diff --git a/decompiler/IR2/Env.cpp b/decompiler/IR2/Env.cpp index c362e4df56..f71c44a079 100644 --- a/decompiler/IR2/Env.cpp +++ b/decompiler/IR2/Env.cpp @@ -66,7 +66,7 @@ void Env::set_remap_for_new_method(const TypeSpec& ts) { void Env::set_remap_for_method(const TypeSpec& ts) { int nargs = ts.arg_count() - 1; - m_var_remap["a0-0"] = "obj"; + m_var_remap["a0-0"] = "this"; for (int i = 1; i < nargs; i++) { m_var_remap[get_reg_name(i)] = ("arg" + std::to_string(i - 1)); } diff --git a/decompiler/IR2/Form.h b/decompiler/IR2/Form.h index 0ff7f1b72b..4ce31eb8ad 100644 --- a/decompiler/IR2/Form.h +++ b/decompiler/IR2/Form.h @@ -438,6 +438,7 @@ class SetFormFormElement : public FormElement { const std::optional& cast_for_define() const { return m_cast_for_define; } void set_cast_for_set(const std::optional& ts) { m_cast_for_set = ts; } void set_cast_for_define(const std::optional& ts) { m_cast_for_define = ts; } + FormElement* make_set_time(const Env& env, FormPool& pool, FormStack& stack); private: int m_real_push_count = 0; @@ -598,6 +599,10 @@ class ConditionElement : public FormElement { FormPool& pool, const std::vector& source_forms, const std::vector& types); + FormElement* make_time_elapsed(const Env& env, + FormPool& pool, + const std::vector& source_forms, + const std::vector& types); bool allow_in_if() const override { return false; } private: @@ -1294,8 +1299,8 @@ class DerefElement : public FormElement { private: ConstantTokenElement* try_as_art_const(const Env& env, FormPool& pool); - GenericElement* try_as_curtime(FormPool& pool); - GenericElement* try_as_seconds_per_frame(FormPool& pool); + GenericElement* try_as_curtime(const Env& env, FormPool& pool); + GenericElement* try_as_seconds_per_frame(const Env& env, FormPool& pool); Form* m_base = nullptr; bool m_is_addr_of = false; diff --git a/decompiler/IR2/FormExpressionAnalysis.cpp b/decompiler/IR2/FormExpressionAnalysis.cpp index 13b2f7f2d7..f7b4989844 100644 --- a/decompiler/IR2/FormExpressionAnalysis.cpp +++ b/decompiler/IR2/FormExpressionAnalysis.cpp @@ -2621,6 +2621,16 @@ void SetVarElement::push_to_stack(const Env& env, FormPool& pool, FormStack& sta } } +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) { + return pool.alloc_element( + GenericOperator::make_function(pool.form("set-time!")), m_dst); + } + return nullptr; +} + void SetFormFormElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stack) { ASSERT(m_popped); ASSERT(m_real_push_count == 0); @@ -2689,6 +2699,12 @@ void SetFormFormElement::push_to_stack(const Env& env, FormPool& pool, FormStack const static InplaceCallInfo in_place_calls[] = {{"seek", "seek!", 0}, {"seekl", "seekl!", 0}}; + auto as_set_time = make_set_time(env, pool, stack); + if (as_set_time) { + stack.push_form_element(as_set_time, true); + return; + } + auto src_as_generic = m_src->try_as_element(); if (src_as_generic) { if (src_as_generic->op().is_func()) { @@ -3926,27 +3942,47 @@ ConstantTokenElement* DerefElement::try_as_art_const(const Env& env, FormPool& p return nullptr; } -GenericElement* DerefElement::try_as_curtime(FormPool& pool) { - auto mr = match(Matcher::deref(Matcher::s6(), false, - {DerefTokenMatcher::string("clock"), - DerefTokenMatcher::string("frame-counter")}), - this); - if (mr.matched) { - return pool.alloc_element( - GenericOperator::make_function(pool.form("current-time"))); +GenericElement* DerefElement::try_as_curtime(const Env& env, FormPool& pool) { + if (env.version == GameVersion::Jak1) { + auto mr = match(Matcher::deref(Matcher::symbol("*display*"), false, + {DerefTokenMatcher::string("base-frame-counter")}), + this); + if (mr.matched) { + return pool.alloc_element( + GenericOperator::make_function(pool.form("current-time"))); + } + } else { + auto mr = match(Matcher::deref(Matcher::s6(), false, + {DerefTokenMatcher::string("clock"), + DerefTokenMatcher::string("frame-counter")}), + this); + if (mr.matched) { + return pool.alloc_element( + GenericOperator::make_function(pool.form("current-time"))); + } } return nullptr; } -GenericElement* DerefElement::try_as_seconds_per_frame(FormPool& pool) { - auto mr = match(Matcher::deref(Matcher::s6(), false, - {DerefTokenMatcher::string("clock"), - DerefTokenMatcher::string("seconds-per-frame")}), - this); - if (mr.matched) { - return pool.alloc_element( - GenericOperator::make_function(pool.form("seconds-per-frame"))); +GenericElement* DerefElement::try_as_seconds_per_frame(const Env& env, FormPool& pool) { + if (env.version == GameVersion::Jak1) { + auto mr = match(Matcher::deref(Matcher::symbol("*display*"), false, + {DerefTokenMatcher::string("seconds-per-frame")}), + this); + if (mr.matched) { + return pool.alloc_element( + GenericOperator::make_function(pool.form("seconds-per-frame"))); + } + } else { + auto mr = match(Matcher::deref(Matcher::s6(), false, + {DerefTokenMatcher::string("clock"), + DerefTokenMatcher::string("seconds-per-frame")}), + this); + if (mr.matched) { + return pool.alloc_element( + GenericOperator::make_function(pool.form("seconds-per-frame"))); + } } return nullptr; } @@ -3987,14 +4023,14 @@ void DerefElement::update_from_stack(const Env& env, } // current-time macro - auto as_curtime = try_as_curtime(pool); + auto as_curtime = try_as_curtime(env, pool); if (as_curtime) { result->push_back(as_curtime); return; } // seconds-per-frame macro - auto as_seconds_per_frame = try_as_seconds_per_frame(pool); + auto as_seconds_per_frame = try_as_seconds_per_frame(env, pool); if (as_seconds_per_frame) { result->push_back(as_seconds_per_frame); return; @@ -5223,6 +5259,48 @@ FormElement* ConditionElement::make_geq_zero_unsigned_check_generic( return pool.alloc_element(GenericOperator::make_fixed(FixedOperatorKind::GEQ), casted); } + +FormElement* ConditionElement::make_time_elapsed(const Env& env, + FormPool& pool, + const std::vector& source_forms, + const std::vector& types) { + // geq case: + // (>= (- (current-time) (-> self state-time)) (seconds 5)) + // to + // (time-elapsed? (-> self state-time) (seconds 5)) + + // lt case: + // (< (- (current-time) (-> self state-time)) (seconds 5)) + // to + // (not (time-elapsed? (-> self state-time) (seconds 5))) + auto matcher = match( + Matcher::op(GenericOpMatcher::fixed(FixedOperatorKind::SUBTRACTION), + {Matcher::op(GenericOpMatcher::func(Matcher::constant_token("current-time")), {}), + Matcher::any(0)}), + source_forms.at(0)); + if (matcher.matched) { + auto time_elapsed = matcher.maps.forms.at(0); + auto time = source_forms.at(1); + std::vector args; + args.push_back(time_elapsed); + args.push_back(time); + if (m_kind == IR2_Condition::Kind::LESS_THAN_SIGNED || + m_kind == IR2_Condition::Kind::LESS_THAN_UNSIGNED) { + return pool.alloc_element( + GenericOperator::make_compare(IR2_Condition::Kind::FALSE), + pool.form( + GenericOperator::make_function(pool.form("time-elapsed?")), + make_casts_if_needed(args, types, TypeSpec("time-frame"), pool, env))); + } else { + return pool.alloc_element( + GenericOperator::make_function(pool.form("time-elapsed?")), + make_casts_if_needed(args, types, TypeSpec("time-frame"), pool, env)); + } + } + + return nullptr; +} + FormElement* ConditionElement::make_generic(const Env& env, FormPool& pool, const std::vector& source_forms, @@ -5248,23 +5326,43 @@ FormElement* ConditionElement::make_generic(const Env& env, case IR2_Condition::Kind::NOT_EQUAL: return make_not_equal_check_generic(env, pool, source_forms, types); - case IR2_Condition::Kind::LESS_THAN_SIGNED: + case IR2_Condition::Kind::LESS_THAN_SIGNED: { + auto time_elapsed = make_time_elapsed(env, pool, source_forms, types); + if (time_elapsed) { + return time_elapsed; + } return pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::LT), make_casts_if_needed(source_forms, types, TypeSpec("int"), pool, env)); - case IR2_Condition::Kind::LESS_THAN_UNSIGNED: + } + case IR2_Condition::Kind::LESS_THAN_UNSIGNED: { + auto time_elapsed = make_time_elapsed(env, pool, source_forms, types); + if (time_elapsed) { + return time_elapsed; + } return pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::LT), make_casts_if_needed(source_forms, types, TypeSpec("uint"), pool, env)); + } - case IR2_Condition::Kind::GEQ_SIGNED: + case IR2_Condition::Kind::GEQ_SIGNED: { + auto time_elapsed = make_time_elapsed(env, pool, source_forms, types); + if (time_elapsed) { + return time_elapsed; + } return pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::GEQ), make_casts_if_needed(source_forms, types, TypeSpec("int"), pool, env)); - case IR2_Condition::Kind::GEQ_UNSIGNED: + } + case IR2_Condition::Kind::GEQ_UNSIGNED: { + auto time_elapsed = make_time_elapsed(env, pool, source_forms, types); + if (time_elapsed) { + return time_elapsed; + } return pool.alloc_element( GenericOperator::make_fixed(FixedOperatorKind::GEQ), make_casts_if_needed(source_forms, types, TypeSpec("uint"), pool, env)); + } case IR2_Condition::Kind::LESS_THAN_ZERO_SIGNED: { return make_less_than_zero_signed_check_generic(env, pool, source_forms, types); diff --git a/decompiler/config/jak1/ntsc_v1/var_names.jsonc b/decompiler/config/jak1/ntsc_v1/var_names.jsonc index 106cc07c5f..c024c3408b 100644 --- a/decompiler/config/jak1/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak1/ntsc_v1/var_names.jsonc @@ -1,6 +1,6 @@ { "identity": { - "args": ["obj"] + "args": ["this"] }, "1/": { @@ -68,7 +68,7 @@ }, "basic-type?": { - "args": ["obj", "parent-type"], + "args": ["this", "parent-type"], "vars": { "v1-0": "obj-type", "a0-1": "end-type" } }, @@ -100,11 +100,11 @@ "vars": { "v0-0": "iter" } }, "member": { - "args": ["obj", "lst"], + "args": ["this", "lst"], "vars": { "v1-0": "iter" } }, "nmember": { - "args": ["obj", "lst"] + "args": ["this", "lst"] }, "assoc": { "args": ["item", "alist"], @@ -150,11 +150,11 @@ }, "(method 0 inline-array-class)": { "args": ["allocation", "type-to-make", "size"], - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, "(method 0 array)": { "args": ["allocation", "type-to-make", "content-type", "len"], - "vars": { "v0-1": "obj" } + "vars": { "v0-1": "this" } }, "(method 2 array)": { @@ -203,18 +203,18 @@ "vars": { "s4-0": "i" } }, "valid?": { - "args": ["obj", "expected-type", "name", "allow-false", "print-dest"], + "args": ["this", "expected-type", "name", "allow-false", "print-dest"], "vars": { "v1-1": "in-goal-mem" } }, // GKERNEL "(method 0 cpu-thread)": { - "vars": { "v0-0": ["obj", "cpu-thread"] } + "vars": { "v0-0": ["this", "cpu-thread"] } }, "inspect-process-heap": { - "vars": { "s5-0": ["obj", "pointer"] } + "vars": { "s5-0": ["this", "pointer"] } }, "(method 23 dead-pool-heap)": { @@ -222,7 +222,7 @@ }, "(method 0 dead-pool-heap)": { - "vars": { "v0-0": ["obj", "dead-pool-heap"] } + "vars": { "v0-0": ["this", "dead-pool-heap"] } }, "seek": { @@ -250,7 +250,7 @@ "(method 0 bit-array)": { "args": ["allocation", "type-to-make", "length"], - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, "(method 12 bit-array)": { @@ -380,7 +380,7 @@ "exit", "event" ], - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, "previous-brother": { @@ -564,7 +564,7 @@ }, "(method 0 trs)": { - "vars": { "gp-0": "obj" } + "vars": { "gp-0": "this" } }, "transform-matrix-calc!": { @@ -746,7 +746,7 @@ "(method 0 cpad-info)": { "args": ["alloction", "type-to-make", "idx"], - "vars": { "s5-0": "obj" } + "vars": { "s5-0": "this" } }, "analog-input": { @@ -797,37 +797,37 @@ }, "(method 9 font-context)": { - "args": ["obj", "mat"] + "args": ["this", "mat"] }, "(method 10 font-context)": { - "args": ["obj", "x", "y"] + "args": ["this", "x", "y"] }, "(method 11 font-context)": { - "args": ["obj", "z"] + "args": ["this", "z"] }, "(method 12 font-context)": { - "args": ["obj", "w"] + "args": ["this", "w"] }, "(method 13 font-context)": { - "args": ["obj", "width"] + "args": ["this", "width"] }, "(method 14 font-context)": { - "args": ["obj", "height"] + "args": ["this", "height"] }, "(method 15 font-context)": { - "args": ["obj", "proj"] + "args": ["this", "proj"] }, "(method 16 font-context)": { - "args": ["obj", "color"] + "args": ["this", "color"] }, "(method 17 font-context)": { - "args": ["obj", "flags"] + "args": ["this", "flags"] }, "(method 18 font-context)": { - "args": ["obj", "start-line"] + "args": ["this", "start-line"] }, "(method 19 font-context)": { - "args": ["obj", "scale"] + "args": ["this", "scale"] }, "(method 0 font-context)": { "args": [ @@ -840,14 +840,14 @@ "color", "flags" ], - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, "font-set-tex0": { "args": ["ptr-tex0", "tex", "tex-addr", "psm", "clut-addr"] }, "(method 0 display-frame)": { - "vars": { "gp-0": "obj" } + "vars": { "gp-0": "this" } }, "(method 0 draw-context)": { @@ -864,11 +864,11 @@ "(method 0 display)": { "args": ["allocation", "type-to-make", "psm", "w", "h", "ztest", "zpsm"], - "vars": { "gp-0": "obj" } + "vars": { "gp-0": "this" } }, "(method 0 ripple-control)": { - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, "vector-seek-2d-xz-smooth!": { @@ -968,26 +968,26 @@ "(method 0 load-dir)": { "args": ["allocation", "type-to-make", "length", "unk"], - "vars": { "s4-0": "obj" } + "vars": { "s4-0": "this" } }, "(method 0 load-dir-art-group)": { "args": ["allocation", "type-to-make", "length", "unk"], - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, "(method 0 external-art-buffer)": { "args": ["allocation", "type-to-make", "idx"], - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, "(method 0 external-art-control)": { - "vars": { "gp-0": "obj", "s4-0": "buff-idx", "v1-9": "rec-idx" } + "vars": { "gp-0": "this", "s4-0": "buff-idx", "v1-9": "rec-idx" } }, "(method 9 display)": { - "args": ["obj", "slowdown"], - "vars": { "gp-0": "obj", "s5-0": "ratio" } + "args": ["this", "slowdown"], + "vars": { "gp-0": "this", "s5-0": "ratio" } }, "set-draw-env-offset": { @@ -1011,12 +1011,12 @@ }, "(method 11 profile-bar)": { - "args": ["obj", "name", "color"], + "args": ["this", "name", "color"], "vars": { "s5-0": "new-frame" } }, "(method 12 profile-bar)": { - "args": ["obj", "name", "color"], + "args": ["this", "name", "color"], "vars": { "v0-0": "new-frame" } }, @@ -1059,7 +1059,7 @@ "height", "color-0" ], - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, "draw-context-set-xy": { @@ -1115,23 +1115,23 @@ }, "(method 15 texture-pool)": { - "args": ["obj", "word-count"] + "args": ["this", "word-count"] }, "(method 22 texture-pool)": { - "args": ["obj", "tpage-id"] + "args": ["this", "tpage-id"] }, "(method 10 texture-page)": { - "args": ["obj", "segment-count", "additional-size"] + "args": ["this", "segment-count", "additional-size"] }, "(method 16 texture-pool)": { - "args": ["obj", "segment", "size"] + "args": ["this", "segment", "size"] }, "(method 9 texture-page)": { - "args": ["obj", "seg"] + "args": ["this", "seg"] }, "texture-page-default-allocate": { @@ -1145,7 +1145,7 @@ }, "(method 12 texture-page)": { - "args": ["obj", "new-dest", "seg-id"], + "args": ["this", "new-dest", "seg-id"], "vars": { "a3-4": "dst-block", "t0-1": "tex-id", @@ -1280,7 +1280,7 @@ }, "(method 13 texture-pool)": { - "args": ["obj", "level", "max-page-kind", "id-array"], + "args": ["this", "level", "max-page-kind", "id-array"], "vars": { "v1-0": "page-idx", "v1-5": "tfrag-dir-entry", @@ -1293,7 +1293,7 @@ }, "(method 14 texture-pool)": { - "args": ["obj", "level", "tex-page-kind"], + "args": ["this", "level", "tex-page-kind"], "vars": { "s3-0": "tfrag-page", "s2-0": "tfrag-bucket", @@ -1315,7 +1315,7 @@ }, "(method 13 texture-page)": { - "args": ["obj", "dma-buff", "mode"], + "args": ["this", "dma-buff", "mode"], "vars": { "sv-16": "total-size", "v1-7": "start-segment", @@ -1369,7 +1369,7 @@ }, "(method 9 texture-page-dir)": { - "args": ["obj", "heap"], + "args": ["this", "heap"], "vars": { "v1-0": "mem-start", "a1-1": "mem-end", @@ -1419,7 +1419,7 @@ }, "(method 9 __assert-info-private-struct)": { - "args": ["obj", "filename", "line-num", "column-num"] + "args": ["this", "filename", "line-num", "column-num"] }, "__assert": { @@ -1520,7 +1520,7 @@ }, "(method 13 profile-bar)": { - "args": ["obj", "buf", "bar-pos"], + "args": ["this", "buf", "bar-pos"], "vars": { "v1-1": "height", "a1-4": "block-idx", @@ -1609,16 +1609,16 @@ "(method 0 engine)": { "args": ["allocation", "type-to-make", "name", "length"], - "vars": { "v0-0": "obj", "v1-11": "idx-to-link", "a0-1": "end-idx" } + "vars": { "v0-0": "this", "v1-11": "idx-to-link", "a0-1": "end-idx" } }, "(method 10 engine)": { - "args": ["obj", "f"], + "args": ["this", "f"], "vars": { "a0-1": "current", "s4-0": "next" } }, "(method 11 engine)": { - "args": ["obj", "f"], + "args": ["this", "f"], "vars": { "s4-0": "iter" } }, @@ -1631,12 +1631,12 @@ }, "(method 19 engine)": { - "args": ["obj", "p1-value"], + "args": ["this", "p1-value"], "vars": { "a0-1": "current", "s4-0": "next" } }, "(method 20 engine)": { - "args": ["obj", "p2-value"], + "args": ["this", "p2-value"], "vars": { "a0-1": "current", "s4-0": "next" } }, @@ -1646,7 +1646,7 @@ }, "(method 15 engine)": { - "args": ["obj", "proc", "func", "p1", "p2", "p3"], + "args": ["this", "proc", "func", "p1", "p2", "p3"], "vars": { "v1-0": "con" } }, @@ -1664,15 +1664,15 @@ "(method 0 collide-shape-prim-sphere)": { "args": ["allocation", "type-to-make", "cshape", "prim-id"], - "vars": { "v0-0": ["obj", "collide-shape-prim-sphere"] } + "vars": { "v0-0": ["this", "collide-shape-prim-sphere"] } }, "(method 0 collide-shape-prim-mesh)": { "args": ["allocation", "type-to-make", "cshape", "mesh-id", "prim-id"], - "vars": { "v0-0": ["obj", "collide-shape-prim-mesh"] } + "vars": { "v0-0": ["this", "collide-shape-prim-mesh"] } }, "(method 0 collide-shape-prim-group)": { "args": ["allocation", "type-to-make", "cshape", "elt-count", "prim-id"], - "vars": { "v0-0": ["obj", "collide-shape-prim-group"] } + "vars": { "v0-0": ["this", "collide-shape-prim-group"] } }, "(method 0 collide-shape)": { "args": [ @@ -1682,16 +1682,16 @@ "collide-list-kind", "prim-id" ], - "vars": { "s5-0": "obj" } + "vars": { "s5-0": "this" } }, "(method 0 collide-sticky-rider-group)": { - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, "(method 11 touching-prims-entry-pool)": { "vars": { "a1-0": "current", "v1-0": "prev", "a2-0": "next" } }, "(method 0 touching-list)": { - "vars": { "v0-0": ["obj", "touching-list"] } + "vars": { "v0-0": ["this", "touching-list"] } }, "cspace-by-name-no-fail": { @@ -1704,7 +1704,7 @@ }, "shrubbery-login-post-texture": { - "args": ["obj"], + "args": ["this"], "vars": { "v1-1": "shader-count", "a1-1": ["dst", "qword"], @@ -1717,7 +1717,7 @@ }, "(method 20 actor-link-info)": { - "args": ["obj", "message"], + "args": ["this", "message"], "vars": { "s4-0": "iter", "s5-0": "result", @@ -1737,7 +1737,7 @@ }, "(method 21 level-group)": { - "args": ["obj", "name", "cmd-idx"], + "args": ["this", "name", "cmd-idx"], "vars": { "v1-1": "cmd-lst" } }, @@ -1752,16 +1752,16 @@ "center", "fade" ], - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, // RES "(method 0 res-lump)": { "args": ["allocation", "type-to-make", "data-count", "data-size"], - "vars": { "v0-0": "obj" } + "vars": { "v0-0": "this" } }, "(method 20 res-lump)": { - "args": ["obj", "time", "result", "buf"], + "args": ["this", "time", "result", "buf"], "vars": { "t0-2": "tag-lo", "t1-2": "tag-hi", @@ -1775,15 +1775,15 @@ "vars": { "s5-0": "i" } }, "(method 9 res-lump)": { - "args": ["obj", "name", "mode", "time", "default", "tag-addr", "buf-addr"], + "args": ["this", "name", "mode", "time", "default", "tag-addr", "buf-addr"], "vars": { "s3-0": "tag-pair" } }, "(method 10 res-lump)": { - "args": ["obj", "name", "mode", "time", "default", "tag-addr", "buf-addr"], + "args": ["this", "name", "mode", "time", "default", "tag-addr", "buf-addr"], "vars": { "s3-0": "tag-pair", "v1-4": "tag" } }, "(method 11 res-lump)": { - "args": ["obj", "name", "mode", "time", "default", "tag-addr", "buf-addr"], + "args": ["this", "name", "mode", "time", "default", "tag-addr", "buf-addr"], "vars": { "a2-1": "tag-pair", "s1-0": "tag", @@ -1792,7 +1792,7 @@ } }, "(method 12 res-lump)": { - "args": ["obj", "name", "mode", "time", "default", "tag-addr", "buf-addr"], + "args": ["this", "name", "mode", "time", "default", "tag-addr", "buf-addr"], "vars": { "a2-1": "tag-pair", "s1-0": "tag", @@ -1828,7 +1828,7 @@ }, "(method 8 res-lump)": { - "args": ["obj", "block", "flags"], + "args": ["this", "block", "flags"], "vars": { "s3-0": "mem-use-id", "s2-0": "mem-use-name", @@ -1840,11 +1840,11 @@ // FACT-H "(method 0 fact-info-target)": { - "vars": { "gp-0": "obj" } + "vars": { "gp-0": "this" } }, "(method 0 fact-info-enemy)": { "vars": { - "gp-0": "obj", + "gp-0": "this", "s5-0": "entity" } }, @@ -1852,14 +1852,14 @@ "(method 0 fact-info)": { "args": ["allocation", "type-to-make", "proc", "pkup-type", "pkup-amount"], "vars": { - "gp-0": ["obj", "fact-info"], + "gp-0": ["this", "fact-info"], "s5-0": "ent", "sv-16": "tag" } }, "(method 0 align-control)": { - "vars": { "v0-0": ["obj", "align-control"] } + "vars": { "v0-0": ["this", "align-control"] } }, "str-load": { @@ -1944,7 +1944,7 @@ }, "(method 19 res-lump)": { - "args": ["obj", "name-sym", "mode", "time"], + "args": ["this", "name-sym", "mode", "time"], "vars": { "t2-4": "type-chars", "t3-1": "max-search", @@ -1970,7 +1970,7 @@ "(method 0 joint-mod)": { "args": ["allocation", "type-to-make", "mode", "proc", "joint-idx"], "vars": { - "gp-0": "obj", + "gp-0": "this", "v1-7": "twist-max" } }, @@ -1980,19 +1980,19 @@ }, "(method 9 joint-mod)": { - "args": ["obj", "handler-mode"], + "args": ["this", "handler-mode"], "vars": { "v1-0": "joint", "a0-1": "mode" } }, "(method 10 joint-mod)": { - "args": ["obj", "target-trans"], + "args": ["this", "target-trans"], "vars": { "f0-0": "distance" } }, - "(method 13 joint-mod)": { "args": ["obj", "x", "y", "z"] }, - "(method 14 joint-mod)": { "args": ["obj", "trans", "rot", "scale"] }, + "(method 13 joint-mod)": { "args": ["this", "x", "y", "z"] }, + "(method 14 joint-mod)": { "args": ["this", "trans", "rot", "scale"] }, "(method 11 joint-mod)": { - "args": ["obj", "target-trans", "option", "proc"], + "args": ["this", "target-trans", "option", "proc"], "vars": { "s1-0": "proc-drawable", "s3-1": ["enemy-facts", "fact-info-enemy"], @@ -2002,7 +2002,7 @@ "joint-mod-look-at-handler": { "args": ["csp", "xform", "mat"] }, "(method 9 collide-history)": { - "args": ["obj", "cshape", "xs", "transv", "transv-out"] + "args": ["this", "cshape", "xs", "transv", "transv-out"] }, "add-debug-sphere-from-table": { @@ -2015,7 +2015,7 @@ "(method 0 actor-link-info)": { "args": ["allocation", "type-to-make", "proc"], - "vars": { "s5-0": "obj", "a0-1": "ent" } + "vars": { "s5-0": "this", "a0-1": "ent" } }, "(method 25 actor-link-info)": { @@ -2023,7 +2023,7 @@ }, "(method 9 actor-link-info)": { - "args": ["obj", "matching-type"], + "args": ["this", "matching-type"], "vars": { "s3-0": "actor", "s5-0": "mask", "s4-0": "current-bit" } }, @@ -2115,7 +2115,7 @@ "vars": { "v1-0": ["cmd", "sound-rpc-set-flava"] } }, "(method 0 ambient-sound)": { - "vars": { "s5-1": ["obj", "ambient-sound"], "v1-2": "bc" } + "vars": { "s5-1": ["this", "ambient-sound"], "v1-2": "bc" } }, "(method 9 ambient-sound)": { "vars": { "s5-1": "spec", "s4-2": "spec-volume" } @@ -2133,7 +2133,7 @@ "(method 0 path-control)": { "args": ["allocation", "type-to-make", "proc", "name", "time"], "vars": { - "gp-0": ["obj", "path-control"], + "gp-0": ["this", "path-control"], "s3-1": "ent", "v1-7": "lookup-entity", "sv-16": "tag", @@ -2143,7 +2143,7 @@ "(method 0 curve-control)": { "args": ["allocation", "type-to-make", "proc", "name", "time"], - "vars": { "gp-0": "obj", "s3-1": "ent", "v1-3": "lookup-entity" } + "vars": { "gp-0": "this", "s3-1": "ent", "v1-3": "lookup-entity" } }, "nav-mesh-connect": { @@ -2163,7 +2163,7 @@ "sphere-count", "nearest-y-threshold-default" ], - "vars": { "s5-0": ["obj", "nav-control"], "a0-3": "ent" } + "vars": { "s5-0": ["this", "nav-control"], "a0-3": "ent" } }, "add-debug-point": { @@ -2278,7 +2278,7 @@ }, "(method 9 game-info)": { - "args": ["obj", "cause", "save-to-load", "continue-point-override"], + "args": ["this", "cause", "save-to-load", "continue-point-override"], "vars": { "v1-0": "selected-cause", "s4-1": "lev-info" @@ -2286,7 +2286,7 @@ }, "(method 10 game-info)": { - "args": ["obj", "item", "amount", "source"], + "args": ["this", "item", "amount", "source"], "vars": { "v1-10": "proc", "s4-1": "level-idx", @@ -2299,7 +2299,7 @@ }, "(method 14 game-info)": { - "args": ["obj", "lev"], + "args": ["this", "lev"], "vars": { "s5-0": "perms", "s4-0": "lev-entities", @@ -2310,7 +2310,7 @@ }, "(method 15 game-info)": { - "args": ["obj", "lev"], + "args": ["this", "lev"], "vars": { "s5-0": "lev-entities", "s4-0": "lev-entity-idx", @@ -2320,7 +2320,7 @@ }, "(method 25 game-info)": { - "args": ["obj", "save"], + "args": ["this", "save"], "vars": { "v1-0": ["save-data", "game-save-tag"], "s4-0": ["data", "game-save-tag"], @@ -2330,7 +2330,7 @@ }, "(method 10 game-save)": { - "args": ["obj", "filename"], + "args": ["this", "filename"], "vars": { "s5-0": "stream", "s3-0": "in-size", @@ -2339,7 +2339,7 @@ }, "(method 11 game-save)": { - "args": ["obj", "detail"], + "args": ["this", "detail"], "vars": { "s4-0": ["tag", "game-save-tag"], "s3-0": "tag-idx", @@ -2427,7 +2427,7 @@ }, "(method 11 cam-float-seeker)": { - "args": ["obj", "offset"], + "args": ["this", "offset"], "vars": { "f1-2": "pos-error", "f0-5": "partial-velocity-limit", @@ -2439,7 +2439,7 @@ }, "(method 9 trsqv)": { - "args": ["obj", "dir", "vel", "frame-count"], + "args": ["this", "dir", "vel", "frame-count"], "vars": { "f0-0": "yaw-error", "f1-2": "yaw-limit", @@ -2450,7 +2450,7 @@ }, "(method 13 trsqv)": { - "args": ["obj", "yaw", "vel", "frame-count"] + "args": ["this", "yaw", "vel", "frame-count"] }, "(method 16 trsqv)": { @@ -2475,7 +2475,7 @@ }, "(method 17 trsqv)": { - "args": ["obj", "target", "y-rate", "z-rate"], + "args": ["this", "target", "y-rate", "z-rate"], "vars": { "gp-0": "quat", "s5-0": "temp-quat" @@ -2509,7 +2509,7 @@ }, "(method 10 cylinder)": { - "args": ["obj", "probe-origin", "probe-dir"], + "args": ["this", "probe-origin", "probe-dir"], "vars": { "f30-0": "result", "f0-5": "u-origin-sph", @@ -2519,7 +2519,7 @@ }, "(method 10 cylinder-flat)": { - "args": ["obj", "probe-origin", "probe-dir"], + "args": ["this", "probe-origin", "probe-dir"], "vars": { "f30-0": "result", "f0-5": "u-origin-circle", @@ -2750,11 +2750,11 @@ }, "(method 8 bsp-header)": { - "args": ["obj", "mem-use", "flags"] + "args": ["this", "mem-use", "flags"] }, "(method 10 bsp-header)": { - "args": ["obj", "other-draw", "disp-frame"], + "args": ["this", "other-draw", "disp-frame"], "vars": { "s4-0": "lev", "a2-3": "vis-list-qwc", @@ -2828,7 +2828,7 @@ }, "(method 14 sync-info)": { - "args": ["obj", "period", "phase"], + "args": ["this", "period", "phase"], "vars": { "f0-1": "period-float", "f1-1": "value" @@ -2836,7 +2836,7 @@ }, "(method 14 sync-info-eased)": { - "args": ["obj", "period", "phase", "out-param", "in-param"], + "args": ["this", "period", "phase", "out-param", "in-param"], "vars": { "f0-9": "total-easing-phase", "f1-11": "total-normal-phase", @@ -2847,12 +2847,12 @@ }, "(method 14 sync-info-paused)": { - "args": ["obj", "period", "phase", "out-param", "in-param"] + "args": ["this", "period", "phase", "out-param", "in-param"] }, "(method 15 sync-info)": { "args": [ - "obj", + "this", "proc", "default-period", "default-phase", @@ -2863,7 +2863,7 @@ "(method 15 sync-info-eased)": { "args": [ - "obj", + "this", "proc", "default-period", "default-phase", @@ -2874,7 +2874,7 @@ "(method 15 sync-info-paused)": { "args": [ - "obj", + "this", "proc", "default-period", "default-phase", @@ -2892,7 +2892,7 @@ }, "(method 16 sync-info)": { - "args": ["obj", "user-time-offset"], + "args": ["this", "user-time-offset"], "vars": { "a2-0": "period", "f0-1": "period-float", @@ -2922,7 +2922,7 @@ }, "(method 9 sync-info)": { - "args": ["obj", "max-val"], + "args": ["this", "max-val"], "vars": { "v1-0": "period", "f0-1": "period-float", @@ -2931,7 +2931,7 @@ }, "(method 13 sync-info)": { - "args": ["obj"], + "args": ["this"], "vars": { "v1-0": "period", "f1-0": "period-float", @@ -2942,7 +2942,7 @@ }, "(method 13 sync-info-eased)": { - "args": ["obj"], + "args": ["this"], "vars": { "v1-0": "period", "f1-0": "period-float", @@ -2956,7 +2956,7 @@ }, "(method 12 sync-info)": { - "args": ["obj", "max-out-val"], + "args": ["this", "max-out-val"], "vars": { "v1-0": "period", "f1-0": "period-float", @@ -2967,28 +2967,28 @@ }, "(method 12 sync-info-eased)": { - "args": ["obj", "max-out-val"] + "args": ["this", "max-out-val"] }, "(method 12 sync-info-paused)": { - "args": ["obj", "max-out-val"] + "args": ["this", "max-out-val"] }, "(method 9 delayed-rand-float)": { - "args": ["obj", "min-tim", "max-time", "max-times-two"] + "args": ["this", "min-tim", "max-time", "max-times-two"] }, "(method 10 oscillating-float)": { - "args": ["obj", "target-offset"], + "args": ["this", "target-offset"], "vars": { "f0-3": "acc" } }, "(method 9 oscillating-float)": { - "args": ["obj", "init-val", "accel", "max-vel", "damping"] + "args": ["this", "init-val", "accel", "max-vel", "damping"] }, "(method 9 bouncing-float)": { "args": [ - "obj", + "this", "init-val", "max-val", "min-val", @@ -3000,38 +3000,38 @@ }, "(method 9 delayed-rand-vector)": { - "args": ["obj", "min-time", "max-time", "xz-range", "y-range"] + "args": ["this", "min-time", "max-time", "xz-range", "y-range"] }, "(method 9 oscillating-vector)": { - "args": ["obj", "init-val", "accel", "max-vel", "damping"] + "args": ["this", "init-val", "accel", "max-vel", "damping"] }, "(method 10 oscillating-vector)": { - "args": ["obj", "target-offset"], + "args": ["this", "target-offset"], "vars": { "f0-2": "vel" } }, "(method 9 trajectory)": { - "args": ["obj", "time", "result"] + "args": ["this", "time", "result"] }, "(method 10 trajectory)": { - "args": ["obj", "time", "result"] + "args": ["this", "time", "result"] }, "(method 11 trajectory)": { - "args": ["obj", "from", "to", "duration", "grav"], + "args": ["this", "from", "to", "duration", "grav"], "vars": { "f0-3": "xz-vel" } }, "(method 12 trajectory)": { - "args": ["obj", "from", "to", "xz-vel", "grav"], + "args": ["this", "from", "to", "xz-vel", "grav"], "vars": { "f0-1": "duration" } }, "(method 13 trajectory)": { - "args": ["obj", "from", "to", "y-vel", "grav"] + "args": ["this", "from", "to", "y-vel", "grav"] }, "(method 15 trajectory)": { @@ -3143,7 +3143,7 @@ }, "(method 16 level)": { - "args": ["obj", "vis-info"], + "args": ["this", "vis-info"], "vars": { "a0-1": "cam-leaf-idx", "v1-1": "curr-vis-str", @@ -3238,7 +3238,7 @@ }, "(method 11 fact-info-target)": { - "args": ["obj", "kind", "amount", "source-handle"], + "args": ["this", "kind", "amount", "source-handle"], "vars": { "f0-29": "buzz-count", "f30-0": "eco-lev" } }, @@ -3320,15 +3320,15 @@ }, "(method 29 entity-actor)": { - "args": ["obj", "mode", "expected-type"] + "args": ["this", "mode", "expected-type"] }, "(method 13 level-group)": { - "args": ["obj", "mode", "expected-type"] + "args": ["this", "mode", "expected-type"] }, "(method 24 entity)": { - "args": ["obj", "lev-group", "lev", "aid"], + "args": ["this", "lev-group", "lev", "aid"], "vars": { "v1-4": "level-link", "t0-5": "other-prev", @@ -3428,7 +3428,7 @@ }, "(method 48 progress)": { - "args": ["obj", "screen", "option"] + "args": ["this", "screen", "option"] }, "activate-progress": { @@ -3436,7 +3436,7 @@ }, "(method 23 progress)": { - "args": ["obj", "aspect", "video-mode"] + "args": ["this", "aspect", "video-mode"] }, "(method 35 progress)": { @@ -3576,7 +3576,7 @@ }, "(method 9 load-dir-art-group)": { - "args": ["obj", "art-name", "do-reload", "heap", "version"] + "args": ["this", "art-name", "do-reload", "heap", "version"] }, "(method 15 hud-money)": { diff --git a/decompiler/config/jak2/ntsc_v1/var_names.jsonc b/decompiler/config/jak2/ntsc_v1/var_names.jsonc index b6703cbf9e..b9e0e722a3 100644 --- a/decompiler/config/jak2/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak2/ntsc_v1/var_names.jsonc @@ -9,16 +9,16 @@ }, "(method 0 lightning-control)": { "vars": { - "gp-0": ["obj", "lightning-control"] + "gp-0": ["this", "lightning-control"] } }, "(method 0 align-control)": { "vars": { - "v0-0": ["obj", "align-control"] + "v0-0": ["this", "align-control"] } }, "(method 16 nav-mesh)": { - "args": ["obj", "ray"], + "args": ["this", "ray"], "vars": { "sv-16": "next-poly-idx", "sv-24": "work", @@ -198,10 +198,10 @@ } }, "(method 10 mood-control)": { - "args": ["obj", "cloud-target", "fog-target", "cloud-speed", "fog-speed"] + "args": ["this", "cloud-target", "fog-target", "cloud-speed", "fog-speed"] }, "(method 11 mood-control)": { - "args": ["obj", "min-cloud", "max-cloud", "min-fog", "max-fog"] + "args": ["this", "min-cloud", "max-cloud", "min-fog", "max-fog"] }, "copy-mood-exterior": { "vars": { @@ -231,7 +231,7 @@ } }, "(method 10 cylinder)": { - "args": ["obj", "ray1", "ray2"] + "args": ["this", "ray1", "ray2"] }, "ripple-make-request": { "args": ["waveform", "effect"] @@ -770,20 +770,20 @@ "args": ["bx", "by", "fmt"] }, "(method 18 texture-pool)": { - "args": ["obj", "tpage-id"] + "args": ["this", "tpage-id"] }, "(method 10 texture-page)": { - "args": ["obj", "num-segments", "upload-offset"], + "args": ["this", "num-segments", "upload-offset"], "vars": { "v1-0": "offset", "a2-1": "i" } }, "(method 16 texture-pool)": { - "args": ["obj", "seg", "num-words"] + "args": ["this", "seg", "num-words"] }, "(method 9 texture-page)": { - "args": ["obj", "heap"] + "args": ["this", "heap"] }, "texture-page-default-allocate": { "args": ["pool", "tpage", "heap", "tpage-id"], @@ -934,7 +934,7 @@ "args": ["dma-buff", "tex", "dest-loc", "dest-fmt", "clut-dst"] }, "(method 11 texture-page)": { - "args": ["obj", "new-dest", "segs"], + "args": ["this", "new-dest", "segs"], "vars": { "v1-0": "new-tbp", "a3-4": "old-tbp", @@ -945,7 +945,7 @@ } }, "(method 7 texture-page)": { - "args": ["obj", "loading-heap", "name"], + "args": ["this", "loading-heap", "name"], "vars": { "v1-2": "loading-level", "a3-0": "tpage-id", @@ -962,7 +962,7 @@ } }, "(method 9 texture-page-dir)": { - "args": ["obj", "heap"], + "args": ["this", "heap"], "vars": { "v1-0": "mem-start", "a1-1": "mem-end", @@ -1202,16 +1202,16 @@ } }, "(method 15 mysql-nav-graph)": { - "args": ["obj", "edge-id", "node-id"] + "args": ["this", "edge-id", "node-id"] }, "(method 16 mysql-nav-graph)": { - "args": ["obj", "edge-id", "node-id"] + "args": ["this", "edge-id", "node-id"] }, "(method 11 mysql-nav-graph)": { - "args": ["obj", "node-id"] + "args": ["this", "node-id"] }, "(method 12 mysql-nav-graph)": { - "args": ["obj", "edge-id"] + "args": ["this", "edge-id"] }, "(method 19 mysql-nav-graph)": { "vars": { @@ -1399,17 +1399,17 @@ } }, "(method 10 path-control)": { - "args": ["obj", "ret", "idx", "search-type"], + "args": ["this", "ret", "idx", "search-type"], "vars": { "a1-1": "num-vertices", "f0-3": "vert-idx" } }, "(method 14 path-control)": { - "args": ["obj", "ret", "percent", "search-type"] + "args": ["this", "ret", "percent", "search-type"] }, "(method 26 path-control)": { - "args": ["obj", "ret", "idx", "mag"], + "args": ["this", "ret", "idx", "mag"], "vars": { "v1-0": "num-vertices", "f0-3": "vert-idx", @@ -1417,31 +1417,31 @@ } }, "(method 13 curve-control)": { - "args": ["obj", "ret", "idx"] + "args": ["this", "ret", "idx"] }, "(method 16 curve-control)": { - "args": ["obj", "ret", "percent"] + "args": ["this", "ret", "percent"] }, "(method 15 curve-control)": { - "args": ["obj", "ret", "idx", "mag"] + "args": ["this", "ret", "idx", "mag"] }, "(method 12 path-control)": { - "args": ["obj", "ret", "idx", "mag"] + "args": ["this", "ret", "idx", "mag"] }, "(method 15 path-control)": { - "args": ["obj", "ret", "percent", "mag"] + "args": ["this", "ret", "percent", "mag"] }, "(method 13 path-control)": { - "args": ["obj", "ret", "idx"] + "args": ["this", "ret", "idx"] }, "(method 12 curve-control)": { - "args": ["obj", "ret", "percent", "mag"] + "args": ["this", "ret", "percent", "mag"] }, "(method 16 path-control)": { - "args": ["obj", "ret", "percent", "mag"] + "args": ["this", "ret", "percent", "mag"] }, "(method 22 path-control)": { - "args": ["obj", "point"], + "args": ["this", "point"], "vars": { "f30-0": "furthest-dist", "s3-0": "given-point", @@ -1454,13 +1454,13 @@ } }, "(method 23 path-control)": { - "args": ["obj", "point"] + "args": ["this", "point"] }, "(method 11 memory-usage-block)": { - "args": ["obj", "level", "fmt-dest"] + "args": ["this", "level", "fmt-dest"] }, "(method 14 level)": { - "args": ["obj", "force?"] + "args": ["this", "force?"] }, "mem-size": { "args": ["data", "inspect-usage?", "arg2"], @@ -1497,13 +1497,13 @@ "args": ["tv-format"] }, "(method 41 nav-graph)": { - "args": ["obj", "idx"] + "args": ["this", "idx"] }, "(method 18 nav-node)": { - "args": ["obj", "ret"] + "args": ["this", "ret"] }, "(method 10 align-control)": { - "args": ["obj", "options", "x", "y", "z"], + "args": ["this", "options", "x", "y", "z"], "vars": { "a0-1": "process", "t9-0": "method-call", @@ -1512,13 +1512,13 @@ } }, "(method 26 trsqv)": { - "args": ["obj", "unkBitfield", "limit"], + "args": ["this", "unkBitfield", "limit"], "vars": { "a0-1": "transv" } }, "(method 19 nav-node)": { - "args": ["obj", "ret"], + "args": ["this", "ret"], "vars": { "f0-1": "angle", "s5-0": "sin-cos-result" @@ -1534,7 +1534,7 @@ } }, "(method 16 level)": { - "args": ["obj", "vis-info", "unused", "in-bsp-vis-string"], + "args": ["this", "vis-info", "unused", "in-bsp-vis-string"], "vars": { "a0-1": "cam-leaf-idx", "v1-1": "curr-vis-string-offset", @@ -1628,14 +1628,14 @@ } }, "(method 27 elec-gate)": { - "args": ["obj", "sparticle-lc"] + "args": ["this", "sparticle-lc"] }, "(method 7 elec-gate)": { "vars": { "v1-0": "bolt-idx", "a2-2": "left-bolt" }, - "args": ["obj", "new-addr"] + "args": ["this", "new-addr"] }, "(method 11 elec-gate)": { "vars": { @@ -1645,7 +1645,7 @@ } }, "(method 29 fort-elec-gate)": { - "args": ["obj", "scale"] + "args": ["this", "scale"] }, "(event idle blocking-plane)": { "vars": { @@ -1658,7 +1658,7 @@ } }, "(method 21 blocking-plane)": { - "args": ["obj", "vec-pair", "height"] + "args": ["this", "vec-pair", "height"] }, "blocking-plane-init-by-other": { "args": ["vec-pair", "height"] @@ -1729,7 +1729,7 @@ } }, "(method 37 basebutton)": { - "args": ["obj", "vec", "quat"] + "args": ["this", "vec", "quat"] }, "(event up-idle basebutton)": { "vars": { @@ -1752,7 +1752,7 @@ } }, "(method 38 basebutton)": { - "args": ["obj", "pressed?"] + "args": ["this", "pressed?"] }, "(method 33 basebutton)": { "vars": { @@ -1778,7 +1778,7 @@ ] }, "(method 36 basebutton)": { - "args": ["obj", "event-type"], + "args": ["this", "event-type"], "vars": { "a1-1": "event", "a1-2": "event", @@ -1802,7 +1802,7 @@ "vars": { "a1-4": "params" }, - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "(event idle drop-plat)": { "vars": { @@ -1824,7 +1824,7 @@ } }, "(method 7 conveyor)": { - "args": ["obj", "new-addr"] + "args": ["this", "new-addr"] }, "(method 24 conveyor)": { "vars": { @@ -1848,7 +1848,7 @@ "v1-8": "section", "a1-3": "vec-temp" }, - "args": ["obj", "proc-focus"] + "args": ["this", "proc-focus"] }, "(method 48 elevator)": { "vars": { @@ -1903,27 +1903,27 @@ } }, "(method 11 elevator)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s5-1": "num-path-points", "s3-1": "path-point-idx" } }, "(method 39 elevator)": { - "args": ["obj", "path-point-x", "path-point-y"], + "args": ["this", "path-point-x", "path-point-y"], "vars": { "s3-0": "point-x", "a1-3": "point-y" } }, "(method 16 drawable-region-prim)": { - "args": ["obj", "area-of-interest", "_count", "region-list"], + "args": ["this", "area-of-interest", "_count", "region-list"], "vars": { "s2-0": "count" } }, "(method 9 region-prim-area)": { - "args": ["obj", "region-sphere"], + "args": ["this", "region-sphere"], "vars": { "v1-0": "regions-entered", "a2-0": "region", @@ -1955,13 +1955,13 @@ "vars": { "s4-0": "area-of-interest" }, - "args": ["obj", "area"] + "args": ["this", "area"] }, "(method 19 drawable-region-sphere)": { - "args": ["obj", "area"] + "args": ["this", "area"] }, "(method 18 drawable-region-volume)": { - "args": ["obj", "area"] + "args": ["this", "area"] }, "add-debug-bound-internal": { "args": ["buf", "pts", "num-pts", "color0", "color1", "flip-tex"] @@ -1980,14 +1980,14 @@ } }, "(method 8 prototype-array-tie)": { - "args": ["obj", "usage", "arg2"], + "args": ["this", "usage", "arg2"], "vars": { "s3-0": "tie-idx", "v1-8": "size-of-tie" } }, "(method 8 prototype-bucket-tie)": { - "args": ["obj", "usage", "arg2"], + "args": ["this", "usage", "arg2"], "vars": { "v1-13": "name-size", "v1-25": "color-size", @@ -1996,14 +1996,14 @@ } }, "(method 8 prototype-inline-array-shrub)": { - "args": ["obj", "usage", "arg2"], + "args": ["this", "usage", "arg2"], "vars": { "v1-8": "shrub-size", "s3-0": "idx" } }, "(method 8 prototype-bucket-shrub)": { - "args": ["obj", "usage", "arg2"], + "args": ["this", "usage", "arg2"], "vars": { "s3-0": "idx", "v1-22": "name-size", @@ -2021,7 +2021,7 @@ "args": ["drawable", "tie"] }, "(method 9 los-control)": { - "args": ["obj", "process", "trans-vec", "radius"], + "args": ["this", "process", "trans-vec", "radius"], "vars": { "s2-0": "process-focus", "s1-0": "process-source", @@ -2033,25 +2033,25 @@ } }, "(method 12 los-control)": { - "args": ["obj", "dst"] + "args": ["this", "dst"] }, "(method 13 los-control)": { - "args": ["obj", "proc", "check-interval", "c-spec"] + "args": ["this", "proc", "check-interval", "c-spec"] }, "(method 9 enemy-info)": { - "args": ["obj", "obj-to-copy"] + "args": ["this", "obj-to-copy"] }, "(method 119 enemy)": { - "args": ["obj", "high"] + "args": ["this", "high"] }, "(method 118 enemy)": { - "args": ["obj", "low", "high"] + "args": ["this", "low", "high"] }, "(method 121 enemy)": { - "args": ["obj", "low", "high"] + "args": ["this", "low", "high"] }, "(method 122 enemy)": { - "args": ["obj", "chance"] + "args": ["this", "chance"] }, "(method 12 enemy)": { "vars": { @@ -2059,13 +2059,13 @@ } }, "(method 53 enemy)": { - "args": ["obj", "proc-focus"] + "args": ["this", "proc-focus"] }, "(method 10 nav-enemy-info)": { - "args": ["obj", "obj-to-copy"] + "args": ["this", "obj-to-copy"] }, "(method 44 nav-state)": { - "args": ["obj", "velocity"] + "args": ["this", "velocity"] }, "scene-looper-init-by-other": { "args": ["scene-name"] @@ -2079,10 +2079,10 @@ "args": ["scene-name"] }, "(method 7 rigid-body-platform)": { - "args": ["obj", "new-addr"] + "args": ["this", "new-addr"] }, "(method 54 rigid-body-platform)": { - "args": ["obj", "ctrl-point"] + "args": ["this", "ctrl-point"] }, "(method 50 rigid-body-platform)": { "vars": { @@ -2093,7 +2093,7 @@ } }, "(method 13 touching-list)": { - "args": ["obj", "shape1", "shape2"], + "args": ["this", "shape1", "shape2"], "vars": { "v0-0": ["entry", "touching-shapes-entry"] } @@ -2102,7 +2102,7 @@ "vars": { "s3-0": "vertices" }, - "args": ["obj", "arg1", "facing"] + "args": ["this", "arg1", "facing"] }, "(method 67 ocean)": { "vars": { @@ -2145,7 +2145,7 @@ } }, "(method 21 ocean)": { - "args": ["obj", "corner-x", "corner-z"] + "args": ["this", "corner-x", "corner-z"] }, "(method 37 control-info)": { "vars": { @@ -2171,22 +2171,22 @@ } }, "(method 42 collide-shape)": { - "args": ["obj", "other", "cquery"] + "args": ["this", "other", "cquery"] }, "(method 18 collide-shape-prim-group)": { - "args": ["obj", "other", "cquery"] + "args": ["this", "other", "cquery"] }, "(method 19 collide-shape-prim)": { - "args": ["obj", "other", "cquery"] + "args": ["this", "other", "cquery"] }, "(method 18 collide-shape-prim-mesh)": { - "args": ["obj", "other", "cquery"] + "args": ["this", "other", "cquery"] }, "(method 18 collide-shape-prim-sphere)": { - "args": ["obj", "other", "cquery"] + "args": ["this", "other", "cquery"] }, "(method 64 collide-shape-moving)": { - "args": ["obj", "vel", "check-dist", "amt", "bounce-dist"], + "args": ["this", "vel", "check-dist", "amt", "bounce-dist"], "vars": { "gp-0": "initial-trans", "s2-0": "collide-vel", @@ -2309,7 +2309,7 @@ "a0-7": "proc-vel", "v1-4": "targ-pos" }, - "args": ["obj", "turn-info", "proc", "arg3"] + "args": ["this", "turn-info", "proc", "arg3"] }, "(method 223 bot)": { "vars": { @@ -2329,7 +2329,7 @@ "t9-4": "on-set", "s3-0": "mesh-idx" }, - "args": ["obj", "id", "skipped?"] + "args": ["this", "id", "skipped?"] }, "(method 215 bot)": { "vars": { @@ -2337,13 +2337,13 @@ } }, "(method 205 bot)": { - "args": ["obj", "scene", "grab?"] + "args": ["this", "scene", "grab?"] }, "(method 207 bot)": { - "args": ["obj", "sound"] + "args": ["this", "sound"] }, "(method 206 bot)": { - "args": ["obj", "idx"], + "args": ["this", "idx"], "vars": { "s5-0": "speech", "gp-0": "course", @@ -2360,7 +2360,7 @@ } }, "(method 217 bot)": { - "args": ["obj", "idx"], + "args": ["this", "idx"], "vars": { "v1-2": "speech" } @@ -2400,10 +2400,10 @@ "f0-0": "rating", "v1-0": "enemy-dist" }, - "args": ["obj", "enemy", "arg2"] + "args": ["this", "enemy", "arg2"] }, "(method 220 bot)": { - "args": ["obj", "channel"] + "args": ["this", "channel"] }, "(method 214 bot)": { "vars": { @@ -2417,16 +2417,16 @@ } }, "(method 194 bot)": { - "args": ["obj", "spot", "bot-trans", "arg3"] + "args": ["this", "spot", "bot-trans", "arg3"] }, "(method 209 bot)": { - "args": ["obj", "channel"] + "args": ["this", "channel"] }, "(method 218 bot)": { - "args": ["obj", "idx"] + "args": ["this", "idx"] }, "(method 219 bot)": { - "args": ["obj", "spot"] + "args": ["this", "spot"] }, "(method 202 bot)": { "vars": { @@ -2436,7 +2436,7 @@ "s1-0": "spot", "gp-0": "spot-idx" }, - "args": ["obj", "num-spots", "spot-indices"] + "args": ["this", "num-spots", "spot-indices"] }, "(method 203 bot)": { "vars": { @@ -2444,7 +2444,7 @@ } }, "(method 9 bot-speech-list-shuffle)": { - "args": ["obj", "bot", "sp-info", "sp-flags"], + "args": ["this", "bot", "sp-info", "sp-flags"], "vars": { "v1-1": "course-cookie", "s2-0": "history-mask", @@ -2465,7 +2465,7 @@ } }, "(method 195 bot)": { - "args": ["obj", "fproc"] + "args": ["this", "fproc"] }, "(method 11 hip-door-b)": { "vars": { @@ -2475,10 +2475,10 @@ "v1-10": "cshape-mesh2", "v1-13": "root" }, - "args": ["obj", "entiy"] + "args": ["this", "entiy"] }, "(method 11 hip-mirror)": { - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "hiphog-activate": { "vars": { @@ -2605,7 +2605,7 @@ "vars": { "v1-3": "prim" }, - "args": ["obj", "collide-with-jak?"] + "args": ["this", "collide-with-jak?"] }, "(method 45 cpad-elevator)": { "vars": { @@ -2616,7 +2616,7 @@ } }, "(method 43 cpad-elevator)": { - "args": ["obj", "vec", "point-a", "point-b"], + "args": ["this", "vec", "point-a", "point-b"], "vars": { "s4-0": "path-point-a", "a0-3": "path-point-b", @@ -2974,7 +2974,7 @@ } }, "(method 11 throne-throne)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "s3-0": "prim-group", @@ -2983,7 +2983,7 @@ } }, "(method 137 sew-gunturret)": { - "args": ["obj", "aim-at-target?"], + "args": ["this", "aim-at-target?"], "vars": { "a0-2": "target-proc", "s5-4": "matrix" @@ -2997,7 +2997,7 @@ } }, "(method 140 sew-gunturret)": { - "args": ["obj", "fire-sound?"], + "args": ["this", "fire-sound?"], "vars": { "s4-0": "proj-params", "s3-0": "temp-vec" @@ -3028,7 +3028,7 @@ "a0-4": "game-info", "a2-2": "id" }, - "args": ["obj", "proc", "arg2", "event-type", "event"] + "args": ["this", "proc", "arg2", "event-type", "event"] }, "(enter die sew-gunturret)": { "vars": { @@ -3056,7 +3056,7 @@ "vars": { "f0-2": "dist" }, - "args": ["obj", "proc"] + "args": ["this", "proc"] }, "(method 141 sew-gunturret)": { "vars": { @@ -3069,7 +3069,7 @@ } }, "(method 74 gator)": { - "args": ["obj", "proc", "arg2", "event-type", "event"] + "args": ["this", "proc", "arg2", "event-type", "event"] }, "(method 180 gator)": { "vars": { @@ -3163,7 +3163,7 @@ } }, "(method 43 sew-elevator)": { - "args": ["obj", "arg1", "point-a", "point-b"], + "args": ["this", "arg1", "point-a", "point-b"], "vars": { "v1-3": "elevator-pos", "s4-0": "path-point-a", @@ -3182,7 +3182,7 @@ "vars": { "v1-3": "prim-group" }, - "args": ["obj", "collide-with-jak?"] + "args": ["this", "collide-with-jak?"] }, "(enter running sew-elevator)": { "vars": { @@ -3230,7 +3230,7 @@ "sv-16": "tag-1", "sv-32": "tag-2" }, - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "sew-mar-statue-debris-init-by-other": { "vars": { @@ -3259,13 +3259,13 @@ "v1-2": "prim-mesh", "v1-5": "root-prim" }, - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "(method 11 sew-grill)": { - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "(method 11 sew-wall)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s3-0": "data", "s5-0": "art-group", @@ -3284,7 +3284,7 @@ } }, "(method 11 sew-mine-b)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "s3-0": "prim-mesh", @@ -3293,7 +3293,7 @@ } }, "(method 11 sew-mine-a)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "s3-0": "prim-mesh", @@ -3301,7 +3301,7 @@ } }, "(method 11 sew-catwalk)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "s3-0": "prim-group", @@ -3452,17 +3452,17 @@ "vars": { "s4-0": "cshape" }, - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "(method 11 sew-light-switch)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "sv-16": "tag", "v1-6": "data" } }, "(method 11 sew-twist-blade)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "s3-0": "prim-mesh", @@ -3472,7 +3472,7 @@ } }, "(method 11 sew-multi-blade)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "s3-0": "prim-mesh", @@ -3482,7 +3482,7 @@ } }, "(method 11 sew-arm-blade)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "s3-0": "prim-mesh", @@ -3538,7 +3538,7 @@ "a1-1": "evt", "t9-0": "func" }, - "args": ["obj", "event-type"] + "args": ["this", "event-type"] }, "(event idle sew-light-control)": { "vars": { @@ -3558,7 +3558,7 @@ } }, "(method 15 sew-light-control)": { - "args": ["obj", "switched-on?", "should-turret-flash?"] + "args": ["this", "switched-on?", "should-turret-flash?"] }, "sew-light-control-init-by-other": { "args": ["switch", "turret"] @@ -3580,7 +3580,7 @@ } }, "(method 179 fodder)": { - "args": ["obj", "position"], + "args": ["this", "position"], "vars": { "a0-2": "focus-proc" } @@ -3640,7 +3640,7 @@ "s4-0": "cshape", "v1-2": "prim-mesh" }, - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "(method 31 mtn-plat-buried)": { "vars": { @@ -3660,13 +3660,13 @@ } }, "(method 11 mtn-lens)": { - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "(method 11 mtn-lens-base)": { - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "(method 11 mtn-lens-floor)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "v1-2": "prim-mesh", @@ -3674,10 +3674,10 @@ } }, "(method 11 mtn-shard)": { - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "(method 11 mtn-step-plat-rocks-a)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "s3-0": "prim-group", @@ -3687,7 +3687,7 @@ } }, "(method 11 mtn-step-plat-rocks-b)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "s3-0": "prim-group", @@ -3697,7 +3697,7 @@ } }, "(method 11 mtn-step-plat-rocks-c)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "s3-0": "prim-group", @@ -3722,7 +3722,7 @@ "v1-2": "prim-mesh", "v1-5": "root-prim" }, - "args": ["obj", "entity"] + "args": ["this", "entity"] }, "(method 31 mtn-plat-shoot)": { "vars": { @@ -3786,7 +3786,7 @@ } }, "(method 28 turret-shot)": { - "args": ["obj", "proj-options"], + "args": ["this", "proj-options"], "vars": { "v1-0": "options" } @@ -3821,7 +3821,7 @@ } }, "(method 11 fort-trap-door)": { - "args": ["obj", "entity"], + "args": ["this", "entity"], "vars": { "s4-0": "cshape", "v1-2": "prim-mesh", @@ -3855,10 +3855,10 @@ } }, "(method 74 pegasus)": { - "args": ["obj", "proc", "arg2", "event-type", "event"] + "args": ["this", "proc", "arg2", "event-type", "event"] }, "(method 57 pegasus)": { - "args": ["obj", "proc", "focus"] + "args": ["this", "proc", "focus"] }, "(method 56 pegasus)": { "vars": { @@ -4096,7 +4096,7 @@ } }, "(method 46 squid)": { - "args": ["obj", "src", "arg2", "dest"] + "args": ["this", "src", "arg2", "dest"] }, "(method 49 traffic-engine)": { "vars": { @@ -4109,7 +4109,7 @@ "sv-200": "guard-idx", "s3-2": "crimson-guard" }, - "args": ["obj", "los", "arg2", "target-status"] + "args": ["this", "los", "arg2", "target-status"] }, "generic-add-constants": { "vars": { @@ -4134,10 +4134,10 @@ } }, "(method 15 race-mesh)": { - "args": ["obj", "id", "slice-query"] + "args": ["this", "id", "slice-query"] }, "(method 17 race-mesh)": { - "args": ["obj", "slice-query"], + "args": ["this", "slice-query"], "vars": { "s4-0": "race-hash" } @@ -4170,7 +4170,7 @@ "s3-0": ["level-list-iter", "pair"], "s2-0": "lev-name" }, - "args": ["obj", "display?"] + "args": ["this", "display?"] }, "(method 23 com-airlock)": { "vars": { @@ -4392,7 +4392,7 @@ } }, "(method 10 menu-missions-option)": { - "args": ["obj", "progress", "font-ctx", "arg3", "arg4"], + "args": ["this", "progress", "font-ctx", "arg3", "arg4"], "vars": { "sv-16": "font-alpha", "v1-26": "task-info", @@ -4465,7 +4465,7 @@ } }, "(method 10 menu-language-game-option)": { - "args": ["obj", "progress", "font-ctx", "option-index", "selected"], + "args": ["this", "progress", "font-ctx", "option-index", "selected"], "vars": { "f30-0": "alpha", "v1-2": "font-ctx-1", diff --git a/goal_src/jak1/build/all_objs.json b/goal_src/jak1/build/all_objs.json index c0a2732dc0..d9aff08b79 100644 --- a/goal_src/jak1/build/all_objs.json +++ b/goal_src/jak1/build/all_objs.json @@ -32,7 +32,7 @@ ["vif-h", "vif-h", 3, ["GAME", "ENGINE"], "engine/ps2"], ["dma-h", "dma-h", 3, ["GAME", "ENGINE"], "engine/dma"], ["video-h", "video-h", 3, ["GAME", "ENGINE"], "engine/gfx/hw"], -["vu1-user-h", "vu1-user-h", 3, ["GAME", "ENGINE"], "engine/gfx/hw"], +["vu1-user-h", "vu1-user-h", 3, ["GAME", "ENGINE"], "engine/gfx"], ["dma", "dma", 3, ["GAME", "ENGINE"], "engine/dma"], ["dma-buffer", "dma-buffer", 3, ["GAME", "ENGINE"], "engine/dma"], ["dma-bucket", "dma-bucket", 3, ["GAME", "ENGINE"], "engine/dma"], @@ -43,19 +43,19 @@ ["vector", "vector", 3, ["GAME", "ENGINE"], "engine/math"], ["file-io", "file-io", 3, ["GAME", "ENGINE"], "engine/load"], ["loader-h", "loader-h", 3, ["GAME", "ENGINE"], "engine/load"], -["texture-h", "texture-h", 3, ["GAME", "ENGINE"], "engine/gfx"], +["texture-h", "texture-h", 3, ["GAME", "ENGINE"], "engine/gfx/texture"], ["level-h", "level-h", 3, ["GAME", "ENGINE"], "engine/level"], ["math-camera-h", "math-camera-h", 3, ["GAME", "ENGINE"], "engine/gfx"], ["math-camera", "math-camera", 3, ["GAME", "ENGINE"], "engine/gfx"], ["font-h", "font-h", 3, ["GAME", "ENGINE"], "engine/gfx"], -["decomp-h", "decomp-h", 3, ["GAME", "ENGINE"], "engine/gfx"], +["decomp-h", "decomp-h", 3, ["GAME", "ENGINE"], "engine/load"], ["display", "display", 3, ["GAME", "ENGINE"], "engine/gfx/hw"], ["connect", "connect", 3, ["GAME", "ENGINE"], "engine/engine"], ["text-h", "text-h", 3, ["GAME", "ENGINE"], "engine/ui"], ["settings-h", "settings-h", 3, ["GAME", "ENGINE"], "engine/game"], -["capture", "capture", 3, ["GAME", "ENGINE"], "engine/gfx"], +["capture", "capture", 3, ["GAME", "ENGINE"], "engine/util"], ["memory-usage-h", "memory-usage-h", 3, ["GAME", "ENGINE"], "engine/debug"], -["texture", "texture", 3, ["GAME", "ENGINE"], "engine/gfx"], +["texture", "texture", 3, ["GAME", "ENGINE"], "engine/gfx/texture"], ["main-h", "main-h", 3, ["GAME", "ENGINE"], "engine/game"], ["mspace-h", "mspace-h", 3, ["GAME", "ENGINE"], "engine/anim"], ["drawable-h", "drawable-h", 3, ["GAME", "ENGINE"], "engine/draw"], @@ -74,7 +74,7 @@ ["ocean-tables", "ocean-tables", 3, ["GAME", "ENGINE"], "engine/gfx/ocean"], ["ocean-frames", "ocean-frames", 3, ["GAME", "ENGINE"], "engine/gfx/ocean"], ["sky-h", "sky-h", 3, ["GAME", "ENGINE"], "engine/gfx/sky"], -["mood-h", "mood-h", 3, ["GAME", "ENGINE"], "engine/gfx"], +["mood-h", "mood-h", 3, ["GAME", "ENGINE"], "engine/gfx/mood"], ["time-of-day-h", "time-of-day-h", 3, ["GAME", "ENGINE"], "engine/gfx/mood"], ["art-h", "art-h", 3, ["GAME", "ENGINE"], "engine/data"], ["generic-vu1-h", "generic-vu1-h", 3, ["GAME", "ENGINE"], "engine/gfx/generic"], @@ -86,21 +86,21 @@ ["shadow-vu1-h", "shadow-vu1-h", 3, ["GAME", "ENGINE"], "engine/gfx/shadow"], ["memcard-h", "memcard-h", 3, ["GAME", "ENGINE"], "engine/ps2"], ["game-info-h", "game-info-h", 3, ["GAME", "ENGINE"], "engine/game"], -["wind-h", "wind-h", 3, ["GAME", "ENGINE"], "engine/gfx"], -["prototype-h", "prototype-h", 3, ["GAME", "ENGINE"], "engine/gfx/tie"], +["wind-h", "wind-h", 3, ["GAME", "ENGINE"], "engine/gfx/background"], +["prototype-h", "prototype-h", 3, ["GAME", "ENGINE"], "engine/gfx/background"], ["joint-h", "joint-h", 3, ["GAME", "ENGINE"], "engine/anim"], -["bones-h", "bones-h", 3, ["GAME", "ENGINE"], "engine/anim"], +["bones-h", "bones-h", 3, ["GAME", "ENGINE"], "engine/gfx/foreground"], ["engines", "engines", 3, ["GAME", "ENGINE"], "engine/engine"], -["res-h", "res-h", 3, ["GAME", "ENGINE"], "engine/data"], -["res", "res", 3, ["GAME", "ENGINE"], "engine/data"], +["res-h", "res-h", 3, ["GAME", "ENGINE"], "engine/entity"], +["res", "res", 3, ["GAME", "ENGINE"], "engine/entity"], ["lights", "lights", 3, ["GAME", "ENGINE"], "engine/gfx"], ["dynamics-h", "dynamics-h", 3, ["GAME", "ENGINE"], "engine/physics"], -["surface-h", "surface-h", 3, ["GAME", "ENGINE"], "engine/target"], -["pat-h", "pat-h", 3, ["GAME", "ENGINE"], "engine/target"], +["surface-h", "surface-h", 3, ["GAME", "ENGINE"], "engine/collide"], +["pat-h", "pat-h", 3, ["GAME", "ENGINE"], "engine/collide"], ["fact-h", "fact-h", 3, ["GAME", "ENGINE"], "engine/game"], ["aligner-h", "aligner-h", 3, ["GAME", "ENGINE"], "engine/anim"], ["game-h", "game-h", 3, ["GAME", "ENGINE"], "engine/game"], -["generic-obs-h", "generic-obs-h", 3, ["GAME", "ENGINE"], "engine/game"], +["generic-obs-h", "generic-obs-h", 3, ["GAME", "ENGINE"], "engine/common-obs"], ["pov-camera-h", "pov-camera-h", 3, ["GAME", "ENGINE"], "engine/camera"], ["sync-info-h", "sync-info-h", 3, ["GAME", "ENGINE"], "engine/util"], ["smush-control-h", "smush-control-h", 3, ["GAME", "ENGINE"], "engine/util"], @@ -120,18 +120,18 @@ ["target-h", "target-h", 3, ["GAME", "ENGINE"], "engine/target"], ["depth-cue-h", "depth-cue-h", 3, ["GAME", "ENGINE"], "engine/gfx"], ["stats-h", "stats-h", 3, ["GAME", "ENGINE"], "engine/debug"], -["bsp-h", "bsp-h", 3, ["GAME", "ENGINE"], "engine/gfx/vis"], +["bsp-h", "bsp-h", 3, ["GAME", "ENGINE"], "engine/level"], ["collide-cache-h", "collide-cache-h", 3, ["GAME", "ENGINE"], "engine/collide"], ["collide-h", "collide-h", 3, ["GAME", "ENGINE"], "engine/collide"], ["shrubbery-h", "shrubbery-h", 3, ["GAME", "ENGINE"], "engine/gfx/shrub"], ["tie-h", "tie-h", 3, ["GAME", "ENGINE"], "engine/gfx/tie"], ["tfrag-h", "tfrag-h", 3, ["GAME", "ENGINE"], "engine/gfx/tfrag"], -["background-h", "background-h", 3, ["GAME", "ENGINE"], "engine/gfx"], -["subdivide-h", "subdivide-h", 3, ["GAME", "ENGINE"], "engine/gfx/tfrag"], +["background-h", "background-h", 3, ["GAME", "ENGINE"], "engine/gfx/background"], +["subdivide-h", "subdivide-h", 3, ["GAME", "ENGINE"], "engine/gfx/background"], ["entity-h", "entity-h", 3, ["GAME", "ENGINE"], "engine/entity"], ["sprite-h", "sprite-h", 3, ["GAME", "ENGINE"], "engine/gfx/sprite"], ["shadow-h", "shadow-h", 3, ["GAME", "ENGINE"], "engine/gfx/shadow"], -["eye-h", "eye-h", 3, ["GAME", "ENGINE"], "engine/gfx"], +["eye-h", "eye-h", 3, ["GAME", "ENGINE"], "engine/gfx/foreground"], ["sparticle-launcher-h", "sparticle-launcher-h", 3, ["GAME", "ENGINE"], "engine/gfx/sprite/sparticle"], ["sparticle-h", "sparticle-h", 3, ["GAME", "ENGINE"], "engine/gfx/sprite/sparticle"], ["actor-link-h", "actor-link-h", 3, ["GAME", "ENGINE"], "engine/entity"], @@ -141,9 +141,9 @@ ["cam-update-h", "cam-update-h", 3, ["GAME", "ENGINE"], "engine/camera"], ["assert-h", "assert-h", 3, ["GAME", "ENGINE"], "engine/debug"], ["hud-h", "hud-h", 3, ["GAME", "ENGINE"], "engine/ui"], -["progress-h", "progress-h", 3, ["GAME", "ENGINE"], "engine/ui"], +["progress-h", "progress-h", 3, ["GAME", "ENGINE"], "engine/ui/progress"], ["rpc-h", "rpc-h", 3, ["GAME", "ENGINE"], "engine/ps2"], -["path-h", "path-h", 3, ["GAME", "ENGINE"], "engine/nav"], +["path-h", "path-h", 3, ["GAME", "ENGINE"], "engine/geometry"], ["navigate-h", "navigate-h", 3, ["GAME", "ENGINE"], "engine/nav"], ["load-dgo", "load-dgo", 3, ["GAME", "ENGINE"], "engine/load"], ["ramdisk", "ramdisk", 3, ["GAME", "ENGINE"], "engine/load"], @@ -153,8 +153,8 @@ ["joint", "joint", 3, ["GAME", "ENGINE"], "engine/anim"], ["cylinder", "cylinder", 3, ["GAME", "ENGINE"], "engine/geometry"], ["wind", "wind", 3, ["GAME", "ENGINE"], "engine/gfx"], -["bsp", "bsp", 3, ["GAME", "ENGINE"], "engine/gfx/vis"], -["subdivide", "subdivide", 3, ["GAME", "ENGINE"], "engine/gfx/tfrag"], +["bsp", "bsp", 3, ["GAME", "ENGINE"], "engine/level"], +["subdivide", "subdivide", 3, ["GAME", "ENGINE"], "engine/gfx/background"], ["sprite", "sprite", 3, ["GAME", "ENGINE"], "engine/gfx/sprite"], ["sprite-distort", "sprite-distort", 3, ["GAME", "ENGINE"], "engine/gfx/sprite"], ["debug-sphere", "debug-sphere", 3, ["GAME", "ENGINE"], "engine/debug"], @@ -162,7 +162,7 @@ ["merc-vu1", "merc-vu1", 3, ["GAME", "ENGINE"], "engine/gfx/merc"], ["merc-blend-shape", "merc-blend-shape", 3, ["GAME", "ENGINE"], "engine/gfx/merc"], ["merc", "merc", 3, ["GAME", "ENGINE"], "engine/gfx/merc"], -["ripple", "ripple", 3, ["GAME", "ENGINE"], "engine/gfx"], +["ripple", "ripple", 3, ["GAME", "ENGINE"], "engine/gfx/foreground"], ["bones", "bones", 3, ["GAME", "ENGINE"], "engine/anim"], ["generic-vu0", "generic-vu0", 3, ["GAME", "ENGINE"], "engine/gfx/generic"], ["generic", "generic", 3, ["GAME", "ENGINE"], "engine/gfx/generic"], @@ -239,7 +239,7 @@ ["generic-obs", "generic-obs", 3, ["GAME", "ENGINE"], "engine/common-obs"], ["target-util", "target-util", 3, ["GAME", "ENGINE"], "engine/target"], ["target-part", "target-part", 3, ["GAME", "ENGINE"], "engine/target"], -["collide-reaction-target", "collide-reaction-target", 3, ["GAME", "ENGINE"], "engine/collide"], +["collide-reaction-target", "collide-reaction-target", 3, ["GAME", "ENGINE"], "engine/target"], ["logic-target", "logic-target", 3, ["GAME", "ENGINE"], "engine/target"], ["sidekick", "sidekick", 3, ["GAME", "ENGINE"], "engine/target"], ["voicebox", "voicebox", 3, ["GAME", "ENGINE"], "engine/common-obs"], @@ -252,7 +252,7 @@ ["drawable-group", "drawable-group", 3, ["GAME", "ENGINE"], "engine/draw"], ["drawable-inline-array", "drawable-inline-array", 3, ["GAME", "ENGINE"], "engine/draw"], ["drawable-tree", "drawable-tree", 3, ["GAME", "ENGINE"], "engine/draw"], -["prototype", "prototype", 3, ["GAME", "ENGINE"], "engine/gfx/tie"], +["prototype", "prototype", 3, ["GAME", "ENGINE"], "engine/gfx/background"], ["main-collide", "main-collide", 3, ["GAME", "ENGINE"], "engine/collide"], ["video", "video", 3, ["GAME", "ENGINE"], "engine/gfx/hw"], ["main", "main", 3, ["GAME", "ENGINE"], "engine/game"], @@ -260,7 +260,7 @@ ["relocate", "relocate", 3, ["GAME", "ENGINE"], "engine/entity"], ["memory-usage", "memory-usage", 3, ["GAME", "ENGINE"], "engine/debug"], ["entity", "entity", 3, ["GAME", "ENGINE"], "engine/entity"], -["path", "path", 3, ["GAME", "ENGINE"], "engine/nav"], +["path", "path", 3, ["GAME", "ENGINE"], "engine/geometry"], ["vol", "vol", 3, ["GAME", "ENGINE"], "engine/geometry"], ["navigate", "navigate", 3, ["GAME", "ENGINE"], "engine/nav"], ["aligner", "aligner", 3, ["GAME", "ENGINE"], "engine/anim"], diff --git a/goal_src/jak1/engine/anim/aligner-h.gc b/goal_src/jak1/engine/anim/aligner-h.gc index b04f0a5ffa..9ff3c6e505 100644 --- a/goal_src/jak1/engine/anim/aligner-h.gc +++ b/goal_src/jak1/engine/anim/aligner-h.gc @@ -29,6 +29,8 @@ (ignore-y-if-zero) ;; if set and the alignment velocity is 0 in y, don't apply it. ) +;; DECOMP BEGINS + (deftype align-control (basic) ((flags align-flags :offset-assert 4) (process process-drawable :offset-assert 8) @@ -66,7 +68,3 @@ obj ) ) - - - - diff --git a/goal_src/jak1/engine/anim/aligner.gc b/goal_src/jak1/engine/anim/aligner.gc index d0fc88c207..61930734a7 100644 --- a/goal_src/jak1/engine/anim/aligner.gc +++ b/goal_src/jak1/engine/anim/aligner.gc @@ -9,12 +9,12 @@ ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod compute-alignment! align-control ((obj align-control)) +(defmethod compute-alignment! align-control ((this align-control)) (local-vars (a0-9 symbol) (s7-0 none) (ra-0 int)) (with-pp - (let ((s5-0 (-> obj process skel active-channels))) + (let ((s5-0 (-> this process skel active-channels))) (dotimes (s4-0 s5-0) - (let* ((a0-3 (-> obj process skel channel s4-0)) + (let* ((a0-3 (-> this process skel channel s4-0)) (v1-5 (-> a0-3 frame-group)) (a0-4 (-> a0-3 command)) (a1-0 'stack) @@ -35,34 +35,34 @@ ) ) ) - (let* ((a0-8 (-> obj process skel root-channel 0)) + (let* ((a0-8 (-> this process skel root-channel 0)) (v1-16 (-> a0-8 frame-group)) (f0-0 (-> a0-8 frame-num)) ) (= (-> a0-8 num-func) num-func-loop!) (cond - ((or (not v1-16) (!= (-> obj frame-group) v1-16)) + ((or (not v1-16) (!= (-> this frame-group) v1-16)) (set! a0-9 #t) ) ((= (-> a0-8 num-func) num-func-loop!) - (set! a0-9 (< (* (-> a0-8 param 0) (- f0-0 (-> obj frame-num))) 0.0)) + (set! a0-9 (< (* (-> a0-8 param 0) (- f0-0 (-> this frame-num))) 0.0)) ) (else (set! a0-9 (= f0-0 0.0)) ) ) (if a0-9 - (logior! (-> obj flags) (align-flags disabled)) - (logclear! (-> obj flags) (align-flags disabled)) + (logior! (-> this flags) (align-flags disabled)) + (logclear! (-> this flags) (align-flags disabled)) ) - (set! (-> obj frame-group) v1-16) - (set! (-> obj frame-num) f0-0) + (set! (-> this frame-group) v1-16) + (set! (-> this frame-num) f0-0) ) - (mem-copy! (the-as pointer (-> obj transform 1)) (the-as pointer (-> obj transform)) 48) - (quaternion-copy! (the-as quaternion (-> obj transform 1 rot)) (-> obj align quat)) - (set! (-> obj transform 1 scale quad) (-> obj align scale quad)) - (let* ((a2-5 (-> obj matrix 1 vector)) - (a3-0 (-> obj matrix)) + (mem-copy! (the-as pointer (-> this transform 1)) (the-as pointer (-> this transform)) 48) + (quaternion-copy! (the-as quaternion (-> this transform 1 rot)) (-> this align quat)) + (set! (-> this transform 1 scale quad) (-> this align scale quad)) + (let* ((a2-5 (-> this matrix 1 vector)) + (a3-0 (-> this matrix)) (v1-19 (-> a3-0 0 vector 0 quad)) (a0-18 (-> a3-0 0 vector 1 quad)) (a1-12 (-> a3-0 0 vector 2 quad)) @@ -73,9 +73,9 @@ (set! (-> a2-5 2 quad) a1-12) (set! (-> a2-5 3 quad) a3-1) ) - (let ((s5-1 (-> obj process node-list data 1))) - (cspace<-matrix-no-push-joint! s5-1 (-> obj process skel)) - (let* ((v1-23 (-> obj matrix)) + (let ((s5-1 (-> this process node-list data 1))) + (cspace<-matrix-no-push-joint! s5-1 (-> this process skel)) + (let* ((v1-23 (-> this matrix)) (a3-2 (-> s5-1 bone transform)) (a0-21 (-> a3-2 vector 0 quad)) (a1-14 (-> a3-2 vector 1 quad)) @@ -87,46 +87,47 @@ (set! (-> v1-23 0 vector 2 quad) a2-6) (set! (-> v1-23 0 vector 3 quad) a3-3) ) - (vector*! (the-as vector (-> obj transform)) (-> s5-1 bone transform vector 3) (-> obj process root scale)) + (vector*! (the-as vector (-> this transform)) (-> s5-1 bone transform vector 3) (-> this process root scale)) ) (vector-! - (the-as vector (-> obj delta)) - (the-as vector (-> obj transform)) - (the-as vector (-> obj transform 1)) + (the-as vector (-> this delta)) + (the-as vector (-> this transform)) + (the-as vector (-> this transform 1)) ) (set-vector! - (-> obj align scale) - (vector-length (the-as vector (-> obj matrix))) - (vector-length (-> obj matrix 0 vector 1)) - (vector-length (-> obj matrix 0 vector 2)) + (-> this align scale) + (vector-length (the-as vector (-> this matrix))) + (vector-length (-> this matrix 0 vector 1)) + (vector-length (-> this matrix 0 vector 2)) 1.0 ) - (vector-! (-> obj delta scale) (-> obj align scale) (-> obj transform 1 scale)) - (let ((a2-8 (matrix-inv-scale! (new 'stack-no-clear 'matrix) (-> obj align scale)))) + (vector-! (-> this delta scale) (-> this align scale) (-> this transform 1 scale)) + (let ((a2-8 (matrix-inv-scale! (new 'stack-no-clear 'matrix) (-> this align scale)))) (quaternion-normalize! - (matrix->quaternion (-> obj align quat) (matrix*! a2-8 (the-as matrix (-> obj matrix)) a2-8)) + (matrix->quaternion (-> this align quat) (matrix*! a2-8 (the-as matrix (-> this matrix)) a2-8)) ) ) - (let ((a1-24 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (the-as quaternion (-> obj transform 1 rot))))) - (quaternion-normalize! (quaternion*! (-> obj delta quat) a1-24 (-> obj align quat))) + (let ((a1-24 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (the-as quaternion (-> this transform 1 rot)))) + ) + (quaternion-normalize! (quaternion*! (-> this delta quat) a1-24 (-> this align quat))) ) - (-> obj delta) + (-> this delta) ) ) -(defmethod first-transform align-control ((obj align-control)) - (the-as transform (-> obj transform)) +(defmethod first-transform align-control ((this align-control)) + (the-as transform (-> this transform)) ) -(defmethod snd-transform align-control ((obj align-control)) - (-> obj transform 1) +(defmethod snd-transform align-control ((this align-control)) + (-> this transform 1) ) -(defmethod align! align-control ((obj align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) - (when (not (logtest? (-> obj flags) (align-flags disabled))) - (let* ((a0-1 (-> obj process)) +(defmethod align! align-control ((this align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) + (when (not (logtest? (-> this flags) (align-flags disabled))) + (let* ((a0-1 (-> this process)) (t9-0 (method-of-object a0-1 apply-alignment)) - (v1-4 (-> obj delta)) + (v1-4 (-> this delta)) (t1-0 (new 'stack-no-clear 'vector)) ) (set! (-> t1-0 x) arg1) @@ -136,11 +137,11 @@ (t9-0 a0-1 arg0 v1-4 t1-0) ) ) - (-> obj process root) + (-> this process root) ) -(defmethod set-and-limit-velocity trsqv ((obj trsqv) (arg0 int) (arg1 vector) (arg2 float)) - (let ((gp-0 (-> obj transv))) +(defmethod set-and-limit-velocity trsqv ((this trsqv) (arg0 int) (arg1 vector) (arg2 float)) + (let ((gp-0 (-> this transv))) (when (logtest? arg0 4) (set! (-> gp-0 x) (-> arg1 x)) (set! (-> gp-0 z) (-> arg1 z)) @@ -149,13 +150,13 @@ ) ) ) - obj + this ) -(defmethod align-vel-and-quat-only! align-control ((obj align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) - (when (not (logtest? (-> obj flags) (align-flags disabled))) - (let ((s5-0 (-> obj delta))) - (let ((s3-0 (-> obj process root transv))) +(defmethod align-vel-and-quat-only! align-control ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) + (when (not (logtest? (-> this flags) (align-flags disabled))) + (let ((s5-0 (-> this delta))) + (let ((s3-0 (-> this process root transv))) (if (logtest? arg0 (align-opts adjust-y-vel)) (set! (-> s3-0 y) (* (-> s5-0 trans y) arg3 (-> *display* frames-per-second))) ) @@ -168,15 +169,15 @@ ) (t9-2 vector-xz-normalize!) ) - (set! (-> obj last-speed) f0-8) + (set! (-> this last-speed) f0-8) (t9-2 s3-0 f0-8) ) ) ) (if (logtest? arg0 (align-opts adjust-quat)) - (quaternion-normalize! (quaternion*! (-> obj process root quat) (-> obj process root quat) (-> s5-0 quat))) + (quaternion-normalize! (quaternion*! (-> this process root quat) (-> this process root quat) (-> s5-0 quat))) ) ) ) - (-> obj process root) + (-> this process root) ) diff --git a/goal_src/jak1/engine/anim/joint-exploder.gc b/goal_src/jak1/engine/anim/joint-exploder.gc index 5e1f4ee8ce..70b7ece9de 100644 --- a/goal_src/jak1/engine/anim/joint-exploder.gc +++ b/goal_src/jak1/engine/anim/joint-exploder.gc @@ -121,8 +121,8 @@ ) -(defmethod asize-of joint-exploder-joints ((obj joint-exploder-joints)) - (the-as int (+ (-> obj type size) (* 176 (-> obj num-joints)))) +(defmethod asize-of joint-exploder-joints ((this joint-exploder-joints)) + (the-as int (+ (-> this type size) (* 176 (-> this num-joints)))) ) (defmethod new joint-exploder-joints ((allocation symbol) (type-to-make type) (arg0 joint-exploder-static-params)) @@ -157,22 +157,22 @@ (none) ) -(defmethod joint-exploder-method-24 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let ((v0-0 (joint-exploder-method-26 obj arg0 arg1))) - (let* ((v1-1 (-> obj joints)) +(defmethod joint-exploder-method-24 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let ((v0-0 (joint-exploder-method-26 this arg0 arg1))) + (let* ((v1-1 (-> this joints)) (v1-2 (-> v1-1 joint arg1)) ) (set! (-> v1-2 mat vector 0 quad) (the-as uint128 0)) (set! (-> v1-2 mat vector 1 quad) (the-as uint128 0)) (set! (-> v1-2 mat vector 2 quad) (the-as uint128 0)) - (set! (-> v1-2 mat vector 3 quad) (-> obj root trans quad)) + (set! (-> v1-2 mat vector 3 quad) (-> this root trans quad)) ) v0-0 ) ) -(defmethod joint-exploder-method-26 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let* ((v1-0 (-> obj joints)) +(defmethod joint-exploder-method-26 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let* ((v1-0 (-> this joints)) (a2-1 (-> v1-0 joint arg1)) (a0-4 (-> a2-1 prev)) (v0-0 (-> a2-1 next)) @@ -202,8 +202,8 @@ ) ) -(defmethod joint-exploder-method-20 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let* ((v1-0 (-> obj joints)) +(defmethod joint-exploder-method-20 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let* ((v1-0 (-> this joints)) (a3-0 (-> v1-0 joint arg1)) (a0-4 (-> arg0 head)) ) @@ -217,7 +217,7 @@ ) ) -(defmethod joint-exploder-method-21 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) +(defmethod joint-exploder-method-21 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) (let ((a1-1 (-> arg1 mat vector 3))) (cond ((-> arg0 bbox-valid?) @@ -234,12 +234,12 @@ (none) ) -(defmethod joint-exploder-method-27 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod joint-exploder-method-27 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int)) (let ((s4-0 (the-as joint-exploder-list #f))) (let ((v1-0 1)) (until (= v1-0 5) - (let ((a0-4 (-> obj lists v1-0))) + (let ((a0-4 (-> this lists v1-0))) (when (< (-> a0-4 head) 0) (set! s4-0 a0-4) (goto cfg-6) @@ -256,11 +256,11 @@ (set! (-> (the-as joint-exploder-list s3-0) bbox-valid?) #f) ) (else - (set! s3-0 (-> obj lists)) + (set! s3-0 (-> this lists)) ) ) (set! (-> arg0 bbox-valid?) #f) - (let ((s2-0 (-> obj joints)) + (let ((s2-0 (-> this joints)) (s1-0 (-> arg0 head)) ) (cond @@ -270,13 +270,13 @@ (let ((s0-0 (-> s2-0 joint s1-0))) (cond ((>= (-> s0-0 mat vector 3 x) f30-0) - (set! sv-16 (joint-exploder-method-26 obj arg0 s1-0)) - (joint-exploder-method-20 obj (the-as joint-exploder-list s3-0) s1-0) + (set! sv-16 (joint-exploder-method-26 this arg0 s1-0)) + (joint-exploder-method-20 this (the-as joint-exploder-list s3-0) s1-0) (set! s1-0 sv-16) - (joint-exploder-method-21 obj (the-as joint-exploder-list s3-0) s0-0) + (joint-exploder-method-21 this (the-as joint-exploder-list s3-0) s0-0) ) (else - (joint-exploder-method-21 obj arg0 s0-0) + (joint-exploder-method-21 this arg0 s0-0) (set! s1-0 (-> s0-0 next)) ) ) @@ -290,13 +290,13 @@ (let ((s0-1 (-> s2-0 joint s1-0))) (cond ((>= (-> s0-1 mat vector 3 y) f30-1) - (set! sv-32 (joint-exploder-method-26 obj arg0 s1-0)) - (joint-exploder-method-20 obj (the-as joint-exploder-list s3-0) s1-0) + (set! sv-32 (joint-exploder-method-26 this arg0 s1-0)) + (joint-exploder-method-20 this (the-as joint-exploder-list s3-0) s1-0) (set! s1-0 sv-32) - (joint-exploder-method-21 obj (the-as joint-exploder-list s3-0) s0-1) + (joint-exploder-method-21 this (the-as joint-exploder-list s3-0) s0-1) ) (else - (joint-exploder-method-21 obj arg0 s0-1) + (joint-exploder-method-21 this arg0 s0-1) (set! s1-0 (-> s0-1 next)) ) ) @@ -310,13 +310,13 @@ (let ((s0-2 (-> s2-0 joint s1-0))) (cond ((>= (-> s0-2 mat vector 3 z) f30-2) - (set! sv-48 (joint-exploder-method-26 obj arg0 s1-0)) - (joint-exploder-method-20 obj (the-as joint-exploder-list s3-0) s1-0) + (set! sv-48 (joint-exploder-method-26 this arg0 s1-0)) + (joint-exploder-method-20 this (the-as joint-exploder-list s3-0) s1-0) (set! s1-0 sv-48) - (joint-exploder-method-21 obj (the-as joint-exploder-list s3-0) s0-2) + (joint-exploder-method-21 this (the-as joint-exploder-list s3-0) s0-2) ) (else - (joint-exploder-method-21 obj arg0 s0-2) + (joint-exploder-method-21 this arg0 s0-2) (set! s1-0 (-> s0-2 next)) ) ) @@ -331,43 +331,43 @@ ) ) -(defmethod joint-exploder-method-28 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-28 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0)) (cond ((< 20480.0 (- (-> arg0 bbox max x) (-> arg0 bbox min x))) - (let ((a1-2 (joint-exploder-method-27 obj arg0 0))) + (let ((a1-2 (joint-exploder-method-27 this arg0 0))) (if a1-2 - (joint-exploder-method-28 obj a1-2) + (joint-exploder-method-28 this a1-2) ) ) - (joint-exploder-method-28 obj arg0) + (joint-exploder-method-28 this arg0) ) ((< 20480.0 (- (-> arg0 bbox max y) (-> arg0 bbox min y))) - (let ((a1-5 (joint-exploder-method-27 obj arg0 1))) + (let ((a1-5 (joint-exploder-method-27 this arg0 1))) (if a1-5 - (joint-exploder-method-28 obj a1-5) + (joint-exploder-method-28 this a1-5) ) ) - (joint-exploder-method-28 obj arg0) + (joint-exploder-method-28 this arg0) ) ((< 20480.0 (- (-> arg0 bbox max z) (-> arg0 bbox min z))) - (let ((a1-8 (joint-exploder-method-27 obj arg0 2))) + (let ((a1-8 (joint-exploder-method-27 this arg0 2))) (if a1-8 - (joint-exploder-method-28 obj a1-8) + (joint-exploder-method-28 this a1-8) ) ) - (joint-exploder-method-28 obj arg0) + (joint-exploder-method-28 this arg0) ) ) ) (none) ) -(defmethod joint-exploder-method-25 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-25 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (set! (-> arg0 bbox-valid?) #f) (set! (-> arg0 pre-moved?) #t) - (let ((s4-0 (-> obj joints)) - (f30-0 (* (-> obj tuning gravity) (-> *display* seconds-per-frame))) + (let ((s4-0 (-> this joints)) + (f30-0 (* (-> this tuning gravity) (seconds-per-frame))) (s3-0 (-> arg0 head)) ) (while (>= s3-0 0) @@ -378,7 +378,7 @@ (+! (-> s2-0 transv y) f30-0) (vector-v+! s1-0 s1-0 (-> s2-0 transv)) (let ((f0-3 0.99) - (f2-1 (* (-> s2-0 rspeed) (-> *display* seconds-per-frame))) + (f2-1 (* (-> s2-0 rspeed) (seconds-per-frame))) (f5-0 (-> s2-0 rmat vector 0 x)) (f4-0 (-> s2-0 rmat vector 0 y)) (f3-0 (-> s2-0 rmat vector 1 x)) @@ -390,13 +390,13 @@ (set! (-> s2-0 rmat vector 1 y) (+ (* f3-0 f2-1) (* f1-2 f0-3))) ) (cond - ((or (< (-> s1-0 y) (-> obj die-if-below-y)) - (< (-> obj die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> obj root trans))) + ((or (< (-> s1-0 y) (-> this die-if-below-y)) + (< (-> this die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> this root trans))) ) - (set! s3-0 (joint-exploder-method-24 obj arg0 s3-0)) + (set! s3-0 (joint-exploder-method-24 this arg0 s3-0)) ) (else - (joint-exploder-method-21 obj arg0 s2-0) + (joint-exploder-method-21 this arg0 s2-0) (set! s3-0 (-> s2-0 next)) ) ) @@ -406,15 +406,15 @@ #f ) -(defmethod joint-exploder-method-22 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-22 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (fill-using-bounding-box *collide-cache* (-> arg0 bbox) (collide-kind background) - obj + this (new 'static 'pat-surface :noentity #x1) ) - (let ((gp-1 (-> obj joints)) + (let ((gp-1 (-> this joints)) (v1-2 (-> arg0 head)) ) (while (>= v1-2 0) @@ -458,10 +458,10 @@ (defstate joint-exploder-shatter (joint-exploder) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (let* ((f1-0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) + (let* ((f1-0 (the float (- (current-time) (-> self state-time)))) (f0-2 (- 1.0 (/ f1-0 (the float (-> self tuning duration))))) (f1-2 (- 1.0 (/ f1-0 (* 0.75 (the float (-> self tuning duration)))))) ) @@ -517,8 +517,8 @@ 0 ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self tuning duration)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (-> self tuning duration)) (suspend) (ja :num! (loop!)) ) @@ -526,23 +526,23 @@ :post ja-post ) -(defmethod joint-exploder-method-23 joint-exploder ((obj joint-exploder)) - (let ((gp-0 (-> obj joints))) +(defmethod joint-exploder-method-23 joint-exploder ((this joint-exploder)) + (let ((gp-0 (-> this joints))) (dotimes (s4-0 (-> gp-0 num-joints)) - (let ((v1-2 (-> obj static-params joints s4-0)) + (let ((v1-2 (-> this static-params joints s4-0)) (s3-0 (-> gp-0 joint s4-0)) ) (let ((a0-6 (-> v1-2 parent-joint-index))) (set! (-> s3-0 prev) (+ s4-0 -1)) (set! (-> s3-0 next) (+ s4-0 1)) (set! (-> s3-0 joint-index) (-> v1-2 joint-index)) - (set! (-> s3-0 rspeed) (-> obj tuning rot-speed)) + (set! (-> s3-0 rspeed) (-> this tuning rot-speed)) (cond ((>= a0-6 0) (if (zero? a0-6) (set! a0-6 (-> v1-2 joint-index)) ) - (let* ((a3-0 (-> obj parent-override 0 node-list data a0-6 bone transform)) + (let* ((a3-0 (-> this parent-override 0 node-list data a0-6 bone transform)) (a2-0 (-> s3-0 mat)) (v1-9 (-> a3-0 vector 0 quad)) (a0-8 (-> a3-0 vector 1 quad)) @@ -557,7 +557,7 @@ (matrix-identity! (-> s3-0 rmat)) ) (else - (let* ((a3-2 (-> obj node-list data (-> v1-2 joint-index) bone transform)) + (let* ((a3-2 (-> this node-list data (-> v1-2 joint-index) bone transform)) (a2-1 (-> s3-0 mat)) (v1-15 (-> a3-2 vector 0 quad)) (a0-11 (-> a3-2 vector 1 quad)) @@ -573,21 +573,21 @@ ) ) ) - (case (-> obj tuning explosion) + (case (-> this tuning explosion) ((1) - (vector-! (-> s3-0 transv) (-> s3-0 mat vector 3) (-> obj tuning fountain-rand-transv-lo)) + (vector-! (-> s3-0 transv) (-> s3-0 mat vector 3) (-> this tuning fountain-rand-transv-lo)) (vector-normalize! (-> s3-0 transv) - (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi x) (-> obj tuning fountain-rand-transv-hi y)) + (rand-vu-float-range (-> this tuning fountain-rand-transv-hi x) (-> this tuning fountain-rand-transv-hi y)) ) (+! (-> s3-0 transv y) - (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi z) (-> obj tuning fountain-rand-transv-hi w)) + (rand-vu-float-range (-> this tuning fountain-rand-transv-hi z) (-> this tuning fountain-rand-transv-hi w)) ) (set! (-> s3-0 transv w) 1.0) ) (else - (let ((s1-1 (-> obj tuning fountain-rand-transv-lo)) - (s2-1 (-> obj tuning fountain-rand-transv-hi)) + (let ((s1-1 (-> this tuning fountain-rand-transv-lo)) + (s2-1 (-> this tuning fountain-rand-transv-hi)) ) (set-vector! (-> s3-0 transv) @@ -605,7 +605,7 @@ (let ((v1-26 (-> gp-0 joint (+ (-> gp-0 num-joints) -1)))) (set! (-> v1-26 next) -1) ) - (let ((v1-27 (the-as joint-exploder-list (&-> obj stack 224)))) + (let ((v1-27 (the-as joint-exploder-list (&-> this stack 224)))) (set! (-> v1-27 head) 0) (let ((s5-1 (-> v1-27 bbox))) (let ((v1-28 (the-as structure (-> gp-0 joint 0 mat vector 3)))) @@ -622,11 +622,11 @@ ) ) -(defmethod relocate joint-exploder ((obj joint-exploder) (arg0 int)) - (if (nonzero? (-> obj joints)) - (&+! (-> obj joints) arg0) +(defmethod relocate joint-exploder ((this joint-exploder) (arg0 int)) + (if (nonzero? (-> this joints)) + (&+! (-> this joints) arg0) ) - (the-as joint-exploder ((method-of-type process-drawable relocate) obj arg0)) + (the-as joint-exploder ((method-of-type process-drawable relocate) this arg0)) ) (defbehavior joint-exploder-init-by-other joint-exploder ((arg0 skeleton-group) (arg1 int) (arg2 joint-exploder-static-params) (arg3 joint-exploder-static-params)) diff --git a/goal_src/jak1/engine/anim/joint-h.gc b/goal_src/jak1/engine/anim/joint-h.gc index 0df4bbda56..9010f4c31d 100644 --- a/goal_src/jak1/engine/anim/joint-h.gc +++ b/goal_src/jak1/engine/anim/joint-h.gc @@ -13,6 +13,22 @@ (define-extern vector<-cspace! (function vector cspace vector)) (define-extern create-interpolated-joint-animation-frame (function (inline-array vector) int process-drawable int)) +(defenum janim-status + :type uint16 + :bitfield #t + (inited 0) + (drawn 1) + (done 2) + (blerc 3) + (skelf04 4) + (spool 5) + (blerc-done 6) + (eye-done 7) + (eye 8) + ) + +;; DECOMP BEGINS + ;; These types are specific to joint control. ;; See mspace-h.gc for the actual joint types @@ -40,41 +56,27 @@ ) ) -(defenum janim-status - :type uint16 - :bitfield #t - (inited 0) - (drawn 1) - (done 2) - (blerc 3) - (skelf04 4) - (spool 5) - (blerc-done 6) - (eye-done 7) - (eye 8) - ) - ;; A collection of joint-control-channels. (deftype joint-control (basic) - ((status janim-status :offset-assert 4) - (allocated-length int16 :offset-assert 6) - (root-channel (inline-array joint-control-channel) :offset 16) - (blend-index int32 :offset-assert 20) - (active-channels int32 :offset-assert 24) - (generate-frame-function (function (inline-array vector) int process-drawable int) :offset-assert 28) - (prebind-function (function pointer int process-drawable none) :offset-assert 32) - (postbind-function (function process-drawable none) :offset-assert 36) - (effect effect-control :offset-assert 40) - (channel joint-control-channel 3 :inline :offset-assert 48) ;; actually dynamic? - (frame-group0 art-joint-anim :offset 60) - (frame-num0 float :offset 64) - (frame-interp0 float :offset 56) - (frame-group1 art-joint-anim :offset 108) - (frame-num1 float :offset 112) - (frame-interp1 float :offset 104) - (frame-group2 art-joint-anim :offset 156) - (frame-num2 float :offset 160) - (frame-interp2 float :offset 152) + ((status janim-status :offset-assert 4) + (allocated-length int16 :offset-assert 6) + (root-channel (inline-array joint-control-channel) :offset 16) + (blend-index int32 :offset-assert 20) + (active-channels int32 :offset-assert 24) + (generate-frame-function (function (inline-array vector) int process-drawable int) :offset-assert 28) + (prebind-function (function pointer int process-drawable none) :offset-assert 32) + (postbind-function (function process-drawable none) :offset-assert 36) + (effect effect-control :offset-assert 40) + (channel joint-control-channel 3 :inline :offset-assert 48) + (frame-group0 art-joint-anim :offset 60) + (frame-num0 float :offset 64) + (frame-interp0 float :offset 56) + (frame-group1 art-joint-anim :offset 108) + (frame-num1 float :offset 112) + (frame-interp1 float :offset 104) + (frame-group2 art-joint-anim :offset 156) + (frame-num2 float :offset 160) + (frame-interp2 float :offset 152) ) :method-count-assert 11 :size-assert #xc0 @@ -130,8 +132,8 @@ (jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328) (fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392) (frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600) - (flatten-array float 576 :offset 2400) ;; no clue! - (flattened vector 24 :inline :offset 2400) ;; no clue! + (flatten-array float 576 :offset 2400) + (flattened vector 24 :inline :offset 2400) ) :method-count-assert 9 :size-assert #x3640 diff --git a/goal_src/jak1/engine/anim/joint-mod-h.gc b/goal_src/jak1/engine/anim/joint-mod-h.gc index 087f10ab5a..70958740b1 100644 --- a/goal_src/jak1/engine/anim/joint-mod-h.gc +++ b/goal_src/jak1/engine/anim/joint-mod-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: joint-mod-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; The joint-mod system allows an animated character to change in a way that's not described in ;; an animation. For example, this is used to point Jak's head toward an attacking enemy. @@ -41,7 +43,7 @@ (trans vector :inline :offset-assert 64) (quat quaternion :inline :offset-assert 80) (scale vector :inline :offset-assert 96) - (notice-time time-frame :offset-assert 112) + (notice-time time-frame :offset-assert 112) (flex-blend float :offset-assert 120) (blend float :offset-assert 124) (max-dist meters :offset-assert 128) @@ -56,21 +58,23 @@ :size-assert #x90 :flag-assert #x1000000090 (:methods - (new (symbol type joint-mod-handler-mode process-drawable int) _type_ 0) - (set-mode! (_type_ joint-mod-handler-mode) _type_ 9) - (set-target! (_type_ vector) none 10) - (look-at-enemy! (_type_ vector symbol process) none 11) - (reset-blend! (_type_) _type_ 12) - (set-twist! (_type_ float float float) vector 13) - (set-trs! (_type_ vector quaternion vector) none 14) - (shut-down! (_type_) none 15) - ) + (new (symbol type joint-mod-handler-mode process-drawable int) _type_ 0) + (set-mode! (_type_ joint-mod-handler-mode) _type_ 9) + (set-target! (_type_ vector) none 10) + (look-at-enemy! (_type_ vector symbol process) none 11) + (reset-blend! (_type_) _type_ 12) + (set-twist! (_type_ float float float) vector 13) + (set-trs! (_type_ vector quaternion vector) none 14) + (shut-down! (_type_) none 15) + ) ) + (defun-debug joint-mod-debug-draw ((mod joint-mod)) "Draw a frame at the bone." ;; I believe this draws a set of coordinate axes that represent the transformation matrix. (add-debug-matrix #t (bucket-id debug-no-zbuf) (-> mod joint bone transform)) + 0 (none) ) @@ -94,123 +98,129 @@ ) ) -(defmethod set-mode! joint-mod ((obj joint-mod) (handler-mode joint-mod-handler-mode)) +(defmethod set-mode! joint-mod ((this joint-mod) (handler-mode joint-mod-handler-mode)) "Set up the joint-mod for the given mode. You can only pick one mode at a time." - (set! (-> obj mode) handler-mode) - (let ((joint (-> obj joint))) - (case handler-mode + (set! (-> this mode) handler-mode) + (let ((joint (-> this joint))) + (case handler-mode (((joint-mod-handler-mode flex-blend)) (set! (-> joint param0) #f) (set! (-> joint param1) #f) (set! (-> joint param2) #f) - (set! (-> obj blend) 0.0) - (set! (-> obj flex-blend) 1.0) + (set! (-> this blend) 0.0) + (set! (-> this flex-blend) 1.0) ) (((joint-mod-handler-mode reset)) (set! (-> joint param0) #f) (set! (-> joint param1) #f) (set! (-> joint param2) #f) - (set! (-> obj blend) 0.0) - (set! (-> obj shutting-down?) #f) + (set! (-> this blend) 0.0) + (set! (-> this shutting-down?) #f) ) (((joint-mod-handler-mode look-at)) (set! (-> joint param0) joint-mod-look-at-handler) - (set! (-> joint param1) obj) + (set! (-> joint param1) this) (set! (-> joint param2) #f) ) (((joint-mod-handler-mode world-look-at)) (set! (-> joint param0) joint-mod-world-look-at-handler) - (set! (-> joint param1) obj) + (set! (-> joint param1) this) (set! (-> joint param2) #f) ) (((joint-mod-handler-mode rotate)) (set! (-> joint param0) joint-mod-rotate-handler) - (set! (-> joint param1) obj) + (set! (-> joint param1) this) (set! (-> joint param2) #f) - (set! (-> obj blend) 1.0) + (set! (-> this blend) 1.0) ) (((joint-mod-handler-mode joint-set)) (set! (-> joint param0) joint-mod-joint-set-handler) - (set! (-> joint param1) obj) + (set! (-> joint param1) this) (set! (-> joint param2) #f) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) - (set! (-> obj max-dist) (the-as float #f)) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) + (set! (-> this max-dist) (the-as meters #f)) ) (((joint-mod-handler-mode joint-set*)) (set! (-> joint param0) joint-mod-joint-set*-handler) - (set! (-> joint param1) obj) + (set! (-> joint param1) this) (set! (-> joint param2) #f) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) - (set! (-> obj max-dist) (the-as float #f)) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) + (set! (-> this max-dist) (the-as meters #f)) ) ) ) - obj + this ) -(defmethod reset-blend! joint-mod ((obj joint-mod)) +(defmethod reset-blend! joint-mod ((this joint-mod)) "Reset the blend to 0." - (set! (-> obj blend) 0.0) - obj + (set! (-> this blend) 0.0) + this ) -(defmethod shut-down! joint-mod ((obj joint-mod)) +(defmethod shut-down! joint-mod ((this joint-mod)) "Shut down and set the blend to zero." - (set! (-> obj shutting-down?) #t) - (set! (-> obj blend) 0.0) + (set! (-> this shutting-down?) #t) + (set! (-> this blend) 0.0) (none) ) -(defmethod set-twist! joint-mod ((obj joint-mod) (x float) (y float) (z float)) +(defmethod set-twist! joint-mod ((this joint-mod) (x float) (y float) (z float)) "Set the twist. You can use #f to not change the current value." - (if x (set! (-> obj twist x) x)) - (if y (set! (-> obj twist y) y)) - (if z (set! (-> obj twist z) z)) - (-> obj twist) + (if x + (set! (-> this twist x) x) + ) + (if y + (set! (-> this twist y) y) + ) + (if z + (set! (-> this twist z) z) + ) + (-> this twist) ) -(defmethod set-trs! joint-mod ((obj joint-mod) (trans vector) (rot quaternion) (scale vector)) - "Set the translation, rotation, and scale." +(defmethod set-trs! joint-mod ((this joint-mod) (trans vector) (rot quaternion) (scale vector)) (if trans - (set! (-> obj trans quad) (-> trans quad)) - ) + (set! (-> this trans quad) (-> trans quad)) + ) (if rot - (quaternion-copy! (-> obj quat) rot) - ) + (quaternion-copy! (-> this quat) rot) + ) (if scale - (set! (-> obj scale quad) (-> scale quad)) - ) + (set! (-> this scale quad) (-> scale quad)) + ) + 0 (none) ) -(defmethod set-target! joint-mod ((obj joint-mod) (target-trans vector)) +(defmethod set-target! joint-mod ((this joint-mod) (target-trans vector)) "Set the joint-mod to look-at if we aren't in a mode, and look at the given target-trans." - ;; set mode, if we aren't in one. - (if (= (-> obj mode) (joint-mod-handler-mode reset)) - (set-mode! obj (joint-mod-handler-mode look-at)) + (if (= (-> this mode) (joint-mod-handler-mode reset)) + (set-mode! this (joint-mod-handler-mode look-at)) ) ;; how far are we from the target? - (let ((distance (vector-vector-distance (-> obj process root trans) target-trans))) - (set! (-> obj shutting-down?) #f) - (set! (-> obj target quad) (-> target-trans quad)) - (if (< distance (-> obj max-dist)) - (set! (-> obj blend) 1.0) ;; in range, set blend to 1.0 to start - (set! (-> obj blend) 0.0) ;; not in range, set blend to 0.0 to disable. + (let ((distance (vector-vector-distance (-> this process root trans) target-trans))) + (set! (-> this shutting-down?) #f) + (set! (-> this target quad) (-> target-trans quad)) + (if (< distance (-> this max-dist)) + (set! (-> this blend) 1.0) + (set! (-> this blend) 0.0) ) ) + 0 (none) ) ;; this type is for storing what we tried to look at last. (deftype try-to-look-at-info (basic) - ((who handle :offset-assert 8) - (horz float :offset-assert 16) - (vert float :offset-assert 20) + ((who handle :offset-assert 8) + (horz float :offset-assert 16) + (vert float :offset-assert 20) ) :method-count-assert 9 :size-assert #x18 @@ -221,18 +231,17 @@ ;; There's only one global instance of this, likely used by Jak looking at enemies. (define last-try-to-look-at-data (new 'global 'try-to-look-at-info)) -(defmethod look-at-enemy! joint-mod ((obj joint-mod) (target-trans vector) (option symbol) (proc process)) +(defmethod look-at-enemy! joint-mod ((this joint-mod) (target-trans vector) (option symbol) (proc process)) "Set up animation for Jak looking at an enemy. If option is 'attacking, remember when this happened. Will only override an existing look-at if this one is closer, or option is 'force." (when (= option 'attacking) ;; make sure we got a process-drawable (let* ((s3-0 proc) - (proc-drawable - (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) process-drawable)) - (the-as process-drawable s3-0) - ) - ) + (proc-drawable (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) process-drawable)) + (the-as process-drawable s3-0) + ) + ) ) (when proc-drawable ;; get enemy fact info @@ -244,12 +253,12 @@ ) ) ;; check that we have enemy facts, and that we are within the notice distance - (when (and enemy-facts (< (vector-vector-distance (-> obj process root trans) (-> proc-drawable root trans)) + (when (and enemy-facts (< (vector-vector-distance (-> this process root trans) (-> proc-drawable root trans)) (-> enemy-facts cam-notice-dist) ) ) ;; success! we consider this a noticed and remember when - (set! (-> obj notice-time) (-> *display* base-frame-counter)) + (set-time! (-> this notice-time)) ;; and update the look at data (set! (-> last-try-to-look-at-data who) (process->handle proc)) ;; not sure what these are yet. @@ -264,93 +273,57 @@ ) ) ) - - ;; in all cases, - (let ((dist (vector-vector-distance (-> obj process root trans) target-trans))) - (when (and - ;; done with previous - (or (= (-> obj blend) 0.0) - ;; closer than previous. - (or (< dist (vector-vector-distance (-> obj process root trans) (-> obj target))) - ;; force - (= option 'force) - ) - ) - ;; and in range - (< dist (-> obj max-dist)) - ) - ;; set mode, if we aren't in one - (if (= (-> obj mode) (joint-mod-handler-mode reset)) - (set-mode! obj (joint-mod-handler-mode look-at)) + (let ((dist (vector-vector-distance (-> this process root trans) target-trans))) + (when (and (or (= (-> this blend) 0.0) + (or (< dist (vector-vector-distance (-> this process root trans) (-> this target))) (= option 'force)) + ) + (< dist (-> this max-dist)) + ) + (if (= (-> this mode) (joint-mod-handler-mode reset)) + (set-mode! this (joint-mod-handler-mode look-at)) ) - ;; set our target. - (set! (-> obj target quad) (-> target-trans quad)) - ;; activate us. - (set! (-> obj blend) 1.0) - (set! (-> obj shutting-down?) #f) + (set! (-> this target quad) (-> target-trans quad)) + (set! (-> this blend) 1.0) + (set! (-> this shutting-down?) #f) ) ) + 0 (none) ) (defun joint-mod-look-at-handler ((csp cspace) (xform transformq)) "Update bone transforms for look-at" - (local-vars (f1-12 float) (sv-48 vector) (sv-52 vector) (sv-56 vector)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 vector)) (let ((gp-0 (the-as joint-mod (-> csp param1)))) (cspace<-parented-transformq-joint! csp xform) - (set! - sv-48 - (vector-normalize-copy! - (new 'stack-no-clear 'vector) - (-> gp-0 process node-list data 0 bone transform vector 1) - 1.0 - ) - ) - (set! - sv-52 - (vector-normalize! (-> csp bone transform vector (-> gp-0 nose)) 1.0) - ) - (set! - sv-56 - (vector-normalize! - (vector-! - (new 'stack-no-clear 'vector) - (-> gp-0 target) - (-> csp bone position) - ) - 1.0 - ) - ) + (set! sv-48 (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (-> gp-0 process node-list data 0 bone transform vector 1) + 1.0 + ) + ) + (set! sv-52 (vector-normalize! (-> csp bone transform vector (-> gp-0 nose)) 1.0)) + (set! sv-56 (vector-normalize! + (vector-! (new 'stack-no-clear 'vector) (-> gp-0 target) (-> csp bone transform vector 3)) + 1.0 + ) + ) (let* ((f30-0 (vector-y-angle sv-52)) - (a0-8 (vector-flatten! (new-stack-vector0) sv-56 sv-48)) - (f0-0 (vector-y-angle a0-8)) + (a0-9 (vector-flatten! (new-stack-vector0) sv-56 sv-48)) + (f0-0 (vector-y-angle a0-9)) (f0-1 (deg-diff f30-0 f0-0)) ) (if (< (-> gp-0 ignore-angle) (fabs f0-1)) (set! f0-1 0.0) ) - (let - ((f30-1 - (fmax - (fmin - (* (* f0-1 (-> gp-0 blend)) (-> gp-0 flex-blend)) - (-> gp-0 twist-max y) + (let ((f30-1 + (fmax (fmin (* f0-1 (-> gp-0 blend) (-> gp-0 flex-blend)) (-> gp-0 twist-max y)) (- (-> gp-0 twist-max y))) ) - (- (-> gp-0 twist-max y)) - ) - ) - ) + ) (if (and (-> gp-0 shutting-down?) (= (-> gp-0 twist y) f30-1)) (set-mode! gp-0 (joint-mod-handler-mode reset)) ) - (set! - (-> gp-0 twist y) - (deg-seek - (-> gp-0 twist y) - f30-1 - (* 0.1 (fabs (deg-diff f30-1 (-> gp-0 twist y)))) - ) - ) + (set! (-> gp-0 twist y) (deg-seek (-> gp-0 twist y) f30-1 (* 0.1 (fabs (deg-diff f30-1 (-> gp-0 twist y)))))) ) ) (let ((v1-15 (-> gp-0 up))) @@ -359,52 +332,32 @@ (quaternion-rotate-x! (-> xform quat) (-> xform quat) (-> gp-0 twist y)) ) ((= v1-15 1) - (quaternion-rotate-local-y! - (-> xform quat) - (-> xform quat) - (-> gp-0 twist y) - ) + (quaternion-rotate-local-y! (-> xform quat) (-> xform quat) (-> gp-0 twist y)) ) (else - (quaternion-rotate-z! (-> xform quat) (-> xform quat) (-> gp-0 twist y)) - ) + (quaternion-rotate-z! (-> xform quat) (-> xform quat) (-> gp-0 twist y)) + ) ) ) - (let* - ((s3-1 - (vector-normalize-copy! - (new 'stack-no-clear 'vector) - (the-as vector (-> gp-0 process node-list data 0 bone transform)) - 1.0 + (let* ((s3-1 (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (the-as vector (-> gp-0 process node-list data 0 bone transform)) + 1.0 + ) + ) + (f30-2 (vector-x-angle sv-52)) + (s3-2 (vector-flatten! (new-stack-vector0) sv-56 s3-1)) + (f0-15 (vector-x-angle s3-2)) + (f0-21 (fmax + (fmin (* (- (deg-diff f30-2 f0-15)) (-> gp-0 blend) (-> gp-0 flex-blend)) (-> gp-0 twist-max x)) + (- (-> gp-0 twist-max x)) + ) + ) ) - ) - (f30-2 (vector-x-angle sv-52)) - (s3-2 (vector-flatten! (new-stack-vector0) sv-56 s3-1)) - (f0-15 (vector-x-angle s3-2)) - (f0-21 - (fmax - (fmin - (* (* (- (deg-diff f30-2 f0-15)) (-> gp-0 blend)) (-> gp-0 flex-blend)) - (-> gp-0 twist-max x) - ) - (- (-> gp-0 twist-max x)) - ) - ) - ) - (let* ((v1-22 sv-52)) - (set! f1-12 (vector-dot s3-2 v1-22)) - ) - (if (< f1-12 0.1) + (if (< (vector-dot s3-2 sv-52) 0.1) (set! f0-21 0.0) ) - (set! - (-> gp-0 twist x) - (deg-seek - (-> gp-0 twist x) - f0-21 - (* 0.1 (fabs (deg-diff f0-21 (-> gp-0 twist x)))) - ) - ) + (set! (-> gp-0 twist x) (deg-seek (-> gp-0 twist x) f0-21 (* 0.1 (fabs (deg-diff f0-21 (-> gp-0 twist x)))))) ) (let ((v1-27 (-> gp-0 ear))) (cond @@ -415,123 +368,90 @@ (quaternion-rotate-local-y! (-> xform quat) (-> xform quat) (-> gp-0 twist x)) ) (else - (quaternion-rotate-z! (-> xform quat) (-> xform quat) (-> gp-0 twist x)) - ) + (quaternion-rotate-z! (-> xform quat) (-> xform quat) (-> gp-0 twist x)) + ) ) ) (cspace<-parented-transformq-joint! csp xform) (if (and (= (-> gp-0 process type) target) (!= (-> gp-0 blend) 0.0)) (add-debug-text-sphere - *display-target-marks* - (bucket-id debug-no-zbuf) - (-> gp-0 target) - 819.2 - "look" - (new 'static 'rgba :r #xff :g #xff :a #x80) - ) + *display-target-marks* + (bucket-id debug-no-zbuf) + (-> gp-0 target) + 819.2 + "look" + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) ) ) + 0 (none) ) (defun joint-mod-world-look-at-handler ((arg0 cspace) (arg1 transformq)) - (local-vars (f1-14 float) (sv-48 vector) (sv-52 vector) (sv-56 vector)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 vector)) (let ((gp-0 (the-as joint-mod (-> arg0 param1)))) (let ((s5-0 (-> arg0 bone transform))) (cspace<-parented-transformq-joint! arg0 arg1) - (set! - sv-48 - (vector-normalize-copy! - (new 'stack-no-clear 'vector) - (-> gp-0 process node-list data 0 bone transform vector 1) - 1.0 - ) - ) + (set! sv-48 + (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (-> gp-0 process node-list data 0 bone transform vector 1) + 1.0 + ) + ) (set! sv-52 (vector-normalize! (-> s5-0 vector (-> gp-0 nose)) 1.0)) - (set! - sv-56 - (vector-normalize! - (vector-! - (new 'stack-no-clear 'vector) - (-> gp-0 target) - (-> s5-0 vector 3) - ) - 1.0 - ) - ) + (set! sv-56 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> gp-0 target) (-> s5-0 vector 3)) 1.0) + ) (let* ((f30-0 (vector-y-angle sv-52)) - (a0-6 (vector-flatten! (new-stack-vector0) sv-56 sv-48)) - (f0-0 (vector-y-angle a0-6)) + (a0-7 (vector-flatten! (new-stack-vector0) sv-56 sv-48)) + (f0-0 (vector-y-angle a0-7)) (f0-1 (deg-diff f30-0 f0-0)) ) (if (< (-> gp-0 ignore-angle) (fabs f0-1)) (set! f0-1 0.0) ) - (let - ((f0-5 - (fmax - (fmin - (* (* f0-1 (-> gp-0 blend)) (-> gp-0 flex-blend)) - (-> gp-0 twist-max y) + (let ((f0-5 + (fmax (fmin (* f0-1 (-> gp-0 blend) (-> gp-0 flex-blend)) (-> gp-0 twist-max y)) (- (-> gp-0 twist-max y))) + ) + ) + (set! (-> gp-0 twist y) + (deg-seek (-> gp-0 twist y) f0-5 (fmax 1.0 (* 0.1 (fabs (deg-diff f0-5 (-> gp-0 twist y)))))) ) - (- (-> gp-0 twist-max y)) - ) - ) - ) - (set! - (-> gp-0 twist y) - (deg-seek - (-> gp-0 twist y) - f0-5 - (fmax 1.0 (* 0.1 (fabs (deg-diff f0-5 (-> gp-0 twist y))))) - ) - ) ) ) (when (!= (-> gp-0 twist y) 0.0) - (let - ((a2-3 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (-> gp-0 twist y))) - (s4-2 (-> s5-0 vector 3 quad)) - ) + (let ((a2-3 (matrix-rotate-y! (new 'stack-no-clear 'matrix) (-> gp-0 twist y))) + (s4-2 (-> s5-0 vector 3 quad)) + ) (matrix*! s5-0 s5-0 a2-3) (set! (-> s5-0 vector 3 quad) s4-2) ) ) - (let* - ((s4-3 - (vector-normalize-copy! - (new 'stack-no-clear 'vector) - (the-as vector (-> gp-0 process node-list data 0 bone transform)) - 1.0 + (let* ((s4-3 + (vector-normalize-copy! + (new 'stack-no-clear 'vector) + (the-as vector (-> gp-0 process node-list data 0 bone transform)) + 1.0 + ) + ) + (f30-2 (vector-x-angle sv-52)) + (s4-4 (vector-flatten! (new-stack-vector0) sv-56 s4-3)) + (f0-14 (vector-x-angle s4-4)) + (f0-20 + (fmax + (fmin (* (- (deg-diff f30-2 f0-14)) (-> gp-0 blend) (-> gp-0 flex-blend)) (-> gp-0 twist-max x)) + (- (-> gp-0 twist-max x)) + ) + ) ) - ) - (f30-2 (vector-x-angle sv-52)) - (s4-4 (vector-flatten! (new-stack-vector0) sv-56 s4-3)) - (f0-14 (vector-x-angle s4-4)) - (f0-20 - (fmax - (fmin - (* (* (- (deg-diff f30-2 f0-14)) (-> gp-0 blend)) (-> gp-0 flex-blend)) - (-> gp-0 twist-max x) - ) - (- (-> gp-0 twist-max x)) - ) - ) - ) - (let* ((v1-14 sv-52)) - (set! f1-14 (vector-dot s4-4 v1-14)) - ) - (if (< f1-14 0.1) + (if (< (vector-dot s4-4 sv-52) 0.1) (set! f0-20 0.0) ) - (set! - (-> gp-0 twist x) - (deg-seek - (-> gp-0 twist x) - f0-20 - (fmax 1.0 (* 0.1 (fabs (deg-diff f0-20 (-> gp-0 twist x))))) - ) - ) + (set! (-> gp-0 twist x) + (deg-seek (-> gp-0 twist x) f0-20 (fmax 1.0 (* 0.1 (fabs (deg-diff f0-20 (-> gp-0 twist x)))))) + ) ) (when (!= (-> gp-0 twist x) 0.0) (let* ((v1-20 (-> gp-0 ear)) @@ -543,12 +463,13 @@ matrix-rotate-y! ) (else - matrix-rotate-z! - ) + matrix-rotate-z! + ) ) - (new 'stack-no-clear 'matrix) (-> gp-0 twist x) + (new 'stack-no-clear 'matrix) + (-> gp-0 twist x) ) - ) + ) ) (matrix*! s5-0 a1-17 s5-0) ) @@ -556,67 +477,67 @@ ) (if (and (= (-> gp-0 process type) target) (!= (-> gp-0 blend) 0.0)) (add-debug-text-sphere - *display-target-marks* - (bucket-id debug-no-zbuf) - (-> gp-0 target) - 819.2 - "look" - (new 'static 'rgba :r #xff :g #xff :a #x80) - ) + *display-target-marks* + (bucket-id debug-no-zbuf) + (-> gp-0 target) + 819.2 + "look" + (new 'static 'rgba :r #xff :g #xff :a #x80) + ) ) ) - (let ((v0-22 0)) - ) + 0 (none) ) (defun joint-mod-rotate-handler ((arg0 cspace) (arg1 transformq)) (let ((s4-0 (the-as joint-mod (-> arg0 param1))) (s3-0 (new 'static 'inline-array vector 3 - (new 'static 'vector :x 1.0 :w 1.0) - (new 'static 'vector :y 1.0 :w 1.0) - (new 'static 'vector :z 1.0 :w 1.0) - ) - ) + (new 'static 'vector :x 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + (new 'static 'vector :z 1.0 :w 1.0) + ) + ) ) (let* ((v1-2 (-> s3-0 (-> s4-0 ear))) (a1-2 (quaternion-axis-angle! - (new 'stack-no-clear 'quaternion) - (-> v1-2 x) - (-> v1-2 y) - (-> v1-2 z) - (* (* (-> s4-0 twist x) (-> s4-0 blend)) (-> s4-0 flex-blend)) - ) - ) + (new 'stack-no-clear 'quaternion) + (-> v1-2 x) + (-> v1-2 y) + (-> v1-2 z) + (* (-> s4-0 twist x) (-> s4-0 blend) (-> s4-0 flex-blend)) + ) + ) ) (quaternion-normalize! (quaternion*! (-> arg1 quat) a1-2 (-> arg1 quat))) ) (let* ((v1-6 (-> s3-0 (-> s4-0 up))) (a1-4 (quaternion-axis-angle! - (new 'stack-no-clear 'quaternion) - (-> v1-6 x) - (-> v1-6 y) - (-> v1-6 z) - (* (* (-> s4-0 twist y) (-> s4-0 blend)) (-> s4-0 flex-blend)) - ) - ) + (new 'stack-no-clear 'quaternion) + (-> v1-6 x) + (-> v1-6 y) + (-> v1-6 z) + (* (-> s4-0 twist y) (-> s4-0 blend) (-> s4-0 flex-blend)) + ) + ) ) (quaternion-normalize! (quaternion*! (-> arg1 quat) a1-4 (-> arg1 quat))) ) (let* ((v1-10 (-> s3-0 (-> s4-0 nose))) (a1-6 (quaternion-axis-angle! - (new 'stack-no-clear 'quaternion) - (-> v1-10 x) - (-> v1-10 y) - (-> v1-10 z) - (* (* (-> s4-0 twist z) (-> s4-0 blend)) (-> s4-0 flex-blend)) - ) - ) + (new 'stack-no-clear 'quaternion) + (-> v1-10 x) + (-> v1-10 y) + (-> v1-10 z) + (* (-> s4-0 twist z) (-> s4-0 blend) (-> s4-0 flex-blend)) + ) + ) ) (quaternion-normalize! (quaternion*! (-> arg1 quat) a1-6 (-> arg1 quat))) ) ) (cspace<-parented-transformq-joint! arg0 arg1) + 0 (none) ) @@ -627,45 +548,41 @@ (set! (-> arg1 scale quad) (-> s4-0 scale quad)) ) (cspace<-parented-transformq-joint! arg0 arg1) - (let ((v0-2 0)) - ) + 0 (none) ) -;; todo vector+! (defun joint-mod-joint-set*-handler ((arg0 cspace) (arg1 transformq)) (let ((s5-0 (the-as joint-mod (-> arg0 param1)))) (vector+! (-> arg1 trans) (-> arg1 trans) (-> s5-0 trans)) - (quaternion-normalize! - (quaternion*! (-> arg1 quat) (-> arg1 quat) (-> s5-0 quat)) - ) + (quaternion-normalize! (quaternion*! (-> arg1 quat) (-> arg1 quat) (-> s5-0 quat))) (vector*! (-> arg1 scale) (-> arg1 scale) (-> s5-0 scale)) (cspace<-parented-transformq-joint! arg0 arg1) (if (-> s5-0 max-dist) (set-vector! (-> arg0 bone scale) 1.0 1.0 1.0 1.0) ) ) + 0 (none) ) -(define *joint-axis-vectors* - (new 'static 'inline-array vector 6 - (new 'static 'vector :x 1.0 :w 1.0) - (new 'static 'vector :y 1.0 :w 1.0) - (new 'static 'vector :z 1.0 :w 1.0) - (new 'static 'vector :x -1.0 :w 1.0) - (new 'static 'vector :y -1.0 :w 1.0) - (new 'static 'vector :z -1.0 :w 1.0) - ) - ) +(define *joint-axis-vectors* (new 'static 'inline-array vector 6 + (new 'static 'vector :x 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :y -1.0 :w 1.0) + (new 'static 'vector :z -1.0 :w 1.0) + ) + ) ;; These joint-mod types contain a bit of extra state required for special types of joint-mods (deftype joint-mod-wheel (basic) - ((last-position vector :inline :offset-assert 16) - (angle float :offset-assert 32) - (process process-drawable :offset-assert 36) - (wheel-radius float :offset-assert 40) - (wheel-axis int8 :offset-assert 44) + ((last-position vector :inline :offset-assert 16) + (angle float :offset-assert 32) + (process process-drawable :offset-assert 36) + (wheel-radius float :offset-assert 40) + (wheel-axis int8 :offset-assert 44) ) :method-count-assert 9 :size-assert #x2d @@ -675,33 +592,30 @@ ) ) + (defun joint-mod-wheel-callback ((arg0 cspace) (arg1 transformq)) (let ((s4-0 (the-as joint-mod-wheel (-> arg0 param1)))) - (let ((v1-1 (-> s4-0 process root)) - (s1-0 (new-stack-vector0)) - (s3-0 (new-stack-vector0)) - (s2-0 (new-stack-vector0)) - ) - 0.0 - 0.0 - (vector-z-quaternion! s2-0 (-> v1-1 quat)) - (vector<-cspace! s1-0 arg0) - (vector-! s3-0 s1-0 (-> s4-0 last-position)) - (set! (-> s4-0 last-position quad) (-> s1-0 quad)) - (let* ((f0-3 (vector-dot s2-0 s3-0)) - (f1-0 65536.0) - (f2-1 (* 6.28318 (-> s4-0 wheel-radius))) - (f0-4 (* (* f1-0 (/ 1.0 f2-1)) f0-3)) - ) - (+! (-> s4-0 angle) f0-4) - ) + (let ((v1-1 (-> s4-0 process root)) + (s1-0 (new-stack-vector0)) + (s3-0 (new-stack-vector0)) + (s2-0 (new-stack-vector0)) + ) + 0.0 + 0.0 + (vector-z-quaternion! s2-0 (-> v1-1 quat)) + (vector<-cspace! s1-0 arg0) + (vector-! s3-0 s1-0 (-> s4-0 last-position)) + (set! (-> s4-0 last-position quad) (-> s1-0 quad)) + (let* ((f0-3 (vector-dot s2-0 s3-0)) + (f1-0 65536.0) + (f2-1 (* 6.28318 (-> s4-0 wheel-radius))) + (f0-4 (* f1-0 (/ 1.0 f2-1) f0-3)) + ) + (+! (-> s4-0 angle) f0-4) + ) + ) + (quaternion-vector-angle! (-> arg1 quat) (-> *joint-axis-vectors* (-> s4-0 wheel-axis)) (-> s4-0 angle)) ) - (quaternion-vector-angle! - (-> arg1 quat) - (-> *joint-axis-vectors* (-> s4-0 wheel-axis)) - (-> s4-0 angle) - ) - ) (cspace<-parented-transformq-joint! arg0 arg1) (none) ) @@ -713,7 +627,7 @@ (set! (-> v0-0 wheel-axis) arg3) (set! (-> v0-0 angle) 0.0) (set-vector! (-> v0-0 last-position) 0.0 0.0 0.0 1.0) - (let ((v1-5 (-> (-> arg0 node-list) data arg1))) + (let ((v1-5 (-> arg0 node-list data arg1))) (set! (-> v1-5 param0) joint-mod-wheel-callback) (set! (-> v1-5 param1) v0-0) ) @@ -722,18 +636,18 @@ ) (deftype joint-mod-set-local (basic) - ((transform transformq :inline :offset-assert 16) - (set-rotation symbol :offset-assert 64) - (set-scale symbol :offset-assert 68) - (set-translation symbol :offset-assert 72) - (enable symbol :offset-assert 76) + ((transform transformq :inline :offset-assert 16) + (set-rotation symbol :offset-assert 64) + (set-scale symbol :offset-assert 68) + (set-translation symbol :offset-assert 72) + (enable symbol :offset-assert 76) ) :method-count-assert 9 :size-assert #x50 :flag-assert #x900000050 (:methods - (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) - ) + (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + ) ) @@ -753,14 +667,21 @@ (cspace<-parented-transformq-joint! arg0 (-> v1-0 transform)) ) (else - (cspace<-parented-transformq-joint! arg0 arg1) - ) + (cspace<-parented-transformq-joint! arg0 arg1) + ) ) ) (none) ) -(defmethod new joint-mod-set-local ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 symbol) (arg4 symbol)) +(defmethod new joint-mod-set-local ((allocation symbol) + (type-to-make type) + (arg0 process-drawable) + (arg1 int) + (arg2 symbol) + (arg3 symbol) + (arg4 symbol) + ) (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (set! (-> v0-0 set-translation) arg2) (set! (-> v0-0 set-rotation) arg3) @@ -778,9 +699,9 @@ ) (deftype joint-mod-set-world (basic) - ((transform transformq :inline :offset-assert 16) - (node-index int32 :offset-assert 64) - (enable basic :offset-assert 68) + ((transform transformq :inline :offset-assert 16) + (node-index int32 :offset-assert 64) + (enable basic :offset-assert 68) ) :method-count-assert 9 :size-assert #x48 @@ -790,6 +711,7 @@ ) ) + (defun joint-mod-set-world-callback ((arg0 cspace) (arg1 transformq)) (let ((v1-0 (the-as joint-mod-set-world (-> arg0 param1)))) (if (-> v1-0 enable) @@ -816,8 +738,8 @@ ) (deftype joint-mod-blend-local (basic) - ((transform transformq :inline :offset-assert 16) - (blend-transform transformq :inline :offset-assert 64) + ((transform transformq :inline :offset-assert 16) + (blend-transform transformq :inline :offset-assert 64) (node-index int32 :offset-assert 112) (blend float :offset-assert 116) (enable basic :offset-assert 120) @@ -826,37 +748,28 @@ :size-assert #x7c :flag-assert #x90000007c (:methods - (new (symbol type process-drawable int basic) _type_ 0) - ) + (new (symbol type process-drawable int basic) _type_ 0) + ) ) + (defun joint-mod-blend-local-callback ((arg0 cspace) (arg1 transformq)) (let ((gp-0 (the-as joint-mod-blend-local (-> arg0 param1)))) (cond ((-> gp-0 enable) (vector-lerp! - (the-as vector (-> gp-0 blend-transform)) - (-> arg1 trans) - (the-as vector (-> gp-0 transform)) - (-> gp-0 blend) - ) - (vector-lerp! - (-> gp-0 blend-transform scale) - (-> arg1 scale) - (-> gp-0 transform scale) - (-> gp-0 blend) - ) - (quaternion-slerp! - (-> gp-0 blend-transform quat) - (-> arg1 quat) - (-> gp-0 transform quat) - (-> gp-0 blend) - ) + (the-as vector (-> gp-0 blend-transform)) + (-> arg1 trans) + (the-as vector (-> gp-0 transform)) + (-> gp-0 blend) + ) + (vector-lerp! (-> gp-0 blend-transform scale) (-> arg1 scale) (-> gp-0 transform scale) (-> gp-0 blend)) + (quaternion-slerp! (-> gp-0 blend-transform quat) (-> arg1 quat) (-> gp-0 transform quat) (-> gp-0 blend)) (cspace<-parented-transformq-joint! arg0 (-> gp-0 blend-transform)) ) (else - (cspace<-parented-transformq-joint! arg0 arg1) - ) + (cspace<-parented-transformq-joint! arg0 arg1) + ) ) ) (none) @@ -879,10 +792,10 @@ ) (deftype joint-mod-spinner (basic) - ((spin-axis vector :inline :offset-assert 16) - (angle float :offset-assert 32) - (spin-rate float :offset-assert 36) - (enable basic :offset-assert 40) + ((spin-axis vector :inline :offset-assert 16) + (angle float :offset-assert 32) + (spin-rate float :offset-assert 36) + (enable basic :offset-assert 40) ) :method-count-assert 9 :size-assert #x2c @@ -892,14 +805,11 @@ ) ) + (defun joint-mod-spinner-callback ((arg0 cspace) (arg1 transformq)) (let ((gp-0 (the-as joint-mod-spinner (-> arg0 param1)))) (when (-> gp-0 enable) - (let ((f30-0 (+ (-> gp-0 angle) - (* (-> gp-0 spin-rate) (-> *display* seconds-per-frame)) - ) - ) - ) + (let ((f30-0 (+ (-> gp-0 angle) (* (-> gp-0 spin-rate) (seconds-per-frame))))) (if (< 32768.0 f30-0) (set! f30-0 (+ -65536.0 f30-0)) ) @@ -917,17 +827,14 @@ (defmethod new joint-mod-spinner ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 vector) (arg3 float)) (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (let ((v1-2 (-> v0-0 spin-axis))) - (set! (-> v1-2 quad) (-> arg2 quad)) - ) + (set! (-> v0-0 spin-axis quad) (-> arg2 quad)) (set! (-> v0-0 spin-rate) arg3) (set! (-> v0-0 enable) #t) (set! (-> v0-0 angle) 0.0) - (let ((v1-6 (-> (-> arg0 node-list) data arg1))) + (let ((v1-6 (-> arg0 node-list data arg1))) (set! (-> v1-6 param0) joint-mod-spinner-callback) (set! (-> v1-6 param1) v0-0) ) v0-0 ) ) - diff --git a/goal_src/jak1/engine/anim/joint.gc b/goal_src/jak1/engine/anim/joint.gc index 1249b66370..15c14b7695 100644 --- a/goal_src/jak1/engine/anim/joint.gc +++ b/goal_src/jak1/engine/anim/joint.gc @@ -14,60 +14,60 @@ ;; Basic Methods for joint/joint-control ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod print joint ((obj joint)) - (format #t "#<~A ~S ~D @ #x~X>" (-> obj type) (-> obj name) (-> obj number) obj) - obj +(defmethod print joint ((this joint)) + (format #t "#<~A ~S ~D @ #x~X>" (-> this type) (-> this name) (-> this number) this) + this ) -(defmethod mem-usage joint ((obj joint) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage joint ((this joint) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 66 (-> arg0 length))) (set! (-> arg0 data 65 name) "joint") (+! (-> arg0 data 65 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 65 used) v1-6) (+! (-> arg0 data 65 total) (logand -16 (+ v1-6 15))) ) - obj + this ) -(defmethod print joint-anim ((obj joint-anim)) - (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> obj type) (-> obj name) (-> obj number) (-> obj length) obj) - obj +(defmethod print joint-anim ((this joint-anim)) + (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> this type) (-> this name) (-> this number) (-> this length) this) + this ) -(defmethod length joint-anim ((obj joint-anim)) - (-> obj length) +(defmethod length joint-anim ((this joint-anim)) + (-> this length) ) -(defmethod inspect joint-anim-matrix ((obj joint-anim-matrix)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnumber: ~D~%" (-> obj number)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - obj +(defmethod inspect joint-anim-matrix ((this joint-anim-matrix)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnumber: ~D~%" (-> this number)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + this ) -(defmethod asize-of joint-anim-matrix ((obj joint-anim-matrix)) - (the-as int (+ (-> joint-anim-matrix size) (* (-> obj length) 64))) +(defmethod asize-of joint-anim-matrix ((this joint-anim-matrix)) + (the-as int (+ (-> joint-anim-matrix size) (* (-> this length) 64))) ) -(defmethod inspect joint-anim-transformq ((obj joint-anim-transformq)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnumber: ~D~%" (-> obj number)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~`transformq`P~%" s5-0 (-> obj data s5-0)) +(defmethod inspect joint-anim-transformq ((this joint-anim-transformq)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnumber: ~D~%" (-> this number)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~`transformq`P~%" s5-0 (-> this data s5-0)) ) - obj + this ) -(defmethod asize-of joint-anim-transformq ((obj joint-anim-transformq)) - (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> obj length)))) +(defmethod asize-of joint-anim-transformq ((this joint-anim-transformq)) + (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> this length)))) ) -(defmethod asize-of joint-anim-drawable ((obj joint-anim-drawable)) - (the-as int (+ (-> joint-anim-drawable size) (* (-> obj length) 4))) +(defmethod asize-of joint-anim-drawable ((this joint-anim-drawable)) + (the-as int (+ (-> joint-anim-drawable size) (* (-> this length) 4))) ) (defun joint-anim-login ((arg0 joint-anim-drawable)) @@ -94,18 +94,18 @@ arg0 ) -(defmethod mem-usage joint-anim-drawable ((obj joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage joint-anim-drawable ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 77 (-> arg0 length))) (set! (-> arg0 data 76 name) "joint-anim-drawable") (+! (-> arg0 data 76 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 76 used) v1-6) (+! (-> arg0 data 76 total) (logand -16 (+ v1-6 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) (defun jacc-mem-usage ((arg0 joint-anim-compressed-control) (arg1 memory-usage-block) (arg2 int)) @@ -135,18 +135,18 @@ arg0 ) -(defmethod print joint-control-channel ((obj joint-control-channel)) +(defmethod print joint-control-channel ((this joint-control-channel)) (format #t "#" - (-> obj command) - (-> obj frame-group) - (-> obj frame-num) - obj + (-> this command) + (-> this frame-group) + (-> this frame-num) + this ) - obj + this ) -(defmethod asize-of joint-control ((obj joint-control)) - (the-as int (+ (-> obj type size) (* 48 (-> obj allocated-length)))) +(defmethod asize-of joint-control ((this joint-control)) + (the-as int (+ (-> this type size) (* 48 (-> this allocated-length)))) ) (defmethod new joint-control ((allocation symbol) (type-to-make type) (arg0 int)) @@ -167,25 +167,25 @@ ) ) -(defmethod debug-print-frames joint-control-channel ((obj joint-control-channel)) +(defmethod debug-print-frames joint-control-channel ((this joint-control-channel)) "Print the current frame of each joint on this channel. Note: this only appears to work for uncompressed joint animations." - (let ((s5-0 (-> obj frame-group)) - (f30-0 (-> obj frame-num)) + (let ((s5-0 (-> this frame-group)) + (f30-0 (-> this frame-num)) ) (dotimes (s4-0 (length s5-0)) (format #t "joint ~A ~D " (-> s5-0 data s4-0 name) s4-0) (joint-anim-inspect-elt (-> s5-0 data s4-0) f30-0) ) ) - obj + this ) -(defmethod debug-print-channels joint-control ((obj joint-control) (arg0 symbol)) +(defmethod debug-print-channels joint-control ((this joint-control) (arg0 symbol)) "Print each active channel to the given stream." - (dotimes (s4-0 (-> obj active-channels)) - (let* ((v1-6 (if (and (-> obj channel s4-0 frame-group) (nonzero? (-> obj channel s4-0 frame-group))) - (-> obj channel s4-0 frame-group) + (dotimes (s4-0 (-> this active-channels)) + (let* ((v1-6 (if (and (-> this channel s4-0 frame-group) (nonzero? (-> this channel s4-0 frame-group))) + (-> this channel s4-0 frame-group) ) ) @@ -194,7 +194,7 @@ arg0 "ch:~2d ~C ~-35S f: ~6,,2f ~4,,2f ~4,,2f%~%" s4-0 ;; channel index - (case (-> obj channel s4-0 command) ;; how we got added. + (case (-> this channel s4-0 command) ;; how we got added. (('push) 80 ) @@ -212,11 +212,11 @@ ) ) (if v1-6 (-> v1-6 name) "(none)") ;; name of anim (can be "none" in the real game) - (+ (* (-> obj channel s4-0 frame-num) (if v1-6 (-> v1-6 artist-step) 1.0)) ;; frame number + (+ (* (-> this channel s4-0 frame-num) (if v1-6 (-> v1-6 artist-step) 1.0)) ;; frame number (if v1-6 (-> v1-6 artist-base) 0.0) ) - (-> obj channel s4-0 frame-interp) - (-> obj channel s4-0 inspector-amount) + (-> this channel s4-0 frame-interp) + (-> this channel s4-0 inspector-amount) ) ) ) @@ -236,136 +236,136 @@ ;; art-mesh-anim: not used ;; art-joint-anim: used for animations. Provides joint-anim-compressed and eye-anim. -(defmethod needs-link? art ((obj art)) +(defmethod needs-link? art ((this art)) #f ) -(defmethod lookup-art art ((obj art) (arg0 string) (arg1 type)) +(defmethod lookup-art art ((this art) (arg0 string) (arg1 type)) "Look-up an art with the given name and type." (the-as joint #f) ) -(defmethod lookup-idx-of-art art ((obj art) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art art ((this art) (arg0 string) (arg1 type)) "Look up the index of an art with the given name and type." (the-as int #f) ) -(defmethod print art ((obj art)) - (format #t "#<~A ~S :length ~D @ #x~X>" (-> obj type) (-> obj name) (-> obj length) obj) - obj +(defmethod print art ((this art)) + (format #t "#<~A ~S :length ~D @ #x~X>" (-> this type) (-> this name) (-> this length) this) + this ) -(defmethod length art ((obj art)) - (-> obj length) +(defmethod length art ((this art)) + (-> this length) ) -(defmethod login art ((obj art)) +(defmethod login art ((this art)) ;; not sure why we have to do this, but if the res-lump isn't properly set up to point to the tags ;; do it manually. - (if (and (-> obj extra) (zero? (-> obj extra tag))) - (set! (-> obj extra tag) (&+ (the-as (pointer res-tag) (-> obj extra)) 28)) + (if (and (-> this extra) (zero? (-> this extra tag))) + (set! (-> this extra tag) (&+ (the-as (pointer res-tag) (-> this extra)) 28)) ) - obj + this ) -(defmethod mem-usage art-mesh-anim ((obj art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-mesh-anim ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 72 (-> arg0 length))) (set! (-> arg0 data 71 name) "art-mesh-anim") (+! (-> arg0 data 71 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 71 used) v1-6) (+! (-> arg0 data 71 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod asize-of art-joint-anim ((obj art-joint-anim)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-joint-anim ((this art-joint-anim)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) -(defmethod mem-usage art-joint-anim ((obj art-joint-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-joint-anim ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 75 (-> arg0 length))) (set! (-> arg0 data 74 name) "art-joint-anim") (+! (-> arg0 data 74 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 74 used) v1-6) (+! (-> arg0 data 74 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (jacc-mem-usage (-> obj frames) arg0 arg1) - (dotimes (s4-1 (-> obj length)) + (jacc-mem-usage (-> this frames) arg0 arg1) + (dotimes (s4-1 (-> this length)) (set! (-> arg0 length) (max 67 (-> arg0 length))) (set! (-> arg0 data 66 name) "joint-anim-compressed") (+! (-> arg0 data 66 count) 1) - (let ((v1-22 (asize-of (-> obj data s4-1)))) + (let ((v1-22 (asize-of (-> this data s4-1)))) (+! (-> arg0 data 66 used) v1-22) (+! (-> arg0 data 66 total) (logand -16 (+ v1-22 15))) ) ) - (when (and (nonzero? (-> obj eye-anim-data)) (-> obj eye-anim-data)) + (when (and (nonzero? (-> this eye-anim-data)) (-> this eye-anim-data)) (set! (-> arg0 length) (max 109 (-> arg0 length))) (set! (-> arg0 data 108 name) "eye-anim") (+! (-> arg0 data 108 count) 1) - (let ((v1-41 (* (* (+ (-> obj eye-anim-data max-frame) 1) 2) 8))) + (let ((v1-41 (* (* (+ (-> this eye-anim-data max-frame) 1) 2) 8))) (+! (-> arg0 data 108 used) v1-41) (+! (-> arg0 data 108 total) (logand -16 (+ v1-41 15))) ) ) - obj + this ) ;; definition for method 3 of type art-group -(defmethod inspect art-group ((obj art-group)) +(defmethod inspect art-group ((this art-group)) "Print the arts in an art-group" - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tinfo: ~A~%" (-> obj info)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (if (-> obj data s5-0) - (format #t "~T [~D] ~A (~D bytes)~%"s5-0 (-> obj data s5-0) (mem-size (-> obj data s5-0) #f 0)) - (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> obj data s5-0) 0) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tinfo: ~A~%" (-> this info)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (if (-> this data s5-0) + (format #t "~T [~D] ~A (~D bytes)~%"s5-0 (-> this data s5-0) (mem-size (-> this data s5-0) #f 0)) + (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> this data s5-0) 0) ) ) - obj + this ) -(defmethod needs-link? art-group ((obj art-group)) +(defmethod needs-link? art-group ((this art-group)) "Does this art-group need to be added to the level's art group? Some animations are streamed in, and need to be linked/unlinked to the level's list of art groups." - (the-as symbol (and (-> obj length) - (type-type? (-> obj data 0 type) art-joint-anim) - (!= (-> obj name) (-> (the-as art-joint-anim (-> obj data 0)) master-art-group-name)) + (the-as symbol (and (-> this length) + (type-type? (-> this data 0 type) art-joint-anim) + (!= (-> this name) (-> (the-as art-joint-anim (-> this data 0)) master-art-group-name)) ) ) ) -(defmethod lookup-art art-group ((obj art-group) (arg0 string) (arg1 type)) +(defmethod lookup-art art-group ((this art-group) (arg0 string) (arg1 type)) "Get the art with the given name and type. Set type to false if you don't care." (the-as joint (cond (arg1 - (let ((s3-0 (+ (length (-> obj name)) 1))) - (dotimes (s2-0 (-> obj length)) - (if (and (-> obj data s2-0) ;; entry is populated - (= (-> obj data s2-0 type) arg1) ;; type is right - (or (name= arg0 (-> obj data s2-0 name)) ;; name is right. - (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0)) ;; also seek past ag name, and try again. + (let ((s3-0 (+ (length (-> this name)) 1))) + (dotimes (s2-0 (-> this length)) + (if (and (-> this data s2-0) ;; entry is populated + (= (-> this data s2-0 type) arg1) ;; type is right + (or (name= arg0 (-> this data s2-0 name)) ;; name is right. + (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0)) ;; also seek past ag name, and try again. ) ) - (return (the-as joint (-> obj data s2-0))) + (return (the-as joint (-> this data s2-0))) ) ) ) @@ -373,9 +373,9 @@ ) (else ;; no type (also no weird after ag name check) - (dotimes (s4-1 (-> obj length)) - (if (and (-> obj data s4-1) (name= arg0 (-> obj data s4-1 name))) - (return (the-as joint (-> obj data s4-1))) + (dotimes (s4-1 (-> this length)) + (if (and (-> this data s4-1) (name= arg0 (-> this data s4-1 name))) + (return (the-as joint (-> this data s4-1))) ) ) (the-as art #f) @@ -384,17 +384,17 @@ ) ) -(defmethod lookup-idx-of-art art-group ((obj art-group) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art art-group ((this art-group) (arg0 string) (arg1 type)) "Get the index of the art with the given name and type. Set type to false if you don't care. Will return #f if the art is not found." (cond (arg1 - (let ((s3-0 (+ (length (-> obj name)) 1))) - (dotimes (s2-0 (-> obj length)) + (let ((s3-0 (+ (length (-> this name)) 1))) + (dotimes (s2-0 (-> this length)) (if (and - (-> obj data s2-0) - (= (-> obj data s2-0 type) arg1) - (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) + (-> this data s2-0) + (= (-> this data s2-0 type) arg1) + (or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) ) (return s2-0) ) @@ -403,8 +403,8 @@ (the-as int #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (and (-> obj data s4-1) (name= arg0 (-> obj data s4-1 name))) + (dotimes (s4-1 (-> this length)) + (if (and (-> this data s4-1) (name= arg0 (-> this data s4-1 name))) (return s4-1) ) ) @@ -413,61 +413,61 @@ ) ) -(defmethod login art-group ((obj art-group)) +(defmethod login art-group ((this art-group)) "Log in all the arts in a group." - (dotimes (s5-0 (-> obj length)) - (if (-> obj data s5-0) - (set! (-> obj data s5-0) (login (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (if (-> this data s5-0) + (set! (-> this data s5-0) (login (-> this data s5-0))) ) ) - obj + this ) -(defmethod mem-usage art-group ((obj art-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-group ((this art-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 71 (-> arg0 length))) (set! (-> arg0 data 70 name) "art-group") (+! (-> arg0 data 70 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 70 used) v1-6) (+! (-> arg0 data 70 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (if (-> obj data s3-0) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (if (-> this data s3-0) + (mem-usage (-> this data s3-0) arg0 arg1) ) ) - obj + this ) -(defmethod relocate art-group ((obj art-group) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate art-group ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) "Handle a loaded art-group." (let ((s4-0 (clear *temp-string*))) (string<-charp s4-0 arg1) - (set! obj (cond - ((not obj) + (set! this (cond + ((not this) (format 0 "ERROR: art-group ~A is not a valid file.~%" s4-0) (the-as art-group #f) ) - ((not (type-type? (-> obj type) art-group)) + ((not (type-type? (-> this type) art-group)) (format 0 "ERROR: art-group ~A is not a art-group.~%" s4-0) (the-as art-group #f) ) - ((not (file-info-correct-version? (-> obj info) (file-kind art-group) 0)) + ((not (file-info-correct-version? (-> this info) (file-kind art-group) 0)) (the-as art-group #f) ) (else (let ((s5-1 (-> *level* loading-level))) (if (or (not s5-1) (= (-> s5-1 name) 'default)) - (login obj) ;; not part of level load, just normal login. + (login this) ;; not part of level load, just normal login. ) (if s5-1 - (set-loaded-art (-> s5-1 art-group) obj) ;; part of level load, add to level's ag, but don't log in yet. + (set-loaded-art (-> s5-1 art-group) this) ;; part of level load, add to level's ag, but don't log in yet. ) ) - obj + this ) ) ) @@ -475,52 +475,52 @@ (none) ) -(defmethod asize-of art-mesh-geo ((obj art-mesh-geo)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-mesh-geo ((this art-mesh-geo)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) -(defmethod mem-usage art-mesh-geo ((obj art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-mesh-geo ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 73 (-> arg0 length))) (set! (-> arg0 data 72 name) "art-mesh-geo") (+! (-> arg0 data 72 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 72 used) v1-6) (+! (-> arg0 data 72 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod login art-joint-anim ((obj art-joint-anim)) - (if (and (-> obj extra) (zero? (-> obj extra tag))) - (set! (-> obj extra tag) (&+ (the-as (pointer res-tag) (-> obj extra)) 28)) +(defmethod login art-joint-anim ((this art-joint-anim)) + (if (and (-> this extra) (zero? (-> this extra tag))) + (set! (-> this extra tag) (&+ (the-as (pointer res-tag) (-> this extra)) 28)) ) - obj + this ) -(defmethod asize-of art-joint-geo ((obj art-joint-geo)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-joint-geo ((this art-joint-geo)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) -(defmethod lookup-art art-joint-geo ((obj art-joint-geo) (arg0 string) (arg1 type)) +(defmethod lookup-art art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 - (dotimes (s3-0 (-> obj length)) - (if (and (= (-> obj data s3-0 type) arg1) (name= arg0 (-> obj data s3-0 name))) - (return (-> obj data s3-0)) + (dotimes (s3-0 (-> this length)) + (if (and (= (-> this data s3-0 type) arg1) (name= arg0 (-> this data s3-0 name))) + (return (-> this data s3-0)) ) ) (the-as joint #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (name= arg0 (-> obj data s4-1 name)) - (return (-> obj data s4-1)) + (dotimes (s4-1 (-> this length)) + (if (name= arg0 (-> this data s4-1 name)) + (return (-> this data s4-1)) ) ) (the-as joint #f) @@ -528,19 +528,19 @@ ) ) -(defmethod lookup-idx-of-art art-joint-geo ((obj art-joint-geo) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 - (dotimes (s3-0 (-> obj length)) - (if (and (= (-> obj data s3-0 type) arg1) (name= arg0 (-> obj data s3-0 name))) + (dotimes (s3-0 (-> this length)) + (if (and (= (-> this data s3-0 type) arg1) (name= arg0 (-> this data s3-0 name))) (return s3-0) ) ) (the-as int #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (name= arg0 (-> obj data s4-1 name)) + (dotimes (s4-1 (-> this length)) + (if (name= arg0 (-> this data s4-1 name)) (return s4-1) ) ) @@ -549,21 +549,21 @@ ) ) -(defmethod mem-usage art-joint-geo ((obj art-joint-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-joint-geo ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 74 (-> arg0 length))) (set! (-> arg0 data 73 name) "art-joint-geo") (+! (-> arg0 data 73 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 73 used) v1-6) (+! (-> arg0 data 73 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1029,14 +1029,14 @@ (the-as matrix (-> arg0 data)) ) -(defmethod reset-and-assign-geo! cspace ((obj cspace) (arg0 basic)) - (set! (-> obj parent) #f) - (set! (-> obj joint) #f) - (set! (-> obj geo) arg0) - (set! (-> obj param0) #f) - (set! (-> obj param1) #f) - (set! (-> obj param2) #f) - obj +(defmethod reset-and-assign-geo! cspace ((this cspace) (arg0 basic)) + (set! (-> this parent) #f) + (set! (-> this joint) #f) + (set! (-> this geo) arg0) + (set! (-> this param0) #f) + (set! (-> this param1) #f) + (set! (-> this param2) #f) + this ) (defmethod new cspace ((allocation symbol) (type-to-make type) (arg0 basic)) diff --git a/goal_src/jak1/engine/anim/mspace-h.gc b/goal_src/jak1/engine/anim/mspace-h.gc index 3339980db3..f54203df1a 100644 --- a/goal_src/jak1/engine/anim/mspace-h.gc +++ b/goal_src/jak1/engine/anim/mspace-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: mspace-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; this file contains types for the skeletal animation system. ;; the "bones" are the actual matrix data consumed by the renderers. ;; the "joints" describe how bones are connected. @@ -18,10 +20,10 @@ ;; First, the joint. This type just describes how the skeleton is connected and the bind pose. (deftype joint (basic) - ((name string :offset-assert 4) ;; the joint's name (neckA, neckB, Rtoes, etc) - (number int32 :offset-assert 8) ;; the joint's number in the cspace-array - (parent joint :offset-assert 12) ;; the parent joint (ex, Lshould has parent of chest) - (bind-pose matrix :inline :offset-assert 16) ;; the bind pose, as a matrix. + ((name string :offset-assert 4) ;; the joint's name (neckA, neckB, Rtoes, etc) + (number int32 :offset-assert 8) ;; the joint's number in the cspace-array + (parent joint :offset-assert 12) ;; the parent joint (ex, Lshould has parent of chest) + (bind-pose matrix :inline :offset-assert 16) ;; the bind pose, as a matrix. ) :method-count-assert 9 :size-assert #x50 @@ -31,10 +33,10 @@ ;; I believe this stores offsets, in bytes, of where there are stored ;; (possibly in the scratchpad) (deftype bone-cache (structure) - ((bone-matrix uint32 :offset-assert 0) - (parent-matrix uint32 :offset-assert 4) - (dummy uint32 :offset-assert 8) - (frame uint32 :offset-assert 12) + ((bone-matrix uint32 :offset-assert 0) + (parent-matrix uint32 :offset-assert 4) + (dummy uint32 :offset-assert 8) + (frame uint32 :offset-assert 12) ) :method-count-assert 9 :size-assert #x10 @@ -44,10 +46,10 @@ ;; The "bone" stores the final positions of the bodies. ;; This is a world space transform. (deftype bone (structure) - ((transform matrix :inline :offset-assert 0) - (position vector :inline :offset 48) ;; overlays the matrix - (scale vector :inline :offset-assert 64) - (cache bone-cache :inline :offset-assert 80) + ((transform matrix :inline :offset-assert 0) + (position vector :inline :offset 48) ;; overlays the matrix + (scale vector :inline :offset-assert 64) + (cache bone-cache :inline :offset-assert 80) ) :method-count-assert 9 :size-assert #x60 @@ -76,19 +78,18 @@ ;; node 4 is the first real joint (for jak, it's upper body). (deftype cspace (structure) - ((parent cspace :offset-assert 0) ;; the parent body - (joint joint :offset-assert 4) ;; the joint which moves us - (joint-num int16 :offset-assert 8) ;; seems to be 0 always?? - (geo basic :offset-assert 12) ;; seems to be #f always - (bone bone :offset-assert 16) ;; points to our bone. - (param0 function :offset-assert 20) ;; function to run to update. - (param1 basic :offset-assert 24) ;; parameter - (param2 basic :offset-assert 28) ;; parameter + ((parent cspace :offset-assert 0) ;; the parent body + (joint joint :offset-assert 4) ;; the joint which moves us + (joint-num int16 :offset-assert 8) ;; seems to be 0 always?? + (geo basic :offset-assert 12) ;; seems to be #f always + (bone bone :offset-assert 16) ;; points to our bone. + (param0 function :offset-assert 20) ;; function to run to update. + (param1 basic :offset-assert 24) ;; parameter + (param2 basic :offset-assert 28) ;; parameter ) :method-count-assert 10 :size-assert #x20 :flag-assert #xa00000020 - ;; params are loaded with signed loads. (:methods (new (symbol type basic) _type_ 0) (reset-and-assign-geo! (_type_ basic) _type_ 9) @@ -97,23 +98,23 @@ ;; All the cspaces for a character. (deftype cspace-array (inline-array-class) - ((data cspace :inline :dynamic :offset-assert 16)) + ((data cspace :inline :dynamic :offset-assert 16) + ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) (set! (-> cspace-array heap-base) 32) - -(defmethod print cspace ((obj cspace)) - "Print a cspace, with the attached joint" - (format #t "#" - (if (-> obj joint) - (-> obj joint name) - "nojoint") - obj - ) - obj +(defmethod print cspace ((this cspace)) + (format + #t + "#" + (if (-> this joint) + (-> this joint name) + "nojoint" + ) + this + ) + this ) - - diff --git a/goal_src/jak1/engine/camera/cam-master.gc b/goal_src/jak1/engine/camera/cam-master.gc index ca6ad8b186..bfc44d015c 100644 --- a/goal_src/jak1/engine/camera/cam-master.gc +++ b/goal_src/jak1/engine/camera/cam-master.gc @@ -74,18 +74,18 @@ (set! (-> self string-max target z) (-> self stringMaxLength)) (set! (-> self string-push-z) (fmax (-> self string-min value z) (-> *CAMERA-bank* default-string-push-z))) (cond - ((>= (- (-> *display* base-frame-counter) (the-as time-frame (if *target* - (the-as int (-> *target* neck notice-time)) - 0 - ) - ) - ) - (-> *CAMERA-bank* attack-timeout) - ) + ((time-elapsed? + (the-as time-frame (if *target* + (the-as int (-> *target* neck notice-time)) + 0 + ) + ) + (-> *CAMERA-bank* attack-timeout) + ) (set! (-> self being-attacked) #f) ) (else - (set! (-> self attack-start) (-> *display* base-frame-counter)) + (set-time! (-> self attack-start)) (set! (-> self being-attacked) #t) (when (and (not (logtest? (-> self master-options) 64)) (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) @@ -294,19 +294,19 @@ (return (the-as symbol #f)) ) (cond - ((>= (- (-> *display* base-frame-counter) (the-as time-frame (if *target* - (the-as int (-> *target* neck notice-time)) - 0 - ) - ) - ) - (-> *CAMERA-bank* attack-timeout) - ) + ((time-elapsed? + (the-as time-frame (if *target* + (the-as int (-> *target* neck notice-time)) + 0 + ) + ) + (-> *CAMERA-bank* attack-timeout) + ) (set! (-> self being-attacked) #f) ) (else (if (not (-> self being-attacked)) - (set! (-> self attack-start) (-> *display* base-frame-counter)) + (set-time! (-> self attack-start)) ) (set! (-> self being-attacked) #t) (when (and (not (logtest? (-> self master-options) 64)) @@ -1507,7 +1507,7 @@ ) ) ((= v1-0 'part-water-drip) - (set! (-> self water-drip-time) (-> *display* base-frame-counter)) + (set-time! (-> self water-drip-time)) (set! (-> self water-drip-mult) (the-as float (-> block param 0))) (set! (-> self water-drip-speed) (the-as float (-> block param 1))) ) diff --git a/goal_src/jak1/engine/camera/cam-states-dbg.gc b/goal_src/jak1/engine/camera/cam-states-dbg.gc index a2a278e741..c4e85eaa13 100644 --- a/goal_src/jak1/engine/camera/cam-states-dbg.gc +++ b/goal_src/jak1/engine/camera/cam-states-dbg.gc @@ -538,13 +538,7 @@ ) (when *camera-read-analog* (let ((f0-20 - (analog-input - (the-as int (-> *cpad-list* cpads 0 rightx)) - 128.0 - 32.0 - 110.0 - (* 21845.334 (-> *display* seconds-per-frame)) - ) + (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 32.0 110.0 (* 21845.334 (seconds-per-frame))) ) ) (set! (-> *camera-orbit-info* rot) diff --git a/goal_src/jak1/engine/camera/cam-states.gc b/goal_src/jak1/engine/camera/cam-states.gc index d734e09505..ea6b455d70 100644 --- a/goal_src/jak1/engine/camera/cam-states.gc +++ b/goal_src/jak1/engine/camera/cam-states.gc @@ -429,7 +429,7 @@ ) ) :code (behavior () - (let ((gp-0 (-> *display* base-frame-counter))) + (let ((gp-0 (current-time))) (loop (when (not (paused?)) (let ((s4-0 (vector-reset! (new-stack-vector0))) @@ -475,10 +475,10 @@ ) (cond ((and (= (-> s4-0 x) 0.0) (= (-> s4-0 y) 0.0)) - (set! gp-0 (-> *display* base-frame-counter)) + (set! gp-0 (current-time)) ) (else - (let ((v1-44 (min 10 (max 1 (- (-> *display* base-frame-counter) gp-0))))) + (let ((v1-44 (min 10 (max 1 (- (current-time) gp-0))))) (vector-float*! s4-0 s4-0 (* 0.1 (the float v1-44))) ) ) @@ -884,7 +884,7 @@ (the-as float 128.0) (the-as float 32.0) (the-as float 110.0) - (* 8192.0 (-> *display* seconds-per-frame)) + (* 8192.0 (seconds-per-frame)) ) ) (f1-2 (analog-input-vertical-third ;; og:preserve-this changed for pc port @@ -892,7 +892,7 @@ (the-as float 128.0) (the-as float 32.0) (the-as float 110.0) - (* 8192.0 (-> *display* seconds-per-frame)) + (* 8192.0 (seconds-per-frame)) ) ) (s2-0 (new-stack-matrix0)) @@ -911,9 +911,7 @@ (set! f1-2 (- f1-2)) ) (let* ((f1-3 (+ f24-0 f1-2)) - (f1-5 - (fmin (* 8192.0 (-> *display* seconds-per-frame)) (fmax (* -8192.0 (-> *display* seconds-per-frame)) f1-3)) - ) + (f1-5 (fmin (* 8192.0 (seconds-per-frame)) (fmax (* -8192.0 (seconds-per-frame)) f1-3))) ) (cond ((and (< 0.0 f1-5) (< 0.0 f0-9) (< (-> self max-angle-curr) f28-0)) @@ -1781,6 +1779,7 @@ (f6-0 (-> sv-224 y)) (f7-0 (-> sv-224 z)) ) + ;; og:preserve-this inlined vector-dot ; (.mula.s f2-0 f5-0) ; (.madda.s f3-0 f6-0) ; (.madd.s f2-1 f4-0 f7-0) @@ -2033,8 +2032,8 @@ ) (set! (-> self los-last-pos quad) (-> self good-point quad)) (when *display-cam-los-debug* - (format 0 "going because u(~f) > 0 frame ~D~%" f30-2 (-> *display* base-frame-counter)) - (format *stdcon* " going because u(~f) > 0 frame ~D~%" f30-2 (-> *display* base-frame-counter)) + (format 0 "going because u(~f) > 0 frame ~D~%" f30-2 (current-time)) + (format *stdcon* " going because u(~f) > 0 frame ~D~%" f30-2 (current-time)) ) (logior! (-> self options) 4096) ) @@ -2255,9 +2254,7 @@ (if (-> self have-phony-joystick) (set! f28-0 (* 0.05 (-> self phony-joystick-y))) ) - (if (and (-> *camera* being-attacked) - (< (- (-> *display* base-frame-counter) (-> *camera* attack-start)) (seconds 0.25)) - ) + (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05) ) (if (!= f28-0 0.0) @@ -2338,7 +2335,7 @@ (the-as float 128.0) (the-as float 32.0) (the-as float 110.0) - (* 21845.334 (-> *display* seconds-per-frame)) + (* 21845.334 (seconds-per-frame)) ) ) (s4-0 (new-stack-matrix0)) @@ -2346,7 +2343,7 @@ (s5-2 (new-stack-vector0)) ) (if (-> self have-phony-joystick) - (set! f0-29 (* 21845.334 (-> self phony-joystick-x) (-> *display* seconds-per-frame))) + (set! f0-29 (* 21845.334 (-> self phony-joystick-x) (seconds-per-frame))) ) (cond ((and (= (-> self los-state) (slave-los-state ccw)) (< 0.0 f0-29)) @@ -2354,7 +2351,7 @@ (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) ) ) - (set! f0-29 (* 21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-34)) (-> *display* seconds-per-frame))) + (set! f0-29 (* 21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-34)) (seconds-per-frame))) ) ) ((and (= (-> self los-state) (slave-los-state cw)) (< f0-29 0.0)) @@ -2362,7 +2359,7 @@ (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) ) ) - (set! f0-29 (* -21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-40)) (-> *display* seconds-per-frame))) + (set! f0-29 (* -21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-40)) (seconds-per-frame))) ) ) ) @@ -2380,7 +2377,7 @@ s4-0 gp-2 s5-2 - (* 10922.667 (-> *display* seconds-per-frame)) + (* 10922.667 (seconds-per-frame)) (the-as float 0.05) ) (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) @@ -3089,7 +3086,7 @@ (the-as float 128.0) (the-as float 32.0) (the-as float 110.0) - (* 21845.334 (-> *display* seconds-per-frame)) + (* 21845.334 (seconds-per-frame)) ) ) (gp-0 (new-stack-matrix0)) @@ -3114,7 +3111,7 @@ gp-0 s5-0 s4-0 - (* 10922.667 (-> *display* seconds-per-frame)) + (* 10922.667 (seconds-per-frame)) (the-as float 0.05) ) (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) diff --git a/goal_src/jak1/engine/camera/camera-h.gc b/goal_src/jak1/engine/camera/camera-h.gc index f26f56e1d6..ca764680d6 100644 --- a/goal_src/jak1/engine/camera/camera-h.gc +++ b/goal_src/jak1/engine/camera/camera-h.gc @@ -191,55 +191,55 @@ ) -(defmethod init-cam-float-seeker cam-float-seeker ((obj cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (set! (-> obj target) arg0) - (set! (-> obj value) arg0) - (set! (-> obj vel) 0.0) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj max-partial) arg3) +(defmethod init-cam-float-seeker cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> this target) arg0) + (set! (-> this value) arg0) + (set! (-> this vel) 0.0) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this max-partial) arg3) 0 (none) ) -(defmethod copy-cam-float-seeker cam-float-seeker ((obj cam-float-seeker) (arg0 cam-float-seeker)) - (set! (-> obj target) (-> arg0 target)) - (set! (-> obj value) (-> arg0 value)) - (set! (-> obj vel) (-> arg0 vel)) - (set! (-> obj accel) (-> arg0 accel)) - (set! (-> obj max-vel) (-> arg0 max-vel)) - (set! (-> obj max-partial) (-> arg0 max-partial)) +(defmethod copy-cam-float-seeker cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker)) + (set! (-> this target) (-> arg0 target)) + (set! (-> this value) (-> arg0 value)) + (set! (-> this vel) (-> arg0 vel)) + (set! (-> this accel) (-> arg0 accel)) + (set! (-> this max-vel) (-> arg0 max-vel)) + (set! (-> this max-partial) (-> arg0 max-partial)) 0 (none) ) -(defmethod update! cam-float-seeker ((obj cam-float-seeker) (offset float)) +(defmethod update! cam-float-seeker ((this cam-float-seeker) (offset float)) 0.0 0.0 - (let* ((pos-error (- (+ (-> obj target) offset) (-> obj value))) - (partial-velocity-limit (* (-> obj max-partial) (fabs pos-error))) + (let* ((pos-error (- (+ (-> this target) offset) (-> this value))) + (partial-velocity-limit (* (-> this max-partial) (fabs pos-error))) ) - (let ((daccel (* pos-error (* (-> obj accel) (-> *display* time-adjust-ratio))))) - (+! (-> obj vel) daccel) + (let ((daccel (* pos-error (* (-> this accel) (-> *display* time-adjust-ratio))))) + (+! (-> this vel) daccel) ) - (let ((abs-vel (fabs (-> obj vel))) - (abs-vel-limit (fmin partial-velocity-limit (-> obj max-vel))) + (let ((abs-vel (fabs (-> this vel))) + (abs-vel-limit (fmin partial-velocity-limit (-> this max-vel))) ) (if (< abs-vel-limit abs-vel) - (set! (-> obj vel) (* (-> obj vel) (/ abs-vel-limit abs-vel))) + (set! (-> this vel) (* (-> this vel) (/ abs-vel-limit abs-vel))) ) ) ) - (let ((dpos (* (-> obj vel) (-> *display* time-adjust-ratio)))) - (+! (-> obj value) dpos) + (let ((dpos (* (-> this vel) (-> *display* time-adjust-ratio)))) + (+! (-> this value) dpos) ) 0 (none) ) -(defmethod jump-to-target! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) - (set! (-> obj value) (+ (-> obj target) arg0)) - (set! (-> obj vel) 0.0) +(defmethod jump-to-target! cam-float-seeker ((this cam-float-seeker) (arg0 float)) + (set! (-> this value) (+ (-> this target) arg0)) + (set! (-> this vel) 0.0) ) (deftype cam-vector-seeker (structure) @@ -260,50 +260,50 @@ ) -(defmethod init! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj value quad) (-> arg0 quad)) + (set! (-> this target quad) (-> arg0 quad)) + (set! (-> this value quad) (-> arg0 quad)) ) (else - (vector-reset! (-> obj target)) - (vector-reset! (-> obj value)) + (vector-reset! (-> this target)) + (vector-reset! (-> this value)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj max-partial) arg3) + (vector-reset! (-> this vel)) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this max-partial) arg3) 0 (none) ) -(defmethod update! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector)) +(defmethod update! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) 0.0 (cond (arg0 - (vector+! gp-0 (-> obj target) arg0) - (vector-! gp-0 gp-0 (-> obj value)) + (vector+! gp-0 (-> this target) arg0) + (vector-! gp-0 gp-0 (-> this value)) ) (else - (vector-! gp-0 (-> obj target) (-> obj value)) + (vector-! gp-0 (-> this target) (-> this value)) ) ) - (let ((f30-1 (* (-> obj max-partial) (vector-length gp-0)))) - (vector-float*! gp-0 gp-0 (* (-> obj accel) (-> *display* time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) gp-0) - (let ((f0-4 (vector-length (-> obj vel))) - (f1-2 (fmin f30-1 (-> obj max-vel))) + (let ((f30-1 (* (-> this max-partial) (vector-length gp-0)))) + (vector-float*! gp-0 gp-0 (* (-> this accel) (-> *display* time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) gp-0) + (let ((f0-4 (vector-length (-> this vel))) + (f1-2 (fmin f30-1 (-> this max-vel))) ) (if (< f1-2 f0-4) - (vector-float*! (-> obj vel) (-> obj vel) (/ f1-2 f0-4)) + (vector-float*! (-> this vel) (-> this vel) (/ f1-2 f0-4)) ) ) ) - (vector-float*! gp-0 (-> obj vel) (-> *display* time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) gp-0) + (vector-float*! gp-0 (-> this vel) (-> *display* time-adjust-ratio)) + (vector+! (-> this value) (-> this value) gp-0) ) 0 (none) diff --git a/goal_src/jak1/engine/camera/camera.gc b/goal_src/jak1/engine/camera/camera.gc index 25c2c172a0..4719a7f740 100644 --- a/goal_src/jak1/engine/camera/camera.gc +++ b/goal_src/jak1/engine/camera/camera.gc @@ -343,10 +343,10 @@ ) ) -(defmethod cam-index-method-9 cam-index ((obj cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) +(defmethod cam-index-method-9 cam-index ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) (local-vars (sv-32 (function _varargs_ object))) (format (clear *cam-res-string*) "~S-flags" arg0) - (set! (-> obj flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *res-key-string*)))) + (set! (-> this flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *res-key-string*)))) (let ((s3-2 (res-lump-data arg1 arg0 pointer)) (s0-1 (method-of-type res-lump get-property-struct)) ) @@ -372,18 +372,18 @@ (s3-2 (cond (v0-8 - (vector+! (the-as vector (-> obj vec)) (the-as vector (&+ s3-2 0)) (the-as vector v0-8)) - (vector+! (-> obj vec 1) (the-as vector (&+ s3-2 16)) (the-as vector v0-8)) + (vector+! (the-as vector (-> this vec)) (the-as vector (&+ s3-2 0)) (the-as vector v0-8)) + (vector+! (-> this vec 1) (the-as vector (&+ s3-2 16)) (the-as vector v0-8)) ) (else - (set! (-> obj vec 0 quad) (-> (the-as (pointer uint128) (&+ s3-2 0)))) - (set! (-> obj vec 1 quad) (-> (the-as (pointer uint128) (&+ s3-2 16)))) + (set! (-> this vec 0 quad) (-> (the-as (pointer uint128) (&+ s3-2 0)))) + (set! (-> this vec 1 quad) (-> (the-as (pointer uint128) (&+ s3-2 16)))) ) ) ) (arg3 - (set! (-> obj vec 0 quad) (-> arg3 cverts 0 quad)) - (set! (-> obj vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) + (set! (-> this vec 0 quad) (-> arg3 cverts 0 quad)) + (set! (-> this vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) ) (else (return #f) @@ -394,100 +394,100 @@ (let ((s4-1 (new-stack-vector0))) 0.0 (cond - ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) - (vector-! s4-1 (-> obj vec 1) arg2) - (set! (-> obj vec 1 w) (vector-length s4-1)) - (vector-! s4-1 (the-as vector (-> obj vec)) arg2) - (set! (-> obj vec 1 x) (vector-length s4-1)) - (set! (-> obj vec 1 w) (- (-> obj vec 1 w) (-> obj vec 1 x))) - (set! (-> obj vec 0 quad) (-> arg2 quad)) + ((logtest? (-> this flags) (cam-index-options SPHERICAL)) + (vector-! s4-1 (-> this vec 1) arg2) + (set! (-> this vec 1 w) (vector-length s4-1)) + (vector-! s4-1 (the-as vector (-> this vec)) arg2) + (set! (-> this vec 1 x) (vector-length s4-1)) + (set! (-> this vec 1 w) (- (-> this vec 1 w) (-> this vec 1 x))) + (set! (-> this vec 0 quad) (-> arg2 quad)) ) - ((logtest? (-> obj flags) (cam-index-options RADIAL)) - (vector-! s4-1 (-> obj vec 1) arg2) - (set! (-> obj vec 1 w) (vector-length s4-1)) - (vector-! s4-1 (the-as vector (-> obj vec)) arg2) - (set! (-> obj vec 1 x) (vector-length s4-1)) - (set! (-> obj vec 1 w) (- (-> obj vec 1 w) (-> obj vec 1 x))) - (set! (-> obj vec 0 quad) (-> arg2 quad)) + ((logtest? (-> this flags) (cam-index-options RADIAL)) + (vector-! s4-1 (-> this vec 1) arg2) + (set! (-> this vec 1 w) (vector-length s4-1)) + (vector-! s4-1 (the-as vector (-> this vec)) arg2) + (set! (-> this vec 1 x) (vector-length s4-1)) + (set! (-> this vec 1 w) (- (-> this vec 1 w) (-> this vec 1 x))) + (set! (-> this vec 0 quad) (-> arg2 quad)) ) (else - (vector-! (-> obj vec 1) (-> obj vec 1) (the-as vector (-> obj vec))) - (set! (-> obj vec 1 w) (vector-normalize-ret-len! (-> obj vec 1) 1.0)) + (vector-! (-> this vec 1) (-> this vec 1) (the-as vector (-> this vec))) + (set! (-> this vec 1 w) (vector-normalize-ret-len! (-> this vec 1) 1.0)) ) ) ) #t ) -(defmethod cam-index-method-10 cam-index ((obj cam-index) (arg0 vector)) +(defmethod cam-index-method-10 cam-index ((this cam-index) (arg0 vector)) (let ((s5-0 (new-stack-vector0))) 0.0 - (vector-! s5-0 arg0 (the-as vector (-> obj vec))) + (vector-! s5-0 arg0 (the-as vector (-> this vec))) (cond - ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) + ((logtest? (-> this flags) (cam-index-options SPHERICAL)) (vector-flatten! s5-0 s5-0 (-> *camera* local-down)) - (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) + (/ (- (vector-length s5-0) (-> this vec 1 x)) (-> this vec 1 w)) ) - ((logtest? (-> obj flags) (cam-index-options RADIAL)) - (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) + ((logtest? (-> this flags) (cam-index-options RADIAL)) + (/ (- (vector-length s5-0) (-> this vec 1 x)) (-> this vec 1 w)) ) (else - (/ (vector-dot s5-0 (-> obj vec 1)) (-> obj vec 1 w)) + (/ (vector-dot s5-0 (-> this vec 1)) (-> this vec 1 w)) ) ) ) ) -(defmethod tracking-spline-method-10 tracking-spline ((obj tracking-spline) (arg0 vector)) - (set! (-> obj point 0 position quad) (-> arg0 quad)) - (set! (-> obj point 0 next) -134250495) - (set! (-> obj summed-len) 0.0) - (set! (-> obj free-point) 1) - (set! (-> obj used-point) 0) - (set! (-> obj partial-point) 0.0) - (set! (-> obj end-point) 0) - (set! (-> obj next-to-last-point) -134250495) - (set! (-> obj max-move) 0.0) - (set! (-> obj sample-len) 0.0) - (set! (-> obj used-count) 1) - (set! (-> obj old-position quad) (-> arg0 quad)) +(defmethod tracking-spline-method-10 tracking-spline ((this tracking-spline) (arg0 vector)) + (set! (-> this point 0 position quad) (-> arg0 quad)) + (set! (-> this point 0 next) -134250495) + (set! (-> this summed-len) 0.0) + (set! (-> this free-point) 1) + (set! (-> this used-point) 0) + (set! (-> this partial-point) 0.0) + (set! (-> this end-point) 0) + (set! (-> this next-to-last-point) -134250495) + (set! (-> this max-move) 0.0) + (set! (-> this sample-len) 0.0) + (set! (-> this used-count) 1) + (set! (-> this old-position quad) (-> arg0 quad)) (let ((v1-6 1)) (while (!= v1-6 31) - (set! (-> obj point v1-6 next) (+ v1-6 1)) + (set! (-> this point v1-6 next) (+ v1-6 1)) (+! v1-6 1) ) - (set! (-> obj point v1-6 next) -134250495) + (set! (-> this point v1-6 next) -134250495) ) 0 (none) ) -(defmethod tracking-spline-method-13 tracking-spline ((obj tracking-spline) (arg0 int)) - (let ((v1-3 (-> obj point arg0 next))) +(defmethod tracking-spline-method-13 tracking-spline ((this tracking-spline) (arg0 int)) + (let ((v1-3 (-> this point arg0 next))) (cond ((= v1-3 -134250495) ) - ((= (-> obj point v1-3 next) -134250495) + ((= (-> this point v1-3 next) -134250495) ) (else - (set! (-> obj point arg0 next) (-> obj point v1-3 next)) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-3 tp-length))) - (set! (-> obj point v1-3 next) (-> obj free-point)) - (set! (-> obj free-point) v1-3) - (+! (-> obj point v1-3 incarnation) 1) - (let ((v1-11 (-> obj point arg0 next))) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point arg0 tp-length))) + (set! (-> this point arg0 next) (-> this point v1-3 next)) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-3 tp-length))) + (set! (-> this point v1-3 next) (-> this free-point)) + (set! (-> this free-point) v1-3) + (+! (-> this point v1-3 incarnation) 1) + (let ((v1-11 (-> this point arg0 next))) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point arg0 tp-length))) (vector-! - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 arg0))) - (the-as vector (-> obj point v1-11)) - (the-as vector (-> obj point arg0)) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 arg0))) + (the-as vector (-> this point v1-11)) + (the-as vector (-> this point arg0)) ) ) - (set! (-> obj point arg0 tp-length) - (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 arg0))) 1.0) + (set! (-> this point arg0 tp-length) + (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 arg0))) 1.0) ) - (+! (-> obj summed-len) (-> obj point arg0 tp-length)) - (+! (-> obj used-count) -1) + (+! (-> this summed-len) (-> this point arg0 tp-length)) + (+! (-> this used-count) -1) ) ) ) @@ -495,35 +495,37 @@ (none) ) -(defmethod tracking-spline-method-14 tracking-spline ((obj tracking-spline) (arg0 tracking-spline-sampler)) - (let ((v1-0 (-> obj used-point))) - (set! (-> obj partial-point) (-> arg0 partial-pt)) - (when (= (-> obj next-to-last-point) v1-0) - (set! (-> obj summed-len) (-> obj point v1-0 tp-length)) - (if (= (-> arg0 cur-pt) (-> obj end-point)) - (set! (-> obj partial-point) 0.99999) +(defmethod tracking-spline-method-14 tracking-spline ((this tracking-spline) (arg0 tracking-spline-sampler)) + (let ((v1-0 (-> this used-point))) + (set! (-> this partial-point) (-> arg0 partial-pt)) + (when (= (-> this next-to-last-point) v1-0) + (set! (-> this summed-len) (-> this point v1-0 tp-length)) + (if (= (-> arg0 cur-pt) (-> this end-point)) + (set! (-> this partial-point) 0.99999) ) ) (when (!= (-> arg0 cur-pt) v1-0) - (while (and (!= (-> obj point v1-0 next) (-> arg0 cur-pt)) (!= (-> obj point v1-0 next) (-> obj next-to-last-point))) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-0 tp-length))) - (+! (-> obj point v1-0 incarnation) 1) - (+! (-> obj used-count) -1) - (set! v1-0 (-> obj point v1-0 next)) + (while (and (!= (-> this point v1-0 next) (-> arg0 cur-pt)) + (!= (-> this point v1-0 next) (-> this next-to-last-point)) + ) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-0 tp-length))) + (+! (-> this point v1-0 incarnation) 1) + (+! (-> this used-count) -1) + (set! v1-0 (-> this point v1-0 next)) ) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-0 tp-length))) - (+! (-> obj point v1-0 incarnation) 1) - (+! (-> obj used-count) -1) - (set! (-> obj point v1-0 next) (-> obj free-point)) - (set! (-> obj free-point) (-> obj used-point)) - (set! (-> obj used-point) (-> arg0 cur-pt)) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-0 tp-length))) + (+! (-> this point v1-0 incarnation) 1) + (+! (-> this used-count) -1) + (set! (-> this point v1-0 next) (-> this free-point)) + (set! (-> this free-point) (-> this used-point)) + (set! (-> this used-point) (-> arg0 cur-pt)) (cond - ((= (-> arg0 cur-pt) (-> obj end-point)) - (set! (-> obj partial-point) 0.0) - (set! (-> obj summed-len) 0.0) + ((= (-> arg0 cur-pt) (-> this end-point)) + (set! (-> this partial-point) 0.0) + (set! (-> this summed-len) 0.0) ) - ((= (-> arg0 cur-pt) (-> obj next-to-last-point)) - (set! (-> obj summed-len) (-> obj point (-> obj next-to-last-point) tp-length)) + ((= (-> arg0 cur-pt) (-> this next-to-last-point)) + (set! (-> this summed-len) (-> this point (-> this next-to-last-point) tp-length)) ) ) ) @@ -532,30 +534,30 @@ (none) ) -(defmethod tracking-spline-method-15 tracking-spline ((obj tracking-spline)) +(defmethod tracking-spline-method-15 tracking-spline ((this tracking-spline)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'tracking-point))) - (set! (-> s5-0 cur-pt) (-> obj used-point)) - (set! (-> s5-0 partial-pt) (-> obj partial-point)) - (tracking-spline-method-19 obj (-> obj sample-len) (the-as vector a2-0) s5-0) + (set! (-> s5-0 cur-pt) (-> this used-point)) + (set! (-> s5-0 partial-pt) (-> this partial-point)) + (tracking-spline-method-19 this (-> this sample-len) (the-as vector a2-0) s5-0) ) - (if (or (= (-> s5-0 cur-pt) (-> obj end-point)) - (= (-> s5-0 cur-pt) (-> obj next-to-last-point)) - (= (-> obj point (-> s5-0 cur-pt) next) (-> obj next-to-last-point)) + (if (or (= (-> s5-0 cur-pt) (-> this end-point)) + (= (-> s5-0 cur-pt) (-> this next-to-last-point)) + (= (-> this point (-> s5-0 cur-pt) next) (-> this next-to-last-point)) ) - (set! (-> s5-0 cur-pt) (-> obj used-point)) + (set! (-> s5-0 cur-pt) (-> this used-point)) ) - (let ((v1-15 (-> obj point (-> s5-0 cur-pt) next))) + (let ((v1-15 (-> this point (-> s5-0 cur-pt) next))) (when (!= v1-15 -134250495) - (let ((a0-14 (-> obj point v1-15 next)) + (let ((a0-14 (-> this point v1-15 next)) (a1-1 v1-15) (f0-2 -2.0) ) 0.0 - (while (not (or (= a0-14 -134250495) (= a0-14 (-> obj end-point)))) + (while (not (or (= a0-14 -134250495) (= a0-14 (-> this end-point)))) (let ((f1-2 (vector-dot - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 v1-15))) - (the-as vector (+ (the-as uint (the-as vector (-> obj point 0 direction))) (* 48 a0-14))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-15))) + (the-as vector (+ (the-as uint (the-as vector (-> this point 0 direction))) (* 48 a0-14))) ) ) ) @@ -565,10 +567,10 @@ ) ) (set! v1-15 a0-14) - (set! a0-14 (-> obj point v1-15 next)) + (set! a0-14 (-> this point v1-15 next)) ) (if (< -2.0 f0-2) - (tracking-spline-method-13 obj a1-1) + (tracking-spline-method-13 this a1-1) ) ) ) @@ -578,35 +580,35 @@ (none) ) -(defmethod tracking-spline-method-16 tracking-spline ((obj tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-16 tracking-spline ((this tracking-spline) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 cur-pt) (-> obj used-point)) - (set! (-> s4-0 partial-pt) (-> obj partial-point)) - (tracking-spline-method-19 obj (-> obj sample-len) a2-0 s4-0) + (set! (-> s4-0 cur-pt) (-> this used-point)) + (set! (-> s4-0 partial-pt) (-> this partial-point)) + (tracking-spline-method-19 this (-> this sample-len) a2-0 s4-0) ) - (let ((s4-1 (-> obj point (-> s4-0 cur-pt) next))) + (let ((s4-1 (-> this point (-> s4-0 cur-pt) next))) (when (!= s4-1 -134250495) - (let ((v1-11 (-> obj point s4-1 next))) + (let ((v1-11 (-> this point s4-1 next))) (while (not (or (= v1-11 -134250495) - (= (-> obj point v1-11 next) -134250495) - (= (-> obj point v1-11 next) (-> obj end-point)) - (= (-> obj point v1-11 next) (-> obj next-to-last-point)) + (= (-> this point v1-11 next) -134250495) + (= (-> this point v1-11 next) (-> this end-point)) + (= (-> this point v1-11 next) (-> this next-to-last-point)) ) ) - (if (< (* (-> obj point s4-1 tp-length) + (if (< (* (-> this point s4-1 tp-length) (+ 1.0 (vector-dot - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s4-1))) - (the-as vector (+ (the-as uint (the-as vector (-> obj point 0 direction))) (* 48 v1-11))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s4-1))) + (the-as vector (+ (the-as uint (the-as vector (-> this point 0 direction))) (* 48 v1-11))) ) ) ) arg0 ) - (tracking-spline-method-13 obj s4-1) + (tracking-spline-method-13 this s4-1) (set! s4-1 v1-11) ) - (set! v1-11 (-> obj point s4-1 next)) + (set! v1-11 (-> this point s4-1 next)) ) ) ) @@ -616,40 +618,40 @@ (none) ) -(defmethod tracking-spline-method-17 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) - (let ((s3-0 (-> obj free-point)) - (s2-0 (-> obj end-point)) +(defmethod tracking-spline-method-17 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) + (let ((s3-0 (-> this free-point)) + (s2-0 (-> this end-point)) ) (vector-! - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s2-0))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s2-0))) arg0 - (the-as vector (-> obj point s2-0)) + (the-as vector (-> this point s2-0)) ) - (set! (-> obj point s2-0 tp-length) - (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s2-0))) 1.0) + (set! (-> this point s2-0 tp-length) + (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s2-0))) 1.0) ) - (if (< (-> obj point s2-0 tp-length) arg1) + (if (< (-> this point s2-0 tp-length) arg1) (return 0) ) (when (and arg3 (= s3-0 -134250495)) - (tracking-spline-method-15 obj) - (set! s3-0 (-> obj free-point)) + (tracking-spline-method-15 this) + (set! s3-0 (-> this free-point)) ) (cond ((= s3-0 -134250495) (format 0 "ERROR : pos spline overflow~%") ) (else - (+! (-> obj summed-len) (-> obj point s2-0 tp-length)) - (set! (-> obj free-point) (-> obj point s3-0 next)) - (set! (-> obj point s2-0 next) s3-0) - (set! (-> obj end-point) s3-0) - (set! (-> obj next-to-last-point) s2-0) - (set! (-> obj point s3-0 next) -134250495) - (set! (-> obj point s3-0 position quad) (-> arg0 quad)) - (+! (-> obj used-count) 1) + (+! (-> this summed-len) (-> this point s2-0 tp-length)) + (set! (-> this free-point) (-> this point s3-0 next)) + (set! (-> this point s2-0 next) s3-0) + (set! (-> this end-point) s3-0) + (set! (-> this next-to-last-point) s2-0) + (set! (-> this point s3-0 next) -134250495) + (set! (-> this point s3-0 position quad) (-> arg0 quad)) + (+! (-> this used-count) 1) (if (< 0.0 arg2) - (tracking-spline-method-16 obj arg2) + (tracking-spline-method-16 this arg2) ) ) ) @@ -657,29 +659,29 @@ 0 ) -(defmethod tracking-spline-method-18 tracking-spline ((obj tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-18 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (local-vars (f0-4 float)) (when (not arg2) (set! arg2 (new 'stack-no-clear 'tracking-spline-sampler)) - (set! (-> arg2 cur-pt) (-> obj used-point)) - (set! (-> arg2 partial-pt) (-> obj partial-point)) + (set! (-> arg2 cur-pt) (-> this used-point)) + (set! (-> arg2 partial-pt) (-> this partial-point)) ) 0.0 (loop (cond - ((= (-> arg2 cur-pt) (-> obj end-point)) + ((= (-> arg2 cur-pt) (-> this end-point)) (set! (-> arg2 partial-pt) 0.0) - (vector+! arg1 arg1 (the-as vector (-> obj point (-> arg2 cur-pt)))) + (vector+! arg1 arg1 (the-as vector (-> this point (-> arg2 cur-pt)))) (return arg1) ) - ((begin (set! f0-4 (+ (-> arg2 partial-pt) (/ arg0 (-> obj point (-> arg2 cur-pt) tp-length)))) (< f0-4 1.0)) + ((begin (set! f0-4 (+ (-> arg2 partial-pt) (/ arg0 (-> this point (-> arg2 cur-pt) tp-length)))) (< f0-4 1.0)) (set! (-> arg2 partial-pt) f0-4) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) - (let ((a2-5 (-> obj point (-> arg2 cur-pt) next))) + (let ((a2-5 (-> this point (-> arg2 cur-pt) next))) (vector-lerp! (the-as vector s5-0) - (the-as vector (-> obj point (-> arg2 cur-pt))) - (the-as vector (-> obj point a2-5)) + (the-as vector (-> this point (-> arg2 cur-pt))) + (the-as vector (-> this point a2-5)) f0-4 ) ) @@ -688,29 +690,29 @@ (return arg1) ) (else - (let ((f0-7 (* (- 1.0 (-> arg2 partial-pt)) (-> obj point (-> arg2 cur-pt) tp-length)))) + (let ((f0-7 (* (- 1.0 (-> arg2 partial-pt)) (-> this point (-> arg2 cur-pt) tp-length)))) (set! arg0 (- arg0 f0-7)) ) (set! (-> arg2 partial-pt) 0.0) - (set! (-> arg2 cur-pt) (-> obj point (-> arg2 cur-pt) next)) + (set! (-> arg2 cur-pt) (-> this point (-> arg2 cur-pt) next)) ) ) ) (the-as vector #f) ) -(defmethod tracking-spline-method-19 tracking-spline ((obj tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-19 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (vector-reset! arg1) - (tracking-spline-method-18 obj arg0 arg1 arg2) + (tracking-spline-method-18 this arg0 arg1 arg2) arg1 ) -(defmethod tracking-spline-method-20 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 int)) +(defmethod tracking-spline-method-20 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! s3-0 - (the-as vector (-> obj point (-> obj used-point))) - (the-as vector (-> obj point (-> obj end-point))) + (the-as vector (-> this point (-> this used-point))) + (the-as vector (-> this point (-> this end-point))) ) (let* ((f0-0 (vector-length s3-0)) (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0)))) @@ -719,9 +721,9 @@ (let* ((f1-2 (fmax 0.0 f1-1)) (f30-0 (+ 0.3 f1-2)) (f0-1 (cond - ((< (-> *CAMERA-bank* min-detectable-velocity) (-> obj summed-len)) + ((< (-> *CAMERA-bank* min-detectable-velocity) (-> this summed-len)) (vector-float*! s3-0 s3-0 (/ 1.0 f0-0)) - (/ f0-0 (-> obj summed-len)) + (/ f0-0 (-> this summed-len)) ) (else (vector-reset! s3-0) @@ -732,15 +734,15 @@ (f0-2 (+ -0.2 f0-1)) (f1-9 (* 2.0 f0-2)) (f28-0 (fmin 1.0 (fmax 0.05 f1-9))) - (v1-8 (-> obj used-point)) + (v1-8 (-> this used-point)) (s2-0 (new 'stack-no-clear 'vector)) ) - (while (and (!= v1-8 (-> obj end-point)) (!= v1-8 (-> obj next-to-last-point)) (!= v1-8 arg1)) - (let ((s1-0 (-> obj point v1-8 next))) + (while (and (!= v1-8 (-> this end-point)) (!= v1-8 (-> this next-to-last-point)) (!= v1-8 arg1)) + (let ((s1-0 (-> this point v1-8 next))) (vector-! s2-0 - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s1-0))) - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 v1-8))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s1-0))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-8))) ) (let* ((f0-4 (vector-normalize-ret-len! s2-0 1.0)) (f0-5 (* 0.5 f0-4)) @@ -759,7 +761,7 @@ ((< f26-0 0.0) (if (and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (the-as vector (-> obj point s1-0)) + (the-as vector (-> this point s1-0)) s2-0 (* -40.96 f26-0) (the-as vector4w (new 'static 'inline-array qword 1 @@ -772,7 +774,7 @@ ) ((and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (the-as vector (-> obj point s1-0)) + (the-as vector (-> this point s1-0)) s2-0 (* 40.96 f26-0) (the-as vector4w (new 'static 'inline-array qword 1 @@ -793,101 +795,101 @@ (none) ) -(defmethod tracking-spline-method-21 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 float) (arg2 float)) - (let ((v1-0 (-> obj used-point)) - (f0-0 (-> obj partial-point)) +(defmethod tracking-spline-method-21 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float)) + (let ((v1-0 (-> this used-point)) + (f0-0 (-> this partial-point)) ) - (let ((f1-0 (-> obj summed-len))) + (let ((f1-0 (-> this summed-len))) 0.0 0.0 - (let* ((f1-1 (- f1-0 (* f0-0 (-> obj point v1-0 tp-length)))) + (let* ((f1-1 (- f1-0 (* f0-0 (-> this point v1-0 tp-length)))) (f2-5 (* 0.1 f1-1)) - (f2-8 (* (fmin arg1 (- f2-5 (-> obj max-move))) (-> *display* time-adjust-ratio))) + (f2-8 (* (fmin arg1 (- f2-5 (-> this max-move))) (-> *display* time-adjust-ratio))) ) - (set! (-> obj max-move) (fmin arg2 (+ (-> obj max-move) f2-8))) + (set! (-> this max-move) (fmin arg2 (+ (-> this max-move) f2-8))) ) ) - (set! (-> obj max-move) (fmax 0.4096 (-> obj max-move))) - (let ((f1-8 (-> obj summed-len))) + (set! (-> this max-move) (fmax 0.4096 (-> this max-move))) + (let ((f1-8 (-> this summed-len))) 0.0 - (let* ((f2-14 (- f1-8 (* f0-0 (-> obj point v1-0 tp-length)))) - (f2-16 (fmin 204.8 (- f2-14 (-> obj sample-len)))) + (let* ((f2-14 (- f1-8 (* f0-0 (-> this point v1-0 tp-length)))) + (f2-16 (fmin 204.8 (- f2-14 (-> this sample-len)))) ) - (set! (-> obj sample-len) (fmin 16384.0 (+ (-> obj sample-len) f2-16))) + (set! (-> this sample-len) (fmin 16384.0 (+ (-> this sample-len) f2-16))) ) ) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (set! (-> s4-0 cur-pt) v1-0) (set! (-> s4-0 partial-pt) f0-0) - (tracking-spline-method-19 obj (* (-> obj max-move) (-> *display* time-adjust-ratio)) arg0 s4-0) - (tracking-spline-method-14 obj s4-0) + (tracking-spline-method-19 this (* (-> this max-move) (-> *display* time-adjust-ratio)) arg0 s4-0) + (tracking-spline-method-14 this s4-0) (dotimes (s3-0 63) - (tracking-spline-method-18 obj (* 0.015625 (-> obj sample-len)) arg0 s4-0) + (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 s4-0) ) (vector-float*! arg0 arg0 0.015625) (let ((a2-3 (-> s4-0 cur-pt))) - (set! (-> obj debug-last-point) a2-3) + (set! (-> this debug-last-point) a2-3) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> obj debug-old-position quad) (-> obj old-position quad)) - (set! (-> obj debug-out-position quad) (-> arg0 quad)) - (vector-! s4-1 arg0 (-> obj old-position)) - (tracking-spline-method-20 obj s4-1 a2-3) - (vector+! arg0 (-> obj old-position) s4-1) + (set! (-> this debug-old-position quad) (-> this old-position quad)) + (set! (-> this debug-out-position quad) (-> arg0 quad)) + (vector-! s4-1 arg0 (-> this old-position)) + (tracking-spline-method-20 this s4-1 a2-3) + (vector+! arg0 (-> this old-position) s4-1) ) ) ) ) - (set! (-> obj old-position quad) (-> arg0 quad)) + (set! (-> this old-position quad) (-> arg0 quad)) arg0 ) -(defmethod tracking-spline-method-22 tracking-spline ((obj tracking-spline) (arg0 float)) - (when (< arg0 (-> obj summed-len)) +(defmethod tracking-spline-method-22 tracking-spline ((this tracking-spline) (arg0 float)) + (when (< arg0 (-> this summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 cur-pt) (-> obj used-point)) + (set! (-> s5-0 cur-pt) (-> this used-point)) (set! (-> s5-0 partial-pt) 0.0) - (tracking-spline-method-19 obj (- (-> obj summed-len) arg0) a2-0 s5-0) + (tracking-spline-method-19 this (- (-> this summed-len) arg0) a2-0 s5-0) ) - (tracking-spline-method-14 obj s5-0) + (tracking-spline-method-14 this s5-0) ) ) 0 (none) ) -(defmethod tracking-spline-method-9 tracking-spline ((obj tracking-spline)) - (let ((v1-0 (-> obj used-point)) +(defmethod tracking-spline-method-9 tracking-spline ((this tracking-spline)) + (let ((v1-0 (-> this used-point)) (s4-0 0) (s5-0 0) ) (while (!= v1-0 -134250495) (set! s5-0 (logior s5-0 (ash 1 v1-0))) (+! s4-0 1) - (set! v1-0 (-> obj point v1-0 next)) + (set! v1-0 (-> this point v1-0 next)) ) - (when (!= s4-0 (-> obj used-count)) + (when (!= s4-0 (-> this used-count)) (if *debug-segment* - (format 0 "ERROR: tracking spline used count ~D actual ~D~%" (-> obj used-count) s4-0) + (format 0 "ERROR: tracking spline used count ~D actual ~D~%" (-> this used-count) s4-0) ) - (set! (-> obj used-count) s4-0) + (set! (-> this used-count) s4-0) ) - (let ((v1-9 (-> obj free-point)) + (let ((v1-9 (-> this free-point)) (a3-1 0) ) (while (!= v1-9 -134250495) (+! a3-1 1) - (set! v1-9 (-> obj point v1-9 next)) + (set! v1-9 (-> this point v1-9 next)) ) - (when (!= a3-1 (- 32 (-> obj used-count))) + (when (!= a3-1 (- 32 (-> this used-count))) (if *debug-segment* - (format 0 "ERROR: tracking spline free count ~D actual ~D~%" (- 32 (-> obj used-count)) a3-1) + (format 0 "ERROR: tracking spline free count ~D actual ~D~%" (- 32 (-> this used-count)) a3-1) ) - (set! (-> obj free-point) -134250495) + (set! (-> this free-point) -134250495) (dotimes (v1-21 32) (when (not (logtest? s5-0 1)) - (set! (-> obj point v1-21 next) (-> obj free-point)) - (set! (-> obj free-point) v1-21) + (set! (-> this point v1-21 next) (-> this free-point)) + (set! (-> this free-point) v1-21) ) (set! s5-0 (shr s5-0 1)) ) @@ -1281,7 +1283,7 @@ ) ) (if arg2 - (vector-seek-3d-smooth! (-> arg0 follow-off) s3-2 (* 20480.0 (-> *display* seconds-per-frame)) 0.05) + (vector-seek-3d-smooth! (-> arg0 follow-off) s3-2 (* 20480.0 (seconds-per-frame)) 0.05) (set! (-> arg0 follow-off quad) (-> s3-2 quad)) ) ) @@ -1554,6 +1556,7 @@ (f4-0 (-> v1-11 y)) (f5-0 (-> v1-11 z)) ) + ;; og:preserve-this inlined vector-dot ; (.mula.s f0-7 f3-0) ; (.madda.s f1-1 f4-0) ; (.madd.s f0-8 f2-0 f5-0) @@ -1689,6 +1692,7 @@ (f4-0 (-> sv-160 y)) (f5-0 (-> sv-160 z)) ) + ;; og:preserve-this inlined vector-dot ; (.mula.s f0-9 f3-0) ; (.madda.s f1-2 f4-0) ; (.madd.s f0-10 f2-0 f5-0) @@ -1775,6 +1779,7 @@ (f4-0 (-> sv-160 y)) (f5-0 (-> sv-160 z)) ) + ;; og:preserve-this inlined vector-dot ; (.mula.s f0-6 f3-0) ; (.madda.s f1-0 f4-0) ; (.madd.s f0-7 f2-0 f5-0) diff --git a/goal_src/jak1/engine/camera/pov-camera-h.gc b/goal_src/jak1/engine/camera/pov-camera-h.gc index 19bcdbf7f5..faedaaed5f 100644 --- a/goal_src/jak1/engine/camera/pov-camera-h.gc +++ b/goal_src/jak1/engine/camera/pov-camera-h.gc @@ -49,10 +49,3 @@ (set-stack-size! (_type_) none 29) ) ) - - -0 - - - - diff --git a/goal_src/jak1/engine/camera/pov-camera.gc b/goal_src/jak1/engine/camera/pov-camera.gc index a001f37d42..03c35b1b1c 100644 --- a/goal_src/jak1/engine/camera/pov-camera.gc +++ b/goal_src/jak1/engine/camera/pov-camera.gc @@ -7,22 +7,20 @@ ;; DECOMP BEGINS -(defmethod check-for-abort pov-camera ((obj pov-camera)) - (when (or (and (>= (- (-> *display* base-frame-counter) (-> obj debounce-start-time)) (seconds 0.2)) - (cpad-pressed? 0 triangle) - ) - (logtest? (-> obj flags) (pov-camera-flag allow-abort)) +(defmethod check-for-abort pov-camera ((this pov-camera)) + (when (or (and (time-elapsed? (-> this debounce-start-time) (seconds 0.2)) (cpad-pressed? 0 triangle)) + (logtest? (-> this flags) (pov-camera-flag allow-abort)) ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (when (logtest? (-> obj flags) (pov-camera-flag notify-of-abort)) - (send-event (handle->process (-> obj notify-handle)) 'notify 'abort-request) + (when (logtest? (-> this flags) (pov-camera-flag notify-of-abort)) + (send-event (handle->process (-> this notify-handle)) 'notify 'abort-request) #t ) ) ) -(defmethod target-grabbed? pov-camera ((obj pov-camera)) +(defmethod target-grabbed? pov-camera ((this pov-camera)) (or (not *target*) (process-grab? *target*)) ) @@ -91,7 +89,7 @@ ) ) :enter (behavior () - (set! (-> self debounce-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self debounce-start-time)) (if (= (-> self anim-name type) string) (backup-load-state-and-set-cmds *load-state* (-> self command-list)) ) @@ -161,12 +159,12 @@ ) ) -(defmethod pre-startup-callback pov-camera ((obj pov-camera)) +(defmethod pre-startup-callback pov-camera ((this pov-camera)) 0 (none) ) -(defmethod set-stack-size! pov-camera ((obj pov-camera)) +(defmethod set-stack-size! pov-camera ((this pov-camera)) (none) ) @@ -181,7 +179,7 @@ (set! (-> self notify-handle) (process->handle arg4)) (set! (-> self notify-handle) (the-as handle #f)) ) - (set! (-> self debounce-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self debounce-start-time)) (logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile)) (set! (-> self root) (new 'process 'trsqv)) (set! (-> self root trans quad) (-> arg0 quad)) diff --git a/goal_src/jak1/engine/collide/collide-cache-h.gc b/goal_src/jak1/engine/collide/collide-cache-h.gc index f698bbe55a..be72f16a67 100644 --- a/goal_src/jak1/engine/collide/collide-cache-h.gc +++ b/goal_src/jak1/engine/collide/collide-cache-h.gc @@ -190,6 +190,7 @@ (define-perm *collide-work* collide-work (new 'global 'collide-work)) +;; og:preserve-this (defglobalconstant BIG_COLLIDE_CACHE_SIZE 5000) (define-perm *collide-cache* collide-cache (new 'global 'collide-cache)) diff --git a/goal_src/jak1/engine/collide/collide-edge-grab-h.gc b/goal_src/jak1/engine/collide/collide-edge-grab-h.gc index edae79e793..041da28c90 100644 --- a/goal_src/jak1/engine/collide/collide-edge-grab-h.gc +++ b/goal_src/jak1/engine/collide/collide-edge-grab-h.gc @@ -38,6 +38,7 @@ ) ) +;; og:preserve-this (declare-type collide-cache-tri structure) (deftype collide-edge-tri (structure) ((ctri collide-cache-tri :offset-assert 0) @@ -48,6 +49,7 @@ :flag-assert #x900000020 ) + (deftype collide-edge-edge (structure) ((ignore basic :offset-assert 0) (etri collide-edge-tri :offset-assert 4) @@ -60,6 +62,7 @@ :flag-assert #x900000030 ) + (deftype collide-edge-hold-item (structure) ((next collide-edge-hold-item :offset-assert 0) (rating float :offset-assert 4) @@ -73,6 +76,7 @@ :flag-assert #x900000030 ) + (deftype collide-edge-hold-list (structure) ((num-allocs uint32 :offset-assert 0) (num-attempts uint32 :offset-assert 4) @@ -89,6 +93,7 @@ ) ) +;; og:preserve-this (declare-type collide-cache basic) (declare-type collide-shape basic) (deftype collide-edge-work (structure) @@ -137,6 +142,7 @@ ) ) + (define *collide-edge-work* (new 'static 'collide-edge-work :max-dist-sqrd-to-outward-pt 37748736.0 :max-dir-cosa-delta 0.6 diff --git a/goal_src/jak1/engine/collide/collide-edge-grab.gc b/goal_src/jak1/engine/collide/collide-edge-grab.gc index 8410689e84..2d484ab8d0 100644 --- a/goal_src/jak1/engine/collide/collide-edge-grab.gc +++ b/goal_src/jak1/engine/collide/collide-edge-grab.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod find-edge-grabs! target ((obj target) (arg0 collide-cache)) +(defmethod find-edge-grabs! target ((this target) (arg0 collide-cache)) "Main edge grabbing method. Will populate *edge-grab-info* and send *target* an 'edge-grab event if successful." (rlet ((vf1 :class vf) @@ -24,7 +24,7 @@ (set! (-> gp-0 num-edges) (the-as uint 0)) (set! (-> gp-0 num-tris) (the-as uint 0)) - (let ((v1-0 (-> obj control))) + (let ((v1-0 (-> this control))) (set! (-> gp-0 ccache) arg0) (.lvf vf1 (&-> gp-0 local-cache-fill-box min quad)) (.lvf vf2 (&-> gp-0 local-cache-fill-box max quad)) @@ -53,9 +53,9 @@ (fill-using-bounding-box arg0 (-> gp-0 cache-fill-box) - (-> obj control root-prim collide-with) - obj - (new 'static 'pat-surface :skip #x1 :noentity #x1) + (-> this control root-prim collide-with) + this + (new 'static 'pat-surface :noentity #x1) ) ;; Filter out tris that can't be grabbed @@ -90,22 +90,22 @@ ) ) -(defmethod search-for-edges collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-list)) +(defmethod search-for-edges collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-list)) "Iterate through edges, adding them to the collide-edge-hold-list, if they are good" ;; reset edge list. (set! (-> arg0 num-allocs) (the-as uint 0)) (set! (-> arg0 num-attempts) (the-as uint 0)) (set! (-> arg0 head) #f) (let ((s4-0 (the-as collide-edge-hold-item (-> arg0 items))) - (s3-0 (the-as collide-edge-edge (-> obj edges))) + (s3-0 (the-as collide-edge-edge (-> this edges))) ) ;; loop over edges - (countdown (s2-0 (-> obj num-edges)) + (countdown (s2-0 (-> this num-edges)) (when (not (-> s3-0 ignore)) ;; find the grab point - (compute-center-point! obj s3-0 (-> s4-0 center-pt)) + (compute-center-point! this s3-0 (-> s4-0 center-pt)) ;; add if needed. - (when (should-add-to-list? obj s4-0 s3-0) + (when (should-add-to-list? this s4-0 s3-0) (add-to-list! arg0 s4-0) (+! (-> arg0 num-allocs) 1) (when (= (-> arg0 num-allocs) 32) @@ -138,7 +138,7 @@ (defmethod-mips2c "(method 18 collide-edge-work)" 18 collide-edge-work) -(defmethod check-grab-for-collisions collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod check-grab-for-collisions collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (local-vars (sv-144 (function vector vector vector float vector)) (sv-160 vector) (sv-176 vector)) (let* ((s3-0 (-> arg0 edge)) (s1-0 (-> s3-0 etri ctri)) @@ -146,7 +146,7 @@ ) (let ((s0-0 (new 'stack-no-clear 'vector))) (vector+*! s0-0 (-> arg0 center-pt) (-> s3-0 edge-vec-norm) 1105.92) - (let ((f0-0 (collide-edge-work-method-14 obj (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) + (let ((f0-0 (collide-edge-work-method-14 this (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) (if (< 491.52 f0-0) (return #f) ) @@ -159,7 +159,7 @@ ) (sv-144 sv-160 sv-176 a2-3 a3-2) ) - (let ((f0-1 (collide-edge-work-method-14 obj (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) + (let ((f0-1 (collide-edge-work-method-14 this (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) (if (< 491.52 f0-1) (return #f) ) @@ -191,19 +191,19 @@ (-> arg1 hanging-matrix vector 1) ) (set! (-> arg1 hanging-matrix vector 3 quad) (-> arg1 center-hold quad)) - (transform-vectors! (-> arg1 hanging-matrix) (-> obj world-player-spheres) (-> obj local-player-spheres) 12) + (transform-vectors! (-> arg1 hanging-matrix) (-> this world-player-spheres) (-> this local-player-spheres) 12) (let ((a1-13 (new 'stack-no-clear 'collide-using-spheres-params))) - (set! (-> a1-13 spheres) (-> obj world-player-spheres)) + (set! (-> a1-13 spheres) (-> this world-player-spheres)) (set! (-> a1-13 num-spheres) (the-as uint 12)) - (set! (-> a1-13 collide-with) (-> obj cshape root-prim collide-with)) + (set! (-> a1-13 collide-with) (-> this cshape root-prim collide-with)) (set! (-> a1-13 proc) #f) (set! (-> a1-13 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> a1-13 solid-only) #t) - (if (probe-using-spheres (-> obj ccache) a1-13) + (if (probe-using-spheres (-> this ccache) a1-13) (return #f) ) ) - (let* ((v1-36 (the-as object (-> obj ccache prims s4-0 prim))) + (let* ((v1-36 (the-as object (-> this ccache prims s4-0 prim))) (a0-35 (-> (the-as collide-shape-prim v1-36) cshape)) ) (cond @@ -231,7 +231,7 @@ #t ) -(defmethod edge-grab-info-method-9 edge-grab-info ((obj edge-grab-info)) +(defmethod edge-grab-info-method-9 edge-grab-info ((this edge-grab-info)) (local-vars (v0-0 symbol) (v1-14 int)) (rlet ((acc :class vf) (Q :class vf) @@ -246,10 +246,10 @@ ) (init-vf0-vector) (let ((s5-0 (the-as object #f))) - (set! (-> obj center-hold-old quad) (-> obj center-hold quad)) - (let ((v1-1 (-> obj actor-cshape-prim-offset))) + (set! (-> this center-hold-old quad) (-> this center-hold quad)) + (let ((v1-1 (-> this actor-cshape-prim-offset))) (when (nonzero? v1-1) - (let ((a0-5 (handle->process (-> obj actor-handle)))) + (let ((a0-5 (handle->process (-> this actor-handle)))) (if (not (the-as process a0-5)) (return #f) ) @@ -268,13 +268,13 @@ ) ) (dotimes (s3-0 6) - (vector-matrix*! (-> obj world-vertex s3-0) (-> obj local-vertex s3-0) s4-0) + (vector-matrix*! (-> this world-vertex s3-0) (-> this local-vertex s3-0) s4-0) ) ) ) - (.lvf vf1 (&-> obj world-vertex 3 quad)) - (.lvf vf2 (&-> obj world-vertex 4 quad)) - (.lvf vf3 (&-> obj world-vertex 5 quad)) + (.lvf vf1 (&-> this world-vertex 3 quad)) + (.lvf vf2 (&-> this world-vertex 4 quad)) + (.lvf vf3 (&-> this world-vertex 5 quad)) (.sub.vf vf4 vf2 vf1) (.sub.vf vf5 vf3 vf1) (.outer.product.a.vf acc vf4 vf5) @@ -294,28 +294,28 @@ (set! v0-0 #f) (b! #t cfg-27 :delay (nop!)) (label cfg-17) - (set! (-> obj hanging-matrix vector 1 quad) (-> *target* control dynam gravity-normal quad)) + (set! (-> this hanging-matrix vector 1 quad) (-> *target* control dynam gravity-normal quad)) (vector-normalize! - (vector-! (-> obj hanging-matrix vector 2) (-> obj world-vertex 1) (the-as vector (-> obj world-vertex))) + (vector-! (-> this hanging-matrix vector 2) (-> this world-vertex 1) (the-as vector (-> this world-vertex))) 1.0 ) (vector-normalize! (vector-cross! - (the-as vector (-> obj hanging-matrix)) - (-> obj hanging-matrix vector 2) - (-> obj hanging-matrix vector 1) + (the-as vector (-> this hanging-matrix)) + (-> this hanging-matrix vector 2) + (-> this hanging-matrix vector 1) ) 1.0 ) (vector-cross! - (-> obj hanging-matrix vector 2) - (the-as vector (-> obj hanging-matrix)) - (-> obj hanging-matrix vector 1) + (-> this hanging-matrix vector 2) + (the-as vector (-> this hanging-matrix)) + (-> this hanging-matrix vector 1) ) - (set! (-> obj hanging-matrix vector 3 quad) (-> obj center-hold quad)) + (set! (-> this hanging-matrix vector 3 quad) (-> this center-hold quad)) (let ((v1-21 *collide-edge-work*)) (transform-vectors! - (-> obj hanging-matrix) + (-> this hanging-matrix) (-> v1-21 world-player-spheres) (-> v1-21 local-player-spheres) 12 @@ -352,7 +352,7 @@ (label cfg-24) (b! (not (the-as int s5-0)) cfg-26) (let ((v1-40 (-> (the-as collide-shape-prim s5-0) cshape))) - (send-event (-> v1-40 process) 'edge-grabbed obj) + (send-event (-> v1-40 process) 'edge-grabbed this) ) ) (label cfg-26) @@ -366,11 +366,11 @@ (defmethod-mips2c "(method 16 collide-edge-work)" 16 collide-edge-work) (defmethod-mips2c "(method 15 collide-edge-work)" 15 collide-edge-work) -(defmethod collide-edge-work-method-14 collide-edge-work ((obj collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod collide-edge-work-method-14 collide-edge-work ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) (let ((f30-0 -1.0)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (dotimes (s1-0 (the-as int (-> obj num-edges))) - (let ((v1-3 (-> obj edges s1-0))) + (dotimes (s1-0 (the-as int (-> this num-edges))) + (let ((v1-3 (-> this edges s1-0))) (when (not (-> v1-3 ignore)) (when (= (-> v1-3 etri ctri prim-index) arg2) (let ((f0-0 (vector-segment-distance-point! arg1 (-> v1-3 vertex-ptr 0 0) (-> v1-3 vertex-ptr 1 0) s2-0))) @@ -389,7 +389,7 @@ ) ;; 17 cew -(defmethod should-add-to-list? collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 collide-edge-edge)) +(defmethod should-add-to-list? collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 collide-edge-edge)) (local-vars (r0-0 uint128) (v1-1 uint128) @@ -420,27 +420,27 @@ (nop!) (.lvf vf1 (&-> arg0 center-pt quad)) (nop!) - (let ((a3-0 (-> obj within-reach-box4w min quad))) + (let ((a3-0 (-> this within-reach-box4w min quad))) (nop!) - (let ((t1-0 (-> obj within-reach-box4w max quad))) + (let ((t1-0 (-> this within-reach-box4w max quad))) (.ftoi.vf vf2 vf1) - (let ((v1-0 (-> obj cshape))) + (let ((v1-0 (-> this cshape))) (.mov t0-0 vf2) (.lvf vf3 (&-> arg1 outward quad)) (.pcgtw t1-1 t0-0 t1-0) - (.lvf vf4 (&-> obj outward-offset quad)) + (.lvf vf4 (&-> this outward-offset quad)) (.pcgtw a3-1 a3-0 t0-0) (.lvf vf5 (&-> v1-0 trans quad)) ) ) ) (.por v1-1 t1-1 a3-1) - (let ((f0-0 (-> obj max-dist-sqrd-to-outward-pt))) + (let ((f0-0 (-> this max-dist-sqrd-to-outward-pt))) (.ppach v1-2 r0-0 v1-1) - (let ((f1-0 (-> obj max-dir-cosa-delta))) - (b! (nonzero? (shl (the-as int v1-2) 16)) cfg-4 :delay (.lvf vf6 (&-> obj search-dir-vec quad))) + (let ((f1-0 (-> this max-dir-cosa-delta))) + (b! (nonzero? (shl (the-as int v1-2) 16)) cfg-4 :delay (.lvf vf6 (&-> this search-dir-vec quad))) (.mul.x.vf vf10 vf3 vf4) - (.lvf vf11 (&-> obj search-pt quad)) + (.lvf vf11 (&-> this search-pt quad)) (.add.vf vf10 vf10 vf1) (.sub.vf vf7 vf5 vf10) (.mul.vf vf7 vf7 vf7) @@ -482,7 +482,7 @@ ) ) -(defmethod compute-center-point! collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) +(defmethod compute-center-point! collide-edge-work ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) (local-vars (v0-0 float) (v1-1 float) (v1-2 float) (v1-3 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -500,7 +500,7 @@ ) (init-vf0-vector) (.mov.vf vf7 vf0) - (.lvf vf1 (&-> obj search-pt quad)) + (.lvf vf1 (&-> this search-pt quad)) (let ((f0-0 0.0)) (let ((v1-0 (-> arg0 vertex-ptr 0)) (a0-1 (-> arg0 vertex-ptr 1)) @@ -550,12 +550,12 @@ ) -(defmethod debug-draw edge-grab-info ((obj edge-grab-info)) +(defmethod debug-draw edge-grab-info ((this edge-grab-info)) (add-debug-line #t (bucket-id debug-no-zbuf) - (the-as vector (-> obj world-vertex)) - (-> obj world-vertex 1) + (the-as vector (-> this world-vertex)) + (-> this world-vertex 1) (new 'static 'rgba :r #xff :a #x60) #f (the-as rgba -1) @@ -563,36 +563,36 @@ (add-debug-sphere #t (bucket-id debug-no-zbuf) - (-> obj center-hold) + (-> this center-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere #t (bucket-id debug-no-zbuf) - (-> obj left-hand-hold) + (-> this left-hand-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x60) ) (add-debug-sphere #t (bucket-id debug-no-zbuf) - (-> obj right-hand-hold) + (-> this right-hand-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x60) ) (add-debug-outline-triangle #t (bucket-id debug-no-zbuf) - (the-as vector (-> obj tri-vertex)) - (-> obj world-vertex 4) - (-> obj world-vertex 5) + (the-as vector (-> this tri-vertex)) + (-> this world-vertex 4) + (-> this world-vertex 5) (new 'static 'rgba :r #xff :a #x30) ) (the-as symbol (cond - ((nonzero? (-> obj actor-cshape-prim-offset)) - (if (handle->process (-> obj actor-handle)) - (format *stdcon* "grab: ~A~%" (-> obj actor-handle process 0 name)) + ((nonzero? (-> this actor-cshape-prim-offset)) + (if (handle->process (-> this actor-handle)) + (format *stdcon* "grab: ~A~%" (-> this actor-handle process 0 name)) (format *stdcon* "grab: invalid handle~%") ) ) @@ -603,10 +603,10 @@ ) ) -(defmethod debug-draw-edges collide-edge-work ((obj collide-edge-work)) +(defmethod debug-draw-edges collide-edge-work ((this collide-edge-work)) (let ((gp-0 0)) - (dotimes (s4-0 (the-as int (-> obj num-edges))) - (let* ((s3-0 (-> obj edges s4-0)) + (dotimes (s4-0 (the-as int (-> this num-edges))) + (let* ((s3-0 (-> this edges s4-0)) (a2-0 (-> s3-0 vertex-ptr 0 0)) (a3-0 (-> s3-0 vertex-ptr 1 0)) (s2-0 (new 'stack-no-clear 'vector)) @@ -648,21 +648,21 @@ ) ) ) - (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> obj num-edges) (the-as uint gp-0)) gp-0) + (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> this num-edges) (the-as uint gp-0)) gp-0) ) ) -(defmethod debug-draw-sphere collide-edge-work ((obj collide-edge-work)) - (dotimes (s5-0 (the-as int (-> obj num-verts))) - (let ((a2-0 (-> obj verts s5-0))) +(defmethod debug-draw-sphere collide-edge-work ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-verts))) + (let ((a2-0 (-> this verts s5-0))) (add-debug-sphere #t (bucket-id debug-no-zbuf) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)) ) ) #f ) -(defmethod debug-draw collide-edge-hold-list ((obj collide-edge-hold-list)) - (let ((s4-0 (-> obj head)) +(defmethod debug-draw collide-edge-hold-list ((this collide-edge-hold-list)) + (let ((s4-0 (-> this head)) (s5-0 0) ) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -701,21 +701,21 @@ ) (format *stdcon* "hold list has ~D item(s)~%" s5-0) ) - (dotimes (s5-1 (the-as int (-> obj num-attempts))) + (dotimes (s5-1 (the-as int (-> this num-attempts))) (add-debug-sphere #t (bucket-id debug-no-zbuf) - (the-as vector (-> obj attempts s5-1)) + (the-as vector (-> this attempts s5-1)) 409.6 (new 'static 'rgba :a #x40) ) ) - (format *stdcon* "hold list has ~D attempt(s)~%" (-> obj num-attempts)) + (format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts)) ) -(defmethod debug-draw-tris collide-edge-work ((obj collide-edge-work)) - (dotimes (s5-0 (the-as int (-> obj num-tris))) - (let* ((v1-3 (-> obj tris s5-0 ctri)) +(defmethod debug-draw-tris collide-edge-work ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-tris))) + (let* ((v1-3 (-> this tris s5-0 ctri)) (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) ) (add-debug-outline-triangle diff --git a/goal_src/jak1/engine/collide/collide-frag-h.gc b/goal_src/jak1/engine/collide/collide-frag-h.gc index 5bd5957d8f..2efcc56913 100644 --- a/goal_src/jak1/engine/collide/collide-frag-h.gc +++ b/goal_src/jak1/engine/collide/collide-frag-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: collide-frag-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;; ;; Collide Frag ;;;;;;;;;;;;;;;;; diff --git a/goal_src/jak1/engine/collide/collide-frag.gc b/goal_src/jak1/engine/collide/collide-frag.gc index 7246ac2ab7..651f9b7a23 100644 --- a/goal_src/jak1/engine/collide/collide-frag.gc +++ b/goal_src/jak1/engine/collide/collide-frag.gc @@ -5,57 +5,59 @@ ;; name in dgo: collide-frag ;; dgos: GAME, ENGINE +;; DECOMP BEGINS ;; This file contains the drawable-tree implementation for collide-fragment -(defmethod login drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment)) - obj +(defmethod login drawable-tree-collide-fragment ((this drawable-tree-collide-fragment)) + this ) -(defmethod draw drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) +(defmethod draw drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) "Note: this doesn't do anything (sadly)" (when *display-render-collision* - (dotimes (s4-0 (-> obj length)) - (draw (-> obj data s4-0) (-> obj data s4-0) arg1) + (dotimes (s4-0 (-> this length)) + (draw (-> this data s4-0) (-> this data s4-0) arg1) + ) ) - ) + 0 (none) ) -(defmethod unpack-vis drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) - "We don't use vis, so just return the input." +(defmethod unpack-vis drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) -(defmethod collide-with-box drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) "Collide everything in the tree with a box. Length arg doesn't matter here." - (collide-with-box (-> obj data 0) (-> obj length) arg1) + (collide-with-box (-> this data-override) (-> this length) arg1) 0 (none) ) -(defmethod collide-y-probe drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-y-probe (-> obj data 0) (-> obj length) arg1) +(defmethod collide-y-probe drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-y-probe (-> this data-override) (-> this length) arg1) 0 (none) ) -(defmethod collide-ray drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-ray (-> obj data 0) (-> obj length) arg1) +(defmethod collide-ray drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-ray (-> this data-override) (-> this length) arg1) + 0 (none) ) -(defmethod mem-usage collide-fragment ((obj collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-fragment ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) (let ((s5-0 (if (logtest? arg1 1) 53 50 ) ) - (s4-0 (-> obj mesh)) + (s4-0 (-> this mesh)) ) (set! (-> arg0 data s5-0 name) (symbol->string 'collide-fragment)) (+! (-> arg0 data s5-0 count) 1) - (let ((v1-11 (+ (asize-of obj) (asize-of s4-0)))) + (let ((v1-11 (+ (asize-of this) (asize-of s4-0)))) (+! (-> arg0 data s5-0 used) v1-11) (+! (-> arg0 data s5-0 total) (logand -16 (+ v1-11 15))) ) @@ -77,57 +79,62 @@ ) ) -(defmethod login drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment)) - obj +(defmethod login drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) + this ) -(defmethod draw collide-fragment ((obj collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) +(defmethod draw collide-fragment ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) ;; if we wanted to draw collide-fragment's we'd do it here. - ; (when (< (-> obj bsphere w) (meters 22.)) - ; (format 0 "sp: ~m : ~D~%" (-> obj bsphere w) (-> obj mesh poly-count)) - ; (let ((mins (vector-copy! (new-stack-vector0) (-> obj bsphere))) - ; (maxs (vector-copy! (new-stack-vector0) (-> obj bsphere)))) + ; (when (< (-> this bsphere w) (meters 22.)) + ; (format 0 "sp: ~m : ~D~%" (-> this bsphere w) (-> this mesh poly-count)) + ; (let ((mins (vector-copy! (new-stack-vector0) (-> this bsphere))) + ; (maxs (vector-copy! (new-stack-vector0) (-> this bsphere)))) ; (dotimes (i 3) - ; (-! (-> mins data i) (-> obj bsphere w)) - ; (+! (-> maxs data i) (-> obj bsphere w)) + ; (-! (-> mins data i) (-> this bsphere w)) + ; (+! (-> maxs data i) (-> this bsphere w)) ; ) ; (add-debug-box #t (bucket-id debug) mins maxs (new 'static 'rgba :r #x80 :a #x80) ; ) - ; ;(add-debug-sphere #t (bucket-id debug) (-> obj bsphere) (-> obj bsphere w) (new 'static 'rgba :r #x80 :a #x80)) + ; ;(add-debug-sphere #t (bucket-id debug) (-> this bsphere) (-> this bsphere w) (new 'static 'rgba :r #x80 :a #x80)) ; ) - ;; (add-debug-point #t (bucket-id debug) (-> obj bsphere)) + ;; (add-debug-point #t (bucket-id debug) (-> this bsphere)) (none) ) -(defmethod draw drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 drawable-inline-array-collide-fragment) (arg1 display-frame)) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj data s4-0))) - (if (sphere-cull (-> s3-0 bsphere)) - (draw s3-0 s3-0 arg1) - ) +(defmethod draw drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) + (arg0 drawable-inline-array-collide-fragment) + (arg1 display-frame) + ) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this data s4-0))) + (if (sphere-cull (-> s3-0 bsphere)) + (draw s3-0 s3-0 arg1) + ) + ) ) - ) - (none) - ) - -(defmethod collide-with-box drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-with-box (the-as collide-fragment (-> obj data)) (-> obj length) arg1) 0 (none) ) -(defmethod collide-y-probe drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-y-probe (the-as collide-fragment (-> obj data)) (-> obj length) arg1) +(defmethod collide-with-box drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-with-box (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 (none) ) -(defmethod collide-ray drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-ray (the-as collide-fragment (-> obj data)) (-> obj length) arg1) +(defmethod collide-y-probe drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-y-probe (the-as collide-fragment (-> this data)) (-> this length) arg1) + 0 (none) ) -(defmethod mem-usage drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod collide-ray drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-ray (the-as collide-fragment (-> this data)) (-> this length) arg1) + 0 + (none) + ) + +(defmethod mem-usage drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -135,8 +142,8 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) diff --git a/goal_src/jak1/engine/collide/collide-mesh-h.gc b/goal_src/jak1/engine/collide/collide-mesh-h.gc index 5ff16b2220..11f7b81bfc 100644 --- a/goal_src/jak1/engine/collide/collide-mesh-h.gc +++ b/goal_src/jak1/engine/collide/collide-mesh-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: collide-mesh-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; The collide-mesh system is used for _moving_ meshes, like a platform. ;; It's not used for the full level (that's collide-frag-mesh) @@ -15,10 +17,10 @@ ;; The triangle involved in collision ;; Note: this is reused for the background collision system. (deftype collide-tri-result (structure) - ((vertex vector 3 :inline :offset-assert 0) - (intersect vector :inline :offset-assert 48) - (normal vector :inline :offset-assert 64) - (pat pat-surface :offset-assert 80) + ((vertex vector 3 :inline :offset-assert 0) + (intersect vector :inline :offset-assert 48) + (normal vector :inline :offset-assert 64) + (pat pat-surface :offset-assert 80) ) :method-count-assert 9 :size-assert #x54 @@ -33,9 +35,9 @@ ;; The vertex indices index into the collide-mesh vertex-data array. ;; Due to using uint8's you only get 256 vertices. (deftype collide-mesh-tri (structure) - ((vertex-index uint8 3 :offset-assert 0) - (unused uint8 :offset-assert 3) - (pat pat-surface :offset-assert 4) + ((vertex-index uint8 3 :offset-assert 0) + (unused uint8 :offset-assert 3) + (pat pat-surface :offset-assert 4) ) :pack-me :method-count-assert 9 @@ -43,15 +45,16 @@ :flag-assert #x900000008 ) +;; og:preserve-this (declare-type collide-mesh-cache-tri structure) ;; A collision mesh. Note that's it's bound to a specific joint. (deftype collide-mesh (basic) - ((joint-id int32 :offset-assert 4) - (num-tris uint32 :offset-assert 8) - (num-verts uint32 :offset-assert 12) - (vertex-data (inline-array vector) :offset-assert 16) - (tris collide-mesh-tri 1 :inline :offset 32) + ((joint-id int32 :offset-assert 4) + (num-tris uint32 :offset-assert 8) + (num-verts uint32 :offset-assert 12) + (vertex-data (inline-array vector) :offset-assert 16) + (tris collide-mesh-tri 1 :inline :offset 32) ) :method-count-assert 16 :size-assert #x28 @@ -77,13 +80,14 @@ ;; If you do multiple collision queries against the same object, it will only have to transform the ;; collision mesh once. +;; og:preserve-this (defconstant COLLIDE_MESH_CACHE_SIZE #xa000) (deftype collide-mesh-cache (basic) - ((used-size uint32 :offset-assert 4) - (max-size uint32 :offset-assert 8) - (id uint64 :offset-assert 16) - (data uint8 #xa000 :offset 32) + ((used-size uint32 :offset-assert 4) + (max-size uint32 :offset-assert 8) + (id uint64 :offset-assert 16) + (data uint8 40960 :offset 32) ) :method-count-assert 12 :size-assert #xa020 @@ -117,17 +121,17 @@ ) ) -(defmethod is-id? collide-mesh-cache ((obj collide-mesh-cache) (arg0 int)) +(defmethod is-id? collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) "Is this our id?" - (= (-> obj id) arg0) + (= (-> this id) arg0) ) ;; possibly this is stored in the data of the collide-mesh-cache (deftype collide-mesh-cache-tri (structure) - ((vertex vector 3 :inline :offset-assert 0) - (normal vector :inline :offset-assert 48) - (bbox4w bounding-box4w :inline :offset-assert 64) - (pat pat-surface :offset 60) + ((vertex vector 3 :inline :offset-assert 0) + (normal vector :inline :offset-assert 48) + (bbox4w bounding-box4w :inline :offset-assert 64) + (pat pat-surface :offset 60) ) :method-count-assert 9 :size-assert #x60 @@ -137,6 +141,7 @@ ;; only allocate if we don't have an existing one. (define-perm *collide-mesh-cache* collide-mesh-cache (new 'global 'collide-mesh-cache)) +;; og:preserve-this ;; in all cases, re-init. (set! (-> *collide-mesh-cache* id) 1) (set! (-> *collide-mesh-cache* used-size) 0) diff --git a/goal_src/jak1/engine/collide/collide-mesh.gc b/goal_src/jak1/engine/collide/collide-mesh.gc index 910882460c..72d3fca71f 100644 --- a/goal_src/jak1/engine/collide/collide-mesh.gc +++ b/goal_src/jak1/engine/collide/collide-mesh.gc @@ -5,31 +5,33 @@ ;; name in dgo: collide-mesh ;; dgos: GAME, ENGINE -(defmethod asize-of collide-mesh ((obj collide-mesh)) +;; DECOMP BEGINS + +(defmethod asize-of collide-mesh ((this collide-mesh)) "Compute the size in memory of a collide-mesh. Somehow this only counts num-tris and not verts." - (the-as int (+ (-> collide-mesh size) (* (+ (-> obj num-tris) -1) 8))) + (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) ) -(defmethod mem-usage collide-mesh ((obj collide-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-mesh ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a collide-mesh." (set! (-> arg0 length) (max 79 (-> arg0 length))) (set! (-> arg0 data 78 name) "collide-mesh") (+! (-> arg0 data 78 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 78 used) v1-6) (+! (-> arg0 data 78 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 79 (-> arg0 length))) (set! (-> arg0 data 78 name) "collide-mesh") (+! (-> arg0 data 78 count) 1) - (let ((v1-16 (* (-> obj num-verts) 16))) + (let ((v1-16 (* (-> this num-verts) 16))) (+! (-> arg0 data 78 used) v1-16) (+! (-> arg0 data 78 total) (logand -16 (+ v1-16 15))) ) (the-as collide-mesh 0) ) -(defmethod debug-draw-tris collide-mesh ((obj collide-mesh) (arg0 process-drawable) (arg1 int)) +(defmethod debug-draw-tris collide-mesh ((this collide-mesh) (arg0 process-drawable) (arg1 int)) "Draw a collide-mesh." (rlet ((acc :class vf) (vf0 :class vf) @@ -42,10 +44,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (the-as object (-> obj tris))) + (let ((s5-0 (the-as object (-> this tris))) (s4-0 (-> arg0 node-list data arg1 bone transform)) ) - (countdown (s3-0 (-> obj num-tris)) + (countdown (s3-0 (-> this num-tris)) (let ((a2-1 (new 'stack-no-clear 'vector)) (a3-0 (new 'stack-no-clear 'vector)) (t0-0 (new 'stack-no-clear 'vector)) @@ -54,9 +56,9 @@ (.lvf vf5 (&-> s4-0 vector 1 quad)) (.lvf vf6 (&-> s4-0 vector 2 quad)) (.lvf vf7 (&-> s4-0 vector 3 quad)) - (.lvf vf1 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) - (.lvf vf2 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) - (.lvf vf3 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 2)) quad)) + (.lvf vf1 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) + (.lvf vf2 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) + (.lvf vf3 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 2)) quad)) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-mesh-tri s5-0) pat mode) color) a 16))) (.mul.w.vf acc vf7 vf0) (.add.mul.x.vf acc vf4 vf1 acc) @@ -110,18 +112,18 @@ (defmethod-mips2c "(method 14 collide-mesh)" 14 collide-mesh) (defmethod-mips2c "(method 15 collide-mesh)" 15 collide-mesh) -(defmethod allocate! collide-mesh-cache ((obj collide-mesh-cache) (arg0 int)) +(defmethod allocate! collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) (local-vars (a1-2 int) (a2-2 int)) (let* ((v1-0 (+ arg0 15)) - (a1-1 (-> obj used-size)) + (a1-1 (-> this used-size)) (v1-1 (/ v1-0 16)) - (a3-0 (-> obj data)) - (a2-0 (-> obj max-size)) + (a3-0 (-> this data)) + (a2-0 (-> this max-size)) (v1-2 (* v1-1 16)) (a3-1 (&+ a3-0 a1-1)) ) (let ((t1-0 (- a2-0 (the-as uint v1-2))) - (t0-0 (-> obj id)) + (t0-0 (-> this id)) ) (b! (< (the-as int t1-0) 0) cfg-6 :delay (set! a1-2 (the-as int (+ a1-1 v1-2)))) (b! (>= (the-as int (- a2-0 (the-as uint a1-2))) 0) cfg-5 :delay (set! a2-2 (the-as int (+ t0-0 1)))) @@ -129,10 +131,10 @@ (b! (zero? (the-as uint a2-2)) cfg-4 :likely-delay (set! a2-2 1)) (label cfg-4) (set! a1-2 v1-2) - (set! a3-1 (-> obj data)) - (set! (-> obj id) (the-as uint a2-2)) + (set! a3-1 (-> this data)) + (set! (-> this id) (the-as uint a2-2)) (label cfg-5) - (set! (-> obj used-size) (the-as uint a1-2)) + (set! (-> this used-size) (the-as uint a1-2)) (let ((v0-0 a3-1)) (b! #t cfg-7 :delay (nop!)) (label cfg-6) @@ -144,7 +146,7 @@ ) ) -(defmethod populate-cache! collide-mesh ((obj collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix)) +(defmethod populate-cache! collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix)) (local-vars (t0-2 uint)) (rlet ((acc :class vf) (Q :class vf) @@ -165,10 +167,10 @@ (init-vf0-vector) (nop!) (let ((t0-0 (scratchpad-object int)) - (v1-0 (-> obj num-verts)) + (v1-0 (-> this num-verts)) ) (nop!) - (let ((a3-0 (-> obj vertex-data))) + (let ((a3-0 (-> this vertex-data))) (b! (zero? v1-0) cfg-3 :delay (.lvf vf1 (&-> arg1 vector 0 quad))) (nop!) (.lvf vf2 (&-> arg1 vector 1 quad)) @@ -230,10 +232,10 @@ ) ) (label cfg-3) - (let ((v1-1 (the-as collide-mesh-tri (-> obj tris)))) + (let ((v1-1 (the-as collide-mesh-tri (-> this tris)))) (nop!) (let ((a2-1 (scratchpad-object int)) - (a0-1 (-> obj num-tris)) + (a0-1 (-> this num-tris)) ) (b! (zero? a0-1) cfg-6 :delay (set! t0-2 (-> v1-1 vertex-index 0))) (let* ((a1-1 (&+ arg0 -96)) @@ -313,7 +315,7 @@ ) -(defmethod overlap-test collide-mesh ((obj collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) +(defmethod overlap-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) (local-vars (zero uint128) (v1-0 uint128) @@ -340,7 +342,7 @@ (s4-0 arg0) ) (.lvf vf2 (&-> arg1 quad)) - (let ((s3-0 (-> obj num-tris))) + (let ((s3-0 (-> this num-tris))) (.sub.w.vf vf5 vf2 vf2) (.add.w.vf vf6 vf2 vf2) (.ftoi.vf vf5 vf5) diff --git a/goal_src/jak1/engine/collide/collide-probe.gc b/goal_src/jak1/engine/collide/collide-probe.gc index 9842bc45cb..789a7ffdfb 100644 --- a/goal_src/jak1/engine/collide/collide-probe.gc +++ b/goal_src/jak1/engine/collide/collide-probe.gc @@ -5,6 +5,8 @@ ;; name in dgo: collide-probe ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; The "collision probe" checks to see what the first triangle is in a given direction. ;; This is an annoying and expensive thing to compute, so this is complicated. ;; Generally, this is used for the "using y probe" methods which find the ground beneath a thing. diff --git a/goal_src/jak1/engine/collide/collide-shape-h.gc b/goal_src/jak1/engine/collide/collide-shape-h.gc index d7004415ca..adaaaece2a 100644 --- a/goal_src/jak1/engine/collide/collide-shape-h.gc +++ b/goal_src/jak1/engine/collide/collide-shape-h.gc @@ -108,10 +108,10 @@ ) ) -(defmethod set-rider! collide-sticky-rider ((obj collide-sticky-rider) (arg0 handle)) +(defmethod set-rider! collide-sticky-rider ((this collide-sticky-rider) (arg0 handle)) "Set the rider and clear the primitive." - (set! (-> obj rider-handle) arg0) - (set! (-> obj sticky-prim) #f) + (set! (-> this rider-handle) arg0) + (set! (-> this sticky-prim) #f) #f ) @@ -132,9 +132,9 @@ ) ) -(defmethod reset! collide-sticky-rider-group ((obj collide-sticky-rider-group)) +(defmethod reset! collide-sticky-rider-group ((this collide-sticky-rider-group)) "Reset all active riders" - (set! (-> obj num-riders) 0) + (set! (-> this num-riders) 0) 0 ) @@ -189,12 +189,12 @@ ) ) -(defmethod reset! collide-overlap-result ((obj collide-overlap-result)) +(defmethod reset! collide-overlap-result ((this collide-overlap-result)) "Reset the result." - (set! (-> obj best-dist) 0.0) - (set! (-> obj best-from-prim) #f) - (set! (-> obj best-to-prim) #f) + (set! (-> this best-dist) 0.0) + (set! (-> this best-from-prim) #f) + (set! (-> this best-to-prim) #f) (none) ) @@ -666,17 +666,17 @@ "Allocate a new collide-shape-prim. It is expected that children of collide-shape-prim override this. NOTE: uses the size-bytes as the TOTAL size of the structure." - (let ((obj (object-new allocation type-to-make size-bytes))) - (set! (-> obj cshape) (the-as collide-shape cshape)) + (let ((this (object-new allocation type-to-make size-bytes))) + (set! (-> this cshape) (the-as collide-shape cshape)) ;; sphere/mesh? - (set! (-> obj prim-id) prim-id) - (set! (-> obj prim-core action) (collide-action)) - (set! (-> obj prim-core collide-as) (collide-kind)) - (set! (-> obj collide-with) (collide-kind)) - (set! (-> obj transform-index) -2) - (set! (-> obj prim-core offense) (collide-offense no-offense)) - (set! (-> obj prim-core prim-type) -2) - obj + (set! (-> this prim-id) prim-id) + (set! (-> this prim-core action) (collide-action)) + (set! (-> this prim-core collide-as) (collide-kind)) + (set! (-> this collide-with) (collide-kind)) + (set! (-> this transform-index) -2) + (set! (-> this prim-core offense) (collide-offense no-offense)) + (set! (-> this prim-core prim-type) -2) + this ) ) @@ -684,114 +684,114 @@ (defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (cshape collide-shape) (prim-id uint)) "Allocate a new sphere primitive" - (let ((obj (the collide-shape-prim-sphere ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-sphere))))) - (set! (-> obj pat) (new 'static 'pat-surface :mode (pat-mode obstacle))) - (set! (-> obj prim-core prim-type) -1) - obj + (let ((this (the collide-shape-prim-sphere ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-sphere))))) + (set! (-> this pat) (new 'static 'pat-surface :mode (pat-mode obstacle))) + (set! (-> this prim-core prim-type) -1) + this ) ) (defmethod new collide-shape-prim-mesh ((allocation symbol) (type-to-make type) (cshape collide-shape) (mesh-id uint) (prim-id uint)) "Allocate a new mesh primitive" - (let ((obj (the collide-shape-prim-mesh ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-mesh))))) - (set! (-> obj mesh) #f) - (set! (-> obj mesh-id) (the int mesh-id)) - (set! (-> obj mesh-cache-id) 0) - (set! (-> obj prim-core prim-type) 1) - obj + (let ((this (the collide-shape-prim-mesh ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id (size-of collide-shape-prim-mesh))))) + (set! (-> this mesh) #f) + (set! (-> this mesh-id) (the int mesh-id)) + (set! (-> this mesh-cache-id) 0) + (set! (-> this prim-core prim-type) 1) + this ) ) (defmethod new collide-shape-prim-group ((allocation symbol) (type-to-make type) (cshape collide-shape) (elt-count uint) (prim-id int)) "Allocate a group of primitives." - (let ((obj (the collide-shape-prim-group ((method-of-type collide-shape-prim new) allocation type-to-make cshape (the uint prim-id) (the int (+ (-> type-to-make size) (* (+ elt-count -1) 4))))))) - (set! (-> obj allocated-prims) (the int elt-count)) - (set! (-> obj num-prims) 0) - (set! (-> obj prim-core prim-type) 0) + (let ((this (the collide-shape-prim-group ((method-of-type collide-shape-prim new) allocation type-to-make cshape (the uint prim-id) (the int (+ (-> type-to-make size) (* (+ elt-count -1) 4))))))) + (set! (-> this allocated-prims) (the int elt-count)) + (set! (-> this num-prims) 0) + (set! (-> this prim-core prim-type) 0) (while (nonzero? elt-count) (+! elt-count -1) - (set! (-> obj prim elt-count) (the collide-shape-prim #f)) + (set! (-> this prim elt-count) (the collide-shape-prim #f)) (nop!) ) - obj + this ) ) -(defmethod length collide-shape-prim-group ((obj collide-shape-prim-group)) +(defmethod length collide-shape-prim-group ((this collide-shape-prim-group)) "How many primitives are used?" - (-> obj num-prims) + (-> this num-prims) ) -(defmethod asize-of collide-shape-prim-group ((obj collide-shape-prim-group)) +(defmethod asize-of collide-shape-prim-group ((this collide-shape-prim-group)) "How big is this in memory?" - (the-as int (+ (-> obj type size) (* (+ (-> obj allocated-prims) -1) 4))) + (the-as int (+ (-> this type size) (* (+ (-> this allocated-prims) -1) 4))) ) (defmethod new collide-shape ((allocation symbol) (type-to-make type) (proc process-drawable) (collide-list-kind collide-list-enum)) "Allocate a new collide-shape and add to a collide-list" - (let ((obj (object-new allocation type-to-make (the int (-> type-to-make size))))) - (set! (-> obj process) proc) - (set! (-> obj max-iteration-count) 1) - (set! (-> obj nav-flags) (nav-flags navf0)) - (set! (-> obj event-self) #f) - (set! (-> obj event-other) #f) - (set! (-> obj riders) #f) - (set! (-> obj root-prim) #f) + (let ((this (object-new allocation type-to-make (the int (-> type-to-make size))))) + (set! (-> this process) proc) + (set! (-> this max-iteration-count) 1) + (set! (-> this nav-flags) (nav-flags navf0)) + (set! (-> this event-self) #f) + (set! (-> this event-other) #f) + (set! (-> this riders) #f) + (set! (-> this root-prim) #f) ;; add a special ignore mask for the camera vs other things. (case (-> proc type symbol) (('camera) - (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :skip #x2 :nocamera #x1)) + (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :skip #x2 :nocamera #x1)) ) (else - (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) + (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :skip #x1 :noentity #x1)) ) ) ;; reset transformation to the origin. - (set! (-> obj trans w) 1.0) - (quaternion-identity! (-> obj quat)) - (vector-identity! (-> obj scale)) + (set! (-> this trans w) 1.0) + (quaternion-identity! (-> this quat)) + (vector-identity! (-> this scale)) ;; add us to right list. (case collide-list-kind (((collide-list-enum hit-by-player)) - (add-connection *collide-hit-by-player-list* proc #f obj #f #f)) + (add-connection *collide-hit-by-player-list* proc #f this #f #f)) (((collide-list-enum usually-hit-by-player)) - (add-connection *collide-usually-hit-by-player-list* proc #f obj #f #f)) + (add-connection *collide-usually-hit-by-player-list* proc #f this #f #f)) (((collide-list-enum hit-by-others)) - (add-connection *collide-hit-by-others-list* proc #f obj #f #f)) + (add-connection *collide-hit-by-others-list* proc #f this #f #f)) (((collide-list-enum player)) - (add-connection *collide-player-list* proc #f obj #f #f)) + (add-connection *collide-player-list* proc #f this #f #f)) (else (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%")) ) - obj + this ) ) (defmethod new collide-sticky-rider-group ((allocation symbol) (type-to-make type) (riders-amount int)) "Allocate a new collide-sticky-rider-group with space for riders-amount sticky riders." - (let ((obj (object-new allocation type-to-make (the int (+ (-> type-to-make size) (the uint (* (1- riders-amount) (size-of collide-sticky-rider)))))))) - (set! (-> obj allocated-riders) riders-amount) - (set! (-> obj num-riders) 0) - obj + (let ((this (object-new allocation type-to-make (the int (+ (-> type-to-make size) (the uint (* (1- riders-amount) (size-of collide-sticky-rider)))))))) + (set! (-> this allocated-riders) riders-amount) + (set! (-> this num-riders) 0) + this ) ) -(defmethod length collide-sticky-rider-group ((obj collide-sticky-rider-group)) - (-> obj num-riders) +(defmethod length collide-sticky-rider-group ((this collide-sticky-rider-group)) + (-> this num-riders) ) -(defmethod asize-of collide-sticky-rider-group ((obj collide-sticky-rider-group)) - (the-as int (+ (-> obj type size) (* (+ (-> obj allocated-riders) -1) 32))) +(defmethod asize-of collide-sticky-rider-group ((this collide-sticky-rider-group)) + (the-as int (+ (-> this type size) (* (+ (-> this allocated-riders) -1) 32))) ) ;;;;;;;;;;;;;;;;;;;; diff --git a/goal_src/jak1/engine/collide/collide-shape-rider.gc b/goal_src/jak1/engine/collide/collide-shape-rider.gc index 32e660c290..1d53e16b0c 100644 --- a/goal_src/jak1/engine/collide/collide-shape-rider.gc +++ b/goal_src/jak1/engine/collide/collide-shape-rider.gc @@ -5,7 +5,9 @@ ;; name in dgo: collide-shape-rider ;; dgos: GAME, ENGINE -(defmethod on-platform collide-shape ((obj collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) +;; DECOMP BEGINS + +(defmethod on-platform collide-shape ((this collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) "Are we on the platform? Returns #t/#f and also sets an overlap result." (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) @@ -13,7 +15,7 @@ (set! (-> v1-0 best-to-prim) #f) ) (set! (-> arg1 best-dist) 122.88) - (let ((s5-0 (-> obj root-prim)) + (let ((s5-0 (-> this root-prim)) (s4-0 (-> arg0 root-prim)) ) (when (and (logtest? (-> s5-0 collide-with) (-> s4-0 prim-core collide-as)) @@ -37,16 +39,16 @@ ) -(defmethod on-platform-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") (none) ) -(defmethod on-platform-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) "Check if we're on the platform for a prim group." (let ((s3-0 (-> arg0 prim-core collide-as))) - (dotimes (s2-0 (-> obj num-prims)) - (let ((s1-0 (-> obj prims s2-0))) + (dotimes (s2-0 (-> this num-prims)) + (let ((s1-0 (-> this prims s2-0))) ;; check collide kind (when (and (logtest? (-> s1-0 collide-with) s3-0) (logtest? (-> s1-0 prim-core action) (collide-action rider-plat-sticky)) @@ -71,26 +73,26 @@ (none) ) -(defmethod on-platform-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) "check if we're on the platform for a mesh." (case (-> arg0 type) ;; mesh to group ((collide-shape-prim-group) - (let ((s3-0 (-> obj collide-with))) + (let ((s3-0 (-> this collide-with))) (dotimes (s2-0 (-> (the-as collide-shape-prim-group arg0) num-prims)) (let ((s1-0 (-> (the-as collide-shape-prim-group arg0) prims s2-0))) (when (and (logtest? s3-0 (-> s1-0 prim-core collide-as)) (logtest? (-> s1-0 prim-core action) (collide-action rider-target)) ) - (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> obj prim-core)) (the-as vector (-> s1-0 prim-core))) - (-> obj prim-core world-sphere w) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> this prim-core)) (the-as vector (-> s1-0 prim-core))) + (-> this prim-core world-sphere w) ) (-> s1-0 prim-core world-sphere w) ) ) ) (if (< f0-2 122.88) - (on-platform-test obj s1-0 arg1 f0-2) + (on-platform-test this s1-0 arg1 f0-2) ) ) ) @@ -100,19 +102,19 @@ ) ;; mesh to sphere. use the collide-mesh-cache. ((collide-shape-prim-sphere) - (let ((s3-1 (-> obj mesh))) + (let ((s3-1 (-> this mesh))) (when s3-1 (let ((s2-1 *collide-mesh-cache*)) - (when (!= (-> obj mesh-cache-id) (-> s2-1 id)) + (when (!= (-> this mesh-cache-id) (-> s2-1 id)) (let ((v1-17 (allocate! s2-1 (* 96 (-> s3-1 num-tris))))) (cond (v1-17 - (set! (-> obj mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-17)) - (set! (-> obj mesh-cache-id) (-> s2-1 id)) + (set! (-> this mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-17)) + (set! (-> this mesh-cache-id) (-> s2-1 id)) (populate-cache! s3-1 - (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) - (-> obj cshape process node-list data (-> obj transform-index) bone transform) + (the-as collide-mesh-cache-tri (-> this mesh-cache-tris)) + (-> this cshape process node-list data (-> this transform-index) bone transform) ) ) (else @@ -125,7 +127,7 @@ (let* ((s2-2 (new 'stack-no-clear 'collide-tri-result)) (f0-4 (sphere-on-platform-test s3-1 - (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + (the-as collide-mesh-cache-tri (-> this mesh-cache-tris)) s2-2 (the-as vector (-> arg0 prim-core)) (-> arg1 best-dist) @@ -134,7 +136,7 @@ ) (when (< f0-4 (-> arg1 best-dist)) (set! (-> arg1 best-dist) f0-4) - (set! (-> arg1 best-from-prim) obj) + (set! (-> arg1 best-from-prim) this) (set! (-> arg1 best-to-prim) arg0) (set! (-> arg1 best-from-tri vertex 0 quad) (-> s2-2 vertex 0 quad)) (set! (-> arg1 best-from-tri vertex 1 quad) (-> s2-2 vertex 1 quad)) @@ -151,13 +153,13 @@ (none) ) -(defmethod add-rider! collide-sticky-rider-group ((obj collide-sticky-rider-group) (arg0 process-drawable)) +(defmethod add-rider! collide-sticky-rider-group ((this collide-sticky-rider-group) (arg0 process-drawable)) "Add a rider to this platform." (let ((gp-0 (the-as collide-sticky-rider #f))) (cond - ((< (-> obj num-riders) (-> obj allocated-riders)) - (set! gp-0 (-> obj rider (-> obj num-riders))) - (+! (-> obj num-riders) 1) + ((< (-> this num-riders) (-> this allocated-riders)) + (set! gp-0 (-> this rider (-> this num-riders))) + (+! (-> this num-riders) 1) (let ((v1-6 gp-0)) (set! (-> v1-6 rider-handle) (the-as handle arg0)) (set! (-> v1-6 sticky-prim) #f) @@ -171,9 +173,9 @@ ) ) -(defmethod detect-riders! collide-shape ((obj collide-shape)) +(defmethod detect-riders! collide-shape ((this collide-shape)) "See who is riding us." - (let ((s5-0 (-> obj riders))) + (let ((s5-0 (-> this riders))) (when s5-0 (let* ((v1-0 *collide-mesh-cache*) (a0-1 (-> v1-0 id)) @@ -187,7 +189,7 @@ ) (set! (-> s5-0 num-riders) 0) 0 - (let ((s4-0 (-> obj root-prim collide-with))) + (let ((s4-0 (-> this root-prim collide-with))) (when (logtest? s4-0 (collide-kind target)) (let ((v1-7 (-> *collide-player-list* alive-list next0))) *collide-player-list* @@ -198,17 +200,17 @@ ) (when (logtest? s4-0 (-> v1-8 prim-core collide-as)) (when (and (logtest? (-> v1-8 prim-core action) (collide-action rider-target)) - (!= (-> obj process) (-> (the-as collide-shape s2-0) process)) + (!= (-> this process) (-> (the-as collide-shape s2-0) process)) ) (let ((s1-0 (new 'stack-no-clear 'collide-overlap-result))) - (when (on-platform obj (the-as collide-shape s2-0) s1-0) + (when (on-platform this (the-as collide-shape s2-0) s1-0) (let ((s4-1 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-0) process))))) ) (when s4-1 (let ((a0-11 (-> s1-0 best-from-prim))) (set! (-> s4-1 sticky-prim) a0-11) (let ((s1-1 - (-> (the-as process-drawable (-> obj process)) node-list data (-> a0-11 transform-index) bone transform) + (-> (the-as process-drawable (-> this process)) node-list data (-> a0-11 transform-index) bone transform) ) ) (set! (-> s4-1 prim-ry) (matrix-y-angle s1-1)) @@ -218,10 +220,10 @@ ) ) ) - (send-event (-> obj process) 'ridden s4-1) + (send-event (-> this process) 'ridden s4-1) ) ) - (set! s4-0 (-> obj root-prim collide-with)) + (set! s4-0 (-> this root-prim collide-with)) ) ) ) @@ -245,16 +247,16 @@ ) (when (logtest? s4-0 (-> v1-38 prim-core collide-as)) (when (and (logtest? (-> v1-38 prim-core action) (collide-action rider-target)) - (!= (-> obj process) (-> (the-as collide-shape s2-1) process)) + (!= (-> this process) (-> (the-as collide-shape s2-1) process)) ) (let ((s1-2 (new 'stack-no-clear 'collide-overlap-result))) - (when (on-platform obj (the-as collide-shape s2-1) s1-2) + (when (on-platform this (the-as collide-shape s2-1) s1-2) (let ((s4-2 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-1) process))))) ) (when s4-2 (let ((a0-30 (-> s1-2 best-from-prim))) (set! (-> s4-2 sticky-prim) a0-30) - (let ((s1-3 (-> obj process node-list data (-> a0-30 transform-index) bone transform))) + (let ((s1-3 (-> this process node-list data (-> a0-30 transform-index) bone transform))) (set! (-> s4-2 prim-ry) (matrix-y-angle s1-3)) (let ((s0-1 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s0-1 s1-3) @@ -262,10 +264,10 @@ ) ) ) - (send-event (-> obj process) 'ridden s4-2) + (send-event (-> this process) 'ridden s4-2) ) ) - (set! s4-0 (-> obj root-prim collide-with)) + (set! s4-0 (-> this root-prim collide-with)) ) ) ) @@ -288,16 +290,16 @@ ) (when (logtest? s4-0 (-> v1-67 prim-core collide-as)) (when (and (logtest? (-> v1-67 prim-core action) (collide-action rider-target)) - (!= (-> obj process) (-> (the-as collide-shape s2-2) process)) + (!= (-> this process) (-> (the-as collide-shape s2-2) process)) ) (let ((s1-4 (new 'stack-no-clear 'collide-overlap-result))) - (when (on-platform obj (the-as collide-shape s2-2) s1-4) + (when (on-platform this (the-as collide-shape s2-2) s1-4) (let ((s4-3 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-2) process))))) ) (when s4-3 (let ((a0-49 (-> s1-4 best-from-prim))) (set! (-> s4-3 sticky-prim) a0-49) - (let ((s1-5 (-> obj process node-list data (-> a0-49 transform-index) bone transform))) + (let ((s1-5 (-> this process node-list data (-> a0-49 transform-index) bone transform))) (set! (-> s4-3 prim-ry) (matrix-y-angle s1-5)) (let ((s0-2 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s0-2 s1-5) @@ -305,10 +307,10 @@ ) ) ) - (send-event (-> obj process) 'ridden s4-3) + (send-event (-> this process) 'ridden s4-3) ) ) - (set! s4-0 (-> obj root-prim collide-with)) + (set! s4-0 (-> this root-prim collide-with)) ) ) ) @@ -331,16 +333,16 @@ ) (when (logtest? s4-0 (-> v1-95 prim-core collide-as)) (when (and (logtest? (-> v1-95 prim-core action) (collide-action rider-target)) - (!= (-> obj process) (-> (the-as collide-shape s2-3) process)) + (!= (-> this process) (-> (the-as collide-shape s2-3) process)) ) (let ((s1-6 (new 'stack-no-clear 'collide-overlap-result))) - (when (on-platform obj (the-as collide-shape s2-3) s1-6) + (when (on-platform this (the-as collide-shape s2-3) s1-6) (let ((s4-4 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-3) process))))) ) (when s4-4 (let ((a0-68 (-> s1-6 best-from-prim))) (set! (-> s4-4 sticky-prim) a0-68) - (let ((s1-7 (-> obj process node-list data (-> a0-68 transform-index) bone transform))) + (let ((s1-7 (-> this process node-list data (-> a0-68 transform-index) bone transform))) (set! (-> s4-4 prim-ry) (matrix-y-angle s1-7)) (let ((s0-3 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s0-3 s1-7) @@ -348,10 +350,10 @@ ) ) ) - (send-event (-> obj process) 'ridden s4-4) + (send-event (-> this process) 'ridden s4-4) ) ) - (set! s4-0 (-> obj root-prim collide-with)) + (set! s4-0 (-> this root-prim collide-with)) ) ) ) @@ -371,9 +373,9 @@ ) ) -(defmethod pull-riders! collide-shape ((obj collide-shape)) +(defmethod pull-riders! collide-shape ((this collide-shape)) "Move our riders." - (let ((s5-0 (-> obj riders))) + (let ((s5-0 (-> this riders))) (when s5-0 (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) (countdown (s3-0 (-> s5-0 num-riders)) @@ -387,14 +389,14 @@ ) (let ((a0-5 (-> v1-2 sticky-prim))) (when a0-5 - (let ((s2-0 (-> obj process node-list data (-> a0-5 transform-index) bone transform))) + (let ((s2-0 (-> this process node-list data (-> a0-5 transform-index) bone transform))) (let ((s1-0 (-> s4-0 rider-dest))) (vector-matrix*! s1-0 (-> v1-2 rider-local-pos) s2-0) (vector-float*! s1-0 s1-0 (/ 1.0 (-> s1-0 w))) ) (set! (-> s4-0 rider-delta-ry) (deg- (matrix-y-angle s2-0) (-> s4-0 rider prim-ry))) ) - (pull-rider! obj s4-0) + (pull-rider! this s4-0) ) ) ) @@ -406,7 +408,7 @@ ) ) -(defmethod pull-rider! collide-shape ((obj collide-shape) (arg0 pull-rider-info)) +(defmethod pull-rider! collide-shape ((this collide-shape) (arg0 pull-rider-info)) "Move a rider." (local-vars (at-0 int) (sv-160 (function collide-shape-moving float collide-kind none))) (rlet ((vf0 :class vf) @@ -421,9 +423,9 @@ (set! (-> s4-0 quad) (-> gp-0 trans quad)) (vector-! s3-0 (-> arg0 rider-dest) s4-0) (cond - ((logtest? (-> obj root-prim prim-core action) (collide-action rider-plat)) - (let ((s1-0 (-> obj root-prim prim-core collide-as))) - (set! (-> obj root-prim prim-core collide-as) (collide-kind)) + ((logtest? (-> this root-prim prim-core action) (collide-action rider-plat)) + (let ((s1-0 (-> this root-prim prim-core collide-as))) + (set! (-> this root-prim prim-core collide-as) (collide-kind)) (let ((s0-0 gp-0)) (set! sv-160 (method-of-object s0-0 fill-cache-for-shape!)) (let ((a1-3 (+ 8192.0 (vector-length s3-0))) @@ -432,7 +434,7 @@ (sv-160 s0-0 a1-3 a2-0) ) ) - (set! (-> obj root-prim prim-core collide-as) s1-0) + (set! (-> this root-prim prim-core collide-as) s1-0) ) (let ((s2-1 (new 'stack-no-clear 'vector))) (set! (-> s2-1 quad) (-> s3-0 quad)) @@ -468,7 +470,7 @@ (vector-! v1-18 (-> gp-0 trans) s4-0) (vector-float*! (-> gp-0 rider-last-move) v1-18 (-> *display* frames-per-second)) ) - (set! (-> gp-0 rider-time) (-> *display* base-frame-counter)) + (set-time! (-> gp-0 rider-time)) ) ) (let ((f0-4 (-> arg0 rider-delta-ry))) @@ -481,10 +483,10 @@ ) ) -(defmethod alloc-riders collide-shape ((obj collide-shape) (arg0 int)) - (if (-> obj riders) +(defmethod alloc-riders collide-shape ((this collide-shape) (arg0 int)) + (if (-> this riders) (format 0 "ERROR: colide-shape::alloc-riders is being called multiple times!~%") - (set! (-> obj riders) (new 'process 'collide-sticky-rider-group arg0)) + (set! (-> this riders) (new 'process 'collide-sticky-rider-group arg0)) ) (none) ) diff --git a/goal_src/jak1/engine/collide/collide-target-h.gc b/goal_src/jak1/engine/collide/collide-target-h.gc index 41a699660e..7816669739 100644 --- a/goal_src/jak1/engine/collide/collide-target-h.gc +++ b/goal_src/jak1/engine/collide/collide-target-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: collide-target-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; We believe that target's control-info may contain an array of these. ;; Each collide-history is a record of a single collision event. (deftype collide-history (structure) @@ -196,17 +198,17 @@ :flag-assert #x4100004a3c ) -(defmethod update! collide-history ((obj collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector)) +(defmethod update! collide-history ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector)) "Update the collide-history element." - (set! (-> obj intersect quad) (-> xs quad)) - (set! (-> obj transv quad) (-> transv quad)) - (set! (-> obj transv-out quad) (-> transv-out quad)) - (set! (-> obj trans quad) (-> cshape trans quad)) - (set! (-> obj local-normal quad) (-> cshape local-normal quad)) - (set! (-> obj surface-normal quad) (-> cshape surface-normal quad)) - (set! (-> obj time) (-> *display* base-frame-counter)) - (set! (-> obj status) (-> cshape status)) - (set! (-> obj reaction-flag) (-> cshape reaction-flag)) - (set! (-> obj pat) (-> cshape cur-pat)) - obj + (set! (-> this intersect quad) (-> xs quad)) + (set! (-> this transv quad) (-> transv quad)) + (set! (-> this transv-out quad) (-> transv-out quad)) + (set! (-> this trans quad) (-> cshape trans quad)) + (set! (-> this local-normal quad) (-> cshape local-normal quad)) + (set! (-> this surface-normal quad) (-> cshape surface-normal quad)) + (set-time! (-> this time)) + (set! (-> this status) (-> cshape status)) + (set! (-> this reaction-flag) (-> cshape reaction-flag)) + (set! (-> this pat) (-> cshape cur-pat)) + this ) diff --git a/goal_src/jak1/engine/collide/collide-touch-h.gc b/goal_src/jak1/engine/collide/collide-touch-h.gc index c738fc05d8..c402218982 100644 --- a/goal_src/jak1/engine/collide/collide-touch-h.gc +++ b/goal_src/jak1/engine/collide/collide-touch-h.gc @@ -66,11 +66,12 @@ ) ) -(defmethod init-list! touching-prims-entry-pool ((obj touching-prims-entry-pool)) + +(defmethod init-list! touching-prims-entry-pool ((this touching-prims-entry-pool)) "Initialize all entries to be not allocated and in a linked list." (let ((prev (the-as touching-prims-entry #f))) - (let ((current (the-as touching-prims-entry (-> obj nodes)))) - (set! (-> obj head) current) + (let ((current (the-as touching-prims-entry (-> this nodes)))) + (set! (-> this head) current) (countdown (a0-1 64) (set! (-> current prev) prev) (let ((next (&+ current 240))) @@ -88,18 +89,18 @@ (defmethod new touching-prims-entry-pool ((allocation symbol) (type-to-make type)) "Allocate and initialize a new touching-prims-entry-pool" - + ;; og:preserve-this ;; Note - the original code passed (-> type-to-make size) as an argument. ;; however, the new method of structure doesn't have this argument. ;; it uses the same value for the size so it doesn't really matter. - (let ((obj (the touching-prims-entry-pool ((method-of-type structure new) + (let ((this (the touching-prims-entry-pool ((method-of-type structure new) allocation type-to-make ;; (-> type-to-make size) see note ) ))) - (init-list! obj) - obj + (init-list! this) + this ) ) @@ -148,27 +149,27 @@ ) ) + (defmethod new touching-list ((allocation symbol) (type-to-make type)) "See note in touching-prims-entry-pool" - (let ((obj (the touching-list ((method-of-type structure new) + ;; og:preserve-this + (let ((this (the touching-list ((method-of-type structure new) allocation type-to-make ;; (-> type-to-make size) see note ) ))) - (set! (-> obj num-touching-shapes) 0) - (set! (-> obj resolve-u) 0) - obj + (set! (-> this num-touching-shapes) 0) + (set! (-> this resolve-u) 0) + this ) ) -(defmethod get-head touching-shapes-entry ((obj touching-shapes-entry)) - "Get the first pair of touching prims in a touching-shapes-entry" - (-> obj head) +(defmethod get-head touching-shapes-entry ((this touching-shapes-entry)) + (-> this head) ) -(defmethod get-next touching-shapes-entry ((obj touching-shapes-entry) (arg0 touching-prims-entry)) - "Get the next pair of touching prims." +(defmethod get-next touching-shapes-entry ((this touching-shapes-entry) (arg0 touching-prims-entry)) (-> arg0 next) ) diff --git a/goal_src/jak1/engine/collide/collide-touch.gc b/goal_src/jak1/engine/collide/collide-touch.gc index 2193faf1bb..3e91d2fbbb 100644 --- a/goal_src/jak1/engine/collide/collide-touch.gc +++ b/goal_src/jak1/engine/collide/collide-touch.gc @@ -24,10 +24,10 @@ ;; there's a global shared pool of entries that you can alloc and free from. -(defmethod get-free-node-count touching-prims-entry-pool ((obj touching-prims-entry-pool)) +(defmethod get-free-node-count touching-prims-entry-pool ((this touching-prims-entry-pool)) "Get the number of nodes that are not in use." (let ((v0-0 0)) - (let ((v1-0 (-> obj head))) + (let ((v1-0 (-> this head))) (while v1-0 (+! v0-0 1) (set! v1-0 (-> v1-0 next)) @@ -40,13 +40,13 @@ ) ) -(defmethod alloc-node touching-prims-entry-pool ((obj touching-prims-entry-pool)) +(defmethod alloc-node touching-prims-entry-pool ((this touching-prims-entry-pool)) "Allocate a node. Will return #f if there are none left." - (let ((gp-0 (-> obj head))) + (let ((gp-0 (-> this head))) (cond (gp-0 (let ((v1-0 (-> gp-0 next))) - (set! (-> obj head) v1-0) + (set! (-> this head) v1-0) (if v1-0 (set! (-> v1-0 prev) #f) ) @@ -63,14 +63,14 @@ ) ) -(defmethod free-node touching-prims-entry-pool ((obj touching-prims-entry-pool) (arg0 touching-prims-entry)) +(defmethod free-node touching-prims-entry-pool ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) "Free a node allocated with alloc-node" (when (-> arg0 allocated?) (set! (-> arg0 allocated?) #f) - (let ((v1-1 (-> obj head))) + (let ((v1-1 (-> this head))) (set! (-> arg0 next) v1-1) (set! (-> arg0 prev) #f) - (set! (-> obj head) arg0) + (set! (-> this head) arg0) (if v1-1 (set! (-> v1-1 prev) arg0) ) @@ -85,13 +85,13 @@ ;; a single shape entry represents a pair of shapes that collide. ;; There can be multiple colliding primitives. -(defmethod free-touching-prims-list touching-shapes-entry ((obj touching-shapes-entry)) +(defmethod free-touching-prims-list touching-shapes-entry ((this touching-shapes-entry)) "Return all nodes used by this touching-shapes-entry to the touching-prims-entry-pool" - (when (-> obj cshape1) - (set! (-> obj cshape1) #f) - (let ((gp-0 (-> obj head))) + (when (-> this cshape1) + (set! (-> this cshape1) #f) + (let ((gp-0 (-> this head))) (when gp-0 - (set! (-> obj head) #f) + (set! (-> this head) #f) (let ((s5-0 *touching-prims-entry-pool*)) (while gp-0 (let ((a1-0 gp-0)) @@ -112,28 +112,28 @@ ;; A touching list is a list up to TOUCHING_LIST_LENGTH pairs of colliding collide-shapes. -(defmethod free-all-prim-nodes touching-list ((obj touching-list)) +(defmethod free-all-prim-nodes touching-list ((this touching-list)) "Free all prim nodes used by all touching shapes in this touching-list." - (let ((s5-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (s4-0 (-> obj num-touching-shapes)) + (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) (free-touching-prims-list s5-0) (&+! s5-0 16) ) ) - (set! (-> obj num-touching-shapes) 0) - (set! (-> obj resolve-u) 0) + (set! (-> this num-touching-shapes) 0) + (set! (-> this resolve-u) 0) 0 (none) ) -(defmethod get-shapes-entry touching-list ((obj touching-list) (arg0 collide-shape) (arg1 collide-shape)) +(defmethod get-shapes-entry touching-list ((this touching-list) (arg0 collide-shape) (arg1 collide-shape)) "Get a touching-shapes-entry for the two shapes. If one exists, it will be returned. Otherwise a new one will be made." - (let ((v0-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) ;; the candidate + (let ((v0-0 (the-as touching-shapes-entry (-> this touching-shapes)))) ;; the candidate (let ((v1-0 (the-as touching-shapes-entry #f))) ;; a good one ;; loop over all touching shapes - (countdown (a3-0 (-> obj num-touching-shapes)) + (countdown (a3-0 (-> this num-touching-shapes)) (let ((t0-0 (-> v0-0 cshape1))) (set! v1-0 (cond @@ -162,13 +162,13 @@ ) (else ;; need to add a new one - (when (>= (-> obj num-touching-shapes) TOUCHING_LIST_LENGTH) + (when (>= (-> this num-touching-shapes) TOUCHING_LIST_LENGTH) ;; but there's no room! (format 0 "ERROR: touching-list::get-shapes-entry() failed!~%") (return (the-as touching-shapes-entry #f)) ) ;; enough room, increase the size - (+! (-> obj num-touching-shapes) 1) + (+! (-> this num-touching-shapes) 1) ) ) ) @@ -178,7 +178,7 @@ (set! (-> v0-0 cshape2) arg1) (set! (-> v0-0 head) #f) (set! (-> v0-0 resolve-u) 1) - (set! (-> obj resolve-u) 1) + (set! (-> this resolve-u) 1) (the-as touching-shapes-entry v0-0) ) ) @@ -211,7 +211,7 @@ -(defmethod add-touching-prims touching-list ((obj touching-list) +(defmethod add-touching-prims touching-list ((this touching-list) (arg0 collide-shape-prim) (arg1 collide-shape-prim) (arg2 float) @@ -230,7 +230,7 @@ (set! (-> gp-0 tri2) arg4) ;; first, grab the entry for the collide-shapes involved. - (let ((s2-0 (get-shapes-entry obj (-> arg0 cshape) (-> arg1 cshape)))) + (let ((s2-0 (get-shapes-entry this (-> arg0 cshape) (-> arg1 cshape)))) (when s2-0 ;; if we ask for a,b, that function might give us b,a. Detect that, and swap our collide shape prims. (when (= (-> s2-0 cshape1) (-> arg1 cshape)) @@ -307,7 +307,7 @@ ;; if we're <0, we started in collision (possible, if we didnt' converge on the last frame) ;; we should still add, but we don't need to bother with the "did we go far enough" checks. (set! (-> s2-0 resolve-u) 1) - (set! (-> obj resolve-u) 1) + (set! (-> this resolve-u) 1) ) (let ((v1-26 (-> s0-1 prim1)) (a1-4 (-> gp-0 tri1)) @@ -346,16 +346,16 @@ (none) ) -(defmethod update-from-step-size touching-list ((obj touching-list) (arg0 float)) +(defmethod update-from-step-size touching-list ((this touching-list) (arg0 float)) "Given that we actually will take a step size of arg0, remove things we won't actually hit." ;; only if we have some un-updated potential collision - (when (nonzero? (-> obj resolve-u)) + (when (nonzero? (-> this resolve-u)) ;; remember we did it - (set! (-> obj resolve-u) 0) + (set! (-> this resolve-u) 0) ;; loop through touching-shape-entries - (let ((s5-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (s4-0 (-> obj num-touching-shapes)) + (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) ;; only when the entry isn't done yet (when (nonzero? (-> s5-0 resolve-u)) ;; remember we did it @@ -424,7 +424,7 @@ (none) ) -(defmethod send-events-for-touching-shapes touching-list ((obj touching-list)) +(defmethod send-events-for-touching-shapes touching-list ((this touching-list)) "Send all events for touching shapes. Note that the order of event sending is basically random. (this could explain lava walks's unreliable behavior)" @@ -439,8 +439,8 @@ ; (* 2 TOUCHING_LIST_LENGTH) -> 64 (let ((handles (new 'stack-no-clear 'array 'handle 64))) - (let ((entry (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (i (-> obj num-touching-shapes)) + (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (i (-> this num-touching-shapes)) (let ((c1 (-> entry cshape1))) (when c1 (let ((c2 (-> entry cshape2))) @@ -460,8 +460,8 @@ ) ) - (let ((entry (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (i (-> obj num-touching-shapes)) + (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (i (-> this num-touching-shapes)) (let ((c1 (-> entry cshape1))) (when c1 (let ((c2 (-> entry cshape2))) @@ -510,11 +510,11 @@ (none) ) -(defmethod prims-touching? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape-moving) (arg1 uint)) +(defmethod prims-touching? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape-moving) (arg1 uint)) "In a pair of collide shapes, is a prim from the given collide shape with the given prim-id mask touching the other shape?" (cond - ((= (-> obj cshape1) arg0) - (let ((v1-1 (-> obj head))) + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) (while v1-1 (if (logtest? (-> v1-1 prim1 cprim prim-id) arg1) (return v1-1) @@ -523,8 +523,8 @@ ) ) ) - ((= (-> obj cshape2) arg0) - (let ((v1-4 (-> obj head))) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) (while v1-4 (if (logtest? (-> v1-4 prim2 cprim prim-id) arg1) (return v1-4) @@ -540,12 +540,12 @@ (the-as touching-prims-entry #f) ) -(defmethod prims-touching-action? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) +(defmethod prims-touching-action? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) "In a pair of collide shapes, find a pair of colliding prims where the prim from the given collide shape has at least one of the actions in arg1 and none of the actions in arg2." (cond - ((= (-> obj cshape1) arg0) - (let ((v1-1 (-> obj head))) + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) (while v1-1 (let ((a0-1 (-> v1-1 prim1 cprim))) (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) @@ -556,8 +556,8 @@ ) ) ) - ((= (-> obj cshape2) arg0) - (let ((v1-4 (-> obj head))) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) (while v1-4 (let ((a0-5 (-> v1-4 prim2 cprim))) (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) @@ -575,45 +575,45 @@ (the-as touching-prims-entry #f) ) -(defmethod get-touched-shape touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape)) +(defmethod get-touched-shape touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape)) "Get the other shape in a pair of shapes." (cond - ((= (-> obj cshape1) arg0) - (return (-> obj cshape2)) + ((= (-> this cshape1) arg0) + (return (-> this cshape2)) ) - ((= (-> obj cshape2) arg0) - (return (-> obj cshape1)) + ((= (-> this cshape2) arg0) + (return (-> this cshape1)) ) ) (the-as collide-shape #f) ) -(defmethod get-touched-prim touching-prims-entry ((obj touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry)) +(defmethod get-touched-prim touching-prims-entry ((this touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry)) "Get the primitive belonging to the collide shape that is touching." (cond ((= (-> arg1 cshape1) arg0) - (return (-> obj prim1 cprim)) + (return (-> this prim1 cprim)) ) ((= (-> arg1 cshape2) arg0) - (return (-> obj prim2 cprim)) + (return (-> this prim2 cprim)) ) ) (the-as collide-shape-prim #f) ) -(defmethod get-touched-tri touching-prims-entry ((obj touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-tri touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) "Get the triangle belonging to the the collide shape that is touching (if it has one, otherwise #f)" (let ((v0-0 (the-as collide-tri-result #f))) (cond ((= (-> arg1 cshape1) arg0) - (let ((v1-2 (-> obj prim1))) + (let ((v1-2 (-> this prim1))) (if (-> v1-2 has-tri?) (set! v0-0 (-> v1-2 tri)) ) ) ) ((= (-> arg1 cshape2) arg0) - (let ((v1-5 (-> obj prim2))) + (let ((v1-5 (-> this prim2))) (if (-> v1-5 has-tri?) (set! v0-0 (-> v1-5 tri)) ) @@ -624,12 +624,12 @@ ) ) -(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((obj touching-prims-entry) (arg0 vector)) +(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((this touching-prims-entry) (arg0 vector)) "This is a bit weird... But assuming the the bounding spheres overlap, draw a line between their centers, consider the line segment that is inside of both spheres, and get the midpoint of that." - (let* ((s4-0 (-> obj prim1 cprim)) - (s3-0 (-> obj prim2 cprim)) + (let* ((s4-0 (-> this prim1 cprim)) + (s3-0 (-> this prim2 cprim)) ;; compute the offset between the prim cores. (gp-1 (vector-! diff --git a/goal_src/jak1/engine/collide/pat-h.gc b/goal_src/jak1/engine/collide/pat-h.gc index 726264d848..858070ec8a 100644 --- a/goal_src/jak1/engine/collide/pat-h.gc +++ b/goal_src/jak1/engine/collide/pat-h.gc @@ -5,9 +5,6 @@ ;; name in dgo: pat-h ;; dgos: GAME, ENGINE -;; The "pat" system is used to store some data per triangle in collision meshes. -;; It packs all data into a 32-bit pat-surface type. - (defenum pat-material :type uint8 (stone) @@ -53,6 +50,11 @@ (melt) ) +;; DECOMP BEGINS + +;; The "pat" system is used to store some data per triangle in collision meshes. +;; It packs all data into a 32-bit pat-surface type. + (deftype pat-surface (uint32) ((skip uint8 :offset 0 :size 3) ;; overlay the "no" fields later on (mode pat-mode :offset 3 :size 3) ;; ground/wall/obstacle for collision system diff --git a/goal_src/jak1/engine/collide/surface-h.gc b/goal_src/jak1/engine/collide/surface-h.gc index 1f600eb1e1..b27325ef13 100644 --- a/goal_src/jak1/engine/collide/surface-h.gc +++ b/goal_src/jak1/engine/collide/surface-h.gc @@ -5,13 +5,6 @@ ;; name in dgo: surface-h ;; dgos: GAME, ENGINE -;; A "surface" contains parameters for how Jak will behave. -;; It can be used for different in-game surfaces (ice is slippery, grass isn't) -;; but is also used for most other changes to Jak's control -;; For example, when jumping, there's a separate "surface" for jumping that makes -;; Jak less responsive to changing directions. -;; Surfaces have flags and parameters that can be combined with other surfaces - (defenum surface-flags :bitfield #t :type uint32 @@ -44,45 +37,53 @@ (moving-ground) ;; unused, but would make sense if jak was on something moving ) +;; DECOMP BEGINS + +;; A "surface" contains parameters for how Jak will behave. +;; It can be used for different in-game surfaces (ice is slippery, grass isn't) +;; but is also used for most other changes to Jak's control +;; For example, when jumping, there's a separate "surface" for jumping that makes +;; Jak less responsive to changing directions. +;; Surfaces have flags and parameters that can be combined with other surfaces + ;; The "surface" defines how jak moves on the ground. It includes things like how fast he can go, ;; how slippery it is, and what functions should run when he hits it. ;; Note that "surface" can apply to weird things, like riding the zoomer or swimming as well. + (deftype surface (basic) - ((name symbol :offset-assert 4) - ;; data went here - (turnv float :offset-assert 8) - (turnvv float :offset-assert 12) - (tiltv float :offset-assert 16) - (tiltvv float :offset-assert 20) - (transv-max float :offset-assert 24) - (target-speed float :offset-assert 28) - (seek0 float :offset-assert 32) - (seek90 float :offset-assert 36) - (seek180 float :offset-assert 40) - (fric float :offset-assert 44) - (nonlin-fric-dist float :offset-assert 48) - (slip-factor float :offset-assert 52) - (slide-factor float :offset-assert 56) - (slope-up-factor float :offset-assert 60) - (slope-down-factor float :offset-assert 64) - (slope-slip-angle float :offset-assert 68) - (impact-fric float :offset-assert 72) - (bend-factor float :offset-assert 76) - (bend-speed float :offset-assert 80) - (alignv float :offset-assert 84) - (slope-up-traction float :offset-assert 88) - (align-speed float :offset-assert 92) - ;; hook went here - (active-hook (function none) :offset 128) - (touch-hook (function none) :offset-assert 132) - (impact-hook function :offset-assert 136) + ((name symbol :offset-assert 4) + (turnv float :offset-assert 8) + (turnvv float :offset-assert 12) + (tiltv float :offset-assert 16) + (tiltvv float :offset-assert 20) + (transv-max float :offset-assert 24) + (target-speed float :offset-assert 28) + (seek0 float :offset-assert 32) + (seek90 float :offset-assert 36) + (seek180 float :offset-assert 40) + (fric float :offset-assert 44) + (nonlin-fric-dist float :offset-assert 48) + (slip-factor float :offset-assert 52) + (slide-factor float :offset-assert 56) + (slope-up-factor float :offset-assert 60) + (slope-down-factor float :offset-assert 64) + (slope-slip-angle float :offset-assert 68) + (impact-fric float :offset-assert 72) + (bend-factor float :offset-assert 76) + (bend-speed float :offset-assert 80) + (alignv float :offset-assert 84) + (slope-up-traction float :offset-assert 88) + (align-speed float :offset-assert 92) + (active-hook (function none) :offset 128) + (touch-hook (function none) :offset-assert 132) + (impact-hook function :offset-assert 136) (mult-hook (function surface surface surface int none) :offset-assert 140) ;; dataw went here - (mode symbol :offset-assert 144) - (flags surface-flags :offset-assert 148) - (data float 30 :offset 8) - (hook function 4 :offset 128) - (dataw uint32 2 :offset 144) + (mode symbol :offset-assert 144) + (flags surface-flags :offset-assert 148) + (data float 30 :offset 8) + (hook function 4 :offset 128) + (dataw uint32 2 :offset 144) ) :method-count-assert 9 :size-assert #x98 @@ -106,20 +107,19 @@ ) ) -(defmethod print surface ((obj surface)) +(defmethod print surface ((this surface)) ;; seems this format string is wrong. (format #t "# obj turnv) - (-> obj turnvv) - (-> obj tiltv) - (-> obj tiltvv) - (-> obj transv-max) - 0 + (-> this turnv) + (-> this turnvv) + (-> this tiltv) + (-> this tiltvv) + (-> this transv-max) ) - (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> obj target-speed) (-> obj seek0) (-> obj seek90) obj) - obj + (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> this target-speed) (-> this seek0) (-> this seek90) this) + this ) (defun surface-interp! ((dst surface) (src0 surface) (src1 surface) (amount float)) @@ -152,7 +152,6 @@ (dotimes (v1-6 2) (set! (-> dst dataw v1-6) (-> src1 dataw v1-6)) ) - dst ) @@ -301,6 +300,7 @@ ) ) (set! (-> a0-3 mult-hook) surface-clamp-speed) + ;; og:preserve-this (define *duck-mods* a0-3) ) @@ -676,6 +676,7 @@ ) ) (set! (-> a0-4 mult-hook) surface-clamp-speed) + ;; og:preserve-this (define *uppercut-jump-mods* a0-4) ) @@ -811,6 +812,7 @@ ) ) (set! (-> a0-5 mult-hook) surface-clamp-speed) + ;; og:preserve-this (define *flop-land-mods* a0-5) ) @@ -926,18 +928,21 @@ (let ((a0-7 (copy *walk-mods* 'global))) (set! (-> a0-7 name) 'pole) (set! (-> a0-7 flags) (surface-flags)) + ;; og:preserve-this (define *pole-mods* a0-7) ) (let ((a0-9 (copy *walk-mods* 'global))) (set! (-> a0-9 name) 'grab) (set! (-> a0-9 flags) (surface-flags)) + ;; og:preserve-this (define *grab-mods* a0-9) ) (let ((a0-11 (copy *walk-mods* 'global))) (set! (-> a0-11 name) 'edge-grab) (set! (-> a0-11 flags) (surface-flags)) + ;; og:preserve-this (define *edge-grab-mods* a0-11) ) @@ -1018,6 +1023,7 @@ ) ) ) + ;; og:preserve-this (define *edge-surface* v1-42) (set! (-> v1-42 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-42 touch-hook) nothing) @@ -1049,6 +1055,7 @@ ) ) ) + ;; og:preserve-this (define *wade-surface* v1-43) (set! (-> v1-43 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-43 touch-hook) nothing) @@ -1080,6 +1087,7 @@ ) ) ) + ;; og:preserve-this (define *slope-surface* v1-44) (set! (-> v1-44 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-44 touch-hook) nothing) @@ -1111,6 +1119,7 @@ ) ) ) + ;; og:preserve-this (define *quicksand-surface* v1-45) (set! (-> v1-45 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-45 touch-hook) nothing) @@ -1142,6 +1151,7 @@ ) ) ) + ;; og:preserve-this (define *tar-surface* v1-46) (set! (-> v1-46 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-46 touch-hook) nothing) @@ -1171,6 +1181,7 @@ ) ) ) + ;; og:preserve-this (define *grass-surface* v1-47) (set! (-> v1-47 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-47 touch-hook) nothing) @@ -1200,6 +1211,7 @@ ) ) ) + ;; og:preserve-this (define *ice-surface* v1-48) (set! (-> v1-48 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-48 touch-hook) nothing) @@ -1230,6 +1242,7 @@ ) ) ) + ;; og:preserve-this (define *tread-surface* v1-49) (set! (-> v1-49 mult-hook) (the-as (function surface surface surface int none) nothing)) (set! (-> v1-49 touch-hook) nothing) @@ -1237,6 +1250,8 @@ ) (define *standard-ground-surface* *stone-surface*) + (define *swim-surface* *stone-surface*) +;; og:preserve-this (define-extern *race-track-surface* surface) diff --git a/goal_src/jak1/engine/common-obs/babak.gc b/goal_src/jak1/engine/common-obs/babak.gc index d34430b15d..ad2ea9c386 100644 --- a/goal_src/jak1/engine/common-obs/babak.gc +++ b/goal_src/jak1/engine/common-obs/babak.gc @@ -239,8 +239,8 @@ ) ) -(defmethod initialize-collision babak ((obj babak)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision babak ((this babak)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -280,34 +280,34 @@ (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod nav-enemy-method-48 babak ((obj babak)) - (initialize-skeleton obj *babak-sg* '()) - (init-defaults! obj *babak-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 babak ((this babak)) + (initialize-skeleton this *babak-sg* '()) + (init-defaults! this *babak-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) -(defmethod nav-enemy-method-59 babak ((obj babak)) +(defmethod nav-enemy-method-59 babak ((this babak)) (cond - ((and (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (logtest? (-> obj enemy-info options) (fact-options has-power-cell)) + ((and (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (logtest? (-> this enemy-info options) (fact-options has-power-cell)) ) - (go (method-of-object obj nav-enemy-fuel-cell)) + (go (method-of-object this nav-enemy-fuel-cell)) ) - ((logtest? (-> obj enemy-info options) (fact-options fop5)) - (go (method-of-object obj nav-enemy-wait-for-cue)) + ((logtest? (-> this enemy-info options) (fact-options fop5)) + (go (method-of-object this nav-enemy-wait-for-cue)) ) (else - (go (method-of-object obj nav-enemy-idle)) + (go (method-of-object this nav-enemy-idle)) ) ) 0 diff --git a/goal_src/jak1/engine/common-obs/basebutton.gc b/goal_src/jak1/engine/common-obs/basebutton.gc index 3015cde67c..8b2d3bd432 100644 --- a/goal_src/jak1/engine/common-obs/basebutton.gc +++ b/goal_src/jak1/engine/common-obs/basebutton.gc @@ -50,15 +50,15 @@ :bounds (static-spherem 0 0 0 3) ) -(defmethod move-to-vec-or-quat! basebutton ((obj basebutton) (arg0 vector) (arg1 quaternion)) - (set! (-> obj move-to?) #t) +(defmethod move-to-vec-or-quat! basebutton ((this basebutton) (arg0 vector) (arg1 quaternion)) + (set! (-> this move-to?) #t) (if arg0 - (set! (-> obj move-to-pos quad) (-> arg0 quad)) - (set! (-> obj move-to-pos quad) (-> obj root-override trans quad)) + (set! (-> this move-to-pos quad) (-> arg0 quad)) + (set! (-> this move-to-pos quad) (-> this root-override trans quad)) ) (if arg1 - (quaternion-copy! (-> obj move-to-quat) arg1) - (quaternion-copy! (-> obj move-to-quat) (-> obj root-override quat)) + (quaternion-copy! (-> this move-to-quat) arg1) + (quaternion-copy! (-> this move-to-quat) (-> this root-override quat)) ) ) @@ -171,13 +171,13 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (cond ((= (-> self timeout) 0.0) (anim-loop) ) (else - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self timeout)))) + (until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout)))) (suspend) ) (basebutton-method-29 self (-> self event-going-up) (-> self notify-actor)) @@ -232,23 +232,23 @@ ) ) -(defmethod press! basebutton ((obj basebutton) (arg0 symbol)) - (set! (-> obj down?) arg0) +(defmethod press! basebutton ((this basebutton) (arg0 symbol)) + (set! (-> this down?) arg0) (cond (arg0 - (if (not (-> obj spawned-by-other?)) - (process-entity-status! obj (entity-perm-status complete) #t) + (if (not (-> this spawned-by-other?)) + (process-entity-status! this (entity-perm-status complete) #t) ) ) (else - (if (not (-> obj spawned-by-other?)) - (process-entity-status! obj (entity-perm-status complete) #f) + (if (not (-> this spawned-by-other?)) + (process-entity-status! this (entity-perm-status complete) #f) ) ) ) ) -(defmethod basebutton-method-29 basebutton ((obj basebutton) (arg0 symbol) (arg1 entity)) +(defmethod basebutton-method-29 basebutton ((this basebutton) (arg0 symbol) (arg1 entity)) (with-pp (when arg0 (cond @@ -268,8 +268,8 @@ ) ) (else - (if (nonzero? (-> obj link)) - (send-to-all (-> obj link) arg0) + (if (nonzero? (-> this link)) + (send-to-all (-> this link) arg0) ) ) ) @@ -278,62 +278,62 @@ ) ) -(defmethod reset! basebutton ((obj basebutton)) - (set! (-> obj down?) #f) - (set! (-> obj spawned-by-other?) #t) - (set! (-> obj move-to?) #f) - (set! (-> obj notify-actor) #f) - (set! (-> obj timeout) 0.0) - (set! (-> obj event-going-down) #f) - (set! (-> obj event-down) #f) - (set! (-> obj event-going-up) #f) - (set! (-> obj event-up) #f) - (set! (-> obj anim-speed) 1.0) +(defmethod reset! basebutton ((this basebutton)) + (set! (-> this down?) #f) + (set! (-> this spawned-by-other?) #t) + (set! (-> this move-to?) #f) + (set! (-> this notify-actor) #f) + (set! (-> this timeout) 0.0) + (set! (-> this event-going-down) #f) + (set! (-> this event-down) #f) + (set! (-> this event-going-up) #f) + (set! (-> this event-up) #f) + (set! (-> this anim-speed) 1.0) ) -(defmethod arm-trigger-event! basebutton ((obj basebutton)) +(defmethod arm-trigger-event! basebutton ((this basebutton)) (let ((v0-0 'trigger)) - (set! (-> obj event-going-down) v0-0) + (set! (-> this event-going-down) v0-0) v0-0 ) ) -(defmethod basebutton-method-26 basebutton ((obj basebutton)) - (initialize-skeleton obj *generic-button-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) +(defmethod basebutton-method-26 basebutton ((this basebutton)) + (initialize-skeleton this *generic-button-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) (cond - ((-> obj down?) - (let ((s5-0 (-> obj skel root-channel 0))) + ((-> this down?) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) ) (else - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) ) ) - (set! (-> obj anim-speed) 2.0) - (update-transforms! (-> obj root-override)) + (set! (-> this anim-speed) 2.0) + (update-transforms! (-> this root-override)) (ja-post) (none) ) -(defmethod basebutton-method-27 basebutton ((obj basebutton)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod basebutton-method-27 basebutton ((this basebutton)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -367,42 +367,42 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) s5-0 ) ) -(defmethod init-from-entity! basebutton ((obj basebutton) (arg0 entity-actor)) - (reset! obj) - (set! (-> obj spawned-by-other?) #f) - (set! (-> obj button-id) -1) - (let ((v1-4 (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 -1)))) +(defmethod init-from-entity! basebutton ((this basebutton) (arg0 entity-actor)) + (reset! this) + (set! (-> this spawned-by-other?) #f) + (set! (-> this button-id) -1) + (let ((v1-4 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1)))) (if (>= (the-as int v1-4) 0) - (set! (-> obj button-id) (the-as int v1-4)) + (set! (-> this button-id) (the-as int v1-4)) ) ) (when (or (res-lump-struct arg0 'next-actor structure) (res-lump-struct arg0 'prev-actor structure)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (if (< (-> obj button-id) 0) - (set! (-> obj button-id) (actor-count-before (-> obj link))) + (set! (-> this link) (new 'process 'actor-link-info this)) + (if (< (-> this button-id) 0) + (set! (-> this button-id) (actor-count-before (-> this link))) ) ) - (basebutton-method-27 obj) - (process-drawable-from-entity! obj arg0) + (basebutton-method-27 this) + (process-drawable-from-entity! this arg0) (let ((v1-16 #f)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (set! v1-16 #t) ) - (set! (-> obj down?) v1-16) + (set! (-> this down?) v1-16) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj timeout) (res-lump-float arg0 'timeout)) - (if (not (-> obj spawned-by-other?)) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this timeout) (res-lump-float arg0 'timeout)) + (if (not (-> this spawned-by-other?)) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) ) - (arm-trigger-event! obj) - (basebutton-method-26 obj) - (go (method-of-object obj basebutton-startup)) + (arm-trigger-event! this) + (basebutton-method-26 this) + (go (method-of-object this basebutton-startup)) (none) ) @@ -460,7 +460,7 @@ (send-event *camera* 'joystick 0.0 0.0) ) :code (behavior ((arg0 int) (arg1 level)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (when (not arg1) (process-release? *target*) (go-virtual idle) @@ -495,7 +495,7 @@ (else (load-state-want-levels (-> self level) (-> arg1 load-name)) (while (or (not (member (level-status *level* (-> arg1 load-name)) '(loaded active))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (not (time-elapsed? (-> self state-time) (seconds 2))) ) (suspend) ) @@ -548,7 +548,7 @@ ) ) :enter (behavior ((arg0 vector) (arg1 vector)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *warp-jump-mods*) (set! (-> self control unknown-vector102 quad) (-> arg0 quad)) @@ -601,7 +601,7 @@ ) ) (clear-collide-with-as (-> self control)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self trans-hook) (lambda :behavior target () @@ -627,9 +627,9 @@ (set! (-> gp-2 y) 0.0) (send-event *target* 'sidekick #f) (when (and (or (< (vector-dot gp-2 (-> self control transv)) 0.0) (-> self control unknown-spoolanim00)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) ) - (vector-seek! (-> self draw color-mult) (new 'static 'vector) (* 2.0 (-> *display* seconds-per-frame))) + (vector-seek! (-> self draw color-mult) (new 'static 'vector) (* 2.0 (seconds-per-frame))) (set! (-> self control transv x) (* 0.95 (-> self control transv x))) (set! (-> self control transv z) (* 0.95 (-> self control transv z))) (when (not (-> self control unknown-spoolanim00)) diff --git a/goal_src/jak1/engine/common-obs/baseplat.gc b/goal_src/jak1/engine/common-obs/baseplat.gc index 362f6644d3..097b50763f 100644 --- a/goal_src/jak1/engine/common-obs/baseplat.gc +++ b/goal_src/jak1/engine/common-obs/baseplat.gc @@ -66,19 +66,19 @@ ) -(defmethod baseplat-method-21 baseplat ((obj baseplat)) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj basetrans quad) (-> obj root-override trans quad)) - (set! (-> obj bouncing) #f) +(defmethod baseplat-method-21 baseplat ((this baseplat)) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this basetrans quad) (-> this root-override trans quad)) + (set! (-> this bouncing) #f) 0 (none) ) -(defmethod baseplat-method-22 baseplat ((obj baseplat)) - (activate! (-> obj smush) -1.0 60 150 1.0 1.0) - (set! (-> obj bouncing) #t) - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) +(defmethod baseplat-method-22 baseplat ((this baseplat)) + (activate! (-> this smush) -1.0 60 150 1.0 1.0) + (set! (-> this bouncing) #t) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -127,13 +127,13 @@ (none) ) -(defmethod baseplat-method-25 baseplat ((obj baseplat)) +(defmethod baseplat-method-25 baseplat ((this baseplat)) (the-as sparticle-launch-group 0) ) -(defmethod baseplat-method-20 baseplat ((obj baseplat)) - (if (nonzero? (-> obj part)) - (spawn (-> obj part) (-> obj root-override trans)) +(defmethod baseplat-method-20 baseplat ((this baseplat)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root-override trans)) ) (none) ) @@ -258,7 +258,7 @@ eco-door-event-handler :virtual #t :event eco-door-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status complete) #t) (clear-collide-with-as (-> self root-override)) (ja :num-func num-func-identity :frame-num max) @@ -312,19 +312,19 @@ eco-door-event-handler :post transform-post ) -(defmethod eco-door-method-26 eco-door ((obj eco-door)) - (when (-> obj state-actor) - (if (logtest? (-> obj state-actor extra perm status) (entity-perm-status complete)) - (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf01))) - (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf00))) +(defmethod eco-door-method-26 eco-door ((this eco-door)) + (when (-> this state-actor) + (if (logtest? (-> this state-actor extra perm status) (entity-perm-status complete)) + (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf01))) + (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf00))) ) ) 0 (none) ) -(defmethod eco-door-method-24 eco-door ((obj eco-door)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod eco-door-method-24 eco-door ((this eco-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -336,47 +336,47 @@ eco-door-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 eco-door ((obj eco-door)) +(defmethod eco-door-method-25 eco-door ((this eco-door)) 0 (none) ) -(defmethod init-from-entity! eco-door ((obj eco-door) (arg0 entity-actor)) - (eco-door-method-24 obj) - (process-drawable-from-entity! obj arg0) - (let ((f0-0 (res-lump-float (-> obj entity) 'scale :default 1.0))) - (set-vector! (-> obj root-override scale) f0-0 f0-0 f0-0 1.0) +(defmethod init-from-entity! eco-door ((this eco-door) (arg0 entity-actor)) + (eco-door-method-24 this) + (process-drawable-from-entity! this arg0) + (let ((f0-0 (res-lump-float (-> this entity) 'scale :default 1.0))) + (set-vector! (-> this root-override scale) f0-0 f0-0 f0-0 1.0) ) - (set! (-> obj open-distance) 32768.0) - (set! (-> obj close-distance) 49152.0) - (set! (-> obj speed) 1.0) - (set! (-> obj state-actor) #f) + (set! (-> this open-distance) 32768.0) + (set! (-> this close-distance) 49152.0) + (set! (-> this speed) 1.0) + (set! (-> this state-actor) #f) (let ((v1-5 (entity-actor-lookup arg0 'state-actor 0))) (if v1-5 - (set! (-> obj state-actor) v1-5) + (set! (-> this state-actor) v1-5) ) ) - (set! (-> obj locked) #f) - (set! (-> obj flags) (res-lump-value arg0 'flags eco-door-flags)) - (eco-door-method-26 obj) - (set! (-> obj auto-close) (logtest? (-> obj flags) (eco-door-flags auto-close))) - (set! (-> obj one-way) (logtest? (-> obj flags) (eco-door-flags one-way))) - (vector-z-quaternion! (-> obj out-dir) (-> obj root-override quat)) - (set! (-> obj out-dir w) (- (vector-dot (-> obj out-dir) (-> obj root-override trans)))) - (update-transforms! (-> obj root-override)) - (eco-door-method-25 obj) - (if (and (not (-> obj auto-close)) - (-> obj entity) - (logtest? (-> obj entity extra perm status) (entity-perm-status complete)) + (set! (-> this locked) #f) + (set! (-> this flags) (res-lump-value arg0 'flags eco-door-flags)) + (eco-door-method-26 this) + (set! (-> this auto-close) (logtest? (-> this flags) (eco-door-flags auto-close))) + (set! (-> this one-way) (logtest? (-> this flags) (eco-door-flags one-way))) + (vector-z-quaternion! (-> this out-dir) (-> this root-override quat)) + (set! (-> this out-dir w) (- (vector-dot (-> this out-dir) (-> this root-override trans)))) + (update-transforms! (-> this root-override)) + (eco-door-method-25 this) + (if (and (not (-> this auto-close)) + (-> this entity) + (logtest? (-> this entity extra perm status) (entity-perm-status complete)) ) - (go (method-of-object obj door-open)) - (go (method-of-object obj door-closed)) + (go (method-of-object this door-open)) + (go (method-of-object this door-closed)) ) (none) ) diff --git a/goal_src/jak1/engine/common-obs/collectables-part.gc b/goal_src/jak1/engine/common-obs/collectables-part.gc index adb3708878..9ac81ddd9c 100644 --- a/goal_src/jak1/engine/common-obs/collectables-part.gc +++ b/goal_src/jak1/engine/common-obs/collectables-part.gc @@ -58,7 +58,7 @@ (-> arg0 root trans) (-> arg0 offset) a2-0 - (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> arg0 start-time)))) + (* 0.006666667 (the float (- (current-time) (-> arg0 start-time)))) ) ) ) diff --git a/goal_src/jak1/engine/common-obs/collectables.gc b/goal_src/jak1/engine/common-obs/collectables.gc index be91f0b5f7..73d0562f02 100644 --- a/goal_src/jak1/engine/common-obs/collectables.gc +++ b/goal_src/jak1/engine/common-obs/collectables.gc @@ -53,45 +53,47 @@ ) -(defmethod initialize-params collectable ((obj collectable) (arg0 time-frame) (arg1 float)) - (logclear! (-> obj mask) (process-mask crate enemy platform ambient)) - (logior! (-> obj mask) (process-mask collectable)) - (set! (-> obj flags) (collectable-flags can-collect ignore-blue)) - (set! (-> obj bob-amount) arg1) - (set! (-> obj bob-offset) (+ (the-as int (-> obj root-override trans x)) - (the-as int (-> obj root-override trans y)) - (the-as int (-> obj root-override trans z)) - ) +(defmethod initialize-params collectable ((this collectable) (arg0 time-frame) (arg1 float)) + (logclear! (-> this mask) (process-mask crate enemy platform ambient)) + (logior! (-> this mask) (process-mask collectable)) + (set! (-> this flags) (collectable-flags can-collect ignore-blue)) + (set! (-> this bob-amount) arg1) + (set! (-> this bob-offset) (+ (the-as int (-> this root-override trans x)) + (the-as int (-> this root-override trans y)) + (the-as int (-> this root-override trans z)) + ) ) (cond - ((or (= (vector-length (-> obj root-override transv)) 0.0) - (logtest? (-> obj fact options) (fact-options instant-collect)) + ((or (= (vector-length (-> this root-override transv)) 0.0) + (logtest? (-> this fact options) (fact-options instant-collect)) ) - (vector-reset! (-> obj root-override transv)) + (vector-reset! (-> this root-override transv)) ) (else - (logior! (-> obj flags) (collectable-flags trans)) - (logclear! (-> obj flags) (collectable-flags can-collect)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj bob-amount) 0.0) + (logior! (-> this flags) (collectable-flags trans)) + (logclear! (-> this flags) (collectable-flags can-collect)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this bob-amount) 0.0) ) ) (when (and (> arg0 0) #t) - (logior! (-> obj flags) (collectable-flags fade)) - (set! (-> obj fadeout-timeout) arg0) + (logior! (-> this flags) (collectable-flags fade)) + (set! (-> this fadeout-timeout) arg0) ) - (set! (-> obj collect-timeout) (seconds 0.33)) - (set! (-> obj birth-time) (-> *display* base-frame-counter)) - (set! (-> obj base quad) (-> obj root-override trans quad)) - (set! (-> obj old-base quad) (-> obj root-override trans quad)) - (set! (-> obj pickup-handle) (the-as handle #f)) - (case (-> obj fact pickup-type) + (set! (-> this collect-timeout) (seconds 0.33)) + (set-time! (-> this birth-time)) + (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this old-base quad) (-> this root-override trans quad)) + (set! (-> this pickup-handle) (the-as handle #f)) + (case (-> this fact pickup-type) (((pickup-type eco-pill) (pickup-type eco-green) (pickup-type money) (pickup-type eco-blue)) - (logclear! (-> obj flags) (collectable-flags ignore-blue)) + (logclear! (-> this flags) (collectable-flags ignore-blue)) ) ) - (if (logtest? (-> obj fact options) (fact-options large)) - (set! (-> obj root-override root-prim local-sphere w) (* 2.5 (-> obj root-override root-prim local-sphere w))) + (if (logtest? (-> this fact options) (fact-options large)) + (set! (-> this root-override root-prim local-sphere w) + (* 2.5 (-> this root-override root-prim local-sphere w)) + ) ) (none) ) @@ -127,12 +129,12 @@ ) -(defmethod initialize eco-collectable ((obj eco-collectable)) - (stack-size-set! (-> obj main-thread) 192) ;; og:preserve-this hack increased from 128 - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify-parent) #f) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize eco-collectable ((this eco-collectable)) + (stack-size-set! (-> this main-thread) 192) ;; og:preserve-this hack increased from 128 + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify-parent) #f) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -146,61 +148,61 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) - (if (logtest? (fact-options respawn) (-> obj fact options)) - (set! (-> obj respawn-delay) (-> obj fact fade-time)) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + (if (logtest? (fact-options respawn) (-> this fact options)) + (set! (-> this respawn-delay) (-> this fact fade-time)) ) - obj + this ) -(defmethod initialize-effect eco-collectable ((obj eco-collectable) (arg0 pickup-type)) - (set! (-> obj fact pickup-type) arg0) - (case (-> obj fact pickup-type) +(defmethod initialize-effect eco-collectable ((this eco-collectable) (arg0 pickup-type)) + (set! (-> this fact pickup-type) arg0) + (case (-> this fact pickup-type) (((pickup-type eco-blue) (pickup-type eco-red) (pickup-type eco-green) (pickup-type eco-yellow)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) ) ) - (set! (-> obj sound-name) #f) + (set! (-> this sound-name) #f) (case arg0 (((pickup-type eco-yellow)) - (set! (-> obj eco-effect) (-> *part-group-id-table* 56)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 68)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 57)) - (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (static-sound-spec "yel-eco-idle" :fo-max 15)) + (set! (-> this eco-effect) (-> *part-group-id-table* 56)) + (set! (-> this collect-effect) (-> *part-group-id-table* 68)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 57)) + (set! (-> this collect-effect-time) (seconds 0.5)) + (set! (-> this sound-name) (static-sound-spec "yel-eco-idle" :fo-max 15)) ) (((pickup-type eco-red)) - (set! (-> obj eco-effect) (-> *part-group-id-table* 48)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 69)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 49)) - (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (static-sound-spec "red-eco-idle" :fo-max 15)) + (set! (-> this eco-effect) (-> *part-group-id-table* 48)) + (set! (-> this collect-effect) (-> *part-group-id-table* 69)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 49)) + (set! (-> this collect-effect-time) (seconds 0.5)) + (set! (-> this sound-name) (static-sound-spec "red-eco-idle" :fo-max 15)) ) (((pickup-type eco-blue)) - (set! (-> obj eco-effect) (-> *part-group-id-table* 42)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 67)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 43)) - (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (static-sound-spec "blue-eco-idle" :fo-max 15)) + (set! (-> this eco-effect) (-> *part-group-id-table* 42)) + (set! (-> this collect-effect) (-> *part-group-id-table* 67)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 43)) + (set! (-> this collect-effect-time) (seconds 0.5)) + (set! (-> this sound-name) (static-sound-spec "blue-eco-idle" :fo-max 15)) ) (((pickup-type eco-green)) - (set! (-> obj eco-effect) (-> *part-group-id-table* 58)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 66)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 61)) - (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (static-sound-spec "green-eco-idle" :fo-max 15)) + (set! (-> this eco-effect) (-> *part-group-id-table* 58)) + (set! (-> this collect-effect) (-> *part-group-id-table* 66)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 61)) + (set! (-> this collect-effect-time) (seconds 0.5)) + (set! (-> this sound-name) (static-sound-spec "green-eco-idle" :fo-max 15)) ) (((pickup-type eco-pill)) - (set! (-> obj eco-effect) (-> *part-group-id-table* 59)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 60)) - (set! (-> obj collect-effect-time) (seconds 0.5)) + (set! (-> this eco-effect) (-> *part-group-id-table* 59)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 60)) + (set! (-> this collect-effect-time) (seconds 0.5)) ) ) - (set! (-> obj part) (create-launch-control (-> obj eco-effect) obj)) - (if (-> obj sound-name) - (set! (-> obj sound) (new 'process 'ambient-sound (-> obj sound-name) (-> obj root-override trans))) + (set! (-> this part) (create-launch-control (-> this eco-effect) this)) + (if (-> this sound-name) + (set! (-> this sound) (new 'process 'ambient-sound (-> this sound-name) (-> this root-override trans))) ) (none) ) @@ -245,21 +247,21 @@ (none) ) -(defmethod initialize-eco eco-collectable ((obj eco-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) - (set! (-> obj pickup-amount) arg2) - (set! (-> obj pickup-type) arg1) - (initialize obj) - (set! (-> obj root-override trans quad) (-> arg0 extra trans quad)) - (initialize-effect obj (-> obj fact pickup-type)) - (initialize-params obj 0 (the-as float 1024.0)) - (update-transforms! (-> obj root-override)) - (if (logtest? (fact-options eco-blocked) (-> obj fact options)) - (go (method-of-object obj blocked)) +(defmethod initialize-eco eco-collectable ((this eco-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> this pickup-amount) arg2) + (set! (-> this pickup-type) arg1) + (initialize this) + (set! (-> this root-override trans quad) (-> arg0 extra trans quad)) + (initialize-effect this (-> this fact pickup-type)) + (initialize-params this 0 (the-as float 1024.0)) + (update-transforms! (-> this root-override)) + (if (logtest? (fact-options eco-blocked) (-> this fact options)) + (go (method-of-object this blocked)) ) - (go (method-of-object obj wait)) + (go (method-of-object this wait)) ) -(defmethod animate eco-collectable ((obj eco-collectable)) +(defmethod animate eco-collectable ((this eco-collectable)) 0 (none) ) @@ -348,19 +350,16 @@ ) (logior! (-> self flags) (collectable-flags suck)) (if (= (-> self speed w) 0.0) - (set! (-> self suck-time) (-> *display* base-frame-counter)) + (set-time! (-> self suck-time)) ) - (+! (-> self speed w) (* 163840.0 (-> *display* seconds-per-frame))) - (+! (-> self speed y) (* 291271.12 (-> *display* seconds-per-frame))) + (+! (-> self speed w) (* 163840.0 (seconds-per-frame))) + (+! (-> self speed y) (* 291271.12 (seconds-per-frame))) (set! (-> self speed y) (fmin (fmin 291271.12 (-> self speed y)) (-> self speed y))) (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> self base) (the-as vector gp-2)))) - (vector-normalize! - s5-2 - (fmax 0.0 (- (vector-length s5-2) (* (-> self speed w) (-> *display* seconds-per-frame)))) - ) - (vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (-> *display* seconds-per-frame))) + (vector-normalize! s5-2 (fmax 0.0 (- (vector-length s5-2) (* (-> self speed w) (seconds-per-frame))))) + (vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (seconds-per-frame))) (set! (-> self suck-y-offset) - (* 2048.0 (sin (* 873.81335 (the float (mod (- (-> *display* base-frame-counter) (-> self suck-time)) 75))))) + (* 2048.0 (sin (* 873.81335 (the float (mod (- (current-time) (-> self suck-time)) 75))))) ) (vector+! (-> self base) (the-as vector gp-2) s5-2) ) @@ -410,9 +409,9 @@ (the-as float 300.0) (the-as float -2.2755556) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (let ((f0-2 (the float (- (-> *display* base-frame-counter) (-> self state-time))))) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) + (let ((f0-2 (the float (- (current-time) (-> self state-time))))) (eval-position! gp-1 f0-2 (-> self root-override trans)) ) (transform-post) @@ -442,7 +441,7 @@ (local-vars (v0-3 object)) (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) (!= (-> self next-state name) 'pickup) (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) ) @@ -456,7 +455,7 @@ (!= (-> self next-state name) 'pickup) (begin (check-blue-suck (the-as process-drawable proc)) #t) (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual notice-blue (process->handle proc)) @@ -508,7 +507,7 @@ ((= message 'fade) (logior! (-> self flags) (collectable-flags fade)) (set! (-> self fadeout-timeout) (seconds 0.1)) - (set! v0-3 (-> *display* base-frame-counter)) + (set! v0-3 (current-time)) (set! (-> self birth-time) (the-as time-frame v0-3)) v0-3 ) @@ -572,12 +571,9 @@ (s5-0 (-> self root-override root-prim prim-core)) ) (when (and (logtest? (-> self flags) (collectable-flags fade)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self fadeout-timeout)) + (time-elapsed? (-> self birth-time) (-> self fadeout-timeout)) ) - (let ((v1-10 - (- (seconds 1) (- (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self fadeout-timeout))) - ) - ) + (let ((v1-10 (- (seconds 1) (- (- (current-time) (-> self birth-time)) (-> self fadeout-timeout))))) (cond ((< v1-10 0) (process-entity-status! self (entity-perm-status dead) #t) @@ -608,7 +604,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) (!= (-> self next-state name) 'pickup) (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) ) @@ -814,7 +810,7 @@ (-> arg0 root trans) (-> arg0 offset) a2-0 - (/ (the float (- (-> *display* base-frame-counter) (-> arg0 start-time))) + (/ (the float (- (current-time) (-> arg0 start-time))) (the float (-> (the-as eco-collectable s5-0) collect-effect-time)) ) ) @@ -851,14 +847,14 @@ ) -(defmethod animate eco ((obj eco)) - (let ((a0-1 (-> obj part)) - (a1-0 (-> obj root-override root-prim prim-core)) +(defmethod animate eco ((this eco)) + (let ((a0-1 (-> this part)) + (a1-0 (-> this root-override root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) - (if (nonzero? (-> obj sound)) - (update! (-> obj sound)) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) ) 0 (none) @@ -892,8 +888,8 @@ ) (cond ((nonzero? (-> self respawn-delay)) - (let ((gp-0 (-> *display* base-frame-counter))) - (while (< (- (-> *display* base-frame-counter) gp-0) (-> self respawn-delay)) + (let ((gp-0 (current-time))) + (while (not (time-elapsed? gp-0 (-> self respawn-delay))) (suspend) ) ) @@ -922,8 +918,8 @@ ) -(defmethod init-from-entity! eco-yellow ((obj eco-yellow) (arg0 entity-actor)) - (initialize-eco obj arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) +(defmethod init-from-entity! eco-yellow ((this eco-yellow) (arg0 entity-actor)) + (initialize-eco this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -936,8 +932,8 @@ ) -(defmethod init-from-entity! eco-red ((obj eco-red) (arg0 entity-actor)) - (initialize-eco obj arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) +(defmethod init-from-entity! eco-red ((this eco-red) (arg0 entity-actor)) + (initialize-eco this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -950,8 +946,8 @@ ) -(defmethod init-from-entity! eco-blue ((obj eco-blue) (arg0 entity-actor)) - (initialize-eco obj arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) +(defmethod init-from-entity! eco-blue ((this eco-blue) (arg0 entity-actor)) + (initialize-eco this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -964,21 +960,21 @@ ) -(defmethod animate health ((obj health)) - (let ((a0-1 (-> obj part)) - (a1-0 (-> obj root-override root-prim prim-core)) +(defmethod animate health ((this health)) + (let ((a0-1 (-> this part)) + (a1-0 (-> this root-override root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) - (if (nonzero? (-> obj sound)) - (update! (-> obj sound)) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) ) 0 (none) ) -(defmethod init-from-entity! health ((obj health) (arg0 entity-actor)) - (initialize-eco obj arg0 (pickup-type eco-green) (-> *FACT-bank* health-single-inc)) +(defmethod init-from-entity! health ((this health) (arg0 entity-actor)) + (initialize-eco this arg0 (pickup-type eco-green) (-> *FACT-bank* health-single-inc)) (none) ) @@ -991,37 +987,37 @@ ) -(defmethod animate eco-pill ((obj eco-pill)) - (let ((a0-1 (-> obj part)) - (a1-0 (-> obj root-override root-prim prim-core)) +(defmethod animate eco-pill ((this eco-pill)) + (let ((a0-1 (-> this part)) + (a1-0 (-> this root-override root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) - (if (nonzero? (-> obj sound)) - (update! (-> obj sound)) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) ) 0 (none) ) -(defmethod init-from-entity! eco-pill ((obj eco-pill) (arg0 entity-actor)) - (initialize-eco obj arg0 (pickup-type eco-pill) (-> *FACT-bank* health-small-inc)) +(defmethod init-from-entity! eco-pill ((this eco-pill) (arg0 entity-actor)) + (initialize-eco this arg0 (pickup-type eco-pill) (-> *FACT-bank* health-small-inc)) (none) ) -(defmethod deactivate eco-pill ((obj eco-pill)) +(defmethod deactivate eco-pill ((this eco-pill)) (set! *eco-pill-count* (+ *eco-pill-count* -1)) - ((method-of-type eco-collectable deactivate) obj) + ((method-of-type eco-collectable deactivate) this) (none) ) -(defmethod initialize eco-pill ((obj eco-pill)) +(defmethod initialize eco-pill ((this eco-pill)) (set! *eco-pill-count* (+ *eco-pill-count* 1)) - (stack-size-set! (-> obj main-thread) 192) ;; og:preserve-this hack increased from 192 - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify-parent) #f) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 192) ;; og:preserve-this hack increased from 128 + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify-parent) #f) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1035,10 +1031,10 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) - obj + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + this ) (defskelgroup *money-sg* money money-lod0-jg money-idle-ja @@ -1062,28 +1058,28 @@ ) -(defmethod run-logic? money ((obj money)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-status was-drawn)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override pause-adjust-distance)) - (vector-vector-distance (-> obj root-override trans) (math-camera-pos)) +(defmethod run-logic? money ((this money)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-status was-drawn)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root-override pause-adjust-distance)) + (vector-vector-distance (-> this root-override trans) (math-camera-pos)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) -(defmethod deactivate money ((obj money)) - (when (= (-> obj next-state name) 'pickup) - (if (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status dead)))) +(defmethod deactivate money ((this money)) + (when (= (-> this next-state name) 'pickup) + (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status dead)))) (format #t "money ~A was killed in pickup~%") ) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) ) - ((method-of-type eco-collectable deactivate) obj) + ((method-of-type eco-collectable deactivate) this) (none) ) @@ -1094,7 +1090,7 @@ (quaternion-rotate-y! (-> self root-override quat) (-> self root-override quat) - (* 40049.777 (-> *display* seconds-per-frame)) + (* 40049.777 (seconds-per-frame)) ) (let ((f30-0 (-> self bob-amount))) (when (< 0.0 f30-0) @@ -1102,11 +1098,7 @@ (+ (-> self base y) (-> self suck-y-offset) (* f30-0 - (sin - (* 109.22667 - (the float (mod (+ (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self bob-offset)) (seconds 2))) - ) - ) + (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) 600)))) ) ) ) @@ -1130,7 +1122,7 @@ (quaternion-rotate-y! (-> self root-override quat) (-> self root-override quat) - (* 91022.22 (-> *display* seconds-per-frame)) + (* 91022.22 (seconds-per-frame)) ) (set! (-> self root-override trans quad) (-> self base quad)) (add-blue-motion #t #t #t #f) @@ -1140,11 +1132,7 @@ (+ (-> self base y) (-> self suck-y-offset) (* f30-0 - (sin - (* 109.22667 - (the float (mod (+ (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self bob-offset)) (seconds 2))) - ) - ) + (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) 600)))) ) ) ) @@ -1163,6 +1151,7 @@ (defstate pickup (money) :virtual #t :code (behavior ((arg0 object) (arg1 handle)) + ;; og:preserve-this added (if (nonzero? (-> self part)) (kill-and-free-particles (-> self part)) ) @@ -1173,9 +1162,9 @@ ) ) -(defmethod initialize money ((obj money)) - (stack-size-set! (-> obj main-thread) 192) ;; hack increased from 128 - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize money ((this money)) + (stack-size-set! (-> this main-thread) 192) ;; og:preserve-this hack increased from 128 + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1189,13 +1178,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify-parent) #f) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type money) (the-as float 1.0))) - (let ((a0-10 (-> obj entity))) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify-parent) #f) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type money) (the-as float 1.0))) + (let ((a0-10 (-> this entity))) (if (when a0-10 (let ((a0-11 (-> a0-10 extra perm task))) (if a0-11 @@ -1203,26 +1192,26 @@ ) ) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) - (initialize-skeleton obj *money-sg* '()) - (if (-> obj entity) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (initialize-skeleton this *money-sg* '()) + (if (-> this entity) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) ) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) ;; og:preserve-this added money starburst - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 64) obj)) - obj + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 64) this)) + this ) -(defmethod init-from-entity! money ((obj money) (arg0 entity-actor)) - (initialize obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-params obj 0 (the-as float 1024.0)) - (update-transforms! (-> obj root-override)) - (go (method-of-object obj wait)) +(defmethod init-from-entity! money ((this money) (arg0 entity-actor)) + (initialize this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-params this 0 (the-as float 1024.0)) + (update-transforms! (-> this root-override)) + (go (method-of-object this wait)) (none) ) @@ -1407,7 +1396,7 @@ (local-vars (v0-3 object)) (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) (and (not (handle->process (-> *game-info* other-camera-handle))) (not *progress-process*) (!= (-> self next-state name) 'pickup) @@ -1470,8 +1459,8 @@ (let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0)))) (set! f28-0 (if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (not (logtest? (-> self flags) (collectable-flags anim)))) - (seek f28-0 (the-as float 16384.0) (* 3072.0 (-> *display* seconds-per-frame))) - (seek f28-0 (the-as float 0.0) (* 3072.0 (-> *display* seconds-per-frame))) + (seek f28-0 (the-as float 16384.0) (* 3072.0 (seconds-per-frame))) + (seek f28-0 (the-as float 0.0) (* 3072.0 (seconds-per-frame))) ) ) (set! (-> self root-override trans y) (+ (-> self base y) (* 2867.2 (sin f28-0)))) @@ -1493,7 +1482,7 @@ (defstate pickup (fuel-cell) :virtual #t :enter (behavior ((arg0 object) (arg1 handle)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (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))) (if t9-1 @@ -1569,7 +1558,7 @@ (format #t "WARNING: fuel-cell stall ~D ~A ~A~%" - (-> *display* base-frame-counter) + (current-time) (handle->process (-> *game-info* other-camera-handle)) (-> *level* loading-level) ) @@ -1916,9 +1905,9 @@ ) ) -(defmethod initialize fuel-cell ((obj fuel-cell)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize fuel-cell ((this fuel-cell)) + (stack-size-set! (-> this main-thread) 512) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1933,30 +1922,30 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify-parent) #f) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type fuel-cell) (the-as float 0.0))) - (initialize-skeleton obj *fuel-cell-sg* '()) - (set! (-> obj base quad) (-> obj root-override trans quad)) - (set! (-> obj old-base quad) (-> obj root-override trans quad)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 63) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> obj root-override trans)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify-parent) #f) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type fuel-cell) (the-as float 0.0))) + (initialize-skeleton this *fuel-cell-sg* '()) + (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this old-base quad) (-> this root-override trans quad)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 63) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> this root-override trans)) ) - (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) - obj + (set! (-> this victory-anim) (fuel-cell-pick-anim this)) + this ) -(defmethod init-from-entity! fuel-cell ((obj fuel-cell) (arg0 entity-actor)) - (initialize obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-params obj 0 (the-as float 1024.0)) - (logclear! (-> obj fact options) (fact-options can-collect)) - (update-transforms! (-> obj root-override)) - (go (method-of-object obj wait)) +(defmethod init-from-entity! fuel-cell ((this fuel-cell) (arg0 entity-actor)) + (initialize this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-params this 0 (the-as float 1024.0)) + (logclear! (-> this fact options) (fact-options can-collect)) + (update-transforms! (-> this root-override)) + (go (method-of-object this wait)) (none) ) @@ -2079,26 +2068,26 @@ ) -(defmethod animate buzzer ((obj buzzer)) +(defmethod animate buzzer ((this buzzer)) (quaternion-rotate-y! - (-> obj root-override quat) - (-> obj root-override quat) - (* 40049.777 (-> *display* seconds-per-frame)) + (-> this root-override quat) + (-> this root-override quat) + (* 40049.777 (seconds-per-frame)) ) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 param 0) 1.0) (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((f0-3 (y-angle (-> obj root-override)))) + (let ((f0-3 (y-angle (-> this root-override)))) (set! (-> *part-id-table* 239 init-specs 4 initial-valuef) (+ 16384.0 f0-3)) (set! (-> *part-id-table* 240 init-specs 4 initial-valuef) (+ 16384.0 f0-3)) ) - (spawn (-> obj part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) - (if (nonzero? (-> obj sound)) - (update! (-> obj sound)) + (spawn (-> this part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) ) (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) - (spool-push *art-control* (-> obj victory-anim name) 0 obj (the-as float -99.0)) + (spool-push *art-control* (-> this victory-anim name) 0 this (the-as float -99.0)) ) 0 (none) @@ -2229,8 +2218,8 @@ ) ) -(defmethod initialize buzzer ((obj buzzer)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize buzzer ((this buzzer)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -2244,31 +2233,31 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify-parent) #f) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type buzzer) (the-as float 0.0))) - (initialize-skeleton obj *buzzer-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 65) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> obj root-override trans)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify-parent) #f) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type buzzer) (the-as float 0.0))) + (initialize-skeleton this *buzzer-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 65) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> this root-override trans)) ) - (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) - obj + (set! (-> this victory-anim) (fuel-cell-pick-anim this)) + this ) -(defmethod init-from-entity! buzzer ((obj buzzer) (arg0 entity-actor)) - (initialize obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-params obj 0 (the-as float 1024.0)) - (set! (-> obj collect-timeout) (seconds 2)) - (update-transforms! (-> obj root-override)) - (update-trans! (-> obj sound) (-> obj root-override trans)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (go (method-of-object obj wait)) - (go (method-of-object obj pickup) #t (the-as handle #f)) +(defmethod init-from-entity! buzzer ((this buzzer) (arg0 entity-actor)) + (initialize this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-params this 0 (the-as float 1024.0)) + (set! (-> this collect-timeout) (seconds 2)) + (update-transforms! (-> this root-override)) + (update-trans! (-> this sound) (-> this root-override trans)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (go (method-of-object this wait)) + (go (method-of-object this pickup) #t (the-as handle #f)) ) (none) ) @@ -2298,37 +2287,37 @@ (none) ) -(defmethod init-from-entity! eco ((obj eco) (arg0 entity-actor)) - (let ((v1-2 (res-lump-value (-> obj entity) 'eco-info pickup-type :time (the-as float -1000000000.0)))) - (set! (-> obj type) (cond - ((= v1-2 (pickup-type eco-blue)) - eco-blue - ) - ((= v1-2 (pickup-type eco-red)) - eco-red - ) - ((= v1-2 (pickup-type eco-yellow)) - eco-yellow - ) - ((= v1-2 (pickup-type eco-green)) - health - ) - ((= v1-2 (pickup-type money)) - money - ) - ((= v1-2 (pickup-type fuel-cell)) - fuel-cell - ) - ((= v1-2 (pickup-type buzzer)) - buzzer - ) - (else - eco-pill +(defmethod init-from-entity! eco ((this eco) (arg0 entity-actor)) + (let ((v1-2 (res-lump-value (-> this entity) 'eco-info pickup-type :time (the-as float -1000000000.0)))) + (set! (-> this type) (cond + ((= v1-2 (pickup-type eco-blue)) + eco-blue ) - ) + ((= v1-2 (pickup-type eco-red)) + eco-red + ) + ((= v1-2 (pickup-type eco-yellow)) + eco-yellow + ) + ((= v1-2 (pickup-type eco-green)) + health + ) + ((= v1-2 (pickup-type money)) + money + ) + ((= v1-2 (pickup-type fuel-cell)) + fuel-cell + ) + ((= v1-2 (pickup-type buzzer)) + buzzer + ) + (else + eco-pill + ) + ) ) ) - (init-from-entity! obj arg0) + (init-from-entity! this arg0) (none) ) @@ -2534,9 +2523,9 @@ sv-192 ) -(defmethod drop-pickup fact-info ((obj fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) - (let ((s3-0 (-> obj pickup-type)) - (f30-0 (-> obj pickup-amount)) +(defmethod drop-pickup fact-info ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) + (let ((s3-0 (-> this pickup-type)) + (f30-0 (-> this pickup-amount)) ) (when (= s3-0 (pickup-type eco-pill-random)) f30-0 @@ -2565,7 +2554,7 @@ ((< 10 *eco-pill-count*) 1.0 ) - ((type-type? (-> obj type) fact-info-enemy) + ((type-type? (-> this type) fact-info-enemy) (+ (rand-vu-float-range (the-as float 3.0) (+ 5.0 f30-0)) (the float arg3)) ) (else @@ -2576,7 +2565,7 @@ ) ) (let ((s2-1 (new 'stack-no-clear 'vector))) - (set! (-> s2-1 quad) (-> obj process root trans quad)) + (set! (-> s2-1 quad) (-> this process root trans quad)) (+! (-> s2-1 y) 12288.0) (let ((s1-1 (new 'stack-no-clear 'collide-tri-result))) (if (>= (fill-and-probe-using-y-probe @@ -2591,13 +2580,13 @@ 0.0 ) (set! (-> s2-1 quad) (-> s1-1 intersect quad)) - (set! (-> s2-1 quad) (-> obj process root trans quad)) + (set! (-> s2-1 quad) (-> this process root trans quad)) ) ) - (if (= s3-0 (pickup-type fuel-cell)) + (if (= (the-as int s3-0) 6) (+! (-> s2-1 y) 6144.0) ) - (birth-pickup-at-point s2-1 s3-0 f30-0 arg0 arg1 obj) + (birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 arg1 this) ) ) ) @@ -2634,7 +2623,7 @@ (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0) ) (when (!= (-> self offset-target y) (-> self offset y)) - (vector-seek! (-> self offset) (-> self offset-target) (* 4096.0 (-> *display* seconds-per-frame))) + (vector-seek! (-> self offset) (-> self offset-target) (* 4096.0 (seconds-per-frame))) (move-to-point! (-> self root-override) (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable (-> self parent 0)) root trans) @@ -2715,10 +2704,10 @@ ) -(defmethod initialize vent ((obj vent) (arg0 entity-actor) (arg1 pickup-type)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask actor-pause)) - (let ((s3-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize vent ((this vent) (arg0 entity-actor) (arg1 pickup-type)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s2-0 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 0)))) (set! (-> s2-0 prim-core collide-as) (collide-kind powerup)) (set! (-> s2-0 collide-with) (collide-kind target)) @@ -2727,69 +2716,69 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> obj root-override) s3-0) + (set! (-> this root-override) s3-0) ) - (set! (-> obj root-override trans quad) (-> arg0 extra trans quad)) - (update-transforms! (-> obj root-override)) - (set! (-> obj root-override pause-adjust-distance) 409600.0) - (set! (-> obj fact) (new 'process 'fact-info obj arg1 (-> *FACT-bank* eco-full-inc))) - (set! (-> obj block-func) (the-as (function vent symbol) true-func)) - (case (-> obj fact pickup-type) + (set! (-> this root-override trans quad) (-> arg0 extra trans quad)) + (update-transforms! (-> this root-override)) + (set! (-> this root-override pause-adjust-distance) 409600.0) + (set! (-> this fact) (new 'process 'fact-info this arg1 (-> *FACT-bank* eco-full-inc))) + (set! (-> this block-func) (the-as (function vent symbol) true-func)) + (case (-> this fact pickup-type) (((pickup-type eco-blue)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 44) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 67)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 43)) - (set! (-> obj sound) (new 'process 'ambient-sound 'eco-bg-blue (-> obj root-override trans))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 44) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 67)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 43)) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-blue (-> this root-override trans))) ) (((pickup-type eco-red)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 50) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 69)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 49)) - (set! (-> obj sound) (new 'process 'ambient-sound 'eco-bg-red (-> obj root-override trans))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 50) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 69)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 49)) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-red (-> this root-override trans))) ) (((pickup-type eco-green)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 62) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 66)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 61)) - (set! (-> obj sound) (new 'process 'ambient-sound 'eco-bg-green (-> obj root-override trans))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 62) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 66)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 61)) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-green (-> this root-override trans))) ) (((pickup-type eco-yellow)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 52) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 68)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 57)) - (set! (-> obj sound) (new 'process 'ambient-sound 'eco-bg-yellow (-> obj root-override trans))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 52) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 68)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 57)) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-yellow (-> this root-override trans))) ) ) - (set! (-> obj blocker) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (when (-> obj blocker) - (logior! (-> obj fact options) (fact-options vent-blocked)) - (set! (-> obj block-func) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (when (-> this blocker) + (logior! (-> this fact options) (fact-options vent-blocked)) + (set! (-> this block-func) (lambda ((arg0 vent)) (not (logtest? (-> arg0 blocker extra perm status) (entity-perm-status complete)))) ) ) - (set! (-> obj show-particles) #t) - (when (logtest? (-> obj fact options) (fact-options vent-blocked)) - (when (logtest? (-> obj fact options) (fact-options vent-valve)) - (case (-> obj fact pickup-type) + (set! (-> this show-particles) #t) + (when (logtest? (-> this fact options) (fact-options vent-blocked)) + (when (logtest? (-> this fact options) (fact-options vent-valve)) + (case (-> this fact pickup-type) (((pickup-type eco-blue)) - (set! (-> obj block-func) + (set! (-> this block-func) (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task jungle-eggtop))))) ) ) (((pickup-type eco-red)) - (set! (-> obj block-func) + (set! (-> this block-func) (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task red-eggtop))))) ) ) (((pickup-type eco-yellow)) - (set! (-> obj block-func) + (set! (-> this block-func) (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task snow-eggtop))))) ) ) ) - (process-spawn ecovalve (-> obj block-func) :from *pickup-dead-pool* :to obj) + (process-spawn ecovalve (-> this block-func) :from *pickup-dead-pool* :to this) ) - (if ((-> obj block-func) obj) + (if ((-> this block-func) this) (go vent-blocked) ) ) @@ -2926,8 +2915,8 @@ ) -(defmethod init-from-entity! ventyellow ((obj ventyellow) (arg0 entity-actor)) - (initialize obj arg0 (pickup-type eco-yellow)) +(defmethod init-from-entity! ventyellow ((this ventyellow) (arg0 entity-actor)) + (initialize this arg0 (pickup-type eco-yellow)) (none) ) @@ -2940,8 +2929,8 @@ ) -(defmethod init-from-entity! ventred ((obj ventred) (arg0 entity-actor)) - (initialize obj arg0 (pickup-type eco-red)) +(defmethod init-from-entity! ventred ((this ventred) (arg0 entity-actor)) + (initialize this arg0 (pickup-type eco-red)) (none) ) @@ -2954,8 +2943,8 @@ ) -(defmethod init-from-entity! ventblue ((obj ventblue) (arg0 entity-actor)) - (initialize obj arg0 (pickup-type eco-blue)) +(defmethod init-from-entity! ventblue ((this ventblue) (arg0 entity-actor)) + (initialize this arg0 (pickup-type eco-blue)) (none) ) @@ -2968,7 +2957,7 @@ ) -(defmethod init-from-entity! ecovent ((obj ecovent) (arg0 entity-actor)) - (initialize obj arg0 (pickup-type eco-blue)) +(defmethod init-from-entity! ecovent ((this ecovent) (arg0 entity-actor)) + (initialize this arg0 (pickup-type eco-blue)) (none) ) diff --git a/goal_src/jak1/engine/common-obs/crates.gc b/goal_src/jak1/engine/common-obs/crates.gc index eb757ff890..f3af150ae7 100644 --- a/goal_src/jak1/engine/common-obs/crates.gc +++ b/goal_src/jak1/engine/common-obs/crates.gc @@ -809,8 +809,8 @@ (logior! (-> self fact options) (fact-options instant-collect)) ) (when (not arg0) - (let ((s5-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.04)) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 0.04)) (suspend) ) ) @@ -903,8 +903,8 @@ (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1) (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status complete) #t) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 5)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 5)) (suspend) ) ) @@ -987,17 +987,17 @@ (none) ) -(defmethod init-from-entity! crate ((obj crate) (arg0 entity-actor)) - (params-init obj arg0) - (art-init obj) - (check-dead obj) +(defmethod init-from-entity! crate ((this crate) (arg0 entity-actor)) + (params-init this arg0) + (art-init this) + (check-dead this) (none) ) -(defmethod params-init crate ((obj crate) (arg0 entity)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask crate)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod params-init crate ((this crate) (arg0 entity)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask crate)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1015,26 +1015,26 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (let ((v1-27 (-> obj entity extra perm))) - (set! (-> obj fact pickup-amount) - (fmax 0.0 (- (-> obj fact pickup-amount) (the float (-> v1-27 user-int8 1)))) + (let ((v1-27 (-> this entity extra perm))) + (set! (-> this fact pickup-amount) + (fmax 0.0 (- (-> this fact pickup-amount) (the float (-> v1-27 user-int8 1)))) ) ) - (when (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> obj fact pickup-amount) 0.0) + (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-amount) 0.0) ) (when arg0 - (process-drawable-from-entity! obj (the-as entity-actor arg0)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this (the-as entity-actor arg0)) + (logclear! (-> this mask) (process-mask actor-pause)) ) (let ((a0-18 ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'crate-type 'interp -1000000000.0 @@ -1044,109 +1044,109 @@ ) ) ) - (set! (-> obj look) (the-as symbol a0-18)) - (set! (-> obj defense) (the-as symbol a0-18)) + (set! (-> this look) (the-as symbol a0-18)) + (set! (-> this defense) (the-as symbol a0-18)) ) - (case (-> obj fact pickup-type) + (case (-> this fact pickup-type) (((pickup-type buzzer)) - (set! (-> obj type) crate-buzzer) - (when (= (-> obj look) 'wood) - (set! (-> obj look) 'iron) - (set! (-> obj defense) 'iron) + (set! (-> this type) crate-buzzer) + (when (= (-> this look) 'wood) + (set! (-> this look) 'iron) + (set! (-> this defense) 'iron) ) ) (else - (when (= (-> obj look) 'iron) - (set! (-> obj look) 'wood) - (set! (-> obj defense) 'wood) + (when (= (-> this look) 'iron) + (set! (-> this look) 'wood) + (set! (-> this defense) 'wood) ) ) ) (none) ) -(defmethod art-init crate ((obj crate)) - (case (-> obj look) +(defmethod art-init crate ((this crate)) + (case (-> this look) (('iron) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense normal-attack)) - (initialize-skeleton obj *crate-iron-sg* '()) + (set! (-> this root-override root-prim prim-core offense) (collide-offense normal-attack)) + (initialize-skeleton this *crate-iron-sg* '()) ) (('steel) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense indestructible)) - (initialize-skeleton obj *crate-steel-sg* '()) + (set! (-> this root-override root-prim prim-core offense) (collide-offense indestructible)) + (initialize-skeleton this *crate-steel-sg* '()) ) (('darkeco) - (when (= (-> obj fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> obj fact pickup-type) (pickup-type none)) - (set! (-> obj fact pickup-amount) 0.0) + (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) ) - (initialize-skeleton obj *crate-darkeco-sg* '()) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (initialize-skeleton this *crate-darkeco-sg* '()) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) ) (('barrel) - (initialize-skeleton obj *crate-barrel-sg* '()) + (initialize-skeleton this *crate-barrel-sg* '()) ) (('bucket) - (when (= (-> obj fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> obj fact pickup-type) (pickup-type none)) - (set! (-> obj fact pickup-amount) 0.0) + (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) ) - (initialize-skeleton obj *crate-bucket-sg* '()) + (initialize-skeleton this *crate-bucket-sg* '()) ) (('none) - (initialize-skeleton obj *crate-wood-sg* '()) - (logior! (-> obj draw status) (draw-status hidden)) + (initialize-skeleton this *crate-wood-sg* '()) + (logior! (-> this draw status) (draw-status hidden)) ) (else - (initialize-skeleton obj *crate-wood-sg* '()) + (initialize-skeleton this *crate-wood-sg* '()) ) ) (cond - ((logtest? (fact-options indestructible) (-> obj fact options)) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense indestructible)) + ((logtest? (fact-options indestructible) (-> this fact options)) + (set! (-> this root-override root-prim prim-core offense) (collide-offense indestructible)) ) - ((logtest? (-> obj fact options) (fact-options strong-attack)) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense strong-attack)) + ((logtest? (-> this fact options) (fact-options strong-attack)) + (set! (-> this root-override root-prim prim-core offense) (collide-offense strong-attack)) ) - ((logtest? (-> obj fact options) (fact-options normal-attack)) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense normal-attack)) + ((logtest? (-> this fact options) (fact-options normal-attack)) + (set! (-> this root-override root-prim prim-core offense) (collide-offense normal-attack)) ) - ((logtest? (-> obj fact options) (fact-options touch)) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense touch)) + ((logtest? (-> this fact options) (fact-options touch)) + (set! (-> this root-override root-prim prim-core offense) (collide-offense touch)) ) ) - (set! (-> obj base quad) (-> obj root-override trans quad)) + (set! (-> this base quad) (-> this root-override trans quad)) (crate-post) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - obj + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + this ) -(defmethod params-set! crate ((obj crate) (arg0 symbol) (arg1 symbol)) +(defmethod params-set! crate ((this crate) (arg0 symbol) (arg1 symbol)) (if arg0 - (set! (-> obj look) arg0) + (set! (-> this look) arg0) ) (if arg1 - (set! (-> obj defense) arg1) + (set! (-> this defense) arg1) ) (none) ) -(defmethod check-dead crate ((obj crate)) - (if (>= (-> obj entity extra perm user-int8 0) 1) - (go (method-of-object obj die) #t 0) +(defmethod check-dead crate ((this crate)) + (if (>= (-> this entity extra perm user-int8 0) 1) + (go (method-of-object this die) #t 0) ) 0 - (go (method-of-object obj wait)) + (go (method-of-object this wait)) 0 (none) ) -(defmethod smush-update! crate ((obj crate)) - (let ((f0-0 (update! (-> obj smush)))) - (set! (-> obj root-override scale x) (+ 1.0 (* -0.5 f0-0))) - (set! (-> obj root-override scale y) (+ 1.0 f0-0)) - (set! (-> obj root-override scale z) (+ 1.0 (* -0.5 f0-0))) +(defmethod smush-update! crate ((this crate)) + (let ((f0-0 (update! (-> this smush)))) + (set! (-> this root-override scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root-override scale y) (+ 1.0 f0-0)) + (set! (-> this root-override scale z) (+ 1.0 (* -0.5 f0-0))) ) 0 (none) @@ -1161,11 +1161,11 @@ ) -(defmethod params-init barrel ((obj barrel) (arg0 entity)) +(defmethod params-init barrel ((this barrel) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj look) 'barrel) + (set! (-> this look) 'barrel) (none) ) @@ -1178,11 +1178,11 @@ ) -(defmethod params-init bucket ((obj bucket) (arg0 entity)) +(defmethod params-init bucket ((this bucket) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj look) 'bucket) + (set! (-> this look) 'bucket) (none) ) @@ -1227,20 +1227,20 @@ ) -(defmethod art-init crate-buzzer ((obj crate-buzzer)) +(defmethod art-init crate-buzzer ((this crate-buzzer)) (let ((t9-0 (method-of-type crate art-init))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 74) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) - (-> obj root-override trans) - ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 74) this)) + (set! (-> this sound) (new + 'process + 'ambient-sound + (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) + (-> this root-override trans) + ) ) - (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) - (the-as crate obj) + (set! (-> this victory-anim) (fuel-cell-pick-anim this)) + (the-as crate this) ) (defstate wait (crate-buzzer) @@ -1249,7 +1249,7 @@ (when (and (and *target* (>= 327680.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.5)) + (time-elapsed? (-> self state-time) (seconds 1.5)) (rand-vu-percent? 0.03) ) (spawn (-> self part) (-> self root-override trans)) @@ -1264,19 +1264,19 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (suspend) (update-transforms! (-> self root-override)) (loop - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) (let ((f30-0 57001.605)) (sound-play "crate-jump") (while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0)) - (+! f30-0 (* -245760.0 (-> *display* seconds-per-frame))) - (+! (-> self root-override trans y) (* f30-0 (-> *display* seconds-per-frame))) + (+! f30-0 (* -245760.0 (seconds-per-frame))) + (+! (-> self root-override trans y) (* f30-0 (seconds-per-frame))) (when (< (-> self root-override trans y) (-> self base y)) (set! (-> self root-override trans y) (-> self base y)) (set! f30-0 (* -0.5 f30-0)) @@ -1316,20 +1316,20 @@ ) -(defmethod params-init pickup-spawner ((obj pickup-spawner) (arg0 entity)) +(defmethod params-init pickup-spawner ((this pickup-spawner) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj look) 'none) - (set! (-> obj blocker) #f) - (if (logtest? (-> obj fact options) (fact-options vent-blocked)) - (set! (-> obj blocker) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (set! (-> this look) 'none) + (set! (-> this blocker) #f) + (if (logtest? (-> this fact options) (fact-options vent-blocked)) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) ) (none) ) -(defmethod check-dead pickup-spawner ((obj pickup-spawner)) - (go (method-of-object obj wait)) +(defmethod check-dead pickup-spawner ((this pickup-spawner)) + (go (method-of-object this wait)) 0 (none) ) diff --git a/goal_src/jak1/engine/common-obs/dark-eco-pool.gc b/goal_src/jak1/engine/common-obs/dark-eco-pool.gc index 253660070e..cf03c77497 100644 --- a/goal_src/jak1/engine/common-obs/dark-eco-pool.gc +++ b/goal_src/jak1/engine/common-obs/dark-eco-pool.gc @@ -84,18 +84,18 @@ ) ) -(defmethod water-vol-method-25 dark-eco-pool ((obj dark-eco-pool)) +(defmethod water-vol-method-25 dark-eco-pool ((this dark-eco-pool)) (let ((t9-0 (method-of-type water-anim water-vol-method-25))) - (t9-0 obj) + (t9-0 this) ) - (logclear! (-> obj flags) (water-flags wt23)) - (logior! (-> obj flags) (water-flags wt24)) - (set! (-> obj attack-event) + (logclear! (-> this flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt24)) + (set! (-> this attack-event) (the-as symbol ((the-as (function res-lump symbol symbol float structure (pointer res-tag) pointer object) (method-of-type res-lump get-property-struct) ) - (-> obj entity) + (-> this entity) 'attack-event 'interp -1000000000.0 @@ -108,18 +108,18 @@ (none) ) -(defmethod water-vol-method-22 dark-eco-pool ((obj dark-eco-pool)) +(defmethod water-vol-method-22 dark-eco-pool ((this dark-eco-pool)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((gp-0 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) gp-0) + (set! (-> this draw ripple) gp-0) (set! (-> gp-0 global-scale) 3072.0) (set! (-> gp-0 close-fade-dist) 163840.0) (set! (-> gp-0 far-fade-dist) 245760.0) (set! (-> gp-0 waveform) ripple-for-dark-eco-pool) (set! (-> gp-0 query) (new 'process 'ripple-merc-query 100)) - (case (-> obj look) + (case (-> this look) ((32) (set! (-> gp-0 waveform) ripple-for-misty-dark-eco-pool) ) @@ -343,7 +343,7 @@ ) ) (let* ((gp-0 (-> self draw ripple)) - (f0-1 (the float (logand (-> *display* base-frame-counter) #xffff))) + (f0-1 (the float (logand (current-time) #xffff))) (f0-3 (cos (* 5.0 f0-1))) (f30-0 (* f0-3 f0-3)) ) diff --git a/goal_src/jak1/engine/common-obs/generic-obs-h.gc b/goal_src/jak1/engine/common-obs/generic-obs-h.gc index 987ff2ee9a..c65aee57b0 100644 --- a/goal_src/jak1/engine/common-obs/generic-obs-h.gc +++ b/goal_src/jak1/engine/common-obs/generic-obs-h.gc @@ -230,10 +230,3 @@ (die () _type_ :state 14) ) ) - - -0 - - - - diff --git a/goal_src/jak1/engine/common-obs/generic-obs.gc b/goal_src/jak1/engine/common-obs/generic-obs.gc index 8bb71b82cf..ef2e3181ed 100644 --- a/goal_src/jak1/engine/common-obs/generic-obs.gc +++ b/goal_src/jak1/engine/common-obs/generic-obs.gc @@ -129,8 +129,8 @@ (while (and *target* (= (handle->process (-> *target* control unknown-handle10)) self)) (suspend) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.5)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) (suspend) ) ) @@ -138,19 +138,19 @@ ) ) -(defmethod init-from-entity! swingpole ((obj swingpole) (arg0 entity-actor)) +(defmethod init-from-entity! swingpole ((this swingpole) (arg0 entity-actor)) "Copy defaults from the entity." - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj root) (new 'process 'trsq)) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 quat)) - (vector-identity! (-> obj root scale)) - (vector-y-quaternion! (-> obj dir) (-> obj root quat)) - (set! (-> obj dir y) 0.0) - (vector-normalize! (-> obj dir) 1.0) - (set! (-> obj range) 12288.0) - (set! (-> obj edge-length) 8192.0) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsq)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (vector-y-quaternion! (-> this dir) (-> this root quat)) + (set! (-> this dir y) 0.0) + (vector-normalize! (-> this dir) 1.0) + (set! (-> this range) 12288.0) + (set! (-> this edge-length) 8192.0) (go swingpole-stance) (none) ) @@ -160,10 +160,10 @@ :code nothing ) -(defmethod init-from-entity! process-hidden ((obj process-hidden) (arg0 entity-actor)) +(defmethod init-from-entity! process-hidden ((this process-hidden) (arg0 entity-actor)) "Copy defaults from the entity." - (process-entity-status! obj (entity-perm-status dead) #t) - (go (method-of-object obj die)) + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die)) (none) ) @@ -542,11 +542,11 @@ (none) ) -(defmethod deactivate part-tracker ((obj part-tracker)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate part-tracker ((this part-tracker)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -571,8 +571,8 @@ (defstate part-tracker-process (part-tracker) :code (behavior () - (set! (-> self start-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self start-time)) (-> self duration)) + (set-time! (-> self start-time)) + (while (not (time-elapsed? (-> self start-time) (-> self duration))) (let ((gp-0 (handle->process (-> self target)))) (when gp-0 (if (and gp-0 (type-type? (-> gp-0 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-0) root))) @@ -588,8 +588,8 @@ ) (suspend) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (-> self linger-duration)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (-> self linger-duration)) (if (-> self linger-callback) ((-> self linger-callback) self) ) @@ -899,7 +899,8 @@ ) ) -(defmethod eval camera-tracker ((obj camera-tracker) (arg0 pair)) +;; ERROR: Failed load: (set! v1-42 (l.wu (+ a0-22 -4))) at op 159 +(defmethod eval camera-tracker ((this camera-tracker) (arg0 pair)) (with-pp (let ((gp-0 (the-as object #f))) (cond @@ -913,18 +914,18 @@ (('print) (set! gp-0 (car s4-0)) (if (pair? gp-0) - (set! gp-0 (eval obj (the-as pair gp-0))) + (set! gp-0 (eval this (the-as pair gp-0))) ) - (format #t "~A MESSAGE (~D): ~A~%" obj (-> *display* base-frame-counter) gp-0) + (format #t "~A MESSAGE (~D): ~A~%" this (current-time) gp-0) ) (('while) (let ((s3-0 (car s4-0))) - (while (eval obj (the-as pair s3-0)) + (while (eval this (the-as pair s3-0)) (let* ((s2-0 (cdr s4-0)) (a1-3 (car s2-0)) ) (while (not (null? s2-0)) - (set! gp-0 (eval obj (the-as pair a1-3))) + (set! gp-0 (eval this (the-as pair a1-3))) (set! s2-0 (cdr s2-0)) (set! a1-3 (car s2-0)) ) @@ -934,12 +935,12 @@ ) (('until) (let ((s3-1 (car s4-0))) - (while (not (eval obj (the-as pair s3-1))) + (while (not (eval this (the-as pair s3-1))) (let* ((s2-1 (cdr s4-0)) (a1-5 (car s2-1)) ) (while (not (null? s2-1)) - (set! gp-0 (eval obj (the-as pair a1-5))) + (set! gp-0 (eval this (the-as pair a1-5))) (set! s2-1 (cdr s2-1)) (set! a1-5 (car s2-1)) ) @@ -948,21 +949,21 @@ ) ) (('not) - (set! gp-0 (not (eval obj (the-as pair (car s4-0))))) + (set! gp-0 (not (eval this (the-as pair (car s4-0))))) ) (('wait-for 'wait 'suspend) (let ((s5-1 (command-get-time (car s4-0) 1)) - (s4-1 (-> *display* base-frame-counter)) + (s4-1 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) s4-1) s5-1) + (until (time-elapsed? s4-1 s5-1) (suspend) ) ) ) (('message?) - (when (= (-> obj message) (car s4-0)) - (set! gp-0 (-> obj message)) - (set! (-> obj message) #f) + (when (= (-> this message) (car s4-0)) + (set! gp-0 (-> this message)) + (set! (-> this message) #f) ) ) (('send-event) @@ -988,13 +989,13 @@ (('eval) (let ((s4-3 (car s4-0))) (if (and s4-3 (type-type? (-> (the-as basic s4-3) type) function)) - (set! gp-0 ((the-as (function camera-tracker symbol) s4-3) obj)) + (set! gp-0 ((the-as (function camera-tracker symbol) s4-3) this)) ) ) ) (('work-set!) - (set! gp-0 (process->handle (eval obj (the-as pair (car s4-0))))) - (set! (-> obj work-process) (the-as handle gp-0)) + (set! gp-0 (process->handle (eval this (the-as pair (car s4-0))))) + (set! (-> this work-process) (the-as handle gp-0)) ) (('grab) (let ((a0-38 (command-get-process (car s4-0) *target*))) @@ -1002,7 +1003,7 @@ ) ) (('release) - (set! gp-0 (process-release? (handle->process (-> obj grab-target)))) + (set! gp-0 (process-release? (handle->process (-> this grab-target)))) ) (('alive?) (set! gp-0 (command-get-process (car s4-0) *target*)) @@ -1042,11 +1043,11 @@ (format (clear *temp-string*) "*~S-sg*" s2-2) (let ((s2-3 (-> (s1-0 *temp-string*) value))) (when (type-type? (rtype-of s2-3) skeleton-group) - (set! (-> obj anim-process) (the-as handle #f)) + (set! (-> this anim-process) (the-as handle #f)) (let ((s1-1 (get-process *default-dead-pool* manipy #x4000))) (set! gp-0 (when s1-1 (let ((t9-35 (method-of-type manipy activate))) - (t9-35 (the-as manipy s1-1) obj 'manipy (the-as pointer #x70004000)) + (t9-35 (the-as manipy s1-1) this 'manipy (the-as pointer #x70004000)) ) (run-now-in-process s1-1 manipy-init s4-4 #f s2-3 #f) (-> s1-1 ppointer) @@ -1055,7 +1056,7 @@ ) (send-event (-> (the-as (pointer process) gp-0) 0 self) 'anim-mode 'play1) (send-event (-> (the-as (pointer process) gp-0) 0 self) 'art-joint-anim s3-3) - (set! (-> obj anim-process) (ppointer->handle (the-as (pointer process) gp-0))) + (set! (-> this anim-process) (ppointer->handle (the-as (pointer process) gp-0))) ) ) ) @@ -1146,7 +1147,7 @@ (set! (-> self pov-target) (the-as handle #f)) (set! (-> self callback) #f) (set! (-> self userdata) #f) - (set! (-> self start-time) (-> *display* base-frame-counter)) + (set-time! (-> self start-time)) (set! (-> self script) '()) (set! (-> self script-line) '()) (set! (-> self script-func) #f) @@ -1252,9 +1253,9 @@ (define *lev-string* (new 'global 'string 64 (the-as string #f))) -(defmethod init-from-entity! med-res-level ((obj med-res-level) (arg0 entity-actor)) +(defmethod init-from-entity! med-res-level ((this med-res-level) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (stack-size-set! (-> obj main-thread) 128) + (stack-size-set! (-> this main-thread) 128) "#f" (let ((s4-0 (the-as (pointer sparticle-launch-group) #f))) (set! sv-16 (new 'static 'res-tag)) @@ -1286,29 +1287,29 @@ (when (the-as object s4-0) (let ((a0-8 (-> s4-0 0))) (if (and (nonzero? a0-8) (= (-> a0-8 type) sparticle-launch-group)) - (set! (-> obj part) (create-launch-control a0-8 obj)) + (set! (-> this part) (create-launch-control a0-8 this)) ) ) ) ) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (let ((s4-1 (res-lump-struct (-> obj entity) 'level structure)) - (s3-1 (res-lump-value (-> obj entity) 'index uint128)) + (process-entity-status! this (entity-perm-status bit-7) #t) + (let ((s4-1 (res-lump-struct (-> this entity) 'level structure)) + (s3-1 (res-lump-value (-> this entity) 'index uint128)) ) (when s4-1 - (set! (-> obj level) (the-as symbol s4-1)) - (set! (-> obj index) (the-as int s3-1)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this level) (the-as symbol s4-1)) + (set! (-> this index) (the-as int s3-1)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (format (clear *lev-string*) "med-res-~S~S" s4-1 (if (zero? s3-1) "" (* s3-1 8) ) ) - (initialize-skeleton-by-name obj *lev-string* '()) - (logior! (-> obj draw status) (draw-status do-not-check-distance)) - (if (nonzero? (-> obj draw)) + (initialize-skeleton-by-name this *lev-string* '()) + (logior! (-> this draw status) (draw-status do-not-check-distance)) + (if (nonzero? (-> this draw)) (go med-res-level-idle) ) ) @@ -1316,9 +1317,9 @@ (none) ) -(defmethod is-visible? part-spawner ((obj part-spawner)) - (sphere<-vector+r! (-> obj world-sphere) (-> obj root trans) (-> obj radius)) - (sphere-in-view-frustum? (-> obj world-sphere)) +(defmethod is-visible? part-spawner ((this part-spawner)) + (sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius)) + (sphere-in-view-frustum? (-> this world-sphere)) ) (defstate part-spawner-active (part-spawner) @@ -1355,18 +1356,18 @@ ) ) -(defmethod init-from-entity! part-spawner ((obj part-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! part-spawner ((this part-spawner) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj radius) 12288.0) - (set! (-> obj enable) - (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this radius) 12288.0) + (set! (-> this enable) + (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete)))) ) - (set! (-> obj sound) (new 'process 'ambient-sound (-> obj entity) (-> obj root trans))) + (set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans))) (let ((s4-0 (the-as object "#f"))) (let ((s3-0 (the-as (pointer sparticle-launch-group) #f))) (set! sv-16 (new 'static 'res-tag)) @@ -1379,7 +1380,7 @@ ) ((= (-> s2-0 -1) string) (when (string= (the-as string s2-0) "group-beach-grotto-1") - (set! (-> obj radius) 61440.0) + (set! (-> this radius) 61440.0) (go beach-part-grotto-1) ) (set! s4-0 s2-0) @@ -1401,11 +1402,11 @@ ) ) ) - (set! (-> obj mode) s3-0) + (set! (-> this mode) s3-0) (when s3-0 (let ((a0-19 (-> s3-0 0))) (when (and (nonzero? a0-19) (= (-> a0-19 type) sparticle-launch-group)) - (set! (-> obj part) (create-launch-control a0-19 obj)) + (set! (-> this part) (create-launch-control a0-19 this)) (go part-spawner-active) ) ) @@ -1731,12 +1732,12 @@ ) ) :code (behavior () - (let ((gp-0 (-> *display* base-frame-counter))) + (let ((gp-0 (current-time))) (loop (when (not (paused?)) (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) (send-event *camera* 'teleport) - (if (and (-> *camera* on-ground) (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1))) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)) ) ) @@ -1796,7 +1797,7 @@ (cam-launcher-long-joystick) ) :code (behavior () - (let ((gp-0 (-> *display* base-frame-counter))) + (let ((gp-0 (current-time))) (loop (when (not (paused?)) (let ((s4-0 (new 'stack-no-clear 'vector)) @@ -1838,7 +1839,7 @@ (set! (-> self trans x) (-> *camera* tpos-curr x)) (set! (-> self trans z) (-> *camera* tpos-curr z)) (vector+! (-> self trans) (-> self trans) (-> self view-flat)) - (if (and (-> *camera* on-ground) (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1))) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)) ) ) @@ -1905,7 +1906,7 @@ (defstate launcher-active (launcher) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (or (= message 'touch) (= message 'attack)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) (cond @@ -1944,7 +1945,7 @@ (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) ) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) ) (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) @@ -1959,9 +1960,9 @@ :code anim-loop ) -(defmethod init-from-entity! launcher ((obj launcher) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 128) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! launcher ((this launcher) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1970,52 +1971,52 @@ ) (set! (-> s4-0 nav-radius) 13926.4) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (update-transforms! (-> obj root-override)) - (set! (-> obj active-distance) 409600.0) - (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) + (process-drawable-from-entity! this arg0) + (update-transforms! (-> this root-override)) + (set! (-> this active-distance) 409600.0) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) (let ((s4-1 (res-lump-value arg0 'mode uint128))) - (let ((v1-18 (-> obj entity extra level name))) - (set! (-> obj part) (create-launch-control - (cond - ((= v1-18 'beach) - (-> *part-group-id-table* 37) - ) - ((= v1-18 'swamp) - (-> *part-group-id-table* 39) - ) - (else - (-> *part-group-id-table* 38) + (let ((v1-18 (-> this entity extra level name))) + (set! (-> this part) (create-launch-control + (cond + ((= v1-18 'beach) + (-> *part-group-id-table* 37) ) - ) - obj - ) + ((= v1-18 'swamp) + (-> *part-group-id-table* 39) + ) + (else + (-> *part-group-id-table* 38) + ) + ) + this + ) ) ) (let ((v1-24 (logand (the-as int s4-1) 255))) (cond ((= (the-as uint v1-24) 1) - (set! (-> obj camera) cam-launcher-longfall) + (set! (-> this camera) cam-launcher-longfall) ) ((= (the-as uint v1-24) 2) - (set! (-> obj camera) #f) + (set! (-> this camera) #f) ) (else - (set! (-> obj camera) cam-launcher-shortfall) + (set! (-> this camera) cam-launcher-shortfall) ) ) ) ) (let ((v1-29 (res-lump-struct arg0 'alt-vector vector))) (when v1-29 - (set-vector! (-> obj dest) (-> v1-29 x) (-> v1-29 y) (-> v1-29 z) 1.0) - (set! (-> obj seek-time) (the-as time-frame (the int (* 300.0 (-> v1-29 w))))) + (set-vector! (-> this dest) (-> v1-29 x) (-> v1-29 y) (-> v1-29 z) 1.0) + (set! (-> this seek-time) (the-as time-frame (the int (* 300.0 (-> v1-29 w))))) ) ) - (set! (-> obj sound-id) (new-sound-id)) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (set! (-> this sound-id) (new-sound-id)) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) (go launcher-idle) (none) ) @@ -2174,7 +2175,7 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (while ((-> self run-function)) (let* ((gp-0 (handle->process (-> self target))) (a0-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) @@ -2239,10 +2240,7 @@ (set! (-> self event) #f) (set! (-> self callback) #f) (set! (-> self run-function) - (lambda :behavior touch-tracker - () - (< (- (-> *display* base-frame-counter) (-> self state-time)) (-> self duration)) - ) + (lambda :behavior touch-tracker () (not (time-elapsed? (-> self state-time) (-> self duration)))) ) (set! (-> self event-hook) (-> touch-tracker-idle event)) (go touch-tracker-idle) diff --git a/goal_src/jak1/engine/common-obs/nav-enemy.gc b/goal_src/jak1/engine/common-obs/nav-enemy.gc index 91c2b5c00f..fc46bfed42 100644 --- a/goal_src/jak1/engine/common-obs/nav-enemy.gc +++ b/goal_src/jak1/engine/common-obs/nav-enemy.gc @@ -37,75 +37,75 @@ ) ) -(defmethod eval-position! trajectory ((obj trajectory) (time float) (result vector)) - (vector+float*! result (-> obj initial-position) (-> obj initial-velocity) time) - (+! (-> result y) (* 0.5 time time (-> obj gravity))) +(defmethod eval-position! trajectory ((this trajectory) (time float) (result vector)) + (vector+float*! result (-> this initial-position) (-> this initial-velocity) time) + (+! (-> result y) (* 0.5 time time (-> this gravity))) result ) -(defmethod relocate nav-enemy ((obj nav-enemy) (arg0 int)) - (if (nonzero? (-> obj neck)) - (set! (-> obj neck) (the-as joint-mod (+ (the-as int (-> obj neck)) arg0))) +(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))) ) - (if (nonzero? (-> obj rand-gen)) - (set! (-> obj rand-gen) (the-as random-generator (+ (the-as int (-> obj rand-gen)) arg0))) + (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)) obj arg0)) + (the-as nav-enemy ((the-as (function process-drawable int none) (find-parent-method nav-enemy 7)) this arg0)) ) -(defmethod new-patrol-point! nav-enemy ((obj nav-enemy)) +(defmethod new-patrol-point! nav-enemy ((this nav-enemy)) (local-vars (v1-11 symbol)) - (if (<= (-> obj path curve num-cverts) 0) + (if (<= (-> this path curve num-cverts) 0) (go process-drawable-art-error "no path") ) (let ((s5-0 3)) 0 - (let ((s4-0 (-> obj nav destination-pos))) + (let ((s4-0 (-> this nav destination-pos))) (until (or v1-11 (<= s5-0 0)) - (let ((v1-8 (nav-enemy-rnd-int-count (-> obj path curve num-cverts)))) - (eval-path-curve-div! (-> obj path) s4-0 (the float v1-8) 'interp) + (let ((v1-8 (nav-enemy-rnd-int-count (-> this path curve num-cverts)))) + (eval-path-curve-div! (-> this path) s4-0 (the float v1-8) 'interp) ) (+! s5-0 -1) - (set! v1-11 (< 4096.0 (vector-vector-xz-distance s4-0 (-> obj collide-info trans)))) + (set! v1-11 (< 4096.0 (vector-vector-xz-distance s4-0 (-> this collide-info trans)))) ) ) ) 0 ) -(defmethod common-post nav-enemy ((obj nav-enemy)) - (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) +(defmethod common-post nav-enemy ((this nav-enemy)) + (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf8)) (or (not *target*) (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) (seconds 0.05)) + (time-elapsed? (-> this touch-time) (seconds 0.05)) ) ) ) - (set-collide-offense (-> obj collide-info) 2 (collide-offense touch)) - (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) + (set-collide-offense (-> this collide-info) 2 (collide-offense touch)) + (logclear! (-> this nav-enemy-flags) (nav-enemy-flags navenmf8)) ) - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) (when *target* (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> obj collide-info root-prim prim-core)) - (if (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf2)) + (the-as vector (-> this collide-info root-prim prim-core)) + (if (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf2)) 'attacking ) - obj + this ) ) - (if (and (nonzero? (-> obj neck)) (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf14))) - (set-target! (-> obj neck) (target-pos (-> obj nav-info player-look-at-joint))) + (if (and (nonzero? (-> this neck)) (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf14))) + (set-target! (-> this neck) (target-pos (-> this nav-info player-look-at-joint))) ) ) - (when (-> obj nav-info debug-draw-neck) - (if (nonzero? (-> obj neck)) - (joint-mod-debug-draw (-> obj neck)) + (when (-> this nav-info debug-draw-neck) + (if (nonzero? (-> this neck)) + (joint-mod-debug-draw (-> this neck)) ) ) (ja-post) @@ -113,11 +113,11 @@ (none) ) -(defmethod touch-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod touch-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) + (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) @@ -125,11 +125,11 @@ ) ) -(defmethod nav-enemy-touch-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod nav-enemy-touch-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) + (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) @@ -137,22 +137,22 @@ ) ) -(defmethod nav-enemy-attack-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-attack-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (send-event arg0 'get-attack-count 1) - (logclear! (-> obj mask) (process-mask actor-pause attackable)) - (go (method-of-object obj nav-enemy-die)) + (logclear! (-> this mask) (process-mask actor-pause attackable)) + (go (method-of-object this nav-enemy-die)) 'die ) -(defmethod attack-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (cond - ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) + ((logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) (send-event arg0 'get-attack-count 1) - (logclear! (-> obj mask) (process-mask actor-pause attackable)) - (go (method-of-object obj nav-enemy-die)) + (logclear! (-> this mask) (process-mask actor-pause attackable)) + (go (method-of-object this nav-enemy-die)) ) (else - (touch-handler obj arg0 arg1) + (touch-handler this arg0 arg1) ) ) ) @@ -175,7 +175,7 @@ (defbehavior nav-enemy-default-event-handler nav-enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) (touch-handler self arg0 arg3) ) (('attack) @@ -223,7 +223,7 @@ (defbehavior nav-enemy-jump-event-handler nav-enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) (nav-enemy-touch-handler self arg0 arg3) ) (('attack) @@ -262,92 +262,97 @@ nav-enemy-default-event-handler (none) ) -(defmethod nav-enemy-method-40 nav-enemy ((obj nav-enemy)) - (nav-control-method-11 (-> obj nav) (-> obj nav target-pos)) +(defmethod nav-enemy-method-40 nav-enemy ((this nav-enemy)) + (nav-control-method-11 (-> this nav) (-> this nav target-pos)) 0 (none) ) -(defmethod nav-enemy-method-41 nav-enemy ((obj nav-enemy)) +(defmethod nav-enemy-method-41 nav-enemy ((this nav-enemy)) (cond - ((-> obj nav-info use-align) + ((-> this nav-info use-align) (align-vel-and-quat-only! - (-> obj align) + (-> this align) (align-opts adjust-xz-vel) - (-> obj nav travel) + (-> this nav travel) (the-as int 1.0) 1.0 - (* (-> obj enemy-info speed) (-> obj speed-scale)) + (* (-> this enemy-info speed) (-> this speed-scale)) ) ) (else (cond - ((-> obj nav-info use-momentum) - (let* ((f0-3 (- (-> obj target-speed) (-> obj momentum-speed))) - (f1-4 (fmin (* (-> obj acceleration) (-> *display* seconds-per-frame)) (fabs f0-3))) + ((-> this nav-info use-momentum) + (let* ((f0-3 (- (-> this target-speed) (-> this momentum-speed))) + (f1-4 (fmin (* (-> this acceleration) (seconds-per-frame)) (fabs f0-3))) ) (if (< f0-3 0.0) - (set! (-> obj momentum-speed) (- (-> obj momentum-speed) f1-4)) - (+! (-> obj momentum-speed) f1-4) + (set! (-> this momentum-speed) (- (-> this momentum-speed) f1-4)) + (+! (-> this momentum-speed) f1-4) ) ) ) (else - (set! (-> obj momentum-speed) (-> obj target-speed)) + (set! (-> this momentum-speed) (-> this target-speed)) ) ) (let* ((f0-12 (fmin - (* (-> obj speed-scale) (-> obj momentum-speed)) - (* (vector-length (-> obj nav travel)) (-> *display* frames-per-second)) + (* (-> this speed-scale) (-> this momentum-speed)) + (* (vector-length (-> this nav travel)) (-> *display* frames-per-second)) ) ) - (v1-15 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj nav travel) f0-12)) + (v1-15 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this nav travel) f0-12)) ) - (set! (-> obj collide-info transv x) (-> v1-15 x)) - (set! (-> obj collide-info transv z) (-> v1-15 z)) + (set! (-> this collide-info transv x) (-> v1-15 x)) + (set! (-> this collide-info transv z) (-> v1-15 z)) ) ) ) - (if (-> obj nav-info move-to-ground) + (if (-> this nav-info move-to-ground) (vector-v++! - (-> obj collide-info transv) - (compute-acc-due-to-gravity (-> obj collide-info) (new-stack-vector0) 0.0) + (-> this collide-info transv) + (compute-acc-due-to-gravity (-> this collide-info) (new-stack-vector0) 0.0) ) ) 0 (none) ) -(defmethod nav-enemy-method-37 nav-enemy ((obj nav-enemy)) - (when (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags enable-travel)) - (if (or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf7)) - (logtest? (nav-control-flags navcf19) (-> obj nav flags)) +(defmethod nav-enemy-method-37 nav-enemy ((this nav-enemy)) + (when (logtest? (-> this nav-enemy-flags) (nav-enemy-flags enable-travel)) + (if (or (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf7)) + (logtest? (nav-control-flags navcf19) (-> this nav flags)) ) (seek-to-point-toward-point! - (-> obj collide-info) - (-> obj nav target-pos) - (-> obj rotate-speed) - (-> obj turn-time) + (-> this collide-info) + (-> this nav target-pos) + (-> this rotate-speed) + (-> this turn-time) + ) + (seek-toward-heading-vec! + (-> this collide-info) + (-> this nav travel) + (-> this rotate-speed) + (-> this turn-time) ) - (seek-toward-heading-vec! (-> obj collide-info) (-> obj nav travel) (-> obj rotate-speed) (-> obj turn-time)) ) ) 0 (none) ) -(defmethod nav-enemy-method-38 nav-enemy ((obj nav-enemy)) - (if (-> obj nav-info move-to-ground) +(defmethod nav-enemy-method-38 nav-enemy ((this nav-enemy)) + (if (-> this nav-info move-to-ground) (integrate-for-enemy-with-move-to-ground! - (-> obj collide-info) - (-> obj collide-info transv) - (-> obj nav-info gnd-collide-with) + (-> this collide-info) + (-> this collide-info transv) + (-> this nav-info gnd-collide-with) 8192.0 #f - (-> obj nav-info hover-if-no-ground) - (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf15)) + (-> this nav-info hover-if-no-ground) + (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf15)) ) - (collide-shape-moving-method-58 (-> obj collide-info) (-> obj collide-info transv)) + (collide-shape-moving-method-58 (-> this collide-info) (-> this collide-info transv)) ) 0 (none) @@ -494,14 +499,14 @@ nav-enemy-default-event-handler ) ) -(defmethod target-in-range? nav-enemy ((obj nav-enemy) (arg0 float)) +(defmethod target-in-range? nav-enemy ((this nav-enemy) (arg0 float)) (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (and (or (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf12))) - (< (vector-vector-distance (target-pos 0) (-> obj collide-info trans)) arg0) + (and (or (not (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf12))) + (< (vector-vector-distance (target-pos 0) (-> this collide-info trans)) arg0) ) (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) ) @@ -512,7 +517,7 @@ nav-enemy-default-event-handler (let ((gp-0 #f)) (cond ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) - (when (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self notice-time) (-> self reaction-time)) (set! gp-0 #t) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) @@ -527,7 +532,7 @@ nav-enemy-default-event-handler ) ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) - (set! (-> self notice-time) (-> *display* base-frame-counter)) + (set-time! (-> self notice-time)) ) ) ) @@ -660,7 +665,7 @@ nav-enemy-default-event-handler ) (set! (-> self collide-info transv y) 65502.96) (ja :num-func num-func-identity :frame-num 0.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self collide-info status) (cshape-moving-flags onsurf onground tsurf)) (until (ja-done? 0) (cond @@ -694,16 +699,14 @@ nav-enemy-default-event-handler (defbehavior nav-enemy-turn-to-face-dir nav-enemy ((arg0 vector) (arg1 float)) (local-vars (v1-16 symbol)) - (let ((s4-0 (-> *display* base-frame-counter))) + (let ((s4-0 (current-time))) (ja :group! (-> self draw art-group data (-> self nav-info turn-anim))) (ja :num-func num-func-identity :frame-num 0.0) (until v1-16 (seek-toward-heading-vec! (-> self collide-info) arg0 (-> self rotate-speed) (-> self turn-time)) (suspend) (ja :num! (loop! 0.75)) - (set! v1-16 - (or (>= (- (-> *display* base-frame-counter) s4-0) (seconds 10)) (nav-enemy-facing-direction? arg0 arg1)) - ) + (set! v1-16 (or (time-elapsed? s4-0 (seconds 10)) (nav-enemy-facing-direction? arg0 arg1))) ) ) (forward-up->quaternion (-> self collide-info quat) arg0 *y-vector*) @@ -723,17 +726,17 @@ nav-enemy-default-event-handler (none) ) -(defmethod run-logic? nav-enemy ((obj nav-enemy)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (and (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance)) - (vector-vector-distance (-> obj collide-info trans) (camera-pos)) +(defmethod run-logic? nav-enemy ((this nav-enemy)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (and (>= (+ (-> *ACTOR-bank* pause-dist) (-> this collide-info pause-adjust-distance)) + (vector-vector-distance (-> this collide-info trans) (camera-pos)) ) - (or (logtest? (-> obj draw status) (draw-status was-drawn)) (!= (-> obj next-state name) 'nav-enemy-idle)) + (or (logtest? (-> this draw status) (draw-status was-drawn)) (!= (-> this next-state name) 'nav-enemy-idle)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) @@ -743,7 +746,7 @@ nav-enemy-default-event-handler :event nav-enemy-default-event-handler :enter (behavior () (nav-enemy-neck-control-inactive) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (-> self nav-info move-to-ground) (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (-> self nav-info gnd-collide-with)) ) @@ -755,7 +758,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn)) ) @@ -780,7 +783,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self nav flags) (the-as nav-control-flags (the-as int (logior (nav-control-flags navcf19) (-> self nav flags)))) ) @@ -796,16 +799,16 @@ nav-enemy-default-event-handler (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn))) - (set! (-> self free-time) (-> *display* base-frame-counter)) + (set-time! (-> self free-time)) ) (if (or (or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 2)) + (time-elapsed? (-> self free-time) (seconds 2)) ) (go-virtual nav-enemy-idle) ) @@ -930,10 +933,10 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (or (or (not *target*) (< (-> self nav-info stop-chase-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -978,7 +981,7 @@ nav-enemy-default-event-handler (if *target* (set! (-> self frustration-point quad) (-> *target* control shadow-pos quad)) ) - (set! (-> self frustration-time) (-> *display* base-frame-counter)) + (set-time! (-> self frustration-time)) 0 (none) ) @@ -1000,8 +1003,8 @@ nav-enemy-default-event-handler :event nav-enemy-default-event-handler :enter (behavior () (nav-enemy-neck-control-look-at) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self free-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) + (set-time! (-> self free-time)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self target-speed) (-> self nav-info run-travel-speed)) (set! (-> self acceleration) (-> self nav-info run-acceleration)) @@ -1023,10 +1026,8 @@ nav-enemy-default-event-handler ) (nav-enemy-reset-frustration) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) - (if (>= (- (-> *display* base-frame-counter) (-> self frustration-time)) - (+ (-> self reaction-time) (-> self nav-info frustration-time)) - ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (time-elapsed? (-> self frustration-time) (+ (-> self reaction-time) (-> self nav-info frustration-time))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) ) (if (or (not (target-in-range? self (-> self nav-info stop-chase-distance))) @@ -1036,12 +1037,12 @@ nav-enemy-default-event-handler ) (cond ((logtest? (nav-control-flags navcf17) (-> self nav flags)) - (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) + (if (time-elapsed? (-> self free-time) (seconds 1)) (go-virtual nav-enemy-patrol) ) ) (else - (set! (-> self free-time) (-> *display* base-frame-counter)) + (set-time! (-> self free-time)) ) ) ) @@ -1064,7 +1065,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let* ((f30-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0))) (gp-1 (the int (+ (lerp-scale 600.0 1800.0 f30-0 32768.0 122880.0) (nav-enemy-rnd-float-range 0.0 30.0)))) ) @@ -1079,7 +1080,7 @@ nav-enemy-default-event-handler (set! (-> self turn-time) (-> self nav-info walk-turn-time)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (go-virtual nav-enemy-patrol) ) @@ -1091,7 +1092,7 @@ nav-enemy-default-event-handler ) ) (logtest? (nav-control-flags navcf17) (-> self nav flags)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) ) (go-virtual nav-enemy-stare) ) @@ -1115,7 +1116,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f0-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0)))) (set! (-> self state-timeout) @@ -1133,20 +1134,18 @@ nav-enemy-default-event-handler (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (go-virtual nav-enemy-patrol) ) (cond ((target-in-range? self (-> self nav-info notice-distance)) - (if (and (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) - (not (nav-enemy-frustrated?)) - ) + (if (and (time-elapsed? (-> self notice-time) (-> self reaction-time)) (not (nav-enemy-frustrated?))) (go-virtual nav-enemy-chase) ) ) (else - (set! (-> self notice-time) (-> *display* base-frame-counter)) + (set-time! (-> self notice-time)) ) ) (when (not (or (and *target* (>= 40960.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) @@ -1159,7 +1158,7 @@ nav-enemy-default-event-handler ) ) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) (go-virtual nav-enemy-give-up) ) ) @@ -1183,12 +1182,12 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (nav-enemy-neck-control-inactive) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (target-in-range? self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) ) @@ -1300,7 +1299,7 @@ nav-enemy-default-event-handler ) ) (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) - (let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self jump-time))))) + (let ((f30-0 (the float (- (current-time) (-> self jump-time))))) (let ((v1-12 (eval-position! (-> self jump-trajectory) f30-0 (new 'stack-no-clear 'vector)))) (set! (-> self collide-info trans quad) (-> v1-12 quad)) ) @@ -1374,7 +1373,7 @@ nav-enemy-default-event-handler ) ) (logclear! (-> self collide-info status) (cshape-moving-flags onsurf onground tsurf)) - (set! (-> self jump-time) (-> *display* base-frame-counter)) + (set-time! (-> self jump-time)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (cond ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) @@ -1396,7 +1395,7 @@ nav-enemy-default-event-handler (ja :num-func num-func-identity :frame-num (ja-aframe arg1 0)) ) ) - (while (< (the float (- (-> *display* base-frame-counter) (-> self jump-time))) (-> self jump-trajectory time)) + (while (< (the float (- (current-time) (-> self jump-time))) (-> self jump-trajectory time)) (suspend) (ja :num! (seek!)) (ja-blend-eval) @@ -1438,7 +1437,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-jump-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (and (-> self nav-info use-jump-blocked) (nav-enemy-method-50 self (-> self event-param-point))) (go-virtual nav-enemy-jump-blocked) ) @@ -1515,7 +1514,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self nav flags) (nav-control-flags navcf19)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info transv quad)) @@ -1527,7 +1526,7 @@ nav-enemy-default-event-handler ) ) :trans (behavior () - (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (if (or (time-elapsed? (-> self state-time) (seconds 0.5)) (logtest? (nav-control-flags navcf19) (-> self nav flags)) ) (go-virtual nav-enemy-chase) @@ -1544,10 +1543,10 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (go (-> self jump-return-state)) ) ) @@ -1572,7 +1571,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) @@ -1585,9 +1584,9 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.1)) (nav-enemy-turn-to-face-point (-> self event-param-point) 910.2222) (let ((gp-0 (nav-enemy-rnd-int-range 0 150)) - (s5-0 (-> *display* base-frame-counter)) + (s5-0 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) + (until (time-elapsed? s5-0 gp-0) (ja :num! (loop! f30-0)) (suspend) ) @@ -1608,7 +1607,7 @@ nav-enemy-default-event-handler 0 ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (nav-enemy-initialize-jump (-> self event-param-point)) (nav-enemy-neck-control-look-at) (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) @@ -1636,56 +1635,56 @@ nav-enemy-default-event-handler ) ) -(defmethod init-defaults! nav-enemy ((obj nav-enemy) (arg0 nav-enemy-info)) - (set! (-> obj rand-gen) (new 'process 'random-generator)) - (set! (-> obj rand-gen seed) (the-as uint #x666edd1e)) - (set! (-> obj mask) (the-as process-mask (logior (process-mask enemy) (-> obj mask)))) - (init-jm! obj arg0) - (if (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) +(defmethod init-defaults! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) + (set! (-> this rand-gen) (new 'process 'random-generator)) + (set! (-> this rand-gen seed) (the-as uint #x666edd1e)) + (set! (-> this mask) (the-as process-mask (logior (process-mask enemy) (-> this mask)))) + (init-jm! this arg0) + (if (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control - (-> obj nav-info shadow-min-y) - (-> obj nav-info shadow-max-y) - (-> obj nav-info shadow-locus-dist) + (-> this nav-info shadow-min-y) + (-> this nav-info shadow-max-y) + (-> this nav-info shadow-locus-dist) (the-as float 17) 245760.0 ) ) - (set! (-> obj draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) + (set! (-> this draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) ) - (set! (-> obj align) (new 'process 'align-control obj)) - (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 16 (-> arg0 nav-nearest-y-threshold))) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj nav gap-event) 'jump) - (nav-control-method-26 (-> obj nav)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj enemy-info) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this nav) (new 'process 'nav-control (-> this collide-info) 16 (-> arg0 nav-nearest-y-threshold))) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this nav gap-event) 'jump) + (nav-control-method-26 (-> this nav)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this enemy-info) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj reaction-time) (nav-enemy-rnd-int-range (seconds 0.1) (seconds 0.8))) - (set! (-> obj speed-scale) 1.0) - (logior! (-> obj nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel navenmf5 navenmf6 navenmf12)) + (set! (-> this reaction-time) (nav-enemy-rnd-int-range (seconds 0.1) (seconds 0.8))) + (set! (-> this speed-scale) 1.0) + (logior! (-> this nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel navenmf5 navenmf6 navenmf12)) 0 (none) ) -(defmethod init-jm! nav-enemy ((obj nav-enemy) (arg0 nav-enemy-info)) - (set! (-> obj nav-info) arg0) - (set! (-> obj rotate-speed) (-> obj nav-info walk-rotate-speed)) - (set! (-> obj turn-time) (-> obj nav-info walk-turn-time)) - (when (and (!= (-> obj nav-info neck-joint) -1) (zero? (-> obj neck))) - (set! (-> obj neck) - (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj (-> obj nav-info neck-joint)) +(defmethod init-jm! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) + (set! (-> this nav-info) arg0) + (set! (-> this rotate-speed) (-> this nav-info walk-rotate-speed)) + (set! (-> this turn-time) (-> this nav-info walk-turn-time)) + (when (and (!= (-> this nav-info neck-joint) -1) (zero? (-> this neck))) + (set! (-> this neck) + (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) this (-> this nav-info neck-joint)) ) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 102400.0) - (set! (-> obj neck ignore-angle) 16384.0) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) ) ) @@ -1708,38 +1707,38 @@ nav-enemy-default-event-handler (none) ) -(defmethod initialize-collision nav-enemy ((obj nav-enemy)) +(defmethod initialize-collision nav-enemy ((this nav-enemy)) 0 (none) ) -(defmethod nav-enemy-method-48 nav-enemy ((obj nav-enemy)) +(defmethod nav-enemy-method-48 nav-enemy ((this nav-enemy)) 0 (none) ) -(defmethod nav-enemy-method-59 nav-enemy ((obj nav-enemy)) - (go (method-of-object obj nav-enemy-idle)) +(defmethod nav-enemy-method-59 nav-enemy ((this nav-enemy)) + (go (method-of-object this nav-enemy-idle)) 0 (none) ) -(defmethod init-from-entity! nav-enemy ((obj nav-enemy) (arg0 entity-actor)) - (initialize-collision obj) - (process-drawable-from-entity! obj arg0) - (nav-enemy-method-48 obj) - (nav-enemy-method-59 obj) +(defmethod init-from-entity! nav-enemy ((this nav-enemy) (arg0 entity-actor)) + (initialize-collision this) + (process-drawable-from-entity! this arg0) + (nav-enemy-method-48 this) + (nav-enemy-method-59 this) 0 (none) ) -(defmethod nav-enemy-method-50 nav-enemy ((obj nav-enemy) (arg0 vector)) +(defmethod nav-enemy-method-50 nav-enemy ((this nav-enemy) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj collide-info trans quad)) - (set! (-> obj collide-info trans quad) (-> arg0 quad)) - (let ((gp-0 (-> obj nav))) + (set! (-> s4-0 quad) (-> this collide-info trans quad)) + (set! (-> this collide-info trans quad) (-> arg0 quad)) + (let ((gp-0 (-> this nav))) (nav-control-method-28 gp-0 (the-as collide-kind -1)) - (set! (-> obj collide-info trans quad) (-> s4-0 quad)) + (set! (-> this collide-info trans quad) (-> s4-0 quad)) (let* ((v1-8 (-> gp-0 mesh origin)) (f0-1 (- (-> arg0 x) (-> v1-8 x))) (f1-2 (- (-> arg0 z) (-> v1-8 z))) diff --git a/goal_src/jak1/engine/common-obs/orb-cache.gc b/goal_src/jak1/engine/common-obs/orb-cache.gc index 1bc0ad3edc..039a4dd1c2 100644 --- a/goal_src/jak1/engine/common-obs/orb-cache.gc +++ b/goal_src/jak1/engine/common-obs/orb-cache.gc @@ -86,29 +86,29 @@ ) ) -(defmethod baseplat-method-22 orb-cache-top ((obj orb-cache-top)) - (if (< 4096.0 (- (-> obj basetrans y) (-> obj root-pos))) - (activate! (-> obj smush) -1.0 60 150 1.0 1.0) - (activate! (-> obj smush) -0.5 60 150 1.0 1.0) +(defmethod baseplat-method-22 orb-cache-top ((this orb-cache-top)) + (if (< 4096.0 (- (-> this basetrans y) (-> this root-pos))) + (activate! (-> this smush) -1.0 60 150 1.0 1.0) + (activate! (-> this smush) -0.5 60 150 1.0 1.0) ) - (set! (-> obj bouncing) #t) - (logclear! (-> obj mask) (process-mask sleep)) + (set! (-> this bouncing) #t) + (logclear! (-> this mask) (process-mask sleep)) 0 (none) ) -(defmethod calculate-pos orb-cache-top ((obj orb-cache-top) (arg0 symbol)) +(defmethod calculate-pos orb-cache-top ((this orb-cache-top) (arg0 symbol)) (let ((f0-0 0.0)) (when arg0 - (set! f0-0 (+ 10240.0 (* 6144.0 (the float (+ (-> obj money) -1))))) + (set! f0-0 (+ 10240.0 (* 6144.0 (the float (+ (-> this money) -1))))) (if (< f0-0 2048.0) (set! f0-0 2048.0) ) ) - (set! (-> obj platform-pos) (+ (-> obj root-pos) f0-0)) + (set! (-> this platform-pos) (+ (-> this root-pos) f0-0)) (let ((f0-2 (+ -6144.0 f0-0))) - (dotimes (v1-5 (-> obj money)) - (set! (-> obj money-pos-list v1-5) (+ (-> obj root-pos) f0-2)) + (dotimes (v1-5 (-> this money)) + (set! (-> this money-pos-list v1-5) (+ (-> this root-pos) f0-2)) (set! f0-2 (+ -6144.0 f0-2)) ) ) @@ -117,19 +117,19 @@ (none) ) -(defmethod pos-logic orb-cache-top ((obj orb-cache-top) (arg0 symbol)) - (dotimes (s4-0 (-> obj money)) - (when (not (handle->process (-> obj money-list s4-0))) - (dotimes (v1-6 (-> obj money)) +(defmethod pos-logic orb-cache-top ((this orb-cache-top) (arg0 symbol)) + (dotimes (s4-0 (-> this money)) + (when (not (handle->process (-> this money-list s4-0))) + (dotimes (v1-6 (-> this money)) (when (< s4-0 v1-6) - (set! (-> obj money-list (+ v1-6 -1)) (-> obj money-list v1-6)) - (set! (-> obj money-pos-actual (+ v1-6 -1)) (-> obj money-pos-actual v1-6)) + (set! (-> this money-list (+ v1-6 -1)) (-> this money-list v1-6)) + (set! (-> this money-pos-actual (+ v1-6 -1)) (-> this money-pos-actual v1-6)) ) ) - (+! (-> obj money) -1) - (calculate-pos obj arg0) + (+! (-> this money) -1) + (calculate-pos this arg0) (+! s4-0 -1) - (let ((v1-15 (-> obj entity extra perm))) + (let ((v1-15 (-> this entity extra perm))) (logior! (-> v1-15 status) (entity-perm-status user-set-from-cstage)) (+! (-> v1-15 user-int16 0) 1) ) @@ -139,16 +139,16 @@ (s5-1 #t) ) (let ((s3-0 #f)) - (let ((f28-0 (- (-> obj basetrans y) (-> obj root-pos))) - (f30-0 (- (-> obj platform-pos) (-> obj root-pos))) + (let ((f28-0 (- (-> this basetrans y) (-> this root-pos))) + (f30-0 (- (-> this platform-pos) (-> this root-pos))) ) - (when (zero? (-> obj money)) + (when (zero? (-> this money)) (set! f30-0 2048.0) (set! s3-0 #t) ) (when (and (< f30-0 15155.2) - (and *target* (>= 16384.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))) - (< (-> (target-pos 0) y) (-> obj basetrans y)) + (and *target* (>= 16384.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans)))) + (< (-> (target-pos 0) y) (-> this basetrans y)) ) (set! f30-0 (if (< 14131.2 f28-0) 15155.2 @@ -157,28 +157,24 @@ ) (set! s3-0 #f) ) - (seek! (-> obj basetrans y) (+ (-> obj root-pos) f30-0) (* 40960.0 (-> *display* seconds-per-frame))) - (if (not (= (-> obj basetrans y) (+ (-> obj root-pos) f30-0))) + (seek! (-> this basetrans y) (+ (-> this root-pos) f30-0) (* 40960.0 (seconds-per-frame))) + (if (not (= (-> this basetrans y) (+ (-> this root-pos) f30-0))) (set! s5-1 #f) ) ) - (dotimes (s2-0 (-> obj money)) + (dotimes (s2-0 (-> this money)) (set! (-> s4-1 quad) - (-> (the-as process-drawable (handle->process (-> obj money-list s2-0))) root trans quad) + (-> (the-as process-drawable (handle->process (-> this money-list s2-0))) root trans quad) ) - (seek! - (-> obj money-pos-actual s2-0) - (-> obj money-pos-list s2-0) - (* 40960.0 (-> *display* seconds-per-frame)) - ) - (if (not (= (-> obj money-pos-actual s2-0) (-> obj money-pos-list s2-0))) + (seek! (-> this money-pos-actual s2-0) (-> this money-pos-list s2-0) (* 40960.0 (seconds-per-frame))) + (if (not (= (-> this money-pos-actual s2-0) (-> this money-pos-list s2-0))) (set! s5-1 #f) ) - (if (>= (-> obj money-pos-actual s2-0) (+ -8192.0 (-> obj root-pos))) - (set! (-> s4-1 y) (-> obj money-pos-actual s2-0)) - (set! (-> s4-1 y) (+ -8192.0 (-> obj root-pos))) + (if (>= (-> this money-pos-actual s2-0) (+ -8192.0 (-> this root-pos))) + (set! (-> s4-1 y) (-> this money-pos-actual s2-0)) + (set! (-> s4-1 y) (+ -8192.0 (-> this root-pos))) ) - (send-event (handle->process (-> obj money-list s2-0)) 'trans s4-1) + (send-event (handle->process (-> this money-list s2-0)) 'trans s4-1) ) (set! s3-0 (and s5-1 s3-0)) (if s3-0 @@ -279,8 +275,8 @@ :post plat-post ) -(defmethod init-from-entity! orb-cache-top ((obj orb-cache-top) (arg0 entity-actor)) - (let ((a0-1 (-> obj entity))) +(defmethod init-from-entity! orb-cache-top ((this orb-cache-top) (arg0 entity-actor)) + (let ((a0-1 (-> this entity))) (if (when a0-1 (let ((a0-2 (-> a0-1 extra perm task))) (if a0-2 @@ -288,10 +284,10 @@ ) ) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -309,37 +305,37 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *orb-cache-top-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (set! (-> obj money) (res-lump-value (-> obj entity) 'orb-cache-count int :default (the-as uint128 20))) - (set! (-> obj active-distance) 61440.0) - (set! (-> obj inactive-distance) 245760.0) - (set! (-> obj root-pos) (-> obj basetrans y)) - (set! (-> obj platform-pos) (-> obj root-pos)) - (set! (-> obj activated) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *orb-cache-top-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (set! (-> this money) (res-lump-value (-> this entity) 'orb-cache-count int :default (the-as uint128 20))) + (set! (-> this active-distance) 61440.0) + (set! (-> this inactive-distance) 245760.0) + (set! (-> this root-pos) (-> this basetrans y)) + (set! (-> this platform-pos) (-> this root-pos)) + (set! (-> this activated) (the-as symbol - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) ) ) - (let ((v1-39 (-> obj entity extra perm))) + (let ((v1-39 (-> this entity extra perm))) (logior! (-> v1-39 status) (entity-perm-status user-set-from-cstage)) - (set! (-> obj money) (- (-> obj money) (-> v1-39 user-int16 0))) + (set! (-> this money) (- (-> this money) (-> v1-39 user-int16 0))) ) - (dotimes (v1-42 (-> obj money)) - (set! (-> obj money-list v1-42) (the-as handle #f)) + (dotimes (v1-42 (-> this money)) + (set! (-> this money-list v1-42) (the-as handle #f)) ) (cond - ((zero? (-> obj money)) + ((zero? (-> this money)) (go orb-cache-top-complete #t) ) - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go orb-cache-top-activate #t) ) (else diff --git a/goal_src/jak1/engine/common-obs/plat-button.gc b/goal_src/jak1/engine/common-obs/plat-button.gc index 41e3e7e38a..4b48c416ae 100644 --- a/goal_src/jak1/engine/common-obs/plat-button.gc +++ b/goal_src/jak1/engine/common-obs/plat-button.gc @@ -46,12 +46,12 @@ :bounds (static-spherem 0 -1 0 6.6) ) -(defmethod should-teleport? plat-button ((obj plat-button)) +(defmethod should-teleport? plat-button ((this plat-button)) #f ) -(defmethod can-activate? plat-button ((obj plat-button)) - (or (= (-> obj path-pos) 0.0) (and (-> obj bidirectional?) (= (-> obj path-pos) 1.0))) +(defmethod can-activate? plat-button ((this plat-button)) + (or (= (-> this path-pos) 0.0) (and (-> this bidirectional?) (= (-> this path-pos) 1.0))) ) (defstate plat-button-idle (plat-button) @@ -164,12 +164,12 @@ :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (or (= message 'touch) (= message 'attack)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) (set-setting! 'allow-look-around #f 0.0 0) @@ -185,7 +185,7 @@ (rider-trans) (when (-> self go-back-if-lost-player?) (when (or (not *target*) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (and (time-elapsed? (-> self state-time) (seconds 4)) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) @@ -196,7 +196,7 @@ (go-virtual plat-button-move-upward) ) ) - (let ((f0-4 (seek-with-smooth (-> self path-pos) 1.0 (* 0.1 (-> *display* seconds-per-frame)) 0.25 0.001))) + (let ((f0-4 (seek-with-smooth (-> self path-pos) 1.0 (* 0.1 (seconds-per-frame)) 0.25 0.001))) (set! (-> self path-pos) f0-4) (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> self path) gp-0 f0-4 'interp) @@ -234,12 +234,12 @@ :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (or (= message 'touch) (= message 'attack)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) (set-setting! 'allow-look-around #f 0.0 0) @@ -255,7 +255,7 @@ (rider-trans) (when (-> self go-back-if-lost-player?) (when (or (not *target*) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (and (time-elapsed? (-> self state-time) (seconds 4)) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) @@ -266,7 +266,7 @@ (go-virtual plat-button-move-downward) ) ) - (let ((f0-4 (seek-with-smooth (-> self path-pos) 0.0 (* 0.1 (-> *display* seconds-per-frame)) 0.25 0.001))) + (let ((f0-4 (seek-with-smooth (-> self path-pos) 0.0 (* 0.1 (seconds-per-frame)) 0.25 0.001))) (set! (-> self path-pos) f0-4) (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> self path) gp-0 f0-4 'interp) @@ -319,8 +319,8 @@ ) ) -(defmethod plat-button-method-28 plat-button ((obj plat-button)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod plat-button-method-28 plat-button ((this plat-button)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -355,94 +355,94 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) s5-0 ) ) -(defmethod can-target-move? plat-button ((obj plat-button)) +(defmethod can-target-move? plat-button ((this plat-button)) 0 (none) ) -(defmethod plat-button-method-27 plat-button ((obj plat-button)) +(defmethod plat-button-method-27 plat-button ((this plat-button)) (ja-channel-set! 1) (cond - ((can-activate? obj) - (let ((s5-0 (-> obj skel root-channel 0))) + ((can-activate? this) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) ) (else - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) ) ) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (none) ) -(defmethod plat-button-method-31 plat-button ((obj plat-button)) - (initialize-skeleton obj *plat-button-sg* '()) +(defmethod plat-button-method-31 plat-button ((this plat-button)) + (initialize-skeleton this *plat-button-sg* '()) 0 (none) ) -(defmethod plat-button-method-32 plat-button ((obj plat-button)) - (go (method-of-object obj plat-button-idle)) +(defmethod plat-button-method-32 plat-button ((this plat-button)) + (go (method-of-object this plat-button-idle)) 0 (none) ) -(defmethod init-from-entity! plat-button ((obj plat-button) (arg0 entity-actor)) - (set! (-> obj go-back-if-lost-player?) #f) - (set! (-> obj grab-player?) #f) - (set! (-> obj should-grab-player?) #f) - (set! (-> obj trans-off quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) - arg0 - 'trans-offset - 'interp - -1000000000.0 - *null-vector* - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - quad - ) +(defmethod init-from-entity! plat-button ((this plat-button) (arg0 entity-actor)) + (set! (-> this go-back-if-lost-player?) #f) + (set! (-> this grab-player?) #f) + (set! (-> this should-grab-player?) #f) + (set! (-> this trans-off quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) + arg0 + 'trans-offset + 'interp + -1000000000.0 + *null-vector* + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + quad + ) ) - (set! (-> obj bidirectional?) (nonzero? (res-lump-value arg0 'bidirectional uint128))) - (plat-button-method-28 obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (plat-button-method-31 obj) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj spawn-pos quad) (-> obj root-override trans quad)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-pos) 0.0) - (let ((s5-1 (-> obj root-override trans))) - (eval-path-curve! (-> obj path) s5-1 (-> obj path-pos) 'interp) - (vector+! s5-1 s5-1 (-> obj trans-off)) + (set! (-> this bidirectional?) (nonzero? (res-lump-value arg0 'bidirectional uint128))) + (plat-button-method-28 this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (plat-button-method-31 this) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this spawn-pos quad) (-> this root-override trans quad)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-pos) 0.0) + (let ((s5-1 (-> this root-override trans))) + (eval-path-curve! (-> this path) s5-1 (-> this path-pos) 'interp) + (vector+! s5-1 s5-1 (-> this trans-off)) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj allow-auto-kill) #t) - (can-target-move? obj) - (plat-button-method-27 obj) - (plat-button-method-32 obj) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this allow-auto-kill) #t) + (can-target-move? this) + (plat-button-method-27 this) + (plat-button-method-32 this) (none) ) diff --git a/goal_src/jak1/engine/common-obs/plat-eco.gc b/goal_src/jak1/engine/common-obs/plat-eco.gc index a8df940073..ae86644456 100644 --- a/goal_src/jak1/engine/common-obs/plat-eco.gc +++ b/goal_src/jak1/engine/common-obs/plat-eco.gc @@ -203,7 +203,7 @@ ) :trans (behavior () (when (!= (-> self sync-offset-faux) (-> self sync-offset-dest)) - (seek! (-> self sync-offset-faux) (-> self sync-offset-dest) (* 12.0 (-> *display* seconds-per-frame))) + (seek! (-> self sync-offset-faux) (-> self sync-offset-dest) (* 12.0 (seconds-per-frame))) (let* ((f0-7 (the float (-> self sync period))) (f1-3 (+ (-> self sync-offset-faux) f0-7)) ) @@ -214,8 +214,8 @@ ) ) -(defmethod baseplat-method-24 plat-eco ((obj plat-eco)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 plat-eco ((this plat-eco)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -233,56 +233,56 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod get-unlit-skel plat-eco ((obj plat-eco)) +(defmethod get-unlit-skel plat-eco ((this plat-eco)) *plat-eco-unlit-sg* ) -(defmethod get-lit-skel plat-eco ((obj plat-eco)) +(defmethod get-lit-skel plat-eco ((this plat-eco)) *plat-eco-lit-sg* ) -(defmethod init-from-entity! plat-eco ((obj plat-eco) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default -1.0)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (baseplat-method-24 obj) - (process-drawable-from-entity! obj arg0) - (let ((s4-0 (get-unlit-skel obj)) - (s5-1 (get-lit-skel obj)) +(defmethod init-from-entity! plat-eco ((this plat-eco) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (set! (-> this notice-dist) (res-lump-float arg0 'notice-dist :default -1.0)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (baseplat-method-24 this) + (process-drawable-from-entity! this arg0) + (let ((s4-0 (get-unlit-skel this)) + (s5-1 (get-lit-skel this)) ) - (initialize-skeleton obj s4-0 '()) - (setup-lods! (-> obj unlit-look) s4-0 (-> obj draw art-group) (-> obj entity)) - (setup-lods! (-> obj lit-look) s5-1 (-> obj draw art-group) (-> obj entity)) + (initialize-skeleton this s4-0 '()) + (setup-lods! (-> this unlit-look) s4-0 (-> this draw art-group) (-> this entity)) + (setup-lods! (-> this lit-look) s5-1 (-> this draw art-group) (-> this entity)) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (update-transforms! (-> obj root-override)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 107) obj)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (logclear! (-> this mask) (process-mask actor-pause)) + (update-transforms! (-> this root-override)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 107) this)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) - (set! (-> obj sync-offset-dest) (-> obj sync offset)) - (set! (-> obj sync-linear-val) (get-phase-offset (-> obj sync))) - (sync-now! (-> obj sync) (-> obj sync-linear-val)) - (set! (-> obj sync-offset-faux) (-> obj sync offset)) - (set! (-> obj path-pos) (get-current-phase-with-mirror (-> obj sync))) - (eval-path-curve! (-> obj path) (-> obj root-override trans) (-> obj path-pos) 'interp) - (set! (-> obj sound-id) (new-sound-id)) - (baseplat-method-26 obj) - (baseplat-method-21 obj) - (if (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (< (-> obj notice-dist) 0.0) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) + (set! (-> this sync-offset-dest) (-> this sync offset)) + (set! (-> this sync-linear-val) (get-phase-offset (-> this sync))) + (sync-now! (-> this sync) (-> this sync-linear-val)) + (set! (-> this sync-offset-faux) (-> this sync offset)) + (set! (-> this path-pos) (get-current-phase-with-mirror (-> this sync))) + (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (set! (-> this sound-id) (new-sound-id)) + (baseplat-method-26 this) + (baseplat-method-21 this) + (if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (< (-> this notice-dist) 0.0) ) - (go (method-of-object obj plat-path-active) (the-as plat #t)) - (go (method-of-object obj plat-idle)) + (go (method-of-object this plat-path-active) (the-as plat #t)) + (go (method-of-object this plat-idle)) ) (none) ) diff --git a/goal_src/jak1/engine/common-obs/plat.gc b/goal_src/jak1/engine/common-obs/plat.gc index e30b85abc8..b841675b42 100644 --- a/goal_src/jak1/engine/common-obs/plat.gc +++ b/goal_src/jak1/engine/common-obs/plat.gc @@ -89,10 +89,10 @@ :bounds (static-spherem 0 -0.5 0 3.2) ) -(defmethod get-unlit-skel plat ((obj plat)) +(defmethod get-unlit-skel plat ((this plat)) (cond - ((= (-> (if (-> obj entity) - (-> obj entity extra level) + ((= (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name @@ -101,16 +101,16 @@ ) *plat-jungleb-sg* ) - ((or (= (-> (if (-> obj entity) - (-> obj entity extra level) + ((or (= (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name ) 'sunken ) - (= (-> (if (-> obj entity) - (-> obj entity extra level) + (= (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name @@ -126,8 +126,8 @@ ) ) -(defmethod baseplat-method-24 plat ((obj plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 plat ((this plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -145,28 +145,28 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod baseplat-method-26 plat ((obj plat)) +(defmethod baseplat-method-26 plat ((this plat)) 0 (none) ) -(defmethod baseplat-method-25 plat ((obj plat)) - (the-as sparticle-launch-group (when (!= (-> (if (-> obj entity) - (-> obj entity extra level) +(defmethod baseplat-method-25 plat ((this plat)) + (the-as sparticle-launch-group (when (!= (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name ) 'maincave ) - (let ((v0-0 (create-launch-control (-> *part-group-id-table* 107) obj))) - (set! (-> obj part) v0-0) + (let ((v0-0 (create-launch-control (-> *part-group-id-table* 107) this))) + (set! (-> this part) v0-0) v0-0 ) ) @@ -239,48 +239,48 @@ :post plat-post ) -(defmethod init-from-entity! plat ((obj plat) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (baseplat-method-24 obj) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (get-unlit-skel obj) '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (baseplat-method-25 obj) - (load-params! (-> obj sync) obj (the-as uint 0) 0.0 0.15 0.15) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) +(defmethod init-from-entity! plat ((this plat) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (baseplat-method-24 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (get-unlit-skel this) '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (baseplat-method-25 this) + (load-params! (-> this sync) this (the-as uint 0) 0.0 0.15 0.15) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this sound-id) (new-sound-id)) (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) - (set! (-> obj path-pos) 0.0) - (let ((a0-14 obj)) + ((logtest? (-> this path flags) (path-control-flag not-found)) + (set! (-> this path-pos) 0.0) + (let ((a0-14 this)) (baseplat-method-26 a0-14) - (go (method-of-object obj plat-startup) a0-14) + (go (method-of-object this plat-startup) a0-14) ) ) - ((> (-> obj sync period) 0) - (set! (-> obj path-pos) (if (logtest? (-> obj fact options) (fact-options wrap-phase)) - (get-current-phase (-> obj sync)) - (get-current-phase-with-mirror (-> obj sync)) - ) + ((> (-> this sync period) 0) + (set! (-> this path-pos) (if (logtest? (-> this fact options) (fact-options wrap-phase)) + (get-current-phase (-> this sync)) + (get-current-phase-with-mirror (-> this sync)) + ) ) - (eval-path-curve! (-> obj path) (-> obj root-override trans) (-> obj path-pos) 'interp) - (let ((a0-18 obj)) + (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (let ((a0-18 this)) (baseplat-method-26 a0-18) - (go (method-of-object obj plat-startup) a0-18) + (go (method-of-object this plat-startup) a0-18) ) ) (else - (set! (-> obj path-pos) 0.0) - (eval-path-curve! (-> obj path) (-> obj root-override trans) (-> obj path-pos) 'interp) - (let ((a0-20 obj)) + (set! (-> this path-pos) 0.0) + (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (let ((a0-20 this)) (baseplat-method-26 a0-20) - (go (method-of-object obj plat-startup) a0-20) + (go (method-of-object this plat-startup) a0-20) ) ) ) diff --git a/goal_src/jak1/engine/common-obs/process-taskable.gc b/goal_src/jak1/engine/common-obs/process-taskable.gc index 9dfd32d697..292f19be6c 100644 --- a/goal_src/jak1/engine/common-obs/process-taskable.gc +++ b/goal_src/jak1/engine/common-obs/process-taskable.gc @@ -18,8 +18,8 @@ ;; DECOMP BEGINS -(defmethod process-taskable-method-52 process-taskable ((obj process-taskable)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 process-taskable ((this process-taskable)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) (set! (-> a0-1 settings bot-plane w) (- -12288.0)) @@ -32,30 +32,30 @@ (none) ) -(defmethod init! gui-query ((obj gui-query) (arg0 string) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol) (arg5 string)) - (set! (-> obj x-position) arg1) - (set! (-> obj y-position) arg2) - (set! (-> obj message-space) arg3) - (set! (-> obj only-allow-cancel) arg4) - (set! (-> obj message) arg0) - (set! (-> obj decision) 'undecided) - (set! (-> obj no-msg) arg5) +(defmethod init! gui-query ((this gui-query) (arg0 string) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol) (arg5 string)) + (set! (-> this x-position) arg1) + (set! (-> this y-position) arg2) + (set! (-> this message-space) arg3) + (set! (-> this only-allow-cancel) arg4) + (set! (-> this message) arg0) + (set! (-> this decision) 'undecided) + (set! (-> this no-msg) arg5) 0 (none) ) -(defmethod get-response gui-query ((obj gui-query)) +(defmethod get-response gui-query ((this gui-query)) (kill-current-level-hint '() '(sidekick voicebox stinger) 'exit) (level-hint-surpress!) (hide-hud) (when (hud-hidden?) - (when (-> obj message) + (when (-> this message) (let ((a1-2 (new 'stack 'font-context *font-default-matrix* - (-> obj x-position) - (-> obj y-position) + (-> this x-position) + (-> this y-position) 0.0 (font-color default) (font-flags shadow kerning) @@ -63,7 +63,7 @@ ) ) (let ((v1-4 a1-2)) - (set! (-> v1-4 width) (the float (- 512 (-> obj x-position)))) + (set! (-> v1-4 width) (the float (- 512 (-> this x-position)))) ) (let ((v1-5 a1-2)) (set! (-> v1-5 height) (the float 40)) @@ -72,21 +72,21 @@ (set! (-> v1-6 scale) 0.9) ) (set! (-> a1-2 flags) (font-flags shadow kerning middle-vert large)) - (print-game-text (-> obj message) a1-2 #f 128 22) + (print-game-text (-> this message) a1-2 #f 128 22) ) ) ;; og:preserve-this PAL patch here (cond - ((-> obj only-allow-cancel) - (when (-> obj no-msg) + ((-> this only-allow-cancel) + (when (-> this no-msg) (clear *temp-string*) - (format *temp-string* "; = ~S" (-> obj no-msg)) + (format *temp-string* "; = ~S" (-> this no-msg)) (let ((a1-5 (new 'stack 'font-context *font-default-matrix* - (-> obj x-position) - (+ (-> obj y-position) 5 (-> obj message-space)) + (-> this x-position) + (+ (-> this y-position) 5 (-> this message-space)) 0.0 (font-color default) (font-flags shadow kerning) @@ -109,8 +109,8 @@ 'stack 'font-context *font-default-matrix* - (-> obj x-position) - (+ (-> obj y-position) 5 (-> obj message-space)) + (-> this x-position) + (+ (-> this y-position) 5 (-> this message-space)) 0.0 (font-color default) (font-flags shadow kerning) @@ -129,33 +129,33 @@ ) ) (cond - ((!= (-> obj decision) 'undecided) + ((!= (-> this decision) 'undecided) ) - ((and (cpad-pressed? 0 x) (not (-> obj only-allow-cancel))) + ((and (cpad-pressed? 0 x) (not (-> this only-allow-cancel))) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) - (set! (-> obj decision) 'yes) + (set! (-> this decision) 'yes) ) ((cpad-pressed? 0 triangle) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (set! (-> obj decision) 'no) + (set! (-> this decision) 'no) ) ) ) - (-> obj decision) + (-> this decision) ) -(defmethod relocate process-taskable ((obj process-taskable) (arg0 int)) - (the-as process-taskable ((method-of-type process-drawable relocate) obj arg0)) +(defmethod relocate process-taskable ((this process-taskable) (arg0 int)) + (the-as process-taskable ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod process-taskable-method-46 process-taskable ((obj process-taskable)) - (when (nonzero? (-> obj sound-flava)) +(defmethod process-taskable-method-46 process-taskable ((this process-taskable)) + (when (nonzero? (-> this sound-flava)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) - (the-as vector (-> obj root-override root-prim prim-core)) + (the-as vector (-> this root-override root-prim prim-core)) ) ) ) @@ -163,37 +163,37 @@ (cond ;; og:preserve-this s5-1 can be nan on the first frame after something spawns ((less-than-hack (vector-length s5-1) 102400.0) - (when (not (-> obj have-flava)) - (set! (-> obj have-flava) #t) - (set-setting! 'sound-flava #f 20.0 (-> obj sound-flava)) + (when (not (-> this have-flava)) + (set! (-> this have-flava) #t) + (set-setting! 'sound-flava #f 20.0 (-> this sound-flava)) ) ) - ((-> obj have-flava) + ((-> this have-flava) (remove-setting! 'sound-flava) - (set! (-> obj have-flava) #f) + (set! (-> this have-flava) #f) ) ) ) ) - (when (-> obj music) + (when (-> this music) (let ((s5-3 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) - (the-as vector (-> obj root-override root-prim prim-core)) + (the-as vector (-> this root-override root-prim prim-core)) ) ) ) (set! (-> s5-3 y) (* 4.0 (-> s5-3 y))) (cond ((< (vector-length s5-3) 102400.0) - (when (not (-> obj have-music)) - (set! (-> obj have-music) #t) - (set-setting! 'music (-> obj music) 0.0 0) + (when (not (-> this have-music)) + (set! (-> this have-music) #t) + (set-setting! 'music (-> this music) 0.0 0) ) ) - ((-> obj have-music) + ((-> this have-music) (remove-setting! 'music) - (set! (-> obj have-music) #f) + (set! (-> this have-music) #f) ) ) ) @@ -202,29 +202,29 @@ (none) ) -(defmethod get-art-elem process-taskable ((obj process-taskable)) - (the-as art-element (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) +(defmethod get-art-elem process-taskable ((this process-taskable)) + (the-as art-element (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) -(defmethod play-anim! process-taskable ((obj process-taskable) (arg0 symbol)) +(defmethod play-anim! process-taskable ((this process-taskable) (arg0 symbol)) (the-as basic #f) ) -(defmethod process-taskable-method-33 process-taskable ((obj process-taskable)) - (let ((s5-0 (play-anim! obj #f))) +(defmethod process-taskable-method-33 process-taskable ((this process-taskable)) + (let ((s5-0 (play-anim! this #f))) (if (type-type? (-> s5-0 type) spool-anim) - (spool-push *art-control* (-> (the-as spool-anim s5-0) name) 0 obj -99.0) + (spool-push *art-control* (-> (the-as spool-anim s5-0) name) 0 this -99.0) ) ) 0 (none) ) -(defmethod close-anim-file! process-taskable ((obj process-taskable)) - (let* ((gp-0 (play-anim! obj #f)) +(defmethod close-anim-file! process-taskable ((this process-taskable)) + (let* ((gp-0 (play-anim! this #f)) (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) spool-anim)) gp-0 ) @@ -236,39 +236,39 @@ ) ) -(defmethod get-accept-anim process-taskable ((obj process-taskable) (arg0 symbol)) +(defmethod get-accept-anim process-taskable ((this process-taskable) (arg0 symbol)) (the-as spool-anim #f) ) -(defmethod push-accept-anim process-taskable ((obj process-taskable)) - (let ((s5-0 (get-accept-anim obj #f))) +(defmethod push-accept-anim process-taskable ((this process-taskable)) + (let ((s5-0 (get-accept-anim this #f))) (if (type-type? (-> s5-0 type) spool-anim) - (spool-push *art-control* (-> s5-0 name) 0 obj -99.0) + (spool-push *art-control* (-> s5-0 name) 0 this -99.0) ) ) 0 (none) ) -(defmethod get-reject-anim process-taskable ((obj process-taskable) (arg0 symbol)) +(defmethod get-reject-anim process-taskable ((this process-taskable) (arg0 symbol)) (the-as spool-anim #f) ) -(defmethod push-reject-anim process-taskable ((obj process-taskable)) - (let ((s5-0 (get-reject-anim obj #f))) +(defmethod push-reject-anim process-taskable ((this process-taskable)) + (let ((s5-0 (get-reject-anim this #f))) (if (type-type? (-> s5-0 type) spool-anim) - (spool-push *art-control* (-> s5-0 name) 0 obj -99.0) + (spool-push *art-control* (-> s5-0 name) 0 this -99.0) ) ) 0 (none) ) -(defmethod process-taskable-method-38 process-taskable ((obj process-taskable)) - (if (nonzero? (-> obj cell-for-task)) - (go (method-of-object obj give-cell)) +(defmethod process-taskable-method-38 process-taskable ((this process-taskable)) + (if (nonzero? (-> this cell-for-task)) + (go (method-of-object this give-cell)) ) - (go (method-of-object obj release)) + (go (method-of-object this release)) (none) ) @@ -340,10 +340,10 @@ (defstate lose (process-taskable) :virtual #t :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) + (if (and (time-elapsed? (-> self state-time) (seconds 5)) (or (not *target*) (< 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -448,6 +448,7 @@ (the-as (function process-drawable symbol) false-func) ) ) + ;; og:preserve-this (#when PC_PORT (if (= (current-time) *play-anim-time*) (suspend))) (remove-setting! 'music-volume) @@ -627,7 +628,7 @@ (none) ) -(defmethod should-display? process-taskable ((obj process-taskable)) +(defmethod should-display? process-taskable ((this process-taskable)) #t ) @@ -648,7 +649,7 @@ ) (defbehavior process-taskable-hide-enter process-taskable () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((v1-3 (-> self draw shadow-ctrl))) (logior! (-> v1-3 settings flags) (shadow-flags disable-draw)) ) @@ -686,7 +687,7 @@ (process-taskable-hide-exit (= (-> self next-state name) 'hidden)) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (process-entity-status! self (entity-perm-status bit-3) #f) ) (if (or (-> self been-kicked) (should-display? self)) @@ -697,13 +698,13 @@ ) ;; WARN: disable def twice: 4. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod process-taskable-method-50 process-taskable ((obj process-taskable)) +(defmethod process-taskable-method-50 process-taskable ((this process-taskable)) (if *target* (or (not *target*) - (< 245760.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans))) + (< 245760.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans))) ) (< 60397978000.0 - (vector-vector-distance-squared (the-as vector (-> obj root-override root-prim prim-core)) (camera-pos)) + (vector-vector-distance-squared (the-as vector (-> this root-override root-prim prim-core)) (camera-pos)) ) ) ) @@ -716,7 +717,7 @@ (process-taskable-hide-exit (= (-> self next-state name) 'hidden-other)) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (process-entity-status! self (entity-perm-status bit-3) #f) ) (cond @@ -799,7 +800,7 @@ ) ) -(defmethod target-above-threshold? process-taskable ((obj process-taskable)) +(defmethod target-above-threshold? process-taskable ((this process-taskable)) #t ) @@ -848,7 +849,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-taskable-clean-up-after-talking) ) :exit (behavior () @@ -868,7 +869,7 @@ ) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (when (time-elapsed? (-> self state-time) (seconds 0.2)) (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) ) @@ -887,6 +888,7 @@ ) ) (< (-> (target-pos 0) y) (+ 8192.0 (-> self root-override root-prim prim-core world-sphere y))) + ;; og:preserve-this (less-than-hack (vector-vector-distance (target-pos 0) (the-as vector (-> self root-override root-prim prim-core))) 32768.0 ) @@ -970,8 +972,8 @@ ) ) -(defmethod initialize-collision process-taskable ((obj process-taskable) (arg0 int) (arg1 vector)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision process-taskable ((this process-taskable) (arg0 int) (arg1 vector)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -983,76 +985,77 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod process-taskable-method-40 process-taskable ((obj process-taskable) (arg0 object) (arg1 skeleton-group) (arg2 int) (arg3 int) (arg4 vector) (arg5 int)) - (stack-size-set! (-> obj main-thread) 512) - (initialize-collision obj arg2 arg4) - (process-drawable-from-entity! obj (the-as entity-actor arg0)) - (initialize-skeleton obj arg1 '()) - (set! (-> obj shadow-backup) (-> obj draw shadow)) - (logior! (-> obj skel status) (janim-status eye)) +(defmethod process-taskable-method-40 process-taskable ((this process-taskable) (arg0 object) (arg1 skeleton-group) (arg2 int) (arg3 int) (arg4 vector) (arg5 int)) + (stack-size-set! (-> this main-thread) 512) + (initialize-collision this arg2 arg4) + (process-drawable-from-entity! this (the-as entity-actor arg0)) + (initialize-skeleton this arg1 '()) + (set! (-> this shadow-backup) (-> this draw shadow)) + (logior! (-> this skel status) (janim-status eye)) + ;; og:preserve-this (#when PC_PORT - (set! (-> obj skel postbind-function) process-drawable-joint-callback-pc)) - (set! (-> obj root-override pause-adjust-distance) -122880.0) - (set! (-> obj fuel-cell-anim) (fuel-cell-pick-anim obj)) - (set! (-> obj draw origin-joint-index) (the-as uint arg2)) - (set! (-> obj draw shadow-joint-index) (the-as uint arg2)) - (set! (-> obj center-joint-index) arg2) - (set! (-> obj draw-bounds-y-offset) (-> obj draw bounds y)) - (set! (-> obj have-flava) #f) - (set! (-> obj music) #f) - (set! (-> obj have-music) #f) - (set! (-> obj cam-joint-index) arg3) - (set! (-> obj cell-x) (the-as handle #f)) - (set! (-> obj cell-for-task) (game-task none)) - (set! (-> obj camera) (the-as handle #f)) - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (text-id press-to-talk)) - (set! (-> obj last-talk) 0) - (set! (-> obj bounce-away) #t) - (set! (-> obj been-kicked) #f) - (set! (-> obj neck-joint-index) arg5) - (set! (-> obj cur-trans-hook) nothing) - (ambient-control-method-9 (-> obj ambient)) - (set! (-> obj event-hook) (-> (method-of-object obj idle) event)) - (set! (-> obj draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) - (process-taskable-method-52 obj) + (set! (-> this skel postbind-function) process-drawable-joint-callback-pc)) + (set! (-> this root-override pause-adjust-distance) -122880.0) + (set! (-> this fuel-cell-anim) (fuel-cell-pick-anim this)) + (set! (-> this draw origin-joint-index) (the-as uint arg2)) + (set! (-> this draw shadow-joint-index) (the-as uint arg2)) + (set! (-> this center-joint-index) arg2) + (set! (-> this draw-bounds-y-offset) (-> this draw bounds y)) + (set! (-> this have-flava) #f) + (set! (-> this music) #f) + (set! (-> this have-music) #f) + (set! (-> this cam-joint-index) arg3) + (set! (-> this cell-x) (the-as handle #f)) + (set! (-> this cell-for-task) (game-task none)) + (set! (-> this camera) (the-as handle #f)) + (set! (-> this will-talk) #t) + (set! (-> this talk-message) (text-id press-to-talk)) + (set! (-> this last-talk) 0) + (set! (-> this bounce-away) #t) + (set! (-> this been-kicked) #f) + (set! (-> this neck-joint-index) arg5) + (set! (-> this cur-trans-hook) nothing) + (ambient-control-method-9 (-> this ambient)) + (set! (-> this event-hook) (-> (method-of-object this idle) event)) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) + (process-taskable-method-52 this) 0 (none) ) -(defmethod process-taskable-method-42 process-taskable ((obj process-taskable)) +(defmethod process-taskable-method-42 process-taskable ((this process-taskable)) (cond - ((not (should-display? obj)) - (go (method-of-object obj hidden)) + ((not (should-display? this)) + (go (method-of-object this hidden)) ) - ((= (current-status (-> obj tasks)) (task-status need-resolution)) - (go (method-of-object obj give-cell)) + ((= (current-status (-> this tasks)) (task-status need-resolution)) + (go (method-of-object this give-cell)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) ) -(defmethod process-taskable-method-43 process-taskable ((obj process-taskable)) +(defmethod process-taskable-method-43 process-taskable ((this process-taskable)) (the-as symbol 0) ) -(defmethod ambient-control-method-9 ambient-control ((obj ambient-control)) - (set! (-> obj last-ambient-time) (-> *display* game-frame-counter)) +(defmethod ambient-control-method-9 ambient-control ((this ambient-control)) + (set! (-> this last-ambient-time) (-> *display* game-frame-counter)) 0 (none) ) -(defmethod ambient-control-method-10 ambient-control ((obj ambient-control) (arg0 vector) (arg1 time-frame) (arg2 float) (arg3 process-drawable)) - (when (< (- (-> *display* game-frame-counter) (-> obj last-ambient-time)) arg1) +(defmethod ambient-control-method-10 ambient-control ((this ambient-control) (arg0 vector) (arg1 time-frame) (arg2 float) (arg3 process-drawable)) + (when (< (- (-> *display* game-frame-counter) (-> this last-ambient-time)) arg1) (set! arg0 (the-as vector #f)) (goto cfg-6) ) @@ -1065,14 +1068,14 @@ arg0 ) -(defmethod play-ambient ambient-control ((obj ambient-control) (arg0 string) (arg1 symbol) (arg2 vector)) - (when (and (not (string= arg0 (-> obj last-ambient))) +(defmethod play-ambient ambient-control ((this ambient-control) (arg0 string) (arg1 symbol) (arg2 vector)) + (when (and (not (string= arg0 (-> this last-ambient))) (or arg1 (can-hint-be-played? (text-id one) (the-as entity #f) (the-as string #f))) (= (-> *level* loading-level) (-> *level* level-default)) (ambient-hint-spawn arg0 arg2 *entity-pool* 'ambient) ) - (set! (-> obj last-ambient-time) (-> *display* game-frame-counter)) - (set! (-> obj last-ambient) arg0) + (set! (-> this last-ambient-time) (-> *display* game-frame-counter)) + (set! (-> this last-ambient) arg0) (return #t) ) #f @@ -1213,8 +1216,8 @@ (suspend) (let ((a0-25 (-> self hand process 0))) (when (or (-> self die?) (and (not (-> self survive-anim-end?)) (ja-anim-done? a0-25))) - (let ((gp-1 (-> *display* base-frame-counter))) - (while (and (< (- (-> *display* base-frame-counter) gp-1) (seconds 60)) + (let ((gp-1 (current-time))) + (while (and (not (time-elapsed? gp-1 (seconds 60))) (or (and (-> self entity) (not (is-object-visible? (-> self entity extra level) (-> self entity extra vis-id)))) (< 81920.0 (vector-vector-distance (camera-pos) (-> *math-camera* trans))) ) @@ -1251,14 +1254,14 @@ (none) ) -(defmethod draw-npc-shadow process-taskable ((obj process-taskable)) - (let ((gp-0 (-> obj draw shadow-ctrl))) +(defmethod draw-npc-shadow process-taskable ((this process-taskable)) + (let ((gp-0 (-> this draw shadow-ctrl))) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (collide-to-find-planes gp-0 (-> obj draw origin) -4096.0 4096.0 32768.0) + (collide-to-find-planes gp-0 (-> this draw origin) -4096.0 4096.0 32768.0) (update-direction-from-time-of-day gp-0) ) (else diff --git a/goal_src/jak1/engine/common-obs/rigid-body.gc b/goal_src/jak1/engine/common-obs/rigid-body.gc index 390da65635..bfd3c0e873 100644 --- a/goal_src/jak1/engine/common-obs/rigid-body.gc +++ b/goal_src/jak1/engine/common-obs/rigid-body.gc @@ -8,55 +8,55 @@ ;; DECOMP BEGINS -(defmethod clear-force-torque! rigid-body ((obj rigid-body)) - (set! (-> obj force quad) (-> *null-vector* quad)) - (set! (-> obj torque quad) (-> *null-vector* quad)) +(defmethod clear-force-torque! rigid-body ((this rigid-body)) + (set! (-> this force quad) (-> *null-vector* quad)) + (set! (-> this torque quad) (-> *null-vector* quad)) 0 (none) ) -(defmethod clear-momentum! rigid-body ((obj rigid-body)) - (set! (-> obj lin-momentum quad) (-> *null-vector* quad)) - (set! (-> obj ang-momentum quad) (-> *null-vector* quad)) +(defmethod clear-momentum! rigid-body ((this rigid-body)) + (set! (-> this lin-momentum quad) (-> *null-vector* quad)) + (set! (-> this ang-momentum quad) (-> *null-vector* quad)) 0 (none) ) -(defmethod rigid-body-method-21 rigid-body ((obj rigid-body)) - (quaternion->matrix (-> obj matrix) (-> obj rotation)) - (rigid-body-method-18 obj (-> obj matrix vector 3)) +(defmethod rigid-body-method-21 rigid-body ((this rigid-body)) + (quaternion->matrix (-> this matrix) (-> this rotation)) + (rigid-body-method-18 this (-> this matrix vector 3)) 0 (none) ) -(defmethod rigid-body-method-22 rigid-body ((obj rigid-body) (arg0 vector) (arg1 quaternion) (arg2 float) (arg3 float)) - (clear-force-torque! obj) - (clear-momentum! obj) - (vector+! (-> obj position) arg0 (-> obj cm-offset-joint)) - (quaternion-copy! (-> obj rotation) arg1) - (quaternion-normalize! (-> obj rotation)) - (set! (-> obj lin-momentum-damping-factor) arg2) - (set! (-> obj ang-momentum-damping-factor) arg3) - (rigid-body-method-21 obj) - (set! (-> obj lin-velocity quad) (-> *null-vector* quad)) - (set! (-> obj ang-velocity quad) (-> *null-vector* quad)) - (set! (-> obj inv-i-world vector 0 quad) (the-as uint128 0)) - (set! (-> obj inv-i-world vector 1 quad) (the-as uint128 0)) - (set! (-> obj inv-i-world vector 2 quad) (the-as uint128 0)) - (set! (-> obj inv-i-world vector 3 quad) (the-as uint128 0)) - (set! (-> obj max-ang-velocity) 0.0) - (set! (-> obj max-ang-momentum) 0.0) +(defmethod rigid-body-method-22 rigid-body ((this rigid-body) (arg0 vector) (arg1 quaternion) (arg2 float) (arg3 float)) + (clear-force-torque! this) + (clear-momentum! this) + (vector+! (-> this position) arg0 (-> this cm-offset-joint)) + (quaternion-copy! (-> this rotation) arg1) + (quaternion-normalize! (-> this rotation)) + (set! (-> this lin-momentum-damping-factor) arg2) + (set! (-> this ang-momentum-damping-factor) arg3) + (rigid-body-method-21 this) + (set! (-> this lin-velocity quad) (-> *null-vector* quad)) + (set! (-> this ang-velocity quad) (-> *null-vector* quad)) + (set! (-> this inv-i-world vector 0 quad) (the-as uint128 0)) + (set! (-> this inv-i-world vector 1 quad) (the-as uint128 0)) + (set! (-> this inv-i-world vector 2 quad) (the-as uint128 0)) + (set! (-> this inv-i-world vector 3 quad) (the-as uint128 0)) + (set! (-> this max-ang-velocity) 0.0) + (set! (-> this max-ang-momentum) 0.0) 0 (none) ) -(defmethod rigid-body-method-9 rigid-body ((obj rigid-body) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (set! (-> obj mass) arg0) +(defmethod rigid-body-method-9 rigid-body ((this rigid-body) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> this mass) arg0) (let ((f0-1 arg0)) - (set! (-> obj inv-mass) (/ 1.0 f0-1)) + (set! (-> this inv-mass) (/ 1.0 f0-1)) ) - (matrix-identity! (-> obj inertial-tensor)) - (matrix-identity! (-> obj inv-inertial-tensor)) + (matrix-identity! (-> this inertial-tensor)) + (matrix-identity! (-> this inv-inertial-tensor)) (let* ((f0-4 arg0) (f1-1 12.0) (f0-5 (* f0-4 (/ 1.0 f1-1))) @@ -65,39 +65,39 @@ (f1-6 (* f1-4 f1-4)) (f2-1 arg3) ) - (set! (-> obj inertial-tensor vector 0 x) (* f0-5 (+ f1-6 (* f2-1 f2-1)))) + (set! (-> this inertial-tensor vector 0 x) (* f0-5 (+ f1-6 (* f2-1 f2-1)))) ) (let* ((f1-9 arg1) (f1-11 (* f1-9 f1-9)) (f2-4 arg3) ) - (set! (-> obj inertial-tensor vector 1 y) (* f0-5 (+ f1-11 (* f2-4 f2-4)))) + (set! (-> this inertial-tensor vector 1 y) (* f0-5 (+ f1-11 (* f2-4 f2-4)))) ) (let* ((f1-14 arg1) (f1-16 (* f1-14 f1-14)) (f2-7 arg2) ) - (set! (-> obj inertial-tensor vector 2 z) (* f0-5 (+ f1-16 (* f2-7 f2-7)))) + (set! (-> this inertial-tensor vector 2 z) (* f0-5 (+ f1-16 (* f2-7 f2-7)))) ) ) - (let ((f0-7 (-> obj inertial-tensor vector 0 x))) - (set! (-> obj inv-inertial-tensor vector 0 x) (/ 1.0 f0-7)) + (let ((f0-7 (-> this inertial-tensor vector 0 x))) + (set! (-> this inv-inertial-tensor vector 0 x) (/ 1.0 f0-7)) ) - (let ((f0-10 (-> obj inertial-tensor vector 1 y))) - (set! (-> obj inv-inertial-tensor vector 1 y) (/ 1.0 f0-10)) + (let ((f0-10 (-> this inertial-tensor vector 1 y))) + (set! (-> this inv-inertial-tensor vector 1 y) (/ 1.0 f0-10)) ) - (let ((f0-13 (-> obj inertial-tensor vector 2 z))) - (set! (-> obj inv-inertial-tensor vector 2 z) (/ 1.0 f0-13)) + (let ((f0-13 (-> this inertial-tensor vector 2 z))) + (set! (-> this inv-inertial-tensor vector 2 z) (/ 1.0 f0-13)) ) 0 (none) ) -(defmethod rigid-body-method-17 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) - (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj position)))) - (vector-cross! arg1 (-> obj ang-velocity) v1-1) +(defmethod rigid-body-method-17 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position)))) + (vector-cross! arg1 (-> this ang-velocity) v1-1) ) - (vector+! arg1 arg1 (-> obj lin-velocity)) + (vector+! arg1 arg1 (-> this lin-velocity)) arg1 ) @@ -120,47 +120,47 @@ arg0 ) -(defmethod rigid-body-method-10 rigid-body ((obj rigid-body) (arg0 float)) - (vector+*! (-> obj lin-momentum) (-> obj lin-momentum) (-> obj force) arg0) - (vector+*! (-> obj ang-momentum) (-> obj ang-momentum) (-> obj torque) arg0) - (vector-float*! (-> obj lin-momentum) (-> obj lin-momentum) (-> obj lin-momentum-damping-factor)) - (vector-float*! (-> obj ang-momentum) (-> obj ang-momentum) (-> obj ang-momentum-damping-factor)) - (vector-float*! (-> obj lin-velocity) (-> obj lin-momentum) (-> obj inv-mass)) - (set! (-> obj matrix vector 3 quad) (-> *null-vector* quad)) - (matrix-3x3-triple-transpose-product (-> obj inv-i-world) (-> obj matrix) (-> obj inv-inertial-tensor)) - (vector-rotate*! (-> obj ang-velocity) (-> obj ang-momentum) (-> obj inv-i-world)) - (vector+*! (-> obj position) (-> obj position) (-> obj lin-velocity) arg0) +(defmethod rigid-body-method-10 rigid-body ((this rigid-body) (arg0 float)) + (vector+*! (-> this lin-momentum) (-> this lin-momentum) (-> this force) arg0) + (vector+*! (-> this ang-momentum) (-> this ang-momentum) (-> this torque) arg0) + (vector-float*! (-> this lin-momentum) (-> this lin-momentum) (-> this lin-momentum-damping-factor)) + (vector-float*! (-> this ang-momentum) (-> this ang-momentum) (-> this ang-momentum-damping-factor)) + (vector-float*! (-> this lin-velocity) (-> this lin-momentum) (-> this inv-mass)) + (set! (-> this matrix vector 3 quad) (-> *null-vector* quad)) + (matrix-3x3-triple-transpose-product (-> this inv-i-world) (-> this matrix) (-> this inv-inertial-tensor)) + (vector-rotate*! (-> this ang-velocity) (-> this ang-momentum) (-> this inv-i-world)) + (vector+*! (-> this position) (-> this position) (-> this lin-velocity) arg0) (let ((s4-0 (new 'stack-no-clear 'quaternion))) - (set! (-> (the-as vector (&-> s4-0 x)) quad) (-> obj ang-velocity quad)) + (set! (-> (the-as vector (&-> s4-0 x)) quad) (-> this ang-velocity quad)) (set! (-> s4-0 w) 0.0) - (quaternion*! s4-0 s4-0 (-> obj rotation)) + (quaternion*! s4-0 s4-0 (-> this rotation)) (quaternion-float*! s4-0 s4-0 0.5) - (+! (-> obj rotation x) (* (-> s4-0 x) arg0)) - (+! (-> obj rotation y) (* (-> s4-0 y) arg0)) - (+! (-> obj rotation z) (* (-> s4-0 z) arg0)) - (+! (-> obj rotation w) (* (-> s4-0 w) arg0)) + (+! (-> this rotation x) (* (-> s4-0 x) arg0)) + (+! (-> this rotation y) (* (-> s4-0 y) arg0)) + (+! (-> this rotation z) (* (-> s4-0 z) arg0)) + (+! (-> this rotation w) (* (-> s4-0 w) arg0)) ) - (quaternion-normalize! (-> obj rotation)) - (quaternion->matrix (-> obj matrix) (-> obj rotation)) - (rigid-body-method-18 obj (-> obj matrix vector 3)) + (quaternion-normalize! (-> this rotation)) + (quaternion->matrix (-> this matrix) (-> this rotation)) + (rigid-body-method-18 this (-> this matrix vector 3)) 0 (none) ) -(defmethod rigid-body-method-13 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) - (vector+! (-> obj force) (-> obj force) arg1) - (let* ((v1-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj position))) +(defmethod rigid-body-method-13 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) + (vector+! (-> this force) (-> this force) arg1) + (let* ((v1-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (a1-2 (vector-cross! (new 'stack-no-clear 'vector) v1-2 arg1)) ) - (vector+! (-> obj torque) (-> obj torque) a1-2) + (vector+! (-> this torque) (-> this torque) a1-2) ) 0 (none) ) -(defmethod rigid-body-method-16 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) - (vector+! (-> obj force) (-> obj force) arg1) - (let* ((a0-3 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj position))) +(defmethod rigid-body-method-16 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) + (vector+! (-> this force) (-> this force) arg1) + (let* ((a0-3 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (s4-1 (vector-cross! (new 'stack-no-clear 'vector) a0-3 arg1)) ) (let ((f0-0 (vector-length a0-3))) @@ -168,62 +168,62 @@ (vector-float*! s4-1 s4-1 (/ arg2 f0-0)) ) ) - (vector+! (-> obj torque) (-> obj torque) s4-1) + (vector+! (-> this torque) (-> this torque) s4-1) ) 0 (none) ) -(defmethod rigid-body-method-14 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-14 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector-rotate*! s4-0 arg1 (-> obj matrix)) - (vector-rotate*! s5-0 arg0 (-> obj matrix)) - (vector+! s5-0 s5-0 (-> obj position)) - (rigid-body-method-13 obj s5-0 s4-0) + (vector-rotate*! s4-0 arg1 (-> this matrix)) + (vector-rotate*! s5-0 arg0 (-> this matrix)) + (vector+! s5-0 s5-0 (-> this position)) + (rigid-body-method-13 this s5-0 s4-0) ) 0 (none) ) -(defmethod rigid-body-method-15 rigid-body ((obj rigid-body) (arg0 vector)) - (vector+! (-> obj force) (-> obj force) arg0) +(defmethod rigid-body-method-15 rigid-body ((this rigid-body) (arg0 vector)) + (vector+! (-> this force) (-> this force) arg0) 0 (none) ) -(defmethod rigid-body-method-18 rigid-body ((obj rigid-body) (arg0 vector)) +(defmethod rigid-body-method-18 rigid-body ((this rigid-body) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-rotate*! gp-0 (-> obj cm-offset-joint) (-> obj matrix)) - (vector-! arg0 (-> obj position) gp-0) + (vector-rotate*! gp-0 (-> this cm-offset-joint) (-> this matrix)) + (vector-! arg0 (-> this position) gp-0) ) arg0 ) -(defmethod print-stats rigid-body ((obj rigid-body)) - (format #t " force ~M ~M ~M" (-> obj force x) (-> obj force y) (-> obj force z)) - (format #t " torque ~f ~f ~f~%" (-> obj torque x) (-> obj torque y) (-> obj torque z)) - (format #t " position ~M ~M ~M" (-> obj position x) (-> obj position y) (-> obj position z)) +(defmethod print-stats rigid-body ((this rigid-body)) + (format #t " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) + (format #t " torque ~f ~f ~f~%" (-> this torque x) (-> this torque y) (-> this torque z)) + (format #t " position ~M ~M ~M" (-> this position x) (-> this position y) (-> this position z)) (format #t " rotation ~f ~f ~f ~f~%" - (-> obj rotation x) - (-> obj rotation y) - (-> obj rotation z) - (-> obj rotation w) + (-> this rotation x) + (-> this rotation y) + (-> this rotation z) + (-> this rotation w) ) - (format #t " lin-mom ~M ~M ~M" (-> obj lin-momentum x) (-> obj lin-momentum y) (-> obj lin-momentum z)) - (format #t " ang-mom ~f ~f ~f~%" (-> obj ang-momentum x) (-> obj ang-momentum y) (-> obj ang-momentum z)) - (format #t " lin-vel ~M ~M ~M" (-> obj lin-velocity x) (-> obj lin-velocity y) (-> obj lin-velocity z)) - (format #t " ang-vel ~f ~f ~f~%" (-> obj ang-velocity x) (-> obj ang-velocity y) (-> obj ang-velocity z)) + (format #t " lin-mom ~M ~M ~M" (-> this lin-momentum x) (-> this lin-momentum y) (-> this lin-momentum z)) + (format #t " ang-mom ~f ~f ~f~%" (-> this ang-momentum x) (-> this ang-momentum y) (-> this ang-momentum z)) + (format #t " lin-vel ~M ~M ~M" (-> this lin-velocity x) (-> this lin-velocity y) (-> this lin-velocity z)) + (format #t " ang-vel ~f ~f ~f~%" (-> this ang-velocity x) (-> this ang-velocity y) (-> this ang-velocity z)) 0 (none) ) -(defmethod rigid-body-method-20 rigid-body ((obj rigid-body)) - (format #t " force ~M ~M ~M" (-> obj force x) (-> obj force y) (-> obj force z)) - (format #t " torque ~f ~f ~f~%" (-> obj torque x) (-> obj torque y) (-> obj torque z)) +(defmethod rigid-body-method-20 rigid-body ((this rigid-body)) + (format #t " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) + (format #t " torque ~f ~f ~f~%" (-> this torque x) (-> this torque y) (-> this torque z)) 0 (none) ) @@ -313,23 +313,23 @@ ) -(defmethod relocate rigid-body-platform ((obj rigid-body-platform) (arg0 int)) - (if (nonzero? (-> obj control-point-array)) - (set! (-> obj control-point-array) - (the-as rigid-body-control-point-inline-array (+ (the-as int (-> obj control-point-array)) arg0)) +(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)) - obj + this arg0 ) ) ) -(defmethod rigid-body-platform-method-22 rigid-body-platform ((obj rigid-body-platform) (arg0 vector) (arg1 float)) - (let ((v1-0 (-> obj water-anim))) +(defmethod rigid-body-platform-method-22 rigid-body-platform ((this rigid-body-platform) (arg0 vector) (arg1 float)) + (let ((v1-0 (-> this water-anim))) 0.0 (+ (the-as float (cond (v1-0 @@ -350,28 +350,28 @@ ) ) ) - (-> obj float-height-offset) + (-> this float-height-offset) ) ) ) -(defmethod rigid-body-platform-method-24 rigid-body-platform ((obj rigid-body-platform) (arg0 rigid-body-control-point) (arg1 float)) - (set! (-> arg0 world-pos w) (rigid-body-platform-method-22 obj (-> arg0 world-pos) arg1)) +(defmethod rigid-body-platform-method-24 rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-control-point) (arg1 float)) + (set! (-> arg0 world-pos w) (rigid-body-platform-method-22 this (-> arg0 world-pos) arg1)) (let* ((s4-0 (new 'stack-no-clear 'vector)) (f0-2 (- (-> arg0 world-pos w) (-> arg0 world-pos y))) - (f30-0 (/ f0-2 (-> obj info max-buoyancy-depth))) + (f30-0 (/ f0-2 (-> this info max-buoyancy-depth))) ) (when (< 0.0 f0-2) - (vector-float*! s4-0 *y-vector* (* (-> obj rbody mass) + (vector-float*! s4-0 *y-vector* (* (-> this rbody mass) (fmin 1.0 f30-0) - (/ (-> obj info gravity) (the float (-> obj info control-point-count))) - (-> obj info gravity-factor) - (-> obj info buoyancy-factor) + (/ (-> this info gravity) (the float (-> this info control-point-count))) + (-> this info gravity-factor) + (-> this info buoyancy-factor) ) ) - (rigid-body-method-13 (-> obj rbody) (-> arg0 world-pos) s4-0) - (vector-float*! s4-0 (-> arg0 velocity) (* -1.0 (-> obj info drag-factor) (fmin 1.0 f30-0))) - (rigid-body-method-13 (-> obj rbody) (-> arg0 world-pos) s4-0) + (rigid-body-method-13 (-> this rbody) (-> arg0 world-pos) s4-0) + (vector-float*! s4-0 (-> arg0 velocity) (* -1.0 (-> this info drag-factor) (fmin 1.0 f30-0))) + (rigid-body-method-13 (-> this rbody) (-> arg0 world-pos) s4-0) ) ) 0 @@ -379,43 +379,43 @@ (none) ) -(defmethod rigid-body-platform-method-25 rigid-body-platform ((obj rigid-body-platform)) - (when (or (-> obj player-impulse) (-> obj player-contact)) - (set! (-> obj player-impulse) #f) +(defmethod rigid-body-platform-method-25 rigid-body-platform ((this rigid-body-platform)) + (when (or (-> this player-impulse) (-> this player-contact)) + (set! (-> this player-impulse) #f) (rigid-body-method-16 - (-> obj rbody) - (-> obj player-force-position) - (-> obj player-force) - (-> obj info player-force-distance) + (-> this rbody) + (-> this player-force-position) + (-> this player-force) + (-> this info player-force-distance) ) ) 0 (none) ) -(defmethod rigid-body-platform-method-26 rigid-body-platform ((obj rigid-body-platform)) +(defmethod rigid-body-platform-method-26 rigid-body-platform ((this rigid-body-platform)) (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-float*! a1-0 *y-vector* - (* -1.0 (-> obj info gravity-factor) (-> obj info gravity) (-> obj rbody mass)) + (* -1.0 (-> this info gravity-factor) (-> this info gravity) (-> this rbody mass)) ) - (rigid-body-method-15 (-> obj rbody) a1-0) + (rigid-body-method-15 (-> this rbody) a1-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-27 rigid-body-platform ((obj rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-27 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 arg0 (-> obj rbody position)) + (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) (let* ((f0-1 (vector-length gp-0)) (f1-1 (* 10.0 (fmax 0.0 (fmin 4096.0 (+ -4096.0 f0-1))))) ) (when (< 0.0 f1-1) (vector-float*! gp-0 gp-0 (/ f1-1 f0-1)) - (rigid-body-method-15 (-> obj rbody) gp-0) + (rigid-body-method-15 (-> this rbody) gp-0) ) ) ) @@ -423,45 +423,45 @@ (none) ) -(defmethod rigid-body-platform-method-23 rigid-body-platform ((obj rigid-body-platform) (arg0 float)) - (let ((s4-0 (-> obj rbody matrix))) - (dotimes (s3-0 (-> obj info control-point-count)) - (let ((s2-0 (-> obj control-point-array data s3-0))) +(defmethod rigid-body-platform-method-23 rigid-body-platform ((this rigid-body-platform) (arg0 float)) + (let ((s4-0 (-> this rbody matrix))) + (dotimes (s3-0 (-> this info control-point-count)) + (let ((s2-0 (-> this control-point-array data s3-0))) (vector-matrix*! (-> s2-0 world-pos) (-> s2-0 local-pos) s4-0) - (rigid-body-method-17 (-> obj rbody) (-> s2-0 world-pos) (-> s2-0 velocity)) - (rigid-body-platform-method-24 obj s2-0 arg0) + (rigid-body-method-17 (-> this rbody) (-> s2-0 world-pos) (-> s2-0 velocity)) + (rigid-body-platform-method-24 this s2-0 arg0) ) ) ) - (rigid-body-platform-method-26 obj) - (rigid-body-platform-method-25 obj) + (rigid-body-platform-method-26 this) + (rigid-body-platform-method-25 this) 0 (none) ) -(defmethod rigid-body-platform-method-28 rigid-body-platform ((obj rigid-body-platform)) - (if (-> obj info platform) - (detect-riders! (-> obj root-overlay)) +(defmethod rigid-body-platform-method-28 rigid-body-platform ((this rigid-body-platform)) + (if (-> this info platform) + (detect-riders! (-> this root-overlay)) ) - (set! (-> obj player-velocity-prev quad) (-> obj player-velocity quad)) + (set! (-> this player-velocity-prev quad) (-> this player-velocity quad)) (if *target* - (set! (-> obj player-velocity quad) (-> *target* control transv quad)) - (set! (-> obj player-velocity quad) (-> *null-vector* quad)) + (set! (-> this player-velocity quad) (-> *target* control transv quad)) + (set! (-> this player-velocity quad) (-> *null-vector* quad)) ) - (+! (-> obj sim-time-remaining) - (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) + (+! (-> this sim-time-remaining) + (* 0.0033333334 (the float (- (current-time) (-> *display* old-base-frame-counter)))) ) (let ((f30-0 (* DISPLAY_FPS_RATIO 0.016666668)) ;; og:preserve-this changed for high fps (f28-0 (* 0.0033333334 (the float (logand #xffffff (-> *display* base-frame-counter))))) ) - (while (>= (-> obj sim-time-remaining) (* 0.5 f30-0)) - (clear-force-torque! (-> obj rbody)) - (rigid-body-platform-method-23 obj f28-0) - (rigid-body-method-10 (-> obj rbody) f30-0) - (set! (-> obj sim-time-remaining) (- (-> obj sim-time-remaining) f30-0)) + (while (>= (-> this sim-time-remaining) (* 0.5 f30-0)) + (clear-force-torque! (-> this rbody)) + (rigid-body-platform-method-23 this f28-0) + (rigid-body-method-10 (-> this rbody) f30-0) + (set! (-> this sim-time-remaining) (- (-> this sim-time-remaining) f30-0)) ) ) - (set! (-> obj player-contact) #f) + (set! (-> this player-contact) #f) 0 (none) ) @@ -469,8 +469,8 @@ (defbehavior rigid-body-platform-event-handler rigid-body-platform ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('bonk) - (when (>= (- (-> *display* base-frame-counter) (-> self player-bonk-timeout)) (-> self info player-force-timeout)) - (set! (-> self player-bonk-timeout) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self player-bonk-timeout) (-> self info player-force-timeout)) + (set-time! (-> self player-bonk-timeout)) (let* ((s5-0 arg0) (v1-7 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) s5-0 @@ -502,8 +502,8 @@ (set! (-> self player-attack-id) (the-as int v1-16)) (cond ((= (-> arg3 param 1) 'flop) - (when (>= (- (-> *display* base-frame-counter) (-> self player-bonk-timeout)) (-> self info player-force-timeout)) - (set! (-> self player-bonk-timeout) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self player-bonk-timeout) (-> self info player-force-timeout)) + (set-time! (-> self player-bonk-timeout)) (let* ((gp-1 arg0) (v1-24 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) process-drawable)) gp-1 @@ -649,47 +649,47 @@ :post rigid-body-platform-post ) -(defmethod rigid-body-platform-method-29 rigid-body-platform ((obj rigid-body-platform) (arg0 rigid-body-platform-constants)) - (set! (-> obj info) arg0) - (set! (-> obj control-point-array) - (new 'process 'rigid-body-control-point-inline-array (-> obj info control-point-count)) +(defmethod rigid-body-platform-method-29 rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-platform-constants)) + (set! (-> this info) arg0) + (set! (-> this control-point-array) + (new 'process 'rigid-body-control-point-inline-array (-> this info control-point-count)) ) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-overlay)) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-overlay)) (set-vector! - (-> obj rbody cm-offset-joint) - (-> obj info cm-joint-x) - (-> obj info cm-joint-y) - (-> obj info cm-joint-z) + (-> this rbody cm-offset-joint) + (-> this info cm-joint-x) + (-> this info cm-joint-y) + (-> this info cm-joint-z) 1.0 ) (rigid-body-method-22 - (-> obj rbody) - (-> obj root-overlay trans) - (-> obj root-overlay quat) - (-> obj info linear-damping) - (-> obj info angular-damping) + (-> this rbody) + (-> this root-overlay trans) + (-> this root-overlay quat) + (-> this info linear-damping) + (-> this info angular-damping) ) (rigid-body-method-9 - (-> obj rbody) - (-> obj info mass) - (-> obj info inertial-tensor-x) - (-> obj info inertial-tensor-y) - (-> obj info inertial-tensor-z) + (-> this rbody) + (-> this info mass) + (-> this info inertial-tensor-x) + (-> this info inertial-tensor-y) + (-> this info inertial-tensor-z) ) - (set! (-> obj player-impulse) #f) - (set! (-> obj player-contact) #f) - (set! (-> obj player-bonk-timeout) (-> *display* base-frame-counter)) - (set! (-> obj player-force quad) (-> *null-vector* quad)) - (set! (-> obj player-velocity quad) (-> *null-vector* quad)) - (set! (-> obj player-velocity-prev quad) (-> *null-vector* quad)) - (set! (-> obj water-anim) (the-as water-anim (entity-actor-lookup (-> obj entity) 'water-actor 0))) + (set! (-> this player-impulse) #f) + (set! (-> this player-contact) #f) + (set-time! (-> this player-bonk-timeout)) + (set! (-> this player-force quad) (-> *null-vector* quad)) + (set! (-> this player-velocity quad) (-> *null-vector* quad)) + (set! (-> this player-velocity-prev quad) (-> *null-vector* quad)) + (set! (-> this water-anim) (the-as water-anim (entity-actor-lookup (-> this entity) 'water-actor 0))) 0 (none) ) -(defmethod rigid-body-platform-method-30 rigid-body-platform ((obj rigid-body-platform)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 rigid-body-platform ((this rigid-body-platform)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -707,7 +707,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -739,18 +739,18 @@ ) ) -(defmethod rigid-body-platform-method-34 rigid-body-platform ((obj rigid-body-platform)) - (go (method-of-object obj rigid-body-platform-idle)) +(defmethod rigid-body-platform-method-34 rigid-body-platform ((this rigid-body-platform)) + (go (method-of-object this rigid-body-platform-idle)) 0 (none) ) -(defmethod rigid-body-platform-method-31 rigid-body-platform ((obj rigid-body-platform)) - (set! (-> obj float-height-offset) 0.0) - (rigid-body-platform-method-29 obj *rigid-body-platform-constants*) - (let ((s5-0 (-> obj info control-point-count))) +(defmethod rigid-body-platform-method-31 rigid-body-platform ((this rigid-body-platform)) + (set! (-> this float-height-offset) 0.0) + (rigid-body-platform-method-29 this *rigid-body-platform-constants*) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0))))) (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) (set! (-> s3-0 local-pos y) -10240.0) @@ -764,12 +764,12 @@ (none) ) -(defmethod init-from-entity! rigid-body-platform ((obj rigid-body-platform) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) - (rigid-body-platform-method-34 obj) +(defmethod init-from-entity! rigid-body-platform ((this rigid-body-platform) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) + (rigid-body-platform-method-34 this) 0 (none) ) diff --git a/goal_src/jak1/engine/common-obs/ropebridge.gc b/goal_src/jak1/engine/common-obs/ropebridge.gc index aff077f392..ed2de80819 100644 --- a/goal_src/jak1/engine/common-obs/ropebridge.gc +++ b/goal_src/jak1/engine/common-obs/ropebridge.gc @@ -547,8 +547,8 @@ (let ((f0-0 -1.0)) (cond ((= message 'bonk) - (when (>= (- (-> *display* base-frame-counter) (-> self bonk-time-stamp)) (seconds 0.2)) - (set! (-> self bonk-time-stamp) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self bonk-time-stamp) (seconds 0.2)) + (set-time! (-> self bonk-time-stamp)) (set! f0-0 (the-as float (-> block param 1))) (if (>= f0-0 (-> self tuning rider-bonk-max)) (set! f0-0 (-> self tuning rider-bonk-max)) @@ -559,14 +559,14 @@ (let ((v1-17 (-> block param 2))) (when (!= v1-17 (-> self player-attack-id)) (set! (-> self player-attack-id) v1-17) - (set! (-> self attack-flop-time-stamp) (-> *display* base-frame-counter)) + (set-time! (-> self attack-flop-time-stamp)) (set! f0-0 (* 1.1 (-> self tuning rider-bonk-max))) ) ) ) ) (when (and (>= f0-0 (-> self tuning rider-bonk-min)) (-> block param 0)) - (set! (-> self agitated-time-stamp) (-> *display* base-frame-counter)) + (set-time! (-> self agitated-time-stamp)) (let* ((f30-0 (/ (* (- f0-0 (-> self tuning rider-bonk-min)) (-> self tuning rider-bonk-force)) (- (-> self tuning rider-bonk-max) (-> self tuning rider-bonk-min)) ) @@ -630,32 +630,32 @@ ) ;; WARN: Function (method 20 ropebridge) has a return type of none, but the expression builder found a return statement. -(defmethod set-vel-from-impact ropebridge ((obj ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) +(defmethod set-vel-from-impact ropebridge ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) (loop - (let ((f0-2 (fabs (- (-> arg1 z) (-> obj spring-point (the-as int arg0) local-pos z))))) - (if (< (-> obj tuning max-bonk-influence-dist) f0-2) + (let ((f0-2 (fabs (- (-> arg1 z) (-> this spring-point (the-as int arg0) local-pos z))))) + (if (< (-> this tuning max-bonk-influence-dist) f0-2) (return #f) ) - (let* ((f0-4 (/ (* 8.0 f0-2) (-> obj tuning max-bonk-influence-dist))) + (let* ((f0-4 (/ (* 8.0 f0-2) (-> this tuning max-bonk-influence-dist))) (f0-5 (+ 1.0 f0-4)) (f0-6 (/ 1.0 f0-5)) ) - (set! (-> obj spring-point (the-as int arg0) vel y) - (- (-> obj spring-point (the-as int arg0) vel y) (* f0-6 arg3)) + (set! (-> this spring-point (the-as int arg0) vel y) + (- (-> this spring-point (the-as int arg0) vel y) (* f0-6 arg3)) ) ) ) (set! arg0 (+ arg0 arg2)) - (if (or (< (the-as int arg0) 0) (>= (the-as int arg0) (-> obj tuning num-spring-points))) + (if (or (< (the-as int arg0) 0) (>= (the-as int arg0) (-> this tuning num-spring-points))) (return #f) ) ) (none) ) -(defmethod clear-spring-forces ropebridge ((obj ropebridge)) - (let ((v1-0 (the-as ropebridge-spring-point (-> obj spring-point)))) - (countdown (a0-2 (-> obj tuning num-spring-points)) +(defmethod clear-spring-forces ropebridge ((this ropebridge)) + (let ((v1-0 (the-as ropebridge-spring-point (-> this spring-point)))) + (countdown (a0-2 (-> this tuning num-spring-points)) (set! (-> v1-0 extra-force quad) (the-as uint128 0)) (nop!) (nop!) @@ -665,8 +665,8 @@ (none) ) -(defmethod set-vel-from-riders ropebridge ((obj ropebridge)) - (let ((v1-1 (-> obj root-override riders))) +(defmethod set-vel-from-riders ropebridge ((this ropebridge)) + (let ((v1-1 (-> this root-override riders))) (when v1-1 (let ((s5-0 (the-as collide-sticky-rider (-> v1-1 rider)))) (countdown (s4-0 (-> v1-1 num-riders)) @@ -677,13 +677,13 @@ ) (when s2-0 (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-matrix*! s3-0 (-> v1-5 trans) (-> obj inv-world-matrix)) + (vector-matrix*! s3-0 (-> v1-5 trans) (-> this inv-world-matrix)) (let ((s2-1 (-> s2-0 prim-id))) - (set-vel-from-rider obj s2-1 s3-0 -1) - (set-vel-from-rider obj (+ s2-1 1) s3-0 1) + (set-vel-from-rider this s2-1 s3-0 -1) + (set-vel-from-rider this (+ s2-1 1) s3-0 1) ) ) - (set! (-> obj agitated-time-stamp) (-> *display* base-frame-counter)) + (set-time! (-> this agitated-time-stamp)) ) ) ) @@ -697,28 +697,28 @@ ) ;; WARN: Function (method 22 ropebridge) has a return type of none, but the expression builder found a return statement. -(defmethod set-vel-from-rider ropebridge ((obj ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) +(defmethod set-vel-from-rider ropebridge ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) (loop - (let ((f0-0 (vector-vector-distance arg1 (the-as vector (-> obj spring-point (the-as int arg0)))))) - (if (< (-> obj tuning max-influence-dist) f0-0) + (let ((f0-0 (vector-vector-distance arg1 (the-as vector (-> this spring-point (the-as int arg0)))))) + (if (< (-> this tuning max-influence-dist) f0-0) (return #f) ) - (let* ((f0-2 (/ (* 8.0 f0-0) (-> obj tuning max-influence-dist))) + (let* ((f0-2 (/ (* 8.0 f0-0) (-> this tuning max-influence-dist))) (f0-3 (+ 1.0 f0-2)) (f0-4 (/ 1.0 f0-3)) ) - (+! (-> obj spring-point (the-as int arg0) extra-force y) (* f0-4 (-> obj tuning rider-max-gravity))) + (+! (-> this spring-point (the-as int arg0) extra-force y) (* f0-4 (-> this tuning rider-max-gravity))) ) ) (+! arg0 arg2) - (if (or (< (the-as int arg0) 0) (>= (the-as int arg0) (-> obj tuning num-spring-points))) + (if (or (< (the-as int arg0) 0) (>= (the-as int arg0) (-> this tuning num-spring-points))) (return #f) ) ) (none) ) -(defmethod do-integration ropebridge ((obj ropebridge)) +(defmethod do-integration ropebridge ((this ropebridge)) (local-vars (a2-1 float) (a3-0 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -739,26 +739,26 @@ (vf9 :class vf) ) (init-vf0-vector) - (let ((v1-1 (-> obj tuning gravity))) + (let ((v1-1 (-> this tuning gravity))) (.mov vf9 v1-1) ) (.add.x.vf vf9 vf0 vf9 :mask #b10) (.mov.vf vf9 vf0 :mask #b1101) 0 - (let ((v1-4 (-> obj tuning friction))) + (let ((v1-4 (-> this tuning friction))) (.mov vf12 v1-4) ) (.add.x.vf vf12 vf0 vf12 :mask #b10) (.add.x.vf vf12 vf0 vf12 :mask #b100) 0 - (let ((v1-7 (/ 1.0 (-> obj tuning spring-mass)))) + (let ((v1-7 (/ 1.0 (-> this tuning spring-mass)))) (.mov vf14 v1-7) ) (.add.x.vf vf14 vf0 vf14 :mask #b10) (.add.x.vf vf14 vf0 vf14 :mask #b100) 0 - (let ((v1-11 (+ (-> obj tuning num-spring-points) -2))) - (let* ((a2-0 (-> obj spring-point)) + (let ((v1-11 (+ (-> this tuning num-spring-points) -2))) + (let* ((a2-0 (-> this spring-point)) (a1-1 (-> a2-0 1)) ) (.lvf vf2 (&-> a2-0 0 local-pos quad)) @@ -771,12 +771,12 @@ (.add.y.vf vf7 vf7 vf7 :mask #b1) (.add.z.vf vf7 vf7 vf7 :mask #b1) (.mov a2-1 vf7) - (let ((f0-5 (- a2-1 (-> obj tuning desired-spring-len)))) + (let ((f0-5 (- a2-1 (-> this tuning desired-spring-len)))) (when (< 0.0 f0-5) (.div.vf Q vf0 vf7 :fsf #b11 :ftf #b0) (.wait.vf) (.mul.vf vf5 vf5 Q) - (let ((a2-5 (* f0-5 (-> obj tuning spring-coefficient)))) + (let ((a2-5 (* f0-5 (-> this tuning spring-coefficient)))) (.mov vf10 a2-5) ) (.mul.x.vf vf10 vf5 vf10 :mask #b111) @@ -791,12 +791,12 @@ (.add.y.vf vf8 vf8 vf8 :mask #b1) (.add.z.vf vf8 vf8 vf8 :mask #b1) (.mov a3-0 vf8) - (let ((f0-8 (- a3-0 (-> obj tuning desired-spring-len)))) + (let ((f0-8 (- a3-0 (-> this tuning desired-spring-len)))) (when (< 0.0 f0-8) (.div.vf Q vf0 vf8 :fsf #b11 :ftf #b0) (.wait.vf) (.mul.vf vf6 vf6 Q) - (let ((a3-4 (* f0-8 (-> obj tuning spring-coefficient)))) + (let ((a3-4 (* f0-8 (-> this tuning spring-coefficient)))) (.mov vf10 a3-4) ) (.mul.x.vf vf10 vf6 vf10 :mask #b111) @@ -817,14 +817,14 @@ (+! v1-11 -1) (b! (> v1-11 0) cfg-1 :delay (nop!)) ) - (let ((v1-13 (-> *display* seconds-per-frame))) + (let ((v1-13 (seconds-per-frame))) (.mov vf13 v1-13) ) (.add.x.vf vf13 vf0 vf13 :mask #b10) (.add.x.vf vf13 vf0 vf13 :mask #b100) 0 - (let ((v1-17 (+ (-> obj tuning num-spring-points) -2))) - (let ((a0-1 (the-as object (&-> obj stack 320)))) + (let ((v1-17 (+ (-> this tuning num-spring-points) -2))) + (let ((a0-1 (the-as object (&-> this stack 320)))) (label cfg-7) (.lvf vf11 (&-> (the-as (inline-array vector) a0-1) 1 quad)) (.lvf vf3 (&-> (the-as (inline-array vector) a0-1) 0 quad)) @@ -841,12 +841,12 @@ ) ) -(defmethod debug-draw ropebridge ((obj ropebridge)) - (let ((gp-0 (-> obj node-list data 0 bone transform)) - (s5-0 (the-as ropebridge-spring-point (-> obj spring-point))) +(defmethod debug-draw ropebridge ((this ropebridge)) + (let ((gp-0 (-> this node-list data 0 bone transform)) + (s5-0 (the-as ropebridge-spring-point (-> this spring-point))) (s4-0 (new 'stack-no-clear 'vector)) ) - (countdown (s3-0 (-> obj tuning num-spring-points)) + (countdown (s3-0 (-> this tuning num-spring-points)) (vector-matrix*! s4-0 (-> s5-0 local-pos) gp-0) (add-debug-sphere #t (bucket-id debug) s4-0 2048.0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40)) (&+! s5-0 48) @@ -855,21 +855,21 @@ (none) ) -(defmethod set-to-rest-state ropebridge ((obj ropebridge)) +(defmethod set-to-rest-state ropebridge ((this ropebridge)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (let ((a1-0 (the-as structure (-> obj tuning rest-state)))) + (let ((a1-0 (the-as structure (-> this tuning rest-state)))) (cond ((the-as symbol a1-0) - (let ((v1-1 (the-as ropebridge-spring-point (-> obj spring-point))) + (let ((v1-1 (the-as ropebridge-spring-point (-> this spring-point))) (a1-1 (the-as vector (-> (the-as vector a1-0) x))) ) (.svf (&-> v1-1 local-pos quad) vf0) (.svf (&-> v1-1 vel quad) vf0) - (countdown (a0-3 (+ (-> obj tuning num-spring-points) -1)) + (countdown (a0-3 (+ (-> this tuning num-spring-points) -1)) (&+! v1-1 48) (.svf (&-> v1-1 local-pos quad) vf0) (.svf (&-> v1-1 vel quad) vf0) @@ -884,11 +884,11 @@ (else (let ((a1-2 8192.0)) (.mov.vf vf1 vf0) - (let ((v1-3 (the-as ropebridge-spring-point (-> obj spring-point)))) + (let ((v1-3 (the-as ropebridge-spring-point (-> this spring-point)))) (.mov vf2 a1-2) (.add.x.vf vf2 vf0 vf2) (.mov.vf vf2 vf0 :mask #b1011) - (countdown (a0-5 (-> obj tuning num-spring-points)) + (countdown (a0-5 (-> this tuning num-spring-points)) (.svf (&-> v1-3 local-pos quad) vf1) (.svf (&-> v1-3 vel quad) vf0) (.add.vf vf1 vf1 vf2 :mask #b111) @@ -940,9 +940,9 @@ (none) ) -(defmethod add-collision-meshes ropebridge ((obj ropebridge)) - (let* ((s5-0 (-> obj root-override)) - (s3-0 (-> obj tuning)) +(defmethod add-collision-meshes ropebridge ((this ropebridge)) + (let* ((s5-0 (-> this root-override)) + (s3-0 (-> this tuning)) (s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint (-> s3-0 num-springs)) 0)) ) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) @@ -951,8 +951,8 @@ (set! (-> s4-0 transform-index) (+ (/ (-> s3-0 num-springs) 2) 4)) (set! (-> s4-0 prim-core action) (collide-action solid rider-plat-sticky)) (set-root-prim! s5-0 s4-0) - (let ((s3-1 (-> obj tuning col-mesh-indexes))) - (dotimes (s2-0 (-> obj tuning num-springs)) + (let ((s3-1 (-> this tuning col-mesh-indexes))) + (dotimes (s2-0 (-> this tuning num-springs)) (let* ((a3-1 (-> s3-1 s2-0)) (a1-3 (new 'process 'collide-shape-prim-mesh s5-0 a3-1 (the-as uint s2-0))) ) @@ -970,85 +970,85 @@ (none) ) -(defmethod run-logic? ropebridge ((obj ropebridge)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (< (- (-> *display* base-frame-counter) (-> obj agitated-time-stamp)) (seconds 5)) - (or (>= (-> obj sleep-dist) (vector-vector-distance (-> obj root-override trans) (math-camera-pos))) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) +(defmethod run-logic? ropebridge ((this ropebridge)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (not (time-elapsed? (-> this agitated-time-stamp) (seconds 5))) + (or (>= (-> this sleep-dist) (vector-vector-distance (-> this root-override trans) (math-camera-pos))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) -(defmethod ropebridge-method-28 ropebridge ((obj ropebridge)) +(defmethod ropebridge-method-28 ropebridge ((this ropebridge)) 0 (none) ) -(defmethod init-from-entity! ropebridge ((obj ropebridge) (arg0 entity-actor)) - (let ((s4-0 (res-lump-struct (-> obj entity) 'art-name structure))) +(defmethod init-from-entity! ropebridge ((this ropebridge) (arg0 entity-actor)) + (let ((s4-0 (res-lump-struct (-> this entity) 'art-name structure))) (if (not s4-0) (set! s4-0 "ropebridge-32") ) (if (= (-> (the-as symbol s4-0) type) symbol) (set! s4-0 (symbol->string (the-as symbol s4-0))) ) - (set! (-> obj subtype-name) (the-as string s4-0)) - (set! (-> obj subtype) (the-as uint (cond - ((string= (the-as string s4-0) "ropebridge-32") - 0 - ) - ((string= (the-as string s4-0) "ropebridge-36") - 1 - ) - ((string= (the-as string s4-0) "ropebridge-52") - 2 - ) - ((string= (the-as string s4-0) "ropebridge-70") - 3 - ) - ((string= (the-as string s4-0) "snow-bridge-36") - 4 - ) - ((string= (the-as string s4-0) "vil3-bridge-36") - 5 - ) - (else + (set! (-> this subtype-name) (the-as string s4-0)) + (set! (-> this subtype) (the-as uint (cond + ((string= (the-as string s4-0) "ropebridge-32") 0 ) - ) - ) + ((string= (the-as string s4-0) "ropebridge-36") + 1 + ) + ((string= (the-as string s4-0) "ropebridge-52") + 2 + ) + ((string= (the-as string s4-0) "ropebridge-70") + 3 + ) + ((string= (the-as string s4-0) "snow-bridge-36") + 4 + ) + ((string= (the-as string s4-0) "vil3-bridge-36") + 5 + ) + (else + 0 + ) + ) + ) ) ) - (set! (-> obj tuning) (-> *ropebridge-tunings* (the-as int (-> obj subtype)))) - (set! (-> obj agitated-time-stamp) (-> *display* base-frame-counter)) - (set! (-> obj bonk-time-stamp) (-> *display* base-frame-counter)) - (set! (-> obj attack-flop-time-stamp) (-> *display* base-frame-counter)) - (set-vector! (-> obj extra-trans) 0.0 0.0 (- (* 0.5 (-> obj tuning bridge-end-to-end-len))) 1.0) - (set! (-> obj do-physics?) #t) - (let ((a0-13 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) - (set! (-> obj root-override) a0-13) + (set! (-> this tuning) (-> *ropebridge-tunings* (the-as int (-> this subtype)))) + (set-time! (-> this agitated-time-stamp)) + (set-time! (-> this bonk-time-stamp)) + (set-time! (-> this attack-flop-time-stamp)) + (set-vector! (-> this extra-trans) 0.0 0.0 (- (* 0.5 (-> this tuning bridge-end-to-end-len))) 1.0) + (set! (-> this do-physics?) #t) + (let ((a0-13 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (set! (-> this root-override) a0-13) (alloc-riders a0-13 3) ) - (add-collision-meshes obj) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton-by-name obj (-> obj subtype-name) '()) - (logior! (-> obj skel status) (janim-status inited)) - (let ((v1-29 (-> obj tuning))) - (set! (-> obj draw bounds w) (-> v1-29 view-frustum-radius)) - (set! (-> obj sleep-dist) (+ 40960.0 (* 0.5 (-> v1-29 bridge-end-to-end-len)))) + (add-collision-meshes this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton-by-name this (-> this subtype-name) '()) + (logior! (-> this skel status) (janim-status inited)) + (let ((v1-29 (-> this tuning))) + (set! (-> this draw bounds w) (-> v1-29 view-frustum-radius)) + (set! (-> this sleep-dist) (+ 40960.0 (* 0.5 (-> v1-29 bridge-end-to-end-len)))) (if (or (< 35 (-> v1-29 num-springs)) (< 36 (-> v1-29 num-spring-points))) (format 0 "ERROR: ##########~%Exceeded max # of springs in ropebridge! Stomping memory!~%##########~%") ) ) - (set! (-> obj skel postbind-function) ropebridge-joint-callback) + (set! (-> this skel postbind-function) ropebridge-joint-callback) (matrix<-transformq+trans! - (-> obj world-matrix) - (the-as transformq (-> obj root-override trans)) - (-> obj extra-trans) + (-> this world-matrix) + (the-as transformq (-> this root-override trans)) + (-> this extra-trans) ) - (matrix-4x4-inverse! (-> obj inv-world-matrix) (-> obj world-matrix)) - (set-to-rest-state obj) + (matrix-4x4-inverse! (-> this inv-world-matrix) (-> this world-matrix)) + (set-to-rest-state this) (go ropebridge-idle) (none) ) diff --git a/goal_src/jak1/engine/common-obs/sharkey.gc b/goal_src/jak1/engine/common-obs/sharkey.gc index 321c3ee9d9..9d28a7110f 100644 --- a/goal_src/jak1/engine/common-obs/sharkey.gc +++ b/goal_src/jak1/engine/common-obs/sharkey.gc @@ -61,92 +61,92 @@ :bounds (static-spherem 0 0 0 6) ) -(defmethod touch-handler sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler sharkey ((this sharkey) (arg0 process) (arg1 event-message-block)) #t ) -(defmethod attack-handler sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler sharkey ((this sharkey) (arg0 process) (arg1 event-message-block)) #t ) nav-enemy-default-event-handler -(defmethod run-logic? sharkey ((obj sharkey)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance)) - (vector-vector-distance (-> obj collide-info trans) (math-camera-pos)) +(defmethod run-logic? sharkey ((this sharkey)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this collide-info pause-adjust-distance)) + (vector-vector-distance (-> this collide-info trans) (math-camera-pos)) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) -(defmethod nav-enemy-method-40 sharkey ((obj sharkey)) - (nav-control-method-11 (-> obj nav) (-> obj nav target-pos)) - (let* ((f0-0 (vector-vector-xz-distance (-> obj collide-info trans) (-> obj nav target-pos))) - (f30-0 (/ (- (fmin (-> obj y-max) (-> obj nav target-pos y)) (-> obj collide-info trans y)) f0-0)) +(defmethod nav-enemy-method-40 sharkey ((this sharkey)) + (nav-control-method-11 (-> this nav) (-> this nav target-pos)) + (let* ((f0-0 (vector-vector-xz-distance (-> this collide-info trans) (-> this nav target-pos))) + (f30-0 (/ (- (fmin (-> this y-max) (-> this nav target-pos y)) (-> this collide-info trans y)) f0-0)) ) - (set! (-> obj nav travel y) (* 4.0 (vector-length (-> obj nav travel)) f30-0)) + (set! (-> this nav travel y) (* 4.0 (vector-length (-> this nav travel)) f30-0)) ) 0 (none) ) -(defmethod nav-enemy-method-37 sharkey ((obj sharkey)) +(defmethod nav-enemy-method-37 sharkey ((this sharkey)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (< 8192.0 (vector-length (-> obj nav travel))) - (vector-normalize-copy! s5-0 (-> obj nav travel) 1.0) - (vector-deg-seek (-> obj dir) (-> obj dir) s5-0 (* 65536.0 (-> *display* seconds-per-frame))) - (vector-normalize! (-> obj dir) 1.0) - (forward-up->quaternion (-> obj collide-info quat) (-> obj dir) *up-vector*) + (when (< 8192.0 (vector-length (-> this nav travel))) + (vector-normalize-copy! s5-0 (-> this nav travel) 1.0) + (vector-deg-seek (-> this dir) (-> this dir) s5-0 (* 65536.0 (seconds-per-frame))) + (vector-normalize! (-> this dir) 1.0) + (forward-up->quaternion (-> this collide-info quat) (-> this dir) *up-vector*) ) ) 0 (none) ) -(defmethod nav-enemy-method-41 sharkey ((obj sharkey)) - (let* ((f0-1 (- (-> obj target-speed) (-> obj momentum-speed))) - (f1-3 (fmin (* (-> obj acceleration) (-> *display* seconds-per-frame)) (fabs f0-1))) +(defmethod nav-enemy-method-41 sharkey ((this sharkey)) + (let* ((f0-1 (- (-> this target-speed) (-> this momentum-speed))) + (f1-3 (fmin (* (-> this acceleration) (seconds-per-frame)) (fabs f0-1))) ) (if (< f0-1 0.0) - (set! (-> obj momentum-speed) (- (-> obj momentum-speed) f1-3)) - (+! (-> obj momentum-speed) f1-3) + (set! (-> this momentum-speed) (- (-> this momentum-speed) f1-3)) + (+! (-> this momentum-speed) f1-3) ) ) (let ((f0-9 (fmin - (* (-> obj speed-scale) (-> obj momentum-speed)) - (* (vector-length (-> obj nav travel)) (-> *display* frames-per-second)) + (* (-> this speed-scale) (-> this momentum-speed)) + (* (vector-length (-> this nav travel)) (-> *display* frames-per-second)) ) ) ) - (vector-normalize-copy! (-> obj collide-info transv) (-> obj nav travel) f0-9) + (vector-normalize-copy! (-> this collide-info transv) (-> this nav travel) f0-9) ) 0 (none) ) -(defmethod common-post sharkey ((obj sharkey)) - (let ((f30-0 (-> obj water height)) +(defmethod common-post sharkey ((this sharkey)) + (let ((f30-0 (-> this water height)) (s5-0 (new 'stack-no-clear 'vector)) ) - (let* ((f3-0 (- -36864.0 (-> obj collide-info trans y))) + (let* ((f3-0 (- -36864.0 (-> this collide-info trans y))) (f0-2 (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.00008138021 f3-0))))) ) - (set-vector! (-> obj draw color-mult) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this draw color-mult) f0-2 f0-2 f0-2 1.0) ) - (water-control-method-10 (-> obj water)) - (let ((f28-0 (-> obj collide-info trans y))) - (when (or (and (< f30-0 f28-0) (>= f30-0 (-> obj last-y))) (and (>= f30-0 f28-0) (< f30-0 (-> obj last-y)))) - (set! (-> s5-0 quad) (-> obj collide-info trans quad)) + (water-control-method-10 (-> this water)) + (let ((f28-0 (-> this collide-info trans y))) + (when (or (and (< f30-0 f28-0) (>= f30-0 (-> this last-y))) (and (>= f30-0 f28-0) (< f30-0 (-> this last-y)))) + (set! (-> s5-0 quad) (-> this collide-info trans quad)) (set! (-> s5-0 y) f30-0) - (create-splash (-> obj water) 1.0 s5-0 1 (-> obj collide-info transv)) + (create-splash (-> this water) 1.0 s5-0 1 (-> this collide-info transv)) ) - (set! (-> obj last-y) f28-0) + (set! (-> this last-y) f28-0) ) ) - ((the-as (function nav-enemy none) (find-parent-method sharkey 39)) obj) + ((the-as (function nav-enemy none) (find-parent-method sharkey 39)) this) 0 (none) ) @@ -210,7 +210,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) :exit (behavior () @@ -223,7 +223,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) ) (go-virtual nav-enemy-patrol) ) @@ -231,13 +231,12 @@ nav-enemy-default-event-handler ((sharkey-notice-player?) (when (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf0))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) - (set! (-> self notice-time) (-> *display* base-frame-counter)) + (set-time! (-> self notice-time)) ) (let ((a0-4 (nav-control-method-16 (-> self nav) (-> *target* control trans)))) - (when (or (and a0-4 (logtest? (-> a0-4 pat) 2)) - (and (logtest? (-> self draw status) (draw-status hidden)) - (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) - ) + (when (or (and a0-4 (logtest? (-> a0-4 pat) 2)) (and (logtest? (-> self draw status) (draw-status hidden)) + (time-elapsed? (-> self notice-time) (-> self reaction-time)) + ) ) (sharkey-move-to-attack-position) (set! (-> self player-in-water) #t) @@ -246,7 +245,7 @@ nav-enemy-default-event-handler ) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (seconds 10)) + (if (time-elapsed? (-> self notice-time) (seconds 10)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) ) @@ -259,7 +258,7 @@ nav-enemy-default-event-handler (until (= (-> self collide-info trans y) (-> self y-min)) (ja :num! (loop! (-> self anim-speed))) (seek! (-> self anim-speed) 1.0 0.05) - (seek! (-> self collide-info trans y) (-> self y-min) (* (-> self y-speed) (-> *display* seconds-per-frame))) + (seek! (-> self collide-info trans y) (-> self y-min) (* (-> self y-speed) (seconds-per-frame))) (water-control-method-10 (-> self water)) (ja-post) (suspend) @@ -290,7 +289,7 @@ nav-enemy-default-event-handler (seek! (-> self anim-speed) 1.0 0.05) (cond ((-> self enable-patrol) - (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (seconds-per-frame))) ) (else (if (< (- (-> self collide-info trans y) (-> self y-min)) 409.6) @@ -335,9 +334,9 @@ nav-enemy-default-event-handler (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (-> *display* base-frame-counter) + (current-time) (sound-play "bigshark-bite") - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> gp-0 quad) (-> self collide-info trans quad)) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! sharkey-chomp-ja :num! (seek! (ja-aframe 3.0 0) 2.0) :frame-num 0.0) @@ -353,16 +352,16 @@ nav-enemy-default-event-handler (when (send-event *target* 'attack-invinc #f (static-attack-info ((mode 'sharkey)))) (logclear! (-> self mask) (process-mask enemy)) (vector-float*! (-> self collide-info transv) (-> self collide-info transv) 8.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((f30-0 -409600.0) (f28-0 (-> self collide-info transv y)) (f26-0 (-> self collide-info trans y)) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (ja-no-eval :group! sharkey-chomp-ja :num! (seek!) :frame-num (ja-aframe 3.0 0)) (until (ja-done? 0) - (+! f28-0 (* f30-0 (-> *display* seconds-per-frame))) - (+! f26-0 (* f28-0 (-> *display* seconds-per-frame))) + (+! f28-0 (* f30-0 (seconds-per-frame))) + (+! f26-0 (* f28-0 (seconds-per-frame))) (set! (-> self collide-info transv y) f28-0) (when (< (-> self collide-info trans y) (-> self water height)) (set! f28-0 (* 0.9 f28-0)) @@ -423,7 +422,7 @@ nav-enemy-default-event-handler (when (logtest? (-> *target* control status) (cshape-moving-flags onground)) (set! (-> self player-in-water) (logtest? (-> *target* control status) (cshape-moving-flags on-water))) (if (-> self player-in-water) - (set! (-> self player-water-time) (-> *display* base-frame-counter)) + (set-time! (-> self player-water-time)) ) ) (if (and *target* (>= 8192.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) @@ -431,7 +430,7 @@ nav-enemy-default-event-handler ) (cond ((-> self player-in-water) - (set! (-> self free-time) (-> *display* base-frame-counter)) + (set-time! (-> self free-time)) (if (and (< (fabs (- (-> gp-0 y) (-> self collide-info trans y))) 40960.0) (< (vector-vector-xz-distance gp-0 (-> self collide-info trans)) 24576.0) ) @@ -439,7 +438,7 @@ nav-enemy-default-event-handler ) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 3)) + (if (time-elapsed? (-> self free-time) (seconds 3)) (go-virtual nav-enemy-patrol) ) ) @@ -453,7 +452,7 @@ nav-enemy-default-event-handler ) ) :code (behavior () - (set! (-> self player-water-time) (-> *display* base-frame-counter)) + (set-time! (-> self player-water-time)) (ja-channel-push! 1 (seconds 0.17)) (sound-play "bigshark-idle") (loop @@ -462,7 +461,7 @@ nav-enemy-default-event-handler :frame-num 0.0 ) (until (ja-done? 0) - (seek! (-> self anim-speed) 1.0 (* 3.0 (-> *display* seconds-per-frame))) + (seek! (-> self anim-speed) 1.0 (* 3.0 (seconds-per-frame))) (suspend) (ja :num! (seek! max (-> self anim-speed))) ) @@ -497,7 +496,7 @@ nav-enemy-default-event-handler ) (until (ja-done? 0) (seek! (-> self anim-speed) 1.0 0.05) - (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (seconds-per-frame))) (suspend) (ja :num! (seek! max (-> self anim-speed))) ) @@ -512,7 +511,7 @@ nav-enemy-default-event-handler (if (target-in-range? self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) (go-virtual nav-enemy-patrol) ) ) @@ -523,7 +522,7 @@ nav-enemy-default-event-handler (loop (ja :num! (loop! (-> self anim-speed))) (seek! (-> self anim-speed) 1.0 0.05) - (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (seconds-per-frame))) (suspend) ) ) @@ -601,9 +600,9 @@ nav-enemy-default-event-handler ) ) -(defmethod init-from-entity! sharkey ((obj sharkey) (arg0 entity-actor)) - (set! (-> obj scale) (res-lump-float arg0 'scale :default 1.0)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! sharkey ((this sharkey) (arg0 entity-actor)) + (set! (-> this scale) (res-lump-float arg0 'scale :default 1.0)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -613,38 +612,38 @@ nav-enemy-default-event-handler (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) (set! (-> s3-0 prim-core offense) (collide-offense normal-attack)) - (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 (* 6144.0 (-> obj scale))) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 (* 6144.0 (-> this scale))) (set-root-prim! s4-0 s3-0) ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *sharkey-sg* '()) - (init-defaults! obj *sharkey-nav-enemy-info*) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj water) (new 'process 'water-control obj 3 12288.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01 wt22 wt23)) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 20480.0) - (set! (-> obj spawn-point quad) (-> obj collide-info trans quad)) - (set! (-> obj collide-info nav-radius) 8192.0) - (set! (-> obj nav nearest-y-threshold) 4096000.0) - (set! (-> obj y-max) (- (-> obj water height) (* 2048.0 (-> obj scale)))) - (set! (-> obj y-min) (+ -49152.0 (-> obj y-max))) - (set! (-> obj collide-info trans y) (-> obj y-min)) - (set! (-> obj anim-speed) 1.0) - (set-vector! (-> obj collide-info scale) (-> obj scale) (-> obj scale) (-> obj scale) 1.0) - (set! (-> obj reaction-time) - (the-as time-frame (the int (* 300.0 (res-lump-float (-> obj entity) 'delay :default 1.0)))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *sharkey-sg* '()) + (init-defaults! this *sharkey-nav-enemy-info*) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this water) (new 'process 'water-control this 3 12288.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01 wt22 wt23)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 20480.0) + (set! (-> this spawn-point quad) (-> this collide-info trans quad)) + (set! (-> this collide-info nav-radius) 8192.0) + (set! (-> this nav nearest-y-threshold) 4096000.0) + (set! (-> this y-max) (- (-> this water height) (* 2048.0 (-> this scale)))) + (set! (-> this y-min) (+ -49152.0 (-> this y-max))) + (set! (-> this collide-info trans y) (-> this y-min)) + (set! (-> this anim-speed) 1.0) + (set-vector! (-> this collide-info scale) (-> this scale) (-> this scale) (-> this scale) 1.0) + (set! (-> this reaction-time) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'delay :default 1.0)))) ) - (set! (-> obj spawn-distance) (res-lump-float (-> obj entity) 'distance :default 122880.0)) - (set! (-> obj chase-speed) (res-lump-float (-> obj entity) 'speed :default 49152.0)) - (set! (-> obj y-speed) (-> obj chase-speed)) - (set! (-> obj enable-patrol) #f) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj enemy-info cam-vert) 49152.0) - (go (method-of-object obj nav-enemy-idle)) + (set! (-> this spawn-distance) (res-lump-float (-> this entity) 'distance :default 122880.0)) + (set! (-> this chase-speed) (res-lump-float (-> this entity) 'speed :default 49152.0)) + (set! (-> this y-speed) (-> this chase-speed)) + (set! (-> this enable-patrol) #f) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this enemy-info cam-vert) 49152.0) + (go (method-of-object this nav-enemy-idle)) (none) ) diff --git a/goal_src/jak1/engine/common-obs/ticky.gc b/goal_src/jak1/engine/common-obs/ticky.gc index bd899ac2ce..6610b5ae36 100644 --- a/goal_src/jak1/engine/common-obs/ticky.gc +++ b/goal_src/jak1/engine/common-obs/ticky.gc @@ -24,32 +24,32 @@ ) -(defmethod sleep ticky ((obj ticky) (arg0 time-frame)) - (set! (-> obj starting-time) (-> *display* base-frame-counter)) - (set! (-> obj delay-til-timeout) arg0) - (set! (-> obj delay-til-ramp) (max 0 (+ arg0 (seconds -4)))) - (set! (-> obj last-tick-time) 0) +(defmethod sleep ticky ((this ticky) (arg0 time-frame)) + (set-time! (-> this starting-time)) + (set! (-> this delay-til-timeout) arg0) + (set! (-> this delay-til-ramp) (max 0 (+ arg0 (seconds -4)))) + (set! (-> this last-tick-time) 0) 0 (none) ) -(defmethod completed? ticky ((obj ticky)) +(defmethod completed? ticky ((this ticky)) (let ((gp-0 #f)) - (let ((v1-2 (- (-> *display* base-frame-counter) (-> obj starting-time)))) + (let ((v1-2 (- (current-time) (-> this starting-time)))) (cond - ((>= v1-2 (-> obj delay-til-timeout)) + ((>= v1-2 (-> this delay-til-timeout)) (set! gp-0 #t) ) (else - (let* ((f0-1 (fmin 1.0 (/ (the float (max 0 (- v1-2 (-> obj delay-til-ramp)))) - (the float (- (-> obj delay-til-timeout) (-> obj delay-til-ramp))) + (let* ((f0-1 (fmin 1.0 (/ (the float (max 0 (- v1-2 (-> this delay-til-ramp)))) + (the float (- (-> this delay-til-timeout) (-> this delay-til-ramp))) ) ) ) (v1-7 (the int (lerp 105.0 41.0 f0-1))) ) - (when (>= (- (-> *display* base-frame-counter) (-> obj last-tick-time)) v1-7) - (set! (-> obj last-tick-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> this last-tick-time) v1-7) + (set-time! (-> this last-tick-time)) (sound-play "stopwatch") ) ) @@ -60,10 +60,6 @@ ) ) -(defmethod reached-delay? ticky ((obj ticky) (arg0 time-frame)) - (>= (- (-> *display* base-frame-counter) (-> obj starting-time)) arg0) +(defmethod reached-delay? ticky ((this ticky) (arg0 time-frame)) + (time-elapsed? (-> this starting-time) arg0) ) - - - - diff --git a/goal_src/jak1/engine/common-obs/tippy.gc b/goal_src/jak1/engine/common-obs/tippy.gc index eb84341012..3ed26297b5 100644 --- a/goal_src/jak1/engine/common-obs/tippy.gc +++ b/goal_src/jak1/engine/common-obs/tippy.gc @@ -25,18 +25,18 @@ ) -(defmethod reset! tippy ((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float)) - (set-vector! (-> obj axis) 0.0 0.0 0.0 1.0) - (set! (-> obj angle) 0.0) - (quaternion-copy! (-> obj orig) (-> arg0 root quat)) - (set! (-> obj dist-ratio) arg1) - (set! (-> obj damping) arg2) - (set! (-> obj 1-damping) (- 1.0 arg2)) +(defmethod reset! tippy ((this tippy) (arg0 process-drawable) (arg1 float) (arg2 float)) + (set-vector! (-> this axis) 0.0 0.0 0.0 1.0) + (set! (-> this angle) 0.0) + (quaternion-copy! (-> this orig) (-> arg0 root quat)) + (set! (-> this dist-ratio) arg1) + (set! (-> this damping) arg2) + (set! (-> this 1-damping) (- 1.0 arg2)) 0 (none) ) -(defmethod tippy-method-10 tippy ((obj tippy) (arg0 process-drawable) (arg1 vector)) +(defmethod tippy-method-10 tippy ((this tippy) (arg0 process-drawable) (arg1 vector)) (let ((s4-0 #t)) (cond (arg1 @@ -47,26 +47,26 @@ (set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x))) (let ((f0-6 (vector-length s3-0))) (vector-float*! s3-0 s3-0 (/ 1.0 f0-6)) - (let ((f30-0 (* f0-6 (-> obj dist-ratio)))) - (set! (-> obj axis x) (+ (* (-> obj 1-damping) (-> obj axis x)) (* (-> obj damping) (-> s3-0 x)))) - (set! (-> obj axis y) 0.0) - (set! (-> obj axis z) (+ (* (-> obj 1-damping) (-> obj axis z)) (* (-> obj damping) (-> s3-0 z)))) - (vector-normalize! (-> obj axis) 1.0) - (set! (-> obj angle) (+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0))) + (let ((f30-0 (* f0-6 (-> this dist-ratio)))) + (set! (-> this axis x) (+ (* (-> this 1-damping) (-> this axis x)) (* (-> this damping) (-> s3-0 x)))) + (set! (-> this axis y) 0.0) + (set! (-> this axis z) (+ (* (-> this 1-damping) (-> this axis z)) (* (-> this damping) (-> s3-0 z)))) + (vector-normalize! (-> this axis) 1.0) + (set! (-> this angle) (+ (* (-> this 1-damping) (-> this angle)) (* (-> this damping) f30-0))) ) ) ) ) (else - (set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle))) - (when (< (-> obj angle) 182.04445) - (set! (-> obj angle) 0.0) + (set! (-> this angle) (* (-> this 1-damping) (-> this angle))) + (when (< (-> this angle) 182.04445) + (set! (-> this angle) 0.0) (set! s4-0 #f) ) ) ) - (quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle)) - (quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig)) + (quaternion-vector-angle! (-> arg0 root quat) (-> this axis) (-> this angle)) + (quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> this orig)) s4-0 ) ) diff --git a/goal_src/jak1/engine/common-obs/voicebox.gc b/goal_src/jak1/engine/common-obs/voicebox.gc index a3b1bc69f2..d0ba79978b 100644 --- a/goal_src/jak1/engine/common-obs/voicebox.gc +++ b/goal_src/jak1/engine/common-obs/voicebox.gc @@ -61,9 +61,7 @@ ) (vector-lerp! (-> self root trans) gp-0 s5-0 (-> self blend)) ) - (+! (-> self root trans y) - (* 1638.4 (sin (* 54.613335 (the float (mod (-> *display* base-frame-counter) 1200))))) - ) + (+! (-> self root trans y) (* 1638.4 (sin (* 54.613335 (the float (mod (current-time) 1200)))))) (let ((gp-1 (new 'stack-no-clear 'quaternion))) (forward-up->quaternion gp-1 @@ -80,8 +78,8 @@ ) ) (if (< 0.0 f0-8) - (seek! (-> self twist) -0.4 (* 0.3 (-> *display* seconds-per-frame))) - (seek! (-> self twist) 0.4 (* 0.3 (-> *display* seconds-per-frame))) + (seek! (-> self twist) -0.4 (* 0.3 (seconds-per-frame))) + (seek! (-> self twist) 0.4 (* 0.3 (seconds-per-frame))) ) ) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) @@ -171,14 +169,13 @@ :trans voicebox-track :code (behavior () (remove-setting! 'sound-flava) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self seeker target) 1.0) - (while (and (< (-> self blend) 0.9999) - (not (and (not (handle->process (-> self hint))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) - (-> *setting-control* current hint) - ) - ) + (while (and (< (-> self blend) 0.9999) (not (and (not (handle->process (-> self hint))) + (time-elapsed? (-> self state-time) (seconds 0.05)) + (-> *setting-control* current hint) + ) + ) ) (update! (-> self seeker) 0.0) (set! (-> self blend) (-> self seeker value)) diff --git a/goal_src/jak1/engine/common-obs/water-anim.gc b/goal_src/jak1/engine/common-obs/water-anim.gc index 5f9ed24280..19d8a0e3b2 100644 --- a/goal_src/jak1/engine/common-obs/water-anim.gc +++ b/goal_src/jak1/engine/common-obs/water-anim.gc @@ -511,36 +511,36 @@ ) ) -(defmethod get-ripple-height water-anim ((obj water-anim) (arg0 vector)) - (ripple-find-height obj 0 arg0) +(defmethod get-ripple-height water-anim ((this water-anim) (arg0 vector)) + (ripple-find-height this 0 arg0) ) -(defmethod set-stack-size! water-anim ((obj water-anim)) +(defmethod set-stack-size! water-anim ((this water-anim)) (none) ) -(defmethod water-vol-method-25 water-anim ((obj water-anim)) +(defmethod water-vol-method-25 water-anim ((this water-anim)) (local-vars (sv-16 res-tag)) - (set! (-> obj play-ambient-sound?) #t) - (set! (-> obj look) (res-lump-value (-> obj entity) 'look int :default (the-as uint128 -1))) + (set! (-> this play-ambient-sound?) #t) + (set! (-> this look) (res-lump-value (-> this entity) 'look int :default (the-as uint128 -1))) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-3 (res-lump-data (-> obj entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) + (let ((v1-3 (res-lump-data (-> this entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-3 - (+! (-> obj root trans x) (-> v1-3 0)) - (+! (-> obj root trans y) (-> v1-3 1)) - (+! (-> obj root trans z) (-> v1-3 2)) + (+! (-> this root trans x) (-> v1-3 0)) + (+! (-> this root trans y) (-> v1-3 1)) + (+! (-> this root trans z) (-> v1-3 2)) ) ) - (let ((f0-6 (res-lump-float (-> obj entity) 'rotoffset))) + (let ((f0-6 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-6 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-6) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-6) ) ) (none) ) -(defmethod water-vol-method-22 water-anim ((obj water-anim)) - (let ((s5-0 (-> obj look))) +(defmethod water-vol-method-22 water-anim ((this water-anim)) + (let ((s5-0 (-> this look))) (if (or (< s5-0 0) (>= s5-0 (-> *water-anim-look* length))) (go process-drawable-art-error "skel group") ) @@ -554,13 +554,13 @@ (go process-drawable-art-error "skel group") ) ) - (initialize-skeleton obj (the-as skeleton-group s4-0) '()) + (initialize-skeleton this (the-as skeleton-group s4-0) '()) ) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data (-> s5-1 anim))) + (the-as art-joint-anim (-> this draw art-group data (-> s5-1 anim))) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) @@ -568,8 +568,8 @@ (let ((a2-2 (-> s5-1 ambient-sound-spec))) (when a2-2 (let ((a3-0 (new 'stack-no-clear 'vector))) - (vector+! a3-0 (-> obj root trans) (-> obj draw bounds)) - (set! (-> obj sound) (new 'process 'ambient-sound a2-2 a3-0)) + (vector+! a3-0 (-> this root trans) (-> this draw bounds)) + (set! (-> this sound) (new 'process 'ambient-sound a2-2 a3-0)) ) ) ) diff --git a/goal_src/jak1/engine/common-obs/water-h.gc b/goal_src/jak1/engine/common-obs/water-h.gc index 5aa0127b6a..d7be1b5077 100644 --- a/goal_src/jak1/engine/common-obs/water-h.gc +++ b/goal_src/jak1/engine/common-obs/water-h.gc @@ -97,8 +97,8 @@ ) -(defmethod display-water-marks? water-control ((obj water-control)) - (and *display-water-marks* (logtest? (-> obj flags) (water-flags wt00))) +(defmethod display-water-marks? water-control ((this water-control)) + (and *display-water-marks* (logtest? (-> this flags) (water-flags wt00))) ) (defmethod new water-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 int) (arg2 float) (arg3 float) (arg4 float)) @@ -116,8 +116,8 @@ ) ) -(defmethod distance-from-surface water-control ((obj water-control)) - (- (-> obj top 0 y) (-> obj height)) +(defmethod distance-from-surface water-control ((this water-control)) + (- (-> this top 0 y) (-> this height)) ) (deftype water-vol (process-drawable) diff --git a/goal_src/jak1/engine/common-obs/water.gc b/goal_src/jak1/engine/common-obs/water.gc index fd05158a29..5744ef54ba 100644 --- a/goal_src/jak1/engine/common-obs/water.gc +++ b/goal_src/jak1/engine/common-obs/water.gc @@ -616,98 +616,102 @@ ) ) -(defmethod water-control-method-9 water-control ((obj water-control)) +(defmethod water-control-method-9 water-control ((this water-control)) 0 (none) ) -(defmethod water-control-method-10 water-control ((obj water-control)) +(defmethod water-control-method-10 water-control ((this water-control)) (with-pp - (let ((s5-0 (-> obj flags))) + (let ((s5-0 (-> this flags))) (cond - ((not (logtest? (-> obj flags) (water-flags wt01))) - (logclear! (-> obj flags) (water-flags wt09 wt10 wt11 wt12 wt13 wt14 wt16)) + ((not (logtest? (-> this flags) (water-flags wt01))) + (logclear! (-> this flags) (water-flags wt09 wt10 wt11 wt12 wt13 wt14 wt16)) ) - ((and (logtest? (water-flags wt21) (-> obj flags)) - (logtest? (-> obj process state-flags) (state-flags grabbed)) + ((and (logtest? (water-flags wt21) (-> this flags)) + (logtest? (-> this process state-flags) (state-flags grabbed)) ) - (logior! (-> obj flags) (water-flags wt16)) + (logior! (-> this flags) (water-flags wt16)) ) ((begin - (set! (-> obj top 1 quad) (-> obj top 0 quad)) - (vector<-cspace! (the-as vector (-> obj top)) (-> obj process node-list data (-> obj joint-index))) - (+! (-> obj top 0 y) (-> obj top-y-offset)) - (set! (-> obj bottom 1 quad) (-> obj bottom 0 quad)) - (set! (-> obj bottom 0 quad) (-> obj process root trans quad)) - (logclear! (-> obj flags) (water-flags wt10 wt11 wt12 wt13 wt14)) - (set! (-> obj bob-offset) (update! (-> obj bob))) + (set! (-> this top 1 quad) (-> this top 0 quad)) + (vector<-cspace! (the-as vector (-> this top)) (-> this process node-list data (-> this joint-index))) + (+! (-> this top 0 y) (-> this top-y-offset)) + (set! (-> this bottom 1 quad) (-> this bottom 0 quad)) + (set! (-> this bottom 0 quad) (-> this process root trans quad)) + (logclear! (-> this flags) (water-flags wt10 wt11 wt12 wt13 wt14)) + (set! (-> this bob-offset) (update! (-> this bob))) (cond - ((and (logtest? (-> obj flags) (water-flags wt08)) - (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + ((and (logtest? (-> this flags) (water-flags wt08)) + (not (logtest? (-> (the-as collide-shape-moving (-> this process root)) root-prim prim-core action) (collide-action racer) ) ) ) - (set! (-> obj real-ocean-offset) (- (ocean-get-height (the-as vector (-> obj bottom))) (-> obj base-height))) - (if (not (logtest? (-> obj flags) (water-flags wt09))) - (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) - (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj real-ocean-offset) 0.2)) + (set! (-> this real-ocean-offset) + (- (ocean-get-height (the-as vector (-> this bottom))) (-> this base-height)) + ) + (if (not (logtest? (-> this flags) (water-flags wt09))) + (set! (-> this ocean-offset) (-> this real-ocean-offset)) + (set! (-> this ocean-offset) (lerp (-> this ocean-offset) (-> this real-ocean-offset) 0.2)) ) ) - ((logtest? (water-flags wt20) (-> obj flags)) - (let* ((a0-26 (-> obj volume process 0)) - (f30-0 (ripple-find-height (the-as process-drawable a0-26) 0 (the-as vector (-> obj bottom)))) + ((logtest? (water-flags wt20) (-> this flags)) + (let* ((a0-26 (-> this volume process 0)) + (f30-0 (ripple-find-height (the-as process-drawable a0-26) 0 (the-as vector (-> this bottom)))) ) - (set! (-> obj real-ocean-offset) (- f30-0 (-> obj base-height))) - (if (not (logtest? (-> obj flags) (water-flags wt09))) - (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) - (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj real-ocean-offset) 0.2)) + (set! (-> this real-ocean-offset) (- f30-0 (-> this base-height))) + (if (not (logtest? (-> this flags) (water-flags wt09))) + (set! (-> this ocean-offset) (-> this real-ocean-offset)) + (set! (-> this ocean-offset) (lerp (-> this ocean-offset) (-> this real-ocean-offset) 0.2)) ) (let ((v1-36 (new 'stack-no-clear 'vector))) - (set! (-> v1-36 quad) (-> obj bottom 0 quad)) + (set! (-> v1-36 quad) (-> this bottom 0 quad)) (set! (-> v1-36 y) f30-0) ) ) ) (else - (set! (-> obj real-ocean-offset) 0.0) - (set! (-> obj ocean-offset) 0.0) + (set! (-> this real-ocean-offset) 0.0) + (set! (-> this ocean-offset) 0.0) ) ) - (if (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (if (logtest? (-> (the-as collide-shape-moving (-> this process root)) root-prim prim-core action) (collide-action racer) ) - (set! (-> obj bob-offset) 0.0) + (set! (-> this bob-offset) 0.0) ) - (set! (-> obj height) - (+ (-> obj base-height) (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)) + (set! (-> this height) + (+ (-> this base-height) (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)) ) - (set! (-> obj surface-height) (+ (-> obj base-height) (-> obj real-ocean-offset))) - (set! (-> obj swim-depth) (fmax 0.0 (- (- (-> obj surface-height) (-> obj swim-height)) (-> obj bottom 0 y)))) - (>= (-> obj height) (-> obj bottom 0 y)) + (set! (-> this surface-height) (+ (-> this base-height) (-> this real-ocean-offset))) + (set! (-> this swim-depth) + (fmax 0.0 (- (- (-> this surface-height) (-> this swim-height)) (-> this bottom 0 y))) + ) + (>= (-> this height) (-> this bottom 0 y)) ) - (if (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) - (set! (-> obj on-water-time) (-> *display* base-frame-counter)) + (if (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags on-water)) + (set-time! (-> this on-water-time)) ) - (set! (-> obj drip-wetness) 1.0) - (set! (-> obj drip-height) (fmax (- (-> obj surface-height) (-> obj bottom 0 y)) (-> obj drip-height))) - (set! (-> obj drip-speed) 15.0) - (if (not (logtest? (-> obj flags) (water-flags wt09))) - (water-control-method-15 obj) + (set! (-> this drip-wetness) 1.0) + (set! (-> this drip-height) (fmax (- (-> this surface-height) (-> this bottom 0 y)) (-> this drip-height))) + (set! (-> this drip-speed) 15.0) + (if (not (logtest? (-> this flags) (water-flags wt09))) + (water-control-method-15 this) ) (cond - ((>= (-> obj top 0 y) (-> obj height)) + ((>= (-> this top 0 y) (-> this height)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj bottom 0 quad)) - (vector-xz-length (-> obj process root transv)) - (set! (-> s4-0 y) (-> obj surface-height)) - (when (and (logtest? (-> obj process draw status) (draw-status was-drawn)) - (zero? (-> obj process draw cur-lod)) - (logtest? (water-flags wt22) (-> obj flags)) - (logtest? (water-flags wt23) (-> obj flags)) + (set! (-> s4-0 quad) (-> this bottom 0 quad)) + (vector-xz-length (-> this process root transv)) + (set! (-> s4-0 y) (-> this surface-height)) + (when (and (logtest? (-> this process draw status) (draw-status was-drawn)) + (zero? (-> this process draw cur-lod)) + (logtest? (water-flags wt22) (-> this flags)) + (logtest? (water-flags wt23) (-> this flags)) ) - (let ((f30-1 (y-angle (-> obj process root))) - (f28-0 (vector-xz-length (-> obj process root transv))) + (let ((f30-1 (y-angle (-> this process root))) + (f28-0 (vector-xz-length (-> this process root transv))) ) (set! (-> *part-id-table* 118 init-specs 4 initial-valuef) (+ 24576.0 f30-1)) (set! (-> *part-id-table* 118 init-specs 19 initial-valuef) (+ 49152.0 f30-1)) @@ -719,95 +723,91 @@ (set! (-> *part-id-table* 121 init-specs 18 initial-valuef) f30-1) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 121) s4-0) (when (< f28-0 4096.0) - (set! (-> *part-id-table* 112 init-specs 4 random-rangef) (-> obj ripple-size)) + (set! (-> *part-id-table* 112 init-specs 4 random-rangef) (-> this ripple-size)) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 112) s4-0) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 115) s4-0) ) ) ) - (if (< (-> obj top 1 y) (-> obj height)) - (create-splash obj 0.2 s4-0 1 (-> obj process root transv)) + (if (< (-> this top 1 y) (-> this height)) + (create-splash this 0.2 s4-0 1 (-> this process root transv)) ) ) ) (else - (logior! (-> obj flags) (water-flags wt13)) + (logior! (-> this flags) (water-flags wt13)) ) ) - (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) - (let* ((v1-124 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) - (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data v1-124))) + (when (and (logtest? (-> this flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> this flags))) + (let* ((v1-124 (rand-vu-int-range 3 (+ (-> this process node-list length) -1))) + (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data v1-124))) ) - (set! (-> *part-id-table* 110 init-specs 16 initial-valuef) (-> obj surface-height)) + (set! (-> *part-id-table* 110 init-specs 16 initial-valuef) (-> this surface-height)) (set! (-> *part-id-table* 110 init-specs 1 initial-valuef) - (+ (lerp-scale 12.0 0.4 (the float (- (-> *display* base-frame-counter) (-> obj enter-water-time))) 0.0 600.0) - (* 0.00012207031 (vector-xz-length (-> obj process root transv))) + (+ (lerp-scale 12.0 0.4 (the float (- (current-time) (-> this enter-water-time))) 0.0 600.0) + (* 0.00012207031 (vector-xz-length (-> this process root transv))) ) ) (launch-particles (-> *part-id-table* 110) s4-1) - (set! (-> *part-id-table* 111 init-specs 16 initial-valuef) (-> obj surface-height)) + (set! (-> *part-id-table* 111 init-specs 16 initial-valuef) (-> this surface-height)) (launch-particles (-> *part-id-table* 111) s4-1) ) ) - (let ((f30-3 (- (+ (-> obj base-height) (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)) - (-> obj swim-height) + (let ((f30-3 (- (+ (-> this base-height) (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)) + (-> this swim-height) ) ) ) - (let* ((s4-2 (-> obj process root)) + (let* ((s4-2 (-> this process root)) (v1-146 (if (and (nonzero? s4-2) (type-type? (-> s4-2 type) control-info)) s4-2 ) ) - (s4-3 - (and v1-146 - (< (- (-> *display* base-frame-counter) (-> (the-as control-info v1-146) unknown-dword11)) (seconds 0.5)) - ) - ) + (s4-3 (and v1-146 (not (time-elapsed? (-> (the-as control-info v1-146) unknown-dword11) (seconds 0.5))))) ) - (if (and (logtest? (-> obj flags) (water-flags wt04)) + (if (and (logtest? (-> this flags) (water-flags wt04)) (and s4-3 - (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) + (not (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags on-water)) ) ) ) - (set! (-> obj bob amp) (* 0.8 (-> obj bob amp))) + (set! (-> this bob amp) (* 0.8 (-> this bob amp))) ) (cond - ((and (logtest? (-> obj flags) (water-flags wt03)) - (or (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) - (>= f30-3 (-> obj bottom 0 y)) + ((and (logtest? (-> this flags) (water-flags wt03)) + (or (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags on-water)) + (>= f30-3 (-> this bottom 0 y)) (and (logtest? s5-0 (water-flags wt11)) - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags tsurf)) - (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags onsurf))) - (>= (+ 204.8 f30-3) (-> obj bottom 0 y)) + (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags tsurf)) + (not (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags onsurf))) + (>= (+ 204.8 f30-3) (-> this bottom 0 y)) ) ) (or (logtest? s5-0 (water-flags wt11)) - (< 12288.0 (vector-xz-length (-> obj process root transv))) - (< (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> obj enter-water-time)) - (>= (+ (- 204.8 (fmin 6144.0 (+ (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)))) f30-3) - (-> obj bottom 0 y) + (< 12288.0 (vector-xz-length (-> this process root transv))) + (< (+ (current-time) (seconds -0.2)) (-> this enter-water-time)) + (>= (+ (- 204.8 (fmin 6144.0 (+ (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)))) f30-3) + (-> this bottom 0 y) ) ) ) - (set! (-> obj swim-time) (-> *display* base-frame-counter)) - (send-event (-> obj process) 'swim) - (logior! (-> obj flags) (water-flags wt11)) + (set-time! (-> this swim-time)) + (send-event (-> this process) 'swim) + (logior! (-> this flags) (water-flags wt11)) (if (not (logtest? s5-0 (water-flags wt11))) - (set! (-> obj enter-swim-time) (-> *display* base-frame-counter)) + (set-time! (-> this enter-swim-time)) ) (cond - ((and (logtest? (-> obj flags) (water-flags wt04)) - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags tsurf)) - (not (logtest? (water-flags wt16) (-> obj flags))) + ((and (logtest? (-> this flags) (water-flags wt04)) + (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags tsurf)) + (not (logtest? (water-flags wt16) (-> this flags))) ) (let ((v1-200 (new 'stack-no-clear 'vector))) - (set! (-> v1-200 quad) (-> obj bottom 0 quad)) - (set! (-> v1-200 y) (- (-> obj height) (-> obj swim-height))) - (let ((s4-4 (-> obj process root))) + (set! (-> v1-200 quad) (-> this bottom 0 quad)) + (set! (-> v1-200 y) (- (-> this height) (-> this swim-height))) + (let ((s4-4 (-> this process root))) (when (and (not (logtest? (-> (the-as collide-shape-moving s4-4) status) (cshape-moving-flags csmf12))) - (logtest? (-> obj flags) (water-flags wt11)) + (logtest? (-> this flags) (water-flags wt11)) (not (logtest? (-> (the-as collide-shape-moving s4-4) root-prim prim-core action) (collide-action racer))) ) (let ((a1-27 (vector-! (new 'stack-no-clear 'vector) v1-200 (-> s4-4 trans)))) @@ -819,35 +819,33 @@ ) ) ) - ((and (< (-> obj bottom 0 y) f30-3) (not (logtest? (water-flags wt16) (-> obj flags)))) - (logior! (-> obj flags) (water-flags wt12)) + ((and (< (-> this bottom 0 y) f30-3) (not (logtest? (water-flags wt16) (-> this flags)))) + (logior! (-> this flags) (water-flags wt12)) ) ) ) ((begin - (set! s4-3 (and (logtest? (-> obj flags) (water-flags wt02)) - (or (not (!= (-> obj bob amp) 0.0)) - (>= (- (-> *display* base-frame-counter) (-> obj swim-time)) (seconds 0.05)) - ) - (and (>= (- (-> obj height) (-> obj wade-height)) (-> obj bottom 0 y)) s4-3) + (set! s4-3 (and (logtest? (-> this flags) (water-flags wt02)) + (or (not (!= (-> this bob amp) 0.0)) (time-elapsed? (-> this swim-time) (seconds 0.05))) + (and (>= (- (-> this height) (-> this wade-height)) (-> this bottom 0 y)) s4-3) ) ) s4-3 ) - (set! (-> obj wade-time) (-> *display* base-frame-counter)) - (send-event (-> obj process) 'wade) - (logior! (-> obj flags) (water-flags wt10)) + (set-time! (-> this wade-time)) + (send-event (-> this process) 'wade) + (logior! (-> this flags) (water-flags wt10)) ) ) ) - (when (and (logtest? (-> obj flags) (water-flags wt03)) - (< (-> obj bottom 1 y) f30-3) - (and (< f30-3 (-> obj bottom 0 y)) (logtest? s5-0 (water-flags wt12))) + (when (and (logtest? (-> this flags) (water-flags wt03)) + (< (-> this bottom 1 y) f30-3) + (and (< f30-3 (-> this bottom 0 y)) (logtest? s5-0 (water-flags wt12))) ) - (logior! (-> obj flags) (water-flags wt11)) + (logior! (-> this flags) (water-flags wt11)) (let ((a1-30 (new 'stack-no-clear 'vector))) - (set! (-> a1-30 quad) (-> obj bottom 0 quad)) - (let ((s5-1 (-> obj process root))) + (set! (-> a1-30 quad) (-> this bottom 0 quad)) + (let ((s5-1 (-> this process root))) (set! (-> a1-30 y) f30-3) (when (not (logtest? (-> (the-as collide-shape-moving s5-1) root-prim prim-core action) (collide-action racer))) (let ((f30-4 (-> (the-as collide-shape-moving s5-1) ground-impact-vel))) @@ -860,25 +858,25 @@ ) ) ) - (when (and (logtest? (water-flags wt17) (-> obj flags)) (= (-> obj process type) target)) - (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) + (when (and (logtest? (water-flags wt17) (-> this flags)) (= (-> this process type) target)) + (when (and (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags onsurf on-water) ) - (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (not (logtest? (-> (the-as collide-shape-moving (-> this process root)) root-prim prim-core action) (collide-action racer) ) ) ) - (when (< (-> obj process root trans y) -409.6) - (send-event (-> obj process) 'no-look-around (seconds 1.5)) - (when (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (when (< (-> this process root trans y) -409.6) + (send-event (-> this process) 'no-look-around (seconds 1.5)) + (when (not (logtest? (-> (the-as collide-shape-moving (-> this process root)) root-prim prim-core action) (collide-action flut) ) ) (cond - ((= (-> obj process type) target) + ((= (-> this process type) target) (send-event - (-> obj process) + (-> this process) 'attack #f (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 0)) (mode 'tar))) @@ -896,68 +894,69 @@ (set! (-> a1-33 param 2) (the-as uint v1-281)) ) (set! (-> a1-33 param 3) (the-as uint 0)) - (send-event-function (-> obj process) a1-33) + (send-event-function (-> this process) a1-33) ) ) ) ) - (let ((v1-283 (-> obj process))) + (let ((v1-283 (-> this process))) (set! (-> (the-as collide-shape-moving (-> v1-283 root)) surf) *tar-surface*) (set! (-> (the-as collide-shape-moving (-> v1-283 root)) ground-pat material) 4) ) ) - (set! (-> obj swim-height) (lerp (-> obj swim-height) 7372.8 0.05)) + (set! (-> this swim-height) (lerp (-> this swim-height) 7372.8 0.05)) ) ) ) (else - (if (logtest? (-> obj flags) (water-flags wt09)) - (water-control-method-16 obj) + (if (logtest? (-> this flags) (water-flags wt09)) + (water-control-method-16 this) ) ) ) ) - (when (not (or (not (logtest? (-> obj flags) (water-flags wt06))) - (not (logtest? (water-flags wt23) (-> obj flags))) - (= (-> obj drip-wetness) 0.0) + (when (not (or (not (logtest? (-> this flags) (water-flags wt06))) + (not (logtest? (water-flags wt23) (-> this flags))) + (= (-> this drip-wetness) 0.0) ) ) (cond - ((logtest? (-> obj flags) (water-flags wt15)) + ((logtest? (-> this flags) (water-flags wt15)) (let ((a2-15 - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data (-> obj drip-joint-index))) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data (-> this drip-joint-index))) ) ) (set! (-> *part-id-table* 145 init-specs 16 initial-valuef) - (fmax (-> obj surface-height) (-> obj bottom 0 y)) + (fmax (-> this surface-height) (-> this bottom 0 y)) + ) + (set! (-> *part-id-table* 145 init-specs 8 initial-valuef) (* 0.05 (- (-> a2-15 x) (-> this drip-old-pos x)))) + (set! (-> *part-id-table* 145 init-specs 9 initial-valuef) (* 0.05 (- (-> a2-15 y) (-> this drip-old-pos y)))) + (set! (-> *part-id-table* 145 init-specs 10 initial-valuef) + (* 0.05 (- (-> a2-15 z) (-> this drip-old-pos z))) ) - (set! (-> *part-id-table* 145 init-specs 8 initial-valuef) (* 0.05 (- (-> a2-15 x) (-> obj drip-old-pos x)))) - (set! (-> *part-id-table* 145 init-specs 9 initial-valuef) (* 0.05 (- (-> a2-15 y) (-> obj drip-old-pos y)))) - (set! (-> *part-id-table* 145 init-specs 10 initial-valuef) (* 0.05 (- (-> a2-15 z) (-> obj drip-old-pos z)))) (launch-particles (-> *part-id-table* 145) a2-15) ) - (set! (-> obj drip-time) (-> *display* base-frame-counter)) - (logclear! (-> obj flags) (water-flags wt15)) - (seek! (-> obj drip-wetness) 0.0 (* 0.001 (-> obj drip-speed))) - (set! (-> obj drip-speed) (* 1.05 (-> obj drip-speed))) - (if (= (-> obj drip-wetness) 0.0) - (set! (-> obj drip-height) 0.0) + (set-time! (-> this drip-time)) + (logclear! (-> this flags) (water-flags wt15)) + (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) + (if (= (-> this drip-wetness) 0.0) + (set! (-> this drip-height) 0.0) ) ) - ((>= (- (-> *display* base-frame-counter) - (the-as time-frame (the int (/ (the float (-> obj drip-time)) (-> obj drip-mult)))) + ((time-elapsed? + (the-as time-frame (the int (/ (the float (-> this drip-time)) (-> this drip-mult)))) + (the int (-> this drip-speed)) + ) + (let* ((s5-2 (rand-vu-int-range 3 (+ (-> this process node-list length) -1))) + (v1-328 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-2))) ) - (the int (-> obj drip-speed)) - ) - (let* ((s5-2 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) - (v1-328 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-2))) - ) - (when (and (< (- (-> v1-328 y) (-> obj process root trans y)) (-> obj drip-height)) - (< (-> obj height) (-> v1-328 y)) + (when (and (< (- (-> v1-328 y) (-> this process root trans y)) (-> this drip-height)) + (< (-> this height) (-> v1-328 y)) ) - (set! (-> obj drip-joint-index) s5-2) - (set! (-> obj drip-old-pos quad) (-> v1-328 quad)) - (logior! (-> obj flags) (water-flags wt15)) + (set! (-> this drip-joint-index) s5-2) + (set! (-> this drip-old-pos quad) (-> v1-328 quad)) + (logior! (-> this flags) (water-flags wt15)) ) ) ) @@ -968,8 +967,8 @@ ) ) -(defmethod start-bobbing! water-control ((obj water-control) (arg0 float) (arg1 int) (arg2 int)) - (activate! (-> obj bob) (- arg0) arg1 arg2 0.9 1.0) +(defmethod start-bobbing! water-control ((this water-control) (arg0 float) (arg1 int) (arg2 int)) + (activate! (-> this bob) (- arg0) arg1 arg2 0.9 1.0) 0 (none) ) @@ -1065,41 +1064,41 @@ (none) ) -(defmethod water-control-method-15 water-control ((obj water-control)) +(defmethod water-control-method-15 water-control ((this water-control)) (with-pp - (logior! (-> obj flags) (water-flags wt09)) - (logclear! (-> obj flags) (water-flags wt16)) - (set! (-> obj enter-water-time) (-> *display* base-frame-counter)) - (set-vector! (-> obj enter-water-pos) (-> obj bottom 0 x) (-> obj surface-height) (-> obj bottom 0 z) 1.0) - (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) + (logior! (-> this flags) (water-flags wt09)) + (logclear! (-> this flags) (water-flags wt16)) + (set-time! (-> this enter-water-time)) + (set-vector! (-> this enter-water-pos) (-> this bottom 0 x) (-> this surface-height) (-> this bottom 0 z) 1.0) + (when (and (logtest? (-> this flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> this flags))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) pp) (set! (-> a1-1 num-params) 1) (set! (-> a1-1 message) 'query) (set! (-> a1-1 param 0) (the-as uint 'ground-height)) - (let* ((f0-4 (the-as float (send-event-function (-> obj process) a1-1))) + (let* ((f0-4 (the-as float (send-event-function (-> this process) a1-1))) (f30-0 (lerp-scale 0.3 1.0 f0-4 2048.0 24576.0)) ) - (if (nonzero? (-> obj process skel effect)) - (effect-control-method-10 (-> obj process skel effect) 'swim-stroke 0.0 -1) + (if (nonzero? (-> this process skel effect)) + (effect-control-method-10 (-> this process skel effect) 'swim-stroke 0.0 -1) ) - (create-splash obj f30-0 (-> obj enter-water-pos) 1 (-> obj process root transv)) + (create-splash this f30-0 (-> this enter-water-pos) 1 (-> this process root transv)) ) ) ) - (if (logtest? (water-flags wt17) (-> obj flags)) - (set! (-> obj swim-height) 2867.2) + (if (logtest? (water-flags wt17) (-> this flags)) + (set! (-> this swim-height) 2867.2) ) 0 (none) ) ) -(defmethod water-control-method-16 water-control ((obj water-control)) - (logclear! (-> obj flags) (water-flags wt09)) - (set-zero! (-> obj bob)) - (if (logtest? (water-flags wt17) (-> obj flags)) - (set! (-> obj swim-height) 2867.2) +(defmethod water-control-method-16 water-control ((this water-control)) + (logclear! (-> this flags) (water-flags wt09)) + (set-zero! (-> this bob)) + (if (logtest? (water-flags wt17) (-> this flags)) + (set! (-> this swim-height) 2867.2) ) 0 (none) @@ -1124,10 +1123,10 @@ (none) ) -(defmethod create-splash water-control ((obj water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector)) - (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) +(defmethod create-splash water-control ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector)) + (when (and (logtest? (-> this flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> this flags))) (let ((a1-3 (vector+float*! (new 'stack-no-clear 'vector) arg1 arg3 0.05))) - (set! (-> a1-3 y) (-> obj surface-height)) + (set! (-> a1-3 y) (-> this surface-height)) (splash-spawn (the-as basic arg0) (the-as basic a1-3) arg2) ) ) @@ -1135,13 +1134,13 @@ (none) ) -(defmethod on-exit-water water-vol ((obj water-vol)) - (when (handle->process (-> obj target)) - (let ((v1-7 (-> (the-as target (-> obj target process 0)) water))) +(defmethod on-exit-water water-vol ((this water-vol)) + (when (handle->process (-> this target)) + (let ((v1-7 (-> (the-as target (-> this target process 0)) water))) (logclear! (-> v1-7 flags) (water-flags wt01 wt02 wt03 wt08 wt17 wt18 wt19 wt20 wt21 wt23 wt24 wt25 wt26)) (set! (-> v1-7 volume) (the-as handle #f)) ) - (set! (-> obj target) (the-as handle #f)) + (set! (-> this target) (the-as handle #f)) (iterate-process-tree *entity-pool* (lambda ((arg0 water-vol)) (with-pp @@ -1152,40 +1151,40 @@ ) *null-kernel-context* ) - (process-entity-status! obj (entity-perm-status bit-3) #f) + (process-entity-status! this (entity-perm-status bit-3) #f) ) 0 (none) ) -(defmethod update! water-vol ((obj water-vol)) +(defmethod update! water-vol ((this water-vol)) (cond - ((handle->process (-> obj target)) + ((handle->process (-> this target)) (cond - ((not (point-in-vol? (-> obj vol) (-> (the-as target (-> obj target process 0)) control trans))) - (on-exit-water obj) + ((not (point-in-vol? (-> this vol) (-> (the-as target (-> this target process 0)) control trans))) + (on-exit-water this) ) (else - (let ((v1-15 (-> (the-as target (-> obj target process 0)) water))) - (when (and (logtest? (water-flags wt19) (-> obj flags)) + (let ((v1-15 (-> (the-as target (-> this target process 0)) water))) + (when (and (logtest? (water-flags wt19) (-> this flags)) (logtest? (-> v1-15 flags) (water-flags wt09)) (>= (-> v1-15 surface-height) (-> v1-15 bottom 0 y)) ) - (let ((v1-18 (-> obj attack-event))) + (let ((v1-18 (-> this attack-event))) (case v1-18 ((#f) ) (('heat) - (send-event (handle->process (-> obj target)) 'heat (* 10.0 (-> *display* seconds-per-frame))) + (send-event (handle->process (-> this target)) 'heat (* 10.0 (seconds-per-frame))) ) (('drown-death 'lava 'dark-eco-pool) - (if (send-event (handle->process (-> obj target)) 'attack-invinc #f (static-attack-info ((mode v1-18)))) - (send-event obj 'notify 'attack) + (if (send-event (handle->process (-> this target)) 'attack-invinc #f (static-attack-info ((mode v1-18)))) + (send-event this 'notify 'attack) ) ) (else - (if (send-event (handle->process (-> obj target)) 'attack #f (static-attack-info ((mode v1-18)))) - (send-event obj 'notify 'attack) + (if (send-event (handle->process (-> this target)) 'attack #f (static-attack-info ((mode v1-18)))) + (send-event this 'notify 'attack) ) ) ) @@ -1196,25 +1195,25 @@ ) ) ((and *target* (and (not (handle->process (-> *target* water volume))) - (point-in-vol? (-> obj vol) (-> *target* control trans)) + (point-in-vol? (-> this vol) (-> *target* control trans)) ) ) (let ((s5-0 (-> *target* water))) - (process-entity-status! obj (entity-perm-status bit-3) #t) - (set! (-> s5-0 volume) (process->handle obj)) - (set! (-> obj target) (process->handle *target*)) + (process-entity-status! this (entity-perm-status bit-3) #t) + (set! (-> s5-0 volume) (process->handle this)) + (set! (-> this target) (process->handle *target*)) (logior! (-> s5-0 flags) (water-flags wt01)) - (set! (-> s5-0 base-height) (-> obj water-height)) + (set! (-> s5-0 base-height) (-> this water-height)) (set! (-> s5-0 ocean-offset) 0.0) - (logior! (-> s5-0 flags) (-> obj flags)) - (if (< 0.0 (-> obj wade-height)) - (set! (-> s5-0 wade-height) (-> obj wade-height)) + (logior! (-> s5-0 flags) (-> this flags)) + (if (< 0.0 (-> this wade-height)) + (set! (-> s5-0 wade-height) (-> this wade-height)) ) - (if (< 0.0 (-> obj swim-height)) - (set! (-> s5-0 swim-height) (-> obj swim-height)) + (if (< 0.0 (-> this swim-height)) + (set! (-> s5-0 swim-height) (-> this swim-height)) ) - (if (< 0.0 (-> obj bottom-height)) - (set! (-> s5-0 bottom-height) (-> obj bottom-height)) + (if (< 0.0 (-> this bottom-height)) + (set! (-> s5-0 bottom-height) (-> this bottom-height)) ) (set-zero! (-> s5-0 bob)) ) @@ -1249,43 +1248,43 @@ :code anim-loop ) -(defmethod set-stack-size! water-vol ((obj water-vol)) - (stack-size-set! (-> obj main-thread) 128) +(defmethod set-stack-size! water-vol ((this water-vol)) + (stack-size-set! (-> this main-thread) 128) (none) ) -(defmethod reset-root! water-vol ((obj water-vol)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod reset-root! water-vol ((this water-vol)) + (set! (-> this root) (new 'process 'trsqv)) (none) ) -(defmethod water-vol-method-25 water-vol ((obj water-vol)) +(defmethod water-vol-method-25 water-vol ((this water-vol)) 0 (none) ) -(defmethod init! water-vol ((obj water-vol)) +(defmethod init! water-vol ((this water-vol)) (local-vars (sv-16 res-tag)) - (set! (-> obj attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) - (-> obj entity) - 'attack-event - 'interp - -1000000000.0 - 'drown - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) + (-> this entity) + 'attack-event + 'interp + -1000000000.0 + 'drown + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) - (process-drawable-from-entity! obj (-> obj entity)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj vol) (new 'process 'vol-control obj)) - (logior! (-> obj vol flags) 3) - (set! (-> obj bottom-height) 32768.0) - (set! (-> obj target) (the-as handle #f)) + (process-drawable-from-entity! this (-> this entity)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this vol) (new 'process 'vol-control this)) + (logior! (-> this vol flags) 3) + (set! (-> this bottom-height) 32768.0) + (set! (-> this target) (the-as handle #f)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-8 (the-as (pointer float) ((method-of-type res-lump get-property-data) - (-> obj entity) + (-> this entity) 'water-height 'exact -1000000000.0 @@ -1297,25 +1296,25 @@ ) ) (when v1-8 - (set! (-> obj water-height) (-> v1-8 0)) - (set! (-> obj wade-height) (-> v1-8 1)) - (set! (-> obj swim-height) (-> v1-8 2)) + (set! (-> this water-height) (-> v1-8 0)) + (set! (-> this wade-height) (-> v1-8 1)) + (set! (-> this swim-height) (-> v1-8 2)) (if (>= (-> sv-16 elt-count) (the-as uint 4)) - (set! (-> obj flags) (the-as water-flags (the int (-> v1-8 3)))) + (set! (-> this flags) (the-as water-flags (the int (-> v1-8 3)))) ) (if (>= (-> sv-16 elt-count) (the-as uint 5)) - (set! (-> obj bottom-height) (-> v1-8 4)) + (set! (-> this bottom-height) (-> v1-8 4)) ) ) ) - (logior! (-> obj flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt23)) (cond - ((zero? (-> obj flags)) - (if (< 0.0 (-> obj wade-height)) - (logior! (-> obj flags) (water-flags wt02)) + ((zero? (-> this flags)) + (if (< 0.0 (-> this wade-height)) + (logior! (-> this flags) (water-flags wt02)) ) - (if (< 0.0 (-> obj swim-height)) - (logior! (-> obj flags) (water-flags wt03)) + (if (< 0.0 (-> this swim-height)) + (logior! (-> this flags) (water-flags wt03)) ) ) (else @@ -1324,7 +1323,7 @@ (none) ) -(defmethod water-vol-method-22 water-vol ((obj water-vol)) +(defmethod water-vol-method-22 water-vol ((this water-vol)) 0 (none) ) @@ -1340,12 +1339,12 @@ (none) ) -(defmethod init-from-entity! water-vol ((obj water-vol) (arg0 entity-actor)) - (set-stack-size! obj) - (reset-root! obj) - (init! obj) - (water-vol-method-25 obj) - (water-vol-method-22 obj) - (go (method-of-object obj water-vol-startup)) +(defmethod init-from-entity! water-vol ((this water-vol) (arg0 entity-actor)) + (set-stack-size! this) + (reset-root! this) + (init! this) + (water-vol-method-25 this) + (water-vol-method-22 this) + (go (method-of-object this water-vol-startup)) (none) ) diff --git a/goal_src/jak1/engine/data/art-h.gc b/goal_src/jak1/engine/data/art-h.gc index 6551887ed5..4b3c077e05 100644 --- a/goal_src/jak1/engine/data/art-h.gc +++ b/goal_src/jak1/engine/data/art-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: art-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; joint animation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -380,9 +382,9 @@ ) ) -(defmethod get-skeleton-origin draw-control ((obj draw-control)) +(defmethod get-skeleton-origin draw-control ((this draw-control)) "Get the origin of the skeleton. Must have up-to-date bones." - (-> obj skeleton bones 0 position) + (-> this skeleton bones 0 position) ) ;; look up the index of an art element in an art group. diff --git a/goal_src/jak1/engine/debug/assert-h.gc b/goal_src/jak1/engine/debug/assert-h.gc index 8c3908ccef..83a2a13c9b 100644 --- a/goal_src/jak1/engine/debug/assert-h.gc +++ b/goal_src/jak1/engine/debug/assert-h.gc @@ -5,6 +5,7 @@ ;; name in dgo: assert-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS (deftype __assert-info-private-struct (structure) ((filename string :offset-assert 0) @@ -20,15 +21,15 @@ ) ) -(defmethod set-pos __assert-info-private-struct ((obj __assert-info-private-struct) (filename string) (line-num uint) (column-num uint)) - (set! (-> obj filename) filename) - (set! (-> obj line-num) line-num) - (set! (-> obj column-num) column-num) +(defmethod set-pos __assert-info-private-struct ((this __assert-info-private-struct) (filename string) (line-num uint) (column-num uint)) + (set! (-> this filename) filename) + (set! (-> this line-num) line-num) + (set! (-> this column-num) column-num) 0 ) -(defmethod print-pos __assert-info-private-struct ((obj __assert-info-private-struct)) - (format #t "file ~S.gc, line ~D, col ~D.~%" (-> obj filename) (-> obj line-num) (-> obj column-num)) +(defmethod print-pos __assert-info-private-struct ((this __assert-info-private-struct)) + (format #t "file ~S.gc, line ~D, col ~D.~%" (-> this filename) (-> this line-num) (-> this column-num)) 0 ) diff --git a/goal_src/jak1/engine/debug/debug-h.gc b/goal_src/jak1/engine/debug/debug-h.gc index c636aef4d5..f968ed24bd 100644 --- a/goal_src/jak1/engine/debug/debug-h.gc +++ b/goal_src/jak1/engine/debug/debug-h.gc @@ -8,6 +8,15 @@ ;; TODO - for anim-tester (define-extern *debug-menu-context* debug-menu-context) +(define-extern add-debug-matrix (function symbol bucket-id matrix matrix)) +(define-extern add-debug-text-sphere (function symbol bucket-id vector float string rgba symbol)) +;; TODO - for trajectory.gc +(define-extern add-debug-line (function symbol bucket-id vector vector rgba symbol rgba symbol)) + +(defun-extern add-debug-sphere symbol bucket-id vector float rgba symbol) + +;; DECOMP BEGINS + ;; circular buffer of positions to draw. (deftype pos-history (structure) ((points (inline-array vector) :offset-assert 0) @@ -43,10 +52,3 @@ :flag-assert #x900004b10 ) - -(define-extern add-debug-matrix (function symbol bucket-id matrix matrix)) -(define-extern add-debug-text-sphere (function symbol bucket-id vector float string rgba symbol)) -;; TODO - for trajectory.gc -(define-extern add-debug-line (function symbol bucket-id vector vector rgba symbol rgba symbol)) - -(defun-extern add-debug-sphere symbol bucket-id vector float rgba symbol) diff --git a/goal_src/jak1/engine/debug/debug-sphere.gc b/goal_src/jak1/engine/debug/debug-sphere.gc index 409ad6c30b..782217940d 100644 --- a/goal_src/jak1/engine/debug/debug-sphere.gc +++ b/goal_src/jak1/engine/debug/debug-sphere.gc @@ -9,6 +9,8 @@ (defconstant DEBUG_SPHERE_SEC_H DEBUG_SPHERE_SEC_AMT) (defconstant DEBUG_SPHERE_SEC_W DEBUG_SPHERE_SEC_AMT) +;; DECOMP BEGINS + (deftype debug-sphere-table (basic) ((point vector 300 :inline :offset-assert 16) ) diff --git a/goal_src/jak1/engine/debug/debug.gc b/goal_src/jak1/engine/debug/debug.gc index 2c04a8fec3..34e90b3a63 100644 --- a/goal_src/jak1/engine/debug/debug.gc +++ b/goal_src/jak1/engine/debug/debug.gc @@ -9,6 +9,7 @@ ;; In general, the 3d functions draw using the camera and the 2d functions draw in screen coordinated. ;; Most functions take a boolean as their first argument. If the boolean is set to #f, it will skip drawing the point. +;; DECOMP BEGINS (defun transform-float-point ((in vector) (out vector4w)) "Transform point in and store the result in out. diff --git a/goal_src/jak1/engine/debug/memory-usage-h.gc b/goal_src/jak1/engine/debug/memory-usage-h.gc index 969f0fc0b8..b587416ef0 100644 --- a/goal_src/jak1/engine/debug/memory-usage-h.gc +++ b/goal_src/jak1/engine/debug/memory-usage-h.gc @@ -5,6 +5,11 @@ ;; name in dgo: memory-usage-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + +;; this file is debug only +(declare-file (debug)) + ;; The memory-usage system is used to track how much memory is used by tracking statistics for categories. ;; It can be used in different ways for different objects. ;; - DMA memory usage per renderer diff --git a/goal_src/jak1/engine/debug/memory-usage.gc b/goal_src/jak1/engine/debug/memory-usage.gc index a0786706d0..17ac10a966 100644 --- a/goal_src/jak1/engine/debug/memory-usage.gc +++ b/goal_src/jak1/engine/debug/memory-usage.gc @@ -11,7 +11,7 @@ (declare-file (debug)) -(defmethod inspect memory-usage-block ((obj memory-usage-block)) +(defmethod inspect memory-usage-block ((this memory-usage-block)) "Print the memory-usage by category. This is a large print." (format #t "-------------------------------------------------------------~%") (format #t " # name count bytes used aligned bytes~%") @@ -19,8 +19,8 @@ (let ((s5-0 0) (s4-0 0) ) - (dotimes (s3-0 (-> obj length)) - (let ((v1-2 (-> obj data s3-0))) + (dotimes (s3-0 (-> this length)) + (let ((v1-2 (-> this data s3-0))) (+! s5-0 (-> v1-2 used)) (+! s4-0 (-> v1-2 total)) (format #t "~3D: ~20S ~7D ~8D ~8D~%" @@ -35,36 +35,36 @@ (format #t "total: ~8D ~8D~%" s5-0 s4-0) ) (format #t "-------------------------------------------------------------~%") - obj + this ) -(defmethod mem-usage object ((obj object) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage object ((this object) (arg0 memory-usage-block) (arg1 int)) "Most general mem-usage message. Just prints a warning, in case you expect this to do something." - (if obj - (format #t "WARNING: mem-usage called on object, probably not what was wanted for ~A~%" obj) + (if this + (format #t "WARNING: mem-usage called on object, probably not what was wanted for ~A~%" this) ) - obj + this ) -(defmethod calculate-total memory-usage-block ((obj memory-usage-block)) +(defmethod calculate-total memory-usage-block ((this memory-usage-block)) "Compute the total memory usage of everything in the block." (let ((v0-0 0)) - (dotimes (v1-0 (-> obj length)) - (+! v0-0 (-> obj data v1-0 total)) + (dotimes (v1-0 (-> this length)) + (+! v0-0 (-> this data v1-0 total)) ) v0-0 ) ) -(defmethod reset! memory-usage-block ((obj memory-usage-block)) +(defmethod reset! memory-usage-block ((this memory-usage-block)) "Reset all memory stats to 0." - (set! (-> obj length) 0) + (set! (-> this length) 0) (dotimes (v1-0 109) - (set! (-> obj data v1-0 used) 0) - (set! (-> obj data v1-0 total) 0) - (set! (-> obj data v1-0 count) 0) + (set! (-> this data v1-0 used) 0) + (set! (-> this data v1-0 total) 0) + (set! (-> this data v1-0 count) 0) ) - obj + this ) (defun mem-size ((arg0 basic) (arg1 symbol) (arg2 int)) @@ -78,20 +78,20 @@ ) ) -(defmethod compute-memory-usage level ((obj level) (arg0 object)) +(defmethod compute-memory-usage level ((this level) (arg0 object)) "Compute the memory usage of a level. Arg0 will force a recalculation." - (if (zero? (-> obj mem-usage-block)) - (set! (-> obj mem-usage-block) (new 'debug 'memory-usage-block)) + (if (zero? (-> this mem-usage-block)) + (set! (-> this mem-usage-block) (new 'debug 'memory-usage-block)) ) - (set! arg0 (or (zero? (-> obj mem-usage-block length)) arg0)) + (set! arg0 (or (zero? (-> this mem-usage-block length)) arg0)) (when arg0 - (mem-usage obj (reset! (-> obj mem-usage-block)) 0) - (set! (-> obj mem-usage) (calculate-total (-> obj mem-usage-block))) + (mem-usage this (reset! (-> this mem-usage-block)) 0) + (set! (-> this mem-usage) (calculate-total (-> this mem-usage-block))) ) - (-> obj mem-usage-block) + (-> this mem-usage-block) ) -(defmethod mem-usage process-tree ((obj process-tree) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage process-tree ((this process-tree) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a process tree." (let ((v1-0 87)) (let* ((a0-1 *dead-pool-list*) @@ -137,7 +137,7 @@ ) ) (iterate-process-tree - obj + this (lambda ((arg0 process)) (let ((gp-0 *temp-mem-usage*)) (let ((s4-0 (cond @@ -300,19 +300,19 @@ ) *null-kernel-context* ) - obj + this ) ;; the max dma ever (excluding debug) (define *max-dma* 0) -(defmethod print-mem-usage memory-usage-block ((obj memory-usage-block) (arg0 level) (arg1 object)) +(defmethod print-mem-usage memory-usage-block ((this memory-usage-block) (arg0 level) (arg1 object)) "Print memory usage. Uses a foramt that will fit on screen." ;; print header (same in normal and compact mode) (let ((s3-0 (&- (-> arg0 heap current) (the-as uint (-> arg0 heap base))))) - (let ((v1-2 (+ (-> obj data 59 total) (-> obj data 60 total)))) + (let ((v1-2 (+ (-> this data 59 total) (-> this data 60 total)))) (< #x10000 v1-2) ) ;; note: this uses a value that's slightly smaller than the real size. @@ -373,7 +373,7 @@ ;; the left column is level heap, the right column is non-debug dma. (format arg1 " bsp ~192H~5DK ~280Hdebug~456H~5DK~%" - (sar (+ (-> obj data 56 total) (-> obj data 57 total) (-> obj data 58 total)) 10) + (sar (+ (-> this data 56 total) (-> this data 57 total) (-> this data 58 total)) 10) (sar (-> *dma-mem-usage* data 84 total) 10) ) @@ -386,18 +386,18 @@ ) ) - (format arg1 " bsp-leaf-vis-adj ~192H~5DK~%" (sar (+ (-> obj data 59 total) (-> obj data 60 total)) 10)) - (format arg1 " level-code ~192H~5DK~%" (sar (-> obj data 63 total) 10)) + (format arg1 " bsp-leaf-vis-adj ~192H~5DK~%" (sar (+ (-> this data 59 total) (-> this data 60 total)) 10)) + (format arg1 " level-code ~192H~5DK~%" (sar (-> this data 63 total) 10)) (format arg1 " tfrag ~192H~5DK ~280Htfragment~456H~5DK~%" - (sar (+ (-> obj data 1 total) - (-> obj data 2 total) - (-> obj data 3 total) - (-> obj data 4 total) - (-> obj data 5 total) - (-> obj data 6 total) - (-> obj data 7 total) - (-> obj data 8 total) + (sar (+ (-> this data 1 total) + (-> this data 2 total) + (-> this data 3 total) + (-> this data 4 total) + (-> this data 5 total) + (-> this data 6 total) + (-> this data 7 total) + (-> this data 8 total) ) 10 ) @@ -405,14 +405,14 @@ ) (format arg1 " tie-proto ~192H~5DK ~280Hsky~456H~5DK~%" - (sar (+ (-> obj data 9 total) - (-> obj data 10 total) - (-> obj data 11 total) - (-> obj data 12 total) - (-> obj data 13 total) - (-> obj data 14 total) - (-> obj data 16 total) - (-> obj data 17 total) + (sar (+ (-> this data 9 total) + (-> this data 10 total) + (-> this data 11 total) + (-> this data 12 total) + (-> this data 13 total) + (-> this data 14 total) + (-> this data 16 total) + (-> this data 17 total) ) 10 ) @@ -420,10 +420,10 @@ ) (format arg1 " tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%" - (sar (+ (-> obj data 18 total) - (-> obj data 20 total) - (-> obj data 21 total) - (-> obj data 22 total) + (sar (+ (-> this data 18 total) + (-> this data 20 total) + (-> this data 21 total) + (-> this data 22 total) ) 10 ) @@ -431,15 +431,15 @@ ) (format arg1 " shrub-proto ~192H~5DK ~280Htie-near~456H~5DK~%" - (sar (+ (-> obj data 25 total) - (-> obj data 26 total) - (-> obj data 27 total) - (-> obj data 28 total) - (-> obj data 29 total) - (-> obj data 30 total) - (-> obj data 31 total) - (-> obj data 32 total) - (-> obj data 33 total) + (sar (+ (-> this data 25 total) + (-> this data 26 total) + (-> this data 27 total) + (-> this data 28 total) + (-> this data 29 total) + (-> this data 30 total) + (-> this data 31 total) + (-> this data 32 total) + (-> this data 33 total) ) 10 ) @@ -447,17 +447,17 @@ ) (format arg1 " shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%" - (sar (-> obj data 34 total) 10) + (sar (-> this data 34 total) 10) (sar (-> *dma-mem-usage* data 27 total) 10) ) (format arg1 " collision ~192H~5DK ~280Htie-generic~456H~5DK~%" - (sar (+ (-> obj data 50 total) - (-> obj data 51 total) - (-> obj data 52 total) - (-> obj data 53 total) - (-> obj data 54 total) - (-> obj data 55 total) + (sar (+ (-> this data 50 total) + (-> this data 51 total) + (-> this data 52 total) + (-> this data 53 total) + (-> this data 54 total) + (-> this data 55 total) ) 10 ) @@ -465,22 +465,22 @@ ) (format arg1 " pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%" - (sar (+ (-> obj data 35 total) - (-> obj data 36 total) - (-> obj data 37 total) - (-> obj data 38 total) - (-> obj data 39 total) - (-> obj data 40 total) - (-> obj data 41 total) - (-> obj data 42 total) - (-> obj data 70 total) - (-> obj data 71 total) - (-> obj data 72 total) - (-> obj data 73 total) - (-> obj data 75 total) - (-> obj data 78 total) - (-> obj data 77 total) - (-> obj data 108 total) + (sar (+ (-> this data 35 total) + (-> this data 36 total) + (-> this data 37 total) + (-> this data 38 total) + (-> this data 39 total) + (-> this data 40 total) + (-> this data 41 total) + (-> this data 42 total) + (-> this data 70 total) + (-> this data 71 total) + (-> this data 72 total) + (-> this data 73 total) + (-> this data 75 total) + (-> this data 78 total) + (-> this data 77 total) + (-> this data 108 total) ) 10 ) @@ -488,13 +488,13 @@ ) (format arg1 " pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%" - (sar (+ (-> obj data 65 total) - (-> obj data 66 total) - (-> obj data 67 total) - (-> obj data 68 total) - (-> obj data 69 total) - (-> obj data 74 total) - (-> obj data 76 total) + (sar (+ (-> this data 65 total) + (-> this data 66 total) + (-> this data 67 total) + (-> this data 68 total) + (-> this data 69 total) + (-> this data 74 total) + (-> this data 76 total) ) 10 ) @@ -502,30 +502,30 @@ ) (format arg1 " textures ~192H~5DK ~280Htextures~456H~5DK~%" - (sar (-> obj data 79 total) 10) + (sar (-> this data 79 total) 10) (sar (-> *dma-mem-usage* data 79 total) 10) ) (format arg1 " entity ~192H~5DK~%" - (sar (+ (-> obj data 64 total) - (-> obj data 43 total) - (-> obj data 44 total) - (-> obj data 45 total) - (-> obj data 49 total) - (-> obj data 48 total) - (-> obj data 46 total) - (-> obj data 47 total) + (sar (+ (-> this data 64 total) + (-> this data 43 total) + (-> this data 44 total) + (-> this data 45 total) + (-> this data 49 total) + (-> this data 48 total) + (-> this data 46 total) + (-> this data 47 total) ) 10 ) ) (format arg1 " misc ~192H~5DK ~280Hsprite~456H~5DK~%" - (sar (+ (-> obj data 0 total) - (-> obj data 61 total) - (-> obj data 62 total) - (-> obj data 80 total) - (-> obj data 81 total) + (sar (+ (-> this data 0 total) + (-> this data 61 total) + (-> this data 62 total) + (-> this data 80 total) + (-> this data 81 total) ) 10 ) diff --git a/goal_src/jak1/engine/debug/menu.gc b/goal_src/jak1/engine/debug/menu.gc index 425d6eb194..f4de8ad6fb 100644 --- a/goal_src/jak1/engine/debug/menu.gc +++ b/goal_src/jak1/engine/debug/menu.gc @@ -11,14 +11,14 @@ ;; A "menu" is a listing of "items". ;; An item is a line in the menu. It can be a flag, function, or variable. +(declare-type debug-menu basic) +(declare-type debug-menu-item basic) + +;; DECOMP BEGINS ;; this file is debug only (declare-file (debug)) - -(declare-type debug-menu basic) -(declare-type debug-menu-item basic) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; context, menu, and item ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1506,6 +1506,3 @@ ) arg0 ) - - - diff --git a/goal_src/jak1/engine/debug/part-tester.gc b/goal_src/jak1/engine/debug/part-tester.gc index 553eeecc2e..75472f5bb0 100644 --- a/goal_src/jak1/engine/debug/part-tester.gc +++ b/goal_src/jak1/engine/debug/part-tester.gc @@ -30,11 +30,11 @@ (define-extern *part-tester* part-tester) (define *part-tester-name* (the-as string #f)) -(defmethod deactivate part-tester ((obj part-tester)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate part-tester ((this part-tester)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) diff --git a/goal_src/jak1/engine/debug/stats-h.gc b/goal_src/jak1/engine/debug/stats-h.gc index 2a21698224..f0b81a51e4 100644 --- a/goal_src/jak1/engine/debug/stats-h.gc +++ b/goal_src/jak1/engine/debug/stats-h.gc @@ -72,15 +72,15 @@ (define *pc-perf-stat-counter* (the-as uint 0)) -(defmethod reset! perf-stat ((obj perf-stat)) +(defmethod reset! perf-stat ((this perf-stat)) "Perfomance counters are partially implemented, they just count cycles." - (+! (-> obj count) 1) - (when (nonzero? (-> obj ctrl)) + (+! (-> this count) 1) + (when (nonzero? (-> this ctrl)) (set! *pc-perf-stat-counter* (get-cpu-clock)) ) #| - (let ((v1-0 (-> obj ctrl))) - (+! (-> obj count) 1) + (let ((v1-0 (-> this ctrl))) + (+! (-> this count) 1) (b! (zero? v1-0) cfg-2) (.mtc0 Perf r0-0) (.sync.l) @@ -98,32 +98,32 @@ (none) ) -(defmethod read! perf-stat ((obj perf-stat)) +(defmethod read! perf-stat ((this perf-stat)) "Perfomance counters are partially implemented, they just count cycles." - (when (nonzero? (-> obj ctrl)) - (+! (-> obj accum0) (- (get-cpu-clock) *pc-perf-stat-counter*)) - (set! (-> obj accum1) 0) + (when (nonzero? (-> this ctrl)) + (+! (-> this accum0) (- (get-cpu-clock) *pc-perf-stat-counter*)) + (set! (-> this accum1) 0) ) #| - (b! (zero? (-> obj ctrl)) cfg-2) + (b! (zero? (-> this ctrl)) cfg-2) (.mtc0 Perf r0-0) (.sync.l) (.sync.p) (.mfpc v1-1 pcr0) - (+! (-> obj accum0) (the-as uint v1-1)) + (+! (-> this accum0) v1-1) (.mfpc v1-3 pcr1) - (+! (-> obj accum1) (the-as uint v1-3)) + (+! (-> this accum1) v1-3) (label cfg-2) |# (none) ) -(defmethod update-wait-stats perf-stat ((obj perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) - (when (nonzero? (-> obj ctrl)) - (+! (-> obj to-vu0-waits) arg0) - (+! (-> obj to-spr-waits) arg1) - (+! (-> obj from-spr-waits) arg2) +(defmethod update-wait-stats perf-stat ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) + (when (nonzero? (-> this ctrl)) + (+! (-> this to-vu0-waits) arg0) + (+! (-> this to-spr-waits) arg1) + (+! (-> this from-spr-waits) arg2) ) 0 (none) diff --git a/goal_src/jak1/engine/debug/viewer.gc b/goal_src/jak1/engine/debug/viewer.gc index 2fd6d26758..9c3f0995ea 100644 --- a/goal_src/jak1/engine/debug/viewer.gc +++ b/goal_src/jak1/engine/debug/viewer.gc @@ -172,10 +172,10 @@ ) ) -(defmethod init-from-entity! viewer ((obj viewer) (arg0 entity-actor)) - (set! *viewer* obj) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! viewer ((this viewer) (arg0 entity-actor)) + (set! *viewer* this) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (actor-get-arg! viewer-ja-name "ja" (res-lump-struct arg0 'name string)) (actor-get-arg! viewer-geo-name "geo" (res-lump-struct arg0 'name string)) (let ((gp-1 (-> arg0 etype))) diff --git a/goal_src/jak1/engine/dma/dma-buffer.gc b/goal_src/jak1/engine/dma/dma-buffer.gc index 54884fca5c..3210ea30eb 100644 --- a/goal_src/jak1/engine/dma/dma-buffer.gc +++ b/goal_src/jak1/engine/dma/dma-buffer.gc @@ -5,6 +5,8 @@ ;; name in dgo: dma-buffer ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; DMA buffers store data to be sent over DMA. ;; They are a very simple wrapper around the data. ;; Typically a dma-buffer will store dma-buckets or other more complicated data structures. @@ -96,21 +98,21 @@ ) ) -(defun dma-buffer-inplace-new ((obj dma-buffer) (size int)) +(defun dma-buffer-inplace-new ((this dma-buffer) (size int)) "Create a dma-buffer in-place. Does not set the type of the dma-buffer object." - (set! (-> obj base) (-> obj data)) - (set! (-> obj allocated-length) size) - obj + (set! (-> this base) (-> this data)) + (set! (-> this allocated-length) size) + this ) -(defmethod length dma-buffer ((obj dma-buffer)) +(defmethod length dma-buffer ((this dma-buffer)) "Get the amount of data the buffer can hold, in bytes." - (-> obj allocated-length) + (-> this allocated-length) ) -(defmethod asize-of dma-buffer ((obj dma-buffer)) +(defmethod asize-of dma-buffer ((this dma-buffer)) "Get the size in memory of the object" - (+ (+ (-> obj allocated-length) -4) (the-as int (-> dma-buffer size))) + (+ (+ (-> this allocated-length) -4) (the-as int (-> dma-buffer size))) ) (defun dma-buffer-length ((arg0 dma-buffer)) @@ -471,5 +473,3 @@ ) ) ) - - diff --git a/goal_src/jak1/engine/dma/dma-disasm.gc b/goal_src/jak1/engine/dma/dma-disasm.gc index 4163df67e8..fcaf2da2a6 100644 --- a/goal_src/jak1/engine/dma/dma-disasm.gc +++ b/goal_src/jak1/engine/dma/dma-disasm.gc @@ -6,6 +6,10 @@ ;; dgos: GAME, ENGINE ;; Debug tool to print out a DMA list. + +;; DECOMP BEGINS + +;; this file is debug only (declare-file (debug)) (deftype vif-disasm-element (structure) diff --git a/goal_src/jak1/engine/dma/dma-h.gc b/goal_src/jak1/engine/dma/dma-h.gc index bb6a0782b6..2d540738f4 100644 --- a/goal_src/jak1/engine/dma/dma-h.gc +++ b/goal_src/jak1/engine/dma/dma-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: dma-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; Constants/type for the PS2 DMA hardware ;; There are a number of DMA channels. ;; The PS2 supports several types of DMA, including simple chunk transfer and more complicated diff --git a/goal_src/jak1/engine/draw/draw-node-h.gc b/goal_src/jak1/engine/draw/draw-node-h.gc index e94ad51523..aece3287c4 100644 --- a/goal_src/jak1/engine/draw/draw-node-h.gc +++ b/goal_src/jak1/engine/draw/draw-node-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: draw-node-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; A "draw-node" is a way to group together a bunch of drawables (possibly other draw-nodes) in a BVH ;; This BVH is used for sphere-in-view culling and the broad phase collision detection. ;; _most_ uses of draw-node are in a special tree with these properties: diff --git a/goal_src/jak1/engine/draw/draw-node.gc b/goal_src/jak1/engine/draw/draw-node.gc index 883679708b..6a3cf14472 100644 --- a/goal_src/jak1/engine/draw/draw-node.gc +++ b/goal_src/jak1/engine/draw/draw-node.gc @@ -5,6 +5,7 @@ ;; name in dgo: draw-node ;; dgos: GAME, ENGINE +;; DECOMP BEGINS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Draw Node Collisions @@ -18,48 +19,48 @@ ;; For an unknown reason, the input to the collision query (the box we're colliding with) is not. ;; It's stored in *collide-work* -(defmethod collide-with-box draw-node ((obj draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) "Find collisions with the box in the current collision query, add results to collide-list." ;; loop over ourself and our brothers (dotimes (s3-0 arg0) - (if (collide-cache-using-box-test (-> obj bsphere)) ;; do we collide with the bounding sphere? + (if (collide-cache-using-box-test (-> this bsphere)) ;; do we collide with the bounding sphere? ;; if so, do the collision check with the geometry. - (collide-with-box (-> obj child) (the-as int (-> obj child-count)) arg1) + (collide-with-box (-> this child) (the-as int (-> this child-count)) arg1) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) ) -(defmethod collide-y-probe draw-node ((obj draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) - (if (collide-cache-using-y-probe-test (-> obj bsphere)) - (collide-y-probe (-> obj child) (the-as int (-> obj child-count)) arg1) + (if (collide-cache-using-y-probe-test (-> this bsphere)) + (collide-y-probe (-> this child) (the-as int (-> this child-count)) arg1) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) ) -(defmethod collide-ray draw-node ((obj draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) - (if (collide-cache-using-line-sphere-test (-> obj bsphere)) - (collide-ray (-> obj child) (the-as int (-> obj child-count)) arg1) + (if (collide-cache-using-line-sphere-test (-> this bsphere)) + (collide-ray (-> this child) (the-as int (-> this child-count)) arg1) ) - (&+! obj 32) + (&+! this 32) ) (none) ) -(defmethod collect-ambients draw-node ((obj draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients draw-node ((this draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (dotimes (s2-0 arg1) - (if (spheres-overlap? arg0 (the-as sphere (-> obj bsphere))) - (collect-ambients (-> obj child) arg0 (the-as int (-> obj child-count)) arg2) + (if (spheres-overlap? arg0 (the-as sphere (-> this bsphere))) + (collect-ambients (-> this child) arg0 (the-as int (-> this child-count)) arg2) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) @@ -73,53 +74,53 @@ ;; This class is a convenient wrapper around an inline-array of draw-nodes. ;; It lets you treat this array like a normal drawable (at least for collisions). -(defmethod inspect drawable-inline-array-node ((obj drawable-inline-array-node)) +(defmethod inspect drawable-inline-array-node ((this drawable-inline-array-node)) "Custom inspect for drawable-inline-array-node to print our nodes." - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) -(defmethod mem-usage drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-node ((this drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a drawable-inline-array-node. Only counts the nodes, doesn't count the node children." (set! (-> arg0 length) (max 62 (-> arg0 length))) (set! (-> arg0 data 61 name) "draw-node") - (+! (-> arg0 data 61 count) (-> obj length)) - (let ((v1-6 (asize-of obj))) + (+! (-> arg0 data 61 count) (-> this length)) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 61 used) v1-6) (+! (-> arg0 data 61 total) (logand -16 (+ v1-6 15))) ) - obj + this ) -(defmethod asize-of drawable-inline-array-node ((obj drawable-inline-array-node)) - (the-as int (+ (-> drawable-inline-array-node size) (* (+ (-> obj length) -1) 32))) +(defmethod asize-of drawable-inline-array-node ((this drawable-inline-array-node)) + (the-as int (+ (-> drawable-inline-array-node size) (* (+ (-> this length) -1) 32))) ) -(defmethod collide-with-box drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) ;; call on the first in the array, then it will loop through all the brothers. - (collide-with-box (-> obj data 0) (-> obj length) arg1) + (collide-with-box (-> this data 0) (-> this length) arg1) 0 (none) ) -(defmethod collide-y-probe drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 int) (arg1 collide-list)) - (collide-y-probe (-> obj data 0) (-> obj length) arg1) +(defmethod collide-y-probe drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) + (collide-y-probe (-> this data 0) (-> this length) arg1) 0 (none) ) -(defmethod collide-ray drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 int) (arg1 collide-list)) - (collide-ray (-> obj data 0) (-> obj length) arg1) +(defmethod collide-ray drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) + (collide-ray (-> this data 0) (-> this length) arg1) (none) ) -(defmethod collect-ambients drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) - (collect-ambients (-> obj data 0) arg0 (-> obj length) arg2) +(defmethod collect-ambients drawable-inline-array-node ((this drawable-inline-array-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) + (collect-ambients (-> this data 0) arg0 (-> this length) arg2) 0 (none) ) diff --git a/goal_src/jak1/engine/draw/drawable-actor-h.gc b/goal_src/jak1/engine/draw/drawable-actor-h.gc index 61d90077d6..13aaada045 100644 --- a/goal_src/jak1/engine/draw/drawable-actor-h.gc +++ b/goal_src/jak1/engine/draw/drawable-actor-h.gc @@ -10,6 +10,8 @@ (declare-type entity-actor basic) +;; DECOMP BEGINS + ;; the actual drawable is just a reference to the actor itself. (deftype drawable-actor (drawable) ((actor entity-actor :offset 8) @@ -33,7 +35,7 @@ ) -(defmethod draw drawable-tree-actor ((obj drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) +(defmethod draw drawable-tree-actor ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) "Do nothing, actor data is not drawn." (none) ) diff --git a/goal_src/jak1/engine/draw/drawable-ambient-h.gc b/goal_src/jak1/engine/draw/drawable-ambient-h.gc index d0da6e88d7..035a556cf5 100644 --- a/goal_src/jak1/engine/draw/drawable-ambient-h.gc +++ b/goal_src/jak1/engine/draw/drawable-ambient-h.gc @@ -5,11 +5,11 @@ ;; name in dgo: drawable-ambient-h ;; dgos: GAME, ENGINE - (declare-type entity-ambient basic) - (define-extern vector-for-ambient (function process-drawable vector vector)) +;; DECOMP BEGINS + ;; the "ambient" system has a bunch of triggers for background sounds, hints, and similar events. ;; each ambient also has a simple drawable that just contains a reference to the entity. @@ -39,12 +39,12 @@ :flag-assert #x1200000044 ) -(defmethod draw drawable-tree-ambient ((obj drawable-tree-ambient) (arg0 drawable-tree-ambient) (arg1 display-frame)) +(defmethod draw drawable-tree-ambient ((this drawable-tree-ambient) (arg0 drawable-tree-ambient) (arg1 display-frame)) "Do nothing - ambients are not drawn." (none) ) -(defmethod unpack-vis drawable-tree-ambient ((obj drawable-tree-ambient) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree-ambient ((this drawable-tree-ambient) (arg0 (pointer int8)) (arg1 (pointer int8))) "Do nothing - ambients do not use vis." arg1 ) diff --git a/goal_src/jak1/engine/draw/drawable-group.gc b/goal_src/jak1/engine/draw/drawable-group.gc index 3f78d95b71..29931ce370 100644 --- a/goal_src/jak1/engine/draw/drawable-group.gc +++ b/goal_src/jak1/engine/draw/drawable-group.gc @@ -5,6 +5,8 @@ ;; name in dgo: drawable-group ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (defmethod new drawable-group ((allocation symbol) (type-to-make type) (arg0 int)) "Allocate a drawable-group with enough room for arg0 drawables" (let ((v0-0 (object-new allocation type-to-make @@ -17,60 +19,60 @@ ) ) -(defmethod inspect drawable-group ((obj drawable-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect drawable-group ((this drawable-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) -(defmethod print drawable-group ((obj drawable-group)) - (format #t "#<~A @ #x~X [~D]" (-> obj type) obj (-> obj length)) - (dotimes (s5-0 (-> obj length)) - (format #t " ~A" (-> obj data s5-0)) +(defmethod print drawable-group ((this drawable-group)) + (format #t "#<~A @ #x~X [~D]" (-> this type) this (-> this length)) + (dotimes (s5-0 (-> this length)) + (format #t " ~A" (-> this data s5-0)) ) (format #t ">") - obj + this ) -(defmethod length drawable-group ((obj drawable-group)) - (-> obj length) +(defmethod length drawable-group ((this drawable-group)) + (-> this length) ) -(defmethod asize-of drawable-group ((obj drawable-group)) - (the-as int (+ (-> drawable-group size) (* (+ (-> obj length) -1) 4))) +(defmethod asize-of drawable-group ((this drawable-group)) + (the-as int (+ (-> drawable-group size) (* (+ (-> this length) -1) 4))) ) -(defmethod mem-usage drawable-group ((obj drawable-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-group ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 0 used) v1-6) (+! (-> arg0 data 0 total) (logand -16 (+ v1-6 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod login drawable-group ((obj drawable-group)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login drawable-group ((this drawable-group)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) -(defmethod draw drawable-group ((obj drawable-group) (arg0 drawable-group) (arg1 display-frame)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (s3-0 (-> obj length)) - (draw (-> obj data s3-0) (-> (the-as drawable-group arg0) data s3-0) arg1) +(defmethod draw drawable-group ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (s3-0 (-> this length)) + (draw (-> this data s3-0) (-> (the-as drawable-group arg0) data s3-0) arg1) ) ) ) @@ -78,11 +80,11 @@ (none) ) -(defmethod collect-stats drawable-group ((obj drawable-group)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj data s5-0)) +(defmethod collect-stats drawable-group ((this drawable-group)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this data s5-0)) ) ) ) @@ -91,12 +93,12 @@ ) -(defmethod debug-draw drawable-group ((obj drawable-group) (arg0 drawable) (arg1 display-frame)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (s3-0 (-> obj length)) +(defmethod debug-draw drawable-group ((this drawable-group) (arg0 drawable) (arg1 display-frame)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (s3-0 (-> this length)) (debug-draw - (-> obj data s3-0) + (-> this data s3-0) (-> (the-as drawable-group arg0) data s3-0) arg1 ) @@ -107,9 +109,9 @@ (none) ) -(defmethod unpack-vis drawable-group ((obj drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) - (dotimes (s4-0 (-> obj length) arg1) - (set! arg1 (unpack-vis (-> obj data s4-0) arg0 arg1)) +(defmethod unpack-vis drawable-group ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) + (dotimes (s4-0 (-> this length) arg1) + (set! arg1 (unpack-vis (-> this data s4-0) arg0 arg1)) ) arg1 ) \ No newline at end of file diff --git a/goal_src/jak1/engine/draw/drawable-h.gc b/goal_src/jak1/engine/draw/drawable-h.gc index 97ed034a64..b28c4ef8c1 100644 --- a/goal_src/jak1/engine/draw/drawable-h.gc +++ b/goal_src/jak1/engine/draw/drawable-h.gc @@ -7,6 +7,7 @@ (declare-type ambient-list structure) (declare-type collide-list structure) +(declare-type drawable-error drawable) ;; These is the base class for the scene graph node. ;; Note that it doesn't always make sense to call all of these methods on all types, @@ -15,7 +16,9 @@ ;; In many cases, "draw" simply adds data to a buffer that must later be converted to dma in finish-background ;; or similar. Or just does nothing. -(declare-type drawable-error drawable) + +;; DECOMP BEGINS + (deftype drawable (basic) ((id int16 :offset-assert 4) ;; ID number for visibility (not always used) (bsphere vector :inline :offset-assert 16) ;; bounding sphere diff --git a/goal_src/jak1/engine/draw/drawable-inline-array-h.gc b/goal_src/jak1/engine/draw/drawable-inline-array-h.gc index 4a203a5d28..e2ab57c6fb 100644 --- a/goal_src/jak1/engine/draw/drawable-inline-array-h.gc +++ b/goal_src/jak1/engine/draw/drawable-inline-array-h.gc @@ -12,6 +12,8 @@ ;; a drawable-inline-array itself has no idea what it stores so you almost always need a more specific type. ;; without a more specific type, the stride of the elements is unknown. +;; DECOMP BEGINS + (deftype drawable-inline-array (drawable) ((length int16 :offset 6) ) diff --git a/goal_src/jak1/engine/draw/drawable-inline-array.gc b/goal_src/jak1/engine/draw/drawable-inline-array.gc index 2431bf6ded..09b27ed57e 100644 --- a/goal_src/jak1/engine/draw/drawable-inline-array.gc +++ b/goal_src/jak1/engine/draw/drawable-inline-array.gc @@ -7,24 +7,26 @@ ;; - All these methods are stubs -(defmethod length drawable-inline-array ((obj drawable-inline-array)) - (-> obj length) +;; DECOMP BEGINS + +(defmethod length drawable-inline-array ((this drawable-inline-array)) + (-> this length) ) -(defmethod login drawable-inline-array ((obj drawable-inline-array)) - obj +(defmethod login drawable-inline-array ((this drawable-inline-array)) + this ) -(defmethod draw drawable-inline-array ((obj drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) +(defmethod draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) (none) ) -(defmethod collect-stats drawable-inline-array ((obj drawable-inline-array)) +(defmethod collect-stats drawable-inline-array ((this drawable-inline-array)) 0 (none) ) -(defmethod debug-draw drawable-inline-array ((obj drawable-inline-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) 0 (none) ) diff --git a/goal_src/jak1/engine/draw/drawable-tree-h.gc b/goal_src/jak1/engine/draw/drawable-tree-h.gc index 1c1218c8fc..c34bc487ed 100644 --- a/goal_src/jak1/engine/draw/drawable-tree-h.gc +++ b/goal_src/jak1/engine/draw/drawable-tree-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: drawable-tree-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; a drawable-tree is a top level grouping for all the drawables in a certain category. ;; for example, there might be a drawable-tree for all the tfrags, one for all the ties, etc. (deftype drawable-tree (drawable-group) diff --git a/goal_src/jak1/engine/draw/drawable-tree.gc b/goal_src/jak1/engine/draw/drawable-tree.gc index 639632ed9c..87c5930c93 100644 --- a/goal_src/jak1/engine/draw/drawable-tree.gc +++ b/goal_src/jak1/engine/draw/drawable-tree.gc @@ -11,15 +11,17 @@ ;; This file contains common functions for all drawable trees. -(defmethod draw drawable-tree-array ((obj drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) +;; DECOMP BEGINS + +(defmethod draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) "Draw a drawable tree array. If the current level is set to special or special-vis, the draw is skipped." (let ((v1-1 (-> (scratchpad-object terrain-context) bsp lev-index))) (case (-> *level* level v1-1 display?) (('special 'special-vis #f) ) (else - (dotimes (s3-0 (-> obj length)) - (draw (-> obj trees s3-0) (-> arg0 trees s3-0) arg1) + (dotimes (s3-0 (-> this length)) + (draw (-> this trees s3-0) (-> arg0 trees s3-0) arg1) ) ) ) @@ -28,26 +30,26 @@ (none) ) -(defmethod collect-stats drawable-tree-array ((obj drawable-tree-array)) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj trees s5-0)) +(defmethod collect-stats drawable-tree-array ((this drawable-tree-array)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this trees s5-0)) ) (none) ) -(defmethod debug-draw drawable-tree-array ((obj drawable-tree-array) (arg0 drawable) (arg1 display-frame)) - (dotimes (s3-0 (-> obj length)) - (debug-draw (-> obj trees s3-0) (-> (the-as drawable-tree-array arg0) trees s3-0) arg1) +(defmethod debug-draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) + (dotimes (s3-0 (-> this length)) + (debug-draw (-> this trees s3-0) (-> (the-as drawable-tree-array arg0) trees s3-0) arg1) ) (none) ) -(defmethod unpack-vis drawable-tree ((obj drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) "Copy our visibility data from arg1 to arg0, unpacking it." (local-vars (t5-1 int)) ;; grab the first array - (let* ((v1-0 (the-as drawable-inline-array-node (-> obj data 0))) + (let* ((v1-0 (the-as drawable-inline-array-node (-> this data 0))) ;; first elt in top array (a3-1 (/ (-> v1-0 data 0 id) 8)) ;; number in first array (8 or fewer) @@ -69,13 +71,13 @@ ) ) ;; now, the remaining arrays, excluding the final which isn't a draw node array. - (let ((v1-5 (+ (-> obj length) -1))) + (let ((v1-5 (+ (-> this length) -1))) (when (nonzero? v1-5) (dotimes (a3-5 v1-5) ;; pointer to this array - (let* ((t0-4 (-> obj data a3-5)) + (let* ((t0-4 (-> this data a3-5)) ;; pointer to next depth array - (t2-0 (-> obj data (+ a3-5 1))) + (t2-0 (-> this data (+ a3-5 1))) ;; id of first in prev (t1-5 (/ (-> (the-as drawable-inline-array-node t0-4) data 0 id) 8)) ;; id of first in next diff --git a/goal_src/jak1/engine/draw/drawable.gc b/goal_src/jak1/engine/draw/drawable.gc index 96c04c62c7..57a603fc10 100644 --- a/goal_src/jak1/engine/draw/drawable.gc +++ b/goal_src/jak1/engine/draw/drawable.gc @@ -5,6 +5,8 @@ ;; name in dgo: drawable ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (defun sphere-cull ((arg0 vector)) #t ;; todo @@ -147,51 +149,51 @@ (none) ) -(defmethod login drawable ((obj drawable)) - obj +(defmethod login drawable ((this drawable)) + this ) -(defmethod draw drawable ((obj drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) -(defmethod collide-with-box drawable ((obj drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box drawable ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) -(defmethod collide-y-probe drawable ((obj drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe drawable ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) -(defmethod collide-ray drawable ((obj drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray drawable ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) -(defmethod collect-ambients drawable ((obj drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients drawable ((this drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list)) 0 (none) ) -(defmethod collect-stats drawable ((obj drawable)) +(defmethod collect-stats drawable ((this drawable)) 0 (none) ) -(defmethod debug-draw drawable ((obj drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) -(defmethod draw drawable-error ((obj drawable-error) (arg0 drawable-error) (arg1 display-frame)) +(defmethod draw drawable-error ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) (error-sphere arg0 (-> arg0 name)) (none) ) -(defmethod unpack-vis drawable ((obj drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) diff --git a/goal_src/jak1/engine/engine/connect.gc b/goal_src/jak1/engine/engine/connect.gc index 589f2a97ea..9c66c3a7da 100644 --- a/goal_src/jak1/engine/engine/connect.gc +++ b/goal_src/jak1/engine/engine/connect.gc @@ -18,6 +18,7 @@ ;; A "connection" is really just a function that gets called when the engine runs, or a set of parameters that the engine can iterate through. +;; DECOMP BEGINS ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; connectable @@ -79,18 +80,18 @@ ) ) -(defmethod inspect connection ((obj connection)) - (format #t "[~8x] ~A~%" obj 'connection) - (format #t "~Tnext0: ~`connectable`P~%" (-> obj next0)) - (format #t "~Tprev0: ~`connectable`P~%" (-> obj prev0)) - (format #t "~Tnext1: ~`connectable`P~%" (-> obj next1)) - (format #t "~Tprev1: ~`connectable`P~%" (-> obj prev1)) - (format #t "~Tparam0: ~A~%" (-> obj param0)) - (format #t "~Tparam1: ~A~%" (-> obj param1)) - (format #t "~Tparam2: ~A~%" (-> obj param2)) - (format #t "~Tparam3: ~A~%" (-> obj param3)) - (format #t "~Tquad[2] @ #x~X~%" (&-> obj next0)) - obj +(defmethod inspect connection ((this connection)) + (format #t "[~8x] ~A~%" this 'connection) + (format #t "~Tnext0: ~`connectable`P~%" (-> this next0)) + (format #t "~Tprev0: ~`connectable`P~%" (-> this prev0)) + (format #t "~Tnext1: ~`connectable`P~%" (-> this next1)) + (format #t "~Tprev1: ~`connectable`P~%" (-> this prev1)) + (format #t "~Tparam0: ~A~%" (-> this param0)) + (format #t "~Tparam1: ~A~%" (-> this param1)) + (format #t "~Tparam2: ~A~%" (-> this param2)) + (format #t "~Tparam3: ~A~%" (-> this param3)) + (format #t "~Tquad[2] @ #x~X~%" (&-> this next0)) + this ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -139,193 +140,193 @@ ) ) -(defmethod belongs-to-process? connection ((obj connection) (arg0 process)) +(defmethod belongs-to-process? connection ((this connection) (arg0 process)) "Does this connection belong to the given process?" - (= arg0 ((method-of-type connection get-process) obj)) + (= arg0 ((method-of-type connection get-process) this)) ) -(defmethod print connection ((obj connection)) +(defmethod print connection ((this connection)) "Print a connection and its parameters" (format #t "#" - (-> obj param0) - (-> obj param1) - (-> obj param2) - (-> obj param3) - obj + (-> this param0) + (-> this param1) + (-> this param2) + (-> this param3) + this ) - obj + this ) -(defmethod get-engine connection ((obj connection)) +(defmethod get-engine connection ((this connection)) "Get the engine for this connection. This must be used on a live connection." ;; back up, until we get to the node that's inline on the engine. - (while (-> obj prev0) + (while (-> this prev0) (nop!) (nop!) - (set! obj (the connection (-> obj prev0))) + (set! this (the connection (-> this prev0))) ) - ;; obj is now alive-list field in an engine, so we can do an offset trick: - (the-as engine (&+ obj -28)) + ;; this is now alive-list field in an engine, so we can do an offset trick: + (the-as engine (&+ this -28)) ) -(defmethod get-process connection ((obj connection)) +(defmethod get-process connection ((this connection)) "Get the process for this connection" ;; same trick as get-engine, but backs up using prev1 until we hit the process. - (while (-> obj prev1) + (while (-> this prev1) (nop!) (nop!) - (set! obj (the connection (-> obj prev1))) + (set! this (the connection (-> this prev1))) ) ;; got to the root connection-list in the process. - (the-as process (&+ obj -92)) + (the-as process (&+ this -92)) ) -(defmethod belongs-to-engine? connection ((obj connection) (arg0 engine)) +(defmethod belongs-to-engine? connection ((this connection) (arg0 engine)) "Check to see if this connection is located in the data section of the engine. This works on dead or alive connections." ;; we can be clever and just see if it has the right address. - (and (< (the-as int arg0) (the-as int obj)) - (< (the-as int obj) (the-as int (-> arg0 data (-> arg0 allocated-length)))) + (and (< (the-as int arg0) (the-as int this)) + (< (the-as int this) (the-as int (-> arg0 data (-> arg0 allocated-length)))) ) ) -(defmethod get-first-connectable engine ((obj engine)) +(defmethod get-first-connectable engine ((this engine)) "Get the first connectable on the alive list. This should be a valid connection." - (-> obj alive-list next0) + (-> this alive-list next0) ) -(defmethod get-last-connectable engine ((obj engine)) +(defmethod get-last-connectable engine ((this engine)) "Get the last connectable on the alive list. I think the returned connectable is invalid." - (-> obj alive-list-end) + (-> this alive-list-end) ) -(defmethod unknown-1 engine ((obj engine) (arg0 (pointer uint32))) +(defmethod unknown-1 engine ((this engine) (arg0 (pointer uint32))) "Not clear what this does. Possibly get next." (the-as uint32 (-> arg0 0)) ) (defmethod new engine ((allocation symbol) (type-to-make type) (name basic) (length int)) "Allocate a new engine with enough room for length connections." - (local-vars (obj engine) (idx-to-link int) (end-idx int)) - (set! obj (object-new allocation type-to-make + (local-vars (this engine) (idx-to-link int) (end-idx int)) + (set! this (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (the-as uint (shl (+ length -1) 5)))) ) ) - (set! (-> obj allocated-length) length) + (set! (-> this allocated-length) length) ;; in use - (set! (-> obj length) 0) - (set! (-> obj name) name) + (set! (-> this length) 0) + (set! (-> this name) name) ;; link the alive list first/last with next0/prev0 ;; alive-list <-> alive-list-end - (set! (-> obj alive-list next0) (-> obj alive-list-end)) - (set! (-> obj alive-list prev0) #f) - (set! (-> obj alive-list next1) #f) - (set! (-> obj alive-list prev1) #f) - (set! (-> obj alive-list-end next0) #f) - (set! (-> obj alive-list-end prev0) (-> obj alive-list)) - (set! (-> obj alive-list-end next1) #f) - (set! (-> obj alive-list-end prev1) #f) + (set! (-> this alive-list next0) (-> this alive-list-end)) + (set! (-> this alive-list prev0) #f) + (set! (-> this alive-list next1) #f) + (set! (-> this alive-list prev1) #f) + (set! (-> this alive-list-end next0) #f) + (set! (-> this alive-list-end prev0) (-> this alive-list)) + (set! (-> this alive-list-end next1) #f) + (set! (-> this alive-list-end prev1) #f) ;; link the dead list first/last with the stuff in data. ;; dead-list <-> (-> data 0) ... dead-list-end ;; dead-list to data[0] - (set! (-> obj dead-list next0) (-> obj data 0)) - (set! (-> obj dead-list prev0) #f) - (set! (-> obj dead-list next1) #f) - (set! (-> obj dead-list prev1) #f) + (set! (-> this dead-list next0) (-> this data 0)) + (set! (-> this dead-list prev0) #f) + (set! (-> this dead-list next1) #f) + (set! (-> this dead-list prev1) #f) ;; end to data[-1] - (set! (-> obj dead-list-end next0) #f) - (set! (-> obj dead-list-end prev0) (-> obj data (+ length -1))) - (set! (-> obj dead-list-end next1) #f) - (set! (-> obj dead-list-end prev1) #f) + (set! (-> this dead-list-end next0) #f) + (set! (-> this dead-list-end prev0) (-> this data (+ length -1))) + (set! (-> this dead-list-end next1) #f) + (set! (-> this dead-list-end prev1) #f) ;; data[0] to dead-list - (set! (-> obj data 0 prev0) (-> obj dead-list)) + (set! (-> this data 0 prev0) (-> this dead-list)) ;; data[0] to data[1] - (set! (-> obj data 0 next0) (the connectable (&+ obj 124))) + (set! (-> this data 0 next0) (the connectable (&+ this 124))) ;; loop over datas. (set! idx-to-link 1) (set! end-idx (+ length -2)) (while (>= end-idx idx-to-link) - (set! (-> obj data idx-to-link prev0) (-> obj data (+ idx-to-link -1))) - (set! (-> obj data idx-to-link next0) (-> obj data (+ idx-to-link 1))) + (set! (-> this data idx-to-link prev0) (-> this data (+ idx-to-link -1))) + (set! (-> this data idx-to-link next0) (-> this data (+ idx-to-link 1))) (+! idx-to-link 1) ) ;; data[-1] to data[-2] - (set! (-> obj data (+ length -1) prev0) (-> obj data (+ length -2))) + (set! (-> this data (+ length -1) prev0) (-> this data (+ length -2))) ;; data[-1] to dead-list-end - (set! (-> obj data (+ length -1) next0) (-> obj dead-list-end)) - obj + (set! (-> this data (+ length -1) next0) (-> this dead-list-end)) + this ) -(defmethod print engine ((obj engine)) +(defmethod print engine ((this engine)) "Print an engine and its name" - (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) - obj + (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) + this ) -(defmethod inspect engine ((obj engine)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tengine-time: ~D~%" (-> obj engine-time)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) +(defmethod inspect engine ((this engine)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tengine-time: ~D~%" (-> this engine-time)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Talive-list:~%") (let ((s5-0 *print-column*)) (set! *print-column* (+ *print-column* 8)) - ((method-of-type connectable inspect) (-> obj alive-list)) + ((method-of-type connectable inspect) (-> this alive-list)) (set! *print-column* s5-0) ) (format #t "~Talive-list-end:~%") (let ((s5-1 *print-column*)) (set! *print-column* (+ *print-column* 8)) - ((method-of-type connectable inspect) (-> obj alive-list-end)) + ((method-of-type connectable inspect) (-> this alive-list-end)) (set! *print-column* s5-1) ) (format #t "~Tdead-list:~%") (let ((s5-2 *print-column*)) (set! *print-column* (+ *print-column* 8)) - ((method-of-type connectable inspect) (-> obj dead-list)) + ((method-of-type connectable inspect) (-> this dead-list)) (set! *print-column* s5-2) ) (format #t "~Tdead-list-end:~%") (let ((s5-3 *print-column*)) (set! *print-column* (+ *print-column* 8)) - ((method-of-type connectable inspect) (-> obj dead-list-end)) + ((method-of-type connectable inspect) (-> this dead-list-end)) (set! *print-column* s5-3) ) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj data)) - obj + (format #t "~Tdata[~D]: @ #x~X~%" (-> this allocated-length) (-> this data)) + this ) -(defmethod length engine ((obj engine)) +(defmethod length engine ((this engine)) "Get the in-use length of an engine" - (-> obj length) + (-> this length) ) -(defmethod asize-of engine ((obj engine)) +(defmethod asize-of engine ((this engine)) "Get the size in memory of an engine" (the-as int - (+ (-> engine size) (the-as uint (shl (+ (-> obj allocated-length) -1) 5))) + (+ (-> engine size) (the-as uint (shl (+ (-> this allocated-length) -1) 5))) ) ) -(defmethod apply-to-connections engine ((obj engine) (f (function connectable none))) +(defmethod apply-to-connections engine ((this engine) (f (function connectable none))) "Apply f to all connections for the engine. It's okay to have f remove the connection." - (let* ((current (-> obj alive-list next0)) + (let* ((current (-> this alive-list next0)) ;; need to get this _before_ running f, in case we remove. (next (-> current next0)) ) - (while (!= current (-> obj alive-list-end)) + (while (!= current (-> this alive-list-end)) (f current) (set! current next) (set! next (-> next next0)) @@ -334,11 +335,11 @@ 0 ) -(defmethod apply-to-connections-reverse engine ((obj engine) (f (function connectable none))) +(defmethod apply-to-connections-reverse engine ((this engine) (f (function connectable none))) "Apply f to all connections, reverse order. Do not use f to remove yourself from the list." - (let ((iter (-> obj alive-list-end prev0))) - (while (!= iter (-> obj alive-list)) + (let ((iter (-> this alive-list-end prev0))) + (while (!= iter (-> this alive-list)) (f iter) (set! iter (-> iter prev0)) ) @@ -346,14 +347,14 @@ 0 ) -(defmethod execute-connections engine ((obj engine) (arg0 object)) +(defmethod execute-connections engine ((this engine) (arg0 object)) "Run the engine!" ;; remember when - (set! (-> obj engine-time) (-> *display* real-frame-counter)) + (set! (-> this engine-time) (-> *display* real-frame-counter)) ;; go through the connection list, in reverse. - (let ((ct (the-as connection (-> obj alive-list-end prev0)))) - (while (!= ct (-> obj alive-list)) + (let ((ct (the-as connection (-> this alive-list-end prev0)))) + (while (!= ct (-> this alive-list)) ;; execute! ((the-as (function int int int object object) (-> ct param0)) (-> ct param1) (-> ct param2) (-> ct param3) arg0) ;; advance to previous. @@ -363,11 +364,11 @@ 0 ) -(defmethod execute-connections-and-move-to-dead engine ((obj engine) (arg0 object)) +(defmethod execute-connections-and-move-to-dead engine ((this engine) (arg0 object)) "Run the engine! If any objects return 'dead, then remove them" - (set! (-> obj engine-time) (-> *display* real-frame-counter)) - (let ((ct (the-as connection (-> obj alive-list-end prev0)))) - (while (!= ct (-> obj alive-list)) + (set! (-> this engine-time) (-> *display* real-frame-counter)) + (let ((ct (the-as connection (-> this alive-list-end prev0)))) + (while (!= ct (-> this alive-list)) ;; execute function (let ((result ((the-as (function int int int object object) (-> ct param0)) (-> ct param1) (-> ct param2) (-> ct param3) arg0))) ;; set the next one, _before_ removing @@ -382,10 +383,10 @@ 0 ) -(defmethod execute-connections-if-needed engine ((obj engine) (arg0 object)) +(defmethod execute-connections-if-needed engine ((this engine) (arg0 object)) "Execute connections, but only if it hasn't been done on this frame." - (when (!= (-> *display* real-frame-counter) (-> obj engine-time)) - (execute-connections obj arg0) + (when (!= (-> *display* real-frame-counter) (-> this engine-time)) + (execute-connections this arg0) ) ) @@ -404,17 +405,17 @@ ) (when *debug-segment* - (defmethod inspect-all-connections engine ((obj engine)) + (defmethod inspect-all-connections engine ((this engine)) "inspect all of the connections." - (apply-to-connections obj + (apply-to-connections this (the (function connection none) (method-of-type connection inspect))) - obj + this ) ) (defmethod add-connection engine - ((obj engine) + ((this engine) (proc process) (func object) ;; not always a function, you can technically put whatever (p1 object) @@ -424,11 +425,11 @@ "Add a connection between this engine and a given process." (local-vars (con connectable)) ;; grab a connection from the dead list - (set! con (-> obj dead-list next0)) + (set! con (-> this dead-list next0)) ;; when we have both a valid process and a valid connectable (when (not (or (not proc) - (= con (-> obj dead-list-end)))) + (= con (-> this dead-list-end)))) (let ((con (the connection con))) ;; set the params of the connection (set! (-> con param0) (the basic func)) @@ -436,13 +437,13 @@ (set! (-> con param2) (the int p2)) (set! (-> con param3) (the int p3)) ;; splice us out of the dead list - (set! (-> obj dead-list next0) (-> con next0)) - (set! (-> con next0 prev0) (-> obj dead-list)) + (set! (-> this dead-list next0) (-> con next0)) + (set! (-> con next0 prev0) (-> this dead-list)) ;; and into the live list - (set! (-> con next0) (-> obj alive-list next0)) + (set! (-> con next0) (-> this alive-list next0)) (set! (-> con next0 prev0) con) - (set! (-> con prev0) (-> obj alive-list)) - (set! (-> obj alive-list next0) con) + (set! (-> con prev0) (-> this alive-list)) + (set! (-> this alive-list next0) con) ;; also splice into the process list (set! (-> con next1) (-> proc connection-list next1)) (when (-> con next1) @@ -450,35 +451,35 @@ ) (set! (-> con prev1) (-> proc connection-list)) (set! (-> proc connection-list next1) con) - (set! (-> obj length) (+ (-> obj length) 1)) + (set! (-> this length) (+ (-> this length) 1)) con ) ) ) -(defmethod move-to-dead connection ((obj connection)) +(defmethod move-to-dead connection ((this connection)) "Move this connection from the alive list to the dead list" (local-vars (v1-1 engine)) ;; get our engine - (set! v1-1 (get-engine obj)) + (set! v1-1 (get-engine this)) ;; splice us out of the engine list - (set! (-> obj prev0 next0) (-> obj next0)) - (set! (-> obj next0 prev0) (-> obj prev0)) + (set! (-> this prev0 next0) (-> this next0)) + (set! (-> this next0 prev0) (-> this prev0)) ;; splice us out of the process list list - (set! (-> obj prev1 next1) (-> obj next1)) + (set! (-> this prev1 next1) (-> this next1)) ;; next can be #f for process list! - (if (-> obj next1) - (set! (-> obj next1 prev1) (-> obj prev1)) + (if (-> this next1) + (set! (-> this next1 prev1) (-> this prev1)) ) ;; insert to the beginning of the deat list - (set! (-> obj next0) (-> v1-1 dead-list next0)) - (set! (-> obj next0 prev0) obj) - (set! (-> obj prev0) (-> v1-1 dead-list)) - (set! (-> v1-1 dead-list next0) obj) + (set! (-> this next0) (-> v1-1 dead-list next0)) + (set! (-> this next0 prev0) this) + (set! (-> this prev0) (-> v1-1 dead-list)) + (set! (-> v1-1 dead-list next0) this) ;; decrement the length. (set! (-> v1-1 length) (+ (-> v1-1 length) -1)) - obj + this ) (defun process-disconnect ((arg0 process)) @@ -495,14 +496,14 @@ (set! v0-1 0) ) -(defmethod remove-from-process engine ((obj engine) (proc process)) +(defmethod remove-from-process engine ((this engine) (proc process)) "Remove all connections from process for this engine" (local-vars (iter connection)) (when proc (set! iter (the connection (-> proc connection-list next1))) (while iter ;; only delete ones for this engine. - (if (belongs-to-engine? iter obj) + (if (belongs-to-engine? iter this) (move-to-dead iter) ) ;; through process list @@ -511,7 +512,7 @@ ) 0) -(defmethod remove-matching engine ((obj engine) (arg0 (function connection engine symbol))) +(defmethod remove-matching engine ((this engine) (arg0 (function connection engine symbol))) "call the given function on each connection and the engine. if it returns truthy, move to dead that connection." (local-vars @@ -519,10 +520,10 @@ (s4-0 connectable) ) ;; tricky iteration because of deleting. - (set! s4-0 (-> obj alive-list next0)) + (set! s4-0 (-> this alive-list next0)) (set! s3-0 (-> s4-0 next0)) - (while (!= s4-0 (-> obj alive-list-end)) - (if (arg0 (the-as connection s4-0) obj) + (while (!= s4-0 (-> this alive-list-end)) + (if (arg0 (the-as connection s4-0) this) ((method-of-type connection move-to-dead) (the-as connection s4-0)) ) (set! s4-0 s3-0) @@ -530,28 +531,28 @@ ) 0) -(defmethod remove-all engine ((obj engine)) +(defmethod remove-all engine ((this engine)) "Remove all connections from an engine" (local-vars (a0-1 connectable) (s5-0 connectable) ) - (set! a0-1 (-> obj alive-list next0)) + (set! a0-1 (-> this alive-list next0)) (set! s5-0 (-> a0-1 next0)) (while - (!= a0-1 (-> obj alive-list-end)) + (!= a0-1 (-> this alive-list-end)) ((method-of-type connection move-to-dead) (the-as connection a0-1)) (set! a0-1 s5-0) (set! s5-0 (-> s5-0 next0)) ) 0) -(defmethod remove-by-param1 engine ((obj engine) (p1-value object)) +(defmethod remove-by-param1 engine ((this engine) (p1-value object)) "Remove all connections with param1 matching arg0" - (let* ((current (-> obj alive-list next0)) + (let* ((current (-> this alive-list next0)) (next (-> current next0)) ) - (while (!= current (-> obj alive-list-end)) + (while (!= current (-> this alive-list-end)) (if (= (-> (the-as connection current) param1) p1-value) ((method-of-type connection move-to-dead) (the-as connection current)) ) @@ -562,12 +563,12 @@ 0 ) -(defmethod remove-by-param2 engine ((obj engine) (p2-value int)) +(defmethod remove-by-param2 engine ((this engine) (p2-value int)) "Remove all connections with param2 matching p2-value" - (let* ((current (-> obj alive-list next0)) + (let* ((current (-> this alive-list next0)) (next (-> current next0)) ) - (while (!= current (-> obj alive-list-end)) + (while (!= current (-> this alive-list-end)) (if (= (-> (the-as connection current) param2) p2-value) ((method-of-type connection move-to-dead) (the-as connection current)) ) diff --git a/goal_src/jak1/engine/entity/actor-link-h.gc b/goal_src/jak1/engine/entity/actor-link-h.gc index d9cf247bb8..12bab7ff81 100644 --- a/goal_src/jak1/engine/entity/actor-link-h.gc +++ b/goal_src/jak1/engine/entity/actor-link-h.gc @@ -16,6 +16,8 @@ ;; The next-actor and prev-actor res build a linked list of actors. +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Initial Lookup Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -93,29 +95,29 @@ ;; Link Setup ;;;;;;;;;;;;;;;; -(defmethod next-actor entity-actor ((obj entity-actor)) +(defmethod next-actor entity-actor ((this entity-actor)) "Utility function to look up the next actor in the list, assuming we don't have actor-link-info yet." (declare (inline)) ;; look up reference to next-actor - this is slow. - (entity-actor-lookup obj 'next-actor 0) + (entity-actor-lookup this 'next-actor 0) ) -(defmethod prev-actor entity-actor ((obj entity-actor)) +(defmethod prev-actor entity-actor ((this entity-actor)) "Look up previous actor in the list" (declare (inline)) - (entity-actor-lookup obj 'prev-actor 0) + (entity-actor-lookup this 'prev-actor 0) ) (defmethod new actor-link-info ((allocation symbol) (type-to-make type) (proc process)) "Set up an actor-link-info for the given process. The entity of this process should be the entity-actor that will get this actor-link-info" - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj process) proc) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this process) proc) ;; set next and prev - (set! (-> obj next) (next-actor (-> proc entity))) - (set! (-> obj prev) (prev-actor (-> proc entity))) - obj + (set! (-> this next) (next-actor (-> proc entity))) + (set! (-> this prev) (prev-actor (-> proc entity))) + this ) ) @@ -124,38 +126,38 @@ ;;;;;;;;;;;;;;;;;;;; ;; These methods can now be used to get next/prev more efficiently, without having to do a res lookup. -(defmethod get-next actor-link-info ((obj actor-link-info)) - (-> obj next) +(defmethod get-next actor-link-info ((this actor-link-info)) + (-> this next) ) -(defmethod get-prev actor-link-info ((obj actor-link-info)) - (-> obj prev) +(defmethod get-prev actor-link-info ((this actor-link-info)) + (-> this prev) ) -(defmethod get-next-process actor-link-info ((obj actor-link-info)) +(defmethod get-next-process actor-link-info ((this actor-link-info)) "Get the process for the next, if it exists." ;; we can't easily get to the actor-link-info of the next, so we have to grab it from entity-links. - (the-as process (and (-> obj next) (-> obj next extra process))) + (the-as process (and (-> this next) (-> this next extra process))) ) -(defmethod get-prev-process actor-link-info ((obj actor-link-info)) +(defmethod get-prev-process actor-link-info ((this actor-link-info)) "Get the process for the prev, if it exists" - (the-as process (and (-> obj prev) (-> obj prev extra process))) + (the-as process (and (-> this prev) (-> this prev extra process))) ) -(defmethod link-to-next-and-prev-actor actor-link-info ((obj actor-link-info)) +(defmethod link-to-next-and-prev-actor actor-link-info ((this actor-link-info)) "Redo the linking in the constructor by looking up the next/prev actor." - (set! (-> obj next) (next-actor (-> obj process entity))) - (set! (-> obj prev) (prev-actor (-> obj process entity))) - (-> obj next) + (set! (-> this next) (next-actor (-> this process entity))) + (set! (-> this prev) (prev-actor (-> this process entity))) + (-> this next) ) (defmethod apply-function-forward actor-link-info - ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) - "Iterate forward through actors, and apply this function. Starts at (-> obj next) + ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + "Iterate forward through actors, and apply this function. Starts at (-> this next) If the function returns truthy, stop iterating." - (let ((s3-0 (-> obj next))) + (let ((s3-0 (-> this next))) (while s3-0 (if (arg0 s3-0 arg1) (return (the-as int #f)) @@ -167,10 +169,10 @@ ) (defmethod apply-function-reverse actor-link-info - ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) "Iterate backward through actors and apply function. If the function returns truth, stop iterating." - (let ((s3-0 (-> obj prev))) + (let ((s3-0 (-> this prev))) (while s3-0 (if (arg0 s3-0 arg1) (return (the-as int #f)) @@ -181,10 +183,10 @@ 0 ) -(defmethod apply-all actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) +(defmethod apply-all actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) "Apply to all entities. Starts at the back and hits everyone, including this object." ;; start at us (next may give us #f here, so can't do that.) - (let ((s4-0 (-> obj process entity))) + (let ((s4-0 (-> this process entity))) ;; while there is a prev... (while (prev-actor s4-0) ;; set prev (this is stupid, they do the slow lookup twice!) @@ -202,10 +204,10 @@ 0 ) -(defmethod send-to-all-after actor-link-info ((obj actor-link-info) (message symbol)) +(defmethod send-to-all-after actor-link-info ((this actor-link-info) (message symbol)) "Send an event to all processes after this link with no parameters." - (let ((iter (-> obj next)) + (let ((iter (-> this next)) (result (the object #f))) (while iter (let ((proc (-> iter extra process))) @@ -219,10 +221,10 @@ ) ) -(defmethod send-to-all-before actor-link-info ((obj actor-link-info) (message symbol)) +(defmethod send-to-all-before actor-link-info ((this actor-link-info) (message symbol)) "Send an event to all processes before this link with no parameters." - (let ((iter (-> obj prev)) + (let ((iter (-> this prev)) (result (the object #f))) (while iter (let ((proc (-> iter extra process))) @@ -236,10 +238,10 @@ ) ) -(defmethod send-to-next actor-link-info ((obj actor-link-info) (message symbol)) +(defmethod send-to-next actor-link-info ((this actor-link-info) (message symbol)) "Send event arg0 to the next actor's process" - (let ((a0-1 (-> obj next))) + (let ((a0-1 (-> this next))) ;; do we have a next? (when a0-1 ;; get the actual process @@ -254,10 +256,10 @@ (none) ) -(defmethod send-to-prev actor-link-info ((obj actor-link-info) (message symbol)) +(defmethod send-to-prev actor-link-info ((this actor-link-info) (message symbol)) "Send event arg1 to the next actor's process." - (let ((a0-1 (-> obj prev))) + (let ((a0-1 (-> this prev))) (when a0-1 (let ((a0-2 (-> a0-1 extra process))) (when a0-2 @@ -269,23 +271,23 @@ (none) ) -(defmethod send-to-next-and-prev actor-link-info ((obj actor-link-info) (msg symbol)) +(defmethod send-to-next-and-prev actor-link-info ((this actor-link-info) (msg symbol)) "Send an event to both next and prev with no params." - (send-to-next obj msg) - (send-to-prev obj msg) + (send-to-next this msg) + (send-to-prev this msg) (none) ) -(defmethod send-to-all actor-link-info ((obj actor-link-info) (msg symbol)) - (send-to-all-after obj msg) - (send-to-all-before obj msg) +(defmethod send-to-all actor-link-info ((this actor-link-info) (msg symbol)) + (send-to-all-after this msg) + (send-to-all-before this msg) (none) ) -(defmethod actor-count actor-link-info ((obj actor-link-info)) +(defmethod actor-count actor-link-info ((this actor-link-info)) "Count the number of actors in the entire list" - (let ((actor (-> obj process entity)) + (let ((actor (-> this process entity)) (count 0) ) ;; get back to the beginning. @@ -301,10 +303,10 @@ ) ) -(defmethod get-matching-actor-type-mask actor-link-info ((obj actor-link-info) (matching-type type)) +(defmethod get-matching-actor-type-mask actor-link-info ((this actor-link-info) (matching-type type)) "Iterate through _all_ actors that are part of this actor list. If the nth actor is type matching-type, then set the nth bit of the result." - (let ((actor (the-as entity-actor (-> obj process entity))) + (let ((actor (the-as entity-actor (-> this process entity))) (mask 0) ) (let ((current-bit 1)) @@ -330,9 +332,9 @@ ) ) -(defmethod actor-count-before actor-link-info ((obj actor-link-info)) +(defmethod actor-count-before actor-link-info ((this actor-link-info)) "Get the number of actors _before_ this actor in the list." - (let* ((this-actor (-> obj process entity)) + (let* ((this-actor (-> this process entity)) (actor this-actor) (count 0) ) diff --git a/goal_src/jak1/engine/entity/ambient.gc b/goal_src/jak1/engine/entity/ambient.gc index 4af1f20f2a..a6ec2c42cf 100644 --- a/goal_src/jak1/engine/entity/ambient.gc +++ b/goal_src/jak1/engine/entity/ambient.gc @@ -10,19 +10,19 @@ ;; DECOMP BEGINS -(defmethod mem-usage drawable-ambient ((obj drawable-ambient) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-ambient ((this drawable-ambient) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 50 (-> arg0 length))) (set! (-> arg0 data 49 name) "ambient") (+! (-> arg0 data 49 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 49 used) v1-6) (+! (-> arg0 data 49 total) (logand -16 (+ v1-6 15))) ) - (mem-usage (-> obj ambient) arg0 (logior arg1 128)) + (mem-usage (-> this ambient) arg0 (logior arg1 128)) (the-as drawable-ambient 0) ) -(defmethod mem-usage drawable-inline-array-ambient ((obj drawable-inline-array-ambient) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-ambient ((this drawable-inline-array-ambient) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -30,8 +30,8 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) (the-as drawable-inline-array-ambient 0) ) @@ -216,17 +216,14 @@ ) (defun level-hint-surpress! () - (set! (-> *game-info* hint-play-time) (-> *display* base-frame-counter)) + (set-time! (-> *game-info* hint-play-time)) 0 (none) ) (defun can-grab-display? ((arg0 process)) (let ((v1-2 (handle->process (-> *game-info* display-text-handle)))) - (when (and (or (not v1-2) - (= v1-2 arg0) - (>= (- (-> *display* base-frame-counter) (-> *game-info* display-text-time)) (seconds 0.1)) - ) + (when (and (or (not v1-2) (= v1-2 arg0) (time-elapsed? (-> *game-info* display-text-time) (seconds 0.1))) (and *target* (!= (-> *target* next-state name) 'target-look-around) (not (logtest? (-> *target* state-flags) (state-flags being-attacked dying))) @@ -234,7 +231,7 @@ ) ) (set! (-> *game-info* display-text-handle) (process->handle arg0)) - (set! (-> *game-info* display-text-time) (-> *display* base-frame-counter)) + (set-time! (-> *game-info* display-text-time)) #t ) ) @@ -291,6 +288,7 @@ (none) ) +;; og:preserve-this (#when PC_PORT (define *level-hint-spool-name* (the string #f))) (defbehavior level-hint-init-by-other level-hint ((arg0 text-id) (arg1 string) (arg2 entity)) (mark-text-as-seen *game-info* arg0) @@ -298,7 +296,7 @@ (set! (-> self sound-to-play) arg1) (set! (-> self total-time) 0) (set! (-> self total-off-time) 0) - (set! (-> self last-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-time)) (set! *hint-semaphore* (the-as (pointer level-hint) (process->ppointer self))) (add-setting! 'hint (process->ppointer self) 0.0 0) (set! (-> self voicebox) (the-as handle #f)) @@ -338,7 +336,7 @@ (set! (-> self sound-to-play) arg0) (set! (-> self total-time) 0) (set! (-> self total-off-time) 0) - (set! (-> self last-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-time)) (set! (-> self trans) arg1) (set! *hint-semaphore* (the-as (pointer level-hint) (process->ppointer self))) (add-setting! 'hint (process->ppointer self) 0.0 0) @@ -364,7 +362,7 @@ (none) ) -(defmethod print-text level-hint ((obj level-hint)) +(defmethod print-text level-hint ((this level-hint)) (when (!= *common-text* #f) (let ((s5-0 (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)) @@ -377,15 +375,15 @@ (set! (-> v1-4 height) (the float 96)) ) (set! (-> s5-0 flags) (font-flags shadow kerning middle large)) - (print-game-text (lookup-text! *common-text* (-> obj text-id-to-display) #f) s5-0 #f 128 22) + (print-game-text (lookup-text! *common-text* (-> this text-id-to-display) #f) s5-0 #f 128 22) ) ) 0 (none) ) -(defmethod appeared-for-long-enough? level-hint ((obj level-hint)) - (and (!= (-> obj next-state name) 'level-hint-sidekick) (< (seconds 5) (-> obj total-time))) +(defmethod appeared-for-long-enough? level-hint ((this level-hint)) + (and (!= (-> this next-state name) 'level-hint-sidekick) (< (seconds 5) (-> this total-time))) ) (defstate level-hint-normal (level-hint) @@ -424,17 +422,17 @@ (not (-> *hud-parts* money-all)) ) (print-text self) - (+! (-> self total-time) (- (-> *display* base-frame-counter) (-> self last-time))) - (set! (-> self last-time) (-> *display* base-frame-counter)) + (+! (-> self total-time) (- (current-time) (-> self last-time))) + (set-time! (-> self last-time)) ) (else - (+! (-> self total-off-time) (- (-> *display* base-frame-counter) (-> self last-time))) + (+! (-> self total-off-time) (- (current-time) (-> self last-time))) (if (or (< (seconds 6) (-> self total-time)) (< (seconds 10) (-> self total-off-time))) (go level-hint-exit) ) ) ) - (set! (-> self last-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-time)) ) ) ) @@ -459,6 +457,7 @@ ) ) :exit (behavior () + ;; og:preserve-this (#when PC_PORT (set! *level-hint-spool-name* #f)) (if (nonzero? (-> self sound-id)) (sound-stop (-> self sound-id)) @@ -472,6 +471,7 @@ (send-event (handle->process (-> self voicebox)) 'die) ) :code (behavior ((arg0 string)) + ;; og:preserve-this (#when PC_PORT (set! *level-hint-spool-name* arg0)) (when (and (-> *setting-control* current play-hints) (< 0.0 (-> *setting-control* current dialog-volume))) (case (-> self mode) @@ -493,8 +493,8 @@ (format (clear *temp-string*) "spool-~S" arg0) (let ((s5-2 (s5-1 (s4-1 *temp-string*) (new-sound-id) 1024 0 0 (sound-group sfx) #t))) (set! (-> self sound-id) s5-2) - (let ((s4-3 (-> *display* base-frame-counter))) - (while (and (!= (current-str-id) s5-2) (< (- (-> *display* base-frame-counter) s4-3) (seconds 5))) + (let ((s4-3 (current-time))) + (while (and (!= (current-str-id) s5-2) (not (time-elapsed? s4-3 (seconds 5)))) (suspend) ) ) @@ -505,8 +505,8 @@ (add-setting! 'dialog-volume 'rel (-> *setting-control* current dialog-volume-hint) 0) ;; og:preserve-this PAL patch here (let ((s5-1 -1) - (s3-1 (-> *display* base-frame-counter)) - (s4-4 (-> *display* base-frame-counter)) + (s3-1 (current-time)) + (s4-4 (current-time)) ) (label cfg-27) (let ((v1-36 (current-str-pos s5-2))) @@ -517,8 +517,8 @@ (set! s3-1 (-> *display* base-frame-counter)) ) (when (not (and (or (< v1-36 0) - (>= (- (-> *display* base-frame-counter) s3-1) (seconds 3)) - (>= (- (-> *display* base-frame-counter) s4-4) (seconds 60)) + (time-elapsed? s3-1 (seconds 3)) + (time-elapsed? s4-4 (seconds 60)) ) *sound-player-enable* ) @@ -576,8 +576,8 @@ ) ) ) - (let ((s5-2 (-> *display* base-frame-counter))) - (while (and (!= (current-str-id) (-> self sound-id)) (< (- (-> *display* base-frame-counter) s5-2) (seconds 5))) + (let ((s5-2 (current-time))) + (while (and (!= (current-str-id) (-> self sound-id)) (not (time-elapsed? s5-2 (seconds 5)))) (suspend) ) ) @@ -625,8 +625,8 @@ :event (-> level-hint-normal event) :code (behavior ((arg0 string) (arg1 string)) (remove-setting! 'hint) - (let ((s4-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s4-0) (seconds 1)) + (let ((s4-0 (current-time))) + (until (time-elapsed? s4-0 (seconds 1)) (when (and *debug-segment* (not (paused?)) (not (str-is-playing?)) (bottom-hud-hidden?)) (let ((s3-0 (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)) @@ -727,17 +727,17 @@ (let* ((s5-0 (-> arg0 ambient)) (s4-0 (-> s5-0 ambient-data user-uint64 0)) ) - (when (>= (-> *display* base-frame-counter) (the-as time-frame s4-0)) + (when (>= (current-time) (the-as time-frame s4-0)) (let ((v1-5 (res-lump-data s5-0 'cycle-speed pointer))) (set! (-> s5-0 ambient-data user-uint64 0) - (the-as uint (+ (-> *display* base-frame-counter) + (the-as uint (+ (current-time) (the int (* 300.0 (-> (the-as (pointer float) v1-5) 0))) (rand-vu-int-count (the int (* 300.0 (-> (the-as (pointer float) v1-5) 1)))) ) ) ) ) - (when (< (the-as uint (- (-> *display* base-frame-counter) (the-as int s4-0))) (the-as uint 300)) + (when (not (time-elapsed? (the-as int s4-0) (seconds 1))) (let ((f30-0 (the float (rand-vu-int-count (the-as int (-> s5-0 ambient-data user-float 2)))))) (set! sv-16 (symbol->string (res-lump-struct s5-0 'effect-name symbol :time f30-0))) (let ((s4-2 (new 'stack 'sound-spec))) @@ -763,13 +763,7 @@ ) ) (when *debug-effect-control* - (format - #t - "(~5D) effect sound ~A ~S " - (-> *display* base-frame-counter) - (res-lump-struct s5-0 'name structure) - sv-16 - ) + (format #t "(~5D) effect sound ~A ~S " (current-time) (res-lump-struct s5-0 'name structure) sv-16) (format #t "volume: ~f pitch-mod: ~f~%" @@ -977,117 +971,119 @@ (none) ) -(defmethod collect-ambients drawable-ambient ((obj drawable-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients drawable-ambient ((this drawable-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (dotimes (s2-0 arg1) - (when (spheres-overlap? arg0 (the-as sphere (-> obj bsphere))) - (set! (-> arg2 items (-> arg2 num-items)) obj) + (when (spheres-overlap? arg0 (the-as sphere (-> this bsphere))) + (set! (-> arg2 items (-> arg2 num-items)) this) (+! (-> arg2 num-items) 1) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) ) -(defmethod collect-ambients drawable-inline-array-ambient ((obj drawable-inline-array-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) - (collect-ambients (the-as drawable-ambient (-> obj data)) arg0 (-> obj length) arg2) +(defmethod collect-ambients drawable-inline-array-ambient ((this drawable-inline-array-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) + (collect-ambients (the-as drawable-ambient (-> this data)) arg0 (-> this length) arg2) 0 (none) ) -(defmethod collect-ambients drawable-tree-ambient ((obj drawable-tree-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) - (collect-ambients (-> obj data 0) arg0 (-> obj length) arg2) +(defmethod collect-ambients drawable-tree-ambient ((this drawable-tree-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) + (collect-ambients (-> this data 0) arg0 (-> this length) arg2) 0 (none) ) -(defmethod birth-ambient! entity-ambient ((obj entity-ambient)) - (set! (-> obj ambient-data quad) (the-as uint128 0)) - (set! (-> obj ambient-data function) ambient-type-error) - (case (res-lump-struct obj 'type structure) +(defmethod birth-ambient! entity-ambient ((this entity-ambient)) + (set! (-> this ambient-data quad) (the-as uint128 0)) + (set! (-> this ambient-data function) ambient-type-error) + (case (res-lump-struct this 'type structure) (('sound) - (let ((s5-0 (res-lump-struct obj 'effect-name structure :time 0.0)) - (a0-7 (res-lump-data obj 'cycle-speed pointer)) + (let ((s5-0 (res-lump-struct this 'effect-name structure :time 0.0)) + (a0-7 (res-lump-data this 'cycle-speed pointer)) ) (when (and s5-0 a0-7) (cond ((>= (-> (the-as (pointer float) a0-7)) 0.0) - (set! (-> obj ambient-data function) ambient-type-sound) - (set! (-> obj ambient-data user-float 2) (the-as float 0)) - (let ((s5-1 (-> ((method-of-type res-lump lookup-tag-idx) obj 'effect-name 'exact 0.0) lo))) + (set! (-> this ambient-data function) ambient-type-sound) + (set! (-> this ambient-data user-float 2) (the-as float 0)) + (let ((s5-1 (-> ((method-of-type res-lump lookup-tag-idx) this 'effect-name 'exact 0.0) lo))) (when (>= (the-as int s5-1) 0) (let ((s4-0 (the-as int s5-1)) - (v1-14 (-> obj tag s5-1)) + (v1-14 (-> this tag s5-1)) ) 0 - (while (= (-> v1-14 name) (-> obj tag s5-1 name)) - (make-property-data obj 0.0 (the-as res-tag-pair s4-0) (the-as pointer #f)) - (set! (-> obj ambient-data user-float 2) (the-as float (+ (the-as int (-> obj ambient-data user-float 2)) 1))) + (while (= (-> v1-14 name) (-> this tag s5-1 name)) + (make-property-data this 0.0 (the-as res-tag-pair s4-0) (the-as pointer #f)) + (set! (-> this ambient-data user-float 2) + (the-as float (+ (the-as int (-> this ambient-data user-float 2)) 1)) + ) (+! s4-0 1) - (set! v1-14 (-> obj tag s4-0)) + (set! v1-14 (-> this tag s4-0)) ) ) ) ) ) (else - (set! (-> obj ambient-data user-float 0) (the-as float (new-sound-id))) - (let ((v1-28 ((method-of-type res-lump lookup-tag-idx) obj 'effect-param 'exact 0.0))) - (set! (-> obj ambient-data user-float 1) (the-as float (if (< (the-as int v1-28) 0) - (the-as (pointer res-tag) #f) - (&-> (-> obj tag) (-> v1-28 lo)) - ) - ) + (set! (-> this ambient-data user-float 0) (the-as float (new-sound-id))) + (let ((v1-28 ((method-of-type res-lump lookup-tag-idx) this 'effect-param 'exact 0.0))) + (set! (-> this ambient-data user-float 1) (the-as float (if (< (the-as int v1-28) 0) + (the-as (pointer res-tag) #f) + (&-> (-> this tag) (-> v1-28 lo)) + ) + ) ) ) - (set! (-> obj ambient-data user-float 2) (the-as float s5-0)) - (set! (-> obj ambient-data function) ambient-type-sound-loop) + (set! (-> this ambient-data user-float 2) (the-as float s5-0)) + (set! (-> this ambient-data function) ambient-type-sound-loop) ) ) ) ) ) (('poi) - (let ((s5-2 (res-lump-struct obj 'effect-name structure :time 0.0))) - (when (res-lump-value obj 'loc-name-id uint128) - (set! (-> obj ambient-data user-float 2) (the-as float s5-2)) - (set! (-> obj ambient-data function) ambient-type-poi) + (let ((s5-2 (res-lump-struct this 'effect-name structure :time 0.0))) + (when (res-lump-value this 'loc-name-id uint128) + (set! (-> this ambient-data user-float 2) (the-as float s5-2)) + (set! (-> this ambient-data function) ambient-type-poi) ) ) ) (('hint) - (let ((s5-3 (res-lump-struct obj 'effect-name structure :time 0.0))) - (when (res-lump-value obj 'text-id uint128) - (set! (-> obj ambient-data user-float 2) (the-as float s5-3)) - (set! (-> obj ambient-data function) ambient-type-hint) + (let ((s5-3 (res-lump-struct this 'effect-name structure :time 0.0))) + (when (res-lump-value this 'text-id uint128) + (set! (-> this ambient-data user-float 2) (the-as float s5-3)) + (set! (-> this ambient-data function) ambient-type-hint) ) ) ) (('light) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data function) ambient-type-light) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data function) ambient-type-light) ) (('dark) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data function) ambient-type-dark) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data function) ambient-type-dark) ) (('weather-off) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data function) ambient-type-weather-off) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data function) ambient-type-weather-off) ) (('ocean-off) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data function) ambient-type-ocean-off) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data function) ambient-type-ocean-off) ) (('ocean-near-off) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data function) ambient-type-ocean-near-off) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data function) ambient-type-ocean-near-off) ) (('music) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data user-float 0) (res-lump-struct obj 'music float)) - (set! (-> obj ambient-data user-float 1) (res-lump-value obj 'flava float)) - (set! (-> obj ambient-data function) ambient-type-music) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data user-float 0) (res-lump-struct this 'music float)) + (set! (-> this ambient-data user-float 1) (res-lump-value this 'flava float)) + (set! (-> this ambient-data function) ambient-type-music) ) ) (none) @@ -1095,18 +1091,18 @@ (define *execute-ambients* #t) -(defmethod execute-ambient drawable-ambient ((obj drawable-ambient) (arg0 vector)) - ((-> obj ambient ambient-data function) obj arg0) +(defmethod execute-ambient drawable-ambient ((this drawable-ambient) (arg0 vector)) + ((-> this ambient ambient-data function) this arg0) 0 (none) ) ;; ERROR: function was not converted to expressions. Cannot decompile. -(defmethod draw-debug entity-ambient ((obj entity-ambient)) +(defmethod draw-debug entity-ambient ((this entity-ambient)) (local-vars (sv-16 uint128)) - (let ((gp-0 (-> obj trans)) - (s5-0 (res-lump-struct obj 'type symbol)) + (let ((gp-0 (-> this trans)) + (s5-0 (res-lump-struct this 'type symbol)) (s3-0 #f) ) (cond @@ -1115,7 +1111,7 @@ (add-debug-text-3d #t (bucket-id debug-no-zbuf) - (symbol->string (res-lump-struct obj 'effect-name symbol :time 0.0)) + (symbol->string (res-lump-struct this 'effect-name symbol :time 0.0)) gp-0 (font-color white) (new 'static 'vector2h :y 24) @@ -1125,7 +1121,7 @@ ) ((= s5-0 'hint) (when *display-ambient-hint-marks* - (set! sv-16 (res-lump-value obj 'text-id uint128)) + (set! sv-16 (res-lump-value this 'text-id uint128)) (let ((s3-2 add-debug-text-3d) (s2-1 #t) (s1-1 68) @@ -1138,7 +1134,7 @@ ) ((= s5-0 'poi) (when *display-ambient-poi-marks* - (let ((a1-7 (res-lump-value obj 'loc-name-id uint128))) + (let ((a1-7 (res-lump-value this 'loc-name-id uint128))) (when (and (nonzero? a1-7) *common-text*) (add-debug-text-3d #t @@ -1208,7 +1204,7 @@ (add-debug-text-3d #t (bucket-id debug-no-zbuf) - (res-lump-struct obj 'name string) + (res-lump-struct this 'name string) gp-0 (font-color white) (new 'static 'vector2h :y 8) diff --git a/goal_src/jak1/engine/entity/entity-h.gc b/goal_src/jak1/engine/entity/entity-h.gc index c711426a54..d27fc69443 100644 --- a/goal_src/jak1/engine/entity/entity-h.gc +++ b/goal_src/jak1/engine/entity/entity-h.gc @@ -5,6 +5,16 @@ ;; name in dgo: entity-h ;; dgos: GAME, ENGINE +(defun-extern entity-by-name string entity) +(defun-extern entity-by-type type entity-actor) +(defun-extern entity-by-aid uint entity) +(define-extern reset-actors (function symbol none)) +(define-extern *spawn-actors* symbol) +;; TODO - for cam-start +(define-extern reset-cameras (function none)) +(define-extern process-by-ename (function string process)) +(define-extern entity-birth-no-kill (function entity none)) + ;; DECOMP BEGINS (define *generate-actor-vis* #f) @@ -184,8 +194,8 @@ ;; But this seems to be setting the symbol to nothing if it's not found, but of course, our compiler freaks out (define-extern entity-nav-login (function entity-actor none)) (if (zero? entity-nav-login) - (set! entity-nav-login (the-as (function entity-actor none) nothing)) - ) + (set! entity-nav-login (the-as (function entity-actor none) nothing)) + ) (deftype actor-bank (basic) ((pause-dist float :offset-assert 4) @@ -204,13 +214,3 @@ :birth-max 10 ;; maximum actor births per frame? (it is known they dont all happen at once) ) ) - -(defun-extern entity-by-name string entity) -(defun-extern entity-by-type type entity-actor) -(defun-extern entity-by-aid uint entity) -(define-extern reset-actors (function symbol none)) -(define-extern *spawn-actors* symbol) -;; TODO - for cam-start -(define-extern reset-cameras (function none)) -(define-extern process-by-ename (function string process)) -(define-extern entity-birth-no-kill (function entity none)) \ No newline at end of file diff --git a/goal_src/jak1/engine/entity/entity.gc b/goal_src/jak1/engine/entity/entity.gc index 4ee7f44df2..916f74d2dd 100644 --- a/goal_src/jak1/engine/entity/entity.gc +++ b/goal_src/jak1/engine/entity/entity.gc @@ -20,22 +20,22 @@ ;; entity basic methods ;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod mem-usage drawable-actor ((obj drawable-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-actor ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) "Update memory use for a drawable-actor" (set! (-> arg0 length) (max 44 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") (+! (-> arg0 data 43 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 43 used) v1-6) (+! (-> arg0 data 43 total) (logand -16 (+ v1-6 15))) ) ;; note: does something with flags here. - (mem-usage (-> obj actor) arg0 (logior arg1 64)) + (mem-usage (-> this actor) arg0 (logior arg1 64)) (the-as drawable-actor 0) ) -(defmethod mem-usage drawable-inline-array-actor ((obj drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-actor ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) "update memory use for a group of drawable actors." (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -44,44 +44,44 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) (the-as drawable-inline-array-actor 0) ) -(defmethod print entity-links ((obj entity-links)) - (format #t "#" (-> obj process) obj) - obj +(defmethod print entity-links ((this entity-links)) + (format #t "#" (-> this process) this) + this ) -(defmethod print entity-perm ((obj entity-perm)) +(defmethod print entity-perm ((this entity-perm)) (format #t "#" - (-> obj aid) - (-> obj task) - (-> obj status) - (-> obj user-uint64) - obj + (-> this aid) + (-> this task) + (-> this status) + (-> this user-uint64) + this ) - obj + this ) -(defmethod birth! entity ((obj entity)) +(defmethod birth! entity ((this entity)) "children of entity should override this." - (format #t "birth ~A~%" obj) - obj + (format #t "birth ~A~%" this) + this ) -(defmethod kill! entity ((obj entity)) +(defmethod kill! entity ((this entity)) "children of entity should override this." - (format #t "kill ~A~%" obj) - obj + (format #t "kill ~A~%" this) + this ) -(defmethod print entity ((obj entity)) +(defmethod print entity ((this entity)) "print an entity, with its name from the res." - (format #t "#<~A :name ~S @ #x~X>" (-> obj type) (res-lump-struct obj 'name structure) obj) - obj + (format #t "#<~A :name ~S @ #x~X>" (-> this type) (res-lump-struct this 'name structure) this) + this ) @@ -89,7 +89,7 @@ ;; entity finding ;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod get-level entity ((obj entity)) +(defmethod get-level entity ((this entity)) "Get the level that the entity belongs to." ;; loop over levels @@ -98,8 +98,8 @@ ;; only if the level is active (when (= (-> a1-3 status) 'active) ;; check if we are inside the heap - (if (and (>= (the-as int obj) (the-as int (-> a1-3 heap base))) - (< (the-as int obj) (the-as int (-> a1-3 heap top-base))) + (if (and (>= (the-as int this) (the-as int (-> a1-3 heap base))) + (< (the-as int this) (the-as int (-> a1-3 heap top-base))) ) (return a1-3) ) @@ -388,80 +388,80 @@ (none) ) -(defmethod print process ((obj process)) +(defmethod print process ((this process)) "Fancier print for process that can also print status of process drawables." - (format #t "#<~A ~S ~A :state ~S :flags " (-> obj type) (-> obj name) (-> obj status) (if (-> obj state) - (-> obj state name) + (format #t "#<~A ~S ~A :state ~S :flags " (-> this type) (-> this name) (-> this status) (if (-> this state) + (-> this state name) ) ) - (process-status-bits obj #t) + (process-status-bits this #t) (format #t " :stack ~D/~D :heap ~D/~D @ #x~X>" - (&- (-> obj top-thread stack-top) (the-as uint (-> obj top-thread sp))) - (-> obj main-thread stack-size) - (- (-> obj allocated-length) (&- (-> obj heap-top) (the-as uint (-> obj heap-cur)))) - (-> obj allocated-length) - obj + (&- (-> this top-thread stack-top) (the-as uint (-> this top-thread sp))) + (-> this main-thread stack-size) + (- (-> this allocated-length) (&- (-> this heap-top) (the-as uint (-> this heap-cur)))) + (-> this allocated-length) + this ) - obj + this ) -(defmethod debug-print entity-actor ((obj entity-actor) (mode symbol) (expected-type type)) +(defmethod debug-print entity-actor ((this entity-actor) (mode symbol) (expected-type type)) "Debug print info about an entity-actor. This is designed to generate rows for the table printed by method debug-print-entities of level-group." - (let ((s4-0 (-> obj etype))) + (let ((s4-0 (-> this etype))) (when (or (not expected-type) (and s4-0 (valid? s4-0 type #f #f 0) (type-type? s4-0 expected-type))) - (format #t "~5D #x~8X ~-21S" (-> obj extra vis-id) obj (res-lump-struct obj 'name structure)) - (let ((t0-3 (-> obj extra level nickname))) + (format #t "~5D #x~8X ~-21S" (-> this extra vis-id) this (res-lump-struct this 'name structure)) + (let ((t0-3 (-> this extra level nickname))) (set! t0-3 (cond (t0-3 t0-3 ) (else - (-> obj extra level name) + (-> this extra level name) ) ) ) - (format #t "~8D ~3D ~-4S #x~4X" (-> obj extra perm aid) (-> obj extra perm task) t0-3 (-> obj extra perm status)) + (format #t "~8D ~3D ~-4S #x~4X" (-> this extra perm aid) (-> this extra perm task) t0-3 (-> this extra perm status)) ) ;; location (if (= mode 'entity-meters) - (format #t " :trans ~14m ~14m ~14m " (-> obj extra trans x) (-> obj extra trans y) (-> obj extra trans z)) - (format #t " :trans ~14f ~14f ~14f " (-> obj extra trans x) (-> obj extra trans y) (-> obj extra trans z)) + (format #t " :trans ~14m ~14m ~14m " (-> this extra trans x) (-> this extra trans y) (-> this extra trans z)) + (format #t " :trans ~14f ~14f ~14f " (-> this extra trans x) (-> this extra trans y) (-> this extra trans z)) ) ;; if we have an associated process, print info. - (let* ((s3-2 (-> obj extra process)) + (let* ((s3-2 (-> this extra process)) (s4-2 (if (and (nonzero? s3-2) (type-type? (-> s3-2 type) process-drawable)) s3-2 ) ) ) (format #t ":pr #x~8X ~-12S ~-21S ~-5S/~-5S " - (if (-> obj extra process) - (-> obj extra process) + (if (-> this extra process) + (-> this extra process) 0 ) - (if (-> obj extra process) - (-> obj extra process name) + (if (-> this extra process) + (-> this extra process name) "" ) - (if (and (-> obj extra process) (-> obj extra process state)) - (-> obj extra process state name) + (if (and (-> this extra process) (-> this extra process state)) + (-> this extra process state name) "" ) - (if (-> obj extra process) - (* (- (-> obj extra process allocated-length) - (&- (-> obj extra process heap-top) (the-as uint (-> obj extra process heap-cur))) + (if (-> this extra process) + (* (- (-> this extra process allocated-length) + (&- (-> this extra process heap-top) (the-as uint (-> this extra process heap-cur))) ) 8 ) "" ) - (if (-> obj extra process) - (* (-> obj extra process allocated-length) 8) + (if (-> this extra process) + (* (-> this extra process allocated-length) 8) "" ) ) @@ -469,14 +469,14 @@ ) (format #t "~%") (if (= mode 'entity-perm) - (format #t " ~`entity-perm`P~%" (-> obj extra perm)) + (format #t " ~`entity-perm`P~%" (-> this extra perm)) ) ) ) (none) ) -(defmethod debug-print-entities level-group ((obj level-group) (mode symbol) (expected-type type)) +(defmethod debug-print-entities level-group ((this level-group) (mode symbol) (expected-type type)) "Print a table of entities. If expected-type is #f, print all. Otherwise, print only entities of the given type. Modes: 'art-group: print art groups instead. @@ -485,8 +485,8 @@ ;; no way this fit on their screen back in ~2000. (format #t " id address name aid tsk lev status x y z address name state heap flags~%" 0 0 0) - (dotimes (s3-0 (-> obj length)) - (let ((s2-0 (-> obj level s3-0))) + (dotimes (s3-0 (-> this length)) + (let ((s2-0 (-> this level s3-0))) (when (= (-> s2-0 status) 'active) (case mode (('art-group) @@ -516,7 +516,7 @@ ;; entity setup ;;;;;;;;;;;;;;;;;; -(defmethod add-to-level! entity ((obj entity) (lev-group level-group) (lev level) (aid actor-id)) +(defmethod add-to-level! entity ((this entity) (lev-group level-group) (lev level) (aid actor-id)) "Add us to a level." ;; grab the first free link @@ -525,8 +525,8 @@ ;; attach the entity to the link (set! (-> level-link process) #f) - (set! (-> level-link entity) obj) - (set! (-> obj extra) level-link) + (set! (-> level-link entity) this) + (set! (-> this extra) level-link) (cond ((-> lev-group entity-link) ;; add to linked list of existing @@ -549,29 +549,29 @@ ;; remember the start of the list (set! (-> lev-group entity-link) level-link) ;; update the trans. - (set! (-> level-link trans quad) (-> obj trans quad)) + (set! (-> level-link trans quad) (-> this trans quad)) ) ;; set us up - (set! (-> obj extra perm aid) aid) - (set! (-> obj extra level) lev) + (set! (-> this extra perm aid) aid) + (set! (-> this extra level) lev) (cond - ((= (-> obj type) entity-actor) - (set! (-> (the-as entity-actor obj) extra perm task) (-> (the-as entity-actor obj) task)) - (set! (-> (the-as entity-actor obj) extra vis-id) (-> (the-as entity-actor obj) vis-id-signed)) + ((= (-> this type) entity-actor) + (set! (-> (the-as entity-actor this) extra perm task) (-> (the-as entity-actor this) task)) + (set! (-> (the-as entity-actor this) extra vis-id) (-> (the-as entity-actor this) vis-id-signed)) ) (else - (set! (-> obj extra perm task) (game-task none)) - (set! (-> obj extra vis-id) 0) + (set! (-> this extra perm task) (game-task none)) + (set! (-> this extra vis-id) 0) 0 ) ) (none) ) -(defmethod remove-from-level! entity ((obj entity) (arg0 level-group)) +(defmethod remove-from-level! entity ((this entity) (arg0 level-group)) "Remove us from the level." - (let ((v1-0 (-> obj extra))) + (let ((v1-0 (-> this extra))) (cond ((= (-> v1-0 next-link) v1-0) (set! (-> arg0 entity-link) #f) @@ -585,7 +585,7 @@ ) ) ) - obj + this ) @@ -616,7 +616,7 @@ (none) ) -(defmethod update-vis-volumes level-group ((obj level-group)) +(defmethod update-vis-volumes level-group ((this level-group)) (local-vars (v1-10 symbol) (sv-16 process) @@ -625,8 +625,8 @@ ) (format 0 "call to update-vis-volumes, which may have a compiler bug.~%") - (dotimes (s5-0 (-> obj length)) - (let ((v1-3 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-3 (-> this level s5-0))) (when (= (-> v1-3 status) 'active) (let ((s4-0 (-> v1-3 bsp level entity))) (dotimes (s3-0 (-> s4-0 length)) @@ -680,13 +680,13 @@ (none) ) -(defmethod update-vis-volumes-from-nav-mesh level-group ((obj level-group)) +(defmethod update-vis-volumes-from-nav-mesh level-group ((this level-group)) "Update the visvol to fit the entire nav-mesh. Does this for all actors in bsps. Probably only used for debugging." (local-vars (sv-16 entity) (sv-32 entity)) ;; loop over levels - (dotimes (s5-0 (-> obj length)) - (let ((v1-3 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-3 (-> this level s5-0))) (when (= (-> v1-3 status) 'active) ;; only active levels ;; loop over entities (let ((s4-0 (-> v1-3 bsp level entity))) @@ -749,12 +749,12 @@ -(defmethod print-volume-sizes level-group ((obj level-group)) +(defmethod print-volume-sizes level-group ((this level-group)) "Loop through all entities and print their visibility. Excludes crate, fuel-cell and springbox." (local-vars (sv-16 type) (sv-32 (function _varargs_ object)) (sv-48 symbol) (sv-64 string) (sv-80 entity)) - (dotimes (s5-0 (-> obj length)) - (let ((v1-3 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-3 (-> this level s5-0))) (when (= (-> v1-3 status) 'active) (let ((s4-0 (-> v1-3 bsp level entity))) (dotimes (s3-0 (-> s4-0 length)) @@ -824,7 +824,7 @@ ;; The Debug Draw Method ;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod debug-draw-actors level-group ((obj level-group) (arg0 symbol)) +(defmethod debug-draw-actors level-group ((this level-group) (arg0 symbol)) (local-vars (sv-48 (function symbol bucket-id string vector font-color vector2h symbol)) (sv-64 symbol) @@ -845,8 +845,8 @@ (sv-304 pointer) ) (when (and arg0 (not (or (= *master-mode* 'menu) (= *master-mode* 'progress)))) - (dotimes (s4-0 (-> obj length)) - (let ((v1-8 (-> obj level s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((v1-8 (-> this level s4-0))) (when (= (-> v1-8 status) 'active) (let ((s3-0 (-> v1-8 bsp level entity))) (dotimes (s2-0 (-> s3-0 length)) @@ -946,8 +946,8 @@ ) (when (and *display-actor-vis* (not (or *display-actor-anim* *display-process-anim*))) (let ((s5-1 *display-actor-vis*)) - (dotimes (s4-1 (-> obj length)) - (let ((s3-1 (-> obj level s4-1))) + (dotimes (s4-1 (-> this length)) + (let ((s3-1 (-> this level s4-1))) (when (= (-> s3-1 status) 'active) (let ((s2-1 (-> s3-1 bsp level entity))) (dotimes (s1-2 (-> s2-1 length)) @@ -1005,7 +1005,7 @@ ) ) (if *generate-actor-vis* - (update-vis-volumes obj) + (update-vis-volumes this) ) (when (or *display-actor-anim* *display-process-anim*) (let ((s5-2 (ppointer->process *display-process-anim*))) @@ -1136,8 +1136,8 @@ ) |# (when *display-split-boxes* - (dotimes (s5-4 (-> obj length)) - (let ((s4-4 (-> obj level s5-4))) + (dotimes (s5-4 (-> this length)) + (let ((s4-4 (-> this level s5-4))) (when (= (-> s4-4 status) 'active) (when (nonzero? (-> s4-4 bsp boxes)) (let ((s3-4 (-> s4-4 bsp boxes))) @@ -1169,8 +1169,8 @@ *display-ambient-ocean-near-off-marks* *display-ambient-music-marks* ) - (dotimes (s5-5 (-> obj length)) - (let ((v1-214 (-> obj level s5-5))) + (dotimes (s5-5 (-> this length)) + (let ((v1-214 (-> this level s5-5))) (when (= (-> v1-214 status) 'active) (let ((s4-5 (-> v1-214 bsp ambients))) (when (nonzero? s4-5) @@ -1191,14 +1191,14 @@ ;; Camera Birthing ;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod birth! entity-camera ((obj entity-camera)) - (add-connection *camera-engine* *camera* nothing obj #f #f) - obj +(defmethod birth! entity-camera ((this entity-camera)) + (add-connection *camera-engine* *camera* nothing this #f #f) + this ) -(defmethod kill! entity-camera ((obj entity-camera)) - (remove-by-param1 *camera-engine* obj) - obj +(defmethod kill! entity-camera ((this entity-camera)) + (remove-by-param1 *camera-engine* this) + this ) ;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1237,28 +1237,28 @@ ;; TODO (define-extern birth-viewer (function process entity-actor object)) -(defmacro obj-etype? (&rest types) - `(or ,@(apply (lambda (x) `(begin (define-extern ,x type) (type-type? (-> obj etype) ,x))) types)) +(defmacro this-etype? (&rest types) + `(or ,@(apply (lambda (x) `(begin (define-extern ,x type) (type-type? (-> this etype) ,x))) types)) ) -(defmethod birth! entity-actor ((obj entity-actor)) +(defmethod birth! entity-actor ((this entity-actor)) "Create a process for this entity and start it." ;; temp - ; (when (or (not (obj-etype? process)) + ; (when (or (not (this-etype? process)) ; ;; disallowed types - ; ;(obj-etype?) - ; (zero? (-> obj etype))) - ; (when (nonzero? (-> obj etype)) - ; (birth-log "rejecting etype ~A birth~%" (-> obj etype)) + ; ;(this-etype?) + ; (zero? (-> this etype))) + ; (when (nonzero? (-> this etype)) + ; (birth-log "rejecting etype ~A birth~%" (-> this etype)) ; ) - ; (logior! (-> obj extra perm status) (entity-perm-status bit-0)) - ; (return obj) + ; (logior! (-> this extra perm status) (entity-perm-status bit-0)) + ; (return this) ; ) - ;;(birth-log "call to birth! on ~A~%" obj) + ;;(birth-log "call to birth! on ~A~%" this) - (let* ((entity-type (-> obj etype)) + (let* ((entity-type (-> this etype)) (info (entity-info-lookup entity-type)) (entity-process (get-process *default-dead-pool* entity-type (if info (-> info heap-size) @@ -1278,17 +1278,17 @@ (valid? (method-of-object entity-process init-from-entity!) function #f #f 0) ) ) - (init-entity entity-process obj) + (init-entity entity-process this) ) (else - (when (not (birth-viewer entity-process obj)) - (format 0 "ERROR: no proper process type named ~A exists in the code, could not start ~A~%" entity-type obj) - (logior! (-> obj extra perm status) (entity-perm-status bit-0)) + (when (not (birth-viewer entity-process this)) + (format 0 "ERROR: no proper process type named ~A exists in the code, could not start ~A~%" entity-type this) + (logior! (-> this extra perm status) (entity-perm-status bit-0)) ) ) ) ) - obj + this ) (defun entity-deactivate-handler ((arg0 process) (arg1 entity-actor)) @@ -1301,86 +1301,86 @@ (none) ) -(defmethod kill! entity-actor ((obj entity-actor)) +(defmethod kill! entity-actor ((this entity-actor)) "Kill an actor." - (let ((a0-1 (-> obj extra process))) + (let ((a0-1 (-> this extra process))) (if a0-1 (deactivate a0-1) - (entity-deactivate-handler a0-1 obj) + (entity-deactivate-handler a0-1 this) ) ) - obj + this ) -(defmethod birth bsp-header ((obj bsp-header)) +(defmethod birth bsp-header ((this bsp-header)) "Birth everything in the level." ;; (local-vars (v1-71 int) (s5-0 int)) ;; (.mfc0 s5-0 Count) ;; how many actors do we need? - (let ((actor-count (if (nonzero? (-> obj actors)) - (-> obj actors length) + (let ((actor-count (if (nonzero? (-> this actors)) + (-> this actors length) 0 ) ) ) (cond - ((not (-> obj level entity)) + ((not (-> this level entity)) ;; we don't have an array of entity-links. allocate one. - (set! (-> obj level entity) (new 'loading-level 'entity-links-array actor-count)) + (set! (-> this level entity) (new 'loading-level 'entity-links-array actor-count)) ) - ((< (-> obj level entity allocated-length) actor-count) + ((< (-> this level entity allocated-length) actor-count) ;; we do, but it's not big enough. Complain. (format 0 "ERROR: Attempting to rebirth level ~A with incorrect entity table size ~D/~D~%" - (-> obj level) + (-> this level) actor-count - (-> obj level entity allocated-length) + (-> this level entity allocated-length) ) ) ) ) ;; reset our entity links array to 0. - (set! (-> obj level entity length) 0) + (set! (-> this level entity length) 0) ;; NOTE: we don't actually birth the actors. It is too slow. ;; so it gets spread over multiple frames later. - (when (nonzero? (-> obj actors)) - (dotimes (birth-idx (-> obj actors length)) - (let* ((idx-to-birth (-> obj actor-birth-order birth-idx)) - (actor-to-birth (-> obj actors data (logand idx-to-birth #xffff) actor)) + (when (nonzero? (-> this actors)) + (dotimes (birth-idx (-> this actors length)) + (let* ((idx-to-birth (-> this actor-birth-order birth-idx)) + (actor-to-birth (-> this actors data (logand idx-to-birth #xffff) actor)) ) - (add-to-level! actor-to-birth *level* (-> obj level) (the-as actor-id (-> actor-to-birth aid))) + (add-to-level! actor-to-birth *level* (-> this level) (the-as actor-id (-> actor-to-birth aid))) ) ) ) - (let ((existing-amb-count (if (nonzero? (-> obj ambients)) - (-> obj ambients length) + (let ((existing-amb-count (if (nonzero? (-> this ambients)) + (-> this ambients length) 0 ) ) ) (cond - ((not (-> obj level ambient)) - (set! (-> obj level ambient) (new 'loading-level 'entity-ambient-data-array existing-amb-count)) + ((not (-> this level ambient)) + (set! (-> this level ambient) (new 'loading-level 'entity-ambient-data-array existing-amb-count)) ) - ((< (-> obj level ambient allocated-length) existing-amb-count) + ((< (-> this level ambient allocated-length) existing-amb-count) (format 0 "ERROR: Attempting to rebirth level ~A with incorrect ambient table size ~D/~D~%" - (-> obj level) + (-> this level) existing-amb-count - (-> obj level ambient allocated-length) + (-> this level ambient allocated-length) ) ) ) ) - (set! (-> obj level ambient length) 0) + (set! (-> this level ambient length) 0) 0 - (let ((amb-array (-> obj level ambient)) - (bsp-ambs (-> obj ambients)) + (let ((amb-array (-> this level ambient)) + (bsp-ambs (-> this ambients)) ) (when (nonzero? bsp-ambs) (dotimes (s2-0 (-> bsp-ambs length)) @@ -1392,7 +1392,7 @@ ) ) ) - (let ((cams (-> obj cameras))) + (let ((cams (-> this cameras))) (when (nonzero? cams) (dotimes (s3-1 (-> cams length)) (birth! (-> cams s3-1)) @@ -1408,8 +1408,8 @@ ) -(defmethod deactivate-entities bsp-header ((obj bsp-header)) - (let ((s5-0 (-> obj actors))) +(defmethod deactivate-entities bsp-header ((this bsp-header)) + (let ((s5-0 (-> this actors))) (when (nonzero? s5-0) (dotimes (s4-0 (-> s5-0 length)) (let ((s3-0 (-> s5-0 data s4-0 actor))) @@ -1419,7 +1419,7 @@ ) ) ) - (let ((s5-1 (-> obj cameras))) + (let ((s5-1 (-> this cameras))) (when (nonzero? s5-1) (dotimes (s4-1 (-> s5-1 length)) (kill! (-> s5-1 s4-1)) @@ -1427,15 +1427,15 @@ ) ) (let ((s5-2 (-> *entity-pool* child)) - (s4-2 (-> obj level heap base)) - (s3-1 (-> obj level heap top-base)) + (s4-2 (-> this level heap base)) + (s3-1 (-> this level heap top-base)) ) (while s5-2 (let ((s2-0 (ppointer->process s5-2))) (set! s5-2 (-> s5-2 0 brother)) (cond ((-> (the-as process s2-0) entity) - (when (= (-> (the-as process s2-0) entity extra level) (-> obj level)) + (when (= (-> (the-as process s2-0) entity extra level) (-> this level)) (format #t "NOTICE: rogue level entity ~A~% still alive~%" s2-0) (deactivate s2-0) ) @@ -1502,13 +1502,13 @@ (none) ) -(defmethod update-perm! entity-perm ((obj entity-perm) (arg0 symbol) (arg1 entity-perm-status)) +(defmethod update-perm! entity-perm ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) (cond ((= arg0 'game) - (logclear! (-> obj status) arg1) + (logclear! (-> this status) arg1) ) - ((nonzero? (-> obj task)) - (logclear! (-> obj status) (logior (if (logtest? (-> obj status) (entity-perm-status bit-4)) + ((nonzero? (-> this task)) + (logclear! (-> this status) (logior (if (logtest? (-> this status) (entity-perm-status bit-4)) 524 0 ) @@ -1517,7 +1517,7 @@ ) ) (else - (logclear! (-> obj status) (logior arg1 (if (logtest? (-> obj status) (entity-perm-status bit-4)) + (logclear! (-> this status) (logior arg1 (if (logtest? (-> this status) (entity-perm-status bit-4)) 524 0 ) @@ -1525,11 +1525,11 @@ ) ) ) - (when (not (logtest? (-> obj status) (entity-perm-status user-set-from-cstage))) - (set! (-> obj user-uint64) (the-as uint 0)) + (when (not (logtest? (-> this status) (entity-perm-status user-set-from-cstage))) + (set! (-> this user-uint64) (the-as uint 0)) 0 ) - obj + this ) (defun reset-actors ((arg0 symbol)) @@ -1610,24 +1610,24 @@ (none) ) -(defmethod run-logic? process-drawable ((obj process-drawable)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) +(defmethod run-logic? process-drawable ((this process-drawable)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) -(defmethod birth? entity-links ((obj entity-links) (arg0 vector)) - (and (not (logtest? (-> obj perm status) (entity-perm-status bit-0 dead))) - (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) +(defmethod birth? entity-links ((this entity-links) (arg0 vector)) + (and (not (logtest? (-> this perm status) (entity-perm-status bit-0 dead))) + (< (vector-vector-distance (-> this trans) arg0) (-> *ACTOR-bank* birth-dist)) ) ) -(defmethod actors-update level-group ((obj level-group)) +(defmethod actors-update level-group ((this level-group)) (local-vars (sv-16 vector) (sv-24 int) (sv-32 entity-links) (sv-48 int) (sv-64 string) (sv-80 int)) (when *compact-actors* (if (and (= *compact-actors* 'debug) (= (-> *nk-dead-pool* alive-list prev) (-> *nk-dead-pool* first-gap))) @@ -1657,8 +1657,8 @@ (when *spawn-actors* (set! sv-16 (camera-pos)) (set! sv-24 0) - (dotimes (s5-2 (-> obj length)) - (let ((s4-2 (-> obj level s5-2))) + (dotimes (s5-2 (-> this length)) + (let ((s4-2 (-> this level s5-2))) (when (= (-> s4-2 status) 'active) (cond ((= (-> s4-2 display?) 'special) @@ -1852,8 +1852,8 @@ (none) ) -(defmethod set-or-clear-status! entity-actor ((obj entity-actor) (arg0 entity-perm-status) (arg1 symbol)) - (let ((v1-0 (-> obj extra))) +(defmethod set-or-clear-status! entity-actor ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) + (let ((v1-0 (-> this extra))) (if arg1 (logior! (-> v1-0 perm status) arg0) (logclear! (-> v1-0 perm status) arg0) diff --git a/goal_src/jak1/engine/entity/relocate.gc b/goal_src/jak1/engine/entity/relocate.gc index 1b9fcfafaf..d44f184381 100644 --- a/goal_src/jak1/engine/entity/relocate.gc +++ b/goal_src/jak1/engine/entity/relocate.gc @@ -9,22 +9,22 @@ ;; DECOMP BEGINS -(defmethod relocate process ((obj process) (arg0 int)) +(defmethod relocate process ((this process) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (&+! (-> obj ppointer 0) arg0) - (let ((v1-5 (-> obj entity))) - (if (and v1-5 (= (-> v1-5 extra process) obj)) + (&+! (-> this ppointer 0) arg0) + (let ((v1-5 (-> this entity))) + (if (and v1-5 (= (-> v1-5 extra process) this)) (&+! (-> v1-5 extra process) arg0) ) ) - (let ((v1-7 (-> obj connection-list next1))) + (let ((v1-7 (-> this connection-list next1))) (while (the-as connection v1-7) (let ((a0-14 (-> v1-7 prev1))) (if (and (>= (the-as int a0-14) (-> *kernel-context* relocating-min)) @@ -51,33 +51,34 @@ (set! v1-7 (-> (the-as connection v1-7) next1)) ) ) - (let ((v1-10 (-> obj self))) + (let ((v1-10 (-> this self))) (if (and (>= (the-as int v1-10) (-> *kernel-context* relocating-min)) (< (the-as int v1-10) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj self) arg0) + (&+! (-> this self) arg0) ) ) - (let ((v1-15 (-> obj ppointer))) + (let ((v1-15 (-> this ppointer))) (if (and (>= (the-as int v1-15) (-> *kernel-context* relocating-min)) (< (the-as int v1-15) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj ppointer) arg0) + (&+! (-> this ppointer) arg0) ) ) - (let ((s4-0 (the basic (&+ (-> obj heap-base) 4)))) - (while (< (the-as int s4-0) (the-as int (-> obj heap-cur))) + ;; og:preserve-this + (let ((s4-0 (the basic (&+ (-> this heap-base) 4)))) + (while (< (the-as int s4-0) (the-as int (-> this heap-cur))) (relocate s4-0 arg0) (&+! s4-0 (logand -16 (+ (asize-of s4-0) 15))) ) ) - (&+! (-> obj main-thread) arg0) - (&+! (-> obj top-thread) arg0) - (&+! (-> obj heap-base) arg0) - (&+! (-> obj heap-cur) arg0) - (&+! (-> obj heap-top) arg0) - (let ((a2-4 (asize-of obj)) - (a1-22 (&-> obj type)) + (&+! (-> this main-thread) arg0) + (&+! (-> this top-thread) arg0) + (&+! (-> this heap-base) arg0) + (&+! (-> this heap-cur) arg0) + (&+! (-> this heap-top) arg0) + (let ((a2-4 (asize-of this)) + (a1-22 (&-> this type)) ) (cond ((>= arg0 0) @@ -92,145 +93,143 @@ ) ) (set! (-> *kernel-context* relocating-process) #f) - (&+ obj arg0) + (&+ this arg0) ) -(defmethod relocate cpu-thread ((obj cpu-thread) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate cpu-thread ((this cpu-thread) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate process-drawable ((obj process-drawable) (arg0 int)) +(defmethod relocate process-drawable ((this process-drawable) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj node-list)) - (&+! (-> obj node-list) arg0) + (if (nonzero? (-> this node-list)) + (&+! (-> this node-list) arg0) ) - (if (nonzero? (-> obj draw)) - (&+! (-> obj draw) arg0) + (if (nonzero? (-> this draw)) + (&+! (-> this draw) arg0) ) - (if (nonzero? (-> obj skel)) - (&+! (-> obj skel) arg0) + (if (nonzero? (-> this skel)) + (&+! (-> this skel) arg0) ) - (if (nonzero? (-> obj nav)) - (&+! (-> obj nav) arg0) + (if (nonzero? (-> this nav)) + (&+! (-> this nav) arg0) ) - (if (nonzero? (-> obj align)) - (&+! (-> obj align) arg0) + (if (nonzero? (-> this align)) + (&+! (-> this align) arg0) ) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - (if (nonzero? (-> obj vol)) - (&+! (-> obj vol) arg0) + (if (nonzero? (-> this vol)) + (&+! (-> this vol) arg0) ) - (if (nonzero? (-> obj fact)) - (&+! (-> obj fact) arg0) + (if (nonzero? (-> this fact)) + (&+! (-> this fact) arg0) ) - (if (nonzero? (-> obj link)) - (&+! (-> obj link) arg0) + (if (nonzero? (-> this link)) + (&+! (-> this link) arg0) ) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (if (nonzero? (-> obj water)) - (&+! (-> obj water) arg0) + (if (nonzero? (-> this water)) + (&+! (-> this water) arg0) ) - (if (nonzero? (-> obj sound)) - (&+! (-> obj sound) arg0) + (if (nonzero? (-> this sound)) + (&+! (-> this sound) arg0) ) - (the-as process-drawable ((method-of-type process relocate) obj arg0)) + (the-as process-drawable ((method-of-type process relocate) this arg0)) ) -(defmethod relocate collide-shape ((obj collide-shape) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj root-prim) arg0) - (if (-> obj riders) - (&+! (-> obj riders) arg0) +(defmethod relocate collide-shape ((this collide-shape) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this root-prim) arg0) + (if (-> this riders) + (&+! (-> this riders) arg0) ) - obj + this ) -(defmethod relocate collide-shape-moving ((obj collide-shape-moving) (arg0 int)) - (if (-> obj dynam) - (&+! (-> obj dynam) arg0) +(defmethod relocate collide-shape-moving ((this collide-shape-moving) (arg0 int)) + (if (-> this dynam) + (&+! (-> this dynam) arg0) ) - (the-as collide-shape-moving ((method-of-type collide-shape relocate) obj arg0)) + (the-as collide-shape-moving ((method-of-type collide-shape relocate) this arg0)) ) -(defmethod relocate collide-sticky-rider-group ((obj collide-sticky-rider-group) (arg0 int)) - (countdown (v1-0 (-> obj num-riders)) - (let ((a2-2 (-> obj rider v1-0))) +(defmethod relocate collide-sticky-rider-group ((this collide-sticky-rider-group) (arg0 int)) + (countdown (v1-0 (-> this num-riders)) + (let ((a2-2 (-> this rider v1-0))) (if (-> a2-2 sticky-prim) (&+! (-> a2-2 sticky-prim) arg0) ) ) ) - obj + this ) -(defmethod relocate collide-shape-prim ((obj collide-shape-prim) (arg0 int)) - (&+! (-> obj cshape) arg0) - obj +(defmethod relocate collide-shape-prim ((this collide-shape-prim) (arg0 int)) + (&+! (-> this cshape) arg0) + this ) -(defmethod relocate collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 int)) - (&+! (-> obj cshape) arg0) - (countdown (v1-2 (-> obj num-prims)) - (&+! (-> obj prims v1-2) arg0) +(defmethod relocate collide-shape-prim-group ((this collide-shape-prim-group) (arg0 int)) + (&+! (-> this cshape) arg0) + (countdown (v1-2 (-> this num-prims)) + (&+! (-> this prims v1-2) arg0) ) - obj + this ) -(defmethod relocate fact-info ((obj fact-info) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate fact-info ((this fact-info) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate draw-control ((obj draw-control) (arg0 int)) - (&+! (-> obj skeleton) arg0) - (&+! (-> obj process) arg0) - (when (-> obj ripple) - (if (-> obj ripple query) - (&+! (-> obj ripple query) arg0) +(defmethod relocate draw-control ((this draw-control) (arg0 int)) + (&+! (-> this skeleton) arg0) + (&+! (-> this process) arg0) + (when (-> this ripple) + (if (-> this ripple query) + (&+! (-> this ripple query) arg0) ) - (&+! (-> obj ripple) arg0) + (&+! (-> this ripple) arg0) ) - (let ((v1-14 (-> obj shadow-ctrl))) + (let ((v1-14 (-> this shadow-ctrl))) (if (and (>= (the-as int v1-14) (-> *kernel-context* relocating-min)) (< (the-as int v1-14) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj shadow-ctrl) arg0) + (&+! (-> this shadow-ctrl) arg0) ) ) - obj + this ) -(defmethod relocate joint-control ((obj joint-control) (arg0 int)) - (if (-> obj effect) - (&+! (-> obj effect) arg0) +(defmethod relocate joint-control ((this joint-control) (arg0 int)) + (if (-> this effect) + (&+! (-> this effect) arg0) ) - (set! (-> obj root-channel) - (the-as (inline-array joint-control-channel) (+ (the-as uint (-> obj root-channel)) arg0)) - ) - (countdown (v1-6 (-> obj allocated-length)) - (&+! (-> obj channel v1-6 parent) arg0) + (set! (-> this root-channel) (the-as (inline-array joint-control-channel) (&+ (-> this root-channel) arg0))) + (countdown (v1-6 (-> this allocated-length)) + (&+! (-> this channel v1-6 parent) arg0) ) - obj + this ) -(defmethod relocate cspace-array ((obj cspace-array) (arg0 int)) - (countdown (v1-0 (-> obj length)) - (let ((a2-2 (-> obj data v1-0))) +(defmethod relocate cspace-array ((this cspace-array) (arg0 int)) + (countdown (v1-0 (-> this length)) + (let ((a2-2 (-> this data v1-0))) (if (-> a2-2 parent) (&+! (-> a2-2 parent) arg0) ) @@ -251,60 +250,60 @@ ) ) ) - obj + this ) -(defmethod relocate nav-control ((obj nav-control) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj shape) arg0) - obj +(defmethod relocate nav-control ((this nav-control) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this shape) arg0) + this ) -(defmethod relocate path-control ((obj path-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate path-control ((this path-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate vol-control ((obj vol-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate vol-control ((this vol-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate water-control ((obj water-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate water-control ((this water-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate actor-link-info ((obj actor-link-info) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate actor-link-info ((this actor-link-info) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate align-control ((obj align-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate align-control ((this align-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate joint-mod ((obj joint-mod) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj joint) arg0) - obj +(defmethod relocate joint-mod ((this joint-mod) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this joint) arg0) + this ) -(defmethod relocate joint-mod-wheel ((obj joint-mod-wheel) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate joint-mod-wheel ((this joint-mod-wheel) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate effect-control ((obj effect-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate effect-control ((this effect-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate sparticle-launch-control ((obj sparticle-launch-control) (arg0 int)) - (&+! (-> obj proc) arg0) - (countdown (v1-2 (-> obj length)) - (let* ((a0-3 (-> obj data v1-2)) +(defmethod relocate sparticle-launch-control ((this sparticle-launch-control) (arg0 int)) + (&+! (-> this proc) arg0) + (countdown (v1-2 (-> this length)) + (let* ((a0-3 (-> this data v1-2)) (a2-0 (-> a0-3 origin)) ) (if (and (>= (the-as int a2-0) (-> *kernel-context* relocating-min)) @@ -315,7 +314,7 @@ ) ) (forall-particles-with-key - obj + this (lambda ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (let ((v1-1 (-> *kernel-context* relocating-offset))) (set! (-> arg1 key) (the-as sparticle-launch-control (+ (the-as int (-> arg1 key)) v1-1))) @@ -329,65 +328,61 @@ #t #t ) - obj + this ) -(defmethod relocate camera-master ((obj camera-master) (arg0 int)) - (if (nonzero? (-> obj water-drip)) - (&+! (-> obj water-drip) arg0) +(defmethod relocate camera-master ((this camera-master) (arg0 int)) + (if (nonzero? (-> this water-drip)) + (&+! (-> this water-drip) arg0) ) - (the-as camera-master ((method-of-type process relocate) obj arg0)) + (the-as camera-master ((method-of-type process relocate) this arg0)) ) -(defmethod relocate time-of-day-proc ((obj time-of-day-proc) (arg0 int)) - (if (nonzero? (-> obj stars)) - (&+! (-> obj stars) arg0) +(defmethod relocate time-of-day-proc ((this time-of-day-proc) (arg0 int)) + (if (nonzero? (-> this stars)) + (&+! (-> this stars) arg0) ) - (if (nonzero? (-> obj sun)) - (&+! (-> obj sun) arg0) + (if (nonzero? (-> this sun)) + (&+! (-> this sun) arg0) ) - (if (nonzero? (-> obj green-sun)) - (&+! (-> obj green-sun) arg0) + (if (nonzero? (-> this green-sun)) + (&+! (-> this green-sun) arg0) ) - (if (nonzero? (-> obj moon)) - (&+! (-> obj moon) arg0) + (if (nonzero? (-> this moon)) + (&+! (-> this moon) arg0) ) - (the-as time-of-day-proc ((method-of-type process relocate) obj arg0)) + (the-as time-of-day-proc ((method-of-type process relocate) this arg0)) ) -(defmethod relocate swingpole ((obj swingpole) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate swingpole ((this swingpole) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (the-as swingpole ((method-of-type process relocate) obj arg0)) + (the-as swingpole ((method-of-type process relocate) this arg0)) ) -(defmethod relocate part-tracker ((obj part-tracker) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate part-tracker ((this part-tracker) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (the-as part-tracker ((method-of-type process relocate) obj arg0)) + (the-as part-tracker ((method-of-type process relocate) this arg0)) ) -(defmethod relocate manipy ((obj manipy) (arg0 int)) - (if (nonzero? (-> obj joint 0)) - (&+! (-> obj joint 0) arg0) +(defmethod relocate manipy ((this manipy) (arg0 int)) + (if (nonzero? (-> this joint 0)) + (&+! (-> this joint 0) arg0) ) - (if (nonzero? (-> obj joint 1)) - (&+! (-> obj joint 1) arg0) + (if (nonzero? (-> this joint 1)) + (&+! (-> this joint 1) arg0) ) - (if (nonzero? (-> obj joint 2)) - (&+! (-> obj joint 2) arg0) + (if (nonzero? (-> this joint 2)) + (&+! (-> this joint 2) arg0) ) - (if (nonzero? (-> obj joint 3)) - (&+! (-> obj joint 3) arg0) + (if (nonzero? (-> this joint 3)) + (&+! (-> this joint 3) arg0) ) - (the-as manipy ((method-of-type process-drawable relocate) obj arg0)) + (the-as manipy ((method-of-type process-drawable relocate) this arg0)) ) - - - - diff --git a/goal_src/jak1/engine/entity/res-h.gc b/goal_src/jak1/engine/entity/res-h.gc index d78b5dbcf1..3567a2b361 100644 --- a/goal_src/jak1/engine/entity/res-h.gc +++ b/goal_src/jak1/engine/entity/res-h.gc @@ -7,6 +7,8 @@ ;; res is the very generic resource storage system. See res.gc for more information. +;; DECOMP BEGINS + ;; the res-tag describes some data (deftype res-tag (uint128) ((name symbol :offset 0) ;; name used for lookups diff --git a/goal_src/jak1/engine/entity/res.gc b/goal_src/jak1/engine/entity/res.gc index ff4adace3f..63e5e28fda 100644 --- a/goal_src/jak1/engine/entity/res.gc +++ b/goal_src/jak1/engine/entity/res.gc @@ -36,113 +36,115 @@ This is updated from the entity system used in Crash 2, which had most of these `(zero? (-> ,tag inlined?)) ) -(defmethod print res-tag ((obj res-tag)) +;; DECOMP BEGINS + +(defmethod print res-tag ((this res-tag)) "print a res-tag." - (if (res-ref? obj) + (if (res-ref? this) (format #t "#" - (-> obj name) - (-> obj key-frame) - (-> obj elt-type) - (-> obj elt-count) + (-> this name) + (-> this key-frame) + (-> this elt-type) + (-> this elt-count) ) (format #t "#" - (-> obj name) - (-> obj key-frame) - (-> obj elt-type) - (-> obj elt-count) + (-> this name) + (-> this key-frame) + (-> this elt-type) + (-> this elt-count) ) ) - obj + this ) -(defmethod length res-tag ((obj res-tag)) +(defmethod length res-tag ((this res-tag)) "get the length in bytes of this tag's resource." (the int - (if (res-ref? obj) + (if (res-ref? this) - (* (-> obj elt-count) 4) ;; elements are pointers/references to data. + (* (-> this elt-count) 4) ;; elements are pointers/references to data. - (* (-> obj elt-count) (-> obj elt-type size)) + (* (-> this elt-count) (-> this elt-type size)) ) ) ) -(defmethod get-tag-index-data res-lump ((obj res-lump) (n int)) +(defmethod get-tag-index-data res-lump ((this res-lump) (n int)) "get the data address of the n'th tag." (declare (inline)) - (&+ (-> obj data-base) - (-> obj tag n data-offset)) + (&+ (-> this data-base) + (-> this tag n data-offset)) ) -(defmethod get-tag-data res-lump ((obj res-lump) (tag res-tag)) +(defmethod get-tag-data res-lump ((this res-lump) (tag res-tag)) "get the data address of the specified tag." (declare (inline)) - (&+ (-> obj data-base) + (&+ (-> this data-base) (-> tag data-offset)) ) (defmethod new res-lump ((allocation symbol) (type-to-make type) (data-count int) (data-size int)) "Allocate a new res-lump." - (let ((obj (object-new allocation type-to-make (the int (+ (-> type-to-make size) + (let ((this (object-new allocation type-to-make (the int (+ (-> type-to-make size) (* (1- data-count) (size-of res-tag)) data-size))))) - (set! (-> obj allocated-length) data-count) - (set! (-> obj data-size) data-size) - (set! (-> obj length) 0) - (set! (-> obj data-base) (&-> (-> obj tag) data-count)) - (set! (-> obj data-top) (&-> (-> obj tag) data-count)) - obj + (set! (-> this allocated-length) data-count) + (set! (-> this data-size) data-size) + (set! (-> this length) 0) + (set! (-> this data-base) (&-> (-> this tag) data-count)) + (set! (-> this data-top) (&-> (-> this tag) data-count)) + this ) ) -(defmethod length res-lump ((obj res-lump)) +(defmethod length res-lump ((this res-lump)) "get the amount of resources in a res-lump." - (-> obj length) + (-> this length) ) -(defmethod asize-of res-lump ((obj res-lump)) +(defmethod asize-of res-lump ((this res-lump)) "get the allocated size of a res-lump." - (the int (+ (-> obj type psize) ;; psize is used here, but size is used in the allocation? - (* (-> obj allocated-length) (size-of res-tag)) - (-> obj data-size))) + (the int (+ (-> this type psize) ;; psize is used here, but size is used in the allocation? + (* (-> this allocated-length) (size-of res-tag)) + (-> this data-size))) ) -(defmethod inspect res-lump ((obj res-lump)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata-base: #x~X~%" (-> obj data-base)) - (format #t "~Tdata-top: #x~X~%" (-> obj data-top)) - (format #t "~Tdata-size: #x~X~%" (-> obj data-size)) - (format #t "~Ttag[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj tag)) - (dotimes (i (-> obj length)) +(defmethod inspect res-lump ((this res-lump)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata-base: #x~X~%" (-> this data-base)) + (format #t "~Tdata-top: #x~X~%" (-> this data-top)) + (format #t "~Tdata-size: #x~X~%" (-> this data-size)) + (format #t "~Ttag[~D]: @ #x~X~%" (-> this allocated-length) (-> this tag)) + (dotimes (i (-> this length)) (format #t "~T [~D] " i) - (print (-> (-> obj tag) i)) - (format #t " @ #x~X" (get-tag-index-data obj i)) + (print (-> (-> this tag) i)) + (format #t " @ #x~X" (get-tag-index-data this i)) (cond - ((res-ref? (-> obj tag i)) - (format #t " = ~A~%" (deref basic (get-tag-index-data obj i))) + ((res-ref? (-> this tag i)) + (format #t " = ~A~%" (deref basic (get-tag-index-data this i))) ) (else (format #t "~%") ) ) ) - obj + this ) -(defmethod lookup-tag-idx res-lump ((obj res-lump) (name-sym symbol) (mode symbol) (time float)) +(defmethod lookup-tag-idx res-lump ((this res-lump) (name-sym symbol) (mode symbol) (time float)) "Look up the index of the tag containing with the given name and timestamp. Correct lookups return a res-tag-pair, which contains one tag index in the lower 32 bits and one in the upper 32 bits. Depending on the mode, they may be the same, or they may be two tags that you should interpolate @@ -169,7 +171,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) ;; check that we are valid. - (if (or (not obj) (zero? obj) (<= (-> obj length) 0)) + (if (or (not this) (zero? this) (<= (-> this length) 0)) (return (the res-tag-pair -1)) ) @@ -186,7 +188,7 @@ This is updated from the entity system used in Crash 2, which had most of these ;; now we will do a binary search. The names are stored in ascending order if you ;; treat the first 8 chars as an integer ;; min/max are inclusive. - (let ((max-search (+ (-> obj length) -1)) + (let ((max-search (+ (-> this length) -1)) (min-search 0) ) ;; inclusive, so >= is correct @@ -195,7 +197,7 @@ This is updated from the entity system used in Crash 2, which had most of these (let* ((check-idx (+ min-search (/ (- max-search min-search) 2))) ;; subtract the two words. The sign of this tells us if we are too high or too low (diff (- type-chars - (-> (the-as (pointer uint64) (-> (symbol->string (-> (-> obj tag) check-idx name)) data)) 0) + (-> (the-as (pointer uint64) (-> (symbol->string (-> (-> this tag) check-idx name)) data)) 0) ) ) ) @@ -228,7 +230,7 @@ This is updated from the entity system used in Crash 2, which had most of these ;; this loop brings us to the first tag with the correct name. (while (and (> tag-idx 0) (= type-chars - (-> (the-as (pointer uint64) (-> (symbol->string (-> (-> obj tag) (+ tag-idx -1) name)) data)) 0) + (-> (the-as (pointer uint64) (-> (symbol->string (-> (-> this tag) (+ tag-idx -1) name)) data)) 0) ) ) (+! tag-idx -1) @@ -250,11 +252,11 @@ This is updated from the entity system used in Crash 2, which had most of these ;; (the fact that they keep a pointer to a tag and not actually load the tag makes it seem like ;; they ran into some 128-bit integer issues here...) (let ((interp-tag-idx tag-idx) - (tag-ptr (&-> (-> obj tag) tag-idx)) + (tag-ptr (&-> (-> this tag) tag-idx)) ) ;; loop, until we reach another name or the end of the table (while (not (or - (>= interp-tag-idx (-> obj length)) + (>= interp-tag-idx (-> this length)) ;; < is correct here because we are incrementing and names get larger (< type-chars (-> (the-as (pointer uint64) (-> (symbol->string (-> tag-ptr 0 name)) data)) 0) @@ -330,31 +332,31 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod make-property-data res-lump ((obj res-lump) (time float) (tag-pair res-tag-pair) (buf pointer)) +(defmethod make-property-data res-lump ((this res-lump) (time float) (tag-pair res-tag-pair) (buf pointer)) "Returns (a pointer to) the value data of a property with the tag-pair. If tag-pair does not represent an exact point in the timeline, then the data is interpolated based on time with the result written into buf. buf must have enough space to copy all of the data. Otherwise, simply returns an address to the resource binary." - (let* ((tag-lo (-> obj tag (-> tag-pair lo))) - (tag-hi (-> obj tag (-> tag-pair hi))) + (let* ((tag-lo (-> this tag (-> tag-pair lo))) + (tag-hi (-> this tag (-> tag-pair hi))) (elt-count (-> tag-lo elt-count)) ) (cond ((res-ref? tag-lo) - (get-tag-data obj tag-lo) + (get-tag-data this tag-lo) ) ((or (not buf) (= (-> tag-pair lo) (-> tag-pair hi)) (!= elt-count (-> tag-hi elt-count)) (!= (-> tag-lo elt-type) (-> tag-hi elt-type))) - (get-tag-data obj tag-lo) + (get-tag-data this tag-lo) ) (else (let ((interp (/ (- time (-> tag-lo key-frame)) (- (-> tag-hi key-frame) (-> tag-lo key-frame)))) ;; DBZ - (src-lo (get-tag-data obj tag-lo)) - (src-hi (get-tag-data obj tag-hi)) + (src-lo (get-tag-data this tag-lo)) + (src-hi (get-tag-data this tag-hi)) ) (case (-> tag-lo elt-type symbol) (('float) @@ -406,7 +408,7 @@ This is updated from the entity system used in Crash 2, which had most of these buf ) (else - (get-tag-data obj tag-lo) + (get-tag-data this tag-lo) ) ) ) @@ -415,22 +417,22 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod get-property-data res-lump ((obj res-lump) (name symbol) (mode symbol) (time float) (default pointer) (tag-addr (pointer res-tag)) (buf-addr pointer)) +(defmethod get-property-data res-lump ((this res-lump) (name symbol) (mode symbol) (time float) (default pointer) (tag-addr (pointer res-tag)) (buf-addr pointer)) "Returns an address to a given property's data at a specific time stamp, or default on error. name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. default is the default result returned in the case of an error. tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode." - (let ((tag-pair (lookup-tag-idx obj name mode time))) + (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) (empty) ) (else - (set! default (make-property-data obj time tag-pair buf-addr)) + (set! default (make-property-data this time tag-pair buf-addr)) (if tag-addr - (set! (-> tag-addr) (-> obj tag (-> tag-pair lo))) + (set! (-> tag-addr) (-> this tag (-> tag-pair lo))) ) ) ) @@ -440,21 +442,21 @@ This is updated from the entity system used in Crash 2, which had most of these -(defmethod get-property-struct res-lump ((obj res-lump) (name symbol) (mode symbol) (time float) (default structure) (tag-addr (pointer res-tag)) (buf-addr pointer)) +(defmethod get-property-struct res-lump ((this res-lump) (name symbol) (mode symbol) (time float) (default structure) (tag-addr (pointer res-tag)) (buf-addr pointer)) "Returns a given struct property's value at a specific time stamp, or default on error. name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. default is the default result returned in the case of an error. tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode." - (let ((tag-pair (lookup-tag-idx obj name mode time))) + (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) (empty) ) (else - (set! default (the-as structure (make-property-data obj time tag-pair buf-addr))) - (let ((tag (-> obj tag (-> tag-pair lo)))) + (set! default (the-as structure (make-property-data this time tag-pair buf-addr))) + (let ((tag (-> this tag (-> tag-pair lo)))) (if tag-addr (set! (-> tag-addr 0) tag) ) @@ -471,21 +473,21 @@ This is updated from the entity system used in Crash 2, which had most of these -(defmethod get-property-value res-lump ((obj res-lump) (name symbol) (mode symbol) (time float) (default uint128) (tag-addr (pointer res-tag)) (buf-addr pointer)) +(defmethod get-property-value res-lump ((this res-lump) (name symbol) (mode symbol) (time float) (default uint128) (tag-addr (pointer res-tag)) (buf-addr pointer)) "Returns a given value property's value at a specific time stamp, or default on error. name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. default is the default result returned in the case of an error. tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode." - (let ((tag-pair (lookup-tag-idx obj name mode time))) + (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) ) (else - (let* ((tag (-> obj tag (-> tag-pair lo))) + (let* ((tag (-> this tag (-> tag-pair lo))) (tag-type (-> tag elt-type)) - (data (make-property-data obj time tag-pair buf-addr)) + (data (make-property-data this time tag-pair buf-addr)) ) (if tag-addr (set! (-> tag-addr 0) tag) @@ -523,18 +525,18 @@ This is updated from the entity system used in Crash 2, which had most of these ) -(defmethod get-property-value-float res-lump ((obj res-lump) (name symbol) (mode symbol) (time float) (default float) (tag-addr (pointer res-tag)) (buf-addr pointer)) +(defmethod get-property-value-float res-lump ((this res-lump) (name symbol) (mode symbol) (time float) (default float) (tag-addr (pointer res-tag)) (buf-addr pointer)) "same as get-property-value but float type is checked first?" - (let ((tag-pair (lookup-tag-idx obj name mode time))) + (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) (empty) ) (else - (let* ((tag (-> obj tag (-> tag-pair lo))) + (let* ((tag (-> this tag (-> tag-pair lo))) (tag-type (-> tag elt-type)) - (data (make-property-data obj time tag-pair buf-addr)) + (data (make-property-data this time tag-pair buf-addr)) ) (if tag-addr (set! (-> tag-addr 0) tag) @@ -572,18 +574,18 @@ This is updated from the entity system used in Crash 2, which had most of these default ) -(defmethod sort! res-lump ((obj res-lump)) +(defmethod sort! res-lump ((this res-lump)) "Sort all tags based on name, then key-frame." (let ((tags-sorted -1)) (while (nonzero? tags-sorted) (set! tags-sorted 0) (let ((i 0) - (tag-stop (+ (-> obj length) -2)) + (tag-stop (+ (-> this length) -2)) ) (while (>= tag-stop i) - (let* ((tag1 (-> obj tag i)) - (tag2 (-> obj tag (1+ i))) + (let* ((tag1 (-> this tag i)) + (tag2 (-> this tag (1+ i))) (tag-name1 (deref uint64 (-> (symbol->string (-> tag1 name)) data))) (tag-name2 (deref uint64 (-> (symbol->string (-> tag2 name)) data))) ) @@ -591,8 +593,8 @@ This is updated from the entity system used in Crash 2, which had most of these (and (= tag-name1 tag-name2) (< (-> tag2 key-frame) (-> tag1 key-frame)))) (1+! tags-sorted) - (set! (-> obj tag i) tag2) - (set! (-> obj tag (1+ i)) tag1) + (set! (-> this tag i) tag2) + (set! (-> this tag (1+ i)) tag1) ) ) (1+! i) @@ -600,11 +602,11 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) ) - obj + this ) -(defmethod allocate-data-memory-for-tag! res-lump ((obj res-lump) (arg0 res-tag)) - "Find space for the data described by arg0 in obj. +(defmethod allocate-data-memory-for-tag! res-lump ((this res-lump) (arg0 res-tag)) + "Find space for the data described by arg0 in `this`. Returns a tag with data-offset set correctly for this res-lump. If the lump already contains memory for the given tag, and it is big enough, it will be reused. Alignment will be at least 8 bytes. @@ -612,8 +614,8 @@ This is updated from the entity system used in Crash 2, which had most of these (local-vars (resource-mem pointer)) ;; first, look up the tag to see if it already exists in this res-lump - (let ((tag-pair (lookup-tag-idx obj (-> arg0 name) 'exact (-> arg0 key-frame)))) - (let ((existing-tag (-> obj tag (-> tag-pair lo)))) + (let ((tag-pair (lookup-tag-idx this (-> arg0 name) 'exact (-> arg0 key-frame)))) + (let ((existing-tag (-> this tag (-> tag-pair lo)))) ;; If our existing tag is valid, but our key-frame is NaN, then we forget about it. (if (and (>= (the-as int tag-pair) 0) (!= (-> arg0 key-frame) (-> arg0 key-frame)) ;; check for NaN @@ -634,34 +636,34 @@ This is updated from the entity system used in Crash 2, which had most of these ) ;; we have enough memory in the existing tag. ;; so we can just reuse it. - (set! resource-mem (&+ (-> obj data-base) (-> existing-tag data-offset))) + (set! resource-mem (&+ (-> this data-base) (-> existing-tag data-offset))) ;; but we want at least 8 byte alignment. If this fails, allocate with 16-byte alignment from the top. (when (nonzero? (logand (the-as int resource-mem) 7)) - (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) - (set! (-> obj data-top) (&+ resource-mem data-size)) + (set! resource-mem (logand -16 (&+ (-> this data-top) 15))) + (set! (-> this data-top) (&+ resource-mem data-size)) ) ) (else ;; the existing tag wasn't there, or it wasn't big enough. ;; just allocate new memory. - (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) - (set! (-> obj data-top) (&+ resource-mem data-size)) + (set! resource-mem (logand -16 (&+ (-> this data-top) 15))) + (set! (-> this data-top) (&+ resource-mem data-size)) ) ) ;; set our data offset. - (set! (-> arg0 data-offset) (&- resource-mem (the-as uint (-> obj data-base)))) + (set! (-> arg0 data-offset) (&- resource-mem (the-as uint (-> this data-base)))) ;; check for overflow of the data memory ;; this will leave things in a bad state. (when (>= (the-as int (&+ resource-mem data-size)) - (the-as int (&+ (-> obj data-base) (-> obj data-size))) + (the-as int (&+ (-> this data-base) (-> this data-size))) ) (format 0 "ERROR: attempting to a new tag ~`res-tag`P data of #x~X bytes to ~A, but data memory is full.~%" arg0 data-size - obj + this ) (return (the-as res-tag #f)) ) @@ -673,41 +675,41 @@ This is updated from the entity system used in Crash 2, which had most of these ((< (the-as int tag-pair) 0) ;; we couldn't reuse an existing tag. Need to allocate another (cond - ((>= (-> obj length) (-> obj allocated-length)) + ((>= (-> this length) (-> this allocated-length)) ;; but there isn't room for another tag. (format 0 "ERROR: attempting to a new tag ~`res-tag`P to ~A, but tag memory is full.~%" arg0 - obj + this ) (return (the-as res-tag #f)) ) (else ;; allocate a new tag and sort, so the binary search works properly. - (set! (-> obj tag (-> obj length)) arg0) - (set! (-> obj length) (+ (-> obj length) 1)) - (sort! obj) + (set! (-> this tag (-> this length)) arg0) + (set! (-> this length) (+ (-> this length) 1)) + (sort! this) ) ) ) (else ;; reuse the existing tag. - (set! (-> obj tag (-> tag-pair lo)) arg0) + (set! (-> this tag (-> tag-pair lo)) arg0) ) ) ) arg0 ) -(defmethod add-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 pointer)) +(defmethod add-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 pointer)) "Given a tag and a pointer to its data, copy it to this res-lump. This doesn't seem to do the right thing if the given tag is a non-inline tag with > 1 element." ;; get a tag for this lump with memory for the given tag. - (let ((new-tag (allocate-data-memory-for-tag! obj arg0))) + (let ((new-tag (allocate-data-memory-for-tag! this arg0))) (when new-tag ;; get pointer to new tag's memory - (let* ((v1-2 obj) + (let* ((v1-2 this) (a1-1 new-tag) (tag-mem (&+ (-> v1-2 data-base) (-> a1-1 data-offset))) ) @@ -727,31 +729,31 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) ) - obj + this ) -(defmethod add-32bit-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 object)) +(defmethod add-32bit-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 object)) "Add a single 32-bit value using add-data." (set! (-> arg0 inlined?) 1) - (add-data! obj arg0 (& arg1)) ;; note, only 32-bits are spilled to the stack here. + (add-data! this arg0 (& arg1)) ;; note, only 32-bits are spilled to the stack here. #| (local-vars (sv-16 object)) (set! sv-16 arg1) (let* ((v1-0 arg0) (a1-4 (copy-and-set-bf v1-0 :inlined? 1)) ) - (add-data! obj a1-4 (& sv-16)) + (add-data! this a1-4 (& sv-16)) ) |# ) -(defmethod get-curve-data! res-lump ((obj res-lump) (curve-target curve) (points-name symbol) (knots-name symbol) (time float)) +(defmethod get-curve-data! res-lump ((this res-lump) (curve-target curve) (points-name symbol) (knots-name symbol) (time float)) "Read curve data and write it to curve-target. Return #t if both control points and knots data was succesfully read, #f otherwise." (let ((result #f)) ;; there's some macro here (let* ((points-tag (new 'static 'res-tag)) - (curve-data (get-property-data obj points-name 'exact time (the pointer #f) (& points-tag) *res-static-buf*))) + (curve-data (get-property-data this points-name 'exact time (the pointer #f) (& points-tag) *res-static-buf*))) (when curve-data (set! (-> curve-target cverts) (the-as (inline-array vector) curve-data)) @@ -766,7 +768,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) (let ((knots-tag (new 'static 'res-tag))) - (set! curve-data (get-property-data obj knots-name 'exact time (the pointer #f) (& knots-tag) *res-static-buf*)) + (set! curve-data (get-property-data this knots-name 'exact time (the pointer #f) (& knots-tag) *res-static-buf*)) (when curve-data (set! (-> curve-target knots) (the (pointer float) curve-data)) @@ -783,7 +785,7 @@ This is updated from the entity system used in Crash 2, which had most of these (define-extern part-group-pointer? (function pointer symbol)) (declare-type nav-mesh basic) (declare-type collide-mesh basic) -(defmethod mem-usage res-lump ((obj res-lump) (block memory-usage-block) (flags int)) +(defmethod mem-usage res-lump ((this res-lump) (block memory-usage-block) (flags int)) "Get the memory usage of this lump and its data" (local-vars (sv-16 int)) @@ -818,7 +820,7 @@ This is updated from the entity system used in Crash 2, which had most of these (set! (-> block data mem-use-id count) (+ (-> block data mem-use-id count) 1)) ;; add the size of the lump itself. - (let ((obj-size (asize-of obj))) + (let ((obj-size (asize-of this))) (set! (-> block data mem-use-id used) (+ (-> block data mem-use-id used) obj-size) ) @@ -828,9 +830,9 @@ This is updated from the entity system used in Crash 2, which had most of these ) ;; add the tags - (dotimes (tag-idx (-> obj length)) - (when (zero? (-> obj tag tag-idx inlined?)) - (let* ((a1-4 obj) + (dotimes (tag-idx (-> this length)) + (when (zero? (-> this tag tag-idx inlined?)) + (let* ((a1-4 this) (a0-15 tag-idx) (tag-data (the-as basic @@ -1003,5 +1005,3 @@ This is updated from the entity system used in Crash 2, which had most of these *res-static-buf* ) ) - - diff --git a/goal_src/jak1/engine/game/effect-control-h.gc b/goal_src/jak1/engine/game/effect-control-h.gc index 0072e7d361..9a29363e1b 100644 --- a/goal_src/jak1/engine/game/effect-control-h.gc +++ b/goal_src/jak1/engine/game/effect-control-h.gc @@ -49,8 +49,8 @@ ) ) -(defmethod set-channel-offset! effect-control ((obj effect-control) (arg0 int)) - (set! (-> obj channel-offset) arg0) +(defmethod set-channel-offset! effect-control ((this effect-control) (arg0 int)) + (set! (-> this channel-offset) arg0) 0 (none) ) diff --git a/goal_src/jak1/engine/game/effect-control.gc b/goal_src/jak1/engine/game/effect-control.gc index 5ddfc0ea87..371d4c4a66 100644 --- a/goal_src/jak1/engine/game/effect-control.gc +++ b/goal_src/jak1/engine/game/effect-control.gc @@ -129,10 +129,10 @@ arg0 ) -(defmethod effect-control-method-9 effect-control ((obj effect-control)) - (let* ((a0-1 (-> obj process skel)) - (v1-3 (if (< (-> obj channel-offset) (-> a0-1 active-channels)) - (-> a0-1 root-channel (-> obj channel-offset)) +(defmethod effect-control-method-9 effect-control ((this effect-control)) + (let* ((a0-1 (-> this process skel)) + (v1-3 (if (< (-> this channel-offset) (-> a0-1 active-channels)) + (-> a0-1 root-channel (-> this channel-offset)) (the-as joint-control-channel #f) ) ) @@ -144,24 +144,24 @@ ) (let ((a0-3 (-> a0-1 root-channel 0 num-func))) (cond - ((!= s5-0 (-> obj last-frame-group)) - (set! (-> obj res) (-> s5-0 extra)) + ((!= s5-0 (-> this last-frame-group)) + (set! (-> this res) (-> s5-0 extra)) (let ((v1-6 (-> (lookup-tag-idx (-> s5-0 extra) 'effect-name 'base -1000000000.0) lo))) - (set! (-> obj name) (if (>= (the-as int v1-6) 0) - (&-> (-> s5-0 extra tag) v1-6) - (the-as (pointer res-tag) #f) - ) + (set! (-> this name) (if (>= (the-as int v1-6) 0) + (&-> (-> s5-0 extra tag) v1-6) + (the-as (pointer res-tag) #f) + ) ) ) - (if (and (-> obj name) (= (-> obj name 0 key-frame) -1000000000.0)) - (set! (-> obj name) (&-> (-> obj name) 1)) + (if (and (-> this name) (= (-> this name 0 key-frame) -1000000000.0)) + (set! (-> this name) (&-> (-> this name) 1)) ) - (effect-control-method-14 obj f30-0 f30-0 f30-0) + (effect-control-method-14 this f30-0 f30-0 f30-0) ) - ((or (not (-> obj name)) (= f30-0 (-> obj last-frame-num))) + ((or (not (-> this name)) (= f30-0 (-> this last-frame-num))) ) (else - (let ((f28-0 (-> obj last-frame-num)) + (let ((f28-0 (-> this last-frame-num)) (f26-0 f30-0) ) (cond @@ -170,12 +170,12 @@ (cond ((< f26-0 f28-0) (if (>= f28-0 f0-6) - (effect-control-method-14 obj f26-0 f28-0 f30-0) + (effect-control-method-14 this f26-0 f28-0 f30-0) ) ) (else (if (>= f0-6 f28-0) - (effect-control-method-14 obj f28-0 f26-0 f30-0) + (effect-control-method-14 this f28-0 f26-0 f30-0) ) ) ) @@ -186,43 +186,43 @@ ((>= (-> v1-3 param 0) 0.0) (cond ((< f26-0 f28-0) - (effect-control-method-14 obj f28-0 9999999.0 f30-0) - (effect-control-method-14 obj -100000000.0 f26-0 9999999.0) + (effect-control-method-14 this f28-0 9999999.0 f30-0) + (effect-control-method-14 this -100000000.0 f26-0 9999999.0) ) (else - (effect-control-method-14 obj f28-0 f26-0 f30-0) + (effect-control-method-14 this f28-0 f26-0 f30-0) ) ) ) ((< f28-0 f26-0) - (effect-control-method-14 obj f26-0 9999999.0 f30-0) - (effect-control-method-14 obj -100000000.0 f28-0 9999999.0) + (effect-control-method-14 this f26-0 9999999.0 f30-0) + (effect-control-method-14 this -100000000.0 f28-0 9999999.0) ) (else - (effect-control-method-14 obj f26-0 f28-0 f30-0) + (effect-control-method-14 this f26-0 f28-0 f30-0) ) ) ) ((= a0-3 num-func-+!) (if (>= (-> v1-3 param 0) 0.0) - (effect-control-method-14 obj f28-0 f26-0 f30-0) - (effect-control-method-14 obj f26-0 f28-0 f30-0) + (effect-control-method-14 this f28-0 f26-0 f30-0) + (effect-control-method-14 this f26-0 f28-0 f30-0) ) ) ((= a0-3 num-func-identity) - (effect-control-method-14 obj f30-0 f30-0 f30-0) + (effect-control-method-14 this f30-0 f30-0 f30-0) ) ) ) ) ) ) - (set! (-> obj last-frame-group) s5-0) - (set! (-> obj last-frame-num) f30-0) + (set! (-> this last-frame-group) s5-0) + (set! (-> this last-frame-num) f30-0) ) ) (else - (set! (-> obj last-frame-group) #f) + (set! (-> this last-frame-group) #f) ) ) ) @@ -230,20 +230,20 @@ (none) ) -(defmethod effect-control-method-14 effect-control ((obj effect-control) (arg0 float) (arg1 float) (arg2 float)) +(defmethod effect-control-method-14 effect-control ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) ;; note: this check was added. I believe in the original game name could be false, and then the ;; effect-name check below would fail. This did not cause a crash on original hardware because ;; misaligned 16-byte loads silently align. This causes a crash in opengoal, so we skip it manually. - (when (-> obj name) - (let ((s2-0 (-> obj name))) + (when (-> this name) + (let ((s2-0 (-> this name))) (while (= (-> s2-0 0 name) 'effect-name) (let ((f0-0 (-> s2-0 0 key-frame))) (when (or (and (< f0-0 arg1) (< arg0 f0-0)) (= f0-0 arg2)) - (let* ((a0-1 obj) - (t9-0 (method-of-object a0-1 effect-control-method-10)) - (v1-7 (-> obj res)) - (a1-1 (-> s2-0 0)) - ) + (let* ((a0-1 this) + (t9-0 (method-of-object a0-1 effect-control-method-10)) + (v1-7 (-> this res)) + (a1-1 (-> s2-0 0)) + ) (t9-0 a0-1 (the-as symbol (-> (the-as (pointer uint32) (&+ (-> v1-7 data-base) (-> a1-1 data-offset))))) @@ -261,14 +261,7 @@ (none) ) -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 205] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 217] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 237] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 343] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 364] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 450] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 469] -(defmethod effect-control-method-10 effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int)) +(defmethod effect-control-method-10 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) (local-vars (sv-160 int) (sv-176 symbol) @@ -284,7 +277,7 @@ (s5-0 (cond ((< arg2 0) (let ((v0-0 (get-property-value - (-> obj res) + (-> this res) 'effect-joint 'exact arg1 @@ -307,8 +300,8 @@ ) ) ) - (when (logtest? (-> obj flags) 1) - (if (send-event (-> obj process) 'effect arg0 arg1 s5-0) + (when (logtest? (-> this flags) 1) + (if (send-event (-> this process) 'effect arg0 arg1 s5-0) (return (the-as object 0)) ) ) @@ -322,7 +315,7 @@ (= (-> v1-10 data 5) 116) (= (-> v1-10 data 6) 45) ) - (let* ((s3-1 (-> obj process root)) + (let* ((s3-1 (-> this process root)) (v1-14 (if (and (nonzero? s3-1) (type-type? (-> s3-1 type) collide-shape-moving)) s3-1 ) @@ -333,7 +326,7 @@ ) ) ) - (effect-control-method-11 obj arg0 arg1 s5-0 (-> obj res) (the-as pat-surface t1-1)) + (effect-control-method-11 this arg0 arg1 s5-0 (-> this res) (the-as pat-surface t1-1)) ) ) ((let ((v1-18 (symbol->string arg0))) @@ -365,8 +358,8 @@ (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) + (current-time) + (-> this process name) arg0 arg1 s5-0 @@ -375,7 +368,7 @@ (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-1 (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s4-1) (-> obj process) 'part-tracker (the-as pointer #x70004000)) + (t9-7 (the-as part-tracker s4-1) (-> this process) 'part-tracker (the-as pointer #x70004000)) ) (let ((s2-1 run-function-in-process) (s1-0 s4-1) @@ -385,7 +378,7 @@ (set! sv-176 (the-as symbol #f)) (set! sv-192 (the-as symbol #f)) (set! sv-208 (the-as symbol #f)) - (let ((t3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) + (let ((t3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)))) ((the-as (function object object object object object object object object none) s2-1) s1-0 s0-0 @@ -407,15 +400,15 @@ (activate! *camera-smush-control* 819.2 37 600 1.0 0.995) ) ((zero? s3-0) - (effect-control-method-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) + (effect-control-method-12 this arg0 arg1 s5-0 (-> this res) (string->sound-name (symbol->string arg0))) ) ((= (-> (the-as basic s3-0) type) sparticle-launcher) (if *debug-effect-control* (format #t "(~5D) effect part ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) + (current-time) + (-> this process name) arg0 arg1 s5-0 @@ -424,15 +417,15 @@ (format #t "-----> (~5D) effect part ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) + (current-time) + (-> this process name) arg0 arg1 s5-0 ) (launch-particles :rate 1.0 (the-as sparticle-launcher s3-0) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) ) ) ((= (-> (the-as basic s3-0) type) sparticle-launch-group) @@ -440,8 +433,8 @@ (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) + (current-time) + (-> this process name) arg0 arg1 s5-0 @@ -450,7 +443,7 @@ (let ((s4-3 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-3 (let ((t9-19 (method-of-type part-tracker activate))) - (t9-19 (the-as part-tracker s4-3) (-> obj process) 'part-tracker (the-as pointer #x70004000)) + (t9-19 (the-as part-tracker s4-3) (-> this process) 'part-tracker (the-as pointer #x70004000)) ) (let ((s2-3 run-function-in-process) (s1-2 s4-3) @@ -460,7 +453,7 @@ (set! sv-240 (the-as symbol #f)) (set! sv-256 (the-as symbol #f)) (set! sv-272 (the-as symbol #f)) - (let ((t3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) + (let ((t3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)))) ((the-as (function object object object object object object object object none) s2-3) s1-2 s0-2 @@ -481,11 +474,11 @@ (sound-play-by-spec (the-as sound-spec s3-0) (new-sound-id) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) ) ) ((= (-> (the-as basic s3-0) type) death-info) - (let ((v1-67 (-> obj process draw))) + (let ((v1-67 (-> this process draw))) (let ((a1-42 (-> (the-as death-info s3-0) vertex-skip)) (a0-55 (max @@ -517,20 +510,20 @@ (set! (-> v1-67 death-draw-overlap) (-> (the-as death-info s3-0) overlap)) ) (when (-> (the-as death-info s3-0) sound) - (let* ((s2-5 obj) + (let* ((s2-5 this) (s1-3 (method-of-object s2-5 effect-control-method-12)) (s0-3 (-> (the-as death-info s3-0) sound)) ) - (set! sv-288 (-> obj res)) + (set! sv-288 (-> this res)) (let ((t1-11 (string->sound-name (symbol->string (-> (the-as death-info s3-0) sound))))) (s1-3 s2-5 s0-3 arg1 s5-0 sv-288 t1-11) ) ) ) - (send-event (-> obj process) 'death-start (the-as death-info s3-0)) + (send-event (-> this process) 'death-start (the-as death-info s3-0)) ) (else - (effect-control-method-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) + (effect-control-method-12 this arg0 arg1 s5-0 (-> this res) (string->sound-name (symbol->string arg0))) ) ) ) @@ -538,7 +531,7 @@ 0 ) -(defmethod effect-control-method-11 effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) +(defmethod effect-control-method-11 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) (local-vars (sv-48 (function sparticle-system sparticle-launcher vector sparticle-launch-state sparticle-launch-control float none) @@ -578,7 +571,7 @@ ) (('effect-land-poof) (when (< a0-4 9000) - (let* ((a0-13 obj) + (let* ((a0-13 this) (t9-8 (method-of-object a0-13 effect-control-method-10)) (v1-15 (-> arg4 material)) ) @@ -645,7 +638,7 @@ ) (('effect-run-poof) (when (< a0-4 9000) - (let* ((a0-14 obj) + (let* ((a0-14 this) (t9-9 (method-of-object a0-14 effect-control-method-10)) (v1-20 (-> arg4 material)) ) @@ -711,7 +704,7 @@ ) ) (('effect-just-footprint) - (let* ((a0-15 obj) + (let* ((a0-15 this) (t9-10 (method-of-object a0-15 effect-control-method-10)) (v1-24 (-> arg4 material)) ) @@ -777,7 +770,7 @@ ) (('effect-just-poof) (when (< a0-4 9000) - (let* ((a0-16 obj) + (let* ((a0-16 this) (t9-11 (method-of-object a0-16 effect-control-method-10)) (v1-29 (-> arg4 material)) ) @@ -843,7 +836,7 @@ ) ) (('effect-slide-poof) - (let* ((a0-19 obj) + (let* ((a0-19 this) (t9-12 (method-of-object a0-19 effect-control-method-10)) (v1-33 (-> arg4 material)) ) @@ -967,7 +960,7 @@ (when (nonzero? s0-0) (set! sv-48 sp-launch-particles-var) (set! sv-64 *sp-particle-system-2d*) - (let ((a2-36 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2))) + (let ((a2-36 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2))) (a3-6 #f) (t0-1 #f) (t1-1 1.0) @@ -1037,7 +1030,7 @@ (when (nonzero? s0-1) (set! sv-80 sp-launch-particles-var) (set! sv-96 *sp-particle-system-2d*) - (let ((a2-37 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2))) + (let ((a2-37 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2))) (a3-7 #f) (t0-2 #f) (t1-2 1.0) @@ -1050,21 +1043,21 @@ ) ) (if s1-0 - (effect-control-method-12 obj arg0 arg1 arg2 arg3 s1-0) + (effect-control-method-12 this arg0 arg1 arg2 arg3 s1-0) ) ) 0 (none) ) -(defmethod effect-control-method-12 effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) +(defmethod effect-control-method-12 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) (local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float))) (set! sv-144 arg3) (let ((s0-0 arg4) (gp-0 (new 'stack 'sound-spec)) (s5-0 (if (< arg2 0) (the-as vector #f) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) ) ) ) @@ -1104,8 +1097,8 @@ (format #t "(~5D) effect sound ~A ~A (~S) frame ~F joint ~D " - (-> *display* base-frame-counter) - (-> obj process name) + (current-time) + (-> this process name) arg0 *temp-string* arg1 diff --git a/goal_src/jak1/engine/game/fact-h.gc b/goal_src/jak1/engine/game/fact-h.gc index a9511bc914..dd442fe41a 100644 --- a/goal_src/jak1/engine/game/fact-h.gc +++ b/goal_src/jak1/engine/game/fact-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: fact-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; The fact bank is a single static object containing health/eco parameters ;; All game code should reference *FACT-bank* to determine these parameters @@ -168,18 +170,18 @@ fails will use the values in the arguments" (local-vars (tag res-tag)) ;; allocate. - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (let ((ent (the res-lump (-> proc entity)))) ;; confirm that we allocated successfully - (when (zero? obj) + (when (zero? this) (go process-drawable-art-error "memory") ;; this is already true... - (set! obj (the-as fact-info 0)) + (set! this (the-as fact-info 0)) (goto cfg-10) ) ;; remember who we belong to - (set! (-> obj process) proc) + (set! (-> this process) proc) ;; eco may override the pickup type and amount, so try to get this. (let ((v1-6 (res-lump-data ent 'eco-info (pointer int32) :tag-ptr (& tag) :time 0.0))) @@ -188,7 +190,7 @@ ;; eco-info lookup succeeded, (let ((a0-6 (-> tag elt-count))) ;; first thing is pickup type, it's always there - (set! (-> obj pickup-type) (the-as pickup-type (-> v1-6 0))) + (set! (-> this pickup-type) (the-as pickup-type (-> v1-6 0))) ;; pickup amount is optional. (set! pkup-amount (if (< (the-as uint 1) (the-as uint a0-6)) (the float (-> v1-6 1)) @@ -196,57 +198,57 @@ ) ) ) - (set! (-> obj pickup-amount) pkup-amount) + (set! (-> this pickup-amount) pkup-amount) ) (else ;; no eco-info, use stuff from args - (set! (-> obj pickup-type) pkup-type) - (set! (-> obj pickup-amount) pkup-amount) + (set! (-> this pickup-type) pkup-type) + (set! (-> this pickup-amount) pkup-amount) ) ) ) ;; read the options - (set! (-> obj options) (res-lump-value ent 'options fact-options)) + (set! (-> this options) (res-lump-value ent 'options fact-options)) ;; read fade time, if we have fade or respawn - (if (logtest? (fact-options fade respawn) (-> obj options)) - (set! (-> obj fade-time) (the int (* 300.0 (res-lump-float ent 'timeout)))) + (if (logtest? (fact-options fade respawn) (-> this options)) + (set! (-> this fade-time) (the int (* 300.0 (res-lump-float ent 'timeout)))) ) ) (label cfg-10) - obj + this ) ) -(defmethod pickup-collectable! fact-info ((obj fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! fact-info ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) 0.0 ) (defmethod new fact-info-enemy ((allocation symbol) (type-to-make type) (proc process-drawable) (kind pickup-type) (amount float)) "Create information about an enemy. Possibly includes what the enemy will drop when it is killed?" ;; base class ctor - (let ((obj (the-as fact-info-enemy ((method-of-type fact-info new) allocation type-to-make proc kind amount)))) + (let ((this (the-as fact-info-enemy ((method-of-type fact-info new) allocation type-to-make proc kind amount)))) ;; read values from the process entity - (let ((entity (the res-lump (-> obj process entity)))) - (set! (-> obj speed) (res-lump-float entity 'speed :default 1.0)) - (set! (-> obj idle-distance) (res-lump-float entity 'idle-distance :default 327680.0)) - (set! (-> obj notice-top) (res-lump-float entity 'notice-top :default 4096000.0)) - (set! (-> obj notice-bottom) (res-lump-float entity 'notice-bottom :default 4096000.0)) - (set! (-> obj cam-horz) (res-lump-float entity 'cam-horz)) - (set! (-> obj cam-vert) (res-lump-float entity 'cam-vert)) - (set! (-> obj cam-notice-dist) (res-lump-float entity 'cam-notice-dist :default -4096.0)) + (let ((entity (the res-lump (-> this process entity)))) + (set! (-> this speed) (res-lump-float entity 'speed :default 1.0)) + (set! (-> this idle-distance) (res-lump-float entity 'idle-distance :default 327680.0)) + (set! (-> this notice-top) (res-lump-float entity 'notice-top :default 4096000.0)) + (set! (-> this notice-bottom) (res-lump-float entity 'notice-bottom :default 4096000.0)) + (set! (-> this cam-horz) (res-lump-float entity 'cam-horz)) + (set! (-> this cam-vert) (res-lump-float entity 'cam-vert)) + (set! (-> this cam-notice-dist) (res-lump-float entity 'cam-notice-dist :default -4096.0)) ) - obj + this ) ) (defmethod new fact-info-target ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 pickup-type) (arg2 float)) "Create information about target. Not sure why this has stuff like pickup-type." - (let ((obj (the-as fact-info-target ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2)))) - (set! (-> obj eco-source) (the-as handle #f)) - (reset! obj #f) - obj + (let ((this (the-as fact-info-target ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2)))) + (set! (-> this eco-source) (the-as handle #f)) + (reset! this #f) + this ) ) diff --git a/goal_src/jak1/engine/game/game-h.gc b/goal_src/jak1/engine/game/game-h.gc index de7cff7c18..12249573c9 100644 --- a/goal_src/jak1/engine/game/game-h.gc +++ b/goal_src/jak1/engine/game/game-h.gc @@ -17,6 +17,27 @@ (declare-type water-control basic) (declare-type collide-shape basic) +(defenum attack-mask + :bitfield #t + :type uint32 + (trans) + (vector) + (intersection) + (attacker) + (invinc-time) + (mode) + (shove-back) + (shove-up) + (speed) + (dist) + (control) + (angle) + (rotate-to) + (atki13) + ) + +;; DECOMP BEGINS + ;; These flags are a bit of a hack and are mostly only meaningful on *target* ;; except for "fade-out-particles" which is meaninful for eco only. (defenum state-flags @@ -186,26 +207,6 @@ ) ) - -(defenum attack-mask - :bitfield #t - :type uint32 - (trans) - (vector) - (intersection) - (attacker) - (invinc-time) - (mode) - (shove-back) - (shove-up) - (speed) - (dist) - (control) - (angle) - (rotate-to) - (atki13) - ) - ;; The attack-info is generated by attackers and sent to target. (deftype attack-info (structure) ((trans vector :inline :offset-assert 0) diff --git a/goal_src/jak1/engine/game/game-info-h.gc b/goal_src/jak1/engine/game/game-info-h.gc index 22188623f6..d463ae0d16 100644 --- a/goal_src/jak1/engine/game/game-info-h.gc +++ b/goal_src/jak1/engine/game/game-info-h.gc @@ -10,6 +10,8 @@ ;; - the "load state" ;; - checkpoints +;; DECOMP BEGINS + ;; Game parameters. (deftype game-bank (basic) ((life-max-default float :offset-assert 4) ;; yes this life system works, but does nothing diff --git a/goal_src/jak1/engine/game/game-info.gc b/goal_src/jak1/engine/game/game-info.gc index c2b15aacde..12cf9cb1c1 100644 --- a/goal_src/jak1/engine/game/game-info.gc +++ b/goal_src/jak1/engine/game/game-info.gc @@ -10,6 +10,7 @@ ;; The "perm" data is saved to the memory card. +;; DECOMP BEGINS ;;;;;;;;;;;;;;;;;; ;; border plane @@ -17,9 +18,9 @@ ;; This border-plane seems to be unused. This is separate from load boundaries. -(defmethod debug-draw! border-plane ((obj border-plane)) +(defmethod debug-draw! border-plane ((this border-plane)) "Debug draw a border plane with a vector and text." - (let* ((v1-0 (-> obj action)) + (let* ((v1-0 (-> this action)) ;; pick color based on action (s5-0 (if (= v1-0 'load) (new 'static 'rgba :g #xff :a #x80) @@ -29,22 +30,22 @@ ) ;; add text and vector - (add-debug-text-sphere #t (bucket-id debug-no-zbuf) (-> obj trans) 819.2 (symbol->string (-> obj name)) s5-0) - (add-debug-vector #t (bucket-id debug-no-zbuf) (-> obj trans) (-> obj normal) (meters 2) s5-0) + (add-debug-text-sphere #t (bucket-id debug-no-zbuf) (-> this trans) 819.2 (symbol->string (-> this name)) s5-0) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> this trans) (-> this normal) (meters 2) s5-0) ) 0 (none) ) -(defmethod point-past-plane? border-plane ((obj border-plane) (arg0 vector)) +(defmethod point-past-plane? border-plane ((this border-plane) (arg0 vector)) "Which side of the plane is the given point on? #t = on the plane, or on the side the normal points toward." - (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) (-> obj normal)) 0.0) + (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) (-> this normal)) 0.0) ) -(defmethod task-complete? game-info ((obj game-info) (arg0 game-task)) +(defmethod task-complete? game-info ((this game-info) (arg0 game-task)) "Likely closed, or in the process of closing" - (logtest? (-> obj task-perm-list data arg0 status) (entity-perm-status real-complete)) + (logtest? (-> this task-perm-list data arg0 status) (entity-perm-status real-complete)) ) ;; set up a static continue point that can be used as a temporary continue point. @@ -63,13 +64,13 @@ ) ) -(defmethod get-or-create-continue! game-info ((obj game-info)) +(defmethod get-or-create-continue! game-info ((this game-info)) "Attempt to get a continue point, if it doesn't exist set the default-continue to a location in front of the camera." (cond - ((and (= (-> obj mode) 'play) (-> obj current-continue)) + ((and (= (-> this mode) 'play) (-> this current-continue)) ;; we have a continue. - (-> obj current-continue) + (-> this current-continue) ) (else ;; need to make one @@ -87,7 +88,7 @@ ) ) -(defmethod get-continue-by-name game-info ((obj game-info) (arg0 string)) +(defmethod get-continue-by-name game-info ((this game-info) (arg0 string)) "Look up a continue point by string name" (let ((s5-0 *level-load-list*)) ;; loop over levels @@ -110,7 +111,7 @@ (the-as continue-point #f) ) -(defmethod set-continue! game-info ((obj game-info) (arg0 basic)) +(defmethod set-continue! game-info ((this game-info) (arg0 basic)) "Set the current continue point to to arg0. arg0 can be: '() or #f, in which case it does nothing. @@ -122,20 +123,20 @@ If the continue is changed, resets the death and time counters " - (let ((s5-0 (-> obj current-continue))) + (let ((s5-0 (-> this current-continue))) (if (null? arg0) (set! arg0 #f) ) (case (-> arg0 type) ((string) - (let ((v1-5 (get-continue-by-name obj (the-as string arg0)))) + (let ((v1-5 (get-continue-by-name this (the-as string arg0)))) (if v1-5 - (set! (-> obj current-continue) v1-5) + (set! (-> this current-continue) v1-5) ) ) ) ((continue-point) - (set! (-> obj current-continue) (the-as continue-point arg0)) + (set! (-> this current-continue) (the-as continue-point arg0)) ) (else (let ((s4-3 *default-continue*)) @@ -146,24 +147,24 @@ (set! (-> s4-3 disp0) (-> *load-state* want 0 display?)) (set! (-> s4-3 lev1) (-> *load-state* want 1 name)) (set! (-> s4-3 disp1) (-> *load-state* want 1 display?)) - (set! (-> obj current-continue) s4-3) + (set! (-> this current-continue) s4-3) ) ) ) - (when (!= s5-0 (-> obj current-continue)) - (set! (-> obj continue-deaths) 0) - (set! (-> obj continue-time) (-> *display* base-frame-counter)) + (when (!= s5-0 (-> this current-continue)) + (set! (-> this continue-deaths) 0) + (set-time! (-> this continue-time)) ) ) - (-> obj current-continue) + (-> this current-continue) ) -(defmethod get-entity-task-perm game-info ((obj game-info) (arg0 game-task)) +(defmethod get-entity-task-perm game-info ((this game-info) (arg0 game-task)) "Get the permanent storage for a game-task" - (-> obj task-perm-list data arg0) + (-> this task-perm-list data arg0) ) -(defmethod initialize! game-info ((obj game-info) (cause symbol) (save-to-load game-save) (continue-point-override string)) +(defmethod initialize! game-info ((this game-info) (cause symbol) (save-to-load game-save) (continue-point-override string)) "Initialize the game-info. The cause can be 'dead if you die, or 'game to reset everything. If save-to-load is not #f will load data from that. @@ -173,34 +174,34 @@ (case cause (('dead) ;; reload game-info because we died. Increase death counts - (+! (-> obj total-deaths) 1) - (+! (-> obj continue-deaths) 1) - (+! (-> obj fuel-cell-deaths) 1) + (+! (-> this total-deaths) 1) + (+! (-> this continue-deaths) 1) + (+! (-> this fuel-cell-deaths) 1) (when *target* (let ((lev-info (-> *target* current-level info))) (set! v0-0 (when (>= (-> *level-task-data-remap* length) (-> lev-info index)) ;; update death per level. (set! v0-0 - (seekl (the-as int (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1)))) 255 1) + (seekl (the-as int (-> this deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1)))) 255 1) ) - (set! (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1))) (the-as uint v0-0)) + (set! (-> this deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1))) (the-as uint v0-0)) v0-0 ) ) ) ) - (case (-> obj mode) + (case (-> this mode) (('play) ;; now pick between life/try depending on if we ran out of lives or not. (this isnt really used) - (if (< 0.0 (-> obj life)) + (if (< 0.0 (-> this life)) (set! cause 'life) (set! cause 'try) ) ) (else ;; not in play mode, we're done. - (set! obj obj) + (set! this this) (goto cfg-50) ) ) @@ -212,7 +213,7 @@ ;; we are doing a full restart. ;; reset everything! (reset-all-hint-controls) - (set-continue! obj (cond + (set-continue! this (cond (continue-point-override (empty) continue-point-override @@ -228,34 +229,34 @@ ) ) ) - (set! (-> obj auto-save-count) 0) + (set! (-> this auto-save-count) 0) (set! (-> *setting-control* default auto-save) #f) - (set! (-> obj money) 0.0) - (set! (-> obj fuel) 0.0) - (set! (-> obj money-total) 0.0) - (set! (-> obj buzzer-total) 0.0) - (set! (-> obj perm-list length) 0) - (clear-all! (-> obj text-ids-seen)) - (set! (-> obj death-movie-tick) (rand-vu-int-count 10)) - (set! (-> obj total-deaths) 0) - (set! (-> obj continue-deaths) 0) - (set! (-> obj fuel-cell-deaths) 0) - (set! (-> obj death-pos length) 0) - (set! (-> obj game-start-time) (-> *display* base-frame-counter)) - (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) - (set! (-> obj continue-time) (-> *display* base-frame-counter)) - (set! (-> obj death-time) (-> *display* base-frame-counter)) - (set! (-> obj hit-time) (-> *display* base-frame-counter)) + (set! (-> this money) 0.0) + (set! (-> this fuel) 0.0) + (set! (-> this money-total) 0.0) + (set! (-> this buzzer-total) 0.0) + (set! (-> this perm-list length) 0) + (clear-all! (-> this text-ids-seen)) + (set! (-> this death-movie-tick) (rand-vu-int-count 10)) + (set! (-> this total-deaths) 0) + (set! (-> this continue-deaths) 0) + (set! (-> this fuel-cell-deaths) 0) + (set! (-> this death-pos length) 0) + (set-time! (-> this game-start-time)) + (set-time! (-> this fuel-cell-pickup-time)) + (set-time! (-> this continue-time)) + (set-time! (-> this death-time)) + (set-time! (-> this hit-time)) (dotimes (v1-50 116) - (set! (-> obj fuel-cell-time 0) 0) + (set! (-> this fuel-cell-time 0) 0) (nop!) ) (dotimes (v1-53 32) - (set! (-> obj money-per-level v1-53) (the-as uint 0)) - (set! (-> obj deaths-per-level v1-53) (the-as uint 0)) - (set! (-> obj enter-level-time v1-53) 0) - (set! (-> obj in-level-time v1-53) 0) - (set! (-> obj level-opened v1-53) (the-as uint 0)) + (set! (-> this money-per-level v1-53) (the-as uint 0)) + (set! (-> this deaths-per-level v1-53) (the-as uint 0)) + (set! (-> this enter-level-time v1-53) 0) + (set! (-> this in-level-time v1-53) 0) + (set! (-> this level-opened v1-53) (the-as uint 0)) (nop!) ) ) @@ -263,24 +264,24 @@ (case cause (('game 'try) ;; full restart, or ran out of lives - (case (-> obj mode) + (case (-> this mode) (('play) (set! *display-profile* #f) (set! *display-entity-errors* #f) ) ) - (set! (-> obj life-max) (-> *GAME-bank* life-max-default)) - (set! (-> obj life) (-> *GAME-bank* life-start-default)) + (set! (-> this life-max) (-> *GAME-bank* life-max-default)) + (set! (-> this life) (-> *GAME-bank* life-start-default)) ) ) - (let ((v1-65 (-> obj mode))) + (let ((v1-65 (-> this mode))) (cond ((= v1-65 'debug) ;; in debug, we didn't kill things so we don't need to restart them (reset-actors cause) (if save-to-load - (load-game! obj save-to-load) + (load-game! this save-to-load) ) ) ((= v1-65 'play) @@ -315,7 +316,7 @@ (start arg0 arg2) (none) ) - (-> obj mode) cause (get-or-create-continue! obj) save-to-load + (-> this mode) cause (get-or-create-continue! this) save-to-load :from *4k-dead-pool* ) (set-master-mode 'game) @@ -323,23 +324,23 @@ ) ) (label cfg-50) - obj + this ) -(defmethod adjust game-info ((obj game-info) (item symbol) (amount float) (source handle)) +(defmethod adjust game-info ((this game-info) (item symbol) (amount float) (source handle)) "Adjust the number of items by amount." (case item (('life) ;; get/lose a life, just modify the life field (if (>= amount 0.0) - (seek! (-> obj life) (-> obj life-max) amount) - (seek! (-> obj life) 0.0 (- amount)) + (seek! (-> this life) (-> this life-max) amount) + (seek! (-> this life) 0.0 (- amount)) ) - (-> obj life) + (-> this life) ) (('money) - (if (and (< 0.0 amount) (= (+ (-> obj money) amount) (-> *GAME-bank* money-task-inc))) + (if (and (< 0.0 amount) (= (+ (-> this money) amount) (-> *GAME-bank* money-task-inc))) ;; got enough orbs to trade, display a hint (level-hint-spawn (text-id sidekick-reminder-money) @@ -359,11 +360,11 @@ ;; get the level index (let ((level-idx (-> *level-task-data-remap* (+ (-> proc entity extra level info index) -1)))) ;; increment the level money count - (+! (-> obj money-per-level level-idx) (the int amount)) + (+! (-> this money-per-level level-idx) (the int amount)) ;; increment our total money in the game (out of the 2000 max orbs) - (+! (-> obj money-total) amount) + (+! (-> this money-total) amount) ;; if we have all the money in our level, display the all orbs graphic - (if (= (-> obj money-per-level level-idx) (-> (get-game-count level-idx) money-count)) + (if (= (-> this money-per-level level-idx) (-> (get-game-count level-idx) money-count)) (activate-orb-all level-idx) ) ) @@ -373,29 +374,29 @@ ) ;; increment our current money count - (+! (-> obj money) amount) + (+! (-> this money) amount) ) (('fuel-cell) ;; got a power cell! ;; in this case, the amount is actually the index of the power cell's task (let ((s5-1 (the int amount))) - (when (not (or (task-complete? obj (the-as game-task s5-1)) (>= (the-as uint 1) (the-as uint s5-1)))) + (when (not (or (task-complete? this (the-as game-task s5-1)) (>= (the-as uint 1) (the-as uint s5-1)))) ;; the cell corresponds to a valid and previously incomplete task. ;; update our stats - (set! (-> obj fuel-cell-deaths) 0) - (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) - (set! (-> obj fuel-cell-time s5-1) (-> *display* base-frame-counter)) + (set! (-> this fuel-cell-deaths) 0) + (set-time! (-> this fuel-cell-pickup-time)) + (set-time! (-> this fuel-cell-time s5-1)) ;; increment power cells! - (+! (-> obj fuel) 1.0) + (+! (-> this fuel) 1.0) ;; mark as completed - (logior! (-> obj task-perm-list data s5-1 status) (entity-perm-status real-complete)) + (logior! (-> this task-perm-list data s5-1 status) (entity-perm-status real-complete)) ;; unused. (get-task-control (the-as game-task s5-1)) ;; close the task! (close-specific-task! (the-as game-task s5-1) (task-status need-resolution)) ) ) - (-> obj fuel) + (-> this fuel) ) (('buzzer) ;; got a scout fly. In this case, the amount is actually two 16 bit numbers @@ -414,7 +415,7 @@ ;; increment total if we haven't collected it before (if (not (logtest? buzz-bits (ash 1 buzz-index))) - (+! (-> obj buzzer-total) 1.0) + (+! (-> this buzzer-total) 1.0) ) ;; set the updated bits @@ -438,13 +439,13 @@ ) ) -(defmethod got-buzzer? game-info ((obj game-info) (arg0 game-task) (arg1 int)) +(defmethod got-buzzer? game-info ((this game-info) (arg0 game-task) (arg1 int)) "Do we have the arg1-th buzzer for the given buzzer task?" ;; buzzers mis-use their reminder bits as a bitfield of which ones have been collected (logtest? (get-reminder (get-task-control arg0) 0) (ash 1 arg1)) ) -(defmethod buzzer-count game-info ((obj game-info) (arg0 game-task)) +(defmethod buzzer-count game-info ((this game-info) (arg0 game-task)) "How many buzzers do we have for this task?" (let ((v1-1 (get-reminder (get-task-control arg0) 0)) ;; buzzer bitmask (v0-2 0) ;; count @@ -458,55 +459,55 @@ ) ) -(defmethod seen-text? game-info ((obj game-info) (arg0 text-id)) +(defmethod seen-text? game-info ((this game-info) (arg0 text-id)) "Have we already displayed this text? This is used to display level names on only the first enter. It seems like hints could also display text on screen at one point in time." - (get-bit (-> obj text-ids-seen) (the-as int arg0)) + (get-bit (-> this text-ids-seen) (the-as int arg0)) ) -(defmethod mark-text-as-seen game-info ((obj game-info) (arg0 text-id)) +(defmethod mark-text-as-seen game-info ((this game-info) (arg0 text-id)) "Mark the game text as seen. This only works if the text id < 4096, and ignores otherwise" (if (and (< (the-as uint arg0) (the-as uint 4095)) (> (the-as uint arg0) 0)) - (set-bit (-> obj text-ids-seen) (the-as int arg0)) + (set-bit (-> this text-ids-seen) (the-as int arg0)) ) 0 (none) ) -(defmethod clear-text-seen! game-info ((obj game-info) (arg0 text-id)) +(defmethod clear-text-seen! game-info ((this game-info) (arg0 text-id)) "Mark text as unseen. MUST be a valid text id" - (clear-bit (-> obj text-ids-seen) (the-as int arg0)) + (clear-bit (-> this text-ids-seen) (the-as int arg0)) 0 (none) ) -(defmethod reset! fact-info-target ((obj fact-info-target) (arg0 symbol)) +(defmethod reset! fact-info-target ((this fact-info-target) (arg0 symbol)) "Reset the facts for a given thing" (when (or (not arg0) (= arg0 'eco)) - (set! (-> obj eco-timeout) 0) - (set! (-> obj eco-level) 0.0) - (set! (-> obj eco-pickup-time) (-> *display* game-frame-counter)) + (set! (-> this eco-timeout) 0) + (set! (-> this eco-level) 0.0) + (set! (-> this eco-pickup-time) (-> *display* game-frame-counter)) ) (when (or (not arg0) (= arg0 'health)) - (set! (-> obj health-max) (-> *FACT-bank* health-max-default)) - (set! (-> obj health) (-> obj health-max)) - (set! (-> obj health-pickup-time) (seconds -100)) + (set! (-> this health-max) (-> *FACT-bank* health-max-default)) + (set! (-> this health) (-> this health-max)) + (set! (-> this health-pickup-time) (seconds -100)) ) (when (or (not arg0) (= arg0 'buzzer)) - (set! (-> obj buzzer-max) (-> *FACT-bank* buzzer-max-default)) - (set! (-> obj buzzer) 0.0) + (set! (-> this buzzer-max) (-> *FACT-bank* buzzer-max-default)) + (set! (-> this buzzer) 0.0) ) (when (or (not arg0) (= arg0 'eco-pill)) - (set! (-> obj eco-pill-max) (-> *FACT-bank* eco-pill-max-default)) - (set! (-> obj eco-pill) 0.0) + (set! (-> this eco-pill-max) (-> *FACT-bank* eco-pill-max-default)) + (set! (-> this eco-pill) 0.0) ) (none) ) (declare-type vent process-drawable) -(defmethod pickup-collectable! fact-info-target ((obj fact-info-target) (kind pickup-type) (amount float) (source-handle handle)) +(defmethod pickup-collectable! fact-info-target ((this fact-info-target) (kind pickup-type) (amount float) (source-handle handle)) "Pickup a thing!" (case kind (((pickup-type eco-green)) @@ -517,8 +518,8 @@ (when (< 0.0 amount) ;; when we get a different source, OR we it's been more than 0.5 seconds since we last got eco ;; from this source. - (if (or (!= (handle->process source-handle) (handle->process (-> obj eco-source))) - (>= (- (-> *display* base-frame-counter) (-> obj eco-source-time)) (seconds 0.5)) + (if (or (!= (handle->process source-handle) (handle->process (-> this eco-source))) + (time-elapsed? (-> this eco-source-time) (seconds 0.5)) ) ;; play the sound! @@ -527,46 +528,46 @@ ;; remember the source. (when (handle->process source-handle) - (set! (-> obj eco-source) source-handle) - (set! (-> obj eco-source-time) (-> *display* base-frame-counter)) + (set! (-> this eco-source) source-handle) + (set-time! (-> this eco-source-time)) ) ) ;; if we are at max health (3), and collect additional an additional big green eco, ;; then max out the little green ecos. - (if (= (-> obj health) (-> obj health-max)) + (if (= (-> this health) (-> this health-max)) (pickup-collectable! - obj + this (pickup-type eco-pill) (-> *FACT-bank* eco-pill-max-default) - (process->handle (-> obj process)) + (process->handle (-> this process)) ) ) ;; remember when - (set! (-> obj health-pickup-time) (-> *display* base-frame-counter)) + (set-time! (-> this health-pickup-time)) ;; increase the health! - (seek! (-> obj health) (-> obj health-max) amount) + (seek! (-> this health) (-> this health-max) amount) ) (else ;; negative health. Subtract. - (seek! (-> obj health) 0.0 (- amount)) + (seek! (-> this health) 0.0 (- amount)) ;; not sure why we do this. But this will set the eco pill collection time. (if (>= amount -10.0) - (pickup-collectable! obj (pickup-type eco-pill) 0.0 source-handle) + (pickup-collectable! this (pickup-type eco-pill) 0.0 source-handle) ) ;; subtract lives. - (if (= (-> obj health) 0.0) - (adjust (-> (the-as target (-> obj process)) game) 'life (- (-> *GAME-bank* life-single-inc)) source-handle) + (if (= (-> this health) 0.0) + (adjust (-> (the-as target (-> this process)) game) 'life (- (-> *GAME-bank* life-single-inc)) source-handle) ) ) ) ;; some sort of hack for eco vents. (b! - (and (logtest? (-> (the-as collide-shape (-> obj process root)) root-prim prim-core action) + (and (logtest? (-> (the-as collide-shape (-> this process root)) root-prim prim-core action) (collide-action racer) ) (type-type? (-> (handle->process source-handle) type) vent) @@ -574,30 +575,30 @@ cfg-80 :delay (nop!) ) - (-> obj health) + (-> this health) ) (((pickup-type eco-pill)) ;; collect small green eco (when (>= amount 0.0) ;; update small eco count - (set! (-> obj eco-pill-pickup-time) (-> *display* base-frame-counter)) - (seek! (-> obj eco-pill) (-> obj eco-pill-max) amount) + (set-time! (-> this eco-pill-pickup-time)) + (seek! (-> this eco-pill) (-> this eco-pill-max) amount) ;; increment big health if needed - (when (and (>= (-> obj eco-pill) (-> *FACT-bank* eco-pill-max-default)) (< (-> obj health) (-> obj health-max))) + (when (and (>= (-> this eco-pill) (-> *FACT-bank* eco-pill-max-default)) (< (-> this health) (-> this health-max))) ;; decrease eco pills - (set! (-> obj eco-pill) (- (-> obj eco-pill) (-> *FACT-bank* eco-pill-max-default))) + (set! (-> this eco-pill) (- (-> this eco-pill) (-> *FACT-bank* eco-pill-max-default))) ;; get a big health. (pickup-collectable! - obj + this (pickup-type eco-green) (-> *FACT-bank* health-small-inc) - (process->handle (-> obj process)) + (process->handle (-> this process)) ) ) ) - (-> obj eco-pill) + (-> this eco-pill) ) (((pickup-type money)) @@ -608,42 +609,44 @@ (hide-speedrun-display) ) ;; play sound. - (if (>= (- (-> *display* base-frame-counter) (-> obj money-pickup-time)) (seconds 0.05)) + (if (time-elapsed? (-> this money-pickup-time) (seconds 0.05)) (sound-play "money-pickup") ) - (set! (-> obj money-pickup-time) (-> *display* base-frame-counter)) + (set-time! (-> this money-pickup-time)) ) - (adjust (-> (the-as target (-> obj process)) game) 'money amount source-handle) + (adjust (-> (the-as target (-> this process)) game) 'money amount source-handle) ) (((pickup-type fuel-cell)) ;; the amount is actually the index of the task. (let ((s4-2 (the int amount))) - (when (not (or (task-complete? (-> (the-as target (-> obj process)) game) (the-as game-task s4-2)) + (when (not (or (task-complete? (-> (the-as target (-> this process)) game) (the-as game-task s4-2)) (>= (the-as uint 1) (the-as uint s4-2)) ) ) + ;; og:preserve-this (#when PC_PORT ;; make sure any speedrun display is hidden (hide-speedrun-display) ) - (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) + (set-time! (-> this fuel-cell-pickup-time)) ) ) - (adjust (-> (the-as target (-> obj process)) game) 'fuel-cell amount source-handle) + (adjust (-> (the-as target (-> this process)) game) 'fuel-cell amount source-handle) ) (((pickup-type buzzer)) ;; buzzer - (let ((buzz-count (adjust (-> (the-as target (-> obj process)) game) 'buzzer amount source-handle))) - (when (!= buzz-count (-> obj buzzer)) + (let ((buzz-count (adjust (-> (the-as target (-> this process)) game) 'buzzer amount source-handle))) + (when (!= buzz-count (-> this buzzer)) + ;; og:preserve-this (#when PC_PORT ;; make sure any speedrun display is hidden (hide-speedrun-display) ) - (set! (-> obj buzzer-pickup-time) (-> *display* base-frame-counter)) + (set-time! (-> this buzzer-pickup-time)) ) - (set! (-> obj buzzer) buzz-count) + (set! (-> this buzzer) buzz-count) ) - (-> obj buzzer) + (-> this buzzer) ) (((pickup-type eco-red) (pickup-type eco-blue) (pickup-type eco-yellow)) ;; the green vent jumps here. @@ -651,55 +654,55 @@ ;; if the amount is zero, we just want to know how much eco there is. (if (= amount 0.0) - (return (if (= (-> obj eco-type) kind) - (-> obj eco-level) + (return (if (= (-> this eco-type) kind) + (-> this eco-level) 0.0 ;; we don't have this kind of eco. ) ) ) ;; new type of eco. Reset and use the new type. - (when (!= (-> obj eco-type) kind) + (when (!= (-> this eco-type) kind) ;; as far as I can tell, the eco-level isn't really used other than just 1 or 0. - (set! (-> obj eco-level) 0.0) - (set! (-> obj eco-timeout) 0) + (set! (-> this eco-level) 0.0) + (set! (-> this eco-timeout) 0) ) - (set! (-> obj eco-type) kind) + (set! (-> this eco-type) kind) - (let ((eco-lev (-> obj eco-level))) - (set! (-> obj eco-level) 1.0) ;; just set to 1. + (let ((eco-lev (-> this eco-level))) + (set! (-> this eco-level) 1.0) ;; just set to 1. ;; this check now doesn't make much sense... - (when (and (= eco-lev 0.0) (< 0.0 (-> obj eco-level))) + (when (and (= eco-lev 0.0) (< 0.0 (-> this eco-level))) ;; didn't have eco and now we do, remember when - (set! (-> obj eco-pickup-time) (-> *display* game-frame-counter)) + (set-time! (-> this eco-pickup-time)) ;; send a reset-collide message. Not sure why we do this. - (send-event (-> obj process) 'reset-collide) + (send-event (-> this process) 'reset-collide) ) ;; this logic prevents eco from respawning before you are out. ;; the time until respawn is min(full_eco_time, old_time + single_timeout) - (set! (-> obj eco-timeout) + (set! (-> this eco-timeout) (the-as seconds - (min (the-as int (+ (-> obj eco-timeout) (* (the-as int (-> *FACT-bank* eco-single-timeout)) (the int amount)))) - (the-as int (+ (-> *FACT-bank* eco-full-timeout) (- (-> *display* game-frame-counter) (-> obj eco-pickup-time)))) + (min (the-as int (+ (-> this eco-timeout) (* (the-as int (-> *FACT-bank* eco-single-timeout)) (the int amount)))) + (the-as int (+ (-> *FACT-bank* eco-full-timeout) (- (-> *display* game-frame-counter) (-> this eco-pickup-time)))) ) ) ) ;; if you max out the eco, this should trigger - (if (>= (the-as int (- (-> obj eco-timeout) (the-as uint (- (-> *display* game-frame-counter) (-> obj eco-pickup-time))))) + (if (>= (the-as int (- (-> this eco-timeout) (the-as uint (- (-> *display* game-frame-counter) (-> this eco-pickup-time))))) (the-as int (-> *FACT-bank* eco-full-timeout)) ) - (set! (-> obj eco-level) 2.0) + (set! (-> this eco-level) 2.0) ) ;; sound and controller vibration. - (when (not (and (= (handle->process source-handle) (handle->process (-> obj eco-source))) - (< (- (-> *display* base-frame-counter) (-> obj eco-source-time)) (seconds 0.5)) + (when (not (and (= (handle->process source-handle) (handle->process (-> this eco-source))) + (not (time-elapsed? (-> this eco-source-time) (seconds 0.5))) ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.2)) @@ -720,13 +723,13 @@ ) ) - (set! (-> obj eco-source) source-handle) - (set! (-> obj eco-source-time) (-> *display* base-frame-counter)) + (set! (-> this eco-source) source-handle) + (set-time! (-> this eco-source-time)) ;; special case for blue eco magnet effect (when (= kind (pickup-type eco-blue)) (when (= eco-lev 0.0) - (let ((s5-1 (-> obj process))) + (let ((s5-1 (-> this process))) (let ((s4-3 (process-spawn touch-tracker @@ -756,8 +759,8 @@ (process-spawn-function process (lambda ((arg0 process-drawable)) - (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 0.6)) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 0.6)) (send-event arg0 'effect 'eco-blue) (suspend) ) @@ -772,16 +775,16 @@ ) ) ) - (-> obj eco-level) + (-> this eco-level) ) (else - ((method-of-type fact-info pickup-collectable!) obj kind amount source-handle) + ((method-of-type fact-info pickup-collectable!) this kind amount source-handle) ) ) ) -(defmethod lookup-entity-perm-by-aid game-info ((obj game-info) (aid actor-id)) - (let ((v1-0 (-> obj perm-list))) +(defmethod lookup-entity-perm-by-aid game-info ((this game-info) (aid actor-id)) + (let ((v1-0 (-> this perm-list))) (countdown (a0-1 (-> v1-0 length)) (if (= aid (-> v1-0 data a0-1 aid)) (return (-> v1-0 data a0-1)) @@ -791,9 +794,9 @@ (the-as entity-perm #f) ) -(defmethod copy-perms-from-level! game-info ((obj game-info) (lev level)) +(defmethod copy-perms-from-level! game-info ((this game-info) (lev level)) "Iterate through entities in the level and copy their perms into game-info" - (let ((perms (-> obj perm-list)) ;; our perms + (let ((perms (-> this perm-list)) ;; our perms (lev-entities (-> lev bsp level entity)) ;; entities in the level ) ;; loop over every entity in the level @@ -803,7 +806,7 @@ ;; only look at ones with an associated task (when (nonzero? (-> lev-entity-perm task)) ;; look up the perm in the game info - (let ((info-entity-perm (lookup-entity-perm-by-aid obj (-> lev-entity-perm aid)))) + (let ((info-entity-perm (lookup-entity-perm-by-aid this (-> lev-entity-perm aid)))) (cond (info-entity-perm ;; it exists, set it to the value from the level @@ -824,12 +827,12 @@ (none) ) -(defmethod copy-perms-to-level! game-info ((obj game-info) (lev level)) +(defmethod copy-perms-to-level! game-info ((this game-info) (lev level)) "Does the opposite of the previous, copies perms from game-info to level entities" (let ((lev-entities (-> lev bsp level entity))) (dotimes (lev-entity-idx (-> lev-entities length)) (let* ((lev-entity-perm (-> lev-entities data lev-entity-idx entity extra perm)) - (info-entity-perm (lookup-entity-perm-by-aid obj (-> lev-entity-perm aid))) + (info-entity-perm (lookup-entity-perm-by-aid this (-> lev-entity-perm aid))) ) (when info-entity-perm ;; found the level entity in game-info, copy @@ -848,28 +851,28 @@ (none) ) -(defmethod print continue-point ((obj continue-point)) - (format #t "#<~A ~S @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print continue-point ((this continue-point)) + (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) + this ) -(defmethod debug-draw! continue-point ((obj continue-point)) +(defmethod debug-draw! continue-point ((this continue-point)) "Draw a continue point." - (add-debug-x #t (bucket-id debug-no-zbuf) (-> obj trans) (new 'static 'rgba :r #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf) (-> this trans) (new 'static 'rgba :r #xff :a #x80)) (add-debug-text-3d #t (bucket-id debug-no-zbuf) - (-> obj name) - (-> obj trans) + (-> this name) + (-> this trans) (font-color white) (new 'static 'vector2h :y 8) ) - (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (-> obj quat)))) + (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (-> this quat)))) (add-debug-vector #t (bucket-id debug-no-zbuf) - (-> obj trans) + (-> this trans) a3-2 (meters 2) (new 'static 'rgba :r #xff :g #x80 :a #x80) @@ -926,25 +929,25 @@ (enum->string game-task arg0) ) -(defmethod debug-print game-info ((obj game-info) (arg0 symbol)) - (inspect obj) +(defmethod debug-print game-info ((this game-info) (arg0 symbol)) + (inspect this) (when (or (not arg0) (= arg0 'game-task)) (format #t "~Tgame-task:~%") (dotimes (s4-0 116) - (if (task-complete? obj (the-as game-task s4-0)) + (if (task-complete? this (the-as game-task s4-0)) (format #t "~T~T~S~%" (game-task->string (the-as game-task s4-0))) ) ) ) (when (or (not arg0) (= arg0 'entity-perm)) (format #t "~Tentity-perm:~%") - (let ((s5-1 (-> obj perm-list))) + (let ((s5-1 (-> this perm-list))) (dotimes (s4-1 (-> s5-1 length)) (format #t "~T~T~`entity-perm`P~%" (-> s5-1 data s4-1)) ) ) ) - obj + this ) ;; allocate storage for game info @@ -995,14 +998,14 @@ (set! (-> gp-0 other-camera-handle) (the-as handle #f)) ) -(defmethod get-death-count game-info ((obj game-info) (arg0 symbol)) +(defmethod get-death-count game-info ((this game-info) (arg0 symbol)) (let ((v1-13 (if (and arg0 *target* (>= (-> *level-task-data-remap* length) (-> *target* current-level info index))) (the-as int - (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> *target* current-level info index) -1))) + (-> this deaths-per-level (-> *level-task-data-remap* (+ (-> *target* current-level info index) -1))) ) - (-> obj fuel-cell-deaths) + (-> this fuel-cell-deaths) ) ) ) @@ -1011,10 +1014,6 @@ ) ) -(defmethod get-health-percent-lost game-info ((obj game-info) (arg0 symbol)) - (* 0.25 (the float (get-death-count obj #f))) +(defmethod get-health-percent-lost game-info ((this game-info) (arg0 symbol)) + (* 0.25 (the float (get-death-count this #f))) ) - - - - diff --git a/goal_src/jak1/engine/game/game-save.gc b/goal_src/jak1/engine/game/game-save.gc index 3e8e4d43cd..22355db0f7 100644 --- a/goal_src/jak1/engine/game/game-save.gc +++ b/goal_src/jak1/engine/game/game-save.gc @@ -14,6 +14,8 @@ ;; Having two state machines, one in C++ and one in GOAL is kind of a questionable and confusing design. +;; DECOMP BEGINS + ;; version identifier (defconstant SAVE_VERSION 1) @@ -158,9 +160,9 @@ ) ) -(defmethod asize-of game-save ((obj game-save)) +(defmethod asize-of game-save ((this game-save)) "Get the size in memory of the save" - (the-as int (+ (-> game-save size) (the-as uint (-> obj allocated-length)))) + (the-as int (+ (-> game-save size) (the-as uint (-> this allocated-length)))) ) (defmethod new game-save ((allocation symbol) (type-to-make type) (arg0 int)) @@ -185,31 +187,31 @@ ) ) -(defmethod debug-print game-save ((obj game-save) (detail symbol)) +(defmethod debug-print game-save ((this game-save) (detail symbol)) "Print a save to #t" - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tversion: ~D~%" (-> obj version)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~Tfuel-cell-count: ~f~%" (-> obj fuel-cell-count)) - (format #t "~Tmoney-count: ~f~%" (-> obj money-count)) - (format #t "~Tbuzzer-count: ~f~%" (-> obj buzzer-count)) - (format #t "~Tcompletion-percentage: ~f~%" (-> obj completion-percentage)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tversion: ~D~%" (-> this version)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~Tfuel-cell-count: ~f~%" (-> this fuel-cell-count)) + (format #t "~Tmoney-count: ~f~%" (-> this money-count)) + (format #t "~Tbuzzer-count: ~f~%" (-> this buzzer-count)) + (format #t "~Tcompletion-percentage: ~f~%" (-> this completion-percentage)) (format #t "~Tsave-time: ~x:~x ~x/~x/~x~%" - (-> obj hour) - (-> obj minute) - (-> obj day) - (-> obj month) - (-> obj year) + (-> this hour) + (-> this minute) + (-> this day) + (-> this month) + (-> this year) ) - (format #t "~Ttag[]: @ #x~X~%" (-> obj tag)) + (format #t "~Ttag[]: @ #x~X~%" (-> this tag)) ;; loop through tags - (let ((tag (the-as game-save-tag (-> obj tag))) + (let ((tag (the-as game-save-tag (-> this tag))) (tag-idx 0) ) - (while (< (the-as int tag) (the-as int (&-> obj tag 0 user-int8 (-> obj length)))) + (while (< (the-as int tag) (the-as int (&-> this tag 0 user-int8 (-> this length)))) (let ((a3-2 (game-save-elt->string (-> tag elt-type))) (t0-1 (-> tag elt-count)) (t1-1 (-> tag elt-size)) @@ -333,21 +335,21 @@ (+! tag-idx 1) ) ) - obj + this ) -(defmethod inspect game-save ((obj game-save)) - (debug-print obj #f) +(defmethod inspect game-save ((this game-save)) + (debug-print this #f) ) -(defmethod save-game! game-info ((obj game-info) (arg0 game-save) (arg1 string)) +(defmethod save-game! game-info ((this game-info) (arg0 game-save) (arg1 string)) "Update the game-save to have the info from the current game state" ;; some stuff lives in the levels and needs to be copied into game-info. (dotimes (s3-0 (-> *level* length)) (let ((a1-1 (-> *level* level s3-0))) (if (= (-> a1-1 status) 'active) - (copy-perms-from-level! obj a1-1) + (copy-perms-from-level! this a1-1) ) ) ) @@ -355,12 +357,12 @@ ;; set common data (set! (-> arg0 length) 0) (set! (-> arg0 version) 1) - (set! (-> arg0 level-index) (-> (lookup-level-info (-> obj current-continue level)) index)) - (set! (-> arg0 fuel-cell-count) (-> obj fuel)) - (set! (-> arg0 money-count) (-> obj money-total)) - (set! (-> arg0 buzzer-count) (-> obj buzzer-total)) + (set! (-> arg0 level-index) (-> (lookup-level-info (-> this current-continue level)) index)) + (set! (-> arg0 fuel-cell-count) (-> this fuel)) + (set! (-> arg0 money-count) (-> this money-total)) + (set! (-> arg0 buzzer-count) (-> this buzzer-total)) (set! (-> arg0 completion-percentage) (calculate-completion (the-as progress #f))) - (when (string= (-> obj current-continue name) "title-start") + (when (string= (-> this current-continue name) "title-start") (set! (-> arg0 new-game) 1) (set! (-> arg0 level-index) (-> (lookup-level-info 'training) index)) (set! (-> arg0 fuel-cell-count) 0.0) @@ -395,7 +397,7 @@ (let ((a0-15 (the-as game-save-tag (&+ v1-37 0)))) (set! (-> a0-15 elt-type) (game-save-elt base-time)) (set! (-> a0-15 elt-count) 0) - (set! (-> a0-15 user-uint64) (the-as uint (-> *display* base-frame-counter))) + (set! (-> a0-15 user-uint64) (the-as uint (current-time))) ) (let ((v1-38 (&+ v1-37 16))) (let ((a0-16 (the-as game-save-tag (&+ v1-38 0)))) @@ -416,7 +418,7 @@ (set! (-> a0-18 user-uint64) (the-as uint (-> *display* integral-frame-counter))) ) (let ((s4-1 (the-as object (&+ v1-40 16)))) - (let ((s3-3 (-> obj current-continue name))) + (let ((s3-3 (-> this current-continue name))) (let ((s2-1 (the-as game-save-tag (-> (the-as game-save-tag s4-1) user-object)))) (set! (-> s2-1 elt-type) (game-save-elt continue)) (set! (-> s2-1 elt-count) (+ ((method-of-type string length) s3-3) 1)) @@ -431,37 +433,37 @@ (let ((a0-24 (the-as game-save-tag (&+ v1-50 0)))) (set! (-> a0-24 elt-type) (game-save-elt life)) (set! (-> a0-24 elt-count) 0) - (set! (-> a0-24 user-float0) (-> obj life)) + (set! (-> a0-24 user-float0) (-> this life)) ) (let ((v1-51 (&+ v1-50 16))) (let ((a0-25 (the-as game-save-tag (&+ v1-51 0)))) (set! (-> a0-25 elt-type) (game-save-elt buzzer-total)) (set! (-> a0-25 elt-count) 0) - (set! (-> a0-25 user-float0) (-> obj buzzer-total)) + (set! (-> a0-25 user-float0) (-> this buzzer-total)) ) (let ((v1-52 (&+ v1-51 16))) (let ((a0-26 (the-as game-save-tag (&+ v1-52 0)))) (set! (-> a0-26 elt-type) (game-save-elt fuel-cell)) (set! (-> a0-26 elt-count) 0) - (set! (-> a0-26 user-float0) (-> obj fuel)) + (set! (-> a0-26 user-float0) (-> this fuel)) ) (let ((v1-53 (&+ v1-52 16))) (let ((a0-27 (the-as game-save-tag (&+ v1-53 0)))) (set! (-> a0-27 elt-type) (game-save-elt death-movie-tick)) (set! (-> a0-27 elt-count) 0) - (set! (-> a0-27 user-uint64) (the-as uint (-> obj death-movie-tick))) + (set! (-> a0-27 user-uint64) (the-as uint (-> this death-movie-tick))) ) (let ((v1-54 (&+ v1-53 16))) (let ((a0-28 (the-as game-save-tag (&+ v1-54 0)))) (set! (-> a0-28 elt-type) (game-save-elt money)) (set! (-> a0-28 elt-count) 0) - (set! (-> a0-28 user-float0) (-> obj money)) + (set! (-> a0-28 user-float0) (-> this money)) ) (let ((v1-55 (&+ v1-54 16))) (let ((a0-29 (the-as game-save-tag (&+ v1-55 0)))) (set! (-> a0-29 elt-type) (game-save-elt money-total)) (set! (-> a0-29 elt-count) 0) - (set! (-> a0-29 user-float0) (-> obj money-total)) + (set! (-> a0-29 user-float0) (-> this money-total)) ) (let ((v1-56 (&+ v1-55 16))) (let ((a0-30 (the-as game-save-tag (&+ v1-56 0)))) @@ -471,7 +473,7 @@ ) (let ((v1-57 (&+ v1-56 16))) (dotimes (a0-31 32) - (set! (-> (the-as (pointer uint8) (&+ v1-57 a0-31))) (-> obj money-per-level a0-31)) + (set! (-> (the-as (pointer uint8) (&+ v1-57 a0-31))) (-> this money-per-level a0-31)) ) (let ((v1-58 (&+ v1-57 32))) (let ((a0-34 (the-as object (&+ v1-58 0)))) @@ -481,10 +483,10 @@ ) (let ((v1-59 (&+ v1-58 16))) (dotimes (a0-35 32) - (set! (-> (the-as (pointer uint8) (&+ v1-59 a0-35))) (-> obj level-opened a0-35)) + (set! (-> (the-as (pointer uint8) (&+ v1-59 a0-35))) (-> this level-opened a0-35)) ) (let ((v1-60 (&+ v1-59 32)) - (s4-2 (-> (the-as (pointer int32) (-> obj perm-list)) 0)) + (s4-2 (-> (the-as (pointer int32) (-> this perm-list)) 0)) ) (let ((a0-39 (the-as game-save-tag (&+ v1-60 0)))) (set! (-> a0-39 elt-type) (game-save-elt perm-list)) @@ -495,12 +497,12 @@ (dotimes (s2-2 s4-2) (mem-copy! (the-as pointer (the-as game-save-tag (&+ s3-4 (* s2-2 16)))) - (the-as pointer (-> obj perm-list data s2-2)) + (the-as pointer (-> this perm-list data s2-2)) 16 ) ) (let ((v1-68 (&+ s3-4 (logand -16 (+ (* s4-2 16) 15)))) - (s4-3 (-> obj task-perm-list length)) + (s4-3 (-> this task-perm-list length)) ) (let ((a0-45 (the-as game-save-tag (&+ v1-68 0)))) (set! (-> a0-45 elt-type) (game-save-elt task-list)) @@ -511,12 +513,12 @@ (dotimes (s2-3 s4-3) (mem-copy! (the-as pointer (the-as game-save-tag (&+ s3-5 (* s2-3 16)))) - (the-as pointer (-> obj task-perm-list data s2-3)) + (the-as pointer (-> this task-perm-list data s2-3)) 16 ) ) (let ((a0-49 (&+ s3-5 (logand -16 (+ (* s4-3 16) 15)))) - (v1-79 (/ (logand -8 (+ (-> obj text-ids-seen allocated-length) 7)) 8)) + (v1-79 (/ (logand -8 (+ (-> this text-ids-seen allocated-length) 7)) 8)) ) (let ((a1-46 (the-as object (&+ a0-49 0)))) (set! (-> (the-as game-save-tag a1-46) elt-type) (game-save-elt text-list)) @@ -525,10 +527,10 @@ ) (let ((a0-50 (&+ a0-49 16))) (dotimes (a1-47 v1-79) - (set! (-> (the-as (pointer uint8) (&+ a0-50 a1-47))) (-> obj text-ids-seen bytes a1-47)) + (set! (-> (the-as (pointer uint8) (&+ a0-50 a1-47))) (-> this text-ids-seen bytes a1-47)) ) (let ((a0-51 (&+ a0-50 (logand -16 (+ v1-79 15)))) - (v1-84 (-> obj hint-control length)) + (v1-84 (-> this hint-control length)) ) (let ((a1-51 (the-as game-save-tag (&+ a0-51 0)))) (set! (-> a1-51 elt-type) (game-save-elt hint-list)) @@ -537,66 +539,66 @@ ) (let ((a0-52 (&+ a0-51 16))) (dotimes (a1-52 v1-84) - (set! (-> (the-as (pointer int64) (&+ a0-52 (* (* a1-52 4) 8)))) (-> obj hint-control a1-52 start-time)) + (set! (-> (the-as (pointer int64) (&+ a0-52 (* (* a1-52 4) 8)))) (-> this hint-control a1-52 start-time)) (set! (-> (the-as (pointer int64) (&+ a0-52 (* (+ (* a1-52 4) 1) 8)))) - (-> obj hint-control a1-52 last-time-called) + (-> this hint-control a1-52 last-time-called) ) - (set! (-> (the-as (pointer int8) (&+ a0-52 (+ (* a1-52 32) 16)))) (-> obj hint-control a1-52 num-attempts)) - (set! (-> (the-as (pointer int8) (&+ a0-52 (+ (* a1-52 32) 17)))) (-> obj hint-control a1-52 num-success)) + (set! (-> (the-as (pointer int8) (&+ a0-52 (+ (* a1-52 32) 16)))) (-> this hint-control a1-52 num-attempts)) + (set! (-> (the-as (pointer int8) (&+ a0-52 (+ (* a1-52 32) 17)))) (-> this hint-control a1-52 num-success)) ) (let ((v1-86 (&+ a0-52 (* v1-84 32)))) (let ((a0-54 (the-as game-save-tag (&+ v1-86 0)))) (set! (-> a0-54 elt-type) (game-save-elt auto-save-count)) (set! (-> a0-54 elt-count) 0) - (set! (-> a0-54 user-uint64) (the-as uint (-> obj auto-save-count))) + (set! (-> a0-54 user-uint64) (the-as uint (-> this auto-save-count))) ) (let ((v1-87 (&+ v1-86 16))) (let ((a0-55 (the-as game-save-tag (&+ v1-87 0)))) (set! (-> a0-55 elt-type) (game-save-elt total-deaths)) (set! (-> a0-55 elt-count) 0) - (set! (-> a0-55 user-uint64) (the-as uint (-> obj total-deaths))) + (set! (-> a0-55 user-uint64) (the-as uint (-> this total-deaths))) ) (let ((v1-88 (&+ v1-87 16))) (let ((a0-56 (the-as game-save-tag (&+ v1-88 0)))) (set! (-> a0-56 elt-type) (game-save-elt continue-deaths)) (set! (-> a0-56 elt-count) 0) - (set! (-> a0-56 user-uint64) (the-as uint (-> obj continue-deaths))) + (set! (-> a0-56 user-uint64) (the-as uint (-> this continue-deaths))) ) (let ((v1-89 (&+ v1-88 16))) (let ((a0-57 (the-as game-save-tag (&+ v1-89 0)))) (set! (-> a0-57 elt-type) (game-save-elt fuel-cell-deaths)) (set! (-> a0-57 elt-count) 0) - (set! (-> a0-57 user-uint64) (the-as uint (-> obj fuel-cell-deaths))) + (set! (-> a0-57 user-uint64) (the-as uint (-> this fuel-cell-deaths))) ) (let ((v1-90 (&+ v1-89 16))) (let ((a0-58 (the-as game-save-tag (&+ v1-90 0)))) (set! (-> a0-58 elt-type) (game-save-elt game-start-time)) (set! (-> a0-58 elt-count) 0) - (set! (-> a0-58 user-uint64) (the-as uint (-> obj game-start-time))) + (set! (-> a0-58 user-uint64) (the-as uint (-> this game-start-time))) ) (let ((v1-91 (&+ v1-90 16))) (let ((a0-59 (the-as game-save-tag (&+ v1-91 0)))) (set! (-> a0-59 elt-type) (game-save-elt continue-time)) (set! (-> a0-59 elt-count) 0) - (set! (-> a0-59 user-uint64) (the-as uint (-> obj continue-time))) + (set! (-> a0-59 user-uint64) (the-as uint (-> this continue-time))) ) (let ((v1-92 (&+ v1-91 16))) (let ((a0-60 (the-as game-save-tag (&+ v1-92 0)))) (set! (-> a0-60 elt-type) (game-save-elt death-time)) (set! (-> a0-60 elt-count) 0) - (set! (-> a0-60 user-uint64) (the-as uint (-> obj death-time))) + (set! (-> a0-60 user-uint64) (the-as uint (-> this death-time))) ) (let ((v1-93 (&+ v1-92 16))) (let ((a0-61 (the-as game-save-tag (&+ v1-93 0)))) (set! (-> a0-61 elt-type) (game-save-elt hit-time)) (set! (-> a0-61 elt-count) 0) - (set! (-> a0-61 user-uint64) (the-as uint (-> obj hit-time))) + (set! (-> a0-61 user-uint64) (the-as uint (-> this hit-time))) ) (let ((v1-94 (&+ v1-93 16))) (let ((a0-62 (the-as game-save-tag (&+ v1-94 0)))) (set! (-> a0-62 elt-type) (game-save-elt fuel-cell-pickup-time)) (set! (-> a0-62 elt-count) 0) - (set! (-> a0-62 user-uint64) (the-as uint (-> obj fuel-cell-pickup-time))) + (set! (-> a0-62 user-uint64) (the-as uint (-> this fuel-cell-pickup-time))) ) (let ((v1-95 (&+ v1-94 16))) (let ((a0-63 (the-as game-save-tag (&+ v1-95 0)))) @@ -608,7 +610,7 @@ (let ((a0-64 (the-as object 0))) (while (< (the-as int a0-64) 116) (set! (-> (the-as (pointer int64) (&+ v1-96 (* (the-as int a0-64) 8)))) - (-> obj fuel-cell-time (the-as int a0-64)) + (-> this fuel-cell-time (the-as int a0-64)) ) (set! a0-64 (+ (the-as int a0-64) 1)) ) @@ -621,7 +623,7 @@ ) (let ((v1-98 (&+ v1-97 16))) (dotimes (a0-68 32) - (set! (-> (the-as (pointer uint8) (&+ v1-98 a0-68))) (-> obj deaths-per-level a0-68)) + (set! (-> (the-as (pointer uint8) (&+ v1-98 a0-68))) (-> this deaths-per-level a0-68)) ) (let ((v1-99 (&+ v1-98 32))) (let ((a0-71 (the-as game-save-tag (&+ v1-99 0)))) @@ -631,7 +633,7 @@ ) (let ((v1-100 (&+ v1-99 16))) (dotimes (a0-72 32) - (set! (-> (the-as (pointer int64) (&+ v1-100 (* a0-72 8)))) (-> obj enter-level-time a0-72)) + (set! (-> (the-as (pointer int64) (&+ v1-100 (* a0-72 8)))) (-> this enter-level-time a0-72)) ) (let ((v1-101 (&+ v1-100 256))) (let ((a0-75 (the-as game-save-tag (&+ v1-101 0)))) @@ -641,7 +643,7 @@ ) (let ((v1-102 (&+ v1-101 16))) (dotimes (a0-76 32) - (set! (-> (the-as (pointer int64) (&+ v1-102 (* a0-76 8)))) (-> obj in-level-time a0-76)) + (set! (-> (the-as (pointer int64) (&+ v1-102 (* a0-76 8)))) (-> this in-level-time a0-76)) ) (let ((v1-103 (&+ v1-102 256))) (let ((a0-79 (the-as game-save-tag (&+ v1-103 0)))) @@ -803,7 +805,7 @@ (none) ) -(defmethod load-game! game-info ((obj game-info) (save game-save)) +(defmethod load-game! game-info ((this game-info) (save game-save)) "Copy save data from a game-save to a game-info" (let ((save-data (the-as game-save-tag (-> save tag)))) ;; loop over all tags @@ -841,7 +843,7 @@ ;; if we're a new game, set our checkpoint. (when (nonzero? (-> save new-game)) - (set-continue! obj "game-start") + (set-continue! this "game-start") (set! save save) (goto cfg-134) ) @@ -851,21 +853,21 @@ (while (< (the-as int data) (the-as int (&-> save tag 0 user-int8 (-> save length)))) (case (-> data elt-type) (((game-save-elt base-time)) - (let ((old-base-frame (-> *display* base-frame-counter))) - (set! (-> *display* base-frame-counter) (the-as time-frame (-> data user-uint64))) - (set! (-> *display* old-base-frame-counter) (+ (-> *display* base-frame-counter) -1)) - (let ((frame-counter-diff (- (-> *display* base-frame-counter) old-base-frame))) - (if (nonzero? (-> obj blackout-time)) - (+! (-> obj blackout-time) frame-counter-diff) + (let ((old-base-frame (current-time))) + (set! (current-time) (the-as time-frame (-> data user-uint64))) + (set! (-> *display* old-base-frame-counter) (+ (current-time) -1)) + (let ((frame-counter-diff (- (current-time) old-base-frame))) + (if (nonzero? (-> this blackout-time)) + (+! (-> this blackout-time) frame-counter-diff) ) - (if (nonzero? (-> obj letterbox-time)) - (+! (-> obj letterbox-time) frame-counter-diff) + (if (nonzero? (-> this letterbox-time)) + (+! (-> this letterbox-time) frame-counter-diff) ) - (if (nonzero? (-> obj hint-play-time)) - (+! (-> obj hint-play-time) frame-counter-diff) + (if (nonzero? (-> this hint-play-time)) + (+! (-> this hint-play-time) frame-counter-diff) ) - (if (nonzero? (-> obj display-text-time)) - (+! (-> obj display-text-time) frame-counter-diff) + (if (nonzero? (-> this display-text-time)) + (+! (-> this display-text-time) frame-counter-diff) ) ) ) @@ -885,54 +887,54 @@ ) (((game-save-elt continue)) (format (clear *temp-string*) "~G" (&+ (the-as pointer data) 16)) - (set-continue! obj *temp-string*) + (set-continue! this *temp-string*) ) (((game-save-elt life)) - (set! (-> obj life) (-> data user-float0)) + (set! (-> this life) (-> data user-float0)) ) (((game-save-elt buzzer-total)) - (set! (-> obj buzzer-total) (-> data user-float0)) + (set! (-> this buzzer-total) (-> data user-float0)) ) (((game-save-elt fuel-cell)) - (set! (-> obj fuel) (-> data user-float0)) + (set! (-> this fuel) (-> data user-float0)) ) (((game-save-elt death-movie-tick)) - (set! (-> obj death-movie-tick) (the-as int (-> data user-uint64))) + (set! (-> this death-movie-tick) (the-as int (-> data user-uint64))) ) (((game-save-elt money)) - (set! (-> obj money) (-> data user-float0)) + (set! (-> this money) (-> data user-float0)) ) (((game-save-elt money-total)) - (set! (-> obj money-total) (-> data user-float0)) + (set! (-> this money-total) (-> data user-float0)) ) (((game-save-elt money-per-level)) (let ((v1-34 (min 32 (-> data elt-count)))) (dotimes (a0-76 v1-34) - (set! (-> obj money-per-level a0-76) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-76)) + (set! (-> this money-per-level a0-76) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-76)) ) ) ) (((game-save-elt level-open-list)) (let ((v1-38 (min 32 (-> data elt-count)))) (dotimes (a0-80 v1-38) - (set! (-> obj level-opened a0-80) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-80)) + (set! (-> this level-opened a0-80) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-80)) ) ) ) (((game-save-elt perm-list)) - (let ((s3-2 (min (-> data elt-count) (-> obj perm-list allocated-length)))) - (set! (-> obj perm-list length) s3-2) + (let ((s3-2 (min (-> data elt-count) (-> this perm-list allocated-length)))) + (set! (-> this perm-list length) s3-2) (dotimes (s2-0 s3-2) - (mem-copy! (the-as pointer (-> obj perm-list data s2-0)) (&+ (&+ (the-as pointer data) 16) (* s2-0 16)) 16) + (mem-copy! (the-as pointer (-> this perm-list data s2-0)) (&+ (&+ (the-as pointer data) 16) (* s2-0 16)) 16) ) ) ) (((game-save-elt task-list)) - (let ((s3-4 (min (-> data elt-count) (-> obj task-perm-list allocated-length)))) - (set! (-> obj task-perm-list length) s3-4) + (let ((s3-4 (min (-> data elt-count) (-> this task-perm-list allocated-length)))) + (set! (-> this task-perm-list length) s3-4) (dotimes (s2-1 s3-4) (mem-copy! - (the-as pointer (-> obj task-perm-list data s2-1)) + (the-as pointer (-> this task-perm-list data s2-1)) (&+ (&+ (the-as pointer data) 16) (* s2-1 16)) 16 ) @@ -940,17 +942,17 @@ ) ) (((game-save-elt text-list)) - (let ((v1-61 (/ (logand -8 (+ (-> obj text-ids-seen allocated-length) 7)) 8)) + (let ((v1-61 (/ (logand -8 (+ (-> this text-ids-seen allocated-length) 7)) 8)) (a0-94 (-> data elt-count)) ) (dotimes (a1-35 v1-61) (cond ((>= a1-35 a0-94) - (set! (-> obj text-ids-seen bytes a1-35) (the-as uint 0)) + (set! (-> this text-ids-seen bytes a1-35) (the-as uint 0)) 0 ) (else - (set! (-> obj text-ids-seen bytes a1-35) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a1-35)) + (set! (-> this text-ids-seen bytes a1-35) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a1-35)) ) ) ) @@ -958,19 +960,19 @@ ) (((game-save-elt hint-list)) (cond - ((= (-> obj hint-control length) (-> data elt-count)) + ((= (-> this hint-control length) (-> data elt-count)) (let ((v1-65 (&+ (the-as pointer data) 16))) (dotimes (a0-99 (-> data elt-count)) - (set! (-> obj hint-control a0-99 start-time) + (set! (-> this hint-control a0-99 start-time) (the-as time-frame (-> (the-as (pointer uint64) (&+ v1-65 (* (* a0-99 4) 8))))) ) - (set! (-> obj hint-control a0-99 last-time-called) + (set! (-> this hint-control a0-99 last-time-called) (the-as time-frame (-> (the-as (pointer uint64) (&+ v1-65 (* (+ (* a0-99 4) 1) 8))))) ) - (set! (-> obj hint-control a0-99 num-attempts) + (set! (-> this hint-control a0-99 num-attempts) (-> (the-as (pointer int8) (&+ (the-as (pointer uint8) v1-65) (+ (* a0-99 32) 16)))) ) - (set! (-> obj hint-control a0-99 num-success) + (set! (-> this hint-control a0-99 num-success) (-> (the-as (pointer int8) (&+ (the-as (pointer uint8) v1-65) (+ (* a0-99 32) 17)))) ) ) @@ -982,43 +984,43 @@ ) ) (((game-save-elt auto-save-count)) - (set! (-> obj auto-save-count) (the-as int (-> data user-uint64))) + (set! (-> this auto-save-count) (the-as int (-> data user-uint64))) ) (((game-save-elt total-deaths)) - (set! (-> obj total-deaths) (the-as int (-> data user-uint64))) + (set! (-> this total-deaths) (the-as int (-> data user-uint64))) ) (((game-save-elt continue-deaths)) - (set! (-> obj continue-deaths) (the-as int (-> data user-uint64))) + (set! (-> this continue-deaths) (the-as int (-> data user-uint64))) ) (((game-save-elt fuel-cell-deaths)) - (set! (-> obj fuel-cell-deaths) (the-as int (-> data user-uint64))) + (set! (-> this fuel-cell-deaths) (the-as int (-> data user-uint64))) ) (((game-save-elt game-start-time)) - (set! (-> obj game-start-time) (the-as time-frame (-> data user-uint64))) + (set! (-> this game-start-time) (the-as time-frame (-> data user-uint64))) ) (((game-save-elt continue-time)) - (set! (-> obj continue-time) (the-as time-frame (-> data user-uint64))) + (set! (-> this continue-time) (the-as time-frame (-> data user-uint64))) ) (((game-save-elt death-time)) - (set! (-> obj death-time) (the-as time-frame (-> data user-uint64))) + (set! (-> this death-time) (the-as time-frame (-> data user-uint64))) ) (((game-save-elt hit-time)) - (set! (-> obj hit-time) (the-as time-frame (-> data user-uint64))) + (set! (-> this hit-time) (the-as time-frame (-> data user-uint64))) ) (((game-save-elt fuel-cell-pickup-time)) - (set! (-> obj fuel-cell-pickup-time) (the-as time-frame (-> data user-uint64))) + (set! (-> this fuel-cell-pickup-time) (the-as time-frame (-> data user-uint64))) ) (((game-save-elt deaths-per-level)) (let ((v1-79 (min 32 (-> data elt-count)))) (dotimes (a0-122 v1-79) - (set! (-> obj deaths-per-level a0-122) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-122)) + (set! (-> this deaths-per-level a0-122) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-122)) ) ) ) (((game-save-elt enter-level-time)) (let ((v1-83 (min 32 (-> data elt-count)))) (dotimes (a0-126 v1-83) - (set! (-> obj enter-level-time a0-126) + (set! (-> this enter-level-time a0-126) (the-as time-frame (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-126 8))))) ) ) @@ -1027,7 +1029,7 @@ (((game-save-elt in-level-time)) (let ((v1-87 (min 32 (-> data elt-count)))) (dotimes (a0-130 v1-87) - (set! (-> obj in-level-time a0-130) + (set! (-> this in-level-time a0-130) (the-as time-frame (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-130 8))))) ) ) @@ -1036,7 +1038,7 @@ (((game-save-elt fuel-cell-time)) (let ((v1-92 (min 32 (-> data elt-count)))) (dotimes (a0-133 v1-92) - (set! (-> obj fuel-cell-time a0-133) + (set! (-> this fuel-cell-time a0-133) (the-as time-frame (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-133 8))))) ) ) @@ -1055,7 +1057,7 @@ (dotimes (s4-1 (-> *level* length)) (let ((a1-68 (-> *level* level s4-1))) (if (= (-> a1-68 status) 'active) - (copy-perms-to-level! obj a1-68) + (copy-perms-to-level! this a1-68) ) ) ) @@ -1073,36 +1075,36 @@ save ) -(defmethod save-to-file game-save ((obj game-save) (arg0 string)) +(defmethod save-to-file game-save ((this game-save) (arg0 string)) "Write a game save to a file for debugging" (let ((s5-0 (new 'stack 'file-stream arg0 'write))) (file-stream-write s5-0 - (&-> obj type) - (+ (-> obj type size) (the-as uint (-> obj length))) + (&-> this type) + (+ (-> this type size) (the-as uint (-> this length))) ) (file-stream-close s5-0) ) - obj + this ) -(defmethod load-from-file! game-save ((obj game-save) (filename string)) +(defmethod load-from-file! game-save ((this game-save) (filename string)) "Load a game save from a file for debugging" (let ((stream (new 'stack 'file-stream filename 'read))) (let ((in-size (file-stream-length stream)) - (my-size (-> obj allocated-length)) + (my-size (-> this allocated-length)) ) (cond - ((>= (asize-of obj) in-size) + ((>= (asize-of this) in-size) ;; thing in file is not bigger than we are, safe to read. (cond - ((= (file-stream-read stream (&-> obj type) in-size) in-size) + ((= (file-stream-read stream (&-> this type) in-size) in-size) ;; read success! set the type tag - (set! (-> obj type) game-save) + (set! (-> this type) game-save) ) (else ;; fail. (format 0 "ERROR: SAVEGAME: save file ~A did not read correctly.~%" stream) - (set! (-> obj length) 0) + (set! (-> this length) 0) 0 ) ) @@ -1113,16 +1115,16 @@ (format 0 "ERROR: SAVEGAME: save file ~A is too big~%" stream) ) ) - (set! (-> obj allocated-length) my-size) + (set! (-> this allocated-length) my-size) ) - (when (!= (-> obj version) SAVE_VERSION) + (when (!= (-> this version) SAVE_VERSION) ;; uh-oh, the version is wrong - (format 0 "ERROR: SAVEGAME: save file ~A was version ~d, but only ~d is supported.~%" stream (-> obj version) SAVE_VERSION) - (set! (-> obj length) 0) + (format 0 "ERROR: SAVEGAME: save file ~A was version ~d, but only ~d is supported.~%" stream (-> this version) SAVE_VERSION) + (set! (-> this length) 0) ) (file-stream-close stream) ) - obj + this ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1189,27 +1191,27 @@ ) ) -(defmethod deactivate auto-save ((obj auto-save)) +(defmethod deactivate auto-save ((this auto-save)) "Deactivate the auto-save process." ;; kill the particles - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) ;; and do a normal deactivate. - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) -(defmethod relocate auto-save ((obj auto-save) (arg0 int)) +(defmethod relocate auto-save ((this auto-save) (arg0 int)) "Relocate an auto-save process by arg0 bytes." ;; update our reference particle launch control, which is allocated on our process heap - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) ;; then relocate the process. This will relocate the heap (memory, and basics on it). - (the-as auto-save ((method-of-type process relocate) obj arg0)) + (the-as auto-save ((method-of-type process relocate) this arg0)) ) (defbehavior auto-save-post auto-save () diff --git a/goal_src/jak1/engine/game/main-h.gc b/goal_src/jak1/engine/game/main-h.gc index b97d5eee8c..37b2c6605b 100644 --- a/goal_src/jak1/engine/game/main-h.gc +++ b/goal_src/jak1/engine/game/main-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: main-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; Global engine settings: (define *stats-poly* #f) (define *stats-memory* #f) diff --git a/goal_src/jak1/engine/game/main.gc b/goal_src/jak1/engine/game/main.gc index b29737814a..0af80dbc0e 100644 --- a/goal_src/jak1/engine/game/main.gc +++ b/goal_src/jak1/engine/game/main.gc @@ -5,6 +5,8 @@ ;; name in dgo: main ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Letterbox and blackout ;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -343,9 +345,9 @@ ) ) -(defmethod draw screen-filter ((obj screen-filter)) +(defmethod draw screen-filter ((this screen-filter)) (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug-no-zbuf)) - (draw-sprite2d-xy buf -256 (- (-> *video-parms* screen-hy)) 512 (-> *video-parms* screen-sy) (-> obj color)) + (draw-sprite2d-xy buf -256 (- (-> *video-parms* screen-hy)) 512 (-> *video-parms* screen-sy) (-> this color)) ) (none) ) @@ -683,9 +685,9 @@ (with-profiler "post-sync-draw" ;; add letterbox effect - (when (or (movie?) (< (-> *display* base-frame-counter) (-> *game-info* letterbox-time))) - (if (< (-> *game-info* letterbox-time) (-> *display* base-frame-counter)) - (set! (-> *game-info* letterbox-time) (-> *display* base-frame-counter)) + (when (or (movie?) (< (current-time) (-> *game-info* letterbox-time))) + (if (< (-> *game-info* letterbox-time) (current-time)) + (set! (-> *game-info* letterbox-time) (current-time)) ) (if (#if (not PC_PORT) (= (-> *setting-control* current aspect-ratio) 'aspect4x3) @@ -695,7 +697,7 @@ ) ;; add blackout effect - (if (< (-> *display* base-frame-counter) (-> *game-info* blackout-time)) + (if (< (current-time) (-> *game-info* blackout-time)) (set! (-> *setting-control* default bg-a-force) 1.0) (set! (-> *setting-control* default bg-a-force) 0.0) ) diff --git a/goal_src/jak1/engine/game/powerups.gc b/goal_src/jak1/engine/game/powerups.gc index 93f7edd3bd..d0c1c22f99 100644 --- a/goal_src/jak1/engine/game/powerups.gc +++ b/goal_src/jak1/engine/game/powerups.gc @@ -18,19 +18,14 @@ (let ((s1-1 (process->handle arg0)) (s2-1 (process->handle arg1)) ) - (let ((s0-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s0-0) (+ arg3 arg4)) + (let ((s0-0 (current-time))) + (until (time-elapsed? s0-0 (+ arg3 arg4)) (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) (if v1-8 (deactivate self) ) ) - (let* ((f0-1 - (fmax - 0.0 - (fmin 1.0 (/ (- (the float (- (-> *display* base-frame-counter) s0-0)) (the float arg3)) (the float arg4))) - ) - ) + (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) s0-0)) (the float arg3)) (the float arg4))))) (a0-18 (process-drawable-pair-random-point! (the-as process-drawable (-> s1-1 process 0)) (the-as process-drawable (-> s2-1 process 0)) @@ -51,8 +46,8 @@ ) ) (else - (let ((s4-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s4-1) arg5) + (let ((s4-1 (current-time))) + (until (time-elapsed? s4-1 arg5) (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) (arg2 a0-21) ) @@ -498,10 +493,10 @@ :init-specs ((:fade-g 0.0)) ) -(defun eco-blue-glow ((origin vector)) - (launch-particles (-> *part-id-table* 255) origin) +(defun eco-blue-glow ((arg0 vector)) + (launch-particles (-> *part-id-table* 255) arg0) (if (rand-vu-percent? 0.5) - (launch-particles (-> *part-id-table* 257) origin) + (launch-particles (-> *part-id-table* 257) arg0) ) 0 (none) @@ -522,7 +517,7 @@ (cond ((and (= (-> self control ground-pat material) (pat-material ice)) (and (>= (-> self control unknown-float01) 204.8) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.05)) + (not (time-elapsed? (-> self control unknown-dword11) (seconds 0.05))) ) ) (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 74)))) @@ -556,7 +551,7 @@ (if (not (ja-group? eichar-ice-stance-ja)) (set! f0-8 (* 0.8 f0-8)) ) - (seek! (-> self control unknown-float141) f0-8 (* 100.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-float141) f0-8 (* 100.0 (seconds-per-frame))) ) (let ((f30-0 (-> self control unknown-float141)) (f0-13 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 81920.0)) diff --git a/goal_src/jak1/engine/game/projectiles.gc b/goal_src/jak1/engine/game/projectiles.gc index afcdb969fc..677fb58031 100644 --- a/goal_src/jak1/engine/game/projectiles.gc +++ b/goal_src/jak1/engine/game/projectiles.gc @@ -587,13 +587,13 @@ :init-specs ((:fade-r -0.53333336) (:fade-g -0.53333336) (:fade-b -1.0666667) (:fade-a -0.53333336)) ) -(defmethod projectile-method-24 projectile ((obj projectile)) - (spawn (-> obj part) (the-as vector (-> obj root-override root-prim prim-core))) +(defmethod projectile-method-24 projectile ((this projectile)) + (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) 0 (none) ) -(defmethod projectile-method-28 projectile ((obj projectile)) +(defmethod projectile-method-28 projectile ((this projectile)) 0 (none) ) @@ -642,11 +642,11 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (let ((gp-0 #f)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (-> self timeout)) + (while (not (time-elapsed? (-> self state-time) (-> self timeout))) (let ((s5-0 (the int (-> *display* time-ratio)))) (set-time-ratios *display* 1.0) (countdown (s4-0 s5-0) @@ -656,14 +656,14 @@ (projectile-method-28 self) ((-> self update-velocity) self) (when (logtest? (-> self options) 2) - (seek! (-> self tween) 1.0 (* 0.5 (-> *display* seconds-per-frame))) + (seek! (-> self tween) 1.0 (* 0.5 (seconds-per-frame))) (let ((f0-6 (vector-vector-distance (-> self root-override trans) (-> self target)))) (cond ((< f0-6 20480.0) - (seek! (-> self tween) 1.0 (* 3.0 (-> *display* seconds-per-frame))) + (seek! (-> self tween) 1.0 (* 3.0 (seconds-per-frame))) ) ((< f0-6 40960.0) - (seek! (-> self tween) 1.0 (-> *display* seconds-per-frame)) + (seek! (-> self tween) 1.0 (seconds-per-frame)) ) ) ) @@ -684,7 +684,7 @@ (countdown (v1-35 16) (+! f0-16 (-> self old-dist v1-35)) ) - ;; changed for high fps. This fixes projectile collision issues + ;; og:preserve-this changed for high fps. This fixes projectile collision issues (if (or (and (logtest? (-> self root-override status) (cshape-moving-flags twall)) (< f0-16 (* (-> *display* time-adjust-ratio) 2048.0))) (< f0-16 (* (-> *display* time-adjust-ratio) 204.8)) ) @@ -784,13 +784,13 @@ ) ) -(defmethod projectile-method-27 projectile ((obj projectile)) +(defmethod projectile-method-27 projectile ((this projectile)) 0 (none) ) -(defmethod projectile-method-26 projectile ((obj projectile)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod projectile-method-26 projectile ((this projectile)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) (set! (-> s5-0 no-reaction) @@ -808,14 +808,14 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod projectile-method-25 projectile ((obj projectile)) - (go (method-of-object obj projectile-moving)) +(defmethod projectile-method-25 projectile ((this projectile)) + (go (method-of-object this projectile-moving)) 0 (none) ) @@ -832,11 +832,11 @@ ) ) -(defmethod deactivate projectile ((obj projectile)) - (if (nonzero? (-> obj sound-id)) - (sound-stop (-> obj sound-id)) +(defmethod deactivate projectile ((this projectile)) + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -886,24 +886,24 @@ (none) ) -(defmethod projectile-method-27 projectile-yellow ((obj projectile-yellow)) +(defmethod projectile-method-27 projectile-yellow ((this projectile-yellow)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj mode) 1) - (set! (-> obj max-speed) (vector-length (-> obj root-override transv))) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj angle) (vector-y-angle (-> obj root-override transv))) - (set! (-> obj tween) 0.05) - (logior! (-> obj options) 2) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this mode) 1) + (set! (-> this max-speed) (vector-length (-> this root-override transv))) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this angle) (vector-y-angle (-> this root-override transv))) + (set! (-> this tween) 0.05) + (logior! (-> this options) 2) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root-override trans quad)) - (+! (-> obj root-override trans y) -5324.8) - (vector+float*! (-> obj target) (-> obj root-override trans) (-> obj root-override transv) 2.0) - (set! (-> obj target-base quad) (-> obj target quad)) - (let ((f30-0 (the float (sar (shl (the int (y-angle (-> obj root-override))) 48) 48)))) - (set! (-> obj mask) (the-as process-mask (logior (process-mask projectile) (-> obj mask)))) - (if (logtest? (-> obj options) 16) - (set! (-> obj max-hits) 1) + (set! (-> s5-0 quad) (-> this root-override trans quad)) + (+! (-> this root-override trans y) -5324.8) + (vector+float*! (-> this target) (-> this root-override trans) (-> this root-override transv) 2.0) + (set! (-> this target-base quad) (-> this target quad)) + (let ((f30-0 (the float (sar (shl (the int (y-angle (-> this root-override))) 48) 48)))) + (set! (-> this mask) (the-as process-mask (logior (process-mask projectile) (-> this mask)))) + (if (logtest? (-> this options) 16) + (set! (-> this max-hits) 1) ) (set! (-> *part-id-table* 356 init-specs 18 initial-valuef) (the float (sar (shl (the int (+ -16384.0 f30-0)) 48) 48)) @@ -912,40 +912,40 @@ (the float (sar (shl (the int (+ -16384.0 f30-0)) 48) 48)) ) (sound-play "yellow-fire") - (set! (-> obj sound-id) (sound-play "yellow-buzz")) - (if (not (logtest? (-> obj options) 416)) - (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0 :to obj) + (set! (-> this sound-id) (sound-play "yellow-buzz")) + (if (not (logtest? (-> this options) 416)) + (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0 :to this) ) (set! (-> *part-id-table* 350 init-specs 2 initial-valuef) f30-0) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 102) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 102) this)) (when *target* (case (-> *target* current-level name) (('swamp) - (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) - (set! (-> obj water height) (if (logtest? (-> obj options) 64) - 8192.0 - 10240.0 - ) + (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01 wt04 wt07)) + (set! (-> this water height) (if (logtest? (-> this options) 64) + 8192.0 + 10240.0 + ) ) - (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) + (logior! (-> this root-override root-prim collide-with) (collide-kind water)) ) (('ogre) - (when (not (logtest? (-> obj options) 128)) - (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) - (set! (-> obj water height) 129024.0) - (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) + (when (not (logtest? (-> this options) 128)) + (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01 wt04 wt07)) + (set! (-> this water height) 129024.0) + (logior! (-> this root-override root-prim collide-with) (collide-kind water)) ) ) (('finalboss) - (+! (-> obj root-override trans y) 4096.0) - (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) - (set! (-> obj water height) 1977958.4) - (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) + (+! (-> this root-override trans y) 4096.0) + (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01 wt04 wt07)) + (set! (-> this water height) 1977958.4) + (logior! (-> this root-override root-prim collide-with) (collide-kind water)) ) ) ) @@ -953,50 +953,50 @@ (none) ) -(defmethod projectile-method-26 projectile-yellow ((obj projectile-yellow)) +(defmethod projectile-method-26 projectile-yellow ((this projectile-yellow)) (let ((t9-0 (method-of-type projectile projectile-method-26))) - (t9-0 obj) + (t9-0 this) ) - (logior! (-> obj root-override root-prim collide-with) (collide-kind mother-spider)) + (logior! (-> this root-override root-prim collide-with) (collide-kind mother-spider)) (none) ) -(defmethod projectile-method-24 projectile-yellow ((obj projectile-yellow)) +(defmethod projectile-method-24 projectile-yellow ((this projectile-yellow)) (with-pp (find-ground-and-draw-shadow - (-> obj root-override trans) - (-> obj root-override shadow-pos) + (-> this root-override trans) + (-> this root-override shadow-pos) 8192.0 (collide-kind background) (the-as process-drawable #f) 12288.0 81920.0 ) - (if (< (-> obj root-override trans y) (-> obj root-override shadow-pos y)) - (set! (-> obj root-override trans y) (+ 1228.8 (-> obj root-override shadow-pos y))) + (if (< (-> this root-override trans y) (-> this root-override shadow-pos y)) + (set! (-> this root-override trans y) (+ 1228.8 (-> this root-override shadow-pos y))) ) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (set! (-> *part-id-table* 353 init-specs 16 initial-valuef) (the-as float 30)) (set! (-> *part-id-table* 353 init-specs 16 random-rangef) (the-as float 300)) (cond - ((logtest? (-> obj options) 32) - (when (>= (- (-> *display* base-frame-counter) (-> obj state-time)) (seconds 0.05)) - (when (< (- (-> *display* base-frame-counter) (-> obj state-time)) (seconds 0.5)) + ((logtest? (-> this options) 32) + (when (time-elapsed? (-> this state-time) (seconds 0.05)) + (when (not (time-elapsed? (-> this state-time) (seconds 0.5))) (set! (-> *part-id-table* 353 init-specs 16 initial-valuef) (the-as float 0)) (set! (-> *part-id-table* 353 init-specs 16 random-rangef) (the-as float 0)) 0 ) - (spawn (-> obj part) (the-as vector (-> obj root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) ) ) (else - (spawn (-> obj part) (the-as vector (-> obj root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) ) ) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) - (set! (-> s5-0 id) (-> obj sound-id)) - (let ((a1-3 (-> obj root-override trans))) + (set! (-> s5-0 id) (-> this sound-id)) + (let ((a1-3 (-> this root-override trans))) (let ((gp-1 pp)) (when (= a1-3 #t) (if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) @@ -1015,20 +1015,20 @@ ) ) -(defmethod projectile-method-28 projectile-yellow ((obj projectile-yellow)) +(defmethod projectile-method-28 projectile-yellow ((this projectile-yellow)) (cond - ((or (not (handle->process (-> obj last-target))) - (zero? (-> (the-as target (handle->process (-> obj last-target))) control root-prim prim-core collide-as)) + ((or (not (handle->process (-> this last-target))) + (zero? (-> (the-as target (handle->process (-> this last-target))) control root-prim prim-core collide-as)) ) (cond - ((zero? (-> obj target-count)) + ((zero? (-> this target-count)) (let ((s5-0 (find-nearest-attackable - (-> obj parent-base) + (-> this parent-base) 409600.0 (the-as uint 0) (the-as uint 0) - (-> obj base-vector) - (if (logtest? (-> obj options) 160) + (-> this base-vector) + (if (logtest? (-> this options) 160) 546.13336 8192.0 ) @@ -1036,23 +1036,23 @@ ) ) (let ((s4-0 (find-nearest-attackable - (-> obj parent-base) + (-> this parent-base) 163840.0 (the-as uint 1) (the-as uint 0) - (-> obj base-vector) - (if (logtest? (-> obj options) 160) + (-> this base-vector) + (if (logtest? (-> this options) 160) 910.2222 8192.0 ) ) ) (v1-10 (find-nearest-attackable - (-> obj parent-base) + (-> this parent-base) 28672.0 (the-as uint 1) (the-as uint 0) - (-> obj base-vector) + (-> this base-vector) 16384.0 ) ) @@ -1064,64 +1064,64 @@ (set! s5-0 v1-10) ) ) - (set! (-> obj last-target) (process->handle s5-0)) + (set! (-> this last-target) (process->handle s5-0)) (when s5-0 - (set! (-> obj target quad) (-> s5-0 root-override root-prim prim-core world-sphere quad)) + (set! (-> this target quad) (-> s5-0 root-override root-prim prim-core world-sphere quad)) (if (= (-> s5-0 type symbol) 'mother-spider) - (logand! (-> obj options) -2) + (logand! (-> this options) -2) ) ) ) ) (else - (set! (-> obj target quad) (-> obj target-base quad)) + (set! (-> this target quad) (-> this target-base quad)) ) ) ) (else - (let ((a1-8 (handle->process (-> obj last-target)))) - (set! (-> obj target quad) (-> (the-as target a1-8) control root-prim prim-core world-sphere quad)) + (let ((a1-8 (handle->process (-> this last-target)))) + (set! (-> this target quad) (-> (the-as target a1-8) control root-prim prim-core world-sphere quad)) ) - (if (and (< (vector-vector-xz-distance (-> obj root-override trans) (-> obj target)) 20480.0) - (< 24576.0 (fabs (- (-> obj target y) (-> obj root-override trans y)))) + (if (and (< (vector-vector-xz-distance (-> this root-override trans) (-> this target)) 20480.0) + (< 24576.0 (fabs (- (-> this target y) (-> this root-override trans y)))) ) - (set! (-> obj last-target) (the-as handle #f)) + (set! (-> this last-target) (the-as handle #f)) ) ) ) - (+! (-> obj target-count) 1) + (+! (-> this target-count) 1) 0 (none) ) -(defmethod projectile-method-27 projectile-blue ((obj projectile-blue)) +(defmethod projectile-method-27 projectile-blue ((this projectile-blue)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (sound-play "blue-eco-on") - (set! (-> obj mode) 2) - (set! (-> obj max-speed) (-> *TARGET-bank* yellow-projectile-speed)) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (+! (-> obj root-override trans y) -5324.8) - (vector+float*! (-> obj target) (-> obj root-override trans) (-> obj root-override transv) 2.0) - (set! (-> obj target-base quad) (-> obj target quad)) - (set! (-> obj mask) (the-as process-mask (logior (process-mask ambient) (-> obj mask)))) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 42) obj)) - (set! (-> obj root-override root-prim collide-with) (collide-kind background)) - (let* ((s5-1 (handle->process (-> obj last-target))) + (set! (-> this mode) 2) + (set! (-> this max-speed) (-> *TARGET-bank* yellow-projectile-speed)) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (+! (-> this root-override trans y) -5324.8) + (vector+float*! (-> this target) (-> this root-override trans) (-> this root-override transv) 2.0) + (set! (-> this target-base quad) (-> this target quad)) + (set! (-> this mask) (the-as process-mask (logior (process-mask ambient) (-> this mask)))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 42) this)) + (set! (-> this root-override root-prim collide-with) (collide-kind background)) + (let* ((s5-1 (handle->process (-> this last-target))) (v1-20 (if (and (nonzero? s5-1) (type-type? (-> s5-1 type) process-drawable)) s5-1 ) ) ) (if v1-20 - (set! (-> obj joint-num) (rand-vu-int-range 3 (+ (-> (the-as process-drawable v1-20) node-list length) -1))) + (set! (-> this joint-num) (rand-vu-int-range 3 (+ (-> (the-as process-drawable v1-20) node-list length) -1))) ) ) 0 (none) ) -(defmethod projectile-method-26 projectile-blue ((obj projectile-blue)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod projectile-method-26 projectile-blue ((this projectile-blue)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1139,7 +1139,7 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -1194,27 +1194,27 @@ ) ) -(defmethod projectile-method-28 projectile-blue ((obj projectile-blue)) - (let* ((s5-0 (handle->process (-> obj last-target))) +(defmethod projectile-method-28 projectile-blue ((this projectile-blue)) + (let* ((s5-0 (handle->process (-> this last-target))) (v1-4 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) s5-0 ) ) ) (if v1-4 - (vector<-cspace! (-> obj target) (-> (the-as process-drawable v1-4) node-list data (-> obj joint-num))) + (vector<-cspace! (-> this target) (-> (the-as process-drawable v1-4) node-list data (-> this joint-num))) ) ) - (if (< (vector-vector-distance (-> obj target) (-> obj root-override trans)) 4096.0) - (go (method-of-object obj projectile-impact)) + (if (< (vector-vector-distance (-> this target) (-> this root-override trans)) 4096.0) + (go (method-of-object this projectile-impact)) ) 0 (none) ) -(defmethod projectile-method-24 projectile-blue ((obj projectile-blue)) +(defmethod projectile-method-24 projectile-blue ((this projectile-blue)) (if (rand-vu-percent? 0.75) - (eco-blue-glow (the-as vector (-> obj root-override root-prim prim-core))) + (eco-blue-glow (the-as vector (-> this root-override root-prim prim-core))) ) 0 (none) diff --git a/goal_src/jak1/engine/game/settings-h.gc b/goal_src/jak1/engine/game/settings-h.gc index 12430fbd5a..36c1d7e94c 100644 --- a/goal_src/jak1/engine/game/settings-h.gc +++ b/goal_src/jak1/engine/game/settings-h.gc @@ -11,6 +11,8 @@ ;; - If there are no processes trying to set a setting, it will go to a "default" setting. ;; - We must catch the actual changing of settings once per frame, and possibly call functions for certains settings. +;; DECOMP BEGINS + ;; The full setting state. (deftype setting-data (structure) ((border-mode symbol :offset-assert 0) @@ -60,47 +62,47 @@ ) ) -(defmethod inspect setting-data ((obj setting-data)) - (format #t "[~8x] ~A~%" obj 'setting-data) - (format #t "~Tborder-mode: ~A~%" (-> obj border-mode)) - (format #t "~Tsfx-volume: ~f~%" (-> obj sfx-volume)) - (format #t "~Tmusic-volume: ~f~%" (-> obj music-volume)) - (format #t "~Tdialog-volume: ~f~%" (-> obj dialog-volume)) - (format #t "~Tprocess-mask: ~D~%" (-> obj process-mask)) - (format #t "~Tcommon-page: ~D~%" (-> obj common-page)) - (format #t "~Tlanguage: ~D~%" (-> obj language)) - (format #t "~Tscreenx: ~D~%" (-> obj screenx)) - (format #t "~Tscreeny: ~D~%" (-> obj screeny)) - (format #t "~Tvibration: ~A~%" (-> obj vibration)) - (format #t "~Tplay-hints: ~A~%" (-> obj play-hints)) - (format #t "~Tmovie: ~A~%" (ppointer->process (-> obj movie))) - (format #t "~Ttalking: ~A~%" (ppointer->process (-> obj talking))) - (format #t "~Tspooling: ~A~%" (ppointer->process (-> obj spooling))) - (format #t "~Thint: ~A~%" (ppointer->process (-> obj hint))) - (format #t "~Tambient: ~A~%" (ppointer->process (-> obj ambient))) - (format #t "~Tvideo-mode: ~A~%" (-> obj video-mode)) - (format #t "~Taspect-ratio: ~A~%" (-> obj aspect-ratio)) - (format #t "~Tsound-flava: ~D~%" (-> obj sound-flava)) - (format #t "~Tauto-save: ~A~%" (-> obj auto-save)) - (format #t "~Tmusic-volume-movie: ~f~%" (-> obj music-volume-movie)) - (format #t "~Tsfx-volume-movie: ~f~%" (-> obj sfx-volume-movie)) - (format #t "~Tmusic: ~A~%" (-> obj music)) - (format #t "~Tbg-r: ~f~%" (-> obj bg-r)) - (format #t "~Tbg-g: ~f~%" (-> obj bg-g)) - (format #t "~Tbg-b: ~f~%" (-> obj bg-b)) - (format #t "~Tbg-a: ~f~%" (-> obj bg-a)) - (format #t "~Tbg-a-speed: ~f~%" (-> obj bg-a-speed)) - (format #t "~Tbg-a-force: ~f~%" (-> obj bg-a-force)) - (format #t "~Tallow-progress: ~A~%" (-> obj allow-progress)) - (format #t "~Tallow-pause: ~A~%" (-> obj allow-pause)) - (format #t "~Tsound-flava-priority: ~f~%" (-> obj sound-flava-priority)) - (format #t "~Tocean-off: ~A~%" (-> obj ocean-off)) - (format #t "~Tallow-look-around: ~A~%" (-> obj allow-look-around)) - (format #t "~Tambient-volume: ~f~%" (-> obj ambient-volume)) - (format #t "~Tambient-volume-movie: ~f~%" (-> obj ambient-volume-movie)) - (format #t "~Tdialog-volume-hint: ~f~%" (-> obj dialog-volume-hint)) - (format #t "~Tdummy[11] @ #x~X~%" (-> obj dummy)) - obj +(defmethod inspect setting-data ((this setting-data)) + (format #t "[~8x] ~A~%" this 'setting-data) + (format #t "~Tborder-mode: ~A~%" (-> this border-mode)) + (format #t "~Tsfx-volume: ~f~%" (-> this sfx-volume)) + (format #t "~Tmusic-volume: ~f~%" (-> this music-volume)) + (format #t "~Tdialog-volume: ~f~%" (-> this dialog-volume)) + (format #t "~Tprocess-mask: ~D~%" (-> this process-mask)) + (format #t "~Tcommon-page: ~D~%" (-> this common-page)) + (format #t "~Tlanguage: ~D~%" (-> this language)) + (format #t "~Tscreenx: ~D~%" (-> this screenx)) + (format #t "~Tscreeny: ~D~%" (-> this screeny)) + (format #t "~Tvibration: ~A~%" (-> this vibration)) + (format #t "~Tplay-hints: ~A~%" (-> this play-hints)) + (format #t "~Tmovie: ~A~%" (ppointer->process (-> this movie))) + (format #t "~Ttalking: ~A~%" (ppointer->process (-> this talking))) + (format #t "~Tspooling: ~A~%" (ppointer->process (-> this spooling))) + (format #t "~Thint: ~A~%" (ppointer->process (-> this hint))) + (format #t "~Tambient: ~A~%" (ppointer->process (-> this ambient))) + (format #t "~Tvideo-mode: ~A~%" (-> this video-mode)) + (format #t "~Taspect-ratio: ~A~%" (-> this aspect-ratio)) + (format #t "~Tsound-flava: ~D~%" (-> this sound-flava)) + (format #t "~Tauto-save: ~A~%" (-> this auto-save)) + (format #t "~Tmusic-volume-movie: ~f~%" (-> this music-volume-movie)) + (format #t "~Tsfx-volume-movie: ~f~%" (-> this sfx-volume-movie)) + (format #t "~Tmusic: ~A~%" (-> this music)) + (format #t "~Tbg-r: ~f~%" (-> this bg-r)) + (format #t "~Tbg-g: ~f~%" (-> this bg-g)) + (format #t "~Tbg-b: ~f~%" (-> this bg-b)) + (format #t "~Tbg-a: ~f~%" (-> this bg-a)) + (format #t "~Tbg-a-speed: ~f~%" (-> this bg-a-speed)) + (format #t "~Tbg-a-force: ~f~%" (-> this bg-a-force)) + (format #t "~Tallow-progress: ~A~%" (-> this allow-progress)) + (format #t "~Tallow-pause: ~A~%" (-> this allow-pause)) + (format #t "~Tsound-flava-priority: ~f~%" (-> this sound-flava-priority)) + (format #t "~Tocean-off: ~A~%" (-> this ocean-off)) + (format #t "~Tallow-look-around: ~A~%" (-> this allow-look-around)) + (format #t "~Tambient-volume: ~f~%" (-> this ambient-volume)) + (format #t "~Tambient-volume-movie: ~f~%" (-> this ambient-volume-movie)) + (format #t "~Tdialog-volume-hint: ~f~%" (-> this dialog-volume-hint)) + (format #t "~Tdummy[11] @ #x~X~%" (-> this dummy)) + this ) ;; There are three copies of setting data: @@ -232,5 +234,4 @@ :flag-assert #x900000008 ) -(define-extern *setting-control* setting-control) - +(define-extern *setting-control* setting-control) \ No newline at end of file diff --git a/goal_src/jak1/engine/game/settings.gc b/goal_src/jak1/engine/game/settings.gc index 9b1725e953..40f79ef3cc 100644 --- a/goal_src/jak1/engine/game/settings.gc +++ b/goal_src/jak1/engine/game/settings.gc @@ -9,7 +9,9 @@ (define *progress-flava* -1) ) -(defmethod update-from-engine setting-data ((obj setting-data) (arg0 engine)) +;; DECOMP BEGINS + +(defmethod update-from-engine setting-data ((this setting-data) (arg0 engine)) "this goes through the list of desired setting changes in the engine/connection list and updates the setting-data" (let ((conn (the-as connection (-> arg0 alive-list-end))) @@ -18,27 +20,27 @@ (while (!= (the-as connectable conn) (-> arg0 alive-list)) (case (-> conn param0) (('border-mode) - (set! (-> obj border-mode) (the-as symbol (-> conn param1))) + (set! (-> this border-mode) (the-as symbol (-> conn param1))) ) (('allow-look-around) - (set! (-> obj allow-look-around) (the-as symbol (-> conn param1))) + (set! (-> this allow-look-around) (the-as symbol (-> conn param1))) ) (('ocean-off) - (set! (-> obj ocean-off) (the-as symbol (-> conn param1))) + (set! (-> this ocean-off) (the-as symbol (-> conn param1))) ) (('music) - (set! (-> obj music) (the-as symbol (-> conn param1))) + (set! (-> this music) (the-as symbol (-> conn param1))) ) (('process-mask) (case (the-as object (-> conn param1)) (('set) - (logior! (-> obj process-mask) (the-as int (-> conn param3))) + (logior! (-> this process-mask) (the-as int (-> conn param3))) ) (('clear) - (logclear! (-> obj process-mask) (the-as uint (-> conn param3))) + (logclear! (-> this process-mask) (the-as uint (-> conn param3))) ) (('abs) - (set! (-> obj process-mask) (the-as process-mask (the-as int (-> conn param3)))) + (set! (-> this process-mask) (the-as process-mask (the-as int (-> conn param3)))) ) ) ) @@ -48,10 +50,10 @@ ) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj sfx-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj sfx-volume))) + (set! (-> this sfx-volume) (* 0.01 (the-as float (-> conn param2)) (-> this sfx-volume))) ) (else - (set! (-> obj sfx-volume) (the-as float (-> conn param2))) + (set! (-> this sfx-volume) (the-as float (-> conn param2))) ) ) ) @@ -59,137 +61,137 @@ (('music-volume) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj music-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj music-volume))) + (set! (-> this music-volume) (* 0.01 (the-as float (-> conn param2)) (-> this music-volume))) ) (else - (set! (-> obj music-volume) (the-as float (-> conn param2))) + (set! (-> this music-volume) (the-as float (-> conn param2))) ) ) ) (('ambient-volume) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj ambient-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj ambient-volume))) + (set! (-> this ambient-volume) (* 0.01 (the-as float (-> conn param2)) (-> this ambient-volume))) ) (else - (set! (-> obj ambient-volume) (the-as float (-> conn param2))) + (set! (-> this ambient-volume) (the-as float (-> conn param2))) ) ) ) (('dialog-volume) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj dialog-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj dialog-volume))) + (set! (-> this dialog-volume) (* 0.01 (the-as float (-> conn param2)) (-> this dialog-volume))) ) (else - (set! (-> obj dialog-volume) (the-as float (-> conn param2))) + (set! (-> this dialog-volume) (the-as float (-> conn param2))) ) ) ) (('sfx-volume-movie) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj sfx-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> obj sfx-volume-movie))) + (set! (-> this sfx-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> this sfx-volume-movie))) ) (else - (set! (-> obj sfx-volume-movie) (the-as float (-> conn param2))) + (set! (-> this sfx-volume-movie) (the-as float (-> conn param2))) ) ) ) (('music-volume-movie) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj music-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> obj music-volume-movie))) + (set! (-> this music-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> this music-volume-movie))) ) (else - (set! (-> obj music-volume-movie) (the-as float (-> conn param2))) + (set! (-> this music-volume-movie) (the-as float (-> conn param2))) ) ) ) (('ambient-volume-movie) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj ambient-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> obj ambient-volume-movie))) + (set! (-> this ambient-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> this ambient-volume-movie))) ) (else - (set! (-> obj ambient-volume-movie) (the-as float (-> conn param2))) + (set! (-> this ambient-volume-movie) (the-as float (-> conn param2))) ) ) ) (('dialog-volume-hint) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj dialog-volume-hint) (* 0.01 (the-as float (-> conn param2)) (-> obj dialog-volume-hint))) + (set! (-> this dialog-volume-hint) (* 0.01 (the-as float (-> conn param2)) (-> this dialog-volume-hint))) ) (else - (set! (-> obj dialog-volume-hint) (the-as float (-> conn param2))) + (set! (-> this dialog-volume-hint) (the-as float (-> conn param2))) ) ) ) (('sound-flava) - (when (>= (the-as float (-> conn param2)) (-> obj sound-flava-priority)) - (set! (-> obj sound-flava) (the-as uint (the-as int (-> conn param3)))) - (set! (-> obj sound-flava-priority) (the-as float (-> conn param2))) + (when (>= (the-as float (-> conn param2)) (-> this sound-flava-priority)) + (set! (-> this sound-flava) (the-as uint (the-as int (-> conn param3)))) + (set! (-> this sound-flava-priority) (the-as float (-> conn param2))) ) ) (('bg-r) - (set! (-> obj bg-r) (the-as float (-> conn param2))) + (set! (-> this bg-r) (the-as float (-> conn param2))) ) (('bg-g) - (set! (-> obj bg-g) (the-as float (-> conn param2))) + (set! (-> this bg-g) (the-as float (-> conn param2))) ) (('bg-b) - (set! (-> obj bg-b) (the-as float (-> conn param2))) + (set! (-> this bg-b) (the-as float (-> conn param2))) ) (('bg-a) - (set! (-> obj bg-a) (the-as float (-> conn param2))) + (set! (-> this bg-a) (the-as float (-> conn param2))) ) (('bg-a-speed) - (set! (-> obj bg-a-speed) (the-as float (-> conn param2))) + (set! (-> this bg-a-speed) (the-as float (-> conn param2))) ) (('bg-a-force) - (set! (-> obj bg-a-force) (the-as float (-> conn param2))) + (set! (-> this bg-a-force) (the-as float (-> conn param2))) ) (('language) - (set! (-> obj language) (the-as language-enum (the-as int (-> conn param3)))) + (set! (-> this language) (the-as language-enum (the-as int (-> conn param3)))) ) (('vibration) - (set! (-> obj vibration) (the-as symbol (-> conn param1))) + (set! (-> this vibration) (the-as symbol (-> conn param1))) ) (('auto-save) - (set! (-> obj auto-save) (the-as symbol (-> conn param1))) + (set! (-> this auto-save) (the-as symbol (-> conn param1))) ) (('allow-pause) - (set! (-> obj allow-pause) (the-as symbol (-> conn param1))) + (set! (-> this allow-pause) (the-as symbol (-> conn param1))) ) (('allow-progress) - (set! (-> obj allow-progress) (the-as symbol (-> conn param1))) + (set! (-> this allow-progress) (the-as symbol (-> conn param1))) ) (('play-hints) - (set! (-> obj play-hints) (the-as symbol (-> conn param1))) + (set! (-> this play-hints) (the-as symbol (-> conn param1))) ) (('movie) - (set! (-> obj movie) (the-as (pointer progress) (-> conn param1))) + (set! (-> this movie) (the-as (pointer progress) (-> conn param1))) ) (('talking) - (set! (-> obj talking) (the-as (pointer progress) (-> conn param1))) + (set! (-> this talking) (the-as (pointer progress) (-> conn param1))) ) (('spooling) - (set! (-> obj spooling) (the-as (pointer progress) (-> conn param1))) + (set! (-> this spooling) (the-as (pointer progress) (-> conn param1))) ) (('hint) - (set! (-> obj hint) (the-as (pointer process) (-> conn param1))) + (set! (-> this hint) (the-as (pointer process) (-> conn param1))) ) (('ambient) - (set! (-> obj ambient) (the-as (pointer progress) (-> conn param1))) + (set! (-> this ambient) (the-as (pointer progress) (-> conn param1))) ) (('common-page) (case (the-as object (-> conn param1)) (('set) - (logior! (-> obj common-page) (the-as int (-> conn param3))) + (logior! (-> this common-page) (the-as int (-> conn param3))) ) (('clear) - (logclear! (-> obj common-page) (the-as uint (-> conn param3))) + (logclear! (-> this common-page) (the-as uint (-> conn param3))) ) ) ) @@ -198,29 +200,29 @@ (set! s4-0 (-> (the-as connectable conn) prev0)) ) ) - obj + this ) -(defmethod add-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod add-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) "add a setting for the process." - (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) + (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) -(defmethod set-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod set-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) "(re-)sets a setting for the process." - (remove-setting obj arg0 arg1) - (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) + (remove-setting this arg0 arg1) + (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) -(defmethod remove-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol)) +(defmethod remove-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol)) "remove a setting from the specified process. if arg1 = #t then remove ALL settings for that process" (when arg0 - (let ((s5-0 (-> obj engine)) + (let ((s5-0 (-> this engine)) (s4-0 (-> arg0 connection-list next1)) ) (while s4-0 @@ -238,18 +240,18 @@ ) -(defmethod apply-settings setting-control ((obj setting-control)) +(defmethod apply-settings setting-control ((this setting-control)) "Update the current settings. This only updates settings that are 'safe' to do multiple times per frame." - (let ((gp-0 (-> obj current))) - (let ((s5-0 (-> obj target))) + (let ((gp-0 (-> this current))) + (let ((s5-0 (-> this target))) ;; set the settings to default - (mem-copy! (the-as pointer s5-0) (the-as pointer (-> obj default)) 196) + (mem-copy! (the-as pointer s5-0) (the-as pointer (-> this default)) 196) ;; hack (set! (-> s5-0 ambient-volume) - (* (* 0.01 (-> obj default ambient-volume)) (-> obj default sfx-volume)) + (* (* 0.01 (-> this default ambient-volume)) (-> this default sfx-volume)) ) ;; apply requesting changes - (update-from-engine s5-0 (-> obj engine)) + (update-from-engine s5-0 (-> this engine)) ;; copy those settings to current. (set! (-> gp-0 border-mode) (-> s5-0 border-mode)) (set! (-> gp-0 common-page) (-> s5-0 common-page)) @@ -277,14 +279,14 @@ ) -(defmethod update setting-control ((obj setting-control)) +(defmethod update setting-control ((this setting-control)) "Do a per-frame update of all settings" ;; compute all settings - (apply-settings obj) + (apply-settings this) ;; now handle the special ones. - (let ((gp-0 (-> obj current))) - (let ((s5-1 (-> obj target))) + (let ((gp-0 (-> this current))) + (let ((s5-1 (-> this target))) ;; the volume change is done slowly (when *sound-player-enable* (when (!= (-> gp-0 sfx-volume) (-> s5-1 sfx-volume)) @@ -487,7 +489,7 @@ ) - +;; og:preserve-this (#when PC_PORT ;;;;;;;;;;;;;;;;;;;;;; ;; opengoal territory override @@ -508,8 +510,4 @@ ) ) -) - - - - +) \ No newline at end of file diff --git a/goal_src/jak1/engine/game/task/hint-control-h.gc b/goal_src/jak1/engine/game/task/hint-control-h.gc index a5b370d429..28e0abf05d 100644 --- a/goal_src/jak1/engine/game/task/hint-control-h.gc +++ b/goal_src/jak1/engine/game/task/hint-control-h.gc @@ -9,6 +9,10 @@ ;; Hints can belong to either a level or a task. The hint-control types have ;; parameters about how often the hints should come, and what they are tied to. +(define-extern reset-all-hint-controls (function none)) +(define-extern kill-current-level-hint (function pair pair symbol none)) +(define-extern level-hint-spawn (function text-id string entity process-tree game-task none)) + (defenum hint-command (if-unknown 0) (if-known 1) @@ -26,6 +30,8 @@ (if-at-most-need-reminder-a 13) ) +;; DECOMP BEGINS + ;; information about an in-level hint. These aren't tied to a specific object or task. (deftype level-hint-control (structure) ((delay-before-playing time-frame :offset-assert 0) @@ -58,9 +64,4 @@ :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 - ) - -(define-extern reset-all-hint-controls (function none)) -(define-extern kill-current-level-hint (function pair pair symbol none)) -(define-extern level-hint-spawn (function text-id string entity process-tree game-task none)) - + ) \ No newline at end of file diff --git a/goal_src/jak1/engine/game/task/hint-control.gc b/goal_src/jak1/engine/game/task/hint-control.gc index 95e0003c84..4b59e4a23c 100644 --- a/goal_src/jak1/engine/game/task/hint-control.gc +++ b/goal_src/jak1/engine/game/task/hint-control.gc @@ -248,7 +248,7 @@ (zero? (-> *game-info* hint-control v1-0 start-time)) (!= (-> *game-info* hint-control v1-0 num-attempts-before-playing) 1) ) - (set! (-> *game-info* hint-control v1-0 start-time) (-> *display* base-frame-counter)) + (set-time! (-> *game-info* hint-control v1-0 start-time)) 0 ) ) @@ -278,7 +278,7 @@ (set! v1-0 (appeared-for-long-enough? (the-as level-hint (ppointer->process *hint-semaphore*)))) 0 ) - (when (and v1-0 (< (- (-> *display* base-frame-counter) (-> *game-info* hint-play-time)) (seconds 0.1))) + (when (and v1-0 (not (time-elapsed? (-> *game-info* hint-play-time) (seconds 0.1)))) (set! v1-0 #f) 0 ) @@ -287,7 +287,7 @@ (not (-> *setting-control* current spooling)) (not (-> *setting-control* current hint)) (not (-> *setting-control* current ambient)) - (>= (-> *display* base-frame-counter) (-> *game-info* blackout-time)) + (>= (current-time) (-> *game-info* blackout-time)) ) ) 0 @@ -301,7 +301,7 @@ ) (else (let ((gp-1 (-> *game-info* hint-control v1-16)) - (a0-24 (- (-> *display* base-frame-counter) (-> *game-info* hint-control v1-16 last-time-called))) + (a0-24 (- (current-time) (-> *game-info* hint-control v1-16 last-time-called))) (v1-21 #t) ) (if (and (= (-> gp-1 num-attempts-before-playing) 1) (< a0-24 (seconds 0.1))) @@ -310,13 +310,13 @@ (cond ((and (!= (-> gp-1 num-attempts-before-playing) 1) (nonzero? (-> gp-1 last-time-called)) - (< (- (-> *display* base-frame-counter) (-> gp-1 last-time-called)) (seconds 0.5)) + (not (time-elapsed? (-> gp-1 last-time-called) (seconds 0.5))) ) - (set! (-> gp-1 last-time-called) (-> *display* base-frame-counter)) + (set-time! (-> gp-1 last-time-called)) #f ) (else - (set! (-> gp-1 last-time-called) (-> *display* base-frame-counter)) + (set-time! (-> gp-1 last-time-called)) (when (nonzero? (-> gp-1 delay-before-playing)) (if (< (-> gp-1 start-time) (-> gp-1 delay-before-playing)) (set! v1-21 #f) @@ -397,7 +397,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak1/engine/game/task/task-control-h.gc b/goal_src/jak1/engine/game/task/task-control-h.gc index a5823a95a0..b77068914b 100644 --- a/goal_src/jak1/engine/game/task/task-control-h.gc +++ b/goal_src/jak1/engine/game/task/task-control-h.gc @@ -121,7 +121,7 @@ (blend-on-exit art-joint-anim :offset-assert 280) (camera handle :offset-assert 288) (will-talk symbol :offset-assert 296) - (talk-message text-id :offset-assert 300) + (talk-message text-id :offset-assert 300) (last-talk time-frame :offset-assert 304) (bounce-away symbol :offset-assert 312) (ambient ambient-control :inline :offset-assert 320) diff --git a/goal_src/jak1/engine/game/task/task-control.gc b/goal_src/jak1/engine/game/task/task-control.gc index 0f22d6ff69..b1390006d1 100644 --- a/goal_src/jak1/engine/game/task/task-control.gc +++ b/goal_src/jak1/engine/game/task/task-control.gc @@ -11,86 +11,86 @@ (enum->string task-status arg0) ) -(defmethod get-task task-cstage ((obj task-cstage)) +(defmethod get-task task-cstage ((this task-cstage)) "Get the game task for this cstage" - (-> obj game-task) + (-> this game-task) ) -(defmethod get-status task-cstage ((obj task-cstage)) +(defmethod get-status task-cstage ((this task-cstage)) "Get the status for this cstage" - (-> obj status) + (-> this status) ) -(defmethod closed? task-cstage ((obj task-cstage)) +(defmethod closed? task-cstage ((this task-cstage)) "Is the closed flag set?" (declare (inline)) - (logtest? (-> obj flags) (task-flags closed)) + (logtest? (-> this flags) (task-flags closed)) ) -(defmethod closed-by-default? task-cstage ((obj task-cstage)) +(defmethod closed-by-default? task-cstage ((this task-cstage)) "Is the closed-by-default flag set?" (declare (inline)) - (logtest? (-> obj flags) (task-flags closed-by-default)) + (logtest? (-> this flags) (task-flags closed-by-default)) ) -(defmethod task-available? task-cstage ((obj task-cstage) (arg0 task-control)) +(defmethod task-available? task-cstage ((this task-cstage) (arg0 task-control)) "Is this task available to be the current task?" (cond - ((closed? obj) + ((closed? this) ;; we're already closed. #f ) - ((>= (the-as int (-> (get-entity-task-perm *game-info* (-> obj game-task)) user-uint8 0)) - (the-as int (-> obj status)) + ((>= (the-as int (-> (get-entity-task-perm *game-info* (-> this game-task)) user-uint8 0)) + (the-as int (-> this status)) ) ;; the permanent entity for this task has stored that we have progresssed past ;; our status. Remember that we are closed, and return #f. - (logior! (-> obj flags) (task-flags closed)) + (logior! (-> this flags) (task-flags closed)) #f ) - ((task-complete? *game-info* (-> obj game-task)) + ((task-complete? *game-info* (-> this game-task)) ;; the game-info thinks that we have completed this task already. ;; remember we are closed and return #f - (logior! (-> obj flags) (task-flags closed)) + (logior! (-> this flags) (task-flags closed)) #f ) (else ;; we aren't closed. Check the condition. - ((-> obj condition) arg0) + ((-> this condition) arg0) ) ) ) -(defmethod close-task! task-cstage ((obj task-cstage)) +(defmethod close-task! task-cstage ((this task-cstage)) "Close this task!" - (if (= (-> obj game-task) (game-task none)) + (if (= (-> this game-task) (game-task none)) ;; invalid task. (return (the-as int #f)) ) ;; flag as closed - (logior! (-> obj flags) (task-flags closed)) + (logior! (-> this flags) (task-flags closed)) ;; do we have an entity to update? - (when (logtest? (-> obj flags) (task-flags has-entity)) + (when (logtest? (-> this flags) (task-flags has-entity)) ;; look up the permanent storage for the entity associated with our task - (let ((v1-9 (get-entity-task-perm *game-info* (-> obj game-task)))) + (let ((v1-9 (get-entity-task-perm *game-info* (-> this game-task)))) ;; we set a bit to indicate that we are storing a non-default status (logior! (-> v1-9 status) (entity-perm-status user-set-from-cstage)) ;; and store the actual status (only increment) - (if (< (-> v1-9 user-uint8 0) (the-as uint (-> obj status))) - (set! (-> v1-9 user-int8 0) (the-as int (-> obj status))) + (if (< (-> v1-9 user-uint8 0) (the-as uint (-> this status))) + (set! (-> v1-9 user-int8 0) (the-as int (-> this status))) ) ) ) 0 ) -(defmethod open-task! task-cstage ((obj task-cstage)) +(defmethod open-task! task-cstage ((this task-cstage)) "Clear the closed flag." - (logclear! (-> obj flags) (task-flags closed)) + (logclear! (-> this flags) (task-flags closed)) 0 ) @@ -102,69 +102,69 @@ ) ) -(defmethod current-task task-control ((obj task-control)) +(defmethod current-task task-control ((this task-control)) "Get the current task that is being played. If unknown returns the none task" (cond - ((= obj *null-task-control*) + ((= this *null-task-control*) (format 0 "ERROR: current-task received *null-task-control*~%") (game-task none) ) - ((= (-> obj current-stage) -1) + ((= (-> this current-stage) -1) ;; state unknown (game-task none) ) (else ;; look up the current cstage's task - (-> obj stage (-> obj current-stage) game-task) + (-> this stage (-> this current-stage) game-task) ) ) ) -(defmethod current-status task-control ((obj task-control)) +(defmethod current-status task-control ((this task-control)) "Get the status of the cstage that is being played. Will return invalid if not possible" (cond - ((= obj *null-task-control*) + ((= this *null-task-control*) (format 0 "ERROR: current-status received self of *null-task-control*~%~%") (task-status invalid) ) - ((= (-> obj current-stage) -1) + ((= (-> this current-stage) -1) (task-status invalid) ) (else - (-> obj stage (-> obj current-stage) status) + (-> this stage (-> this current-stage) status) ) ) ) -(defmethod close-current! task-control ((obj task-control)) +(defmethod close-current! task-control ((this task-control)) (cond - ((= obj *null-task-control*) + ((= this *null-task-control*) (format 0 "ERROR: close-current! received self of *null-task-control*~%~%") ) - ((= (-> obj current-stage) -1) + ((= (-> this current-stage) -1) ;; no current stage, do nothing ) (else - (close-task! (-> obj stage (-> obj current-stage))) + (close-task! (-> this stage (-> this current-stage))) ) ) ;; attempt to update the current task - (first-any obj #t) + (first-any this #t) ) -(defmethod close-status! task-control ((obj task-control) (arg0 task-status)) +(defmethod close-status! task-control ((this task-control) (arg0 task-status)) "Close the cstage that: - is associated with the task for the current cstage - is for the given status " - (let ((a0-2 (current-task obj))) + (let ((a0-2 (current-task this))) ;; iterate over all cstages - (dotimes (v1-1 (-> obj stage length)) - (when (and (= a0-2 (-> obj stage v1-1 game-task)) (= arg0 (-> obj stage v1-1 status))) + (dotimes (v1-1 (-> this stage length)) + (when (and (= a0-2 (-> this stage v1-1 game-task)) (= arg0 (-> this stage v1-1 status))) ;; found it! close and update current stage - (close-task! (-> obj stage v1-1)) - (return (first-any obj #t)) + (close-task! (-> this stage v1-1)) + (return (first-any this #t)) ) ) ;; nope, complain. @@ -176,12 +176,12 @@ (game-task none) ) -(defmethod first-any task-control ((obj task-control) (arg0 symbol)) +(defmethod first-any task-control ((this task-control) (arg0 symbol)) "Iterate through tasks, finding an unclosed one to mark as current If arg0 is #t, warn on receiving null-task-control" ;; check for null - (when (= obj *null-task-control*) + (when (= this *null-task-control*) (if arg0 (format 0 "ERROR: first-any received self of *null-task-control*~%~%") ) @@ -189,57 +189,57 @@ ) ;; iterate through all tasks - (dotimes (s5-0 (-> obj stage length)) - (when (task-available? (-> obj stage s5-0) obj) + (dotimes (s5-0 (-> this stage length)) + (when (task-available? (-> this stage s5-0) this) ;; found an available task, set it. - (set! (-> obj current-stage) s5-0) - (return (-> obj stage s5-0 game-task)) + (set! (-> this current-stage) s5-0) + (return (-> this stage s5-0 game-task)) ) ) ;; none available. - (set! (-> obj current-stage) -1) + (set! (-> this current-stage) -1) (game-task none) ) -(defmethod reset! task-control ((obj task-control) (reset-mode symbol) (arg1 symbol)) +(defmethod reset! task-control ((this task-control) (reset-mode symbol) (arg1 symbol)) "Reset a task control. arg1 to warn on null, reset-mode 'game for a game reset" - (when (= obj *null-task-control*) + (when (= this *null-task-control*) (if arg1 (format 0 "ERROR: reset! received self of *null-task-control*~%~%") ) (return 0) ) - (dotimes (s4-0 (-> obj stage length)) + (dotimes (s4-0 (-> this stage length)) ;; do we open the task? (if (or (= reset-mode 'game) ;; open every task on game reset - (not (closed-by-default? (-> obj stage s4-0))) ;; todo this flag? + (not (closed-by-default? (-> this stage s4-0))) ;; todo this flag? ) - (open-task! (-> obj stage s4-0)) + (open-task! (-> this stage s4-0)) ) ;; call close-task! to send closed stuff to entities - (if (closed? (-> obj stage s4-0)) - (close-task! (-> obj stage s4-0)) + (if (closed? (-> this stage s4-0)) + (close-task! (-> this stage s4-0)) ) ) (the-as int #f) ) -(defmethod closed? task-control ((obj task-control) (arg0 game-task) (arg1 task-status)) +(defmethod closed? task-control ((this task-control) (arg0 game-task) (arg1 task-status)) "Is the given task/status cstage closed?" - (when (= obj *null-task-control*) + (when (= this *null-task-control*) (format 0 "ERROR: closed? received self of *null-task-control*~%~%") (return #f) ) ;; iterate all and check for match - (dotimes (v1-3 (-> obj stage length)) - (when (and (= arg0 (-> obj stage v1-3 game-task)) - (= arg1 (-> obj stage v1-3 status)) + (dotimes (v1-3 (-> this stage length)) + (when (and (= arg0 (-> this stage v1-3 game-task)) + (= arg1 (-> this stage v1-3 status)) ) - (return (closed? (-> obj stage v1-3))) + (return (closed? (-> this stage v1-3))) ) ) (format 0 "ERROR: closed? received non-existent task-cstage(~S ~S)--returning #t.~%" @@ -249,38 +249,38 @@ #t ) -(defmethod exists? task-control ((obj task-control) (arg0 game-task) (arg1 task-status)) +(defmethod exists? task-control ((this task-control) (arg0 game-task) (arg1 task-status)) "Is there a cstage for the given task and status?" - (when (= obj *null-task-control*) + (when (= this *null-task-control*) (format 0 "ERROR: exists? received self of *null-task-control*~%~%") (return #f) ) - (dotimes (v1-3 (-> obj stage length)) - (if (and (= arg0 (-> obj stage v1-3 game-task)) (= arg1 (-> obj stage v1-3 status))) + (dotimes (v1-3 (-> this stage length)) + (if (and (= arg0 (-> this stage v1-3 game-task)) (= arg1 (-> this stage v1-3 status))) (return #t) ) ) #f ) -(defmethod get-reminder task-control ((obj task-control) (arg0 int)) +(defmethod get-reminder task-control ((this task-control) (arg0 int)) "Get the arg0th reminder. " - (when (= obj *null-task-control*) + (when (= this *null-task-control*) (format 0 "ERROR: get-reminder received self of *null-task-control*~%~%") (return 0) ) - (let ((v1-4 (get-entity-task-perm *game-info* (-> obj stage 0 game-task)))) + (let ((v1-4 (get-entity-task-perm *game-info* (-> this stage 0 game-task)))) (the-as int (-> v1-4 user-uint8 (+ arg0 1))) ) ) -(defmethod save-reminder task-control ((obj task-control) (arg0 int) (arg1 int)) +(defmethod save-reminder task-control ((this task-control) (arg0 int) (arg1 int)) "Set the arg1th reminder to arg0" - (when (= obj *null-task-control*) + (when (= this *null-task-control*) (format 0 "ERROR: save-reminder received self of *null-task-control*~%~%") (return 0) ) - (let ((v1-4 (get-entity-task-perm *game-info* (-> obj stage 0 game-task)))) + (let ((v1-4 (get-entity-task-perm *game-info* (-> this stage 0 game-task)))) ;; remember that we have a change. (logior! (-> v1-4 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-4 user-int8 (+ arg1 1)) arg0) diff --git a/goal_src/jak1/engine/geometry/bounding-box-h.gc b/goal_src/jak1/engine/geometry/bounding-box-h.gc index 631216aa0b..13d9b01e47 100644 --- a/goal_src/jak1/engine/geometry/bounding-box-h.gc +++ b/goal_src/jak1/engine/geometry/bounding-box-h.gc @@ -7,6 +7,8 @@ ;; Types related to bounding boxes. +;; DECOMP BEGINS + ;; floating point bounding box. ;; min is the corner with lowest x,y,z values. ;; max is the corner with highest x,y,z values. diff --git a/goal_src/jak1/engine/geometry/bounding-box.gc b/goal_src/jak1/engine/geometry/bounding-box.gc index 5a54f4aef0..22611de003 100644 --- a/goal_src/jak1/engine/geometry/bounding-box.gc +++ b/goal_src/jak1/engine/geometry/bounding-box.gc @@ -5,6 +5,8 @@ ;; name in dgo: bounding-box ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (defun box-vector-enside? ((box bounding-box) (pt vector)) "Is the point in the box? On the edge doesn't count" (and @@ -29,7 +31,7 @@ ) ) -(defmethod set-from-point-offset! bounding-box ((obj bounding-box) (arg0 vector3s) (arg1 vector3s)) +(defmethod set-from-point-offset! bounding-box ((this bounding-box) (arg0 vector3s) (arg1 vector3s)) "Set box to smallest containing the points arg0, (arg0 + arg1)" (rlet ((vf0 :class vf) (vf1 :class vf) @@ -46,49 +48,49 @@ (.max.vf vf2 vf4 vf5) (.mov.vf vf1 vf0 :mask #b1000) (.mov.vf vf2 vf0 :mask #b1000) - (.svf obj vf1) - (.svf obj vf2 :offset 16) + (.svf this vf1) + (.svf this vf2 :offset 16) 0 ) ) -(defmethod add-point! bounding-box ((obj bounding-box) (arg0 vector3s)) +(defmethod add-point! bounding-box ((this bounding-box) (arg0 vector3s)) "Expand the box if needed to contain the given point" (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) - (.lvf vf1 obj) - (.lvf vf2 obj :offset 16) + (.lvf vf1 this) + (.lvf vf2 this :offset 16) (.lvf vf3 arg0) (.min.vf vf1 vf1 vf3) (.max.vf vf2 vf2 vf3) - (.svf obj vf1) - (.svf obj vf2 :offset 16) + (.svf this vf1) + (.svf this vf2 :offset 16) 0 ) ) -(defmethod add-box! bounding-box ((obj bounding-box) (arg0 bounding-box)) +(defmethod add-box! bounding-box ((this bounding-box) (arg0 bounding-box)) "Expand the box if needed to contain the given box" (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) ) - (.lvf vf1 obj) - (.lvf vf2 obj :offset 16) + (.lvf vf1 this) + (.lvf vf2 this :offset 16) (.lvf vf3 arg0) (.lvf vf4 arg0 :offset 16) (.min.vf vf1 vf1 vf3) (.max.vf vf2 vf2 vf4) - (.svf obj vf1) - (.svf obj vf2 :offset 16) + (.svf this vf1) + (.svf this vf2 :offset 16) 0 ) ) -(defmethod set-from-point-offset-pad! bounding-box ((obj bounding-box) (arg0 vector3s) (arg1 vector3s) (arg2 float)) +(defmethod set-from-point-offset-pad! bounding-box ((this bounding-box) (arg0 vector3s) (arg1 vector3s) (arg2 float)) "Set the box size to contain pt, pt + offset, with some padding" (rlet ((vf0 :class vf) (vf1 :class vf) @@ -109,13 +111,13 @@ (.sub.x.vf vf2 vf2 vf1 :mask #b111) (.mov.vf vf2 vf0 :mask #b1000) (.mov.vf vf3 vf0 :mask #b1000) - (.svf obj vf2) - (.svf obj vf3 :offset 16) + (.svf this vf2) + (.svf this vf3 :offset 16) 0 ) ) -(defmethod set-from-sphere! bounding-box ((obj bounding-box) (arg0 sphere)) +(defmethod set-from-sphere! bounding-box ((this bounding-box) (arg0 sphere)) "Set the box size to contain the given sphere" (rlet ((vf0 :class vf) (vf1 :class vf) @@ -128,8 +130,8 @@ (.add.w.vf vf3 vf1 vf1 :mask #b111) (.mov.vf vf2 vf0 :mask #b1000) (.mov.vf vf3 vf0 :mask #b1000) - (.svf obj vf2) - (.svf obj vf3 :offset 16) + (.svf this vf2) + (.svf this vf3 :offset 16) 0 ) ) @@ -140,7 +142,7 @@ ;; these are used in the collision system to build bounding boxes around collision geometries, so they are quite optimized. -(defmethod add-spheres! bounding-box ((obj bounding-box) (spheres (inline-array sphere)) (count int)) +(defmethod add-spheres! bounding-box ((this bounding-box) (spheres (inline-array sphere)) (count int)) "Add count spheres." ;; the PS2 implementation is very optimized ;; It is unrolled and 'software pipelined' to do 4 at a time. @@ -153,8 +155,8 @@ (when (nonzero? count) ;; load these outside the loop - (.lvf current-min (-> obj min)) - (.lvf current-max (-> obj max)) + (.lvf current-min (-> this min)) + (.lvf current-max (-> this max)) (dotimes (i count) (.lvf sph (-> spheres i)) @@ -164,14 +166,14 @@ (.max.vf current-max current-max sph-max :mask #b111) ) - (.svf (-> obj min) current-min) - (.svf (-> obj max) current-max) + (.svf (-> this min) current-min) + (.svf (-> this max) current-max) ) ) 0 ) -(defmethod set-from-spheres! bounding-box ((obj bounding-box) (spheres (inline-array sphere)) (count int)) +(defmethod set-from-spheres! bounding-box ((this bounding-box) (spheres (inline-array sphere)) (count int)) "Reset box to hold the given spheres. Note: this implementation could be optimized." ;; This is also unrolled, but does 7 at a time. (rlet ((vf0 :class vf) @@ -202,8 +204,8 @@ ) ) - (.svf (-> obj min) current-min) - (.svf (-> obj max) current-max) + (.svf (-> this min) current-min) + (.svf (-> this max) current-max) ) 0 ) diff --git a/goal_src/jak1/engine/geometry/cylinder.gc b/goal_src/jak1/engine/geometry/cylinder.gc index 8f66e7a044..03053612dd 100644 --- a/goal_src/jak1/engine/geometry/cylinder.gc +++ b/goal_src/jak1/engine/geometry/cylinder.gc @@ -7,7 +7,9 @@ ;; Note: "cylinder" refers to a capsule, "cylinder-flat" refers to a real cylinder with end caps. -(defmethod ray-capsule-intersect cylinder ((obj cylinder) (probe-origin vector) (probe-dir vector)) +;; DECOMP BEGINS + +(defmethod ray-capsule-intersect cylinder ((this cylinder) (probe-origin vector) (probe-dir vector)) "Intersect a ray with a capsule." (let ((t2-0 (new 'stack-no-clear 'vector)) (end-pt (new 'stack-no-clear 'vector)) @@ -16,10 +18,10 @@ (let ((result (ray-cylinder-intersect probe-origin probe-dir - (-> obj origin) - (-> obj axis) - (-> obj radius) - (-> obj length) + (-> this origin) + (-> this axis) + (-> this radius) + (-> this length) t2-0 ) ) @@ -28,8 +30,8 @@ (let ((u-origin-sph (ray-sphere-intersect probe-origin probe-dir - (-> obj origin) - (-> obj radius) + (-> this origin) + (-> this radius) ) ) ) @@ -39,9 +41,9 @@ ) ) ;; compute the location of the other end's sphere's origin - (vector+float*! end-pt (-> obj origin) (-> obj axis) (-> obj length)) + (vector+float*! end-pt (-> this origin) (-> this axis) (-> this length)) ;; intersect that - (let ((u-end-sphere (ray-sphere-intersect probe-origin probe-dir end-pt (-> obj radius)))) + (let ((u-end-sphere (ray-sphere-intersect probe-origin probe-dir end-pt (-> this radius)))) ;; and pick it if it's closer. (if (and (>= u-end-sphere 0.0) (or (< result 0.0) (< u-end-sphere result))) (set! result u-end-sphere) @@ -62,7 +64,7 @@ ) -(defmethod debug-draw cylinder ((obj cylinder) (arg0 vector4w)) +(defmethod debug-draw cylinder ((this cylinder) (arg0 vector4w)) "Debug draw a cylinder. This is slow and ugly" (local-vars (sv-896 matrix) @@ -93,21 +95,21 @@ (let ((s1-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'vector)) ) - (if (< 0.999 (fabs (-> obj axis y))) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :z 1.0)) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :y 1.0)) + (if (< 0.999 (fabs (-> this axis y))) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) - (vector-normalize! s1-0 (-> obj radius)) - (vector-float*! s0-0 (-> obj axis) (* 0.125 (-> obj length))) + (vector-normalize! s1-0 (-> this radius)) + (vector-float*! s0-0 (-> this axis) (* 0.125 (-> this length))) (let ((s5-0 (new 'stack-no-clear 'cylinder-verts)) (s4-0 (new 'stack-no-clear 'cylinder-verts)) (s3-0 (new 'stack-no-clear 'matrix)) ) - (matrix-axis-angle! s3-0 (-> obj axis) 4096.0) + (matrix-axis-angle! s3-0 (-> this axis) 4096.0) (set! sv-896 (new 'stack-no-clear 'matrix)) - (vector-matrix*! (the-as vector sv-896) (-> obj origin) s3-0) + (vector-matrix*! (the-as vector sv-896) (-> this origin) s3-0) (let ((v1-5 (-> s3-0 vector 3))) - (.lvf vf4 (&-> (-> obj origin) quad)) + (.lvf vf4 (&-> (-> this origin) quad)) (.lvf vf5 (&-> sv-896 vector 0 quad)) (.mov.vf vf6 vf0 :mask #b1000) (.sub.vf vf6 vf4 vf5 :mask #b111) @@ -115,7 +117,7 @@ ) (set! sv-912 0) (while (< sv-912 8) - (vector+! (-> s5-0 vert (+ sv-912 8)) (-> obj origin) s1-0) + (vector+! (-> s5-0 vert (+ sv-912 8)) (-> this origin) s1-0) (vector+float*! (-> s5-0 vert (+ sv-912 8)) (-> s5-0 vert (+ sv-912 8)) @@ -127,7 +129,7 @@ (dotimes (s0-1 8) (set! sv-928 vector+float*!) (set! sv-944 (-> s5-0 vert s0-1)) - (set! sv-960 (-> obj origin)) + (set! sv-960 (-> this origin)) (set! sv-976 s1-0) (let ((a3-1 (cos (* 2048.0 (the float (- 7 s0-1)))))) (sv-928 sv-944 sv-960 sv-976 a3-1) @@ -135,14 +137,14 @@ (set! sv-992 vector+float*!) (set! sv-1008 (-> s5-0 vert s0-1)) (set! sv-1024 (-> s5-0 vert s0-1)) - (set! sv-1040 (-> obj axis)) + (set! sv-1040 (-> this axis)) (let - ((a3-2 (* (- (-> obj radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))) + ((a3-2 (* (- (-> this radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))) (sv-992 sv-1008 sv-1024 sv-1040 a3-2) ) (set! sv-1056 vector+float*!) (set! sv-1072 (-> s5-0 vert (+ s0-1 16))) - (set! sv-1088 (-> obj origin)) + (set! sv-1088 (-> this origin)) (set! sv-1104 s1-0) (let ((a3-3 (cos (* 2048.0 (the float s0-1))))) (sv-1056 sv-1072 sv-1088 sv-1104 a3-3) @@ -150,9 +152,9 @@ (set! sv-1120 vector+float*!) (set! sv-1136 (-> s5-0 vert (+ s0-1 16))) (set! sv-1152 (-> s5-0 vert (+ s0-1 16))) - (set! sv-1168 (-> obj axis)) - (let ((a3-4 (+ (-> obj length) - (* (-> obj radius) (sin (* 2048.0 (the float s0-1)))) + (set! sv-1168 (-> this axis)) + (let ((a3-4 (+ (-> this length) + (* (-> this radius) (sin (* 2048.0 (the float s0-1)))) ) ) ) @@ -202,7 +204,7 @@ ) ) -(defmethod ray-flat-cyl-intersect cylinder-flat ((obj cylinder-flat) (probe-origin vector) (probe-dir vector)) +(defmethod ray-flat-cyl-intersect cylinder-flat ((this cylinder-flat) (probe-origin vector) (probe-dir vector)) "Intersect with a real cylinder." (let ((gp-0 (new 'stack-no-clear 'vector)) (end-pt (new 'stack-no-clear 'vector)) @@ -213,10 +215,10 @@ (let ((result (ray-cylinder-intersect probe-origin probe-dir - (-> obj origin) - (-> obj axis) - (-> obj radius) - (-> obj length) + (-> this origin) + (-> this axis) + (-> this radius) + (-> this length) gp-0 ) ) @@ -225,25 +227,25 @@ (let ((u-origin-circle (ray-arbitrary-circle-intersect probe-origin probe-dir - (-> obj origin) - (-> obj axis) - (-> obj radius) + (-> this origin) + (-> this axis) + (-> this radius) ) ) ) (when (and (>= u-origin-circle 0.0) (or (< result 0.0) (< u-origin-circle result))) (set! result u-origin-circle) - (set! (-> gp-0 quad) (-> obj origin quad)) + (set! (-> gp-0 quad) (-> this origin quad)) ) ) ;; get other end cap - (vector+float*! end-pt (-> obj origin) (-> obj axis) (-> obj length)) + (vector+float*! end-pt (-> this origin) (-> this axis) (-> this length)) (let ((u-end-circle (ray-arbitrary-circle-intersect probe-origin probe-dir end-pt - (-> obj axis) - (-> obj radius) + (-> this axis) + (-> this radius) ) ) ) @@ -267,7 +269,7 @@ ) -(defmethod debug-draw cylinder-flat ((obj cylinder-flat) (arg0 vector4w)) +(defmethod debug-draw cylinder-flat ((this cylinder-flat) (arg0 vector4w)) (local-vars (sv-448 vector) (sv-464 int)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -278,21 +280,21 @@ (let ((s1-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'vector)) ) - (if (< 0.999 (fabs (-> obj axis y))) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :z 1.0)) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :y 1.0)) + (if (< 0.999 (fabs (-> this axis y))) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) - (vector-normalize! s1-0 (-> obj radius)) - (vector-float*! s0-0 (-> obj axis) (* 0.14285715 (-> obj length))) + (vector-normalize! s1-0 (-> this radius)) + (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s3-0 (new 'stack-no-clear 'matrix)) ) - (matrix-axis-angle! s3-0 (-> obj axis) 4096.0) + (matrix-axis-angle! s3-0 (-> this axis) 4096.0) (set! sv-448 (new 'stack-no-clear 'vector)) - (vector-matrix*! sv-448 (-> obj origin) s3-0) + (vector-matrix*! sv-448 (-> this origin) s3-0) (let ((v1-5 (-> s3-0 vector 3))) - (.lvf vf4 (&-> (-> obj origin) quad)) + (.lvf vf4 (&-> (-> this origin) quad)) (.lvf vf5 (&-> sv-448 quad)) (.mov.vf vf6 vf0 :mask #b1000) (.sub.vf vf6 vf4 vf5 :mask #b111) @@ -300,7 +302,7 @@ ) (set! sv-464 0) (while (< sv-464 8) - (vector+! (-> s5-0 vert (+ sv-464 1)) (-> obj origin) s1-0) + (vector+! (-> s5-0 vert (+ sv-464 1)) (-> this origin) s1-0) (vector+float*! (-> s5-0 vert (+ sv-464 1)) (-> s5-0 vert (+ sv-464 1)) @@ -309,12 +311,12 @@ ) (set! sv-464 (+ sv-464 1)) ) - (set! (-> s5-0 vert 0 quad) (-> obj origin quad)) + (set! (-> s5-0 vert 0 quad) (-> this origin quad)) (vector+float*! (-> s5-0 vert 9) - (-> obj origin) - (-> obj axis) - (-> obj length) + (-> this origin) + (-> this axis) + (-> this length) ) (dotimes (s2-1 16) (dotimes (s1-1 10) @@ -334,9 +336,4 @@ 0 (none) ) - ) - - - - - + ) \ No newline at end of file diff --git a/goal_src/jak1/engine/geometry/geometry-h.gc b/goal_src/jak1/engine/geometry/geometry-h.gc index 7ba5bd1254..9f34b416f2 100644 --- a/goal_src/jak1/engine/geometry/geometry-h.gc +++ b/goal_src/jak1/engine/geometry/geometry-h.gc @@ -6,6 +6,9 @@ ;; dgos: GAME, ENGINE (defconstant MAX_CURVE_CONTROL_POINTS 256) +(defun-extern quaternion-from-two-vectors-max-angle! quaternion vector vector float quaternion) + +;; DECOMP BEGINS ;; A 3 dimensional polynomial spline with arbitrarily placed knot points ;; It's used for camera paths and similar and can be generated by offline tools. @@ -36,6 +39,4 @@ (debug-draw! (_type_) none 9) (point-past-plane? (_type_ vector) symbol 10) ) - ) - -(defun-extern quaternion-from-two-vectors-max-angle! quaternion vector vector float quaternion) + ) \ No newline at end of file diff --git a/goal_src/jak1/engine/geometry/path-h.gc b/goal_src/jak1/engine/geometry/path-h.gc index e87325335c..197b854eb7 100644 --- a/goal_src/jak1/engine/geometry/path-h.gc +++ b/goal_src/jak1/engine/geometry/path-h.gc @@ -59,17 +59,17 @@ (defmethod new path-control ((allocation symbol) (type-to-make type) (proc process) (name symbol) (time float)) (local-vars (tag res-tag)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (when (zero? obj) + (when (zero? this) ;; allocation failed. (go process-drawable-art-error "memory") - (set! obj (the-as path-control 0)) + (set! this (the-as path-control 0)) (goto cfg-9) ) - (set! (-> obj process) (the-as process-drawable proc)) - (set! (-> obj name) name) + (set! (-> this process) (the-as process-drawable proc)) + (set! (-> this name) name) (let ((ent (-> proc entity))) (when (= name 'path) ;; if we are a path, try to look up the path-actor. @@ -86,44 +86,44 @@ (cond (data ;; success, we got some data - (set! (-> obj cverts) (the-as (inline-array vector) data)) - (set! (-> obj curve num-cverts) (the-as int (-> tag elt-count))) + (set! (-> this cverts) (the-as (inline-array vector) data)) + (set! (-> this curve num-cverts) (the-as int (-> tag elt-count))) ) (else ;; did not find the data. Set flags and zero stuff - (logior! (-> obj flags) (path-control-flag not-found)) - (set! (-> obj cverts) (the-as (inline-array vector) #f)) - (set! (-> obj curve num-cverts) 0) + (logior! (-> this flags) (path-control-flag not-found)) + (set! (-> this cverts) (the-as (inline-array vector) #f)) + (set! (-> this curve num-cverts) 0) ) ) ) ) (label cfg-9) - (the-as path-control obj) + (the-as path-control this) ) ) -(defmethod should-display? path-control ((obj path-control)) +(defmethod should-display? path-control ((this path-control)) "Should we display path marks?" (and *display-path-marks* - (logtest? (-> obj flags) (path-control-flag display)) + (logtest? (-> this flags) (path-control-flag display)) ) ) -(defmethod length-as-float path-control ((obj path-control)) +(defmethod length-as-float path-control ((this path-control)) "Get the number of edges as a float" - (the float (+ (-> obj curve num-cverts) -1)) + (the float (+ (-> this curve num-cverts) -1)) ) -(defmethod get-num-verts path-control ((obj path-control)) +(defmethod get-num-verts path-control ((this path-control)) "Get the number of vertices" - (-> obj curve num-cverts) + (-> this curve num-cverts) ) (defmethod new curve-control ((allocation symbol) (type-to-make type) (proc process) (name symbol) (time float)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj process) (the-as process-drawable proc)) - (set! (-> obj name) name) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this process) (the-as process-drawable proc)) + (set! (-> this name) name) (let* ((ent (-> proc entity)) (v1-2 name) (s2-0 (cond @@ -145,22 +145,22 @@ (set! ent lookup-entity) ) ) - (when (not (get-curve-data! ent (-> obj curve) name s2-0 time)) + (when (not (get-curve-data! ent (-> this curve) name s2-0 time)) (cond - ((> (-> obj curve num-cverts) 0) + ((> (-> this curve num-cverts) 0) ;; downgrade us to a path-control, we got cverts but no knots. - (set! (-> obj type) path-control) + (set! (-> this type) path-control) ) (else ;; couldn't get anything, mark as bad. - (logior! (-> obj flags) (path-control-flag not-found)) - (set! (-> obj flags) (logior (-> obj flags) (path-control-flag not-found))) - (set! (-> obj curve cverts) (the-as (inline-array vector) #f)) - (set! (-> obj curve num-cverts) 0) + (logior! (-> this flags) (path-control-flag not-found)) + (set! (-> this flags) (logior (-> this flags) (path-control-flag not-found))) + (set! (-> this curve cverts) (the-as (inline-array vector) #f)) + (set! (-> this curve num-cverts) 0) ) ) ) ) - obj + this ) ) diff --git a/goal_src/jak1/engine/geometry/path.gc b/goal_src/jak1/engine/geometry/path.gc index 7ebd4ebdd5..726ecaaed5 100644 --- a/goal_src/jak1/engine/geometry/path.gc +++ b/goal_src/jak1/engine/geometry/path.gc @@ -7,46 +7,46 @@ ;; DECOMP BEGINS -(defmethod debug-draw path-control ((obj path-control)) +(defmethod debug-draw path-control ((this path-control)) (cond - ((logtest? (-> obj flags) (path-control-flag not-found)) - (when (and (type-type? (-> obj process type) process-drawable) *display-entity-errors*) + ((logtest? (-> this flags) (path-control-flag not-found)) + (when (and (type-type? (-> this process type) process-drawable) *display-entity-errors*) (let ((s5-0 add-debug-text-3d) (s4-0 #t) (s3-0 68) ) - (format (clear *temp-string*) "path data error in ~S" (-> obj process name)) + (format (clear *temp-string*) "path data error in ~S" (-> this process name)) (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* - (-> obj process root trans) + (-> this process root trans) (font-color red) (the-as vector2h #f) ) ) ) ) - ((let ((a0-5 obj)) + ((let ((a0-5 this)) (and *display-path-marks* (logtest? (-> a0-5 flags) (path-control-flag display))) ) - (dotimes (s5-1 (-> obj curve num-cverts)) - (let ((s4-1 (-> obj cverts s5-1))) - (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (< s5-1 (+ (-> obj curve num-cverts) -1))) + (dotimes (s5-1 (-> this curve num-cverts)) + (let ((s4-1 (-> this cverts s5-1))) + (if (and (logtest? (-> this flags) (path-control-flag draw-line)) (< s5-1 (+ (-> this curve num-cverts) -1))) (add-debug-line #t (bucket-id debug-no-zbuf) s4-1 - (-> obj cverts (+ s5-1 1)) + (-> this cverts (+ s5-1 1)) (new 'static 'rgba :r #xff :g #x80 :a #x80) #f (the-as rgba -1) ) ) - (if (logtest? (-> obj flags) (path-control-flag draw-point)) + (if (logtest? (-> this flags) (path-control-flag draw-point)) (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) - (when (logtest? (-> obj flags) (path-control-flag draw-text)) + (when (logtest? (-> this flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) (s2-1 #t) (s1-0 68) @@ -63,57 +63,57 @@ (none) ) -(defmethod path-distance path-control ((obj path-control)) +(defmethod path-distance path-control ((this path-control)) (let ((f30-0 0.0)) - (dotimes (s5-0 (+ (-> obj curve num-cverts) -1)) - (+! f30-0 (vector-vector-distance (-> obj cverts s5-0) (-> obj cverts (+ s5-0 1)))) + (dotimes (s5-0 (+ (-> this curve num-cverts) -1)) + (+! f30-0 (vector-vector-distance (-> this cverts s5-0) (-> this cverts (+ s5-0 1)))) ) f30-0 ) ) -(defmethod path-distance curve-control ((obj curve-control)) - (let ((f0-0 (-> obj curve length))) +(defmethod path-distance curve-control ((this curve-control)) + (let ((f0-0 (-> this curve length))) (when (= f0-0 0.0) - (set! f0-0 (curve-length (the-as curve (&-> obj cverts)))) - (set! (-> obj curve length) f0-0) + (set! f0-0 (curve-length (the-as curve (&-> this cverts)))) + (set! (-> this curve length) f0-0) ) f0-0 ) ) -(defmethod eval-path-curve-div! path-control ((obj path-control) (arg0 vector) (arg1 float) (arg2 symbol)) - (let ((a1-1 (-> obj curve num-cverts)) +(defmethod eval-path-curve-div! path-control ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (let ((a1-1 (-> this curve num-cverts)) (f0-3 (the float (the int arg1))) ) (cond ((< arg1 0.0) - (set! (-> arg0 quad) (-> obj cverts 0 quad)) + (set! (-> arg0 quad) (-> this cverts 0 quad)) ) ((>= f0-3 (the float (+ a1-1 -1))) - (set! (-> arg0 quad) (-> obj cverts (+ a1-1 -1) quad)) + (set! (-> arg0 quad) (-> this cverts (+ a1-1 -1) quad)) ) ((or (= arg2 'exact) (= f0-3 arg1)) - (set! (-> arg0 quad) (-> obj cverts (the int f0-3) quad)) + (set! (-> arg0 quad) (-> this cverts (the int f0-3) quad)) ) (else - (vector-lerp! arg0 (-> obj cverts (the int f0-3)) (-> obj cverts (the int (+ 1.0 f0-3))) (- arg1 f0-3)) + (vector-lerp! arg0 (-> this cverts (the int f0-3)) (-> this cverts (the int (+ 1.0 f0-3))) (- arg1 f0-3)) ) ) ) arg0 ) -(defmethod get-random-point path-control ((obj path-control) (arg0 vector)) +(defmethod get-random-point path-control ((this path-control) (arg0 vector)) (with-pp (cond - ((> (-> obj curve num-cverts) 0) - (let ((s4-0 (rand-vu-int-count (-> obj curve num-cverts)))) + ((> (-> this curve num-cverts) 0) + (let ((s4-0 (rand-vu-int-count (-> this curve num-cverts)))) (when *run-time-assert-enable* (set-pos *__private-assert-info* "path" (the-as uint 83) (the-as uint 6)) - (__assert-zero-lim-range-int s4-0 (-> obj curve num-cverts) "rand-index" "(-> obj num-cverts)") + (__assert-zero-lim-range-int s4-0 (-> this curve num-cverts) "rand-index" "(-> obj num-cverts)") ) - (set! (-> arg0 quad) (-> obj cverts s4-0 quad)) + (set! (-> arg0 quad) (-> this cverts s4-0 quad)) ) ) (else @@ -128,54 +128,54 @@ ) ) -(defmethod eval-path-curve! path-control ((obj path-control) (arg0 vector) (arg1 float) (arg2 symbol)) - (eval-path-curve-div! obj arg0 (* arg1 (the float (+ (-> obj curve num-cverts) -1))) arg2) +(defmethod eval-path-curve! path-control ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (eval-path-curve-div! this arg0 (* arg1 (the float (+ (-> this curve num-cverts) -1))) arg2) ) -(defmethod eval-path-curve! curve-control ((obj curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) - (the-as vector (if (logtest? (-> obj flags) (path-control-flag not-found)) +(defmethod eval-path-curve! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (the-as vector (if (logtest? (-> this flags) (path-control-flag not-found)) 0.0 (curve-evaluate! arg0 arg1 - (-> obj cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) ) ) ) -(defmethod eval-path-curve-div! curve-control ((obj curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) - (the-as vector (if (logtest? (-> obj flags) (path-control-flag not-found)) +(defmethod eval-path-curve-div! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (the-as vector (if (logtest? (-> this flags) (path-control-flag not-found)) 0.0 (curve-evaluate! arg0 - (/ arg1 (the float (+ (-> obj curve num-cverts) -1))) - (-> obj cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (/ arg1 (the float (+ (-> this curve num-cverts) -1))) + (-> this cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) ) ) ) -(defmethod path-control-method-12 path-control ((obj path-control) (arg0 vector) (arg1 float)) - (when (not (logtest? (-> obj flags) (path-control-flag not-found))) - (let ((v1-3 (-> obj curve num-cverts)) +(defmethod path-control-method-12 path-control ((this path-control) (arg0 vector) (arg1 float)) + (when (not (logtest? (-> this flags) (path-control-flag not-found))) + (let ((v1-3 (-> this curve num-cverts)) (f0-3 (the float (the int arg1))) ) (cond ((< v1-3 2) ) ((< arg1 0.0) - (vector-! arg0 (-> obj cverts 1) (-> obj cverts 0)) + (vector-! arg0 (-> this cverts 1) (-> this cverts 0)) ) (else (let ((f0-4 (fmin f0-3 (the float (+ v1-3 -2))))) - (vector-! arg0 (-> obj cverts (the int (+ 1.0 f0-4))) (-> obj cverts (the int f0-4))) + (vector-! arg0 (-> this cverts (the int (+ 1.0 f0-4))) (-> this cverts (the int f0-4))) ) ) ) @@ -184,30 +184,30 @@ (vector-normalize! arg0 1.0) ) -(defmethod path-control-method-14 path-control ((obj path-control) (arg0 vector) (arg1 float)) - (path-control-method-12 obj arg0 (* arg1 (the float (+ (-> obj curve num-cverts) -1)))) +(defmethod path-control-method-14 path-control ((this path-control) (arg0 vector) (arg1 float)) + (path-control-method-12 this arg0 (* arg1 (the float (+ (-> this curve num-cverts) -1)))) ) -(defmethod path-control-method-14 curve-control ((obj curve-control) (arg0 vector) (arg1 float)) - (when (not (logtest? (-> obj flags) (path-control-flag not-found))) +(defmethod path-control-method-14 curve-control ((this curve-control) (arg0 vector) (arg1 float)) + (when (not (logtest? (-> this flags) (path-control-flag not-found))) (let ((s4-0 (new 'stack-no-clear 'vector))) (curve-evaluate! arg0 arg1 - (-> obj cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) (cond ((< arg1 0.99) (curve-evaluate! s4-0 (+ 0.01 arg1) - (-> obj cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) (vector-! arg0 s4-0 arg0) ) @@ -215,10 +215,10 @@ (curve-evaluate! s4-0 (+ -0.01 arg1) - (-> obj cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) (vector-! arg0 arg0 s4-0) ) @@ -228,11 +228,11 @@ (vector-normalize! arg0 1.0) ) -(defmethod path-control-method-12 curve-control ((obj curve-control) (arg0 vector) (arg1 float)) - (path-control-method-14 obj arg0 (/ arg1 (the float (+ (-> obj curve num-cverts) -1)))) +(defmethod path-control-method-12 curve-control ((this curve-control) (arg0 vector) (arg1 float)) + (path-control-method-14 this arg0 (/ arg1 (the float (+ (-> this curve num-cverts) -1)))) ) -(defmethod path-control-method-19 path-control ((obj path-control)) +(defmethod path-control-method-19 path-control ((this path-control)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -242,11 +242,11 @@ (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 quad) (-> (target-pos 0) quad)) (set! (-> s3-0 y) 0.0) - (eval-path-curve-div! obj s4-0 0.0 'interp) + (eval-path-curve-div! this s4-0 0.0 'interp) (set! (-> s4-0 y) 0.0) - (dotimes (s1-1 (+ (-> obj curve num-cverts) -1)) + (dotimes (s1-1 (+ (-> this curve num-cverts) -1)) (set! (-> s5-0 quad) (-> s4-0 quad)) - (eval-path-curve-div! obj s4-0 (the float (+ s1-1 1)) 'interp) + (eval-path-curve-div! this s4-0 (the float (+ s1-1 1)) 'interp) (set! (-> s4-0 y) 0.0) (let ((f0-5 (vector-segment-distance-point! s3-0 s5-0 s4-0 s2-0))) (when (< f0-5 f30-0) @@ -262,48 +262,48 @@ ) ) -(defmethod path-control-method-20 path-control ((obj path-control)) - (/ (path-control-method-19 obj) (the float (+ (-> obj curve num-cverts) -1))) +(defmethod path-control-method-20 path-control ((this path-control)) + (/ (path-control-method-19 this) (the float (+ (-> this curve num-cverts) -1))) ) -(defmethod debug-draw curve-control ((obj curve-control)) +(defmethod debug-draw curve-control ((this curve-control)) (cond - ((logtest? (-> obj flags) (path-control-flag not-found)) - (when (and (type-type? (-> obj process type) process-drawable) *display-entity-errors*) + ((logtest? (-> this flags) (path-control-flag not-found)) + (when (and (type-type? (-> this process type) process-drawable) *display-entity-errors*) (let ((s5-0 add-debug-text-3d) (s4-0 #t) (s3-0 68) ) - (format (clear *temp-string*) "curve data error in ~S" (-> obj process name)) + (format (clear *temp-string*) "curve data error in ~S" (-> this process name)) (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* - (-> obj process root trans) + (-> this process root trans) (font-color red) (the-as vector2h #f) ) ) ) ) - ((let ((a0-5 obj)) + ((let ((a0-5 this)) (and *display-path-marks* (logtest? (-> a0-5 flags) (path-control-flag display))) ) - (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (> (-> obj curve num-cverts) 0)) + (if (and (logtest? (-> this flags) (path-control-flag draw-line)) (> (-> this curve num-cverts) 0)) (add-debug-curve2 #t (bucket-id debug-no-zbuf) - (the-as curve (&-> obj cverts)) + (the-as curve (&-> this cverts)) (new 'static 'rgba :r #xff :g #x80 :a #x80) #f ) ) - (dotimes (s5-1 (-> obj curve num-cverts)) - (let ((s4-1 (-> obj cverts s5-1))) - (if (logtest? (-> obj flags) (path-control-flag draw-point)) + (dotimes (s5-1 (-> this curve num-cverts)) + (let ((s4-1 (-> this cverts s5-1))) + (if (logtest? (-> this flags) (path-control-flag draw-point)) (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) - (when (logtest? (-> obj flags) (path-control-flag draw-text)) + (when (logtest? (-> this flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) (s2-1 #t) (s1-0 68) diff --git a/goal_src/jak1/engine/geometry/vol-h.gc b/goal_src/jak1/engine/geometry/vol-h.gc index 8bd94f771e..3cb5181456 100644 --- a/goal_src/jak1/engine/geometry/vol-h.gc +++ b/goal_src/jak1/engine/geometry/vol-h.gc @@ -107,6 +107,6 @@ ) ) -(defmethod vol-control-method-11 vol-control ((obj vol-control)) - (and *display-vol-marks* (logtest? (-> obj flags) 1)) +(defmethod vol-control-method-11 vol-control ((this vol-control)) + (and *display-vol-marks* (logtest? (-> this flags) 1)) ) diff --git a/goal_src/jak1/engine/geometry/vol.gc b/goal_src/jak1/engine/geometry/vol.gc index b58d746cbe..5225f7161f 100644 --- a/goal_src/jak1/engine/geometry/vol.gc +++ b/goal_src/jak1/engine/geometry/vol.gc @@ -18,7 +18,7 @@ ) ) -(defmethod init-vol! plane-volume ((obj plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) +(defmethod init-vol! plane-volume ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) (local-vars (sv-144 vector) (sv-148 float) @@ -31,12 +31,12 @@ (sv-240 int) (sv-256 int) ) - (set! (-> obj volume-type) arg0) - (set! (-> obj point-count) 0) - (set! (-> obj first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) - (set! (-> obj normal-count) 0) - (set! (-> obj first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) - (dotimes (s3-0 (-> obj num-planes)) + (set! (-> this volume-type) arg0) + (set! (-> this point-count) 0) + (set! (-> this first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) + (set! (-> this normal-count) 0) + (set! (-> this first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) + (dotimes (s3-0 (-> this num-planes)) (set! sv-176 (new 'stack-no-clear 'vector)) (set! (-> sv-176 quad) (the-as uint128 0)) (set! sv-192 (new 'stack-no-clear 'vector)) @@ -51,10 +51,10 @@ (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (let ((s1-0 (new-stack-vector0)) (s0-0 0) - (s2-0 (-> obj plane)) + (s2-0 (-> this plane)) ) (set! sv-240 0) - (while (< sv-240 (-> obj num-planes)) + (while (< sv-240 (-> this num-planes)) (when (!= s3-0 sv-240) (vector-float*! sv-176 (the-as vector (-> s2-0 sv-240)) (-> s2-0 sv-240 w)) (vector-cross! sv-192 (the-as vector (-> s2-0 sv-240)) (the-as vector (-> s2-0 s3-0))) @@ -70,7 +70,7 @@ (set! sv-160 (new-stack-vector0)) (set! (-> sv-144 quad) (-> sv-224 quad)) (set! sv-256 0) - (while (< sv-256 (-> obj num-planes)) + (while (< sv-256 (-> this num-planes)) (when (and (!= sv-256 s3-0) (!= sv-256 sv-240)) (let ((f30-0 (plane-volume-intersect-dist (-> s2-0 sv-256) sv-144 sv-192))) (cond @@ -110,7 +110,7 @@ ((= sv-148 0.0) ) (else - (dotimes (v1-70 (-> obj num-planes)) + (dotimes (v1-70 (-> this num-planes)) (when (and (!= v1-70 s3-0) (!= v1-70 sv-240)) (if (< 4096.0 (- (vector-dot sv-144 (the-as vector (-> s2-0 v1-70))) (the-as float (-> s2-0 v1-70 w)))) (goto cfg-42) @@ -120,13 +120,13 @@ (vector+float*! sv-224 sv-144 sv-192 sv-148) (cond ((< (-> arg1 allocated-length) (+ (-> arg1 length) 2)) - (format 0 "ERROR : vol-control #x~X out of volume points~%" obj) + (format 0 "ERROR : vol-control #x~X out of volume points~%" this) ) (else (set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad)) (set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad)) (+! (-> arg1 length) 2) - (+! (-> obj point-count) 2) + (+! (-> this point-count) 2) ) ) (vector+! s1-0 s1-0 sv-144) @@ -144,13 +144,13 @@ (vector-float*! s1-0 s1-0 (/ 1.0 (the float s0-0))) (cond ((< (-> arg2 allocated-length) (+ (-> arg2 length) 2)) - (format 0 "ERROR : vol-control #x~X out of volume normals~%" obj) + (format 0 "ERROR : vol-control #x~X out of volume normals~%" this) ) (else (set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad)) (set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad)) (+! (-> arg2 length) 2) - (set! (-> obj normal-count) (+ (-> obj normal-count) 2)) + (set! (-> this normal-count) (+ (-> this normal-count) 2)) ) ) ) @@ -159,8 +159,8 @@ #f ) -(defmethod debug-draw plane-volume ((obj plane-volume)) - (let* ((v1-0 (-> obj volume-type)) +(defmethod debug-draw plane-volume ((this plane-volume)) + (let* ((v1-0 (-> this volume-type)) (s5-0 (cond ((= v1-0 'vol) (the-as uint #x8000c000) @@ -173,9 +173,9 @@ ) ) ) - (s4-0 (-> obj first-point)) + (s4-0 (-> this first-point)) ) - (dotimes (s3-0 (/ (-> obj point-count) 2)) + (dotimes (s3-0 (/ (-> this point-count) 2)) (add-debug-line #t (bucket-id debug-no-zbuf) @@ -192,48 +192,48 @@ (none) ) -(defmethod point-in-vol? plane-volume ((obj plane-volume) (arg0 vector) (arg1 float)) - (dotimes (v1-0 (-> obj num-planes)) - (if (< arg1 (- (vector-dot arg0 (the-as vector (-> obj plane v1-0))) (the-as float (-> obj plane v1-0 w)))) +(defmethod point-in-vol? plane-volume ((this plane-volume) (arg0 vector) (arg1 float)) + (dotimes (v1-0 (-> this num-planes)) + (if (< arg1 (- (vector-dot arg0 (the-as vector (-> this plane v1-0))) (the-as float (-> this plane v1-0 w)))) (return #f) ) ) #t ) -(defmethod init! vol-control ((obj vol-control)) +(defmethod init! vol-control ((this vol-control)) (with-pp - (let ((a0-1 obj)) - (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) 1)) (logtest? (-> obj flags) 2)) - (when (zero? (-> obj debug-point)) + (let ((a0-1 this)) + (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) 1)) (logtest? (-> this flags) 2)) + (when (zero? (-> this debug-point)) (let ((s5-0 pp)) - (set! pp (-> obj process)) + (set! pp (-> this process)) (let ((s4-0 0)) - (dotimes (v1-8 (-> obj pos-vol-count)) - (+! s4-0 (-> obj pos-vol v1-8 num-planes)) + (dotimes (v1-8 (-> this pos-vol-count)) + (+! s4-0 (-> this pos-vol v1-8 num-planes)) ) - (dotimes (v1-11 (-> obj neg-vol-count)) - (+! s4-0 (-> obj neg-vol v1-11 num-planes)) + (dotimes (v1-11 (-> this neg-vol-count)) + (+! s4-0 (-> this neg-vol v1-11 num-planes)) ) - (set! (-> obj debug-point) (new 'debug 'vector-array (* 10 s4-0))) - (set! (-> obj debug-normal) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> this debug-point) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> this debug-normal) (new 'debug 'vector-array (* 10 s4-0))) ) (set! pp s5-0) ) - (set! (-> obj debug-point length) 0) - (set! (-> obj debug-normal length) 0) - (dotimes (s5-1 (-> obj pos-vol-count)) - (init-vol! (-> obj pos-vol s5-1) 'vol (-> obj debug-point) (-> obj debug-normal)) + (set! (-> this debug-point length) 0) + (set! (-> this debug-normal length) 0) + (dotimes (s5-1 (-> this pos-vol-count)) + (init-vol! (-> this pos-vol s5-1) 'vol (-> this debug-point) (-> this debug-normal)) ) - (dotimes (s5-2 (-> obj neg-vol-count)) - (init-vol! (-> obj neg-vol s5-2) 'vol (-> obj debug-point) (-> obj debug-normal)) + (dotimes (s5-2 (-> this neg-vol-count)) + (init-vol! (-> this neg-vol s5-2) 'vol (-> this debug-point) (-> this debug-normal)) ) ) - (dotimes (s5-3 (-> obj pos-vol-count)) - (debug-draw (-> obj pos-vol s5-3)) + (dotimes (s5-3 (-> this pos-vol-count)) + (debug-draw (-> this pos-vol s5-3)) ) - (dotimes (s5-4 (-> obj neg-vol-count)) - (debug-draw (-> obj neg-vol s5-4)) + (dotimes (s5-4 (-> this neg-vol-count)) + (debug-draw (-> this neg-vol s5-4)) ) ) ) @@ -241,14 +241,14 @@ ) ) -(defmethod point-in-vol? vol-control ((obj vol-control) (arg0 vector)) - (dotimes (s4-0 (-> obj neg-vol-count)) - (if (point-in-vol? (-> obj neg-vol s4-0) arg0 0.0) +(defmethod point-in-vol? vol-control ((this vol-control) (arg0 vector)) + (dotimes (s4-0 (-> this neg-vol-count)) + (if (point-in-vol? (-> this neg-vol s4-0) arg0 0.0) (return #f) ) ) - (dotimes (s4-1 (-> obj pos-vol-count)) - (if (point-in-vol? (-> obj pos-vol s4-1) arg0 0.0) + (dotimes (s4-1 (-> this pos-vol-count)) + (if (point-in-vol? (-> this pos-vol s4-1) arg0 0.0) (return #t) ) ) diff --git a/goal_src/jak1/engine/gfx/background/background-h.gc b/goal_src/jak1/engine/gfx/background/background-h.gc index f06c071cfd..4da287dab1 100644 --- a/goal_src/jak1/engine/gfx/background/background-h.gc +++ b/goal_src/jak1/engine/gfx/background/background-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: background-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (deftype background-work (basic) ((tfrag-tree-count int32 :offset-assert 4) (tfrag-trees drawable-tree-tfrag 8 :offset-assert 8) diff --git a/goal_src/jak1/engine/gfx/background/prototype-h.gc b/goal_src/jak1/engine/gfx/background/prototype-h.gc index d0a210e652..5ff4660814 100644 --- a/goal_src/jak1/engine/gfx/background/prototype-h.gc +++ b/goal_src/jak1/engine/gfx/background/prototype-h.gc @@ -7,6 +7,8 @@ ;; The "prototype" system is used for instanced background rendering (shrub and tie). +;; DECOMP BEGINS + ;; The first type is the bucket. There's one bucket per prototype which collects instances. ;; Each prototype can have up to 4 geometries (level of details). Lower numbers are higher detail. ;; During drawing, the engine will build linked lists of instance data. Each instance will pick diff --git a/goal_src/jak1/engine/gfx/background/prototype.gc b/goal_src/jak1/engine/gfx/background/prototype.gc index 92bfe11ea8..9bf2c4d083 100644 --- a/goal_src/jak1/engine/gfx/background/prototype.gc +++ b/goal_src/jak1/engine/gfx/background/prototype.gc @@ -7,9 +7,11 @@ ;; shared code for the tie and shrub prototypes -(defmethod login prototype-array-tie ((obj prototype-array-tie)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj array-data s5-0))) +;; DECOMP BEGINS + +(defmethod login prototype-array-tie ((this prototype-array-tie)) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this array-data s5-0))) (dotimes (s3-0 4) (let ((a0-1 (-> s4-0 geometry s3-0))) (if (nonzero? a0-1) @@ -35,9 +37,9 @@ (none) ) -(defmethod login prototype-inline-array-shrub ((obj prototype-inline-array-shrub)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) +(defmethod login prototype-inline-array-shrub ((this prototype-inline-array-shrub)) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (dotimes (s3-0 4) (let ((a0-1 (-> s4-0 geometry s3-0))) (if (nonzero? a0-1) @@ -47,26 +49,26 @@ ) ) ) - obj + this ) -(defmethod mem-usage prototype-array-tie ((obj prototype-array-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-array-tie ((this prototype-array-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) - (let ((v1-8 (asize-of obj))) + (let ((v1-8 (asize-of this))) (+! (-> arg0 data 0 used) v1-8) (+! (-> arg0 data 0 total) (logand -16 (+ v1-8 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj array-data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this array-data s3-0) arg0 arg1) ) - obj + this ) -(defmethod mem-usage prototype-bucket-tie ((obj prototype-bucket-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-bucket-tie ((this prototype-bucket-tie) (arg0 memory-usage-block) (arg1 int)) (dotimes (s3-0 4) - (let ((a0-1 (-> obj geometry s3-0))) + (let ((a0-1 (-> this geometry s3-0))) (if (nonzero? a0-1) (mem-usage a0-1 arg0 (logior arg1 1)) ) @@ -75,40 +77,40 @@ (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (+! (-> arg0 data 80 count) 1) - (let ((v1-13 ((method-of-type string asize-of) (the-as string (-> obj name))))) + (let ((v1-13 ((method-of-type string asize-of) (the-as string (-> this name))))) (+! (-> arg0 data 80 used) v1-13) (+! (-> arg0 data 80 total) (logand -16 (+ v1-13 15))) ) - (when (nonzero? (-> obj tie-colors)) + (when (nonzero? (-> this tie-colors)) (set! (-> arg0 length) (max 17 (-> arg0 length))) (set! (-> arg0 data 16 name) "tie-pal") (+! (-> arg0 data 16 count) 1) - (let ((v1-25 (asize-of (-> obj tie-colors)))) + (let ((v1-25 (asize-of (-> this tie-colors)))) (+! (-> arg0 data 16 used) v1-25) (+! (-> arg0 data 16 total) (logand -16 (+ v1-25 15))) ) ) - (if (nonzero? (-> obj collide-frag)) - (mem-usage (-> obj collide-frag) arg0 (logior arg1 1)) + (if (nonzero? (-> this collide-frag)) + (mem-usage (-> this collide-frag) arg0 (logior arg1 1)) ) - obj + this ) -(defmethod mem-usage prototype-inline-array-shrub ((obj prototype-inline-array-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-inline-array-shrub ((this prototype-inline-array-shrub) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) - (let ((v1-8 (asize-of obj))) + (let ((v1-8 (asize-of this))) (+! (-> arg0 data 0 used) v1-8) (+! (-> arg0 data 0 total) (logand -16 (+ v1-8 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod mem-usage prototype-bucket-shrub ((obj prototype-bucket-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-bucket-shrub ((this prototype-bucket-shrub) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 25 (-> arg0 length))) (set! (-> arg0 data 24 name) "prototype-bucket-shrub") (+! (-> arg0 data 24 count) 1) @@ -117,7 +119,7 @@ (+! (-> arg0 data 24 total) (logand -16 (+ v1-5 15))) ) (dotimes (s3-0 4) - (let ((a0-5 (-> obj geometry s3-0))) + (let ((a0-5 (-> this geometry s3-0))) (if (nonzero? a0-5) (mem-usage a0-5 arg0 (logior arg1 1)) ) @@ -126,13 +128,9 @@ (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (+! (-> arg0 data 80 count) 1) - (let ((v1-22 ((method-of-type string asize-of) (the-as string (-> obj name))))) + (let ((v1-22 ((method-of-type string asize-of) (the-as string (-> this name))))) (+! (-> arg0 data 80 used) v1-22) (+! (-> arg0 data 80 total) (logand -16 (+ v1-22 15))) ) - obj + this ) - - - - diff --git a/goal_src/jak1/engine/gfx/background/subdivide-h.gc b/goal_src/jak1/engine/gfx/background/subdivide-h.gc index 6a3ed04875..24328ecdf3 100644 --- a/goal_src/jak1/engine/gfx/background/subdivide-h.gc +++ b/goal_src/jak1/engine/gfx/background/subdivide-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: subdivide-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (deftype subdivide-settings (basic) ((dist float 5 :offset-assert 4) (meters float 5 :offset-assert 24) diff --git a/goal_src/jak1/engine/gfx/background/subdivide.gc b/goal_src/jak1/engine/gfx/background/subdivide.gc index d7a7583c6d..7e29979211 100644 --- a/goal_src/jak1/engine/gfx/background/subdivide.gc +++ b/goal_src/jak1/engine/gfx/background/subdivide.gc @@ -8,6 +8,8 @@ ;; This file mainly contains statistics stuff for the background renderers. ;; And the mysterious "gomi stats hack", abbreviated GSH. +;; DECOMP BEGINS + (define *merc-global-stats* (new 'global 'merc-global-stats)) (defun clear-tr-stat ((arg0 tr-stat)) @@ -184,20 +186,20 @@ ;; oops, this runs even when not debugging and ends up on global. (define *perf-stats* (new 'debug 'perf-stat-array 17)) -(defmethod print-to-stream perf-stat ((obj perf-stat) (arg0 string) (arg1 basic)) +(defmethod print-to-stream perf-stat ((this perf-stat) (arg0 string) (arg1 basic)) "Print performance info to a stream. But the stream is ignored and it is printed to the screen." (format *stdcon* "~3d ~8d ~8d ~6d ~6d" - (-> obj count) - (-> obj cycles) - (-> obj instructions) - 0 ;; (-> obj icache) removed, doesn't work on pc - 0 ;; (-> obj dcache) removed, doesn't work on pc + (-> this count) + (-> this cycles) + (-> this instructions) + 0 ;; (-> this icache) removed, doesn't work on pc + 0 ;; (-> this dcache) removed, doesn't work on pc ) (format *stdcon* " ~2d ~2d ~2d" - (-> obj to-vu0-waits) - (-> obj to-spr-waits) - (-> obj from-spr-waits) + (-> this to-vu0-waits) + (-> this to-spr-waits) + (-> this from-spr-waits) ) (format *stdcon* " ~s~%" arg0) (none) diff --git a/goal_src/jak1/engine/gfx/background/wind-h.gc b/goal_src/jak1/engine/gfx/background/wind-h.gc index aa66bbc04b..4916acdbdb 100644 --- a/goal_src/jak1/engine/gfx/background/wind-h.gc +++ b/goal_src/jak1/engine/gfx/background/wind-h.gc @@ -8,6 +8,8 @@ ;; These "wind" types are used in the tie/shrub renderers to make things sway in the breeze. ;; It generates vectors that are applied as shear to the instance matrices. +;; DECOMP BEGINS + (deftype wind-vector (structure) ((wind-pos vector2w :inline :offset-assert 0) (wind-vel vector2w :inline :offset-assert 8) diff --git a/goal_src/jak1/engine/gfx/depth-cue-h.gc b/goal_src/jak1/engine/gfx/depth-cue-h.gc index 925c8e5c89..bace787113 100644 --- a/goal_src/jak1/engine/gfx/depth-cue-h.gc +++ b/goal_src/jak1/engine/gfx/depth-cue-h.gc @@ -5,6 +5,7 @@ ;; name in dgo: depth-cue-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS (deftype depth-cue-data (structure) ((data vector :inline :offset-assert 0) diff --git a/goal_src/jak1/engine/gfx/font-h.gc b/goal_src/jak1/engine/gfx/font-h.gc index 62c5316884..7b03989d94 100644 --- a/goal_src/jak1/engine/gfx/font-h.gc +++ b/goal_src/jak1/engine/gfx/font-h.gc @@ -8,6 +8,8 @@ ;; The font system draws all of the strings. ;; The font textures live in the upper 8 bits of the 24-bit texture format depth buffer. +;; DECOMP BEGINS + (defenum font-color :type uint64 (default 0) @@ -124,129 +126,129 @@ ;; I don't believe these methods are called, so they might be inlined -(defmethod set-mat! font-context ((obj font-context) (mat matrix)) +(defmethod set-mat! font-context ((this font-context) (mat matrix)) (declare (inline)) - (set! (-> obj mat) mat) - obj + (set! (-> this mat) mat) + this ) -(defmethod set-origin! font-context ((obj font-context) (x int) (y int)) +(defmethod set-origin! font-context ((this font-context) (x int) (y int)) (declare (inline)) - (set! (-> obj origin x) (the float x)) - (set! (-> obj origin y) (the float y)) - obj + (set! (-> this origin x) (the float x)) + (set! (-> this origin y) (the float y)) + this ) -(defmethod set-depth! font-context ((obj font-context) (z int)) +(defmethod set-depth! font-context ((this font-context) (z int)) (declare (inline)) - (set! (-> obj origin z) (the float z)) - obj + (set! (-> this origin z) (the float z)) + this ) -(defmethod set-w! font-context ((obj font-context) (w float)) +(defmethod set-w! font-context ((this font-context) (w float)) (declare (inline)) - (set! (-> obj origin w) w) - obj + (set! (-> this origin w) w) + this ) -(defmethod set-width! font-context ((obj font-context) (width int)) +(defmethod set-width! font-context ((this font-context) (width int)) (declare (inline)) - (set! (-> obj width) (the float width)) - obj + (set! (-> this width) (the float width)) + this ) -(defmethod set-height! font-context ((obj font-context) (height int)) +(defmethod set-height! font-context ((this font-context) (height int)) (declare (inline)) - (set! (-> obj height) (the float height)) - obj + (set! (-> this height) (the float height)) + this ) -(defmethod set-projection! font-context ((obj font-context) (proj float)) +(defmethod set-projection! font-context ((this font-context) (proj float)) (declare (inline)) - (set! (-> obj projection) proj) - obj + (set! (-> this projection) proj) + this ) -(defmethod set-color! font-context ((obj font-context) (color font-color)) +(defmethod set-color! font-context ((this font-context) (color font-color)) (declare (inline)) - (set! (-> obj color) color) - obj + (set! (-> this color) color) + this ) -(defmethod set-flags! font-context ((obj font-context) (flags font-flags)) +(defmethod set-flags! font-context ((this font-context) (flags font-flags)) (declare (inline)) - (set! (-> obj flags) flags) - obj + (set! (-> this flags) flags) + this ) -(defmethod set-start-line! font-context ((obj font-context) (start-line uint)) +(defmethod set-start-line! font-context ((this font-context) (start-line uint)) (declare (inline)) - (set! (-> obj start-line) start-line) - obj + (set! (-> this start-line) start-line) + this ) -(defmethod set-scale! font-context ((obj font-context) (scale float)) +(defmethod set-scale! font-context ((this font-context) (scale float)) (declare (inline)) - (set! (-> obj scale) scale) - obj + (set! (-> this scale) scale) + this ) (defmethod new font-context ((allocation symbol) (type-to-make type) (mat matrix) (x int) (y int) (z float) (color font-color) (flags font-flags)) (let - ((obj + ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))) ) ) - (set! (-> obj mat) mat) - (let ((v1-3 obj)) + (set! (-> this mat) mat) + (let ((v1-3 this)) (set! (-> v1-3 origin x) (the float x)) (set! (-> v1-3 origin y) (the float y)) ) (cond ((= z 0.0) - (let ((v1-4 obj)) + (let ((v1-4 this)) (set! (-> v1-4 origin z) (-> *math-camera* isometric vector 3 z)) ;;(format #t "fc: ~F~%" (-> v1-4 origin z)) ) ) (else - (let ((v1-5 obj)) + (let ((v1-5 this)) (set! (-> v1-5 origin z) z) ) ) ) - (let ((v1-6 obj)) + (let ((v1-6 this)) (set! (-> v1-6 origin w) 1.0) ) - (let ((v1-7 obj)) + (let ((v1-7 this)) (set! (-> v1-7 width) (the float 512)) ) - (let ((v1-8 obj)) + (let ((v1-8 this)) (set! (-> v1-8 height) (the float 256)) ) - (let ((v1-9 obj)) + (let ((v1-9 this)) (set! (-> v1-9 projection) 1.0) ) - (set! (-> obj color) color) - (set! (-> obj flags) flags) - (let ((a0-4 obj)) + (set! (-> this color) color) + (set! (-> this flags) flags) + (let ((a0-4 this)) (set! (-> a0-4 start-line) (the-as uint 0)) ) - (let ((v1-13 obj)) + (let ((v1-13 this)) (set! (-> v1-13 scale) 1.0) ) - obj + this ) ) diff --git a/goal_src/jak1/engine/gfx/foreground/bones-h.gc b/goal_src/jak1/engine/gfx/foreground/bones-h.gc index d0a6b7052c..3edaa30efa 100644 --- a/goal_src/jak1/engine/gfx/foreground/bones-h.gc +++ b/goal_src/jak1/engine/gfx/foreground/bones-h.gc @@ -9,6 +9,8 @@ ;; It looks like it also expanded to do most of the DMA generation ;; for the foreground renderers. +;; DECOMP BEGINS + (deftype bone-buffer (structure) ((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0) (bone bone 16 :inline :offset-assert 1024) diff --git a/goal_src/jak1/engine/gfx/foreground/eye-h.gc b/goal_src/jak1/engine/gfx/foreground/eye-h.gc index c7a3bfb7a7..91c8138a14 100644 --- a/goal_src/jak1/engine/gfx/foreground/eye-h.gc +++ b/goal_src/jak1/engine/gfx/foreground/eye-h.gc @@ -70,9 +70,3 @@ (set! (-> *eye-control-array* data v1-5 random-time) (the-as uint 60)) (set! (-> *eye-control-array* data v1-5 blink) 0.0) ) - -0 - - - - diff --git a/goal_src/jak1/engine/gfx/foreground/ripple.gc b/goal_src/jak1/engine/gfx/foreground/ripple.gc index 251666ee76..63ba0ec14b 100644 --- a/goal_src/jak1/engine/gfx/foreground/ripple.gc +++ b/goal_src/jak1/engine/gfx/foreground/ripple.gc @@ -8,6 +8,8 @@ (define-extern ripple-create-wave-table (function ripple-wave-set int)) (define-extern ripple-apply-wave-table (function merc-effect symbol)) +;; DECOMP BEGINS + (deftype ripple-request (structure) ((waveform ripple-wave :offset-assert 0) (effect merc-effect :offset-assert 4) diff --git a/goal_src/jak1/engine/gfx/generic/generic-h.gc b/goal_src/jak1/engine/gfx/generic/generic-h.gc index efb986982b..1e7a5c2316 100644 --- a/goal_src/jak1/engine/gfx/generic/generic-h.gc +++ b/goal_src/jak1/engine/gfx/generic/generic-h.gc @@ -26,6 +26,7 @@ ;; - shrub will use generic for scissoring ;; - tie will use generic for envmap +;; DECOMP BEGINS ;; gsf, what does it stand for? (deftype gsf-vertex (structure) diff --git a/goal_src/jak1/engine/gfx/generic/generic-merc.gc b/goal_src/jak1/engine/gfx/generic/generic-merc.gc index 4240cfb61b..31b3c35bbc 100644 --- a/goal_src/jak1/engine/gfx/generic/generic-merc.gc +++ b/goal_src/jak1/engine/gfx/generic/generic-merc.gc @@ -5,6 +5,8 @@ ;; name in dgo: generic-merc ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (define mercneric-vu0-block (new 'static 'vu-function :length #x0 :origin #x0 :qlength #x0)) (deftype invinitdata (structure) @@ -18,12 +20,12 @@ :flag-assert #x900000004 ) -(defmethod inspect invinitdata ((obj invinitdata)) - (format #t "[~8x] ~A~%" obj 'invinitdata) - (format #t "~Tcount: ~D~%" (-> obj count)) - (format #t "~Tinit-data: ~D~%" (-> obj init-data)) - (format #t "~Tinit-addr: ~D~%" (-> obj init-addr)) - obj +(defmethod inspect invinitdata ((this invinitdata)) + (format #t "[~8x] ~A~%" this 'invinitdata) + (format #t "~Tcount: ~D~%" (-> this count)) + (format #t "~Tinit-data: ~D~%" (-> this init-data)) + (format #t "~Tinit-addr: ~D~%" (-> this init-addr)) + this ) (define *inv-init-table* (new 'static 'inline-array invinitdata 8 @@ -200,6 +202,3 @@ ;; (format 0 "[GMERC] made it to the end of generic-merc-execute-all.~%") (none) ) - - - diff --git a/goal_src/jak1/engine/gfx/generic/generic-vu1-h.gc b/goal_src/jak1/engine/gfx/generic/generic-vu1-h.gc index 2226e74de6..3c208a8d25 100644 --- a/goal_src/jak1/engine/gfx/generic/generic-vu1-h.gc +++ b/goal_src/jak1/engine/gfx/generic/generic-vu1-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: generic-vu1-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; "pris" refers to foreground drawing, with normals. (deftype pris-mtx (structure) ((data float 32 :offset 0) @@ -48,4 +50,3 @@ ) (defun-extern generic-init-buf dma-buffer int gs-zbuf none) - diff --git a/goal_src/jak1/engine/gfx/generic/generic-work-h.gc b/goal_src/jak1/engine/gfx/generic/generic-work-h.gc index 619366b20d..dd009f28e3 100644 --- a/goal_src/jak1/engine/gfx/generic/generic-work-h.gc +++ b/goal_src/jak1/engine/gfx/generic/generic-work-h.gc @@ -7,6 +7,8 @@ ;; common types for internal generic work. +;; DECOMP BEGINS + (deftype generic-input-buffer (structure) ((merc generic-merc-work :inline :offset 0) (tie generic-tie-work :inline :offset 0) diff --git a/goal_src/jak1/engine/gfx/hw/display-h.gc b/goal_src/jak1/engine/gfx/hw/display-h.gc index daf9cd6b51..6e5cace6b0 100644 --- a/goal_src/jak1/engine/gfx/hw/display-h.gc +++ b/goal_src/jak1/engine/gfx/hw/display-h.gc @@ -10,6 +10,8 @@ ;; the double buffered rendering system. ;; The *display* global will hold the main display state, including the DMA buffers for each of the two frames +;; DECOMP BEGINS + ;; display-env stores the GS settings for displaying a framebuffer on screen. ;; this is identical to the Sony sceGsDispEnv struct. ;; you can set one of these up with set-display-env, then use it with @@ -92,16 +94,16 @@ (defmethod new display-frame ((allocation symbol) (type-to-make type)) "Allocate a new display frame" - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj calc-buf) (the-as dma-buffer 0)) - (set! (-> obj global-buf) (the-as dma-buffer 0)) - (set! (-> obj debug-buf) (the-as dma-buffer 0)) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this calc-buf) (the-as dma-buffer 0)) + (set! (-> this global-buf) (the-as dma-buffer 0)) + (set! (-> this debug-buf) (the-as dma-buffer 0)) ;; allocate profile-bars in the debug heap, if we're debugging. (when *debug-segment* - (set! (-> obj profile-bar 0) (new 'debug 'profile-bar)) - (set! (-> obj profile-bar 1) (new 'debug 'profile-bar)) + (set! (-> this profile-bar 0) (new 'debug 'profile-bar)) + (set! (-> this profile-bar 1) (new 'debug 'profile-bar)) ) - obj + this ) ) @@ -184,49 +186,49 @@ (define-extern set-display (function display int int int int int display)) (defmethod new display ((allocation symbol) (type-to-make type) (psm int) (w int) (h int) (ztest int) (zpsm int)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) ;; set the display size, texture format, zbuffer format, etc. - (set-display obj psm w h ztest zpsm) + (set-display this psm w h ztest zpsm) ;; set up frames. for the most part only the first 2 make sense, and ;; the rest have repeats. - (set! (-> obj frames 0 display) (-> obj display-env0)) - (set! (-> obj frames 1 display) (-> obj display-env1)) - (set! (-> obj frames 2 display) (-> obj display-env2)) - (set! (-> obj frames 3 display) (-> obj display-env0)) - (set! (-> obj frames 4 display) (-> obj display-env1)) - (set! (-> obj frames 5 display) (-> obj display-env2)) - (set! (-> obj frames 0 display-last) (-> obj display-env2)) - (set! (-> obj frames 1 display-last) (-> obj display-env0)) - (set! (-> obj frames 2 display-last) (-> obj display-env1)) - (set! (-> obj frames 3 display-last) (-> obj display-env2)) - (set! (-> obj frames 4 display-last) (-> obj display-env0)) - (set! (-> obj frames 5 display-last) (-> obj display-env1)) - (set! (-> obj frames 0 gif) (&-> obj gif-tag0 qword)) - (set! (-> obj frames 1 gif) (&-> obj gif-tag1 qword)) - (set! (-> obj frames 2 gif) (&-> obj gif-tag2 qword)) - (set! (-> obj frames 3 gif) (&-> obj gif-tag0 qword)) - (set! (-> obj frames 4 gif) (&-> obj gif-tag1 qword)) - (set! (-> obj frames 5 gif) (&-> obj gif-tag2 qword)) - (set! (-> obj frames 0 draw) (-> obj draw0)) - (set! (-> obj frames 1 draw) (-> obj draw1)) - (set! (-> obj frames 2 draw) (-> obj draw2)) - (set! (-> obj frames 3 draw) (-> obj draw0)) - (set! (-> obj frames 4 draw) (-> obj draw1)) - (set! (-> obj frames 5 draw) (-> obj draw2)) - (set! (-> obj frames 0 frame) (new 'global 'display-frame)) - (set! (-> obj frames 1 frame) (new 'global 'display-frame)) - (set! (-> obj frames 2 frame) (-> obj frames 0 frame)) - (set! (-> obj frames 3 frame) (-> obj frames 1 frame)) - (set! (-> obj frames 4 frame) (-> obj frames 0 frame)) - (set! (-> obj frames 5 frame) (-> obj frames 1 frame)) + (set! (-> this frames 0 display) (-> this display-env0)) + (set! (-> this frames 1 display) (-> this display-env1)) + (set! (-> this frames 2 display) (-> this display-env2)) + (set! (-> this frames 3 display) (-> this display-env0)) + (set! (-> this frames 4 display) (-> this display-env1)) + (set! (-> this frames 5 display) (-> this display-env2)) + (set! (-> this frames 0 display-last) (-> this display-env2)) + (set! (-> this frames 1 display-last) (-> this display-env0)) + (set! (-> this frames 2 display-last) (-> this display-env1)) + (set! (-> this frames 3 display-last) (-> this display-env2)) + (set! (-> this frames 4 display-last) (-> this display-env0)) + (set! (-> this frames 5 display-last) (-> this display-env1)) + (set! (-> this frames 0 gif) (&-> this gif-tag0 qword)) + (set! (-> this frames 1 gif) (&-> this gif-tag1 qword)) + (set! (-> this frames 2 gif) (&-> this gif-tag2 qword)) + (set! (-> this frames 3 gif) (&-> this gif-tag0 qword)) + (set! (-> this frames 4 gif) (&-> this gif-tag1 qword)) + (set! (-> this frames 5 gif) (&-> this gif-tag2 qword)) + (set! (-> this frames 0 draw) (-> this draw0)) + (set! (-> this frames 1 draw) (-> this draw1)) + (set! (-> this frames 2 draw) (-> this draw2)) + (set! (-> this frames 3 draw) (-> this draw0)) + (set! (-> this frames 4 draw) (-> this draw1)) + (set! (-> this frames 5 draw) (-> this draw2)) + (set! (-> this frames 0 frame) (new 'global 'display-frame)) + (set! (-> this frames 1 frame) (new 'global 'display-frame)) + (set! (-> this frames 2 frame) (-> this frames 0 frame)) + (set! (-> this frames 3 frame) (-> this frames 1 frame)) + (set! (-> this frames 4 frame) (-> this frames 0 frame)) + (set! (-> this frames 5 frame) (-> this frames 1 frame)) ;; do this again. just in case. (default-buffer-init *default-regs-buffer*) ;; set the default gray color. - (set! (-> obj bg-clear-color 0) (static-rgba #x80 #x80 #x80 #x80)) - (set! (-> obj bg-clear-color 1) (static-rgba #x80 #x80 #x80 #x80)) - (set! (-> obj bg-clear-color 2) (static-rgba #x80 #x80 #x80 #x80)) - (set! (-> obj bg-clear-color 3) (static-rgba #x80 #x80 #x80 #x80)) - obj + (set! (-> this bg-clear-color 0) (static-rgba #x80 #x80 #x80 #x80)) + (set! (-> this bg-clear-color 1) (static-rgba #x80 #x80 #x80 #x80)) + (set! (-> this bg-clear-color 2) (static-rgba #x80 #x80 #x80 #x80)) + (set! (-> this bg-clear-color 3) (static-rgba #x80 #x80 #x80 #x80)) + this ) ) @@ -250,6 +252,17 @@ `(-> *display* real-frame-counter) ) +(defmacro seconds-per-frame () + `(-> *display* seconds-per-frame) + ) + +(defmacro set-time! (time) + `(set! ,time (current-time)) + ) + +(defmacro time-elapsed? (time duration) + `(>= (- (current-time) ,time) ,duration) + ) ;; debug stuff really (defmacro get-screen-x (frac) diff --git a/goal_src/jak1/engine/gfx/hw/display.gc b/goal_src/jak1/engine/gfx/hw/display.gc index 3bfa114740..a869585ace 100644 --- a/goal_src/jak1/engine/gfx/hw/display.gc +++ b/goal_src/jak1/engine/gfx/hw/display.gc @@ -5,7 +5,6 @@ ;; name in dgo: display ;; dgos: GAME, ENGINE - (defconstant DMA_BUFFER_GLOBAL_SIZE (#if (not PC_PORT) (* 1712 1024) ;; 1712K (* PROCESS_HEAP_MULT 2664 1024))) ;; 2600K x actor heap increase (usually 3x) @@ -13,6 +12,8 @@ (* 8 1024 1024) ;; 8M (* 16 1024 1024))) ;; 16M +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; TIME ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -33,42 +34,42 @@ ) -(defmethod set-time-ratios display ((obj display) (slowdown float)) +(defmethod set-time-ratios display ((this display) (slowdown float)) "Set the time ratios for the current game speed. For example, set slowdown = 1.0 if the game is running at full speed or slowdown = 2.0 if the game is running at half speed." ;; don't allow slowdowns of more than 4x. This prevents the dt's in the physics ;; calculations from getting huge. (let ((ratio (fmin 4.0 slowdown))) - (set! (-> obj time-ratio) ratio) + (set! (-> this time-ratio) ratio) (case (get-video-mode) (('pal) - (set! (-> obj time-adjust-ratio) (* 1.2 ratio)) - (set! (-> obj seconds-per-frame) (* 0.02 ratio)) - (set! (-> obj frames-per-second) (* 50.0 (/ 1.0 ratio))) + (set! (-> this time-adjust-ratio) (* 1.2 ratio)) + (set! (-> this seconds-per-frame) (* 0.02 ratio)) + (set! (-> this frames-per-second) (* 50.0 (/ 1.0 ratio))) ;; 6 "ticks" per frame * 50 fps = 300 ticks per second. - (set! (-> obj time-factor) 6.0) + (set! (-> this time-factor) 6.0) ) (('ntsc) - (set! (-> obj time-adjust-ratio) ratio) - (set! (-> obj seconds-per-frame) (* 0.016666668 ratio)) - (set! (-> obj frames-per-second) (* 60.0 (/ 1.0 ratio))) + (set! (-> this time-adjust-ratio) ratio) + (set! (-> this seconds-per-frame) (* 0.016666668 ratio)) + (set! (-> this frames-per-second) (* 60.0 (/ 1.0 ratio))) ;; 5 "ticks" per frame * 60 fps = 300 ticks per second. - (set! (-> obj time-factor) 5.0) + (set! (-> this time-factor) 5.0) ) (('custom) - (set! (-> obj time-adjust-ratio) (* (/ 60.0 (-> *pc-settings* target-fps)) ratio)) - (set! (-> obj seconds-per-frame) (/ ratio (-> *pc-settings* target-fps))) - (set! (-> obj frames-per-second) (* (the float (-> *pc-settings* target-fps)) (/ 1.0 ratio))) + (set! (-> this time-adjust-ratio) (* (/ 60.0 (-> *pc-settings* target-fps)) ratio)) + (set! (-> this seconds-per-frame) (/ ratio (-> *pc-settings* target-fps))) + (set! (-> this frames-per-second) (* (the float (-> *pc-settings* target-fps)) (/ 1.0 ratio))) ;; x "ticks" per frame * y fps = 300 ticks per second. - (set! (-> obj time-factor) (/ 300.0 (-> *pc-settings* target-fps))) + (set! (-> this time-factor) (/ 300.0 (-> *pc-settings* target-fps))) ) (else (format #t "Warning: Tried to set unsupported video-mode") ) ) ) - (-> obj time-ratio) + (-> this time-ratio) ) ;; new constant for use in high FPS scenarios @@ -318,11 +319,11 @@ ;; PROFILE BAR ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod add-frame profile-bar ((obj profile-bar) (name symbol) (color rgba)) +(defmethod add-frame profile-bar ((this profile-bar) (name symbol) (color rgba)) "Add a block to the profile bar. Looks at the timer to determine the current time." (if *debug-segment* - (let ((new-frame (-> obj data (-> obj profile-frame-count)))) - (set! (-> obj profile-frame-count) (+ (-> obj profile-frame-count) 1)) + (let ((new-frame (-> this data (-> this profile-frame-count)))) + (set! (-> this profile-frame-count) (+ (-> this profile-frame-count) 1)) (set! (-> new-frame name) name) (set! (-> new-frame time-stamp) (timer-count (the-as timer-bank #x10000800))) (set! (-> new-frame color) color) @@ -331,17 +332,17 @@ ) ) -(defmethod reset profile-bar ((obj profile-bar)) +(defmethod reset profile-bar ((this profile-bar)) "Clear all blocks from the profile bar. Adds the start block" - (set! (-> obj profile-frame-count) 0) - (add-frame obj 'start (new 'static 'rgba :r #x40 :b #x40 :a #x80)) - obj + (set! (-> this profile-frame-count) 0) + (add-frame this 'start (new 'static 'rgba :r #x40 :b #x40 :a #x80)) + this ) -(defmethod add-end-frame profile-bar ((obj profile-bar) (name symbol) (color rgba)) +(defmethod add-end-frame profile-bar ((this profile-bar) (name symbol) (color rgba)) "Finish the frame." - (let ((new-frame (-> obj data (-> obj profile-frame-count)))) - (set! (-> obj profile-frame-count) (+ (-> obj profile-frame-count) 1)) + (let ((new-frame (-> this data (-> this profile-frame-count)))) + (set! (-> this profile-frame-count) (+ (-> this profile-frame-count) 1)) (set! (-> new-frame name) name) (set! (-> new-frame time-stamp) (the-as uint *ticks-per-frame*)) (set! (-> new-frame color) color) @@ -358,7 +359,7 @@ ;; ticks or percent? (define *profile-ticks* #f) -(defmethod draw profile-bar ((obj profile-bar) (buf dma-buffer) (bar-pos int)) +(defmethod draw profile-bar ((this profile-bar) (buf dma-buffer) (bar-pos int)) "Draw the bar! The bar pos shouldn't be changed." ;; recompute y stuff based on the current relative-y-scale. @@ -367,7 +368,7 @@ (set! *profile-h* height) ;; px ) (let ((block-idx 1) ;; block to draw (0 is 'start) - (block-count (-> obj profile-frame-count)) ;; total number of blocks + (block-count (-> this profile-frame-count)) ;; total number of blocks (left (shl *profile-x* 4)) ;; x (12.4) of the current block. initialized to start of bar. (end-time 0) ;; end of last block ;; if there's a single really slow frame, we want its time to appear for @@ -391,7 +392,7 @@ ;; loop through blocks to draw. (while (< block-idx block-count) - (let ((block (-> obj data block-idx))) + (let ((block (-> this data block-idx))) ;; add first three regs (prim, color, one vertex) (dma-buffer-add-uint64 buf (new 'static 'gs-prim :prim (gs-prim-type sprite) :abe 1) (-> block color) @@ -428,11 +429,11 @@ ;; update the worst time cache if its more than 0.25 seconds old, or we did worse ;; than the cached value. ;; we use bar-pos/10 as the index into the cache, which is kind of sketchy. - (when (or (< (seconds 0.25) (- (-> *display* real-frame-counter) (-> obj cache-time))) + (when (or (< (seconds 0.25) (- (-> *display* real-frame-counter) (-> this cache-time))) (>= end-time (the-as int (-> worst-time-cache (/ bar-pos 10)))) ) (set! (-> worst-time-cache (/ bar-pos 10)) (the-as uint end-time)) - (set! (-> obj cache-time) (-> *display* real-frame-counter)) + (set! (-> this cache-time) (-> *display* real-frame-counter)) ) ;; draw the time, either in ticks or percent. diff --git a/goal_src/jak1/engine/gfx/hw/gs.gc b/goal_src/jak1/engine/gfx/hw/gs.gc index c2e3a02655..5d072fad86 100644 --- a/goal_src/jak1/engine/gfx/hw/gs.gc +++ b/goal_src/jak1/engine/gfx/hw/gs.gc @@ -9,6 +9,8 @@ ;; These are used when creating GS packets to be sent to the GIF ;; or for directly interfacing with the memory-mapped GS control registers. +;; DECOMP BEGINS + ;; the GS's PMODE register makes various settings for the PCRTC. (deftype gs-pmode (uint64) ((en1 uint8 :offset 0 :size 1) @@ -758,33 +760,33 @@ :flag-assert #x900000010 ) -(defmethod inspect gif-tag ((obj gif-tag)) - (format #t "[~8x] gif-tag~%" obj) - (format #t "~Tnloop: ~4d~%" (-> obj nloop)) - (format #t "~Teop : ~4d~%" (-> obj eop)) - (format #t "~Tid : ~4d~%" (-> obj id)) - (format #t "~Tpre : ~4d~%" (-> obj pre)) - (format #t "~Tprim : ~4d~%" (-> obj prim)) - (format #t "~Tflg : ~4d~%" (-> obj flg)) - (format #t "~Tnreg : ~4d~%" (-> obj nreg)) - (format #t "~Tregs0 : ~4d~%" (-> obj regs0)) - (format #t "~Tregs1 : ~4d~%" (-> obj regs1)) - (format #t "~Tregs2 : ~4d~%" (-> obj regs2)) - (format #t "~Tregs3 : ~4d~%" (-> obj regs3)) - (format #t "~Tregs4 : ~4d~%" (-> obj regs4)) - (format #t "~Tregs5 : ~4d~%" (-> obj regs5)) - (format #t "~Tregs6 : ~4d~%" (-> obj regs6)) - (format #t "~Tregs7 : ~4d~%" (-> obj regs7)) - (format #t "~Tregs8 : ~4d~%" (-> obj regs8)) - (format #t "~Tregs9 : ~4d~%" (-> obj regs9)) - (format #t "~Tregs10: ~4d~%" (-> obj regs10)) - (format #t "~Tregs11: ~4d~%" (-> obj regs11)) - (format #t "~Tregs12: ~4d~%" (-> obj regs12)) - (format #t "~Tregs13: ~4d~%" (-> obj regs13)) - (format #t "~Tregs14: ~4d~%" (-> obj regs14)) - (format #t "~Tregs15: ~4d~%" (-> obj regs15)) +(defmethod inspect gif-tag ((this gif-tag)) + (format #t "[~8x] gif-tag~%" this) + (format #t "~Tnloop: ~4d~%" (-> this nloop)) + (format #t "~Teop : ~4d~%" (-> this eop)) + (format #t "~Tid : ~4d~%" (-> this id)) + (format #t "~Tpre : ~4d~%" (-> this pre)) + (format #t "~Tprim : ~4d~%" (-> this prim)) + (format #t "~Tflg : ~4d~%" (-> this flg)) + (format #t "~Tnreg : ~4d~%" (-> this nreg)) + (format #t "~Tregs0 : ~4d~%" (-> this regs0)) + (format #t "~Tregs1 : ~4d~%" (-> this regs1)) + (format #t "~Tregs2 : ~4d~%" (-> this regs2)) + (format #t "~Tregs3 : ~4d~%" (-> this regs3)) + (format #t "~Tregs4 : ~4d~%" (-> this regs4)) + (format #t "~Tregs5 : ~4d~%" (-> this regs5)) + (format #t "~Tregs6 : ~4d~%" (-> this regs6)) + (format #t "~Tregs7 : ~4d~%" (-> this regs7)) + (format #t "~Tregs8 : ~4d~%" (-> this regs8)) + (format #t "~Tregs9 : ~4d~%" (-> this regs9)) + (format #t "~Tregs10: ~4d~%" (-> this regs10)) + (format #t "~Tregs11: ~4d~%" (-> this regs11)) + (format #t "~Tregs12: ~4d~%" (-> this regs12)) + (format #t "~Tregs13: ~4d~%" (-> this regs13)) + (format #t "~Tregs14: ~4d~%" (-> this regs14)) + (format #t "~Tregs15: ~4d~%" (-> this regs15)) ;; original function failed to return this. - obj + this ) ;; some nice blue. probably the same as the fog color for geyser/sandover/etc. @@ -924,18 +926,18 @@ (color-0 rgba) ) "Allocate and initialize a draw-context" - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (let ((v1-3 (the int (* (the float org-y) (-> *video-parms* relative-y-scale)))) (a0-2 (the int (* (the float height) (-> *video-parms* relative-y-scale)))) ) - (set! (-> obj orgx) org-x) - (set! (-> obj orgy) v1-3) - (set! (-> obj orgz) #xffffff) - (set! (-> obj width) width) - (set! (-> obj height) a0-2) + (set! (-> this orgx) org-x) + (set! (-> this orgy) v1-3) + (set! (-> this orgz) #xffffff) + (set! (-> this width) width) + (set! (-> this height) a0-2) ) - (set! (-> obj color 0) color-0) - obj + (set! (-> this color 0) color-0) + this ) ) diff --git a/goal_src/jak1/engine/gfx/hw/video-h.gc b/goal_src/jak1/engine/gfx/hw/video-h.gc index 523ea98d09..249b0f11e6 100644 --- a/goal_src/jak1/engine/gfx/hw/video-h.gc +++ b/goal_src/jak1/engine/gfx/hw/video-h.gc @@ -12,6 +12,8 @@ ;; The game is interlaced, meaning each framebuffer is half height. +;; DECOMP BEGINS + (deftype video-parms (structure) ((set-video-mode basic :offset-assert 0) (reset-video-mode basic :offset-assert 4) diff --git a/goal_src/jak1/engine/gfx/lights-h.gc b/goal_src/jak1/engine/gfx/lights-h.gc index 4cac1c0b3c..0f8bb03a0d 100644 --- a/goal_src/jak1/engine/gfx/lights-h.gc +++ b/goal_src/jak1/engine/gfx/lights-h.gc @@ -8,6 +8,8 @@ ;; It seems like some of these are unused. ;; The commonly used lights are vu-lights and light-group. +;; DECOMP BEGINS + ;; this type represents the lights that can be sent to the VU for merc (and maybe generic?) rendering. ;; it contains 3 directional lights and an ambient light. ;; Note that the data is transposed to be faster for use in the VU code. @@ -95,21 +97,21 @@ :flag-assert #x900000010 ) -(defmethod print light ((obj light)) +(defmethod print light ((this light)) "Print a directional light." (format #t "# obj levels data 0) - (-> obj direction data 0) - (-> obj direction data 1) - (-> obj direction data 2) + (-> this levels data 0) + (-> this direction data 0) + (-> this direction data 1) + (-> this direction data 2) ) (format #t "~F ~F ~F @ #x~X>" - (-> obj color data 0) - (-> obj color data 1) - (-> obj color data 2) - obj + (-> this color data 0) + (-> this color data 1) + (-> this color data 2) + this ) - obj + this ) ;; the primary light type, used before conversion to vu-lights. diff --git a/goal_src/jak1/engine/gfx/math-camera-h.gc b/goal_src/jak1/engine/gfx/math-camera-h.gc index 73809008ac..78b75904e7 100644 --- a/goal_src/jak1/engine/gfx/math-camera-h.gc +++ b/goal_src/jak1/engine/gfx/math-camera-h.gc @@ -13,6 +13,8 @@ ;; Some of the code here may be extremely old and unused, but this does compute the camera projection ;; matrix used almost everywhere. +;; DECOMP BEGINS + (deftype vis-gif-tag (structure) ((fog0 uint32 :offset-assert 0) (strip uint32 :offset-assert 4) diff --git a/goal_src/jak1/engine/gfx/math-camera.gc b/goal_src/jak1/engine/gfx/math-camera.gc index 54e03458a8..3d0df43ed5 100644 --- a/goal_src/jak1/engine/gfx/math-camera.gc +++ b/goal_src/jak1/engine/gfx/math-camera.gc @@ -31,6 +31,8 @@ ;; tells the GS how "foggy" the color should be. This should be proportional to how far away the vertex ;; is. There is a scaling factor applied so the fog intensity isn't affected by the field of view angle. +;; DECOMP BEGINS + ;; The fog-corrector stores a fog-end fog-start value that is corrected for the field of view. ;; the actual correction factor is computed in cam-update.gc (deftype fog-corrector (structure) diff --git a/goal_src/jak1/engine/gfx/merc/generic-merc-h.gc b/goal_src/jak1/engine/gfx/merc/generic-merc-h.gc index 36126859de..0345258c99 100644 --- a/goal_src/jak1/engine/gfx/merc/generic-merc-h.gc +++ b/goal_src/jak1/engine/gfx/merc/generic-merc-h.gc @@ -8,6 +8,8 @@ ;; The "generic merc" renderer converts merc data to be used by generic. ;; It is used for environment mapping and scissoring in the original game. +;; DECOMP BEGINS + (deftype merc-matrix (structure) ((quad uint128 8 :offset-assert 0) (vector vector 8 :inline :offset 0) diff --git a/goal_src/jak1/engine/gfx/merc/merc-h.gc b/goal_src/jak1/engine/gfx/merc/merc-h.gc index 6e59fcfe60..360b4d8e38 100644 --- a/goal_src/jak1/engine/gfx/merc/merc-h.gc +++ b/goal_src/jak1/engine/gfx/merc/merc-h.gc @@ -9,6 +9,8 @@ ;; All foreground objects are stored in merc format. ;; See bones.gc for where it's actually used and the pc port changes. +;; DECOMP BEGINS + ;; The "ripple" system can apply a ripple effect (for waves or similar) to merc data. ;; This defines which vertices should be rippled. (deftype ripple-merc-query (inline-array-class) @@ -400,16 +402,16 @@ ) (defmethod new ripple-control ((allocation symbol) (type-to-make type)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj global-scale) 0.0) - (set! (-> obj last-frame-scale) -0.001) - (set! (-> obj close-fade-dist) (meters 1000000)) - (set! (-> obj far-fade-dist) (meters 2000000)) - (set! (-> obj faded-scale) -0.001) - (set! (-> obj waveform) #f) - (set! (-> obj individual-normal-scale) 1.0) - (set! (-> obj send-query) #f) - (set! (-> obj query) #f) - obj + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this global-scale) 0.0) + (set! (-> this last-frame-scale) -0.001) + (set! (-> this close-fade-dist) (meters 1000000)) + (set! (-> this far-fade-dist) (meters 2000000)) + (set! (-> this faded-scale) -0.001) + (set! (-> this waveform) #f) + (set! (-> this individual-normal-scale) 1.0) + (set! (-> this send-query) #f) + (set! (-> this query) #f) + this ) ) diff --git a/goal_src/jak1/engine/gfx/merc/merc.gc b/goal_src/jak1/engine/gfx/merc/merc.gc index 4bb726cd16..11b51bcc30 100644 --- a/goal_src/jak1/engine/gfx/merc/merc.gc +++ b/goal_src/jak1/engine/gfx/merc/merc.gc @@ -14,17 +14,19 @@ ;; It contains a merc-ctrl-header which has the metadata. ;; It also has an array of merc-effects which contain the actual data. +;; DECOMP BEGINS + ;; contains the header for the currently logging-in thing. (define *merc-ctrl-header* (the-as merc-ctrl-header #f)) -(defmethod asize-of merc-fragment ((obj merc-fragment)) +(defmethod asize-of merc-fragment ((this merc-fragment)) "Get the size in memory of a merc-fragment" - (the-as int (* (-> obj header mm-quadword-size) 16)) + (the-as int (* (-> this header mm-quadword-size) 16)) ) -(defmethod login-adgifs merc-fragment ((obj merc-fragment)) +(defmethod login-adgifs merc-fragment ((this merc-fragment)) "Set up a merc-fragment. Does adgifs and eye stuff" - (let* ((fp-data (merc-fragment-fp-data obj)) + (let* ((fp-data (merc-fragment-fp-data this)) (eye-ctrl (if (nonzero? (-> *merc-ctrl-header* eye-ctrl)) (-> *merc-ctrl-header* eye-ctrl) (the-as merc-eye-ctrl #f) @@ -93,30 +95,30 @@ (none) ) -(defmethod asize-of merc-fragment-control ((obj merc-fragment-control)) - (the-as int (+ (* (-> obj mat-xfer-count) 2) 4)) +(defmethod asize-of merc-fragment-control ((this merc-fragment-control)) + (the-as int (+ (* (-> this mat-xfer-count) 2) 4)) ) -(defmethod inspect merc-fragment-control ((obj merc-fragment-control)) +(defmethod inspect merc-fragment-control ((this merc-fragment-control)) "Debug print a merc-fragment-control" - (format #t "[~8x] ~A~%" obj 'merc-fragment-control) - (format #t "~Tunsigned-four-count: ~D~%" (-> obj unsigned-four-count)) - (format #t "~Tlump-four-count: ~D~%" (-> obj lump-four-count)) - (format #t "~Tfp-qwc: ~D~%" (-> obj fp-qwc)) - (format #t "~Tmat-xfer-count: ~D~%" (-> obj mat-xfer-count)) - (dotimes (s5-0 (the-as int (-> obj mat-xfer-count))) + (format #t "[~8x] ~A~%" this 'merc-fragment-control) + (format #t "~Tunsigned-four-count: ~D~%" (-> this unsigned-four-count)) + (format #t "~Tlump-four-count: ~D~%" (-> this lump-four-count)) + (format #t "~Tfp-qwc: ~D~%" (-> this fp-qwc)) + (format #t "~Tmat-xfer-count: ~D~%" (-> this mat-xfer-count)) + (dotimes (s5-0 (the-as int (-> this mat-xfer-count))) (format #t "~Tmat-dest-data[~d]:~%" s5-0) - (format #t "~T~Tmatrix-number: ~D~%"(-> obj mat-dest-data s5-0 matrix-number)) - (format #t "~T~Tmatrix-dest: ~D~%" (-> obj mat-dest-data s5-0 matrix-dest)) + (format #t "~T~Tmatrix-number: ~D~%"(-> this mat-dest-data s5-0 matrix-number)) + (format #t "~T~Tmatrix-dest: ~D~%" (-> this mat-dest-data s5-0 matrix-dest)) ) - obj + this ) -(defmethod login-adgifs merc-effect ((obj merc-effect)) +(defmethod login-adgifs merc-effect ((this merc-effect)) "Login everything for this merc-effect." ;; login adgifs, if we have them. - (let ((data (-> obj extra-info))) + (let ((data (-> this extra-info))) (when (nonzero? data) (when (nonzero? (-> data shader-offset)) (let ((tex (adgif-shader-login @@ -138,10 +140,10 @@ ) ;; login fragment geometry and control. ctrls don't need logins - (let ((ctrl (-> obj frag-ctrl)) - (geo (-> obj frag-geo)) + (let ((ctrl (-> this frag-ctrl)) + (geo (-> this frag-geo)) ) - (dotimes (frag-idx (the-as int (-> obj frag-count))) + (dotimes (frag-idx (the-as int (-> this frag-count))) (let ((ctrl-size (asize-of ctrl))) (let ((geo-size (asize-of geo))) (login-adgifs geo) @@ -154,33 +156,33 @@ (none) ) -(defmethod inspect merc-ctrl ((obj merc-ctrl)) +(defmethod inspect merc-ctrl ((this merc-ctrl)) "Print a merc-ctrl" - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (inspect (-> obj header)) - (dotimes (s5-0 (the-as int (-> obj header effect-count))) - (inspect (-> obj effect s5-0)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~Textra: ~A~%" (-> this extra)) + (inspect (-> this header)) + (dotimes (s5-0 (the-as int (-> this header effect-count))) + (inspect (-> this effect s5-0)) ) - obj + this ) -(defmethod mem-usage merc-ctrl ((obj merc-ctrl) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage merc-ctrl ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage stats for a merc-ctrl" ;; do extra - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 arg1) + (if (-> this extra) + (mem-usage (-> this extra) arg0 arg1) ) ;; do merc ctrls in each effect: - (let ((ctrl-mem (+ 32 80 (* (-> obj header effect-count) 32)))) - (dotimes (effect-idx (the-as int (-> obj header effect-count))) - (let ((fctrl (-> obj effect effect-idx frag-ctrl))) - (dotimes (frag-idx (the-as int (-> obj effect effect-idx frag-count))) + (let ((ctrl-mem (+ 32 80 (* (-> this header effect-count) 32)))) + (dotimes (effect-idx (the-as int (-> this header effect-count))) + (let ((fctrl (-> this effect effect-idx frag-ctrl))) + (dotimes (frag-idx (the-as int (-> this effect effect-idx frag-count))) (set! ctrl-mem (+ ctrl-mem (* (shr (+ (-> fctrl unsigned-four-count) 3) 2) 16) (* (shr (+ (-> fctrl lump-four-count) 3) 2) 16) @@ -201,10 +203,10 @@ ;; do effect blend shapes (let ((effect-mem 0)) - (dotimes (effect-idx2 (the-as int (-> obj header effect-count))) - (when (nonzero? (-> obj effect effect-idx2 blend-frag-count)) - (let ((bctrl (-> obj effect effect-idx2 blend-ctrl))) - (dotimes (blend-frag-idx (the-as int (-> obj effect effect-idx2 blend-frag-count)) ) + (dotimes (effect-idx2 (the-as int (-> this header effect-count))) + (when (nonzero? (-> this effect effect-idx2 blend-frag-count)) + (let ((bctrl (-> this effect effect-idx2 blend-ctrl))) + (dotimes (blend-frag-idx (the-as int (-> this effect effect-idx2 blend-frag-count)) ) (let ((v1-36 (+ effect-mem (* (+ (-> bctrl nonzero-index-count) 1) (the-as uint (logand (+ (* (the-as uint 6) (-> bctrl blend-vtx-count)) 15) #xfff0)) @@ -212,9 +214,9 @@ ) ) ) - (set! effect-mem (the-as int (+ (-> obj header blend-target-count) 2 v1-36))) + (set! effect-mem (the-as int (+ (-> this header blend-target-count) 2 v1-36))) ) - (set! bctrl (the-as merc-blend-ctrl (&+ (the-as pointer bctrl) (+ (-> obj header blend-target-count) 2)))) + (set! bctrl (the-as merc-blend-ctrl (&+ (the-as pointer bctrl) (+ (-> this header blend-target-count) 2)))) ) ) ) @@ -229,8 +231,8 @@ ) ;; do eyes. - (when (nonzero? (-> obj header eye-ctrl)) - (let ((a0-28 (-> obj header eye-ctrl))) + (when (nonzero? (-> this header eye-ctrl)) + (let ((a0-28 (-> this header eye-ctrl))) (set! (-> arg0 length) (max 109 (-> arg0 length))) (set! (-> arg0 data 108 name) "eye-anim") (+! (-> arg0 data 108 count) 1) @@ -240,14 +242,14 @@ ) ) ) - obj + this ) -(defmethod login merc-ctrl ((obj merc-ctrl)) +(defmethod login merc-ctrl ((this merc-ctrl)) "Log in a merc-ctrl." ;; so we can find it - (set! *merc-ctrl-header* (-> obj header)) + (set! *merc-ctrl-header* (-> this header)) ;; clear masks. logging in will set these for textures we need. (dotimes (v1-1 3) @@ -255,23 +257,23 @@ ) ;; login the effects - (dotimes (effect-idx (the-as int (-> obj header effect-count))) - (login-adgifs (-> obj effect effect-idx)) + (dotimes (effect-idx (the-as int (-> this header effect-count))) + (login-adgifs (-> this effect effect-idx)) ) ;; some weird hack to swap two effects. (let ((idx-with-bit1 -1) - (a1-1 (-> obj header effect-count)) + (a1-1 (-> this header effect-count)) ) (dotimes (v1-11 (the-as int a1-1)) - (if (logtest? (-> obj effect v1-11 effect-bits) 2) + (if (logtest? (-> this effect v1-11 effect-bits) 2) (set! idx-with-bit1 v1-11) ) ) (when (!= idx-with-bit1 -1) (let ((v1-16 4) - (this-effect (-> obj effect idx-with-bit1)) - (last-effect (-> obj effect (+ a1-1 -1))) + (this-effect (-> this effect idx-with-bit1)) + (last-effect (-> this effect (+ a1-1 -1))) ) (dotimes (copy-idx v1-16) (let ((a3-2 (-> this-effect data copy-idx))) @@ -285,13 +287,13 @@ ;; login eye. (cond - ((zero? (logand -65536 (the-as int (-> obj header eye-ctrl)))) + ((zero? (logand -65536 (the-as int (-> this header eye-ctrl)))) ;; no idea what this is for. - (set! (-> obj header eye-ctrl) (the-as merc-eye-ctrl 0)) + (set! (-> this header eye-ctrl) (the-as merc-eye-ctrl 0)) 0 ) (else - (let ((s5-1 (-> obj header eye-ctrl))) + (let ((s5-1 (-> this header eye-ctrl))) ;; login and set masks (dotimes (s4-0 3) (let ((v1-25 (adgif-shader-login (-> s5-1 shader s4-0)))) @@ -305,7 +307,7 @@ ) ) ) - obj + this ) (defun-debug merc-stats-display ((arg0 merc-ctrl)) diff --git a/goal_src/jak1/engine/gfx/mood/mood-h.gc b/goal_src/jak1/engine/gfx/mood/mood-h.gc index 7284fafcf8..24f68c2820 100644 --- a/goal_src/jak1/engine/gfx/mood/mood-h.gc +++ b/goal_src/jak1/engine/gfx/mood/mood-h.gc @@ -9,6 +9,8 @@ ;; each level has 8 "moods" corresponding to the 8 times of day. ;; the mood system blends together moods to create smooth transitions between levels and times of day. +;; DECOMP BEGINS + ;; set of fog parameters (deftype mood-fog (structure) ((fog-color vector :inline :offset-assert 0) diff --git a/goal_src/jak1/engine/gfx/mood/mood.gc b/goal_src/jak1/engine/gfx/mood/mood.gc index f4f89a943f..c9f0a7dae1 100644 --- a/goal_src/jak1/engine/gfx/mood/mood.gc +++ b/goal_src/jak1/engine/gfx/mood/mood.gc @@ -2436,8 +2436,8 @@ (cond ((or (logtest? (get-reminder (get-task-control (game-task finalboss-movies)) 0) 1) (not *time-of-day-effects*)) (when (and *target* (= (-> *target* next-state name) 'target-continue)) - (set! (-> s4-0 start-time) (+ (-> *display* base-frame-counter) (seconds -33.335))) - (set! (-> s4-0 secret-time) (+ (-> *display* base-frame-counter) (seconds -33.335))) + (set! (-> s4-0 start-time) (+ (current-time) (seconds -33.335))) + (set! (-> s4-0 secret-time) (+ (current-time) (seconds -33.335))) ) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -2483,7 +2483,7 @@ ) (cond ((logtest? (get-reminder (get-task-control (game-task finalboss-movies)) 0) 2) - (let* ((f1-14 (* 0.00055555557 (the float (- (-> *display* base-frame-counter) (-> s4-0 secret-time))))) + (let* ((f1-14 (* 0.00055555557 (the float (- (current-time) (-> s4-0 secret-time))))) (f0-15 (fmax 0.0 (fmin 1.0 f1-14))) (a0-21 (-> arg0 light-group)) ) @@ -2520,10 +2520,10 @@ ) ) (else - (set! (-> s4-0 secret-time) (-> *display* base-frame-counter)) + (set-time! (-> s4-0 secret-time)) ) ) - (let* ((f1-36 (* 0.00019607843 (the float (- (-> *display* base-frame-counter) (-> s4-0 start-time))))) + (let* ((f1-36 (* 0.00019607843 (the float (- (current-time) (-> s4-0 start-time))))) (f1-38 (fmax 0.0 (fmin 1.0 f1-36))) (f0-32 (fmax 0.0 (fmin 1.0 f1-38))) ) @@ -2551,7 +2551,7 @@ (set! (-> *time-of-day-proc* 0 minute) 0) (set! (-> *time-of-day-proc* 0 second) 0) (set! (-> *time-of-day-proc* 0 frame) 0) - (set! (-> s4-0 start-time) (-> *display* base-frame-counter)) + (set-time! (-> s4-0 start-time)) (dotimes (v1-72 8) (set! (-> arg0 sky-times v1-72) 0.0) ) diff --git a/goal_src/jak1/engine/gfx/mood/time-of-day.gc b/goal_src/jak1/engine/gfx/mood/time-of-day.gc index 41ee1bc6e9..a25a57df8c 100644 --- a/goal_src/jak1/engine/gfx/mood/time-of-day.gc +++ b/goal_src/jak1/engine/gfx/mood/time-of-day.gc @@ -5,9 +5,11 @@ ;; name in dgo: time-of-day ;; dgos: GAME, ENGINE -(defmethod asize-of time-of-day-palette ((obj time-of-day-palette)) +;; DECOMP BEGINS + +(defmethod asize-of time-of-day-palette ((this time-of-day-palette)) "Compute the size in memory of a time-of-day-palette" - (the-as int (+ (-> obj type size) (* (* (-> obj height) (-> obj width)) 4))) + (the-as int (+ (-> this type size) (* (* (-> this height) (-> this width)) 4))) ) ;; The time-of-day-effect function is a callback used before doing a time-of-day-update. @@ -620,10 +622,10 @@ (none) ) -(defmethod set-fade! palette-fade-controls ((obj palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) +(defmethod set-fade! palette-fade-controls ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) (cond ((and (>= arg0 0) (< arg0 8)) - (let ((v1-3 (-> obj control arg0))) + (let ((v1-3 (-> this control arg0))) (when (< arg2 (-> v1-3 actor-dist)) (if arg3 (set! (-> v1-3 trans quad) (-> arg3 quad)) @@ -642,9 +644,9 @@ ) ) -(defmethod reset! palette-fade-controls ((obj palette-fade-controls)) +(defmethod reset! palette-fade-controls ((this palette-fade-controls)) (countdown (v1-0 8) - (let ((a1-2 (-> obj control v1-0))) + (let ((a1-2 (-> this control v1-0))) (set! (-> a1-2 fade) 0.0) (set! (-> a1-2 actor-dist) 4096000000.0) ) diff --git a/goal_src/jak1/engine/gfx/mood/weather-part.gc b/goal_src/jak1/engine/gfx/mood/weather-part.gc index be3db5b0e0..babb811d8b 100644 --- a/goal_src/jak1/engine/gfx/mood/weather-part.gc +++ b/goal_src/jak1/engine/gfx/mood/weather-part.gc @@ -347,7 +347,7 @@ ) (defun update-snow ((arg0 target)) - (let ((target-position (-> arg0 control trans))) + (let ((gp-0 (-> arg0 control trans))) (let ((f0-0 (lerp-scale 0.0 1.0 (vector-length (-> arg0 control transv)) 2048.0 40960.0))) (set! (-> *part-id-table* 34 init-specs 1 initial-valuef) (- 1.0 f0-0)) (set! (-> *part-id-table* 33 init-specs 1 initial-valuef) (* 4.0 f0-0)) @@ -355,8 +355,8 @@ (set! (-> *part-id-table* 33 init-specs 19 initial-valuef) (+ 32768.0 (vector-y-angle (-> arg0 control transv))) ) - (launch-particles (-> *part-id-table* 34) target-position) - (launch-particles (-> *part-id-table* 33) target-position) + (launch-particles (-> *part-id-table* 34) gp-0) + (launch-particles (-> *part-id-table* 33) gp-0) ) 0 (none) @@ -487,7 +487,7 @@ ) (defbehavior cam-master-effect camera-master () - (when (< (+ (-> *display* base-frame-counter) (seconds -10)) (-> self water-drip-time)) + (when (< (+ (current-time) (seconds -10)) (-> self water-drip-time)) (set! (-> *part-id-table* 21 init-specs 1 initial-valuef) (-> self water-drip-mult)) (set! (-> *part-id-table* 18 init-specs 1 initial-valuef) (* 0.9 (-> self water-drip-mult))) (set! (-> *part-id-table* 22 init-specs 11 initial-valuef) (* -2.7306666 (-> self water-drip-speed))) diff --git a/goal_src/jak1/engine/gfx/ocean/ocean-h.gc b/goal_src/jak1/engine/gfx/ocean/ocean-h.gc index e7d8779358..00ecb8ce69 100644 --- a/goal_src/jak1/engine/gfx/ocean/ocean-h.gc +++ b/goal_src/jak1/engine/gfx/ocean/ocean-h.gc @@ -18,6 +18,8 @@ ;; The "ocean" renderer is used to render the infinite water. ;; It doesn't draw the rivers in FJ or the water near the farmer. +;; DECOMP BEGINS + (deftype ocean-corner (structure) ((bsphere sphere :inline :offset-assert 0) (start-corner vector :inline :offset-assert 16) diff --git a/goal_src/jak1/engine/gfx/shadow/shadow-h.gc b/goal_src/jak1/engine/gfx/shadow/shadow-h.gc index 904cb49c30..4e9652e353 100644 --- a/goal_src/jak1/engine/gfx/shadow/shadow-h.gc +++ b/goal_src/jak1/engine/gfx/shadow/shadow-h.gc @@ -5,6 +5,7 @@ ;; name in dgo: shadow-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS (deftype fake-shadow (structure) ((px float :offset-assert 0) diff --git a/goal_src/jak1/engine/gfx/shadow/shadow-vu1.gc b/goal_src/jak1/engine/gfx/shadow/shadow-vu1.gc index 00651bfd61..cd9d109c8f 100644 --- a/goal_src/jak1/engine/gfx/shadow/shadow-vu1.gc +++ b/goal_src/jak1/engine/gfx/shadow/shadow-vu1.gc @@ -5,6 +5,8 @@ ;; name in dgo: shadow-vu1 ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (deftype shadow-vu1-constants (structure) ((hmgescale vector :inline :offset-assert 0) (invhscale vector :inline :offset-assert 16) @@ -24,21 +26,21 @@ :flag-assert #x9000000d0 ) -(defmethod inspect shadow-vu1-constants ((obj shadow-vu1-constants)) - (format #t "[~8x] ~A~%" obj 'shadow-vu1-constants) - (format #t "~Thmgescale: #~%" (-> obj hmgescale)) - (format #t "~Tinvhscale: #~%" (-> obj invhscale)) - (format #t "~Ttexoffset: #~%" (-> obj texoffset)) - (format #t "~Ttexscale: #~%" (-> obj texscale)) - (format #t "~Thvdfoff: #~%" (-> obj hvdfoff)) - (format #t "~Tfog: #~%" (-> obj fog)) - (format #t "~Tclrs[2] @ #x~X~%" (-> obj clrs)) - (format #t "~Tadgif: #~%" (-> obj adgif)) - (format #t "~Ttexflush: #~%" (-> obj texflush)) - (format #t "~Tflush: #~%" (-> obj flush)) - (format #t "~Ttrigif: #~%" (-> obj trigif)) - (format #t "~Tquadgif: #~%" (-> obj quadgif)) - obj +(defmethod inspect shadow-vu1-constants ((this shadow-vu1-constants)) + (format #t "[~8x] ~A~%" this 'shadow-vu1-constants) + (format #t "~Thmgescale: #~%" (-> this hmgescale)) + (format #t "~Tinvhscale: #~%" (-> this invhscale)) + (format #t "~Ttexoffset: #~%" (-> this texoffset)) + (format #t "~Ttexscale: #~%" (-> this texscale)) + (format #t "~Thvdfoff: #~%" (-> this hvdfoff)) + (format #t "~Tfog: #~%" (-> this fog)) + (format #t "~Tclrs[2] @ #x~X~%" (-> this clrs)) + (format #t "~Tadgif: #~%" (-> this adgif)) + (format #t "~Ttexflush: #~%" (-> this texflush)) + (format #t "~Tflush: #~%" (-> this flush)) + (format #t "~Ttrigif: #~%" (-> this trigif)) + (format #t "~Tquadgif: #~%" (-> this quadgif)) + this ) (deftype shadow-vu1-gifbuf-template (structure) @@ -53,14 +55,14 @@ :flag-assert #x900000050 ) -(defmethod inspect shadow-vu1-gifbuf-template ((obj shadow-vu1-gifbuf-template)) - (format #t "[~8x] ~A~%" obj 'shadow-vu1-gifbuf-template) - (format #t "~Tadgif: #~%" (-> obj adgif)) - (format #t "~Tad: #~%" (-> obj ad)) - (format #t "~Tflush: #~%" (-> obj flush)) - (format #t "~Ttrigif: #~%" (-> obj trigif)) - (format #t "~Tquadgif: #~%" (-> obj quadgif)) - obj +(defmethod inspect shadow-vu1-gifbuf-template ((this shadow-vu1-gifbuf-template)) + (format #t "[~8x] ~A~%" this 'shadow-vu1-gifbuf-template) + (format #t "~Tadgif: #~%" (-> this adgif)) + (format #t "~Tad: #~%" (-> this ad)) + (format #t "~Tflush: #~%" (-> this flush)) + (format #t "~Ttrigif: #~%" (-> this trigif)) + (format #t "~Tquadgif: #~%" (-> this quadgif)) + this ) (define @@ -237,7 +239,3 @@ ) (none) ) - - - - diff --git a/goal_src/jak1/engine/gfx/shrub/shrubbery-h.gc b/goal_src/jak1/engine/gfx/shrub/shrubbery-h.gc index 232ce53c28..8b87c5a05c 100644 --- a/goal_src/jak1/engine/gfx/shrub/shrubbery-h.gc +++ b/goal_src/jak1/engine/gfx/shrub/shrubbery-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: shrubbery-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (deftype billboard (drawable) ((flat adgif-shader :inline :offset-assert 32) ) @@ -127,21 +129,21 @@ :flag-assert #x900000050 ) -(defun shrubbery-login-post-texture ((obj shrubbery)) +(defun shrubbery-login-post-texture ((this shrubbery)) "Copies adgif shader crap to somewhere" ;; total number of adgif shaders for this shrubbery object. - (let* ((shader-count (-> obj header data 0)) + (let* ((shader-count (-> this header data 0)) ;; one destination to place the data. (dst (the-as qword - (+ (the-as uint (-> obj header)) - (the-as uint (* (+ (-> obj header data 1) 1) 16)) + (+ (the-as uint (-> this header)) + (the-as uint (* (+ (-> this header data 1) 1) 16)) ) ) ) ;; the second destination to place the data (tex-dst (the-as qword (+ (the-as int dst) (the-as int (* shader-count 64))))) ;; the input data (adgif shaders, each is 0x50 bytes, or 5 quads) - (src (the-as qword (-> obj textures))) + (src (the-as qword (-> this textures))) ) ;; iterate over all shaders (dotimes (a0-1 (the-as int shader-count)) diff --git a/goal_src/jak1/engine/gfx/sky/sky-h.gc b/goal_src/jak1/engine/gfx/sky/sky-h.gc index bc67485f23..a91dee38ee 100644 --- a/goal_src/jak1/engine/gfx/sky/sky-h.gc +++ b/goal_src/jak1/engine/gfx/sky/sky-h.gc @@ -8,6 +8,8 @@ ;; the "sky" system draws the sky and determines colors for lights. ;; each level has 8 skies that are interpolated between. +;; DECOMP BEGINS + ;; represents the skies that are used during a single hour. ;; there can be 1 or 2 skies used. (deftype sky-color-hour (structure) diff --git a/goal_src/jak1/engine/gfx/sky/sky-tng.gc b/goal_src/jak1/engine/gfx/sky/sky-tng.gc index 928cb9b733..d0a3194247 100644 --- a/goal_src/jak1/engine/gfx/sky/sky-tng.gc +++ b/goal_src/jak1/engine/gfx/sky/sky-tng.gc @@ -5,6 +5,8 @@ ;; name in dgo: sky-tng ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (define *sky-work* (new 'static 'sky-work ;; usual 5x a+d @@ -140,27 +142,27 @@ (define *sky-tng-data* (new 'global 'sky-tng-data)) (init-sky-tng-data *sky-tng-data*) -(defmethod inspect sky-vertex ((obj sky-vertex)) - (format #t "sky-vertex [~X]:~%" obj) +(defmethod inspect sky-vertex ((this sky-vertex)) + (format #t "sky-vertex [~X]:~%" this) (format #t "~TPos: [~F ~F ~F ~F]~%" - (-> obj pos x) - (-> obj pos y) - (-> obj pos z) - (-> obj pos w) + (-> this pos x) + (-> this pos y) + (-> this pos z) + (-> this pos w) ) (format #t "~TSTQ: [~F ~F ~F ~F]~%" - (-> obj stq x) - (-> obj stq y) - (-> obj stq z) - (-> obj stq w) + (-> this stq x) + (-> this stq y) + (-> this stq z) + (-> this stq w) ) (format #t "~TCol: [~F ~F ~F ~F]~%" - (-> obj col x) - (-> obj col y) - (-> obj col z) - (-> obj col w) + (-> this col x) + (-> this col y) + (-> this col z) + (-> this col w) ) - obj + this ) (defun update-sky-tng-data ((arg0 float)) @@ -1324,5 +1326,3 @@ 0 (none) ) - - diff --git a/goal_src/jak1/engine/gfx/sky/sky.gc b/goal_src/jak1/engine/gfx/sky/sky.gc index 3b74a71cf5..93323027eb 100644 --- a/goal_src/jak1/engine/gfx/sky/sky.gc +++ b/goal_src/jak1/engine/gfx/sky/sky.gc @@ -5,6 +5,8 @@ ;; name in dgo: sky ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (defun sky-make-sun-data ((arg0 sky-parms) (arg1 int) (arg2 float)) "Make sun data for the arg1th sun at arg2 time" (let* ((s4-0 (-> arg0 orbit arg1)) diff --git a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-h.gc b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-h.gc index 70a54850c1..40adb496c1 100644 --- a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-h.gc +++ b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: sparticle-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (define *sp-frame-time* (new 'global 'vector)) (set-vector! diff --git a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h.gc b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h.gc index 7269dc75b7..efe8778eb9 100644 --- a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h.gc +++ b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h.gc @@ -132,6 +132,8 @@ (launcher 6) ;; launcher from id ) +;; DECOMP BEGINS + ;; This describes the initial value and some more info for a single field ;; Note that there are overlays here and some values only make sense in some ;; cases. diff --git a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher.gc b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher.gc index eb2d3d3439..b382acee0b 100644 --- a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher.gc +++ b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle-launcher.gc @@ -6,8 +6,10 @@ ;; dgos: GAME, ENGINE ;; og:preserve-this added macro +;; the rate was defaulted to DISPLAY_FPS_RATIO before, but sp-launch-particles-var checks +;; if the rate is not 1.0 and crashes the game. (defmacro launch-particles (&key (system *sp-particle-system-2d*) particle origin &key (launch-state (the-as sparticle-launch-state #f)) &key (launch-control (the-as sparticle-launch-control #f)) - &key (rate DISPLAY_FPS_RATIO)) + &key (rate 1.0 #|DISPLAY_FPS_RATIO|#)) `(sp-launch-particles-var ,system ,particle ,origin ,launch-state ,launch-control ,rate) ) @@ -32,12 +34,12 @@ ) -(defmethod inspect sparticle-launcher ((obj sparticle-launcher)) +(defmethod inspect sparticle-launcher ((this sparticle-launcher)) "Print out a sparticle-laucher, including its fields" - (format #t "~X: sparticle-launcher~%" obj) + (format #t "~X: sparticle-launcher~%" this) (let ((s5-0 0)) - (while (!= (-> obj init-specs s5-0 field) (sp-field-id spt-end)) - (let ((init-spec (-> obj init-specs s5-0))) + (while (!= (-> this init-specs s5-0 field) (sp-field-id spt-end)) + (let ((init-spec (-> this init-specs s5-0))) (format #t "~T~S : ~F / #x~X / ~D~%" (enum->string sp-field-id (-> init-spec field)) (-> init-spec initial-valuef) @@ -810,24 +812,24 @@ ;; the launch-controls are always associated with a process. this allows the memory to be reclaimed once the ;; particles are despawned. -(defmethod initialize sparticle-launch-control ((obj sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) +(defmethod initialize sparticle-launch-control ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) "start a particle effect." (let ((s5-0 0)) ;; init - (set! (-> obj group) arg0) - (set! (-> obj proc) arg1) - (set! (-> obj local-clock) 0) - (set! (-> obj fade) 1.0) - (set! (-> obj matrix) 0) - (set! (-> obj last-spawn-frame) (the-as int (+ (-> *display* real-actual-frame-counter) (seconds -0.007)))) - (set! (-> obj last-spawn-time) 0) + (set! (-> this group) arg0) + (set! (-> this proc) arg1) + (set! (-> this local-clock) 0) + (set! (-> this fade) 1.0) + (set! (-> this matrix) 0) + (set! (-> this last-spawn-frame) (the-as int (+ (-> *display* real-actual-frame-counter) (seconds -0.007)))) + (set! (-> this last-spawn-time) 0) ;; iterate through the effects in the group (dotimes (s3-0 (-> arg0 length)) (let* ((a0-2 (-> arg0 launcher s3-0)) ;; the group-item (definition of the effect) (a1-2 (-> *part-id-table* (-> a0-2 launcher))) ;; the actual effect for the group item - (v1-9 (-> obj data s5-0)) ;; our state for this particular instance of this effect within the group. + (v1-9 (-> this data s5-0)) ;; our state for this particular instance of this effect within the group. ) (when (nonzero? a1-2) (set! (-> v1-9 group-item) a0-2) @@ -849,7 +851,7 @@ (else (logior! (-> v1-9 flags) (sp-launch-state-flags launcher-active)) ;; set the position now. - (set! (-> v1-9 origin) (-> obj center)) + (set! (-> v1-9 origin) (-> this center)) (set! (-> v1-9 sprite3d) #f) (set! (-> v1-9 sprite) #f) ) @@ -863,63 +865,63 @@ ) ) ) - (set! (-> obj length) s5-0) + (set! (-> this length) s5-0) ) 0 (none) ) -(defmethod create-launch-control sparticle-launch-group ((obj sparticle-launch-group) (arg0 process)) +(defmethod create-launch-control sparticle-launch-group ((this sparticle-launch-group) (arg0 process)) "create a launch-control to hold the state of the particles. stored on the process heap." - (let ((gp-0 (the-as sparticle-launch-control (new 'process 'sparticle-launch-control (-> obj length))))) + (let ((gp-0 (the-as sparticle-launch-control (new 'process 'sparticle-launch-control (-> this length))))) (when (zero? gp-0) (go process-drawable-art-error "memory") (return (the-as sparticle-launch-control 0)) ) - (initialize gp-0 obj arg0) + (initialize gp-0 this arg0) gp-0 ) ) -(defmethod kill-and-free-particles sparticle-launch-control ((obj sparticle-launch-control)) +(defmethod kill-and-free-particles sparticle-launch-control ((this sparticle-launch-control)) "kill all the particles" ;; clear the flag. - (countdown (v1-0 (-> obj length)) - (let ((a0-3 (-> obj data v1-0))) + (countdown (v1-0 (-> this length)) + (let ((a0-3 (-> this data v1-0))) (logclear! (-> a0-3 flags) (sp-launch-state-flags particles-active)) ) ) - (set! (-> obj local-clock) 0) - (set! (-> obj fade) 1.0) + (set! (-> this local-clock) 0) + (set! (-> this fade) 1.0) ;; kill the particles (let them go back to the sparticle system.) - (kill-all-particles-with-key obj) + (kill-all-particles-with-key this) ;; release matrices - (if (> (-> obj matrix) 0) - (sprite-release-user-hvdf (-> obj matrix)) + (if (> (-> this matrix) 0) + (sprite-release-user-hvdf (-> this matrix)) ) 0 (none) ) -(defmethod kill-particles sparticle-launch-control ((obj sparticle-launch-control)) +(defmethod kill-particles sparticle-launch-control ((this sparticle-launch-control)) "kill the particles, but don't clear flags or free hvdfs." - (kill-all-particles-with-key obj) + (kill-all-particles-with-key this) 0 (none) ) -(defmethod is-visible? sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) +(defmethod is-visible? sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) "Is the effect visible?. arg0 is the offset of the effect" - (let* ((v1-0 (-> obj group)) + (let* ((v1-0 (-> this group)) (f0-0 (-> v1-0 bounds w)) ) (cond ((= f0-0 0.0) ;; visibility sphere has 0 size, just say yes always #t ) - ((nonzero? (-> obj matrix)) ;; I guess if we have an extra matrix, we can't figure it out? + ((nonzero? (-> this matrix)) ;; I guess if we have an extra matrix, we can't figure it out? #t ) (else @@ -930,7 +932,7 @@ ;; debug draw sphere (if (and *display-actor-vis* (or (not *display-actor-anim*) - (name= *display-actor-anim* (-> obj proc name)) + (name= *display-actor-anim* (-> this proc name)) ) ) (add-debug-sphere @@ -958,33 +960,33 @@ ) -(defmethod spawn sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) - (set! (-> obj center quad) (-> arg0 quad)) +(defmethod spawn sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) + (set! (-> this center quad) (-> arg0 quad)) ;; og:preserve-this ;; check if we are visible (remove this check to force particles to be drawn.) - (if (not (or (is-visible? obj arg0) - (logtest? (-> obj group flags) (sp-group-flag always-draw screen-space)) + (if (not (or (is-visible? this arg0) + (logtest? (-> this group flags) (sp-group-flag always-draw screen-space)) ) ) (return (the-as object 0)) ) (let ((s4-0 *particle-300hz-timer*) - (s5-0 (-> obj last-spawn-time)) + (s5-0 (-> this last-spawn-time)) ) ;; weird stuff for frame counting (let ((v1-8 (-> *display* real-actual-frame-counter))) - (if (!= v1-8 (+ (-> obj last-spawn-frame) 1)) + (if (!= v1-8 (+ (-> this last-spawn-frame) 1)) (set! s5-0 (- s4-0 (logand (the-as int (-> *sp-frame-time* x)) 255))) ) ) - (set! (-> obj last-spawn-frame) (the-as int (-> *display* real-actual-frame-counter))) - (set! (-> obj last-spawn-time) s4-0) - (when (logtest? (-> obj group flags) (sp-group-flag use-local-clock)) - (set! s5-0 (-> obj local-clock)) - (+! (-> obj local-clock) (logand (the-as int (-> *sp-frame-time* x)) 255)) - (set! s4-0 (-> obj local-clock)) + (set! (-> this last-spawn-frame) (the-as int (-> *display* real-actual-frame-counter))) + (set! (-> this last-spawn-time) s4-0) + (when (logtest? (-> this group flags) (sp-group-flag use-local-clock)) + (set! s5-0 (-> this local-clock)) + (+! (-> this local-clock) (logand (the-as int (-> *sp-frame-time* x)) 255)) + (set! s4-0 (-> this local-clock)) ) (let ((f30-0 (vector-vector-distance arg0 (math-camera-pos))) @@ -996,7 +998,7 @@ ) ) ) - (if (nonzero? (-> obj matrix)) ;; if we have an additional matrix, say we're at the camera so we always draw. + (if (nonzero? (-> this matrix)) ;; if we have an additional matrix, say we're at the camera so we always draw. (set! f30-0 0.0) ) @@ -1006,10 +1008,10 @@ (set! f30-0 0.0))) ;; loop over particles in the group. - (let ((s2-1 (-> obj length))) + (let ((s2-1 (-> this length))) (while (begin (label cfg-79) (nonzero? s2-1)) (+! s2-1 -1) - (let* ((a3-0 (-> obj data s2-1)) + (let* ((a3-0 (-> this data s2-1)) (v1-29 (-> a3-0 group-item)) (a1-4 (-> *part-id-table* (-> v1-29 launcher))) ) @@ -1049,7 +1051,7 @@ a1-4 (-> a3-0 origin) :launch-state a3-0 - :launch-control obj + :launch-control this :rate f0-2 ) ) @@ -1073,8 +1075,8 @@ (let ((f0-4 (* 0.2 (the float (- s4-0 s5-0)) f0-2))) (b! #t cfg-72 :delay (nop!)) (label cfg-50) - (let ((a2-5 (mod (+ s5-0 (-> obj data s2-1 offset)) (the-as int (-> v1-29 period)))) - (a0-56 (mod (the-as uint (+ s4-0 (-> obj data s2-1 offset))) (-> v1-29 period))) + (let ((a2-5 (mod (+ s5-0 (-> this data s2-1 offset)) (the-as int (-> v1-29 period)))) + (a0-56 (mod (the-as uint (+ s4-0 (-> this data s2-1 offset))) (-> v1-29 period))) (t0-2 (-> v1-29 length)) ) (set! f0-4 (cond @@ -1092,11 +1094,11 @@ 0 (goto cfg-77) ) - (when (< (the-as uint (- s4-0 (the-as int (-> obj data s2-1 spawn-time)))) (-> v1-29 period)) + (when (< (the-as uint (- s4-0 (the-as int (-> this data s2-1 spawn-time)))) (-> v1-29 period)) 0 (goto cfg-77) ) - (set! (-> obj data s2-1 offset) (- (-> v1-29 period) a0-56)) + (set! (-> this data s2-1 offset) (- (-> v1-29 period) a0-56)) (* 0.2 (the float (- s4-0 s5-0)) f0-2) ) ) @@ -1114,7 +1116,7 @@ a1-4 (-> a3-0 origin) :launch-state a3-0 - :launch-control obj + :launch-control this :rate f0-4 ) ) diff --git a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc index 1e9ed80834..826d47b163 100644 --- a/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc +++ b/goal_src/jak1/engine/gfx/sprite/sparticle/sparticle.gc @@ -8,17 +8,19 @@ ;; This file contains the interface between sparticle and sprite as well as the actual particle updates. +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;; ;; basic methods ;;;;;;;;;;;;;;;;;;;;;;; -(defmethod print sparticle-cpuinfo ((obj sparticle-cpuinfo)) +(defmethod print sparticle-cpuinfo ((this sparticle-cpuinfo)) (format #t "~%") (dotimes (s5-0 16) - (format #t "~D:~F~%" s5-0 (the-as float (-> obj data s5-0))) + (format #t "~D:~F~%" s5-0 (the-as float (-> this data s5-0))) ) - (format #t "TIMER:~D~%" (-> obj timer)) - (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> obj flags))) + (format #t "TIMER:~D~%" (-> this timer)) + (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> this flags))) ) (defun sp-particle-copy! ((arg0 sparticle-cpuinfo) (arg1 sparticle-cpuinfo)) diff --git a/goal_src/jak1/engine/gfx/sprite/sprite-distort.gc b/goal_src/jak1/engine/gfx/sprite/sprite-distort.gc index be5516b94b..ae644b7a99 100644 --- a/goal_src/jak1/engine/gfx/sprite/sprite-distort.gc +++ b/goal_src/jak1/engine/gfx/sprite/sprite-distort.gc @@ -8,6 +8,8 @@ ;; The sprite-distort is a VU1 renderer. ;; It likely does some of the effects with sprites. +;; DECOMP BEGINS + ;; Scratch information used by the sprite-distorter. (deftype sprite-distorter-sine-tables (basic) ((aspx float :offset-assert 4) @@ -400,4 +402,3 @@ (none) ) ) - diff --git a/goal_src/jak1/engine/gfx/sprite/sprite-h.gc b/goal_src/jak1/engine/gfx/sprite/sprite-h.gc index 3d2c3d2d81..c8ffa90364 100644 --- a/goal_src/jak1/engine/gfx/sprite/sprite-h.gc +++ b/goal_src/jak1/engine/gfx/sprite/sprite-h.gc @@ -5,9 +5,9 @@ ;; name in dgo: sprite-h ;; dgos: GAME, ENGINE - (#when PC_BIG_MEMORY (defconstant SPRITE_MAX_AMOUNT_MULT 12)) +;; DECOMP BEGINS (deftype sprite-vec-data-2d (structure) ((x-y-z-sx vector :inline :offset-assert 0) diff --git a/goal_src/jak1/engine/gfx/sprite/sprite.gc b/goal_src/jak1/engine/gfx/sprite/sprite.gc index b39f1d62aa..1b3a9b4930 100644 --- a/goal_src/jak1/engine/gfx/sprite/sprite.gc +++ b/goal_src/jak1/engine/gfx/sprite/sprite.gc @@ -13,6 +13,8 @@ ;; at most, 48 sprites may be rendered per chunk. (defconstant SPRITE_CHUNK_COUNT 48) +;; DECOMP BEGINS + ;; This is the first quadword of the data sent to VU1. ;; It contains the number of sprites that should be drawn. (deftype sprite-header (structure) @@ -102,12 +104,12 @@ ) ) -(defmethod inspect sprite-aux-list ((obj sprite-aux-list)) - (format #t "[~X] sprite-aux-list:~%" obj) - (format #t "~Tnum-entries: ~D~%" (-> obj num-entries)) - (format #t "~Tentry: ~D~%" (-> obj entry)) - (dotimes (s5-0 (-> obj entry)) - (format #t "~T~D : ~X~%" s5-0 (-> obj data s5-0)) +(defmethod inspect sprite-aux-list ((this sprite-aux-list)) + (format #t "[~X] sprite-aux-list:~%" this) + (format #t "~Tnum-entries: ~D~%" (-> this num-entries)) + (format #t "~Tentry: ~D~%" (-> this entry)) + (dotimes (s5-0 (-> this entry)) + (format #t "~T~D : ~X~%" s5-0 (-> this data s5-0)) ) (the-as sprite-aux-list #f) ) @@ -999,6 +1001,4 @@ (defun sprite-get-user-hvdf ((arg0 int)) "Get an HVDF entry by index" (the-as vector (-> *sprite-hvdf-data* data arg0)) - ) - - + ) \ No newline at end of file diff --git a/goal_src/jak1/engine/gfx/texture/texture-h.gc b/goal_src/jak1/engine/gfx/texture/texture-h.gc index 1e6a635079..4c40d0d818 100644 --- a/goal_src/jak1/engine/gfx/texture/texture-h.gc +++ b/goal_src/jak1/engine/gfx/texture/texture-h.gc @@ -12,6 +12,8 @@ ;; There are a lot more details, see texture.gc for more info +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;; ;; Texture Control ;;;;;;;;;;;;;;;;;;;;;; diff --git a/goal_src/jak1/engine/gfx/texture/texture.gc b/goal_src/jak1/engine/gfx/texture/texture.gc index 47f6960cc6..bcf216289f 100644 --- a/goal_src/jak1/engine/gfx/texture/texture.gc +++ b/goal_src/jak1/engine/gfx/texture/texture.gc @@ -83,6 +83,7 @@ ;; KB: kilobytes, used only for diagnostic printing. 2^10 bytes (1024) ;; "ND page". Twice the size of a GS page. +;; DECOMP BEGINS ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; texture-page type @@ -98,29 +99,29 @@ ;; You can check for this by looking at the texture-pool ids. ;; Or, use the upload-vram-pages function which will add uploads to a DMA chain only if needed. -(defmethod print texture-page ((obj texture-page)) +(defmethod print texture-page ((this texture-page)) "Print a short description of a texture page." (format #t "#" - (-> obj name) - (-> obj length) ;; number of textures. - (shr (-> obj segment 0 dest) 6) ;; destination (vram words (4 byte) -> blocks (256 byte)) - (shr (-> obj size) 8) ;; size (vram words -> kilobytes) - obj + (-> this name) + (-> this length) ;; number of textures. + (shr (-> this segment 0 dest) 6) ;; destination (vram words (4 byte) -> blocks (256 byte)) + (shr (-> this size) 8) ;; size (vram words -> kilobytes) + this ) - obj + this ) -(defmethod length texture-page ((obj texture-page)) +(defmethod length texture-page ((this texture-page)) "Get the number of textures in a texture page" - (-> obj length) + (-> this length) ) -(defmethod asize-of texture-page ((obj texture-page)) +(defmethod asize-of texture-page ((this texture-page)) "Get the size in memory of a texture page object, not including the actual texture objects or texture data" - (the-as int (+ (-> obj type size) (the-as uint (shl (-> obj length) 2)))) + (the-as int (+ (-> this type size) (the-as uint (shl (-> this length) 2)))) ) -(defmethod mem-usage texture-page ((obj texture-page) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage texture-page ((this texture-page) (arg0 memory-usage-block) (arg1 int)) "Update the mem-usage for a texture." ;; some setup for texture memory usage. @@ -129,14 +130,14 @@ ;; count will hold the number of textures. (set! (-> arg0 data (mem-usage-id texture) count) - (+ (-> arg0 data (mem-usage-id texture) count) (-> obj length))) + (+ (-> arg0 data (mem-usage-id texture) count) (-> this length))) ;; We subtract off the size of the textures. This makes the memory usage negative! ;; I don't see why this is correct. - (let ((v1-7 (- (asize-of obj) (the-as int (shl (-> obj size) 2))))) + (let ((v1-7 (- (asize-of this) (the-as int (shl (-> this size) 2))))) ;; add 64-bytes for each entry, the size of texture. - (dotimes (a0-6 (-> obj length)) - (if (-> obj data a0-6) + (dotimes (a0-6 (-> this length)) + (if (-> this data a0-6) (+! v1-7 64) ) ) @@ -147,7 +148,7 @@ (+ (-> arg0 data (mem-usage-id texture) total) (logand -16 (+ v1-7 15))) ) ) - obj + this ) @@ -234,26 +235,26 @@ ;; after load, these point to location of the texture in VRAM _if the texture were uploaded to address 0_. ;; these records will be updated to point to the correct spot in VRAM by the texture allocators. -(defmethod print texture ((obj texture)) +(defmethod print texture ((this texture)) "Print out texture object, describing the texture format." (format #t "# obj name) - (psm->string (-> obj psm)) - (-> obj w) - (-> obj h) - (-> obj num-mips) - (shr (-> obj size) 8) ;; (vram words -> kb) + (-> this name) + (psm->string (-> this psm)) + (-> this w) + (-> this h) + (-> this num-mips) + (shr (-> this size) 8) ;; (vram words -> kb) ) ;; print each level - (dotimes (s5-1 (the-as int (-> obj num-mips))) - (format #t " #x~X/~X" (-> obj dest s5-1) (-> obj width s5-1)) + (dotimes (s5-1 (the-as int (-> this num-mips))) + (format #t " #x~X/~X" (-> this dest s5-1) (-> this width s5-1)) ) ;; for < 16 bpp textures, there is a color look-up table. - (if (< (texture-bpp (-> obj psm)) 16) - (format #t " :clut #x~X/1" (-> obj clutdest)) + (if (< (texture-bpp (-> this psm)) 16) + (format #t " :clut #x~X/1" (-> this clutdest)) ) - (format #t " @ #x~X>" obj) - obj + (format #t " @ #x~X>" this) + this ) @@ -464,10 +465,10 @@ ) ) -(defmethod allocate-vram-words! texture-pool ((obj texture-pool) (word-count int)) +(defmethod allocate-vram-words! texture-pool ((this texture-pool) (word-count int)) "Allocate words in vram. Returns the index of the first word." - (let ((v0-0 (-> obj cur))) - (set! (-> obj cur) (+ (-> obj cur) word-count)) + (let ((v0-0 (-> this cur))) + (set! (-> this cur) (+ (-> this cur) word-count)) v0-0 ) ) @@ -475,7 +476,7 @@ ;; boot common textures are "common" textures that are loaded at boot, but will live in RAM ;; and be uploaded to VRAM as needed. -(defmethod lookup-boot-common-id texture-pool ((obj texture-pool) (arg0 int)) +(defmethod lookup-boot-common-id texture-pool ((this texture-pool) (arg0 int)) "Map these special textures to a number betwen 0 and 19. For other textures, return -1. NOTE: hud means start menu + zoomer, not the usual health HUD." (case arg0 @@ -545,61 +546,61 @@ ) ) -(defmethod initialize! texture-pool ((obj texture-pool)) +(defmethod initialize! texture-pool ((this texture-pool)) "Initialize (or maybe reinitialize) a texture pool." ;; reset allocator - (set! (-> obj cur) 0) + (set! (-> this cur) 0) ;; I think top is basically unused, but seems to be the _lowest_ address. ;; maybe it's the top when VRAM is viewed on the screen. - (set! (-> obj top) (-> obj cur)) + (set! (-> this top) (-> this cur)) ;; by default, use the default allocator. - (set! (-> obj allocate-func) texture-page-default-allocate) + (set! (-> this allocate-func) texture-page-default-allocate) ;; allocate the weird stuff we always want (font, sky, etc) - (allocate-defaults! obj) - (set! (-> obj font-palette) (allocate-vram-words! obj 64)) + (allocate-defaults! this) + (set! (-> this font-palette) (allocate-vram-words! this 64)) ;; mark the common page area as not-uploaded. (dotimes (v1-6 32) - (set! (-> obj common-page v1-6) (the-as texture-page 0)) + (set! (-> this common-page v1-6) (the-as texture-page 0)) ) - (set! (-> obj common-page-mask) 0) + (set! (-> this common-page-mask) 0) ;; clear ids. This stores the texture ids that are stored at each "pool page", or 0 if there is junk. ;; it is used for the lazy loading system to see if the data is already there. (dotimes (v1-9 160) - (set! (-> obj ids v1-9) (the-as uint 0)) + (set! (-> this ids v1-9) (the-as uint 0)) ) - obj + this ) -(defmethod get-leftover-block-count texture-page ((obj texture-page) (segment-count int) (additional-size int)) +(defmethod get-leftover-block-count texture-page ((this texture-page) (segment-count int) (additional-size int)) "This returns how many blocks are used in the last pool page. It uses pool-pages, which are 64 blocks or 16 kB." (let ((v1-0 additional-size)) (dotimes (a2-1 segment-count) - (+! v1-0 (the-as int (-> obj segment a2-1 size))) + (+! v1-0 (the-as int (-> this segment a2-1 size))) ) (logand (sar v1-0 6) 63) ) ) -(defmethod print-usage texture-pool ((obj texture-pool)) +(defmethod print-usage texture-pool ((this texture-pool)) "Print out VRAM usage." (format #t "--------------------~%") (format #t "texture pool ~DK - ~DK (~DK used, ~DK free)~%" - (sar (-> obj top) 8) ;; vram words to kb - (sar (-> obj cur) 8) ;; vram words to kb - (sar (- (-> obj cur) (-> obj top)) 8) - (sar (- #xfa000 (-> obj cur)) 8) ;; 4 MB, doesn't seem to account for framebuffers? + (sar (-> this top) 8) ;; vram words to kb + (sar (-> this cur) 8) ;; vram words to kb + (sar (- (-> this cur) (-> this top)) 8) + (sar (- #xfa000 (-> this cur)) 8) ;; 4 MB, doesn't seem to account for framebuffers? ) (format #t "--------------------~%") - obj + this ) -(defmethod allocate-segment! texture-pool ((obj texture-pool) (segment texture-pool-segment) (size int)) +(defmethod allocate-segment! texture-pool ((this texture-pool) (segment texture-pool-segment) (size int)) "Allocate a segment of the given size. The segment is an output here, containing size/dest." (set! (-> segment size) (the-as uint size)) - (set! (-> segment dest) (the-as uint (allocate-vram-words! obj size))) + (set! (-> segment dest) (the-as uint (allocate-vram-words! this size))) segment ) @@ -610,14 +611,14 @@ (defconstant SPECIAL_VRAM_WORDS #x7000) ;; for sky, eyes, ocean, and depth-cue effect rendering. -(defmethod allocate-defaults! texture-pool ((obj texture-pool)) +(defmethod allocate-defaults! texture-pool ((this texture-pool)) "Allocate default segments" ;; allocate the common and near segments - (allocate-segment! obj (-> obj segment-common) COMMON_SEGMENT_WORDS) ;; ~0.5 MB - (allocate-segment! obj (-> obj segment-near) NEAR_SEGMENT_WORDS) ;; ~1.6 MB. + (allocate-segment! this (-> this segment-common) COMMON_SEGMENT_WORDS) ;; ~0.5 MB + (allocate-segment! this (-> this segment-near) NEAR_SEGMENT_WORDS) ;; ~1.6 MB. ;; Allocate the random crap - (set! *sky-base-vram-word* (allocate-vram-words! obj SPECIAL_VRAM_WORDS)) + (set! *sky-base-vram-word* (allocate-vram-words! this SPECIAL_VRAM_WORDS)) (set! *sky-base-block* (sar *sky-base-vram-word* 6)) (set! *sky-base-page* (sar *sky-base-vram-word* 11)) (set! *eyes-base-vram-word* (+ *sky-base-vram-word* 6144)) @@ -638,13 +639,13 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod remove-from-heap texture-page ((obj texture-page) (seg kheap)) +(defmethod remove-from-heap texture-page ((this texture-page) (seg kheap)) "Remove the texture data from the heap. This can only safely be called immediately after the texture-page is loaded. This is used for textures that always live in VRAM." ;; this keeps around the texture objects themselves. - (set! (-> seg current) (-> obj segment 0 block-data)) - obj + (set! (-> seg current) (-> this segment 0 block-data)) + this ) (defun texture-page-default-allocate ((pool texture-pool) (page texture-page) (heap kheap) (tpage-id int)) @@ -1362,7 +1363,7 @@ ;; It will also link the textures. ;; You _must_ login textures. -(defmethod login-level-textures texture-pool ((obj texture-pool) (level level) (max-page-kind int) (id-array (pointer texture-id))) +(defmethod login-level-textures texture-pool ((this texture-pool) (level level) (max-page-kind int) (id-array (pointer texture-id))) "Login textures in a level. Only does up to max-page-kind. Set this to water (4) to do all of them. Also checks sizes. This is called from level.gc as part of level loading." @@ -1426,11 +1427,11 @@ ) ) ;; check with no prints first - (let ((overflow-bits (texture-page-size-check obj level #t))) + (let ((overflow-bits (texture-page-size-check this level #t))) (when (nonzero? overflow-bits) ;; and if it failed, print info (format #t "-------------------- tpage overflow error #x~X~%" overflow-bits) - (texture-page-size-check obj level #f) + (texture-page-size-check this level #f) (format #t "--------------------~%") ) ) @@ -1440,7 +1441,7 @@ ;; for movie hack. (defun-extern movie? symbol) -(defmethod add-tex-to-dma! texture-pool ((obj texture-pool) (level level) (tex-page-kind int)) +(defmethod add-tex-to-dma! texture-pool ((this texture-pool) (level level) (tex-page-kind int)) "For the given tpage-kind, upload as needed for the level" (when (= tex-page-kind (tpage-kind tfrag)) ;; TFRAG (0) ;; get the texture page, bucket to add to, and an effective distance from the closest thing. @@ -1469,7 +1470,7 @@ (if (< distance (meters 20)) (set! (-> level upload-size 0) (+ (-> level upload-size 0) - (upload-vram-pages obj (-> obj segment-near) tfrag-page 2 tfrag-bucket) + (upload-vram-pages this (-> this segment-near) tfrag-page 2 tfrag-bucket) ) ) ) @@ -1479,7 +1480,7 @@ ;; pretty far. Just do segment 0. (set! (-> level upload-size 0) (+ (-> level upload-size 0) - (upload-vram-pages obj (-> obj segment-common) tfrag-page 0 tfrag-bucket) + (upload-vram-pages this (-> this segment-common) tfrag-page 0 tfrag-bucket) ) ) ) @@ -1487,7 +1488,7 @@ ;; pretty close. Do segment 0 and 1. (set! (-> level upload-size 0) (+ (-> level upload-size 0) - (upload-vram-pages obj (-> obj segment-common) tfrag-page -2 tfrag-bucket) + (upload-vram-pages this (-> this segment-common) tfrag-page -2 tfrag-bucket) ) ) ) @@ -1503,7 +1504,7 @@ ;; just upload the whole thing always. ;; use the cache mask as requested by the level. (set! (-> level upload-size 1) - (upload-vram-pages-pris obj (-> obj segment-common) pris-page pris-bucket (the-as int (-> level texture-mask 7))) + (upload-vram-pages-pris this (-> this segment-common) pris-page pris-bucket (the-as int (-> level texture-mask 7))) ) ) ) @@ -1533,7 +1534,7 @@ ) ) (set! (-> level upload-size 2) - (upload-vram-pages obj (-> obj segment-common) shrub-page shrub-mode shrub-bucket) + (upload-vram-pages this (-> this segment-common) shrub-page shrub-mode shrub-bucket) ) ) ) @@ -1563,12 +1564,12 @@ ;; there's some serious hack here. We invalidate some ;; alpha texture when in movie mode. (when (movie?) - (set! (-> obj ids alpha-dest-chunk) (the-as uint 0)) - (set! (-> obj ids (+ alpha-dest-chunk 1)) (the-as uint 0)) + (set! (-> this ids alpha-dest-chunk) (the-as uint 0)) + (set! (-> this ids (+ alpha-dest-chunk 1)) (the-as uint 0)) ) ) (set! (-> level upload-size 3) - (upload-vram-pages obj (-> obj segment-common) alpha-page alpha-mode alpha-bucket) + (upload-vram-pages this (-> this segment-common) alpha-page alpha-mode alpha-bucket) ) ) ) @@ -1580,7 +1581,7 @@ (if (and water-page (nonzero? water-page)) (let ((water-bucket (if (zero? (-> level index)) (bucket-id water-tex0) (bucket-id water-tex1)))) (set! (-> level upload-size 4) - (upload-vram-pages-pris obj (-> obj segment-common) water-page water-bucket (the-as int (-> level texture-mask 8))) + (upload-vram-pages-pris this (-> this segment-common) water-page water-bucket (the-as int (-> level texture-mask 8))) ) ) ) @@ -1590,15 +1591,15 @@ (none) ) -(defmethod upload-one-common! texture-pool ((obj texture-pool) (lev level)) +(defmethod upload-one-common! texture-pool ((this texture-pool) (lev level)) "Upload the first common texture page that's in in the common-page-mask." (dotimes (v1-0 32) - (let ((a2-0 (-> obj common-page v1-0))) + (let ((a2-0 (-> this common-page v1-0))) (when (and (nonzero? a2-0) ;; known common texture page - (and (nonzero? a2-0) (logtest? (-> obj common-page-mask) (ash 1 v1-0))) ;; in the mask. + (and (nonzero? a2-0) (logtest? (-> this common-page-mask) (ash 1 v1-0))) ;; in the mask. ) ;; upload it! - (upload-vram-pages obj (-> obj segment-common) a2-0 -2 (bucket-id common-page-tex)) + (upload-vram-pages this (-> this segment-common) a2-0 -2 (bucket-id common-page-tex)) (return #f) ) ) @@ -1606,11 +1607,11 @@ #f ) -(defmethod add-irq-to-tex-buckets! level ((obj level)) +(defmethod add-irq-to-tex-buckets! level ((this level)) "Adds a packet that will cause a VIF interrupt to the end of all texture buckets for a given level. This will trigger a VU1 profiler bar" (cond - ((zero? (-> obj index)) + ((zero? (-> this index)) ;; use bucket numbers for the 0th level ;; TFRAG (with-dma-buffer-add-bucket ((v1-4 (-> (current-frame) global-buf)) @@ -1691,12 +1692,12 @@ ;; the actual texture data doesn't go in the buffer, just tags to set up the transfer (define *txt-dma-list* (new 'global 'dma-buffer 4096)) -(defmethod upload-now! texture-page ((obj texture-page) (arg0 int)) +(defmethod upload-now! texture-page ((this texture-page) (arg0 int)) "Immediately upload the texture-page to the given buffer, using arg0 mode." (#when PC_PORT ;; load it to the PC Port's texture pool. - (__pc-texture-upload-now obj arg0) + (__pc-texture-upload-now this arg0) ) (let ((gp-0 *txt-dma-list*)) @@ -1706,7 +1707,7 @@ (set! (-> v1-0 end) (&-> v1-0 data-buffer (-> v1-0 allocated-length))) ) ;; add the texture to the buffer - (add-to-dma-buffer obj gp-0 arg0) + (add-to-dma-buffer this gp-0 arg0) ;; DMA -> VIF (direct) -> GIF ;; GIF texflush @@ -1730,7 +1731,7 @@ (none) ) -(defmethod add-to-dma-buffer texture-page ((obj texture-page) (dma-buff dma-buffer) (mode int)) +(defmethod add-to-dma-buffer texture-page ((this texture-page) (dma-buff dma-buffer) (mode int)) "Helper for upload-now! to upload texture-page to VRAM" (local-vars (total-size int)) (let ((v1-0 mode)) @@ -1743,18 +1744,18 @@ ((= v1-0 -2) ;; segment 0, 1 only (the-as int - (+ (-> obj segment 0 size) - (-> obj segment 1 size) + (+ (-> this segment 0 size) + (-> this segment 1 size) ) ) ) ((= v1-0 -1) ;; the whole thing. - (the-as int (-> obj size)) + (the-as int (-> this size)) ) (else ;; 0, 1, 2, just segment 0, 1, 2 - (the-as int (-> obj segment mode size)) + (the-as int (-> this segment mode size)) ) ) ) @@ -1763,8 +1764,8 @@ ;; loop over chunks to load (let* ((start-segment (max 0 mode)) (chunk-count (* (/ (+ (/ total-size 64) 63) 64) 32)) - (current-dest (shr (-> obj segment start-segment dest) 6)) - (current-data (-> obj segment start-segment block-data)) + (current-dest (shr (-> this segment start-segment dest) 6)) + (current-data (-> this segment start-segment block-data)) ) (while (> chunk-count 0) ;; do up to 2048 now @@ -1882,13 +1883,13 @@ ;; The font texture is a special case. (define-perm *font-texture* texture #f) -(defmethod setup-font-texture! texture-pool ((obj texture-pool)) +(defmethod setup-font-texture! texture-pool ((this texture-pool)) "Move the font textures to the upper 8-bits of the depth buffer." (local-vars (heap-before-font-tex int) (clut-dest-addr int)) ;; we reserved some space for the CLUT earlier. I guess it didn't fit in the depth buffer too - (let ((font-clut (-> obj font-palette))) + (let ((font-clut (-> this font-palette))) ;; we're going to try to find the font texture - (set! heap-before-font-tex (-> obj cur)) + (set! heap-before-font-tex (-> this cur)) (set! clut-dest-addr (/ font-clut 64)) ;; find the font texture. @@ -1992,9 +1993,9 @@ ;; try to kick out the font texture (if (and main-font-tx ;; we found it (-> main-font-tx page) ;; directory has it - (= (-> obj cur) (+ heap-before-font-tex (the-as int (-> main-font-tx page size)))) ;; not killing other stuff + (= (-> this cur) (+ heap-before-font-tex (the-as int (-> main-font-tx page size)))) ;; not killing other stuff ) - (set! (-> obj cur) heap-before-font-tex) ;; kick first copy out of VRAM! + (set! (-> this cur) heap-before-font-tex) ;; kick first copy out of VRAM! ;; or, if we failed, complain. (format 0 "ERROR: could not resize heap to remove gamefont.~%") ) @@ -2007,33 +2008,33 @@ ;; The texture page directory is a list of all texture pages. ;; It is actually stored in the dir-tpages.o object file, which is pre-populated with lengths. -(defmethod asize-of texture-page-dir ((obj texture-page-dir)) +(defmethod asize-of texture-page-dir ((this texture-page-dir)) "Get the size in memory of a texture-page-dir" - (the-as int (+ (-> texture-page-dir size) (the-as uint (* 12 (+ (-> obj length) -1))))) + (the-as int (+ (-> texture-page-dir size) (the-as uint (* 12 (+ (-> this length) -1))))) ) -(defmethod length texture-page-dir ((obj texture-page-dir)) +(defmethod length texture-page-dir ((this texture-page-dir)) "Get the number of tpages in the texture-page-dir" - (-> obj length) + (-> this length) ) -(defmethod relocate texture-page-dir ((obj texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate texture-page-dir ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) "Load a texture-page-dir" ;; just set the global. - (tex-dbg "Loaded texture-page-dir ~A with ~D entries~%" obj (-> obj length)) - (set! *texture-page-dir* obj) + (tex-dbg "Loaded texture-page-dir ~A with ~D entries~%" this (-> this length)) + (set! *texture-page-dir* this) (none) ) -(defmethod relocate-dests! texture-page ((obj texture-page) (new-dest int) (seg-id int)) +(defmethod relocate-dests! texture-page ((this texture-page) (new-dest int) (seg-id int)) "Update a texture-page so all the textures point to a new location" (let ((v1-0 (shr new-dest 6)) - (dst-block (shr (-> obj segment seg-id dest) 6)) + (dst-block (shr (-> this segment seg-id dest) 6)) ) (when (!= v1-0 dst-block) ;; skip if already correct - (dotimes (tex-id (-> obj length)) ;; iterate through all textures - (when (-> obj data tex-id) ;; only if we have a texture - (let* ((tex (-> obj data tex-id)) + (dotimes (tex-id (-> this length)) ;; iterate through all textures + (when (-> this data tex-id) ;; only if we have a texture + (let* ((tex (-> this data tex-id)) (num-mips (-> tex num-mips)) ) ;; (tex-dbg " relocate-dests! ~A~%" tex) @@ -2062,59 +2063,59 @@ ) ) ) - ;; (format #t "relocate dests: ~A seg ~D from ~D to ~D~%" obj seg-id (-> obj segment seg-id dest) new-dest) - (set! (-> obj segment seg-id dest) (the-as uint new-dest)) + ;; (format #t "relocate dests: ~A seg ~D from ~D to ~D~%" this seg-id (-> this segment seg-id dest) new-dest) + (set! (-> this segment seg-id dest) (the-as uint new-dest)) ) ) (none) ) -(defmethod relocate texture-page ((obj texture-page) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate texture-page ((this texture-page) (arg0 kheap) (arg1 (pointer uint8))) "Add to VRAM and allocate links. This method is called by the GOAL linker when it loads a texture page." - (tex-dbg "loaded tpage ~A~%" obj - ;;(-> obj info file-name) - ;;(-> obj info maya-file-name) - ;;(-> obj info tool-debug) - ;;(-> obj info mdb-file-name) + (tex-dbg "loaded tpage ~A~%" this + ;;(-> this info file-name) + ;;(-> this info maya-file-name) + ;;(-> this info tool-debug) + ;;(-> this info mdb-file-name) ) (local-vars (s4-0 texture-page-dir-entry)) (cond - ((or (not obj) - (not (file-info-correct-version? (-> obj info) (file-kind tpage) 0)) + ((or (not this) + (not (file-info-correct-version? (-> this info) (file-kind tpage) 0)) ) ;; bad file - (set! obj (the-as texture-page #f)) + (set! this (the-as texture-page #f)) ) ((begin (let ((v1-2 (-> *level* loading-level))) ;; loading/linking level (tex-dbg " tpage is with level ~A~%" v1-2) (when v1-2 ;; add us to the loading level's tpages - (set! (-> v1-2 loaded-texture-page (-> v1-2 loaded-texture-page-count)) obj) + (set! (-> v1-2 loaded-texture-page (-> v1-2 loaded-texture-page-count)) this) (+! (-> v1-2 loaded-texture-page-count) 1) ) ) ;; set our dests for the 3 segments being in order - (set! (-> obj segment 1 dest) (-> obj segment 0 size)) - (set! (-> obj segment 2 dest) (+ (-> obj segment 0 size) (-> obj segment 1 size))) + (set! (-> this segment 1 dest) (-> this segment 0 size)) + (set! (-> this segment 2 dest) (+ (-> this segment 0 size) (-> this segment 1 size))) ;; grab our tpage dir entry - (let ((a3-0 (-> obj id))) + (let ((a3-0 (-> this id))) (set! s4-0 (-> *texture-page-dir* entries a3-0)) (set! (-> *texture-relocate-later* memcpy) #f) ;; allocate! - ((-> *texture-pool* allocate-func) *texture-pool* obj arg0 (the-as int a3-0)) + ((-> *texture-pool* allocate-func) *texture-pool* this arg0 (the-as int a3-0)) ) ;; the actual condition (not (-> *texture-relocate-later* memcpy)) ) ;; if no relocate later memcpy, then we allocate links - (set! (-> s4-0 page) obj) + (set! (-> s4-0 page) this) (if (not (-> s4-0 link)) (set! (-> s4-0 link) - (the-as texture-link (malloc 'loading-level (* (max (-> s4-0 length) (-> obj length)) 4))) + (the-as texture-link (malloc 'loading-level (* (max (-> s4-0 length) (-> this length)) 4))) ) ) ) @@ -2122,7 +2123,7 @@ ;; yes memcpy, we can't allocate on the heap. (let ((v1-19 *texture-relocate-later*)) (set! (-> v1-19 entry) s4-0) - (set! (-> v1-19 page) obj) + (set! (-> v1-19 page) this) ) ) ) @@ -2202,7 +2203,7 @@ ) ) -(defmethod unload! texture-pool ((obj texture-pool) (arg0 texture-page)) +(defmethod unload! texture-pool ((this texture-pool) (arg0 texture-page)) "Unload the texture from the directory" (local-vars (a0-2 int)) (let ((v1-0 *texture-page-dir*)) @@ -2257,15 +2258,15 @@ ) ) -(defmethod unlink-textures-in-heap! texture-page-dir ((obj texture-page-dir) (heap kheap)) +(defmethod unlink-textures-in-heap! texture-page-dir ((this texture-page-dir) (heap kheap)) "Remove adgif shaders that are in the given heap" (local-vars (dist-past-end uint)) (let ((mem-start (-> heap base)) (mem-end (-> heap top-base)) ) ;; iterate over all entries in the director - (dotimes (entry-idx (-> obj length)) - (let* ((entry (-> obj entries entry-idx)) + (dotimes (entry-idx (-> this length)) + (let* ((entry (-> this entries entry-idx)) (tex-page (-> entry page)) (link-arr (-> entry link next)) (tex-count (min (-> tex-page length) (-> entry length))) @@ -2626,9 +2627,9 @@ (none) ) -(defmethod inspect texture-page-dir ((obj texture-page-dir)) - (texture-page-dir-inspect obj #f) - obj +(defmethod inspect texture-page-dir ((this texture-page-dir)) + (texture-page-dir-inspect this #f) + this ) diff --git a/goal_src/jak1/engine/gfx/tfrag/tfrag-h.gc b/goal_src/jak1/engine/gfx/tfrag/tfrag-h.gc index 94141ac747..6c6a883d82 100644 --- a/goal_src/jak1/engine/gfx/tfrag/tfrag-h.gc +++ b/goal_src/jak1/engine/gfx/tfrag/tfrag-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: tfrag-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; definition of type tfragment-stats (deftype tfragment-stats (structure) ((num-tris uint16 4 :offset-assert 0) diff --git a/goal_src/jak1/engine/gfx/tfrag/tfrag-methods.gc b/goal_src/jak1/engine/gfx/tfrag/tfrag-methods.gc index c3d4b1f2ed..6a8ed997c4 100644 --- a/goal_src/jak1/engine/gfx/tfrag/tfrag-methods.gc +++ b/goal_src/jak1/engine/gfx/tfrag/tfrag-methods.gc @@ -5,6 +5,7 @@ ;; name in dgo: tfrag-methods ;; dgos: GAME, ENGINE +;; DECOMP BEGINS (defun edge-debug-lines ((arg0 (array vector-array))) "Draw edge debug lines" @@ -717,12 +718,12 @@ ;; definition for method 10 of type drawable-tree-tfrag ;; INFO: Return type mismatch drawable-tree-tfrag vs none. -(defmethod draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* tfrag-trees v1-1) obj) + (set! (-> *background-work* tfrag-trees v1-1) this) (set! (-> *background-work* tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* tfrag-tree-count) 1) @@ -731,12 +732,12 @@ ;; definition for method 10 of type drawable-tree-trans-tfrag ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. -(defmethod draw drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag) (arg0 drawable-tree-trans-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag) (arg0 drawable-tree-trans-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* trans-tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* trans-tfrag-trees v1-1) obj) + (set! (-> *background-work* trans-tfrag-trees v1-1) this) (set! (-> *background-work* trans-tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* trans-tfrag-tree-count) 1) @@ -745,12 +746,12 @@ ;; definition for method 10 of type drawable-tree-dirt-tfrag ;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none. -(defmethod draw drawable-tree-dirt-tfrag ((obj drawable-tree-dirt-tfrag) (arg0 drawable-tree-dirt-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-dirt-tfrag ((this drawable-tree-dirt-tfrag) (arg0 drawable-tree-dirt-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* dirt-tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* dirt-tfrag-trees v1-1) obj) + (set! (-> *background-work* dirt-tfrag-trees v1-1) this) (set! (-> *background-work* dirt-tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* dirt-tfrag-tree-count) 1) @@ -759,12 +760,12 @@ ;; definition for method 10 of type drawable-tree-ice-tfrag ;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none. -(defmethod draw drawable-tree-ice-tfrag ((obj drawable-tree-ice-tfrag) (arg0 drawable-tree-ice-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-ice-tfrag ((this drawable-tree-ice-tfrag) (arg0 drawable-tree-ice-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* ice-tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* ice-tfrag-trees v1-1) obj) + (set! (-> *background-work* ice-tfrag-trees v1-1) this) (set! (-> *background-work* ice-tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* ice-tfrag-tree-count) 1) @@ -773,12 +774,12 @@ ;; definition for method 10 of type drawable-tree-lowres-tfrag ;; INFO: Return type mismatch drawable-tree-lowres-tfrag vs none. -(defmethod draw drawable-tree-lowres-tfrag ((obj drawable-tree-lowres-tfrag) (arg0 drawable-tree-lowres-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-lowres-tfrag ((this drawable-tree-lowres-tfrag) (arg0 drawable-tree-lowres-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* lowres-tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* lowres-tfrag-trees v1-1) obj) + (set! (-> *background-work* lowres-tfrag-trees v1-1) this) (set! (-> *background-work* lowres-tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* lowres-tfrag-tree-count) 1) @@ -790,12 +791,12 @@ (defmethod draw drawable-tree-lowres-trans-tfrag - ((obj drawable-tree-lowres-trans-tfrag) (arg0 drawable-tree-lowres-trans-tfrag) (arg1 display-frame)) + ((this drawable-tree-lowres-trans-tfrag) (arg0 drawable-tree-lowres-trans-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* lowres-trans-tfrag-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* lowres-trans-tfrag-trees v1-1) obj) + (set! (-> *background-work* lowres-trans-tfrag-trees v1-1) this) (set! (-> *background-work* lowres-trans-tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* lowres-trans-tfrag-tree-count) 1) @@ -803,15 +804,15 @@ ) ;; definition for method 14 of type tfragment -(defmethod collect-stats tfragment ((obj tfragment)) - (stats-tfrag-asm obj) +(defmethod collect-stats tfragment ((this tfragment)) + (stats-tfrag-asm this) (none) ) ;; definition for method 14 of type drawable-tree-tfrag ;; INFO: Return type mismatch drawable-tree-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-tfrag ((obj drawable-tree-tfrag)) +(defmethod collect-stats drawable-tree-tfrag ((this drawable-tree-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) @@ -820,8 +821,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -830,7 +831,7 @@ ;; definition for method 14 of type drawable-tree-lowres-tfrag ;; INFO: Return type mismatch drawable-tree-lowres-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-lowres-tfrag ((obj drawable-tree-lowres-tfrag)) +(defmethod collect-stats drawable-tree-lowres-tfrag ((this drawable-tree-lowres-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) @@ -839,8 +840,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -849,7 +850,7 @@ ;; definition for method 14 of type drawable-tree-trans-tfrag ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag)) +(defmethod collect-stats drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) @@ -858,8 +859,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -868,7 +869,7 @@ ;; definition for method 14 of type drawable-tree-lowres-trans-tfrag ;; INFO: Return type mismatch drawable-tree-lowres-trans-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-lowres-trans-tfrag ((obj drawable-tree-lowres-trans-tfrag)) +(defmethod collect-stats drawable-tree-lowres-trans-tfrag ((this drawable-tree-lowres-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) @@ -877,8 +878,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -887,7 +888,7 @@ ;; definition for method 14 of type drawable-tree-dirt-tfrag ;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-dirt-tfrag ((obj drawable-tree-dirt-tfrag)) +(defmethod collect-stats drawable-tree-dirt-tfrag ((this drawable-tree-dirt-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) @@ -896,8 +897,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -906,7 +907,7 @@ ;; definition for method 14 of type drawable-tree-ice-tfrag ;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none. ;; Used lq/sq -(defmethod collect-stats drawable-tree-ice-tfrag ((obj drawable-tree-ice-tfrag)) +(defmethod collect-stats drawable-tree-ice-tfrag ((this drawable-tree-ice-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag)))) @@ -915,8 +916,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -924,10 +925,10 @@ ;; definition for method 14 of type drawable-inline-array-tfrag ;; INFO: Return type mismatch drawable-inline-array-tfrag vs none. -(defmethod collect-stats drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag)) +(defmethod collect-stats drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (if (vis-cull (-> s4-0 id)) (collect-stats s4-0) ) @@ -939,10 +940,10 @@ ;; definition for method 14 of type drawable-inline-array-trans-tfrag ;; INFO: Return type mismatch drawable-inline-array-trans-tfrag vs none. -(defmethod collect-stats drawable-inline-array-trans-tfrag ((obj drawable-inline-array-trans-tfrag)) +(defmethod collect-stats drawable-inline-array-trans-tfrag ((this drawable-inline-array-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (if (vis-cull (-> s4-0 id)) (collect-stats s4-0) ) @@ -954,10 +955,10 @@ ;; definition for method 15 of type drawable-tree-tfrag ;; INFO: Return type mismatch drawable-tree-tfrag vs none. -(defmethod debug-draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) - (dotimes (s4-0 (-> obj length)) - (let ((a1-1 (-> obj arrays s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((a1-1 (-> this arrays s4-0))) (debug-draw a1-1 a1-1 arg1) ) ) @@ -967,10 +968,10 @@ ;; definition for method 15 of type drawable-tree-trans-tfrag ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. -(defmethod debug-draw drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) - (dotimes (s4-0 (-> obj length)) - (let ((a1-1 (-> obj arrays s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((a1-1 (-> this arrays s4-0))) (debug-draw a1-1 a1-1 arg1) ) ) @@ -983,9 +984,9 @@ (defmethod debug-draw drawable-inline-array-tfrag - ((obj drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj data s4-0))) + ((this drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this data s4-0))) (if (vis-cull (-> s3-0 id)) (debug-draw s3-0 s3-0 arg1) ) @@ -995,12 +996,11 @@ ) ;; definition for method 15 of type tfragment -(defmethod debug-draw tfragment ((obj tfragment) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw tfragment ((this tfragment) (arg0 drawable) (arg1 display-frame)) (-> arg1 global-buf) - (edge-debug-lines (-> obj debug-data debug-lines)) + (edge-debug-lines (-> this debug-data debug-lines)) - (add-debug-sphere #t (bucket-id debug) (-> obj bsphere) (-> obj bsphere w) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) - ;;(add-debug-x #t (bucket-id debug) (-> obj bsphere) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + (add-debug-sphere #t (bucket-id debug) (-> this bsphere) (-> this bsphere w) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + ;;(add-debug-x #t (bucket-id debug) (-> this bsphere) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) (none) ) - diff --git a/goal_src/jak1/engine/gfx/tfrag/tfrag.gc b/goal_src/jak1/engine/gfx/tfrag/tfrag.gc index 72c51a2585..12abe6403d 100644 --- a/goal_src/jak1/engine/gfx/tfrag/tfrag.gc +++ b/goal_src/jak1/engine/gfx/tfrag/tfrag.gc @@ -22,30 +22,31 @@ ;; - the draw-drawable-tree-tfrag function sets up DMA, eventually calls draw-inline-array-tfrag (in this file), which actually does the DMA setup. +;; DECOMP BEGINS ;;;;;;;;;;;;;;;;;;;;;;;; ;; basic methods ;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod login tfragment ((obj tfragment)) +(defmethod login tfragment ((this tfragment)) "Initialize a tfragment by linking the textures in adgif shaders" - (dotimes (s5-0 (the-as int (-> obj num-shaders))) - (adgif-shader-login-no-remap (-> obj shader s5-0)) + (dotimes (s5-0 (the-as int (-> this num-shaders))) + (adgif-shader-login-no-remap (-> this shader s5-0)) ) - obj + this ) -(defmethod mem-usage tfragment ((obj tfragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage tfragment ((this tfragment) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a tfragment" ;; seems like this flag does colors? (when (logtest? arg1 2) (+! (-> arg0 data 19 count) 1) - (let ((v1-6 (+ (-> obj num-base-colors) (-> obj num-level0-colors) (-> obj num-level1-colors)))) + (let ((v1-6 (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors)))) (+! (-> arg0 data 19 used) v1-6) (+! (-> arg0 data 19 total) (logand -4 (+ v1-6 3))) ) - (return obj) + (return this) ) (let ((s4-0 1)) @@ -54,7 +55,7 @@ (+! (-> arg0 data s4-0 count) 1) ;; the size of the actual tfragment - (let ((v1-22 (asize-of obj))) + (let ((v1-22 (asize-of this))) (+! (-> arg0 data s4-0 used) v1-22) (+! (-> arg0 data s4-0 total) (logand -16 (+ v1-22 15))) ) @@ -62,7 +63,7 @@ ;; the size of the "base" DMA (set! (-> arg0 data (+ s4-0 1) name) "tfragment-base") (+! (-> arg0 data (+ s4-0 1) count) 1) - (let ((v1-33 (* (-> obj dma-qwc 0) 16))) + (let ((v1-33 (* (-> this dma-qwc 0) 16))) (+! (-> arg0 data (+ s4-0 1) used) v1-33) (+! (-> arg0 data (+ s4-0 1) total) v1-33) ) @@ -70,16 +71,16 @@ ;; the size of the "common" DMA (set! (-> arg0 data (+ s4-0 2) name) "tfragment-common") (+! (-> arg0 data (+ s4-0 2) count) 1) - (let ((v1-43 (* (- (-> obj dma-qwc 1) (-> obj dma-qwc 0)) 16))) + (let ((v1-43 (* (- (-> this dma-qwc 1) (-> this dma-qwc 0)) 16))) (+! (-> arg0 data (+ s4-0 2) used) v1-43) (+! (-> arg0 data (+ s4-0 2) total) v1-43) ) ;; the size of the "level0" DMA (set! (-> arg0 data (+ s4-0 3) name) "tfragment-level0") - (when (nonzero? (-> obj num-level0-colors)) + (when (nonzero? (-> this num-level0-colors)) (+! (-> arg0 data (+ s4-0 3) count) 1) - (let ((v1-55 (* (- (-> obj dma-qwc 2) (-> obj dma-qwc 0)) 16))) + (let ((v1-55 (* (- (-> this dma-qwc 2) (-> this dma-qwc 0)) 16))) (+! (-> arg0 data (+ s4-0 3) used) v1-55) (+! (-> arg0 data (+ s4-0 3) total) v1-55) ) @@ -87,14 +88,14 @@ ;; The size of the "level0" DMA. Note that the dma chains can overlap, so this is a bit weird. (set! (-> arg0 data (+ s4-0 4) name) "tfragment-level1") - (when (not (or (= (-> obj dma-level-1) (-> obj dma-common)) - (= (-> obj dma-level-1) (-> obj dma-base)) - (zero? (-> obj num-level1-colors)) + (when (not (or (= (-> this dma-level-1) (-> this dma-common)) + (= (-> this dma-level-1) (-> this dma-base)) + (zero? (-> this num-level1-colors)) ) ) (+! (-> arg0 data (+ s4-0 4) count) 1) - (let ((v1-70 (* (- (-> obj dma-qwc 3) - (the-as uint (- (/ (the-as int (- (-> obj dma-level-1) (-> obj dma-common))) 16) (the-as int (-> obj dma-qwc 0)))) + (let ((v1-70 (* (- (-> this dma-qwc 3) + (the-as uint (- (/ (the-as int (- (-> this dma-level-1) (-> this dma-common))) 16) (the-as int (-> this dma-qwc 0)))) ) 16 ) @@ -110,7 +111,7 @@ (+! (-> arg0 data (+ s4-0 5) count) 1) (let ((v1-79 (if (logtest? arg1 1) 0 - (the-as int (* (+ (-> obj num-base-colors) (-> obj num-level0-colors) (-> obj num-level1-colors)) 2)) + (the-as int (* (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors)) 2)) ) ) ) @@ -122,32 +123,32 @@ (set! (-> arg0 data (+ s4-0 6) name) "tfragment-debug") ) - obj + this ) ;;;;;;;;;;;;;;;;;;;;;;; ;; tree/array methods ;;;;;;;;;;;;;;;;;;;;;;; -(defmethod inspect drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag)) +(defmethod inspect drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) "Inspect an array of tfragments." - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) -(defmethod login drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) -(defmethod mem-usage drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-tfrag ((this drawable-inline-array-tfrag) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -155,37 +156,37 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod mem-usage drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 0 used) v1-6) (+! (-> arg0 data 0 total) (logand -16 (+ v1-6 15))) ) - (when (nonzero? (-> obj time-of-day-pal)) + (when (nonzero? (-> this time-of-day-pal)) (set! (-> arg0 length) (max 9 (-> arg0 length))) (set! (-> arg0 data 8 name) "tfragment-pal") (+! (-> arg0 data 8 count) 1) - (let ((v1-18 (asize-of (-> obj time-of-day-pal)))) + (let ((v1-18 (asize-of (-> this time-of-day-pal)))) (+! (-> arg0 data 8 used) v1-18) (+! (-> arg0 data 8 total) (logand -16 (+ v1-18 15))) ) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj arrays s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this arrays s3-0) arg0 arg1) ) - obj + this ) -(defmethod asize-of drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag)) - (the-as int (+ (-> drawable-inline-array-tfrag size) (* (+ (-> obj length) -1) 64))) +(defmethod asize-of drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) + (the-as int (+ (-> drawable-inline-array-tfrag size) (* (+ (-> this length) -1) 64))) ) ;;;;;;;;;;;;;;;;;;;;;; diff --git a/goal_src/jak1/engine/gfx/tie/generic-tie-h.gc b/goal_src/jak1/engine/gfx/tie/generic-tie-h.gc index 7b132b63b2..4ac591ec32 100644 --- a/goal_src/jak1/engine/gfx/tie/generic-tie-h.gc +++ b/goal_src/jak1/engine/gfx/tie/generic-tie-h.gc @@ -7,6 +7,8 @@ ;; Generic tie converts tie data to generic and supports environment mapping. +;; DECOMP BEGINS + (deftype generic-tie-instance (structure) ((matrix-tag dma-packet :inline :offset-assert 0) (matrix-data vector 6 :inline :offset-assert 16) diff --git a/goal_src/jak1/engine/gfx/tie/tie-methods.gc b/goal_src/jak1/engine/gfx/tie/tie-methods.gc index 57ab4f4f80..ddc0568cbc 100644 --- a/goal_src/jak1/engine/gfx/tie/tie-methods.gc +++ b/goal_src/jak1/engine/gfx/tie/tie-methods.gc @@ -8,6 +8,8 @@ (def-mips2c draw-inline-array-instance-tie (function pointer (inline-array instance-tie) int dma-buffer none)) (def-mips2c draw-inline-array-prototype-tie-generic-asm (function dma-buffer int prototype-array-tie none)) +;; DECOMP BEGINS + (defun pc-add-tie-envmap-info ((dma-buf dma-buffer)) (let ((packet (the-as dma-packet (-> dma-buf base)))) (set! (-> packet dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc 1)) @@ -264,14 +266,14 @@ ;; draw-inline-array-prototype-tie-near-asm -(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) - (if (nonzero? (-> obj prototypes prototype-array-tie)) - (login (-> obj prototypes prototype-array-tie)) +(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) + (if (nonzero? (-> this prototypes prototype-array-tie)) + (login (-> this prototypes prototype-array-tie)) ) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) (defun add-pc-wind-data ((dma-buf dma-buffer)) @@ -567,30 +569,30 @@ (none) ) -(defmethod draw drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 drawable-tree-instance-tie) (arg1 display-frame)) +(defmethod draw drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 drawable-tree-instance-tie) (arg1 display-frame)) "Add the tree to the background work list." (let* ((v1-1 (-> *background-work* tie-tree-count)) (a1-2 (-> (scratchpad-object terrain-context) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* tie-trees v1-1) obj) + (set! (-> *background-work* tie-trees v1-1) this) (set! (-> *background-work* tie-levels v1-1) a1-5) ) (+! (-> *background-work* tie-tree-count) 1) (none) ) -(defmethod collect-stats drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) +(defmethod collect-stats drawable-tree-instance-tie ((this drawable-tree-instance-tie)) "Collect statistics on TIE drawing." ;; only if tie/generic ran (when (logtest? *vu1-enable-user* (vu1-renderer-mask tie-near tie generic)) ;; unused? - (-> obj data (+ (-> obj length) -1)) + (-> this data (+ (-> this length) -1)) ;; loop over all prototypes. ;; the drawing process will write to the prototypes to say how many of each it draws - (let ((v1-8 (-> obj prototypes prototype-array-tie))) + (let ((v1-8 (-> this prototypes prototype-array-tie))) (dotimes (a0-1 (-> v1-8 length)) ;; grap the prototype (let ((a1-2 (-> v1-8 array-data a0-1))) @@ -698,9 +700,9 @@ -(defmethod debug-draw drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 drawable) (arg1 display-frame)) - (-> obj data (+ (-> obj length) -1)) - (let* ((s5-0 (-> obj prototypes prototype-array-tie)) +(defmethod debug-draw drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 drawable) (arg1 display-frame)) + (-> this data (+ (-> this length) -1)) + (let* ((s5-0 (-> this prototypes prototype-array-tie)) (s4-0 (-> s5-0 length)) ) (dotimes (s3-0 s4-0) @@ -718,39 +720,39 @@ ;; note: the first three methods appear twice in the original code. -(defmethod collide-with-box drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-with-box (-> obj data 0) (-> obj length) arg1) +(defmethod collide-with-box drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-with-box (-> this data 0) (-> this length) arg1) 0 (none) ) -(defmethod collide-y-probe drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-y-probe (-> obj data 0) (-> obj length) arg1) +(defmethod collide-y-probe drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-y-probe (-> this data 0) (-> this length) arg1) 0 (none) ) -(defmethod collide-ray drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-ray (-> obj data 0) (-> obj length) arg1) +(defmethod collide-ray drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-ray (-> this data 0) (-> this length) arg1) 0 (none) ) -(defmethod collide-with-box drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-with-box (the-as instance-tie (-> obj data)) (-> obj length) arg1) +(defmethod collide-with-box drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-with-box (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) ) -(defmethod collide-y-probe drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-y-probe (the-as instance-tie (-> obj data)) (-> obj length) arg1) +(defmethod collide-y-probe drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-y-probe (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) ) -(defmethod collide-ray drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-ray (the-as instance-tie (-> obj data)) (-> obj length) arg1) +(defmethod collide-ray drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-ray (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) ) @@ -783,4 +785,4 @@ ) (send-event *camera* 'set-fov 11650.845) (none) - ) \ No newline at end of file + ) diff --git a/goal_src/jak1/engine/gfx/tie/tie-near.gc b/goal_src/jak1/engine/gfx/tie/tie-near.gc index f1eada9781..17175d2aca 100644 --- a/goal_src/jak1/engine/gfx/tie/tie-near.gc +++ b/goal_src/jak1/engine/gfx/tie/tie-near.gc @@ -12,6 +12,8 @@ ;; This isn't super well documented or even complete, see tie.gc. +;; DECOMP BEGINS + ;; uploaded to VU1 once per frame. (deftype tie-near-consts (structure) ((extra qword :inline :offset-assert 0) diff --git a/goal_src/jak1/engine/gfx/tie/tie.gc b/goal_src/jak1/engine/gfx/tie/tie.gc index fd9ac50c9c..fb151f2dd7 100644 --- a/goal_src/jak1/engine/gfx/tie/tie.gc +++ b/goal_src/jak1/engine/gfx/tie/tie.gc @@ -19,83 +19,85 @@ ;; The exact procedure for GENERIC through TIE is unknown. ;; The functions are generic-tie-execute and generic-tie-convert +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;; ;; Basic Methods ;;;;;;;;;;;;;;;;; ;; something is going wrong mem-usage (believed fixed) -(defmethod login tie-fragment ((obj tie-fragment)) +(defmethod login tie-fragment ((this tie-fragment)) "Initialize the shaders for a tie-fragment" ;; the gif data is just adgif shaders, each are 5 qw's - (let ((s5-0 (-> obj gif-ref)) - (s4-0 (/ (-> obj tex-count) (the-as uint 5))) + (let ((s5-0 (-> this gif-ref)) + (s4-0 (/ (-> this tex-count) (the-as uint 5))) ) (dotimes (s3-0 (the-as int s4-0)) ;; will modify the adgif-shaders in place to have the appropriate tbp. (adgif-shader-login-no-remap (-> s5-0 s3-0)) ) ) - obj + this ) -(defmethod inspect drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie)) +(defmethod inspect drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) "Inspect an array of instances" - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) -(defmethod asize-of drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie)) +(defmethod asize-of drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) "Compute the size in memory of an array of instances." (the-as int (+ (-> drawable-inline-array-instance-tie size) - (* (+ (-> obj length) -1) 64) ;; 64 bytes / instance, minus the 1 in the type. + (* (+ (-> this length) -1) 64) ;; 64 bytes / instance, minus the 1 in the type. ) ) ) #| ;; for some reason, this showed up twice. -(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) -obj +(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +this ) |# -(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) +(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) "Login method for the tie instance tree." ;; just log in all of the drawables. - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) (the-as drawable-tree-instance-tie #f) ) -(defmethod inspect prototype-tie ((obj prototype-tie)) +(defmethod inspect prototype-tie ((this prototype-tie)) "Inspect the inline-array of tie" - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) ;; print each fragment - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) -(defmethod login prototype-tie ((obj prototype-tie)) +(defmethod login prototype-tie ((this prototype-tie)) "Login each tie-fragment." - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) -(defmethod mem-usage drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage for a drawable tree of TIE instances" (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -106,20 +108,20 @@ obj ) ;; do our drawables - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) ;; do our prototypes, but with a flag set! - (mem-usage (-> obj prototypes prototype-array-tie) arg0 (logior arg1 1)) - obj + (mem-usage (-> this prototypes prototype-array-tie) arg0 (logior arg1 1)) + this ) -(defmethod mem-usage tie-fragment ((obj tie-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage tie-fragment ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a TIE prototype." (when (logtest? arg1 2) ;; count for an instance of this prototype. - (let ((v1-3 (* (-> obj color-count) 4)) + (let ((v1-3 (* (-> this color-count) 4)) ;; pick one of the instance color categories. (a0-2 (cond ((logtest? arg1 4) @@ -139,7 +141,7 @@ obj (+! (-> arg0 data a0-2 total) (logand -4 (+ v1-3 3))) ) (set! (-> arg0 length) (max 23 (-> arg0 length))) - (set! obj obj) + (set! this this) (goto cfg-13) ) @@ -153,56 +155,56 @@ obj (set! (-> arg0 data 13 name) "tie-draw-points") (set! (-> arg0 data 17 name) "tie-generic") (+! (-> arg0 data 9 count) 1) - (let ((v1-21 (asize-of obj))) + (let ((v1-21 (asize-of this))) (+! (-> arg0 data 9 used) v1-21) (+! (-> arg0 data 9 total) (logand -16 (+ v1-21 15))) ) - (let ((v1-26 (* (-> obj gif-count) 16))) - (+! (-> arg0 data 10 count) (-> obj tex-count)) + (let ((v1-26 (* (-> this gif-count) 16))) + (+! (-> arg0 data 10 count) (-> this tex-count)) (+! (-> arg0 data 10 used) v1-26) (+! (-> arg0 data 10 total) (logand -16 (+ v1-26 15))) ) - (let ((v1-31 (* (-> obj vertex-count) 16))) - (+! (-> arg0 data 11 count) (-> obj vertex-count)) + (let ((v1-31 (* (-> this vertex-count) 16))) + (+! (-> arg0 data 11 count) (-> this vertex-count)) (+! (-> arg0 data 11 used) v1-31) (+! (-> arg0 data 11 total) (logand -16 (+ v1-31 15))) ) - (let ((v1-36 (* (-> obj dp-qwc) 16))) - (+! (-> arg0 data 13 count) (* (-> obj dp-qwc) 16)) + (let ((v1-36 (* (-> this dp-qwc) 16))) + (+! (-> arg0 data 13 count) (* (-> this dp-qwc) 16)) (+! (-> arg0 data 13 used) v1-36) (+! (-> arg0 data 13 total) (logand -16 (+ v1-36 15))) ) - (let ((v1-41 (* (-> obj generic-count) 16))) + (let ((v1-41 (* (-> this generic-count) 16))) (+! (-> arg0 data 17 count) 1) (+! (-> arg0 data 17 used) v1-41) (+! (-> arg0 data 17 total) (logand -16 (+ v1-41 15))) ) - (when (nonzero? (-> obj debug-lines)) - (dotimes (s4-0 (-> obj debug-lines length)) + (when (nonzero? (-> this debug-lines)) + (dotimes (s4-0 (-> this debug-lines length)) (+! (-> arg0 data 14 count) - (-> (the-as (pointer int32) (-> obj debug-lines s4-0)) 0) + (-> (the-as (pointer int32) (-> this debug-lines s4-0)) 0) ) - (let ((v1-52 (asize-of (the-as basic (-> obj debug-lines s4-0))))) + (let ((v1-52 (asize-of (the-as basic (-> this debug-lines s4-0))))) (+! (-> arg0 data 12 used) v1-52) (+! (-> arg0 data 12 total) (logand -16 (+ v1-52 15))) ) ) ) (label cfg-13) - obj + this ) -(defmethod mem-usage instance-tie ((obj instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage instance-tie ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of TIE instance." (set! (-> arg0 length) (max 19 (-> arg0 length))) (set! (-> arg0 data 18 name) "instance-tie") (+! (-> arg0 data 18 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 18 used) v1-6) (+! (-> arg0 data 18 total) (logand -16 (+ v1-6 15))) ) - (when (nonzero? (-> obj error)) + (when (nonzero? (-> this error)) (set! (-> arg0 length) (max 24 (-> arg0 length))) (set! (-> arg0 data 23 name) "instance-tie-colors*") (set! (-> arg0 data 19 name) "instance-tie-colors0") @@ -210,7 +212,7 @@ obj (set! (-> arg0 data 21 name) "instance-tie-colors2") (set! (-> arg0 data 22 name) "instance-tie-colors3") (+! (-> arg0 data 23 count) 1) - (let ((s3-0 (-> obj bucket-ptr))) + (let ((s3-0 (-> this bucket-ptr))) ;; unused (+ (-> arg0 data 19 used) (-> arg0 data 20 used) (-> arg0 data 21 used) (-> arg0 data 22 used)) @@ -235,10 +237,10 @@ obj ) ) ) - obj + this ) -(defmethod mem-usage drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of an entire array of instances" (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -248,13 +250,13 @@ obj (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) ;; just call mem-usage on every element. - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod mem-usage prototype-tie ((obj prototype-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-tie ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of an entire array of prototypes." (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -264,16 +266,16 @@ obj (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) ;; just call mem-usage on each. - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod asize-of prototype-tie ((obj prototype-tie)) +(defmethod asize-of prototype-tie ((this prototype-tie)) "Compute the size in memory of a prototype array" ;; 64 bytes/fragment, minus 1 in the type. - (the-as int (+ (-> prototype-tie size) (* (+ (-> obj length) -1) 64))) + (the-as int (+ (-> prototype-tie size) (* (+ (-> this length) -1) 64))) ) ;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -811,5 +813,3 @@ obj ) (none) ) - - diff --git a/goal_src/jak1/engine/gfx/vu1-user-h.gc b/goal_src/jak1/engine/gfx/vu1-user-h.gc index 944c4d948d..acd0ab5714 100644 --- a/goal_src/jak1/engine/gfx/vu1-user-h.gc +++ b/goal_src/jak1/engine/gfx/vu1-user-h.gc @@ -31,6 +31,8 @@ (twenty 20) ) +;; DECOMP BEGINS + (define *vu1-enable-user-menu* (vu1-renderer-mask sky diff --git a/goal_src/jak1/engine/level/bsp-h.gc b/goal_src/jak1/engine/level/bsp-h.gc index d01e411815..3d5e8cc79d 100644 --- a/goal_src/jak1/engine/level/bsp-h.gc +++ b/goal_src/jak1/engine/level/bsp-h.gc @@ -26,6 +26,8 @@ ;; flags: 1 = load ;; 2 = display +;; DECOMP BEGINS + ;; a node in the bsp tree (deftype bsp-node (structure) ((front int32 :offset-assert 0) ;; if > 0, is a pointer to another bsp-node @@ -108,17 +110,17 @@ ) (define-extern inspect-bsp-tree (function bsp-header bsp-node none)) -(defmethod inspect bsp-header ((obj bsp-header)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tall-visible-list: #x~X~%" (-> obj all-visible-list)) - (format #t "~Tvisible-list-length: ~D~%" (-> obj visible-list-length)) - (format #t "~Tdrawable-trees: ~A~%" (-> obj drawable-trees)) - (format #t "~Tpat: #x~X~%" (-> obj pat)) - (format #t "~Tpat-length: ~D~%" (-> obj pat-length)) +(defmethod inspect bsp-header ((this bsp-header)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tall-visible-list: #x~X~%" (-> this all-visible-list)) + (format #t "~Tvisible-list-length: ~D~%" (-> this visible-list-length)) + (format #t "~Tdrawable-trees: ~A~%" (-> this drawable-trees)) + (format #t "~Tpat: #x~X~%" (-> this pat)) + (format #t "~Tpat-length: ~D~%" (-> this pat-length)) ;; putting this stuff here for debugging! - (format #t "~Ttexture-remap-table-len: ~D~%" (-> obj texture-remap-table-len)) - (dotimes (i (-> obj texture-remap-table-len)) - (let* ((tex-id-array (the (pointer texture-id) (&-> obj texture-remap-table i))) + (format #t "~Ttexture-remap-table-len: ~D~%" (-> this texture-remap-table-len)) + (dotimes (i (-> this texture-remap-table-len)) + (let* ((tex-id-array (the (pointer texture-id) (&-> this texture-remap-table i))) (tex-id-from (-> tex-id-array 0)) (tex-id-to (-> tex-id-array 1)) ) @@ -129,8 +131,8 @@ ) ) ) - ;;(inspect-bsp-tree obj (the-as bsp-node (-> obj nodes))) - obj + ;;(inspect-bsp-tree this (the-as bsp-node (-> this nodes))) + this ) (defun-debug inspect-bsp-tree ((arg0 bsp-header) (arg1 bsp-node)) diff --git a/goal_src/jak1/engine/level/bsp.gc b/goal_src/jak1/engine/level/bsp.gc index bb7fc7038f..129bc7f8ce 100644 --- a/goal_src/jak1/engine/level/bsp.gc +++ b/goal_src/jak1/engine/level/bsp.gc @@ -5,6 +5,7 @@ ;; name in dgo: bsp ;; dgos: GAME, ENGINE +;; DECOMP BEGINS ;;;;;;;;;;;;;;; ;; memory use @@ -32,27 +33,27 @@ (none) ) -(defmethod mem-usage bsp-header ((obj bsp-header) (mem-use memory-usage-block) (flags int)) +(defmethod mem-usage bsp-header ((this bsp-header) (mem-use memory-usage-block) (flags int)) "Update the memory usage info for this bsp-header. This will visit all the stuff in the level data." ;; start off by setting the current bsp - (set! (-> mem-use work-bsp) obj) + (set! (-> mem-use work-bsp) this) ;; this seems slightly wrong, we count the file-info toward array. - (when (nonzero? (-> obj info)) + (when (nonzero? (-> this info)) (set! (-> mem-use length) (max 82 (-> mem-use length))) (set! (-> mem-use data 81 name) "array") (+! (-> mem-use data 81 count) 1) - (let ((v1-8 (asize-of (-> obj info)))) + (let ((v1-8 (asize-of (-> this info)))) (+! (-> mem-use data 81 used) v1-8) (+! (-> mem-use data 81 total) (logand -16 (+ v1-8 15))) ) ) ;; measure the drawable trees. - (if (nonzero? (-> obj drawable-trees)) - (mem-usage (-> obj drawable-trees) mem-use flags) + (if (nonzero? (-> this drawable-trees)) + (mem-usage (-> this drawable-trees) mem-use flags) ) ;; add stuff @@ -75,7 +76,7 @@ (set! (-> mem-use length) (max 60 (-> mem-use length))) (set! (-> mem-use data 59 name) "bsp-leaf-vis-self") (+! (-> mem-use data 59 count) 1) - (let ((v1-36 (-> obj visible-list-length))) + (let ((v1-36 (-> this visible-list-length))) (+! (-> mem-use data 59 used) v1-36) (+! (-> mem-use data 59 total) (logand -16 (+ v1-36 15))) ) @@ -84,7 +85,7 @@ (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-46 (* (-> obj texture-remap-table-len) 8))) + (let ((v1-46 (* (-> this texture-remap-table-len) 8))) (+! (-> mem-use data 57 used) v1-46) (+! (-> mem-use data 57 total) (logand -16 (+ v1-46 15))) ) @@ -93,48 +94,48 @@ (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-56 (* (-> obj texture-page-count) 4))) + (let ((v1-56 (* (-> this texture-page-count) 4))) (+! (-> mem-use data 57 used) v1-56) (+! (-> mem-use data 57 total) (logand -16 (+ v1-56 15))) ) ;; add unk-zero-0 - (when (nonzero? (-> obj unk-zero-0)) + (when (nonzero? (-> this unk-zero-0)) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-68 (asize-of (-> obj unk-zero-0)))) + (let ((v1-68 (asize-of (-> this unk-zero-0)))) (+! (-> mem-use data 57 used) v1-68) (+! (-> mem-use data 57 total) (logand -16 (+ v1-68 15))) ) ) ;; add adgifs - (when (nonzero? (-> obj adgifs)) + (when (nonzero? (-> this adgifs)) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-80 (asize-of (-> obj adgifs)))) + (let ((v1-80 (asize-of (-> this adgifs)))) (+! (-> mem-use data 57 used) v1-80) (+! (-> mem-use data 57 total) (logand -16 (+ v1-80 15))) ) ) ;; add boxes - (when (nonzero? (-> obj boxes)) + (when (nonzero? (-> this boxes)) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-92 (asize-of (-> obj boxes)))) + (let ((v1-92 (asize-of (-> this boxes)))) (+! (-> mem-use data 57 used) v1-92) (+! (-> mem-use data 57 total) (logand -16 (+ v1-92 15))) ) ;; add box indices - (when (nonzero? (-> obj split-box-indices)) + (when (nonzero? (-> this split-box-indices)) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-105 (* (-> obj boxes length) 2))) + (let ((v1-105 (* (-> this boxes length) 2))) (+! (-> mem-use data 57 used) v1-105) (+! (-> mem-use data 57 total) (logand -16 (+ v1-105 15))) ) @@ -142,27 +143,27 @@ ) ;; add actor-birth-order - (when (nonzero? (-> obj actor-birth-order)) + (when (nonzero? (-> this actor-birth-order)) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) ;; add actors - (let ((v1-118 (* (-> obj actors length) 4))) + (let ((v1-118 (* (-> this actors length) 4))) (+! (-> mem-use data 57 used) v1-118) (+! (-> mem-use data 57 total) (logand -16 (+ v1-118 15))) ) ) ;; add pat - (+! (-> mem-use data 62 count) (-> obj pat-length)) - (let ((v1-125 (* (-> obj pat-length) 4))) + (+! (-> mem-use data 62 count) (-> this pat-length)) + (let ((v1-125 (* (-> this pat-length) 4))) (+! (-> mem-use data 62 used) v1-125) (+! (-> mem-use data 62 total) (logand -16 (+ v1-125 15))) ) ;; add cameras - (let ((s3-0 (-> obj cameras))) + (let ((s3-0 (-> this cameras))) (when (nonzero? s3-0) (dotimes (s2-0 (-> s3-0 length)) (mem-usage (-> s3-0 s2-0) mem-use (logior flags 256)) @@ -171,36 +172,36 @@ ) ;; add the tree itself - (mem-usage-bsp-tree obj (the-as bsp-node (-> obj nodes)) mem-use flags) - obj + (mem-usage-bsp-tree this (the-as bsp-node (-> this nodes)) mem-use flags) + this ) -(defmethod login bsp-header ((obj bsp-header)) +(defmethod login bsp-header ((this bsp-header)) "Main login for a level" ;; login our drawables - (if (nonzero? (-> obj drawable-trees)) - (login (-> obj drawable-trees)) + (if (nonzero? (-> this drawable-trees)) + (login (-> this drawable-trees)) ) ;; login our shaders - (when (nonzero? (-> obj adgifs)) - (let ((s5-0 (-> obj adgifs))) + (when (nonzero? (-> this adgifs)) + (let ((s5-0 (-> this adgifs))) (dotimes (s4-0 (-> s5-0 length)) (adgif-shader-login-no-remap (-> s5-0 data s4-0)) ) ) ) - obj + this ) (define *test-shrub* 0) ;; unused. -(defmethod draw bsp-header ((obj bsp-header) (other-draw bsp-header) (arg1 display-frame)) +(defmethod draw bsp-header ((this bsp-header) (other-draw bsp-header) (arg1 display-frame)) "Draw the level" (local-vars (a3-4 uint128) (a3-5 uint128) (r0 uint128)) (set! r0 (the-as uint128 0)) - (let ((lev (-> obj level))) + (let ((lev (-> this level))) ;; set up some stuff in the scratchpad (set! (-> (scratchpad-object terrain-bsp :offset TERRAIN_BSP_SCRATCHPAD) lev-index) (-> lev index)) (set! (-> (scratchpad-object terrain-bsp :offset TERRAIN_BSP_SCRATCHPAD) mood) (-> lev mood)) @@ -218,7 +219,7 @@ ;; upload the visible list to the scratchpad. ;; the final result of all visibility calculations is stored in vis-bits. ;; this goes at the end of the scratchpad. - (let ((vis-list-qwc (/ (+ (-> obj visible-list-length) 15) 16))) + (let ((vis-list-qwc (/ (+ (-> this visible-list-length) 15) 16))) (dma-send-to-spr-no-flush (scratchpad-object uint :offset VISIBLE_LIST_SCRATCHPAD) (the-as uint (-> lev vis-bits)) @@ -232,9 +233,9 @@ ;; probably the DMA wins though. ;; this messes with the visibility bits to invert what was just uploaded (when *artist-flip-visible* - (let ((vis-list-qwc2 (/ (+ (-> obj visible-list-length) 15) 16)) + (let ((vis-list-qwc2 (/ (+ (-> this visible-list-length) 15) 16)) (vis-list-spad (scratchpad-object (pointer uint128) :offset VISIBLE_LIST_SCRATCHPAD)) - (vis-list-lev (the-as (pointer uint128) (-> obj all-visible-list))) + (vis-list-lev (the-as (pointer uint128) (-> this all-visible-list))) ) ;; iterate through all qw's in the visible list. (dotimes (current-qw vis-list-qwc2) @@ -279,7 +280,7 @@ ;; draw the drawables! ;; start a profile bar. - (when (nonzero? (-> obj drawable-trees)) + (when (nonzero? (-> this drawable-trees)) (if *debug-segment* (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) 'draw @@ -287,7 +288,7 @@ ) ) ;; draw! - (let ((a1-7 (-> obj drawable-trees))) + (let ((a1-7 (-> this drawable-trees))) (draw a1-7 a1-7 arg1) ) ;; end a profile bar @@ -304,14 +305,14 @@ (let ((s5-1 (-> *display* frames (-> *display* on-screen) frame))) ;; 0 (foreground-engine-execute - (-> obj level foreground-draw-engine 0) + (-> this level foreground-draw-engine 0) s5-1 (-> (scratchpad-object terrain-bsp :offset TERRAIN_BSP_SCRATCHPAD) lev-index) 0 ) ;; 1 (foreground-engine-execute - (-> obj level foreground-draw-engine 1) + (-> this level foreground-draw-engine 1) s5-1 (-> (scratchpad-object terrain-bsp :offset TERRAIN_BSP_SCRATCHPAD) lev-index) 1 @@ -319,7 +320,7 @@ ;; 2 (foreground-engine-execute - (-> obj level foreground-draw-engine 2) + (-> this level foreground-draw-engine 2) s5-1 (-> (scratchpad-object terrain-bsp :offset TERRAIN_BSP_SCRATCHPAD) lev-index) 2 @@ -330,16 +331,16 @@ (none) ) -(defmethod debug-draw bsp-header ((obj bsp-header) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw bsp-header ((this bsp-header) (arg0 drawable) (arg1 display-frame)) "This is some sort of debugging thing. It calls debug-draw on the drawables with the scratchpad and vfs set up." - (let ((s4-0 (-> obj level))) + (let ((s4-0 (-> this level))) ;; set up some stuff in the scratchpad (set! (-> (scratchpad-object terrain-bsp :offset TERRAIN_BSP_SCRATCHPAD) lev-index) (-> s4-0 index)) (set! (-> (scratchpad-object terrain-bsp :offset TERRAIN_BSP_SCRATCHPAD) mood) (-> s4-0 mood)) (add-irq-to-tex-buckets! s4-0) - (let ((a2-1 (/ (+ (-> obj visible-list-length) 15) 16))) + (let ((a2-1 (/ (+ (-> this visible-list-length) 15) 16))) (dma-send-to-spr-no-flush (scratchpad-object uint :offset VISIBLE_LIST_SCRATCHPAD) (the-as uint (-> s4-0 vis-bits)) @@ -369,14 +370,14 @@ (.lvf vf31 (&-> at-0 camera-temp vector 3 quad)) ) ) - (when (nonzero? (-> obj drawable-trees)) + (when (nonzero? (-> this drawable-trees)) (if *debug-segment* (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) 'draw (new 'static 'rgba :r #x40 :b #x40 :a #x80) ) ) - (let ((a1-3 (-> obj drawable-trees))) + (let ((a1-3 (-> this drawable-trees))) (debug-draw a1-3 a1-3 arg1) ) (if *debug-segment* @@ -389,10 +390,10 @@ (none) ) -(defmethod collect-stats bsp-header ((obj bsp-header)) +(defmethod collect-stats bsp-header ((this bsp-header)) "Collect drawing statistics" - (let ((v1-0 (-> obj level)) - (a2-0 (/ (+ (-> obj visible-list-length) 15) 16)) + (let ((v1-0 (-> this level)) + (a2-0 (/ (+ (-> this visible-list-length) 15) 16)) ) (dma-send-to-spr-no-flush (scratchpad-object uint :offset VISIBLE_LIST_SCRATCHPAD) @@ -422,8 +423,8 @@ (.lvf vf31 (&-> at-0 camera-temp vector 3 quad)) ) ) - (if (nonzero? (-> obj drawable-trees)) - (collect-stats (-> obj drawable-trees)) + (if (nonzero? (-> this drawable-trees)) + (collect-stats (-> this drawable-trees)) ) (none) ) @@ -485,10 +486,10 @@ ;; Collision ;;;;;;;;;;;;;;; -(defmethod collide-with-box bsp-header ((obj bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) "Top level collision with a box function. I think the arg0 length doesn't really matter here." (+! (-> *collide-stats* calls) 1) - (let ((s4-0 (-> obj drawable-trees))) + (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) (collide-with-box (-> s4-0 data s3-0) arg0 arg1) ) @@ -496,9 +497,9 @@ (none) ) -(defmethod collide-y-probe bsp-header ((obj bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) (+! (-> *collide-stats* calls) 1) - (let ((s4-0 (-> obj drawable-trees))) + (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) (collide-y-probe (-> s4-0 data s3-0) arg0 arg1) ) @@ -506,9 +507,9 @@ (none) ) -(defmethod collide-ray bsp-header ((obj bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) (+! (-> *collide-stats* calls) 1) - (let ((s4-0 (-> obj drawable-trees))) + (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) (collide-ray (-> s4-0 data s3-0) arg0 arg1) ) @@ -516,8 +517,8 @@ (none) ) -(defmethod collect-ambients bsp-header ((obj bsp-header) (arg0 sphere) (arg1 int) (arg2 ambient-list)) - (let ((s3-0 (-> obj drawable-trees))) +(defmethod collect-ambients bsp-header ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 ambient-list)) + (let ((s3-0 (-> this drawable-trees))) (dotimes (s2-0 (-> s3-0 length)) (collect-ambients (-> s3-0 data s2-0) arg0 arg1 arg2) ) @@ -658,4 +659,3 @@ ) (the-as texture-id tex-id) ) - diff --git a/goal_src/jak1/engine/level/level-h.gc b/goal_src/jak1/engine/level/level-h.gc index 834bcca88b..f359f2e0fe 100644 --- a/goal_src/jak1/engine/level/level-h.gc +++ b/goal_src/jak1/engine/level/level-h.gc @@ -21,6 +21,8 @@ (declare-type mood-context basic) (declare-type entity-links structure) +;; DECOMP BEGINS + ;;;;;;;;;;;;;;; ;; VIS ;;;;;;;;;;;;;;; @@ -84,9 +86,9 @@ ) -(defmethod asize-of level-vis-info ((obj level-vis-info)) +(defmethod asize-of level-vis-info ((this level-vis-info)) "Get the size of a level-vis-info in memory" - (the-as int (+ (-> level-vis-info size) (-> obj dictionary-length))) + (the-as int (+ (-> level-vis-info size) (-> this dictionary-length))) ) ;; Per level information related to how to load the level. diff --git a/goal_src/jak1/engine/level/level.gc b/goal_src/jak1/engine/level/level.gc index 3f8a11f179..8cf5389916 100644 --- a/goal_src/jak1/engine/level/level.gc +++ b/goal_src/jak1/engine/level/level.gc @@ -5,6 +5,8 @@ ;; name in dgo: level ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;; ;; level info/names ;;;;;;;;;;;;;;;;;;;;;; @@ -32,7 +34,7 @@ ) -(defmethod load-command-get-index level-group ((obj level-group) (name symbol) (cmd-idx int)) +(defmethod load-command-get-index level-group ((this level-group) (name symbol) (cmd-idx int)) "Get the n-th load command for the given level." (let ((cmd-lst (-> (lookup-level-info name) alt-load-commands))) (while (nonzero? cmd-idx) @@ -55,26 +57,26 @@ ) ) -(defmethod art-group-get-by-name level ((obj level) (arg0 string)) +(defmethod art-group-get-by-name level ((this level) (arg0 string)) "Get the art group in the given level with the given name. If it doesn't exist, #f." - (countdown (i (-> obj art-group art-group-array length)) - (if (name= (-> obj art-group art-group-array i name) arg0) - (return (-> obj art-group art-group-array i)) + (countdown (i (-> this art-group art-group-array length)) + (if (name= (-> this art-group art-group-array i name) arg0) + (return (-> this art-group art-group-array i)) ) ) (the-as art-group #f) ) -(defmethod bsp-name level ((obj level)) +(defmethod bsp-name level ((this level)) "Get the name of the bsp tree of the level" -(if (and (!= (-> obj status) 'inactive) - (-> obj bsp) - (nonzero? (-> obj bsp name)) +(if (and (!= (-> this status) 'inactive) + (-> this bsp) + (nonzero? (-> this bsp name)) ) - (-> obj bsp name) - (-> obj name) + (-> this bsp name) + (-> this name) ) ) @@ -101,47 +103,47 @@ ) -(defmethod print level ((obj level)) +(defmethod print level ((this level)) "print a level." (format #t "#<~A ~A ~S @ #x~X>" - (-> obj type) - (-> obj status) - (-> obj name) - obj + (-> this type) + (-> this status) + (-> this name) + this ) - obj + this ) -(defmethod relocate bsp-header ((obj bsp-header) (dest-heap kheap) (name (pointer uint8))) +(defmethod relocate bsp-header ((this bsp-header) (dest-heap kheap) (name (pointer uint8))) "Handle a bsp file load." ;; we expect that we'll have a loading-level set when we link/login a bsp-header (let ((s5-0 (-> *level* loading-level))) (if s5-0 (cond - (obj + (this (cond - ((not (type-type? (-> obj type) bsp-header)) + ((not (type-type? (-> this type) bsp-header)) (format 0 "ERROR: level ~A is not a bsp-header.~%" (-> s5-0 name)) (the-as bsp-header #f) ) - ((not (file-info-correct-version? (-> obj info) (file-kind level-bt) 0)) + ((not (file-info-correct-version? (-> this info) (file-kind level-bt) 0)) (the-as bsp-header #f) ) - ((< 2048 (-> obj visible-list-length)) + ((< 2048 (-> this visible-list-length)) (format 0 "ERROR: level ~A visible-list-length ~d is greater than 2048 (16384 drawables).~%" (-> s5-0 name) - (-> obj visible-list-length) + (-> this visible-list-length) ) (the-as bsp-header #f) ) (else - (load-dbg "bsp relocate: ~A~%" obj) + (load-dbg "bsp relocate: ~A~%" this) ;; everything is okay, link the bsp and level. - (set! (-> s5-0 bsp) obj) - (set! (-> obj level) s5-0) - obj + (set! (-> s5-0 bsp) this) + (set! (-> this level) s5-0) + this ) ) ) @@ -157,50 +159,50 @@ (none) ) -(defmethod load-required-packages level ((obj level)) +(defmethod load-required-packages level ((this level)) "Load required packages for the level. This is mostly useless, but might load common. This will have no effect most of the time - common is often loaded at boot as part of game.cgo." - (when (not (or (not (-> obj bsp)) (= *kernel-boot-mode* 'debug-boot))) - (if (not (null? (-> obj info packages))) + (when (not (or (not (-> this bsp)) (= *kernel-boot-mode* 'debug-boot))) + (if (not (null? (-> this info packages))) (load-package "common" global) ) ) - obj + this ) ;;;;;;;;;;;;;; ;; vis ;;;;;;;;;;;;;; -(defmethod vis-clear level ((obj level)) +(defmethod vis-clear level ((this level)) "Clear the visibility info for when the level is loading." ;; clear vis-infos, so we can't try to look up a vis string. (countdown (v1-0 8) (nop!) ;; the usual. - (set! (-> obj vis-info v1-0) #f) + (set! (-> this vis-info v1-0) #f) ) ;; set the vis string to all 0s. (dotimes (v1-3 128) - (set! (deref int128 (-> obj vis-bits) v1-3) (the-as int128 0)) + (set! (deref int128 (-> this vis-bits) v1-3) (the-as int128 0)) ) ;; this flag indicates we don't have vis data because loading is in progress - (set! (-> obj all-visible?) 'loading) + (set! (-> this all-visible?) 'loading) 0 ) -(defmethod vis-load level ((obj level)) +(defmethod vis-load level ((this level)) "Start the initial load of a VIS file to the IOP VIS buffer. After this is done, we can use ramdisk-load to load chunks." ;; check to see if we have a buffer for loaded vis data. - (when (zero? (-> obj vis-info (-> obj vis-self-index) ramdisk)) + (when (zero? (-> this vis-info (-> this vis-self-index) ramdisk)) ;; nope, we have no vis data buffer, we need to set it up. ;; first, we should see if the other level has loaded vis. if so, kill it. - (let ((vis (-> obj other vis-info (-> obj other vis-self-index)))) + (let ((vis (-> this other vis-info (-> this other vis-self-index)))) (when (and vis (nonzero? (-> vis ramdisk))) (set! (-> vis flags) (logand #xffffffffbfffffff (-> vis flags))) ;; clear waiting-for-load (set! (-> vis ramdisk) 0) @@ -209,7 +211,7 @@ ) ;; set up a ramdisk rpc (fill command, actually load the file from DVD to IOP buffer) - (let ((visname (make-file-name (file-kind vis) (the-as string (-> obj nickname)) 0 #f)) + (let ((visname (make-file-name (file-kind vis) (the-as string (-> this nickname)) 0 #f)) (cmd (the-as ramdisk-rpc-fill (add-element *ramdisk-rpc*))) (s5-0 (+ *current-ramdisk-id* 1)) ) @@ -219,12 +221,12 @@ (load-dbg "doing ramdisk vis load: ~A~%" visname) (call *ramdisk-rpc* RAMDISK_RPC_FILL_FNO (the-as pointer 0) (the-as uint 0)) ;; remember which ramdisk id we are assigned - (set! (-> obj vis-info (-> obj vis-self-index) ramdisk) s5-0) + (set! (-> this vis-info (-> this vis-self-index) ramdisk) s5-0) ) ) ;; return the ramdisk ID. - (-> obj vis-info (-> obj vis-self-index) ramdisk) + (-> this vis-info (-> this vis-self-index) ramdisk) ) (defun load-vis-info ((vis-name symbol) (old-vis-name symbol)) @@ -243,25 +245,25 @@ 0 ) -(defmethod init-vis level ((obj level)) +(defmethod init-vis level ((this level)) "Set up the vis info in a level from the vis info in the BSP." - (when (not (or (= (-> obj status) 'inactive) (not (-> obj bsp)))) + (when (not (or (= (-> this status) 'inactive) (not (-> this bsp)))) ;; no vis loaded at first, mark as loading/invalid. - (set! (-> obj all-visible?) 'loading) + (set! (-> this all-visible?) 'loading) ;; vis info 0 is always self. - (let ((s5-0 (-> obj bsp vis-info 0))) + (let ((s5-0 (-> this bsp vis-info 0))) ;; check that our vis info is valid. (cond ((and s5-0 (nonzero? s5-0) (valid? s5-0 level-vis-info #f #f 0)) ;; add to the level - (set! (-> obj vis-info 0) s5-0) + (set! (-> this vis-info 0) s5-0) ;; don't have a string loaded yet (set! (-> s5-0 current-vis-string) (the-as uint -1)) ;; link to bsp - (set! (-> s5-0 from-bsp) (-> obj bsp)) + (set! (-> s5-0 from-bsp) (-> this bsp)) ;; the current vis string (uncompressed). The level allocates/manages this. - (set! (-> s5-0 vis-bits) (-> obj vis-bits)) + (set! (-> s5-0 vis-bits) (-> this vis-bits)) ;; clear waiting-for-load, thirty-one (set! (-> s5-0 flags) (logand (the-as uint #xffffffff3fffffff) (-> s5-0 flags))) ;; set twenty-nine @@ -274,7 +276,7 @@ ) (else ;; we don't have vis (but it's okay) - (set! (-> obj vis-info 0) #f) + (set! (-> this vis-info 0) #f) ) ) ) @@ -282,20 +284,20 @@ ;; check for up to 6 neighbor level vis info. The last one is always left as null. (dotimes (s5-1 6) (let* ((s3-0 (+ s5-1 1)) - (s4-0 (-> obj bsp vis-info s3-0)) + (s4-0 (-> this bsp vis-info s3-0)) ) (cond ((and s4-0 (nonzero? s4-0) (valid? s4-0 level-vis-info #f #f 0)) - (set! (-> obj vis-info s3-0) s4-0) + (set! (-> this vis-info s3-0) s4-0) (set! (-> s4-0 current-vis-string) (the-as uint -1)) (set! (-> s4-0 from-bsp) #f) - (set! (-> s4-0 vis-bits) (-> obj vis-bits)) + (set! (-> s4-0 vis-bits) (-> this vis-bits)) ;; clear 29, 30, 31 (set! (-> s4-0 flags) (logand (the-as uint #xffffffff1fffffff) (-> s4-0 flags))) (set! *vis-boot* #t) ) (else - (set! (-> obj vis-info s3-0) #f) + (set! (-> this vis-info s3-0) #f) ) ) ) @@ -304,21 +306,21 @@ 0 ) -(defmethod level-get-for-use level-group ((obj level-group) (name symbol) (want-status symbol)) +(defmethod level-get-for-use level-group ((this level-group) (name symbol) (want-status symbol)) "Get a level in a playable form, loading it if necessary." (local-vars (s5-1 level)) ;; debug allocate levels if necessary - (alloc-levels! obj #f) + (alloc-levels! this #f) (let* ((level-info (lookup-level-info name)) (level-name (remap-level-name level-info)) ) - (awhen (level-get obj level-name) + (awhen (level-get this level-name) (level-status-set! it want-status) (return it) ) - (let ((a0-7 (level-get-most-disposable obj))) + (let ((a0-7 (level-get-most-disposable this))) (set! s5-1 (if a0-7 (level-status-set! a0-7 'inactive) a0-7 )) @@ -359,7 +361,7 @@ ;; - alive: level is birthed, etc ;; - active: level is being drawn -(defmethod level-status level-group ((obj level-group) (level-name symbol)) +(defmethod level-status level-group ((this level-group) (level-name symbol)) "Get the status of an existing level." (let ((lev (level-get *level* level-name))) @@ -369,117 +371,117 @@ ) ) -(defmethod level-status-set! level ((obj level) (want-status symbol)) +(defmethod level-status-set! level ((this level) (want-status symbol)) "Change the status of a level, performing any cleanup and prep work as necessary. Only change loading statuses in order! Returns the level." (case want-status (('inactive) - (case (-> obj status) + (case (-> this status) ) - (unload! obj) + (unload! this) ) (('loading) - (case (-> obj status) + (case (-> this status) (('inactive) - (load-begin obj) + (load-begin this) ) ) ) (('loading-bt) - (case (-> obj status) + (case (-> this status) (('loading) - (set! (-> obj status) want-status) - (load-continue obj) + (set! (-> this status) want-status) + (load-continue this) ) ) ) (('loading-done) - (case (-> obj status) + (case (-> this status) (('loading-bt) - (set! (-> obj status) want-status) + (set! (-> this status) want-status) ) ) ) (('loaded) - (case (-> obj status) + (case (-> this status) (('loading-done) ;; will actually put us in login for a bit. - (login-begin obj) + (login-begin this) ) (('alive 'active) - (deactivate obj) + (deactivate this) ) ) ) (('alive 'active) (when *dproc* - (case (-> obj status) + (case (-> this status) (('loaded) - (birth obj) + (birth this) ;; try again. we will be in alive. ;; this will do nothing if we want alive, but will activate if we want activate - (level-status-set! obj want-status) + (level-status-set! this want-status) ) (('alive) (when (and *dproc* (= want-status 'active)) ;; only if we want to do alive -> active ;; will set the level to be drawn. - (remove-by-param1 *background-draw-engine* (-> obj bsp)) - (add-connection *background-draw-engine* *dproc* (the (function object object object object object) add-bsp-drawable) (-> obj bsp) obj #f) + (remove-by-param1 *background-draw-engine* (-> this bsp)) + (add-connection *background-draw-engine* *dproc* (the (function object object object object object) add-bsp-drawable) (-> this bsp) this #f) (dotimes (v1-40 9) - (set! (-> obj closest-object v1-40) 0.0) - (set! (-> obj texture-mask v1-40) (the-as uint 0)) + (set! (-> this closest-object v1-40) 0.0) + (set! (-> this texture-mask v1-40) (the-as uint 0)) ) - (set! (-> obj level-distance) 0.0) - (set! (-> obj status) 'active) + (set! (-> this level-distance) 0.0) + (set! (-> this status) 'active) ) ) ) ) ) ) - obj + this ) (define *login-state* (new 'global 'login-state)) (define *print-login* #t) -(defmethod load-continue level ((obj level)) +(defmethod load-continue level ((this level)) "Continue loading a level from where we left off last time." ;; see if we are still linking some file - (when (-> obj linking) + (when (-> this linking) ;; do some more linking (when (nonzero? (link-resume)) ;; done linking and object file! - (set! (-> obj linking) #f) - (case (-> obj status) + (set! (-> this linking) #f) + (case (-> this status) (('loading) ;; load another object if we don't wanna copy anything (if (not (-> *texture-relocate-later* memcpy)) - (dgo-load-continue (the pointer (align64 (-> obj heap current)))) + (dgo-load-continue (the pointer (align64 (-> this heap current)))) ) ) (('loading-bt) ;; finished loading the last object! - (level-status-set! obj 'loading-done) - (level-status-set! obj 'loaded) + (level-status-set! this 'loading-done) + (level-status-set! this 'loaded) ) ) ) - (return obj) + (return this) ) ;; otherwise, copy stuff that needs copying (when (-> *texture-relocate-later* memcpy) (relocate-later) - (dgo-load-continue (the pointer (align64 (-> obj heap current)))) - (return obj) + (dgo-load-continue (the pointer (align64 (-> this heap current)))) + (return this) ) ;; otherwise, check status - (case (-> obj status) + (case (-> this status) (('loading) ;; we are still loading (let* ((last-obj #f) @@ -490,22 +492,22 @@ ((not last-obj) ;; not the last object. start linking (cond - ((dgo-load-link (the-as dgo-header a0-15) (-> obj heap) *print-login* #f) + ((dgo-load-link (the-as dgo-header a0-15) (-> this heap) *print-login* #f) ;; linking finished (that was fast) (if (not (-> *texture-relocate-later* memcpy)) - (dgo-load-continue (the pointer (align64 (-> obj heap current)))) + (dgo-load-continue (the pointer (align64 (-> this heap current)))) ) ) (else ;; linking is not done, resume later. - (set! (-> obj linking) #t) + (set! (-> this linking) #t) ) ) ) (else ;; we're loading the last object now, which has different rules - (set! (-> obj heap top) (-> obj heap top-base)) - (level-status-set! obj 'loading-bt) + (set! (-> this heap top) (-> this heap top-base)) + (level-status-set! this 'loading-bt) ) ) ) @@ -513,90 +515,90 @@ ) (('login) ;; run level login - (level-update-after-load obj *login-state*) + (level-update-after-load this *login-state*) ) (('loading-bt) ;; link the last object - (let ((a0-26 (the pointer (align64 (-> obj heap current))))) + (let ((a0-26 (the pointer (align64 (-> this heap current))))) (cond - ((dgo-load-link (the-as dgo-header a0-26) (-> obj heap) *print-login* #t) - (level-status-set! obj 'loading-done) + ((dgo-load-link (the-as dgo-header a0-26) (-> this heap) *print-login* #t) + (level-status-set! this 'loading-done) ;; will start login. - (level-status-set! obj 'loaded) + (level-status-set! this 'loaded) ) (else - (set! (-> obj linking) #t) + (set! (-> this linking) #t) ) ) ) ) ) - obj + this ) -(defmethod load-begin level ((obj level)) +(defmethod load-begin level ((this level)) "Start loading the level. Uses 2 megabyte heaps for loading each object." ;; set the level heap. level code logins called from linker may allocate here - (set! loading-level (-> obj heap)) + (set! loading-level (-> this heap)) ;; relocate method of the bsp will look for this - (set! (-> *level* loading-level) obj) + (set! (-> *level* loading-level) this) ;; clear out old stuff (set! (-> *level* log-in-level-bsp) #f) - (set! (-> obj nickname) #f) - (set! (-> obj bsp) #f) - (set! (-> obj entity) #f) - (set! (-> obj ambient) #f) - (set! (-> obj linking) #f) - (vis-clear obj) + (set! (-> this nickname) #f) + (set! (-> this bsp) #f) + (set! (-> this entity) #f) + (set! (-> this ambient) #f) + (set! (-> this linking) #f) + (vis-clear this) - (set! (-> obj status) 'loading) + (set! (-> this status) 'loading) ;; incoming textures should use the level allocator (set! (-> *texture-pool* allocate-func) texture-page-level-allocate) ;; build name - (if (= (-> obj load-name) (-> obj info visname)) - (format (clear *temp-string*) "~S" (-> obj info nickname)) - (format (clear *temp-string*) "~S" (-> obj name)) + (if (= (-> this load-name) (-> this info visname)) + (format (clear *temp-string*) "~S" (-> this info nickname)) + (format (clear *temp-string*) "~S" (-> this name)) ) (set! (-> *temp-string* data 8) (the-as uint 0)) (format *temp-string* ".DGO") ;; reset temporary allocations on level heap - (set! (-> obj heap top) (-> obj heap top-base)) + (set! (-> this heap top) (-> this heap top-base)) ;; allocate DGO loading buffers - (let ((s4-0 (kmalloc (-> obj heap) (* 2 1024 1024) (kmalloc-flags align-64 top) "dgo-level-buf-2")) - (s5-2 (kmalloc (-> obj heap) (* 2 1024 1024) (kmalloc-flags align-64 top) "dgo-level-buf-2")) + (let ((s4-0 (kmalloc (-> this heap) (* 2 1024 1024) (kmalloc-flags align-64 top) "dgo-level-buf-2")) + (s5-2 (kmalloc (-> this heap) (* 2 1024 1024) (kmalloc-flags align-64 top) "dgo-level-buf-2")) ) (load-dbg " DGO buffers at #x~X #x~X~%" s4-0 s5-2) ;; we expect to load code first, remember where the heap is now. - (set! (-> obj code-memory-start) (-> obj heap current)) + (set! (-> this code-memory-start) (-> this heap current)) - (format 0 "-----------> begin load ~A [~S]~%" (-> obj load-name) *temp-string*) + (format 0 "-----------> begin load ~A [~S]~%" (-> this load-name) *temp-string*) ;; kick off the load! - (dgo-load-begin *temp-string* s5-2 s4-0 (the pointer (align64 (-> obj heap current)))) + (dgo-load-begin *temp-string* s5-2 s4-0 (the pointer (align64 (-> this heap current)))) ) - obj + this ) -(defmethod login-begin level ((obj level)) +(defmethod login-begin level ((this level)) "Start the login. This is spread over multiple frames." ;; done with load, reset the texture page allocator (set! (-> *texture-pool* allocate-func) texture-page-default-allocate) (cond - ((-> obj bsp) - (set! (-> *level* log-in-level-bsp) (-> obj bsp)) + ((-> this bsp) + (set! (-> *level* log-in-level-bsp) (-> this bsp)) ;; login textures - (login-level-textures *texture-pool* obj (-> obj bsp texture-page-count) (-> obj bsp texture-ids)) + (login-level-textures *texture-pool* this (-> this bsp texture-page-count) (-> this bsp texture-ids)) ;; login shaders - (let ((bsp (-> obj bsp))) + (let ((bsp (-> this bsp))) (when (nonzero? (-> bsp adgifs)) (let ((adgifs (-> bsp adgifs))) (dotimes (i (-> adgifs length)) @@ -610,16 +612,16 @@ (set! (-> *login-state* state) -1) (set! (-> *login-state* pos) (the-as uint 0)) (set! (-> *login-state* elts) (the-as uint 0)) - (set! (-> obj status) 'login) + (set! (-> this status) 'login) ) (else ;; something went wrong, kill the level. - (level-status-set! obj 'inactive) + (level-status-set! this 'inactive) (set! loading-level global) (set! (-> *level* loading-level) (-> *level* level-default)) ) ) - obj + this ) (defun level-update-after-load ((loaded-level level) (level-login-state login-state)) @@ -872,72 +874,72 @@ loaded-level ) -(defmethod birth level ((obj level)) +(defmethod birth level ((this level)) "Birth a level to make it alive! It must be loaded." - (case (-> obj status) + (case (-> this status) (('loaded) (protect (loading-level (-> *level* loading-level) (-> *level* log-in-level-bsp) ) - (set! loading-level (-> obj heap)) - (set! (-> *level* log-in-level-bsp) (-> obj bsp)) - (set! (-> *level* loading-level) obj) - (birth (-> obj bsp)) - (set! (-> obj status) 'alive) + (set! loading-level (-> this heap)) + (set! (-> *level* log-in-level-bsp) (-> this bsp)) + (set! (-> *level* loading-level) this) + (birth (-> this bsp)) + (set! (-> this status) 'alive) ;;(load-dbg "copy perms~%") - (copy-perms-to-level! *game-info* obj) + (copy-perms-to-level! *game-info* this) ;;(load-dbg "send activate~%") ;; note: this isn't a great name - the level isn't actually activated, just alive. - (send-event *camera* 'level-activate (-> obj name)) - (send-event *target* 'level-activate (-> obj name)) + (send-event *camera* 'level-activate (-> this name)) + (send-event *target* 'level-activate (-> this name)) ) ) ) - obj + this ) -(defmethod deactivate level ((obj level)) +(defmethod deactivate level ((this level)) "Kill the level. This won't remove it from memory." - (case (-> obj status) + (case (-> this status) (('active 'alive) - (format 0 "----------- kill ~A (status ~A)~%" obj (-> obj status)) + (format 0 "----------- kill ~A (status ~A)~%" this (-> this status)) ;; copy data from the level to the game-info storage. This will remember permanent level stuff, like ;; what you collected/completed. - (copy-perms-from-level! *game-info* obj) - (send-event *camera* 'level-deactivate (-> obj name)) - (send-event *target* 'level-deactivate (-> obj name)) + (copy-perms-from-level! *game-info* this) + (send-event *camera* 'level-deactivate (-> this name)) + (send-event *target* 'level-deactivate (-> this name)) ;; remove this BSP from the engine. This will stop us from being drawn. - (remove-by-param1 *background-draw-engine* (-> obj bsp)) + (remove-by-param1 *background-draw-engine* (-> this bsp)) ;; track down all the entities and kill them - (deactivate-entities (-> obj bsp)) + (deactivate-entities (-> this bsp)) ;; kill any remaining particles not associated with a part-tracker - (kill-all-particles-in-level obj) + (kill-all-particles-in-level this) ;; clean up our level - (set! (-> obj inside-sphere?) #f) - (set! (-> obj inside-boxes?) #f) - (set! (-> obj meta-inside?) #f) - (set! (-> obj force-inside?) #f) + (set! (-> this inside-sphere?) #f) + (set! (-> this inside-boxes?) #f) + (set! (-> this meta-inside?) #f) + (set! (-> this force-inside?) #f) ;; we're still loaded. - (set! (-> obj status) 'loaded) + (set! (-> this status) 'loaded) - (set! (-> obj all-visible?) 'loading) + (set! (-> this all-visible?) 'loading) ;; clear vis buffers (dotimes (v1-19 128) - (set! (deref int128 (-> obj vis-bits) v1-19) (the-as int128 0)) + (set! (deref int128 (-> this vis-bits) v1-19) (the-as int128 0)) ) (let ((v1-22 8)) (while (nonzero? v1-22) (+! v1-22 -1) - (let ((a0-14 (-> obj vis-info v1-22))) + (let ((a0-14 (-> this vis-info v1-22))) (if a0-14 (set! (-> a0-14 current-vis-string) (the-as uint -1)) ) @@ -946,26 +948,26 @@ ) ) ) - (if (= (-> *level* log-in-level-bsp) (-> obj bsp)) + (if (= (-> *level* log-in-level-bsp) (-> this bsp)) (set! (-> *level* log-in-level-bsp) #f) ) - obj + this ) -(defmethod unload! level ((obj level)) +(defmethod unload! level ((this level)) "Unloads the level. This does not free the heap. The level will be made inactive and ready to be loaded some other time." - (deactivate obj) - (when (!= (-> obj status) 'inactive) + (deactivate this) + (when (!= (-> this status) 'inactive) ;; if we linked art group, unlink it. - (when (or (= (-> obj status) 'loaded) - (= (-> obj status) 'alive) - (= (-> obj status) 'active) - (= (-> obj status) 'login) + (when (or (= (-> this status) 'loaded) + (= (-> this status) 'alive) + (= (-> this status) 'active) + (= (-> this status) 'login) ) - (dotimes (s5-0 (-> obj art-group art-group-array length)) - (let ((s4-0 (-> obj art-group art-group-array s5-0))) + (dotimes (s5-0 (-> this art-group art-group-array length)) + (let ((s4-0 (-> this art-group art-group-array s5-0))) (if (needs-link? s4-0) (unlink-art! s4-0) ) @@ -974,33 +976,33 @@ ) ;; turn some things off - (set! (-> obj bsp) #f) - (set! (-> obj entity) #f) - (set! (-> obj ambient) #f) - (set! (-> obj status) 'inactive) - (set! (-> obj art-group string-array length) 0) - (set! (-> obj art-group art-group-array length) 0) + (set! (-> this bsp) #f) + (set! (-> this entity) #f) + (set! (-> this ambient) #f) + (set! (-> this status) 'inactive) + (set! (-> this art-group string-array length) 0) + (set! (-> this art-group art-group-array length) 0) ;; unload texture pages - (countdown (s5-1 (-> obj loaded-texture-page-count)) + (countdown (s5-1 (-> this loaded-texture-page-count)) (dotimes (v1-27 32) - (when (= (-> obj loaded-texture-page s5-1) (-> *texture-pool* common-page v1-27)) + (when (= (-> this loaded-texture-page s5-1) (-> *texture-pool* common-page v1-27)) (set! (-> *texture-pool* common-page v1-27) (the-as texture-page 0)) ) ) - (unload! *texture-pool* (-> obj loaded-texture-page s5-1)) + (unload! *texture-pool* (-> this loaded-texture-page s5-1)) ) - (set! (-> obj loaded-texture-page-count) 0) - (unlink-textures-in-heap! *texture-page-dir* (-> obj heap)) + (set! (-> this loaded-texture-page-count) 0) + (unlink-textures-in-heap! *texture-page-dir* (-> this heap)) ;; unload particle groups that were defined in the level data - (unlink-part-group-by-heap (-> obj heap)) + (unlink-part-group-by-heap (-> this heap)) ;; if there are any in-progress art loads for this level, kill them. (dotimes (s5-2 2) (let ((v1-41 (-> *art-control* buffer s5-2 pending-load-file))) - (if (and (>= (the-as int v1-41) (the-as int (-> obj heap base))) - (< (the-as int v1-41) (the-as int (-> obj heap top-base))) + (if (and (>= (the-as int v1-41) (the-as int (-> this heap base))) + (< (the-as int v1-41) (the-as int (-> this heap top-base))) ) (set-pending-file (-> *art-control* buffer s5-2) @@ -1014,7 +1016,7 @@ ) ;; unload packages (doesn't really do anything.) - (let* ((s5-3 (-> obj info packages)) + (let* ((s5-3 (-> this info packages)) (a0-29 (car s5-3)) ) (while (not (null? s5-3)) @@ -1031,27 +1033,27 @@ ) ) - (vis-clear obj) + (vis-clear this) ;; reset the level heap! - (let ((v1-64 (-> obj heap))) + (let ((v1-64 (-> this heap))) (set! (-> v1-64 current) (-> v1-64 base)) ) - (set! (-> obj code-memory-start) (the-as pointer 0)) - (set! (-> obj code-memory-end) (the-as pointer 0)) - (when (= (-> *level* loading-level) obj) + (set! (-> this code-memory-start) (the-as pointer 0)) + (set! (-> this code-memory-end) (the-as pointer 0)) + (when (= (-> *level* loading-level) this) (set! loading-level global) (set! (-> *level* loading-level) (-> *level* level-default)) (set! (-> *level* log-in-level-bsp) #f) ) ) - obj + this ) ;; method 27 level ;; method 10 level -(defmethod is-object-visible? level ((obj level) (arg0 int)) +(defmethod is-object-visible? level ((this level) (arg0 int)) "Is arg0 visible? Note that this will return #f if the visibility data is not loaded." ;; og:preserve-this pc port added option to show every actor regardless @@ -1059,7 +1061,7 @@ ;; check the vis bits! (let* (;; lwu v1, 388(a0) - (vis-data (-> obj vis-bits)) + (vis-data (-> this vis-bits)) ;; sra a0, a1, 3 (byte-idx (sar arg0 3)) ;; daddu v1, a0, v1 @@ -1080,18 +1082,18 @@ ) ) -(defmethod point-in-boxes? level ((obj level) (arg0 vector)) +(defmethod point-in-boxes? level ((this level) (arg0 vector)) "Is this point in the list of level boxes?" (cond - ((or (not (-> obj bsp)) (zero? (-> obj bsp boxes))) + ((or (not (-> this bsp)) (zero? (-> this bsp boxes))) ;; no boxes or no bsp #f ) - ((-> obj force-inside?) + ((-> this force-inside?) #t ) (else - (let* ((a0-1 (-> obj bsp boxes)) + (let* ((a0-1 (-> this bsp boxes)) (v1-5 (-> a0-1 data)) ) (countdown (a0-2 (-> a0-1 length)) @@ -1113,14 +1115,14 @@ ) -(defmethod debug-print-splitbox level ((obj level) (arg0 vector) (arg1 string)) +(defmethod debug-print-splitbox level ((this level) (arg0 vector) (arg1 string)) "Print the current splitbox, if we're in one." (cond - ((or (not (-> obj bsp)) (zero? (-> obj bsp boxes)) (zero? (-> obj bsp split-box-indices))) + ((or (not (-> this bsp)) (zero? (-> this bsp boxes)) (zero? (-> this bsp split-box-indices))) ;; do nothing! ) (else - (let* ((s3-0 (-> obj bsp boxes)) + (let* ((s3-0 (-> this bsp boxes)) (s2-0 (-> s3-0 data)) ) (dotimes (s1-0 (-> s3-0 length)) @@ -1133,7 +1135,7 @@ (< (-> arg0 y) (-> s2-0 0 max y)) (< (-> arg0 z) (-> s2-0 0 max z)) ) - (format arg1 " splitbox-~D~%" (-> obj bsp split-box-indices s1-0)) + (format arg1 " splitbox-~D~%" (-> this bsp split-box-indices s1-0)) ) (set! s2-0 (the (inline-array box8s) (-> s2-0 1))) ) @@ -1145,17 +1147,17 @@ ) -(defmethod mem-usage level ((obj level) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage level ((this level) (arg0 memory-usage-block) (arg1 int)) "Get the memory usage for a level." - (when (= (-> obj status) 'active) + (when (= (-> this status) 'active) (set! (-> arg0 length) (max 65 (-> arg0 length))) (set! (-> arg0 data 64 name) "entity-links") (set! (-> arg0 data 64 count) - (+ (-> arg0 data 64 count) (-> obj entity length)) + (+ (-> arg0 data 64 count) (-> this entity length)) ) - (let ((v1-8 (asize-of (-> obj entity)))) + (let ((v1-8 (asize-of (-> this entity)))) (set! (-> arg0 data 64 used) (+ (-> arg0 data 64 used) v1-8)) (set! (-> arg0 data 64 total) @@ -1166,22 +1168,22 @@ (set! (-> arg0 data 64 name) "ambient-links") (set! (-> arg0 data 64 count) - (+ (-> arg0 data 64 count) (-> obj ambient length)) + (+ (-> arg0 data 64 count) (-> this ambient length)) ) - (let ((v1-18 (asize-of (-> obj ambient)))) + (let ((v1-18 (asize-of (-> this ambient)))) (set! (-> arg0 data 64 used) (+ (-> arg0 data 64 used) v1-18)) (set! (-> arg0 data 64 total) (+ (-> arg0 data 64 total) (logand -16 (+ v1-18 15))) ) ) - (mem-usage (-> obj art-group) arg0 arg1) + (mem-usage (-> this art-group) arg0 arg1) (set! (-> arg0 length) (max 64 (-> arg0 length))) (set! (-> arg0 data 63 name) "level-code") (set! (-> arg0 data 63 count) (+ (-> arg0 data 63 count) 1)) (let ((v1-30 - (&- (-> obj code-memory-end) (the-as uint (-> obj code-memory-start))) + (&- (-> this code-memory-end) (the-as uint (-> this code-memory-start))) ) ) (set! (-> arg0 data 63 used) (+ (-> arg0 data 63 used) v1-30)) @@ -1190,11 +1192,11 @@ (+ (-> arg0 data 63 total) (logand -16 (+ v1-30 15))) ) ) - (countdown (s3-0 (-> obj loaded-texture-page-count)) - (mem-usage (-> obj loaded-texture-page s3-0) arg0 arg1) + (countdown (s3-0 (-> this loaded-texture-page-count)) + (mem-usage (-> this loaded-texture-page s3-0) arg0 arg1) ) (countdown (s3-1 8) - (let ((s2-0 (-> obj vis-info s3-1))) + (let ((s2-0 (-> this vis-info s3-1))) (when s2-0 (cond ((zero? s3-1) @@ -1226,9 +1228,9 @@ ) ) ) - (mem-usage (-> obj bsp) arg0 arg1) + (mem-usage (-> this bsp) arg0 arg1) ) - obj + this ) (#cond @@ -1242,7 +1244,7 @@ ) ) -(defmethod alloc-levels! level-group ((obj level-group) (compact-level-heaps symbol)) +(defmethod alloc-levels! level-group ((this level-group) (compact-level-heaps symbol)) "Allocate the level heaps and load the common packages for levels." ;; only do stuff if levels are not allocated @@ -1261,7 +1263,7 @@ LEVEL_HEAP_SIZE_DEBUG)) ) (dotimes (lev LEVEL_COUNT) - (let ((level-heap (-> obj level lev heap))) + (let ((level-heap (-> this level lev heap))) (set! (-> level-heap base) (malloc 'global level-heap-size)) (set! (-> level-heap current) (-> level-heap base)) (set! (-> level-heap top-base) (&+ (-> level-heap base) level-heap-size)) @@ -1274,56 +1276,56 @@ ) -(defmethod level-get-with-status level-group ((obj level-group) (status symbol)) - (dotimes (i (-> obj length)) - (if (= (-> obj level i status) status) - (return (-> obj level i)) +(defmethod level-get-with-status level-group ((this level-group) (status symbol)) + (dotimes (i (-> this length)) + (if (= (-> this level i status) status) + (return (-> this level i)) ) ) (the-as level #f) ) -(defmethod level-get-most-disposable level-group ((obj level-group)) +(defmethod level-get-most-disposable level-group ((this level-group)) "Get a level that's least likely to be in use right now. #f = all levels in use." ;; check inactive levels first - (dotimes (v1-0 (-> obj length)) - (case (-> obj level v1-0 status) + (dotimes (v1-0 (-> this length)) + (case (-> this level v1-0 status) (('inactive) - (return (-> obj level v1-0)) + (return (-> this level v1-0)) ) ) ) ;; check for any loading levels - (dotimes (v1-6 (-> obj length)) - (case (-> obj level v1-6 status) + (dotimes (v1-6 (-> this length)) + (case (-> this level v1-6 status) (('loading 'loading-bt) - (return (-> obj level v1-6)) + (return (-> this level v1-6)) ) ) ) ;; check for loaded, but not active, levels. - (dotimes (v1-12 (-> obj length)) - (let ((a1-18 (-> obj level v1-12 status))) + (dotimes (v1-12 (-> this length)) + (let ((a1-18 (-> this level v1-12 status))) (if (= a1-18 'loaded) - (return (-> obj level v1-12)) + (return (-> this level v1-12)) ) ) ) ;; check active levels. pick one we're not in bounds of. (let ((v0-0 (the-as level #f))) - (dotimes (v1-18 (-> obj length)) - (case (-> obj level v1-18 status) + (dotimes (v1-18 (-> this length)) + (case (-> this level v1-18 status) (('active) - (if (and (not (-> obj level v1-18 inside-boxes?)) + (if (and (not (-> this level v1-18 inside-boxes?)) (or (not v0-0) - (< (-> obj level v1-18 info priority) (-> v0-0 info priority)) + (< (-> this level v1-18 info priority) (-> v0-0 info priority)) ) ) - (set! v0-0 (-> obj level v1-18)) + (set! v0-0 (-> this level v1-18)) ) ) ) @@ -1332,24 +1334,24 @@ ) ) -(defmethod level-get level-group ((obj level-group) (name symbol)) +(defmethod level-get level-group ((this level-group) (name symbol)) "Return the level data using its name, if it is available. Returns #f if none are found." - (dotimes (lev (-> obj length)) - (if (and (!= (-> obj level lev status) 'inactive) - (or (= (-> obj level lev name) name) - (= (-> obj level lev load-name) name) + (dotimes (lev (-> this length)) + (if (and (!= (-> this level lev status) 'inactive) + (or (= (-> this level lev name) name) + (= (-> this level lev load-name) name) ) ) - (return (-> obj level lev)) + (return (-> this level lev)) ) ) (the level #f) ) -(defmethod art-group-get-by-name level-group ((obj level-group) (arg0 string)) +(defmethod art-group-get-by-name level-group ((this level-group) (arg0 string)) (countdown (i 3) - (let ((lev (-> obj level i))) + (let ((lev (-> this level i))) (countdown (ii (-> lev art-group art-group-array length)) (if (name= (-> lev art-group art-group-array ii name) arg0) (return (-> lev art-group art-group-array ii)) @@ -1361,31 +1363,31 @@ ) -(defmethod activate-levels! level-group ((obj level-group)) +(defmethod activate-levels! level-group ((this level-group)) "Try to activate all levels." - (dotimes (i (-> obj length)) - (level-status-set! (-> obj level i) 'active) + (dotimes (i (-> this length)) + (level-status-set! (-> this level i) 'active) ) 0 ) -(defmethod level-get-target-inside level-group ((obj level-group)) +(defmethod level-get-target-inside level-group ((this level-group)) "Get the level target is in, or one it is close to. The distance checks do not work." (let ((target-trans (target-pos 0))) (let ((current-level (-> *game-info* current-continue level))) - (dotimes (i (-> obj length)) - (let ((ilev (-> obj level i))) + (dotimes (i (-> this length)) + (let ((ilev (-> this level i))) (when (= (-> ilev status) 'active) (if (= (-> ilev name) current-level) (return ilev) ))))) (let ((level-ret (the-as level #f))) (let ((min-distance-to-level 0.0)) ;; uh-huh - (dotimes (i (-> obj length)) - (let ((ilev (-> obj level i))) + (dotimes (i (-> this length)) + (let ((ilev (-> this level i))) (when (= (-> ilev status) 'active) (let ((distance-to-level (vector-vector-distance (-> ilev bsp bsphere) target-trans))) (if (and (-> ilev inside-boxes?) (or (not level-ret) (< distance-to-level min-distance-to-level))) @@ -1396,16 +1398,16 @@ ) ) ) - (dotimes (i (-> obj length)) - (let ((ilev (-> obj level i))) + (dotimes (i (-> this length)) + (let ((ilev (-> this level i))) (when (= (-> ilev status) 'active) (if (-> ilev meta-inside?) (return ilev) )))) (let ((level-ret (the-as level #f))) (let ((min-distance-to-level 0.0)) ;; why? - (dotimes (i (-> obj length)) - (let ((ilev (-> obj level i))) + (dotimes (i (-> this length)) + (let ((ilev (-> this level i))) (when (= (-> ilev status) 'active) (if (or (not level-ret) (< (-> ilev level-distance) min-distance-to-level)) (set! level-ret ilev) @@ -1414,19 +1416,19 @@ ) ) -(defmethod load-commands-set! level-group ((obj level-group) (load-commands pair)) - (set! (-> obj load-commands) load-commands) +(defmethod load-commands-set! level-group ((this level-group) (load-commands pair)) + (set! (-> this load-commands) load-commands) load-commands ) -(defmethod mem-usage level-group ((obj level-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage level-group ((this level-group) (arg0 memory-usage-block) (arg1 int)) "Get the memory usage data for a level-group" ;; get memory usage of each level - (dotimes (i (-> obj length)) - (mem-usage (-> obj level i) arg0 arg1) + (dotimes (i (-> this length)) + (mem-usage (-> this level i) arg0 arg1) ) - obj + this ) (defun bg ((level-name symbol)) @@ -1664,7 +1666,7 @@ 0 ) -(defmethod update! load-state ((obj load-state)) +(defmethod update! load-state ((this load-state)) "Updates load requests." (update-sound-banks) @@ -1675,7 +1677,7 @@ (when (!= (-> s4-0 status) 'inactive) (let ((a0-6 #f)) (dotimes (a1-2 2) - (if (= (-> s4-0 name) (-> obj want a1-2 name)) + (if (= (-> s4-0 name) (-> this want a1-2 name)) (set! a0-6 #t) ) ) @@ -1706,24 +1708,24 @@ (let ((a0-20 #f) (v1-5 #f) ) - (when (-> obj want 0 name) + (when (-> this want 0 name) (set! a0-20 #t) (dotimes (a1-12 3) (let ((a2-9 (-> *level* level a1-12))) (if (and (!= (-> a2-9 status) 'inactive) - (= (-> a2-9 name) (-> obj want 0 name)) + (= (-> a2-9 name) (-> this want 0 name)) ) (set! a0-20 #f) ) ) ) ) - (when (-> obj want 1 name) + (when (-> this want 1 name) (set! v1-5 #t) (dotimes (a1-17 3) (let ((a2-17 (-> *level* level a1-17))) (if (and (!= (-> a2-17 status) 'inactive) - (= (-> a2-17 name) (-> obj want 1 name)) + (= (-> a2-17 name) (-> this want 1 name)) ) (set! v1-5 #f) ) @@ -1734,8 +1736,8 @@ (cond ((and a0-20 v1-5) (set! s4-1 0) - (if (and (-> obj want 1 display?) - (not (-> obj want 0 display?)) + (if (and (-> this want 1 display?) + (not (-> this want 0 display?)) ) (set! s4-1 1) ) @@ -1749,9 +1751,9 @@ ) (when (!= s4-1 -1) (when (or s5-1 (not (check-busy *load-dgo-rpc*))) - (format 0 "Adding level ~A~%" (-> obj want s4-1 name)) - (let ((s3-0 (level-get-for-use *level* (the-as symbol (-> obj want s4-1 name)) 'loaded))) - (when (and s5-1 (-> obj want s4-1 display?)) + (format 0 "Adding level ~A~%" (-> this want s4-1 name)) + (let ((s3-0 (level-get-for-use *level* (the-as symbol (-> this want s4-1 name)) 'loaded))) + (when (and s5-1 (-> this want s4-1 display?)) (format 0 "Waiting for level to load~%") (while (or (= (-> s3-0 status) 'loading) (= (-> s3-0 status) 'loading-bt) @@ -1768,54 +1770,54 @@ ) ) (dotimes (s5-2 2) - (when (-> obj want s5-2 name) + (when (-> this want s5-2 name) (dotimes (s4-2 3) (let ((s3-1 (-> *level* level s4-2))) (when (!= (-> s3-1 status) 'inactive) - (when (= (-> s3-1 name) (-> obj want s5-2 name)) - (when (!= (-> s3-1 display?) (-> obj want s5-2 display?)) + (when (= (-> s3-1 name) (-> this want s5-2 name)) + (when (!= (-> s3-1 display?) (-> this want s5-2 display?)) (cond ((not (-> s3-1 display?)) (cond ((or (= (-> s3-1 status) 'loaded) (= (-> s3-1 status) 'active)) - (format 0 "Displaying level ~A [~A]~%" (-> obj want s5-2 name) (-> obj want s5-2 display?)) + (format 0 "Displaying level ~A [~A]~%" (-> this want s5-2 name) (-> this want s5-2 display?)) (level-get-for-use *level* (-> s3-1 info name) 'active) - (set! (-> s3-1 display?) (-> obj want s5-2 display?)) + (set! (-> s3-1 display?) (-> this want s5-2 display?)) ) (else (when (and (-> s3-1 info wait-for-load) - (!= (-> obj want s5-2 display?) 'display-no-wait) + (!= (-> this want s5-2 display?) 'display-no-wait) ) (send-event *target* 'loading) ) (if (= *cheat-mode* 'debug) - (format *stdcon* "display on for ~A but level is loading~%" (-> obj want s5-2 name)) + (format *stdcon* "display on for ~A but level is loading~%" (-> this want s5-2 name)) ) ) ) ) (else (cond - ((not (-> obj want s5-2 display?)) + ((not (-> this want s5-2 display?)) (set! (-> s3-1 display?) #f) (format 0 "Turning level ~A off~%" (-> s3-1 name)) (deactivate s3-1) ) (else - (format 0 "Setting level ~A display command to ~A~%" (-> obj want s5-2 name) (-> obj want s5-2 display?)) - (set! (-> s3-1 display?) (-> obj want s5-2 display?)) + (format 0 "Setting level ~A display command to ~A~%" (-> this want s5-2 name) (-> this want s5-2 display?)) + (set! (-> s3-1 display?) (-> this want s5-2 display?)) ) ) ) ) ) - (when (!= (-> s3-1 force-all-visible?) (-> obj want s5-2 force-vis?)) - (set! (-> s3-1 force-all-visible?) (-> obj want s5-2 force-vis?)) - (format 0 "Setting force-all-visible?[~A] to ~A~%" (-> obj want s5-2 name) (-> obj want s5-2 force-vis?)) + (when (!= (-> s3-1 force-all-visible?) (-> this want s5-2 force-vis?)) + (set! (-> s3-1 force-all-visible?) (-> this want s5-2 force-vis?)) + (format 0 "Setting force-all-visible?[~A] to ~A~%" (-> this want s5-2 name) (-> this want s5-2 force-vis?)) ) - (when (!= (-> s3-1 force-inside?) (-> obj want s5-2 force-inside?)) - (set! (-> s3-1 force-inside?) (-> obj want s5-2 force-inside?)) - (format 0 "Setting force-inside?[~A] to ~A~%" (-> obj want s5-2 name) (-> obj want s5-2 force-inside?)) + (when (!= (-> s3-1 force-inside?) (-> this want s5-2 force-inside?)) + (set! (-> s3-1 force-inside?) (-> this want s5-2 force-inside?)) + (format 0 "Setting force-inside?[~A] to ~A~%" (-> this want s5-2 name) (-> this want s5-2 force-inside?)) ) ) ) @@ -1841,17 +1843,17 @@ ) ;; if we have the wrong vis - (when (and (!= s5-3 (-> obj vis-nick)) (-> *level* vis?)) + (when (and (!= s5-3 (-> this vis-nick)) (-> *level* vis?)) ;; and we want a vis - (when (-> obj vis-nick) + (when (-> this vis-nick) ;; find matching level and load vis (dotimes (s4-3 (-> *level* length)) (let ((v1-133 (-> *level* level s4-3))) (when (= (-> v1-133 status) 'active) - (if (and (= (-> v1-133 nickname) (-> obj vis-nick)) + (if (and (= (-> v1-133 nickname) (-> this vis-nick)) (-> v1-133 inside-boxes?) ;; note: only start if we are inside boxes. ) - (load-vis-info (-> obj vis-nick) s5-3) + (load-vis-info (-> this vis-nick) s5-3) ) ) ) @@ -1864,7 +1866,7 @@ ;; method 16 level-group (debug text stuff) -(defmethod level-update level-group ((obj level-group)) +(defmethod level-update level-group ((this level-group)) ;; this does nothing... (camera-pos) @@ -1879,12 +1881,12 @@ ;; run level loading! (dotimes (s5-0 2) - (load-continue (-> obj level s5-0)) + (load-continue (-> this level s5-0)) ) ;; compute inside for each level - (dotimes (s5-1 (-> obj length)) - (let ((s4-0 (-> obj level s5-1))) + (dotimes (s5-1 (-> this length)) + (let ((s4-0 (-> this level s5-1))) (when (= (-> s4-0 status) 'active) (set! (-> s4-0 inside-boxes?) (point-in-boxes? s4-0 (-> *math-camera* trans))) (set! (-> s4-0 inside-sphere?) (>= (-> s4-0 bsp bsphere w) (-> s4-0 level-distance))) @@ -1899,14 +1901,14 @@ ;; update load state machine (the level-border one) (update! *load-state*) ;; checkpoint assignment - (dotimes (s5-2 (-> obj length)) - (let ((s4-1 (-> obj level s5-2))) + (dotimes (s5-2 (-> this length)) + (let ((s4-1 (-> this level s5-2))) (when (= (-> s4-1 status) 'active) ;; if you're outside here, and inside somewhere else, kick out of meta inside. (if (and (-> s4-1 inside-boxes?) (not (-> s4-1 other inside-boxes?))) (set! (-> s4-1 other meta-inside?) #f) ) - (when (and (null? (-> obj load-commands)) + (when (and (null? (-> this load-commands)) (= (-> s4-1 nickname) (-> *load-state* vis-nick)) (!= (-> s4-1 name) (-> *game-info* current-continue level)) (-> *level* border?) @@ -1934,8 +1936,8 @@ ) ;; determine vis info idx for each level - (dotimes (v1-67 (-> obj length)) - (let ((a0-26 (-> obj level v1-67))) + (dotimes (v1-67 (-> this length)) + (let ((a0-26 (-> this level v1-67))) (when (= (-> a0-26 status) 'active) ;; self is always 0 (set! (-> a0-26 vis-self-index) 0) @@ -1958,8 +1960,8 @@ ;; display level vis info (when *display-level-border* - (dotimes (s5-3 (-> obj length)) - (let ((s4-3 (-> obj level s5-3))) + (dotimes (s5-3 (-> this length)) + (let ((s4-3 (-> this level s5-3))) (when (= (-> s4-3 status) 'active) (let ((s3-1 (-> s4-3 bsp current-bsp-back-flags))) (dotimes (s2-1 6) @@ -1989,8 +1991,8 @@ ;; will be consistent and there is no way to set a vis to a level that we aren't in. ;; (you can be "in" multiple levels at the same time, when crossing levels, it is expected ;; that you are in both.) - (dotimes (s5-4 (-> obj length)) - (let ((s4-4 (-> obj level s5-4))) + (dotimes (s5-4 (-> this length)) + (let ((s4-4 (-> this level s5-4))) (when (= (-> s4-4 status) 'active) (when (and (= (-> s4-4 nickname) (-> *load-state* vis-nick)) ;; vis for A (not (-> s4-4 inside-boxes?)) ;; but not in A @@ -2011,8 +2013,8 @@ ;; if we are outside of both levels boxes, then we don't really know what to do ;; for vis, and we can display the classic "outside of bsp" error. (cond - ((not (or (-> obj level0 inside-boxes?) (-> obj level1 inside-boxes?))) - (when (or (-> obj level0 vis-info 0) (-> obj level1 vis-info 0)) + ((not (or (-> this level0 inside-boxes?) (-> this level1 inside-boxes?))) + (when (or (-> this level0 vis-info 0) (-> this level1 vis-info 0)) (if (= *cheat-mode* 'debug) (format *stdcon* "~3Loutside of bsp~%~0L") ) @@ -2021,8 +2023,8 @@ (else ;; we are in at least one bsp. ;; now we need to link vis info to bsps. - (dotimes (v1-125 (-> obj length)) - (let ((a0-44 (-> obj level v1-125))) + (dotimes (v1-125 (-> this length)) + (let ((a0-44 (-> this level v1-125))) (when (= (-> a0-44 status) 'active) ;; loop over vis infos (dotimes (a1-17 8) @@ -2115,8 +2117,8 @@ ; ) ; ) ) - (dotimes (s5-5 (-> obj length)) - (let ((s4-5 (-> obj level s5-5))) + (dotimes (s5-5 (-> this length)) + (let ((s4-5 (-> this level s5-5))) (when (= (-> s4-5 status) 'active) (format *stdcon* "~A: ~S ~A~%" (-> s4-5 name) @@ -2150,8 +2152,8 @@ ;; tell PC port about our levels (__pc-set-levels - (if (= (-> obj level0 status) 'inactive) "none" (symbol->string (-> obj level0 nickname))) - (if (= (-> obj level1 status) 'inactive) "none" (symbol->string (-> obj level1 nickname))) + (if (= (-> this level0 status) 'inactive) "none" (symbol->string (-> this level0 nickname))) + (if (= (-> this level1 status) 'inactive) "none" (symbol->string (-> this level1 nickname))) ) 0 diff --git a/goal_src/jak1/engine/level/load-boundary-h.gc b/goal_src/jak1/engine/level/load-boundary-h.gc index 624f8e6439..5525eddd8a 100644 --- a/goal_src/jak1/engine/level/load-boundary-h.gc +++ b/goal_src/jak1/engine/level/load-boundary-h.gc @@ -13,6 +13,8 @@ ;; Crossing load boundaries will change this state. ;; Cutscene playback can also change this state. +;; DECOMP BEGINS + ;; the vertex type used for load boundaries (deftype lbvtx (structure) ((x float :offset-assert 0) diff --git a/goal_src/jak1/engine/level/load-boundary.gc b/goal_src/jak1/engine/level/load-boundary.gc index 3ad3b6245b..5e4b1963c9 100644 --- a/goal_src/jak1/engine/level/load-boundary.gc +++ b/goal_src/jak1/engine/level/load-boundary.gc @@ -5,6 +5,8 @@ ;; name in dgo: load-boundary ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; the editor state (deftype lb-editor-parms (basic) ((boundary load-boundary :offset-assert 4) @@ -1565,55 +1567,55 @@ ) ) -(defmethod reset! load-state ((obj load-state)) - (set! (-> obj want 0 name) #f) - (set! (-> obj want 0 display?) #f) - (set! (-> obj want 0 force-vis?) #f) - (set! (-> obj want 0 force-inside?) #f) - (set! (-> obj want 1 name) #f) - (set! (-> obj want 1 display?) #f) - (set! (-> obj want 1 force-vis?) #f) - (set! (-> obj want 1 force-inside?) #f) - (set! (-> obj command-list) '()) +(defmethod reset! load-state ((this load-state)) + (set! (-> this want 0 name) #f) + (set! (-> this want 0 display?) #f) + (set! (-> this want 0 force-vis?) #f) + (set! (-> this want 0 force-inside?) #f) + (set! (-> this want 1 name) #f) + (set! (-> this want 1 display?) #f) + (set! (-> this want 1 force-vis?) #f) + (set! (-> this want 1 force-inside?) #f) + (set! (-> this command-list) '()) (dotimes (v1-1 256) - (set! (-> obj object-name v1-1) #f) - (set! (-> obj object-status v1-1) (the-as basic 0)) + (set! (-> this object-name v1-1) #f) + (set! (-> this object-status v1-1) (the-as basic 0)) ) - obj + this ) -(defmethod want-levels load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-levels load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) (cond - ((= (-> obj want v1-0 name) arg0) + ((= (-> this want v1-0 name) arg0) (set! arg0 #f) ) - ((= (-> obj want v1-0 name) arg1) + ((= (-> this want v1-0 name) arg1) (set! arg1 #f) ) (else - (set! (-> obj want v1-0 name) #f) + (set! (-> this want v1-0 name) #f) ) ) ) (when arg0 (dotimes (v1-4 2) - (when (not (-> obj want v1-4 name)) - (set! (-> obj want v1-4 name) arg0) - (set! (-> obj want v1-4 display?) #f) - (set! (-> obj want v1-4 force-vis?) #f) - (set! (-> obj want v1-4 force-inside?) #f) + (when (not (-> this want v1-4 name)) + (set! (-> this want v1-4 name) arg0) + (set! (-> this want v1-4 display?) #f) + (set! (-> this want v1-4 force-vis?) #f) + (set! (-> this want v1-4 force-inside?) #f) (set! v1-4 2) ) ) ) (when arg1 (dotimes (v1-10 2) - (when (not (-> obj want v1-10 name)) - (set! (-> obj want v1-10 name) arg1) - (set! (-> obj want v1-10 display?) #f) - (set! (-> obj want v1-10 force-vis?) #f) - (set! (-> obj want v1-10 force-inside?) #f) + (when (not (-> this want v1-10 name)) + (set! (-> this want v1-10 name) arg1) + (set! (-> this want v1-10 display?) #f) + (set! (-> this want v1-10 force-vis?) #f) + (set! (-> this want v1-10 force-inside?) #f) (set! v1-10 2) ) ) @@ -1621,10 +1623,10 @@ 0 ) -(defmethod want-display-level load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-display-level load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 display?) arg1) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 display?) arg1) (return 0) ) ) @@ -1634,15 +1636,15 @@ 0 ) -(defmethod want-vis load-state ((obj load-state) (arg0 symbol)) - (set! (-> obj vis-nick) arg0) +(defmethod want-vis load-state ((this load-state) (arg0 symbol)) + (set! (-> this vis-nick) arg0) 0 ) -(defmethod want-force-vis load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-vis load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 force-vis?) arg1) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 force-vis?) arg1) (return 0) ) ) @@ -1650,10 +1652,10 @@ 0 ) -(defmethod set-force-inside! load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod set-force-inside! load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 force-inside?) arg1) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 force-inside?) arg1) (return 0) ) ) @@ -1681,48 +1683,48 @@ (define *display-load-commands* #f) (define *backup-load-state* (new 'global 'load-state)) -(defmethod backup-load-state-and-set-cmds load-state ((obj load-state) (arg0 pair)) +(defmethod backup-load-state-and-set-cmds load-state ((this load-state) (arg0 pair)) (dotimes (s4-0 256) - (when (-> obj object-name s4-0) + (when (-> this object-name s4-0) (format 0 "WARNING: load state somehow aquired object command ~A~%" - (-> obj object-name s4-0) + (-> this object-name s4-0) ) - (set! (-> obj object-name s4-0) #f) + (set! (-> this object-name s4-0) #f) ) ) - (mem-copy! (&-> *backup-load-state* type) (&-> obj type) 2092) + (mem-copy! (&-> *backup-load-state* type) (&-> this type) 2092) (set! (-> *backup-load-state* command-list) '()) - (set! (-> obj command-list) arg0) + (set! (-> this command-list) arg0) 0 ) -(defmethod restore-load-state-and-cleanup load-state ((obj load-state)) - (execute-commands-up-to obj 100000.0) +(defmethod restore-load-state-and-cleanup load-state ((this load-state)) + (execute-commands-up-to this 100000.0) (dotimes (s5-0 256) - (when (-> obj object-name s5-0) - (let ((a0-3 (entity-by-name (the-as string (-> obj object-name s5-0))))) + (when (-> this object-name s5-0) + (let ((a0-3 (entity-by-name (the-as string (-> this object-name s5-0))))) (set! (-> a0-3 extra perm status) - (the-as entity-perm-status (-> obj object-status s5-0)) + (the-as entity-perm-status (-> this object-status s5-0)) ) (if (-> a0-3 extra process) (kill! a0-3) ) ) - (set! (-> obj object-name s5-0) #f) + (set! (-> this object-name s5-0) #f) ) ) - (mem-copy! (&-> obj type) (&-> *backup-load-state* type) 2092) + (mem-copy! (&-> this type) (&-> *backup-load-state* type) 2092) 0 ) -(defmethod restore-load-state load-state ((obj load-state)) +(defmethod restore-load-state load-state ((this load-state)) (dotimes (v1-0 256) - (if (-> obj object-name v1-0) - (set! (-> obj object-name v1-0) #f) + (if (-> this object-name v1-0) + (set! (-> this object-name v1-0) #f) ) ) - (mem-copy! (&-> obj type) (&-> *backup-load-state* type) 2092) + (mem-copy! (&-> this type) (&-> *backup-load-state* type) 2092) 0 ) @@ -1808,10 +1810,10 @@ ) ) -(defmethod execute-commands-up-to load-state ((obj load-state) (arg0 float)) - (while (not (null? (-> obj command-list))) - (let ((f0-0 (command-get-float (car (car (-> obj command-list))) 0.0)) - (s4-0 (cdr (car (-> obj command-list)))) +(defmethod execute-commands-up-to load-state ((this load-state) (arg0 float)) + (while (not (null? (-> this command-list))) + (let ((f0-0 (command-get-float (car (car (-> this command-list))) 0.0)) + (s4-0 (cdr (car (-> this command-list)))) ) (if (< arg0 f0-0) (return (the-as int #f)) @@ -1829,24 +1831,24 @@ ((pair? (car s4-0)) (let ((a1-3 (car s4-0))) (while (not (null? s4-0)) - (execute-command obj (the-as pair a1-3)) + (execute-command this (the-as pair a1-3)) (set! s4-0 (cdr s4-0)) (set! a1-3 (car s4-0)) ) ) ) (else - (execute-command obj s4-0) + (execute-command this s4-0) ) ) ) - (set! (-> obj command-list) (cdr (-> obj command-list))) + (set! (-> this command-list) (cdr (-> this command-list))) ) 0 ) -(defmethod execute-command load-state ((obj load-state) (arg0 pair)) +(defmethod execute-command load-state ((this load-state) (arg0 pair)) (local-vars (v1-26 int) (v1-57 int)) (with-pp (cond @@ -1868,32 +1870,32 @@ ((the-as (function int) (command-get-param (car gp-0) #f))) ) ((= v1-4 'want-vis) - (want-vis obj (the-as symbol (command-get-param (car gp-0) #f))) + (want-vis this (the-as symbol (command-get-param (car gp-0) #f))) ) ((= v1-4 'want-levels) (want-levels - obj + this (the-as symbol (command-get-param (car gp-0) #f)) (the-as symbol (command-get-param (car (cdr gp-0)) #f)) ) ) ((= v1-4 'display-level) (want-display-level - obj + this (the-as symbol (command-get-param (car gp-0) #f)) (the-as symbol (command-get-param (car (cdr gp-0)) #f)) ) ) ((= v1-4 'want-force-vis) (want-force-vis - obj + this (the-as symbol (command-get-param (car gp-0) #f)) (the-as symbol (command-get-param (car (cdr gp-0)) #f)) ) ) ((= v1-4 'want-force-inside) (set-force-inside! - obj + this (the-as symbol (command-get-param (car gp-0) #f)) (the-as symbol (command-get-param (car (cdr gp-0)) #f)) ) @@ -1904,9 +1906,9 @@ (let ((gp-1 (entity-by-name (the-as string s4-5)))) (when gp-1 (dotimes (v1-25 256) - (when (not (-> obj object-name v1-25)) - (set! (-> obj object-name v1-25) (the-as symbol s4-5)) - (set! (-> obj object-status v1-25) (the-as basic (-> gp-1 extra perm status))) + (when (not (-> this object-name v1-25)) + (set! (-> this object-name v1-25) (the-as symbol s4-5)) + (set! (-> this object-status v1-25) (the-as basic (-> gp-1 extra perm status))) (set! v1-26 v1-25) (goto cfg-29) ) @@ -1933,12 +1935,12 @@ (let ((s4-6 (entity-by-name (the-as string s3-4)))) (when s4-6 (dotimes (gp-2 256) - (when (string= (the-as string (-> obj object-name gp-2)) (the-as string s3-4)) - (set! (-> s4-6 extra perm status) (the-as entity-perm-status (-> obj object-status gp-2))) + (when (string= (the-as string (-> this object-name gp-2)) (the-as string s3-4)) + (set! (-> s4-6 extra perm status) (the-as entity-perm-status (-> this object-status gp-2))) (if (-> s4-6 extra process) (kill! s4-6) ) - (set! (-> obj object-name gp-2) #f) + (set! (-> this object-name gp-2) #f) (goto cfg-45) ) ) @@ -1954,9 +1956,9 @@ (let ((gp-3 (entity-by-name (the-as string s4-7)))) (when gp-3 (dotimes (v1-56 256) - (when (not (-> obj object-name v1-56)) - (set! (-> obj object-name v1-56) (the-as symbol s4-7)) - (set! (-> obj object-status v1-56) (the-as basic (-> gp-3 extra perm status))) + (when (not (-> this object-name v1-56)) + (set! (-> this object-name v1-56) (the-as symbol s4-7)) + (set! (-> this object-status v1-56) (the-as basic (-> gp-3 extra perm status))) (set! v1-57 v1-56) (goto cfg-56) ) @@ -2070,7 +2072,7 @@ ) ) ((= v1-4 'save) - (mem-copy! (&-> *backup-load-state* type) (&-> obj type) 2092) + (mem-copy! (&-> *backup-load-state* type) (&-> this type) 2092) (set! (-> *backup-load-state* command-list) '()) (dotimes (v1-112 256) (if (-> *backup-load-state* object-name v1-112) diff --git a/goal_src/jak1/engine/load/decomp-h.gc b/goal_src/jak1/engine/load/decomp-h.gc index f2d023ba18..8d11fe63dd 100644 --- a/goal_src/jak1/engine/load/decomp-h.gc +++ b/goal_src/jak1/engine/load/decomp-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: decomp-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; temporary storage for visibility data decompression. ;; this is stored on the scratchpad. (deftype decomp-work (structure) diff --git a/goal_src/jak1/engine/load/decomp.gc b/goal_src/jak1/engine/load/decomp.gc index 602a3c20fd..32ee747e74 100644 --- a/goal_src/jak1/engine/load/decomp.gc +++ b/goal_src/jak1/engine/load/decomp.gc @@ -7,6 +7,8 @@ ;; This file contains update-vis! which updates the vis-bits string from the loaded VIS file. +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; decompression functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -111,7 +113,7 @@ (none) ) -(defmethod update-vis! level ((obj level) (vis-info level-vis-info) (arg1 uint) (arg2 uint)) +(defmethod update-vis! level ((this level) (vis-info level-vis-info) (arg1 uint) (arg2 uint)) "Update the vis-bits for the level with the given vis info. arg1 unused. if the vis-file flag isn't set, will use arg2 as vis data." (local-vars (t0-3 uint128) (vis-buffer object)) @@ -136,7 +138,7 @@ ) ;; we're done! Deal with the vis data. (logclear! (-> vis-info flags) (vis-info-flag waiting-for-iop-to-ee)) - (set! vis-buffer (-> obj vis-buffer)) + (set! vis-buffer (-> this vis-buffer)) (b! #t cfg-27 :delay (nop!)) ) (else @@ -166,13 +168,13 @@ ;; start a ramdisk load. This should have already been done as part of level loading anyway. ;; so this will just get the ramdisk file ID. - (let ((vis-load-result (vis-load obj))) + (let ((vis-load-result (vis-load this))) (b! (nonzero? vis-load-result) cfg-21) ;; ramdisk failed, make everything visible. (let* ((dest-bits (-> vis-info vis-bits)) - (len (-> obj bsp visible-list-length)) - (bsp-bits (the-as (pointer uinteger) (-> obj bsp all-visible-list))) + (len (-> this bsp visible-list-length)) + (bsp-bits (the-as (pointer uinteger) (-> this bsp all-visible-list))) (len-qw (/ (+ len 15) 16)) ) (dotimes (a2-1 len-qw) @@ -192,7 +194,7 @@ ;; from the DVD. So display a message and keep us in loading. (when (check-busy *ramdisk-rpc*) (set! (-> vis-info current-vis-string) (the-as uint -1)) - (set! (-> obj all-visible?) 'loading) + (set! (-> this all-visible?) 'loading) (if (= *cheat-mode* 'debug) (format *stdcon* "Ramdisk loading~%") ) @@ -206,7 +208,7 @@ (the-as int vis-load-result) ;; file ID in ramdisk desired-vis-str ;; the offset in the VIS file (the-as uint 2048) ;; always do 2kB. it's a worst case if the string can't be compressed - (-> obj vis-buffer) ;; copy to the level buffer for vis data + (-> this vis-buffer) ;; copy to the level buffer for vis data ) (set! result #f) ;; this takes time, so quit and report that we failed. (b! #t cfg-55 :delay (nop!)) @@ -219,7 +221,7 @@ (let ((lower-flag-bits (the-as int (logand #x1fffffff (-> vis-info flags)))) (spad-start (the-as object (scratchpad-object object :offset 16))) (spad-end (the-as int (scratchpad-object int :offset 2064))) - (list-len (-> obj bsp visible-list-length)) + (list-len (-> this bsp visible-list-length)) ) (when (zero? (the-as vis-info-flag lower-flag-bits)) ;; set the spad buffer to 0 (but we write over this next??) @@ -243,7 +245,7 @@ ) ) (unpack-vis - (-> obj bsp drawable-trees) + (-> this bsp drawable-trees) (the-as (pointer int8) spad-start) (the-as (pointer int8) vis-buffer) ) @@ -282,7 +284,7 @@ ;; remove any bits. ;; this just prints errors. (let ((s2-1 (the-as object vis-buffer)) - (s1-1 (the-as (pointer uinteger) (-> obj bsp all-visible-list))) + (s1-1 (the-as (pointer uinteger) (-> this bsp all-visible-list))) (v1-67 #f) ;; found error ) (dotimes (s0-1 list-len) @@ -318,7 +320,7 @@ ;; also copy from vis-buffer (may be spad) to the final vis-bits output (let ((v1-71 (the-as object vis-buffer)) (a0-47 (-> vis-info vis-bits)) - (a1-22 (the-as (pointer uinteger) (-> obj bsp all-visible-list))) + (a1-22 (the-as (pointer uinteger) (-> this bsp all-visible-list))) (a2-11 (/ (+ list-len 15) 16)) ) (dotimes (a3-8 a2-11) diff --git a/goal_src/jak1/engine/load/file-io.gc b/goal_src/jak1/engine/load/file-io.gc index eba11c84d5..97c38d27a3 100644 --- a/goal_src/jak1/engine/load/file-io.gc +++ b/goal_src/jak1/engine/load/file-io.gc @@ -19,6 +19,8 @@ ;; 3). The C runtime constructs this type before anything is loaded. The sizes ;; must be kept up to date there as well. +;; DECOMP BEGINS + (deftype file-stream (basic) ((flags uint32 :offset-assert 4) (mode symbol :offset-assert 8) @@ -83,11 +85,11 @@ :flag-assert #x900000020 ) -(defmethod print file-info ((obj file-info)) +(defmethod print file-info ((this file-info)) "Print information about a file" (format #t "#<~A ~A :version ~D.~D @ #x~X>" - (-> obj type) (-> obj file-name) (-> obj major-version) (-> obj minor-version) obj) - obj + (-> this type) (-> this file-name) (-> this major-version) (-> this minor-version) this) + this ) ;; allocate a temporary string diff --git a/goal_src/jak1/engine/load/load-dgo.gc b/goal_src/jak1/engine/load/load-dgo.gc index 7a3f5387a4..6c818930a5 100644 --- a/goal_src/jak1/engine/load/load-dgo.gc +++ b/goal_src/jak1/engine/load/load-dgo.gc @@ -21,6 +21,8 @@ (invalid 666) ;; invalid status indicating a communication error. ) +;; DECOMP BEGINS + ;; load command sent to the IOP to load a DGO. ;; The OVERLORD responds with the same message. (deftype load-dgo-msg (structure) diff --git a/goal_src/jak1/engine/load/loader-h.gc b/goal_src/jak1/engine/load/loader-h.gc index 40fa94b5bd..31272cae0d 100644 --- a/goal_src/jak1/engine/load/loader-h.gc +++ b/goal_src/jak1/engine/load/loader-h.gc @@ -16,6 +16,7 @@ (defconstant SPOOL_HEAP_SIZE (* 247 1024)) ;; size of the heap to be used for each spool +;; DECOMP BEGINS ;; A load-dir is a collection of references to loaded art. ;; This type didn't have a nomral inspect method, so these field names are made up. @@ -50,33 +51,33 @@ (defmethod new load-dir ((allocation symbol) (type-to-make type) (length int) (lev level)) "Allocate a new load-dir with room for length entries" - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj lev) lev) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this lev) lev) ;; create the name array - (set! (-> obj string-array) + (set! (-> this string-array) (the-as (array string) ((method-of-type array new) allocation array string length) ) ) - (set! (-> obj string-array length) 0) + (set! (-> this string-array length) 0) ;; create the data array - (set! (-> obj data-array) + (set! (-> this data-array) (the-as (array art-group) ((method-of-type array new) allocation array basic length) )) - (set! (-> obj data-array length) 0) - obj + (set! (-> this data-array length) 0) + this ) ) (defmethod new load-dir-art-group ((allocation symbol) (type-to-make type) (length int) (lev level)) "Allocate a new load-dir with room for length art-groups" ;; call parent ctor. - (let ((obj ((method-of-type load-dir new) allocation type-to-make length lev))) + (let ((this ((method-of-type load-dir new) allocation type-to-make length lev))) ;; override the content type - (set! (-> obj data-array content-type) art-group) + (set! (-> this data-array content-type) art-group) ;; and cast to child. - (the-as load-dir-art-group obj) + (the-as load-dir-art-group this) ) ) @@ -128,21 +129,21 @@ (defmethod new external-art-buffer ((allocation symbol) (type-to-make type) (idx int)) "Allocate a new external-art-buffer" - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj index) idx) - (set! (-> obj load-file) #f) - (set! (-> obj load-file-part) -1) - (set! (-> obj load-file-owner) (the-as handle #f)) - (set! (-> obj load-file-priority) SPOOL_PRIORITY_LOWEST) - (set! (-> obj pending-load-file) #f) - (set! (-> obj pending-load-file-part) -1) - (set! (-> obj pending-load-file-owner) (the-as handle #f)) - (set! (-> obj pending-load-file-priority) SPOOL_PRIORITY_LOWEST) - (set! (-> obj art-group) #f) - (set! (-> obj status) 'initialize) - (set! (-> obj locked?) #f) - (set! (-> obj other) #f) - obj + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this index) idx) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this art-group) #f) + (set! (-> this status) 'initialize) + (set! (-> this locked?) #f) + (set! (-> this other) #f) + this ) ) @@ -196,38 +197,36 @@ (defmethod new external-art-control ((allocation symbol) (type-to-make type)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) ;; allocate buffers. (dotimes (buff-idx 2) - (set! (-> obj buffer buff-idx) + (set! (-> this buffer buff-idx) ((method-of-type external-art-buffer new) allocation external-art-buffer buff-idx) ) ) ;; point buffers to each other - (set! (-> obj buffer 0 other) (-> obj buffer 1)) - (set! (-> obj buffer 1 other) (-> obj buffer 0)) + (set! (-> this buffer 0 other) (-> this buffer 1)) + (set! (-> this buffer 1 other) (-> this buffer 0)) ;; set up recs (dotimes (rec-idx 3) - (set! (-> obj rec rec-idx name) #f) - (set! (-> obj rec rec-idx priority) SPOOL_PRIORITY_LOWEST) - (set! (-> obj rec rec-idx owner) (the-as handle #f)) + (set! (-> this rec rec-idx name) #f) + (set! (-> this rec rec-idx priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this rec rec-idx owner) (the-as handle #f)) ) ;; set up defaults. - (set! (-> obj spool-lock) (the-as handle #f)) - (set! (-> obj reserve-buffer) #f) - (set! (-> obj active-stream) #f) - (set! (-> obj preload-stream name) #f) - (set! (-> obj preload-stream priority) SPOOL_PRIORITY_LOWEST) - (set! (-> obj preload-stream owner) (the-as handle #f)) - (set! (-> obj last-preload-stream name) #f) - (set! (-> obj last-preload-stream priority) SPOOL_PRIORITY_LOWEST) - (set! (-> obj last-preload-stream owner) (the-as handle #f)) - obj + (set! (-> this spool-lock) (the-as handle #f)) + (set! (-> this reserve-buffer) #f) + (set! (-> this active-stream) #f) + (set! (-> this preload-stream name) #f) + (set! (-> this preload-stream priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this preload-stream owner) (the-as handle #f)) + (set! (-> this last-preload-stream name) #f) + (set! (-> this last-preload-stream priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this last-preload-stream owner) (the-as handle #f)) + this ) ) (define-extern *art-control* external-art-control) (defun-extern art-group-load-check string kheap int art-group) - - diff --git a/goal_src/jak1/engine/load/loader.gc b/goal_src/jak1/engine/load/loader.gc index 0f219f6c63..cf3f0b416c 100644 --- a/goal_src/jak1/engine/load/loader.gc +++ b/goal_src/jak1/engine/load/loader.gc @@ -6,27 +6,28 @@ ;; dgos: GAME, ENGINE ;; note: changed for high fps +;; DECOMP BEGINS -(defmethod inspect load-dir ((obj load-dir)) +(defmethod inspect load-dir ((this load-dir)) "Print all the stuff in a load-dir" - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlevel: ~A~%" (-> obj lev)) - (format #t "~Tallocated-length: ~D~%" (-> obj string-array allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj string-array length)) - (dotimes (i (-> obj string-array length)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlevel: ~A~%" (-> this lev)) + (format #t "~Tallocated-length: ~D~%" (-> this string-array allocated-length)) + (format #t "~Tlength: ~D~%" (-> this string-array length)) + (dotimes (i (-> this string-array length)) (format #t "~T [~D] ~S ~A (~D bytes)~%" - i (-> obj string-array i) (-> obj data-array i) (mem-size (-> obj data-array i) #f 0)) + i (-> this string-array i) (-> this data-array i) (mem-size (-> this data-array i) #f 0)) ) - obj + this ) -(defmethod mem-usage load-dir ((obj load-dir) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage load-dir ((this load-dir) (arg0 memory-usage-block) (arg1 int)) "Get the memory usage data of a load-dir" (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "array") (set! (-> arg0 data 81 count) (+ (-> arg0 data 81 count) 1)) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (set! (-> arg0 data 81 used) (+ (-> arg0 data 81 used) v1-6)) (set! (-> arg0 data 81 total) @@ -36,7 +37,7 @@ (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "array") (set! (-> arg0 data 81 count) (-> arg0 data 81 count)) - (let ((v1-15 (asize-of (-> obj string-array)))) + (let ((v1-15 (asize-of (-> this string-array)))) (set! (-> arg0 data 81 used) (+ (-> arg0 data 81 used) v1-15)) (set! (-> arg0 data 81 total) @@ -46,37 +47,37 @@ (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "array") (set! (-> arg0 data 81 count) (-> arg0 data 81 count)) - (let ((v1-24 (asize-of (-> obj data-array)))) + (let ((v1-24 (asize-of (-> this data-array)))) (set! (-> arg0 data 81 used) (+ (-> arg0 data 81 used) v1-24)) (set! (-> arg0 data 81 total) (+ (-> arg0 data 81 total) (logand -16 (+ v1-24 15))) ) ) - (dotimes (s3-0 (-> obj data-array length)) - (mem-usage (-> obj data-array s3-0) arg0 arg1) + (dotimes (s3-0 (-> this data-array length)) + (mem-usage (-> this data-array s3-0) arg0 arg1) ) (the-as load-dir #f) ) -(defmethod load-to-heap-by-name load-dir-art-group ((obj load-dir-art-group) (art-name string) (do-reload symbol) (heap kheap) (version int)) +(defmethod load-to-heap-by-name load-dir-art-group ((this load-dir-art-group) (art-name string) (do-reload symbol) (heap kheap) (version int)) "Load the art with the given name to the heap and return the art. Won't load a thing if it's already loaded, unless you set do-reload. This is intended for debug only." ;; see if we already have it. - (let ((s5-0 (-> obj string-array))) + (let ((s5-0 (-> this string-array))) (dotimes (s3-0 (-> s5-0 length)) (when (string= art-name (-> s5-0 s3-0)) (when do-reload ;; we have it, reload it if requested (let ((v1-4 (art-group-load-check art-name heap version))) (if v1-4 - (set! (-> obj art-group-array s3-0) v1-4) + (set! (-> this art-group-array s3-0) v1-4) ) ) ) - (return (-> obj art-group-array s3-0)) + (return (-> this art-group-array s3-0)) ) ) @@ -84,30 +85,30 @@ (let ((v0-2 (art-group-load-check art-name heap version))) (when v0-2 (set! (-> s5-0 (-> s5-0 length)) art-name) - (set! (-> obj art-group-array (-> s5-0 length)) v0-2) + (set! (-> this art-group-array (-> s5-0 length)) v0-2) (+! (-> s5-0 length) 1) - (+! (-> obj art-group-array length) 1) + (+! (-> this art-group-array length) 1) ) v0-2 ) ) ) -(defmethod set-loaded-art load-dir-art-group ((obj load-dir-art-group) (arg0 art-group)) +(defmethod set-loaded-art load-dir-art-group ((this load-dir-art-group) (arg0 art-group)) "Add some already loaded art to the load-dir." - (let ((s4-0 (-> obj string-array))) + (let ((s4-0 (-> this string-array))) (dotimes (s3-0 (-> s4-0 length)) (when (string= (-> arg0 name) (-> s4-0 s3-0)) - (set! (-> obj art-group-array s3-0) arg0) - (return (-> obj art-group-array s3-0)) + (set! (-> this art-group-array s3-0) arg0) + (return (-> this art-group-array s3-0)) ) ) (set! (-> s4-0 (-> s4-0 length)) (-> arg0 name)) - (set! (-> obj art-group-array (-> s4-0 length)) arg0) + (set! (-> this art-group-array (-> s4-0 length)) arg0) (set! (-> s4-0 length) (+ (-> s4-0 length) 1)) ) - (set! (-> obj art-group-array length) (+ (-> obj art-group-array length) 1)) + (set! (-> this art-group-array length) (+ (-> this art-group-array length) 1)) arg0 ) @@ -181,53 +182,53 @@ ) ) -(defmethod set-pending-file external-art-buffer ((obj external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) +(defmethod set-pending-file external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) "Request a new file to be loaded into this buffer." - (set! (-> obj pending-load-file) arg0) - (set! (-> obj pending-load-file-part) arg1) - (set! (-> obj pending-load-file-owner) arg2) - (set! (-> obj pending-load-file-priority) arg3) + (set! (-> this pending-load-file) arg0) + (set! (-> this pending-load-file-part) arg1) + (set! (-> this pending-load-file-owner) arg2) + (set! (-> this pending-load-file-priority) arg3) 0 ) -(defmethod unlock! external-art-buffer ((obj external-art-buffer)) +(defmethod unlock! external-art-buffer ((this external-art-buffer)) "Unlock this buffer." (declare (inline)) - (set! (-> obj locked?) #f) + (set! (-> this locked?) #f) #f ) -(defmethod inactive? external-art-buffer ((obj external-art-buffer)) +(defmethod inactive? external-art-buffer ((this external-art-buffer)) "Is this buffer inactive?" (declare (inline)) - (!= (-> obj status) 'active) + (!= (-> this status) 'active) ) -(defmethod file-status external-art-buffer ((obj external-art-buffer) (name string) (part int)) +(defmethod file-status external-art-buffer ((this external-art-buffer) (name string) (part int)) "Get the status of a file in the buffer. #f = file is not present." - (when (and (name= (-> obj pending-load-file) name) - (= (-> obj pending-load-file-part) part) + (when (and (name= (-> this pending-load-file) name) + (= (-> this pending-load-file-part) part) ) ;; the file is at least wanting to load - (if (and (name= (-> obj load-file) name) (= (-> obj load-file-part) part)) - (-> obj status) ;; file is loaded or loading + (if (and (name= (-> this load-file) name) (= (-> this load-file-part) part)) + (-> this status) ;; file is loaded or loading 'pending ;; file has not started loading yet. ) ) ) -(defmethod link-art! art-group ((obj art-group)) +(defmethod link-art! art-group ((this art-group)) "Links the elements of this art-group. This will put a reference to this joint animation in the level art group. Level art groups have slots for temporarily loaded joint animations." - (when obj - (countdown (s5-0 (-> obj length)) - (let* ((art-elt (-> obj data s5-0)) + (when this + (countdown (s5-0 (-> this length)) + (let* ((art-elt (-> this data s5-0)) (janim (if (and (nonzero? art-elt) (type-type? (-> art-elt type) art-joint-anim)) (the-as art-joint-anim art-elt) )) @@ -269,21 +270,21 @@ ) ) (if (not success) - (format 0 "ERROR: ~A could not find a master slot to link for ~A.~%" (-> obj name) janim) + (format 0 "ERROR: ~A could not find a master slot to link for ~A.~%" (-> this name) janim) ) ) ) ) ) - obj + this ) -(defmethod unlink-art! art-group ((obj art-group)) +(defmethod unlink-art! art-group ((this art-group)) "Unlinks the elements of this art-group. This will undo the link-art! function." - (when obj - (countdown (s5-0 (-> obj length)) - (let* ((art-elt (-> obj data s5-0)) + (when this + (countdown (s5-0 (-> this length)) + (let* ((art-elt (-> this data s5-0)) (janim (if (and (nonzero? art-elt) (type-type? (-> art-elt type) art-joint-anim)) (the-as art-joint-anim art-elt) )) @@ -310,7 +311,7 @@ ) ) (if (not success) - (format 0 "ERROR: ~A could not find a master slot to unlink for ~A.~%" (-> obj name) janim) + (format 0 "ERROR: ~A could not find a master slot to unlink for ~A.~%" (-> this name) janim) ) ) ) @@ -319,74 +320,74 @@ 0 ) -(defmethod link-file external-art-buffer ((obj external-art-buffer) (ag art-group)) +(defmethod link-file external-art-buffer ((this external-art-buffer) (ag art-group)) "Link the art-group and set it to this buffer's art group." (when ag (link-art! ag) - (set! (-> obj art-group) ag) + (set! (-> this art-group) ag) ) ag ) -(defmethod unlink-file external-art-buffer ((obj external-art-buffer) (ag art-group)) +(defmethod unlink-file external-art-buffer ((this external-art-buffer) (ag art-group)) "Unlink the art-group and remove this buffer's art group." (when ag (unlink-art! ag) - (set! (-> obj art-group) #f) + (set! (-> this art-group) #f) ) 0 ) -(defmethod update external-art-buffer ((obj external-art-buffer)) +(defmethod update external-art-buffer ((this external-art-buffer)) "Update this buffer." - (when (or (not (name= (-> obj pending-load-file) (-> obj load-file))) - (!= (-> obj pending-load-file-part) (-> obj load-file-part)) + (when (or (not (name= (-> this pending-load-file) (-> this load-file))) + (!= (-> this pending-load-file-part) (-> this load-file-part)) ) ;; we're loading a different file, or a different part of a file - (unless (handle->process (-> obj pending-load-file-owner)) + (unless (handle->process (-> this pending-load-file-owner)) ;; nobody owns the loading file so we can discard it - (set! (-> obj pending-load-file) #f) - (set! (-> obj pending-load-file-part) -1) - (set! (-> obj pending-load-file-owner) (the-as handle #f)) - (set! (-> obj pending-load-file-priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) SPOOL_PRIORITY_LOWEST) ) - (when (= (-> obj status) 'initialize) + (when (= (-> this status) 'initialize) ;; we need to initialize the heap - (let ((v1-11 (-> obj heap))) + (let ((v1-11 (-> this heap))) ;; Scary: this is a hard coded address that points to the kernel memory. ;; it turns out the kernel doesn't need this. So we can use it! - (set! (-> v1-11 base) (the-as pointer (+ #x84000 (* SPOOL_HEAP_SIZE (-> obj index))))) + (set! (-> v1-11 base) (the-as pointer (+ #x84000 (* SPOOL_HEAP_SIZE (-> this index))))) (set! (-> v1-11 current) (-> v1-11 base)) (set! (-> v1-11 top-base) (&+ (-> v1-11 base) SPOOL_HEAP_SIZE)) (set! (-> v1-11 top) (-> v1-11 top-base)) ) - (set! (-> obj status) 'inactive) + (set! (-> this status) 'inactive) ;; heap is now allocated, but there is no data to use ) (cond - ((-> obj load-file) + ((-> this load-file) ;; the buffer is working on a file - (if (= (-> obj status) 'loading) + (if (= (-> this status) 'loading) ;; something else is already loading, cancel that because we want something else (str-load-cancel) ) ;; now nothing is loaded! - (set! (-> obj load-file) #f) - (set! (-> obj load-file-part) -1) - (set! (-> obj load-file-owner) (the-as handle #f)) - (set! (-> obj load-file-priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) SPOOL_PRIORITY_LOWEST) ;; on the next time through, we will set the actual load file. ) (else ;; we have officially chosen to load this file - (set! (-> obj load-file) (-> obj pending-load-file)) - (set! (-> obj load-file-part) (-> obj pending-load-file-part)) - (set! (-> obj load-file-owner) (-> obj pending-load-file-owner)) - (set! (-> obj load-file-priority) (-> obj pending-load-file-priority)) + (set! (-> this load-file) (-> this pending-load-file)) + (set! (-> this load-file-part) (-> this pending-load-file-part)) + (set! (-> this load-file-owner) (-> this pending-load-file-owner)) + (set! (-> this load-file-priority) (-> this pending-load-file-priority)) ) ) ) @@ -394,57 +395,57 @@ (label cfg-18) (cond - ((-> obj load-file) + ((-> this load-file) ;; something is being worked on - (case (-> obj status) + (case (-> this status) (('active 'reserved) ;; file is loaded and usable (or reserved) ) (('error) ;; oops an error happened. make this buffer unusable now. - (set! (-> obj status) 'inactive) - (set! (-> obj load-file) #f) - (set! (-> obj load-file-part) -1) - (set! (-> obj load-file-owner) (the-as handle #f)) - (set! (-> obj load-file-priority) SPOOL_PRIORITY_LOWEST) - (set! (-> obj pending-load-file) #f) - (set! (-> obj pending-load-file-part) -1) - (set! (-> obj pending-load-file-owner) (the-as handle #f)) - (set! (-> obj pending-load-file-priority) SPOOL_PRIORITY_LOWEST) - (set! (-> obj art-group) #f) + (set! (-> this status) 'inactive) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this art-group) #f) ) (('inactive) ;; no usable data here, fill the buffer - (kheap-reset (-> obj heap)) + (kheap-reset (-> this heap)) (cond - ((string= (-> obj load-file) "reserved") ;; we want to reserve this buffer for something (not loading an str file) + ((string= (-> this load-file) "reserved") ;; we want to reserve this buffer for something (not loading an str file) (cond ((-> *art-control* reserve-buffer) - (format 0 "ERROR: trying double reserve ~A when ~A is reserved~%" obj (-> *art-control* reserve-buffer)) + (format 0 "ERROR: trying double reserve ~A when ~A is reserved~%" this (-> *art-control* reserve-buffer)) ) (else - (set! (-> obj status) 'reserved) - (set! (-> *art-control* reserve-buffer) obj) ;; this buffer is reserved + (set! (-> this status) 'reserved) + (set! (-> *art-control* reserve-buffer) this) ;; this buffer is reserved ) ) ) ((and (!= (-> *level* loading-level) (-> *level* level-default)) - (< (meters 20) (-> obj load-file-priority)) + (< (meters 20) (-> this load-file-priority)) ) ;; unused cond ) - ((str-load (-> obj load-file) (-> obj load-file-part) (the pointer (align64 (-> obj heap current))) #x3fc00) ;; try to start load + ((str-load (-> this load-file) (-> this load-file-part) (the pointer (align64 (-> this heap current))) #x3fc00) ;; try to start load ;; load has started!! - (set! (-> obj status) 'loading) + (set! (-> this status) 'loading) ) ) ) (('loading) ;; loading... - (case (str-load-status (&-> obj len)) + (case (str-load-status (&-> this len)) (('error) ;; something went wrong. oh well. - (set! (-> obj status) 'error) + (set! (-> this status) 'error) ) (('busy) ;; loading. we have nothing to do. @@ -452,36 +453,36 @@ (else ;; done!! ;; not sure it is a good idea to assume that this is a success... - (set! (-> obj buf) (the pointer (align64 (-> obj heap current)))) - (set! (-> obj status) 'loaded) + (set! (-> this buf) (the pointer (align64 (-> this heap current)))) + (set! (-> this status) 'loaded) (goto cfg-18) ;; go back and check status again! ) ) ) (('loaded) ;; file is loaded. link it and see if we're good - (let ((a0-37 (-> obj buf))) - (set! (-> obj art-group) (the-as art-group (link (the-as pointer a0-37) (-> obj load-file data) (-> obj len) (-> obj heap) 0))) + (let ((a0-37 (-> this buf))) + (set! (-> this art-group) (the-as art-group (link (the-as pointer a0-37) (-> this load-file data) (-> this len) (-> this heap) 0))) ) - (let ((s4-0 (-> obj art-group)) - (s3-0 (-> obj load-file)) + (let ((s4-0 (-> this art-group)) + (s3-0 (-> this load-file)) ) (cond ((not s4-0) - (format 0 "ERROR: art-group ~A part ~D is not a valid file.~%" s3-0 (-> obj load-file-part)) - (set! (-> obj status) 'error) + (format 0 "ERROR: art-group ~A part ~D is not a valid file.~%" s3-0 (-> this load-file-part)) + (set! (-> this status) 'error) ) ((not (type-type? (-> s4-0 type) art-group)) - (format 0 "ERROR: art-group ~A part ~D is not a art-group.~%" s3-0 (-> obj load-file-part)) - (set! (-> obj status) 'error) + (format 0 "ERROR: art-group ~A part ~D is not a art-group.~%" s3-0 (-> this load-file-part)) + (set! (-> this status) 'error) ) ((not (file-info-correct-version? (-> s4-0 info) (file-kind art-group) 0)) - ;;(format 0 "ERROR: art-group ~A part ~D is the wrong version.~%" s3-0 (-> obj load-file-part)) - (set! (-> obj status) 'error) + ;;(format 0 "ERROR: art-group ~A part ~D is the wrong version.~%" s3-0 (-> this load-file-part)) + (set! (-> this status) 'error) ) (else (login s4-0) - (set! (-> obj status) 'locked) ;; make file ready to be used + (set! (-> this status) 'locked) ;; make file ready to be used ) ) ) @@ -489,11 +490,11 @@ (('locked) ;; this buffer is locked and needs to be unlocked before it can be used. ;; only one buffer can be active at a time. The other buffer is locked to prevent it from activating. - (when (and (not (-> obj locked?)) (handle->process (-> obj load-file-owner))) + (when (and (not (-> this locked?)) (handle->process (-> this load-file-owner))) ;; we want to be used, unlock this buffer and lock the other just in case. - (link-file obj (-> obj art-group)) - (set! (-> obj other locked?) #t) ;; prevent it from becoming active - (set! (-> obj status) 'active) + (link-file this (-> this art-group)) + (set! (-> this other locked?) #t) ;; prevent it from becoming active + (set! (-> this status) 'active) (goto cfg-18) ) ) @@ -501,43 +502,43 @@ ) (else ;; we want to get rid of the file! - (case (-> obj status) + (case (-> this status) (('initialize) ;; this was done earlier ) (('reserved) ;; this buffer is reserved (cond - ((= (-> *art-control* reserve-buffer) obj) ;; yep it's this one! + ((= (-> *art-control* reserve-buffer) this) ;; yep it's this one! (set! (-> *art-control* reserve-buffer) #f) - (set! (-> obj status) 'inactive) + (set! (-> this status) 'inactive) ) (else - (format 0 "ERROR: trying tro free ~A when ~A is reserved~%" obj (-> *art-control* reserve-buffer)) + (format 0 "ERROR: trying tro free ~A when ~A is reserved~%" this (-> *art-control* reserve-buffer)) ) ) ) (('active) ;; buffer is in use. not anymore! - (unlink-file obj (-> obj art-group)) - (let ((v1-70 (-> obj heap))) + (unlink-file this (-> this art-group)) + (let ((v1-70 (-> this heap))) (set! (-> v1-70 current) (-> v1-70 base)) ) - (set! (-> obj art-group) #f) - (set! (-> obj status) 'inactive) + (set! (-> this art-group) #f) + (set! (-> this status) 'inactive) ;; if the other is locked due to us, unlock it, then update it so it activates. - (when (-> obj other locked?) - (unlock! (-> obj other)) - (update (-> obj other)) + (when (-> this other locked?) + (unlock! (-> this other)) + (update (-> this other)) ) ) (else ;; some other scenario, just get rid of the whole thing. - (let ((v1-79 (-> obj heap))) + (let ((v1-79 (-> this heap))) (set! (-> v1-79 current) (-> v1-79 base)) ) - (set! (-> obj art-group) #f) - (set! (-> obj status) 'inactive) + (set! (-> this art-group) #f) + (set! (-> this status) 'inactive) ) ) ) @@ -550,55 +551,55 @@ ;; (some processes may want to wait for the stream to be preloaded, which won't happen with this disabled) (define *preload-spool-anims* #t) -(defmethod file-status external-art-control ((obj external-art-control) (name string) (part int)) +(defmethod file-status external-art-control ((this external-art-control) (name string) (part int)) "Get the status of a file in this art control. #f = file not found" (dotimes (i 2) - (awhen (file-status (-> obj buffer i) name part) + (awhen (file-status (-> this buffer i) name part) (return it) ) ) #f ) -(defmethod update external-art-control ((obj external-art-control) (debug-print symbol)) +(defmethod update external-art-control ((this external-art-control) (debug-print symbol)) "Update this external-art-control. This validates the spool buffers, sorts the spools and queues the highest priority one, and does some other things. If debug-print, also prints some text to the display console" ;; if somebody wants a reserve buffer, they will set this to 1. - (if (nonzero? (-> obj reserve-buffer-count)) - (spool-push obj "reserved" 0 *dproc* (if (-> obj reserve-buffer) + (if (nonzero? (-> this reserve-buffer-count)) + (spool-push this "reserved" 0 *dproc* (if (-> this reserve-buffer) -110.0 -0.5 ))) ;; frame-lock will get set to #t if something is assigned to this buffer in this update. (dotimes (v1-5 2) - (set! (-> obj buffer v1-5 frame-lock) #f) + (set! (-> this buffer v1-5 frame-lock) #f) ) ;; buffers assigned from this call to update (dotimes (v1-8 3) - (set! (-> obj rec v1-8 buf2) #f) + (set! (-> this rec v1-8 buf2) #f) ) ;; update existing buffers from their recs (dotimes (s4-0 2) - (let ((s3-0 (-> obj rec s4-0))) + (let ((s3-0 (-> this rec s4-0))) (when (-> s3-0 name) ;; iterate over the two buffers (dotimes (s2-0 2) - (when (and (file-status (-> obj buffer s2-0) (-> s3-0 name) (-> s3-0 parts)) ;; this buffer holds the file for the rec - (not (-> obj buffer s2-0 frame-lock))) ;; and nothing has frame-locked this buffer + (when (and (file-status (-> this buffer s2-0) (-> s3-0 name) (-> s3-0 parts)) ;; this buffer holds the file for the rec + (not (-> this buffer s2-0 frame-lock))) ;; and nothing has frame-locked this buffer ;; so we frame lock it to prevent it from being kicked out - (set! (-> obj buffer s2-0 frame-lock) #t) + (set! (-> this buffer s2-0 frame-lock) #t) ;; remember what buffer - (set! (-> s3-0 index) (the-as int (-> obj buffer s2-0))) + (set! (-> s3-0 index) (the-as int (-> this buffer s2-0))) ;; update owner and priority. - (set! (-> obj buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) - (set! (-> obj buffer s2-0 load-file-owner) (-> s3-0 owner)) - (set! (-> obj buffer s2-0 pending-load-file-priority) (-> s3-0 priority)) - (set! (-> obj buffer s2-0 load-file-priority) (-> s3-0 priority)) + (set! (-> this buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) + (set! (-> this buffer s2-0 load-file-owner) (-> s3-0 owner)) + (set! (-> this buffer s2-0 pending-load-file-priority) (-> s3-0 priority)) + (set! (-> this buffer s2-0 load-file-priority) (-> s3-0 priority)) (goto cfg-24) ) ) @@ -610,7 +611,7 @@ ;; preload recs ;; iterate over recs (dotimes (s4-1 2) - (let ((s3-1 (-> obj rec s4-1))) + (let ((s3-1 (-> this rec s4-1))) ;; rec wants to load something, but doesn't have a buffer already (when (and (-> s3-1 name) (not (-> s3-1 buf2))) ;; skip if we aren't preloading, or have a positive priority. @@ -621,11 +622,11 @@ ;; search for a buffer for preloading (dotimes (s2-1 2) ;; can't steal one that's already assigned - (when (not (-> obj buffer s2-1 frame-lock)) + (when (not (-> this buffer s2-1 frame-lock)) ;; do the assignment! - (set! (-> obj buffer s2-1 frame-lock) #t) - (set-pending-file (-> obj buffer s2-1) (-> s3-1 name) (-> s3-1 parts) (-> s3-1 owner) (-> s3-1 priority)) - (set! (-> s3-1 index) (the-as int (-> obj buffer s2-1))) + (set! (-> this buffer s2-1 frame-lock) #t) + (set-pending-file (-> this buffer s2-1) (-> s3-1 name) (-> s3-1 parts) (-> s3-1 owner) (-> s3-1 priority)) + (set! (-> s3-1 index) (the-as int (-> this buffer s2-1))) (goto cfg-46) ) ) @@ -635,8 +636,8 @@ ) ;; this part is a bit confusing, but I think it basically kicks out the lowest priority thing. - (when (not (-> obj reserve-buffer)) - (let ((s4-2 (-> obj rec 0 buf2))) ;; top priority buffer + (when (not (-> this reserve-buffer)) + (let ((s4-2 (-> this rec 0 buf2))) ;; top priority buffer (if (and s4-2 (-> s4-2 locked?) (not (string= (-> s4-2 pending-load-file) "reserved")) @@ -649,74 +650,74 @@ ;; update the buffers (dotimes (s4-3 2) - (update (-> obj buffer s4-3)) + (update (-> this buffer s4-3)) ) ;; sort spool anims. (let ((s4-4 (the-as spool-anim #f))) (countdown (s3-2 3) - (if (and (-> obj rec s3-2 name) (not (name= (-> obj rec s3-2 name) (-> obj active-stream)))) - (set! s4-4 (the-as spool-anim (-> obj rec))) + (if (and (-> this rec s3-2 name) (not (name= (-> this rec s3-2 name) (-> this active-stream)))) + (set! s4-4 (the-as spool-anim (-> this rec))) ) ) - (if (and (-> obj preload-stream name) (or (not s4-4) (< (-> obj preload-stream priority) (-> s4-4 priority)))) - (set! s4-4 (-> obj preload-stream)) + (if (and (-> this preload-stream name) (or (not s4-4) (< (-> this preload-stream priority) (-> s4-4 priority)))) + (set! s4-4 (-> this preload-stream)) ) (cond (s4-4 - (mem-copy! (&-> (-> obj last-preload-stream) type) (&-> s4-4 type) 44) + (mem-copy! (&-> (-> this last-preload-stream) type) (&-> s4-4 type) 44) (str-play-queue (-> s4-4 name)) ) (else - (set! (-> obj last-preload-stream name) #f) - (set! (-> obj last-preload-stream owner) (the-as handle #f)) + (set! (-> this last-preload-stream name) #f) + (set! (-> this last-preload-stream owner) (the-as handle #f)) ) ) ) (when (and debug-print *display-art-control*) (dotimes (s5-1 3) - (format *stdcon* "rec ~d ~S ~D ~f ~A~%" s5-1 (-> obj rec s5-1 name) (-> obj rec s5-1 parts) (-> obj rec s5-1 priority) (handle->name (-> obj rec s5-1 owner))) + (format *stdcon* "rec ~d ~S ~D ~f ~A~%" s5-1 (-> this rec s5-1 name) (-> this rec s5-1 parts) (-> this rec s5-1 priority) (handle->name (-> this rec s5-1 owner))) ) (dotimes (s5-2 2) - (format *stdcon* "buf ~d ~C ~S ~D ~A ~A~%" s5-2 (if (-> obj buffer s5-2 locked?) #\l #\\s) (-> obj buffer s5-2 pending-load-file) (-> obj buffer s5-2 pending-load-file-part) (-> obj buffer s5-2 status) (handle->name (-> obj buffer s5-2 pending-load-file-owner))) + (format *stdcon* "buf ~d ~C ~S ~D ~A ~A~%" s5-2 (if (-> this buffer s5-2 locked?) #\l #\\s) (-> this buffer s5-2 pending-load-file) (-> this buffer s5-2 pending-load-file-part) (-> this buffer s5-2 status) (handle->name (-> this buffer s5-2 pending-load-file-owner))) ) - (format *stdcon* " a: ~S~%" (-> obj active-stream)) - (format *stdcon* " p: ~S ~A~%" (-> obj preload-stream name) (handle->name (-> obj preload-stream owner))) - (format *stdcon* " q: ~S ~A~%" (-> obj last-preload-stream name) (handle->name (-> obj last-preload-stream owner))) + (format *stdcon* " a: ~S~%" (-> this active-stream)) + (format *stdcon* " p: ~S ~A~%" (-> this preload-stream name) (handle->name (-> this preload-stream owner))) + (format *stdcon* " q: ~S ~A~%" (-> this last-preload-stream name) (handle->name (-> this last-preload-stream owner))) ) 0 ) -(defmethod none-reserved? external-art-control ((obj external-art-control)) +(defmethod none-reserved? external-art-control ((this external-art-control)) "are there any reserved buffers?" (declare (inline)) - (zero? (-> obj reserve-buffer-count)) + (zero? (-> this reserve-buffer-count)) ) -(defmethod reserve-alloc external-art-control ((obj external-art-control)) +(defmethod reserve-alloc external-art-control ((this external-art-control)) "Reserve a buffer!" - (set! (-> obj reserve-buffer-count) 1) - (if (-> obj reserve-buffer) - (-> obj reserve-buffer heap) + (set! (-> this reserve-buffer-count) 1) + (if (-> this reserve-buffer) + (-> this reserve-buffer heap) ) ) -(defmethod reserve-free external-art-control ((obj external-art-control) (arg0 kheap)) +(defmethod reserve-free external-art-control ((this external-art-control) (arg0 kheap)) "Free the reserved buffer!" (cond - ((none-reserved? obj) + ((none-reserved? this) (format 0 "ERROR: illegal attempt to free a buffer #x~X which had not been reserved (none reserved).~%" arg0) ) - ((not (-> obj reserve-buffer)) - (set! (-> obj reserve-buffer-count) 0) + ((not (-> this reserve-buffer)) + (set! (-> this reserve-buffer-count) 0) ) - ((= (-> obj reserve-buffer heap) arg0) - (set-pending-file (-> obj reserve-buffer) (the-as string #f) -1 (the-as handle #f) SPOOL_PRIORITY_LOWEST) - (update (-> obj reserve-buffer)) - (set! (-> obj reserve-buffer-count) 0) + ((= (-> this reserve-buffer heap) arg0) + (set-pending-file (-> this reserve-buffer) (the-as string #f) -1 (the-as handle #f) SPOOL_PRIORITY_LOWEST) + (update (-> this reserve-buffer)) + (set! (-> this reserve-buffer-count) 0) ) (else (format 0 "ERROR: illegal attempt to free a buffer #x~X which had not been reserved (buffer unknown).~%" arg0) @@ -725,40 +726,40 @@ 0 ) -(defmethod clear-rec external-art-control ((obj external-art-control)) +(defmethod clear-rec external-art-control ((this external-art-control)) "Clears the recent spool anims from the art control." (cond ((!= *master-mode* 'game) (dotimes (s5-0 3) - (when (name= (-> obj rec s5-0 name) "reserved") + (when (name= (-> this rec s5-0 name) "reserved") (case s5-0 ((0) - (mem-copy! (&-> obj rec 0 type) (&-> obj rec 1 type) (size-of spool-anim)) - (mem-copy! (&-> obj rec 1 type) (&-> obj rec 2 type) (size-of spool-anim)) + (mem-copy! (&-> this rec 0 type) (&-> this rec 1 type) (size-of spool-anim)) + (mem-copy! (&-> this rec 1 type) (&-> this rec 2 type) (size-of spool-anim)) ) ((1) - (mem-copy! (&-> obj rec 1 type) (&-> obj rec 2 type) (size-of spool-anim)) + (mem-copy! (&-> this rec 1 type) (&-> this rec 2 type) (size-of spool-anim)) ) ) - (set! (-> obj rec 2 type) spool-anim) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 priority) SPOOL_PRIORITY_LOWEST) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (set! (-> this rec 2 type) spool-anim) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this rec 2 owner) (the-as handle #f)) ) ) ) (else (dotimes (v1-19 3) - (set! (-> obj rec v1-19 type) spool-anim) - (set! (-> obj rec v1-19 name) #f) - (set! (-> obj rec v1-19 priority) SPOOL_PRIORITY_LOWEST) - (set! (-> obj rec v1-19 owner) (the-as handle #f)) + (set! (-> this rec v1-19 type) spool-anim) + (set! (-> this rec v1-19 name) #f) + (set! (-> this rec v1-19 priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this rec v1-19 owner) (the-as handle #f)) ) - (set! (-> obj preload-stream type) spool-anim) - (set! (-> obj preload-stream name) #f) - (set! (-> obj preload-stream priority) SPOOL_PRIORITY_LOWEST) - (set! (-> obj preload-stream owner) (the-as handle #f)) + (set! (-> this preload-stream type) spool-anim) + (set! (-> this preload-stream name) #f) + (set! (-> this preload-stream priority) SPOOL_PRIORITY_LOWEST) + (set! (-> this preload-stream owner) (the-as handle #f)) ) ) 0 @@ -775,83 +776,83 @@ ) ) -(defmethod try-preload-stream external-art-control ((obj external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) +(defmethod try-preload-stream external-art-control ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) "Set a new stream to be preloaded, if appropriate." (spool-calc-priority arg3 arg2) - (unless (and (-> obj preload-stream name) - (>= arg3 (-> obj preload-stream priority)) + (unless (and (-> this preload-stream name) + (>= arg3 (-> this preload-stream priority)) ) - (set! (-> obj preload-stream name) arg0) - (set! (-> obj preload-stream parts) arg1) - (set! (-> obj preload-stream priority) arg3) - (set! (-> obj preload-stream owner) (process->handle arg2)) + (set! (-> this preload-stream name) arg0) + (set! (-> this preload-stream parts) arg1) + (set! (-> this preload-stream priority) arg3) + (set! (-> this preload-stream owner) (process->handle arg2)) ) 0 ) -(defmethod spool-push external-art-control ((obj external-art-control) (name string) (part int) (proc process) (priority float)) +(defmethod spool-push external-art-control ((this external-art-control) (name string) (part int) (proc process) (priority float)) "Push a spool-anim to the spool array. There are only space for three, and only the three highest priority spool anims will be kept. (lowest priority = top)" (spool-calc-priority priority proc) ;; if this spool-anim already exists, pop it from the rec list (cond - ((and (= part (-> obj rec 0 parts)) (name= name (-> obj rec 0 name))) - (if (>= priority (-> obj rec 0 priority)) + ((and (= part (-> this rec 0 parts)) (name= name (-> this rec 0 name))) + (if (>= priority (-> this rec 0 priority)) (return (the-as int #f)) ) ;; first spool. copy 1st <- 2nd and 2nd <- 3rd, 3rd will be wiped - (mem-copy! (&-> obj rec 0 type) (&-> obj rec 1 type) (size-of spool-anim)) - (mem-copy! (&-> obj rec 1 type) (&-> obj rec 2 type) (size-of spool-anim)) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (mem-copy! (&-> this rec 0 type) (&-> this rec 1 type) (size-of spool-anim)) + (mem-copy! (&-> this rec 1 type) (&-> this rec 2 type) (size-of spool-anim)) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) - ((and (= part (-> obj rec 1 parts)) (name= name (-> obj rec 1 name))) - (if (>= priority (-> obj rec 1 priority)) + ((and (= part (-> this rec 1 parts)) (name= name (-> this rec 1 name))) + (if (>= priority (-> this rec 1 priority)) (return (the-as int #f)) ) ;; second spool. copy 2nd <- 3rd, 3rd will be wiped - (mem-copy! (&-> obj rec 1 type) (&-> obj rec 2 type) (size-of spool-anim)) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (mem-copy! (&-> this rec 1 type) (&-> this rec 2 type) (size-of spool-anim)) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) - ((and (= part (-> obj rec 2 parts)) (name= name (-> obj rec 2 name))) - (if (>= priority (-> obj rec 2 priority)) + ((and (= part (-> this rec 2 parts)) (name= name (-> this rec 2 name))) + (if (>= priority (-> this rec 2 priority)) (return (the-as int #f)) ) ;; third spool. 3rd will be wiped - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) ) ;; if it's top 3 priority, push this spool-anim to the rec list (cond - ((< priority (-> obj rec 0 priority)) + ((< priority (-> this rec 0 priority)) ;; 1st place! - (mem-copy! (&-> obj rec 2 type) (&-> obj rec 1 type) (size-of spool-anim)) - (mem-copy! (&-> obj rec 1 type) (&-> obj rec 0 type) (size-of spool-anim)) - (set! (-> obj rec 0 name) name) - (set! (-> obj rec 0 parts) part) - (set! (-> obj rec 0 priority) priority) - (set! (-> obj rec 0 owner) (process->handle proc)) + (mem-copy! (&-> this rec 2 type) (&-> this rec 1 type) (size-of spool-anim)) + (mem-copy! (&-> this rec 1 type) (&-> this rec 0 type) (size-of spool-anim)) + (set! (-> this rec 0 name) name) + (set! (-> this rec 0 parts) part) + (set! (-> this rec 0 priority) priority) + (set! (-> this rec 0 owner) (process->handle proc)) ) - ((< priority (-> obj rec 1 priority)) + ((< priority (-> this rec 1 priority)) ;; 2nd place. - (mem-copy! (&-> obj rec 2 type) (&-> obj rec 1 type) (size-of spool-anim)) - (set! (-> obj rec 1 name) name) - (set! (-> obj rec 1 parts) part) - (set! (-> obj rec 1 priority) priority) - (set! (-> obj rec 1 owner) (process->handle proc)) + (mem-copy! (&-> this rec 2 type) (&-> this rec 1 type) (size-of spool-anim)) + (set! (-> this rec 1 name) name) + (set! (-> this rec 1 parts) part) + (set! (-> this rec 1 priority) priority) + (set! (-> this rec 1 owner) (process->handle proc)) ) - ((< priority (-> obj rec 2 priority)) + ((< priority (-> this rec 2 priority)) ;; 3rd place... - (set! (-> obj rec 2 name) name) - (set! (-> obj rec 2 parts) part) - (set! (-> obj rec 2 priority) priority) - (set! (-> obj rec 2 owner) (process->handle proc)) + (set! (-> this rec 2 name) name) + (set! (-> this rec 2 parts) part) + (set! (-> this rec 2 priority) priority) + (set! (-> this rec 2 owner) (process->handle proc)) ) ) 0 diff --git a/goal_src/jak1/engine/load/ramdisk.gc b/goal_src/jak1/engine/load/ramdisk.gc index 076274b428..67eeaff5a9 100644 --- a/goal_src/jak1/engine/load/ramdisk.gc +++ b/goal_src/jak1/engine/load/ramdisk.gc @@ -11,6 +11,8 @@ (defconstant RAMDISK_RPC_FILL_FNO (the uint 1)) +;; DECOMP BEGINS + ;; command to load something into the OVERLORD RAMDISK from the DVD ;; use with fno = 1 (deftype ramdisk-rpc-fill (structure) diff --git a/goal_src/jak1/engine/math/euler-h.gc b/goal_src/jak1/engine/math/euler-h.gc index eb3fa934d0..b8f98af06c 100644 --- a/goal_src/jak1/engine/math/euler-h.gc +++ b/goal_src/jak1/engine/math/euler-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: euler-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; maybe euler angle storage orders? (define EulSafe (new 'static 'boxed-array :type int32 :length 4 0 1 2 0)) diff --git a/goal_src/jak1/engine/math/math.gc b/goal_src/jak1/engine/math/math.gc index 718e46c1a0..5a036be618 100644 --- a/goal_src/jak1/engine/math/math.gc +++ b/goal_src/jak1/engine/math/math.gc @@ -7,6 +7,8 @@ ;; various math helpers +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; float utility ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/goal_src/jak1/engine/math/matrix-h.gc b/goal_src/jak1/engine/math/matrix-h.gc index 8f5e261015..cf8ba5b01b 100644 --- a/goal_src/jak1/engine/math/matrix-h.gc +++ b/goal_src/jak1/engine/math/matrix-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: matrix-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; A 4x4 matrix, stored in row-major order ;; some, but not all, functions assume that a matrix is an affine transform. ;; others assume that the rotation has no scale or shear (and that its inverse is its transpose) diff --git a/goal_src/jak1/engine/math/matrix.gc b/goal_src/jak1/engine/math/matrix.gc index d78af302fe..2f602e5e4c 100644 --- a/goal_src/jak1/engine/math/matrix.gc +++ b/goal_src/jak1/engine/math/matrix.gc @@ -32,55 +32,57 @@ ;; requirements for the form of the input matrix or if the input/output matrix are ;; allowed to be the same memory. -(defmethod inspect matrix ((obj matrix)) +;; DECOMP BEGINS + +(defmethod inspect matrix ((this matrix)) "Print out all the values in a matrix." - (format #t "[~8x] matrix~%" obj) + (format #t "[~8x] matrix~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj data 0) - (-> obj data 1) - (-> obj data 2) - (-> obj data 3) + (-> this data 0) + (-> this data 1) + (-> this data 2) + (-> this data 3) ) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj data 4) - (-> obj data 5) - (-> obj data 6) - (-> obj data 7) + (-> this data 4) + (-> this data 5) + (-> this data 6) + (-> this data 7) ) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj data 8) - (-> obj data 9) - (-> obj data 10) - (-> obj data 11) + (-> this data 8) + (-> this data 9) + (-> this data 10) + (-> this data 11) ) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj data 12) - (-> obj data 13) - (-> obj data 14) - (-> obj data 15) + (-> this data 12) + (-> this data 13) + (-> this data 14) + (-> this data 15) ) - obj + this ) -(defmethod inspect matrix3 ((obj matrix3)) +(defmethod inspect matrix3 ((this matrix3)) "Print out the values in a 3x3 matrix." - (format #t "[~8x] matrix3~%" obj) + (format #t "[~8x] matrix3~%" this) (format #t "~T[~F] [~F] [~F]~%" - (-> obj data 0) - (-> obj data 1) - (-> obj data 2) + (-> this data 0) + (-> this data 1) + (-> this data 2) ) (format #t "~T[~F] [~F] [~F]~%" - (-> obj data 4) - (-> obj data 5) - (-> obj data 6) + (-> this data 4) + (-> this data 5) + (-> this data 6) ) (format #t "~T[~F] [~F] [~F]~%" - (-> obj data 8) - (-> obj data 9) - (-> obj data 10) + (-> this data 8) + (-> this data 9) + (-> this data 10) ) - obj + this ) (defun matrix-identity! ((dst matrix)) @@ -1664,7 +1666,7 @@ ) -(defmethod transform-vectors! matrix ((obj _type_) (dst (inline-array vector)) (src (inline-array vector)) (count int)) +(defmethod transform-vectors! matrix ((this _type_) (dst (inline-array vector)) (src (inline-array vector)) (count int)) "Transform many vectors. This acts like w = 1, even if it isn't. The value of w is copied." (rlet ((vf0 :class vf) (vf1 :class vf) @@ -1684,16 +1686,16 @@ (when-goto (<= count 0) end) ;; lqc2 vf1, 0(a0) - (.lvf vf1 (-> obj vector 0)) + (.lvf vf1 (-> this vector 0)) ;; lqc2 vf2, 16(a0) - (.lvf vf2 (-> obj vector 1)) + (.lvf vf2 (-> this vector 1)) ;; lqc2 vf3, 32(a0) - (.lvf vf3 (-> obj vector 2)) + (.lvf vf3 (-> this vector 2)) ;; lqc2 vf4, 48(a0) - (.lvf vf4 (-> obj vector 3)) + (.lvf vf4 (-> this vector 3)) ;; lqc2 vf5, 0(a2) (.lvf vf5 (-> src 0)) diff --git a/goal_src/jak1/engine/math/quaternion-h.gc b/goal_src/jak1/engine/math/quaternion-h.gc index 1bacda3157..11ee8d8ec1 100644 --- a/goal_src/jak1/engine/math/quaternion-h.gc +++ b/goal_src/jak1/engine/math/quaternion-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: quaternion-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; general quaternion type used to represent an orientation in a way that's compact (4 floats), ;; avoids singularities of euler angles, and reasonably efficient to transform. ;; the w component is stored last. diff --git a/goal_src/jak1/engine/math/quaternion.gc b/goal_src/jak1/engine/math/quaternion.gc index 6173104d9c..819d6f0980 100644 --- a/goal_src/jak1/engine/math/quaternion.gc +++ b/goal_src/jak1/engine/math/quaternion.gc @@ -5,34 +5,36 @@ ;; name in dgo: quaternion ;; dgos: GAME, ENGINE -(defmethod inspect quaternion ((obj quaternion)) +;; DECOMP BEGINS + +(defmethod inspect quaternion ((this quaternion)) "Print a quaternion. Prints the values and axis-angle" - (format #t "[~8x] quaternion~%" obj) + (format #t "[~8x] quaternion~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj x) - (-> obj y) - (-> obj z) - (-> obj w) + (-> this x) + (-> this y) + (-> this z) + (-> this w) ) (let ((f0-5 (/ 1.0 (sqrtf - (+ (* (-> obj x) (-> obj x)) - (* (-> obj y) (-> obj y)) - (* (-> obj z) (-> obj z)) + (+ (* (-> this x) (-> this x)) + (* (-> this y) (-> this y)) + (* (-> this z) (-> this z)) ) ) ) ) ) (format #t "~Taxis: ~F ~F ~F" - (* f0-5 (-> obj x)) - (* f0-5 (-> obj y)) - (* f0-5 (-> obj z)) + (* f0-5 (-> this x)) + (* f0-5 (-> this y)) + (* f0-5 (-> this z)) ) ) - (let ((f0-9 (* 2.0 (acos (-> obj w))))) + (let ((f0-9 (* 2.0 (acos (-> this w))))) (format #t "~T~Tangle: (deg ~R)~%" f0-9) ) - obj + this ) (defun quaternion-axis-angle! ((quat quaternion) (x float) (y float) (z float) (angle float)) diff --git a/goal_src/jak1/engine/math/transform-h.gc b/goal_src/jak1/engine/math/transform-h.gc index 01fc49be3c..8d1a03b9cc 100644 --- a/goal_src/jak1/engine/math/transform-h.gc +++ b/goal_src/jak1/engine/math/transform-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: transform-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; Transformation. w components of vectors should be 1.0 ;; This can represent any rotation, translation, and scaling. ;; Note that the scaling is applied before rotation (meaning it scales along the axes of the pre-transformed frame). diff --git a/goal_src/jak1/engine/math/transform.gc b/goal_src/jak1/engine/math/transform.gc index cfedc47f64..13c40d9750 100644 --- a/goal_src/jak1/engine/math/transform.gc +++ b/goal_src/jak1/engine/math/transform.gc @@ -7,36 +7,38 @@ ;; note: transformq and trsq is mostly used instead of transform. -(defmethod print transform ((obj transform)) - (format #t "# obj trans data 0) - (-> obj trans data 1) - (-> obj trans data 2) - (-> obj trans data 3) + (-> this trans data 0) + (-> this trans data 1) + (-> this trans data 2) + (-> this trans data 3) ) (format #t "~T~Trot: ~F ~F ~F ~F ~%" - (-> obj rot data 0) - (-> obj rot data 1) - (-> obj rot data 2) - (-> obj rot data 3) + (-> this rot data 0) + (-> this rot data 1) + (-> this rot data 2) + (-> this rot data 3) ) (format #t "~T~Tscale:~F ~F ~F ~F>" - (-> obj scale data 0) - (-> obj scale data 1) - (-> obj scale data 2) - (-> obj scale data 3) + (-> this scale data 0) + (-> this scale data 1) + (-> this scale data 2) + (-> this scale data 3) ) - obj + this ) (defmethod new trs ((allocation symbol) (type-to-make type)) "Create a new trs and set it equal to identity." - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj trans data 3) 1.0) - (set! (-> obj rot data 3) 1.0) - (vector-identity! (-> obj scale)) - obj + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this trans data 3) 1.0) + (set! (-> this rot data 3) 1.0) + (vector-identity! (-> this scale)) + this ) ) diff --git a/goal_src/jak1/engine/math/transformq-h.gc b/goal_src/jak1/engine/math/transformq-h.gc index 2c4c49d0b5..c18f541dad 100644 --- a/goal_src/jak1/engine/math/transformq-h.gc +++ b/goal_src/jak1/engine/math/transformq-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: transformq-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; the transformq is a transform, but _replaces_ the rotation field with a quaternion. ;; it is much more commonly used than transform. (deftype transformq (transform) @@ -74,15 +76,15 @@ ) ) -(defmethod global-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) +(defmethod global-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) "Get the angle in the xz plane from the position of this trsqv to the point arg0." - (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans))) + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) ) -(defmethod relative-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) +(defmethod relative-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) "Get the y angle between the current orientation and arg0." (deg-diff - (y-angle obj) - (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans))) + (y-angle this) + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) ) ) diff --git a/goal_src/jak1/engine/math/transformq.gc b/goal_src/jak1/engine/math/transformq.gc index 6abb18ef14..c7acc6c02e 100644 --- a/goal_src/jak1/engine/math/transformq.gc +++ b/goal_src/jak1/engine/math/transformq.gc @@ -5,56 +5,58 @@ ;; name in dgo: transformq ;; dgos: GAME, ENGINE -(defmethod print transformq ((obj transformq)) +;; DECOMP BEGINS + +(defmethod print transformq ((this transformq)) "Print a transformq" - (format #t "# obj trans x) - (-> obj trans y) - (-> obj trans z) - (-> obj trans w) + (-> this trans x) + (-> this trans y) + (-> this trans z) + (-> this trans w) ) (format #t "~T~Tquat: ~F ~F ~F ~F ~%" - (-> obj rot x) - (-> obj rot y) - (-> obj rot z) - (-> obj rot w) + (-> this rot x) + (-> this rot y) + (-> this rot z) + (-> this rot w) ) (format #t "~T~Tscale:~F ~F ~F ~F>" - (-> obj scale x) - (-> obj scale y) - (-> obj scale z) - (-> obj scale w) + (-> this scale x) + (-> this scale y) + (-> this scale z) + (-> this scale w) ) - obj + this ) -(defmethod get-quaternion trsqv ((obj trsqv)) +(defmethod get-quaternion trsqv ((this trsqv)) "Get the rotation as a quaternion." - (-> obj quat) + (-> this quat) ) -(defmethod set-quaternion! trsqv ((obj trsqv) (arg0 quaternion)) +(defmethod set-quaternion! trsqv ((this trsqv) (arg0 quaternion)) "Set the rotation as a quaternion" - (quaternion-copy! (get-quaternion obj) arg0) + (quaternion-copy! (get-quaternion this) arg0) ) -(defmethod rot->dir-targ! trsqv ((obj trsqv)) +(defmethod rot->dir-targ! trsqv ((this trsqv)) "Set the dir-targ to our current orientation" - (quaternion-copy! (-> obj dir-targ) (get-quaternion obj)) + (quaternion-copy! (-> this dir-targ) (get-quaternion this)) ) -(defmethod y-angle trsqv ((obj trsqv)) +(defmethod y-angle trsqv ((this trsqv)) "Get our current y-angle (y is up, so yaw)" - (quaternion-y-angle (get-quaternion obj)) + (quaternion-y-angle (get-quaternion this)) ) -(defmethod seek-toward-heading-vec! trsqv ((obj trsqv) (dir vector) (vel float) (frame-count time-frame)) +(defmethod seek-toward-heading-vec! trsqv ((this trsqv) (dir vector) (vel float) (frame-count time-frame)) "Adjust the orientation to point along dir, only changing our yaw. The vel is a maximum velocity limit. The frame count is the time constant (first order). There's some logic to avoid rapidly changing directions" - (let* ((yaw-error (deg-diff (quaternion-y-angle (-> obj quat)) (vector-y-angle dir))) + (let* ((yaw-error (deg-diff (quaternion-y-angle (-> this quat)) (vector-y-angle dir))) ;; limit both on a max velocity, and a proportional to error term. (yaw-limit (fmin (* vel (-> *display* seconds-per-frame)) (/ (* 5.0 (fabs yaw-error)) (the float frame-count)) @@ -63,7 +65,7 @@ ;; saturate the yaw error (saturated-yaw (fmax (fmin yaw-error yaw-limit) (- yaw-limit))) ) - (let ((old-diff (-> obj old-y-angle-diff))) + (let ((old-diff (-> this old-y-angle-diff))) (set! saturated-yaw (cond ;; I have no idea what this crazy thing is. @@ -72,13 +74,13 @@ (and (< 0.0 saturated-yaw) (< 0.0 old-diff)) (or (and (< saturated-yaw 0.0) (< old-diff 0.0)) (>= (- (-> *display* base-frame-counter) - (-> obj angle-change-time) + (-> this angle-change-time) ) 60 ) ) ) - (set! (-> obj angle-change-time) (-> *display* base-frame-counter)) + (set! (-> this angle-change-time) (-> *display* base-frame-counter)) saturated-yaw ) (else @@ -88,16 +90,16 @@ ) ) ) - (set! (-> obj old-y-angle-diff) saturated-yaw) - (let ((quat (get-quaternion obj))) + (set! (-> this old-y-angle-diff) saturated-yaw) + (let ((quat (get-quaternion this))) (quaternion-rotate-y! quat quat saturated-yaw) ) ) ) -(defmethod set-heading-vec! trsqv ((obj trsqv) (arg0 vector)) +(defmethod set-heading-vec! trsqv ((this trsqv) (arg0 vector)) "Makes us look in the arg0 direction immediately. Pitch will be unchanged." - (let ((s3-0 (get-quaternion obj))) + (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) ;; forward is the given dir. @@ -106,32 +108,32 @@ ) ) -(defmethod seek-to-point-toward-point! trsqv ((obj trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) +(defmethod seek-to-point-toward-point! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) "Seek toward pointing toward arg0 from our current location." (seek-toward-heading-vec! - obj - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) + this + (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) arg1 arg2 ) ) -(defmethod point-toward-point! trsqv ((obj trsqv) (arg0 vector)) +(defmethod point-toward-point! trsqv ((this trsqv) (arg0 vector)) "Immediately point toward arg0" - (let ((s3-0 (get-quaternion obj))) + (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0) ) ) ) -(defmethod seek-toward-yaw-angle! trsqv ((obj trsqv) (yaw float) (vel float) (frame-count time-frame)) +(defmethod seek-toward-yaw-angle! trsqv ((this trsqv) (yaw float) (vel float) (frame-count time-frame)) "Seek toward the given yaw angle." (seek-toward-heading-vec! - obj + this ;; make a vector that points toward +z (forward) rotated by the yaw. (set-vector! (new 'stack-no-clear 'vector) (sin yaw) 0.0 (cos yaw) 1.0) vel @@ -139,22 +141,22 @@ ) ) -(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((obj trsqv) (yaw float)) +(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((this trsqv) (yaw float)) "Immediately clear our roll and pitch and set yaw to the given angle" (set-heading-vec-clear-roll-pitch! - obj + this (set-vector! (new 'stack-no-clear 'vector) (sin yaw) 0.0 (cos yaw) 1.0) ) ) -(defmethod set-roll-to-grav! trsqv ((obj trsqv) (arg0 float)) +(defmethod set-roll-to-grav! trsqv ((this trsqv) (arg0 float)) "Set our roll so that our local down aligns with standard gravity" - (set-roll-to-grav-2! obj arg0) + (set-roll-to-grav-2! this arg0) ) -(defmethod set-roll-to-grav-2! trsqv ((obj trsqv) (arg0 float)) +(defmethod set-roll-to-grav-2! trsqv ((this trsqv) (arg0 float)) "Set our roll so that our local down aligns with standard gravity" - (let* ((quat (get-quaternion obj)) ;; our orientation + (let* ((quat (get-quaternion this)) ;; our orientation (grav (-> *standard-dynamics* gravity-normal)) ;; dir of gravity (rot-mat (quaternion->matrix (new 'stack-no-clear 'matrix) quat)) ;; our orientation ) @@ -180,9 +182,9 @@ ) ) -(defmethod roll-relative-to-gravity trsqv ((obj trsqv)) +(defmethod roll-relative-to-gravity trsqv ((this trsqv)) "Get our roll, relative to 'down' from gravity" - (let* ((quat (get-quaternion obj)) + (let* ((quat (get-quaternion this)) (dir-z (vector-z-quaternion! (new 'stack-no-clear 'vector) quat)) (dir-y (vector-y-quaternion! (new 'stack-no-clear 'vector) quat)) (dir-grav (-> *standard-dynamics* gravity-normal)) @@ -208,7 +210,7 @@ ) -(defmethod rotate-toward-orientation! trsqv ((obj trsqv) (target quaternion) (y-rate float) (z-rate float)) +(defmethod rotate-toward-orientation! trsqv ((this trsqv) (target quaternion) (y-rate float) (z-rate float)) "Adjust our orientation toward target, subject to some rate limits. I don't think this is a very robust function and probably doesn't work right in cases where an axis flips by 180 degrees." @@ -218,7 +220,7 @@ ;; out z axis. These are both rate limited. (local-vars (sv-96 vector)) - (let ((quat (get-quaternion obj))) + (let ((quat (get-quaternion this))) (let ((temp-quat (new 'stack-no-clear 'quaternion))) (when (< 0.0 z-rate) (let ((s1-0 quaternion-from-two-vectors-max-angle!) @@ -247,21 +249,21 @@ ) ) -(defmethod set-heading-vec-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector)) +(defmethod set-heading-vec-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) "Set our rotation to point along the given heading, with no roll or pitch." (forward-up->quaternion - (get-quaternion obj) + (get-quaternion this) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) (new 'static 'vector :y 1.0 :w 1.0) ) ) -(defmethod point-toward-point-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector)) +(defmethod point-toward-point-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) "Set our orientation to point toward arg0, clearing roll and pitch" (forward-up->quaternion - (get-quaternion obj) + (get-quaternion this) (vector-normalize! - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) + (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0 ) (new 'static 'vector :y 1.0 :w 1.0) diff --git a/goal_src/jak1/engine/math/vector-h.gc b/goal_src/jak1/engine/math/vector-h.gc index 7e7a7f8c80..70529fd7b4 100644 --- a/goal_src/jak1/engine/math/vector-h.gc +++ b/goal_src/jak1/engine/math/vector-h.gc @@ -8,6 +8,8 @@ ;; Type definitions/inline functions for bit array and vector types. +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bit array ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -38,61 +40,61 @@ (defmethod new bit-array ((allocation symbol) (type-to-make type) (length int)) "Allocate a new bit-array which can hold length bits. Sets both the length and the allocated-length to this length." - (let ((obj (object-new allocation type-to-make + (let ((this (object-new allocation type-to-make (+ (+ (/ (logand -8 (+ length 7)) 8) -1) (the-as int (-> type-to-make size)) ) ) ) ) - (set! (-> obj length) length) - (set! (-> obj allocated-length) length) - obj + (set! (-> this length) length) + (set! (-> this allocated-length) length) + this ) ) -(defmethod length bit-array ((obj bit-array)) +(defmethod length bit-array ((this bit-array)) "Get the length (in bits)" - (-> obj length) + (-> this length) ) -(defmethod asize-of bit-array ((obj bit-array)) +(defmethod asize-of bit-array ((this bit-array)) "Get the size in memory. It is wrong and says its one byte longer, which is safe." (the-as int - (+ (-> obj type size) - (the-as uint (/ (logand -8 (+ (-> obj allocated-length) 7)) 8)) + (+ (-> this type size) + (the-as uint (/ (logand -8 (+ (-> this allocated-length) 7)) 8)) ) ) ) -(defmethod get-bit bit-array ((obj bit-array) (idx int)) +(defmethod get-bit bit-array ((this bit-array) (idx int)) "Is the bit at idx set or not?" - (let ((v1-2 (-> obj bytes (/ idx 8)))) + (let ((v1-2 (-> this bytes (/ idx 8)))) (logtest? v1-2 (ash 1 (logand idx 7))) ) ) -(defmethod clear-bit bit-array ((obj bit-array) (idx int)) +(defmethod clear-bit bit-array ((this bit-array) (idx int)) "Clear the bit at position idx" - (logclear! (-> obj bytes (/ idx 8)) (ash 1 (logand idx 7))) + (logclear! (-> this bytes (/ idx 8)) (ash 1 (logand idx 7))) 0 ) -(defmethod set-bit bit-array ((obj bit-array) (idx int)) +(defmethod set-bit bit-array ((this bit-array) (idx int)) "Set the bit at position idx" - (logior! (-> obj bytes (/ idx 8)) (the-as uint (ash 1 (logand idx 7)))) + (logior! (-> this bytes (/ idx 8)) (the-as uint (ash 1 (logand idx 7)))) 0 ) -(defmethod clear-all! bit-array ((obj bit-array)) +(defmethod clear-all! bit-array ((this bit-array)) "Set all bits to zero." - (countdown (idx (/ (logand -8 (+ (-> obj allocated-length) 7)) 8)) + (countdown (idx (/ (logand -8 (+ (-> this allocated-length) 7)) 8)) (nop!) (nop!) - (set! (-> obj bytes idx) (the-as uint 0)) + (set! (-> this bytes idx) (the-as uint 0)) ) - obj + this ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/goal_src/jak1/engine/math/vector.gc b/goal_src/jak1/engine/math/vector.gc index 751092106e..f27fd1edda 100644 --- a/goal_src/jak1/engine/math/vector.gc +++ b/goal_src/jak1/engine/math/vector.gc @@ -5,6 +5,8 @@ ;; name in dgo: vector ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (defun vector-cross! ((arg0 vector) (arg1 vector) (arg2 vector)) "Compute the cross product. The w component is set to junk." (rlet ((acc :class vf) diff --git a/goal_src/jak1/engine/nav/navigate-h.gc b/goal_src/jak1/engine/nav/navigate-h.gc index 6399ddb317..416ffc601d 100644 --- a/goal_src/jak1/engine/nav/navigate-h.gc +++ b/goal_src/jak1/engine/nav/navigate-h.gc @@ -362,49 +362,49 @@ (sphere-count int) (nearest-y-threshold-default float) ) - (let ((obj (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* sphere-count 16)))))) - (when (zero? obj) + (let ((this (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* sphere-count 16)))))) + (when (zero? this) (go process-drawable-art-error "memory") - (set! obj (the-as nav-control 0)) + (set! this (the-as nav-control 0)) (goto cfg-4) ) - (set! (-> obj max-spheres) sphere-count) - (set! (-> obj flags) (nav-control-flags navcf8 navcf13)) - (set! (-> obj mesh) (nav-mesh-connect (-> shape process) shape obj)) + (set! (-> this max-spheres) sphere-count) + (set! (-> this flags) (nav-control-flags navcf8 navcf13)) + (set! (-> this mesh) (nav-mesh-connect (-> shape process) shape this)) (let ((ent (-> shape process entity))) - (set! (-> obj nearest-y-threshold) + (set! (-> this nearest-y-threshold) (res-lump-float ent 'nearest-y-threshold :default nearest-y-threshold-default) ) ) - (set! (-> obj shape) shape) - (set! (-> obj process) (-> shape process)) - (set! (-> obj gap-event) #f) - (set! (-> obj current-poly) #f) - (set! (-> obj next-poly) #f) - (set! (-> obj target-poly) #f) - (set! (-> obj user-poly) #f) - (set! (-> obj portal 0) #f) - (set! (-> obj portal 1) #f) - (set! (-> obj nav-cull-radius) 40960.0) + (set! (-> this shape) shape) + (set! (-> this process) (-> shape process)) + (set! (-> this gap-event) #f) + (set! (-> this current-poly) #f) + (set! (-> this next-poly) #f) + (set! (-> this target-poly) #f) + (set! (-> this user-poly) #f) + (set! (-> this portal 0) #f) + (set! (-> this portal 1) #f) + (set! (-> this nav-cull-radius) 40960.0) (label cfg-4) - (the-as nav-control obj) + (the-as nav-control this) ) ) -(defmethod should-display? nav-control ((obj nav-control)) - (and *display-nav-marks* (logtest? (-> obj flags) (nav-control-flags display-marks))) +(defmethod should-display? nav-control ((this nav-control)) + (and *display-nav-marks* (logtest? (-> this flags) (nav-control-flags display-marks))) ) -(defmethod point-in-bounds? nav-control ((obj nav-control) (arg0 vector)) +(defmethod point-in-bounds? nav-control ((this nav-control) (arg0 vector)) "Is the point in bounds?" - (let ((v1-1 (-> obj mesh bounds))) + (let ((v1-1 (-> this mesh bounds))) ;; w is the sphere radius (>= (-> v1-1 w) (vector-vector-distance arg0 v1-1)) ) ) -(defmethod set-target-pos! nav-control ((obj nav-control) (arg0 vector)) - (set! (-> obj target-pos quad) (-> arg0 quad)) +(defmethod set-target-pos! nav-control ((this nav-control) (arg0 vector)) + (set! (-> this target-pos quad) (-> arg0 quad)) (none) ) diff --git a/goal_src/jak1/engine/nav/navigate.gc b/goal_src/jak1/engine/nav/navigate.gc index 3bafe9bd0e..2c6d79c1b3 100644 --- a/goal_src/jak1/engine/nav/navigate.gc +++ b/goal_src/jak1/engine/nav/navigate.gc @@ -131,12 +131,12 @@ (none) ) -(defmethod length nav-control ((obj nav-control)) - (-> obj num-spheres) +(defmethod length nav-control ((this nav-control)) + (-> this num-spheres) ) -(defmethod asize-of nav-control ((obj nav-control)) - (the-as int (+ (-> nav-control size) (* (-> obj max-spheres) 16))) +(defmethod asize-of nav-control ((this nav-control)) + (the-as int (+ (-> nav-control size) (* (-> this max-spheres) 16))) ) (define *default-nav-mesh* (new 'static 'nav-mesh @@ -176,13 +176,13 @@ ) ) -(defmethod length nav-mesh ((obj nav-mesh)) - (-> obj poly-count) +(defmethod length nav-mesh ((this nav-mesh)) + (-> this poly-count) ) -(defmethod debug-draw-poly nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 rgba)) - (let ((s5-0 (-> obj origin)) - (s2-0 (-> obj vertex)) +(defmethod debug-draw-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) + (let ((s5-0 (-> this origin)) + (s2-0 (-> this vertex)) (gp-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -222,16 +222,16 @@ (set! (-> *nav-one-third* x) 0.33333334) -(defmethod tri-centroid-local nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) - (set! (-> arg1 quad) (-> obj vertex (-> arg0 vertex 0) quad)) - (vector+! arg1 arg1 (the-as vector (-> obj vertex (-> arg0 vertex 1)))) - (vector+! arg1 arg1 (the-as vector (-> obj vertex (-> arg0 vertex 2)))) +(defmethod tri-centroid-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (set! (-> arg1 quad) (-> this vertex (-> arg0 vertex 0) quad)) + (vector+! arg1 arg1 (the-as vector (-> this vertex (-> arg0 vertex 1)))) + (vector+! arg1 arg1 (the-as vector (-> this vertex (-> arg0 vertex 2)))) (vector-float*! arg1 arg1 0.333333) ) -(defmethod tri-centroid-world nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) - (tri-centroid-local obj arg0 arg1) - (vector+! arg1 arg1 (-> obj origin)) +(defmethod tri-centroid-world nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (tri-centroid-local this arg0 arg1) + (vector+! arg1 arg1 (-> this origin)) ) (define *edge-vert0-table* (new 'static 'boxed-array :type int8 1 2 0)) @@ -314,17 +314,17 @@ ) ) -(defmethod point-in-poly? nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod point-in-poly? nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (vu-point-triangle-intersection? arg1 - (-> obj vertex (-> arg0 vertex 0)) - (-> obj vertex (-> arg0 vertex 1)) - (-> obj vertex (-> arg0 vertex 2)) + (-> this vertex (-> arg0 vertex 0)) + (-> this vertex (-> arg0 vertex 1)) + (-> this vertex (-> arg0 vertex 2)) ) ) -(defmethod closest-point-on-boundary nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) - (let ((s2-0 (-> obj vertex)) +(defmethod closest-point-on-boundary nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) + (let ((s2-0 (-> this vertex)) (s1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -345,10 +345,10 @@ arg1 ) -(defmethod project-point-into-tri-2d nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) - (if (point-in-poly? obj arg0 arg2) +(defmethod project-point-into-tri-2d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) + (if (point-in-poly? this arg0 arg2) (set! (-> arg1 quad) (-> arg2 quad)) - (closest-point-on-boundary obj arg0 arg1 arg2) + (closest-point-on-boundary this arg0 arg1 arg2) ) arg1 ) @@ -484,19 +484,19 @@ -1 ) -(defmethod find-poly-fast nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 meters)) +(defmethod find-poly-fast nav-mesh ((this nav-mesh) (arg0 vector) (arg1 meters)) (local-vars (a0-6 symbol) (a2-3 uint128) (a2-4 uint128)) -1 (let ((s2-0 -1) (s3-0 (-> *display* base-frame-counter)) - (f0-0 (-> obj bounds w)) + (f0-0 (-> this bounds w)) ) (when (>= (* f0-0 f0-0) (vector-length-squared arg0)) (dotimes (v1-3 4) - (set! a0-6 (and (= (-> obj cache v1-3 time) s3-0) - (= (-> obj cache v1-3 vec w) arg1) + (set! a0-6 (and (= (-> this cache v1-3 time) s3-0) + (= (-> this cache v1-3 vec w) arg1) (begin - (let ((a3-0 (-> obj cache v1-3)) + (let ((a3-0 (-> this cache v1-3)) (a2-1 arg0) ) (set! a0-6 #t) @@ -517,16 +517,16 @@ ) (label cfg-10) (if a0-6 - (return (-> obj poly (-> obj cache v1-3 poly-ind))) + (return (-> this poly (-> this cache v1-3 poly-ind))) ) - (if (and (< s2-0 0) (!= (-> obj cache v1-3 time) s3-0)) + (if (and (< s2-0 0) (!= (-> this cache v1-3 time) s3-0)) (set! s2-0 v1-3) ) ) - (let ((v1-12 (recursive-inside-poly obj (-> obj nodes 0) arg0 arg1))) + (let ((v1-12 (recursive-inside-poly this (-> this nodes 0) arg0 arg1))) (when (>= v1-12 0) (when (>= s2-0 0) - (let ((a0-24 (-> obj cache s2-0))) + (let ((a0-24 (-> this cache s2-0))) (set! (-> a0-24 vec x) (-> arg0 x)) (set! (-> a0-24 vec y) (-> arg0 y)) (set! (-> a0-24 vec z) (-> arg0 z)) @@ -535,7 +535,7 @@ (set! (-> a0-24 poly-ind) (the-as uint v1-12)) ) ) - (return (-> obj poly v1-12)) + (return (-> this poly v1-12)) ) ) ) @@ -741,7 +741,7 @@ ) ;; ERROR: Failed load: (set! vf3 (l.vf a0-4)) at op 42 -(defmethod is-in-mesh? nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 float) (arg2 meters)) +(defmethod is-in-mesh? nav-mesh ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 meters)) (local-vars (v1-10 int)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -751,17 +751,17 @@ (vf6 :class vf) (vf7 :class vf) ) - (let ((f0-1 (+ arg1 (-> obj bounds w)))) + (let ((f0-1 (+ arg1 (-> this bounds w)))) (when (>= (* f0-1 f0-1) (vector-length-squared arg0)) (let ((s2-0 (new 'stack-no-clear 'inline-array 'nav-vertex 6)) (f30-1 0.33333334) ) - (countdown (s1-0 (-> obj poly-count)) + (countdown (s1-0 (-> this poly-count)) (set! *debug-traverse* (+ *debug-traverse* 1)) - (let ((a0-3 (-> obj poly s1-0))) + (let ((a0-3 (-> this poly s1-0))) (when (not (logtest? (-> a0-3 pat) 1)) (nop!) - (let ((v1-8 (the-as object (-> obj vertex)))) + (let ((v1-8 (the-as object (-> this vertex)))) (nop!) (let ((a2-1 (-> a0-3 vertex 0))) (nop!) @@ -820,15 +820,15 @@ ) ) -(defmethod move-along-nav-ray! nav-mesh ((obj nav-mesh) (arg0 nav-ray)) +(defmethod move-along-nav-ray! nav-mesh ((this nav-mesh) (arg0 nav-ray)) (local-vars (a2-7 int) (a3-3 int)) (let ((v1-0 -1) (f0-1 (- (-> arg0 dest-pos x) (-> arg0 current-pos x))) (f1-2 (- (-> arg0 dest-pos z) (-> arg0 current-pos z))) ) (dotimes (a2-0 3) - (let* ((a3-1 (-> obj vertex (-> arg0 current-poly vertex (-> *edge-vert0-table* a2-0)))) - (t0-7 (-> obj vertex (-> arg0 current-poly vertex (-> *edge-vert1-table* a2-0)))) + (let* ((a3-1 (-> this vertex (-> arg0 current-poly vertex (-> *edge-vert0-table* a2-0)))) + (t0-7 (-> this vertex (-> arg0 current-poly vertex (-> *edge-vert1-table* a2-0)))) (f4-0 (- (-> a3-1 z) (-> t0-7 z))) (f3-2 (- (-> t0-7 x) (-> a3-1 x))) (f2-4 (+ (* f0-1 f4-0) (* f1-2 f3-2))) @@ -868,7 +868,7 @@ ) (let ((a2-9 (-> arg0 current-poly adj-poly a2-7))) (if (!= a2-9 255) - (set! (-> arg0 next-poly) (-> obj poly a2-9)) + (set! (-> arg0 next-poly) (-> this poly a2-9)) ) ) (cond @@ -919,14 +919,14 @@ (init-ray arg0) ) -(defmethod try-move-along-ray nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod try-move-along-ray nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (v1-2 symbol)) (let ((gp-0 (new 'stack-no-clear 'nav-ray))) (let ((s4-0 0)) (init-ray-dir-local gp-0 arg0 arg1 arg2 arg3) (until v1-2 (+! s4-0 1) - (move-along-nav-ray! obj gp-0) + (move-along-nav-ray! this gp-0) (set! v1-2 (or (>= s4-0 15) (-> gp-0 terminated))) ) ) @@ -984,14 +984,14 @@ (define *nav-update-route-table-route-count* 0) -(defmethod nav-mesh-method-18 nav-mesh ((obj nav-mesh) (arg0 int) (arg1 vector) (arg2 int) (arg3 (pointer int8)) (arg4 int)) +(defmethod nav-mesh-method-18 nav-mesh ((this nav-mesh) (arg0 int) (arg1 vector) (arg2 int) (arg3 (pointer int8)) (arg4 int)) (local-vars (sv-32 int) (sv-48 uint)) (set! (-> arg3 arg2) 1) - (nav-mesh-update-route-table obj arg0 arg2 (the-as uint 3)) - (nav-mesh-update-route-table obj arg2 arg0 (the-as uint 3)) + (nav-mesh-update-route-table this arg0 arg2 (the-as uint 3)) + (nav-mesh-update-route-table this arg2 arg0 (the-as uint 3)) (set! *nav-update-route-table-route-count* (+ *nav-update-route-table-route-count* 1)) (when (> arg4 0) - (let ((s1-1 (-> obj poly arg2)) + (let ((s1-1 (-> this poly arg2)) (s0-0 (new 'stack-no-clear 'vector)) ) (set! sv-32 0) @@ -999,15 +999,15 @@ (set! sv-48 (-> (the-as nav-poly (+ sv-32 (the-as int s1-1))) adj-poly 0)) (when (and (!= sv-48 255) (!= 1 (-> (the-as (pointer uint8) (&+ arg3 sv-48))))) (set! (-> arg3 sv-48) 1) - (when (not (logtest? (-> obj poly sv-48 pat) 1)) - (let ((v0-3 (= (nav-mesh-lookup-route obj arg0 (the-as int sv-48)) 3))) + (when (not (logtest? (-> this poly sv-48 pat) 1)) + (let ((v0-3 (= (nav-mesh-lookup-route this arg0 (the-as int sv-48)) 3))) (when (not v0-3) - (tri-centroid-local obj s1-1 s0-0) + (tri-centroid-local this s1-1 s0-0) (set! *nav-update-route-table-ray-count* (+ *nav-update-route-table-ray-count* 1)) - (set! v0-3 (nav-ray-test-local? obj (-> obj poly arg0) arg1 s0-0)) + (set! v0-3 (nav-ray-test-local? this (-> this poly arg0) arg1 s0-0)) ) (when v0-3 - (let* ((a0-16 obj) + (let* ((a0-16 this) (t9-5 (method-of-object a0-16 nav-mesh-method-18)) (a1-7 arg0) (a2-6 arg1) @@ -1028,7 +1028,7 @@ (none) ) -(defmethod update-route-table nav-mesh ((obj nav-mesh)) +(defmethod update-route-table nav-mesh ((this nav-mesh)) (when *nav-patch-route-table* (stopwatch-init *nav-timer*) (stopwatch-begin *nav-timer*) @@ -1037,17 +1037,17 @@ (let ((s4-0 (new 'stack-no-clear 'array 'int8 256))) (set! *nav-update-route-table-ray-count* 0) (set! *nav-update-route-table-route-count* 0) - (countdown (s3-0 (-> obj poly-count)) - (let ((s2-0 (-> obj poly s3-0))) + (countdown (s3-0 (-> this poly-count)) + (let ((s2-0 (-> this poly s3-0))) (when (not (logtest? (-> s2-0 pat) 1)) - (tri-centroid-local obj s2-0 s5-0) + (tri-centroid-local this s2-0 s5-0) (mem-set32! s4-0 64 0) (set! (-> s4-0 s3-0) 1) (dotimes (s1-0 3) (let ((a3-0 (-> s2-0 adj-poly s1-0))) (when (!= a3-0 255) - (if (not (logtest? (-> obj poly a3-0 pat) 1)) - (nav-mesh-method-18 obj s3-0 s5-0 (the-as int a3-0) s4-0 0) + (if (not (logtest? (-> this poly a3-0 pat) 1)) + (nav-mesh-method-18 this s3-0 s5-0 (the-as int a3-0) s4-0 0) ) ) ) @@ -1162,9 +1162,9 @@ ) ) -(defmethod find-poly nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 meters) (arg2 (pointer nav-control-flags))) +(defmethod find-poly nav-mesh ((this nav-mesh) (arg0 vector) (arg1 meters) (arg2 (pointer nav-control-flags))) (local-vars (s3-1 nav-poly)) - (let ((v1-1 (find-poly-fast obj arg0 arg1))) + (let ((v1-1 (find-poly-fast this arg0 arg1))) (when v1-1 (if arg2 (logior! (-> arg2 0) (nav-control-flags navcf20)) @@ -1179,12 +1179,12 @@ (let ((s2-0 (new 'stack-no-clear 'inline-array 'nav-vertex 3))) (set! s3-1 (the-as nav-poly #f)) (let ((f30-0 10000000000000000000000000000000000000.0)) - (countdown (s1-0 (-> obj poly-count)) - (let ((s0-0 (-> obj poly s1-0))) + (countdown (s1-0 (-> this poly-count)) + (let ((s0-0 (-> this poly s1-0))) (when (not (logtest? (-> s0-0 pat) 1)) - (set! (-> s2-0 0 quad) (-> obj vertex (-> s0-0 vertex 0) quad)) - (set! (-> s2-0 1 quad) (-> obj vertex (-> s0-0 vertex 1) quad)) - (set! (-> s2-0 2 quad) (-> obj vertex (-> s0-0 vertex 2) quad)) + (set! (-> s2-0 0 quad) (-> this vertex (-> s0-0 vertex 0) quad)) + (set! (-> s2-0 1 quad) (-> this vertex (-> s0-0 vertex 1) quad)) + (set! (-> s2-0 2 quad) (-> this vertex (-> s0-0 vertex 2) quad)) (let ((f1-2 (- (-> arg0 y) (* 0.333333 (+ (-> s2-0 0 y) (-> s2-0 1 y) (-> s2-0 2 y)))))) (when (>= arg1 (fabs f1-2)) (let ((f0-2 (point-triangle-distance-min arg0 f30-0 s2-0))) @@ -1204,14 +1204,14 @@ s3-1 ) -(defmethod setup-portal nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) +(defmethod setup-portal nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) (local-vars (t0-6 int) (t1-1 int)) (set! (-> arg2 next-poly) #f) (cond ((and arg0 arg1) - (let* ((v1-3 (* (+ (-> arg1 id) (* (the-as int (-> arg0 id)) (-> obj poly-count))) 2)) + (let* ((v1-3 (* (+ (-> arg1 id) (* (the-as int (-> arg0 id)) (-> this poly-count))) 2)) (v1-8 - (logand (ash (-> (the-as (pointer uint8) (-> obj route)) (/ (the-as int v1-3) 8)) (- (the-as int (logand v1-3 7)))) + (logand (ash (-> (the-as (pointer uint8) (-> this route)) (/ (the-as int v1-3) 8)) (- (the-as int (logand v1-3 7)))) 3 ) ) @@ -1221,8 +1221,8 @@ (let ((a2-9 (-> arg0 adj-poly v1-8))) (when (!= a2-9 255) (set! (-> arg2 edge-index) (the-as int v1-8)) - (set! (-> arg2 next-poly) (-> obj poly a2-9)) - (let ((a2-12 (-> obj vertex))) + (set! (-> arg2 next-poly) (-> this poly a2-9)) + (let ((a2-12 (-> this vertex))) (let ((t0-5 (+ v1-8 1))) (let ((t1-0 2)) (set-on-less-than t1-1 t1-0 t0-5) @@ -1231,7 +1231,7 @@ ) (set! (-> arg2 vertex 0) (-> a2-12 (-> arg0 vertex t0-6))) ) - (set! (-> arg2 vertex 1) (-> obj vertex (-> arg0 vertex v1-8))) + (set! (-> arg2 vertex 1) (-> this vertex (-> arg0 vertex v1-8))) #t ) ) @@ -1244,13 +1244,13 @@ ) ) -(defmethod get-adj-poly nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 symbol)) +(defmethod get-adj-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 symbol)) (local-vars (v1-12 uint) (t0-6 int) (t1-1 int)) (cond ((and arg0 arg1) - (let* ((v1-3 (* (+ (-> arg1 id) (* (the-as int (-> arg0 id)) (-> obj poly-count))) 2)) + (let* ((v1-3 (* (+ (-> arg1 id) (* (the-as int (-> arg0 id)) (-> this poly-count))) 2)) (a2-6 - (logand (ash (-> (the-as (pointer uint8) (-> obj route)) (/ (the-as int v1-3) 8)) (- (the-as int (logand v1-3 7)))) + (logand (ash (-> (the-as (pointer uint8) (-> this route)) (/ (the-as int v1-3) 8)) (- (the-as int (logand v1-3 7)))) 3 ) ) @@ -1275,7 +1275,7 @@ ) (set! (-> arg2 value) (logior (-> arg0 vertex t0-6) (shl (-> arg0 vertex a2-6) 16))) ) - (-> obj poly v1-12) + (-> this poly v1-12) ) ) ) @@ -1286,7 +1286,7 @@ ) ) -(defmethod compute-bounding-box nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector)) +(defmethod compute-bounding-box nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector)) (let ((f0-0 10000000000000000000000000000000000000.0) (f1-0 -10000000000000000000000000000000000000.0) ) @@ -1297,8 +1297,8 @@ (set! (-> arg1 y) f1-0) (set! (-> arg1 z) f1-0) ) - (dotimes (v1-1 (-> obj vertex-count)) - (let ((a3-1 (-> obj vertex v1-1))) + (dotimes (v1-1 (-> this vertex-count)) + (let ((a3-1 (-> this vertex v1-1))) (set! (-> arg0 x) (fmin (-> arg0 x) (-> a3-1 x))) (set! (-> arg0 y) (fmin (-> arg0 y) (-> a3-1 y))) (set! (-> arg0 z) (fmin (-> arg0 z) (-> a3-1 z))) @@ -1307,18 +1307,18 @@ (set! (-> arg1 z) (fmax (-> arg1 z) (-> a3-1 z))) ) ) - (vector+! arg0 arg0 (-> obj origin)) - (vector+! arg1 arg1 (-> obj origin)) + (vector+! arg0 arg0 (-> this origin)) + (vector+! arg1 arg1 (-> this origin)) 0 (none) ) -(defmethod initialize-mesh! nav-mesh ((obj nav-mesh)) +(defmethod initialize-mesh! nav-mesh ((this nav-mesh)) (local-vars (sv-32 vector) (sv-48 int)) (with-pp (set! sv-32 (new 'stack-no-clear 'vector)) - (let ((s5-0 (-> obj poly-count)) - (s3-0 (-> obj vertex-count)) + (let ((s5-0 (-> this poly-count)) + (s3-0 (-> this vertex-count)) (s1-0 0) (s2-0 0) (s4-0 0) @@ -1327,13 +1327,13 @@ (set! sv-48 s5-0) (while (nonzero? sv-48) (set! sv-48 (+ sv-48 -1)) - (let ((v1-4 (-> obj poly sv-48))) + (let ((v1-4 (-> this poly sv-48))) (if (logtest? (-> v1-4 pat) 1) (+! s4-0 1) ) - (let ((a1-2 (-> obj vertex (-> v1-4 vertex 0))) - (a2-2 (-> obj vertex (-> v1-4 vertex 1))) - (a3-0 (-> obj vertex (-> v1-4 vertex 2))) + (let ((a1-2 (-> this vertex (-> v1-4 vertex 0))) + (a2-2 (-> this vertex (-> v1-4 vertex 1))) + (a3-0 (-> this vertex (-> v1-4 vertex 2))) ) (vector-3pt-cross! sv-32 a1-2 a2-2 a3-0) ) @@ -1386,7 +1386,7 @@ ) ) -(defmethod find-opposite-vertices nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) +(defmethod find-opposite-vertices nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) (when (!= arg0 arg1) (dotimes (v1-1 3) (dotimes (a0-1 3) @@ -1463,9 +1463,9 @@ ) ) -(defmethod nav-mesh-method-23 nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 nav-route-portal)) +(defmethod nav-mesh-method-23 nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 nav-route-portal)) (local-vars (v1-32 int) (a0-14 int) (a0-17 int) (a1-10 int) (sv-16 nav-vertex)) - (let ((s1-0 (-> obj vertex)) + (let ((s1-0 (-> this vertex)) (s0-0 -1) ) (set! (-> arg2 quad) (-> arg3 quad)) @@ -1496,7 +1496,7 @@ (let ((v1-11 (-> arg0 adj-poly (-> *edge-vert0-table* s0-0)))) (cond ((!= v1-11 255) - (set! (-> arg4 next-poly) (-> obj poly v1-11)) + (set! (-> arg4 next-poly) (-> this poly v1-11)) (set! s0-0 -1) ) ((let ((a1-8 (-> s1-0 (-> arg0 vertex (-> *edge-vert0-table* s0-0))))) @@ -1535,29 +1535,29 @@ arg2 ) -(defmethod project-point-into-tri-3d nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-tri-3d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'matrix)) ) (dotimes (v1-0 3) (set! (-> s4-0 vector v1-0 quad) (the-as uint128 0)) ) - (set! (-> s4-0 vector 0 quad) (-> obj vertex (-> arg0 vertex 0) quad)) - (set! (-> s4-0 vector 1 quad) (-> obj vertex (-> arg0 vertex 1) quad)) - (set! (-> s4-0 vector 2 quad) (-> obj vertex (-> arg0 vertex 2) quad)) + (set! (-> s4-0 vector 0 quad) (-> this vertex (-> arg0 vertex 0) quad)) + (set! (-> s4-0 vector 1 quad) (-> this vertex (-> arg0 vertex 1) quad)) + (set! (-> s4-0 vector 2 quad) (-> this vertex (-> arg0 vertex 2) quad)) (normal-of-plane s3-0 (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) (-> s4-0 vector 2)) (closest-pt-in-triangle arg1 arg2 s4-0 s3-0) ) (none) ) -(defmethod project-onto-nav-mesh nav-control ((obj nav-control) (arg0 vector) (arg1 vector)) +(defmethod project-onto-nav-mesh nav-control ((this nav-control) (arg0 vector) (arg1 vector)) (local-vars (sv-32 int)) - (let ((s5-0 (-> obj mesh)) - (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 (-> obj mesh origin))) + (let ((s5-0 (-> this mesh)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 (-> this mesh origin))) ) (set! sv-32 0) - (let ((a1-5 (find-poly s5-0 s3-1 (-> obj nearest-y-threshold) (the-as (pointer nav-control-flags) (& sv-32))))) + (let ((a1-5 (find-poly s5-0 s3-1 (-> this nearest-y-threshold) (the-as (pointer nav-control-flags) (& sv-32))))) (cond ((logtest? #x100000 sv-32) (set! (-> arg0 quad) (-> arg1 quad)) @@ -1572,35 +1572,35 @@ arg0 ) -(defmethod find-poly nav-control ((obj nav-control) (arg0 vector)) +(defmethod find-poly nav-control ((this nav-control) (arg0 vector)) (find-poly - (-> obj mesh) - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj mesh origin)) - (-> obj nearest-y-threshold) + (-> this mesh) + (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) + (-> this nearest-y-threshold) (the-as (pointer nav-control-flags) #f) ) ) -(defmethod project-point-into-tri-3d nav-control ((obj nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-tri-3d nav-control ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (project-point-into-tri-3d - (-> obj mesh) + (-> this mesh) arg0 arg1 - (vector-! (new 'stack-no-clear 'vector) arg2 (-> obj mesh origin)) + (vector-! (new 'stack-no-clear 'vector) arg2 (-> this mesh origin)) ) - (vector+! arg1 arg1 (-> obj mesh origin)) + (vector+! arg1 arg1 (-> this mesh origin)) arg1 ) -(defmethod is-in-mesh? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) - (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj mesh origin))) - (a1-1 (-> obj mesh)) +(defmethod is-in-mesh? nav-control ((this nav-control) (arg0 vector) (arg1 float)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin))) + (a1-1 (-> this mesh)) ) - (is-in-mesh? a1-1 v1-1 arg1 (-> obj nearest-y-threshold)) + (is-in-mesh? a1-1 v1-1 arg1 (-> this nearest-y-threshold)) ) ) -(defmethod debug-draw nav-control ((obj nav-control)) +(defmethod debug-draw nav-control ((this nav-control)) (local-vars (sv-192 vector) (sv-208 uint) @@ -1610,16 +1610,16 @@ (sv-272 int) (sv-288 (function _varargs_ object)) ) - (let ((a0-1 obj)) + (let ((a0-1 this)) (when (and *display-nav-marks* (logtest? (-> a0-1 flags) (nav-control-flags display-marks))) - (let ((s5-0 (-> obj mesh)) + (let ((s5-0 (-> this mesh)) (s4-0 (new 'stack-no-clear 'vector)) ) - (= (-> obj mesh debug-time) (logand (-> *display* actual-frame-counter) 255)) + (= (-> this mesh debug-time) (logand (-> *display* actual-frame-counter) 255)) (when #t (set! (-> s5-0 debug-time) (the-as uint (-> *display* actual-frame-counter))) (add-debug-sphere - (logtest? (-> obj flags) (nav-control-flags navcf1)) + (logtest? (-> this flags) (nav-control-flags navcf1)) (bucket-id debug) (-> s5-0 bounds) (-> s5-0 bounds w) @@ -1627,7 +1627,7 @@ ) (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *x-vector* (meters 1) *color-red*) (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *z-vector* (meters 1) *color-blue*) - (when (logtest? (-> obj flags) (nav-control-flags navcf2)) + (when (logtest? (-> this flags) (nav-control-flags navcf2)) (dotimes (s3-0 (-> s5-0 vertex-count)) (add-debug-x #t @@ -1682,7 +1682,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf3)) + (when (logtest? (-> this flags) (nav-control-flags navcf3)) (dotimes (s3-2 (-> s5-0 poly-count)) (let ((s2-1 (-> s5-0 poly s3-2))) (debug-draw-poly s5-0 s2-1 (cond @@ -1706,7 +1706,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf4)) + (when (logtest? (-> this flags) (nav-control-flags navcf4)) (let ((s1-1 add-debug-text-3d) (s0-1 #t) ) @@ -1730,18 +1730,18 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf5)) - (if (-> obj next-poly) - (debug-draw-poly s5-0 (-> obj next-poly) *color-cyan*) + (when (logtest? (-> this flags) (nav-control-flags navcf5)) + (if (-> this next-poly) + (debug-draw-poly s5-0 (-> this next-poly) *color-cyan*) ) - (if (-> obj target-poly) - (debug-draw-poly s5-0 (-> obj target-poly) *color-yellow*) + (if (-> this target-poly) + (debug-draw-poly s5-0 (-> this target-poly) *color-yellow*) ) - (if (-> obj current-poly) - (debug-draw-poly s5-0 (-> obj current-poly) *color-red*) + (if (-> this current-poly) + (debug-draw-poly s5-0 (-> this current-poly) *color-red*) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf7)) + (when (logtest? (-> this flags) (nav-control-flags navcf7)) (dotimes (s3-3 (the-as int (-> s5-0 static-sphere-count))) (let ((s2-2 (-> s5-0 static-sphere s3-3))) (add-debug-sphere #t (bucket-id debug) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) @@ -1774,8 +1774,8 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf6)) - (when (and (-> obj portal 0) (-> obj portal 1)) + (when (logtest? (-> this flags) (nav-control-flags navcf6)) + (when (and (-> this portal 0) (-> this portal 1)) (let ((v1-80 (-> s5-0 origin)) (a2-22 (new 'stack-no-clear 'vector)) (a3-13 (new 'stack-no-clear 'vector)) @@ -1783,8 +1783,8 @@ (add-debug-line #t (bucket-id debug-no-zbuf) - (vector+! a2-22 v1-80 (the-as vector (-> obj portal 0))) - (vector+! a3-13 v1-80 (the-as vector (-> obj portal 1))) + (vector+! a2-22 v1-80 (the-as vector (-> this portal 0))) + (vector+! a3-13 v1-80 (the-as vector (-> this portal 1))) (new 'static 'rgba :r #xff :g #x80 :b #x40 :a #x80) #f (the-as rgba -1) @@ -1794,42 +1794,42 @@ (add-debug-vector #t (bucket-id debug-no-zbuf) - (-> obj shape trans) - (-> obj travel) + (-> this shape trans) + (-> this travel) (meters 0.00024414062) *color-white* ) (add-debug-vector #t (bucket-id debug-no-zbuf) - (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (new 'static 'vector :y 4096.0 :w 1.0)) - (-> obj old-travel) + (vector+! (new 'stack-no-clear 'vector) (-> this shape trans) (new 'static 'vector :y 4096.0 :w 1.0)) + (-> this old-travel) (meters 0.00024414062) *color-yellow* ) (add-debug-x #t (bucket-id debug-no-zbuf) - (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj travel)) + (vector+! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this travel)) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf7)) + (when (logtest? (-> this flags) (nav-control-flags navcf7)) (add-debug-sphere #t (bucket-id debug-no-zbuf) - (the-as vector (-> obj shape root-prim prim-core)) - (-> obj shape nav-radius) + (the-as vector (-> this shape root-prim prim-core)) + (-> this shape nav-radius) (new 'static 'rgba :g #xff :b #xff :a #x20) ) - (dotimes (s3-4 (-> obj num-spheres)) - (let ((v1-95 (-> obj sphere s3-4))) + (dotimes (s3-4 (-> this num-spheres)) + (let ((v1-95 (-> this sphere s3-4))) (vector+! s4-0 (-> s5-0 origin) (the-as vector (&-> v1-95 x))) (add-debug-sphere #t (bucket-id debug-no-zbuf) s4-0 - (- (-> v1-95 w) (-> obj shape nav-radius)) + (- (-> v1-95 w) (-> this shape nav-radius)) (new 'static 'rgba :g #xff :b #xff :a #x20) ) ) @@ -1842,50 +1842,50 @@ (none) ) -(defmethod mem-usage nav-mesh ((obj nav-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage nav-mesh ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 45 used) v1-6) (+! (-> arg0 data 45 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-16 (* (-> obj vertex-count) 16))) + (let ((v1-16 (* (-> this vertex-count) 16))) (+! (-> arg0 data 45 used) v1-16) (+! (-> arg0 data 45 total) (logand -16 (+ v1-16 15))) ) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-26 (* (-> obj poly-count) 8))) + (let ((v1-26 (* (-> this poly-count) 8))) (+! (-> arg0 data 45 used) v1-26) (+! (-> arg0 data 45 total) (logand -16 (+ v1-26 15))) ) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-38 (/ (* (* (-> obj poly-count) (-> obj poly-count)) 2) 8))) + (let ((v1-38 (/ (* (* (-> this poly-count) (-> this poly-count)) 2) 8))) (+! (-> arg0 data 45 used) v1-38) (+! (-> arg0 data 45 total) (logand -16 (+ v1-38 15))) ) (the-as nav-mesh 0) ) -(defmethod set-current-poly! nav-control ((obj nav-control) (arg0 nav-poly)) - (set! (-> obj current-poly) arg0) - (logior! (-> obj flags) (nav-control-flags navcf9)) +(defmethod set-current-poly! nav-control ((this nav-control) (arg0 nav-poly)) + (set! (-> this current-poly) arg0) + (logior! (-> this flags) (nav-control-flags navcf9)) 0 (none) ) -(defmethod nav-control-method-30 nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod nav-control-method-30 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (the-as sphere #f))) (let ((f30-0 -0.000001)) - (countdown (s1-0 (-> obj num-spheres)) - (let* ((s0-0 (-> obj sphere s1-0)) + (countdown (s1-0 (-> this num-spheres)) + (let* ((s0-0 (-> this sphere s1-0)) (f0-1 (ray-circle-intersect arg0 arg1 (the-as vector (&-> s0-0 x)) (-> s0-0 w))) ) (when (< f30-0 f0-1) @@ -1900,7 +1900,7 @@ ) ) -(defmethod intersect-ray-line-segment? nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod intersect-ray-line-segment? nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (ray-line-segment-intersection? arg0 arg1 arg2 arg3) ) @@ -1966,7 +1966,7 @@ (none) ) -(defmethod nav-control-method-28 nav-control ((obj nav-control) (arg0 collide-kind)) +(defmethod nav-control-method-28 nav-control ((this nav-control) (arg0 collide-kind)) (local-vars (sv-32 nav-control) (sv-48 sphere) @@ -1976,18 +1976,18 @@ (sv-112 vector) (sv-128 sphere) ) - (set! (-> obj num-spheres) 0) - (let ((s4-0 (-> obj mesh user-list)) + (set! (-> this num-spheres) 0) + (let ((s4-0 (-> this mesh user-list)) (s3-0 (new 'stack-no-clear 'vector)) ) (when (and *target* - (or (logtest? (-> obj flags) (nav-control-flags navcf11)) + (or (logtest? (-> this flags) (nav-control-flags navcf11)) (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) ) - (let ((s2-0 obj) + (let ((s2-0 this) (s1-0 (-> *target* control)) ) (let ((s0-0 s3-0)) @@ -2031,10 +2031,10 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf13)) - (countdown (s2-1 (-> obj mesh static-sphere-count)) - (let ((s1-2 obj) - (s0-2 (-> obj mesh static-sphere s2-1)) + (when (logtest? (-> this flags) (nav-control-flags navcf13)) + (countdown (s2-1 (-> this mesh static-sphere-count)) + (let ((s1-2 this) + (s0-2 (-> this mesh static-sphere s2-1)) ) (when (< (-> s1-2 num-spheres) (-> s1-2 max-spheres)) (set! sv-64 (-> s1-2 sphere (-> s1-2 num-spheres))) @@ -2058,8 +2058,8 @@ ) (while (!= v1-71 (-> s4-0 alive-list-end)) (let ((s0-3 (the-as collide-shape (-> (the-as connection v1-71) param3)))) - (when (not (or (= s0-3 (-> obj shape)) (not (logtest? arg0 (-> s0-3 root-prim prim-core collide-as))))) - (let ((s1-3 obj)) + (when (not (or (= s0-3 (-> this shape)) (not (logtest? arg0 (-> s0-3 root-prim prim-core collide-as))))) + (let ((s1-3 this)) (set! sv-112 s3-0) (when (logtest? (-> s0-3 nav-flags) (nav-flags navf0)) (set! (-> sv-112 quad) (-> s0-3 root-prim prim-core world-sphere quad)) @@ -2116,10 +2116,10 @@ (none) ) -(defmethod nav-control-method-35 nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-control-method-35 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg1 (-> obj mesh origin)) - (nav-control-method-32 obj arg0 v1-0 arg2 arg3 arg4) + (vector-! v1-0 arg1 (-> this mesh origin)) + (nav-control-method-32 this arg0 v1-0 arg2 arg3 arg4) ) (none) ) @@ -2257,7 +2257,7 @@ ) ) -(defmethod nav-control-method-32 nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-control-method-32 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (local-vars (v0-3 symbol) (v1-38 int) (a0-29 int) (a3-7 int) (sv-208 sphere)) (let ((gp-0 (new 'stack-no-clear 'nav-control-cfs-work))) (set! (-> gp-0 in-dir quad) (-> arg2 quad)) @@ -2274,8 +2274,8 @@ (set! (-> gp-0 initial-ignore-mask) (the-as uint 0)) (set! (-> gp-0 i-inside-sphere) -1) (set! (-> gp-0 inside-sphere-dist) 0.0) - (dotimes (s0-0 (-> obj num-spheres)) - (set! sv-208 (-> obj sphere s0-0)) + (dotimes (s0-0 (-> this num-spheres)) + (set! sv-208 (-> this sphere s0-0)) (set! (-> gp-0 dist2) (vector-vector-xz-distance-squared arg1 sv-208)) (let ((f0-10 (-> gp-0 dist2)) (f1-0 (-> sv-208 w)) @@ -2298,8 +2298,8 @@ arg1 (-> gp-0 in-dir) (-> gp-0 travel-len) - (-> obj num-spheres) - (-> obj sphere) + (-> this num-spheres) + (-> this sphere) (the-as int (-> gp-0 initial-ignore-mask)) ) ) @@ -2310,7 +2310,7 @@ (the-as none 0) ) (+! (-> gp-0 initial-ignore-mask) (ash 1 (-> gp-0 i-first-sphere))) - (let ((a1-9 (-> obj sphere (-> gp-0 i-first-sphere)))) + (let ((a1-9 (-> this sphere (-> gp-0 i-first-sphere)))) (circle-tangent-directions arg1 a1-9 (the-as vector (-> gp-0 temp-dir)) (-> gp-0 temp-dir 1)) ) (dotimes (v1-31 2) @@ -2333,7 +2333,7 @@ (b! #t cfg-31 :delay (nop!)) (label cfg-22) (+! (-> gp-0 ignore-mask) (ash 1 v1-38)) - (circle-tangent-directions arg1 (-> obj sphere v1-38) (the-as vector (-> gp-0 temp-dir)) (-> gp-0 temp-dir 1)) + (circle-tangent-directions arg1 (-> this sphere v1-38) (the-as vector (-> gp-0 temp-dir)) (-> gp-0 temp-dir 1)) (set! (-> gp-0 dir-update) #f) (dotimes (v1-40 2) (let ((f0-23 (-> gp-0 sign)) @@ -2360,8 +2360,8 @@ arg1 (-> gp-0 best-dir s1-1) (-> gp-0 travel-len) - (-> obj num-spheres) - (-> obj sphere) + (-> this num-spheres) + (-> this sphere) (the-as int (-> gp-0 ignore-mask)) ) ) @@ -2370,7 +2370,7 @@ (set! (-> gp-0 sign) (* -1.0 (-> gp-0 sign))) ) (when (!= (-> gp-0 i-inside-sphere) -1) - (let ((s2-1 (-> obj sphere (-> gp-0 i-inside-sphere)))) + (let ((s2-1 (-> this sphere (-> gp-0 i-inside-sphere)))) (vector-! (-> gp-0 away-dir) arg1 (the-as vector s2-1)) (set! (-> gp-0 away-dir y) 0.0) (when (>= 40.96 (vector-length (-> gp-0 away-dir))) @@ -2411,13 +2411,13 @@ v0-3 ) -(defmethod nav-control-method-23 nav-control ((obj nav-control) (arg0 vector) (arg1 check-vector-collision-with-nav-spheres-info)) - (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj mesh origin))) +(defmethod nav-control-method-23 nav-control ((this nav-control) (arg0 vector) (arg1 check-vector-collision-with-nav-spheres-info)) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this mesh origin))) (f30-0 -1.0) ) (let ((s3-0 -1)) - (countdown (s1-0 (-> obj num-spheres)) - (let* ((s0-0 (-> obj sphere s1-0)) + (countdown (s1-0 (-> this num-spheres)) + (let* ((s0-0 (-> this sphere s1-0)) (f0-1 (ray-circle-intersect s2-1 arg0 (the-as vector (&-> s0-0 x)) (-> s0-0 w))) ) (when (>= f0-1 0.0) @@ -2436,11 +2436,11 @@ (when arg1 (set! (-> arg1 u) f30-0) (when (>= f30-0 0.0) - (vector+float*! (-> arg1 intersect) (-> obj shape trans) arg0 f30-0) - (let ((a1-4 (-> obj sphere s3-0)) + (vector+float*! (-> arg1 intersect) (-> this shape trans) arg0 f30-0) + (let ((a1-4 (-> this sphere s3-0)) (v1-19 (new 'stack-no-clear 'vector)) ) - (vector+! v1-19 (the-as vector (&-> a1-4 x)) (-> obj mesh origin)) + (vector+! v1-19 (the-as vector (&-> a1-4 x)) (-> this mesh origin)) (vector-! (-> arg1 normal) (-> arg1 intersect) v1-19) ) (set! (-> arg1 normal w) 1.0) @@ -2452,17 +2452,17 @@ ) ) -(defmethod nav-control-method-33 nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) - (let ((f30-0 (vector-xz-length (-> obj travel)))) - (when (nav-control-method-32 obj arg0 arg1 arg2 arg3 f30-0) - (set! (-> obj blocked-travel quad) (-> obj travel quad)) - (let ((f0-0 (vector-xz-length (-> obj travel)))) +(defmethod nav-control-method-33 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) + (let ((f30-0 (vector-xz-length (-> this travel)))) + (when (nav-control-method-32 this arg0 arg1 arg2 arg3 f30-0) + (set! (-> this blocked-travel quad) (-> this travel quad)) + (let ((f0-0 (vector-xz-length (-> this travel)))) (when (and (>= f30-0 f0-0) (< f0-0 204.8)) - (logior! (-> obj flags) (nav-control-flags navcf17)) - (set! (-> obj block-time) (-> *display* base-frame-counter)) - (+! (-> obj block-count) 1.0) - (if (-> obj block-event) - (send-event (the-as process-tree (-> obj process)) (the-as symbol (-> obj block-event)) obj) + (logior! (-> this flags) (nav-control-flags navcf17)) + (set! (-> this block-time) (-> *display* base-frame-counter)) + (+! (-> this block-count) 1.0) + (if (-> this block-event) + (send-event (the-as process-tree (-> this process)) (the-as symbol (-> this block-event)) this) ) ) ) @@ -2483,7 +2483,7 @@ (define *test-ray-dest-pos* (new 'static 'vector :x -722887.7 :y 9532.475 :z -958862.25 :w 1.0)) -(defmethod nav-control-method-19 nav-control ((obj nav-control) (arg0 vector) (arg1 collide-shape-moving) (arg2 vector) (arg3 float)) +(defmethod nav-control-method-19 nav-control ((this nav-control) (arg0 vector) (arg1 collide-shape-moving) (arg2 vector) (arg3 float)) (local-vars (sv-48 float)) (let ((f30-0 (* arg3 (-> *display* seconds-per-frame))) (s0-0 arg1) @@ -2495,23 +2495,23 @@ (f28-0 (s2-0 sv-48 a1-1)) ) (cond - ((or (vector= arg2 (-> obj target-pos)) (< (fabs f28-0) 364.0889)) - (logior! (-> obj flags) (nav-control-flags navcf21)) + ((or (vector= arg2 (-> this target-pos)) (< (fabs f28-0) 364.0889)) + (logior! (-> this flags) (nav-control-flags navcf21)) (set! (-> arg0 quad) (-> arg2 quad)) ) (else (let ((s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg1 quat)))) (vector-rotate-y! s2-1 s2-1 (fmax (fmin f28-0 f30-0) (- f30-0))) (vector-normalize! s2-1 819.2) - (logclear! (-> obj flags) (nav-control-flags navcf21)) + (logclear! (-> this flags) (nav-control-flags navcf21)) (vector+! arg0 (-> arg1 trans) s2-1) ) - (when (or (not (nav-control-method-16 obj arg0)) - (logtest? (nav-control-flags navcf17) (-> obj flags)) - (not (logtest? (-> obj flags) (nav-control-flags navcf10))) + (when (or (not (nav-control-method-16 this arg0)) + (logtest? (nav-control-flags navcf17) (-> this flags)) + (not (logtest? (-> this flags) (nav-control-flags navcf10))) ) - (logior! (-> obj flags) (nav-control-flags navcf21)) - (vector-! (-> obj travel) arg2 (-> arg1 trans)) + (logior! (-> this flags) (nav-control-flags navcf21)) + (vector-! (-> this travel) arg2 (-> arg1 trans)) (set! (-> arg0 quad) (-> arg2 quad)) ) ) @@ -2521,29 +2521,29 @@ (none) ) -(defmethod nav-control-method-16 nav-control ((obj nav-control) (arg0 vector)) +(defmethod nav-control-method-16 nav-control ((this nav-control) (arg0 vector)) (find-poly-fast - (-> obj mesh) - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj mesh origin)) - (-> obj nearest-y-threshold) + (-> this mesh) + (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) + (-> this nearest-y-threshold) ) ) -(defmethod nav-control-method-21 nav-control ((obj nav-control) (arg0 vector)) +(defmethod nav-control-method-21 nav-control ((this nav-control) (arg0 vector)) (find-poly-fast - (-> obj mesh) - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj mesh origin)) - (-> obj nearest-y-threshold) + (-> this mesh) + (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) + (-> this nearest-y-threshold) ) ) -(defmethod nav-control-method-22 nav-control ((obj nav-control) (arg0 vector) (arg1 float)) +(defmethod nav-control-method-22 nav-control ((this nav-control) (arg0 vector) (arg1 float)) (the-as symbol (and (find-poly-fast - (-> obj mesh) - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj mesh origin)) - (-> obj nearest-y-threshold) + (-> this mesh) + (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) + (-> this nearest-y-threshold) ) - (< (-> arg0 y) (+ (-> obj mesh origin y) arg1)) + (< (-> arg0 y) (+ (-> this mesh origin y) arg1)) ) ) ) @@ -2558,22 +2558,22 @@ ) ) -(defmethod nav-control-method-26 nav-control ((obj nav-control)) +(defmethod nav-control-method-26 nav-control ((this nav-control)) 0 (none) ) -(defmethod nav-control-method-27 nav-control ((obj nav-control)) +(defmethod nav-control-method-27 nav-control ((this nav-control)) (local-vars (v1-7 symbol)) (cond - ((-> obj current-poly) - (let ((s4-0 (-> obj mesh)) + ((-> this current-poly) + (let ((s4-0 (-> this mesh)) (s5-0 (new 'stack-no-clear 'nav-ray)) ) (let ((s3-0 0)) - (set! (-> s5-0 current-poly) (-> obj current-poly)) - (vector-! (-> s5-0 current-pos) (-> obj prev-pos) (-> s4-0 origin)) - (vector-! (-> s5-0 dest-pos) (-> obj shape trans) (-> s4-0 origin)) + (set! (-> s5-0 current-poly) (-> this current-poly)) + (vector-! (-> s5-0 current-pos) (-> this prev-pos) (-> s4-0 origin)) + (vector-! (-> s5-0 dest-pos) (-> this shape trans) (-> s4-0 origin)) (init-ray s5-0) (until v1-7 (+! s3-0 1) @@ -2581,7 +2581,7 @@ (set! v1-7 (or (>= s3-0 15) (-> s5-0 terminated))) ) ) - (set! (-> obj current-poly) (-> s5-0 current-poly)) + (set! (-> this current-poly) (-> s5-0 current-poly)) (when (-> s5-0 reached-dest) (if (not (point-in-poly? s4-0 (-> s5-0 current-poly) (-> s5-0 dest-pos))) (set! (-> s5-0 reached-dest) #f) @@ -2589,27 +2589,27 @@ ) (cond ((-> s5-0 reached-dest) - (set! (-> obj prev-pos quad) (-> obj shape trans quad)) + (set! (-> this prev-pos quad) (-> this shape trans quad)) ) (else - (set! (-> obj prev-pos quad) (-> obj shape trans quad)) - (set! (-> obj current-poly) (find-poly obj (-> obj shape trans))) + (set! (-> this prev-pos quad) (-> this shape trans quad)) + (set! (-> this current-poly) (find-poly this (-> this shape trans))) ) ) ) 0 ) (else - (set! (-> obj prev-pos quad) (-> obj shape trans quad)) - (set! (-> obj current-poly) (find-poly obj (-> obj shape trans))) + (set! (-> this prev-pos quad) (-> this shape trans quad)) + (set! (-> this current-poly) (find-poly this (-> this shape trans))) ) ) - (nav-control-method-26 obj) + (nav-control-method-26 this) 0 (none) ) -(defmethod nav-mesh-method-16 nav-mesh ((obj nav-mesh) +(defmethod nav-mesh-method-16 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) @@ -2633,14 +2633,14 @@ (init-ray s0-0) (until v1-10 (set! sv-128 (+ sv-128 1)) - (move-along-nav-ray! obj s0-0) + (move-along-nav-ray! this s0-0) (set! v1-10 (or (>= sv-128 15) (or (>= (-> s0-0 len) (fmax 20480.0 arg4)) (-> s0-0 terminated)))) ) (cond ((and (-> s0-0 hit-boundary) (and (< (-> s0-0 len) arg4) (!= (-> s0-0 last-edge) -1) (< sv-112 1))) (set! sv-112 (+ sv-112 1)) - (let* ((v1-22 (-> obj vertex (-> s0-0 current-poly vertex (-> *edge-vert0-table* (-> s0-0 last-edge))))) - (a0-15 (-> obj vertex (-> s0-0 current-poly vertex (-> *edge-vert1-table* (-> s0-0 last-edge))))) + (let* ((v1-22 (-> this vertex (-> s0-0 current-poly vertex (-> *edge-vert0-table* (-> s0-0 last-edge))))) + (a0-15 (-> this vertex (-> s0-0 current-poly vertex (-> *edge-vert1-table* (-> s0-0 last-edge))))) (f2-1 (- (-> v1-22 z) (-> a0-15 z))) (f3-0 (- (-> a0-15 x) (-> v1-22 x))) (f1-5 (-> arg2 x)) @@ -2655,14 +2655,14 @@ ) (when arg5 (set! (-> arg5 found-boundary) #t) - (vector+! (-> arg5 intersection) (-> s0-0 current-pos) (-> obj origin)) + (vector+! (-> arg5 intersection) (-> s0-0 current-pos) (-> this origin)) (set! (-> arg5 boundary-normal x) f2-2) (set! (-> arg5 boundary-normal y) 0.0) (set! (-> arg5 boundary-normal z) f3-1) (set! (-> arg5 poly) (-> s0-0 current-poly)) (set! (-> arg5 edge) (-> s0-0 last-edge)) - (vector+! (-> arg5 vert-0) (the-as vector v1-22) (-> obj origin)) - (vector+! (-> arg5 vert-1) (the-as vector a0-15) (-> obj origin)) + (vector+! (-> arg5 vert-0) (the-as vector v1-22) (-> this origin)) + (vector+! (-> arg5 vert-1) (the-as vector a0-15) (-> this origin)) ) (set! (-> s0-0 dest-pos quad) (-> s0-0 current-pos quad)) (cond @@ -2702,22 +2702,22 @@ (none) ) -(defmethod nav-control-method-24 nav-control ((obj nav-control) (arg0 float) (arg1 clip-travel-vector-to-mesh-return-info)) +(defmethod nav-control-method-24 nav-control ((this nav-control) (arg0 float) (arg1 clip-travel-vector-to-mesh-return-info)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 (-> obj shape trans) (-> obj mesh origin)) + (vector-! v1-0 (-> this shape trans) (-> this mesh origin)) (nav-mesh-method-16 - (-> obj mesh) + (-> this mesh) v1-0 - (-> obj current-poly) - (-> obj travel) - (not (logtest? (-> obj flags) (nav-control-flags navcf12))) + (-> this current-poly) + (-> this travel) + (not (logtest? (-> this flags) (nav-control-flags navcf12))) arg0 arg1 ) ) (when arg1 (if (-> arg1 gap-poly) - (set! (-> obj next-poly) (-> arg1 gap-poly)) + (set! (-> this next-poly) (-> arg1 gap-poly)) ) ) 0 @@ -2823,7 +2823,7 @@ ) ) -(defmethod nav-control-method-13 nav-control ((obj nav-control) (arg0 vector) (arg1 vector)) +(defmethod nav-control-method-13 nav-control ((this nav-control) (arg0 vector) (arg1 vector)) (local-vars (sv-80 vector) (sv-84 vector) @@ -2834,32 +2834,32 @@ ) (set! sv-80 (new 'stack-no-clear 'vector)) (set! sv-84 (new 'stack-no-clear 'vector)) - (set! sv-88 (-> obj current-poly)) + (set! sv-88 (-> this current-poly)) (set! sv-92 (new 'stack-no-clear 'vector)) (set! sv-96 (new 'stack-no-clear 'nav-route-portal)) (set! sv-100 (the-as symbol #f)) - (vector-! sv-80 (-> obj shape trans) (-> obj mesh origin)) + (vector-! sv-80 (-> this shape trans) (-> this mesh origin)) (set! (-> sv-84 quad) (-> sv-80 quad)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 arg0 (-> obj mesh origin)) - (set! (-> obj target-poly) (find-poly (-> obj mesh) s4-0 (-> obj nearest-y-threshold) (&-> obj flags))) - (if (not (-> obj target-poly)) - (set! (-> obj target-poly) (-> obj current-poly)) + (vector-! s4-0 arg0 (-> this mesh origin)) + (set! (-> this target-poly) (find-poly (-> this mesh) s4-0 (-> this nearest-y-threshold) (&-> this flags))) + (if (not (-> this target-poly)) + (set! (-> this target-poly) (-> this current-poly)) ) - (project-point-into-tri-2d (-> obj mesh) (-> obj target-poly) sv-92 s4-0) + (project-point-into-tri-2d (-> this mesh) (-> this target-poly) sv-92 s4-0) ) - (vector-! (-> obj travel) sv-92 sv-80) - (setup-portal (-> obj mesh) (-> obj current-poly) (-> obj target-poly) sv-96) + (vector-! (-> this travel) sv-92 sv-80) + (setup-portal (-> this mesh) (-> this current-poly) (-> this target-poly) sv-96) (cond ((not (-> sv-96 next-poly)) - (set! (-> obj next-poly) #f) - (set! (-> obj portal 0) #f) - (set! (-> obj portal 1) #f) + (set! (-> this next-poly) #f) + (set! (-> this portal 0) #f) + (set! (-> this portal 1) #f) ) (else - (set! (-> obj next-poly) (-> sv-96 next-poly)) - (set! (-> obj portal 0) (the-as nav-route-portal (-> sv-96 vertex 0))) - (set! (-> obj portal 1) (the-as nav-route-portal (-> sv-96 vertex 1))) + (set! (-> this next-poly) (-> sv-96 next-poly)) + (set! (-> this portal 0) (the-as nav-route-portal (-> sv-96 vertex 0))) + (set! (-> this portal 1) (the-as nav-route-portal (-> sv-96 vertex 1))) (set! sv-100 #t) (while (and sv-100 (-> sv-96 next-poly) @@ -2868,29 +2868,29 @@ (when #t #t (vector-segment-distance-point! sv-80 (-> sv-96 vertex 0) (-> sv-96 vertex 1) sv-84) - (vector-! (-> obj travel) sv-92 sv-84) + (vector-! (-> this travel) sv-92 sv-84) 0 ) (cond ((logtest? (-> sv-96 next-poly pat) 1) (vector-segment-distance-point! sv-80 (-> sv-96 vertex 0) (-> sv-96 vertex 1) sv-92) - (vector-! (-> obj travel) sv-92 sv-84) - (set! (-> obj next-poly) (-> sv-96 next-poly)) + (vector-! (-> this travel) sv-92 sv-84) + (set! (-> this next-poly) (-> sv-96 next-poly)) (set! sv-100 (the-as symbol #f)) ) ((begin (set! sv-88 (-> sv-96 next-poly)) - (setup-portal (-> obj mesh) (-> sv-96 next-poly) (-> obj target-poly) sv-96) + (setup-portal (-> this mesh) (-> sv-96 next-poly) (-> this target-poly) sv-96) ) - (set! (-> obj next-poly) (-> sv-96 next-poly)) - (set! (-> obj portal 0) (the-as nav-route-portal (-> sv-96 vertex 0))) - (set! (-> obj portal 1) (the-as nav-route-portal (-> sv-96 vertex 1))) + (set! (-> this next-poly) (-> sv-96 next-poly)) + (set! (-> this portal 0) (the-as nav-route-portal (-> sv-96 vertex 0))) + (set! (-> this portal 1) (the-as nav-route-portal (-> sv-96 vertex 1))) 0 ) (else - (set! (-> obj next-poly) #f) - (set! (-> obj portal 0) #f) - (set! (-> obj portal 1) #f) + (set! (-> this next-poly) #f) + (set! (-> this portal 0) #f) + (set! (-> this portal 1) #f) (set! sv-100 (the-as symbol #f)) ) ) @@ -2900,51 +2900,51 @@ (when sv-100 (when (not (ray-ccw-line-segment-intersection? sv-84 - (-> obj travel) - (the-as vector (-> obj portal 0)) - (the-as vector (-> obj portal 1)) + (-> this travel) + (the-as vector (-> this portal 0)) + (the-as vector (-> this portal 1)) ) ) - (let ((a0-18 (choose-travel-portal-vertex (-> obj mesh) sv-96 (-> obj target-poly) sv-92))) - (vector-! (-> obj travel) (the-as vector (-> sv-96 vertex a0-18)) sv-84) + (let ((a0-18 (choose-travel-portal-vertex (-> this mesh) sv-96 (-> this target-poly) sv-92))) + (vector-! (-> this travel) (the-as vector (-> sv-96 vertex a0-18)) sv-84) ) ) ) - (nav-control-method-33 obj (-> obj travel) sv-84 (-> obj travel) arg1 40960.0) + (nav-control-method-33 this (-> this travel) sv-84 (-> this travel) arg1 40960.0) (let ((s5-1 (new 'stack-no-clear 'clip-travel-vector-to-mesh-return-info))) (nav-mesh-method-16 - (-> obj mesh) + (-> this mesh) sv-84 sv-88 - (-> obj travel) - (not (logtest? (-> obj flags) (nav-control-flags navcf12))) + (-> this travel) + (not (logtest? (-> this flags) (nav-control-flags navcf12))) 204.8 s5-1 ) (if (-> s5-1 gap-poly) - (set! (-> obj next-poly) (-> s5-1 gap-poly)) + (set! (-> this next-poly) (-> s5-1 gap-poly)) ) ) (let ((v1-82 (new 'stack-no-clear 'vector))) (vector-! v1-82 sv-84 sv-80) - (vector+! (-> obj travel) (-> obj travel) v1-82) + (vector+! (-> this travel) (-> this travel) v1-82) ) - (set! (-> obj travel y) 0.0) - (-> obj travel) + (set! (-> this travel y) 0.0) + (-> this travel) ) -(defmethod nav-control-method-12 nav-control ((obj nav-control) (arg0 nav-gap-info)) - (when (and (-> obj next-poly) (logtest? (-> obj next-poly pat) 1)) - (let ((s4-0 (-> obj next-poly)) - (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj mesh origin))) +(defmethod nav-control-method-12 nav-control ((this nav-control) (arg0 nav-gap-info)) + (when (and (-> this next-poly) (logtest? (-> this next-poly pat) 1)) + (let ((s4-0 (-> this next-poly)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this mesh origin))) ) (while (and s4-0 (logtest? (-> s4-0 pat) 1)) - (set! s4-0 (get-adj-poly (-> obj mesh) s4-0 (-> obj target-poly) #f)) + (set! s4-0 (get-adj-poly (-> this mesh) s4-0 (-> this target-poly) #f)) ) - (when (and s4-0 (-> obj gap-event)) - (let ((s2-0 (-> obj event-temp))) - (closest-point-on-boundary (-> obj mesh) s4-0 s2-0 s3-1) - (vector+! s2-0 s2-0 (-> obj mesh origin)) + (when (and s4-0 (-> this gap-event)) + (let ((s2-0 (-> this event-temp))) + (closest-point-on-boundary (-> this mesh) s4-0 s2-0 s3-1) + (vector+! s2-0 s2-0 (-> this mesh origin)) (set! (-> arg0 dest quad) (-> s2-0 quad)) ) (set! (-> arg0 poly) s4-0) @@ -2954,30 +2954,30 @@ ) ) -(defmethod nav-control-method-11 nav-control ((obj nav-control) (arg0 vector)) - (set! (-> obj old-travel quad) (-> obj travel quad)) - (-> obj block-count) - (seek! (-> obj block-count) 0.0 0.016666668) - (logclear! (-> obj flags) (nav-control-flags navcf9 navcf17 navcf18 navcf19)) - (nav-control-method-27 obj) - (if (logtest? (-> obj flags) (nav-control-flags navcf8)) - (nav-control-method-28 obj (the-as collide-kind -1)) +(defmethod nav-control-method-11 nav-control ((this nav-control) (arg0 vector)) + (set! (-> this old-travel quad) (-> this travel quad)) + (-> this block-count) + (seek! (-> this block-count) 0.0 0.016666668) + (logclear! (-> this flags) (nav-control-flags navcf9 navcf17 navcf18 navcf19)) + (nav-control-method-27 this) + (if (logtest? (-> this flags) (nav-control-flags navcf8)) + (nav-control-method-28 this (the-as collide-kind -1)) ) - (nav-control-method-13 obj arg0 (-> obj old-travel)) - (-> obj mesh) - (vector-! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj mesh origin)) + (nav-control-method-13 this arg0 (-> this old-travel)) + (-> this mesh) + (vector-! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this mesh origin)) (let ((s5-1 (new 'stack-no-clear 'nav-gap-info))) - (when (< (vector-xz-length (-> obj travel)) 204.8) + (when (< (vector-xz-length (-> this travel)) 204.8) (cond - ((logtest? (nav-control-flags navcf17) (-> obj flags)) + ((logtest? (nav-control-flags navcf17) (-> this flags)) ) - ((-> obj next-poly) + ((-> this next-poly) (cond - ((nav-control-method-12 obj s5-1) - (set! (-> obj next-poly) #f) + ((nav-control-method-12 this s5-1) + (set! (-> this next-poly) #f) (send-event - (the-as process-tree (-> obj process)) - (the-as symbol (-> obj gap-event)) + (the-as process-tree (-> this process)) + (the-as symbol (-> this gap-event)) (-> s5-1 dest) (-> s5-1 poly) ) @@ -2987,12 +2987,12 @@ ) ) (else - (logior! (-> obj flags) (nav-control-flags navcf19)) + (logior! (-> this flags) (nav-control-flags navcf19)) ) ) ) ) - (-> obj travel) + (-> this travel) ) (defun-debug nav-sphere-from-cam () diff --git a/goal_src/jak1/engine/physics/dynamics-h.gc b/goal_src/jak1/engine/physics/dynamics-h.gc index 8e2c93a5d9..e999d44ded 100644 --- a/goal_src/jak1/engine/physics/dynamics-h.gc +++ b/goal_src/jak1/engine/physics/dynamics-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: dynamics-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; dyanamics contain gravity properties (deftype dynamics (basic) ((name basic :offset-assert 4) diff --git a/goal_src/jak1/engine/physics/trajectory-h.gc b/goal_src/jak1/engine/physics/trajectory-h.gc index 9b222bf881..30d2396e44 100644 --- a/goal_src/jak1/engine/physics/trajectory-h.gc +++ b/goal_src/jak1/engine/physics/trajectory-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: trajectory-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; Trajectory represents a ballistic trajectory. ;; First, call one of the setup methods to setup the trajectory object. ;; Then, use eval-position or eval-velocity to get the position or velocity of the @@ -28,6 +30,3 @@ (debug-draw! (_type_) none 15) ) ) - - - diff --git a/goal_src/jak1/engine/physics/trajectory.gc b/goal_src/jak1/engine/physics/trajectory.gc index 7af595444d..20cd1e5ea1 100644 --- a/goal_src/jak1/engine/physics/trajectory.gc +++ b/goal_src/jak1/engine/physics/trajectory.gc @@ -5,54 +5,56 @@ ;; name in dgo: trajectory ;; dgos: GAME, ENGINE -(defmethod eval-position! trajectory ((obj trajectory) (time float) (result vector)) +;; DECOMP BEGINS + +(defmethod eval-position! trajectory ((this trajectory) (time float) (result vector)) "Evaluate the position of the object at a give time" - (set! (-> result quad) (-> obj initial-position quad)) - (+! (-> result x) (* time (-> obj initial-velocity x))) - (+! (-> result y) (* time (-> obj initial-velocity y))) - (+! (-> result z) (* time (-> obj initial-velocity z))) - (+! (-> result y) (* (* (* 0.5 time) time) (-> obj gravity))) + (set! (-> result quad) (-> this initial-position quad)) + (+! (-> result x) (* time (-> this initial-velocity x))) + (+! (-> result y) (* time (-> this initial-velocity y))) + (+! (-> result z) (* time (-> this initial-velocity z))) + (+! (-> result y) (* (* (* 0.5 time) time) (-> this gravity))) result ) -(defmethod eval-velocity! trajectory ((obj trajectory) (time float) (result vector)) +(defmethod eval-velocity! trajectory ((this trajectory) (time float) (result vector)) "Evaluate the velocity of the object at a given time" - (set! (-> result quad) (-> obj initial-velocity quad)) - (+! (-> result y) (* time (-> obj gravity))) + (set! (-> result quad) (-> this initial-velocity quad)) + (+! (-> result y) (* time (-> this gravity))) result ) -(defmethod setup-from-to-duration! trajectory ((obj trajectory) (from vector) (to vector) (duration float) (grav float)) +(defmethod setup-from-to-duration! trajectory ((this trajectory) (from vector) (to vector) (duration float) (grav float)) "Set up a trajectory that goes from->to in the given duration" - (set! (-> obj initial-position quad) (-> from quad)) - (set! (-> obj gravity) grav) - (set! (-> obj time) duration) + (set! (-> this initial-position quad) (-> from quad)) + (set! (-> this gravity) grav) + (set! (-> this time) duration) ;; the velocity we need in xz to make it in time (let ((xz-vel (/ (vector-vector-xz-distance to from) duration))) ;; our velocity will point along from -> to - (vector-! (-> obj initial-velocity) to from) + (vector-! (-> this initial-velocity) to from) ;; but have magnitude that we calculated above. - (vector-xz-normalize! (-> obj initial-velocity) xz-vel) + (vector-xz-normalize! (-> this initial-velocity) xz-vel) ) ;; solve for the y velocity that makes us land at the right height. - (set! (-> obj initial-velocity y) + (set! (-> this initial-velocity y) (- (/ (- (-> to y) (-> from y)) duration) - (* (* 0.5 duration) (-> obj gravity)) + (* (* 0.5 duration) (-> this gravity)) ) ) (none) ) -(defmethod setup-from-to-xz-vel! trajectory ((obj trajectory) (from vector) (to vector) (xz-vel float) (grav float)) +(defmethod setup-from-to-xz-vel! trajectory ((this trajectory) (from vector) (to vector) (xz-vel float) (grav float)) "Set up a trajectory that goes from->to with the given velocity" ;; just solve for the duration and use the previous (let ((duration (/ (vector-vector-xz-distance to from) xz-vel))) - (setup-from-to-duration! obj from to duration grav) + (setup-from-to-duration! this from to duration grav) ) (none) ) -(defmethod setup-from-to-y-vel! trajectory ((obj trajectory) (from vector) (to vector) (y-vel float) (grav float)) +(defmethod setup-from-to-y-vel! trajectory ((this trajectory) (from vector) (to vector) (y-vel float) (grav float)) "Set up a trajectory with the given initial y velocity." (let* ((f0-0 y-vel) (f1-3 (- (* f0-0 f0-0) (* (* 2.0 (- (-> from y) (-> to y))) grav))) @@ -63,13 +65,13 @@ (set! f0-3 (fmax (/ (- (- y-vel) f0-4) grav) (/ (+ (- y-vel) f0-4) grav))) ) ) - (setup-from-to-duration! obj from to f0-3 grav) + (setup-from-to-duration! this from to f0-3 grav) ) 0 (none) ) -(defmethod setup-from-to-height! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) "Setup a trajectory that reaches a given height" (let* ((f1-2 (+ arg2 (fmax (-> arg0 y) (-> arg1 y)))) (f1-5 (* (* 2.0 (- (-> arg0 y) f1-2)) arg3)) @@ -78,22 +80,22 @@ (if (< 0.0 f1-5) (set! f0-3 (sqrtf f1-5)) ) - (setup-from-to-y-vel! obj arg0 arg1 f0-3 arg3) + (setup-from-to-y-vel! this arg0 arg1 f0-3 arg3) ) (none) ) -(defmethod debug-draw! trajectory ((obj trajectory)) +(defmethod debug-draw! trajectory ((this trajectory)) "Draw the trajectory" (let ((prev-pos (new 'stack-no-clear 'vector)) (pos (new 'stack-no-clear 'vector)) (num-segments 10) ) - (set! (-> pos quad) (-> obj initial-position quad)) + (set! (-> pos quad) (-> this initial-position quad)) (dotimes (s2-0 num-segments) (set! (-> prev-pos quad) (-> pos quad)) - (let ((t-eval (* (-> obj time) (/ (+ 1.0 (the float s2-0)) (the float num-segments))))) - (eval-position! obj t-eval pos) + (let ((t-eval (* (-> this time) (/ (+ 1.0 (the float s2-0)) (the float num-segments))))) + (eval-position! this t-eval pos) ) (add-debug-line #t diff --git a/goal_src/jak1/engine/ps2/memcard-h.gc b/goal_src/jak1/engine/ps2/memcard-h.gc index 32749e5fbe..975a6e527a 100644 --- a/goal_src/jak1/engine/ps2/memcard-h.gc +++ b/goal_src/jak1/engine/ps2/memcard-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: memcard-h ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + (deftype mc-handle (int32) () :flag-assert #x900000004 diff --git a/goal_src/jak1/engine/ps2/pad.gc b/goal_src/jak1/engine/ps2/pad.gc index ca4372ca13..b36692ec80 100644 --- a/goal_src/jak1/engine/ps2/pad.gc +++ b/goal_src/jak1/engine/ps2/pad.gc @@ -14,6 +14,8 @@ (define-extern get-current-time (function time-frame)) (define-extern get-integral-current-time (function time-frame)) +;; DECOMP BEGINS + (defenum pad-buttons :bitfield #t :type uint32 @@ -139,11 +141,11 @@ (defmethod new cpad-info ((alloction symbol) (type-to-make type) (idx int)) "Allocate a new cpad-info and open the pad itself through the kernel" - (let ((obj (object-new alloction type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj number) idx) - (set! (-> obj buzz) #f) - (cpad-open obj idx) ;; kernel function. - (cpad-invalid! obj) + (let ((this (object-new alloction type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this number) idx) + (set! (-> this buzz) #f) + (cpad-open this idx) ;; kernel function. + (cpad-invalid! this) ) ) diff --git a/goal_src/jak1/engine/ps2/rpc-h.gc b/goal_src/jak1/engine/ps2/rpc-h.gc index ffed796d82..9f39d37b59 100644 --- a/goal_src/jak1/engine/ps2/rpc-h.gc +++ b/goal_src/jak1/engine/ps2/rpc-h.gc @@ -14,6 +14,8 @@ (defconstant RPC-LOAD-STR 4) ;; called STR in IOP code (defconstant RPC-PLAY-STR 5) ;; called PLAY in IOP code +;; DECOMP BEGINS + ;; an RPC buffer is a container of elements to send to the IOP. ;; each element is size elt-size, and there are maximum of elt-count elements ;; it is possible to use fewer elements than elt-count. @@ -39,15 +41,15 @@ "Create a new rpc-buffer with room for elt-count elements of elt-size. The element array is 64-byte aligned." ;; we make room for a buffer of size elt-size * elt-count that is _64 byte_ aligned. - (let ((obj (object-new allocation type-to-make (the int (+ (-> type-to-make size) 63 (* elt-size elt-count)))))) - (set! (-> obj elt-size) elt-size) - (set! (-> obj elt-count) elt-count) - (set! (-> obj elt-used) 0) - (set! (-> obj busy) #f) - ;(set! (-> obj base) (logand -64 (+ (the uint obj) 28 63))) + (let ((this (object-new allocation type-to-make (the int (+ (-> type-to-make size) 63 (* elt-size elt-count)))))) + (set! (-> this elt-size) elt-size) + (set! (-> this elt-count) elt-count) + (set! (-> this elt-used) 0) + (set! (-> this busy) #f) + ;(set! (-> this base) (logand -64 (+ (the uint this) 28 63))) ;; base is the 64-byte aligned buffer. - (set! (-> obj base) (the pointer (logand -64 (+ (the uint (-> obj data)) 63)))) - obj + (set! (-> this base) (the pointer (logand -64 (+ (the uint (-> this data)) 63)))) + this ) ) @@ -77,34 +79,34 @@ (defmethod new rpc-buffer-pair ((allocation symbol) (type-to-make type) (elt-size uint) (elt-count uint) (rpc-port int)) "Create a new rpc-buffer-pair" - (let ((obj (object-new allocation type-to-make))) - (set! (-> obj buffer 0) (new 'global 'rpc-buffer elt-size elt-count)) - (set! (-> obj buffer 1) (new 'global 'rpc-buffer elt-size elt-count)) - (set! (-> obj current) (-> obj buffer 0)) - (set! (-> obj last-recv-buffer) (the pointer #f)) - (set! (-> obj rpc-port) rpc-port) - obj + (let ((this (object-new allocation type-to-make))) + (set! (-> this buffer 0) (new 'global 'rpc-buffer elt-size elt-count)) + (set! (-> this buffer 1) (new 'global 'rpc-buffer elt-size elt-count)) + (set! (-> this current) (-> this buffer 0)) + (set! (-> this last-recv-buffer) (the pointer #f)) + (set! (-> this rpc-port) rpc-port) + this ) ) ;; method 12 -(defmethod sync rpc-buffer-pair ((obj rpc-buffer-pair) (print-stall-warning symbol)) +(defmethod sync rpc-buffer-pair ((this rpc-buffer-pair) (print-stall-warning symbol)) "Wait for the in progress RPC to complete." - (let ((active-buffer (if (= (-> obj buffer 0) (-> obj current)) - (-> obj buffer 1) - (-> obj buffer 0)) + (let ((active-buffer (if (= (-> this buffer 0) (-> this current)) + (-> this buffer 1) + (-> this buffer 0)) ) ) (when (-> active-buffer busy) ;; the flag is set, meaning we should check. (cond - ((!= 0 (rpc-busy? (-> obj rpc-port))) + ((!= 0 (rpc-busy? (-> this rpc-port))) ;; we're busy (if print-stall-warning - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) ) - (while (!= 0 (rpc-busy? (-> obj rpc-port))) + (while (!= 0 (rpc-busy? (-> this rpc-port))) ;; real game has a bunch of nops (+ 1 2 3) ) @@ -122,14 +124,14 @@ ) ;; method 13 -(defmethod check-busy rpc-buffer-pair ((obj rpc-buffer-pair)) +(defmethod check-busy rpc-buffer-pair ((this rpc-buffer-pair)) "Is the currently running RPC still busy?" - (let ((active-buffer (if (= (-> obj buffer 0) (-> obj current)) - (-> obj buffer 1) - (-> obj buffer 0) + (let ((active-buffer (if (= (-> this buffer 0) (-> this current)) + (-> this buffer 1) + (-> this buffer 0) ))) (when (-> active-buffer busy) - (if (!= 0 (rpc-busy? (-> obj rpc-port))) + (if (!= 0 (rpc-busy? (-> this rpc-port))) (return-from #f #t) ) (set! (-> active-buffer busy) #f) @@ -141,23 +143,23 @@ ;; method 9 -(defmethod call rpc-buffer-pair ((obj rpc-buffer-pair) (fno uint) (recv-buff pointer) (recv-size uint)) +(defmethod call rpc-buffer-pair ((this rpc-buffer-pair) (fno uint) (recv-buff pointer) (recv-size uint)) "Call an RPC. This is an async RPC. Use check-busy or sync to see if it's done." - (when (!= 0 (-> obj current elt-used)) + (when (!= 0 (-> this current elt-used)) ;; when we have used elements - ;; (format 0 "call rpc-buffer-pair with ~D elts~%" (-> obj current elt-used)) + ;; (format 0 "call rpc-buffer-pair with ~D elts~%" (-> this current elt-used)) ;; make sure the previous buffer is done - (let ((active-buffer (if (= (-> obj buffer 0) (-> obj current)) - (-> obj buffer 1) - (-> obj buffer 0)))) + (let ((active-buffer (if (= (-> this buffer 0) (-> this current)) + (-> this buffer 1) + (-> this buffer 0)))) (when (-> active-buffer busy) ;; we think the active buffer may be busy. ;; first lets just do a simple check - (when (!= 0 (rpc-busy? (-> obj rpc-port))) + (when (!= 0 (rpc-busy? (-> this rpc-port))) ;; busy! print an error and stall! - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) - (while (!= 0 (rpc-busy? (-> obj rpc-port))) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) + (while (!= 0 (rpc-busy? (-> this rpc-port))) (+ 1 2 3) ) ) @@ -166,10 +168,10 @@ (set! (-> active-buffer elt-used) 0) ) ;; now we've cleared the last RPC call, we can do another - (let ((current-buffer (-> obj current))) + (let ((current-buffer (-> this current))) ;; rpc_channel, fno, async, send_buff, send_size, recv_buff, recv_size ;; (format 0 "recv-size is ~D~%" recv-size) - (rpc-call (-> obj rpc-port) + (rpc-call (-> this rpc-port) fno (the uint 1) (the uint (-> current-buffer base)) @@ -178,8 +180,8 @@ (the int recv-size) ) (set! (-> current-buffer busy) #t) - (set! (-> obj last-recv-buffer) recv-buff) - (set! (-> obj current) active-buffer) + (set! (-> this last-recv-buffer) recv-buff) + (set! (-> this current) active-buffer) ) ) ) @@ -188,33 +190,33 @@ ;; method 14 -(defmethod pop-last-received rpc-buffer-pair ((obj rpc-buffer-pair)) - (let ((result (-> obj last-recv-buffer))) - (set! (-> obj last-recv-buffer) (the pointer #f)) +(defmethod pop-last-received rpc-buffer-pair ((this rpc-buffer-pair)) + (let ((result (-> this last-recv-buffer))) + (set! (-> this last-recv-buffer) (the pointer #f)) result ) ) ;; method 10 -(defmethod add-element rpc-buffer-pair ((obj rpc-buffer-pair)) +(defmethod add-element rpc-buffer-pair ((this rpc-buffer-pair)) "Add an element, and return a pointer to the element. If we are out of elements, flush by doing an RPC call. DANGER: this uses all arguments of 0. If you want something else, flush it yourself. If we're RPC 0 and we do this auto-flush, print a warning. " - (let ((current-buffer (-> obj current))) + (let ((current-buffer (-> this current))) (when (= (-> current-buffer elt-count) (-> current-buffer elt-used)) ;; oops, we're full. - (when (= 0 (-> obj rpc-port)) + (when (= 0 (-> this rpc-port)) ;; if we're RPC 0, this is evidently a situation to warn about. (format 0 "WARNING: too many sound commands queued~%") ;;(sound-buffer-dump) ) ;; otherwise we just flush ;; seems kinda dangerous. these could be the wrong parameters... - (call obj (the uint 0) (the pointer 0) (the uint 0)) + (call this (the uint 0) (the pointer 0) (the uint 0)) ;; update the current-buffer. - (set! current-buffer (-> obj current)) + (set! current-buffer (-> this current)) ) (let ((result (&+ (-> current-buffer base) (* (-> current-buffer elt-size) (-> current-buffer elt-used))))) (+! (-> current-buffer elt-used) 1) @@ -225,10 +227,10 @@ ;; method 11 -(defmethod decrement-elt-used rpc-buffer-pair ((obj rpc-buffer-pair)) +(defmethod decrement-elt-used rpc-buffer-pair ((this rpc-buffer-pair)) "If elt-used > 0, decrease it by one." - (when (> (-> obj current elt-used) 0) - (-! (-> obj current elt-used) 1) + (when (> (-> this current elt-used) 0) + (-! (-> this current elt-used) 1) ) 0 ) diff --git a/goal_src/jak1/engine/ps2/timer-h.gc b/goal_src/jak1/engine/ps2/timer-h.gc index 40606dfd72..40c2b065ad 100644 --- a/goal_src/jak1/engine/ps2/timer-h.gc +++ b/goal_src/jak1/engine/ps2/timer-h.gc @@ -48,6 +48,9 @@ (busclk/256 2) (hblank 3) ) + +;; DECOMP BEGINS + ;; this matches the Tn_MODE register structure of the ps2 EE timers. ;; Only the lower 32 bits of these registers are usable, and the upper 16 hardwired to zero (deftype timer-mode (uint32) @@ -142,14 +145,14 @@ :flag-assert #x90000000c ) -(defmethod inspect profile-frame ((obj profile-frame)) - (let ((this-frame obj)) +(defmethod inspect profile-frame ((this profile-frame)) + (let ((this-frame this)) (format #t "[~8x] profile-frame~%" this-frame) (format #t "~Tname: ~A~%" (-> this-frame name)) (format #t "~Ttime-stamp: ~D~%" (-> this-frame time-stamp)) (format #t "~Tcolor: ~D ~D ~D~%" (-> this-frame color r) (-> this-frame color g) (-> this-frame color b)) ) - obj + this ) ;; A "bar" to display all the timed events @@ -183,8 +186,7 @@ ) ;; tentative name -(defmethod get-last-frame-time-stamp profile-bar ((obj profile-bar)) +(defmethod get-last-frame-time-stamp profile-bar ((this profile-bar)) "Returns the timestamp of the last (non-remaining) frame on the profiler bar." - (-> obj data (+ (-> obj profile-frame-count) -2) time-stamp) + (-> this data (+ (-> this profile-frame-count) -2) time-stamp) ) - diff --git a/goal_src/jak1/engine/ps2/vif-h.gc b/goal_src/jak1/engine/ps2/vif-h.gc index b810a62c76..d6555546ed 100644 --- a/goal_src/jak1/engine/ps2/vif-h.gc +++ b/goal_src/jak1/engine/ps2/vif-h.gc @@ -12,6 +12,8 @@ ;; (during gameplay, everything is synchronized by DMA, so code generally does not know when ;; it is safe to mess with VIF registers.) +;; DECOMP BEGINS + ;;VIF0_STAT or VIF1_STAT bitfields (deftype vif-stat (uint32) ((vps uint8 :offset 0 :size 2) @@ -31,18 +33,18 @@ :flag-assert #x900000004 ) -(defmethod inspect vif-stat ((obj vif-stat)) - (format #t "~Tvps: ~D" (-> obj vps)) - (format #t "~Tvew: ~D" (-> obj vew)) - (format #t "~Tmrk: ~D" (-> obj mrk)) - (format #t "~Tvss: ~D" (-> obj vss)) - (format #t "~Tvfs: ~D" (-> obj vfs)) - (format #t "~Tvis: ~D" (-> obj vis)) - (format #t "~Tint: ~D" (-> obj int)) - (format #t "~Ter0: ~D" (-> obj er0)) - (format #t "~Ter1: ~D" (-> obj er1)) - (format #t "~Tfqc: ~D" (-> obj fqc)) - obj) +(defmethod inspect vif-stat ((this vif-stat)) + (format #t "~Tvps: ~D" (-> this vps)) + (format #t "~Tvew: ~D" (-> this vew)) + (format #t "~Tmrk: ~D" (-> this mrk)) + (format #t "~Tvss: ~D" (-> this vss)) + (format #t "~Tvfs: ~D" (-> this vfs)) + (format #t "~Tvis: ~D" (-> this vis)) + (format #t "~Tint: ~D" (-> this int)) + (format #t "~Ter0: ~D" (-> this er0)) + (format #t "~Ter1: ~D" (-> this er1)) + (format #t "~Tfqc: ~D" (-> this fqc)) + this) ;; VIF "reset" register. (deftype vif-fbrst (uint32) diff --git a/goal_src/jak1/engine/sound/gsound-h.gc b/goal_src/jak1/engine/sound/gsound-h.gc index 12654066f6..f7e25a3e0b 100644 --- a/goal_src/jak1/engine/sound/gsound-h.gc +++ b/goal_src/jak1/engine/sound/gsound-h.gc @@ -10,6 +10,8 @@ ;; The EE sends commands using the IOP RPC system to the OVERLORD IOP driver telling it to load and play sounds. ;; There is also some sort of per-frame status update, that is not included here. +;; DECOMP BEGINS + (defenum sound-group :bitfield #t :type uint8 diff --git a/goal_src/jak1/engine/sound/gsound.gc b/goal_src/jak1/engine/sound/gsound.gc index 6af3df7a30..3f958be80c 100644 --- a/goal_src/jak1/engine/sound/gsound.gc +++ b/goal_src/jak1/engine/sound/gsound.gc @@ -5,8 +5,10 @@ ;; name in dgo: gsound ;; dgos: GAME, ENGINE +;; DECOMP BEGINS + ;; The sound playback stuff is all on the IOP so we use IOP RPCs to control it. -;; Ther is a "player" that plays sound effects, and a "loader" that takes care of loading banks. +;; There is a "player" that plays sound effects, and a "loader" that takes care of loading banks. (define *sound-player-rpc* (new 'global 'rpc-buffer-pair (the uint (size-of sound-rpc-union)) (the-as uint 128) RPC-SOUND-PLAYER)) (define *sound-loader-rpc* (new 'global 'rpc-buffer-pair (the uint (size-of sound-rpc-union)) (the-as uint 1) RPC-SOUND-LOADER)) @@ -576,33 +578,33 @@ (cond ((or spec (nonzero? name)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj spec) spec) - (set! (-> obj name) name) - (set! (-> obj playing-id) (new-sound-id)) - (set! (-> obj params) (the-as (pointer float) params)) - (set! (-> obj param-count) param-count) - (set! (-> obj entity) #f) - (set! (-> obj sound-count) 1) - (set! (-> obj volume) 1024) - (set! (-> obj pitch) 0) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this spec) spec) + (set! (-> this name) name) + (set! (-> this playing-id) (new-sound-id)) + (set! (-> this params) (the-as (pointer float) params)) + (set! (-> this param-count) param-count) + (set! (-> this entity) #f) + (set! (-> this sound-count) 1) + (set! (-> this volume) 1024) + (set! (-> this pitch) 0) (when (and spec (!= spec *ambient-spec*)) (if (logtest? (-> spec mask) (sound-mask volume)) - (set! (-> obj volume) (-> spec volume))) + (set! (-> this volume) (-> spec volume))) (if (logtest? (-> spec mask) (sound-mask pitch)) - (set! (-> obj pitch) (-> spec pitch-mod))) + (set! (-> this pitch) (-> spec pitch-mod))) ) (cond (sound-times - (set! (-> obj time-base) (the int (* 300.0 (-> sound-times 0)))) - (set! (-> obj time-random) (the int (* 300.0 (-> sound-times 1)))) + (set! (-> this time-base) (the int (* 300.0 (-> sound-times 0)))) + (set! (-> this time-random) (the int (* 300.0 (-> sound-times 1)))) ) (else - (set! (-> obj time-base) -1) + (set! (-> this time-base) -1) ) ) - (set! (-> obj trans quad) (-> sound-trans quad)) - obj + (set! (-> this trans quad) (-> sound-trans quad)) + this ) ) (else @@ -614,42 +616,42 @@ (define-extern *debug-effect-control* symbol) -(defmethod update! ambient-sound ((obj ambient-sound)) +(defmethod update! ambient-sound ((this ambient-sound)) "Called once per frame to update the sound playback" (if (not *ambient-sound-class*) (return (the int #f)) ) (cond - ((-> obj spec) - (when (or (< (-> obj time-base) 0) - (>= (-> *display* base-frame-counter) (-> obj play-time)) + ((-> this spec) + (when (or (< (-> this time-base) 0) + (>= (-> *display* base-frame-counter) (-> this play-time)) ) - (when (>= (-> obj time-base) 0) - (set! (-> obj play-time) (+ (-> *display* base-frame-counter) - (-> obj time-base) - (rand-vu-int-count (-> obj time-random)) + (when (>= (-> this time-base) 0) + (set! (-> this play-time) (+ (-> *display* base-frame-counter) + (-> this time-base) + (rand-vu-int-count (-> this time-random)) )) - (set! (-> obj playing-id) (new-sound-id)) + (set! (-> this playing-id) (new-sound-id)) ) - (let ((spec (-> obj spec))) + (let ((spec (-> this spec))) (when (= spec *ambient-spec*) - (set! (-> spec volume) (-> obj volume)) - (set! (-> spec pitch-mod) (-> obj pitch)) + (set! (-> spec volume) (-> this volume)) + (set! (-> spec pitch-mod) (-> this pitch)) (set! (-> spec bend) 0) - (set! (-> spec sound-name) (-> obj name)) - (set! (-> spec fo-max) (-> obj falloff-far)) + (set! (-> spec sound-name) (-> this name)) + (set! (-> spec fo-max) (-> this falloff-far)) (set! (-> spec mask) (sound-mask)) - (if (-> obj params) - (effect-param->sound-spec spec (-> obj params) (-> obj param-count)) + (if (-> this params) + (effect-param->sound-spec spec (-> this params) (-> this param-count)) ) ) (if (and (nonzero? (-> spec fo-max)) (< (* 4096.0 (the float (-> spec fo-max))) - (vector-vector-distance (ear-trans) (-> obj trans)))) + (vector-vector-distance (ear-trans) (-> this trans)))) (return 0) ) - (when (and *debug-effect-control* (>= (-> obj time-base) 0)) + (when (and *debug-effect-control* (>= (-> this time-base) 0)) (with-pp (format #t "(~5D) effect sound ~A ~G " (-> *display* base-frame-counter) @@ -661,8 +663,8 @@ ) ) (let ((spec-volume (-> spec volume))) - (set! (-> spec volume) (-> obj volume)) - (set! (-> obj playing-id) (sound-play-by-spec spec (-> obj playing-id) (-> obj trans))) + (set! (-> spec volume) (-> this volume)) + (set! (-> this playing-id) (sound-play-by-spec spec (-> this playing-id) (-> this trans))) (set! (-> spec volume) spec-volume) ) ) @@ -670,29 +672,29 @@ ) (else (cond - ((< (-> obj time-base) 0) - (set! (-> obj playing-id) (sound-play-by-name - (-> obj name) - (-> obj playing-id) - (-> obj volume) - (-> obj pitch) + ((< (-> this time-base) 0) + (set! (-> this playing-id) (sound-play-by-name + (-> this name) + (-> this playing-id) + (-> this volume) + (-> this pitch) 0 (sound-group sfx) - (the-as symbol (-> obj trans)))) + (the-as symbol (-> this trans)))) ) (else - (when (>= (-> *display* base-frame-counter) (-> obj play-time)) - (set! (-> obj playing-id) (sound-play-by-name - (-> obj name) + (when (>= (-> *display* base-frame-counter) (-> this play-time)) + (set! (-> this playing-id) (sound-play-by-name + (-> this name) (new-sound-id) - (-> obj volume) - (-> obj pitch) + (-> this volume) + (-> this pitch) 0 (sound-group sfx) - (the-as symbol (-> obj trans)))) - (set! (-> obj play-time) (+ (-> *display* base-frame-counter) - (-> obj time-base) - (rand-vu-int-count (-> obj time-random)) + (the-as symbol (-> this trans)))) + (set! (-> this play-time) (+ (-> *display* base-frame-counter) + (-> this time-base) + (rand-vu-int-count (-> this time-random)) )) ) ) @@ -702,21 +704,21 @@ 0 ) -(defmethod stop! ambient-sound ((obj ambient-sound)) +(defmethod stop! ambient-sound ((this ambient-sound)) "Halt playback of this ambient-sound" - (sound-stop (-> obj playing-id)) + (sound-stop (-> this playing-id)) 0 ) -(defmethod update-trans! ambient-sound ((obj ambient-sound) (sound-trans vector)) +(defmethod update-trans! ambient-sound ((this ambient-sound) (sound-trans vector)) "Update the position of the thing playing the sound" - (set! (-> obj trans quad) (-> sound-trans quad)) - (when (nonzero? (-> obj playing-id)) + (set! (-> this trans quad) (-> sound-trans quad)) + (when (nonzero? (-> this playing-id)) (let ((cmd (the sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command set-param)) - (set! (-> cmd id) (-> obj playing-id)) + (set! (-> cmd id) (-> this playing-id)) (sound-trans-from-process cmd sound-trans) @@ -727,28 +729,28 @@ 0 ) -(defmethod update-vol! ambient-sound ((obj ambient-sound) (arg0 int)) +(defmethod update-vol! ambient-sound ((this ambient-sound) (arg0 int)) "Update the volume of the sound" - (when (nonzero? (-> obj playing-id)) + (when (nonzero? (-> this playing-id)) (let ((cmd (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command set-param)) - (set! (-> cmd id) (-> obj playing-id)) + (set! (-> cmd id) (-> this playing-id)) (set! (-> cmd parms volume) (the int (* 10.24 (the float arg0)))) (set! (-> cmd parms mask) (sound-mask volume)) (-> cmd id) ) ) - (set! (-> obj volume) (the int (* 10.24 (the float arg0)))) + (set! (-> this volume) (the int (* 10.24 (the float arg0)))) 0 ) -(defmethod change-sound! ambient-sound ((obj ambient-sound) (name sound-name)) +(defmethod change-sound! ambient-sound ((this ambient-sound) (name sound-name)) "Change the sound being played" - (when (not (sound-name= (-> obj name) name)) - (stop! obj) - (set! (-> obj playing-id) (new-sound-id)) - (set! (-> obj name) name) + (when (not (sound-name= (-> this name) name)) + (stop! this) + (set! (-> this playing-id) (new-sound-id)) + (set! (-> this name) name) ) 0 ) diff --git a/goal_src/jak1/engine/target/collide-reaction-target.gc b/goal_src/jak1/engine/target/collide-reaction-target.gc index 58a00786f9..c33629ea3b 100644 --- a/goal_src/jak1/engine/target/collide-reaction-target.gc +++ b/goal_src/jak1/engine/target/collide-reaction-target.gc @@ -74,7 +74,15 @@ (set! sv-208 (vector+float*! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) sv-160 2867.2)) (set! sv-212 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 dynam gravity-normal) -20480.0)) (vector+float*! sv-212 sv-212 sv-160 4096.0) - (when (>= (probe-using-line-sphere *collide-cache* sv-208 sv-212 409.6 (-> arg1 best-from-prim collide-with) sv-164 (new 'static 'pat-surface :noentity #x1)) + (when (>= (probe-using-line-sphere + *collide-cache* + sv-208 + sv-212 + 409.6 + (-> arg1 best-from-prim collide-with) + sv-164 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (set! (-> arg0 unknown-float-coverage-0) @@ -97,7 +105,15 @@ (set! sv-276 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> arg0 dynam gravity-normal) -20480.0)) (vector+float*! sv-272 sv-272 sv-160 -819.2) (vector+float*! sv-276 sv-276 sv-160 -4096.0) - (when (>= (probe-using-line-sphere *collide-cache* sv-272 sv-276 409.6 (-> arg1 best-from-prim collide-with) sv-164 (new 'static 'pat-surface :noentity #x1)) + (when (>= (probe-using-line-sphere + *collide-cache* + sv-272 + sv-276 + 409.6 + (-> arg1 best-from-prim collide-with) + sv-164 + (new 'static 'pat-surface :noentity #x1) + ) 0.0 ) (set! (-> arg0 unknown-float-coverage-2) (vector-vector-distance sv-272 (-> sv-164 intersect))) @@ -105,7 +121,7 @@ (set! (-> arg0 unknown-vector-coverage-1 quad) (-> sv-164 normal quad)) 0 ) - (when (and (zero? (logand sv-32 512)) + (when (and (not (logtest? sv-32 512)) (and (or (< (* 1.25 (-> arg1 best-from-prim local-sphere w)) (-> arg0 unknown-float-coverage-0)) (= (shr (shl (the-as int (-> arg0 unknown-float-coverage-1)) 58) 61) 1) ) @@ -115,9 +131,9 @@ ) ) (set! sv-32 (logior sv-32 128)) - (set! (-> arg0 unknown-dword-coverage) (the-as int (-> *display* base-frame-counter))) + (set! (-> arg0 unknown-dword-coverage) (the-as int (current-time))) (set! sv-40 (logior sv-40 128)) - (set! (-> arg0 unknown-dword21) (-> *display* base-frame-counter)) + (set-time! (-> arg0 unknown-dword21)) (let ((f30-0 (vector-dot sv-52 (-> arg0 unknown-vector22))) (f0-21 (if (logtest? sv-32 2) (cos (- 16384.0 (acos (-> arg0 coverage)))) @@ -130,7 +146,7 @@ ) ) ) - (if (or (zero? (logand sv-32 32)) (< 0.5 f0-21)) + (if (or (not (logtest? sv-32 32)) (< 0.5 f0-21)) (set! sv-48 (the-as symbol #f)) ) (when (and (or (and (< f0-21 0.95) (>= f30-0 0.0)) @@ -161,17 +177,17 @@ (< 0.3 (fabs (-> arg0 surface-angle))) ) ) - (zero? (logand sv-32 128)) + (not (logtest? sv-32 128)) ) (set! sv-32 (logior sv-32 64)) (set! sv-40 (logior sv-40 128)) - (set! (-> arg0 unknown-dword21) (-> *display* base-frame-counter)) + (set-time! (-> arg0 unknown-dword21)) (set! sv-48 (the-as symbol #f)) ) (#t (set! sv-32 (logior sv-32 64)) (set! sv-40 (logior sv-40 128)) - (set! (-> arg0 unknown-dword21) (-> *display* base-frame-counter)) + (set-time! (-> arg0 unknown-dword21)) ) ) ) @@ -251,7 +267,7 @@ (& sv-160) ) ) - (when (zero? (logand (-> arg0 prev-status) (cshape-moving-flags onsurf))) + (when (not (logtest? (-> arg0 prev-status) (cshape-moving-flags onsurf))) (set! (-> arg0 ground-impact-vel) (- (vector-dot (-> arg0 transv) (-> arg0 dynam gravity-normal)))) (set! sv-96 (logior sv-96 2048)) (when (not sv-160) @@ -321,8 +337,8 @@ ) ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) - (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) - (zero? (logand sv-104 32)) + (not (time-elapsed? (-> arg0 unknown-dword10) (seconds 0.3))) + (not (logtest? sv-104 32)) ) ) ) @@ -352,7 +368,7 @@ (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) (set! (-> arg0 unknown-vector53 quad) (-> sv-84 quad)) (set! (-> arg0 unknown-float60) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) - (set! (-> arg0 unknown-dword10) (-> *display* base-frame-counter)) + (set-time! (-> arg0 unknown-dword10)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) (set! (-> arg0 ground-touch-point quad) (-> arg1 best-tri intersect quad)) (set! (-> arg0 unknown-vector55 quad) (-> arg1 best-from-prim prim-core world-sphere quad)) @@ -388,7 +404,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak1/engine/target/logic-target.gc b/goal_src/jak1/engine/target/logic-target.gc index f7619f7f97..201dcb1aa3 100644 --- a/goal_src/jak1/engine/target/logic-target.gc +++ b/goal_src/jak1/engine/target/logic-target.gc @@ -455,7 +455,7 @@ arg1 "~0ky:~,,2M t:~d cy: ~,,2M my: ~,,2M impv:~,,2M " (-> arg0 control unknown-vector52 y) - (- (-> *display* base-frame-counter) (-> arg0 control unknown-dword11)) + (- (current-time) (-> arg0 control unknown-dword11)) (- (-> arg0 control trans y) (-> arg0 control unknown-vector52 y)) (- (-> arg0 control unknown-vector111 y) (-> arg0 control unknown-vector110 y)) (-> arg0 control ground-impact-vel) @@ -553,14 +553,14 @@ (set! (-> self control unknown-int10) a0-3) (set! (-> self control unknown-float100) f1-1) (if (logtest? (-> self control unknown-surface01 flags) (surface-flags no-turn-around)) - (set! (-> v1-6 0) (the-as uint (-> *display* base-frame-counter))) + (set! (-> v1-6 0) (the-as uint (current-time))) ) - (and (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> v1-6 0)))) (the-as uint 300)) + (and (time-elapsed? (the-as int (-> v1-6 0)) (seconds 1)) (< f0-1 0.0) (< 32768.0 f1-1) (< 0.7 (-> self control unknown-float20)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) (seconds 0.3)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) (seconds 0.3)) + (time-elapsed? (-> self control unknown-dword20) (seconds 0.3)) + (time-elapsed? (-> self control unknown-dword21) (seconds 0.3)) (logtest? (-> self control status) (cshape-moving-flags onsurf)) (and (< 0.7 (-> self control surface-angle)) #t) ) @@ -577,7 +577,7 @@ (let* ((v1-0 127) (a1-6 (-> self control history-data (logand (+ (-> self control unknown-halfword00) v1-0) 127))) ) - (while (and (< (- (-> *display* base-frame-counter) (-> a1-6 time)) arg0) (> v1-0 0)) + (while (and (not (time-elapsed? (-> a1-6 time) arg0)) (> v1-0 0)) (vector+! s5-0 s5-0 (-> a1-6 trans)) (+! gp-0 1) (+! v1-0 -1) @@ -743,7 +743,7 @@ (set! (-> s3-3 z) (fmax 0.0 (fmin (-> s3-3 z) (-> s4-0 z)))) ) (if (< 0.2 (-> self control unknown-float70)) - (vector-seek! s3-3 s4-0 (* 122880.0 (-> *display* seconds-per-frame))) + (vector-seek! s3-3 s4-0 (* 122880.0 (seconds-per-frame))) ) (vector-matrix*! s2-3 s3-3 (-> self control unknown-matrix01)) (let ((f28-2 (vector-vector-xz-distance s3-3 s4-0))) @@ -773,9 +773,9 @@ ) ) ) - (set! (-> self control unknown-dword70) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword70)) ) - (if (< (- (-> *display* base-frame-counter) (-> self control unknown-dword70)) (seconds 0.2)) + (if (not (time-elapsed? (-> self control unknown-dword70) (seconds 0.2))) (set! f30-4 (+ 204800.0 f30-4)) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags twall))) @@ -788,7 +788,7 @@ (set! (-> gp-0 z) 0.0) ) (let ((s4-2 (vector-! (new-stack-vector0) s5-0 gp-0))) - (let ((f30-5 (* f30-4 (-> *display* seconds-per-frame)))) + (let ((f30-5 (* f30-4 (seconds-per-frame)))) (set! (-> s4-2 y) 0.0) (if (< f30-5 (vector-xz-length s4-2)) (vector-xz-normalize! s4-2 f30-5) @@ -899,10 +899,10 @@ (s5-0 (if (and (or (not (logtest? (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags onsurf tsurf)) ) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) (seconds 0.5)) + (not (time-elapsed? (-> self control unknown-dword20) (seconds 0.5))) (!= (-> self next-state name) 'target-walk) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) (seconds 0.5)) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) + (not (time-elapsed? (-> self control unknown-dword21) (seconds 0.5))) (logtest? (-> self control unknown-surface01 flags) (surface-flags no-rotate-toward-transv)) (!= (-> self control unknown-float41) 0.0) ) @@ -917,7 +917,7 @@ (s4-0 (forward-up-nopitch->quaternion (new-stack-quaternion0) gp-0 s3-0)) (s3-1 (forward-up-nopitch->quaternion (new-stack-quaternion0) s5-0 s3-0)) (f0-2 (acos (vector-dot gp-0 s5-0))) - (f1-2 (* (-> self control unknown-surface01 turnvv) (-> *display* seconds-per-frame))) + (f1-2 (* (-> self control unknown-surface01 turnvv) (seconds-per-frame))) ) (quaternion-slerp! (-> self control dir-targ) s4-0 s3-1 (cond ((>= 0.0 (-> self control unknown-float12)) @@ -977,7 +977,7 @@ (set! (-> self current-level) (level-get-target-inside *level*)) (if (and (-> self current-level) (>= (-> *level-task-data-remap* length) (-> self current-level info index))) (+! (-> *game-info* in-level-time (-> *level-task-data-remap* (+ (-> self current-level info index) -1))) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) + (- (current-time) (-> *display* old-base-frame-counter)) ) ) (if (and (or (not gp-0) (!= (-> gp-0 name) (-> self current-level name))) (-> self current-level)) @@ -994,7 +994,7 @@ ((-> self control unknown-surface01 active-hook)) (cond ((logtest? (-> self control status) (cshape-moving-flags onsurf)) - (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword11)) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (if (and (>= (-> self control coverage) 1.0) (not (logtest? (-> self control status) (cshape-moving-flags t-act on-water))) @@ -1034,7 +1034,7 @@ ) ) (-> *setting-control* current allow-look-around) - (>= (- (-> *display* base-frame-counter) (-> self no-look-around-wait)) (seconds 0.05)) + (time-elapsed? (-> self no-look-around-wait) (seconds 0.05)) (not (and (= (-> self control ground-pat material) (pat-material ice)) (< 4096.0 (-> self control unknown-float01)) ) @@ -1115,7 +1115,7 @@ ) ) (let ((v1-146 (-> self current-level))) - (if (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 2)) + (if (and (time-elapsed? (-> self control unknown-dword11) (seconds 2)) (and v1-146 (< (-> self control trans y) (-> v1-146 info bottom-height)) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) @@ -1130,15 +1130,15 @@ (defbehavior post-flag-setup target () (if (logtest? (-> self control status) (cshape-moving-flags twall t-act)) - (set! (-> self control unknown-dword20) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword20)) ) (when (logtest? (-> self state-flags) (state-flags timed-invulnerable)) ;; og:preserve-this changed for high fps. This fixes the flicker speed when damaged - (if (< (logand (- (-> *display* base-frame-counter) (-> self control unknown-dword80)) 3) (/ 1.0 (-> *display* time-adjust-ratio))) + (if (< (logand (- (current-time) (-> self control unknown-dword80)) 3) (/ 1.0 (-> *display* time-adjust-ratio))) (logior! (-> self draw status) (draw-status hidden)) (logclear! (-> self draw status) (draw-status hidden)) ) - (if (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword80)) (-> self control unknown-dword81)) + (if (time-elapsed? (-> self control unknown-dword80) (-> self control unknown-dword81)) (target-timed-invulnerable-off self) ) ) @@ -1162,11 +1162,7 @@ ) ) ) - (seek! - (-> self control unknown-float80) - f0-2 - (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) - ) + (seek! (-> self control unknown-float80) f0-2 (* (-> self control unknown-float82) (seconds-per-frame))) ) (vector-deg-slerp (-> self control dynam gravity-normal) @@ -1249,14 +1245,14 @@ (set! (-> self control unknown-float110) (vector-length s4-1)) (cond ((and (< 819.2 (-> self control unknown-float110)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword40)) (seconds 0.2)) + (time-elapsed? (-> self control unknown-dword40) (seconds 0.2)) ) (vector-normalize! s4-1 1228.8) (move-by-vector! (-> self control) s4-1) (vector-float*! (-> self control rider-last-move) s4-1 (-> *display* frames-per-second)) - (set! (-> self control rider-time) (-> *display* base-frame-counter)) - (if (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword41)) (seconds 0.5)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword40)) (seconds 0.5)) + (set-time! (-> self control rider-time)) + (if (and (time-elapsed? (-> self control unknown-dword41) (seconds 0.5)) + (time-elapsed? (-> self control unknown-dword40) (seconds 0.5)) ) (send-event self 'end-mode) ) @@ -1265,12 +1261,12 @@ (let ((a1-6 (new 'stack-no-clear 'vector))) (vector-! a1-6 (-> s5-0 center-hold) (-> self control unknown-vector91)) (vector-float*! (-> self control rider-last-move) s4-1 (-> *display* frames-per-second)) - (set! (-> self control rider-time) (-> *display* base-frame-counter)) + (set-time! (-> self control rider-time)) (move-to-point! (-> self control) a1-6) ) (set! (-> self control unknown-float110) 0.0) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) - (set! (-> self control unknown-dword40) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword40)) ) ) ) @@ -1301,7 +1297,7 @@ ) (let ((a1-7 (vector-! (new-stack-vector0) (-> gp-0 center-hold) (-> gp-0 center-hold-old)))) (vector-float*! (-> self control rider-last-move) a1-7 (-> *display* frames-per-second)) - (set! (-> self control rider-time) (-> *display* base-frame-counter)) + (set-time! (-> self control rider-time)) (move-by-vector! (-> self control) a1-7) ) ) @@ -1909,7 +1905,7 @@ (set! (-> self control unknown-vector02 quad) (-> self control unknown-dynamics00 gravity-normal quad)) (quaternion-identity! (-> self control unknown-quaternion01)) (set! (-> self control unknown-float00) 0.0) - (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword11)) (set! (-> self control unknown-float80) 0.0) (set! (-> self control unknown-float82) 32.0) (set! (-> self cam-user-mode) 'normal) @@ -2043,9 +2039,9 @@ (none) ) -(defmethod deactivate target ((obj target)) +(defmethod deactivate target ((this target)) (set-zero! *camera-smush-control*) - ((the-as (function process-drawable none) (find-parent-method target 10)) obj) + ((the-as (function process-drawable none) (find-parent-method target 10)) this) (none) ) diff --git a/goal_src/jak1/engine/target/target-death.gc b/goal_src/jak1/engine/target/target-death.gc index 9d41b4c4e9..b90e042484 100644 --- a/goal_src/jak1/engine/target/target-death.gc +++ b/goal_src/jak1/engine/target/target-death.gc @@ -57,7 +57,7 @@ (remove-setting! 'music) ) :code (behavior ((arg0 continue-point)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (-> *art-control* reserve-buffer) (reserve-free *art-control* (-> *art-control* reserve-buffer heap)) ) @@ -255,8 +255,8 @@ ) ) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 2)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) @@ -264,7 +264,7 @@ (suspend) (set! v1-10 (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed)))) ) - (set! (-> *cpad-list* cpads 0 change-time) (-> *display* base-frame-counter)) + (set-time! (-> *cpad-list* cpads 0 change-time)) (reset-actors 'dead) (start 'play (get-continue-by-name *game-info* "misty-start")) ) @@ -431,8 +431,8 @@ ) ) (else - (let ((s5-7 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-7) (seconds 0.05)) + (let ((s5-7 (current-time))) + (until (time-elapsed? s5-7 (seconds 0.05)) (suspend) ) ) @@ -593,6 +593,7 @@ ) (case (-> arg0 mode) (('burn 'burnup) + ;; og:preserve-this (if (not (handle->process (-> self burn-proc))) (set! (-> self burn-proc) (ppointer->handle (process-spawn-function process process-drawable-burn-effect (seconds 4) :to self)) @@ -619,9 +620,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -642,9 +641,7 @@ ) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (the-as time-frame (-> *TARGET-bank* stuck-time)) - ) + (and (time-elapsed? (-> self state-time) (the-as time-frame (-> *TARGET-bank* stuck-time))) (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) ) @@ -772,7 +769,7 @@ #t (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (ja-group) data 0 length) -1)) (ja-step 0)))))) (until v1-40 - (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) + (+! f30-1 (* (-> arg0 shove-back) f28-1 (seconds-per-frame))) (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) (suspend) (ja :num! (seek!)) @@ -780,7 +777,7 @@ ) (while (and (or (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) s2-1) (!= s2-1 'stuck)) (arg2) - (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) + (+! f30-1 (* (-> arg0 shove-back) f28-1 (seconds-per-frame))) (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) (if (not s2-1) (logclear! (-> self state-flags) (state-flags being-attacked)) @@ -830,7 +827,7 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags wt16)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((v1-4 gp-0)) @@ -876,7 +873,7 @@ (cond ((= arg0 'attack) (logior! (-> self state-flags) (state-flags being-attacked)) - (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('endlessfall) (cond @@ -884,8 +881,8 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-known-safe-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s3-1) (seconds 1)) + (let ((s3-1 (current-time))) + (until (time-elapsed? s3-1 (seconds 1)) (suspend) ) ) @@ -1102,8 +1099,8 @@ (-> self attack-info attacker) (ja-channel-set! 0) (ja-post) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 1)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -1121,7 +1118,7 @@ ) (set! (-> gp-3 frame-group) (the-as art-joint-anim eichar-swim-walk-to-down-ja)) (set! (-> gp-3 param 0) (ja-aframe (the-as float 73.0) 0)) - (let ((f30-1 (seek f30-0 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame))))) + (let ((f30-1 (seek f30-0 (the-as float 0.05) (* 1.5 (seconds-per-frame))))) (set! (-> gp-3 param 1) f30-1) (set! (-> gp-3 frame-num) 0.0) (joint-control-channel-group! gp-3 (the-as art-joint-anim eichar-swim-walk-to-down-ja) num-func-seek!) @@ -1129,7 +1126,7 @@ (suspend) (let ((gp-4 (-> self skel root-channel 0))) (set! (-> gp-4 param 0) (ja-aframe (the-as float 73.0) 0)) - (set! f30-1 (seek f30-1 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame)))) + (set! f30-1 (seek f30-1 (the-as float 0.05) (* 1.5 (seconds-per-frame)))) (set! (-> gp-4 param 1) f30-1) (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) ) @@ -1180,8 +1177,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((gp-9 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-9) (seconds 2)) + (let ((gp-9 (current-time))) + (until (time-elapsed? gp-9 (seconds 2)) (suspend) ) ) @@ -1212,7 +1209,7 @@ (set! (-> self trans-hook) (lambda :behavior target () - (vector-seek! (-> self draw color-mult) *zero-vector* (-> *display* seconds-per-frame)) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) (let ((gp-0 (new-stack-vector0)) (f30-0 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) ) @@ -1242,8 +1239,8 @@ (target-falling-anim (seconds 0.1) (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! eichar-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-12 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-12) (seconds 0.8)) + (let ((gp-12 (current-time))) + (until (time-elapsed? gp-12 (seconds 0.8)) (ja :group! eichar-launch-jump-loop-ja :num! (loop! 0.5)) (suspend) ) @@ -1393,7 +1390,7 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (anim-loop) ) :post target-no-stick-post diff --git a/goal_src/jak1/engine/target/target-handler.gc b/goal_src/jak1/engine/target/target-handler.gc index afc6ae09eb..18024a112e 100644 --- a/goal_src/jak1/engine/target/target-handler.gc +++ b/goal_src/jak1/engine/target/target-handler.gc @@ -66,9 +66,7 @@ (if (and (zero? (-> *game-info* enter-level-time (-> s5-1 index))) (>= (-> *level-task-data-remap* length) (-> s5-1 index)) ) - (set! (-> *game-info* enter-level-time (-> *level-task-data-remap* (+ (-> s5-1 index) -1))) - (-> *display* base-frame-counter) - ) + (set-time! (-> *game-info* enter-level-time (-> *level-task-data-remap* (+ (-> s5-1 index) -1)))) ) ) (send-event (ppointer->process (-> *hud-parts* buzzers)) 'sync) @@ -117,7 +115,7 @@ ) (rot->dir-targ! (-> self control)) (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) - (set! v0-0 (-> *display* base-frame-counter)) + (set! v0-0 (current-time)) (set! (-> self control unknown-dword11) (the-as time-frame v0-0)) v0-0 ) @@ -260,14 +258,12 @@ ) ) (('no-load-wait) - (set! v0-0 (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0)))) + (set! v0-0 (+ (current-time) (the-as time-frame (-> arg3 param 0)))) (set! (-> self no-load-wait) (the-as time-frame v0-0)) v0-0 ) (('no-look-around) - (set! (-> self no-look-around-wait) - (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0))) - ) + (set! (-> self no-look-around-wait) (+ (current-time) (the-as time-frame (-> arg3 param 0)))) (if (= (-> self next-state name) 'target-look-around) (send-event self 'end-mode) ) @@ -771,7 +767,7 @@ (logtest? (-> self control root-prim prim-core action) (collide-action edgegrab-cam swingpole-active racer snowball tube flut) ) - (>= (-> self no-load-wait) (-> *display* base-frame-counter)) + (>= (-> self no-load-wait) (current-time)) ) ) ) diff --git a/goal_src/jak1/engine/target/target-part.gc b/goal_src/jak1/engine/target/target-part.gc index 25493956be..eae56efa88 100644 --- a/goal_src/jak1/engine/target/target-part.gc +++ b/goal_src/jak1/engine/target/target-part.gc @@ -2143,13 +2143,13 @@ (defbehavior process-drawable-burn-effect target ((arg0 time-frame)) (sound-play "get-burned") (let ((s5-1 (new 'stack 'rgbaf)) - (s3-0 (-> *display* base-frame-counter)) + (s3-0 (current-time)) (s4-1 (-> self parent)) ) (set! (-> s5-1 quad) (-> (the-as process-drawable (-> s4-1 0)) draw color-mult quad)) (let ((s2-1 (vector-float*! (the-as vector (new 'stack 'rgbaf)) (the-as vector s5-1) 0.0))) - (while (< (- (-> *display* base-frame-counter) s3-0) arg0) - (let ((v1-8 (- (-> *display* base-frame-counter) s3-0))) + (while (not (time-elapsed? s3-0 arg0)) + (let ((v1-8 (- (current-time) s3-0))) (if (< v1-8 (/ arg0 2)) (vector-lerp! (-> (the-as process-drawable (-> s4-1 0)) draw color-mult) diff --git a/goal_src/jak1/engine/target/target-util.gc b/goal_src/jak1/engine/target/target-util.gc index aafcc0e608..7863997d36 100644 --- a/goal_src/jak1/engine/target/target-util.gc +++ b/goal_src/jak1/engine/target/target-util.gc @@ -9,7 +9,6 @@ ;; DECOMP BEGINS - (defskelgroup *jchar-sg* eichar eichar-lod0-jg -1 ((eichar-lod0-mg (meters 999999))) :bounds (static-spherem 0 2 0 3) @@ -638,8 +637,8 @@ 0 ) -(defmethod get-quaternion control-info ((obj control-info)) - (-> obj unknown-quaternion00) +(defmethod get-quaternion control-info ((this control-info)) + (-> this unknown-quaternion00) ) (defbehavior target-align-vel-z-adjust target ((arg0 float)) @@ -652,23 +651,22 @@ ) ) -(defmethod apply-alignment target ((obj target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment target ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg2 quad)) (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) - (let* ((s3-0 (-> obj control unknown-matrix01)) - (s0-0 (-> obj control unknown-matrix00)) - (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control dynam gravity) s0-0)) - (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control transv) s0-0)) + (let* ((s3-0 (-> this control unknown-matrix01)) + (s0-0 (-> this control unknown-matrix00)) + (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control dynam gravity) s0-0)) + (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control transv) s0-0)) ) (if (logtest? arg0 (align-opts no-gravity)) (set-vector! s1-0 0.0 0.0 0.0 1.0) ) (when (logtest? arg0 (align-opts adjust-x-vel)) - (set! (-> a1-3 x) (+ (* (-> arg1 trans x) (-> s2-0 x) (-> *display* frames-per-second)) - (* (-> s1-0 x) (-> *display* seconds-per-frame)) - ) + (set! (-> a1-3 x) + (+ (* (-> arg1 trans x) (-> s2-0 x) (-> *display* frames-per-second)) (* (-> s1-0 x) (seconds-per-frame))) ) (if (not (logtest? arg0 (align-opts adjust-xz-vel keep-other-velocities))) (set! (-> a1-3 z) 0.0) @@ -677,30 +675,28 @@ (if (and (logtest? arg0 (align-opts adjust-y-vel)) (not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0))) ) - (set! (-> a1-3 y) (+ (* (-> arg1 trans y) (-> s2-0 y) (-> *display* frames-per-second)) - (* (-> s1-0 y) (-> *display* seconds-per-frame)) - ) + (set! (-> a1-3 y) + (+ (* (-> arg1 trans y) (-> s2-0 y) (-> *display* frames-per-second)) (* (-> s1-0 y) (seconds-per-frame))) ) ) (when (logtest? arg0 (align-opts adjust-xz-vel)) - (set! (-> a1-3 z) (+ (* (-> arg1 trans z) (-> s2-0 z) (-> *display* frames-per-second)) - (* (-> s1-0 z) (-> *display* seconds-per-frame)) - ) + (set! (-> a1-3 z) + (+ (* (-> arg1 trans z) (-> s2-0 z) (-> *display* frames-per-second)) (* (-> s1-0 z) (seconds-per-frame))) ) (if (not (logtest? arg0 (align-opts adjust-x-vel keep-other-velocities))) (set! (-> a1-3 x) 0.0) ) ) - (vector-matrix*! (-> obj control transv) a1-3 s3-0) + (vector-matrix*! (-> this control transv) a1-3 s3-0) ) ) ) (if (logtest? arg0 (align-opts adjust-quat)) (quaternion-normalize! - (quaternion*! (-> obj control unknown-quaternion00) (-> obj control unknown-quaternion00) (-> arg1 quat)) + (quaternion*! (-> this control unknown-quaternion00) (-> this control unknown-quaternion00) (-> arg1 quat)) ) ) - (the-as collide-shape (-> obj control)) + (the-as collide-shape (-> this control)) ) (defun average-turn-angle ((arg0 target)) @@ -720,7 +716,7 @@ ) (defbehavior can-play-stance-amibent? target () - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 30)) + (and (time-elapsed? (-> self state-time) (seconds 30)) (not (-> *setting-control* current talking)) (not (-> *setting-control* current spooling)) (not (-> *setting-control* current movie)) @@ -732,7 +728,7 @@ (defbehavior can-jump? target ((arg0 symbol)) (and (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) + (not (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout))) (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (< 0.866 (-> self control surface-angle)) ) @@ -761,7 +757,7 @@ (defbehavior fall-test target () (when (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-15 (ja-group))) (or (not (or (= v1-15 (-> self draw art-group data 59)) @@ -773,7 +769,7 @@ ) ) ) - (when (and (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (-> *TARGET-bank* ground-timeout)) + (when (and (not (time-elapsed? (-> self control rider-time) (-> *TARGET-bank* ground-timeout))) (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground)) ) (+! (-> self control transv x) (-> self control rider-last-move x)) @@ -786,7 +782,7 @@ (defbehavior slide-down-test target () (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf csmf07))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout)) (logtest? (-> self control status) (cshape-moving-flags tsurf)) (< 0.5 (-> self control surface-angle)) ) @@ -868,26 +864,24 @@ ) #f ) - ((and (or (not arg0) - (and (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) - (< (-> self control unknown-float61) 0.7) - ) + ((and (or (not arg0) (and (not (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout))) + (< (-> self control unknown-float61) 0.7) + ) ) - (>= (- (-> *display* base-frame-counter) - (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) - (-> *TARGET-bank* yellow-attack-timeout) - (-> *TARGET-bank* attack-timeout) + (time-elapsed? + (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) + (>= (-> self fact-info-target eco-level) 1.0) ) - ) - (-> self control unknown-dword31) - ) + (-> *TARGET-bank* yellow-attack-timeout) + (-> *TARGET-bank* attack-timeout) + ) + (-> self control unknown-dword31) + ) ) #t ) (else - (set! (-> self control unknown-dword32) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword32)) #f ) ) @@ -900,11 +894,11 @@ ) #f ) - ((>= (- (-> *display* base-frame-counter) (-> *TARGET-bank* attack-timeout)) (-> self control unknown-dword33)) + ((time-elapsed? (-> *TARGET-bank* attack-timeout) (-> self control unknown-dword33)) #t ) (else - (set! (-> self control unknown-dword34) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword34)) #f ) ) @@ -973,7 +967,7 @@ (defun target-timed-invulnerable ((arg0 time-frame) (arg1 target)) (logior! (-> arg1 state-flags) (state-flags timed-invulnerable)) - (set! (-> arg1 control unknown-dword80) (-> *display* base-frame-counter)) + (set-time! (-> arg1 control unknown-dword80)) (set! (-> arg1 control unknown-dword81) arg0) (set-collide-kinds (-> arg1 control) 2 (collide-kind target-attack) (collide-kind)) 0 @@ -988,88 +982,88 @@ (none) ) -(defmethod combine! attack-info ((obj attack-info) (arg0 attack-info)) +(defmethod combine! attack-info ((this attack-info) (arg0 attack-info)) (with-pp (let ((s4-0 (-> arg0 mask))) - (set! (-> obj mask) (-> arg0 mask)) + (set! (-> this mask) (-> arg0 mask)) (if (logtest? s4-0 (attack-mask attacker)) - (set! (-> obj attacker) (-> arg0 attacker)) + (set! (-> this attacker) (-> arg0 attacker)) ) (if (logtest? s4-0 (attack-mask mode)) - (set! (-> obj mode) (-> arg0 mode)) + (set! (-> this mode) (-> arg0 mode)) ) (if (logtest? s4-0 (attack-mask angle)) - (set! (-> obj angle) (-> arg0 angle)) + (set! (-> this angle) (-> arg0 angle)) ) (if (logtest? s4-0 (attack-mask dist)) - (set! (-> obj dist) (-> arg0 dist)) + (set! (-> this dist) (-> arg0 dist)) ) (if (logtest? s4-0 (attack-mask control)) - (set! (-> obj control) (-> arg0 control)) + (set! (-> this control) (-> arg0 control)) ) (if (logtest? s4-0 (attack-mask speed)) - (set! (-> obj speed) (-> arg0 speed)) + (set! (-> this speed) (-> arg0 speed)) ) (if (logtest? s4-0 (attack-mask shove-back)) - (set! (-> obj shove-back) (-> arg0 shove-back)) + (set! (-> this shove-back) (-> arg0 shove-back)) ) (if (logtest? s4-0 (attack-mask shove-up)) - (set! (-> obj shove-up) (-> arg0 shove-up)) + (set! (-> this shove-up) (-> arg0 shove-up)) ) (if (logtest? s4-0 (attack-mask invinc-time)) - (set! (-> obj invinc-time) (-> arg0 invinc-time)) + (set! (-> this invinc-time) (-> arg0 invinc-time)) ) (if (logtest? s4-0 (attack-mask rotate-to)) - (set! (-> obj rotate-to) (-> arg0 rotate-to)) + (set! (-> this rotate-to) (-> arg0 rotate-to)) ) (if (logtest? s4-0 (attack-mask intersection)) - (set! (-> obj intersection quad) (-> arg0 intersection quad)) + (set! (-> this intersection quad) (-> arg0 intersection quad)) ) (cond ((not (logtest? s4-0 (attack-mask vector))) (let* ((s3-0 pp) - (s2-0 (handle->process (-> obj attacker))) + (s2-0 (handle->process (-> this attacker))) (v1-39 (if (and (nonzero? s2-0) (type-type? (-> s2-0 type) process-drawable)) s2-0 ) ) ) (when v1-39 - (set! (-> obj trans quad) (-> (the-as process-drawable v1-39) root trans quad)) + (set! (-> this trans quad) (-> (the-as process-drawable v1-39) root trans quad)) (vector-! - (-> obj vector) + (-> this vector) (-> (the-as process-drawable s3-0) root trans) (-> (the-as process-drawable v1-39) root trans) ) - (logior! (-> obj mask) (attack-mask vector)) + (logior! (-> this mask) (attack-mask vector)) ) ) ) (else - (let* ((s3-1 (handle->process (-> obj attacker))) + (let* ((s3-1 (handle->process (-> this attacker))) (a0-16 (if (and (nonzero? s3-1) (type-type? (-> s3-1 type) process-drawable)) s3-1 ) ) ) (if a0-16 - (set! (-> obj trans quad) (-> (the-as process-drawable a0-16) root trans quad)) + (set! (-> this trans quad) (-> (the-as process-drawable a0-16) root trans quad)) ) ) - (set! (-> obj vector quad) (-> arg0 vector quad)) + (set! (-> this vector quad) (-> arg0 vector quad)) (if (not (logtest? s4-0 (attack-mask shove-back))) - (set! (-> obj shove-back) (vector-xz-length (-> obj vector))) + (set! (-> this shove-back) (vector-xz-length (-> this vector))) ) (if (not (logtest? s4-0 (attack-mask shove-up))) - (set! (-> obj shove-up) (-> obj vector y)) + (set! (-> this shove-up) (-> this vector y)) ) ) ) - (if (not (logtest? (-> obj mask) (attack-mask dist))) - (set! (-> obj dist) (fabs (-> obj shove-back))) + (if (not (logtest? (-> this mask) (attack-mask dist))) + (set! (-> this dist) (fabs (-> this shove-back))) ) (if (logtest? s4-0 (attack-mask trans)) - (set! (-> obj trans quad) (-> arg0 trans quad)) + (set! (-> this trans quad) (-> arg0 trans quad)) ) ) (none) diff --git a/goal_src/jak1/engine/target/target.gc b/goal_src/jak1/engine/target/target.gc index 5f1edc3489..7dfccc40be 100644 --- a/goal_src/jak1/engine/target/target.gc +++ b/goal_src/jak1/engine/target/target.gc @@ -62,8 +62,8 @@ ) ) (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) - (let ((s5-1 (-> *display* base-frame-counter))) - (while (or (= arg0 -1) (< (- (-> *display* base-frame-counter) s5-1) arg0)) + (let ((s5-1 (current-time))) + (while (or (= arg0 -1) (not (time-elapsed? s5-1 arg0))) (suspend) (ja :group! eichar-jump-loop-ja :num! (loop!)) ) @@ -109,7 +109,7 @@ (pad-buttons x) ) (not (logtest? (-> self water flags) (water-flags wt09))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (not (time-elapsed? (-> self state-time) (seconds 3))) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) @@ -120,7 +120,7 @@ ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) (>= arg1 0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) arg1) + (time-elapsed? (-> self state-time) arg1) (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) #t @@ -128,7 +128,7 @@ (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground 'stuck) ) - (if (!= (-> self state-time) (-> *display* base-frame-counter)) + (if (!= (-> self state-time) (current-time)) (slide-down-test) ) 0 @@ -175,7 +175,7 @@ ) ) ) - (let ((f30-1 (seek f30-0 (the-as float 1.0) (* 0.5 (-> *display* seconds-per-frame))))) + (let ((f30-1 (seek f30-0 (the-as float 1.0) (* 0.5 (seconds-per-frame))))) (set! (-> s5-0 param 1) f30-1) (set! (-> s5-0 frame-num) 0.0) (joint-control-channel-group! @@ -221,7 +221,7 @@ (suspend) (let ((s5-1 (-> self skel root-channel 0))) (set! (-> s5-1 param 0) (the float (+ (-> s5-1 frame-group data 0 length) -1))) - (set! f30-1 (seek f30-1 (the-as float 1.0) (* 0.5 (-> *display* seconds-per-frame)))) + (set! f30-1 (seek f30-1 (the-as float 1.0) (* 0.5 (seconds-per-frame)))) (set! (-> s5-1 param 1) f30-1) (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) ) @@ -348,7 +348,7 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control unknown-surface00) *walk-mods*) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (set! (-> self control unknown-float81) 0.0) @@ -462,7 +462,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (seek! (-> self control unknown-float81) (the-as float 0.0) (-> *display* seconds-per-frame)) + (seek! (-> self control unknown-float81) (the-as float 0.0) (seconds-per-frame)) (suspend) (ja :num! (seek!)) ) @@ -580,7 +580,7 @@ (defstate target-walk (target) :event target-walk-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *walk-mods*) ) :exit (behavior () @@ -601,7 +601,7 @@ ) (pad-buttons l1 r1) ) - (and (>= (- (-> *display* base-frame-counter) (-> *TARGET-bank* wheel-timeout)) (-> self control unknown-dword30)) + (and (time-elapsed? (-> *TARGET-bank* wheel-timeout) (-> self control unknown-dword30)) (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?)) ) ) @@ -642,7 +642,7 @@ (if (can-hands? #t) (go target-running-attack) ) - (when (and (turn-around?) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.3))) + (when (and (turn-around?) (time-elapsed? (-> self state-time) (seconds 0.3))) (set! (-> self control transv quad) (-> self control unknown-vector-array10 (-> self control unknown-int10) quad) ) @@ -876,7 +876,7 @@ (set! f30-0 (seek f30-0 (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01))))) - (* 2.0 (-> *display* seconds-per-frame)) + (* 2.0 (seconds-per-frame)) ) ) (let ((v1-317 (-> self skel effect))) @@ -994,7 +994,7 @@ (go target-running-attack) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.08)) + (time-elapsed? (-> self control unknown-dword11) (seconds 0.08)) ) (go target-falling #f) ) @@ -1027,7 +1027,7 @@ (set! (-> self control unknown-surface00) *jump-mods*) ) :exit (behavior () - (set! (-> self control unknown-dword35) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword35)) ) :trans (behavior () (when (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) @@ -1057,7 +1057,7 @@ (defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 vector) (arg3 vector) (arg4 vector)) (logclear! (-> self control status) (cshape-moving-flags csmf14)) (delete-back-vel) - (when (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (seconds 0.05)) + (when (not (time-elapsed? (-> self control rider-time) (seconds 0.05))) (let ((f0-1 (fmax 0.0 @@ -1119,7 +1119,7 @@ (defbehavior mod-var-jump target ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 vector)) (local-vars (v0-2 vector)) - (let ((f30-0 (* 0.033333335 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (let ((f30-0 (* 0.033333335 (the float (- (current-time) (-> self state-time)))))) (cond ((or (< 1.0 f30-0) (< (-> self control unknown-float123) 0.0) (not arg2)) (set! (-> self control unknown-float123) -1.0) @@ -1376,7 +1376,7 @@ (go target-launch (the-as float a0-9) (the-as symbol a1-5) a2-5 (-> self control unknown-dword63)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 70) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) @@ -1424,9 +1424,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -1448,7 +1446,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) @@ -1524,7 +1522,7 @@ (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-0 (-> self control unknown-dword63)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *double-jump-mods*) @@ -1540,9 +1538,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -1559,13 +1555,13 @@ ) ) ) - (if (!= (-> self state-time) (-> *display* base-frame-counter)) + (if (!= (-> self state-time) (current-time)) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) ) (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 float) (arg1 float)) @@ -1600,7 +1596,7 @@ (if (or (= arg2 'duck) (= arg2 'launch)) (go target-duck-high-jump arg0 arg1 (the-as symbol arg2)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (sound-play "jump" :pitch 0.3) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) @@ -1637,9 +1633,7 @@ ) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -1660,7 +1654,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (-> target-jump code) @@ -1670,7 +1664,7 @@ (defstate target-duck-high-jump (target) :event target-standard-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *turn-around-mods*) ) @@ -1722,7 +1716,7 @@ (defstate target-duck-high-jump-jump (target) :event target-jump-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 80 :pitch -0.4) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) @@ -1824,7 +1818,7 @@ :enter (behavior ((arg0 symbol)) (set! (-> self control unknown-surface00) *jump-mods*) (set! (-> self control unknown-uint20) (the-as uint arg0)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (target-falling-trans @@ -1941,7 +1935,7 @@ (defstate target-attack (target) :event target-dangerous-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (target-start-attack) (target-danger-set! 'spin #f) (set! (-> self control unknown-surface00) *attack-mods*) @@ -1949,7 +1943,7 @@ (set! (-> self neck flex-blend) 0.0) ) :exit (behavior () - (set! (-> self control unknown-dword33) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword33)) (target-exit) ) :code (behavior () @@ -2011,7 +2005,7 @@ ) ) (when gp-1 - (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self control unknown-uint20) (the-as uint (current-time))) (let ((v1-9 (if (and (nonzero? proc) (type-type? (-> proc type) process-drawable)) proc ) @@ -2034,7 +2028,7 @@ ) ) (when (or (= gp-1 'die) (= gp-1 'push)) - (let ((v0-2 (the-as object (-> *display* base-frame-counter)))) + (let ((v0-2 (the-as object (current-time)))) (set! (-> self control unknown-int21) (the-as int v0-2)) v0-2 ) @@ -2056,11 +2050,11 @@ (if (or (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 1.5)) + (not (time-elapsed? (-> self control unknown-dword82) (seconds 1.5))) ) (go target-yellow-blast) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control unknown-int21) 0) (set! (-> self control unknown-uint31) (the-as uint 0)) @@ -2078,18 +2072,18 @@ (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) - (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword31)) (target-exit) ) :trans (behavior () - (when (!= (-> self state-time) (-> *display* base-frame-counter)) + (when (!= (-> self state-time) (current-time)) (if (and (or (smack-surface? #t) (and (>= (-> self control unknown-float63) 0.7) (not (logtest? (-> self control status) (cshape-moving-flags t-act))) ) ) (begin - (set! (-> self control unknown-int21) (the-as int (-> *display* base-frame-counter))) + (set! (-> self control unknown-int21) (the-as int (current-time))) (set! (-> self control unknown-float81) 0.0) (let ((gp-0 (new-stack-vector0)) (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -2110,9 +2104,7 @@ #t ) (or (zero? (-> self control unknown-uint20)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.04)) ) (!= (-> self control unknown-uint31) 1) ) @@ -2125,7 +2117,7 @@ ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (and (< 4096.0 (-> self control unknown-float01)) - (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (or (time-elapsed? (-> self state-time) (seconds 0.1)) (not (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons square) ) @@ -2142,7 +2134,7 @@ ) ) (if (and (logtest? (-> self water flags) (water-flags wt09)) - (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) + (zero? (mod (- (current-time) (-> self state-time)) 21)) ) (create-splash (-> self water) @@ -2185,7 +2177,7 @@ (cond ((and (>= (ja-aframe-num 0) 20.0) (and (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-39 (ja-group))) (or (not (or (= v1-39 eichar-attack-punch-ja) @@ -2197,22 +2189,18 @@ ) ) ) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.04)) ) ) (go target-falling #f) ) ((and (nonzero? (-> self control unknown-uint30)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint30)) (seconds 0.04)) ) (set-forward-vel (the-as float 0.0)) ) ((and (not (cpad-hold? (-> self control unknown-cpad-info00 number) square)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) ) (if (= (-> self control ground-pat material) (pat-material ice)) (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control unknown-float01)))) @@ -2237,7 +2225,7 @@ ) (suspend) (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (if (< 2 gp-2) @@ -2247,7 +2235,7 @@ ) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-121 (ja-group))) (or (not (or (= v1-121 eichar-attack-punch-ja) @@ -2281,7 +2269,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (target-start-attack) (target-danger-set! 'spin-air #f) @@ -2307,8 +2295,8 @@ ) ) (else - (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (-> *display* seconds-per-frame)))) - (f30-0 (* 0.5 f1-5 (-> *display* seconds-per-frame) f0-1)) + (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (seconds-per-frame)))) + (f30-0 (* 0.5 f1-5 (seconds-per-frame) f0-1)) ) (if (ja-group? eichar-attack-uppercut-ja) (set! f30-0 @@ -2356,18 +2344,14 @@ (set-quaternion! (-> self control) (-> self control dir-targ)) (go target-hit-ground #f) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (seek! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length) - (* 245760.0 (if (= (-> *setting-control* current video-mode) 'custom) - 0.016666668 - (-> *display* seconds-per-frame) - ) - ) + (* 245760.0 (seconds-per-frame)) ) ) - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.05)) (< (vector-dot (-> self control dynam gravity-normal) (-> self control unknown-vector10)) (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) ) @@ -2404,13 +2388,13 @@ (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) (while (not (or (and (< (fabs (/ f0-8 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.7)) + (time-elapsed? (-> self state-time) (seconds 1.7)) ) ) (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) - (* f30-0 (-> *display* seconds-per-frame)) + (* f30-0 (seconds-per-frame)) ) (suspend) (ja :num! (loop!)) @@ -2425,7 +2409,7 @@ (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) - (* f30-0 (-> *display* seconds-per-frame)) + (* f30-0 (seconds-per-frame)) ) ) (else @@ -2456,7 +2440,7 @@ (defstate target-attack-uppercut (target) :event target-dangerous-event-handler :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (target-start-attack) (target-danger-set! 'uppercut #f) (set! (-> self control unknown-surface00) *turn-around-mods*) @@ -2490,7 +2474,7 @@ ) (set-forward-vel (the-as float 32768.0)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *uppercut-jump-mods*) @@ -2505,9 +2489,7 @@ (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -2622,7 +2604,7 @@ (set-forward-vel arg2) (set-forward-vel (-> self control unknown-float01)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flop-mods*) (set! (-> self control unknown-uint20) (the-as uint 0)) @@ -2667,7 +2649,7 @@ (not (logtest? (-> self control status) (cshape-moving-flags t-act))) (>= (-> self control unknown-uint20) (the-as uint 2)) ) - (set! (-> self control unknown-dword36) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword36)) (set! gp-1 'stuck) ) ) @@ -2808,7 +2790,7 @@ ) ) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *TARGET-bank* fall-timeout)) + (if (time-elapsed? (-> self state-time) (-> *TARGET-bank* fall-timeout)) (go target-falling #f) ) (if (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (not *pause-lock*)) @@ -2845,7 +2827,7 @@ ) (target-land-effect) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-uint20) (the-as uint arg0)) (set-forward-vel (the-as float 0.0)) (set! (-> self control unknown-surface00) *flop-land-mods*) @@ -2862,7 +2844,7 @@ (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) (>= (-> self fact-info-target eco-level) 1.0) ) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) + (not (time-elapsed? (-> self state-time) (seconds 0.25))) ) (effect-control-method-10 (-> self skel effect) @@ -2899,7 +2881,7 @@ (target-standard-event-handler proc argc message block) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *wheel-mods*) (+! (-> self control unknown-int50) 1) (rot->dir-targ! (-> self control)) @@ -2917,7 +2899,7 @@ :exit (behavior () (when (!= (-> self next-state name) 'target-wheel) (set! (-> self control unknown-int50) 0) - (set! (-> self control unknown-dword30) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword30)) ) (target-exit) ) @@ -2931,13 +2913,11 @@ (ja :group! eichar-duck-roll-ja :num! min) (until (ja-done? 0) (if (cpad-pressed? (-> self control unknown-cpad-info00 number) x) - (set! gp-0 (the-as int (-> *display* base-frame-counter))) + (set! gp-0 (the-as int (current-time))) ) (when (and (or (smack-surface? #f) (>= (-> self control unknown-float63) 0.7)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 3) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1) + (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.01)) + (time-elapsed? (-> self state-time) 1) ) (if (>= 6.0 (ja-aframe-num 0)) (target-shoved @@ -2948,11 +2928,11 @@ ) ) (if (zero? s5-0) - (set! s5-0 (the-as int (-> *display* base-frame-counter))) + (set! s5-0 (the-as int (current-time))) ) ) (if (cpad-pressed? (-> self control unknown-cpad-info00 number) square) - (-> *display* base-frame-counter) + (current-time) ) (compute-alignment! (-> self align)) (cond @@ -2972,7 +2952,7 @@ (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) ) ) - (if (and (or (< (- (-> *display* base-frame-counter) (the-as time-frame gp-0)) (-> *TARGET-bank* wheel-jump-pre-window)) + (if (and (or (not (time-elapsed? (the-as time-frame gp-0) (-> *TARGET-bank* wheel-jump-pre-window))) (cpad-pressed? (-> self control unknown-cpad-info00 number) x) ) (can-jump? 'target-wheel-flip) @@ -2980,12 +2960,12 @@ (go target-wheel-flip (-> *TARGET-bank* wheel-flip-height) (-> *TARGET-bank* wheel-flip-dist)) ) ) - (set! (-> self state-hook-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-hook-time)) (set! (-> self state-hook) (lambda :behavior target () (cond - ((>= (- (-> *display* base-frame-counter) (-> self state-hook-time)) (-> *TARGET-bank* wheel-jump-post-window)) + ((time-elapsed? (-> self state-hook-time) (-> *TARGET-bank* wheel-jump-post-window)) (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) ) (else @@ -3020,7 +3000,7 @@ (if (and (or (smack-surface? #f) (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) ) - (!= (-> self state-time) (-> *display* base-frame-counter)) + (!= (-> self state-time) (current-time)) ) (target-shoved (-> *TARGET-bank* smack-surface-dist) @@ -3075,9 +3055,9 @@ (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (while (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.01)) + (when (time-elapsed? (-> self state-time) (seconds 0.01)) (when (not (ja-group? eichar-jump-loop-ja)) (ja-channel-push! 1 (seconds 0.1)) (ja :group! eichar-jump-loop-ja :num! min) @@ -3106,12 +3086,12 @@ ) ) (target-land-effect) - (set! (-> self state-hook-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-hook-time)) (set! (-> self state-hook) (lambda :behavior target () (cond - ((>= (- (-> *display* base-frame-counter) (-> self state-hook-time)) (seconds 0.1)) + ((time-elapsed? (-> self state-hook-time) (seconds 0.1)) (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) ) (else diff --git a/goal_src/jak1/engine/target/target2.gc b/goal_src/jak1/engine/target/target2.gc index 0802616f83..6c93847c57 100644 --- a/goal_src/jak1/engine/target/target2.gc +++ b/goal_src/jak1/engine/target/target2.gc @@ -15,7 +15,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('loading) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) (else @@ -26,8 +26,8 @@ :exit target-exit :code (behavior () (set! (-> self control unknown-surface00) *walk-no-turn-mods*) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.05))) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! eichar-trip-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -37,8 +37,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.3)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.3)) (suspend) (ja :num! (seek! (ja-aframe (the-as float 19.0) 0) 0.05)) (suspend) @@ -99,7 +99,7 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (let ((a0-0 (-> self control unknown-spoolanim00))) @@ -168,14 +168,14 @@ (define *fp-hud-stack* (malloc 'global #x3800)) -(defmethod deactivate first-person-hud ((obj first-person-hud)) - (dotimes (s5-0 (-> obj nb-of-particles)) - (kill-and-free-particles (-> obj particles s5-0 part)) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod deactivate first-person-hud ((this first-person-hud)) + (dotimes (s5-0 (-> this nb-of-particles)) + (kill-and-free-particles (-> this particles s5-0 part)) + (set! (-> this particles s5-0 part matrix) -1) ) (enable-hud) (set! (-> *target* fp-hud) (the-as handle #f)) - ((the-as (function process none) (find-parent-method first-person-hud 10)) obj) + ((the-as (function process none) (find-parent-method first-person-hud 10)) this) (none) ) @@ -219,7 +219,7 @@ ) (case (get-aspect-ratio) (('aspect4x3) - (set! (-> self sides-x-scale) (if (= (-> *pc-settings* aspect-custom-x) 16) 5.0 3.5)) + (set! (-> self sides-x-scale) 3.5) (set! (-> self sides-y-scale) 13.0) (set! (-> self x-offset) 0) 0 @@ -235,37 +235,37 @@ (none) ) -(defmethod relocate first-person-hud ((obj first-person-hud) (arg0 int)) - (dotimes (v1-0 (-> obj nb-of-particles)) - (when (-> obj particles v1-0 part) - (if (nonzero? (-> obj particles v1-0 part)) - (&+! (-> obj particles v1-0 part) arg0) +(defmethod relocate first-person-hud ((this first-person-hud) (arg0 int)) + (dotimes (v1-0 (-> this nb-of-particles)) + (when (-> this particles v1-0 part) + (if (nonzero? (-> this particles v1-0 part)) + (&+! (-> this particles v1-0 part) arg0) ) ) ) - (the-as first-person-hud ((method-of-type process relocate) obj arg0)) + (the-as first-person-hud ((method-of-type process relocate) this arg0)) ) -(defmethod dumb-15 first-person-hud ((obj first-person-hud)) - (dotimes (s5-0 (-> obj nb-of-particles)) - (set! (-> obj particles s5-0 pos x) (+ -256.0 (-> obj particles s5-0 init-pos x))) - (set! (-> obj particles s5-0 pos y) - (* 0.5 (- (* (-> obj particles s5-0 init-pos y) (-> *video-parms* relative-y-scale)) +(defmethod dumb-15 first-person-hud ((this first-person-hud)) + (dotimes (s5-0 (-> this nb-of-particles)) + (set! (-> this particles s5-0 pos x) (+ -256.0 (-> this particles s5-0 init-pos x))) + (set! (-> this particles s5-0 pos y) + (* 0.5 (- (* (-> this particles s5-0 init-pos y) (-> *video-parms* relative-y-scale)) (the float (-> *video-parms* screen-sy)) ) ) ) - (set! (-> obj particles s5-0 pos z) (-> obj particles s5-0 init-pos z)) - (if (> (-> obj particles s5-0 part matrix) 0) + (set! (-> this particles s5-0 pos z) (-> this particles s5-0 init-pos z)) + (if (> (-> this particles s5-0 part matrix) 0) (set-vector! - (sprite-get-user-hvdf (-> obj particles s5-0 part matrix)) - (the float (+ (the int (-> obj particles s5-0 pos x)) 2048)) - (the float (+ (the int (-> obj particles s5-0 pos y)) 2048)) - (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> obj particles s5-0 pos z))) + (sprite-get-user-hvdf (-> this particles s5-0 part matrix)) + (the float (+ (the int (-> this particles s5-0 pos x)) 2048)) + (the float (+ (the int (-> this particles s5-0 pos y)) 2048)) + (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> this particles s5-0 pos z))) (-> *math-camera* hvdf-off w) ) ) - (spawn (-> obj particles s5-0 part) *null-vector*) + (spawn (-> this particles s5-0 part) *null-vector*) ) 0 (none) @@ -422,7 +422,7 @@ (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'dist-from-interp-src) (and (< (send-event-function *camera* a1-0) 4915.2) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.07)) + (not (time-elapsed? (-> self state-time) (seconds 0.07))) (zero? (ja-group-size)) ) ) @@ -505,7 +505,7 @@ (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.5)) + (time-elapsed? (-> self control unknown-dword82) (seconds 0.5)) (not *pause-lock*) ) (let ((gp-1 (vector-float*! @@ -557,7 +557,7 @@ ) ) ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword82)) ) (when (cpad-pressed? (-> self control unknown-cpad-info00 number) triangle) (logclear! @@ -654,7 +654,7 @@ ) (pad-buttons r2 circle square) ) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.45)) + (time-elapsed? (-> self control unknown-dword82) (seconds 0.45)) (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) @@ -709,7 +709,7 @@ ) ) ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword82)) ) ) ) @@ -774,7 +774,7 @@ (let ((gp-0 0)) (while (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (target-falling-anim-trans) - (+! gp-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) + (+! gp-0 (- (current-time) (-> *display* old-base-frame-counter))) (suspend) ) (if (or (> gp-0 0) (let ((v1-11 (ja-group))) @@ -895,7 +895,7 @@ ) :enter (behavior ((arg0 handle)) (set! (-> self control unknown-handle10) arg0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *pole-mods*) (logior! (-> self control root-prim prim-core action) (collide-action swingpole-active)) (target-collide-set! 'pole (the-as float 0.0)) @@ -918,7 +918,7 @@ (pad-buttons x) ) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (set! (-> self control transv quad) (the-as uint128 0)) (cond @@ -1103,9 +1103,9 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *edge-grab-mods*) - (set! (-> self control unknown-dword41) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword41)) (logior! (-> self control root-prim prim-core action) (collide-action edgegrab-active edgegrab-cam)) (set! (-> self control unknown-vector102 quad) (-> self control transv quad)) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1118,7 +1118,7 @@ ) ) :trans (behavior () - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -1267,7 +1267,7 @@ (set! (-> self control transv quad) (the-as uint128 0)) (logclear! (-> self control root-prim prim-core action) (collide-action edgegrab-active edgegrab-cam)) (vector-float*! (-> self control transv) (-> self control unknown-vector101) -40960.0) - (when (and (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (seconds 0.2)) + (when (and (not (time-elapsed? (-> self control rider-time) (seconds 0.2))) (or (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground)) (= (-> self control poly-pat material) (pat-material rotate)) ) @@ -1283,7 +1283,7 @@ (defstate target-yellow-blast (target) :event (-> target-running-attack event) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *run-attack-mods*) (set! (-> *run-attack-mods* turnv) 655360.0) (set! (-> *run-attack-mods* turnvv) 655360.0) @@ -1314,7 +1314,7 @@ :exit (behavior () (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) - (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword31)) (target-exit) ) :code (behavior () @@ -1343,7 +1343,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (suspend) @@ -1378,14 +1378,12 @@ ) ) ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword82)) ) ) (ja-no-eval :group! eichar-yellow-running-blast-ja :num! (seek!) :frame-num (ja-aframe (the-as float 9.0) 0)) (until (ja-done? 0) - (if (or (< (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) - (the-as uint 30) - ) + (if (or (not (time-elapsed? (the-as int (-> self control unknown-uint30)) (seconds 0.1))) (= (-> self control unknown-uint31) 1) ) (send-event (handle->process gp-0) 'die) @@ -1449,7 +1447,7 @@ ) :exit (behavior () (rot->dir-targ! (-> self control)) - (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword31)) (target-exit) ) :code (behavior () @@ -1497,9 +1495,9 @@ #f :to self ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) - (let ((gp-4 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-4) (seconds 0.1)) + (set-time! (-> self control unknown-dword82)) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 0.1)) (suspend) ) ) @@ -1524,7 +1522,7 @@ ) :code (behavior ((arg0 object) (arg1 float)) (set! (-> self neck flex-blend) 0.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (= arg1 (-> *FACT-bank* eco-full-inc)) (set! (-> self control unknown-surface00) *double-jump-mods*) (set! (-> self control unknown-surface00) *walk-mods*) @@ -1599,7 +1597,7 @@ (defstate target-wade-stance (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *wade-mods*) (set-zero! (-> self water bob)) ) @@ -1614,7 +1612,7 @@ :trans (behavior () ((-> self state-hook)) (when (and (not (logtest? (-> self water flags) (water-flags wt10))) - (>= (- (-> *display* base-frame-counter) (-> self water wade-time)) (seconds 0.05)) + (time-elapsed? (-> self water wade-time) (seconds 0.05)) ) (if (logtest? (-> self water flags) (water-flags wt11)) (go target-swim-stance) @@ -1658,7 +1656,7 @@ :trans (behavior () ((-> self state-hook)) (when (and (not (logtest? (-> self water flags) (water-flags wt10))) - (>= (- (-> *display* base-frame-counter) (-> self water wade-time)) (seconds 0.1)) + (time-elapsed? (-> self water wade-time) (seconds 0.1)) ) (if (logtest? (-> self water flags) (water-flags wt11)) (go target-swim-stance) @@ -1819,7 +1817,7 @@ (the-as float 16384.0) (the-as float 32768.0) ) - (* 4.0 (-> *display* seconds-per-frame)) + (* 4.0 (seconds-per-frame)) ) ) (set! (-> self skel root-channel 1 frame-interp) f24-1) @@ -1834,7 +1832,7 @@ (ja :chan 2 :num! (chan 0)) (ja :chan 3 :num! (chan 0)) (ja :chan 4 :num! (chan 0)) - (when (and (>= (- (-> *display* base-frame-counter) (the-as time-frame gp-6)) (seconds 0.2)) + (when (and (time-elapsed? (the-as time-frame gp-6) (seconds 0.2)) (< (- (-> self water height) (-> self control trans y)) 4096.0) ) (case (the int (ja-aframe-num 0)) @@ -1846,7 +1844,7 @@ 0 (vector-float*! (new 'stack-no-clear 'vector) (-> self control transv) 2.5) ) - (set! gp-6 (the-as int (-> *display* base-frame-counter))) + (set! gp-6 (the-as int (current-time))) ) ((46 47 48 49) (create-splash @@ -1856,7 +1854,7 @@ 0 (vector-float*! (new 'stack-no-clear 'vector) (-> self control transv) 2.5) ) - (set! gp-6 (the-as int (-> *display* base-frame-counter))) + (set! gp-6 (the-as int (current-time))) ) ) ) @@ -1877,7 +1875,7 @@ (seek! (-> self control unknown-float130) (fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3)) - (* arg1 (-> *display* seconds-per-frame)) + (* arg1 (seconds-per-frame)) ) ) (let ((a2-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)))) @@ -1895,8 +1893,8 @@ ) (set! (-> self control unknown-float00) (fabs (-> self control unknown-float130))) (if (= (-> self next-state name) 'target-swim-down) - (seek! (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (-> *display* seconds-per-frame))) - (seek! (-> self control unknown-float131) (the-as float 0.0) (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (seconds-per-frame))) + (seek! (-> self control unknown-float131) (the-as float 0.0) (* 2048.0 (seconds-per-frame))) ) (set! (-> self control unknown-vector11 y) (-> self control unknown-float131)) ) @@ -1904,7 +1902,7 @@ (defstate target-swim-stance (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *swim-mods*) (logior! (-> self water flags) (water-flags wt04)) ) @@ -1930,7 +1928,7 @@ (set-zero! (-> self water bob)) ) (when (and (not (logtest? (-> self water flags) (water-flags wt11))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) @@ -1945,7 +1943,7 @@ (pad-buttons x) ) (can-jump? #f) - (>= (- (-> *display* base-frame-counter) (-> self water enter-swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) ) (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) ) @@ -2031,7 +2029,7 @@ :enter (behavior () ((-> target-swim-stance enter)) (die-on-next-update! (-> self water bob)) - (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self control unknown-uint20) (the-as uint (current-time))) ) :exit (-> target-swim-stance exit) :trans (behavior () @@ -2042,7 +2040,7 @@ (set-zero! (-> self water bob)) ) (when (and (not (logtest? (-> self water flags) (water-flags wt11))) - (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water swim-time) (seconds 0.1)) ) (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) @@ -2057,7 +2055,7 @@ (pad-buttons x) ) (can-jump? #f) - (>= (- (-> *display* base-frame-counter) (-> self water enter-swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) ) (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) ) @@ -2074,14 +2072,12 @@ ) (cond ((= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (if (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 15) - ) + (if (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.05)) (go target-swim-stance) ) ) (else - (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self control unknown-uint20) (the-as uint (current-time))) ) ) (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0)) @@ -2147,12 +2143,12 @@ (target-standard-event-handler proc argc message block) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self water flags) (water-flags wt04)) (set! (-> self control unknown-surface00) *dive-mods*) (set! (-> self control dynam gravity-max) 16384.0) (set! (-> self control dynam gravity-length) 16384.0) - (set! (-> self water swim-time) (-> *display* base-frame-counter)) + (set-time! (-> self water swim-time)) (set! (-> self control unknown-uint20) (the-as uint #f)) (if (= (-> self next-state name) 'target-swim-down) (set! (-> self control unknown-float130) 0.0) @@ -2173,11 +2169,11 @@ ) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.5)) + (if (time-elapsed? (-> self water swim-time) (seconds 0.5)) (go target-stance) ) (cond - ((>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) + ((time-elapsed? (-> self control unknown-dword11) (seconds 0.1)) (set! (-> self control unknown-surface00) *dive-mods*) (if (= (-> self next-state name) 'target-swim-down) (target-swim-tilt (the-as float -0.9) (the-as float 1.0) (the-as float 0.0) (the-as float 0.5)) @@ -2247,15 +2243,13 @@ (if (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) square)) (-> self control unknown-spoolanim00) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + (time-elapsed? (-> self state-time) gp-0) ) (go target-swim-up) ) - (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) s5-0) + (if (or (time-elapsed? (-> self state-time) s5-0) (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (and (< (-> self water swim-depth) 8192.0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) - ) + (and (< (-> self water swim-depth) 8192.0) (time-elapsed? (-> self state-time) gp-0)) ) ) (go target-swim-up) @@ -2269,7 +2263,7 @@ (f26-0 f28-0) (f24-1 (+ f24-0 f30-0)) ) - (set! f30-0 (seek f30-0 (the-as float 0.0) (* 32768.0 (-> *display* seconds-per-frame)))) + (set! f30-0 (seek f30-0 (the-as float 0.0) (* 32768.0 (seconds-per-frame)))) (vector+! (-> self control transv) (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f24-1) @@ -2309,7 +2303,7 @@ (the-as surface #f) ) ) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) + (if (and (time-elapsed? (-> self state-time) (seconds 10)) (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) ) (send-event self 'attack #f (static-attack-info ((mode 'drown-death)))) @@ -2378,14 +2372,14 @@ ) (suspend) (ja :num! (loop! f30-0)) - (set! f30-0 (seek f30-0 (the-as float 1.0) (-> *display* seconds-per-frame))) + (set! f30-0 (seek f30-0 (the-as float 1.0) (seconds-per-frame))) ) ) (label cfg-37) (logior! (-> self water flags) (water-flags wt04)) - (set! (-> self water swim-time) (-> *display* base-frame-counter)) + (set-time! (-> self water swim-time)) (start-bobbing! (-> self water) (the-as float -4096.0) 600 1500) - (set! (-> self water bob start-time) (+ (-> *display* base-frame-counter) (seconds -0.05))) + (set! (-> self water bob start-time) (+ (current-time) (seconds -0.05))) (go target-swim-stance) ) :post target-swim-post @@ -2397,7 +2391,7 @@ :exit target-exit :trans (behavior () (cond - ((< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + ((not (time-elapsed? (-> self state-time) (seconds 0.5))) (logior! (-> self water flags) (water-flags wt16)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ) @@ -2517,7 +2511,7 @@ ) ) :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *turn-around-mods*) (ja-channel-push! 1 (seconds 0.15)) (set-forward-vel (the-as float 0.0)) @@ -2535,13 +2529,13 @@ (lambda :behavior process ((arg0 vector) (arg1 time-frame) (arg2 float)) (local-vars (sv-32 time-frame) (sv-40 vector) (sv-44 symbol)) - (set! sv-32 (-> *display* base-frame-counter)) + (set! sv-32 (current-time)) (let ((v1-2 (new-stack-vector0))) (set! (-> v1-2 quad) (-> arg0 quad)) (set! sv-40 v1-2) ) (set! sv-44 #t) - (until (>= (- (-> *display* base-frame-counter) sv-32) arg1) + (until (time-elapsed? sv-32 arg1) (let ((s4-0 (ppointer->process (-> self parent)))) (cond ((and sv-44 @@ -2558,7 +2552,7 @@ ) (else (if sv-44 - (set! sv-32 (-> *display* base-frame-counter)) + (set! sv-32 (current-time)) ) (set! sv-44 (the-as symbol #f)) (when (or (= (-> (the-as target s4-0) next-state name) 'target-duck-high-jump-jump) @@ -2754,7 +2748,7 @@ ) (rot->dir-targ! (-> self control)) (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) - (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword11)) (ja-channel-set! 0) (ja-post) (target-exit) diff --git a/goal_src/jak1/engine/ui/hud-classes.gc b/goal_src/jak1/engine/ui/hud-classes.gc index cb23c10154..ab7d254956 100644 --- a/goal_src/jak1/engine/ui/hud-classes.gc +++ b/goal_src/jak1/engine/ui/hud-classes.gc @@ -134,20 +134,20 @@ ) -(defmethod draw-hud hud-pickups ((obj hud-pickups)) +(defmethod draw-hud hud-pickups ((this hud-pickups)) (let ((t9-0 (method-of-type hud draw-hud))) - (t9-0 obj) + (t9-0 this) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> s5-0 base)) ) (let ((s4-0 draw-string-xy)) - (format (clear *temp-string*) "~D" (-> obj value)) + (format (clear *temp-string*) "~D" (-> this value)) (s4-0 *temp-string* s5-0 - (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset))) - (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) + (+ (-> this text-x) (* (-> this x-sgn) (-> this offset))) + (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale)) ) 2 @@ -175,36 +175,36 @@ (none) ) -(defmethod hud-update hud-pickups ((obj hud-pickups)) +(defmethod hud-update hud-pickups ((this hud-pickups)) (if *target* - (tally-value obj (the int (+ 0.5 (-> *target* fact-info-target eco-pill))) 0) + (tally-value this (the int (+ 0.5 (-> *target* fact-info-target eco-pill))) 0) ) 0 (none) ) -(defmethod init-particles! hud-pickups ((obj hud-pickups) (arg0 int)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 75) obj)) - (set! (-> obj particles s5-0 init-pos x) 110.0) - (set! (-> obj particles s5-0 init-pos y) 55.0) - (set! (-> obj particles s5-0 init-pos z) 1.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod init-particles! hud-pickups ((this hud-pickups) (arg0 int)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 75) this)) + (set! (-> this particles s5-0 init-pos x) 110.0) + (set! (-> this particles s5-0 init-pos y) 55.0) + (set! (-> this particles s5-0 init-pos z) 1.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-1 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-1 part matrix) -1) - (set! (-> obj particles s5-1 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-1 (-> this nb-of-particles)) + (if (= (-> this particles s5-1 part matrix) -1) + (set! (-> this particles s5-1 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set! (-> obj text-x) 118) - (set! (-> obj text-y) 45) - (set! (-> obj x-sgn) -1) - (set! (-> obj y-sgn) -1) - (set! (-> obj friend) 3) + (set! (-> this text-x) 118) + (set! (-> this text-y) 45) + (set! (-> this x-sgn) -1) + (set! (-> this y-sgn) -1) + (set! (-> this friend) 3) 0 (none) ) @@ -345,16 +345,16 @@ (none) ) -(defmethod draw-hud hud-health ((obj hud-health)) - ((method-of-type hud draw-hud) obj) +(defmethod draw-hud hud-health ((this hud-health)) + ((method-of-type hud draw-hud) this) 0 (none) ) -(defmethod hud-update hud-health ((obj hud-health)) +(defmethod hud-update hud-health ((this hud-health)) (if *target* (tally-value - obj + this (the int (-> *target* fact-info-target health)) (the-as int (-> *target* fact-info-target health-pickup-time)) ) @@ -363,77 +363,77 @@ (none) ) -(defmethod init-particles! hud-health ((obj hud-health) (arg0 int)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 76) obj)) - (set! (-> obj particles s5-0 init-pos x) 61.0) - (set! (-> obj particles s5-0 init-pos y) 55.0) - (set! (-> obj particles s5-0 init-pos z) 5.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod init-particles! hud-health ((this hud-health) (arg0 int)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 76) this)) + (set! (-> this particles s5-0 init-pos x) 61.0) + (set! (-> this particles s5-0 init-pos y) 55.0) + (set! (-> this particles s5-0 init-pos z) 5.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 77) obj)) - (set! (-> obj particles s5-1 init-pos x) 98.0) - (set! (-> obj particles s5-1 init-pos y) 55.0) - (set! (-> obj particles s5-1 init-pos z) 5.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 77) this)) + (set! (-> this particles s5-1 init-pos x) 98.0) + (set! (-> this particles s5-1 init-pos y) 55.0) + (set! (-> this particles s5-1 init-pos z) 5.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 78) obj)) - (set! (-> obj particles s5-2 init-pos x) 70.0) - (set! (-> obj particles s5-2 init-pos y) 76.0) - (set! (-> obj particles s5-2 init-pos z) 5.0) - (set! (-> obj particles s5-2 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-2 (-> this nb-of-particles))) + (set! (-> this particles s5-2) (new 'static 'hud-particle)) + (set! (-> this particles s5-2 part) (create-launch-control (-> *part-group-id-table* 78) this)) + (set! (-> this particles s5-2 init-pos x) 70.0) + (set! (-> this particles s5-2 init-pos y) 76.0) + (set! (-> this particles s5-2 init-pos z) 5.0) + (set! (-> this particles s5-2 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-3 part matrix) -1) - (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-3 (-> this nb-of-particles)) + (if (= (-> this particles s5-3 part matrix) -1) + (set! (-> this particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) - (set! (-> obj x-sgn) -1) - (set! (-> obj y-sgn) -1) - (set! (-> obj friend) 0) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set! (-> this x-sgn) -1) + (set! (-> this y-sgn) -1) + (set! (-> this friend) 0) 0 (none) ) -(defmethod set-pos-and-scale hud-health ((obj hud-health) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-health ((this hud-health) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj particles 0 init-pos x) 65.0) - (set! (-> obj particles 0 init-pos y) 55.0) - (set! (-> obj particles 1 init-pos x) 98.0) - (set! (-> obj particles 1 init-pos y) 55.0) - (set! (-> obj particles 2 init-pos x) 73.0) - (set! (-> obj particles 2 init-pos y) 80.0) - (set! (-> obj scale) 6144.0) + (set! (-> this particles 0 init-pos x) 65.0) + (set! (-> this particles 0 init-pos y) 55.0) + (set! (-> this particles 1 init-pos x) 98.0) + (set! (-> this particles 1 init-pos y) 55.0) + (set! (-> this particles 2 init-pos x) 73.0) + (set! (-> this particles 2 init-pos y) 80.0) + (set! (-> this scale) 6144.0) ) (else - (set! (-> obj particles 0 init-pos x) 61.0) - (set! (-> obj particles 0 init-pos y) 55.0) - (set! (-> obj particles 1 init-pos x) 98.0) - (set! (-> obj particles 1 init-pos y) 55.0) - (set! (-> obj particles 2 init-pos x) 70.0) - (set! (-> obj particles 2 init-pos y) 76.0) - (set! (-> obj scale) 6963.2) + (set! (-> this particles 0 init-pos x) 61.0) + (set! (-> this particles 0 init-pos y) 55.0) + (set! (-> this particles 1 init-pos x) 98.0) + (set! (-> this particles 1 init-pos y) 55.0) + (set! (-> this particles 2 init-pos x) 70.0) + (set! (-> this particles 2 init-pos y) 76.0) + (set! (-> this scale) 6963.2) (with-pc (when (not (-> *pc-settings* use-vis?)) - (let ((base-x (-> obj particles 0 init-pos x))) - (set! (-> obj particles 1 init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> obj particles 1 init-pos x) base-x)))) - (set! (-> obj particles 2 init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> obj particles 2 init-pos x) base-x)))) + (let ((base-x (-> this particles 0 init-pos x))) + (set! (-> this particles 1 init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> this particles 1 init-pos x) base-x)))) + (set! (-> this particles 2 init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> this particles 2 init-pos x) base-x)))) ) ) ) @@ -479,20 +479,20 @@ ) -(defmethod draw-hud hud-money-all ((obj hud-money-all)) +(defmethod draw-hud hud-money-all ((this hud-money-all)) (let ((t9-0 (method-of-type hud draw-hud))) - (t9-0 obj) + (t9-0 this) ) 0 (let ((s5-0 0)) - (when (>= (-> obj level-index) 0) + (when (>= (-> this level-index) 0) (let ((s5-1 (new 'stack 'font-context *font-default-matrix* - (+ (* (-> obj x-sgn) (-> obj offset)) -60 (-> obj text-x)) - (+ (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) + (+ (* (-> this x-sgn) (-> this offset)) -60 (-> this text-x)) + (+ (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale)) ) 2 @@ -516,7 +516,7 @@ ) (set! (-> s5-1 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text - (lookup-text! *common-text* (-> *level-task-data* (-> obj level-index) level-name-id) #f) + (lookup-text! *common-text* (-> *level-task-data* (-> this level-index) level-name-id) #f) s5-1 #f 128 @@ -530,12 +530,12 @@ (s4-1 (-> s3-0 base)) ) (let ((s2-0 draw-string-xy)) - (format (clear *temp-string*) "~D/~D" (-> obj total-orbs) (-> obj total-orbs)) + (format (clear *temp-string*) "~D/~D" (-> this total-orbs) (-> this total-orbs)) (s2-0 *temp-string* s3-0 - (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset)) s1-0) - (+ (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) + (+ (-> this text-x) (* (-> this x-sgn) (-> this offset)) s1-0) + (+ (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale)) ) 2 @@ -566,15 +566,15 @@ (none) ) -(defmethod hud-update hud-money-all ((obj hud-money-all)) +(defmethod hud-update hud-money-all ((this hud-money-all)) (when *target* (hide-bottom-hud) (when (!= *master-mode* 'pause) - (when (and (!= (-> obj icons 0) 0) (-> obj icons 0 icon)) - (set! (-> obj icons 0 scale-x) (-> obj x-scale)) - (set! (-> obj icons 0 scale-y) (-> obj y-scale)) - (set! (-> obj icons 0 icon-y) (* (-> obj y-pos) (the int (-> *video-parms* relative-y-scale)))) - (let ((a0-6 (-> obj icons 0 icon 0 root))) + (when (and (!= (-> this icons 0) 0) (-> this icons 0 icon)) + (set! (-> this icons 0 scale-x) (-> this x-scale)) + (set! (-> this icons 0 scale-y) (-> this y-scale)) + (set! (-> this icons 0 icon-y) (* (-> this y-pos) (the int (-> *video-parms* relative-y-scale)))) + (let ((a0-6 (-> this icons 0 icon 0 root))) (set-yaw-angle-clear-roll-pitch! a0-6 (- (y-angle a0-6) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) @@ -582,20 +582,20 @@ ) ) ) - (if (>= (+ (-> *display* base-frame-counter) (seconds -5)) (-> obj start-time)) - (set! (-> obj deactivate-when-hidden) #t) - (tally-value obj (the-as int (-> *display* base-frame-counter)) 0) + (if (>= (+ (-> *display* base-frame-counter) (seconds -5)) (-> this start-time)) + (set! (-> this deactivate-when-hidden) #t) + (tally-value this (the-as int (-> *display* base-frame-counter)) 0) ) ) 0 (none) ) -(defmethod init-particles! hud-money-all ((obj hud-money-all) (arg0 int)) - (when (< (-> obj nb-of-icons) 6) - (let ((s4-0 (-> obj nb-of-icons))) - (set! (-> obj icons s4-0) (new 'static 'hud-icon)) - (let ((s3-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to obj))) +(defmethod init-particles! hud-money-all ((this hud-money-all) (arg0 int)) + (when (< (-> this nb-of-icons) 6) + (let ((s4-0 (-> this nb-of-icons))) + (set! (-> this icons s4-0) (new 'static 'hud-icon)) + (let ((s3-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to this))) (when s3-0 (set! (-> (the-as process-drawable (-> s3-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s3-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -604,42 +604,42 @@ (send-event (ppointer->process s3-0) 'trans-hook #f) ) ) - (set! (-> obj icons s4-0 icon) (the-as (pointer manipy) s3-0)) + (set! (-> this icons s4-0 icon) (the-as (pointer manipy) s3-0)) (when s3-0 (logior! (-> s3-0 0 mask) (process-mask pause)) (logclear! (-> s3-0 0 mask) (process-mask menu progress)) (set! (-> (the-as process-drawable (-> s3-0 0)) root trans z) 1024.0) - (set! (-> obj icons s4-0 icon-x) 170) - (set! (-> obj icons s4-0 icon-y) 0) - (set! (-> obj icons s4-0 icon-z) 0) - (set! (-> obj icons s4-0 scale-x) 0.0095) - (set! (-> obj icons s4-0 scale-y) -0.011) + (set! (-> this icons s4-0 icon-x) 170) + (set! (-> this icons s4-0 icon-y) 0) + (set! (-> this icons s4-0 icon-z) 0) + (set! (-> this icons s4-0 scale-x) 0.0095) + (set! (-> this icons s4-0 scale-y) -0.011) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s4-1 (-> obj nb-of-particles))) - (set! (-> obj particles s4-1) (new 'static 'hud-particle)) - (set! (-> obj particles s4-1 part) (create-launch-control (-> *part-group-id-table* 705) obj)) - (set! (-> obj particles s4-1 init-pos x) 172.0) - (set! (-> obj particles s4-1 init-pos y) 330.0) - (set! (-> obj particles s4-1 init-pos z) 2.0) - (set! (-> obj particles s4-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s4-1 (-> this nb-of-particles))) + (set! (-> this particles s4-1) (new 'static 'hud-particle)) + (set! (-> this particles s4-1 part) (create-launch-control (-> *part-group-id-table* 705) this)) + (set! (-> this particles s4-1 init-pos x) 172.0) + (set! (-> this particles s4-1 init-pos y) 330.0) + (set! (-> this particles s4-1 init-pos z) 2.0) + (set! (-> this particles s4-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) - (dotimes (s4-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s4-3 part matrix) -1) - (set! (-> obj particles s4-3 part matrix) (sprite-allocate-user-hvdf)) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (dotimes (s4-3 (-> this nb-of-particles)) + (if (= (-> this particles s4-3 part matrix) -1) + (set! (-> this particles s4-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set! (-> obj text-x) 251) - (set! (-> obj text-y) 305) - (set! (-> obj x-sgn) 0) - (set! (-> obj y-sgn) 1) + (set! (-> this text-x) 251) + (set! (-> this text-y) 305) + (set! (-> this x-sgn) 0) + (set! (-> this y-sgn) 1) (hide-bottom-hud) (let ((s4-4 0) (s3-2 0) @@ -660,45 +660,45 @@ ) (cond ((= s3-2 s4-4) - (set! (-> obj total-orbs) s4-4) - (set! (-> obj total-orbs) s4-4) - (set! (-> obj level-index) -1) + (set! (-> this total-orbs) s4-4) + (set! (-> this total-orbs) s4-4) + (set! (-> this level-index) -1) ) - ((begin (set! (-> obj total-orbs) s2-2) (< arg0 (length *level-task-data*))) - (set! (-> obj level-index) arg0) + ((begin (set! (-> this total-orbs) s2-2) (< arg0 (length *level-task-data*))) + (set! (-> this level-index) arg0) ) (else - (set! (-> obj level-index) -1) + (set! (-> this level-index) -1) ) ) ) - (set! (-> obj start-time) (-> *display* base-frame-counter)) + (set! (-> this start-time) (-> *display* base-frame-counter)) (sound-play "get-all-orbs") 0 (none) ) -(defmethod set-pos-and-scale hud-money-all ((obj hud-money-all) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-money-all ((this hud-money-all) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj x-scale) 0.01845) - (set! (-> obj y-scale) -0.02175) - (set! (-> obj y-pos) (if arg1 + (set! (-> this x-scale) 0.01845) + (set! (-> this y-scale) -0.02175) + (set! (-> this y-pos) (if arg1 374 373 ) ) ) (else - (set! (-> obj x-scale) 0.013499999) - (set! (-> obj y-scale) -0.01575) - (set! (-> obj y-pos) 361) + (set! (-> this x-scale) 0.013499999) + (set! (-> this y-scale) -0.01575) + (set! (-> this y-pos) 361) ) ) (when arg1 - (set! (-> obj x-scale) (* 1.02 (-> obj x-scale))) - (set! (-> obj y-scale) (* 1.2 (-> obj y-scale))) - (set! (-> obj y-pos) (the int (* 1.21 (the float (-> obj y-pos))))) + (set! (-> this x-scale) (* 1.02 (-> this x-scale))) + (set! (-> this y-scale) (* 1.2 (-> this y-scale))) + (set! (-> this y-pos) (the int (* 1.21 (the float (-> this y-pos))))) ) 0 (none) @@ -737,14 +737,14 @@ ) (define-extern *game-counts* game-count-info) -(defmethod draw-hud hud-money ((obj hud-money)) +(defmethod draw-hud hud-money ((this hud-money)) (let ((t9-0 (method-of-type hud draw-hud))) - (t9-0 obj) + (t9-0 this) ) (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug)) - (let* ((string-x (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset)))) - (string-y (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) (the int (-> *video-parms* relative-y-scale))) 2)) + (let* ((string-x (+ (-> this text-x) (* (-> this x-sgn) (-> this offset)))) + (string-y (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale))) 2)) ) (case *hud-collectable-view* (((hud-collectable-view game-totals)) @@ -784,7 +784,7 @@ (((hud-collectable-view original)) ;; show original (total collected, unspent orbs) (draw-string-xy - (string-format "~D" (-> obj value)) + (string-format "~D" (-> this value)) buf string-x string-y @@ -799,14 +799,14 @@ (none) ) -(defmethod hud-update hud-money ((obj hud-money)) +(defmethod hud-update hud-money ((this hud-money)) (when *target* (when (!= *master-mode* 'pause) - (when (and (!= (-> obj icons 0) 0) (-> obj icons 0 icon)) - (set! (-> obj icons 0 scale-x) (-> obj x-scale)) - (set! (-> obj icons 0 scale-y) (-> obj y-scale)) - (set! (-> obj icons 0 icon-y) (* (-> obj y-pos) (the int (-> *video-parms* relative-y-scale)))) - (let ((a0-6 (-> obj icons 0 icon 0 root))) + (when (and (!= (-> this icons 0) 0) (-> this icons 0 icon)) + (set! (-> this icons 0 scale-x) (-> this x-scale)) + (set! (-> this icons 0 scale-y) (-> this y-scale)) + (set! (-> this icons 0 icon-y) (* (-> this y-pos) (the int (-> *video-parms* relative-y-scale)))) + (let ((a0-6 (-> this icons 0 icon 0 root))) (set-yaw-angle-clear-roll-pitch! a0-6 (- (y-angle a0-6) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) @@ -814,17 +814,17 @@ ) ) ) - (tally-value obj (the int (+ 0.5 (-> *target* game money))) 0) + (tally-value this (the int (+ 0.5 (-> *target* game money))) 0) ) 0 (none) ) -(defmethod init-particles! hud-money ((obj hud-money) (arg0 int)) - (when (< (-> obj nb-of-icons) 6) - (let ((s5-0 (-> obj nb-of-icons))) - (set! (-> obj icons s5-0) (new 'static 'hud-icon)) - (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to obj))) +(defmethod init-particles! hud-money ((this hud-money) (arg0 int)) + (when (< (-> this nb-of-icons) 6) + (let ((s5-0 (-> this nb-of-icons))) + (set! (-> this icons s5-0) (new 'static 'hud-icon)) + (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to this))) (when s4-0 (set! (-> (the-as process-drawable (-> s4-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s4-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -833,64 +833,64 @@ (send-event (ppointer->process s4-0) 'trans-hook #f) ) ) - (set! (-> obj icons s5-0 icon) (the-as (pointer manipy) s4-0)) + (set! (-> this icons s5-0 icon) (the-as (pointer manipy) s4-0)) (when s4-0 (logior! (-> s4-0 0 mask) (process-mask pause)) (logclear! (-> s4-0 0 mask) (process-mask menu progress)) (set! (-> (the-as process-drawable (-> s4-0 0)) root trans z) 1024.0) - (set! (-> obj icons s5-0 icon-x) 399) - (set! (-> obj icons s5-0 icon-y) 79) - (set! (-> obj icons s5-0 icon-z) 0) - (set! (-> obj icons s5-0 scale-x) 0.0095) - (set! (-> obj icons s5-0 scale-y) -0.011) + (set! (-> this icons s5-0 icon-x) 399) + (set! (-> this icons s5-0 icon-y) 79) + (set! (-> this icons s5-0 icon-z) 0) + (set! (-> this icons s5-0 scale-x) 0.0095) + (set! (-> this icons s5-0 scale-y) -0.011) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 79) obj)) - (set! (-> obj particles s5-1 init-pos x) 400.0) - (set! (-> obj particles s5-1 init-pos y) 58.0) - (set! (-> obj particles s5-1 init-pos z) 2.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 79) this)) + (set! (-> this particles s5-1 init-pos x) 400.0) + (set! (-> this particles s5-1 init-pos y) 58.0) + (set! (-> this particles s5-1 init-pos z) 2.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) - (dotimes (s5-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-3 part matrix) -1) - (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (dotimes (s5-3 (-> this nb-of-particles)) + (if (= (-> this particles s5-3 part matrix) -1) + (set! (-> this particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set! (-> obj text-x) 420) - (set! (-> obj text-y) 45) - (set! (-> obj x-sgn) 1) - (set! (-> obj y-sgn) -1) - (set! (-> obj increment-on-event) #t) + (set! (-> this text-x) 420) + (set! (-> this text-y) 45) + (set! (-> this x-sgn) 1) + (set! (-> this y-sgn) -1) + (set! (-> this increment-on-event) #t) 0 (none) ) -(defmethod set-pos-and-scale hud-money ((obj hud-money) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-money ((this hud-money) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj x-scale) 0.0123) - (set! (-> obj y-scale) -0.0145) - (set! (-> obj y-pos) 86) + (set! (-> this x-scale) 0.0123) + (set! (-> this y-scale) -0.0145) + (set! (-> this y-pos) 86) ) (else - (set! (-> obj x-scale) 0.0095) - (set! (-> obj y-scale) -0.011) - (set! (-> obj y-pos) 79) + (set! (-> this x-scale) 0.0095) + (set! (-> this y-scale) -0.011) + (set! (-> this y-pos) 79) ) ) (when arg1 - (set! (-> obj x-scale) (* 1.1 (-> obj x-scale))) - (set! (-> obj y-scale) (* 1.2 (-> obj y-scale))) - (set! (-> obj y-pos) (the int (* (the float (-> obj y-pos)) (if arg0 + (set! (-> this x-scale) (* 1.1 (-> this x-scale))) + (set! (-> this y-scale) (* 1.2 (-> this y-scale))) + (set! (-> this y-pos) (the int (* (the float (-> this y-pos)) (if arg0 0.95 0.9 ) @@ -902,19 +902,19 @@ (none) ) -(defmethod get-icon-pos-x hud-money ((obj hud-money)) - (-> obj icons 0 icon-x) +(defmethod get-icon-pos-x hud-money ((this hud-money)) + (-> this icons 0 icon-x) ) -(defmethod get-icon-pos-y hud-money ((obj hud-money)) - (-> obj icons 0 icon-y) +(defmethod get-icon-pos-y hud-money ((this hud-money)) + (-> this icons 0 icon-y) ) -(defmethod get-icon-scale-x hud-money ((obj hud-money)) +(defmethod get-icon-scale-x hud-money ((this hud-money)) 0.01 ) -(defmethod get-icon-scale-y hud-money ((obj hud-money)) +(defmethod get-icon-scale-y hud-money ((this hud-money)) -0.011 ) @@ -1137,14 +1137,14 @@ ) -(defmethod draw-hud hud-fuel-cell ((obj hud-fuel-cell)) +(defmethod draw-hud hud-fuel-cell ((this hud-fuel-cell)) (let ((t9-0 (method-of-type hud draw-hud))) - (t9-0 obj) + (t9-0 this) ) (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug)) - (let* ((string-x (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset)))) - (string-y (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) (the int (-> *video-parms* relative-y-scale))) 2)) + (let* ((string-x (+ (-> this text-x) (* (-> this x-sgn) (-> this offset)))) + (string-y (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale))) 2)) ) (case *hud-collectable-view* (((hud-collectable-view game-totals)) @@ -1192,7 +1192,7 @@ (((hud-collectable-view original)) ;; show original (cells collected across entire game) (draw-string-xy - (string-format "~D" (-> obj value)) + (string-format "~D" (-> this value)) buf string-x string-y @@ -1251,50 +1251,50 @@ (none) ) -(defmethod hud-update hud-fuel-cell ((obj hud-fuel-cell)) +(defmethod hud-update hud-fuel-cell ((this hud-fuel-cell)) (when *target* (when (!= *master-mode* 'pause) - (let ((a0-2 (-> obj icons 0 icon 0 root))) + (let ((a0-2 (-> this icons 0 icon 0 root))) (set-yaw-angle-clear-roll-pitch! a0-2 (+ (y-angle a0-2) (* 182.04445 (* 0.5 (-> *display* time-adjust-ratio)))) ) ) ) - (set! (-> obj icons 0 icon-y) (-> obj icon-pos-y)) - (tally-value obj (the int (+ 0.5 (-> *target* game fuel))) 0) + (set! (-> this icons 0 icon-y) (-> this icon-pos-y)) + (tally-value this (the int (+ 0.5 (-> *target* game fuel))) 0) (let ((s5-1 (new 'stack-no-clear 'vector))) - (vector<-cspace! s5-1 (-> obj icons 0 icon 0 node-list data 3)) - (set! (-> obj particles 0 pos x) (-> s5-1 x)) - (set! (-> obj particles 0 pos y) (* 0.5 (-> s5-1 y))) - (set! (-> obj particles 0 pos z) (+ 2.0 (* 0.05 (+ -2048.0 (-> s5-1 z))))) + (vector<-cspace! s5-1 (-> this icons 0 icon 0 node-list data 3)) + (set! (-> this particles 0 pos x) (-> s5-1 x)) + (set! (-> this particles 0 pos y) (* 0.5 (-> s5-1 y))) + (set! (-> this particles 0 pos z) (+ 2.0 (* 0.05 (+ -2048.0 (-> s5-1 z))))) ) ) 0 (none) ) -(defmethod init-particles! hud-fuel-cell ((obj hud-fuel-cell) (arg0 int)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 80) obj)) - (set! (-> obj particles s5-0 init-pos x) 256.0) - (set! (-> obj particles s5-0 init-pos y) 224.0) - (set! (-> obj particles s5-0 init-pos z) 1.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod init-particles! hud-fuel-cell ((this hud-fuel-cell) (arg0 int)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 80) this)) + (set! (-> this particles s5-0 init-pos x) 256.0) + (set! (-> this particles s5-0 init-pos y) 224.0) + (set! (-> this particles s5-0 init-pos z) 1.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-1 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-1 part matrix) -1) - (set! (-> obj particles s5-1 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-1 (-> this nb-of-particles)) + (if (= (-> this particles s5-1 part matrix) -1) + (set! (-> this particles s5-1 part matrix) (sprite-allocate-user-hvdf)) ) ) - (when (< (-> obj nb-of-icons) 6) - (let ((s5-2 (-> obj nb-of-icons))) - (set! (-> obj icons s5-2) (new 'static 'hud-icon)) - (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *fuelcell-naked-sg* #f :to obj))) + (when (< (-> this nb-of-icons) 6) + (let ((s5-2 (-> this nb-of-icons))) + (set! (-> this icons s5-2) (new 'static 'hud-icon)) + (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *fuelcell-naked-sg* #f :to this))) (when s4-0 (set! (-> (the-as process-drawable (-> s4-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s4-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -1303,59 +1303,59 @@ (send-event (ppointer->process s4-0) 'trans-hook #f) ) ) - (set! (-> obj icons s5-2 icon) (the-as (pointer manipy) s4-0)) + (set! (-> this icons s5-2 icon) (the-as (pointer manipy) s4-0)) (when s4-0 (logior! (-> s4-0 0 mask) (process-mask pause)) (logclear! (-> s4-0 0 mask) (process-mask menu progress)) (set! (-> (the-as process-drawable (-> s4-0 0)) root trans z) 2048.0) - (set! (-> obj icons s5-2 icon-x) 256) - (set! (-> obj icons s5-2 icon-y) 62) - (set! (-> obj icons s5-2 icon-z) 0) - (set! (-> obj icons s5-2 scale-x) 0.009) - (set! (-> obj icons s5-2 scale-y) 0.009) + (set! (-> this icons s5-2 icon-x) 256) + (set! (-> this icons s5-2 icon-y) 62) + (set! (-> this icons s5-2 icon-z) 0) + (set! (-> this icons s5-2 scale-x) 0.009) + (set! (-> this icons s5-2 scale-y) 0.009) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (set! (-> obj text-x) 276) - (set! (-> obj text-y) 45) - (set! (-> obj x-sgn) 0) - (set! (-> obj y-sgn) -1) - (set! (-> obj increment-on-event) #t) - (set! (-> obj skip-particle) -2) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set! (-> this text-x) 276) + (set! (-> this text-y) 45) + (set! (-> this x-sgn) 0) + (set! (-> this y-sgn) -1) + (set! (-> this increment-on-event) #t) + (set! (-> this skip-particle) -2) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (let ((s5-4 (new 'stack-no-clear 'quaternion))) (quaternion-axis-angle! s5-4 0.0 1.0 0.0 16384.0) - (quaternion*! (-> obj icons 0 icon 0 root quat) s5-4 (-> obj icons 0 icon 0 root quat)) + (quaternion*! (-> this icons 0 icon 0 root quat) s5-4 (-> this icons 0 icon 0 root quat)) ) 0 (none) ) -(defmethod set-pos-and-scale hud-fuel-cell ((obj hud-fuel-cell) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-fuel-cell ((this hud-fuel-cell) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj scale-starburst-3-x) 10240.0) - (set! (-> obj scale-starburst-3-y) 9420.8) - (set! (-> obj scale-starburst-4-x) 9420.8) - (set! (-> obj scale-starburst-4-y) 8192.0) - (set! (-> obj scale-icon) 0.007) - (set! (-> obj scale-center) 6144.0) - (set! (-> obj icon-pos-y) 62) + (set! (-> this scale-starburst-3-x) 10240.0) + (set! (-> this scale-starburst-3-y) 9420.8) + (set! (-> this scale-starburst-4-x) 9420.8) + (set! (-> this scale-starburst-4-y) 8192.0) + (set! (-> this scale-icon) 0.007) + (set! (-> this scale-center) 6144.0) + (set! (-> this icon-pos-y) 62) ) (else - (set! (-> obj scale-starburst-3-x) 12288.0) - (set! (-> obj scale-starburst-3-y) 10240.0) - (set! (-> obj scale-starburst-4-x) 12288.0) - (set! (-> obj scale-starburst-4-y) 10240.0) - (set! (-> obj scale-icon) 0.009) - (set! (-> obj scale-center) 7372.8) - (set! (-> obj icon-pos-y) 62) + (set! (-> this scale-starburst-3-x) 12288.0) + (set! (-> this scale-starburst-3-y) 10240.0) + (set! (-> this scale-starburst-4-x) 12288.0) + (set! (-> this scale-starburst-4-y) 10240.0) + (set! (-> this scale-icon) 0.009) + (set! (-> this scale-center) 7372.8) + (set! (-> this icon-pos-y) 62) ) ) (if arg1 - (set! (-> obj icon-pos-y) (the int (* (the float (-> obj icon-pos-y)) (if arg0 + (set! (-> this icon-pos-y) (the int (* (the float (-> this icon-pos-y)) (if arg0 1.1 1.14 ) @@ -1428,12 +1428,12 @@ (none) ) -(defmethod draw-hud hud-buzzers ((obj hud-buzzers)) +(defmethod draw-hud hud-buzzers ((this hud-buzzers)) (let ((t9-0 (method-of-type hud draw-hud))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj text-y) (+ (if (nonzero? (-> obj next-y-offset)) - (-> obj text-y-offset) + (set! (-> this text-y) (+ (if (nonzero? (-> this next-y-offset)) + (-> this text-y-offset) 0 ) 362 @@ -1441,8 +1441,8 @@ ) (with-dma-buffer-add-bucket ((buf (-> (current-frame) global-buf)) (bucket-id debug)) - (let* ((string-x (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset)))) - (string-y (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) (the int (-> *video-parms* relative-y-scale))) 2)) + (let* ((string-x (+ (-> this text-x) (* (-> this x-sgn) (-> this offset)))) + (string-y (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale))) 2)) ) (case *hud-collectable-view* (((hud-collectable-view game-totals)) @@ -1482,7 +1482,7 @@ (((hud-collectable-view original)) ;; show original (flies collected this level) (draw-string-xy - (string-format " ~D" (-> obj value)) + (string-format " ~D" (-> this value)) buf string-x string-y @@ -1497,72 +1497,72 @@ (none) ) -(defmethod hud-update hud-buzzers ((obj hud-buzzers)) +(defmethod hud-update hud-buzzers ((this hud-buzzers)) (if *target* - (tally-value obj (the int (+ 0.5 (-> *target* fact-info-target buzzer))) 0) + (tally-value this (the int (+ 0.5 (-> *target* fact-info-target buzzer))) 0) ) 0 (none) ) -(defmethod init-particles! hud-buzzers ((obj hud-buzzers) (arg0 int)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 81) obj)) - (set! (-> obj particles s5-0 init-pos x) 60.0) - (set! (-> obj particles s5-0 init-pos y) 380.0) - (set! (-> obj particles s5-0 init-pos z) 1.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod init-particles! hud-buzzers ((this hud-buzzers) (arg0 int)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 81) this)) + (set! (-> this particles s5-0 init-pos x) 60.0) + (set! (-> this particles s5-0 init-pos y) 380.0) + (set! (-> this particles s5-0 init-pos z) 1.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-1 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-1 part matrix) -1) - (set! (-> obj particles s5-1 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-1 (-> this nb-of-particles)) + (if (= (-> this particles s5-1 part matrix) -1) + (set! (-> this particles s5-1 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) - (set! (-> obj text-x) 85) - (set! (-> obj text-y) 362) - (set! (-> obj x-sgn) -1) - (set! (-> obj y-sgn) 1) - (set! (-> obj text-y-offset) 0) - (set! (-> obj increment-on-event) #t) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set! (-> this text-x) 85) + (set! (-> this text-y) 362) + (set! (-> this x-sgn) -1) + (set! (-> this y-sgn) 1) + (set! (-> this text-y-offset) 0) + (set! (-> this increment-on-event) #t) 0 (none) ) -(defmethod get-icon-pos-x hud-buzzers ((obj hud-buzzers)) - (-> obj text-x) +(defmethod get-icon-pos-x hud-buzzers ((this hud-buzzers)) + (-> this text-x) ) -(defmethod get-icon-pos-y hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-pos-y hud-buzzers ((this hud-buzzers)) (+ (if (= (-> *setting-control* current video-mode) 'pal) - (+ (-> obj text-y) 120) - (+ (-> obj text-y) 50) + (+ (-> this text-y) 120) + (+ (-> this text-y) 50) ) - (-> obj next-y-offset) + (-> this next-y-offset) ) ) -(defmethod get-icon-scale-x hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-scale-x hud-buzzers ((this hud-buzzers)) 0.008 ) -(defmethod get-icon-scale-y hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-scale-y hud-buzzers ((this hud-buzzers)) -0.008 ) -(defmethod set-pos-and-scale hud-buzzers ((obj hud-buzzers) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-buzzers ((this hud-buzzers) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj scale) 6553.6) - (set! (-> obj text-y-offset) -40) + (set! (-> this scale) 6553.6) + (set! (-> this text-y-offset) -40) ) (else - (set! (-> obj scale) 7372.8) - (set! (-> obj text-y-offset) 0) + (set! (-> this scale) 7372.8) + (set! (-> this text-y-offset) 0) 0 ) ) @@ -1870,10 +1870,10 @@ (none) ) -(defmethod hud-update hud-power ((obj hud-power)) +(defmethod hud-update hud-power ((this hud-power)) (if *target* (tally-value - obj + this (max 0 (min @@ -1893,76 +1893,77 @@ (none) ) -(defmethod init-particles! hud-power ((obj hud-power) (arg0 int)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 83) obj)) - (set! (-> obj particles s5-0 init-pos x) 435.0) - (set! (-> obj particles s5-0 init-pos y) 370.0) - (set! (-> obj particles s5-0 init-pos z) 10.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod init-particles! hud-power ((this hud-power) (arg0 int)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 83) this)) + (set! (-> this particles s5-0 init-pos x) 435.0) + (set! (-> this particles s5-0 init-pos y) 370.0) + (set! (-> this particles s5-0 init-pos z) 10.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 84) obj)) - (set! (-> obj particles s5-1 init-pos x) 432.0) - (set! (-> obj particles s5-1 init-pos y) 368.0) - (set! (-> obj particles s5-1 init-pos z) 3.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 84) this)) + (set! (-> this particles s5-1 init-pos x) 432.0) + (set! (-> this particles s5-1 init-pos y) 368.0) + (set! (-> this particles s5-1 init-pos z) 3.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 82) obj)) - (set! (-> obj particles s5-2 init-pos x) 435.0) - (set! (-> obj particles s5-2 init-pos y) 370.0) - (set! (-> obj particles s5-2 init-pos z) 2.0) - (set! (-> obj particles s5-2 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-2 (-> this nb-of-particles))) + (set! (-> this particles s5-2) (new 'static 'hud-particle)) + (set! (-> this particles s5-2 part) (create-launch-control (-> *part-group-id-table* 82) this)) + (set! (-> this particles s5-2 init-pos x) 435.0) + (set! (-> this particles s5-2 init-pos y) 370.0) + (set! (-> this particles s5-2 init-pos z) 2.0) + (set! (-> this particles s5-2 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-3 part matrix) -1) - (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-3 (-> this nb-of-particles)) + (if (= (-> this particles s5-3 part matrix) -1) + (set! (-> this particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) - (set! (-> obj x-sgn) 1) - (set! (-> obj y-sgn) 1) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set! (-> this x-sgn) 1) + (set! (-> this y-sgn) 1) 0 (none) ) -(defmethod set-pos-and-scale hud-power ((obj hud-power) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-power ((this hud-power) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj scale-blue) 7168.0) - (set! (-> obj scale-timer) 11468.8) - (set! (-> obj scale-backing) 8960.0) + (set! (-> this scale-blue) 7168.0) + (set! (-> this scale-timer) 11468.8) + (set! (-> this scale-backing) 8960.0) ) (else - (set! (-> obj scale-blue) 8192.0) - (set! (-> obj scale-timer) 13107.2) - (set! (-> obj scale-backing) 10240.0) + (set! (-> this scale-blue) 8192.0) + (set! (-> this scale-timer) 13107.2) + (set! (-> this scale-backing) 10240.0) ) ) + ;; og:preserve-this (#when PC_PORT - (let ((base-x (-> obj particles 2 init-pos x))) + (let ((base-x (-> this particles 2 init-pos x))) (+! base-x (* (- 512.0 base-x) (- 1.0 (-> *pc-settings* aspect-ratio-reciprocal)))) - (set! (-> obj particles 0 init-pos x) 435.0) - (set! (-> obj particles 1 init-pos x) 432.0) - (set! (-> obj particles 2 init-pos x) 435.0) + (set! (-> this particles 0 init-pos x) 435.0) + (set! (-> this particles 1 init-pos x) 432.0) + (set! (-> this particles 2 init-pos x) 435.0) (when (not (-> *pc-settings* use-vis?)) - (dotimes (i (-> obj nb-of-particles)) - (set! (-> obj particles i init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> obj particles i init-pos x) base-x)))) + (dotimes (i (-> this nb-of-particles)) + (set! (-> this particles i init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> this particles i init-pos x) base-x)))) )) diff --git a/goal_src/jak1/engine/ui/hud.gc b/goal_src/jak1/engine/ui/hud.gc index f555210c75..6f19996ab7 100644 --- a/goal_src/jak1/engine/ui/hud.gc +++ b/goal_src/jak1/engine/ui/hud.gc @@ -7,35 +7,35 @@ ;; DECOMP BEGINS -(defmethod relocate hud ((obj hud) (arg0 int)) - (dotimes (v1-0 (-> obj nb-of-particles)) - (if (nonzero? (-> obj particles v1-0 part)) - (&+! (-> obj particles v1-0 part) arg0) +(defmethod relocate hud ((this hud) (arg0 int)) + (dotimes (v1-0 (-> this nb-of-particles)) + (if (nonzero? (-> this particles v1-0 part)) + (&+! (-> this particles v1-0 part) arg0) ) ) - (the-as hud ((method-of-type process relocate) obj arg0)) + (the-as hud ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate hud ((obj hud)) +(defmethod deactivate hud ((this hud)) (dotimes (v1-0 9) - (if (and (-> *hud-parts* parts v1-0) (= (ppointer->process (-> *hud-parts* parts v1-0)) obj)) + (if (and (-> *hud-parts* parts v1-0) (= (ppointer->process (-> *hud-parts* parts v1-0)) this)) (set! (-> *hud-parts* parts v1-0) (the-as (pointer hud) #f)) ) ) - (dotimes (s5-0 (-> obj nb-of-particles)) - (kill-and-free-particles (-> obj particles s5-0 part)) - (set! (-> obj particles s5-0 part matrix) -1) + (dotimes (s5-0 (-> this nb-of-particles)) + (kill-and-free-particles (-> this particles s5-0 part)) + (set! (-> this particles s5-0 part matrix) -1) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) -(defmethod draw-hud hud ((obj hud)) - (when (and (not (hidden? obj)) (not (paused?))) - (dotimes (s5-0 (-> obj nb-of-particles)) - (when (!= s5-0 (-> obj skip-particle)) - (if (or (!= (-> obj particles 0 pos x) 0.0) (!= (-> obj particles 0 pos y) 0.0)) - (spawn (-> obj particles s5-0 part) *null-vector*) +(defmethod draw-hud hud ((this hud)) + (when (and (not (hidden? this)) (not (paused?))) + (dotimes (s5-0 (-> this nb-of-particles)) + (when (!= s5-0 (-> this skip-particle)) + (if (or (!= (-> this particles 0 pos x) 0.0) (!= (-> this particles 0 pos y) 0.0)) + (spawn (-> this particles s5-0 part) *null-vector*) ) ) ) @@ -44,24 +44,24 @@ (none) ) -(defmethod tally-value hud ((obj hud) (arg0 int) (arg1 int)) - (if (= arg0 (-> obj target-value)) - (set! (-> obj last-target-equal-time) (-> *display* base-frame-counter)) +(defmethod tally-value hud ((this hud) (arg0 int) (arg1 int)) + (if (= arg0 (-> this target-value)) + (set! (-> this last-target-equal-time) (-> *display* base-frame-counter)) ) (when (and (not *progress-process*) - (and (!= (-> obj last-hide-time) (-> *display* base-frame-counter)) + (and (!= (-> this last-hide-time) (-> *display* base-frame-counter)) (not (movie?)) (>= (- (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) (seconds 0.1)) (>= (- (-> *display* base-frame-counter) (-> *game-info* blackout-time)) (seconds 0.1)) (not (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed)))) ) ) - (when (or (!= (-> obj value) arg0) - (!= (-> obj value2) arg1) - (-> obj force-on-screen) - (or (and (cpad-hold? 0 l2) (not (-> obj disable))) + (when (or (!= (-> this value) arg0) + (!= (-> this value2) arg1) + (-> this force-on-screen) + (or (and (cpad-hold? 0 l2) (not (-> this disable))) (and (not *cheat-mode*) (cpad-hold? 0 r2)) - (-> obj first-init) + (-> this first-init) ) ) ;; modified for pc port @@ -77,65 +77,65 @@ ) ) (cond - ((and (-> obj increment-on-event) - (< (-> obj value) arg0) - (not (-> obj first-init)) - (< (- (-> *display* base-frame-counter) (-> obj last-target-equal-time)) (seconds 1.5)) + ((and (-> this increment-on-event) + (< (-> this value) arg0) + (not (-> this first-init)) + (< (- (-> *display* base-frame-counter) (-> this last-target-equal-time)) (seconds 1.5)) ) - (when (and (!= (-> obj value) (-> obj target-value)) - (>= (- (-> *display* base-frame-counter) (-> obj last-increment-time)) (seconds 0.1)) + (when (and (!= (-> this value) (-> this target-value)) + (>= (- (-> *display* base-frame-counter) (-> this last-increment-time)) (seconds 0.1)) ) (sound-play "cursor-options") - (+! (-> obj value) 1) - (set! (-> obj last-increment-time) (-> *display* base-frame-counter)) + (+! (-> this value) 1) + (set! (-> this last-increment-time) (-> *display* base-frame-counter)) ) ) (else - (if (not (and (not (-> obj first-init)) - (>= (- (-> *display* base-frame-counter) (-> obj last-target-equal-time)) (seconds 1.5)) + (if (not (and (not (-> this first-init)) + (>= (- (-> *display* base-frame-counter) (-> this last-target-equal-time)) (seconds 1.5)) ) ) - (set! (-> obj value) arg0) + (set! (-> this value) arg0) ) - (set! (-> obj target-value) arg0) - (set! (-> obj last-target-equal-time) (-> *display* base-frame-counter)) + (set! (-> this target-value) arg0) + (set! (-> this last-target-equal-time) (-> *display* base-frame-counter)) ) ) - (set! (-> obj value2) arg1) - (when (and (not (movie?)) (= *master-mode* 'game) (not (-> obj first-init)) (not (-> obj disable))) - (if (>= (-> obj friend) 0) - (send-event (ppointer->process (-> *hud-parts* parts (-> obj friend))) 'show) + (set! (-> this value2) arg1) + (when (and (not (movie?)) (= *master-mode* 'game) (not (-> this first-init)) (not (-> this disable))) + (if (>= (-> this friend) 0) + (send-event (ppointer->process (-> *hud-parts* parts (-> this friend))) 'show) ) (go hud-arriving) ) - (set! (-> obj trigger-time) (-> *display* base-frame-counter)) - (set! (-> obj first-init) #f) + (set! (-> this trigger-time) (-> *display* base-frame-counter)) + (set! (-> this first-init) #f) ) ) 0 (none) ) -(defmethod draw-icons hud ((obj hud)) - (dotimes (v1-0 (-> obj nb-of-icons)) +(defmethod draw-icons hud ((this hud)) + (dotimes (v1-0 (-> this nb-of-icons)) (set-vector! - (-> obj icons v1-0 icon 0 root scale) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) - (* (-> obj icons v1-0 scale-y) (-> *video-parms* relative-y-scale)) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) + (-> this icons v1-0 icon 0 root scale) + (* (-> this icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) + (* (-> this icons v1-0 scale-y) (-> *video-parms* relative-y-scale)) + (* (-> this icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) 1.0 ) - (set! (-> obj icons v1-0 icon 0 root trans x) - (the float (+ (-> obj icons v1-0 icon-x) -256 (* (-> obj x-sgn) (-> obj offset)))) + (set! (-> this icons v1-0 icon 0 root trans x) + (the float (+ (-> this icons v1-0 icon-x) -256 (* (-> this x-sgn) (-> this offset)))) ) - (set! (-> obj icons v1-0 icon 0 root trans y) - (- (+ (the float (-> obj icons v1-0 icon-y)) - (* (the float (-> obj y-sgn)) - (the float (-> obj offset)) + (set! (-> this icons v1-0 icon 0 root trans y) + (- (+ (the float (-> this icons v1-0 icon-y)) + (* (the float (-> this y-sgn)) + (the float (-> this offset)) (-> *video-parms* relative-y-scale) (-> *video-parms* relative-y-scale) ) - (* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical)) + (* (the float (-> this y-offset)) (-> *video-parms* relative-x-scale-reciprical)) ) (the float (-> *video-parms* screen-sy)) ) @@ -145,22 +145,23 @@ (none) ) -(defmethod draw-particles hud ((obj hud)) - (dotimes (s5-0 (-> obj nb-of-particles)) - (when (!= (-> obj skip-particle) -2) - (set! (-> obj particles s5-0 pos x) - (+ -256.0 (the float (* (-> obj x-sgn) (-> obj offset))) (-> obj particles s5-0 init-pos x)) +(defmethod draw-particles hud ((this hud)) + (dotimes (s5-0 (-> this nb-of-particles)) + (when (!= (-> this skip-particle) -2) + (set! (-> this particles s5-0 pos x) + (+ -256.0 (the float (* (-> this x-sgn) (-> this offset))) (-> this particles s5-0 init-pos x)) ) - (set! (-> obj particles s5-0 pos y) + (set! (-> this particles s5-0 pos y) (* 0.5 (- (* (-> *video-parms* relative-y-scale) - (+ (-> obj particles s5-0 init-pos y) - (the float (* (-> obj y-sgn) (-> obj offset))) + (+ (-> this particles s5-0 init-pos y) + (the float (* (-> this y-sgn) (-> this offset))) + ;; og:preserve-this (#if PC_PORT (if (not (-> *pc-settings* use-vis?)) - (* (the float (-> obj y-offset)) (-> *video-parms* relative-y-scale)) - (* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical)) + (* (the float (-> this y-offset)) (-> *video-parms* relative-y-scale)) + (* (the float (-> this y-offset)) (-> *video-parms* relative-x-scale-reciprical)) ) - (* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical)) + (* (the float (-> this y-offset)) (-> *video-parms* relative-x-scale-reciprical)) ) ) ) @@ -168,14 +169,14 @@ ) ) ) - (set! (-> obj particles s5-0 pos z) (-> obj particles s5-0 init-pos z)) + (set! (-> this particles s5-0 pos z) (-> this particles s5-0 init-pos z)) ) - (if (> (-> obj particles s5-0 part matrix) 0) + (if (> (-> this particles s5-0 part matrix) 0) (set-vector! - (sprite-get-user-hvdf (-> obj particles s5-0 part matrix)) - (the float (+ (the int (-> obj particles s5-0 pos x)) 2048)) - (the float (+ (the int (-> obj particles s5-0 pos y)) 2048)) - (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> obj particles s5-0 pos z))) + (sprite-get-user-hvdf (-> this particles s5-0 part matrix)) + (the float (+ (the int (-> this particles s5-0 pos x)) 2048)) + (the float (+ (the int (-> this particles s5-0 pos y)) 2048)) + (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> this particles s5-0 pos z))) (-> *math-camera* hvdf-off w) ) ) @@ -184,39 +185,39 @@ (none) ) -(defmethod hud-update hud ((obj hud)) +(defmethod hud-update hud ((this hud)) 0 (none) ) -(defmethod init-particles! hud ((obj hud) (arg0 int)) +(defmethod init-particles! hud ((this hud) (arg0 int)) 0 (none) ) -(defmethod get-icon-pos-x hud ((obj hud)) +(defmethod get-icon-pos-x hud ((this hud)) 0 ) -(defmethod get-icon-pos-y hud ((obj hud)) +(defmethod get-icon-pos-y hud ((this hud)) 0 ) -(defmethod get-icon-scale-x hud ((obj hud)) +(defmethod get-icon-scale-x hud ((this hud)) 0.0 ) -(defmethod get-icon-scale-y hud ((obj hud)) +(defmethod get-icon-scale-y hud ((this hud)) 0.0 ) -(defmethod set-pos-and-scale hud ((obj hud) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud ((this hud) (arg0 symbol) (arg1 symbol)) 0 (none) ) -(defmethod hidden? hud ((obj hud)) - (= (-> obj next-state name) 'hud-hidden) +(defmethod hidden? hud ((this hud)) + (= (-> this next-state name) 'hud-hidden) ) (defstate hud-hidden (hud) diff --git a/goal_src/jak1/engine/ui/progress/progress-draw.gc b/goal_src/jak1/engine/ui/progress/progress-draw.gc index 91143ada57..0003884d17 100644 --- a/goal_src/jak1/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak1/engine/ui/progress/progress-draw.gc @@ -14,7 +14,7 @@ ) ) -(defmethod draw-fuel-cell-screen progress ((obj progress) (arg0 int)) +(defmethod draw-fuel-cell-screen progress ((this progress) (arg0 int)) (local-vars (sv-112 int) (sv-128 int) @@ -34,25 +34,25 @@ (set! (-> *progress-process* 0 particles 15 init-pos x) -320.0) (set! (-> *progress-process* 0 icons 4 icon-x) -320) (when (and (!= s5-0 #f) (= (-> *game-info* level-opened arg0) 1)) - (set! sv-112 (- (-> *task-egg-starting-x* (-> s5-0 nb-of-tasks)) (-> obj left-x-offset))) - (set! sv-128 (the int (* 47.0 (-> obj transition-percentage-invert)))) + (set! sv-112 (- (-> *task-egg-starting-x* (-> s5-0 nb-of-tasks)) (-> this left-x-offset))) + (set! sv-128 (the int (* 47.0 (-> this transition-percentage-invert)))) 0 (let ((s0-0 6) (s2-0 0) - (s4-1 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (s4-1 (if (= (-> this level-transition) 1) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) - (f30-0 (-> obj transition-percentage-invert)) + (f30-0 (-> this transition-percentage-invert)) (s1-0 0) (s3-0 #f) ) - (when (-> obj stat-transition) + (when (-> this stat-transition) (set! sv-128 47) - (set! s2-0 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (set! s2-0 (if (!= (-> this display-state) (-> this next-display-state)) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) (set! s4-1 0) @@ -60,7 +60,7 @@ ) (set! sv-144 0) (while (< sv-144 4) - (let ((a0-18 (-> obj icons sv-144 icon 0 root))) + (let ((a0-18 (-> this icons sv-144 icon 0 root))) (set! sv-176 a0-18) (set! sv-160 (method-of-object sv-176 set-yaw-angle-clear-roll-pitch!)) (let ((a1-2 (+ (y-angle a0-18) (* 182.04445 (* 0.5 (-> *display* time-adjust-ratio)))))) @@ -76,16 +76,16 @@ (v1-59 -1) (a0-25 #f) ) - (set! (-> obj particle-state s0-0) 2) + (set! (-> this particle-state s0-0) 2) (cond ((or (= v0-4 (task-status need-hint)) (= v0-4 (task-status unknown))) (if (= *kernel-boot-message* 'play) - (set! (-> obj particle-state s0-0) 1) + (set! (-> this particle-state s0-0) 1) ) ) ((= v0-4 (task-status invalid)) (set! v1-59 (-> s5-0 task-info sv-208 text-index-when-resolved)) - (set! (-> obj particle-state s0-0) 3) + (set! (-> this particle-state s0-0) 3) (set! a0-25 #t) ) ((= v0-4 (task-status need-introduction)) @@ -107,14 +107,14 @@ (if (and (!= *kernel-boot-message* 'play) (= v1-59 -1)) (set! v1-59 0) ) - (set! (-> obj particles s0-0 init-pos x) (the float (+ sv-192 s2-0))) - (set! (-> obj particles s0-0 init-pos y) (the float (+ s4-1 204))) + (set! (-> this particles s0-0 init-pos x) (the float (+ sv-192 s2-0))) + (set! (-> this particles s0-0 init-pos y) (the float (+ s4-1 204))) (+! s0-0 1) - (when (= sv-208 (-> obj task-index)) + (when (= sv-208 (-> this task-index)) (set! s1-0 v1-59) (set! s3-0 a0-25) - (set! (-> obj particles 5 init-pos x) (the float (+ sv-192 s2-0))) - (set! (-> obj particles 5 init-pos y) (the float (+ s4-1 204))) + (set! (-> this particles 5 init-pos x) (the float (+ sv-192 s2-0))) + (set! (-> this particles 5 init-pos y) (the float (+ s4-1 204))) ) ) (set! sv-192 (+ sv-192 sv-128)) @@ -122,20 +122,20 @@ ) (dotimes (v1-77 (- 8 (-> s5-0 nb-of-tasks))) (set! (-> *progress-process* 0 particles s0-0 init-pos x) (the float (+ s2-0 -320))) - (set! (-> obj particles s0-0 init-pos y) (the float (+ s4-1 194))) + (set! (-> this particles s0-0 init-pos y) (the float (+ s4-1 194))) (+! s0-0 1) ) (when *common-text* (when (and (!= s1-0 -1) (> (-> s5-0 nb-of-tasks) 0) - (>= (-> obj task-index) 0) - (< (-> obj task-index) (-> s5-0 nb-of-tasks)) + (>= (-> this task-index) 0) + (< (-> this task-index) (-> s5-0 nb-of-tasks)) ) (let ((s0-1 (new 'stack 'font-context *font-default-matrix* - (- (+ s2-0 32) (-> obj left-x-offset)) + (- (+ s2-0 32) (-> this left-x-offset)) (+ (/ s4-1 2) 125) 8325000.0 (font-color progress-yellow) @@ -154,7 +154,7 @@ ) (set! (-> s0-1 flags) (font-flags shadow kerning middle middle-vert large)) (set! sv-224 print-game-text-scaled) - (let ((a0-47 (lookup-text! *common-text* (-> s5-0 task-info (-> obj task-index) task-name s1-0) #f)) + (let ((a0-47 (lookup-text! *common-text* (-> s5-0 task-info (-> this task-index) task-name s1-0) #f)) (a1-57 f30-0) (a2-15 s0-1) (a3-2 (the int (* 128.0 f30-0))) @@ -162,7 +162,7 @@ (sv-224 a0-47 a1-57 a2-15 a3-2) ) (when s3-0 - (set! (-> s0-1 origin x) (the float (- (+ s2-0 32) (-> obj left-x-offset)))) + (set! (-> s0-1 origin x) (the float (- (+ s2-0 32) (-> this left-x-offset)))) (set! (-> s0-1 origin y) (the float (+ (/ s4-1 2) 175))) (let ((a0-49 s0-1)) (set! (-> a0-49 color) (font-color progress-blue)) @@ -190,32 +190,32 @@ (none) ) -(defmethod draw-money-screen progress ((obj progress) (arg0 int)) +(defmethod draw-money-screen progress ((this progress) (arg0 int)) (hide-progress-icons) - (let* ((v1-1 (/ (-> obj transition-offset) 16)) - (s4-0 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (let* ((v1-1 (/ (-> this transition-offset) 16)) + (s4-0 (if (= (-> this level-transition) 1) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) - (f30-0 (-> obj transition-percentage-invert)) + (f30-0 (-> this transition-percentage-invert)) (s3-0 (- v1-1)) ) - (when (-> obj stat-transition) - (set! v1-1 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (when (-> this stat-transition) + (set! v1-1 (if (!= (-> this display-state) (-> this next-display-state)) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) (set! s3-0 v1-1) (set! s4-0 0) (set! f30-0 1.0) ) - (set! (-> obj particles 15 init-pos x) (the float (- (+ v1-1 150) (-> obj left-x-offset)))) - (set! (-> obj particles 15 init-pos y) (the float (+ s4-0 214))) - (set! (-> obj icons 4 icon-x) (- (+ v1-1 148) (-> obj left-x-offset))) - (set! (-> obj icons 4 icon-y) (+ (-> obj big-orb-y-offset) s4-0)) - (let ((a0-15 (-> obj icons 4 icon 0 root))) + (set! (-> this particles 15 init-pos x) (the float (- (+ v1-1 150) (-> this left-x-offset)))) + (set! (-> this particles 15 init-pos y) (the float (+ s4-0 214))) + (set! (-> this icons 4 icon-x) (- (+ v1-1 148) (-> this left-x-offset))) + (set! (-> this icons 4 icon-y) (+ (-> this big-orb-y-offset) s4-0)) + (let ((a0-15 (-> this icons 4 icon 0 root))) (set-yaw-angle-clear-roll-pitch! a0-15 (- (y-angle a0-15) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) @@ -226,7 +226,7 @@ 'stack 'font-context *font-default-matrix* - (- (+ s3-0 200) (-> obj left-x-offset)) + (- (+ s3-0 200) (-> this left-x-offset)) (+ (/ s4-0 2) 96) 8325000.0 (font-color default) @@ -264,7 +264,7 @@ ) (+! (-> s4-1 origin y) 15.0) (let ((s5-2 print-game-text-scaled)) - (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* money-total)) (-> obj total-nb-of-orbs)) + (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* money-total)) (-> this total-nb-of-orbs)) (s5-2 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) ) ) @@ -273,30 +273,30 @@ (none) ) -(defmethod draw-buzzer-screen progress ((obj progress) (arg0 int)) +(defmethod draw-buzzer-screen progress ((this progress) (arg0 int)) (hide-progress-icons) (let* ((v1-2 (-> *level-task-data* arg0)) - (a0-3 (/ (-> obj transition-offset) 16)) - (s4-0 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (a0-3 (/ (-> this transition-offset) 16)) + (s4-0 (if (= (-> this level-transition) 1) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) - (f30-0 (-> obj transition-percentage-invert)) + (f30-0 (-> this transition-percentage-invert)) (s3-0 (- a0-3)) ) - (when (-> obj stat-transition) - (set! a0-3 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (when (-> this stat-transition) + (set! a0-3 (if (!= (-> this display-state) (-> this next-display-state)) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) (set! s3-0 a0-3) (set! s4-0 0) (set! f30-0 1.0) ) - (set! (-> obj particles 14 init-pos x) (the float (- (+ a0-3 150) (-> obj left-x-offset)))) - (set! (-> obj particles 14 init-pos y) (the float (+ s4-0 214))) + (set! (-> this particles 14 init-pos x) (the float (- (+ a0-3 150) (-> this left-x-offset)))) + (set! (-> this particles 14 init-pos y) (the float (+ s4-0 214))) (let ((s2-0 0)) (let ((a1-8 (-> v1-2 buzzer-task-index))) (if (!= a1-8 -1) @@ -308,7 +308,7 @@ 'stack 'font-context *font-default-matrix* - (- (+ s3-0 200) (-> obj left-x-offset)) + (- (+ s3-0 200) (-> this left-x-offset)) (+ (/ s4-0 2) 96) 8325000.0 (font-color default) @@ -341,7 +341,7 @@ ) (+! (-> s4-1 origin y) 15.0) (let ((s5-2 print-game-text-scaled)) - (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* buzzer-total)) (-> obj total-nb-of-buzzers)) + (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* buzzer-total)) (-> this total-nb-of-buzzers)) (s5-2 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) ) ) @@ -351,7 +351,7 @@ (none) ) -(defmethod draw-memcard-storage-error progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-storage-error progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.55) ) @@ -363,7 +363,7 @@ ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s4-0 (text-id memcard-not-formatted-title))) - (case (-> obj display-state) + (case (-> this display-state) (((progress-screen memcard-no-space)) (set! s4-0 (text-id memcard-no-space)) ) @@ -373,10 +373,10 @@ ) (let ((s3-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* s4-0 #f) 1) - (s3-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s3-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 70.0) (let ((v1-12 arg0)) (set! (-> v1-12 width) (the float 350)) @@ -388,12 +388,12 @@ (format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-space-requirement1) #f) - (if (-> obj card-info) - (-> obj card-info mem-required) + (if (-> this card-info) + (-> this card-info mem-required) 0 ) ) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-1 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (set! (-> arg0 origin y) 115.0) (let ((v1-17 arg0)) @@ -401,7 +401,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id memcard-space-requirement2) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -411,7 +411,7 @@ (set! (-> arg0 origin y) 160.0) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -419,7 +419,7 @@ (none) ) -(defmethod draw-memcard-format progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-format progress ((this progress) (arg0 font-context)) (set! (-> arg0 origin y) 35.0) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.55) @@ -433,9 +433,9 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s4-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-not-formatted-title) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 105.0) (let ((v1-7 arg0)) (set! (-> v1-7 width) (the float 360)) @@ -445,7 +445,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id memcard-not-formatted-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -458,7 +458,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id format?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -466,12 +466,12 @@ (none) ) -(defmethod draw-memcard-data-exists progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-data-exists progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 55.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 365)) @@ -481,7 +481,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id save-data-already-exists) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -494,7 +494,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id overwrite?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -502,12 +502,12 @@ (none) ) -(defmethod draw-memcard-no-data progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-no-data progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 40.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 365)) @@ -517,7 +517,7 @@ ) (let ((s4-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id no-save-data) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (set! (-> arg0 origin y) 130.0) (let ((v1-7 arg0)) @@ -528,7 +528,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id create-save-data?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -536,12 +536,12 @@ (none) ) -(defmethod draw-memcard-accessing progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-accessing progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 1.0) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 35.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 365)) @@ -549,9 +549,9 @@ (let ((v1-5 arg0)) (set! (-> v1-5 height) (the float 75)) ) - (when (or (< (mod (-> *display* real-frame-counter) 300) 150) (!= (-> obj transition-percentage-invert) 1.0)) + (when (or (< (mod (-> *display* real-frame-counter) 300) 150) (!= (-> this transition-percentage-invert) 1.0)) (let ((a1-1 (text-id loading-data))) - (case (-> obj display-state) + (case (-> this display-state) (((progress-screen memcard-saving)) (set! a1-1 (text-id saving-data)) ) @@ -562,14 +562,14 @@ (set! a1-1 (text-id creating-save-data)) ) ) - (print-game-text-scaled (lookup-text! *common-text* a1-1 #f) (-> obj transition-percentage-invert) arg0 128) + (print-game-text-scaled (lookup-text! *common-text* a1-1 #f) (-> this transition-percentage-invert) arg0 128) ) ) (let ((v1-18 arg0)) (set! (-> v1-18 scale) 0.65) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 15 (-> this left-x-offset)))) (set! (-> arg0 origin y) 100.0) (let ((v1-22 arg0)) (set! (-> v1-22 width) (the float 370)) @@ -579,18 +579,18 @@ ) (let ((s4-1 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-do-not-remove) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-1 *temp-string* (-> this transition-percentage-invert) arg0 128) ) 0 (none) ) -(defmethod draw-memcard-insert progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-insert progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 35.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 310)) @@ -599,19 +599,19 @@ (set! (-> v1-5 height) (the float 110)) ) ;; og:preserve-this PAL patch here - (let ((v1-6 (-> obj card-info))) + (let ((v1-6 (-> this card-info))) (when (and (= (-> *setting-control* default language) (language-enum japanese)) v1-6 (zero? (-> v1-6 handle))) (set! (-> arg0 origin y) -15.0) (let ((s4-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-not-inserted) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (set! (-> arg0 origin y) 53.0) ) ) (let ((s4-1 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id insert-memcard) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-1 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (let ((v1-12 arg0)) (set! (-> v1-12 scale) 0.65) @@ -622,7 +622,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id back?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -630,7 +630,7 @@ (none) ) -(defmethod draw-memcard-file-select progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-file-select progress ((this progress) (arg0 font-context)) (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object)) @@ -642,29 +642,29 @@ (sv-128 (function _varargs_ object)) (sv-144 (function _varargs_ object)) ) - (let ((s4-0 (* (+ (-> obj transition-offset) -256) 2))) + (let ((s4-0 (* (+ (-> this transition-offset) -256) 2))) (if (< s4-0 0) (set! s4-0 0) ) (if (< 500 s4-0) (set! s4-0 700) ) - (set! (-> obj particles 19 init-pos x) (the float (- (- 202 (adjust-pos s4-0 150)) (-> obj left-x-offset)))) - (set! (-> obj particles 20 init-pos x) (the float (- (+ (adjust-pos s4-0 100) 202) (-> obj left-x-offset)))) - (set! (-> obj particles 21 init-pos x) (the float (- (- 202 (adjust-pos s4-0 50)) (-> obj left-x-offset)))) - (set! (-> obj particles 22 init-pos x) (the float (- (+ s4-0 202) (-> obj left-x-offset)))) + (set! (-> this particles 19 init-pos x) (the float (- (- 202 (adjust-pos s4-0 150)) (-> this left-x-offset)))) + (set! (-> this particles 20 init-pos x) (the float (- (+ (adjust-pos s4-0 100) 202) (-> this left-x-offset)))) + (set! (-> this particles 21 init-pos x) (the float (- (- 202 (adjust-pos s4-0 50)) (-> this left-x-offset)))) + (set! (-> this particles 22 init-pos x) (the float (- (+ s4-0 202) (-> this left-x-offset)))) ) (cond ((= (-> *setting-control* current video-mode) 'pal) - (set! (-> obj particles 21 init-pos y) 256.0) - (set! (-> obj particles 22 init-pos y) 338.0) + (set! (-> this particles 21 init-pos y) 256.0) + (set! (-> this particles 22 init-pos y) 338.0) ) (else - (set! (-> obj particles 21 init-pos y) 255.0) - (set! (-> obj particles 22 init-pos y) 336.0) + (set! (-> this particles 21 init-pos y) 255.0) + (set! (-> this particles 22 init-pos y) 336.0) ) ) - (let ((f0-13 (* 2.0 (+ -0.5 (-> obj transition-percentage-invert))))) + (let ((f0-13 (* 2.0 (+ -0.5 (-> this transition-percentage-invert))))) 128 (if (< f0-13 0.0) (set! f0-13 0.0) @@ -674,7 +674,7 @@ (set! (-> v1-29 scale) 0.5) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 102 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 102 (-> this left-x-offset)))) (set! (-> arg0 origin y) 5.0) (let ((v1-33 arg0)) (set! (-> v1-33 width) (the float 200)) @@ -685,7 +685,7 @@ (print-game-text (lookup-text! *common-text* - (if (= (-> obj display-state) (progress-screen load-game)) + (if (= (-> this display-state) (progress-screen load-game)) (text-id select-file-to-load) (text-id select-file-to-save) ) @@ -700,11 +700,11 @@ (let ((v1-37 arg0)) (set! (-> v1-37 height) (the float 20)) ) - (let ((s3-3 (-> obj card-info)) + (let ((s3-3 (-> this card-info)) (s2-0 23) ) (dotimes (s1-0 4) - (set! (-> arg0 origin x) (the float (- 41 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 41 (-> this left-x-offset)))) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (let ((a0-17 arg0)) (set! (-> a0-17 color) (font-color default)) @@ -714,7 +714,7 @@ ) (cond ((and s3-3 (= (-> s3-3 formatted) 1) (= (-> s3-3 inited) 1) (= (-> s3-3 file s1-0 present) 1)) - (set! (-> obj particles s2-0 init-pos x) (the float (- 66 (-> obj left-x-offset)))) + (set! (-> this particles s2-0 init-pos x) (the float (- 66 (-> this left-x-offset)))) (let ((v1-57 arg0)) (set! (-> v1-57 scale) 0.6) ) @@ -738,10 +738,10 @@ (set! (-> a0-28 color) (font-color progress-memcard)) ) (cond - ((or (>= (seconds 2) (- (-> *display* real-frame-counter) (-> obj last-option-index-change))) - (or (< (mod (- (-> *display* real-frame-counter) (-> obj last-option-index-change)) 1200) 600) - (!= (-> obj option-index) s1-0) - (-> obj in-transition) + ((or (>= (seconds 2) (- (-> *display* real-frame-counter) (-> this last-option-index-change))) + (or (< (mod (- (-> *display* real-frame-counter) (-> this last-option-index-change)) 1200) 600) + (!= (-> this option-index) s1-0) + (-> this in-transition) ) ) (let ((v1-87 arg0)) @@ -749,7 +749,7 @@ ) (+! (-> arg0 origin y) 16.0) (set! (-> arg0 flags) (font-flags shadow kerning middle large)) - (set! (-> arg0 origin x) (the float (- -73 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- -73 (-> this left-x-offset)))) (let ((v1-91 arg0)) (set! (-> v1-91 width) (the float 350)) ) @@ -763,7 +763,7 @@ ) (s0-2 *temp-string* arg0 #f s4-1 22) ) - (set! (-> arg0 origin x) (the float (- 1 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 1 (-> this left-x-offset)))) (let ((s0-3 print-game-text)) (set! sv-32 format) (let ((a0-44 (clear *temp-string*)) @@ -774,7 +774,7 @@ ) (s0-3 *temp-string* arg0 #f s4-1 22) ) - (set! (-> arg0 origin x) (the float (- 79 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 79 (-> this left-x-offset)))) (let ((s0-4 print-game-text)) (set! sv-48 format) (let ((a0-48 (clear *temp-string*)) @@ -790,7 +790,7 @@ (set! (-> v1-108 scale) 1.0) ) (set! (-> arg0 flags) (font-flags shadow kerning right large)) - (set! (-> arg0 origin x) (the float (- 352 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 352 (-> this left-x-offset)))) (let ((s0-5 print-game-text)) (set! sv-64 format) (let ((a0-52 (clear *temp-string*)) @@ -806,13 +806,13 @@ ) (+! (-> arg0 origin y) 9.0) (set! (-> arg0 flags) (font-flags shadow kerning large)) - (set! (-> arg0 origin x) (the float (- 85 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 85 (-> this left-x-offset)))) (let ((s0-6 print-game-text)) (set! sv-80 format) (let ((a0-56 (clear *temp-string*)) (a1-21 "/~D") (a2-17 (if (< 100 (the int (-> s3-3 file s1-0 fuel-cell-count))) - (-> obj total-nb-of-power-cells) + (-> this total-nb-of-power-cells) 100 ) ) @@ -821,23 +821,23 @@ ) (s0-6 *temp-string* arg0 #f s4-1 22) ) - (set! (-> arg0 origin x) (the float (- 150 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 150 (-> this left-x-offset)))) (let ((s0-7 print-game-text)) (set! sv-96 format) (let ((a0-60 (clear *temp-string*)) (a1-23 "/~D") - (a2-19 (-> obj total-nb-of-orbs)) + (a2-19 (-> this total-nb-of-orbs)) ) (sv-96 a0-60 a1-23 a2-19) ) (s0-7 *temp-string* arg0 #f s4-1 22) ) - (set! (-> arg0 origin x) (the float (- 238 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 238 (-> this left-x-offset)))) (let ((s0-8 print-game-text)) (set! sv-112 format) (let ((a0-64 (clear *temp-string*)) (a1-25 "/~D") - (a2-21 (-> obj total-nb-of-buzzers)) + (a2-21 (-> this total-nb-of-buzzers)) ) (sv-112 a0-64 a1-25 a2-21) ) @@ -847,7 +847,7 @@ ) (else (+! (-> arg0 origin y) 18.0) - (set! (-> arg0 origin x) (the float (- 28 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 28 (-> this left-x-offset)))) (let ((v1-131 arg0)) (set! (-> v1-131 scale) 0.8) ) @@ -876,13 +876,13 @@ arg0 #f s4-1 22) ) ) - (set! (-> obj particles s2-0 init-pos x) -320.0) + (set! (-> this particles s2-0 init-pos x) -320.0) (+! (-> arg0 origin y) 23.0) ) ) ) (else - (set! (-> obj particles s2-0 init-pos x) -320.0) + (set! (-> this particles s2-0 init-pos x) -320.0) (+! (-> arg0 origin y) 12.0) (let ((v1-173 arg0)) (set! (-> v1-173 scale) 0.7) @@ -900,12 +900,12 @@ (none) ) -(defmethod draw-memcard-auto-save-error progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-auto-save-error progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.6) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 70 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 70 (-> this left-x-offset)))) (set! (-> arg0 origin y) 5.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 265)) @@ -915,11 +915,11 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id error-saving) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 34.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 360)) @@ -929,7 +929,7 @@ ) (let ((s4-1 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id check-memcard) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-1 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (set! (-> arg0 origin y) 89.0) (let ((v1-12 arg0)) @@ -940,7 +940,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-title) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -953,7 +953,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -966,7 +966,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -974,12 +974,12 @@ (none) ) -(defmethod draw-memcard-removed progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-removed progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.6) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 70 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 70 (-> this left-x-offset)))) (set! (-> arg0 origin y) 10.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 265)) @@ -989,9 +989,9 @@ ) (let ((s4-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-removed) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 78.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 360)) @@ -1001,7 +1001,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-title) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1014,7 +1014,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1027,7 +1027,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1035,7 +1035,7 @@ (none) ) -(defmethod draw-memcard-error progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-error progress ((this progress) (arg0 font-context)) (set! (-> arg0 origin y) 15.0) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.7) @@ -1048,7 +1048,7 @@ ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s4-0 (text-id error-loading))) - (case (-> obj display-state) + (case (-> this display-state) (((progress-screen memcard-error-saving)) (set! s4-0 (text-id error-saving)) ) @@ -1061,10 +1061,10 @@ ) (let ((s3-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* s4-0 #f) 1) - (s3-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s3-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 80.0) (let ((v1-13 arg0)) (set! (-> v1-13 width) (the float 360)) @@ -1074,7 +1074,7 @@ ) (let ((s4-1 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id check-memcard-and-retry) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-1 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (let ((v1-16 arg0)) (set! (-> v1-16 scale) 0.65) @@ -1085,7 +1085,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1093,8 +1093,8 @@ (none) ) -(defmethod draw-auto-save progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 35 (-> obj left-x-offset)))) +(defmethod draw-auto-save progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 35 (-> this left-x-offset)))) (set! (-> arg0 origin y) 18.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1108,11 +1108,11 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-warn-title) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 15 (-> this left-x-offset)))) (set! (-> arg0 origin y) 110.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 370)) @@ -1122,7 +1122,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-warn-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1135,7 +1135,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1147,11 +1147,11 @@ ) (set! (-> *progress-process* 0 particles 31 init-pos x) (the float - (- (if (or (< (mod (-> *display* real-frame-counter) 300) 270) (!= (-> obj transition-percentage-invert) 1.0)) + (- (if (or (< (mod (-> *display* real-frame-counter) 300) 270) (!= (-> this transition-percentage-invert) 1.0)) 205 -320 ) - (-> obj left-x-offset) + (-> this left-x-offset) ) ) ) @@ -1159,8 +1159,8 @@ (none) ) -(defmethod draw-pal-change-to-60hz progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) +(defmethod draw-pal-change-to-60hz progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 20.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1174,11 +1174,11 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id screen-change-to-60hz) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 15 (-> this left-x-offset)))) (set! (-> arg0 origin y) 60.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 370)) @@ -1188,7 +1188,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id screen-60hz-warn-support) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1198,7 +1198,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id screen-60hz-warn-timer) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1211,7 +1211,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1219,8 +1219,8 @@ (none) ) -(defmethod draw-no-disc progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) +(defmethod draw-no-disc progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 50.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1234,11 +1234,11 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id no-disc-title) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 90.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 360)) @@ -1248,7 +1248,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id no-disc-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1262,7 +1262,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1271,8 +1271,8 @@ (none) ) -(defmethod draw-bad-disc progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) +(defmethod draw-bad-disc progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 50.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1286,11 +1286,11 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id bad-disc-title) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 90.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 360)) @@ -1300,7 +1300,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id bad-disc-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1313,7 +1313,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1321,8 +1321,8 @@ (none) ) -(defmethod draw-quit progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) +(defmethod draw-quit progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 70.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1336,7 +1336,7 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id quit?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1344,8 +1344,8 @@ (none) ) -(defmethod draw-pal-now-60hz progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) +(defmethod draw-pal-now-60hz progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 45.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1359,7 +1359,7 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id screen-now-60hz) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1369,7 +1369,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id screen-60hz-keep?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1377,14 +1377,14 @@ (none) ) -(defmethod draw-notice-screen progress ((obj progress)) +(defmethod draw-notice-screen progress ((this progress)) (hide-progress-icons) (when *common-text* (let ((a1-1 (new 'stack 'font-context *font-default-matrix* - (- 70 (-> obj left-x-offset)) + (- 70 (-> this left-x-offset)) 10 0.0 (font-color default) @@ -1392,65 +1392,65 @@ ) ) ) - (case (-> obj display-state) + (case (-> this display-state) (((progress-screen memcard-format)) - (draw-memcard-format obj a1-1) + (draw-memcard-format this a1-1) ) (((progress-screen memcard-no-space) (progress-screen memcard-not-inserted) (progress-screen memcard-not-formatted) ) - (draw-memcard-storage-error obj a1-1) + (draw-memcard-storage-error this a1-1) ) (((progress-screen memcard-data-exists)) - (draw-memcard-data-exists obj a1-1) + (draw-memcard-data-exists this a1-1) ) (((progress-screen memcard-no-data)) - (draw-memcard-no-data obj a1-1) + (draw-memcard-no-data this a1-1) ) (((progress-screen memcard-loading) (progress-screen memcard-saving) (progress-screen memcard-formatting) (progress-screen memcard-creating) ) - (draw-memcard-accessing obj a1-1) + (draw-memcard-accessing this a1-1) ) (((progress-screen memcard-insert)) - (draw-memcard-insert obj a1-1) + (draw-memcard-insert this a1-1) ) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (draw-memcard-file-select obj a1-1) + (draw-memcard-file-select this a1-1) ) (((progress-screen memcard-auto-save-error)) - (draw-memcard-auto-save-error obj a1-1) + (draw-memcard-auto-save-error this a1-1) ) (((progress-screen memcard-removed)) - (draw-memcard-removed obj a1-1) + (draw-memcard-removed this a1-1) ) (((progress-screen memcard-error-loading) (progress-screen memcard-error-saving) (progress-screen memcard-error-formatting) (progress-screen memcard-error-creating) ) - (draw-memcard-error obj a1-1) + (draw-memcard-error this a1-1) ) (((progress-screen auto-save)) - (draw-auto-save obj a1-1) + (draw-auto-save this a1-1) ) (((progress-screen pal-change-to-60hz)) - (draw-pal-change-to-60hz obj a1-1) + (draw-pal-change-to-60hz this a1-1) ) (((progress-screen pal-now-60hz)) - (draw-pal-now-60hz obj a1-1) + (draw-pal-now-60hz this a1-1) ) (((progress-screen no-disc)) - (draw-no-disc obj a1-1) + (draw-no-disc this a1-1) ) (((progress-screen bad-disc)) - (draw-bad-disc obj a1-1) + (draw-bad-disc this a1-1) ) (((progress-screen quit)) - (draw-quit obj a1-1) + (draw-quit this a1-1) ) ) ) @@ -1491,8 +1491,8 @@ arg1 ) -(defmethod draw-options progress ((obj progress) (arg0 int) (arg1 int) (arg2 float)) - (let ((s3-0 (-> *options-remap* (-> obj display-state)))) +(defmethod draw-options progress ((this progress) (arg0 int) (arg1 int) (arg2 float)) + (let ((s3-0 (-> *options-remap* (-> this display-state)))) (when s3-0 (let ((s2-1 (- arg0 (/ (* arg1 (length s3-0)) 2))) (s1-0 0) @@ -1526,9 +1526,9 @@ ) ) ) - ((and (-> obj selected-option) (= (-> obj option-index) s0-0)) + ((and (-> this selected-option) (= (-> this option-index) s0-0)) (set-color! font (font-color default)) - (set! (-> font origin x) (the float (- x-off (-> obj left-x-offset)))) + (set! (-> font origin x) (the float (- x-off (-> this left-x-offset)))) (case (-> s3-0 s0-0 option-type) (((game-option-type center-screen)) (set! (-> font origin y) (the float (+ s2-1 -20))) @@ -1554,7 +1554,7 @@ (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) ) - (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as rgba a3-5)) + (draw-percent-bar (- 75 (-> this left-x-offset)) (+ s2-1 8) f0-12 (the-as rgba a3-5)) ) (set! option-str (string-format "~D" (the int (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify)))))) (set! x-off (+ (the int (* 2.5 (-> (the-as (pointer float) (-> s3-0 s0-0 value-to-modify))))) -100)) @@ -1567,7 +1567,7 @@ ) ) (((game-option-type language)) - (let ((old-lang (-> obj language-selection)) + (let ((old-lang (-> this language-selection)) (new-lang (-> (the-as (pointer language-enum) (-> s3-0 s0-0 value-to-modify)))) (max-lang (if (and (= (scf-get-territory) GAME_TERRITORY_SCEA) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2)))) @@ -1575,13 +1575,13 @@ 6 )) ) - (if (-> obj language-transition) - (seekl! (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))) - (when (>= (-> obj language-x-offset) 100) - (set! (-> obj language-selection) new-lang) + (if (-> this language-transition) + (seekl! (-> this language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio))))) + (when (>= (-> this language-x-offset) 100) + (set! (-> this language-selection) new-lang) (set! old-lang new-lang) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) + (set! (-> this language-transition) #f) + (set! (-> this language-x-offset) 0) ) (set! (-> font origin y) (the float (+ s2-1 3))) (set-color! font (font-color progress-blue)) @@ -1592,17 +1592,17 @@ (prev-lang (mod (+ max-lang -2 old-lang) max-lang)) ) (cond - ((-> obj language-direction) - (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) + ((-> this language-direction) + (let ((a2-22 (- 200 (+ (-> this language-x-offset) 100)))) (print-language-name a0-66 font a2-22 #f) ) - (let ((a2-23 (+ (-> obj language-x-offset) 100))) + (let ((a2-23 (+ (-> this language-x-offset) 100))) (cond ((< a2-23 150) (print-language-name (the int next-lang) font a2-23 #t) ) (else - (let ((a2-24 (- 200 (-> obj language-x-offset)))) + (let ((a2-24 (- 200 (-> this language-x-offset)))) (print-language-name prev-lang font a2-24 #f) ) ) @@ -1610,27 +1610,27 @@ ) ) (else - (let ((a2-25 (+ (-> obj language-x-offset) 100))) + (let ((a2-25 (+ (-> this language-x-offset) 100))) (cond ((< a2-25 150) (print-language-name a0-66 font a2-25 #f) ) (else - (let ((a2-26 (- 200 (-> obj language-x-offset)))) + (let ((a2-26 (- 200 (-> this language-x-offset)))) (print-language-name (the int v1-153) font a2-26 #t) ) ) ) ) - (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) + (let ((a2-27 (- 200 (+ (-> this language-x-offset) 100)))) (print-language-name (the int next-lang) font a2-27 #t) ) ) ) ) - (if (not (-> obj language-transition)) + (if (not (-> this language-transition)) (set-color! font (font-color progress-selected))) - (print-language-name (the-as int old-lang) font (-> obj language-x-offset) (-> obj language-direction)) + (print-language-name (the-as int old-lang) font (-> this language-x-offset) (-> this language-direction)) )) (((game-option-type center-screen)) (set! option-str (lookup-text! *common-text* (text-id move-dpad) #f)) @@ -1674,13 +1674,13 @@ ) ) (when option-str - (let ((f0-23 (-> obj transition-percentage-invert))) - (set-color! font (if (and (= s0-0 (-> obj option-index)) (not (-> obj in-transition))) + (let ((f0-23 (-> this transition-percentage-invert))) + (set-color! font (if (and (= s0-0 (-> this option-index)) (not (-> this in-transition))) (font-color progress-selected) (font-color default) ) ) - (set! (-> font origin x) (the float (- x-off (-> obj left-x-offset)))) + (set! (-> font origin x) (the float (- x-off (-> this left-x-offset)))) (set! (-> font origin y) (the float (the int (* (the float y-off) (if (-> s3-0 s0-0 scale) f0-23 1.0 @@ -1699,17 +1699,17 @@ (none) ) -(defmethod draw-progress progress ((obj progress)) - (let ((f30-0 (+ -409.0 (-> obj particles 2 init-pos x) (* 0.8 (the float (-> obj left-x-offset))))) - (s5-0 (if (or (-> obj stat-transition) (nonzero? (-> obj level-transition))) +(defmethod draw-progress progress ((this progress)) + (let ((f30-0 (+ -409.0 (-> this particles 2 init-pos x) (* 0.8 (the float (-> this left-x-offset))))) + (s5-0 (if (or (-> this stat-transition) (nonzero? (-> this level-transition))) 0 - (-> obj transition-offset) + (-> this transition-offset) ) ) ) - (let ((f28-0 (if (or (-> obj stat-transition) (nonzero? (-> obj level-transition))) + (let ((f28-0 (if (or (-> this stat-transition) (nonzero? (-> this level-transition))) 1.0 - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) ) ) ) @@ -1769,7 +1769,7 @@ 'stack 'font-context *font-default-matrix* - (the int (+ (- 423.0 (the float (/ (-> obj left-x-offset) 2))) f30-0 (the float (adjust-pos s5-0 150)))) + (the int (+ (- 423.0 (the float (/ (-> this left-x-offset) 2))) f30-0 (the float (adjust-pos s5-0 150)))) 131 0.0 (font-color default) @@ -1819,27 +1819,27 @@ ) ) 0.0 - (let ((f28-1 (+ -94.0 (-> obj particles 2 init-pos x))) + (let ((f28-1 (+ -94.0 (-> this particles 2 init-pos x))) (s3-4 90) (s4-3 224) (s2-5 (/ s5-0 5)) - (f26-3 (-> obj button-scale)) + (f26-3 (-> this button-scale)) ) (let ((f24-0 (* 182.04445 (- (/ -36.0 f26-3) (the float s2-5))))) - (set! (-> obj particles 27 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-0)))))) - (set! (-> obj particles 27 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-0)))))) + (set! (-> this particles 27 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-0)))))) + (set! (-> this particles 27 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-0)))))) ) (let ((f24-2 (* 182.04445 (- (/ -21.0 f26-3) (the float (adjust-pos s2-5 10)))))) - (set! (-> obj particles 28 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-2)))))) - (set! (-> obj particles 28 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-2)))))) + (set! (-> this particles 28 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-2)))))) + (set! (-> this particles 28 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-2)))))) ) (let ((f24-4 (* 182.04445 (- (/ -6.0 f26-3) (the float (adjust-pos s2-5 15)))))) - (set! (-> obj particles 29 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-4)))))) - (set! (-> obj particles 29 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-4)))))) + (set! (-> this particles 29 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-4)))))) + (set! (-> this particles 29 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-4)))))) ) (let ((f26-5 (* 182.04445 (- (/ 9.0 f26-3) (the float (adjust-pos s2-5 20)))))) - (set! (-> obj particles 30 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f26-5)))))) - (set! (-> obj particles 30 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f26-5)))))) + (set! (-> this particles 30 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f26-5)))))) + (set! (-> this particles 30 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f26-5)))))) ) ) (when *cheat-mode* @@ -1875,7 +1875,7 @@ ) ) ) - (let ((a0-52 (-> obj icons 5 icon 0 root))) + (let ((a0-52 (-> this icons 5 icon 0 root))) (set-yaw-angle-clear-roll-pitch! a0-52 (- (y-angle a0-52) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) @@ -1884,28 +1884,28 @@ (let* ((f28-2 (* 0.00024414062 (the float (-> *progress-process* 0 in-out-position)))) (f30-1 (* 300.0 f28-2)) ) - (set! (-> obj particles 18 init-pos x) - (the float (+ (the int (the float (adjust-pos s5-0 50))) 394 (the int f30-1) (-> obj right-x-offset))) + (set! (-> this particles 18 init-pos x) + (the float (+ (the int (the float (adjust-pos s5-0 50))) 394 (the int f30-1) (-> this right-x-offset))) ) - (set! (-> obj particles 18 init-pos y) (the float (- 40 (the int (* 80.0 f28-2))))) - (set! (-> obj icons 5 icon-x) - (+ (the int (the float (adjust-pos s5-0 50))) 393 (the int f30-1) (-> obj right-x-offset)) + (set! (-> this particles 18 init-pos y) (the float (- 40 (the int (* 80.0 f28-2))))) + (set! (-> this icons 5 icon-x) + (+ (the int (the float (adjust-pos s5-0 50))) 393 (the int f30-1) (-> this right-x-offset)) ) - (set! (-> obj icons 5 icon-y) (- (-> obj small-orb-y-offset) (the int (* 80.0 f28-2)))) - (set! (-> obj particles 16 init-pos x) - (the float (+ (the int (the float (adjust-pos s5-0 100))) 425 (the int f30-1) (-> obj right-x-offset))) + (set! (-> this icons 5 icon-y) (- (-> this small-orb-y-offset) (the int (* 80.0 f28-2)))) + (set! (-> this particles 16 init-pos x) + (the float (+ (the int (the float (adjust-pos s5-0 100))) 425 (the int f30-1) (-> this right-x-offset))) ) - (set! (-> obj particles 16 init-pos y) (the float (- 112 (the int (* 60.0 f28-2))))) - (set! (-> obj particles 17 init-pos x) (the float (+ (the int (the float (adjust-pos s5-0 150))) + (set! (-> this particles 16 init-pos y) (the float (- 112 (the int (* 60.0 f28-2))))) + (set! (-> this particles 17 init-pos x) (the float (+ (the int (the float (adjust-pos s5-0 150))) 442 (the int f30-1) - (the int (* 0.7 (the float (-> obj right-x-offset)))) + (the int (* 0.7 (the float (-> this right-x-offset)))) ) ) ) ) ) - (set! (-> obj particles 17 init-pos y) 193.0) + (set! (-> this particles 17 init-pos y) 193.0) 0 (none) ) diff --git a/goal_src/jak1/engine/ui/progress/progress-part.gc b/goal_src/jak1/engine/ui/progress/progress-part.gc index fc6d6ab37d..e31aaa8f3d 100644 --- a/goal_src/jak1/engine/ui/progress/progress-part.gc +++ b/goal_src/jak1/engine/ui/progress/progress-part.gc @@ -24,6 +24,7 @@ ) (defun part-progress-hud-orb-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + ;; og:preserve-this (#cond (PC_PORT (unless (and *pc-settings* (not (-> *pc-settings* use-vis?))) @@ -40,6 +41,7 @@ ) (defun part-progress-hud-buzzer-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + ;; og:preserve-this (#cond (PC_PORT (unless (and *pc-settings* (not (-> *pc-settings* use-vis?))) @@ -56,6 +58,7 @@ ) (defun part-progress-hud-button-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) + ;; og:preserve-this (#cond (PC_PORT (unless (and *pc-settings* (not (-> *pc-settings* use-vis?))) @@ -73,6 +76,7 @@ (defun part-progress-hud-tint-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 matrix)) (set! (-> arg2 vector 2 w) (the float (- 64 (sar (* 63 (-> *progress-process* 0 in-out-position)) 12)))) + ;; og:preserve-this (#when PC_PORT (if (and *pc-settings* (not (-> *pc-settings* use-vis?))) (set! (-> arg2 vector 0 w) (* (meters 15) (-> *pc-settings* aspect-ratio-scale))) @@ -183,6 +187,7 @@ (vector<-cspace! s3-0 (-> s5-0 icons (logand s4-0 3) icon 0 node-list data v1-0)) (vector<-cspace! s2-0 (-> s5-0 icons (logand s4-0 3) icon 0 node-list data 3)) (vector-! s3-0 s3-0 s2-0) + ;; og:preserve-this (#when PC_PORT (when (not (-> *pc-settings* use-vis?)) (*! (-> s3-0 x) (-> *video-parms* relative-x-scale)) @@ -919,20 +924,20 @@ ) (defmacro progress-new-particle (&key part &key x &key y &key z) - `(when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((part-nb (-> obj nb-of-particles))) - (set! (-> obj particles part-nb) (new 'static 'hud-particle)) - (set! (-> obj particles part-nb part) (create-launch-control (-> *part-group-id-table* ,part) obj)) - (set! (-> obj particles part-nb init-pos x) ,x) - (set! (-> obj particles part-nb init-pos y) ,y) - (set! (-> obj particles part-nb init-pos z) ,z) - (set! (-> obj particles part-nb part matrix) -1) + `(when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((part-nb (-> this nb-of-particles))) + (set! (-> this particles part-nb) (new 'static 'hud-particle)) + (set! (-> this particles part-nb part) (create-launch-control (-> *part-group-id-table* ,part) this)) + (set! (-> this particles part-nb init-pos x) ,x) + (set! (-> this particles part-nb init-pos y) ,y) + (set! (-> this particles part-nb init-pos z) ,z) + (set! (-> this particles part-nb part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) ) -(defmethod initialize-particles progress ((obj progress)) +(defmethod initialize-particles progress ((this progress)) (progress-new-particle :part 90 :x 256.0 :y 224.0 :z 16.0) ;; tint (progress-new-particle :part 88 :x -42.0 :y (#if PC_PORT 256.0 254.0) :z 5.0) ;; left (progress-new-particle :part 89 :x 610.0 :y (#if PC_PORT 256.0 254.0) :z 5.0) ;; right diff --git a/goal_src/jak1/engine/ui/progress/progress.gc b/goal_src/jak1/engine/ui/progress/progress.gc index c33ceddc09..307920c684 100644 --- a/goal_src/jak1/engine/ui/progress/progress.gc +++ b/goal_src/jak1/engine/ui/progress/progress.gc @@ -66,7 +66,7 @@ ) ) -(defun init-game-options ((obj progress)) +(defun init-game-options ((this progress)) "Set the options for all of the menus." ;; start off by making them all invalid @@ -330,18 +330,18 @@ (define *progress-save-info* (new 'global 'mc-slot-info)) -(defmacro progress-make-icon (obj &key skel +(defmacro progress-make-icon (this &key skel &key x &key y &key z &key scale-x &key scale-y ) - `(when (< (-> ,obj nb-of-icons) 6) - (let ((icon-idx (-> ,obj nb-of-icons))) - (set! (-> ,obj icons icon-idx) (new 'static 'hud-icon)) + `(when (< (-> ,this nb-of-icons) 6) + (let ((icon-idx (-> ,this nb-of-icons))) + (set! (-> ,this icons icon-idx) (new 'static 'hud-icon)) (let ((new-manipy (manipy-spawn (new 'static 'vector :w 1.0) #f ,skel #f - :to ,obj + :to ,this :stack *scratch-memory-top* ))) (when new-manipy @@ -352,76 +352,76 @@ (send-event (ppointer->process new-manipy) 'trans-hook #f) ) ) - (set! (-> ,obj icons icon-idx icon) new-manipy) + (set! (-> ,this icons icon-idx icon) new-manipy) (when new-manipy (logior! (-> new-manipy 0 mask) (process-mask pause)) (logclear! (-> new-manipy 0 mask) (process-mask menu progress)) (set! (-> (-> new-manipy) root trans z) ,z) - (set! (-> ,obj icons icon-idx icon-x) ,x) - (set! (-> ,obj icons icon-idx icon-y) ,y) - (set! (-> ,obj icons icon-idx icon-z) 0) - (set! (-> ,obj icons icon-idx scale-x) ,scale-x) - (set! (-> ,obj icons icon-idx scale-y) ,scale-y) + (set! (-> ,this icons icon-idx icon-x) ,x) + (set! (-> ,this icons icon-idx icon-y) ,y) + (set! (-> ,this icons icon-idx icon-z) 0) + (set! (-> ,this icons icon-idx scale-x) ,scale-x) + (set! (-> ,this icons icon-idx scale-y) ,scale-y) ) ) ) - (+! (-> ,obj nb-of-icons) 1) + (+! (-> ,this nb-of-icons) 1) ) ) -(defmethod initialize-icons progress ((obj progress)) - (progress-make-icon obj :skel *fuelcell-naked-sg* +(defmethod initialize-icons progress ((this progress)) + (progress-make-icon this :skel *fuelcell-naked-sg* :x 256 :y 77 :z (meters 0.5) :scale-x 0.006 :scale-y 0.006) - (progress-make-icon obj :skel *fuelcell-naked-sg* + (progress-make-icon this :skel *fuelcell-naked-sg* :x 256 :y 77 :z (meters 0.5) :scale-x 0.006 :scale-y 0.006) - (progress-make-icon obj :skel *fuelcell-naked-sg* + (progress-make-icon this :skel *fuelcell-naked-sg* :x 256 :y 77 :z (meters 0.5) :scale-x 0.006 :scale-y 0.006) - (progress-make-icon obj :skel *fuelcell-naked-sg* + (progress-make-icon this :skel *fuelcell-naked-sg* :x 256 :y 77 :z (meters 0.5) :scale-x 0.006 :scale-y 0.006) - (progress-make-icon obj :skel *money-sg* + (progress-make-icon this :skel *money-sg* :x -320 :y 253 :z (meters 17) :scale-x 0.013 :scale-y -0.015) - (progress-make-icon obj :skel *money-sg* + (progress-make-icon this :skel *money-sg* :x -320 :y 253 :z (meters 0.25) :scale-x 0.008 :scale-y -0.009) - (send-event (ppointer->process (-> obj icons 1 icon)) 'set-frame-num 2.5) - (send-event (ppointer->process (-> obj icons 2 icon)) 'set-frame-num 10.0) - (send-event (ppointer->process (-> obj icons 3 icon)) 'set-frame-num 15.5) + (send-event (ppointer->process (-> this icons 1 icon)) 'set-frame-num 2.5) + (send-event (ppointer->process (-> this icons 2 icon)) 'set-frame-num 10.0) + (send-event (ppointer->process (-> this icons 3 icon)) 'set-frame-num 15.5) 0 (none) ) -(defmethod enter! progress ((obj progress) (screen progress-screen) (option int)) - (when (!= (-> obj display-state) screen) +(defmethod enter! progress ((this progress) (screen progress-screen) (option int)) + (when (!= (-> this display-state) screen) (set! (-> *progress-state* yes-no-choice) #f) - (set! (-> obj selected-option) #f) - (set! (-> obj option-index) option) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) - (set! (-> obj display-state) screen) - (set! (-> obj next-display-state) screen) - (set-transition-speed! obj) - (case (-> obj display-state) + (set! (-> this selected-option) #f) + (set! (-> this option-index) option) + (set! (-> this last-option-index-change) (-> *display* real-frame-counter)) + (set! (-> this display-state) screen) + (set! (-> this next-display-state) screen) + (set-transition-speed! this) + (case (-> this display-state) (((progress-screen memcard-creating)) - (auto-save-command 'create-file 0 0 obj) + (auto-save-command 'create-file 0 0 this) ) (((progress-screen memcard-loading)) (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which)) (sound-volume-off) - (auto-save-command 'restore 0 (-> *progress-state* which) obj) + (auto-save-command 'restore 0 (-> *progress-state* which) this) ) (((progress-screen memcard-saving)) (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which)) - (auto-save-command 'save 0 (-> *progress-state* which) obj) + (auto-save-command 'save 0 (-> *progress-state* which) this) ) (((progress-screen memcard-formatting)) - (auto-save-command 'format-card 0 0 obj) + (auto-save-command 'format-card 0 0 this) ) (((progress-screen save-game) (progress-screen load-game)) - (set! (-> obj option-index) (max 0 (-> *progress-state* last-slot-saved))) + (set! (-> this option-index) (max 0 (-> *progress-state* last-slot-saved))) ) (((progress-screen memcard-removed)) (set! (-> *progress-state* last-slot-saved) 0) @@ -432,13 +432,13 @@ (none) ) -(defmethod push! progress ((obj progress)) - (let ((v1-0 (-> obj display-state-pos))) +(defmethod push! progress ((this progress)) + (let ((v1-0 (-> this display-state-pos))) (cond ((< v1-0 5) - (set! (-> obj display-state-stack v1-0) (-> obj display-state)) - (set! (-> obj option-index-stack v1-0) (-> obj option-index)) - (set! (-> obj display-state-pos) (+ v1-0 1)) + (set! (-> this display-state-stack v1-0) (-> this display-state)) + (set! (-> this option-index-stack v1-0) (-> this option-index)) + (set! (-> this display-state-pos) (+ v1-0 1)) ) (else (format #t "ERROR: Can't push any more states on the display-state-stack.~%") @@ -449,13 +449,13 @@ (none) ) -(defmethod pop! progress ((obj progress)) - (let ((v1-0 (-> obj display-state-pos))) +(defmethod pop! progress ((this progress)) + (let ((v1-0 (-> this display-state-pos))) (cond ((> v1-0 0) (let ((a2-0 (+ v1-0 -1))) - (set! (-> obj display-state-pos) a2-0) - (enter! obj (-> obj display-state-stack a2-0) (-> obj option-index-stack a2-0)) + (set! (-> this display-state-pos) a2-0) + (enter! this (-> this display-state-stack a2-0) (-> this option-index-stack a2-0)) ) ) (else @@ -467,17 +467,17 @@ (none) ) -(defmethod set-transition-progress! progress ((obj progress) (arg0 int)) - (set! (-> obj transition-offset) arg0) - (set! (-> obj transition-offset-invert) (- 512 arg0)) - (set! (-> obj transition-percentage) (* (1/ 512) (the float arg0))) - (set! (-> obj transition-percentage-invert) (- 1.0 (-> obj transition-percentage))) +(defmethod set-transition-progress! progress ((this progress) (arg0 int)) + (set! (-> this transition-offset) arg0) + (set! (-> this transition-offset-invert) (- 512 arg0)) + (set! (-> this transition-percentage) (* (1/ 512) (the float arg0))) + (set! (-> this transition-percentage-invert) (- 1.0 (-> this transition-percentage))) 0 (none) ) -(defmethod set-transition-speed! progress ((obj progress)) - (case (-> obj display-state) +(defmethod set-transition-speed! progress ((this progress)) + (case (-> this display-state) (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer) @@ -485,10 +485,10 @@ (progress-screen save-game) (progress-screen save-game-title) ) - (set! (-> obj transition-speed) 15.0) + (set! (-> this transition-speed) 15.0) ) (else - (set! (-> obj transition-speed) 45.0) + (set! (-> this transition-speed) 45.0) ) ) 0 @@ -679,70 +679,70 @@ (none) ) -(defmethod relocate game-count-info ((obj game-count-info) (arg0 int)) +(defmethod relocate game-count-info ((this game-count-info) (arg0 int)) "Load in the game-count-info. This is a bit of a hack." - (set! *game-counts* obj) - obj + (set! *game-counts* this) + this ) -(defmethod relocate progress ((obj progress) (arg0 int)) - (dotimes (v1-0 (-> obj nb-of-particles)) - (when (-> obj particles v1-0 part) - (if (nonzero? (-> obj particles v1-0 part)) - (set! (-> obj particles v1-0 part) - (the-as sparticle-launch-control (&+ (the-as pointer (-> obj particles v1-0 part)) arg0)) +(defmethod relocate progress ((this progress) (arg0 int)) + (dotimes (v1-0 (-> this nb-of-particles)) + (when (-> this particles v1-0 part) + (if (nonzero? (-> this particles v1-0 part)) + (set! (-> this particles v1-0 part) + (the-as sparticle-launch-control (&+ (the-as pointer (-> this particles v1-0 part)) arg0)) ) ) ) ) - (the-as progress ((method-of-type process relocate) obj arg0)) + (the-as progress ((method-of-type process relocate) this arg0)) ) -(defmethod adjust-sprites progress ((obj progress)) - (let ((f0-1 (* (1/ METER_LENGTH) (the float (-> obj in-out-position))))) - (set! (-> obj particles 2 init-pos x) (the float (+ (-> obj right-x-offset) 409 (the int (* 301.5 f0-1))))) - (set! (-> obj particles 1 init-pos x) (the float (+ (-> obj left-x-offset) 59))) - (set! (-> obj left-side-x-scale) (meters (+ (/ (if (= (-> *pc-settings* aspect-custom-x) 16) 5.0 3.5) (-> obj sides-x-scale)) (* 10.0 f0-1)))) - (set! (-> obj left-side-y-scale) (meters (+ (-> obj sides-y-scale) (* 10.0 f0-1)))) - (set! (-> obj right-side-x-scale) (meters (+ (/ (if (= (-> *pc-settings* aspect-custom-x) 16) 8.5 6.0) (-> obj sides-x-scale)) (* 4.0 f0-1)))) - (set! (-> obj right-side-y-scale) (meters (+ (-> obj sides-y-scale) (* 4.0 f0-1)))) +(defmethod adjust-sprites progress ((this progress)) + (let ((f0-1 (* (1/ METER_LENGTH) (the float (-> this in-out-position))))) + (set! (-> this particles 2 init-pos x) (the float (+ (-> this right-x-offset) 409 (the int (* 301.5 f0-1))))) + (set! (-> this particles 1 init-pos x) (the float (+ (-> this left-x-offset) 59))) + (set! (-> this left-side-x-scale) (meters (+ (/ (if (= (-> *pc-settings* aspect-custom-x) 16) 5.0 3.5) (-> this sides-x-scale)) (* 10.0 f0-1)))) + (set! (-> this left-side-y-scale) (meters (+ (-> this sides-y-scale) (* 10.0 f0-1)))) + (set! (-> this right-side-x-scale) (meters (+ (/ (if (= (-> *pc-settings* aspect-custom-x) 16) 8.5 6.0) (-> this sides-x-scale)) (* 4.0 f0-1)))) + (set! (-> this right-side-y-scale) (meters (+ (-> this sides-y-scale) (* 4.0 f0-1)))) ) - (dotimes (s5-0 (-> obj nb-of-particles)) - (set! (-> obj particles s5-0 pos x) (+ -256.0 (-> obj particles s5-0 init-pos x))) - (set! (-> obj particles s5-0 pos y) - (* 0.5 (- (* (-> obj particles s5-0 init-pos y) (-> *video-parms* relative-y-scale)) + (dotimes (s5-0 (-> this nb-of-particles)) + (set! (-> this particles s5-0 pos x) (+ -256.0 (-> this particles s5-0 init-pos x))) + (set! (-> this particles s5-0 pos y) + (* 0.5 (- (* (-> this particles s5-0 init-pos y) (-> *video-parms* relative-y-scale)) (the float (-> *video-parms* screen-sy)) ) ) ) - (set! (-> obj particles s5-0 pos z) (-> obj particles s5-0 init-pos z)) - (if (> (-> obj particles s5-0 part matrix) 0) - (set-vector! (sprite-get-user-hvdf (-> obj particles s5-0 part matrix)) - (the float (+ (the int (-> obj particles s5-0 pos x)) 2048)) - (the float (+ (the int (-> obj particles s5-0 pos y)) 2048)) - (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> obj particles s5-0 pos z))) + (set! (-> this particles s5-0 pos z) (-> this particles s5-0 init-pos z)) + (if (> (-> this particles s5-0 part matrix) 0) + (set-vector! (sprite-get-user-hvdf (-> this particles s5-0 part matrix)) + (the float (+ (the int (-> this particles s5-0 pos x)) 2048)) + (the float (+ (the int (-> this particles s5-0 pos y)) 2048)) + (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> this particles s5-0 pos z))) (-> *math-camera* hvdf-off w) ) ) - (spawn (-> obj particles s5-0 part) *null-vector*) + (spawn (-> this particles s5-0 part) *null-vector*) ) 0 (none) ) -(defmethod adjust-icons progress ((obj progress)) - (dotimes (v1-0 (-> obj nb-of-icons)) +(defmethod adjust-icons progress ((this progress)) + (dotimes (v1-0 (-> this nb-of-icons)) (when (>= v1-0 4) - (set-vector! (-> obj icons v1-0 icon 0 root scale) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) - (* (-> obj icons v1-0 scale-y) (-> *video-parms* relative-y-scale)) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) + (set-vector! (-> this icons v1-0 icon 0 root scale) + (* (-> this icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) + (* (-> this icons v1-0 scale-y) (-> *video-parms* relative-y-scale)) + (* (-> this icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) 1.0 ) - (set! (-> obj icons v1-0 icon 0 root trans x) (the float (+ (-> obj icons v1-0 icon-x) -256))) - (set! (-> obj icons v1-0 icon 0 root trans y) + (set! (-> this icons v1-0 icon 0 root trans x) (the float (+ (-> this icons v1-0 icon-x) -256))) + (set! (-> this icons v1-0 icon 0 root trans y) (* (-> *video-parms* relative-y-scale) - (- (* (-> *video-parms* relative-y-scale) (the float (-> obj icons v1-0 icon-y))) + (- (* (-> *video-parms* relative-y-scale) (the float (-> this icons v1-0 icon-y))) (the float (-> *video-parms* screen-sy)) ) ) @@ -753,48 +753,48 @@ (none) ) -(defmethod adjust-ratios progress ((obj progress) (aspect symbol) (video-mode symbol)) +(defmethod adjust-ratios progress ((this progress) (aspect symbol) (video-mode symbol)) (case aspect (('aspect4x3) - (set! (-> obj sides-x-scale) 1.0) - (set! (-> obj sides-y-scale) 13.0) - (set! (-> obj left-x-offset) 0) - (set! (-> obj right-x-offset) 0) - (set! (-> obj button-scale) 1.0) - (set! (-> obj slot-scale) 8192.0) - (set! (-> obj small-orb-y-offset) 58) - (set! (-> obj icons 5 scale-x) 0.008) - (set! (-> obj icons 5 scale-y) -0.009) - (set! (-> obj big-orb-y-offset) 243) - (set! (-> obj icons 4 scale-x) 0.013) - (set! (-> obj icons 4 scale-y) -0.015) + (set! (-> this sides-x-scale) 1.0) + (set! (-> this sides-y-scale) 13.0) + (set! (-> this left-x-offset) 0) + (set! (-> this right-x-offset) 0) + (set! (-> this button-scale) 1.0) + (set! (-> this slot-scale) 8192.0) + (set! (-> this small-orb-y-offset) 58) + (set! (-> this icons 5 scale-x) 0.008) + (set! (-> this icons 5 scale-y) -0.009) + (set! (-> this big-orb-y-offset) 243) + (set! (-> this icons 4 scale-x) 0.013) + (set! (-> this icons 4 scale-y) -0.015) ) (('aspect16x9) - (set! (-> obj sides-x-scale) 1.2) - (set! (-> obj sides-y-scale) 9.8) - (set! (-> obj left-x-offset) -10) - (set! (-> obj right-x-offset) 17) - (set! (-> obj button-scale) 1.05) - (set! (-> obj slot-scale) 6144.0) - (set! (-> obj small-orb-y-offset) 59) - (set! (-> obj icons 5 scale-x) 0.008) - (set! (-> obj icons 5 scale-y) -0.0098) - (set! (-> obj big-orb-y-offset) 255) - (set! (-> obj icons 4 scale-x) 0.017) - (set! (-> obj icons 4 scale-y) -0.0205) + (set! (-> this sides-x-scale) 1.2) + (set! (-> this sides-y-scale) 9.8) + (set! (-> this left-x-offset) -10) + (set! (-> this right-x-offset) 17) + (set! (-> this button-scale) 1.05) + (set! (-> this slot-scale) 6144.0) + (set! (-> this small-orb-y-offset) 59) + (set! (-> this icons 5 scale-x) 0.008) + (set! (-> this icons 5 scale-y) -0.0098) + (set! (-> this big-orb-y-offset) 255) + (set! (-> this icons 4 scale-x) 0.017) + (set! (-> this icons 4 scale-y) -0.0205) ) ) (when (= video-mode 'pal) - (set! (-> obj icons 5 scale-y) (* 1.15 (-> obj icons 5 scale-y))) - (set! (-> obj icons 4 scale-x) (* 1.05 (-> obj icons 4 scale-x))) - (set! (-> obj icons 4 scale-y) (* (-> obj icons 4 scale-y) (the-as float (if (= aspect 'aspect16x9) + (set! (-> this icons 5 scale-y) (* 1.15 (-> this icons 5 scale-y))) + (set! (-> this icons 4 scale-x) (* 1.05 (-> this icons 4 scale-x))) + (set! (-> this icons 4 scale-y) (* (-> this icons 4 scale-y) (the-as float (if (= aspect 'aspect16x9) 1.18 1.15 ) ) ) ) - (+! (-> obj big-orb-y-offset) (if (= aspect 'aspect16x9) + (+! (-> this big-orb-y-offset) (if (= aspect 'aspect16x9) 3 2 ) @@ -804,13 +804,13 @@ (none) ) -(defmethod can-go-back? progress ((obj progress)) +(defmethod can-go-back? progress ((this progress)) (let ((v1-2 (-> *progress-process* 0 display-state)) (a1-1 (-> *progress-state* starting-state)) ) - (and (= (-> obj next-state name) 'progress-normal) - (not (-> obj in-transition)) - (not (-> obj selected-option)) + (and (= (-> this next-state name) 'progress-normal) + (not (-> this in-transition)) + (not (-> this selected-option)) (or (= v1-2 (progress-screen fuel-cell)) (= v1-2 (progress-screen money)) (= v1-2 (progress-screen buzzer)) @@ -865,11 +865,11 @@ ) ) -(defmethod visible? progress ((obj progress)) +(defmethod visible? progress ((this progress)) (the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position)))) ) -(defmethod hidden? progress ((obj progress)) +(defmethod hidden? progress ((this progress)) (or (not *progress-process*) (= (-> *progress-process* 0 in-out-position) 4096)) ) @@ -908,8 +908,8 @@ ) ) -(defmethod set-memcard-screen progress ((obj progress) (arg0 progress-screen)) - (let ((s4-0 (-> obj card-info)) +(defmethod set-memcard-screen progress ((this progress) (arg0 progress-screen)) + (let ((s4-0 (-> this card-info)) (gp-0 arg0) ) (when s4-0 @@ -924,7 +924,7 @@ ) ((zero? (-> s4-0 formatted)) (cond - ((or (zero? (-> obj display-state-pos)) + ((or (zero? (-> this display-state-pos)) (and (!= (-> *progress-state* starting-state) 27) (nonzero? (-> *progress-state* starting-state))) ) (set-master-mode 'game) @@ -939,7 +939,7 @@ ((and (zero? (-> s4-0 inited)) (< (-> s4-0 mem-actual) (-> s4-0 mem-required))) (set! gp-0 (progress-screen memcard-no-space)) ) - ((or (zero? (-> obj display-state-pos)) + ((or (zero? (-> this display-state-pos)) (and (!= (-> *progress-state* starting-state) 27) (nonzero? (-> *progress-state* starting-state))) ) (set-master-mode 'game) @@ -1009,39 +1009,39 @@ ) ) -(defmethod respond-memcard progress ((obj progress)) - (let ((s5-0 (-> obj card-info))) - (when (and s5-0 (not (-> obj in-transition))) +(defmethod respond-memcard progress ((this progress)) + (let ((s5-0 (-> this card-info))) + (when (and s5-0 (not (-> this in-transition))) (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) (cpad-clear! 0 x) (cpad-clear! 0 circle) - (case (-> obj display-state) + (case (-> this display-state) (((progress-screen load-game)) (cond - ((< (-> obj option-index) 4) - (when (nonzero? (-> s5-0 file (-> obj option-index) present)) + ((< (-> this option-index) 4) + (when (nonzero? (-> s5-0 file (-> this option-index) present)) (sound-play "start-options") - (set! (-> *progress-state* which) (-> obj option-index)) - (set! (-> obj next-display-state) (progress-screen memcard-loading)) + (set! (-> *progress-state* which) (-> this option-index)) + (set! (-> this next-display-state) (progress-screen memcard-loading)) ) ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) (((progress-screen save-game) (progress-screen save-game-title)) (cond - ((< (-> obj option-index) 4) + ((< (-> this option-index) 4) (sound-play "start-options") - (set! (-> *progress-state* which) (-> obj option-index)) - (if (zero? (-> s5-0 file (-> obj option-index) present)) - (set! (-> obj next-display-state) (progress-screen memcard-saving)) - (set! (-> obj next-display-state) (progress-screen memcard-data-exists)) + (set! (-> *progress-state* which) (-> this option-index)) + (if (zero? (-> s5-0 file (-> this option-index) present)) + (set! (-> this next-display-state) (progress-screen memcard-saving)) + (set! (-> this next-display-state) (progress-screen memcard-data-exists)) ) ) - ((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4)) + ((and (= (-> this display-state) (progress-screen save-game-title)) (= (-> this option-index) 4)) (sound-play "starts-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) @@ -1050,25 +1050,25 @@ ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) (((progress-screen memcard-insert)) (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) (((progress-screen memcard-data-exists)) (cond ((-> *progress-state* yes-no-choice) (sound-play "start-options") - (set! (-> obj next-display-state) (progress-screen memcard-saving)) + (set! (-> this next-display-state) (progress-screen memcard-saving)) ) (else (sound-play "cursor-options") - (if (= (-> obj display-state-stack 0) (progress-screen title)) - (set! (-> obj next-display-state) (progress-screen save-game-title)) - (set! (-> obj next-display-state) (progress-screen save-game)) + (if (= (-> this display-state-stack 0) (progress-screen title)) + (set! (-> this next-display-state) (progress-screen save-game-title)) + (set! (-> this next-display-state) (progress-screen save-game)) ) ) ) @@ -1077,10 +1077,10 @@ (cond ((-> *progress-state* yes-no-choice) (sound-play "start-options") - (set! (-> obj next-display-state) (progress-screen memcard-creating)) + (set! (-> this next-display-state) (progress-screen memcard-creating)) ) ;; og:preserve-this PAL & NTSC-J patch here - ((= (-> obj display-state-stack 0) (progress-screen title)) + ((= (-> this display-state-stack 0) (progress-screen title)) (sound-play "cursor-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) @@ -1089,7 +1089,7 @@ ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) @@ -1098,20 +1098,20 @@ (progress-screen memcard-not-formatted) ) (cond - ((= (-> obj display-state-stack 0) (progress-screen title)) + ((= (-> this display-state-stack 0) (progress-screen title)) (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) - ((nonzero? (-> obj display-state-stack 0)) + ((nonzero? (-> this display-state-stack 0)) (sound-play "start-options") (set-master-mode 'game) ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) @@ -1124,20 +1124,20 @@ (progress-screen auto-save) ) (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) (((progress-screen pal-change-to-60hz)) (cond ((-> *progress-state* yes-no-choice) (sound-play "start-options") (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (set! (-> obj video-mode-timeout) (-> *display* real-frame-counter)) - (set! (-> obj next-display-state) (progress-screen pal-now-60hz)) + (set! (-> this video-mode-timeout) (-> *display* real-frame-counter)) + (set! (-> this next-display-state) (progress-screen pal-now-60hz)) ) (else (sound-play "cursor-options") (set! (-> *progress-state* video-mode-choice) 'pal) - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) @@ -1152,12 +1152,12 @@ (sound-play "start-options") ) ) - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) (((progress-screen no-disc) (progress-screen bad-disc)) (when (is-cd-in?) (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) (((progress-screen quit)) @@ -1170,7 +1170,7 @@ ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) @@ -1178,10 +1178,10 @@ (cond ((-> *progress-state* yes-no-choice) (sound-play "start-options") - (set! (-> obj next-display-state) (progress-screen memcard-formatting)) + (set! (-> this next-display-state) (progress-screen memcard-formatting)) ) ;; og:preserve-this NTSC-J patch here - ((= (-> obj display-state-stack 0) (progress-screen title)) + ((= (-> this display-state-stack 0) (progress-screen title)) (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) @@ -1190,7 +1190,7 @@ ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) @@ -1202,30 +1202,30 @@ (none) ) -(defmethod respond-common progress ((obj progress)) +(defmethod respond-common progress ((this progress)) (mc-get-slot-info 0 *progress-save-info*) - (set! (-> obj card-info) *progress-save-info*) - (let ((s5-0 (-> *options-remap* (-> obj display-state)))) - (when (and s5-0 (not (-> obj in-transition))) + (set! (-> this card-info) *progress-save-info*) + (let ((s5-0 (-> *options-remap* (-> this display-state)))) + (when (and s5-0 (not (-> this in-transition))) (cond ((cpad-hold? 0 up) (cond ((cpad-pressed? 0 up) - (when (not (-> obj selected-option)) + (when (not (-> this selected-option)) (if (!= (length s5-0) 1) (sound-play "cursor-up-down") ) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) - (if (> (-> obj option-index) 0) - (+! (-> obj option-index) -1) - (set! (-> obj option-index) (+ (length s5-0) -1)) + (set! (-> this last-option-index-change) (-> *display* real-frame-counter)) + (if (> (-> this option-index) 0) + (+! (-> this option-index) -1) + (set! (-> this option-index) (+ (length s5-0) -1)) ) ) ) (else - (when (-> obj selected-option) + (when (-> this selected-option) (let ((v1-34 #f)) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type center-screen)) (when (< -48 (-> *setting-control* current screeny)) (set! v1-34 #t) @@ -1247,26 +1247,26 @@ ((cpad-hold? 0 down) (cond ((cpad-pressed? 0 down) - (when (not (-> obj selected-option)) + (when (not (-> this selected-option)) (if (!= (length s5-0) 1) (sound-play "cursor-up-down") ) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) + (set! (-> this last-option-index-change) (-> *display* real-frame-counter)) (cond - ((< (-> obj option-index) (+ (length s5-0) -1)) - (+! (-> obj option-index) 1) + ((< (-> this option-index) (+ (length s5-0) -1)) + (+! (-> this option-index) 1) ) (else - (set! (-> obj option-index) 0) + (set! (-> this option-index) 0) 0 ) ) ) ) (else - (when (-> obj selected-option) + (when (-> this selected-option) (let ((v1-69 #f)) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type center-screen)) (when (< (-> *setting-control* current screeny) 48) (set! v1-69 #t) @@ -1288,30 +1288,30 @@ ((cpad-hold? 0 left) (cond ((cpad-pressed? 0 left) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) + (when (or (-> this selected-option) (= (-> s5-0 (-> this option-index) option-type) (game-option-type yes-no))) (let ((s4-5 #f)) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type on-off) (game-option-type yes-no)) - (when (not (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (when (not (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) (set! s4-5 #t) - (if (= (-> s5-0 (-> obj option-index) value-to-modify) (&-> *setting-control* current vibration)) + (if (= (-> s5-0 (-> this option-index) value-to-modify) (&-> *setting-control* current vibration)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) ) ) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify))) #t) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify))) #t) ) (((game-option-type aspect-ratio)) - (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3) + (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'aspect16x9)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'aspect4x3) ) (((game-option-type video-mode)) - (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal) + (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'ntsc)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'pal) ) (((game-option-type language)) - (if (> (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) 0) - (+! (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))) -1) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) + (if (> (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> this option-index) value-to-modify)))) 0) + (+! (-> (the-as (pointer uint64) (-> s5-0 (-> this option-index) value-to-modify))) -1) + (set! (-> (the-as (pointer int64) (-> s5-0 (-> this option-index) value-to-modify))) (if (and (= (scf-get-territory) GAME_TERRITORY_SCEA) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) ) @@ -1320,8 +1320,8 @@ ) ) ) - (set! (-> obj language-transition) #t) - (set! (-> obj language-direction) #t) + (set! (-> this language-transition) #t) + (set! (-> this language-direction) #t) (set! s4-5 #t) ) ) @@ -1332,22 +1332,22 @@ ) ) (else - (when (-> obj selected-option) + (when (-> this selected-option) (let ((v1-157 #f)) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type slider)) (cond - ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> s5-0 (-> obj option-index) param1)) + ((>= (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) + (+ 1.0 (-> s5-0 (-> this option-index) param1)) ) - (+! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) -1.0) + (+! (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) -1.0) (set! v1-157 #t) ) - ((< (-> s5-0 (-> obj option-index) param1) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ((< (-> s5-0 (-> this option-index) param1) + (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param1) + (set! (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) + (-> s5-0 (-> this option-index) param1) ) (set! v1-157 #t) ) @@ -1362,9 +1362,9 @@ ) (when v1-157 (let ((f30-0 100.0)) - (case (-> s5-0 (-> obj option-index) name) + (case (-> s5-0 (-> this option-index) name) (((text-id music-volume) (text-id speech-volume)) - (set! f30-0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) + (set! f30-0 (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) @@ -1381,20 +1381,20 @@ ((cpad-hold? 0 right) (cond ((cpad-pressed? 0 right) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) + (when (or (-> this selected-option) (= (-> s5-0 (-> this option-index) option-type) (game-option-type yes-no))) (let ((v1-217 (the-as object #f))) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type on-off) (game-option-type yes-no)) - (set! v1-217 (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #f) + (set! v1-217 (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) #f) ) (((game-option-type aspect-ratio)) - (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9) + (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'aspect4x3)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'aspect16x9) ) (((game-option-type video-mode)) - (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc) + (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'pal)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'ntsc) ) (((game-option-type language)) (let ((v1-243 (if (and (= (scf-get-territory) GAME_TERRITORY_SCEA) @@ -1406,17 +1406,17 @@ ) ) (cond - ((< (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) v1-243) - (+! (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))) 1) + ((< (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> this option-index) value-to-modify)))) v1-243) + (+! (-> (the-as (pointer uint64) (-> s5-0 (-> this option-index) value-to-modify))) 1) ) (else - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) 0) + (set! (-> (the-as (pointer int64) (-> s5-0 (-> this option-index) value-to-modify))) 0) 0 ) ) ) - (set! (-> obj language-transition) #t) - (set! (-> obj language-direction) #f) + (set! (-> this language-transition) #t) + (set! (-> this language-direction) #f) (set! v1-217 #t) ) ) @@ -1427,22 +1427,22 @@ ) ) (else - (when (-> obj selected-option) + (when (-> this selected-option) (let ((v1-263 #f)) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type slider)) (cond - ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ((>= (+ -1.0 (-> s5-0 (-> this option-index) param2)) + (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) ) - (+! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) 1.0) + (+! (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) 1.0) (set! v1-263 #t) ) - ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) + ((< (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) + (-> s5-0 (-> this option-index) param2) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) + (set! (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) + (-> s5-0 (-> this option-index) param2) ) (set! v1-263 #t) ) @@ -1457,9 +1457,9 @@ ) (when v1-263 (let ((f30-1 100.0)) - (case (-> s5-0 (-> obj option-index) name) + (case (-> s5-0 (-> this option-index) name) (((text-id music-volume) (text-id speech-volume)) - (set! f30-1 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) + (set! f30-1 (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) @@ -1475,20 +1475,20 @@ ) ((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle)) (cond - ((-> obj selected-option) - (case (-> s5-0 (-> obj option-index) option-type) + ((-> this selected-option) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type slider)) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (set! (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) (-> *progress-state* slider-backup) ) ) (((game-option-type language)) - (set! (-> (the-as (pointer language-enum) (-> s5-0 (-> obj option-index) value-to-modify))) + (set! (-> (the-as (pointer language-enum) (-> s5-0 (-> this option-index) value-to-modify))) (-> *progress-state* language-backup) ) ) (((game-option-type on-off)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) (-> *progress-state* on-off-backup) ) ) @@ -1497,81 +1497,81 @@ (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) ) (((game-option-type aspect-ratio) (game-option-type video-mode)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) (-> *progress-state* aspect-ratio-backup) ) ) ) (sound-play "cursor-options") - (set! (-> obj selected-option) #f) + (set! (-> this selected-option) #f) ) - ((or (can-go-back? obj) - (= (-> obj display-state) (progress-screen load-game)) - (= (-> obj display-state) (progress-screen save-game)) - (= (-> obj display-state) (progress-screen save-game-title)) + ((or (can-go-back? this) + (= (-> this display-state) (progress-screen load-game)) + (= (-> this display-state) (progress-screen save-game)) + (= (-> this display-state) (progress-screen save-game-title)) ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons square)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons square)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (if (= (-> obj display-state) (progress-screen settings)) + (if (= (-> this display-state) (progress-screen settings)) (sound-play "menu-stats") (sound-play "cursor-options") ) - (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) - (set! (-> obj next-display-state) (progress-screen invalid)) + (load-level-text-files (-> *level-task-data* (-> this display-level-index) text-group-index)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) ((or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) (cond - ((not (-> obj selected-option)) + ((not (-> this selected-option)) (cond - ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type menu)) + ((= (-> s5-0 (-> this option-index) option-type) (game-option-type menu)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (push! obj) + (push! this) (sound-play "select-option") - (set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3))) - (case (-> obj next-display-state) + (set! (-> this next-display-state) (the-as progress-screen (-> s5-0 (-> this option-index) param3))) + (case (-> this next-display-state) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (set! (-> obj next-display-state) (set-memcard-screen obj (-> obj next-display-state))) + (set! (-> this next-display-state) (set-memcard-screen this (-> this next-display-state))) ) ) ) - ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type button)) + ((= (-> s5-0 (-> this option-index) option-type) (game-option-type button)) (cond - ((= (-> s5-0 (-> obj option-index) name) (text-id exit-demo)) + ((= (-> s5-0 (-> this option-index) name) (text-id exit-demo)) (set! *master-exit* 'force) (set-master-mode 'game) ) - ((= (-> s5-0 (-> obj option-index) name) (text-id back)) - (if (= (-> obj display-state) (progress-screen settings)) + ((= (-> s5-0 (-> this option-index) name) (text-id back)) + (if (= (-> this display-state) (progress-screen settings)) (sound-play "menu-stats") (sound-play "cursor-options") ) - (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) - (set! (-> obj next-display-state) (progress-screen invalid)) + (load-level-text-files (-> *level-task-data* (-> this display-level-index) text-group-index)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) - ((!= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no)) - (case (-> s5-0 (-> obj option-index) option-type) + ((!= (-> s5-0 (-> this option-index) option-type) (game-option-type yes-no)) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type slider)) (set! (-> *progress-state* slider-backup) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) ) ) (((game-option-type language)) (set! (-> *progress-state* language-backup) - (-> (the-as (pointer language-enum) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> (the-as (pointer language-enum) (-> s5-0 (-> this option-index) value-to-modify))) ) ) (((game-option-type on-off)) (set! (-> *progress-state* on-off-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (((game-option-type center-screen)) @@ -1580,7 +1580,7 @@ ) (((game-option-type aspect-ratio) (game-option-type video-mode)) (set! (-> *progress-state* aspect-ratio-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) ) @@ -1589,12 +1589,12 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (set! (-> obj selected-option) #t) - (when (= (-> s5-0 (-> obj option-index) option-type) (game-option-type language)) - (set! (-> obj language-selection) (-> *setting-control* current language)) - (set! (-> obj language-direction) #t) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) + (set! (-> this selected-option) #t) + (when (= (-> s5-0 (-> this option-index) option-type) (game-option-type language)) + (set! (-> this language-selection) (-> *setting-control* current language)) + (set! (-> this language-direction) #t) + (set! (-> this language-transition) #f) + (set! (-> this language-x-offset) 0) 0 ) ) @@ -1602,29 +1602,29 @@ ) (else (sound-play "start-options") - (set! (-> obj selected-option) #f) - (case (-> s5-0 (-> obj option-index) option-type) + (set! (-> this selected-option) #f) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type aspect-ratio)) (set! (-> *setting-control* default aspect-ratio) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (((game-option-type video-mode)) - (case (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))) + (case (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify))) (('pal) (set! (-> *setting-control* default video-mode) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (('ntsc) - (push! obj) - (set! (-> obj next-display-state) (progress-screen pal-change-to-60hz)) + (push! this) + (set! (-> this next-display-state) (progress-screen pal-change-to-60hz)) ) ) ) (((game-option-type language)) - (if (not (-> obj language-transition)) - (load-level-text-files (-> obj display-level-index)) + (if (not (-> this language-transition)) + (load-level-text-files (-> this display-level-index)) ) ) ) @@ -1638,69 +1638,69 @@ (none) ) -(defmethod respond-progress progress ((obj progress)) - (when (not (-> obj in-transition)) +(defmethod respond-progress progress ((this progress)) + (when (not (-> this in-transition)) (cond ((cpad-pressed? 0 up) - (let ((s5-0 (-> obj display-level-index))) - (set! (-> obj next-level-index) (get-next-level-down s5-0)) - (when (!= s5-0 (-> obj next-level-index)) + (let ((s5-0 (-> this display-level-index))) + (set! (-> this next-level-index) (get-next-level-down s5-0)) + (when (!= s5-0 (-> this next-level-index)) (sound-play "cursor-up-down") - (set! (-> obj level-transition) 2) + (set! (-> this level-transition) 2) ) ) ) ((cpad-pressed? 0 down) - (let ((s5-2 (-> obj next-level-index))) - (set! (-> obj next-level-index) (get-next-level-up s5-2)) - (when (!= s5-2 (-> obj next-level-index)) + (let ((s5-2 (-> this next-level-index))) + (set! (-> this next-level-index) (get-next-level-up s5-2)) + (when (!= s5-2 (-> this next-level-index)) (sound-play "cursor-up-down") - (set! (-> obj level-transition) 1) + (set! (-> this level-transition) 1) ) ) ) ((cpad-pressed? 0 square) - (when (nonzero? (-> obj display-state)) + (when (nonzero? (-> this display-state)) (sound-play "select-option") - (set! (-> obj next-display-state) (progress-screen fuel-cell)) - (set! (-> obj stat-transition) #t) + (set! (-> this next-display-state) (progress-screen fuel-cell)) + (set! (-> this stat-transition) #t) ) ) ((cpad-pressed? 0 x) - (when (!= (-> obj display-state) (progress-screen money)) + (when (!= (-> this display-state) (progress-screen money)) (sound-play "select-option") - (set! (-> obj next-display-state) (progress-screen money)) - (set! (-> obj stat-transition) #t) + (set! (-> this next-display-state) (progress-screen money)) + (set! (-> this stat-transition) #t) ) ) ((cpad-pressed? 0 triangle) - (when (!= (-> obj display-state) (progress-screen buzzer)) + (when (!= (-> this display-state) (progress-screen buzzer)) (sound-play "select-option") - (set! (-> obj next-display-state) (progress-screen buzzer)) - (set! (-> obj stat-transition) #t) + (set! (-> this next-display-state) (progress-screen buzzer)) + (set! (-> this stat-transition) #t) ) ) ((cpad-pressed? 0 circle) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (sound-play "start-options") - (push! obj) - (set! (-> obj next-display-state) (progress-screen settings)) + (push! this) + (set! (-> this next-display-state) (progress-screen settings)) ) - ((= (-> obj display-state) (progress-screen fuel-cell)) + ((= (-> this display-state) (progress-screen fuel-cell)) (cond ((cpad-pressed? 0 left) - (let ((s5-8 (-> obj task-index))) - (set! (-> obj task-index) (get-next-task-down (-> obj task-index) (-> obj display-level-index))) - (if (!= s5-8 (-> obj task-index)) + (let ((s5-8 (-> this task-index))) + (set! (-> this task-index) (get-next-task-down (-> this task-index) (-> this display-level-index))) + (if (!= s5-8 (-> this task-index)) (sound-play "cursor-l-r") ) ) ) ((cpad-pressed? 0 right) - (let ((s5-10 (-> obj task-index))) - (set! (-> obj task-index) (get-next-task-up (-> obj task-index) (-> obj display-level-index))) - (if (!= s5-10 (-> obj task-index)) + (let ((s5-10 (-> this task-index))) + (set! (-> this task-index) (get-next-task-up (-> this task-index) (-> this display-level-index))) + (if (!= s5-10 (-> this task-index)) (sound-play "cursor-l-r") ) ) diff --git a/goal_src/jak1/engine/ui/text-h.gc b/goal_src/jak1/engine/ui/text-h.gc index 07ce13a90b..50fda6a71a 100644 --- a/goal_src/jak1/engine/ui/text-h.gc +++ b/goal_src/jak1/engine/ui/text-h.gc @@ -828,6 +828,7 @@ ;; GAME-TEXT-ID ENUM ENDS ) +;; DECOMP BEGINS ;; an individual string. (deftype game-text (structure) diff --git a/goal_src/jak1/engine/ui/text.gc b/goal_src/jak1/engine/ui/text.gc index d9e8a2ef77..3a41812562 100644 --- a/goal_src/jak1/engine/ui/text.gc +++ b/goal_src/jak1/engine/ui/text.gc @@ -14,6 +14,8 @@ ;; It seems like there it would be possible to have multiple "groups" of text, ;; but in practice, only the COMMON group is used. +;; DECOMP BEGINS + ;; State of text drawing. (define *game-text-word* (new 'global 'string 128 (the string '#f))) (define *game-text-line* (new 'global 'string 256 (the string '#f))) @@ -31,40 +33,40 @@ ;; The game-text-info stores records for each string in the loaded text on the text heap. -(defmethod length game-text-info ((obj game-text-info)) +(defmethod length game-text-info ((this game-text-info)) "Get the length (number of strings) in a game-text-info." - (-> obj length) + (-> this length) ) -(defmethod asize-of game-text-info ((obj game-text-info)) +(defmethod asize-of game-text-info ((this game-text-info)) "Get the size in memory of the game-text-info" ;; each record is 8 bytes - (the int (+ (-> obj type size) (* 8 (-> obj length)))) + (the int (+ (-> this type size) (* 8 (-> this length)))) ) -(defmethod inspect game-text-info ((obj game-text-info)) +(defmethod inspect game-text-info ((this game-text-info)) "Print a game text info, including all strings" - (format '#t "[~8x] ~A~%" obj (-> obj type)) - (format '#t "~Tlength: ~D~%" (-> obj length)) - (format '#t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) + (format '#t "[~8x] ~A~%" this (-> this type)) + (format '#t "~Tlength: ~D~%" (-> this length)) + (format '#t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) (let ((i 0)) - (while (< i (-> obj length)) - (format '#t "~T [~D] #x~X ~A~%" i (-> obj data i id) (-> obj data i text)) + (while (< i (-> this length)) + (format '#t "~T [~D] #x~X ~A~%" i (-> this data i id) (-> this data i text)) (+! i 1) ) ) - obj + this ) -(defmethod mem-usage game-text-info ((obj game-text-info) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage game-text-info ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) "Get the memory usage." (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (set! (-> arg0 data 80 count) (+ (-> arg0 data 80 count) 1)) ;; get the size of this structure - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (set! (-> arg0 data 80 used) (+ (-> arg0 data 80 used) v1-6)) (set! (-> arg0 data 80 total) (+ (-> arg0 data 80 total) (logand -16 (+ v1-6 15))) @@ -72,33 +74,33 @@ ) ;; get the size of all the strings - (dotimes (s4-0 (-> obj length)) + (dotimes (s4-0 (-> this length)) (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (set! (-> arg0 data 80 count) (+ (-> arg0 data 80 count) 1)) - (let ((v1-18 (asize-of (-> obj data s4-0 text)))) + (let ((v1-18 (asize-of (-> this data s4-0 text)))) (set! (-> arg0 data 80 used) (+ (-> arg0 data 80 used) v1-18)) (set! (-> arg0 data 80 total) (+ (-> arg0 data 80 total) (logand -16 (+ v1-18 15))) ) ) ) - obj + this ) -(defmethod lookup-text! game-text-info ((obj game-text-info) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text! game-text-info ((this game-text-info) (arg0 text-id) (arg1 symbol)) "Look up text by ID. Will return the string. If the ID can't be found, and arg1 is #t, it will return #f, otherwise the temp string UNKNOWN ID " ;; binary search for it (let* ((a1-1 0) ;; min - (a3-0 (+ (-> obj length) 1)) ;; max + (a3-0 (+ (-> this length) 1)) ;; max (v1-2 (/ (+ a1-1 a3-0) 2)) ;; mid ) (let ((t0-0 -1)) ;; last time's lookup - (while (and (!= (-> obj data v1-2 id) arg0) (!= v1-2 t0-0)) ;; while we haven't found it/not the same as last time - (if (< arg0 (-> obj data v1-2 id)) + (while (and (!= (-> this data v1-2 id) arg0) (!= v1-2 t0-0)) ;; while we haven't found it/not the same as last time + (if (< arg0 (-> this data v1-2 id)) (set! a3-0 v1-2) ;; bisect, right (set! a1-1 v1-2) ;; bisect, left ) @@ -107,7 +109,7 @@ ) ) (cond - ((!= (-> obj data v1-2 id) arg0) ;; didn't find it :( + ((!= (-> this data v1-2 id) arg0) ;; didn't find it :( (cond (arg1 (the-as string #f) @@ -126,7 +128,7 @@ ) ) (else - (-> obj data v1-2 text) ;; found it! + (-> this data v1-2 text) ;; found it! ) ) ) @@ -694,4 +696,3 @@ (set! *level-text-file-load-flag* #t) (none) ) - diff --git a/goal_src/jak1/engine/util/capture.gc b/goal_src/jak1/engine/util/capture.gc index 14951741a6..a3ba4b37bb 100644 --- a/goal_src/jak1/engine/util/capture.gc +++ b/goal_src/jak1/engine/util/capture.gc @@ -8,6 +8,11 @@ ;; Functions for taking a screenshot of VRAM. ;; These are debug-only and leak memory. +;; DECOMP BEGINS + +;; this file is debug only +(declare-file (debug)) + ;; vif/gif tags to do a transfer of data from VRAM to EE memory. (deftype gs-store-image-packet (structure) ((vifcode vif-tag 4 :offset-assert 0) diff --git a/goal_src/jak1/engine/util/glist-h.gc b/goal_src/jak1/engine/util/glist-h.gc index 029d2470de..37c0c69c16 100644 --- a/goal_src/jak1/engine/util/glist-h.gc +++ b/goal_src/jak1/engine/util/glist-h.gc @@ -9,6 +9,9 @@ ;; Very very weird linked list system. ;; TODO add examples because this is extremely confusing. +;; DECOMP BEGINS + +;; this file is debug only (declare-file (debug)) (deftype glst-node (structure) diff --git a/goal_src/jak1/engine/util/smush-control-h.gc b/goal_src/jak1/engine/util/smush-control-h.gc index 08d301583f..d0727b4fda 100644 --- a/goal_src/jak1/engine/util/smush-control-h.gc +++ b/goal_src/jak1/engine/util/smush-control-h.gc @@ -10,6 +10,8 @@ ;; - there is a maximum duration. ;; - the amplitude is additionally linearly scaled to go to zero over the duration. +;; DECOMP BEGINS + (deftype smush-control (structure) ((start-time time-frame :offset-assert 0) (period float :offset-assert 8) @@ -33,54 +35,54 @@ ) ) -(defmethod nonzero-amplitude? smush-control ((obj smush-control)) +(defmethod nonzero-amplitude? smush-control ((this smush-control)) "Return #t if amp is not zero, #f otherwise" (declare (inline)) - (!= (-> obj amp) 0.0) + (!= (-> this amp) 0.0) ) -(defmethod set-zero! smush-control ((obj smush-control)) - (set! (-> obj period) 0.0) - (set! (-> obj duration) 0.0) - (set! (-> obj amp) 0.0) - (set! (-> obj damp-amp) 0.0) - (set! (-> obj damp-period) 0.0) - (set! (-> obj ticks) 0.0) - obj +(defmethod set-zero! smush-control ((this smush-control)) + (set! (-> this period) 0.0) + (set! (-> this duration) 0.0) + (set! (-> this amp) 0.0) + (set! (-> this damp-amp) 0.0) + (set! (-> this damp-period) 0.0) + (set! (-> this ticks) 0.0) + this ) -(defmethod update! smush-control ((obj smush-control)) +(defmethod update! smush-control ((this smush-control)) "Run the smush control and return the result. Updates the internal state." (cond - ((nonzero-amplitude? obj) - (let* ((time-since-start (the float (- (-> *display* base-frame-counter) (-> obj start-time)))) + ((nonzero-amplitude? this) + (let* ((time-since-start (the float (- (-> *display* base-frame-counter) (-> this start-time)))) ;; use float to int rounding to figure out offset into the current period. - (time-since-period-start (- time-since-start (* (the float (the int (/ time-since-start (-> obj period)))) (-> obj period)))) + (time-since-period-start (- time-since-start (* (the float (the int (/ time-since-start (-> this period)))) (-> this period)))) ) ;; we completed a new period! - (when (>= (- time-since-start (-> obj ticks)) (-> obj period)) + (when (>= (- time-since-start (-> this ticks)) (-> this period)) ;; once per period updates of amp/period - (set! (-> obj amp) (* (-> obj amp) (-> obj damp-amp))) - (set! (-> obj period) (* (-> obj period) (-> obj damp-period))) + (set! (-> this amp) (* (-> this amp) (-> this damp-amp))) + (set! (-> this period) (* (-> this period) (-> this damp-period))) ;; store the ticks that we did this on - (set! (-> obj ticks) time-since-start) + (set! (-> this ticks) time-since-start) ;; you can set damp-period to a negative number to indicate ;; that it should die on the next update. Do that here. - (if (< (-> obj damp-period) 0.0) - (set-zero! obj) + (if (< (-> this damp-period) 0.0) + (set-zero! this) ) ) ;; absolute duraction check - (if (>= time-since-start (-> obj duration)) - (set-zero! obj) + (if (>= time-since-start (-> this duration)) + (set-zero! this) ) ;; sine term multiplied by amplitude, and scaled by how much is left to go. - (* (sin (/ (* DEGREES_PER_ROT time-since-period-start) (-> obj period))) - (* (-> obj amp) - (/ (- (-> obj duration) time-since-start) (-> obj duration))) + (* (sin (/ (* DEGREES_PER_ROT time-since-period-start) (-> this period))) + (* (-> this amp) + (/ (- (-> this duration) time-since-start) (-> this duration))) ) ) ) @@ -89,17 +91,17 @@ ) ) -(defmethod get-no-update smush-control ((obj smush-control)) +(defmethod get-no-update smush-control ((this smush-control)) "Get the value, but don't update internal state" (cond - ((nonzero-amplitude? obj) - (let* ((time-since-start (the float (- (-> *display* base-frame-counter) (-> obj start-time)))) - (time-since-period-start (- time-since-start (* (the float (the int (/ time-since-start (-> obj period)))) (-> obj period)))) + ((nonzero-amplitude? this) + (let* ((time-since-start (the float (- (-> *display* base-frame-counter) (-> this start-time)))) + (time-since-period-start (- time-since-start (* (the float (the int (/ time-since-start (-> this period)))) (-> this period)))) ) - (* (sin (/ (* DEGREES_PER_ROT time-since-period-start) (-> obj period))) - (* (-> obj amp) - (/ (- (-> obj duration) time-since-start) (-> obj duration))) + (* (sin (/ (* DEGREES_PER_ROT time-since-period-start) (-> this period))) + (* (-> this amp) + (/ (- (-> this duration) time-since-start) (-> this duration))) ) ) ) @@ -108,17 +110,17 @@ ) ) -(defmethod die-on-next-update! smush-control ((obj smush-control)) +(defmethod die-on-next-update! smush-control ((this smush-control)) "On the next call to update!, zero everything. Calls to get-no-update will still work." - (if (nonzero-amplitude? obj) - (set! (-> obj damp-period) -1.0) + (if (nonzero-amplitude? this) + (set! (-> this damp-period) -1.0) ) - obj + this ) -(defmethod activate! smush-control ((obj smush-control) +(defmethod activate! smush-control ((this smush-control) (arg0 float) (arg1 int) (arg2 int) @@ -127,16 +129,16 @@ ) "Activate the smush! This only activates if the ongoing smush is mostly done." - (when (>= (fabs (* 0.2 (-> obj amp))) - (fabs (get-no-update obj)) + (when (>= (fabs (* 0.2 (-> this amp))) + (fabs (get-no-update this)) ) - (set! (-> obj amp) arg0) - (set! (-> obj period) (the float arg1)) - (set! (-> obj duration) (the float arg2)) - (set! (-> obj damp-amp) arg3) - (set! (-> obj damp-period) arg4) - (set! (-> obj ticks) 0.0) - (set! (-> obj start-time) (-> *display* base-frame-counter)) + (set! (-> this amp) arg0) + (set! (-> this period) (the float arg1)) + (set! (-> this duration) (the float arg2)) + (set! (-> this damp-amp) arg3) + (set! (-> this damp-period) arg4) + (set! (-> this ticks) 0.0) + (set! (-> this start-time) (-> *display* base-frame-counter)) ) - obj + this ) diff --git a/goal_src/jak1/engine/util/sync-info-h.gc b/goal_src/jak1/engine/util/sync-info-h.gc index aff5761bd6..a5986b1432 100644 --- a/goal_src/jak1/engine/util/sync-info-h.gc +++ b/goal_src/jak1/engine/util/sync-info-h.gc @@ -10,6 +10,8 @@ ;; There are also some non-syncronized movement helpers in here. +;; DECOMP BEGINS + ;; Simplest synchronization. Simply counts up, then resets once it reaches period. ;; For example, this is used to synchronize the "pies" in citadel. (deftype sync-info (structure) diff --git a/goal_src/jak1/engine/util/sync-info.gc b/goal_src/jak1/engine/util/sync-info.gc index 9a5e14a308..f27be79d3f 100644 --- a/goal_src/jak1/engine/util/sync-info.gc +++ b/goal_src/jak1/engine/util/sync-info.gc @@ -5,33 +5,34 @@ ;; name in dgo: sync-info ;; dgos: GAME, ENGINE +;; DECOMP BEGINS -(defmethod setup-params! sync-info ((obj sync-info) (period uint) (phase float) (arg2 float) (arg3 float)) +(defmethod setup-params! sync-info ((this sync-info) (period uint) (phase float) (arg2 float) (arg3 float)) "Setup a sync-info. period is the duration of the pattern. phase is the offset relative to the global clock, specified as a fraction of period." - (set! (-> obj period) period) + (set! (-> this period) period) (let* ((period-float (the float period)) (value (* phase period-float)) ) ;; this is like (fmod value period-float) - (set! (-> obj offset) + (set! (-> this offset) (- value (* (the float (the int (/ value period-float))) period-float)) ) ) (none) ) -(defmethod setup-params! sync-info-eased ((obj sync-info-eased) (period uint) (phase float) (out-param float) (in-param float)) +(defmethod setup-params! sync-info-eased ((this sync-info-eased) (period uint) (phase float) (out-param float) (in-param float)) "Setup a sync-info-eased. The out-param and in-param are related to the smoothing at the beginning/end. it looks like the easing is cubic so the first derivative is continuous." - (set! (-> obj period) period) + (set! (-> this period) period) ;; set the offset from the phase (let* ((period-float (the float period)) (value (* phase period-float)) ) - (set! (-> obj offset) (- value (* (the float (the int (/ value period-float))) period-float))) + (set! (-> this offset) (- value (* (the float (the int (/ value period-float))) period-float))) ) ;; saturate the params (if (< out-param 0.0) @@ -59,24 +60,24 @@ (f4-3 (/ f0-10 (- 1.0 f1-12))) (y-end (+ (* (* (- 1.0 f1-12) (- 1.0 f1-12)) f4-3) f3-3)) ) - (set! (-> obj tlo) f0-10) - (set! (-> obj thi) f1-12) - (set! (-> obj ylo) f2-5) - (set! (-> obj m2) f4-3) - (set! (-> obj yend) y-end) + (set! (-> this tlo) f0-10) + (set! (-> this thi) f1-12) + (set! (-> this ylo) f2-5) + (set! (-> this m2) f4-3) + (set! (-> this yend) y-end) ) ) (none) ) -(defmethod setup-params! sync-info-paused ((obj sync-info-paused) (period uint) (phase float) (out-param float) (in-param float)) +(defmethod setup-params! sync-info-paused ((this sync-info-paused) (period uint) (phase float) (out-param float) (in-param float)) "Setup a sync-info-paused. The params are delays for the pause, specified in a fraction of period." - (set! (-> obj period) period) + (set! (-> this period) period) ;; set phase. (let* ((f0-1 (the float period)) (f1-1 (* phase f0-1)) ) - (set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1))) + (set! (-> this offset) (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1))) ) ;; saturate params (cond @@ -96,12 +97,12 @@ (set! in-param (- 1.0 out-param)) ) ) - (set! (-> obj pause-after-in) in-param) - (set! (-> obj pause-after-out) out-param) + (set! (-> this pause-after-in) in-param) + (set! (-> this pause-after-out) out-param) (none) ) -(defmethod load-params! sync-info ((obj sync-info) (proc process) (default-period uint) (default-phase float) (default-out float) (default-in float)) +(defmethod load-params! sync-info ((this sync-info) (proc process) (default-period uint) (default-phase float) (default-out float) (default-in float)) "Load params from the res of a process, and set them up. If the res lookup fails, returns #f and uses the specified defaults." (local-vars (sv-16 res-tag)) @@ -111,7 +112,7 @@ (v1-1 ;; res lookup succeeded, we should have two values: a period (not yet in seconds) and a phase. (setup-params! - obj + this (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) (-> (the-as (pointer float) v1-1) 1) 0.15 @@ -121,14 +122,14 @@ ) (else ;; failed, set defaults - (setup-params! obj default-period default-phase 0.15 0.15) + (setup-params! this default-period default-phase 0.15 0.15) #f ) ) ) ) -(defmethod load-params! sync-info-eased ((obj sync-info-eased) (proc process) (default-period uint) (default-phase float) (default-out float) (default-in float)) +(defmethod load-params! sync-info-eased ((this sync-info-eased) (proc process) (default-period uint) (default-phase float) (default-out float) (default-in float)) "Load settings from a res. Can load settings from just a sync-info and uses defaults. If res lookup totally fails, will return #f and use all defaults." (local-vars (sv-16 res-tag)) @@ -139,14 +140,14 @@ ;; we may not get all the parameters (if (>= (-> sv-16 elt-count) (the-as uint 4)) (setup-params! - obj + this (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) (-> (the-as (pointer float) v1-1) 1) (-> (the-as (pointer float) v1-1) 2) (-> (the-as (pointer float) v1-1) 3) ) (setup-params! - obj + this (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) (-> (the-as (pointer float) v1-1) 1) default-out @@ -156,14 +157,14 @@ #t ) (else - (setup-params! obj default-period default-phase default-out default-in) + (setup-params! this default-period default-phase default-out default-in) #f ) ) ) ) -(defmethod load-params! sync-info-paused ((obj sync-info-paused) (proc process) (default-period uint) (default-phase float) (default-out float) (default-in float)) +(defmethod load-params! sync-info-paused ((this sync-info-paused) (proc process) (default-period uint) (default-phase float) (default-out float) (default-in float)) "Load and setup a sync-info-paused." (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) @@ -172,14 +173,14 @@ (v1-1 (if (>= (-> sv-16 elt-count) (the-as uint 4)) (setup-params! - obj + this (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) (-> (the-as (pointer float) v1-1) 1) (-> (the-as (pointer float) v1-1) 2) (-> (the-as (pointer float) v1-1) 3) ) (setup-params! - obj + this (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) (-> (the-as (pointer float) v1-1) 1) default-out @@ -189,22 +190,22 @@ #t ) (else - (setup-params! obj default-period default-phase default-out default-in) + (setup-params! this default-period default-phase default-out default-in) #f ) ) ) ) -(defmethod get-current-phase-no-mod sync-info ((obj sync-info)) +(defmethod get-current-phase-no-mod sync-info ((this sync-info)) "Based on the current frame, get the current phase. Does not apply any modifications like pauses or eases." - (let* ((period (-> obj period)) + (let* ((period (-> this period)) (period-float (the float period)) ;; now + offset (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) - (-> obj offset) + (-> this offset) ) ) ) @@ -216,14 +217,14 @@ ) ) -(defmethod get-phase-offset sync-info ((obj sync-info)) +(defmethod get-phase-offset sync-info ((this sync-info)) "Get the offset, as a fraction of period" - (/ (-> obj offset) (the float (-> obj period))) + (/ (-> this offset) (the float (-> this period))) ) -(defmethod sync-now! sync-info ((obj sync-info) (user-phase-offset float)) +(defmethod sync-now! sync-info ((this sync-info) (user-phase-offset float)) "Adjusts our offset so we are at phase user-phase-offset now" - (let* ((period (-> obj period)) + (let* ((period (-> this period)) (period-float (the float period)) ;; in (0, 1) (wrapped-user-offset @@ -236,7 +237,7 @@ ;; with the current offset, what is the time (0, period)? (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) - (-> obj offset) + (-> this offset) ) ) ;; current period in (0, 1) @@ -250,7 +251,7 @@ (+ (+ (* (- wrapped-user-offset current-period-wrapped) period-float) period-float ) - (-> obj offset) + (-> this offset) ) ) ;; wrap it @@ -260,16 +261,16 @@ ) ) ) - (set! (-> obj offset) combined-offset-wrapped) + (set! (-> this offset) combined-offset-wrapped) combined-offset-wrapped ) ) -(defmethod get-current-phase sync-info ((obj sync-info)) +(defmethod get-current-phase sync-info ((this sync-info)) "Get the current phase." - (let* ((period (-> obj period)) + (let* ((period (-> this period)) (period-float (the float period)) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) ) ;; don't need to wrap this again. (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) @@ -278,27 +279,27 @@ ) ) -(defmethod get-current-phase sync-info-paused ((obj sync-info-paused)) +(defmethod get-current-phase sync-info-paused ((this sync-info-paused)) "Get the current phase. this only uses the pause-after-out - use the mirrored version for pauses on both ends" - (let* ((period (-> obj period)) + (let* ((period (-> this period)) (period-float (the float period)) (max-phase 1.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) ) (fmin max-phase (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) - (* period-float (- 1.0 (-> obj pause-after-out))) ;; just tweak the effective period so we end early + (* period-float (- 1.0 (-> this pause-after-out))) ;; just tweak the effective period so we end early ) ) ) ) -(defmethod get-current-value sync-info ((obj sync-info) (max-val float)) +(defmethod get-current-value sync-info ((this sync-info) (max-val float)) "This is just get-current-phase multiplied by max-val" - (let* ((period (-> obj period)) + (let* ((period (-> this period)) (period-float (the float period)) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) ) (* (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float @@ -308,17 +309,17 @@ ) ) -(defmethod get-current-value sync-info-paused ((obj sync-info-paused) (arg0 float)) +(defmethod get-current-value sync-info-paused ((this sync-info-paused) (arg0 float)) "This is just get-current-phase multiplied by max-val" - (* (get-current-phase obj) arg0) + (* (get-current-phase this) arg0) ) -(defmethod get-current-phase-with-mirror sync-info ((obj sync-info)) +(defmethod get-current-phase-with-mirror sync-info ((this sync-info)) "Gets the phase that goes from 0 to 1 back to 0 every period." - (let* ((period (-> obj period)) + (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) (phase-out-of-2 (* max-val (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) @@ -335,13 +336,13 @@ ) -(defmethod get-current-phase-with-mirror sync-info-eased ((obj sync-info-eased)) +(defmethod get-current-phase-with-mirror sync-info-eased ((this sync-info-eased)) "Get the phase that goes from 0 to 1 back to 0 every period. Note that sync-info-eased only does easing on this mirrored version." - (let* ((period (-> obj period)) + (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) (current-val (* max-val (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) @@ -357,24 +358,24 @@ (set! in-mirror? #t) (set! current-val (+ -1.0 current-val)) ) - (let* ((tlo (-> obj tlo)) + (let* ((tlo (-> this tlo)) (eased-phase (/ (cond ((< current-val tlo) ;; quadratic ramp in (* current-val current-val) ) - ((< current-val (-> obj thi)) + ((< current-val (-> this thi)) ;; linear part - (+ (* (* 2.0 tlo) (- current-val tlo)) (-> obj ylo)) + (+ (* (* 2.0 tlo) (- current-val tlo)) (-> this ylo)) ) (else (let ((f1-7 (- 1.0 current-val))) ;; quadratic ramp out - (- (-> obj yend) (* (* f1-7 f1-7) (-> obj m2))) + (- (-> this yend) (* (* f1-7 f1-7) (-> this m2))) ) ) ) - (-> obj yend) + (-> this yend) ) ) ) @@ -387,19 +388,19 @@ ) ) -(defmethod get-current-phase-with-mirror sync-info-paused ((obj sync-info-paused)) +(defmethod get-current-phase-with-mirror sync-info-paused ((this sync-info-paused)) "Get the phase that goes from 0 to 1 to 0 in one period." - (let* ((v1-0 (-> obj period)) + (let* ((v1-0 (-> this period)) (f1-0 (the float v1-0)) ;; max val (f0-1 2.0) ;; current-time - (f2-2 (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) v1-0)) (-> obj offset))) + (f2-2 (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) v1-0)) (-> this offset))) ;; phase (f0-2 (* f0-1 (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0))) ;; offset for pause - (f1-3 (- 1.0 (* 2.0 (-> obj pause-after-in)))) - (f2-7 (- 1.0 (* 2.0 (-> obj pause-after-out)))) + (f1-3 (- 1.0 (* 2.0 (-> this pause-after-in)))) + (f2-7 (- 1.0 (* 2.0 (-> this pause-after-out)))) ) (cond ((>= f0-2 (+ 1.0 f1-3)) @@ -421,12 +422,12 @@ ) ) -(defmethod get-current-value-with-mirror sync-info ((obj sync-info) (max-out-val float)) +(defmethod get-current-value-with-mirror sync-info ((this sync-info) (max-out-val float)) "Get the phase that goes from 0 to max-out-val to 0 in each period." - (let* ((period (-> obj period)) + (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> this offset))) (current-val (* max-val (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) @@ -442,44 +443,44 @@ ) ) -(defmethod get-current-value-with-mirror sync-info-eased ((obj sync-info-eased) (max-out-val float)) +(defmethod get-current-value-with-mirror sync-info-eased ((this sync-info-eased) (max-out-val float)) "Get phase that goes from 0 to max-out-val to 0 in each period" - (* (get-current-phase-with-mirror obj) max-out-val) + (* (get-current-phase-with-mirror this) max-out-val) ) -(defmethod get-current-value-with-mirror sync-info-paused ((obj sync-info-paused) (max-out-val float)) +(defmethod get-current-value-with-mirror sync-info-paused ((this sync-info-paused) (max-out-val float)) "Get phase that goes from 0 to max-out-val to 0 in each period" - (* (get-current-phase-with-mirror obj) max-out-val) + (* (get-current-phase-with-mirror this) max-out-val) ) -(defmethod set-params! delayed-rand-float ((obj delayed-rand-float) (min-tim int) (max-time int) (max-times-two float)) +(defmethod set-params! delayed-rand-float ((this delayed-rand-float) (min-tim int) (max-time int) (max-times-two float)) "Float that changes randomly: min-time: minimum time between changes max-time: maximum time between changes max-times-two: maximum range. result is centered around zero." - (set! (-> obj min-time) min-tim) - (set! (-> obj max-time) max-time) - (set! (-> obj max-val) (* 0.5 max-times-two)) - (set! (-> obj start-time) 0) - (set! (-> obj timer) 0) - (set! (-> obj value) 0.0) - (-> obj value) + (set! (-> this min-time) min-tim) + (set! (-> this max-time) max-time) + (set! (-> this max-val) (* 0.5 max-times-two)) + (set! (-> this start-time) 0) + (set! (-> this timer) 0) + (set! (-> this value) 0.0) + (-> this value) ) -(defmethod update! delayed-rand-float ((obj delayed-rand-float)) +(defmethod update! delayed-rand-float ((this delayed-rand-float)) "Get the value." - (when (>= (- (-> *display* base-frame-counter) (-> obj start-time)) (-> obj timer)) + (when (>= (- (-> *display* base-frame-counter) (-> this start-time)) (-> this timer)) ;; only update if enough time has passed. - (set! (-> obj start-time) (-> *display* base-frame-counter)) + (set! (-> this start-time) (-> *display* base-frame-counter)) ;; come up with a random end time. - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) ;; come up with a random value in (-max, max) - (set! (-> obj value) (rand-vu-float-range (- (-> obj max-val)) (-> obj max-val))) + (set! (-> this value) (rand-vu-float-range (- (-> this max-val)) (-> this max-val))) ) - (-> obj value) + (-> this value) ) -(defmethod set-params! oscillating-float ((obj oscillating-float) (init-val float) (accel float) (max-vel float) (damping float)) +(defmethod set-params! oscillating-float ((this oscillating-float) (init-val float) (accel float) (max-vel float) (damping float)) "Setup an oscillating-float. It will head toward the target, but will overshoot and oscillate before eventually reaching the target. init-val: the initial value and target @@ -487,35 +488,35 @@ damping: this is 1 - damping really. 0 means don't move, 1 means oscillate forever. accel: gain." - (set! (-> obj value) init-val) - (set! (-> obj target) init-val) - (set! (-> obj vel) 0.0) - (set! (-> obj max-vel) max-vel) - (set! (-> obj damping) damping) - (set! (-> obj accel) accel) - (-> obj value) + (set! (-> this value) init-val) + (set! (-> this target) init-val) + (set! (-> this vel) 0.0) + (set! (-> this max-vel) max-vel) + (set! (-> this damping) damping) + (set! (-> this accel) accel) + (-> this value) ) -(defmethod update! oscillating-float ((obj oscillating-float) (target-offset float)) +(defmethod update! oscillating-float ((this oscillating-float) (target-offset float)) ;; first compute desired acceleration - (let ((acc (* (- (+ (-> obj target) target-offset) (-> obj value)) - (* (-> obj accel) (-> *display* time-adjust-ratio)) + (let ((acc (* (- (+ (-> this target) target-offset) (-> this value)) + (* (-> this accel) (-> *display* time-adjust-ratio)) ) ) ) ;; integrate and update velocity - (+! (-> obj vel) acc) + (+! (-> this vel) acc) ) ;; limit velocity - (set! (-> obj vel) (fmin (-> obj max-vel) (fmax (- (-> obj max-vel)) (-> obj vel)))) + (set! (-> this vel) (fmin (-> this max-vel) (fmax (- (-> this max-vel)) (-> this vel)))) ;; apply damping - (set! (-> obj vel) (* (-> obj vel) (-> obj damping))) + (set! (-> this vel) (* (-> this vel) (-> this damping))) ;; integrate and update position - (+! (-> obj value) (* (-> obj vel) (-> *display* time-adjust-ratio))) - (-> obj value) + (+! (-> this value) (* (-> this vel) (-> *display* time-adjust-ratio))) + (-> this value) ) -(defmethod set-params! bouncing-float ((obj bouncing-float) (init-val float) (max-val float) (min-val float) (elast float) (accel float) (max-vel float) (damping float)) +(defmethod set-params! bouncing-float ((this bouncing-float) (init-val float) (max-val float) (min-val float) (elast float) (accel float) (max-vel float) (damping float)) "Float that bounces. It's an oscillating float, but you can add a floor/ceiling that has an elastic collision. init-val: intial value and target. @@ -525,135 +526,135 @@ accel: gain max-vel: maximum velocity, not in elastic part. damping: damping for the non-elastic part." - (set-params! (-> obj osc) init-val accel max-vel damping) - (set! (-> obj max-value) max-val) - (set! (-> obj min-value) min-val) - (set! (-> obj elasticity) elast) - (set! (-> obj state) 0) - (-> obj osc value) + (set-params! (-> this osc) init-val accel max-vel damping) + (set! (-> this max-value) max-val) + (set! (-> this min-value) min-val) + (set! (-> this elasticity) elast) + (set! (-> this state) 0) + (-> this osc value) ) -(defmethod update! bouncing-float ((obj bouncing-float) (arg0 float)) +(defmethod update! bouncing-float ((this bouncing-float) (arg0 float)) ;; first, update the oscillator and assume we aren't in a bouncing part - (update! (-> obj osc) arg0) - (set! (-> obj state) 0) + (update! (-> this osc) arg0) + (set! (-> this state) 0) - (when (>= (-> obj osc value) (-> obj max-value)) + (when (>= (-> this osc value) (-> this max-value)) ;; boucing off of the ceiling. first, saturate to max-val - (set! (-> obj osc value) (-> obj max-value)) - (if (< 0.0 (-> obj osc vel)) + (set! (-> this osc value) (-> this max-value)) + (if (< 0.0 (-> this osc vel)) ;; then update our velocity for the elastic collision - (set! (-> obj osc vel) (* (-> obj osc vel) (- (-> obj elasticity)))) + (set! (-> this osc vel) (* (-> this osc vel) (- (-> this elasticity)))) ) ;; and remember we did this, so at-min/at-max work - (set! (-> obj state) 1) + (set! (-> this state) 1) ) ;; same for bouncing off of the floor - (when (>= (-> obj min-value) (-> obj osc value)) - (set! (-> obj osc value) (-> obj min-value)) - (if (< (-> obj osc vel) 0.0) - (set! (-> obj osc vel) (* (-> obj osc vel) (- (-> obj elasticity)))) + (when (>= (-> this min-value) (-> this osc value)) + (set! (-> this osc value) (-> this min-value)) + (if (< (-> this osc vel) 0.0) + (set! (-> this osc vel) (* (-> this osc vel) (- (-> this elasticity)))) ) - (set! (-> obj state) -1) + (set! (-> this state) -1) ) - (-> obj osc value) + (-> this osc value) ) -(defmethod at-min? bouncing-float ((obj bouncing-float)) +(defmethod at-min? bouncing-float ((this bouncing-float)) "Did the last update it the minimum value?" - (= (-> obj state) -1) + (= (-> this state) -1) ) -(defmethod at-max? bouncing-float ((obj bouncing-float)) +(defmethod at-max? bouncing-float ((this bouncing-float)) "Did the last update hit the maximum value?" - (= (-> obj state) 1) + (= (-> this state) 1) ) -(defmethod set-params! delayed-rand-vector ((obj delayed-rand-vector) (min-time int) (max-time int) (xz-range float) (y-range float)) +(defmethod set-params! delayed-rand-vector ((this delayed-rand-vector) (min-time int) (max-time int) (xz-range float) (y-range float)) "Set up a delayed-rand-vector. This vector randomly changes at random times. min-time: minimum time between changes max-time: maximum time between changes xz-range: xz results in (-range/2, range/2) y-range: y results in (-range/2, range/2)" - (set! (-> obj min-time) min-time) - (set! (-> obj max-time) max-time) - (set! (-> obj xz-max) (* 0.5 xz-range)) - (set! (-> obj y-max) (* 0.5 y-range)) - (set! (-> obj start-time) 0) - (set! (-> obj timer) 0) - (vector-reset! (-> obj value)) - (-> obj value) + (set! (-> this min-time) min-time) + (set! (-> this max-time) max-time) + (set! (-> this xz-max) (* 0.5 xz-range)) + (set! (-> this y-max) (* 0.5 y-range)) + (set! (-> this start-time) 0) + (set! (-> this timer) 0) + (vector-reset! (-> this value)) + (-> this value) ) -(defmethod update-now! delayed-rand-vector ((obj delayed-rand-vector)) +(defmethod update-now! delayed-rand-vector ((this delayed-rand-vector)) "update to a random value now" - (set! (-> obj start-time) (-> *display* base-frame-counter)) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value x) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (set! (-> obj value y) (rand-vu-float-range (- (-> obj y-max)) (-> obj y-max))) - (set! (-> obj value z) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (-> obj value) + (set! (-> this start-time) (-> *display* base-frame-counter)) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (set! (-> this value y) (rand-vu-float-range (- (-> this y-max)) (-> this y-max))) + (set! (-> this value z) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (-> this value) ) -(defmethod update-with-delay! delayed-rand-vector ((obj delayed-rand-vector)) +(defmethod update-with-delay! delayed-rand-vector ((this delayed-rand-vector)) "Update, if enough time has passed" - (if (>= (- (-> *display* base-frame-counter) (-> obj start-time)) (-> obj timer)) - (update-now! obj) + (if (>= (- (-> *display* base-frame-counter) (-> this start-time)) (-> this timer)) + (update-now! this) ) - (-> obj value) + (-> this value) ) -(defmethod update-with-delay-or-reset! delayed-rand-vector ((obj delayed-rand-vector)) +(defmethod update-with-delay-or-reset! delayed-rand-vector ((this delayed-rand-vector)) "Update, if enough time has passed. Otherwise reset to zero." - (if (>= (- (-> *display* base-frame-counter) (-> obj start-time)) (-> obj timer)) - (update-now! obj) - (vector-reset! (-> obj value)) + (if (>= (- (-> *display* base-frame-counter) (-> this start-time)) (-> this timer)) + (update-now! this) + (vector-reset! (-> this value)) ) - (-> obj value) + (-> this value) ) -(defmethod set-params! oscillating-vector ((obj oscillating-vector) (init-val vector) (accel float) (max-vel float) (damping float)) +(defmethod set-params! oscillating-vector ((this oscillating-vector) (init-val vector) (accel float) (max-vel float) (damping float)) "Works just like oscillating-float, but does a whole vector. init-val can be #f to reset to 0." (cond (init-val - (set! (-> obj value quad) (-> init-val quad)) - (set! (-> obj target quad) (-> init-val quad)) + (set! (-> this value quad) (-> init-val quad)) + (set! (-> this target quad) (-> init-val quad)) ) (else - (vector-reset! (-> obj value)) - (vector-reset! (-> obj target)) + (vector-reset! (-> this value)) + (vector-reset! (-> this target)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj max-vel) max-vel) - (set! (-> obj damping) damping) - (set! (-> obj accel) accel) - (-> obj value) + (vector-reset! (-> this vel)) + (set! (-> this max-vel) max-vel) + (set! (-> this damping) damping) + (set! (-> this accel) accel) + (-> this value) ) -(defmethod update! oscillating-vector ((obj oscillating-vector) (target-offset vector)) +(defmethod update! oscillating-vector ((this oscillating-vector) (target-offset vector)) "target-offset can be #f, acts like 0" (let ((s5-0 (new 'stack-no-clear 'vector))) (cond (target-offset - (vector+! s5-0 (-> obj target) target-offset) - (vector-! s5-0 s5-0 (-> obj value)) + (vector+! s5-0 (-> this target) target-offset) + (vector-! s5-0 s5-0 (-> this value)) ) (else - (vector-! s5-0 (-> obj target) (-> obj value)) + (vector-! s5-0 (-> this target) (-> this value)) ) ) - (vector-float*! s5-0 s5-0 (* (-> obj accel) (-> *display* time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) s5-0) - (let ((vel (vector-length (-> obj vel)))) - (if (< (-> obj max-vel) vel) - (vector-float*! (-> obj vel) (-> obj vel) (/ (-> obj max-vel) vel)) + (vector-float*! s5-0 s5-0 (* (-> this accel) (-> *display* time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) s5-0) + (let ((vel (vector-length (-> this vel)))) + (if (< (-> this max-vel) vel) + (vector-float*! (-> this vel) (-> this vel) (/ (-> this max-vel) vel)) ) ) - (vector-float*! (-> obj vel) (-> obj vel) (-> obj damping)) - (vector-float*! s5-0 (-> obj vel) (-> *display* time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) s5-0) + (vector-float*! (-> this vel) (-> this vel) (-> this damping)) + (vector-float*! s5-0 (-> this vel) (-> *display* time-adjust-ratio)) + (vector+! (-> this value) (-> this value) s5-0) ) - (-> obj value) + (-> this value) ) diff --git a/goal_src/jak1/kernel/dgo-h.gc b/goal_src/jak1/kernel/dgo-h.gc index 92a38100d6..343d4706f0 100644 --- a/goal_src/jak1/kernel/dgo-h.gc +++ b/goal_src/jak1/kernel/dgo-h.gc @@ -8,6 +8,8 @@ ;; I suspect that these are unused, and were for an older version of DGO. ;; All DGO stuff is handled on the IOP. +;; DECOMP BEGINS + ;; seems to be unused, and not accurate to a DGO file anyway. ;; all DGO stuff is handled on the IOP. (deftype dgo-entry (structure) diff --git a/goal_src/jak1/kernel/gcommon.gc b/goal_src/jak1/kernel/gcommon.gc index 78a17ff6e0..a1a23bf596 100644 --- a/goal_src/jak1/kernel/gcommon.gc +++ b/goal_src/jak1/kernel/gcommon.gc @@ -67,6 +67,8 @@ ) ) +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Function versions of built-in forms ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -239,23 +241,23 @@ :flag-assert #x900000010 ) -(defmethod inspect vec4s ((obj vec4s)) - (format #t "[~8x] ~A~%" obj 'vec4s) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tw: ~f~%" (-> obj w)) - obj +(defmethod inspect vec4s ((this vec4s)) + (format #t "[~8x] ~A~%" this 'vec4s) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tw: ~f~%" (-> this w)) + this ) -(defmethod print vec4s ((obj vec4s)) +(defmethod print vec4s ((this vec4s)) (format #t "#" - (-> obj x) - (-> obj y) - (-> obj z) - (-> obj w) - obj) - obj + (-> this x) + (-> this y) + (-> this z) + (-> this w) + this) + this ) (defmacro print128 (value &key (stream #t)) @@ -286,31 +288,31 @@ :flag-assert #x900000008 ) -(defmethod print bfloat ((obj bfloat)) +(defmethod print bfloat ((this bfloat)) "Override the default print method to print a bfloat like a normal float" - (format #t "~f" (-> obj data)) - obj + (format #t "~f" (-> this data)) + this ) ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type System ;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod asize-of type ((obj type)) +(defmethod asize-of type ((this type)) "Get the size in memory of a type" ;; The 28 is 8 bytes too large. It's also strange that types have a 16-byte aligned size always, ;; but this matches what the runtime does as well. There's no reason that I can see for this, ;; as other basics don't require 16-byte aligned sizes. ;; - maybe the 16-byte aligned size was a requirement if types were stored in the symbol table? ;; - maybe types used to be a little bit larger, they made an effort to pack fields tightly. - (logand #xfffffff0 (+ 15 (* 4 (-> obj allocated-length)) 28)) + (logand #xfffffff0 (+ 15 (* 4 (-> this allocated-length)) 28)) ) -(defun basic-type? ((obj basic) (parent-type type)) - "Is obj of type parent-type? +(defun basic-type? ((this basic) (parent-type type)) + "Is this of type parent-type? Note: this will return #f if you put a parent-type of object. Only use this with types that are fully defined." - (let ((obj-type (-> obj type)) + (let ((obj-type (-> this type)) (end-type object) ) (until (= obj-type end-type) @@ -360,11 +362,11 @@ current-method ) -(defmacro as-type (obj type) +(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." - `(if (and (nonzero? ,obj) (type-type? (-> ,obj type) ,type)) - (the-as ,type ,obj) + `(if (and (nonzero? ,this) (type-type? (-> ,this type) ,type)) + (the-as ,type ,this) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -381,15 +383,15 @@ (car lst) ) -(defmethod length pair ((obj pair)) +(defmethod length pair ((this pair)) "Get the length of a proper list" (local-vars (result int)) (cond - ((null? obj) + ((null? this) (set! result 0) ) (else - (let ((iter (cdr obj))) + (let ((iter (cdr this))) (set! result 1) (while (and (not (null? iter)) (pair? iter)) (+! result 1) @@ -402,7 +404,7 @@ ) -(defmethod asize-of pair ((obj pair)) +(defmethod asize-of pair ((this pair)) "Get the size in memory of pair. Note: if you make a child type of pair, you must override this. (nobody does this?)" @@ -421,10 +423,10 @@ ) ) -(defun member ((obj object) (lst object)) - "Is obj in the list lst? Returns pair with obj as its car, or #f if not found." +(defun member ((this object) (lst object)) + "Is this in the list lst? Returns pair with this as its car, or #f if not found." (let ((iter lst)) - (while (not (or (null? iter) (= (car iter) obj))) + (while (not (or (null? iter) (= (car iter) this))) (set! iter (cdr iter)) ) (if (not (null? iter)) @@ -436,9 +438,9 @@ ;; need to forward declare this, we haven't loaded the string library yet. (define-extern name= (function basic basic symbol)) -(defun nmember ((obj basic) (lst object)) - "Is obj in the list lst? Check with the name= function." - (while (not (or (= lst '()) (name= (the-as basic (car lst)) obj))) +(defun nmember ((this basic) (lst object)) + "Is this in the list lst? Check with the name= function." + (while (not (or (= lst '()) (name= (the-as basic (car lst)) this))) (set! lst (cdr lst)) ) (if (!= lst '()) @@ -673,8 +675,8 @@ (defmethod new inline-array-class ((allocation symbol) (type-to-make type) (len int)) "Allocate a new inline-array-class object with room for the given number of objects. Both length and allocated-length are set to the given size" - (local-vars (obj inline-array-class)) - (set! obj + (local-vars (this inline-array-class)) + (set! this (object-new allocation type-to-make ;; size is the normal type's size + room for elements. (the-as int (+ (-> type-to-make size) @@ -684,26 +686,26 @@ ) ) ;; don't initialize if allocation failed. - (when (nonzero? obj) - (set! (-> obj length) len) - (set! (-> obj allocated-length) len) + (when (nonzero? this) + (set! (-> this length) len) + (set! (-> this allocated-length) len) ) - obj + this ) -(defmethod length inline-array-class ((obj inline-array-class)) +(defmethod length inline-array-class ((this inline-array-class)) "Get the length of the inline-array-class. This is the length field, not how much storage there is" - (-> obj length) + (-> this length) ) -(defmethod asize-of inline-array-class ((obj inline-array-class)) +(defmethod asize-of inline-array-class ((this inline-array-class)) "Get the size in memory of an inline-array-class." (the-as int - (+ (-> obj type size) - (the-as uint (* (-> obj allocated-length) - (the-as int (-> obj type heap-base))) + (+ (-> this type size) + (the-as uint (* (-> this allocated-length) + (the-as int (-> this type heap-base))) ) ) ) @@ -725,8 +727,8 @@ "Allocate a new array to hold len elements of type content-type. The content should either be a numeric type (child of number) or the content should be a reference (will get 4-bytes for a pointer)" - (local-vars (obj array)) - (set! obj (object-new + (local-vars (this array)) + (set! this (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) @@ -739,229 +741,229 @@ ) )) )) - (set! (-> obj allocated-length) len) - (set! (-> obj length) len) - (set! (-> obj content-type) content-type) - obj + (set! (-> this allocated-length) len) + (set! (-> this length) len) + (set! (-> this content-type) content-type) + this ) -(defmethod print array ((obj array)) +(defmethod print array ((this array)) "Print array." (format #t "#(") (cond - ((type-type? (-> obj content-type) integer) - (case (-> obj content-type symbol) + ((type-type? (-> this content-type) integer) + (case (-> this content-type symbol) (('int32) - (dotimes (s5-0 (-> obj length)) + (dotimes (s5-0 (-> this length)) (format #t (if (zero? s5-0) "~D" " ~D" ) - (-> (the-as (array int32) obj) s5-0) + (-> (the-as (array int32) this) s5-0) ) ) ) (('uint32) - (dotimes (s5-1 (-> obj length)) + (dotimes (s5-1 (-> this length)) (format #t (if (zero? s5-1) "~D" " ~D" ) - (-> (the-as (array uint32) obj) s5-1) + (-> (the-as (array uint32) this) s5-1) ) ) ) (('int64) - (dotimes (s5-2 (-> obj length)) + (dotimes (s5-2 (-> this length)) (format #t (if (zero? s5-2) "~D" " ~D" ) - (-> (the-as (array int64) obj) s5-2) + (-> (the-as (array int64) this) s5-2) ) ) ) (('uint64) - (dotimes (s5-3 (-> obj length)) + (dotimes (s5-3 (-> this length)) (format #t (if (zero? s5-3) "#x~X" " #x~X" ) - (-> (the-as (array uint64) obj) s5-3) + (-> (the-as (array uint64) this) s5-3) ) ) ) (('int8) - (dotimes (s5-4 (-> obj length)) + (dotimes (s5-4 (-> this length)) (format #t (if (zero? s5-4) "~D" " ~D" ) - (-> (the-as (array int8) obj) s5-4) + (-> (the-as (array int8) this) s5-4) ) ) ) (('uint8) - (dotimes (s5-5 (-> obj length)) + (dotimes (s5-5 (-> this length)) (format #t (if (zero? s5-5) "~D" " ~D" ) - (-> (the-as (array uint8) obj) s5-5) + (-> (the-as (array uint8) this) s5-5) ) ) ) (('int16) - (dotimes (s5-6 (-> obj length)) + (dotimes (s5-6 (-> this length)) (format #t (if (zero? s5-6) "~D" " ~D" ) - (-> (the-as (array int16) obj) s5-6) + (-> (the-as (array int16) this) s5-6) ) ) ) (('uint16) - (dotimes (s5-7 (-> obj length)) + (dotimes (s5-7 (-> this length)) (format #t (if (zero? s5-7) "~D" " ~D" ) - (-> (the-as (array uint16) obj) s5-7) + (-> (the-as (array uint16) this) s5-7) ) ) ) (('uint128 'int128) - (dotimes (s5-8 (-> obj length)) + (dotimes (s5-8 (-> this length)) (format #t (if (zero? s5-8) "#x~X" " #x~X" ) - (-> (the-as (array uint128) obj) s5-8) + (-> (the-as (array uint128) this) s5-8) ) ) ) (else - (dotimes (s5-9 (-> obj length)) + (dotimes (s5-9 (-> this length)) (format #t (if (zero? s5-9) "~D" " ~D" ) - (-> (the-as (array int32) obj) s5-9) + (-> (the-as (array int32) this) s5-9) ) ) ) ) ) - ((= (-> obj content-type) float) - (dotimes (s5-10 (-> obj length)) + ((= (-> this content-type) float) + (dotimes (s5-10 (-> this length)) (if (zero? s5-10) - (format #t "~f" (-> (the-as (array float) obj) s5-10)) - (format #t " ~f" (-> (the-as (array float) obj) s5-10)) + (format #t "~f" (-> (the-as (array float) this) s5-10)) + (format #t " ~f" (-> (the-as (array float) this) s5-10)) ) ) ) (else - (dotimes (s5-11 (-> obj length)) + (dotimes (s5-11 (-> this length)) (if (zero? s5-11) - (format #t "~A" (-> (the-as (array basic) obj) s5-11)) - (format #t " ~A" (-> (the-as (array basic) obj) s5-11)) + (format #t "~A" (-> (the-as (array basic) this) s5-11)) + (format #t " ~A" (-> (the-as (array basic) this) s5-11)) ) ) ) ) (format #t ")") - obj + this ) -(defmethod inspect array ((obj array)) +(defmethod inspect array ((this array)) "Inspect an array" - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tcontent-type: ~A~%" (-> obj content-type)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tcontent-type: ~A~%" (-> this content-type)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this allocated-length) (-> this data)) (cond - ((type-type? (-> obj content-type) integer) - (case (-> obj content-type symbol) + ((type-type? (-> this content-type) integer) + (case (-> this content-type symbol) (('int32) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-0 (-> (the-as (array int32) obj) s5-0)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~D~%" s5-0 (-> (the-as (array int32) this) s5-0)) ) ) (('uint32) - (dotimes (s5-1 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-1 (-> (the-as (array uint32) obj) s5-1)) + (dotimes (s5-1 (-> this length)) + (format #t "~T [~D] ~D~%" s5-1 (-> (the-as (array uint32) this) s5-1)) ) ) (('int64) - (dotimes (s5-2 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-2 (-> (the-as (array int64) obj) s5-2)) + (dotimes (s5-2 (-> this length)) + (format #t "~T [~D] ~D~%" s5-2 (-> (the-as (array int64) this) s5-2)) ) ) (('uint64) - (dotimes (s5-3 (-> obj length)) - (format #t "~T [~D] #x~X~%" s5-3 (-> (the-as (array uint64) obj) s5-3)) + (dotimes (s5-3 (-> this length)) + (format #t "~T [~D] #x~X~%" s5-3 (-> (the-as (array uint64) this) s5-3)) ) ) (('int8) - (dotimes (s5-4 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-4 (-> (the-as (array int8) obj) s5-4)) + (dotimes (s5-4 (-> this length)) + (format #t "~T [~D] ~D~%" s5-4 (-> (the-as (array int8) this) s5-4)) ) ) (('uint8) - (dotimes (s5-5 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-5 (-> (the-as (array int8) obj) s5-5)) + (dotimes (s5-5 (-> this length)) + (format #t "~T [~D] ~D~%" s5-5 (-> (the-as (array int8) this) s5-5)) ) ) (('int16) - (dotimes (s5-6 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-6 (-> (the-as (array int16) obj) s5-6)) + (dotimes (s5-6 (-> this length)) + (format #t "~T [~D] ~D~%" s5-6 (-> (the-as (array int16) this) s5-6)) ) ) (('uint16) - (dotimes (s5-7 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-7 (-> (the-as (array uint16) obj) s5-7)) + (dotimes (s5-7 (-> this length)) + (format #t "~T [~D] ~D~%" s5-7 (-> (the-as (array uint16) this) s5-7)) ) ) (('int128 'uint128) - (dotimes (s5-8 (-> obj length)) - (format #t "~T [~D] #x~X~%" s5-8 (-> (the-as (array uint128) obj) s5-8)) + (dotimes (s5-8 (-> this length)) + (format #t "~T [~D] #x~X~%" s5-8 (-> (the-as (array uint128) this) s5-8)) ) ) (else - (dotimes (s5-9 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-9 (-> (the-as (array int32) obj) s5-9)) + (dotimes (s5-9 (-> this length)) + (format #t "~T [~D] ~D~%" s5-9 (-> (the-as (array int32) this) s5-9)) ) ) ) ) - ((= (-> obj content-type) float) - (dotimes (s5-10 (-> obj length)) - (format #t "~T [~D] ~f~%" s5-10 (-> (the-as (array float) obj) s5-10)) + ((= (-> this content-type) float) + (dotimes (s5-10 (-> this length)) + (format #t "~T [~D] ~f~%" s5-10 (-> (the-as (array float) this) s5-10)) ) ) (else - (dotimes (s5-11 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-11 (-> (the-as (array basic) obj) s5-11)) + (dotimes (s5-11 (-> this length)) + (format #t "~T [~D] ~A~%" s5-11 (-> (the-as (array basic) this) s5-11)) ) ) ) - obj + this ) -(defmethod length array ((obj array)) +(defmethod length array ((this array)) "Get the length of an array" - (-> obj length) + (-> this length) ) -(defmethod asize-of array ((obj array)) +(defmethod asize-of array ((this array)) "Get the size in memory of an array" (the-as int (+ (-> array size) - (* (-> obj allocated-length) - (if (type-type? (-> obj content-type) number) - (-> obj content-type size) + (* (-> this allocated-length) + (if (type-type? (-> this content-type) number) + (-> this content-type size) 4 ) ) @@ -1089,15 +1091,15 @@ ((method-of-type (rtype-of arg0) print) arg0) ) -(defmacro printl (obj) +(defmacro printl (this) "Print out a boxed object and a newline. Note: we define both a macro and a function on purpose. The compiler will use the macro over the function, which will allow it to pick the correct print method for non-boxed objects" `(begin - (print ,obj) + (print ,this) (format #t "~%") - ,obj + ,this ) ) @@ -1175,7 +1177,7 @@ ;; recursive, so needs to be forward declared with return type. (define-extern valid? (function object type basic basic object symbol)) -(defun valid? ((obj object) +(defun valid? ((this object) (expected-type type) (name basic) (allow-false basic) @@ -1200,25 +1202,25 @@ ;; first, check if we are even in valid memory. This is the start of the symbol table to the end of RAM. ;; (note, this will fail stuff like the debug and global heap info objects, which aren't in GOAL heaps.) - (set! in-goal-mem (and (>= (the-as uint obj) (start-of-symbol-table)) - (< (the-as uint obj) END_OF_MEMORY) + (set! in-goal-mem (and (>= (the-as uint this) (start-of-symbol-table)) + (< (the-as uint this) END_OF_MEMORY) ) ) (cond ((not expected-type) ;; we didn't get an expected type, just check the alignment and address. (cond - ((nonzero? (logand (the-as int obj) 3)) + ((nonzero? (logand (the-as int this) 3)) ;; alignment is bad! (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object (misaligned)~%" obj name) + (format print-dest "ERROR: object #x~X ~S is not a valid object (misaligned)~%" this name) ) '#f ) ((not in-goal-mem) ;; address isn't within the memory we expect. (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object (bad address)~%" obj name) + (format print-dest "ERROR: object #x~X ~S is not a valid object (bad address)~%" this name) ) '#f ) @@ -1226,7 +1228,7 @@ (else '#t) ) ) ;; end (not expected-type) check - ((and allow-false (not obj)) + ((and allow-false (not this)) ;; we got a false, but its allowed! ;; note that we don't reject falses otherwise, as false is a perfectly valid symbol. #t) @@ -1235,16 +1237,16 @@ ((= expected-type structure) ;; no runtime type info, check alignment (16-bytes for a heap allocated or non-packed structure) (cond - ((nonzero? (logand (the-as int obj) 15)) + ((nonzero? (logand (the-as int this) 15)) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type) ) '#f ) - ((or (not in-goal-mem) (< (the-as uint obj) (end-of-symbol-table))) + ((or (not in-goal-mem) (< (the-as uint this) (end-of-symbol-table))) ;; structures should never be in the symbol table, they have a slightly stricter allowed memory range. (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" this name expected-type) ) '#f ) @@ -1254,16 +1256,16 @@ ((= expected-type pair) ;; pair alignment is 8 bytes + 2. (cond - ((!= (logand (the-as int obj) 7) PAIR_OFFSET) + ((!= (logand (the-as int this) 7) PAIR_OFFSET) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type) ) '#f ) ((not in-goal-mem) ;; the empty pair is in the symbol table, so we allow anything in GOAL memory. (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" this name expected-type) ) '#f ) @@ -1274,35 +1276,35 @@ ((= expected-type binteger) (cond ;; binteger has 0 in the lower 3 bits. - ((zero? (logand (the-as int obj) 7)) + ((zero? (logand (the-as int this) 7)) '#t) (else (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type) ) '#f ) ) ) ;; now we assume desired type is a basic. - ((!= (logand (the-as int obj) 7) BASIC_OFFSET) + ((!= (logand (the-as int this) 7) BASIC_OFFSET) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type) ) '#f ) ;; basics can be in the symbol table (basics are symbols...) ((not in-goal-mem) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" this name expected-type) ) '#f ) - ((and (= expected-type type) (!= (rtype-of obj) type)) + ((and (= expected-type type) (!= (rtype-of this) type)) ;; special case for type, check the runtime type of the object and be done. (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (invalid type #x~X)~%" - obj name expected-type (rtype-of obj) + this name expected-type (rtype-of this) ) ) '#f @@ -1314,21 +1316,21 @@ (cond ((and (!= expected-type type) - (not (valid? (rtype-of obj) type '#f '#t 0)) + (not (valid? (rtype-of this) type '#f '#t 0)) ) (if name ;; note: print the invalid type as an address in case it's unprintable. (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (invalid type #x~X)~%" - obj name expected-type (rtype-of obj) + this name expected-type (rtype-of this) ) ) '#f ) - ((not (type-type? (rtype-of obj) expected-type)) + ((not (type-type? (rtype-of this) expected-type)) ;; type check failed. (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (is type '~A' instead)~%" - obj name expected-type (rtype-of obj) + this name expected-type (rtype-of this) ) ) '#f @@ -1336,9 +1338,9 @@ ((= expected-type symbol) ;; got a symbol, expecting to be in the symbol table. (cond - ((>= (the-as uint obj) (end-of-symbol-table)) + ((>= (the-as uint this) (end-of-symbol-table)) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (not in symbol table)~%" - obj name expected-type + this name expected-type ) ) '#f @@ -1347,10 +1349,10 @@ ) ) ;; not a symbol, so expecting to be outside st. - ((< (the-as uint obj) (end-of-symbol-table)) + ((< (the-as uint this) (end-of-symbol-table)) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (inside symbol table)~%" - obj name expected-type + this name expected-type ) ) '#f diff --git a/goal_src/jak1/kernel/gkernel-h.gc b/goal_src/jak1/kernel/gkernel-h.gc index 72c3782d9f..8ed5313762 100644 --- a/goal_src/jak1/kernel/gkernel-h.gc +++ b/goal_src/jak1/kernel/gkernel-h.gc @@ -129,6 +129,8 @@ `(format 0 ,@args) ) +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; TYPES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -422,11 +424,11 @@ :flag-assert #x900000008 ) -(defmethod inspect handle ((obj handle)) +(defmethod inspect handle ((this handle)) (format #t "[~8x] ~A~%" 'handle) - (format #t "~Tprocess: #x~x~%" (-> obj process)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - obj + (format #t "~Tprocess: #x~x~%" (-> this process)) + (format #t "~Tpid: ~D~%" (-> this pid)) + this ) @@ -472,16 +474,16 @@ `(ppointer->handle (process->ppointer ,proc)) ) -(defmethod print handle ((obj handle)) +(defmethod print handle ((this handle)) "print a handle" - (if (nonzero? (-> obj u64)) ;; zero-initialized handles can't be derefenced safely. + (if (nonzero? (-> this u64)) ;; zero-initialized handles can't be derefenced safely. (format #t "#" - (handle->process obj) ;; actually print the process stored - (-> obj pid) + (handle->process this) ;; actually print the process stored + (-> this pid) ) (format #t "#") ) - obj + this ) ;; A "state" is a collection of 6 functions that describe what code a process should run. diff --git a/goal_src/jak1/kernel/gkernel.gc b/goal_src/jak1/kernel/gkernel.gc index eb57a08552..64d7387464 100644 --- a/goal_src/jak1/kernel/gkernel.gc +++ b/goal_src/jak1/kernel/gkernel.gc @@ -17,6 +17,8 @@ ;; Fwd (define-extern change-parent (function process-tree process-tree process-tree)) +;; DECOMP BEGINS + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; System Globals ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -179,23 +181,23 @@ ;; All threads are actually cpu-threads. It's not clear why there are two separate types. ;; Perhaps the thread was the public interface and cpu-thread is internal to the kernel? -(defmethod delete thread ((obj thread)) +(defmethod delete thread ((this thread)) "Clean up a temporary thread after it is done being used. This assumes it's the top-thread of the process and restores the previous top thread." - (when (eq? obj (-> obj process main-thread)) + (when (eq? this (-> this process main-thread)) ;; We have attempted to delete the main thread, which is bad. (break) ) ;; restore the old top-thread. - (set! (-> obj process top-thread) (-> obj previous)) + (set! (-> this process top-thread) (-> this previous)) (none) ) -(defmethod print thread ((obj thread)) +(defmethod print thread ((this thread)) "Print thread." - (format #t "#<~A ~S of ~S pc: #x~X @ #x~X>" (-> obj type) (-> obj name) (-> obj process name) (-> obj pc) obj) - obj) + (format #t "#<~A ~S of ~S pc: #x~X @ #x~X>" (-> this type) (-> this name) (-> this process name) (-> this pc) this) + this) (defmethod stack-size-set! thread ((this thread) (stack-size int)) "Set the backup stack size of a thread. This should only be done on the main-thread. @@ -237,7 +239,7 @@ The stack-size is for the backup stack (applicable for main thread only)" ;; first, let's see if we're doing the main or temp thread - (let* ((obj (cond + (let* ((this (cond ((-> parent-process top-thread) ;; we're allocating a temporary thread, the main thread already exists. ;; we can stash the cpu-thread structure at the bottom of the stack. @@ -256,35 +258,35 @@ ))) ;; set up the type manually, as we allocated the memory manually - (set! (-> obj type) type-to-make) + (set! (-> this type) type-to-make) ;; set up thread - (set! (-> obj name) name) - (set! (-> obj process) parent-process) + (set! (-> this name) name) + (set! (-> this process) parent-process) ;; start stack at the top - (set! (-> obj sp) stack-top) - (set! (-> obj stack-top) stack-top) + (set! (-> this sp) stack-top) + (set! (-> this stack-top) stack-top) ;; remember the previous thread, in case we're a temp thread - (set! (-> obj previous) (-> parent-process top-thread)) + (set! (-> this previous) (-> parent-process top-thread)) ;; and make us the top! - (set! (-> parent-process top-thread) obj) + (set! (-> parent-process top-thread) this) ;; set up our suspend/resume hooks. By default just use the thread's methods. ;; but something else could install a different hook if needed. - (set! (-> obj suspend-hook) (method-of-object obj thread-suspend)) - (set! (-> obj resume-hook) (method-of-object obj thread-resume)) + (set! (-> this suspend-hook) (method-of-object this thread-suspend)) + (set! (-> this resume-hook) (method-of-object this thread-resume)) ;; remember how much space we have for the backup stack. - (set! (-> obj stack-size) stack-size) - obj + (set! (-> this stack-size) stack-size) + this ) ) -(defmethod asize-of cpu-thread ((obj cpu-thread)) +(defmethod asize-of cpu-thread ((this cpu-thread)) "Get the size of a cpu-thread" ;; we need this because the cpu-thread is stored in the process stack - (the int (+ (-> obj type size) (-> obj stack-size))) + (the int (+ (-> this type size) (-> this stack-size))) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -319,53 +321,53 @@ (defmethod new process-tree ((allocation symbol) (type-to-make type) (name basic)) "Create a process-tree node" ;; allocate - (let ((obj (object-new allocation type-to-make))) - (set! (-> obj name) name) - (set! (-> obj mask) (process-mask process-tree)) - (set! (-> obj parent) #f) - (set! (-> obj brother) #f) - (set! (-> obj child) #f) + (let ((this (object-new allocation type-to-make))) + (set! (-> this name) name) + (set! (-> this mask) (process-mask process-tree)) + (set! (-> this parent) #f) + (set! (-> this brother) #f) + (set! (-> this child) #f) - (set! (-> obj self) obj) - (set! (-> obj ppointer) (the (pointer process) (&-> obj self))) - obj + (set! (-> this self) this) + (set! (-> this ppointer) (the (pointer process) (&-> this self))) + this ) ) -(defmethod inspect process-tree ((obj process-tree)) +(defmethod inspect process-tree ((this process-tree)) "Inspect a process-tree node." - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~S~%" (-> obj name)) - (format #t "~Tmask: #x~X~%" (-> obj mask)) - (format #t "~Tparent: ~A~%" (ppointer->process (-> obj parent))) - (format #t "~Tbrother: ~A~%" (ppointer->process (-> obj brother))) - (format #t "~Tchild: ~A~%" (ppointer->process (-> obj child))) - obj + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~S~%" (-> this name)) + (format #t "~Tmask: #x~X~%" (-> this mask)) + (format #t "~Tparent: ~A~%" (ppointer->process (-> this parent))) + (format #t "~Tbrother: ~A~%" (ppointer->process (-> this brother))) + (format #t "~Tchild: ~A~%" (ppointer->process (-> this child))) + this ) (defmethod new process ((allocation symbol) (type-to-make type) (name basic) (stack-size int)) "Allocate a new process. The process stack is initially set to the entire process memory." - (let ((obj (if (eq? (-> allocation type) symbol) + (let ((this (if (eq? (-> allocation type) symbol) (object-new allocation type-to-make (the int (+ (-> process size) stack-size))) ;; symbol, allocate on heap (the process (&+ allocation *gtype-basic-offset*))))) ;; treat as address. ;; initialize - (set! (-> obj name) name) - (set! (-> obj status) 'dead) - (set! (-> obj pid) 0) - (set! (-> obj pool) #f) - (set! (-> obj allocated-length) stack-size) - (set! (-> obj top-thread) #f) - (set! (-> obj main-thread) #f) + (set! (-> this name) name) + (set! (-> this status) 'dead) + (set! (-> this pid) 0) + (set! (-> this pool) #f) + (set! (-> this allocated-length) stack-size) + (set! (-> this top-thread) #f) + (set! (-> this main-thread) #f) ;; set up the heap to start at the stack - (set! (-> obj heap-cur) (-> obj stack)) - (set! (-> obj heap-base) (-> obj stack)) + (set! (-> this heap-cur) (-> this stack)) + (set! (-> this heap-base) (-> this stack)) ;; and end at the end of the stack. - (set! (-> obj heap-top) (&-> (-> obj stack) (-> obj allocated-length))) + (set! (-> this heap-top) (&-> (-> this stack) (-> this allocated-length))) ;;;;;;;;;;;;;;;;;;;;;;;;; ;; heap top-base bug ;;;;;;;;;;;;;;;;;;;;;;;;; @@ -375,33 +377,33 @@ ;; general, but not to process heaps. ;; setup state stuff - (set! (-> obj stack-frame-top) #f) - (set! (-> obj state) #f) - (set! (-> obj next-state) #f) - (set! (-> obj entity) #f) + (set! (-> this stack-frame-top) #f) + (set! (-> this state) #f) + (set! (-> this next-state) #f) + (set! (-> this entity) #f) ;; setup handlers - (set! (-> obj trans-hook) #f) - (set! (-> obj post-hook) #f) - (set! (-> obj event-hook) #f) + (set! (-> this trans-hook) #f) + (set! (-> this post-hook) #f) + (set! (-> this event-hook) #f) ;; setup process tree - (set! (-> obj parent) #f) - (set! (-> obj brother) #f) - (set! (-> obj child) #f) + (set! (-> this parent) #f) + (set! (-> this brother) #f) + (set! (-> this child) #f) ;; setup reference stuff. - (set! (-> obj self) obj) - (set! (-> obj ppointer) (the (pointer process) (&-> obj self))) - obj + (set! (-> this self) this) + (set! (-> this ppointer) (the (pointer process) (&-> this self))) + this ) ) -(defun inspect-process-heap ((obj process)) +(defun inspect-process-heap ((this process)) "Inspect the heap of a process." - (let ((ptr (&+ (-> obj heap-base) *gtype-basic-offset*))) ; point to first basic + (let ((ptr (&+ (-> this heap-base) *gtype-basic-offset*))) ; point to first basic ;; loop over objects - (while (< (the int ptr) (the int (-> obj heap-cur))) + (while (< (the int ptr) (the int (-> this heap-cur))) ;; inspect the object (inspect (the basic ptr)) ;; seek to the next object on the heap. @@ -410,60 +412,60 @@ ) ) -(defmethod inspect process ((obj process)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~S~%" (-> obj name)) - (format #t "~Tmask: #x~X~%" (-> obj mask)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tparent: ~A~%" (ppointer->process (-> obj parent))) - (format #t "~Tbrother: ~A~%" (ppointer->process (-> obj brother))) - (format #t "~Tchild: ~A~%" (ppointer->process (-> obj child))) - (format #t "~Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) +(defmethod inspect process ((this process)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~S~%" (-> this name)) + (format #t "~Tmask: #x~X~%" (-> this mask)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tparent: ~A~%" (ppointer->process (-> this parent))) + (format #t "~Tbrother: ~A~%" (ppointer->process (-> this brother))) + (format #t "~Tchild: ~A~%" (ppointer->process (-> this child))) + (format #t "~Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) ;; print all objects on the process heap (protect (*print-column*) (+! *print-column* *tab-size*) (format #t "----~%") - (inspect-process-heap obj) + (inspect-process-heap this) (format #t "----~%") ) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tstack[~D] @ #x~X~%" (-> obj allocated-length) (-> obj stack)) - obj + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tstack[~D] @ #x~X~%" (-> this allocated-length) (-> this stack)) + this ) -(defmethod asize-of process ((obj process)) - (the int (+ (-> process size) (-> obj allocated-length))) +(defmethod asize-of process ((this process)) + (the int (+ (-> process size) (-> this allocated-length))) ) -(defmethod print process ((obj process)) +(defmethod print process ((this process)) (format #t "#<~A ~S ~A :state ~S " - (-> obj type) - (-> obj name) - (-> obj status) - (when (-> obj state) (-> obj state name))) + (-> this type) + (-> this name) + (-> this status) + (when (-> this state) (-> this state name))) (format #t ":stack ~D/~D :heap ~D/~D @ #x~X>" - (process-stack-used obj) - (process-stack-size obj) - (process-heap-used obj) - (process-heap-size obj) - obj + (process-stack-used this) + (process-stack-size this) + (process-heap-used this) + (process-heap-size this) + this ) - obj + this ) @@ -566,7 +568,7 @@ ) ) -(defun reset-and-call ((obj thread) (func function)) +(defun reset-and-call ((this thread) (func function)) "Make the given thread the top thread, reset the stack, and call the function. Sets up a return trampoline so when the function returns it will return to the kernel context. Will NOT deactivate on return, so this is intended for temporary threads. @@ -587,10 +589,10 @@ ) ;; set up the process pointer - (set! pp (-> obj process)) + (set! pp (-> this process)) ;; mark the process as running and set its top thread (set! (-> pp status) 'running) - (set! (-> pp top-thread) obj) + (set! (-> pp top-thread) this) ;; save the current kernel regs (.push :color #f s0) @@ -605,7 +607,7 @@ (set! *kernel-sp* (the pointer sp)) ;; todo, asm form here? ;; setup the rsp for the new thread - (set! sp (the uint (-> obj stack-top))) + (set! sp (the uint (-> this stack-top))) (.add sp off) ;; push the return trampoline to the stack for the user code to return to @@ -633,7 +635,7 @@ ;; we begin this function with the thread object in pp. ;; not sure why we do this, maybe at one point suspending didn't clobber ;; temp registers? - (rlet ((obj :reg r13 :type cpu-thread) + (rlet ((this :reg r13 :type cpu-thread) (temp :reg rax :type uint) (off :reg r15 :type uint) (sp :reg rsp :type uint) @@ -658,48 +660,48 @@ ;; convert to a GOAL address (.sub temp off) ;; store return address in thread - (set! (-> obj pc) (the pointer temp)) + (set! (-> this pc) (the pointer temp)) ;; convert our stack pointer to a GOAL address (.sub sp off) ;; store in thread. - (set! (-> obj sp) (the pointer sp)) + (set! (-> this sp) (the pointer sp)) ;; back up registers (.mov :color #f temp s0) - (set! (-> obj rreg 0) temp) + (set! (-> this rreg 0) temp) (.mov :color #f temp s1) - (set! (-> obj rreg 1) temp) + (set! (-> this rreg 1) temp) (.mov :color #f temp s2) - (set! (-> obj rreg 2) temp) + (set! (-> this rreg 2) temp) (.mov :color #f temp s3) - (set! (-> obj rreg 3) temp) + (set! (-> this rreg 3) temp) (.mov :color #f temp s4) - (set! (-> obj rreg 4) temp) + (set! (-> this rreg 4) temp) ;; back up fprs (.mov :color #f temp xmm8) - (set! (-> obj freg 0) (the-as float temp)) + (set! (-> this freg 0) (the-as float temp)) (.mov :color #f temp xmm9) - (set! (-> obj freg 1) (the-as float temp)) + (set! (-> this freg 1) (the-as float temp)) (.mov :color #f temp xmm10) - (set! (-> obj freg 2) (the-as float temp)) + (set! (-> this freg 2) (the-as float temp)) (.mov :color #f temp xmm11) - (set! (-> obj freg 3) (the-as float temp)) + (set! (-> this freg 3) (the-as float temp)) (.mov :color #f temp xmm12) - (set! (-> obj freg 4) (the-as float temp)) + (set! (-> this freg 4) (the-as float temp)) (.mov :color #f temp xmm13) - (set! (-> obj freg 5) (the-as float temp)) + (set! (-> this freg 5) (the-as float temp)) (.mov :color #f temp xmm14) - (set! (-> obj freg 6) (the-as float temp)) + (set! (-> this freg 6) (the-as float temp)) (.mov :color #f temp xmm15) - (set! (-> obj freg 7) (the-as float temp)) + (set! (-> this freg 7) (the-as float temp)) ;; get our process - (let ((proc (-> obj process))) - (when (> (process-stack-used proc) (-> obj stack-size)) + (let ((proc (-> this process))) + (when (> (process-stack-used proc) (-> this stack-size)) (break) ;; too much stack has been used and we can't suspend! ;; if you hit this, try with DEBUG_PRINT_SUSPEND_FAIL set to #t (see gkernel-h.gc) ;; it will print more info before reaching here. @@ -707,8 +709,8 @@ ;; mark the process as suspended and copy the stack (set! (-> proc status) 'suspended) - (let ((cur (the (pointer uint64) (-> obj stack-top))) - (save (&+ (the (pointer uint64) (-> obj stack)) (-> obj stack-size))) + (let ((cur (the (pointer uint64) (-> this stack-top))) + (save (&+ (the (pointer uint64) (-> this stack)) (-> this stack-size))) ) (while (> (the int cur) (the int sp)) (set! cur (the (pointer uint64) (&- cur 8))) @@ -719,7 +721,7 @@ ) ;; actually setting pp to 0 - (set! obj (the cpu-thread 0)) + (set! this (the cpu-thread 0)) ;; get the kernel stack pointer as a GOAL pointer (.load-sym :sext #f sp *kernel-sp*) @@ -748,7 +750,7 @@ ;;(print-asm) ) - (rlet ((obj :reg r13 :type cpu-thread) + (rlet ((this :reg r13 :type cpu-thread) (temp :reg rax :type uint) (off :reg r15 :type uint) (sp :reg rsp :type uint) @@ -784,14 +786,14 @@ (set! *kernel-sp* (the pointer sp)) ;; todo, asm form here? ;; temp, stash thread in process-pointer - (set! obj thread-to-resume) + (set! this thread-to-resume) ;; set stack pointer for the thread. leave it as a GOAL pointer for now.. - (set! sp (the uint (-> obj sp))) + (set! sp (the uint (-> this sp))) ;; restore the stack (sp is a GOAL pointer) - (let ((cur (the (pointer uint64) (-> obj stack-top))) - (restore (&+ (the (pointer uint64) (-> obj stack)) (-> obj stack-size))) + (let ((cur (the (pointer uint64) (-> this stack-top))) + (restore (&+ (the (pointer uint64) (-> this stack)) (-> this stack-size))) ) (while (> (the int cur) (the int sp)) (set! cur (the (pointer uint64) (&- cur 8))) @@ -804,35 +806,35 @@ (.add sp off) ;; setup process - (set! (-> (-> obj process) top-thread) obj) - (set! (-> (-> obj process) status) 'running) + (set! (-> (-> this process) top-thread) this) + (set! (-> (-> this process) status) 'running) ;; restore reg - (set! temp (-> obj rreg 0)) + (set! temp (-> this rreg 0)) (.mov :color #f s0 temp) - (set! temp (-> obj rreg 1)) + (set! temp (-> this rreg 1)) (.mov :color #f s1 temp) - (set! temp (-> obj rreg 2)) + (set! temp (-> this rreg 2)) (.mov :color #f s2 temp) - (set! temp (-> obj rreg 3)) + (set! temp (-> this rreg 3)) (.mov :color #f s3 temp) - (set! temp (-> obj rreg 4)) + (set! temp (-> this rreg 4)) (.mov :color #f s4 temp) - (set! temp-float (-> obj freg 0)) + (set! temp-float (-> this freg 0)) (.mov :color #f xmm8 temp-float) - (set! temp-float (-> obj freg 1)) + (set! temp-float (-> this freg 1)) (.mov :color #f xmm9 temp-float) - (set! temp-float (-> obj freg 2)) + (set! temp-float (-> this freg 2)) (.mov :color #f xmm10 temp-float) - (set! temp-float (-> obj freg 3)) + (set! temp-float (-> this freg 3)) (.mov :color #f xmm11 temp-float) - (set! temp-float (-> obj freg 4)) + (set! temp-float (-> this freg 4)) (.mov :color #f xmm12 temp-float) - (set! temp-float (-> obj freg 5)) + (set! temp-float (-> this freg 5)) (.mov :color #f xmm13 temp-float) - (set! temp-float (-> obj freg 6)) + (set! temp-float (-> this freg 6)) (.mov :color #f xmm14 temp-float) - (set! temp-float (-> obj freg 7)) + (set! temp-float (-> this freg 7)) (.mov :color #f xmm15 temp-float) ;; hack for set-to-run-bootstrap. The set-to-run-bootstrap in MIPS @@ -845,17 +847,17 @@ ;; so we load the a4/a5 argument registers with rreg 5 and rreg 6 ;; In the case where we are doing a normal resume, the ;; compiler should assume that these registers are overwritten anyway. - (set! temp (-> obj rreg 5)) + (set! temp (-> this rreg 5)) (.mov a4 temp) - (set! temp (-> obj rreg 6)) + (set! temp (-> this rreg 6)) (.mov a5 temp) ;; get the resume address - (set! temp (the uint (-> obj pc))) + (set! temp (the uint (-> this pc))) (.add temp off) ;; setup the process - (set! obj (the cpu-thread (-> obj process))) + (set! this (the cpu-thread (-> this process))) ;; resume! (.jr temp) (.add a4 a4) @@ -876,43 +878,43 @@ (defmethod new dead-pool ((allocation symbol) (type-to-make type) (count int) (stack-size int) (name basic)) "Create a pool of count dead processes, each with a fixed size stack-size" - (let ((obj (object-new allocation type-to-make))) + (let ((this (object-new allocation type-to-make))) ;; setup process naming - (set! (-> obj name) name) - (set! (-> obj mask) (process-mask process-tree)) + (set! (-> this name) name) + (set! (-> this mask) (process-mask process-tree)) ;; setup process tree - (set! (-> obj parent) #f) - (set! (-> obj brother) #f) - (set! (-> obj child) #f) + (set! (-> this parent) #f) + (set! (-> this brother) #f) + (set! (-> this child) #f) ;; setup ref - (set! (-> obj self) obj) - (set! (-> obj ppointer) (the (pointer process) (&-> obj self))) + (set! (-> this self) this) + (set! (-> this ppointer) (the (pointer process) (&-> this self))) (dotimes (i count) ;; create each process - (let ((old-bro (-> obj child)) + (let ((old-bro (-> this child)) (next ((method-of-type process new) allocation process 'dead stack-size))) - (set! (-> obj child) (process->ppointer next)) - (set! (-> next parent) (process->ppointer obj)) - (set! (-> next pool) obj) + (set! (-> this child) (process->ppointer next)) + (set! (-> next parent) (process->ppointer this)) + (set! (-> next pool) this) (set! (-> next brother) old-bro) ) ) - obj + this ) ) -(defmethod get-process dead-pool ((obj dead-pool) (type-to-make type) (stack-size int)) +(defmethod get-process dead-pool ((this dead-pool) (type-to-make type) (stack-size int)) "Get a process from this dead pool of the given type." - (let ((proc (-> obj child))) + (let ((proc (-> this child))) - (when (and (not proc) *debug-segment* (neq? obj *debug-dead-pool*)) + (when (and (not proc) *debug-segment* (neq? this *debug-dead-pool*)) ;; we failed, but we're in debug mode and not looking at the debug pool ;; try again from the debug pool and warn if this works (set! proc (the (pointer process-tree) (get-process *debug-dead-pool* type-to-make stack-size))) (when proc (format 0 "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%" - type-to-make (ppointer->process proc) (-> obj name)) + type-to-make (ppointer->process proc) (-> this name)) ) ;; there's a bug here. proc is a process here, but will be used as a process pointer. ;; let's just kill the program here. @@ -928,7 +930,7 @@ ) (else (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" - type-to-make (ppointer->process proc) (-> obj name)) + type-to-make (ppointer->process proc) (-> this name)) (the process #f) ) ) @@ -936,9 +938,9 @@ ) -(defmethod return-process dead-pool ((obj dead-pool) (proc process)) +(defmethod return-process dead-pool ((this dead-pool) (proc process)) "Return a process to its pool once you are done with it." - (change-parent proc obj) + (change-parent proc this) (none) ) @@ -959,50 +961,50 @@ (defmethod new dead-pool-heap ((allocation symbol) (type-to-make type) (name basic) (allocated-length int) (heap-size int)) "Create a new dead pool heap. It will support allocated-length processes and have a total heap size of heap-size" - (let ((obj (object-new allocation type-to-make (+ (the int (-> type-to-make size)) + (let ((this (object-new allocation type-to-make (+ (the int (-> type-to-make size)) (the int (align16 (* allocated-length 12))) heap-size)))) - (set! (-> obj name) name) - (set! (-> obj mask) (process-mask process-tree)) - (set! (-> obj allocated-length) allocated-length) - (set! (-> obj parent) #f) - (set! (-> obj brother) #f) - (set! (-> obj child) #f) + (set! (-> this name) name) + (set! (-> this mask) (process-mask process-tree)) + (set! (-> this allocated-length) allocated-length) + (set! (-> this parent) #f) + (set! (-> this brother) #f) + (set! (-> this child) #f) - (set! (-> obj self) obj) - (set! (-> obj ppointer) (the (pointer process) (&-> obj self))) + (set! (-> this self) this) + (set! (-> this ppointer) (the (pointer process) (&-> this self))) ;; initialize each process handle ;; build them into a linked list of null-process (countdown (i allocated-length) - (let ((rec (-> obj process-list i))) + (let ((rec (-> this process-list i))) (set! (-> rec process) *null-process*) - (set! (-> rec next) (-> obj process-list (+ i 1))) + (set! (-> rec next) (-> this process-list (+ i 1))) ) ) ;; set up the dead-list - (set! (-> obj dead-list next) (-> obj process-list 0)) - (set! (-> obj alive-list process) #f) ;; likely typo here, should be dead-list - (set! (-> obj process-list (- allocated-length 1) next) #f) + (set! (-> this dead-list next) (-> this process-list 0)) + (set! (-> this alive-list process) #f) ;; likely typo here, should be dead-list + (set! (-> this process-list (- allocated-length 1) next) #f) ;; nothing is alive - (set! (-> obj last) (-> obj alive-list)) - (set! (-> obj alive-list next) #f) - (set! (-> obj alive-list process) #f) - (set! (-> obj first-gap) (-> obj alive-list)) - (set! (-> obj first-shrink) #f) + (set! (-> this last) (-> this alive-list)) + (set! (-> this alive-list next) #f) + (set! (-> this alive-list process) #f) + (set! (-> this first-gap) (-> this alive-list)) + (set! (-> this first-shrink) #f) ;; setup the heap. It just begins after the process records. - (set! (-> obj heap base) (the pointer (align16 (-> obj process-list allocated-length)))) - (set! (-> obj heap current) (-> obj heap base)) - (set! (-> obj heap top) (&+ (-> obj heap base) heap-size)) - (set! (-> obj heap top-base) (-> obj heap top)) - obj + (set! (-> this heap base) (the pointer (align16 (-> this process-list allocated-length)))) + (set! (-> this heap current) (-> this heap base)) + (set! (-> this heap top) (&+ (-> this heap base) heap-size)) + (set! (-> this heap top-base) (-> this heap top)) + this ) ) -(defmethod gap-location dead-pool-heap ((obj dead-pool-heap) (rec dead-pool-heap-rec)) +(defmethod gap-location dead-pool-heap ((this dead-pool-heap) (rec dead-pool-heap-rec)) "Get the gap after the given process. If root of the alive list is given, will give the first gap between the heap and the first process. If there is no gap, may point to the next process. Not 16-byte aligned." @@ -1012,12 +1014,12 @@ ;; start of proc end of type data process's heap basic offset ) (else - (-> obj heap base) + (-> this heap base) ) ) ) -(defmethod gap-size dead-pool-heap ((obj dead-pool-heap) (rec dead-pool-heap-rec)) +(defmethod gap-size dead-pool-heap ((this dead-pool-heap) (rec dead-pool-heap-rec)) "Determine the size between the given process and the next process or end of the heap. If you give the first rec, it will given the gap between the beginning of the heap and the next process." (the int @@ -1029,23 +1031,23 @@ ;; if there's a next process, look at the difference to the next (basic offsets cancel) (&- (-> rec next process) my-end) ;; no next process, look at the top of the heap. - (&- (-> obj heap top) (&+ my-end *gtype-basic-offset*)) + (&- (-> this heap top) (&+ my-end *gtype-basic-offset*)) ) ) ) (else (if (-> rec next) - (&- (-> rec next process) (&+ (-> obj heap base) *gtype-basic-offset*)) - (&- (-> obj heap top) (-> obj heap base))) + (&- (-> rec next process) (&+ (-> this heap base) *gtype-basic-offset*)) + (&- (-> this heap top) (-> this heap base))) ) ) ) ) -(defmethod find-gap dead-pool-heap ((obj dead-pool-heap) (rec dead-pool-heap-rec)) +(defmethod find-gap dead-pool-heap ((this dead-pool-heap) (rec dead-pool-heap-rec)) "Start at the given record and find the closest gap after it. Returns the rec which has the gap after it. If no gaps, returns the last rec." - (while (and (-> rec next) (zero? (gap-size obj rec))) + (while (and (-> rec next) (zero? (gap-size this rec))) ; no gap here! (set! rec (-> rec next)) ) @@ -1053,96 +1055,96 @@ ) -(defmethod inspect dead-pool-heap ((obj dead-pool-heap)) +(defmethod inspect dead-pool-heap ((this dead-pool-heap)) "Inspect a dead-pool-heap and all of the recs and their gaps" - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Theap: #~%" (-> obj heap)) - (format #t "~Tfirst-gap: #~%" (-> obj first-gap)) - (format #t "~Tfirst-shrink: #~%" (-> obj first-shrink)) - (format #t "~Talive-list: #~%" (-> obj alive-list)) - (format #t "~Tlast: #~%" (-> obj last)) - (format #t "~Tdead-list: #~%" (-> obj dead-list)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Theap: #~%" (-> this heap)) + (format #t "~Tfirst-gap: #~%" (-> this first-gap)) + (format #t "~Tfirst-shrink: #~%" (-> this first-shrink)) + (format #t "~Talive-list: #~%" (-> this alive-list)) + (format #t "~Tlast: #~%" (-> this last)) + (format #t "~Tdead-list: #~%" (-> this dead-list)) ;; here we consider the free memory to be all of the stuff after the last process. ;; we don't consider random gaps to be "free". ;; this means you can do a single allocation of free bytes and it will always succeed. - (let* ((total (the int (&- (-> obj heap top) (-> obj heap base)))) - (free (if (-> obj last) - (gap-size obj (-> obj last)) + (let* ((total (the int (&- (-> this heap top) (-> this heap base)))) + (free (if (-> this last) + (gap-size this (-> this last)) total)) ) - (format #t "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%" (-> obj process-list) (- total free) total) + (format #t "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%" (-> this process-list) (- total free) total) ) - (let ((rec (-> obj alive-list)) + (let ((rec (-> this alive-list)) (i 0) ) (while rec (when (-> rec process) (format #t "~T [~3D] # ~A~%" i rec (-> rec process)) ) - (let ((gap (gap-size obj rec))) + (let ((gap (gap-size this rec))) (unless (zero? gap) - (format #t "~T gap: ~D bytes @ #x~X~%" gap (gap-location obj rec))) + (format #t "~T gap: ~D bytes @ #x~X~%" gap (gap-location this rec))) ) (set! rec (-> rec next)) (+! i 1) ) ) - obj) + this) -(defmethod asize-of dead-pool-heap ((obj dead-pool-heap)) +(defmethod asize-of dead-pool-heap ((this dead-pool-heap)) "Get our total size. Uses the heap top as the end." - (- (the int (-> obj heap top)) (the int obj) *gtype-basic-offset*) + (- (the int (-> this heap top)) (the int this) *gtype-basic-offset*) ) -(defmethod memory-used dead-pool-heap ((obj dead-pool-heap)) +(defmethod memory-used dead-pool-heap ((this dead-pool-heap)) "Get the amount of memory used. This includes gaps between processes." - (if (-> obj last) + (if (-> this last) ; we have at least one process, get the not-last-gap memory - (- (memory-total obj) (gap-size obj (-> obj last))) + (- (memory-total this) (gap-size this (-> this last))) ; no processes. 0 ) ) -(defmethod memory-total dead-pool-heap ((obj dead-pool-heap)) +(defmethod memory-total dead-pool-heap ((this dead-pool-heap)) "Get the total amount of memory for processes" - (the int (&- (-> obj heap top) (-> obj heap base))) + (the int (&- (-> this heap top) (-> this heap base))) ) -(defmethod memory-free dead-pool-heap ((obj dead-pool-heap)) +(defmethod memory-free dead-pool-heap ((this dead-pool-heap)) "Get the total memory free." - (let ((top (-> obj heap top))) - (if (-> obj last) + (let ((top (-> this heap top))) + (if (-> this last) ; get the last gap size - (gap-size obj (-> obj last)) + (gap-size this (-> this last)) ; otherwise just the whole heap. - (the int (&- top (-> obj heap base))) + (the int (&- top (-> this heap base))) ) ) ) -(defmethod compact-time dead-pool-heap ((obj dead-pool-heap)) +(defmethod compact-time dead-pool-heap ((this dead-pool-heap)) "Access the compact time field." - (-> obj compact-time) + (-> this compact-time) ) -(defmethod find-gap-by-size dead-pool-heap ((obj dead-pool-heap) (size int)) +(defmethod find-gap-by-size dead-pool-heap ((this dead-pool-heap) (size int)) "Find a gap which will fit at least size bytes. Returns the rec for the proc before the gap. Will return a #f rec if there's no gap big enough." ; start our search at first-gap - (let ((rec (-> obj first-gap))) - (while (and rec (< (gap-size obj rec) size)) + (let ((rec (-> this first-gap))) + (while (and rec (< (gap-size this rec) size)) ;; nope, not big enough. (set! rec (-> rec next)) ) @@ -1155,15 +1157,15 @@ ;; warn when this happens. (define-extern *vis-boot* basic) -(defmethod get-process dead-pool-heap ((obj dead-pool-heap) (type-to-make type) (stack-size int)) +(defmethod get-process dead-pool-heap ((this dead-pool-heap) (type-to-make type) (stack-size int)) "Allocate a process" ;; get a record for the new process - (let ((rec (-> obj dead-list next)) + (let ((rec (-> this dead-list next)) ;; will eventually hold our new process (proc (the process #f)) ;; find the rec which has a big enough gap - (insert (find-gap-by-size obj (+ (the int (-> process size)) stack-size))) + (insert (find-gap-by-size this (+ (the int (-> process size)) stack-size))) ) (cond @@ -1171,7 +1173,7 @@ ((and rec insert) ;; pop the record off of the list - (set! (-> obj dead-list next) (-> rec next)) + (set! (-> this dead-list next) (-> rec next)) ;; splice it into the alive list in the right spot (let ((next (-> insert next))) @@ -1188,12 +1190,12 @@ (set! (-> rec prev) insert) ;; if we are inserting after the last process, we should update the last. - (when (eq? insert (-> obj last)) - (set! (-> obj last) rec) + (when (eq? insert (-> this last)) + (set! (-> this last) rec) ) ;; get the gap - (set! proc (the process (gap-location obj insert))) + (set! proc (the process (gap-location this insert))) ;; and allocate! The method new does the offset for us. (set! proc ((method-of-type process new) (the symbol proc) process 'process stack-size)) @@ -1203,31 +1205,31 @@ (set! (-> proc ppointer) (&-> rec process)) ;; if we used the first gap, update first gap - (when (eq? (-> obj first-gap) insert) - (set! (-> obj first-gap) (find-gap obj rec)) + (when (eq? (-> this first-gap) insert) + (set! (-> this first-gap) (find-gap this rec)) ) ;; we haven't shrunk yet. If we don't have a first-shrink, or we are before it, ;; mark us as first shrink. - (when (or (not (-> obj first-shrink)) - (< (the int proc) (the int (-> obj first-shrink process))) + (when (or (not (-> this first-shrink)) + (< (the int proc) (the int (-> this first-shrink process))) ) - (set! (-> obj first-shrink) rec) + (set! (-> this first-shrink) rec) ) ;; update tree stuff. - (set! (-> proc parent) (-> obj ppointer)) - (set! (-> proc pool) obj) - (set! (-> obj child) (&-> rec process)) + (set! (-> proc parent) (-> this ppointer)) + (set! (-> proc pool) this) + (set! (-> this child) (&-> rec process)) ) ) (else ;; allocation failed! try again on the debug heap if we're debugging. - (when (and *debug-segment* (not (eq? obj *debug-dead-pool*))) + (when (and *debug-segment* (not (eq? this *debug-dead-pool*))) (set! proc (get-process *debug-dead-pool* type-to-make stack-size)) (when (and proc *vis-boot*) - (format 0 "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%" type-to-make proc (-> obj name))) + (format 0 "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%" type-to-make proc (-> this name))) ) ) @@ -1240,45 +1242,45 @@ ) (else ;; failure. complain. - (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" type-to-make proc (-> obj name)) + (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" type-to-make proc (-> this name)) ) ) proc) ) -(defmethod return-process dead-pool-heap ((obj dead-pool-heap) (proc process)) +(defmethod return-process dead-pool-heap ((this dead-pool-heap) (proc process)) "Return a process to a dead pool heap" ;; check we are returning to the correct pool - (unless (eq? obj (-> proc pool)) - (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" proc obj) + (unless (eq? this (-> proc pool)) + (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" proc this) ) ;; reclaim us. - (change-parent proc obj) + (change-parent proc this) ;; we don't maintain a real tree for a dead-pool-heap, so undo any change to child ;; done by change-parent - (set! (-> obj child) #f) + (set! (-> this child) #f) ;; we know our ppointer is really a rec for a dead-pool-heap process, so we can use ;; this trick to quickly find our rec. (let ((rec (the dead-pool-heap-rec (-> proc ppointer)))) ;; if we are at or below the first gap, update first gap. - (when (or (eq? (-> obj first-gap) rec) - (< (the int (gap-location obj rec)) (the int (gap-location obj (-> obj first-gap)))) + (when (or (eq? (-> this first-gap) rec) + (< (the int (gap-location this rec)) (the int (gap-location this (-> this first-gap)))) ) - (set! (-> obj first-gap) (-> rec prev)) + (set! (-> this first-gap) (-> rec prev)) ) ;; update the first-shrink. We aren't smart about this and just move it backward. - (when (eq? (-> obj first-shrink) rec) - (set! (-> obj first-shrink) (-> rec prev)) - (when (not (-> obj first-shrink process)) - (set! (-> obj first-shrink) #f)) + (when (eq? (-> this first-shrink) rec) + (set! (-> this first-shrink) (-> rec prev)) + (when (not (-> this first-shrink process)) + (set! (-> this first-shrink) #f)) ) ;; remove us from list @@ -1290,20 +1292,20 @@ ) (else ;; we were last, update that. - (set! (-> obj last) (-> rec prev)) + (set! (-> this last) (-> rec prev)) ) ) ;; insert at the front of the dead list. - (set! (-> rec next) (-> obj dead-list next)) - (set! (-> obj dead-list next) rec) + (set! (-> rec next) (-> this dead-list next)) + (set! (-> this dead-list next) rec) (set! (-> rec process) *null-process*) (none) ) ) -(defmethod shrink-heap dead-pool-heap ((obj dead-pool-heap) (proc process)) +(defmethod shrink-heap dead-pool-heap ((this dead-pool-heap) (proc process)) "Shrink the heap of a process. This resizes the process heap to be the exact size it is currently using." (when proc @@ -1319,8 +1321,8 @@ (set! (-> proc heap-top) (&-> (-> proc stack) (-> proc allocated-length))) ;; update first gap - (when (< (the int proc) (the int (gap-location obj (-> obj first-gap)))) - (set! (-> obj first-gap) (find-gap obj rec)) + (when (< (the int proc) (the int (gap-location this (-> this first-gap)))) + (set! (-> this first-gap) (find-gap this rec)) ) ;; mark us as shrunk @@ -1328,21 +1330,21 @@ ) ;; update first shrink - (when (eq? (-> obj first-shrink) rec) - (set! (-> obj first-shrink) (-> rec next)) + (when (eq? (-> this first-shrink) rec) + (set! (-> this first-shrink) (-> rec next)) ) ) ) - obj + this ) -(defmethod compact dead-pool-heap ((obj dead-pool-heap) (count int)) +(defmethod compact dead-pool-heap ((this dead-pool-heap) (count int)) "Do heap compaction. The count argument tells us how much work to do. If the heap is very full we will automatically do more work than requested." ;; first we see how much memory is in use. - (let ((free (memory-free obj)) - (total (memory-total obj)) + (let ((free (memory-free this)) + (total (memory-total this)) ) (let ((perc (/ (the float free) (the float total)))) (cond @@ -1366,30 +1368,30 @@ ) ;; update stats - (set! (-> obj compact-count-targ) count) - (set! (-> obj compact-count) 0) + (set! (-> this compact-count-targ) count) + (set! (-> this compact-count) 0) ;; and do compaction! (countdown (ii count) ;; first try to shrink a heap. - (let ((shrink (-> obj first-shrink))) + (let ((shrink (-> this first-shrink))) (when (not shrink) ;; not sure when this happens, but reset shrink if we need to. - (set! shrink (set! (-> obj first-shrink) (-> obj alive-list next))) + (set! shrink (set! (-> this first-shrink) (-> this alive-list next))) ) (when shrink ;; do a shrink! - (shrink-heap obj (-> shrink process)) + (shrink-heap this (-> shrink process)) ) ) ;; now find the first gap - (let ((gap (-> obj first-gap))) + (let ((gap (-> this first-gap))) ;; and the thing after it (when (-> gap next) (let ((proc (-> gap next process)) - (size (gap-size obj gap))) + (size (gap-size this gap))) (unless (zero? size) ;;(format #t "[kernel] Relocating process ~A by ~D.~%" proc (- size)) (when (< size 0) @@ -1398,13 +1400,13 @@ ) ;; try shrinking before relocating. - (shrink-heap obj proc) + (shrink-heap this proc) ;; relocate! (relocate proc (- size)) ;; update first gap - (set! (-> obj first-gap) (find-gap obj gap)) + (set! (-> this first-gap) (find-gap this gap)) ;; and update stats. - (+! (-> obj compact-count) 1) + (+! (-> this compact-count) 1) ) ) ) @@ -1414,22 +1416,22 @@ (none) ) -(defmethod churn dead-pool-heap ((obj dead-pool-heap) (count int)) +(defmethod churn dead-pool-heap ((this dead-pool-heap) (count int)) "Mess with the heap" (countdown (ii count) - (let ((rec (-> obj alive-list next))) + (let ((rec (-> this alive-list next))) (when rec - (when (or (eq? (-> obj first-gap) rec) - (< (the int (gap-location obj rec)) (the int (gap-location obj (-> obj first-gap)))) + (when (or (eq? (-> this first-gap) rec) + (< (the int (gap-location this rec)) (the int (gap-location this (-> this first-gap)))) ) - (set! (-> obj first-gap) (-> rec prev))) + (set! (-> this first-gap) (-> rec prev))) - (when (eq? (-> obj first-shrink) rec) - (set! (-> obj first-shrink) (-> rec prev)) - (when (not (-> obj first-shrink process)) - (set! (-> obj first-shrink) #f)) + (when (eq? (-> this first-shrink) rec) + (set! (-> this first-shrink) (-> rec prev)) + (when (not (-> this first-shrink process)) + (set! (-> this first-shrink) #f)) ) (set! (-> rec prev next) (-> rec next)) @@ -1438,11 +1440,11 @@ (set! (-> rec next prev) (-> rec prev)) ) (else - (set! (-> obj last) (-> rec prev)) + (set! (-> this last) (-> rec prev)) ) ) - (let* ((insert (-> obj last)) + (let* ((insert (-> this last)) (next (-> insert next)) ) @@ -1452,8 +1454,8 @@ (set! (-> next prev) rec)) (set! (-> rec prev) insert) - (set! (-> obj last) rec) - (set! (-> rec process) (relocate (-> rec process) (the int (&- (gap-location obj insert) + (set! (-> this last) rec) + (set! (-> rec process) (relocate (-> rec process) (the int (&- (gap-location this insert) (the int (&- (-> rec process) *gtype-basic-offset*)))))) ) ) @@ -1493,7 +1495,7 @@ "Count number of processes in the given tree using iterate-process-tree" (set! *global-search-count* 0) (iterate-process-tree this - (lambda ((obj process)) + (lambda ((this process)) (+! *global-search-count* 1) #t) *null-kernel-context*) @@ -1545,25 +1547,25 @@ ;; Process Iterating ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod run-logic? process ((obj process)) +(defmethod run-logic? process ((this process)) "Return if the process should be run or not. Children of process should override this with more interesting functions" #t) ;; the following three functions recursively iterate through process trees. -(defun iterate-process-tree ((obj process-tree) (func (function object object)) (context kernel-context)) +(defun iterate-process-tree ((this process-tree) (func (function object object)) (context kernel-context)) "Call func on all processes that aren't a process-tree. If func returns 'dead, stop. The kernel-context is ignored." - (let ((ret (or (process-mask? (-> obj mask) process-tree) - (func obj)))) + (let ((ret (or (process-mask? (-> this mask) process-tree) + (func this)))) (cond ((eq? ret 'dead) ;; stop. ) (else ;; iterate through brothers - (let ((brother (-> obj child))) + (let ((brother (-> this child))) (while brother ;; kinda weird, we use the brother from _before_ recursing. (let ((old-brother (-> (-> brother) brother))) @@ -1578,22 +1580,22 @@ ) ) -(defun execute-process-tree ((obj process-tree) (func (function object object)) (context kernel-context)) +(defun execute-process-tree ((this process-tree) (func (function object object)) (context kernel-context)) "Like iterate, but also requires that prevent-from-run's mask doesn't block, and that run-logic? is true in order to call the function." ;; check mask for tree, mask for prevent, run-logic?, then run! - (let ((ret (or (process-mask? (-> obj mask) process-tree) - (not (and (or (zero? (logand (-> context prevent-from-run) (-> obj mask)))) - (run-logic? obj))) - (func obj) + (let ((ret (or (process-mask? (-> this mask) process-tree) + (not (and (or (zero? (logand (-> context prevent-from-run) (-> this mask)))) + (run-logic? this))) + (func this) ))) ;; run on our children (cond ((eq? ret 'dead) ;; if dead, don't bother checking children. ) - (else (let ((brother (-> obj child))) + (else (let ((brother (-> this child))) (while brother (let ((temp (-> (-> brother) brother))) (execute-process-tree (-> brother) func context) @@ -1606,19 +1608,19 @@ ) -(defun search-process-tree ((obj process-tree) (func (function process-tree object))) +(defun search-process-tree ((this process-tree) (func (function process-tree object))) "Find the first process which func return true on. Won't find process-tree's (by mask)" ;; reject process-tree - (unless (process-mask? (-> obj mask) process-tree) + (unless (process-mask? (-> this mask) process-tree) ;; is this a match? - (when (func obj) - (return-from #f obj) + (when (func this) + (return-from #f this) ) ) ;; not a match, check out children - (let ((brother (-> obj child))) + (let ((brother (-> this child))) (while brother (let ((temp (-> (-> brother) brother))) (let ((ret (search-process-tree (-> brother) func))) @@ -1681,21 +1683,21 @@ ;; iterate over all processes, running this lambda: (execute-process-tree *active-pool* - (lambda ((obj process)) + (lambda ((this process)) (let ((context *kernel-context*)) (cond - ((or (eq? (-> obj status) 'waiting-to-run) - (eq? (-> obj status) 'suspended)) + ((or (eq? (-> this status) 'waiting-to-run) + (eq? (-> this status) 'suspended)) ;; begin event in profiler. - (profiler-start-event (process-name-as-string obj)) + (profiler-start-event (process-name-as-string this)) ;; set current process to us - (set! (-> context current-process) obj) + (set! (-> context current-process) this) ;; pause tricks to prevent debug text and drawings from disappearing when pausing: (cond - ((process-mask? (-> obj mask) pause) + ((process-mask? (-> this mask) pause) ;; we are a pausable object, so we should put our *stdcon* to the one that isn't cleared during pause: (set! *stdcon* *stdcon1*) ;; and we should do our debug drawing to a buffer that isn't cleared during pause: @@ -1712,22 +1714,22 @@ ;; TRANS ;; this function should run before resuming. (cond - ((-> obj trans-hook) + ((-> this trans-hook) ;; we have a trans hook defined. let's create a thread and run it. we can reuse the stack of the main-thread ;; it is safe to do this because the main-thread is currently suspended or hasn't run yet. - (let ((trans (new 'process 'cpu-thread obj 'trans PROCESS_STACK_SAVE_SIZE (-> obj main-thread stack-top)))) + (let ((trans (new 'process 'cpu-thread this 'trans PROCESS_STACK_SAVE_SIZE (-> this main-thread stack-top)))) ;; call the function in the thread. - (reset-and-call trans (-> obj trans-hook)) + (reset-and-call trans (-> this trans-hook)) (#when KERNEL_DEBUG (when (!= (-> trans type) cpu-thread) - (format 0 "corrupted stack after trans for ~A~%" obj) + (format 0 "corrupted stack after trans for ~A~%" this) ) ) ;; remove the cpu-thread (delete trans) ;; check for deadness - (when (eq? (-> obj status) 'dead) + (when (eq? (-> this status) 'dead) (set! (-> context current-process) #f) (profiler-end-event) (return 'dead) ;; tells the execute-process-tree function to skip our children. @@ -1737,17 +1739,17 @@ ) ;; MAIN CODE - (if (process-mask? (-> obj mask) sleep-code) + (if (process-mask? (-> this mask) sleep-code) ;; we're sleeping. Move us to suspended, in case we were in waiting to run. - (set! (-> obj status) 'suspended) + (set! (-> this status) 'suspended) ;; not sleeping. call resume hook. This will return once the main thread suspends again. - ((-> obj main-thread resume-hook) (-> obj main-thread)) + ((-> this main-thread resume-hook) (-> this main-thread)) ) ;; check for deadness (cond - ((eq? (-> obj status) 'dead) + ((eq? (-> this status) 'dead) ;; oops we died. return 'dead (set! (-> context current-process) #f) (profiler-end-event) @@ -1757,19 +1759,19 @@ ;; not dead. ;; POST CODE (cond - ((-> obj post-hook) + ((-> this post-hook) ;; Note: use dram stack always. This will allow actors to use the scratchpad stack and get a speedup for trans/code ;; but still be able to do joint-animation stuff that uses the scratchpad in post. - (let ((post (new 'process 'cpu-thread obj 'post PROCESS_STACK_SAVE_SIZE *kernel-dram-stack*))) - (reset-and-call post (-> obj post-hook)) + (let ((post (new 'process 'cpu-thread this 'post PROCESS_STACK_SAVE_SIZE *kernel-dram-stack*))) + (reset-and-call post (-> this post-hook)) (delete post) - (when (eq? (-> obj status) 'dead) + (when (eq? (-> this status) 'dead) ;; oops we died. (set! (-> context current-process) #f) (profiler-end-event) (return 'dead) ) - (set! (-> obj status) 'suspended) + (set! (-> this status) 'suspended) ) ) ) @@ -1781,7 +1783,7 @@ ) - ((eq? (-> obj status) 'dead) + ((eq? (-> this status) 'dead) 'dead) ) ) @@ -1791,7 +1793,7 @@ ) (define-extern inspect-process-tree (function process-tree int int symbol process-tree)) -(defun inspect-process-tree ((obj process-tree) (level int) (mask int) (detail symbol)) +(defun inspect-process-tree ((this process-tree) (level int) (mask int) (detail symbol)) "Debug print a pocess-tree" (print-tree-bitmask mask (+ 0 level)) @@ -1800,25 +1802,25 @@ (detail (format #t "__________________~%") ;; this is here, but I removed it because it prints at the wrong indent and looks weird. - ;(format #t "~S~A~%" (if (zero? level) "" "+---") obj) + ;(format #t "~S~A~%" (if (zero? level) "" "+---") this) (protect (*print-column*) (set! *print-column* (the binteger (* level 4))) - (inspect obj) + (inspect this) ) ) (else - (format #t "~S~A~%" (if (zero? level) "" "+---") obj) + (format #t "~S~A~%" (if (zero? level) "" "+---") this) ) ) ;; print our children - (let ((child (-> obj child))) + (let ((child (-> this child))) (while child (inspect-process-tree (-> child) (+ level 1) (if (not (-> (-> child) brother)) mask (logior mask (ash 1 (+ 1 level)))) detail) (set! child (-> (-> child) brother)) ) ) - obj + this ) (defmacro set-u128-as-u64! (dst src) @@ -1873,56 +1875,56 @@ ) ;; we treat the allocation as an address. - (let ((obj (the catch-frame (&+ allocation *gtype-basic-offset*)))) + (let ((this (the catch-frame (&+ allocation *gtype-basic-offset*)))) ;; setup catch frame - (set! (-> obj type) type-to-make) - (set! (-> obj name) name) + (set! (-> this type) type-to-make) + (set! (-> this name) name) ;; get the return address (the compiler won't touch the stack because we're an asm-func) (.pop temp) (.push temp) ;; make it a GOAL address so it fits in 32 bits (.sub temp off) ;; store it - (set! (-> obj ra) (the int temp)) + (set! (-> this ra) (the int temp)) ;; todo, do we need a stack offset here? ;; remember the stack pointer (set! temp sp) (.sub temp off) - (set! (-> obj sp) (the int temp)) + (set! (-> this sp) (the int temp)) ;; back up registers we care about (.mov :color #f temp s0) - (set-u128-as-u64! (-> obj rreg 0) temp) + (set-u128-as-u64! (-> this rreg 0) temp) (.mov :color #f temp s1) - (set-u128-as-u64! (-> obj rreg 1) temp) + (set-u128-as-u64! (-> this rreg 1) temp) (.mov :color #f temp s2) - (set-u128-as-u64! (-> obj rreg 2) temp) + (set-u128-as-u64! (-> this rreg 2) temp) (.mov :color #f temp s3) - (set-u128-as-u64! (-> obj rreg 3) temp) + (set-u128-as-u64! (-> this rreg 3) temp) (.mov :color #f temp s4) - (set-u128-as-u64! (-> obj rreg 4) temp) + (set-u128-as-u64! (-> this rreg 4) temp) (.mov :color #f temp xmm8) - (set! (-> obj freg 0) (the-as float temp)) + (set! (-> this freg 0) (the-as float temp)) (.mov :color #f temp xmm9) - (set! (-> obj freg 1) (the-as float temp)) + (set! (-> this freg 1) (the-as float temp)) (.mov :color #f temp xmm10) - (set! (-> obj freg 2) (the-as float temp)) + (set! (-> this freg 2) (the-as float temp)) (.mov :color #f temp xmm11) - (set! (-> obj freg 3) (the-as float temp)) + (set! (-> this freg 3) (the-as float temp)) (.mov :color #f temp xmm12) - (set! (-> obj freg 4) (the-as float temp)) + (set! (-> this freg 4) (the-as float temp)) (.mov :color #f temp xmm13) - (set! (-> obj freg 5) (the-as float temp)) + (set! (-> this freg 5) (the-as float temp)) (.mov :color #f temp xmm14) - (set! (-> obj freg 6) (the-as float temp)) + (set! (-> this freg 6) (the-as float temp)) (.mov :color #f temp xmm15) - (set! (-> obj freg 7) (the-as float temp)) + (set! (-> this freg 7) (the-as float temp)) ;; push this stack frame - (set! (-> obj next) (-> pp stack-frame-top)) - (set! (-> pp stack-frame-top) obj) + (set! (-> this next) (-> pp stack-frame-top)) + (set! (-> pp stack-frame-top) this) ;; help coloring, it isn't smart enough to realize it's "safe" to use these registers. (.push :color #f s3) @@ -1953,7 +1955,7 @@ ) -(defun throw-dispatch ((obj catch-frame) value) +(defun throw-dispatch ((this catch-frame) value) "Throw the given value to the catch frame. Only can throw a 64-bit value. The original could throw 128 bits." (declare (asm-func none)) @@ -1980,44 +1982,44 @@ ) ;; pop everything we threw past - (set! (-> pp stack-frame-top) (-> obj next)) + (set! (-> pp stack-frame-top) (-> this next)) ;; restore regs we care about. - (set-u64-from-u128! temp (-> obj rreg 0)) + (set-u64-from-u128! temp (-> this rreg 0)) (.mov :color #f s0 temp) - (set-u64-from-u128! temp (-> obj rreg 1)) + (set-u64-from-u128! temp (-> this rreg 1)) (.mov :color #f s1 temp) - (set-u64-from-u128! temp (-> obj rreg 2)) + (set-u64-from-u128! temp (-> this rreg 2)) (.mov :color #f s2 temp) - (set-u64-from-u128! temp (-> obj rreg 3)) + (set-u64-from-u128! temp (-> this rreg 3)) (.mov :color #f s3 temp) - (set-u64-from-u128! temp (-> obj rreg 4)) + (set-u64-from-u128! temp (-> this rreg 4)) (.mov :color #f s4 temp) - (set! temp-float (-> obj freg 0)) + (set! temp-float (-> this freg 0)) (.mov :color #f xmm8 temp-float) - (set! temp-float (-> obj freg 1)) + (set! temp-float (-> this freg 1)) (.mov :color #f xmm9 temp-float) - (set! temp-float (-> obj freg 2)) + (set! temp-float (-> this freg 2)) (.mov :color #f xmm10 temp-float) - (set! temp-float (-> obj freg 3)) + (set! temp-float (-> this freg 3)) (.mov :color #f xmm11 temp-float) - (set! temp-float (-> obj freg 4)) + (set! temp-float (-> this freg 4)) (.mov :color #f xmm12 temp-float) - (set! temp-float (-> obj freg 5)) + (set! temp-float (-> this freg 5)) (.mov :color #f xmm13 temp-float) - (set! temp-float (-> obj freg 6)) + (set! temp-float (-> this freg 6)) (.mov :color #f xmm14 temp-float) - (set! temp-float (-> obj freg 7)) + (set! temp-float (-> this freg 7)) (.mov :color #f xmm15 temp-float) ;; set stack pointer - (set! sp (the uint (-> obj sp))) + (set! sp (the uint (-> this sp))) (.add sp off) ;; overwrite our return address (.pop temp) - (set! temp (the uint (-> obj ra))) + (set! temp (the uint (-> this ra))) (.add temp off) (.push temp) @@ -2051,16 +2053,16 @@ ) (defmethod new protect-frame ((allocation symbol) (type-to-make type) (func (function object))) - (let ((obj (the protect-frame (&+ allocation *gtype-basic-offset*)))) - (set! (-> obj type) type-to-make) - (set! (-> obj name) 'protect-frame) - (set! (-> obj exit) func) + (let ((this (the protect-frame (&+ allocation *gtype-basic-offset*)))) + (set! (-> this type) type-to-make) + (set! (-> this name) 'protect-frame) + (set! (-> this exit) func) (rlet ((pp :reg r13 :type process)) - (set! (-> obj next) (-> pp stack-frame-top)) - (set! (-> pp stack-frame-top) obj) + (set! (-> this next) (-> pp stack-frame-top)) + (set! (-> pp stack-frame-top) this) ) - obj + this ) ) @@ -2092,34 +2094,34 @@ ) -(defun change-parent ((obj process-tree) (new-parent process-tree)) - "Make obj a child of new-parent" - (let ((parent (-> obj parent))) +(defun change-parent ((this process-tree) (new-parent process-tree)) + "Make this a child of new-parent" + (let ((parent (-> this parent))) ;; parent is a ppointer. - ;; need to remove obj from its current parent + ;; need to remove this from its current parent (when parent (let ((proc (-> (-> parent) child))) - (if (eq? (ppointer->process proc) obj) + (if (eq? (ppointer->process proc) this) ;; case where we're the first child is easy! - (set! (-> (-> parent) child) (-> obj brother)) + (set! (-> (-> parent) child) (-> this brother)) ;; otherwise, look through brothers to find us. (begin - (while (not (eq? (ppointer->process (-> (-> proc) brother)) obj)) + (while (not (eq? (ppointer->process (-> (-> proc) brother)) this)) (set! proc (-> (-> proc) brother)) ) ;; ok, got us, splice out of list. - (set! (-> (-> proc) brother) (-> obj brother)) + (set! (-> (-> proc) brother) (-> this brother)) ) ) ) ) ;; add to new parent - (set! (-> obj parent) (-> new-parent ppointer)) - (set! (-> obj brother) (-> new-parent child)) - (set! (-> new-parent child) (-> obj ppointer)) - obj + (set! (-> this parent) (-> new-parent ppointer)) + (set! (-> this brother) (-> new-parent child)) + (set! (-> new-parent child) (-> this ppointer)) + this ) ) @@ -2235,7 +2237,7 @@ ;; Process Control ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod activate process ((obj process) (dest process-tree) (name basic) (stack-top pointer)) +(defmethod activate process ((this process) (dest process-tree) (name basic) (stack-top pointer)) "Activate a process! Put it on the given active tree and set up the main thread." ;; if we got the scratchpad stack, move to the fake scratchpad. @@ -2245,50 +2247,50 @@ ) ) ;; inherit mask (minus stuff like sleep) - (set! (-> obj mask) (logand (-> dest mask) PROCESS_CLEAR_MASK)) - (set! (-> obj status) 'ready) + (set! (-> this mask) (logand (-> dest mask) PROCESS_CLEAR_MASK)) + (set! (-> this status) 'ready) ;; get a unique pid. (let ((pid (-> *kernel-context* next-pid))) - (set! (-> obj pid) pid) + (set! (-> this pid) pid) (set! (-> *kernel-context* next-pid) (+ 1 pid))) - (set! (-> obj top-thread) #f) - (set! (-> obj main-thread) #f) - (set! (-> obj name) name) + (set! (-> this top-thread) #f) + (set! (-> this main-thread) #f) + (set! (-> this name) name) ;; set up our heap. Note that we apply an offset of heap-base to leave room for fields of the actual type. ;; unclear why we can't just use the size of our type... but I guess this gives you the option ;; to put some other stuff in between the fields and the heap. - (set! (-> obj heap-base) (set! (-> obj heap-cur) (&+ (-> obj stack) (-> obj type heap-base)))) - (set! (-> obj stack-frame-top) #f) + (set! (-> this heap-base) (set! (-> this heap-cur) (&+ (-> this stack) (-> this type heap-base)))) + (set! (-> this stack-frame-top) #f) ;; heaps should be 0 initialized. - (mem-set32! (-> obj stack) (the int (/ (-> obj type heap-base) 4)) 0) + (mem-set32! (-> this stack) (the int (/ (-> this type heap-base) 4)) 0) - (set! (-> obj trans-hook) #f) - (set! (-> obj post-hook) #f) - (set! (-> obj event-hook) #f) - (set! (-> obj state) #f) - (set! (-> obj next-state) #f) + (set! (-> this trans-hook) #f) + (set! (-> this post-hook) #f) + (set! (-> this event-hook) #f) + (set! (-> this state) #f) + (set! (-> this next-state) #f) ;; inherit entity if our parent is another process (if (process-mask? (-> dest mask) process-tree) - (set! (-> obj entity) #f) - (set! (-> obj entity) (-> (the process dest) entity)) + (set! (-> this entity) #f) + (set! (-> this entity) (-> (the process dest) entity)) ) ;; reset all connections - (set! (-> obj connection-list next1) #f) - (set! (-> obj connection-list prev1) #f) + (set! (-> this connection-list next1) #f) + (set! (-> this connection-list prev1) #f) ;; allocate the main thread (sets everything up.) - (let ((thread (new 'process 'cpu-thread obj 'code PROCESS_STACK_SAVE_SIZE stack-top))) - (set! (-> obj main-thread) thread) + (let ((thread (new 'process 'cpu-thread this 'code PROCESS_STACK_SAVE_SIZE stack-top))) + (set! (-> this main-thread) thread) ) - (change-parent obj dest) + (change-parent this dest) ) -(defun run-function-in-process ((obj process) (func function) a0 a1 a2 a3 a4 a5) +(defun run-function-in-process ((this process) (func function) a0 a1 a2 a3 a4 a5) "Switch to the given process and run the function. This is used to initialize a process. The function will run until it attempts to change state. At the first attempt to change state, this function will return. The idea is that you use this when you want to initialize a process NOW. @@ -2309,7 +2311,7 @@ (let* ((old-pp pp) (func-val (begin ;; set the process - (set! pp obj) + (set! pp this) ;; set us as initializing (set! (-> pp status) 'initialize) ;; run! @@ -2422,7 +2424,7 @@ ;; Process Deactivation ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod deactivate process-tree ((obj process-tree)) +(defmethod deactivate process-tree ((this process-tree)) "Can't deactivate a process-tree" (none) ) @@ -2447,7 +2449,7 @@ (define-extern process-disconnect (function process int)) -(defmethod deactivate process ((obj process)) +(defmethod deactivate process ((this process)) "Deactivate a process. This returns the process to the dead pool it came from. You can use this on your own process to kill yourself and immediately return to the kernel. @@ -2458,13 +2460,13 @@ vars from within your exit handlers." ;; don't do anything if we already died. - (unless (eq? (-> obj status) 'dead) + (unless (eq? (-> this status) 'dead) ;; set our state to a dead-state that does nothing. - (set! (-> obj next-state) dead-state) + (set! (-> this next-state) dead-state) ;; call entity handler if we're from an entity. - (when (-> obj entity) - (entity-deactivate-handler obj (-> obj entity)) + (when (-> this entity) + (entity-deactivate-handler this (-> this entity)) ) ;; clean up stack frames the process is in. @@ -2472,7 +2474,7 @@ ;; we might be getting deactivated from another process. (rlet ((pp :reg r13 :type process)) (let ((old-pp pp)) - (set! pp obj) + (set! pp this) (let ((cur (-> pp stack-frame-top))) ;; loop over frames... (while cur @@ -2492,11 +2494,11 @@ ;; remove our connections. ;; hack - if this isn't defined yet, don't try it. (if (!= 0 (the uint process-disconnect)) - (process-disconnect obj) + (process-disconnect this) ) ;; kill our child and their brothers - (let ((bro (-> obj child))) + (let ((bro (-> this child))) (while bro (let ((temp (-> (-> bro) brother))) (deactivate (-> bro)) @@ -2506,20 +2508,20 @@ ) ;; return ourself to the pool - (return-process (-> obj pool) obj) - (set! (-> obj state) #f) - (set! (-> obj next-state) #f) - (set! (-> obj entity) #f) - (set! (-> obj pid) 0) + (return-process (-> this pool) this) + (set! (-> this state) #f) + (set! (-> this next-state) #f) + (set! (-> this entity) #f) + (set! (-> this pid) 0) ;; deal with getting out of here. (cond ;; first case - we deactivated the running process ;; (note, we don't check against pp because run-function-in-process ;; will change pp for running initializations.) - ((eq? obj (-> *kernel-context* current-process)) + ((eq? this (-> *kernel-context* current-process)) ;; go straight to dead. - (set! (-> obj status) 'dead) + (set! (-> this status) 'dead) ;; and return (with no deactivate) ;; TODO: replace with abandon. (let ((temp (the uint return-from-thread))) @@ -2531,13 +2533,13 @@ ) ) ;; second case - we deactivated while initializing. - ((eq? (-> obj status) 'initialize) - (set! (-> obj status) 'dead) + ((eq? (-> this status) 'initialize) + (set! (-> this status) 'dead) ;; throw back to the place where we started initializing. (throw 'initialize #f) ) ) - (set! (-> obj status) 'dead) + (set! (-> this status) 'dead) ) (none) ) @@ -2548,10 +2550,10 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; the listener process is used to run functions from the REPL. -(let ((obj (define *listener-process* (new 'global 'process 'listener 2048)))) - (set! (-> obj status) 'ready) - (set! (-> obj pid) 1) - (set! (-> obj main-thread) (new 'process 'cpu-thread obj 'main 256 *kernel-dram-stack*)) +(let ((this (define *listener-process* (new 'global 'process 'listener 2048)))) + (set! (-> this status) 'ready) + (set! (-> this pid) 1) + (set! (-> this main-thread) (new 'process 'cpu-thread this 'main 256 *kernel-dram-stack*)) ) ;; a dummy process for process records that don't have a process to point to. diff --git a/goal_src/jak1/kernel/gstate.gc b/goal_src/jak1/kernel/gstate.gc index aba54d7955..ca0e63387c 100644 --- a/goal_src/jak1/kernel/gstate.gc +++ b/goal_src/jak1/kernel/gstate.gc @@ -257,6 +257,8 @@ It type checks the arguments for the entry function. `(none) ) +;; DECOMP BEGINS + (defmethod new state ((allocation symbol) (type-to-make type) @@ -268,16 +270,16 @@ It type checks the arguments for the entry function. (event (function process int symbol event-message-block object))) "Allocate a new state. It seems like this isn't really used much and most states are statically allocated and as a result don't have the constructor called." - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj name) name) - (set! (-> obj next) #f) - (set! (-> obj exit) exit) - (set! (-> obj code) code) - (set! (-> obj trans) trans) - (set! (-> obj post) #f) - (set! (-> obj enter) enter) - (set! (-> obj event) event) - obj + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this name) name) + (set! (-> this next) #f) + (set! (-> this exit) exit) + (set! (-> this code) code) + (set! (-> this trans) trans) + (set! (-> this post) #f) + (set! (-> this enter) enter) + (set! (-> this event) event) + this ) ) @@ -302,10 +304,10 @@ It type checks the arguments for the entry function. child ) -(defmethod print state ((obj state)) +(defmethod print state ((this state)) "Print a state." - (format '#t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) - obj + (format '#t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) + this ) (define-extern enter-state (function object object object object object object object)) diff --git a/goal_src/jak1/kernel/gstring.gc b/goal_src/jak1/kernel/gstring.gc index 1aedca26fc..8bc2009c38 100644 --- a/goal_src/jak1/kernel/gstring.gc +++ b/goal_src/jak1/kernel/gstring.gc @@ -11,25 +11,25 @@ ;; Note that string is a bit of a special type, and the compiler assumes there is no ;; child type of string ever created. - +;; DECOMP BEGINS ;;;;;;;;;;;;;;;;;;;;;;;;; ;; String methods ;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod length string ((obj string)) +(defmethod length string ((this string)) "Get the length of a string. Like strlen" - (let ((str-ptr (-> obj data))) + (let ((str-ptr (-> this data))) (while (!= 0 (-> str-ptr 0)) (set! str-ptr (the (pointer uint8) (&+ str-ptr 1))) ) - (- (the int str-ptr) (the int (-> obj data))) + (- (the int str-ptr) (the int (-> this data))) ) ) -(defmethod asize-of string ((obj string)) +(defmethod asize-of string ((this string)) "get the size in bytes of a string." - (+ (-> obj allocated-length) 1 (-> string size)) + (+ (-> this allocated-length) 1 (-> string size)) ) (defun copy-string<-string ((dst string) (src string)) diff --git a/goal_src/jak1/levels/beach/air-h.gc b/goal_src/jak1/levels/beach/air-h.gc index 67f8ba65db..366dd45bd9 100644 --- a/goal_src/jak1/levels/beach/air-h.gc +++ b/goal_src/jak1/levels/beach/air-h.gc @@ -54,9 +54,3 @@ ) ) ) - -0 - - - - diff --git a/goal_src/jak1/levels/beach/beach-obs.gc b/goal_src/jak1/levels/beach/beach-obs.gc index c72eb2525a..96cb58bfd2 100644 --- a/goal_src/jak1/levels/beach/beach-obs.gc +++ b/goal_src/jak1/levels/beach/beach-obs.gc @@ -58,9 +58,9 @@ :post rider-post ) -(defmethod init-from-entity! windmill-one ((obj windmill-one) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! windmill-one ((this windmill-one) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -95,14 +95,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj root-override pause-adjust-distance) 409600.0) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *windmill-one-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this root-override pause-adjust-distance) 409600.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *windmill-one-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this sound-id) (new-sound-id)) (go windmill-one-idle) (none) ) @@ -248,7 +248,7 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! (-> self draw art-group data 3) :num! min) (transform-post) (suspend) @@ -268,7 +268,7 @@ (set! (-> arg0 part local-clock) 0) (set-vector! s4-0 0.0 0.0 0.0 1.0) (while (and (not s2-0) (< f30-0 (-> arg0 distance))) - (let ((f28-0 (* (-> arg0 speed) (-> *display* seconds-per-frame)))) + (let ((f28-0 (* (-> arg0 speed) (seconds-per-frame)))) (when (< (-> arg0 distance) (+ f30-0 f28-0)) (set! f28-0 (- (-> arg0 distance) f30-0)) (set! s2-0 #t) @@ -323,8 +323,8 @@ :post transform-post ) -(defmethod init-from-entity! grottopole ((obj grottopole) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! grottopole ((this grottopole) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -361,17 +361,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *grottopole-sg* '()) - (set! (-> obj speed) (res-lump-float arg0 'speed :default 81920.0)) - (set! (-> obj distance) (res-lump-float arg0 'distance :default 3072.0)) - (set! (-> obj position) 0) - (set! (-> obj max-position) (res-lump-value arg0 'num-positions int :default (the-as uint128 3))) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 155) obj)) - (set! (-> obj position) (-> obj entity extra perm user-int16 0)) - (move-grottopole-to-position obj) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *grottopole-sg* '()) + (set! (-> this speed) (res-lump-float arg0 'speed :default 81920.0)) + (set! (-> this distance) (res-lump-float arg0 'distance :default 3072.0)) + (set! (-> this position) 0) + (set! (-> this max-position) (res-lump-value arg0 'num-positions int :default (the-as uint128 3))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 155) this)) + (set! (-> this position) (-> this entity extra perm user-int16 0)) + (move-grottopole-to-position this) (go grottopole-idle) (none) ) @@ -547,7 +547,7 @@ (defstate ecoventrock-break (ecoventrock) :event process-drawable-fuel-cell-handler :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior ((arg0 symbol)) (local-vars (sv-128 symbol)) @@ -621,8 +621,8 @@ (set! sv-128 (the-as symbol #f)) (apply-all (-> self link) actor-link-subtask-complete-hook (& sv-128)) (when sv-128 - (let ((s5-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-2) (seconds 0.5)) + (let ((s5-2 (current-time))) + (until (time-elapsed? s5-2 (seconds 0.5)) (suspend) ) ) @@ -655,9 +655,9 @@ ) ) -(defmethod init-from-entity! ecoventrock ((obj ecoventrock) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! ecoventrock ((this ecoventrock) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -669,14 +669,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ecoventrock-sg* '()) - (set! (-> obj link) (new 'process 'actor-link-info obj)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ecoventrock-sg* '()) + (set! (-> this link) (new 'process 'actor-link-info this)) (transform-post) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go ecoventrock-break #t) (go ecoventrock-idle) ) @@ -705,7 +705,7 @@ (defstate flying-rock-rolling (flying-rock) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (let ((gp-0 #f) @@ -771,7 +771,7 @@ ) (set-vector! gp-2 (-> self root-override transv z) 0.0 (- (-> self root-override transv x)) 1.0) (vector-normalize! gp-2 1.0) - (let ((f0-12 (* 0.00061035156 (-> *display* seconds-per-frame) f30-1))) + (let ((f0-12 (* 0.00061035156 (seconds-per-frame) f30-1))) (quaternion-vector-angle! (-> self tumble) gp-2 (* 10430.379 f0-12)) ) ) @@ -781,7 +781,7 @@ (go flying-rock-idle) ) :post (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go flying-rock-idle) ) (ja-post) @@ -873,7 +873,7 @@ (defstate bladeassm-idle (bladeassm) :code (behavior () (loop - (+! (-> self angle) (* 3640.889 (-> *display* seconds-per-frame))) + (+! (-> self angle) (* 3640.889 (seconds-per-frame))) (set! (-> self angle) (the float (sar (shl (the int (-> self angle)) 48) 48))) (pusher-post) (suspend) @@ -888,9 +888,9 @@ 0 ) -(defmethod init-from-entity! bladeassm ((obj bladeassm) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! bladeassm ((this bladeassm) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -907,14 +907,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *bladeassm-sg* '()) - (set! (-> obj skel prebind-function) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *bladeassm-sg* '()) + (set! (-> this skel prebind-function) (the-as (function pointer int process-drawable none) bladeassm-prebind-function) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (go bladeassm-idle) (none) ) @@ -958,24 +958,24 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod relocate flutflutegg ((obj flutflutegg) (arg0 int)) - (if (nonzero? (-> obj wobbler)) - (&+! (-> obj wobbler) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method flutflutegg 7)) this arg0) ) ) ;; WARN: Function (method 20 flutflutegg) has a return type of none, but the expression builder found a return statement. -(defmethod flutflutegg-method-20 flutflutegg ((obj flutflutegg) (arg0 float) (arg1 float) (arg2 float)) - (if (< (- (-> *display* base-frame-counter) (the-as time-frame (-> obj last-impulse-time))) (seconds 0.5)) +(defmethod flutflutegg-method-20 flutflutegg ((this flutflutegg) (arg0 float) (arg1 float) (arg2 float)) + (if (not (time-elapsed? (the-as time-frame (-> this last-impulse-time)) (seconds 0.5))) (return 0) ) - (set! (-> obj last-impulse-time) (the-as int (-> *display* base-frame-counter))) - (+! (-> obj vel) arg0) - (inc-xy-vel! (-> obj wobbler) arg1 arg2) + (set! (-> this last-impulse-time) (the-as int (current-time))) + (+! (-> this vel) arg0) + (inc-xy-vel! (-> this wobbler) arg1 arg2) 0 (none) ) @@ -1062,7 +1062,7 @@ ) ((< (-> gp-0 y) -24576.0) ) - ((< (- (-> *display* base-frame-counter) (-> self ambient last-ambient-time)) (seconds 30)) + ((not (time-elapsed? (-> self ambient last-ambient-time) (seconds 30))) ) ((< 0.8 f30-0) (play-ambient (-> self ambient) "BIR-AM07" #f (-> self root-override trans)) @@ -1092,7 +1092,7 @@ (defstate flutflutegg-physics (flutflutegg) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.5)) (= message 'attack) (or (= (-> block param 1) 'punch) (= (-> block param 1) 'spin) (= (-> block param 1) 'spin-air)) (!= (-> self incomming-attack-id) (-> block param 2)) @@ -1117,9 +1117,9 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (+! (-> self pos) (* (-> self vel) (-> *display* seconds-per-frame))) + (+! (-> self pos) (* (-> self vel) (seconds-per-frame))) ;; og:preserve-this PAL patch here (set! (-> self vel) (* (-> self vel) (- 1.0 (* 0.05 (-> *display* time-adjust-ratio))))) (move! (-> self wobbler)) @@ -1159,8 +1159,8 @@ ) (camera-change-to "camera-135" 0 #f) (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 9)) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 4)) (suspend) ) ) @@ -1177,7 +1177,7 @@ (close-specific-task! (game-task beach-flutflut) (task-status need-reminder)) (loop (vector-float*! (-> self root-override transv) (-> self dir) (-> self vel)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (until v1-25 (vector-v++! (-> self root-override transv) @@ -1198,7 +1198,7 @@ (quaternion*! (-> self root-override quat) (-> self root-override quat) a2-6) ) (suspend) - (set! v1-25 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (set! v1-25 (and (time-elapsed? (-> self state-time) (seconds 0.5)) (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) ) ) @@ -1234,9 +1234,9 @@ ) (suspend) ) - (let ((gp-2 (-> *display* base-frame-counter))) + (let ((gp-2 (current-time))) (while (not (task-closed? (game-task beach-flutflut) (task-status need-reward-speech))) - (if (>= (- (-> *display* base-frame-counter) gp-2) (seconds 10)) + (if (time-elapsed? gp-2 (seconds 10)) (level-hint-spawn (text-id beach-flutflutegg-hint) "sksp0029" @@ -1264,8 +1264,8 @@ :post ja-post ) -(defmethod init-from-entity! flutflutegg ((obj flutflutegg) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! flutflutegg ((this flutflutegg) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1297,20 +1297,20 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *flutflutegg-sg* '()) - (vector-z-quaternion! (-> obj dir) (-> obj root-override quat)) - (set! (-> obj start quad) (-> obj root-override trans quad)) - (set! (-> obj fall-dist) 20480.0) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (+ -16384.0 (y-angle (-> obj root-override)))) - (set! (-> obj pos) 0.0) - (set! (-> obj vel) 0.0) - (set! (-> obj wobbler) (new 'process 'wobbler)) - (reset! (-> obj wobbler) 0.1 0.98 4096.0) - (set! (-> obj last-impulse-time) 0) - (set! (-> obj ambients-played) 0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *flutflutegg-sg* '()) + (vector-z-quaternion! (-> this dir) (-> this root-override quat)) + (set! (-> this start quad) (-> this root-override trans quad)) + (set! (-> this fall-dist) 20480.0) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) (+ -16384.0 (y-angle (-> this root-override)))) + (set! (-> this pos) 0.0) + (set! (-> this vel) 0.0) + (set! (-> this wobbler) (new 'process 'wobbler)) + (reset! (-> this wobbler) 0.1 0.98 4096.0) + (set! (-> this last-impulse-time) 0) + (set! (-> this ambients-played) 0) (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) (go flutflutegg-break #t) (go flutflutegg-idle) @@ -1381,9 +1381,9 @@ :post ja-post ) -(defmethod init-from-entity! harvester ((obj harvester) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! harvester ((this harvester) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind background)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1439,11 +1439,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *harvester-sg* '()) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *harvester-sg* '()) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (go harvester-idle) (none) ) diff --git a/goal_src/jak1/levels/beach/beach-rocks.gc b/goal_src/jak1/levels/beach/beach-rocks.gc index 8f25dd65ec..56334995a7 100644 --- a/goal_src/jak1/levels/beach/beach-rocks.gc +++ b/goal_src/jak1/levels/beach/beach-rocks.gc @@ -248,24 +248,27 @@ ) -(defmethod relocate beach-rock ((obj beach-rock) (arg0 int)) - (if (nonzero? (-> obj part-falling)) - (set! (-> obj part-falling) (the-as sparticle-launch-control (+ (the-as int (-> obj part-falling)) arg0))) +(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))) ) - (if (nonzero? (-> obj part-landing)) - (set! (-> obj part-landing) (the-as sparticle-launch-control (+ (the-as int (-> obj part-landing)) arg0))) + (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)) obj arg0)) + (the-as + beach-rock + ((the-as (function process-drawable int none) (find-parent-method beach-rock 7)) this arg0) + ) ) -(defmethod deactivate beach-rock ((obj beach-rock)) - (if (nonzero? (-> obj part-falling)) - (kill-and-free-particles (-> obj part-falling)) +(defmethod deactivate beach-rock ((this beach-rock)) + (if (nonzero? (-> this part-falling)) + (kill-and-free-particles (-> this part-falling)) ) - (if (nonzero? (-> obj part-landing)) - (kill-and-free-particles (-> obj part-landing)) + (if (nonzero? (-> this part-landing)) + (kill-and-free-particles (-> this part-landing)) ) - ((the-as (function process-drawable none) (find-parent-method beach-rock 10)) obj) + ((the-as (function process-drawable none) (find-parent-method beach-rock 10)) this) (none) ) @@ -360,7 +363,7 @@ ) ) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) - (set! (-> self movie-start) (-> *display* base-frame-counter)) + (set-time! (-> self movie-start)) (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) (ja-play-spooled-anim (new 'static 'spool-anim @@ -422,37 +425,37 @@ :post ja-post ) -(defmethod init-from-entity! beach-rock ((obj beach-rock) (arg0 entity-actor)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj align) (new 'process 'align-control obj)) - (set! (-> obj trigger) #f) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 553) obj)) - (set! (-> obj part-falling) (create-launch-control (-> *part-group-id-table* 554) obj)) - (set! (-> obj part-landing) (create-launch-control (-> *part-group-id-table* 555) obj)) - (set! (-> obj prev-frame) -1000.0) - (set! (-> obj draw origin-joint-index) (the-as uint 4)) - (case (get-task-status (-> obj entity extra perm task)) +(defmethod init-from-entity! beach-rock ((this beach-rock) (arg0 entity-actor)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this trigger) #f) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 553) this)) + (set! (-> this part-falling) (create-launch-control (-> *part-group-id-table* 554) this)) + (set! (-> this part-landing) (create-launch-control (-> *part-group-id-table* 555) this)) + (set! (-> this prev-frame) -1000.0) + (set! (-> this draw origin-joint-index) (the-as uint 4)) + (case (get-task-status (-> this entity extra perm task)) (((task-status invalid)) - (go (method-of-object obj fallen)) + (go (method-of-object this fallen)) ) (((task-status need-resolution)) (let ((s5-0 (new 'stack-no-clear 'vector))) (ja-post) - (vector<-cspace! s5-0 (-> obj node-list data 8)) + (vector<-cspace! s5-0 (-> this node-list data 8)) (birth-pickup-at-point s5-0 (pickup-type fuel-cell) - (the float (the-as int (-> obj entity extra perm task))) + (the float (the-as int (-> this entity extra perm task))) #f - obj + this (the-as fact-info #f) ) ) - (go (method-of-object obj fallen)) + (go (method-of-object this fallen)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -467,9 +470,9 @@ ) -(defmethod init-from-entity! lrocklrg ((obj lrocklrg) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! lrocklrg ((this lrocklrg) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -486,10 +489,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lrocklrg-sg* '()) - ((method-of-type beach-rock init-from-entity!) obj arg0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lrocklrg-sg* '()) + ((method-of-type beach-rock init-from-entity!) this arg0) (none) ) diff --git a/goal_src/jak1/levels/beach/bird-lady-beach.gc b/goal_src/jak1/levels/beach/bird-lady-beach.gc index 1753326b32..2cde3c5dec 100644 --- a/goal_src/jak1/levels/beach/bird-lady-beach.gc +++ b/goal_src/jak1/levels/beach/bird-lady-beach.gc @@ -44,21 +44,23 @@ ) ) -(defmethod play-anim! bird-lady-beach ((obj bird-lady-beach) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! bird-lady-beach ((this bird-lady-beach) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) - (set! (-> obj flutflut) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *flutflut-naked-sg* #f :to obj)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) + (set! (-> this flutflut) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *flutflut-naked-sg* #f :to this) + ) ) - (send-event (handle->process (-> obj flutflut)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj flutflut)) 'blend-shape #t) - (set! (-> obj egg) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *flutflutegg-sg* #f :to obj)) + (send-event (handle->process (-> this flutflut)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this flutflut)) 'blend-shape #t) + (set! (-> this egg) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *flutflutegg-sg* #f :to this)) ) - (send-event (handle->process (-> obj egg)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this egg)) 'anim-mode 'clone-anim) ) (new 'static 'spool-anim :name "bird-lady-beach-resolution" @@ -72,27 +74,27 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod get-art-elem bird-lady-beach ((obj bird-lady-beach)) - (-> obj draw art-group data 3) +(defmethod get-art-elem bird-lady-beach ((this bird-lady-beach)) + (-> this draw art-group data 3) ) -(defmethod should-display? bird-lady-beach ((obj bird-lady-beach)) - (= (current-status (-> obj tasks)) (task-status need-reward-speech)) +(defmethod should-display? bird-lady-beach ((this bird-lady-beach)) + (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) -(defmethod init-from-entity! bird-lady-beach ((obj bird-lady-beach) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *bird-lady-beach-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task beach-flutflut))) - (set! (-> obj sound-flava) (music-flava birdlady)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! bird-lady-beach ((this bird-lady-beach) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *bird-lady-beach-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task beach-flutflut))) + (set! (-> this sound-flava) (music-flava birdlady)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/beach/bird-lady.gc b/goal_src/jak1/levels/beach/bird-lady.gc index 15e4dfce81..574e18b500 100644 --- a/goal_src/jak1/levels/beach/bird-lady.gc +++ b/goal_src/jak1/levels/beach/bird-lady.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype bird-lady (process-taskable) () :heap-base #x110 @@ -23,10 +22,10 @@ :shadow bird-lady-shadow-mg ) -(defmethod process-taskable-method-52 bird-lady ((obj bird-lady)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 bird-lady ((this bird-lady)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0))) ) @@ -42,21 +41,21 @@ (none) ) -(defmethod draw-npc-shadow bird-lady ((obj bird-lady)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow bird-lady ((this bird-lady)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -65,11 +64,11 @@ (none) ) -(defmethod play-anim! bird-lady ((obj bird-lady) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! bird-lady ((this bird-lady) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "bird-lady-introduction" @@ -99,17 +98,17 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (if arg0 - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) (new 'static 'spool-anim :name "bird-lady-reminder-1" :index 5 :parts 4 :command-list '()) ) (else (if arg0 - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) (new 'static 'spool-anim :name "bird-lady-reminder-2" :index 6 :parts 5 :command-list '()) ) @@ -120,49 +119,49 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod get-art-elem bird-lady ((obj bird-lady)) - (-> obj draw art-group data 3) +(defmethod get-art-elem bird-lady ((this bird-lady)) + (-> this draw art-group data 3) ) -(defmethod process-taskable-method-43 bird-lady ((obj bird-lady)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 bird-lady ((this bird-lady)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) - (play-ambient (-> obj ambient) "BIR-LO02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIR-LO02" #f (-> this root-override trans)) ) ((< 0.33 f0-2) - (play-ambient (-> obj ambient) "BIR-LO03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIR-LO03" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "BIR-am08" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIR-am08" #f (-> this root-override trans)) ) ) ) ) ) -(defmethod target-above-threshold? bird-lady ((obj bird-lady)) +(defmethod target-above-threshold? bird-lady ((this bird-lady)) (the-as symbol (and *target* (< (-> (target-pos 0) z) -81920.0))) ) -(defmethod init-from-entity! bird-lady ((obj bird-lady) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *bird-lady-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task beach-flutflut))) - (set! (-> obj sound-flava) (music-flava birdlady)) - (set! (-> obj draw light-index) (the-as uint 4)) - (if (closed? (-> obj tasks) (game-task beach-flutflut) (task-status need-reminder)) - (cleanup-for-death obj) - (go (method-of-object obj idle)) +(defmethod init-from-entity! bird-lady ((this bird-lady) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *bird-lady-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task beach-flutflut))) + (set! (-> this sound-flava) (music-flava birdlady)) + (set! (-> this draw light-index) (the-as uint 4)) + (if (closed? (-> this tasks) (game-task beach-flutflut) (task-status need-reminder)) + (cleanup-for-death this) + (go (method-of-object this idle)) ) (none) ) diff --git a/goal_src/jak1/levels/beach/lurkercrab.gc b/goal_src/jak1/levels/beach/lurkercrab.gc index 40e4d4e759..babf4390dd 100644 --- a/goal_src/jak1/levels/beach/lurkercrab.gc +++ b/goal_src/jak1/levels/beach/lurkercrab.gc @@ -73,54 +73,54 @@ :bounds (static-spherem 0 0 0 2.5) ) -(defmethod touch-handler lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod touch-handler lurkercrab ((this lurkercrab) (arg0 process) (arg1 event-message-block)) + (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) (send-shove-back - (-> obj collide-info) + (-> this collide-info) arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 0.7 6144.0 16384.0 ) - (if (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) - (do-push-aways! (-> obj collide-info)) + (if (not (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf8))) + (do-push-aways! (-> this collide-info)) ) ) -(defmethod attack-handler lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block)) - (let ((s5-0 (-> obj incomming-attack-id))) - (set! (-> obj incomming-attack-id) (the-as handle (-> arg1 param 2))) +(defmethod attack-handler lurkercrab ((this lurkercrab) (arg0 process) (arg1 event-message-block)) + (let ((s5-0 (-> this incomming-attack-id))) + (set! (-> this incomming-attack-id) (the-as handle (-> arg1 param 2))) (let ((v1-1 (-> arg1 param 1))) (cond ((or (= v1-1 'flop) (= v1-1 'explode) (= v1-1 'darkeco)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj nav-enemy-die)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this nav-enemy-die)) ) ((= v1-1 'punch) (cond - ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj nav-enemy-die)) + ((logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this nav-enemy-die)) ) ((begin (let ((s4-0 (new 'stack-no-clear 'vector))) (let ((f30-0 (quaternion-xz-angle (target-rot)))) (set-vector! s4-0 (* 24576.0 (sin f30-0)) 0.0 (* 24576.0 (cos f30-0)) 1.0) ) - (vector+! s4-0 (-> obj collide-info trans) s4-0) - (set! (-> obj nav target-pos quad) (-> s4-0 quad)) + (vector+! s4-0 (-> this collide-info trans) s4-0) + (set! (-> this nav target-pos quad) (-> s4-0 quad)) ) (go lurkercrab-pushed) - (= s5-0 (-> obj incomming-attack-id)) + (= s5-0 (-> this incomming-attack-id)) ) 'push ) @@ -129,19 +129,19 @@ ) ) ) - ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj nav-enemy-die)) + ((logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this nav-enemy-die)) ) ((begin (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector-! s4-1 (-> obj collide-info trans) (target-pos 0)) + (vector-! s4-1 (-> this collide-info trans) (target-pos 0)) (vector-normalize! s4-1 24576.0) - (vector+! s4-1 (-> obj collide-info trans) s4-1) - (set! (-> obj nav target-pos quad) (-> s4-1 quad)) + (vector+! s4-1 (-> this collide-info trans) s4-1) + (set! (-> this nav target-pos quad) (-> s4-1 quad)) ) (go lurkercrab-pushed) - (= s5-0 (-> obj incomming-attack-id)) + (= s5-0 (-> this incomming-attack-id)) ) 'push ) @@ -155,33 +155,38 @@ nav-enemy-default-event-handler -(defmethod nav-enemy-method-37 lurkercrab ((obj lurkercrab)) - (when (-> obj orient) - (if (logtest? (nav-control-flags navcf19) (-> obj nav flags)) +(defmethod nav-enemy-method-37 lurkercrab ((this lurkercrab)) + (when (-> this orient) + (if (logtest? (nav-control-flags navcf19) (-> this nav flags)) (seek-to-point-toward-point! - (-> obj collide-info) - (-> obj nav target-pos) - (-> obj rotate-speed) - (-> obj turn-time) + (-> this collide-info) + (-> this nav target-pos) + (-> this rotate-speed) + (-> this turn-time) + ) + (seek-toward-heading-vec! + (-> this collide-info) + (-> this nav travel) + (-> this rotate-speed) + (-> this turn-time) ) - (seek-toward-heading-vec! (-> obj collide-info) (-> obj nav travel) (-> obj rotate-speed) (-> obj turn-time)) ) ) - (if (not (-> obj orient)) + (if (not (-> this orient)) (quaternion-rotate-y! - (-> obj collide-info quat) - (-> obj collide-info quat) - (* 163840.0 (-> *display* seconds-per-frame)) + (-> this collide-info quat) + (-> this collide-info quat) + (* 163840.0 (seconds-per-frame)) ) ) 0 (none) ) -(defmethod nav-enemy-method-38 lurkercrab ((obj lurkercrab)) +(defmethod nav-enemy-method-38 lurkercrab ((this lurkercrab)) (integrate-for-enemy-with-move-to-ground! - (-> obj collide-info) - (-> obj collide-info transv) + (-> this collide-info) + (-> this collide-info transv) (collide-kind background) 8192.0 #f @@ -204,8 +209,8 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.075)) (loop (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 3)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 3)) (suspend) ) ) @@ -215,8 +220,8 @@ nav-enemy-default-event-handler (ja :num! (seek! (ja-aframe 19.0 0))) ) (ja :num-func num-func-identity :frame-num (ja-aframe 19.0 0)) - (let ((gp-5 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 1)) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 1)) (suspend) ) ) @@ -285,8 +290,8 @@ nav-enemy-default-event-handler (nav-enemy-rnd-int-range 2 6) (until (not (nav-enemy-rnd-go-idle? 0.2)) (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 2)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 2)) (suspend) ) ) @@ -420,10 +425,10 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-channel-push! 1 (seconds 0.075)) (ja :group! (-> self draw art-group data (-> self nav-info victory-anim))) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) @@ -445,13 +450,13 @@ nav-enemy-default-event-handler (suspend) (ja :num! (seek! (ja-aframe 18.0 0) 0.75)) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.25)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.25)) (suspend) ) ) - (let ((gp-3 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-3) (seconds 0.1)) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 0.1)) (suspend) ) ) @@ -520,8 +525,8 @@ nav-enemy-default-event-handler ) ) -(defmethod init-from-entity! lurkercrab ((obj lurkercrab) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! lurkercrab ((this lurkercrab) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -560,17 +565,17 @@ nav-enemy-default-event-handler ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lurkercrab-sg* '()) - (init-defaults! obj *lurkercrab-nav-enemy-info*) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 159) obj)) - (set! (-> obj orient) #t) - (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5 navenmf6)) - (set! (-> obj target-speed) 0.0) - (set! (-> obj momentum-speed) 0.0) - (set! (-> obj draw force-lod) 2) - (go (method-of-object obj nav-enemy-idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lurkercrab-sg* '()) + (init-defaults! this *lurkercrab-nav-enemy-info*) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 159) this)) + (set! (-> this orient) #t) + (logclear! (-> this nav-enemy-flags) (nav-enemy-flags navenmf5 navenmf6)) + (set! (-> this target-speed) 0.0) + (set! (-> this momentum-speed) 0.0) + (set! (-> this draw force-lod) 2) + (go (method-of-object this nav-enemy-idle)) (none) ) diff --git a/goal_src/jak1/levels/beach/lurkerpuppy.gc b/goal_src/jak1/levels/beach/lurkerpuppy.gc index 7c1694fc81..c9e4d05521 100644 --- a/goal_src/jak1/levels/beach/lurkerpuppy.gc +++ b/goal_src/jak1/levels/beach/lurkerpuppy.gc @@ -103,9 +103,9 @@ nav-enemy-default-event-handler (ja :group! lurkerpuppy-idle-ja) (ja :num-func num-func-identity :frame-num 0.0) (let ((gp-2 (rand-vu-int-range 750 900)) - (s5-0 (-> *display* base-frame-counter)) + (s5-0 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) s5-0) gp-2) + (until (time-elapsed? s5-0 gp-2) (ja :num! (loop!)) (ja-blend-eval) (suspend) @@ -235,8 +235,8 @@ nav-enemy-default-event-handler ) ) -(defmethod initialize-collision lurkerpuppy ((obj lurkerpuppy)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision lurkerpuppy ((this lurkerpuppy)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -252,19 +252,19 @@ nav-enemy-default-event-handler ) (set! (-> s5-0 nav-radius) 2048.0) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod nav-enemy-method-48 lurkerpuppy ((obj lurkerpuppy)) - (initialize-skeleton obj *lurkerpuppy-sg* '()) - (init-defaults! obj *lurkerpuppy-nav-enemy-info*) - (when (nonzero? (-> obj neck)) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 lurkerpuppy ((this lurkerpuppy)) + (initialize-skeleton this *lurkerpuppy-sg* '()) + (init-defaults! this *lurkerpuppy-nav-enemy-info*) + (when (nonzero? (-> this neck)) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) ) 0 (none) diff --git a/goal_src/jak1/levels/beach/lurkerworm.gc b/goal_src/jak1/levels/beach/lurkerworm.gc index d400b74862..b416a2b558 100644 --- a/goal_src/jak1/levels/beach/lurkerworm.gc +++ b/goal_src/jak1/levels/beach/lurkerworm.gc @@ -36,21 +36,21 @@ ) -(defmethod relocate lurkerworm ((obj lurkerworm) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate lurkerworm ((this lurkerworm) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj twister)) - (&+! (-> obj twister) arg0) + (if (nonzero? (-> this twister)) + (&+! (-> this twister) arg0) ) - (the-as lurkerworm ((method-of-type process-drawable relocate) obj arg0)) + (the-as lurkerworm ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate lurkerworm ((obj lurkerworm)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate lurkerworm ((this lurkerworm)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -201,18 +201,18 @@ :init-specs ((:fade-a -0.10666667)) ) -(defmethod lurkerworm-method-20 lurkerworm ((obj lurkerworm)) +(defmethod lurkerworm-method-20 lurkerworm ((this lurkerworm)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (target-pos 0) (-> obj root-override trans)) - (set-target! (-> obj twister) (atan (-> s5-0 x) (-> s5-0 z))) - (twister-method-11 (-> obj twister)) + (vector-! s5-0 (target-pos 0) (-> this root-override trans)) + (set-target! (-> this twister) (atan (-> s5-0 x) (-> s5-0 z))) + (twister-method-11 (-> this twister)) (let* ((f0-5 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) (f0-6 (atan (-> s5-0 y) f0-5)) ) - (seek! (-> obj head-tilt) f0-6 (* 5461.3335 (-> *display* seconds-per-frame))) + (seek! (-> this head-tilt) f0-6 (* 5461.3335 (seconds-per-frame))) ) ) - (set! (-> obj head-tilt) (fmin 8192.0 (fmax -5461.3335 (-> obj head-tilt)))) + (set! (-> this head-tilt) (fmin 8192.0 (fmax -5461.3335 (-> this head-tilt)))) 0 (none) ) @@ -237,17 +237,17 @@ (none) ) -(defmethod particle-effect lurkerworm ((obj lurkerworm)) - (let ((a2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 5)))) +(defmethod particle-effect lurkerworm ((this lurkerworm)) + (let ((a2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 5)))) (launch-particles (-> *part-id-table* 661) a2-0) ) - (let ((a2-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 6)))) + (let ((a2-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 6)))) (launch-particles (-> *part-id-table* 661) a2-1) ) - (let ((a2-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7)))) + (let ((a2-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7)))) (launch-particles (-> *part-id-table* 661) a2-2) ) - (let ((a2-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8)))) + (let ((a2-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8)))) (launch-particles (-> *part-id-table* 661) a2-3) ) 0 @@ -287,11 +287,11 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter (behavior () (ja-channel-set! 0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (loop - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -306,7 +306,7 @@ lurkerworm-default-post-behavior (defstate lurkerworm-spot (lurkerworm) :event lurkerworm-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sound-play "worm-rise1") ) :code (behavior () @@ -314,7 +314,7 @@ lurkerworm-default-post-behavior (loop (spawn (-> self part) (-> self root-override trans)) (particle-effect self) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (if (and *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (go lurkerworm-rise) (go lurkerworm-idle) @@ -329,7 +329,7 @@ lurkerworm-default-post-behavior (defstate lurkerworm-rise (lurkerworm) :event lurkerworm-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (ja-channel-set! 1) @@ -349,7 +349,7 @@ lurkerworm-default-post-behavior (defstate lurkerworm-rest (lurkerworm) :event lurkerworm-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self vulnerable) #t) ) :exit (behavior () @@ -429,7 +429,7 @@ lurkerworm-default-post-behavior (defstate lurkerworm-sink (lurkerworm) :event lurkerworm-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (ja-no-eval :group! lurkerworm-sink-ja :num! (seek!) :frame-num 0.0) @@ -463,9 +463,9 @@ lurkerworm-default-post-behavior :post lurkerworm-default-post-behavior ) -(defmethod init-from-entity! lurkerworm ((obj lurkerworm) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! lurkerworm ((this lurkerworm) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -533,24 +533,24 @@ lurkerworm-default-post-behavior ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lurkerworm-sg* '()) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lurkerworm-sg* '()) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj angle) 0.0) - (set! (-> obj vulnerable) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 157) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 158) obj)) - (set! (-> obj twister) (new 'process 'twister 3 15 1092.2667 72.81778 0.25 0.001)) - (twister-method-9 (-> obj twister) 3 9 910.2222) - (set! (-> obj head-tilt) 0.0) - (set! (-> obj skel prebind-function) lurkerworm-prebind-function) - (set! (-> obj skel postbind-function) lurkerworm-joint-callback) - (set! (-> obj root-override nav-radius) 12288.0) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (set! (-> this angle) 0.0) + (set! (-> this vulnerable) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 157) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 158) this)) + (set! (-> this twister) (new 'process 'twister 3 15 1092.2667 72.81778 0.25 0.001)) + (twister-method-9 (-> this twister) 3 9 910.2222) + (set! (-> this head-tilt) 0.0) + (set! (-> this skel prebind-function) lurkerworm-prebind-function) + (set! (-> this skel postbind-function) lurkerworm-joint-callback) + (set! (-> this root-override nav-radius) 12288.0) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) (go lurkerworm-idle) (none) ) diff --git a/goal_src/jak1/levels/beach/mayor.gc b/goal_src/jak1/levels/beach/mayor.gc index 0374fd7525..d91caa3cce 100644 --- a/goal_src/jak1/levels/beach/mayor.gc +++ b/goal_src/jak1/levels/beach/mayor.gc @@ -22,10 +22,10 @@ :shadow mayor-shadow-mg ) -(defmethod process-taskable-method-52 mayor ((obj mayor)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 mayor ((this mayor)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -38,21 +38,21 @@ (none) ) -(defmethod draw-npc-shadow mayor ((obj mayor)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow mayor ((this mayor)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (set! (-> v1-14 settings flags) (the-as shadow-flags (logior (the-as int (-> v1-14 settings flags)) 32))) ) 0 @@ -76,17 +76,17 @@ ) ) -(defmethod play-anim! mayor ((obj mayor) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! mayor ((this mayor) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 (close-specific-task! (game-task jungle-lurkerm) (task-status need-introduction)) (close-specific-task! (game-task village1-mayor-money) (task-status need-introduction)) ) (cond - ((closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder)) - (mayor-lurkerm-reward-speech obj arg0) + ((closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder)) + (mayor-lurkerm-reward-speech this arg0) ) (else (new 'static 'spool-anim :name "mayor-introduction" :index 4 :parts 16 :command-list '()) @@ -178,9 +178,9 @@ ) ) (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reward-speech)) (new 'static 'spool-anim :name "mayor-reminder-donation" :index 6 @@ -263,7 +263,7 @@ ) ) ) - ((closed? (-> obj tasks) (game-task village1-mayor-money) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task village1-mayor-money) (task-status need-reward-speech)) (new 'static 'spool-anim :name "mayor-reminder-beams" :index 5 @@ -346,9 +346,9 @@ ) ) ) - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (if arg0 - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) (new 'static 'spool-anim :name "mayor-reminder-beams" @@ -434,7 +434,7 @@ ) (else (if arg0 - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) (new 'static 'spool-anim :name "mayor-reminder-donation" @@ -522,21 +522,21 @@ ) (((task-status need-reward-speech)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task jungle-lurkerm)) - (mayor-lurkerm-reward-speech obj arg0) + (mayor-lurkerm-reward-speech this arg0) ) (else (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) ) (else - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (new 'static 'spool-anim @@ -628,67 +628,67 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod get-art-elem mayor ((obj mayor)) - (-> obj draw art-group data 3) +(defmethod get-art-elem mayor ((this mayor)) + (-> this draw art-group data 3) ) -(defmethod should-display? mayor ((obj mayor)) +(defmethod should-display? mayor ((this mayor)) (if *target* - (< (- (-> (target-pos 0) z) (-> obj root-override trans z)) 57344.0) - (< (- (-> (camera-pos) z) (-> obj root-override trans z)) 57344.0) + (< (- (-> (target-pos 0) z) (-> this root-override trans z)) 57344.0) + (< (- (-> (camera-pos) z) (-> this root-override trans z)) 57344.0) ) ) -(defmethod process-taskable-method-43 mayor ((obj mayor)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 mayor ((this mayor)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-LO01" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-LO01" #f (-> this root-override trans)) ) ) ((< 0.7777778 f0-2) - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-LO02" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-LO02" #f (-> this root-override trans)) ) ) ((< 0.6666667 f0-2) - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-AM07" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-AM07" #f (-> this root-override trans)) ) ) ((< 0.5555556 f0-2) - (play-ambient (-> obj ambient) "CHI-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "CHI-AM06" #f (-> this root-override trans)) ) ((< 0.44444445 f0-2) - (play-ambient (-> obj ambient) "CHI-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "CHI-AM05" #f (-> this root-override trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "CHI-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "CHI-AM04" #f (-> this root-override trans)) ) ((< 0.22222222 f0-2) - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-AM03" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-AM03" #f (-> this root-override trans)) ) ) ((< 0.11111111 f0-2) - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-AM02" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-AM02" #f (-> this root-override trans)) ) ) (else - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-AM01" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-AM01" #f (-> this root-override trans)) ) ) ) @@ -714,12 +714,12 @@ ) ) -(defmethod init-from-entity! mayor ((obj mayor) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *mayor-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) - (set! (-> obj bounce-away) #f) - (set! (-> obj tasks) (get-task-control (game-task jungle-lurkerm))) - (set! (-> obj sound-flava) (music-flava mayor)) - (set! (-> obj draw light-index) (the-as uint 2)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! mayor ((this mayor) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *mayor-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) + (set! (-> this bounce-away) #f) + (set! (-> this tasks) (get-task-control (game-task jungle-lurkerm))) + (set! (-> this sound-flava) (music-flava mayor)) + (set! (-> this draw light-index) (the-as uint 2)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/beach/pelican.gc b/goal_src/jak1/levels/beach/pelican.gc index 0ccc3a55f8..1b948f8fb2 100644 --- a/goal_src/jak1/levels/beach/pelican.gc +++ b/goal_src/jak1/levels/beach/pelican.gc @@ -83,21 +83,21 @@ ) -(defmethod relocate pelican ((obj pelican) (arg0 int)) +(defmethod relocate pelican ((this pelican) (arg0 int)) (countdown (v1-0 8) - (if (nonzero? (-> obj path-data v1-0)) - (&+! (-> obj path-data v1-0) arg0) + (if (nonzero? (-> this path-data v1-0)) + (&+! (-> this path-data v1-0) arg0) ) ) - (if (nonzero? (-> obj path-cache)) - (&+! (-> obj path-cache) arg0) + (if (nonzero? (-> this path-cache)) + (&+! (-> this path-cache) arg0) ) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) + (if (nonzero? (-> this neck)) + (&+! (-> this neck) arg0) ) (the-as pelican - ((the-as (function process-drawable int process-drawable) (find-parent-method pelican 7)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method pelican 7)) this arg0) ) ) @@ -232,7 +232,7 @@ ) :trans (behavior () (pelican-path-update 728177.75 30 1.0 (/ (-> self path-max) (path-distance (-> self path))) #f) - (let ((f0-3 (+ (-> self path-pos) (* (-> self path-speed) (-> *display* seconds-per-frame)))) + (let ((f0-3 (+ (-> self path-pos) (* (-> self path-speed) (seconds-per-frame)))) (f1-2 (-> self path-max)) ) (set! (-> self path-pos) (- f0-3 (* (the float (the int (/ f0-3 f1-2))) f1-2))) @@ -323,7 +323,7 @@ :enter (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) (init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f)) (set! (-> self state-object) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set-roll-to-grav-2! (-> self root-override) 0.0) (let ((a0-4 (handle->process (-> self fuel-cell)))) (cond @@ -355,7 +355,7 @@ (go pelican-fly-to-end (-> self path-to-nest2) (-> *PELICAN-bank* run-away-time)) ) (pelican-path-update 364088.88 30 0.0 0.0 #t) - (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-to-nest (-> self path-cache) (the-as int (-> self time-cache))) ) @@ -398,7 +398,7 @@ ) :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) - (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-wait-at-nest #f) ) @@ -504,7 +504,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> self root-override trans quad)) - (vector-seek! gp-0 a1-0 (* (-> self state-float 0) (-> *display* seconds-per-frame))) + (vector-seek! gp-0 a1-0 (* (-> self state-float 0) (seconds-per-frame))) (move-to-point! (-> self root-override) gp-0) ) (do-push-aways! (-> self root-override)) @@ -691,7 +691,7 @@ ) :trans (behavior () (pelican-path-update 131072.0 150 0.0 0.0 #f) - (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-dive (-> self path-dive1) (-> self path-to-nest1) (-> *PELICAN-bank* to-nest1-time)) ) @@ -712,7 +712,7 @@ (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 0) 10) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self path) arg0) (set! (-> self path-pos) 0.0) (set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1))) @@ -726,14 +726,12 @@ ) :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) - (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-wait-at-end #f) ) - (when (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int (-> self state-float 1))) - (set! (-> self state-float 0) - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self state-float 1)) - ) + (when (not (time-elapsed? (-> self state-time) (the int (-> self state-float 1)))) + (set! (-> self state-float 0) (/ (the float (- (current-time) (-> self state-time))) (-> self state-float 1))) (vector-lerp! (-> self root-override trans) (-> self state-vector) @@ -812,9 +810,9 @@ :post ja-post ) -(defmethod init-from-entity! pelican ((obj pelican) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! pelican ((this pelican) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -830,31 +828,31 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *pelican-sg* '()) - (set! (-> obj draw shadow-ctrl) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *pelican-sg* '()) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -81920.0 4096.0 614400.0 (the-as float 25) 409600.0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj align) (new 'process 'align-control obj)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this align) (new 'process 'align-control this)) (dotimes (s5-1 8) - (let ((v1-27 (new 'process 'curve-control obj 'path (the float (+ s5-1 1))))) - (set! (-> obj path-data s5-1) v1-27) + (let ((v1-27 (new 'process 'curve-control this 'path (the float (+ s5-1 1))))) + (set! (-> this path-data s5-1) v1-27) (logior! (-> v1-27 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) - (set! (-> obj fuel-cell) (the-as handle #f)) - (set! (-> obj cam-tracker) (the-as handle #f)) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 9)) - (set-vector! (-> obj neck twist-max) 2730.6667 2730.6667 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 61440.0) - (set! (-> obj neck ignore-angle) 16384.0) - (case (-> obj entity extra perm user-int8 0) + (set! (-> this fuel-cell) (the-as handle #f)) + (set! (-> this cam-tracker) (the-as handle #f)) + (set! (-> this neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) this 9)) + (set-vector! (-> this neck twist-max) 2730.6667 2730.6667 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 61440.0) + (set! (-> this neck ignore-angle) 16384.0) + (case (-> this entity extra perm user-int8 0) ((10) (go pelican-wait-at-end #t) ) @@ -863,18 +861,18 @@ ) ((2) (let ((s5-2 (manipy-spawn - (-> obj root-override trans) - (-> obj entity) + (-> this root-override trans) + (-> this entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) - :to obj + :to this ) ) ) - (set! (-> obj fuel-cell) (if s5-2 - (ppointer->handle s5-2) - (the-as handle #f) - ) + (set! (-> this fuel-cell) (if s5-2 + (ppointer->handle s5-2) + (the-as handle #f) + ) ) (when s5-2 (send-event diff --git a/goal_src/jak1/levels/beach/sculptor.gc b/goal_src/jak1/levels/beach/sculptor.gc index 46833af631..3a9a37d923 100644 --- a/goal_src/jak1/levels/beach/sculptor.gc +++ b/goal_src/jak1/levels/beach/sculptor.gc @@ -29,10 +29,10 @@ :shadow sculptor-shadow-mg ) -(defmethod process-taskable-method-52 sculptor ((obj sculptor)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 sculptor ((this sculptor)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -45,21 +45,21 @@ (none) ) -(defmethod draw-npc-shadow sculptor ((obj sculptor)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow sculptor ((this sculptor)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -92,11 +92,11 @@ ) ) -(defmethod play-anim! sculptor ((obj sculptor) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! sculptor ((this sculptor) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "sculptor-introduction" @@ -123,23 +123,25 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (new 'static 'spool-anim :name "sculptor-reminder-1" :index 17 :parts 2 :command-list '()) ) (((task-status need-reward-speech)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) - (set! (-> obj muse) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *sculptor-muse-sg* #f :to obj)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) + (set! (-> this muse) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *sculptor-muse-sg* #f :to this) + ) ) - (let ((v1-18 (handle->process (-> obj muse)))) + (let ((v1-18 (handle->process (-> this muse)))) (if v1-18 (set! (-> (the-as muse v1-18) draw light-index) (the-as uint 3)) ) ) - (send-event (handle->process (-> obj muse)) 'center-joint 4) - (send-event (handle->process (-> obj muse)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this muse)) 'center-joint 4) + (send-event (handle->process (-> this muse)) 'anim-mode 'clone-anim) ) (new 'static 'spool-anim :name "sculptor-resolution" @@ -153,50 +155,50 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) -(defmethod get-art-elem sculptor ((obj sculptor)) - (case (current-status (-> obj tasks)) +(defmethod get-art-elem sculptor ((this sculptor)) + (case (current-status (-> this tasks)) (((task-status invalid) (task-status need-resolution)) - (-> obj draw art-group data 11) + (-> this draw art-group data 11) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod process-taskable-method-43 sculptor ((obj sculptor)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 sculptor ((this sculptor)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> obj ambient) "SCU-LO01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-LO01" #f (-> this root-override trans)) ) ((< 0.71428573 f0-2) - (play-ambient (-> obj ambient) "SCU-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM05" #f (-> this root-override trans)) ) ((< 0.5714286 f0-2) - (play-ambient (-> obj ambient) "SCU-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM06" #f (-> this root-override trans)) ) ((< 0.42857143 f0-2) - (play-ambient (-> obj ambient) "SCU-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM03" #f (-> this root-override trans)) ) ((< 0.2857143 f0-2) - (play-ambient (-> obj ambient) "SCU-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM04" #f (-> this root-override trans)) ) ((< 0.14285715 f0-2) - (play-ambient (-> obj ambient) "SCU-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM01" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "SCU-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM02" #f (-> this root-override trans)) ) ) ) @@ -343,12 +345,12 @@ ) ) -(defmethod init-from-entity! sculptor ((obj sculptor) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sculptor-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task misty-muse))) - (set! (-> obj muse) (the-as handle #f)) - (set! (-> obj sound-flava) (music-flava sculptor)) - (set! (-> obj draw light-index) (the-as uint 3)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! sculptor ((this sculptor) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sculptor-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task misty-muse))) + (set! (-> this muse) (the-as handle #f)) + (set! (-> this sound-flava) (music-flava sculptor)) + (set! (-> this draw light-index) (the-as uint 3)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/beach/seagull.gc b/goal_src/jak1/levels/beach/seagull.gc index 9356e89bd1..8c437a070f 100644 --- a/goal_src/jak1/levels/beach/seagull.gc +++ b/goal_src/jak1/levels/beach/seagull.gc @@ -79,7 +79,7 @@ ((self-override seagullflock :offset 28) (path path-control :offset-assert 112) (trans vector :inline :offset-assert 128) - (bird (pointer seagull) SEAGULLFLOCK_MAX :offset-assert 144) + (bird (pointer seagull) 64 :offset-assert 144) (birds int32 :offset-assert 400) (link actor-link-info :offset-assert 404) (bird-at-waterfall uint64 :offset-assert 408) @@ -109,24 +109,24 @@ ) -(defmethod relocate seagullflock ((obj seagullflock) (arg0 int)) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) +(defmethod relocate seagullflock ((this seagullflock) (arg0 int)) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - (if (nonzero? (-> obj link)) - (&+! (-> obj link) arg0) + (if (nonzero? (-> this link)) + (&+! (-> this link) arg0) ) - (if (nonzero? (-> obj squall)) - (&+! (-> obj squall) arg0) + (if (nonzero? (-> this squall)) + (&+! (-> this squall) arg0) ) - (the-as seagullflock ((method-of-type process relocate) obj arg0)) + (the-as seagullflock ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate seagullflock ((obj seagullflock)) - (if (nonzero? (-> obj squall)) - (stop! (-> obj squall)) +(defmethod deactivate seagullflock ((this seagullflock)) + (if (nonzero? (-> this squall)) + (stop! (-> this squall)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -190,11 +190,11 @@ :bounds (static-spherem 0 0 0 2) ) -(defmethod seagull-method-25 seagull ((obj seagull) (arg0 float)) - (let ((f1-1 (the float (sar (shl (the int (- arg0 (-> obj heading))) 48) 48))) - (f0-5 (- (-> obj tilt))) +(defmethod seagull-method-25 seagull ((this seagull) (arg0 float)) + (let ((f1-1 (the float (sar (shl (the int (- arg0 (-> this heading))) 48) 48))) + (f0-5 (- (-> this tilt))) ) - (let ((f2-0 (-> obj max-tilt))) + (let ((f2-0 (-> this max-tilt))) (set! f0-5 (cond ((< f1-1 -364.0889) (if (< (- f2-0) f0-5) @@ -217,29 +217,29 @@ ) ) ) - (set! (-> obj tilt) (- f0-5)) - (set! (-> obj heading) (the float (sar (shl (the int (+ (-> obj heading) (* 0.05 f0-5))) 48) 48))) + (set! (-> this tilt) (- f0-5)) + (set! (-> this heading) (the float (sar (shl (the int (+ (-> this heading) (* 0.05 f0-5))) 48) 48))) ) 0 (none) ) -(defmethod seagull-method-24 seagull ((obj seagull)) +(defmethod seagull-method-24 seagull ((this seagull)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> obj flock 0 target) (-> obj root-override trans)) + (vector-! s5-0 (-> this flock 0 target) (-> this root-override trans)) (when (< (vector-dot s5-0 s5-0) 6710886400.0) - (let ((v1-5 (ash 1 (-> obj index)))) - (when (not (logtest? v1-5 (-> obj flock 0 bird-at-waterfall))) - (logior! (-> obj flock 0 bird-at-waterfall) v1-5) - (+! (-> obj flock 0 birds-at-waterfall) 1) + (let ((v1-5 (ash 1 (-> this index)))) + (when (not (logtest? v1-5 (-> this flock 0 bird-at-waterfall))) + (logior! (-> this flock 0 bird-at-waterfall) v1-5) + (+! (-> this flock 0 birds-at-waterfall) 1) ) ) ) (cond - ((> (-> obj temp-heading-time) 0) - (+! (-> obj temp-heading-time) -1) - (let* ((v1-15 obj) - (f1-2 (the float (sar (shl (the int (- (-> obj temp-heading) (-> v1-15 heading))) 48) 48))) + ((> (-> this temp-heading-time) 0) + (+! (-> this temp-heading-time) -1) + (let* ((v1-15 this) + (f1-2 (the float (sar (shl (the int (- (-> this temp-heading) (-> v1-15 heading))) 48) 48))) (f0-7 (- (-> v1-15 tilt))) ) (let ((f2-0 (-> v1-15 max-tilt))) @@ -272,7 +272,7 @@ ) (else (let* ((f0-15 (atan (-> s5-0 x) (-> s5-0 z))) - (v1-18 obj) + (v1-18 this) (f1-12 (the float (sar (shl (the int (- f0-15 (-> v1-18 heading))) 48) 48))) (f0-20 (- (-> v1-18 tilt))) ) @@ -306,8 +306,9 @@ ) ) (let ((f0-28 (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) - (set! (-> obj angletan) (/ (- (-> s5-0 y)) (sqrtf f0-28))) - (set! (-> obj target-dist) (* DISPLAY_FPS_RATIO (sqrtf (+ f0-28 (* (-> s5-0 y) (-> s5-0 y)))))) ;; og:preserve-this changed for high fps + (set! (-> this angletan) (/ (- (-> s5-0 y)) (sqrtf f0-28))) + ;; og:preserve-this changed for high fps + (set! (-> this target-dist) (* DISPLAY_FPS_RATIO (sqrtf (+ f0-28 (* (-> s5-0 y) (-> s5-0 y)))))) ) ) 0 @@ -453,11 +454,11 @@ :post seagull-post ) -(defmethod move-vertically! seagull ((obj seagull) (arg0 symbol)) - (let ((f0-0 (-> obj root-override transv y))) +(defmethod move-vertically! seagull ((this seagull) (arg0 symbol)) + (let ((f0-0 (-> this root-override transv y))) (set! f0-0 (cond (arg0 - (if (< f0-0 (-> obj flock 0 max-lift)) + (if (< f0-0 (-> this flock 0 max-lift)) (set! f0-0 (+ 12288.0 f0-0)) ) f0-0 @@ -467,66 +468,69 @@ ) ) ) - (set! (-> obj root-override transv y) (* DISPLAY_FPS_RATIO f0-0)) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (set! (-> this root-override transv y) (* DISPLAY_FPS_RATIO f0-0)) ) 0 (none) ) -(defmethod seagull-method-26 seagull ((obj seagull)) +(defmethod seagull-method-26 seagull ((this seagull)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((f30-0 -4096.0) (f28-0 8192.0) ) - (set! (-> s5-0 x) (+ f30-0 (* f28-0 (rand-float-gen)) (-> obj flock 0 target x))) + (set! (-> s5-0 x) (+ f30-0 (* f28-0 (rand-float-gen)) (-> this flock 0 target x))) ) (let ((f30-1 -4096.0) (f28-1 8192.0) ) - (set! (-> s5-0 y) (+ f30-1 (* f28-1 (rand-float-gen)) (-> obj flock 0 target y))) + (set! (-> s5-0 y) (+ f30-1 (* f28-1 (rand-float-gen)) (-> this flock 0 target y))) ) (let ((f30-2 -4096.0) (f28-2 8192.0) ) - (set! (-> s5-0 z) (+ f30-2 (* f28-2 (rand-float-gen)) (-> obj flock 0 target z))) + (set! (-> s5-0 z) (+ f30-2 (* f28-2 (rand-float-gen)) (-> this flock 0 target z))) ) - (vector-! s5-0 s5-0 (-> obj root-override trans)) + (vector-! s5-0 s5-0 (-> this root-override trans)) (vector-float*! s5-0 s5-0 0.9) - (move-by-vector! (-> obj root-override) s5-0) + (move-by-vector! (-> this root-override) s5-0) ) - (set! (-> obj teleport) #f) + (set! (-> this teleport) #f) #f ) -(defmethod adjust-heading-around-point-slow! seagull ((obj seagull) (arg0 float)) - (let ((f30-1 (* arg0 (sin (-> obj heading)))) - (f0-4 (* arg0 (cos (-> obj heading)))) +(defmethod adjust-heading-around-point-slow! seagull ((this seagull) (arg0 float)) + (let ((f30-1 (* arg0 (sin (-> this heading)))) + (f0-4 (* arg0 (cos (-> this heading)))) ) - (set! (-> obj root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> obj root-override transv x)) (* 0.2 f30-1)))) ;; og:preserve-this changed for high fps - (set! (-> obj root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> obj root-override transv z)) (* 0.2 f0-4)))) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (set! (-> this root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> this root-override transv x)) (* 0.2 f30-1)))) + (set! (-> this root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> this root-override transv z)) (* 0.2 f0-4)))) ) 0 (none) ) -(defmethod adjust-heading-around-point! seagull ((obj seagull) (arg0 float)) - (let ((f30-1 (* arg0 (sin (-> obj heading)))) - (f0-4 (* arg0 (cos (-> obj heading)))) +(defmethod adjust-heading-around-point! seagull ((this seagull) (arg0 float)) + (let ((f30-1 (* arg0 (sin (-> this heading)))) + (f0-4 (* arg0 (cos (-> this heading)))) ) - (set! (-> obj root-override transv x) (* DISPLAY_FPS_RATIO f30-1)) ;; og:preserve-this changed for high fps - (set! (-> obj root-override transv z) (* DISPLAY_FPS_RATIO f0-4)) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (set! (-> this root-override transv x) (* DISPLAY_FPS_RATIO f30-1)) + (set! (-> this root-override transv z) (* DISPLAY_FPS_RATIO f0-4)) ) 0 (none) ) -(defmethod seagull-method-22 seagull ((obj seagull)) - (set! (-> obj root-override transv y) -8192.0) +(defmethod seagull-method-22 seagull ((this seagull)) + (set! (-> this root-override transv y) -8192.0) 0 (none) ) -(defmethod seagull-method-27 seagull ((obj seagull)) +(defmethod seagull-method-27 seagull ((this seagull)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -534,13 +538,13 @@ ) (init-vf0-vector) (let ((v1-0 (new 'stack-no-clear 'vector)) - (a0-2 (-> obj root-override trans)) - (s5-0 (-> obj root-override transv)) + (a0-2 (-> this root-override trans)) + (s5-0 (-> this root-override transv)) (a1-1 (new 'stack-no-clear 'vector)) ) (let ((a2-0 v1-0)) (.lvf vf1 (&-> s5-0 quad)) - (let ((f0-0 (-> *display* seconds-per-frame))) + (let ((f0-0 (seconds-per-frame))) (.mov at-0 f0-0) ) (.mov vf2 at-0) @@ -550,8 +554,8 @@ ) (vector+! a1-1 a0-2 v1-0) (if (points-in-air? a0-2 a1-1 *seagull-boxes* 10) - (integrate-no-collide! (-> obj root-override) (-> obj root-override transv)) - (fill-cache-integrate-and-collide! (-> obj root-override) s5-0 (collide-kind background)) + (integrate-no-collide! (-> this root-override) (-> this root-override transv)) + (fill-cache-integrate-and-collide! (-> this root-override) s5-0 (collide-kind background)) ) ) (none) @@ -560,13 +564,13 @@ (defstate seagull-takeoff (seagull) :trans (behavior () - (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) + (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) ) :code (behavior () - (set! (-> self part-time) (-> *display* base-frame-counter)) + (set-time! (-> self part-time)) (ja-no-eval :group! seagull-takeoff-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) (ja-aframe 2.0 0)) (>= (ja-aframe 3.0 0) (ja-frame-num 0))) @@ -586,7 +590,8 @@ ) ) ) - (set! (-> v1-13 root-override transv y) (* DISPLAY_FPS_RATIO f0-5)) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (set! (-> v1-13 root-override transv y) (* DISPLAY_FPS_RATIO f0-5)) ) 0 (let* ((gp-1 self) @@ -594,8 +599,9 @@ (f30-2 (* f28-0 (sin (-> gp-1 heading)))) (f0-10 (* f28-0 (cos (-> gp-1 heading)))) ) - (set! (-> gp-1 root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-2)))) ;; og:preserve-this changed for high fps - (set! (-> gp-1 root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-10)))) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (set! (-> gp-1 root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-2)))) + (set! (-> gp-1 root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-10)))) ) 0 ) @@ -612,7 +618,7 @@ (defstate seagull-flying (seagull) :trans (behavior () - (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) + (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) @@ -713,7 +719,8 @@ ) (let ((f0-33 (+ (* (-> s4-0 x) (-> s4-0 x)) (* (-> s4-0 z) (-> s4-0 z))))) (set! (-> s5-0 angletan) (/ (- (-> s4-0 y)) (sqrtf f0-33))) - (set! (-> s5-0 target-dist) (* DISPLAY_FPS_RATIO (sqrtf (+ f0-33 (* (-> s4-0 y) (-> s4-0 y)))))) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (set! (-> s5-0 target-dist) (* DISPLAY_FPS_RATIO (sqrtf (+ f0-33 (* (-> s4-0 y) (-> s4-0 y)))))) ) ) 0 @@ -736,7 +743,8 @@ ) ) ) - (set! (-> v1-44 root-override transv y) (* DISPLAY_FPS_RATIO f0-38)) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (set! (-> v1-44 root-override transv y) (* DISPLAY_FPS_RATIO f0-38)) ) 0 ) @@ -757,7 +765,8 @@ ) ) ) - (set! (-> v1-48 root-override transv y) (* DISPLAY_FPS_RATIO f0-39)) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (set! (-> v1-48 root-override transv y) (* DISPLAY_FPS_RATIO f0-39)) ) 0 ) @@ -802,13 +811,13 @@ (defstate seagull-soaring (seagull) :trans (behavior () - (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) + (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self max-tilt) 4551.1113) (loop (ja-no-eval :group! seagull-slowfly-ja :num! (seek!) :frame-num 0.0) @@ -903,7 +912,8 @@ ) (let ((f0-33 (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) (set! (-> gp-0 angletan) (/ (- (-> s5-0 y)) (sqrtf f0-33))) - (set! (-> gp-0 target-dist) (* DISPLAY_FPS_RATIO (sqrtf (+ f0-33 (* (-> s5-0 y) (-> s5-0 y)))))) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (set! (-> gp-0 target-dist) (* DISPLAY_FPS_RATIO (sqrtf (+ f0-33 (* (-> s5-0 y) (-> s5-0 y)))))) ) ) 0 @@ -916,8 +926,9 @@ (f30-0 (* f28-0 (sin (-> gp-1 heading)))) (f0-41 (* f28-0 (cos (-> gp-1 heading)))) ) - (set! (-> gp-1 root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-0)))) ;; og:preserve-this changed for high fps - (set! (-> gp-1 root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-41)))) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (set! (-> gp-1 root-override transv x) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv x)) (* 0.2 f30-0)))) + (set! (-> gp-1 root-override transv z) (* DISPLAY_FPS_RATIO (+ (* 0.8 (-> gp-1 root-override transv z)) (* 0.2 f0-41)))) ) 0 (seagull-method-27 self) @@ -926,7 +937,7 @@ (go seagull-flying) ) (when (< (-> self root-override trans y) 204800.0) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) (let* ((f30-1 0.99) (v1-67 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-68 (the-as number (logior #x3f800000 v1-67))) @@ -986,7 +997,7 @@ (vector+! gp-0 gp-0 (-> self root-override trans)) (while (< 0.5 f30-0) (suspend) - (set! f30-0 (- f30-0 (-> *display* seconds-per-frame))) + (set! f30-0 (- f30-0 (seconds-per-frame))) (fill-cache-integrate-and-collide! (-> self root-override) (-> self root-override transv) @@ -1030,7 +1041,7 @@ (while (< 0.0 f30-0) (suspend) (ja :num! (seek!)) - (set! f30-0 (- f30-0 (-> *display* seconds-per-frame))) + (set! f30-0 (- f30-0 (seconds-per-frame))) (fill-cache-integrate-and-collide! (-> self root-override) (-> self root-override transv) @@ -1173,30 +1184,30 @@ (none) ) -(defmethod play-hint seagullflock ((obj seagullflock) (arg0 int)) - (when (>= (- (-> *display* base-frame-counter) (-> obj alert-time)) (seconds 5)) - (eval-path-curve-div! (-> obj path) (-> obj target) (the float (-> obj targetnum)) 'interp) +(defmethod play-hint seagullflock ((this seagullflock) (arg0 int)) + (when (time-elapsed? (-> this alert-time) (seconds 5)) + (eval-path-curve-div! (-> this path) (-> this target) (the float (-> this targetnum)) 'interp) (let ((f0-2 4096.0) - (v1-6 (-> obj targetnum)) + (v1-6 (-> this targetnum)) ) - (set! (-> obj max-lift) (* f0-2 (cond - ((= v1-6 1) - 4.0 - ) - ((= v1-6 2) - 4.0 - ) - ((= v1-6 3) - 4.0 - ) - (else - 10.0 + (set! (-> this max-lift) (* f0-2 (cond + ((= v1-6 1) + 4.0 ) - ) - ) + ((= v1-6 2) + 4.0 + ) + ((= v1-6 3) + 4.0 + ) + (else + 10.0 + ) + ) + ) ) ) - (case (-> obj targetnum) + (case (-> this targetnum) ((1) (level-hint-spawn (text-id sidekick-seagulls1) "sksp0020" (the-as entity #f) *entity-pool* (game-task none)) ) @@ -1210,29 +1221,29 @@ (level-hint-spawn (text-id sidekick-seagulls4) "sksp0024" (the-as entity #f) *entity-pool* (game-task none)) ) ) - (let ((v1-16 (-> obj entity extra perm))) + (let ((v1-16 (-> this entity extra perm))) (logior! (-> v1-16 status) (entity-perm-status user-set-from-cstage)) - (set! (-> v1-16 user-int8 0) (min 2 (-> obj targetnum))) + (set! (-> v1-16 user-int8 0) (min 2 (-> this targetnum))) ) - (+! (-> obj targetnum) 1) - (dotimes (v1-19 (-> obj birds)) - (set! (-> obj bird v1-19 0 scared) (+ (* v1-19 2) 5)) + (+! (-> this targetnum) 1) + (dotimes (v1-19 (-> this birds)) + (set! (-> this bird v1-19 0 scared) (+ (* v1-19 2) 5)) ) - (set! (-> obj bird arg0 0 scared) 1) - (set! (-> obj bird-at-waterfall) (the-as uint 0)) - (set! (-> obj birds-at-waterfall) 0) - (if (>= (-> obj targetnum) 4) - (set! (-> obj teleport-frames) 1500) + (set! (-> this bird arg0 0 scared) 1) + (set! (-> this bird-at-waterfall) (the-as uint 0)) + (set! (-> this birds-at-waterfall) 0) + (if (>= (-> this targetnum) 4) + (set! (-> this teleport-frames) 1500) ) (sound-play "seagull-takeoff") - (set! (-> obj alert-time) (-> *display* base-frame-counter)) + (set-time! (-> this alert-time)) ) (none) ) -(defmethod seagullflock-method-16 seagullflock ((obj seagullflock) (arg0 seagull)) +(defmethod seagullflock-method-16 seagullflock ((this seagullflock) (arg0 seagull)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (eval-path-curve-div! (-> obj path) gp-0 (the float (-> obj targetnum)) 'interp) + (eval-path-curve-div! (-> this path) gp-0 (the float (-> this targetnum)) 'interp) (vector-! gp-0 gp-0 (-> arg0 root-override trans)) (atan (-> gp-0 x) (-> gp-0 z)) ) @@ -1246,7 +1257,7 @@ (t9-1 (function process-tree event-message-block object)) ) (aybabtu 2) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (-> self link next) (until (t9-1 a0-2 a1-0) (suspend) @@ -1262,7 +1273,7 @@ ) ) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self teleport-frames)) + (until (time-elapsed? (-> self state-time) (-> self teleport-frames)) (suspend) ) (close-specific-task! (game-task beach-seagull) (task-status need-reminder)) @@ -1309,23 +1320,23 @@ ) ) -(defmethod init-from-entity! seagullflock ((obj seagullflock) (arg0 entity-actor)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj targetnum) (+ (-> arg0 extra perm user-int8 0) 1)) - (eval-path-curve-div! (-> obj path) (-> obj trans) (the float (+ (-> obj targetnum) -1)) 'interp) - (set! (-> obj target quad) (-> obj trans quad)) - (set! (-> obj max-lift) 20480.0) - (set! (-> obj birds) 0) - (dotimes (v1-16 SEAGULLFLOCK_MAX) - (set! (-> obj bird v1-16) (the-as (pointer seagull) #f)) +(defmethod init-from-entity! seagullflock ((this seagullflock) (arg0 entity-actor)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this targetnum) (+ (-> arg0 extra perm user-int8 0) 1)) + (eval-path-curve-div! (-> this path) (-> this trans) (the float (+ (-> this targetnum) -1)) 'interp) + (set! (-> this target quad) (-> this trans quad)) + (set! (-> this max-lift) 20480.0) + (set! (-> this birds) 0) + (dotimes (v1-16 64) + (set! (-> this bird v1-16) (the-as (pointer seagull) #f)) ) - (spawn-bird obj (-> obj trans)) + (spawn-bird this (-> this trans)) (dotimes (s5-1 20) (let ((s4-0 (new 'stack-no-clear 'vector))) - (let* ((f30-0 (-> obj trans x)) + (let* ((f30-0 (-> this trans x)) (f28-0 4096.0) (f26-0 10.0) (v1-22 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -1333,7 +1344,7 @@ ) (set! (-> s4-0 x) (+ f30-0 (* f28-0 (* f26-0 (+ -1.0 (the-as float v1-23)))))) ) - (let* ((f30-1 (-> obj trans z)) + (let* ((f30-1 (-> this trans z)) (f28-1 4096.0) (f26-1 10.0) (v1-26 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -1341,25 +1352,26 @@ ) (set! (-> s4-0 z) (+ f30-1 (* f28-1 (* f26-1 (+ -1.0 (the-as float v1-27)))))) ) - (set! (-> s4-0 y) (-> obj trans y)) + (set! (-> s4-0 y) (-> this trans y)) (set! (-> s4-0 w) 1.0) - (spawn-bird obj s4-0) + (spawn-bird this s4-0) ) ) - (set! (-> obj squall) (new 'process 'ambient-sound sound-seagull-squall (-> obj trans))) - (set! (-> obj teleport-frames) 0) - (logior! (-> obj mask) (process-mask enemy)) + (set! (-> this squall) (new 'process 'ambient-sound sound-seagull-squall (-> this trans))) + (set! (-> this teleport-frames) 0) + (logior! (-> this mask) (process-mask enemy)) (go seagullflock-idle) (none) ) -(defmethod spawn-bird seagullflock ((obj seagullflock) (arg0 vector)) - (if (= (-> obj birds) SEAGULLFLOCK_MAX) +(defmethod spawn-bird seagullflock ((this seagullflock) (arg0 vector)) + ;; og:preserve-this constant + (if (= (-> this birds) SEAGULLFLOCK_MAX) (return (the-as (pointer process) #f)) ) - (let ((v0-0 (process-spawn seagull arg0 (-> obj birds) obj :to obj))) - (set! (-> obj bird (-> obj birds)) (the-as (pointer seagull) v0-0)) - (+! (-> obj birds) 1) + (let ((v0-0 (process-spawn seagull arg0 (-> this birds) this :to this))) + (set! (-> this bird (-> this birds)) (the-as (pointer seagull) v0-0)) + (+! (-> this birds) 1) v0-0 ) ) diff --git a/goal_src/jak1/levels/beach/twister.gc b/goal_src/jak1/levels/beach/twister.gc index ad21dfe23e..c4fdc2c4ef 100644 --- a/goal_src/jak1/levels/beach/twister.gc +++ b/goal_src/jak1/levels/beach/twister.gc @@ -73,16 +73,16 @@ ) ) -(defmethod asize-of twister ((obj twister)) - (+ (* (-> obj num-joints) 16) 40) +(defmethod asize-of twister ((this twister)) + (+ (* (-> this num-joints) 16) 40) ) -(defmethod twister-method-9 twister ((obj twister) (arg0 int) (arg1 int) (arg2 float)) - (let ((v1-1 (- arg0 (-> obj first-joint))) - (a1-2 (- arg1 (-> obj first-joint))) +(defmethod twister-method-9 twister ((this twister) (arg0 int) (arg1 int) (arg2 float)) + (let ((v1-1 (- arg0 (-> this first-joint))) + (a1-2 (- arg1 (-> this first-joint))) ) (while (>= a1-2 v1-1) - (set! (-> obj data v1-1 max-dry) arg2) + (set! (-> this data v1-1 max-dry) arg2) (+! v1-1 1) ) ) @@ -90,23 +90,23 @@ (none) ) -(defmethod set-target! twister ((obj twister) (arg0 float)) - (set! (-> obj target) arg0) +(defmethod set-target! twister ((this twister) (arg0 float)) + (set! (-> this target) arg0) 0 (none) ) -(defmethod twister-method-11 twister ((obj twister)) - (let* ((s5-0 (+ (-> obj num-joints) -1)) - (s4-0 (-> obj data s5-0)) +(defmethod twister-method-11 twister ((this twister)) + (let* ((s5-0 (+ (-> this num-joints) -1)) + (s4-0 (-> this data s5-0)) ) - (let ((f0-2 (deg-diff (-> s4-0 ry) (-> obj target)))) - (+! (-> s4-0 ry) (seek-with-smooth 0.0 f0-2 (-> obj max-speed) (-> obj smoothing) (-> obj min-dist))) + (let ((f0-2 (deg-diff (-> s4-0 ry) (-> this target)))) + (+! (-> s4-0 ry) (seek-with-smooth 0.0 f0-2 (-> this max-speed) (-> this smoothing) (-> this min-dist))) ) (let ((f30-1 (-> s4-0 ry))) (while (> s5-0 0) (+! s5-0 -1) - (let ((s4-1 (-> obj data s5-0))) + (let ((s4-1 (-> this data s5-0))) (let ((f0-9 (deg-diff f30-1 (-> s4-1 ry)))) (cond ((= (-> s4-1 max-dry) 0.0) @@ -116,11 +116,13 @@ ) ((< f0-9 0.0) (set! f0-9 - (seek-with-smooth f0-9 (- (-> s4-1 max-dry)) (-> obj max-speed) (-> obj smoothing) (-> obj min-dist)) + (seek-with-smooth f0-9 (- (-> s4-1 max-dry)) (-> this max-speed) (-> this smoothing) (-> this min-dist)) ) ) (else - (set! f0-9 (seek-with-smooth f0-9 (-> s4-1 max-dry) (-> obj max-speed) (-> obj smoothing) (-> obj min-dist))) + (set! f0-9 + (seek-with-smooth f0-9 (-> s4-1 max-dry) (-> this max-speed) (-> this smoothing) (-> this min-dist)) + ) ) ) (+! f30-1 f0-9) @@ -134,11 +136,11 @@ (none) ) -(defmethod twister-method-12 twister ((obj twister) (arg0 process-drawable)) +(defmethod twister-method-12 twister ((this twister) (arg0 process-drawable)) (let ((s4-0 (new 'stack-no-clear 'matrix))) - (dotimes (s3-0 (-> obj num-joints)) - (let ((s2-0 (-> arg0 node-list data (+ (-> obj first-joint) s3-0) bone transform))) - (matrix-rotate-y! s4-0 (-> obj data s3-0 ry)) + (dotimes (s3-0 (-> this num-joints)) + (let ((s2-0 (-> arg0 node-list data (+ (-> this first-joint) s3-0) bone transform))) + (matrix-rotate-y! s4-0 (-> this data s3-0 ry)) (vector-! (-> s2-0 vector 3) (-> s2-0 vector 3) (-> arg0 root trans)) (matrix*! s2-0 s2-0 s4-0) (vector+! (-> s2-0 vector 3) (-> s2-0 vector 3) (-> arg0 root trans)) diff --git a/goal_src/jak1/levels/beach/wobbler.gc b/goal_src/jak1/levels/beach/wobbler.gc index ae76226cbf..03c628a358 100644 --- a/goal_src/jak1/levels/beach/wobbler.gc +++ b/goal_src/jak1/levels/beach/wobbler.gc @@ -28,43 +28,43 @@ ) -(defmethod reset! wobbler ((obj wobbler) (arg0 float) (arg1 float) (arg2 float)) - (set! (-> obj posx) 0.0) - (set! (-> obj posy) 0.0) - (set! (-> obj velx) 0.0) - (set! (-> obj vely) 0.0) - (set! (-> obj spring) arg0) - (set! (-> obj damping) arg1) - (set! (-> obj height) arg2) +(defmethod reset! wobbler ((this wobbler) (arg0 float) (arg1 float) (arg2 float)) + (set! (-> this posx) 0.0) + (set! (-> this posy) 0.0) + (set! (-> this velx) 0.0) + (set! (-> this vely) 0.0) + (set! (-> this spring) arg0) + (set! (-> this damping) arg1) + (set! (-> this height) arg2) 0 (none) ) -(defmethod inc-xy-vel! wobbler ((obj wobbler) (arg0 float) (arg1 float)) - (+! (-> obj velx) arg0) - (+! (-> obj vely) arg1) +(defmethod inc-xy-vel! wobbler ((this wobbler) (arg0 float) (arg1 float)) + (+! (-> this velx) arg0) + (+! (-> this vely) arg1) 0 (none) ) -(defmethod move! wobbler ((obj wobbler)) - (+! (-> obj posx) (* (-> obj velx) (-> *display* seconds-per-frame))) - (+! (-> obj posy) (* (-> obj vely) (-> *display* seconds-per-frame))) - (set! (-> obj velx) (* (-> obj velx) (-> obj damping))) - (set! (-> obj vely) (* (-> obj vely) (-> obj damping))) - (+! (-> obj velx) (* -1.0 (-> obj posx) (-> obj spring))) - (+! (-> obj vely) (* -1.0 (-> obj posy) (-> obj spring))) +(defmethod move! wobbler ((this wobbler)) + (+! (-> this posx) (* (-> this velx) (seconds-per-frame))) + (+! (-> this posy) (* (-> this vely) (seconds-per-frame))) + (set! (-> this velx) (* (-> this velx) (-> this damping))) + (set! (-> this vely) (* (-> this vely) (-> this damping))) + (+! (-> this velx) (* -1.0 (-> this posx) (-> this spring))) + (+! (-> this vely) (* -1.0 (-> this posy) (-> this spring))) 0 (none) ) -(defmethod wobbler-method-12 wobbler ((obj wobbler) (arg0 quaternion)) +(defmethod wobbler-method-12 wobbler ((this wobbler) (arg0 quaternion)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 x) (-> obj posy)) + (set! (-> s5-0 x) (-> this posy)) (set! (-> s5-0 y) 0.0) - (set! (-> s5-0 z) (- (-> obj posx))) + (set! (-> s5-0 z) (- (-> this posx))) (vector-normalize! s5-0 1.0) - (let* ((f0-8 (/ (sqrtf (+ (* (-> obj posx) (-> obj posx)) (* (-> obj posy) (-> obj posy)))) (-> obj height))) + (let* ((f0-8 (/ (sqrtf (+ (* (-> this posx) (-> this posx)) (* (-> this posy) (-> this posy)))) (-> this height))) (f0-9 (atan f0-8 1.0)) ) (quaternion-vector-angle! arg0 s5-0 f0-9) diff --git a/goal_src/jak1/levels/citadel/assistant-citadel.gc b/goal_src/jak1/levels/citadel/assistant-citadel.gc index 643dfc6d57..f851c60f41 100644 --- a/goal_src/jak1/levels/citadel/assistant-citadel.gc +++ b/goal_src/jak1/levels/citadel/assistant-citadel.gc @@ -22,14 +22,14 @@ :shadow assistant-lavatube-end-shadow-mg ) -(defmethod play-anim! assistant-lavatube-end ((obj assistant-lavatube-end) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! assistant-lavatube-end ((this assistant-lavatube-end) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint)) (new 'static 'spool-anim :name "assistant-lavatube-end-resolution" :index 4 :parts 11 :command-list '()) ) (((task-status need-reward-speech)) (if arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "assistant-lavatube-end-resolution" @@ -56,17 +56,17 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) -(defmethod get-art-elem assistant-lavatube-end ((obj assistant-lavatube-end)) - (-> obj draw art-group data 3) +(defmethod get-art-elem assistant-lavatube-end ((this assistant-lavatube-end)) + (-> this draw art-group data 3) ) (defstate hidden (assistant-lavatube-end) @@ -106,19 +106,19 @@ ) ) -(defmethod should-display? assistant-lavatube-end ((obj assistant-lavatube-end)) - (first-any (-> obj tasks) #t) - (let ((v1-3 (current-status (-> obj tasks)))) +(defmethod should-display? assistant-lavatube-end ((this assistant-lavatube-end)) + (first-any (-> this tasks) #t) + (let ((v1-3 (current-status (-> this tasks)))) (and (or (= v1-3 (task-status need-reward-speech)) (= v1-3 (task-status invalid))) (not (task-closed? (game-task citadel-sage-green) (task-status need-hint))) ) ) ) -(defmethod init-from-entity! assistant-lavatube-end ((obj assistant-lavatube-end) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-lavatube-end-sg* 3 29 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task village4-button))) - (first-any (-> obj tasks) #t) - (process-taskable-method-42 obj) +(defmethod init-from-entity! assistant-lavatube-end ((this assistant-lavatube-end) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-lavatube-end-sg* 3 29 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task village4-button))) + (first-any (-> this tasks) #t) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/citadel/citadel-obs.gc b/goal_src/jak1/levels/citadel/citadel-obs.gc index 0f80652bec..22d17078a2 100644 --- a/goal_src/jak1/levels/citadel/citadel-obs.gc +++ b/goal_src/jak1/levels/citadel/citadel-obs.gc @@ -97,38 +97,38 @@ :post ja-post ) -(defmethod init-root! citb-arm-section ((obj citb-arm-section)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod init-root! citb-arm-section ((this citb-arm-section)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod setup-new-process! citb-arm-section ((obj citb-arm-section)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) +(defmethod setup-new-process! citb-arm-section ((this citb-arm-section)) + (logclear! (-> this mask) (process-mask actor-pause)) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (cond - ((> (-> obj sync period) 0) - (set! (-> obj rot-scale) 1.0) + ((> (-> this sync period) 0) + (set! (-> this rot-scale) 1.0) ) (else - (set! (-> obj rot-scale) -1.0) - (let ((v1-6 (abs (the-as int (-> obj sync period))))) - (set! (-> obj sync period) (the-as uint v1-6)) + (set! (-> this rot-scale) -1.0) + (let ((v1-6 (abs (the-as int (-> this sync period))))) + (set! (-> this sync period) (the-as uint v1-6)) ) ) ) - (logior! (-> obj skel status) (janim-status inited)) - (set-vector! (-> obj cull-dir-local) 0.0 0.0 -1.0 1.0) - (set! (-> obj cull-dot) (cos 5461.3335)) + (logior! (-> this skel status) (janim-status inited)) + (set-vector! (-> this cull-dir-local) 0.0 0.0 -1.0 1.0) + (set! (-> this cull-dot) (cos 5461.3335)) 0 (none) ) -(defmethod init-from-entity! citb-arm-section ((obj citb-arm-section) (arg0 entity-actor)) - (init-root! obj) - (process-drawable-from-entity! obj arg0) - (setup-new-process! obj) - (go (method-of-object obj idle)) +(defmethod init-from-entity! citb-arm-section ((this citb-arm-section) (arg0 entity-actor)) + (init-root! this) + (process-drawable-from-entity! this arg0) + (setup-new-process! this) + (go (method-of-object this idle)) (none) ) @@ -154,8 +154,8 @@ ) ) -(defmethod init-root! citb-arm ((obj citb-arm)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-root! citb-arm ((this citb-arm)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -173,17 +173,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod setup-new-process! citb-arm ((obj citb-arm)) - ((the-as (function citb-arm-section none) (find-parent-method citb-arm 21)) 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)) +(defmethod setup-new-process! citb-arm ((this citb-arm)) + ((the-as (function citb-arm-section none) (find-parent-method citb-arm 21)) 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)) 0 (none) ) @@ -197,11 +197,11 @@ ) -(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) - (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)) +(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) + (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)) 0 (none) ) @@ -260,48 +260,48 @@ ) -(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) - (set! (-> obj root-override root-prim local-sphere z) -184320.0) +(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) + (set! (-> this root-override root-prim local-sphere z) -184320.0) 0 (none) ) -(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) - (set! (-> obj root-override root-prim local-sphere z) -225280.0) +(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) + (set! (-> this root-override root-prim local-sphere z) -225280.0) 0 (none) ) -(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) - (set! (-> obj root-override root-prim local-sphere z) -266240.0) +(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) + (set! (-> this root-override root-prim local-sphere z) -266240.0) 0 (none) ) -(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) - (set! (-> obj root-override root-prim local-sphere z) -307200.0) +(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) + (set! (-> this root-override root-prim local-sphere z) -307200.0) 0 (none) ) -(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)) +(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)) 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)) +(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)) 0 (none) ) @@ -375,8 +375,8 @@ :post rider-post ) -(defmethod init! citb-disc ((obj citb-disc)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init! citb-disc ((this citb-disc)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -394,38 +394,38 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod citb-disc-method-21 citb-disc ((obj citb-disc)) +(defmethod citb-disc-method-21 citb-disc ((this citb-disc)) 0 (none) ) -(defmethod init-from-entity! citb-disc ((obj citb-disc) (arg0 entity-actor)) - (init! obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) +(defmethod init-from-entity! citb-disc ((this citb-disc) (arg0 entity-actor)) + (init! this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (cond - ((> (-> obj sync period) 0) - (set! (-> obj rot-scale) 1.0) + ((> (-> this sync period) 0) + (set! (-> this rot-scale) 1.0) ) (else - (set! (-> obj rot-scale) -1.0) - (let ((v1-8 (abs (the-as int (-> obj sync period))))) - (set! (-> obj sync period) (the-as uint v1-8)) + (set! (-> this rot-scale) -1.0) + (let ((v1-8 (abs (the-as int (-> this sync period))))) + (set! (-> this sync period) (the-as uint v1-8)) ) ) ) - (citb-disc-method-21 obj) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> obj root-override trans)) + (citb-disc-method-21 this) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root-override trans)) ) - (logior! (-> obj skel status) (janim-status inited)) + (logior! (-> this skel status) (janim-status inited)) (go citb-disc-idle) (none) ) @@ -466,26 +466,26 @@ ) -(defmethod citb-disc-method-21 citb-disc-a ((obj citb-disc-a)) - (initialize-skeleton obj *citb-disc-a-sg* '()) +(defmethod citb-disc-method-21 citb-disc-a ((this citb-disc-a)) + (initialize-skeleton this *citb-disc-a-sg* '()) 0 (none) ) -(defmethod citb-disc-method-21 citb-disc-b ((obj citb-disc-b)) - (initialize-skeleton obj *citb-disc-b-sg* '()) +(defmethod citb-disc-method-21 citb-disc-b ((this citb-disc-b)) + (initialize-skeleton this *citb-disc-b-sg* '()) 0 (none) ) -(defmethod citb-disc-method-21 citb-disc-c ((obj citb-disc-c)) - (initialize-skeleton obj *citb-disc-c-sg* '()) +(defmethod citb-disc-method-21 citb-disc-c ((this citb-disc-c)) + (initialize-skeleton this *citb-disc-c-sg* '()) 0 (none) ) -(defmethod citb-disc-method-21 citb-disc-d ((obj citb-disc-d)) - (initialize-skeleton obj *citb-disc-d-sg* '()) +(defmethod citb-disc-method-21 citb-disc-d ((this citb-disc-d)) + (initialize-skeleton this *citb-disc-d-sg* '()) 0 (none) ) @@ -504,8 +504,8 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod eco-door-method-24 citb-iris-door ((obj citb-iris-door)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod eco-door-method-24 citb-iris-door ((this citb-iris-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -517,19 +517,19 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 citb-iris-door ((obj citb-iris-door)) - (initialize-skeleton obj *citb-iris-door-sg* '()) - (set! (-> obj open-distance) 32768.0) - (set! (-> obj close-distance) 49152.0) - (set! (-> obj auto-close) #t) - (process-entity-status! obj (entity-perm-status complete) #t) - (update-transforms! (-> obj root-override)) +(defmethod eco-door-method-25 citb-iris-door ((this citb-iris-door)) + (initialize-skeleton this *citb-iris-door-sg* '()) + (set! (-> this open-distance) 32768.0) + (set! (-> this close-distance) 49152.0) + (set! (-> this auto-close) #t) + (process-entity-status! this (entity-perm-status complete) #t) + (update-transforms! (-> this root-override)) 0 (none) ) @@ -548,8 +548,8 @@ ) -(defmethod basebutton-method-27 citb-button ((obj citb-button)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod basebutton-method-27 citb-button ((this citb-button)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -566,42 +566,42 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) (the-as collide-shape-moving 0) ) -(defmethod basebutton-method-26 citb-button ((obj citb-button)) - (initialize-skeleton obj *citb-button-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) +(defmethod basebutton-method-26 citb-button ((this citb-button)) + (initialize-skeleton this *citb-button-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) (cond - ((-> obj down?) - (let ((s5-0 (-> obj skel root-channel 0))) + ((-> this down?) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) ) (else - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) ) ) - (set! (-> obj anim-speed) 2.0) - (set! (-> obj timeout) 1.0) - (update-transforms! (-> obj root-override)) + (set! (-> this anim-speed) 2.0) + (set! (-> this timeout) 1.0) + (update-transforms! (-> this root-override)) (ja-post) (none) ) @@ -633,18 +633,18 @@ :bounds (static-spherem 0 0 0 4) ) -(defmethod get-unlit-skel citb-launcher ((obj citb-launcher)) +(defmethod get-unlit-skel citb-launcher ((this citb-launcher)) *citb-launcher-sg* ) -(defmethod baseplat-method-26 citb-launcher ((obj citb-launcher)) - (let ((f30-0 (res-lump-float (-> obj entity) 'spring-height :default 163840.0)) - (s5-0 (res-lump-value (-> obj entity) 'mode uint128)) +(defmethod baseplat-method-26 citb-launcher ((this citb-launcher)) + (let ((f30-0 (res-lump-float (-> this entity) 'spring-height :default 163840.0)) + (s5-0 (res-lump-value (-> this entity) 'mode uint128)) ) - (set! (-> obj launcher) (process-spawn launcher (-> obj root-override trans) f30-0 s5-0 81920.0 :to obj)) + (set! (-> this launcher) (process-spawn launcher (-> this root-override trans) f30-0 s5-0 81920.0 :to this)) ) - (set! (-> obj root-override root-prim local-sphere w) 18432.0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root-override root-prim local-sphere w) 18432.0) + (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) ) @@ -833,8 +833,8 @@ ) ) -(defmethod init-from-entity! citb-robotboss ((obj citb-robotboss) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! citb-robotboss ((this citb-robotboss) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -846,17 +846,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *citb-robotboss-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 601) obj)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj shield-on) #t) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "robotcage-lp" :fo-max 150) (-> obj root-override trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *citb-robotboss-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 601) this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this shield-on) #t) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "robotcage-lp" :fo-max 150) (-> this root-override trans)) ) - (if (= (get-task-status (-> obj entity extra perm task)) (task-status invalid)) + (if (= (get-task-status (-> this entity extra perm task)) (task-status invalid)) (go citb-robotboss-die) (go citb-robotboss-idle) ) @@ -883,18 +883,18 @@ ) -(defmethod relocate citb-coil ((obj citb-coil) (arg0 int)) - (if (nonzero? (-> obj part-off)) - (&+! (-> obj part-off) arg0) +(defmethod relocate citb-coil ((this citb-coil) (arg0 int)) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) arg0) ) - (the-as citb-coil ((method-of-type process-drawable relocate) obj arg0)) + (the-as citb-coil ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate citb-coil ((obj citb-coil)) - (if (nonzero? (-> obj part-off)) - (kill-and-free-particles (-> obj part-off)) +(defmethod deactivate citb-coil ((this citb-coil)) + (if (nonzero? (-> this part-off)) + (kill-and-free-particles (-> this part-off)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -950,15 +950,15 @@ :post ja-post ) -(defmethod init-from-entity! citb-coil ((obj citb-coil) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *citb-coil-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 596) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 602) obj)) - (let ((v1-9 (entity-actor-lookup (-> obj entity) 'state-actor 0))) +(defmethod init-from-entity! citb-coil ((this citb-coil) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *citb-coil-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 596) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 602) this)) + (let ((v1-9 (entity-actor-lookup (-> this entity) 'state-actor 0))) (if (not v1-9) - (set! v1-9 (-> obj entity)) + (set! v1-9 (-> this entity)) ) (if (logtest? (-> v1-9 extra perm status) (entity-perm-status complete)) (go citb-coil-broken) @@ -1041,13 +1041,13 @@ :post ja-post ) -(defmethod init-from-entity! citb-hose ((obj citb-hose) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *citb-hose-sg* '()) - (let ((v1-3 (entity-actor-lookup (-> obj entity) 'state-actor 0))) +(defmethod init-from-entity! citb-hose ((this citb-hose) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *citb-hose-sg* '()) + (let ((v1-3 (entity-actor-lookup (-> this entity) 'state-actor 0))) (if (not v1-3) - (set! v1-3 (-> obj entity)) + (set! v1-3 (-> this entity)) ) (if (logtest? (-> v1-3 extra perm status) (entity-perm-status complete)) (go citb-hose-die) @@ -1102,24 +1102,24 @@ ) -(defmethod relocate citb-generator ((obj citb-generator) (arg0 int)) - (if (nonzero? (-> obj part-broken)) - (&+! (-> obj part-broken) arg0) +(defmethod relocate citb-generator ((this citb-generator) (arg0 int)) + (if (nonzero? (-> this part-broken)) + (&+! (-> this part-broken) arg0) ) - (if (nonzero? (-> obj part-mushroom)) - (&+! (-> obj part-mushroom) arg0) + (if (nonzero? (-> this part-mushroom)) + (&+! (-> this part-mushroom) arg0) ) - (the-as citb-generator ((method-of-type process-drawable relocate) obj arg0)) + (the-as citb-generator ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate citb-generator ((obj citb-generator)) - (if (nonzero? (-> obj part-broken)) - (kill-and-free-particles (-> obj part-broken)) +(defmethod deactivate citb-generator ((this citb-generator)) + (if (nonzero? (-> this part-broken)) + (kill-and-free-particles (-> this part-broken)) ) - (if (nonzero? (-> obj part-mushroom)) - (kill-and-free-particles (-> obj part-mushroom)) + (if (nonzero? (-> this part-mushroom)) + (kill-and-free-particles (-> this part-mushroom)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -1155,10 +1155,10 @@ ) ) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (while (< (- (-> *display* base-frame-counter) gp-1) (seconds 0.5)) + (let ((gp-1 (current-time))) + (while (not (time-elapsed? gp-1 (seconds 0.5))) (if (movie?) - (set! gp-1 (-> *display* base-frame-counter)) + (set! gp-1 (current-time)) ) (suspend) ) @@ -1327,8 +1327,8 @@ ) ) -(defmethod init! citb-generator ((obj citb-generator)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init! citb-generator ((this citb-generator)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1339,64 +1339,64 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod citb-generator-method-21 citb-generator ((obj citb-generator)) - (initialize-skeleton obj *citb-generator-sg* '()) - (setup-lods! (-> obj normal-look) *citb-generator-sg* (-> obj draw art-group) (-> obj entity)) - (setup-lods! (-> obj broken-look) *citb-generator-broken-sg* (-> obj draw art-group) (-> obj entity)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj birth-fuel-cell) (< (the-as uint 1) (the-as uint (-> obj entity extra perm task)))) - (set! (-> obj trigger-others) #f) - (set! (-> obj mushroom-pos quad) (-> obj root-override trans quad)) +(defmethod citb-generator-method-21 citb-generator ((this citb-generator)) + (initialize-skeleton this *citb-generator-sg* '()) + (setup-lods! (-> this normal-look) *citb-generator-sg* (-> this draw art-group) (-> this entity)) + (setup-lods! (-> this broken-look) *citb-generator-broken-sg* (-> this draw art-group) (-> this entity)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this birth-fuel-cell) (< (the-as uint 1) (the-as uint (-> this entity extra perm task)))) + (set! (-> this trigger-others) #f) + (set! (-> this mushroom-pos quad) (-> this root-override trans quad)) (let ((f30-0 0.0)) (cond - ((name= (-> obj name) "citb-generator-1") - (set! (-> obj mushroom) #t) + ((name= (-> this name) "citb-generator-1") + (set! (-> this mushroom) #t) (set! f30-0 21845.334) ) - ((name= (-> obj name) "citb-generator-2") - (set! (-> obj mushroom) #t) + ((name= (-> this name) "citb-generator-2") + (set! (-> this mushroom) #t) (set! f30-0 16384.0) ) - ((name= (-> obj name) "citb-generator-3") - (set! (-> obj mushroom) #t) + ((name= (-> this name) "citb-generator-3") + (set! (-> this mushroom) #t) (set! f30-0 16384.0) ) - ((name= (-> obj name) "citb-generator-4") - (set! (-> obj mushroom) #t) + ((name= (-> this name) "citb-generator-4") + (set! (-> this mushroom) #t) (set! f30-0 -5461.3335) ) (else - (set! (-> obj mushroom) #f) + (set! (-> this mushroom) #f) ) ) - (when (-> obj mushroom) - (+! (-> obj mushroom-pos x) (* 19251.2 (sin f30-0))) - (+! (-> obj mushroom-pos z) (* 19251.2 (cos f30-0))) + (when (-> this mushroom) + (+! (-> this mushroom-pos x) (* 19251.2 (sin f30-0))) + (+! (-> this mushroom-pos z) (* 19251.2 (cos f30-0))) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 600) obj)) - (set! (-> obj part-broken) (create-launch-control (-> *part-group-id-table* 597) obj)) - (set! (-> obj part-mushroom) (create-launch-control (-> *part-group-id-table* 599) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "mushroom-gen" :fo-max 20) (-> obj root-override trans)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 600) this)) + (set! (-> this part-broken) (create-launch-control (-> *part-group-id-table* 597) this)) + (set! (-> this part-mushroom) (create-launch-control (-> *part-group-id-table* 599) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "mushroom-gen" :fo-max 20) (-> this root-override trans)) ) 0 (none) ) -(defmethod init-from-entity! citb-generator ((obj citb-generator) (arg0 entity-actor)) - (init! obj) - (process-drawable-from-entity! obj arg0) - (citb-generator-method-21 obj) - (let ((v1-4 (entity-actor-lookup (-> obj entity) 'state-actor 0))) +(defmethod init-from-entity! citb-generator ((this citb-generator) (arg0 entity-actor)) + (init! this) + (process-drawable-from-entity! this arg0) + (citb-generator-method-21 this) + (let ((v1-4 (entity-actor-lookup (-> this entity) 'state-actor 0))) (if (not v1-4) - (set! v1-4 (-> obj entity)) + (set! v1-4 (-> this entity)) ) (if (logtest? (-> v1-4 extra perm status) (entity-perm-status complete)) (go citb-generator-broken) @@ -1492,10 +1492,10 @@ ) ) -(defmethod init-from-entity! citadelcam ((obj citadelcam) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) +(defmethod init-from-entity! citadelcam ((this citadelcam) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (go citadelcam-idle) (none) ) @@ -1549,9 +1549,9 @@ ) ) -(defmethod battlecontroller-method-27 citb-battlecontroller ((obj citb-battlecontroller)) - ((the-as (function battlecontroller none) (find-parent-method citb-battlecontroller 27)) obj) - (set! (-> obj activate-distance) 143360.0) +(defmethod battlecontroller-method-27 citb-battlecontroller ((this citb-battlecontroller)) + ((the-as (function battlecontroller none) (find-parent-method citb-battlecontroller 27)) 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 afa88204f5..08cdb42588 100644 --- a/goal_src/jak1/levels/citadel/citadel-sages.gc +++ b/goal_src/jak1/levels/citadel/citadel-sages.gc @@ -146,8 +146,8 @@ ) ) -(defmethod citb-sagecage-method-20 citb-sagecage ((obj citb-sagecage)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod citb-sagecage-method-20 citb-sagecage ((this citb-sagecage)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -165,43 +165,43 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod citb-sagecage-method-21 citb-sagecage ((obj citb-sagecage)) - (initialize-skeleton obj *citb-sagecage-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj root-override pause-adjust-distance) 409600.0) +(defmethod citb-sagecage-method-21 citb-sagecage ((this citb-sagecage)) + (initialize-skeleton this *citb-sagecage-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this root-override pause-adjust-distance) 409600.0) (let ((f0-1 20766.72) (f4-0 14745.6) (f1-0 -14745.6) (f2-0 7372.8) ) (let ((f3-0 -7372.8)) - (set-vector! (-> obj bar-array 0) f4-0 f0-1 f3-0 1.0) - (set-vector! (-> obj bar-array 1) f4-0 f0-1 0.0 1.0) - (set-vector! (-> obj bar-array 2) f4-0 f0-1 f2-0 1.0) - (set-vector! (-> obj bar-array 3) f1-0 f0-1 f3-0 1.0) - (set-vector! (-> obj bar-array 4) f1-0 f0-1 0.0 1.0) - (set-vector! (-> obj bar-array 5) f1-0 f0-1 f2-0 1.0) - (set-vector! (-> obj bar-array 6) f3-0 f0-1 f4-0 1.0) - (set-vector! (-> obj bar-array 7) 0.0 f0-1 f4-0 1.0) - (set-vector! (-> obj bar-array 8) f2-0 f0-1 f4-0 1.0) - (set-vector! (-> obj bar-array 9) f3-0 f0-1 f1-0 1.0) + (set-vector! (-> this bar-array 0) f4-0 f0-1 f3-0 1.0) + (set-vector! (-> this bar-array 1) f4-0 f0-1 0.0 1.0) + (set-vector! (-> this bar-array 2) f4-0 f0-1 f2-0 1.0) + (set-vector! (-> this bar-array 3) f1-0 f0-1 f3-0 1.0) + (set-vector! (-> this bar-array 4) f1-0 f0-1 0.0 1.0) + (set-vector! (-> this bar-array 5) f1-0 f0-1 f2-0 1.0) + (set-vector! (-> this bar-array 6) f3-0 f0-1 f4-0 1.0) + (set-vector! (-> this bar-array 7) 0.0 f0-1 f4-0 1.0) + (set-vector! (-> this bar-array 8) f2-0 f0-1 f4-0 1.0) + (set-vector! (-> this bar-array 9) f3-0 f0-1 f1-0 1.0) ) - (set-vector! (-> obj bar-array 10) 0.0 f0-1 f1-0 1.0) - (set-vector! (-> obj bar-array 11) f2-0 f0-1 f1-0 1.0) + (set-vector! (-> this bar-array 10) 0.0 f0-1 f1-0 1.0) + (set-vector! (-> this bar-array 11) f2-0 f0-1 f1-0 1.0) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> obj root-override trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> this root-override trans)) ) - (set! (-> obj bars-on) (not (task-complete? *game-info* (-> obj entity extra perm task)))) + (set! (-> this bars-on) (not (task-complete? *game-info* (-> this entity extra perm task)))) (citb-sagecage-update-collision) - (set! (-> obj cloning) #t) - (set! (-> obj event-hook) (-> citb-sagecage-idle event)) + (set! (-> this cloning) #t) + (set! (-> this event-hook) (-> citb-sagecage-idle event)) 0 (none) ) @@ -277,85 +277,85 @@ ) -(defmethod relocate citb-sage ((obj citb-sage) (arg0 int)) - (if (nonzero? (-> obj part-impact)) - (&+! (-> obj part-impact) arg0) +(defmethod relocate citb-sage ((this citb-sage) (arg0 int)) + (if (nonzero? (-> this part-impact)) + (&+! (-> this part-impact) arg0) ) - (the-as citb-sage ((method-of-type process-taskable relocate) obj arg0)) + (the-as citb-sage ((method-of-type process-taskable relocate) this arg0)) ) -(defmethod deactivate citb-sage ((obj citb-sage)) - (if (nonzero? (-> obj part-impact)) - (kill-and-free-particles (-> obj part-impact)) +(defmethod deactivate citb-sage ((this citb-sage)) + (if (nonzero? (-> this part-impact)) + (kill-and-free-particles (-> this part-impact)) ) - (sound-stop (-> obj sound-id)) - ((method-of-type process-taskable deactivate) obj) + (sound-stop (-> this sound-id)) + ((method-of-type process-taskable deactivate) this) (none) ) -(defmethod play-reminder citb-sage ((obj citb-sage)) - (set! (-> obj root-override pause-adjust-distance) 409600.0) - (set! (-> obj cage) (ppointer->handle (process-spawn citb-sagecage obj :to obj))) - (set! (-> obj beam-on) #f) - (set! (-> obj sound-id) (new-sound-id)) - (if (zero? (-> obj sound-name)) - (set! (-> obj sound-name) "") +(defmethod play-reminder citb-sage ((this citb-sage)) + (set! (-> this root-override pause-adjust-distance) 409600.0) + (set! (-> this cage) (ppointer->handle (process-spawn citb-sagecage this :to this))) + (set! (-> this beam-on) #f) + (set! (-> this sound-id) (new-sound-id)) + (if (zero? (-> this sound-name)) + (set! (-> this sound-name) "") ) - (let ((v1-9 (the-as entity (entity-actor-lookup (-> obj entity) 'alt-actor 0))) + (let ((v1-9 (the-as entity (entity-actor-lookup (-> this entity) 'alt-actor 0))) (s5-1 (new 'stack-no-clear 'vector)) ) (let ((s4-0 (new 'stack-no-clear 'vector))) (if (not (the-as entity-actor v1-9)) (set! v1-9 (entity-by-name "citb-robotboss-1")) ) - (set! (-> obj alt-actor) (the-as entity-actor v1-9)) - (set! (-> obj spawn-pos quad) (-> obj root-override trans quad)) + (set! (-> this alt-actor) (the-as entity-actor v1-9)) + (set! (-> this spawn-pos quad) (-> this root-override trans quad)) (set! (-> s5-1 quad) (-> v1-9 extra trans quad)) (+! (-> s5-1 y) 81920.0) - (vector-! s4-0 (-> obj spawn-pos) s5-1) + (vector-! s4-0 (-> this spawn-pos) s5-1) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (vector+*! (-> obj target-pos) s5-1 s4-0 116940.8) + (vector+*! (-> this target-pos) s5-1 s4-0 116940.8) ) - (when (nonzero? (-> obj part)) - (vector-! s5-1 (-> obj target-pos) (-> obj spawn-pos)) - (vector-float*! (the-as vector (-> obj part group bounds)) s5-1 0.5) - (set! (-> obj part group bounds w) (* 0.6 (vector-vector-distance (-> obj spawn-pos) (-> obj target-pos)))) + (when (nonzero? (-> this part)) + (vector-! s5-1 (-> this target-pos) (-> this spawn-pos)) + (vector-float*! (the-as vector (-> this part group bounds)) s5-1 0.5) + (set! (-> this part group bounds w) (* 0.6 (vector-vector-distance (-> this spawn-pos) (-> this target-pos)))) ) ) (the-as symbol 0) ) -(defmethod process-taskable-method-45 citb-sage ((obj citb-sage)) - (set! (-> obj spawn-pos quad) (-> obj root-override trans quad)) +(defmethod process-taskable-method-45 citb-sage ((this citb-sage)) + (set! (-> this spawn-pos quad) (-> this root-override trans quad)) (the-as symbol 0) ) -(defmethod process-taskable-method-42 citb-sage ((obj citb-sage)) - (if (not (should-display? obj)) - (go (method-of-object obj hidden)) - (go (method-of-object obj idle)) +(defmethod process-taskable-method-42 citb-sage ((this citb-sage)) + (if (not (should-display? this)) + (go (method-of-object this hidden)) + (go (method-of-object this idle)) ) (none) ) -(defmethod play-anim! citb-sage ((obj citb-sage) (arg0 symbol)) - (the-as basic (-> obj resolution-anim)) +(defmethod play-anim! citb-sage ((this citb-sage) (arg0 symbol)) + (the-as basic (-> this resolution-anim)) ) -(defmethod get-art-elem citb-sage ((obj citb-sage)) +(defmethod get-art-elem citb-sage ((this citb-sage)) (cond - ((= (current-status (-> obj tasks)) (task-status invalid)) - (set! (-> obj beam-on) #t) - (-> obj draw art-group data (-> obj attack-anim)) + ((= (current-status (-> this tasks)) (task-status invalid)) + (set! (-> this beam-on) #t) + (-> this draw art-group data (-> this attack-anim)) ) (else - (-> obj draw art-group data (-> obj idle-anim)) + (-> this draw art-group data (-> this idle-anim)) ) ) ) -(defmethod should-display? citb-sage ((obj citb-sage)) +(defmethod should-display? citb-sage ((this citb-sage)) (!= (get-task-status (game-task citadel-sage-green)) (task-status invalid)) ) @@ -445,8 +445,8 @@ ) -(defmethod process-taskable-method-52 red-sagecage ((obj red-sagecage)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 red-sagecage ((this red-sagecage)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) (set! (-> a0-1 settings bot-plane w) (- -8192.0)) @@ -462,21 +462,21 @@ (none) ) -(defmethod draw-npc-shadow red-sagecage ((obj red-sagecage)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow red-sagecage ((this red-sagecage)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -485,67 +485,67 @@ (none) ) -(defmethod process-taskable-method-45 red-sagecage ((obj red-sagecage)) - (set! (-> *part-id-table* 2455 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2455 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2457 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2457 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2454 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2454 init-specs 13 initial-valuef) (-> obj rot-x)) +(defmethod process-taskable-method-45 red-sagecage ((this red-sagecage)) + (set! (-> *part-id-table* 2455 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2455 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2457 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2457 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2454 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2454 init-specs 13 initial-valuef) (-> this rot-x)) (the-as symbol 0) ) -(defmethod play-reminder red-sagecage ((obj red-sagecage)) - (set! (-> obj idle-anim) 4) - (set! (-> obj attack-start-anim) 5) - (set! (-> obj attack-anim) 6) - (set! (-> obj beam-joint) 20) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 604) obj)) - (set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 608) obj)) - (set! (-> obj resolution-anim) (new 'static 'spool-anim - :name "redsage-resolution" - :index 7 - :parts 9 - :command-list '((15 send-event self disable-bars) - (45 joint "cameraB") - (216 joint "camera") - (435 joint "cameraB") - (685 joint "camera") - ) - ) +(defmethod play-reminder red-sagecage ((this red-sagecage)) + (set! (-> this idle-anim) 4) + (set! (-> this attack-start-anim) 5) + (set! (-> this attack-anim) 6) + (set! (-> this beam-joint) 20) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 604) this)) + (set! (-> this part-impact) (create-launch-control (-> *part-group-id-table* 608) this)) + (set! (-> this resolution-anim) (new 'static 'spool-anim + :name "redsage-resolution" + :index 7 + :parts 9 + :command-list '((15 send-event self disable-bars) + (45 joint "cameraB") + (216 joint "camera") + (435 joint "cameraB") + (685 joint "camera") + ) + ) ) - (set! (-> obj sound-name) "redsage-fires") - ((the-as (function citb-sage none) (find-parent-method red-sagecage 44)) obj) + (set! (-> this sound-name) "redsage-fires") + ((the-as (function citb-sage none) (find-parent-method red-sagecage 44)) this) (the-as symbol 0) ) -(defmethod process-taskable-method-43 red-sagecage ((obj red-sagecage)) - (if (-> obj beam-on) +(defmethod process-taskable-method-43 red-sagecage ((this red-sagecage)) + (if (-> this beam-on) (return #f) ) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> obj ambient) "RED-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "RED-AM01" #f (-> this root-override trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "RED-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "RED-AM02" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "RED-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "RED-AM03" #f (-> this root-override trans)) ) ) ) ) ) -(defmethod init-from-entity! red-sagecage ((obj red-sagecage) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *redsage-sg* 3 33 (new 'static 'vector :w 8192.0) 5) - (set! (-> obj tasks) (get-task-control (-> obj entity extra perm task))) - (play-reminder obj) - (set! (-> obj sound-flava) (music-flava sage-red)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! red-sagecage ((this red-sagecage) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *redsage-sg* 3 33 (new 'static 'vector :w 8192.0) 5) + (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) + (play-reminder this) + (set! (-> this sound-flava) (music-flava sage-red)) + (process-taskable-method-42 this) (none) ) @@ -558,8 +558,8 @@ ) -(defmethod process-taskable-method-52 blue-sagecage ((obj blue-sagecage)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 blue-sagecage ((this blue-sagecage)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) (set! (-> a0-1 settings bot-plane w) (- -10035.2)) @@ -575,21 +575,21 @@ (none) ) -(defmethod draw-npc-shadow blue-sagecage ((obj blue-sagecage)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow blue-sagecage ((this blue-sagecage)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -598,72 +598,72 @@ (none) ) -(defmethod process-taskable-method-45 blue-sagecage ((obj blue-sagecage)) - (set! (-> *part-id-table* 2448 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2448 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2450 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2450 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2447 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2447 init-specs 13 initial-valuef) (-> obj rot-x)) +(defmethod process-taskable-method-45 blue-sagecage ((this blue-sagecage)) + (set! (-> *part-id-table* 2448 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2448 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2450 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2450 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2447 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2447 init-specs 13 initial-valuef) (-> this rot-x)) (the-as symbol 0) ) -(defmethod play-reminder blue-sagecage ((obj blue-sagecage)) - (set! (-> obj idle-anim) 4) - (set! (-> obj attack-start-anim) 5) - (set! (-> obj attack-anim) 6) - (set! (-> obj beam-joint) 53) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 603) obj)) - (set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 607) obj)) - (set! (-> obj resolution-anim) (new 'static 'spool-anim - :name "bluesage-resolution" - :index 7 - :parts 9 - :command-list '((15 send-event self disable-bars) - (45 joint "cameraB") - (74 shadow self #f) - (185 joint "camera") - (256 joint "cameraB") - (505 joint "camera") - (590 joint "cameraB") - (670 joint "camera") - (875 shadow self #t) - (876 joint "cameraB") - ) - ) +(defmethod play-reminder blue-sagecage ((this blue-sagecage)) + (set! (-> this idle-anim) 4) + (set! (-> this attack-start-anim) 5) + (set! (-> this attack-anim) 6) + (set! (-> this beam-joint) 53) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 603) this)) + (set! (-> this part-impact) (create-launch-control (-> *part-group-id-table* 607) this)) + (set! (-> this resolution-anim) (new 'static 'spool-anim + :name "bluesage-resolution" + :index 7 + :parts 9 + :command-list '((15 send-event self disable-bars) + (45 joint "cameraB") + (74 shadow self #f) + (185 joint "camera") + (256 joint "cameraB") + (505 joint "camera") + (590 joint "cameraB") + (670 joint "camera") + (875 shadow self #t) + (876 joint "cameraB") + ) + ) ) - (set! (-> obj sound-name) "bluesage-fires") - ((the-as (function citb-sage none) (find-parent-method blue-sagecage 44)) obj) + (set! (-> this sound-name) "bluesage-fires") + ((the-as (function citb-sage none) (find-parent-method blue-sagecage 44)) this) (the-as symbol 0) ) -(defmethod process-taskable-method-43 blue-sagecage ((obj blue-sagecage)) - (if (-> obj beam-on) +(defmethod process-taskable-method-43 blue-sagecage ((this blue-sagecage)) + (if (-> this beam-on) (return #f) ) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> obj ambient) "BLU-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BLU-AM01" #f (-> this root-override trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "BLU-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BLU-AM02" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "BLU-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BLU-AM03" #f (-> this root-override trans)) ) ) ) ) ) -(defmethod init-from-entity! blue-sagecage ((obj blue-sagecage) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *bluesage-sg* 3 54 (new 'static 'vector :w 8192.0) 5) - (set! (-> obj tasks) (get-task-control (-> obj entity extra perm task))) - (play-reminder obj) - (set! (-> obj sound-flava) (music-flava sage-blue)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! blue-sagecage ((this blue-sagecage) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *bluesage-sg* 3 54 (new 'static 'vector :w 8192.0) 5) + (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) + (play-reminder this) + (set! (-> this sound-flava) (music-flava sage-blue)) + (process-taskable-method-42 this) (none) ) @@ -676,8 +676,8 @@ ) -(defmethod process-taskable-method-52 yellow-sagecage ((obj yellow-sagecage)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 yellow-sagecage ((this yellow-sagecage)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) (set! (-> a0-1 settings bot-plane w) (- -6144.0)) @@ -693,21 +693,21 @@ (none) ) -(defmethod draw-npc-shadow yellow-sagecage ((obj yellow-sagecage)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow yellow-sagecage ((this yellow-sagecage)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -716,67 +716,67 @@ (none) ) -(defmethod process-taskable-method-45 yellow-sagecage ((obj yellow-sagecage)) - (set! (-> *part-id-table* 2462 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2462 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2464 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2464 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2461 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2461 init-specs 13 initial-valuef) (-> obj rot-x)) +(defmethod process-taskable-method-45 yellow-sagecage ((this yellow-sagecage)) + (set! (-> *part-id-table* 2462 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2462 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2464 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2464 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2461 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2461 init-specs 13 initial-valuef) (-> this rot-x)) (the-as symbol 0) ) -(defmethod play-reminder yellow-sagecage ((obj yellow-sagecage)) - (set! (-> obj idle-anim) 4) - (set! (-> obj attack-start-anim) 5) - (set! (-> obj attack-anim) 6) - (set! (-> obj beam-joint) 74) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 605) obj)) - (set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 609) obj)) - (set! (-> obj resolution-anim) (new 'static 'spool-anim - :name "yellowsage-resolution" - :index 7 - :parts 6 - :command-list '((15 send-event self disable-bars) - (45 joint "cameraB") - (256 joint "camera") - (314 joint "cameraB") - (600 joint "camera") - ) - ) +(defmethod play-reminder yellow-sagecage ((this yellow-sagecage)) + (set! (-> this idle-anim) 4) + (set! (-> this attack-start-anim) 5) + (set! (-> this attack-anim) 6) + (set! (-> this beam-joint) 74) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 605) this)) + (set! (-> this part-impact) (create-launch-control (-> *part-group-id-table* 609) this)) + (set! (-> this resolution-anim) (new 'static 'spool-anim + :name "yellowsage-resolution" + :index 7 + :parts 6 + :command-list '((15 send-event self disable-bars) + (45 joint "cameraB") + (256 joint "camera") + (314 joint "cameraB") + (600 joint "camera") + ) + ) ) - (set! (-> obj sound-name) "yellsage-fire") - ((the-as (function citb-sage none) (find-parent-method yellow-sagecage 44)) obj) + (set! (-> this sound-name) "yellsage-fire") + ((the-as (function citb-sage none) (find-parent-method yellow-sagecage 44)) this) (the-as symbol 0) ) -(defmethod process-taskable-method-43 yellow-sagecage ((obj yellow-sagecage)) - (if (-> obj beam-on) +(defmethod process-taskable-method-43 yellow-sagecage ((this yellow-sagecage)) + (if (-> this beam-on) (return #f) ) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> obj ambient) "YEL-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "YEL-AM01" #f (-> this root-override trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "YEL-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "YEL-AM02" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "YEL-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "YEL-AM03" #f (-> this root-override trans)) ) ) ) ) ) -(defmethod init-from-entity! yellow-sagecage ((obj yellow-sagecage) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *yellowsage-sg* 3 50 (new 'static 'vector :w 8192.0) 5) - (set! (-> obj tasks) (get-task-control (-> obj entity extra perm task))) - (play-reminder obj) - (set! (-> obj sound-flava) (music-flava sage-yellow)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! yellow-sagecage ((this yellow-sagecage) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *yellowsage-sg* 3 50 (new 'static 'vector :w 8192.0) 5) + (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) + (play-reminder this) + (set! (-> this sound-flava) (music-flava sage-yellow)) + (process-taskable-method-42 this) (none) ) @@ -794,49 +794,49 @@ ) -(defmethod process-taskable-method-45 green-sagecage ((obj green-sagecage)) - (set! (-> *part-id-table* 2469 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2469 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2471 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2471 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2468 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2468 init-specs 13 initial-valuef) (-> obj rot-x)) +(defmethod process-taskable-method-45 green-sagecage ((this green-sagecage)) + (set! (-> *part-id-table* 2469 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2469 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2471 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2471 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2468 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2468 init-specs 13 initial-valuef) (-> this rot-x)) (the-as symbol 0) ) -(defmethod play-reminder green-sagecage ((obj green-sagecage)) - (set! (-> obj idle-anim) 4) - (set! (-> obj attack-start-anim) 4) - (set! (-> obj attack-anim) 4) - (set! (-> obj beam-joint) 22) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 606) obj)) - (set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 610) obj)) - (set! (-> obj resolution-anim) (new 'static 'spool-anim - :name "green-sagecage-resolution" - :index 6 - :parts 12 - :command-list '((33 joint "cameraB") - (156 joint "camera") - (405 joint "cameraB") - (576 joint "camera") - (823 joint "cameraB") - (1156 joint "camera") - (1199 joint "cameraB") - ) - ) +(defmethod play-reminder green-sagecage ((this green-sagecage)) + (set! (-> this idle-anim) 4) + (set! (-> this attack-start-anim) 4) + (set! (-> this attack-anim) 4) + (set! (-> this beam-joint) 22) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 606) this)) + (set! (-> this part-impact) (create-launch-control (-> *part-group-id-table* 610) this)) + (set! (-> this resolution-anim) (new 'static 'spool-anim + :name "green-sagecage-resolution" + :index 6 + :parts 12 + :command-list '((33 joint "cameraB") + (156 joint "camera") + (405 joint "cameraB") + (576 joint "camera") + (823 joint "cameraB") + (1156 joint "camera") + (1199 joint "cameraB") + ) + ) ) - (set! (-> obj sound-name) "greensage-fires") - ((the-as (function citb-sage none) (find-parent-method green-sagecage 44)) obj) + (set! (-> this sound-name) "greensage-fires") + ((the-as (function citb-sage none) (find-parent-method green-sagecage 44)) this) (the-as symbol 0) ) -(defmethod play-anim! green-sagecage ((obj green-sagecage) (arg0 symbol)) +(defmethod play-anim! green-sagecage ((this green-sagecage) (arg0 symbol)) (local-vars (v1-7 int)) - (let ((v1-1 (current-status (-> obj tasks)))) + (let ((v1-1 (current-status (-> this tasks)))) (cond ((= v1-1 (task-status need-hint)) (when arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) (close-specific-task! (game-task citadel-sage-blue) (task-status need-hint)) (close-specific-task! (game-task citadel-sage-red) (task-status need-hint)) (close-specific-task! (game-task citadel-sage-yellow) (task-status need-hint)) @@ -855,31 +855,35 @@ ) ) ) - ((begin (set! v1-7 (-> obj which-movie)) (zero? v1-7)) + ((begin (set! v1-7 (-> this which-movie)) (zero? v1-7)) (when arg0 - (send-event (handle->process (-> obj cage)) 'disable-bars) - (+! (-> obj which-movie) 1) - (set! (-> obj draw bounds w) 40960.0) + (send-event (handle->process (-> this cage)) 'disable-bars) + (+! (-> this which-movie) 1) + (set! (-> this draw bounds w) 40960.0) ) - (-> obj resolution-anim) + (-> this resolution-anim) ) ((= v1-7 1) (when arg0 - (+! (-> obj which-movie) 1) - (set! (-> obj draw bounds w) 40960.0) - (set! (-> obj evilbro) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilbro-citadel-sg* #f :to obj)) + (+! (-> this which-movie) 1) + (set! (-> this draw bounds w) 40960.0) + (set! (-> this evilbro) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *evilbro-citadel-sg* #f :to this) + ) ) - (send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilbro)) 'blend-shape #t) - (send-event (handle->process (-> obj evilbro)) 'center-joint 3) - (set! (-> obj evilsis) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilsis-citadel-sg* #f :to obj)) + (send-event (handle->process (-> this evilbro)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this evilbro)) 'blend-shape #t) + (send-event (handle->process (-> this evilbro)) 'center-joint 3) + (set! (-> this evilsis) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *evilsis-citadel-sg* #f :to this) + ) ) - (send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilsis)) 'blend-shape #t) - (send-event (handle->process (-> obj evilsis)) 'center-joint 3) - (if (handle->process (-> obj exitplat)) + (send-event (handle->process (-> this evilsis)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this evilsis)) 'blend-shape #t) + (send-event (handle->process (-> this evilsis)) 'center-joint 3) + (if (handle->process (-> this exitplat)) (format 0 "exitplat activated~%") ) ) @@ -971,11 +975,11 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) @@ -1099,8 +1103,8 @@ ) ) -(defmethod should-display? green-sagecage ((obj green-sagecage)) - (< (-> obj which-movie) 2) +(defmethod should-display? green-sagecage ((this green-sagecage)) + (< (-> this which-movie) 2) ) (defstate idle (green-sagecage) @@ -1120,24 +1124,24 @@ ) ) -(defmethod init-from-entity! green-sagecage ((obj green-sagecage) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *green-sagecage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (-> obj entity extra perm task))) - (play-reminder obj) - (set! (-> obj evilbro) (the-as handle #f)) - (set! (-> obj evilsis) (the-as handle #f)) - (set! (-> obj robotboss) (the-as handle #f)) - (set! (-> obj exitplat) (the-as handle #f)) +(defmethod init-from-entity! green-sagecage ((this green-sagecage) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *green-sagecage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) + (play-reminder this) + (set! (-> this evilbro) (the-as handle #f)) + (set! (-> this evilsis) (the-as handle #f)) + (set! (-> this robotboss) (the-as handle #f)) + (set! (-> this exitplat) (the-as handle #f)) (cond - ((= (current-status (-> obj tasks)) (task-status invalid)) - (set! (-> obj which-movie) 2) + ((= (current-status (-> this tasks)) (task-status invalid)) + (set! (-> this which-movie) 2) ) (else - (set! (-> obj which-movie) 0) + (set! (-> this which-movie) 0) 0 ) ) - (set! (-> obj sound-flava) (music-flava sage)) - (process-taskable-method-42 obj) + (set! (-> this sound-flava) (music-flava sage)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/citadel/citb-bunny.gc b/goal_src/jak1/levels/citadel/citb-bunny.gc index 6fad6a6cf5..392006ee20 100644 --- a/goal_src/jak1/levels/citadel/citb-bunny.gc +++ b/goal_src/jak1/levels/citadel/citb-bunny.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype citb-bunny (snow-bunny) () :heap-base #x190 @@ -39,11 +38,11 @@ :neck-joint 5 :player-look-at-joint 5 :run-travel-speed (meters 6) - :run-rotate-speed (degrees 2880.0) + :run-rotate-speed (degrees 2880) :run-acceleration (meters 1) :run-turn-time (seconds 0.1) :walk-travel-speed (meters 4) - :walk-rotate-speed (degrees 720.0) + :walk-rotate-speed (degrees 720) :walk-acceleration (meters 1) :walk-turn-time (seconds 0.5) :shadow-size (meters 2) @@ -77,59 +76,59 @@ ) ) -(defmethod snow-bunny-method-60 citb-bunny ((obj citb-bunny)) - (initialize-skeleton obj *citb-bunny-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) +(defmethod snow-bunny-method-60 citb-bunny ((this citb-bunny)) + (initialize-skeleton this *citb-bunny-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) 0 (none) ) -(defmethod citb-bunny-method-48 citb-bunny ((obj citb-bunny) (arg0 object)) - (snow-bunny-method-60 obj) - (init-defaults! obj *citb-bunny-nav-enemy-info*) - (logclear! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf03)) +(defmethod citb-bunny-method-48 citb-bunny ((this citb-bunny) (arg0 object)) + (snow-bunny-method-60 this) + (init-defaults! this *citb-bunny-nav-enemy-info*) + (logclear! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond - ((zero? (res-lump-value (-> obj entity) 'mode uint128)) - (set! (-> obj defense) (the-as uint 1)) - (set! (-> obj retreat-timeout) 5.0) + ((zero? (res-lump-value (-> this entity) 'mode uint128)) + (set! (-> this defense) (the-as uint 1)) + (set! (-> this retreat-timeout) 5.0) ) (else - (set! (-> obj defense) (the-as uint 0)) - (set! (-> obj retreat-timeout) 0.1) + (set! (-> this defense) (the-as uint 0)) + (set! (-> this retreat-timeout) 0.1) ) ) - (set! (-> obj last-nondangerous-time) (-> *display* base-frame-counter)) - (set! (-> obj gnd-popup) 16384.0) - (set! (-> obj got-jump-event?) #f) - (set! (-> obj notice-land-anim) 8) - (set! (-> obj attack-anim) 4) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj patrol-rand-distraction) (+ (nav-enemy-rnd-int-count 5) 1)) - (set! (-> obj patrol-hop-failed?) #f) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set-time! (-> this last-nondangerous-time)) + (set! (-> this gnd-popup) 16384.0) + (set! (-> this got-jump-event?) #f) + (set! (-> this notice-land-anim) 8) + (set! (-> this attack-anim) 4) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this patrol-rand-distraction) (+ (nav-enemy-rnd-int-count 5) 1)) + (set! (-> this patrol-hop-failed?) #f) + (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) ) -(defmethod set-jump-height-factor! citb-bunny ((obj citb-bunny) (arg0 int)) +(defmethod set-jump-height-factor! citb-bunny ((this citb-bunny) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (set! (-> obj jump-anim) 6) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.6) + (set! (-> this jump-anim) 6) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.6) ) ((= v1-0 1) - (set! (-> obj jump-anim) 5) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.6) + (set! (-> this jump-anim) 5) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.6) ) ((= v1-0 2) - (set! (-> obj jump-anim) 5) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.4) + (set! (-> this jump-anim) 5) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.4) ) ) ) diff --git a/goal_src/jak1/levels/citadel/citb-drop-plat.gc b/goal_src/jak1/levels/citadel/citb-drop-plat.gc index 2b06333456..dcc9f053d4 100644 --- a/goal_src/jak1/levels/citadel/citb-drop-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-drop-plat.gc @@ -77,10 +77,10 @@ :code (behavior () (suspend) (update-transforms! (-> self root-override)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self mask) (process-mask actor-pause)) (loop - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self duration)) + (if (time-elapsed? (-> self state-time) (-> self duration)) (go drop-plat-drop) ) (suspend) @@ -118,9 +118,9 @@ ) (logior! (-> self draw status) (draw-status hidden)) (ja-post) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay)) + (when (time-elapsed? (-> self state-time) (-> self delay)) (let ((v1-14 (logclear (-> self draw status) (draw-status hidden))) (a0-5 (-> self draw)) ) @@ -143,7 +143,7 @@ ) :code (behavior ((arg0 draw-control)) (set! (-> self interp) 1.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self spin-angle) 0.0) (set! (-> self root-override trans y) (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y)) @@ -154,10 +154,7 @@ (set! (-> gp-0 quad) (-> self root-override trans quad)) (set! (-> gp-0 y) (-> (the-as process-drawable (-> self parent 0)) root trans y)) (loop - (let ((f0-6 - (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) - ) - ) + (let ((f0-6 (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (current-time) (-> self state-time)))))))) (set! (-> self interp) (* f0-6 f0-6)) ) (set! (-> self root-override trans y) @@ -188,13 +185,11 @@ (defstate drop-plat-drop (drop-plat) :code (behavior () (when (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sound-play "bridge-piece-dn") (let ((gp-1 (the int (* 300.0 (rand-vu-float-range 0.2 0.3))))) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-1) - (set! (-> self interp) - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) (the float gp-1)) - ) + (while (not (time-elapsed? (-> self state-time) gp-1)) + (set! (-> self interp) (/ (the float (- (current-time) (-> self state-time))) (the float gp-1))) (set! (-> self spin-angle) (* 910.2222 (sin (* 196608.0 (-> self interp))))) (suspend) ) @@ -211,7 +206,7 @@ ) (go drop-plat-die) ) - (+! (-> self spin-angle) (* (-> self spin-speed) (-> *display* seconds-per-frame))) + (+! (-> self spin-angle) (* (-> self spin-speed) (seconds-per-frame))) (suspend) ) ) @@ -231,8 +226,8 @@ ) ) -(defmethod drop-plat-method-20 drop-plat ((obj drop-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod drop-plat-method-20 drop-plat ((this drop-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -250,31 +245,31 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod drop-plat-method-21 drop-plat ((obj drop-plat)) - (case (-> obj color) +(defmethod drop-plat-method-21 drop-plat ((this drop-plat)) + (case (-> this color) ((1) - (initialize-skeleton obj *citb-drop-plat-red-sg* '()) + (initialize-skeleton this *citb-drop-plat-red-sg* '()) ) ((2) - (initialize-skeleton obj *citb-drop-plat-green-sg* '()) + (initialize-skeleton this *citb-drop-plat-green-sg* '()) ) ((3) - (initialize-skeleton obj *citb-drop-plat-blue-sg* '()) + (initialize-skeleton this *citb-drop-plat-blue-sg* '()) ) ((4) - (initialize-skeleton obj *citb-drop-plat-yellow-sg* '()) + (initialize-skeleton this *citb-drop-plat-yellow-sg* '()) ) (else - (initialize-skeleton obj *citb-drop-plat-sg* '()) + (initialize-skeleton this *citb-drop-plat-sg* '()) ) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -286,13 +281,13 @@ (set! (-> s3-0 y) (* f30-1 (* f0-2 f0-2))) ) (vector-sincos! s5-0 s4-0 s3-0) - (set! (-> obj spin-axis x) (* (-> s4-0 y) (-> s4-0 x))) - (set! (-> obj spin-axis y) (-> s5-0 y)) - (set! (-> obj spin-axis z) (* (-> s4-0 y) (-> s5-0 x))) + (set! (-> this spin-axis x) (* (-> s4-0 y) (-> s4-0 x))) + (set! (-> this spin-axis y) (-> s5-0 y)) + (set! (-> this spin-axis z) (* (-> s4-0 y) (-> s5-0 x))) ) - (set! (-> obj spin-axis w) 1.0) - (set! (-> obj spin-angle) 0.0) - (set! (-> obj spin-speed) (* 8192.0 (+ 1.0 (rand-vu)))) + (set! (-> this spin-axis w) 1.0) + (set! (-> this spin-angle) 0.0) + (set! (-> this spin-speed) (* 8192.0 (+ 1.0 (rand-vu)))) 0 (none) ) @@ -347,11 +342,11 @@ ) -(defmethod relocate citb-drop-plat ((obj citb-drop-plat) (arg0 int)) - (if (nonzero? (-> obj child-array)) - (&+! (-> obj child-array) arg0) +(defmethod relocate citb-drop-plat ((this citb-drop-plat) (arg0 int)) + (if (nonzero? (-> this child-array)) + (&+! (-> this child-array) arg0) ) - (the-as citb-drop-plat ((method-of-type process-drawable relocate) obj arg0)) + (the-as citb-drop-plat ((method-of-type process-drawable relocate) this arg0)) ) (defbehavior citb-drop-plat-spawn-children citb-drop-plat () @@ -408,8 +403,8 @@ ) ) ) - (let ((s2-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s2-1) (seconds 0.12)) + (let ((s2-1 (current-time))) + (until (time-elapsed? s2-1 (seconds 0.12)) (suspend) ) ) @@ -417,7 +412,7 @@ ) ) ) - (set! (-> self drop-time) (-> *display* base-frame-counter)) + (set-time! (-> self drop-time)) 0 (none) ) @@ -469,8 +464,8 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('player-stepped) - (when (>= (- (-> *display* base-frame-counter) (-> self drop-time)) (seconds 0.2)) - (set! (-> self drop-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self drop-time) (seconds 0.2)) + (set-time! (-> self drop-time)) (citb-drop-plat-drop-children (the-as int (-> block param 0))) ) ) @@ -480,10 +475,10 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (citb-drop-plat-spawn-children) (loop - (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (+ (-> self duration) (seconds 2))) + (if (or (time-elapsed? (-> self state-time) (+ (-> self duration) (seconds 2))) (or (not *target*) (< (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) @@ -496,38 +491,38 @@ ) ) -(defmethod init-from-entity! citb-drop-plat ((obj citb-drop-plat) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! citb-drop-plat ((this citb-drop-plat) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (let ((v1-2 (res-lump-data arg0 'count pointer))) (when v1-2 - (set! (-> obj x-count) (-> (the-as (pointer int32) v1-2) 0)) - (set! (-> obj z-count) (-> (the-as (pointer int32) v1-2) 1)) + (set! (-> this x-count) (-> (the-as (pointer int32) v1-2) 0)) + (set! (-> this z-count) (-> (the-as (pointer int32) v1-2) 1)) ) ) - (set! (-> obj child-count) (* (-> obj x-count) (-> obj z-count))) - (set! (-> obj child-color-array) (res-lump-data arg0 'plat-type (pointer int8))) - (when (> (-> obj child-count) 0) - (set! (-> obj child-array) (new 'process 'handle-inline-array (-> obj child-count))) - (dotimes (v1-9 (-> obj child-count)) - (set! (-> obj child-array data v1-9) (the-as handle #f)) + (set! (-> this child-count) (* (-> this x-count) (-> this z-count))) + (set! (-> this child-color-array) (res-lump-data arg0 'plat-type (pointer int8))) + (when (> (-> this child-count) 0) + (set! (-> this child-array) (new 'process 'handle-inline-array (-> this child-count))) + (dotimes (v1-9 (-> this child-count)) + (set! (-> this child-array data v1-9) (the-as handle #f)) ) ) - (set! (-> obj x-spacing) 16384.0) - (set! (-> obj z-spacing) 16384.0) - (set! (-> obj idle-distance) (+ 40960.0 (* 0.5 (the float (-> obj z-count)) (-> obj z-spacing)))) - (set! (-> obj duration) (the-as time-frame (the int (* 300.0 (+ 2.0 (the float (-> obj z-count))))))) + (set! (-> this x-spacing) 16384.0) + (set! (-> this z-spacing) 16384.0) + (set! (-> this idle-distance) (+ 40960.0 (* 0.5 (the float (-> this z-count)) (-> this z-spacing)))) + (set! (-> this duration) (the-as time-frame (the int (* 300.0 (+ 2.0 (the float (-> this z-count))))))) (let ((f0-7 (res-lump-float arg0 'rotoffset))) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-7) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-7) ) - (vector-x-quaternion! (-> obj x-dir) (-> obj root quat)) - (vector-z-quaternion! (-> obj z-dir) (-> obj root quat)) - (set! (-> obj origin quad) (-> obj root trans quad)) - (let ((f0-10 (* -0.5 (the float (+ (-> obj x-count) -1)) (-> obj x-spacing))) - (f30-0 (* -0.5 (the float (+ (-> obj z-count) -1)) (-> obj z-spacing))) + (vector-x-quaternion! (-> this x-dir) (-> this root quat)) + (vector-z-quaternion! (-> this z-dir) (-> this root quat)) + (set! (-> this origin quad) (-> this root trans quad)) + (let ((f0-10 (* -0.5 (the float (+ (-> this x-count) -1)) (-> this x-spacing))) + (f30-0 (* -0.5 (the float (+ (-> this z-count) -1)) (-> this z-spacing))) ) - (vector+*! (-> obj origin) (-> obj origin) (-> obj x-dir) f0-10) - (vector+*! (-> obj origin) (-> obj origin) (-> obj z-dir) f30-0) + (vector+*! (-> this origin) (-> this origin) (-> this x-dir) f0-10) + (vector+*! (-> this origin) (-> this origin) (-> this z-dir) f30-0) ) (go citb-drop-plat-idle) (none) diff --git a/goal_src/jak1/levels/citadel/citb-plat.gc b/goal_src/jak1/levels/citadel/citb-plat.gc index 31e5b86808..7301dd672e 100644 --- a/goal_src/jak1/levels/citadel/citb-plat.gc +++ b/goal_src/jak1/levels/citadel/citb-plat.gc @@ -80,8 +80,8 @@ :post rider-post ) -(defmethod citb-base-plat-method-21 citb-base-plat ((obj citb-base-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod citb-base-plat-method-21 citb-base-plat ((this citb-base-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -99,31 +99,31 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod citb-base-plat-method-22 citb-base-plat ((obj citb-base-plat)) - (initialize-skeleton obj *plat-citb-sg* '()) +(defmethod citb-base-plat-method-22 citb-base-plat ((this citb-base-plat)) + (initialize-skeleton this *plat-citb-sg* '()) 0 (none) ) -(defmethod citb-base-plat-method-24 citb-base-plat ((obj citb-base-plat)) - (go (method-of-object obj citb-base-plat-idle)) +(defmethod citb-base-plat-method-24 citb-base-plat ((this citb-base-plat)) + (go (method-of-object this citb-base-plat-idle)) 0 (none) ) -(defmethod init-from-entity! citb-base-plat ((obj citb-base-plat) (arg0 entity-actor)) - (citb-base-plat-method-21 obj) - (process-drawable-from-entity! obj arg0) - (set! (-> obj idle-distance) 245760.0) - (citb-base-plat-method-22 obj) - (logior! (-> obj skel status) (janim-status inited)) - (citb-base-plat-method-24 obj) +(defmethod init-from-entity! citb-base-plat ((this citb-base-plat) (arg0 entity-actor)) + (citb-base-plat-method-21 this) + (process-drawable-from-entity! this arg0) + (set! (-> this idle-distance) 245760.0) + (citb-base-plat-method-22 this) + (logior! (-> this skel status) (janim-status inited)) + (citb-base-plat-method-24 this) (none) ) @@ -136,8 +136,8 @@ ) -(defmethod baseplat-method-24 citb-plat-eco ((obj citb-plat-eco)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod baseplat-method-24 citb-plat-eco ((this citb-plat-eco)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -155,23 +155,23 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod baseplat-method-26 citb-plat-eco ((obj citb-plat-eco)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj notice-dist) 8192.0) +(defmethod baseplat-method-26 citb-plat-eco ((this citb-plat-eco)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this notice-dist) 8192.0) (none) ) -(defmethod get-unlit-skel citb-plat-eco ((obj citb-plat-eco)) +(defmethod get-unlit-skel citb-plat-eco ((this citb-plat-eco)) *plat-eco-citb-unlit-sg* ) -(defmethod get-lit-skel citb-plat-eco ((obj citb-plat-eco)) +(defmethod get-lit-skel citb-plat-eco ((this citb-plat-eco)) *plat-eco-citb-lit-sg* ) @@ -202,12 +202,12 @@ ) ) -(defmethod get-unlit-skel citb-plat ((obj citb-plat)) +(defmethod get-unlit-skel citb-plat ((this citb-plat)) *plat-citb-sg* ) -(defmethod baseplat-method-24 citb-plat ((obj citb-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod baseplat-method-24 citb-plat ((this citb-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -225,33 +225,33 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod baseplat-method-26 citb-plat ((obj citb-plat)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj root-override scale quad) (-> (res-lump-struct (-> obj entity) 'scale vector) quad)) - (let ((f0-0 (-> obj root-override scale x))) - (set! (-> obj root-override root-prim local-sphere w) - (* (-> obj root-override root-prim local-sphere w) f0-0) +(defmethod baseplat-method-26 citb-plat ((this citb-plat)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this root-override scale quad) (-> (res-lump-struct (-> this entity) 'scale vector) quad)) + (let ((f0-0 (-> this root-override scale x))) + (set! (-> this root-override root-prim local-sphere w) + (* (-> this root-override root-prim local-sphere w) f0-0) ) - (set! (-> obj draw bounds w) (* (-> obj draw bounds w) f0-0)) + (set! (-> this draw bounds w) (* (-> this draw bounds w) f0-0)) ) - (set! (-> obj trans-offset quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) - (-> obj entity) - 'trans-offset - 'interp - -1000000000.0 - *null-vector* - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - quad - ) + (set! (-> this trans-offset quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) + (-> this entity) + 'trans-offset + 'interp + -1000000000.0 + *null-vector* + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + quad + ) ) 0 (none) @@ -291,14 +291,14 @@ ) (logclear! (-> self draw status) (draw-status hidden)) (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (-> self delay))) (ja-post) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (let ((f30-0 (- 1.0 (* 0.0011111111 (the float (- (-> *display* base-frame-counter) (-> self state-time))))))) + (let ((f30-0 (- 1.0 (* 0.0011111111 (the float (- (current-time) (-> self state-time))))))) (when (< f30-0 0.0) (set! (-> self root-override trans y) (-> self rise-height)) (go-virtual citb-base-plat-active) @@ -330,33 +330,33 @@ :post ja-post ) -(defmethod citb-base-plat-method-22 citb-stair-plat ((obj citb-stair-plat)) - (initialize-skeleton obj *plat-citb-sg* '()) - (set! (-> obj rise-height) (-> obj root-override trans y)) - (set! (-> obj idle-height) (+ -409600.0 (-> obj rise-height))) - (set! (-> obj root-override trans y) (-> obj idle-height)) - (set! (-> obj rise) #f) - (set! (-> obj delay) - (the-as time-frame (the int (* 300.0 (res-lump-float (-> obj entity) 'delay :default 1.0)))) +(defmethod citb-base-plat-method-22 citb-stair-plat ((this citb-stair-plat)) + (initialize-skeleton this *plat-citb-sg* '()) + (set! (-> this rise-height) (-> this root-override trans y)) + (set! (-> this idle-height) (+ -409600.0 (-> this rise-height))) + (set! (-> this root-override trans y) (-> this idle-height)) + (set! (-> this rise) #f) + (set! (-> this delay) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'delay :default 1.0)))) ) (let ((f0-7 1.5)) - (set-vector! (-> obj root-override scale) f0-7 f0-7 f0-7 1.0) - (set! (-> obj root-override root-prim local-sphere w) - (* (-> obj root-override root-prim local-sphere w) f0-7) + (set-vector! (-> this root-override scale) f0-7 f0-7 f0-7 1.0) + (set! (-> this root-override root-prim local-sphere w) + (* (-> this root-override root-prim local-sphere w) f0-7) ) - (set! (-> obj draw bounds w) (* (-> obj draw bounds w) f0-7)) + (set! (-> this draw bounds w) (* (-> this draw bounds w) f0-7)) ) 0 (none) ) -(defmethod citb-base-plat-method-24 citb-stair-plat ((obj citb-stair-plat)) +(defmethod citb-base-plat-method-24 citb-stair-plat ((this citb-stair-plat)) (if (and (task-complete? *game-info* (game-task citadel-sage-blue)) (task-complete? *game-info* (game-task citadel-sage-red)) (task-complete? *game-info* (game-task citadel-sage-yellow)) ) - (go (method-of-object obj citb-base-plat-active)) - (go (method-of-object obj citb-base-plat-idle)) + (go (method-of-object this citb-base-plat-active)) + (go (method-of-object this citb-base-plat-idle)) ) 0 (none) @@ -405,27 +405,27 @@ ) -(defmethod rigid-body-platform-method-22 citb-chain-plat ((obj citb-chain-plat) (arg0 vector) (arg1 float)) +(defmethod rigid-body-platform-method-22 citb-chain-plat ((this citb-chain-plat) (arg0 vector) (arg1 float)) (+ 12288.0 (* 2048.0 - (fmax 0.0 (fmin 1.0 (* 0.000024414063 (-> obj float-height-offset)))) + (fmax 0.0 (fmin 1.0 (* 0.000024414063 (-> this float-height-offset)))) (cos (* 109.22667 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z))))) ) - (-> obj float-height-offset) - (-> obj orig-trans y) + (-> this float-height-offset) + (-> this orig-trans y) ) ) -(defmethod rigid-body-platform-method-27 citb-chain-plat ((obj citb-chain-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-27 citb-chain-plat ((this citb-chain-plat) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 arg0 (-> obj rbody position)) + (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) (let* ((f0-1 (vector-length gp-0)) (f1-1 (* 4.0 (fmax 0.0 (fmin 4096.0 (+ -819.2 f0-1))))) ) (when (< 0.0 f1-1) (vector-float*! gp-0 gp-0 (/ f1-1 f0-1)) - (rigid-body-method-15 (-> obj rbody) gp-0) + (rigid-body-method-15 (-> this rbody) gp-0) ) ) ) @@ -433,9 +433,9 @@ (none) ) -(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) - (rigid-body-platform-method-27 obj (-> obj orig-trans)) +(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) + (rigid-body-platform-method-27 this (-> this orig-trans)) 0 (none) ) @@ -443,8 +443,8 @@ (defstate rigid-body-platform-idle (citb-chain-plat) :virtual #t :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (set-time! (-> self state-time)) (if (and (and *target* (>= (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) @@ -465,7 +465,7 @@ :virtual #t :event rigid-body-platform-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (stop! (-> self sound)) @@ -478,18 +478,18 @@ ) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) - (when (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (when (not (time-elapsed? (-> self state-time) (seconds 1))) (if (rand-vu-percent? 0.05) (spawn-projectile-blue *target*) ) ) - (seek! (-> self float-height-offset) (-> self float-offset) (* 8192.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) (-> self float-offset) (* 8192.0 (seconds-per-frame))) (draw-eco-beam (-> self root-overlay trans) (-> self beam-end)) (update-trans! (-> self sound) (-> self root-overlay trans)) (update! (-> self sound)) ) (else - (seek! (-> self float-height-offset) (-> self idle-offset) (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) (-> self idle-offset) (* 16384.0 (seconds-per-frame))) (stop! (-> self sound)) (if (= (-> self float-height-offset) (-> self idle-offset)) (go citb-chain-plat-settle) @@ -511,9 +511,9 @@ ) (set! (-> gp-0 quad) (-> self root-overlay trans quad)) (quaternion-copy! s5-0 (-> self root-overlay quat)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) - (let ((f30-0 (* 0.013333334 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.25))) + (let ((f30-0 (* 0.013333334 (the float (- (current-time) (-> self state-time)))))) (quaternion-slerp! (-> self root-overlay quat) s5-0 (-> self orig-quat) f30-0) (vector-lerp! (-> self root-overlay trans) gp-0 (-> self orig-trans) f30-0) ) @@ -535,8 +535,8 @@ :post rider-post ) -(defmethod rigid-body-platform-method-30 citb-chain-plat ((obj citb-chain-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 citb-chain-plat ((this citb-chain-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -554,28 +554,28 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-31 citb-chain-plat ((obj citb-chain-plat)) - (initialize-skeleton obj *citb-chain-plat-sg* '()) - (set! (-> obj orig-trans quad) (-> obj root-overlay trans quad)) - (quaternion-copy! (-> obj orig-quat) (-> obj root-overlay quat)) - (set! (-> obj beam-end quad) (-> obj orig-trans quad)) - (+! (-> obj beam-end y) -49152.0) - (rigid-body-platform-method-29 obj *citb-chain-plat-constants*) - (set! (-> obj idle-offset) 0.0) - (set! (-> obj float-offset) (res-lump-float (-> obj entity) 'height-info :default 4096.0)) - (set! (-> obj float-height-offset) (-> obj idle-offset)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "eco-plat-hover" :fo-max 50) (-> obj root-overlay trans)) +(defmethod rigid-body-platform-method-31 citb-chain-plat ((this citb-chain-plat)) + (initialize-skeleton this *citb-chain-plat-sg* '()) + (set! (-> this orig-trans quad) (-> this root-overlay trans quad)) + (quaternion-copy! (-> this orig-quat) (-> this root-overlay quat)) + (set! (-> this beam-end quad) (-> this orig-trans quad)) + (+! (-> this beam-end y) -49152.0) + (rigid-body-platform-method-29 this *citb-chain-plat-constants*) + (set! (-> this idle-offset) 0.0) + (set! (-> this float-offset) (res-lump-float (-> this entity) 'height-info :default 4096.0)) + (set! (-> this float-height-offset) (-> this idle-offset)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "eco-plat-hover" :fo-max 50) (-> this root-overlay trans)) ) - (let ((s5-0 (-> obj info control-point-count))) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0))))) (set! (-> s3-0 local-pos x) (* 16384.0 (sin f30-0))) (set! (-> s3-0 local-pos y) 0.0) @@ -623,8 +623,8 @@ ) ) -(defmethod citb-base-plat-method-21 citb-rotatebox ((obj citb-rotatebox)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod citb-base-plat-method-21 citb-rotatebox ((this citb-rotatebox)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -642,14 +642,14 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod citb-base-plat-method-22 citb-rotatebox ((obj citb-rotatebox)) - (initialize-skeleton obj *citb-rotatebox-sg* '()) +(defmethod citb-base-plat-method-22 citb-rotatebox ((this citb-rotatebox)) + (initialize-skeleton this *citb-rotatebox-sg* '()) 0 (none) ) @@ -684,8 +684,8 @@ ) ) -(defmethod citb-base-plat-method-21 citb-donut ((obj citb-donut)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod citb-base-plat-method-21 citb-donut ((this citb-donut)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -703,19 +703,19 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod citb-base-plat-method-22 citb-donut ((obj citb-donut)) - (initialize-skeleton obj *citb-donut-sg* '()) - (setup-params! (-> obj sync) (the-as uint 9000) 0.0 0.15 0.15) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> obj root-override trans)) +(defmethod citb-base-plat-method-22 citb-donut ((this citb-donut)) + (initialize-skeleton this *citb-donut-sg* '()) + (setup-params! (-> this sync) (the-as uint 9000) 0.0 0.15 0.15) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root-override trans)) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) ) @@ -746,12 +746,12 @@ ) ) -(defmethod get-unlit-skel citb-stopbox ((obj citb-stopbox)) +(defmethod get-unlit-skel citb-stopbox ((this citb-stopbox)) *citb-stopbox-sg* ) -(defmethod baseplat-method-24 citb-stopbox ((obj citb-stopbox)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod baseplat-method-24 citb-stopbox ((this citb-stopbox)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -769,15 +769,15 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod baseplat-method-26 citb-stopbox ((obj citb-stopbox)) - (logior! (-> obj fact options) (fact-options wrap-phase)) - (logclear! (-> obj mask) (process-mask actor-pause)) +(defmethod baseplat-method-26 citb-stopbox ((this citb-stopbox)) + (logior! (-> this fact options) (fact-options wrap-phase)) + (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) ) @@ -904,8 +904,8 @@ :post transform-post ) -(defmethod init-from-entity! citb-firehose ((obj citb-firehose) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! citb-firehose ((this citb-firehose) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -936,14 +936,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *citb-firehose-sg* '()) - (load-params! (-> obj sync) obj (the-as uint 900) 0.0 0.15 0.15) - (set! (-> obj idle-distance) 286720.0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 685) obj)) - (clear-collide-with-as (-> obj root-override)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *citb-firehose-sg* '()) + (load-params! (-> this sync) this (the-as uint 900) 0.0 0.15 0.15) + (set! (-> this idle-distance) 286720.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 685) this)) + (clear-collide-with-as (-> this root-override)) (go citb-firehose-idle) (none) ) @@ -995,9 +995,9 @@ :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root-override)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (let ((f30-0 (- 1.0 (* 0.0016666667 (the float (- (-> *display* base-frame-counter) (-> self state-time))))))) + (let ((f30-0 (- 1.0 (* 0.0016666667 (the float (- (current-time) (-> self state-time))))))) (when (< f30-0 0.0) (set! (-> self root-override trans y) (-> self rise-height)) (go-virtual plat-button-idle) @@ -1062,26 +1062,26 @@ :post transform-post ) -(defmethod can-activate? citb-exit-plat ((obj citb-exit-plat)) +(defmethod can-activate? citb-exit-plat ((this citb-exit-plat)) (not (movie?)) ) -(defmethod plat-button-method-31 citb-exit-plat ((obj citb-exit-plat)) - (initialize-skeleton obj *citb-exit-plat-sg* '()) +(defmethod plat-button-method-31 citb-exit-plat ((this citb-exit-plat)) + (initialize-skeleton this *citb-exit-plat-sg* '()) (none) ) -(defmethod plat-button-method-32 citb-exit-plat ((obj citb-exit-plat)) - (if (-> obj activated) - (go (method-of-object obj plat-button-idle)) +(defmethod plat-button-method-32 citb-exit-plat ((this citb-exit-plat)) + (if (-> this activated) + (go (method-of-object this plat-button-idle)) (go citb-exit-plat-idle) ) 0 (none) ) -(defmethod plat-button-method-28 citb-exit-plat ((obj citb-exit-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod plat-button-method-28 citb-exit-plat ((this citb-exit-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1116,43 +1116,43 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) s5-0 ) ) -(defmethod can-target-move? citb-exit-plat ((obj citb-exit-plat)) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj draw light-index) (the-as uint 255)) - (let ((a0-5 (entity-actor-lookup (-> obj entity) 'state-actor 0))) - (set! (-> obj activated) (logtest? (-> a0-5 extra perm status) (entity-perm-status complete))) +(defmethod can-target-move? citb-exit-plat ((this citb-exit-plat)) + (process-entity-status! this (entity-perm-status bit-7) #t) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 255)) + (let ((a0-5 (entity-actor-lookup (-> this entity) 'state-actor 0))) + (set! (-> this activated) (logtest? (-> a0-5 extra perm status) (entity-perm-status complete))) ) (cond ((= (-> *game-info* current-continue level) 'finalboss) - (let ((v1-8 (-> obj entity extra perm))) + (let ((v1-8 (-> this entity extra perm))) (logior! (-> v1-8 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-8 user-int8 0) 1) ) - (set! (-> obj activated) #t) - (set! (-> obj path-pos) 0.0) + (set! (-> this activated) #t) + (set! (-> this path-pos) 0.0) ) (else - (set! (-> obj path-pos) 1.0) + (set! (-> this path-pos) 1.0) ) ) - (let ((s5-0 (-> obj root-override trans))) - (eval-path-curve! (-> obj path) s5-0 (-> obj path-pos) 'interp) - (vector+! s5-0 s5-0 (-> obj trans-off)) + (let ((s5-0 (-> this root-override trans))) + (eval-path-curve! (-> this path) s5-0 (-> this path-pos) 'interp) + (vector+! s5-0 s5-0 (-> this trans-off)) ) - (set! (-> obj rise-height) (-> obj root-override trans y)) - (set! (-> obj idle-height) (+ -286720.0 (-> obj rise-height))) - (if (-> obj activated) - (set! (-> obj root-override trans y) (-> obj rise-height)) - (set! (-> obj root-override trans y) (-> obj idle-height)) + (set! (-> this rise-height) (-> this root-override trans y)) + (set! (-> this idle-height) (+ -286720.0 (-> this rise-height))) + (if (-> this activated) + (set! (-> this root-override trans y) (-> this rise-height)) + (set! (-> this root-override trans y) (-> this idle-height)) ) - (set! (-> obj allow-auto-kill) #f) - (process-entity-status! obj (entity-perm-status bit-3) #t) + (set! (-> this allow-auto-kill) #f) + (process-entity-status! this (entity-perm-status bit-3) #t) 0 (none) ) diff --git a/goal_src/jak1/levels/common/battlecontroller.gc b/goal_src/jak1/levels/common/battlecontroller.gc index 742c451b09..fd041ee21b 100644 --- a/goal_src/jak1/levels/common/battlecontroller.gc +++ b/goal_src/jak1/levels/common/battlecontroller.gc @@ -386,13 +386,13 @@ battlecontroller-default-event-handler 0 ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (-> self prespawn) (battlecontroller-fill-all-spawners) ) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (set-time! (-> self state-time)) (when (and *target* (>= (-> self activate-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) @@ -447,11 +447,11 @@ battlecontroller-default-event-handler (battlecontroller-update-spawners) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (battlecontroller-camera-on) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (set-time! (-> self state-time)) (let ((gp-0 0)) (let ((v1-8 (-> self child))) (while v1-8 @@ -465,8 +465,8 @@ battlecontroller-default-event-handler (go-virtual battlecontroller-die) ) (when (< gp-0 (-> self target-count)) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (-> self spawn-period)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (-> self spawn-period)) (suspend) ) ) @@ -579,54 +579,54 @@ battlecontroller-default-event-handler :post #f ) -(defmethod relocate battlecontroller ((obj battlecontroller) (arg0 int)) - (dotimes (v1-0 (-> obj spawner-count)) - (let ((a0-3 (-> obj spawner-array v1-0))) +(defmethod relocate battlecontroller ((this battlecontroller) (arg0 int)) + (dotimes (v1-0 (-> this spawner-count)) + (let ((a0-3 (-> this spawner-array v1-0))) (if (nonzero? (-> a0-3 path)) (&+! (-> a0-3 path) arg0) ) ) ) - (if (nonzero? (-> obj path-spawn)) - (&+! (-> obj path-spawn) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method battlecontroller 7)) this arg0) ) ) -(defmethod deactivate battlecontroller ((obj battlecontroller)) +(defmethod deactivate battlecontroller ((this battlecontroller)) (with-pp (let ((gp-0 pp)) - (set! pp obj) + (set! pp this) (battlecontroller-off) (set! pp gp-0) ) - ((the-as (function process-drawable none) (find-parent-method battlecontroller 10)) obj) + ((the-as (function process-drawable none) (find-parent-method battlecontroller 10)) this) 0 (none) ) ) -(defmethod battlecontroller-method-27 battlecontroller ((obj battlecontroller)) +(defmethod battlecontroller-method-27 battlecontroller ((this battlecontroller)) (local-vars (sv-16 res-tag)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj activate-distance) 122880.0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this activate-distance) 122880.0) (let ((s5-0 0)) (let* ((s4-0 '(patha pathb pathc pathd pathe pathf pathg pathh)) (s2-0 (car s4-0)) ) (while (not (null? s4-0)) - (let ((v1-7 (res-lump-struct (-> obj entity) (the-as symbol s2-0) structure)) - (s3-0 (-> obj spawner-array s5-0)) + (let ((v1-7 (res-lump-struct (-> this entity) (the-as symbol s2-0) structure)) + (s3-0 (-> this spawner-array s5-0)) ) (when (and v1-7 (< s5-0 8)) - (set! (-> s3-0 path) (new 'process 'path-control obj (the-as symbol s2-0) 0.0)) + (set! (-> s3-0 path) (new 'process 'path-control this (the-as symbol s2-0) 0.0)) (set! (-> s3-0 creature) (the-as handle #f)) (set! (-> s3-0 trigger-actor) #f) (set! (-> s3-0 blocker-actor) #f) @@ -639,96 +639,96 @@ battlecontroller-default-event-handler (set! s2-0 (car s4-0)) ) ) - (set! (-> obj spawner-count) s5-0) + (set! (-> this spawner-count) s5-0) ) 0 - (if (res-lump-struct (-> obj entity) 'pathspawn structure) - (set! (-> obj path-spawn) (new 'process 'path-control obj 'pathspawn 0.0)) + (if (res-lump-struct (-> this entity) 'pathspawn structure) + (set! (-> this path-spawn) (new 'process 'path-control this 'pathspawn 0.0)) ) - (let ((s5-1 (entity-actor-count (-> obj entity) 'spawner-trigger-actor))) + (let ((s5-1 (entity-actor-count (-> this entity) 'spawner-trigger-actor))) (dotimes (s4-1 s5-1) - (if (< s4-1 (-> obj spawner-count)) - (set! (-> obj spawner-array s4-1 trigger-actor) - (entity-actor-lookup (-> obj entity) 'spawner-trigger-actor s4-1) + (if (< s4-1 (-> this spawner-count)) + (set! (-> this spawner-array s4-1 trigger-actor) + (entity-actor-lookup (-> this entity) 'spawner-trigger-actor s4-1) ) ) ) ) - (let ((s5-2 (entity-actor-count (-> obj entity) 'spawner-blocker-actor))) + (let ((s5-2 (entity-actor-count (-> this entity) 'spawner-blocker-actor))) (dotimes (s4-2 s5-2) - (if (< s4-2 (-> obj spawner-count)) - (set! (-> obj spawner-array s4-2 blocker-actor) - (entity-actor-lookup (-> obj entity) 'spawner-blocker-actor s4-2) + (if (< s4-2 (-> this spawner-count)) + (set! (-> this spawner-array s4-2 blocker-actor) + (entity-actor-lookup (-> this entity) 'spawner-blocker-actor s4-2) ) ) ) ) - (set! (-> obj spawn-period) - (the-as time-frame (the int (* 300.0 (res-lump-float (-> obj entity) 'delay :default 0.1)))) + (set! (-> this spawn-period) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'delay :default 0.1)))) ) - (set! (-> obj target-count) 10) - (set! (-> obj max-spawn-count) 100) - (set! (-> obj spawn-count) 0) - (set! (-> obj die-count) 0) - (set! (-> obj creature-type-count) 1) - (set! (-> obj noticed-player) #f) - (set! (-> obj camera-on) #f) - (let ((v1-46 (res-lump-data (-> obj entity) 'num-lurkers (pointer int32)))) + (set! (-> this target-count) 10) + (set! (-> this max-spawn-count) 100) + (set! (-> this spawn-count) 0) + (set! (-> this die-count) 0) + (set! (-> this creature-type-count) 1) + (set! (-> this noticed-player) #f) + (set! (-> this camera-on) #f) + (let ((v1-46 (res-lump-data (-> this entity) 'num-lurkers (pointer int32)))) (when v1-46 - (set! (-> obj target-count) (-> v1-46 0)) - (set! (-> obj max-spawn-count) (-> v1-46 1)) + (set! (-> this target-count) (-> v1-46 0)) + (set! (-> this max-spawn-count) (-> v1-46 1)) ) ) - (set! (-> obj creature-type-array 0 type2) babak) - (set! (-> obj creature-type-array 0 percent) 1.0) + (set! (-> this creature-type-array 0 type2) babak) + (set! (-> this creature-type-array 0 percent) 1.0) (let ((s5-3 0)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-49 (res-lump-data (-> obj entity) 'lurker-type pointer :tag-ptr (& sv-16)))) + (let ((v1-49 (res-lump-data (-> this entity) 'lurker-type pointer :tag-ptr (& sv-16)))) (when v1-49 (dotimes (a0-22 (the-as int (-> sv-16 elt-count))) (let ((a1-15 (-> (the-as (pointer uint32) (&+ v1-49 (* a0-22 4)))))) (when (nonzero? a1-15) - (set! (-> obj creature-type-array s5-3 type2) (the-as type a1-15)) + (set! (-> this creature-type-array s5-3 type2) (the-as type a1-15)) (+! s5-3 1) ) ) ) ) ) - (set! (-> obj creature-type-count) s5-3) + (set! (-> this creature-type-count) s5-3) ) - (let ((v1-52 (res-lump-data (-> obj entity) 'percent pointer)) + (let ((v1-52 (res-lump-data (-> this entity) 'percent pointer)) (f0-6 0.0) ) (when v1-52 - (dotimes (a0-26 (-> obj creature-type-count)) - (set! (-> obj creature-type-array a0-26 percent) (fabs (-> (the-as (pointer float) (&+ v1-52 (* a0-26 4)))))) - (+! f0-6 (-> obj creature-type-array a0-26 percent)) + (dotimes (a0-26 (-> this creature-type-count)) + (set! (-> this creature-type-array a0-26 percent) (fabs (-> (the-as (pointer float) (&+ v1-52 (* a0-26 4)))))) + (+! f0-6 (-> this creature-type-array a0-26 percent)) ) (cond ((= f0-6 0.0) - (set! (-> obj creature-type-count) 1) - (set! (-> obj creature-type-array 0 percent) 1.0) + (set! (-> this creature-type-count) 1) + (set! (-> this creature-type-array 0 percent) 1.0) ) (else (let ((f0-9 (/ 1.0 f0-6))) - (dotimes (v1-57 (-> obj creature-type-count)) - (set! (-> obj creature-type-array 0 percent) (* (-> obj creature-type-array 0 percent) f0-9)) + (dotimes (v1-57 (-> this creature-type-count)) + (set! (-> this creature-type-array 0 percent) (* (-> this creature-type-array 0 percent) f0-9)) ) ) ) ) ) ) - (set! (-> obj final-pickup-type) - (res-lump-value (-> obj entity) 'final-pickup pickup-type :default (the-as uint128 7)) + (set! (-> this final-pickup-type) + (res-lump-value (-> this entity) 'final-pickup pickup-type :default (the-as uint128 7)) ) - (let ((s5-4 (res-lump-data (-> obj entity) 'pickup-type pointer)) - (s4-3 (res-lump-data (-> obj entity) 'max-pickup-count pointer)) - (v1-63 (res-lump-data (-> obj entity) 'pickup-percent pointer)) + (let ((s5-4 (res-lump-data (-> this entity) 'pickup-type pointer)) + (s4-3 (res-lump-data (-> this entity) 'max-pickup-count pointer)) + (v1-63 (res-lump-data (-> this entity) 'pickup-percent pointer)) ) - (dotimes (a0-34 (-> obj creature-type-count)) - (let ((a1-34 (-> obj creature-type-array a0-34))) + (dotimes (a0-34 (-> this creature-type-count)) + (let ((a1-34 (-> this creature-type-array a0-34))) (set! (-> a1-34 pickup-count) 0) (if s5-4 (set! (-> a1-34 pickup-type) (the-as pickup-type (-> (the-as (pointer int32) (&+ s5-4 (* a0-34 4)))))) @@ -742,30 +742,30 @@ battlecontroller-default-event-handler ) ) ) - (set! (-> obj misty-ambush-collision-hack) #f) - (set! (-> obj disable-ocean) #f) - (set! (-> obj disable-mid-ocean) #f) - (set! (-> obj disable-near-ocean) #t) - (set! (-> obj final-pickup-spawn-point quad) (-> obj root trans quad)) - (set! (-> obj prespawn) (= (res-lump-value (-> obj entity) 'mode uint128) 1)) + (set! (-> this misty-ambush-collision-hack) #f) + (set! (-> this disable-ocean) #f) + (set! (-> this disable-mid-ocean) #f) + (set! (-> this disable-near-ocean) #t) + (set! (-> this final-pickup-spawn-point quad) (-> this root trans quad)) + (set! (-> this prespawn) (= (res-lump-value (-> this entity) 'mode uint128) 1)) 0 (none) ) -(defmethod cleanup-if-finished! battlecontroller ((obj battlecontroller)) +(defmethod cleanup-if-finished! battlecontroller ((this battlecontroller)) (if (battlecontroller-task-completed?) - (go (method-of-object obj battlecontroller-die)) - (go (method-of-object obj battlecontroller-idle)) + (go (method-of-object this battlecontroller-die)) + (go (method-of-object this battlecontroller-idle)) ) 0 (none) ) -(defmethod init-from-entity! battlecontroller ((obj battlecontroller) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (battlecontroller-method-27 obj) - (cleanup-if-finished! obj) +(defmethod init-from-entity! battlecontroller ((this battlecontroller) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (battlecontroller-method-27 this) + (cleanup-if-finished! this) (none) ) diff --git a/goal_src/jak1/levels/common/launcherdoor.gc b/goal_src/jak1/levels/common/launcherdoor.gc index 1360a15215..d3b288f866 100644 --- a/goal_src/jak1/levels/common/launcherdoor.gc +++ b/goal_src/jak1/levels/common/launcherdoor.gc @@ -133,11 +133,11 @@ :post ja-post ) -(defmethod init-from-entity! launcherdoor ((obj launcherdoor) (arg0 entity-actor)) - (set! (-> obj notify-player-passed-thru?) #f) - (set! (-> obj open-speed) 4.0) - (set! (-> obj close-speed) 2.0) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! launcherdoor ((this launcherdoor) (arg0 entity-actor)) + (set! (-> this notify-player-passed-thru?) #f) + (set! (-> this open-speed) 4.0) + (set! (-> this close-speed) 2.0) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -149,37 +149,37 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (cond - ((= (-> (if (-> obj entity) - (-> obj entity extra level) + ((= (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name ) 'maincave ) - (set! (-> obj close-speed) 4.0) - (initialize-skeleton obj *launcherdoor-maincave-sg* '()) + (set! (-> this close-speed) 4.0) + (initialize-skeleton this *launcherdoor-maincave-sg* '()) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) ) (else - (initialize-skeleton obj *launcherdoor-sg* '()) + (initialize-skeleton this *launcherdoor-sg* '()) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) @@ -187,19 +187,19 @@ ) ) (transform-post) - (case (-> obj entity extra level name) + (case (-> this entity extra level name) (('jungle) - (set! (-> obj draw shadow-mask) (the-as uint 28)) + (set! (-> this draw shadow-mask) (the-as uint 28)) ) ) - (set! (-> obj load-mode) (-> (if (-> obj entity) - (-> obj entity extra level) - (-> *level* level-default) - ) - name - ) + (set! (-> this load-mode) (-> (if (-> this entity) + (-> this entity extra level) + (-> *level* level-default) + ) + name + ) ) - (set! (-> obj thresh-y) (+ -81920.0 (-> obj root-override trans y))) + (set! (-> this thresh-y) (+ -81920.0 (-> this root-override trans y))) (if (and *target* (= (-> *target* control unknown-surface00 name) 'launch-jump)) (go launcherdoor-open #t) (go launcherdoor-closed #t) diff --git a/goal_src/jak1/levels/darkcave/darkcave-obs.gc b/goal_src/jak1/levels/darkcave/darkcave-obs.gc index 31f6fcf3a0..26089096f8 100644 --- a/goal_src/jak1/levels/darkcave/darkcave-obs.gc +++ b/goal_src/jak1/levels/darkcave/darkcave-obs.gc @@ -45,11 +45,11 @@ :bounds (static-spherem 0 4.7 0 5.4) ) -(defmethod update-connected-crystals! cavecrystal ((obj cavecrystal)) - (when (-> obj is-master?) - (let ((v1-2 (-> *display* base-frame-counter))) - (when (!= (-> obj last-updated-user-lighting) v1-2) - (set! (-> obj last-updated-user-lighting) v1-2) +(defmethod update-connected-crystals! cavecrystal ((this cavecrystal)) + (when (-> this is-master?) + (let ((v1-2 (current-time))) + (when (!= (-> this last-updated-user-lighting) v1-2) + (set! (-> this last-updated-user-lighting) v1-2) (execute-connections *cavecrystal-light-control*) ) ) @@ -57,14 +57,13 @@ (none) ) -(defmethod compute-glow cavecrystal ((obj cavecrystal)) - (set! (-> obj prev-compute-glow-time) (-> *display* game-frame-counter)) - (let* ((gp-1 (max 1 (+ (- 1 (-> obj activated-time)) (-> *display* game-frame-counter)))) - (f0-2 - (/ (the float (mod (+ (-> *display* base-frame-counter) (-> obj glow-wf-offset)) (-> obj glow-wf-period))) - (the float (-> obj glow-wf-period)) - ) - ) +(defmethod compute-glow cavecrystal ((this cavecrystal)) + (set! (-> this prev-compute-glow-time) (-> *display* game-frame-counter)) + (let* ((gp-1 (max 1 (+ (- 1 (-> this activated-time)) (-> *display* game-frame-counter)))) + (f0-2 (/ (the float (mod (+ (current-time) (-> this glow-wf-offset)) (-> this glow-wf-period))) + (the float (-> this glow-wf-period)) + ) + ) (f30-1 (* 0.1 (cos (* 65536.0 f0-2)))) ) (cond @@ -78,11 +77,11 @@ (fmin 2.0 (+ (lerp 2.0 1.0 a2-0) f30-1)) ) ) - ((>= (-> obj start-fade-time) gp-1) + ((>= (-> this start-fade-time) gp-1) (+ 1.0 f30-1) ) (else - (let ((v1-20 (fmin 1.0 (* 0.004761905 (the float (- gp-1 (-> obj start-fade-time))))))) + (let ((v1-20 (fmin 1.0 (* 0.004761905 (the float (- gp-1 (-> this start-fade-time))))))) (fmax 0.0 (- (+ 1.0 (* (- 1.0 v1-20) f30-1)) v1-20)) ) ) @@ -180,23 +179,23 @@ ) ) -(defmethod deactivate cavecrystal ((obj cavecrystal)) - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) +(defmethod deactivate cavecrystal ((this cavecrystal)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod init-from-entity! cavecrystal ((obj cavecrystal) (arg0 entity-actor)) - (set! (-> obj glow-u) 0.0) - (set! (-> obj player-attack-id) (the-as uint 0)) - (set! (-> obj last-updated-user-lighting) 0) - (set-vector! (-> obj off-color-mult) 0.0 0.0 0.0 1.0) - (set-vector! (-> obj off-color-emissive) 0.0 0.0 0.0 0.0) - (set-vector! (-> obj on-color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj on-color-emissive) 0.0 0.0 0.0 0.0) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! cavecrystal ((this cavecrystal) (arg0 entity-actor)) + (set! (-> this glow-u) 0.0) + (set! (-> this player-attack-id) (the-as uint 0)) + (set! (-> this last-updated-user-lighting) 0) + (set-vector! (-> this off-color-mult) 0.0 0.0 0.0 1.0) + (set-vector! (-> this off-color-emissive) 0.0 0.0 0.0 0.0) + (set-vector! (-> this on-color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this on-color-emissive) 0.0 0.0 0.0 0.0) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -208,38 +207,38 @@ ) (set! (-> s4-0 nav-radius) 4915.2) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj crystal-id) (actor-count-before (-> obj link))) - (set! (-> obj is-master?) (= (-> obj crystal-id) 3)) - (set! (-> obj glow-wf-period) (rand-vu-int-range 225 375)) - (set! (-> obj glow-wf-offset) (rand-vu-int-range 0 300)) - (if (-> obj is-master?) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this crystal-id) (actor-count-before (-> this link))) + (set! (-> this is-master?) (= (-> this crystal-id) 3)) + (set! (-> this glow-wf-period) (rand-vu-int-range 225 375)) + (set! (-> this glow-wf-offset) (rand-vu-int-range 0 300)) + (if (-> this is-master?) + (logclear! (-> this mask) (process-mask actor-pause)) ) - (set! (-> obj start-fade-time) - (the-as time-frame (the int (* 300.0 (res-lump-float (-> obj entity) 'timeout :default 8.0)))) + (set! (-> this start-fade-time) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'timeout :default 8.0)))) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *cavecrystal-sg* '()) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj draw color-mult quad) (-> obj off-color-mult quad)) - (set! (-> obj draw color-emissive quad) (-> obj off-color-emissive quad)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *cavecrystal-sg* '()) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this draw color-mult quad) (-> this off-color-mult quad)) + (set! (-> this draw color-emissive quad) (-> this off-color-emissive quad)) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (cavecrystal-light-control-method-9 *cavecrystal-light-control* (-> obj crystal-id) 0.0 obj) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "crystal-on" :fo-max 80) (-> obj root-override trans)) + (update-transforms! (-> this root-override)) + (cavecrystal-light-control-method-9 *cavecrystal-light-control* (-> this crystal-id) 0.0 this) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "crystal-on" :fo-max 80) (-> this root-override trans)) ) (go cavecrystal-idle) (none) diff --git a/goal_src/jak1/levels/demo/static-screen.gc b/goal_src/jak1/levels/demo/static-screen.gc index 4fc6ee72ba..5cf99e2139 100644 --- a/goal_src/jak1/levels/demo/static-screen.gc +++ b/goal_src/jak1/levels/demo/static-screen.gc @@ -21,30 +21,30 @@ ) -(defmethod relocate static-screen ((obj static-screen) (arg0 int)) +(defmethod relocate static-screen ((this static-screen) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) (dotimes (v1-2 1) - (if (nonzero? (-> obj part v1-2)) - (&+! (-> obj part v1-2) arg0) + (if (nonzero? (-> this part v1-2)) + (&+! (-> this part v1-2) arg0) ) ) - (the-as static-screen ((method-of-type process relocate) obj arg0)) + (the-as static-screen ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate static-screen ((obj static-screen)) +(defmethod deactivate static-screen ((this static-screen)) (dotimes (s5-0 1) - (if (nonzero? (-> obj part s5-0)) - (kill-and-free-particles (-> obj part s5-0)) + (if (nonzero? (-> this part s5-0)) + (kill-and-free-particles (-> this part s5-0)) ) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -114,12 +114,12 @@ ) :code (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) (local-vars (v1-6 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (until v1-6 (suspend) - (set! v1-6 (or (and (> arg1 0) (>= (- (-> *display* base-frame-counter) (-> self state-time)) arg1)) + (set! v1-6 (or (and (> arg1 0) (time-elapsed? (-> self state-time) arg1)) (and arg2 - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (time-elapsed? (-> self state-time) (seconds 1)) (cpad-pressed? 0 select start triangle circle x square) ) ) diff --git a/goal_src/jak1/levels/finalboss/final-door.gc b/goal_src/jak1/levels/finalboss/final-door.gc index 41c0ee42fd..dc3c6aa391 100644 --- a/goal_src/jak1/levels/finalboss/final-door.gc +++ b/goal_src/jak1/levels/finalboss/final-door.gc @@ -109,8 +109,8 @@ ) ) -(defmethod init-from-entity! final-door ((obj final-door) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! final-door ((this final-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -127,11 +127,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (final-door-method-21 obj) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (final-door-method-21 this) + (go (method-of-object this idle)) (none) ) @@ -180,14 +180,14 @@ ) ) -(defmethod final-door-method-21 power-left ((obj power-left)) - (initialize-skeleton obj *power-left-sg* '()) +(defmethod final-door-method-21 power-left ((this power-left)) + (initialize-skeleton this *power-left-sg* '()) 0 (none) ) -(defmethod final-door-method-21 power-right ((obj power-right)) - (initialize-skeleton obj *power-right-sg* '()) +(defmethod final-door-method-21 power-right ((this power-right)) + (initialize-skeleton this *power-right-sg* '()) 0 (none) ) @@ -217,9 +217,9 @@ (let ((gp-1 (new 'stack 'trajectory))) (set! (-> self base y) (-> self jump-pos y)) (setup-from-to-duration! gp-1 (-> self root-override trans) (-> self jump-pos) 300.0 -2.2755556) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (let ((f0-2 (the float (- (-> *display* base-frame-counter) (-> self state-time))))) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) + (let ((f0-2 (the float (- (current-time) (-> self state-time))))) (eval-position! gp-1 f0-2 (-> self root-override trans)) ) (transform-post) @@ -349,8 +349,8 @@ ) ) ) - (let ((s1-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s1-1) (seconds 0.1)) + (let ((s1-1 (current-time))) + (until (time-elapsed? s1-1 (seconds 0.1)) (suspend) ) ) @@ -371,15 +371,15 @@ ) ) ) - (let ((s1-3 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s1-3) (seconds 0.1)) + (let ((s1-3 (current-time))) + (until (time-elapsed? s1-3 (seconds 0.1)) (suspend) ) ) ) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 2)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) diff --git a/goal_src/jak1/levels/finalboss/green-eco-lurker.gc b/goal_src/jak1/levels/finalboss/green-eco-lurker.gc index 0fd6f5d198..7026f03484 100644 --- a/goal_src/jak1/levels/finalboss/green-eco-lurker.gc +++ b/goal_src/jak1/levels/finalboss/green-eco-lurker.gc @@ -294,85 +294,85 @@ ) ) -(defmethod attack-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (cond ((= (-> arg0 type) target) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) + (send-event (ppointer->process (-> this parent)) 'blob-hit-jak) ) #f ) (else (nav-enemy-set-hit-from-direction arg0) - ((method-of-type nav-enemy attack-handler) obj arg0 arg1) + ((method-of-type nav-enemy attack-handler) this arg0 arg1) ) ) ) -(defmethod nav-enemy-attack-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-attack-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (cond ((= (-> arg0 type) target) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) + (send-event (ppointer->process (-> this parent)) 'blob-hit-jak) ) #f ) (else - ((method-of-type nav-enemy nav-enemy-attack-handler) obj arg0 arg1) + ((method-of-type nav-enemy nav-enemy-attack-handler) this arg0 arg1) ) ) ) -(defmethod touch-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod touch-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) + (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) + (send-event (ppointer->process (-> this parent)) 'blob-hit-jak) ) ) ) -(defmethod nav-enemy-touch-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod nav-enemy-touch-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) + (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) + (send-event (ppointer->process (-> this parent)) 'blob-hit-jak) ) ) ) -(defmethod green-eco-lurker-method-51 green-eco-lurker ((obj green-eco-lurker) (arg0 vector)) +(defmethod green-eco-lurker-method-51 green-eco-lurker ((this green-eco-lurker) (arg0 vector)) (when (or (not *target*) (>= (vector-vector-xz-distance arg0 (target-pos 0)) 36864.0)) (let ((v1-3 (new 'stack-no-clear 'vector))) (set! (-> v1-3 quad) (-> arg0 quad)) - (set! (-> v1-3 w) (-> obj collide-info root-prim local-sphere w)) + (set! (-> v1-3 w) (-> this collide-info root-prim local-sphere w)) ) - (if (not (nav-enemy-method-50 obj arg0)) + (if (not (nav-enemy-method-50 this arg0)) (return #t) ) ) #f ) -(defmethod nav-enemy-method-52 green-eco-lurker ((obj green-eco-lurker) (arg0 vector)) - (let ((s4-0 (-> obj path curve num-cverts))) +(defmethod nav-enemy-method-52 green-eco-lurker ((this green-eco-lurker) (arg0 vector)) + (let ((s4-0 (-> this path curve num-cverts))) (when (> s4-0 0) (let ((s2-0 (nav-enemy-rnd-int-count s4-0)) (s3-0 s4-0) ) (while (> s3-0 0) - (eval-path-curve-div! (-> obj path) arg0 (the float s2-0) 'interp) - (if (green-eco-lurker-method-51 obj arg0) + (eval-path-curve-div! (-> this path) arg0 (the float s2-0) 'interp) + (if (green-eco-lurker-method-51 this arg0) (return #t) ) (set! s2-0 (mod (+ s2-0 1) s4-0)) @@ -416,14 +416,14 @@ ) ) -(defmethod nav-enemy-method-53 green-eco-lurker ((obj green-eco-lurker)) +(defmethod nav-enemy-method-53 green-eco-lurker ((this green-eco-lurker)) (the-as symbol (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((f0-0 (-> obj appear-dest y)) - (v1-7 (-> obj draw shadow-ctrl)) + (let ((f0-0 (-> this appear-dest y)) + (v1-7 (-> this draw shadow-ctrl)) ) (let ((a0-1 v1-7)) (logclear! (-> a0-1 settings flags) (shadow-flags disable-draw)) @@ -438,7 +438,7 @@ 0 ) (else - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logior! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 @@ -449,7 +449,7 @@ (defstate green-eco-lurker-appear (green-eco-lurker) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self played-sound?) #f) (set! (-> self sound-delay) (nav-enemy-rnd-int-range 30 150)) (let ((f0-1 (- (-> self appear-dest x) (-> (the-as green-eco-lurker-gen (-> self parent 0)) root trans x)))) @@ -484,7 +484,7 @@ ) ) :trans (behavior () - (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self traj time)))) + (let ((f30-0 (fmin (the float (- (current-time) (-> self state-time))) (-> self traj time)))) (eval-position! (-> self traj) f30-0 (-> self collide-info trans)) (when (= f30-0 (-> self traj time)) (logior! (-> self collide-info nav-flags) (nav-flags navf0)) @@ -492,9 +492,7 @@ (go green-eco-lurker-appear-land) ) ) - (when (and (not (-> self played-sound?)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self sound-delay)) - ) + (when (and (not (-> self played-sound?)) (time-elapsed? (-> self state-time) (-> self sound-delay))) (set! (-> self played-sound?) #t) (sound-play "blob-jump" :pitch (nav-enemy-rnd-float-range -0.5 0.5)) ) @@ -650,8 +648,8 @@ ) ) -(defmethod initialize-collision green-eco-lurker ((obj green-eco-lurker)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision green-eco-lurker ((this green-eco-lurker)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -724,21 +722,21 @@ (set! (-> s5-0 nav-radius) 8192.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod nav-enemy-method-48 green-eco-lurker ((obj green-eco-lurker)) - (initialize-skeleton obj *green-eco-lurker-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) - (init-defaults! obj *green-eco-lurker-nav-enemy-info*) - (logior! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf02)) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 green-eco-lurker ((this green-eco-lurker)) + (initialize-skeleton this *green-eco-lurker-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (logclear! (-> this collide-info nav-flags) (nav-flags navf0)) + (init-defaults! this *green-eco-lurker-nav-enemy-info*) + (logior! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf02)) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) @@ -771,8 +769,8 @@ (while (< (-> self num-spawned) (-> self num-to-spawn)) (when (< (-> self num-alive) 3) (when (nonzero? (-> self num-spawned)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) diff --git a/goal_src/jak1/levels/finalboss/light-eco.gc b/goal_src/jak1/levels/finalboss/light-eco.gc index 195262c244..da10b78350 100644 --- a/goal_src/jak1/levels/finalboss/light-eco.gc +++ b/goal_src/jak1/levels/finalboss/light-eco.gc @@ -358,21 +358,21 @@ ) ) -(defmethod common-trans light-eco-child ((obj light-eco-child)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-update-time)) - (set! (-> obj last-update-time) v1-1) +(defmethod common-trans light-eco-child ((this light-eco-child)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-update-time)) + (set! (-> this last-update-time) v1-1) (let* ((s5-0 (new 'stack-no-clear 'vector)) - (s4-0 (-> obj rot)) + (s4-0 (-> this rot)) (f30-0 (-> s4-0 w)) ) - (vector-v++! s4-0 (-> obj rotv)) - (set! (-> s4-0 w) (+ f30-0 (* (-> obj rotv w) (-> *display* seconds-per-frame)))) + (vector-v++! s4-0 (-> this rotv)) + (set! (-> s4-0 w) (+ f30-0 (* (-> this rotv w) (seconds-per-frame)))) (set-vector! s5-0 (cos (-> s4-0 x)) (cos (-> s4-0 y)) (cos (-> s4-0 z)) 1.0) (vector-normalize! s5-0 1.0) - (quaternion-vector-angle! (-> obj root-override quat) s5-0 f30-0) + (quaternion-vector-angle! (-> this root-override quat) s5-0 f30-0) ) - (spawn (-> obj part) (-> obj root-override trans)) + (spawn (-> this part) (-> this root-override trans)) ) ) (none) @@ -381,13 +381,10 @@ (defstate light-eco-child-appear (light-eco-child) :event light-eco-child-default-event-handler :enter (behavior () - (set! (-> self falling-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self falling-start-time)) ) :trans (behavior () - (let ((f30-0 - (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) - ) - ) + (let ((f30-0 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) (eval-position! (-> self traj) f30-0 (-> self root-override trans)) (if (= f30-0 (-> self traj time)) (go light-eco-child-hit-ground) @@ -407,10 +404,10 @@ (defstate light-eco-child-hit-ground (light-eco-child) :event light-eco-child-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (-> *display* seconds-per-frame))))) + (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (seconds-per-frame))))) (when (and (< f30-0 0.0) (>= (-> self ground-y) (-> self root-override trans y))) (if (>= 4096.0 (fabs f30-0)) (go light-eco-child-idle) @@ -453,10 +450,10 @@ (defstate light-eco-child-idle (light-eco-child) :event light-eco-child-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (if (time-elapsed? (-> self state-time) (seconds 4)) (go light-eco-child-die) ) (common-trans self) @@ -475,8 +472,8 @@ (send-event (ppointer->process (-> self parent)) 'untrigger (-> self angle-bit)) (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.1)) (suspend) ) ) @@ -541,60 +538,56 @@ (none) ) -(defmethod common-trans light-eco-mother ((obj light-eco-mother)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-update-time)) - (set! (-> obj last-update-time) v1-1) +(defmethod common-trans light-eco-mother ((this light-eco-mother)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-update-time)) + (set! (-> this last-update-time) v1-1) (let ((s5-0 (new 'stack-no-clear 'vector))) (set-vector! s5-0 - (cos (* 25.700392 (the float (mod (-> *display* base-frame-counter) 2550)))) - (cos (* 24.59229 (the float (mod (-> *display* base-frame-counter) 2664)))) - (cos (* 26.121408 (the float (mod (-> *display* base-frame-counter) 2508)))) + (cos (* 25.700392 (the float (mod (current-time) 2550)))) + (cos (* 24.59229 (the float (mod (current-time) 2664)))) + (cos (* 26.121408 (the float (mod (current-time) 2508)))) 1.0 ) (vector-normalize! s5-0 1.0) - (quaternion-vector-angle! - (-> obj root quat) - s5-0 - (* 48.860058 (the float (mod (-> *display* base-frame-counter) 1341))) - ) + (quaternion-vector-angle! (-> this root quat) s5-0 (* 48.860058 (the float (mod (current-time) 1341)))) ) (cond ((and *target* (logtest? (-> *target* state-flags) (state-flags grabbed))) - (set! (-> obj last-spawned-time) (-> *display* base-frame-counter)) - (set! (-> obj delay-til-spawn) 2400) + (set-time! (-> this last-spawned-time)) + (set! (-> this delay-til-spawn) 2400) ) (else - (when (>= (- (-> *display* base-frame-counter) (-> obj last-spawned-time)) (-> obj delay-til-spawn)) - (when (spawn-child-eco obj) - (set! (-> obj last-spawned-time) (-> *display* base-frame-counter)) - (set! (-> obj delay-til-spawn) (rand-vu-int-range 300 600)) + (when (time-elapsed? (-> this last-spawned-time) (-> this delay-til-spawn)) + (when (spawn-child-eco this) + (set-time! (-> this last-spawned-time)) + (set! (-> this delay-til-spawn) (rand-vu-int-range 300 600)) ) ) ) ) - (update! (-> obj sound)) + (update! (-> this sound)) 0 ) ) (none) ) -(defmethod spawn-child-eco light-eco-mother ((obj light-eco-mother)) +(defmethod spawn-child-eco light-eco-mother ((this light-eco-mother)) (countdown (s3-0 4) (let ((gp-0 (rand-vu-int-count 32))) - (when (not (logtest? (-> obj angle-mask) (ash 1 gp-0))) + (when (not (logtest? (-> this angle-mask) (ash 1 gp-0))) (let ((f28-0 (* 2048.0 (the float gp-0))) (f30-0 (rand-vu-float-range 61440.0 88514.56)) (s4-0 (new 'stack-no-clear 'vector)) ) (set-vector! s4-0 (* (sin f28-0) f30-0) 0.0 (* (cos f28-0) f30-0) 1.0) - (vector+! s4-0 s4-0 (-> obj root trans)) + (vector+! s4-0 s4-0 (-> this root trans)) (set! (-> s4-0 y) 1974272.0) (when (or (not *target*) (>= (vector-vector-xz-distance s4-0 (target-pos 0)) 49152.0)) - (logior! (-> obj angle-mask) (ash 1 gp-0)) - (process-spawn light-eco-child (-> obj entity) (-> obj root trans) s4-0 gp-0 :to obj) + (logior! (-> this angle-mask) (ash 1 gp-0)) + (process-spawn light-eco-child (-> this entity) (-> this root trans) s4-0 gp-0 :to this) (return #t) ) ) @@ -641,7 +634,7 @@ ) :code (behavior () (while (!= (-> self root scale x) 12.0) - (let ((f0-3 (seek-with-smooth (-> self root scale x) 12.0 (* 6.0 (-> *display* seconds-per-frame)) 0.25 0.001))) + (let ((f0-3 (seek-with-smooth (-> self root scale x) 12.0 (* 6.0 (seconds-per-frame)) 0.25 0.001))) (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) (suspend) @@ -675,7 +668,7 @@ ) :code (behavior () (while (!= (-> self root scale x) 0.0) - (let ((f0-3 (seek-with-smooth (-> self root scale x) 0.0 (* 12.0 (-> *display* seconds-per-frame)) 0.5 0.001))) + (let ((f0-3 (seek-with-smooth (-> self root scale x) 0.0 (* 12.0 (seconds-per-frame)) 0.5 0.001))) (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) (suspend) @@ -689,25 +682,25 @@ :post ja-post ) -(defmethod deactivate light-eco-mother ((obj light-eco-mother)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate light-eco-mother ((this light-eco-mother)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type projectile deactivate) (the-as projectile obj)) + ((method-of-type projectile deactivate) (the-as projectile this)) (none) ) -(defmethod relocate light-eco-mother ((obj light-eco-mother) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate light-eco-mother ((this light-eco-mother) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as light-eco-mother ((method-of-type projectile relocate) (the-as projectile obj) arg0)) + (the-as light-eco-mother ((method-of-type projectile relocate) (the-as projectile this) arg0)) ) (defbehavior light-eco-mother-init-by-other light-eco-mother ((arg0 entity-actor) (arg1 vector)) (set! (-> self entity) arg0) (set! (-> self last-update-time) 0) - (set! (-> self last-spawned-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-spawned-time)) (set! (-> self delay-til-spawn) 2400) (set! (-> self angle-mask) 0) (set! (-> self player-got-eco?) #f) diff --git a/goal_src/jak1/levels/finalboss/robotboss-h.gc b/goal_src/jak1/levels/finalboss/robotboss-h.gc index e6f0db547e..186e118186 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-h.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-h.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype robotboss-dda (structure) ((blue-bomb-time float :offset-assert 0) (num-blobs int32 :offset-assert 4) @@ -89,39 +88,39 @@ ) -(defmethod relocate robotboss ((obj robotboss) (arg0 int)) +(defmethod relocate robotboss ((this robotboss) (arg0 int)) (dotimes (v1-0 7) - (if (nonzero? (-> obj particle v1-0)) - (&+! (-> obj particle v1-0) arg0) + (if (nonzero? (-> this particle v1-0)) + (&+! (-> this particle v1-0) arg0) ) ) (dotimes (v1-3 4) - (if (nonzero? (-> obj looping-sound v1-3)) - (&+! (-> obj looping-sound v1-3) arg0) + (if (nonzero? (-> this looping-sound v1-3)) + (&+! (-> this looping-sound v1-3) arg0) ) ) - (if (nonzero? (-> obj yellow-gun)) - (&+! (-> obj yellow-gun) arg0) + (if (nonzero? (-> this yellow-gun)) + (&+! (-> this yellow-gun) arg0) ) - (the-as robotboss ((method-of-type process-drawable relocate) obj arg0)) + (the-as robotboss ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate robotboss ((obj robotboss)) +(defmethod deactivate robotboss ((this robotboss)) (dotimes (s5-0 7) - (let ((a0-1 (-> obj particle s5-0))) + (let ((a0-1 (-> this particle s5-0))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) (dotimes (s5-1 4) - (let ((a0-2 (-> obj looping-sound s5-1))) + (let ((a0-2 (-> this looping-sound s5-1))) (if (nonzero? a0-2) (stop! a0-2) ) ) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -137,7 +136,3 @@ :bounds (static-spherem 0 -10 0 80) :longest-edge (meters 19.9) ) - - - - diff --git a/goal_src/jak1/levels/finalboss/robotboss-misc.gc b/goal_src/jak1/levels/finalboss/robotboss-misc.gc index 4d90920dde..c274268db5 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-misc.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-misc.gc @@ -215,9 +215,7 @@ (dotimes (gp-0 2) (cond ((handle->process (-> self particles gp-0 tracker)) - (set! (-> (the-as part-tracker (-> self particles gp-0 tracker process 0)) start-time) - (-> *display* base-frame-counter) - ) + (set-time! (-> (the-as part-tracker (-> self particles gp-0 tracker process 0)) start-time)) ) ((-> self particles gp-0 kind) (set! (-> self particles gp-0 tracker) (ppointer->handle (process-spawn @@ -263,15 +261,15 @@ :post ja-post ) -(defmethod init-from-entity! ecoclaw ((obj ecoclaw) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ecoclaw-sg* '()) +(defmethod init-from-entity! ecoclaw ((this ecoclaw) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ecoclaw-sg* '()) (dotimes (v1-3 3) - (set! (-> obj particles v1-3 kind) #f) - (set! (-> obj particles v1-3 tracker) (the-as handle #f)) + (set! (-> this particles v1-3 kind) #f) + (set! (-> this particles v1-3 tracker) (the-as handle #f)) ) - (set! *ecoclaw* (the-as (pointer ecoclaw) (process->ppointer obj))) + (set! *ecoclaw* (the-as (pointer ecoclaw) (process->ppointer this))) (go ecoclaw-idle) (none) ) @@ -352,8 +350,8 @@ ) ) -(defmethod init-from-entity! silodoor ((obj silodoor) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! silodoor ((this silodoor) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -406,18 +404,18 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *silodoor-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj root pause-adjust-distance) 1228800.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "silo-moves" :fo-max 80) (-> obj root trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *silodoor-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this root pause-adjust-distance) 1228800.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "silo-moves" :fo-max 80) (-> this root trans)) ) - (logclear! (-> obj mask) (process-mask actor-pause crate enemy attackable)) - (set! (-> obj part-opened) 0.0) - (go (method-of-object obj idle)) + (logclear! (-> this mask) (process-mask actor-pause crate enemy attackable)) + (set! (-> this part-opened) 0.0) + (go (method-of-object this idle)) (none) ) @@ -445,17 +443,17 @@ (none) ) -(defmethod play-anim! finalbosscam ((obj finalbosscam) (arg0 symbol)) +(defmethod play-anim! finalbosscam ((this finalbosscam) (arg0 symbol)) (when arg0 - (set! (-> obj robotboss) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *robotboss-sg* #f :to obj)) + (set! (-> this robotboss) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *robotboss-sg* #f :to this)) ) - (send-event (handle->process (-> obj robotboss)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj robotboss)) 'center-joint 3) - (send-event (handle->process (-> obj robotboss)) 'origin-joint-index 3) - (send-event (handle->process (-> obj robotboss)) 'trans-hook robotboss-manipy-trans-hook) + (send-event (handle->process (-> this robotboss)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this robotboss)) 'center-joint 3) + (send-event (handle->process (-> this robotboss)) 'origin-joint-index 3) + (send-event (handle->process (-> this robotboss)) 'trans-hook robotboss-manipy-trans-hook) (send-event - (handle->process (-> obj robotboss)) + (handle->process (-> this robotboss)) 'eval (lambda :behavior finalbosscam () (let ((v0-0 (create-launch-control (-> *part-group-id-table* 645) self))) (set! (-> self part) v0-0) @@ -463,7 +461,7 @@ ) ) ) - (let ((v1-43 (handle->process (-> obj robotboss)))) + (let ((v1-43 (handle->process (-> this robotboss)))) (if v1-43 (set! (-> (the-as robotboss v1-43) draw bounds w) 327680.0) ) @@ -472,11 +470,11 @@ (the-as basic (new 'static 'spool-anim :name "finalbosscam-white-eco" :index 3 :parts 3 :command-list '())) ) -(defmethod get-art-elem finalbosscam ((obj finalbosscam)) - (-> obj draw art-group data 2) +(defmethod get-art-elem finalbosscam ((this finalbosscam)) + (-> this draw art-group data 2) ) -(defmethod should-display? finalbosscam ((obj finalbosscam)) +(defmethod should-display? finalbosscam ((this finalbosscam)) #f ) diff --git a/goal_src/jak1/levels/finalboss/robotboss-weapon.gc b/goal_src/jak1/levels/finalboss/robotboss-weapon.gc index 1a87b8fdbd..e89f86f2fd 100644 --- a/goal_src/jak1/levels/finalboss/robotboss-weapon.gc +++ b/goal_src/jak1/levels/finalboss/robotboss-weapon.gc @@ -25,29 +25,29 @@ ) -(defmethod torus-method-10 torus ((obj torus) (arg0 collide-prim-core) (arg1 vector)) +(defmethod torus-method-10 torus ((this torus) (arg0 collide-prim-core) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) - (f30-0 (+ (-> obj radius-secondary) (-> arg0 world-sphere w))) + (f30-0 (+ (-> this radius-secondary) (-> arg0 world-sphere w))) ) - (vector-! gp-0 (the-as vector arg0) (-> obj origin)) - (vector-flatten! s5-0 gp-0 (-> obj axis)) - (vector-normalize! s5-0 (-> obj radius-primary)) + (vector-! gp-0 (the-as vector arg0) (-> this origin)) + (vector-flatten! s5-0 gp-0 (-> this axis)) + (vector-normalize! s5-0 (-> this radius-primary)) (vector-! arg1 gp-0 s5-0) (< (vector-length-squared arg1) (* f30-0 f30-0)) ) ) -(defmethod torus-method-11 torus ((obj torus) (arg0 vector)) +(defmethod torus-method-11 torus ((this torus) (arg0 vector)) (let ((s4-0 (the-as collide-shape-prim-group (-> *target* control root-prim)))) (when (and (logtest? (-> s4-0 prim-core collide-as) (collide-kind target)) - (torus-method-10 obj (-> s4-0 prim-core) arg0) + (torus-method-10 this (-> s4-0 prim-core) arg0) ) (countdown (s3-0 (-> s4-0 num-prims)) (let ((v1-9 (-> s4-0 prims s3-0))) (if (and (logtest? (-> v1-9 prim-core action) (collide-action solid)) (logtest? (-> v1-9 prim-core collide-as) (collide-kind target)) - (torus-method-10 obj (-> v1-9 prim-core) arg0) + (torus-method-10 this (-> v1-9 prim-core) arg0) ) (return #t) ) @@ -67,7 +67,7 @@ ) -(defmethod torus-method-9 torus ((obj torus) (arg0 vector)) +(defmethod torus-method-9 torus ((this torus) (arg0 vector)) (local-vars (sv-256 int) (sv-272 int) (sv-288 int)) (let ((s0-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -76,38 +76,38 @@ (s1-0 (new 'stack-no-clear 'inline-array 'vector 8)) ) (set-vector! s0-0 0.0 0.0 1.0 1.0) - (vector-flatten! s0-0 s0-0 (-> obj axis)) + (vector-flatten! s0-0 s0-0 (-> this axis)) (if (= (vector-normalize-ret-len! s0-0 1.0) 0.0) (set-vector! s0-0 0.0 1.0 0.0 1.0) ) - (vector-cross! s4-0 s0-0 (-> obj axis)) + (vector-cross! s4-0 s0-0 (-> this axis)) (matrix-axis-angle! s2-0 s4-0 8192.0) - (vector-float*! (-> s1-0 0) s0-0 (-> obj radius-secondary)) + (vector-float*! (-> s1-0 0) s0-0 (-> this radius-secondary)) (set! sv-256 0) (while (< sv-256 7) (vector-matrix*! (-> s1-0 (+ sv-256 1)) (-> s1-0 sv-256) s2-0) (set! sv-256 (+ sv-256 1)) ) - (vector-float*! s0-0 s0-0 (-> obj radius-primary)) + (vector-float*! s0-0 s0-0 (-> this radius-primary)) (dotimes (v1-21 8) (vector+! (-> s1-0 v1-21) (-> s1-0 v1-21) s0-0) ) - (matrix-axis-angle! s2-0 (-> obj axis) 4096.0) + (matrix-axis-angle! s2-0 (-> this axis) 4096.0) (dotimes (s0-1 16) (set! sv-272 0) (while (< sv-272 7) - (vector+! s4-0 (-> s1-0 sv-272) (-> obj origin)) - (vector+! s3-0 (-> s1-0 (+ sv-272 1)) (-> obj origin)) + (vector+! s4-0 (-> s1-0 sv-272) (-> this origin)) + (vector+! s3-0 (-> s1-0 (+ sv-272 1)) (-> this origin)) (camera-line s4-0 s3-0 (the-as vector4w arg0)) (set! sv-272 (+ sv-272 1)) ) - (vector+! s4-0 (-> s1-0 0) (-> obj origin)) + (vector+! s4-0 (-> s1-0 0) (-> this origin)) (camera-line s4-0 s3-0 (the-as vector4w arg0)) (set! sv-288 0) (while (< sv-288 8) - (vector+! s4-0 (-> s1-0 sv-288) (-> obj origin)) + (vector+! s4-0 (-> s1-0 sv-288) (-> this origin)) (vector-matrix*! (-> s1-0 sv-288) (-> s1-0 sv-288) s2-0) - (vector+! s3-0 (-> s1-0 sv-288) (-> obj origin)) + (vector+! s3-0 (-> s1-0 sv-288) (-> this origin)) (camera-line s4-0 s3-0 (the-as vector4w arg0)) (set! sv-288 (+ sv-288 1)) ) @@ -117,17 +117,17 @@ (none) ) -(defmethod torus-method-12 torus ((obj torus) (arg0 vector)) +(defmethod torus-method-12 torus ((this torus) (arg0 vector)) (let* ((f30-0 65536.0) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-2 (the-as number (logior #x3f800000 v1-1))) (f30-1 (* f30-0 (+ -1.0 (the-as float v1-2)))) ) (set! (-> arg0 x) 0.0) - (set! (-> arg0 y) (* (-> obj radius-secondary) (sin f30-1))) - (set! (-> arg0 z) (* (-> obj radius-secondary) (cos f30-1))) + (set! (-> arg0 y) (* (-> this radius-secondary) (sin f30-1))) + (set! (-> arg0 z) (* (-> this radius-secondary) (cos f30-1))) ) - (+! (-> arg0 z) (-> obj radius-primary)) + (+! (-> arg0 z) (-> this radius-primary)) (set! (-> arg0 w) 0.0) (let ((s2-0 (new 'stack-no-clear 'matrix))) (let* ((s4-0 matrix-rotate-y!) @@ -139,10 +139,10 @@ (s4-0 s3-0 (* f30-2 (+ -1.0 (the-as float v1-7)))) ) (vector-matrix*! arg0 arg0 s2-0) - (matrix-from-two-vectors! s2-0 (new 'static 'vector :y 1.0 :w 1.0) (-> obj axis)) + (matrix-from-two-vectors! s2-0 (new 'static 'vector :y 1.0 :w 1.0) (-> this axis)) (vector-matrix*! arg0 arg0 s2-0) ) - (vector+! arg0 arg0 (-> obj origin)) + (vector+! arg0 arg0 (-> this origin)) arg0 ) @@ -264,8 +264,8 @@ ) (send-event (ppointer->process (-> self parent)) 'bomb-going) (send-event *camera* 'change-to-entity-by-name "camera-402") - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (suspend) ) (send-event *camera* 'force-blend 0) @@ -553,24 +553,24 @@ ) -(defmethod relocate redshot ((obj redshot) (arg0 int)) - (if (nonzero? (-> obj shot-particle)) - (&+! (-> obj shot-particle) arg0) +(defmethod relocate redshot ((this redshot) (arg0 int)) + (if (nonzero? (-> this shot-particle)) + (&+! (-> this shot-particle) arg0) ) - (if (nonzero? (-> obj test-particle)) - (&+! (-> obj test-particle) arg0) + (if (nonzero? (-> this test-particle)) + (&+! (-> this test-particle) arg0) ) - (the-as redshot ((method-of-type arcing-shot relocate) obj arg0)) + (the-as redshot ((method-of-type arcing-shot relocate) this arg0)) ) -(defmethod deactivate redshot ((obj redshot)) - (if (nonzero? (-> obj shot-particle)) - (kill-and-free-particles (-> obj shot-particle)) +(defmethod deactivate redshot ((this redshot)) + (if (nonzero? (-> this shot-particle)) + (kill-and-free-particles (-> this shot-particle)) ) - (if (nonzero? (-> obj test-particle)) - (kill-and-free-particles (-> obj test-particle)) + (if (nonzero? (-> this test-particle)) + (kill-and-free-particles (-> this test-particle)) ) - ((method-of-type arcing-shot deactivate) obj) + ((method-of-type arcing-shot deactivate) this) (none) ) diff --git a/goal_src/jak1/levels/finalboss/robotboss.gc b/goal_src/jak1/levels/finalboss/robotboss.gc index a6817c3f7a..fb021899bb 100644 --- a/goal_src/jak1/levels/finalboss/robotboss.gc +++ b/goal_src/jak1/levels/finalboss/robotboss.gc @@ -7,8 +7,8 @@ ;; DECOMP BEGINS -(defmethod ease-loc-t robotboss ((obj robotboss)) - (parameter-ease-sin-clamp (-> obj loc-t)) +(defmethod ease-loc-t robotboss ((this robotboss)) + (parameter-ease-sin-clamp (-> this loc-t)) ) (defskelgroup *robotboss-blueeco-sg* robotboss-blueeco robotboss-blueeco-lod0-jg robotboss-blueeco-idle-ja @@ -617,7 +617,7 @@ :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (set! (-> self children-spawned) 0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-post) ) :exit (behavior () @@ -625,9 +625,7 @@ ) :trans (behavior () (spool-push *art-control* "green-sagecage-daxter-sacrifice" 0 self (the-as float -1.0)) - (when (and (< (-> self children-spawned) 1) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.95)) - ) + (when (and (< (-> self children-spawned) 1) (time-elapsed? (-> self state-time) (seconds 0.95))) (+! (-> self children-spawned) 1) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self entity extra trans quad)) @@ -779,6 +777,7 @@ (while (movie?) (suspend) ) + ;; og:preserve-this (#when PC_PORT (-! (-> self state-time) (seconds 0.95)) ((-> self state trans)) @@ -1007,7 +1006,7 @@ (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-1) 'anim-mode 'play1) (send-event (ppointer->process gp-1) 'rot-quat (-> self root-override quat)) - ;; the zero passed here was missing in the original game, but is a bug that causes undefined behavior + ;; og:preserve-this the zero passed here was missing in the original game, but is a bug that causes undefined behavior (send-event (ppointer->process gp-1) 'art-joint-anim "robotboss-yelloweco-yellow-last-hit" 0) ) ) @@ -1591,7 +1590,7 @@ (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-1) 'anim-mode 'play1) (send-event (ppointer->process gp-1) 'rot-quat (-> self root-override quat)) - ;; the zero passed here was missing in the original game, but is a bug that causes undefined behavior + ;; og:preserve-this the zero passed here was missing in the original game, but is a bug that causes undefined behavior (send-event (ppointer->process gp-1) 'art-joint-anim "robotboss-redeco-red-last-hit" 0) ) ) @@ -2537,7 +2536,7 @@ (send-event (ppointer->process (-> self parent)) 'flash 255.0) (send-event (ppointer->process gp-2) 'anim-mode 'play1) (send-event (ppointer->process gp-2) 'rot-quat (-> self root-override quat)) - ;; the zero passed here was missing in the original game, but is a bug that causes undefined behavior + ;; og:preserve-this the zero passed here was missing in the original game, but is a bug that causes undefined behavior (send-event (ppointer->process gp-2) 'art-joint-anim "robotboss-blueeco-blue-last-hit" 0) ) ) @@ -2632,9 +2631,9 @@ :post transform-post ) -(defmethod init-from-entity! robotboss ((obj robotboss) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! robotboss ((this robotboss) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -2821,81 +2820,81 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *robotboss-sg* '()) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *robotboss-sg* '()) (aybabtu 2) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 (the-as float 40960.0))) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) - (set! (-> obj path) (new 'process 'path-control obj 'path (the-as float 0.0))) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj root-override pause-adjust-distance) 1228800.0) - (set-vector! (-> obj old-loc) 8192.0 0.0 245760.0 1.0) - (set! (-> obj desired-loc quad) (-> obj old-loc quad)) - (set! (-> obj loc-t) 1.0) - (set! (-> obj loc-t-duration) 1) - (set! (-> obj loc-t-start) 0) - (set! (-> obj shot-attractor) (the-as handle #f)) - (set! (-> obj white-eco) (the-as handle #f)) - (set! (-> obj desired-pool-y) -30720.0) - (set! (-> obj des-cam-entity) #f) - (set! (-> obj use-interesting) #f) - (set! (-> obj ignore-camera) #f) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 (the-as float 40960.0))) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (logclear! (-> this root-override nav-flags) (nav-flags navf0)) + (set! (-> this path) (new 'process 'path-control this 'path (the-as float 0.0))) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this root-override pause-adjust-distance) 1228800.0) + (set-vector! (-> this old-loc) 8192.0 0.0 245760.0 1.0) + (set! (-> this desired-loc quad) (-> this old-loc quad)) + (set! (-> this loc-t) 1.0) + (set! (-> this loc-t-duration) 1) + (set! (-> this loc-t-start) 0) + (set! (-> this shot-attractor) (the-as handle #f)) + (set! (-> this white-eco) (the-as handle #f)) + (set! (-> this desired-pool-y) -30720.0) + (set! (-> this des-cam-entity) #f) + (set! (-> this use-interesting) #f) + (set! (-> this ignore-camera) #f) (dotimes (v1-211 13) - (set! (-> obj alts v1-211) #f) + (set! (-> this alts v1-211) #f) ) - (let ((s5-1 (entity-actor-count (-> obj entity) 'alt-actor))) + (let ((s5-1 (entity-actor-count (-> this entity) 'alt-actor))) (dotimes (s4-1 (min 13 s5-1)) - (set! (-> obj alts s4-1) (entity-actor-lookup (-> obj entity) 'alt-actor s4-1)) + (set! (-> this alts s4-1) (entity-actor-lookup (-> this entity) 'alt-actor s4-1)) ) ) - (set! (-> obj particle 0) (create-launch-control (-> *part-group-id-table* 636) obj)) - (set! (-> obj particle 1) (create-launch-control (-> *part-group-id-table* 637) obj)) - (set! (-> obj particle 2) (create-launch-control (-> *part-group-id-table* 645) obj)) - (set! (-> obj particle 3) (create-launch-control (-> *part-group-id-table* 650) obj)) - (set! (-> obj particle 4) (create-launch-control (-> *part-group-id-table* 654) obj)) - (set! (-> obj particle 5) (create-launch-control (-> *part-group-id-table* 646) obj)) - (set! (-> obj particle 6) (create-launch-control (-> *part-group-id-table* 651) obj)) - (set! (-> obj looping-sound 0) - (new 'process 'ambient-sound (static-sound-spec "robo-blue-lp" :fo-max 80) (-> obj root-override trans)) + (set! (-> this particle 0) (create-launch-control (-> *part-group-id-table* 636) this)) + (set! (-> this particle 1) (create-launch-control (-> *part-group-id-table* 637) this)) + (set! (-> this particle 2) (create-launch-control (-> *part-group-id-table* 645) this)) + (set! (-> this particle 3) (create-launch-control (-> *part-group-id-table* 650) this)) + (set! (-> this particle 4) (create-launch-control (-> *part-group-id-table* 654) this)) + (set! (-> this particle 5) (create-launch-control (-> *part-group-id-table* 646) this)) + (set! (-> this particle 6) (create-launch-control (-> *part-group-id-table* 651) this)) + (set! (-> this looping-sound 0) + (new 'process 'ambient-sound (static-sound-spec "robo-blue-lp" :fo-max 80) (-> this root-override trans)) ) - (set! (-> obj looping-sound 1) - (new 'process 'ambient-sound (static-sound-spec "eco-torch" :fo-max 80) (-> obj root-override trans)) + (set! (-> this looping-sound 1) + (new 'process 'ambient-sound (static-sound-spec "eco-torch" :fo-max 80) (-> this root-override trans)) ) - (set! (-> obj looping-sound 2) - (new 'process 'ambient-sound (static-sound-spec "red-buzz" :fo-max 80) (-> obj root-override trans)) + (set! (-> this looping-sound 2) + (new 'process 'ambient-sound (static-sound-spec "red-buzz" :fo-max 80) (-> this root-override trans)) ) - (set! (-> obj looping-sound 3) - (new 'process 'ambient-sound (static-sound-spec "bfg-buzz" :fo-max 80) (-> obj root-override trans)) + (set! (-> this looping-sound 3) + (new 'process 'ambient-sound (static-sound-spec "bfg-buzz" :fo-max 80) (-> this root-override trans)) ) - (set! (-> obj blue-smoke) #f) - (set! (-> obj red-smoke) #f) - (set! (-> obj yellow-smoke) #f) - (ambient-control-method-9 (-> obj ambient)) - (set! (-> obj yellow-gun) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 16)) - (set-vector! (-> obj yellow-gun twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj yellow-gun up) (the-as uint 1)) - (set! (-> obj yellow-gun nose) (the-as uint 2)) - (set! (-> obj yellow-gun ear) (the-as uint 0)) - (set! (-> obj yellow-gun max-dist) 819200.0) - (set! (-> obj yellow-gun ignore-angle) 16384.0) - (set! (-> obj palette-val) 0.0) - (set! (-> obj dda) (new 'static 'robotboss-dda - :blue-bomb-time 4200.0 - :num-blobs 12 - :green-bomb-time 4200.0 - :red-shots-min 5 - :red-shot-time-min 3600.0 - :red-shot-time-rnd 600.0 - :red-bomb-time 3600.0 - :yellow-shot-time-min 900.0 - :yellow-shot-time-rnd 600.0 - :yellow-gun-hits 5 - :yellow-bomb-time 3600.0 - ) + (set! (-> this blue-smoke) #f) + (set! (-> this red-smoke) #f) + (set! (-> this yellow-smoke) #f) + (ambient-control-method-9 (-> this ambient)) + (set! (-> this yellow-gun) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) this 16)) + (set-vector! (-> this yellow-gun twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this yellow-gun up) (the-as uint 1)) + (set! (-> this yellow-gun nose) (the-as uint 2)) + (set! (-> this yellow-gun ear) (the-as uint 0)) + (set! (-> this yellow-gun max-dist) 819200.0) + (set! (-> this yellow-gun ignore-angle) 16384.0) + (set! (-> this palette-val) 0.0) + (set! (-> this dda) (new 'static 'robotboss-dda + :blue-bomb-time 4200.0 + :num-blobs 12 + :green-bomb-time 4200.0 + :red-shots-min 5 + :red-shot-time-min 3600.0 + :red-shot-time-rnd 600.0 + :red-bomb-time 3600.0 + :yellow-shot-time-min 900.0 + :yellow-shot-time-rnd 600.0 + :yellow-gun-hits 5 + :yellow-bomb-time 3600.0 + ) ) (go robotboss-blue-wait) (none) diff --git a/goal_src/jak1/levels/finalboss/sage-finalboss.gc b/goal_src/jak1/levels/finalboss/sage-finalboss.gc index c70a375929..d536465ef0 100644 --- a/goal_src/jak1/levels/finalboss/sage-finalboss.gc +++ b/goal_src/jak1/levels/finalboss/sage-finalboss.gc @@ -46,21 +46,21 @@ ) -(defmethod get-unlit-skel plat-eco-finalboss ((obj plat-eco-finalboss)) +(defmethod get-unlit-skel plat-eco-finalboss ((this plat-eco-finalboss)) *plat-eco-finalboss-unlit-sg* ) -(defmethod get-lit-skel plat-eco-finalboss ((obj plat-eco-finalboss)) +(defmethod get-lit-skel plat-eco-finalboss ((this plat-eco-finalboss)) *plat-eco-finalboss-lit-sg* ) -(defmethod baseplat-method-26 plat-eco-finalboss ((obj plat-eco-finalboss)) - (set! (-> obj force-dest) -1.0) - (set! (-> obj targ-dest) -1.0) - (set! (-> obj dest) 0.0) - (set! (-> obj speed) 0.1) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status bit-3) #t) +(defmethod baseplat-method-26 plat-eco-finalboss ((this plat-eco-finalboss)) + (set! (-> this force-dest) -1.0) + (set! (-> this targ-dest) -1.0) + (set! (-> this dest) 0.0) + (set! (-> this speed) 0.1) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status bit-3) #t) (none) ) @@ -73,7 +73,7 @@ (set! (-> self force-dest) (the-as float (-> block param 0))) ) (('ridden 'edge-grabbed) - (if (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 2)) + (if (time-elapsed? (-> self touch-time) (seconds 2)) (set! (-> self targ-dest) (cond ((= (-> self path-pos) 0.0) (set! (-> self force-dest) -1.0) @@ -88,7 +88,7 @@ ) ) ) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) #f ) (else @@ -97,7 +97,7 @@ ) ) :enter (behavior ((arg0 plat)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (lods-assign! (-> self draw) (-> self lit-look)) (process-entity-status! self (entity-perm-status complete) #t) (cond @@ -114,7 +114,7 @@ (let ((s5-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp)) (gp-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 1.0 'interp)) ) - (if (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 3)) + (if (time-elapsed? (-> self touch-time) (seconds 3)) (set! (-> self targ-dest) -1.0) ) (set! (-> self dest) @@ -134,10 +134,10 @@ ) ) ) - (if (= (-> self state-time) (-> *display* base-frame-counter)) + (if (= (-> self state-time) (current-time)) (set! (-> self path-pos) (-> self dest)) ) - (seek! (-> self path-pos) (-> self dest) (* (-> self speed) (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) (-> self dest) (* (-> self speed) (seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) @@ -190,30 +190,30 @@ ) -(defmethod relocate sage-finalboss ((obj sage-finalboss) (arg0 int)) +(defmethod relocate sage-finalboss ((this sage-finalboss) (arg0 int)) (dotimes (v1-0 9) - (if (nonzero? (-> obj particle v1-0 part)) - (&+! (-> obj particle v1-0 part) arg0) + (if (nonzero? (-> this particle v1-0 part)) + (&+! (-> this particle v1-0 part) arg0) ) ) - (if (nonzero? (-> obj particle-whiteout)) - (&+! (-> obj particle-whiteout) arg0) + (if (nonzero? (-> this particle-whiteout)) + (&+! (-> this particle-whiteout) arg0) ) - (the-as sage-finalboss ((method-of-type process-taskable relocate) obj arg0)) + (the-as sage-finalboss ((method-of-type process-taskable relocate) this arg0)) ) -(defmethod deactivate sage-finalboss ((obj sage-finalboss)) +(defmethod deactivate sage-finalboss ((this sage-finalboss)) (dotimes (s5-0 9) - (let ((a0-1 (-> obj particle s5-0 part))) + (let ((a0-1 (-> this particle s5-0 part))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) - (if (nonzero? (-> obj particle-whiteout)) - (kill-and-free-particles (-> obj particle-whiteout)) + (if (nonzero? (-> this particle-whiteout)) + (kill-and-free-particles (-> this particle-whiteout)) ) - ((method-of-type process-taskable deactivate) obj) + ((method-of-type process-taskable deactivate) this) (none) ) @@ -223,73 +223,73 @@ :shadow green-sagecage-shadow-mg ) -(defmethod play-reminder sage-finalboss ((obj sage-finalboss)) +(defmethod play-reminder sage-finalboss ((this sage-finalboss)) (let ((s5-0 (entity-by-name "red-sagecage-1"))) (when s5-0 - (set! (-> obj redsage) - (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-0 *redsage-sg* #f :to obj)) + (set! (-> this redsage) + (ppointer->handle (manipy-spawn (-> this root-override trans) s5-0 *redsage-sg* #f :to this)) ) - (send-event (handle->process (-> obj redsage)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj redsage)) 'blend-shape #t) - (send-event (handle->process (-> obj redsage)) 'center-joint 3) - (send-event (handle->process (-> obj redsage)) 'origin-joint-index 3) + (send-event (handle->process (-> this redsage)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this redsage)) 'blend-shape #t) + (send-event (handle->process (-> this redsage)) 'center-joint 3) + (send-event (handle->process (-> this redsage)) 'origin-joint-index 3) ) ) (let ((s5-1 (entity-by-name "blue-sagecage-1"))) (when s5-1 - (set! (-> obj bluesage) - (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-1 *bluesage-sg* #f :to obj)) + (set! (-> this bluesage) + (ppointer->handle (manipy-spawn (-> this root-override trans) s5-1 *bluesage-sg* #f :to this)) ) - (send-event (handle->process (-> obj bluesage)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj bluesage)) 'blend-shape #t) - (send-event (handle->process (-> obj bluesage)) 'center-joint 3) - (send-event (handle->process (-> obj bluesage)) 'origin-joint-index 3) + (send-event (handle->process (-> this bluesage)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this bluesage)) 'blend-shape #t) + (send-event (handle->process (-> this bluesage)) 'center-joint 3) + (send-event (handle->process (-> this bluesage)) 'origin-joint-index 3) ) ) (let ((s5-2 (entity-by-name "yellow-sagecage-1"))) (the-as symbol (when s5-2 - (set! (-> obj yellowsage) - (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-2 *yellowsage-sg* #f :to obj)) + (set! (-> this yellowsage) + (ppointer->handle (manipy-spawn (-> this root-override trans) s5-2 *yellowsage-sg* #f :to this)) ) - (send-event (handle->process (-> obj yellowsage)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj yellowsage)) 'blend-shape #t) - (send-event (handle->process (-> obj yellowsage)) 'center-joint 3) - (send-event (handle->process (-> obj yellowsage)) 'origin-joint-index 3) + (send-event (handle->process (-> this yellowsage)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this yellowsage)) 'blend-shape #t) + (send-event (handle->process (-> this yellowsage)) 'center-joint 3) + (send-event (handle->process (-> this yellowsage)) 'origin-joint-index 3) ) ) ) ) -(defmethod process-taskable-method-45 sage-finalboss ((obj sage-finalboss)) +(defmethod process-taskable-method-45 sage-finalboss ((this sage-finalboss)) (let ((s5-0 (entity-by-name "assistant-lavatube-end-3"))) (the-as symbol (when s5-0 - (set! (-> obj assistant) - (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-0 *assistant-lavatube-end-sg* #f :to obj)) + (set! (-> this assistant) + (ppointer->handle (manipy-spawn (-> this root-override trans) s5-0 *assistant-lavatube-end-sg* #f :to this)) ) - (let ((s5-1 (handle->process (-> obj assistant)))) + (let ((s5-1 (handle->process (-> this assistant)))) (if (the-as manipy s5-1) (set! (-> (the-as manipy s5-1) draw level-index) (the-as uint (-> (level-get *level* 'finalboss) index))) ) ) - (send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj assistant)) 'blend-shape #t) - (send-event (handle->process (-> obj assistant)) 'center-joint 3) - (send-event (handle->process (-> obj assistant)) 'origin-joint-index 3) + (send-event (handle->process (-> this assistant)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this assistant)) 'blend-shape #t) + (send-event (handle->process (-> this assistant)) 'center-joint 3) + (send-event (handle->process (-> this assistant)) 'origin-joint-index 3) ) ) ) ) -(defmethod play-anim! sage-finalboss ((obj sage-finalboss) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! sage-finalboss ((this sage-finalboss) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status unknown)) (when arg0 - (close-current! (-> obj tasks)) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) + (close-current! (-> this tasks)) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) ) (new 'static 'spool-anim :name "green-sagecage-daxter-sacrifice" @@ -300,36 +300,36 @@ ) (((task-status need-introduction)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) - (close-current! (-> obj tasks)) - (set! (-> obj jak-white) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *jak-white-sg* #f :to obj)) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) + (close-current! (-> this tasks)) + (set! (-> this jak-white) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *jak-white-sg* #f :to this)) ) (send-event - (handle->process (-> obj jak-white)) + (handle->process (-> this jak-white)) 'eval (lambda :behavior sage-finalboss () (set-vector! (-> self draw color-emissive) 0.5 0.5 0.5 0.0) (none)) ) - (send-event (handle->process (-> obj jak-white)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj jak-white)) 'origin-joint-index 3) - (send-event (handle->process (-> obj jak-white)) 'blend-shape #t) - (set! (-> obj robotboss) + (send-event (handle->process (-> this jak-white)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this jak-white)) 'origin-joint-index 3) + (send-event (handle->process (-> this jak-white)) 'blend-shape #t) + (set! (-> this robotboss) (ppointer->handle - (manipy-spawn (-> obj root-override trans) (-> obj entity) *robotboss-cinematic-sg* #f :to obj) + (manipy-spawn (-> this root-override trans) (-> this entity) *robotboss-cinematic-sg* #f :to this) ) ) - (send-event (handle->process (-> obj robotboss)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj robotboss)) 'origin-joint-index 3) - (let ((v1-67 (handle->process (-> obj robotboss)))) + (send-event (handle->process (-> this robotboss)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this robotboss)) 'origin-joint-index 3) + (let ((v1-67 (handle->process (-> this robotboss)))) (if (the-as manipy v1-67) (set! (-> (the-as manipy v1-67) draw bounds w) 2048000.0) ) ) - (set! (-> obj silodoor) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *silodoor-sg* #f :to obj)) + (set! (-> this silodoor) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *silodoor-sg* #f :to this)) ) - (send-event (handle->process (-> obj silodoor)) 'anim-mode 'clone-anim) - (let ((v1-84 (handle->process (-> obj silodoor)))) + (send-event (handle->process (-> this silodoor)) 'anim-mode 'clone-anim) + (let ((v1-84 (handle->process (-> this silodoor)))) (if (the-as manipy v1-84) (set! (-> (the-as silodoor v1-84) draw bounds w) 2048000.0) ) @@ -381,22 +381,22 @@ ) (((task-status need-reminder-a)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) - (close-current! (-> obj tasks)) - (play-reminder obj) - (process-taskable-method-45 obj) - (set! (-> obj kick-the-credits) #t) - (set! (-> obj robotplat) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) + (close-current! (-> this tasks)) + (play-reminder this) + (process-taskable-method-45 this) + (set! (-> this kick-the-credits) #t) + (set! (-> this robotplat) (ppointer->handle - (manipy-spawn (-> obj root-override trans) (-> obj entity) *plat-eco-finalboss-lit-sg* #f :to obj) + (manipy-spawn (-> this root-override trans) (-> this entity) *plat-eco-finalboss-lit-sg* #f :to this) ) ) - (send-event (handle->process (-> obj robotplat)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj robotplat)) 'origin-joint-index 3) - (set! (-> obj old-target-pos trans quad) + (send-event (handle->process (-> this robotplat)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this robotplat)) 'origin-joint-index 3) + (set! (-> this old-target-pos trans quad) (-> (new 'static 'vector :x 11368946.0 :y 2215900.2 :z -19405602.0 :w 1.0) quad) ) - (quaternion-copy! (-> obj old-target-pos quat) (new 'static 'quaternion :y -0.8472 :w 0.5312)) + (quaternion-copy! (-> this old-target-pos quat) (new 'static 'quaternion :y -0.8472 :w 0.5312)) (set-setting! 'music #f 0.0 0) (set-setting! 'sfx-volume 'abs 0.0 0) (set-setting! 'ambient-volume 'abs 0.0 0) @@ -436,9 +436,9 @@ ) (((task-status need-reminder)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) - (close-current! (-> obj tasks)) - (process-taskable-method-45 obj) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) -13116.667) + (close-current! (-> this tasks)) + (process-taskable-method-45 this) (send-event *camera* 'teleport) (set-setting! 'allow-progress #f 0.0 0) ) @@ -484,11 +484,11 @@ ) (((task-status need-reward-speech)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) - (close-current! (-> obj tasks)) - (process-taskable-method-45 obj) - (set! (-> obj left-door) (the-as entity-actor (entity-by-name "power-left-2"))) - (set! (-> obj right-door) (the-as entity-actor (entity-by-name "power-right-2"))) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) -13116.667) + (close-current! (-> this tasks)) + (process-taskable-method-45 this) + (set! (-> this left-door) (the-as entity-actor (entity-by-name "power-left-2"))) + (set! (-> this right-door) (the-as entity-actor (entity-by-name "power-right-2"))) (set-setting! 'allow-progress #f 0.0 0) ) (new 'static 'spool-anim @@ -515,17 +515,17 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) -(defmethod get-art-elem sage-finalboss ((obj sage-finalboss)) - (-> obj draw art-group data 4) +(defmethod get-art-elem sage-finalboss ((this sage-finalboss)) + (-> this draw art-group data 4) ) (defbehavior sage-finalboss-credit-particle sage-finalboss () @@ -903,11 +903,11 @@ ((paused?) ) ((and (< 1300.0 f30-0) (cpad-hold? 0 circle x)) - (set! f28-0 (seek f28-0 16.0 (* 4.0 (-> *display* seconds-per-frame)))) + (set! f28-0 (seek f28-0 16.0 (* 4.0 (seconds-per-frame)))) (+! f30-0 (* f28-0 (-> *display* time-adjust-ratio))) ) (else - (set! f28-0 (seek f28-0 0.5 (* 16.0 (-> *display* seconds-per-frame)))) + (set! f28-0 (seek f28-0 0.5 (* 16.0 (seconds-per-frame)))) (+! f30-0 (* f28-0 (-> *display* time-adjust-ratio))) ) ) @@ -923,8 +923,8 @@ (remove-setting! 'music) (apply-settings *setting-control*) (set-blackout-frames (seconds 0.05)) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 0.05)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.05)) (suspend) ) ) @@ -932,7 +932,7 @@ ) ) -(defmethod should-display? sage-finalboss ((obj sage-finalboss)) +(defmethod should-display? sage-finalboss ((this sage-finalboss)) #f ) @@ -992,43 +992,43 @@ ) ) -(defmethod init-from-entity! sage-finalboss ((obj sage-finalboss) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sage-finalboss-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task finalboss-movies))) - (set! (-> obj redsage) (the-as handle #f)) - (set! (-> obj bluesage) (the-as handle #f)) - (set! (-> obj yellowsage) (the-as handle #f)) - (set! (-> obj assistant) (the-as handle #f)) - (set! (-> obj robotplat) (the-as handle #f)) - (set! (-> obj robotboss) (the-as handle #f)) - (set! (-> obj jak-white) (the-as handle #f)) - (set! (-> obj silodoor) (the-as handle #f)) - (set! (-> obj left-door) #f) - (set! (-> obj right-door) #f) - (set! (-> obj kick-in-the-door) #f) - (set! (-> obj kick-the-credits) #f) - (set! (-> obj credits-played) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 682) obj)) - (set! (-> obj part matrix) (sprite-allocate-user-hvdf)) - (set! (-> obj particle-whiteout) (create-launch-control (-> *part-group-id-table* 706) obj)) - (set! (-> obj particle-whiteout matrix) (sprite-allocate-user-hvdf)) - (set! (-> obj particle 0 part) (create-launch-control (-> *part-group-id-table* 699) obj)) - (set! (-> obj particle 1 part) (create-launch-control (-> *part-group-id-table* 700) obj)) - (set! (-> obj particle 2 part) (create-launch-control (-> *part-group-id-table* 701) obj)) - (set! (-> obj particle 3 part) (create-launch-control (-> *part-group-id-table* 702) obj)) - (set! (-> obj particle 7 part) (create-launch-control (-> *part-group-id-table* 645) obj)) - (set! (-> obj particle 4 part) (create-launch-control (-> *part-group-id-table* 703) obj)) - (set! (-> obj particle 5 part) (create-launch-control (-> *part-group-id-table* 696) obj)) - (set! (-> obj particle 6 part) (create-launch-control (-> *part-group-id-table* 704) obj)) - (set! (-> obj particle 8 part) (create-launch-control (-> *part-group-id-table* 698) obj)) +(defmethod init-from-entity! sage-finalboss ((this sage-finalboss) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sage-finalboss-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task finalboss-movies))) + (set! (-> this redsage) (the-as handle #f)) + (set! (-> this bluesage) (the-as handle #f)) + (set! (-> this yellowsage) (the-as handle #f)) + (set! (-> this assistant) (the-as handle #f)) + (set! (-> this robotplat) (the-as handle #f)) + (set! (-> this robotboss) (the-as handle #f)) + (set! (-> this jak-white) (the-as handle #f)) + (set! (-> this silodoor) (the-as handle #f)) + (set! (-> this left-door) #f) + (set! (-> this right-door) #f) + (set! (-> this kick-in-the-door) #f) + (set! (-> this kick-the-credits) #f) + (set! (-> this credits-played) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 682) this)) + (set! (-> this part matrix) (sprite-allocate-user-hvdf)) + (set! (-> this particle-whiteout) (create-launch-control (-> *part-group-id-table* 706) this)) + (set! (-> this particle-whiteout matrix) (sprite-allocate-user-hvdf)) + (set! (-> this particle 0 part) (create-launch-control (-> *part-group-id-table* 699) this)) + (set! (-> this particle 1 part) (create-launch-control (-> *part-group-id-table* 700) this)) + (set! (-> this particle 2 part) (create-launch-control (-> *part-group-id-table* 701) this)) + (set! (-> this particle 3 part) (create-launch-control (-> *part-group-id-table* 702) this)) + (set! (-> this particle 7 part) (create-launch-control (-> *part-group-id-table* 645) this)) + (set! (-> this particle 4 part) (create-launch-control (-> *part-group-id-table* 703) this)) + (set! (-> this particle 5 part) (create-launch-control (-> *part-group-id-table* 696) this)) + (set! (-> this particle 6 part) (create-launch-control (-> *part-group-id-table* 704) this)) + (set! (-> this particle 8 part) (create-launch-control (-> *part-group-id-table* 698) this)) (dotimes (v1-37 9) - (set! (-> obj particle v1-37 active) #f) + (set! (-> this particle v1-37 active) #f) ) - (set! (-> obj palette-val) 0.0) - (+! (-> obj root-override trans y) 2048.0) - (if (not (should-display? obj)) - (go (method-of-object obj hidden)) - (go (method-of-object obj idle)) + (set! (-> this palette-val) 0.0) + (+! (-> this root-override trans y) 2048.0) + (if (not (should-display? this)) + (go (method-of-object this hidden)) + (go (method-of-object this idle)) ) (none) ) diff --git a/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc b/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc index 2b6c7dae4e..b08affe0ad 100644 --- a/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc +++ b/goal_src/jak1/levels/firecanyon/assistant-firecanyon.gc @@ -22,11 +22,11 @@ :shadow assistant-firecanyon-shadow-mg ) -(defmethod play-anim! assistant-firecanyon ((obj assistant-firecanyon) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! assistant-firecanyon ((this assistant-firecanyon) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (if arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "assistant-firecanyon-resolution" @@ -53,19 +53,19 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod get-art-elem assistant-firecanyon ((obj assistant-firecanyon)) - (if (= (current-status (-> obj tasks)) (task-status invalid)) - (-> obj draw art-group data 8) - (-> obj draw art-group data 3) +(defmethod get-art-elem assistant-firecanyon ((this assistant-firecanyon)) + (if (= (current-status (-> this tasks)) (task-status invalid)) + (-> this draw art-group data 8) + (-> this draw art-group data 3) ) ) @@ -78,7 +78,7 @@ #t ) (else - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) ) @@ -86,7 +86,7 @@ (not (movie?)) (not (level-hint-displayed?)) (not (and *cheat-mode* (cpad-hold? 0 l3))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) + (not (time-elapsed? (-> self state-time) (seconds 10))) ) ) (hide-hud) @@ -248,15 +248,15 @@ ) ) -(defmethod should-display? assistant-firecanyon ((obj assistant-firecanyon)) - (first-any (-> obj tasks) #t) - (= (current-status (-> obj tasks)) (task-status need-reward-speech)) +(defmethod should-display? assistant-firecanyon ((this assistant-firecanyon)) + (first-any (-> this tasks) #t) + (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) -(defmethod init-from-entity! assistant-firecanyon ((obj assistant-firecanyon) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-firecanyon-sg* 3 29 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task firecanyon-assistant))) - (first-any (-> obj tasks) #t) - (process-taskable-method-42 obj) +(defmethod init-from-entity! assistant-firecanyon ((this assistant-firecanyon) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-firecanyon-sg* 3 29 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task firecanyon-assistant))) + (first-any (-> this tasks) #t) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc b/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc index fdc81468d6..ffe47a76ab 100644 --- a/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc +++ b/goal_src/jak1/levels/firecanyon/firecanyon-obs.gc @@ -134,8 +134,8 @@ :post ja-post ) -(defmethod init-from-entity! balloon ((obj balloon) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! balloon ((this balloon) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -145,11 +145,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *balloon-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 227) obj)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *balloon-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 227) this)) (go balloon-idle) (none) ) @@ -299,8 +299,8 @@ ) ) -(defmethod init-from-entity! spike ((obj spike) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! spike ((this spike) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -348,13 +348,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *spike-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj num-alts) (entity-actor-count (-> obj entity) 'alt-actor)) - (if (zero? (-> obj num-alts)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *spike-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (set! (-> this num-alts) (entity-actor-count (-> this entity) 'alt-actor)) + (if (zero? (-> this num-alts)) (go spike-down) (go spike-idle) ) @@ -607,8 +607,8 @@ ) ) -(defmethod init-from-entity! crate-darkeco-cluster ((obj crate-darkeco-cluster) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! crate-darkeco-cluster ((this crate-darkeco-cluster) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind crate)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -620,10 +620,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *crate-darkeco-cluster-sg* '()) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *crate-darkeco-cluster-sg* '()) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak1/levels/flut_common/flutflut.gc b/goal_src/jak1/levels/flut_common/flutflut.gc index 1f9278111f..4b721c7cbb 100644 --- a/goal_src/jak1/levels/flut_common/flutflut.gc +++ b/goal_src/jak1/levels/flut_common/flutflut.gc @@ -37,13 +37,13 @@ ) -(defmethod relocate flutflut ((obj flutflut) (arg0 int)) +(defmethod relocate flutflut ((this flutflut) (arg0 int)) (countdown (v1-0 2) - (if (-> obj path-data v1-0) - (&+! (-> obj path-data v1-0) arg0) + (if (-> this path-data v1-0) + (&+! (-> this path-data v1-0) arg0) ) ) - (the-as flutflut ((method-of-type process-drawable relocate) obj arg0)) + (the-as flutflut ((method-of-type process-drawable relocate) this arg0)) ) (define *flutflut-shadow-control* @@ -84,7 +84,7 @@ ) ) (('touch 'attack) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) #f ) ) @@ -128,7 +128,7 @@ ) (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) - (< (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 0.05)) + (not (time-elapsed? (-> self touch-time) (seconds 0.05))) ) (go-virtual pickup (method-of-object self idle)) ) @@ -260,8 +260,8 @@ (flutflut-effect) (suspend) ) - (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 1)) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 1)) (flutflut-effect) (suspend) ) @@ -297,8 +297,8 @@ ) ) -(defmethod init-from-entity! flutflut ((obj flutflut) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! flutflut ((this flutflut) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -312,46 +312,46 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (res-lump-float arg0 'rotoffset)) - (initialize-skeleton obj *flutflut-sg* '()) - (logior! (-> obj skel status) (janim-status eye)) - (set! (-> obj draw shadow-ctrl) *flutflut-shadow-control*) - (let ((v1-24 (-> obj node-list data))) + (process-drawable-from-entity! this arg0) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) (res-lump-float arg0 'rotoffset)) + (initialize-skeleton this *flutflut-sg* '()) + (logior! (-> this skel status) (janim-status eye)) + (set! (-> this draw shadow-ctrl) *flutflut-shadow-control*) + (let ((v1-24 (-> this node-list data))) (set! (-> v1-24 0 param0) cspace<-transformq+trans!) - (set! (-> v1-24 0 param1) (the-as basic (-> obj root-override trans))) - (set! (-> v1-24 0 param2) (the-as basic (-> obj extra-trans))) + (set! (-> v1-24 0 param1) (the-as basic (-> this root-override trans))) + (set! (-> v1-24 0 param2) (the-as basic (-> this extra-trans))) ) (dotimes (s4-2 2) - (let ((v1-27 (new 'process 'curve-control obj 'path (the float (+ s4-2 1))))) - (set! (-> obj path-data s4-2) v1-27) + (let ((v1-27 (new 'process 'curve-control this 'path (the float (+ s4-2 1))))) + (set! (-> this path-data s4-2) v1-27) (if v1-27 (logior! (-> v1-27 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) ) - (set! (-> obj condition) (res-lump-value arg0 'index int)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this condition) (res-lump-value arg0 'index int)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 120) obj)) - (set! (-> obj auto-get-off) #f) - (move-to-ground (-> obj root-override) 40960.0 40960.0 #t (collide-kind background)) - (set! (-> obj cell) (the-as handle #f)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 120) this)) + (set! (-> this auto-get-off) #f) + (move-to-ground (-> this root-override) 40960.0 40960.0 #t (collide-kind background)) + (set! (-> this cell) (the-as handle #f)) (blocking-plane-spawn (the-as curve-control (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut))) - (-> obj path-flut) - (-> obj path-target) + (-> this path-flut) + (-> this path-target) ) ) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> obj root-override trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root-override trans)) ) - (go (method-of-object obj wait-for-start)) + (go (method-of-object this wait-for-start)) (none) ) diff --git a/goal_src/jak1/levels/flut_common/target-flut.gc b/goal_src/jak1/levels/flut_common/target-flut.gc index 2f64a360f5..0622f2ebd7 100644 --- a/goal_src/jak1/levels/flut_common/target-flut.gc +++ b/goal_src/jak1/levels/flut_common/target-flut.gc @@ -528,7 +528,7 @@ (go target-flut-running-attack) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (and (time-elapsed? (-> self control unknown-dword11) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-37 (ja-group))) (or (not (or (= v1-37 (-> self draw art-group data 59)) @@ -590,7 +590,7 @@ (defstate target-flut-walk (target) :event target-flut-standard-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *flut-walk-mods*) (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-surface00 turnv))) (set! (-> self control unknown-int21) (the-as int (-> self control unknown-surface00 target-speed))) @@ -619,7 +619,7 @@ (go target-flut-running-attack) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (and (time-elapsed? (-> self control unknown-dword11) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-37 (ja-group))) (or (not (or (= v1-37 (-> self draw art-group data 59)) @@ -647,12 +647,12 @@ (seek! (-> self control unknown-surface00 target-speed) (the-as float 4096.0) - (* 245760.0 (-> *display* seconds-per-frame)) + (* 245760.0 (seconds-per-frame)) ) (seek! (-> self control unknown-surface00 target-speed) (the-as float (-> self control unknown-uint30)) - (* 81920.0 (-> *display* seconds-per-frame)) + (* 81920.0 (seconds-per-frame)) ) ) ) @@ -715,7 +715,7 @@ ) ) ) - (set! f30-0 (seek f30-0 f0-13 (* 4.0 (-> *display* seconds-per-frame)))) + (set! f30-0 (seek f30-0 f0-13 (* 4.0 (seconds-per-frame)))) ) (set! (-> self skel root-channel 1 frame-interp) f30-0) (let* ((f0-16 (current-cycle-distance (-> self skel))) @@ -778,7 +778,7 @@ ) ) :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sound-play "jump" :pitch -0.5) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) @@ -816,9 +816,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 61440.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -827,7 +825,7 @@ (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (and (time-elapsed? (-> self state-time) (seconds 0.1)) (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) ) @@ -842,7 +840,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 float) (arg1 float)) @@ -905,7 +903,7 @@ (defstate target-flut-double-jump (target) :event (-> target-flut-jump event) :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (set! (-> self control dynam gravity-max) 40960.0) (set! (-> self control dynam gravity-length) 245760.0) @@ -932,15 +930,13 @@ (and (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (< 4096.0 (target-height-above-ground)) ) ) (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) ) - (if (!= (-> self state-time) (-> *display* base-frame-counter)) + (if (!= (-> self state-time) (current-time)) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) ) (if (ja-group? (-> self draw art-group data 149)) @@ -949,7 +945,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 float) (arg1 float)) @@ -982,15 +978,15 @@ (seek! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max) - (* 163840.0 (-> *display* seconds-per-frame)) + (* 163840.0 (seconds-per-frame)) ) (seek! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length) - (* 163840.0 (-> *display* seconds-per-frame)) + (* 163840.0 (seconds-per-frame)) ) ) - (-> *display* base-frame-counter) + (current-time) (ja-channel-push! 2 (seconds 0.1)) (ja-no-eval :group! (-> self draw art-group data 144) :num! (loop!) :frame-num 0.0) (ja :chan 1 @@ -1003,12 +999,12 @@ (seek! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max) - (* 163840.0 (-> *display* seconds-per-frame)) + (* 163840.0 (seconds-per-frame)) ) (seek! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length) - (* 163840.0 (-> *display* seconds-per-frame)) + (* 163840.0 (seconds-per-frame)) ) (ja :num! (loop! max)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) @@ -1045,7 +1041,7 @@ (go target-flut-walk) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (and (time-elapsed? (-> self control unknown-dword11) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-34 (ja-group))) (or (not (or (= v1-34 (-> self draw art-group data 59)) @@ -1074,15 +1070,13 @@ :event (-> target-flut-jump event) :enter (behavior ((arg0 symbol)) (set! (-> self control unknown-surface00) *flut-jump-mods*) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (-> target-flut-start exit) :trans (behavior () (when (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (/ (the-as int (-> *TARGET-bank* stuck-time)) 2) - ) + (and (time-elapsed? (-> self state-time) (/ (the-as int (-> *TARGET-bank* stuck-time)) 2)) (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) ) @@ -1095,7 +1089,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 symbol)) @@ -1144,7 +1138,7 @@ ) ) (when gp-1 - (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self control unknown-uint20) (the-as uint (current-time))) (let ((v1-9 (if (and (nonzero? proc) (type-type? (-> proc type) process-drawable)) proc ) @@ -1168,7 +1162,7 @@ ) ) (when (or (= gp-1 'die) (= gp-1 'push)) - (let ((v0-2 (the-as object (-> *display* base-frame-counter)))) + (let ((v0-2 (the-as object (current-time)))) (set! (-> self control unknown-int21) (the-as int v0-2)) v0-2 ) @@ -1187,7 +1181,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control unknown-int21) 0) (set! (-> self control unknown-uint31) (the-as uint 0)) @@ -1199,7 +1193,7 @@ (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.25)) + (time-elapsed? (-> self control unknown-dword82) (seconds 0.25)) ) (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 32))) @@ -1221,7 +1215,7 @@ :to self ) ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword82)) ) ) :exit (behavior () @@ -1229,18 +1223,18 @@ (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) - (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword31)) (target-exit) ) :trans (behavior () - (when (!= (-> self state-time) (-> *display* base-frame-counter)) + (when (!= (-> self state-time) (current-time)) (if (and (or (smack-surface? #t) (and (>= (-> self control unknown-float63) 0.7) (not (logtest? (-> self control status) (cshape-moving-flags t-act))) ) ) (begin - (set! (-> self control unknown-int21) (the-as int (-> *display* base-frame-counter))) + (set! (-> self control unknown-int21) (the-as int (current-time))) (set! (-> self control unknown-float81) 0.0) (let ((gp-0 (new-stack-vector0)) (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -1261,16 +1255,14 @@ #t ) (or (zero? (-> self control unknown-uint20)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.04)) ) (!= (-> self control unknown-uint31) 1) ) (target-shoved (meters 2) (-> *TARGET-bank* smack-surface-height) (the-as process #f) target-flut-hit) ) (if (and (logtest? (-> self water flags) (water-flags wt09)) - (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) + (zero? (mod (- (current-time) (-> self state-time)) 21)) ) (create-splash (-> self water) @@ -1289,7 +1281,7 @@ (set! (-> self control dynam gravity-max) 368640.0) (set! (-> self control dynam gravity-length) 368640.0) (let ((f28-0 0.0) - (f30-0 (the-as float (if (= (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (f30-0 (the-as float (if (= (-> self control unknown-dword82) (current-time)) 0.2 0.8 ) @@ -1302,7 +1294,7 @@ (cond ((and (>= (ja-aframe-num 0) 20.0) (and (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-39 (ja-group))) (or (not (or (= v1-39 (-> self draw art-group data 59)) @@ -1314,17 +1306,13 @@ ) ) ) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.04)) ) ) (go target-flut-falling #f) ) ((and (nonzero? (-> self control unknown-uint30)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint30)) (seconds 0.04)) ) (set-forward-vel (the-as float 0.0)) (set! f30-0 0.0) @@ -1347,15 +1335,15 @@ ) (suspend) (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *flut-run-attack-mods* turnvv) 0.0) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! f30-0 (* f30-0 (the-as float (fmin 1.0 (the-as float (-> self control unknown-float140)))))) ) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-105 (ja-group))) (or (not (or (= v1-105 (-> self draw art-group data 59)) @@ -1416,7 +1404,7 @@ ) :enter (behavior ((arg0 float)) (set-forward-vel arg0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-air-attack-mods*) (target-start-attack) @@ -1472,7 +1460,7 @@ (go target-flut-air-attack-hit-ground) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) 4096.0) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (and (time-elapsed? (-> self state-time) (seconds 0.5)) (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) ) @@ -1542,7 +1530,7 @@ (seek! (-> arg0 collide-info root-prim local-sphere w) (the-as float 28672.0) - (* 286720.0 (-> *display* seconds-per-frame)) + (* 286720.0 (seconds-per-frame)) ) (update-transforms! (-> arg0 collide-info)) (none) @@ -1598,7 +1586,7 @@ ) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((v1-2 gp-0)) @@ -1643,7 +1631,7 @@ ) (when (= arg0 'attack) (logior! (-> self state-flags) (state-flags being-attacked)) - (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('endlessfall) (cond @@ -1651,8 +1639,8 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-known-safe-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s3-1) (seconds 1)) + (let ((s3-1 (current-time))) + (until (time-elapsed? s3-1 (seconds 1)) (suspend) ) ) @@ -1778,10 +1766,10 @@ ) ) ) - (let ((gp-4 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-4) (seconds 1)) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 1)) (target-flut-falling-anim-trans) - (vector-seek! (-> self draw color-mult) *zero-vector* (-> *display* seconds-per-frame)) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) (let ((s5-2 (new-stack-vector0)) (f30-1 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) ) @@ -1829,10 +1817,10 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (until v1-104 (suspend) - (set! v1-104 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (movie?)))) + (set! v1-104 (and (time-elapsed? (-> self state-time) (seconds 1)) (not (movie?)))) ) (go target-flut-stance) ) @@ -1846,7 +1834,7 @@ (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self alt-cam-pos quad) (-> (&-> (-> self control) unknown-qword00) 0)) (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1899,20 +1887,14 @@ ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) - (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (current-time) (-> self state-time)))))) ) (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) (set! (-> gp-0 y) (lerp (-> self control unknown-vector102 y) (-> self control unknown-vector103 y) - (fmax - 0.0 - (fmin - 1.0 - (* 0.006666667 (the float (+ (- (the-as int (-> self state-time))) (-> *display* base-frame-counter)))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (+ (- (the-as int (-> self state-time))) (current-time)))))) ) ) (move-to-point! (-> self control) gp-0) @@ -1935,7 +1917,7 @@ (let ((s5-0 0)) (while (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (target-flut-falling-anim-trans) - (+! s5-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) + (+! s5-0 (- (current-time) (-> *display* old-base-frame-counter))) (suspend) ) ) @@ -1951,7 +1933,7 @@ :event target-generic-event-handler :exit (-> target-flut-start exit) :code (behavior ((arg0 handle)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) @@ -2006,23 +1988,15 @@ ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) - (f30-0 - (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) - ) + (f30-0 (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (current-time) (-> self state-time))))))) ) - (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (current-time) (-> self state-time)))))) (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) (set! (-> gp-0 y) (lerp (-> self control unknown-vector102 y) (-> self control unknown-vector103 y) - (fmax - 0.0 - (fmin - 1.0 - (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (-> *display* base-frame-counter)))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (current-time)))))) ) ) (move-to-point! (-> self control) gp-0) diff --git a/goal_src/jak1/levels/intro/evilbro.gc b/goal_src/jak1/levels/intro/evilbro.gc index 2f87b7ecac..068adb6981 100644 --- a/goal_src/jak1/levels/intro/evilbro.gc +++ b/goal_src/jak1/levels/intro/evilbro.gc @@ -23,21 +23,21 @@ :shadow evilbro-shadow-mg ) -(defmethod play-anim! evilbro ((obj evilbro) (arg0 symbol)) +(defmethod play-anim! evilbro ((this evilbro) (arg0 symbol)) (cond (arg0 (close-specific-task! (game-task leaving-misty) (task-status need-introduction)) - (send-event (-> obj evilsis extra process) 'clone (process->handle obj)) + (send-event (-> this evilsis extra process) 'clone (process->handle this)) ) (else - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) ) (the-as basic (new 'static 'spool-anim :name "evilbro-misty-end" :index 5 :parts 9 :command-list '())) ) -(defmethod get-art-elem evilbro ((obj evilbro)) - (-> obj draw art-group data 3) +(defmethod get-art-elem evilbro ((this evilbro)) + (-> this draw art-group data 3) ) (defstate play-anim (evilbro) @@ -60,8 +60,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (while (let ((s5-0 (-> *display* base-frame-counter)) + (let ((gp-0 (current-time))) + (while (let ((s5-0 (current-time)) (f30-0 300.0) (f28-0 0.16) (f26-0 0.17000002) @@ -76,8 +76,8 @@ (suspend) (ja :num! (seek! (ja-aframe 0.0 0))) ) - (let ((gp-3 (-> *display* base-frame-counter))) - (while (let ((s5-1 (-> *display* base-frame-counter)) + (let ((gp-3 (current-time))) + (while (let ((s5-1 (current-time)) (f30-1 300.0) (f28-1 0.16) (f26-1 0.17000002) @@ -91,11 +91,11 @@ ) ) -(defmethod init-from-entity! evilbro ((obj evilbro) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *evilbro-intro-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task leaving-misty))) - (set! (-> obj evilsis) (entity-actor-lookup arg0 'alt-actor 0)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! evilbro ((this evilbro) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *evilbro-intro-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task leaving-misty))) + (set! (-> this evilsis) (entity-actor-lookup arg0 'alt-actor 0)) + (process-taskable-method-42 this) (none) ) @@ -114,20 +114,20 @@ :shadow evilsis-shadow-mg ) -(defmethod play-anim! evilsis ((obj evilsis) (arg0 symbol)) +(defmethod play-anim! evilsis ((this evilsis) (arg0 symbol)) (if arg0 (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (the-as basic (get-art-elem obj)) + (the-as basic (get-art-elem this)) ) -(defmethod get-art-elem evilsis ((obj evilsis)) - (-> obj draw art-group data 3) +(defmethod get-art-elem evilsis ((this evilsis)) + (-> this draw art-group data 3) ) (defstate idle (evilsis) @@ -138,9 +138,9 @@ ) ) -(defmethod init-from-entity! evilsis ((obj evilsis) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *evilsis-intro-sg* 3 0 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task leaving-misty))) - (process-taskable-method-42 obj) +(defmethod init-from-entity! evilsis ((this evilsis) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *evilsis-intro-sg* 3 0 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task leaving-misty))) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/jungle/bouncer.gc b/goal_src/jak1/levels/jungle/bouncer.gc index c95a0187e8..9e388231eb 100644 --- a/goal_src/jak1/levels/jungle/bouncer.gc +++ b/goal_src/jak1/levels/jungle/bouncer.gc @@ -68,7 +68,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('touch) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) (else @@ -77,10 +77,10 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self smush) 0.0) (loop - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) (ja :num! (seek! 0.0 0.1)) (ja :num! (seek! (lerp-scale @@ -116,8 +116,8 @@ :post transform-post ) -(defmethod init-from-entity! springbox ((obj springbox) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! springbox ((this springbox) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -134,12 +134,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *bouncer-sg* '()) - (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) - (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *bouncer-sg* '()) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) (go bouncer-wait) (none) ) diff --git a/goal_src/jak1/levels/jungle/darkvine.gc b/goal_src/jak1/levels/jungle/darkvine.gc index 3a0a267533..0a5d913f85 100644 --- a/goal_src/jak1/levels/jungle/darkvine.gc +++ b/goal_src/jak1/levels/jungle/darkvine.gc @@ -34,16 +34,16 @@ ) -(defmethod run-logic? darkvine ((obj darkvine)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-status was-drawn)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override pause-adjust-distance)) - (vector-vector-distance (-> obj root-override trans) (math-camera-pos)) +(defmethod run-logic? darkvine ((this darkvine)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-status was-drawn)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root-override pause-adjust-distance)) + (vector-vector-distance (-> this root-override trans) (math-camera-pos)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) @@ -181,9 +181,7 @@ ) ) :post (behavior () - (when (and (-> self hit-player) - (or (not *target*) (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 0.05))) - ) + (when (and (-> self hit-player) (or (not *target*) (time-elapsed? (-> self touch-time) (seconds 0.05)))) (set-collide-offense (-> self root-override) 2 (collide-offense indestructible)) (set! (-> self hit-player) #f) ) @@ -202,7 +200,7 @@ (defstate darkvine-retreat (darkvine) :event darkvine-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self dangerous) #f) (set! (-> self vulnerable) #f) (logclear! (-> self mask) (process-mask actor-pause)) @@ -214,8 +212,8 @@ (ja :num! (seek!)) ) (ja-channel-set! 0) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 2)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) (suspend) ) ) @@ -230,8 +228,8 @@ (-> self root-override trans) :to *entity-pool* ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.5)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -266,9 +264,9 @@ :post (-> darkvine-idle post) ) -(defmethod init-from-entity! darkvine ((obj darkvine) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! darkvine ((this darkvine) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -314,14 +312,14 @@ ) (set! (-> s4-0 nav-radius) 2048.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj tip-index) 8) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *darkvine-sg* '()) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj hit-player) #f) - (set! (-> obj speed) (rand-vu-float-range 0.95 1.05)) + (set! (-> this tip-index) 8) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *darkvine-sg* '()) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this hit-player) #f) + (set! (-> this speed) (rand-vu-float-range 0.95 1.05)) (if (logtest? (get-reminder (get-task-control (game-task jungle-plant)) 0) 1) (go darkvine-die #t) ) diff --git a/goal_src/jak1/levels/jungle/fisher.gc b/goal_src/jak1/levels/jungle/fisher.gc index 433dd30652..71d97713ff 100644 --- a/goal_src/jak1/levels/jungle/fisher.gc +++ b/goal_src/jak1/levels/jungle/fisher.gc @@ -796,10 +796,10 @@ :shadow fisher-shadow-mg ) -(defmethod process-taskable-method-52 fisher ((obj fisher)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 fisher ((this fisher)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0))) ) @@ -815,21 +815,21 @@ (none) ) -(defmethod draw-npc-shadow fisher ((obj fisher)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow fisher ((this fisher)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -854,7 +854,7 @@ ) (defbehavior fisher-fish-move fisher-fish () - (+! (-> self pos) (* (-> self vel) (-> *display* seconds-per-frame))) + (+! (-> self pos) (* (-> self vel) (seconds-per-frame))) (eval-path-curve-div! (-> (the-as fisher (-> self parent 0)) path) (-> self root trans) (-> self pos) 'interp) (path-control-method-12 (-> (the-as fisher (-> self parent 0)) path) (-> self dir) (-> self pos)) (seek-toward-heading-vec! (-> self root) (-> self dir) 291271.12 (seconds 0.2)) @@ -1082,16 +1082,16 @@ (none) ) -(defmethod play-anim! fisher ((obj fisher) (arg0 symbol)) +(defmethod play-anim! fisher ((this fisher) (arg0 symbol)) (if arg0 - (set! (-> obj training) #f) + (set! (-> this training) #f) ) - (case (current-status (-> obj tasks)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 - (set! (-> obj blend-on-exit) (the-as art-joint-anim #t)) - (close-status! (-> obj tasks) (task-status need-introduction)) - (set! (-> obj training) #t) + (set! (-> this blend-on-exit) (the-as art-joint-anim #t)) + (close-status! (-> this tasks) (task-status need-introduction)) + (set! (-> this training) #t) ) (new 'static 'spool-anim :name "fisher-introduction" @@ -1129,14 +1129,14 @@ ) ) (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) - (set! (-> obj blend-on-exit) (the-as art-joint-anim #t)) + (set! (-> this skippable) #t) + (set! (-> this blend-on-exit) (the-as art-joint-anim #t)) (new 'static 'spool-anim :name "fisher-reminder-1" :index 10 :parts 1 :command-list '()) ) (((task-status need-reward-speech)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "fisher-resolution" @@ -1150,40 +1150,40 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) -(defmethod get-art-elem fisher ((obj fisher)) - (if (closed? (-> obj tasks) (game-task jungle-fishgame) (task-status need-reminder)) - (-> obj draw art-group data 7) - (-> obj draw art-group data 6) +(defmethod get-art-elem fisher ((this fisher)) + (if (closed? (-> this tasks) (game-task jungle-fishgame) (task-status need-reminder)) + (-> this draw art-group data 7) + (-> this draw art-group data 6) ) ) -(defmethod process-taskable-method-38 fisher ((obj fisher)) - (case (current-status (-> obj tasks)) +(defmethod process-taskable-method-38 fisher ((this fisher)) + (case (current-status (-> this tasks)) (((task-status need-reminder-a) (task-status need-reminder)) - (go (method-of-object obj query)) + (go (method-of-object this query)) ) (((task-status need-reward-speech)) - (go (method-of-object obj play-anim)) + (go (method-of-object this play-anim)) ) (else - ((the-as (function fisher none) (find-parent-method fisher 38)) obj) + ((the-as (function fisher none) (find-parent-method fisher 38)) this) ) ) (none) ) -(defmethod get-accept-anim fisher ((obj fisher) (arg0 symbol)) +(defmethod get-accept-anim fisher ((this fisher) (arg0 symbol)) (when arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) (aybabtu 2) ) (new 'static 'spool-anim @@ -1194,7 +1194,7 @@ ) ) -(defmethod get-reject-anim fisher ((obj fisher) (arg0 symbol)) +(defmethod get-reject-anim fisher ((this fisher) (arg0 symbol)) (new 'static 'spool-anim :name "fisher-reject" :index 11 :parts 2 :command-list '()) ) @@ -1211,7 +1211,7 @@ ) (ja-channel-set! 1) (ja :group! (get-art-elem self)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (while (-> self child) (deactivate (-> self child 0)) ) @@ -1303,8 +1303,8 @@ ) (process-spawn-function process (lambda :behavior process () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.1)) (suspend) ) ) @@ -1377,26 +1377,26 @@ (let ((f0-2 (rand-float-gen))) (cond ((and (< 0.3 f0-2) (< (+ (-> *FISHER-bank* max-caught) -30) (-> self caught))) - (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-almost)) (seconds 10)) + (if (and (time-elapsed? (-> self ambient-almost) (seconds 10)) (play-ambient (-> self ambient) "FIS-TA11" #t (-> self root-override trans)) ) - (set! (-> self ambient-almost) (-> *display* base-frame-counter)) + (set-time! (-> self ambient-almost)) ) ) ((< 0.125 f0-2) ) ((< 0.1 f0-2) - (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-steady)) (seconds 10)) + (if (and (time-elapsed? (-> self ambient-steady) (seconds 10)) (play-ambient (-> self ambient) "FIS-TA06" #t (-> self root-override trans)) ) - (set! (-> self ambient-steady) (-> *display* base-frame-counter)) + (set-time! (-> self ambient-steady)) ) ) ((< (+ (-> *FISHER-bank* max-missed) -6) (-> self missed)) - (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-sagging)) (seconds 10)) + (if (and (time-elapsed? (-> self ambient-sagging) (seconds 10)) (play-ambient (-> self ambient) "FIS-TA07" #t (-> self root-override trans)) ) - (set! (-> self ambient-sagging) (-> *display* base-frame-counter)) + (set-time! (-> self ambient-sagging)) ) ) ) @@ -1405,8 +1405,8 @@ ) (defbehavior fisher-game-update fisher () - (when (>= (- (-> *display* base-frame-counter) (-> self block-time)) (-> self params timeout)) - (set! (-> self block-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self block-time) (-> self params timeout)) + (set-time! (-> self block-time)) (+! (-> self block) 1) (mem-copy! (the-as pointer (-> self params)) @@ -1414,14 +1414,14 @@ 56 ) ) - (when (>= (- (-> *display* base-frame-counter) (-> self turn-time)) (-> self swing-time)) - (set! (-> self turn-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self turn-time) (-> self swing-time)) + (set-time! (-> self turn-time)) (set! (-> self swing-time) (rand-vu-int-range (the-as int (-> self params swing-min)) (the-as int (-> self params swing-max))) ) (set! (-> self params vel) (- (-> self params vel))) ) - (+! (-> self spawner) (* (-> self params vel) (-> *display* seconds-per-frame))) + (+! (-> self spawner) (* (-> self params vel) (seconds-per-frame))) (if (= (-> self params swing-min) (seconds 333.33)) (set! (-> self spawner) (* 0.01 (the float (-> self params swing-max)))) ) @@ -1435,16 +1435,14 @@ (set! (-> self spawner) 0.0) ) ) - (when (and (nonzero? (-> self params period)) - (>= (- (-> *display* base-frame-counter) (-> self spawn-time)) (-> self params period)) - ) + (when (and (nonzero? (-> self params period)) (time-elapsed? (-> self spawn-time) (-> self params period))) (let ((gp-0 (cond ((rand-vu-percent? (-> self params powerup-percent)) - (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-big-one)) (seconds 30)) + (if (and (time-elapsed? (-> self ambient-big-one) (seconds 30)) (play-ambient (-> self ambient) "FIS-TA03" #t (-> self root-override trans)) ) - (set! (-> self ambient-big-one) (-> *display* base-frame-counter)) + (set-time! (-> self ambient-big-one)) ) 'powerup ) @@ -1464,18 +1462,18 @@ (set! (-> self spawner) (* 0.5 (+ (-> self spawner-last) (-> self spawner)))) ) (set! (-> self spawner-last) (-> self spawner)) - (set! (-> self spawn-time) (-> *display* base-frame-counter)) + (set-time! (-> self spawn-time)) (sound-play "fish-spawn" :vol 70) (fisher-spawn-ambient) (process-spawn fisher-fish gp-0 (-> self spawner) (* 1.85 (-> self params fish-vel)) :to self) ) ) (let ((f1-14 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 32.0 110.0 28.0))) - (+! (-> self paddle-vel) (* f1-14 (-> *display* seconds-per-frame))) + (+! (-> self paddle-vel) (* f1-14 (seconds-per-frame))) ) - (seek! (-> self paddle-vel) 0.0 (* 15.0 (-> *display* seconds-per-frame))) + (seek! (-> self paddle-vel) 0.0 (* 15.0 (seconds-per-frame))) (set! (-> self paddle-vel) (fmax -2.0 (fmin 2.0 (-> self paddle-vel)))) - (+! (-> self paddle) (* (-> self paddle-vel) (-> *display* seconds-per-frame))) + (+! (-> self paddle) (* (-> self paddle-vel) (seconds-per-frame))) (set! (-> self paddle) (fmax 0.0 (fmin 1.0 (-> self paddle)))) (vector-lerp! (-> self paddle-pos) @@ -1565,14 +1563,14 @@ (set! *display-profile* #f) (set! (-> self paddle) 0.5) (set! (-> self paddle-vel) 0.0) - (set! (-> self start-time) (-> *display* base-frame-counter)) + (set-time! (-> self start-time)) (set! (-> self caught) 0) (set! (-> self missed) 0) (set! (-> self spawner) 0.5) (set! (-> self spawner-last) 0.5) (set! (-> self swing-time) 0) (set! (-> self block) -1) - (set! (-> self block-time) (-> *display* base-frame-counter)) + (set-time! (-> self block-time)) (+! (-> self block) 1) (mem-copy! (the-as pointer (-> self params)) @@ -1668,45 +1666,45 @@ ((-> (method-of-type process-taskable play-anim) exit))) ) -(defmethod process-taskable-method-43 fisher ((obj fisher)) +(defmethod process-taskable-method-43 fisher ((this fisher)) (cond - ((closed? (-> obj tasks) (game-task jungle-fishgame) (task-status need-reminder)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 1) 122880.0 obj) + ((closed? (-> this tasks) (game-task jungle-fishgame) (task-status need-reminder)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 1) 122880.0 this) (let ((f0-2 (rand-float-gen))) (if (< 0.5 f0-2) - (play-ambient (-> obj ambient) "FIS-LO03" #f (-> obj root-override trans)) - (play-ambient (-> obj ambient) "FIS-LO05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-LO03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-LO05" #f (-> this root-override trans)) ) ) ) ) (else - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-5 (rand-float-gen))) (cond ((< 0.875 f0-5) - (play-ambient (-> obj ambient) "FIS-LO01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-LO01" #f (-> this root-override trans)) ) ((< 0.75 f0-5) - (play-ambient (-> obj ambient) "FIS-LO04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-LO04" #f (-> this root-override trans)) ) ((< 0.625 f0-5) - (play-ambient (-> obj ambient) "FIS-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM01" #f (-> this root-override trans)) ) ((< 0.5 f0-5) - (play-ambient (-> obj ambient) "FIS-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM02" #f (-> this root-override trans)) ) ((< 0.375 f0-5) - (play-ambient (-> obj ambient) "FIS-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM03" #f (-> this root-override trans)) ) ((< 0.25 f0-5) - (play-ambient (-> obj ambient) "FIS-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM04" #f (-> this root-override trans)) ) ((< 0.125 f0-5) - (play-ambient (-> obj ambient) "FIS-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM05" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "FIS-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM06" #f (-> this root-override trans)) ) ) ) @@ -1915,8 +1913,8 @@ ) ) -(defmethod initialize-collision fisher ((obj fisher) (arg0 int) (arg1 vector)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision fisher ((this fisher) (arg0 int) (arg1 vector)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1945,35 +1943,35 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod target-above-threshold? fisher ((obj fisher)) - (or (= (current-task (-> obj tasks)) (game-task jungle-fishgame)) (-> obj hard)) +(defmethod target-above-threshold? fisher ((this fisher)) + (or (= (current-task (-> this tasks)) (game-task jungle-fishgame)) (-> this hard)) ) -(defmethod init-from-entity! fisher ((obj fisher) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *fisher-sg* 3 49 (new 'static 'vector :w 4096.0) 33) - (set! (-> obj tasks) (get-task-control (game-task jungle-fishgame))) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (let ((s5-0 (eval-path-curve-div! (-> obj path) (-> obj paddle-pos) 6.5 'interp)) - (s4-0 (path-control-method-12 (-> obj path) (new-stack-vector0) 6.5)) +(defmethod init-from-entity! fisher ((this fisher) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *fisher-sg* 3 49 (new 'static 'vector :w 4096.0) 33) + (set! (-> this tasks) (get-task-control (game-task jungle-fishgame))) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s5-0 (eval-path-curve-div! (-> this path) (-> this paddle-pos) 6.5 'interp)) + (s4-0 (path-control-method-12 (-> this path) (new-stack-vector0) 6.5)) ) (+! (-> s5-0 y) 2457.6) (vector-normalize! (vector-rotate-y! s4-0 s4-0 16384.0) (-> *FISHER-bank* width)) - (vector-! (the-as vector (-> obj paddle-end)) s5-0 s4-0) - (vector+! (the-as vector (&-> obj stack 288)) s5-0 s4-0) + (vector-! (the-as vector (-> this paddle-end)) s5-0 s4-0) + (vector+! (the-as vector (&-> this stack 288)) s5-0 s4-0) ) - (set! (-> obj music) 'fishgame) - (set! (-> obj difficulty) (the-as int (-> obj entity extra perm user-uint8 6))) - (set! (-> obj hard) #f) + (set! (-> this music) 'fishgame) + (set! (-> this difficulty) (the-as int (-> this entity extra perm user-uint8 6))) + (set! (-> this hard) #f) (set! (-> *FISHER-bank* max-caught) 200) - (set! (-> obj training) #f) - (process-taskable-method-42 obj) + (set! (-> this training) #f) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/jungle/hopper.gc b/goal_src/jak1/levels/jungle/hopper.gc index 7d13d6b8ba..094bf305c8 100644 --- a/goal_src/jak1/levels/jungle/hopper.gc +++ b/goal_src/jak1/levels/jungle/hopper.gc @@ -27,12 +27,12 @@ nav-enemy-default-event-handler -(defmethod common-post hopper ((obj hopper)) - (let ((v1-1 (-> obj draw shadow-ctrl))) - (set! (-> v1-1 settings bot-plane w) (- (- (-> obj shadow-min-y) (-> obj collide-info trans y)))) +(defmethod common-post hopper ((this hopper)) + (let ((v1-1 (-> this draw shadow-ctrl))) + (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)) obj) + ((the-as (function nav-enemy none) (find-parent-method hopper 39)) this) 0 (none) ) @@ -165,9 +165,9 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.075)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! hopper-idle-ja :num! min) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) (ja :num! (loop!)) ) @@ -227,9 +227,9 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.075)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! hopper-idle-ja :num! min) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) (ja :num! (loop!)) ) @@ -302,8 +302,8 @@ nav-enemy-default-event-handler ) ) -(defmethod initialize-collision hopper ((obj hopper)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision hopper ((this hopper)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -335,16 +335,16 @@ nav-enemy-default-event-handler (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod nav-enemy-method-48 hopper ((obj hopper)) - (initialize-skeleton obj *hopper-sg* '()) - (init-defaults! obj *hopper-nav-enemy-info*) - (set! (-> obj shadow-min-y) (+ (-> obj collide-info trans y) (-> obj nav-info shadow-min-y))) +(defmethod nav-enemy-method-48 hopper ((this hopper)) + (initialize-skeleton this *hopper-sg* '()) + (init-defaults! this *hopper-nav-enemy-info*) + (set! (-> this shadow-min-y) (+ (-> this collide-info trans y) (-> this nav-info shadow-min-y))) 0 (none) ) diff --git a/goal_src/jak1/levels/jungle/jungle-elevator.gc b/goal_src/jak1/levels/jungle/jungle-elevator.gc index a9a605fa64..e4b3926299 100644 --- a/goal_src/jak1/levels/jungle/jungle-elevator.gc +++ b/goal_src/jak1/levels/jungle/jungle-elevator.gc @@ -19,8 +19,8 @@ ) -(defmethod can-activate? jungle-elevator ((obj jungle-elevator)) - (and ((method-of-type plat-button can-activate?) obj) (task-complete? *game-info* (game-task jungle-tower))) +(defmethod can-activate? jungle-elevator ((this jungle-elevator)) + (and ((method-of-type plat-button can-activate?) this) (task-complete? *game-info* (game-task jungle-tower))) ) (defstate plat-button-move-downward (jungle-elevator) @@ -60,7 +60,7 @@ (send-event *target* 'reset-height) ) ) - (if (and (>= (-> self path-pos) 0.2) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))) + (if (and (>= (-> self path-pos) 0.2) (not (time-elapsed? (-> self state-time) (seconds 0.2)))) (load-commands-set! *level* (load-command-get-index *level* 'jungle 0)) ) ) @@ -93,7 +93,7 @@ (t9-0) ) ) - (if (and (< (-> self path-pos) 0.8) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))) + (if (and (< (-> self path-pos) 0.8) (not (time-elapsed? (-> self state-time) (seconds 0.2)))) (load-commands-set! *level* (load-command-get-index *level* 'jungle 1)) ) ) @@ -126,18 +126,18 @@ ) ) -(defmethod should-teleport? jungle-elevator ((obj jungle-elevator)) +(defmethod should-teleport? jungle-elevator ((this jungle-elevator)) (let ((f0-0 (-> (camera-pos) y))) - (case (-> obj path-pos) + (case (-> this path-pos) ((0.0) - (when (< f0-0 (-> obj teleport-if-below-y)) - (set! (-> obj draw light-index) (the-as uint 1)) + (when (< f0-0 (-> this teleport-if-below-y)) + (set! (-> this draw light-index) (the-as uint 1)) (return #t) ) ) ((1.0) - (when (< (-> obj teleport-if-above-y) f0-0) - (set! (-> obj draw light-index) (the-as uint 255)) + (when (< (-> this teleport-if-above-y) f0-0) + (set! (-> this draw light-index) (the-as uint 255)) (return #t) ) ) @@ -146,15 +146,15 @@ #f ) -(defmethod can-target-move? jungle-elevator ((obj jungle-elevator)) +(defmethod can-target-move? jungle-elevator ((this jungle-elevator)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (eval-path-curve! (-> obj path) s5-0 0.4 'interp) - (set! (-> obj teleport-if-above-y) (-> s5-0 y)) - (eval-path-curve! (-> obj path) s5-0 0.6 'interp) - (set! (-> obj teleport-if-below-y) (-> s5-0 y)) + (eval-path-curve! (-> this path) s5-0 0.4 'interp) + (set! (-> this teleport-if-above-y) (-> s5-0 y)) + (eval-path-curve! (-> this path) s5-0 0.6 'interp) + (set! (-> this teleport-if-below-y) (-> s5-0 y)) ) - (set! (-> obj draw light-index) (the-as uint 255)) - (set! (-> obj bidirectional?) #f) - (set! (-> obj should-grab-player?) #t) + (set! (-> this draw light-index) (the-as uint 255)) + (set! (-> this bidirectional?) #f) + (set! (-> this should-grab-player?) #t) (none) ) diff --git a/goal_src/jak1/levels/jungle/jungle-mirrors.gc b/goal_src/jak1/levels/jungle/jungle-mirrors.gc index 61a31372f0..26d7849190 100644 --- a/goal_src/jak1/levels/jungle/jungle-mirrors.gc +++ b/goal_src/jak1/levels/jungle/jungle-mirrors.gc @@ -529,21 +529,21 @@ ) -(defmethod relocate periscope ((obj periscope) (arg0 int)) - (if (nonzero? (-> obj grips)) - (&+! (-> obj grips) arg0) +(defmethod relocate periscope ((this periscope) (arg0 int)) + (if (nonzero? (-> this grips)) + (&+! (-> this grips) arg0) ) - (if (nonzero? (-> obj part-aligned)) - (&+! (-> obj part-aligned) arg0) + (if (nonzero? (-> this part-aligned)) + (&+! (-> this part-aligned) arg0) ) - (the-as periscope ((method-of-type process-drawable relocate) obj arg0)) + (the-as periscope ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate periscope ((obj periscope)) - (if (nonzero? (-> obj part-aligned)) - (kill-and-free-particles (-> obj part-aligned)) +(defmethod deactivate periscope ((this periscope)) + (if (nonzero? (-> this part-aligned)) + (kill-and-free-particles (-> this part-aligned)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -824,7 +824,7 @@ (set! (-> v1-30 y) (- (- 2048 (/ (-> v1-30 y) 16)))) ) (let ((f0-9 (- (atan (the float (-> v1-30 x)) (the float (- (-> v1-30 y))))))) - (set! (-> self gauge-rot) (deg-seek (-> self gauge-rot) f0-9 (* 131072.0 (-> *display* seconds-per-frame)))) + (set! (-> self gauge-rot) (deg-seek (-> self gauge-rot) f0-9 (* 131072.0 (seconds-per-frame)))) ) ) ) @@ -1193,7 +1193,7 @@ :code (behavior () (local-vars (v1-13 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (link-to-next-and-prev-actor (-> self link)) (periscope-find-next) (periscope-find-reflection-angles) @@ -1203,9 +1203,9 @@ ) (until (and v1-13 (= (-> self turn) (-> self target-turn)) (= (-> self tilt) (-> self target-tilt))) (sound-play "eco-tower-rise" :id (-> self rise-sound-id) :position (the-as symbol (-> self base))) - (seek! (-> self y-offset) (-> self height) (* 16384.0 (-> *display* seconds-per-frame))) - (seek! (-> self turn) (-> self target-turn) (* 7281.778 (-> *display* seconds-per-frame))) - (seek! (-> self tilt) (-> self target-tilt) (* 7281.778 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset) (-> self height) (* 16384.0 (seconds-per-frame))) + (seek! (-> self turn) (-> self target-turn) (* 7281.778 (seconds-per-frame))) + (seek! (-> self tilt) (-> self target-tilt) (* 7281.778 (seconds-per-frame))) (set! (-> self raised?) (< (+ -12288.0 (-> self height)) (-> self y-offset))) (periscope-update-joints) (suspend) @@ -1223,7 +1223,7 @@ (set! (-> self raised?) #t) (let ((f30-0 (+ -20480.0 (-> self height)))) (until (= (-> self y-offset-grips) f30-0) - (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (seconds-per-frame))) (periscope-update-joints) (suspend) ) @@ -1293,7 +1293,7 @@ (level-hint-spawn (text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) - (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (seconds-per-frame))) (periscope-update-joints) (suspend) ) @@ -1313,7 +1313,7 @@ (when (and *target* (>= f30-1 (vector-vector-distance a0-10 (-> *target* control trans)))) (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) (let ((f0-7 (fmax 4096.0 (fmin 12288.0 (+ (- 5120.0 (-> self base y)) (-> *target* control trans y)))))) - (seek! (-> self y-offset-grips) f0-7 (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset-grips) f0-7 (* 16384.0 (seconds-per-frame))) ) ) (vector-! gp-1 (target-pos 0) (-> self base)) @@ -1322,7 +1322,7 @@ (-> self grips transform quat) (-> self grips transform quat) (the-as quaternion gp-1) - (* 27306.666 (-> *display* seconds-per-frame)) + (* 27306.666 (seconds-per-frame)) ) (vector-z-quaternion! s3-0 (-> self grips transform quat)) (set! (-> self grips-moving?) (< (vector-dot s4-0 s3-0) (cos 182.04445))) @@ -1389,7 +1389,7 @@ (hide-hud) ) :code (behavior () - (set! (-> self lock-time) (-> *display* base-frame-counter)) + (set-time! (-> self lock-time)) (link-to-next-and-prev-actor (-> self link)) (periscope-find-next) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1497,12 +1497,10 @@ (suspend) (loop (if (not (-> self aligned?)) - (set! (-> self lock-time) (-> *display* base-frame-counter)) + (set-time! (-> self lock-time)) ) (periscope-crosshair) - (when (or (cpad-pressed? 0 triangle x) - (and (-> self aligned?) (>= (- (-> *display* base-frame-counter) (-> self lock-time)) (seconds 3))) - ) + (when (or (cpad-pressed? 0 triangle x) (and (-> self aligned?) (time-elapsed? (-> self lock-time) (seconds 3)))) (sound-stop (-> self sound-id)) (if (periscope-test-task-complete?) (close-specific-task! (game-task jungle-lurkerm) (task-status need-reminder)) @@ -1607,7 +1605,7 @@ (set! (-> self tilt) (-> self target-tilt)) (let ((f30-0 (+ -20480.0 (-> self height)))) (until (= (-> self y-offset-grips) f30-0) - (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (seconds-per-frame))) (periscope-update-joints) (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (suspend) @@ -1622,9 +1620,9 @@ :post periscope-post ) -(defmethod init-from-entity! periscope ((obj periscope) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! periscope ((this periscope) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1661,42 +1659,42 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj height) (res-lump-float (-> obj entity) 'height-info)) - (set! (-> obj y-offset) (-> obj height)) - (set! (-> obj y-offset-grips) (+ -20480.0 (-> obj height))) - (set! (-> obj base quad) (-> obj root-override trans quad)) - (set! (-> obj reflector-trans quad) (-> obj base quad)) - (+! (-> obj reflector-trans y) (-> obj height)) - (set! (-> obj reflector) (process-spawn reflector (-> obj reflector-trans) :to obj)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) + (process-drawable-from-entity! this arg0) + (set! (-> this height) (res-lump-float (-> this entity) 'height-info)) + (set! (-> this y-offset) (-> this height)) + (set! (-> this y-offset-grips) (+ -20480.0 (-> this height))) + (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this reflector-trans quad) (-> this base quad)) + (+! (-> this reflector-trans y) (-> this height)) + (set! (-> this reflector) (process-spawn reflector (-> this reflector-trans) :to this)) + (set! (-> this link) (new 'process 'actor-link-info this)) (periscope-find-next) - (initialize-skeleton obj *periscope-base-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 176) obj)) - (set! (-> obj part-aligned) (create-launch-control (-> *part-group-id-table* 689) obj)) - (set! (-> obj grips) (new 'process 'joint-mod-set-world obj 4 #t)) - (transformq-copy! (-> obj grips transform) (the-as transformq (-> obj root-override trans))) + (initialize-skeleton this *periscope-base-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 176) this)) + (set! (-> this part-aligned) (create-launch-control (-> *part-group-id-table* 689) this)) + (set! (-> this grips) (new 'process 'joint-mod-set-world this 4 #t)) + (transformq-copy! (-> this grips transform) (the-as transformq (-> this root-override trans))) (periscope-find-reflection-angles) - (set! (-> obj turn) (-> obj target-turn)) - (set! (-> obj tilt) (-> obj target-tilt)) + (set! (-> this turn) (-> this target-turn)) + (set! (-> this tilt) (-> this target-tilt)) (periscope-update-joints) - (set! (-> obj grips-moving?) #f) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> obj reflector-trans)) + (set! (-> this grips-moving?) #f) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> this reflector-trans)) ) - (set! (-> obj rise-sound-id) (new-sound-id)) - (set! (-> obj grips-sound-id) (new-sound-id)) - (set! (-> obj root-override nav-radius) 8192.0) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (set! (-> this rise-sound-id) (new-sound-id)) + (set! (-> this grips-sound-id) (new-sound-id)) + (set! (-> this root-override nav-radius) 8192.0) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go periscope-power-on) ) ((periscope-has-power-input?) - (set! (-> obj y-offset-grips) 8192.0) + (set! (-> this y-offset-grips) 8192.0) (go periscope-wait-for-player) ) (else @@ -1764,13 +1762,13 @@ ) ) -(defmethod init-from-entity! reflector-origin ((obj reflector-origin) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj blocker) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj reflector-trans quad) (-> obj root trans quad)) +(defmethod init-from-entity! reflector-origin ((this reflector-origin) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this blocker) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this reflector-trans quad) (-> this root trans quad)) (go reflector-origin-idle) (none) ) @@ -1847,8 +1845,8 @@ ) (send-event (ppointer->process v1-11) 'anim-mode 'play1) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.5)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -1871,8 +1869,8 @@ ) ) -(defmethod init-from-entity! reflector-mirror ((obj reflector-mirror) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! reflector-mirror ((this reflector-mirror) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1907,17 +1905,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (initialize-skeleton obj *reflector-mirror-sg* '()) - (set-vector! (-> obj beam-end) 1805721.6 167936.0 -932659.2 1.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> obj beam-end)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (initialize-skeleton this *reflector-mirror-sg* '()) + (set-vector! (-> this beam-end) 1805721.6 167936.0 -932659.2 1.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> this beam-end)) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go reflector-mirror-broken #t) (go reflector-mirror-idle) ) diff --git a/goal_src/jak1/levels/jungle/jungle-obs.gc b/goal_src/jak1/levels/jungle/jungle-obs.gc index 60339c45b5..3e308f0c2d 100644 --- a/goal_src/jak1/levels/jungle/jungle-obs.gc +++ b/goal_src/jak1/levels/jungle/jungle-obs.gc @@ -71,9 +71,9 @@ ) ) -(defmethod init-from-entity! logtrap ((obj logtrap) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! logtrap ((this logtrap) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -88,14 +88,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *logtrap-sg* '()) - (set! (-> obj draw shadow-ctrl) (new 'process 'shadow-control -5734.4 0.0 614400.0 (the-as float 1) 163840.0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (update-transforms! (-> obj root-override)) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *logtrap-sg* '()) + (set! (-> this draw shadow-ctrl) + (new 'process 'shadow-control -5734.4 0.0 614400.0 (the-as float 1) 163840.0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (update-transforms! (-> this root-override)) + (go (method-of-object this idle)) (none) ) @@ -130,12 +132,12 @@ :post ja-post ) -(defmethod init-from-entity! towertop ((obj towertop) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root-override) (new 'process 'trsq)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *towertop-sg* '()) +(defmethod init-from-entity! towertop ((this towertop) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root-override) (new 'process 'trsq)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *towertop-sg* '()) (go towertop-idle) (none) ) @@ -181,7 +183,7 @@ (quaternion-rotate-local-y! (-> self root-override quat) (-> self root-override quat) - (* 12743.111 (-> *display* seconds-per-frame) (-> self speed)) + (* 12743.111 (seconds-per-frame) (-> self speed)) ) (suspend) (ja :num! (seek! max (* 0.5 (-> self speed)))) @@ -191,9 +193,9 @@ :post rider-post ) -(defmethod init-from-entity! lurkerm-tall-sail ((obj lurkerm-tall-sail) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! lurkerm-tall-sail ((this lurkerm-tall-sail) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -219,16 +221,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lurkerm-tall-sail-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj speed) 1.0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj speed) 0.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lurkerm-tall-sail-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this speed) 1.0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this speed) 0.0) ) (go lurkerm-tall-sail-idle) (none) @@ -271,7 +273,7 @@ (quaternion-rotate-local-y! (-> self root-override quat) (-> self root-override quat) - (* -12743.111 (-> *display* seconds-per-frame) (-> self speed)) + (* -12743.111 (seconds-per-frame) (-> self speed)) ) (suspend) (ja :num! (seek! max (* 0.5 (-> self speed)))) @@ -281,9 +283,9 @@ :post rider-post ) -(defmethod init-from-entity! lurkerm-short-sail ((obj lurkerm-short-sail) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! lurkerm-short-sail ((this lurkerm-short-sail) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -326,16 +328,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lurkerm-short-sail-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj speed) 1.0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj speed) 0.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lurkerm-short-sail-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this speed) 1.0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this speed) 0.0) ) (go lurkerm-short-sail-idle) (none) @@ -391,10 +393,10 @@ :post rider-post ) -(defmethod init-from-entity! lurkerm-piston ((obj lurkerm-piston) (arg0 entity-actor)) +(defmethod init-from-entity! lurkerm-piston ((this lurkerm-piston) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -412,26 +414,26 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *lurkerm-piston-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj base quad) (-> obj root-override trans quad)) - (let ((f30-0 (-> obj base y))) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *lurkerm-piston-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this base quad) (-> this root-override trans quad)) + (let ((f30-0 (-> this base y))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-32 (res-lump-data arg0 'height-info pointer :tag-ptr (& sv-16)))) - (set! (-> obj base y) (+ f30-0 (if (and v1-32 (> (the-as int (-> sv-16 elt-count)) 0)) - (-> (the-as (pointer float) v1-32)) - 0.0 - ) - ) + (set! (-> this base y) (+ f30-0 (if (and v1-32 (> (the-as int (-> sv-16 elt-count)) 0)) + (-> (the-as (pointer float) v1-32)) + 0.0 + ) + ) ) ) ) - (let ((s4-1 (-> obj height))) + (let ((s4-1 (-> this height))) (set! (-> s4-1 x) 0.0) (set! sv-32 (new 'static 'res-tag)) (let ((v1-35 (res-lump-data arg0 'height-info (pointer float) :tag-ptr (& sv-32)))) @@ -444,11 +446,11 @@ (set! (-> s4-1 z) 0.0) (set! (-> s4-1 w) 1.0) ) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj speed) 1.0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj speed) 0.0) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this speed) 1.0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this speed) 0.0) ) (go lurkerm-piston-idle) (none) @@ -496,15 +498,15 @@ ) ) -(defmethod init-from-entity! accordian ((obj accordian) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *accordian-sg* '()) - (set! (-> obj root pause-adjust-distance) 204800.0) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj speed) 1.0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj speed) 0.0) +(defmethod init-from-entity! accordian ((this accordian) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *accordian-sg* '()) + (set! (-> this root pause-adjust-distance) 204800.0) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this speed) 1.0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this speed) 0.0) ) (go accordian-idle) (none) @@ -718,10 +720,10 @@ :post rider-post ) -(defmethod init-from-entity! precurbridge ((obj precurbridge) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! precurbridge ((this precurbridge) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -882,19 +884,19 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set-vector! (-> obj activation-point) 1765785.6 61440.0 -1279180.8 1.0) - (initialize-skeleton obj *precurbridge-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (set-vector! (-> this activation-point) 1765785.6 61440.0 -1279180.8 1.0) + (initialize-skeleton this *precurbridge-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-post) - (update-transforms! (-> obj root-override)) - (set! (-> obj base quad) (-> obj root-override trans quad)) - (set! (-> obj sound) (new 'process 'ambient-sound arg0 (-> obj root-override trans))) + (update-transforms! (-> this root-override)) + (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root-override trans))) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (logclear! (-> obj mask) (process-mask actor-pause)) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (logclear! (-> this mask) (process-mask actor-pause)) (go precurbridge-active #t) ) (else @@ -991,8 +993,8 @@ :post ja-post ) -(defmethod init-from-entity! maindoor ((obj maindoor) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! maindoor ((this maindoor) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1004,15 +1006,15 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *maindoor-sg* '()) - (update-transforms! (-> obj root-override)) - (set! (-> obj thresh w) 61440.0) - (if (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *maindoor-sg* '()) + (update-transforms! (-> this root-override)) + (set! (-> this thresh w) 61440.0) + (if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (and (and *target* - (>= (-> obj thresh w) (vector-vector-distance (-> obj root-override trans) (-> *target* control trans))) + (>= (-> this thresh w) (vector-vector-distance (-> this root-override trans) (-> *target* control trans))) ) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) @@ -1037,8 +1039,8 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod eco-door-method-24 sidedoor ((obj sidedoor)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod eco-door-method-24 sidedoor ((this sidedoor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1050,18 +1052,18 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 sidedoor ((obj sidedoor)) - (initialize-skeleton obj *sidedoor-sg* '()) - (set! (-> obj open-distance) 22528.0) - (set! (-> obj close-distance) 61440.0) - (set! (-> obj speed) 6.0) - (update-transforms! (-> obj root-override)) +(defmethod eco-door-method-25 sidedoor ((this sidedoor)) + (initialize-skeleton this *sidedoor-sg* '()) + (set! (-> this open-distance) 22528.0) + (set! (-> this close-distance) 61440.0) + (set! (-> this speed) 6.0) + (update-transforms! (-> this root-override)) 0 (none) ) @@ -1081,13 +1083,13 @@ ) -(defmethod relocate jngpusher ((obj jngpusher) (arg0 int)) - (if (nonzero? (-> obj back-prim)) - (&+! (-> obj back-prim) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method jngpusher 7)) this arg0) ) ) @@ -1117,9 +1119,9 @@ :post rider-post ) -(defmethod init-from-entity! jngpusher ((obj jngpusher) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! jngpusher ((this jngpusher) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1149,16 +1151,16 @@ (set! (-> s2-1 transform-index) 4) (set-vector! (-> s2-1 local-sphere) 36864.0 0.0 0.0 20480.0) (append-prim s3-0 s2-1) - (set! (-> obj back-prim) s2-1) + (set! (-> this back-prim) s2-1) ) ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *jngpusher-sg* '()) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *jngpusher-sg* '()) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) (go jngpusher-idle) (none) ) @@ -1185,13 +1187,13 @@ ) ) -(defmethod water-vol-method-22 jungle-water ((obj jungle-water)) +(defmethod water-vol-method-22 jungle-water ((this jungle-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) diff --git a/goal_src/jak1/levels/jungle/junglefish.gc b/goal_src/jak1/levels/jungle/junglefish.gc index 30aac41a49..69bcaa6475 100644 --- a/goal_src/jak1/levels/jungle/junglefish.gc +++ b/goal_src/jak1/levels/jungle/junglefish.gc @@ -23,9 +23,9 @@ 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) +(defmethod common-post junglefish ((this junglefish)) + (water-control-method-10 (-> this water)) + ((the-as (function nav-enemy none) (find-parent-method junglefish 39)) this) 0 (none) ) @@ -219,8 +219,8 @@ nav-enemy-default-event-handler ) ) -(defmethod init-from-entity! junglefish ((obj junglefish) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! junglefish ((this junglefish) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -236,16 +236,16 @@ nav-enemy-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *junglefish-sg* '()) - (init-defaults! obj *junglefish-nav-enemy-info*) - (set! (-> obj water) (new 'process 'water-control obj 7 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01)) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 5734.4) - (set! (-> obj collide-info trans y) (+ -4096.0 (-> obj water height))) - (go (method-of-object obj nav-enemy-idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *junglefish-sg* '()) + (init-defaults! this *junglefish-nav-enemy-info*) + (set! (-> this water) (new 'process 'water-control this 7 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 5734.4) + (set! (-> this collide-info trans y) (+ -4096.0 (-> this water height))) + (go (method-of-object this nav-enemy-idle)) (none) ) diff --git a/goal_src/jak1/levels/jungle/junglesnake.gc b/goal_src/jak1/levels/jungle/junglesnake.gc index 60552cd785..e6a9d0dbe9 100644 --- a/goal_src/jak1/levels/jungle/junglesnake.gc +++ b/goal_src/jak1/levels/jungle/junglesnake.gc @@ -147,20 +147,20 @@ junglesnake-default-event-handler -(defmethod junglesnake-method-20 junglesnake ((obj junglesnake)) - (when (and *target* (-> obj track-player-ry)) +(defmethod junglesnake-method-20 junglesnake ((this junglesnake)) + (when (and *target* (-> this track-player-ry)) (let ((v1-3 (target-pos 0))) - (set! (-> obj des-ry) - (atan (- (-> v1-3 x) (-> obj root-override trans x)) (- (-> v1-3 z) (-> obj root-override trans z))) + (set! (-> this des-ry) + (atan (- (-> v1-3 x) (-> this root-override trans x)) (- (-> v1-3 z) (-> this root-override trans z))) ) ) ) - (let ((f0-7 (deg-diff (-> obj ry) (-> obj des-ry)))) - (+! (-> obj ry) (seek-with-smooth 0.0 f0-7 (* 655360.0 (-> *display* seconds-per-frame)) 0.125 0.001)) + (let ((f0-7 (deg-diff (-> this ry) (-> this des-ry)))) + (+! (-> this ry) (seek-with-smooth 0.0 f0-7 (* 655360.0 (seconds-per-frame)) 0.125 0.001)) ) - (let ((f30-1 (-> obj ry))) + (let ((f30-1 (-> this ry))) (dotimes (s5-0 24) - (let ((s4-0 (-> obj twist-joints s5-0))) + (let ((s4-0 (-> this twist-joints s5-0))) (let ((f28-0 (-> s4-0 drag-delta-ry))) (cond ((= f28-0 0.0) @@ -178,7 +178,7 @@ junglesnake-default-event-handler ) ) (let ((f0-16 (deg-diff (-> s4-0 ry) f26-0))) - (+! (-> s4-0 ry) (seek-with-smooth 0.0 f0-16 (* 327680.0 (-> *display* seconds-per-frame)) 0.25 0.001)) + (+! (-> s4-0 ry) (seek-with-smooth 0.0 f0-16 (* 327680.0 (seconds-per-frame)) 0.25 0.001)) ) ) ) @@ -279,7 +279,7 @@ junglesnake-default-event-handler ) (let* ((f30-1 (-> s5-0 tilt)) (f0-21 (deg-diff f30-1 (-> s5-0 des-tilt))) - (f28-0 (+ f30-1 (seek-with-smooth 0.0 f0-21 (* 65536.0 (-> *display* seconds-per-frame)) 0.2 0.001))) + (f28-0 (+ f30-1 (seek-with-smooth 0.0 f0-21 (* 65536.0 (seconds-per-frame)) 0.2 0.001))) ) (set! (-> s5-0 tilt) f28-0) (let ((f30-2 (cos f28-0)) @@ -388,13 +388,13 @@ junglesnake-default-event-handler (defstate junglesnake-tracking (junglesnake) :event junglesnake-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self track-player-ry) #t) (set! (-> self track-player-tilt) #t) ) :trans (behavior () (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self refractory-delay)) + (time-elapsed? (-> self state-time) (-> self refractory-delay)) (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) @@ -482,7 +482,7 @@ junglesnake-default-event-handler (seek f30-0 (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)) 0.0 24576.0) - (* 2.0 (-> *display* seconds-per-frame)) + (* 2.0 (seconds-per-frame)) ) ) (ja :num! (seek! max 1.25)) @@ -515,7 +515,7 @@ junglesnake-default-event-handler (defstate junglesnake-give-up (junglesnake) :event junglesnake-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self track-player-ry) #f) (set! (-> self track-player-tilt) #f) (set! (-> self des-ry) (-> self ry)) @@ -570,10 +570,10 @@ junglesnake-default-event-handler :post ja-post ) -(defmethod junglesnake-method-23 junglesnake ((obj junglesnake)) - (when (not (-> obj is-lethal?)) - (set! (-> obj is-lethal?) #t) - (let ((v1-5 (-> (the-as collide-shape-prim-group (-> obj root-override root-prim)) prims 0))) +(defmethod junglesnake-method-23 junglesnake ((this junglesnake)) + (when (not (-> this is-lethal?)) + (set! (-> this is-lethal?) #t) + (let ((v1-5 (-> (the-as collide-shape-prim-group (-> this root-override root-prim)) prims 0))) (logclear! (-> v1-5 prim-core action) (collide-action solid)) ) ) @@ -581,13 +581,13 @@ junglesnake-default-event-handler (none) ) -(defmethod junglesnake-method-24 junglesnake ((obj junglesnake)) - (when (-> obj is-lethal?) - (set! (-> obj is-lethal?) #f) - (let ((v1-4 (-> (the-as collide-shape-prim-group (-> obj root-override root-prim)) prims 0))) +(defmethod junglesnake-method-24 junglesnake ((this junglesnake)) + (when (-> this is-lethal?) + (set! (-> this is-lethal?) #f) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root-override root-prim)) prims 0))) (logior! (-> v1-4 prim-core action) (collide-action solid)) ) - (do-push-aways! (-> obj root-override)) + (do-push-aways! (-> this root-override)) ) 0 (none) @@ -625,10 +625,10 @@ junglesnake-default-event-handler ) ) -(defmethod junglesnake-method-22 junglesnake ((obj junglesnake) (arg0 float)) +(defmethod junglesnake-method-22 junglesnake ((this junglesnake) (arg0 float)) (let ((f0-0 0.0)) (dotimes (v1-0 24) - (let ((a2-2 (-> obj twist-joints v1-0))) + (let ((a2-2 (-> this twist-joints v1-0))) (set! (-> a2-2 ry) arg0) (set! (-> a2-2 joint-index) (- 26 v1-0)) (let ((f1-1 (-> *junglesnake-twist-max-deltas* v1-0))) @@ -641,17 +641,17 @@ junglesnake-default-event-handler #f ) -(defmethod junglesnake-method-21 junglesnake ((obj junglesnake)) +(defmethod junglesnake-method-21 junglesnake ((this junglesnake)) (dotimes (v1-0 3) - (let ((a1-2 (-> obj tilt-joints v1-0))) + (let ((a1-2 (-> this tilt-joints v1-0))) (set! (-> a1-2 joint-index) (+ v1-0 23)) (set! (-> a1-2 flip-it) #f) ) ) - (let ((v1-3 (the-as object (&-> obj stack 524)))) + (let ((v1-3 (the-as object (&-> this stack 524)))) (set! (-> (the-as junglesnake-tilt-joint v1-3) flip-it) #t) ) - (let ((v1-4 (the-as object (&-> obj stack 476))) + (let ((v1-4 (the-as object (&-> this stack 476))) (v0-0 #t) ) (set! (-> (the-as junglesnake-twist-joint v1-4) ry) (the-as float v0-0)) @@ -659,9 +659,9 @@ junglesnake-default-event-handler ) ) -(defmethod init-from-entity! junglesnake ((obj junglesnake) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! junglesnake ((this junglesnake) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -752,25 +752,25 @@ junglesnake-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *junglesnake-sg* '()) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *junglesnake-sg* '()) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 173) obj)) - (set! (-> obj is-lethal?) #f) - (set! (-> obj ry) (y-angle (-> obj root-override))) - (set! (-> obj des-ry) (-> obj ry)) - (set! (-> obj tilt) 0.0) - (set! (-> obj des-tilt) (-> obj tilt)) - (set! (-> obj track-player-ry) #f) - (set! (-> obj track-player-tilt) #f) - (quaternion-identity! (-> obj root-override quat)) - (junglesnake-method-22 obj (-> obj ry)) - (junglesnake-method-21 obj) - (logior! (-> obj skel status) (janim-status inited)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 173) this)) + (set! (-> this is-lethal?) #f) + (set! (-> this ry) (y-angle (-> this root-override))) + (set! (-> this des-ry) (-> this ry)) + (set! (-> this tilt) 0.0) + (set! (-> this des-tilt) (-> this tilt)) + (set! (-> this track-player-ry) #f) + (set! (-> this track-player-tilt) #f) + (quaternion-identity! (-> this root-override quat)) + (junglesnake-method-22 this (-> this ry)) + (junglesnake-method-21 this) + (logior! (-> this skel status) (janim-status inited)) (go junglesnake-sleeping) (none) ) diff --git a/goal_src/jak1/levels/jungleb/aphid.gc b/goal_src/jak1/levels/jungleb/aphid.gc index 28cd0c7938..c5313ef72f 100644 --- a/goal_src/jak1/levels/jungleb/aphid.gc +++ b/goal_src/jak1/levels/jungleb/aphid.gc @@ -35,17 +35,17 @@ (none) ) -(defmethod attack-handler aphid ((obj aphid) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler aphid ((this aphid) (arg0 process) (arg1 event-message-block)) (cond - ((or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) - (= arg0 (ppointer->process (-> obj parent))) + ((or (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) + (= arg0 (ppointer->process (-> this parent))) ) (send-event arg0 'get-attack-count 1) - (logclear! (-> obj mask) (process-mask actor-pause attackable)) - (go (method-of-object obj nav-enemy-die)) + (logclear! (-> this mask) (process-mask actor-pause attackable)) + (go (method-of-object this nav-enemy-die)) ) (else - (touch-handler obj arg0 arg1) + (touch-handler this arg0 arg1) ) ) ) @@ -83,10 +83,10 @@ (ja :group! (-> self draw art-group data 5)) (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)) - (s5-1 (-> *display* base-frame-counter)) + (s5-1 (current-time)) (s4-1 (- (the int (nav-enemy-rnd-float-range 900.0 1440.0)) gp-0)) ) - (until (>= (- (-> *display* base-frame-counter) s5-1) s4-1) + (until (time-elapsed? s5-1 s4-1) (suspend) (ja :num! (loop! f30-0)) ) @@ -103,10 +103,10 @@ (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-1 (nav-enemy-rnd-float-range 0.9 1.1)) - (s5-3 (-> *display* base-frame-counter)) + (s5-3 (current-time)) (s4-3 (+ (the int (nav-enemy-rnd-float-range 660.0 900.0)) gp-0)) ) - (until (>= (- (-> *display* base-frame-counter) s5-3) s4-3) + (until (time-elapsed? s5-3 s4-3) (suspend) (ja :num! (loop! f30-1)) ) @@ -252,8 +252,8 @@ ) ) -(defmethod initialize-collision aphid ((obj aphid)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision aphid ((this aphid)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -270,18 +270,18 @@ (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod nav-enemy-method-48 aphid ((obj aphid)) - (initialize-skeleton obj *aphid-sg* '()) - (init-defaults! obj *aphid-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 aphid ((this aphid)) + (initialize-skeleton this *aphid-sg* '()) + (init-defaults! this *aphid-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) diff --git a/goal_src/jak1/levels/jungleb/jungleb-obs.gc b/goal_src/jak1/levels/jungleb/jungleb-obs.gc index 5bd7ca9ef9..0afb403ed2 100644 --- a/goal_src/jak1/levels/jungleb/jungleb-obs.gc +++ b/goal_src/jak1/levels/jungleb/jungleb-obs.gc @@ -233,16 +233,16 @@ (while (not (process-grab? *target*)) (suspend) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) (send-event *camera* 'blend-from-as-fixed) (camera-look-at (the-as pair "ecovent-171") (the-as uint 0)) (camera-change-to "camera-223" 0 #f) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 3)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 3)) (suspend) ) ) @@ -289,8 +289,8 @@ :post rider-post ) -(defmethod init-from-entity! eggtop ((obj eggtop) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! eggtop ((this eggtop) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -308,25 +308,25 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *eggtop-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 189) obj)) - (set! (-> obj sound-id) (new-sound-id)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *eggtop-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 189) this)) + (set! (-> this sound-id) (new-sound-id)) (cond - ((task-complete? *game-info* (-> obj entity extra perm task)) + ((task-complete? *game-info* (-> this entity extra perm task)) (go eggtop-close #t) ) (else (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> obj root-override trans) (new 'static 'vector :y 6144.0 :w 1.0)) + (vector+! (new 'stack-no-clear 'vector) (-> this root-override trans) (new 'static 'vector :y 6144.0 :w 1.0)) (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) + (the float (-> this entity extra perm task)) #f - obj + this (the-as fact-info #f) ) (go eggtop-idle) @@ -349,8 +349,8 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod eco-door-method-24 jng-iris-door ((obj jng-iris-door)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod eco-door-method-24 jng-iris-door ((this jng-iris-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -362,17 +362,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 jng-iris-door ((obj jng-iris-door)) - (initialize-skeleton obj *jng-iris-door-sg* '()) - (set! (-> obj open-distance) 32768.0) - (set! (-> obj close-distance) 49152.0) - (update-transforms! (-> obj root-override)) +(defmethod eco-door-method-25 jng-iris-door ((this jng-iris-door)) + (initialize-skeleton this *jng-iris-door-sg* '()) + (set! (-> this open-distance) 32768.0) + (set! (-> this close-distance) 49152.0) + (update-transforms! (-> this root-override)) 0 (none) ) diff --git a/goal_src/jak1/levels/jungleb/plant-boss.gc b/goal_src/jak1/levels/jungleb/plant-boss.gc index bbfe83a661..5958f1950c 100644 --- a/goal_src/jak1/levels/jungleb/plant-boss.gc +++ b/goal_src/jak1/levels/jungleb/plant-boss.gc @@ -52,24 +52,24 @@ ) -(defmethod relocate plant-boss ((obj plant-boss) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(defmethod relocate plant-boss ((this plant-boss) (arg0 int)) + (if (nonzero? (-> this neck)) + (&+! (-> this neck) arg0) ) - (if (nonzero? (-> obj body)) - (&+! (-> obj body) arg0) + (if (nonzero? (-> this body)) + (&+! (-> this body) arg0) ) (dotimes (v1-8 3) - (if (nonzero? (-> obj attack-prim v1-8)) - (&+! (-> obj attack-prim v1-8) arg0) + (if (nonzero? (-> this attack-prim v1-8)) + (&+! (-> this attack-prim v1-8) arg0) ) - (if (nonzero? (-> obj death-prim v1-8)) - (&+! (-> obj death-prim v1-8) arg0) + (if (nonzero? (-> this death-prim v1-8)) + (&+! (-> this 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) + ((the-as (function process-drawable int process-drawable) (find-parent-method plant-boss 7)) this arg0) ) ) @@ -484,9 +484,9 @@ :code (behavior ((arg0 symbol)) (when (not arg0) (let ((f30-0 (rand-vu-float-range (the-as float 0.0) (the-as float 1.0))) - (gp-0 (-> *display* base-frame-counter)) + (gp-0 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) gp-0) (the int (* 300.0 f30-0))) + (until (time-elapsed? gp-0 (the int (* 300.0 f30-0))) (ja :num! (loop!)) (suspend) ) @@ -528,9 +528,9 @@ (defstate plant-boss-root-die (plant-boss-arm) :code (behavior ((arg0 symbol)) (when (not arg0) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4)) - (+! (-> self root-override trans z) (* -4096.0 (-> *display* seconds-per-frame))) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 4)) + (+! (-> self root-override trans z) (* -4096.0 (seconds-per-frame))) (suspend) ) ) @@ -751,7 +751,7 @@ (case message (('kill) (set! (-> self state-object) #t) - (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> block param 0)))))) + (let ((v0-0 (the-as object (+ (current-time) (the-as time-frame (-> block param 0)))))) (set! (-> self state-time-frame) (the-as time-frame v0-0)) v0-0 ) @@ -786,7 +786,7 @@ (until v1-19 (suspend) (ja :num! (loop!)) - (set! v1-19 (and (-> self state-object) (< (-> self state-time-frame) (-> *display* base-frame-counter)))) + (set! v1-19 (and (-> self state-object) (< (-> self state-time-frame) (current-time)))) ) (go plant-boss-leaf-close) ) @@ -798,7 +798,7 @@ (case message (('kill) (set! (-> self state-object) #t) - (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> block param 0)))))) + (let ((v0-0 (the-as object (+ (current-time) (the-as time-frame (-> block param 0)))))) (set! (-> self state-time-frame) (the-as time-frame v0-0)) v0-0 ) @@ -935,7 +935,7 @@ (loop (ja-no-eval :group! plant-boss-main-initial-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (seek! (-> self energy) (the-as float 0.25) (-> *display* seconds-per-frame)) + (seek! (-> self energy) (the-as float 0.25) (seconds-per-frame)) (if (and (and *target* (>= 245760.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -963,7 +963,7 @@ (ja :group! plant-boss-main-intro-ja :num! (identity (ja-aframe (the-as float 510.0) 0))) (b! #t cfg-3 :delay (nop!)) (label cfg-2) - (seek! (-> self energy) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self energy) (the-as float 1.0) (* 2.0 (seconds-per-frame))) (suspend) (label cfg-3) (let ((v1-22 (-> self skel channel))) @@ -991,8 +991,8 @@ (suspend) ) (camera-change-to "camera-222" 600 #f) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 2)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) (suspend) ) ) @@ -1022,7 +1022,7 @@ (ja-channel-push! 1 (seconds 0.5)) (ja-no-eval :group! plant-boss-main-intro-ja :num! (seek! (ja-aframe (the-as float 510.0) 0)) :frame-num 0.0) (until (ja-done? 0) - (seek! (-> self energy) (the-as float 1.0) (* 0.2 (-> *display* seconds-per-frame))) + (seek! (-> self energy) (the-as float 1.0) (* 0.2 (seconds-per-frame))) (ja-blend-eval) (suspend) (ja :num! (seek! (ja-aframe (the-as float 510.0) 0))) @@ -1044,7 +1044,7 @@ :event plant-boss-default-event-handler :enter (behavior () (set-setting! 'music 'danger 0.0 0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self body flex-blend) 0.0) (set! (-> self neck flex-blend) 1.0) ) @@ -1054,21 +1054,21 @@ (go plant-boss-far-idle) ) (if (and (< f30-0 143360.0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (cond - ((>= (-> self try) 15) - 1500 - ) - ((>= (-> self try) 10) - 1200 - ) - ((>= (-> self try) 5) - 900 - ) - (else - 600 - ) - ) - ) + (time-elapsed? (-> self state-time) (cond + ((>= (-> self try) 15) + 1500 + ) + ((>= (-> self try) 10) + 1200 + ) + ((>= (-> self try) 5) + 900 + ) + (else + 600 + ) + ) + ) *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -1153,7 +1153,7 @@ ) (set! (-> self try-inc) #t) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (+! (-> self cycle-count) 1) (set! (-> self snap-count) 0) (set! (-> self body flex-blend) 0.0) @@ -1196,11 +1196,11 @@ ) ) ) - ((>= (- (-> *display* base-frame-counter) (-> self aphid-spawn-time)) (seconds 1.4)) + ((time-elapsed? (-> self aphid-spawn-time) (seconds 1.4)) (when (process-spawn aphid self (-> self root-override trans) (target-pos 0) :to self) (+! (-> self aphid-count) 1) (seekl! (-> self want-aphid-count) 0 1) - (set! (-> self aphid-spawn-time) (-> *display* base-frame-counter)) + (set-time! (-> self aphid-spawn-time)) ) ) ) @@ -1233,7 +1233,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self body flex-blend) 0.0) (set! (-> self neck flex-blend) 0.0) (set! (-> self attack-prim 0 local-sphere w) 12288.0) @@ -1292,7 +1292,7 @@ ) ) ) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-5) + (while (not (time-elapsed? (-> self state-time) gp-5)) (ja-no-eval :group! plant-boss-main-vulnerable-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1356,8 +1356,8 @@ ) ) (until (or v1-64 (ja-done? 0)) - (seek! (-> self body flex-blend) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) - (seek! (-> self neck flex-blend) (the-as float 0.0) (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self body flex-blend) (the-as float 1.0) (* 2.0 (seconds-per-frame))) + (seek! (-> self neck flex-blend) (the-as float 0.0) (* 2.0 (seconds-per-frame))) (set! f30-0 (seek f30-0 (lerp-scale @@ -1367,7 +1367,7 @@ (the-as float 26624.0) (the-as float 86016.0) ) - (* 2.0 (-> *display* seconds-per-frame)) + (* 2.0 (seconds-per-frame)) ) ) (set! (-> self interp) f30-0) @@ -1412,7 +1412,7 @@ ) (until (>= (ja-aframe-num 0) 285.0) (try-preload-stream *art-control* "$GAMCAM29" 0 self (the-as float -99.0)) - (seek! (-> self energy) (the-as float 0.5) (* 0.2 (-> *display* seconds-per-frame))) + (seek! (-> self energy) (the-as float 0.5) (* 0.2 (seconds-per-frame))) (when (and (>= (ja-aframe-num 0) 175.0) (zero? gp-0)) (set! gp-0 1) (set! (-> self camera) (ppointer->handle (process-spawn othercam self 28 #f #t :to self))) @@ -1423,8 +1423,8 @@ (set! gp-0 2) (send-event (handle->process (-> self camera)) 'joint "camera2") ) - (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) - (seek! (-> self interp) (the-as float 0.0) (-> *display* seconds-per-frame)) + (seek! (-> self body flex-blend) (the-as float 0.0) (seconds-per-frame)) + (seek! (-> self interp) (the-as float 0.0) (seconds-per-frame)) (ja :num! (seek! max 0.66)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self interp)) (suspend) @@ -1460,9 +1460,9 @@ (ja-no-eval :group! plant-boss-main-reset-ja :num! (seek! (ja-aframe (the-as float 210.0) 0)) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) - (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) + (seek! (-> self body flex-blend) (the-as float 0.0) (seconds-per-frame)) (if (>= 1 arg0) - (seek! (-> self neck flex-blend) (the-as float 1.0) (-> *display* seconds-per-frame)) + (seek! (-> self neck flex-blend) (the-as float 1.0) (seconds-per-frame)) ) (suspend) (ja :num! (seek! (ja-aframe (the-as float 210.0) 0))) @@ -1475,8 +1475,8 @@ :frame-num (ja-aframe (the-as float 210.0) 0) ) (until (ja-done? 0) - (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) - (seek! (-> self neck flex-blend) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self body flex-blend) (the-as float 0.0) (seconds-per-frame)) + (seek! (-> self neck flex-blend) (the-as float 1.0) (* 2.0 (seconds-per-frame))) (suspend) (ja :num! (seek! (ja-aframe (the-as float 240.0) 0))) ) @@ -1667,8 +1667,8 @@ :code (behavior () (ja-channel-set! 1) (ja :group! plant-boss-main-die-ja :num! max) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 5)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 5)) (transform-post) (do-push-aways! (-> self root-override)) (suspend) @@ -1712,9 +1712,9 @@ :post rider-post ) -(defmethod init-from-entity! plant-boss ((obj plant-boss) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! plant-boss ((this plant-boss) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1745,7 +1745,7 @@ (set! (-> s2-2 transform-index) 13) (set-vector! (-> s2-2 local-sphere) 0.0 8192.0 0.0 16384.0) (append-prim s3-0 s2-2) - (set! (-> obj attack-prim 0) s2-2) + (set! (-> this attack-prim 0) s2-2) ) (let ((s2-3 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s2-3 prim-core collide-as) (collide-kind)) @@ -1754,7 +1754,7 @@ (set! (-> s2-3 transform-index) 13) (set-vector! (-> s2-3 local-sphere) 0.0 8192.0 0.0 16384.0) (append-prim s3-0 s2-3) - (set! (-> obj death-prim 0) s2-3) + (set! (-> this death-prim 0) s2-3) ) (let ((s2-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) (set! (-> s2-4 prim-core collide-as) (collide-kind)) @@ -1763,147 +1763,163 @@ (set! (-> s2-4 transform-index) 12) (set-vector! (-> s2-4 local-sphere) 0.0 -24576.0 0.0 40960.0) (append-prim s3-0 s2-4) - (set! (-> obj death-prim 1) s2-4) + (set! (-> this death-prim 1) s2-4) ) ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *plant-boss-sg* '()) - (set! (-> obj draw shadow-ctrl) *plant-boss-shadow-control*) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *plant-boss-sg* '()) + (set! (-> this draw shadow-ctrl) *plant-boss-shadow-control*) (process-spawn plant-boss-arm :init plant-boss-arm-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0)) + (vector+! + (new-stack-vector0) + (-> this root-override trans) + (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0) + ) -8192.0 1 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-arm-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) 8192.0 0 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-back-arms-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :w 1.0)) 0.0 2 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) (new 'static 'vector :y 14563.556) 1.0 3 - :to obj - ) - (process-spawn - plant-boss-arm - :init plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0)) - (new 'static 'vector :y -5461.3335) - 1.0 - 3 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-vine-init (vector+! (new-stack-vector0) - (-> obj root-override trans) + (-> this root-override trans) + (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0) + ) + (new 'static 'vector :y -5461.3335) + 1.0 + 3 + :to this + ) + (process-spawn + plant-boss-arm + :init plant-boss-vine-init + (vector+! + (new-stack-vector0) + (-> this root-override trans) (new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0) ) (new 'static 'vector :x -1820.4445 :y -11286.756) 0.8 3 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0)) + (vector+! + (new-stack-vector0) + (-> this root-override trans) + (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0) + ) (new 'static 'vector :x -910.2222 :y 22755.555) 0.8 3 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) (new 'static 'vector :y -4096.0) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) 4 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0)) + (vector+! + (new-stack-vector0) + (-> this root-override trans) + (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0) + ) (new 'static 'vector :x 364.0889 :y 4096.0) (new 'static 'vector :x 1.0 :y 1.25 :z 1.0) 4 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :z -2048.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :z -2048.0 :w 1.0)) (new 'static 'vector :x 1820.4445) (new 'static 'vector :x 0.9 :y 1.5 :z 1.0) 4 - :to obj + :to this ) - (set! (-> obj leaf 0) + (set! (-> this leaf 0) (process-spawn plant-boss-leaf :init plant-boss-leaf-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :w 1.0)) 0.0 0 - :to obj + :to this ) ) - (set! (-> obj leaf 1) (process-spawn - plant-boss-leaf - :init plant-boss-leaf-init - (vector+! - (new-stack-vector0) - (-> obj root-override trans) - (new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0) - ) - 0.0 - 1 - :to obj - ) + (set! (-> this leaf 1) (process-spawn + plant-boss-leaf + :init plant-boss-leaf-init + (vector+! + (new-stack-vector0) + (-> this root-override trans) + (new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0) + ) + 0.0 + 1 + :to this + ) ) - (set! (-> obj energy) 0.25) - (set! (-> obj health) 3.0) - (set! (-> obj cam-tracker) (the-as handle #f)) - (set! (-> obj camera) (the-as handle #f)) - (set! (-> obj money) (the-as handle #f)) - (set! (-> obj try-inc) #f) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 13)) - (set-vector! (-> obj neck twist-max) 3640.889 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) - (set! (-> obj body) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 4)) - (set-vector! (-> obj body twist-max) 0.0 8192.0 0.0 1.0) - (set! (-> obj body up) (the-as uint 1)) - (set! (-> obj body nose) (the-as uint 0)) - (set! (-> obj body ear) (the-as uint 2)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this energy) 0.25) + (set! (-> this health) 3.0) + (set! (-> this cam-tracker) (the-as handle #f)) + (set! (-> this camera) (the-as handle #f)) + (set! (-> this money) (the-as handle #f)) + (set! (-> this try-inc) #f) + (set! (-> this neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) this 13)) + (set-vector! (-> this neck twist-max) 3640.889 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) + (set! (-> this body) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) this 4)) + (set-vector! (-> this body twist-max) 0.0 8192.0 0.0 1.0) + (set! (-> this body up) (the-as uint 1)) + (set! (-> this body nose) (the-as uint 0)) + (set! (-> this body ear) (the-as uint 2)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go plant-boss-dead #t) ) (go plant-boss-far-idle) diff --git a/goal_src/jak1/levels/jungleb/plat-flip.gc b/goal_src/jak1/levels/jungleb/plat-flip.gc index b0ceb805a3..79a018b46e 100644 --- a/goal_src/jak1/levels/jungleb/plat-flip.gc +++ b/goal_src/jak1/levels/jungleb/plat-flip.gc @@ -101,10 +101,10 @@ :post rider-post ) -(defmethod init-from-entity! plat-flip ((obj plat-flip) (arg0 entity-actor)) +(defmethod init-from-entity! plat-flip ((this plat-flip) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -122,42 +122,45 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj base-pos quad) (-> obj root-override trans quad)) - (initialize-skeleton obj *plat-flip-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (set! (-> this base-pos quad) (-> this root-override trans quad)) + (initialize-skeleton this *plat-flip-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (let ((f30-0 300.0)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-28 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-16)))) - (set! (-> obj before-turn-down-time) (* f30-0 (if (and v1-28 (> (the-as int (-> sv-16 elt-count)) 0)) - (-> (the-as (pointer float) v1-28)) - 2.0 - ) - ) + (set! (-> this before-turn-down-time) (* f30-0 (if (and v1-28 (> (the-as int (-> sv-16 elt-count)) 0)) + (-> (the-as (pointer float) v1-28)) + 2.0 + ) + ) ) ) ) (let ((f30-1 300.0)) (set! sv-32 (new 'static 'res-tag)) (let ((v1-31 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-32)))) - (set! (-> obj before-turn-up-time) (* f30-1 (if (and v1-31 (< 1 (the-as int (-> sv-32 elt-count)))) - (-> (the-as (pointer float) v1-31) 1) - 0.2 - ) - ) + (set! (-> this before-turn-up-time) (* f30-1 (if (and v1-31 (< 1 (the-as int (-> sv-32 elt-count)))) + (-> (the-as (pointer float) v1-31) 1) + 0.2 + ) + ) ) ) ) - (set! (-> obj turn-down-time) 300.0) - (set! (-> obj turn-up-time) 300.0) - (set! (-> obj total-time) - (+ (-> obj before-turn-down-time) (-> obj turn-down-time) (-> obj before-turn-up-time) (-> obj turn-up-time)) + (set! (-> this turn-down-time) 300.0) + (set! (-> this turn-up-time) 300.0) + (set! (-> this total-time) (+ (-> this before-turn-down-time) + (-> this turn-down-time) + (-> this before-turn-up-time) + (-> this turn-up-time) + ) ) - (let ((s4-1 (-> obj sync)) + (let ((s4-1 (-> this sync)) (s3-1 (method-of-type sync-info setup-params!)) - (s2-0 (the int (-> obj total-time))) + (s2-0 (the int (-> this total-time))) ) (set! sv-48 (new 'static 'res-tag)) (let ((v1-35 (res-lump-data arg0 'sync-percent pointer :tag-ptr (& sv-48)))) @@ -173,7 +176,7 @@ ) ) ) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (go plat-flip-idle) (none) ) diff --git a/goal_src/jak1/levels/lavatube/assistant-lavatube.gc b/goal_src/jak1/levels/lavatube/assistant-lavatube.gc index e93730b34c..c485ffc2e2 100644 --- a/goal_src/jak1/levels/lavatube/assistant-lavatube.gc +++ b/goal_src/jak1/levels/lavatube/assistant-lavatube.gc @@ -22,11 +22,11 @@ :shadow assistant-lavatube-start-shadow-mg ) -(defmethod play-anim! assistant-lavatube-start ((obj assistant-lavatube-start) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! assistant-lavatube-start ((this assistant-lavatube-start) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (if arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "assistant-lavatube-start-resolution" @@ -40,17 +40,17 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) -(defmethod get-art-elem assistant-lavatube-start ((obj assistant-lavatube-start)) - (-> obj draw art-group data 3) +(defmethod get-art-elem assistant-lavatube-start ((this assistant-lavatube-start)) + (-> this draw art-group data 3) ) (defstate hidden (assistant-lavatube-start) @@ -62,7 +62,7 @@ #t ) (else - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) ) @@ -70,7 +70,7 @@ (not (movie?)) (not (level-hint-displayed?)) (not (and *cheat-mode* (cpad-hold? 0 l3))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) + (not (time-elapsed? (-> self state-time) (seconds 10))) ) ) (hide-hud) @@ -138,15 +138,15 @@ ) ) -(defmethod should-display? assistant-lavatube-start ((obj assistant-lavatube-start)) - (first-any (-> obj tasks) #t) - (= (current-status (-> obj tasks)) (task-status need-reward-speech)) +(defmethod should-display? assistant-lavatube-start ((this assistant-lavatube-start)) + (first-any (-> this tasks) #t) + (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) -(defmethod init-from-entity! assistant-lavatube-start ((obj assistant-lavatube-start) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-lavatube-start-sg* 3 29 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task lavatube-start))) - (first-any (-> obj tasks) #t) - (process-taskable-method-42 obj) +(defmethod init-from-entity! assistant-lavatube-start ((this assistant-lavatube-start) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-lavatube-start-sg* 3 29 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task lavatube-start))) + (first-any (-> this tasks) #t) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/lavatube/lavatube-energy.gc b/goal_src/jak1/levels/lavatube/lavatube-energy.gc index b2a2103fb5..3a0678092c 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-energy.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-energy.gc @@ -529,9 +529,9 @@ ) ) -(defmethod init-from-entity! energydoor ((obj energydoor) (arg0 entity-actor)) +(defmethod init-from-entity! energydoor ((this energydoor) (arg0 entity-actor)) (with-pp - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -548,17 +548,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *energydoor-sg* '()) - (set! (-> obj root-override pause-adjust-distance) 245760.0) - (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *energydoor-sg* '()) + (set! (-> this root-override pause-adjust-distance) 245760.0) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) (cond ((< (energydoor-player-dist) -409600.0) (go energydoor-closed-till-near) ) - ((task-closed? (-> obj entity extra perm task) (task-status need-resolution)) + ((task-closed? (-> this entity extra perm task) (task-status need-resolution)) (go energydoor-opened) ) (else @@ -567,7 +567,7 @@ (set! (-> a1-9 num-params) 0) (set! (-> a1-9 message) 'open?) (let ((t9-12 send-event-function) - (v1-25 (-> obj alt-actor)) + (v1-25 (-> this alt-actor)) ) (cond ((t9-12 @@ -663,10 +663,10 @@ :post ja-post ) -(defmethod init-from-entity! energybase ((obj energybase) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *energybase-sg* '()) +(defmethod init-from-entity! energybase ((this energybase) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *energybase-sg* '()) (if (task-closed? (game-task lavatube-balls) (task-status need-resolution)) (go energybase-stopped) (go energybase-idle) @@ -782,7 +782,7 @@ ) (s4-0 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'matrix)) - (f0-1 (the float (-> *display* base-frame-counter))) + (f0-1 (the float (current-time))) (f30-0 (- f0-1 (* (the float (the int (/ f0-1 -150.0))) -150.0))) ) (when gp-0 @@ -1114,11 +1114,10 @@ ) (defbehavior energyhub-trans energyhub () - (+! (-> self y-rotation) - (* 36.40889 - (-> self rotation-speed value) - (the float (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) - ) + (+! (-> self y-rotation) (* 36.40889 + (-> self rotation-speed value) + (the float (- (current-time) (-> *display* old-base-frame-counter))) + ) ) (cond ((< 65536.0 (-> self y-rotation)) @@ -1129,7 +1128,7 @@ ) ) (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((f0-9 (the float (-> *display* base-frame-counter))) + (let* ((f0-9 (the float (current-time))) (f28-0 (- f0-9 (* (the float (the int (/ f0-9 1200.0))) 1200.0))) ) (matrix-rotate-y! gp-0 (-> self y-rotation)) @@ -1346,17 +1345,17 @@ :post ja-post ) -(defmethod init-from-entity! energyhub ((obj energyhub) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *energyhub-sg* '()) - (set! (-> obj sound) (new 'process 'ambient-sound arg0 (-> obj root trans))) - (let ((s5-1 (entity-actor-count (-> obj entity) 'alt-actor))) +(defmethod init-from-entity! energyhub ((this energyhub) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *energyhub-sg* '()) + (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root trans))) + (let ((s5-1 (entity-actor-count (-> this entity) 'alt-actor))) (dotimes (s4-0 (min 3 s5-1)) - (set! (-> obj alts s4-0) (entity-actor-lookup (-> obj entity) 'alt-actor s4-0)) + (set! (-> this alts s4-0) (entity-actor-lookup (-> this entity) 'alt-actor s4-0)) ) ) - (quaternion->matrix (-> obj rot-mat-init) (-> obj root quat)) + (quaternion->matrix (-> this rot-mat-init) (-> this root quat)) (let ((f30-0 13107.2) (s5-2 (new 'stack-no-clear 'vector)) (s4-1 (new 'stack-no-clear 'matrix)) @@ -1364,22 +1363,24 @@ (set-vector! s5-2 0.0 2457.6 -24576.0 1.0) (matrix-rotate-y! s4-1 f30-0) (dotimes (s3-0 5) - (set! (-> obj arm s3-0) (ppointer->handle (process-spawn energyarm s5-2 (* (the float s3-0) f30-0) :to obj))) + (set! (-> this arm s3-0) + (ppointer->handle (process-spawn energyarm s5-2 (* (the float s3-0) f30-0) :to this)) + ) (vector-matrix*! s5-2 s5-2 s4-1) ) ) - (set! (-> obj root pause-adjust-distance) 245760.0) - (set! (-> obj y-rotation) 0.0) - (set! (-> obj x-rotation) 0.0) - (set-params! (-> obj rotation-speed-offset) 300 600 0.25) - (set! (-> obj palette-val) 0.0) + (set! (-> this root pause-adjust-distance) 245760.0) + (set! (-> this y-rotation) 0.0) + (set! (-> this x-rotation) 0.0) + (set-params! (-> this rotation-speed-offset) 300 600 0.25) + (set! (-> this palette-val) 0.0) (cond ((task-closed? (game-task lavatube-balls) (task-status need-resolution)) - (set-params! (-> obj rotation-speed) 0.0 0.01 0.1 0.9) + (set-params! (-> this rotation-speed) 0.0 0.01 0.1 0.9) (go energyhub-stopped) ) (else - (set-params! (-> obj rotation-speed) 1.0 0.01 0.1 0.9) + (set-params! (-> this rotation-speed) 1.0 0.01 0.1 0.9) (go energyhub-idle) ) ) @@ -1414,10 +1415,10 @@ :post ja-post ) -(defmethod init-from-entity! energylava ((obj energylava) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *energylava-sg* '()) +(defmethod init-from-entity! energylava ((this energylava) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *energylava-sg* '()) (go energylava-idle) (none) ) diff --git a/goal_src/jak1/levels/lavatube/lavatube-obs.gc b/goal_src/jak1/levels/lavatube/lavatube-obs.gc index 64d6521205..831efc2445 100644 --- a/goal_src/jak1/levels/lavatube/lavatube-obs.gc +++ b/goal_src/jak1/levels/lavatube/lavatube-obs.gc @@ -38,10 +38,10 @@ :post ja-post ) -(defmethod init-from-entity! lavabase ((obj lavabase) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavabase-sg* '()) +(defmethod init-from-entity! lavabase ((this lavabase) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavabase-sg* '()) (go lavabase-idle) (none) ) @@ -77,10 +77,10 @@ :post ja-post ) -(defmethod init-from-entity! lavafall ((obj lavafall) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavafall-sg* '()) +(defmethod init-from-entity! lavafall ((this lavafall) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavafall-sg* '()) (go lavafall-idle) (none) ) @@ -116,10 +116,10 @@ :post ja-post ) -(defmethod init-from-entity! lavashortcut ((obj lavashortcut) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavashortcut-sg* '()) +(defmethod init-from-entity! lavashortcut ((this lavashortcut) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavashortcut-sg* '()) (go lavashortcut-idle) (none) ) @@ -399,13 +399,13 @@ ) -(defmethod relocate darkecobarrel ((obj darkecobarrel) (arg0 int)) - (if (nonzero? (-> obj spawn-array)) - (&+! (-> obj spawn-array) arg0) +(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)) obj arg0) + ((the-as (function darkecobarrel-base int darkecobarrel-base) (find-parent-method darkecobarrel 7)) this arg0) ) ) @@ -416,7 +416,7 @@ ) (defbehavior darkecobarrel-base-time darkecobarrel-base () - (+ (-> *display* base-frame-counter) (-> self sync)) + (+ (current-time) (-> self sync)) ) (defbehavior darkecobarrel-base-pos darkecobarrel-base ((arg0 time-frame)) @@ -504,8 +504,8 @@ ) ) (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (cleanup-for-death self) @@ -703,62 +703,62 @@ ) ) -(defmethod init-from-entity! darkecobarrel ((obj darkecobarrel) (arg0 entity-actor)) +(defmethod init-from-entity! darkecobarrel ((this darkecobarrel) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj root-override) (the-as collide-shape-moving (new 'process 'trsqv))) + (set! (-> this root-override) (the-as collide-shape-moving (new 'process 'trsqv))) (darkecobarrel-base-init arg0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> obj root-override trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> this root-override trans)) ) - (logior! (-> obj draw status) (draw-status hidden)) - (set! (-> obj speed) (/ 300.0 (res-lump-float (-> obj entity) 'speed :default 61440.0))) + (logior! (-> this draw status) (draw-status hidden)) + (set! (-> this speed) (/ 300.0 (res-lump-float (-> this entity) 'speed :default 61440.0))) (set! sv-16 (new 'static 'res-tag)) (let ((s5-1 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-16)))) (cond (s5-1 - (set! (-> obj spawn-array) (new 'process 'boxed-array time-frame (the-as int (-> sv-16 elt-count)))) + (set! (-> this spawn-array) (new 'process 'boxed-array time-frame (the-as int (-> sv-16 elt-count)))) (dotimes (v1-12 (the-as int (-> sv-16 elt-count))) - (set! (-> obj spawn-array v1-12) - (the int (* (fabs (-> obj speed)) (-> (the-as (pointer float) (&+ s5-1 (* v1-12 4)))))) + (set! (-> this spawn-array v1-12) + (the int (* (fabs (-> this speed)) (-> (the-as (pointer float) (&+ s5-1 (* v1-12 4)))))) ) ) ) (else - (set! (-> obj spawn-array) (new 'process 'boxed-array time-frame 4)) - (set! (-> obj spawn-array 0) (the int (* 45056.0 (fabs (-> obj speed))))) - (set! (-> obj spawn-array 1) (the int (* 90112.0 (fabs (-> obj speed))))) - (set! (-> obj spawn-array 2) (the int (* 45056.0 (fabs (-> obj speed))))) - (set! (-> obj spawn-array 3) (the int (* 135168.0 (fabs (-> obj speed))))) + (set! (-> this spawn-array) (new 'process 'boxed-array time-frame 4)) + (set! (-> this spawn-array 0) (the int (* 45056.0 (fabs (-> this speed))))) + (set! (-> this spawn-array 1) (the int (* 90112.0 (fabs (-> this speed))))) + (set! (-> this spawn-array 2) (the int (* 45056.0 (fabs (-> this speed))))) + (set! (-> this spawn-array 3) (the int (* 135168.0 (fabs (-> this speed))))) ) ) ) - (dotimes (v1-19 (+ (-> obj spawn-array length) -1)) - (+! (-> obj spawn-array (+ v1-19 1)) (-> obj spawn-array v1-19)) + (dotimes (v1-19 (+ (-> this spawn-array length) -1)) + (+! (-> this spawn-array (+ v1-19 1)) (-> this spawn-array v1-19)) ) - (set! (-> obj sync) - (the-as time-frame (the int (* (fabs (-> obj speed)) (res-lump-float (-> obj entity) 'sync)))) + (set! (-> this sync) + (the-as time-frame (the int (* (fabs (-> this speed)) (res-lump-float (-> this entity) 'sync)))) ) - (set! (-> obj speed) (/ 1.0 (* (-> obj speed) (path-distance (-> obj path))))) + (set! (-> this speed) (/ 1.0 (* (-> this speed) (path-distance (-> this path))))) (let ((s5-3 (mod (darkecobarrel-base-time) (darkecobarrel-cycle-time)))) - (set! (-> obj cur-spawn) 0) - (while (>= s5-3 (-> obj spawn-array (-> obj cur-spawn))) + (set! (-> this cur-spawn) 0) + (while (>= s5-3 (-> this spawn-array (-> this cur-spawn))) (darkecobarrel-advance-curspawn) ) - (+! (-> obj cur-spawn) -1) - (when (< (-> obj cur-spawn) 0) - (set! (-> obj cur-spawn) (+ (-> obj spawn-array length) -1)) - (+! s5-3 (-> obj spawn-array (-> obj cur-spawn))) + (+! (-> this cur-spawn) -1) + (when (< (-> this cur-spawn) 0) + (set! (-> this cur-spawn) (+ (-> this spawn-array length) -1)) + (+! s5-3 (-> this spawn-array (-> this cur-spawn))) ) - (let ((s4-0 (-> obj cur-spawn)) - (s5-4 (- (darkecobarrel-base-time) (the-as time-frame (- s5-3 (-> obj spawn-array (-> obj cur-spawn)))))) + (let ((s4-0 (-> this cur-spawn)) + (s5-4 (- (darkecobarrel-base-time) (the-as time-frame (- s5-3 (-> this spawn-array (-> this cur-spawn)))))) ) (until (darkecobarrel-base-done? (darkecobarrel-base-pos s5-4)) - (process-spawn darkecobarrel-mover (-> obj entity) (-> obj speed) s5-4 (-> obj sync) :to obj) - (set! s5-4 (- s5-4 (the-as time-frame (-> obj spawn-array s4-0)))) + (process-spawn darkecobarrel-mover (-> this entity) (-> this speed) s5-4 (-> this sync) :to this) + (set! s5-4 (- s5-4 (the-as time-frame (-> this spawn-array s4-0)))) (+! s4-0 -1) (if (< s4-0 0) - (set! s4-0 (+ (-> obj spawn-array length) -1)) - (+! s5-4 (-> obj spawn-array s4-0)) + (set! s4-0 (+ (-> this spawn-array length) -1)) + (+! s5-4 (-> this spawn-array s4-0)) ) ) ) @@ -798,10 +798,10 @@ :post ja-post ) -(defmethod init-from-entity! lavafallsewera ((obj lavafallsewera) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavafallsewera-sg* '()) +(defmethod init-from-entity! lavafallsewera ((this lavafallsewera) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavafallsewera-sg* '()) (go lavafallsewera-idle) (none) ) @@ -836,10 +836,10 @@ :post ja-post ) -(defmethod init-from-entity! lavafallsewerb ((obj lavafallsewerb) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavafallsewerb-sg* '()) +(defmethod init-from-entity! lavafallsewerb ((this lavafallsewerb) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavafallsewerb-sg* '()) (go lavafallsewerb-idle) (none) ) @@ -1015,8 +1015,8 @@ ) ) (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (cleanup-for-death self) @@ -1049,9 +1049,9 @@ :post ja-post ) -(defmethod init-from-entity! chainmine ((obj chainmine) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask attackable)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! chainmine ((this chainmine) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask attackable)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1068,14 +1068,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *chainmine-sg* '()) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> obj root-override trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *chainmine-sg* '()) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> this root-override trans)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1202,7 +1202,7 @@ ) :trans (behavior () (when (not (logtest? (-> self path flags) (path-control-flag not-found))) - (let ((f0-4 (* 0.5 (+ 1.0 (sin (* (-> self move-per-tick) (the float (-> *display* base-frame-counter)))))))) + (let ((f0-4 (* 0.5 (+ 1.0 (sin (* (-> self move-per-tick) (the float (current-time)))))))) (eval-path-curve! (-> self path) (-> self root-override trans) f0-4 'interp) ) ) @@ -1219,8 +1219,8 @@ :post transform-post ) -(defmethod init-from-entity! lavaballoon ((obj lavaballoon) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! lavaballoon ((this lavaballoon) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1230,20 +1230,20 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavaballoon-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 543) obj)) - (set! (-> obj root-override pause-adjust-distance) 122880.0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (when (not (logtest? (-> obj path flags) (path-control-flag not-found))) - (let ((f30-0 (res-lump-float (-> obj entity) 'speed :default 12288.0))) - (set! (-> obj move-per-tick) (* 32768.0 (/ 1.0 (* 300.0 (path-distance (-> obj path)))) f30-0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavaballoon-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 543) this)) + (set! (-> this root-override pause-adjust-distance) 122880.0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (when (not (logtest? (-> this path flags) (path-control-flag not-found))) + (let ((f30-0 (res-lump-float (-> this entity) 'speed :default 12288.0))) + (set! (-> this move-per-tick) (* 32768.0 (/ 1.0 (* 300.0 (path-distance (-> this path)))) f30-0)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1280,18 +1280,18 @@ ) ) -(defmethod water-vol-method-22 lavatube-lava ((obj lavatube-lava)) +(defmethod water-vol-method-22 lavatube-lava ((this lavatube-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) + (set! (-> this draw ripple) v1-2) (set! (-> v1-2 global-scale) 2048.0) (set! (-> v1-2 waveform) ripple-for-lavatube-lava) ) - (logclear! (-> obj flags) (water-flags wt23)) - (logior! (-> obj flags) (water-flags wt25)) - (set! (-> obj attack-event) 'heat) + (logclear! (-> this flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt25)) + (set! (-> this attack-event) 'heat) (none) ) @@ -1325,10 +1325,10 @@ :post ja-post ) -(defmethod init-from-entity! lavayellowtarp ((obj lavayellowtarp) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavayellowtarp-sg* '()) +(defmethod init-from-entity! lavayellowtarp ((this lavayellowtarp) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavayellowtarp-sg* '()) (go lavayellowtarp-idle) (none) ) diff --git a/goal_src/jak1/levels/maincave/baby-spider.gc b/goal_src/jak1/levels/maincave/baby-spider.gc index 0f9318cfb8..8500fbd5ea 100644 --- a/goal_src/jak1/levels/maincave/baby-spider.gc +++ b/goal_src/jak1/levels/maincave/baby-spider.gc @@ -172,7 +172,7 @@ ) ) -(defmethod init! baby-spider-spawn-params ((obj baby-spider-spawn-params) +(defmethod init! baby-spider-spawn-params ((this baby-spider-spawn-params) (arg0 symbol) (arg1 symbol) (arg2 symbol) @@ -181,30 +181,30 @@ (arg5 int) (arg6 symbol) ) - (set! (-> obj hatched?) arg0) - (set! (-> obj fast-start?) arg1) - (set! (-> obj die-if-not-visible?) arg2) - (set! (-> obj hack-move-above-ground?) arg3) - (set! (-> obj pickup) arg4) - (set! (-> obj pickup-amount) arg5) - (set! (-> obj event-death) arg6) - (set! (-> obj delay-before-dying-if-not-visible) (seconds 2)) + (set! (-> this hatched?) arg0) + (set! (-> this fast-start?) arg1) + (set! (-> this die-if-not-visible?) arg2) + (set! (-> this hack-move-above-ground?) arg3) + (set! (-> this pickup) arg4) + (set! (-> this pickup-amount) arg5) + (set! (-> this event-death) arg6) + (set! (-> this delay-before-dying-if-not-visible) (seconds 2)) (none) ) -(defmethod set-delay! baby-spider-spawn-params ((obj baby-spider-spawn-params) (arg0 time-frame)) - (set! (-> obj delay-before-dying-if-not-visible) arg0) +(defmethod set-delay! baby-spider-spawn-params ((this baby-spider-spawn-params) (arg0 time-frame)) + (set! (-> this delay-before-dying-if-not-visible) arg0) (none) ) -(defmethod touch-handler baby-spider ((obj baby-spider) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler baby-spider ((this baby-spider) (arg0 process) (arg1 event-message-block)) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (go (method-of-object obj nav-enemy-victory)) + (go (method-of-object this nav-enemy-victory)) ) ) ) @@ -222,24 +222,24 @@ baby-spider-default-event-handler -(defmethod common-post baby-spider ((obj baby-spider)) - (when (logtest? (-> obj collide-info status) (cshape-moving-flags onsurf)) - (vector-deg-seek (-> obj up-vector) (-> obj up-vector) (-> obj collide-info surface-normal) 910.2222) - (vector-normalize! (-> obj up-vector) 1.0) +(defmethod common-post baby-spider ((this baby-spider)) + (when (logtest? (-> this collide-info status) (cshape-moving-flags onsurf)) + (vector-deg-seek (-> this up-vector) (-> this up-vector) (-> this collide-info surface-normal) 910.2222) + (vector-normalize! (-> this up-vector) 1.0) ) (forward-up-nopitch->quaternion - (-> obj collide-info quat) - (vector-z-quaternion! (new-stack-vector0) (-> obj collide-info quat)) - (-> obj up-vector) + (-> this collide-info quat) + (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)) obj) + ((the-as (function nav-enemy none) (find-parent-method baby-spider 39)) this) (none) ) -(defmethod nav-enemy-method-38 baby-spider ((obj baby-spider)) +(defmethod nav-enemy-method-38 baby-spider ((this baby-spider)) (integrate-for-enemy-with-move-to-ground! - (-> obj collide-info) - (-> obj collide-info transv) + (-> this collide-info) + (-> this collide-info transv) (collide-kind background) 8192.0 #t @@ -249,50 +249,48 @@ baby-spider-default-event-handler (none) ) -(defmethod nav-enemy-method-51 baby-spider ((obj baby-spider)) +(defmethod nav-enemy-method-51 baby-spider ((this baby-spider)) (let* ((f0-0 (rand-vu-float-range 0.0 1.0)) (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) (f0-2 (+ 1.0 (* 0.2 f0-0))) ) - (set! (-> obj delta-wiggle-angle) (* 910.2222 f1-1)) - (set! (-> obj wiggle-factor) (* 1.5 f2-4)) - (set! (-> obj target-speed) (* 28672.0 f0-2)) + (set! (-> this delta-wiggle-angle) (* 910.2222 f1-1)) + (set! (-> this wiggle-factor) (* 1.5 f2-4)) + (set! (-> this target-speed) (* 28672.0 f0-2)) ) (none) ) -(defmethod nav-enemy-method-52 baby-spider ((obj baby-spider) (arg0 vector)) - (+! (-> obj wiggle-angle) (* DISPLAY_FPS_RATIO (-> obj delta-wiggle-angle))) ;; og:preserve-this changed for high fps - (if (< 65536.0 (-> obj wiggle-angle)) - (+! (-> obj wiggle-angle) -65536.0) +(defmethod nav-enemy-method-52 baby-spider ((this baby-spider) (arg0 vector)) + ;; og:preserve-this changed for high fps + (+! (-> this wiggle-angle) (* DISPLAY_FPS_RATIO (-> this delta-wiggle-angle))) + (if (< 65536.0 (-> this wiggle-angle)) + (+! (-> this wiggle-angle) -65536.0) ) - (let* ((v1-3 (-> obj collide-info trans)) + (let* ((v1-3 (-> this collide-info trans)) (a1-2 (vector-! (new 'stack-no-clear 'vector) v1-3 arg0)) (s2-0 (vector-rotate-around-y! (new 'stack-no-clear 'vector) a1-2 16384.0)) (v1-4 - (vector+*! (new 'stack-no-clear 'vector) arg0 s2-0 (* (-> obj wiggle-factor) (sin (-> obj wiggle-angle)))) + (vector+*! (new 'stack-no-clear 'vector) arg0 s2-0 (* (-> this wiggle-factor) (sin (-> this wiggle-angle)))) ) - (v0-3 (-> obj nav target-pos)) + (v0-3 (-> this nav target-pos)) ) (set! (-> v0-3 quad) (-> v1-4 quad)) (the-as symbol v0-3) ) ) -(defmethod nav-enemy-method-53 baby-spider ((obj baby-spider)) +(defmethod nav-enemy-method-53 baby-spider ((this baby-spider)) (cond - ((logtest? (-> obj draw status) (draw-status was-drawn)) - (set! (-> obj last-visible-time) (-> *display* base-frame-counter)) + ((logtest? (-> this draw status) (draw-status was-drawn)) + (set-time! (-> this last-visible-time)) (return #f) ) (else - (if (-> obj die-if-not-visible?) - (return (>= (- (-> *display* base-frame-counter) (-> obj last-visible-time)) - (-> obj delay-before-dying-if-not-visible) - ) - ) + (if (-> this die-if-not-visible?) + (return (time-elapsed? (-> this last-visible-time) (-> this delay-before-dying-if-not-visible))) ) ) ) @@ -330,7 +328,7 @@ baby-spider-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn)) ) @@ -435,7 +433,7 @@ baby-spider-default-event-handler (if (nav-enemy-method-53 self) (go baby-spider-die-fast) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) + (if (time-elapsed? (-> self state-time) (-> self chase-rest-time)) (go-virtual nav-enemy-victory) ) (let ((t9-3 (-> (method-of-type nav-enemy nav-enemy-chase) trans))) @@ -445,15 +443,15 @@ baby-spider-default-event-handler ) ) :code (behavior () - (set! (-> self target-nav-time) (-> *display* base-frame-counter)) - (set! (-> self wiggle-time) (+ (-> *display* base-frame-counter) (seconds -10))) + (set-time! (-> self target-nav-time)) + (set! (-> self wiggle-time) (+ (current-time) (seconds -10))) (set! (-> self wiggle-angle) 0.0) (set! (-> self chase-rest-time) (rand-vu-int-range (seconds 1) (seconds 4))) (ja-channel-push! 1 (seconds 0.17)) (ja :group! baby-spider-run-ja :num! min) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self wiggle-time)) (seconds 1)) - (set! (-> self wiggle-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self wiggle-time) (seconds 1)) + (set-time! (-> self wiggle-time)) (nav-enemy-method-51 self) ) (suspend) @@ -510,9 +508,9 @@ baby-spider-default-event-handler (ja-no-eval :num! (loop!)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) - (s5-0 (-> *display* base-frame-counter)) + (s5-0 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) + (until (time-elapsed? s5-0 gp-0) (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend) @@ -632,8 +630,8 @@ baby-spider-default-event-handler ) ) -(defmethod initialize-collision baby-spider ((obj baby-spider)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision baby-spider ((this baby-spider)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -649,33 +647,33 @@ baby-spider-default-event-handler ) (set! (-> s5-0 nav-radius) 4096.0) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod nav-enemy-method-48 baby-spider ((obj baby-spider)) - (set! (-> obj last-visible-time) (-> *display* base-frame-counter)) - (initialize-skeleton obj *baby-spider-sg* '()) - (if (= (-> obj parent 0 type) cave-trap) - (init-defaults! obj *baby-spider-nav-enemy-info-for-cave-trap*) - (init-defaults! obj *baby-spider-nav-enemy-info*) +(defmethod nav-enemy-method-48 baby-spider ((this baby-spider)) + (set-time! (-> this last-visible-time)) + (initialize-skeleton this *baby-spider-sg* '()) + (if (= (-> this parent 0 type) cave-trap) + (init-defaults! this *baby-spider-nav-enemy-info-for-cave-trap*) + (init-defaults! this *baby-spider-nav-enemy-info*) ) - (let ((v1-11 (-> obj draw shadow-ctrl settings))) + (let ((v1-11 (-> this draw shadow-ctrl settings))) (logclear! (-> v1-11 flags) (shadow-flags shdf03)) (set! (-> v1-11 fade-dist) 98304.0) ) - (vector-float*! (-> obj collide-info scale) *identity-vector* 0.63) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj wiggle-angle) 0.0) - (set! (-> obj delta-wiggle-angle) 910.2222) - (set! (-> obj wiggle-factor) 1.5) - (set! (-> obj reaction-time) (rand-vu-int-range (seconds 0.1) (seconds 0.8))) - (set! (-> obj chase-rest-time) (seconds 1)) - (set! (-> obj up-vector quad) (-> *y-vector* quad)) + (vector-float*! (-> this collide-info scale) *identity-vector* 0.63) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this wiggle-angle) 0.0) + (set! (-> this delta-wiggle-angle) 910.2222) + (set! (-> this wiggle-factor) 1.5) + (set! (-> this reaction-time) (rand-vu-int-range (seconds 0.1) (seconds 0.8))) + (set! (-> this chase-rest-time) (seconds 1)) + (set! (-> this up-vector quad) (-> *y-vector* quad)) 0 (none) ) @@ -717,28 +715,28 @@ baby-spider-default-event-handler (none) ) -(defmethod init-from-entity! baby-spider ((obj baby-spider) (arg0 entity-actor)) - (set! (-> obj die-if-not-visible?) #f) - (set! (-> obj delay-before-dying-if-not-visible) (seconds 2)) - (set! (-> obj hack-move-above-ground?) #f) - (set! (-> obj event-death) #f) - (initialize-collision obj) - (process-drawable-from-entity! obj arg0) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 24 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) +(defmethod init-from-entity! baby-spider ((this baby-spider) (arg0 entity-actor)) + (set! (-> this die-if-not-visible?) #f) + (set! (-> this delay-before-dying-if-not-visible) (seconds 2)) + (set! (-> this hack-move-above-ground?) #f) + (set! (-> this event-death) #f) + (initialize-collision this) + (process-drawable-from-entity! this arg0) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this nav) (new 'process 'nav-control (-> this collide-info) 24 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) -1 4096.0 ) - (nav-enemy-method-48 obj) - (go (method-of-object obj nav-enemy-idle)) + (nav-enemy-method-48 this) + (go (method-of-object this nav-enemy-idle)) (none) ) diff --git a/goal_src/jak1/levels/maincave/cavecrystal-light.gc b/goal_src/jak1/levels/maincave/cavecrystal-light.gc index 561179867a..4f0041d6be 100644 --- a/goal_src/jak1/levels/maincave/cavecrystal-light.gc +++ b/goal_src/jak1/levels/maincave/cavecrystal-light.gc @@ -65,7 +65,7 @@ (none) ) -(defmethod create-connection! cavecrystal-light-control ((obj cavecrystal-light-control) +(defmethod create-connection! cavecrystal-light-control ((this cavecrystal-light-control) (arg0 process-drawable) (arg1 res-lump) (arg2 (function object object object object object)) @@ -77,22 +77,22 @@ ) ) -(defmethod execute-connections cavecrystal-light-control ((obj cavecrystal-light-control)) +(defmethod execute-connections cavecrystal-light-control ((this cavecrystal-light-control)) (execute-connections *cavecrystal-engine* #f) ) -(defmethod cavecrystal-light-control-method-12 cavecrystal-light-control ((obj cavecrystal-light-control)) - (let ((v1-0 (-> obj last-known-valid-time)) - (a1-1 (-> *display* base-frame-counter)) +(defmethod cavecrystal-light-control-method-12 cavecrystal-light-control ((this cavecrystal-light-control)) + (let ((v1-0 (-> this last-known-valid-time)) + (a1-1 (current-time)) ) (when (!= v1-0 a1-1) - (set! (-> obj last-known-valid-time) a1-1) + (set! (-> this last-known-valid-time) a1-1) (cond ((zero? v1-0) - (set! (-> obj active-count) 0) - (set! (-> obj head) #f) + (set! (-> this active-count) 0) + (set! (-> this head) #f) (dotimes (v1-1 7) - (let ((a1-5 (-> obj crystal v1-1))) + (let ((a1-5 (-> this crystal v1-1))) (set! (-> a1-5 next) #f) (set! (-> a1-5 crystal-id) v1-1) (set! (-> a1-5 intensity) 0.0) @@ -103,9 +103,9 @@ ) ) (else - (when (> (-> obj active-count) 0) + (when (> (-> this active-count) 0) (let ((v1-4 (the-as cavecrystal-light #f)) - (a1-7 (-> obj head)) + (a1-7 (-> this head)) ) (while a1-7 (cond @@ -115,11 +115,11 @@ ) (else (let ((a2-4 (-> a1-7 next))) - (+! (-> obj active-count) -1) + (+! (-> this active-count) -1) (set! (-> a1-7 next) #f) (set! (-> a1-7 intensity) 0.0) (if v1-4 - (set! (-> obj head) a2-4) + (set! (-> this head) a2-4) (set! (-> v1-4 next) a2-4) ) (set! a1-7 a2-4) @@ -136,49 +136,49 @@ (none) ) -(defmethod inc-intensities! cavecrystal-light-control ((obj cavecrystal-light-control)) - (set! (-> obj head) #f) +(defmethod inc-intensities! cavecrystal-light-control ((this cavecrystal-light-control)) + (set! (-> this head) #f) (let ((a1-0 (the-as cavecrystal-light #f)) (v0-0 0) ) (dotimes (v1-0 7) - (let ((a2-3 (-> obj crystal v1-0))) + (let ((a2-3 (-> this crystal v1-0))) (set! (-> a2-3 next) #f) (when (< 0.0 (-> a2-3 intensity)) (+! v0-0 1) (if a1-0 (set! (-> a1-0 next) a2-3) - (set! (-> obj head) a2-3) + (set! (-> this head) a2-3) ) (set! a1-0 a2-3) ) ) ) - (set! (-> obj active-count) v0-0) + (set! (-> this active-count) v0-0) ) (none) ) ;; WARN: Function (method 9 cavecrystal-light-control) has a return type of none, but the expression builder found a return statement. -(defmethod cavecrystal-light-control-method-9 cavecrystal-light-control ((obj cavecrystal-light-control) (arg0 int) (arg1 float) (arg2 process-drawable)) - (cavecrystal-light-control-method-12 obj) +(defmethod cavecrystal-light-control-method-9 cavecrystal-light-control ((this cavecrystal-light-control) (arg0 int) (arg1 float) (arg2 process-drawable)) + (cavecrystal-light-control-method-12 this) (when (or (< arg0 0) (>= arg0 7)) (format 0 "ERROR: Bogus cavecrystal id!~%") (return #f) ) - (let ((s3-0 (-> obj crystal arg0))) + (let ((s3-0 (-> this crystal arg0))) (cond ((and (< 0.0 arg1) (>= 0.0 (-> s3-0 intensity))) - (+! (-> obj active-count) 1) + (+! (-> this active-count) 1) (set! (-> s3-0 intensity) arg1) (set! (-> s3-0 crystal-handle) (process->handle arg2)) (set! (-> s3-0 trans quad) (-> arg2 root trans quad)) - (inc-intensities! obj) + (inc-intensities! this) ) ((and (>= 0.0 arg1) (< 0.0 (-> s3-0 intensity))) - (+! (-> obj active-count) -1) + (+! (-> this active-count) -1) (set! (-> s3-0 intensity) 0.0) - (inc-intensities! obj) + (inc-intensities! this) ) ((< 0.0 arg1) (set! (-> s3-0 intensity) arg1) @@ -189,9 +189,9 @@ (none) ) -(defmethod cavecrystal-light-control-method-10 cavecrystal-light-control ((obj cavecrystal-light-control) (arg0 vector)) - (cavecrystal-light-control-method-12 obj) - (let ((s5-1 (-> obj head)) +(defmethod cavecrystal-light-control-method-10 cavecrystal-light-control ((this cavecrystal-light-control) (arg0 vector)) + (cavecrystal-light-control-method-12 this) + (let ((s5-1 (-> this head)) (f30-0 0.0) ) (when s5-1 diff --git a/goal_src/jak1/levels/maincave/dark-crystal.gc b/goal_src/jak1/levels/maincave/dark-crystal.gc index 3ac568db2b..acc04af644 100644 --- a/goal_src/jak1/levels/maincave/dark-crystal.gc +++ b/goal_src/jak1/levels/maincave/dark-crystal.gc @@ -446,15 +446,15 @@ (sound-play "warning") (set! (-> self draw color-mult quad) (-> self lit-color-mult quad)) (set! (-> self draw color-emissive quad) (-> self lit-color-emissive quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.1)) (suspend) ) (set! (-> self draw color-mult quad) (-> self unlit-color-mult quad)) (set! (-> self draw color-emissive quad) (-> self unlit-color-emissive quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((s5-1 (-> *dark-crystal-flash-delays* gp-0))) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) s5-1) + (until (time-elapsed? (-> self state-time) s5-1) (suspend) ) ) @@ -465,7 +465,7 @@ (defstate dark-crystal-explode (dark-crystal) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) (let ((gp-0 (new 'stack 'joint-exploder-tuning 0))) @@ -503,8 +503,8 @@ (-> self root-override trans) :to *entity-pool* ) - (let ((s5-4 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-4) (seconds 0.25)) + (let ((s5-4 (current-time))) + (until (time-elapsed? s5-4 (seconds 0.25)) (suspend) ) ) @@ -553,17 +553,17 @@ ) ) -(defmethod dark-crystal-method-20 dark-crystal ((obj dark-crystal)) +(defmethod dark-crystal-method-20 dark-crystal ((this dark-crystal)) (when *target* (let ((s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> obj root-override trans quad)) + (set! (-> s5-0 quad) (-> this root-override trans quad)) (+! (-> s5-0 y) 6144.0) (set! (-> s3-0 quad) (-> (target-pos 0) quad)) (+! (-> s3-0 y) 6144.0) - (when (>= (-> obj explode-danger-radius) (vector-vector-distance s5-0 s3-0)) + (when (>= (-> this explode-danger-radius) (vector-vector-distance s5-0 s3-0)) (vector-! s4-0 s3-0 s5-0) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result))) (if (< (fill-and-probe-using-line-sphere @@ -572,7 +572,7 @@ s4-0 819.2 (collide-kind background) - obj + this t2-0 (new 'static 'pat-surface :noentity #x1) ) @@ -587,16 +587,16 @@ (none) ) -(defmethod dark-crystal-method-21 dark-crystal ((obj dark-crystal)) +(defmethod dark-crystal-method-21 dark-crystal ((this dark-crystal)) (let ((s5-0 #f)) - (when (nonzero? (-> obj crystal-num)) + (when (nonzero? (-> this crystal-num)) (let* ((s4-0 (get-task-control (game-task cave-dark-crystals))) - (s3-0 (logior (get-reminder s4-0 3) (ash 1 (-> obj crystal-num)))) + (s3-0 (logior (get-reminder s4-0 3) (ash 1 (-> this crystal-num)))) ) (save-reminder s4-0 s3-0 3) (when (= s3-0 62) (set! s5-0 #t) - (process-entity-status! obj (entity-perm-status complete) #t) + (process-entity-status! this (entity-perm-status complete) #t) ) ) ) @@ -604,13 +604,13 @@ ) ) -(defmethod init-from-entity! dark-crystal ((obj dark-crystal) (arg0 entity-actor)) - (set-vector! (-> obj unlit-color-mult) 0.5 0.5 0.5 1.0) - (set-vector! (-> obj unlit-color-emissive) 0.0 0.0 0.0 0.0) - (set-vector! (-> obj lit-color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj lit-color-emissive) 1.0 1.0 1.0 0.0) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! dark-crystal ((this dark-crystal) (arg0 entity-actor)) + (set-vector! (-> this unlit-color-mult) 0.5 0.5 0.5 1.0) + (set-vector! (-> this unlit-color-emissive) 0.0 0.0 0.0 0.0) + (set-vector! (-> this lit-color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this lit-color-emissive) 1.0 1.0 1.0 0.0) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -622,29 +622,29 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *dark-crystal-sg* '()) - (logior! (-> obj mask) (process-mask attackable)) - (set! (-> obj draw color-mult quad) (-> obj unlit-color-mult quad)) - (set! (-> obj draw color-emissive quad) (-> obj unlit-color-emissive quad)) - (set! (-> obj underwater?) (= (res-lump-value arg0 'mode uint128) 1)) - (set! (-> obj explode-danger-radius) (res-lump-float arg0 'extra-radius :default 28672.0)) - (set! (-> obj crystal-num) (res-lump-value arg0 'extra-id int)) - (set-vector! (-> obj root-override scale) 2.0 2.0 2.0 1.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *dark-crystal-sg* '()) + (logior! (-> this mask) (process-mask attackable)) + (set! (-> this draw color-mult quad) (-> this unlit-color-mult quad)) + (set! (-> this draw color-emissive quad) (-> this unlit-color-emissive quad)) + (set! (-> this underwater?) (= (res-lump-value arg0 'mode uint128) 1)) + (set! (-> this explode-danger-radius) (res-lump-float arg0 'extra-radius :default 28672.0)) + (set! (-> this crystal-num) (res-lump-value arg0 'extra-id int)) + (set-vector! (-> this root-override scale) 2.0 2.0 2.0 1.0) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (update-transforms! (-> this root-override)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go dark-crystal-spawn-fuel-cell) (go dark-crystal-idle) ) diff --git a/goal_src/jak1/levels/maincave/driller-lurker.gc b/goal_src/jak1/levels/maincave/driller-lurker.gc index 9b826fc6d9..9e8534afc2 100644 --- a/goal_src/jak1/levels/maincave/driller-lurker.gc +++ b/goal_src/jak1/levels/maincave/driller-lurker.gc @@ -259,7 +259,7 @@ (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) ) (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-time! (-> self hit-player-time)) (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) (let ((v1-39 (-> self mode))) (if (or (zero? v1-39) (= v1-39 1) (= v1-39 2)) @@ -302,7 +302,7 @@ (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) ) (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-time! (-> self hit-player-time)) (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) (let ((v1-62 (-> self mode))) (if (or (zero? v1-62) (= v1-62 1) (= v1-62 2)) @@ -315,19 +315,19 @@ ) ) -(defmethod driller-lurker-method-20 driller-lurker ((obj driller-lurker) (arg0 symbol) (arg1 target)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-update-time)) - (set! (-> obj last-update-time) v1-1) - (let* ((f0-0 (-> obj path-speed)) - (f1-1 (seek f0-0 (-> obj targ-path-speed) (* 12288.0 (-> *display* seconds-per-frame)))) +(defmethod driller-lurker-method-20 driller-lurker ((this driller-lurker) (arg0 symbol) (arg1 target)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-update-time)) + (set! (-> this last-update-time) v1-1) + (let* ((f0-0 (-> this path-speed)) + (f1-1 (seek f0-0 (-> this targ-path-speed) (* 12288.0 (seconds-per-frame)))) ) - (set! (-> obj path-speed) f1-1) + (set! (-> this path-speed) f1-1) (when (< 0.0 f1-1) - (let* ((f0-5 (-> obj path-u)) - (f30-0 (* (-> obj path-dir) f1-1 (-> *display* seconds-per-frame))) + (let* ((f0-5 (-> this path-u)) + (f30-0 (* (-> this path-dir) f1-1 (seconds-per-frame))) (s4-0 #t) - (f0-6 (+ f0-5 (* 0.00024414062 (-> obj path-units-per-meter) f30-0))) + (f0-6 (+ f0-5 (* 0.00024414062 (-> this path-units-per-meter) f30-0))) ) (cond ((< f0-6 0.0) @@ -335,12 +335,12 @@ (cond (arg0 (set! f0-6 (- f0-6)) - (set! (-> obj path-dir) (- (-> obj path-dir))) - (set! (-> obj path-speed) 0.0) + (set! (-> this path-dir) (- (-> this path-dir))) + (set! (-> this path-speed) 0.0) ) (else (set! f0-6 0.0) - (set! (-> obj path-speed) 0.0) + (set! (-> this path-speed) 0.0) ) ) ) @@ -349,22 +349,22 @@ (cond (arg0 (set! f0-6 (- 2.0 f0-6)) - (set! (-> obj path-dir) (- (-> obj path-dir))) - (set! (-> obj path-speed) 0.0) + (set! (-> this path-dir) (- (-> this path-dir))) + (set! (-> this path-speed) 0.0) ) (else (set! f0-6 1.0) - (set! (-> obj path-speed) 0.0) + (set! (-> this path-speed) 0.0) ) ) ) ) - (set! (-> obj path-u) f0-6) + (set! (-> this path-u) f0-6) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> obj root-overeride trans quad)) - (eval-path-curve! (-> obj path) (-> obj root-overeride trans) f0-6 'interp) + (set! (-> s3-1 quad) (-> this root-overeride trans quad)) + (eval-path-curve! (-> this path) (-> this root-overeride trans) f0-6 'interp) (when s4-0 - (let ((f0-7 (vector-vector-xz-distance s3-1 (-> obj root-overeride trans)))) + (let ((f0-7 (vector-vector-xz-distance s3-1 (-> this root-overeride trans)))) #| fix for higher framerate: @@ -372,197 +372,200 @@ when this happens, the change in u on a frame may be extremely small so the vector-vector-xz-distance is very small (because you didn't move much - on the path) and (set! (-> obj path-units-per-meter) (* (/ (fabs f30-0) f0-7) - (-> obj path-units-per-meter))) makes things blow up because that division isn't + on the path) and (set! (-> this path-units-per-meter) (* (/ (fabs f30-0) f0-7) + (-> this path-units-per-meter))) makes things blow up because that division isn't accurate for tiny numbers |# (when (> f0-7 0.00001) - (set! (-> obj path-units-per-meter) (* (/ (fabs f30-0) f0-7) (-> obj path-units-per-meter))))) + (set! (-> this path-units-per-meter) (* (/ (fabs f30-0) f0-7) (-> this path-units-per-meter))))) ) ) ) ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (path-control-method-14 (-> obj path) s4-1 (-> obj path-u)) + (path-control-method-14 (-> this path) s4-1 (-> this path-u)) (let ((f0-13 (atan (-> s4-1 x) (-> s4-1 z)))) - (if (< (-> obj path-dir) 0.0) + (if (< (-> this path-dir) 0.0) (set! f0-13 (+ 32768.0 f0-13)) ) - (set! (-> obj path-ry) f0-13) + (set! (-> this path-ry) f0-13) ) ) - (case (-> obj mode) + (case (-> this mode) ((4) (when *target* (let ((a0-13 (target-pos 0)) (v1-26 (new 'stack-no-clear 'vector)) ) - (vector-! v1-26 a0-13 (-> obj root-overeride trans)) + (vector-! v1-26 a0-13 (-> this root-overeride trans)) (let ((f0-16 (atan (-> v1-26 x) (-> v1-26 z)))) - (set! (-> obj facing-ry) - (deg-seek-smooth (-> obj facing-ry) f0-16 (* 32768.0 (-> *display* seconds-per-frame)) 0.25) - ) + (set! (-> this facing-ry) (deg-seek-smooth (-> this facing-ry) f0-16 (* 32768.0 (seconds-per-frame)) 0.25)) ) ) - (when (< 16384.0 (fabs (deg- (-> obj facing-ry) (-> obj path-ry)))) - (set! (-> obj path-dir) (- (-> obj path-dir))) - (+! (-> obj path-ry) 32768.0) + (when (< 16384.0 (fabs (deg- (-> this facing-ry) (-> this path-ry)))) + (set! (-> this path-dir) (- (-> this path-dir))) + (+! (-> this path-ry) 32768.0) ) ) ) (else - (if (!= (-> obj mode) 1) - (set! (-> obj facing-ry) - (deg-seek-smooth (-> obj facing-ry) (-> obj path-ry) (* 32768.0 (-> *display* seconds-per-frame)) 0.25) + (if (!= (-> this mode) 1) + (set! (-> this facing-ry) + (deg-seek-smooth (-> this facing-ry) (-> this path-ry) (* 32768.0 (seconds-per-frame)) 0.25) ) ) ) ) - (quaternion-axis-angle! (-> obj root-overeride quat) 0.0 1.0 0.0 (-> obj facing-ry)) + (quaternion-axis-angle! (-> this root-overeride quat) 0.0 1.0 0.0 (-> this facing-ry)) (let ((f30-2 0.0)) (when *target* - (let ((f0-34 (vector-vector-xz-distance (target-pos 0) (-> obj root-overeride trans)))) + (let ((f0-34 (vector-vector-xz-distance (target-pos 0) (-> this root-overeride trans)))) (if (< f0-34 36864.0) (set! f30-2 (- 1.0 (* 0.00006510417 (fmax 0.0 (+ -21504.0 f0-34))))) ) ) ) - (let ((f28-1 (* 0.0001373291 (fmin 7281.778 (fabs (deg- (-> obj path-ry) (-> obj facing-ry))))))) + (let ((f28-1 (* 0.0001373291 (fmin 7281.778 (fabs (deg- (-> this path-ry) (-> this facing-ry))))))) (cond ((< 0.0 f30-2) (let ((s3-2 (new 'stack-no-clear 'vector))) - (vector-! s3-2 (target-pos 0) (-> obj root-overeride trans)) + (vector-! s3-2 (target-pos 0) (-> this root-overeride trans)) (let* ((f1-27 (vector-x-angle s3-2)) (f1-29 (fmax 728.1778 (fmin 10194.489 f1-27))) (f0-46 (* 0.000105637766 (+ -728.1778 f1-29))) (f0-47 (lerp f28-1 f0-46 f30-2)) ) - (set! (-> obj up-blend) - (seek-with-smooth (-> obj up-blend) f0-47 (* 8192.0 (-> *display* seconds-per-frame)) 0.25 0.01) - ) + (set! (-> this up-blend) (seek-with-smooth (-> this up-blend) f0-47 (* 8192.0 (seconds-per-frame)) 0.25 0.01)) ) ) ) (else - (set! (-> obj up-blend) - (seek-with-smooth (-> obj up-blend) f28-1 (* 8192.0 (-> *display* seconds-per-frame)) 0.125 0.01) + (set! (-> this up-blend) + (seek-with-smooth (-> this up-blend) f28-1 (* 8192.0 (seconds-per-frame)) 0.125 0.01) ) ) ) ) ) (when (and arg1 *target*) - (set-target! (-> obj neck) (target-pos 5)) + (set-target! (-> this neck) (target-pos 5)) (if *target* - (look-at-enemy! (-> *target* neck) (the-as vector (-> obj root-overeride root-prim prim-core)) 'attacking obj) + (look-at-enemy! + (-> *target* neck) + (the-as vector (-> this root-overeride root-prim prim-core)) + 'attacking + this + ) ) ) - (let ((f30-3 (-> obj drill-speed))) - (let ((v1-56 (-> obj mode))) + (let ((f30-3 (-> this drill-speed))) + (let ((v1-56 (-> this mode))) (cond ((or (= v1-56 2) (zero? v1-56)) - (set! f30-3 (seek f30-3 72817.78 (* 372827.03 (-> *display* seconds-per-frame)))) + (set! f30-3 (seek f30-3 72817.78 (* 372827.03 (seconds-per-frame)))) ) ((= v1-56 1) - (set! f30-3 (seek f30-3 276707.56 (* 372827.03 (-> *display* seconds-per-frame)))) + (set! f30-3 (seek f30-3 276707.56 (* 372827.03 (seconds-per-frame)))) ) ((or (= v1-56 3) (= v1-56 4)) - (set! f30-3 (if (>= (- (-> *display* base-frame-counter) (-> obj started-chasing-time)) (seconds 2.25)) - (seek f30-3 0.0 (* 600746.7 (-> *display* seconds-per-frame))) - (seek f30-3 276707.56 (* 372827.03 (-> *display* seconds-per-frame))) + (set! f30-3 (if (time-elapsed? (-> this started-chasing-time) (seconds 2.25)) + (seek f30-3 0.0 (* 600746.7 (seconds-per-frame))) + (seek f30-3 276707.56 (* 372827.03 (seconds-per-frame))) ) ) ) ((= v1-56 5) - (set! f30-3 (if (>= (- (-> *display* base-frame-counter) (-> obj started-chasing-time)) (seconds 5.75)) - (seek f30-3 276707.56 (* 372827.03 (-> *display* seconds-per-frame))) - (seek f30-3 0.0 (* 600746.7 (-> *display* seconds-per-frame))) + (set! f30-3 (if (time-elapsed? (-> this started-chasing-time) (seconds 5.75)) + (seek f30-3 276707.56 (* 372827.03 (seconds-per-frame))) + (seek f30-3 0.0 (* 600746.7 (seconds-per-frame))) ) ) ) ) ) - (set! (-> obj drill-speed) f30-3) + (set! (-> this drill-speed) f30-3) (cond ((>= f30-3 36408.89) - (update-trans! (-> obj sound) (-> obj root-overeride trans)) - (update! (-> obj sound)) - (set! (-> obj played-drill-sound?) #t) + (update-trans! (-> this sound) (-> this root-overeride trans)) + (update! (-> this sound)) + (set! (-> this played-drill-sound?) #t) ) (else - (when (-> obj played-drill-sound?) - (set! (-> obj played-drill-sound?) #f) - (stop! (-> obj sound)) + (when (-> this played-drill-sound?) + (set! (-> this played-drill-sound?) #f) + (stop! (-> this sound)) ) ) ) - (let ((f0-69 (+ (-> obj drill-rz) (* f30-3 (-> *display* seconds-per-frame))))) - (set! (-> obj drill-rz) (- f0-69 (* (the float (the int (/ f0-69 65536.0))) 65536.0))) + (let ((f0-69 (+ (-> this drill-rz) (* f30-3 (seconds-per-frame))))) + (set! (-> this drill-rz) (- f0-69 (* (the float (the int (/ f0-69 65536.0))) 65536.0))) ) ) (let ((s5-2 (new 'stack-no-clear 'quaternion))) - (quaternion-axis-angle! s5-2 0.0 0.0 1.0 (-> obj drill-rz)) - (set-trs! (-> obj drill) (the-as vector #f) s5-2 (the-as vector #f)) + (quaternion-axis-angle! s5-2 0.0 0.0 1.0 (-> this drill-rz)) + (set-trs! (-> this drill) (the-as vector #f) s5-2 (the-as vector #f)) ) 0 ) ) - (when (and (-> obj hit-player?) + (when (and (-> this hit-player?) (or (not *target*) (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (>= (- (-> *display* base-frame-counter) (-> obj hit-player-time)) (seconds 0.05)) + (time-elapsed? (-> this hit-player-time) (seconds 0.05)) ) ) ) - (set-collide-offense (-> obj root-overeride) 2 (collide-offense touch)) - (set! (-> obj hit-player?) #f) + (set-collide-offense (-> this root-overeride) 2 (collide-offense touch)) + (set! (-> this hit-player?) #f) #f ) ) -(defmethod driller-lurker-method-23 driller-lurker ((obj driller-lurker)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-player-path-u-time)) - (set! (-> obj last-player-path-u-time) v1-1) +(defmethod driller-lurker-method-23 driller-lurker ((this driller-lurker)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-player-path-u-time)) + (set! (-> this last-player-path-u-time) v1-1) (cond (*target* - (let* ((s5-0 (-> obj path)) + (let* ((s5-0 (-> this path)) (s4-0 (method-of-object s5-0 path-control-method-20)) ) (target-pos 0) - (set! (-> obj player-path-u) (s4-0 s5-0)) + (set! (-> this player-path-u) (s4-0 s5-0)) ) ) (else - (set! (-> obj player-path-u) 0.0) + (set! (-> this player-path-u) 0.0) ) ) ) ) - (-> obj player-path-u) + (-> this player-path-u) ) -(defmethod driller-lurker-method-25 driller-lurker ((obj driller-lurker)) +(defmethod driller-lurker-method-25 driller-lurker ((this driller-lurker)) (when *target* (let* ((s5-0 (target-pos 0)) - (f0-1 (- (-> s5-0 y) (-> obj root-overeride trans y))) + (f0-1 (- (-> s5-0 y) (-> this root-overeride trans y))) ) (when (and (>= 32768.0 f0-1) (>= f0-1 -2048.0)) - (case (-> obj mode) + (case (-> this mode) ((1) - (if (>= 73728.0 (vector-vector-xz-distance (-> obj root-overeride trans) s5-0)) + (if (>= 73728.0 (vector-vector-xz-distance (-> this root-overeride trans) s5-0)) (return #t) ) ) (else - (when (>= 102400.0 (vector-vector-xz-distance (-> obj root-overeride trans) s5-0)) - (let ((f0-8 (atan (- (-> s5-0 x) (-> obj root-overeride trans x)) (- (-> s5-0 z) (-> obj root-overeride trans z)))) + (when (>= 102400.0 (vector-vector-xz-distance (-> this root-overeride trans) s5-0)) + (let ((f0-8 + (atan (- (-> s5-0 x) (-> this root-overeride trans x)) (- (-> s5-0 z) (-> this root-overeride trans z))) + ) ) - (if (>= 20024.889 (fabs (deg- f0-8 (-> obj facing-ry)))) + (if (>= 20024.889 (fabs (deg- f0-8 (-> this facing-ry)))) (return #t) ) ) @@ -575,14 +578,14 @@ #f ) -(defmethod driller-lurker-method-26 driller-lurker ((obj driller-lurker)) +(defmethod driller-lurker-method-26 driller-lurker ((this driller-lurker)) (when *target* (let* ((a1-0 (target-pos 0)) - (f0-1 (- (-> a1-0 y) (-> obj root-overeride trans y))) + (f0-1 (- (-> a1-0 y) (-> this root-overeride trans y))) ) (if (and (< f0-1 40960.0) (< -10240.0 f0-1) - (< (vector-vector-xz-distance (-> obj root-overeride trans) a1-0) 143360.0) + (< (vector-vector-xz-distance (-> this root-overeride trans) a1-0) 143360.0) ) (return #f) ) @@ -591,22 +594,22 @@ #t ) -(defmethod driller-lurker-method-24 driller-lurker ((obj driller-lurker)) +(defmethod driller-lurker-method-24 driller-lurker ((this driller-lurker)) (when *target* (let* ((a1-0 (target-pos 0)) - (f0-1 (- (-> a1-0 y) (-> obj root-overeride trans y))) + (f0-1 (- (-> a1-0 y) (-> this root-overeride trans y))) ) (when (and (< f0-1 40960.0) (< -10240.0 f0-1)) - (let ((f0-2 (vector-vector-xz-distance (-> obj root-overeride trans) a1-0))) + (let ((f0-2 (vector-vector-xz-distance (-> this root-overeride trans) a1-0))) (cond ((>= 17408.0 f0-2) (return #t) ) ((< f0-2 143360.0) - (let ((f0-3 (driller-lurker-method-23 obj)) - (f1-5 (-> obj path-u)) + (let ((f0-3 (driller-lurker-method-23 this)) + (f1-5 (-> this path-u)) ) - (if (>= (* 0.1 (-> obj path-units-per-meter)) (fabs (- f0-3 f1-5))) + (if (>= (* 0.1 (-> this path-units-per-meter)) (fabs (- f0-3 f1-5))) (return #t) ) ) @@ -619,14 +622,14 @@ #f ) -(defmethod driller-lurker-method-27 driller-lurker ((obj driller-lurker)) - (let ((a2-0 (-> obj node-list data 25 bone transform)) +(defmethod driller-lurker-method-27 driller-lurker ((this driller-lurker)) + (let ((a2-0 (-> this node-list data 25 bone transform)) (s5-0 (new 'stack-no-clear 'vector)) ) (set-vector! s5-0 0.0 0.0 8192.0 1.0) (vector-matrix*! s5-0 s5-0 a2-0) (vector-float*! s5-0 s5-0 (/ 1.0 (-> s5-0 w))) - (spawn (-> obj part) s5-0) + (spawn (-> this part) s5-0) ) ) @@ -692,7 +695,7 @@ :event driller-lurker-default-event-handler :enter (behavior () (set! (-> self mode) (the-as uint 2)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self timeout) (rand-vu-int-range 900 3600)) (set! (-> self targ-path-speed) 15360.0) (if (>= 4096.0 (-> self path-speed)) @@ -717,7 +720,7 @@ (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend)) ) (when (ja-done? 0) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self timeout)) + (if (and (time-elapsed? (-> self state-time) (-> self timeout)) (>= 546.13336 (fabs (deg- (-> self path-ry) (-> self facing-ry)))) ) (go driller-lurker-patrol-pause) @@ -789,10 +792,10 @@ :event driller-lurker-default-event-handler :enter (behavior ((arg0 symbol)) (if arg0 - (set! (-> self started-chasing-time) (-> *display* base-frame-counter)) + (set-time! (-> self started-chasing-time)) ) (set! (-> self mode) (the-as uint 3)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self targ-path-speed) 23552.0) ) :trans (behavior () @@ -802,7 +805,7 @@ (if (driller-lurker-method-26 self) (go driller-lurker-patrol) ) - (if (>= (- (-> *display* base-frame-counter) (-> self started-chasing-time)) (seconds 3)) + (if (time-elapsed? (-> self started-chasing-time) (seconds 3)) (go driller-lurker-jammed-standing) ) (let* ((gp-0 (-> self path)) @@ -852,22 +855,22 @@ :event driller-lurker-default-event-handler :enter (behavior () (set! (-> self mode) (the-as uint 4)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) ) :trans (behavior () (cond ((driller-lurker-method-24 self) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (go driller-lurker-chase #f) ) ) ) - (if (>= (- (-> *display* base-frame-counter) (-> self started-chasing-time)) (seconds 3)) + (if (time-elapsed? (-> self started-chasing-time) (seconds 3)) (go driller-lurker-jammed-standing) ) (driller-lurker-method-20 self #f (the-as target #t)) @@ -908,7 +911,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self started-chasing-time) (-> *display* base-frame-counter)) + (set-time! (-> self started-chasing-time)) (cond (*target* (go driller-lurker-chase #f) @@ -944,45 +947,45 @@ :post ja-post ) -(defmethod relocate driller-lurker ((obj driller-lurker) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(defmethod relocate driller-lurker ((this driller-lurker) (arg0 int)) + (if (nonzero? (-> this neck)) + (&+! (-> this neck) arg0) ) - (if (nonzero? (-> obj drill)) - (&+! (-> obj drill) arg0) + (if (nonzero? (-> this drill)) + (&+! (-> this drill) arg0) ) - (if (nonzero? (-> obj sound2)) - (&+! (-> obj sound2) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method driller-lurker 7)) this arg0) ) ) -(defmethod deactivate driller-lurker ((obj driller-lurker)) - (if (nonzero? (-> obj sound2)) - (stop! (-> obj sound2)) +(defmethod deactivate driller-lurker ((this driller-lurker)) + (if (nonzero? (-> this sound2)) + (stop! (-> this sound2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod init-from-entity! driller-lurker ((obj driller-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! driller-lurker ((this driller-lurker) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj hit-player?) #f) - (set! (-> obj played-drill-sound?) #f) - (set! (-> obj hit-player-time) 0) - (set! (-> obj mode) (the-as uint 0)) - (set! (-> obj drill-rz) 0.0) - (set! (-> obj drill-speed) 72817.78) - (set! (-> obj last-update-time) 0) - (set! (-> obj last-player-path-u-time) 0) - (set! (-> obj started-chasing-time) 0) - (set! (-> obj player-attack-id) (the-as uint 0)) - (set! (-> obj ambient-drilling-u) -1.0) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this hit-player?) #f) + (set! (-> this played-drill-sound?) #f) + (set! (-> this hit-player-time) 0) + (set! (-> this mode) (the-as uint 0)) + (set! (-> this drill-rz) 0.0) + (set! (-> this drill-speed) 72817.78) + (set! (-> this last-update-time) 0) + (set! (-> this last-player-path-u-time) 0) + (set! (-> this started-chasing-time) 0) + (set! (-> this player-attack-id) (the-as uint 0)) + (set! (-> this ambient-drilling-u) -1.0) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1046,34 +1049,34 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-overeride) s4-0) + (set! (-> this root-overeride) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *driller-lurker-sg* '()) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (if (< (-> obj path curve num-cverts) 2) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *driller-lurker-sg* '()) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj draw shadow-ctrl) *driller-lurker-shadow-control*) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "drill-idle" :fo-max 40) (-> obj root-overeride trans)) + (set! (-> this draw shadow-ctrl) *driller-lurker-shadow-control*) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "drill-idle" :fo-max 40) (-> this root-overeride trans)) ) - (set! (-> obj sound2) - (new 'process 'ambient-sound (static-sound-spec "drill-idle2" :fo-max 60) (-> obj root-overeride trans)) + (set! (-> this sound2) + (new 'process 'ambient-sound (static-sound-spec "drill-idle2" :fo-max 60) (-> this root-overeride trans)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 331) obj)) - (let ((f0-34 (path-distance (-> obj path)))) - (set! (-> obj path-units-per-meter) (/ 4096.0 f0-34)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 331) this)) + (let ((f0-34 (path-distance (-> this path)))) + (set! (-> this path-units-per-meter) (/ 4096.0 f0-34)) ) - (set! (-> obj path-dir) 1.0) - (set! (-> obj path-u) 0.0) - (set! (-> obj path-speed) 15360.0) - (set! (-> obj targ-path-speed) 15360.0) - (set! (-> obj up-blend) 0.0) + (set! (-> this path-dir) 1.0) + (set! (-> this path-u) 0.0) + (set! (-> this path-speed) 15360.0) + (set! (-> this targ-path-speed) 15360.0) + (set! (-> this up-blend) 0.0) (set! sv-16 (new 'static 'res-tag)) (let ((v1-91 (res-lump-data @@ -1085,54 +1088,54 @@ ) ) (when v1-91 - (set! (-> obj path-u) (fmax 0.0 (fmin 1.0 (-> v1-91 0)))) + (set! (-> this path-u) (fmax 0.0 (fmin 1.0 (-> v1-91 0)))) (if (< (-> v1-91 1) 0.0) - (set! (-> obj path-dir) -1.0) + (set! (-> this path-dir) -1.0) ) (let ((f0-45 (-> v1-91 2))) (when (!= f0-45 12345.0) (let ((f30-0 (* 182.04445 f0-45))) - (set! (-> obj ambient-drilling-u) (-> obj path-u)) - (quaternion-axis-angle! (-> obj root-overeride quat) 0.0 1.0 0.0 f30-0) - (set! (-> obj facing-ry) f30-0) + (set! (-> this ambient-drilling-u) (-> this path-u)) + (quaternion-axis-angle! (-> this root-overeride quat) 0.0 1.0 0.0 f30-0) + (set! (-> this facing-ry) f30-0) ) ) ) ) ) - (eval-path-curve! (-> obj path) (-> obj root-overeride trans) (-> obj path-u) 'interp) + (eval-path-curve! (-> this path) (-> this root-overeride trans) (-> this path-u) 'interp) (let ((s5-1 (new 'stack-no-clear 'vector))) - (path-control-method-14 (-> obj path) s5-1 (-> obj path-u)) + (path-control-method-14 (-> this path) s5-1 (-> this path-u)) (let ((f0-51 (atan (-> s5-1 x) (-> s5-1 z)))) - (if (< (-> obj path-dir) 0.0) + (if (< (-> this path-dir) 0.0) (set! f0-51 (+ 32768.0 f0-51)) ) - (set! (-> obj path-ry) f0-51) - (if (< (-> obj ambient-drilling-u) 0.0) - (set! (-> obj facing-ry) f0-51) + (set! (-> this path-ry) f0-51) + (if (< (-> this ambient-drilling-u) 0.0) + (set! (-> this facing-ry) f0-51) ) ) ) - (let ((v1-103 (new 'process 'joint-mod (joint-mod-handler-mode reset) obj 6))) - (set! (-> obj neck) v1-103) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) + (let ((v1-103 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 6))) + (set! (-> this neck) v1-103) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) (set! (-> v1-103 up) (the-as uint 1)) (set! (-> v1-103 nose) (the-as uint 2)) (set! (-> v1-103 ear) (the-as uint 0)) (set! (-> v1-103 max-dist) 102400.0) (set! (-> v1-103 ignore-angle) 16384.0) ) - (set! (-> obj drill) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) obj 38)) + (set! (-> this drill) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) this 38)) (transform-post) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) -1 8192.0 ) - (if (>= (-> obj ambient-drilling-u) 0.0) + (if (>= (-> this ambient-drilling-u) 0.0) (go driller-lurker-idle-drilling) (go driller-lurker-patrol) ) diff --git a/goal_src/jak1/levels/maincave/gnawer.gc b/goal_src/jak1/levels/maincave/gnawer.gc index 72cbf34d27..7d34a1fe27 100644 --- a/goal_src/jak1/levels/maincave/gnawer.gc +++ b/goal_src/jak1/levels/maincave/gnawer.gc @@ -318,14 +318,14 @@ (defstate falling (gnawer-falling-segment) :virtual #t :trans (behavior () - (+! (-> self transv y) (* -409600.0 (-> *display* seconds-per-frame))) + (+! (-> self transv y) (* -409600.0 (seconds-per-frame))) (vector-v+! (-> self root trans) (-> self root trans) (-> self transv)) - (+! (-> self facing-rot x) (* (-> self facing-rotv x) (-> *display* seconds-per-frame))) + (+! (-> self facing-rot x) (* (-> self facing-rotv x) (seconds-per-frame))) (set! (-> self facing-rot z) - (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (-> *display* seconds-per-frame))) + (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (seconds-per-frame))) ) (quaternion-zxy! (-> self root quat) (-> self facing-rot)) - (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) + (seek! (-> self root scale x) 0.0 (* 0.5 (seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) ) @@ -388,39 +388,39 @@ (none) ) -(defmethod gnawer-method-23 gnawer ((obj gnawer)) - (when (not (-> obj hidden?)) - (set! (-> obj hidden?) #t) - (logior! (-> obj draw status) (draw-status hidden)) - (logclear! (-> obj mask) (process-mask attackable)) - (set! (-> obj skel postbind-function) #f) - (set! (-> obj root-override trans quad) (-> obj post-trans quad)) - (clear-collide-with-as (-> obj root-override)) +(defmethod gnawer-method-23 gnawer ((this gnawer)) + (when (not (-> this hidden?)) + (set! (-> this hidden?) #t) + (logior! (-> this draw status) (draw-status hidden)) + (logclear! (-> this mask) (process-mask attackable)) + (set! (-> this skel postbind-function) #f) + (set! (-> this root-override trans quad) (-> this post-trans quad)) + (clear-collide-with-as (-> this root-override)) (dotimes (v1-12 10) - (set! (-> obj segments v1-12 world-pos quad) (-> obj post-trans quad)) + (set! (-> this segments v1-12 world-pos quad) (-> this post-trans quad)) ) - (set-vector! (-> obj draw bounds) 0.0 0.0 0.0 12288.0) + (set-vector! (-> this draw bounds) 0.0 0.0 0.0 12288.0) ) (none) ) -(defmethod gnawer-method-26 gnawer ((obj gnawer)) - (when (-> obj hidden?) - (set! (-> obj hidden?) #f) - (restore-collide-with-as (-> obj root-override)) - (set! (-> obj skel postbind-function) gnawer-joint-callback) - (logclear! (-> obj draw status) (draw-status hidden)) +(defmethod gnawer-method-26 gnawer ((this gnawer)) + (when (-> this hidden?) + (set! (-> this hidden?) #f) + (restore-collide-with-as (-> this root-override)) + (set! (-> this skel postbind-function) gnawer-joint-callback) + (logclear! (-> this draw status) (draw-status hidden)) ) (none) ) -(defmethod gnawer-method-24 gnawer ((obj gnawer)) +(defmethod gnawer-method-24 gnawer ((this gnawer)) (local-vars (sv-48 vector) (sv-64 vector)) (let ((s5-0 0) (s4-0 0) ) (let ((f30-0 -1.0) - (s3-0 (-> obj path curve num-cverts)) + (s3-0 (-> this path curve num-cverts)) ) (dotimes (s2-0 3) (let ((s1-0 (rand-vu-int-count s3-0)) @@ -434,8 +434,8 @@ ) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-64 (new 'stack-no-clear 'vector)) - (eval-path-curve-div! (-> obj path) sv-48 (the float s1-0) 'interp) - (eval-path-curve-div! (-> obj path) sv-64 (the float s0-0) 'interp) + (eval-path-curve-div! (-> this path) sv-48 (the float s1-0) 'interp) + (eval-path-curve-div! (-> this path) sv-64 (the float s0-0) 'interp) (let ((f0-4 (vector-vector-distance sv-48 sv-64))) (when (< f30-0 f0-4) (set! f30-0 f0-4) @@ -446,32 +446,32 @@ ) ) ) - (set! (-> obj route src-pt-index) s5-0) - (set! (-> obj route dest-pt-index) s4-0) + (set! (-> this route src-pt-index) s5-0) + (set! (-> this route dest-pt-index) s4-0) ) - (let ((v1-13 (-> obj route src-pt-index)) - (s5-1 (-> obj route dest-pt-index)) + (let ((v1-13 (-> this route src-pt-index)) + (s5-1 (-> this route dest-pt-index)) ) - (eval-path-curve-div! (-> obj path) (-> obj route src-pt-offset) (the float v1-13) 'interp) - (eval-path-curve-div! (-> obj path) (-> obj route dest-pt-offset) (the float s5-1) 'interp) + (eval-path-curve-div! (-> this path) (-> this route src-pt-offset) (the float v1-13) 'interp) + (eval-path-curve-div! (-> this path) (-> this route dest-pt-offset) (the float s5-1) 'interp) ) - (vector-! (-> obj route src-pt-offset) (-> obj route src-pt-offset) (-> obj post-trans)) - (vector-! (-> obj route dest-pt-offset) (-> obj route dest-pt-offset) (-> obj post-trans)) - (let ((f30-1 (-> obj route src-pt-offset y))) - (set! (-> obj route src-pt-offset y) 0.0) - (vector-normalize! (-> obj route src-pt-offset) 10240.0) - (set! (-> obj route src-pt-offset y) f30-1) + (vector-! (-> this route src-pt-offset) (-> this route src-pt-offset) (-> this post-trans)) + (vector-! (-> this route dest-pt-offset) (-> this route dest-pt-offset) (-> this post-trans)) + (let ((f30-1 (-> this route src-pt-offset y))) + (set! (-> this route src-pt-offset y) 0.0) + (vector-normalize! (-> this route src-pt-offset) 10240.0) + (set! (-> this route src-pt-offset y) f30-1) ) - (let ((f30-2 (-> obj route dest-pt-offset y))) - (set! (-> obj route dest-pt-offset y) 0.0) - (vector-normalize! (-> obj route dest-pt-offset) 10240.0) - (set! (-> obj route dest-pt-offset y) f30-2) + (let ((f30-2 (-> this route dest-pt-offset y))) + (set! (-> this route dest-pt-offset y) 0.0) + (vector-normalize! (-> this route dest-pt-offset) 10240.0) + (set! (-> this route dest-pt-offset y) f30-2) ) - (let ((f30-3 (atan (-> obj route src-pt-offset x) (-> obj route src-pt-offset z))) - (f0-15 (atan (-> obj route dest-pt-offset x) (-> obj route dest-pt-offset z))) + (let ((f30-3 (atan (-> this route src-pt-offset x) (-> this route src-pt-offset z))) + (f0-15 (atan (-> this route dest-pt-offset x) (-> this route dest-pt-offset z))) ) - (set! (-> obj route src-ang) f30-3) - (set! (-> obj route dest-ang) f0-15) + (set! (-> this route src-ang) f30-3) + (set! (-> this route dest-ang) f0-15) (let ((f30-4 (deg- f0-15 f30-3))) 0.0 (let* ((v0-13 (rand-vu-int-count 100)) @@ -488,37 +488,37 @@ ) ) ) - (set! (-> obj route delta-ang) (if (>= f30-4 0.0) - (- f30-4 f0-17) - (+ f30-4 f0-17) - ) + (set! (-> this route delta-ang) (if (>= f30-4 0.0) + (- f30-4 f0-17) + (+ f30-4 f0-17) + ) ) ) ) ) - (let ((f30-5 (* 0.9817476 (-> obj route delta-ang))) - (f28-0 (- (-> obj route dest-pt-offset y) (-> obj route src-pt-offset y))) + (let ((f30-5 (* 0.9817476 (-> this route delta-ang))) + (f28-0 (- (-> this route dest-pt-offset y) (-> this route src-pt-offset y))) ) - (set-vector! (-> obj route surface-dir) f30-5 f28-0 0.0 1.0) - (vector-normalize! (-> obj route surface-dir) 1.0) + (set-vector! (-> this route surface-dir) f30-5 f28-0 0.0 1.0) + (vector-normalize! (-> this route surface-dir) 1.0) (let ((f0-25 (sqrtf (+ (* f30-5 f30-5) (* f28-0 f28-0))))) - (set! (-> obj route surface-dist) f0-25) - (set! (-> obj route total-dist) (+ 20480.0 f0-25)) + (set! (-> this route surface-dist) f0-25) + (set! (-> this route total-dist) (+ 20480.0 f0-25)) ) ) - (set! (-> obj route total-travel-time) - (the-as time-frame (the int (/ (-> obj route total-dist) (* 0.016666668 (-> obj speed))))) + (set! (-> this route total-travel-time) + (the-as time-frame (the int (/ (-> this route total-dist) (* 0.016666668 (-> this speed))))) ) (none) ) -(defmethod gnawer-method-22 gnawer ((obj gnawer) (arg0 float)) +(defmethod gnawer-method-22 gnawer ((this gnawer) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'bounding-box)) (a3-0 #t) (gp-0 #t) ) (dotimes (s2-0 10) - (let ((v1-4 (-> obj segments s2-0 place))) + (let ((v1-4 (-> this segments s2-0 place))) (cond ((>= v1-4 0) (let ((f0-1 (- arg0 (* 3891.2 (the float v1-4))))) @@ -527,80 +527,80 @@ (set! f0-1 0.0) (set! gp-0 #f) ) - ((>= f0-1 (-> obj route total-dist)) - (set! f0-1 (-> obj route total-dist)) + ((>= f0-1 (-> this route total-dist)) + (set! f0-1 (-> this route total-dist)) ) (else (set! gp-0 #f) ) ) - (gnawer-method-21 obj s2-0 s4-0 a3-0 f0-1) + (gnawer-method-21 this s2-0 s4-0 a3-0 f0-1) ) ) (else - (gnawer-method-20 obj s2-0) + (gnawer-method-20 this s2-0) ) ) ) (set! a3-0 #f) ) (set-vector! - (-> obj root-override trans) + (-> this root-override trans) (* 0.5 (+ (-> s4-0 min x) (-> s4-0 max x))) (* 0.5 (+ (-> s4-0 min y) (-> s4-0 max y))) (* 0.5 (+ (-> s4-0 min z) (-> s4-0 max z))) 1.0 ) - (let* ((f0-10 (- (-> s4-0 max x) (-> obj root-override trans x))) - (f1-12 (- (-> s4-0 max y) (-> obj root-override trans y))) - (f2-7 (- (-> s4-0 max z) (-> obj root-override trans z))) + (let* ((f0-10 (- (-> s4-0 max x) (-> this root-override trans x))) + (f1-12 (- (-> s4-0 max y) (-> this root-override trans y))) + (f2-7 (- (-> s4-0 max z) (-> this root-override trans z))) (f0-14 (sqrtf (+ (* f0-10 f0-10) (* f1-12 f1-12) (* f2-7 f2-7)))) - (a0-3 (-> obj draw bounds)) - (v1-21 (-> obj root-override root-prim)) + (a0-3 (-> this draw bounds)) + (v1-21 (-> this root-override root-prim)) (f0-15 (+ 12288.0 f0-14)) ) (vector-reset! a0-3) (set! (-> a0-3 w) f0-15) (vector-reset! (-> v1-21 local-sphere)) (set! (-> v1-21 local-sphere w) f0-15) - (set! (-> v1-21 prim-core world-sphere quad) (-> obj root-override trans quad)) + (set! (-> v1-21 prim-core world-sphere quad) (-> this root-override trans quad)) (set! (-> v1-21 prim-core world-sphere w) f0-15) ) gp-0 ) ) -(defmethod gnawer-method-21 gnawer ((obj gnawer) (arg0 int) (arg1 bounding-box) (arg2 symbol) (arg3 float)) - (let ((gp-0 (-> obj segments arg0))) - (let ((f0-1 (+ 10240.0 (-> obj route surface-dist)))) +(defmethod gnawer-method-21 gnawer ((this gnawer) (arg0 int) (arg1 bounding-box) (arg2 symbol) (arg3 float)) + (let ((gp-0 (-> this segments arg0))) + (let ((f0-1 (+ 10240.0 (-> this route surface-dist)))) (cond ((< arg3 10240.0) (let ((f0-3 (* 0.00009765625 arg3))) - (vector-float*! (-> gp-0 world-pos) (-> obj route src-pt-offset) f0-3) + (vector-float*! (-> gp-0 world-pos) (-> this route src-pt-offset) f0-3) ) - (set! (-> gp-0 world-pos y) (-> obj route src-pt-offset y)) - (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> obj post-trans)) + (set! (-> gp-0 world-pos y) (-> this route src-pt-offset y)) + (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> this post-trans)) ) ((< arg3 f0-1) - (let* ((f30-0 (/ (+ -10240.0 arg3) (-> obj route surface-dist))) - (f28-0 (+ (* (-> obj route delta-ang) f30-0) (-> obj route src-ang))) + (let* ((f30-0 (/ (+ -10240.0 arg3) (-> this route surface-dist))) + (f28-0 (+ (* (-> this route delta-ang) f30-0) (-> this route src-ang))) ) (set-vector! (-> gp-0 world-pos) (* 10240.0 (sin f28-0)) - (lerp (-> obj route src-pt-offset y) (-> obj route dest-pt-offset y) f30-0) + (lerp (-> this route src-pt-offset y) (-> this route dest-pt-offset y) f30-0) (* 10240.0 (cos f28-0)) 1.0 ) ) - (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> obj post-trans)) + (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> this post-trans)) ) (else (let ((f0-19 (- 1.0 (* 0.00009765625 (- arg3 f0-1))))) - (vector-float*! (-> gp-0 world-pos) (-> obj route dest-pt-offset) f0-19) + (vector-float*! (-> gp-0 world-pos) (-> this route dest-pt-offset) f0-19) ) - (set! (-> gp-0 world-pos y) (-> obj route dest-pt-offset y)) - (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> obj post-trans)) + (set! (-> gp-0 world-pos y) (-> this route dest-pt-offset y)) + (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> this post-trans)) ) ) ) @@ -614,13 +614,13 @@ ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector-! s4-1 (-> gp-0 world-pos) (-> obj post-trans)) + (vector-! s4-1 (-> gp-0 world-pos) (-> this post-trans)) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) (let ((f0-24 (atan (-> s4-1 x) (-> s4-1 z))) (s3-1 (new 'stack-no-clear 'vector)) ) - (vector-rotate-around-y! s3-1 (-> obj route surface-dir) f0-24) + (vector-rotate-around-y! s3-1 (-> this route surface-dir) f0-24) (set! (-> gp-0 orient-mat vector 1 quad) (-> s4-1 quad)) (set! (-> gp-0 orient-mat vector 2 quad) (-> s3-1 quad)) ) @@ -637,9 +637,9 @@ ) ) -(defmethod gnawer-method-20 gnawer ((obj gnawer) (arg0 int)) - (let ((v1-3 (-> obj segments arg0)) - (a0-1 (-> obj segments (+ arg0 -1))) +(defmethod gnawer-method-20 gnawer ((this gnawer) (arg0 int)) + (let ((v1-3 (-> this segments arg0)) + (a0-1 (-> this segments (+ arg0 -1))) ) (set! (-> v1-3 world-pos quad) (-> a0-1 world-pos quad)) (let ((v0-0 (-> v1-3 orient-mat))) @@ -659,27 +659,27 @@ ) ) -(defmethod gnawer-method-25 gnawer ((obj gnawer)) +(defmethod gnawer-method-25 gnawer ((this gnawer)) (dotimes (s5-0 3) - (when (> (-> obj hit-points) 0) - (+! (-> obj hit-points) -1) - (+! (-> obj speed) 4096.0) - (when (> (-> obj hit-points) 0) - (set! (-> obj show-damage?) #t) - (let ((s4-0 (+ (-> obj hit-points) 2))) - (let ((s3-0 (-> obj segments s4-0))) + (when (> (-> this hit-points) 0) + (+! (-> this hit-points) -1) + (+! (-> this speed) 4096.0) + (when (> (-> this hit-points) 0) + (set! (-> this show-damage?) #t) + (let ((s4-0 (+ (-> this hit-points) 2))) + (let ((s3-0 (-> this segments s4-0))) (let ((s1-0 (new 'stack-no-clear 'vector)) (s2-0 (-> s3-0 world-pos)) ) - (vector-! s1-0 s2-0 (-> obj root-override trans)) + (vector-! s1-0 s2-0 (-> this root-override trans)) (set! (-> s1-0 y) 0.0) (vector-normalize! s1-0 1.0) - (process-spawn gnawer-falling-segment obj s2-0 s1-0 :to obj) + (process-spawn gnawer-falling-segment this s2-0 s1-0 :to this) ) (set! (-> s3-0 place) -1) ) (while (< s4-0 10) - (let ((v1-20 (-> obj segments s4-0))) + (let ((v1-20 (-> this segments s4-0))) (if (>= (-> v1-20 place) 0) (+! (-> v1-20 place) -1) ) @@ -691,10 +691,10 @@ ) ) (close-specific-task! (game-task cave-gnawers) (task-status need-hint)) - (<= (-> obj hit-points) 0) + (<= (-> this hit-points) 0) ) -(defmethod gnawer-method-28 gnawer ((obj gnawer) (arg0 int) (arg1 int)) +(defmethod gnawer-method-28 gnawer ((this gnawer) (arg0 int) (arg1 int)) (when (> arg0 0) (let* ((v1-1 (rand-vu-int-count arg0)) (a0-2 v1-1) @@ -712,42 +712,42 @@ (the-as symbol 0) ) -(defmethod gnawer-method-27 gnawer ((obj gnawer)) - (set! (-> obj eco-green-mask) (the-as uint 0)) - (let ((s4-0 (-> obj path curve num-cverts)) +(defmethod gnawer-method-27 gnawer ((this gnawer)) + (set! (-> this eco-green-mask) (the-as uint 0)) + (let ((s4-0 (-> this path curve num-cverts)) (s3-0 (get-death-count *game-info* #f)) - (s5-0 (-> obj money-mask)) + (s5-0 (-> this money-mask)) ) (when (and *target* (or (and (= s3-0 1) (and (>= 1.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.1))) (and (< 1 s3-0) (and (>= 2.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.05))) ) ) - (let ((v1-14 (gnawer-method-28 obj s4-0 (the-as int s5-0)))) + (let ((v1-14 (gnawer-method-28 this s4-0 (the-as int s5-0)))) (logior s5-0 (the-as uint v1-14)) - (set! (-> obj eco-green-mask) (the-as uint (logior (-> obj eco-green-mask) (the-as uint v1-14)))) + (set! (-> this eco-green-mask) (the-as uint (logior (-> this eco-green-mask) (the-as uint v1-14)))) ) ) ) (none) ) -(defmethod gnawer-method-29 gnawer ((obj gnawer) (arg0 int) (arg1 vector) (arg2 vector)) - (let ((s1-0 (-> obj path curve num-cverts)) +(defmethod gnawer-method-29 gnawer ((this gnawer) (arg0 int) (arg1 vector) (arg2 vector)) + (let ((s1-0 (-> this path curve num-cverts)) (s2-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (eval-path-curve-div! (-> obj path) s2-0 0.0 'interp) + (eval-path-curve-div! (-> this path) s2-0 0.0 'interp) (let* ((f30-0 (-> s2-0 y)) (f28-0 f30-0) ) - (eval-path-curve-div! (-> obj path) s2-0 (the float (+ s1-0 -1)) 'interp) + (eval-path-curve-div! (-> this path) s2-0 (the float (+ s1-0 -1)) 'interp) (let ((f30-1 (fmin f30-0 (-> s2-0 y))) (f28-1 (fmax f28-0 (-> s2-0 y))) ) - (eval-path-curve-div! (-> obj path) arg1 (the float arg0) 'interp) - (vector-! arg2 arg1 (-> obj post-trans)) + (eval-path-curve-div! (-> this path) arg1 (the float arg0) 'interp) + (vector-! arg2 arg1 (-> this post-trans)) (let ((f0-9 (+ 16384.0 (* 16384.0 (/ (fmax 0.0 (- (-> arg2 y) f30-1)) (- f28-1 f30-1)))))) (set! (-> arg2 y) 0.0) (vector-normalize! arg2 f0-9) @@ -755,25 +755,25 @@ ) ) ) - (vector+! arg2 arg2 (-> obj post-trans)) + (vector+! arg2 arg2 (-> this post-trans)) (set! (-> arg2 y) (+ 4096.0 (-> arg2 y))) ) -(defmethod gnawer-method-30 gnawer ((obj gnawer) (arg0 process-drawable)) +(defmethod gnawer-method-30 gnawer ((this gnawer) (arg0 process-drawable)) (local-vars (sv-48 vector)) - (let ((gp-0 (-> obj entity extra perm))) + (let ((gp-0 (-> this entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) (let ((s5-0 (-> gp-0 user-uint16 0)) (s2-0 -1) ) (let ((f30-0 0.0) - (s1-0 (-> obj path curve num-cverts)) + (s1-0 (-> this path curve num-cverts)) ) (dotimes (s0-0 s1-0) (when (logtest? (ash 1 s0-0) s5-0) (let ((a2-0 (new 'stack-no-clear 'vector))) (set! sv-48 (new 'stack-no-clear 'vector)) - (gnawer-method-29 obj s0-0 a2-0 sv-48) + (gnawer-method-29 this s0-0 a2-0 sv-48) ) (let* ((t9-1 vector-vector-xz-distance) (a1-2 (-> arg0 root trans)) @@ -933,9 +933,9 @@ :code (behavior () (set! (-> self draw origin-joint-index) (the-as uint 0)) (gnawer-method-23 self) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (rand-vu-int-range 240 360))) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + (until (time-elapsed? (-> self state-time) gp-0) (suspend) ) ) @@ -968,7 +968,7 @@ ) ) (else - (if (< (- (-> *display* base-frame-counter) (-> self last-hit-time)) (seconds 0.5)) + (if (not (time-elapsed? (-> self last-hit-time) (seconds 0.5))) (return #f) ) (let* ((a2-1 (the-as object (-> block param 0))) @@ -998,7 +998,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self route-dist) 0.0) (gnawer-method-24 self) - (set! (-> self last-hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hit-time)) (gnawer-method-26 self) ) :exit (behavior () @@ -1006,7 +1006,7 @@ (stop! (-> self sound)) ) :trans (behavior () - (+! (-> self route-dist) (* (-> self speed) (-> *display* seconds-per-frame))) + (+! (-> self route-dist) (* (-> self speed) (seconds-per-frame))) (if (gnawer-method-22 self (-> self route-dist)) (go gnawer-wait-to-run) ) @@ -1054,7 +1054,7 @@ (vector-normalize! (-> self root-override transv) 32768.0) ) :trans (behavior () - (+! (-> self root-override transv y) (* -409600.0 (-> *display* seconds-per-frame))) + (+! (-> self root-override transv y) (* -409600.0 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self fall-trans quad)) (vector-v+! (-> self fall-trans) (-> self fall-trans) (-> self root-override transv)) @@ -1130,8 +1130,8 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.05)) (suspend) ) ) @@ -1295,40 +1295,40 @@ (none) ) -(defmethod deactivate gnawer ((obj gnawer)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate gnawer ((this gnawer)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj sound2)) - (stop! (-> obj sound2)) + (if (nonzero? (-> this sound2)) + (stop! (-> this sound2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod relocate gnawer ((obj gnawer) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate gnawer ((this gnawer) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj sound2)) - (&+! (-> obj sound2) arg0) + (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 obj) arg0) + ((the-as (function nav-enemy int nav-enemy) (find-parent-method gnawer 7)) (the-as nav-enemy this) arg0) ) ) -(defmethod init-from-entity! gnawer ((obj gnawer) (arg0 entity-actor)) +(defmethod init-from-entity! gnawer ((this gnawer) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) - (set! (-> obj hidden?) #f) - (set! (-> obj show-damage?) #f) - (set! (-> obj hit-points) 6) - (set! (-> obj speed) 24576.0) - (set! (-> obj last-hit-time) 0) - (set! (-> obj route-dist) 0.0) - (logclear! (-> obj mask) (process-mask attackable)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this hidden?) #f) + (set! (-> this show-damage?) #f) + (set! (-> this hit-points) 6) + (set! (-> this speed) 24576.0) + (set! (-> this last-hit-time) 0) + (set! (-> this route-dist) 0.0) + (logclear! (-> this mask) (process-mask attackable)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 8) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1401,55 +1401,55 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (quaternion-identity! (-> obj root-override quat)) - (initialize-skeleton obj *gnawer-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 8)) - (set! (-> obj post-trans quad) (-> obj root-override trans quad)) - (let ((f0-40 (res-lump-float (-> obj entity) 'rotoffset))) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-40) + (process-drawable-from-entity! this arg0) + (quaternion-identity! (-> this root-override quat)) + (initialize-skeleton this *gnawer-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 8)) + (set! (-> this post-trans quad) (-> this root-override trans quad)) + (let ((f0-40 (res-lump-float (-> this entity) 'rotoffset))) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-40) ) - (+! (-> obj root-override trans y) -2048.0) + (+! (-> this root-override trans y) -2048.0) (set! sv-16 (new 'static 'res-tag)) (let ((v1-81 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-81 - (+! (-> obj root-override trans x) (-> v1-81 0)) - (+! (-> obj root-override trans y) (-> v1-81 1)) - (+! (-> obj root-override trans z) (-> v1-81 2)) + (+! (-> this root-override trans x) (-> v1-81 0)) + (+! (-> this root-override trans y) (-> v1-81 1)) + (+! (-> this root-override trans z) (-> v1-81 2)) ) ) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (if (< (-> obj path curve num-cverts) 2) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 330) obj)) - (set! (-> obj total-money) 0) - (set! (-> obj money-mask) (the-as uint 0)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 330) this)) + (set! (-> this total-money) 0) + (set! (-> this money-mask) (the-as uint 0)) (set! sv-32 (new 'static 'res-tag)) (let ((v1-96 (res-lump-data arg0 'extra-count (pointer int32) :tag-ptr (& sv-32)))) (when v1-96 (case (-> v1-96 0) ((5) - (set! (-> obj total-money) (-> v1-96 1)) + (set! (-> this total-money) (-> v1-96 1)) ) ) ) ) - (when (> (-> obj total-money) 0) + (when (> (-> this total-money) 0) (set! sv-48 (new 'static 'res-tag)) (let ((a0-49 (res-lump-data arg0 'gnawer (pointer int32) :tag-ptr (& sv-48)))) (cond (a0-49 (let ((v1-100 0)) - (dotimes (a1-30 (-> obj total-money)) + (dotimes (a1-30 (-> this total-money)) (let ((a3-15 (-> a0-49 a1-30))) (set! v1-100 (logior v1-100 (ash 1 a3-15))) ) ) - (set! (-> obj money-mask) (the-as uint v1-100)) + (set! (-> this money-mask) (the-as uint v1-100)) ) ) (else @@ -1458,30 +1458,30 @@ ) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 329) obj)) - (set! (-> obj sound) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 329) this)) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "gnawer-crawl" :fo-min 30 :fo-max 30) - (-> obj root-override trans) + (-> this root-override trans) ) ) - (set! (-> obj sound2) - (new 'process 'ambient-sound (static-sound-spec "gnawer-chew" :fo-max 40) (-> obj root-override trans)) + (set! (-> this sound2) + (new 'process 'ambient-sound (static-sound-spec "gnawer-chew" :fo-max 40) (-> this root-override trans)) ) (dotimes (v1-110 10) - (let ((a0-59 (-> obj segments v1-110))) + (let ((a0-59 (-> this segments v1-110))) (set! (-> a0-59 place) v1-110) - (set! (-> a0-59 world-pos quad) (-> obj post-trans quad)) + (set! (-> a0-59 world-pos quad) (-> this post-trans quad)) (vector-reset! (-> a0-59 anim-to-local-trans-offset)) (+! (-> a0-59 anim-to-local-trans-offset z) (* 5447.68 (the float v1-110))) ) ) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj gnawer-id) (+ (actor-count-before (-> obj link)) 1)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this gnawer-id) (+ (actor-count-before (-> this link)) 1)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go gnawer-put-items-at-dest) (go gnawer-chewing-on-post) ) diff --git a/goal_src/jak1/levels/maincave/maincave-obs.gc b/goal_src/jak1/levels/maincave/maincave-obs.gc index 216a78d0da..79e003df7b 100644 --- a/goal_src/jak1/levels/maincave/maincave-obs.gc +++ b/goal_src/jak1/levels/maincave/maincave-obs.gc @@ -22,8 +22,8 @@ :bounds (static-spherem 0 0 0 10) ) -(defmethod set-stack-size! maincavecam ((obj maincavecam)) - (stack-size-set! (-> obj main-thread) 512) +(defmethod set-stack-size! maincavecam ((this maincavecam)) + (stack-size-set! (-> this main-thread) 512) (none) ) @@ -88,20 +88,20 @@ ) ) -(defmethod water-vol-method-22 cave-water ((obj cave-water)) +(defmethod water-vol-method-22 cave-water ((this cave-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) + (set! (-> this draw ripple) v1-2) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) (set! (-> v1-2 waveform) ripple-for-cave-water) ) - (case (-> obj look) + (case (-> this look) ((37 14) - (set-vector! (-> obj draw color-mult) 0.2 0.1 0.3 0.75) + (set-vector! (-> this draw color-mult) 0.2 0.1 0.3 0.75) ) ) (none) @@ -155,8 +155,8 @@ :post ja-post ) -(defmethod init-from-entity! cavecrusher ((obj cavecrusher) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! cavecrusher ((this cavecrusher) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -168,24 +168,24 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *cavecrusher-sg* '()) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> obj root-override trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *cavecrusher-sg* '()) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> this root-override trans)) ) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (go cavecrusher-idle) (none) ) @@ -240,8 +240,8 @@ :virtual #t :code (behavior () (when (nonzero? (-> self delay-before-wiggle)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay-before-wiggle)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (-> self delay-before-wiggle)) (suspend) ) ) @@ -302,9 +302,9 @@ :post pusher-post ) -(defmethod init-from-entity! cavetrapdoor ((obj cavetrapdoor) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! cavetrapdoor ((this cavetrapdoor) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -322,38 +322,38 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *cavetrapdoor-sg* '()) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *cavetrapdoor-sg* '()) (ja-channel-push! 1 0) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (let ((f0-7 (quaternion-y-angle (-> obj root-override quat))) - (s4-2 (-> obj draw bounds)) + (update-transforms! (-> this root-override)) + (let ((f0-7 (quaternion-y-angle (-> this root-override quat))) + (s4-2 (-> this draw bounds)) ) (set-vector! s4-2 0.0 -8192.0 4096.0 1.0) (vector-rotate-around-y! s4-2 s4-2 f0-7) (set! (-> s4-2 w) 25600.0) ) - (set! (-> obj delay-before-wiggle) (the int (* 300.0 (res-lump-float arg0 'delay)))) + (set! (-> this delay-before-wiggle) (the int (* 300.0 (res-lump-float arg0 'delay)))) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) -1 8192.0 ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -435,7 +435,7 @@ (let ((s4-0 (new 'stack 'attack-info))) (calc-shove-up (-> self root-override) s4-0 (-> self shove-up)) (if (or (= (-> *target* control unknown-surface00 mode) 'air) - (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) + (>= (+ (current-time) (seconds -0.2)) (-> *target* control unknown-dword11)) (< 0.75 (-> *target* control poly-normal y)) ) (send-event @@ -466,7 +466,7 @@ :trans (behavior () (let* ((v1-0 (-> self cycle-speed)) (a0-1 (- v1-0 (-> self cycle-pause))) - (gp-0 (mod (+ (-> *display* base-frame-counter) (the-as time-frame (-> self cycle-offset))) v1-0)) + (gp-0 (mod (+ (current-time) (the-as time-frame (-> self cycle-offset))) v1-0)) ) (cond ((< gp-0 a0-1) @@ -515,15 +515,15 @@ ) ) -(defmethod init-from-entity! caveflamepots ((obj caveflamepots) (arg0 entity-actor)) +(defmethod init-from-entity! caveflamepots ((this caveflamepots) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) - (set! (-> obj was-deadly?) #f) - (set! (-> obj should-play-sound?) #f) - (set! (-> obj shove-up) (res-lump-float arg0 'shove :default 8192.0)) - (logclear! (-> obj mask) (process-mask enemy)) - (logclear! (-> obj mask) (process-mask attackable)) - (logior! (-> obj mask) (process-mask actor-pause)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (set! (-> this was-deadly?) #f) + (set! (-> this should-play-sound?) #f) + (set! (-> this shove-up) (res-lump-float arg0 'shove :default 8192.0)) + (logclear! (-> this mask) (process-mask enemy)) + (logclear! (-> this mask) (process-mask attackable)) + (logior! (-> this mask) (process-mask actor-pause)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -561,11 +561,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (let ((v1-42 (new 'process 'path-control obj 'path 0.0))) - (set! (-> obj path) v1-42) + (process-drawable-from-entity! this arg0) + (let ((v1-42 (new 'process 'path-control this 'path 0.0))) + (set! (-> this path) v1-42) (logior! (-> v1-42 flags) (path-control-flag display draw-line draw-point draw-text)) (if (<= (-> v1-42 curve num-cverts) 0) (go process-drawable-art-error "no path") @@ -573,11 +573,11 @@ ) (let ((f0-23 (res-lump-float arg0 'rotoffset))) (if (!= f0-23 0.0) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-23) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-23) ) ) - (let ((f30-0 (quaternion-y-angle (-> obj root-override quat)))) - (let ((s4-1 (-> obj launch-pos))) + (let ((f30-0 (quaternion-y-angle (-> this root-override quat)))) + (let ((s4-1 (-> this launch-pos))) (let ((v1-53 s4-1)) (set! (-> v1-53 0 x) 6144.0) (set! (-> v1-53 0 y) 0.0) @@ -585,14 +585,14 @@ (set! (-> v1-53 0 w) 1.0) ) (vector-rotate-around-y! (the-as vector s4-1) (the-as vector s4-1) f30-0) - (vector+! (the-as vector s4-1) (the-as vector s4-1) (-> obj root-override trans)) + (vector+! (the-as vector s4-1) (the-as vector s4-1) (-> this root-override trans)) ) - (let ((s4-2 (the-as object (&-> obj stack 112)))) + (let ((s4-2 (the-as object (&-> this stack 112)))) (set-vector! (the-as vector s4-2) -6144.0 0.0 0.0 1.0) (vector-rotate-around-y! (the-as vector s4-2) (the-as vector s4-2) f30-0) - (vector+! (the-as vector s4-2) (the-as vector s4-2) (-> obj root-override trans)) + (vector+! (the-as vector s4-2) (the-as vector s4-2) (-> this root-override trans)) ) - (let ((s4-3 (-> obj root-override root-prim))) + (let ((s4-3 (-> this root-override root-prim))) (dotimes (s3-1 (-> (the-as collide-shape-prim-group s4-3) num-prims)) (let ((a1-19 (-> (the-as collide-shape-prim-group s4-3) prims s3-1 local-sphere))) (vector-rotate-around-y! a1-19 a1-19 f30-0) @@ -600,23 +600,23 @@ ) ) ) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (let ((f30-1 300.0)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-70 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-16)))) - (set! (-> obj cycle-speed) (the int (* f30-1 (if (and v1-70 (> (the-as int (-> sv-16 elt-count)) 0)) - (-> v1-70 0) - 4.0 - ) - ) - ) + (set! (-> this cycle-speed) (the int (* f30-1 (if (and v1-70 (> (the-as int (-> sv-16 elt-count)) 0)) + (-> v1-70 0) + 4.0 + ) + ) + ) ) ) ) - (let ((f30-2 (the float (-> obj cycle-speed)))) + (let ((f30-2 (the float (-> this cycle-speed)))) (set! sv-32 (new 'static 'res-tag)) (let ((v1-74 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-32)))) - (set! (-> obj cycle-offset) + (set! (-> this cycle-offset) (the-as uint (the int (* f30-2 (if (and v1-74 (< 1 (the-as int (-> sv-32 elt-count)))) (-> v1-74 1) 0.0 @@ -630,12 +630,12 @@ (let ((f30-3 300.0)) (set! sv-48 (new 'static 'res-tag)) (let ((v1-77 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-48)))) - (set! (-> obj cycle-pause) (the int (* f30-3 (if (and v1-77 (< 2 (the-as int (-> sv-48 elt-count)))) - (-> v1-77 2) - 2.0 - ) - ) - ) + (set! (-> this cycle-pause) (the int (* f30-3 (if (and v1-77 (< 2 (the-as int (-> sv-48 elt-count)))) + (-> v1-77 2) + 2.0 + ) + ) + ) ) ) ) @@ -684,9 +684,9 @@ :post rider-post ) -(defmethod init-from-entity! cavespatula ((obj cavespatula) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! cavespatula ((this cavespatula) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -704,51 +704,56 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> obj root-override trans)) + (process-drawable-from-entity! this arg0) + (set! (-> this sound) + (new + 'process + 'ambient-sound + (static-sound-spec "spatula" :fo-min 25 :fo-max 50) + (-> this root-override trans) + ) ) - (case (-> (if (-> obj entity) - (-> obj entity extra level) + (case (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name ) (('darkcave) - (initialize-skeleton obj *cavespatula-darkcave-sg* '()) + (initialize-skeleton this *cavespatula-darkcave-sg* '()) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) ) (else - (initialize-skeleton obj *cavespatula-sg* '()) + (initialize-skeleton this *cavespatula-sg* '()) (ja-channel-push! 1 0) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) ) ) - (logior! (-> obj skel status) (janim-status inited)) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) + (logior! (-> this skel status) (janim-status inited)) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) -1 32768.0 @@ -794,9 +799,9 @@ :post rider-post ) -(defmethod init-from-entity! cavespatulatwo ((obj cavespatulatwo) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! cavespatulatwo ((this cavespatulatwo) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -814,25 +819,29 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *cavespatulatwo-sg* '()) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj skel status) (janim-status inited)) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *cavespatulatwo-sg* '()) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this skel status) (janim-status inited)) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> obj root-override trans)) + (set! (-> this sound) (new + 'process + 'ambient-sound + (static-sound-spec "spatula" :fo-min 25 :fo-max 50) + (-> this root-override trans) + ) ) (go cavespatulatwo-idle) (none) @@ -891,15 +900,15 @@ ) ) -(defmethod caveelevator-method-20 caveelevator ((obj caveelevator)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-update-bounce-time)) - (set! (-> obj last-update-bounce-time) v1-1) - (when (!= (-> obj smush amp) 0.0) +(defmethod caveelevator-method-20 caveelevator ((this caveelevator)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-update-bounce-time)) + (set! (-> this last-update-bounce-time) v1-1) + (when (!= (-> this smush amp) 0.0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj orig-trans quad)) - (+! (-> s5-0 y) (* 819.2 (update! (-> obj smush)))) - (move-to-point! (-> obj root-override) s5-0) + (set! (-> s5-0 quad) (-> this orig-trans quad)) + (+! (-> s5-0 y) (* 819.2 (update! (-> this smush)))) + (move-to-point! (-> this root-override) s5-0) ) ) ) @@ -907,12 +916,12 @@ (none) ) -(defmethod caveelevator-method-21 caveelevator ((obj caveelevator)) +(defmethod caveelevator-method-21 caveelevator ((this caveelevator)) (let ((s5-0 (new 'stack-no-clear 'vector)) - (gp-0 (-> obj draw bounds)) + (gp-0 (-> this draw bounds)) ) - (vector<-cspace! s5-0 (-> obj node-list data 3)) - (vector-! gp-0 s5-0 (-> obj root-override trans)) + (vector<-cspace! s5-0 (-> this node-list data 3)) + (vector-! gp-0 s5-0 (-> this root-override trans)) (set! (-> gp-0 w) 17408.0) ) ) @@ -1031,17 +1040,17 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (cond ((zero? (-> self root-override riders num-riders)) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go caveelevator-one-way-travel-to-start) ) ) (else - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) ) (rider-trans) @@ -1113,12 +1122,12 @@ (none) ) -(defmethod init-from-entity! caveelevator ((obj caveelevator) (arg0 entity-actor)) +(defmethod init-from-entity! caveelevator ((this caveelevator) (arg0 entity-actor)) (local-vars (v1-43 int) (sv-16 res-tag)) - (set! (-> obj prev-frame-num) 10000.0) - (set! (-> obj last-update-bounce-time) 0) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> this prev-frame-num) 10000.0) + (set! (-> this last-update-bounce-time) 0) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1136,61 +1145,61 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *caveelevator-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj skel postbind-function) caveelevator-joint-callback) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *caveelevator-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this skel postbind-function) caveelevator-joint-callback) (set! sv-16 (new 'static 'res-tag)) (let ((v1-28 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-28 - (+! (-> obj root-override trans x) (-> v1-28 0)) - (+! (-> obj root-override trans y) (-> v1-28 1)) - (+! (-> obj root-override trans z) (-> v1-28 2)) + (+! (-> this root-override trans x) (-> v1-28 0)) + (+! (-> this root-override trans y) (-> v1-28 1)) + (+! (-> this root-override trans z) (-> v1-28 2)) ) ) - (set! (-> obj orig-trans quad) (-> obj root-override trans quad)) - (let ((f0-13 (res-lump-float (-> obj entity) 'rotoffset))) + (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (let ((f0-13 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-13 0.0) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-13) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-13) ) ) - (let ((f0-14 (quaternion-y-angle (-> obj root-override quat)))) - (matrix-rotate-y! (-> obj wheel-ry-mat) f0-14) + (let ((f0-14 (quaternion-y-angle (-> this root-override quat)))) + (matrix-rotate-y! (-> this wheel-ry-mat) f0-14) ) - (set-zero! (-> obj smush)) + (set-zero! (-> this smush)) (let ((s5-1 (res-lump-value arg0 'mode uint128))) 0 - (set! (-> obj elev-type) (the-as int s5-1)) + (set! (-> this elev-type) (the-as int s5-1)) (let ((v1-42 s5-1)) (cond ((zero? v1-42) (set! v1-43 0) - (set! (-> obj anim 0) 2) + (set! (-> this anim 0) 2) ) ((= (the-as uint v1-42) 1) (set! v1-43 1) - (set! (-> obj anim 0) 3) - (set! (-> obj anim 1) 4) + (set! (-> this anim 0) 3) + (set! (-> this anim 1) 4) ) ((= (the-as uint v1-42) 2) (set! v1-43 0) - (set! (-> obj anim 0) 5) + (set! (-> this anim 0) 5) ) (else (set! v1-43 0) - (set! (-> obj anim 0) 2) - (set! (-> obj elev-type) (the-as int s5-1)) + (set! (-> this anim 0) 2) + (set! (-> this elev-type) (the-as int s5-1)) ) ) ) - (set! (-> obj elev-mode) (the-as uint v1-43)) + (set! (-> this elev-mode) (the-as uint v1-43)) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data (-> obj anim 0))) + (the-as art-joint-anim (-> this draw art-group data (-> this anim 0))) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) @@ -1198,16 +1207,16 @@ (if (= (the-as uint s5-1) 1) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-caveelevator-callback) 3 8192.0 ) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) 3 8192.0 @@ -1215,10 +1224,10 @@ ) ) (transform-post) - (let ((v1-55 (-> obj elev-mode))) + (let ((v1-55 (-> this elev-mode))) (cond ((zero? v1-55) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (go caveelevator-cycle-active) ) ((= v1-55 1) diff --git a/goal_src/jak1/levels/maincave/mother-spider-egg.gc b/goal_src/jak1/levels/maincave/mother-spider-egg.gc index 0f4774824c..19c34daadb 100644 --- a/goal_src/jak1/levels/maincave/mother-spider-egg.gc +++ b/goal_src/jak1/levels/maincave/mother-spider-egg.gc @@ -155,17 +155,17 @@ ) ) -(defmethod draw-egg-shadow mother-spider-egg ((obj mother-spider-egg) (arg0 vector) (arg1 symbol)) +(defmethod draw-egg-shadow mother-spider-egg ((this mother-spider-egg) (arg0 vector) (arg1 symbol)) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result)) (a1-1 (new 'stack-no-clear 'vector)) (a2-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> obj root-override trans quad)) + (set! (-> a1-1 quad) (-> this root-override trans quad)) (+! (-> a1-1 y) 1228.8) (set-vector! a2-1 0.0 -61440.0 0.0 1.0) (cond @@ -175,28 +175,28 @@ a2-1 7372.8 (collide-kind background) - obj + this s5-0 (new 'static 'pat-surface :noentity #x1) ) 0.0 ) - (let ((v1-11 (-> obj draw shadow-ctrl))) + (let ((v1-11 (-> this draw shadow-ctrl))) (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (set! (-> v1-14 settings bot-plane w) (- (+ -4096.0 (-> s5-0 intersect y)))) ) 0 - (let ((v1-17 (-> obj draw shadow-ctrl))) + (let ((v1-17 (-> this draw shadow-ctrl))) (set! (-> v1-17 settings top-plane w) (- (+ 6144.0 (-> s5-0 intersect y)))) ) 0 (return #t) ) (else - (let ((v1-22 (-> obj draw shadow-ctrl))) + (let ((v1-22 (-> this draw shadow-ctrl))) (logior! (-> v1-22 settings flags) (shadow-flags disable-draw)) ) 0 @@ -205,7 +205,7 @@ ) ) (else - (let ((v1-25 (-> obj draw shadow-ctrl))) + (let ((v1-25 (-> this draw shadow-ctrl))) (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 @@ -223,13 +223,10 @@ ) ) :enter (behavior () - (set! (-> self falling-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self falling-start-time)) ) :trans (behavior () - (let ((f30-0 - (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) - ) - ) + (let ((f30-0 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) (let ((f28-0 (/ f30-0 (-> self traj time)))) (eval-position! (-> self traj) f30-0 (-> self root-override trans)) (let ((f0-3 (lerp 0.3 0.4 f28-0))) @@ -275,13 +272,13 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (not (draw-egg-shadow self (-> self shadow-pos) #t)) (set! (-> self shadow-pos quad) (-> self fall-dest quad)) ) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (go mother-spider-egg-hatch) ) (draw-egg-shadow self (-> self shadow-pos) #f) @@ -403,10 +400,7 @@ (defstate mother-spider-egg-die-while-falling (mother-spider-egg) :trans (behavior () - (let ((f0-2 - (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) - ) - ) + (let ((f0-2 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) (eval-position! (-> self traj) f0-2 (-> self root-override trans)) ) ) @@ -460,7 +454,7 @@ (defbehavior mother-spider-egg-init-by-other mother-spider-egg ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 vector)) (set! (-> self entity) arg0) (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.2)) - (set! (-> self falling-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self falling-start-time)) (set! (-> self fall-dest quad) (-> arg2 quad)) (set! (-> self fall-dest-normal quad) (-> arg3 quad)) (let ((s4-1 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) diff --git a/goal_src/jak1/levels/maincave/mother-spider-proj.gc b/goal_src/jak1/levels/maincave/mother-spider-proj.gc index c89f4312bc..e6440d1fc6 100644 --- a/goal_src/jak1/levels/maincave/mother-spider-proj.gc +++ b/goal_src/jak1/levels/maincave/mother-spider-proj.gc @@ -225,13 +225,13 @@ :parts ((sp-item 722)) ) -(defmethod projectile-method-24 mother-spider-proj ((obj mother-spider-proj)) +(defmethod projectile-method-24 mother-spider-proj ((this mother-spider-proj)) (with-pp - (spawn (-> obj part) (the-as vector (-> obj root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) - (set! (-> s5-0 id) (-> obj sound-id)) - (let ((a1-1 (-> obj root-override trans))) + (set! (-> s5-0 id) (-> this sound-id)) + (let ((a1-1 (-> this root-override trans))) (let ((s4-0 pp)) (when (= a1-1 #t) (if (and s4-0 (type-type? (-> s4-0 type) process-drawable) (nonzero? (-> (the-as process-drawable s4-0) root))) @@ -245,9 +245,9 @@ (set! (-> s5-0 parms mask) (sound-mask trans)) (-> s5-0 id) ) - (let ((f0-5 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (-> *display* base-frame-counter) 75))))))))) + (let ((f0-5 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (current-time) 75))))))))) (find-ground-and-draw-shadow - (-> obj root-override trans) + (-> this root-override trans) (the-as vector #f) f0-5 (collide-kind background) @@ -277,7 +277,7 @@ s3-2 s5-0 s4-0 - (* (-> arg0 max-turn) (-> *display* seconds-per-frame)) + (* (-> arg0 max-turn) (seconds-per-frame)) (-> arg0 tween) ) (vector-matrix*! s5-0 s5-0 s3-2) @@ -290,8 +290,8 @@ (none) ) -(defmethod projectile-method-26 mother-spider-proj ((obj mother-spider-proj)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod projectile-method-26 mother-spider-proj ((this mother-spider-proj)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) (set! (-> s5-0 no-reaction) @@ -311,43 +311,43 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (logclear! (-> obj mask) (process-mask enemy)) - (logclear! (-> obj mask) (process-mask crate)) - (logclear! (-> obj mask) (process-mask attackable)) - (logior! (-> obj mask) (process-mask projectile)) + (logclear! (-> this mask) (process-mask enemy)) + (logclear! (-> this mask) (process-mask crate)) + (logclear! (-> this mask) (process-mask attackable)) + (logior! (-> this mask) (process-mask projectile)) 0 (none) ) -(defmethod projectile-method-27 mother-spider-proj ((obj mother-spider-proj)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 326) obj)) - (set! (-> obj max-speed) 32768.0) - (set! (-> obj update-velocity) mother-spider-proj-update-velocity) - (set! (-> obj max-turn) 5916.4443) - (set! (-> obj tween) 0.02) - (set! (-> obj attack-mode) 'mother-spider-proj) - (set! (-> obj timeout) (seconds 4)) - (set! (-> obj target quad) (-> (target-pos 0) quad)) - (+! (-> obj target y) 4915.2) - (set! (-> obj target-base quad) (-> obj target quad)) - (set! (-> obj sound-id) (sound-play "mother-track")) +(defmethod projectile-method-27 mother-spider-proj ((this mother-spider-proj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 326) this)) + (set! (-> this max-speed) 32768.0) + (set! (-> this update-velocity) mother-spider-proj-update-velocity) + (set! (-> this max-turn) 5916.4443) + (set! (-> this tween) 0.02) + (set! (-> this attack-mode) 'mother-spider-proj) + (set! (-> this timeout) (seconds 4)) + (set! (-> this target quad) (-> (target-pos 0) quad)) + (+! (-> this target y) 4915.2) + (set! (-> this target-base quad) (-> this target quad)) + (set! (-> this sound-id) (sound-play "mother-track")) (sound-play "mother-fire") (none) ) -(defmethod projectile-method-28 mother-spider-proj ((obj mother-spider-proj)) +(defmethod projectile-method-28 mother-spider-proj ((this mother-spider-proj)) (when (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) ) - (let ((gp-0 (-> obj target))) + (let ((gp-0 (-> this target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (+! (-> gp-0 y) 4915.2) - (let ((f0-2 (vector-vector-distance gp-0 (-> obj root-override trans))) + (let ((f0-2 (vector-vector-distance gp-0 (-> this root-override trans))) (a2-0 (new 'stack-no-clear 'vector)) ) (if (>= 0.0 f0-2) @@ -355,8 +355,8 @@ ) (set! (-> a2-0 quad) (-> *target* control transv quad)) (set! (-> a2-0 y) 0.0) - (let ((f0-3 (/ f0-2 (* 32768.0 (-> *display* seconds-per-frame))))) - (vector+float*! gp-0 gp-0 a2-0 (* f0-3 (-> *display* seconds-per-frame))) + (let ((f0-3 (/ f0-2 (* 32768.0 (seconds-per-frame))))) + (vector+float*! gp-0 gp-0 a2-0 (* f0-3 (seconds-per-frame))) ) ) ) diff --git a/goal_src/jak1/levels/maincave/mother-spider.gc b/goal_src/jak1/levels/maincave/mother-spider.gc index e4b621e7e4..c8284d14a7 100644 --- a/goal_src/jak1/levels/maincave/mother-spider.gc +++ b/goal_src/jak1/levels/maincave/mother-spider.gc @@ -86,13 +86,13 @@ (vf2 :class vf) ) (init-vf0-vector) - (+! (-> self transv y) (* (-> self gravity) (-> *display* seconds-per-frame))) + (+! (-> self transv y) (* (-> self gravity) (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'collide-tri-result)) (a2-0 (new 'stack-no-clear 'vector)) ) (let ((v1-1 a2-0)) (.lvf vf1 (&-> (-> self transv) quad)) - (let ((f0-2 (-> *display* seconds-per-frame))) + (let ((f0-2 (seconds-per-frame))) (.mov at-0 f0-2) ) (.mov vf2 at-0) @@ -130,12 +130,12 @@ ) ) (vector-v+! (-> self root trans) (-> self root trans) (-> self transv)) - (+! (-> self facing-rot x) (* (-> self facing-rotv x) (-> *display* seconds-per-frame))) + (+! (-> self facing-rot x) (* (-> self facing-rotv x) (seconds-per-frame))) (set! (-> self facing-rot z) - (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (-> *display* seconds-per-frame))) + (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (seconds-per-frame))) ) (quaternion-zxy! (-> self root quat) (-> self facing-rot)) - (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) + (seek! (-> self root scale x) 0.0 (* 0.5 (seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) ) @@ -342,30 +342,30 @@ ) ) -(defmethod spawn-child mother-spider ((obj mother-spider) (arg0 vector) (arg1 vector) (arg2 symbol)) +(defmethod spawn-child mother-spider ((this mother-spider) (arg0 vector) (arg1 vector) (arg2 symbol)) (let ((s3-0 (new 'stack-no-clear 'baby-spider-spawn-params))) (init! s3-0 arg2 #f #t #f 7 1 'untrigger) (set-delay! s3-0 (seconds 9)) - (process-spawn baby-spider obj arg0 arg1 s3-0 :to obj) + (process-spawn baby-spider this arg0 arg1 s3-0 :to this) ) - (let ((v0-5 (+ (-> obj baby-count) 1))) - (set! (-> obj baby-count) v0-5) + (let ((v0-5 (+ (-> this baby-count) 1))) + (set! (-> this baby-count) v0-5) v0-5 ) ) -(defmethod is-player-stuck? mother-spider ((obj mother-spider)) +(defmethod is-player-stuck? mother-spider ((this mother-spider)) (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) (let* ((v1-10 (target-pos 0)) - (f0-1 (- (-> obj anchor-trans y) (-> v1-10 y))) - (f1-2 (- (-> obj player-sticky-dist-from-anchor) f0-1)) + (f0-1 (- (-> this anchor-trans y) (-> v1-10 y))) + (f1-2 (- (-> this player-sticky-dist-from-anchor) f0-1)) ) (when (or (< 8192.0 f1-2) (< f1-2 -8192.0)) - (set! (-> obj player-sticky-dist-from-anchor) f0-1) + (set! (-> this player-sticky-dist-from-anchor) f0-1) (return #t) ) ) @@ -373,26 +373,26 @@ #f ) -(defmethod mother-spider-method-27 mother-spider ((obj mother-spider)) +(defmethod mother-spider-method-27 mother-spider ((this mother-spider)) (none) ) -(defmethod mother-spider-method-28 mother-spider ((obj mother-spider)) +(defmethod mother-spider-method-28 mother-spider ((this mother-spider)) 0 (none) ) -(defmethod shadow-handler mother-spider ((obj mother-spider)) +(defmethod shadow-handler mother-spider ((this mother-spider)) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result)) (a1-0 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> obj root-override trans quad)) + (set! (-> a1-0 quad) (-> this root-override trans quad)) (set-vector! a2-0 0.0 -81920.0 0.0 1.0) (+! (-> a1-0 y) -8192.0) (cond @@ -402,32 +402,32 @@ a2-0 8192.0 (collide-kind background) - obj + this s5-0 (new 'static 'pat-surface :noentity #x1) ) 0.0 ) - (let ((v1-11 (-> obj draw shadow-ctrl))) + (let ((v1-11 (-> this draw shadow-ctrl))) (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (set! (-> v1-14 settings bot-plane w) (- (+ -6144.0 (-> s5-0 intersect y)))) ) 0 - (let ((v1-17 (-> obj draw shadow-ctrl))) + (let ((v1-17 (-> this draw shadow-ctrl))) (set! (-> v1-17 settings top-plane w) (- (+ 6144.0 (-> s5-0 intersect y)))) ) 0 - (let* ((f3-0 (vector-vector-distance (-> s5-0 intersect) (-> obj root-override trans))) + (let* ((f3-0 (vector-vector-distance (-> s5-0 intersect) (-> this root-override trans))) (f0-14 (* 0.000030517578 (fmin 32768.0 (fmax 0.0 (+ -57344.0 f3-0))))) ) - (set! (-> obj draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-14)) + (set! (-> this draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-14)) ) ) (else - (let ((v1-23 (-> obj draw shadow-ctrl))) + (let ((v1-23 (-> this draw shadow-ctrl))) (logior! (-> v1-23 settings flags) (shadow-flags disable-draw)) ) 0 @@ -436,7 +436,7 @@ ) ) (else - (let ((v1-25 (-> obj draw shadow-ctrl))) + (let ((v1-25 (-> this draw shadow-ctrl))) (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 @@ -444,16 +444,16 @@ ) ) -(defmethod grab-player? mother-spider ((obj mother-spider)) +(defmethod grab-player? mother-spider ((this mother-spider)) (when *target* (let ((s5-0 (target-pos 0))) - (when (and (>= 40960.0 (- (-> obj thread-min-trans y) (-> s5-0 y))) - (>= (-> obj activate-xz-dist) (vector-vector-xz-distance (-> obj thread-min-trans) s5-0)) + (when (and (>= 40960.0 (- (-> this thread-min-trans y) (-> s5-0 y))) + (>= (-> this activate-xz-dist) (vector-vector-xz-distance (-> this thread-min-trans) s5-0)) ) (cond - ((-> obj check-z-thresh?) - (let ((f0-3 (- (-> s5-0 z) (-> obj root-override trans z)))) - (if (>= (-> obj activate-z-thresh) f0-3) + ((-> this check-z-thresh?) + (let ((f0-3 (- (-> s5-0 z) (-> this root-override trans z)))) + (if (>= (-> this activate-z-thresh) f0-3) (return #t) ) ) @@ -468,18 +468,18 @@ #f ) -(defmethod letgo-player? mother-spider ((obj mother-spider)) +(defmethod letgo-player? mother-spider ((this mother-spider)) (if (not *target*) (return #t) ) (let ((a1-0 (target-pos 0))) - (when (-> obj check-z-thresh?) - (if (>= (- (-> a1-0 z) (-> obj root-override trans z)) (-> obj deactivate-z-thresh)) + (when (-> this check-z-thresh?) + (if (>= (- (-> a1-0 z) (-> this root-override trans z)) (-> this deactivate-z-thresh)) (return #t) ) ) - (if (or (>= (- (-> obj thread-min-trans y) (-> a1-0 y)) 49152.0) - (>= (vector-vector-xz-distance (-> obj thread-min-trans) a1-0) (-> obj deactivate-xz-dist)) + (if (or (>= (- (-> this thread-min-trans y) (-> a1-0 y)) 49152.0) + (>= (vector-vector-xz-distance (-> this thread-min-trans) a1-0) (-> this deactivate-xz-dist)) ) (return #t) ) @@ -487,19 +487,19 @@ #f ) -(defmethod mother-spider-method-21 mother-spider ((obj mother-spider) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod mother-spider-method-21 mother-spider ((this mother-spider) (arg0 vector) (arg1 float) (arg2 symbol)) (local-vars (sv-112 process) (sv-128 vector) (sv-144 vector)) - (let ((f30-0 (vector-length (-> obj swing-pos)))) + (let ((f30-0 (vector-length (-> this swing-pos)))) (when (< 0.0 f30-0) (let ((s1-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) ) - (vector-normalize-copy! s1-0 (-> obj swing-pos) 1.0) + (vector-normalize-copy! s1-0 (-> this swing-pos) 1.0) (vector-rotate-around-y! s2-0 s1-0 16384.0) (if (< (vector-dot arg0 s2-0) 0.0) (vector-negate! s2-0 s2-0) ) - (let ((f0-4 (fmin 1.0 (/ f30-0 (-> obj max-swing-radius))))) + (let ((f0-4 (fmin 1.0 (/ f30-0 (-> this max-swing-radius))))) (vector-lerp! arg0 arg0 s2-0 f0-4) ) ) @@ -508,28 +508,28 @@ ) (let ((s2-1 (new 'stack-no-clear 'vector))) (vector-float*! s2-1 arg0 arg1) - (vector-flatten! (-> obj swing-vel) (-> obj swing-vel) arg0) - (vector+! (-> obj swing-vel) (-> obj swing-vel) s2-1) + (vector-flatten! (-> this swing-vel) (-> this swing-vel) arg0) + (vector+! (-> this swing-vel) (-> this swing-vel) s2-1) ) - (set! (-> obj swing-vel y) 0.0) + (set! (-> this swing-vel y) 0.0) (when arg2 - (set! (-> obj hit?) #t) - (set! (-> obj spin-vel) 131072.0) - (set! (-> obj spin-time) (-> *display* base-frame-counter)) - (let ((s4-1 (-> obj damage)) - (s3-1 (-> obj root-override root-prim)) + (set! (-> this hit?) #t) + (set! (-> this spin-vel) 131072.0) + (set-time! (-> this spin-time)) + (let ((s4-1 (-> this damage)) + (s3-1 (-> this root-override root-prim)) ) (dotimes (s2-2 2) - (when (< (-> obj damage) 6) - (+! (-> obj damage) 1) - (logior! (-> obj leg-socket-part-mask) (ash 1 s4-1)) - (set! (-> obj leg-socket-part-time s4-1) (-> *display* base-frame-counter)) + (when (< (-> this damage) 6) + (+! (-> this damage) 1) + (logior! (-> this leg-socket-part-mask) (ash 1 s4-1)) + (set-time! (-> this leg-socket-part-time s4-1)) (let ((s1-1 (-> *mother-spider-leg-infos* s4-1))) (let ((s0-0 (new 'stack-no-clear 'vector))) (set! sv-128 (new 'stack-no-clear 'vector)) (set! sv-144 (new 'stack-no-clear 'vector)) - (vector<-cspace! s0-0 (-> obj node-list data (-> s1-1 joint-index0))) - (vector<-cspace! sv-128 (-> obj node-list data (-> s1-1 joint-index1))) + (vector<-cspace! s0-0 (-> this node-list data (-> s1-1 joint-index0))) + (vector<-cspace! sv-128 (-> this node-list data (-> s1-1 joint-index1))) (vector-! sv-128 sv-128 s0-0) (vector-normalize! sv-128 1.0) (vector-lerp! sv-144 sv-128 arg0 0.6) @@ -539,9 +539,9 @@ (set! sv-112 (get-process *default-dead-pool* mother-spider-leg #x4000)) (when sv-112 (let ((t9-15 (method-of-type mother-spider-leg activate))) - (t9-15 (the-as mother-spider-leg sv-112) obj 'mother-spider-leg (the-as pointer #x70004000)) + (t9-15 (the-as mother-spider-leg sv-112) this 'mother-spider-leg (the-as pointer #x70004000)) ) - (run-now-in-process sv-112 mother-spider-leg-init-by-other obj s0-0 sv-128 sv-144) + (run-now-in-process sv-112 mother-spider-leg-init-by-other this s0-0 sv-128 sv-144) (-> sv-112 ppointer) ) ) @@ -556,43 +556,43 @@ ) ) ) - (>= (-> obj damage) 6) + (>= (-> this damage) 6) ) -(defmethod mother-spider-method-29 mother-spider ((obj mother-spider) (arg0 symbol) (arg1 symbol)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-update-time)) - (set! (-> obj last-update-time) v1-1) - (mother-spider-method-23 obj) - (let ((f0-1 (fmax 0.0 (- (-> obj dist-from-anchor) (-> obj idle-dist-from-anchor))))) +(defmethod mother-spider-method-29 mother-spider ((this mother-spider) (arg0 symbol) (arg1 symbol)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-update-time)) + (set! (-> this last-update-time) v1-1) + (mother-spider-method-23 this) + (let ((f0-1 (fmax 0.0 (- (-> this dist-from-anchor) (-> this idle-dist-from-anchor))))) (cond ((>= f0-1 20480.0) - (vector-identity! (-> obj root-override scale)) + (vector-identity! (-> this root-override scale)) ) (else (let ((f0-2 (* 0.000048828126 f0-1))) - (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root-override scale) f0-2 f0-2 f0-2 1.0) ) ) ) ) (if arg0 - (shadow-handler obj) + (shadow-handler this) ) - (let ((s4-1 (-> obj leg-socket-part-mask))) + (let ((s4-1 (-> this leg-socket-part-mask))) (when (nonzero? s4-1) (dotimes (s3-0 6) (when (logtest? s4-1 1) (cond - ((>= (+ (-> *display* base-frame-counter) (seconds -1)) (-> obj leg-socket-part-time s3-0)) - (logxor! (-> obj leg-socket-part-mask) (ash 1 s3-0)) + ((>= (+ (current-time) (seconds -1)) (-> this leg-socket-part-time s3-0)) + (logxor! (-> this leg-socket-part-mask) (ash 1 s3-0)) ) (else (let ((v1-20 (-> *mother-spider-leg-infos* s3-0)) (s2-0 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s2-0 (-> obj node-list data (-> v1-20 joint-index0))) - (spawn (-> obj part) s2-0) + (vector<-cspace! s2-0 (-> this node-list data (-> v1-20 joint-index0))) + (spawn (-> this part) s2-0) ) ) ) @@ -603,35 +603,40 @@ ) (when arg1 (when *target* - (case (-> obj mode) + (case (-> this mode) ((1 2) (if *target* - (look-at-enemy! (-> *target* neck) (the-as vector (-> obj root-override root-prim prim-core)) 'attacking obj) + (look-at-enemy! + (-> *target* neck) + (the-as vector (-> this root-override root-prim prim-core)) + 'attacking + this + ) ) ) ) ) - (set-target! (-> obj neck) (target-pos 5)) + (set-target! (-> this neck) (target-pos 5)) ) ) ) (none) ) -(defmethod mother-spider-method-23 mother-spider ((obj mother-spider)) +(defmethod mother-spider-method-23 mother-spider ((this mother-spider)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (let* ((f2-0 (-> obj dist-from-anchor)) - (f1-0 (- (-> obj targ-dist-from-anchor) f2-0)) - (f0-1 (-> obj thread-vel)) + (let* ((f2-0 (-> this dist-from-anchor)) + (f1-0 (- (-> this targ-dist-from-anchor) f2-0)) + (f0-1 (-> this thread-vel)) ) (when (or (!= f0-1 0.0) (!= f1-0 0.0)) (let ((f0-2 (+ f0-1 (* 2.0 f1-0)))) - (let ((f3-4 (-> obj thread-speed))) + (let ((f3-4 (-> this thread-speed))) (if (< f3-4 (fabs f0-2)) (set! f0-2 (if (>= f0-2 0.0) f3-4 @@ -640,8 +645,8 @@ ) ) ) - (let ((f2-1 (+ f2-0 (* f0-2 (-> *display* seconds-per-frame))))) - (let ((f3-8 (- (-> obj targ-dist-from-anchor) f2-1))) + (let ((f2-1 (+ f2-0 (* f0-2 (seconds-per-frame))))) + (let ((f3-8 (- (-> this targ-dist-from-anchor) f2-1))) (cond ((>= f1-0 0.0) (if (>= 0.0 f3-8) @@ -655,40 +660,40 @@ ) ) ) - (set! (-> obj dist-from-anchor) (fmax 0.0 f2-1)) + (set! (-> this dist-from-anchor) (fmax 0.0 f2-1)) ) - (set! (-> obj thread-vel) f0-2) + (set! (-> this thread-vel) f0-2) ) ) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-negate! s5-0 (-> obj swing-base-pos)) + (vector-negate! s5-0 (-> this swing-base-pos)) (set! (-> s5-0 y) 0.0) (let ((f0-4 (vector-length s5-0))) (when (< 0.0 f0-4) - (let ((f1-11 (* 61440.0 (-> *display* seconds-per-frame)))) + (let ((f1-11 (* 61440.0 (seconds-per-frame)))) (if (< f1-11 f0-4) (vector-normalize! s5-0 f1-11) ) ) - (vector+! (-> obj swing-vel) (-> obj swing-vel) s5-0) + (vector+! (-> this swing-vel) (-> this swing-vel) s5-0) ) ) ) - (let ((f0-5 (vector-length (-> obj swing-vel)))) + (let ((f0-5 (vector-length (-> this swing-vel)))) (when (< 0.0 f0-5) (let ((f0-6 (* 0.995 f0-5))) (cond ((< 40.96 f0-6) - (vector-normalize! (-> obj swing-vel) f0-6) + (vector-normalize! (-> this swing-vel) f0-6) (let ((s5-1 (new 'stack-no-clear 'event-message-block)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s4-0 (-> obj node-list data 6)) + (vector<-cspace! s4-0 (-> this node-list data 6)) (let ((v1-20 s3-0)) - (.lvf vf1 (&-> (-> obj swing-vel) quad)) - (let ((f0-7 (-> *display* seconds-per-frame))) + (.lvf vf1 (&-> (-> this swing-vel) quad)) + (let ((f0-7 (seconds-per-frame))) (.mov at-0 f0-7) ) (.mov vf2 at-0) @@ -702,84 +707,86 @@ s3-0 4915.2 (collide-kind background) - obj + this (the-as collide-tri-result s5-1) (new 'static 'pat-surface :noentity #x1) ) 0.0 ) - (vector-reflect! (-> obj swing-vel) (-> obj swing-vel) (the-as vector (&-> s5-1 param 6))) - (set! (-> obj swing-vel y) 0.0) - (vector-normalize! (-> obj swing-vel) (* 0.5 (vector-length (-> obj swing-vel)))) - (when (and (!= (-> obj spin-vel) 0.0) (>= (- (-> *display* base-frame-counter) (-> obj spin-time)) (seconds 0.5))) - (set! (-> obj spin-vel) (* 0.75 (- (-> obj spin-vel)))) - (set! (-> obj spin-time) (-> *display* base-frame-counter)) + (vector-reflect! (-> this swing-vel) (-> this swing-vel) (the-as vector (&-> s5-1 param 6))) + (set! (-> this swing-vel y) 0.0) + (vector-normalize! (-> this swing-vel) (* 0.5 (vector-length (-> this swing-vel)))) + (when (and (!= (-> this spin-vel) 0.0) (time-elapsed? (-> this spin-time) (seconds 0.5))) + (set! (-> this spin-vel) (* 0.75 (- (-> this spin-vel)))) + (set-time! (-> this spin-time)) ) ) ) - (vector-v+! (-> obj swing-base-pos) (-> obj swing-base-pos) (-> obj swing-vel)) + (vector-v+! (-> this swing-base-pos) (-> this swing-base-pos) (-> this swing-vel)) 0 ) (else - (vector-reset! (-> obj swing-vel)) + (vector-reset! (-> this swing-vel)) ) ) ) ) ) - (set! (-> obj swing-pos quad) (-> obj swing-base-pos quad)) - (let ((f30-1 (the float (- (-> *display* base-frame-counter) (-> obj spawned-time))))) - (+! (-> obj swing-pos x) (* 1024.0 (cos (* 54.613335 f30-1)))) - (+! (-> obj swing-pos z) (* 1024.0 (cos (* 81.817726 f30-1)))) + (set! (-> this swing-pos quad) (-> this swing-base-pos quad)) + (let ((f30-1 (the float (- (current-time) (-> this spawned-time))))) + (+! (-> this swing-pos x) (* 1024.0 (cos (* 54.613335 f30-1)))) + (+! (-> this swing-pos z) (* 1024.0 (cos (* 81.817726 f30-1)))) ) - (let ((f0-26 (vector-length (-> obj swing-pos)))) + (let ((f0-26 (vector-length (-> this swing-pos)))) (cond ((!= f0-26 0.0) - (let* ((f30-2 (-> obj dist-from-anchor)) + (let* ((f30-2 (-> this dist-from-anchor)) (f28-2 (* 10430.379 (/ f0-26 f30-2))) ) - (set-vector! (-> obj root-override trans) 0.0 (* (cos f28-2) (- f30-2)) (* (sin f28-2) f30-2) 1.0) + (set-vector! (-> this root-override trans) 0.0 (* (cos f28-2) (- f30-2)) (* (sin f28-2) f30-2) 1.0) ) - (let ((f0-36 (atan (-> obj swing-pos x) (-> obj swing-pos z)))) - (vector-rotate-around-y! (-> obj root-override trans) (-> obj root-override trans) f0-36) + (let ((f0-36 (atan (-> this swing-pos x) (-> this swing-pos z)))) + (vector-rotate-around-y! (-> this root-override trans) (-> this root-override trans) f0-36) ) - (vector+! (-> obj root-override trans) (-> obj root-override trans) (-> obj anchor-trans)) + (vector+! (-> this root-override trans) (-> this root-override trans) (-> this anchor-trans)) ) (else - (set! (-> obj root-override trans quad) (-> obj anchor-trans quad)) - (set! (-> obj root-override trans y) (- (-> obj root-override trans y) (-> obj dist-from-anchor))) + (set! (-> this root-override trans quad) (-> this anchor-trans quad)) + (set! (-> this root-override trans y) (- (-> this root-override trans y) (-> this dist-from-anchor))) ) ) ) - (let ((v1-51 (-> obj draw bounds))) - (vector+! v1-51 (-> obj root-override trans) (-> obj anchor-trans)) + (let ((v1-51 (-> this draw bounds))) + (vector+! v1-51 (-> this root-override trans) (-> this anchor-trans)) (vector-float*! v1-51 v1-51 0.5) - (vector-! v1-51 v1-51 (-> obj root-override trans)) - (set! (-> v1-51 w) (+ 28672.0 (* 0.5 (-> obj dist-from-anchor)))) + (vector-! v1-51 v1-51 (-> this root-override trans)) + (set! (-> v1-51 w) (+ 28672.0 (* 0.5 (-> this dist-from-anchor)))) ) (cond - ((!= (-> obj spin-vel) 0.0) - (let ((f0-44 (+ (-> obj orient-rot y) (* (-> obj spin-vel) (-> *display* seconds-per-frame))))) - (set! (-> obj orient-rot y) (- f0-44 (* (the float (the int (/ f0-44 65536.0))) 65536.0))) + ((!= (-> this spin-vel) 0.0) + (let ((f0-44 (+ (-> this orient-rot y) (* (-> this spin-vel) (seconds-per-frame))))) + (set! (-> this orient-rot y) (- f0-44 (* (the float (the int (/ f0-44 65536.0))) 65536.0))) ) - (seek! (-> obj spin-vel) 0.0 (* 91022.22 (-> *display* seconds-per-frame))) - (when (< (fabs (-> obj spin-vel)) 69176.89) - (if (>= (-> obj spin-vel) 0.0) - (set! (-> obj spin-vel) 69176.89) - (set! (-> obj spin-vel) -69176.89) + (seek! (-> this spin-vel) 0.0 (* 91022.22 (seconds-per-frame))) + (when (< (fabs (-> this spin-vel)) 69176.89) + (if (>= (-> this spin-vel) 0.0) + (set! (-> this spin-vel) 69176.89) + (set! (-> this spin-vel) -69176.89) ) (cond (*target* (let* ((v1-59 (target-pos 0)) - (f0-59 (atan (- (-> v1-59 x) (-> obj root-override trans x)) (- (-> v1-59 z) (-> obj root-override trans z)))) + (f0-59 + (atan (- (-> v1-59 x) (-> this root-override trans x)) (- (-> v1-59 z) (-> this root-override trans z))) + ) ) - (if (>= 3640.889 (fabs (deg- f0-59 (-> obj orient-rot y)))) - (set! (-> obj spin-vel) 0.0) + (if (>= 3640.889 (fabs (deg- f0-59 (-> this orient-rot y)))) + (set! (-> this spin-vel) 0.0) ) ) ) (else - (set! (-> obj spin-vel) 0.0) + (set! (-> this spin-vel) 0.0) ) ) ) @@ -787,16 +794,18 @@ (else (when *target* (let* ((v1-66 (target-pos 0)) - (f0-69 (atan (- (-> v1-66 x) (-> obj root-override trans x)) (- (-> v1-66 z) (-> obj root-override trans z)))) + (f0-69 + (atan (- (-> v1-66 x) (-> this root-override trans x)) (- (-> v1-66 z) (-> this root-override trans z))) + ) ) - (set! (-> obj orient-rot y) - (deg-seek-smooth (-> obj orient-rot y) f0-69 (* 32768.0 (-> *display* seconds-per-frame)) 0.2) + (set! (-> this orient-rot y) + (deg-seek-smooth (-> this orient-rot y) f0-69 (* 32768.0 (seconds-per-frame)) 0.2) ) ) ) ) ) - (quaternion-zxy! (-> obj root-override quat) (-> obj orient-rot)) + (quaternion-zxy! (-> this root-override quat) (-> this orient-rot)) 0 (none) ) @@ -982,7 +991,7 @@ (go mother-spider-tracking) ) ((= v1-22 2) - (set! (-> self started-birthing-time) (-> *display* base-frame-counter)) + (set-time! (-> self started-birthing-time)) (set! (-> self birthing-counter) (max 0 (- (-> self max-baby-count) (-> self baby-count)))) (go mother-spider-birthing) ) @@ -996,8 +1005,8 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) + (set-time! (-> self last-player-in-air-time)) ) :trans (behavior () (if (-> self hit?) @@ -1032,11 +1041,11 @@ (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) - (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-player-in-air-time)) ) (when (and *target* - (>= (- (-> *display* base-frame-counter) (-> self last-spit-time)) (seconds 3)) - (>= (- (-> *display* base-frame-counter) (-> self last-player-in-air-time)) (seconds 0.06)) + (time-elapsed? (-> self last-spit-time) (seconds 3)) + (time-elapsed? (-> self last-player-in-air-time) (seconds 0.06)) (>= (-> self max-spit-xz-dist) (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) ) (let ((gp-2 (new 'stack-no-clear 'vector)) @@ -1053,7 +1062,7 @@ (go mother-spider-spit) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self last-spit-time)) (seconds 5)) + (if (time-elapsed? (-> self last-spit-time) (seconds 5)) (go mother-spider-traveling (the-as uint 2)) ) ) @@ -1125,7 +1134,7 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (-> self hit?) @@ -1169,7 +1178,7 @@ :to self ) (set! gp-0 #t) - (set! (-> self last-spit-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-spit-time)) (vector-negate! s5-0 s5-0) (mother-spider-method-21 self s5-0 49152.0 #f) (when (nonzero? (-> self max-baby-count)) @@ -1199,7 +1208,7 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (-> self hit?) @@ -1208,7 +1217,7 @@ (if (letgo-player? self) (go mother-spider-traveling (the-as uint 0)) ) - (if (and (>= (- (-> *display* base-frame-counter) (-> self started-birthing-time)) (seconds 6)) + (if (and (time-elapsed? (-> self started-birthing-time) (seconds 6)) (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) @@ -1216,7 +1225,7 @@ ) (go mother-spider-traveling (the-as uint 1)) ) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.25)) (> (-> self birthing-counter) 0) (and (>= 49152.0 (- (-> self max-dist-from-anchor) (-> self dist-from-anchor))) (not (logtest? (-> *target* state-flags) @@ -1258,7 +1267,7 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (-> self hit?) @@ -1299,12 +1308,12 @@ :post transform-post ) -(defmethod mother-spider-method-20 mother-spider ((obj mother-spider) (arg0 vector) (arg1 vector)) - (set! (-> obj nav nav-cull-radius) 40960.0) - (set-current-poly! (-> obj nav) (nav-control-method-16 (-> obj nav) (-> obj root-override trans))) - (nav-control-method-28 (-> obj nav) (the-as collide-kind -1)) +(defmethod mother-spider-method-20 mother-spider ((this mother-spider) (arg0 vector) (arg1 vector)) + (set! (-> this nav nav-cull-radius) 40960.0) + (set-current-poly! (-> this nav) (nav-control-method-16 (-> this nav) (-> this root-override trans))) + (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) (dotimes (s3-1 4) - (let ((f28-0 (+ 32768.0 (-> obj orient-rot y))) + (let ((f28-0 (+ 32768.0 (-> this orient-rot y))) (f30-0 (rand-vu-float-range 16384.0 40960.0)) ) (let ((s1-0 (new 'stack-no-clear 'vector)) @@ -1314,13 +1323,13 @@ (set-vector! s1-0 (sin f28-1) 0.0 (cos f28-1) 1.0) ) (vector-float*! s2-1 s1-0 f30-0) - (nav-control-method-35 (-> obj nav) (-> obj nav travel) (-> obj root-override trans) s2-1 s1-0 f30-0) + (nav-control-method-35 (-> this nav) (-> this nav travel) (-> this root-override trans) s2-1 s1-0 f30-0) ) - (nav-control-method-24 (-> obj nav) f30-0 (the-as clip-travel-vector-to-mesh-return-info #f)) + (nav-control-method-24 (-> this nav) f30-0 (the-as clip-travel-vector-to-mesh-return-info #f)) ) (cond - ((>= (vector-xz-length (-> obj nav travel)) 4096.0) - (vector+! arg0 (-> obj root-override trans) (-> obj nav travel)) + ((>= (vector-xz-length (-> this nav travel)) 4096.0) + (vector+! arg0 (-> this root-override trans) (-> this nav travel)) (let ((s2-2 (new 'stack-no-clear 'collide-tri-result))) (cond ((>= (fill-and-probe-using-line-sphere @@ -1329,7 +1338,7 @@ (new 'static 'vector :y -69632.0 :w 1.0) 40.96 (collide-kind background) - obj + this s2-2 (new 'static 'pat-surface :noentity #x1) ) @@ -1350,7 +1359,7 @@ ) ) ) - (project-onto-nav-mesh (-> obj nav) arg0 (-> obj root-override trans)) + (project-onto-nav-mesh (-> this nav) arg0 (-> this root-override trans)) (let ((a1-12 (new 'stack-no-clear 'vector)) (s3-2 (new 'stack-no-clear 'collide-tri-result)) ) @@ -1363,7 +1372,7 @@ (new 'static 'vector :y -69632.0 :w 1.0) 40.96 (collide-kind background) - obj + this s3-2 (new 'static 'pat-surface :noentity #x1) ) @@ -1554,7 +1563,7 @@ (none) ) -(defmethod mother-spider-method-22 mother-spider ((obj mother-spider) (arg0 matrix) (arg1 vector)) +(defmethod mother-spider-method-22 mother-spider ((this mother-spider) (arg0 matrix) (arg1 vector)) (rlet ((vf0 :class vf)) (init-vf0-vector) (vector-! (-> arg0 vector 2) arg1 (-> arg0 vector 3)) @@ -1577,52 +1586,52 @@ ) ) -(defmethod run-logic? mother-spider ((obj mother-spider)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (< (vector-vector-xz-distance (-> obj root-override trans) (math-camera-pos)) (-> obj deactivate-xz-dist)) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) +(defmethod run-logic? mother-spider ((this mother-spider)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (< (vector-vector-xz-distance (-> this root-override trans) (math-camera-pos)) (-> this deactivate-xz-dist)) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) -(defmethod relocate mother-spider ((obj mother-spider) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(defmethod relocate mother-spider ((this mother-spider) (arg0 int)) + (if (nonzero? (-> this neck)) + (&+! (-> this neck) arg0) ) - (the-as mother-spider ((method-of-type process-drawable relocate) obj arg0)) + (the-as mother-spider ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod init-from-entity! mother-spider ((obj mother-spider) (arg0 entity-actor)) +(defmethod init-from-entity! mother-spider ((this mother-spider) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-64 vector)) - (set! (-> obj baby-count) 0) - (set! (-> obj spit-counter) 0) - (set! (-> obj leg-socket-part-mask) 0) - (set! (-> obj mode) (the-as uint 0)) - (set! (-> obj damage) 0) - (set! (-> obj player-attack-id) (the-as uint 0)) - (set! (-> obj spin-vel) 0.0) - (set! (-> obj thread-speed) 245760.0) - (set! (-> obj thread-vel) 0.0) - (set! (-> obj hit?) #f) - (set! (-> obj last-update-time) 0) - (set! (-> obj spawned-time) (-> *display* base-frame-counter)) - (set! (-> obj spin-time) (-> *display* base-frame-counter)) - (set! (-> obj last-spit-time) 0) - (set! (-> obj started-birthing-time) 0) - (set! (-> obj check-z-thresh?) #f) - (set! (-> obj activate-z-thresh) 0.0) - (set! (-> obj deactivate-z-thresh) 0.0) - (vector-reset! (-> obj swing-pos)) - (vector-reset! (-> obj swing-base-pos)) - (vector-reset! (-> obj swing-vel)) - (when (name= (-> obj name) "mother-spider-7") - (set! (-> obj check-z-thresh?) #t) - (set! (-> obj activate-z-thresh) -12288.0) - (set! (-> obj deactivate-z-thresh) 24985.6) + (set! (-> this baby-count) 0) + (set! (-> this spit-counter) 0) + (set! (-> this leg-socket-part-mask) 0) + (set! (-> this mode) (the-as uint 0)) + (set! (-> this damage) 0) + (set! (-> this player-attack-id) (the-as uint 0)) + (set! (-> this spin-vel) 0.0) + (set! (-> this thread-speed) 245760.0) + (set! (-> this thread-vel) 0.0) + (set! (-> this hit?) #f) + (set! (-> this last-update-time) 0) + (set-time! (-> this spawned-time)) + (set-time! (-> this spin-time)) + (set! (-> this last-spit-time) 0) + (set! (-> this started-birthing-time) 0) + (set! (-> this check-z-thresh?) #f) + (set! (-> this activate-z-thresh) 0.0) + (set! (-> this deactivate-z-thresh) 0.0) + (vector-reset! (-> this swing-pos)) + (vector-reset! (-> this swing-base-pos)) + (vector-reset! (-> this swing-vel)) + (when (name= (-> this name) "mother-spider-7") + (set! (-> this check-z-thresh?) #t) + (set! (-> this activate-z-thresh) -12288.0) + (set! (-> this deactivate-z-thresh) 24985.6) ) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind mother-spider)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1704,74 +1713,74 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *mother-spider-sg* '()) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj nav nearest-y-threshold) 409600.0) - (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) - (logclear! (-> obj root-override nav-flags) (nav-flags navf1)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *mother-spider-sg* '()) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this nav nearest-y-threshold) 409600.0) + (logclear! (-> this root-override nav-flags) (nav-flags navf0)) + (logclear! (-> this root-override nav-flags) (nav-flags navf1)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 4096000.0 (the-as float 60) 245760.0)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 618) obj)) - (logior! (-> obj skel status) (janim-status inited)) - (let ((v0-30 (new 'process 'joint-mod (joint-mod-handler-mode reset) obj 19))) - (set! (-> obj neck) v0-30) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 4096000.0 (the-as float 60) 245760.0)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 618) this)) + (logior! (-> this skel status) (janim-status inited)) + (let ((v0-30 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 19))) + (set! (-> this neck) v0-30) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) (set! (-> v0-30 up) (the-as uint 1)) (set! (-> v0-30 nose) (the-as uint 2)) (set! (-> v0-30 ear) (the-as uint 0)) (set! (-> v0-30 max-dist) 102400.0) (set! (-> v0-30 ignore-angle) 16384.0) ) - (set! (-> obj thread-min-trans quad) (-> obj root-override trans quad)) - (set! (-> obj anchor-trans quad) (-> obj root-override trans quad)) - (set! (-> obj max-swing-radius) 73728.0) - (set! (-> obj max-baby-count) 4) + (set! (-> this thread-min-trans quad) (-> this root-override trans quad)) + (set! (-> this anchor-trans quad) (-> this root-override trans quad)) + (set! (-> this max-swing-radius) 73728.0) + (set! (-> this max-baby-count) 4) (let ((s4-1 #f)) (set! sv-16 (new 'static 'res-tag)) (let ((v0-31 (res-lump-data arg0 'mother-spider pointer :tag-ptr (& sv-16)))) (cond (v0-31 - (+! (-> obj thread-min-trans y) (-> (the-as (pointer float) v0-31) 0)) - (+! (-> obj anchor-trans y) (-> (the-as (pointer float) v0-31) 1)) - (set! (-> obj max-swing-radius) (-> (the-as (pointer float) v0-31) 2)) - (set! (-> obj max-baby-count) (the int (-> (the-as (pointer float) v0-31) 3))) + (+! (-> this thread-min-trans y) (-> (the-as (pointer float) v0-31) 0)) + (+! (-> this anchor-trans y) (-> (the-as (pointer float) v0-31) 1)) + (set! (-> this max-swing-radius) (-> (the-as (pointer float) v0-31) 2)) + (set! (-> this max-baby-count) (the int (-> (the-as (pointer float) v0-31) 3))) (set! s4-1 (!= (-> (the-as (pointer float) v0-31) 4) 0.0)) - (set! (-> obj max-spit-xz-dist) (-> (the-as (pointer float) v0-31) 5)) - (set! (-> obj activate-xz-dist) (-> (the-as (pointer float) v0-31) 6)) - (set! (-> obj deactivate-xz-dist) (-> (the-as (pointer float) v0-31) 7)) + (set! (-> this max-spit-xz-dist) (-> (the-as (pointer float) v0-31) 5)) + (set! (-> this activate-xz-dist) (-> (the-as (pointer float) v0-31) 6)) + (set! (-> this deactivate-xz-dist) (-> (the-as (pointer float) v0-31) 7)) ) (else - (+! (-> obj thread-min-trans y) 28672.0) - (+! (-> obj anchor-trans y) 204800.0) - (set! (-> obj max-spit-xz-dist) 81920.0) - (set! (-> obj activate-xz-dist) 143360.0) - (set! (-> obj deactivate-xz-dist) 163430.4) + (+! (-> this thread-min-trans y) 28672.0) + (+! (-> this anchor-trans y) 204800.0) + (set! (-> this max-spit-xz-dist) 81920.0) + (set! (-> this activate-xz-dist) 143360.0) + (set! (-> this deactivate-xz-dist) 163430.4) ) ) ) - (set! (-> obj thread-min-trans w) 1.0) - (set! (-> obj anchor-trans w) 1.0) - (set! (-> obj idle-dist-from-anchor) 16384.0) - (set! (-> obj max-dist-from-anchor) (- (-> obj anchor-trans y) (-> obj thread-min-trans y))) - (set! (-> obj player-sticky-dist-from-anchor) (-> obj max-dist-from-anchor)) - (set! (-> obj targ-dist-from-anchor) (-> obj idle-dist-from-anchor)) - (set! (-> obj root-override trans quad) (-> obj anchor-trans quad)) - (set! (-> obj root-override trans y) (- (-> obj root-override trans y) (-> obj idle-dist-from-anchor))) - (set-vector! (-> obj orient-rot) 0.0 0.0 0.0 1.0) - (quaternion-zxy! (-> obj root-override quat) (-> obj orient-rot)) + (set! (-> this thread-min-trans w) 1.0) + (set! (-> this anchor-trans w) 1.0) + (set! (-> this idle-dist-from-anchor) 16384.0) + (set! (-> this max-dist-from-anchor) (- (-> this anchor-trans y) (-> this thread-min-trans y))) + (set! (-> this player-sticky-dist-from-anchor) (-> this max-dist-from-anchor)) + (set! (-> this targ-dist-from-anchor) (-> this idle-dist-from-anchor)) + (set! (-> this root-override trans quad) (-> this anchor-trans quad)) + (set! (-> this root-override trans y) (- (-> this root-override trans y) (-> this idle-dist-from-anchor))) + (set-vector! (-> this orient-rot) 0.0 0.0 0.0 1.0) + (quaternion-zxy! (-> this root-override quat) (-> this orient-rot)) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 5)) + (the-as art-joint-anim (-> this draw art-group data 5)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) @@ -1779,14 +1788,14 @@ (transform-post) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) -1 10240.0 ) (let ((v1-121 #f)) - (if (nonzero? (-> obj entity extra perm user-int8 0)) + (if (nonzero? (-> this entity extra perm user-int8 0)) (set! v1-121 #t) ) (cond @@ -1795,12 +1804,12 @@ ) (else (when s4-1 - (let ((s5-3 (max 0 (min (+ (-> obj path curve num-cverts) -1) (-> obj max-baby-count)))) + (let ((s5-3 (max 0 (min (+ (-> this path curve num-cverts) -1) (-> this max-baby-count)))) (s4-2 (new 'stack-no-clear 'vector)) (s3-1 (new 'stack-no-clear 'vector)) ) (dotimes (s2-9 s5-3) - (eval-path-curve-div! (-> obj path) s4-2 (the float s2-9) 'interp) + (eval-path-curve-div! (-> this path) s4-2 (the float s2-9) 'interp) (vector-! s3-1 (target-pos 0) s4-2) (set! (-> s3-1 y) 0.0) (let ((s1-2 vector-rotate-around-y!) @@ -1812,11 +1821,11 @@ ) ) (vector-normalize! s3-1 1.0) - (spawn-child obj s4-2 s3-1 #f) + (spawn-child this s4-2 s3-1 #f) ) ) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (go mother-spider-idle) ) ) diff --git a/goal_src/jak1/levels/maincave/spiderwebs.gc b/goal_src/jak1/levels/maincave/spiderwebs.gc index 1f8f331454..dd87276112 100644 --- a/goal_src/jak1/levels/maincave/spiderwebs.gc +++ b/goal_src/jak1/levels/maincave/spiderwebs.gc @@ -121,9 +121,9 @@ :post transform-post ) -(defmethod init-from-entity! spiderwebs ((obj spiderwebs) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! spiderwebs ((this spiderwebs) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -140,26 +140,26 @@ ) (set! (-> s4-0 nav-radius) 13926.4) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *spiderwebs-sg* '()) - (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *spiderwebs-sg* '()) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) (ja-channel-set! 1) - (let ((a0-11 (-> obj skel root-channel 0))) + (let ((a0-11 (-> this skel root-channel 0))) (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) (set! (-> a0-11 param 1) 1.0) (joint-control-channel-group! a0-11 (the-as art-joint-anim #f) num-func-seek!) ) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) - (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (transform-post) (go spiderwebs-idle) (none) diff --git a/goal_src/jak1/levels/misty/babak-with-cannon.gc b/goal_src/jak1/levels/misty/babak-with-cannon.gc index 3b458638a2..ba4adeab9b 100644 --- a/goal_src/jak1/levels/misty/babak-with-cannon.gc +++ b/goal_src/jak1/levels/misty/babak-with-cannon.gc @@ -35,7 +35,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) ) (go-virtual nav-enemy-patrol) ) @@ -57,9 +57,9 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((f30-0 (- (-> (target-pos 0) y) (-> self collide-info trans y)))) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (if (and (time-elapsed? (-> self state-time) (seconds 3)) (or (or (not *target*) (< (-> self distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) ) @@ -69,7 +69,7 @@ nav-enemy-default-event-handler (go babak-run-to-cannon) ) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (if (or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -88,7 +88,7 @@ nav-enemy-default-event-handler (defstate babak-run-to-cannon (babak) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self nav destination-pos quad) (-> self entity extra trans quad)) (set! (-> self nav target-pos quad) (-> self entity extra trans quad)) ) @@ -168,7 +168,7 @@ nav-enemy-default-event-handler (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) @@ -237,7 +237,7 @@ nav-enemy-default-event-handler (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (nav-enemy-initialize-jump (-> self entity extra trans)) (nav-enemy-neck-control-look-at) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) @@ -263,7 +263,7 @@ nav-enemy-default-event-handler (defstate babak-with-cannon-shooting (babak-with-cannon) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor 0))) (if v1-2 (logior! (-> v1-2 extra perm status) (entity-perm-status complete)) @@ -283,7 +283,7 @@ nav-enemy-default-event-handler (and (and *target* (>= (-> self distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) ) ) (go babak-with-cannon-jump-off-cannon) @@ -351,31 +351,31 @@ nav-enemy-default-event-handler ) ) -(defmethod common-post babak-with-cannon ((obj babak-with-cannon)) +(defmethod common-post babak-with-cannon ((this babak-with-cannon)) (cond ((= (level-status *level* 'beach) 'active) - (spool-push *art-control* "beachcam-cannon" 0 obj -99.0) + (spool-push *art-control* "beachcam-cannon" 0 this -99.0) ) ((= (level-status *level* 'misty) 'active) - (spool-push *art-control* "mistycam-cannon" 0 obj -99.0) + (spool-push *art-control* "mistycam-cannon" 0 this -99.0) ) ) - ((method-of-type nav-enemy common-post) obj) + ((method-of-type nav-enemy common-post) this) (none) ) -(defmethod init-from-entity! babak-with-cannon ((obj babak-with-cannon) (arg0 entity-actor)) - (initialize-collision obj) - (process-drawable-from-entity! obj arg0) - (nav-enemy-method-48 obj) - (set! (-> obj distance) (res-lump-float arg0 'distance :default 163840.0)) - (set! (-> obj cannon-ent) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (if (or (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))) - (not (logtest? (-> obj enemy-info options) (fact-options has-power-cell))) +(defmethod init-from-entity! babak-with-cannon ((this babak-with-cannon) (arg0 entity-actor)) + (initialize-collision this) + (process-drawable-from-entity! this arg0) + (nav-enemy-method-48 this) + (set! (-> this distance) (res-lump-float arg0 'distance :default 163840.0)) + (set! (-> this cannon-ent) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (if (or (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete)))) + (not (logtest? (-> this enemy-info options) (fact-options has-power-cell))) ) - (go (method-of-object obj nav-enemy-idle)) + (go (method-of-object this nav-enemy-idle)) ) - (go (method-of-object obj nav-enemy-fuel-cell)) + (go (method-of-object this nav-enemy-fuel-cell)) (none) ) diff --git a/goal_src/jak1/levels/misty/balloonlurker.gc b/goal_src/jak1/levels/misty/balloonlurker.gc index 665cd82d00..18fdef3ccb 100644 --- a/goal_src/jak1/levels/misty/balloonlurker.gc +++ b/goal_src/jak1/levels/misty/balloonlurker.gc @@ -467,24 +467,24 @@ ) ) -(defmethod rigid-body-platform-method-23 balloonlurker ((obj balloonlurker) (arg0 float)) +(defmethod rigid-body-platform-method-23 balloonlurker ((this balloonlurker) (arg0 float)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s3-0 (new 'stack-no-clear 'vector)) - (s4-0 (-> obj rbody matrix)) + (s4-0 (-> this rbody matrix)) ) (dotimes (s2-0 4) - (let ((s1-0 (-> obj control-point-array data s2-0))) + (let ((s1-0 (-> this control-point-array data s2-0))) (vector-matrix*! (-> s1-0 world-pos) (-> s1-0 local-pos) s4-0) - (rigid-body-method-17 (-> obj rbody) (-> s1-0 world-pos) (-> s1-0 velocity)) - (let* ((f30-0 (vector-vector-xz-distance (-> obj dest-point) (-> obj root-overlay trans))) - (f0-0 (vector-vector-xz-distance (-> obj dest-point-old) (-> obj root-overlay trans))) + (rigid-body-method-17 (-> this rbody) (-> s1-0 world-pos) (-> s1-0 velocity)) + (let* ((f30-0 (vector-vector-xz-distance (-> this dest-point) (-> this root-overlay trans))) + (f0-0 (vector-vector-xz-distance (-> this dest-point-old) (-> this root-overlay trans))) (f0-6 - (/ (- (+ (/ (+ (* f30-0 (-> obj dest-point-old y)) (* f0-0 (-> obj dest-point y))) (fmax 409.6 (+ f30-0 f0-0))) + (/ (- (+ (/ (+ (* f30-0 (-> this dest-point-old y)) (* f0-0 (-> this dest-point y))) (fmax 409.6 (+ f30-0 f0-0))) (-> *BALLOONLURKER-bank* buoyancy-depth-offset) ) (-> s1-0 world-pos y) ) - (-> obj info max-buoyancy-depth) + (-> this info max-buoyancy-depth) ) ) ) @@ -492,24 +492,24 @@ s5-0 *y-vector* (* 0.25 - (-> obj buoyancy-factor) - (-> obj info gravity-factor) + (-> this buoyancy-factor) + (-> this info gravity-factor) (fmax 0.3 (fmin 1.0 f0-6)) - (-> obj info gravity) - (-> obj rbody mass) + (-> this info gravity) + (-> this rbody mass) ) ) ) - (rigid-body-method-13 (-> obj rbody) (-> s1-0 world-pos) s5-0) - (vector-float*! s5-0 (-> s1-0 velocity) (* -1.0 (-> obj info drag-factor))) - (rigid-body-method-13 (-> obj rbody) (-> s1-0 world-pos) s5-0) + (rigid-body-method-13 (-> this rbody) (-> s1-0 world-pos) s5-0) + (vector-float*! s5-0 (-> s1-0 velocity) (* -1.0 (-> this info drag-factor))) + (rigid-body-method-13 (-> this rbody) (-> s1-0 world-pos) s5-0) ) 0 ) - (let ((s2-1 (-> obj control-point-array data 4))) - (let ((f30-1 (* (-> *BALLOONLURKER-bank* max-rudder-deflection-angle) (-> obj rudder-control)))) + (let ((s2-1 (-> this control-point-array data 4))) + (let ((f30-1 (* (-> *BALLOONLURKER-bank* max-rudder-deflection-angle) (-> this rudder-control)))) (vector-matrix*! (-> s2-1 world-pos) (-> s2-1 local-pos) s4-0) - (rigid-body-method-17 (-> obj rbody) (-> s2-1 world-pos) (-> s2-1 velocity)) + (rigid-body-method-17 (-> this rbody) (-> s2-1 world-pos) (-> s2-1 velocity)) (set-vector! s3-0 (cos f30-1) 0.0 (sin f30-1) 1.0) ) (vector-rotate*! s3-0 s3-0 s4-0) @@ -518,44 +518,44 @@ s3-0 (* -1.0 (-> *BALLOONLURKER-bank* rudder-factor) (vector-dot s3-0 (-> s2-1 velocity))) ) - (rigid-body-method-13 (-> obj rbody) (-> s2-1 world-pos) s5-0) + (rigid-body-method-13 (-> this rbody) (-> s2-1 world-pos) s5-0) ) 0 - (let ((s3-1 (-> obj control-point-array data 5))) + (let ((s3-1 (-> this control-point-array data 5))) (vector-matrix*! (-> s3-1 world-pos) (-> s3-1 local-pos) s4-0) (set! (-> s3-1 world-pos quad) (-> s3-1 world-pos quad)) - (vector-float*! s5-0 (-> s4-0 vector 2) (-> obj engine-thrust)) - (rigid-body-method-13 (-> obj rbody) (-> s3-1 world-pos) s5-0) + (vector-float*! s5-0 (-> s4-0 vector 2) (-> this engine-thrust)) + (rigid-body-method-13 (-> this rbody) (-> s3-1 world-pos) s5-0) ) ) (dotimes (s4-1 2) - (when (-> obj mine s4-1 enable) - (let ((v1-43 (-> obj control-point-array data (if (zero? s4-1) - 5 - 4 - ) + (when (-> this mine s4-1 enable) + (let ((v1-43 (-> this control-point-array data (if (zero? s4-1) + 5 + 4 + ) ) ) ) (vector-float*! s5-0 *y-vector* (-> *BALLOONLURKER-bank* mine-weight)) - (rigid-body-method-13 (-> obj rbody) (-> v1-43 world-pos) s5-0) + (rigid-body-method-13 (-> this rbody) (-> v1-43 world-pos) s5-0) ) ) ) (vector-float*! s5-0 *y-vector* - (* -1.0 (-> obj info gravity-factor) (-> obj info gravity) (-> obj rbody mass)) + (* -1.0 (-> this info gravity-factor) (-> this info gravity) (-> this rbody mass)) ) - (rigid-body-method-15 (-> obj rbody) s5-0) + (rigid-body-method-15 (-> this rbody) s5-0) ) - (when (or (-> obj player-impulse) (-> obj player-contact)) - (set! (-> obj player-impulse) #f) - (rigid-body-method-13 (-> obj rbody) (-> obj player-force-position) (-> obj player-force)) + (when (or (-> this player-impulse) (-> this player-contact)) + (set! (-> this player-impulse) #f) + (rigid-body-method-13 (-> this rbody) (-> this player-force-position) (-> this player-force)) ) - (when (-> obj explosion) - (set! (-> obj explosion) #f) - (rigid-body-method-13 (-> obj rbody) (-> obj explosion-force-position) (-> obj explosion-force)) + (when (-> this explosion) + (set! (-> this explosion) #f) + (rigid-body-method-13 (-> this rbody) (-> this explosion-force-position) (-> this explosion-force)) ) 0 (none) @@ -623,7 +623,7 @@ (seek! (-> self rudder-control) (fmax -1.0 (fmin 1.0 (/ f2-2 (fmax 4096.0 f0-4)))) - (* 4.0 (-> *display* seconds-per-frame)) + (* 4.0 (seconds-per-frame)) ) ) (let ((f0-12 0.0) @@ -638,11 +638,11 @@ ) (else (let ((f0-14 (analog-input (the-as int (-> *cpad-list* cpads 1 leftx)) 128.0 48.0 110.0 -1.0))) - (seek! (-> self rudder-control) f0-14 (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self rudder-control) f0-14 (* 2.0 (seconds-per-frame))) ) (if (cpad-hold? 1 x) - (seek! (-> self throttle-control) 1.0 (-> *display* seconds-per-frame)) - (seek! (-> self throttle-control) 0.0 (* 0.25 (-> *display* seconds-per-frame))) + (seek! (-> self throttle-control) 1.0 (seconds-per-frame)) + (seek! (-> self throttle-control) 0.0 (* 0.25 (seconds-per-frame))) ) ) ) @@ -744,7 +744,7 @@ (defstate balloonlurker-die (balloonlurker) :event #f :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self vulnerable) #f) (set! (-> self dead) #t) ) @@ -760,8 +760,8 @@ (apply-all (-> self link) actor-link-dead-hook (& sv-16)) (when (and sv-16 sv-24) (process-grab? *target*) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -790,7 +790,7 @@ (until v1-27 (suspend) (ja :num! (loop!)) - (set! v1-27 (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 30)) + (set! v1-27 (or (time-elapsed? (-> self state-time) (seconds 30)) (< 819200.0 (- (-> self root-overlay trans y) (-> self water-y))) ) ) @@ -803,22 +803,22 @@ :post balloonlurker-post ) -(defmethod relocate balloonlurker ((obj balloonlurker) (arg0 int)) - (if (nonzero? (-> obj propeller)) - (&+! (-> obj propeller) arg0) +(defmethod relocate balloonlurker ((this balloonlurker) (arg0 int)) + (if (nonzero? (-> this propeller)) + (&+! (-> this propeller) arg0) ) - (if (nonzero? (-> obj rudder)) - (&+! (-> obj rudder) arg0) + (if (nonzero? (-> this rudder)) + (&+! (-> this rudder) arg0) ) - (if (nonzero? (-> obj mine 0)) - (&+! (-> obj mine 0) arg0) + (if (nonzero? (-> this mine 0)) + (&+! (-> this mine 0) arg0) ) - (if (nonzero? (-> obj mine 1)) - (&+! (-> obj mine 1) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method balloonlurker 7)) this arg0) ) ) @@ -886,8 +886,8 @@ ) ) -(defmethod balloonlurker-pilot-method-20 balloonlurker-pilot ((obj balloonlurker-pilot)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod balloonlurker-pilot-method-20 balloonlurker-pilot ((this balloonlurker-pilot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -903,15 +903,15 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod balloonlurker-pilot-method-21 balloonlurker-pilot ((obj balloonlurker-pilot)) - (initialize-skeleton obj *balloonlurker-pilot-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 6)) +(defmethod balloonlurker-pilot-method-21 balloonlurker-pilot ((this balloonlurker-pilot)) + (initialize-skeleton this *balloonlurker-pilot-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 6)) 0 (none) ) @@ -931,8 +931,8 @@ (none) ) -(defmethod rigid-body-platform-method-30 balloonlurker ((obj balloonlurker)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 balloonlurker ((this balloonlurker)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -980,28 +980,28 @@ (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-31 balloonlurker ((obj balloonlurker)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *balloonlurker-sg* '()) - (set! (-> obj root-overlay pause-adjust-distance) 1228800.0) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) +(defmethod rigid-body-platform-method-31 balloonlurker ((this balloonlurker)) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *balloonlurker-sg* '()) + (set! (-> this root-overlay pause-adjust-distance) 1228800.0) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj water-y) (-> obj root-overlay trans y)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) + (set! (-> this water-y) (-> this root-overlay trans y)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this link) (new 'process 'actor-link-info this)) (balloonlurker-find-nearest-path-point) - (balloonlurker-snap-to-path-point (-> obj dest-index)) - (rigid-body-platform-method-29 obj *balloonlurker-constants*) + (balloonlurker-snap-to-path-point (-> this dest-index)) + (rigid-body-platform-method-29 this *balloonlurker-constants*) (dotimes (s5-0 4) - (let ((s4-0 (-> obj control-point-array data s5-0))) + (let ((s4-0 (-> this control-point-array data s5-0))) (let ((f30-0 (* 16384.0 (the float (logand s5-0 3))))) (set! (-> s4-0 local-pos x) (* 24576.0 (cos f30-0))) (set! (-> s4-0 local-pos y) 61440.0) @@ -1010,60 +1010,62 @@ (set! (-> s4-0 local-pos w) 1.0) ) ) - (let ((v1-22 (-> obj control-point-array data 4))) + (let ((v1-22 (-> this control-point-array data 4))) (set! (-> v1-22 local-pos x) 0.0) (set! (-> v1-22 local-pos y) 61440.0) (set! (-> v1-22 local-pos z) -40960.0) (set! (-> v1-22 local-pos w) 1.0) ) - (let ((v1-24 (-> obj control-point-array data 5))) + (let ((v1-24 (-> this control-point-array data 5))) (set! (-> v1-24 local-pos x) 0.0) (set! (-> v1-24 local-pos y) 61440.0) (set! (-> v1-24 local-pos z) 40960.0) (set! (-> v1-24 local-pos w) 1.0) ) - (let ((v1-26 (-> obj control-point-array data 6))) + (let ((v1-26 (-> this control-point-array data 6))) (set! (-> v1-26 local-pos x) 0.0) (set! (-> v1-26 local-pos y) 0.0) (set! (-> v1-26 local-pos z) 0.0) (set! (-> v1-26 local-pos w) 1.0) ) - (set! (-> obj buoyancy-factor) (-> obj info buoyancy-factor)) - (set! (-> obj player-impulse) #f) - (set! (-> obj player-contact) #f) - (set! (-> obj auto-pilot) #t) - (set! (-> obj vulnerable) #t) - (set! (-> obj dead) #f) - (set! (-> obj explosion) #f) - (set! (-> obj propeller) (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :z -1.0 :w 1.0) 8192.0)) - (set! (-> obj rudder) (new 'process 'joint-mod-set-local obj 12 #f #t #f)) - (set! (-> obj mine 0) (new 'process 'joint-mod-set-world obj 8 #f)) - (set! (-> obj mine 1) (new 'process 'joint-mod-set-world obj 5 #f)) - (set! (-> obj explosion-joint-index-bytes 0) 10) - (set! (-> obj explosion-joint-index-bytes 1) 7) - (set! (-> obj engine-sound-id) (new 'static 'sound-id)) - (set! (-> obj pedal-sound-id) (new 'static 'sound-id)) - (set! (-> obj player-force quad) (-> *null-vector* quad)) - (set! (-> obj player-velocity quad) (-> *null-vector* quad)) + (set! (-> this buoyancy-factor) (-> this info buoyancy-factor)) + (set! (-> this player-impulse) #f) + (set! (-> this player-contact) #f) + (set! (-> this auto-pilot) #t) + (set! (-> this vulnerable) #t) + (set! (-> this dead) #f) + (set! (-> this explosion) #f) + (set! (-> this propeller) + (new 'process 'joint-mod-spinner this 4 (new 'static 'vector :z -1.0 :w 1.0) 8192.0) + ) + (set! (-> this rudder) (new 'process 'joint-mod-set-local this 12 #f #t #f)) + (set! (-> this mine 0) (new 'process 'joint-mod-set-world this 8 #f)) + (set! (-> this mine 1) (new 'process 'joint-mod-set-world this 5 #f)) + (set! (-> this explosion-joint-index-bytes 0) 10) + (set! (-> this explosion-joint-index-bytes 1) 7) + (set! (-> this engine-sound-id) (new 'static 'sound-id)) + (set! (-> this pedal-sound-id) (new 'static 'sound-id)) + (set! (-> this player-force quad) (-> *null-vector* quad)) + (set! (-> this player-velocity quad) (-> *null-vector* quad)) 0 (none) ) ;; WARN: Function (method 11 balloonlurker) has a return type of none, but the expression builder found a return statement. -(defmethod init-from-entity! balloonlurker ((obj balloonlurker) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) +(defmethod init-from-entity! balloonlurker ((this balloonlurker) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) (cond - ((logtest? (-> (entity-actor-lookup (-> obj entity) 'alt-actor 0) extra perm status) + ((logtest? (-> (entity-actor-lookup (-> this entity) 'alt-actor 0) extra perm status) (entity-perm-status complete) ) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (return #f) ) (else - (process-spawn balloonlurker-pilot obj :to obj) + (process-spawn balloonlurker-pilot this :to this) (go balloonlurker-patrol) ) ) diff --git a/goal_src/jak1/levels/misty/bonelurker.gc b/goal_src/jak1/levels/misty/bonelurker.gc index a9abfea70e..3aae5cedf7 100644 --- a/goal_src/jak1/levels/misty/bonelurker.gc +++ b/goal_src/jak1/levels/misty/bonelurker.gc @@ -40,24 +40,24 @@ (none) ) -(defmethod touch-handler bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod touch-handler bonelurker ((this bonelurker) (arg0 process) (arg1 event-message-block)) + (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (set! (-> obj speed-scale) 0.5) + (set! (-> this speed-scale) 0.5) #t ) ) ) -(defmethod attack-handler bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler bonelurker ((this bonelurker) (arg0 process) (arg1 event-message-block)) (with-pp - (set! (-> obj state-time) (-> *display* base-frame-counter)) + (set-time! (-> this state-time)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) pp) (set! (-> a1-1 num-params) 2) @@ -66,15 +66,15 @@ (set! (-> a1-1 param 1) (the-as uint 2)) (cond ((or (send-event-function *target* a1-1) (= (-> arg1 param 1) 'explode)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj nav-enemy-die)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this nav-enemy-die)) 'die ) (else (cond (((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 2) ) (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) @@ -83,21 +83,21 @@ ) ((and ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) - (= (-> obj skel root-channel 0) (-> obj skel channel)) - (let ((v1-30 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (= (-> this skel root-channel 0) (-> this skel channel)) + (let ((v1-30 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (or (= v1-30 (-> obj draw art-group data 9)) (= v1-30 (-> obj draw art-group data 10))) + (or (= v1-30 (-> this draw art-group data 9)) (= v1-30 (-> this draw art-group data 10))) ) ) (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) - (set! (-> obj bump-player-time) (-> *display* base-frame-counter)) - (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + (set-time! (-> this bump-player-time)) + (logclear! (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) 'push ) ) @@ -110,7 +110,7 @@ (defbehavior bonelurker-stunned-event-handler bonelurker ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (nav-enemy-set-hit-from-direction arg0) (send-event arg0 'get-attack-count 1) (logclear! (-> self mask) (process-mask actor-pause)) @@ -185,7 +185,7 @@ nav-enemy-default-event-handler :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) (if (and (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf6))) - (>= (- (-> *display* base-frame-counter) (-> self bump-player-time)) (seconds 0.5)) + (time-elapsed? (-> self bump-player-time) (seconds 0.5)) ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) ) @@ -444,8 +444,8 @@ nav-enemy-default-event-handler ) ) -(defmethod initialize-collision bonelurker ((obj bonelurker)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision bonelurker ((this bonelurker)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -485,18 +485,18 @@ nav-enemy-default-event-handler (set! (-> s5-0 nav-radius) 8192.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod nav-enemy-method-48 bonelurker ((obj bonelurker)) - (initialize-skeleton obj *bonelurker-sg* '()) - (init-defaults! obj *bonelurker-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 bonelurker ((this bonelurker)) + (initialize-skeleton this *bonelurker-sg* '()) + (init-defaults! this *bonelurker-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) diff --git a/goal_src/jak1/levels/misty/misty-conveyor.gc b/goal_src/jak1/levels/misty/misty-conveyor.gc index caa1f8be3a..49664b0e32 100644 --- a/goal_src/jak1/levels/misty/misty-conveyor.gc +++ b/goal_src/jak1/levels/misty/misty-conveyor.gc @@ -183,7 +183,7 @@ (vector<-cspace! (-> self root-override trans) gp-0) ) (set! (-> self path-position quad) (-> self root-override trans quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (suspend) ) ) @@ -207,10 +207,10 @@ 0.0 (forward-up-nopitch->quaternion s3-0 a1-3 (new 'static 'vector :y 1.0 :w 1.0)) (loop - (if (>= (the float (- (-> *display* base-frame-counter) (-> self state-time))) f30-0) + (if (>= (the float (- (current-time) (-> self state-time))) f30-0) (go keg-on-path) ) - (let ((f28-0 (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) f30-0))) + (let ((f28-0 (/ (the float (- (current-time) (-> self state-time))) f30-0))) (vector-lerp! (-> self root-override trans) gp-0 s5-0 f28-0) (set! (-> self path-position quad) (-> self root-override trans quad)) (quaternion-slerp! (-> self root-override quat) s4-0 s3-0 f28-0) @@ -300,8 +300,8 @@ (set! f22-0 (/ f0-32 f20-0)) ) ) - (set! sv-64 (+ sv-64 (* sv-80 (-> *display* seconds-per-frame)))) - (set! sv-48 (+ sv-48 (* sv-64 (-> *display* seconds-per-frame)))) + (set! sv-64 (+ sv-64 (* sv-80 (seconds-per-frame)))) + (set! sv-48 (+ sv-48 (* sv-64 (seconds-per-frame)))) (when (< sv-48 0.0) (set! sv-48 0.0) (activate! (-> self smush) -0.15 90 150 1.0 1.0) @@ -359,15 +359,15 @@ 0 (clear-collide-with-as (-> self root-override)) (vector-normalize! gp-0 1.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (go keg-die) ) (let ((v1-23 (-> self root-override trans))) - (vector-float*! s5-0 gp-0 (* f30-0 (-> *display* seconds-per-frame))) - (set! (-> s5-0 y) (* f28-0 (-> *display* seconds-per-frame))) - (+! f28-0 (* f26-0 (-> *display* seconds-per-frame))) + (vector-float*! s5-0 gp-0 (* f30-0 (seconds-per-frame))) + (set! (-> s5-0 y) (* f28-0 (seconds-per-frame))) + (+! f28-0 (* f26-0 (seconds-per-frame))) (vector+! v1-23 v1-23 s5-0) ) (ja :num! (loop!)) @@ -558,41 +558,41 @@ (none) ) -(defmethod relocate keg-conveyor ((obj keg-conveyor) (arg0 int)) - (if (nonzero? (-> obj pivot)) - (&+! (-> obj pivot) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method keg-conveyor 7)) this arg0) ) ) ;; WARN: Function (method 11 keg-conveyor) has a return type of none, but the expression builder found a return statement. -(defmethod init-from-entity! keg-conveyor ((obj keg-conveyor) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy death)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *keg-conveyor-sg* '()) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (when (logtest? (-> obj path flags) (path-control-flag not-found)) +(defmethod init-from-entity! keg-conveyor ((this keg-conveyor) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy death)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *keg-conveyor-sg* '()) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (when (logtest? (-> this path flags) (path-control-flag not-found)) (go process-drawable-art-error "path") (return #f) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj pivot) (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :x 1.0 :w 1.0) 65536.0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this pivot) (new 'process 'joint-mod-spinner this 4 (new 'static 'vector :x 1.0 :w 1.0) 65536.0)) (let ((s5-1 (new-stack-vector0))) (let ((s4-0 (new-stack-matrix0))) - (path-control-method-12 (-> obj path) s5-1 0.0) - (set-heading-vec! (-> obj root) s5-1) - (quaternion->matrix s4-0 (-> obj root quat)) + (path-control-method-12 (-> this path) s5-1 0.0) + (set-heading-vec! (-> this root) s5-1) + (quaternion->matrix s4-0 (-> this root quat)) (set-vector! s5-1 -4096.0 -3072.0 -1433.6 1.0) (vector-rotate*! s5-1 s5-1 s4-0) ) - (vector+! (-> obj root trans) (-> obj root trans) s5-1) + (vector+! (-> this root trans) (-> this root trans) s5-1) ) - (process-spawn keg-conveyor-paddle obj :to obj) + (process-spawn keg-conveyor-paddle this :to this) (go keg-conveyor-idle) (none) ) diff --git a/goal_src/jak1/levels/misty/misty-obs.gc b/goal_src/jak1/levels/misty/misty-obs.gc index b53a52833b..182b9a4798 100644 --- a/goal_src/jak1/levels/misty/misty-obs.gc +++ b/goal_src/jak1/levels/misty/misty-obs.gc @@ -1022,11 +1022,7 @@ :code (behavior () (local-vars (s4-0 int)) (loop - (quaternion-rotate-local-x! - (-> self root quat) - (-> self root quat) - (* -5461.3335 (-> *display* seconds-per-frame)) - ) + (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) (* -5461.3335 (seconds-per-frame))) (let ((gp-0 (-> self part)) (s5-0 (-> self root trans)) ) @@ -1047,13 +1043,13 @@ :post ja-post ) -(defmethod init-from-entity! boatpaddle ((obj boatpaddle) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *boatpaddle-sg* '()) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 196) obj)) +(defmethod init-from-entity! boatpaddle ((this boatpaddle) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *boatpaddle-sg* '()) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 196) this)) (go boatpaddle-idle) (none) ) @@ -1094,7 +1090,7 @@ (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) - (* -1.0 (-> *display* seconds-per-frame) (-> self angle-speed)) + (* -1.0 (seconds-per-frame) (-> self angle-speed)) ) (if (-> self spawn-particle-enable) (spawn (-> self part) (-> self root trans)) @@ -1105,16 +1101,16 @@ :post ja-post ) -(defmethod init-from-entity! windturbine ((obj windturbine) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj spawn-particle-enable) (= (res-lump-value arg0 'particle-select uint128) 1)) - (if (-> obj spawn-particle-enable) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 191) obj)) +(defmethod init-from-entity! windturbine ((this windturbine) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this spawn-particle-enable) (= (res-lump-value arg0 'particle-select uint128) 1)) + (if (-> this spawn-particle-enable) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 191) this)) ) - (initialize-skeleton obj *windturbine-sg* '()) + (initialize-skeleton this *windturbine-sg* '()) (go windturbine-idle) (none) ) @@ -1262,9 +1258,9 @@ :post rider-post ) -(defmethod init-from-entity! mis-bone-bridge ((obj mis-bone-bridge) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! mis-bone-bridge ((this mis-bone-bridge) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1300,36 +1296,36 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *mis-bone-bridge-sg* '()) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *mis-bone-bridge-sg* '()) (let ((v1-40 (res-lump-value arg0 'animation-select uint128))) (cond ((= (the-as uint v1-40) 1) - (set! (-> obj fall-anim-index) 2) - (set! (-> obj particle-group) (-> *part-group-id-table* 192)) + (set! (-> this fall-anim-index) 2) + (set! (-> this particle-group) (-> *part-group-id-table* 192)) ) ((= (the-as uint v1-40) 2) - (set! (-> obj fall-anim-index) 3) - (set! (-> obj particle-group) (-> *part-group-id-table* 194)) + (set! (-> this fall-anim-index) 3) + (set! (-> this particle-group) (-> *part-group-id-table* 194)) ) ((= (the-as uint v1-40) 3) - (set! (-> obj fall-anim-index) 2) - (set! (-> obj particle-group) (-> *part-group-id-table* 193)) + (set! (-> this fall-anim-index) 2) + (set! (-> this particle-group) (-> *part-group-id-table* 193)) ) ((= (the-as uint v1-40) 7) - (set! (-> obj fall-anim-index) 4) - (set! (-> obj particle-group) (-> *part-group-id-table* 195)) + (set! (-> this fall-anim-index) 4) + (set! (-> this particle-group) (-> *part-group-id-table* 195)) ) (else - (set! (-> obj fall-anim-index) 2) - (set! (-> obj particle-group) (-> *part-group-id-table* 192)) + (set! (-> this fall-anim-index) 2) + (set! (-> this particle-group) (-> *part-group-id-table* 192)) ) ) ) - (set! (-> obj hit-points) 3) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this hit-points) 3) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go mis-bone-bridge-fall #t) (go mis-bone-bridge-idle) ) @@ -1369,8 +1365,8 @@ ) (defun actor-wait-for-period ((arg0 time-frame)) - (let ((s5-0 (-> *display* base-frame-counter))) - (while (< (- (-> *display* base-frame-counter) s5-0) arg0) + (let ((s5-0 (current-time))) + (while (not (time-elapsed? s5-0 arg0)) (suspend) ) ) @@ -1382,16 +1378,16 @@ (sound-play "falling-bones") (launch-particles (-> *part-id-table* 281) (-> self root-override trans)) (let ((gp-1 #f) - (s5-1 (-> *display* base-frame-counter)) + (s5-1 (current-time)) ) (loop (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 15.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) - (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.15))) + (when (and (not gp-1) (time-elapsed? s5-1 (seconds 0.15))) (set! gp-1 #t) (send-to-next-and-prev (-> self link) 'touch) ) - (if (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.25)) + (if (time-elapsed? s5-1 (seconds 0.25)) (go breakaway-fall) ) (suspend) @@ -1411,8 +1407,8 @@ ) (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 32.0 0) 0.4) :frame-num (ja-aframe 16.0 0)) (until (ja-done? 0) - (+! f30-0 (* f28-0 (-> *display* seconds-per-frame))) - (+! f28-0 (* f26-0 (-> *display* seconds-per-frame))) + (+! f30-0 (* f28-0 (seconds-per-frame))) + (+! f28-0 (* f26-0 (seconds-per-frame))) (+! (-> self root-override trans y) f30-0) (suspend) (ja :num! (seek! (ja-aframe 32.0 0) 0.4)) @@ -1423,9 +1419,9 @@ :post rider-post ) -(defmethod init! breakaway ((obj breakaway) (arg0 res-lump) (arg1 int)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init! breakaway ((this breakaway) (arg0 res-lump) (arg1 int)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1443,14 +1439,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (process-drawable-from-entity! obj (the-as entity-actor arg0)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (process-drawable-from-entity! this (the-as entity-actor arg0)) (none) ) -(defmethod go-idle breakaway ((obj breakaway)) +(defmethod go-idle breakaway ((this breakaway)) (go breakaway-idle) (none) ) @@ -1497,24 +1493,24 @@ :bounds (static-spherem 0 0 0 7) ) -(defmethod init-from-entity! breakaway-right ((obj breakaway-right) (arg0 entity-actor)) - (init! obj arg0 3) - (initialize-skeleton obj *breakaway-right-sg* '()) - (go-idle obj) +(defmethod init-from-entity! breakaway-right ((this breakaway-right) (arg0 entity-actor)) + (init! this arg0 3) + (initialize-skeleton this *breakaway-right-sg* '()) + (go-idle this) (none) ) -(defmethod init-from-entity! breakaway-mid ((obj breakaway-mid) (arg0 entity-actor)) - (init! obj arg0 3) - (initialize-skeleton obj *breakaway-mid-sg* '()) - (go-idle obj) +(defmethod init-from-entity! breakaway-mid ((this breakaway-mid) (arg0 entity-actor)) + (init! this arg0 3) + (initialize-skeleton this *breakaway-mid-sg* '()) + (go-idle this) (none) ) -(defmethod init-from-entity! breakaway-left ((obj breakaway-left) (arg0 entity-actor)) - (init! obj arg0 3) - (initialize-skeleton obj *breakaway-left-sg* '()) - (go-idle obj) +(defmethod init-from-entity! breakaway-left ((this breakaway-left) (arg0 entity-actor)) + (init! this arg0 3) + (initialize-skeleton this *breakaway-left-sg* '()) + (go-idle this) (none) ) @@ -1560,16 +1556,16 @@ :bounds (static-spherem 0 0 0 4) ) -(defmethod rigid-body-platform-method-27 bone-platform ((obj bone-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-27 bone-platform ((this bone-platform) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 arg0 (-> obj rbody position)) + (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) (let* ((f0-1 (vector-length gp-0)) (f1-1 (* 20.0 (fmax 0.0 (fmin 4096.0 (+ -819.2 f0-1))))) ) (when (< 0.0 f1-1) (vector-float*! gp-0 gp-0 (/ f1-1 f0-1)) - (rigid-body-method-15 (-> obj rbody) gp-0) + (rigid-body-method-15 (-> this rbody) gp-0) ) ) ) @@ -1577,12 +1573,12 @@ (none) ) -(defmethod rigid-body-platform-method-23 bone-platform ((obj bone-platform) (arg0 float)) +(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)) - obj + this (the-as basic arg0) ) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) @@ -1611,14 +1607,14 @@ ) ) (let ((f30-1 -4096.0)) - (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (seconds-per-frame))) ) ) ) @@ -1633,8 +1629,8 @@ :post rigid-body-platform-post ) -(defmethod rigid-body-platform-method-30 bone-platform ((obj bone-platform)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 bone-platform ((this bone-platform)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1652,22 +1648,22 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-31 bone-platform ((obj bone-platform)) - (initialize-skeleton obj *mis-bone-platform-sg* '()) - (rigid-body-platform-method-29 obj *bone-platform-constants*) - (set! (-> obj float-height-offset) -4096.0) - (if (name= (-> obj name) "bone-platform-5") - (set-vector! (-> obj root-overlay scale) 0.8 1.0 0.8 1.0) +(defmethod rigid-body-platform-method-31 bone-platform ((this bone-platform)) + (initialize-skeleton this *mis-bone-platform-sg* '()) + (rigid-body-platform-method-29 this *bone-platform-constants*) + (set! (-> this float-height-offset) -4096.0) + (if (name= (-> this name) "bone-platform-5") + (set-vector! (-> this root-overlay scale) 0.8 1.0 0.8 1.0) ) - (let ((s5-0 (-> obj info control-point-count))) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0))))) (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) (set! (-> s3-0 local-pos y) -12288.0) @@ -1677,7 +1673,7 @@ ) ) ) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) 0 (none) ) @@ -1759,9 +1755,9 @@ ) ) -(defmethod battlecontroller-method-27 misty-battlecontroller ((obj misty-battlecontroller)) - ((the-as (function battlecontroller none) (find-parent-method misty-battlecontroller 27)) obj) - (set! (-> obj misty-ambush-collision-hack) #t) +(defmethod battlecontroller-method-27 misty-battlecontroller ((this misty-battlecontroller)) + ((the-as (function battlecontroller none) (find-parent-method misty-battlecontroller 27)) this) + (set! (-> this misty-ambush-collision-hack) #t) 0 (none) ) @@ -1865,12 +1861,12 @@ ) ) -(defmethod init-from-entity! boat-fuelcell ((obj boat-fuelcell) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj play-cutscene?) #f) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) +(defmethod init-from-entity! boat-fuelcell ((this boat-fuelcell) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this play-cutscene?) #f) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go boat-fuelcell-spawn) (go boat-fuelcell-idle) ) diff --git a/goal_src/jak1/levels/misty/misty-teetertotter.gc b/goal_src/jak1/levels/misty/misty-teetertotter.gc index 569ecc5c6a..2d39af3b96 100644 --- a/goal_src/jak1/levels/misty/misty-teetertotter.gc +++ b/goal_src/jak1/levels/misty/misty-teetertotter.gc @@ -135,8 +135,8 @@ :post rider-post ) -(defmethod init-from-entity! teetertotter ((obj teetertotter) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! teetertotter ((this teetertotter) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -197,13 +197,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *teetertotter-sg* '()) - (set! (-> obj launched-player) #f) - (set! (-> obj in-launch-window) #f) - (set! (-> obj rock-is-dangerous) #f) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *teetertotter-sg* '()) + (set! (-> this launched-player) #f) + (set! (-> this in-launch-window) #f) + (set! (-> this rock-is-dangerous) #f) (go teetertotter-idle) (none) ) diff --git a/goal_src/jak1/levels/misty/misty-warehouse.gc b/goal_src/jak1/levels/misty/misty-warehouse.gc index 207d279639..63fda80401 100644 --- a/goal_src/jak1/levels/misty/misty-warehouse.gc +++ b/goal_src/jak1/levels/misty/misty-warehouse.gc @@ -62,8 +62,8 @@ (suspend) ) (camera-change-to "camera-160" 150 #f) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 3)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 3)) (suspend) ) ) @@ -88,9 +88,9 @@ ) (save-reminder gp-0 (logior v1-1 2) 0) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 1)) + (set-time! (-> self state-time)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -123,9 +123,9 @@ :post #f ) -(defmethod init-from-entity! silostep ((obj silostep) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask movie-subject)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! silostep ((this silostep) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask movie-subject)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -143,17 +143,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *silostep-sg* '()) - (set! (-> obj anim-limit) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *silostep-sg* '()) + (set! (-> this anim-limit) (* (res-lump-float arg0 'distance :default 1.0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this link) (new 'process 'actor-link-info this)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go silostep-rise #t) (go silostep-idle) ) @@ -174,8 +174,8 @@ ) -(defmethod eco-door-method-24 rounddoor ((obj rounddoor)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod eco-door-method-24 rounddoor ((this rounddoor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -187,24 +187,24 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 rounddoor ((obj rounddoor)) - (initialize-skeleton obj *rounddoor-sg* '()) - (set! (-> obj open-distance) 69632.0) - (set! (-> obj close-distance) 81920.0) - (set! (-> obj open-sound) (static-sound-name "arenadoor-open")) - (set! (-> obj close-sound) (static-sound-name "arenadoor-close")) - (set! (-> obj speed) 1.5) - (set! (-> obj auto-close) #t) - (set! (-> obj one-way) #t) - (vector-x-quaternion! (-> obj out-dir) (-> obj root-override quat)) - (set! (-> obj out-dir w) (- 8192.0 (vector-dot (-> obj out-dir) (-> obj root-override trans)))) - (update-transforms! (-> obj root-override)) +(defmethod eco-door-method-25 rounddoor ((this rounddoor)) + (initialize-skeleton this *rounddoor-sg* '()) + (set! (-> this open-distance) 69632.0) + (set! (-> this close-distance) 81920.0) + (set! (-> this open-sound) (static-sound-name "arenadoor-open")) + (set! (-> this close-sound) (static-sound-name "arenadoor-close")) + (set! (-> this speed) 1.5) + (set! (-> this auto-close) #t) + (set! (-> this one-way) #t) + (vector-x-quaternion! (-> this out-dir) (-> this root-override quat)) + (set! (-> this out-dir w) (- 8192.0 (vector-dot (-> this out-dir) (-> this root-override trans)))) + (update-transforms! (-> this root-override)) 0 (none) ) diff --git a/goal_src/jak1/levels/misty/mistycannon.gc b/goal_src/jak1/levels/misty/mistycannon.gc index a32ffa006c..8fdaa9f6ed 100644 --- a/goal_src/jak1/levels/misty/mistycannon.gc +++ b/goal_src/jak1/levels/misty/mistycannon.gc @@ -20,7 +20,7 @@ (defun angle-tracker-apply-move! ((arg0 angle-tracker) (arg1 float)) - (let* ((f0-2 (* arg1 (-> arg0 speed) (-> *display* seconds-per-frame))) + (let* ((f0-2 (* arg1 (-> arg0 speed) (seconds-per-frame))) (f0-3 (+ (-> arg0 value) f0-2)) ) (when (!= (-> arg0 range) 0.0) @@ -75,7 +75,7 @@ (defun angle-tracker-seek! ((arg0 angle-tracker) (arg1 float)) (let* ((v1-0 arg0) (f1-1 (the float (sar (shl (the int (+ (-> v1-0 min) (-> v1-0 value))) 48) 48))) - (f0-6 (* (-> arg0 speed) (-> *display* seconds-per-frame))) + (f0-6 (* (-> arg0 speed) (seconds-per-frame))) (v1-9 (the float (sar (shl (the int (- arg1 f1-1)) 48) 48))) ) (when (< (fabs v1-9) f0-6) @@ -625,18 +625,18 @@ ) -(defmethod relocate mistycannon-missile ((obj mistycannon-missile) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate mistycannon-missile ((this mistycannon-missile) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as mistycannon-missile ((method-of-type process-drawable relocate) obj arg0)) + (the-as mistycannon-missile ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate mistycannon-missile ((obj mistycannon-missile)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate mistycannon-missile ((this mistycannon-missile)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -645,9 +645,9 @@ :bounds (static-spherem 0 0 0 4) ) -(defmethod spawn-part mistycannon-missile ((obj mistycannon-missile)) - (let ((gp-0 (-> obj part)) - (a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7))) +(defmethod spawn-part mistycannon-missile ((this mistycannon-missile)) + (let ((gp-0 (-> this part)) + (a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7))) ) (spawn gp-0 a1-1) ) @@ -664,7 +664,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self sfx) (the-as uint 0)) 0 ) @@ -675,14 +675,15 @@ ) :code (behavior () (clear-collide-with-as (-> self root-override)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self muzzle-time)))) + (while (not (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self muzzle-time))))) (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) (suspend) - (let ((f0-1 (fmin 1.0 (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) - (the float (the int (* 300.0 (-> self muzzle-time)))) - ) - ) - ) + (let ((f0-1 + (fmin + 1.0 + (/ (the float (- (current-time) (-> self state-time))) (the float (the int (* 300.0 (-> self muzzle-time))))) + ) + ) ) (set! (-> self root-override scale x) (* 0.6 f0-1)) (set! (-> self root-override scale y) (* 0.6 f0-1)) @@ -733,7 +734,7 @@ (set! (-> self sfx) (the-as uint 0)) 0 ) - (set! (-> self ground-time) (-> *display* base-frame-counter)) + (set-time! (-> self ground-time)) (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) (ja-no-eval :group! sack-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -902,8 +903,8 @@ ) (suspend) (clear-collide-with-as (-> self root-override)) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 3)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 3)) (spawn (-> self part2) (-> self root-override trans)) (suspend) ) @@ -1067,28 +1068,28 @@ (none) ) -(defmethod rotate! mistycannon ((obj mistycannon) (arg0 float)) - (angle-tracker-apply-move! (-> obj rotate) arg0) +(defmethod rotate! mistycannon ((this mistycannon) (arg0 float)) + (angle-tracker-apply-move! (-> this rotate) arg0) 0 (none) ) -(defmethod tilt! mistycannon ((obj mistycannon) (arg0 float)) - (angle-tracker-apply-move! (-> obj tilt) arg0) +(defmethod tilt! mistycannon ((this mistycannon) (arg0 float)) + (angle-tracker-apply-move! (-> this tilt) arg0) 0 (none) ) ;; WARN: Function (method 22 mistycannon) has a return type of none, but the expression builder found a return statement. -(defmethod mistycannon-method-22 mistycannon ((obj mistycannon) (arg0 float) (arg1 float) (arg2 float)) - (if (not (-> obj postbindinfo-ok)) +(defmethod mistycannon-method-22 mistycannon ((this mistycannon) (arg0 float) (arg1 float) (arg2 float)) + (if (not (-> this postbindinfo-ok)) (return #f) ) - (let* ((s3-0 (-> obj launch-origin)) + (let* ((s3-0 (-> this launch-origin)) (s2-0 (new 'stack-no-clear 'vector)) - (v1-3 (-> obj rotate)) + (v1-3 (-> this rotate)) (f30-0 (the float (sar (shl (the int (+ (-> v1-3 min) (-> v1-3 value))) 48) 48))) - (v1-8 (-> obj tilt)) + (v1-8 (-> this tilt)) (f26-0 (the float (sar (shl (the int (+ (-> v1-8 min) (-> v1-8 value))) 48) 48))) (f28-0 (/ 24576.0 arg0)) ) @@ -1097,57 +1098,57 @@ (set! (-> s2-0 z) (* arg0 f24-0 (cos f30-0))) ) (set! (-> s2-0 y) (* arg0 (sin f26-0))) - (vector-float*! (-> obj hellmouth) s2-0 f28-0) - (vector+! (-> obj hellmouth) (-> obj hellmouth) s3-0) - (spawn-mistycannon-missile obj s3-0 s2-0 f30-0 arg1 f28-0 arg2 (-> obj entity)) + (vector-float*! (-> this hellmouth) s2-0 f28-0) + (vector+! (-> this hellmouth) (-> this hellmouth) s3-0) + (spawn-mistycannon-missile this s3-0 s2-0 f30-0 arg1 f28-0 arg2 (-> this entity)) ) (sound-play "cannon-shot") - (set! (-> obj part local-clock) 0) - (set! (-> obj part-timer) (-> *display* base-frame-counter)) + (set! (-> this part local-clock) 0) + (set-time! (-> this part-timer)) (mistycannon-pick-random-target-point) 0 (none) ) -(defmethod mistycannon-method-23 mistycannon ((obj mistycannon)) - (when (< (- (-> *display* base-frame-counter) (-> obj part-timer)) (seconds 3)) - (let ((v1-4 (-> obj rotate))) +(defmethod mistycannon-method-23 mistycannon ((this mistycannon)) + (when (not (time-elapsed? (-> this part-timer) (seconds 3))) + (let ((v1-4 (-> this rotate))) (set! (-> *part-id-table* 529 init-specs 24 initial-valuef) (the float (sar (shl (the int (+ (-> v1-4 min) (-> v1-4 value))) 48) 48)) ) ) - (let ((v1-12 (-> obj rotate))) + (let ((v1-12 (-> this rotate))) (set! (-> *part-id-table* 530 init-specs 23 initial-valuef) (the float (sar (shl (the int (+ (-> v1-12 min) (-> v1-12 value))) 48) 48)) ) ) - (let ((v1-20 (-> obj rotate))) + (let ((v1-20 (-> this rotate))) (set! (-> *part-id-table* 534 init-specs 21 initial-valuef) (the float (sar (shl (the int (+ (-> v1-20 min) (-> v1-20 value))) 48) 48)) ) ) (let ((f0-18 16384.0) - (v1-28 (-> obj tilt)) + (v1-28 (-> this tilt)) ) (set! (-> *part-id-table* 529 init-specs 22 initial-valuef) (- f0-18 (the float (sar (shl (the int (+ (-> v1-28 min) (-> v1-28 value))) 48) 48))) ) ) (let ((f0-20 16384.0) - (v1-36 (-> obj tilt)) + (v1-36 (-> this tilt)) ) (set! (-> *part-id-table* 530 init-specs 21 initial-valuef) (- f0-20 (the float (sar (shl (the int (+ (-> v1-36 min) (-> v1-36 value))) 48) 48))) ) ) (let ((f0-22 16384.0) - (v1-44 (-> obj tilt)) + (v1-44 (-> this tilt)) ) (set! (-> *part-id-table* 534 init-specs 20 initial-valuef) (- f0-22 (the float (sar (shl (the int (+ (-> v1-44 min) (-> v1-44 value))) 48) 48))) ) ) - (spawn (-> obj part) (-> obj hellmouth)) + (spawn (-> this part) (-> this hellmouth)) ) 0 (none) @@ -1390,16 +1391,16 @@ ) (mistycannon-find-trajectory gp-0) (when (= (-> gp-0 time) 0.0) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (when (time-elapsed? (-> self state-time) (seconds 3)) (mistycannon-method-22 self 409600.0 2.0 20480.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (return #f) ) (when (angle-tracker-seek! (-> self tilt) (-> gp-0 theta)) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (when (time-elapsed? (-> self state-time) (seconds 3)) (mistycannon-method-22 self (fmax 163840.0 (fmin 409600.0 (-> gp-0 speed))) (-> gp-0 time) 20480.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) ) ) @@ -1409,7 +1410,7 @@ (defstate mistycannon-aim-at-player (mistycannon) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) @@ -1556,7 +1557,7 @@ :code (behavior () (send-event *camera* 'change-state cam-mistycannon 0) (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 0) (s5-0 0) ) @@ -1587,12 +1588,10 @@ (suspend) ) ) - (let ((v1-45 (and (cpad-hold? 0 x) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1))))) + (let ((v1-45 (and (cpad-hold? 0 x) (time-elapsed? (-> self state-time) (seconds 1))))) (when (zero? s5-0) (when v1-45 - (set! gp-0 - (seekl gp-0 300 (the-as int (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) - ) + (set! gp-0 (seekl gp-0 300 (the-as int (- (current-time) (-> *display* old-base-frame-counter))))) (sound-play "cannon-charge" :id (-> self sound-id) :pitch (* 0.008 (the float gp-0))) ) (when (or (= gp-0 300) (and (not (cpad-hold? 0 x)) (nonzero? gp-0))) @@ -1600,7 +1599,7 @@ (level-hint-spawn (text-id sidekick-mistycannon) "sksp009f" (the-as entity #f) *entity-pool* (game-task none)) (mistycannon-method-22 self (* 4096.0 (the float gp-1)) 2.0 40960.0) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! gp-0 0) (set! s5-0 1) (sound-stop (-> self sound-id)) @@ -1636,7 +1635,7 @@ (-> self root-override) (the-as uint 1) ) - (let ((v0-0 (-> *display* base-frame-counter))) + (let ((v0-0 (current-time))) (set! (-> self state-time) v0-0) v0-0 ) @@ -1645,14 +1644,14 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans rider-trans :code (behavior () (loop (suspend) (mistycannon-method-23 self) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (go mistycannon-waiting-for-player) ) ) @@ -1660,10 +1659,10 @@ :post rider-post ) -(defmethod init-from-entity! mistycannon ((obj mistycannon) (arg0 entity-actor)) +(defmethod init-from-entity! mistycannon ((this mistycannon) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1697,78 +1696,78 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (quaternion-identity! (-> obj root-override quat)) - (initialize-skeleton obj *mistycannon-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj skel prebind-function) mistycannon-prebind-function) - (set! (-> obj skel postbind-function) mistycannon-postbind-function) - (set! (-> obj fact-info-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (quaternion-identity! (-> this root-override quat)) + (initialize-skeleton this *mistycannon-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this skel prebind-function) mistycannon-prebind-function) + (set! (-> this skel postbind-function) mistycannon-postbind-function) + (set! (-> this fact-info-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((f30-0 (res-lump-float arg0 'rotmin :default 16384.0)) (f28-0 (res-lump-float arg0 'rotmax :default 32768.0)) (f0-15 (res-lump-float arg0 'rotspeed :default 3640.889)) ) - (angle-tracker-init-range! (-> obj rotate) f30-0 f28-0 f0-15) + (angle-tracker-init-range! (-> this rotate) f30-0 f28-0 f0-15) ) (let ((f30-1 (res-lump-float arg0 'tiltmin :default -1820.4445)) (f28-1 (res-lump-float arg0 'tiltmax :default 12743.111)) (f0-16 (res-lump-float arg0 'tiltspeed :default 3640.889)) ) - (angle-tracker-init-range! (-> obj tilt) f30-1 f28-1 f0-16) + (angle-tracker-init-range! (-> this tilt) f30-1 f28-1 f0-16) ) - (set! (-> obj avoid-entity) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj center-point w) (res-lump-float arg0 'center-radius)) + (set! (-> this avoid-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this center-point w) (res-lump-float arg0 'center-radius)) (cond - ((= (-> obj center-point w) 0.0) - (set! (-> obj center-point quad) (-> obj root-override trans quad)) - (set! (-> obj center-point w) (-> obj fact-info-override idle-distance)) + ((= (-> this center-point w) 0.0) + (set! (-> this center-point quad) (-> this root-override trans quad)) + (set! (-> this center-point w) (-> this fact-info-override idle-distance)) ) (else (set! sv-16 (new 'static 'res-tag)) (let ((v1-64 (res-lump-data arg0 'center-point pointer :tag-ptr (& sv-16)))) - (set! (-> obj center-point x) (if (and v1-64 (< 0.0 (the float (-> sv-16 elt-count)))) - (-> (the-as (pointer float) v1-64)) - 0.0 - ) + (set! (-> this center-point x) (if (and v1-64 (< 0.0 (the float (-> sv-16 elt-count)))) + (-> (the-as (pointer float) v1-64)) + 0.0 + ) ) ) (set! sv-32 (new 'static 'res-tag)) (let ((v1-67 (res-lump-data arg0 'center-point (pointer float) :tag-ptr (& sv-32)))) - (set! (-> obj center-point y) (if (and v1-67 (< 1.0 (the float (-> sv-32 elt-count)))) - (-> v1-67 1) - 0.0 - ) + (set! (-> this center-point y) (if (and v1-67 (< 1.0 (the float (-> sv-32 elt-count)))) + (-> v1-67 1) + 0.0 + ) ) ) (set! sv-48 (new 'static 'res-tag)) (let ((v1-70 (res-lump-data arg0 'center-point (pointer float) :tag-ptr (& sv-48)))) - (set! (-> obj center-point z) (if (and v1-70 (< 2.0 (the float (-> sv-48 elt-count)))) - (-> v1-70 2) - 0.0 - ) + (set! (-> this center-point z) (if (and v1-70 (< 2.0 (the float (-> sv-48 elt-count)))) + (-> v1-70 2) + 0.0 + ) ) ) ) ) - (set! (-> obj accuracy-range) 16384.0) + (set! (-> this accuracy-range) 16384.0) (mistycannon-pick-random-target-point) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 119) obj)) - (set! (-> obj part-timer) (+ (-> *display* base-frame-counter) (seconds -10))) - (set! (-> obj postbindinfo-ok) #f) - (let ((v1-79 (-> obj rotate))) - (set! (-> obj last-known-rotation) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 119) this)) + (set! (-> this part-timer) (+ (current-time) (seconds -10))) + (set! (-> this postbindinfo-ok) #f) + (let ((v1-79 (-> this rotate))) + (set! (-> this last-known-rotation) (the float (sar (shl (the int (+ (-> v1-79 min) (-> v1-79 value))) 48) 48)) ) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj aim-sound-id) (new-sound-id)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this aim-sound-id) (new-sound-id)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go mistycannon-idle) (go mistycannon-waiting-for-player) ) diff --git a/goal_src/jak1/levels/misty/mud.gc b/goal_src/jak1/levels/misty/mud.gc index 7b8da21c45..31f36744e5 100644 --- a/goal_src/jak1/levels/misty/mud.gc +++ b/goal_src/jak1/levels/misty/mud.gc @@ -42,29 +42,29 @@ ) ) -(defmethod water-vol-method-22 mud ((obj mud)) +(defmethod water-vol-method-22 mud ((this mud)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) - (logclear! (-> obj flags) (water-flags wt23)) - (logior! (-> obj flags) (water-flags wt18)) + (logclear! (-> this flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt18)) (let ((gp-0 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) gp-0) + (set! (-> this draw ripple) gp-0) (set! (-> gp-0 global-scale) 3072.0) (set! (-> gp-0 waveform) ripple-for-mud) - (let ((v1-9 (res-lump-data (-> obj entity) 'water-anim-fade-dist (pointer float)))) + (let ((v1-9 (res-lump-data (-> this entity) 'water-anim-fade-dist (pointer float)))) (when v1-9 (set! (-> gp-0 close-fade-dist) (-> v1-9 0)) (set! (-> gp-0 far-fade-dist) (-> v1-9 1)) ) ) - (case (-> obj look) + (case (-> this look) ((21 25 29) (set! (-> gp-0 close-fade-dist) 4096000000.0) (set! (-> gp-0 far-fade-dist) 8192000000.0) ) ) - (case (-> obj look) + (case (-> this look) ((22 25 24 27 26 31) (set! (-> gp-0 waveform) ripple-for-small-mud) ) diff --git a/goal_src/jak1/levels/misty/muse.gc b/goal_src/jak1/levels/misty/muse.gc index e99b975999..61e0a43f2c 100644 --- a/goal_src/jak1/levels/misty/muse.gc +++ b/goal_src/jak1/levels/misty/muse.gc @@ -139,12 +139,12 @@ (none) ) -(defmethod nav-enemy-method-51 muse ((obj muse)) +(defmethod nav-enemy-method-51 muse ((this muse)) (dotimes (s5-0 2) - (let ((v1-2 (rand-vu-int-range 3 (+ (-> obj node-list length) -1)))) + (let ((v1-2 (rand-vu-int-range 3 (+ (-> this node-list length) -1)))) (launch-particles (-> *part-id-table* 271) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data v1-2)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data v1-2)) ) ) ) @@ -152,10 +152,10 @@ (none) ) -(defmethod common-post muse ((obj muse)) - (spool-push *art-control* (-> obj anim name) 0 obj -99.0) - (nav-enemy-method-51 obj) - ((method-of-type nav-enemy common-post) obj) +(defmethod common-post muse ((this muse)) + (spool-push *art-control* (-> this anim name) 0 this -99.0) + (nav-enemy-method-51 this) + ((method-of-type nav-enemy common-post) this) (none) ) @@ -165,11 +165,11 @@ :shadow muse-shadow-mg ) -(defmethod touch-handler muse ((obj muse) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler muse ((this muse) (arg0 process) (arg1 event-message-block)) (go muse-caught) ) -(defmethod attack-handler muse ((obj muse) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler muse ((this muse) (arg0 process) (arg1 event-message-block)) (go muse-caught) ) @@ -178,7 +178,7 @@ nav-enemy-default-event-handler (defstate muse-idle (muse) :event nav-enemy-default-event-handler :trans (behavior () - (seek! (-> self sprint-distance) 61440.0 (* 8192.0 (-> *display* seconds-per-frame))) + (seek! (-> self sprint-distance) 61440.0 (* 8192.0 (seconds-per-frame))) (if (and *target* (>= 102400.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (level-hint-spawn (text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) @@ -214,7 +214,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (cond @@ -236,7 +236,7 @@ nav-enemy-default-event-handler (set! (-> self target-speed) 61440.0) ) ) - (seek! (-> self sprint-distance) 0.0 (* 4096.0 (-> *display* seconds-per-frame))) + (seek! (-> self sprint-distance) 0.0 (* 4096.0 (seconds-per-frame))) (muse-check-dest-point) ) :code (behavior () @@ -446,10 +446,10 @@ nav-enemy-default-event-handler ) ) -(defmethod init-from-entity! muse ((obj muse) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! muse ((this muse) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -465,34 +465,34 @@ nav-enemy-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *muse-sg* '()) - (logclear! (-> obj mask) (process-mask actor-pause)) - (init-defaults! obj *muse-nav-enemy-info*) - (set! (-> obj max-path-index) (the float (+ (-> obj path curve num-cverts) -1))) - (set! (-> obj current-path-index) 7.0) - (set! (-> obj prev-path-index) 7.0) - (set! (-> obj dest-path-index) 7.0) - (set! (-> obj player-path-index) 0.0) - (eval-path-curve-div! (-> obj path) (-> obj dest-point) (-> obj current-path-index) 'interp) - (set! (-> obj collide-info trans quad) (-> obj dest-point quad)) - (set! (-> obj nav nearest-y-threshold) 20480.0) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) - (set! (-> obj neck max-dist) 102400.0) - (set! (-> obj neck ignore-angle) 16384.0) - (set! (-> obj anim) (new 'static 'spool-anim - :name "muse-victory" - :index 9 - :parts 2 - :command-list '((1 blackout 0) (219 blackout 60)) - ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *muse-sg* '()) + (logclear! (-> this mask) (process-mask actor-pause)) + (init-defaults! this *muse-nav-enemy-info*) + (set! (-> this max-path-index) (the float (+ (-> this path curve num-cverts) -1))) + (set! (-> this current-path-index) 7.0) + (set! (-> this prev-path-index) 7.0) + (set! (-> this dest-path-index) 7.0) + (set! (-> this player-path-index) 0.0) + (eval-path-curve-div! (-> this path) (-> this dest-point) (-> this current-path-index) 'interp) + (set! (-> this collide-info trans quad) (-> this dest-point quad)) + (set! (-> this nav nearest-y-threshold) 20480.0) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) + (set! (-> this anim) (new 'static 'spool-anim + :name "muse-victory" + :index 9 + :parts 2 + :command-list '((1 blackout 0) (219 blackout 60)) + ) ) - (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) + (set! (-> this victory-anim) (fuel-cell-pick-anim this)) (go muse-idle) (none) ) diff --git a/goal_src/jak1/levels/misty/quicksandlurker.gc b/goal_src/jak1/levels/misty/quicksandlurker.gc index 37f8b8572c..61a600e5d2 100644 --- a/goal_src/jak1/levels/misty/quicksandlurker.gc +++ b/goal_src/jak1/levels/misty/quicksandlurker.gc @@ -331,10 +331,10 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (while (not (time-elapsed? (-> self state-time) (seconds 4))) (fill-cache-integrate-and-collide! (-> self root-override) (-> self root-override transv) @@ -380,8 +380,8 @@ (-> self root-override trans) :to *entity-pool* ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (cleanup-for-death self) @@ -509,8 +509,8 @@ ) (defbehavior quicksandlurker-post quicksandlurker () - (inc-angle (&-> self theta-angle) (* 9102.223 (-> *display* seconds-per-frame))) - (inc-angle (&-> self bob-angle) (* 14563.556 (-> *display* seconds-per-frame))) + (inc-angle (&-> self theta-angle) (* 9102.223 (seconds-per-frame))) + (inc-angle (&-> self bob-angle) (* 14563.556 (seconds-per-frame))) (let ((f28-0 (* (-> self radial-offset) (cos (-> self theta-angle)))) (f30-2 (* 0.0 (sin (-> self theta-angle)))) ) @@ -593,31 +593,31 @@ ((or (not *target*) (< 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (seek! (-> self y-offset) -6553.6 (* 20480.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset) -6553.6 (* 20480.0 (seconds-per-frame))) (if (= (-> self y-offset) -6553.6) (go quicksandlurker-idle) ) ) (else - (seek! (-> self y-offset) 1228.8 (* 20480.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset) 1228.8 (* 20480.0 (seconds-per-frame))) ) ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 1.5 2.0)))) (s5-0 5) (s4-0 0) ) (ja-channel-push! 1 (seconds 0.1)) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + (when (time-elapsed? (-> self state-time) gp-0) (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (+! s4-0 1) (when (< s5-0 s4-0) (set! s4-0 0) @@ -662,19 +662,19 @@ (quicksandlurker-check-hide-transition) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 0.8 1.2)))) (s5-0 1) (s4-0 0) ) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + (when (time-elapsed? (-> self state-time) gp-0) (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (+! s4-0 1) (when (>= s4-0 s5-0) (if (logtest? (-> self draw status) (draw-status was-drawn)) @@ -769,7 +769,7 @@ (defstate quicksandlurker-hide (quicksandlurker) :event quicksandlurker-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) @@ -787,10 +787,10 @@ ) (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (go quicksandlurker-popup) ) ) @@ -864,9 +864,9 @@ :post quicksandlurker-post ) -(defmethod init-from-entity! quicksandlurker ((obj quicksandlurker) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! quicksandlurker ((this quicksandlurker) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -900,23 +900,23 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (+! (-> obj root-override trans y) -2048.0) - (set! (-> obj original-position quad) (-> obj root-override trans quad)) - (set! (-> obj theta-angle) (rand-vu-float-range 0.0 65536.0)) - (set! (-> obj bob-angle) (rand-vu-float-range 0.0 65536.0)) - (set! (-> obj radial-offset) 4096.0) - (set! (-> obj y-offset) -6553.6) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (rand-vu-float-range 0.0 65536.0)) - (initialize-skeleton obj *quicksandlurker-sg* '()) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (+! (-> this root-override trans y) -2048.0) + (set! (-> this original-position quad) (-> this root-override trans quad)) + (set! (-> this theta-angle) (rand-vu-float-range 0.0 65536.0)) + (set! (-> this bob-angle) (rand-vu-float-range 0.0 65536.0)) + (set! (-> this radial-offset) 4096.0) + (set! (-> this y-offset) -6553.6) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) (rand-vu-float-range 0.0 65536.0)) + (initialize-skeleton this *quicksandlurker-sg* '()) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj mud-entity) (entity-actor-lookup (-> obj entity) 'water-actor 0)) + (set! (-> this mud-entity) (entity-actor-lookup (-> this entity) 'water-actor 0)) (go quicksandlurker-idle) (none) ) diff --git a/goal_src/jak1/levels/misty/sidekick-human.gc b/goal_src/jak1/levels/misty/sidekick-human.gc index d556653dde..6c7b22d6f7 100644 --- a/goal_src/jak1/levels/misty/sidekick-human.gc +++ b/goal_src/jak1/levels/misty/sidekick-human.gc @@ -1224,15 +1224,15 @@ (none) ) -(defmethod play-anim! sequenceB ((obj sequenceB) (arg0 symbol)) +(defmethod play-anim! sequenceB ((this sequenceB) (arg0 symbol)) (cond (arg0 (send-event *target* 'sidekick #f) - (set! (-> obj bonelurker) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f :to obj)) + (set! (-> this bonelurker) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *bonelurker-sg* #f :to this)) ) - (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) + (send-event (handle->process (-> this bonelurker)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this bonelurker)) 'center-joint 3) (set-setting! 'music-volume-movie 'abs 0.0 0) (set-setting! 'sfx-volume-movie 'abs 0.0 0) (set-setting! 'ambient-volume-movie 'abs 0.0 0) @@ -1240,10 +1240,10 @@ (let ((s4-0 (-> *lurker-army* s5-1))) (cond ((= (-> s4-0 skel) 'bonelurker) - (set! (-> obj lurker-army s5-1) - (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> obj entity) *bonelurker-sg* #f :to obj)) + (set! (-> this lurker-army s5-1) + (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> this entity) *bonelurker-sg* #f :to this)) ) - (let ((s3-1 (handle->process (-> obj lurker-army s5-1)))) + (let ((s3-1 (handle->process (-> this lurker-army s5-1)))) (when s3-1 (set! (-> (the-as babak s3-1) draw light-index) (the-as uint 1)) (set! (-> (the-as babak s3-1) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) @@ -1251,24 +1251,24 @@ ) ) (else - (set! (-> obj lurker-army s5-1) - (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> obj entity) *babak-sg* #f :to obj)) + (set! (-> this lurker-army s5-1) + (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> this entity) *babak-sg* #f :to this)) ) - (let ((s3-3 (handle->process (-> obj lurker-army s5-1)))) + (let ((s3-3 (handle->process (-> this lurker-army s5-1)))) (when s3-3 (set! (-> (the-as babak s3-3) draw light-index) (the-as uint 1)) (set! (-> (the-as babak s3-3) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) ) ) - (send-event (handle->process (-> obj lurker-army s5-1)) 'art-joint-anim "idle" 0) + (send-event (handle->process (-> this lurker-army s5-1)) 'art-joint-anim "idle" 0) ) ) - (send-event (handle->process (-> obj lurker-army s5-1)) 'rot (-> s4-0 rot)) + (send-event (handle->process (-> this lurker-army s5-1)) 'rot (-> s4-0 rot)) ) ) ) ((!= (level-status *level* 'intro) 'active) - (return (get-art-elem obj)) + (return (get-art-elem this)) ) ) (new 'static 'spool-anim @@ -1374,8 +1374,8 @@ ) ) -(defmethod get-art-elem sequenceB ((obj sequenceB)) - (-> obj draw art-group data 3) +(defmethod get-art-elem sequenceB ((this sequenceB)) + (-> this draw art-group data 3) ) (defstate play-anim (sequenceB) @@ -1475,6 +1475,7 @@ ) ) ((-> (method-of-type process-taskable play-anim) exit)) + ;; og:preserve-this (#when PC_PORT ;; extra stuff when skipping cutscene (when (and (= (get-response (-> self query)) 'no) (or (not (= *cheat-mode* 'debug)) (not (cpad-hold? 0 r1)))) @@ -1504,20 +1505,20 @@ ) ) -(defmethod should-display? sequenceB ((obj sequenceB)) +(defmethod should-display? sequenceB ((this sequenceB)) #f ) -(defmethod init-from-entity! sequenceB ((obj sequenceB) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) - (set! (-> obj tasks) (get-task-control (game-task intro))) - (set! (-> obj bonelurker) (the-as handle #f)) - (set! (-> obj evilbro) (the-as handle #f)) - (set! (-> obj evilsis) (the-as handle #f)) +(defmethod init-from-entity! sequenceB ((this sequenceB) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) + (set! (-> this tasks) (get-task-control (game-task intro))) + (set! (-> this bonelurker) (the-as handle #f)) + (set! (-> this evilbro) (the-as handle #f)) + (set! (-> this evilsis) (the-as handle #f)) (dotimes (v1-2 9) - (set! (-> obj lurker-army v1-2) (the-as handle #f)) + (set! (-> this lurker-army v1-2) (the-as handle #f)) ) - (process-taskable-method-42 obj) + (process-taskable-method-42 this) (none) ) @@ -1554,24 +1555,24 @@ (none) ) -(defmethod play-anim! sequenceC ((obj sequenceC) (arg0 symbol)) +(defmethod play-anim! sequenceC ((this sequenceC) (arg0 symbol)) (when arg0 (set-setting! 'music-volume-movie 'abs 0.0 0) (set-setting! 'sfx-volume-movie 'abs 0.0 0) (set-setting! 'ambient-volume-movie 'abs 0.0 0) - (set! (-> obj bonelurker) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f :to obj)) + (set! (-> this bonelurker) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *bonelurker-sg* #f :to this)) ) - (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) - (set! (-> obj darkecocan) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *darkecocan-sg* #f :to obj)) + (send-event (handle->process (-> this bonelurker)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this bonelurker)) 'center-joint 3) + (set! (-> this darkecocan) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *darkecocan-sg* #f :to this)) ) - (send-event (handle->process (-> obj darkecocan)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj darkecocan)) 'center-joint 3) - (send-event (handle->process (-> obj darkecocan)) 'trans-hook sequenceC-can-trans-hook) + (send-event (handle->process (-> this darkecocan)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this darkecocan)) 'center-joint 3) + (send-event (handle->process (-> this darkecocan)) 'trans-hook sequenceC-can-trans-hook) (send-event - (handle->process (-> obj darkecocan)) + (handle->process (-> this darkecocan)) 'eval (lambda :behavior sequenceC () @@ -1647,8 +1648,8 @@ ) ) -(defmethod get-art-elem sequenceC ((obj sequenceC)) - (-> obj draw art-group data 3) +(defmethod get-art-elem sequenceC ((this sequenceC)) + (-> this draw art-group data 3) ) (defstate play-anim (sequenceC) @@ -1665,6 +1666,7 @@ ) ) ((-> (method-of-type process-taskable play-anim) exit)) + ;; og:preserve-this (#when PC_PORT ;; extra stuff when skipping cutscene (when (and (= (get-response (-> self query)) 'no) (or (not (= *cheat-mode* 'debug)) (not (cpad-hold? 0 r1)))) @@ -1684,7 +1686,7 @@ ) ) -(defmethod should-display? sequenceC ((obj sequenceC)) +(defmethod should-display? sequenceC ((this sequenceC)) #f ) @@ -1710,12 +1712,12 @@ (none) ) -(defmethod init-from-entity! sequenceC ((obj sequenceC) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) - (set! (-> obj tasks) (get-task-control (game-task intro))) - (set! (-> obj bonelurker) (the-as handle #f)) - (set! (-> obj darkecocan) (the-as handle #f)) - (set! (-> obj cur-trans-hook) sequenceC-trans-hook) - (process-taskable-method-42 obj) +(defmethod init-from-entity! sequenceC ((this sequenceC) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) + (set! (-> this tasks) (get-task-control (game-task intro))) + (set! (-> this bonelurker) (the-as handle #f)) + (set! (-> this darkecocan) (the-as handle #f)) + (set! (-> this cur-trans-hook) sequenceC-trans-hook) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/ogre/flying-lurker.gc b/goal_src/jak1/levels/ogre/flying-lurker.gc index 4274ea4457..7d4775f135 100644 --- a/goal_src/jak1/levels/ogre/flying-lurker.gc +++ b/goal_src/jak1/levels/ogre/flying-lurker.gc @@ -250,9 +250,9 @@ ) ) -(defmethod init-from-entity! plunger-lurker ((obj plunger-lurker) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! plunger-lurker ((this plunger-lurker) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -264,13 +264,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *plunger-lurker-sg* '()) - (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj got-hit) #f) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) -16384.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *plunger-lurker-sg* '()) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this got-hit) #f) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) -16384.0) (if (= (get-task-status (game-task plunger-lurker-hit)) (task-status invalid)) (go plunger-lurker-die) (go plunger-lurker-idle) @@ -327,20 +327,20 @@ :shadow flying-lurker-shadow-mg ) -(defmethod flying-lurker-method-20 flying-lurker ((obj flying-lurker)) +(defmethod flying-lurker-method-20 flying-lurker ((this flying-lurker)) (with-pp - (let ((s5-0 (-> obj draw shadow-ctrl)) + (let ((s5-0 (-> this draw shadow-ctrl)) (s4-0 #f) ) - (when (-> obj draw shadow) - (when (or (logtest? (-> obj draw status) (draw-status was-drawn)) - (< (vector-vector-xz-distance-squared (-> obj root trans) (camera-pos)) 10485760000.0) + (when (-> this draw shadow) + (when (or (logtest? (-> this draw status) (draw-status was-drawn)) + (< (vector-vector-xz-distance-squared (-> this root trans) (camera-pos)) 10485760000.0) ) (let ((s3-1 (new 'stack-no-clear 'collide-tri-result)) (a1-1 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> obj root trans quad)) + (set! (-> a1-1 quad) (-> this root trans quad)) (+! (-> a1-1 y) -8192.0) (set-vector! a2-0 0.0 -81920.0 0.0 1.0) (when (>= (fill-and-probe-using-line-sphere @@ -374,24 +374,24 @@ 0 (let ((s2-2 (new 'stack-no-clear 'bounding-box))) (let ((s1-1 (new 'stack-no-clear 'vector))) - (vector<-cspace! s1-1 (-> obj node-list data 4)) + (vector<-cspace! s1-1 (-> this node-list data 4)) (vector+float! (-> s2-2 min) s1-1 -18432.0) (vector+float! (-> s2-2 max) s1-1 18432.0) ) (add-spheres! s2-2 (the-as (inline-array sphere) (-> s3-1 intersect)) 1) (let ((f0-17 (* 0.5 (vector-vector-distance (-> s2-2 min) (-> s2-2 max))))) (set-vector! - (-> obj draw bounds) + (-> this draw bounds) (* 0.5 (+ (-> s2-2 min x) (-> s2-2 max x))) (* 0.5 (+ (-> s2-2 min y) (-> s2-2 max y))) (* 0.5 (+ (-> s2-2 min z) (-> s2-2 max z))) 1.0 ) - (vector-! (-> obj draw bounds) (-> obj draw bounds) (-> obj root trans)) - (set! (-> obj draw bounds w) f0-17) + (vector-! (-> this draw bounds) (-> this draw bounds) (-> this root trans)) + (set! (-> this draw bounds w) f0-17) ) ) - (set! (-> obj draw origin-joint-index) (the-as uint 0)) + (set! (-> this draw origin-joint-index) (the-as uint 0)) 0 ) ) @@ -401,8 +401,8 @@ (when (not s4-0) (logior! (-> s5-0 settings flags) (shadow-flags disable-draw)) 0 - (set! (-> obj draw bounds quad) (-> obj default-bounds quad)) - (set! (-> obj draw origin-joint-index) (the-as uint 4)) + (set! (-> this draw bounds quad) (-> this default-bounds quad)) + (set! (-> this draw origin-joint-index) (the-as uint 4)) ) ) (none) @@ -494,9 +494,7 @@ (defbehavior flying-lurker-move flying-lurker () (+! (-> self curve-position) - (/ (the float - (* (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) (the int (-> self speed))) - ) + (/ (the float (* (- (current-time) (-> *display* old-base-frame-counter)) (the int (-> self speed)))) (path-distance (-> self path)) ) ) @@ -718,14 +716,14 @@ ) (ja :num! (loop! (flying-lurker-calc-anim-speed))) (suspend) - (when (>= (- (-> *display* base-frame-counter) (-> self last-look-time)) (-> self time-to-next-look)) + (when (time-elapsed? (-> self last-look-time) (-> self time-to-next-look)) (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! flying-lurker-look-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) - (set! (-> self last-look-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-look-time)) (let* ((f30-0 300.0) (f28-0 3.0) (f26-0 5.0) @@ -906,8 +904,8 @@ process (lambda :behavior process () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.1)) (suspend) ) ) @@ -1155,8 +1153,8 @@ ) (when (and *target* (>= 172032.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (process-grab? *target*) - (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 1)) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 1)) (suspend) ) ) @@ -1184,46 +1182,46 @@ :post ja-post ) -(defmethod init-from-entity! flying-lurker ((obj flying-lurker) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *flying-lurker-sg* '()) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj root pause-adjust-distance) 122880.0) - (set! (-> obj curve-position) 0.0) +(defmethod init-from-entity! flying-lurker ((this flying-lurker) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *flying-lurker-sg* '()) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this root pause-adjust-distance) 122880.0) + (set! (-> this curve-position) 0.0) (cond ((play-movie?) - (eval-path-curve! (-> obj path) (-> obj root trans) (-> obj curve-position) 'interp) - (path-control-method-14 (-> obj path) (-> obj tangent) (-> obj curve-position)) - (quaternion-identity! (-> obj root quat)) + (eval-path-curve! (-> this path) (-> this root trans) (-> this curve-position) 'interp) + (path-control-method-14 (-> this path) (-> this tangent) (-> this curve-position)) + (quaternion-identity! (-> this root quat)) ) (else (flying-lurker-move) (flying-lurker-rotate) ) ) - (set! (-> obj y-offset) 0.0) - (set! (-> obj y-vel) 0.0) - (set! (-> obj last-look-time) 0) - (set! (-> obj time-to-next-look) 0) - (set! (-> obj draw origin-joint-index) (the-as uint 4)) - (set! (-> obj draw shadow-joint-index) (the-as uint 4)) - (set! (-> obj take-off) #f) - (set-vector! (-> obj default-bounds) 0.0 8192.0 0.0 24576.0) - (set! (-> obj draw bounds quad) (-> obj default-bounds quad)) - (set! (-> obj draw shadow-ctrl) + (set! (-> this y-offset) 0.0) + (set! (-> this y-vel) 0.0) + (set! (-> this last-look-time) 0) + (set! (-> this time-to-next-look) 0) + (set! (-> this draw origin-joint-index) (the-as uint 4)) + (set! (-> this draw shadow-joint-index) (the-as uint 4)) + (set! (-> this take-off) #f) + (set-vector! (-> this default-bounds) 0.0 8192.0 0.0 24576.0) + (set! (-> this draw bounds quad) (-> this default-bounds quad)) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 131072.0 151552.0 614400.0 (the-as float 60) 409600.0) ) - (let ((v1-27 (-> obj draw shadow-ctrl))) + (let ((v1-27 (-> this draw shadow-ctrl))) (logclear! (-> v1-27 settings flags) (shadow-flags disable-draw)) ) 0 - (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj shadow-backup) (-> obj draw shadow)) - (set! (-> obj try-counted) #f) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this shadow-backup) (-> this draw shadow)) + (set! (-> this try-counted) #f) (if (= (get-task-status (game-task plunger-lurker-hit)) (task-status invalid)) (go flying-lurker-die) (go flying-lurker-idle) diff --git a/goal_src/jak1/levels/ogre/ogre-obs.gc b/goal_src/jak1/levels/ogre/ogre-obs.gc index 4de1c6266f..fa1db29ed1 100644 --- a/goal_src/jak1/levels/ogre/ogre-obs.gc +++ b/goal_src/jak1/levels/ogre/ogre-obs.gc @@ -367,8 +367,8 @@ ) ) -(defmethod init-from-entity! tntbarrel ((obj tntbarrel) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! tntbarrel ((this tntbarrel) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind crate)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -380,12 +380,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *tntbarrel-sg* '()) - (set-vector! (-> obj draw color-mult) 1.3 1.3 1.3 1.0) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *tntbarrel-sg* '()) + (set-vector! (-> this draw color-mult) 1.3 1.3 1.3 1.0) + (go (method-of-object this idle)) (none) ) @@ -439,9 +439,12 @@ ) -(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)) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) +(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) + ) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) @@ -453,7 +456,7 @@ (('trigger) (set! (-> self triggered) (the-as entity-actor #t)) (set! (-> self delay) (the-as time-frame (-> block param 0))) - (let ((v0-0 (-> *display* base-frame-counter))) + (let ((v0-0 (current-time))) (set! (-> self state-time) v0-0) v0-0 ) @@ -474,7 +477,7 @@ ) ) (else - (if (and (-> self triggered) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay))) + (if (and (-> self triggered) (time-elapsed? (-> self state-time) (-> self delay))) (set! (-> self active) #t) ) ) @@ -499,14 +502,14 @@ ) ) (let ((f30-1 (-> self idle-y-offset))) - (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (seek! (-> self float-height-offset) (-> self float-y-offset) (* 32768.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) (-> self float-y-offset) (* 32768.0 (seconds-per-frame))) ) ) ) @@ -519,8 +522,8 @@ :post rigid-body-platform-post ) -(defmethod rigid-body-platform-method-30 ogre-plat ((obj ogre-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod rigid-body-platform-method-30 ogre-plat ((this ogre-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -538,19 +541,19 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-31 ogre-plat ((obj ogre-plat)) - (set! (-> obj float-height-offset) (-> obj idle-y-offset)) - (let ((s5-0 (-> obj info control-point-count))) +(defmethod rigid-body-platform-method-31 ogre-plat ((this ogre-plat)) + (set! (-> this float-height-offset) (-> this idle-y-offset)) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0)))) - (f28-0 (-> obj root-overlay root-prim local-sphere w)) + (f28-0 (-> this root-overlay root-prim local-sphere w)) ) (set! (-> s3-0 local-pos x) (* f28-0 (sin f30-0))) (set! (-> s3-0 local-pos y) 0.0) @@ -560,9 +563,9 @@ ) ) ) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) - (set! (-> obj active) #f) - (set! (-> obj triggered) #f) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) + (set! (-> this active) #f) + (set! (-> this triggered) #f) 0 (none) ) @@ -602,25 +605,25 @@ ) -(defmethod rigid-body-platform-method-31 ogre-step ((obj ogre-step)) - (set! (-> obj idle-y-offset) -28672.0) - (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) - (let ((a0-5 (entity-actor-lookup (-> obj entity) 'alt-actor 0))) +(defmethod rigid-body-platform-method-31 ogre-step ((this ogre-step)) + (set! (-> this idle-y-offset) -28672.0) + (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) + (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! (-> obj active) #t) + (set! (-> this active) #t) ) ) 0 (none) ) -(defmethod rigid-body-platform-method-34 ogre-step ((obj ogre-step)) - (if (-> obj active) - (go (method-of-object obj rigid-body-platform-float)) - (go (method-of-object obj rigid-body-platform-idle)) +(defmethod rigid-body-platform-method-34 ogre-step ((this ogre-step)) + (if (-> this active) + (go (method-of-object this rigid-body-platform-float)) + (go (method-of-object this rigid-body-platform-idle)) ) 0 (none) @@ -662,34 +665,34 @@ ) -(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) +(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) 0 (none) ) -(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) +(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) 0 (none) ) -(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) +(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) 0 (none) ) -(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) +(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) 0 (none) ) @@ -730,12 +733,12 @@ ) -(defmethod rigid-body-platform-method-31 ogre-isle ((obj ogre-isle)) - (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) - (set! (-> obj active) #t) +(defmethod rigid-body-platform-method-31 ogre-isle ((this ogre-isle)) + (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) + (set! (-> this active) #t) 0 (none) ) @@ -767,30 +770,30 @@ ) -(defmethod rigid-body-platform-method-31 ogre-isle-b ((obj ogre-isle-b)) - (+! (-> 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) +(defmethod rigid-body-platform-method-31 ogre-isle-b ((this ogre-isle-b)) + (+! (-> 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) 0 (none) ) -(defmethod rigid-body-platform-method-31 ogre-isle-c ((obj ogre-isle-c)) - (+! (-> 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) +(defmethod rigid-body-platform-method-31 ogre-isle-c ((this ogre-isle-c)) + (+! (-> 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) 0 (none) ) -(defmethod rigid-body-platform-method-31 ogre-isle-d ((obj ogre-isle-d)) - (+! (-> obj root-overlay trans x) -8192.0) - (+! (-> 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) +(defmethod rigid-body-platform-method-31 ogre-isle-d ((this ogre-isle-d)) + (+! (-> this root-overlay trans x) -8192.0) + (+! (-> 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) 0 (none) ) @@ -819,15 +822,15 @@ ) -(defmethod relocate ogre-bridge ((obj ogre-bridge) (arg0 int)) +(defmethod relocate ogre-bridge ((this ogre-bridge) (arg0 int)) (dotimes (v1-0 8) - (if (nonzero? (-> obj joint-mod-array v1-0)) - (&+! (-> obj joint-mod-array v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method ogre-bridge 7)) this arg0) ) ) @@ -961,10 +964,10 @@ (define *ogre-bridge-joint-array* (new 'static 'boxed-array :type uint8 #x4 #x9 #xc #x11 #x7 #xa #xf #x12)) -(defmethod init-from-entity! ogre-bridge ((obj ogre-bridge) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! ogre-bridge ((this ogre-bridge) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1134,21 +1137,21 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *ogre-bridge-sg* '()) - (logior! (-> obj skel effect flags) 1) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *ogre-bridge-sg* '()) + (logior! (-> this skel effect flags) 1) (dotimes (s5-1 8) - (let ((v1-185 (new 'process 'joint-mod-set-local obj (the-as int (-> *ogre-bridge-joint-array* s5-1)) #f #f #f))) - (set! (-> obj joint-mod-array s5-1) (the-as joint-mod v1-185)) + (let ((v1-185 (new 'process 'joint-mod-set-local this (the-as int (-> *ogre-bridge-joint-array* s5-1)) #f #f #f))) + (set! (-> this joint-mod-array s5-1) (the-as joint-mod v1-185)) (vector-reset! (-> v1-185 transform scale)) ) ) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj dead-joint-count) 8) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this dead-joint-count) 8) (ogre-bridge-update-joints) (go ogre-bridge-activated) ) @@ -1184,8 +1187,8 @@ ) ) -(defmethod init-from-entity! ogre-bridgeend ((obj ogre-bridgeend) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! ogre-bridgeend ((this ogre-bridgeend) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1197,10 +1200,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ogre-bridgeend-sg* '()) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ogre-bridgeend-sg* '()) (go ogre-bridgeend-idle) (none) ) @@ -1285,18 +1288,18 @@ ) ) -(defmethod water-vol-method-22 ogre-lava ((obj ogre-lava)) +(defmethod water-vol-method-22 ogre-lava ((this ogre-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) + (set! (-> this draw ripple) v1-2) (set! (-> v1-2 global-scale) 2048.0) (set! (-> v1-2 waveform) ripple-for-ogre-lava) ) - (logclear! (-> obj flags) (water-flags wt23)) - (logior! (-> obj flags) (water-flags wt25)) - (set! (-> obj attack-event) 'lava) + (logclear! (-> this flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt25)) + (set! (-> this attack-event) 'lava) (none) ) @@ -1447,8 +1450,8 @@ ) ) -(defmethod init-from-entity! shortcut-boulder ((obj shortcut-boulder) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! shortcut-boulder ((this shortcut-boulder) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1460,12 +1463,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *shortcut-boulder-whole-sg* '()) - (setup-lods! (-> obj broken-look) *shortcut-boulder-broken-sg* (-> obj draw art-group) (-> obj entity)) - (set-vector! (-> obj draw color-emissive) 0.125 0.0625 0.0 0.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *shortcut-boulder-whole-sg* '()) + (setup-lods! (-> this broken-look) *shortcut-boulder-broken-sg* (-> this draw art-group) (-> this entity)) + (set-vector! (-> this draw color-emissive) 0.125 0.0625 0.0 0.0) (go shortcut-boulder-idle) (none) ) diff --git a/goal_src/jak1/levels/ogre/ogreboss.gc b/goal_src/jak1/levels/ogre/ogreboss.gc index 9c1ad166e0..e85f00c2c1 100644 --- a/goal_src/jak1/levels/ogre/ogreboss.gc +++ b/goal_src/jak1/levels/ogre/ogreboss.gc @@ -92,15 +92,15 @@ (defstate ogreboss-missile-idle (ogreboss-missile) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'collide-tri-result)) ) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 6)) - (let ((f0-1 (the float (- (-> *display* base-frame-counter) (-> self start-time))))) + (while (not (time-elapsed? (-> self state-time) (seconds 6))) + (let ((f0-1 (the float (- (current-time) (-> self start-time))))) (eval-position! (-> self trajectory) f0-1 gp-0) ) (vector-! s5-0 gp-0 (-> self root-override trans)) @@ -143,12 +143,12 @@ (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'collide-tri-result)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (empty) ) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 6)) - (let ((f0-1 (the float (- (-> *display* base-frame-counter) (-> self start-time))))) + (while (not (time-elapsed? (-> self state-time) (seconds 6))) + (let ((f0-1 (the float (- (current-time) (-> self start-time))))) (eval-position! (-> self trajectory) f0-1 gp-0) ) (vector-! s5-0 gp-0 (-> self root-override trans)) @@ -219,7 +219,7 @@ (defun ogreboss-missile-scale-explosion ((arg0 handle)) (let* ((gp-0 (handle->process arg0)) (f0-0 (-> (the-as process-drawable gp-0) root scale x)) - (f0-2 (seek f0-0 (the-as float 0.0) (-> *display* seconds-per-frame))) + (f0-2 (seek f0-0 (the-as float 0.0) (seconds-per-frame))) ) (set-vector! (-> (the-as process-drawable gp-0) root scale) f0-2 f0-2 f0-2 1.0) ) @@ -413,7 +413,7 @@ (the-as float -0.22755557) ) ) - (set! (-> self start-time) (-> *display* base-frame-counter)) + (set-time! (-> self start-time)) (set! (-> self blast-radius) (-> arg0 blast-radius)) (set! (-> self pickup-type) (-> arg0 pickup-type)) (let ((f30-1 (* 65536.0 (rand-vu)))) @@ -531,18 +531,18 @@ (ja :group! ogreboss-super-boulder-idle-ja :num! min) (set! (-> self joint enable) #t) (set! (-> self joint blend) 1.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (quaternion-vector-angle! (-> self tumble-quat) (-> self spin-axis) - (* 32768.0 (-> *display* seconds-per-frame) (-> self speed)) + (* 32768.0 (seconds-per-frame) (-> self speed)) ) (quaternion*! (-> self joint transform quat) (-> self joint transform quat) (-> self tumble-quat)) - (+! (-> self size) (* (-> self grow-rate) (-> *display* seconds-per-frame))) + (+! (-> self size) (* (-> self grow-rate) (seconds-per-frame))) (set! (-> self size) (fmin 1.0 (-> self size))) (let* ((f0-10 (sqrtf (-> self size))) - (f28-0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> self state-time))))) + (f28-0 (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) (f30-0 (* 116508.445 f28-0 (-> self speed))) ) (set-vector! (-> self joint transform scale) f0-10 f0-10 f0-10 1.0) @@ -583,7 +583,7 @@ (set! (-> self src-pos quad) (-> self root-override trans quad)) (ja-no-eval :group! ogreboss-super-boulder-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (-> *display* seconds-per-frame))) + (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (seconds-per-frame))) (let* ((f1-1 (/ (- (ja-frame-num 0) (ja-aframe (the-as float 54.0) 0)) (- (the float (ja-num-frames 0)) (ja-aframe (the-as float 54.0) 0)) ) @@ -605,7 +605,7 @@ (set! (-> self src-pos quad) (-> self root-override trans quad)) (ja-no-eval :group! ogreboss-super-boulder-throw-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (-> *display* seconds-per-frame))) + (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (seconds-per-frame))) (let* ((f1-1 (/ (- (ja-frame-num 0) (ja-aframe (the-as float 32.0) 0)) (- (the float (ja-num-frames 0)) (ja-aframe (the-as float 32.0) 0)) ) @@ -747,14 +747,14 @@ ) ) -(defmethod relocate ogreboss-super-boulder ((obj ogreboss-super-boulder) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(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)) - obj + this arg0 ) ) @@ -858,7 +858,7 @@ (defstate ogreboss-bounce-boulder-idle (ogreboss-bounce-boulder) :event ogreboss-bounce-boulder-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((f30-0 2.0)) (ja-no-eval :group! ogreboss-bounce-boulder-idle-ja :num! (seek! (ja-aframe (the-as float 40.0) 0) f30-0) @@ -877,7 +877,7 @@ ) (until (ja-done? 0) (if (>= (ja-frame-num 0) (ja-aframe (the-as float 235.0) 0)) - (seek! (-> self side-pos) (the-as float 0.0) (* 20480.0 (-> *display* seconds-per-frame))) + (seek! (-> self side-pos) (the-as float 0.0) (* 20480.0 (seconds-per-frame))) ) (suspend) (ja :num! (seek! max f30-0)) @@ -1045,8 +1045,8 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 140.0) 0))) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.167)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.167)) (suspend) ) ) @@ -1058,8 +1058,8 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 168.0) 0))) ) - (let ((gp-5 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.167)) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 0.167)) (suspend) ) ) @@ -1223,6 +1223,7 @@ (defbehavior ogreboss-shoot-boulder ogreboss ((arg0 pickup-type)) (let ((gp-0 (new 'stack-no-clear 'ogreboss-missile-init-data))) (let ((s5-0 (new 'stack-no-clear 'vector))) + ;; og:preserve-this (set! (-> gp-0 src) (-> self node-list data (#if *jak1-full-game* 50 52) bone transform vector 3)) (set! (-> gp-0 duration) (the-as time-frame (the int (* 300.0 (+ 1.25 (* -0.25 (-> self level)) (/ 0.5 (-> self difficulty)))))) @@ -1332,8 +1333,8 @@ ) (logior! (-> self draw status) (draw-status hidden)) (set! (-> self submerged) #t) - (let ((s5-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-1) arg0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 arg0) (suspend) ) ) @@ -1431,12 +1432,12 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (and (-> self bridge-assembled) (ogreboss-player-inside-range? (the-as float 524288.0)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (go ogreboss-stage2) ) @@ -1558,7 +1559,7 @@ (let ((f1-0 0.0) (f0-0 0.0) ) - (let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self hit-time))))) + (let ((f30-0 (the float (- (current-time) (-> self hit-time))))) (when (and (> (-> self hit-count) 0) (>= 45.0 f30-0)) (set! f0-0 (+ (ja-aframe (the-as float 0.0) 1) (* 0.022222223 f30-0 (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (the-as float 0.0) 1))) @@ -1613,7 +1614,7 @@ (ja :chan 1 :group! ogreboss-hit-crotch-ja :num! min :frame-interp 0.0) (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) ) - (set! (-> self hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self hit-time)) (let ((v1-17 (rand-vu-int-range 0 2))) (cond ((zero? v1-17) @@ -1657,10 +1658,10 @@ (suspend) (ja :num! (seek! max 1.5)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (while (not gp-0) (ogreboss-roll-boulder) - (set! gp-0 (or (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (set! gp-0 (or (and (time-elapsed? (-> self state-time) (seconds 2)) (not (ogreboss-player-inside-range? (the-as float 524288.0))) ) (ogreboss-player-inside-range? (the-as float 409600.0)) @@ -1701,7 +1702,7 @@ (defstate ogreboss-stage3-shuffle (ogreboss) :event ogreboss-attack-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self hit-count) 0) (set! (-> self max-hit-count) (the int (* 6.0 (-> self difficulty)))) (set! (-> self grow-time) (* 300.0 (+ (/ 10.0 (-> self difficulty)) (* -1.0 (-> self level))))) @@ -1718,9 +1719,9 @@ ) ) (when (and (not (ogreboss-player-inside-range? (the-as float 409600.0))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (send-event (handle->process (-> self boulder)) 'grow-faster) ) 0 @@ -1741,7 +1742,7 @@ (ja :num! (seek! max f30-0)) ) (ogreboss-spawn-super-boulder) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-channel-push! 2 (seconds 0.05)) (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) (set! (-> self vulnerable) #t) @@ -1766,7 +1767,7 @@ (ja-no-eval :group! ogreboss-shuffle-right-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) - (set! (-> self shuffle-pos) (- (-> self shuffle-pos) (* 16384.0 (-> *display* seconds-per-frame) f30-0))) + (set! (-> self shuffle-pos) (- (-> self shuffle-pos) (* 16384.0 (seconds-per-frame) f30-0))) (suspend) (ja :num! (seek! max f30-0)) ) @@ -1793,7 +1794,7 @@ (ja-no-eval :group! ogreboss-shuffle-left-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) - (+! (-> self shuffle-pos) (* 16384.0 (-> *display* seconds-per-frame) f30-0)) + (+! (-> self shuffle-pos) (* 16384.0 (seconds-per-frame) f30-0)) (suspend) (ja :num! (seek! max f30-0)) ) @@ -1979,9 +1980,9 @@ (none) ) -(defmethod init-from-entity! ogreboss ((obj ogreboss) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask attackable)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! ogreboss ((this ogreboss) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask attackable)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 6) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -2045,46 +2046,46 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *ogreboss-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 5)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *ogreboss-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 5)) (ogreboss-get-targets) - (set! (-> obj try-count) (-> obj entity extra perm user-uint8 0)) + (set! (-> this try-count) (-> this entity extra perm user-uint8 0)) (cond - ((< (-> obj try-count) (the-as uint 5)) - (set! (-> obj difficulty) 1.0) + ((< (-> this try-count) (the-as uint 5)) + (set! (-> this difficulty) 1.0) ) - ((< (-> obj try-count) (the-as uint 10)) - (set! (-> obj difficulty) 0.83334) + ((< (-> this try-count) (the-as uint 10)) + (set! (-> this difficulty) 0.83334) ) - ((< (-> obj try-count) (the-as uint 15)) - (set! (-> obj difficulty) 0.66667) + ((< (-> this try-count) (the-as uint 15)) + (set! (-> this difficulty) 0.66667) ) (else - (set! (-> obj difficulty) 0.5) + (set! (-> this difficulty) 0.5) ) ) - (set! (-> obj lava) (entity-actor-lookup (-> obj entity) 'water-actor 0)) - (set! *ogreboss* (the-as ogreboss (process->ppointer obj))) - (set! (-> obj level) 0.0) - (set! (-> obj vulnerable) #f) - (set! (-> obj bridge-assembled) #f) - (set! (-> obj submerged) #f) - (vector-z-quaternion! (-> obj z-plane) (-> obj root-override quat)) - (set! (-> obj z-plane w) (- (vector-dot (-> obj z-plane) (-> obj root-override trans)))) - (vector-x-quaternion! (-> obj side-dir) (-> obj root-override quat)) - (set! (-> obj far-pos quad) (-> obj root-override trans quad)) + (set! (-> this lava) (entity-actor-lookup (-> this entity) 'water-actor 0)) + (set! *ogreboss* (the-as ogreboss (process->ppointer this))) + (set! (-> this level) 0.0) + (set! (-> this vulnerable) #f) + (set! (-> this bridge-assembled) #f) + (set! (-> this submerged) #f) + (vector-z-quaternion! (-> this z-plane) (-> this root-override quat)) + (set! (-> this z-plane w) (- (vector-dot (-> this z-plane) (-> this root-override trans)))) + (vector-x-quaternion! (-> this side-dir) (-> this root-override quat)) + (set! (-> this far-pos quad) (-> this root-override trans quad)) (let ((f0-38 1.0)) - (set-vector! (-> obj root-override scale) f0-38 f0-38 f0-38 1.0) + (set-vector! (-> this root-override scale) f0-38 f0-38 f0-38 1.0) ) - (vector+*! (-> obj near-pos) (-> obj far-pos) (-> obj z-plane) (the-as float 348160.0)) - (set! (-> obj at-near-spot) #t) - (set! (-> obj try-counted) #f) - (set! (-> obj root-override trans quad) (-> obj near-pos quad)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (vector+*! (-> this near-pos) (-> this far-pos) (-> this z-plane) (the-as float 348160.0)) + (set! (-> this at-near-spot) #t) + (set! (-> this try-counted) #f) + (set! (-> this root-override trans quad) (-> this near-pos quad)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go ogreboss-dead) (go ogreboss-idle) ) diff --git a/goal_src/jak1/levels/racer_common/collide-reaction-racer.gc b/goal_src/jak1/levels/racer_common/collide-reaction-racer.gc index 59cf0e58ee..dd78718aff 100644 --- a/goal_src/jak1/levels/racer_common/collide-reaction-racer.gc +++ b/goal_src/jak1/levels/racer_common/collide-reaction-racer.gc @@ -123,7 +123,7 @@ ) ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) - (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) + (not (time-elapsed? (-> arg0 unknown-dword10) (seconds 0.3))) (not (logtest? sv-104 32)) ) ) @@ -170,7 +170,7 @@ (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) (set! (-> arg0 unknown-vector53 quad) (-> sv-84 quad)) (set! (-> arg0 unknown-float60) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) - (set! (-> arg0 unknown-dword10) (-> *display* base-frame-counter)) + (set-time! (-> arg0 unknown-dword10)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) (set! (-> arg0 ground-touch-point quad) (-> arg1 best-tri intersect quad)) (set! sv-104 (logior sv-104 2048)) diff --git a/goal_src/jak1/levels/racer_common/racer-part.gc b/goal_src/jak1/levels/racer_common/racer-part.gc index 87d50a5490..3c4c31929a 100644 --- a/goal_src/jak1/levels/racer_common/racer-part.gc +++ b/goal_src/jak1/levels/racer_common/racer-part.gc @@ -38,8 +38,8 @@ (cond ((< (-> *hud-parts* bike-speed 0 offset) 10) (if (< f0-1 (-> arg2 vector 1 z)) - (set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 131072.0 (-> *display* seconds-per-frame)))) - (set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 32768.0 (-> *display* seconds-per-frame)))) + (set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 131072.0 (seconds-per-frame)))) + (set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 32768.0 (seconds-per-frame)))) ) ) (else @@ -321,68 +321,68 @@ ) -(defmethod hud-update hud-bike-heat ((obj hud-bike-heat)) +(defmethod hud-update hud-bike-heat ((this hud-bike-heat)) (if *target* - (tally-value obj (the int (-> *target* racer heat)) 0) + (tally-value this (the int (-> *target* racer heat)) 0) ) 0 (none) ) -(defmethod init-particles! hud-bike-heat ((obj hud-bike-heat) (arg0 int)) +(defmethod init-particles! hud-bike-heat ((this hud-bike-heat) (arg0 int)) (add-setting! 'common-page 'set 0.0 2) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 111) obj)) - (set! (-> obj particles s5-0 init-pos x) 13.0) - (set! (-> obj particles s5-0 init-pos y) 370.0) - (set! (-> obj particles s5-0 init-pos z) 10.0) - (set! (-> obj particles s5-0 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 111) this)) + (set! (-> this particles s5-0 init-pos x) 13.0) + (set! (-> this particles s5-0 init-pos y) 370.0) + (set! (-> this particles s5-0 init-pos z) 10.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 112) obj)) - (set! (-> obj particles s5-1 init-pos x) 70.0) - (set! (-> obj particles s5-1 init-pos y) 370.0) - (set! (-> obj particles s5-1 init-pos z) 6.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 112) this)) + (set! (-> this particles s5-1 init-pos x) 70.0) + (set! (-> this particles s5-1 init-pos y) 370.0) + (set! (-> this particles s5-1 init-pos z) 6.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 113) obj)) - (set! (-> obj particles s5-2 init-pos x) 20.0) - (set! (-> obj particles s5-2 init-pos y) 370.0) - (set! (-> obj particles s5-2 init-pos z) 1.0) - (set! (-> obj particles s5-2 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-2 (-> this nb-of-particles))) + (set! (-> this particles s5-2) (new 'static 'hud-particle)) + (set! (-> this particles s5-2 part) (create-launch-control (-> *part-group-id-table* 113) this)) + (set! (-> this particles s5-2 init-pos x) 20.0) + (set! (-> this particles s5-2 init-pos y) 370.0) + (set! (-> this particles s5-2 init-pos z) 1.0) + (set! (-> this particles s5-2 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-3 (-> obj nb-of-particles))) - (set! (-> obj particles s5-3) (new 'static 'hud-particle)) - (set! (-> obj particles s5-3 part) (create-launch-control (-> *part-group-id-table* 114) obj)) - (set! (-> obj particles s5-3 init-pos x) 70.0) - (set! (-> obj particles s5-3 init-pos y) 370.0) - (set! (-> obj particles s5-3 init-pos z) 7.0) - (set! (-> obj particles s5-3 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-3 (-> this nb-of-particles))) + (set! (-> this particles s5-3) (new 'static 'hud-particle)) + (set! (-> this particles s5-3 part) (create-launch-control (-> *part-group-id-table* 114) this)) + (set! (-> this particles s5-3 init-pos x) 70.0) + (set! (-> this particles s5-3 init-pos y) 370.0) + (set! (-> this particles s5-3 init-pos z) 7.0) + (set! (-> this particles s5-3 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-4 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-4 part matrix) -1) - (set! (-> obj particles s5-4 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-4 (-> this nb-of-particles)) + (if (= (-> this particles s5-4 part matrix) -1) + (set! (-> this particles s5-4 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set! (-> obj x-sgn) -1) - (set! (-> obj y-sgn) 1) - (set! (-> obj force-on-screen) #t) + (set! (-> this x-sgn) -1) + (set! (-> this y-sgn) 1) + (set! (-> this force-on-screen) #t) 0 (none) ) @@ -396,75 +396,75 @@ ) -(defmethod hud-update hud-bike-speed ((obj hud-bike-speed)) +(defmethod hud-update hud-bike-speed ((this hud-bike-speed)) (if *target* - (tally-value obj (the int (-> *target* control unknown-float01)) 0) + (tally-value this (the int (-> *target* control unknown-float01)) 0) ) 0 (none) ) -(defmethod init-particles! hud-bike-speed ((obj hud-bike-speed) (arg0 int)) +(defmethod init-particles! hud-bike-speed ((this hud-bike-speed) (arg0 int)) (add-setting! 'common-page 'set 0.0 2) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 108) obj)) - (set! (-> obj particles s5-0 init-pos x) 433.0) - (set! (-> obj particles s5-0 init-pos y) 370.0) - (set! (-> obj particles s5-0 init-pos z) 3.0) - (set! (-> obj particles s5-0 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 108) this)) + (set! (-> this particles s5-0 init-pos x) 433.0) + (set! (-> this particles s5-0 init-pos y) 370.0) + (set! (-> this particles s5-0 init-pos z) 3.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 109) obj)) - (set! (-> obj particles s5-1 init-pos x) 378.0) - (set! (-> obj particles s5-1 init-pos y) 370.0) - (set! (-> obj particles s5-1 init-pos z) 5.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 109) this)) + (set! (-> this particles s5-1 init-pos x) 378.0) + (set! (-> this particles s5-1 init-pos y) 370.0) + (set! (-> this particles s5-1 init-pos z) 5.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 110) obj)) - (set! (-> obj particles s5-2 init-pos x) 415.0) - (set! (-> obj particles s5-2 init-pos y) 370.0) - (set! (-> obj particles s5-2 init-pos z) 1.0) - (set! (-> obj particles s5-2 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-2 (-> this nb-of-particles))) + (set! (-> this particles s5-2) (new 'static 'hud-particle)) + (set! (-> this particles s5-2 part) (create-launch-control (-> *part-group-id-table* 110) this)) + (set! (-> this particles s5-2 init-pos x) 415.0) + (set! (-> this particles s5-2 init-pos y) 370.0) + (set! (-> this particles s5-2 init-pos z) 1.0) + (set! (-> this particles s5-2 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-3 part matrix) -1) - (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-3 (-> this nb-of-particles)) + (if (= (-> this particles s5-3 part matrix) -1) + (set! (-> this particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set! (-> obj x-sgn) 1) - (set! (-> obj y-sgn) 1) - (set! (-> obj force-on-screen) #t) + (set! (-> this x-sgn) 1) + (set! (-> this y-sgn) 1) + (set! (-> this force-on-screen) #t) 0 (none) ) (#when PC_PORT -;; extra methods needed for aspect ratio in pc port -(defmethod set-pos-and-scale hud-bike-heat ((obj hud-bike-heat) (arg0 symbol) (arg1 symbol)) +;; og:preserve-this extra methods needed for aspect ratio in pc port +(defmethod set-pos-and-scale hud-bike-heat ((this hud-bike-heat) (arg0 symbol) (arg1 symbol)) (with-pc - (let ((base-x (-> obj particles 0 init-pos x))) + (let ((base-x (-> this particles 0 init-pos x))) (*! base-x (-> *pc-settings* aspect-ratio-reciprocal)) - (set! (-> obj particles 0 init-pos x) 13.0) - (set! (-> obj particles 1 init-pos x) 70.0) - (set! (-> obj particles 2 init-pos x) 20.0) - (set! (-> obj particles 3 init-pos x) 70.0) + (set! (-> this particles 0 init-pos x) 13.0) + (set! (-> this particles 1 init-pos x) 70.0) + (set! (-> this particles 2 init-pos x) 20.0) + (set! (-> this particles 3 init-pos x) 70.0) (when (not (-> *pc-settings* use-vis?)) - (dotimes (i (-> obj nb-of-particles)) - (set! (-> obj particles i init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> obj particles i init-pos x) base-x)))) + (dotimes (i (-> this nb-of-particles)) + (set! (-> this particles i init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> this particles i init-pos x) base-x)))) )) @@ -473,17 +473,17 @@ (none) ) -(defmethod set-pos-and-scale hud-bike-speed ((obj hud-bike-speed) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-bike-speed ((this hud-bike-speed) (arg0 symbol) (arg1 symbol)) (with-pc - (let ((base-x (-> obj particles 1 init-pos x))) + (let ((base-x (-> this particles 1 init-pos x))) (+! base-x (* (- 512.0 base-x) (- 1.0 (-> *pc-settings* aspect-ratio-reciprocal)))) - (set! (-> obj particles 0 init-pos x) 433.0) - (set! (-> obj particles 1 init-pos x) 378.0) - (set! (-> obj particles 2 init-pos x) 415.0) + (set! (-> this particles 0 init-pos x) 433.0) + (set! (-> this particles 1 init-pos x) 378.0) + (set! (-> this particles 2 init-pos x) 415.0) (when (not (-> *pc-settings* use-vis?)) - (dotimes (i (-> obj nb-of-particles)) - (set! (-> obj particles i init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> obj particles i init-pos x) base-x)))) + (dotimes (i (-> this nb-of-particles)) + (set! (-> this particles i init-pos x) (+ base-x (* (-> *pc-settings* aspect-ratio-reciprocal) (- (-> this particles i init-pos x) base-x)))) )) diff --git a/goal_src/jak1/levels/racer_common/racer-states.gc b/goal_src/jak1/levels/racer_common/racer-states.gc index 0895ea7c21..642c08f281 100644 --- a/goal_src/jak1/levels/racer_common/racer-states.gc +++ b/goal_src/jak1/levels/racer_common/racer-states.gc @@ -16,7 +16,7 @@ 'racer ) ((and (= message 'get-pickup) (= (-> block param 0) 3)) - (if (>= (- (-> *display* base-frame-counter) (-> self racer boost-time)) (seconds 1)) + (if (time-elapsed? (-> self racer boost-time) (seconds 1)) (send-event self 'boost (fmax 1.0 (fmin 2.0 (the-as float (-> block param 1))))) ) ) @@ -55,7 +55,7 @@ (('boost) (sound-play "get-blue-eco") (set! (-> self racer boost-sound-id) (sound-play "zoom-boost")) - (set! (-> self racer boost-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer boost-time)) (set! (-> self racer boost-level) (seek (-> self racer boost-level) (-> *RACER-bank* boost-level-max) @@ -161,7 +161,7 @@ (set! (-> self racer stick-lock) #f) (set! (-> self racer stick-off) #f) (set! (-> self racer heavy) #f) - (set! (-> self racer unstuck-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer unstuck-time)) (set! (-> self racer stuck-count) 0) (set! (-> self racer cushion-base) 10240.0) (set! (-> self racer shock-offset) 0.0) @@ -334,7 +334,7 @@ ) (pad-buttons l1 r1) ) - (or (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) + (or (not (time-elapsed? (-> self control unknown-dword11) (seconds 0.1))) (< (vector-dot (-> self control dynam gravity-normal) (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) @@ -355,11 +355,7 @@ ) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (or (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) - (* (-> *TARGET-bank* ground-timeout) 2) - ) - (< 75 v1-28) - ) + (or (time-elapsed? (-> self control unknown-dword11) (* (-> *TARGET-bank* ground-timeout) 2)) (< 75 v1-28)) (< 30 v1-28) (< 4096.0 f30-0) ) @@ -387,7 +383,7 @@ (gp-0 #f) ) (when (and (< (fabs (-> self racer bob-mult-trans)) 0.2) - (and (>= (- (-> *display* base-frame-counter) (-> self racer racing-time)) (seconds 0.15)) + (and (time-elapsed? (-> self racer racing-time) (seconds 0.15)) (< 16384.0 (-> self control ground-impact-vel)) ) ) @@ -410,8 +406,8 @@ (set! (-> self racer bob-meta-timer) f0-14) ) (set! (-> self racer bob-mult-trans) (lerp-scale 0.2 2.5 (-> self control ground-impact-vel) 20480.0 81920.0)) - (set! (-> self racer bob-hit-ground-time) (-> *display* base-frame-counter)) - (set! (-> self racer bob-meta-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer bob-hit-ground-time)) + (set-time! (-> self racer bob-meta-time)) (cond ((or s5-0 (and (>= (-> self racer bounce) 1) (< (-> self racer bounce) 2))) (+! (-> self racer bounce) 1) @@ -447,7 +443,7 @@ ) (set! (-> self racer bounce) 0) (loop - (let ((gp-3 (-> *display* base-frame-counter))) + (let ((gp-3 (current-time))) (when (not (ja-group? (-> self draw art-group data 123))) (ja-channel-push! 4 (seconds 0.1)) (ja :group! (-> self draw art-group data 123) :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) @@ -455,13 +451,13 @@ (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) - (while (< (- (-> *display* base-frame-counter) gp-3) (seconds 1)) + (while (not (time-elapsed? gp-3 (seconds 1))) (if (or (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (or (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1 x) (>= (fabs (-> self racer turn-anim-frame)) 1.0) ) ) - (set! gp-3 (-> *display* base-frame-counter)) + (set! gp-3 (current-time)) ) (target-racing-turn-anim) (suspend) @@ -484,7 +480,7 @@ ) :post (behavior () (if (= (-> self next-state name) 'target-racing) - (set! (-> self racer racing-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer racing-time)) ) (target-racing-post) ) @@ -495,7 +491,7 @@ :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self racer shock-offsetv) 0.0) (sound-play "zoomer-jump") - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (when arg2 (when (>= (-> self racer hill-ground-value) 0.11) (set! (-> self racer hill-boost) (* 40960.0 (-> self racer hill-ground-value))) @@ -517,7 +513,7 @@ (if (< (-> self racer slide-mode) 0) (set! (-> self racer slide-down-time 0) (the-as time-frame (if (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) - (the-as int (-> *display* base-frame-counter)) + (the-as int (current-time)) 0 ) ) @@ -538,15 +534,13 @@ ) (cond ((cpad-pressed? (-> self control unknown-cpad-info00 number) l1 r1) - (set! (-> self racer slide-down-time 0) (-> *display* base-frame-counter)) + (set-time! (-> self racer slide-down-time 0)) ) ((not (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1)) (set! (-> self racer slide-down-time 0) 0) 0 ) - ((and (>= (- (-> *display* base-frame-counter) (-> self racer slide-down-time 0)) - (the-as time-frame (-> *RACER-bank* slide-hold-time)) - ) + ((and (time-elapsed? (-> self racer slide-down-time 0) (the-as time-frame (-> *RACER-bank* slide-hold-time))) (< (-> self racer slide-mode) 0) (or (< (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) leftx) (the-as uint 64)) (< (the-as uint 192) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) leftx)) @@ -558,7 +552,7 @@ 1 ) ) - (set! (-> self racer slide-enter-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer slide-enter-time)) (set! (-> self racer slide-amp) 1.0) (set! (-> self racer slide-grip-mult) 0.0) ) @@ -575,7 +569,7 @@ ) ) (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (go target-racing) ) @@ -589,7 +583,7 @@ (set! (-> self racer hop?) #f) ) (target-racing-smack-check) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (logior! (-> self control root-prim prim-core action) (collide-action racer-grounded)) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (-> self control transv)) @@ -613,7 +607,7 @@ :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (logior! (-> self control root-prim prim-core action) (collide-action racer-grounded)) (sound-play "zoomer-jump") - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (racer-calc-gravity) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) @@ -639,7 +633,7 @@ ) (pad-buttons l1 r1) ) - (or (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.2)) + (or (not (time-elapsed? (-> self control unknown-dword11) (seconds 0.2))) (< (vector-dot (-> self control dynam gravity-normal) (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) @@ -651,7 +645,7 @@ (go target-racing-jump 2048.0 5324.8 #t) ) (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (go target-racing) ) @@ -725,7 +719,7 @@ :event (-> target-racing-start event) :enter (behavior () (set! (-> self control unknown-surface00) *racer-air-mods*) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action racer-grounded)) @@ -737,7 +731,7 @@ ) (target-racing-smack-check) (racer-buzz 0.3) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (logior! (-> self control root-prim prim-core action) (collide-action racer-grounded)) ) ) @@ -786,7 +780,7 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) (sound-play "oof") ) - (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self game hit-time)) (logior! (-> self state-flags) (state-flags being-attacked)) (set! (-> self racer boost-curve) 0.0) (set! (-> self racer boost-level) 0.0) @@ -934,7 +928,7 @@ (ja-no-eval :group! (-> self draw art-group data 139) :num! (seek! (ja-aframe 240.0 0)) :frame-num 0.0) (until (ja-done? 0) (set! (-> self racer stick-lock) #t) - (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (seconds-per-frame))) (send-event *camera* 'joystick 0.0 1.0) (suspend) (ja :num! (seek! (ja-aframe 240.0 0))) @@ -945,7 +939,7 @@ (until (ja-done? 0) (set! (-> self racer stick-lock) #t) (send-event *camera* 'joystick 0.0 1.0) - (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (seconds-per-frame))) (if (>= (ja-aframe-num 0) 245.0) (set-forward-vel (* 0.5 (-> self control unknown-float01))) ) @@ -972,8 +966,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((gp-6 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-6) (seconds 2)) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 2)) (suspend) ) ) @@ -999,9 +993,9 @@ ) ) ) - (let ((gp-9 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-9) (seconds 0.75)) - (vector-seek! (-> self draw color-mult) *zero-vector* (* 1.5 (-> *display* seconds-per-frame))) + (let ((gp-9 (current-time))) + (until (time-elapsed? gp-9 (seconds 0.75)) + (vector-seek! (-> self draw color-mult) *zero-vector* (* 1.5 (seconds-per-frame))) (set-forward-vel (* 0.96 (-> self control unknown-float01))) (let ((s5-3 (new-stack-vector0)) (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -1032,10 +1026,10 @@ (set! (-> self control unknown-float01) 0.0) (set! (-> self post-hook) target-no-stick-post) (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (until v1-154 (suspend) - (set! v1-154 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set! v1-154 (and (time-elapsed? (-> self state-time) (seconds 1)) (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask movie))) ) ) @@ -1052,7 +1046,7 @@ (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self alt-cam-pos quad) (-> (&-> (-> self control) unknown-qword00) 0)) (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1098,16 +1092,10 @@ (set! (-> self racer front-rotv) 65536.0) (set! (-> self racer front-rot) (the float - (sar - (shl - (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (-> *display* seconds-per-frame)))) - 48 - ) - 48 - ) + (sar (shl (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (seconds-per-frame)))) 48) 48) ) ) - (+! (-> self racer bottom-rot) (* 364088.88 (-> *display* seconds-per-frame))) + (+! (-> self racer bottom-rot) (* 364088.88 (seconds-per-frame))) (set-twist! (-> self racer front-blade) (the-as float #f) (- (-> self racer front-rot)) (the-as float #f)) (set-twist! (-> self racer bottom-blade) (the-as float #f) (the-as float #f) (- (-> self racer bottom-rot))) ) @@ -1140,20 +1128,14 @@ ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) - (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (current-time) (-> self state-time)))))) ) (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) (set! (-> gp-0 y) (lerp (-> self control unknown-vector102 y) (-> self control unknown-vector103 y) - (fmax - 0.0 - (fmin - 1.0 - (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (-> *display* base-frame-counter)))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (current-time)))))) ) ) (move-to-point! (-> self control) gp-0) @@ -1164,12 +1146,7 @@ f30-0 ) ) - (let ((f30-1 - (fmax - 0.0 - (fmin 1.0 (* 0.010528533 (+ -279.99 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) - ) - ) + (let ((f30-1 (fmax 0.0 (fmin 1.0 (* 0.010528533 (+ -279.99 (the float (- (current-time) (-> self state-time)))))))) ) (set! (-> self control unknown-vector11 y) (lerp (the-as float (-> self control unknown-uint20)) (-> self racer cushion-base) f30-1) @@ -1190,7 +1167,7 @@ :event target-generic-event-handler :exit (-> target-racing-start exit) :code (behavior ((arg0 handle)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *racer-mods*) (let ((a0-2 (-> *hud-parts* bike-speed))) (if a0-2 @@ -1209,14 +1186,14 @@ (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) - (let ((s5-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.5)) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 0.5)) (set! (-> self racer stick-lock) #t) (set-forward-vel (* 0.9 (-> self control unknown-float01))) (set! (-> self racer turn-anim-targ) 0.0) (set! (-> self racer turn-anim-targ) 0.0) (target-racing-turn-anim) - (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (seconds-per-frame))) (suspend) ) ) @@ -1230,7 +1207,7 @@ :exit (-> target-racing-start exit) :code (behavior ((arg0 handle)) (sound-play "zoomer-stop") - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self control trans quad)) @@ -1287,17 +1264,11 @@ ) ) ) - (seek! (-> self racer front-rotv) f0-5 (* 54613.332 (-> *display* seconds-per-frame))) + (seek! (-> self racer front-rotv) f0-5 (* 54613.332 (seconds-per-frame))) ) (set! (-> self racer front-rot) (the float - (sar - (shl - (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (-> *display* seconds-per-frame)))) - 48 - ) - 48 - ) + (sar (shl (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (seconds-per-frame)))) 48) 48) ) ) (when (and (< (fabs (deg-diff (-> *RACER-bank* default-front-blade) (-> self racer front-rot))) 1820.4445) @@ -1306,33 +1277,19 @@ (set! (-> self racer front-rotv) 0.0) (set! (-> self racer front-rot) (-> *RACER-bank* default-front-blade)) ) - (+! (-> self racer bottom-rot) (* 364088.88 (-> *display* seconds-per-frame))) + (+! (-> self racer bottom-rot) (* 364088.88 (seconds-per-frame))) (set-twist! (-> self racer front-blade) (the-as float #f) (- (-> self racer front-rot)) (the-as float #f)) (set-twist! (-> self racer bottom-blade) (the-as float #f) (the-as float #f) (- (-> self racer bottom-rot))) (let ((gp-0 (new 'stack-no-clear 'vector)) - (f30-0 - (fmax - 0.0 - (fmin 1.0 (* 0.004761905 (+ -150.0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) - ) - ) + (f30-0 (fmax 0.0 (fmin 1.0 (* 0.004761905 (+ -150.0 (the float (- (current-time) (-> self state-time)))))))) ) - (fmax - 0.0 - (fmin 1.0 (* 0.006666667 (+ -225.0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) - ) + (fmax 0.0 (fmin 1.0 (* 0.006666667 (+ -225.0 (the float (- (current-time) (-> self state-time))))))) (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) (set! (-> gp-0 y) (lerp (-> self control unknown-vector102 y) (-> self control unknown-vector103 y) - (fmax - 0.0 - (fmin - 1.0 - (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (-> *display* base-frame-counter)))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (current-time)))))) ) ) (move-to-point! (-> self control) gp-0) @@ -1451,7 +1408,7 @@ ) :post (behavior () (racer-sounds) - (seek! (-> self racer heat) 0.0 (* (-> *RACER-bank* surface-heat-inc) (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) 0.0 (* (-> *RACER-bank* surface-heat-inc) (seconds-per-frame))) (vector+! (-> self racer bike-trans) (-> self control trans) (-> self control unknown-vector12)) (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> self control quat)) (set! (-> self racer bike-scale quad) (-> self control scale quad)) diff --git a/goal_src/jak1/levels/racer_common/racer.gc b/goal_src/jak1/levels/racer_common/racer.gc index e3b885f6f0..abc6c81248 100644 --- a/goal_src/jak1/levels/racer_common/racer.gc +++ b/goal_src/jak1/levels/racer_common/racer.gc @@ -39,13 +39,13 @@ ) -(defmethod relocate racer ((obj racer) (arg0 int)) +(defmethod relocate racer ((this racer) (arg0 int)) (countdown (v1-0 2) - (if (-> obj path-data v1-0) - (&+! (-> obj path-data v1-0) arg0) + (if (-> this path-data v1-0) + (&+! (-> this path-data v1-0) arg0) ) ) - (the-as racer ((method-of-type process-drawable relocate) obj arg0)) + (the-as racer ((method-of-type process-drawable relocate) this arg0)) ) (defskelgroup *racer-sg* racer racer-geo-jg racer-racer-idle-ja @@ -316,8 +316,8 @@ (racer-effect) (suspend) ) - (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 1)) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 1)) (racer-effect) (suspend) ) @@ -371,8 +371,8 @@ ) ) -(defmethod init-from-entity! racer ((obj racer) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! racer ((this racer) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -386,50 +386,50 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (res-lump-float arg0 'rotoffset)) - (initialize-skeleton obj *racer-sg* '()) - (set! (-> obj shadow-backup) (-> obj draw shadow)) - (set! (-> obj draw shadow-ctrl) *racer-shadow-control*) - (let ((v1-23 (-> obj node-list data))) + (process-drawable-from-entity! this arg0) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) (res-lump-float arg0 'rotoffset)) + (initialize-skeleton this *racer-sg* '()) + (set! (-> this shadow-backup) (-> this draw shadow)) + (set! (-> this draw shadow-ctrl) *racer-shadow-control*) + (let ((v1-23 (-> this node-list data))) (set! (-> v1-23 0 param0) cspace<-transformq+trans!) - (set! (-> v1-23 0 param1) (the-as basic (-> obj root-override trans))) - (set! (-> v1-23 0 param2) (the-as basic (-> obj extra-trans))) + (set! (-> v1-23 0 param1) (the-as basic (-> this root-override trans))) + (set! (-> v1-23 0 param2) (the-as basic (-> this extra-trans))) ) - (set! (-> obj condition) (res-lump-value arg0 'index int)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this condition) (res-lump-value arg0 'index int)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 115) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 115) this)) (dotimes (s5-1 2) - (let ((v1-32 (new 'process 'curve-control obj 'path (the float (+ s5-1 1))))) - (set! (-> obj path-data s5-1) v1-32) + (let ((v1-32 (new 'process 'curve-control this 'path (the float (+ s5-1 1))))) + (set! (-> this path-data s5-1) v1-32) (if v1-32 (logior! (-> v1-32 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) ) - (set! (-> obj path) (-> obj path-target)) - (set-vector! (-> obj extra-trans) 0.0 6144.0 0.0 1.0) - (set! (-> obj auto-get-off) #f) - (move-to-ground (-> obj root-override) 40960.0 40960.0 #t (collide-kind background)) - (set! (-> obj cell) (the-as handle #f)) + (set! (-> this path) (-> this path-target)) + (set-vector! (-> this extra-trans) 0.0 6144.0 0.0 1.0) + (set! (-> this auto-get-off) #f) + (move-to-ground (-> this root-override) 40960.0 40960.0 #t (collide-kind background)) + (set! (-> this cell) (the-as handle #f)) (blocking-plane-spawn (the-as curve-control (if (or (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) - (= (-> obj condition) 3) + (= (-> this condition) 3) ) - (-> obj path-racer) - (-> obj path-target) + (-> this path-racer) + (-> this path-target) ) ) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> obj root-override trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root-override trans)) ) - (go (method-of-object obj wait-for-start)) + (go (method-of-object this wait-for-start)) (none) ) diff --git a/goal_src/jak1/levels/racer_common/target-racer-h.gc b/goal_src/jak1/levels/racer_common/target-racer-h.gc index 69628cfb1f..155cb7e6c5 100644 --- a/goal_src/jak1/levels/racer_common/target-racer-h.gc +++ b/goal_src/jak1/levels/racer_common/target-racer-h.gc @@ -17,7 +17,6 @@ ;; DECOMP BEGINS - (deftype racer-info (basic) ((entity entity-actor :offset-assert 4) (bike-trans vector :inline :offset-assert 16) diff --git a/goal_src/jak1/levels/racer_common/target-racer.gc b/goal_src/jak1/levels/racer_common/target-racer.gc index d34b92c231..fd77da2d64 100644 --- a/goal_src/jak1/levels/racer_common/target-racer.gc +++ b/goal_src/jak1/levels/racer_common/target-racer.gc @@ -105,7 +105,7 @@ ((or (-> self racer hop?) (= (-> self next-state name) 'target-racing-bounce)) (lerp-scale 81920.0 163840.0 (-> self control unknown-float01) 0.0 (-> self racer transv-max)) ) - ((>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.6)) + ((time-elapsed? (-> self control unknown-dword11) (seconds 0.6)) (lerp-scale 81920.0 122880.0 (-> self control unknown-float01) 0.0 (-> self racer transv-max)) ) (else @@ -150,7 +150,7 @@ ) ) ) - (seek! (-> self racer slide-amp) 0.0 (* 0.3 (-> *display* seconds-per-frame))) + (seek! (-> self racer slide-amp) 0.0 (* 0.3 (seconds-per-frame))) (if (= (-> self racer slide-amp) 0.0) (set! (-> self racer slide-mode) -1) ) @@ -160,7 +160,7 @@ (defbehavior racer-xz target ((arg0 float) (arg1 float)) (set! (-> self racer slide-shift-x) arg1) - (seek! (-> self racer slide-interp) 0.0 (-> *display* seconds-per-frame)) + (seek! (-> self racer slide-interp) 0.0 (seconds-per-frame)) (let ((f30-1 (if (or (< (* arg1 arg0) 0.0) (not (racer-on-ground?))) 1.0 @@ -174,7 +174,7 @@ (lerp-scale 91022.22 236657.78 (-> self control unknown-float01) 0.0 (* 0.125 (-> self racer transv-max))) ) ) - (seek! (-> self racer rotv y) (* arg0 f30-1 (- f28-1)) (* f0-18 (-> *display* seconds-per-frame))) + (seek! (-> self racer rotv y) (* arg0 f30-1 (- f28-1)) (* f0-18 (seconds-per-frame))) ) (set! (-> self racer rotv y) (* (-> self racer rotv y) @@ -189,7 +189,7 @@ (set! (-> self racer slide-grip-mult) 1.0) ) (s5-1 - (seek! (-> self racer slide-grip-mult) 1.0 (-> *display* seconds-per-frame)) + (seek! (-> self racer slide-grip-mult) 1.0 (seconds-per-frame)) ) ) (let ((f30-4 (* (deg-diff f30-3 0.0) (-> self racer slide-grip-mult)))) @@ -208,10 +208,7 @@ (vector-rotate-y! (-> self control unknown-vector00) (-> self control unknown-vector00) - (fmax - (fmin f30-4 (* 10922.667 (-> *display* seconds-per-frame))) - (* -10922.667 (-> *display* seconds-per-frame)) - ) + (fmax (fmin f30-4 (* 10922.667 (seconds-per-frame))) (* -10922.667 (seconds-per-frame))) ) ) ) @@ -271,24 +268,18 @@ ) ) ) - (+! (-> self control unknown-vector00 z) (* f1-4 (-> *display* seconds-per-frame))) + (+! (-> self control unknown-vector00 z) (* f1-4 (seconds-per-frame))) ) ) (seek! (-> self racer front-rotv) (+ 65536.0 (* 364088.88 (+ f0-0 (* 0.1 arg1)))) - (* 364088.88 (-> *display* seconds-per-frame)) + (* 364088.88 (seconds-per-frame)) ) ) (set! (-> self racer front-rot) (the float - (sar - (shl - (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (-> *display* seconds-per-frame)))) - 48 - ) - 48 - ) + (sar (shl (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (seconds-per-frame)))) 48) 48) ) ) (let* ((f1-12 (-> self control unknown-surface01 fric)) @@ -335,7 +326,7 @@ ) ) (+! (-> self racer bottom-rot) - (* (+ 364088.88 (* 0.32 (fabs (-> self control unknown-vector00 y)))) (-> *display* seconds-per-frame)) + (* (+ 364088.88 (* 0.32 (fabs (-> self control unknown-vector00 y)))) (seconds-per-frame)) ) 0 (none) @@ -344,11 +335,7 @@ (defbehavior racer-cushion target ((arg0 float)) (let ((f30-0 (-> self racer bob-period))) (let ((f28-0 1.0)) - (seek! - (-> self racer bob-meta-timer) - (-> self racer bob-meta-meta-timer) - (* 4.0 (-> *display* seconds-per-frame)) - ) + (seek! (-> self racer bob-meta-timer) (-> self racer bob-meta-meta-timer) (* 4.0 (seconds-per-frame))) (let* ((f0-8 (sin (/ (* 65536.0 (-> self racer bob-timer)) f30-0))) (f0-9 (* 1228.8 (-> self racer bob-mult-trans) f28-0 f0-8)) ) @@ -391,7 +378,7 @@ (set! (-> self racer hill-offset) (lerp (-> self racer hill-offset) 0.0 0.05)) ) ) - (seek! (-> self racer hill-boost) 0.0 (* 81920.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer hill-boost) 0.0 (* 81920.0 (seconds-per-frame))) (set! (-> self racer hill-offset) 0.0) 0 (none) @@ -408,20 +395,20 @@ ) (+! (-> self racer shock-offsetv) (* (- (-> gp-0 y) (-> self control transv y)) f30-0)) (+! (-> self racer shock-offsetv) - (+ (* -20.0 (-> *display* seconds-per-frame) (-> self racer shock-offset)) + (+ (* -20.0 (seconds-per-frame) (-> self racer shock-offset)) (if (racer-on-ground?) - (* (-> self control dynam gravity-length) (-> *display* seconds-per-frame) f30-0) + (* (-> self control dynam gravity-length) (seconds-per-frame) f30-0) 0.0 ) ) ) ) - (if (and (or (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.2)) + (if (and (or (not (time-elapsed? (-> self control unknown-dword11) (seconds 0.2))) (< (-> self racer shock-offset) 0.0) ) (!= (-> self control unknown-surface00 mode) 'air) ) - (+! (-> self racer shock-offset) (* (-> self racer shock-offsetv) (-> *display* seconds-per-frame))) + (+! (-> self racer shock-offset) (* (-> self racer shock-offsetv) (seconds-per-frame))) ) (set! (-> self racer shock-offset) (* (-> self racer shock-offset) (lerp-scale 0.99 0.98 (-> self control unknown-float01) 0.0 28672.0)) @@ -539,11 +526,7 @@ ) ) ) - (seek! - (-> self control unknown-float80) - f0-2 - (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) - ) + (seek! (-> self control unknown-float80) f0-2 (* (-> self control unknown-float82) (seconds-per-frame))) ) (vector-deg-slerp (-> self control dynam gravity-normal) @@ -583,7 +566,7 @@ (if (< 2.5 f0-6) (set! f0-6 2.5) ) - (seek! (-> self racer engine-sound-pitch) f0-6 (* 4.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer engine-sound-pitch) f0-6 (* 4.0 (seconds-per-frame))) ) ) (let ((f0-11 (lerp-scale 100.0 60.0 (-> self racer engine-sound-pitch) 0.8 2.0))) @@ -602,18 +585,18 @@ ((or (logtest? (-> self control status) (cshape-moving-flags onground)) (< 12288.0 (vector-length (-> self control transv))) ) - (let ((v0-5 (the-as object (-> *display* base-frame-counter)))) + (let ((v0-5 (the-as object (current-time)))) (set! (-> self racer unstuck-time) (the-as time-frame v0-5)) v0-5 ) ) - ((>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) (seconds 5)) + ((time-elapsed? (-> self racer unstuck-time) (seconds 5)) (send-event self 'attack #f (static-attack-info ((mode 'heat)))) ) - ((and (>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) (seconds 3)) - (>= (- (-> *display* base-frame-counter) (-> self racer heat-sound-time)) (seconds 1)) + ((and (time-elapsed? (-> self racer unstuck-time) (seconds 3)) + (time-elapsed? (-> self racer heat-sound-time) (seconds 1)) ) - (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer heat-sound-time)) (sound-play "warning") ) ) @@ -781,7 +764,7 @@ (>= (-> self fact-info-target eco-level) 1.0) ) (cpad-pressed? (-> self control unknown-cpad-info00 number) circle square) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.25)) + (time-elapsed? (-> self control unknown-dword82) (seconds 0.25)) (not (logtest? (-> self state-flags) (state-flags being-attacked dying))) ) (let ((gp-6 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) @@ -804,7 +787,7 @@ :to self ) ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword82)) ) (let ((f22-0 (-> *RACER-bank* hotcoals-heat-inc)) (f24-0 (-> *RACER-bank* lava-heat-inc)) @@ -827,24 +810,24 @@ ) (case (-> self control poly-pat material) (((pat-material hotcoals)) - (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f22-1 (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f22-1 (seconds-per-frame))) ) (((pat-material lava)) (if (racer-on-ground?) - (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f24-1 (-> *display* seconds-per-frame))) - (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f28-2 (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f24-1 (seconds-per-frame))) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f28-2 (seconds-per-frame))) ) ) (else (if (not (racer-on-ground?)) - (seek! (-> self racer heat) 0.0 (* f26-0 (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) 0.0 (* f26-0 (seconds-per-frame))) ) ) ) ) - (let ((v1-189 (- (-> *display* base-frame-counter) (-> self control unknown-dword11)))) + (let ((v1-189 (- (current-time) (-> self control unknown-dword11)))) (if (and (>= v1-189 (seconds 0.9)) (>= (seconds 3) v1-189)) - (seek! (-> self racer heat) 0.0 (* f30-2 (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) 0.0 (* f30-2 (seconds-per-frame))) ) ) ) @@ -855,7 +838,7 @@ (if (and *cheat-mode* (or *debug-segment* PC_PORT) (cpad-pressed? 0 l2)) (send-event self 'boost 1.0) ) - (let ((v1-218 (- (-> *display* base-frame-counter) (-> self racer boost-time)))) + (let ((v1-218 (- (current-time) (-> self racer boost-time)))) (if (< v1-218 (-> self racer boost-duration)) (set! (-> self racer boost-curve) (* (-> *RACER-bank* boost-curve-max) @@ -885,7 +868,7 @@ (set! (-> self racer boost-level) 0.0) ) (set! (-> self racer boost-target) (+ (-> self racer boost-curve) (-> self racer boost-level))) - (seek! (-> self racer boost-output) (-> self racer boost-target) (* 40960.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer boost-output) (-> self racer boost-target) (* 40960.0 (seconds-per-frame))) (when (!= (-> self racer boost-output) 0.0) (dotimes (gp-7 8) (let ((v1-258 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) @@ -932,12 +915,13 @@ ) (when (and (< (-> self racer heat) (-> *RACER-bank* heat-max)) (and (< (* 0.8 (-> *RACER-bank* heat-max)) (-> self racer heat)) - (>= (- (-> *display* base-frame-counter) (-> self racer heat-sound-time)) - (the int (* 3000.0 (- 1.0 (/ (-> self racer heat) (-> *RACER-bank* heat-max))))) - ) + (time-elapsed? + (-> self racer heat-sound-time) + (the int (* 3000.0 (- 1.0 (/ (-> self racer heat) (-> *RACER-bank* heat-max))))) + ) ) ) - (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer heat-sound-time)) (sound-play "warning") ) (when (rand-vu-percent? (/ (-> self racer heat) (-> *RACER-bank* heat-max))) @@ -983,7 +967,7 @@ 0.0 (* 0.3 (-> self racer transv-max)) ) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) (set! (-> self racer turn-anim-vel) @@ -997,7 +981,7 @@ ) ) ) - (+! (-> self racer turn-anim-frame) (* (-> self racer turn-anim-vel) (-> *display* seconds-per-frame))) + (+! (-> self racer turn-anim-frame) (* (-> self racer turn-anim-vel) (seconds-per-frame))) (set! (-> self racer turn-anim-frame) (fmax -20.0 (fmin 20.0 (-> self racer turn-anim-frame)))) (cond ((and (>= (-> self racer turn-anim-frame) 20.0) (>= (-> self racer turn-anim-vel) 0.0)) @@ -1009,14 +993,14 @@ ) (+! (-> self racer tail-anim-vel) (* -50.0 - (-> *display* seconds-per-frame) + (seconds-per-frame) (- (-> self racer tail-anim-frame) (* -0.0091552725 (- (-> self racer change-roty) (-> self racer change-roty-old))) ) ) ) (set! (-> self racer tail-anim-vel) (fmax -100.0 (fmin 100.0 (* 0.8 (-> self racer tail-anim-vel))))) - (+! (-> self racer tail-anim-frame) (* (-> self racer tail-anim-vel) (-> *display* seconds-per-frame))) + (+! (-> self racer tail-anim-frame) (* (-> self racer tail-anim-vel) (seconds-per-frame))) (set! (-> self racer tail-anim-frame) (fmax -20.0 (fmin 20.0 (-> self racer tail-anim-frame)))) (cond ((and (>= (-> self racer tail-anim-frame) 20.0) (>= (-> self racer tail-anim-vel) 0.0)) @@ -1027,10 +1011,10 @@ ) ) (+! (-> self racer rudd-anim-vel) - (* 40.0 (-> *display* seconds-per-frame) (- (-> self racer tail-anim-frame) (-> self racer rudd-anim-frame))) + (* 40.0 (seconds-per-frame) (- (-> self racer tail-anim-frame) (-> self racer rudd-anim-frame))) ) (set! (-> self racer rudd-anim-vel) (fmax -100.0 (fmin 100.0 (* 0.96 (-> self racer rudd-anim-vel))))) - (+! (-> self racer rudd-anim-frame) (* (-> self racer rudd-anim-vel) (-> *display* seconds-per-frame))) + (+! (-> self racer rudd-anim-frame) (* (-> self racer rudd-anim-vel) (seconds-per-frame))) (set! (-> self racer rudd-anim-frame) (fmax -20.0 (fmin 20.0 (-> self racer rudd-anim-frame)))) (cond ((and (>= (-> self racer rudd-anim-frame) 20.0) (>= (-> self racer rudd-anim-vel) 0.0)) @@ -1125,7 +1109,7 @@ (loop (suspend) (let ((gp-3 (-> self skel root-channel 1))) - (set! f30-1 (seek f30-1 1.0 (-> *display* seconds-per-frame))) + (set! f30-1 (seek f30-1 1.0 (seconds-per-frame))) (set! (-> gp-3 frame-interp) f30-1) ) ) @@ -1295,8 +1279,8 @@ ) (cond ((racer-on-ground?) - (seek! (-> self control unknown-float81) 1.0 (* 8.0 (-> *display* seconds-per-frame))) - (seek! (-> self racer mult-rotx) 0.0 (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-float81) 1.0 (* 8.0 (seconds-per-frame))) + (seek! (-> self racer mult-rotx) 0.0 (* 2.0 (seconds-per-frame))) (set! (-> self racer targ-rotx) 0.0) (set! (-> self racer hill-rotx) 0.0) (set! (-> self racer speed-rotx) 0.25) @@ -1313,14 +1297,14 @@ (if (< 1.5 (-> self racer bob-meta-meta-timer)) (seek! (-> self racer bob-meta-meta-timer) 1.0 0.5) ) - (when (>= (- (-> *display* base-frame-counter) (-> self racer bob-meta-time)) (seconds 2.2)) - (set! (-> self racer bob-meta-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self racer bob-meta-time) (seconds 2.2)) + (set-time! (-> self racer bob-meta-time)) (set! (-> self racer bob-meta-meta-timer) (rand-vu-float-range 0.8 1.2)) ) ) ) (let ((f0-63 (lerp-scale -1.0 -0.33 (-> self control unknown-float01) 0.0 (-> self racer transv-max)))) - (seek! (-> self racer bob-mult-rot) f0-63 (* 8.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer bob-mult-rot) f0-63 (* 8.0 (seconds-per-frame))) ) (if (< 0.0 f30-1) (set! f30-1 0.0) @@ -1328,8 +1312,8 @@ (set! (-> self racer stick-lock) #f) ) (else - (seek! (-> self control unknown-float81) 0.0 (* 2.0 (-> *display* seconds-per-frame))) - (seek! (-> self racer mult-rotx) 1.0 (* 16.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-float81) 0.0 (* 2.0 (seconds-per-frame))) + (seek! (-> self racer mult-rotx) 1.0 (* 16.0 (seconds-per-frame))) (let ((f0-77 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (the-as vector (-> self control trans-old))) (let* ((v1-128 (-> self racer bounce)) @@ -1363,8 +1347,8 @@ (and (= (-> self next-state name) 'target-racing-bounce) (= (-> self racer bounce) 1)) ) (set! (-> self racer speed-rotx) 0.5) - (when (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) - (seek! (-> self racer hill-rotx) 0.0 (* 65536.0 (-> *display* seconds-per-frame))) + (when (time-elapsed? (-> self control unknown-dword11) (seconds 0.1)) + (seek! (-> self racer hill-rotx) 0.0 (* 65536.0 (seconds-per-frame))) (set! (-> self racer speed-rotx) 0.6) ) ) @@ -1372,7 +1356,7 @@ (set! (-> self racer speed-rotx) 0.25) ) ) - (seek! (-> self racer mult-rotx) 1.0 (* 64.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer mult-rotx) 1.0 (* 64.0 (seconds-per-frame))) ) (else (set! (-> self racer speed-rotx) 0.025) @@ -1384,20 +1368,14 @@ ) (set! (-> self racer bob-timer) (- f0-91 (* (the float (the int (/ f0-91 f1-44))) f1-44))) ) - (seek! (-> self racer bob-mult-rot) 0.0 (* 16.0 (-> *display* seconds-per-frame))) - (seek! (-> self racer bob-mult-trans) 0.0 (* 16.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer bob-mult-rot) 0.0 (* 16.0 (seconds-per-frame))) + (seek! (-> self racer bob-mult-trans) 0.0 (* 16.0 (seconds-per-frame))) (set! f30-1 - (lerp-scale - f30-1 - 1820.4445 - (the float (- (-> *display* base-frame-counter) (-> self control unknown-dword11))) - 0.0 - 900.0 - ) + (lerp-scale f30-1 1820.4445 (the float (- (current-time) (-> self control unknown-dword11))) 0.0 900.0) ) (cond ((and (logtest? (-> self control status) (cshape-moving-flags twall)) - (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) + (and (time-elapsed? (-> self control unknown-dword11) (seconds 0.1)) (or (-> self racer stick-lock) (< (target-move-dist (-> *TARGET-bank* stuck-time)) 4096.0)) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) @@ -1432,10 +1410,7 @@ (set! (-> self racer change-roty-old) (-> self racer change-roty)) (set! (-> self racer rot y) (the float - (sar - (shl (the int (+ (-> self racer rot y) (* (-> self racer rotv y) (-> *display* seconds-per-frame)))) 48) - 48 - ) + (sar (shl (the int (+ (-> self racer rot y) (* (-> self racer rotv y) (seconds-per-frame)))) 48) 48) ) ) (set! (-> self racer change-roty) diff --git a/goal_src/jak1/levels/robocave/cave-trap.gc b/goal_src/jak1/levels/robocave/cave-trap.gc index a394ceb36a..7fe96af989 100644 --- a/goal_src/jak1/levels/robocave/cave-trap.gc +++ b/goal_src/jak1/levels/robocave/cave-trap.gc @@ -50,11 +50,11 @@ (local-vars (v0-0 object)) (case message (('can-spawn?) - (return (>= (- (-> *display* base-frame-counter) (-> self last-spawn-time)) (seconds 1))) + (return (time-elapsed? (-> self last-spawn-time) (seconds 1))) v0-0 ) (('notify-spawned) - (set! v0-0 (-> *display* base-frame-counter)) + (set! v0-0 (current-time)) (set! (-> self last-spawn-time) (the-as time-frame v0-0)) v0-0 ) @@ -67,10 +67,10 @@ ) ) -(defmethod init-from-entity! spider-vent ((obj spider-vent) (arg0 entity-actor)) - (set! (-> obj last-spawn-time) 0) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! spider-vent ((this spider-vent) (arg0 entity-actor)) + (set! (-> this last-spawn-time) 0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (go spider-vent-idle) (none) ) @@ -112,9 +112,9 @@ ) -(defmethod cave-trap-method-20 cave-trap ((obj cave-trap)) - (set! (-> obj last-spawn-time) (-> *display* base-frame-counter)) - (set! (-> obj spawn-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.5))) +(defmethod cave-trap-method-20 cave-trap ((this cave-trap)) + (set-time! (-> this last-spawn-time)) + (set! (-> this spawn-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.5))) (let ((s5-0 (new 'stack-no-clear 'spawn-baby-spider-work))) (let ((s4-0 (new 'stack-no-clear 'vector))) (dotimes (v1-2 4) @@ -125,8 +125,8 @@ (vector-normalize! s4-0 102400.0) (vector+! s4-0 s4-0 (camera-pos)) (set! (-> s4-0 y) (-> (target-pos 0) y)) - (dotimes (s3-2 (-> obj alt-actors length)) - (let* ((v1-10 (-> obj alt-actors s3-2)) + (dotimes (s3-2 (-> this alt-actors length)) + (let* ((v1-10 (-> this alt-actors s3-2)) (s1-0 (if v1-10 (-> v1-10 extra process) ) @@ -182,7 +182,7 @@ (dotimes (s4-1 4) (let ((v1-29 (-> s5-0 best s4-1 index))) (when (>= v1-29 0) - (let* ((v1-32 (-> obj alt-actors v1-29)) + (let* ((v1-32 (-> this alt-actors v1-29)) (s2-3 (if v1-32 (-> v1-32 extra process) ) @@ -197,10 +197,10 @@ (vector-! s2-4 (target-pos 0) (-> (the-as process-drawable s3-3) root trans)) (vector-normalize! s2-4 1.0) (init! s1-1 (= (-> s3-3 type) spider-egg) #t #t #t 7 1 'untrigger) - (let ((v1-40 (process-spawn baby-spider obj (-> (the-as process-drawable s3-3) root trans) s2-4 s1-1 :to obj))) + (let ((v1-40 (process-spawn baby-spider this (-> (the-as process-drawable s3-3) root trans) s2-4 s1-1 :to this))) (when v1-40 (set! (-> (the-as baby-spider (-> v1-40 0)) die-if-not-visible?) #t) - (+! (-> obj spider-count) 1) + (+! (-> this spider-count) 1) (send-event s3-3 'notify-spawned) (return #f) ) @@ -256,9 +256,7 @@ (go cave-trap-give-up) ) ) - (if (and (< (-> self spider-count) 8) - (>= (- (-> *display* base-frame-counter) (-> self last-spawn-time)) (-> self spawn-delay)) - ) + (if (and (< (-> self spider-count) 8) (time-elapsed? (-> self last-spawn-time) (-> self spawn-delay))) (cave-trap-method-20 self) ) ) @@ -283,21 +281,21 @@ ) ) -(defmethod relocate cave-trap ((obj cave-trap) (arg0 int)) - (if (nonzero? (-> obj alt-actors)) - (&+! (-> obj alt-actors) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method cave-trap 7)) this arg0) ) ) -(defmethod init-from-entity! cave-trap ((obj cave-trap) (arg0 entity-actor)) - (set! (-> obj spider-count) 0) - (set! (-> obj spawn-delay) 0) - (set! (-> obj last-spawn-time) 0) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! cave-trap ((this cave-trap) (arg0 entity-actor)) + (set! (-> this spider-count) 0) + (set! (-> this spawn-delay) 0) + (set! (-> this last-spawn-time) 0) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core offense) (collide-offense no-offense)) (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 4096.0) @@ -305,19 +303,19 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj nav nearest-y-threshold) 409600.0) - (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (process-drawable-from-entity! this arg0) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this nav nearest-y-threshold) 409600.0) + (logclear! (-> this root-override nav-flags) (nav-flags navf0)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s4-1 (entity-actor-count arg0 'alt-actor))) - (set! (-> obj alt-actors) (new 'process 'boxed-array entity-actor s4-1)) + (set! (-> this alt-actors) (new 'process 'boxed-array entity-actor s4-1)) (dotimes (s3-1 s4-1) - (set! (-> obj alt-actors s3-1) (entity-actor-lookup arg0 'alt-actor s3-1)) + (set! (-> this alt-actors s3-1) (entity-actor-lookup arg0 'alt-actor s3-1)) ) ) (go cave-trap-idle) diff --git a/goal_src/jak1/levels/robocave/spider-egg.gc b/goal_src/jak1/levels/robocave/spider-egg.gc index 13fb7efc22..dcf5a471bf 100644 --- a/goal_src/jak1/levels/robocave/spider-egg.gc +++ b/goal_src/jak1/levels/robocave/spider-egg.gc @@ -68,7 +68,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior ((arg0 symbol)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) @@ -209,10 +209,10 @@ :post ja-post ) -(defmethod init-from-entity! spider-egg ((obj spider-egg) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask attackable)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! spider-egg ((this spider-egg) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask attackable)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -228,34 +228,34 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *spider-egg-unbroken-sg* '()) - (setup-lods! (-> obj broken-look) *spider-egg-broken-sg* (-> obj draw art-group) (-> obj entity)) - (set-vector! (-> obj root-override scale) 0.4 0.4 0.4 1.0) - (if (not (move-to-ground (-> obj root-override) 12288.0 40960.0 #t (collide-kind background))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *spider-egg-unbroken-sg* '()) + (setup-lods! (-> this broken-look) *spider-egg-broken-sg* (-> this draw art-group) (-> this entity)) + (set-vector! (-> this root-override scale) 0.4 0.4 0.4 1.0) + (if (not (move-to-ground (-> this root-override) 12288.0 40960.0 #t (collide-kind background))) (go process-drawable-art-error "no ground") ) - (+! (-> obj root-override trans y) -409.6) + (+! (-> this root-override trans y) -409.6) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> obj root-override surface-normal quad)) + (set! (-> s4-1 quad) (-> this root-override surface-normal quad)) (+! (-> s4-1 x) (rand-vu-float-range -0.2 0.2)) (+! (-> s4-1 z) (rand-vu-float-range -0.2 0.2)) (vector-normalize! s4-1 1.0) (quaternion-axis-angle! - (-> obj root-override quat) + (-> this root-override quat) (-> s4-1 x) (-> s4-1 y) (-> s4-1 z) (rand-vu-float-range 0.0 65536.0) ) ) - (update-transforms! (-> obj root-override)) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (update-transforms! (-> this root-override)) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) (if (> (entity-actor-count arg0 'alt-actor) 0) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj notify-actor) #f) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this notify-actor) #f) ) (go spider-egg-idle #t) (none) diff --git a/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc b/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc index ffa89874e0..6fea209f95 100644 --- a/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc +++ b/goal_src/jak1/levels/rolling/rolling-lightning-mole.gc @@ -347,7 +347,7 @@ ) ) ) - (when (>= (- (-> *display* base-frame-counter) (-> self last-reflection-time)) (-> self flee-info reflection-time)) + (when (time-elapsed? (-> self last-reflection-time) (-> self flee-info reflection-time)) (let ((s3-0 (new 'stack-no-clear 'matrix)) (s5-2 (new 'stack-no-clear 'vector)) ) @@ -368,7 +368,7 @@ ) ) (if (fleeing-nav-enemy-clip-travel self (-> self desired-travel)) - (set! (-> self last-reflection-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-reflection-time)) ) (fleeing-nav-enemy-adjust-travel self (-> self desired-travel)) (fleeing-nav-enemy-chase-post-func) @@ -634,12 +634,12 @@ (set! (-> gp-0 quad) (-> self debug-vector quad)) (set! (-> self target-speed) (-> self nav-info run-travel-speed)) (format *stdcon* "tgt-speed ~M defmd ~M~%" (-> self target-speed) (-> self flee-info deflection-max-dist)) - (if (>= (- (-> *display* base-frame-counter) (-> self last-reflection-time)) (-> self flee-info reflection-time)) + (if (time-elapsed? (-> self last-reflection-time) (-> self flee-info reflection-time)) (vector-normalize-copy! (-> self desired-travel) gp-0 (-> self flee-info deflection-max-dist)) ) ) (if (fleeing-nav-enemy-clip-travel self (-> self desired-travel)) - (set! (-> self last-reflection-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-reflection-time)) ) (set! (-> self debug-vector quad) (-> self desired-travel quad)) (fleeing-nav-enemy-adjust-travel self (-> self desired-travel)) @@ -867,17 +867,17 @@ :post fleeing-nav-enemy-chase-post ) -(defmethod attack-handler lightning-mole ((obj lightning-mole) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler lightning-mole ((this lightning-mole) (arg0 process) (arg1 event-message-block)) (send-event arg0 'get-attack-count 1) - (when (!= (-> obj state) lightning-mole-yelp) + (when (!= (-> this state) lightning-mole-yelp) (send-event arg0 'jump 32768.0 32768.0) (go lightning-mole-yelp) ) #t ) -(defmethod touch-handler lightning-mole ((obj lightning-mole) (arg0 process) (arg1 event-message-block)) - (when (!= (-> obj state) lightning-mole-yelp) +(defmethod touch-handler lightning-mole ((this lightning-mole) (arg0 process) (arg1 event-message-block)) + (when (!= (-> this state) lightning-mole-yelp) (send-event arg0 'jump 32768.0 32768.0) (go lightning-mole-yelp) ) @@ -937,8 +937,8 @@ ) ) -(defmethod init-from-entity! lightning-mole ((obj lightning-mole) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! lightning-mole ((this lightning-mole) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -954,42 +954,42 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lightning-mole-sg* '()) - (init-defaults! obj *lightning-mole-nav-enemy-info*) - (logclear! (-> obj nav flags) (nav-control-flags navcf5 navcf6 navcf7)) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj reaction-time) (seconds 0.05)) - (set! (-> obj last-reflection-time) 0) - (set! (-> obj collide-info pause-adjust-distance) 122880.0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj flee-info min-reflect-angle) 10922.667) - (set! (-> obj flee-info max-reflect-angle) 14563.556) - (set! (-> obj flee-info max-boundary-deflection) 18204.445) - (set! (-> obj flee-info deflection-min-dist) 20480.0) - (set! (-> obj flee-info deflection-max-dist) 49152.0) - (set! (-> obj flee-info reflection-time) 225) - (set! (-> obj flee-info travel-rotate-speed) 1820.4445) - (set! (-> obj flee-info blend_interp_angle) 2184.5334) - (set! (-> obj flee-info min-speed-adjust) 0.8) - (set! (-> obj flee-info max-speed-adjust) 1.2) - (set! (-> obj flee-info speed-adjust-center) 40960.0) - (set! (-> obj flee-info speed-adjust-range) 20480.0) - (set! (-> obj flee-info abort-notice-distance) 49152.0) - (set! (-> obj flee-info min-notice-dist) 61440.0) - (set! (-> obj flee-info max-notice-dist) 143360.0) - (set! (-> obj flee-info min-stop-chase-dist) 40960.0) - (set! (-> obj flee-info max-stop-chase-dist) 184320.0) - (set! (-> obj flee-info max-flee-rotation) 364.0889) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lightning-mole-sg* '()) + (init-defaults! this *lightning-mole-nav-enemy-info*) + (logclear! (-> this nav flags) (nav-control-flags navcf5 navcf6 navcf7)) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (set! (-> this reaction-time) (seconds 0.05)) + (set! (-> this last-reflection-time) 0) + (set! (-> this collide-info pause-adjust-distance) 122880.0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this flee-info min-reflect-angle) 10922.667) + (set! (-> this flee-info max-reflect-angle) 14563.556) + (set! (-> this flee-info max-boundary-deflection) 18204.445) + (set! (-> this flee-info deflection-min-dist) 20480.0) + (set! (-> this flee-info deflection-max-dist) 49152.0) + (set! (-> this flee-info reflection-time) 225) + (set! (-> this flee-info travel-rotate-speed) 1820.4445) + (set! (-> this flee-info blend_interp_angle) 2184.5334) + (set! (-> this flee-info min-speed-adjust) 0.8) + (set! (-> this flee-info max-speed-adjust) 1.2) + (set! (-> this flee-info speed-adjust-center) 40960.0) + (set! (-> this flee-info speed-adjust-range) 20480.0) + (set! (-> this flee-info abort-notice-distance) 49152.0) + (set! (-> this flee-info min-notice-dist) 61440.0) + (set! (-> this flee-info max-notice-dist) 143360.0) + (set! (-> this flee-info min-stop-chase-dist) 40960.0) + (set! (-> this flee-info max-stop-chase-dist) 184320.0) + (set! (-> this flee-info max-flee-rotation) 364.0889) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go lightning-mole-gone) ) - ((task-closed? (-> obj entity extra perm task) (task-status need-introduction)) - (go (method-of-object obj nav-enemy-idle)) + ((task-closed? (-> this entity extra perm task) (task-status need-introduction)) + (go (method-of-object this nav-enemy-idle)) ) (else (go lightning-mole-hiding) @@ -1172,7 +1172,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('hide) - (let ((v0-0 (-> *display* base-frame-counter))) + (let ((v0-0 (current-time))) (set! (-> self state-time) v0-0) v0-0 ) @@ -1183,10 +1183,10 @@ (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (not (and *target* (>= 81920.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))))) ) (go peeper-up) @@ -1232,8 +1232,8 @@ ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (let* ((f30-0 2.0) @@ -1241,19 +1241,19 @@ (v1-11 (the-as number (logior #x3f800000 v1-10))) ) (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-11)))) 1)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 5)) (if (nonzero? (-> self sound)) (update! (-> self sound)) ) (spawn (-> self part) (-> self root trans)) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (suspend) ) ) @@ -1295,12 +1295,12 @@ :post ja-post ) -(defmethod init-from-entity! peeper ((obj peeper) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lightning-mole-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 456) obj)) - (set! (-> obj sound) (new 'process 'ambient-sound arg0 (-> obj root trans))) +(defmethod init-from-entity! peeper ((this peeper) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lightning-mole-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 456) this)) + (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root trans))) (go peeper-up) (none) ) diff --git a/goal_src/jak1/levels/rolling/rolling-obs.gc b/goal_src/jak1/levels/rolling/rolling-obs.gc index afa0c254ac..3f74b5492a 100644 --- a/goal_src/jak1/levels/rolling/rolling-obs.gc +++ b/goal_src/jak1/levels/rolling/rolling-obs.gc @@ -127,17 +127,17 @@ :post rider-post ) -(defmethod init-from-entity! pusher ((obj pusher) (arg0 entity-actor)) +(defmethod init-from-entity! pusher ((this pusher) (arg0 entity-actor)) (pusher-base-init) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *pusher-sg* '()) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) - (set! (-> obj max-frame) (res-lump-float arg0 'max-frame :default (the float (ja-num-frames 0)))) - (set! (-> obj cyl origin quad) (-> obj root-override trans quad)) - (vector-x-quaternion! (-> obj cyl axis) (-> obj root-override quat)) - (vector-negate! (-> obj cyl axis) (-> obj cyl axis)) - (set! (-> obj cyl length) 36864.0) - (set! (-> obj cyl radius) 20480.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *pusher-sg* '()) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) + (set! (-> this max-frame) (res-lump-float arg0 'max-frame :default (the float (ja-num-frames 0)))) + (set! (-> this cyl origin quad) (-> this root-override trans quad)) + (vector-x-quaternion! (-> this cyl axis) (-> this root-override quat)) + (vector-negate! (-> this cyl axis) (-> this cyl axis)) + (set! (-> this cyl length) 36864.0) + (set! (-> this cyl radius) 20480.0) (go pusher-idle) (none) ) @@ -156,25 +156,25 @@ :post rider-post ) -(defmethod init-from-entity! gorge-pusher ((obj gorge-pusher) (arg0 entity-actor)) +(defmethod init-from-entity! gorge-pusher ((this gorge-pusher) (arg0 entity-actor)) (pusher-base-init) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *pusher-sg* '()) - (set! (-> obj max-frame) (res-lump-float arg0 'max-frame :default 1.0)) - (set! (-> obj max-frame) (* (-> obj max-frame) (the float (ja-num-frames 0)))) - (set! (-> obj min-frame) (res-lump-float arg0 'min-frame)) - (set! (-> obj min-frame) (* (-> obj min-frame) (the float (ja-num-frames 0)))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *pusher-sg* '()) + (set! (-> this max-frame) (res-lump-float arg0 'max-frame :default 1.0)) + (set! (-> this max-frame) (* (-> this max-frame) (the float (ja-num-frames 0)))) + (set! (-> this min-frame) (res-lump-float arg0 'min-frame)) + (set! (-> this min-frame) (* (-> this min-frame) (the float (ja-num-frames 0)))) (cond ((task-closed? (game-task rolling-race) (task-status need-introduction)) - (let ((v1-6 (-> obj skel root-channel 0))) + (let ((v1-6 (-> this skel root-channel 0))) (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) (-> obj min-frame)) + (set! (-> v1-6 frame-num) (-> this min-frame)) ) ) (else - (let ((v1-10 (-> obj skel root-channel 0))) + (let ((v1-10 (-> this skel root-channel 0))) (set! (-> v1-10 num-func) num-func-identity) - (set! (-> v1-10 frame-num) (-> obj max-frame)) + (set! (-> v1-10 frame-num) (-> this max-frame)) ) ) ) @@ -284,20 +284,20 @@ (v1-5 (the-as number (logior #x3f800000 v1-4))) (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-5)))) 3000)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (when (and (!= (get-task-status (game-task rolling-plants)) (task-status invalid)) (!= (get-task-status (game-task rolling-plants)) 7) ) (cond - ((>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + ((time-elapsed? (-> self state-time) gp-0) (go dark-plant-sprout) ) ((dark-plant-check-target self) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) ((not (dark-plant-has-bad-neighbor self)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (else ) @@ -450,19 +450,19 @@ ) ) -(defmethod init-from-entity! dark-plant ((obj dark-plant) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *dark-plant-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 455) obj)) - (set! (-> obj num-alts) (min 4 (entity-actor-count (-> obj entity) 'alt-actor))) - (dotimes (s5-3 (-> obj num-alts)) - (set! (-> obj alts s5-3) (entity-actor-lookup (-> obj entity) 'alt-actor s5-3)) +(defmethod init-from-entity! dark-plant ((this dark-plant) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *dark-plant-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 455) this)) + (set! (-> this num-alts) (min 4 (entity-actor-count (-> this entity) 'alt-actor))) + (dotimes (s5-3 (-> this num-alts)) + (set! (-> this alts s5-3) (entity-actor-lookup (-> this entity) 'alt-actor s5-3)) ) - (if (zero? (-> obj num-alts)) - (format 0 "ERROR: ~S has no alternates~%" (-> obj name)) + (if (zero? (-> this num-alts)) + (format 0 "ERROR: ~S has no alternates~%" (-> this name)) ) - (dark-plant-randomize obj) + (dark-plant-randomize this) (case (get-task-status (game-task rolling-plants)) (((task-status invalid) (task-status need-resolution)) (go dark-plant-gone) @@ -609,9 +609,9 @@ :post ja-post ) -(defmethod init-from-entity! happy-plant ((obj happy-plant) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! happy-plant ((this happy-plant) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -622,28 +622,28 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *happy-plant-sg* '()) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *happy-plant-sg* '()) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (case (get-task-status (game-task rolling-plants)) (((task-status invalid)) - (let ((v1-19 (-> obj skel root-channel 0))) - (set! (-> v1-19 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((v1-19 (-> this skel root-channel 0))) + (set! (-> v1-19 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) ) (go happy-plant-opened) ) (((task-status need-resolution)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (let ((v1-23 (-> obj skel root-channel 0))) - (set! (-> v1-23 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((v1-23 (-> this skel root-channel 0))) + (set! (-> v1-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) ) - (logior! (-> obj skel status) (janim-status inited)) + (logior! (-> this skel status) (janim-status inited)) (ja-post) - (logclear! (-> obj skel status) (janim-status inited)) - (vector<-cspace! s5-1 (-> obj node-list data 25)) - (birth-pickup-at-point s5-1 (pickup-type fuel-cell) 55.0 #f obj (the-as fact-info #f)) + (logclear! (-> this skel status) (janim-status inited)) + (vector<-cspace! s5-1 (-> this node-list data 25)) + (birth-pickup-at-point s5-1 (pickup-type fuel-cell) 55.0 #f this (the-as fact-info #f)) ) (go happy-plant-opened) ) @@ -1119,8 +1119,8 @@ :code (behavior () (gorge-start-draw-time #t #t) (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (seekl! (-> self timer-pos-offset) 100 (the int (* 3.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) @@ -1141,8 +1141,8 @@ (gorge-trans) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) @@ -1320,18 +1320,18 @@ ) ) -(defmethod init-from-entity! gorge-start ((obj gorge-start) (arg0 entity-actor)) - (set! (-> obj root-override) (the-as collide-shape-moving (new 'process 'trsqv))) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! gorge-start ((this gorge-start) (arg0 entity-actor)) + (set! (-> this root-override) (the-as collide-shape-moving (new 'process 'trsqv))) + (process-drawable-from-entity! this arg0) (let ((a0-3 (new 'stack-no-clear 'vector))) - (set! (-> a0-3 quad) (-> obj root-override trans quad)) + (set! (-> a0-3 quad) (-> this root-override trans quad)) (+! (-> a0-3 y) -8192.0) (gorge-init a0-3 (new 'static 'vector :z 1.0) 102400.0 40960.0) ) - (set! (-> obj tasks) (get-task-control (-> obj entity extra perm task))) - (set! (-> obj start-banner) (the-as handle #f)) - (set! (-> obj end-banner) (the-as handle #f)) - (set! (-> obj timer-pos-offset) 100) + (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) + (set! (-> this start-banner) (the-as handle #f)) + (set! (-> this end-banner) (the-as handle #f)) + (set! (-> this timer-pos-offset) 100) (go gorge-start-idle) (none) ) @@ -1360,18 +1360,18 @@ ) ) -(defmethod water-vol-method-22 rolling-water ((obj rolling-water)) +(defmethod water-vol-method-22 rolling-water ((this rolling-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) (set! (-> v1-2 waveform) (the-as ripple-wave-set ripple-for-rolling-water)) ) - (logclear! (-> obj flags) (water-flags wt23)) + (logclear! (-> this flags) (water-flags wt23)) (none) ) diff --git a/goal_src/jak1/levels/rolling/rolling-race-ring.gc b/goal_src/jak1/levels/rolling/rolling-race-ring.gc index 10f1796d4d..f78fe6f101 100644 --- a/goal_src/jak1/levels/rolling/rolling-race-ring.gc +++ b/goal_src/jak1/levels/rolling/rolling-race-ring.gc @@ -701,7 +701,7 @@ (cond ((handle->process (-> self part-track)) (if (-> self keep-part-track-alive) - (set! (-> (the-as part-tracker (-> self part-track process 0)) start-time) (-> *display* base-frame-counter)) + (set-time! (-> (the-as part-tracker (-> self part-track process 0)) start-time)) ) ) ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) @@ -937,94 +937,96 @@ ) ) -(defmethod init-from-entity! race-ring ((obj race-ring) (arg0 entity-actor)) +(defmethod init-from-entity! race-ring ((this race-ring) (arg0 entity-actor)) (let ((a0-1 arg0)) (if (not (entity-actor-lookup a0-1 'next-actor 0)) - (stack-size-set! (-> obj main-thread) 512) + (stack-size-set! (-> this main-thread) 512) ) ) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *race-ring-sg* '()) - (set! (-> obj root pause-adjust-distance) 122880.0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj part-track) (the-as handle #f)) - (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (logior! (-> obj draw status) (draw-status hidden)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "loop-racering" :fo-max 40) (-> obj root trans)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *race-ring-sg* '()) + (set! (-> this root pause-adjust-distance) 122880.0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this part-track) (the-as handle #f)) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (logior! (-> this draw status) (draw-status hidden)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "loop-racering" :fo-max 40) (-> this root trans)) ) (let ((f0-1 (res-lump-float arg0 'timeout))) - (set! (-> obj timeout) (the-as time-frame (the int (* 300.0 f0-1)))) + (set! (-> this timeout) (the-as time-frame (the int (* 300.0 f0-1)))) ) (let ((s4-0 (new 'stack-no-clear 'vector))) (cond - ((-> obj link next) - (vector-! (-> obj face-vec) (-> obj link next extra trans) (-> obj root trans)) + ((-> this link next) + (vector-! (-> this face-vec) (-> this link next extra trans) (-> this root trans)) ) - ((-> obj link prev) - (vector-! (-> obj face-vec) (-> obj root trans) (-> obj link prev extra trans)) + ((-> this link prev) + (vector-! (-> this face-vec) (-> this root trans) (-> this link prev extra trans)) ) ) - (vector-flatten! (-> obj face-vec) (-> obj face-vec) (new 'static 'vector :y 1.0)) - (vector-normalize! (-> obj face-vec) 1.0) + (vector-flatten! (-> this face-vec) (-> this face-vec) (new 'static 'vector :y 1.0)) + (vector-normalize! (-> this face-vec) 1.0) (cond - ((and (-> obj link next) (-> obj link prev)) - (vector-! s4-0 (-> obj link prev extra trans) (-> obj root trans)) + ((and (-> this link next) (-> this link prev)) + (vector-! s4-0 (-> this link prev extra trans) (-> this root trans)) (vector-flatten! s4-0 s4-0 (new 'static 'vector :y 1.0)) (vector-normalize! s4-0 1.0) - (vector+! s4-0 s4-0 (-> obj face-vec)) + (vector+! s4-0 s4-0 (-> this face-vec)) (vector-normalize! s4-0 1.0) - (set! (-> obj rot-y) (acos (vector-dot s4-0 (new 'static 'vector :z 1.0)))) + (set! (-> this rot-y) (acos (vector-dot s4-0 (new 'static 'vector :z 1.0)))) (if (< (vector-dot s4-0 (new 'static 'vector :x 1.0)) 0.0) - (set! (-> obj rot-y) (- (-> obj rot-y))) + (set! (-> this rot-y) (- (-> this rot-y))) ) ) (else - (set! (-> obj rot-y) (acos (vector-dot (-> obj face-vec) (new 'static 'vector :z 1.0)))) - (if (< (vector-dot (-> obj face-vec) (new 'static 'vector :x 1.0)) 0.0) - (set! (-> obj rot-y) (- (-> obj rot-y))) + (set! (-> this rot-y) (acos (vector-dot (-> this face-vec) (new 'static 'vector :z 1.0)))) + (if (< (vector-dot (-> this face-vec) (new 'static 'vector :x 1.0)) 0.0) + (set! (-> this rot-y) (- (-> this rot-y))) ) - (+! (-> obj rot-y) 16384.0) + (+! (-> this rot-y) 16384.0) ) ) ) - (+! (-> obj rot-y) (res-lump-float arg0 'rotoffset)) - (set-vector! (-> obj cyl axis) (cos (-> obj rot-y)) 0.0 (- (sin (-> obj rot-y))) 1.0) - (vector+float*! (the-as vector (-> obj cyl)) (-> obj root trans) (-> obj cyl axis) -2048.0) - (set! (-> obj cyl radius) 24576.0) - (set! (-> obj cyl length) 4096.0) + (+! (-> this rot-y) (res-lump-float arg0 'rotoffset)) + (set-vector! (-> this cyl axis) (cos (-> this rot-y)) 0.0 (- (sin (-> this rot-y))) 1.0) + (vector+float*! (the-as vector (-> this cyl)) (-> this root trans) (-> this cyl axis) -2048.0) + (set! (-> this cyl radius) 24576.0) + (set! (-> this cyl length) 4096.0) (cond - ((and (first-ring? obj) - (!= (get-task-status (-> obj entity extra perm task)) (task-status invalid)) - (!= (get-task-status (-> obj entity extra perm task)) 7) + ((and (first-ring? this) + (!= (get-task-status (-> this entity extra perm task)) (task-status invalid)) + (!= (get-task-status (-> this entity extra perm task)) 7) ) - (set! (-> obj alt-task) (res-lump-value (-> obj entity) 'alt-task uint)) - (if (or (= (-> obj alt-task) 0) (= (get-task-status (the-as game-task (-> obj alt-task))) (task-status invalid))) + (set! (-> this alt-task) (res-lump-value (-> this entity) 'alt-task uint)) + (if (or (= (-> this alt-task) 0) + (= (get-task-status (the-as game-task (-> this alt-task))) (task-status invalid)) + ) (go race-ring-active) (go race-ring-wait) ) ) - ((and (last-ring? obj) (= (get-task-status (-> obj entity extra perm task)) (task-status need-resolution))) + ((and (last-ring? this) (= (get-task-status (-> this entity extra perm task)) (task-status need-resolution))) (let ((s5-2 (new 'stack-no-clear 'vector))) - (logclear! (-> obj draw status) (draw-status hidden)) + (logclear! (-> this draw status) (draw-status hidden)) (ja-post) - (vector<-cspace! s5-2 (-> obj node-list data 5)) - (logior! (-> obj draw status) (draw-status hidden)) + (vector<-cspace! s5-2 (-> this node-list data 5)) + (logior! (-> this draw status) (draw-status hidden)) (birth-pickup-at-point s5-2 (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) + (the float (-> this entity extra perm task)) #f - obj + this (the-as fact-info #f) ) ) ) - ((and (last-ring? obj) (!= (get-task-status (-> obj entity extra perm task)) (task-status invalid))) + ((and (last-ring? this) (!= (get-task-status (-> this entity extra perm task)) (task-status invalid))) ) ) - (set! (-> obj event-hook) (-> race-ring-idle event)) + (set! (-> this event-hook) (-> race-ring-idle event)) (go race-ring-idle) (none) ) diff --git a/goal_src/jak1/levels/rolling/rolling-robber.gc b/goal_src/jak1/levels/rolling/rolling-robber.gc index 27770bc8d7..3259a49ff0 100644 --- a/goal_src/jak1/levels/rolling/rolling-robber.gc +++ b/goal_src/jak1/levels/rolling/rolling-robber.gc @@ -21,7 +21,7 @@ (set! (-> *camera-other-fov* data) 11650.845) (set! (-> *camera-other-trans* quad) (-> *math-camera* trans quad)) (set! (-> *camera-other-root* quad) (-> *math-camera* trans quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (*! arg2 (- 1.0 (* 0.05 (-> *display* time-adjust-ratio)))) ;; og:preserve-this changed for high fps (when (and (< (fabs arg2) 13.653334) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.5))) @@ -30,7 +30,7 @@ ) (go-virtual wait) ) - (set! arg1 (+ arg1 (/ (* arg2 (-> *display* seconds-per-frame)) (path-distance (-> self path))))) + (set! arg1 (+ arg1 (/ (* arg2 (seconds-per-frame)) (path-distance (-> self path))))) (cond ((< 1.0 arg1) (set! arg1 (+ -1.0 arg1)) @@ -212,9 +212,7 @@ (defbehavior robber-move robber () (+! (-> self curve-position) - (/ (the float - (* (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) (the int (-> self speed))) - ) + (/ (the float (* (- (current-time) (-> *display* old-base-frame-counter)) (the int (-> self speed)))) (path-distance (-> self path)) ) ) @@ -451,7 +449,7 @@ (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (when (>= (- (-> *display* base-frame-counter) (-> self last-ambient-time)) (-> self time-to-next-ambient)) + (when (time-elapsed? (-> self last-ambient-time) (-> self time-to-next-ambient)) (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -461,7 +459,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self last-ambient-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-ambient-time)) (let* ((f30-0 300.0) (f28-0 2.0) (f26-0 2.0) @@ -482,7 +480,7 @@ :event robber-event-handler :enter (behavior () (set! (-> self near-timer) 3000) - (set! (-> self far-time) (-> *display* base-frame-counter)) + (set-time! (-> self far-time)) (set! (-> self y-offset-desired) 0.0) ) :trans (behavior () @@ -495,16 +493,15 @@ (when (and *target* (>= 102400.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) - (set! (-> self near-timer) (- (the-as time-frame (-> self near-timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) + (set! (-> self near-timer) + (- (the-as time-frame (-> self near-timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) (if (<= (-> self near-timer) 0) (go robber-tired) ) - (set! (-> self far-time) (-> *display* base-frame-counter)) + (set-time! (-> self far-time)) ) - (if (>= (- (-> *display* base-frame-counter) (-> self far-time)) (seconds 3)) + (if (time-elapsed? (-> self far-time) (seconds 3)) (set! (-> self near-timer) (the-as int (-> self timeout))) ) ) @@ -519,7 +516,7 @@ (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (when (>= (- (-> *display* base-frame-counter) (-> self last-ambient-time)) (-> self time-to-next-ambient)) + (when (time-elapsed? (-> self last-ambient-time) (-> self time-to-next-ambient)) (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -529,7 +526,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self last-ambient-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-ambient-time)) (let* ((f30-0 300.0) (f28-0 3.0) (f26-0 5.0) @@ -641,8 +638,8 @@ :post transform-post ) -(defmethod init-from-entity! robber ((obj robber) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! robber ((this robber) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -659,43 +656,43 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *robber-sg* '()) - (set! (-> obj root-override pause-adjust-distance) 122880.0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *robber-sg* '()) + (set! (-> this root-override pause-adjust-distance) 122880.0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj curve-position) (res-lump-float (-> obj entity) 'initial-spline-pos)) - (eval-path-curve! (-> obj path) (-> obj root-override trans) (-> obj curve-position) 'interp) - (path-control-method-14 (-> obj path) (-> obj tangent) (-> obj curve-position)) - (set! (-> obj facing quad) (-> obj tangent quad)) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (set! (-> this curve-position) (res-lump-float (-> this entity) 'initial-spline-pos)) + (eval-path-curve! (-> this path) (-> this root-override trans) (-> this curve-position) 'interp) + (path-control-method-14 (-> this path) (-> this tangent) (-> this curve-position)) + (set! (-> this facing quad) (-> this tangent quad)) (let ((s4-1 (new 'stack-no-clear 'matrix))) - (forward-down->inv-matrix s4-1 (-> obj facing) (new 'static 'vector :y -1.0)) - (matrix->quaternion (-> obj root-override quat) s4-1) + (forward-down->inv-matrix s4-1 (-> this facing) (new 'static 'vector :y -1.0)) + (matrix->quaternion (-> this root-override quat) s4-1) ) - (set! (-> obj y-vel) 0.0) - (set! (-> obj water-height) (res-lump-float (-> obj entity) 'water-height)) + (set! (-> this y-vel) 0.0) + (set! (-> this water-height) (res-lump-float (-> this entity) 'water-height)) (robber-find-ground) - (set! (-> obj y-offset) (-> obj y-offset-desired)) + (set! (-> this y-offset) (-> this y-offset-desired)) (let ((f0-14 (res-lump-float arg0 'timeout :default 10.0))) - (set! (-> obj timeout) (the-as time-frame (the int (* 300.0 f0-14)))) + (set! (-> this timeout) (the-as time-frame (the int (* 300.0 f0-14)))) ) - (set! (-> obj last-ambient-time) 0) - (set! (-> obj time-to-next-ambient) 0) - (set! (-> obj speed) 0.0) - (let ((v1-42 (-> obj entity extra perm))) + (set! (-> this last-ambient-time) 0) + (set! (-> this time-to-next-ambient) 0) + (set! (-> this speed) 0.0) + (let ((v1-42 (-> this entity extra perm))) (logior! (-> v1-42 status) (entity-perm-status user-set-from-cstage)) (if (nonzero? (-> v1-42 user-object 1)) (go robber-die) ) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go robber-dead) (go robber-initial) ) diff --git a/goal_src/jak1/levels/snow/ice-cube.gc b/goal_src/jak1/levels/snow/ice-cube.gc index 3318ec0ae7..82b27c87ed 100644 --- a/goal_src/jak1/levels/snow/ice-cube.gc +++ b/goal_src/jak1/levels/snow/ice-cube.gc @@ -462,8 +462,8 @@ ) ) -(defmethod initialize-collision ice-cube ((obj ice-cube)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision ice-cube ((this ice-cube)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -519,20 +519,20 @@ (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) - (set! (-> obj cprims-type) (the-as uint 0)) - (set-root-prim-collide-with! (-> obj collide-info) (collide-kind target)) - (set! (-> obj collide-info event-self) 'touched) - (nav-enemy-method-57 obj) + (set! (-> this cprims-type) (the-as uint 0)) + (set-root-prim-collide-with! (-> this collide-info) (collide-kind target)) + (set! (-> this collide-info event-self) 'touched) + (nav-enemy-method-57 this) 0 (none) ) -(defmethod nav-enemy-method-57 ice-cube ((obj ice-cube)) - (when (!= (-> obj cprims-type) 1) - (set! (-> obj cprims-type) (the-as uint 1)) - (let ((v1-3 (-> obj collide-info root-prim))) +(defmethod nav-enemy-method-57 ice-cube ((this ice-cube)) + (when (!= (-> this cprims-type) 1) + (set! (-> this cprims-type) (the-as uint 1)) + (let ((v1-3 (-> this collide-info root-prim))) (set-vector! (-> v1-3 local-sphere) 0.0 12288.0 0.0 14745.6) (set-vector! (-> (the-as collide-shape-prim-group v1-3) prims 3 local-sphere) 819.2 0.0 0.0 2048.0) (set-vector! (-> (the-as collide-shape-prim-group v1-3) prims 4 local-sphere) 0.0 2048.0 0.0 4505.6) @@ -541,10 +541,10 @@ (none) ) -(defmethod nav-enemy-method-58 ice-cube ((obj ice-cube)) - (when (!= (-> obj cprims-type) 2) - (set! (-> obj cprims-type) (the-as uint 2)) - (let ((v1-3 (-> obj collide-info root-prim))) +(defmethod nav-enemy-method-58 ice-cube ((this ice-cube)) + (when (!= (-> this cprims-type) 2) + (set! (-> this cprims-type) (the-as uint 2)) + (let ((v1-3 (-> this collide-info root-prim))) (set-vector! (-> v1-3 local-sphere) 0.0 12288.0 0.0 16384.0) (set-vector! (-> (the-as collide-shape-prim-group v1-3) prims 3 local-sphere) 819.2 0.0 0.0 4915.2) (set-vector! (-> (the-as collide-shape-prim-group v1-3) prims 4 local-sphere) 0.0 2048.0 0.0 9420.8) @@ -553,59 +553,59 @@ (none) ) -(defmethod nav-enemy-method-48 ice-cube ((obj ice-cube)) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-skeleton obj *ice-cube-sg* '()) - (init-defaults! obj *ice-cube-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 ice-cube ((this ice-cube)) + (process-drawable-from-entity! this (-> this entity)) + (initialize-skeleton this *ice-cube-sg* '()) + (init-defaults! this *ice-cube-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) -(defmethod deactivate ice-cube ((obj ice-cube)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate ice-cube ((this ice-cube)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj part3)) - (kill-and-free-particles (-> obj part3)) + (if (nonzero? (-> this part3)) + (kill-and-free-particles (-> this part3)) ) - (if (nonzero? (-> obj part4)) - (kill-and-free-particles (-> obj part4)) + (if (nonzero? (-> this part4)) + (kill-and-free-particles (-> this part4)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod relocate ice-cube ((obj ice-cube) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate ice-cube ((this ice-cube) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj part3)) - (&+! (-> obj part3) arg0) + (if (nonzero? (-> this part3)) + (&+! (-> this part3) arg0) ) - (if (nonzero? (-> obj part4)) - (&+! (-> obj part4) arg0) + (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)) obj arg0)) + (the-as ice-cube ((the-as (function nav-enemy int nav-enemy) (find-parent-method ice-cube 7)) this arg0)) ) -(defmethod init-from-entity! ice-cube ((obj ice-cube) (arg0 entity-actor)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 507) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 508) obj)) - (set! (-> obj part3) (create-launch-control (-> *part-group-id-table* 509) obj)) - (set! (-> obj part4) (create-launch-control (-> *part-group-id-table* 567) obj)) - (initialize-collision obj) - (nav-enemy-method-48 obj) - (let ((s4-0 (-> obj path curve num-cverts))) +(defmethod init-from-entity! ice-cube ((this ice-cube) (arg0 entity-actor)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 507) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 508) this)) + (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 509) this)) + (set! (-> this part4) (create-launch-control (-> *part-group-id-table* 567) this)) + (initialize-collision this) + (nav-enemy-method-48 this) + (let ((s4-0 (-> this path curve num-cverts))) (if (<= s4-0 0) (go process-drawable-art-error "no path") ) (let ((v1-21 (res-lump-value arg0 'mode uint128 :default (the-as uint128 -1)))) (if (and (>= (the-as int v1-21) 0) (< (the-as int v1-21) s4-0)) - (set! (-> obj force-spawn-pt) (the-as int v1-21)) - (set! (-> obj force-spawn-pt) -1) + (set! (-> this force-spawn-pt) (the-as int v1-21)) + (set! (-> this force-spawn-pt) -1) ) ) ) @@ -613,16 +613,16 @@ (none) ) -(defmethod nav-enemy-method-60 ice-cube ((obj ice-cube) (arg0 symbol)) +(defmethod nav-enemy-method-60 ice-cube ((this ice-cube) (arg0 symbol)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (when (-> obj tracking-player?) + (when (-> this tracking-player?) (if (and *target* arg0) - (set! (-> obj target-pt quad) (-> (target-pos 0) quad)) + (set! (-> this target-pt quad) (-> (target-pos 0) quad)) ) ) - (vector-! gp-0 (-> obj target-pt) (-> obj collide-info trans)) - (seek-toward-heading-vec! (-> obj collide-info) gp-0 524288.0 (seconds 0.1)) - (let ((v0-5 (< (fabs (deg- (quaternion-y-angle (-> obj collide-info quat)) (vector-y-angle gp-0))) 364.0889))) + (vector-! gp-0 (-> this target-pt) (-> this collide-info trans)) + (seek-toward-heading-vec! (-> this collide-info) gp-0 524288.0 (seconds 0.1)) + (let ((v0-5 (< (fabs (deg- (quaternion-y-angle (-> this collide-info quat)) (vector-y-angle gp-0))) 364.0889))) (b! #t cfg-10 :delay (nop!)) (the-as none 0) (set! v0-5 (the-as symbol #f)) @@ -632,7 +632,7 @@ ) ) -(defmethod ice-cube-method-51 ice-cube ((obj ice-cube) (arg0 vector) (arg1 vector)) +(defmethod ice-cube-method-51 ice-cube ((this ice-cube) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let* ((s4-0 (new 'stack-no-clear 'collide-tri-result)) (f0-0 40960.0) @@ -645,13 +645,14 @@ s5-0 f30-0 (collide-kind background) - (-> obj collide-info process) + (-> this collide-info process) s4-0 (new 'static 'pat-surface :noentity #x1) ) ) ) - (if (or (< f0-2 0.0) (= (logand #b111000 (the-as int (-> s4-0 pat))) 8)) ;; yes this is bugged + ;; og:preserve-this yes this is bugged + (if (or (< f0-2 0.0) (= (logand #b111000 (the-as int (-> s4-0 pat))) 8)) (return #f) ) (set! (-> s5-0 y) (- (-> s5-0 y) (* f0-2 f30-0))) @@ -662,13 +663,13 @@ #t ) -(defmethod nav-enemy-method-52 ice-cube ((obj ice-cube) (arg0 vector)) +(defmethod nav-enemy-method-52 ice-cube ((this ice-cube) (arg0 vector)) (when *target* (let ((f0-0 (vector-vector-xz-distance arg0 (target-pos 0)))) - (when (and (>= f0-0 40960.0) (>= 81920.0 f0-0) (not (nav-enemy-method-50 obj arg0))) + (when (and (>= f0-0 40960.0) (>= 81920.0 f0-0) (not (nav-enemy-method-50 this arg0))) (let ((a0-4 (new 'stack-no-clear 'vector))) (set! (-> a0-4 quad) (-> arg0 quad)) - (set! (-> a0-4 w) (-> obj collide-info root-prim local-sphere w)) + (set! (-> a0-4 w) (-> this collide-info root-prim local-sphere w)) (if (sphere-in-view-frustum? (the-as sphere a0-4)) (return #t) ) @@ -679,15 +680,15 @@ #f ) -(defmethod ice-cube-method-53 ice-cube ((obj ice-cube) (arg0 vector) (arg1 vector)) +(defmethod ice-cube-method-53 ice-cube ((this ice-cube) (arg0 vector) (arg1 vector)) (local-vars (s1-0 int) (s2-0 int)) - (let ((s3-0 (-> obj path curve num-cverts))) + (let ((s3-0 (-> this path curve num-cverts))) (if (<= s3-0 0) (return #f) ) (cond - ((>= (-> obj force-spawn-pt) 0) - (set! s1-0 (-> obj force-spawn-pt)) + ((>= (-> this force-spawn-pt) 0) + (set! s1-0 (-> this force-spawn-pt)) (set! s2-0 1) ) (else @@ -696,8 +697,8 @@ ) ) (while (> s2-0 0) - (eval-path-curve-div! (-> obj path) arg0 (the float s1-0) 'interp) - (when (nav-enemy-method-52 obj arg0) + (eval-path-curve-div! (-> this path) arg0 (the float s1-0) 'interp) + (when (nav-enemy-method-52 this arg0) (let ((a1-3 (new 'stack-no-clear 'vector)) (s3-1 (new 'stack-no-clear 'collide-tri-result)) ) @@ -709,7 +710,7 @@ (new 'static 'vector :y -32768.0 :w 1.0) 409.6 (collide-kind background) - obj + this s3-1 (new 'static 'pat-surface :noentity #x1) ) @@ -885,7 +886,7 @@ (defstate ice-cube-face-player (ice-cube) :event ice-cube-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-method-57 self) (logclear! (-> self mask) (process-mask actor-pause)) @@ -921,7 +922,7 @@ (set! (-> self collide-info transv y) f30-0) ) ) - (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) (let* ((v1-26 (>= 0.0 (-> self collide-info transv y))) (v1-27 (and v1-26 (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)))) ) @@ -950,7 +951,7 @@ #f #f ) - (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) (set! gp-0 (nav-enemy-method-60 self (not s5-0))) ) (suspend) @@ -997,16 +998,16 @@ :post nav-enemy-simple-post ) -(defmethod nav-enemy-method-54 ice-cube ((obj ice-cube) (arg0 vector)) - (let* ((s4-0 (-> obj path curve num-cverts)) +(defmethod nav-enemy-method-54 ice-cube ((this ice-cube) (arg0 vector)) + (let* ((s4-0 (-> this path curve num-cverts)) (s2-0 (nav-enemy-rnd-int-count s4-0)) (s5-0 (new 'stack-no-clear 'vector)) ) (dotimes (s3-0 s4-0) - (eval-path-curve-div! (-> obj path) s5-0 (the float s2-0) 'interp) - (when (>= (vector-vector-xz-distance s5-0 (-> obj collide-info trans)) 32768.0) - (when (ice-cube-method-51 obj s5-0 s5-0) - (set! (-> obj target-pt quad) (-> s5-0 quad)) + (eval-path-curve-div! (-> this path) s5-0 (the float s2-0) 'interp) + (when (>= (vector-vector-xz-distance s5-0 (-> this collide-info trans)) 32768.0) + (when (ice-cube-method-51 this s5-0 s5-0) + (set! (-> this target-pt quad) (-> s5-0 quad)) (return #t) ) ) @@ -1019,7 +1020,7 @@ (defstate ice-cube-mean-turn-to-charge (ice-cube) :event ice-cube-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-method-58 self) (if (or (not *target*) @@ -1054,7 +1055,7 @@ (set! (-> self collide-info transv y) f30-0) ) ) - (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) (let* ((v1-26 (>= 0.0 (-> self collide-info transv y))) (v1-27 (and v1-26 (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)))) ) @@ -1083,7 +1084,7 @@ #f #f ) - (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) (set! gp-0 (nav-enemy-method-60 self (not s5-0))) ) (suspend) @@ -1108,10 +1109,10 @@ (defstate ice-cube-mean-charge (ice-cube) :event ice-cube-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (nav-enemy-method-58 self) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (set! (-> self next-skid-sound-time) (-> *display* base-frame-counter)) + (set-time! (-> self next-skid-sound-time)) (if (or (not *target*) (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -1174,7 +1175,7 @@ ) (cond ((-> self track-target?) - (let ((f26-0 (deg-seek-smooth (-> self charge-angle) f0-5 (* 2730.6667 (-> *display* seconds-per-frame)) 0.25))) + (let ((f26-0 (deg-seek-smooth (-> self charge-angle) f0-5 (* 2730.6667 (seconds-per-frame)) 0.25))) (set! (-> self prev-charge-angle-diff) (deg- f26-0 (-> self charge-angle))) (set! (-> self charge-angle) f26-0) ) @@ -1196,9 +1197,7 @@ ) (set! (-> self nav travel y) 0.0) (when (-> self slow-down?) - (set! (-> self speed) - (seek-with-smooth (-> self speed) 0.0 (* 81920.0 (-> *display* seconds-per-frame)) 0.8 1638.4) - ) + (set! (-> self speed) (seek-with-smooth (-> self speed) 0.0 (* 81920.0 (seconds-per-frame)) 0.8 1638.4)) (if (>= 0.0 (-> self speed)) (go ice-cube-mean-charge-done) ) @@ -1210,8 +1209,8 @@ (spawn (-> self part4) gp-3) ) ) - (when (>= (-> *display* base-frame-counter) (-> self next-skid-sound-time)) - (set! (-> self next-skid-sound-time) (+ (-> *display* base-frame-counter) (nav-enemy-rnd-int-range 60 120))) + (when (>= (current-time) (-> self next-skid-sound-time)) + (set! (-> self next-skid-sound-time) (+ (current-time) (nav-enemy-rnd-int-range 60 120))) (sound-play "ice-stop" :vol (the float (the int (* 0.0012207031 (-> self speed))))) ) ) @@ -1231,7 +1230,7 @@ (-> self collide-info quat) (-> self collide-info quat) (the-as quaternion (-> self collide-info transv)) - (* 16384.0 (-> *display* seconds-per-frame)) + (* 16384.0 (seconds-per-frame)) ) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) @@ -1296,10 +1295,10 @@ (defstate ice-cube-tired (ice-cube) :event ice-cube-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (when (time-elapsed? (-> self state-time) (seconds 2)) (cond ((or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) diff --git a/goal_src/jak1/levels/snow/snow-ball.gc b/goal_src/jak1/levels/snow/snow-ball.gc index 8ae5cd4d70..120f71801c 100644 --- a/goal_src/jak1/levels/snow/snow-ball.gc +++ b/goal_src/jak1/levels/snow/snow-ball.gc @@ -151,42 +151,42 @@ (none) ) -(defmethod follow-path snow-ball-roller ((obj snow-ball-roller)) - (let ((s5-0 (-> obj path-info))) +(defmethod follow-path snow-ball-roller ((this snow-ball-roller)) + (let ((s5-0 (-> this path-info))) (set! (-> s5-0 hug-path?) #f) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> s5-0 path-pos quad)) - (eval-path-curve! (-> obj path) (-> s5-0 path-pos) (-> obj path-u) 'interp) - (let ((f0-1 (-> obj path-coming-out-u))) - (when (< (-> obj path-u) f0-1) - (+! (-> s5-0 path-pos y) (- -20480.0 (* -20480.0 (/ (-> obj path-u) f0-1)))) + (eval-path-curve! (-> this path) (-> s5-0 path-pos) (-> this path-u) 'interp) + (let ((f0-1 (-> this path-coming-out-u))) + (when (< (-> this path-u) f0-1) + (+! (-> s5-0 path-pos y) (- -20480.0 (* -20480.0 (/ (-> this path-u) f0-1)))) (set! (-> s5-0 hug-path?) #t) ) ) - (let ((f0-6 (-> obj path-faded-up-u))) + (let ((f0-6 (-> this path-faded-up-u))) (cond - ((< (-> obj path-u) f0-6) - (let* ((f0-7 (/ (-> obj path-u) f0-6)) + ((< (-> this path-u) f0-6) + (let* ((f0-7 (/ (-> this path-u) f0-6)) (f0-8 (* f0-7 f0-7)) ) - (set-vector! (-> obj draw color-mult) f0-8 f0-8 f0-8 1.0) + (set-vector! (-> this draw color-mult) f0-8 f0-8 f0-8 1.0) ) ) (else - (vector-identity! (-> obj draw color-mult)) + (vector-identity! (-> this draw color-mult)) ) ) ) (cond - ((>= (-> obj path-u) (-> obj path-fall-u)) + ((>= (-> this path-u) (-> this path-fall-u)) (set! (-> s5-0 path-pos y) -409600.0) - (set! (-> s5-0 path-pos x) (+ (-> s4-0 x) (-> obj root-override transv x))) - (set! (-> s5-0 path-pos z) (+ (-> s4-0 z) (-> obj root-override transv z))) - (set! (-> obj rolling-sound-enabled?) #f) + (set! (-> s5-0 path-pos x) (+ (-> s4-0 x) (-> this root-override transv x))) + (set! (-> s5-0 path-pos z) (+ (-> s4-0 z) (-> this root-override transv z))) + (set! (-> this rolling-sound-enabled?) #f) ) (else - (set! (-> obj root-override transv x) (- (-> s5-0 path-pos x) (-> s4-0 x))) - (set! (-> obj root-override transv z) (- (-> s5-0 path-pos z) (-> s4-0 z))) + (set! (-> this root-override transv x) (- (-> s5-0 path-pos x) (-> s4-0 x))) + (set! (-> this root-override transv z) (- (-> s5-0 path-pos z) (-> s4-0 z))) ) ) ) @@ -194,7 +194,7 @@ (none) ) -(defmethod play-landing-sound snow-ball-roller ((obj snow-ball-roller) (arg0 float)) +(defmethod play-landing-sound snow-ball-roller ((this snow-ball-roller) (arg0 float)) (let ((f30-0 (* 0.0018780049 (fmin 53248.0 (fmax 0.0 (+ -4096.0 (fabs arg0))))))) (sound-play "snowball-land" :vol f30-0) ) @@ -203,8 +203,8 @@ (defbehavior snow-ball-roller-path-update snow-ball-roller () (local-vars (f0-5 float)) (let ((f0-0 (-> self root-override trans y))) - (+! (-> self root-override transv y) (* -491520.0 (-> *display* seconds-per-frame))) - (let ((f30-0 (+ f0-0 (* (-> self root-override transv y) (-> *display* seconds-per-frame))))) + (+! (-> self root-override transv y) (* -491520.0 (seconds-per-frame))) + (let ((f30-0 (+ f0-0 (* (-> self root-override transv y) (seconds-per-frame))))) (follow-path self) (let ((a1-0 (new 'stack-no-clear 'vector))) (let ((a0-1 (-> self path-info))) @@ -234,12 +234,12 @@ ) ) (when (< (-> self path-u) (-> self path-fall-u)) - (when (>= (- (-> *display* base-frame-counter) (-> self last-bounce-time)) (-> self delay-til-bounce)) + (when (time-elapsed? (-> self last-bounce-time) (-> self delay-til-bounce)) (let ((f0-13 (rand-vu-float-range 8192.0 20480.0))) (+! (-> self root-override transv y) f0-13) (play-landing-sound self f0-13) ) - (set! (-> self last-bounce-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-bounce-time)) (set! (-> self delay-til-bounce) (rand-vu-int-range 300 2100)) ) ) @@ -262,7 +262,7 @@ (matrix->quaternion (-> self root-override quat) gp-0) ) ) - (+! (-> self path-u) (* (-> self path-speed) (-> *display* seconds-per-frame))) + (+! (-> self path-u) (* (-> self path-speed) (seconds-per-frame))) (if (< 1.0 (-> self path-u)) (set! (-> self path-u) 1.0) ) @@ -308,27 +308,27 @@ (none) ) -(defmethod snow-ball-roller-method-22 snow-ball-roller ((obj snow-ball-roller) (arg0 process-drawable)) +(defmethod snow-ball-roller-method-22 snow-ball-roller ((this snow-ball-roller) (arg0 process-drawable)) (cond - ((< (+ 4096.0 (-> arg0 root trans y)) (-> obj root-override trans y)) + ((< (+ 4096.0 (-> arg0 root trans y)) (-> this root-override trans y)) (let ((f0-2 81920.0)) - (+! (-> obj root-override transv y) f0-2) - (play-landing-sound obj f0-2) + (+! (-> this root-override transv y) f0-2) + (play-landing-sound this f0-2) ) ) (else (let ((f0-3 24576.0)) - (+! (-> obj root-override transv y) f0-3) - (play-landing-sound obj f0-3) + (+! (-> this root-override transv y) f0-3) + (play-landing-sound this f0-3) ) ) ) (let ((s4-0 (new 'stack-no-clear 'vector))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> arg0 root trans) (-> obj root-override trans)) + (vector-! s4-0 (-> arg0 root trans) (-> this root-override trans)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (path-control-method-14 (-> obj path) s3-0 (-> obj path-u)) + (path-control-method-14 (-> this path) s3-0 (-> this path-u)) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (let* ((f28-0 (atan (-> s4-0 x) (-> s4-0 z))) @@ -349,7 +349,7 @@ ) ) (vector-normalize! s4-0 25600.0) - (vector+! s4-0 s4-0 (-> obj root-override trans)) + (vector+! s4-0 s4-0 (-> this root-override trans)) (vector-! s4-0 s4-0 (-> arg0 root trans)) (set! (-> s4-0 y) 0.0) (let ((f30-2 (vector-length s4-0))) @@ -366,8 +366,8 @@ (('touch 'attack) (when (= (-> proc type) target) (do-push-aways! (-> self root-override)) - (when (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.5)) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self hit-player-time) (seconds 0.5)) + (set-time! (-> self hit-player-time)) (snow-ball-roller-method-22 self *target*) ) ) @@ -375,7 +375,7 @@ ) ) :enter (behavior () - (set! (-> self last-bounce-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-bounce-time)) (snow-ball-roller-path-init) ) :exit (behavior () @@ -452,15 +452,15 @@ (none) ) -(defmethod snow-ball-method-14 snow-ball ((obj snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 float) (arg2 int)) +(defmethod snow-ball-method-14 snow-ball ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 float) (arg2 int)) (local-vars (v1-0 (pointer float))) (if (zero? arg2) (set! v1-0 (new 'static 'array float 8 0.3309 0.36 0.4691 0.5061 0.6904 0.7264 0.864 0.8667)) (set! v1-0 (new 'static 'array float 8 0.3344 0.3528 0.4919 0.5246 0.6967 0.7272 0.8677 0.9105)) ) - (let ((a0-4 (* arg1 (-> *display* seconds-per-frame))) + (let ((a0-4 (* arg1 (seconds-per-frame))) (a1-1 (-> arg0 0)) - (a2-2 (-> *display* base-frame-counter)) + (a2-2 (current-time)) ) (dotimes (a3-1 4) (set! (-> a1-1 enter-time) (+ a2-2 (the int (/ (-> v1-0 0) a0-4)))) @@ -472,9 +472,9 @@ #f ) -(defmethod snow-ball-method-15 snow-ball ((obj snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 int)) +(defmethod snow-ball-method-15 snow-ball ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 int)) (local-vars (v0-0 symbol)) - (let ((v1-0 (-> obj child-override))) + (let ((v1-0 (-> this child-override))) (while v1-0 (let ((a0-1 (-> arg0 0)) (a3-1 (-> v1-0 0 junctions)) @@ -502,10 +502,10 @@ (defstate snow-ball-idle (snow-ball) :code (behavior () (local-vars (gp-0 int)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self delay-til-next) 0) (label cfg-1) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay-til-next)) + (when (time-elapsed? (-> self state-time) (-> self delay-til-next)) (set! gp-0 (cond ((>= (-> self same-path-picked-count) 2) (if (zero? (-> self last-path-picked)) @@ -527,7 +527,7 @@ (snow-ball-method-14 self s5-0 s3-0 gp-0) (when (snow-ball-method-15 self s5-0 gp-0) (process-spawn snow-ball-roller (-> self entity) self s3-0 gp-0 s5-0 :to self) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self delay-til-next) (rand-vu-int-range 450 1650)) (cond ((= gp-0 (-> self last-path-picked)) @@ -554,26 +554,26 @@ ) ) -(defmethod relocate snow-ball ((obj snow-ball) (arg0 int)) +(defmethod relocate snow-ball ((this snow-ball) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj path v1-0)) - (&+! (-> obj path v1-0) arg0) + (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 obj) + (the-as process-drawable this) arg0 ) ) ) -(defmethod init-from-entity! snow-ball ((obj snow-ball) (arg0 entity-actor)) - (set! (-> obj last-path-picked) 1) - (set! (-> obj same-path-picked-count) 1) +(defmethod init-from-entity! snow-ball ((this snow-ball) (arg0 entity-actor)) + (set! (-> this last-path-picked) 1) + (set! (-> this same-path-picked-count) 1) (dotimes (s5-0 2) - (set! (-> obj path s5-0) (new 'process 'curve-control obj 'path (the float (+ s5-0 1)))) + (set! (-> this path s5-0) (new 'process 'curve-control this 'path (the float (+ s5-0 1)))) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (go snow-ball-idle) (none) ) diff --git a/goal_src/jak1/levels/snow/snow-bumper.gc b/goal_src/jak1/levels/snow/snow-bumper.gc index 999f271666..995a473cc6 100644 --- a/goal_src/jak1/levels/snow/snow-bumper.gc +++ b/goal_src/jak1/levels/snow/snow-bumper.gc @@ -99,14 +99,14 @@ ) ) -(defmethod shove-player snow-bumper ((obj snow-bumper) (arg0 process-drawable)) +(defmethod shove-player snow-bumper ((this snow-bumper) (arg0 process-drawable)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> arg0 root trans) (-> obj root trans)) + (vector-! s5-0 (-> arg0 root trans) (-> this root trans)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) (let* ((f0-3 (atan (-> s5-0 x) (-> s5-0 z))) - (f30-0 (-> obj base-shove-ry)) - (f28-0 (-> obj max-shove-diff-ry)) + (f30-0 (-> this base-shove-ry)) + (f28-0 (-> this max-shove-diff-ry)) (f0-4 (deg- f0-3 f30-0)) ) (when (< f28-0 (fabs f0-4)) @@ -123,16 +123,16 @@ (let ((f0-12 (+ -16384.0 (atan (-> s5-0 x) (-> s5-0 z))))) (set! (-> *part-id-table* 1895 init-specs 17 initial-valuef) (+ -4096.0 f0-12)) ) - (spawn (-> obj part2) (-> obj root trans)) + (spawn (-> this part2) (-> this root trans)) (let ((s3-1 (new 'stack-no-clear 'vector))) (vector-normalize-copy! s3-1 s5-0 32768.0) - (vector+! s3-1 s3-1 (-> obj root trans)) + (vector+! s3-1 s3-1 (-> this root trans)) (vector-! s5-0 s3-1 (-> arg0 root trans)) ) (let ((f30-3 (vector-xz-length s5-0))) (vector-normalize! s5-0 1.0) (if (send-event *target* 'shove #f (static-attack-info ((vector s5-0) (shove-up (meters 1)) (shove-back f30-3)))) - (set! (-> obj last-shoved-player-time) (-> *display* base-frame-counter)) + (set-time! (-> this last-shoved-player-time)) ) ) ) @@ -187,7 +187,7 @@ (if (< 368640.0 f30-0) (go snow-bumper-active-far-idle) ) - (if (and (>= (- (-> *display* base-frame-counter) (-> self last-shoved-player-time)) (seconds 0.5)) + (if (and (time-elapsed? (-> self last-shoved-player-time) (seconds 0.5)) (>= 20480.0 f30-0) (>= f28-0 -4096.0) (>= 11059.2 f28-0) @@ -231,8 +231,8 @@ (ja :num! (seek! max 0.05)) ) (stop! (-> self sound)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) (ja-no-eval :group! snow-bumper-collapse-ja :num! (seek! max 0.02) :frame-num 0.0) @@ -287,28 +287,28 @@ ) ) -(defmethod deactivate snow-bumper ((obj snow-bumper)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate snow-bumper ((this snow-bumper)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod relocate snow-bumper ((obj snow-bumper) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method snow-bumper 7)) this arg0) ) ) -(defmethod init-from-entity! snow-bumper ((obj snow-bumper) (arg0 entity-actor)) +(defmethod init-from-entity! snow-bumper ((this snow-bumper) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj last-shoved-player-time) 0) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> this last-shoved-player-time) 0) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -341,41 +341,41 @@ ) (set! (-> s4-0 nav-radius) 20480.0) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-bumper-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 519) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 520) obj)) - (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj bumper-id) (+ (actor-count-before (-> obj link)) 1)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "snow-bumper" :fo-max 40) (-> obj root trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-bumper-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 519) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 520) this)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this bumper-id) (+ (actor-count-before (-> this link)) 1)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "snow-bumper" :fo-max 40) (-> this root trans)) ) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> obj base-shove-ry) 0.0) - (set! (-> obj max-shove-diff-ry) 32768.0) + (set! (-> this base-shove-ry) 0.0) + (set! (-> this max-shove-diff-ry) 32768.0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-52 (res-lump-data (-> obj entity) 'rotmin (pointer float) :tag-ptr (& sv-16)))) + (let ((v1-52 (res-lump-data (-> this entity) 'rotmin (pointer float) :tag-ptr (& sv-16)))) (when v1-52 - (set! (-> obj base-shove-ry) (-> v1-52 0)) - (set! (-> obj max-shove-diff-ry) (-> v1-52 1)) + (set! (-> this base-shove-ry) (-> v1-52 0)) + (set! (-> this max-shove-diff-ry) (-> v1-52 1)) ) ) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (if (and (= (get-reminder (get-task-control (game-task snow-bumpers)) 0) (-> obj bumper-id)) - (not (task-complete? *game-info* (-> obj entity extra perm task))) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (if (and (= (get-reminder (get-task-control (game-task snow-bumpers)) 0) (-> this bumper-id)) + (not (task-complete? *game-info* (-> this entity extra perm task))) ) (go snow-bumper-spawn-fuel-cell) (go snow-bumper-inactive-idle) diff --git a/goal_src/jak1/levels/snow/snow-bunny.gc b/goal_src/jak1/levels/snow/snow-bunny.gc index 952478d1c9..aa8b9503b3 100644 --- a/goal_src/jak1/levels/snow/snow-bunny.gc +++ b/goal_src/jak1/levels/snow/snow-bunny.gc @@ -111,7 +111,7 @@ ) (('touch) (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual snow-bunny-attack) @@ -129,12 +129,12 @@ ) ) -(defmethod snow-bunny-method-76 snow-bunny ((obj snow-bunny) (arg0 symbol)) +(defmethod snow-bunny-method-76 snow-bunny ((this snow-bunny) (arg0 symbol)) (let ((f0-0 -4096.0)) (if arg0 (set! f0-0 -20480.0) ) - (let ((v1-3 (-> obj draw shadow-ctrl))) + (let ((v1-3 (-> this draw shadow-ctrl))) (set! (-> v1-3 settings bot-plane w) (- f0-0)) ) ) @@ -142,8 +142,8 @@ (none) ) -(defmethod initialize-collision snow-bunny ((obj snow-bunny)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision snow-bunny ((this snow-bunny)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -183,61 +183,61 @@ (set! (-> s5-0 nav-radius) 2048.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod snow-bunny-method-60 snow-bunny ((obj snow-bunny)) - (initialize-skeleton obj *snow-bunny-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) +(defmethod snow-bunny-method-60 snow-bunny ((this snow-bunny)) + (initialize-skeleton this *snow-bunny-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) (none) ) -(defmethod nav-enemy-method-48 snow-bunny ((obj snow-bunny)) - (snow-bunny-method-60 obj) - (init-defaults! obj *snow-bunny-nav-enemy-info*) - (logclear! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf03)) +(defmethod nav-enemy-method-48 snow-bunny ((this snow-bunny)) + (snow-bunny-method-60 this) + (init-defaults! this *snow-bunny-nav-enemy-info*) + (logclear! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond - ((zero? (res-lump-value (-> obj entity) 'mode uint128)) - (set! (-> obj defense) (the-as uint 1)) - (set! (-> obj retreat-timeout) 5.0) + ((zero? (res-lump-value (-> this entity) 'mode uint128)) + (set! (-> this defense) (the-as uint 1)) + (set! (-> this retreat-timeout) 5.0) ) (else - (set! (-> obj defense) (the-as uint 0)) - (set! (-> obj retreat-timeout) 0.1) + (set! (-> this defense) (the-as uint 0)) + (set! (-> this retreat-timeout) 0.1) ) ) - (set! (-> obj last-nondangerous-time) (-> *display* base-frame-counter)) - (set! (-> obj gnd-popup) 16384.0) - (set! (-> obj got-jump-event?) #f) - (set! (-> obj notice-land-anim) 10) - (set! (-> obj attack-anim) 6) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj patrol-rand-distraction) (+ (nav-enemy-rnd-int-count 5) 1)) - (set! (-> obj patrol-hop-failed?) #f) + (set-time! (-> this last-nondangerous-time)) + (set! (-> this gnd-popup) 16384.0) + (set! (-> this got-jump-event?) #f) + (set! (-> this notice-land-anim) 10) + (set! (-> this attack-anim) 6) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this patrol-rand-distraction) (+ (nav-enemy-rnd-int-count 5) 1)) + (set! (-> this patrol-hop-failed?) #f) 0 (none) ) -(defmethod init-from-entity! snow-bunny ((obj snow-bunny) (arg0 entity-actor)) - (initialize-collision obj) - (process-drawable-from-entity! obj arg0) - (nav-enemy-method-48 obj) - (if (<= (-> obj path curve num-cverts) 0) +(defmethod init-from-entity! snow-bunny ((this snow-bunny) (arg0 entity-actor)) + (initialize-collision this) + (process-drawable-from-entity! this arg0) + (nav-enemy-method-48 this) + (if (<= (-> this path curve num-cverts) 0) (go process-drawable-art-error "no path") ) - (set! *snow-bunny* (the-as (pointer snow-bunny) (process->ppointer obj))) - (nav-enemy-method-59 obj) + (set! *snow-bunny* (the-as (pointer snow-bunny) (process->ppointer this))) + (nav-enemy-method-59 this) (none) ) -(defmethod nav-enemy-method-58 snow-bunny ((obj snow-bunny)) +(defmethod nav-enemy-method-58 snow-bunny ((this snow-bunny)) (if (not (logtest? (-> *target* state-flags) (state-flags dangerous))) - (set! (-> obj last-nondangerous-time) (-> *display* base-frame-counter)) + (set-time! (-> this last-nondangerous-time)) ) (none) ) @@ -256,37 +256,37 @@ (none) ) -(defmethod set-jump-height-factor! snow-bunny ((obj snow-bunny) (arg0 int)) +(defmethod set-jump-height-factor! snow-bunny ((this snow-bunny) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (set! (-> obj jump-anim) 8) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.6) - (set! (-> obj jump-anim-start-frame) 4.0) + (set! (-> this jump-anim) 8) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.6) + (set! (-> this jump-anim-start-frame) 4.0) ) ((= v1-0 1) - (set! (-> obj jump-anim) 7) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.6) - (set! (-> obj jump-anim-start-frame) 11.0) + (set! (-> this jump-anim) 7) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.6) + (set! (-> this jump-anim-start-frame) 11.0) ) ((= v1-0 2) - (set! (-> obj jump-anim) 7) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.4) - (set! (-> obj jump-anim-start-frame) 11.0) + (set! (-> this jump-anim) 7) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.4) + (set! (-> this jump-anim-start-frame) 11.0) ) ) ) (none) ) -(defmethod snow-bunny-method-57 snow-bunny ((obj snow-bunny)) +(defmethod snow-bunny-method-57 snow-bunny ((this snow-bunny)) (if (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags dangerous)))) (return #f) ) - (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> obj collide-info trans)))) + (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> this collide-info trans)))) (if (< 73728.0 f0-0) (return #f) ) @@ -296,12 +296,8 @@ (if (>= 40.96 f0-2) (set! f0-2 40.96) ) - (let ((v1-13 (the int (/ f0-2 (* (-> obj nav-info run-travel-speed) (-> *display* seconds-per-frame)))))) - (if (<= (- (- (seconds 0.36) (- (-> *display* base-frame-counter) (-> obj last-nondangerous-time))) - (the-as time-frame v1-13) - ) - 0 - ) + (let ((v1-13 (the int (/ f0-2 (* (-> this nav-info run-travel-speed) (seconds-per-frame)))))) + (if (<= (- (- (seconds 0.36) (- (current-time) (-> this last-nondangerous-time))) (the-as time-frame v1-13)) 0) (return #f) ) ) @@ -384,7 +380,7 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (snow-bunny-method-76 self #f) (logior! (-> self nav flags) (nav-control-flags navcf19)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) @@ -395,7 +391,7 @@ (if (snow-bunny-method-57 self) (go-virtual snow-bunny-defend) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (if (not *target*) (go-virtual nav-enemy-idle) ) @@ -424,8 +420,8 @@ :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) (loop - (let ((s5-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 2.52)) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 2.52)) (suspend) (ja :num! (loop!)) ) @@ -447,10 +443,10 @@ :post nav-enemy-simple-post ) -(defmethod snow-bunny-method-51 snow-bunny ((obj snow-bunny) (arg0 vector) (arg1 vector)) +(defmethod snow-bunny-method-51 snow-bunny ((this snow-bunny) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let* ((s4-0 (new 'stack-no-clear 'collide-tri-result)) - (f0-0 (-> obj gnd-popup)) + (f0-0 (-> this gnd-popup)) (f30-0 (+ f0-0 40960.0)) ) (set! (-> s5-0 quad) (-> arg0 quad)) @@ -460,13 +456,14 @@ s5-0 f30-0 (collide-kind background) - (-> obj collide-info process) + (-> this collide-info process) s4-0 (new 'static 'pat-surface :noentity #x1) ) ) ) - (if (or (< f0-2 0.0) (= (logand #b111000 (the-as int (-> s4-0 pat))) 8)) ;; yes this is bugged... again + ;; og:preserve-this yes this is bugged... again + (if (or (< f0-2 0.0) (= (logand #b111000 (the-as int (-> s4-0 pat))) 8)) (return #f) ) (set! (-> s5-0 y) (- (-> s5-0 y) (* f0-2 f30-0))) @@ -477,19 +474,19 @@ #t ) -(defmethod nav-enemy-method-53 snow-bunny ((obj snow-bunny)) - (let* ((s4-0 (-> obj path curve num-cverts)) +(defmethod nav-enemy-method-53 snow-bunny ((this snow-bunny)) + (let* ((s4-0 (-> this path curve num-cverts)) (s2-0 (nav-enemy-rnd-int-count s4-0)) (s5-0 (new 'stack-no-clear 'vector)) ) (dotimes (s3-0 s4-0) - (eval-path-curve-div! (-> obj path) s5-0 (the float s2-0) 'interp) - (let ((f30-0 (vector-vector-xz-distance s5-0 (-> obj collide-info trans)))) + (eval-path-curve-div! (-> this path) s5-0 (the float s2-0) 'interp) + (let ((f30-0 (vector-vector-xz-distance s5-0 (-> this collide-info trans)))) (when (>= f30-0 6144.0) - (when (snow-bunny-method-51 obj s5-0 s5-0) - (set! (-> obj final-dest quad) (-> s5-0 quad)) - (set! (-> obj halfway-dist) (* 0.5 f30-0)) - (set! (-> obj base-hop-dist) (rand-vu-float-range 6144.0 22118.4)) + (when (snow-bunny-method-51 this s5-0 s5-0) + (set! (-> this final-dest quad) (-> s5-0 quad)) + (set! (-> this halfway-dist) (* 0.5 f30-0)) + (set! (-> this base-hop-dist) (rand-vu-float-range 6144.0 22118.4)) (return #t) ) ) @@ -500,12 +497,12 @@ #f ) -(defmethod snow-bunny-method-54 snow-bunny ((obj snow-bunny)) +(defmethod snow-bunny-method-54 snow-bunny ((this snow-bunny)) (local-vars (sv-48 (function float float))) - (set! (-> obj using-jump-event?) #f) - (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> obj final-dest) (-> obj collide-info trans))) + (set! (-> this using-jump-event?) #f) + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this final-dest) (-> this collide-info trans))) (f30-0 (vector-length s5-1)) - (f1-0 (-> obj halfway-dist)) + (f1-0 (-> this halfway-dist)) (f0-1 (- 1.0 (/ (fabs (- f30-0 f1-0)) (* 2.0 f1-0)))) ) (cond @@ -516,10 +513,10 @@ (set! f0-1 1.0) ) ) - (let ((f28-0 (* (-> obj base-hop-dist) f0-1))) + (let ((f28-0 (* (-> this base-hop-dist) f0-1))) (cond ((>= (+ 4096.0 f28-0) f30-0) - (set! (-> obj nav target-pos quad) (-> obj final-dest quad)) + (set! (-> this nav target-pos quad) (-> this final-dest quad)) ) (else (vector-rotate-around-y! s5-1 s5-1 16384.0) @@ -527,7 +524,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector))) (let ((s3-0 vector+*!) (s2-0 s4-0) - (s1-0 (-> obj final-dest)) + (s1-0 (-> this final-dest)) (s0-0 s5-1) ) (set! sv-48 sin) @@ -535,32 +532,32 @@ (s3-0 s2-0 s1-0 s0-0 (sv-48 a0-9)) ) ) - (vector-! s5-1 s4-0 (-> obj collide-info trans)) + (vector-! s5-1 s4-0 (-> this collide-info trans)) (when (< f28-0 (vector-length s5-1)) (vector-normalize! s5-1 f28-0) - (vector+! s4-0 (-> obj collide-info trans) s5-1) + (vector+! s4-0 (-> this collide-info trans) s5-1) ) - (set! (-> obj nav target-pos quad) (-> s4-0 quad)) + (set! (-> this nav target-pos quad) (-> s4-0 quad)) ) ) ) ) ) - (set! (-> obj got-jump-event?) #f) - (nav-control-method-11 (-> obj nav) (-> obj nav target-pos)) + (set! (-> this got-jump-event?) #f) + (nav-control-method-11 (-> this nav) (-> this nav target-pos)) (cond - ((-> obj got-jump-event?) - (set! (-> obj nav target-pos quad) (-> obj jump-event-dest quad)) - (set! (-> obj using-jump-event?) #t) + ((-> this got-jump-event?) + (set! (-> this nav target-pos quad) (-> this jump-event-dest quad)) + (set! (-> this using-jump-event?) #t) ) (else - (let ((s5-2 (-> obj nav travel))) + (let ((s5-2 (-> this nav travel))) (if (< (vector-length s5-2) 0.01) (return #f) ) - (let ((a2-2 (-> obj nav target-pos))) - (vector+! a2-2 (-> obj collide-info trans) s5-2) - (if (not (snow-bunny-method-51 obj a2-2 a2-2)) + (let ((a2-2 (-> this nav target-pos))) + (vector+! a2-2 (-> this collide-info trans) s5-2) + (if (not (snow-bunny-method-51 this a2-2 a2-2)) (return #f) ) ) @@ -574,7 +571,7 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (when (not (snow-bunny-method-54 self)) (set! (-> self patrol-hop-failed?) #t) (go-virtual snow-bunny-patrol-idle) @@ -640,7 +637,7 @@ ) (until (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) (ja :num! (seek! max f30-0)) - (+! (-> self collide-info transv y) (* -546119.7 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -546119.7 (seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) @@ -684,25 +681,25 @@ :post #f ) -(defmethod snow-bunny-method-52 snow-bunny ((obj snow-bunny)) +(defmethod snow-bunny-method-52 snow-bunny ((this snow-bunny)) (local-vars (sv-48 (function float float))) - (set! (-> obj using-jump-event?) #f) + (set! (-> this using-jump-event?) #f) (if (not *target*) (return #f) ) - (let ((s4-0 (-> obj final-dest))) + (let ((s4-0 (-> this final-dest))) (set! (-> s4-0 quad) (-> (target-pos 0) quad)) - (if (not (snow-bunny-method-51 obj s4-0 s4-0)) + (if (not (snow-bunny-method-51 this s4-0 s4-0)) (return #f) ) - (set! (-> obj base-hop-dist) (rand-vu-float-range 18022.4 22118.4)) - (let* ((s5-2 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> obj collide-info trans))) + (set! (-> this base-hop-dist) (rand-vu-float-range 18022.4 22118.4)) + (let* ((s5-2 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> this collide-info trans))) (f28-0 (vector-length s5-2)) - (f30-0 (-> obj base-hop-dist)) + (f30-0 (-> this base-hop-dist)) ) (cond ((>= (+ 4096.0 f30-0) f28-0) - (set! (-> obj nav target-pos quad) (-> s4-0 quad)) + (set! (-> this nav target-pos quad) (-> s4-0 quad)) ) (else (vector-rotate-around-y! s5-2 s5-2 16384.0) @@ -717,32 +714,32 @@ (s2-0 s1-0 s4-0 s0-0 (sv-48 a0-11)) ) ) - (vector-! s5-2 s3-0 (-> obj collide-info trans)) + (vector-! s5-2 s3-0 (-> this collide-info trans)) (when (< f30-0 (vector-length s5-2)) (vector-normalize! s5-2 f30-0) - (vector+! s3-0 (-> obj collide-info trans) s5-2) + (vector+! s3-0 (-> this collide-info trans) s5-2) ) - (set! (-> obj nav target-pos quad) (-> s3-0 quad)) + (set! (-> this nav target-pos quad) (-> s3-0 quad)) ) ) ) ) ) - (set! (-> obj got-jump-event?) #f) - (nav-control-method-11 (-> obj nav) (-> obj nav target-pos)) + (set! (-> this got-jump-event?) #f) + (nav-control-method-11 (-> this nav) (-> this nav target-pos)) (cond - ((-> obj got-jump-event?) - (set! (-> obj nav target-pos quad) (-> obj jump-event-dest quad)) - (set! (-> obj using-jump-event?) #t) + ((-> this got-jump-event?) + (set! (-> this nav target-pos quad) (-> this jump-event-dest quad)) + (set! (-> this using-jump-event?) #t) ) (else - (let ((s5-3 (-> obj nav travel))) + (let ((s5-3 (-> this nav travel))) (if (< (vector-length s5-3) 0.01) (return #f) ) - (let ((a2-3 (-> obj nav target-pos))) - (vector+! a2-3 (-> obj collide-info trans) s5-3) - (if (not (snow-bunny-method-51 obj a2-3 a2-3)) + (let ((a2-3 (-> this nav target-pos))) + (vector+! a2-3 (-> this collide-info trans) s5-3) + (if (not (snow-bunny-method-51 this a2-3 a2-3)) (return #f) ) ) @@ -756,7 +753,7 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self should-retreat?) #f) (if (or (not *target*) (logtest? (-> *target* state-flags) (state-flags do-not-notice))) (go-virtual nav-enemy-patrol) @@ -823,19 +820,19 @@ ) -(defmethod nav-enemy-method-55 snow-bunny ((obj snow-bunny)) - (set! (-> obj using-jump-event?) #f) +(defmethod nav-enemy-method-55 snow-bunny ((this snow-bunny)) + (set! (-> this using-jump-event?) #f) (if (not *target*) (return #f) ) (let ((s5-0 (new 'stack-no-clear 'snow-bunny-retreat-work))) (set! (-> s5-0 found-best) #f) - (let ((s4-0 (-> obj nav))) + (let ((s4-0 (-> this nav))) (nav-control-method-27 s4-0) (nav-control-method-28 s4-0 (the-as collide-kind -1)) ) (let ((s4-1 (target-pos 0))) - (vector-! (-> s5-0 away-vec) (-> obj collide-info trans) s4-1) + (vector-! (-> s5-0 away-vec) (-> this collide-info trans) s4-1) (set! (-> s5-0 away-vec y) 0.0) (vector-normalize! (-> s5-0 away-vec) 86016.0) (let* ((s3-0 (quaternion-y-angle (-> *target* control quat))) @@ -857,7 +854,7 @@ (s1-0 (new 'stack-no-clear 'vector)) ) (vector-rotate-around-y! s1-0 (-> s5-0 away-vec) f0-7) - (vector+! (-> obj final-dest) s4-1 s1-0) + (vector+! (-> this final-dest) s4-1 s1-0) ) ) ) @@ -871,11 +868,11 @@ (s1-1 (new 'stack-no-clear 'vector)) ) (vector-rotate-around-y! s1-1 (-> s5-0 away-vec) f0-10) - (vector+! (-> obj final-dest) s4-1 s1-1) + (vector+! (-> this final-dest) s4-1 s1-1) ) ) ) - (let* ((s1-3 (vector-! (new 'stack-no-clear 'vector) (-> obj final-dest) (-> obj collide-info trans))) + (let* ((s1-3 (vector-! (new 'stack-no-clear 'vector) (-> this final-dest) (-> this collide-info trans))) (f0-12 (vector-length s1-3)) ) (let ((f1-4 (* 0.000011625744 f0-12))) @@ -887,41 +884,41 @@ (set! f1-4 0.4) ) ) - (set! (-> obj base-hop-dist) (+ 16384.0 (* 20480.0 f1-4))) + (set! (-> this base-hop-dist) (+ 16384.0 (* 20480.0 f1-4))) ) - (when (< (-> obj base-hop-dist) f0-12) - (vector-normalize! s1-3 (-> obj base-hop-dist)) - (vector+! (-> obj final-dest) (-> obj collide-info trans) s1-3) + (when (< (-> this base-hop-dist) f0-12) + (vector-normalize! s1-3 (-> this base-hop-dist)) + (vector+! (-> this final-dest) (-> this collide-info trans) s1-3) ) ) - (set! (-> obj nav target-pos quad) (-> obj final-dest quad)) - (set! (-> obj got-jump-event?) #f) - (nav-control-method-13 (-> obj nav) (-> obj nav target-pos) (-> obj nav old-travel)) - (when (< (vector-xz-length (-> obj nav travel)) 204.8) + (set! (-> this nav target-pos quad) (-> this final-dest quad)) + (set! (-> this got-jump-event?) #f) + (nav-control-method-13 (-> this nav) (-> this nav target-pos) (-> this nav old-travel)) + (when (< (vector-xz-length (-> this nav travel)) 204.8) (let ((s1-4 (new 'stack-no-clear 'nav-gap-info))) - (when (nav-control-method-12 (-> obj nav) s1-4) - (set! (-> obj got-jump-event?) #t) - (set! (-> obj jump-event-dest quad) (-> s1-4 dest quad)) + (when (nav-control-method-12 (-> this nav) s1-4) + (set! (-> this got-jump-event?) #t) + (set! (-> this jump-event-dest quad) (-> s1-4 dest quad)) ) ) ) (cond - ((-> obj got-jump-event?) + ((-> this got-jump-event?) (when (zero? s2-0) - (set! (-> obj nav target-pos quad) (-> obj jump-event-dest quad)) - (set! (-> obj using-jump-event?) #t) + (set! (-> this nav target-pos quad) (-> this jump-event-dest quad)) + (set! (-> this using-jump-event?) #t) (return #t) ) ) (else - (let* ((s0-0 (-> obj nav travel)) + (let* ((s0-0 (-> this nav travel)) (f30-2 (vector-length s0-0)) ) (when (>= f30-2 409.6) - (let ((s1-5 (-> obj nav target-pos))) - (vector+! s1-5 (-> obj collide-info trans) s0-0) - (when (snow-bunny-method-51 obj s1-5 s1-5) - (if (>= f30-2 (+ -409.6 (-> obj base-hop-dist))) + (let ((s1-5 (-> this nav target-pos))) + (vector+! s1-5 (-> this collide-info trans) s0-0) + (when (snow-bunny-method-51 this s1-5 s1-5) + (if (>= f30-2 (+ -409.6 (-> this base-hop-dist))) (return #t) ) (when (or (not (-> s5-0 found-best)) (< (-> s5-0 best-travel-dist) f30-2)) @@ -939,8 +936,8 @@ ) ) (when (-> s5-0 found-best) - (set! (-> obj nav target-pos quad) (-> s5-0 best-dest quad)) - (vector-! (-> obj nav travel) (-> s5-0 best-dest) (-> obj collide-info trans)) + (set! (-> this nav target-pos quad) (-> s5-0 best-dest quad)) + (vector-! (-> this nav travel) (-> s5-0 best-dest) (-> this collide-info trans)) (return #t) ) ) @@ -951,18 +948,16 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (not *target*) (go-virtual nav-enemy-patrol) ) (let ((v1-8 (>= 73728.0 (vector-vector-xz-distance (target-pos 0) (-> self collide-info trans))))) (when (or (-> self should-retreat?) (and v1-8 (logtest? (-> *target* state-flags) (state-flags dangerous)))) - (set! (-> self retreat-timeout-time) - (+ (-> *display* base-frame-counter) (the int (* 300.0 (-> self retreat-timeout)))) - ) + (set! (-> self retreat-timeout-time) (+ (current-time) (the int (* 300.0 (-> self retreat-timeout))))) (set! (-> self should-retreat?) #f) ) - (when (or (>= (-> *display* base-frame-counter) (-> self retreat-timeout-time)) (not v1-8)) + (when (or (>= (current-time) (-> self retreat-timeout-time)) (not v1-8)) (if (or (not *target*) (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (not (target-in-range? self (-> self nav-info stop-chase-distance))) @@ -1003,7 +998,7 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (snow-bunny-method-76 self #f) ) :trans (behavior () @@ -1042,7 +1037,7 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set-vector! (-> self collide-info transv) 0.0 0.0 0.0 1.0) (snow-bunny-method-76 self #t) ) @@ -1053,7 +1048,7 @@ (seek-toward-heading-vec! (-> self collide-info) gp-0 524288.0 (seconds 0.1)) ) ) - (+! (-> self collide-info transv y) (* -546119.7 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -546119.7 (seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) diff --git a/goal_src/jak1/levels/snow/snow-flutflut-obs.gc b/goal_src/jak1/levels/snow/snow-flutflut-obs.gc index 1049246a16..9160fe00fd 100644 --- a/goal_src/jak1/levels/snow/snow-flutflut-obs.gc +++ b/goal_src/jak1/levels/snow/snow-flutflut-obs.gc @@ -267,7 +267,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self wiggled?) #f) ;; og:preserve-this PAL patch here (set! (-> self trying-for-fuel-cell?) (not (task-complete? *game-info* (game-task snow-ball)))) @@ -334,8 +334,8 @@ :trans rider-trans :code (behavior () (send-to-all-after (-> self link) 'untrigger) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.6)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.6)) (suspend) ) (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) @@ -348,8 +348,8 @@ :post rider-post ) -(defmethod init-from-entity! snow-button ((obj snow-button) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-button ((this snow-button) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -391,25 +391,25 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (initialize-skeleton obj *snow-button-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj timeout) (the-as time-frame (the int (* 300.0 (res-lump-float arg0 'timeout :default 10.0))))) - (set! (-> obj delay-til-wiggle) (+ (-> obj timeout) (seconds -0.4))) + (process-drawable-from-entity! this arg0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (initialize-skeleton this *snow-button-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this timeout) (the-as time-frame (the int (* 300.0 (res-lump-float arg0 'timeout :default 10.0))))) + (set! (-> this delay-til-wiggle) (+ (-> this timeout) (seconds -0.4))) (if (> (entity-actor-count arg0 'alt-actor) 0) - (set! (-> obj prev-button) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj prev-button) #f) + (set! (-> this prev-button) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this prev-button) #f) ) ;; og:preserve-this PAL patch here - (set! (-> obj trying-for-fuel-cell?) (not (task-complete? *game-info* (game-task snow-ball)))) + (set! (-> this trying-for-fuel-cell?) (not (task-complete? *game-info* (game-task snow-ball)))) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) @@ -419,60 +419,60 @@ (none) ) -(defmethod baseplat-method-26 flutflut-plat ((obj flutflut-plat)) +(defmethod baseplat-method-26 flutflut-plat ((this flutflut-plat)) (let ((t9-0 (method-of-type plat baseplat-method-26))) - (t9-0 obj) + (t9-0 this) ) - (if (zero? (-> obj link)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) + (if (zero? (-> this link)) + (set! (-> this link) (new 'process 'actor-link-info this)) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj plat-type) (res-lump-value (-> obj entity) 'mode int)) - (set! (-> obj flutflut-button) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (let ((f0-0 (res-lump-float (-> obj entity) 'rotoffset))) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this plat-type) (res-lump-value (-> this entity) 'mode int)) + (set! (-> this flutflut-button) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-0 0.0) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-0) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-0) ) ) - (set! (-> obj has-path?) - (and (not (logtest? (-> obj path flags) (path-control-flag not-found))) (> (-> obj sync period) 0)) + (set! (-> this has-path?) + (and (not (logtest? (-> this path flags) (path-control-flag not-found))) (> (-> this sync period) 0)) ) - (when (nonzero? (-> obj plat-type)) + (when (nonzero? (-> this plat-type)) (cond - ((-> obj has-path?) - (set! (-> obj sync-starting-val) (get-phase-offset (-> obj sync))) - (sync-now! (-> obj sync) (-> obj sync-starting-val)) + ((-> this has-path?) + (set! (-> this sync-starting-val) (get-phase-offset (-> this sync))) + (sync-now! (-> this sync) (-> this sync-starting-val)) (eval-path-curve! - (-> obj path) - (-> obj appear-trans-top) - (if (logtest? (-> obj fact options) (fact-options wrap-phase)) - (get-current-phase (-> obj sync)) - (get-current-phase-with-mirror (-> obj sync)) + (-> this path) + (-> this appear-trans-top) + (if (logtest? (-> this fact options) (fact-options wrap-phase)) + (get-current-phase (-> this sync)) + (get-current-phase-with-mirror (-> this sync)) ) 'interp ) ) (else - (set! (-> obj appear-trans-top quad) (-> obj root-override trans quad)) + (set! (-> this appear-trans-top quad) (-> this root-override trans quad)) ) ) - (set! (-> obj appear-trans-bottom quad) (-> obj appear-trans-top quad)) - (+! (-> obj appear-trans-bottom y) -286720.0) - (quaternion-copy! (-> obj appear-quat-top) (-> obj root-override quat)) - (let ((v1-33 (res-lump-value (-> obj entity) 'extra-id uint128))) - (set! (-> obj rise-time) (the int (* 300.0 (+ 0.6 (* 0.15 (the float v1-33)))))) + (set! (-> this appear-trans-bottom quad) (-> this appear-trans-top quad)) + (+! (-> this appear-trans-bottom y) -286720.0) + (quaternion-copy! (-> this appear-quat-top) (-> this root-override quat)) + (let ((v1-33 (res-lump-value (-> this entity) 'extra-id uint128))) + (set! (-> this rise-time) (the int (* 300.0 (+ 0.6 (* 0.15 (the float v1-33)))))) ) - (set! (-> obj fall-time) 180) + (set! (-> this fall-time) 180) ) (none) ) -(defmethod get-lit-skel flutflut-plat ((obj flutflut-plat)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) +(defmethod get-lit-skel flutflut-plat ((this flutflut-plat)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (return (the-as skeleton-group #t)) ) - (when (task-complete? *game-info* (-> obj entity extra perm task)) - (process-entity-status! obj (entity-perm-status complete) #t) + (when (task-complete? *game-info* (-> this entity extra perm task)) + (process-entity-status! this (entity-perm-status complete) #t) (return (the-as skeleton-group #t)) ) (the-as skeleton-group #f) @@ -559,7 +559,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root-override)) @@ -580,12 +580,7 @@ ) :trans (behavior () (plat-trans) - (let* ((f0-1 - (fmin - 1.0 - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) (the float (-> self rise-time))) - ) - ) + (let* ((f0-1 (fmin 1.0 (/ (the float (- (current-time) (-> self state-time))) (the float (-> self rise-time))))) (f0-2 (- 1.0 f0-1)) (f0-3 (* f0-2 f0-2)) (f30-0 (- 1.0 f0-3)) @@ -704,7 +699,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self root-override root-prim prim-core action) (collide-action rider-plat-sticky)) (set! (-> self start-trans quad) (-> self root-override trans quad)) @@ -725,12 +720,7 @@ ) :trans (behavior () (plat-trans) - (let* ((f0-1 - (fmin - 1.0 - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) (the float (-> self fall-time))) - ) - ) + (let* ((f0-1 (fmin 1.0 (/ (the float (- (current-time) (-> self state-time))) (the float (-> self fall-time))))) (f30-0 (* f0-1 f0-1)) ) (vector-lerp! (-> self basetrans) (-> self start-trans) (-> self appear-trans-bottom) f30-0) @@ -793,7 +783,7 @@ (go elevator-idle-at-fort) ) ;; og:preserve-this PAL patch here - (seek! (-> self path-pos) 1.0 (* 0.16 (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) 1.0 (* 0.16 (seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (baseplat-method-20 self) @@ -846,7 +836,7 @@ (go elevator-idle-at-cave) ) ;; og:preserve-this PAL patch here - (seek! (-> self path-pos) 0.0 (* 0.16 (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) 0.0 (* 0.16 (seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (baseplat-method-20 self) @@ -882,36 +872,36 @@ ) -(defmethod get-unlit-skel flutflut-plat-small ((obj flutflut-plat-small)) +(defmethod get-unlit-skel flutflut-plat-small ((this flutflut-plat-small)) *flutflut-plat-small-sg* ) -(defmethod baseplat-method-25 flutflut-plat-small ((obj flutflut-plat-small)) - (let ((v0-0 (create-launch-control (-> *part-group-id-table* 516) obj))) - (set! (-> obj part) v0-0) +(defmethod baseplat-method-25 flutflut-plat-small ((this flutflut-plat-small)) + (let ((v0-0 (create-launch-control (-> *part-group-id-table* 516) this))) + (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) -(defmethod baseplat-method-20 flutflut-plat-small ((obj flutflut-plat-small)) - (when (nonzero? (-> obj part)) - (set! (-> *part-id-table* 2087 init-specs 12 initial-valuef) (-> obj part-ry)) - (set! (-> *part-id-table* 2088 init-specs 17 initial-valuef) (-> obj part-ry)) - (spawn (-> obj part) (-> obj root-override trans)) +(defmethod baseplat-method-20 flutflut-plat-small ((this flutflut-plat-small)) + (when (nonzero? (-> this part)) + (set! (-> *part-id-table* 2087 init-specs 12 initial-valuef) (-> this part-ry)) + (set! (-> *part-id-table* 2088 init-specs 17 initial-valuef) (-> this part-ry)) + (spawn (-> this part) (-> this root-override trans)) ) (none) ) -(defmethod baseplat-method-26 flutflut-plat-small ((obj flutflut-plat-small)) +(defmethod baseplat-method-26 flutflut-plat-small ((this flutflut-plat-small)) (let ((t9-0 (method-of-type flutflut-plat baseplat-method-26))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj part-ry) (+ 16384.0 (quaternion-y-angle (-> obj root-override quat)))) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) (none) ) -(defmethod baseplat-method-24 flutflut-plat-small ((obj flutflut-plat-small)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 flutflut-plat-small ((this flutflut-plat-small)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -929,25 +919,25 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod get-unlit-skel flutflut-plat-med ((obj flutflut-plat-med)) +(defmethod get-unlit-skel flutflut-plat-med ((this flutflut-plat-med)) *flutflut-plat-med-sg* ) -(defmethod baseplat-method-25 flutflut-plat-med ((obj flutflut-plat-med)) - (let ((v0-0 (create-launch-control (-> *part-group-id-table* 517) obj))) - (set! (-> obj part) v0-0) +(defmethod baseplat-method-25 flutflut-plat-med ((this flutflut-plat-med)) + (let ((v0-0 (create-launch-control (-> *part-group-id-table* 517) this))) + (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) -(defmethod baseplat-method-24 flutflut-plat-med ((obj flutflut-plat-med)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 flutflut-plat-med ((this flutflut-plat-med)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -965,42 +955,42 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod get-unlit-skel flutflut-plat-large ((obj flutflut-plat-large)) +(defmethod get-unlit-skel flutflut-plat-large ((this flutflut-plat-large)) *flutflut-plat-large-sg* ) -(defmethod baseplat-method-25 flutflut-plat-large ((obj flutflut-plat-large)) - (let ((v0-0 (create-launch-control (-> *part-group-id-table* 518) obj))) - (set! (-> obj part) v0-0) +(defmethod baseplat-method-25 flutflut-plat-large ((this flutflut-plat-large)) + (let ((v0-0 (create-launch-control (-> *part-group-id-table* 518) this))) + (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) -(defmethod baseplat-method-20 flutflut-plat-large ((obj flutflut-plat-large)) - (when (nonzero? (-> obj part)) - (set! (-> *part-id-table* 2091 init-specs 12 initial-valuef) (-> obj part-ry)) - (set! (-> *part-id-table* 2092 init-specs 17 initial-valuef) (-> obj part-ry)) - (spawn (-> obj part) (-> obj root-override trans)) +(defmethod baseplat-method-20 flutflut-plat-large ((this flutflut-plat-large)) + (when (nonzero? (-> this part)) + (set! (-> *part-id-table* 2091 init-specs 12 initial-valuef) (-> this part-ry)) + (set! (-> *part-id-table* 2092 init-specs 17 initial-valuef) (-> this part-ry)) + (spawn (-> this part) (-> this root-override trans)) ) (none) ) -(defmethod baseplat-method-26 flutflut-plat-large ((obj flutflut-plat-large)) +(defmethod baseplat-method-26 flutflut-plat-large ((this flutflut-plat-large)) (let ((t9-0 (method-of-type flutflut-plat baseplat-method-26))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj part-ry) (+ 16384.0 (quaternion-y-angle (-> obj root-override quat)))) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) (none) ) -(defmethod baseplat-method-24 flutflut-plat-large ((obj flutflut-plat-large)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 flutflut-plat-large ((this flutflut-plat-large)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1018,7 +1008,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) diff --git a/goal_src/jak1/levels/snow/snow-obs.gc b/goal_src/jak1/levels/snow/snow-obs.gc index d779f8d4e6..6e6bcba1df 100644 --- a/goal_src/jak1/levels/snow/snow-obs.gc +++ b/goal_src/jak1/levels/snow/snow-obs.gc @@ -22,8 +22,8 @@ :bounds (static-spherem 0 0 0 10) ) -(defmethod set-stack-size! snowcam ((obj snowcam)) - (stack-size-set! (-> obj main-thread) 512) +(defmethod set-stack-size! snowcam ((this snowcam)) + (stack-size-set! (-> this main-thread) 512) (none) ) @@ -48,8 +48,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4.5)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 4.5)) (suspend) ) ) @@ -383,8 +383,8 @@ *entity-pool* (game-task none) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1.1)) (if (-> self play-sound?) (update! (-> self sound)) ) @@ -424,8 +424,8 @@ ) ) -(defmethod init-from-entity! snow-eggtop ((obj snow-eggtop) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-eggtop ((this snow-eggtop) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -443,32 +443,32 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-eggtop-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj spawn-trans quad) (-> obj root-override trans quad)) - (+! (-> obj root-override trans y) -2662.4) - (update-transforms! (-> obj root-override)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 510) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "electric-loop" :fo-max 40) (-> obj root-override trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-eggtop-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this spawn-trans quad) (-> this root-override trans quad)) + (+! (-> this root-override trans y) -2662.4) + (update-transforms! (-> this root-override)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 510) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "electric-loop" :fo-max 40) (-> this root-override trans)) ) (cond - ((task-complete? *game-info* (-> obj entity extra perm task)) + ((task-complete? *game-info* (-> this entity extra perm task)) (go snow-eggtop-idle-down) ) (else (let ((a0-17 (new 'stack-no-clear 'vector))) - (set! (-> a0-17 quad) (-> obj root-override trans quad)) + (set! (-> a0-17 quad) (-> this root-override trans quad)) (+! (-> a0-17 y) 3072.0) (birth-pickup-at-point a0-17 (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) + (the float (-> this entity extra perm task)) #f - obj + this (the-as fact-info #f) ) ) @@ -536,14 +536,14 @@ :post pusher-post ) -(defmethod init-from-entity! snowpusher ((obj snowpusher) (arg0 entity-actor)) +(defmethod init-from-entity! snowpusher ((this snowpusher) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (logior! (-> obj mask) (process-mask enemy platform)) + (logior! (-> this mask) (process-mask enemy platform)) (let ((s3-0 0) (s4-0 0) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-3 (res-lump-data (-> obj entity) 'mode (pointer int32) :tag-ptr (& sv-16)))) + (let ((v1-3 (res-lump-data (-> this entity) 'mode (pointer int32) :tag-ptr (& sv-16)))) (when v1-3 (set! s3-0 (-> v1-3 0)) (set! s4-0 (-> v1-3 1)) @@ -551,19 +551,19 @@ ) (cond ((zero? s3-0) - (set! (-> obj open-sound) (static-sound-name "snow-piston-opn")) - (set! (-> obj close-sound) (static-sound-name "snow-piston-cls")) + (set! (-> this open-sound) (static-sound-name "snow-piston-opn")) + (set! (-> this close-sound) (static-sound-name "snow-piston-cls")) ) ((= s3-0 1) - (set! (-> obj open-sound) (static-sound-name "snow-pist-opn3")) - (set! (-> obj close-sound) (static-sound-name "snow-pist-cls3")) + (set! (-> this open-sound) (static-sound-name "snow-pist-opn3")) + (set! (-> this close-sound) (static-sound-name "snow-pist-cls3")) ) ((= s3-0 2) - (set! (-> obj open-sound) (static-sound-name "snow-pist-opn2")) - (set! (-> obj close-sound) (static-sound-name "snow-pist-cls2")) + (set! (-> this open-sound) (static-sound-name "snow-pist-opn2")) + (set! (-> this close-sound) (static-sound-name "snow-pist-cls2")) ) ) - (let ((s3-1 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s3-1 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s3-1 dynam) (copy *standard-dynamics* 'process)) (set! (-> s3-1 reaction) default-collision-reaction) (set! (-> s3-1 no-reaction) @@ -580,22 +580,22 @@ ) (set! (-> s3-1 nav-radius) (* 0.75 (-> s3-1 root-prim local-sphere w))) (backup-collide-with-as s3-1) - (set! (-> obj root-override) s3-1) + (set! (-> this root-override) s3-1) ) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snowpusher-sg* '()) - (let ((s4-2 (-> obj skel root-channel 0))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snowpusher-sg* '()) + (let ((s4-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-2 frame-num) 0.0) ) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) - (set! (-> obj max-frame) (* (the float (ja-num-frames 0)) (res-lump-float arg0 'max-frame :default 1.0))) - (logclear! (-> obj mask) (process-mask actor-pause)) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) + (set! (-> this max-frame) (* (the float (ja-num-frames 0)) (res-lump-float arg0 'max-frame :default 1.0))) + (logclear! (-> this mask) (process-mask actor-pause)) (go snowpusher-idle) (none) ) @@ -668,9 +668,9 @@ :post plat-post ) -(defmethod init-from-entity! snow-spatula ((obj snow-spatula) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-spatula ((this snow-spatula) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -688,14 +688,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-spatula-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) - (quaternion->matrix (-> obj startmat) (-> obj root-override quat)) - (baseplat-method-21 obj) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-spatula-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) + (quaternion->matrix (-> this startmat) (-> this root-override quat)) + (baseplat-method-21 this) (go snow-spatula-idle) (none) ) @@ -951,7 +951,7 @@ (go snow-fort-gate-idle-open) ) ) - (vector-seek-3d-smooth! s5-0 (-> self open-trans) (* 16384.0 (-> *display* seconds-per-frame)) 0.9) + (vector-seek-3d-smooth! s5-0 (-> self open-trans) (* 16384.0 (seconds-per-frame)) 0.9) (move-to-point! (-> self root-override) s5-0) ) (let ((a1-7 (new 'stack-no-clear 'vector))) @@ -983,32 +983,32 @@ ) ) -(defmethod deactivate snow-fort-gate ((obj snow-fort-gate)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate snow-fort-gate ((this snow-fort-gate)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj part3)) - (kill-and-free-particles (-> obj part3)) + (if (nonzero? (-> this part3)) + (kill-and-free-particles (-> this part3)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod relocate snow-fort-gate ((obj snow-fort-gate) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate snow-fort-gate ((this snow-fort-gate) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj part3)) - (&+! (-> obj part3) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method snow-fort-gate 7)) this arg0) ) ) -(defmethod init-from-entity! snow-fort-gate ((obj snow-fort-gate) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! snow-fort-gate ((this snow-fort-gate) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1020,37 +1020,37 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-fort-gate-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 512) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 513) obj)) - (set! (-> obj part3) (create-launch-control (-> *part-group-id-table* 514) obj)) - (set! (-> obj open-trans quad) (-> obj root-override trans quad)) - (set! (-> obj closed-trans quad) (-> obj open-trans quad)) - (+! (-> obj open-trans y) -141312.0) - (+! (-> obj open-trans z) 32768.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "lodge-door-mov" :fo-max 80) (-> obj open-trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-fort-gate-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 512) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 513) this)) + (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 514) this)) + (set! (-> this open-trans quad) (-> this root-override trans quad)) + (set! (-> this closed-trans quad) (-> this open-trans quad)) + (+! (-> this open-trans y) -141312.0) + (+! (-> this open-trans z) 32768.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "lodge-door-mov" :fo-max 80) (-> this open-trans)) ) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (cond ((task-complete? *game-info* (game-task snow-ball)) - (set! (-> obj root-override trans quad) (-> obj open-trans quad)) + (set! (-> this root-override trans quad) (-> this open-trans quad)) (transform-post) (go snow-fort-gate-idle-open) ) (else - (set! (-> obj root-override trans quad) (-> obj closed-trans quad)) + (set! (-> this root-override trans quad) (-> this closed-trans quad)) (transform-post) (go snow-fort-gate-idle-closed) ) @@ -1145,11 +1145,11 @@ :init-specs ((:fade-a -0.14222223)) ) -(defmethod snow-gears-method-20 snow-gears ((obj snow-gears)) +(defmethod snow-gears-method-20 snow-gears ((this snow-gears)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> obj root trans quad)) + (set! (-> a1-0 quad) (-> this root trans quad)) (+! (-> a1-0 y) 61440.0) - (spawn (-> obj part) a1-0) + (spawn (-> this part) a1-0) ) (none) ) @@ -1191,9 +1191,9 @@ (suspend) (ja :num! (seek! max 0.35)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! (-> self draw art-group data 2) :num! min) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (update! (-> self sound)) (suspend) ) @@ -1239,13 +1239,13 @@ ) ) -(defmethod init-from-entity! snow-gears ((obj snow-gears) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-gears-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 515) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "snow-engine" :fo-max 300) (-> obj root trans)) +(defmethod init-from-entity! snow-gears ((this snow-gears) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-gears-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 515) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "snow-engine" :fo-max 300) (-> this root trans)) ) (go snow-gears-idle) (none) @@ -1366,7 +1366,7 @@ ) (else (set! (-> s5-1 y) - (seek-with-smooth (-> self root-override trans y) f0-1 (* 6144.0 (-> *display* seconds-per-frame)) 0.2 204.8) + (seek-with-smooth (-> self root-override trans y) f0-1 (* 6144.0 (seconds-per-frame)) 0.2 204.8) ) (move-to-point! (-> self root-override) s5-1) ) @@ -1393,11 +1393,11 @@ ) ) -(defmethod init-from-entity! snow-switch ((obj snow-switch) (arg0 entity-actor)) - (set! (-> obj pressed?) #f) - (set! (-> obj fcell-handle) (the-as handle #f)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-switch ((this snow-switch) (arg0 entity-actor)) + (set! (-> this pressed?) #f) + (set! (-> this fcell-handle) (the-as handle #f)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1415,37 +1415,37 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-switch-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-switch-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> obj orig-trans quad) (-> obj root-override trans quad)) + (set! (-> this orig-trans quad) (-> this root-override trans quad)) (let ((s5-2 (task-complete? *game-info* (game-task snow-ball)))) - (set! (-> obj pressed?) s5-2) + (set! (-> this pressed?) s5-2) (when (not s5-2) (let ((a0-17 (new 'stack-no-clear 'vector))) - (set! (-> a0-17 quad) (-> obj orig-trans quad)) + (set! (-> a0-17 quad) (-> this orig-trans quad)) (+! (-> a0-17 y) 12288.0) - (set! (-> obj fcell-handle) (ppointer->handle (birth-pickup-at-point - a0-17 - (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) - #f - obj - (the-as fact-info #f) - ) - ) + (set! (-> this fcell-handle) (ppointer->handle (birth-pickup-at-point + a0-17 + (pickup-type fuel-cell) + (the float (-> this entity extra perm task)) + #f + this + (the-as fact-info #f) + ) + ) ) ) ) @@ -1608,8 +1608,8 @@ :post rider-post ) -(defmethod init-from-entity! snow-log ((obj snow-log) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-log ((this snow-log) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1627,18 +1627,18 @@ ) (set! (-> s4-0 nav-radius) 11264.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-log-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (logior! (-> obj draw status) (draw-status hidden)) - (+! (-> obj root-override trans x) -1024.0) - (+! (-> obj root-override trans y) -4915.2) - (set-vector! (-> obj root-override scale) 1.5 1.0 1.5 1.0) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj master) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-log-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (logior! (-> this draw status) (draw-status hidden)) + (+! (-> this root-override trans x) -1024.0) + (+! (-> this root-override trans y) -4915.2) + (set-vector! (-> this root-override scale) 1.5 1.0 1.5 1.0) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this master) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this draw origin-joint-index) (the-as uint 3)) (go snow-log-wait-for-master) (none) ) @@ -1728,13 +1728,8 @@ ) (go snow-log-button-idle-down) ) - (set! (-> self root-override trans y) (seek-with-smooth - (-> self root-override trans y) - f30-0 - (* 12288.0 (-> *display* seconds-per-frame)) - 0.2 - 204.8 - ) + (set! (-> self root-override trans y) + (seek-with-smooth (-> self root-override trans y) f30-0 (* 12288.0 (seconds-per-frame)) 0.2 204.8) ) ) (suspend) @@ -1756,8 +1751,8 @@ ) ) -(defmethod init-from-entity! snow-log-button ((obj snow-log-button) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-log-button ((this snow-log-button) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1775,24 +1770,24 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-switch-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-switch-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-push! 1 0) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) (transform-post) - (set! (-> obj orig-trans quad) (-> obj root-override trans quad)) - (set! (-> obj log) (entity-actor-lookup arg0 'alt-actor 0)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (set! (-> this log) (entity-actor-lookup arg0 'alt-actor 0)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go snow-log-button-idle-down) (go snow-log-button-idle-up) ) diff --git a/goal_src/jak1/levels/snow/snow-part.gc b/goal_src/jak1/levels/snow/snow-part.gc index 1c69c69255..ec896023c9 100644 --- a/goal_src/jak1/levels/snow/snow-part.gc +++ b/goal_src/jak1/levels/snow/snow-part.gc @@ -725,7 +725,7 @@ (defun snow-bird-bob-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (set! (-> arg2 y) (+ (-> (the-as process-drawable (-> arg1 key proc)) root trans y) - (* -2048.0 (sin (* 218.45334 (the float (mod (-> *display* base-frame-counter) 300))))) + (* -2048.0 (sin (* 218.45334 (the float (mod (current-time) 300))))) ) ) 0 diff --git a/goal_src/jak1/levels/snow/snow-ram-boss.gc b/goal_src/jak1/levels/snow/snow-ram-boss.gc index 3dbcf06e4c..3cdfdf3fd8 100644 --- a/goal_src/jak1/levels/snow/snow-ram-boss.gc +++ b/goal_src/jak1/levels/snow/snow-ram-boss.gc @@ -456,21 +456,21 @@ :parts ((sp-item 1914)) ) -(defmethod projectile-method-24 ram-boss-proj ((obj ram-boss-proj)) +(defmethod projectile-method-24 ram-boss-proj ((this ram-boss-proj)) (with-pp (quaternion-rotate-local-x! - (-> obj root-override quat) - (-> obj root-override quat) - (* 65718.05 (-> *display* seconds-per-frame)) + (-> this root-override quat) + (-> this root-override quat) + (* 65718.05 (seconds-per-frame)) ) (quaternion-rotate-local-y! - (-> obj root-override quat) - (-> obj root-override quat) - (* 32221.867 (-> *display* seconds-per-frame)) + (-> this root-override quat) + (-> this root-override quat) + (* 32221.867 (seconds-per-frame)) ) - (let ((f0-9 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (-> *display* base-frame-counter) 75))))))))) + (let ((f0-9 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (current-time) 75))))))))) (find-ground-and-draw-shadow - (-> obj root-override trans) + (-> this root-override trans) (the-as vector #f) f0-9 (collide-kind background) @@ -479,13 +479,13 @@ 81920.0 ) ) - (if (-> obj launched?) - (spawn (-> obj part2) (the-as vector (-> obj root-override root-prim prim-core))) + (if (-> this launched?) + (spawn (-> this part2) (the-as vector (-> this root-override root-prim prim-core))) ) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) - (set! (-> s5-0 id) (-> obj sound-id)) - (let ((a1-4 (-> obj root-override trans))) + (set! (-> s5-0 id) (-> this sound-id)) + (let ((a1-4 (-> this root-override trans))) (let ((gp-1 pp)) (when (= a1-4 #t) (if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) @@ -520,7 +520,7 @@ s3-2 s5-0 s4-0 - (* (-> arg0 max-turn) (-> *display* seconds-per-frame)) + (* (-> arg0 max-turn) (seconds-per-frame)) (-> arg0 tween) ) (vector-matrix*! s5-0 s5-0 s3-2) @@ -533,14 +533,14 @@ (none) ) -(defmethod projectile-method-25 ram-boss-proj ((obj ram-boss-proj)) +(defmethod projectile-method-25 ram-boss-proj ((this ram-boss-proj)) (go ram-boss-proj-growing) 0 (none) ) -(defmethod projectile-method-26 ram-boss-proj ((obj ram-boss-proj)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod projectile-method-26 ram-boss-proj ((this ram-boss-proj)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) (set! (-> s5-0 no-reaction) @@ -559,59 +559,59 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod projectile-method-27 ram-boss-proj ((obj ram-boss-proj)) - (set! (-> obj charge-sound-id) (new 'static 'sound-id)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 521) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 522) obj)) - (set! (-> obj launched?) #f) - (set! (-> obj growth) 0.0) - (set! (-> obj max-speed) 40960.0) - (set! (-> obj update-velocity) snow-ram-proj-update-velocity) - (set! (-> obj max-turn) 11832.889) - (set! (-> obj tween) 0.02) - (set! (-> obj attack-mode) 'snow-ram-proj) - (set! (-> obj launch-time) (-> *display* base-frame-counter)) - (set! (-> obj timeout) (seconds 4)) - (set! (-> obj sound-id) (sound-play "ramboss-track")) - (let ((v1-12 (-> obj parent-override))) +(defmethod projectile-method-27 ram-boss-proj ((this ram-boss-proj)) + (set! (-> this charge-sound-id) (new 'static 'sound-id)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 521) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 522) this)) + (set! (-> this launched?) #f) + (set! (-> this growth) 0.0) + (set! (-> this max-speed) 40960.0) + (set! (-> this update-velocity) snow-ram-proj-update-velocity) + (set! (-> this max-turn) 11832.889) + (set! (-> this tween) 0.02) + (set! (-> this attack-mode) 'snow-ram-proj) + (set-time! (-> this launch-time)) + (set! (-> this timeout) (seconds 4)) + (set! (-> this sound-id) (sound-play "ramboss-track")) + (let ((v1-12 (-> this parent-override))) (set! (-> v1-12 0 proj-stoked) #t) (set! (-> v1-12 0 proj-status) (the-as uint 1)) ) (none) ) -(defmethod deactivate ram-boss-proj ((obj ram-boss-proj)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate ram-boss-proj ((this ram-boss-proj)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type projectile deactivate) obj) + ((method-of-type projectile deactivate) this) (none) ) -(defmethod relocate ram-boss-proj ((obj ram-boss-proj) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate ram-boss-proj ((this ram-boss-proj) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as ram-boss-proj ((method-of-type projectile relocate) obj arg0)) + (the-as ram-boss-proj ((method-of-type projectile relocate) this arg0)) ) -(defmethod projectile-method-28 ram-boss-proj ((obj ram-boss-proj)) +(defmethod projectile-method-28 ram-boss-proj ((this ram-boss-proj)) (when (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) ) - (let ((gp-0 (-> obj target))) + (let ((gp-0 (-> this target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (+! (-> gp-0 y) 4915.2) - (let ((f0-2 (vector-vector-distance gp-0 (-> obj root-override trans))) + (let ((f0-2 (vector-vector-distance gp-0 (-> this root-override trans))) (a2-0 (new 'stack-no-clear 'vector)) ) (if (>= 0.0 f0-2) @@ -619,8 +619,8 @@ ) (set! (-> a2-0 quad) (-> *target* control transv quad)) (set! (-> a2-0 y) 0.0) - (let ((f0-3 (/ f0-2 (* 40960.0 (-> *display* seconds-per-frame))))) - (vector+float*! gp-0 gp-0 a2-0 (* f0-3 (-> *display* seconds-per-frame))) + (let ((f0-3 (/ f0-2 (* 40960.0 (seconds-per-frame))))) + (vector+float*! gp-0 gp-0 a2-0 (* f0-3 (seconds-per-frame))) ) ) ) @@ -656,9 +656,7 @@ (cond ((-> gp-1 0 proj-stoked) (set! (-> gp-1 0 proj-stoked) #f) - (set! (-> self growth) - (seek-with-smooth (-> self growth) 1.0 (* 1.25 (-> *display* seconds-per-frame)) 0.8 0.01) - ) + (set! (-> self growth) (seek-with-smooth (-> self growth) 1.0 (* 1.25 (seconds-per-frame)) 0.8 0.01)) (if (>= (-> self growth) 1.0) (set! (-> gp-1 0 proj-status) (the-as uint 2)) (set! (-> gp-1 0 proj-status) (the-as uint 1)) @@ -688,7 +686,7 @@ (set! (-> self launched?) #t) (set! (-> self growth) 1.0) (logior! (-> self root-override root-prim prim-core action) (collide-action solid)) - (set! (-> self launch-time) (-> *display* base-frame-counter)) + (set-time! (-> self launch-time)) (vector-float*! (-> self root-override transv) (-> self parent-override 0 proj-launch-vec) 40960.0) (set! (-> self target quad) (-> (target-pos 0) quad)) (+! (-> self target y) 4915.2) @@ -950,7 +948,7 @@ ) ) ((= (-> arg3 param 0) 'die) - (let* ((v1-73 (- (-> *display* base-frame-counter) (-> (the-as ram-boss-proj v1-66) launch-time))) + (let* ((v1-73 (- (current-time) (-> (the-as ram-boss-proj v1-66) launch-time))) (v1-74 (the-as int (- (seconds 4) v1-73))) ) (cond @@ -976,26 +974,26 @@ ) ) -(defmethod deactivate ram-boss ((obj ram-boss)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate ram-boss ((this ram-boss)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type nav-enemy deactivate) obj) + ((method-of-type nav-enemy deactivate) this) (none) ) -(defmethod relocate ram-boss ((obj ram-boss) (arg0 int)) - (if (nonzero? (-> obj shield-jmod)) - (&+! (-> obj shield-jmod) arg0) +(defmethod relocate ram-boss ((this ram-boss) (arg0 int)) + (if (nonzero? (-> this shield-jmod)) + (&+! (-> this shield-jmod) arg0) ) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as ram-boss ((method-of-type nav-enemy relocate) obj arg0)) + (the-as ram-boss ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod initialize-collision ram-boss ((obj ram-boss)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision ram-boss ((this ram-boss)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1041,14 +1039,14 @@ (set! (-> s5-0 nav-radius) 10240.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod ram-boss-method-52 ram-boss ((obj ram-boss)) - (let ((v1-1 (the-as basic (-> obj collide-info root-prim)))) +(defmethod ram-boss-method-52 ram-boss ((this ram-boss)) + (let ((v1-1 (the-as basic (-> this collide-info root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-1) local-sphere) 0.0 8192.0 0.0 13516.8) (set-vector! (-> (the-as (array collide-shape-prim) v1-1) 16 local-sphere) 0.0 4096.0 0.0 4505.6) (set-vector! (-> (the-as (array collide-shape-prim) v1-1) 17 local-sphere) 0.0 9830.4 0.0 4505.6) @@ -1068,8 +1066,8 @@ ) ) -(defmethod nav-enemy-method-53 ram-boss ((obj ram-boss)) - (let ((v1-1 (the-as (array collide-shape-prim) (-> obj collide-info root-prim)))) +(defmethod nav-enemy-method-53 ram-boss ((this ram-boss)) + (let ((v1-1 (the-as (array collide-shape-prim) (-> this collide-info root-prim)))) (let ((a0-1 (-> v1-1 16))) (set! (-> a0-1 prim-core offense) (collide-offense touch)) ) @@ -1089,27 +1087,27 @@ (the-as symbol 0) ) -(defmethod nav-enemy-method-48 ram-boss ((obj ram-boss)) - (initialize-skeleton obj *ram-boss-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (init-defaults! obj *ram-boss-nav-enemy-info*) - (logclear! (-> obj enemy-info options) (fact-options has-power-cell)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 525) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 574) obj)) - (set! (-> obj shield-jmod) (new 'process 'joint-mod-set-local obj 32 #f #f #t)) - (set! (-> obj shield-jmod enable) #f) - (set! (-> obj has-shield?) #t) - (when (nonzero? (-> obj entity extra perm user-int8 1)) - (set! (-> obj has-shield?) #f) - (init-jm! obj *ram-boss-nav-enemy-info-no-shield*) - (let ((v1-23 (-> obj shield-jmod))) +(defmethod nav-enemy-method-48 ram-boss ((this ram-boss)) + (initialize-skeleton this *ram-boss-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (init-defaults! this *ram-boss-nav-enemy-info*) + (logclear! (-> this enemy-info options) (fact-options has-power-cell)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 525) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 574) this)) + (set! (-> this shield-jmod) (new 'process 'joint-mod-set-local this 32 #f #f #t)) + (set! (-> this shield-jmod enable) #f) + (set! (-> this has-shield?) #t) + (when (nonzero? (-> this entity extra perm user-int8 1)) + (set! (-> this has-shield?) #f) + (init-jm! this *ram-boss-nav-enemy-info-no-shield*) + (let ((v1-23 (-> this shield-jmod))) (set! (-> v1-23 enable) #t) (set! (-> v1-23 transform scale quad) (the-as uint128 0)) ) ) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) 0 (none) ) @@ -1118,7 +1116,7 @@ (set! (-> self dead?) #f) (set! (-> self proj-status) (the-as uint 0)) (set! (-> self proj-stoked) #f) - (set! (-> self proj-last-thrown-time) (-> *display* base-frame-counter)) + (set-time! (-> self proj-last-thrown-time)) (set-vector! (-> self local-throw-point) 10456.269 9961.882 1510.6049 1.0) (set! (-> self frustration) 0) (set! (-> self nav-enemy-patrol-timeout) (seconds 1)) @@ -1145,22 +1143,22 @@ (none) ) -(defmethod nav-enemy-method-54 ram-boss ((obj ram-boss) (arg0 vector)) - (let ((a2-0 (-> obj node-list data 18 bone transform))) +(defmethod nav-enemy-method-54 ram-boss ((this ram-boss) (arg0 vector)) + (let ((a2-0 (-> this node-list data 18 bone transform))) (set-vector! arg0 0.0 0.0 -2457.6 1.0) (vector-matrix*! arg0 arg0 a2-0) ) (the-as symbol (vector-float*! arg0 arg0 (/ 1.0 (-> arg0 w)))) ) -(defmethod nav-enemy-method-55 ram-boss ((obj ram-boss)) +(defmethod nav-enemy-method-55 ram-boss ((this ram-boss)) (if (not *target*) (return #f) ) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> obj collide-info trans quad)) + (set! (-> s5-0 quad) (-> this collide-info trans quad)) (+! (-> s5-0 y) 8192.0) (set! (-> s4-0 quad) (-> (target-pos 0) quad)) (+! (-> s4-0 y) 4915.2) @@ -1172,7 +1170,7 @@ s4-0 1228.8 (collide-kind background cak-2 ground-object) - obj + this t2-0 (new 'static 'pat-surface :noentity #x1) ) @@ -1189,8 +1187,8 @@ ) ) -(defmethod ram-boss-method-51 ram-boss ((obj ram-boss) (arg0 vector)) - (let* ((f30-0 (quaternion-y-angle (-> obj collide-info quat))) +(defmethod ram-boss-method-51 ram-boss ((this ram-boss) (arg0 vector)) + (let* ((f30-0 (quaternion-y-angle (-> this collide-info quat))) (f0-2 (atan (-> arg0 x) (-> arg0 z))) (f0-3 (deg- f30-0 f0-2)) ) @@ -1204,34 +1202,34 @@ #t ) -(defmethod set-jump-height-factor! ram-boss ((obj ram-boss) (arg0 int)) +(defmethod set-jump-height-factor! ram-boss ((this ram-boss) (arg0 int)) (cond - ((zero? (-> obj proj-status)) - (when (and *target* (>= (- (-> *display* base-frame-counter) (-> obj proj-last-thrown-time)) (seconds 2))) + ((zero? (-> this proj-status)) + (when (and *target* (time-elapsed? (-> this proj-last-thrown-time) (seconds 2))) (when arg0 - (set! (-> obj proj-stoked) #t) + (set! (-> this proj-stoked) #t) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (the-as uint128 0)) (let ((v1-9 (process-spawn ram-boss-proj :init projectile-init-by-other - (-> obj entity) - (-> obj collide-info trans) + (-> this entity) + (-> this collide-info trans) s5-0 0 (process->handle *target*) - :to obj + :to this ) ) ) - (set! (-> (the-as (pointer ram-boss-proj) v1-9) 0 notify-handle) (process->handle obj)) + (set! (-> (the-as (pointer ram-boss-proj) v1-9) 0 notify-handle) (process->handle this)) ) ) ) ) ) (else - (set! (-> obj proj-stoked) #t) + (set! (-> this proj-stoked) #t) ) ) (none) @@ -1327,7 +1325,7 @@ (set! (-> self collide-info transv y) 102400.0) ) :trans (behavior () - (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) @@ -1473,7 +1471,7 @@ (if (>= 18432.0 f30-0) (go ram-boss-tracking) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (not (target-in-range? self (-> self nav-info stop-chase-distance))) (go-virtual nav-enemy-patrol) ) @@ -1484,12 +1482,12 @@ ) (cond ((logtest? (nav-control-flags navcf17) (-> self nav flags)) - (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) + (if (time-elapsed? (-> self free-time) (seconds 1)) (go-virtual nav-enemy-patrol) ) ) (else - (set! (-> self free-time) (-> *display* base-frame-counter)) + (set-time! (-> self free-time)) ) ) 0 @@ -1505,11 +1503,11 @@ ) ) -(defmethod ram-boss-method-57 ram-boss ((obj ram-boss) (arg0 float)) +(defmethod ram-boss-method-57 ram-boss ((this ram-boss) (arg0 float)) (let ((f0-0 0.0)) (when *target* (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s3-0 (target-pos 0) (-> obj collide-info trans)) + (vector-! s3-0 (target-pos 0) (-> this collide-info trans)) (let ((f0-1 (vector-x-angle s3-0))) (set! f0-0 (* 0.000091552734 f0-1)) ) @@ -1533,15 +1531,12 @@ (defstate ram-boss-tracking (ram-boss) :event ram-boss-on-ground-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self facing-y) (quaternion-y-angle (-> self collide-info quat))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) ) :trans (behavior () - (set-jump-height-factor! - self - (the-as int (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.75))) - ) + (set-jump-height-factor! self (the-as int (time-elapsed? (-> self state-time) (seconds 0.75)))) (if (not *target*) (go-virtual nav-enemy-patrol) ) @@ -1555,7 +1550,7 @@ ) ) (f30-0 (-> self facing-y)) - (f0-6 (deg-seek-smooth f30-0 (-> self player-dir-y) (* v1-13 (-> *display* seconds-per-frame)) 0.25)) + (f0-6 (deg-seek-smooth f30-0 (-> self player-dir-y) (* v1-13 (seconds-per-frame)) 0.25)) (f0-7 (deg- f0-6 f30-0)) ) (cond @@ -1594,7 +1589,7 @@ (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (time-elapsed? (-> self state-time) (seconds 0.2)) ) (let ((gp-2 (new 'stack-no-clear 'vector)) (s5-2 (new 'stack-no-clear 'vector)) @@ -1750,7 +1745,7 @@ (set! gp-0 (-> gp-0 0 brother)) ) ) - (set! (-> self proj-last-thrown-time) (-> *display* base-frame-counter)) + (set-time! (-> self proj-last-thrown-time)) ) :trans (behavior () (set-jump-height-factor! self (the-as int #t)) diff --git a/goal_src/jak1/levels/snow/snow-ram.gc b/goal_src/jak1/levels/snow/snow-ram.gc index 0b92d81e6d..a4158db773 100644 --- a/goal_src/jak1/levels/snow/snow-ram.gc +++ b/goal_src/jak1/levels/snow/snow-ram.gc @@ -107,62 +107,62 @@ ) ) -(defmethod ram-method-20 ram ((obj ram)) - (let ((gp-0 (-> obj part))) +(defmethod ram-method-20 ram ((this ram)) + (let ((gp-0 (-> this part))) (when (nonzero? gp-0) - (let ((a2-0 (-> obj node-list data 8 bone transform)) + (let ((a2-0 (-> this node-list data 8 bone transform)) (s5-0 (new 'stack-no-clear 'vector)) ) (set-vector! s5-0 0.0 0.0 -49152.0 1.0) (vector-matrix*! s5-0 s5-0 a2-0) - (set! (-> *part-id-table* 1920 init-specs 16 initial-valuef) (+ 16384.0 (-> obj orient-ry))) + (set! (-> *part-id-table* 1920 init-specs 16 initial-valuef) (+ 16384.0 (-> this orient-ry))) (spawn gp-0 s5-0) ) ) ) ) -(defmethod ram-method-21 ram ((obj ram)) - (let ((gp-0 (-> obj part2))) +(defmethod ram-method-21 ram ((this ram)) + (let ((gp-0 (-> this part2))) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s3-0 (-> obj node-list data 5)) + (vector<-cspace! s3-0 (-> this node-list data 5)) (set-vector! s4-0 13312.0 -5324.8 0.0 1.0) - (vector-rotate-around-y! s4-0 s4-0 (-> obj orient-ry)) + (vector-rotate-around-y! s4-0 s4-0 (-> this orient-ry)) (vector+! s4-0 s4-0 s3-0) (spawn gp-0 s4-0) (set-vector! s4-0 -13312.0 -5324.8 0.0 1.0) - (vector-rotate-around-y! s4-0 s4-0 (-> obj orient-ry)) + (vector-rotate-around-y! s4-0 s4-0 (-> this orient-ry)) (vector+! s4-0 s4-0 s3-0) (spawn gp-0 s4-0) ) (let ((s3-1 (new 'stack-no-clear 'vector)) (s4-1 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s3-1 (-> obj node-list data 6)) + (vector<-cspace! s3-1 (-> this node-list data 6)) (set-vector! s4-1 13312.0 -5324.8 0.0 1.0) - (vector-rotate-around-y! s4-1 s4-1 (-> obj orient-ry)) + (vector-rotate-around-y! s4-1 s4-1 (-> this orient-ry)) (vector+! s4-1 s4-1 s3-1) (spawn gp-0 s4-1) (set-vector! s4-1 -13312.0 -5324.8 0.0 1.0) - (vector-rotate-around-y! s4-1 s4-1 (-> obj orient-ry)) + (vector-rotate-around-y! s4-1 s4-1 (-> this orient-ry)) (vector+! s4-1 s4-1 s3-1) (spawn gp-0 s4-1) ) ) ) -(defmethod ram-method-22 ram ((obj ram)) - (process-entity-status! obj (entity-perm-status complete) #t) - (let ((v1-0 (alt-actor-list-subtask-incomplete-count obj))) +(defmethod ram-method-22 ram ((this ram)) + (process-entity-status! this (entity-perm-status complete) #t) + (let ((v1-0 (alt-actor-list-subtask-incomplete-count this))) (cond ((zero? v1-0) - (let ((v1-3 (-> obj entity extra perm))) + (let ((v1-3 (-> this entity extra perm))) (logior! (-> v1-3 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-3 user-int8 2) 1) ) - (if (not (task-complete? *game-info* (-> obj entity extra perm task))) + (if (not (task-complete? *game-info* (-> this entity extra perm task))) (return #t) ) ) @@ -325,25 +325,25 @@ ) ) -(defmethod deactivate ram ((obj ram)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate ram ((this ram)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod relocate ram ((obj ram) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate ram ((this ram) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as ram ((method-of-type process-drawable relocate) obj arg0)) + (the-as ram ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod init-from-entity! ram ((obj ram) (arg0 entity-actor)) - (set! (-> obj give-fuel-cell?) #f) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! ram ((this ram) (arg0 entity-actor)) + (set! (-> this give-fuel-cell?) #f) + (set! (-> this link) (new 'process 'actor-link-info this)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -385,58 +385,58 @@ ) (set! (-> s4-0 nav-radius) 20480.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ram-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ram-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-post) - (update-transforms! (-> obj root-override)) - (set! (-> obj orient-ry) (quaternion-y-angle (-> obj root-override quat))) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 526) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 527) obj)) - (set! (-> obj ram-id) (res-lump-value arg0 'extra-id int)) - (case (-> obj ram-id) + (update-transforms! (-> this root-override)) + (set! (-> this orient-ry) (quaternion-y-angle (-> this root-override quat))) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 526) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 527) this)) + (set! (-> this ram-id) (res-lump-value arg0 'extra-id int)) + (case (-> this ram-id) ((1) - (set! (-> obj give-fuel-cell-anim) + (set! (-> this give-fuel-cell-anim) (new 'static 'spool-anim :name "snowcam-ram-boss-in-cave-fuel-cell" :index 7 :parts 1 :command-list '()) ) - (set-vector! (-> obj fuel-cell-dest-pos) 3137396.8 803676.2 -13560558.0 1.0) + (set-vector! (-> this fuel-cell-dest-pos) 3137396.8 803676.2 -13560558.0 1.0) ) ((2) - (set! (-> obj give-fuel-cell-anim) + (set! (-> this give-fuel-cell-anim) (new 'static 'spool-anim :name "snowcam-ram-boss-ice-pond-fuel-cell" :index 8 :parts 1 :command-list '()) ) - (set-vector! (-> obj fuel-cell-dest-pos) 2790289.5 1058152.5 -13639766.0 1.0) + (set-vector! (-> this fuel-cell-dest-pos) 2790289.5 1058152.5 -13639766.0 1.0) ) ((3) - (set! (-> obj give-fuel-cell-anim) + (set! (-> this give-fuel-cell-anim) (new 'static 'spool-anim :name "snowcam-ram-boss-snow-ball-fuel-cell" :index 9 :parts 1 :command-list '()) ) - (set-vector! (-> obj fuel-cell-dest-pos) 4208423.0 1037348.9 -13591491.0 1.0) + (set-vector! (-> this fuel-cell-dest-pos) 4208423.0 1037348.9 -13591491.0 1.0) ) (else - (set! (-> obj give-fuel-cell-anim) #f) + (set! (-> this give-fuel-cell-anim) #f) ) ) (let ((s4-1 #f)) - (if (nonzero? (-> obj entity extra perm user-int8 0)) + (if (nonzero? (-> this entity extra perm user-int8 0)) (set! s4-1 #t) ) (let ((s3-1 (= (res-lump-value arg0 'mode uint128) 1))) (when (not s3-1) - (when (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (set! s3-1 #t) - (if (and (nonzero? (-> obj entity extra perm user-int8 2)) - (not (task-complete? *game-info* (-> obj entity extra perm task))) + (if (and (nonzero? (-> this entity extra perm user-int8 2)) + (not (task-complete? *game-info* (-> this entity extra perm task))) ) (birth-pickup-at-point - (-> obj fuel-cell-dest-pos) + (-> this fuel-cell-dest-pos) (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) + (the float (-> this entity extra perm task)) #f - obj + this (the-as fact-info #f) ) ) @@ -447,11 +447,11 @@ ((and (not s3-1) (has-nav-mesh? arg0)) (cond (s4-1 - (process-spawn ram-boss (-> obj entity) obj #t :to obj) + (process-spawn ram-boss (-> this entity) this #t :to this) (go ram-fun-idle) ) (else - (process-spawn ram-boss (-> obj entity) obj #f :to obj) + (process-spawn ram-boss (-> this entity) this #f :to this) (go ram-idle) ) ) diff --git a/goal_src/jak1/levels/snow/target-ice.gc b/goal_src/jak1/levels/snow/target-ice.gc index 47e0fe4f22..f96c630380 100644 --- a/goal_src/jak1/levels/snow/target-ice.gc +++ b/goal_src/jak1/levels/snow/target-ice.gc @@ -112,7 +112,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (seek! (-> self control unknown-float81) 0.0 (-> *display* seconds-per-frame)) + (seek! (-> self control unknown-float81) 0.0 (seconds-per-frame)) (suspend) (ja :num! (seek!)) ) @@ -162,7 +162,7 @@ (defstate target-ice-walk (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *walk-mods*) ) :exit (behavior () @@ -182,7 +182,7 @@ ) (pad-buttons l1 r1) ) - (and (>= (- (-> *display* base-frame-counter) (-> *TARGET-bank* wheel-timeout)) (-> self control unknown-dword30)) + (and (time-elapsed? (-> *TARGET-bank* wheel-timeout) (-> self control unknown-dword30)) (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?)) ) ) @@ -288,7 +288,7 @@ (loop (suspend) (let* ((s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control unknown-vector01) 1.0)) - ;; modified to avoid dividing by zero when jak's speed is 0. + ;; og:preserve-this modified to avoid dividing by zero when jak's speed is 0. ;; this fixes the issue where jak gets stuck on frame 60 of the ice-walk animation ;; instead of switching to stance (due to making zero progress here), ;; _and_ it fixes the issue where we get a NaN frame number in daxter, causing the eye animation @@ -297,6 +297,7 @@ (gp-6 (vector-float*! (new 'stack-no-clear 'vector) (-> self control unknown-vector00) + ;; og:preserve-this (/ 1.0 (if (= vector01-len 0) 0.001 vector01-len)) ;; added the .001 case here. ) ) diff --git a/goal_src/jak1/levels/snow/yeti.gc b/goal_src/jak1/levels/snow/yeti.gc index 9a0dcd3995..46dd85e8e4 100644 --- a/goal_src/jak1/levels/snow/yeti.gc +++ b/goal_src/jak1/levels/snow/yeti.gc @@ -216,7 +216,7 @@ :event yeti-slave-default-event-handler :enter (behavior () (nav-enemy-neck-control-inactive) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (-> self nav-info move-to-ground) (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) ) @@ -471,8 +471,8 @@ ) ) -(defmethod initialize-collision yeti-slave ((obj yeti-slave)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision yeti-slave ((this yeti-slave)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -512,36 +512,36 @@ (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod nav-enemy-method-48 yeti-slave ((obj yeti-slave)) - (initialize-skeleton obj *yeti-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (init-defaults! obj *yeti-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 yeti-slave ((this yeti-slave)) + (initialize-skeleton this *yeti-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (init-defaults! this *yeti-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) -(defmethod deactivate yeti-slave ((obj yeti-slave)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate yeti-slave ((this yeti-slave)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod relocate yeti-slave ((obj yeti-slave) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(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)) obj arg0)) + (the-as yeti-slave ((the-as (function nav-enemy int nav-enemy) (find-parent-method yeti-slave 7)) this arg0)) ) (defbehavior yeti-slave-init-by-other yeti-slave ((arg0 entity) (arg1 yeti) (arg2 vector) (arg3 vector) (arg4 symbol)) @@ -560,8 +560,8 @@ (none) ) -(defmethod aggro? yeti ((obj yeti) (arg0 vector)) - (let ((s5-0 (the-as (pointer process-tree) (-> obj child-process)))) +(defmethod aggro? yeti ((this yeti) (arg0 vector)) + (let ((s5-0 (the-as (pointer process-tree) (-> this child-process)))) (while s5-0 (if (< (vector-vector-xz-distance-squared arg0 (-> (the-as (pointer yeti-slave) s5-0) 0 collide-info trans)) 603979800.0 @@ -579,8 +579,8 @@ #t ) -(defmethod yeti-method-20 yeti ((obj yeti) (arg0 vector) (arg1 vector)) - (let ((s3-0 (-> obj path curve num-cverts))) +(defmethod yeti-method-20 yeti ((this yeti) (arg0 vector) (arg1 vector)) + (let ((s3-0 (-> this path curve num-cverts))) (if (<= s3-0 0) (return #f) ) @@ -588,8 +588,8 @@ (s2-0 s3-0) ) (while (> s2-0 0) - (eval-path-curve-div! (-> obj path) arg0 (the float s1-0) 'interp) - (when (aggro? obj arg0) + (eval-path-curve-div! (-> this path) arg0 (the float s1-0) 'interp) + (when (aggro? this arg0) (cond (*target* (vector-! arg1 (target-pos 0) arg0) @@ -668,12 +668,12 @@ ) (when (< v1-1 (-> self desired-num-children)) (set! (-> self spawn-delay) (rand-vu-int-range 150 1200)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) ) ) (else - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self spawn-delay)) + (when (time-elapsed? (-> self state-time) (-> self spawn-delay)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -691,16 +691,16 @@ ) ) -(defmethod init-from-entity! yeti ((obj yeti) (arg0 entity-actor)) - (set! (-> obj spawn-delay) 0) - (set! (-> obj root) (new 'process 'trsqv)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj desired-num-children) - (res-lump-value arg0 'num-lurkers int :default (the-as uint128 (-> obj path curve num-cverts))) +(defmethod init-from-entity! yeti ((this yeti) (arg0 entity-actor)) + (set! (-> this spawn-delay) 0) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (process-drawable-from-entity! this arg0) + (set! (-> this desired-num-children) + (res-lump-value arg0 'num-lurkers int :default (the-as uint128 (-> this path curve num-cverts))) ) - (set! (-> obj first-time-spawn-dist) (res-lump-float arg0 'notice-dist :default 204800.0)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this first-time-spawn-dist) (res-lump-float arg0 'notice-dist :default 204800.0)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go yeti-resuming-start) (go yeti-first-time-start) ) diff --git a/goal_src/jak1/levels/sunken/bully.gc b/goal_src/jak1/levels/sunken/bully.gc index 30c470e364..b6cc6bf961 100644 --- a/goal_src/jak1/levels/sunken/bully.gc +++ b/goal_src/jak1/levels/sunken/bully.gc @@ -318,7 +318,7 @@ (set! (-> self hit-player?) #t) (set! (-> self bounced?) #t) (set! (-> self bounce-volume) 100) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-time! (-> self hit-player-time)) (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) ) ) @@ -363,7 +363,7 @@ (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + (time-elapsed? (-> self hit-player-time) (seconds 0.05)) ) ) ) @@ -374,7 +374,7 @@ (none) ) -(defmethod bully-method-20 bully ((obj bully)) +(defmethod bully-method-20 bully ((this bully)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -382,17 +382,17 @@ ) (init-vf0-vector) (set-vector! - (-> obj root-override transv) - (* (sin (-> obj travel-ry)) (-> obj travel-speed)) + (-> this root-override transv) + (* (sin (-> this travel-ry)) (-> this travel-speed)) 0.0 - (* (cos (-> obj travel-ry)) (-> obj travel-speed)) + (* (cos (-> this travel-ry)) (-> this travel-speed)) 1.0 ) (let ((s5-1 #f)) - (nav-control-method-28 (-> obj nav) (collide-kind wall-object ground-object)) - (let ((v1-4 (-> obj nav travel))) - (.lvf vf1 (&-> (-> obj root-override transv) quad)) - (let ((f0-8 (-> *display* seconds-per-frame))) + (nav-control-method-28 (-> this nav) (collide-kind wall-object ground-object)) + (let ((v1-4 (-> this nav travel))) + (.lvf vf1 (&-> (-> this root-override transv) quad)) + (let ((f0-8 (seconds-per-frame))) (.mov at-0 f0-8) ) (.mov vf2 at-0) @@ -401,54 +401,54 @@ (.svf (&-> v1-4 quad) vf1) ) (let ((s4-0 (new 'stack-no-clear 'check-vector-collision-with-nav-spheres-info))) - (when (>= (nav-control-method-23 (-> obj nav) (-> obj nav travel) s4-0) 0.0) + (when (>= (nav-control-method-23 (-> this nav) (-> this nav travel) s4-0) 0.0) (let ((s5-2 (new 'stack-no-clear 'vector))) (set! (-> s5-2 quad) (-> s4-0 normal quad)) (set! (-> s5-2 y) 0.0) (vector-normalize! s5-2 1.0) - (vector-reflect! (-> obj root-override transv) (-> obj root-override transv) s5-2) + (vector-reflect! (-> this root-override transv) (-> this root-override transv) s5-2) ) - (set! (-> obj travel-ry) (atan (-> obj root-override transv x) (-> obj root-override transv z))) - (+! (-> obj travel-ry) (rand-vu-float-range -910.2222 910.2222)) - (vector-reset! (-> obj root-override transv)) + (set! (-> this travel-ry) (atan (-> this root-override transv x) (-> this root-override transv z))) + (+! (-> this travel-ry) (rand-vu-float-range -910.2222 910.2222)) + (vector-reset! (-> this root-override transv)) (set! s5-1 #t) - (set! (-> obj bounced?) #t) - (set! (-> obj bounce-volume) 100) + (set! (-> this bounced?) #t) + (set! (-> this bounce-volume) 100) ) ) (when (not s5-1) - (vector-normalize-copy! (-> obj nav travel) (-> obj root-override transv) 2048.0) + (vector-normalize-copy! (-> this nav travel) (-> this root-override transv) 2048.0) (let ((s5-3 (new 'stack 'clip-travel-vector-to-mesh-return-info))) - (nav-control-method-24 (-> obj nav) 2048.0 s5-3) + (nav-control-method-24 (-> this nav) 2048.0 s5-3) (when (and (-> s5-3 found-boundary) - (>= (* (-> obj travel-speed) (-> *display* seconds-per-frame)) - (vector-vector-xz-distance (-> s5-3 intersection) (-> obj root-override trans)) + (>= (* (-> this travel-speed) (seconds-per-frame)) + (vector-vector-xz-distance (-> s5-3 intersection) (-> this root-override trans)) ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) (vector-negate! s4-1 (-> s5-3 boundary-normal)) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) - (vector-reflect! (-> obj root-override transv) (-> obj root-override transv) s4-1) + (vector-reflect! (-> this root-override transv) (-> this root-override transv) s4-1) ) - (set! (-> obj travel-ry) (atan (-> obj root-override transv x) (-> obj root-override transv z))) - (+! (-> obj travel-ry) (rand-vu-float-range -910.2222 910.2222)) - (vector-reset! (-> obj root-override transv)) + (set! (-> this travel-ry) (atan (-> this root-override transv x) (-> this root-override transv z))) + (+! (-> this travel-ry) (rand-vu-float-range -910.2222 910.2222)) + (vector-reset! (-> this root-override transv)) #t - (set! (-> obj bounced?) #t) - (set! (-> obj bounce-volume) 60) + (set! (-> this bounced?) #t) + (set! (-> this bounce-volume) 60) ) ) ) ) - (set! (-> obj root-override transv y) (+ -36864.0 (-> obj root-override transv y))) + (set! (-> this root-override transv y) (+ -36864.0 (-> this root-override transv y))) ) ) (defstate bully-idle (bully) :event bully-default-event-handler :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self reaction-delay) (rand-vu-int-range 0 (seconds 0.35))) (set! (-> self travel-speed) 0.0) (shut-down! (-> self neck)) @@ -468,7 +468,7 @@ (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-delay)) + (time-elapsed? (-> self state-time) (-> self reaction-delay)) ) (start-hint-timer (text-id sunken-bully-dive-hint)) (go bully-notice) @@ -516,7 +516,7 @@ ) (until (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) (ja :num! (seek!)) - (+! (-> self root-override transv y) (* -545996.8 (-> *display* seconds-per-frame))) + (+! (-> self root-override transv y) (* -545996.8 (seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self root-override) (-> self root-override transv) @@ -548,8 +548,8 @@ (defstate bully-start-spinning (bully) :event bully-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self start-spin-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) + (set-time! (-> self start-spin-time)) (set! (-> self slow-down) (rand-vu-int-range (seconds 4) (seconds 8))) (set! (-> self speed-u) 0.2) (set! (-> self bounced?) #f) @@ -575,19 +575,19 @@ (set-target! (-> self neck) (target-pos 5)) ) (cond - ((>= (- (-> *display* base-frame-counter) (-> self start-spin-time)) (-> self slow-down)) - (seek! (-> self speed-u) 0.0 (* 0.5555556 (-> *display* seconds-per-frame))) + ((time-elapsed? (-> self start-spin-time) (-> self slow-down)) + (seek! (-> self speed-u) 0.0 (* 0.5555556 (seconds-per-frame))) (if (= (-> self speed-u) 0.0) (go bully-stop-spinning) ) ) (else - (seek! (-> self speed-u) 1.0 (* 0.5555556 (-> *display* seconds-per-frame))) + (seek! (-> self speed-u) 1.0 (* 0.5555556 (seconds-per-frame))) ) ) (set! (-> self spin-vel) (* 196608.0 (-> self speed-u))) (set! (-> self travel-speed) (* 41779.2 (-> self speed-u))) - (+! (-> self facing-ry) (* (-> self spin-vel) (-> *display* seconds-per-frame))) + (+! (-> self facing-ry) (* (-> self spin-vel) (seconds-per-frame))) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self facing-ry)) (bully-method-20 self) (integrate-for-enemy-with-move-to-ground! @@ -641,7 +641,7 @@ (defstate bully-stop-spinning (bully) :event bully-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self reaction-delay) (rand-vu-int-range (seconds 2) (seconds 3))) (set! (-> self travel-speed) 0.0) (set! (-> self bounced?) #f) @@ -663,7 +663,7 @@ (local-vars (v1-17 symbol) (v1-35 symbol)) (let ((gp-0 2)) (ja-channel-push! 1 (seconds 0.2)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-delay)) + (until (time-elapsed? (-> self state-time) (-> self reaction-delay)) (cond ((>= gp-0 0) (+! gp-0 -1) @@ -730,24 +730,24 @@ :post transform-post ) -(defmethod relocate bully ((obj bully) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method bully 7)) this arg0) ) ) -(defmethod init-from-entity! bully ((obj bully) (arg0 entity-actor)) - (set! (-> obj hit-player?) #f) - (set! (-> obj bounced?) #f) - (set! (-> obj bounce-volume) 100) - (set! (-> obj spin-vel) 0.0) - (set! (-> obj travel-speed) 0.0) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! bully ((this bully) (arg0 entity-actor)) + (set! (-> this hit-player?) #f) + (set! (-> this bounced?) #f) + (set! (-> this bounce-volume) 100) + (set! (-> this spin-vel) 0.0) + (set! (-> this travel-speed) 0.0) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -779,22 +779,22 @@ ) (set! (-> s4-0 nav-radius) 7680.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj root-override event-self) 'touched) - (set! (-> obj root-override event-other) 'touch) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *bully-sg* '()) - (set! (-> obj draw shadow-ctrl) *bully-shadow-control*) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 454) obj)) - (set! (-> obj fact-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this root-override event-self) 'touched) + (set! (-> this root-override event-other) 'touch) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *bully-sg* '()) + (set! (-> this draw shadow-ctrl) *bully-shadow-control*) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 454) this)) + (set! (-> this fact-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (let ((v1-49 (new 'process 'joint-mod (joint-mod-handler-mode reset) obj 5))) - (set! (-> obj neck) v1-49) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) + (let ((v1-49 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 5))) + (set! (-> this neck) v1-49) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) (set! (-> v1-49 up) (the-as uint 1)) (set! (-> v1-49 nose) (the-as uint 2)) (set! (-> v1-49 ear) (the-as uint 0)) @@ -802,10 +802,10 @@ (set! (-> v1-49 ignore-angle) 16384.0) ) (transform-post) - (if (not (move-to-ground (-> obj root-override) 12288.0 40960.0 #t (collide-kind background))) + (if (not (move-to-ground (-> this root-override) 12288.0 40960.0 #t (collide-kind background))) (go process-drawable-art-error "no ground") ) - (set! (-> obj facing-ry) (quaternion-y-angle (-> obj root-override quat))) + (set! (-> this facing-ry) (quaternion-y-angle (-> this root-override quat))) (go bully-idle #t) (none) ) diff --git a/goal_src/jak1/levels/sunken/double-lurker.gc b/goal_src/jak1/levels/sunken/double-lurker.gc index 13e3cd2c94..c3840d8fe0 100644 --- a/goal_src/jak1/levels/sunken/double-lurker.gc +++ b/goal_src/jak1/levels/sunken/double-lurker.gc @@ -346,7 +346,7 @@ (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn)) ) @@ -387,15 +387,15 @@ ) ) -(defmethod nav-enemy-method-51 double-lurker-top ((obj double-lurker-top)) - (restore-collide-with-as (-> obj collide-info)) - (logior! (-> obj collide-info nav-flags) (nav-flags navf0)) - (nav-control-method-27 (-> obj nav)) +(defmethod nav-enemy-method-51 double-lurker-top ((this double-lurker-top)) + (restore-collide-with-as (-> this collide-info)) + (logior! (-> this collide-info nav-flags) (nav-flags navf0)) + (nav-control-method-27 (-> this nav)) (none) ) -(defmethod initialize-collision double-lurker-top ((obj double-lurker-top)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision double-lurker-top ((this double-lurker-top)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -458,22 +458,22 @@ ) (set! (-> s5-0 nav-radius) 9011.2) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) - (clear-collide-with-as (-> obj collide-info)) + (clear-collide-with-as (-> this collide-info)) (none) ) -(defmethod nav-enemy-method-48 double-lurker-top ((obj double-lurker-top)) - (initialize-skeleton obj *double-lurker-top-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (init-defaults! obj *double-lurker-top-nav-enemy-info*) - (let ((v1-5 (-> obj parent-process))) - (set! (-> obj collide-info trans quad) (-> v1-5 0 collide-info trans quad)) - (set-vector! (-> obj collide-info scale) 1.0 1.0 1.0 1.0) - (quaternion-copy! (-> obj collide-info quat) (-> v1-5 0 collide-info quat)) +(defmethod nav-enemy-method-48 double-lurker-top ((this double-lurker-top)) + (initialize-skeleton this *double-lurker-top-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (init-defaults! this *double-lurker-top-nav-enemy-info*) + (let ((v1-5 (-> this parent-process))) + (set! (-> this collide-info trans quad) (-> v1-5 0 collide-info trans quad)) + (set-vector! (-> this collide-info scale) 1.0 1.0 1.0 1.0) + (quaternion-copy! (-> this collide-info quat) (-> v1-5 0 collide-info quat)) ) - (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) + (logclear! (-> this collide-info nav-flags) (nav-flags navf0)) (none) ) @@ -511,7 +511,7 @@ (local-vars (v0-0 object)) (case arg2 (('touch) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) (touch-handler self arg0 arg3) ) (('attack) @@ -599,7 +599,7 @@ (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn)) ) @@ -690,17 +690,15 @@ (vf2 :class vf) ) (init-vf0-vector) - (let* ((f0-3 - (seek-with-smooth (-> self knocked-back-speed) 0.0 (* 49152.0 (-> *display* seconds-per-frame)) 0.5 0.01) - ) - (f30-0 (* f0-3 (-> *display* seconds-per-frame))) + (let* ((f0-3 (seek-with-smooth (-> self knocked-back-speed) 0.0 (* 49152.0 (seconds-per-frame)) 0.5 0.01)) + (f30-0 (* f0-3 (seconds-per-frame))) ) (set! (-> self knocked-back-speed) f0-3) (vector-float*! (-> self collide-info transv) (-> self hit-from-dir) f0-3) (when (< 0.0 f0-3) (let ((v1-7 (-> self nav travel))) (.lvf vf1 (&-> (-> self collide-info transv) quad)) - (let ((f0-4 (-> *display* seconds-per-frame))) + (let ((f0-4 (seconds-per-frame))) (.mov at-0 f0-4) ) (.mov vf2 at-0) @@ -755,15 +753,15 @@ :post nav-enemy-simple-post ) -(defmethod nav-enemy-method-52 double-lurker ((obj double-lurker) (arg0 vector)) - (nav-control-method-28 (-> obj nav) (the-as collide-kind -1)) +(defmethod nav-enemy-method-52 double-lurker ((this double-lurker) (arg0 vector)) + (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) (let ((a1-2 (new 'stack-no-clear 'vector))) - (vector-float*! a1-2 (-> obj hit-from-dir) 22937.602) - (vector+! a1-2 a1-2 (-> obj collide-info trans)) - (nav-control-method-13 (-> obj nav) a1-2 (-> obj hit-from-dir)) + (vector-float*! a1-2 (-> this hit-from-dir) 22937.602) + (vector+! a1-2 a1-2 (-> this collide-info trans)) + (nav-control-method-13 (-> this nav) a1-2 (-> this hit-from-dir)) ) - (when (>= (vector-xz-length (-> obj nav travel)) 18841.602) - (vector+! arg0 (-> obj collide-info trans) (-> obj nav travel)) + (when (>= (vector-xz-length (-> this nav travel)) 18841.602) + (vector+! arg0 (-> this collide-info trans) (-> this nav travel)) (let ((a1-5 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'collide-tri-result)) ) @@ -775,7 +773,7 @@ (new 'static 'vector :y -40960.0 :w 1.0) 40.96 (collide-kind background) - obj + this s4-0 (new 'static 'pat-surface :noentity #x1) ) @@ -832,17 +830,15 @@ (vf2 :class vf) ) (init-vf0-vector) - (let* ((f0-3 - (seek-with-smooth (-> self knocked-back-speed) 0.0 (* 49152.0 (-> *display* seconds-per-frame)) 0.5 0.01) - ) - (f30-0 (* f0-3 (-> *display* seconds-per-frame))) + (let* ((f0-3 (seek-with-smooth (-> self knocked-back-speed) 0.0 (* 49152.0 (seconds-per-frame)) 0.5 0.01)) + (f30-0 (* f0-3 (seconds-per-frame))) ) (set! (-> self knocked-back-speed) f0-3) (vector-float*! (-> self collide-info transv) (-> self hit-from-dir) f0-3) (when (< 0.0 f0-3) (let ((v1-7 (-> self nav travel))) (.lvf vf1 (&-> (-> self collide-info transv) quad)) - (let ((f0-4 (-> *display* seconds-per-frame))) + (let ((f0-4 (seconds-per-frame))) (.mov at-0 f0-4) ) (.mov vf2 at-0) @@ -907,14 +903,14 @@ ) ) -(defmethod double-lurker-method-53 double-lurker ((obj double-lurker) (arg0 vector)) - (let* ((s3-0 (-> obj path curve num-cverts)) +(defmethod double-lurker-method-53 double-lurker ((this double-lurker) (arg0 vector)) + (let* ((s3-0 (-> this path curve num-cverts)) (s4-0 (rand-vu-int-count s3-0)) ) (while (nonzero? s3-0) (+! s3-0 -1) - (eval-path-curve-div! (-> obj path) arg0 (the float s4-0) 'interp) - (if (not (nav-enemy-method-50 obj arg0)) + (eval-path-curve-div! (-> this path) arg0 (the float s4-0) 'interp) + (if (not (nav-enemy-method-50 this arg0)) (return #t) ) ) @@ -922,8 +918,8 @@ #f ) -(defmethod initialize-collision double-lurker ((obj double-lurker)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision double-lurker ((this double-lurker)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1010,13 +1006,13 @@ ) (set! (-> s5-0 nav-radius) 9830.4) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) s5-0 ) ) -(defmethod nav-enemy-method-51 double-lurker ((obj double-lurker)) - (let ((v1-1 (-> obj collide-info root-prim))) +(defmethod nav-enemy-method-51 double-lurker ((this double-lurker)) + (let ((v1-1 (-> this collide-info root-prim))) (let ((a0-1 0)) (dotimes (a1-0 3) (let ((a2-2 (-> (the-as collide-shape-prim-group v1-1) prims a0-1))) @@ -1040,68 +1036,68 @@ (none) ) -(defmethod nav-enemy-method-48 double-lurker ((obj double-lurker)) - (set! (-> obj buddy-handle) (the-as handle #f)) - (process-drawable-from-entity! obj (-> obj entity)) - (set! (-> obj align) (new 'process 'align-control obj)) - (initialize-skeleton obj *double-lurker-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj buddy-on-shoulders?) #t) - (set! (-> obj dead?) #f) - (set! (-> obj buddy-dead?) #f) - (let ((v1-7 (-> obj entity extra perm))) +(defmethod nav-enemy-method-48 double-lurker ((this double-lurker)) + (set! (-> this buddy-handle) (the-as handle #f)) + (process-drawable-from-entity! this (-> this entity)) + (set! (-> this align) (new 'process 'align-control this)) + (initialize-skeleton this *double-lurker-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (set! (-> this buddy-on-shoulders?) #t) + (set! (-> this dead?) #f) + (set! (-> this buddy-dead?) #f) + (let ((v1-7 (-> this entity extra perm))) (if (nonzero? (-> v1-7 user-int8 2)) - (set! (-> obj buddy-on-shoulders?) #f) + (set! (-> this buddy-on-shoulders?) #f) ) (when (nonzero? (-> v1-7 user-int8 0)) - (set! (-> obj dead?) #t) - (set! (-> obj buddy-on-shoulders?) #f) + (set! (-> this dead?) #t) + (set! (-> this buddy-on-shoulders?) #f) ) (when (nonzero? (-> v1-7 user-int8 1)) - (set! (-> obj buddy-dead?) #t) - (set! (-> obj buddy-on-shoulders?) #f) + (set! (-> this buddy-dead?) #t) + (set! (-> this buddy-on-shoulders?) #f) ) ) - (init-defaults! obj *double-lurker-when-both-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set-vector! (-> obj neck twist-max) 12743.111 12743.111 0.0 1.0) - (when (not (-> obj buddy-dead?)) + (init-defaults! this *double-lurker-when-both-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set-vector! (-> this neck twist-max) 12743.111 12743.111 0.0 1.0) + (when (not (-> this buddy-dead?)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (not (-> obj buddy-on-shoulders?)) - (when (not (double-lurker-method-53 obj s5-0)) - (set! (-> obj buddy-on-shoulders?) #t) - (let ((v1-29 (-> obj entity extra perm))) + (when (not (-> this buddy-on-shoulders?)) + (when (not (double-lurker-method-53 this s5-0)) + (set! (-> this buddy-on-shoulders?) #t) + (let ((v1-29 (-> this entity extra perm))) (logior! (-> v1-29 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-29 user-int8 2) 0) ) 0 ) ) - (if (-> obj buddy-on-shoulders?) - (set! (-> s5-0 quad) (-> obj collide-info trans quad)) + (if (-> this buddy-on-shoulders?) + (set! (-> s5-0 quad) (-> this collide-info trans quad)) ) - (set! (-> obj buddy-handle) + (set! (-> this buddy-handle) (ppointer->handle - (process-spawn double-lurker-top (-> obj entity) obj (-> obj buddy-on-shoulders?) s5-0 :to obj) + (process-spawn double-lurker-top (-> this entity) this (-> this buddy-on-shoulders?) s5-0 :to this) ) ) ) ) - (when (and (not (-> obj dead?)) (not (-> obj buddy-on-shoulders?))) - (nav-enemy-method-51 obj) - (init-jm! obj *double-lurker-nav-enemy-info*) + (when (and (not (-> this dead?)) (not (-> this buddy-on-shoulders?))) + (nav-enemy-method-51 this) + (init-jm! this *double-lurker-nav-enemy-info*) ) (none) ) -(defmethod init-from-entity! double-lurker ((obj double-lurker) (arg0 entity-actor)) - (initialize-collision obj) - (nav-enemy-method-48 obj) - (if (-> obj dead?) +(defmethod init-from-entity! double-lurker ((this double-lurker) (arg0 entity-actor)) + (initialize-collision this) + (nav-enemy-method-48 this) + (if (-> this dead?) (go double-lurker-waiting-to-die) - (go (method-of-object obj nav-enemy-idle)) + (go (method-of-object this nav-enemy-idle)) ) (none) ) diff --git a/goal_src/jak1/levels/sunken/floating-launcher.gc b/goal_src/jak1/levels/sunken/floating-launcher.gc index b7f9ac0f2e..ca7643f19e 100644 --- a/goal_src/jak1/levels/sunken/floating-launcher.gc +++ b/goal_src/jak1/levels/sunken/floating-launcher.gc @@ -65,7 +65,7 @@ ) (let ((f30-0 1.0)) (while (!= f30-0 0.0) - (set! f30-0 (seek f30-0 0.0 (-> *display* seconds-per-frame))) + (set! f30-0 (seek f30-0 0.0 (seconds-per-frame))) (eval-path-curve-div! (-> self path) (-> self basetrans) f30-0 'interp) (set! (-> self launcher 0 root-override trans quad) (-> self basetrans quad)) (update-transforms! (-> self launcher 0 root-override)) @@ -87,9 +87,9 @@ :post plat-post ) -(defmethod init-from-entity! floating-launcher ((obj floating-launcher) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! floating-launcher ((this floating-launcher) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -107,20 +107,20 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (eval-path-curve-div! (-> obj path) (-> obj root-override trans) 1.0 'interp) + (process-drawable-from-entity! this arg0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (eval-path-curve-div! (-> this path) (-> this root-override trans) 1.0 'interp) (let ((f30-0 (res-lump-float arg0 'spring-height :default 163840.0))) - (set! (-> obj launcher) (process-spawn launcher (-> obj root-override trans) f30-0 0 81920.0 :to obj)) + (set! (-> this launcher) (process-spawn launcher (-> this root-override trans) f30-0 0 81920.0 :to this)) ) - (initialize-skeleton obj *floating-launcher-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (set! (-> obj trigger-height) (res-lump-float arg0 'trigger-height)) + (initialize-skeleton this *floating-launcher-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (set! (-> this trigger-height) (res-lump-float arg0 'trigger-height)) (go floating-launcher-idle) (none) ) diff --git a/goal_src/jak1/levels/sunken/helix-water.gc b/goal_src/jak1/levels/sunken/helix-water.gc index 7874d2f722..b3811611b8 100644 --- a/goal_src/jak1/levels/sunken/helix-water.gc +++ b/goal_src/jak1/levels/sunken/helix-water.gc @@ -174,8 +174,8 @@ ) ) -(defmethod init-from-entity! helix-slide-door ((obj helix-slide-door) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! helix-slide-door ((this helix-slide-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -187,23 +187,23 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *helix-slide-door-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *helix-slide-door-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (set! *helix-slide-door* obj) + (update-transforms! (-> this root-override)) + (set! *helix-slide-door* this) (go helix-slide-door-idle-open) (none) ) @@ -309,7 +309,7 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (when *target* (let ((gp-1 (new 'stack-no-clear 'vector))) (vector-! gp-1 (-> self root-override trans) (target-pos 0)) @@ -322,7 +322,7 @@ ) ) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.5)) + (until (time-elapsed? (-> self state-time) (seconds 1.5)) (suspend) ) (level-hint-spawn (text-id sunken-helix-hint) "sksp0124" (the-as entity #f) *entity-pool* (game-task none)) @@ -335,8 +335,8 @@ (f0-2 (-> self root-override trans y)) (a1-11 (new 'stack-no-clear 'vector)) ) - (let* ((f1-1 (+ f1-0 (* -737280.0 (-> *display* seconds-per-frame)))) - (f0-3 (+ f0-2 (* f1-1 (-> *display* seconds-per-frame)))) + (let* ((f1-1 (+ f1-0 (* -737280.0 (seconds-per-frame)))) + (f0-3 (+ f0-2 (* f1-1 (seconds-per-frame)))) ) (when (>= (-> self down-y) f0-3) (set! f0-3 (-> self down-y)) @@ -352,12 +352,12 @@ (suspend) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.25)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1.25)) (suspend) ) (sound-play "maindoor") - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.9)) + (until (time-elapsed? (-> self state-time) (seconds 1.9)) (suspend) ) (let ((a1-13 (new 'stack-no-clear 'event-message-block))) @@ -375,7 +375,7 @@ ) ) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3.5)) + (until (time-elapsed? (-> self state-time) (seconds 3.5)) (suspend) ) (let ((a1-14 (new 'stack-no-clear 'event-message-block))) @@ -400,10 +400,10 @@ *entity-pool* (game-task none) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (suspend) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (send-event *target* 'play-anim 'shock-out) (send-event *target* 'neck 1.0 (-> self my-door extra trans)) (suspend) @@ -470,8 +470,8 @@ (f0-0 (-> self root-override trans y)) (a1-5 (new 'stack-no-clear 'vector)) ) - (let* ((f1-1 (+ f1-0 (* -737280.0 (-> *display* seconds-per-frame)))) - (f0-1 (+ f0-0 (* f1-1 (-> *display* seconds-per-frame)))) + (let* ((f1-1 (+ f1-0 (* -737280.0 (seconds-per-frame)))) + (f0-1 (+ f0-0 (* f1-1 (seconds-per-frame)))) ) (when (>= (-> self down-y) f0-1) (set! f0-1 (-> self down-y)) @@ -500,11 +500,11 @@ ) ) -(defmethod init-from-entity! helix-button ((obj helix-button) (arg0 entity-actor)) - (set! (-> obj fcell-handle) (the-as handle #f)) - (set! (-> obj my-water) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj my-door) (entity-actor-lookup arg0 'alt-actor 1)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! helix-button ((this helix-button) (arg0 entity-actor)) + (set! (-> this fcell-handle) (the-as handle #f)) + (set! (-> this my-water) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this my-door) (entity-actor-lookup arg0 'alt-actor 1)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -522,37 +522,37 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *helix-button-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *helix-button-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) - (set! (-> obj spawn-trans quad) (-> obj root-override trans quad)) - (+! (-> obj root-override trans y) -26624.0) - (set! (-> obj down-y) (+ -6553.6 (-> obj root-override trans y))) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this spawn-trans quad) (-> this root-override trans quad)) + (+! (-> this root-override trans y) -26624.0) + (set! (-> this down-y) (+ -6553.6 (-> this root-override trans y))) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (ja-post) - (update-transforms! (-> obj root-override)) - (set! *helix-button* obj) + (update-transforms! (-> this root-override)) + (set! *helix-button* this) (go helix-button-startup) (none) ) -(defmethod helix-water-method-21 helix-water ((obj helix-water)) - (let ((s5-0 (+ (-> obj last-alt-actor-consumed) 1))) - (when (< s5-0 (-> obj alt-actors length)) - (let* ((v1-5 (-> obj alt-actors s5-0)) +(defmethod helix-water-method-21 helix-water ((this helix-water)) + (let ((s5-0 (+ (-> this last-alt-actor-consumed) 1))) + (when (< s5-0 (-> this alt-actors length)) + (let* ((v1-5 (-> this alt-actors s5-0)) (s4-0 (if v1-5 (-> v1-5 extra process) ) @@ -562,11 +562,11 @@ ) ) ) - (+ -1638.4 (-> obj root trans y)) + (+ -1638.4 (-> this root trans y)) (cond (a0-3 - (when (< (-> (the-as process-drawable a0-3) root trans y) (-> obj root trans y)) - (set! (-> obj last-alt-actor-consumed) s5-0) + (when (< (-> (the-as process-drawable a0-3) root trans y) (-> this root trans y)) + (set! (-> this last-alt-actor-consumed) s5-0) (case (-> a0-3 type) ((babak) (send-event a0-3 'instant-death) @@ -581,7 +581,7 @@ ) ) (else - (set! (-> obj last-alt-actor-consumed) s5-0) + (set! (-> this last-alt-actor-consumed) s5-0) s5-0 ) ) @@ -627,7 +627,7 @@ ) ) :trans (behavior () - (seek! (-> self root scale y) 0.8 (* 0.667 (-> *display* seconds-per-frame))) + (seek! (-> self root scale y) 0.8 (* 0.667 (seconds-per-frame))) (when *target* (let ((f0-4 (-> (target-pos 0) y))) (when (not (logtest? (-> *target* state-flags) (state-flags grabbed))) @@ -648,7 +648,7 @@ ) ) ) - (+! (-> self root trans y) (* (-> self transv-y) (-> *display* seconds-per-frame))) + (+! (-> self root trans y) (* (-> self transv-y) (seconds-per-frame))) (if (< (-> self end-y) (-> self root trans y)) (set! (-> self root trans y) (-> self end-y)) ) @@ -665,33 +665,35 @@ :post ja-post ) -(defmethod relocate helix-water ((obj helix-water) (arg0 int)) - (if (nonzero? (-> obj alt-actors)) - (&+! (-> obj alt-actors) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method helix-water 7)) this arg0) ) ) -(defmethod init-from-entity! helix-water ((obj helix-water) (arg0 entity-actor)) - (set! (-> obj last-alt-actor-consumed) -1) - (set! (-> obj transv-y) 9216.0) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj start-y) (+ -49152.0 (-> obj root trans y))) - (set! (-> obj end-y) (+ 851968.0 (-> obj start-y))) - (set-vector! (-> obj root scale) 1.0 0.8 1.0 1.0) +(defmethod init-from-entity! helix-water ((this helix-water) (arg0 entity-actor)) + (set! (-> this last-alt-actor-consumed) -1) + (set! (-> this transv-y) 9216.0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this start-y) (+ -49152.0 (-> this root trans y))) + (set! (-> this end-y) (+ 851968.0 (-> this start-y))) + (set-vector! (-> this root scale) 1.0 0.8 1.0 1.0) (let ((s4-0 (entity-actor-count arg0 'alt-actor))) - (set! (-> obj alt-actors) (new 'process 'boxed-array entity-actor s4-0)) + (set! (-> this alt-actors) (new 'process 'boxed-array entity-actor s4-0)) (dotimes (s3-0 s4-0) - (set! (-> obj alt-actors s3-0) (entity-actor-lookup arg0 'alt-actor s3-0)) + (set! (-> this alt-actors s3-0) (entity-actor-lookup arg0 'alt-actor s3-0)) ) ) - (set! (-> obj root trans y) (-> obj start-y)) - (set! (-> obj dark-eco) (process-spawn helix-dark-eco :init water-vol-init-by-other (-> obj entity) :to obj)) - (set! *helix-water* obj) + (set! (-> this root trans y) (-> this start-y)) + (set! (-> this dark-eco) + (process-spawn helix-dark-eco :init water-vol-init-by-other (-> this entity) :to this) + ) + (set! *helix-water* this) (go helix-water-idle) (none) ) diff --git a/goal_src/jak1/levels/sunken/orbit-plat.gc b/goal_src/jak1/levels/sunken/orbit-plat.gc index e38679b318..5ded55f481 100644 --- a/goal_src/jak1/levels/sunken/orbit-plat.gc +++ b/goal_src/jak1/levels/sunken/orbit-plat.gc @@ -137,7 +137,7 @@ ) ) -(defmethod orbit-plat-bottom-method-20 orbit-plat-bottom ((obj orbit-plat-bottom) (arg0 vector) (arg1 vector)) +(defmethod orbit-plat-bottom-method-20 orbit-plat-bottom ((this orbit-plat-bottom) (arg0 vector) (arg1 vector)) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) (f30-0 (vector-length s5-1)) ) @@ -228,18 +228,18 @@ :post ja-post ) -(defmethod relocate orbit-plat-bottom ((obj orbit-plat-bottom) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate orbit-plat-bottom ((this orbit-plat-bottom) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as orbit-plat-bottom ((method-of-type process-drawable relocate) obj arg0)) + (the-as orbit-plat-bottom ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate orbit-plat-bottom ((obj orbit-plat-bottom)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate orbit-plat-bottom ((this orbit-plat-bottom)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -350,13 +350,13 @@ :post plat-post ) -(defmethod orbit-plat-method-28 orbit-plat ((obj orbit-plat)) - (when (>= (- (-> *display* base-frame-counter) (-> obj state-time)) (the int (* 300.0 (-> obj timeout)))) +(defmethod orbit-plat-method-28 orbit-plat ((this orbit-plat)) + (when (time-elapsed? (-> this state-time) (the int (* 300.0 (-> this timeout)))) (cond (*target* (let ((s5-0 (target-pos 0))) - (if (or (>= (vector-vector-xz-distance s5-0 (-> obj root-override trans)) 102400.0) - (>= (- (-> obj root-override trans y) (-> s5-0 y)) 16384.0) + (if (or (>= (vector-vector-xz-distance s5-0 (-> this root-override trans)) 102400.0) + (>= (- (-> this root-override trans y) (-> s5-0 y)) 16384.0) ) (return #t) ) @@ -384,7 +384,7 @@ :trans plat-trans :code (behavior () (set! (-> self plat-status) (the-as uint 0)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-no-eval :num! (seek! 0.0)) (until (orbit-plat-method-28 self) (when (nonzero? (-> self root-override riders num-riders)) @@ -457,7 +457,7 @@ (set! (-> s2-0 x) (* arg4 (-> s5-0 z))) (set! (-> s2-0 y) 0.0) (set! (-> s2-0 z) (- (* arg4 (-> s5-0 x)))) - (vector-normalize! s2-0 (* arg5 (-> *display* seconds-per-frame))) + (vector-normalize! s2-0 (* arg5 (seconds-per-frame))) (+! (-> s5-0 x) (-> s2-0 x)) (+! (-> s5-0 z) (-> s2-0 z)) ) @@ -476,7 +476,7 @@ (if (< arg3 f0-0) (set! f0-0 arg3) ) - (vector-normalize! (-> arg1 nav travel) (* f0-0 (-> *display* seconds-per-frame))) + (vector-normalize! (-> arg1 nav travel) (* f0-0 (seconds-per-frame))) ) (set! (-> arg0 x) (+ (-> arg1 root-override trans x) (-> arg1 nav travel x))) (set! (-> arg0 y) (-> arg1 root-override trans x)) @@ -544,9 +544,9 @@ ) ;; WARN: disable def twice: 132. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod orbit-plat-method-27 orbit-plat ((obj orbit-plat)) +(defmethod orbit-plat-method-27 orbit-plat ((this orbit-plat)) (local-vars (v0-11 object)) - (let* ((v1-0 (-> obj other)) + (let* ((v1-0 (-> this other)) (s5-0 (if v1-0 (-> v1-0 extra process) ) @@ -557,27 +557,27 @@ (cond ((and s5-0 (< (vector-vector-xz-distance (the-as vector (&-> s5-0 stack 96)) (the-as vector (&-> s5-0 stack 128))) - (vector-vector-xz-distance (-> obj basetrans) (-> obj reset-trans)) + (vector-vector-xz-distance (-> this basetrans) (-> this reset-trans)) ) ) (cond ((-> (the-as orbit-plat s5-0) is-reset?) - (when (!= (-> obj plat-status) 2) - (set! (-> obj plat-status) (the-as uint 2)) + (when (!= (-> this plat-status) 2) + (set! (-> this plat-status) (the-as uint 2)) (let ((f30-1 (atan - (- (-> obj basetrans x) (-> (the-as orbit-plat s5-0) basetrans x)) - (- (-> obj basetrans z) (-> (the-as orbit-plat s5-0) basetrans z)) + (- (-> this basetrans x) (-> (the-as orbit-plat s5-0) basetrans x)) + (- (-> this basetrans z) (-> (the-as orbit-plat s5-0) basetrans z)) ) ) (f0-9 (atan - (- (-> obj reset-trans x) (-> (the-as orbit-plat s5-0) basetrans x)) - (- (-> obj reset-trans z) (-> (the-as orbit-plat s5-0) basetrans z)) + (- (-> this reset-trans x) (-> (the-as orbit-plat s5-0) basetrans x)) + (- (-> this reset-trans z) (-> (the-as orbit-plat s5-0) basetrans z)) ) ) ) (if (>= (deg- f0-9 f30-1) 0.0) - (set! (-> obj rot-dir) 1.0) - (set! (-> obj rot-dir) -1.0) + (set! (-> this rot-dir) 1.0) + (set! (-> this rot-dir) -1.0) ) ) ) @@ -587,7 +587,7 @@ (s5-1 (new 'stack-no-clear 'vector)) ) (let ((v1-9 s4-0) - (a1-5 (-> obj other)) + (a1-5 (-> this other)) ) (set! (-> v1-9 quad) (-> (the-as orbit-plat (if a1-5 (-> a1-5 extra process) @@ -599,36 +599,36 @@ ) ) ) - (vector-! a0-7 (-> obj basetrans) s4-0) + (vector-! a0-7 (-> this basetrans) s4-0) (let ((f30-2 (vector-length a0-7))) - (get-rotate-point! s5-1 s4-0 (-> obj basetrans) (the-as vector f30-2) (-> obj rot-dir) 40960.0) + (get-rotate-point! s5-1 s4-0 (-> this basetrans) (the-as vector f30-2) (-> this rot-dir) 40960.0) (cond - ((nav-control-method-16 (-> obj nav) s5-1) - (set! (-> obj basetrans quad) (-> s5-1 quad)) + ((nav-control-method-16 (-> this nav) s5-1) + (set! (-> this basetrans quad) (-> s5-1 quad)) ) (else - (set! (-> obj rot-dir) (- (-> obj rot-dir))) - (get-rotate-point! s5-1 s4-0 (-> obj basetrans) (the-as vector f30-2) (-> obj rot-dir) 40960.0) - (if (nav-control-method-16 (-> obj nav) s5-1) - (set! (-> obj basetrans quad) (-> s5-1 quad)) + (set! (-> this rot-dir) (- (-> this rot-dir))) + (get-rotate-point! s5-1 s4-0 (-> this basetrans) (the-as vector f30-2) (-> this rot-dir) 40960.0) + (if (nav-control-method-16 (-> this nav) s5-1) + (set! (-> this basetrans quad) (-> s5-1 quad)) ) ) ) ) ) ) - (when (>= 614.4 (vector-vector-xz-distance (-> obj basetrans) (-> obj reset-trans))) - (set! v0-11 (logior (nav-control-flags navcf19) (-> obj nav flags))) - (set! (-> obj nav flags) (the-as nav-control-flags v0-11)) + (when (>= 614.4 (vector-vector-xz-distance (-> this basetrans) (-> this reset-trans))) + (set! v0-11 (logior (nav-control-flags navcf19) (-> this nav flags))) + (set! (-> this nav flags) (the-as nav-control-flags v0-11)) v0-11 ) ) (else (let ((s5-2 (new 'stack-no-clear 'vector))) (let ((s4-1 (new 'stack-no-clear 'vector))) - (get-nav-point! s5-2 obj (-> obj reset-trans) 40960.0) + (get-nav-point! s5-2 this (-> this reset-trans) 40960.0) (let ((v1-20 s4-1) - (a0-19 (-> obj other)) + (a0-19 (-> this other)) ) (set! (-> v1-20 quad) (-> (the-as orbit-plat (if a0-19 (-> a0-19 extra process) @@ -642,36 +642,36 @@ ) (set! (-> s5-2 y) (-> s4-1 y)) (vector-! s5-2 s5-2 s4-1) - (vector-normalize! s5-2 (-> obj reset-length)) + (vector-normalize! s5-2 (-> this reset-length)) (vector+! s5-2 s5-2 s4-1) - (when (not (nav-control-method-16 (-> obj nav) s5-2)) - (logclear! (-> obj nav flags) (nav-control-flags navcf19)) - (get-rotate-point! s5-2 s4-1 (-> obj basetrans) (the-as vector (-> obj reset-length)) 0.0 40960.0) - (when (not (nav-control-method-16 (-> obj nav) s5-2)) + (when (not (nav-control-method-16 (-> this nav) s5-2)) + (logclear! (-> this nav flags) (nav-control-flags navcf19)) + (get-rotate-point! s5-2 s4-1 (-> this basetrans) (the-as vector (-> this reset-length)) 0.0 40960.0) + (when (not (nav-control-method-16 (-> this nav) s5-2)) (get-rotate-point! s5-2 s4-1 - (-> obj basetrans) - (the-as vector (-> obj reset-length)) - (-> obj rot-dir) + (-> this basetrans) + (the-as vector (-> this reset-length)) + (-> this rot-dir) 40960.0 ) - (when (not (nav-control-method-16 (-> obj nav) s5-2)) - (set! (-> obj rot-dir) (- (-> obj rot-dir))) + (when (not (nav-control-method-16 (-> this nav) s5-2)) + (set! (-> this rot-dir) (- (-> this rot-dir))) (get-rotate-point! s5-2 s4-1 - (-> obj basetrans) - (the-as vector (-> obj reset-length)) - (-> obj rot-dir) + (-> this basetrans) + (the-as vector (-> this reset-length)) + (-> this rot-dir) 40960.0 ) ) ) ) ) - (set! (-> s5-2 y) (-> obj basetrans y)) - (set! v0-11 (-> obj basetrans)) + (set! (-> s5-2 y) (-> this basetrans y)) + (set! v0-11 (-> this basetrans)) (set! (-> (the-as vector v0-11) quad) (-> s5-2 quad)) ) v0-11 @@ -680,9 +680,9 @@ ) (else (let ((s5-3 (new 'stack-no-clear 'vector))) - (set! (-> s5-3 quad) (-> obj basetrans quad)) - (get-nav-point! (-> obj basetrans) obj (-> obj reset-trans) 40960.0) - (set! (-> obj basetrans y) (-> s5-3 y)) + (set! (-> s5-3 quad) (-> this basetrans quad)) + (get-nav-point! (-> this basetrans) this (-> this reset-trans) 40960.0) + (set! (-> this basetrans y) (-> s5-3 y)) ) ) ) @@ -759,10 +759,10 @@ :post ja-post ) -(defmethod init-from-entity! orbit-plat ((obj orbit-plat) (arg0 entity-actor)) - (set! (-> obj plat-status) (the-as uint 0)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! orbit-plat ((this orbit-plat) (arg0 entity-actor)) + (set! (-> this plat-status) (the-as uint 0)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -780,35 +780,35 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *orbit-plat-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *orbit-plat-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj nav gap-event) 'blocked) - (set! (-> obj other) (entity-actor-lookup arg0 'alt-actor 0)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this nav gap-event) 'blocked) + (set! (-> this other) (entity-actor-lookup arg0 'alt-actor 0)) (let ((f0-7 (res-lump-float arg0 'scale :default 1.0))) - (set-vector! (-> obj root-override scale) f0-7 f0-7 f0-7 1.0) + (set-vector! (-> this root-override scale) f0-7 f0-7 f0-7 1.0) ) - (set! (-> obj timeout) (res-lump-float arg0 'timeout :default 10.0)) - (set! (-> obj rot-dir) 1.0) - (set! (-> obj reset-trans quad) (-> obj basetrans quad)) - (set! (-> obj is-reset?) #t) - (process-spawn orbit-plat-bottom (-> obj entity) obj :to obj) + (set! (-> this timeout) (res-lump-float arg0 'timeout :default 10.0)) + (set! (-> this rot-dir) 1.0) + (set! (-> this reset-trans quad) (-> this basetrans quad)) + (set! (-> this is-reset?) #t) + (process-spawn orbit-plat-bottom (-> this entity) this :to this) (go orbit-plat-wait-for-other) (none) ) diff --git a/goal_src/jak1/levels/sunken/puffer.gc b/goal_src/jak1/levels/sunken/puffer.gc index d270382a66..131f703770 100644 --- a/goal_src/jak1/levels/sunken/puffer.gc +++ b/goal_src/jak1/levels/sunken/puffer.gc @@ -112,7 +112,7 @@ (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-time! (-> self hit-player-time)) (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) ) ) @@ -127,7 +127,7 @@ (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + (time-elapsed? (-> self hit-player-time) (seconds 0.05)) ) ) ) @@ -138,17 +138,17 @@ (none) ) -(defmethod puffer-method-28 puffer ((obj puffer)) +(defmethod puffer-method-28 puffer ((this puffer)) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result)) (a1-0 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> obj root-override trans quad)) + (set! (-> a1-0 quad) (-> this root-override trans quad)) (set-vector! a2-0 0.0 -40960.0 0.0 1.0) (cond ((>= (fill-and-probe-using-line-sphere @@ -157,27 +157,27 @@ a2-0 8192.0 (collide-kind background cak-3 ground-object) - obj + this s5-0 (new 'static 'pat-surface :noentity #x1) ) 0.0 ) - (let ((v1-11 (-> obj draw shadow-ctrl))) + (let ((v1-11 (-> this draw shadow-ctrl))) (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (set! (-> v1-14 settings bot-plane w) (- (+ -12288.0 (-> s5-0 intersect y)))) ) 0 - (let ((v1-17 (-> obj draw shadow-ctrl))) + (let ((v1-17 (-> this draw shadow-ctrl))) (set! (-> v1-17 settings top-plane w) (- (+ 4096.0 (-> s5-0 intersect y)))) ) 0 ) (else - (let ((v1-19 (-> obj draw shadow-ctrl))) + (let ((v1-19 (-> this draw shadow-ctrl))) (logior! (-> v1-19 settings flags) (shadow-flags disable-draw)) ) 0 @@ -186,7 +186,7 @@ ) ) (else - (let ((v1-21 (-> obj draw shadow-ctrl))) + (let ((v1-21 (-> this draw shadow-ctrl))) (logior! (-> v1-21 settings flags) (shadow-flags disable-draw)) ) 0 @@ -195,14 +195,14 @@ (none) ) -(defmethod puffer-method-24 puffer ((obj puffer) (arg0 vector)) - (and (is-in-mesh? (-> obj nav) arg0 11468.8) - (< (-> arg0 y) (+ (-> obj root-override trans y) (-> obj fact-info-override notice-top))) +(defmethod puffer-method-24 puffer ((this puffer) (arg0 vector)) + (and (is-in-mesh? (-> this nav) arg0 11468.8) + (< (-> arg0 y) (+ (-> this root-override trans y) (-> this fact-info-override notice-top))) ) ) -(defmethod puffer-method-22 puffer ((obj puffer)) - (let* ((a1-0 (-> obj buddy)) +(defmethod puffer-method-22 puffer ((this puffer)) + (let* ((a1-0 (-> this buddy)) (v1-0 (if a1-0 (-> a1-0 ppointer 3) ) @@ -210,7 +210,7 @@ ) (if (and v1-0 (>= 25395.2 - (vector-vector-xz-distance (-> obj root-override trans) (-> (the-as process-drawable v1-0) root trans)) + (vector-vector-xz-distance (-> this root-override trans) (-> (the-as process-drawable v1-0) root trans)) ) ) (return #t) @@ -219,20 +219,20 @@ #f ) -(defmethod puffer-method-25 puffer ((obj puffer) (arg0 float)) +(defmethod puffer-method-25 puffer ((this puffer) (arg0 float)) (when *target* (let ((gp-0 (target-pos 0))) (when (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (puffer-method-24 obj gp-0) - (>= (-> gp-0 y) (+ -14336.0 (-> obj attack-bottom-y))) - (>= (+ 2048.0 (-> obj top-y)) (-> gp-0 y)) + (puffer-method-24 this gp-0) + (>= (-> gp-0 y) (+ -14336.0 (-> this attack-bottom-y))) + (>= (+ 2048.0 (-> this top-y)) (-> gp-0 y)) ) - (let ((f30-0 (vector-vector-xz-distance gp-0 (-> obj root-override trans)))) + (let ((f30-0 (vector-vector-xz-distance gp-0 (-> this root-override trans)))) (when (>= arg0 f30-0) - (let* ((a0-4 (-> obj buddy)) + (let* ((a0-4 (-> this buddy)) (v1-12 (if a0-4 (-> a0-4 ppointer 3) ) @@ -274,10 +274,10 @@ ) -(defmethod puffer-method-23 puffer ((obj puffer) (arg0 symbol)) +(defmethod puffer-method-23 puffer ((this puffer) (arg0 symbol)) (local-vars (v1-0 process)) (set! v1-0 (when arg0 - (let ((a0-1 (-> obj buddy))) + (let ((a0-1 (-> this buddy))) (set! v1-0 (if a0-1 (-> a0-1 ppointer 3) ) @@ -291,16 +291,16 @@ ) (cond (arg0 - (let ((s4-0 (-> obj path curve num-cverts)) + (let ((s4-0 (-> this path curve num-cverts)) (s5-0 (new 'stack-no-clear 'inline-array 'vector 5)) ) (set! (-> s5-0 0 x) (the-as float -1)) - (vector-! (-> s5-0 3) (-> obj root-override trans) (-> (the-as process-drawable v1-0) root trans)) + (vector-! (-> s5-0 3) (-> this root-override trans) (-> (the-as process-drawable v1-0) root trans)) (set! (-> s5-0 3 y) 0.0) (vector-normalize! (-> s5-0 3) 1.0) (dotimes (s3-0 s4-0) - (eval-path-curve-div! (-> obj path) (-> s5-0 4) (the float s3-0) 'interp) - (vector-! (-> s5-0 2) (-> s5-0 4) (-> obj root-override trans)) + (eval-path-curve-div! (-> this path) (-> s5-0 4) (the float s3-0) 'interp) + (vector-! (-> s5-0 2) (-> s5-0 4) (-> this root-override trans)) (when (>= (vector-xz-length (-> s5-0 2)) 10240.0) (set! (-> s5-0 2 y) 0.0) (vector-normalize! (-> s5-0 2) 1.0) @@ -316,24 +316,24 @@ ) ) (when (>= (the-as int (-> s5-0 0 x)) 0) - (set! (-> obj dest-pos quad) (-> s5-0 1 quad)) - (set! (-> obj dest-pos y) (-> obj root-override trans y)) + (set! (-> this dest-pos quad) (-> s5-0 1 quad)) + (set! (-> this dest-pos y) (-> this root-override trans y)) (return #t) ) ) ) (else - (let* ((s3-1 (-> obj path curve num-cverts)) + (let* ((s3-1 (-> this path curve num-cverts)) (s4-1 (new 'stack-no-clear 'vector)) (s5-1 (rand-vu-int-count s3-1)) ) (while (nonzero? s3-1) (+! s3-1 -1) - (eval-path-curve-div! (-> obj path) s4-1 (the float s5-1) 'interp) - (when (>= (vector-vector-xz-distance s4-1 (-> obj root-override trans)) 10240.0) - (set! (-> obj dest-pos quad) (-> s4-1 quad)) - (set! (-> obj dest-pos y) (-> obj root-override trans y)) - (set! (-> obj path-index) s5-1) + (eval-path-curve-div! (-> this path) s4-1 (the float s5-1) 'interp) + (when (>= (vector-vector-xz-distance s4-1 (-> this root-override trans)) 10240.0) + (set! (-> this dest-pos quad) (-> s4-1 quad)) + (set! (-> this dest-pos y) (-> this root-override trans y)) + (set! (-> this path-index) s5-1) (return #t) ) ) @@ -343,50 +343,45 @@ #f ) -(defmethod puffer-method-20 puffer ((obj puffer) (arg0 vector)) - (if (-> obj attacking?) - (set! (-> obj travel-speed) - (seek-with-smooth (-> obj travel-speed) 30720.0 (* 8192.0 (-> *display* seconds-per-frame)) 0.125 40.96) +(defmethod puffer-method-20 puffer ((this puffer) (arg0 vector)) + (if (-> this attacking?) + (set! (-> this travel-speed) + (seek-with-smooth (-> this travel-speed) 30720.0 (* 8192.0 (seconds-per-frame)) 0.125 40.96) ) - (set! (-> obj travel-speed) - (seek-with-smooth (-> obj travel-speed) 18432.0 (* 2048.0 (-> *display* seconds-per-frame)) 0.125 40.96) + (set! (-> this travel-speed) + (seek-with-smooth (-> this travel-speed) 18432.0 (* 2048.0 (seconds-per-frame)) 0.125 40.96) ) ) - (nav-control-method-27 (-> obj nav)) - (nav-control-method-28 (-> obj nav) (the-as collide-kind -1)) - (nav-control-method-13 (-> obj nav) arg0 (-> obj root-override transv)) - (let ((f30-0 (* (vector-xz-length (-> obj nav travel)) (-> *display* frames-per-second)))) - (let ((f0-11 (atan (-> obj nav travel x) (-> obj nav travel z))) + (nav-control-method-27 (-> this nav)) + (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) + (nav-control-method-13 (-> this nav) arg0 (-> this root-override transv)) + (let ((f30-0 (* (vector-xz-length (-> this nav travel)) (-> *display* frames-per-second)))) + (let ((f0-11 (atan (-> this nav travel x) (-> this nav travel z))) (s5-1 (new 'stack-no-clear 'vector)) ) - (if (< (-> obj travel-speed) f30-0) - (set! f30-0 (-> obj travel-speed)) + (if (< (-> this travel-speed) f30-0) + (set! f30-0 (-> this travel-speed)) ) - (set! (-> s5-1 quad) (-> obj nav travel quad)) - (set! (-> obj travel-ry) - (deg-seek-smooth - (-> obj travel-ry) - f0-11 - (* (-> obj travel-turn-speed) (-> *display* seconds-per-frame)) - 0.125 - ) + (set! (-> s5-1 quad) (-> this nav travel quad)) + (set! (-> this travel-ry) + (deg-seek-smooth (-> this travel-ry) f0-11 (* (-> this travel-turn-speed) (seconds-per-frame)) 0.125) ) - (let* ((f0-16 (* f30-0 (-> *display* seconds-per-frame))) + (let* ((f0-16 (* f30-0 (seconds-per-frame))) (f28-0 (* 150.0 f0-16)) (f26-0 -1.0) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set-vector! s4-0 (* (sin (-> obj travel-ry)) f28-0) 0.0 (* (cos (-> obj travel-ry)) f28-0) 1.0) + (set-vector! s4-0 (* (sin (-> this travel-ry)) f28-0) 0.0 (* (cos (-> this travel-ry)) f28-0) 1.0) (let ((s3-1 (new 'stack 'clip-travel-vector-to-mesh-return-info))) - (set! (-> obj nav travel quad) (-> s4-0 quad)) - (nav-control-method-24 (-> obj nav) f28-0 s3-1) + (set! (-> this nav travel quad) (-> s4-0 quad)) + (nav-control-method-24 (-> this nav) f28-0 s3-1) (if (-> s3-1 found-boundary) - (set! f26-0 (vector-vector-xz-distance (-> s3-1 intersection) (-> obj root-override trans))) + (set! f26-0 (vector-vector-xz-distance (-> s3-1 intersection) (-> this root-override trans))) ) ) (let ((s3-2 (new 'stack-no-clear 'matrix))) - (when (>= (nav-control-method-23 (-> obj nav) s4-0 (the-as check-vector-collision-with-nav-spheres-info s3-2)) 0.0) - (let ((f0-26 (vector-vector-xz-distance (-> s3-2 vector 1) (-> obj root-override trans)))) + (when (>= (nav-control-method-23 (-> this nav) s4-0 (the-as check-vector-collision-with-nav-spheres-info s3-2)) 0.0) + (let ((f0-26 (vector-vector-xz-distance (-> s3-2 vector 1) (-> this root-override trans)))) (if (or (< f26-0 0.0) (< f0-26 f26-0)) (set! f26-0 f0-26) ) @@ -396,89 +391,89 @@ ) (when (>= f26-0 0.0) (let ((f26-1 (- 1.0 (/ f26-0 f28-0)))) - (+! (-> obj travel-ry) (* f26-1 (deg- (atan (-> s5-1 x) (-> s5-1 z)) (-> obj travel-ry)))) + (+! (-> this travel-ry) (* f26-1 (deg- (atan (-> s5-1 x) (-> s5-1 z)) (-> this travel-ry)))) ) ) ) ) (set-vector! - (-> obj root-override transv) - (* (sin (-> obj travel-ry)) f30-0) - (-> obj root-override transv y) - (* (cos (-> obj travel-ry)) f30-0) + (-> this root-override transv) + (* (sin (-> this travel-ry)) f30-0) + (-> this root-override transv y) + (* (cos (-> this travel-ry)) f30-0) 1.0 ) ) - (set! (-> obj facing-ry) - (deg-seek-smooth (-> obj facing-ry) (-> obj travel-ry) (* 32768.0 (-> *display* seconds-per-frame)) 0.125) + (set! (-> this facing-ry) + (deg-seek-smooth (-> this facing-ry) (-> this travel-ry) (* 32768.0 (seconds-per-frame)) 0.125) ) - (puffer-method-27 obj) + (puffer-method-27 this) (none) ) -(defmethod puffer-method-27 puffer ((obj puffer)) - (let ((f30-0 (-> obj patrol-bottom-y))) +(defmethod puffer-method-27 puffer ((this puffer)) + (let ((f30-0 (-> this patrol-bottom-y))) (cond - ((-> obj attacking?) - (let ((f30-1 (-> obj attack-bottom-y))) - (set! (-> obj targ-trans-y) (fmax (fmin (+ 4096.0 (-> (target-pos 0) y)) (-> obj top-y)) f30-1)) + ((-> this attacking?) + (let ((f30-1 (-> this attack-bottom-y))) + (set! (-> this targ-trans-y) (fmax (fmin (+ 4096.0 (-> (target-pos 0) y)) (-> this top-y)) f30-1)) ) - (set! (-> obj root-override transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> obj targ-trans-y) (-> obj root-override trans y))) + (set! (-> this root-override transv y) + (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root-override trans y))) ) - (when (< 6144.0 (fabs (-> obj root-override transv y))) - (if (>= (-> obj root-override transv y) 0.0) - (set! (-> obj root-override transv y) 6144.0) - (set! (-> obj root-override transv y) -6144.0) + (when (< 6144.0 (fabs (-> this root-override transv y))) + (if (>= (-> this root-override transv y) 0.0) + (set! (-> this root-override transv y) 6144.0) + (set! (-> this root-override transv y) -6144.0) ) ) ) - ((< (-> obj root-override trans y) f30-0) - (set! (-> obj targ-trans-y) (* 0.5 (+ (-> obj top-y) (-> obj patrol-bottom-y)))) - (set! (-> obj root-override transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> obj targ-trans-y) (-> obj root-override trans y))) + ((< (-> this root-override trans y) f30-0) + (set! (-> this targ-trans-y) (* 0.5 (+ (-> this top-y) (-> this patrol-bottom-y)))) + (set! (-> this root-override transv y) + (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root-override trans y))) ) - (when (< 2048.0 (fabs (-> obj root-override transv y))) - (if (>= (-> obj root-override transv y) 0.0) - (set! (-> obj root-override transv y) 2048.0) - (set! (-> obj root-override transv y) -2048.0) + (when (< 2048.0 (fabs (-> this root-override transv y))) + (if (>= (-> this root-override transv y) 0.0) + (set! (-> this root-override transv y) 2048.0) + (set! (-> this root-override transv y) -2048.0) ) ) ) (else - (let ((f0-22 (- (-> obj targ-trans-y) (-> obj root-override trans y)))) - (when (or (and (>= f0-22 0.0) (< (-> obj acc-y) 0.0)) (and (< f0-22 0.0) (>= (-> obj acc-y) 0.0))) - (when (not (-> obj attacking?)) + (let ((f0-22 (- (-> this targ-trans-y) (-> this root-override trans y)))) + (when (or (and (>= f0-22 0.0) (< (-> this acc-y) 0.0)) (and (< f0-22 0.0) (>= (-> this acc-y) 0.0))) + (when (not (-> this attacking?)) (cond - ((>= (-> obj acc-y) 0.0) - (if (< f30-0 (-> obj targ-trans-y)) - (set! (-> obj targ-trans-y) (rand-vu-float-range f30-0 (-> obj targ-trans-y))) + ((>= (-> this acc-y) 0.0) + (if (< f30-0 (-> this targ-trans-y)) + (set! (-> this targ-trans-y) (rand-vu-float-range f30-0 (-> this targ-trans-y))) ) ) (else - (if (< (-> obj targ-trans-y) (-> obj top-y)) - (set! (-> obj targ-trans-y) (rand-vu-float-range (-> obj targ-trans-y) (-> obj top-y))) + (if (< (-> this targ-trans-y) (-> this top-y)) + (set! (-> this targ-trans-y) (rand-vu-float-range (-> this targ-trans-y) (-> this top-y))) ) ) ) ) - (set! (-> obj acc-y) (- (-> obj acc-y))) + (set! (-> this acc-y) (- (-> this acc-y))) ) ) - (+! (-> obj root-override transv y) (* (-> obj acc-y) (-> *display* seconds-per-frame))) - (let ((f0-37 (* (-> obj root-override transv y) (-> *display* seconds-per-frame)))) + (+! (-> this root-override transv y) (* (-> this acc-y) (seconds-per-frame))) + (let ((f0-37 (* (-> this root-override transv y) (seconds-per-frame)))) (cond ((>= f0-37 0.0) - (let ((f1-27 (* 0.0625 (- (-> obj top-y) (-> obj root-override trans y))))) + (let ((f1-27 (* 0.0625 (- (-> this top-y) (-> this root-override trans y))))) (if (< f1-27 f0-37) - (set! (-> obj root-override transv y) (* f1-27 (-> *display* frames-per-second))) + (set! (-> this root-override transv y) (* f1-27 (-> *display* frames-per-second))) ) ) ) (else - (let ((f1-29 (* 0.0625 (- f30-0 (-> obj root-override trans y))))) + (let ((f1-29 (* 0.0625 (- f30-0 (-> this root-override trans y))))) (if (< f0-37 f1-29) - (set! (-> obj root-override transv y) (* f1-29 (-> *display* frames-per-second))) + (set! (-> this root-override transv y) (* f1-29 (-> *display* frames-per-second))) ) ) ) @@ -493,7 +488,7 @@ (defstate puffer-idle (puffer) :event puffer-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self attacking?) #f) (shut-down! (-> self neck)) (let ((v1-5 (-> self draw shadow-ctrl))) @@ -508,7 +503,7 @@ ) ) (logtest? (-> self draw status) (draw-status was-drawn)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (time-elapsed? (-> self state-time) (seconds 0.2)) ) (go puffer-patrol) ) @@ -522,15 +517,15 @@ (defstate puffer-patrol (puffer) :event puffer-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self attacking?) #f) (set! (-> self reaction-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.35))) (if (not (puffer-method-23 self #f)) (go puffer-idle) ) - (set! (-> self picked-point-time) (-> *display* base-frame-counter)) + (set-time! (-> self picked-point-time)) (set! (-> self pick-new-point-delay) (rand-vu-int-range (seconds 3) (seconds 10))) - (set! (-> self last-on-screen-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-on-screen-time)) ) :trans (behavior () (if (and (not (and *target* (>= (-> self fact-info-override idle-distance) @@ -538,36 +533,36 @@ ) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) ) (go puffer-idle) ) (cond ((logtest? (-> self draw status) (draw-status was-drawn)) - (set! (-> self last-on-screen-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-on-screen-time)) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self last-on-screen-time)) (seconds 8)) + (if (time-elapsed? (-> self last-on-screen-time) (seconds 8)) (go puffer-idle) ) ) ) (when (puffer-method-22 self) (when (puffer-method-23 self #t) - (set! (-> self picked-point-time) (-> *display* base-frame-counter)) + (set-time! (-> self picked-point-time)) (set! (-> self pick-new-point-delay) (rand-vu-int-range (seconds 3) (seconds 10))) ) ) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-delay)) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-delay)) (puffer-method-25 self (-> self notice-dist)) ) (go puffer-attack) ) (when (or (< (vector-vector-xz-distance (-> self root-override trans) (-> self dest-pos)) 8192.0) - (>= (- (-> *display* base-frame-counter) (-> self picked-point-time)) (-> self pick-new-point-delay)) + (time-elapsed? (-> self picked-point-time) (-> self pick-new-point-delay)) ) (when (puffer-method-23 self #f) - (set! (-> self picked-point-time) (-> *display* base-frame-counter)) + (set-time! (-> self picked-point-time)) (set! (-> self pick-new-point-delay) (rand-vu-int-range (seconds 3) (seconds 10))) ) ) @@ -592,7 +587,7 @@ :event puffer-default-event-handler :enter (behavior () (set! (-> self attacking?) #t) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self travel-turn-speed) 21845.334) ) :exit (behavior () @@ -664,8 +659,8 @@ :post ja-post ) -(defmethod puffer-method-21 puffer ((obj puffer)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod puffer-method-21 puffer ((this puffer)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -703,28 +698,28 @@ ) (set! (-> s5-0 nav-radius) 12288.0) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (puffer-method-30 obj) + (puffer-method-30 this) 0 (none) ) -(defmethod flip-look! puffer ((obj puffer) (arg0 symbol)) - (when (!= arg0 (-> obj look-mean?)) - (set! (-> obj look-mean?) arg0) +(defmethod flip-look! puffer ((this puffer) (arg0 symbol)) + (when (!= arg0 (-> this look-mean?)) + (set! (-> this look-mean?) arg0) (if arg0 - (lods-assign! (-> obj draw) (-> obj mean-look)) - (lods-assign! (-> obj draw) (-> obj nice-look)) + (lods-assign! (-> this draw) (-> this mean-look)) + (lods-assign! (-> this draw) (-> this nice-look)) ) ) (none) ) -(defmethod puffer-method-30 puffer ((obj puffer)) - (when (!= (-> obj cprims-type) 1) - (set! (-> obj cprims-type) (the-as uint 1)) - (let ((v1-3 (the-as basic (-> obj root-override root-prim)))) +(defmethod puffer-method-30 puffer ((this puffer)) + (when (!= (-> this cprims-type) 1) + (set! (-> this cprims-type) (the-as uint 1)) + (let ((v1-3 (the-as basic (-> this root-override root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-3) local-sphere) 0.0 6144.0 0.0 18432.0) (let ((v0-0 (-> (the-as (array collide-shape-prim) v1-3) 17 local-sphere))) (set! (-> v0-0 x) 0.0) @@ -737,10 +732,10 @@ ) ) -(defmethod puffer-method-31 puffer ((obj puffer)) - (when (!= (-> obj cprims-type) 2) - (set! (-> obj cprims-type) (the-as uint 2)) - (let ((v1-3 (the-as basic (-> obj root-override root-prim)))) +(defmethod puffer-method-31 puffer ((this puffer)) + (when (!= (-> this cprims-type) 2) + (set! (-> this cprims-type) (the-as uint 2)) + (let ((v1-3 (the-as basic (-> this root-override root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-3) local-sphere) 0.0 6144.0 0.0 18432.0) (let ((v0-0 (-> (the-as (array collide-shape-prim) v1-3) 17 local-sphere))) (set! (-> v0-0 x) 0.0) @@ -753,50 +748,50 @@ ) ) -(defmethod puffer-method-26 puffer ((obj puffer)) - (let ((f30-0 (get-current-phase (-> obj sync)))) +(defmethod puffer-method-26 puffer ((this puffer)) + (let ((f30-0 (get-current-phase (-> this sync)))) (if (and (< 0.025 f30-0) (< f30-0 0.525)) - (flip-look! obj #f) - (flip-look! obj #t) + (flip-look! this #f) + (flip-look! this #t) ) (cond ((< f30-0 0.5) (cond - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 9) + (-> this draw art-group data 9) ) (cond - ((-> obj attacking?) + ((-> this attacking?) (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-0 (-> obj skel root-channel 0))) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 11)) + (the-as art-joint-anim (-> this draw art-group data 11)) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) (set! (-> a0-10 param 1) 1.0) (joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-seek!) ) ) ((ja-done? 0) - (let ((v1-28 (-> obj skel root-channel 0))) + (let ((v1-28 (-> this skel root-channel 0))) (set! (-> v1-28 num-func) num-func-identity) (set! (-> v1-28 frame-num) 0.0) ) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) (set! (-> a0-13 param 1) 1.0) (joint-control-channel-group! a0-13 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) (set! (-> a0-14 param 1) 1.0) (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) @@ -804,41 +799,41 @@ ) ) ) - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 11) + (-> this draw art-group data 11) ) (cond - ((not (-> obj attacking?)) + ((not (-> this attacking?)) (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 9)) + (the-as art-joint-anim (-> this draw art-group data 9)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) - (let ((a0-21 (-> obj skel root-channel 0))) + (let ((a0-21 (-> this skel root-channel 0))) (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) (set! (-> a0-21 param 1) 1.0) (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-seek!) ) ) ((ja-done? 0) - (let ((v1-64 (-> obj skel root-channel 0))) + (let ((v1-64 (-> this skel root-channel 0))) (set! (-> v1-64 num-func) num-func-identity) (set! (-> v1-64 frame-num) 0.0) ) - (let ((a0-24 (-> obj skel root-channel 0))) + (let ((a0-24 (-> this skel root-channel 0))) (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) (set! (-> a0-24 param 1) 1.0) (joint-control-channel-group! a0-24 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-25 (-> obj skel root-channel 0))) + (let ((a0-25 (-> this skel root-channel 0))) (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) (set! (-> a0-25 param 1) 1.0) (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) @@ -846,44 +841,44 @@ ) ) ) - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 14) + (-> this draw art-group data 14) ) (cond ((ja-done? 0) (ja-channel-push! 1 (seconds 0.2)) (cond - ((-> obj attacking?) - (let ((s5-2 (-> obj skel root-channel 0))) + ((-> this attacking?) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 11)) + (the-as art-joint-anim (-> this draw art-group data 11)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) ) (else - (let ((s5-3 (-> obj skel root-channel 0))) + (let ((s5-3 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-3 - (the-as art-joint-anim (-> obj draw art-group data 9)) + (the-as art-joint-anim (-> this draw art-group data 9)) num-func-identity ) (set! (-> s5-3 frame-num) 0.0) ) ) ) - (let ((a0-34 (-> obj skel root-channel 0))) + (let ((a0-34 (-> this skel root-channel 0))) (set! (-> a0-34 param 0) (the float (+ (-> a0-34 frame-group data 0 length) -1))) (set! (-> a0-34 param 1) 1.0) (joint-control-channel-group! a0-34 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-35 (-> obj skel root-channel 0))) + (let ((a0-35 (-> this skel root-channel 0))) (set! (-> a0-35 param 0) (the float (+ (-> a0-35 frame-group data 0 length) -1))) (set! (-> a0-35 param 1) 1.0) (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-seek!) @@ -893,15 +888,15 @@ ) (else (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-4 (-> obj skel root-channel 0))) + (let ((s5-4 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-4 - (the-as art-joint-anim (-> obj draw art-group data 14)) + (the-as art-joint-anim (-> this draw art-group data 14)) num-func-identity ) (set! (-> s5-4 frame-num) 0.0) ) - (let ((a0-38 (-> obj skel root-channel 0))) + (let ((a0-38 (-> this skel root-channel 0))) (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) (set! (-> a0-38 param 1) 1.0) (joint-control-channel-group! a0-38 (the-as art-joint-anim #f) num-func-seek!) @@ -909,41 +904,41 @@ ) ) ) - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 10) + (-> this draw art-group data 10) ) (cond - ((-> obj attacking?) + ((-> this attacking?) (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-5 (-> obj skel root-channel 0))) + (let ((s5-5 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-5 - (the-as art-joint-anim (-> obj draw art-group data 12)) + (the-as art-joint-anim (-> this draw art-group data 12)) num-func-identity ) (set! (-> s5-5 frame-num) 0.0) ) - (let ((a0-45 (-> obj skel root-channel 0))) + (let ((a0-45 (-> this skel root-channel 0))) (set! (-> a0-45 param 0) (the float (+ (-> a0-45 frame-group data 0 length) -1))) (set! (-> a0-45 param 1) 1.0) (joint-control-channel-group! a0-45 (the-as art-joint-anim #f) num-func-seek!) ) ) ((ja-done? 0) - (let ((v1-142 (-> obj skel root-channel 0))) + (let ((v1-142 (-> this skel root-channel 0))) (set! (-> v1-142 num-func) num-func-identity) (set! (-> v1-142 frame-num) 0.0) ) - (let ((a0-48 (-> obj skel root-channel 0))) + (let ((a0-48 (-> this skel root-channel 0))) (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group data 0 length) -1))) (set! (-> a0-48 param 1) 1.0) (joint-control-channel-group! a0-48 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-49 (-> obj skel root-channel 0))) + (let ((a0-49 (-> this skel root-channel 0))) (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) (set! (-> a0-49 param 1) 1.0) (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) @@ -951,41 +946,41 @@ ) ) ) - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 12) + (-> this draw art-group data 12) ) (cond - ((not (-> obj attacking?)) + ((not (-> this attacking?)) (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-6 (-> obj skel root-channel 0))) + (let ((s5-6 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-6 - (the-as art-joint-anim (-> obj draw art-group data 10)) + (the-as art-joint-anim (-> this draw art-group data 10)) num-func-identity ) (set! (-> s5-6 frame-num) 0.0) ) - (let ((a0-56 (-> obj skel root-channel 0))) + (let ((a0-56 (-> this skel root-channel 0))) (set! (-> a0-56 param 0) (the float (+ (-> a0-56 frame-group data 0 length) -1))) (set! (-> a0-56 param 1) 1.0) (joint-control-channel-group! a0-56 (the-as art-joint-anim #f) num-func-seek!) ) ) ((ja-done? 0) - (let ((v1-178 (-> obj skel root-channel 0))) + (let ((v1-178 (-> this skel root-channel 0))) (set! (-> v1-178 num-func) num-func-identity) (set! (-> v1-178 frame-num) 0.0) ) - (let ((a0-59 (-> obj skel root-channel 0))) + (let ((a0-59 (-> this skel root-channel 0))) (set! (-> a0-59 param 0) (the float (+ (-> a0-59 frame-group data 0 length) -1))) (set! (-> a0-59 param 1) 1.0) (joint-control-channel-group! a0-59 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-60 (-> obj skel root-channel 0))) + (let ((a0-60 (-> this skel root-channel 0))) (set! (-> a0-60 param 0) (the float (+ (-> a0-60 frame-group data 0 length) -1))) (set! (-> a0-60 param 1) 1.0) (joint-control-channel-group-eval! a0-60 (the-as art-joint-anim #f) num-func-seek!) @@ -993,30 +988,30 @@ ) ) ) - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 13) + (-> this draw art-group data 13) ) (cond ((ja-done? 0) (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-7 (-> obj skel root-channel 0))) + (let ((s5-7 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-7 - (the-as art-joint-anim (-> obj draw art-group data 10)) + (the-as art-joint-anim (-> this draw art-group data 10)) num-func-identity ) (set! (-> s5-7 frame-num) 0.0) ) - (let ((a0-68 (-> obj skel root-channel 0))) + (let ((a0-68 (-> this skel root-channel 0))) (set! (-> a0-68 param 0) (the float (+ (-> a0-68 frame-group data 0 length) -1))) (set! (-> a0-68 param 1) 1.0) (joint-control-channel-group! a0-68 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-69 (-> obj skel root-channel 0))) + (let ((a0-69 (-> this skel root-channel 0))) (set! (-> a0-69 param 0) (the float (+ (-> a0-69 frame-group data 0 length) -1))) (set! (-> a0-69 param 1) 1.0) (joint-control-channel-group-eval! a0-69 (the-as art-joint-anim #f) num-func-seek!) @@ -1026,15 +1021,15 @@ ) (else (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-8 (-> obj skel root-channel 0))) + (let ((s5-8 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-8 - (the-as art-joint-anim (-> obj draw art-group data 13)) + (the-as art-joint-anim (-> this draw art-group data 13)) num-func-identity ) (set! (-> s5-8 frame-num) 0.0) ) - (let ((a0-72 (-> obj skel root-channel 0))) + (let ((a0-72 (-> this skel root-channel 0))) (set! (-> a0-72 param 0) (the float (+ (-> a0-72 frame-group data 0 length) -1))) (set! (-> a0-72 param 1) 1.0) (joint-control-channel-group! a0-72 (the-as art-joint-anim #f) num-func-seek!) @@ -1042,80 +1037,80 @@ ) ) ) - (case (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (case (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (((-> obj draw art-group data 10) (-> obj draw art-group data 12)) - (puffer-method-31 obj) + (((-> this draw art-group data 10) (-> this draw art-group data 12)) + (puffer-method-31 this) ) (else - (puffer-method-30 obj) + (puffer-method-30 this) ) ) (none) ) -(defmethod relocate puffer ((obj puffer) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method puffer 7)) this arg0) ) ) -(defmethod init-from-entity! puffer ((obj puffer) (arg0 entity-actor)) +(defmethod init-from-entity! puffer ((this puffer) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj cprims-type) (the-as uint 0)) - (set! (-> obj attacking?) #f) - (set! (-> obj buddy) #f) - (set! (-> obj hit-player?) #f) - (set! (-> obj look-mean?) #f) - (set! (-> obj travel-turn-speed) 16384.0) - (puffer-method-21 obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-skeleton obj *puffer-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask enemy)) - (setup-lods! (-> obj nice-look) *puffer-sg* (-> obj draw art-group) (-> obj entity)) - (setup-lods! (-> obj mean-look) *puffer-mean-sg* (-> obj draw art-group) (-> obj entity)) - (load-params! (-> obj sync) obj (the-as uint 2400) 0.0 0.15 0.15) - (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default 57344.0)) - (set! (-> obj give-up-dist) (+ 20480.0 (-> obj notice-dist))) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (nav-control-method-26 (-> obj nav)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact-info-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this cprims-type) (the-as uint 0)) + (set! (-> this attacking?) #f) + (set! (-> this buddy) #f) + (set! (-> this hit-player?) #f) + (set! (-> this look-mean?) #f) + (set! (-> this travel-turn-speed) 16384.0) + (puffer-method-21 this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-skeleton this *puffer-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask enemy)) + (setup-lods! (-> this nice-look) *puffer-sg* (-> this draw art-group) (-> this entity)) + (setup-lods! (-> this mean-look) *puffer-mean-sg* (-> this draw art-group) (-> this entity)) + (load-params! (-> this sync) this (the-as uint 2400) 0.0 0.15 0.15) + (set! (-> this notice-dist) (res-lump-float arg0 'notice-dist :default 57344.0)) + (set! (-> this give-up-dist) (+ 20480.0 (-> this notice-dist))) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (nav-control-method-26 (-> this nav)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact-info-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) - (if (<= (-> obj path curve num-cverts) 0) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) + (if (<= (-> this path curve num-cverts) 0) (go process-drawable-art-error "no path") ) - (set! (-> obj buddy) (the-as process-drawable (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this buddy) (the-as process-drawable (entity-actor-lookup arg0 'alt-actor 0))) (ja-channel-set! 1) - (let ((a0-21 (-> obj skel root-channel 0))) + (let ((a0-21 (-> this skel root-channel 0))) (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) (set! (-> a0-21 param 1) 1.0) (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-seek!) ) - (let ((s4-0 (-> obj skel root-channel 0))) + (let ((s4-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-0 - (the-as art-joint-anim (-> obj draw art-group data 9)) + (the-as art-joint-anim (-> this draw art-group data 9)) num-func-identity ) (set! (-> s4-0 frame-num) 0.0) ) - (set! (-> obj facing-ry) (quaternion-y-angle (-> obj root-override quat))) - (set! (-> obj travel-ry) (-> obj facing-ry)) - (set! (-> obj travel-speed) 18432.0) - (vector-reset! (-> obj root-override transv)) - (set! (-> obj patrol-bottom-y) (-> obj root-override trans y)) + (set! (-> this facing-ry) (quaternion-y-angle (-> this root-override quat))) + (set! (-> this travel-ry) (-> this facing-ry)) + (set! (-> this travel-speed) 18432.0) + (vector-reset! (-> this root-override transv)) + (set! (-> this patrol-bottom-y) (-> this root-override trans y)) (let ((f28-0 8192.0) (f30-0 -8192.0) ) @@ -1126,22 +1121,22 @@ (set! f30-0 (-> v1-54 1)) ) ) - (set! (-> obj top-y) (+ (-> obj patrol-bottom-y) f28-0)) - (set! (-> obj attack-bottom-y) (+ (-> obj patrol-bottom-y) f30-0)) + (set! (-> this top-y) (+ (-> this patrol-bottom-y) f28-0)) + (set! (-> this attack-bottom-y) (+ (-> this patrol-bottom-y) f30-0)) ) - (set! (-> obj root-override trans y) (rand-vu-float-range (-> obj patrol-bottom-y) (-> obj top-y))) - (set! (-> obj targ-trans-y) (-> obj root-override trans y)) - (set! (-> obj acc-y) 2048.0) - (let ((v1-59 (new 'process 'joint-mod (joint-mod-handler-mode reset) obj 5))) - (set! (-> obj neck) v1-59) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this root-override trans y) (rand-vu-float-range (-> this patrol-bottom-y) (-> this top-y))) + (set! (-> this targ-trans-y) (-> this root-override trans y)) + (set! (-> this acc-y) 2048.0) + (let ((v1-59 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 5))) + (set! (-> this neck) v1-59) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) (set! (-> v1-59 up) (the-as uint 1)) (set! (-> v1-59 nose) (the-as uint 2)) (set! (-> v1-59 ear) (the-as uint 0)) (set! (-> v1-59 max-dist) 102400.0) (set! (-> v1-59 ignore-angle) 16384.0) ) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (go puffer-idle) (none) ) diff --git a/goal_src/jak1/levels/sunken/qbert-plat.gc b/goal_src/jak1/levels/sunken/qbert-plat.gc index f6e64d3565..1f5eb4f5e5 100644 --- a/goal_src/jak1/levels/sunken/qbert-plat.gc +++ b/goal_src/jak1/levels/sunken/qbert-plat.gc @@ -163,37 +163,37 @@ ) ) -(defmethod rigid-body-platform-method-33 qbert-plat ((obj qbert-plat)) - (let* ((a1-0 (-> obj master)) +(defmethod rigid-body-platform-method-33 qbert-plat ((this qbert-plat)) + (let* ((a1-0 (-> this master)) (v1-0 (if a1-0 (-> a1-0 extra process) ) ) ) (if v1-0 - (send-event v1-0 'trigger (-> obj plat-id)) + (send-event v1-0 'trigger (-> this plat-id)) ) ) ) -(defmethod rigid-body-platform-method-32 qbert-plat ((obj qbert-plat)) - (let* ((v1-0 (-> obj master)) +(defmethod rigid-body-platform-method-32 qbert-plat ((this qbert-plat)) + (let* ((v1-0 (-> this master)) (a0-1 (if v1-0 (-> v1-0 extra process) ) ) ) (when (the-as qbert-plat-master a0-1) - (let ((v1-3 (plat-state-set? (the-as qbert-plat-master a0-1) (the-as uint (-> obj plat-id))))) - (when (!= v1-3 (-> obj on?)) - (set! (-> obj on?) v1-3) + (let ((v1-3 (plat-state-set? (the-as qbert-plat-master a0-1) (the-as uint (-> this plat-id))))) + (when (!= v1-3 (-> this on?)) + (set! (-> this on?) v1-3) (cond (v1-3 - (process-spawn qbert-plat-on (-> obj entity) obj :to obj) + (process-spawn qbert-plat-on (-> this entity) this :to this) (sound-play "plat-light-on") ) (else - (let ((gp-2 (-> obj child))) + (let ((gp-2 (-> this child))) (while gp-2 (send-event (ppointer->process gp-2) 'die) (set! gp-2 (-> gp-2 0 brother)) @@ -272,22 +272,22 @@ ) ) -(defmethod rigid-body-platform-method-22 qbert-plat ((obj qbert-plat) (arg0 vector) (arg1 float)) - (+ (-> obj anchor-point y) - (-> obj float-height-offset) +(defmethod rigid-body-platform-method-22 qbert-plat ((this qbert-plat) (arg0 vector) (arg1 float)) + (+ (-> this anchor-point y) + (-> this float-height-offset) (* 512.0 (cos (* 546.13336 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z)))))) ) ) -(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) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) +(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) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) -(defmethod rigid-body-platform-method-30 qbert-plat ((obj qbert-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod rigid-body-platform-method-30 qbert-plat ((this qbert-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -305,63 +305,63 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-31 qbert-plat ((obj qbert-plat)) - (initialize-skeleton obj *qbert-plat-sg* '()) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-overlay)) - (rigid-body-platform-method-29 obj *qbert-plat-constants*) - (set! (-> obj float-height-offset) 6144.0) - (let ((v1-11 (-> obj control-point-array data))) +(defmethod rigid-body-platform-method-31 qbert-plat ((this qbert-plat)) + (initialize-skeleton this *qbert-plat-sg* '()) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-overlay)) + (rigid-body-platform-method-29 this *qbert-plat-constants*) + (set! (-> this float-height-offset) 6144.0) + (let ((v1-11 (-> this control-point-array data))) (set! (-> v1-11 0 local-pos x) -14336.0) (set! (-> v1-11 0 local-pos y) 0.0) (set! (-> v1-11 0 local-pos z) -14336.0) (set! (-> v1-11 0 local-pos w) 1.0) ) - (let ((v1-13 (-> obj control-point-array data 1))) + (let ((v1-13 (-> this control-point-array data 1))) (set! (-> v1-13 local-pos x) -14336.0) (set! (-> v1-13 local-pos y) 0.0) (set! (-> v1-13 local-pos z) 14336.0) (set! (-> v1-13 local-pos w) 1.0) ) - (let ((v1-15 (-> obj control-point-array data 2))) + (let ((v1-15 (-> this control-point-array data 2))) (set! (-> v1-15 local-pos x) 14336.0) (set! (-> v1-15 local-pos y) 0.0) (set! (-> v1-15 local-pos z) 14336.0) (set! (-> v1-15 local-pos w) 1.0) ) - (let ((v1-17 (-> obj control-point-array data 3))) + (let ((v1-17 (-> this control-point-array data 3))) (set! (-> v1-17 local-pos x) 14336.0) (set! (-> v1-17 local-pos y) 0.0) (set! (-> v1-17 local-pos z) -14336.0) (set! (-> v1-17 local-pos w) 1.0) ) - (set! (-> obj on?) #f) - (set! (-> obj player-is-riding?) #f) - (set! (-> obj master) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj plat-id) (actor-count-before (-> obj link))) + (set! (-> this on?) #f) + (set! (-> this player-is-riding?) #f) + (set! (-> this master) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this plat-id) (actor-count-before (-> this link))) 0 (none) ) -(defmethod init-from-entity! qbert-plat ((obj qbert-plat) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) +(defmethod init-from-entity! qbert-plat ((this qbert-plat) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) (go qbert-plat-wait-for-master) (none) ) -(defmethod plat-state-set? qbert-plat-master ((obj qbert-plat-master) (arg0 uint)) - (logtest? (-> obj plat-states) (ash 1 arg0)) +(defmethod plat-state-set? qbert-plat-master ((this qbert-plat-master) (arg0 uint)) + (logtest? (-> this plat-states) (ash 1 arg0)) ) (defstate qbert-plat-master-idle (qbert-plat-master) @@ -595,19 +595,19 @@ ) (go qbert-plat-master-idle) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (cond (arg0 (ambient-hint-spawn "gamcam08" (the-as vector #f) *entity-pool* 'camera) (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "qbert-show-door-open" 0 #f '() :to self) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.4)) + (until (time-elapsed? (-> self state-time) (seconds 1.4)) (suspend) ) ) (else (ambient-hint-spawn "gamcam07" (the-as vector #f) *entity-pool* 'camera) (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "qbert-show-door-close" 0 #f '() :to self) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) @@ -712,30 +712,30 @@ ) ) -(defmethod init-from-entity! qbert-plat-master ((obj qbert-plat-master) (arg0 entity-actor)) - (set! (-> obj last-plat-triggered) -1) - (set! (-> obj player-in-water?) #f) - (set! (-> obj player-in-bounds?) #f) - (set! (-> obj play-door-cam?) #t) - (set! (-> obj puzzle-beaten?) #f) - (set! (-> obj plat-states) (the-as uint 0)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj plat-states-needed-to-open-door) - (the-as uint (get-matching-actor-type-mask (-> obj link) qbert-plat)) +(defmethod init-from-entity! qbert-plat-master ((this qbert-plat-master) (arg0 entity-actor)) + (set! (-> this last-plat-triggered) -1) + (set! (-> this player-in-water?) #f) + (set! (-> this player-in-bounds?) #f) + (set! (-> this play-door-cam?) #t) + (set! (-> this puzzle-beaten?) #f) + (set! (-> this plat-states) (the-as uint 0)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this plat-states-needed-to-open-door) + (the-as uint (get-matching-actor-type-mask (-> this link) qbert-plat)) ) - (set! (-> obj door) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj door-plat) (entity-actor-lookup arg0 'alt-actor 1)) - (set-vector! (-> obj bounds-start) -39034.88 0.0 27729.92 1.0) - (vector+! (-> obj bounds-start) (-> obj bounds-start) (-> obj root trans)) - (set-vector! (-> obj bounds-end) 128573.44 0.0 -38420.48 1.0) - (vector+! (-> obj bounds-end) (-> obj bounds-end) (-> obj root trans)) + (set! (-> this door) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this door-plat) (entity-actor-lookup arg0 'alt-actor 1)) + (set-vector! (-> this bounds-start) -39034.88 0.0 27729.92 1.0) + (vector+! (-> this bounds-start) (-> this bounds-start) (-> this root trans)) + (set-vector! (-> this bounds-end) 128573.44 0.0 -38420.48 1.0) + (vector+! (-> this bounds-end) (-> this bounds-end) (-> this root trans)) (let ((v1-11 (task-complete? *game-info* (game-task sunken-platforms)))) - (set! (-> obj puzzle-beaten?) v1-11) + (set! (-> this puzzle-beaten?) v1-11) (when v1-11 - (set! (-> obj plat-states) (-> obj plat-states-needed-to-open-door)) - (set! (-> obj play-door-cam?) #f) + (set! (-> this plat-states) (-> this plat-states-needed-to-open-door)) + (set! (-> this play-door-cam?) #f) ) ) (go qbert-plat-master-wait-for-door) diff --git a/goal_src/jak1/levels/sunken/shover.gc b/goal_src/jak1/levels/sunken/shover.gc index 5ea61edb14..d6e4112889 100644 --- a/goal_src/jak1/levels/sunken/shover.gc +++ b/goal_src/jak1/levels/sunken/shover.gc @@ -44,7 +44,7 @@ (calc-shove-up (-> self root-override) s4-0 (-> self shove-up)) (level-hint-spawn (text-id sunken-hotpipes) "sksp0134" (the-as entity #f) *entity-pool* (game-task none)) (if (or (= (-> *target* control unknown-surface00 mode) 'air) - (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) + (>= (+ (current-time) (seconds -0.2)) (-> *target* control unknown-dword11)) (< 0.75 (-> *target* control poly-normal y)) ) (send-event @@ -75,11 +75,11 @@ :code anim-loop ) -(defmethod init-from-entity! shover ((obj shover) (arg0 entity-actor)) +(defmethod init-from-entity! shover ((this shover) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj shove-up) (res-lump-float arg0 'shove :default 12288.0)) + (set! (-> this shove-up) (res-lump-float arg0 'shove :default 12288.0)) (let ((s3-0 (res-lump-value arg0 'collision-mesh-id uint128)) - (s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))) + (s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))) ) (let ((s3-1 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint s3-0) (the-as uint 0)))) (set! (-> s3-1 prim-core collide-as) (collide-kind wall-object)) @@ -92,12 +92,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *shover-sg* '()) - (let ((v1-17 (new 'process 'path-control obj 'path 0.0))) - (set! (-> obj path) v1-17) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *shover-sg* '()) + (let ((v1-17 (new 'process 'path-control this 'path 0.0))) + (set! (-> this path) v1-17) (logior! (-> v1-17 flags) (path-control-flag display draw-line draw-point draw-text)) (if (<= (-> v1-17 curve num-cverts) 0) (go process-drawable-art-error "no path") @@ -106,28 +106,28 @@ (set! sv-16 (new 'static 'res-tag)) (let ((v1-23 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-23 - (+! (-> obj root-override trans x) (-> v1-23 0)) - (+! (-> obj root-override trans y) (-> v1-23 1)) - (+! (-> obj root-override trans z) (-> v1-23 2)) + (+! (-> this root-override trans x) (-> v1-23 0)) + (+! (-> this root-override trans y) (-> v1-23 1)) + (+! (-> this root-override trans z) (-> v1-23 2)) ) ) (let ((f0-13 (res-lump-float arg0 'rotoffset))) (if (!= f0-13 0.0) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-13) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-13) ) ) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (set! *shover* obj) + (update-transforms! (-> this root-override)) + (set! *shover* this) (go shover-idle) (none) ) diff --git a/goal_src/jak1/levels/sunken/square-platform.gc b/goal_src/jak1/levels/sunken/square-platform.gc index ffb03c3118..b586d61d92 100644 --- a/goal_src/jak1/levels/sunken/square-platform.gc +++ b/goal_src/jak1/levels/sunken/square-platform.gc @@ -174,20 +174,20 @@ :parts ((sp-item 2222 :flags (is-3d)) (sp-item 2315 :flags (is-3d))) ) -(defmethod square-platform-method-27 square-platform ((obj square-platform) (arg0 symbol)) +(defmethod square-platform-method-27 square-platform ((this square-platform) (arg0 symbol)) (local-vars (v0-3 sound-id) (sv-48 int)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj root-override trans quad)) + (set! (-> s4-0 quad) (-> this root-override trans quad)) (+! (-> s4-0 y) -20480.0) - (let* ((v1-1 (-> obj water-entity)) + (let* ((v1-1 (-> this water-entity)) (a0-4 (if v1-1 (-> v1-1 extra process) ) ) ) (when (not a0-4) - (set! (-> obj water-entity) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (let ((v1-4 (-> obj water-entity))) + (set! (-> this water-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (let ((v1-4 (-> this water-entity))) (set! a0-4 (if v1-4 (-> v1-4 extra process) ) @@ -200,17 +200,17 @@ ) (set! (-> s3-0 quad) (-> s4-0 quad)) (set! (-> s3-0 y) f0-2) - (if (zero? (-> obj start-splash-time)) + (if (zero? (-> this start-splash-time)) (set! v0-3 (cond (arg0 (if (>= (-> s4-0 y) f0-2) - (set! (-> obj start-splash-time) (-> *display* base-frame-counter)) + (set-time! (-> this start-splash-time)) ) v0-3 ) (else (when (>= f0-2 (-> s4-0 y)) - (set! (-> obj start-splash-time) (-> *display* base-frame-counter)) + (set-time! (-> this start-splash-time)) (let ((s2-0 sound-play-by-name) (s1-0 (make-u128 #x6873616c (the-as uint #x70732d656772616c))) (s0-0 (new-sound-id)) @@ -229,26 +229,26 @@ ) ) ) - (when (nonzero? (-> obj start-splash-time)) + (when (nonzero? (-> this start-splash-time)) (cond (arg0 - (let ((v1-21 (-> obj splash-counter))) + (let ((v1-21 (-> this splash-counter))) (when (< v1-21 2) - (set! (-> obj splash-counter) (+ v1-21 1)) - (spawn (-> obj part2) s3-0) + (set! (-> this splash-counter) (+ v1-21 1)) + (spawn (-> this part2) s3-0) ) ) ) (else - (spawn (-> obj part3) s4-0) + (spawn (-> this part3) s4-0) ) ) ) (when (not arg0) - (let ((v1-25 (-> obj splash-counter))) + (let ((v1-25 (-> this splash-counter))) (when (< v1-25 2) - (set! (-> obj splash-counter) (+ v1-25 1)) - (spawn (-> obj part4) s3-0) + (set! (-> this splash-counter) (+ v1-25 1)) + (spawn (-> this part4) s3-0) ) ) ) @@ -380,40 +380,40 @@ :post plat-post ) -(defmethod deactivate square-platform ((obj square-platform)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate square-platform ((this square-platform)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj part3)) - (kill-and-free-particles (-> obj part3)) + (if (nonzero? (-> this part3)) + (kill-and-free-particles (-> this part3)) ) - (if (nonzero? (-> obj part4)) - (kill-and-free-particles (-> obj part4)) + (if (nonzero? (-> this part4)) + (kill-and-free-particles (-> this part4)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod relocate square-platform ((obj square-platform) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate square-platform ((this square-platform) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj part3)) - (&+! (-> obj part3) arg0) + (if (nonzero? (-> this part3)) + (&+! (-> this part3) arg0) ) - (if (nonzero? (-> obj part4)) - (&+! (-> obj part4) arg0) + (if (nonzero? (-> this part4)) + (&+! (-> this part4) arg0) ) (the-as square-platform - ((the-as (function baseplat int baseplat) (find-parent-method square-platform 7)) obj arg0) + ((the-as (function baseplat int baseplat) (find-parent-method square-platform 7)) this arg0) ) ) -(defmethod init-from-entity! square-platform ((obj square-platform) (arg0 entity-actor)) +(defmethod init-from-entity! square-platform ((this square-platform) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (set! (-> obj pos-u) 0.0) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> this pos-u) 0.0) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -431,24 +431,24 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj plat-id) (actor-count-before (-> obj link))) - (initialize-skeleton obj *square-platform-sg* '()) - (baseplat-method-21 obj) + (process-drawable-from-entity! this arg0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this plat-id) (actor-count-before (-> this link))) + (initialize-skeleton this *square-platform-sg* '()) + (baseplat-method-21 this) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) (set! sv-16 (new 'static 'res-tag)) - (let* ((v1-32 (res-lump-data (-> obj entity) 'distance pointer :tag-ptr (& sv-16))) + (let* ((v1-32 (res-lump-data (-> this entity) 'distance pointer :tag-ptr (& sv-16))) (f30-0 (if (and v1-32 (> (the-as int (-> sv-16 elt-count)) 0)) (-> (the-as (pointer float) v1-32)) -8192.0 @@ -456,27 +456,27 @@ ) ) (set! sv-32 (new 'static 'res-tag)) - (let* ((v1-35 (res-lump-data (-> obj entity) 'distance pointer :tag-ptr (& sv-32))) + (let* ((v1-35 (res-lump-data (-> this entity) 'distance pointer :tag-ptr (& sv-32))) (f0-10 (if (and v1-35 (< 1 (the-as int (-> sv-32 elt-count)))) (-> (the-as (pointer float) v1-35) 1) 16384.0 ) ) ) - (set! (-> obj down-pos quad) (-> obj root-override trans quad)) - (+! (-> obj down-pos y) f30-0) - (set! (-> obj up-pos quad) (-> obj root-override trans quad)) - (+! (-> obj up-pos y) f0-10) + (set! (-> this down-pos quad) (-> this root-override trans quad)) + (+! (-> this down-pos y) f30-0) + (set! (-> this up-pos quad) (-> this root-override trans quad)) + (+! (-> this up-pos y) f0-10) ) ) - (set! (-> obj basetrans quad) (-> obj down-pos quad)) - (set! (-> obj root-override trans quad) (-> obj basetrans quad)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 437) obj)) - (set! (-> obj part3) (create-launch-control (-> *part-group-id-table* 438) obj)) - (set! (-> obj part4) (create-launch-control (-> *part-group-id-table* 439) obj)) - (set! (-> obj water-entity) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this basetrans quad) (-> this down-pos quad)) + (set! (-> this root-override trans quad) (-> this basetrans quad)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 437) this)) + (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 438) this)) + (set! (-> this part4) (create-launch-control (-> *part-group-id-table* 439) this)) + (set! (-> this water-entity) (entity-actor-lookup arg0 'alt-actor 0)) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (go square-platform-lowered) (none) ) @@ -503,7 +503,7 @@ (defstate square-platform-master-activate (square-platform-master) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self wiggled?) #f) (sleep (-> self ticker) (-> self timeout)) (set! (-> self plat-id) -1) @@ -605,8 +605,8 @@ (send-to-all (-> self link) 'bounce) ) ) - (when (>= (- (-> *display* base-frame-counter) (-> self last-plat-activated-time)) (seconds 0.3)) - (set! (-> self last-plat-activated-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self last-plat-activated-time) (seconds 0.3)) + (set-time! (-> self last-plat-activated-time)) (let ((v1-20 (-> self plat-id)) (a0-5 (-> self plat-id-dir)) (a1-3 (-> self plat-mask)) @@ -641,17 +641,17 @@ ) ) -(defmethod init-from-entity! square-platform-master ((obj square-platform-master) (arg0 entity-actor)) - (set! (-> obj button-id) -1) - (set! (-> obj plat-id) -1) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj timeout) - (the-as time-frame (the int (* 300.0 (res-lump-float (-> obj entity) 'timeout :default 10.0)))) +(defmethod init-from-entity! square-platform-master ((this square-platform-master) (arg0 entity-actor)) + (set! (-> this button-id) -1) + (set! (-> this plat-id) -1) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this timeout) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'timeout :default 10.0)))) ) - (set! (-> obj delay-til-wiggle) (+ (-> obj timeout) (seconds -0.4))) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj plat-mask) (the-as uint (get-matching-actor-type-mask (-> obj link) square-platform))) + (set! (-> this delay-til-wiggle) (+ (-> this timeout) (seconds -0.4))) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this plat-mask) (the-as uint (get-matching-actor-type-mask (-> this link) square-platform))) (go square-platform-master-idle) (none) ) diff --git a/goal_src/jak1/levels/sunken/steam-cap.gc b/goal_src/jak1/levels/sunken/steam-cap.gc index d0340feda8..4bf8e2f92c 100644 --- a/goal_src/jak1/levels/sunken/steam-cap.gc +++ b/goal_src/jak1/levels/sunken/steam-cap.gc @@ -410,23 +410,23 @@ :bounds (static-spherem 0 0 0 3) ) -(defmethod steam-cap-method-20 steam-cap ((obj steam-cap)) +(defmethod steam-cap-method-20 steam-cap ((this steam-cap)) (when *target* (let* ((a1-0 (target-pos 0)) (f0-0 (-> a1-0 y)) ) - (when (and (>= f0-0 (+ -8192.0 (-> obj down y))) - (and (>= (+ -4096.0 (-> obj root-override trans y)) f0-0) (zero? (-> obj root-override riders num-riders))) + (when (and (>= f0-0 (+ -8192.0 (-> this down y))) + (and (>= (+ -4096.0 (-> this root-override trans y)) f0-0) (zero? (-> this root-override riders num-riders))) ) - (let ((f0-1 (vector-vector-xz-distance-squared (-> obj down) a1-0))) + (let ((f0-1 (vector-vector-xz-distance-squared (-> this down) a1-0))) (when (>= 104857600.0 f0-1) (let ((s5-0 (>= 37748736.0 f0-1))) (when (not s5-0) - (when (>= (- (-> obj root-override trans y) (-> obj down y)) 3072.0) + (when (>= (- (-> this root-override trans y) (-> this down y)) 3072.0) (let ((a1-1 (new 'stack-no-clear 'vector))) (set! (-> a1-1 x) (the-as float 1)) (set! (-> a1-1 y) (the-as float #f)) - (if (find-overlapping-shapes (-> obj root-override) (the-as overlaps-others-params a1-1)) + (if (find-overlapping-shapes (-> this root-override) (the-as overlaps-others-params a1-1)) (set! s5-0 #t) ) ) @@ -444,23 +444,23 @@ (none) ) -(defmethod steam-cap-method-21 steam-cap ((obj steam-cap)) +(defmethod steam-cap-method-21 steam-cap ((this steam-cap)) (local-vars (at-0 int) (at-1 int) (s5-0 symbol)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (let ((f0-0 (get-current-phase (-> obj sync)))) + (let ((f0-0 (get-current-phase (-> this sync)))) #t (cond - ((< f0-0 (-> obj begin-travel-up)) - (let ((f30-0 (/ f0-0 (-> obj begin-travel-up)))) + ((< f0-0 (-> this begin-travel-up)) + (let ((f30-0 (/ f0-0 (-> this begin-travel-up)))) (set! s5-0 #t) (dotimes (s4-0 3) - (let ((s3-0 (-> obj control-pt s4-0))) - (when (= (-> s3-0 trans y) (-> obj down y)) - (set! (-> obj do-burst?) #t) + (let ((s3-0 (-> this control-pt s4-0))) + (when (= (-> s3-0 trans y) (-> this down y)) + (set! (-> this do-burst?) #t) (let ((a0-2 (+ (the int (* 60.0 (- 1.0 f30-0))) 3))) (if (zero? (rand-vu-int-count a0-2)) (+! (-> s3-0 transv y) (* (rand-vu-float-range 40960.0 57344.0) f30-0)) @@ -471,56 +471,56 @@ ) (let ((a0-4 (+ (the int (* 60.0 (- 1.0 f30-0))) 1))) (if (zero? (rand-vu-int-count a0-4)) - (spawn (-> obj part) (-> obj down)) + (spawn (-> this part) (-> this down)) ) ) ) ) - ((< f0-0 (-> obj begin-travel-down)) - (let ((f30-1 (/ (- f0-0 (-> obj begin-travel-up)) (- (-> obj begin-travel-down) (-> obj begin-travel-up))))) + ((< f0-0 (-> this begin-travel-down)) + (let ((f30-1 (/ (- f0-0 (-> this begin-travel-up)) (- (-> this begin-travel-down) (-> this begin-travel-up))))) (set! s5-0 #f) - (set! (-> obj do-falling-sound?) #t) - (when (-> obj do-burst?) + (set! (-> this do-falling-sound?) #t) + (when (-> this do-burst?) (sound-play "sunk-top-rises") - (set! (-> obj do-burst?) #f) - (spawn (-> obj part) (-> obj down)) - (spawn (-> obj part) (-> obj down)) - (spawn (-> obj part) (-> obj down)) - (spawn (-> obj part) (-> obj down)) + (set! (-> this do-burst?) #f) + (spawn (-> this part) (-> this down)) + (spawn (-> this part) (-> this down)) + (spawn (-> this part) (-> this down)) + (spawn (-> this part) (-> this down)) ) (when (< f30-1 0.94) - (spawn (-> obj part2) (-> obj down)) + (spawn (-> this part2) (-> this down)) (let ((a1-8 (new 'stack-no-clear 'vector))) - (set! (-> a1-8 quad) (-> obj root-override trans quad)) + (set! (-> a1-8 quad) (-> this root-override trans quad)) (+! (-> a1-8 y) -3072.0) - (spawn (-> obj part3) a1-8) + (spawn (-> this part3) a1-8) ) ) ) ) (else (set! s5-0 #t) - (when (-> obj do-falling-sound?) - (set! (-> obj do-falling-sound?) #f) + (when (-> this do-falling-sound?) + (set! (-> this do-falling-sound?) #f) (sound-play "sunk-top-falls") ) ) ) ) (dotimes (s4-3 3) - (let ((s2-0 (-> obj control-pt s4-3)) + (let ((s2-0 (-> this control-pt s4-3)) (s3-3 (new 'stack-no-clear 'vector)) ) (set! (-> s3-3 quad) (-> s2-0 trans quad)) (cond (s5-0 - (+! (-> s2-0 transv y) (* -819200.0 (-> *display* seconds-per-frame))) + (+! (-> s2-0 transv y) (* -819200.0 (seconds-per-frame))) (let ((a1-10 s3-3) (v1-42 s3-3) (a0-21 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> (-> s2-0 transv) quad)) - (let ((f0-17 (-> *display* seconds-per-frame))) + (let ((f0-17 (seconds-per-frame))) (.mov at-0 f0-17) ) (.mov vf2 at-0) @@ -529,12 +529,12 @@ (.svf (&-> a0-21 quad) vf1) (vector+! a1-10 v1-42 a0-21) ) - (when (< (-> s3-3 y) (-> obj down y)) - (when (-> obj do-landing-sound?) - (set! (-> obj do-landing-sound?) #f) + (when (< (-> s3-3 y) (-> this down y)) + (when (-> this do-landing-sound?) + (set! (-> this do-landing-sound?) #f) (sound-play "sunk-top-lands") ) - (set! (-> s3-3 y) (-> obj down y)) + (set! (-> s3-3 y) (-> this down y)) (let ((f0-20 (-> s2-0 transv y))) (when (< f0-20 0.0) (let ((f0-22 (* 0.3 (- f0-20)))) @@ -548,8 +548,8 @@ ) ) (else - (set! (-> obj do-landing-sound?) #t) - (let ((f0-24 (* 0.000048828126 (- (-> obj up y) (-> s2-0 trans y))))) + (set! (-> this do-landing-sound?) #t) + (let ((f0-24 (* 0.000048828126 (- (-> this up y) (-> s2-0 trans y))))) (cond ((< 1.0 f0-24) (set! f0-24 1.0) @@ -558,7 +558,7 @@ (set! f0-24 -1.0) ) ) - (+! (-> s2-0 transv y) (* 819200.0 (-> *display* seconds-per-frame) f0-24)) + (+! (-> s2-0 transv y) (* 819200.0 (seconds-per-frame) f0-24)) (let ((f1-24 (-> s2-0 transv y))) (when (< 122880.0 (fabs f1-24)) (if (>= f1-24 0.0) @@ -572,7 +572,7 @@ (a0-26 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> (-> s2-0 transv) quad)) - (let ((f1-27 (-> *display* seconds-per-frame))) + (let ((f1-27 (seconds-per-frame))) (.mov at-1 f1-27) ) (.mov vf2 at-1) @@ -581,7 +581,7 @@ (.svf (&-> a0-26 quad) vf1) (vector+! a1-14 v1-61 a0-26) ) - (let ((f1-29 (- (-> obj up y) (-> s3-3 y))) + (let ((f1-29 (- (-> this up y) (-> s3-3 y))) (v1-62 (>= f0-24 0.0)) ) (when (!= v1-62 (>= f1-29 0.0)) @@ -604,27 +604,27 @@ ) (let ((f0-31 0.0)) (dotimes (v1-71 3) - (+! f0-31 (-> obj control-pt v1-71 trans y)) + (+! f0-31 (-> this control-pt v1-71 trans y)) ) (let ((f0-32 (* 0.33333334 f0-31)) (a1-16 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-16 quad) (-> obj root-override trans quad)) + (set! (-> a1-16 quad) (-> this root-override trans quad)) (set! (-> a1-16 y) f0-32) - (move-to-point! (-> obj root-override) a1-16) + (move-to-point! (-> this root-override) a1-16) ) ) (let ((v1-77 (new 'stack-no-clear 'vector)) (a0-35 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'vector)) ) - (vector-! v1-77 (the-as vector (&-> obj stack 176)) (the-as vector (-> obj control-pt))) - (vector-! a0-35 (the-as vector (&-> obj stack 208)) (the-as vector (-> obj control-pt))) + (vector-! v1-77 (the-as vector (&-> this stack 176)) (the-as vector (-> this control-pt))) + (vector-! a0-35 (the-as vector (&-> this stack 208)) (the-as vector (-> this control-pt))) (vector-cross! s5-1 v1-77 a0-35) (vector-normalize! s5-1 1.0) (forward-up-nopitch->quaternion - (-> obj root-override quat) - (vector-z-quaternion! (new-stack-vector0) (-> obj root-override quat)) + (-> this root-override quat) + (vector-z-quaternion! (new-stack-vector0) (-> this root-override quat)) s5-1 ) ) @@ -643,34 +643,34 @@ :post rider-post ) -(defmethod relocate steam-cap ((obj steam-cap) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate steam-cap ((this steam-cap) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj part3)) - (&+! (-> obj part3) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method steam-cap 7)) this arg0) ) ) -(defmethod deactivate steam-cap ((obj steam-cap)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate steam-cap ((this steam-cap)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj part3)) - (kill-and-free-particles (-> obj part3)) + (if (nonzero? (-> this part3)) + (kill-and-free-particles (-> this part3)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod init-from-entity! steam-cap ((obj steam-cap) (arg0 entity-actor)) +(defmethod init-from-entity! steam-cap ((this steam-cap) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -688,25 +688,25 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj do-burst?) #f) - (set! (-> obj do-falling-sound?) #f) - (set! (-> obj do-landing-sound?) #f) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *steam-cap-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (set! (-> this do-burst?) #f) + (set! (-> this do-falling-sound?) #f) + (set! (-> this do-landing-sound?) #f) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *steam-cap-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) - (update-transforms! (-> obj root-override)) - (load-params! (-> obj sync) obj (the-as uint 1800) 0.0 0.15 0.15) + (update-transforms! (-> this root-override)) + (load-params! (-> this sync) this (the-as uint 1800) 0.0 0.15 0.15) (let ((f30-0 0.4) (f28-0 0.9) ) @@ -730,25 +730,25 @@ ) ) ) - (set! (-> obj begin-travel-up) f30-0) - (set! (-> obj begin-travel-down) f28-0) + (set! (-> this begin-travel-up) f30-0) + (set! (-> this begin-travel-down) f28-0) ) - (set! (-> obj down quad) (-> obj root-override trans quad)) - (set! (-> obj up quad) (-> obj root-override trans quad)) - (+! (-> obj up y) 40960.0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 441) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 442) obj)) - (set! (-> obj part3) (create-launch-control (-> *part-group-id-table* 443) obj)) - (vector-reset! (-> obj root-override transv)) + (set! (-> this down quad) (-> this root-override trans quad)) + (set! (-> this up quad) (-> this root-override trans quad)) + (+! (-> this up y) 40960.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 441) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 442) this)) + (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 443) this)) + (vector-reset! (-> this root-override transv)) (let ((s5-1 (new 'stack-no-clear 'vector)) (f30-1 0.0) ) (dotimes (s4-2 3) - (let ((s3-1 (-> obj control-pt s4-2))) + (let ((s3-1 (-> this control-pt s4-2))) (set-vector! s5-1 0.0 0.0 10240.0 1.0) (vector-rotate-around-y! s5-1 s5-1 f30-1) (set! f30-1 (+ 21845.334 f30-1)) - (vector+! (-> s3-1 trans) s5-1 (-> obj root-override trans)) + (vector+! (-> s3-1 trans) s5-1 (-> this root-override trans)) (vector-reset! (-> s3-1 transv)) ) ) diff --git a/goal_src/jak1/levels/sunken/sun-exit-chamber.gc b/goal_src/jak1/levels/sunken/sun-exit-chamber.gc index c18c81af72..a5849d2407 100644 --- a/goal_src/jak1/levels/sunken/sun-exit-chamber.gc +++ b/goal_src/jak1/levels/sunken/sun-exit-chamber.gc @@ -181,15 +181,15 @@ ) ) -(defmethod blue-eco-charger-orb-method-20 blue-eco-charger-orb ((obj blue-eco-charger-orb) (arg0 float)) +(defmethod blue-eco-charger-orb-method-20 blue-eco-charger-orb ((this blue-eco-charger-orb) (arg0 float)) (set-vector! - (-> obj targ-orbit-rotv) + (-> this targ-orbit-rotv) (rand-vu-float-range 72817.78 258503.11) (rand-vu-float-range 72817.78 258503.11) (rand-vu-float-range 72817.78 258503.11) 1.0 ) - (vector-float*! (-> obj targ-orbit-rotv) (-> obj targ-orbit-rotv) arg0) + (vector-float*! (-> this targ-orbit-rotv) (-> this targ-orbit-rotv) arg0) ) (defstate blue-eco-charger-orb-idle (blue-eco-charger-orb) @@ -239,7 +239,7 @@ (a0-6 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> (-> self orbit-rotv) quad)) - (let ((f0-11 (-> *display* seconds-per-frame))) + (let ((f0-11 (seconds-per-frame))) (.mov at-0 f0-11) ) (.mov vf2 at-0) @@ -255,17 +255,13 @@ (vector+! (-> self root trans) gp-0 (-> self rest-pos)) (set-vector! gp-0 - (cos (* 436.90668 (the float (mod (-> *display* base-frame-counter) 150)))) - (cos (* 247.39902 (the float (mod (-> *display* base-frame-counter) 264)))) - (cos (* 601.7998 (the float (mod (-> *display* base-frame-counter) 108)))) + (cos (* 436.90668 (the float (mod (current-time) 150)))) + (cos (* 247.39902 (the float (mod (current-time) 264)))) + (cos (* 601.7998 (the float (mod (current-time) 108)))) 1.0 ) (vector-normalize! gp-0 1.0) - (quaternion-vector-angle! - (-> self root quat) - gp-0 - (* 463.8075 (the float (mod (-> *display* base-frame-counter) 141))) - ) + (quaternion-vector-angle! (-> self root quat) gp-0 (* 463.8075 (the float (mod (current-time) 141)))) ) ) (let ((gp-1 (new 'stack-no-clear 'vector))) @@ -306,16 +302,16 @@ (none) ) -(defmethod blue-eco-charger-method-21 blue-eco-charger ((obj blue-eco-charger) (arg0 symbol)) - (let* ((v1-0 (-> obj master)) +(defmethod blue-eco-charger-method-21 blue-eco-charger ((this blue-eco-charger) (arg0 symbol)) + (let* ((v1-0 (-> this master)) (a0-1 (if v1-0 (-> v1-0 extra process) ) ) ) (when (not a0-1) - (set! (-> obj master) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (let ((v1-3 (-> obj master))) + (set! (-> this master) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (let ((v1-3 (-> this master))) (set! a0-1 (if v1-3 (-> v1-3 extra process) ) @@ -330,14 +326,14 @@ 1 2 ) - (-> obj charger-id) + (-> this charger-id) ) ) ) ) -(defmethod blue-eco-charger-method-20 blue-eco-charger ((obj blue-eco-charger)) - (and (and *target* (>= 16384.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))) +(defmethod blue-eco-charger-method-20 blue-eco-charger ((this blue-eco-charger)) + (and (and *target* (>= 16384.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans)))) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) @@ -376,7 +372,7 @@ (defstate blue-eco-charger-open (blue-eco-charger) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if arg0 (sound-play "blue-eco-start") ) @@ -384,7 +380,7 @@ ) :trans (behavior () (if (blue-eco-charger-method-20 self) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (update! (-> self sound)) ) @@ -398,7 +394,7 @@ (loop (cond ((zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 20)) + (when (time-elapsed? (-> self state-time) (seconds 20)) (level-hint-spawn (text-id sunken-blue-eco-charger-all-hint) "sksp0133" @@ -456,9 +452,9 @@ :post ja-post ) -(defmethod init-from-entity! blue-eco-charger ((obj blue-eco-charger) (arg0 entity-actor)) - (set! (-> obj open-level) 0.0) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! blue-eco-charger ((this blue-eco-charger) (arg0 entity-actor)) + (set! (-> this open-level) 0.0) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -470,33 +466,33 @@ ) (set! (-> s4-0 nav-radius) 6553.6) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *blue-eco-charger-sg* '()) - (let ((f0-6 (res-lump-float (-> obj entity) 'rotoffset))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *blue-eco-charger-sg* '()) + (let ((f0-6 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-6 0.0) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-6) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-6) ) ) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj master) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj charger-id) (+ (actor-count-before (-> obj link)) 1)) - (process-spawn blue-eco-charger-orb (-> obj entity) obj :to obj) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "blue-eco-charg" :fo-max 35) (-> obj root-override trans)) + (update-transforms! (-> this root-override)) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this master) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this charger-id) (+ (actor-count-before (-> this link)) 1)) + (process-spawn blue-eco-charger-orb (-> this entity) this :to this) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "blue-eco-charg" :fo-max 35) (-> this root-override trans)) ) (if (zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) (go blue-eco-charger-idle) @@ -519,11 +515,9 @@ (none) ) -(defmethod exit-chamber-method-20 exit-chamber ((obj exit-chamber) (arg0 float)) - (set! (-> obj root-override trans y) - (+ (-> obj orig-trans y) - (* 2252.8 arg0 (cos (* 36.40889 (the float (mod (-> *display* base-frame-counter) 1800))))) - ) +(defmethod exit-chamber-method-20 exit-chamber ((this exit-chamber) (arg0 float)) + (set! (-> this root-override trans y) + (+ (-> this orig-trans y) (* 2252.8 arg0 (cos (* 36.40889 (the float (mod (current-time) 1800)))))) ) ) @@ -546,8 +540,8 @@ ) ) -(defmethod exit-chamber-method-24 exit-chamber ((obj exit-chamber) (arg0 float)) - (let ((s4-0 (-> obj node-list data 3 bone transform)) +(defmethod exit-chamber-method-24 exit-chamber ((this exit-chamber) (arg0 float)) + (let ((s4-0 (-> this node-list data 3 bone transform)) (f30-0 (rand-vu-float-range 0.0 65536.0)) (f28-0 (rand-vu-float-range 8192.0 40960.0)) (gp-0 (new 'stack-no-clear 'vector)) @@ -561,8 +555,8 @@ (none) ) -(defmethod exit-chamber-method-21 exit-chamber ((obj exit-chamber) (arg0 exit-chamber-items)) - (let ((s5-0 (-> obj node-list data 3 bone transform))) +(defmethod exit-chamber-method-21 exit-chamber ((this exit-chamber) (arg0 exit-chamber-items)) + (let ((s5-0 (-> this node-list data 3 bone transform))) (set-vector! (-> arg0 door-pos) 0.0 13107.2 -40960.0 1.0) (vector-matrix*! (-> arg0 door-pos) (-> arg0 door-pos) s5-0) (vector-float*! (-> arg0 door-pos) (-> arg0 door-pos) (/ 1.0 (-> arg0 door-pos w))) @@ -577,21 +571,21 @@ (vector-float*! (-> arg0 fcell-pos) (-> arg0 fcell-pos) (/ 1.0 (-> arg0 fcell-pos w))) ) -(defmethod exit-chamber-method-23 exit-chamber ((obj exit-chamber) (arg0 symbol)) +(defmethod exit-chamber-method-23 exit-chamber ((this exit-chamber) (arg0 symbol)) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector<-cspace! (-> obj last-pos) (-> obj node-list data 3)) - (vector-! s5-0 (-> obj last-pos) (-> obj root-override trans)) - (set! (-> obj draw bounds quad) (-> s5-0 quad)) + (vector<-cspace! (-> this last-pos) (-> this node-list data 3)) + (vector-! s5-0 (-> this last-pos) (-> this root-override trans)) + (set! (-> this draw bounds quad) (-> s5-0 quad)) ) - (+! (-> obj draw bounds y) 16384.0) - (set! (-> obj draw bounds w) 67584.0) + (+! (-> this draw bounds y) 16384.0) + (set! (-> this draw bounds w) 67584.0) (let ((s5-1 (new 'stack-no-clear 'exit-chamber-items))) - (exit-chamber-method-21 obj s5-1) - (if (-> obj button) - (send-event (ppointer->process (-> obj button)) 'move-to (-> s5-1 button-pos) (-> s5-1 button-quat)) + (exit-chamber-method-21 this s5-1) + (if (-> this button) + (send-event (ppointer->process (-> this button)) 'move-to (-> s5-1 button-pos) (-> s5-1 button-quat)) ) - (when (and *target* (-> obj move-player?)) + (when (and *target* (-> this move-player?)) (let ((a1-6 (new 'stack-no-clear 'vector))) (set! (-> a1-6 quad) (-> s5-1 button-pos quad)) (+! (-> a1-6 y) 2662.4) @@ -599,16 +593,16 @@ ) (vector-reset! (-> *target* control transv)) ) - (if (-> obj door) - (send-event (ppointer->process (-> obj door)) 'move-to (-> s5-1 door-pos) (-> s5-1 door-quat)) + (if (-> this door) + (send-event (ppointer->process (-> this door)) 'move-to (-> s5-1 door-pos) (-> s5-1 door-quat)) ) (when arg0 - (let ((a0-12 (handle->process (-> obj fcell-handle)))) + (let ((a0-12 (handle->process (-> this fcell-handle)))) (when a0-12 - (when (or (-> obj move-fcell?) (< (-> (the-as fuel-cell a0-12) root-override trans y) (-> s5-1 fcell-pos y))) - (when (not (-> obj move-fcell?)) - (set! (-> obj move-fcell?) #t) - (let ((v1-50 (-> obj entity extra perm))) + (when (or (-> this move-fcell?) (< (-> (the-as fuel-cell a0-12) root-override trans y) (-> s5-1 fcell-pos y))) + (when (not (-> this move-fcell?)) + (set! (-> this move-fcell?) #t) + (let ((v1-50 (-> this entity extra perm))) (logior! (-> v1-50 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-50 user-int8 0) 1) ) @@ -682,8 +676,8 @@ '() :to self ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2.5)) (suspend) ) (send-event (ppointer->process (-> self door)) 'trigger) @@ -782,11 +776,11 @@ ) 0 (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-1 #f)) (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.75)) (-> self door)) + (when (and (not gp-1) (time-elapsed? (-> self state-time) (seconds 0.75)) (-> self door)) (set! gp-1 #t) (send-event (ppointer->process (-> self door)) 'untrigger) ) @@ -844,8 +838,8 @@ (restore-collide-with-as (-> (the-as fuel-cell v1-143) root-override)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (seek! (-> self wave-scale) 1.0 0.0016666667) (exit-chamber-method-20 self (-> self wave-scale)) (suspend) @@ -853,8 +847,8 @@ (if (-> self door) (send-event (ppointer->process (-> self door)) 'trigger) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2.5)) (seek! (-> self wave-scale) 1.0 0.0016666667) (exit-chamber-method-20 self (-> self wave-scale)) (suspend) @@ -893,7 +887,7 @@ ) :enter (behavior ((arg0 symbol)) (logior! (-> self mask) (process-mask platform)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (logclear! (-> self mask) (process-mask platform)) @@ -982,17 +976,17 @@ ) (load-state-want-display-level 'sunken 'display) (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-1 #f) (s5-0 #f) ) (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) (-> self door)) + (when (and (not gp-1) (time-elapsed? (-> self state-time) (seconds 0.25)) (-> self door)) (set! gp-1 #t) (send-event (ppointer->process (-> self door)) 'untrigger) ) - (when (+ (-> *display* base-frame-counter) (seconds -0.1)) + (when (+ (current-time) (seconds -0.1)) (let ((a0-9 (new 'stack-no-clear 'vector))) (set! (-> a0-9 quad) (-> self last-pos quad)) (+! (-> a0-9 y) 64102.4) @@ -1035,8 +1029,8 @@ (restore-collide-with-as (-> (the-as fuel-cell v1-109) root-override)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (suspend) ) (set-continue! *game-info* "sunkenb-start") @@ -1051,15 +1045,15 @@ ) ) -(defmethod init-from-entity! exit-chamber ((obj exit-chamber) (arg0 entity-actor)) - (process-entity-status! obj (entity-perm-status bit-3) #t) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (set! (-> obj move-player?) #f) - (set! (-> obj move-fcell?) #f) - (set! (-> obj play-assistant-message?) #t) - (set! (-> obj wave-scale) 0.0) - (set! (-> obj fcell-handle) (the-as handle #f)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! exit-chamber ((this exit-chamber) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status bit-3) #t) + (process-entity-status! this (entity-perm-status bit-7) #t) + (set! (-> this move-player?) #f) + (set! (-> this move-fcell?) #f) + (set! (-> this play-assistant-message?) #t) + (set! (-> this wave-scale) 0.0) + (set! (-> this fcell-handle) (the-as handle #f)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1077,63 +1071,63 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *exit-chamber-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 620) obj)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *exit-chamber-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 620) this)) (ja-channel-set! 1) (let ((s4-1 (get-reminder (get-task-control (game-task sunken-room)) 0))) (let ((s2-0 #f) (s3-1 (new 'stack-no-clear 'matrix)) ) - (let ((a0-17 (-> obj entity extra perm))) - (set! (-> obj move-fcell?) (nonzero? (-> a0-17 user-int8 0))) + (let ((a0-17 (-> this entity extra perm))) + (set! (-> this move-fcell?) (nonzero? (-> a0-17 user-int8 0))) ) (let ((v1-35 s4-1)) (cond ((zero? v1-35) - (set! (-> obj chargers-active) (the-as uint 0)) - (let ((s1-0 (-> obj skel root-channel 0))) + (set! (-> this chargers-active) (the-as uint 0)) + (let ((s1-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s1-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s1-0 frame-num) 0.0) ) ) ((= v1-35 1) - (set! (-> obj chargers-active) (the-as uint 62)) - (let ((s1-1 (-> obj skel root-channel 0))) + (set! (-> this chargers-active) (the-as uint 62)) + (let ((s1-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s1-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s1-1 frame-num) 0.0) ) ) ((= v1-35 2) - (set! (-> obj chargers-active) (the-as uint 62)) - (let ((s1-2 (-> obj skel root-channel 0))) + (set! (-> this chargers-active) (the-as uint 62)) + (let ((s1-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s1-2 - (the-as art-joint-anim (-> obj draw art-group data 6)) + (the-as art-joint-anim (-> this draw art-group data 6)) num-func-identity ) (set! (-> s1-2 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 6)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 6)) data 0 length) -1)) ) ) ) ) ) (ja-post) - (update-transforms! (-> obj root-override)) - (exit-chamber-method-21 obj (the-as exit-chamber-items s3-1)) + (update-transforms! (-> this root-override)) + (exit-chamber-method-21 this (the-as exit-chamber-items s3-1)) (let ((s1-3 #t)) (let ((v1-64 s4-1)) (cond @@ -1141,23 +1135,23 @@ (set! s1-3 #f) ) ((= v1-64 2) - (if (or (not *target*) (< 114688.0 (vector-vector-xz-distance (target-pos 0) (-> obj last-pos)))) + (if (or (not *target*) (< 114688.0 (vector-vector-xz-distance (target-pos 0) (-> this last-pos)))) (set! s1-3 #f) ) ) ) ) - (set! (-> obj door) (process-spawn sun-iris-door (-> s3-1 vector) (-> s3-1 vector 1) s1-3 :to obj)) + (set! (-> this door) (process-spawn sun-iris-door (-> s3-1 vector) (-> s3-1 vector 1) s1-3 :to this)) ) - (set! (-> obj button) - (process-spawn exit-chamber-button (-> s3-1 vector 2) (-> s3-1 vector 3) arg0 #f :to obj) + (set! (-> this button) + (process-spawn exit-chamber-button (-> s3-1 vector 2) (-> s3-1 vector 3) arg0 #f :to this) ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (static-sound-spec "chamber-move" :fo-min 300 :fo-max 400) - (-> obj root-override trans) - ) + (set! (-> this sound) (new + 'process + 'ambient-sound + (static-sound-spec "chamber-move" :fo-min 300 :fo-max 400) + (-> this root-override trans) + ) ) (when (not (task-complete? *game-info* (game-task sunken-room))) (let ((a0-40 (new 'stack-no-clear 'vector))) @@ -1165,24 +1159,24 @@ (set! (-> a0-40 quad) (-> (&+ s3-1 64) vector 0 quad)) (set-vector! a0-40 2357755.5 -882327.1 -6879603.0 1.0) ) - (set! (-> obj fcell-handle) (ppointer->handle (birth-pickup-at-point - a0-40 - (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) - #f - obj - (the-as fact-info #f) - ) - ) + (set! (-> this fcell-handle) (ppointer->handle (birth-pickup-at-point + a0-40 + (pickup-type fuel-cell) + (the float (-> this entity extra perm task)) + #f + this + (the-as fact-info #f) + ) + ) ) ) ) ) - (set! (-> obj orig-trans quad) (-> obj root-override trans quad)) - (set! (-> obj last-pos quad) (-> obj root-override trans quad)) - (set! (-> obj move-player?) #f) - (exit-chamber-method-23 obj #t) - (set! (-> obj move-player?) #f) + (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (set! (-> this last-pos quad) (-> this root-override trans quad)) + (set! (-> this move-player?) #f) + (exit-chamber-method-23 this #t) + (set! (-> this move-player?) #f) (cond ((zero? s4-1) (go exit-chamber-charger-puzzle) diff --git a/goal_src/jak1/levels/sunken/sun-iris-door.gc b/goal_src/jak1/levels/sunken/sun-iris-door.gc index 1cb8d4112e..8125db2820 100644 --- a/goal_src/jak1/levels/sunken/sun-iris-door.gc +++ b/goal_src/jak1/levels/sunken/sun-iris-door.gc @@ -42,33 +42,33 @@ :bounds (static-spherem 0 0 0 4.5) ) -(defmethod should-open? sun-iris-door ((obj sun-iris-door)) +(defmethod should-open? sun-iris-door ((this sun-iris-door)) (let ((f30-0 1228800.0)) 0.0 (let ((f0-7 (cond - ((-> obj directional-proximity?) + ((-> this directional-proximity?) (let ((s5-0 (new 'stack-no-clear 'vector))) (when *target* - (vector-! s5-0 (target-pos 0) (-> obj root-override trans)) + (vector-! s5-0 (target-pos 0) (-> this root-override trans)) (set! (-> s5-0 y) 0.0) - (set! f30-0 (fabs (vector-dot s5-0 (-> obj outward-vec)))) + (set! f30-0 (fabs (vector-dot s5-0 (-> this outward-vec)))) ) - (vector-! s5-0 (camera-pos) (-> obj root-override trans)) + (vector-! s5-0 (camera-pos) (-> this root-override trans)) (set! (-> s5-0 y) 0.0) - (fabs (vector-dot s5-0 (-> obj outward-vec))) + (fabs (vector-dot s5-0 (-> this outward-vec))) ) ) (else (if *target* - (set! f30-0 (vector-vector-xz-distance (-> obj root-override trans) (target-pos 0))) + (set! f30-0 (vector-vector-xz-distance (-> this root-override trans) (target-pos 0))) ) - (vector-vector-xz-distance (-> obj root-override trans) (camera-pos)) + (vector-vector-xz-distance (-> this root-override trans) (camera-pos)) ) ) ) ) - (when (or (>= (-> obj open-dist) f30-0) (>= (-> obj open-dist) f0-7)) - (if (or (not (-> obj locked-by-task?)) (task-complete? *game-info* (-> obj entity extra perm task))) + (when (or (>= (-> this open-dist) f30-0) (>= (-> this open-dist) f0-7)) + (if (or (not (-> this locked-by-task?)) (task-complete? *game-info* (-> this entity extra perm task))) (return #t) ) ) @@ -151,43 +151,43 @@ ) ) -(defmethod should-close? sun-iris-door ((obj sun-iris-door)) +(defmethod should-close? sun-iris-door ((this sun-iris-door)) (let ((f30-0 1228800.0)) 0.0 (let ((f0-7 (cond - ((-> obj directional-proximity?) + ((-> this directional-proximity?) (let ((s5-0 (new 'stack-no-clear 'vector))) (when *target* - (vector-! s5-0 (target-pos 0) (-> obj root-override trans)) + (vector-! s5-0 (target-pos 0) (-> this root-override trans)) (set! (-> s5-0 y) 0.0) - (set! f30-0 (fabs (vector-dot s5-0 (-> obj outward-vec)))) + (set! f30-0 (fabs (vector-dot s5-0 (-> this outward-vec)))) ) - (vector-! s5-0 (camera-pos) (-> obj root-override trans)) + (vector-! s5-0 (camera-pos) (-> this root-override trans)) (set! (-> s5-0 y) 0.0) - (fabs (vector-dot s5-0 (-> obj outward-vec))) + (fabs (vector-dot s5-0 (-> this outward-vec))) ) ) (else (if *target* - (set! f30-0 (vector-vector-xz-distance (-> obj root-override trans) (target-pos 0))) + (set! f30-0 (vector-vector-xz-distance (-> this root-override trans) (target-pos 0))) ) - (vector-vector-xz-distance (-> obj root-override trans) (camera-pos)) + (vector-vector-xz-distance (-> this root-override trans) (camera-pos)) ) ) ) ) - (when (and (>= f30-0 (-> obj close-dist)) (>= f0-7 (-> obj close-dist))) + (when (and (>= f30-0 (-> this close-dist)) (>= f0-7 (-> this close-dist))) (cond - ((and *target* (-> obj directional-proximity?)) + ((and *target* (-> this directional-proximity?)) (let ((s4-6 (new 'stack-no-clear 'vector)) (s5-3 (new 'stack-no-clear 'vector)) ) - (vector-! s4-6 (target-pos 0) (-> obj root-override trans)) + (vector-! s4-6 (target-pos 0) (-> this root-override trans)) (set! (-> s4-6 y) 0.0) - (vector-! s5-3 (camera-pos) (-> obj root-override trans)) + (vector-! s5-3 (camera-pos) (-> this root-override trans)) (set! (-> s5-3 y) 0.0) - (case (>= (vector-dot (-> obj outward-vec) s4-6) 0.0) - (((>= (vector-dot (-> obj outward-vec) s5-3) 0.0)) + (case (>= (vector-dot (-> this outward-vec) s4-6) 0.0) + (((>= (vector-dot (-> this outward-vec) s5-3) 0.0)) (return #t) ) ) @@ -207,7 +207,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('trigger) - (let ((v0-0 (the-as object (-> *display* base-frame-counter)))) + (let ((v0-0 (the-as object (current-time)))) (set! (-> self state-time) (the-as time-frame v0-0)) v0-0 ) @@ -223,7 +223,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) ) @@ -237,9 +237,7 @@ (go sun-iris-door-closing) ) ) - (if (and (!= (-> self timeout) 0.0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self timeout)))) - ) + (if (and (!= (-> self timeout) 0.0) (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout))))) (go sun-iris-door-closing) ) ) @@ -297,10 +295,10 @@ ) ) -(defmethod init-from-entity! sun-iris-door ((obj sun-iris-door) (arg0 entity-actor)) +(defmethod init-from-entity! sun-iris-door ((this sun-iris-door) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj move-to?) #f) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) + (set! (-> this move-to?) #f) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -312,49 +310,49 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *sun-iris-door-sg* '()) - (set! (-> obj close-dist) 49152.0) - (set! (-> obj open-dist) 40960.0) - (set! (-> obj timeout) (res-lump-float arg0 'timeout)) - (set! (-> obj proximity?) (nonzero? (res-lump-value arg0 'proximity uint128))) - (set! (-> obj directional-proximity?) #f) - (when (name= (-> obj name) "sun-iris-door-6") - (set! (-> obj close-dist) 16384.0) - (set! (-> obj open-dist) 8192.0) - (set! (-> obj directional-proximity?) #t) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *sun-iris-door-sg* '()) + (set! (-> this close-dist) 49152.0) + (set! (-> this open-dist) 40960.0) + (set! (-> this timeout) (res-lump-float arg0 'timeout)) + (set! (-> this proximity?) (nonzero? (res-lump-value arg0 'proximity uint128))) + (set! (-> this directional-proximity?) #f) + (when (name= (-> this name) "sun-iris-door-6") + (set! (-> this close-dist) 16384.0) + (set! (-> this open-dist) 8192.0) + (set! (-> this directional-proximity?) #t) ) - (set! (-> obj locked-by-task?) (nonzero? (-> obj entity extra perm task))) + (set! (-> this locked-by-task?) (nonzero? (-> this entity extra perm task))) (let ((f0-11 (res-lump-float arg0 'scale-factor :default 1.0))) - (set-vector! (-> obj root-override scale) f0-11 f0-11 f0-11 1.0) - (set! (-> obj draw bounds w) (* 18432.0 f0-11)) - (let ((v1-25 (-> obj root-override root-prim))) + (set-vector! (-> this root-override scale) f0-11 f0-11 f0-11 1.0) + (set! (-> this draw bounds w) (* 18432.0 f0-11)) + (let ((v1-25 (-> this root-override root-prim))) (set! (-> v1-25 local-sphere w) (* 24576.0 f0-11 f0-11)) ) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-28 (res-lump-data (-> obj entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) + (let ((v1-28 (res-lump-data (-> this entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-28 - (+! (-> obj root-override trans x) (-> v1-28 0)) - (+! (-> obj root-override trans y) (-> v1-28 1)) - (+! (-> obj root-override trans z) (-> v1-28 2)) + (+! (-> this root-override trans x) (-> v1-28 0)) + (+! (-> this root-override trans y) (-> v1-28 1)) + (+! (-> this root-override trans z) (-> v1-28 2)) ) ) - (let ((f30-0 (quaternion-y-angle (-> obj root-override quat)))) - (set-vector! (-> obj outward-vec) (sin f30-0) 0.0 (cos f30-0) 1.0) + (let ((f30-0 (quaternion-y-angle (-> this root-override quat)))) + (set-vector! (-> this outward-vec) (sin f30-0) 0.0 (cos f30-0) 1.0) ) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (ja-post) (go sun-iris-door-closed) (none) diff --git a/goal_src/jak1/levels/sunken/sunken-fish.gc b/goal_src/jak1/levels/sunken/sunken-fish.gc index 1d26f9ca23..fb807b379b 100644 --- a/goal_src/jak1/levels/sunken/sunken-fish.gc +++ b/goal_src/jak1/levels/sunken/sunken-fish.gc @@ -58,16 +58,16 @@ :bounds (static-spherem 0 1.5 0 2.5) ) -(defmethod sunkenfisha-method-22 sunkenfisha ((obj sunkenfisha)) +(defmethod sunkenfisha-method-22 sunkenfisha ((this sunkenfisha)) 0 (none) ) -(defmethod sunkenfisha-method-21 sunkenfisha ((obj sunkenfisha) (arg0 vector) (arg1 float) (arg2 vector)) - (eval-path-curve! (-> obj path) arg0 arg1 'interp) - (vector+! arg0 arg0 (-> obj path-trans-offset)) +(defmethod sunkenfisha-method-21 sunkenfisha ((this sunkenfisha) (arg0 vector) (arg1 float) (arg2 vector)) + (eval-path-curve! (-> this path) arg0 arg1 'interp) + (vector+! arg0 arg0 (-> this path-trans-offset)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (path-control-method-14 (-> obj path) s2-0 arg1) + (path-control-method-14 (-> this path) s2-0 arg1) (let ((f0-2 (atan (-> s2-0 x) (-> s2-0 z))) (s4-1 (new 'stack-no-clear 'vector)) ) @@ -77,94 +77,90 @@ ) ) -(defmethod sunkenfisha-method-24 sunkenfisha ((obj sunkenfisha)) +(defmethod sunkenfisha-method-24 sunkenfisha ((this sunkenfisha)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'matrix)) (gp-0 (new 'stack-no-clear 'vector)) ) - (vector-! s4-0 (-> obj targ-local-path-offset) (-> obj local-path-offset)) - (when (>= (* 4096.0 (-> *display* seconds-per-frame)) (vector-length s4-0)) - (until (< (* 16384.0 (-> *display* seconds-per-frame)) (vector-length s4-0)) - (set! (-> obj targ-local-path-offset x) - (rand-vu-float-range (- (-> obj max-local-path-offset x)) (-> obj max-local-path-offset x)) + (vector-! s4-0 (-> this targ-local-path-offset) (-> this local-path-offset)) + (when (>= (* 4096.0 (seconds-per-frame)) (vector-length s4-0)) + (until (< (* 16384.0 (seconds-per-frame)) (vector-length s4-0)) + (set! (-> this targ-local-path-offset x) + (rand-vu-float-range (- (-> this max-local-path-offset x)) (-> this max-local-path-offset x)) ) - (set! (-> obj targ-local-path-offset y) - (rand-vu-float-range (- (-> obj max-local-path-offset y)) (-> obj max-local-path-offset y)) + (set! (-> this targ-local-path-offset y) + (rand-vu-float-range (- (-> this max-local-path-offset y)) (-> this max-local-path-offset y)) ) - (vector-! s4-0 (-> obj targ-local-path-offset) (-> obj local-path-offset)) + (vector-! s4-0 (-> this targ-local-path-offset) (-> this local-path-offset)) ) ) (vector-normalize! s4-0 1.0) (matrix-from-two-vectors-max-angle-partial! s3-0 - (-> obj local-path-offset-dir) + (-> this local-path-offset-dir) s4-0 - (* 16384.0 (-> *display* seconds-per-frame)) + (* 16384.0 (seconds-per-frame)) 0.1 ) - (vector-matrix*! (-> obj local-path-offset-dir) (-> obj local-path-offset-dir) s3-0) - (vector-normalize! (-> obj local-path-offset-dir) 1.0) - (vector-float*! gp-0 (-> obj local-path-offset-dir) (* 4096.0 (-> *display* seconds-per-frame))) - (vector+! (-> obj local-path-offset) (-> obj local-path-offset) gp-0) + (vector-matrix*! (-> this local-path-offset-dir) (-> this local-path-offset-dir) s3-0) + (vector-normalize! (-> this local-path-offset-dir) 1.0) + (vector-float*! gp-0 (-> this local-path-offset-dir) (* 4096.0 (seconds-per-frame))) + (vector+! (-> this local-path-offset) (-> this local-path-offset) gp-0) ) ) -(defmethod sunkenfisha-method-25 sunkenfisha ((obj sunkenfisha)) - (let* ((f0-0 (-> obj path-speed)) - (f1-1 - (seek f0-0 (-> obj targ-path-speed) (* (-> obj path-speed-seek-speed) (-> *display* seconds-per-frame))) - ) +(defmethod sunkenfisha-method-25 sunkenfisha ((this sunkenfisha)) + (let* ((f0-0 (-> this path-speed)) + (f1-1 (seek f0-0 (-> this targ-path-speed) (* (-> this path-speed-seek-speed) (seconds-per-frame)))) ) - (set! (-> obj path-speed) f1-1) - (let ((f30-0 (+ (-> obj path-u) (* (-> obj path-dir) f1-1 (-> *display* seconds-per-frame))))) + (set! (-> this path-speed) f1-1) + (let ((f30-0 (+ (-> this path-u) (* (-> this path-dir) f1-1 (seconds-per-frame))))) (cond ((< f30-0 0.0) (set! f30-0 (- f30-0)) - (sunkenfisha-method-20 obj) + (sunkenfisha-method-20 this) ) ((< 1.0 f30-0) (+! f30-0 (* 2.0 (- 1.0 f30-0))) - (sunkenfisha-method-20 obj) + (sunkenfisha-method-20 this) ) ) - (set! (-> obj path-u) f30-0) + (set! (-> this path-u) f30-0) ) ) (none) ) -(defmethod sunkenfisha-method-23 sunkenfisha ((obj sunkenfisha)) +(defmethod sunkenfisha-method-23 sunkenfisha ((this sunkenfisha)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set-vector! s5-0 (- (vector-x-angle (-> obj root transv))) (vector-y-angle (-> obj root transv)) 0.0 1.0) - (set! (-> obj facing-rot x) - (deg-seek-smooth (-> obj facing-rot x) (-> s5-0 x) (* 16384.0 (-> *display* seconds-per-frame)) 0.1) + (set-vector! s5-0 (- (vector-x-angle (-> this root transv))) (vector-y-angle (-> this root transv)) 0.0 1.0) + (set! (-> this facing-rot x) + (deg-seek-smooth (-> this facing-rot x) (-> s5-0 x) (* 16384.0 (seconds-per-frame)) 0.1) ) - (set! (-> obj facing-rot y) - (deg-seek-smooth (-> obj facing-rot y) (-> s5-0 y) (* 32768.0 (-> *display* seconds-per-frame)) 0.1) + (set! (-> this facing-rot y) + (deg-seek-smooth (-> this facing-rot y) (-> s5-0 y) (* 32768.0 (seconds-per-frame)) 0.1) ) ) - (quaternion-zxy! (-> obj root quat) (-> obj facing-rot)) + (quaternion-zxy! (-> this root quat) (-> this facing-rot)) ) -(defmethod sunkenfisha-method-20 sunkenfisha ((obj sunkenfisha)) - (set! (-> obj path-dir) (- (-> obj path-dir))) - (set! (-> obj path-speed) 0.0) - (set! (-> obj targ-path-speed) - (rand-vu-float-range (-> obj path-normal-speed-lo) (-> obj path-normal-speed-hi)) +(defmethod sunkenfisha-method-20 sunkenfisha ((this sunkenfisha)) + (set! (-> this path-dir) (- (-> this path-dir))) + (set! (-> this path-speed) 0.0) + (set! (-> this targ-path-speed) + (rand-vu-float-range (-> this path-normal-speed-lo) (-> this path-normal-speed-hi)) ) - (set! (-> obj change-path-dir-time) - (+ (-> *display* base-frame-counter) (rand-vu-int-range (seconds 5) (seconds 18))) + (set! (-> this change-path-dir-time) (+ (current-time) (rand-vu-int-range (seconds 5) (seconds 18)))) + (set! (-> this targ-local-path-offset y) + (* 0.5 (+ (-> this targ-local-path-offset y) (-> this local-path-offset y))) ) - (set! (-> obj targ-local-path-offset y) - (* 0.5 (+ (-> obj targ-local-path-offset y) (-> obj local-path-offset y))) - ) - (let* ((f0-8 (-> obj local-path-offset x)) - (f1-3 (- (-> obj targ-local-path-offset x) f0-8)) + (let* ((f0-8 (-> this local-path-offset x)) + (f1-3 (- (-> this targ-local-path-offset x) f0-8)) ) (when (< (fabs f1-3) 12288.0) (if (>= f1-3 0.0) - (set! (-> obj targ-local-path-offset x) (fmin (+ 12288.0 f0-8) (-> obj max-local-path-offset x))) - (set! (-> obj targ-local-path-offset x) (fmax (+ -12288.0 f0-8) (- (-> obj max-local-path-offset x)))) + (set! (-> this targ-local-path-offset x) (fmin (+ 12288.0 f0-8) (-> this max-local-path-offset x))) + (set! (-> this targ-local-path-offset x) (fmax (+ -12288.0 f0-8) (- (-> this max-local-path-offset x)))) ) ) ) @@ -178,7 +174,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (if (>= (-> *display* base-frame-counter) (-> self change-path-dir-time)) + (if (>= (current-time) (-> self change-path-dir-time)) (sunkenfisha-method-20 self) ) (sunkenfisha-method-24 self) @@ -213,106 +209,108 @@ :post ja-post ) -(defmethod sunkenfisha-method-26 sunkenfisha ((obj sunkenfisha)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj (-> obj entity)) - (set-vector! (-> obj root scale) 6.0 6.0 6.0 1.0) +(defmethod sunkenfisha-method-26 sunkenfisha ((this sunkenfisha)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this (-> this entity)) + (set-vector! (-> this root scale) 6.0 6.0 6.0 1.0) (let ((v1-3 (rand-vu-int-count 3))) (cond ((zero? v1-3) - (initialize-skeleton obj *sunkenfisha-red-yellow-sg* '()) + (initialize-skeleton this *sunkenfisha-red-yellow-sg* '()) ) ((= v1-3 1) - (initialize-skeleton obj *sunkenfisha-yellow-blue-sg* '()) + (initialize-skeleton this *sunkenfisha-yellow-blue-sg* '()) ) ((= v1-3 2) - (initialize-skeleton obj *sunkenfisha-yellow-eye-sg* '()) + (initialize-skeleton this *sunkenfisha-yellow-eye-sg* '()) ) ) ) (ja-channel-set! 1) - (let ((s5-0 (-> obj skel root-channel 0))) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 6)) + (the-as art-joint-anim (-> this draw art-group data 6)) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) ) -(defmethod sunkenfisha-method-27 sunkenfisha ((obj sunkenfisha)) +(defmethod sunkenfisha-method-27 sunkenfisha ((this sunkenfisha)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) - (vector-reset! (-> obj path-trans-offset)) - (set! (-> obj path-u) (rand-vu-float-range 0.0 1.0)) + (vector-reset! (-> this path-trans-offset)) + (set! (-> this path-u) (rand-vu-float-range 0.0 1.0)) (if (zero? (rand-vu-int-count 2)) - (set! (-> obj path-dir) 1.0) - (set! (-> obj path-dir) -1.0) + (set! (-> this path-dir) 1.0) + (set! (-> this path-dir) -1.0) ) - (set-vector! (-> obj max-local-path-offset) 16384.0 28672.0 0.0 1.0) + (set-vector! (-> this max-local-path-offset) 16384.0 28672.0 0.0 1.0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-5 (res-lump-data (-> obj entity) 'path-max-offset (pointer float) :tag-ptr (& sv-16)))) + (let ((v1-5 (res-lump-data (-> this entity) 'path-max-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-5 - (set! (-> obj max-local-path-offset x) (-> v1-5 0)) - (set! (-> obj max-local-path-offset y) (-> v1-5 1)) + (set! (-> this max-local-path-offset x) (-> v1-5 0)) + (set! (-> this max-local-path-offset y) (-> v1-5 1)) ) ) - (set-vector! (-> obj local-path-offset) 0.0 0.0 0.0 1.0) - (set! (-> obj local-path-offset x) - (rand-vu-float-range (- (-> obj max-local-path-offset x)) (-> obj max-local-path-offset x)) + (set-vector! (-> this local-path-offset) 0.0 0.0 0.0 1.0) + (set! (-> this local-path-offset x) + (rand-vu-float-range (- (-> this max-local-path-offset x)) (-> this max-local-path-offset x)) ) - (set! (-> obj local-path-offset y) - (rand-vu-float-range (- (-> obj max-local-path-offset y)) (-> obj max-local-path-offset y)) + (set! (-> this local-path-offset y) + (rand-vu-float-range (- (-> this max-local-path-offset y)) (-> this max-local-path-offset y)) ) - (set! (-> obj targ-local-path-offset quad) (-> obj local-path-offset quad)) - (set! (-> obj targ-local-path-offset x) - (rand-vu-float-range (- (-> obj max-local-path-offset x)) (-> obj max-local-path-offset x)) + (set! (-> this targ-local-path-offset quad) (-> this local-path-offset quad)) + (set! (-> this targ-local-path-offset x) + (rand-vu-float-range (- (-> this max-local-path-offset x)) (-> this max-local-path-offset x)) ) - (set! (-> obj targ-local-path-offset y) - (rand-vu-float-range (- (-> obj max-local-path-offset y)) (-> obj max-local-path-offset y)) + (set! (-> this targ-local-path-offset y) + (rand-vu-float-range (- (-> this max-local-path-offset y)) (-> this max-local-path-offset y)) ) - (vector-! (-> obj local-path-offset-dir) (-> obj targ-local-path-offset) (-> obj local-path-offset)) - (vector-normalize! (-> obj local-path-offset-dir) 1.0) - (set! (-> obj change-path-dir-time) - (+ (-> *display* base-frame-counter) (rand-vu-int-range (seconds 5) (seconds 18))) - ) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (vector-! (-> this local-path-offset-dir) (-> this targ-local-path-offset) (-> this local-path-offset)) + (vector-normalize! (-> this local-path-offset-dir) 1.0) + (set! (-> this change-path-dir-time) (+ (current-time) (rand-vu-int-range (seconds 5) (seconds 18)))) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-16 (res-lump-data (-> obj entity) 'path-trans-offset (pointer float) :tag-ptr (& sv-32)))) + (let ((v1-16 (res-lump-data (-> this entity) 'path-trans-offset (pointer float) :tag-ptr (& sv-32)))) (when v1-16 - (+! (-> obj path-trans-offset x) (-> v1-16 0)) - (+! (-> obj path-trans-offset y) (-> v1-16 1)) - (+! (-> obj path-trans-offset z) (-> v1-16 2)) + (+! (-> this path-trans-offset x) (-> v1-16 0)) + (+! (-> this path-trans-offset y) (-> v1-16 1)) + (+! (-> this path-trans-offset z) (-> v1-16 2)) ) ) - (if (< (-> obj path curve num-cverts) 2) + (if (< (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) (let ((f28-0 8192.0) (f30-0 26624.0) ) (set! sv-48 (new 'static 'res-tag)) - (let ((v1-23 (res-lump-data (-> obj entity) 'speed (pointer float) :tag-ptr (& sv-48)))) + (let ((v1-23 (res-lump-data (-> this entity) 'speed (pointer float) :tag-ptr (& sv-48)))) (when v1-23 (set! f28-0 (-> v1-23 0)) (set! f30-0 (-> v1-23 1)) ) ) - (let ((f0-35 (path-distance (-> obj path)))) - (set! (-> obj path-normal-speed-lo) (/ f28-0 f0-35)) - (set! (-> obj path-normal-speed-hi) (/ f30-0 f0-35)) + (let ((f0-35 (path-distance (-> this path)))) + (set! (-> this path-normal-speed-lo) (/ f28-0 f0-35)) + (set! (-> this path-normal-speed-hi) (/ f30-0 f0-35)) ) ) - (set! (-> obj path-speed-seek-speed) (* 2.0 (- (-> obj path-normal-speed-hi) (-> obj path-normal-speed-lo)))) - (set! (-> obj path-speed) (rand-vu-float-range (-> obj path-normal-speed-lo) (-> obj path-normal-speed-hi))) - (set! (-> obj targ-path-speed) (-> obj path-speed)) + (set! (-> this path-speed-seek-speed) + (* 2.0 (- (-> this path-normal-speed-hi) (-> this path-normal-speed-lo))) + ) + (set! (-> this path-speed) + (rand-vu-float-range (-> this path-normal-speed-lo) (-> this path-normal-speed-hi)) + ) + (set! (-> this targ-path-speed) (-> this path-speed)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (path-control-method-14 (-> obj path) s4-0 (-> obj path-u)) - (set-vector! (-> obj facing-rot) 0.0 (atan (-> s4-0 x) (-> s4-0 z)) 0.0 1.0) + (path-control-method-14 (-> this path) s4-0 (-> this path-u)) + (set-vector! (-> this facing-rot) 0.0 (atan (-> s4-0 x) (-> s4-0 z)) 0.0 1.0) ) - (if (< (-> obj path-dir) 0.0) - (set! (-> obj facing-rot y) (- (-> obj facing-rot y))) + (if (< (-> this path-dir) 0.0) + (set! (-> this facing-rot y) (- (-> this facing-rot y))) ) ) @@ -324,12 +322,12 @@ (none) ) -(defmethod init-from-entity! sunkenfisha ((obj sunkenfisha) (arg0 entity-actor)) - (sunkenfisha-method-26 obj) - (sunkenfisha-method-27 obj) - (let ((s5-0 (+ (res-lump-value (-> obj entity) 'count uint128 :default (the-as uint128 1)) -1))) +(defmethod init-from-entity! sunkenfisha ((this sunkenfisha) (arg0 entity-actor)) + (sunkenfisha-method-26 this) + (sunkenfisha-method-27 this) + (let ((s5-0 (+ (res-lump-value (-> this entity) 'count uint128 :default (the-as uint128 1)) -1))) (while (> (the-as int s5-0) 0) - (process-spawn sunkenfisha (-> obj entity) :to obj) + (process-spawn sunkenfisha (-> this entity) :to this) (+! s5-0 -1) ) ) diff --git a/goal_src/jak1/levels/sunken/sunken-obs.gc b/goal_src/jak1/levels/sunken/sunken-obs.gc index e671dbe292..e04b03ea46 100644 --- a/goal_src/jak1/levels/sunken/sunken-obs.gc +++ b/goal_src/jak1/levels/sunken/sunken-obs.gc @@ -85,12 +85,12 @@ ) ) -(defmethod get-unlit-skel side-to-side-plat ((obj side-to-side-plat)) +(defmethod get-unlit-skel side-to-side-plat ((this side-to-side-plat)) *side-to-side-plat-sg* ) -(defmethod baseplat-method-24 side-to-side-plat ((obj side-to-side-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 side-to-side-plat ((this side-to-side-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -108,29 +108,29 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod baseplat-method-26 side-to-side-plat ((obj side-to-side-plat)) - (set! (-> obj part-ry) (+ 16384.0 (quaternion-y-angle (-> obj root-override quat)))) +(defmethod baseplat-method-26 side-to-side-plat ((this side-to-side-plat)) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) (none) ) -(defmethod baseplat-method-25 side-to-side-plat ((obj side-to-side-plat)) - (let ((v0-0 (create-launch-control (-> *part-group-id-table* 436) obj))) - (set! (-> obj part) v0-0) +(defmethod baseplat-method-25 side-to-side-plat ((this side-to-side-plat)) + (let ((v0-0 (create-launch-control (-> *part-group-id-table* 436) this))) + (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) -(defmethod baseplat-method-20 side-to-side-plat ((obj side-to-side-plat)) - (when (nonzero? (-> obj part)) - (set! (-> *part-id-table* 1713 init-specs 14 initial-valuef) (-> obj part-ry)) - (set! (-> *part-id-table* 1714 init-specs 19 initial-valuef) (-> obj part-ry)) - (spawn (-> obj part) (-> obj root-override trans)) +(defmethod baseplat-method-20 side-to-side-plat ((this side-to-side-plat)) + (when (nonzero? (-> this part)) + (set! (-> *part-id-table* 1713 init-specs 14 initial-valuef) (-> this part-ry)) + (set! (-> *part-id-table* 1714 init-specs 19 initial-valuef) (-> this part-ry)) + (spawn (-> this part) (-> this root-override trans)) ) (none) ) @@ -151,8 +151,8 @@ :bounds (static-spherem 0 0 0 10) ) -(defmethod set-stack-size! sunkencam ((obj sunkencam)) - (stack-size-set! (-> obj main-thread) 512) +(defmethod set-stack-size! sunkencam ((this sunkencam)) + (stack-size-set! (-> this main-thread) 512) (none) ) @@ -232,8 +232,8 @@ (send-event gp-2 'change-state cam-fixed 0) (send-event gp-2 'change-state *camera-base-mode* 0) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) @@ -269,8 +269,8 @@ (new 'static 'vector :x 2834432.0 :y -634880.0 :z -6811648.0) 1.3 ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) ) @@ -336,20 +336,20 @@ :post ja-post ) -(defmethod init-from-entity! seaweed ((obj seaweed) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *seaweed-sg* '()) +(defmethod init-from-entity! seaweed ((this seaweed) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *seaweed-sg* '()) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) data 0 @@ -361,8 +361,8 @@ ) ) ) - (set! (-> obj anim-speed) (rand-vu-float-range 0.2 0.4)) - (set! *seaweed* obj) + (set! (-> this anim-speed) (rand-vu-float-range 0.2 0.4)) + (set! *seaweed* this) (go seaweed-idle) (none) ) diff --git a/goal_src/jak1/levels/sunken/sunken-pipegame.gc b/goal_src/jak1/levels/sunken/sunken-pipegame.gc index 7fef3ba56a..4b0c15185b 100644 --- a/goal_src/jak1/levels/sunken/sunken-pipegame.gc +++ b/goal_src/jak1/levels/sunken/sunken-pipegame.gc @@ -489,7 +489,7 @@ (none) ) -(defmethod sunken-pipegame-method-20 sunken-pipegame ((obj sunken-pipegame)) +(defmethod sunken-pipegame-method-20 sunken-pipegame ((this sunken-pipegame)) (let ((gp-0 0)) (if (task-complete? *game-info* (game-task sunken-pipe)) (+! gp-0 1) @@ -555,7 +555,7 @@ ) :code (behavior () (local-vars (v1-112 symbol)) - (let ((gp-0 (-> *display* base-frame-counter))) + (let ((gp-0 (current-time))) (if (not (handle->process (-> self prize (-> self challenge) actor-handle))) (go sunken-pipegame-end-play) ) @@ -576,14 +576,14 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((f30-0 0.0)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (let ((s5-3 (-> self prize (-> self challenge)))) (spawn (-> s5-3 sucked-up-part) (-> s5-3 sucked-up-jar-part-pos)) (spawn (-> s5-3 blown-out-part) (-> s5-3 blown-out-far-part-pos)) ) - (+! f30-0 (* 1024.0 (-> *display* seconds-per-frame))) + (+! f30-0 (* 1024.0 (seconds-per-frame))) (let ((s5-4 (new 'stack-no-clear 'vector))) (set! (-> s5-4 quad) (-> (the-as (pointer uint128) (&+ (&-> self stack 160) (* 144 (-> self challenge)))))) (let* ((f28-0 (-> s5-4 y)) @@ -611,7 +611,7 @@ (let ((s5-5 (-> self prize (-> self challenge)))) (spawn (-> s5-5 sucked-up-part) (-> s5-5 sucked-up-jar-part-pos)) (spawn (-> s5-5 blown-out-part) (-> s5-5 blown-out-far-part-pos)) - (set! f28-1 (seek f28-1 20480.0 (* 81920.0 (-> *display* seconds-per-frame)))) + (set! f28-1 (seek f28-1 20480.0 (* 81920.0 (seconds-per-frame)))) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> s5-5 jar-pos quad)) (let* ((f26-0 (-> s4-0 y)) @@ -637,7 +637,7 @@ ) ) ) - (until (>= (- (-> *display* base-frame-counter) gp-0) (-> self prize (-> self challenge) pipe-travel-time-to-far)) + (until (time-elapsed? gp-0 (-> self prize (-> self challenge) pipe-travel-time-to-far)) (let ((s5-6 (-> self prize (-> self challenge)))) (spawn (-> s5-6 sucked-up-part) (-> s5-6 sucked-up-jar-part-pos)) (spawn (-> s5-6 blown-out-part) (-> s5-6 blown-out-far-part-pos)) @@ -648,7 +648,7 @@ (sunken-pipegame-method-22 self #t) (let ((f30-1 20480.0)) (until (= f30-1 0.0) - (set! f30-1 (seek f30-1 0.0 (* 81920.0 (-> *display* seconds-per-frame)))) + (set! f30-1 (seek f30-1 0.0 (* 81920.0 (seconds-per-frame)))) (let ((gp-1 (-> self prize (-> self challenge)))) (spawn (-> gp-1 sucked-up-part) (-> gp-1 sucked-up-jar-part-pos)) (spawn (-> gp-1 blown-out-part) (-> gp-1 blown-out-far-part-pos)) @@ -678,9 +678,9 @@ (suspend) (set! v1-112 (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags grabbed))))) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sleep (-> self ticker) (-> self prize (-> self challenge) puzzle-delay)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (completed? (-> self ticker)) (suspend) ) @@ -692,13 +692,13 @@ (kill-current-level-hint '(camera) '() 'exit) (ambient-hint-spawn "gamcam26" (the-as vector #f) *entity-pool* 'camera) (set! (-> self abort-audio-if-beaten?) #t) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((f30-2 0.0)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (let ((gp-2 (-> self prize (-> self challenge)))) (spawn (-> gp-2 sucked-up-part) (-> gp-2 sucked-up-far-part-pos)) (spawn (-> gp-2 blown-out-part) (-> gp-2 blown-out-jar-part-pos)) - (+! f30-2 (* 1024.0 (-> *display* seconds-per-frame))) + (+! f30-2 (* 1024.0 (seconds-per-frame))) (let ((s5-7 (new 'stack-no-clear 'vector))) (set! (-> s5-7 quad) (-> gp-2 far-pos quad)) (let* ((f28-2 (-> s5-7 y)) @@ -727,7 +727,7 @@ (let ((gp-3 (-> self prize (-> self challenge)))) (spawn (-> gp-3 sucked-up-part) (-> gp-3 sucked-up-far-part-pos)) (spawn (-> gp-3 blown-out-part) (-> gp-3 blown-out-jar-part-pos)) - (set! f28-3 (seek f28-3 20480.0 (* 81920.0 (-> *display* seconds-per-frame)))) + (set! f28-3 (seek f28-3 20480.0 (* 81920.0 (seconds-per-frame)))) (let ((s5-8 (new 'stack-no-clear 'vector))) (set! (-> s5-8 quad) (-> gp-3 far-pos quad)) (let* ((f26-1 (-> s5-8 y)) @@ -762,10 +762,8 @@ (+! (-> a0-109 y) 40960.0) (send-event (handle->process (-> v1-184 actor-handle)) 'trans a0-109) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (-> self prize (-> self challenge) pipe-travel-time-to-jar) - ) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (-> self prize (-> self challenge) pipe-travel-time-to-jar)) (let ((gp-4 (-> self prize (-> self challenge)))) (spawn (-> gp-4 sucked-up-part) (-> gp-4 sucked-up-far-part-pos)) (spawn (-> gp-4 blown-out-part) (-> gp-4 blown-out-jar-part-pos)) @@ -774,7 +772,7 @@ ) (let ((f30-3 20480.0)) (until (= f30-3 0.0) - (set! f30-3 (seek f30-3 0.0 (* 40960.0 (-> *display* seconds-per-frame)))) + (set! f30-3 (seek f30-3 0.0 (* 40960.0 (seconds-per-frame)))) (let ((v1-203 (new 'stack-no-clear 'vector))) (set! (-> v1-203 quad) (-> (the-as (pointer uint128) (&+ (&-> self stack 160) (* 144 (-> self challenge)))))) (+! (-> v1-203 y) f30-3) @@ -793,8 +791,8 @@ (suspend) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1.5)) (suspend) ) (ambient-hint-spawn "st-lose" (the-as vector #f) *entity-pool* 'stinger) @@ -836,13 +834,13 @@ ) ) -(defmethod sunken-pipegame-method-22 sunken-pipegame ((obj sunken-pipegame) (arg0 symbol)) - (let* ((v1-0 (-> obj challenge)) +(defmethod sunken-pipegame-method-22 sunken-pipegame ((this sunken-pipegame) (arg0 symbol)) + (let* ((v1-0 (-> this challenge)) (a2-0 v1-0) ) (cond ((zero? a2-0) - (let ((v1-5 (handle->process (-> obj prize v1-0 actor-handle)))) + (let ((v1-5 (handle->process (-> this prize v1-0 actor-handle)))) (when v1-5 (if arg0 (restore-collide-with-as (-> (the-as collectable v1-5) root-override)) @@ -852,7 +850,7 @@ ) ) ((or (= a2-0 1) (= a2-0 2)) - (let ((v1-13 (handle->process (-> obj prize v1-0 actor-handle)))) + (let ((v1-13 (handle->process (-> this prize v1-0 actor-handle)))) (when v1-13 (if arg0 (restore-collide-with-as (-> (the-as collectable v1-13) root-override)) @@ -866,12 +864,12 @@ (none) ) -(defmethod sunken-pipegame-method-21 sunken-pipegame ((obj sunken-pipegame) (arg0 symbol)) +(defmethod sunken-pipegame-method-21 sunken-pipegame ((this sunken-pipegame) (arg0 symbol)) (if arg0 - (logior! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) ) - (let ((v1-4 (-> obj child))) + (let ((v1-4 (-> this child))) (while v1-4 (if arg0 (logior! (-> v1-4 0 mask) (process-mask actor-pause)) @@ -883,9 +881,9 @@ #f ) -(defmethod deactivate sunken-pipegame ((obj sunken-pipegame)) +(defmethod deactivate sunken-pipegame ((this sunken-pipegame)) (dotimes (s5-0 3) - (let ((s4-0 (-> obj prize s5-0))) + (let ((s4-0 (-> this prize s5-0))) (if (nonzero? (-> s4-0 sucked-up-part)) (kill-and-free-particles (-> s4-0 sucked-up-part)) ) @@ -894,13 +892,13 @@ ) ) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod relocate sunken-pipegame ((obj sunken-pipegame) (arg0 int)) +(defmethod relocate sunken-pipegame ((this sunken-pipegame) (arg0 int)) (dotimes (v1-0 3) - (let ((a0-4 (-> obj prize v1-0))) + (let ((a0-4 (-> this prize v1-0))) (when (nonzero? (-> a0-4 sucked-up-part)) (if (nonzero? (-> a0-4 sucked-up-part)) (&+! (-> a0-4 sucked-up-part) arg0) @@ -915,33 +913,33 @@ ) (the-as sunken-pipegame - ((the-as (function process-drawable int process-drawable) (find-parent-method sunken-pipegame 7)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method sunken-pipegame 7)) this arg0) ) ) -(defmethod init-from-entity! sunken-pipegame ((obj sunken-pipegame) (arg0 entity-actor)) - (set! (-> obj abort-audio-if-beaten?) #f) - (stack-size-set! (-> obj main-thread) 512) - (set! (-> obj challenge) -1) +(defmethod init-from-entity! sunken-pipegame ((this sunken-pipegame) (arg0 entity-actor)) + (set! (-> this abort-audio-if-beaten?) #f) + (stack-size-set! (-> this main-thread) 512) + (set! (-> this challenge) -1) (dotimes (v1-3 3) - (set! (-> obj prize v1-3 actor-handle) (the-as handle #f)) + (set! (-> this prize v1-3 actor-handle) (the-as handle #f)) ) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj challenges-mask) (sunken-pipegame-method-20 obj)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this challenges-mask) (sunken-pipegame-method-20 this)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'quaternion)) ) (quaternion-identity! s3-0) (dotimes (s2-0 3) - (let* ((s0-0 (-> obj prize s2-0)) + (let* ((s0-0 (-> this prize s2-0)) (v1-17 (ash 1 s2-0)) - (s1-1 (logtest? v1-17 (-> obj challenges-mask))) + (s1-1 (logtest? v1-17 (-> this challenges-mask))) ) - (eval-path-curve-div! (-> obj path) (-> s0-0 jar-pos) (the float (* s2-0 2)) 'interp) - (eval-path-curve-div! (-> obj path) (-> s0-0 far-pos) (the float (+ (* s2-0 2) 1)) 'interp) + (eval-path-curve-div! (-> this path) (-> s0-0 jar-pos) (the float (* s2-0 2)) 'interp) + (eval-path-curve-div! (-> this path) (-> s0-0 far-pos) (the float (+ (* s2-0 2) 1)) 'interp) (set! (-> s0-0 sucked-up-jar-part-pos quad) (-> s0-0 jar-pos quad)) (set! (-> s0-0 sucked-up-far-part-pos quad) (-> s0-0 far-pos quad)) (set! (-> s0-0 blown-out-jar-part-pos quad) (-> s0-0 jar-pos quad)) @@ -955,14 +953,14 @@ (set! (-> s0-0 pipe-travel-time-to-far) (seconds 8.5)) (set! (-> s0-0 pipe-travel-time-to-jar) (seconds 2.5)) (set-vector! s4-0 -30720.0 1146.88 5120.0 1.0) - (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 448) obj)) - (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 451) obj)) + (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 448) this)) + (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 451) this)) (+! (-> s0-0 jar-pos y) 11673.6) (+! (-> s0-0 far-pos y) 11673.6) (when (not s1-1) (set! (-> s0-0 actor-handle) (ppointer->handle - (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type fuel-cell) 45.0 #f obj (the-as fact-info #f)) + (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type fuel-cell) 45.0 #f this (the-as fact-info #f)) ) ) (let ((a1-10 (handle->process (-> s0-0 actor-handle)))) @@ -977,15 +975,15 @@ (set! (-> s0-0 pipe-travel-time-to-far) (seconds 5.5)) (set! (-> s0-0 pipe-travel-time-to-jar) (seconds 2.5)) (set-vector! s4-0 0.0 1146.88 5120.0 1.0) - (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 449) obj)) - (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 452) obj)) + (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 449) this)) + (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 452) this)) (+! (-> s0-0 jar-pos y) 7168.0) (+! (-> s0-0 far-pos y) 7168.0) (+! (-> s0-0 blown-out-far-part-pos y) 4096.0) (when (not s1-1) (set! (-> s0-0 actor-handle) (ppointer->handle - (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type buzzer) 49.0 #f obj (the-as fact-info #f)) + (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type buzzer) 49.0 #f this (the-as fact-info #f)) ) ) (let ((s0-1 (handle->process (-> s0-0 actor-handle)))) @@ -1001,15 +999,15 @@ (set! (-> s0-0 pipe-travel-time-to-far) (seconds 4.5)) (set! (-> s0-0 pipe-travel-time-to-jar) (seconds 2.5)) (set-vector! s4-0 30720.0 1146.88 5120.0 1.0) - (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 450) obj)) - (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 453) obj)) + (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 450) this)) + (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 453) this)) (+! (-> s0-0 jar-pos y) 7168.0) (+! (-> s0-0 far-pos y) 7168.0) (+! (-> s0-0 blown-out-far-part-pos y) 4096.0) (when (not s1-1) (set! (-> s0-0 actor-handle) (ppointer->handle - (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type buzzer) 65585.0 #f obj (the-as fact-info #f)) + (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type buzzer) 65585.0 #f this (the-as fact-info #f)) ) ) (let ((s0-2 (handle->process (-> s0-0 actor-handle)))) @@ -1022,9 +1020,9 @@ ) ) ) - (vector+! s4-0 s4-0 (-> obj root trans)) - (let ((v1-102 (process-spawn sunken-pipegame-button s4-0 s3-0 arg0 s1-1 :to obj))) - (set! (-> obj button s2-0) (the-as (pointer sunken-pipegame-button) v1-102)) + (vector+! s4-0 s4-0 (-> this root trans)) + (let ((v1-102 (process-spawn sunken-pipegame-button s4-0 s3-0 arg0 s1-1 :to this))) + (set! (-> this button s2-0) (the-as (pointer sunken-pipegame-button) v1-102)) (set! (-> (the-as (pointer sunken-pipegame-button) v1-102) 0 button-id) s2-0) ) ) diff --git a/goal_src/jak1/levels/sunken/sunken-water.gc b/goal_src/jak1/levels/sunken/sunken-water.gc index 9026490b3b..f0561c2aba 100644 --- a/goal_src/jak1/levels/sunken/sunken-water.gc +++ b/goal_src/jak1/levels/sunken/sunken-water.gc @@ -72,10 +72,10 @@ :init-specs ((:r 255.0) (:g 128.0 128.0) (:b 0.0) (:fade-a -1.28)) ) -(defmethod draw-ripple sunken-water ((obj sunken-water)) - (set! (-> obj draw ripple send-query) #t) - (let ((gp-0 (-> obj draw ripple query))) - (let ((a0-1 (-> *display* base-frame-counter))) +(defmethod draw-ripple sunken-water ((this sunken-water)) + (set! (-> this draw ripple send-query) #t) + (let ((gp-0 (-> this draw ripple query))) + (let ((a0-1 (current-time))) (set! (-> gp-0 start-vertex) (logand (* 13 (logand a0-1 127)) 127)) ) (set! (-> gp-0 vertex-skip) 128) @@ -111,7 +111,7 @@ (cond ((< (get-current-phase (-> self sync)) (-> self deadly-time)) (when (!= (-> self deadly-fade) 1.0) - (seek! (-> self deadly-fade) 1.0 (* 8.0 (-> *display* seconds-per-frame))) + (seek! (-> self deadly-fade) 1.0 (* 8.0 (seconds-per-frame))) (let ((f30-0 (-> self deadly-fade))) (vector-lerp! (-> self draw color-mult) (-> self safe-color-mult) (-> self deadly-color-mult) f30-0) (vector-lerp! @@ -136,7 +136,7 @@ (else (logclear! (-> self flags) (water-flags wt19)) (when (!= (-> self deadly-fade) 0.0) - (seek! (-> self deadly-fade) 0.0 (* 8.0 (-> *display* seconds-per-frame))) + (seek! (-> self deadly-fade) 0.0 (* 8.0 (seconds-per-frame))) (let ((f30-1 (-> self deadly-fade))) (vector-lerp! (-> self draw color-mult) (-> self safe-color-mult) (-> self deadly-color-mult) f30-1) (vector-lerp! @@ -178,23 +178,23 @@ :post ja-post ) -(defmethod water-vol-method-25 sunken-water ((obj sunken-water)) +(defmethod water-vol-method-25 sunken-water ((this sunken-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-25))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj playing-deadly-sound?) #f) - (set-vector! (-> obj safe-color-mult) 0.125 0.225 0.22 0.5) - (set-vector! (-> obj safe-color-emissive) 0.0 0.0 0.0 1.0) - (set-vector! (-> obj deadly-color-mult) 0.125 0.225 0.22 0.5) - (set-vector! (-> obj deadly-color-emissive) 0.33 0.6 0.0 1.0) - (let ((s5-0 (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15))) - (let ((f0-16 (res-lump-float (-> obj entity) 'percent :default -1.0))) + (set! (-> this playing-deadly-sound?) #f) + (set-vector! (-> this safe-color-mult) 0.125 0.225 0.22 0.5) + (set-vector! (-> this safe-color-emissive) 0.0 0.0 0.0 1.0) + (set-vector! (-> this deadly-color-mult) 0.125 0.225 0.22 0.5) + (set-vector! (-> this deadly-color-emissive) 0.33 0.6 0.0 1.0) + (let ((s5-0 (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15))) + (let ((f0-16 (res-lump-float (-> this entity) 'percent :default -1.0))) (if (or (< f0-16 0.0) (< 1.0 f0-16)) (set! f0-16 (cond (s5-0 0.5 ) - ((logtest? (water-flags wt19) (-> obj flags)) + ((logtest? (water-flags wt19) (-> this flags)) 1.0 ) (else @@ -206,42 +206,42 @@ (when (and s5-0 (or (= f0-16 0.0) (= f0-16 1.0))) (set! s5-0 #f) (if (= f0-16 0.0) - (logior! (-> obj flags) (water-flags wt19)) - (logclear! (-> obj flags) (water-flags wt19)) + (logior! (-> this flags) (water-flags wt19)) + (logclear! (-> this flags) (water-flags wt19)) ) ) - (set! (-> obj use-sync?) s5-0) - (set! (-> obj deadly-time) f0-16) + (set! (-> this use-sync?) s5-0) + (set! (-> this deadly-time) f0-16) ) (when s5-0 - (if (< (get-current-phase (-> obj sync)) (-> obj deadly-time)) - (set! (-> obj flags) (the-as water-flags (logior (water-flags wt19) (-> obj flags)))) - (set! (-> obj flags) (the-as water-flags (logclear (-> obj flags) (water-flags wt19)))) + (if (< (get-current-phase (-> this sync)) (-> this deadly-time)) + (set! (-> this flags) (the-as water-flags (logior (water-flags wt19) (-> this flags)))) + (set! (-> this flags) (the-as water-flags (logclear (-> this flags) (water-flags wt19)))) ) ) ) (none) ) -(defmethod water-vol-method-22 sunken-water ((obj sunken-water)) +(defmethod water-vol-method-22 sunken-water ((this sunken-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj play-ambient-sound?) #f) + (set! (-> this play-ambient-sound?) #f) (cond - ((logtest? (water-flags wt19) (-> obj flags)) - (set! (-> obj draw color-mult quad) (-> obj deadly-color-mult quad)) - (set! (-> obj draw color-emissive quad) (-> obj deadly-color-emissive quad)) - (set! (-> obj deadly-fade) 1.0) + ((logtest? (water-flags wt19) (-> this flags)) + (set! (-> this draw color-mult quad) (-> this deadly-color-mult quad)) + (set! (-> this draw color-emissive quad) (-> this deadly-color-emissive quad)) + (set! (-> this deadly-fade) 1.0) ) (else - (set! (-> obj draw color-mult quad) (-> obj safe-color-mult quad)) - (set! (-> obj draw color-emissive quad) (-> obj safe-color-emissive quad)) - (set! (-> obj deadly-fade) 0.0) + (set! (-> this draw color-mult quad) (-> this safe-color-mult quad)) + (set! (-> this draw color-emissive quad) (-> this safe-color-emissive quad)) + (set! (-> this deadly-fade) 0.0) ) ) (let ((s5-0 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) s5-0) + (set! (-> this draw ripple) s5-0) (set! (-> s5-0 global-scale) 3072.0) (set! (-> s5-0 close-fade-dist) 163840.0) (set! (-> s5-0 far-fade-dist) 245760.0) diff --git a/goal_src/jak1/levels/sunken/target-tube.gc b/goal_src/jak1/levels/sunken/target-tube.gc index 89ee05e2cf..4ac9bc3604 100644 --- a/goal_src/jak1/levels/sunken/target-tube.gc +++ b/goal_src/jak1/levels/sunken/target-tube.gc @@ -161,7 +161,7 @@ 100.0 0.0 ) - (* 200.0 (-> *display* seconds-per-frame)) + (* 200.0 (seconds-per-frame)) ) (let ((f30-0 (-> self tube tube-sound-vol)) (f0-5 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 122880.0)) @@ -277,7 +277,7 @@ (vector-v++! (-> self control unknown-vector00) s4-2) ) (let* ((f1-6 (-> self control unknown-surface01 fric)) - (f1-9 (- 1.0 (* 60.0 (-> *display* seconds-per-frame) (- 1.0 f1-6)))) + (f1-9 (- 1.0 (* 60.0 (seconds-per-frame) (- 1.0 f1-6)))) (f0-21 (* 0.5 (+ 1.0 f1-9))) ) (set! (-> self control unknown-vector00 x) (* (-> self control unknown-vector00 x) f0-21)) @@ -501,7 +501,7 @@ (set! (-> self tube entity) (-> a0-4 entity)) ) ) - (set! (-> self tube start-time) (-> *display* base-frame-counter)) + (set-time! (-> self tube start-time)) (set! (-> self tube tube-sound-id) (new-sound-id)) (set! (-> self tube tube-sound-vol) 0.0) (target-collide-set! 'tube 0.0) @@ -560,7 +560,7 @@ 0.0 36864.0 ) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) (set! (-> self tube turn-anim-vel) @@ -572,7 +572,7 @@ ) ) ) - (+! (-> self tube turn-anim-frame) (* (-> self tube turn-anim-vel) (-> *display* seconds-per-frame))) + (+! (-> self tube turn-anim-frame) (* (-> self tube turn-anim-vel) (seconds-per-frame))) (set! (-> self tube turn-anim-frame) (fmax -20.0 (fmin 20.0 (-> self tube turn-anim-frame)))) (cond ((and (>= (-> self tube turn-anim-frame) 20.0) (>= (-> self tube turn-anim-vel) 0.0)) @@ -639,7 +639,7 @@ (defstate target-tube-jump (target) :event (-> target-tube-start event) :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *tube-jump-mods*) @@ -653,7 +653,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 float) (arg1 float)) @@ -711,9 +711,9 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (let ((gp-0 (-> self attack-info))) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self state-flags) (state-flags being-attacked)) - (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self game hit-time)) (when (not (logtest? (-> arg1 mask) (attack-mask vector))) (vector-! (-> arg1 vector) @@ -835,10 +835,10 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (until v1-40 (suspend) - (set! v1-40 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (movie?)))) + (set! v1-40 (and (time-elapsed? (-> self state-time) (seconds 1)) (not (movie?)))) ) (go target-tube) ) @@ -988,13 +988,13 @@ :code anim-loop ) -(defmethod init-from-entity! slide-control ((obj slide-control) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj target) (the-as handle #f)) - (go (method-of-object obj slide-control-watch)) +(defmethod init-from-entity! slide-control ((this slide-control) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this target) (the-as handle #f)) + (go (method-of-object this slide-control-watch)) (none) ) diff --git a/goal_src/jak1/levels/sunken/wall-plat.gc b/goal_src/jak1/levels/sunken/wall-plat.gc index 34b1c8e690..7ccd1faa7c 100644 --- a/goal_src/jak1/levels/sunken/wall-plat.gc +++ b/goal_src/jak1/levels/sunken/wall-plat.gc @@ -71,9 +71,9 @@ :trans rider-trans :code (behavior () (restore-collide-with-as (-> self root-override)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (seek! (-> self extended-amount) 1.0 (* 2.5 (-> *display* seconds-per-frame))) + (seek! (-> self extended-amount) 1.0 (* 2.5 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) (move-to-point! (-> self root-override) gp-0) @@ -120,9 +120,9 @@ ) :trans rider-trans :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (seek! (-> self extended-amount) 0.0 (* 2.5 (-> *display* seconds-per-frame))) + (seek! (-> self extended-amount) 0.0 (* 2.5 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) (move-to-point! (-> self root-override) gp-0) @@ -185,10 +185,10 @@ :post rider-post ) -(defmethod init-from-entity! wall-plat ((obj wall-plat) (arg0 entity-actor)) - (set! (-> obj extended-amount) 0.0) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! wall-plat ((this wall-plat) (arg0 entity-actor)) + (set! (-> this extended-amount) 0.0) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -206,36 +206,36 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *wall-plat-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj use-sync?) (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.2 0.2)) - (let ((f30-0 (quaternion-y-angle (-> obj root-override quat))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *wall-plat-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this use-sync?) (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.2 0.2)) + (let ((f30-0 (quaternion-y-angle (-> this root-override quat))) (s4-1 (new 'stack-no-clear 'vector)) ) (set-vector! s4-1 0.0 0.0 (+ 1638.4 (res-lump-float arg0 'tunemeters)) 1.0) (vector-rotate-around-y! s4-1 s4-1 f30-0) - (vector+! (-> obj out-trans) (-> obj root-override trans) s4-1) + (vector+! (-> this out-trans) (-> this root-override trans) s4-1) (set-vector! s4-1 0.0 0.0 20480.0 1.0) (vector-rotate-around-y! s4-1 s4-1 f30-0) - (vector+! (-> obj in-trans) (-> obj out-trans) s4-1) + (vector+! (-> this in-trans) (-> this out-trans) s4-1) ) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (cond - ((-> obj use-sync?) - (logclear! (-> obj mask) (process-mask actor-pause)) + ((-> this use-sync?) + (logclear! (-> this mask) (process-mask actor-pause)) (go wall-plat-sync-idle) ) (else diff --git a/goal_src/jak1/levels/sunken/wedge-plats.gc b/goal_src/jak1/levels/sunken/wedge-plats.gc index ce1d7d49b2..701487d87c 100644 --- a/goal_src/jak1/levels/sunken/wedge-plats.gc +++ b/goal_src/jak1/levels/sunken/wedge-plats.gc @@ -31,28 +31,24 @@ :code (behavior () (loop (set! (-> self rotate-inner) - (the float - (sar (shl (the int (+ (-> self rotate-inner) (* (-> self rotspeed) (-> *display* seconds-per-frame)))) 48) 48) - ) + (the float (sar (shl (the int (+ (-> self rotate-inner) (* (-> self rotspeed) (seconds-per-frame)))) 48) 48)) ) (set! (-> self rotate-outer) - (the float - (sar (shl (the int (- (-> self rotate-outer) (* (-> self rotspeed) (-> *display* seconds-per-frame)))) 48) 48) - ) + (the float (sar (shl (the int (- (-> self rotate-outer) (* (-> self rotspeed) (seconds-per-frame)))) 48) 48)) ) (suspend) ) ) ) -(defmethod init-from-entity! wedge-plat-master ((obj wedge-plat-master) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (set! (-> obj center quad) (-> arg0 extra trans quad)) - (+! (-> obj center y) 819.2) - (set! (-> obj rotspeed) (res-lump-float arg0 'rotspeed)) - (set! (-> obj rotate-inner) 0.0) - (set! (-> obj rotate-outer) 0.0) - (logclear! (-> obj mask) (process-mask actor-pause)) +(defmethod init-from-entity! wedge-plat-master ((this wedge-plat-master) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (set! (-> this center quad) (-> arg0 extra trans quad)) + (+! (-> this center y) 819.2) + (set! (-> this rotspeed) (res-lump-float arg0 'rotspeed)) + (set! (-> this rotate-inner) 0.0) + (set! (-> this rotate-outer) 0.0) + (logclear! (-> this mask) (process-mask actor-pause)) (go wedge-plat-master-idle) (none) ) @@ -81,8 +77,8 @@ :bounds (static-spherem 0 0 0 6) ) -(defmethod wedge-plat-method-27 wedge-plat ((obj wedge-plat)) - (let* ((a0-1 (-> obj master)) +(defmethod wedge-plat-method-27 wedge-plat ((this wedge-plat)) + (let* ((a0-1 (-> this master)) (v1-0 (if a0-1 (-> (the-as process-drawable (-> a0-1 ppointer)) brother) ) @@ -90,20 +86,20 @@ ) (when v1-0 (let ((s4-0 (&-> v1-0 27)) - (f30-0 (-> obj distance)) - (f28-0 (the float (sar (shl (the int (+ (the-as float (-> v1-0 32)) (-> obj offset))) 48) 48))) + (f30-0 (-> this distance)) + (f28-0 (the float (sar (shl (the int (+ (the-as float (-> v1-0 32)) (-> this offset))) 48) 48))) (s5-0 #f) ) (quaternion-axis-angle! - (-> obj root-override quat) + (-> this root-override quat) 0.0 1.0 0.0 (the float (sar (shl (the int (- 49152.0 f28-0)) 48) 48)) ) - (set! (-> obj basetrans x) (+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))) - (set! (-> obj basetrans y) (the-as float (-> s4-0 1))) - (set! (-> obj basetrans z) (+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))) + (set! (-> this basetrans x) (+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))) + (set! (-> this basetrans y) (the-as float (-> s4-0 1))) + (set! (-> this basetrans z) (+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))) (let ((f0-16 (cos f28-0))) (if (or (< 0.95 f0-16) (< f0-16 -0.95)) (set! s5-0 #t) @@ -168,8 +164,8 @@ (suspend) (ja :num! (seek! (ja-aframe 100.0 0))) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (ja :num-func num-func-identity :frame-num (ja-aframe 100.0 0)) (wedge-plat-method-27 self) (suspend) @@ -188,9 +184,9 @@ :post plat-post ) -(defmethod init-from-entity! wedge-plat ((obj wedge-plat) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! wedge-plat ((this wedge-plat) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -208,17 +204,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *wedge-plat-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (set! (-> obj master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) - (set! (-> obj offset) (res-lump-float arg0 'rotoffset)) - (set! (-> obj distance) (res-lump-float arg0 'distance :default 36864.0)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *wedge-plat-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (set! (-> this master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this offset) (res-lump-float arg0 'rotoffset)) + (set! (-> this distance) (res-lump-float arg0 'distance :default 36864.0)) + (logclear! (-> this mask) (process-mask actor-pause)) (go wedge-plat-idle) (none) ) @@ -241,8 +237,8 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod wedge-plat-method-27 wedge-plat-outer ((obj wedge-plat-outer)) - (let* ((a0-1 (-> obj master)) +(defmethod wedge-plat-method-27 wedge-plat-outer ((this wedge-plat-outer)) + (let* ((a0-1 (-> this master)) (v1-0 (if a0-1 (-> (the-as process-drawable (-> a0-1 ppointer)) brother) ) @@ -250,20 +246,20 @@ ) (when v1-0 (let ((s4-0 (&-> v1-0 27)) - (f30-0 (-> obj distance)) - (f28-0 (the float (sar (shl (the int (+ (the-as float (-> v1-0 33)) (-> obj offset))) 48) 48))) + (f30-0 (-> this distance)) + (f28-0 (the float (sar (shl (the int (+ (the-as float (-> v1-0 33)) (-> this offset))) 48) 48))) (s5-0 #f) ) (quaternion-axis-angle! - (-> obj root-override quat) + (-> this root-override quat) 0.0 1.0 0.0 (the float (sar (shl (the int (- 49152.0 f28-0)) 48) 48)) ) - (set! (-> obj basetrans x) (+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))) - (set! (-> obj basetrans y) (the-as float (-> s4-0 1))) - (set! (-> obj basetrans z) (+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))) + (set! (-> this basetrans x) (+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))) + (set! (-> this basetrans y) (the-as float (-> s4-0 1))) + (set! (-> this basetrans z) (+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))) (let ((f0-16 (sin f28-0))) (if (or (< 0.95 f0-16) (< f0-16 -0.95)) (set! s5-0 #t) @@ -327,8 +323,8 @@ (suspend) (ja :num! (seek! (ja-aframe 100.0 0))) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (ja :num-func num-func-identity :frame-num (ja-aframe 100.0 0)) (wedge-plat-method-27 self) (suspend) @@ -347,9 +343,9 @@ :post plat-post ) -(defmethod init-from-entity! wedge-plat-outer ((obj wedge-plat-outer) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! wedge-plat-outer ((this wedge-plat-outer) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -367,17 +363,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *wedge-plat-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (set! (-> obj master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) - (set! (-> obj offset) (res-lump-float arg0 'rotoffset)) - (set! (-> obj distance) (res-lump-float arg0 'distance :default 69632.0)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *wedge-plat-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (set! (-> this master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this offset) (res-lump-float arg0 'rotoffset)) + (set! (-> this distance) (res-lump-float arg0 'distance :default 69632.0)) + (logclear! (-> this mask) (process-mask actor-pause)) (go wedge-plat-outer-idle) (none) ) diff --git a/goal_src/jak1/levels/sunken/whirlpool.gc b/goal_src/jak1/levels/sunken/whirlpool.gc index 540041f39d..b3e51b4459 100644 --- a/goal_src/jak1/levels/sunken/whirlpool.gc +++ b/goal_src/jak1/levels/sunken/whirlpool.gc @@ -284,21 +284,21 @@ ) ) -(defmethod whirlpool-method-20 whirlpool ((obj whirlpool) (arg0 float)) +(defmethod whirlpool-method-20 whirlpool ((this whirlpool) (arg0 float)) (let* ((gp-0 (target-pos 0)) - (f28-0 (vector-vector-xz-distance (-> obj root-override trans) gp-0)) + (f28-0 (vector-vector-xz-distance (-> this root-override trans) gp-0)) ) (when (< f28-0 40960.0) (let* ((f0-2 (* 0.000024414063 (- 40960.0 f28-0))) (f26-0 (* f0-2 f0-2)) - (f0-7 (atan (- (-> gp-0 x) (-> obj root-override trans x)) (- (-> gp-0 z) (-> obj root-override trans z)))) - (f30-0 (* 0.5 f26-0 arg0 (-> *display* seconds-per-frame))) + (f0-7 (atan (- (-> gp-0 x) (-> this root-override trans x)) (- (-> gp-0 z) (-> this root-override trans z)))) + (f30-0 (* 0.5 f26-0 arg0 (seconds-per-frame))) (f24-0 (+ f0-7 f30-0)) - (f28-1 (- f28-0 (fmin f28-0 (* 0.16874999 f26-0 (fabs arg0) (-> *display* seconds-per-frame))))) + (f28-1 (- f28-0 (fmin f28-0 (* 0.16874999 f26-0 (fabs arg0) (seconds-per-frame))))) (s4-1 (new 'stack-no-clear 'vector)) ) (set-vector! s4-1 (* (sin f24-0) f28-1) 0.0 (* (cos f24-0) f28-1) 1.0) - (vector+! s4-1 s4-1 (-> obj root-override trans)) + (vector+! s4-1 s4-1 (-> this root-override trans)) (set! (-> s4-1 x) (* (- (-> s4-1 x) (-> gp-0 x)) (-> *display* frames-per-second))) (set! (-> s4-1 y) 0.0) (set! (-> s4-1 z) (* (- (-> s4-1 z) (-> gp-0 z)) (-> *display* frames-per-second))) @@ -329,7 +329,7 @@ (spawn (-> self part) a1-0) ) ) - (+! (-> self spin-ry) (* f30-0 (-> *display* seconds-per-frame))) + (+! (-> self spin-ry) (* f30-0 (seconds-per-frame))) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self spin-ry)) (if (and *target* (logtest? (-> *target* water flags) (water-flags wt09))) (whirlpool-method-20 self f30-0) @@ -344,18 +344,18 @@ :post ja-post ) -(defmethod deactivate whirlpool ((obj whirlpool)) - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) +(defmethod deactivate whirlpool ((this whirlpool)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) -(defmethod init-from-entity! whirlpool ((obj whirlpool) (arg0 entity-actor)) +(defmethod init-from-entity! whirlpool ((this whirlpool) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj spin-ry) (rand-vu-float-range 0.0 65536.0)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (set! (-> this spin-ry) (rand-vu-float-range 0.0 65536.0)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -366,11 +366,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *whirlpool-sg* '()) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *whirlpool-sg* '()) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) (let ((f30-0 32768.0) (f28-0 145635.56) ) @@ -381,24 +381,24 @@ (set! f28-0 (-> v1-17 1)) ) ) - (set! (-> obj spin-speed-idle) f30-0) - (set! (-> obj spin-speed-delta) (- f28-0 f30-0)) + (set! (-> this spin-speed-idle) f30-0) + (set! (-> this spin-speed-delta) (- f28-0 f30-0)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 447) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "whirlpool" :fo-max 55) (-> obj root-override trans)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 447) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "whirlpool" :fo-max 55) (-> this root-override trans)) ) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (go whirlpool-idle) (none) ) diff --git a/goal_src/jak1/levels/swamp/billy.gc b/goal_src/jak1/levels/swamp/billy.gc index 737abba7cf..65ac57a163 100644 --- a/goal_src/jak1/levels/swamp/billy.gc +++ b/goal_src/jak1/levels/swamp/billy.gc @@ -37,15 +37,15 @@ ) -(defmethod relocate billy ((obj billy) (arg0 int)) +(defmethod relocate billy ((this billy) (arg0 int)) (countdown (v1-0 3) - (if (nonzero? (-> obj path-data v1-0)) - (&+! (-> obj path-data v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method billy 7)) this arg0) ) ) @@ -234,7 +234,7 @@ :trans (behavior () (set! (-> self speed-scale) (-> self billy 0 rat-speed)) (if (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) + (time-elapsed? (-> self state-time) (-> self chase-rest-time)) ) (go-virtual nav-enemy-victory) ) @@ -285,18 +285,18 @@ #f ) -(defmethod play-anim! billy ((obj billy) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! billy ((this billy) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 - (set! (-> obj blend-on-exit) (the-as art-joint-anim #t)) - (close-status! (-> obj tasks) (task-status need-introduction)) + (set! (-> this blend-on-exit) (the-as art-joint-anim #t)) + (close-status! (-> this tasks) (task-status need-introduction)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (dotimes (s4-0 (+ (the int (the float (+ (-> obj path-snacks curve num-cverts) -1))) 1)) - (eval-path-curve-div! (-> obj path-snacks) s5-1 (the float s4-0) 'exact) + (dotimes (s4-0 (+ (the int (the float (+ (-> this path-snacks curve num-cverts) -1))) 1)) + (eval-path-curve-div! (-> this path-snacks) s5-1 (the float s4-0) 'exact) (+! (-> s5-1 x) -40960.0) (+! (-> s5-1 z) 20480.0) - (manipy-spawn s5-1 (-> obj entity) *farthy-snack-sg* #f :to obj) + (manipy-spawn s5-1 (-> this entity) *farthy-snack-sg* #f :to this) ) ) ) @@ -338,9 +338,9 @@ ) ) (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) - (set! (-> obj blend-on-exit) (the-as art-joint-anim #t)) - (set! (-> obj will-talk) #t) + (set! (-> this skippable) #t) + (set! (-> this blend-on-exit) (the-as art-joint-anim #t)) + (set! (-> this will-talk) #t) (new 'static 'spool-anim :name "billy-reminder-1" :index 8 @@ -372,8 +372,8 @@ ) (((task-status need-reward-speech)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "billy-resolution" @@ -409,49 +409,49 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod get-art-elem billy ((obj billy)) - (case (current-status (-> obj tasks)) +(defmethod get-art-elem billy ((this billy)) + (case (current-status (-> this tasks)) (((task-status invalid) (task-status need-resolution)) - (-> obj draw art-group data 10) + (-> this draw art-group data 10) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod process-taskable-method-38 billy ((obj billy)) - (case (current-status (-> obj tasks)) +(defmethod process-taskable-method-38 billy ((this billy)) + (case (current-status (-> this tasks)) (((task-status need-reminder-a) (task-status need-reminder)) - (go (method-of-object obj query)) + (go (method-of-object this query)) ) (((task-status need-reward-speech)) - (go (method-of-object obj play-anim)) + (go (method-of-object this play-anim)) ) (else - ((the-as (function nav-enemy none) (find-parent-method billy 38)) (the-as nav-enemy obj)) + ((the-as (function nav-enemy none) (find-parent-method billy 38)) (the-as nav-enemy this)) ) ) (none) ) -(defmethod get-accept-anim billy ((obj billy) (arg0 symbol)) +(defmethod get-accept-anim billy ((this billy) (arg0 symbol)) (if arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "billy-accept" :index 6 :parts 3 :command-list '()) ) -(defmethod get-reject-anim billy ((obj billy) (arg0 symbol)) +(defmethod get-reject-anim billy ((this billy) (arg0 symbol)) (new 'static 'spool-anim :name "billy-reject" :index 7 :parts 3 :command-list '()) ) @@ -568,27 +568,27 @@ (set! (-> self rat-speed) 1.0) (set! (-> self spawn-rats) #t) (set! (-> self passed-last-stage) #f) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 15)) + (when (time-elapsed? (-> self wave-start-time) (seconds 15)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-5 2) (set! (-> self max-rats) 8) (set! (-> self rat-speed) 1.2) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 20)) + (when (time-elapsed? (-> self wave-start-time) (seconds 20)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-5 4) (set! (-> self max-rats) 10) (set! (-> self rat-speed) 1.35) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 25)) + (when (time-elapsed? (-> self wave-start-time) (seconds 25)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ) @@ -602,27 +602,27 @@ (set! (-> self rat-speed) 1.0) (set! (-> self spawn-rats) #t) (set! (-> self passed-last-stage) #f) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 15)) + (when (time-elapsed? (-> self wave-start-time) (seconds 15)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-30 2) (set! (-> self max-rats) 7) (set! (-> self rat-speed) 1.2) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 20)) + (when (time-elapsed? (-> self wave-start-time) (seconds 20)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-30 4) (set! (-> self max-rats) 10) (set! (-> self rat-speed) 1.3) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 22)) + (when (time-elapsed? (-> self wave-start-time) (seconds 22)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ) @@ -636,27 +636,27 @@ (set! (-> self rat-speed) 1.0) (set! (-> self spawn-rats) #t) (set! (-> self passed-last-stage) #f) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 15)) + (when (time-elapsed? (-> self wave-start-time) (seconds 15)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-55 2) (set! (-> self max-rats) 7) (set! (-> self rat-speed) 1.1) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 18)) + (when (time-elapsed? (-> self wave-start-time) (seconds 18)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-55 4) (set! (-> self max-rats) 9) (set! (-> self rat-speed) 1.25) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 20)) + (when (time-elapsed? (-> self wave-start-time) (seconds 20)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ) @@ -670,27 +670,27 @@ (set! (-> self rat-speed) 0.9) (set! (-> self spawn-rats) #t) (set! (-> self passed-last-stage) #f) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 15)) + (when (time-elapsed? (-> self wave-start-time) (seconds 15)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-80 2) (set! (-> self max-rats) 6) (set! (-> self rat-speed) 1.0) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 18)) + (when (time-elapsed? (-> self wave-start-time) (seconds 18)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-80 4) (set! (-> self max-rats) 8) (set! (-> self rat-speed) 1.1) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 20)) + (when (time-elapsed? (-> self wave-start-time) (seconds 20)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ) @@ -712,13 +712,13 @@ (set! (-> self passed-last-stage) #t) ) ((begin (set! (-> self spawn-rats) #f) (zero? (-> self num-rats))) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 3)) + (when (time-elapsed? (-> self wave-start-time) (seconds 3)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) (else - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ) @@ -862,7 +862,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (text-id quit) #f)) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) (set! (-> self num-snacks) 0) (set! (-> self num-rats) 0) (set! (-> self current-wave) 0) @@ -955,63 +955,63 @@ ) ) -(defmethod process-taskable-method-43 billy ((obj billy)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 billy ((this billy)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f30-0 (rand-float-gen))) (cond ((< 0.9411765 f30-0) - (play-ambient (-> obj ambient) "BIL-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM01" #f (-> this root-override trans)) ) ((< 0.88235295 f30-0) - (play-ambient (-> obj ambient) "BIL-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM02" #f (-> this root-override trans)) ) ((< 0.8235294 f30-0) - (play-ambient (-> obj ambient) "BIL-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM03" #f (-> this root-override trans)) ) ((< 0.7647059 f30-0) - (play-ambient (-> obj ambient) "BIL-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM04" #f (-> this root-override trans)) ) ((< 0.7058824 f30-0) - (play-ambient (-> obj ambient) "BIL-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM05" #f (-> this root-override trans)) ) ((< 0.64705884 f30-0) - (play-ambient (-> obj ambient) "BIL-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM06" #f (-> this root-override trans)) ) ((< 0.5882353 f30-0) - (play-ambient (-> obj ambient) "BIL-AM07" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM07" #f (-> this root-override trans)) ) ((< 0.5294118 f30-0) - (play-ambient (-> obj ambient) "BIL-AM08" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM08" #f (-> this root-override trans)) ) ((< 0.47058824 f30-0) - (play-ambient (-> obj ambient) "BIL-AM1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM1A" #f (-> this root-override trans)) ) ((< 0.4117647 f30-0) - (play-ambient (-> obj ambient) "BIL-AM2A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM2A" #f (-> this root-override trans)) ) ((< 0.3529412 f30-0) - (play-ambient (-> obj ambient) "BIL-AM2B" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM2B" #f (-> this root-override trans)) ) - ((= (current-status (-> obj tasks)) (task-status invalid)) + ((= (current-status (-> this tasks)) (task-status invalid)) #f ) ((< 0.29411766 f30-0) - (play-ambient (-> obj ambient) "BIL-LO01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO01" #f (-> this root-override trans)) ) ((< 0.23529412 f30-0) - (play-ambient (-> obj ambient) "BIL-LO02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO02" #f (-> this root-override trans)) ) ((< 0.1764706 f30-0) - (play-ambient (-> obj ambient) "BIL-LO03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO03" #f (-> this root-override trans)) ) ((< 0.11764706 f30-0) - (play-ambient (-> obj ambient) "BIL-LO1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO1A" #f (-> this root-override trans)) ) ((< 0.05882353 f30-0) - (play-ambient (-> obj ambient) "BIL-LO2A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO2A" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "BIL-LO2B" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO2B" #f (-> this root-override trans)) ) ) ) @@ -1058,28 +1058,30 @@ ) ) -(defmethod target-above-threshold? billy ((obj billy)) +(defmethod target-above-threshold? billy ((this billy)) (the-as symbol (and *target* (not (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) ) ) -(defmethod init-from-entity! billy ((obj billy) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *billy-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task swamp-billy))) +(defmethod init-from-entity! billy ((this billy) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *billy-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task swamp-billy))) (dotimes (s5-0 3) - (let ((v1-3 (new 'process 'curve-control obj 'path (the float s5-0)))) - (set! (-> obj path-data s5-0) v1-3) + (let ((v1-3 (new 'process 'curve-control this 'path (the float s5-0)))) + (set! (-> this path-data s5-0) v1-3) (logior! (-> v1-3 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) - (set! (-> obj path) (-> obj path-snacks)) - (set! (-> obj farthy) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *billy-sidekick-sg* #f :to obj)) + (set! (-> this path) (-> this path-snacks)) + (set! (-> this farthy) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *billy-sidekick-sg* #f :to this) + ) ) - (send-event (handle->process (-> obj farthy)) 'center-joint 3) - (send-event (handle->process (-> obj farthy)) 'anim-mode 'clone-anim) - (process-taskable-method-42 obj) + (send-event (handle->process (-> this farthy)) 'center-joint 3) + (send-event (handle->process (-> this farthy)) 'anim-mode 'clone-anim) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/swamp/kermit.gc b/goal_src/jak1/levels/swamp/kermit.gc index 8c14f71eb2..75e35b45d6 100644 --- a/goal_src/jak1/levels/swamp/kermit.gc +++ b/goal_src/jak1/levels/swamp/kermit.gc @@ -402,9 +402,9 @@ ) -(defmethod relocate joint-mod-tracker ((obj joint-mod-tracker) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate joint-mod-tracker ((this joint-mod-tracker) (arg0 int)) + (&+! (-> this process) arg0) + this ) (defun build-matrix-from-up-and-forward-axes! ((arg0 matrix) (arg1 vector) (arg2 int) (arg3 vector) (arg4 int)) @@ -523,13 +523,13 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (sound-stop (-> self sound-id)) ) :code (behavior () - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (while (not (time-elapsed? (-> self state-time) (seconds 4))) (sound-play "kermit-loop" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) (spawn (-> self part) (-> self root-override trans)) (find-ground-and-draw-shadow @@ -635,21 +635,21 @@ ) -(defmethod relocate kermit ((obj kermit) (arg0 int)) - (if (nonzero? (-> obj tongue-control)) - (&+! (-> obj tongue-control) arg0) +(defmethod relocate kermit ((this kermit) (arg0 int)) + (if (nonzero? (-> this tongue-control)) + (&+! (-> this tongue-control) arg0) ) - (if (nonzero? (-> obj charging-part)) - (&+! (-> obj charging-part) arg0) + (if (nonzero? (-> this charging-part)) + (&+! (-> this charging-part) arg0) ) - (the-as kermit ((method-of-type nav-enemy relocate) obj arg0)) + (the-as kermit ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod deactivate kermit ((obj kermit)) - (if (nonzero? (-> obj charging-part)) - (kill-and-free-particles (-> obj charging-part)) +(defmethod deactivate kermit ((this kermit)) + (if (nonzero? (-> this charging-part)) + (kill-and-free-particles (-> this charging-part)) ) - ((method-of-type nav-enemy deactivate) obj) + ((method-of-type nav-enemy deactivate) this) (none) ) @@ -828,9 +828,9 @@ nav-enemy-default-event-handler -(defmethod common-post kermit ((obj kermit)) - ((the-as (function nav-enemy none) (find-parent-method kermit 39)) obj) - (when (-> obj charged-up) +(defmethod common-post kermit ((this kermit)) + ((the-as (function nav-enemy none) (find-parent-method kermit 39)) this) + (when (-> this charged-up) ) 0 (none) @@ -917,7 +917,7 @@ nav-enemy-default-event-handler (defstate kermit-patrol (kermit) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) (kermit-get-new-patrol-point) (nav-control-method-11 (-> self nav) (-> self nav target-pos)) @@ -927,7 +927,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (time-elapsed? (-> self state-time) (seconds 1)) ) (go kermit-idle) ) @@ -983,7 +983,7 @@ nav-enemy-default-event-handler (defstate kermit-chase-new-position (kermit) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self miss-count) 0) (let* ((a1-1 (kermit-get-head-dir-xz self (new 'stack-no-clear 'vector))) (gp-0 (vector-rotate-around-y! (new 'stack-no-clear 'vector) a1-1 16384.0)) @@ -1008,9 +1008,9 @@ nav-enemy-default-event-handler ) :trans (behavior () (when (not (-> self airborne)) - (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (if (or (time-elapsed? (-> self state-time) (seconds 3)) (and (logtest? (nav-control-flags navcf19) (-> self nav flags)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) ) ) (go kermit-chase) @@ -1037,7 +1037,7 @@ nav-enemy-default-event-handler (defstate kermit-chase (kermit) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (kermit-set-nav-mesh-target (-> self collide-info trans)) (nav-control-method-11 (-> self nav) (-> self nav target-pos)) @@ -1046,7 +1046,7 @@ nav-enemy-default-event-handler (kermit-set-nav-mesh-target (-> self collide-info trans)) (kermit-set-rotate-dir-to-player) (if (nav-enemy-test-point-in-nav-mesh? (target-pos 0)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (kermit-tongue-pos self) (let ((v1-5 (kermit-player-target-pos))) @@ -1069,7 +1069,7 @@ nav-enemy-default-event-handler ) ) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go kermit-give-up) ) ) @@ -1167,7 +1167,7 @@ nav-enemy-default-event-handler ) (go kermit-retract-tongue) ) - (seek! (-> self tongue-pulse-pos) 1.0 (* 0.3 (-> *display* seconds-per-frame))) + (seek! (-> self tongue-pulse-pos) 1.0 (* 0.3 (seconds-per-frame))) (when (and (-> self child-override) (let ((v1-9 (-> self child-override))) (= (-> (if v1-9 (-> v1-9 0 self-override) @@ -1211,7 +1211,7 @@ nav-enemy-default-event-handler (defstate kermit-retract-tongue (kermit) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self charged-up) #f) (+! (-> self miss-count) 1) ) @@ -1223,7 +1223,7 @@ nav-enemy-default-event-handler (kermit-set-nav-mesh-target (-> self collide-info trans)) (kermit-set-rotate-dir-to-player) (when (not (-> self airborne)) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2.5)) + (when (time-elapsed? (-> self state-time) (seconds 2.5)) (kill-and-free-particles (-> self charging-part)) (set! (-> self charged-up) #t) (go kermit-chase) @@ -1308,9 +1308,9 @@ nav-enemy-default-event-handler ) ) -(defmethod init-from-entity! kermit ((obj kermit) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! kermit ((this kermit) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1334,31 +1334,33 @@ nav-enemy-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *kermit-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj airborne) #f) - (init-defaults! obj *kermit-nav-enemy-info*) - (set-vector! (-> obj neck twist-max) 3640.889 3640.889 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 102400.0) - (set! (-> obj neck ignore-angle) 16384.0) - (set! (-> obj miss-count) 0) - (set! (-> obj tongue-control) (new 'process 'joint-mod-tracker obj 24 kermit-get-tongue-target-callback 1 2)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *kermit-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (set! (-> this airborne) #f) + (init-defaults! this *kermit-nav-enemy-info*) + (set-vector! (-> this neck twist-max) 3640.889 3640.889 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) + (set! (-> this miss-count) 0) + (set! (-> this tongue-control) + (new 'process 'joint-mod-tracker this 24 kermit-get-tongue-target-callback 1 2) + ) (let ((f0-16 49152.0)) - (set! (-> obj tongue-control inv-forward-scale-factor) (/ 1.0 f0-16)) + (set! (-> this tongue-control inv-forward-scale-factor) (/ 1.0 f0-16)) ) - (set! (-> obj tongue-control forward-scale-control) 0.0) - (set! (-> obj tongue-control forward-scale-max) 2.0) - (set! (-> obj tongue-control enable) #f) - (set! (-> obj charged-up) #t) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 299) obj)) - (set! (-> obj charging-part) (create-launch-control (-> *part-group-id-table* 298) obj)) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this tongue-control forward-scale-control) 0.0) + (set! (-> this tongue-control forward-scale-max) 2.0) + (set! (-> this tongue-control enable) #f) + (set! (-> this charged-up) #t) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 299) this)) + (set! (-> this charging-part) (create-launch-control (-> *part-group-id-table* 298) this)) + (set! (-> this sound-id) (new-sound-id)) (go kermit-idle) (none) ) diff --git a/goal_src/jak1/levels/swamp/swamp-bat.gc b/goal_src/jak1/levels/swamp/swamp-bat.gc index 445a3feb2d..9edcf2640f 100644 --- a/goal_src/jak1/levels/swamp/swamp-bat.gc +++ b/goal_src/jak1/levels/swamp/swamp-bat.gc @@ -24,11 +24,11 @@ ) -(defmethod swamp-bat-idle-path-method-9 swamp-bat-idle-path ((obj swamp-bat-idle-path) (arg0 vector) (arg1 float)) +(defmethod swamp-bat-idle-path-method-9 swamp-bat-idle-path ((this swamp-bat-idle-path) (arg0 vector) (arg1 float)) (let ((f30-0 (* 65536.0 arg1))) - (set! (-> arg0 quad) (-> obj origin quad)) - (vector+*! arg0 arg0 (-> obj x-axis) (cos f30-0)) - (vector+*! arg0 arg0 (-> obj y-axis) (sin f30-0)) + (set! (-> arg0 quad) (-> this origin quad)) + (vector+*! arg0 arg0 (-> this x-axis) (cos f30-0)) + (vector+*! arg0 arg0 (-> this y-axis) (sin f30-0)) ) arg0 ) @@ -56,15 +56,15 @@ ) -(defmethod relocate swamp-bat ((obj swamp-bat) (arg0 int)) +(defmethod relocate swamp-bat ((this swamp-bat) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj path-list v1-0)) - (&+! (-> obj path-list v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method swamp-bat 7)) this arg0) ) ) @@ -124,8 +124,8 @@ swamp-bat-slave-event-handler (transform-post) ) -(defmethod swamp-bat-slave-method-20 swamp-bat-slave ((obj swamp-bat-slave)) - (* (get-current-phase (-> obj sync)) (-> obj path-point-count)) +(defmethod swamp-bat-slave-method-20 swamp-bat-slave ((this swamp-bat-slave)) + (* (get-current-phase (-> this sync)) (-> this path-point-count)) ) (defbehavior swamp-bat-slave-path-post swamp-bat-slave () @@ -146,7 +146,7 @@ swamp-bat-slave-event-handler ) ) ) - (seek! (-> self strafe-distance) f0-4 (* 20480.0 (-> *display* seconds-per-frame))) + (seek! (-> self strafe-distance) f0-4 (* 20480.0 (seconds-per-frame))) ) (vector-float*! s4-0 s4-0 (-> self strafe-distance)) (vector+! (-> self root-override trans) s5-0 s4-0) @@ -188,7 +188,7 @@ swamp-bat-slave-event-handler (defstate swamp-bat-slave-idle (swamp-bat-slave) :event swamp-bat-slave-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self launch-ready) #f) (ja-channel-push! 1 (seconds 0.165)) (ja :group! swamp-bat-idle-ja) @@ -211,7 +211,7 @@ swamp-bat-slave-event-handler ) (forward-up->quaternion gp-0 s2-0 (new 'static 'vector :y 1.0 :w 1.0)) (loop - (let ((v1-17 (- (-> *display* base-frame-counter) (-> self state-time)))) + (let ((v1-17 (- (current-time) (-> self state-time)))) (when (>= v1-17 s3-0) 0 (goto cfg-10) @@ -249,7 +249,7 @@ swamp-bat-slave-event-handler ) (ja :num! (loop! (-> self idle-anim-speed))) (suspend) - (+! f30-2 (* 32768.0 (-> *display* seconds-per-frame) (-> self idle-anim-speed))) + (+! f30-2 (* 32768.0 (seconds-per-frame) (-> self idle-anim-speed))) ) ) ) @@ -259,7 +259,7 @@ swamp-bat-slave-event-handler (defstate swamp-bat-slave-launch (swamp-bat-slave) :event swamp-bat-slave-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self launch-ready) #f) (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new-stack-vector0))) @@ -268,7 +268,7 @@ swamp-bat-slave-event-handler (eval-path-curve-div! (-> self parent-process 0 path-list (-> self path-select)) s5-0 0.0 'interp) (ja :group! swamp-bat-idle-ja) (loop - (let ((s4-0 (- (-> *display* base-frame-counter) (-> self state-time)))) + (let ((s4-0 (- (current-time) (-> self state-time)))) (if (>= s4-0 (seconds 0.3)) (go swamp-bat-slave-swoop) ) @@ -509,7 +509,7 @@ swamp-bat-slave-event-handler (deactivate self) ) (loop - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) *target* (>= (-> self fact-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) @@ -556,11 +556,11 @@ swamp-bat-slave-event-handler (defstate swamp-bat-launch-slaves (swamp-bat) :trans swamp-bat-debug :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (swamp-bat-update-path) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) + (set-time! (-> self state-time)) (if (not (swamp-bat-launch-slave)) (go swamp-bat-idle) ) @@ -571,47 +571,47 @@ swamp-bat-slave-event-handler :post #f ) -(defmethod init-from-entity! swamp-bat ((obj swamp-bat) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! swamp-bat ((this swamp-bat) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 0.0) (set-root-prim! s4-0 s3-0) ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask enemy)) - (set! (-> obj vol) (new 'process 'vol-control obj)) - (logior! (-> obj vol flags) 3) - (set! (-> obj path-list 0) (new 'process 'curve-control obj 'path -1000000000.0)) - (set! (-> obj path-list 1) (new 'process 'curve-control obj 'pathb -1000000000.0)) - (logior! (-> obj path-list 0 flags) (path-control-flag display draw-line draw-point draw-text)) - (logior! (-> obj path-list 1 flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-count) 0) - (when (< 0.0 (the float (+ (-> obj path-list 0 curve num-cverts) -1))) - (+! (-> obj path-count) 1) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this vol) (new 'process 'vol-control this)) + (logior! (-> this vol flags) 3) + (set! (-> this path-list 0) (new 'process 'curve-control this 'path -1000000000.0)) + (set! (-> this path-list 1) (new 'process 'curve-control this 'pathb -1000000000.0)) + (logior! (-> this path-list 0 flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this path-list 1 flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-count) 0) + (when (< 0.0 (the float (+ (-> this path-list 0 curve num-cverts) -1))) + (+! (-> this path-count) 1) (swamp-bat-make-path-select-plane 0) ) - (when (< 0.0 (the float (+ (-> obj path-list 1 curve num-cverts) -1))) - (+! (-> obj path-count) 1) + (when (< 0.0 (the float (+ (-> this path-list 1 curve num-cverts) -1))) + (+! (-> this path-count) 1) (swamp-bat-make-path-select-plane 1) ) - (if (!= (-> obj path-count) 2) + (if (!= (-> this path-count) 2) (go process-drawable-art-error "need 2 paths") ) - (set! (-> obj fact-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this fact-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (let ((a1-10 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 6)))) - (set! (-> obj slave-count) (max 2 (min 8 (the-as int a1-10)))) + (set! (-> this slave-count) (max 2 (min 8 (the-as int a1-10)))) ) (swamp-bat-setup-new-path 0) (swamp-bat-update-path) - (dotimes (s5-1 (-> obj slave-count)) - (process-spawn swamp-bat-slave obj s5-1 :to obj :stack-size 4512) + (dotimes (s5-1 (-> this slave-count)) + (process-spawn swamp-bat-slave this s5-1 :to this :stack-size 4512) ) (go swamp-bat-idle) (none) diff --git a/goal_src/jak1/levels/swamp/swamp-obs.gc b/goal_src/jak1/levels/swamp/swamp-obs.gc index 6e5289015a..ac800315f9 100644 --- a/goal_src/jak1/levels/swamp/swamp-obs.gc +++ b/goal_src/jak1/levels/swamp/swamp-obs.gc @@ -187,7 +187,7 @@ (vector-z-quaternion! gp-0 (-> self root-override quat)) (set! (-> gp-0 w) (- (vector-dot gp-0 (-> self root-override trans)))) (loop - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! (-> self draw art-group data 3)) (until (>= (get-current-phase (-> self sync)) 0.5) (ja :num-func num-func-identity :frame-num 0.0) @@ -235,7 +235,7 @@ (ja :num! (seek!)) ) (set! (-> self dangerous) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :num-func num-func-identity :frame-num max) (until (< (get-current-phase (-> self sync)) 0.5) (suspend) @@ -279,7 +279,7 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! (-> self draw art-group data 4)) (until (-> self open-gate) (ja :num-func num-func-identity :frame-num 0.0) @@ -314,8 +314,8 @@ :post swamp-spike-post ) -(defmethod init! swamp-spike ((obj swamp-spike)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init! swamp-spike ((this swamp-spike)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -343,19 +343,19 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-skeleton obj *swamp-spike-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) - (set! (-> obj open-gate) #f) - (set! (-> obj dangerous) #f) + (process-drawable-from-entity! this (-> this entity)) + (initialize-skeleton this *swamp-spike-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) + (set! (-> this open-gate) #f) + (set! (-> this dangerous) #f) #f ) -(defmethod init-from-entity! swamp-spike ((obj swamp-spike) (arg0 entity-actor)) - (init! obj) +(defmethod init-from-entity! swamp-spike ((this swamp-spike) (arg0 entity-actor)) + (init! this) (go swamp-spike-idle) (none) ) @@ -373,8 +373,8 @@ ) -(defmethod init-from-entity! swampgate ((obj swampgate) (arg0 entity-actor)) - (init! obj) +(defmethod init-from-entity! swampgate ((this swampgate) (arg0 entity-actor)) + (init! this) (if (logtest? (-> arg0 extra perm status) (entity-perm-status complete)) (go swamp-spike-gate-down) (go swamp-spike-gate-up) @@ -468,10 +468,10 @@ :post rider-post ) -(defmethod init-from-entity! balance-plat ((obj balance-plat) (arg0 entity-actor)) +(defmethod init-from-entity! balance-plat ((this balance-plat) (arg0 entity-actor)) ;; og:preserve-this PAL patch here. usually-hit-by-player -> hit-by-others - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -489,17 +489,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *balance-plat-sg* '()) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj y-accel) 0.0) - (set! (-> obj y-vel) 0.0) - (set! (-> obj y-offset) 0.0) - (set! (-> obj y-init) (-> obj root-override trans y)) - (set! (-> obj got-grow) #f) - (set! (-> obj y-travel) (res-lump-float arg0 'distance :default 20480.0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *balance-plat-sg* '()) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this y-accel) 0.0) + (set! (-> this y-vel) 0.0) + (set! (-> this y-offset) 0.0) + (set! (-> this y-init) (-> this root-override trans y)) + (set! (-> this got-grow) #f) + (set! (-> this y-travel) (res-lump-float arg0 'distance :default 20480.0)) (go balance-plat-idle) (none) ) @@ -640,10 +640,10 @@ ) ) -(defmethod init-from-entity! swamp-rock ((obj swamp-rock) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask attackable)) +(defmethod init-from-entity! swamp-rock ((this swamp-rock) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask attackable)) (let ((f30-0 (res-lump-float arg0 'scale-factor :default 1.0))) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -655,14 +655,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (vector-float*! (-> obj root scale) *identity-vector* f30-0) + (process-drawable-from-entity! this arg0) + (vector-float*! (-> this root scale) *identity-vector* f30-0) ) - (initialize-skeleton obj *swamp-rock-sg* '()) - (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 291) obj)) + (initialize-skeleton this *swamp-rock-sg* '()) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 291) this)) (go swamp-rock-idle) (none) ) @@ -740,16 +740,16 @@ ) -(defmethod rigid-body-platform-method-22 tar-plat ((obj tar-plat) (arg0 vector) (arg1 float)) - (+ (-> obj float-height) - (-> obj float-height-offset) +(defmethod rigid-body-platform-method-22 tar-plat ((this tar-plat) (arg0 vector) (arg1 float)) + (+ (-> this float-height) + (-> this float-height-offset) (* 512.0 (cos (* 109.22667 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z)))))) ) ) -(defmethod rigid-body-platform-method-23 tar-plat ((obj tar-plat) (arg0 float)) - ((the-as (function rigid-body-platform basic none) (find-parent-method tar-plat 23)) obj (the-as basic arg0)) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) +(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)) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) @@ -777,14 +777,14 @@ ) ) (let ((f30-1 -2048.0)) - (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (seconds-per-frame))) ) ) ) @@ -799,8 +799,8 @@ :post rigid-body-platform-post ) -(defmethod rigid-body-platform-method-30 tar-plat ((obj tar-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 tar-plat ((this tar-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -818,20 +818,20 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-31 tar-plat ((obj tar-plat)) - (initialize-skeleton obj *tar-plat-sg* '()) - (rigid-body-platform-method-29 obj *tar-plat-constants*) - (set! (-> obj float-height) (-> obj entity extra trans y)) - (set! (-> obj float-height-offset) -2048.0) - (let ((s5-0 (-> obj info control-point-count))) +(defmethod rigid-body-platform-method-31 tar-plat ((this tar-plat)) + (initialize-skeleton this *tar-plat-sg* '()) + (rigid-body-platform-method-29 this *tar-plat-constants*) + (set! (-> this float-height) (-> this entity extra trans y)) + (set! (-> this float-height-offset) -2048.0) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f26-0 (+ 8192.0 (* 65536.0 (/ (the float s4-0) (the float s5-0))))) (f28-0 20480.0) (f30-0 12288.0) @@ -844,8 +844,8 @@ ) ) ) - (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f)) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) + (nav-mesh-connect this (-> this root-overlay) (the-as nav-control #f)) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) 0 (none) ) diff --git a/goal_src/jak1/levels/swamp/swamp-rat-nest.gc b/goal_src/jak1/levels/swamp/swamp-rat-nest.gc index 67c20a8cdf..98e519add1 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat-nest.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat-nest.gc @@ -721,7 +721,7 @@ (defstate swamp-rat-nest-dummy-hit (swamp-rat-nest-dummy) :event swamp-rat-nest-dummy-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (<= (-> self parent-process 0 hit-points) 0) (go swamp-rat-nest-dummy-die) ) @@ -756,7 +756,7 @@ (defstate swamp-rat-nest-dummy-die (swamp-rat-nest-dummy) :event #f :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self parent-process 0 dummy) (the-as (pointer swamp-rat-nest-dummy) #f)) (process-spawn part-tracker @@ -769,7 +769,7 @@ (-> self node-list data (-> self particle-spawn-joint) bone transform vector 3) :to *entity-pool* ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (until (time-elapsed? (-> self state-time) (seconds 0.1)) (suspend) ) (ja-channel-set! 0) @@ -903,7 +903,7 @@ swamp-rat-nest-default-event-handler ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (and *target* (>= (-> self fact-override idle-distance) @@ -925,12 +925,12 @@ swamp-rat-nest-default-event-handler (defstate swamp-rat-nest-active (swamp-rat-nest) :event swamp-rat-nest-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (swamp-rat-nest-check-dummy) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self test-interval)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (-> self test-interval)) + (set-time! (-> self state-time)) (set! (-> self test-interval) (seconds 0.2)) (let ((v1-6 0)) (let ((a0-2 (the-as (pointer process-tree) (-> self child-process)))) @@ -958,13 +958,11 @@ swamp-rat-nest-default-event-handler (defstate swamp-rat-nest-gestate (swamp-rat-nest) :event swamp-rat-nest-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (swamp-rat-nest-check-dummy) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (the int (* (-> self spawn-period-scale) (-> self spawn-period))) - ) + (when (time-elapsed? (-> self state-time) (the int (* (-> self spawn-period-scale) (-> self spawn-period)))) (send-event (ppointer->process (-> self dummy)) 'shake) (swamp-rat-nest-spawn-rat) (go swamp-rat-nest-active) @@ -1014,32 +1012,32 @@ swamp-rat-nest-default-event-handler :post #f ) -(defmethod init-from-entity! swamp-rat-nest ((obj swamp-rat-nest) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj fact-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) +(defmethod init-from-entity! swamp-rat-nest ((this swamp-rat-nest) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this fact-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s5-1 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 3)))) (if (>= (get-health-percent-lost *game-info* #f) 0.5) (+! s5-1 -1) ) - (set! (-> obj rat-count) (max 1 (min 4 (the-as int s5-1)))) + (set! (-> this rat-count) (max 1 (min 4 (the-as int s5-1)))) ) - (set! (-> obj defensive-rat-count) 2) + (set! (-> this defensive-rat-count) 2) (if (>= (get-health-percent-lost *game-info* #f) 0.75) - (+! (-> obj defensive-rat-count) -1) + (+! (-> this defensive-rat-count) -1) ) - (set! (-> obj dummy) (the-as (pointer swamp-rat-nest-dummy) #f)) - (set! (-> obj dummy-type) 0) - (set! (-> obj hit-points) 0) - (set! (-> obj damaged) #f) - (set! (-> obj spawn-period) (* 1200.0 (rand-vu-float-range 0.9 1.1))) - (set! (-> obj spawn-period-scale) (+ 1.0 (* 2.0 (get-health-percent-lost *game-info* #f)))) - (set! (-> obj test-interval) (rand-vu-int-range (seconds 0.1) (seconds 0.2))) + (set! (-> this dummy) (the-as (pointer swamp-rat-nest-dummy) #f)) + (set! (-> this dummy-type) 0) + (set! (-> this hit-points) 0) + (set! (-> this damaged) #f) + (set! (-> this spawn-period) (* 1200.0 (rand-vu-float-range 0.9 1.1))) + (set! (-> this spawn-period-scale) (+ 1.0 (* 2.0 (get-health-percent-lost *game-info* #f)))) + (set! (-> this test-interval) (rand-vu-int-range (seconds 0.1) (seconds 0.2))) (go swamp-rat-nest-idle) (none) ) @@ -1059,8 +1057,8 @@ swamp-rat-nest-default-event-handler :bounds (static-spherem 0 0 0 5) ) -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-a ((obj swamp-rat-nest-dummy-a)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-a ((this swamp-rat-nest-dummy-a)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1072,14 +1070,14 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (initialize-skeleton obj *swamp-rat-nest-dummy-a-sg* '()) + (initialize-skeleton this *swamp-rat-nest-dummy-a-sg* '()) (none) ) -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-b ((obj swamp-rat-nest-dummy-b)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-b ((this swamp-rat-nest-dummy-b)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1091,14 +1089,14 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (initialize-skeleton obj *swamp-rat-nest-dummy-b-sg* '()) + (initialize-skeleton this *swamp-rat-nest-dummy-b-sg* '()) (none) ) -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-c ((obj swamp-rat-nest-dummy-c)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-c ((this swamp-rat-nest-dummy-c)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1110,80 +1108,80 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (initialize-skeleton obj *swamp-rat-nest-dummy-c-sg* '()) + (initialize-skeleton this *swamp-rat-nest-dummy-c-sg* '()) (none) ) -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-a ((obj swamp-rat-nest-dummy-a)) +(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-a ((this swamp-rat-nest-dummy-a)) (let ((v1-0 0)) (let* ((a0-1 '(5 6 7 8 9 10)) (a1-0 (car a0-1)) ) (while (not (null? a0-1)) (when (< v1-0 6) - (set! (-> obj spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) + (set! (-> this spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) (+! v1-0 1) ) (set! a0-1 (cdr a0-1)) (set! a1-0 (car a0-1)) ) ) - (set! (-> obj spawn-joint-count) v1-0) + (set! (-> this spawn-joint-count) v1-0) ) - (set! (-> obj death-part) (-> *part-group-id-table* 292)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 295) obj)) + (set! (-> this death-part) (-> *part-group-id-table* 292)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 295) this)) (let ((v0-1 6)) - (set! (-> obj particle-spawn-joint) v0-1) + (set! (-> this particle-spawn-joint) v0-1) v0-1 ) ) -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-b ((obj swamp-rat-nest-dummy-b)) +(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-b ((this swamp-rat-nest-dummy-b)) (let ((v1-0 0)) (let* ((a0-1 '(5 9 10 6 7 8)) (a1-0 (car a0-1)) ) (while (not (null? a0-1)) (when (< v1-0 6) - (set! (-> obj spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) + (set! (-> this spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) (+! v1-0 1) ) (set! a0-1 (cdr a0-1)) (set! a1-0 (car a0-1)) ) ) - (set! (-> obj spawn-joint-count) v1-0) + (set! (-> this spawn-joint-count) v1-0) ) - (set! (-> obj death-part) (-> *part-group-id-table* 293)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 296) obj)) + (set! (-> this death-part) (-> *part-group-id-table* 293)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 296) this)) (let ((v0-1 9)) - (set! (-> obj particle-spawn-joint) v0-1) + (set! (-> this particle-spawn-joint) v0-1) v0-1 ) ) -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-c ((obj swamp-rat-nest-dummy-c)) +(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-c ((this swamp-rat-nest-dummy-c)) (let ((v1-0 0)) (let* ((a0-1 '(5 6)) (a1-0 (car a0-1)) ) (while (not (null? a0-1)) (when (< v1-0 6) - (set! (-> obj spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) + (set! (-> this spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) (+! v1-0 1) ) (set! a0-1 (cdr a0-1)) (set! a1-0 (car a0-1)) ) ) - (set! (-> obj spawn-joint-count) v1-0) + (set! (-> this spawn-joint-count) v1-0) ) - (set! (-> obj death-part) (-> *part-group-id-table* 294)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 297) obj)) + (set! (-> this death-part) (-> *part-group-id-table* 294)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 297) this)) (let ((v0-1 5)) - (set! (-> obj particle-spawn-joint) v0-1) + (set! (-> this particle-spawn-joint) v0-1) v0-1 ) ) diff --git a/goal_src/jak1/levels/swamp/swamp-rat.gc b/goal_src/jak1/levels/swamp/swamp-rat.gc index 030c388c53..9caae1fa29 100644 --- a/goal_src/jak1/levels/swamp/swamp-rat.gc +++ b/goal_src/jak1/levels/swamp/swamp-rat.gc @@ -40,14 +40,14 @@ :longest-edge (meters 1) ) -(defmethod touch-handler swamp-rat ((obj swamp-rat) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler swamp-rat ((this swamp-rat) (arg0 process) (arg1 event-message-block)) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (let* ((s5-1 (-> obj parent)) + (let* ((s5-1 (-> this parent)) (a0-4 (if (and (nonzero? s5-1) (type-type? pointer process-drawable)) s5-1 ) @@ -55,7 +55,7 @@ ) (if a0-4 (send-event (the-as process-tree a0-4) 'victory) - (go (method-of-object obj nav-enemy-victory)) + (go (method-of-object this nav-enemy-victory)) ) ) ) @@ -75,35 +75,35 @@ swamp-rat-default-event-handler -(defmethod common-post swamp-rat ((obj swamp-rat)) - (when (logtest? (-> obj collide-info status) (cshape-moving-flags onsurf)) - (vector-deg-seek (-> obj up-vector) (-> obj up-vector) (-> obj collide-info surface-normal) 910.2222) - (vector-normalize! (-> obj up-vector) 1.0) +(defmethod common-post swamp-rat ((this swamp-rat)) + (when (logtest? (-> this collide-info status) (cshape-moving-flags onsurf)) + (vector-deg-seek (-> this up-vector) (-> this up-vector) (-> this collide-info surface-normal) 910.2222) + (vector-normalize! (-> this up-vector) 1.0) ) (forward-up-nopitch->quaternion - (-> obj collide-info quat) - (vector-z-quaternion! (new-stack-vector0) (-> obj collide-info quat)) - (-> obj up-vector) + (-> this collide-info quat) + (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)) obj) + ((the-as (function nav-enemy none) (find-parent-method swamp-rat 39)) this) (none) ) -(defmethod nav-enemy-method-38 swamp-rat ((obj swamp-rat)) +(defmethod nav-enemy-method-38 swamp-rat ((this swamp-rat)) (integrate-for-enemy-with-move-to-ground! - (-> obj collide-info) - (-> obj collide-info transv) + (-> this collide-info) + (-> this collide-info transv) (collide-kind background) 8192.0 #t #f #f ) - (when (< (-> obj collide-info trans y) (-> obj min-height)) + (when (< (-> this collide-info trans y) (-> this min-height)) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> obj collide-info trans quad)) - (set! (-> a1-1 y) (-> obj min-height)) - (move-to-ground-point! (-> obj collide-info) a1-1 (-> obj collide-info transv) *y-vector*) + (set! (-> a1-1 quad) (-> this collide-info trans quad)) + (set! (-> a1-1 y) (-> this min-height)) + (move-to-ground-point! (-> this collide-info) a1-1 (-> this collide-info transv) *y-vector*) ) ) 0 @@ -168,7 +168,8 @@ swamp-rat-default-event-handler ) (defbehavior swamp-rat-update-wiggle-target swamp-rat ((arg0 vector)) - (+! (-> self wiggle-angle) (* DISPLAY_FPS_RATIO (-> self delta-wiggle-angle))) ;; og:preserve-this changed for high fps + ;; og:preserve-this changed for high fps + (+! (-> self wiggle-angle) (* DISPLAY_FPS_RATIO (-> self delta-wiggle-angle))) (if (< 65536.0 (-> self wiggle-angle)) (+! (-> self wiggle-angle) -65536.0) ) @@ -189,21 +190,21 @@ swamp-rat-default-event-handler :virtual #t :event swamp-rat-default-event-handler :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) + (if (time-elapsed? (-> self state-time) (-> self chase-rest-time)) (go-virtual nav-enemy-victory) ) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) :code (behavior () - (set! (-> self target-nav-time) (-> *display* base-frame-counter)) - (set! (-> self wiggle-time) (+ (-> *display* base-frame-counter) (seconds -10))) + (set-time! (-> self target-nav-time)) + (set! (-> self wiggle-time) (+ (current-time) (seconds -10))) (set! (-> self wiggle-angle) 0.0) (set! (-> self chase-rest-time) (rand-vu-int-range (seconds 1) (seconds 4))) (ja-channel-push! 1 (seconds 0.17)) (ja :group! swamp-rat-run-ja :num! min) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self wiggle-time)) (seconds 1)) - (set! (-> self wiggle-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self wiggle-time) (seconds 1)) + (set-time! (-> self wiggle-time)) (swamp-rat-update-wiggle-params) ) (suspend) @@ -240,9 +241,9 @@ swamp-rat-default-event-handler (ja-no-eval :num! (loop!)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) - (s5-0 (-> *display* base-frame-counter)) + (s5-0 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) + (until (time-elapsed? s5-0 gp-0) (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend) @@ -310,7 +311,7 @@ swamp-rat-default-event-handler (set! (-> gp-0 z) 0.0) (set! (-> gp-0 w) 1.0) (let ((f30-0 0.125)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! swamp-rat-fall-ja :num! min) (loop (set! f30-0 (seek f30-0 1.5 0.1)) @@ -325,9 +326,7 @@ swamp-rat-default-event-handler #f ) (when (or (logtest? (-> self collide-info status) (cshape-moving-flags tsurf)) - (or (< (-> self collide-info trans y) (-> self min-height)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - ) + (or (< (-> self collide-info trans y) (-> self min-height)) (time-elapsed? (-> self state-time) (seconds 1))) ) 0 (goto cfg-13) @@ -410,8 +409,8 @@ swamp-rat-default-event-handler ) ) -(defmethod initialize-collision swamp-rat ((obj swamp-rat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision swamp-rat ((this swamp-rat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -427,30 +426,30 @@ swamp-rat-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod nav-enemy-method-48 swamp-rat ((obj swamp-rat)) - (initialize-skeleton obj *swamp-rat-sg* '()) - (init-defaults! obj *swamp-rat-nav-enemy-info*) - (vector-float*! (-> obj collide-info scale) *identity-vector* 1.5) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj wiggle-angle) 0.0) - (set! (-> obj delta-wiggle-angle) 910.2222) - (set! (-> obj wiggle-factor) 1.5) - (set! (-> obj reaction-time) (rand-vu-int-range (seconds 0.1) (seconds 0.8))) - (set! (-> obj chase-rest-time) (seconds 1)) - (set! (-> obj water) (new 'process 'water-control obj 7 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01)) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 12288.0) - (set! (-> obj min-height) (+ -2048.0 (-> obj water height))) - (set! (-> obj up-vector quad) (-> *y-vector* quad)) +(defmethod nav-enemy-method-48 swamp-rat ((this swamp-rat)) + (initialize-skeleton this *swamp-rat-sg* '()) + (init-defaults! this *swamp-rat-nav-enemy-info*) + (vector-float*! (-> this collide-info scale) *identity-vector* 1.5) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this wiggle-angle) 0.0) + (set! (-> this delta-wiggle-angle) 910.2222) + (set! (-> this wiggle-factor) 1.5) + (set! (-> this reaction-time) (rand-vu-int-range (seconds 0.1) (seconds 0.8))) + (set! (-> this chase-rest-time) (seconds 1)) + (set! (-> this water) (new 'process 'water-control this 7 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 12288.0) + (set! (-> this min-height) (+ -2048.0 (-> this water height))) + (set! (-> this up-vector quad) (-> *y-vector* quad)) 0 (none) ) diff --git a/goal_src/jak1/levels/title/title-obs.gc b/goal_src/jak1/levels/title/title-obs.gc index 30cf2aec20..b8de6b3c8a 100644 --- a/goal_src/jak1/levels/title/title-obs.gc +++ b/goal_src/jak1/levels/title/title-obs.gc @@ -32,11 +32,11 @@ ) -(defmethod relocate logo ((obj logo) (arg0 int)) - (if (nonzero? (-> obj main-joint)) - (&+! (-> obj main-joint) arg0) +(defmethod relocate logo ((this logo) (arg0 int)) + (if (nonzero? (-> this main-joint)) + (&+! (-> this main-joint) arg0) ) - (the-as logo ((method-of-type process-drawable relocate) obj arg0)) + (the-as logo ((method-of-type process-drawable relocate) this arg0)) ) (deftype logo-slave (process-drawable) @@ -53,11 +53,11 @@ ) -(defmethod relocate logo-slave ((obj logo-slave) (arg0 int)) - (if (nonzero? (-> obj main-joint)) - (&+! (-> obj main-joint) arg0) +(defmethod relocate logo-slave ((this logo-slave) (arg0 int)) + (if (nonzero? (-> this main-joint)) + (&+! (-> this main-joint) arg0) ) - (the-as logo-slave ((method-of-type process-drawable relocate) obj arg0)) + (the-as logo-slave ((method-of-type process-drawable relocate) this arg0)) ) (defskelgroup *logo-sg* logo logo-english-lod0-jg logo-idle-ja @@ -226,7 +226,7 @@ ) ) (send-event (handle->process (-> self camera)) 'mask 0) - ;; check language instead of territory here + ;; og:preserve-this check language instead of territory here (#if PC_PORT (if (= (-> *setting-control* default language) (language-enum japanese)) (set! (-> self volumes) (ppointer->handle (process-spawn logo-slave (-> self entity) *logo-volumes-japan-sg* :to self))) @@ -429,8 +429,8 @@ ) (loop (when (and (none-reserved? *art-control*) (not (paused?))) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 0.1)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.1)) (set! *camera-look-through-other* 2) (suspend) ) @@ -455,7 +455,7 @@ :enter (behavior () (set-setting! 'bg-a 'abs 0.0 0) (apply-settings *setting-control*) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if *time-of-day-proc* (set! (-> *time-of-day-proc* 0 hour) 12) ) @@ -467,6 +467,7 @@ ) :trans (behavior () ((-> (method-of-type logo startup) trans)) + ;; og:preserve-this (if (and (or *debug-segment* PC_PORT) (cpad-pressed? 0 start circle x) (member (level-status *level* 'village1) '(loaded active)) @@ -475,7 +476,7 @@ ) (when (and (= (-> *setting-control* current bg-a) 1.0) (and (member (level-status *level* 'village1) '(active loaded)) - ;; i think we can forgo the time check here... + ;; og:preserve-this i think we can forgo the time check here... (#if PC_PORT #t (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3))) (let ((gp-2 (level-get *level* 'village1))) (when gp-2 @@ -533,6 +534,7 @@ (send-event (handle->process (-> self sidekick)) 'origin-joint-index 6) (set! (-> self anim) (-> self next-anim)) (set! (-> self next-anim) (new 'static 'spool-anim :name "logo-intro" :index 5 :parts 3 :command-list '())) + ;; og:preserve-this (#cond (PC_PORT (cond @@ -573,7 +575,7 @@ (('logo) (set! (-> *time-of-day-context* title-light-group dir1 levels x) 0.0) (set! (-> *time-of-day-context* title-light-group ambi levels x) 0.444) - ;; check language instead of territory here + ;; og:preserve-this check language instead of territory here (#if PC_PORT (if (= (-> *setting-control* default language) (language-enum japanese)) (initialize-skeleton self *logo-japan-sg* '()) @@ -663,7 +665,7 @@ (set-setting! 'allow-progress #f 0.0 0) (set-setting! 'border-mode #f 0.0 0) (apply-settings *setting-control*) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self manipy) (the-as (pointer manipy) #f)) (ja-channel-set! 0) (ja-post) @@ -707,8 +709,8 @@ (set-blackout-frames (seconds 0.05)) (suspend) ) - (let ((s5-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.25)) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 0.25)) (set-blackout-frames (seconds 0.05)) (suspend) ) @@ -748,8 +750,8 @@ (while *progress-process* (suspend) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.01)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.01)) (suspend) ) ) diff --git a/goal_src/jak1/levels/training/training-obs.gc b/goal_src/jak1/levels/training/training-obs.gc index cbc7f31596..27b6921834 100644 --- a/goal_src/jak1/levels/training/training-obs.gc +++ b/goal_src/jak1/levels/training/training-obs.gc @@ -29,13 +29,13 @@ ) ) -(defmethod water-vol-method-22 training-water ((obj training-water)) +(defmethod water-vol-method-22 training-water ((this training-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) @@ -65,11 +65,11 @@ ) -(defmethod relocate training-cam ((obj training-cam) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate training-cam ((this training-cam) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (the-as training-cam ((method-of-type process relocate) obj arg0)) + (the-as training-cam ((method-of-type process relocate) this arg0)) ) (defstate idle (training-cam) @@ -92,7 +92,7 @@ ) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-grab? *target*) (process-entity-status! self (entity-perm-status bit-3) #t) (until (not (or (-> *setting-control* current talking) (or (-> *setting-control* current spooling) @@ -120,7 +120,7 @@ (suspend) ) ) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (suspend) ) (remove-setting! 'movie) @@ -173,8 +173,8 @@ (when (not (task-complete? *game-info* (game-task training-climb))) (clear-text-seen! *game-info* (text-id training-double-jump)) (level-hint-spawn (text-id training-double-jump) "sagevb27" (the-as entity #f) *entity-pool* (game-task none)) - (let ((gp-8 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-8) (seconds 30)) + (let ((gp-8 (current-time))) + (until (time-elapsed? gp-8 (seconds 30)) (suspend) ) ) @@ -208,16 +208,16 @@ ) ) -(defmethod init-from-entity! training-cam ((obj training-cam) (arg0 entity-actor)) +(defmethod init-from-entity! training-cam ((this training-cam) (arg0 entity-actor)) "Copy defaults from the entity." - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj root) (new 'process 'trsq)) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 quat)) - (vector-identity! (-> obj root scale)) - (set! (-> obj range) (res-lump-float arg0 'cam-notice-dist :default 81920.0)) - (set! (-> obj index) (res-lump-value arg0 'index int)) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsq)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (set! (-> this range) (res-lump-float arg0 'cam-notice-dist :default 81920.0)) + (set! (-> this index) (res-lump-value arg0 'index int)) + (go (method-of-object this idle)) (none) ) @@ -231,19 +231,19 @@ ) -(defmethod init-from-entity! tra-pontoon ((obj tra-pontoon) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) - (go (method-of-object obj rigid-body-platform-idle)) +(defmethod init-from-entity! tra-pontoon ((this tra-pontoon) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) + (go (method-of-object this rigid-body-platform-idle)) 0 (none) ) -(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) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) +(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) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) @@ -279,8 +279,8 @@ :bounds (static-spherem 0 0 0 5) ) -(defmethod rigid-body-platform-method-30 tra-pontoon ((obj tra-pontoon)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 tra-pontoon ((this tra-pontoon)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -298,43 +298,43 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-31 tra-pontoon ((obj tra-pontoon)) - (initialize-skeleton obj *tra-pontoon-sg* '()) - (rigid-body-platform-method-29 obj *tra-pontoon-constants*) - (set! (-> obj float-height-offset) 6144.0) - (set! (-> obj root-overlay nav-radius) 20480.0) - (let ((v1-6 (-> obj control-point-array data))) +(defmethod rigid-body-platform-method-31 tra-pontoon ((this tra-pontoon)) + (initialize-skeleton this *tra-pontoon-sg* '()) + (rigid-body-platform-method-29 this *tra-pontoon-constants*) + (set! (-> this float-height-offset) 6144.0) + (set! (-> this root-overlay nav-radius) 20480.0) + (let ((v1-6 (-> this control-point-array data))) (set! (-> v1-6 0 local-pos x) 9216.0) (set! (-> v1-6 0 local-pos y) 0.0) (set! (-> v1-6 0 local-pos z) 12083.2) (set! (-> v1-6 0 local-pos w) 1.0) ) - (let ((v1-8 (-> obj control-point-array data 1))) + (let ((v1-8 (-> this control-point-array data 1))) (set! (-> v1-8 local-pos x) 9216.0) (set! (-> v1-8 local-pos y) 0.0) (set! (-> v1-8 local-pos z) -12083.2) (set! (-> v1-8 local-pos w) 1.0) ) - (let ((v1-10 (-> obj control-point-array data 2))) + (let ((v1-10 (-> this control-point-array data 2))) (set! (-> v1-10 local-pos x) -9216.0) (set! (-> v1-10 local-pos y) 0.0) (set! (-> v1-10 local-pos z) -12083.2) (set! (-> v1-10 local-pos w) 1.0) ) - (let ((v1-12 (-> obj control-point-array data 3))) + (let ((v1-12 (-> this control-point-array data 3))) (set! (-> v1-12 local-pos x) -9216.0) (set! (-> v1-12 local-pos y) 0.0) (set! (-> v1-12 local-pos z) 12083.2) (set! (-> v1-12 local-pos w) 1.0) ) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) - (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f)) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) + (nav-mesh-connect this (-> this root-overlay) (the-as nav-control #f)) 0 (none) ) @@ -353,8 +353,8 @@ :bounds (static-spherem 0 0 0 8) ) -(defmethod eco-door-method-24 tra-iris-door ((obj tra-iris-door)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod eco-door-method-24 tra-iris-door ((this tra-iris-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -366,17 +366,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod eco-door-method-25 tra-iris-door ((obj tra-iris-door)) - (initialize-skeleton obj *tra-iris-door-sg* '()) - (set! (-> obj open-distance) 32768.0) - (set! (-> obj close-distance) 49152.0) - (update-transforms! (-> obj root-override)) +(defmethod eco-door-method-25 tra-iris-door ((this tra-iris-door)) + (initialize-skeleton this *tra-iris-door-sg* '()) + (set! (-> this open-distance) 32768.0) + (set! (-> this close-distance) 49152.0) + (update-transforms! (-> this root-override)) 0 (none) ) @@ -767,8 +767,8 @@ :post ja-post ) -(defmethod init-from-entity! scarecrow-a ((obj scarecrow-a) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! scarecrow-a ((this scarecrow-a) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -794,11 +794,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *scarecrow-a-sg* '()) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *scarecrow-a-sg* '()) + (go (method-of-object this idle)) (none) ) @@ -906,8 +906,8 @@ :post ja-post ) -(defmethod init-from-entity! scarecrow-b ((obj scarecrow-b) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! scarecrow-b ((this scarecrow-b) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -941,10 +941,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *scarecrow-b-sg* '()) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *scarecrow-b-sg* '()) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak1/levels/training/training-part.gc b/goal_src/jak1/levels/training/training-part.gc index 6ebcf701f0..d011a071a7 100644 --- a/goal_src/jak1/levels/training/training-part.gc +++ b/goal_src/jak1/levels/training/training-part.gc @@ -814,7 +814,7 @@ (defun tra-bird-bob-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (set! (-> arg2 y) (+ (-> (the-as process-drawable (-> arg1 key proc)) root trans y) - (* -2048.0 (sin (* 218.45334 (the float (mod (-> *display* base-frame-counter) 300))))) + (* -2048.0 (sin (* 218.45334 (the float (mod (current-time) 300))))) ) ) 0 diff --git a/goal_src/jak1/levels/village1/assistant.gc b/goal_src/jak1/levels/village1/assistant.gc index ff7dbbd803..b8b16bd2fa 100644 --- a/goal_src/jak1/levels/village1/assistant.gc +++ b/goal_src/jak1/levels/village1/assistant.gc @@ -23,10 +23,10 @@ :shadow assistant-shadow-mg ) -(defmethod process-taskable-method-52 assistant ((obj assistant)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 assistant ((this assistant)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -42,21 +42,21 @@ (none) ) -(defmethod draw-npc-shadow assistant ((obj assistant)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow assistant ((this assistant)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -65,18 +65,18 @@ (none) ) -(defmethod play-anim! assistant ((obj assistant) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! assistant ((this assistant) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task jungle-eggtop)) (when arg0 - (let* ((s5-1 (-> obj tasks)) + (let* ((s5-1 (-> this tasks)) (s4-0 (method-of-object s5-1 save-reminder)) ) (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "assistant-introduction-blue-eco-switch" @@ -113,7 +113,7 @@ ) (else (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "assistant-introduction-race-bike" @@ -125,28 +125,28 @@ ) ) (((task-status need-reminder) (task-status need-reminder-a)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((= (current-task (-> obj tasks)) (game-task none)) + ((= (current-task (-> this tasks)) (game-task none)) (new 'static 'spool-anim :name "assistant-reminder-1-generic" :index 14 :parts 2 :command-list '()) ) - ((closed? (-> obj tasks) (game-task jungle-eggtop) (task-status need-resolution)) + ((closed? (-> this tasks) (game-task jungle-eggtop) (task-status need-resolution)) (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) ) - ((or (closed? (-> obj tasks) (game-task misty-bike) (task-status need-resolution)) - (not (closed? (-> obj tasks) (game-task misty-bike) (task-status need-introduction))) + ((or (closed? (-> this tasks) (game-task misty-bike) (task-status need-resolution)) + (not (closed? (-> this tasks) (game-task misty-bike) (task-status need-introduction))) ) (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) ) - ((zero? (get-reminder (-> obj tasks) 2)) + ((zero? (get-reminder (-> this tasks) 2)) (if arg0 - (save-reminder (-> obj tasks) 1 2) + (save-reminder (-> this tasks) 1 2) ) (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) ) (else (if arg0 - (save-reminder (-> obj tasks) 0 2) + (save-reminder (-> this tasks) 0 2) ) (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) ) @@ -157,21 +157,22 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod get-art-elem assistant ((obj assistant)) - (-> obj draw art-group data 3) +(defmethod get-art-elem assistant ((this assistant)) + (-> this draw art-group data 3) ) -(defmethod process-taskable-method-43 assistant ((obj assistant)) - (let ((s5-0 (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj))) +(defmethod process-taskable-method-43 assistant ((this assistant)) + (let ((s5-0 (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this)) + ) (when s5-0 (let ((f0-2 (rand-float-gen))) (cond @@ -179,19 +180,19 @@ #f ) ((< 0.8 f0-2) - (play-ambient (-> obj ambient) "ASSTLP01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP01" #f (-> this root-override trans)) ) ((< 0.6 f0-2) - (play-ambient (-> obj ambient) "ASSTLP04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP04" #f (-> this root-override trans)) ) ((< 0.4 f0-2) - (play-ambient (-> obj ambient) "ASSTLP05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP05" #f (-> this root-override trans)) ) ((< 0.2 f0-2) - (play-ambient (-> obj ambient) "ASSTLP02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP02" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "ASSTLP03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP03" #f (-> this root-override trans)) ) ) ) @@ -362,20 +363,20 @@ (none) ) -(defmethod init-from-entity! assistant ((obj assistant) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-sg* 3 31 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj bounce-away) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 122) obj)) - (set! (-> obj tasks) (get-task-control (game-task jungle-eggtop))) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj draw light-index) (the-as uint 1)) +(defmethod init-from-entity! assistant ((this assistant) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-sg* 3 31 (new 'static 'vector :w 4096.0) 5) + (set! (-> this bounce-away) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 122) this)) + (set! (-> this tasks) (get-task-control (game-task jungle-eggtop))) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this draw light-index) (the-as uint 1)) (case (get-task-status (game-task firecanyon-assistant)) (((task-status unknown)) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) (else - (cleanup-for-death obj) - (deactivate obj) + (cleanup-for-death this) + (deactivate this) ) ) (none) diff --git a/goal_src/jak1/levels/village1/explorer.gc b/goal_src/jak1/levels/village1/explorer.gc index 1ed9f3b37d..82e1d780ce 100644 --- a/goal_src/jak1/levels/village1/explorer.gc +++ b/goal_src/jak1/levels/village1/explorer.gc @@ -22,10 +22,10 @@ :shadow explorer-shadow-mg ) -(defmethod process-taskable-method-52 explorer ((obj explorer)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 explorer ((this explorer)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -41,21 +41,21 @@ (none) ) -(defmethod draw-npc-shadow explorer ((obj explorer)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow explorer ((this explorer)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -64,12 +64,12 @@ (none) ) -(defmethod play-anim! explorer ((obj explorer) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! explorer ((this explorer) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "explorer-introduction" @@ -79,11 +79,11 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (if arg0 - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) (new 'static 'spool-anim :name "explorer-reminder-1" @@ -100,7 +100,7 @@ ) (else (if arg0 - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) (new 'static 'spool-anim :name "explorer-reminder-2" :index 11 :parts 3 :command-list '()) ) @@ -109,13 +109,13 @@ (((task-status need-reward-speech)) (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) ) (else - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this will-talk) #t) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (new 'static 'spool-anim @@ -130,54 +130,54 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod get-art-elem explorer ((obj explorer)) - (-> obj draw art-group data 3) +(defmethod get-art-elem explorer ((this explorer)) + (-> this draw art-group data 3) ) -(defmethod process-taskable-method-43 explorer ((obj explorer)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 explorer ((this explorer)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> obj ambient) "EXP-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "EXP-AM05" #f (-> this root-override trans)) ) ((< 0.71428573 f0-2) - (if (not (closed? (-> obj tasks) (game-task village1-uncle-money) (task-status need-reminder))) - (play-ambient (-> obj ambient) "EXP-LO02" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task village1-uncle-money) (task-status need-reminder))) + (play-ambient (-> this ambient) "EXP-LO02" #f (-> this root-override trans)) ) ) ((< 0.5714286 f0-2) - (play-ambient (-> obj ambient) "EXP-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "EXP-AM04" #f (-> this root-override trans)) ) ((< 0.42857143 f0-2) - (play-ambient (-> obj ambient) "EXP-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "EXP-AM03" #f (-> this root-override trans)) ) ((< 0.2857143 f0-2) - (play-ambient (-> obj ambient) "EXP-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "EXP-AM02" #f (-> this root-override trans)) ) ((< 0.14285715 f0-2) - (if (not (closed? (-> obj tasks) (game-task village1-uncle-money) (task-status need-reminder))) - (play-ambient (-> obj ambient) "EXP-AM01" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task village1-uncle-money) (task-status need-reminder))) + (play-ambient (-> this ambient) "EXP-AM01" #f (-> this root-override trans)) ) ) (else - (play-ambient (-> obj ambient) "EXP-LO1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "EXP-LO1A" #f (-> this root-override trans)) ) ) ) ) ) -(defmethod target-above-threshold? explorer ((obj explorer)) +(defmethod target-above-threshold? explorer ((this explorer)) (the-as symbol (and *target* (< (-> (target-pos 0) x) -202752.0) (< 98304.0 (-> (target-pos 0) z)))) ) @@ -209,8 +209,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (while (let ((s5-0 (-> *display* base-frame-counter)) + (let ((gp-1 (current-time))) + (while (let ((s5-0 (current-time)) (f30-1 300.0) (f28-0 0.5) (f26-0 0.5) @@ -226,8 +226,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (while (let ((s5-1 (-> *display* base-frame-counter)) + (let ((gp-2 (current-time))) + (while (let ((s5-1 (current-time)) (f30-2 300.0) (f28-1 0.5) (f26-1 0.5) @@ -248,8 +248,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-3 (-> *display* base-frame-counter))) - (while (let ((s5-2 (-> *display* base-frame-counter)) + (let ((gp-3 (current-time))) + (while (let ((s5-2 (current-time)) (f30-3 300.0) (f28-2 0.5) (f26-2 0.5) @@ -278,8 +278,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-4 (-> *display* base-frame-counter))) - (while (let ((s5-3 (-> *display* base-frame-counter)) + (let ((gp-4 (current-time))) + (while (let ((s5-3 (current-time)) (f30-4 300.0) (f28-3 0.5) (f26-3 0.5) @@ -294,8 +294,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-5 (-> *display* base-frame-counter))) - (while (let ((s5-4 (-> *display* base-frame-counter)) + (let ((gp-5 (current-time))) + (while (let ((s5-4 (current-time)) (f30-5 300.0) (f28-4 0.5) (f26-4 0.5) @@ -310,8 +310,8 @@ (suspend) (ja :num! (seek! 0.0)) ) - (let ((gp-6 (-> *display* base-frame-counter))) - (while (let ((s5-5 (-> *display* base-frame-counter)) + (let ((gp-6 (current-time))) + (while (let ((s5-5 (current-time)) (f30-6 300.0) (f28-5 0.5) (f26-5 0.5) @@ -332,11 +332,11 @@ ) ) -(defmethod init-from-entity! explorer ((obj explorer) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *explorer-sg* 3 42 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task village1-uncle-money))) - (set! (-> obj sound-flava) (music-flava explorer)) - (set! (-> obj draw light-index) (the-as uint 5)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! explorer ((this explorer) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *explorer-sg* 3 42 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task village1-uncle-money))) + (set! (-> this sound-flava) (music-flava explorer)) + (set! (-> this draw light-index) (the-as uint 5)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village1/farmer.gc b/goal_src/jak1/levels/village1/farmer.gc index bd4c29ac88..56b322ba96 100644 --- a/goal_src/jak1/levels/village1/farmer.gc +++ b/goal_src/jak1/levels/village1/farmer.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype farmer (process-taskable) () :heap-base #x110 @@ -23,26 +22,26 @@ :shadow farmer-shadow-mg ) -(defmethod play-anim! farmer ((obj farmer) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! farmer ((this farmer) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "farmer-introduction" :index 6 :parts 5 :command-list '()) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (if arg0 - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) (new 'static 'spool-anim :name "farmer-reminder-1" :index 7 :parts 2 :command-list '()) ) (else (if arg0 - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) (new 'static 'spool-anim :name "farmer-reminder-2" :index 8 :parts 2 :command-list '()) ) @@ -50,8 +49,8 @@ ) (((task-status need-reward-speech)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "farmer-resolution" :index 9 :parts 4 :command-list '()) ) @@ -60,44 +59,44 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) -(defmethod get-art-elem farmer ((obj farmer)) - (case (current-status (-> obj tasks)) +(defmethod get-art-elem farmer ((this farmer)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction) (task-status need-resolution) (task-status invalid)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (else - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ) ) -(defmethod process-taskable-method-43 farmer ((obj farmer)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 farmer ((this farmer)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8333333 f0-2) - (play-ambient (-> obj ambient) "FAR-LO1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FAR-LO1A" #f (-> this root-override trans)) ) ((< 0.6666667 f0-2) - (play-ambient (-> obj ambient) "FAR-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FAR-AM01" #f (-> this root-override trans)) ) ((< 0.5 f0-2) #f ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "FAR-AM2A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FAR-AM2A" #f (-> this root-override trans)) ) ((< 0.16666667 f0-2) - (play-ambient (-> obj ambient) "FAR-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FAR-AM02" #f (-> this root-override trans)) ) (else #f @@ -107,8 +106,8 @@ ) ) -(defmethod initialize-collision farmer ((obj farmer) (arg0 int) (arg1 vector)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision farmer ((this farmer) (arg0 int) (arg1 vector)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -135,17 +134,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod init-from-entity! farmer ((obj farmer) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *farmer-sg* 3 25 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj root-override nav-radius) 40960.0) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj tasks) (get-task-control (game-task village1-yakow))) - (process-taskable-method-42 obj) +(defmethod init-from-entity! farmer ((this farmer) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *farmer-sg* 3 25 (new 'static 'vector :w 4096.0) 5) + (set! (-> this root-override nav-radius) 40960.0) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this tasks) (get-task-control (game-task village1-yakow))) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village1/fishermans-boat.gc b/goal_src/jak1/levels/village1/fishermans-boat.gc index 0148fdcbad..f5625fa8cb 100644 --- a/goal_src/jak1/levels/village1/fishermans-boat.gc +++ b/goal_src/jak1/levels/village1/fishermans-boat.gc @@ -64,39 +64,39 @@ ) -(defmethod get-point-count vehicle-path ((obj vehicle-path)) - (-> obj point-count) +(defmethod get-point-count vehicle-path ((this vehicle-path)) + (-> this point-count) ) -(defmethod nth-point vehicle-path ((obj vehicle-path) (arg0 int) (arg1 vector)) - (set! (-> arg1 quad) (-> obj point-array arg0 quad)) +(defmethod nth-point vehicle-path ((this vehicle-path) (arg0 int) (arg1 vector)) + (set! (-> arg1 quad) (-> this point-array arg0 quad)) arg1 ) -(defmethod distance-to-next-point vehicle-path ((obj vehicle-path) (arg0 int) (arg1 vector)) +(defmethod distance-to-next-point vehicle-path ((this vehicle-path) (arg0 int) (arg1 vector)) (let ((a2-1 (+ arg0 1))) - (if (>= a2-1 (-> obj point-count)) + (if (>= a2-1 (-> this point-count)) (set! a2-1 0) ) - (vector-! arg1 (-> obj point-array a2-1) (-> obj point-array arg0)) + (vector-! arg1 (-> this point-array a2-1) (-> this point-array arg0)) ) (set! (-> arg1 y) 0.0) (vector-normalize! arg1 1.0) arg1 ) -(defmethod add-point! vehicle-path ((obj vehicle-path) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (let ((v1-0 (-> obj point-count))) +(defmethod add-point! vehicle-path ((this vehicle-path) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (let ((v1-0 (-> this point-count))) (when (< v1-0 10) - (set-vector! (-> obj point-array v1-0) arg0 arg1 arg2 arg3) - (+! (-> obj point-count) 1) + (set-vector! (-> this point-array v1-0) arg0 arg1 arg2 arg3) + (+! (-> this point-count) 1) ) ) 0 (none) ) -(defmethod debug-draw vehicle-path ((obj vehicle-path)) +(defmethod debug-draw vehicle-path ((this vehicle-path)) (local-vars (sv-64 int) (sv-80 (function _varargs_ object))) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -104,10 +104,10 @@ ) (set! (-> s5-0 y) 0.0) (set! (-> s5-0 w) 1.0) - (dotimes (s2-0 (-> obj point-count)) - (let ((v1-1 (mod (+ s2-0 1) (-> obj point-count)))) - (set! (-> s4-0 quad) (-> obj point-array s2-0 quad)) - (set! (-> s3-0 quad) (-> obj point-array v1-1 quad)) + (dotimes (s2-0 (-> this point-count)) + (let ((v1-1 (mod (+ s2-0 1) (-> this point-count)))) + (set! (-> s4-0 quad) (-> this point-array s2-0 quad)) + (set! (-> s3-0 quad) (-> this point-array v1-1 quad)) ) (let ((f30-0 (-> s4-0 y)) (f28-0 (-> s4-0 w)) @@ -267,66 +267,66 @@ ) -(defmethod relocate vehicle-controller ((obj vehicle-controller) (arg0 int)) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) +(defmethod relocate vehicle-controller ((this vehicle-controller) (arg0 int)) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) (the-as vehicle-controller 0) ) -(defmethod vehicle-controller-method-12 vehicle-controller ((obj vehicle-controller) (arg0 int) (arg1 vector)) - (when (< arg0 (get-point-count (-> obj path))) - (set! (-> obj path-dest-index) arg0) - (nth-point (-> obj path) arg0 (-> obj path-dest-point)) - (let ((f30-0 (-> obj path-dest-point y)) - (f28-0 (-> obj path-dest-point w)) +(defmethod vehicle-controller-method-12 vehicle-controller ((this vehicle-controller) (arg0 int) (arg1 vector)) + (when (< arg0 (get-point-count (-> this path))) + (set! (-> this path-dest-index) arg0) + (nth-point (-> this path) arg0 (-> this path-dest-point)) + (let ((f30-0 (-> this path-dest-point y)) + (f28-0 (-> this path-dest-point w)) ) - (set! (-> obj path-dest-velocity x) (* f30-0 (cos f28-0))) - (set! (-> obj path-dest-velocity z) (* f30-0 (sin f28-0))) + (set! (-> this path-dest-velocity x) (* f30-0 (cos f28-0))) + (set! (-> this path-dest-velocity z) (* f30-0 (sin f28-0))) ) - (set! (-> obj path-dest-velocity y) 0.0) - (set! (-> obj path-dest-velocity w) 1.0) - (set! (-> obj path-dest-point y) 0.0) - (set! (-> obj path-dest-point w) 1.0) + (set! (-> this path-dest-velocity y) 0.0) + (set! (-> this path-dest-velocity w) 1.0) + (set! (-> this path-dest-point y) 0.0) + (set! (-> this path-dest-point w) 1.0) (let ((s5-1 (new 'stack-no-clear 'vector))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s3-0 (-> obj path-dest-point) arg1) - (set! (-> s5-1 quad) (-> obj path-dest-velocity quad)) - (set! (-> s5-1 x) (-> obj path-dest-velocity z)) - (set! (-> s5-1 z) (- (-> obj path-dest-velocity x))) + (vector-! s3-0 (-> this path-dest-point) arg1) + (set! (-> s5-1 quad) (-> this path-dest-velocity quad)) + (set! (-> s5-1 x) (-> this path-dest-velocity z)) + (set! (-> s5-1 z) (- (-> this path-dest-velocity x))) (vector-xz-normalize! s5-1 1.0) - (set! (-> obj left-circle) 1) + (set! (-> this left-circle) 1) (when (< 0.0 (vector-dot s3-0 s5-1)) - (set! (-> obj left-circle) 0) + (set! (-> this left-circle) 0) (vector-float*! s5-1 s5-1 -1.0) ) ) - (vector+*! (-> obj dest-circle) (-> obj path-dest-point) s5-1 (-> obj circle-radius)) + (vector+*! (-> this dest-circle) (-> this path-dest-point) s5-1 (-> this circle-radius)) ) - (set! (-> obj dest-circle w) (-> obj circle-radius)) + (set! (-> this dest-circle w) (-> this circle-radius)) ) 0 (none) ) -(defmethod move-to-next-point vehicle-controller ((obj vehicle-controller) (arg0 vector)) - (let ((s4-0 (+ (-> obj path-dest-index) 1))) - (if (>= s4-0 (get-point-count (-> obj path))) +(defmethod move-to-next-point vehicle-controller ((this vehicle-controller) (arg0 vector)) + (let ((s4-0 (+ (-> this path-dest-index) 1))) + (if (>= s4-0 (get-point-count (-> this path))) (set! s4-0 0) ) - (vehicle-controller-method-12 obj s4-0 arg0) + (vehicle-controller-method-12 this s4-0 arg0) ) 0 (none) ) -(defmethod vehicle-controller-method-14 vehicle-controller ((obj vehicle-controller) (arg0 vector) (arg1 vector)) +(defmethod vehicle-controller-method-14 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (vector-! s5-0 (-> obj dest-circle) arg0) + (vector-! s5-0 (-> this dest-circle) arg0) (let ((f30-0 (vector-xz-length s5-0)) - (f28-0 (-> obj dest-circle w)) + (f28-0 (-> this dest-circle w)) ) (if (< f30-0 f28-0) (set! f28-0 (* 0.9 f30-0)) @@ -334,7 +334,7 @@ (vector-normalize! s5-0 1.0) (set! (-> s3-0 x) (-> s5-0 z)) (set! (-> s3-0 z) (- (-> s5-0 x))) - (if (= (-> obj left-circle) 1) + (if (= (-> this left-circle) 1) (vector-float*! s3-0 s3-0 -1.0) ) (let* ((f0-5 f30-0) @@ -345,9 +345,9 @@ ) (let ((f0-12 (/ (* f0-9 f0-9) f30-0))) (set! (-> arg1 quad) (-> arg0 quad)) - (vector+*! arg1 (-> obj target-point) s5-0 f0-12) + (vector+*! arg1 (-> this target-point) s5-0 f0-12) ) - (vector+*! arg1 (-> obj target-point) s3-0 f28-1) + (vector+*! arg1 (-> this target-point) s3-0 f28-1) ) ) ) @@ -355,28 +355,28 @@ (none) ) -(defmethod vehicle-controller-method-15 vehicle-controller ((obj vehicle-controller) (arg0 collide-shape-moving)) - (vehicle-controller-method-14 obj (-> arg0 trans) (-> obj target-point)) +(defmethod vehicle-controller-method-15 vehicle-controller ((this vehicle-controller) (arg0 collide-shape-moving)) + (vehicle-controller-method-14 this (-> arg0 trans) (-> this target-point)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> obj path-dest-velocity quad)) + (set! (-> s3-0 quad) (-> this path-dest-velocity quad)) (vector-xz-normalize! s3-0 1.0) - (vector-! s4-0 (-> obj path-dest-point) (-> arg0 trans)) + (vector-! s4-0 (-> this path-dest-point) (-> arg0 trans)) (let ((f30-0 (vector-dot s3-0 s4-0))) - (if (and (< (vector-xz-length s4-0) (-> obj circle-radius)) (< f30-0 0.0)) - (move-to-next-point obj (-> arg0 trans)) + (if (and (< (vector-xz-length s4-0) (-> this circle-radius)) (< f30-0 0.0)) + (move-to-next-point this (-> arg0 trans)) ) ) ) (let ((s4-2 (max 0 (min - (the int (/ (vector-xz-length (-> obj path-dest-velocity)) (-> obj table-step))) - (+ (-> obj table-length) -1) + (the int (/ (vector-xz-length (-> this path-dest-velocity)) (-> this table-step))) + (+ (-> this table-length) -1) ) ) ) ) - (set! (-> obj throttle) (-> obj throttle-control-table s4-2)) + (set! (-> this throttle) (-> this throttle-control-table s4-2)) ) (let ((s3-1 (new 'stack-no-clear 'vector)) (s4-3 (new 'stack-no-clear 'vector)) @@ -384,10 +384,10 @@ (vector-z-quaternion! s3-1 (-> arg0 quat)) (vector-x-quaternion! s4-3 (-> arg0 quat)) (let* ((v1-16 (-> arg0 trans)) - (f0-9 (- (vector-dot s3-1 (-> obj target-point)) (vector-dot s3-1 v1-16))) - (f3-0 (- (vector-dot s4-3 (-> obj target-point)) (vector-dot s4-3 v1-16))) + (f0-9 (- (vector-dot s3-1 (-> this target-point)) (vector-dot s3-1 v1-16))) + (f3-0 (- (vector-dot s4-3 (-> this target-point)) (vector-dot s4-3 v1-16))) ) - (set! (-> obj steering) (fmax -1.0 (fmin 1.0 (/ (* 4.0 f3-0) (fmax 4096.0 f0-9))))) + (set! (-> this steering) (fmax -1.0 (fmin 1.0 (/ (* 4.0 f3-0) (fmax 4096.0 f0-9))))) ) ) 0 @@ -395,16 +395,16 @@ (none) ) -(defmethod vehicle-controller-method-11 vehicle-controller ((obj vehicle-controller)) +(defmethod vehicle-controller-method-11 vehicle-controller ((this vehicle-controller)) (format #t "(define *turning-radius-table* (new 'static 'inline-array 'float 0~%") - (dotimes (s5-0 (-> obj table-length)) - (format #t " (meters ~4,,2M)~%" (-> obj turning-radius-table s5-0)) + (dotimes (s5-0 (-> this table-length)) + (format #t " (meters ~4,,2M)~%" (-> this turning-radius-table s5-0)) ) (format #t " )~%") (format #t " )~%") (format #t "(define *throttle-control-table* (new 'static 'inline-array 'float 0~%") - (dotimes (s5-1 (-> obj table-length)) - (format #t " ~f~%" (-> obj throttle-control-table s5-1)) + (dotimes (s5-1 (-> this table-length)) + (format #t " ~f~%" (-> this throttle-control-table s5-1)) ) (format #t " )~%") (format #t " )~%") @@ -412,30 +412,30 @@ (none) ) -(defmethod vehicle-controller-method-10 vehicle-controller ((obj vehicle-controller) (arg0 vector) (arg1 float) (arg2 int)) +(defmethod vehicle-controller-method-10 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 float) (arg2 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 quad) (-> arg0 quad)) (set! (-> s3-0 y) 0.0) (vector-xz-normalize! s3-0 1.0) (cond - ((= arg2 (-> obj sample-index)) - (let* ((f30-0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> obj sample-time))))) - (f28-0 (* (-> obj table-step) (the float arg2))) - (f0-4 (acos-rad (vector-dot s3-0 (-> obj sample-dir)))) + ((= arg2 (-> this sample-index)) + (let* ((f30-0 (* 0.0033333334 (the float (- (current-time) (-> this sample-time))))) + (f28-0 (* (-> this table-step) (the float arg2))) + (f0-4 (acos-rad (vector-dot s3-0 (-> this sample-dir)))) (f26-0 (/ (* f28-0 f30-0) f0-4)) ) - (when (and (>= arg2 0) (< arg2 (-> obj table-length))) - (set! (-> obj turning-radius-table arg2) f26-0) - (set! (-> obj throttle-control-table arg2) arg1) + (when (and (>= arg2 0) (< arg2 (-> this table-length))) + (set! (-> this turning-radius-table arg2) f26-0) + (set! (-> this throttle-control-table arg2) arg1) (format #t "sample ~d (~M m/s) angle ~f deg, time ~f sec~%" arg2 f28-0 (* 57.29747 f0-4) f30-0) (format #t "sample ~d (~M m/s) radius ~M throttle ~f~%" arg2 f28-0 f26-0 arg1) ) ) ) (else - (set! (-> obj sample-index) arg2) - (set! (-> obj sample-time) (-> *display* base-frame-counter)) - (set! (-> obj sample-dir quad) (-> s3-0 quad)) + (set! (-> this sample-index) arg2) + (set-time! (-> this sample-time)) + (set! (-> this sample-dir quad) (-> s3-0 quad)) ) ) ) @@ -443,38 +443,38 @@ (none) ) -(defmethod vehicle-controller-method-16 vehicle-controller ((obj vehicle-controller)) - (debug-draw (-> obj path)) +(defmethod vehicle-controller-method-16 vehicle-controller ((this vehicle-controller)) + (debug-draw (-> this path)) (add-debug-sphere #t (bucket-id debug-no-zbuf) - (-> obj dest-circle) - (-> obj dest-circle w) + (-> this dest-circle) + (-> this dest-circle w) (new 'static 'rgba :g #xff :a #x80) ) (add-debug-x #t (bucket-id debug-no-zbuf) - (-> obj target-point) + (-> this target-point) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) 0 (none) ) -(defmethod init! vehicle-controller ((obj vehicle-controller) +(defmethod init! vehicle-controller ((this vehicle-controller) (arg0 vehicle-path) (arg1 (pointer float)) (arg2 (pointer float)) (arg3 int) (arg4 float) ) - (set! (-> obj path) arg0) - (set! (-> obj turning-radius-table) arg1) - (set! (-> obj throttle-control-table) arg2) - (set! (-> obj table-length) arg3) - (set! (-> obj table-step) arg4) - (set! (-> obj circle-radius) 102400.0) + (set! (-> this path) arg0) + (set! (-> this turning-radius-table) arg1) + (set! (-> this throttle-control-table) arg2) + (set! (-> this table-length) arg3) + (set! (-> this table-step) arg4) + (set! (-> this circle-radius) 102400.0) 0 (none) ) @@ -542,40 +542,40 @@ :bounds (static-spherem 0 0 0 1) ) -(defmethod rigid-body-platform-method-23 fishermans-boat ((obj fishermans-boat) (arg0 float)) +(defmethod rigid-body-platform-method-23 fishermans-boat ((this fishermans-boat) (arg0 float)) (local-vars (sv-128 int) (sv-144 rigid-body-control-point) (sv-160 int) (sv-176 vector)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) - (s3-0 (-> obj rbody matrix)) + (s3-0 (-> this rbody matrix)) ) (set! (-> s2-0 quad) (-> s3-0 vector 2 quad)) (set! sv-128 0) (while (< sv-128 6) - (set! sv-144 (-> obj control-point-array data sv-128)) + (set! sv-144 (-> this control-point-array data sv-128)) (vector-matrix*! s5-0 (-> sv-144 local-pos) s3-0) (set! (-> sv-144 world-pos quad) (-> s5-0 quad)) - (rigid-body-method-17 (-> obj rbody) s5-0 s1-0) + (rigid-body-method-17 (-> this rbody) s5-0 s1-0) (set! (-> sv-144 velocity quad) (-> s1-0 quad)) (set! (-> sv-144 world-pos w) (ocean-get-height s5-0)) (let* ((f0-2 (- (-> sv-144 world-pos w) (-> s5-0 y))) - (f30-0 (fmin 1.0 (/ f0-2 (-> obj info max-buoyancy-depth)))) + (f30-0 (fmin 1.0 (/ f0-2 (-> this info max-buoyancy-depth)))) ) (when (< 0.0 f0-2) - (vector-float*! s4-0 *y-vector* (* 20.0 f0-2 (-> obj rbody mass))) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (vector-float*! s4-0 *y-vector* (* 20.0 f0-2 (-> this rbody mass))) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) (vector-float*! s4-0 *y-vector* (* 1.6 f30-0 (fmax 0.0 (vector-dot s2-0 s1-0)))) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) - (vector-float*! s4-0 s1-0 (* -1.0 (-> obj info drag-factor) f30-0)) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) + (vector-float*! s4-0 s1-0 (* -1.0 (-> this info drag-factor) f30-0)) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) (vector-float*! s4-0 (the-as vector (-> s3-0 vector)) (* -0.5 (vector-dot (the-as vector (-> s3-0 vector)) s1-0)) ) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) ) ) 0 @@ -583,28 +583,28 @@ ) (set! sv-160 0) (while (< sv-160 2) - (set! sv-176 (-> obj stabilizer-array sv-160 local-pos)) + (set! sv-176 (-> this stabilizer-array sv-160 local-pos)) (vector-matrix*! s5-0 (the-as vector (&-> sv-176 x)) s3-0) (vector-rotate*! s0-0 (&+ sv-176 16) s3-0) - (rigid-body-method-17 (-> obj rbody) s5-0 s1-0) + (rigid-body-method-17 (-> this rbody) s5-0 s1-0) (vector-float*! s4-0 s0-0 (* -1.0 (vector-dot s0-0 s1-0))) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) 0 (set! sv-160 (+ sv-160 1)) ) - (when (-> obj anchored) + (when (-> this anchored) (let ((s1-1 (new 'stack-no-clear 'vector))) (vector+*! s5-0 (-> s3-0 vector 3) s2-0 24576.0) - (vector+*! s1-1 (-> obj dock-point) (-> obj dest-dir) 24576.0) + (vector+*! s1-1 (-> this dock-point) (-> this dest-dir) 24576.0) (vector-! s4-0 s1-1 s5-0) (set! (-> s4-0 y) 0.0) (vector-float*! s4-0 s4-0 10.0) (if (< 81920.0 (vector-length s4-0)) (vector-normalize! s4-0 81920.0) ) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) (vector+*! s5-0 (-> s3-0 vector 3) s2-0 -24576.0) - (vector+*! s1-1 (-> obj dock-point) (-> obj dest-dir) -24576.0) + (vector+*! s1-1 (-> this dock-point) (-> this dest-dir) -24576.0) (vector-! s4-0 s1-1 s5-0) ) (set! (-> s4-0 y) 0.0) @@ -612,21 +612,21 @@ (if (< 81920.0 (vector-length s4-0)) (vector-normalize! s4-0 81920.0) ) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) ) - (when (-> obj ignition) + (when (-> this ignition) (let ((s2-1 (new 'stack-no-clear 'vector))) - (vector-matrix*! s5-0 (-> obj engine-thrust-local-pos) s3-0) - (set-vector! s2-1 (- (-> obj controller steering)) 0.0 2.0 1.0) + (vector-matrix*! s5-0 (-> this engine-thrust-local-pos) s3-0) + (set-vector! s2-1 (- (-> this controller steering)) 0.0 2.0 1.0) (vector-rotate*! s2-1 s2-1 s3-0) (vector-normalize! s2-1 1.0) - (vector-float*! s4-0 s2-1 (-> obj engine-thrust)) + (vector-float*! s4-0 s2-1 (-> this engine-thrust)) ) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) ) ) - (rigid-body-platform-method-26 obj) - (rigid-body-platform-method-25 obj) + (rigid-body-platform-method-26 this) + (rigid-body-platform-method-25 this) 0 (none) ) @@ -708,8 +708,8 @@ (defbehavior fishermans-boat-play-sounds fishermans-boat () (if (-> self ignition) - (seek! (-> self engine-sound-envelope) 1.0 (* 2.0 (-> *display* seconds-per-frame))) - (seek! (-> self engine-sound-envelope) 0.0 (-> *display* seconds-per-frame)) + (seek! (-> self engine-sound-envelope) 1.0 (* 2.0 (seconds-per-frame))) + (seek! (-> self engine-sound-envelope) 0.0 (seconds-per-frame)) ) (cond ((< 0.0 (-> self engine-sound-envelope)) @@ -757,11 +757,11 @@ (else (when (not (-> self measure-parameters)) (let ((f0-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0))) - (seek! (-> self controller steering) (fmax -1.0 (fmin 1.0 f0-0)) (-> *display* seconds-per-frame)) + (seek! (-> self controller steering) (fmax -1.0 (fmin 1.0 f0-0)) (seconds-per-frame)) ) (if (cpad-hold? 0 x) - (seek! (-> self controller throttle) 0.8 (-> *display* seconds-per-frame)) - (seek! (-> self controller throttle) 0.0 (* 0.25 (-> *display* seconds-per-frame))) + (seek! (-> self controller throttle) 0.8 (seconds-per-frame)) + (seek! (-> self controller throttle) 0.0 (* 0.25 (seconds-per-frame))) ) 0 ) @@ -830,7 +830,7 @@ (when (and (< (vector-vector-distance (target-pos 0) (-> self rbody position)) 6144.0) (or (task-complete? *game-info* (game-task jungle-fishgame)) (and *cheat-mode* (cpad-hold? 0 l3))) (not (level-hint-displayed?)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (file-status *art-control* (-> self anim name) 0) ) (hide-hud) @@ -885,7 +885,7 @@ (defstate fishermans-boat-docked-village (fishermans-boat) :event rigid-body-platform-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (fishermans-boat-leave-dock?) @@ -992,7 +992,7 @@ (defstate fishermans-boat-docked-misty (fishermans-boat) :event rigid-body-platform-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (fishermans-boat-leave-dock?) @@ -1183,11 +1183,11 @@ (let ((f30-0 (* (the float s5-0) (-> self controller table-step)))) (set! (-> self measure-parameters) #t) (set! (-> self controller steering) 1.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (let ((f0-6 (/ (fabs (- f30-0 (vector-xz-length (-> self rbody lin-velocity)))) f30-0))) (if (< 0.05 f0-6) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) ) (fishermans-boat-set-throttle-by-speed f30-0) @@ -1195,8 +1195,8 @@ ) (vector-z-quaternion! gp-0 (-> self root-overlay quat)) (vehicle-controller-method-10 (-> self controller) gp-0 (-> self controller throttle) s5-0) - (let ((s3-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s3-0) (seconds 1)) + (let ((s3-0 (current-time))) + (until (time-elapsed? s3-0 (seconds 1)) (fishermans-boat-set-throttle-by-speed f30-0) (suspend) (suspend) @@ -1213,22 +1213,22 @@ :post fishermans-boat-post ) -(defmethod relocate fishermans-boat ((obj fishermans-boat) (arg0 int)) - (relocate (-> obj controller) arg0) - (if (nonzero? (-> obj propeller)) - (&+! (-> obj propeller) arg0) +(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)) - obj + this arg0 ) ) ) -(defmethod rigid-body-platform-method-30 fishermans-boat ((obj fishermans-boat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod rigid-body-platform-method-30 fishermans-boat ((this fishermans-boat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1254,108 +1254,108 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-31 fishermans-boat ((obj fishermans-boat)) - (initialize-skeleton obj *fishermans-boat-sg* '()) - (logclear! (-> obj mask) (process-mask actor-pause movie)) - (logior! (-> obj skel status) (janim-status inited)) - (process-entity-status! obj (entity-perm-status bit-3) #t) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj boat-path point-count) 0) - (add-point! (-> obj boat-path) -88473.6 28672.0 425984.0 16384.0) - (add-point! (-> obj boat-path) 18432.0 69632.0 1014169.6 14563.556) - (add-point! (-> obj boat-path) 292864.0 122880.0 2875801.5 18204.445) - (add-point! (-> obj boat-path) 167936.0 40960.0 3069952.0 32768.0) - (add-point! (-> obj boat-path) 49971.2 28672.0 2924544.0 -16384.0) - (add-point! (-> obj boat-path) 175718.4 122880.0 626688.0 -18204.445) - (add-point! (-> obj boat-path) 50790.4 40960.0 197427.2 32768.0) +(defmethod rigid-body-platform-method-31 fishermans-boat ((this fishermans-boat)) + (initialize-skeleton this *fishermans-boat-sg* '()) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (logior! (-> this skel status) (janim-status inited)) + (process-entity-status! this (entity-perm-status bit-3) #t) + (process-entity-status! this (entity-perm-status bit-7) #t) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this boat-path point-count) 0) + (add-point! (-> this boat-path) -88473.6 28672.0 425984.0 16384.0) + (add-point! (-> this boat-path) 18432.0 69632.0 1014169.6 14563.556) + (add-point! (-> this boat-path) 292864.0 122880.0 2875801.5 18204.445) + (add-point! (-> this boat-path) 167936.0 40960.0 3069952.0 32768.0) + (add-point! (-> this boat-path) 49971.2 28672.0 2924544.0 -16384.0) + (add-point! (-> this boat-path) 175718.4 122880.0 626688.0 -18204.445) + (add-point! (-> this boat-path) 50790.4 40960.0 197427.2 32768.0) (init! - (-> obj controller) - (-> obj boat-path) + (-> this controller) + (-> this boat-path) *boat-turning-radius-table* *boat-throttle-control-table* 30 4096.0 ) - (set! (-> obj propeller) (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :z -1.0 :w 1.0) 0.0)) - (set! (-> obj ignition) #f) - (set! (-> obj anchored) #t) - (set! (-> obj player-riding) #f) - (set! (-> obj kill-player) #f) - (set! (-> obj debug-draw) #f) - (set! (-> obj cam-tracker) (the-as handle #f)) - (set! (-> obj auto-pilot) #f) + (set! (-> this propeller) (new 'process 'joint-mod-spinner this 4 (new 'static 'vector :z -1.0 :w 1.0) 0.0)) + (set! (-> this ignition) #f) + (set! (-> this anchored) #t) + (set! (-> this player-riding) #f) + (set! (-> this kill-player) #f) + (set! (-> this debug-draw) #f) + (set! (-> this cam-tracker) (the-as handle #f)) + (set! (-> this auto-pilot) #f) (if (= (-> *game-info* current-continue level) 'misty) (fishermans-boat-set-dock-point 4) (fishermans-boat-set-dock-point 0) ) - (fishermans-boat-set-path-point (-> obj dock-point-index)) + (fishermans-boat-set-path-point (-> this dock-point-index)) (fishermans-boat-next-path-point) - (set! (-> obj root-overlay trans quad) (-> obj dock-point quad)) - (set! (-> obj root-overlay trans y) 0.0) - (forward-up-nopitch->quaternion (-> obj root-overlay quat) (-> obj dest-dir) *up-vector*) - (rigid-body-platform-method-29 obj *fishermans-boat-constants*) - (let ((v1-39 (-> obj control-point-array data))) + (set! (-> this root-overlay trans quad) (-> this dock-point quad)) + (set! (-> this root-overlay trans y) 0.0) + (forward-up-nopitch->quaternion (-> this root-overlay quat) (-> this dest-dir) *up-vector*) + (rigid-body-platform-method-29 this *fishermans-boat-constants*) + (let ((v1-39 (-> this control-point-array data))) (set! (-> v1-39 0 local-pos x) 0.0) (set! (-> v1-39 0 local-pos y) 0.0) (set! (-> v1-39 0 local-pos z) 24576.0) (set! (-> v1-39 0 local-pos w) 1.0) ) - (let ((v1-41 (-> obj control-point-array data 1))) + (let ((v1-41 (-> this control-point-array data 1))) (set! (-> v1-41 local-pos x) 22528.0) (set! (-> v1-41 local-pos y) 0.0) (set! (-> v1-41 local-pos z) -20480.0) (set! (-> v1-41 local-pos w) 1.0) ) - (let ((v1-43 (-> obj control-point-array data 2))) + (let ((v1-43 (-> this control-point-array data 2))) (set! (-> v1-43 local-pos x) -22528.0) (set! (-> v1-43 local-pos y) 0.0) (set! (-> v1-43 local-pos z) -20480.0) (set! (-> v1-43 local-pos w) 1.0) ) - (let ((v1-45 (-> obj control-point-array data 3))) + (let ((v1-45 (-> this control-point-array data 3))) (set! (-> v1-45 local-pos x) 0.0) (set! (-> v1-45 local-pos y) 0.0) (set! (-> v1-45 local-pos z) 49152.0) (set! (-> v1-45 local-pos w) 1.0) ) - (let ((v1-47 (-> obj control-point-array data 4))) + (let ((v1-47 (-> this control-point-array data 4))) (set! (-> v1-47 local-pos x) 22528.0) (set! (-> v1-47 local-pos y) 0.0) (set! (-> v1-47 local-pos z) 12288.0) (set! (-> v1-47 local-pos w) 1.0) ) - (let ((v1-49 (-> obj control-point-array data 5))) + (let ((v1-49 (-> this control-point-array data 5))) (set! (-> v1-49 local-pos x) -22528.0) (set! (-> v1-49 local-pos y) 0.0) (set! (-> v1-49 local-pos z) 12288.0) (set! (-> v1-49 local-pos w) 1.0) ) - (let ((v1-50 (-> obj stabilizer-array))) + (let ((v1-50 (-> this stabilizer-array))) (set! (-> v1-50 0 local-pos x) 16384.0) (set! (-> v1-50 0 local-pos y) 20480.0) (set! (-> v1-50 0 local-pos z) -32768.0) (set! (-> v1-50 0 local-pos w) 1.0) ) - (set-vector! (-> obj stabilizer-array 1 local-pos) -16384.0 20480.0 -32768.0 1.0) - (set-vector! (-> obj stabilizer-array 0 normal) 0.0 0.75 0.2 1.0) - (set-vector! (-> obj stabilizer-array 1 normal) 0.0 0.75 0.2 1.0) - (set-vector! (-> obj engine-thrust-local-pos) 0.0 12288.0 -20480.0 1.0) - (set! (-> obj root-overlay nav-radius) 53248.0) - (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f)) - (set! (-> obj engine-sound-id) (new 'static 'sound-id)) - (set! (-> obj debug-path-record) #f) - (set! (-> obj debug-path-playback) #f) - (set! (-> obj measure-parameters) #f) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (let ((a0-29 (-> obj entity))) + (set-vector! (-> this stabilizer-array 1 local-pos) -16384.0 20480.0 -32768.0 1.0) + (set-vector! (-> this stabilizer-array 0 normal) 0.0 0.75 0.2 1.0) + (set-vector! (-> this stabilizer-array 1 normal) 0.0 0.75 0.2 1.0) + (set-vector! (-> this engine-thrust-local-pos) 0.0 12288.0 -20480.0 1.0) + (set! (-> this root-overlay nav-radius) 53248.0) + (nav-mesh-connect this (-> this root-overlay) (the-as nav-control #f)) + (set! (-> this engine-sound-id) (new 'static 'sound-id)) + (set! (-> this debug-path-record) #f) + (set! (-> this debug-path-playback) #f) + (set! (-> this measure-parameters) #f) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (let ((a0-29 (-> this entity))) (if (when a0-29 (let ((a0-30 (-> a0-29 extra perm task))) (if a0-30 @@ -1363,18 +1363,18 @@ ) ) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) (none) ) -(defmethod init-from-entity! fishermans-boat ((obj fishermans-boat) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask platform)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) +(defmethod init-from-entity! fishermans-boat ((this fishermans-boat) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask platform)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) (if (= (-> *game-info* current-continue level) 'misty) (go fishermans-boat-docked-misty) (go fishermans-boat-docked-village) @@ -1447,8 +1447,8 @@ process (lambda :behavior fishermans-boat () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) diff --git a/goal_src/jak1/levels/village1/sage.gc b/goal_src/jak1/levels/village1/sage.gc index ce70052f9b..ce2db8980e 100644 --- a/goal_src/jak1/levels/village1/sage.gc +++ b/goal_src/jak1/levels/village1/sage.gc @@ -24,7 +24,7 @@ :shadow sage-shadow-mg ) -(defmethod play-anim! sage ((obj sage) (arg0 symbol)) +(defmethod play-anim! sage ((this sage) (arg0 symbol)) (when (!= *kernel-boot-message* 'play) (close-specific-task! (game-task intro) (task-status need-resolution)) (return (new 'static 'spool-anim @@ -45,12 +45,12 @@ ) ) ) - (case (current-status (-> obj tasks)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task intro)) (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) (set-setting! 'music-volume-movie 'abs 0.0 0) (apply-settings *setting-control*) ) @@ -111,12 +111,12 @@ ) (((game-task beach-ecorocks)) (when arg0 - (let* ((s5-1 (-> obj tasks)) + (let* ((s5-1 (-> this tasks)) (s4-0 (method-of-object s5-1 save-reminder)) ) (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "sage-intro-sequence-e" @@ -160,7 +160,7 @@ ) (else (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "sage-introduction-misty-cannon" @@ -179,11 +179,11 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (if arg0 - (set! (-> obj reminder-played) #t) + (set! (-> this reminder-played) #t) ) - (case (get-reminder (-> obj tasks) 0) + (case (get-reminder (-> this tasks) 0) ((3) (new 'static 'spool-anim :name "sage-reminder-2-generic" :index 13 :parts 4 :command-list '()) ) @@ -229,19 +229,19 @@ (when arg0 (set-setting! 'music-volume-movie 'abs 0.0 0) (apply-settings *setting-control*) - (close-status! (-> obj tasks) (task-status need-reward-speech)) - (set! (-> obj assistant) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *assistant-sg* #f :to obj)) + (close-status! (-> this tasks) (task-status need-reward-speech)) + (set! (-> this assistant) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *assistant-sg* #f :to this)) ) - (send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj assistant)) 'blend-shape #t) - (send-event (handle->process (-> obj assistant)) 'center-joint 3) - (let ((v1-68 (handle->process (-> obj assistant)))) + (send-event (handle->process (-> this assistant)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this assistant)) 'blend-shape #t) + (send-event (handle->process (-> this assistant)) 'center-joint 3) + (let ((v1-68 (handle->process (-> this assistant)))) (if v1-68 (set! (-> (the-as assistant v1-68) draw light-index) (the-as uint 1)) ) ) - (set! (-> obj draw bounds w) 40960.0) + (set! (-> this draw bounds w) 40960.0) ) (new 'static 'spool-anim :name "sage-intro-sequence-d2" @@ -324,28 +324,30 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) -(defmethod process-taskable-method-45 sage ((obj sage)) +(defmethod process-taskable-method-45 sage ((this sage)) (cond - ((and (closed? (-> obj tasks) (game-task beach-ecorocks) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 0) + ((and (closed? (-> this tasks) (game-task beach-ecorocks) (task-status need-reminder)) + (= (get-reminder (-> this tasks) 0) 0) ) #t ) - ((and (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 1) + ((and (closed? (-> this tasks) (game-task misty-cannon) (task-status need-reminder)) + (= (get-reminder (-> this tasks) 0) 1) ) #t ) - ((and (-> obj reminder-played) (< 81920.0 (vector-vector-distance (-> obj root-override trans) (camera-pos)))) + ((and (-> this reminder-played) + (< 81920.0 (vector-vector-distance (-> this root-override trans) (camera-pos))) + ) #t ) (else @@ -354,70 +356,71 @@ ) ) -(defmethod get-art-elem sage ((obj sage)) +(defmethod get-art-elem sage ((this sage)) (cond - ((and (= (current-task (-> obj tasks)) (game-task beach-ecorocks)) - (or (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) + ((and (= (current-task (-> this tasks)) (game-task beach-ecorocks)) + (or (= (current-status (-> this tasks)) (task-status need-hint)) + (= (current-status (-> this tasks)) (task-status need-introduction)) ) ) - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) - ((and (= (current-task (-> obj tasks)) (game-task misty-cannon)) - (or (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) + ((and (= (current-task (-> this tasks)) (game-task misty-cannon)) + (or (= (current-status (-> this tasks)) (task-status need-hint)) + (= (current-status (-> this tasks)) (task-status need-introduction)) ) ) - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) - ((process-taskable-method-45 obj) - (set! (-> obj reminder-played) #f) + ((process-taskable-method-45 this) + (set! (-> this reminder-played) #f) (cond - ((= (current-task (-> obj tasks)) (game-task none)) - (case (get-reminder (-> obj tasks) 0) + ((= (current-task (-> this tasks)) (game-task none)) + (case (get-reminder (-> this tasks) 0) ((2) - (save-reminder (-> obj tasks) 3 0) + (save-reminder (-> this tasks) 3 0) ) (else - (save-reminder (-> obj tasks) 2 0) + (save-reminder (-> this tasks) 2 0) ) ) ) - ((closed? (-> obj tasks) (game-task beach-ecorocks) (task-status need-reminder)) - (save-reminder (-> obj tasks) 1 0) + ((closed? (-> this tasks) (game-task beach-ecorocks) (task-status need-reminder)) + (save-reminder (-> this tasks) 1 0) ) - ((or (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-reminder)) - (not (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-introduction))) + ((or (closed? (-> this tasks) (game-task misty-cannon) (task-status need-reminder)) + (not (closed? (-> this tasks) (game-task misty-cannon) (task-status need-introduction))) ) - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) - ((zero? (get-reminder (-> obj tasks) 0)) - (save-reminder (-> obj tasks) 1 0) + ((zero? (get-reminder (-> this tasks) 0)) + (save-reminder (-> this tasks) 1 0) ) (else - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) ) ) ) - (case (get-reminder (-> obj tasks) 0) + (case (get-reminder (-> this tasks) 0) ((3) - (-> obj draw art-group data 7) + (-> this draw art-group data 7) ) ((2) - (-> obj draw art-group data 6) + (-> this draw art-group data 6) ) ((1) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) (else - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) -(defmethod process-taskable-method-43 sage ((obj sage)) - (let ((s5-0 (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj))) +(defmethod process-taskable-method-43 sage ((this sage)) + (let ((s5-0 (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this)) + ) (when s5-0 (let ((f0-2 (rand-float-gen))) (cond @@ -425,19 +428,19 @@ #f ) ((< 0.8 f0-2) - (play-ambient (-> obj ambient) "SAGELP03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP03" #f (-> this root-override trans)) ) ((< 0.6 f0-2) - (play-ambient (-> obj ambient) "SAGELP04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP04" #f (-> this root-override trans)) ) ((< 0.4 f0-2) - (play-ambient (-> obj ambient) "SAGELP05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP05" #f (-> this root-override trans)) ) ((< 0.2 f0-2) - (play-ambient (-> obj ambient) "SAGELP06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP06" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "SAGELP11" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP11" #f (-> this root-override trans)) ) ) ) @@ -502,6 +505,7 @@ ) ) ((-> (method-of-type process-taskable play-anim) exit)) + ;; og:preserve-this (#when PC_PORT ;; extra stuff when skipping cutscene (when (and (= (get-response (-> self query)) 'no) (or (not (= *cheat-mode* 'debug)) (not (cpad-hold? 0 r1))) @@ -532,12 +536,12 @@ ) ) -(defmethod should-display? sage ((obj sage)) +(defmethod should-display? sage ((this sage)) (not (sages-kidnapped?)) ) -(defmethod initialize-collision sage ((obj sage) (arg0 int) (arg1 vector)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision sage ((this sage) (arg0 int) (arg1 vector)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -567,19 +571,19 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod init-from-entity! sage ((obj sage) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task misty-cannon))) - (set! (-> obj reminder-played) #f) - (set! (-> obj sound-flava) (music-flava sage)) - (set! (-> obj assistant) (the-as handle #f)) - (set! (-> obj draw light-index) (the-as uint 1)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! sage ((this sage) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task misty-cannon))) + (set! (-> this reminder-played) #f) + (set! (-> this sound-flava) (music-flava sage)) + (set! (-> this assistant) (the-as handle #f)) + (set! (-> this draw light-index) (the-as uint 1)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village1/sequence-a-village1.gc b/goal_src/jak1/levels/village1/sequence-a-village1.gc index 5911db89c1..6ae7a74fd4 100644 --- a/goal_src/jak1/levels/village1/sequence-a-village1.gc +++ b/goal_src/jak1/levels/village1/sequence-a-village1.gc @@ -206,7 +206,7 @@ ) -(defmethod play-anim! sequenceA-village1 ((obj sequenceA-village1) (arg0 symbol)) +(defmethod play-anim! sequenceA-village1 ((this sequenceA-village1) (arg0 symbol)) (when arg0 (set! (-> *time-of-day-proc* 0 time-ratio) 0.0) (set! (-> *time-of-day-proc* 0 hour) 23) @@ -215,11 +215,13 @@ (send-event *camera* 'force-blend 0) (send-event *camera* 'change-state cam-fixed 0) (send-event *target* 'sidekick #f) - (set! (-> obj boat) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *fishermans-boat-sg* #f :to obj)) + (set! (-> this boat) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *fishermans-boat-sg* #f :to this) + ) ) - (send-event (handle->process (-> obj boat)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj boat)) 'origin-joint-index 3) + (send-event (handle->process (-> this boat)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this boat)) 'origin-joint-index 3) ) ;; og:preserve-this PAL patch here (the-as basic (new 'static 'spool-anim @@ -252,8 +254,8 @@ ) ) -(defmethod get-art-elem sequenceA-village1 ((obj sequenceA-village1)) - (-> obj draw art-group data 3) +(defmethod get-art-elem sequenceA-village1 ((this sequenceA-village1)) + (-> this draw art-group data 3) ) (defstate play-anim (sequenceA-village1) @@ -299,7 +301,7 @@ ) ((-> (method-of-type process-taskable play-anim) exit)) (#when PC_PORT - ;; extra stuff when skipping cutscene + ;; og:preserve-this extra stuff when skipping cutscene (when (and (= (get-response (-> self query)) 'no) (or (not (= *cheat-mode* 'debug)) (not (cpad-hold? 0 r1)))) (close-specific-task! (game-task intro) (task-status need-resolution)) (start 'play (get-continue-by-name *game-info* "game-start")) @@ -325,6 +327,7 @@ ) ) :trans (behavior () + ;; og:preserve-this ;; yeah they messed up a little bit here (spool-push *art-control* "sage-intro-sequence-b" 0 self -1.0) ;; they should have put this: @@ -334,7 +337,7 @@ ) ) -(defmethod should-display? sequenceA-village1 ((obj sequenceA-village1)) +(defmethod should-display? sequenceA-village1 ((this sequenceA-village1)) #f ) diff --git a/goal_src/jak1/levels/village1/village-obs.gc b/goal_src/jak1/levels/village1/village-obs.gc index e701bb41d6..05be0d3d1b 100644 --- a/goal_src/jak1/levels/village1/village-obs.gc +++ b/goal_src/jak1/levels/village1/village-obs.gc @@ -197,18 +197,18 @@ ) -(defmethod relocate windmill-sail ((obj windmill-sail) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate windmill-sail ((this windmill-sail) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as windmill-sail ((method-of-type process-drawable relocate) obj arg0)) + (the-as windmill-sail ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate windmill-sail ((obj windmill-sail)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate windmill-sail ((this windmill-sail)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -292,19 +292,19 @@ :post ja-post ) -(defmethod init-from-entity! windmill-sail ((obj windmill-sail) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (load-params! (-> obj sync) obj (the-as uint 4800) 0.0 0.15 0.15) - (set! (-> obj root-override) (new 'process 'trsq)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *windmill-sail-sg* '()) - (quaternion-copy! (-> obj orig-quat) (-> obj root-override quat)) - (vector-x-quaternion! (-> obj blade-normal) (-> obj root-override quat)) - (vector-normalize! (-> obj blade-normal) 1.0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 123) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 124) obj)) - (set! (-> obj sound) (new 'process 'ambient-sound arg0 (-> obj root-override trans))) +(defmethod init-from-entity! windmill-sail ((this windmill-sail) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (load-params! (-> this sync) this (the-as uint 4800) 0.0 0.15 0.15) + (set! (-> this root-override) (new 'process 'trsq)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *windmill-sail-sg* '()) + (quaternion-copy! (-> this orig-quat) (-> this root-override quat)) + (vector-x-quaternion! (-> this blade-normal) (-> this root-override quat)) + (vector-normalize! (-> this blade-normal) 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 123) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 124) this)) + (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root-override trans))) (go windmill-sail-idle) (none) ) @@ -349,16 +349,16 @@ :post ja-post ) -(defmethod init-from-entity! sagesail ((obj sagesail) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) - (set! (-> obj root-override) (new 'process 'trsq)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *sagesail-sg* '()) - (quaternion-copy! (-> obj orig-quat) (-> obj root-override quat)) - (vector-z-quaternion! (-> obj blade-normal) (-> obj root-override quat)) - (vector-normalize! (-> obj blade-normal) 1.0) +(defmethod init-from-entity! sagesail ((this sagesail) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) + (set! (-> this root-override) (new 'process 'trsq)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *sagesail-sg* '()) + (quaternion-copy! (-> this orig-quat) (-> this root-override quat)) + (vector-z-quaternion! (-> this blade-normal) (-> this root-override quat)) + (vector-normalize! (-> this blade-normal) 1.0) (go sagesail-idle) (none) ) @@ -379,16 +379,16 @@ ) -(defmethod run-logic? windspinner ((obj windspinner)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-status was-drawn)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) +(defmethod run-logic? windspinner ((this windspinner)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-status was-drawn)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) @@ -438,17 +438,17 @@ :post ja-post ) -(defmethod init-from-entity! windspinner ((obj windspinner) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj angle) 0.0) - (set! (-> obj angle-vel) 145.63556) - (set! (-> obj root) (the-as trsqv (new 'process 'trsq))) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *windspinner-sg* '()) - (set! (-> obj root pause-adjust-distance) 819200.0) - (quaternion-copy! (-> obj orig-quat) (-> obj root quat)) - (vector-y-quaternion! (-> obj blade-normal) (-> obj root quat)) - (vector-normalize! (-> obj blade-normal) 1.0) +(defmethod init-from-entity! windspinner ((this windspinner) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this angle) 0.0) + (set! (-> this angle-vel) 145.63556) + (set! (-> this root) (the-as trsqv (new 'process 'trsq))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *windspinner-sg* '()) + (set! (-> this root pause-adjust-distance) 819200.0) + (quaternion-copy! (-> this orig-quat) (-> this root quat)) + (vector-y-quaternion! (-> this blade-normal) (-> this root quat)) + (vector-normalize! (-> this blade-normal) 1.0) (go windspinner-idle) (none) ) @@ -484,12 +484,12 @@ :post ja-post ) -(defmethod init-from-entity! mayorgears ((obj mayorgears) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *mayorgears-sg* '()) - (set! (-> obj draw shadow-mask) (the-as uint 255)) +(defmethod init-from-entity! mayorgears ((this mayorgears) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *mayorgears-sg* '()) + (set! (-> this draw shadow-mask) (the-as uint 255)) (go mayorgears-idle) (none) ) @@ -570,21 +570,21 @@ :post ja-post ) -(defmethod init-from-entity! reflector-middle ((obj reflector-middle) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *reflector-middle-sg* '()) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj reflector-trans quad) (-> obj root trans quad)) - (+! (-> obj reflector-trans y) (res-lump-float arg0 'height-info)) - (let ((a0-10 (-> obj link next))) +(defmethod init-from-entity! reflector-middle ((this reflector-middle) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *reflector-middle-sg* '()) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this reflector-trans quad) (-> this root trans quad)) + (+! (-> this reflector-trans y) (res-lump-float arg0 'height-info)) + (let ((a0-10 (-> this link next))) (when a0-10 - (set! (-> obj next-reflector-trans quad) (-> a0-10 extra trans quad)) - (+! (-> obj next-reflector-trans y) (res-lump-float a0-10 'height-info)) + (set! (-> this next-reflector-trans quad) (-> a0-10 extra trans quad)) + (+! (-> this next-reflector-trans y) (res-lump-float a0-10 'height-info)) ) ) - (logior! (-> obj draw status) (draw-status do-not-check-distance)) + (logior! (-> this draw status) (draw-status do-not-check-distance)) (go reflector-middle-idle) (none) ) @@ -605,9 +605,9 @@ :code anim-loop ) -(defmethod init-from-entity! reflector-end ((obj reflector-end) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! reflector-end ((this reflector-end) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (go reflector-end-idle) (none) ) @@ -646,7 +646,7 @@ (defstate starfish-idle (starfish) :enter (behavior () (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-channel-set! 0) ) :exit (behavior () @@ -667,11 +667,11 @@ (defstate starfish-patrol (starfish) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav flags) (nav-control-flags navcf19)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (if (or (not *target*) (< 204800.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) ) @@ -746,9 +746,9 @@ ) ) -(defmethod initialize-collision starfish ((obj starfish)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision starfish ((this starfish)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -761,15 +761,15 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) ) -(defmethod nav-enemy-method-48 starfish ((obj starfish)) - (initialize-skeleton obj *starfish-sg* '()) - (init-defaults! obj *starfish-nav-enemy-info*) +(defmethod nav-enemy-method-48 starfish ((this starfish)) + (initialize-skeleton this *starfish-sg* '()) + (init-defaults! this *starfish-nav-enemy-info*) 0 (none) ) @@ -809,10 +809,10 @@ (defstate villa-starfish-idle (villa-starfish) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) + (set-time! (-> self state-time)) (if (and (and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (< (process-drawable-child-count) (-> self child-count)) ) @@ -825,13 +825,13 @@ :post #f ) -(defmethod init-from-entity! villa-starfish ((obj villa-starfish) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! villa-starfish ((this villa-starfish) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (let ((a1-4 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 3)))) - (set! (-> obj child-count) (max 1 (min 8 (the-as int a1-4)))) + (set! (-> this child-count) (max 1 (min 8 (the-as int a1-4)))) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (go villa-starfish-idle) (none) ) @@ -851,7 +851,7 @@ (defstate village-fish-idle (village-fish) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (suspend) ) @@ -859,9 +859,9 @@ :post #f ) -(defmethod init-from-entity! village-fish ((obj village-fish) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! village-fish ((this village-fish) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (go village-fish-idle) (none) ) @@ -920,13 +920,13 @@ ) -(defmethod relocate hutlamp ((obj hutlamp) (arg0 int)) - (if (nonzero? (-> obj pivot)) - (&+! (-> obj pivot) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method hutlamp 7)) this arg0) ) ) @@ -948,13 +948,13 @@ :post ja-post ) -(defmethod init-from-entity! hutlamp ((obj hutlamp) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *hutlamp-sg* '()) - (set! (-> obj pivot) (new 'process 'joint-mod-set-local obj 3 #f #t #f)) - (set-period (-> obj clock) 900) - (set! (-> obj clock output) (rand-vu)) +(defmethod init-from-entity! hutlamp ((this hutlamp) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *hutlamp-sg* '()) + (set! (-> this pivot) (new 'process 'joint-mod-set-local this 3 #f #t #f)) + (set-period (-> this clock) 900) + (set! (-> this clock output) (rand-vu)) (go hutlamp-idle) (none) ) @@ -982,12 +982,12 @@ :post ja-post ) -(defmethod init-from-entity! revcycleprop ((obj revcycleprop) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *revcycleprop-sg* '()) - (set! (-> obj draw light-index) (the-as uint 1)) - (go (method-of-object obj idle)) +(defmethod init-from-entity! revcycleprop ((this revcycleprop) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *revcycleprop-sg* '()) + (set! (-> this draw light-index) (the-as uint 1)) + (go (method-of-object this idle)) (none) ) @@ -1014,12 +1014,12 @@ :post ja-post ) -(defmethod init-from-entity! revcycle ((obj revcycle) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *revcycle-sg* '()) - (set! (-> obj draw light-index) (the-as uint 1)) - (go (method-of-object obj idle)) +(defmethod init-from-entity! revcycle ((this revcycle) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *revcycle-sg* '()) + (set! (-> this draw light-index) (the-as uint 1)) + (go (method-of-object this idle)) (none) ) @@ -1045,13 +1045,13 @@ ) ) -(defmethod water-vol-method-22 villagea-water ((obj villagea-water)) +(defmethod water-vol-method-22 villagea-water ((this villagea-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) diff --git a/goal_src/jak1/levels/village1/village1-part.gc b/goal_src/jak1/levels/village1/village1-part.gc index 7d921e4d58..9f4ec271ae 100644 --- a/goal_src/jak1/levels/village1/village1-part.gc +++ b/goal_src/jak1/levels/village1/village1-part.gc @@ -776,7 +776,7 @@ (defun bird-bob-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (set! (-> arg2 y) (+ (-> (the-as process-drawable (-> arg1 key proc)) root trans y) - (* -2048.0 (sin (* 218.45334 (the float (mod (-> *display* base-frame-counter) 300))))) + (* -2048.0 (sin (* 218.45334 (the float (mod (current-time) 300))))) ) ) 0 diff --git a/goal_src/jak1/levels/village1/yakow.gc b/goal_src/jak1/levels/village1/yakow.gc index d7c14c3262..f0a9042aa7 100644 --- a/goal_src/jak1/levels/village1/yakow.gc +++ b/goal_src/jak1/levels/village1/yakow.gc @@ -258,7 +258,7 @@ yakow-default-event-handler (-> self turn-time) ) (vector-z-quaternion! gp-0 (-> self root-override quat)) - (set! (-> self rotating) (< (vector-dot gp-0 s5-0) (cos (* 8192.0 (-> *display* seconds-per-frame))))) + (set! (-> self rotating) (< (vector-dot gp-0 s5-0) (cos (* 8192.0 (seconds-per-frame))))) (when (-> self rotating) (let ((v1-16 (new 'stack-no-clear 'vector))) (vector-cross! v1-16 gp-0 s5-0) @@ -267,11 +267,7 @@ yakow-default-event-handler ) ) ) - (seek! - (-> self walk-turn-blend) - f30-0 - (* (-> *YAKOW-bank* walk-turn-blend-rate) (-> *display* seconds-per-frame)) - ) + (seek! (-> self walk-turn-blend) f30-0 (* (-> *YAKOW-bank* walk-turn-blend-rate) (seconds-per-frame))) ) (set! (-> self final-speed) (fmin (-> self travel-speed) (* (vector-length (-> self nav travel)) (-> *display* frames-per-second))) @@ -346,7 +342,7 @@ yakow-default-event-handler ) (defbehavior yakow-blend-walk-run yakow () - (let ((gp-0 (-> *display* base-frame-counter))) + (let ((gp-0 (current-time))) (loop (let ((f30-0 (-> self final-speed))) (cond @@ -355,13 +351,13 @@ yakow-default-event-handler (ja-channel-push! 1 (seconds 0.15)) ) (ja :group! yakow-idle-ja :num! min) - (while (or (< (- (-> *display* base-frame-counter) gp-0) (seconds 0.2)) (< (-> self final-speed) 409.6)) + (while (or (not (time-elapsed? gp-0 (seconds 0.2))) (< (-> self final-speed) 409.6)) (suspend) (ja :num! (loop!)) ) ) (else - (set! gp-0 (-> *display* base-frame-counter)) + (set! gp-0 (current-time)) ) ) (when (not (ja-group? yakow-walk-ja)) @@ -383,16 +379,8 @@ yakow-default-event-handler ) ) (if (-> self run-mode) - (seek! - (-> self walk-run-blend) - 1.0 - (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame)) - ) - (seek! - (-> self walk-run-blend) - 0.0 - (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame)) - ) + (seek! (-> self walk-run-blend) 1.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (seconds-per-frame))) + (seek! (-> self walk-run-blend) 0.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (seconds-per-frame))) ) (ja :chan 1 :frame-interp (fabs (-> self walk-turn-blend))) (ja :chan 2 :frame-interp (-> self walk-run-blend)) @@ -449,11 +437,11 @@ yakow-default-event-handler (defstate yakow-idle (yakow) :event yakow-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self travel-speed) 0.0) ) :trans (behavior () - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) + (if (and (time-elapsed? (-> self state-time) (-> *YAKOW-bank* default-patrol-time)) (and *target* (>= (-> self fact-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -498,7 +486,7 @@ yakow-default-event-handler (defstate yakow-notice (yakow) :event yakow-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self travel-speed) 0.0) ) :code (behavior () @@ -510,14 +498,14 @@ yakow-default-event-handler (defstate yakow-walk-to (yakow) :event yakow-default-event-handler :enter (behavior ((arg0 vector)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self nav destination-pos quad) (-> arg0 quad)) (set! (-> self rotate-speed) (-> *YAKOW-bank* walk-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* walk-turn-time)) ) :trans (behavior () - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) + (if (and (time-elapsed? (-> self state-time) (-> *YAKOW-bank* default-patrol-time)) (not (-> self in-pen)) (and *target* (>= (-> self fact-override idle-distance) @@ -528,7 +516,7 @@ yakow-default-event-handler ) (go yakow-notice) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (when (time-elapsed? (-> self state-time) (seconds 0.05)) (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< (vector-vector-xz-distance (-> self root-override trans) (-> self nav destination-pos)) 4096.0) ) @@ -541,7 +529,7 @@ yakow-default-event-handler (seek! (-> self travel-speed) (-> *YAKOW-bank* walk-speed) - (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) + (* (-> *YAKOW-bank* acceleration) (seconds-per-frame)) ) ) :code (the-as (function vector object) yakow-blend-walk-run) @@ -563,7 +551,7 @@ yakow-default-event-handler (defstate yakow-graze (yakow) :event yakow-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self travel-speed) 0.0) (set! (-> self grazing) #t) (let ((v1-3 (entity-actor-lookup (-> self entity) 'alt-actor 0))) @@ -621,7 +609,7 @@ yakow-default-event-handler (defstate yakow-run-away (yakow) :event yakow-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self rotate-speed) (-> *YAKOW-bank* run-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* run-turn-time)) @@ -656,7 +644,7 @@ yakow-default-event-handler (set! f30-2 0.0) ) (set! (-> self enable-turn-around) (< (-> *YAKOW-bank* run-speed) f30-2)) - (seek! (-> self travel-speed) f30-2 (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame))) + (seek! (-> self travel-speed) f30-2 (* (-> *YAKOW-bank* acceleration) (seconds-per-frame))) ) ) :code yakow-blend-walk-run @@ -666,7 +654,7 @@ yakow-default-event-handler (defstate yakow-kicked (yakow) :event #f :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (-> self grazing) (go yakow-graze-kicked) ) @@ -681,11 +669,11 @@ yakow-default-event-handler '() ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) (seek! (-> self travel-speed) (-> *YAKOW-bank* run-speed) - (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) + (* (-> *YAKOW-bank* acceleration) (seconds-per-frame)) ) ) 0 @@ -744,9 +732,9 @@ yakow-default-event-handler ) ) -(defmethod init-from-entity! yakow ((obj yakow) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! yakow ((this yakow) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -762,44 +750,44 @@ yakow-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj align) (new 'process 'align-control obj)) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj nav nearest-y-threshold) 409600.0) - (set! (-> obj fact-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this nav nearest-y-threshold) 409600.0) + (set! (-> this fact-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj fact-override idle-distance) (-> *YAKOW-bank* default-idle-distance)) - (initialize-skeleton obj *yakow-sg* '()) - (set! (-> obj draw shadow-ctrl) + (set! (-> this fact-override idle-distance) (-> *YAKOW-bank* default-idle-distance)) + (initialize-skeleton this *yakow-sg* '()) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -4096.0 4096.0 614400.0 (the-as float 24) 245760.0) ) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj water) (new 'process 'water-control obj 6 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01)) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 12288.0) - (set! (-> obj home-base quad) (-> obj root-override trans quad)) - (let ((v1-40 (res-lump-struct (-> obj entity) 'alt-vector vector))) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this water) (new 'process 'water-control this 6 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 12288.0) + (set! (-> this home-base quad) (-> this root-override trans quad)) + (let ((v1-40 (res-lump-struct (-> this entity) 'alt-vector vector))) (when v1-40 - (set! (-> obj dest-base quad) (-> v1-40 quad)) - (set! (-> obj dest-rot) (-> v1-40 w)) - (set! (-> obj dest-base w) 1.0) + (set! (-> this dest-base quad) (-> v1-40 quad)) + (set! (-> this dest-rot) (-> v1-40 w)) + (set! (-> this dest-base w) 1.0) ) ) - (set! (-> obj vulnerable) #t) - (set! (-> obj grazing) #f) - (set! (-> obj enable-turn-around) #f) - (set! (-> obj in-pen) - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this vulnerable) #t) + (set! (-> this grazing) #f) + (set! (-> this enable-turn-around) #f) + (set! (-> this in-pen) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) ) (cond - ((-> obj in-pen) - (set! (-> obj root-override trans quad) (-> obj dest-base quad)) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (-> obj dest-rot)) + ((-> this in-pen) + (set! (-> this root-override trans quad) (-> this dest-base quad)) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) (-> this dest-rot)) (go yakow-graze) ) (else diff --git a/goal_src/jak1/levels/village2/assistant-village2.gc b/goal_src/jak1/levels/village2/assistant-village2.gc index 7612a74531..00a7ae79a8 100644 --- a/goal_src/jak1/levels/village2/assistant-village2.gc +++ b/goal_src/jak1/levels/village2/assistant-village2.gc @@ -21,24 +21,24 @@ ) -(defmethod relocate assistant-levitator ((obj assistant-levitator) (arg0 int)) +(defmethod relocate assistant-levitator ((this assistant-levitator) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj particle v1-0)) - (&+! (-> obj particle v1-0) arg0) + (if (nonzero? (-> this particle v1-0)) + (&+! (-> this particle v1-0) arg0) ) ) - (the-as assistant-levitator ((method-of-type process-taskable relocate) obj arg0)) + (the-as assistant-levitator ((method-of-type process-taskable relocate) this arg0)) ) -(defmethod deactivate assistant-levitator ((obj assistant-levitator)) +(defmethod deactivate assistant-levitator ((this assistant-levitator)) (dotimes (s5-0 4) - (let ((a0-1 (-> obj particle s5-0))) + (let ((a0-1 (-> this particle s5-0))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) - ((method-of-type process-taskable deactivate) obj) + ((method-of-type process-taskable deactivate) this) (none) ) @@ -56,10 +56,10 @@ :bounds (static-spherem 0 0 0 0.25) ) -(defmethod process-taskable-method-52 assistant-levitator ((obj assistant-levitator)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 assistant-levitator ((this assistant-levitator)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -409.6 f0-0))) ) @@ -75,21 +75,21 @@ (none) ) -(defmethod draw-npc-shadow assistant-levitator ((obj assistant-levitator)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow assistant-levitator ((this assistant-levitator)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -98,19 +98,19 @@ (none) ) -(defmethod play-anim! assistant-bluehut ((obj assistant-bluehut) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk-to-assistant)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! assistant-bluehut ((this assistant-bluehut) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk-to-assistant)) + (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint) (task-status need-introduction)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task village2-levitator)) (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> obj sage extra process) 'clone (process->handle obj)) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) + (close-status! (-> this tasks) (task-status need-introduction)) + (send-event (-> this sage extra process) 'clone (process->handle this)) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "assistant-village2-introduction" @@ -273,23 +273,23 @@ ) (((game-task sunken-room)) (when arg0 - (let* ((s5-2 (-> obj tasks)) + (let* ((s5-2 (-> this tasks)) (s4-0 (method-of-object s5-2 save-reminder)) ) (s4-0 s5-2 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) - (set! (-> obj jaws) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *jaws-sg* #f :to obj)) + (close-status! (-> this tasks) (task-status need-introduction)) + (set! (-> this jaws) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *jaws-sg* #f :to this)) ) - (let ((v1-42 (handle->process (-> obj jaws)))) + (let ((v1-42 (handle->process (-> this jaws)))) (if v1-42 (set! (-> (the-as manipy v1-42) draw light-index) (the-as uint 1)) ) ) - (send-event (handle->process (-> obj jaws)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj jaws)) 'center-joint 3) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) + (send-event (handle->process (-> this jaws)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this jaws)) 'center-joint 3) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "assistant-village2-introduction-room" @@ -308,12 +308,12 @@ ) (((game-task rolling-robbers)) (when arg0 - (let* ((s5-5 (-> obj tasks)) + (let* ((s5-5 (-> this tasks)) (s4-1 (method-of-object s5-5 save-reminder)) ) (s4-1 s5-5 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "assistant-village2-introduction-robbers" @@ -324,8 +324,8 @@ ) (else (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) + (close-status! (-> this tasks) (task-status need-introduction)) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "assistant-village2-introduction-flutflut" @@ -337,8 +337,8 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) + (set! (-> this skippable) #t) + (let ((s4-2 (+ (get-reminder (-> this tasks) 0) 1))) (if (< (the-as uint 2) (the-as uint s4-2)) (set! s4-2 0) ) @@ -364,7 +364,7 @@ ) ) (if arg0 - (save-reminder (-> obj tasks) s4-2 2) + (save-reminder (-> this tasks) s4-2 2) ) (cond ((zero? s4-2) @@ -384,22 +384,22 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ) ) -(defmethod get-art-elem assistant-bluehut ((obj assistant-bluehut)) - (-> obj draw art-group data 10) +(defmethod get-art-elem assistant-bluehut ((this assistant-bluehut)) + (-> this draw art-group data 10) ) -(defmethod play-reminder assistant-bluehut ((obj assistant-bluehut)) +(defmethod play-reminder assistant-bluehut ((this assistant-bluehut)) (cond - ((and (-> obj will-talk) *target*) + ((and (-> this will-talk) *target*) (let* ((f30-1 (+ -1552384.0 (-> (target-pos 0) x))) (f0-3 (+ 6352896.0 (-> (target-pos 0) z) f30-1)) ) @@ -412,29 +412,29 @@ ) ) -(defmethod target-above-threshold? assistant-bluehut ((obj assistant-bluehut)) - (when (not (play-reminder obj)) - (set! (-> obj im-talking) #f) +(defmethod target-above-threshold? assistant-bluehut ((this assistant-bluehut)) + (when (not (play-reminder this)) + (set! (-> this im-talking) #f) (return #f) ) - (let ((s5-0 (-> obj sage extra process))) + (let ((s5-0 (-> this sage extra process))) (when (not s5-0) (let ((v1-7 #t)) - (set! (-> obj im-talking) v1-7) + (set! (-> this im-talking) v1-7) (return v1-7) ) ) (when (!= (-> (the-as sage-bluehut s5-0) next-state name) 'idle) - (set! (-> obj im-talking) #f) + (set! (-> this im-talking) #f) (return #f) ) (when (not (play-reminder (the-as sage-bluehut s5-0))) (let ((v1-15 #t)) - (set! (-> obj im-talking) v1-15) + (set! (-> this im-talking) v1-15) (return v1-15) ) ) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj center-joint-index)))) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this center-joint-index)))) (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as sage-bluehut s5-0) node-list data (-> (the-as sage-bluehut s5-0) center-joint-index)) @@ -444,17 +444,17 @@ ) (cond ((< f0-1 -4096.0) - (set! (-> obj im-talking) #f) + (set! (-> this im-talking) #f) (return #f) ) ((< 4096.0 f0-1) (let ((v1-24 #t)) - (set! (-> obj im-talking) v1-24) + (set! (-> this im-talking) v1-24) (return v1-24) ) ) (else - (return (-> obj im-talking)) + (return (-> this im-talking)) ) ) ) @@ -462,18 +462,18 @@ (the-as symbol 0) ) -(defmethod process-taskable-method-43 assistant-bluehut ((obj assistant-bluehut)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 assistant-bluehut ((this assistant-bluehut)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f30-0 (rand-float-gen))) (cond ((= (get-task-status (game-task village2-levitator)) (task-status invalid)) #f ) ((< 0.5 f30-0) - (play-ambient (-> obj ambient) "ASSTLP23" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP23" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "ASSTLP24" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP24" #f (-> this root-override trans)) ) ) ) @@ -509,8 +509,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (while (let ((s5-1 (-> *display* base-frame-counter)) + (let ((gp-1 (current-time))) + (while (let ((s5-1 (current-time)) (f30-0 300.0) (f28-0 0.16) (f26-0 0.17000002) @@ -590,10 +590,10 @@ ) ) -(defmethod should-display? assistant-bluehut ((obj assistant-bluehut)) +(defmethod should-display? assistant-bluehut ((this assistant-bluehut)) (cond - ((not (closed? (-> obj tasks) (game-task village2-levitator) (task-status unknown))) - (process-taskable-method-33 obj) + ((not (closed? (-> this tasks) (game-task village2-levitator) (task-status unknown))) + (process-taskable-method-33 this) #f ) ((or (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) (sages-kidnapped?)) @@ -686,16 +686,16 @@ (none) ) -(defmethod init-from-entity! assistant-bluehut ((obj assistant-bluehut) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 288) obj)) - (set! (-> obj tasks) (get-task-control (game-task village2-levitator))) - (set! (-> obj jaws) (the-as handle #f)) - (set! (-> obj sage) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj im-talking) #t) - (set! (-> obj draw light-index) (the-as uint 1)) - (set! (-> obj sound-id) (new-sound-id)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! assistant-bluehut ((this assistant-bluehut) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 288) this)) + (set! (-> this tasks) (get-task-control (game-task village2-levitator))) + (set! (-> this jaws) (the-as handle #f)) + (set! (-> this sage) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this im-talking) #t) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this sound-id) (new-sound-id)) + (process-taskable-method-42 this) (none) ) @@ -1211,19 +1211,19 @@ (none) ) -(defmethod play-anim! assistant-levitator ((obj assistant-levitator) (arg0 symbol)) +(defmethod play-anim! assistant-levitator ((this assistant-levitator) (arg0 symbol)) (with-pp - (case (current-status (-> obj tasks)) + (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (when arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) pp) (set! (-> a1-1 num-params) 1) (set! (-> a1-1 message) 'clone) - (set! (-> a1-1 param 0) (the-as uint (process->handle obj))) + (set! (-> a1-1 param 0) (the-as uint (process->handle this))) (let ((t9-2 send-event-function) - (v1-10 (-> obj boulder)) + (v1-10 (-> this boulder)) ) (t9-2 (if v1-10 @@ -1254,20 +1254,20 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ) ) ) -(defmethod get-art-elem assistant-levitator ((obj assistant-levitator)) +(defmethod get-art-elem assistant-levitator ((this assistant-levitator)) (if (= (get-task-status (game-task village2-levitator)) (task-status invalid)) - (-> obj draw art-group data 9) - (-> obj draw art-group data 5) + (-> this draw art-group data 9) + (-> this draw art-group data 5) ) ) @@ -1309,7 +1309,7 @@ #t ) (else - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) ) @@ -1318,7 +1318,7 @@ (not (movie?)) (not (level-hint-displayed?)) (not (and *cheat-mode* (cpad-hold? 0 l3))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) + (not (time-elapsed? (-> self state-time) (seconds 10))) ) ) (hide-hud) @@ -1356,7 +1356,7 @@ ) ) -(defmethod target-above-threshold? assistant-levitator ((obj assistant-levitator)) +(defmethod target-above-threshold? assistant-levitator ((this assistant-levitator)) (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) ) @@ -1428,7 +1428,7 @@ ) ) -(defmethod should-display? assistant-levitator ((obj assistant-levitator)) +(defmethod should-display? assistant-levitator ((this assistant-levitator)) (or (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) (zero? (get-task-status (game-task village2-levitator))) ) @@ -1446,20 +1446,20 @@ ) ) -(defmethod init-from-entity! assistant-levitator ((obj assistant-levitator) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task village2-levitator))) - (set! (-> obj boulder) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj particle 0) (create-launch-control (-> *part-group-id-table* 658) obj)) - (set! (-> obj particle 1) (create-launch-control (-> *part-group-id-table* 659) obj)) - (set! (-> obj particle 2) (create-launch-control (-> *part-group-id-table* 660) obj)) - (set! (-> obj particle 3) (create-launch-control (-> *part-group-id-table* 661) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> obj root-override trans)) +(defmethod init-from-entity! assistant-levitator ((this assistant-levitator) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task village2-levitator))) + (set! (-> this boulder) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this particle 0) (create-launch-control (-> *part-group-id-table* 658) this)) + (set! (-> this particle 1) (create-launch-control (-> *part-group-id-table* 659) this)) + (set! (-> this particle 2) (create-launch-control (-> *part-group-id-table* 660) this)) + (set! (-> this particle 3) (create-launch-control (-> *part-group-id-table* 661) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> this root-override trans)) ) (if (= (get-task-status (game-task village2-levitator)) (task-status invalid)) (go just-particles) - (process-taskable-method-42 obj) + (process-taskable-method-42 this) ) (none) ) diff --git a/goal_src/jak1/levels/village2/flutflut-bluehut.gc b/goal_src/jak1/levels/village2/flutflut-bluehut.gc index 335c0cc352..b15f4d0dcb 100644 --- a/goal_src/jak1/levels/village2/flutflut-bluehut.gc +++ b/goal_src/jak1/levels/village2/flutflut-bluehut.gc @@ -21,25 +21,25 @@ :bounds (static-spherem 0 0 0 3.25) ) -(defmethod play-anim! flutflut-bluehut ((obj flutflut-bluehut) (arg0 symbol)) - (current-status (-> obj tasks)) +(defmethod play-anim! flutflut-bluehut ((this flutflut-bluehut) (arg0 symbol)) + (current-status (-> this tasks)) (if arg0 (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (the-as basic (get-art-elem obj)) + (the-as basic (get-art-elem this)) ) -(defmethod get-art-elem flutflut-bluehut ((obj flutflut-bluehut)) - (-> obj draw art-group data 2) +(defmethod get-art-elem flutflut-bluehut ((this flutflut-bluehut)) + (-> this draw art-group data 2) ) -(defmethod should-display? flutflut-bluehut ((obj flutflut-bluehut)) - (and (closed? (-> obj tasks) (game-task village2-levitator) (task-status need-introduction)) +(defmethod should-display? flutflut-bluehut ((this flutflut-bluehut)) + (and (closed? (-> this tasks) (game-task village2-levitator) (task-status need-introduction)) (task-closed? (game-task beach-flutflut) (task-status need-resolution)) ) ) @@ -66,8 +66,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-0 (-> *display* base-frame-counter))) - (while (< (+ (-> *display* base-frame-counter) (seconds -0.5)) s5-0) + (let ((s5-0 (current-time))) + (while (< (+ (current-time) (seconds -0.5)) s5-0) (suspend) ) ) @@ -76,8 +76,8 @@ (suspend) (ja :num! (seek! 0.0)) ) - (let ((s5-1 (-> *display* base-frame-counter))) - (while (< (+ (-> *display* base-frame-counter) (seconds -0.5)) s5-1) + (let ((s5-1 (current-time))) + (while (< (+ (current-time) (seconds -0.5)) s5-1) (suspend) ) ) @@ -110,10 +110,10 @@ ) ) -(defmethod init-from-entity! flutflut-bluehut ((obj flutflut-bluehut) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *flutflut-bluehut-sg* 3 0 (new 'static 'vector :w 4096.0) 27) - (set! (-> obj tasks) (get-task-control (game-task village2-levitator))) - (set! (-> obj draw light-index) (the-as uint 1)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! flutflut-bluehut ((this flutflut-bluehut) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *flutflut-bluehut-sg* 3 0 (new 'static 'vector :w 4096.0) 27) + (set! (-> this tasks) (get-task-control (game-task village2-levitator))) + (set! (-> this draw light-index) (the-as uint 1)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village2/gambler.gc b/goal_src/jak1/levels/village2/gambler.gc index bf7034dca1..c11f072430 100644 --- a/goal_src/jak1/levels/village2/gambler.gc +++ b/goal_src/jak1/levels/village2/gambler.gc @@ -22,12 +22,12 @@ :shadow gambler-shadow-mg ) -(defmethod play-anim! gambler ((obj gambler) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! gambler ((this gambler) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) (close-specific-task! (game-task village2-gambler-money) (task-status need-introduction)) ) (new 'static 'spool-anim @@ -55,23 +55,23 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((closed? (-> obj tasks) (game-task rolling-race) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task rolling-race) (task-status need-reward-speech)) (new 'static 'spool-anim :name "gambler-reminder-money" :index 13 :parts 2 :command-list '()) ) - ((closed? (-> obj tasks) (game-task village2-gambler-money) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task village2-gambler-money) (task-status need-reward-speech)) (new 'static 'spool-anim :name "gambler-reminder-race" :index 12 :parts 2 :command-list '()) ) - ((zero? (get-reminder (-> obj tasks) 5)) + ((zero? (get-reminder (-> this tasks) 5)) (if arg0 - (save-reminder (-> obj tasks) 1 5) + (save-reminder (-> this tasks) 1 5) ) (new 'static 'spool-anim :name "gambler-reminder-race" :index 12 :parts 2 :command-list '()) ) (else (if arg0 - (save-reminder (-> obj tasks) 0 5) + (save-reminder (-> this tasks) 0 5) ) (new 'static 'spool-anim :name "gambler-reminder-money" :index 13 :parts 2 :command-list '()) ) @@ -79,25 +79,25 @@ ) (((task-status need-reward-speech)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task rolling-race)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "gambler-resolution-race" :index 14 :parts 3 :command-list '()) ) (else (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) ) (else - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (new 'static 'spool-anim :name "gambler-resolution-money" :index 15 :parts 2 :command-list '()) @@ -109,63 +109,63 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 7) + (-> this draw art-group data 7) ) ) ) -(defmethod get-art-elem gambler ((obj gambler)) - (-> obj draw art-group data 7) +(defmethod get-art-elem gambler ((this gambler)) + (-> this draw art-group data 7) ) -(defmethod process-taskable-method-43 gambler ((obj gambler)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 61440.0 obj) +(defmethod process-taskable-method-43 gambler ((this gambler)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 61440.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.9230769 f0-2) - (play-ambient (-> obj ambient) "GAM-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM01" #f (-> this root-override trans)) ) ((< 0.84615386 f0-2) - (play-ambient (-> obj ambient) "GAM-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM02" #f (-> this root-override trans)) ) ((< 0.7692308 f0-2) - (play-ambient (-> obj ambient) "GAM-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM03" #f (-> this root-override trans)) ) ((< 0.6923077 f0-2) - (play-ambient (-> obj ambient) "GAM-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM04" #f (-> this root-override trans)) ) ((< 0.61538464 f0-2) - (play-ambient (-> obj ambient) "GAM-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM05" #f (-> this root-override trans)) ) ((< 0.53846157 f0-2) - (play-ambient (-> obj ambient) "GAM-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM06" #f (-> this root-override trans)) ) ((< 0.46153846 f0-2) - (play-ambient (-> obj ambient) "GAM-AM07" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM07" #f (-> this root-override trans)) ) ((< 0.3846154 f0-2) - (play-ambient (-> obj ambient) "GAM-AM08" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM08" #f (-> this root-override trans)) ) ((< 0.30769232 f0-2) - (play-ambient (-> obj ambient) "GAM-AM09" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM09" #f (-> this root-override trans)) ) ((< 0.23076923 f0-2) (if (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) - (play-ambient (-> obj ambient) "GAM-AM10" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM10" #f (-> this root-override trans)) ) ) ((< 0.15384616 f0-2) - (play-ambient (-> obj ambient) "GAM-AM11" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM11" #f (-> this root-override trans)) ) ((< 0.07692308 f0-2) - (play-ambient (-> obj ambient) "GAM-AM12" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM12" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "GAM-AM13" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM13" #f (-> this root-override trans)) ) ) ) @@ -212,11 +212,11 @@ ) ) -(defmethod init-from-entity! gambler ((obj gambler) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *gambler-sg* 3 32 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task rolling-race))) - (set! (-> obj sound-flava) (music-flava gambler)) - (set! (-> obj draw light-index) (the-as uint 4)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! gambler ((this gambler) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *gambler-sg* 3 32 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task rolling-race))) + (set! (-> this sound-flava) (music-flava gambler)) + (set! (-> this draw light-index) (the-as uint 4)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village2/geologist.gc b/goal_src/jak1/levels/village2/geologist.gc index ef809f39a5..a3c8044a7c 100644 --- a/goal_src/jak1/levels/village2/geologist.gc +++ b/goal_src/jak1/levels/village2/geologist.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS - (deftype geologist (process-taskable) () :heap-base #x110 @@ -23,12 +22,12 @@ :shadow geologist-shadow-mg ) -(defmethod play-anim! geologist ((obj geologist) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! geologist ((this geologist) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) (close-specific-task! (game-task village2-geologist-money) (task-status need-introduction)) ) (new 'static 'spool-anim @@ -48,23 +47,23 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((closed? (-> obj tasks) (game-task rolling-moles) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task rolling-moles) (task-status need-reward-speech)) (new 'static 'spool-anim :name "geologist-reminder-money" :index 8 :parts 2 :command-list '()) ) - ((closed? (-> obj tasks) (game-task village2-geologist-money) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task village2-geologist-money) (task-status need-reward-speech)) (new 'static 'spool-anim :name "geologist-reminder-moles" :index 7 :parts 3 :command-list '()) ) - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (if arg0 - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) (new 'static 'spool-anim :name "geologist-reminder-moles" :index 7 :parts 3 :command-list '()) ) (else (if arg0 - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) (new 'static 'spool-anim :name "geologist-reminder-money" :index 8 :parts 2 :command-list '()) ) @@ -72,25 +71,25 @@ ) (((task-status need-reward-speech)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task rolling-moles)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "geologist-resolution-moles" :index 9 :parts 3 :command-list '()) ) (else (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) ) (else - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (new 'static 'spool-anim :name "geologist-resolution-money" :index 10 :parts 2 :command-list '()) @@ -102,69 +101,69 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ) ) -(defmethod get-art-elem geologist ((obj geologist)) - (-> obj draw art-group data 5) +(defmethod get-art-elem geologist ((this geologist)) + (-> this draw art-group data 5) ) -(defmethod process-taskable-method-43 geologist ((obj geologist)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 geologist ((this geologist)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) - (play-ambient (-> obj ambient) "GEO-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-AM01" #f (-> this root-override trans)) ) ((< 0.7777778 f0-2) - (if (not (closed? (-> obj tasks) (game-task rolling-moles) (task-status need-reminder))) - (play-ambient (-> obj ambient) "GEO-AM02" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task rolling-moles) (task-status need-reminder))) + (play-ambient (-> this ambient) "GEO-AM02" #f (-> this root-override trans)) ) ) ((< 0.6666667 f0-2) - (play-ambient (-> obj ambient) "GEO-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-AM03" #f (-> this root-override trans)) ) ((< 0.5555556 f0-2) - (if (closed? (-> obj tasks) (game-task village2-geologist-money) (task-status need-introduction)) - (play-ambient (-> obj ambient) "GEO-AM04" #f (-> obj root-override trans)) + (if (closed? (-> this tasks) (game-task village2-geologist-money) (task-status need-introduction)) + (play-ambient (-> this ambient) "GEO-AM04" #f (-> this root-override trans)) ) ) ((< 0.44444445 f0-2) - (play-ambient (-> obj ambient) "GEO-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-AM05" #f (-> this root-override trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "GEO-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-AM06" #f (-> this root-override trans)) ) ((< 0.22222222 f0-2) - (if (not (closed? (-> obj tasks) (game-task rolling-moles) (task-status need-reminder))) - (play-ambient (-> obj ambient) "GEO-AM07" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task rolling-moles) (task-status need-reminder))) + (play-ambient (-> this ambient) "GEO-AM07" #f (-> this root-override trans)) ) ) ((< 0.11111111 f0-2) - (play-ambient (-> obj ambient) "GEO-LO02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-LO02" #f (-> this root-override trans)) ) - ((closed? (-> obj tasks) (game-task village2-geologist-money) (task-status need-resolution)) - (play-ambient (-> obj ambient) "GEO-AM08" #f (-> obj root-override trans)) + ((closed? (-> this tasks) (game-task village2-geologist-money) (task-status need-resolution)) + (play-ambient (-> this ambient) "GEO-AM08" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "GEO-LO01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-LO01" #f (-> this root-override trans)) ) ) ) ) ) -(defmethod init-from-entity! geologist ((obj geologist) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *geologist-sg* 3 45 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task rolling-moles))) - (set! (-> obj sound-flava) (music-flava geologist)) - (set! (-> obj draw light-index) (the-as uint 2)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! geologist ((this geologist) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *geologist-sg* 3 45 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task rolling-moles))) + (set! (-> this sound-flava) (music-flava geologist)) + (set! (-> this draw light-index) (the-as uint 2)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village2/sage-bluehut.gc b/goal_src/jak1/levels/village2/sage-bluehut.gc index ef82710ad2..27642a5aaa 100644 --- a/goal_src/jak1/levels/village2/sage-bluehut.gc +++ b/goal_src/jak1/levels/village2/sage-bluehut.gc @@ -37,28 +37,28 @@ :shadow sage-bluehut-shadow-mg ) -(defmethod play-anim! sage-bluehut ((obj sage-bluehut) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk-to-sage)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! sage-bluehut ((this sage-bluehut) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk-to-sage)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task rolling-plants)) (when arg0 - (let* ((s5-1 (-> obj tasks)) + (let* ((s5-1 (-> this tasks)) (s4-0 (method-of-object s5-1 save-reminder)) ) (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) - (let ((s5-2 (-> obj assistant extra process))) + (close-status! (-> this tasks) (task-status need-introduction)) + (let ((s5-2 (-> this assistant extra process))) (if (and s5-2 (should-display? (the-as assistant-bluehut s5-2))) - (send-event s5-2 'clone (process->handle obj)) + (send-event s5-2 'clone (process->handle this)) ) ) - (set! (-> obj draw bounds w) 40960.0) + (set! (-> this draw bounds w) 40960.0) ) (new 'static 'spool-anim :name "sage-bluehut-introduction-crop-dusting" @@ -69,7 +69,7 @@ ) (else (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) (close-specific-task! (game-task swamp-tether-1) (task-status need-introduction)) (close-specific-task! (game-task swamp-tether-2) (task-status need-introduction)) (close-specific-task! (game-task swamp-tether-3) (task-status need-introduction)) @@ -91,17 +91,17 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (if arg0 - (set! (-> obj reminder-played) #t) + (set! (-> this reminder-played) #t) ) (cond - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (new 'static 'spool-anim :name "sage-bluehut-reminder-1-crop-dusting" :index 9 :parts 3 :command-list '()) ) (else (if arg0 - (set! (-> obj draw bounds w) 40960.0) + (set! (-> this draw bounds w) 40960.0) ) (new 'static 'spool-anim :name "sage-bluehut-reminder-1-prec-arm" @@ -117,34 +117,36 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) -(defmethod process-taskable-method-45 sage-bluehut ((obj sage-bluehut)) +(defmethod process-taskable-method-45 sage-bluehut ((this sage-bluehut)) (cond - ((= (current-status (-> obj tasks)) (task-status unknown)) + ((= (current-status (-> this tasks)) (task-status unknown)) #f ) - ((= (current-status (-> obj tasks)) (task-status invalid)) + ((= (current-status (-> this tasks)) (task-status invalid)) #f ) - ((and (closed? (-> obj tasks) (game-task rolling-plants) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 0) + ((and (closed? (-> this tasks) (game-task rolling-plants) (task-status need-reminder)) + (= (get-reminder (-> this tasks) 0) 0) ) #t ) - ((and (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 1) + ((and (closed? (-> this tasks) (game-task swamp-arm) (task-status need-reminder)) + (= (get-reminder (-> this tasks) 0) 1) ) #t ) - ((and (-> obj reminder-played) (< 81920.0 (vector-vector-distance (-> obj root-override trans) (camera-pos)))) + ((and (-> this reminder-played) + (< 81920.0 (vector-vector-distance (-> this root-override trans) (camera-pos))) + ) #t ) (else @@ -153,45 +155,45 @@ ) ) -(defmethod get-art-elem sage-bluehut ((obj sage-bluehut)) +(defmethod get-art-elem sage-bluehut ((this sage-bluehut)) (cond - ((and (= (current-task (-> obj tasks)) (game-task rolling-plants)) - (or (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) + ((and (= (current-task (-> this tasks)) (game-task rolling-plants)) + (or (= (current-status (-> this tasks)) (task-status need-hint)) + (= (current-status (-> this tasks)) (task-status need-introduction)) ) ) - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) - ((and (= (current-task (-> obj tasks)) (game-task swamp-arm)) - (or (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) + ((and (= (current-task (-> this tasks)) (game-task swamp-arm)) + (or (= (current-status (-> this tasks)) (task-status need-hint)) + (= (current-status (-> this tasks)) (task-status need-introduction)) ) ) - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) - ((process-taskable-method-45 obj) - (set! (-> obj reminder-played) #f) + ((process-taskable-method-45 this) + (set! (-> this reminder-played) #f) (cond - ((closed? (-> obj tasks) (game-task rolling-plants) (task-status need-reminder)) - (save-reminder (-> obj tasks) 1 0) + ((closed? (-> this tasks) (game-task rolling-plants) (task-status need-reminder)) + (save-reminder (-> this tasks) 1 0) ) - ((or (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-reminder)) - (not (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-introduction))) + ((or (closed? (-> this tasks) (game-task swamp-arm) (task-status need-reminder)) + (not (closed? (-> this tasks) (game-task swamp-arm) (task-status need-introduction))) ) - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) - ((zero? (get-reminder (-> obj tasks) 0)) - (save-reminder (-> obj tasks) 1 0) + ((zero? (get-reminder (-> this tasks) 0)) + (save-reminder (-> this tasks) 1 0) ) (else - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) ) ) ) - (if (zero? (get-reminder (-> obj tasks) 0)) - (-> obj draw art-group data 4) - (-> obj draw art-group data 5) + (if (zero? (get-reminder (-> this tasks) 0)) + (-> this draw art-group data 4) + (-> this draw art-group data 5) ) ) @@ -204,23 +206,23 @@ ) ) -(defmethod should-display? sage-bluehut ((obj sage-bluehut)) +(defmethod should-display? sage-bluehut ((this sage-bluehut)) (and (task-closed? (game-task village2-levitator) (task-status need-introduction)) (not (sages-kidnapped?))) ) -(defmethod play-reminder sage-bluehut ((obj sage-bluehut)) +(defmethod play-reminder sage-bluehut ((this sage-bluehut)) (the-as symbol - (and (-> obj will-talk) *target* (< -6365184.0 (-> (target-pos 0) z)) (< (-> (target-pos 0) x) 1612800.0)) + (and (-> this will-talk) *target* (< -6365184.0 (-> (target-pos 0) z)) (< (-> (target-pos 0) x) 1612800.0)) ) ) -(defmethod target-above-threshold? sage-bluehut ((obj sage-bluehut)) +(defmethod target-above-threshold? sage-bluehut ((this sage-bluehut)) (local-vars (v0-1 symbol)) - (if (not (play-reminder obj)) + (if (not (play-reminder this)) (return #f) ) - (let ((gp-1 (-> obj assistant extra process))) + (let ((gp-1 (-> this assistant extra process))) (if (not gp-1) (return #t) ) @@ -230,24 +232,24 @@ v0-1 ) -(defmethod process-taskable-method-43 sage-bluehut ((obj sage-bluehut)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 sage-bluehut ((this sage-bluehut)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8 f0-2) - (play-ambient (-> obj ambient) "SAGELP20" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP20" #f (-> this root-override trans)) ) ((< 0.6 f0-2) - (play-ambient (-> obj ambient) "SAGELP21" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP21" #f (-> this root-override trans)) ) ((< 0.4 f0-2) - (play-ambient (-> obj ambient) "SAGELP22" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP22" #f (-> this root-override trans)) ) ((< 0.2 f0-2) - (play-ambient (-> obj ambient) "SAGELP23" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP23" #f (-> this root-override trans)) ) ((nonzero? (get-task-status (game-task citadel-sage-blue))) - (play-ambient (-> obj ambient) "SAGELP24" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP24" #f (-> this root-override trans)) ) ) ) @@ -312,13 +314,13 @@ ) ) -(defmethod init-from-entity! sage-bluehut ((obj sage-bluehut) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sage-bluehut-sg* 3 40 (new 'static 'vector :w 4505.6) 5) - (set! (-> obj tasks) (get-task-control (game-task rolling-plants))) - (set! (-> obj reminder-played) #f) - (set! (-> obj assistant) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj draw light-index) (the-as uint 1)) - (set! (-> obj sound-flava) (music-flava sage)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! sage-bluehut ((this sage-bluehut) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sage-bluehut-sg* 3 40 (new 'static 'vector :w 4505.6) 5) + (set! (-> this tasks) (get-task-control (game-task rolling-plants))) + (set! (-> this reminder-played) #f) + (set! (-> this assistant) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this sound-flava) (music-flava sage)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village2/sunken-elevator.gc b/goal_src/jak1/levels/village2/sunken-elevator.gc index c1d4794185..f99a5f7d06 100644 --- a/goal_src/jak1/levels/village2/sunken-elevator.gc +++ b/goal_src/jak1/levels/village2/sunken-elevator.gc @@ -24,16 +24,16 @@ :bounds (static-spherem 0 -1 0 6.6) ) -(defmethod should-teleport? sunken-elevator ((obj sunken-elevator)) +(defmethod should-teleport? sunken-elevator ((this sunken-elevator)) (let ((f0-0 (-> (camera-pos) y))) - (case (-> obj path-pos) + (case (-> this path-pos) ((0.0) - (if (< f0-0 (-> obj teleport-if-below-y)) + (if (< f0-0 (-> this teleport-if-below-y)) (return #t) ) ) ((1.0) - (if (< (-> obj teleport-if-above-y) f0-0) + (if (< (-> this teleport-if-above-y) f0-0) (return #t) ) ) @@ -162,50 +162,50 @@ ) ) -(defmethod can-target-move? sunken-elevator ((obj sunken-elevator)) - (set! (-> obj play-at-top-going-up-camera?) #f) +(defmethod can-target-move? sunken-elevator ((this sunken-elevator)) + (set! (-> this play-at-top-going-up-camera?) #f) (let ((s5-0 (new 'stack-no-clear 'vector))) - (eval-path-curve! (-> obj path) s5-0 0.4 'interp) - (set! (-> obj teleport-if-above-y) (-> s5-0 y)) - (eval-path-curve! (-> obj path) s5-0 0.6 'interp) - (set! (-> obj teleport-if-below-y) (-> s5-0 y)) + (eval-path-curve! (-> this path) s5-0 0.4 'interp) + (set! (-> this teleport-if-above-y) (-> s5-0 y)) + (eval-path-curve! (-> this path) s5-0 0.6 'interp) + (set! (-> this teleport-if-below-y) (-> s5-0 y)) ) (none) ) -(defmethod plat-button-method-27 sunken-elevator ((obj sunken-elevator)) +(defmethod plat-button-method-27 sunken-elevator ((this sunken-elevator)) (ja-channel-set! 1) (cond - ((can-activate? obj) - (let ((s5-0 (-> obj skel root-channel 0))) + ((can-activate? this) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) ) (else - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) ) ) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (none) ) -(defmethod plat-button-method-31 sunken-elevator ((obj sunken-elevator)) - (initialize-skeleton obj *sunken-elevator-sg* '()) +(defmethod plat-button-method-31 sunken-elevator ((this sunken-elevator)) + (initialize-skeleton this *sunken-elevator-sg* '()) 0 (none) ) diff --git a/goal_src/jak1/levels/village2/swamp-blimp.gc b/goal_src/jak1/levels/village2/swamp-blimp.gc index 600c12e5c7..5af193d4c6 100644 --- a/goal_src/jak1/levels/village2/swamp-blimp.gc +++ b/goal_src/jak1/levels/village2/swamp-blimp.gc @@ -296,24 +296,23 @@ ) -(defmethod init! swamp-rope-rand-float ((obj swamp-rope-rand-float) (arg0 int) (arg1 int) (arg2 float)) - (set! (-> obj min-time) arg0) - (set! (-> obj max-time) arg1) - (set! (-> obj max-val) (* 0.5 arg2)) - (set! (-> obj timer) 0) - (set! (-> obj value) 0.0) +(defmethod init! swamp-rope-rand-float ((this swamp-rope-rand-float) (arg0 int) (arg1 int) (arg2 float)) + (set! (-> this min-time) arg0) + (set! (-> this max-time) arg1) + (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this timer) 0) + (set! (-> this value) 0.0) 0 (none) ) -(defmethod update-timer! swamp-rope-rand-float ((obj swamp-rope-rand-float)) - (set! (-> obj timer) (- (the-as time-frame (-> obj timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) +(defmethod update-timer! swamp-rope-rand-float ((this swamp-rope-rand-float)) + (set! (-> this timer) + (- (the-as time-frame (-> this timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) - (when (<= (-> obj timer) 0) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value) (rand-vu-float-range (- (-> obj max-val)) (-> obj max-val))) + (when (<= (-> this timer) 0) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value) (rand-vu-float-range (- (-> this max-val)) (-> this max-val))) ) 0 (none) @@ -338,24 +337,25 @@ ) -(defmethod init! swamp-rope-oscillator ((obj swamp-rope-oscillator) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (set! (-> obj target) arg0) - (set! (-> obj value) arg0) - (set! (-> obj vel) 0.0) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj damping) arg3) +(defmethod init! swamp-rope-oscillator ((this swamp-rope-oscillator) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> this target) arg0) + (set! (-> this value) arg0) + (set! (-> this vel) 0.0) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this damping) arg3) 0 (none) ) -(defmethod swamp-rope-oscillator-method-10 swamp-rope-oscillator ((obj swamp-rope-oscillator) (arg0 float)) - (let ((f0-3 (* (- (+ (-> obj target) arg0) (-> obj value)) (* (-> obj accel) (-> *display* time-adjust-ratio))))) - (+! (-> obj vel) f0-3) +(defmethod swamp-rope-oscillator-method-10 swamp-rope-oscillator ((this swamp-rope-oscillator) (arg0 float)) + (let ((f0-3 (* (- (+ (-> this target) arg0) (-> this value)) (* (-> this accel) (-> *display* time-adjust-ratio)))) + ) + (+! (-> this vel) f0-3) ) - (set! (-> obj vel) (fmin (-> obj max-vel) (fmax (- (-> obj max-vel)) (-> obj vel)))) - (set! (-> obj vel) (* (-> obj vel) (-> obj damping))) - (+! (-> obj value) (* (-> obj vel) (-> *display* time-adjust-ratio))) + (set! (-> this vel) (fmin (-> this max-vel) (fmax (- (-> this max-vel)) (-> this vel)))) + (set! (-> this vel) (* (-> this vel) (-> this damping))) + (+! (-> this value) (* (-> this vel) (-> *display* time-adjust-ratio))) 0 (none) ) @@ -378,27 +378,26 @@ ) -(defmethod init! swamp-blimp-rand-vector ((obj swamp-blimp-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) - (set! (-> obj min-time) arg0) - (set! (-> obj max-time) arg1) - (set! (-> obj xz-max) (* 0.5 arg2)) - (set! (-> obj y-max) (* 0.5 arg3)) - (set! (-> obj timer) 0) - (vector-reset! (-> obj value)) +(defmethod init! swamp-blimp-rand-vector ((this swamp-blimp-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) + (set! (-> this min-time) arg0) + (set! (-> this max-time) arg1) + (set! (-> this xz-max) (* 0.5 arg2)) + (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this timer) 0) + (vector-reset! (-> this value)) 0 (none) ) -(defmethod update-timer! swamp-blimp-rand-vector ((obj swamp-blimp-rand-vector)) - (set! (-> obj timer) (- (the-as time-frame (-> obj timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) +(defmethod update-timer! swamp-blimp-rand-vector ((this swamp-blimp-rand-vector)) + (set! (-> this timer) + (- (the-as time-frame (-> this timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) - (when (<= (-> obj timer) 0) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value x) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (set! (-> obj value y) (rand-vu-float-range (- (-> obj y-max)) (-> obj y-max))) - (set! (-> obj value z) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) + (when (<= (-> this timer) 0) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (set! (-> this value y) (rand-vu-float-range (- (-> this y-max)) (-> this y-max))) + (set! (-> this value z) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) ) 0 (none) @@ -423,46 +422,46 @@ ) -(defmethod init! swamp-blimp-oscillator ((obj swamp-blimp-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init! swamp-blimp-oscillator ((this swamp-blimp-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj value quad) (-> arg0 quad)) + (set! (-> this target quad) (-> arg0 quad)) + (set! (-> this value quad) (-> arg0 quad)) ) (else - (vector-reset! (-> obj target)) - (vector-reset! (-> obj value)) + (vector-reset! (-> this target)) + (vector-reset! (-> this value)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj damping) arg3) + (vector-reset! (-> this vel)) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this damping) arg3) 0 (none) ) -(defmethod swamp-blimp-oscillator-method-10 swamp-blimp-oscillator ((obj swamp-blimp-oscillator) (arg0 vector)) +(defmethod swamp-blimp-oscillator-method-10 swamp-blimp-oscillator ((this swamp-blimp-oscillator) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (cond (arg0 - (vector+! gp-0 (-> obj target) arg0) - (vector-! gp-0 gp-0 (-> obj value)) + (vector+! gp-0 (-> this target) arg0) + (vector-! gp-0 gp-0 (-> this value)) ) (else - (vector-! gp-0 (-> obj target) (-> obj value)) + (vector-! gp-0 (-> this target) (-> this value)) ) ) - (vector-float*! gp-0 gp-0 (* (-> obj accel) (-> *display* time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) gp-0) - (let ((f0-2 (vector-length (-> obj vel)))) - (if (< (-> obj max-vel) f0-2) - (vector-float*! (-> obj vel) (-> obj vel) (/ (-> obj max-vel) f0-2)) + (vector-float*! gp-0 gp-0 (* (-> this accel) (-> *display* time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) gp-0) + (let ((f0-2 (vector-length (-> this vel)))) + (if (< (-> this max-vel) f0-2) + (vector-float*! (-> this vel) (-> this vel) (/ (-> this max-vel) f0-2)) ) ) - (vector-float*! (-> obj vel) (-> obj vel) (-> obj damping)) - (vector-float*! gp-0 (-> obj vel) (-> *display* time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) gp-0) + (vector-float*! (-> this vel) (-> this vel) (-> this damping)) + (vector-float*! gp-0 (-> this vel) (-> *display* time-adjust-ratio)) + (vector+! (-> this value) (-> this value) gp-0) ) 0 (none) @@ -542,9 +541,9 @@ ) -(defmethod swamp-rope-method-20 swamp-rope ((obj swamp-rope)) - (and (-> obj other-entity) - (not (task-closed? (-> obj other-entity extra perm task) (task-status need-reminder))) +(defmethod swamp-rope-method-20 swamp-rope ((this swamp-rope)) + (and (-> this other-entity) + (not (task-closed? (-> this other-entity extra perm task) (task-status need-reminder))) ) ) @@ -578,16 +577,16 @@ ) -(defmethod relocate swamp-blimp ((obj swamp-blimp) (arg0 int)) - (if (nonzero? (-> obj gondola)) - (&+! (-> obj gondola) arg0) +(defmethod relocate swamp-blimp ((this swamp-blimp) (arg0 int)) + (if (nonzero? (-> this gondola)) + (&+! (-> this gondola) arg0) ) - (if (nonzero? (-> obj bag)) - (&+! (-> obj bag) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method swamp-blimp 7)) this arg0) ) ) @@ -653,8 +652,8 @@ (set! (-> *camera-other-fov* data) (cam-slave-get-fov s5-1)) ) (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.6)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.6)) (set! *camera-look-through-other* 2) (suspend) ) @@ -713,8 +712,8 @@ (suspend) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (set! *camera-look-through-other* 2) (suspend) ) @@ -725,13 +724,13 @@ (set! (-> *camera-other-fov* data) (cam-slave-get-fov gp-1)) ) (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 5)) (set! *camera-look-through-other* 2) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 5)) (set! *camera-look-through-other* 2) (let ((gp-2 (new 'stack-no-clear 'vector)) (a0-58 (-> self blimp extra process)) @@ -870,10 +869,10 @@ :post transform-post ) -(defmethod init-from-entity! swamp-tetherrock ((obj swamp-tetherrock) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask attackable)) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! swamp-tetherrock ((this swamp-tetherrock) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask attackable)) + (process-entity-status! this (entity-perm-status bit-7) #t) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -891,29 +890,29 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *swamp-tetherrock-sg* '()) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *swamp-tetherrock-sg* '()) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj blimp) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj tension) 0.0) - (vector-reset! (-> obj tension-pt)) - (quaternion-copy! (-> obj rot-at-init) (-> obj root-override quat)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (case (get-task-status (-> obj entity extra perm task)) + (set! (-> this blimp) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this tension) 0.0) + (vector-reset! (-> this tension-pt)) + (quaternion-copy! (-> this rot-at-init) (-> this root-override quat)) + (logclear! (-> this mask) (process-mask actor-pause)) + (case (get-task-status (-> this entity extra perm task)) (((task-status invalid)) (go swamp-tetherrock-die) ) (((task-status need-resolution)) (birth-pickup-at-point - (-> obj root-override trans) + (-> this root-override trans) (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) + (the float (-> this entity extra perm task)) #f - obj + this (the-as fact-info #f) ) (go swamp-tetherrock-hide) @@ -937,10 +936,8 @@ (defstate precursor-arm-sink (precursor-arm) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (the int (-> *SWAMP_BLIMP-bank* arm-sink-wait)) - ) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (the int (-> *SWAMP_BLIMP-bank* arm-sink-wait))) (suspend) ) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) @@ -1026,17 +1023,13 @@ ) (when (< 0.0 f28-2) (let ((f26-1 (+ f26-0 (* 0.14648438 f28-2)))) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int f26-1)) - (if (< (- f26-1 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) 150.0) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (the int f26-1))) + (if (< (- f26-1 (the float (- (current-time) (-> self state-time)))) 150.0) (set! (-> self tension) 0.5) ) (set! (-> self y-offset) - (+ f30-2 - (* f28-2 - (precursor-arm-slip (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) f26-1)) - ) - ) + (+ f30-2 (* f28-2 (precursor-arm-slip (/ (the float (- (current-time) (-> self state-time))) f26-1)))) ) (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) @@ -1052,17 +1045,13 @@ ) (when (< f28-4 0.0) (let ((f26-3 (- f26-2 (* 0.036621094 f28-4)))) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int f26-3)) - (if (< (- f26-3 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) 150.0) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (the int f26-3))) + (if (< (- f26-3 (the float (- (current-time) (-> self state-time)))) 150.0) (set! (-> self tension) 1.5) ) (set! (-> self y-offset) - (+ f30-5 - (* f28-4 - (parameter-ease-sin-clamp (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) f26-3)) - ) - ) + (+ f30-5 (* f28-4 (parameter-ease-sin-clamp (/ (the float (- (current-time) (-> self state-time))) f26-3)))) ) (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) @@ -1076,8 +1065,8 @@ :post transform-post ) -(defmethod init-from-entity! precursor-arm ((obj precursor-arm) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! precursor-arm ((this precursor-arm) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (alloc-riders s4-0 1) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -1089,22 +1078,22 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *precursor-arm-sg* '()) - (set! (-> obj rot-speed) 0.0) - (set! (-> obj rot-dist) 0.0) - (set! (-> obj rot-base) 0.0) - (set! (-> obj rot-t) 1.0) - (quaternion->matrix (-> obj init-mat) (-> obj root-override quat)) - (set! (-> obj y-offset) 0.0) - (set! (-> obj y-init) (-> obj root-override trans y)) - (set! (-> obj tension) 0.0) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj event-hook) (-> precursor-arm-idle event)) - (if (= (get-task-status (-> obj entity extra perm task)) (task-status invalid)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *precursor-arm-sg* '()) + (set! (-> this rot-speed) 0.0) + (set! (-> this rot-dist) 0.0) + (set! (-> this rot-base) 0.0) + (set! (-> this rot-t) 1.0) + (quaternion->matrix (-> this init-mat) (-> this root-override quat)) + (set! (-> this y-offset) 0.0) + (set! (-> this y-init) (-> this root-override trans y)) + (set! (-> this tension) 0.0) + (process-entity-status! this (entity-perm-status bit-7) #t) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this event-hook) (-> precursor-arm-idle event)) + (if (= (get-task-status (-> this entity extra perm task)) (task-status invalid)) (go precursor-arm-die) (go precursor-arm-idle) ) @@ -1164,9 +1153,9 @@ (vector-normalize! (-> gp-0 vector 1) 1.0) (set-vector! s5-0 - (sin (* (-> self rot-speed) (the float (- (-> *display* base-frame-counter) (-> self state-time))))) + (sin (* (-> self rot-speed) (the float (- (current-time) (-> self state-time))))) 0.0 - (cos (* (-> self rot-speed) (the float (- (-> *display* base-frame-counter) (-> self state-time))))) + (cos (* (-> self rot-speed) (the float (- (current-time) (-> self state-time))))) 1.0 ) (vector-cross! (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1) s5-0) @@ -1409,14 +1398,14 @@ ) :trans blimp-trans :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-copy! gp-0 (-> self rot-at-init)) (loop (quaternion-vector-angle! (-> self rot-at-init) (new 'static 'vector :y 1.0 :w 1.0) - (* 18.204445 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) + (* 18.204445 (the float (- (current-time) (-> self state-time)))) ) (quaternion*! (-> self rot-at-init) (-> self rot-at-init) gp-0) (if (< (-> self pos-oscillator target x) 409600.0) @@ -1533,27 +1522,24 @@ (ja :group! swamp-blimp-idle-ja) (loop (when (< 300 (-> self arm-timer)) - (set! (-> self arm-timer) (- (the-as time-frame (-> self arm-timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) + (set! (-> self arm-timer) + (- (the-as time-frame (-> self arm-timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) (if (>= 300 (-> self arm-timer)) (+! (-> self pos-oscillator target y) (* 16384.0 (-> *display* time-adjust-ratio))) ) ) (when (< 240 (-> self arm-timer)) - (set! (-> self arm-timer) (- (the-as time-frame (-> self arm-timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) + (set! (-> self arm-timer) + (- (the-as time-frame (-> self arm-timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) (if (>= 150 (-> self arm-timer)) (set! (-> self scale-oscillator target) 0.2) ) ) (when (> (-> self arm-timer) 0) - (set! (-> self arm-timer) (- (the-as time-frame (-> self arm-timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) + (set! (-> self arm-timer) + (- (the-as time-frame (-> self arm-timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) (when (<= (-> self arm-timer) 0) (set! (-> self scale-oscillator target) -0.2) @@ -1567,8 +1553,8 @@ :post transform-post ) -(defmethod init-from-entity! swamp-blimp ((obj swamp-blimp) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! swamp-blimp ((this swamp-blimp) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1586,44 +1572,44 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *swamp-blimp-sg* '()) - (quaternion-copy! (-> obj rot-at-init) (-> obj root-override quat)) - (set! (-> obj arm-timer) 0) - (set! (-> obj trans-at-init quad) (-> obj root-override trans quad)) - (set! (-> obj y-vel) 0.0) - (set! (-> obj y-offset) 0.0) - (set! (-> obj y-offset-target) 0.0) - (init! (-> obj main-tilt-rand) 300 900 0.05 0.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *swamp-blimp-sg* '()) + (quaternion-copy! (-> this rot-at-init) (-> this root-override quat)) + (set! (-> this arm-timer) 0) + (set! (-> this trans-at-init quad) (-> this root-override trans quad)) + (set! (-> this y-vel) 0.0) + (set! (-> this y-offset) 0.0) + (set! (-> this y-offset-target) 0.0) + (init! (-> this main-tilt-rand) 300 900 0.05 0.0) (let ((s5-1 (new 'stack-no-clear 'vector))) (set-vector! s5-1 0.0 1.0 0.0 1.0) - (init! (-> obj main-tilt-oscillator) s5-1 0.001 0.01 0.99) - (init! (-> obj gondola-tilt-oscillator) s5-1 0.001 0.01 0.99) + (init! (-> this main-tilt-oscillator) s5-1 0.001 0.01 0.99) + (init! (-> this gondola-tilt-oscillator) s5-1 0.001 0.01 0.99) ) - (init! (-> obj pos-rand) 1500 2400 20480.0 4096.0) - (init! (-> obj pos-oscillator) (the-as vector #f) 0.00032768 1638.4 0.995) - (init! (-> obj scale-rand) 1500 2400 0.02) - (init! (-> obj scale-oscillator) 0.0 0.002 0.015 0.99) + (init! (-> this pos-rand) 1500 2400 20480.0 4096.0) + (init! (-> this pos-oscillator) (the-as vector #f) 0.00032768 1638.4 0.995) + (init! (-> this scale-rand) 1500 2400 0.02) + (init! (-> this scale-oscillator) 0.0 0.002 0.015 0.99) (dotimes (v1-38 5) - (set! (-> obj the-ropes v1-38) (the-as handle #f)) + (set! (-> this the-ropes v1-38) (the-as handle #f)) ) - (let ((s5-2 (entity-actor-count (-> obj entity) 'alt-actor))) + (let ((s5-2 (entity-actor-count (-> this entity) 'alt-actor))) (dotimes (s4-1 s5-2) - (let ((s3-1 (entity-actor-lookup (-> obj entity) 'alt-actor s4-1))) + (let ((s3-1 (entity-actor-lookup (-> this entity) 'alt-actor s4-1))) (if s3-1 - (set! (-> obj the-ropes s4-1) - (ppointer->handle (process-spawn swamp-rope (-> obj trans-at-init) s3-1 :to obj)) + (set! (-> this the-ropes s4-1) + (ppointer->handle (process-spawn swamp-rope (-> this trans-at-init) s3-1 :to this)) ) ) ) ) ) - (set! (-> obj gondola) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) obj 5)) - (set! (-> obj bag) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) obj 3)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status bit-7) #t) + (set! (-> this gondola) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) this 5)) + (set! (-> this bag) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) this 3)) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status bit-7) #t) (swamp-blimp-setup) (go swamp-blimp-idle) (none) diff --git a/goal_src/jak1/levels/village2/village2-obs.gc b/goal_src/jak1/levels/village2/village2-obs.gc index c75d61fe59..66164dbaf4 100644 --- a/goal_src/jak1/levels/village2/village2-obs.gc +++ b/goal_src/jak1/levels/village2/village2-obs.gc @@ -23,8 +23,8 @@ :bounds (static-spherem 0 0 0 10) ) -(defmethod set-stack-size! village2cam ((obj village2cam)) - (stack-size-set! (-> obj main-thread) 512) +(defmethod set-stack-size! village2cam ((this village2cam)) + (stack-size-set! (-> this main-thread) 512) (none) ) @@ -153,26 +153,26 @@ ) ) -(defmethod init-from-entity! pontoon ((obj pontoon) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) - (set! (-> obj water-anim) #f) - (set! (-> obj root-overlay pause-adjust-distance) -122880.0) - (set! (-> obj task) (the-as uint (-> arg0 extra perm task))) - (set! (-> obj alt-task) (res-lump-value arg0 'alt-task uint)) +(defmethod init-from-entity! pontoon ((this pontoon) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) + (set! (-> this water-anim) #f) + (set! (-> this root-overlay pause-adjust-distance) -122880.0) + (set! (-> this task) (the-as uint (-> arg0 extra perm task))) + (set! (-> this alt-task) (res-lump-value arg0 'alt-task uint)) (cond - ((and (nonzero? (-> obj alt-task)) - (task-closed? (the-as game-task (-> obj alt-task)) (task-status need-resolution)) + ((and (nonzero? (-> this alt-task)) + (task-closed? (the-as game-task (-> this alt-task)) (task-status need-resolution)) ) (go pontoon-die) ) - ((zero? (-> obj task)) - (go (method-of-object obj rigid-body-platform-idle)) + ((zero? (-> this task)) + (go (method-of-object this rigid-body-platform-idle)) ) - ((task-closed? (the-as game-task (-> obj task)) (task-status need-resolution)) - (go (method-of-object obj rigid-body-platform-idle)) + ((task-closed? (the-as game-task (-> this task)) (task-status need-resolution)) + (go (method-of-object this rigid-body-platform-idle)) ) (else (go pontoon-hidden) @@ -182,9 +182,9 @@ (none) ) -(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)) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) +(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)) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) @@ -271,8 +271,8 @@ :longest-edge (meters 4) ) -(defmethod rigid-body-platform-method-30 pontoonfive ((obj pontoonfive)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 pontoonfive ((this pontoonfive)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -290,49 +290,49 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-31 pontoonfive ((obj pontoonfive)) - (initialize-skeleton obj *pontoonfive-sg* '()) - (rigid-body-platform-method-29 obj *pontoonfive-constants*) - (set! (-> obj float-height-offset) 6144.0) - (set! (-> obj root-overlay nav-radius) 12288.0) - (let ((v1-6 (-> obj control-point-array data))) +(defmethod rigid-body-platform-method-31 pontoonfive ((this pontoonfive)) + (initialize-skeleton this *pontoonfive-sg* '()) + (rigid-body-platform-method-29 this *pontoonfive-constants*) + (set! (-> this float-height-offset) 6144.0) + (set! (-> this root-overlay nav-radius) 12288.0) + (let ((v1-6 (-> this control-point-array data))) (set! (-> v1-6 0 local-pos x) 9216.0) (set! (-> v1-6 0 local-pos y) 0.0) (set! (-> v1-6 0 local-pos z) 12083.2) (set! (-> v1-6 0 local-pos w) 1.0) ) - (let ((v1-8 (-> obj control-point-array data 1))) + (let ((v1-8 (-> this control-point-array data 1))) (set! (-> v1-8 local-pos x) 9216.0) (set! (-> v1-8 local-pos y) 0.0) (set! (-> v1-8 local-pos z) -12083.2) (set! (-> v1-8 local-pos w) 1.0) ) - (let ((v1-10 (-> obj control-point-array data 2))) + (let ((v1-10 (-> this control-point-array data 2))) (set! (-> v1-10 local-pos x) -9216.0) (set! (-> v1-10 local-pos y) 0.0) (set! (-> v1-10 local-pos z) -12083.2) (set! (-> v1-10 local-pos w) 1.0) ) - (let ((v1-12 (-> obj control-point-array data 3))) + (let ((v1-12 (-> this control-point-array data 3))) (set! (-> v1-12 local-pos x) -9216.0) (set! (-> v1-12 local-pos y) 0.0) (set! (-> v1-12 local-pos z) 12083.2) (set! (-> v1-12 local-pos w) 1.0) ) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) - (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f)) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) + (nav-mesh-connect this (-> this root-overlay) (the-as nav-control #f)) 0 (none) ) -(defmethod rigid-body-platform-method-30 pontoonten ((obj pontoonten)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 pontoonten ((this pontoonten)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -350,43 +350,43 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-31 pontoonten ((obj pontoonten)) - (initialize-skeleton obj *pontoonten-sg* '()) - (rigid-body-platform-method-29 obj *pontoonten-constants*) - (set! (-> obj float-height-offset) 6144.0) - (set! (-> obj root-overlay nav-radius) 20480.0) - (let ((v1-6 (-> obj control-point-array data))) +(defmethod rigid-body-platform-method-31 pontoonten ((this pontoonten)) + (initialize-skeleton this *pontoonten-sg* '()) + (rigid-body-platform-method-29 this *pontoonten-constants*) + (set! (-> this float-height-offset) 6144.0) + (set! (-> this root-overlay nav-radius) 20480.0) + (let ((v1-6 (-> this control-point-array data))) (set! (-> v1-6 0 local-pos x) 17408.0) (set! (-> v1-6 0 local-pos y) 0.0) (set! (-> v1-6 0 local-pos z) 10035.2) (set! (-> v1-6 0 local-pos w) 1.0) ) - (let ((v1-8 (-> obj control-point-array data 1))) + (let ((v1-8 (-> this control-point-array data 1))) (set! (-> v1-8 local-pos x) 17408.0) (set! (-> v1-8 local-pos y) 0.0) (set! (-> v1-8 local-pos z) -10035.2) (set! (-> v1-8 local-pos w) 1.0) ) - (let ((v1-10 (-> obj control-point-array data 2))) + (let ((v1-10 (-> this control-point-array data 2))) (set! (-> v1-10 local-pos x) -17408.0) (set! (-> v1-10 local-pos y) 0.0) (set! (-> v1-10 local-pos z) -10035.2) (set! (-> v1-10 local-pos w) 1.0) ) - (let ((v1-12 (-> obj control-point-array data 3))) + (let ((v1-12 (-> this control-point-array data 3))) (set! (-> v1-12 local-pos x) -17408.0) (set! (-> v1-12 local-pos y) 0.0) (set! (-> v1-12 local-pos z) 10035.2) (set! (-> v1-12 local-pos w) 1.0) ) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) - (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f)) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) + (nav-mesh-connect this (-> this root-overlay) (the-as nav-control #f)) 0 (none) ) @@ -529,12 +529,12 @@ ) ) -(defmethod init-from-entity! allpontoons ((obj allpontoons) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *allpontoons-sg* '()) - (set! (-> obj task) (the-as uint (-> arg0 extra perm task))) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 563) obj)) +(defmethod init-from-entity! allpontoons ((this allpontoons) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *allpontoons-sg* '()) + (set! (-> this task) (the-as uint (-> arg0 extra perm task))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 563) this)) (go allpontoons-idle) (none) ) @@ -587,7 +587,7 @@ (cond ((handle->process (-> self tracker)) (let ((v1-6 (-> (the-as (pointer part-tracker) (-> self tracker process)) 0))) - (set! (-> v1-6 start-time) (-> *display* base-frame-counter)) + (set-time! (-> v1-6 start-time)) (set! v0-1 (-> v1-6 root trans)) ) (set! (-> (the-as vector v0-1) quad) (-> gp-0 quad)) @@ -710,9 +710,7 @@ ((zero? (-> self task)) ) ((handle->process (-> self tracker)) - (set! (-> (the-as (pointer part-tracker) (-> self tracker process)) 0 start-time) - (-> *display* base-frame-counter) - ) + (set-time! (-> (the-as (pointer part-tracker) (-> self tracker process)) 0 start-time)) ) (else (set! (-> self tracker) (ppointer->handle (process-spawn @@ -738,8 +736,8 @@ :post ja-post ) -(defmethod init-from-entity! fireboulder ((obj fireboulder) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! fireboulder ((this fireboulder) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -768,26 +766,26 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (cond - ((name= (-> obj name) "fireboulder-6") - (quaternion-axis-angle! (-> obj root-override quat) 0.0 1.0 0.0 16384.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> obj root-override trans)) + ((name= (-> this name) "fireboulder-6") + (quaternion-axis-angle! (-> this root-override quat) 0.0 1.0 0.0 16384.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> this root-override trans)) ) ) (else (fireboulder-disable-blocking-collision) ) ) - (initialize-skeleton obj *fireboulder-sg* '()) - (set! (-> obj tracker) (the-as handle #f)) - (set-vector! (-> obj draw color-emissive) 0.125 0.0625 0.0 0.0) - (set! (-> obj task) (the-as uint (-> arg0 extra perm task))) + (initialize-skeleton this *fireboulder-sg* '()) + (set! (-> this tracker) (the-as handle #f)) + (set-vector! (-> this draw color-emissive) 0.125 0.0625 0.0 0.0) + (set! (-> this task) (the-as uint (-> arg0 extra perm task))) (cond - ((zero? (-> obj task)) + ((zero? (-> this task)) (go fireboulder-idle) ) ((= (get-task-status (-> arg0 extra perm task)) (task-status invalid)) @@ -830,10 +828,10 @@ :post ja-post ) -(defmethod init-from-entity! ceilingflag ((obj ceilingflag) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ceilingflag-sg* '()) +(defmethod init-from-entity! ceilingflag ((this ceilingflag) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ceilingflag-sg* '()) (go ceilingflag-idle) (none) ) @@ -861,7 +859,7 @@ :bounds (static-spherem 0 5 0 15) ) -(defmethod skip-reminder? exit-chamber-dummy ((obj exit-chamber-dummy)) +(defmethod skip-reminder? exit-chamber-dummy ((this exit-chamber-dummy)) (case (get-reminder (get-task-control (game-task sunken-room)) 0) ((2) (let ((v1-4 (level-get *level* 'sunken))) @@ -904,9 +902,7 @@ (+! gp-0 1) ) (set! (-> self root trans y) - (+ (-> self orig-trans y) - (* 2252.8 (cos (* 36.40889 (the float (mod (-> *display* base-frame-counter) 1800))))) - ) + (+ (-> self orig-trans y) (* 2252.8 (cos (* 36.40889 (the float (mod (current-time) 1800)))))) ) (let ((a0-7 (handle->process (-> self fcell-handle)))) (when a0-7 @@ -930,24 +926,24 @@ :post ja-post ) -(defmethod init-from-entity! exit-chamber-dummy ((obj exit-chamber-dummy) (arg0 entity-actor)) - (set! (-> obj fcell-handle) (the-as handle #f)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (+! (-> obj root trans y) 24576.0) - (set! (-> obj orig-trans quad) (-> obj root trans quad)) - (initialize-skeleton obj *exit-chamber-dummy-sg* '()) +(defmethod init-from-entity! exit-chamber-dummy ((this exit-chamber-dummy) (arg0 entity-actor)) + (set! (-> this fcell-handle) (the-as handle #f)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (+! (-> this root trans y) 24576.0) + (set! (-> this orig-trans quad) (-> this root trans quad)) + (initialize-skeleton this *exit-chamber-dummy-sg* '()) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) - (logior! (-> obj draw status) (draw-status hidden)) + (logior! (-> this draw status) (draw-status hidden)) (go exit-chamber-dummy-wait-to-appear) (none) ) @@ -1428,8 +1424,8 @@ (suspend) (ja :num! (seek! (ja-aframe 140.0 0))) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.167)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.167)) (suspend) ) ) @@ -1441,8 +1437,8 @@ (suspend) (ja :num! (seek! (ja-aframe 168.0 0))) ) - (let ((gp-5 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.167)) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 0.167)) (suspend) ) ) @@ -1490,8 +1486,8 @@ :post ja-post ) -(defmethod init-from-entity! ogreboss-village2 ((obj ogreboss-village2) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! ogreboss-village2 ((this ogreboss-village2) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1509,15 +1505,15 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ogreboss-village2-sg* '()) - (set-vector! (-> obj root scale) 0.65 0.65 0.65 1.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ogreboss-village2-sg* '()) + (set-vector! (-> this root scale) 0.65 0.65 0.65 1.0) (transform-post) - (set! (-> obj root pause-adjust-distance) 122880.0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj boulder) (the-as handle #f)) + (set! (-> this root pause-adjust-distance) 122880.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this boulder) (the-as handle #f)) (go ogreboss-village2-idle) (none) ) @@ -1553,13 +1549,13 @@ ) ) -(defmethod water-vol-method-22 villageb-water ((obj villageb-water)) +(defmethod water-vol-method-22 villageb-water ((this villageb-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) diff --git a/goal_src/jak1/levels/village2/warrior.gc b/goal_src/jak1/levels/village2/warrior.gc index f1d93d3b4b..c90ff0c548 100644 --- a/goal_src/jak1/levels/village2/warrior.gc +++ b/goal_src/jak1/levels/village2/warrior.gc @@ -22,10 +22,10 @@ :shadow warrior-shadow-mg ) -(defmethod process-taskable-method-52 warrior ((obj warrior)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 warrior ((this warrior)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -38,21 +38,21 @@ (none) ) -(defmethod draw-npc-shadow warrior ((obj warrior)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow warrior ((this warrior)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -61,13 +61,13 @@ (none) ) -(defmethod play-anim! warrior ((obj warrior) (arg0 symbol)) +(defmethod play-anim! warrior ((this warrior) (arg0 symbol)) (with-pp - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "warrior-introduction" @@ -88,24 +88,24 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (new 'static 'spool-anim :name "warrior-reminder-1" :index 7 :parts 3 :command-list '()) ) (((task-status need-reward-speech)) (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) - (send-event (-> (entity-by-type allpontoons) extra process) 'clone (process->handle obj)) - (dotimes (s5-2 (entity-actor-count (-> obj entity) 'alt-actor)) - (entity-birth-no-kill (entity-actor-lookup (-> obj entity) 'alt-actor s5-2)) + (send-event (-> (entity-by-type allpontoons) extra process) 'clone (process->handle this)) + (dotimes (s5-2 (entity-actor-count (-> this entity) 'alt-actor)) + (entity-birth-no-kill (entity-actor-lookup (-> this entity) 'alt-actor s5-2)) (let ((s4-2 (new 'stack-no-clear 'event-message-block))) (set! (-> s4-2 from) pp) (set! (-> s4-2 num-params) 0) (set! (-> s4-2 message) 'die) (let ((s3-0 send-event-function) - (v1-25 (entity-actor-lookup (-> obj entity) 'alt-actor s5-2)) + (v1-25 (entity-actor-lookup (-> this entity) 'alt-actor s5-2)) ) (s3-0 (if v1-25 @@ -118,8 +118,8 @@ ) ) (else - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this will-talk) #t) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (new 'static 'spool-anim @@ -134,18 +134,18 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ) ) ) -(defmethod get-art-elem warrior ((obj warrior)) - (-> obj draw art-group data 5) +(defmethod get-art-elem warrior ((this warrior)) + (-> this draw art-group data 5) ) (defstate play-anim (warrior) @@ -156,26 +156,26 @@ ) ) -(defmethod process-taskable-method-43 warrior ((obj warrior)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 2) 61440.0 obj) +(defmethod process-taskable-method-43 warrior ((this warrior)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 2) 61440.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) - (play-ambient (-> obj ambient) "WAR-LO1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1A" #f (-> this root-override trans)) ) ((< 0.33 f0-2) - (play-ambient (-> obj ambient) "WAR-LO1B" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1B" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "WAR-LO1C" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1C" #f (-> this root-override trans)) ) ) ) ) ) -(defmethod initialize-collision warrior ((obj warrior) (arg0 int) (arg1 vector)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision warrior ((this warrior) (arg0 int) (arg1 vector)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -202,17 +202,17 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) -(defmethod init-from-entity! warrior ((obj warrior) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *warrior-sg* 3 33 (new 'static 'vector :y -4096.0 :w 10240.0) 5) - (set! (-> obj tasks) (get-task-control (game-task village2-warrior-money))) - (set! (-> obj sound-flava) (music-flava warrior)) - (set! (-> obj draw light-index) (the-as uint 3)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! warrior ((this warrior) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *warrior-sg* 3 33 (new 'static 'vector :y -4096.0 :w 10240.0) 5) + (set! (-> this tasks) (get-task-control (game-task village2-warrior-money))) + (set! (-> this sound-flava) (music-flava warrior)) + (set! (-> this draw light-index) (the-as uint 3)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village3/assistant-village3.gc b/goal_src/jak1/levels/village3/assistant-village3.gc index acb8fc7416..89b1be6c9d 100644 --- a/goal_src/jak1/levels/village3/assistant-village3.gc +++ b/goal_src/jak1/levels/village3/assistant-village3.gc @@ -22,10 +22,10 @@ :shadow assistant-village3-shadow-mg ) -(defmethod process-taskable-method-52 assistant-villagec ((obj assistant-villagec)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 assistant-villagec ((this assistant-villagec)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -38,21 +38,21 @@ (none) ) -(defmethod draw-npc-shadow assistant-villagec ((obj assistant-villagec)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow assistant-villagec ((this assistant-villagec)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -61,19 +61,19 @@ (none) ) -(defmethod play-anim! assistant-villagec ((obj assistant-villagec) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk-to-assistant)) +(defmethod play-anim! assistant-villagec ((this assistant-villagec) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk-to-assistant)) (cond ((= (get-task-status (game-task finalboss-movies)) (task-status need-introduction)) (if arg0 (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) (else (new 'static 'spool-anim :name "assistant-village3-reminder" :index 4 :parts 3 :command-list '()) @@ -81,54 +81,54 @@ ) ) -(defmethod get-art-elem assistant-villagec ((obj assistant-villagec)) - (-> obj draw art-group data 3) +(defmethod get-art-elem assistant-villagec ((this assistant-villagec)) + (-> this draw art-group data 3) ) -(defmethod should-display? assistant-villagec ((obj assistant-villagec)) +(defmethod should-display? assistant-villagec ((this assistant-villagec)) (and (task-closed? (game-task village3-button) (task-status need-introduction)) (not (sages-kidnapped?))) ) -(defmethod target-above-threshold? assistant-villagec ((obj assistant-villagec)) +(defmethod target-above-threshold? assistant-villagec ((this assistant-villagec)) (the-as symbol (and *target* (< (-> (target-pos 0) z) -14245888.0))) ) -(defmethod process-taskable-method-43 assistant-villagec ((obj assistant-villagec)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 assistant-villagec ((this assistant-villagec)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> obj ambient) "ASSTLP31" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP31" #f (-> this root-override trans)) ) ((< 0.71428573 f0-2) - (play-ambient (-> obj ambient) "ASSTLP32" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP32" #f (-> this root-override trans)) ) ((< 0.5714286 f0-2) - (play-ambient (-> obj ambient) "ASSTLP33" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP33" #f (-> this root-override trans)) ) ((< 0.42857143 f0-2) (let ((v1-16 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-16 (task-status need-reward-speech)) (= v1-16 (task-status invalid)))) - (play-ambient (-> obj ambient) "ASSTLP34" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP34" #f (-> this root-override trans)) ) ) ) ((< 0.2857143 f0-2) (let ((v1-21 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-21 (task-status need-reward-speech)) (= v1-21 (task-status invalid)))) - (play-ambient (-> obj ambient) "ASSTLP35" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP35" #f (-> this root-override trans)) ) ) ) ((< 0.14285715 f0-2) (let ((v1-26 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-26 (task-status need-reward-speech)) (= v1-26 (task-status invalid)))) - (play-ambient (-> obj ambient) "ASSTLP36" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP36" #f (-> this root-override trans)) ) ) ) ((nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> obj ambient) "ASSTLP37" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP37" #f (-> this root-override trans)) ) ) ) @@ -148,8 +148,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (while (let ((s5-0 (-> *display* base-frame-counter)) + (let ((gp-0 (current-time))) + (while (let ((s5-0 (current-time)) (f30-0 300.0) (f28-0 0.16) (f26-0 0.17000002) @@ -164,8 +164,8 @@ (suspend) (ja :num! (seek! (ja-aframe 0.0 0))) ) - (let ((gp-3 (-> *display* base-frame-counter))) - (while (let ((s5-1 (-> *display* base-frame-counter)) + (let ((gp-3 (current-time))) + (while (let ((s5-1 (current-time)) (f30-1 300.0) (f28-1 0.16) (f26-1 0.17000002) @@ -179,9 +179,9 @@ ) ) -(defmethod init-from-entity! assistant-villagec ((obj assistant-villagec) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-village3-sg* 3 31 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task assistant-village3))) - (process-taskable-method-42 obj) +(defmethod init-from-entity! assistant-villagec ((this assistant-villagec) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-village3-sg* 3 31 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task assistant-village3))) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village3/minecart.gc b/goal_src/jak1/levels/village3/minecart.gc index 0b0f3601b8..7e3378b51e 100644 --- a/goal_src/jak1/levels/village3/minecart.gc +++ b/goal_src/jak1/levels/village3/minecart.gc @@ -132,14 +132,14 @@ (go-virtual idle) ) -(defmethod init-from-entity! minecartsteel ((obj minecartsteel) (arg0 entity-actor)) +(defmethod init-from-entity! minecartsteel ((this minecartsteel) (arg0 entity-actor)) (dotimes (s4-0 4) (process-spawn minecartsteel :init minecartsteel-initialize-by-other arg0 (* 0.2 (the float (+ s4-0 1))) - :to obj + :to this ) ) (minecartsteel-initialize-by-other arg0 0.0) diff --git a/goal_src/jak1/levels/village3/miners.gc b/goal_src/jak1/levels/village3/miners.gc index d459001a9d..5396562161 100644 --- a/goal_src/jak1/levels/village3/miners.gc +++ b/goal_src/jak1/levels/village3/miners.gc @@ -40,10 +40,10 @@ :shadow minertall-shadow-mg ) -(defmethod process-taskable-method-52 minertall ((obj minertall)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 minertall ((this minertall)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -59,21 +59,21 @@ (none) ) -(defmethod draw-npc-shadow minertall ((obj minertall)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow minertall ((this minertall)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -82,22 +82,22 @@ (none) ) -(defmethod play-anim! minertall ((obj minertall) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (current-status (-> obj tasks)) +(defmethod play-anim! minertall ((this minertall) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (current-status (-> this tasks)) (if arg0 (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (the-as basic (-> obj draw art-group data 3)) + (the-as basic (-> this draw art-group data 3)) ) -(defmethod get-art-elem minertall ((obj minertall)) - (-> obj draw art-group data 3) +(defmethod get-art-elem minertall ((this minertall)) + (-> this draw art-group data 3) ) (defstate idle (minertall) @@ -109,11 +109,11 @@ :code miners-anim-loop ) -(defmethod init-from-entity! minertall ((obj minertall) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *minertall-sg* 32 47 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task village3-miner-money1))) - (set! (-> obj draw light-index) (the-as uint 1)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! minertall ((this minertall) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *minertall-sg* 32 47 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task village3-miner-money1))) + (set! (-> this draw light-index) (the-as uint 1)) + (process-taskable-method-42 this) (none) ) @@ -214,10 +214,10 @@ ) ) -(defmethod process-taskable-method-52 minershort ((obj minershort)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 minershort ((this minershort)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -233,21 +233,21 @@ (none) ) -(defmethod draw-npc-shadow minershort ((obj minershort)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow minershort ((this minershort)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -261,22 +261,22 @@ (none) ) -(defmethod play-anim! minershort ((obj minershort) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! minershort ((this minershort) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task village3-miner-money1)) (when arg0 - (let* ((s5-1 (-> obj tasks)) + (let* ((s5-1 (-> this tasks)) (s4-0 (method-of-object s5-1 save-reminder)) ) (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) (close-specific-task! (game-task village3-miner-money1) (task-status need-introduction)) (close-specific-task! (game-task village3-miner-money2) (task-status need-introduction)) (close-specific-task! (game-task village3-miner-money3) (task-status need-introduction)) @@ -301,13 +301,13 @@ ) (((game-task cave-gnawers)) (when arg0 - (let* ((s5-2 (-> obj tasks)) + (let* ((s5-2 (-> this tasks)) (s4-1 (method-of-object s5-2 save-reminder)) ) (s4-1 s5-2 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (close-status! (-> obj tasks) (task-status need-introduction)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "minershort-introduction-gnawers" @@ -326,8 +326,8 @@ ) (else (when arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (close-status! (-> obj tasks) (task-status need-introduction)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "minershort-introduction-switch" @@ -339,8 +339,8 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) + (set! (-> this skippable) #t) + (let ((s4-2 (+ (get-reminder (-> this tasks) 0) 1))) (if (< (the-as uint 3) (the-as uint s4-2)) (set! s4-2 0) ) @@ -381,7 +381,7 @@ ) ) (if arg0 - (save-reminder (-> obj tasks) s4-2 0) + (save-reminder (-> this tasks) s4-2 0) ) (cond ((zero? s4-2) @@ -389,19 +389,19 @@ ) ((= s4-2 1) (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "minershort-reminder-1-gnawers" :index 10 :parts 3 :command-list '()) ) ((= s4-2 2) (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "minershort-reminder-2-orbs" :index 6 :parts 2 :command-list '()) ) (else (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "minershort-reminder-1-switch" @@ -414,18 +414,18 @@ ) ) (((task-status need-reward-speech)) - (let ((s4-3 (get-reminder (-> obj tasks) 2))) + (let ((s4-3 (get-reminder (-> this tasks) 2))) (cond (arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) - (save-reminder (-> obj tasks) (+ s4-3 1) 2) + (save-reminder (-> this tasks) (+ s4-3 1) 2) ) (else - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this will-talk) #t) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (if (< (the-as uint s4-3) (the-as uint 3)) @@ -444,11 +444,11 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) @@ -461,100 +461,100 @@ ) ) -(defmethod get-art-elem minershort ((obj minershort)) - (-> obj draw art-group data 3) +(defmethod get-art-elem minershort ((this minershort)) + (-> this draw art-group data 3) ) -(defmethod process-taskable-method-43 minershort ((obj minershort)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 minershort ((this minershort)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.9655172 f0-2) - (play-ambient (-> obj ambient) "MIN-LO01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MIN-LO01" #f (-> this root-override trans)) ) ((< 0.9310345 f0-2) - (play-ambient (-> obj ambient) "MIN-LO03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MIN-LO03" #f (-> this root-override trans)) ) ((< 0.8965517 f0-2) - (play-ambient (-> obj ambient) "MIN-LO04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MIN-LO04" #f (-> this root-override trans)) ) ((< 0.86206895 f0-2) - (play-ambient (-> obj ambient) "MIN-LO05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MIN-LO05" #f (-> this root-override trans)) ) ((< 0.82758623 f0-2) - (play-ambient (-> obj ambient) "MIN-LO06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MIN-LO06" #f (-> this root-override trans)) ) ((< 0.79310346 f0-2) - (play-ambient (-> obj ambient) "MSH-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM01" #f (-> this root-override trans)) ) ((< 0.7586207 f0-2) - (play-ambient (-> obj ambient) "MSH-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM02" #f (-> this root-override trans)) ) ((< 0.7241379 f0-2) - (play-ambient (-> obj ambient) "MSH-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM03" #f (-> this root-override trans)) ) ((< 0.6896552 f0-2) - (play-ambient (-> obj ambient) "MSH-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM04" #f (-> this root-override trans)) ) ((< 0.6551724 f0-2) - (play-ambient (-> obj ambient) "MSH-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM05" #f (-> this root-override trans)) ) ((< 0.62068963 f0-2) - (play-ambient (-> obj ambient) "MSH-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM06" #f (-> this root-override trans)) ) ((< 0.5862069 f0-2) - (play-ambient (-> obj ambient) "MSH-AM07" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM07" #f (-> this root-override trans)) ) ((< 0.55172414 f0-2) - (play-ambient (-> obj ambient) "MSH-AM08" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM08" #f (-> this root-override trans)) ) ((< 0.51724136 f0-2) - (play-ambient (-> obj ambient) "MSH-AM09" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM09" #f (-> this root-override trans)) ) ((< 0.4827586 f0-2) - (play-ambient (-> obj ambient) "MSH-AM10" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM10" #f (-> this root-override trans)) ) ((< 0.44827586 f0-2) - (play-ambient (-> obj ambient) "MSH-AM11" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM11" #f (-> this root-override trans)) ) ((< 0.41379312 f0-2) - (play-ambient (-> obj ambient) "MSH-AM12" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM12" #f (-> this root-override trans)) ) ((< 0.37931034 f0-2) - (play-ambient (-> obj ambient) "MSH-AM1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM1A" #f (-> this root-override trans)) ) ((< 0.3448276 f0-2) - (play-ambient (-> obj ambient) "MSH-AM2A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM2A" #f (-> this root-override trans)) ) ((< 0.31034482 f0-2) - (play-ambient (-> obj ambient) "MSH-AM3A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM3A" #f (-> this root-override trans)) ) ((< 0.27586207 f0-2) - (play-ambient (-> obj ambient) "MTA-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM01" #f (-> this root-override trans)) ) ((< 0.2413793 f0-2) - (play-ambient (-> obj ambient) "MTA-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM02" #f (-> this root-override trans)) ) ((< 0.20689656 f0-2) - (play-ambient (-> obj ambient) "MTA-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM03" #f (-> this root-override trans)) ) ((< 0.1724138 f0-2) - (play-ambient (-> obj ambient) "MTA-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM04" #f (-> this root-override trans)) ) ((< 0.13793103 f0-2) - (play-ambient (-> obj ambient) "MTA-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM05" #f (-> this root-override trans)) ) ((< 0.10344828 f0-2) - (play-ambient (-> obj ambient) "MTA-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM06" #f (-> this root-override trans)) ) ((< 0.06896552 f0-2) - (play-ambient (-> obj ambient) "MTA-AM07" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM07" #f (-> this root-override trans)) ) ((< 0.03448276 f0-2) - (play-ambient (-> obj ambient) "MTA-AM08" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM08" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "MTA-AM09" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM09" #f (-> this root-override trans)) ) ) ) @@ -566,15 +566,15 @@ :code miners-anim-loop ) -(defmethod init-from-entity! minershort ((obj minershort) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *minershort-sg* 34 46 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 566) obj)) - (set! (-> obj tasks) (get-task-control (game-task village3-miner-money1))) - (set! (-> obj other-miner) (the-as minertall (entity-actor-lookup arg0 'alt-actor 0))) - (set! (-> obj cur-trans-hook) minershort-trans-hook) - (set! (-> obj sound-flava) (music-flava miners)) - (set! (-> obj draw light-index) (the-as uint 1)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! minershort ((this minershort) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *minershort-sg* 34 46 (new 'static 'vector :w 4096.0) 5) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 566) this)) + (set! (-> this tasks) (get-task-control (game-task village3-miner-money1))) + (set! (-> this other-miner) (the-as minertall (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this cur-trans-hook) minershort-trans-hook) + (set! (-> this sound-flava) (music-flava miners)) + (set! (-> this draw light-index) (the-as uint 1)) + (process-taskable-method-42 this) (none) ) @@ -609,10 +609,10 @@ :post ja-post ) -(defmethod init-from-entity! cavegem ((obj cavegem) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *cavegem-sg* '()) - (go (method-of-object obj idle)) +(defmethod init-from-entity! cavegem ((this cavegem) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *cavegem-sg* '()) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak1/levels/village3/sage-village3.gc b/goal_src/jak1/levels/village3/sage-village3.gc index 6b64fe94e6..746584e053 100644 --- a/goal_src/jak1/levels/village3/sage-village3.gc +++ b/goal_src/jak1/levels/village3/sage-village3.gc @@ -37,35 +37,35 @@ :shadow evilsis-village3-shadow-mg ) -(defmethod play-anim! sage-villagec ((obj sage-villagec) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk-to-sage)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! sage-villagec ((this sage-villagec) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk-to-sage)) + (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint) (task-status need-introduction)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task village3-button)) (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> obj assistant extra process) 'clone (process->handle obj)) - (set! (-> obj evilbro) + (close-status! (-> this tasks) (task-status need-introduction)) + (send-event (-> this assistant extra process) 'clone (process->handle this)) + (set! (-> this evilbro) (ppointer->handle - (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilbro-village3-sg* #f :to obj) + (manipy-spawn (-> this root-override trans) (-> this entity) *evilbro-village3-sg* #f :to this) ) ) - (send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilbro)) 'blend-shape #t) - (send-event (handle->process (-> obj evilbro)) 'center-joint 3) - (set! (-> obj evilsis) + (send-event (handle->process (-> this evilbro)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this evilbro)) 'blend-shape #t) + (send-event (handle->process (-> this evilbro)) 'center-joint 3) + (set! (-> this evilsis) (ppointer->handle - (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilsis-village3-sg* #f :to obj) + (manipy-spawn (-> this root-override trans) (-> this entity) *evilsis-village3-sg* #f :to this) ) ) - (send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilsis)) 'blend-shape #t) - (send-event (handle->process (-> obj evilsis)) 'center-joint 3) - (set! (-> obj draw bounds w) 40960.0) + (send-event (handle->process (-> this evilsis)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this evilsis)) 'blend-shape #t) + (send-event (handle->process (-> this evilsis)) 'center-joint 3) + (set! (-> this draw bounds w) 40960.0) ) (new 'static 'spool-anim :name "sage-village3-introduction" @@ -106,12 +106,12 @@ ) (((game-task cave-dark-crystals)) (when arg0 - (let* ((s5-3 (-> obj tasks)) + (let* ((s5-3 (-> this tasks)) (s4-0 (method-of-object s5-3 save-reminder)) ) (s4-0 s5-3 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "sage-village3-introduction-dark-eco" @@ -134,8 +134,8 @@ ) ) (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-1 (+ (get-reminder (-> obj tasks) 0) 1))) + (set! (-> this skippable) #t) + (let ((s4-1 (+ (get-reminder (-> this tasks) 0) 1))) (if (< (the-as uint 1) (the-as uint s4-1)) (set! s4-1 0) ) @@ -157,7 +157,7 @@ ) ) (if arg0 - (save-reminder (-> obj tasks) s4-1 0) + (save-reminder (-> this tasks) s4-1 0) ) (if (zero? s4-1) (new 'static 'spool-anim :name "sage-village3-reminder-1-dark-eco" :index 5 :parts 2 :command-list '()) @@ -170,56 +170,56 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) -(defmethod get-art-elem sage-villagec ((obj sage-villagec)) - (-> obj draw art-group data 3) +(defmethod get-art-elem sage-villagec ((this sage-villagec)) + (-> this draw art-group data 3) ) -(defmethod target-above-threshold? sage-villagec ((obj sage-villagec)) +(defmethod target-above-threshold? sage-villagec ((this sage-villagec)) (the-as symbol (and *target* (< (-> (target-pos 0) x) 4575232.0) (< -14323302.0 (-> (target-pos 0) z)))) ) -(defmethod process-taskable-method-43 sage-villagec ((obj sage-villagec)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 sage-villagec ((this sage-villagec)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.875 f0-2) - (play-ambient (-> obj ambient) "SAGELP31" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP31" #f (-> this root-override trans)) ) ((< 0.75 f0-2) - (if (not (closed? (-> obj tasks) (game-task cave-dark-crystals) (task-status need-reminder))) - (play-ambient (-> obj ambient) "SAGELP32" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task cave-dark-crystals) (task-status need-reminder))) + (play-ambient (-> this ambient) "SAGELP32" #f (-> this root-override trans)) ) ) ((< 0.625 f0-2) (if (nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> obj ambient) "SAGELP33" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP33" #f (-> this root-override trans)) ) ) ((< 0.5 f0-2) - (play-ambient (-> obj ambient) "SAGELP34" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP34" #f (-> this root-override trans)) ) ((< 0.375 f0-2) - (play-ambient (-> obj ambient) "SAGELP35" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP35" #f (-> this root-override trans)) ) ((< 0.25 f0-2) - (play-ambient (-> obj ambient) "SAGELP36" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP36" #f (-> this root-override trans)) ) ((< 0.125 f0-2) (if (nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> obj ambient) "SAGELP37" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP37" #f (-> this root-override trans)) ) ) ((!= (get-task-status (game-task citadel-sage-green)) (task-status need-resolution)) - (play-ambient (-> obj ambient) "SAGELP38" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP38" #f (-> this root-override trans)) ) ) ) @@ -257,14 +257,14 @@ ) ) -(defmethod should-display? sage-villagec ((obj sage-villagec)) +(defmethod should-display? sage-villagec ((this sage-villagec)) (cond - ((not (closed? (-> obj tasks) (game-task village3-button) (task-status need-hint))) - (process-taskable-method-33 obj) + ((not (closed? (-> this tasks) (game-task village3-button) (task-status need-hint))) + (process-taskable-method-33 this) #f ) ((sages-kidnapped?) - (process-taskable-method-33 obj) + (process-taskable-method-33 this) #f ) (else @@ -273,12 +273,12 @@ ) ) -(defmethod draw-npc-shadow sage-villagec ((obj sage-villagec)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod draw-npc-shadow sage-villagec ((this sage-villagec)) + (let ((v1-1 (-> this draw shadow-ctrl))) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) (logclear! (-> v1-1 settings flags) (shadow-flags shdf02)) @@ -298,13 +298,13 @@ (none) ) -(defmethod init-from-entity! sage-villagec ((obj sage-villagec) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sage-village3-sg* 3 40 (new 'static 'vector :w 8192.0) 5) - (set! (-> obj tasks) (get-task-control (game-task cave-dark-crystals))) - (set! (-> obj assistant) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj evilbro) (the-as handle #f)) - (set! (-> obj evilsis) (the-as handle #f)) - (set! (-> obj sound-flava) (music-flava sage)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! sage-villagec ((this sage-villagec) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sage-village3-sg* 3 40 (new 'static 'vector :w 8192.0) 5) + (set! (-> this tasks) (get-task-control (game-task cave-dark-crystals))) + (set! (-> this assistant) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this evilbro) (the-as handle #f)) + (set! (-> this evilsis) (the-as handle #f)) + (set! (-> this sound-flava) (music-flava sage)) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village3/village3-obs.gc b/goal_src/jak1/levels/village3/village3-obs.gc index 05e1d8c3b3..844e1016b8 100644 --- a/goal_src/jak1/levels/village3/village3-obs.gc +++ b/goal_src/jak1/levels/village3/village3-obs.gc @@ -52,18 +52,18 @@ ) ) -(defmethod water-vol-method-22 villagec-lava ((obj villagec-lava)) +(defmethod water-vol-method-22 villagec-lava ((this villagec-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) + (set! (-> this draw ripple) v1-2) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 waveform) ripple-for-villagec-lava) ) - (logclear! (-> obj flags) (water-flags wt23)) - (logior! (-> obj flags) (water-flags wt25)) - (set! (-> obj attack-event) 'lava) + (logclear! (-> this flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt25)) + (set! (-> this attack-event) 'lava) (none) ) @@ -93,7 +93,7 @@ (defstate idle (gondola) :virtual #t :code (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-channel-set! 1) (cond (arg0 @@ -144,7 +144,7 @@ (not (movie?)) (not (level-hint-displayed?)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) - ;; pc port note : fix gondola spool not loading because it's "too far away" (technically) + ;; og:preserve-this fix gondola spool not loading because it's "too far away" (technically) (#if (not PC_PORT) (file-status *art-control* (-> self anim name) 0) (begin @@ -321,9 +321,9 @@ :post (-> (method-of-type gondola ride-up) post) ) -(defmethod init-from-entity! gondola ((obj gondola) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! gondola ((this gondola) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -341,16 +341,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (quaternion-identity! (-> obj root-override quat)) - (initialize-skeleton obj *gondola-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj draw shadow-joint-index) (the-as uint 3)) - (set! (-> obj draw shadow-ctrl) (copy *target-shadow-control* 'process)) - (let ((a0-16 (-> obj draw shadow-ctrl))) + (process-drawable-from-entity! this arg0) + (quaternion-identity! (-> this root-override quat)) + (initialize-skeleton this *gondola-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw shadow-joint-index) (the-as uint 3)) + (set! (-> this draw shadow-ctrl) (copy *target-shadow-control* 'process)) + (let ((a0-16 (-> this draw shadow-ctrl))) (when a0-16 (let ((v1-32 a0-16)) (set! (-> v1-32 settings bot-plane w) (- -122880.0)) @@ -364,12 +364,12 @@ ) ) (cond - ((< (-> (target-pos 0) y) (+ 204800.0 (-> obj root-override trans y))) - (go (method-of-object obj idle) #f) + ((< (-> (target-pos 0) y) (+ 204800.0 (-> this root-override trans y))) + (go (method-of-object this idle) #f) ) (else - (set! (-> obj anim) (new 'static 'spool-anim :name "gondola-ride-down" :index 6 :parts 3 :command-list '())) - (go (method-of-object obj idle) #t) + (set! (-> this anim) (new 'static 'spool-anim :name "gondola-ride-down" :index 6 :parts 3 :command-list '())) + (go (method-of-object this idle) #t) ) ) (none) @@ -424,28 +424,28 @@ ) ) (loop - (set! f30-0 (seek f30-0 1.0 (* 0.2 (-> *display* seconds-per-frame)))) + (set! f30-0 (seek f30-0 1.0 (* 0.2 (seconds-per-frame)))) (ja :num! (loop! f30-0)) (ja-post) (update! (-> self sound)) (suspend) ) ) - ;; decompiler never gets here and fails hard + ;; og:preserve-this decompiler never gets here and fails hard (go-virtual idle) ) ) -(defmethod init-from-entity! pistons ((obj pistons) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *pistons-sg* '()) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "gdl-gen-loop" :fo-max 100) (-> obj root trans)) +(defmethod init-from-entity! pistons ((this pistons) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *pistons-sg* '()) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "gdl-gen-loop" :fo-max 100) (-> this root trans)) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (go (method-of-object obj active) (the-as handle #f) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (go (method-of-object this active) (the-as handle #f) #t) + (go (method-of-object this idle)) ) (none) ) @@ -492,19 +492,19 @@ :post ja-post ) -(defmethod init-from-entity! gondolacables ((obj gondolacables) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *gondolacables-sg* '()) - (set! (-> obj draw mgeo effect 0 effect-bits) +(defmethod init-from-entity! gondolacables ((this gondolacables) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *gondolacables-sg* '()) + (set! (-> this draw mgeo effect 0 effect-bits) (the-as uint - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) 1 0 ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak1/levels/village_common/oracle.gc b/goal_src/jak1/levels/village_common/oracle.gc index 7bbd77bda7..107cc66b1e 100644 --- a/goal_src/jak1/levels/village_common/oracle.gc +++ b/goal_src/jak1/levels/village_common/oracle.gc @@ -25,13 +25,13 @@ :bounds (static-spherem 0 0 0 4) ) -(defmethod play-anim! oracle ((obj oracle) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! oracle ((this oracle) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 - (close-specific-task! (the-as game-task (-> obj first-task)) (task-status need-introduction)) - (close-specific-task! (the-as game-task (-> obj second-task)) (task-status need-introduction)) + (close-specific-task! (the-as game-task (-> this first-task)) (task-status need-introduction)) + (close-specific-task! (the-as game-task (-> this second-task)) (task-status need-introduction)) ) (case (-> (level-get-target-inside *level*) name) (('village1) @@ -133,7 +133,7 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (case (-> (level-get-target-inside *level*) name) (('village1) (new 'static 'spool-anim :name "oracle-reminder-1" :index 10 :parts 4 :command-list '()) @@ -149,19 +149,19 @@ (((task-status need-reward-speech)) (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-oracle-inc))) (cond - ((= (current-task (-> obj tasks)) (-> obj first-task)) - (let ((a0-25 (handle->process (-> obj right-eye-cell)))) + ((= (current-task (-> this tasks)) (-> this first-task)) + (let ((a0-25 (handle->process (-> this right-eye-cell)))) (if a0-25 (deactivate a0-25) ) ) ) (else - (let ((a0-29 (handle->process (-> obj left-eye-cell)))) + (let ((a0-29 (handle->process (-> this left-eye-cell)))) (if a0-29 (deactivate a0-29) ) @@ -170,12 +170,12 @@ ) ) (else - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (text-id press-to-trade-money-oracle)) + (set! (-> this will-talk) #t) + (set! (-> this talk-message) (text-id press-to-trade-money-oracle)) ) ) (cond - ((= (current-task (-> obj tasks)) (-> obj first-task)) + ((= (current-task (-> this tasks)) (-> this first-task)) (case (-> (level-get-target-inside *level*) name) (('village1) (new 'static 'spool-anim :name "oracle-right-eye-1" :index 3 :parts 2 :command-list '()) @@ -208,17 +208,17 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 2) + (-> this draw art-group data 2) ) ) ) -(defmethod get-art-elem oracle ((obj oracle)) - (-> obj draw art-group data 2) +(defmethod get-art-elem oracle ((this oracle)) + (-> this draw art-group data 2) ) (defstate idle (oracle) @@ -233,17 +233,17 @@ ) ) -(defmethod init-from-entity! oracle ((obj oracle) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *oracle-sg* 3 4 (new 'static 'vector :y -4096.0 :w 4096.0) -1) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "oracle-sleep" :fo-max 50) (-> obj root-override trans)) +(defmethod init-from-entity! oracle ((this oracle) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *oracle-sg* 3 4 (new 'static 'vector :y -4096.0 :w 4096.0) -1) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "oracle-sleep" :fo-max 50) (-> this root-override trans)) ) - (set! (-> obj first-task) (the-as uint (-> arg0 extra perm task))) - (set! (-> obj second-task) (res-lump-value arg0 'alt-task uint)) - (set! (-> obj tasks) (get-task-control (the-as game-task (-> obj first-task)))) - (set! (-> obj right-eye-cell) (the-as handle #f)) - (set! (-> obj left-eye-cell) (the-as handle #f)) - (logior! (-> obj draw status) (draw-status skip-bones)) + (set! (-> this first-task) (the-as uint (-> arg0 extra perm task))) + (set! (-> this second-task) (res-lump-value arg0 'alt-task uint)) + (set! (-> this tasks) (get-task-control (the-as game-task (-> this first-task)))) + (set! (-> this right-eye-cell) (the-as handle #f)) + (set! (-> this left-eye-cell) (the-as handle #f)) + (logior! (-> this draw status) (draw-status skip-bones)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-1 (lambda :behavior oracle () @@ -266,13 +266,15 @@ ) ) (ja-post) - (when (not (task-closed? (the-as game-task (-> obj first-task)) (task-status need-resolution))) - (vector<-cspace! s4-0 (-> obj node-list data 5)) - (set! (-> obj right-eye-cell) - (ppointer->handle (manipy-spawn s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to obj)) + (when (not (task-closed? (the-as game-task (-> this first-task)) (task-status need-resolution))) + (vector<-cspace! s4-0 (-> this node-list data 5)) + (set! (-> this right-eye-cell) + (ppointer->handle + (manipy-spawn s4-0 (-> this entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to this) + ) ) (send-event - (handle->process (-> obj right-eye-cell)) + (handle->process (-> this right-eye-cell)) 'eval (lambda :behavior oracle () (let ((v0-0 (create-launch-control (-> *part-group-id-table* 63) self))) (set! (-> self part) v0-0) @@ -280,15 +282,17 @@ ) ) ) - (send-event (handle->process (-> obj right-eye-cell)) 'trans-hook s5-1) + (send-event (handle->process (-> this right-eye-cell)) 'trans-hook s5-1) ) - (when (not (task-closed? (the-as game-task (-> obj second-task)) (task-status need-resolution))) - (vector<-cspace! s4-0 (-> obj node-list data 6)) - (set! (-> obj left-eye-cell) - (ppointer->handle (manipy-spawn s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to obj)) + (when (not (task-closed? (the-as game-task (-> this second-task)) (task-status need-resolution))) + (vector<-cspace! s4-0 (-> this node-list data 6)) + (set! (-> this left-eye-cell) + (ppointer->handle + (manipy-spawn s4-0 (-> this entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to this) + ) ) (send-event - (handle->process (-> obj left-eye-cell)) + (handle->process (-> this left-eye-cell)) 'eval (lambda :behavior oracle () (let ((v0-0 (create-launch-control (-> *part-group-id-table* 63) self))) (set! (-> self part) v0-0) @@ -296,9 +300,9 @@ ) ) ) - (send-event (handle->process (-> obj left-eye-cell)) 'trans-hook s5-1) + (send-event (handle->process (-> this left-eye-cell)) 'trans-hook s5-1) ) ) - (process-taskable-method-42 obj) + (process-taskable-method-42 this) (none) ) diff --git a/goal_src/jak1/levels/village_common/villagep-obs.gc b/goal_src/jak1/levels/village_common/villagep-obs.gc index 5fe6e0cdc1..9a52803175 100644 --- a/goal_src/jak1/levels/village_common/villagep-obs.gc +++ b/goal_src/jak1/levels/village_common/villagep-obs.gc @@ -37,8 +37,8 @@ (ja-channel-set! 0) (vector-reset! (-> self control transv)) (move-to-point! (-> self control) (-> self control unknown-vector102)) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -64,7 +64,7 @@ ) (set-heading-vec! (-> self control) (-> self control transv)) (rot->dir-targ! (-> self control)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self post-hook) target-no-stick-post) (ja-channel-set! 1) (send-event self 'do-effect 'death-warp-in -1.0) @@ -99,7 +99,7 @@ ) :code (behavior () (remove-setting! 'allow-progress) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (>= (-> self level-slot) 0) @@ -124,14 +124,14 @@ (can-grab-display? self) (cond ((or (= (-> *target* next-state name) 'target-warp-in) (= (-> *target* next-state name) 'target-warp-out)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) (else #t ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (if (and (cpad-pressed? 0 circle) (process-grab? *target*)) (go-virtual active) @@ -220,11 +220,11 @@ (set-setting! 'allow-progress #f 0.0 0) (apply-settings *setting-control*) (sound-play "start-options") - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (when (or (and (cpad-pressed? 0 triangle) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) (process-release? *target*) ) (not *target*) @@ -245,7 +245,7 @@ (send-event *target* 'rotate-y-angle - (fmax (fmin f0-0 (* 65536.0 (-> *display* seconds-per-frame))) (* -65536.0 (-> *display* seconds-per-frame))) + (fmax (fmin f0-0 (* 65536.0 (seconds-per-frame))) (* -65536.0 (seconds-per-frame))) ) ) ) @@ -289,7 +289,7 @@ (hide-hud) (let ((s1-2 (get-continue-by-name *game-info* (-> *warp-info* gp-0)))) (lookup-level-info (-> s1-2 level)) - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) (cpad-pressed? 0 circle)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.05)) (cpad-pressed? 0 circle)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (go-virtual use gp-0 (the-as level s1-2)) @@ -461,8 +461,8 @@ :bounds (static-spherem 0 0 0 1.5) ) -(defmethod basebutton-method-27 warp-gate-switch ((obj warp-gate-switch)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod basebutton-method-27 warp-gate-switch ((this warp-gate-switch)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -487,13 +487,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) s5-0 ) ) -(defmethod pressable? warp-gate-switch ((obj warp-gate-switch)) - (let ((v1-2 (-> obj entity extra perm task))) +(defmethod pressable? warp-gate-switch ((this warp-gate-switch)) + (let ((v1-2 (-> this entity extra perm task))) (cond ((logtest? (-> *target* control root-prim prim-core action) (collide-action edgegrab-cam swingpole-active racer snowball tube flut) @@ -528,62 +528,62 @@ ) ) -(defmethod basebutton-method-26 warp-gate-switch ((obj warp-gate-switch)) - (set! (-> obj warp) (the-as handle #f)) - (let ((v1-2 (-> obj entity extra perm task))) +(defmethod basebutton-method-26 warp-gate-switch ((this warp-gate-switch)) + (set! (-> this warp) (the-as handle #f)) + (let ((v1-2 (-> this entity extra perm task))) (cond ((= v1-2 (game-task training-door)) - (set! (-> obj down?) + (set! (-> this down?) (the-as symbol - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) ) ) ) (else - (if (or (= v1-2 (game-task none)) (task-closed? (-> obj entity extra perm task) (task-status need-hint))) - (set! (-> obj down?) #t) + (if (or (= v1-2 (game-task none)) (task-closed? (-> this entity extra perm task) (task-status need-hint))) + (set! (-> this down?) #t) ) ) ) ) - (initialize-skeleton obj *warp-gate-switch-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (initialize-skeleton this *warp-gate-switch-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) (cond - ((-> obj down?) - (let ((s5-0 (-> obj skel root-channel 0))) + ((-> this down?) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) ) (else - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) ) ) - (set! (-> obj anim-speed) 2.0) - (update-transforms! (-> obj root-override)) + (set! (-> this anim-speed) 2.0) + (update-transforms! (-> this root-override)) (ja-post) (none) ) -(defmethod press! warp-gate-switch ((obj warp-gate-switch) (arg0 symbol)) +(defmethod press! warp-gate-switch ((this warp-gate-switch) (arg0 symbol)) (with-pp (when arg0 - (let ((s4-0 (-> obj entity extra perm task))) + (let ((s4-0 (-> this entity extra perm task))) (when (nonzero? s4-0) (close-specific-task! s4-0 (task-status need-hint)) (when (= s4-0 (game-task village3-button)) @@ -603,7 +603,7 @@ (set! (-> a1-5 num-params) 0) (set! (-> a1-5 message) 'start) (let ((t9-5 send-event-function) - (v1-14 (-> obj notify-actor)) + (v1-14 (-> this notify-actor)) ) (t9-5 (if v1-14 @@ -622,7 +622,7 @@ ;; a more severe memory corruption problem. So we fix it. (the-as int ((the-as (function basebutton symbol none) (find-parent-method warp-gate-switch 31)) ;;(the-as basebutton arg0) - obj + this arg0 ) ) @@ -648,7 +648,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((t9-0 (-> (method-of-type basebutton basebutton-up-idle) enter))) (if t9-0 (t9-0) @@ -671,7 +671,7 @@ ) ) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 60)) + (when (time-elapsed? (-> self state-time) (seconds 60)) (case (-> self entity extra perm task) (((game-task training-door)) (when (and (task-complete? *game-info* (game-task training-door)) @@ -736,7 +736,7 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (let ((t9-13 (-> (method-of-type basebutton basebutton-up-idle) trans))) (if t9-13 @@ -759,7 +759,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self warp) (ppointer->handle (process-spawn warp-gate (-> self notify-actor extra trans) :to self))) (process-entity-status! self (entity-perm-status complete) #t) (let ((t9-4 (-> (method-of-type basebutton basebutton-down-idle) enter))) @@ -781,7 +781,7 @@ ) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 60)) + (when (time-elapsed? (-> self state-time) (seconds 60)) (case (-> self entity extra perm task) (((game-task training-door)) (when (not (task-closed? (game-task beach-ecorocks) (task-status need-introduction))) @@ -796,7 +796,7 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (let ((t9-3 (-> (method-of-type basebutton basebutton-down-idle) trans))) (if t9-3 @@ -871,11 +871,11 @@ ) -(defmethod relocate village-cam ((obj village-cam) (arg0 int)) - (if (nonzero? (-> obj root-override)) - (&+! (-> obj root-override) arg0) +(defmethod relocate village-cam ((this village-cam) (arg0 int)) + (if (nonzero? (-> this root-override)) + (&+! (-> this root-override) arg0) ) - (the-as village-cam ((method-of-type process relocate) obj arg0)) + (the-as village-cam ((method-of-type process relocate) this arg0)) ) (defstate idle (village-cam) @@ -947,7 +947,7 @@ ) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-grab? *target*) (process-entity-status! self (entity-perm-status bit-3) #t) (kill-current-level-hint '(ambient) '() 'exit) @@ -979,7 +979,7 @@ ) (suspend) ) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (suspend) ) (kill-current-level-hint '() '() 'die) @@ -1107,8 +1107,8 @@ (let ((a0-70 (-> self entity extra perm))) (when (= (-> a0-70 user-uint8 0) 1) (remove-setting! 'allow-progress) - (let ((gp-3 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-3) (seconds 300)) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 300)) (suspend) ) ) @@ -1126,15 +1126,15 @@ ) ) -(defmethod init-from-entity! village-cam ((obj village-cam) (arg0 entity-actor)) +(defmethod init-from-entity! village-cam ((this village-cam) (arg0 entity-actor)) "Copy defaults from the entity." - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj root-override) (new 'process 'trsq)) - (set! (-> obj root-override trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root-override quat) (-> arg0 quat)) - (vector-identity! (-> obj root-override scale)) - (set! (-> obj range) (res-lump-float arg0 'cam-notice-dist :default 81920.0)) - (set! (-> obj index) (res-lump-value arg0 'index int)) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this root-override) (new 'process 'trsq)) + (set! (-> this root-override trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root-override quat) (-> arg0 quat)) + (vector-identity! (-> this root-override scale)) + (set! (-> this range) (res-lump-float arg0 'cam-notice-dist :default 81920.0)) + (set! (-> this index) (res-lump-value arg0 'index int)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/engine/ai/enemy-h.gc b/goal_src/jak2/engine/ai/enemy-h.gc index 4c0956b1fd..12ebe62492 100644 --- a/goal_src/jak2/engine/ai/enemy-h.gc +++ b/goal_src/jak2/engine/ai/enemy-h.gc @@ -432,13 +432,13 @@ ) -(defmethod try-update-focus enemy-focus ((obj enemy-focus) (arg0 process-focusable) (arg1 enemy)) +(defmethod try-update-focus enemy-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy)) (let* ((t9-0 (method-of-type focus try-update-focus)) - (s3-0 (t9-0 obj arg0)) + (s3-0 (t9-0 this arg0)) ) (when (not s3-0) - (logclear! (-> obj flags) (enemy-flag lock-focus)) - (set! (-> obj aware) + (logclear! (-> this flags) (enemy-flag lock-focus)) + (set! (-> this aware) (the-as enemy-aware (enemy-method-61 arg1 (the-as int (update-target-awareness! arg1 arg0 (the-as enemy-best-focus #f)))) @@ -449,24 +449,24 @@ ) ) -(defmethod enemy-focus-method-13 enemy-focus ((obj enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-focus-method-13 enemy-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) (let* ((t9-0 (method-of-type focus try-update-focus)) - (v0-0 (t9-0 obj arg0)) + (v0-0 (t9-0 this arg0)) ) - (set! (-> obj aware) arg1) + (set! (-> this aware) arg1) (if (not v0-0) - (logclear! (-> obj flags) (enemy-flag lock-focus)) + (logclear! (-> this flags) (enemy-flag lock-focus)) ) v0-0 ) ) ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod clear-focused enemy-focus ((obj enemy-focus)) +(defmethod clear-focused enemy-focus ((this enemy-focus)) (let ((t9-0 (method-of-type focus clear-focused))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj aware) (enemy-aware enemy-aware-0)) - (logclear! (-> obj flags) (enemy-flag lock-focus)) + (set! (-> this aware) (enemy-aware enemy-aware-0)) + (logclear! (-> this flags) (enemy-flag lock-focus)) (none) ) diff --git a/goal_src/jak2/engine/ai/enemy.gc b/goal_src/jak2/engine/ai/enemy.gc index db365916a6..81212b5825 100644 --- a/goal_src/jak2/engine/ai/enemy.gc +++ b/goal_src/jak2/engine/ai/enemy.gc @@ -7,9 +7,9 @@ ;; DECOMP BEGINS -(defmethod copy-enemy-info! enemy-info ((obj enemy-info) (obj-to-copy enemy-info)) +(defmethod copy-enemy-info! enemy-info ((this enemy-info) (obj-to-copy enemy-info)) "Copies the given [[enemy-info]] into the current [[enemy-info]]" - (mem-copy! (&-> obj type) (&-> obj-to-copy type) 384) + (mem-copy! (&-> this type) (&-> obj-to-copy type) 384) 0 (none) ) @@ -25,43 +25,43 @@ ) ;; WARN: Return type mismatch process-focusable vs enemy. -(defmethod relocate enemy ((obj enemy) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method enemy 7)) this arg0) ) ) -(defmethod get-rand-float enemy ((obj enemy)) +(defmethod get-rand-float enemy ((this enemy)) "@returns the result of calling [[rand-vu]]" (rand-vu) ) -(defmethod get-rand-float-range enemy ((obj enemy) (low float) (high float)) +(defmethod get-rand-float-range enemy ((this enemy) (low float) (high float)) "@param low The lower bound of the range (inclusive) @param high The upper bound of the range (exclusive) @returns A random float in the specified range" (+ low (* (rand-vu) (- high low))) ) -(defmethod get-rand-int enemy ((obj enemy) (high int)) +(defmethod get-rand-int enemy ((this enemy) (high int)) "@param high The upper bound of the range (exclusive) @returns a random integer in the range 0 to `high` @see [[rand-vu]]" (the int (* (rand-vu) (the float high))) ) -(defmethod get-rand-int-range enemy ((obj enemy) (low int) (high int)) +(defmethod get-rand-int-range enemy ((this enemy) (low int) (high int)) "@param low The lower bound of the range (inclusive) @param high The upper bound of the range (exclusive) @returns A random integer in the specified range" (+ low (the int (* (rand-vu) (the float (+ (- 1 low) high))))) ) -(defmethod rng-hit? enemy ((obj enemy) (chance float)) +(defmethod rng-hit? enemy ((this enemy) (chance float)) "TODO - not the best name @param chance The value to compare ([[>=]]) with the result from [[rand-vu]]. @returns If `chance` is greater than the random draw" @@ -69,7 +69,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod enemy-method-120 enemy ((obj enemy) (arg0 int) (arg1 int)) +(defmethod enemy-method-120 enemy ((this enemy) (arg0 int) (arg1 int)) "TODO" (let ((v1-0 0) (s5-0 0) @@ -84,7 +84,7 @@ ) ) (when (> v1-0 0) - (let ((v1-1 (get-rand-int obj v1-0)) + (let ((v1-1 (get-rand-int this v1-0)) (a0-1 1) ) (until #f @@ -109,7 +109,7 @@ ) ) -(defmethod enemy-method-123 enemy ((obj enemy) (arg0 float)) +(defmethod enemy-method-123 enemy ((this enemy) (arg0 float)) "TODO" (let* ((v1-5 (-> *display* frames (-> *display* last-screen) run-time)) (f1-2 (fmax 0.0 (fmin 1.0 (* 0.001 (+ -7000.0 (the float v1-5)))))) @@ -118,25 +118,25 @@ ) ) -(defmethod coin-flip? enemy ((obj enemy)) +(defmethod coin-flip? enemy ((this enemy)) "@returns The result of a 50/50 RNG roll" - (zero? (get-rand-int obj 2)) + (zero? (get-rand-int this 2)) ) ;; WARN: disable def twice: 40. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod run-logic? enemy ((obj enemy)) +(defmethod run-logic? enemy ((this enemy)) (cond - ((logtest? (-> obj mask) (process-mask actor-pause)) - (let ((draw (-> obj draw))) + ((logtest? (-> this mask) (process-mask actor-pause)) + (let ((draw (-> this draw))) (or (and (nonzero? draw) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (camera-pos)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (camera-pos)) ) (or (logtest? (-> draw status) (draw-control-status on-screen)) - (not (and (-> obj next-state) (= (-> obj next-state name) 'idle))) + (not (and (-> this next-state) (= (-> this next-state name) 'idle))) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) (and (nonzero? draw) (logtest? (-> draw status) (draw-control-status uninited))) ) ) @@ -148,14 +148,14 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-53 enemy ((obj enemy) (proc-focus process-focusable)) +(defmethod enemy-method-53 enemy ((this enemy) (proc-focus process-focusable)) "TODO" - (the-as symbol (and proc-focus (!= obj proc-focus) (collide-check? (-> obj focus) proc-focus))) + (the-as symbol (and proc-focus (!= this proc-focus) (collide-check? (-> this focus) proc-focus))) ) -(defmethod get-trans enemy ((obj enemy) (arg0 int)) +(defmethod get-trans enemy ((this enemy) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((s4-0 (-> obj root))) + (let ((s4-0 (-> this root))) (cond ((zero? arg0) (-> s4-0 trans) @@ -164,11 +164,11 @@ (-> s4-0 gspot-pos) ) ((= arg0 2) - (vector<-cspace! (new 'static 'vector) (-> obj node-list data (-> obj enemy-info look-at-joint))) + (vector<-cspace! (new 'static 'vector) (-> this node-list data (-> this enemy-info look-at-joint))) ) ((= arg0 3) - (let ((v0-0 (vector<-cspace! (new 'static 'vector) (-> obj node-list data (-> obj enemy-info bullseye-joint))))) - (set! (-> v0-0 w) (-> obj root root-prim prim-core world-sphere w)) + (let ((v0-0 (vector<-cspace! (new 'static 'vector) (-> this node-list data (-> this enemy-info bullseye-joint))))) + (set! (-> v0-0 w) (-> this root root-prim prim-core world-sphere w)) v0-0 ) ) @@ -179,42 +179,42 @@ ) ) -(defmethod enemy-method-124 enemy ((obj enemy)) +(defmethod enemy-method-124 enemy ((this enemy)) "TODO" - (let* ((v1-0 (-> obj enemy-info)) - (v0-0 (if (logtest? (enemy-flag use-trigger) (-> obj enemy-flags)) + (let* ((v1-0 (-> this enemy-info)) + (v0-0 (if (logtest? (enemy-flag use-trigger) (-> this enemy-flags)) (-> v1-0 recover-gnd-collide-with) (-> v1-0 gnd-collide-with) ) ) ) - (set! (-> obj gnd-collide) (the-as uint v0-0)) + (set! (-> this gnd-collide) (the-as uint v0-0)) v0-0 ) ) -(defmethod get-penetrate-info enemy ((obj enemy)) +(defmethod get-penetrate-info enemy ((this enemy)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" - (penetrated-by-all&hit-points->penetrated-by (-> obj penetrated-by-all) (-> obj hit-points)) + (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (-> this hit-points)) ) -(defmethod get-water-height enemy ((obj enemy)) - (-> obj water-surface-height) +(defmethod get-water-height enemy ((this enemy)) + (-> this water-surface-height) ) -(defmethod enemy-method-54 enemy ((obj enemy)) - (let ((s4-0 (-> obj root))) - (when (>= (-> obj water-max-height) (-> s4-0 trans y)) +(defmethod enemy-method-54 enemy ((this enemy)) + (let ((s4-0 (-> this root))) + (when (>= (-> this water-max-height) (-> s4-0 trans y)) (let ((s5-0 (new 'stack-no-clear 'water-info))) (water-info-init! s4-0 s5-0 (collide-action solid semi-solid)) (let ((s3-0 (-> s5-0 flags))) (when (logtest? (water-flags touch-water) s3-0) - (logior! (-> obj enemy-flags) (enemy-flag directed-ready)) - (set! (-> obj water-surface-height) (-> s5-0 trans y)) - (when (not (focus-test? obj touch-water under-water)) + (logior! (-> this enemy-flags) (enemy-flag directed-ready)) + (set! (-> this water-surface-height) (-> s5-0 trans y)) + (when (not (focus-test? this touch-water under-water)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> obj root trans quad)) + (set! (-> s2-0 quad) (-> this root trans quad)) (set! (-> s2-0 y) (+ 409.6 (-> s5-0 trans y))) (let ((s1-0 (get-process *default-dead-pool* part-tracker #x4000))) (when s1-0 @@ -255,23 +255,23 @@ (cond ((logtest? s3-0 (water-flags dark-eco)) (sound-play "eco-splash") - (send-event obj 'instant-death) + (send-event this 'instant-death) ) (else (sound-play "splash") ) ) ) - (logior! (-> obj focus-status) (focus-status touch-water)) + (logior! (-> this focus-status) (focus-status touch-water)) (let* ((v1-32 (-> s4-0 root-prim prim-core)) (f0-5 (+ (-> v1-32 world-sphere y) (-> v1-32 world-sphere w))) ) - (if (focus-test? obj under-water) + (if (focus-test? this under-water) (set! f0-5 (+ -819.2 f0-5)) ) (if (< f0-5 (-> s5-0 trans y)) - (logior! (-> obj focus-status) (focus-status under-water)) - (logclear! (-> obj focus-status) (focus-status under-water)) + (logior! (-> this focus-status) (focus-status under-water)) + (logclear! (-> this focus-status) (focus-status under-water)) ) ) (return (the-as enemy-flag #f)) @@ -280,10 +280,10 @@ ) ) ) - (logclear! (-> obj focus-status) (focus-status touch-water under-water)) - (when (not (logtest? (enemy-flag use-trigger) (-> obj enemy-flags))) - (let ((v0-9 (logclear (-> obj enemy-flags) (enemy-flag directed-ready)))) - (set! (-> obj enemy-flags) v0-9) + (logclear! (-> this focus-status) (focus-status touch-water under-water)) + (when (not (logtest? (enemy-flag use-trigger) (-> this enemy-flags))) + (let ((v0-9 (logclear (-> this enemy-flags) (enemy-flag directed-ready)))) + (set! (-> this enemy-flags) v0-9) v0-9 ) ) @@ -295,7 +295,7 @@ - looks at the target and handles attacking @TODO Not extremely well understood yet" (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) (if (logtest? (enemy-flag use-trigger) (-> self enemy-flags)) @@ -318,7 +318,7 @@ ) ) (when (and (logtest? (-> self enemy-flags) (enemy-flag attackable-backup)) - (>= (- (current-time) (-> self auto-reset-penetrate-time)) (seconds 0.1)) + (time-elapsed? (-> self auto-reset-penetrate-time) (seconds 0.1)) ) (logclear! (-> self enemy-flags) (enemy-flag attackable-backup)) (set! (-> self root penetrated-by) (get-penetrate-info self)) @@ -343,17 +343,17 @@ (none) ) -(defmethod enemy-method-136 enemy ((obj enemy)) - (when (or (>= (- (current-time) (-> obj hit-focus-time)) (seconds 2)) - (and (handle->process (-> obj focus handle)) - (not (logtest? (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) +(defmethod enemy-method-136 enemy ((this enemy)) + (when (or (time-elapsed? (-> this hit-focus-time) (seconds 2)) + (and (handle->process (-> this focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) ) ) ) - (let ((v0-0 (logclear (-> obj enemy-flags) (enemy-flag look-at-focus)))) - (set! (-> obj enemy-flags) v0-0) + (let ((v0-0 (logclear (-> this enemy-flags) (enemy-flag look-at-focus)))) + (set! (-> this enemy-flags) v0-0) v0-0 ) ) @@ -389,9 +389,9 @@ ) ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target enemy ((obj enemy)) +(defmethod get-enemy-target enemy ((this enemy)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" - (let ((v0-0 (handle->process (-> obj focus handle)))) + (let ((v0-0 (handle->process (-> this focus handle)))) (if (and v0-0 (not (and v0-0 (not (logtest? (-> (the-as process-focusable v0-0) focus-status) (focus-status disable dead ignore grabbed))) @@ -404,24 +404,24 @@ ) ) -(defmethod enemy-method-63 enemy ((obj enemy) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 enemy ((this enemy) (arg0 process-focusable) (arg1 enemy-aware)) (if arg1 - (enemy-focus-method-13 (-> obj focus) arg0 arg1) - (try-update-focus (-> obj focus) arg0 obj) + (enemy-focus-method-13 (-> this focus) arg0 arg1) + (try-update-focus (-> this focus) arg0 this) ) ) -(defmethod enemy-method-62 enemy ((obj enemy)) - (when (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (let* ((s4-0 (handle->process (-> obj incoming attacker-handle))) +(defmethod enemy-method-62 enemy ((this enemy)) + (when (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) + (let* ((s4-0 (handle->process (-> this incoming attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) ) - (when (enemy-method-53 obj (the-as process-focusable s5-0)) - (enemy-method-63 obj (the-as process-focusable s5-0) (the-as enemy-aware #f)) - (logior! (-> obj focus flags) (enemy-flag lock-focus)) + (when (enemy-method-53 this (the-as process-focusable s5-0)) + (enemy-method-63 this (the-as process-focusable s5-0) (the-as enemy-aware #f)) + (logior! (-> this focus flags) (enemy-flag lock-focus)) ) ) ) @@ -429,17 +429,19 @@ (none) ) -(defmethod enemy-method-108 enemy ((obj enemy) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 enemy ((this enemy) (arg0 enemy) (arg1 event-message-block)) (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) (when (and s4-0 - (and (logtest? (-> obj incoming penetrate-using) 4096) (not (logtest? (-> obj incoming penetrate-using) 32))) + (and (logtest? (-> this incoming penetrate-using) 4096) + (not (logtest? (-> this incoming penetrate-using) 32)) + ) (begin (let ((s3-0 (-> s4-0 head))) (while s3-0 (let ((s2-0 (get-touched-prim s3-0 (-> arg0 root) s4-0))) - (get-touched-prim s3-0 (-> obj root) s4-0) + (get-touched-prim s3-0 (-> this root) s4-0) (when (logtest? (-> s2-0 prim-core action) (collide-action solid semi-solid deadly)) - (let* ((a0-5 obj) + (let* ((a0-5 this) (t9-2 (method-of-object a0-5 enemy-method-104)) (a1-3 arg0) (a2-3 s4-0) @@ -465,104 +467,104 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-64 enemy ((obj enemy)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod enemy-method-64 enemy ((this enemy)) + (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) ) 0 - (logior! (-> obj draw status) (draw-control-status no-draw)) - (logior! (-> obj focus-status) (focus-status disable)) - (go (method-of-object obj dormant)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (logior! (-> this focus-status) (focus-status disable)) + (go (method-of-object this dormant)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-65 enemy ((obj enemy)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod enemy-method-65 enemy ((this enemy)) + (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) ) 0 - (logior! (-> obj draw status) (draw-control-status no-draw)) - (logior! (-> obj focus-status) (focus-status disable)) - (go (method-of-object obj dormant-aware)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (logior! (-> this focus-status) (focus-status disable)) + (go (method-of-object this dormant-aware)) (none) ) -(defmethod go-stare enemy ((obj enemy)) - (go (method-of-object obj stare)) +(defmethod go-stare enemy ((this enemy)) + (go (method-of-object this stare)) ) -(defmethod go-stare2 enemy ((obj enemy)) - (go (method-of-object obj stare)) +(defmethod go-stare2 enemy ((this enemy)) + (go (method-of-object this stare)) ) -(defmethod go-hostile enemy ((obj enemy)) - (go (method-of-object obj hostile)) +(defmethod go-hostile enemy ((this enemy)) + (go (method-of-object this hostile)) ) -(defmethod go-ambush enemy ((obj enemy)) - (go (method-of-object obj ambush)) +(defmethod go-ambush enemy ((this enemy)) + (go (method-of-object this ambush)) ) -(defmethod go-flee enemy ((obj enemy)) - (go (method-of-object obj flee)) +(defmethod go-flee enemy ((this enemy)) + (go (method-of-object this flee)) ) -(defmethod go-directed enemy ((obj enemy)) - (go (method-of-object obj directed)) +(defmethod go-directed enemy ((this enemy)) + (go (method-of-object this directed)) ) -(defmethod react-to-focus enemy ((obj enemy)) +(defmethod react-to-focus enemy ((this enemy)) "@TODO - flesh out docs" - (let ((s5-0 (-> obj focus aware))) + (let ((s5-0 (-> this focus aware))) (cond - ((and (= s5-0 (enemy-aware enemy-aware-3)) (get-enemy-target obj)) - (go-hostile obj) + ((and (= s5-0 (enemy-aware enemy-aware-3)) (get-enemy-target this)) + (go-hostile this) ) ((<= (the-as int s5-0) 0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((>= 1 (the-as int s5-0)) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ((= s5-0 (enemy-aware unaware)) - (go-flee obj) + (go-flee this) ) (else - (go-stare obj) + (go-stare this) ) ) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 enemy ((obj enemy)) - (if (logtest? (enemy-flag alert) (-> obj enemy-flags)) - (go-directed obj) - (react-to-focus obj) +(defmethod enemy-method-93 enemy ((this enemy)) + (if (logtest? (enemy-flag alert) (-> this enemy-flags)) + (go-directed this) + (react-to-focus this) ) (none) ) -(defmethod kill-prefer-falling enemy ((obj enemy)) +(defmethod kill-prefer-falling enemy ((this enemy)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (if (-> obj enemy-info use-die-falling) - (go (method-of-object obj die-falling)) - (go (method-of-object obj die)) + (if (-> this enemy-info use-die-falling) + (go (method-of-object this die-falling)) + (go (method-of-object this die)) ) ) -(defmethod enemy-method-135 enemy ((obj enemy) (arg0 int)) +(defmethod enemy-method-135 enemy ((this enemy) (arg0 int)) (let ((gp-0 (make-u128 0 0))) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (set! gp-0 (the-as uint (-> obj enemy-info sound-hit))) + (set! gp-0 (the-as uint (-> this enemy-info sound-hit))) ) ((= v1-0 1) - (set! gp-0 (the-as uint (-> obj enemy-info sound-die))) + (set! gp-0 (the-as uint (-> this enemy-info sound-die))) ) ) ) @@ -572,8 +574,8 @@ ) ) -(defmethod enemy-method-94 enemy ((obj enemy) (arg0 vector) (arg1 float)) - (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) +(defmethod enemy-method-94 enemy ((this enemy) (arg0 vector) (arg1 float)) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> arg0 quad)) @@ -585,21 +587,21 @@ ) ) -(defmethod enemy-method-95 enemy ((obj enemy) (arg0 vector) (arg1 float)) - (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj root trans)))) - (enemy-method-94 obj v1-1 arg1) +(defmethod enemy-method-95 enemy ((this enemy) (arg0 vector) (arg1 float)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) + (enemy-method-94 this v1-1 arg1) ) ) -(defmethod enemy-method-96 enemy ((obj enemy) (arg0 float) (arg1 symbol)) - (let ((a0-2 (handle->process (-> obj focus handle)))) +(defmethod enemy-method-96 enemy ((this enemy) (arg0 float) (arg1 symbol)) + (let ((a0-2 (handle->process (-> this focus handle)))) (cond (a0-2 (let ((s4-1 - (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) (-> obj root trans)) + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) (-> this root trans)) ) ) - (enemy-method-94 obj s4-1 arg0) + (enemy-method-94 this s4-1 arg0) ) ) (else @@ -609,46 +611,46 @@ ) ) -(defmethod enemy-method-104 enemy ((obj enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) - (let ((v1-1 (-> obj enemy-info attack-damage))) +(defmethod enemy-method-104 enemy ((this enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + (let ((v1-1 (-> this enemy-info attack-damage))) (if (and (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) (= v1-1 1)) (set! v1-1 2) ) (when (send-event arg0 'attack arg1 (static-attack-info ((id arg2) - (shove-back (-> obj enemy-info attack-shove-back)) - (shove-up (-> obj enemy-info attack-shove-up)) - (mode (-> obj enemy-info attack-mode)) + (shove-back (-> this enemy-info attack-shove-back)) + (shove-up (-> this enemy-info attack-shove-up)) + (mode (-> this enemy-info attack-mode)) (damage (the float v1-1)) (knock (the-as uint 8)) ) ) ) - (enemy-method-105 obj arg0) + (enemy-method-105 this arg0) #t ) ) ) -(defmethod enemy-method-105 enemy ((obj enemy) (arg0 process)) +(defmethod enemy-method-105 enemy ((this enemy) (arg0 process)) (when (logtest? (process-mask target bot) (-> arg0 mask)) - (set! (-> obj root penetrated-by) (the-as penetrate -1)) - (enemy-method-49 obj) + (set! (-> this root penetrated-by) (the-as penetrate -1)) + (enemy-method-49 this) ) (let ((s5-0 (if (type? arg0 process-focusable) arg0 ) ) ) - (when (enemy-method-53 obj (the-as process-focusable s5-0)) - (let ((v1-10 (handle->process (-> obj focus handle)))) - (when (or (= s5-0 v1-10) (and (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (or (not v1-10) (not (logtest? (-> obj focus flags) (enemy-flag lock-focus)))) + (when (enemy-method-53 this (the-as process-focusable s5-0)) + (let ((v1-10 (handle->process (-> this focus handle)))) + (when (or (= s5-0 v1-10) (and (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) + (or (not v1-10) (not (logtest? (-> this focus flags) (enemy-flag lock-focus)))) ) ) - (enemy-method-63 obj (the-as process-focusable s5-0) (the-as enemy-aware #f)) - (set! (-> obj hit-focus-time) (current-time)) - (let ((v0-3 (logior (-> obj enemy-flags) (enemy-flag look-at-focus)))) - (set! (-> obj enemy-flags) v0-3) + (enemy-method-63 this (the-as process-focusable s5-0) (the-as enemy-aware #f)) + (set-time! (-> this hit-focus-time)) + (let ((v0-3 (logior (-> this enemy-flags) (enemy-flag look-at-focus)))) + (set! (-> this enemy-flags) v0-3) v0-3 ) ) @@ -657,19 +659,19 @@ ) ) -(defmethod enemy-method-49 enemy ((obj enemy)) - (logior! (-> obj enemy-flags) (enemy-flag attackable-backup)) +(defmethod enemy-method-49 enemy ((this enemy)) + (logior! (-> this enemy-flags) (enemy-flag attackable-backup)) (let ((v0-0 (current-time))) - (set! (-> obj auto-reset-penetrate-time) v0-0) + (set! (-> this auto-reset-penetrate-time) v0-0) v0-0 ) ) -(defmethod enemy-method-50 enemy ((obj enemy) (arg0 vector)) - (set! (-> arg0 quad) (-> obj incoming attack-direction quad)) +(defmethod enemy-method-50 enemy ((this enemy) (arg0 vector)) + (set! (-> arg0 quad) (-> this incoming attack-direction quad)) (let ((v1-1 arg0)) (when (= (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))) 0.0) - (vector-z-quaternion! arg0 (-> obj root quat)) + (vector-z-quaternion! arg0 (-> this root quat)) (vector-negate-in-place! arg0) ) ) @@ -678,7 +680,7 @@ ) ;; WARN: Return type mismatch int vs uint. -(defmethod enemy-method-131 enemy ((obj enemy) (arg0 int)) +(defmethod enemy-method-131 enemy ((this enemy) (arg0 int)) (the-as uint (cond ((logtest? arg0 1024) 7 @@ -708,101 +710,101 @@ ) ) -(defmethod enemy-method-106 enemy ((obj enemy) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) - (set! (-> obj incoming penetrate-using) (the-as uint arg2)) - (set! (-> obj incoming attack-id) (-> arg3 id)) +(defmethod enemy-method-106 enemy ((this enemy) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) + (set! (-> this incoming penetrate-using) (the-as uint arg2)) + (set! (-> this incoming attack-id) (-> arg3 id)) (let ((v1-3 (if (logtest? (attack-mask knock) (-> arg3 mask)) (-> arg3 knock) - (enemy-method-131 obj arg2) + (enemy-method-131 this arg2) ) ) ) - (set! (-> obj incoming knocked-type) (the-as knocked-type v1-3)) + (set! (-> this incoming knocked-type) (the-as knocked-type v1-3)) (let ((a0-4 (current-time))) (cond ((!= v1-3 6) - (set! (-> obj incoming blue-juggle-count) (the-as uint 0)) + (set! (-> this incoming blue-juggle-count) (the-as uint 0)) 0 ) - ((>= (- (current-time) (-> obj incoming attack-time)) (seconds 1)) - (set! (-> obj incoming blue-juggle-count) (the-as uint 1)) + ((time-elapsed? (-> this incoming attack-time) (seconds 1)) + (set! (-> this incoming blue-juggle-count) (the-as uint 1)) ) (else - (+! (-> obj incoming blue-juggle-count) 1) + (+! (-> this incoming blue-juggle-count) 1) ) ) - (set! (-> obj incoming attack-time) a0-4) + (set! (-> this incoming attack-time) a0-4) ) (cond ((= v1-3 7) - (set! (-> obj incoming attack-direction quad) (-> arg3 vector quad)) + (set! (-> this incoming attack-direction quad) (-> arg3 vector quad)) ) (else (let ((s3-0 (new 'stack-no-clear 'attack-info))) - (attack-info-method-9 arg3 s3-0 (the-as process-drawable arg0) obj) - (set! (-> obj incoming attacker-pos quad) (-> s3-0 intersection quad)) - (set! (-> obj incoming attack-direction quad) (-> s3-0 attacker-velocity quad)) + (attack-info-method-9 arg3 s3-0 (the-as process-drawable arg0) this) + (set! (-> this incoming attacker-pos quad) (-> s3-0 intersection quad)) + (set! (-> this incoming attack-direction quad) (-> s3-0 attacker-velocity quad)) ) ) ) ) - (set! (-> obj incoming attacker-handle) (process->handle (enemy-method-134 obj arg0 arg3))) + (set! (-> this incoming attacker-handle) (process->handle (enemy-method-134 this arg0 arg3))) 0 (none) ) -(defmethod look-at-target! enemy ((obj enemy) (arg0 enemy-flag)) +(defmethod look-at-target! enemy ((this enemy) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" (case arg0 (((enemy-flag lock-focus)) - (logclear! (-> obj enemy-flags) (enemy-flag death-start)) - (logior! (-> obj enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> this enemy-flags) (enemy-flag death-start)) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) ) (((enemy-flag death-start)) - (logclear! (-> obj enemy-flags) (enemy-flag lock-focus)) - (logior! (-> obj enemy-flags) (enemy-flag death-start)) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (logior! (-> this enemy-flags) (enemy-flag death-start)) ) ) - (if (nonzero? (-> obj neck)) - (mode-set! (-> obj neck) (joint-mod-mode look-at)) + (if (nonzero? (-> this neck)) + (mode-set! (-> this neck) (joint-mod-mode look-at)) ) 0 (none) ) -(defmethod stop-looking-at-target! enemy ((obj enemy)) +(defmethod stop-looking-at-target! enemy ((this enemy)) "Will unset [[enemy-flag::death-start]] and [[enemy-flag::lock-focus]] and call [[joint-mod::shut-down]] if applicable" - (when (nonzero? (-> obj neck)) - (logclear! (-> obj enemy-flags) (enemy-flag lock-focus death-start)) - (shut-down (-> obj neck)) + (when (nonzero? (-> this neck)) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus death-start)) + (shut-down (-> this neck)) ) 0 (none) ) -(defmethod enemy-method-125 enemy ((obj enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) - (when (find-ground (-> obj root) arg0 arg1 arg2 arg3 arg4) +(defmethod enemy-method-125 enemy ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) + (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) (let ((v0-1 (-> arg0 best-other-tri pat))) - (set! (-> obj root ground-pat) v0-1) + (set! (-> this root ground-pat) v0-1) v0-1 ) ) ) -(defmethod enemy-above-ground? enemy ((obj enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float)) +(defmethod enemy-above-ground? enemy ((this enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float)) "@returns if the enemy is above the ground or not @see [[above-ground?]]" - (above-ground? (-> obj root) arg0 arg1 arg2 arg3 arg4 arg5) + (above-ground? (-> this root) arg0 arg1 arg2 arg3 arg4 arg5) ) -(defmethod enemy-method-127 enemy ((obj enemy) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) +(defmethod enemy-method-127 enemy ((this enemy) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) (cond - ((enemy-method-125 obj s4-0 arg3 arg0 arg1 1024.0) - (let ((s5-1 (-> obj root))) + ((enemy-method-125 this s4-0 arg3 arg0 arg1 1024.0) + (let ((s5-1 (-> this root))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> obj root trans quad)) + (set! (-> s3-0 quad) (-> this root trans quad)) (set! (-> s3-0 y) (-> s4-0 best-other-tri intersect y)) (move-to-point! s5-1 s3-0) (let ((a0-3 (-> s4-0 best-other-tri normal)) @@ -823,7 +825,7 @@ #t ) (else - (let ((v1-11 (-> obj root))) + (let ((v1-11 (-> this root))) (logclear! (-> v1-11 status) (collide-status on-surface on-ground @@ -852,7 +854,7 @@ ) ) (if arg2 - (format 0 "WARNING: enemy::move-to-ground: failed to locate ground for ~S!~%" (-> obj name)) + (format 0 "WARNING: enemy::move-to-ground: failed to locate ground for ~S!~%" (-> this name)) ) #f ) @@ -860,8 +862,8 @@ ) ) -(defmethod enemy-method-128 enemy ((obj enemy) (arg0 vector) (arg1 move-above-ground-params)) - (let ((gp-0 (-> obj root))) +(defmethod enemy-method-128 enemy ((this enemy) (arg0 vector) (arg1 move-above-ground-params)) + (let ((gp-0 (-> this root))) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) (set! (-> arg1 old-gspot-pos quad) (-> gp-0 gspot-pos quad)) @@ -874,7 +876,7 @@ (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (cond - ((enemy-method-125 obj s2-0 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0) + ((enemy-method-125 this s2-0 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0) (when (>= (-> gp-0 gspot-pos y) (-> arg1 new-pos y)) (set! (-> arg1 on-ground?) #t) (set! (-> arg1 pat) (-> s2-0 best-other-tri pat)) @@ -959,10 +961,10 @@ (none) ) -(defmethod enemy-method-111 enemy ((obj enemy)) - (let ((v1-0 (-> obj root))) +(defmethod enemy-method-111 enemy ((this enemy)) + (let ((v1-0 (-> this root))) (when (logtest? (-> v1-0 status) (collide-status touch-surface)) - (let ((f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 (-> obj enemy-info friction))))))) + (let ((f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 (-> this enemy-info friction))))))) (vector-float*! (-> v1-0 transv) (-> v1-0 transv) f0-1) ) 0 @@ -972,147 +974,149 @@ (none) ) -(defmethod init-enemy-collision! enemy ((obj enemy)) +(defmethod init-enemy-collision! enemy ((this enemy)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" 0 (none) ) -(defmethod init-enemy! enemy ((obj enemy)) +(defmethod init-enemy! enemy ((this enemy)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle enemy ((obj enemy)) - (go (method-of-object obj idle)) +(defmethod go-idle enemy ((this enemy)) + (go (method-of-object this idle)) (none) ) -(defmethod set-enemy-info! enemy ((obj enemy) (arg0 enemy-info)) +(defmethod set-enemy-info! enemy ((this enemy) (arg0 enemy-info)) "In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it @param info Set `enemy-info` accordingly" - (set! (-> obj enemy-info) arg0) - (when (and (!= (-> obj enemy-info neck-joint) -1) (zero? (-> obj neck))) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj (-> obj enemy-info neck-joint))) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 102400.0) - (set! (-> obj neck ignore-angle) 16384.0) + (set! (-> this enemy-info) arg0) + (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) + (set! (-> this neck) + (new 'process 'joint-mod (joint-mod-mode flex-blend) this (-> this enemy-info neck-joint)) + ) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) ) 0 (none) ) -(defmethod init-enemy-behaviour-and-stats! enemy ((obj enemy) (arg0 enemy-info)) +(defmethod init-enemy-behaviour-and-stats! enemy ((this enemy) (arg0 enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (local-vars (sv-16 res-tag)) - (when (coin-flip? obj) - (let ((a0-2 (-> obj node-list data 2))) + (when (coin-flip? this) + (let ((a0-2 (-> this node-list data 2))) (set! (-> a0-2 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!)) (set! (-> a0-2 param1) #f) (set! (-> a0-2 param2) #f) ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag dislike-combo) (-> obj enemy-flags)))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag dislike-combo) (-> this enemy-flags)))) ) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj enemy-flags) (enemy-flag notice)) - (set-enemy-info! obj arg0) - (let ((a1-2 (-> obj enemy-info idle-anim-script))) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask actor-pause)) + (logior! (-> this enemy-flags) (enemy-flag notice)) + (set-enemy-info! this arg0) + (let ((a1-2 (-> this enemy-info idle-anim-script))) (if a1-2 - (idle-control-method-9 (-> obj idle-anim-player) a1-2) + (idle-control-method-9 (-> this idle-anim-player) a1-2) ) ) - (if (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) (new - 'process - 'shadow-control - (-> obj enemy-info shadow-min-y) - (-> obj enemy-info shadow-max-y) - (-> obj enemy-info shadow-locus-dist) - (shadow-flags shdf00 shdf04) - 245760.0 - ) + (if (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new + 'process + 'shadow-control + (-> this enemy-info shadow-min-y) + (-> this enemy-info shadow-max-y) + (-> this enemy-info shadow-locus-dist) + (shadow-flags shdf00 shdf04) + 245760.0 + ) ) - (set! (-> obj draw shadow-ctrl) *enemy-dummy-shadow-control*) + (set! (-> this draw shadow-ctrl) *enemy-dummy-shadow-control*) ) - (set! (-> obj water-max-height) 8192.0) + (set! (-> this water-max-height) 8192.0) (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) - (set! (-> obj hit-points) (* (-> obj enemy-info default-hit-points) 2)) - (set! (-> obj hit-points) (-> obj enemy-info default-hit-points)) + (set! (-> this hit-points) (* (-> this enemy-info default-hit-points) 2)) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) ) (let* ((v1-38 *game-info*) (a0-10 (+ (-> v1-38 attack-id) 1)) ) (set! (-> v1-38 attack-id) a0-10) - (set! (-> obj attack-id) a0-10) + (set! (-> this attack-id) a0-10) ) (let* ((v1-39 *game-info*) (a0-12 (+ (-> v1-39 attack-id) 1)) ) (set! (-> v1-39 attack-id) a0-12) - (set! (-> obj persistent-attack-id) a0-12) + (set! (-> this persistent-attack-id) a0-12) ) - (set! (-> obj incoming attacker-handle) (the-as handle #f)) - (enemy-method-124 obj) - (set! (-> obj fact) (new - 'process - 'fact-info-enemy - obj - (the-as (pointer float) (-> arg0 fact-defaults)) - (pickup-type eco-pill-random) - (-> *FACT-bank* default-eco-pill-green-inc) - ) + (set! (-> this incoming attacker-handle) (the-as handle #f)) + (enemy-method-124 this) + (set! (-> this fact) (new + 'process + 'fact-info-enemy + this + (the-as (pointer float) (-> arg0 fact-defaults)) + (pickup-type eco-pill-random) + (-> *FACT-bank* default-eco-pill-green-inc) + ) ) - (let ((a1-5 (if (logtest? (enemy-option multi-focus) (-> obj fact enemy-options)) + (let ((a1-5 (if (logtest? (enemy-option multi-focus) (-> this fact enemy-options)) #x400406 #x400402 ) ) ) - (reset-to-collide-spec (-> obj focus) (the-as collide-spec a1-5)) + (reset-to-collide-spec (-> this focus) (the-as collide-spec a1-5)) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-49 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-49 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-49 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-49)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-49)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice symbol)) - (set! (-> obj on-active) (res-lump-struct (-> obj entity) 'on-active symbol)) - (set! (-> obj on-hostile) (res-lump-struct (-> obj entity) 'on-hostile symbol)) - (set! (-> obj on-death) (res-lump-struct (-> obj entity) 'on-death symbol)) - (if (-> obj on-notice) - (logior! (-> obj enemy-flags) (enemy-flag auto-reset-penetrate)) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice symbol)) + (set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active symbol)) + (set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile symbol)) + (set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death symbol)) + (if (-> this on-notice) + (logior! (-> this enemy-flags) (enemy-flag auto-reset-penetrate)) ) - (if (-> obj on-active) - (logior! (-> obj enemy-flags) (enemy-flag jump-check-blocked)) + (if (-> this on-active) + (logior! (-> this enemy-flags) (enemy-flag jump-check-blocked)) ) - (if (-> obj on-hostile) - (logior! (-> obj enemy-flags) (enemy-flag drawn-mirrored)) + (if (-> this on-hostile) + (logior! (-> this enemy-flags) (enemy-flag drawn-mirrored)) ) - (let ((s4-0 (-> obj root))) - (set! (-> obj penetrated-by-all) (-> s4-0 penetrated-by)) - (set! (-> s4-0 penetrated-by) (get-penetrate-info obj)) + (let ((s4-0 (-> this root))) + (set! (-> this penetrated-by-all) (-> s4-0 penetrated-by)) + (set! (-> s4-0 penetrated-by) (get-penetrate-info this)) (set! (-> s4-0 event-self) 'touched) ) - (set! (-> obj penetrated-flinch) (-> arg0 penetrate-flinch)) - (set! (-> obj penetrated-knocked) (-> arg0 penetrate-knocked)) - (set! (-> obj reaction-time) (the-as time-frame (get-rand-int-range obj 30 180))) - (let* ((v1-79 (-> obj enemy-flags)) - (a0-28 (-> obj fact enemy-options)) + (set! (-> this penetrated-flinch) (-> arg0 penetrate-flinch)) + (set! (-> this penetrated-knocked) (-> arg0 penetrate-knocked)) + (set! (-> this reaction-time) (the-as time-frame (get-rand-int-range this 30 180))) + (let* ((v1-79 (-> this enemy-flags)) + (a0-28 (-> this fact enemy-options)) (v1-80 (logior (enemy-flag enable-on-active checking-water @@ -1131,17 +1135,17 @@ (if (logtest? (enemy-option has-trigger) a0-28) (set! v1-80 (logior (enemy-flag called-dying) v1-80)) ) - (set! (-> obj enemy-flags) v1-80) + (set! (-> this enemy-flags) v1-80) ) - (logior! (-> obj mask) (process-mask collectable)) - (if (and (-> obj enemy-info move-to-ground) - (not (logtest? (enemy-flag vulnerable-backup) (-> obj enemy-flags))) - (not (logtest? (enemy-option ambush) (-> obj fact enemy-options))) + (logior! (-> this mask) (process-mask collectable)) + (if (and (-> this enemy-info move-to-ground) + (not (logtest? (enemy-flag vulnerable-backup) (-> this enemy-flags))) + (not (logtest? (enemy-option ambush) (-> this fact enemy-options))) ) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) + (enemy-method-127 this 40960.0 40960.0 #t (the-as collide-spec (-> this gnd-collide))) ) - (if (zero? (-> obj draw light-index)) - (set! (-> obj draw light-index) (the-as uint 10)) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) ) 0 (none) @@ -1217,20 +1221,20 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! enemy ((obj enemy) (arg0 entity-actor)) +(defmethod init-from-entity! enemy ((this enemy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-enemy-collision! obj) - (process-drawable-from-entity! obj arg0) - (init-enemy! obj) - (when (>= (-> obj enemy-info gem-joint) 0) + (init-enemy-collision! this) + (process-drawable-from-entity! this arg0) + (init-enemy! this) + (when (>= (-> this enemy-info gem-joint) 0) (cond - ((and (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status save))) - (not (-> obj entity)) + ((and (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status save))) + (not (-> this entity)) ) (not (or (task-node-closed? (game-task-node city-win-introduction)) (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) @@ -1238,45 +1242,45 @@ This commonly includes things such as: ) ) (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-no-seg)) - (the-as int (-> obj enemy-info gem-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-no-seg)) + (the-as int (-> this enemy-info gem-seg)) ) ) (else (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-seg)) - (the-as int (-> obj enemy-info gem-no-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-seg)) + (the-as int (-> this enemy-info gem-no-seg)) ) - (add-connection *part-engine* obj (-> obj enemy-info gem-joint) obj 314 (-> obj enemy-info gem-offset)) + (add-connection *part-engine* this (-> this enemy-info gem-joint) this 314 (-> this enemy-info gem-offset)) ) ) ) - (let ((v1-28 (-> obj fact enemy-options))) + (let ((v1-28 (-> this fact enemy-options))) (cond ((logtest? (enemy-option spawner) v1-28) - (process-entity-status! obj (entity-perm-status dead) #t) - (go (method-of-object obj die-fast)) + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die-fast)) ) (*debug-view-anims* - (go (method-of-object obj view-anims)) + (go (method-of-object this view-anims)) ) ((logtest? (enemy-option dormant) v1-28) - (enemy-method-64 obj) + (enemy-method-64 this) ) ((logtest? (enemy-option dormant-aware) v1-28) - (enemy-method-65 obj) + (enemy-method-65 this) ) (else - (go-idle obj) + (go-idle this) ) ) ) (none) ) -(defmethod in-aggro-range? enemy ((obj enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? enemy ((this enemy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -1285,39 +1289,39 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-99 enemy ((obj enemy) (arg0 process-focusable)) +(defmethod enemy-method-99 enemy ((this enemy) (arg0 process-focusable)) #f ) -(defmethod reset-to-collide-spec enemy-focus ((obj enemy-focus) (arg0 collide-spec)) +(defmethod reset-to-collide-spec enemy-focus ((this enemy-focus) (arg0 collide-spec)) (let ((t9-0 (method-of-type focus reset-to-collide-spec))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj aware) (enemy-aware enemy-aware-0)) + (set! (-> this aware) (enemy-aware enemy-aware-0)) 0 (none) ) ;; WARN: Return type mismatch process vs none. ;; WARN: Function (method 129 enemy) has a return type of none, but the expression builder found a return statement. -(defmethod enemy-method-129 enemy ((obj enemy)) - (let ((gp-0 (-> obj focus))) +(defmethod enemy-method-129 enemy ((this enemy)) + (let ((gp-0 (-> this focus))) (let ((a1-0 (handle->process (-> gp-0 handle)))) (when a1-0 - (let ((v1-4 (-> obj enemy-flags))) + (let ((v1-4 (-> this enemy-flags))) (cond ((and a1-0 (not (logtest? (-> (the-as process-focusable a1-0) focus-status) (focus-status disable dead)))) (when (and (logtest? (enemy-flag trackable) v1-4) (not (logtest? (enemy-flag actor-pause-backup) v1-4)) (not (logtest? (-> gp-0 flags) (enemy-flag lock-focus))) ) - (enemy-method-97 obj) + (enemy-method-97 this) (return #f) ) (let ((v1-14 (enemy-method-61 - obj - (the-as int (update-target-awareness! obj (the-as process-focusable a1-0) (the-as enemy-best-focus #f))) + this + (the-as int (update-target-awareness! this (the-as process-focusable a1-0) (the-as enemy-best-focus #f))) ) ) ) @@ -1339,14 +1343,14 @@ This commonly includes things such as: (clear-focused gp-0) ) ) - (if (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (enemy-method-97 obj) + (if (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) + (enemy-method-97 this) ) (none) ) -(defmethod enemy-method-97 enemy ((obj enemy)) - (let ((s4-0 (-> obj focus collide-with)) +(defmethod enemy-method-97 enemy ((this enemy)) + (let ((s4-0 (-> this focus collide-with)) (gp-0 (new 'stack-no-clear 'enemy-best-focus)) ) (set! (-> gp-0 proc) #f) @@ -1365,8 +1369,8 @@ This commonly includes things such as: ) ) ) - (if (and a1-1 (and a1-1 (not (logtest? (-> a1-1 focus-status) (focus-status disable dead)))) (!= obj a1-1)) - (update-target-awareness! obj a1-1 gp-0) + (if (and a1-1 (and a1-1 (not (logtest? (-> a1-1 focus-status) (focus-status disable dead)))) (!= this a1-1)) + (update-target-awareness! this a1-1 gp-0) ) ) ) @@ -1392,8 +1396,8 @@ This commonly includes things such as: ) ) ) - (if (and a1-3 (and a1-3 (not (logtest? (-> a1-3 focus-status) (focus-status disable dead)))) (!= obj a1-3)) - (update-target-awareness! obj a1-3 gp-0) + (if (and a1-3 (and a1-3 (not (logtest? (-> a1-3 focus-status) (focus-status disable dead)))) (!= this a1-3)) + (update-target-awareness! this a1-3 gp-0) ) ) ) @@ -1418,8 +1422,8 @@ This commonly includes things such as: ) ) ) - (if (and a1-5 (and a1-5 (not (logtest? (-> a1-5 focus-status) (focus-status disable dead)))) (!= obj a1-5)) - (update-target-awareness! obj a1-5 gp-0) + (if (and a1-5 (and a1-5 (not (logtest? (-> a1-5 focus-status) (focus-status disable dead)))) (!= this a1-5)) + (update-target-awareness! this a1-5 gp-0) ) ) ) @@ -1435,9 +1439,9 @@ This commonly includes things such as: (let ((s4-1 (-> gp-0 proc))) (when s4-1 (enemy-method-63 - obj + this (the-as process-focusable s4-1) - (the-as enemy-aware (enemy-method-61 obj (the-as int (-> gp-0 aware)))) + (the-as enemy-aware (enemy-method-61 this (the-as int (-> gp-0 aware)))) ) s4-1 ) @@ -1446,26 +1450,26 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! enemy ((obj enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! enemy ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" - (let ((f30-0 (vector-vector-distance (get-trans arg0 0) (-> obj root trans))) + (let ((f30-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans))) (s3-1 #f) (s2-0 #f) ) (cond - ((< f30-0 (-> obj enemy-info proximity-notice-distance)) + ((< f30-0 (-> this enemy-info proximity-notice-distance)) (set! s3-1 #t) - (set! s2-0 (in-aggro-range? obj arg0 (the-as vector #f))) + (set! s2-0 (in-aggro-range? this arg0 (the-as vector #f))) ) (else - (let ((f0-1 (the-as float (-> obj enemy-info notice-distance)))) - (if (< 1 (the-as int (-> obj focus aware))) - (set! f0-1 (+ (the-as meters f0-1) (-> obj enemy-info notice-distance-delta))) + (let ((f0-1 (the-as float (-> this enemy-info notice-distance)))) + (if (< 1 (the-as int (-> this focus aware))) + (set! f0-1 (+ (the-as meters f0-1) (-> this enemy-info notice-distance-delta))) ) - (when (or (< f30-0 f0-1) (not (logtest? (-> obj enemy-flags) (enemy-flag enable-on-notice)))) - (set! s2-0 (in-aggro-range? obj arg0 (the-as vector #f))) + (when (or (< f30-0 f0-1) (not (logtest? (-> this enemy-flags) (enemy-flag enable-on-notice)))) + (set! s2-0 (in-aggro-range? this arg0 (the-as vector #f))) (if s2-0 (set! s3-1 #t) ) @@ -1476,7 +1480,7 @@ This commonly includes things such as: (let ((s3-2 (cond (s3-1 (cond - ((enemy-method-99 obj arg0) + ((enemy-method-99 this arg0) 4 ) (s2-0 @@ -1487,7 +1491,7 @@ This commonly includes things such as: ) ) ) - ((< f30-0 (-> obj fact idle-distance)) + ((< f30-0 (-> this fact idle-distance)) 1 ) (else @@ -1496,15 +1500,15 @@ This commonly includes things such as: ) ) ) - (when (and (> s3-2 0) (logtest? (enemy-flag called-dying) (-> obj enemy-flags))) + (when (and (> s3-2 0) (logtest? (enemy-flag called-dying) (-> this enemy-flags))) (cond - ((logtest? (enemy-option idle-til-trigger) (-> obj fact enemy-options)) - (if (not (enemy-method-130 obj f30-0)) + ((logtest? (enemy-option idle-til-trigger) (-> this fact enemy-options)) + (if (not (enemy-method-130 this f30-0)) (set! s3-2 0) ) ) (else - (if (and (< 1 s3-2) (not (enemy-method-130 obj f30-0))) + (if (and (< 1 s3-2) (not (enemy-method-130 this f30-0))) (set! s3-2 1) ) ) @@ -1522,8 +1526,8 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-130 enemy ((obj enemy) (arg0 float)) - (let* ((v1-0 (-> obj fact)) +(defmethod enemy-method-130 enemy ((this enemy) (arg0 float)) + (let* ((v1-0 (-> this fact)) (a2-0 (-> v1-0 trig-mask-count)) (a3-0 (-> v1-0 trig-mask)) ) @@ -1546,7 +1550,7 @@ This commonly includes things such as: ) (label cfg-17) (when (zero? t1-1) - (logclear! (-> obj enemy-flags) (enemy-flag called-dying)) + (logclear! (-> this enemy-flags) (enemy-flag called-dying)) (return #t) ) ) @@ -1555,29 +1559,29 @@ This commonly includes things such as: #f ) -(defmethod enemy-method-61 enemy ((obj enemy) (arg0 int)) +(defmethod enemy-method-61 enemy ((this enemy) (arg0 int)) (let ((v1-1 (< 1 arg0))) (cond (v1-1 - (when (not (logtest? (-> obj enemy-flags) (enemy-flag spawn-gem))) - (logior! (-> obj enemy-flags) (enemy-flag spawn-gem)) - (set! (-> obj notice-time) (current-time)) + (when (not (logtest? (-> this enemy-flags) (enemy-flag spawn-gem))) + (logior! (-> this enemy-flags) (enemy-flag spawn-gem)) + (set-time! (-> this notice-time)) ) - (if (and (not (logtest? (-> obj enemy-flags) (enemy-flag chase-startup))) - (< (- (current-time) (-> obj notice-time)) (-> obj reaction-time)) + (if (and (not (logtest? (-> this enemy-flags) (enemy-flag chase-startup))) + (not (time-elapsed? (-> this notice-time) (-> this reaction-time))) ) (set! v1-1 #f) ) ) (else - (logclear! (-> obj enemy-flags) (enemy-flag spawn-gem)) + (logclear! (-> this enemy-flags) (enemy-flag spawn-gem)) ) ) (cond (v1-1 arg0 ) - ((or (zero? arg0) (>= (- (current-time) (-> obj last-draw-time)) (seconds 2))) + ((or (zero? arg0) (time-elapsed? (-> this last-draw-time) (seconds 2))) 0 ) (else @@ -1587,25 +1591,25 @@ This commonly includes things such as: ) ) -(defmethod general-event-handler enemy ((obj enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler enemy ((this enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (s5-5 rgbaf) (sv-432 process) (sv-448 event-message-block)) (cond ((= arg2 'track) - (and (nonzero? (-> obj hit-points)) - (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) - (logtest? (enemy-flag check-water-backup) (-> obj enemy-flags)) + (and (nonzero? (-> this hit-points)) + (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) + (logtest? (enemy-flag check-water-backup) (-> this enemy-flags)) ) ) ((= arg2 'combo) - (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) + (and (not (logtest? (enemy-flag multi-focus) (-> this enemy-flags))) (nonzero? (-> this hit-points))) ) ((= arg2 'touch) - (enemy-method-75 obj arg0 arg3) + (enemy-method-75 this arg0 arg3) ) ((= arg2 'touched) - (when (logtest? (-> obj enemy-flags) (enemy-flag attackable-backup)) + (when (logtest? (-> this enemy-flags) (enemy-flag attackable-backup)) (let* ((s3-1 arg0) (v1-20 (if (type? s3-1 process-drawable) (the-as process-drawable s3-1) @@ -1630,39 +1634,39 @@ This commonly includes things such as: ) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s3-3) - (-> obj root) + (-> this root) (collide-action solid) (collide-action) ) ) - (set! (-> obj auto-reset-penetrate-time) (current-time)) + (set-time! (-> this auto-reset-penetrate-time)) ) ) ) ) ) - (enemy-method-76 obj arg0 arg3) + (enemy-method-76 this arg0 arg3) ) ((= arg2 'attack-invinc) (case (-> (the-as attack-info (-> arg3 param 1)) mode) (('endlessfall) - (let ((v1-31 (-> obj root root-prim))) + (let ((v1-31 (-> this root root-prim))) (set! (-> v1-31 prim-core collide-as) (collide-spec)) (set! (-> v1-31 prim-core collide-with) (collide-spec)) ) 0 - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ) ) ((= arg2 'attack) (let ((s2-0 (the-as object (-> arg3 param 1)))) - (when (!= (-> (the-as attack-info s2-0) id) (-> obj incoming attack-id)) + (when (!= (-> (the-as attack-info s2-0) id) (-> this incoming attack-id)) (cond - ((and (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ((and (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) - (let* ((s1-0 obj) + (let* ((s1-0 this) (s0-0 (method-of-object s1-0 enemy-method-106)) ) (set! sv-432 arg0) @@ -1671,31 +1675,31 @@ This commonly includes things such as: (s0-0 s1-0 sv-432 sv-448 (the-as int a3-3) (the-as attack-info s2-0)) ) ) - (send-event (ppointer->process (-> obj parent)) 'child-hit) + (send-event (ppointer->process (-> this parent)) 'child-hit) 0 (when (not *debug-unkillable*) ;; og:preserve-this for damage numbers cheat (#cond (PC_PORT - (let ((old-hp (-> obj hit-points)) - (dmg-taken (take-damage-from-attack obj arg0 arg3))) + (let ((old-hp (-> this hit-points)) + (dmg-taken (take-damage-from-attack this arg0 arg3))) (when (> dmg-taken 0) - (process-spawn damage-number (damage-amount-from-attack obj arg0 arg3) (-> obj root trans) (-> obj mask)) - (send-damage-to-bar *health-bar-manager* obj dmg-taken old-hp)) - (when (nonzero? (-> obj fated-time)) - (aif (get-bar-for-process *health-bar-manager* obj) + (process-spawn damage-number (damage-amount-from-attack this arg0 arg3) (-> this root trans) (-> this mask)) + (send-damage-to-bar *health-bar-manager* this dmg-taken old-hp)) + (when (nonzero? (-> this fated-time)) + (aif (get-bar-for-process *health-bar-manager* this) (send-event (ppointer->process it) 'set-hit-points 0) - (send-damage-to-bar *health-bar-manager* obj 1 1)) + (send-damage-to-bar *health-bar-manager* this 1 1)) ) ) ) (#t - (take-damage-from-attack obj arg0 arg3))) + (take-damage-from-attack this arg0 arg3))) ) - (let ((s2-1 (the-as attack-info (enemy-method-58 obj arg0 arg3)))) + (let ((s2-1 (the-as attack-info (enemy-method-58 this arg0 arg3)))) (when s2-1 - (logclear! (-> obj enemy-flags) (enemy-flag called-dying)) - (enemy-method-108 obj (the-as enemy arg0) arg3) + (logclear! (-> this enemy-flags) (enemy-flag called-dying)) + (enemy-method-108 this (the-as enemy arg0) arg3) (let ((a1-13 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-13 from) (process->ppointer arg0)) (set! (-> a1-13 num-params) arg1) @@ -1706,104 +1710,104 @@ This commonly includes things such as: (set! (-> a1-13 param 3) (-> arg3 param 3)) (set! (-> a1-13 param 4) (-> arg3 param 4)) (set! (-> a1-13 param 5) (-> arg3 param 5)) - (send-event-function obj a1-13) + (send-event-function this a1-13) ) ) ) ) (else - (set! (-> obj incoming attack-id) (-> (the-as attack-info s2-0) id)) - (enemy-method-75 obj arg0 arg3) + (set! (-> this incoming attack-id) (-> (the-as attack-info s2-0) id)) + (enemy-method-75 this arg0 arg3) ) ) ) ) ) ((= arg2 'hit-flinch) - (when (zero? (-> obj hit-points)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (when (zero? (-> this hit-points)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) #t ) ((= arg2 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (when (zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + (when (zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) 0 ) ) ) - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ((= arg2 'hit) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (if (zero? (-> obj hit-points)) - (kill-prefer-falling obj) - (go (method-of-object obj hit)) + (if (zero? (-> this hit-points)) + (kill-prefer-falling this) + (go (method-of-object this hit)) ) ) ((= arg2 'cue-chase) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (when (and (> (-> this hit-points) 0) + (zero? (-> this fated-time)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) - (let ((v1-162 (logtest? (enemy-flag alert) (-> obj enemy-flags)))) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (let ((v1-162 (logtest? (enemy-flag alert) (-> this enemy-flags)))) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) (cond (v1-162 - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (go-hostile obj) + (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (go-ambush this) + (go-hostile this) ) ) - ((and (-> obj next-state) (let ((v1-173 (-> obj next-state name))) - (or (= v1-173 'dormant) (= v1-173 'dormant-aware)) - ) + ((and (-> this next-state) (let ((v1-173 (-> this next-state name))) + (or (= v1-173 'dormant) (= v1-173 'dormant-aware)) + ) ) - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (go (method-of-object obj notice)) + (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (go-ambush this) + (go (method-of-object this notice)) ) ) ) @@ -1812,114 +1816,114 @@ This commonly includes things such as: ) ) ((= arg2 'cue-wake) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (when (and (> (-> this hit-points) 0) + (zero? (-> this fated-time)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) - (logclear! (-> obj enemy-flags) (enemy-flag alert victory called-dying)) - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (react-to-focus obj) + (logclear! (-> this enemy-flags) (enemy-flag alert victory called-dying)) + (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (go-ambush this) + (react-to-focus this) ) #t ) ) ((= arg2 'jump) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (when (and (> (-> this hit-points) 0) + (zero? (-> this fated-time)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj jump-why) (-> arg3 param 0)) - (set! (-> obj event-param-point quad) (-> (the-as vector (-> arg3 param 1)) quad)) - (go (method-of-object obj jump)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this jump-why) (-> arg3 param 0)) + (set! (-> this event-param-point quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (go (method-of-object this jump)) ) ) ((= arg2 'death-start) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag recover) (-> obj enemy-flags)))) - (send-event (ppointer->process (-> obj parent)) 'child-die) - (drop-pickup (-> obj fact) #t *entity-pool* (-> obj fact) 0) - (let ((s5-1 (-> obj on-death))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag recover) (-> this enemy-flags)))) + (send-event (ppointer->process (-> this parent)) 'child-die) + (drop-pickup (-> this fact) #t *entity-pool* (-> this fact) 0) + (let ((s5-1 (-> this on-death))) (if s5-1 - (script-eval (the-as pair s5-1) :vector (-> obj root trans)) + (script-eval (the-as pair s5-1) :vector (-> this root trans)) ) ) ) ((= arg2 'death-end) - (if (-> obj skel effect) - (logior! (-> obj skel effect flags) (effect-control-flag ecf2)) + (if (-> this skel effect) + (logior! (-> this skel effect flags) (effect-control-flag ecf2)) ) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (set! (-> obj enemy-flags) (logclear (-> obj enemy-flags) (enemy-flag check-water))) + (logior! (-> this draw status) (draw-control-status no-draw)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (set! (-> this enemy-flags) (logclear (-> this enemy-flags) (enemy-flag check-water))) ) ((= arg2 'instant-death) - (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time))) - (set! (-> obj hit-points) 0) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) - (let ((s5-2 (enemy-method-50 obj (new 'stack-no-clear 'vector)))) - (vector-z-quaternion! s5-2 (-> obj root quat)) + (when (and (> (-> this hit-points) 0) (zero? (-> this fated-time))) + (set! (-> this hit-points) 0) + (set! (-> this root penetrated-by) (get-penetrate-info this)) + (let ((s5-2 (enemy-method-50 this (new 'stack-no-clear 'vector)))) + (vector-z-quaternion! s5-2 (-> this root quat)) (vector-float*! s5-2 s5-2 -1.0) (vector-normalize! s5-2 1.0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (kill-prefer-falling obj) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (kill-prefer-falling this) ) ) ((= arg2 'die-fast) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (dispose! obj) - (send-event (ppointer->process (-> obj parent)) 'child-die) - (let ((s5-3 (-> obj on-death))) + (logior! (-> this draw status) (draw-control-status no-draw)) + (dispose! this) + (send-event (ppointer->process (-> this parent)) 'child-die) + (let ((s5-3 (-> this on-death))) (if s5-3 - (script-eval (the-as pair s5-3) :vector (-> obj root trans)) + (script-eval (the-as pair s5-3) :vector (-> this root trans)) ) ) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) ((= arg2 'victory) - (if (and (-> obj enemy-info use-victory) - (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) - (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (if (and (-> this enemy-info use-victory) + (not (and (-> this next-state) (= (-> this next-state name) 'victory))) + (> (-> this hit-points) 0) + (zero? (-> this fated-time)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) - (go (method-of-object obj victory)) + (go (method-of-object this victory)) ) ) ((= arg2 'nav-control) - (if (nonzero? (-> obj nav)) - (-> obj nav) + (if (nonzero? (-> this nav)) + (-> this nav) ) ) ((= arg2 'push-trans) - (move-by-vector! (-> obj root) (the-as vector (-> arg3 param 0))) + (move-by-vector! (-> this root) (the-as vector (-> arg3 param 0))) ) ((= arg2 'move-trans) - (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) + (move-to-point! (-> this root) (the-as vector (-> arg3 param 0))) ) ((= arg2 'shadow) (cond ((-> arg3 param 0) - (let ((v1-320 (-> obj draw shadow-ctrl))) + (let ((v1-320 (-> this draw shadow-ctrl))) (logclear! (-> v1-320 settings flags) (shadow-flags disable-draw)) ) 0 ) (else - (let ((v1-323 (-> obj draw shadow-ctrl))) + (let ((v1-323 (-> this draw shadow-ctrl))) (logior! (-> v1-323 settings flags) (shadow-flags disable-draw)) ) 0 @@ -1930,8 +1934,8 @@ This commonly includes things such as: (case (-> arg3 param 0) (('dark) (let ((f30-0 (rand-vu-float-range 0.2 1.0))) - (set-vector! (-> obj draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0) - (set! s5-5 (-> obj draw color-emissive)) + (set-vector! (-> this draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0) + (set! s5-5 (-> this draw color-emissive)) (set! (-> s5-5 x) (lerp 0.0 0.3 f30-0)) (set! (-> s5-5 y) (lerp 0.0 0.0 f30-0)) (set! (-> s5-5 z) (lerp 0.0 0.3 f30-0)) @@ -1940,8 +1944,8 @@ This commonly includes things such as: s5-5 ) ((#f) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (set! s5-5 (-> obj draw color-emissive)) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set! s5-5 (-> this draw color-emissive)) (set! (-> s5-5 quad) (the-as uint128 0)) s5-5 ) @@ -1950,23 +1954,23 @@ This commonly includes things such as: ) ) -(defmethod damage-amount-from-attack enemy ((obj enemy) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack enemy ((this enemy) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let ((v1-0 (the-as attack-info (-> arg1 param 1)))) (if (logtest? (attack-mask damage) (-> v1-0 mask)) (the int (-> v1-0 damage)) - (penetrate-using->damage (the-as penetrate (-> obj incoming penetrate-using))) + (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using))) ) ) ) -(defmethod enemy-method-58 enemy ((obj enemy) (arg0 process) (arg1 event-message-block)) - (let ((v1-0 (-> obj incoming penetrate-using))) +(defmethod enemy-method-58 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) + (let ((v1-0 (-> this incoming penetrate-using))) (cond - ((logtest? (the-as penetrate v1-0) (-> obj penetrated-flinch)) + ((logtest? (the-as penetrate v1-0) (-> this penetrated-flinch)) 'hit-flinch ) - ((logtest? (the-as penetrate v1-0) (-> obj penetrated-knocked)) + ((logtest? (the-as penetrate v1-0) (-> this penetrated-knocked)) 'hit-knocked ) (else @@ -1976,37 +1980,37 @@ This commonly includes things such as: ) ) -(defmethod take-damage-from-attack enemy ((obj enemy) (arg0 process) (arg1 event-message-block)) - (let* ((v1-1 (damage-amount-from-attack obj arg0 arg1)) - (s5-0 (-> obj hit-points)) +(defmethod take-damage-from-attack enemy ((this enemy) (arg0 process) (arg1 event-message-block)) + (let* ((v1-1 (damage-amount-from-attack this arg0 arg1)) + (s5-0 (-> this hit-points)) (s4-1 (max 0 (- s5-0 v1-1))) ) - (when (and (zero? s4-1) (nonzero? s5-0) (= (-> obj incoming knocked-type) (knocked-type knocked-type-6))) + (when (and (zero? s4-1) (nonzero? s5-0) (= (-> this incoming knocked-type) (knocked-type knocked-type-6))) (cond - ((zero? (-> obj fated-time)) - (set! (-> obj fated-time) (current-time)) + ((zero? (-> this fated-time)) + (set-time! (-> this fated-time)) (set! s4-1 1) ) (else - (if (< (- (current-time) (-> obj fated-time)) (seconds 1)) + (if (not (time-elapsed? (-> this fated-time) (seconds 1))) (set! s4-1 1) ) ) ) ) - (set! (-> obj hit-points) s4-1) - (if (not (logtest? (-> obj enemy-flags) (enemy-flag attackable-backup))) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) + (set! (-> this hit-points) s4-1) + (if (not (logtest? (-> this enemy-flags) (enemy-flag attackable-backup))) + (set! (-> this root penetrated-by) (get-penetrate-info this)) ) (- s5-0 s4-1) ) ) -(defmethod enemy-method-134 enemy ((obj enemy) (arg0 process) (arg1 attack-info)) +(defmethod enemy-method-134 enemy ((this enemy) (arg0 process) (arg1 attack-info)) (find-offending-process-focusable arg0 arg1) ) -(defmethod enemy-method-75 enemy ((obj enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-75 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) (let* ((touch-entry (the-as touching-shapes-entry (-> arg1 param 0))) (s2-0 arg0) (s3-0 (if (type? s2-0 process-focusable) @@ -2016,39 +2020,39 @@ This commonly includes things such as: ) (when (and (the-as uint touch-entry) s3-0) (cond - ((and (focus-test? obj dangerous) + ((and (focus-test? this dangerous) (and s3-0 (not (logtest? (-> s3-0 focus-status) (focus-status disable dead ignore grabbed)))) ((method-of-type touching-shapes-entry prims-touching-action?) touch-entry - (-> obj root) + (-> this root) (collide-action deadly) (collide-action) ) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) touch-entry - (-> obj root) + (-> this root) (collide-action persistent-attack) (collide-action) ) - (-> obj persistent-attack-id) - (-> obj attack-id) + (-> this persistent-attack-id) + (-> this attack-id) ) ) ) - (enemy-method-104 obj arg0 touch-entry a3-2) + (enemy-method-104 this arg0 touch-entry a3-2) ) ) ((and ((method-of-type touching-shapes-entry prims-touching-action?) touch-entry - (-> obj root) + (-> this root) (collide-action no-standon) (collide-action) ) - (not (logtest? (-> obj root penetrated-by) (-> s3-0 root penetrate-using))) + (not (logtest? (-> this root penetrated-by) (-> s3-0 root penetrate-using))) ) - (if (send-shoves (-> obj root) arg0 touch-entry 0.7 6144.0 16384.0) - (send-event obj 'bouncing-off arg0) + (if (send-shoves (-> this root) arg0 touch-entry 0.7 6144.0 16384.0) + (send-event this 'bouncing-off arg0) ) ) ) @@ -2056,34 +2060,34 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-76 enemy ((obj enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) (let ((s4-0 (-> arg1 param 0))) (when s4-0 - (when (or (and (and (-> obj next-state) (= (-> obj next-state name) 'knocked)) + (when (or (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) (logtest? (process-mask crate) (-> arg0 mask)) ) - (and (and (-> obj next-state) (= (-> obj next-state name) 'jump)) + (and (and (-> this next-state) (= (-> this next-state name) 'jump)) (logtest? (process-mask target sidekick crate bot) (-> arg0 mask)) ) ) (when ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s4-0) - (-> obj root) + (-> this root) (collide-action solid semi-solid deadly) (collide-action) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s4-0) - (-> obj root) + (-> this root) (collide-action persistent-attack) (collide-action) ) - (-> obj persistent-attack-id) - (-> obj attack-id) + (-> this persistent-attack-id) + (-> this attack-id) ) ) ) - (enemy-method-104 obj arg0 (the-as touching-shapes-entry s4-0) a3-2) + (enemy-method-104 this arg0 (the-as touching-shapes-entry s4-0) a3-2) ) ) ) @@ -2129,7 +2133,7 @@ This commonly includes things such as: (none) ) -(defmethod enemy-method-47 enemy ((obj enemy) (arg0 vector)) +(defmethod enemy-method-47 enemy ((this enemy) (arg0 vector)) (let* ((f2-0 0.8) (f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 f2-0))))) ) @@ -2168,7 +2172,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (stop-looking-at-target! self) (logclear! (-> self enemy-flags) (enemy-flag spawn-gem chase-startup use-notice-distance)) (logior! (-> self enemy-flags) (enemy-flag enable-on-notice)) @@ -2190,9 +2194,7 @@ This commonly includes things such as: ) ) :trans (behavior () - (if (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) - (> (the-as int (-> self focus aware)) 0) - ) + (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (> (the-as int (-> self focus aware)) 0)) (go-virtual active) ) ) @@ -2203,7 +2205,7 @@ This commonly includes things such as: :post (behavior () (idle-control-method-10 (-> self idle-anim-player) self) (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) (ja-post) @@ -2247,9 +2249,7 @@ This commonly includes things such as: :enter (-> (method-of-type enemy dormant) enter) :exit (-> (method-of-type enemy dormant) exit) :trans (behavior () - (when (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) - (> (the-as int (-> self focus aware)) 0) - ) + (when (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (> (the-as int (-> self focus aware)) 0)) (if (logtest? (enemy-option ambush) (-> self fact enemy-options)) (go-ambush self) (go-virtual active) @@ -2259,7 +2259,7 @@ This commonly includes things such as: :code sleep-code :post (behavior () (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) ) @@ -2280,7 +2280,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self enemy-flags) (enemy-flag use-notice-distance)) (when (logtest? (-> self enemy-flags) (enemy-flag jump-check-blocked)) (logclear! (-> self enemy-flags) (enemy-flag jump-check-blocked)) @@ -2298,7 +2298,7 @@ This commonly includes things such as: ) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-3 (-> self focus aware))) (cond ((< (the-as int v1-3) 1) @@ -2325,7 +2325,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-3 (logior (-> self enemy-flags) (enemy-flag use-notice-distance)))) (set! (-> self enemy-flags) (logclear v1-3 (enemy-flag called-dying))) ) @@ -2381,7 +2381,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (look-at-target! self (enemy-flag lock-focus)) (logior! (-> self enemy-flags) (enemy-flag use-notice-distance)) (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) @@ -2400,7 +2400,7 @@ This commonly includes things such as: (go-virtual victory) ) (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((or (>= 2 (the-as int gp-0)) (not (get-enemy-target self))) (go-stare self) @@ -2431,12 +2431,12 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((gp-0 (-> self focus aware))) (cond ((>= 1 (the-as int gp-0)) @@ -2498,13 +2498,13 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (look-at-target! self (enemy-flag lock-focus)) (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) (logclear! (-> self mask) (process-mask actor-pause)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (!= (-> self focus aware) (enemy-aware unaware)) (go-stare self) ) @@ -2525,23 +2525,23 @@ This commonly includes things such as: :post enemy-simple-post ) -(defmethod enemy-method-82 enemy ((obj enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 enemy ((this enemy) (arg0 enemy-jump-info)) "@abstract" #f ) -(defmethod enemy-method-83 enemy ((obj enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-83 enemy ((this enemy) (arg0 enemy-jump-info)) (set! (-> arg0 flags) (the-as uint 1)) - (set! (-> arg0 anim-speed) (get-rand-float-range obj 0.9 1.1)) + (set! (-> arg0 anim-speed) (get-rand-float-range this 0.9 1.1)) (set! (-> arg0 hang-time) 0) - (set! (-> arg0 dest-pos quad) (-> obj event-param-point quad)) - (set! (-> arg0 start-pos quad) (-> obj root trans quad)) + (set! (-> arg0 dest-pos quad) (-> this event-param-point quad)) + (set! (-> arg0 start-pos quad) (-> this root trans quad)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) (if (enemy-above-ground? - obj + this s4-0 (-> arg0 dest-pos) - (the-as collide-spec (-> obj gnd-collide)) + (the-as collide-spec (-> this gnd-collide)) 8192.0 81920.0 1024.0 @@ -2549,57 +2549,57 @@ This commonly includes things such as: (set! (-> arg0 dest-pos y) (-> s4-0 best-other-tri intersect y)) ) ) - (enemy-method-84 obj arg0) + (enemy-method-84 this arg0) (none) ) -(defmethod enemy-method-84 enemy ((obj enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 enemy ((this enemy) (arg0 enemy-jump-info)) (let* ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))) - (f0-2 (fmax (-> obj enemy-info jump-height-min) (* (-> obj enemy-info jump-height-factor) f0-0))) + (f0-2 (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0))) ) (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f0-2 -4.551111) ) (none) ) -(defmethod enemy-method-86 enemy ((obj enemy)) - (let ((gp-0 (-> obj root))) +(defmethod enemy-method-86 enemy ((this enemy)) + (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (find-ground (-> obj root) a1-0 (the-as collide-spec (-> obj gnd-collide)) 8192.0 81920.0 1024.0) + (find-ground (-> this root) a1-0 (the-as collide-spec (-> this gnd-collide)) 8192.0 81920.0 1024.0) ) (>= (-> gp-0 gspot-pos y) (-> gp-0 trans y)) ) ) ) -(defmethod enemy-method-85 enemy ((obj enemy)) - (let* ((v1-0 (-> obj root)) +(defmethod enemy-method-85 enemy ((this enemy)) + (let* ((v1-0 (-> this root)) (f0-0 (-> v1-0 gspot-pos y)) ) (if (< (-> v1-0 trans y) f0-0) (set! (-> v1-0 trans y) f0-0) ) ) - (set! (-> obj root transv y) 0.0) + (set! (-> this root transv y) 0.0) ) -(defmethod enemy-method-92 enemy ((obj enemy) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 enemy ((this enemy) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" 0 (none) ) -(defmethod enemy-method-91 enemy ((obj enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-91 enemy ((this enemy) (arg0 int) (arg1 enemy-jump-info)) (case arg0 ((2 3) - (logior! (-> obj enemy-flags) (enemy-flag directed)) + (logior! (-> this enemy-flags) (enemy-flag directed)) (let ((f30-0 (the float (-> arg1 hang-time)))) (let ((a1-3 (compute-trans-at-time (-> arg1 traj) f30-0 (new 'stack-no-clear 'vector)))) - (move-to-point! (-> obj root) a1-3) + (move-to-point! (-> this root) a1-3) ) - (let ((s5-1 (-> obj root transv))) + (let ((s5-1 (-> this root transv))) (compute-transv-at-time (-> arg1 traj) f30-0 s5-1) (vector-float*! s5-1 s5-1 300.0) ) @@ -2610,14 +2610,14 @@ This commonly includes things such as: (none) ) -(defmethod enemy-method-89 enemy ((obj enemy) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-89 enemy ((this enemy) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info jump-wind-up-anim))) - (a0-5 (-> obj skel root-channel 0)) + (let ((a1-3 (-> this draw art-group data (-> this enemy-info jump-wind-up-anim))) + (a0-5 (-> this skel root-channel 0)) ) (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-3)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) @@ -2628,19 +2628,19 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-87 enemy ((obj enemy) (arg0 enemy-jump-info)) - (let ((s5-0 (-> obj draw art-group data (-> obj enemy-info jump-in-air-anim)))) - (let ((v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) +(defmethod enemy-method-87 enemy ((this enemy) (arg0 enemy-jump-info)) + (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) + (let ((v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-6 (= v1-6 (-> obj draw art-group data (-> obj enemy-info jump-wind-up-anim)))) + ((and v1-6 (= v1-6 (-> this draw art-group data (-> this enemy-info jump-wind-up-anim)))) (ja-channel-push! 1 0) ) (else - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 param 0) 1.0) (joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) @@ -2648,7 +2648,7 @@ This commonly includes things such as: ) ) ) - (let ((a0-12 (-> obj skel root-channel 0))) + (let ((a0-12 (-> this skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim s5-0)) (set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) (set! (-> a0-12 param 1) (-> arg0 anim-speed)) @@ -2659,14 +2659,14 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-88 enemy ((obj enemy) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-88 enemy ((this enemy) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.075)) - (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info jump-land-anim))) - (a0-5 (-> obj skel root-channel 0)) + (let ((a1-3 (-> this draw art-group data (-> this enemy-info jump-land-anim))) + (a0-5 (-> this skel root-channel 0)) ) (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-3)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) @@ -2677,16 +2677,16 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-90 enemy ((obj enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 enemy ((this enemy) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (not (enemy-method-89 obj arg1)) + (not (enemy-method-89 this arg1)) ) ((= v1-0 1) (set! s5-0 (ja-done? 0)) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) @@ -2695,12 +2695,12 @@ This commonly includes things such as: s5-0 ) ((= v1-0 2) - (enemy-method-87 obj arg1) + (enemy-method-87 this arg1) #f ) ((= v1-0 3) (set! s5-0 (ja-done? 0)) - (let ((a0-9 (-> obj skel root-channel 0))) + (let ((a0-9 (-> this skel root-channel 0))) (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) (set! (-> a0-9 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) @@ -2709,11 +2709,11 @@ This commonly includes things such as: s5-0 ) ((= v1-0 4) - (not (enemy-method-88 obj arg1)) + (not (enemy-method-88 this arg1)) ) ((= v1-0 5) (set! s5-0 (ja-done? 0)) - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group frames num-frames) -1))) (set! (-> a0-14 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) @@ -2732,7 +2732,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logior! (-> self focus-status) (focus-status dangerous)) (let* ((v1-6 *game-info*) @@ -2827,11 +2827,11 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (if (logtest? (enemy-flag alert) (-> self enemy-flags)) (go-virtual jump) (enemy-method-93 self) @@ -2909,41 +2909,41 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch collide-spec vs none. -(defmethod enemy-method-101 enemy ((obj enemy)) - (when (not (logtest? (enemy-flag use-trigger) (-> obj enemy-flags))) - (logior! (-> obj enemy-flags) (enemy-flag use-trigger)) - (logclear! (-> obj enemy-flags) (enemy-flag directed)) - (enemy-method-124 obj) +(defmethod enemy-method-101 enemy ((this enemy)) + (when (not (logtest? (enemy-flag use-trigger) (-> this enemy-flags))) + (logior! (-> this enemy-flags) (enemy-flag use-trigger)) + (logclear! (-> this enemy-flags) (enemy-flag directed)) + (enemy-method-124 this) ) (none) ) -(defmethod enemy-method-103 enemy ((obj enemy)) - (when (logtest? (enemy-flag use-trigger) (-> obj enemy-flags)) - (logclear! (-> obj enemy-flags) (enemy-flag use-trigger directed)) - (enemy-method-124 obj) +(defmethod enemy-method-103 enemy ((this enemy)) + (when (logtest? (enemy-flag use-trigger) (-> this enemy-flags)) + (logclear! (-> this enemy-flags) (enemy-flag use-trigger directed)) + (enemy-method-124 this) ) ) -(defmethod enemy-method-102 enemy ((obj enemy)) +(defmethod enemy-method-102 enemy ((this enemy)) #f ) ;; WARN: Return type mismatch vector vs symbol. -(defmethod enemy-method-100 enemy ((obj enemy)) +(defmethod enemy-method-100 enemy ((this enemy)) (local-vars (v0-1 vector)) - (when (not (-> obj enemy-info move-to-ground)) - (enemy-method-103 obj) + (when (not (-> this enemy-info move-to-ground)) + (enemy-method-103 this) (return (the-as symbol #f)) ) - (when (not (logtest? (enemy-flag directed) (-> obj enemy-flags))) - (let ((s5-0 (-> obj root))) - (if (focus-test? obj under-water) - (enemy-method-47 obj (-> s5-0 transv)) - (+! (-> s5-0 transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame))) + (when (not (logtest? (enemy-flag directed) (-> this enemy-flags))) + (let ((s5-0 (-> this root))) + (if (focus-test? this under-water) + (enemy-method-47 this (-> s5-0 transv)) + (+! (-> s5-0 transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) - (let ((v1-16 (-> obj enemy-info))) + (let ((v1-16 (-> this enemy-info))) (set! (-> a2-0 gnd-collide-with) (-> v1-16 recover-gnd-collide-with)) (set! (-> a2-0 popup) 8192.0) (set! (-> a2-0 dont-move-if-overlaps?) #t) @@ -2953,15 +2953,15 @@ This commonly includes things such as: ) (set! (-> a2-0 overlaps-params tlist) *touching-list*) (-> a2-0 overlaps-params) - (enemy-method-128 obj (-> s5-0 transv) a2-0) + (enemy-method-128 this (-> s5-0 transv) a2-0) ) ) ) - (logclear! (-> obj enemy-flags) (enemy-flag directed)) - (if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead)))) - (kill-prefer-falling obj) + (logclear! (-> this enemy-flags) (enemy-flag directed)) + (if (and (enemy-method-102 this) (not (logtest? (-> this focus-status) (focus-status dead)))) + (kill-prefer-falling this) ) - (let ((s5-1 (-> obj root)) + (let ((s5-1 (-> this root)) (a1-2 (new 'stack-no-clear 'collide-query)) (s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -2969,10 +2969,10 @@ This commonly includes things such as: (set! (-> s3-0 quad) (-> s5-1 gspot-pos quad)) (set! (-> s4-0 quad) (-> s5-1 gspot-normal quad)) (the-as symbol (cond - ((find-ground s5-1 a1-2 (-> obj enemy-info gnd-collide-with) 8192.0 81920.0 1024.0) + ((find-ground s5-1 a1-2 (-> this enemy-info gnd-collide-with) 8192.0 81920.0 1024.0) (let ((f0-4 (- (-> s5-1 trans y) (-> s5-1 gspot-pos y)))) (when (>= 409.6 (fabs f0-4)) - (enemy-method-103 obj) + (enemy-method-103 this) (return (the-as symbol #f)) v0-1 ) @@ -2989,31 +2989,31 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-46 enemy ((obj enemy) (arg0 int)) +(defmethod enemy-method-46 enemy ((this enemy) (arg0 int)) "@abstract" 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 enemy ((obj enemy) (arg0 vector)) - (enemy-method-50 obj arg0) - (let ((s5-0 (-> obj enemy-info))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-52 enemy ((this enemy) (arg0 vector)) + (enemy-method-50 this arg0) + (let ((s5-0 (-> this enemy-info))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-2)) - (let ((f30-0 (get-rand-float-range obj 0.0 1.0))) + (let ((f30-0 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-hard-vxz-lo) (-> s5-0 knocked-hard-vxz-hi) f30-0)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-hard-vy-lo) (-> s5-0 knocked-hard-vy-hi) f30-0)) ) ) (((knocked-type knocked-type-1)) - (let ((f30-1 (get-rand-float-range obj 0.0 1.0))) + (let ((f30-1 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-medium-vxz-lo) (-> s5-0 knocked-medium-vxz-hi) f30-1)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-medium-vy-lo) (-> s5-0 knocked-medium-vy-hi) f30-1)) ) ) (((knocked-type knocked-type-3)) - (let ((f30-2 (get-rand-float-range obj 0.0 1.0))) + (let ((f30-2 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-huge-vxz-lo) (-> s5-0 knocked-huge-vxz-hi) f30-2)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-huge-vy-lo) (-> s5-0 knocked-huge-vy-hi) f30-2)) ) @@ -3021,44 +3021,44 @@ This commonly includes things such as: (((knocked-type knocked-type-4)) (vector-rotate90-around-y! arg0 arg0) (let ((v1-9 (new 'stack-no-clear 'vector))) - (vector-! v1-9 (-> obj incoming attacker-pos) (-> obj root trans)) + (vector-! v1-9 (-> this incoming attacker-pos) (-> this root trans)) (set! (-> v1-9 y) 0.0) (if (< 0.0 (vector-dot v1-9 arg0)) (vector-negate! arg0 arg0) ) ) - (let ((f30-3 (get-rand-float-range obj 0.0 1.0))) + (let ((f30-3 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-yellow-vxz-lo) (-> s5-0 knocked-yellow-vxz-hi) f30-3)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-yellow-vy-lo) (-> s5-0 knocked-yellow-vy-hi) f30-3)) ) ) (((knocked-type knocked-type-5)) - (let* ((f1-2 (vector-vector-xz-distance-squared (target-pos 0) (-> obj root trans))) + (let* ((f1-2 (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) (f0-26 1.0) (f2-0 61440.0) (f1-3 (fmin f1-2 (* f2-0 f2-0))) (f2-3 61440.0) - (f30-5 (* (- f0-26 (/ f1-3 (* f2-3 f2-3))) (get-rand-float-range obj 0.8 1.0))) + (f30-5 (* (- f0-26 (/ f1-3 (* f2-3 f2-3))) (get-rand-float-range this 0.8 1.0))) ) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-red-vxz-lo) (-> s5-0 knocked-red-vxz-hi) f30-5)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-red-vy-lo) (-> s5-0 knocked-red-vy-hi) f30-5)) ) ) (((knocked-type knocked-type-6)) - (let* ((f1-5 (vector-vector-xz-distance-squared (target-pos 0) (-> obj root trans))) + (let* ((f1-5 (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) (f0-34 1.0) (f2-6 122880.0) (f1-6 (fmin f1-5 (* f2-6 f2-6))) (f2-9 122880.0) - (f30-7 (* (- f0-34 (/ f1-6 (* f2-9 f2-9))) (get-rand-float-range obj 0.8 1.0))) + (f30-7 (* (- f0-34 (/ f1-6 (* f2-9 f2-9))) (get-rand-float-range this 0.8 1.0))) ) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-blue-vxz-lo) (-> s5-0 knocked-blue-vxz-hi) f30-7)) (cond - ((>= (the-as uint 4) (-> obj incoming blue-juggle-count)) + ((>= (the-as uint 4) (-> this incoming blue-juggle-count)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-blue-vy-lo) (-> s5-0 knocked-blue-vy-hi) f30-7)) ) (else - (if (zero? (get-rand-int obj 3)) + (if (zero? (get-rand-int this 3)) (set! (-> arg0 y) 40960.0) ) ) @@ -3066,10 +3066,10 @@ This commonly includes things such as: ) ) (((knocked-type knocked-type-7)) - (set! (-> arg0 quad) (-> obj incoming attack-direction quad)) + (set! (-> arg0 quad) (-> this incoming attack-direction quad)) ) (else - (let ((f30-8 (get-rand-float-range obj 0.0 1.0))) + (let ((f30-8 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-soft-vxz-lo) (-> s5-0 knocked-soft-vxz-hi) f30-8)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-soft-vy-lo) (-> s5-0 knocked-soft-vy-hi) f30-8)) ) @@ -3079,24 +3079,24 @@ This commonly includes things such as: (none) ) -(defmethod enemy-method-51 enemy ((obj enemy)) - (let ((f30-0 (quaternion-y-angle (-> obj root quat)))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-51 enemy ((this enemy)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (let ((a0-5 (handle->process (-> obj focus handle)))) + (let ((a0-5 (handle->process (-> this focus handle)))) (when a0-5 (let ((v1-9 (get-trans (the-as process-focusable a0-5) 0))) - (set! f30-0 (atan (- (-> v1-9 x) (-> obj root trans x)) (- (-> v1-9 z) (-> obj root trans z)))) + (set! f30-0 (atan (- (-> v1-9 x) (-> this root trans x)) (- (-> v1-9 z) (-> this root trans z)))) ) ) ) ) (else - (let* ((v1-13 (-> obj root transv)) + (let* ((v1-13 (-> this root transv)) (f28-0 (atan (-> v1-13 x) (-> v1-13 z))) (f1-2 (deg- f30-0 f28-0)) (f2-0 (fabs f1-2)) - (f0-6 (-> obj enemy-info knocked-seek-ry-clamp)) + (f0-6 (-> this enemy-info knocked-seek-ry-clamp)) ) (when (and (< f0-6 f2-0) (< f2-0 (- 32768.0 f0-6))) (set! f30-0 (+ (cond @@ -3127,10 +3127,10 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-77 enemy ((obj enemy) (arg0 (pointer float))) +(defmethod enemy-method-77 enemy ((this enemy) (arg0 (pointer float))) (ja-channel-push! 1 0) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info knocked-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -3141,9 +3141,9 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-78 enemy ((obj enemy) (arg0 (pointer float))) - (let ((v1-4 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-3 (-> obj skel root-channel 0)) +(defmethod enemy-method-78 enemy ((this enemy) (arg0 (pointer float))) + (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-3 (-> this skel root-channel 0)) ) (set! (-> a0-3 frame-group) (the-as art-joint-anim v1-4)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-4) frames num-frames) -1))) @@ -3154,8 +3154,8 @@ This commonly includes things such as: #t ) -(defmethod enemy-method-80 enemy ((obj enemy) (arg0 enemy-knocked-info)) - (let ((gp-0 (-> obj root))) +(defmethod enemy-method-80 enemy ((this enemy) (arg0 enemy-knocked-info)) + (let ((gp-0 (-> this root))) (or (>= (-> arg0 on-surface-count) 3) (and (logtest? (-> gp-0 status) (collide-status on-ground)) (>= 16384.0 (-> gp-0 transv y))) (and (>= (-> arg0 move-count) 3) @@ -3170,12 +3170,12 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-81 enemy ((obj enemy)) - (let ((s5-0 (-> obj root)) +(defmethod enemy-method-81 enemy ((this enemy)) + (let ((s5-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) ) - (when (find-ground s5-0 a1-0 (-> obj enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) + (when (find-ground s5-0 a1-0 (-> this enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) (let ((f0-1 (- (-> s5-0 trans y) (-> s5-0 gspot-pos y)))) (if (and (>= f0-1 -1228.8) (>= 6144.0 f0-1)) (set! gp-0 #f) @@ -3186,36 +3186,36 @@ This commonly includes things such as: ) ) -(defmethod enemy-method-79 enemy ((obj enemy) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 enemy ((this enemy) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (enemy-method-77 obj (the-as (pointer float) arg1)) + (enemy-method-77 this (the-as (pointer float) arg1)) (set! s5-0 #f) ) ((= v1-0 1) (set! s5-0 (ja-done? 0)) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) ) ) ((= v1-0 2) - (set! s5-0 (not (enemy-method-78 obj (the-as (pointer float) arg1)))) - (set! (-> obj incoming blue-juggle-count) (the-as uint 0)) + (set! s5-0 (not (enemy-method-78 this (the-as (pointer float) arg1)))) + (set! (-> this incoming blue-juggle-count) (the-as uint 0)) ) ((= v1-0 3) (set! s5-0 (ja-done? 0)) - (let ((a0-9 (-> obj skel root-channel 0))) + (let ((a0-9 (-> this skel root-channel 0))) (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) (set! (-> a0-9 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) ) ) ((= v1-0 4) - (vector-reset! (-> obj root transv)) + (vector-reset! (-> this root transv)) (set! s5-0 #t) ) (else @@ -3230,7 +3230,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (stop-looking-at-target! self) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -3340,7 +3340,7 @@ This commonly includes things such as: (set! (-> gp-0 on-surface-count) 0) (set! (-> gp-0 move-count) 0) (until (enemy-method-80 self gp-0) - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (kill-prefer-falling self) ) (if (logtest? (-> self root status) (collide-status on-surface)) @@ -3353,7 +3353,7 @@ This commonly includes things such as: ) ) (let ((s5-1 2)) - (set! (-> gp-0 land-can-land-time) (current-time)) + (set-time! (-> gp-0 land-can-land-time)) (until #f (if (logtest? (-> self root status) (collide-status on-surface)) (+! (-> gp-0 on-surface-count) 1) @@ -3365,17 +3365,14 @@ This commonly includes things such as: (+! (-> gp-0 move-count) 1) (set! s5-1 3) (if (enemy-method-80 self gp-0) - (set! (-> gp-0 land-can-land-time) (current-time)) + (set-time! (-> gp-0 land-can-land-time)) ) ) ) #f (label cfg-15) (if (and (not (logtest? (enemy-flag recover) (-> self enemy-flags))) - (or (>= (- (current-time) (-> gp-0 land-can-land-time)) (seconds 0.1)) - (enemy-method-81 self) - (enemy-method-102 self) - ) + (or (time-elapsed? (-> gp-0 land-can-land-time) (seconds 0.1)) (enemy-method-81 self) (enemy-method-102 self)) ) (kill-prefer-falling self) ) @@ -3414,46 +3411,48 @@ This commonly includes things such as: :post enemy-falling-post ) -(defmethod dispose! enemy ((obj enemy)) +(defmethod dispose! enemy ((this enemy)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) - (set! (-> obj enemy-flags) - (the-as enemy-flag (logior (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) + (set! (-> this enemy-flags) + (the-as enemy-flag (logior (enemy-flag recover-applied-velocity) (-> this enemy-flags))) ) - (enemy-method-135 obj 1) - (when (and (>= (-> obj enemy-info gem-joint) 0) - (not (logtest? (enemy-flag cam-attack-mode) (-> obj enemy-flags))) - (or (and (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status save)))) - (-> obj entity) + (enemy-method-135 this 1) + (when (and (>= (-> this enemy-info gem-joint) 0) + (not (logtest? (enemy-flag cam-attack-mode) (-> this enemy-flags))) + (or (and (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status save)))) + (-> this entity) ) (task-node-closed? (game-task-node city-win-introduction)) (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) ) ) - (logior! (-> obj enemy-flags) (enemy-flag cam-attack-mode)) - (remove-from-process *part-engine* obj) + (logior! (-> this enemy-flags) (enemy-flag cam-attack-mode)) + (remove-from-process *part-engine* this) (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-no-seg)) - (the-as int (-> obj enemy-info gem-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-no-seg)) + (the-as int (-> this enemy-info gem-seg)) ) - (let ((a0-18 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj enemy-info gem-joint)))) + (let ((a0-18 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this enemy-info gem-joint))) + ) ) - (birth-pickup-at-point a0-18 (pickup-type gem) 1.0 #t *entity-pool* (-> obj fact)) + (birth-pickup-at-point a0-18 (pickup-type gem) 1.0 #t *entity-pool* (-> this fact)) ) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (logior! (-> obj focus-status) (focus-status dead)) - (if (-> obj skel effect) - (logior! (-> obj skel effect flags) (effect-control-flag ecf1)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag check-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (logior! (-> this focus-status) (focus-status dead)) + (if (-> this skel effect) + (logior! (-> this skel effect flags) (effect-control-flag ecf1)) ) - (stop-looking-at-target! obj) + (stop-looking-at-target! this) ) (none) ) @@ -3468,7 +3467,7 @@ This commonly includes things such as: (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self hit-points) 0) (enemy-method-103 self) ) @@ -3493,12 +3492,12 @@ This commonly includes things such as: :post enemy-simple-post ) -(defmethod enemy-method-133 enemy ((obj enemy)) - (let ((s5-0 (-> obj root)) +(defmethod enemy-method-133 enemy ((this enemy)) + (let ((s5-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) ) - (when (find-ground s5-0 a1-0 (-> obj enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) + (when (find-ground s5-0 a1-0 (-> this enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) (if (< (- (-> s5-0 trans y) (-> s5-0 gspot-pos y)) 8192.0) (set! gp-0 #f) ) diff --git a/goal_src/jak2/engine/ai/traffic-h.gc b/goal_src/jak2/engine/ai/traffic-h.gc index fc28015d91..fc58ba121b 100644 --- a/goal_src/jak2/engine/ai/traffic-h.gc +++ b/goal_src/jak2/engine/ai/traffic-h.gc @@ -127,8 +127,8 @@ ;; WARN: Return type mismatch symbol vs none. -(defmethod has-valid-id? traffic-suppression-params ((obj traffic-suppression-params)) - (!= (-> obj id) -1) +(defmethod has-valid-id? traffic-suppression-params ((this traffic-suppression-params)) + (!= (-> this id) -1) (none) ) diff --git a/goal_src/jak2/engine/ambient/ambient.gc b/goal_src/jak2/engine/ambient/ambient.gc index 72ac17881a..bd26e93db0 100644 --- a/goal_src/jak2/engine/ambient/ambient.gc +++ b/goal_src/jak2/engine/ambient/ambient.gc @@ -113,49 +113,49 @@ (-> *talker-speech* 0) ) -(defmethod talker-speech-class-method-9 talker-speech-class ((obj talker-speech-class)) - (and (>= (-> *game-info* unknown-pad6 (* (-> obj speech) 2)) (-> obj pos)) - (>= (-> obj neg) (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1))) +(defmethod talker-speech-class-method-9 talker-speech-class ((this talker-speech-class)) + (and (>= (-> *game-info* unknown-pad6 (* (-> this speech) 2)) (-> this pos)) + (>= (-> this neg) (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1))) ) ) -(defmethod play-communicator-speech! talker-speech-class ((obj talker-speech-class)) +(defmethod play-communicator-speech! talker-speech-class ((this talker-speech-class)) "Plays the provided [[talker-speech-class]] @TODO - understand the array from [[game-info]] better" - (set! (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1)) (the-as uint #xffff)) + (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) 0 (none) ) -(defmethod talker-speech-class-method-11 talker-speech-class ((obj talker-speech-class)) - (set! (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1)) (the-as uint 0)) +(defmethod talker-speech-class-method-11 talker-speech-class ((this talker-speech-class)) + (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint 0)) 0 (none) ) -(defmethod talker-speech-class-method-12 talker-speech-class ((obj talker-speech-class) (arg0 int)) +(defmethod talker-speech-class-method-12 talker-speech-class ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) - (set! (-> *game-info* unknown-pad6 (* (-> obj speech) 2)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (* (-> obj speech) 2))) #xfff0 arg0)) + (set! (-> *game-info* unknown-pad6 (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (* (-> this speech) 2))) #xfff0 arg0)) ) - (set! (-> *game-info* unknown-pad6 (* (-> obj speech) 2)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (* (-> obj speech) 2))) 0 (- arg0))) + (set! (-> *game-info* unknown-pad6 (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (* (-> this speech) 2))) 0 (- arg0))) ) ) - (if (talker-speech-class-method-9 obj) - (talker-spawn-func obj *entity-pool* (target-pos 0) (the-as region #f)) + (if (talker-speech-class-method-9 this) + (talker-spawn-func this *entity-pool* (target-pos 0) (the-as region #f)) ) 0 (none) ) -(defmethod talker-speech-class-method-13 talker-speech-class ((obj talker-speech-class) (arg0 int)) +(defmethod talker-speech-class-method-13 talker-speech-class ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) - (set! (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1))) #xfff0 arg0)) + (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1))) #xfff0 arg0)) ) - (set! (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1))) 0 (- arg0))) + (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1))) 0 (- arg0))) ) ) 0 @@ -245,7 +245,7 @@ (set! (-> self region) arg2) (set! (-> self total-time) 0) (set! (-> self total-off-time) 0) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self voicebox) (the-as handle #f)) (set! (-> self save?) #f) (if (logtest? (-> self message flags) 96) @@ -257,13 +257,13 @@ (none) ) -(defmethod deactivate talker ((obj talker)) - (send-event (handle->process (-> obj voicebox)) 'die) - ((the-as (function process none) (find-parent-method talker 10)) obj) +(defmethod deactivate talker ((this talker)) + (send-event (handle->process (-> this voicebox)) 'die) + ((the-as (function process none) (find-parent-method talker 10)) this) (none) ) -(defmethod talker-method-17 talker ((obj talker)) +(defmethod talker-method-17 talker ((this talker)) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 36 310 0.0 (font-color default) (font-flags shadow kerning)) ) @@ -272,10 +272,10 @@ (let ((v1-2 gp-0)) (set! (-> v1-2 scale) 0.75) ) - (case (-> obj message channel) + (case (-> this message channel) (((gui-channel notice)) (cond - ((logtest? (-> obj message flags) 128) + ((logtest? (-> this message flags) 128) (let ((v1-9 gp-0) (a1-1 36) (a0-4 140) @@ -307,14 +307,14 @@ (set! (-> v1-15 height) (the float 140)) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle large)) - (if (logtest? (-> obj message flags) 32) - (set! (-> gp-0 alpha) (-> obj interp)) + (if (logtest? (-> this message flags) 32) + (set! (-> gp-0 alpha) (-> this interp)) (set! (-> gp-0 alpha) 1.0) ) - (when (logtest? (-> obj message flags) 64) + (when (logtest? (-> this message flags) 64) (let ((s4-0 gp-0) (s3-0 36) - (v1-27 (the int (lerp-scale 400.0 f0-0 (-> obj interp) 0.0 1.0))) + (v1-27 (the int (lerp-scale 400.0 f0-0 (-> this interp) 0.0 1.0))) ) (set! (-> s4-0 origin x) (the float s3-0)) (set! (-> s4-0 origin y) (the float v1-27)) @@ -322,10 +322,10 @@ ) ) (let ((s4-1 print-game-text) - (a0-11 (lookup-text! *common-text* (-> obj message text-message) #f)) + (a0-11 (lookup-text! *common-text* (-> this message text-message) #f)) (a2-3 #f) (a3-2 44) - (v1-31 (-> obj message channel)) + (v1-31 (-> this message channel)) ) (s4-1 a0-11 @@ -347,7 +347,7 @@ :virtual #t :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (the-as time-frame (-> self message delay))) + (until (time-elapsed? gp-0 (the-as time-frame (-> self message delay))) (suspend) ) ) @@ -358,7 +358,7 @@ ) ) ) - (while (< (- (current-time) (-> self start-time)) (the-as time-frame (+ (-> self message delay) 300))) + (while (not (time-elapsed? (-> self start-time) (the-as time-frame (+ (-> self message delay) 300)))) (if (and (or (zero? (-> self voice-id)) (= (get-status *gui-control* (-> self voice-id)) (gui-status ready))) (or (zero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active))) ) @@ -373,7 +373,7 @@ (defstate active (talker) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (if (logtest? (-> self message flags) 1) (play-communicator-speech! (-> self message)) ) @@ -471,16 +471,16 @@ ) (set! v1-43 #t) (label cfg-39) - (and v1-43 (< (- (current-time) (-> self state-time)) (seconds 120))) + (and v1-43 (not (time-elapsed? (-> self state-time) (seconds 120)))) ) ) (and (nonzero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active)) - (or (< (- (current-time) (-> self state-time)) (the-as time-frame (-> self message text-duration))) + (or (not (time-elapsed? (-> self state-time) (the-as time-frame (-> self message text-duration)))) (and (logtest? (-> self message flags) 16) (-> self region) (region-method-9 (-> self region) (target-pos 0))) ) ) - (< (- (current-time) (-> self state-time)) (seconds 0.05)) + (not (time-elapsed? (-> self state-time) (seconds 0.05))) ) (when (and (nonzero? (-> self voice-id)) (not gp-1) (zero? (get-status *gui-control* (-> self voice-id)))) (remove-setting! 'music-volume) @@ -513,7 +513,7 @@ ) (when (and (logtest? (-> self message flags) 8) (not (-> self save?))) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 1)) + (until (time-elapsed? gp-2 (seconds 1)) (suspend) ) ) diff --git a/goal_src/jak2/engine/anim/aligner-h.gc b/goal_src/jak2/engine/anim/aligner-h.gc index 0d05285bcd..11c108d51c 100644 --- a/goal_src/jak2/engine/anim/aligner-h.gc +++ b/goal_src/jak2/engine/anim/aligner-h.gc @@ -63,16 +63,12 @@ ;; WARN: Return type mismatch object vs align-control. (defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (when (zero? obj) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? this) (go process-drawable-art-error "memory") (return (the-as align-control 0)) ) - (set! (-> obj process) (the-as process-drawable arg0)) - (the-as align-control obj) + (set! (-> this process) (the-as process-drawable arg0)) + (the-as align-control this) ) ) - - - - diff --git a/goal_src/jak2/engine/anim/aligner.gc b/goal_src/jak2/engine/anim/aligner.gc index f051011732..5a3ee5c9bd 100644 --- a/goal_src/jak2/engine/anim/aligner.gc +++ b/goal_src/jak2/engine/anim/aligner.gc @@ -9,7 +9,9 @@ ;; DECOMP BEGINS -(defmethod compute-alignment! align-control ((obj align-control)) +;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] +;; ERROR: Unsupported inline assembly instruction kind - [jr ra] +(defmethod compute-alignment! align-control ((this align-control)) (local-vars (a0-10 symbol) (s7-0 none) (ra-0 int)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -17,10 +19,10 @@ (vf6 :class vf) ) (init-vf0-vector) - (update-anim-data (-> obj process skel)) - (let ((s5-0 (-> obj process skel active-channels))) + (update-anim-data (-> this process skel)) + (let ((s5-0 (-> this process skel active-channels))) (dotimes (s4-0 (the-as int s5-0)) - (let* ((a0-4 (-> obj process skel channel s4-0)) + (let* ((a0-4 (-> this process skel channel s4-0)) (v1-7 (-> a0-4 frame-group)) ) (case (-> a0-4 command) @@ -29,6 +31,7 @@ (else (when (!= (-> v1-7 type) art-joint-anim) (go process-drawable-art-error "align joint-anim") + ;; og:preserve-this (abandon-thread) 0 ) @@ -37,34 +40,34 @@ ) ) ) - (let* ((a0-9 (-> obj process skel root-channel 0)) + (let* ((a0-9 (-> this process skel root-channel 0)) (v1-18 (-> a0-9 frame-group)) (f0-0 (-> a0-9 frame-num)) ) (= (-> a0-9 num-func) num-func-loop!) (cond - ((or (not v1-18) (!= (-> obj frame-group) v1-18)) + ((or (not v1-18) (!= (-> this frame-group) v1-18)) (set! a0-10 #t) ) ((= (-> a0-9 num-func) num-func-loop!) - (set! a0-10 (< (* (-> a0-9 param 0) (- f0-0 (-> obj frame-num))) 0.0)) + (set! a0-10 (< (* (-> a0-9 param 0) (- f0-0 (-> this frame-num))) 0.0)) ) (else (set! a0-10 (= f0-0 0.0)) ) ) (if a0-10 - (logior! (-> obj flags) (align-flags disabled)) - (logclear! (-> obj flags) (align-flags disabled)) + (logior! (-> this flags) (align-flags disabled)) + (logclear! (-> this flags) (align-flags disabled)) ) - (set! (-> obj frame-group) v1-18) - (set! (-> obj frame-num) f0-0) + (set! (-> this frame-group) v1-18) + (set! (-> this frame-num) f0-0) ) - (mem-copy! (the-as pointer (-> obj transform 1)) (the-as pointer (-> obj transform)) 48) - (quaternion-copy! (the-as quaternion (-> obj transform 1 rot)) (-> obj align quat)) - (set! (-> obj transform 1 scale quad) (-> obj align scale quad)) - (let* ((a2-5 (-> obj matrix 1)) - (a3-0 (-> obj matrix)) + (mem-copy! (the-as pointer (-> this transform 1)) (the-as pointer (-> this transform)) 48) + (quaternion-copy! (the-as quaternion (-> this transform 1 rot)) (-> this align quat)) + (set! (-> this transform 1 scale quad) (-> this align scale quad)) + (let* ((a2-5 (-> this matrix 1)) + (a3-0 (-> this matrix)) (v1-21 (-> a3-0 0 quad 0)) (a0-19 (-> a3-0 0 quad 1)) (a1-13 (-> a3-0 0 quad 2)) @@ -75,9 +78,9 @@ (set! (-> a2-5 quad 2) a1-13) (set! (-> a2-5 trans quad) a3-1) ) - (let ((s5-1 (-> obj process node-list data 1))) - (cspace<-matrix-no-push-joint! s5-1 (-> obj process skel)) - (let* ((v1-25 (-> obj matrix)) + (let ((s5-1 (-> this process node-list data 1))) + (cspace<-matrix-no-push-joint! s5-1 (-> this process skel)) + (let* ((v1-25 (-> this matrix)) (a3-2 (-> s5-1 bone transform)) (a0-22 (-> a3-2 quad 0)) (a1-15 (-> a3-2 quad 1)) @@ -89,9 +92,9 @@ (set! (-> v1-25 0 quad 2) a2-6) (set! (-> v1-25 0 trans quad) a3-3) ) - (let ((v1-26 (-> obj transform))) + (let ((v1-26 (-> this transform))) (let ((a0-24 (-> s5-1 bone transform trans)) - (a1-18 (-> obj process root scale)) + (a1-18 (-> this process root scale)) ) (.lvf vf4 (&-> a0-24 quad)) (.lvf vf5 (&-> a1-18 quad)) @@ -102,51 +105,52 @@ ) ) (vector-! - (the-as vector (-> obj delta)) - (the-as vector (-> obj transform)) - (the-as vector (-> obj transform 1)) + (the-as vector (-> this delta)) + (the-as vector (-> this transform)) + (the-as vector (-> this transform 1)) ) (set-vector! - (-> obj align scale) - (vector-length (the-as vector (-> obj matrix))) - (vector-length (-> obj matrix 0 vector 1)) - (vector-length (-> obj matrix 0 vector 2)) + (-> this align scale) + (vector-length (the-as vector (-> this matrix))) + (vector-length (-> this matrix 0 vector 1)) + (vector-length (-> this matrix 0 vector 2)) 1.0 ) - (vector-! (-> obj delta scale) (-> obj align scale) (-> obj transform 1 scale)) - (let ((a2-7 (matrix-inv-scale! (new 'stack-no-clear 'matrix) (-> obj align scale)))) + (vector-! (-> this delta scale) (-> this align scale) (-> this transform 1 scale)) + (let ((a2-7 (matrix-inv-scale! (new 'stack-no-clear 'matrix) (-> this align scale)))) (quaternion-normalize! - (matrix->quaternion (-> obj align quat) (matrix*! a2-7 (the-as matrix (-> obj matrix)) a2-7)) + (matrix->quaternion (-> this align quat) (matrix*! a2-7 (the-as matrix (-> this matrix)) a2-7)) ) ) - (let ((a1-27 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (the-as quaternion (-> obj transform 1 rot))))) - (quaternion-normalize! (quaternion*! (-> obj delta quat) a1-27 (-> obj align quat))) + (let ((a1-27 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (the-as quaternion (-> this transform 1 rot)))) + ) + (quaternion-normalize! (quaternion*! (-> this delta quat) a1-27 (-> this align quat))) ) - (-> obj delta) + (-> this delta) ) ) ;; WARN: Return type mismatch (inline-array transform) vs transform. -(defmethod first-transform align-control ((obj align-control)) +(defmethod first-transform align-control ((this align-control)) "@returns The first of the two [[transforms]] held by the object" - (the-as transform (-> obj transform)) + (the-as transform (-> this transform)) ) -(defmethod second-transform align-control ((obj align-control)) +(defmethod second-transform align-control ((this align-control)) "@returns The second of the two [[transforms]] held by the object" - (-> obj transform 1) + (-> this transform 1) ) -(defmethod align! align-control ((obj align-control) (options align-opts) (x float) (y float) (z float)) +(defmethod align! align-control ((this align-control) (options align-opts) (x float) (y float) (z float)) "As long as [[align-flags::0]] is not set call [[process-drawable::16]] on the process being controlled using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> @returns the `root` of the [[process-drawable]] after the method returns @see [[process-drawable::16]]" - (when (not (logtest? (-> obj flags) (align-flags disabled))) - (let* ((process (-> obj process)) + (when (not (logtest? (-> this flags) (align-flags disabled))) + (let* ((process (-> this process)) (method-call (method-of-object process apply-alignment)) - (transform (-> obj delta)) + (transform (-> this delta)) (data (new 'stack-no-clear 'vector)) ) (set! (-> data x) x) @@ -156,12 +160,12 @@ using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> (method-call process options transform data) ) ) - (-> obj process root) + (-> this process root) ) -(defmethod set-and-limit-velocity trsqv ((obj trsqv) (unkBitfield int) (limit vector) (arg2 float)) +(defmethod set-and-limit-velocity trsqv ((this trsqv) (unkBitfield int) (limit vector) (arg2 float)) "TODO - arg1 is an bitfield of some sort" - (let ((transv (-> obj transv))) + (let ((transv (-> this transv))) (when (logtest? unkBitfield 4) (set! (-> transv x) (-> limit x)) (set! (-> transv z) (-> limit z)) @@ -177,13 +181,13 @@ using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> ) ) ) - obj + this ) -(defmethod align-vel-and-quat-only! align-control ((obj align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) - (when (not (logtest? (-> obj flags) (align-flags disabled))) - (let ((s5-0 (-> obj delta))) - (let ((a0-1 (-> obj process root transv))) +(defmethod align-vel-and-quat-only! align-control ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) + (when (not (logtest? (-> this flags) (align-flags disabled))) + (let ((s5-0 (-> this delta))) + (let ((a0-1 (-> this process root transv))) (if (logtest? arg0 (align-opts adjust-y-vel)) (set! (-> a0-1 y) (* (-> s5-0 trans y) arg3 (-> self clock frames-per-second))) ) @@ -199,15 +203,15 @@ using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> ) (t9-0 vector-xz-normalize!) ) - (set! (-> obj last-speed) f0-11) + (set! (-> this last-speed) f0-11) (t9-0 a0-1 f0-11) ) ) ) (if (logtest? arg0 (align-opts adjust-quat)) - (quaternion-normalize! (quaternion*! (-> obj process root quat) (-> obj process root quat) (-> s5-0 quat))) + (quaternion-normalize! (quaternion*! (-> this process root quat) (-> this process root quat) (-> s5-0 quat))) ) ) ) - (-> obj process root) + (-> this process root) ) diff --git a/goal_src/jak2/engine/anim/fma-sphere.gc b/goal_src/jak2/engine/anim/fma-sphere.gc index 9462128944..e0a543f0b1 100644 --- a/goal_src/jak2/engine/anim/fma-sphere.gc +++ b/goal_src/jak2/engine/anim/fma-sphere.gc @@ -40,12 +40,12 @@ ) -(defmethod run-logic? fma-sphere ((obj fma-sphere)) +(defmethod run-logic? fma-sphere ((this fma-sphere)) (or (logtest? *display-scene-control* (scene-controls display-controls)) - (and *display-nav-marks* (logtest? (-> obj mode) (fma-sphere-mode nav))) - (logtest? (-> obj mode) (fma-sphere-mode deadly-overlap)) - (>= (-> obj track-joint) 0) - (-> obj first-time?) + (and *display-nav-marks* (logtest? (-> this mode) (fma-sphere-mode nav))) + (logtest? (-> this mode) (fma-sphere-mode deadly-overlap)) + (>= (-> this track-joint) 0) + (-> this first-time?) ) ) @@ -70,7 +70,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self first-time?) #f) (if (logtest? (-> self mode) (fma-sphere-mode kill-once)) (send-event *traffic-manager* 'kill-traffic-sphere (-> self sphere)) @@ -84,7 +84,7 @@ ) (init-vf0-vector) (let ((v1-0 (-> self duration))) - (if (and (nonzero? v1-0) (>= (- (current-time) (-> self state-time)) v1-0)) + (if (and (nonzero? v1-0) (time-elapsed? (-> self state-time) v1-0)) (go empty-state) ) ) diff --git a/goal_src/jak2/engine/anim/joint-exploder.gc b/goal_src/jak2/engine/anim/joint-exploder.gc index 49f8706b5f..6d48d8430d 100644 --- a/goal_src/jak2/engine/anim/joint-exploder.gc +++ b/goal_src/jak2/engine/anim/joint-exploder.gc @@ -132,8 +132,8 @@ ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-exploder-joints ((obj joint-exploder-joints)) - (the-as int (+ (-> obj type size) (* 240 (-> obj num-joints)))) +(defmethod asize-of joint-exploder-joints ((this joint-exploder-joints)) + (the-as int (+ (-> this type size) (* 240 (-> this num-joints)))) ) (defmethod new joint-exploder-joints ((allocation symbol) (type-to-make type) (arg0 joint-exploder-static-params)) @@ -176,22 +176,22 @@ (none) ) -(defmethod remove-from-list-and-reset joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let ((v0-0 (remove-joint-from-list obj arg0 arg1))) - (let* ((v1-1 (-> obj joints)) +(defmethod remove-from-list-and-reset joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let ((v0-0 (remove-joint-from-list this arg0 arg1))) + (let* ((v1-1 (-> this joints)) (v1-2 (-> v1-1 joint arg1)) ) (set! (-> v1-2 mat quad 0) (the-as uint128 0)) (set! (-> v1-2 mat vector 1 quad) (the-as uint128 0)) (set! (-> v1-2 mat vector 2 quad) (the-as uint128 0)) - (set! (-> v1-2 mat trans quad) (-> obj root trans quad)) + (set! (-> v1-2 mat trans quad) (-> this root trans quad)) ) v0-0 ) ) -(defmethod remove-joint-from-list joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let* ((v1-0 (-> obj joints)) +(defmethod remove-joint-from-list joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let* ((v1-0 (-> this joints)) (a2-1 (-> v1-0 joint arg1)) (a0-4 (-> a2-1 prev)) (v0-0 (-> a2-1 next)) @@ -221,8 +221,8 @@ ) ) -(defmethod add-joint-to-list joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let* ((v1-0 (-> obj joints)) +(defmethod add-joint-to-list joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let* ((v1-0 (-> this joints)) (a3-0 (-> v1-0 joint arg1)) (a0-4 (-> arg0 head)) ) @@ -236,7 +236,7 @@ ) ) -(defmethod update-bbox-for-joint joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) +(defmethod update-bbox-for-joint joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) (let ((a1-1 (-> arg1 mat trans))) (cond ((-> arg0 bbox-valid?) @@ -253,7 +253,7 @@ (none) ) -(defmethod adjust-bbox-for-limits-along-axis joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod adjust-bbox-for-limits-along-axis joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-16 int) (sv-32 int) @@ -266,7 +266,7 @@ (let ((s5-0 (the-as joint-exploder-list #f))) (let ((v1-0 1)) (until (= v1-0 5) - (let ((a0-4 (-> obj lists v1-0))) + (let ((a0-4 (-> this lists v1-0))) (when (< (-> a0-4 head) 0) (set! s5-0 a0-4) (goto cfg-6) @@ -282,11 +282,11 @@ (set! (-> s5-0 bbox-valid?) #f) ) (else - (set! s5-0 (the-as joint-exploder-list (-> obj lists))) + (set! s5-0 (the-as joint-exploder-list (-> this lists))) ) ) (set! (-> arg0 bbox-valid?) #f) - (let ((s2-0 (-> obj joints))) + (let ((s2-0 (-> this joints))) (set! sv-32 (-> arg0 head)) (let ((s1-0 0) (s0-0 0) @@ -299,14 +299,14 @@ (set! sv-48 (-> s2-0 joint sv-32)) (cond ((>= (-> sv-48 mat trans x) f30-0) - (set! sv-16 (remove-joint-from-list obj arg0 sv-32)) - (add-joint-to-list obj s5-0 sv-32) + (set! sv-16 (remove-joint-from-list this arg0 sv-32)) + (add-joint-to-list this s5-0 sv-32) (set! sv-32 sv-16) - (update-bbox-for-joint obj s5-0 sv-48) + (update-bbox-for-joint this s5-0 sv-48) (+! s0-0 1) ) (else - (update-bbox-for-joint obj arg0 sv-48) + (update-bbox-for-joint this arg0 sv-48) (set! sv-32 (-> sv-48 next)) (+! s1-0 1) ) @@ -320,14 +320,14 @@ (set! sv-80 (-> s2-0 joint sv-32)) (cond ((>= (-> sv-80 mat trans y) f30-1) - (set! sv-64 (remove-joint-from-list obj arg0 sv-32)) - (add-joint-to-list obj s5-0 sv-32) + (set! sv-64 (remove-joint-from-list this arg0 sv-32)) + (add-joint-to-list this s5-0 sv-32) (set! sv-32 sv-64) - (update-bbox-for-joint obj s5-0 sv-80) + (update-bbox-for-joint this s5-0 sv-80) (+! s0-0 1) ) (else - (update-bbox-for-joint obj arg0 sv-80) + (update-bbox-for-joint this arg0 sv-80) (set! sv-32 (-> sv-80 next)) (+! s1-0 1) ) @@ -341,14 +341,14 @@ (set! sv-112 (-> s2-0 joint sv-32)) (cond ((>= (-> sv-112 mat trans z) f30-2) - (set! sv-96 (remove-joint-from-list obj arg0 sv-32)) - (add-joint-to-list obj s5-0 sv-32) + (set! sv-96 (remove-joint-from-list this arg0 sv-32)) + (add-joint-to-list this s5-0 sv-32) (set! sv-32 sv-96) - (update-bbox-for-joint obj s5-0 sv-112) + (update-bbox-for-joint this s5-0 sv-112) (+! s0-0 1) ) (else - (update-bbox-for-joint obj arg0 sv-112) + (update-bbox-for-joint this arg0 sv-112) (set! sv-32 (-> sv-112 next)) (+! s1-0 1) ) @@ -360,11 +360,11 @@ ) (cond ((zero? s0-0) - (final-adjust obj arg0 arg1) + (final-adjust this arg0 arg1) ) ((zero? s1-0) (if (not (-> s5-0 probeless?)) - (final-adjust obj s5-0 arg1) + (final-adjust this s5-0 arg1) ) ) ) @@ -375,10 +375,10 @@ ) ;; WARN: Return type mismatch symbol vs int. -(defmethod final-adjust joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod final-adjust joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-48 int) (sv-64 (inline-array joint-exploder-list)) (sv-80 joint-exploder-joint)) (set! (-> arg0 bbox-valid?) #f) - (let ((s3-0 (-> obj joints)) + (let ((s3-0 (-> this joints)) (s2-0 (-> arg0 head)) ) (while (>= s2-0 0) @@ -388,27 +388,27 @@ ) (set! (-> s1-0 min quad) (-> arg0 bbox min quad)) (set! (-> s1-0 max quad) (-> arg0 bbox max quad)) - (update-bbox-for-joint obj arg0 sv-80) + (update-bbox-for-joint this arg0 sv-80) (let* ((v1-7 arg1) (v1-8 (cond ((zero? v1-7) - (< (-> obj tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x))) + (< (-> this tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x))) ) ((= v1-7 1) - (< (-> obj tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y))) + (< (-> this tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y))) ) ((= v1-7 2) - (< (-> obj tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z))) + (< (-> this tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z))) ) ) ) ) (when v1-8 - (set! sv-48 (remove-joint-from-list obj arg0 s2-0)) - (set! sv-64 (-> obj lists)) - (add-joint-to-list obj (the-as joint-exploder-list sv-64) s2-0) + (set! sv-48 (remove-joint-from-list this arg0 s2-0)) + (set! sv-64 (-> this lists)) + (add-joint-to-list this (the-as joint-exploder-list sv-64) s2-0) (set! s2-0 sv-48) - (update-bbox-for-joint obj (the-as joint-exploder-list sv-64) sv-80) + (update-bbox-for-joint this (the-as joint-exploder-list sv-64) sv-80) (set! (-> arg0 bbox-valid?) s0-0) (set! (-> arg0 bbox min quad) (-> s1-0 min quad)) (set! (-> arg0 bbox max quad) (-> s1-0 max quad)) @@ -420,27 +420,27 @@ (the-as int #f) ) -(defmethod adjust-bbox-for-limits joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod adjust-bbox-for-limits joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0) (not (-> arg0 probeless?))) (let ((a2-0 -1)) (cond - ((< (-> obj tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x))) + ((< (-> this tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x))) (set! a2-0 0) ) - ((< (-> obj tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y))) + ((< (-> this tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y))) (set! a2-0 1) ) - ((< (-> obj tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z))) + ((< (-> this tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z))) (set! a2-0 2) ) ) (when (>= a2-0 0) - (let ((a1-2 (adjust-bbox-for-limits-along-axis obj arg0 a2-0))) + (let ((a1-2 (adjust-bbox-for-limits-along-axis this arg0 a2-0))) (if (not (-> a1-2 probeless?)) - (adjust-bbox-for-limits obj a1-2) + (adjust-bbox-for-limits this a1-2) ) ) - (adjust-bbox-for-limits obj arg0) + (adjust-bbox-for-limits this arg0) ) ) ) @@ -448,11 +448,11 @@ (none) ) -(defmethod integrate-and-kill joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod integrate-and-kill joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (set! (-> arg0 bbox-valid?) #f) (set! (-> arg0 pre-moved?) #t) - (let ((s4-0 (-> obj joints)) - (f30-0 (* (-> obj tuning gravity) (seconds-per-frame))) + (let ((s4-0 (-> this joints)) + (f30-0 (* (-> this tuning gravity) (seconds-per-frame))) (s3-0 (-> arg0 head)) ) (while (>= s3-0 0) @@ -464,13 +464,13 @@ (vector-v+! s1-0 s1-0 (-> s2-0 transv)) (matrix*! (-> s2-0 rmat) (-> s2-0 rmat) (-> s2-0 update-rmat)) (cond - ((or (< (-> s1-0 y) (-> obj die-if-below-y)) - (< (-> obj die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> obj root trans))) + ((or (< (-> s1-0 y) (-> this die-if-below-y)) + (< (-> this die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> this root trans))) ) - (set! s3-0 (remove-from-list-and-reset obj arg0 s3-0)) + (set! s3-0 (remove-from-list-and-reset this arg0 s3-0)) ) (else - (update-bbox-for-joint obj arg0 s2-0) + (update-bbox-for-joint this arg0 s2-0) (set! s3-0 (-> s2-0 next)) ) ) @@ -481,17 +481,17 @@ (none) ) -(defmethod do-collision-response joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod do-collision-response joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 collide-with) (the-as collide-spec (-> obj static-params collide-spec))) - (set! (-> s5-0 ignore-process0) obj) + (set! (-> s5-0 collide-with) (the-as collide-spec (-> this static-params collide-spec))) + (set! (-> s5-0 ignore-process0) this) (set! (-> s5-0 ignore-process1) #f) (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> s5-0 action-mask) (collide-action solid)) (mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer (-> arg0 bbox)) 32) (fill-using-bounding-box *collide-cache* s5-0) ) - (let ((s5-1 (-> obj joints)) + (let ((s5-1 (-> this joints)) (v1-6 (-> arg0 head)) ) (while (>= v1-6 0) @@ -503,7 +503,7 @@ (set! (-> s2-0 start-pos quad) (-> s4-1 prev-pos quad)) (let ((v1-11 s2-0)) (set! (-> v1-11 radius) 40.96) - (set! (-> v1-11 collide-with) (the-as collide-spec (-> obj static-params collide-spec))) + (set! (-> v1-11 collide-with) (the-as collide-spec (-> this static-params collide-spec))) (set! (-> v1-11 ignore-process0) #f) (set! (-> v1-11 ignore-process1) #f) (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) @@ -517,8 +517,8 @@ (vector-reflect! (-> s4-1 transv) (-> s4-1 transv) (-> s2-0 best-other-tri normal)) (let ((f30-0 (-> s4-1 transv y))) (set! (-> s4-1 transv y) 0.0) - (vector-normalize! (-> s4-1 transv) (* f28-0 (-> obj tuning hit-xz-reaction))) - (set! (-> s4-1 transv y) (* f30-0 (-> obj tuning hit-y-reaction))) + (vector-normalize! (-> s4-1 transv) (* f28-0 (-> this tuning hit-xz-reaction))) + (set! (-> s4-1 transv y) (* f30-0 (-> this tuning hit-y-reaction))) ) ) (+! (-> s3-0 y) (* 40.96 (-> s2-0 best-other-tri normal y))) @@ -536,7 +536,7 @@ (defstate joint-exploder-shatter (joint-exploder) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let* ((f0-1 (the float (- (current-time) (-> self state-time)))) @@ -586,8 +586,8 @@ 0 ) :code (behavior () - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (-> self tuning duration)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (-> self tuning duration)) (suspend) (ja :num! (loop!)) ) @@ -595,10 +595,10 @@ :post ja-post ) -(defmethod init-joint-list joint-exploder ((obj joint-exploder)) - (let ((gp-0 (-> obj joints))) +(defmethod init-joint-list joint-exploder ((this joint-exploder)) + (let ((gp-0 (-> this joints))) (dotimes (s4-0 (-> gp-0 num-joints)) - (let ((v1-2 (-> obj static-params joints s4-0)) + (let ((v1-2 (-> this static-params joints s4-0)) (s3-0 (-> gp-0 joint s4-0)) ) (let ((a0-6 (-> v1-2 parent-joint-index))) @@ -610,7 +610,7 @@ (if (zero? a0-6) (set! a0-6 (-> v1-2 joint-index)) ) - (let* ((a3-0 (-> (the-as process-drawable (-> obj parent 0)) node-list data a0-6 bone transform)) + (let* ((a3-0 (-> (the-as process-drawable (-> this parent 0)) node-list data a0-6 bone transform)) (a2-0 (-> s3-0 mat)) (v1-9 (-> a3-0 quad 0)) (a0-8 (-> a3-0 quad 1)) @@ -625,7 +625,7 @@ (matrix-identity! (-> s3-0 rmat)) ) (else - (let* ((a3-2 (-> obj node-list data (-> v1-2 joint-index) bone transform)) + (let* ((a3-2 (-> this node-list data (-> v1-2 joint-index) bone transform)) (a2-1 (-> s3-0 mat)) (v1-15 (-> a3-2 quad 0)) (a0-11 (-> a3-2 quad 1)) @@ -641,21 +641,21 @@ ) ) ) - (case (-> obj tuning explosion) + (case (-> this tuning explosion) ((1) - (vector-! (-> s3-0 transv) (-> s3-0 mat trans) (-> obj tuning fountain-rand-transv-lo)) + (vector-! (-> s3-0 transv) (-> s3-0 mat trans) (-> this tuning fountain-rand-transv-lo)) (vector-normalize! (-> s3-0 transv) - (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi x) (-> obj tuning fountain-rand-transv-hi y)) + (rand-vu-float-range (-> this tuning fountain-rand-transv-hi x) (-> this tuning fountain-rand-transv-hi y)) ) (+! (-> s3-0 transv y) - (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi z) (-> obj tuning fountain-rand-transv-hi w)) + (rand-vu-float-range (-> this tuning fountain-rand-transv-hi z) (-> this tuning fountain-rand-transv-hi w)) ) (set! (-> s3-0 transv w) 1.0) ) (else - (let ((s0-0 (-> obj tuning fountain-rand-transv-lo)) - (s1-1 (-> obj tuning fountain-rand-transv-hi)) + (let ((s0-0 (-> this tuning fountain-rand-transv-lo)) + (s1-1 (-> this tuning fountain-rand-transv-hi)) ) (set-vector! (-> s3-0 transv) @@ -672,7 +672,7 @@ (s1-2 (new 'stack-no-clear 'quaternion)) ) (vector-normalize! s2-4 1.0) - (quaternion-vector-angle! s1-2 s2-4 (* 182.04445 (-> obj tuning rot-speed))) + (quaternion-vector-angle! s1-2 s2-4 (* 182.04445 (-> this tuning rot-speed))) (quaternion->matrix (-> s3-0 update-rmat) s1-2) ) ) @@ -681,7 +681,7 @@ (let ((v1-32 (-> gp-0 joint (+ (-> gp-0 num-joints) -1)))) (set! (-> v1-32 next) -1) ) - (let ((v1-33 (-> obj lists 1))) + (let ((v1-33 (-> this lists 1))) (set! (-> v1-33 head) 0) (let ((s5-1 (-> v1-33 bbox))) (let ((v1-34 (-> gp-0 joint 0 mat trans))) @@ -700,11 +700,11 @@ ) ;; WARN: Return type mismatch process-drawable vs joint-exploder. -(defmethod relocate joint-exploder ((obj joint-exploder) (arg0 int)) - (if (nonzero? (-> obj joints)) - (&+! (-> obj joints) arg0) +(defmethod relocate joint-exploder ((this joint-exploder) (arg0 int)) + (if (nonzero? (-> this joints)) + (&+! (-> this joints) arg0) ) - (the-as joint-exploder ((method-of-type process-drawable relocate) obj arg0)) + (the-as joint-exploder ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/engine/anim/joint-mod-h.gc b/goal_src/jak2/engine/anim/joint-mod-h.gc index a2b2a369d8..d9317e0908 100644 --- a/goal_src/jak2/engine/anim/joint-mod-h.gc +++ b/goal_src/jak2/engine/anim/joint-mod-h.gc @@ -131,9 +131,9 @@ (none) ) -(defmethod reset-blend! joint-mod ((obj joint-mod)) - (set! (-> obj blend) 0.0) - obj +(defmethod reset-blend! joint-mod ((this joint-mod)) + (set! (-> this blend) 0.0) + this ) (define *joint-axis-vectors* (new 'static 'inline-array vector 6 @@ -339,6 +339,7 @@ ) +;; WARN: Return type mismatch object vs none. (defun joint-mod-set-world-callback ((arg0 cspace) (arg1 transformq)) (let ((v1-0 (the-as joint-mod-set-world (-> arg0 param1)))) (if (-> v1-0 enable) @@ -480,6 +481,7 @@ ) +;; WARN: Return type mismatch object vs none. (defun joint-mod-blend-world-callback ((arg0 cspace) (arg1 transformq)) (rlet ((vf0 :class vf) (vf4 :class vf) diff --git a/goal_src/jak2/engine/anim/joint-mod.gc b/goal_src/jak2/engine/anim/joint-mod.gc index d884ced028..7f4c8691b5 100644 --- a/goal_src/jak2/engine/anim/joint-mod.gc +++ b/goal_src/jak2/engine/anim/joint-mod.gc @@ -323,16 +323,16 @@ ) ) -(defmethod handle-copy! joint-mod-ik ((obj joint-mod-ik) (arg0 vector)) - (set! (-> obj handle-pos quad) (-> arg0 quad)) +(defmethod handle-copy! joint-mod-ik ((this joint-mod-ik) (arg0 vector)) + (set! (-> this handle-pos quad) (-> arg0 quad)) 0 (none) ) -(defmethod enable-set! joint-mod-ik ((obj joint-mod-ik) (arg0 symbol)) +(defmethod enable-set! joint-mod-ik ((this joint-mod-ik) (arg0 symbol)) (if arg0 - (logior! (-> obj flags) (joint-mod-ik-flags enable)) - (logclear! (-> obj flags) (joint-mod-ik-flags enable)) + (logior! (-> this flags) (joint-mod-ik-flags enable)) + (logclear! (-> this flags) (joint-mod-ik-flags enable)) ) 0 (none) @@ -589,107 +589,107 @@ ) ;; WARN: Return type mismatch joint-mod vs none. -(defmethod mode-set! joint-mod ((obj joint-mod) (arg0 joint-mod-mode)) - (set! (-> obj mode) arg0) - (let ((v1-0 (-> obj joint))) +(defmethod mode-set! joint-mod ((this joint-mod) (arg0 joint-mod-mode)) + (set! (-> this mode) arg0) + (let ((v1-0 (-> this joint))) (case arg0 (((joint-mod-mode flex-blend)) (set! (-> v1-0 param0) #f) - (set! (-> obj blend) 0.0) - (set! (-> obj flex-blend) 1.0) + (set! (-> this blend) 0.0) + (set! (-> this flex-blend) 1.0) ) (((joint-mod-mode reset)) (set! (-> v1-0 param0) #f) - (set! (-> obj blend) 0.0) - (set! (-> obj shutting-down?) #f) + (set! (-> this blend) 0.0) + (set! (-> this shutting-down?) #f) ) (((joint-mod-mode look-at)) (let ((a0-4 v1-0)) (set! (-> a0-4 param0) joint-mod-look-at-handler) - (set! (-> a0-4 param1) obj) + (set! (-> a0-4 param1) this) ) ) (((joint-mod-mode gun-look-at)) (let ((a0-5 v1-0)) (set! (-> a0-5 param0) joint-mod-gun-look-at-handler) - (set! (-> a0-5 param1) obj) + (set! (-> a0-5 param1) this) ) ) (((joint-mod-mode foot-rot)) - (set-vector! (-> obj twist) 0.0 1.0 0.0 1.0) + (set-vector! (-> this twist) 0.0 1.0 0.0 1.0) (let ((a0-7 v1-0)) (set! (-> a0-7 param0) (lambda ((arg0 cspace) (arg1 transformq)) (joint-mod-foot-rot-handler arg0 arg1) (none)) ) - (set! (-> a0-7 param1) obj) + (set! (-> a0-7 param1) this) ) ) (((joint-mod-mode world-look-at)) (let ((a0-8 v1-0)) (set! (-> a0-8 param0) joint-mod-world-look-at-handler) - (set! (-> a0-8 param1) obj) + (set! (-> a0-8 param1) this) ) ) (((joint-mod-mode polar-look-at)) (let ((a0-9 v1-0)) (set! (-> a0-9 param0) joint-mod-polar-look-at-handler) - (set! (-> a0-9 param1) obj) + (set! (-> a0-9 param1) this) ) - (set! (-> obj polar-internal-tilt-max) 32768.0) - (set! (-> obj polar-internal-radius) 32768.0) - (set! (-> obj polar-external-tilt-max) 32768.0) - (set! (-> obj polar-external-radius) 32768.0) + (set! (-> this polar-internal-tilt-max) 32768.0) + (set! (-> this polar-internal-radius) 32768.0) + (set! (-> this polar-external-tilt-max) 32768.0) + (set! (-> this polar-external-radius) 32768.0) ) (((joint-mod-mode rotate)) (let ((a0-11 v1-0)) (set! (-> a0-11 param0) joint-mod-rotate-handler) - (set! (-> a0-11 param1) obj) + (set! (-> a0-11 param1) this) ) - (set! (-> obj blend) 1.0) + (set! (-> this blend) 1.0) ) (((joint-mod-mode rotate2)) (let ((a0-13 v1-0)) (set! (-> a0-13 param0) joint-mod-rotate-handler) - (set! (-> a0-13 param1) obj) + (set! (-> a0-13 param1) this) ) - (set! (-> obj blend) 1.0) + (set! (-> this blend) 1.0) ) (((joint-mod-mode joint-set)) (let ((a0-15 v1-0)) (set! (-> a0-15 param0) joint-mod-joint-set-handler) - (set! (-> a0-15 param1) obj) + (set! (-> a0-15 param1) this) ) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) ) (((joint-mod-mode joint-set-world)) (let ((a0-18 v1-0)) (set! (-> a0-18 param0) joint-mod-joint-set-world-handler) - (set! (-> a0-18 param1) obj) + (set! (-> a0-18 param1) this) ) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) - (set! (-> obj flex-blend) 1.0) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) + (set! (-> this flex-blend) 1.0) ) (((joint-mod-mode joint-set*)) (let ((a0-25 v1-0)) (set! (-> a0-25 param0) joint-mod-joint-set*-handler) - (set! (-> a0-25 param1) obj) + (set! (-> a0-25 param1) this) ) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) ) (((joint-mod-mode joint-set*-world)) (let ((a0-29 v1-0)) (set! (-> a0-29 param0) joint-mod-joint-set*-world-handler) - (set! (-> a0-29 param1) obj) + (set! (-> a0-29 param1) this) ) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) ) ) ) @@ -697,49 +697,49 @@ ) ;; WARN: Return type mismatch joint-mod vs none. -(defmethod shut-down joint-mod ((obj joint-mod)) - (set! (-> obj shutting-down?) #t) - (set! (-> obj blend) 0.0) +(defmethod shut-down joint-mod ((this joint-mod)) + (set! (-> this shutting-down?) #t) + (set! (-> this blend) 0.0) (none) ) -(defmethod twist-set! joint-mod ((obj joint-mod) (arg0 float) (arg1 float) (arg2 float)) +(defmethod twist-set! joint-mod ((this joint-mod) (arg0 float) (arg1 float) (arg2 float)) (if arg0 - (set! (-> obj twist x) arg0) + (set! (-> this twist x) arg0) ) (if arg1 - (set! (-> obj twist y) arg1) + (set! (-> this twist y) arg1) ) (if arg2 - (set! (-> obj twist z) arg2) + (set! (-> this twist z) arg2) ) - (-> obj twist) + (-> this twist) ) -(defmethod trs-set! joint-mod ((obj joint-mod) (arg0 vector) (arg1 quaternion) (arg2 vector)) +(defmethod trs-set! joint-mod ((this joint-mod) (arg0 vector) (arg1 quaternion) (arg2 vector)) (if arg0 - (set! (-> obj trans quad) (-> arg0 quad)) + (set! (-> this trans quad) (-> arg0 quad)) ) (if arg1 - (quaternion-copy! (-> obj quat) arg1) + (quaternion-copy! (-> this quat) arg1) ) (if arg2 - (set! (-> obj scale quad) (-> arg2 quad)) + (set! (-> this scale quad) (-> arg2 quad)) ) 0 (none) ) -(defmethod target-set! joint-mod ((obj joint-mod) (arg0 vector)) - (if (= (-> obj mode) (joint-mod-mode reset)) - (mode-set! obj (joint-mod-mode look-at)) +(defmethod target-set! joint-mod ((this joint-mod) (arg0 vector)) + (if (= (-> this mode) (joint-mod-mode reset)) + (mode-set! this (joint-mod-mode look-at)) ) - (let ((f0-0 (vector-vector-distance (-> obj process root trans) arg0))) - (set! (-> obj shutting-down?) #f) - (set! (-> obj target quad) (-> arg0 quad)) - (if (< f0-0 (-> obj max-dist)) - (set! (-> obj blend) 1.0) - (set! (-> obj blend) 0.0) + (let ((f0-0 (vector-vector-distance (-> this process root trans) arg0))) + (set! (-> this shutting-down?) #f) + (set! (-> this target quad) (-> arg0 quad)) + (if (< f0-0 (-> this max-dist)) + (set! (-> this blend) 1.0) + (set! (-> this blend) 0.0) ) ) 0 @@ -748,7 +748,7 @@ (define last-try-to-look-at-data (new 'global 'try-to-look-at-info)) -(defmethod look-at! joint-mod ((obj joint-mod) (arg0 vector) (arg1 symbol) (arg2 process)) +(defmethod look-at! joint-mod ((this joint-mod) (arg0 vector) (arg1 symbol) (arg2 process)) (when (= arg1 'attacking) (let* ((s2-0 arg2) (s1-0 (if (type? s2-0 process-drawable) @@ -764,8 +764,8 @@ ) ) (when s2-1 - (when (< (vector-vector-distance (-> obj process root trans) (-> s1-0 root trans)) (-> s2-1 cam-notice-dist)) - (set! (-> obj notice-time) (current-time)) + (when (< (vector-vector-distance (-> this process root trans) (-> s1-0 root trans)) (-> s2-1 cam-notice-dist)) + (set-time! (-> this notice-time)) (set! (-> last-try-to-look-at-data who) (process->handle arg2)) (if (< (-> last-try-to-look-at-data vert) (-> s2-1 cam-vert)) (set! (-> last-try-to-look-at-data vert) (-> s2-1 cam-vert)) @@ -779,21 +779,21 @@ ) ) ) - (let ((f30-0 (vector-vector-distance (-> obj process root trans) arg0))) + (let ((f30-0 (vector-vector-distance (-> this process root trans) arg0))) (if (logtest? (process-mask enemy) (-> arg2 mask)) - (+! (-> obj loock-at-count) (the int (lerp-scale 256.0 0.0 f30-0 20480.0 204800.0))) + (+! (-> this loock-at-count) (the int (lerp-scale 256.0 0.0 f30-0 20480.0 204800.0))) ) - (when (and (or (= (-> obj blend) 0.0) - (or (< f30-0 (vector-vector-distance (-> obj process root trans) (-> obj target))) (= arg1 'force)) + (when (and (or (= (-> this blend) 0.0) + (or (< f30-0 (vector-vector-distance (-> this process root trans) (-> this target))) (= arg1 'force)) ) - (< f30-0 (-> obj max-dist)) + (< f30-0 (-> this max-dist)) ) - (if (= (-> obj mode) (joint-mod-mode reset)) - (mode-set! obj (joint-mod-mode look-at)) + (if (= (-> this mode) (joint-mod-mode reset)) + (mode-set! this (joint-mod-mode look-at)) ) - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj blend) 1.0) - (set! (-> obj shutting-down?) #f) + (set! (-> this target quad) (-> arg0 quad)) + (set! (-> this blend) 1.0) + (set! (-> this shutting-down?) #f) ) ) 0 diff --git a/goal_src/jak2/engine/anim/joint.gc b/goal_src/jak2/engine/anim/joint.gc index 5ea031cf4e..291c0cfdab 100644 --- a/goal_src/jak2/engine/anim/joint.gc +++ b/goal_src/jak2/engine/anim/joint.gc @@ -10,44 +10,44 @@ ;; DECOMP BEGINS -(defmethod print joint ((obj joint)) - (format #t "#<~A ~S ~D @ #x~X>" (-> obj type) (-> obj name) (-> obj number) obj) - obj +(defmethod print joint ((this joint)) + (format #t "#<~A ~S ~D @ #x~X>" (-> this type) (-> this name) (-> this number) this) + this ) -(defmethod mem-usage joint ((obj joint) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage joint ((this joint) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 68 (-> arg0 length))) (set! (-> arg0 data 67 name) "joint") (+! (-> arg0 data 67 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 67 used) v1-6) (+! (-> arg0 data 67 total) (logand -16 (+ v1-6 15))) ) - obj + this ) -(defmethod print joint-anim ((obj joint-anim)) - (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> obj type) (-> obj name) (-> obj number) (-> obj length) obj) - obj +(defmethod print joint-anim ((this joint-anim)) + (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> this type) (-> this name) (-> this number) (-> this length) this) + this ) -(defmethod length joint-anim ((obj joint-anim)) - (-> obj length) +(defmethod length joint-anim ((this joint-anim)) + (-> this length) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-matrix ((obj joint-anim-matrix)) - (the-as int (+ (-> joint-anim-matrix size) (* (-> obj length) 64))) +(defmethod asize-of joint-anim-matrix ((this joint-anim-matrix)) + (the-as int (+ (-> joint-anim-matrix size) (* (-> this length) 64))) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-transformq ((obj joint-anim-transformq)) - (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> obj length)))) +(defmethod asize-of joint-anim-transformq ((this joint-anim-transformq)) + (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> this length)))) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-drawable ((obj joint-anim-drawable)) - (the-as int (+ (-> joint-anim-drawable size) (* (-> obj length) 4))) +(defmethod asize-of joint-anim-drawable ((this joint-anim-drawable)) + (the-as int (+ (-> joint-anim-drawable size) (* (-> this length) 4))) ) (defun joint-anim-login ((arg0 joint-anim-drawable)) @@ -71,18 +71,18 @@ arg0 ) -(defmethod mem-usage joint-anim-drawable ((obj joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage joint-anim-drawable ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 80 (-> arg0 length))) (set! (-> arg0 data 79 name) "joint-anim-drawable") (+! (-> arg0 data 79 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 79 used) v1-6) (+! (-> arg0 data 79 total) (logand -16 (+ v1-6 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) (defun jacc-mem-usage ((arg0 joint-anim-compressed-control) (arg1 memory-usage-block) (arg2 int)) @@ -112,11 +112,11 @@ arg0 ) -(defmethod print joint-control-channel ((obj joint-control-channel)) +(defmethod print joint-control-channel ((this joint-control-channel)) (let ((t9-0 format) (a0-1 #t) (a1-0 "#") - (v1-0 (-> obj command)) + (v1-0 (-> this command)) ) (t9-0 a0-1 @@ -144,17 +144,17 @@ "*unknown*" ) ) - (-> obj frame-group) - (-> obj frame-num) - obj + (-> this frame-group) + (-> this frame-num) + this ) ) - obj + this ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-control ((obj joint-control)) - (the-as int (+ (-> obj type size) (* (-> obj allocated-length) 64))) +(defmethod asize-of joint-control ((this joint-control)) + (the-as int (+ (-> this type size) (* (-> this allocated-length) 64))) ) (defmethod new joint-control ((allocation symbol) (type-to-make type) (arg0 int)) @@ -177,10 +177,10 @@ ) ) -(defmethod debug-print-channels joint-control ((obj joint-control) (arg0 symbol)) +(defmethod debug-print-channels joint-control ((this joint-control) (arg0 symbol)) (format arg0 "~0K") - (dotimes (s4-0 (the-as int (+ (-> obj active-channels) (-> obj float-channels)))) - (let* ((s3-0 (-> obj channel s4-0)) + (dotimes (s4-0 (the-as int (+ (-> this active-channels) (-> this float-channels)))) + (let* ((s3-0 (-> this channel s4-0)) (s2-0 (if (and (-> s3-0 frame-group) (nonzero? (-> s3-0 frame-group))) (-> s3-0 frame-group) ) @@ -189,7 +189,7 @@ (let* ((t9-1 format) (a0-3 arg0) (a1-2 "~S~2d ~C ~-35S ") - (a2-0 (if (= (-> obj root-channel) s3-0) + (a2-0 (if (= (-> this root-channel) s3-0) "~3Lch:~0L" "ch:" ) @@ -254,7 +254,7 @@ 0.0 ) ) - (-> s3-0 frame-interp (-> obj active-frame-interp)) + (-> s3-0 frame-interp (-> this active-frame-interp)) (* 0.003921569 (the float (-> s3-0 inspector-amount))) ) ) @@ -264,130 +264,130 @@ 0 ) -(defmethod needs-link? art ((obj art)) +(defmethod needs-link? art ((this art)) #f ) ;; WARN: Return type mismatch symbol vs basic. -(defmethod get-art-by-name-method art ((obj art) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method art ((this art) (arg0 string) (arg1 type)) (the-as basic #f) ) -(defmacro get-art-by-name (obj name type) +(defmacro get-art-by-name (this name type) "Helper macro for casting the result of get-art-by-name-method. Generated by decompiler." - `(the-as ,type (get-art-by-name-method ,obj ,name ,type)) + `(the-as ,type (get-art-by-name-method ,this ,name ,type)) ) ;; WARN: Return type mismatch symbol vs int. -(defmethod get-art-idx-by-name-method art ((obj art) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method art ((this art) (arg0 string) (arg1 type)) (the-as int #f) ) -(defmethod print art ((obj art)) - (format #t "#<~A ~S :length ~D @ #x~X>" (-> obj type) (-> obj name) (-> obj length) obj) - obj +(defmethod print art ((this art)) + (format #t "#<~A ~S :length ~D @ #x~X>" (-> this type) (-> this name) (-> this length) this) + this ) -(defmethod length art ((obj art)) - (-> obj length) +(defmethod length art ((this art)) + (-> this length) ) -(defmethod login art ((obj art)) - (if (and (-> obj extra) (zero? (-> obj extra tag))) - (set! (-> obj extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> obj extra)) 28))) +(defmethod login art ((this art)) + (if (and (-> this extra) (zero? (-> this extra tag))) + (set! (-> this extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> this extra)) 28))) ) - obj + this ) -(defmethod mem-usage art-mesh-anim ((obj art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-mesh-anim ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 75 (-> arg0 length))) (set! (-> arg0 data 74 name) "art-mesh-anim") (+! (-> arg0 data 74 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 74 used) v1-6) (+! (-> arg0 data 74 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod mem-usage art-joint-anim ((obj art-joint-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-joint-anim ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 78 (-> arg0 length))) (set! (-> arg0 data 77 name) "art-joint-anim") (+! (-> arg0 data 77 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 77 used) v1-6) (+! (-> arg0 data 77 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (jacc-mem-usage (-> obj frames) arg0 arg1) - (when (and (nonzero? (-> obj eye-anim)) (-> obj eye-anim)) + (jacc-mem-usage (-> this frames) arg0 arg1) + (when (and (nonzero? (-> this eye-anim)) (-> this eye-anim)) (set! (-> arg0 length) (max 112 (-> arg0 length))) (set! (-> arg0 data 111 name) "eye-anim") (+! (-> arg0 data 111 count) 1) - (let ((v1-26 (* (* (+ (-> obj eye-anim max-frame) 1) 2) 8))) + (let ((v1-26 (* (* (+ (-> this eye-anim max-frame) 1) 2) 8))) (+! (-> arg0 data 111 used) v1-26) (+! (-> arg0 data 111 total) (logand -16 (+ v1-26 15))) ) ) - obj + this ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-joint-anim ((obj art-joint-anim)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-joint-anim ((this art-joint-anim)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) -(defmethod inspect art-group ((obj art-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tinfo: ~A~%" (-> obj info)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (if (-> obj data s5-0) - (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> obj data s5-0) (mem-size (-> obj data s5-0) #f 0)) - (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> obj data s5-0) 0) +(defmethod inspect art-group ((this art-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tinfo: ~A~%" (-> this info)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (if (-> this data s5-0) + (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> this data s5-0) (mem-size (-> this data s5-0) #f 0)) + (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> this data s5-0) 0) ) ) - obj + this ) -(defmethod needs-link? art-group ((obj art-group)) - (and (nonzero? (-> obj length)) - (type? (-> obj data 0) art-joint-anim) - (!= (-> obj name) (-> (the-as art-joint-anim (-> obj data 0)) master-art-group-name)) +(defmethod needs-link? art-group ((this art-group)) + (and (nonzero? (-> this length)) + (type? (-> this data 0) art-joint-anim) + (!= (-> this name) (-> (the-as art-joint-anim (-> this data 0)) master-art-group-name)) ) ) ;; WARN: Return type mismatch art-element vs basic. -(defmethod get-art-by-name-method art-group ((obj art-group) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method art-group ((this art-group) (arg0 string) (arg1 type)) (cond (arg1 - (let ((s3-0 (+ (length (-> obj name)) 1))) - (dotimes (s2-0 (-> obj length)) - (if (and (-> obj data s2-0) - (= (-> obj data s2-0 type) arg1) - (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) + (let ((s3-0 (+ (length (-> this name)) 1))) + (dotimes (s2-0 (-> this length)) + (if (and (-> this data s2-0) + (= (-> this data s2-0 type) arg1) + (or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) ) - (return (the-as basic (-> obj data s2-0))) + (return (the-as basic (-> this data s2-0))) ) ) ) (the-as art-element #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (and (-> obj data s4-1) (name= arg0 (-> obj data s4-1 name))) - (return (the-as basic (-> obj data s4-1))) + (dotimes (s4-1 (-> this length)) + (if (and (-> this data s4-1) (name= arg0 (-> this data s4-1 name))) + (return (the-as basic (-> this data s4-1))) ) ) (the-as art-element #f) @@ -395,14 +395,14 @@ ) ) -(defmethod get-art-idx-by-name-method art-group ((obj art-group) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method art-group ((this art-group) (arg0 string) (arg1 type)) (cond (arg1 - (let ((s3-0 (+ (length (-> obj name)) 1))) - (dotimes (s2-0 (-> obj length)) - (if (and (-> obj data s2-0) - (= (-> obj data s2-0 type) arg1) - (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) + (let ((s3-0 (+ (length (-> this name)) 1))) + (dotimes (s2-0 (-> this length)) + (if (and (-> this data s2-0) + (= (-> this data s2-0 type) arg1) + (or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) ) (return s2-0) ) @@ -411,8 +411,8 @@ (the-as int #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (and (-> obj data s4-1) (name= arg0 (-> obj data s4-1 name))) + (dotimes (s4-1 (-> this length)) + (if (and (-> this data s4-1) (name= arg0 (-> this data s4-1 name))) (return s4-1) ) ) @@ -421,49 +421,49 @@ ) ) -(defmethod login art-group ((obj art-group)) - (dotimes (s5-0 (-> obj length)) - (if (-> obj data s5-0) - (set! (-> obj data s5-0) (login (-> obj data s5-0))) +(defmethod login art-group ((this art-group)) + (dotimes (s5-0 (-> this length)) + (if (-> this data s5-0) + (set! (-> this data s5-0) (login (-> this data s5-0))) ) ) - obj + this ) -(defmethod mem-usage art-group ((obj art-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-group ((this art-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 74 (-> arg0 length))) (set! (-> arg0 data 73 name) "art-group") (+! (-> arg0 data 73 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 73 used) v1-6) (+! (-> arg0 data 73 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (if (-> obj data s3-0) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (if (-> this data s3-0) + (mem-usage (-> this data s3-0) arg0 arg1) ) ) - obj + this ) ;; WARN: Return type mismatch art-group vs none. -(defmethod relocate art-group ((obj art-group) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate art-group ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) (let ((s4-0 (clear *temp-string*))) (string<-charp s4-0 arg1) - (set! obj + (set! this (cond - ((not obj) + ((not this) (format 0 "ERROR: art-group ~A is not a valid file.~%" s4-0) (the-as art-group #f) ) - ((not (type? obj art-group)) + ((not (type? this art-group)) (format 0 "ERROR: art-group ~A is not a art-group.~%" s4-0) (the-as art-group #f) ) - ((not (file-info-correct-version? (-> obj info) (file-kind art-group) 0)) + ((not (file-info-correct-version? (-> this info) (file-kind art-group) 0)) (the-as art-group #f) ) (else @@ -476,8 +476,8 @@ (format 0 "ERROR: illegal login of art ~A (in level ~A) to level ~A~%" - obj - (get-level-by-heap-ptr-and-status *level* (the-as pointer obj) 'loading) + this + (get-level-by-heap-ptr-and-status *level* (the-as pointer this) 'loading) s5-1 ) (break!) @@ -485,12 +485,12 @@ ) ((or (not s5-1) (= (-> s5-1 name) 'default)) ) - ((!= (get-level-by-heap-ptr-and-status *level* (the-as pointer obj) 'loading) s5-1) + ((!= (get-level-by-heap-ptr-and-status *level* (the-as pointer this) 'loading) s5-1) (format 0 "ERROR: illegal login of art ~A (in level ~A) to level ~A~%" - obj - (get-level-by-heap-ptr-and-status *level* (the-as pointer obj) 'loading) + this + (get-level-by-heap-ptr-and-status *level* (the-as pointer this) 'loading) s5-1 ) (break!) @@ -498,16 +498,16 @@ ) ) (when (or (not s5-1) (= (-> s5-1 name) 'default)) - (login obj) - (if (needs-link? obj) - (link-art! obj) + (login this) + (if (needs-link? this) + (link-art! this) ) ) (if s5-1 - (set-loaded-art (-> s5-1 art-group) obj) + (set-loaded-art (-> s5-1 art-group) this) ) ) - obj + this ) ) ) @@ -516,30 +516,30 @@ ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-mesh-geo ((obj art-mesh-geo)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-mesh-geo ((this art-mesh-geo)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) -(defmethod mem-usage art-mesh-geo ((obj art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-mesh-geo ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 76 (-> arg0 length))) (set! (-> arg0 data 75 name) "art-mesh-geo") (+! (-> arg0 data 75 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 75 used) v1-6) (+! (-> arg0 data 75 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod login art-mesh-geo ((obj art-mesh-geo)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (the-as object (-> obj data s5-0)))) +(defmethod login art-mesh-geo ((this art-mesh-geo)) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (the-as object (-> this data s5-0)))) (dotimes (s3-0 (-> (the-as (pointer int16) s4-0) 3)) (if (-> (the-as (pointer art) (+ (* s3-0 4) (the-as int s4-0))) 2) (login (the-as drawable (-> (the-as (pointer art) (+ (* s3-0 4) (the-as int s4-0))) 2))) @@ -547,36 +547,36 @@ ) ) ) - obj + this ) -(defmethod login art-joint-anim ((obj art-joint-anim)) - (if (and (-> obj extra) (zero? (-> obj extra tag))) - (set! (-> obj extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> obj extra)) 28))) +(defmethod login art-joint-anim ((this art-joint-anim)) + (if (and (-> this extra) (zero? (-> this extra tag))) + (set! (-> this extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> this extra)) 28))) ) - obj + this ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-joint-geo ((obj art-joint-geo)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-joint-geo ((this art-joint-geo)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; WARN: Return type mismatch joint vs basic. -(defmethod get-art-by-name-method art-joint-geo ((obj art-joint-geo) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 - (dotimes (s3-0 (-> obj length)) - (if (and (= (-> obj data s3-0 type) arg1) (name= arg0 (-> obj data s3-0 name))) - (return (the-as basic (-> obj data s3-0))) + (dotimes (s3-0 (-> this length)) + (if (and (= (-> this data s3-0 type) arg1) (name= arg0 (-> this data s3-0 name))) + (return (the-as basic (-> this data s3-0))) ) ) (the-as joint #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (name= arg0 (-> obj data s4-1 name)) - (return (the-as basic (-> obj data s4-1))) + (dotimes (s4-1 (-> this length)) + (if (name= arg0 (-> this data s4-1 name)) + (return (the-as basic (-> this data s4-1))) ) ) (the-as joint #f) @@ -584,19 +584,19 @@ ) ) -(defmethod get-art-idx-by-name-method art-joint-geo ((obj art-joint-geo) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 - (dotimes (s3-0 (-> obj length)) - (if (and (= (-> obj data s3-0 type) arg1) (name= arg0 (-> obj data s3-0 name))) + (dotimes (s3-0 (-> this length)) + (if (and (= (-> this data s3-0 type) arg1) (name= arg0 (-> this data s3-0 name))) (return s3-0) ) ) (the-as int #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (name= arg0 (-> obj data s4-1 name)) + (dotimes (s4-1 (-> this length)) + (if (name= arg0 (-> this data s4-1 name)) (return s4-1) ) ) @@ -605,21 +605,21 @@ ) ) -(defmethod mem-usage art-joint-geo ((obj art-joint-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-joint-geo ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 77 (-> arg0 length))) (set! (-> arg0 data 76 name) "art-joint-geo") (+! (-> arg0 data 76 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 76 used) v1-6) (+! (-> arg0 data 76 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) (defbehavior joint-control-channel-eval process ((arg0 joint-control-channel)) @@ -1103,14 +1103,14 @@ (the-as matrix (-> arg0 data)) ) -(defmethod reset-and-assign-geo! cspace ((obj cspace) (arg0 drawable)) - (set! (-> obj parent) #f) - (set! (-> obj joint) #f) - (set! (-> obj geo) arg0) - (set! (-> obj param0) #f) - (set! (-> obj param1) #f) - (set! (-> obj param2) #f) - obj +(defmethod reset-and-assign-geo! cspace ((this cspace) (arg0 drawable)) + (set! (-> this parent) #f) + (set! (-> this joint) #f) + (set! (-> this geo) arg0) + (set! (-> this param0) #f) + (set! (-> this param1) #f) + (set! (-> this param2) #f) + this ) (defmethod new cspace ((allocation symbol) (type-to-make type) (arg0 drawable)) @@ -1625,17 +1625,17 @@ 0 ) -(defmethod print art-joint-anim-manager-slot ((obj art-joint-anim-manager-slot)) +(defmethod print art-joint-anim-manager-slot ((this art-joint-anim-manager-slot)) (let* ((gp-0 format) (s5-0 #t) (s4-0 "#") - (v1-0 (-> obj anim)) + (v1-0 (-> this anim)) (s3-0 (if v1-0 (-> v1-0 name) ) ) - (s1-0 (-> obj comp-data)) - (v1-1 (-> obj anim)) + (s1-0 (-> this comp-data)) + (v1-1 (-> this anim)) ) (gp-0 s5-0 @@ -1646,36 +1646,36 @@ (-> v1-1 frames fixed) 0 ) - (if (-> obj anim) + (if (-> this anim) (sar (used-bytes-for-slot *anim-manager* - (the-as int (/ (the-as int (- (the-as uint obj) (the-as uint (the-as uint (-> *anim-manager* slot))))) 16)) + (the-as int (/ (the-as int (- (the-as uint this) (the-as uint (the-as uint (-> *anim-manager* slot))))) 16)) ) 10 ) 0 ) - (-> obj time-stamp) + (-> this time-stamp) ) ) - obj + this ) -(defmethod used-bytes-for-slot art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 int)) - (let ((v1-2 (-> obj slot arg0))) - (if (< arg0 (+ (-> obj free-index) -1)) +(defmethod used-bytes-for-slot art-joint-anim-manager ((this art-joint-anim-manager) (arg0 int)) + (let ((v1-2 (-> this slot arg0))) + (if (< arg0 (+ (-> this free-index) -1)) (&- - (the-as pointer (-> obj slot (+ arg0 1) anim frames fixed)) + (the-as pointer (-> this slot (+ arg0 1) anim frames fixed)) (the-as uint (the-as pointer (-> v1-2 anim frames fixed))) ) - (&- (the-as pointer (-> obj kheap current)) (the-as uint (the-as pointer (-> v1-2 anim frames fixed)))) + (&- (the-as pointer (-> this kheap current)) (the-as uint (the-as pointer (-> v1-2 anim frames fixed)))) ) ) ) -(defmethod unload-from-slot art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 int)) - (let* ((s3-0 (-> obj slot arg0)) +(defmethod unload-from-slot art-joint-anim-manager ((this art-joint-anim-manager) (arg0 int)) + (let* ((s3-0 (-> this slot arg0)) (s5-0 (-> s3-0 anim)) ) (let ((s2-0 (the-as object (-> s5-0 frames fixed)))) @@ -1698,10 +1698,10 @@ (set! (-> v1-6 flags) (logand -3 (-> v1-6 flags))) ) (cond - ((< arg0 (+ (-> obj free-index) -1)) - (let ((s1-0 (- (the-as uint (-> obj slot (+ arg0 1) anim frames fixed)) (the-as uint s2-0)))) - (let ((s0-0 (+ (- -1 arg0) (-> obj free-index)))) - (let ((a2-6 (&- (-> obj kheap current) (the-as uint (+ (the-as uint s2-0) s1-0))))) + ((< arg0 (+ (-> this free-index) -1)) + (let ((s1-0 (- (the-as uint (-> this slot (+ arg0 1) anim frames fixed)) (the-as uint s2-0)))) + (let ((s0-0 (+ (- -1 arg0) (-> this free-index)))) + (let ((a2-6 (&- (-> this kheap current) (the-as uint (+ (the-as uint s2-0) s1-0))))) (if (< (the-as int a2-6) 2560) (qmem-copy<-! (the-as pointer s2-0) (the-as pointer (+ (the-as uint s2-0) s1-0)) (the-as int a2-6)) (ultimate-memcpy (the-as pointer s2-0) (the-as pointer (+ (the-as uint s2-0) s1-0)) (the-as uint a2-6)) @@ -1709,7 +1709,7 @@ ) (qmem-copy<-! (the-as pointer s3-0) (the-as pointer (&+ s3-0 16)) (* s0-0 16)) (dotimes (v1-20 s0-0) - (let ((a0-21 (-> obj slot (+ arg0 v1-20) anim frames))) + (let ((a0-21 (-> this slot (+ arg0 v1-20) anim frames))) (set! (-> a0-21 fixed) (the-as joint-anim-compressed-fixed (- (the-as uint (-> a0-21 fixed)) s1-0))) (dotimes (a1-9 (the-as int (-> a0-21 num-frames))) (set! (-> a0-21 data a1-9) (the-as joint-anim-compressed-frame (- (the-as uint (-> a0-21 data a1-9)) s1-0))) @@ -1717,16 +1717,16 @@ ) ) ) - (set! s3-0 (-> obj slot (+ (-> obj free-index) -1))) - (set! (-> obj kheap current) (the pointer (- (the uint (-> obj kheap current)) (the-as uint s1-0)))) + (set! s3-0 (-> this slot (+ (-> this free-index) -1))) + (set! (-> this kheap current) (the pointer (- (the uint (-> this kheap current)) (the-as uint s1-0)))) ) ) (else - (set! (-> obj kheap current) (the-as pointer s2-0)) + (set! (-> this kheap current) (the-as pointer s2-0)) ) ) ) - (+! (-> obj free-index) -1) + (+! (-> this free-index) -1) (set! (-> s3-0 anim) #f) (set! (-> s3-0 time-stamp) (the-as uint 0)) (set! (-> s3-0 comp-data) (the-as uint 0)) @@ -1734,43 +1734,43 @@ ) ) -(defmethod update-time-stamp art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 art-joint-anim)) - (countdown (v1-0 (-> obj free-index)) - (when (= arg0 (-> obj slot v1-0 anim)) - (set! (-> obj slot v1-0 time-stamp) (the-as uint (-> *display* base-clock frame-counter))) +(defmethod update-time-stamp art-joint-anim-manager ((this art-joint-anim-manager) (arg0 art-joint-anim)) + (countdown (v1-0 (-> this free-index)) + (when (= arg0 (-> this slot v1-0 anim)) + (set! (-> this slot v1-0 time-stamp) (the-as uint (-> *display* base-clock frame-counter))) (return arg0) ) ) arg0 ) -(defmethod decompress art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 art-joint-anim)) +(defmethod decompress art-joint-anim-manager ((this art-joint-anim-manager) (arg0 art-joint-anim)) (let* ((s5-0 (-> arg0 frames)) (s3-0 (* (+ (-> s5-0 fixed-qwc) (* (-> s5-0 num-frames) (-> s5-0 frame-qwc))) 16)) ) - (while (or (< (the-as uint (&- (-> obj kheap top) (the-as uint (-> obj kheap current)))) (+ s3-0 64)) - (>= (-> obj free-index) 64) + (while (or (< (the-as uint (&- (-> this kheap top) (the-as uint (-> this kheap current)))) (+ s3-0 64)) + (>= (-> this free-index) 64) ) (let ((a1-2 -1)) (let ((a0-3 0)) - (dotimes (v1-2 (-> obj free-index)) - (when (or (< a1-2 0) (< (the-as int (-> obj slot v1-2 time-stamp)) a0-3)) - (set! a0-3 (the-as int (-> obj slot v1-2 time-stamp))) + (dotimes (v1-2 (-> this free-index)) + (when (or (< a1-2 0) (< (the-as int (-> this slot v1-2 time-stamp)) a0-3)) + (set! a0-3 (the-as int (-> this slot v1-2 time-stamp))) (set! a1-2 v1-2) ) ) ) - (unload-from-slot obj a1-2) + (unload-from-slot this a1-2) ) ) - (let ((v1-15 (-> obj slot (-> obj free-index)))) + (let ((v1-15 (-> this slot (-> this free-index)))) 0 - (+! (-> obj free-index) 1) + (+! (-> this free-index) 1) (set! (-> v1-15 anim) arg0) (set! (-> v1-15 time-stamp) (the-as uint (-> *display* base-clock frame-counter))) (set! (-> v1-15 comp-data) (the-as uint (-> s5-0 fixed))) ) - (let ((s4-1 (kmalloc (-> obj kheap) (the-as int s3-0) (kmalloc-flags) "malloc"))) + (let ((s4-1 (kmalloc (-> this kheap) (the-as int s3-0) (kmalloc-flags) "malloc"))) (unpack-comp-lzo (the-as (pointer uint8) s4-1) (the-as (pointer uint8) (-> s5-0 fixed))) (set! (-> s5-0 flags) (logand -2 (-> s5-0 flags))) (logior! (-> s5-0 flags) 2) @@ -1789,15 +1789,15 @@ arg0 ) -(defmethod unload-from-level art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 level)) +(defmethod unload-from-level art-joint-anim-manager ((this art-joint-anim-manager) (arg0 level)) (let ((s5-0 (-> arg0 heap base)) (s4-0 (-> arg0 heap top-base)) ) - (countdown (s3-0 (-> obj free-index)) - (if (and (>= (the-as int (-> obj slot s3-0 anim)) (the-as int s5-0)) - (< (the-as int (-> obj slot s3-0 anim)) (the-as int s4-0)) + (countdown (s3-0 (-> this free-index)) + (if (and (>= (the-as int (-> this slot s3-0 anim)) (the-as int s5-0)) + (< (the-as int (-> this slot s3-0 anim)) (the-as int s4-0)) ) - (unload-from-slot obj s3-0) + (unload-from-slot this s3-0) ) ) ) diff --git a/goal_src/jak2/engine/anim/mspace-h.gc b/goal_src/jak2/engine/anim/mspace-h.gc index 18587e73a6..08154f7f85 100644 --- a/goal_src/jak2/engine/anim/mspace-h.gc +++ b/goal_src/jak2/engine/anim/mspace-h.gc @@ -90,15 +90,15 @@ (set! (-> cspace-array heap-base) (the-as uint 32)) -(defmethod print cspace ((obj cspace)) +(defmethod print cspace ((this cspace)) (format #t "#" - (if (-> obj joint) - (-> obj joint name) + (if (-> this joint) + (-> this joint name) "nojoint" ) - obj + this ) - obj + this ) diff --git a/goal_src/jak2/engine/camera/cam-debug.gc b/goal_src/jak2/engine/camera/cam-debug.gc index 58ef695bf4..2d5db9bc14 100644 --- a/goal_src/jak2/engine/camera/cam-debug.gc +++ b/goal_src/jak2/engine/camera/cam-debug.gc @@ -818,16 +818,16 @@ ) ) -(defmethod debug-point-info tracking-spline ((obj tracking-spline) (arg0 int)) - (if (= arg0 (-> obj used-point)) +(defmethod debug-point-info tracking-spline ((this tracking-spline) (arg0 int)) + (if (= arg0 (-> this used-point)) (format 0 "u") (format 0 " ") ) - (if (= arg0 (-> obj next-to-last-point)) + (if (= arg0 (-> this next-to-last-point)) (format 0 "n") (format 0 " ") ) - (if (= arg0 (-> obj end-point)) + (if (= arg0 (-> this end-point)) (format 0 "e") (format 0 " ") ) @@ -837,33 +837,33 @@ 0 " ~D ~M ~M ~M~%" arg0 - (-> obj point arg0 position x) - (-> obj point arg0 position y) - (-> obj point arg0 position z) + (-> this point arg0 position x) + (-> this point arg0 position y) + (-> this point arg0 position z) ) ) 0 (none) ) -(defmethod debug-all-points tracking-spline ((obj tracking-spline)) - (let ((s5-0 (-> obj used-point))) +(defmethod debug-all-points tracking-spline ((this tracking-spline)) + (let ((s5-0 (-> this used-point))) (while (!= s5-0 -134250495) - (debug-point-info obj s5-0) - (set! s5-0 (-> obj point s5-0 next)) + (debug-point-info this s5-0) + (set! s5-0 (-> this point s5-0 next)) ) - (debug-point-info obj s5-0) + (debug-point-info this s5-0) ) 0 (none) ) -(defmethod debug-draw-spline tracking-spline ((obj tracking-spline)) - (let ((s5-0 (-> obj used-point))) - (let ((s4-0 (-> obj point (-> obj used-point) next))) +(defmethod debug-draw-spline tracking-spline ((this tracking-spline)) + (let ((s5-0 (-> this used-point))) + (let ((s4-0 (-> this point (-> this used-point) next))) (let ((s3-0 (new 'stack-no-clear 'vector))) (when (!= s4-0 -134250495) - (tracking-spline-method-19 obj 0.0 s3-0 (the-as tracking-spline-sampler #f)) + (tracking-spline-method-19 this 0.0 s3-0 (the-as tracking-spline-sampler #f)) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) @@ -871,7 +871,7 @@ (new 'static 'vector4w :x #xff :w #x80) (meters 0.25) ) - (tracking-spline-method-19 obj (-> obj sample-len) s3-0 (the-as tracking-spline-sampler #f)) + (tracking-spline-method-19 this (-> this sample-len) s3-0 (the-as tracking-spline-sampler #f)) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) @@ -883,19 +883,19 @@ ) (while (!= s4-0 -134250495) (camera-line - (the-as vector (-> obj point s5-0)) - (the-as vector (-> obj point s4-0)) + (the-as vector (-> this point s5-0)) + (the-as vector (-> this point s4-0)) (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) ) (set! s5-0 s4-0) - (set! s4-0 (-> obj point s4-0 next)) + (set! s4-0 (-> this point s4-0 next)) ) ) (if (!= s5-0 -134250495) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) - (the-as vector (-> obj point s5-0)) + (the-as vector (-> this point s5-0)) (new 'static 'vector4w :x #xff :w #x80) (meters 0.25) ) @@ -903,13 +903,13 @@ ) (let ((s5-1 (new 'stack-no-clear 'vector))) (camera-line - (-> obj debug-out-position) - (-> obj debug-old-position) + (-> this debug-out-position) + (-> this debug-old-position) (new 'static 'vector4w :x #xff :y #xff :w #x80) ) - (vector-! s5-1 (-> obj debug-out-position) (-> obj debug-old-position)) - (tracking-spline-method-20 obj s5-1 (-> obj debug-last-point)) - (camera-line-rel (-> obj debug-old-position) s5-1 (new 'static 'vector4w :x #xff :z #xff :w #x80)) + (vector-! s5-1 (-> this debug-out-position) (-> this debug-old-position)) + (tracking-spline-method-20 this s5-1 (-> this debug-last-point)) + (camera-line-rel (-> this debug-old-position) s5-1 (new 'static 'vector4w :x #xff :z #xff :w #x80)) ) 0 (none) diff --git a/goal_src/jak2/engine/camera/cam-master.gc b/goal_src/jak2/engine/camera/cam-master.gc index 392ab26038..cd591fd3ec 100644 --- a/goal_src/jak2/engine/camera/cam-master.gc +++ b/goal_src/jak2/engine/camera/cam-master.gc @@ -8,8 +8,8 @@ ;; DECOMP BEGINS -(defmethod camera-master-method-16 camera-master ((obj camera-master) (arg0 symbol)) - (let ((a2-0 (the-as target (handle->process (-> obj focus handle)))) +(defmethod camera-master-method-16 camera-master ((this camera-master) (arg0 symbol)) + (let ((a2-0 (the-as target (handle->process (-> this focus handle)))) (v1-4 0) ) (if a2-0 @@ -61,11 +61,11 @@ (set! (-> self string-max target z) (-> self settings string-max-length)) (set! (-> self string-push-z) (fmax (-> self string-min value z) (-> *CAMERA-bank* default-string-push-z))) (cond - ((>= (- (current-time) (get-notice-time (the-as process-focusable gp-0))) (-> *CAMERA-bank* attack-timeout)) + ((time-elapsed? (get-notice-time (the-as process-focusable gp-0)) (-> *CAMERA-bank* attack-timeout)) (set! (-> self being-attacked) #f) ) (else - (set! (-> self attack-start) (current-time)) + (set-time! (-> self attack-start)) (set! (-> self being-attacked) #t) (when (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) (set! (-> self string-max target y) (fmax (-> self string-max target y) (-> last-try-to-look-at-data vert))) @@ -115,12 +115,12 @@ (gp-0 (logior! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) (cond - ((>= (- (current-time) (get-notice-time (the-as target gp-0))) (-> *CAMERA-bank* attack-timeout)) + ((time-elapsed? (get-notice-time (the-as target gp-0)) (-> *CAMERA-bank* attack-timeout)) (set! (-> self being-attacked) #f) ) (else (if (not (-> self being-attacked)) - (set! (-> self attack-start) (current-time)) + (set-time! (-> self attack-start)) ) (set! (-> self being-attacked) #t) (when (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) @@ -920,7 +920,7 @@ ) ) (('part-water-drip) - (set! (-> self water-drip-time) (current-time)) + (set-time! (-> self water-drip-time)) (set! (-> self water-drip-mult) (the-as float (-> block param 0))) (set! (-> self water-drip-speed) (the-as float (-> block param 1))) ) @@ -1075,17 +1075,17 @@ (none) ) -(defmethod camera-master-method-14 camera-master ((obj camera-master) (arg0 vector)) - (if (handle->process (-> obj focus handle)) - (vector-! arg0 (-> obj tpos-curr) (-> obj tpos-old)) +(defmethod camera-master-method-14 camera-master ((this camera-master) (arg0 vector)) + (if (handle->process (-> this focus handle)) + (vector-! arg0 (-> this tpos-curr) (-> this tpos-old)) (vector-reset! arg0) ) arg0 ) -(defmethod camera-master-method-15 camera-master ((obj camera-master) (arg0 vector)) - (if (and (-> obj slave) (-> obj slave 0 next-state) (= (-> obj slave 0 next-state name) 'cam-string)) - (set! (-> arg0 quad) (-> obj slave 0 view-flat quad)) +(defmethod camera-master-method-15 camera-master ((this camera-master) (arg0 vector)) + (if (and (-> this slave) (-> this slave 0 next-state) (= (-> this slave 0 next-state name) 'cam-string)) + (set! (-> arg0 quad) (-> this slave 0 view-flat quad)) (vector-reset! arg0) ) arg0 diff --git a/goal_src/jak2/engine/camera/cam-states.gc b/goal_src/jak2/engine/camera/cam-states.gc index 6bfe892369..fe446d6abb 100644 --- a/goal_src/jak2/engine/camera/cam-states.gc +++ b/goal_src/jak2/engine/camera/cam-states.gc @@ -2294,7 +2294,7 @@ (if (-> self have-phony-joystick) (set! f28-0 (* 0.05 (-> self phony-joystick-y))) ) - (if (and (-> *camera* being-attacked) (< (- (current-time) (-> *camera* attack-start)) (seconds 0.25))) + (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05) ) (when (logtest? (cam-slave-options-u32 GUN_CAM) (-> self options)) diff --git a/goal_src/jak2/engine/camera/camera-defs-h.gc b/goal_src/jak2/engine/camera/camera-defs-h.gc index 26792c2b7f..970ccfb3df 100644 --- a/goal_src/jak2/engine/camera/camera-defs-h.gc +++ b/goal_src/jak2/engine/camera/camera-defs-h.gc @@ -45,6 +45,7 @@ :flag-assert #x900000030 ) + (define *CAMERA-bank* (new 'static 'camera-bank :collide-move-rad 1638.4 :min-detectable-velocity 40.96 @@ -73,6 +74,7 @@ :flag-assert #x900000024 ) + (define *CAMERA_MASTER-bank* (new 'static 'camera-master-bank :onscreen-head-height (meters 2.65) :onscreen-foot-height (meters -0.5) @@ -84,4 +86,3 @@ :pitch-off-blend 0.5 ) ) - diff --git a/goal_src/jak2/engine/camera/camera-h.gc b/goal_src/jak2/engine/camera/camera-h.gc index 1f003da17f..629141751a 100644 --- a/goal_src/jak2/engine/camera/camera-h.gc +++ b/goal_src/jak2/engine/camera/camera-h.gc @@ -154,57 +154,57 @@ ) -(defmethod init cam-float-seeker ((obj cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (set! (-> obj target) arg0) - (set! (-> obj value) arg0) - (set! (-> obj vel) 0.0) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj max-partial) arg3) +(defmethod init cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> this target) arg0) + (set! (-> this value) arg0) + (set! (-> this vel) 0.0) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this max-partial) arg3) 0 (none) ) -(defmethod copy-to cam-float-seeker ((obj cam-float-seeker) (arg0 cam-float-seeker)) - (set! (-> obj target) (-> arg0 target)) - (set! (-> obj value) (-> arg0 value)) - (set! (-> obj vel) (-> arg0 vel)) - (set! (-> obj accel) (-> arg0 accel)) - (set! (-> obj max-vel) (-> arg0 max-vel)) - (set! (-> obj max-partial) (-> arg0 max-partial)) +(defmethod copy-to cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker)) + (set! (-> this target) (-> arg0 target)) + (set! (-> this value) (-> arg0 value)) + (set! (-> this vel) (-> arg0 vel)) + (set! (-> this accel) (-> arg0 accel)) + (set! (-> this max-vel) (-> arg0 max-vel)) + (set! (-> this max-partial) (-> arg0 max-partial)) 0 (none) ) -(defmethod update! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) +(defmethod update! cam-float-seeker ((this cam-float-seeker) (arg0 float)) (with-pp 0.0 0.0 - (let* ((f1-2 (- (+ (-> obj target) arg0) (-> obj value))) - (f0-5 (* (-> obj max-partial) (fabs f1-2))) + (let* ((f1-2 (- (+ (-> this target) arg0) (-> this value))) + (f0-5 (* (-> this max-partial) (fabs f1-2))) ) - (let ((f1-3 (* f1-2 (* (-> obj accel) (-> pp clock time-adjust-ratio))))) - (+! (-> obj vel) f1-3) + (let ((f1-3 (* f1-2 (* (-> this accel) (-> pp clock time-adjust-ratio))))) + (+! (-> this vel) f1-3) ) - (let ((f1-6 (fabs (-> obj vel))) - (f0-6 (fmin f0-5 (-> obj max-vel))) + (let ((f1-6 (fabs (-> this vel))) + (f0-6 (fmin f0-5 (-> this max-vel))) ) (if (< f0-6 f1-6) - (set! (-> obj vel) (* (-> obj vel) (/ f0-6 f1-6))) + (set! (-> this vel) (* (-> this vel) (/ f0-6 f1-6))) ) ) ) - (let ((f0-10 (* (-> obj vel) (-> pp clock time-adjust-ratio)))) - (+! (-> obj value) f0-10) + (let ((f0-10 (* (-> this vel) (-> pp clock time-adjust-ratio)))) + (+! (-> this value) f0-10) ) 0 (none) ) ) -(defmethod jump-to-target! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) - (set! (-> obj value) (+ (-> obj target) arg0)) - (set! (-> obj vel) 0.0) +(defmethod jump-to-target! cam-float-seeker ((this cam-float-seeker) (arg0 float)) + (set! (-> this value) (+ (-> this target) arg0)) + (set! (-> this vel) 0.0) 0.0 ) @@ -226,51 +226,51 @@ ) -(defmethod init cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init cam-vector-seeker ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj value quad) (-> arg0 quad)) + (set! (-> this target quad) (-> arg0 quad)) + (set! (-> this value quad) (-> arg0 quad)) ) (else - (vector-reset! (-> obj target)) - (vector-reset! (-> obj value)) + (vector-reset! (-> this target)) + (vector-reset! (-> this value)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj max-partial) arg3) + (vector-reset! (-> this vel)) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this max-partial) arg3) 0 (none) ) -(defmethod update! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector)) +(defmethod update! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vector))) 0.0 (cond (arg0 - (vector+! v1-0 (-> obj target) arg0) - (vector-! v1-0 v1-0 (-> obj value)) + (vector+! v1-0 (-> this target) arg0) + (vector-! v1-0 v1-0 (-> this value)) ) (else - (vector-! v1-0 (-> obj target) (-> obj value)) + (vector-! v1-0 (-> this target) (-> this value)) ) ) - (let ((f0-2 (* (-> obj max-partial) (vector-length v1-0)))) - (vector-float*! v1-0 v1-0 (* (-> obj accel) (-> pp clock time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) v1-0) - (let ((f1-3 (vector-length (-> obj vel))) - (f0-3 (fmin f0-2 (-> obj max-vel))) + (let ((f0-2 (* (-> this max-partial) (vector-length v1-0)))) + (vector-float*! v1-0 v1-0 (* (-> this accel) (-> pp clock time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) v1-0) + (let ((f1-3 (vector-length (-> this vel))) + (f0-3 (fmin f0-2 (-> this max-vel))) ) (if (< f0-3 f1-3) - (vector-float*! (-> obj vel) (-> obj vel) (/ f0-3 f1-3)) + (vector-float*! (-> this vel) (-> this vel) (/ f0-3 f1-3)) ) ) ) - (vector-float*! v1-0 (-> obj vel) (-> pp clock time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) v1-0) + (vector-float*! v1-0 (-> this vel) (-> pp clock time-adjust-ratio)) + (vector+! (-> this value) (-> this value) v1-0) ) 0 (none) diff --git a/goal_src/jak2/engine/camera/camera.gc b/goal_src/jak2/engine/camera/camera.gc index 5891a7b913..d30327dd54 100644 --- a/goal_src/jak2/engine/camera/camera.gc +++ b/goal_src/jak2/engine/camera/camera.gc @@ -360,10 +360,10 @@ ) ) -(defmethod cam-index-method-9 cam-index ((obj cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) +(defmethod cam-index-method-9 cam-index ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) (local-vars (sv-32 (function _varargs_ object))) (format (clear *cam-res-string*) "~S-flags" arg0) - (set! (-> obj flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *cam-res-string*)))) + (set! (-> this flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *cam-res-string*)))) (let ((s3-2 (res-lump-data arg1 arg0 pointer)) (s0-1 (method-of-type res-lump get-property-struct)) ) @@ -389,18 +389,18 @@ (s3-2 (cond (v0-8 - (vector+! (the-as vector (-> obj vec)) (the-as vector (&+ s3-2 0)) (the-as vector v0-8)) - (vector+! (-> obj vec 1) (the-as vector (&+ s3-2 16)) (the-as vector v0-8)) + (vector+! (the-as vector (-> this vec)) (the-as vector (&+ s3-2 0)) (the-as vector v0-8)) + (vector+! (-> this vec 1) (the-as vector (&+ s3-2 16)) (the-as vector v0-8)) ) (else - (set! (-> obj vec 0 quad) (-> (the-as (pointer uint128) (&+ s3-2 0)))) - (set! (-> obj vec 1 quad) (-> (the-as (pointer uint128) (&+ s3-2 16)))) + (set! (-> this vec 0 quad) (-> (the-as (pointer uint128) (&+ s3-2 0)))) + (set! (-> this vec 1 quad) (-> (the-as (pointer uint128) (&+ s3-2 16)))) ) ) ) (arg3 - (set! (-> obj vec 0 quad) (-> arg3 cverts 0 quad)) - (set! (-> obj vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) + (set! (-> this vec 0 quad) (-> arg3 cverts 0 quad)) + (set! (-> this vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) ) (else (return #f) @@ -411,100 +411,100 @@ (let ((v1-11 (new-stack-vector0))) 0.0 (cond - ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) - (vector-! v1-11 (-> obj vec 1) arg2) - (set! (-> obj vec 1 w) (vector-length v1-11)) - (vector-! v1-11 (the-as vector (-> obj vec)) arg2) - (set! (-> obj vec 1 x) (vector-length v1-11)) - (set! (-> obj vec 1 w) (- (-> obj vec 1 w) (-> obj vec 1 x))) - (set! (-> obj vec 0 quad) (-> arg2 quad)) + ((logtest? (-> this flags) (cam-index-options SPHERICAL)) + (vector-! v1-11 (-> this vec 1) arg2) + (set! (-> this vec 1 w) (vector-length v1-11)) + (vector-! v1-11 (the-as vector (-> this vec)) arg2) + (set! (-> this vec 1 x) (vector-length v1-11)) + (set! (-> this vec 1 w) (- (-> this vec 1 w) (-> this vec 1 x))) + (set! (-> this vec 0 quad) (-> arg2 quad)) ) - ((logtest? (-> obj flags) (cam-index-options RADIAL)) - (vector-! v1-11 (-> obj vec 1) arg2) - (set! (-> obj vec 1 w) (vector-length v1-11)) - (vector-! v1-11 (the-as vector (-> obj vec)) arg2) - (set! (-> obj vec 1 x) (vector-length v1-11)) - (set! (-> obj vec 1 w) (- (-> obj vec 1 w) (-> obj vec 1 x))) - (set! (-> obj vec 0 quad) (-> arg2 quad)) + ((logtest? (-> this flags) (cam-index-options RADIAL)) + (vector-! v1-11 (-> this vec 1) arg2) + (set! (-> this vec 1 w) (vector-length v1-11)) + (vector-! v1-11 (the-as vector (-> this vec)) arg2) + (set! (-> this vec 1 x) (vector-length v1-11)) + (set! (-> this vec 1 w) (- (-> this vec 1 w) (-> this vec 1 x))) + (set! (-> this vec 0 quad) (-> arg2 quad)) ) (else - (vector-! (-> obj vec 1) (-> obj vec 1) (the-as vector (-> obj vec))) - (set! (-> obj vec 1 w) (vector-normalize-ret-len! (-> obj vec 1) 1.0)) + (vector-! (-> this vec 1) (-> this vec 1) (the-as vector (-> this vec))) + (set! (-> this vec 1 w) (vector-normalize-ret-len! (-> this vec 1) 1.0)) ) ) ) #t ) -(defmethod cam-index-method-10 cam-index ((obj cam-index) (arg0 vector)) +(defmethod cam-index-method-10 cam-index ((this cam-index) (arg0 vector)) (let ((s5-0 (new-stack-vector0))) 0.0 - (vector-! s5-0 arg0 (the-as vector (-> obj vec))) + (vector-! s5-0 arg0 (the-as vector (-> this vec))) (cond - ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) + ((logtest? (-> this flags) (cam-index-options SPHERICAL)) (vector-flatten! s5-0 s5-0 (-> *camera* local-down)) - (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) + (/ (- (vector-length s5-0) (-> this vec 1 x)) (-> this vec 1 w)) ) - ((logtest? (-> obj flags) (cam-index-options RADIAL)) - (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) + ((logtest? (-> this flags) (cam-index-options RADIAL)) + (/ (- (vector-length s5-0) (-> this vec 1 x)) (-> this vec 1 w)) ) (else - (/ (vector-dot s5-0 (-> obj vec 1)) (-> obj vec 1 w)) + (/ (vector-dot s5-0 (-> this vec 1)) (-> this vec 1 w)) ) ) ) ) -(defmethod tracking-spline-method-10 tracking-spline ((obj tracking-spline) (arg0 vector)) - (set! (-> obj point 0 position quad) (-> arg0 quad)) - (set! (-> obj point 0 next) -134250495) - (set! (-> obj summed-len) 0.0) - (set! (-> obj free-point) 1) - (set! (-> obj used-point) 0) - (set! (-> obj partial-point) 0.0) - (set! (-> obj end-point) 0) - (set! (-> obj next-to-last-point) -134250495) - (set! (-> obj max-move) 0.0) - (set! (-> obj sample-len) 0.0) - (set! (-> obj used-count) 1) - (set! (-> obj old-position quad) (-> arg0 quad)) +(defmethod tracking-spline-method-10 tracking-spline ((this tracking-spline) (arg0 vector)) + (set! (-> this point 0 position quad) (-> arg0 quad)) + (set! (-> this point 0 next) -134250495) + (set! (-> this summed-len) 0.0) + (set! (-> this free-point) 1) + (set! (-> this used-point) 0) + (set! (-> this partial-point) 0.0) + (set! (-> this end-point) 0) + (set! (-> this next-to-last-point) -134250495) + (set! (-> this max-move) 0.0) + (set! (-> this sample-len) 0.0) + (set! (-> this used-count) 1) + (set! (-> this old-position quad) (-> arg0 quad)) (let ((v1-6 1)) (while (!= v1-6 31) - (set! (-> obj point v1-6 next) (+ v1-6 1)) + (set! (-> this point v1-6 next) (+ v1-6 1)) (+! v1-6 1) ) - (set! (-> obj point v1-6 next) -134250495) + (set! (-> this point v1-6 next) -134250495) ) 0 (none) ) -(defmethod tracking-spline-method-13 tracking-spline ((obj tracking-spline) (arg0 int)) - (let ((v1-3 (-> obj point arg0 next))) +(defmethod tracking-spline-method-13 tracking-spline ((this tracking-spline) (arg0 int)) + (let ((v1-3 (-> this point arg0 next))) (cond ((= v1-3 -134250495) ) - ((= (-> obj point v1-3 next) -134250495) + ((= (-> this point v1-3 next) -134250495) ) (else - (set! (-> obj point arg0 next) (-> obj point v1-3 next)) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-3 tp-length))) - (set! (-> obj point v1-3 next) (-> obj free-point)) - (set! (-> obj free-point) v1-3) - (+! (-> obj point v1-3 incarnation) 1) - (let ((v1-11 (-> obj point arg0 next))) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point arg0 tp-length))) + (set! (-> this point arg0 next) (-> this point v1-3 next)) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-3 tp-length))) + (set! (-> this point v1-3 next) (-> this free-point)) + (set! (-> this free-point) v1-3) + (+! (-> this point v1-3 incarnation) 1) + (let ((v1-11 (-> this point arg0 next))) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point arg0 tp-length))) (vector-! - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 arg0))) - (the-as vector (-> obj point v1-11)) - (the-as vector (-> obj point arg0)) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 arg0))) + (the-as vector (-> this point v1-11)) + (the-as vector (-> this point arg0)) ) ) - (set! (-> obj point arg0 tp-length) - (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 arg0))) 1.0) + (set! (-> this point arg0 tp-length) + (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 arg0))) 1.0) ) - (+! (-> obj summed-len) (-> obj point arg0 tp-length)) - (+! (-> obj used-count) -1) + (+! (-> this summed-len) (-> this point arg0 tp-length)) + (+! (-> this used-count) -1) ) ) ) @@ -512,35 +512,37 @@ (none) ) -(defmethod tracking-spline-method-14 tracking-spline ((obj tracking-spline) (arg0 tracking-spline-sampler)) - (let ((v1-0 (-> obj used-point))) - (set! (-> obj partial-point) (-> arg0 partial-pt)) - (when (= (-> obj next-to-last-point) v1-0) - (set! (-> obj summed-len) (-> obj point v1-0 tp-length)) - (if (= (-> arg0 cur-pt) (-> obj end-point)) - (set! (-> obj partial-point) 0.99999) +(defmethod tracking-spline-method-14 tracking-spline ((this tracking-spline) (arg0 tracking-spline-sampler)) + (let ((v1-0 (-> this used-point))) + (set! (-> this partial-point) (-> arg0 partial-pt)) + (when (= (-> this next-to-last-point) v1-0) + (set! (-> this summed-len) (-> this point v1-0 tp-length)) + (if (= (-> arg0 cur-pt) (-> this end-point)) + (set! (-> this partial-point) 0.99999) ) ) (when (!= (-> arg0 cur-pt) v1-0) - (while (and (!= (-> obj point v1-0 next) (-> arg0 cur-pt)) (!= (-> obj point v1-0 next) (-> obj next-to-last-point))) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-0 tp-length))) - (+! (-> obj point v1-0 incarnation) 1) - (+! (-> obj used-count) -1) - (set! v1-0 (-> obj point v1-0 next)) + (while (and (!= (-> this point v1-0 next) (-> arg0 cur-pt)) + (!= (-> this point v1-0 next) (-> this next-to-last-point)) + ) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-0 tp-length))) + (+! (-> this point v1-0 incarnation) 1) + (+! (-> this used-count) -1) + (set! v1-0 (-> this point v1-0 next)) ) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-0 tp-length))) - (+! (-> obj point v1-0 incarnation) 1) - (+! (-> obj used-count) -1) - (set! (-> obj point v1-0 next) (-> obj free-point)) - (set! (-> obj free-point) (-> obj used-point)) - (set! (-> obj used-point) (-> arg0 cur-pt)) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-0 tp-length))) + (+! (-> this point v1-0 incarnation) 1) + (+! (-> this used-count) -1) + (set! (-> this point v1-0 next) (-> this free-point)) + (set! (-> this free-point) (-> this used-point)) + (set! (-> this used-point) (-> arg0 cur-pt)) (cond - ((= (-> arg0 cur-pt) (-> obj end-point)) - (set! (-> obj partial-point) 0.0) - (set! (-> obj summed-len) 0.0) + ((= (-> arg0 cur-pt) (-> this end-point)) + (set! (-> this partial-point) 0.0) + (set! (-> this summed-len) 0.0) ) - ((= (-> arg0 cur-pt) (-> obj next-to-last-point)) - (set! (-> obj summed-len) (-> obj point (-> obj next-to-last-point) tp-length)) + ((= (-> arg0 cur-pt) (-> this next-to-last-point)) + (set! (-> this summed-len) (-> this point (-> this next-to-last-point) tp-length)) ) ) ) @@ -549,30 +551,30 @@ (none) ) -(defmethod tracking-spline-method-15 tracking-spline ((obj tracking-spline)) +(defmethod tracking-spline-method-15 tracking-spline ((this tracking-spline)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 cur-pt) (-> obj used-point)) - (set! (-> s5-0 partial-pt) (-> obj partial-point)) - (tracking-spline-method-19 obj (-> obj sample-len) a2-0 s5-0) + (set! (-> s5-0 cur-pt) (-> this used-point)) + (set! (-> s5-0 partial-pt) (-> this partial-point)) + (tracking-spline-method-19 this (-> this sample-len) a2-0 s5-0) ) - (if (or (= (-> s5-0 cur-pt) (-> obj end-point)) - (= (-> s5-0 cur-pt) (-> obj next-to-last-point)) - (= (-> obj point (-> s5-0 cur-pt) next) (-> obj next-to-last-point)) + (if (or (= (-> s5-0 cur-pt) (-> this end-point)) + (= (-> s5-0 cur-pt) (-> this next-to-last-point)) + (= (-> this point (-> s5-0 cur-pt) next) (-> this next-to-last-point)) ) - (set! (-> s5-0 cur-pt) (-> obj used-point)) + (set! (-> s5-0 cur-pt) (-> this used-point)) ) - (let ((v1-15 (-> obj point (-> s5-0 cur-pt) next))) + (let ((v1-15 (-> this point (-> s5-0 cur-pt) next))) (when (!= v1-15 -134250495) - (let ((a0-14 (-> obj point v1-15 next)) + (let ((a0-14 (-> this point v1-15 next)) (a1-1 v1-15) (f0-2 -2.0) ) 0.0 - (while (not (or (= a0-14 -134250495) (= a0-14 (-> obj end-point)))) + (while (not (or (= a0-14 -134250495) (= a0-14 (-> this end-point)))) (let ((f1-2 (vector-dot - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 v1-15))) - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 a0-14))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-15))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 a0-14))) ) ) ) @@ -582,10 +584,10 @@ ) ) (set! v1-15 a0-14) - (set! a0-14 (-> obj point v1-15 next)) + (set! a0-14 (-> this point v1-15 next)) ) (if (< -2.0 f0-2) - (tracking-spline-method-13 obj a1-1) + (tracking-spline-method-13 this a1-1) ) ) ) @@ -595,35 +597,35 @@ (none) ) -(defmethod tracking-spline-method-16 tracking-spline ((obj tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-16 tracking-spline ((this tracking-spline) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 cur-pt) (-> obj used-point)) - (set! (-> s4-0 partial-pt) (-> obj partial-point)) - (tracking-spline-method-19 obj (-> obj sample-len) a2-0 s4-0) + (set! (-> s4-0 cur-pt) (-> this used-point)) + (set! (-> s4-0 partial-pt) (-> this partial-point)) + (tracking-spline-method-19 this (-> this sample-len) a2-0 s4-0) ) - (let ((s4-1 (-> obj point (-> s4-0 cur-pt) next))) + (let ((s4-1 (-> this point (-> s4-0 cur-pt) next))) (when (!= s4-1 -134250495) - (let ((v1-11 (-> obj point s4-1 next))) + (let ((v1-11 (-> this point s4-1 next))) (while (not (or (= v1-11 -134250495) - (= (-> obj point v1-11 next) -134250495) - (= (-> obj point v1-11 next) (-> obj end-point)) - (= (-> obj point v1-11 next) (-> obj next-to-last-point)) + (= (-> this point v1-11 next) -134250495) + (= (-> this point v1-11 next) (-> this end-point)) + (= (-> this point v1-11 next) (-> this next-to-last-point)) ) ) - (if (< (* (-> obj point s4-1 tp-length) + (if (< (* (-> this point s4-1 tp-length) (+ 1.0 (vector-dot - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s4-1))) - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 v1-11))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s4-1))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-11))) ) ) ) arg0 ) - (tracking-spline-method-13 obj s4-1) + (tracking-spline-method-13 this s4-1) (set! s4-1 v1-11) ) - (set! v1-11 (-> obj point s4-1 next)) + (set! v1-11 (-> this point s4-1 next)) ) ) ) @@ -633,40 +635,40 @@ (none) ) -(defmethod tracking-spline-method-17 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) - (let ((s3-0 (-> obj free-point)) - (s2-0 (-> obj end-point)) +(defmethod tracking-spline-method-17 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) + (let ((s3-0 (-> this free-point)) + (s2-0 (-> this end-point)) ) (vector-! - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s2-0))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s2-0))) arg0 - (the-as vector (-> obj point s2-0)) + (the-as vector (-> this point s2-0)) ) - (set! (-> obj point s2-0 tp-length) - (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s2-0))) 1.0) + (set! (-> this point s2-0 tp-length) + (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s2-0))) 1.0) ) - (if (< (-> obj point s2-0 tp-length) arg1) + (if (< (-> this point s2-0 tp-length) arg1) (return 0) ) (when (and arg3 (= s3-0 -134250495)) - (tracking-spline-method-15 obj) - (set! s3-0 (-> obj free-point)) + (tracking-spline-method-15 this) + (set! s3-0 (-> this free-point)) ) (cond ((= s3-0 -134250495) (format 0 "ERROR : pos spline overflow~%") ) (else - (+! (-> obj summed-len) (-> obj point s2-0 tp-length)) - (set! (-> obj free-point) (-> obj point s3-0 next)) - (set! (-> obj point s2-0 next) s3-0) - (set! (-> obj end-point) s3-0) - (set! (-> obj next-to-last-point) s2-0) - (set! (-> obj point s3-0 next) -134250495) - (set! (-> obj point s3-0 position quad) (-> arg0 quad)) - (+! (-> obj used-count) 1) + (+! (-> this summed-len) (-> this point s2-0 tp-length)) + (set! (-> this free-point) (-> this point s3-0 next)) + (set! (-> this point s2-0 next) s3-0) + (set! (-> this end-point) s3-0) + (set! (-> this next-to-last-point) s2-0) + (set! (-> this point s3-0 next) -134250495) + (set! (-> this point s3-0 position quad) (-> arg0 quad)) + (+! (-> this used-count) 1) (if (< 0.0 arg2) - (tracking-spline-method-16 obj arg2) + (tracking-spline-method-16 this arg2) ) ) ) @@ -675,29 +677,29 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod tracking-spline-method-18 tracking-spline ((obj tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-18 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (local-vars (f0-4 float)) (when (not arg2) (set! arg2 (new 'stack-no-clear 'tracking-spline-sampler)) - (set! (-> arg2 cur-pt) (-> obj used-point)) - (set! (-> arg2 partial-pt) (-> obj partial-point)) + (set! (-> arg2 cur-pt) (-> this used-point)) + (set! (-> arg2 partial-pt) (-> this partial-point)) ) 0.0 (until #f (cond - ((= (-> arg2 cur-pt) (-> obj end-point)) + ((= (-> arg2 cur-pt) (-> this end-point)) (set! (-> arg2 partial-pt) 0.0) - (vector+! arg1 arg1 (the-as vector (-> obj point (-> arg2 cur-pt)))) + (vector+! arg1 arg1 (the-as vector (-> this point (-> arg2 cur-pt)))) (return arg1) ) - ((begin (set! f0-4 (+ (-> arg2 partial-pt) (/ arg0 (-> obj point (-> arg2 cur-pt) tp-length)))) (< f0-4 1.0)) + ((begin (set! f0-4 (+ (-> arg2 partial-pt) (/ arg0 (-> this point (-> arg2 cur-pt) tp-length)))) (< f0-4 1.0)) (set! (-> arg2 partial-pt) f0-4) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) - (let ((a2-5 (-> obj point (-> arg2 cur-pt) next))) + (let ((a2-5 (-> this point (-> arg2 cur-pt) next))) (vector-lerp! (the-as vector s5-0) - (the-as vector (-> obj point (-> arg2 cur-pt))) - (the-as vector (-> obj point a2-5)) + (the-as vector (-> this point (-> arg2 cur-pt))) + (the-as vector (-> this point a2-5)) f0-4 ) ) @@ -706,11 +708,11 @@ (return arg1) ) (else - (let ((f0-7 (* (- 1.0 (-> arg2 partial-pt)) (-> obj point (-> arg2 cur-pt) tp-length)))) + (let ((f0-7 (* (- 1.0 (-> arg2 partial-pt)) (-> this point (-> arg2 cur-pt) tp-length)))) (set! arg0 (- arg0 f0-7)) ) (set! (-> arg2 partial-pt) 0.0) - (set! (-> arg2 cur-pt) (-> obj point (-> arg2 cur-pt) next)) + (set! (-> arg2 cur-pt) (-> this point (-> arg2 cur-pt) next)) ) ) ) @@ -718,18 +720,18 @@ (the-as vector #f) ) -(defmethod tracking-spline-method-19 tracking-spline ((obj tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-19 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (vector-reset! arg1) - (tracking-spline-method-18 obj arg0 arg1 arg2) + (tracking-spline-method-18 this arg0 arg1 arg2) arg1 ) -(defmethod tracking-spline-method-20 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 int)) +(defmethod tracking-spline-method-20 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! s3-0 - (the-as vector (-> obj point (-> obj used-point))) - (the-as vector (-> obj point (-> obj end-point))) + (the-as vector (-> this point (-> this used-point))) + (the-as vector (-> this point (-> this end-point))) ) (let* ((f0-0 (vector-length s3-0)) (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0)))) @@ -738,9 +740,9 @@ (let* ((f1-2 (fmax 0.0 f1-1)) (f30-0 (+ 0.3 f1-2)) (f0-1 (cond - ((< (-> *CAMERA-bank* min-detectable-velocity) (-> obj summed-len)) + ((< (-> *CAMERA-bank* min-detectable-velocity) (-> this summed-len)) (vector-float*! s3-0 s3-0 (/ 1.0 f0-0)) - (/ f0-0 (-> obj summed-len)) + (/ f0-0 (-> this summed-len)) ) (else (vector-reset! s3-0) @@ -751,15 +753,15 @@ (f0-2 (+ -0.2 f0-1)) (f0-3 (* 2.0 f0-2)) (f28-0 (fmin 1.0 (fmax 0.05 f0-3))) - (v1-18 (-> obj used-point)) + (v1-18 (-> this used-point)) (s2-0 (new 'stack-no-clear 'vector)) ) - (while (and (!= v1-18 (-> obj end-point)) (!= v1-18 (-> obj next-to-last-point)) (!= v1-18 arg1)) - (let ((s1-0 (-> obj point v1-18 next))) + (while (and (!= v1-18 (-> this end-point)) (!= v1-18 (-> this next-to-last-point)) (!= v1-18 arg1)) + (let ((s1-0 (-> this point v1-18 next))) (vector-! s2-0 - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s1-0))) - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 v1-18))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s1-0))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-18))) ) (let* ((f0-5 (vector-normalize-ret-len! s2-0 1.0)) (f0-6 (* 0.5 f0-5)) @@ -778,7 +780,7 @@ ((< f26-0 0.0) (if (and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (the-as vector (-> obj point s1-0)) + (the-as vector (-> this point s1-0)) s2-0 (* -40.96 f26-0) (new 'static 'vector4w :x #xff :y #xff :w #x80) @@ -788,7 +790,7 @@ ) ((and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (the-as vector (-> obj point s1-0)) + (the-as vector (-> this point s1-0)) s2-0 (* 40.96 f26-0) (new 'static 'vector4w :x #x80 :y #x80 :w #x80) @@ -806,102 +808,102 @@ (none) ) -(defmethod tracking-spline-method-21 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod tracking-spline-method-21 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (with-pp - (let ((v1-0 (-> obj used-point)) - (f0-0 (-> obj partial-point)) + (let ((v1-0 (-> this used-point)) + (f0-0 (-> this partial-point)) ) - (let ((f1-0 (-> obj summed-len))) + (let ((f1-0 (-> this summed-len))) 0.0 0.0 - (let* ((f2-5 (* (- f1-0 (* f0-0 (-> obj point v1-0 tp-length))) arg3)) - (f2-8 (* (fmin arg1 (- f2-5 (-> obj max-move))) (-> pp clock time-adjust-ratio))) + (let* ((f2-5 (* (- f1-0 (* f0-0 (-> this point v1-0 tp-length))) arg3)) + (f2-8 (* (fmin arg1 (- f2-5 (-> this max-move))) (-> pp clock time-adjust-ratio))) ) - (set! (-> obj max-move) (fmin arg2 (+ (-> obj max-move) f2-8))) + (set! (-> this max-move) (fmin arg2 (+ (-> this max-move) f2-8))) ) ) - (set! (-> obj max-move) (fmax 0.4096 (-> obj max-move))) - (let ((f1-8 (-> obj summed-len))) + (set! (-> this max-move) (fmax 0.4096 (-> this max-move))) + (let ((f1-8 (-> this summed-len))) 0.0 - (let* ((f1-9 (- f1-8 (* f0-0 (-> obj point v1-0 tp-length)))) - (f1-11 (fmin 204.8 (- f1-9 (-> obj sample-len)))) + (let* ((f1-9 (- f1-8 (* f0-0 (-> this point v1-0 tp-length)))) + (f1-11 (fmin 204.8 (- f1-9 (-> this sample-len)))) ) - (set! (-> obj sample-len) (fmin 16384.0 (+ (-> obj sample-len) f1-11))) + (set! (-> this sample-len) (fmin 16384.0 (+ (-> this sample-len) f1-11))) ) ) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (set! (-> s4-0 cur-pt) v1-0) (set! (-> s4-0 partial-pt) f0-0) - (tracking-spline-method-19 obj (* (-> obj max-move) (-> pp clock time-adjust-ratio)) arg0 s4-0) - (tracking-spline-method-14 obj s4-0) + (tracking-spline-method-19 this (* (-> this max-move) (-> pp clock time-adjust-ratio)) arg0 s4-0) + (tracking-spline-method-14 this s4-0) (dotimes (s3-0 63) - (tracking-spline-method-18 obj (* 0.015625 (-> obj sample-len)) arg0 s4-0) + (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 s4-0) ) (vector-float*! arg0 arg0 0.015625) (let ((a2-3 (-> s4-0 cur-pt))) - (set! (-> obj debug-last-point) a2-3) + (set! (-> this debug-last-point) a2-3) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> obj debug-old-position quad) (-> obj old-position quad)) - (set! (-> obj debug-out-position quad) (-> arg0 quad)) - (vector-! s4-1 arg0 (-> obj old-position)) - (tracking-spline-method-20 obj s4-1 a2-3) - (vector+! arg0 (-> obj old-position) s4-1) + (set! (-> this debug-old-position quad) (-> this old-position quad)) + (set! (-> this debug-out-position quad) (-> arg0 quad)) + (vector-! s4-1 arg0 (-> this old-position)) + (tracking-spline-method-20 this s4-1 a2-3) + (vector+! arg0 (-> this old-position) s4-1) ) ) ) ) - (set! (-> obj old-position quad) (-> arg0 quad)) + (set! (-> this old-position quad) (-> arg0 quad)) arg0 ) ) ;; WARN: Return type mismatch int vs symbol. -(defmethod tracking-spline-method-22 tracking-spline ((obj tracking-spline) (arg0 float)) - (when (< arg0 (-> obj summed-len)) +(defmethod tracking-spline-method-22 tracking-spline ((this tracking-spline) (arg0 float)) + (when (< arg0 (-> this summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 cur-pt) (-> obj used-point)) + (set! (-> s5-0 cur-pt) (-> this used-point)) (set! (-> s5-0 partial-pt) 0.0) - (tracking-spline-method-19 obj (- (-> obj summed-len) arg0) a2-0 s5-0) + (tracking-spline-method-19 this (- (-> this summed-len) arg0) a2-0 s5-0) ) - (tracking-spline-method-14 obj s5-0) + (tracking-spline-method-14 this s5-0) ) ) (the-as symbol 0) ) -(defmethod tracking-spline-method-9 tracking-spline ((obj tracking-spline)) - (let ((v1-0 (-> obj used-point)) +(defmethod tracking-spline-method-9 tracking-spline ((this tracking-spline)) + (let ((v1-0 (-> this used-point)) (s4-0 0) (s5-0 0) ) (while (!= v1-0 -134250495) (set! s5-0 (logior s5-0 (ash 1 v1-0))) (+! s4-0 1) - (set! v1-0 (-> obj point v1-0 next)) + (set! v1-0 (-> this point v1-0 next)) ) - (when (!= s4-0 (-> obj used-count)) + (when (!= s4-0 (-> this used-count)) (if *debug-segment* - (format 0 "ERROR: tracking spline used count ~D actual ~D~%" (-> obj used-count) s4-0) + (format 0 "ERROR: tracking spline used count ~D actual ~D~%" (-> this used-count) s4-0) ) - (set! (-> obj used-count) s4-0) + (set! (-> this used-count) s4-0) ) - (let ((v1-9 (-> obj free-point)) + (let ((v1-9 (-> this free-point)) (a3-1 0) ) (while (!= v1-9 -134250495) (+! a3-1 1) - (set! v1-9 (-> obj point v1-9 next)) + (set! v1-9 (-> this point v1-9 next)) ) - (when (!= a3-1 (- 32 (-> obj used-count))) + (when (!= a3-1 (- 32 (-> this used-count))) (if *debug-segment* - (format 0 "ERROR: tracking spline free count ~D actual ~D~%" (- 32 (-> obj used-count)) a3-1) + (format 0 "ERROR: tracking spline free count ~D actual ~D~%" (- 32 (-> this used-count)) a3-1) ) - (set! (-> obj free-point) -134250495) + (set! (-> this free-point) -134250495) (dotimes (v1-21 32) (when (not (logtest? s5-0 1)) - (set! (-> obj point v1-21 next) (-> obj free-point)) - (set! (-> obj free-point) v1-21) + (set! (-> this point v1-21 next) (-> this free-point)) + (set! (-> this free-point) v1-21) ) (set! s5-0 (shr s5-0 1)) ) diff --git a/goal_src/jak2/engine/camera/pov-camera-h.gc b/goal_src/jak2/engine/camera/pov-camera-h.gc index d609318a36..e58c30f2ec 100644 --- a/goal_src/jak2/engine/camera/pov-camera-h.gc +++ b/goal_src/jak2/engine/camera/pov-camera-h.gc @@ -47,10 +47,3 @@ (target-released? (_type_) symbol 29) ) ) - - -0 - - - - diff --git a/goal_src/jak2/engine/collide/collide-cache.gc b/goal_src/jak2/engine/collide/collide-cache.gc index cdd699297a..1e8884c041 100644 --- a/goal_src/jak2/engine/collide/collide-cache.gc +++ b/goal_src/jak2/engine/collide/collide-cache.gc @@ -7,17 +7,17 @@ ;; DECOMP BEGINS -(defmethod reset collide-cache ((obj collide-cache)) - (set! (-> obj num-tris) 0) - (set! (-> obj num-prims) 0) - (set! (-> obj ignore-processes 0) #f) - (set! (-> obj ignore-processes 1) #f) +(defmethod reset collide-cache ((this collide-cache)) + (set! (-> this num-tris) 0) + (set! (-> this num-prims) 0) + (set! (-> this ignore-processes 0) #f) + (set! (-> this ignore-processes 1) #f) (set! *already-printed-exeeded-max-cache-tris* #f) 0 (none) ) -(defmethod fill-from-bg collide-cache ((obj collide-cache) +(defmethod fill-from-bg collide-cache ((this collide-cache) (arg0 (function collide-hash int collide-list collide-query int)) (arg1 (function collide-cache collide-list collide-query none)) (arg2 collide-query) @@ -42,16 +42,16 @@ ) (when (> (-> *collide-list* num-items) 0) (arg1 *collide-cache* *collide-list* arg2) - (let ((a0-8 (-> obj num-tris))) + (let ((a0-8 (-> this num-tris))) (when (> a0-8 0) - (let ((v1-16 (-> obj prims)) + (let ((v1-16 (-> this prims)) (a1-6 *collide-shape-prim-backgnd*) ) (set! (-> v1-16 0 num-tris) (the-as uint a0-8)) (set! (-> v1-16 0 prim) a1-6) - (set! (-> obj num-prims) 1) + (set! (-> this num-prims) 1) (set! (-> v1-16 0 first-tri) (the-as uint 0)) - (set! (-> v1-16 0 ccache) obj) + (set! (-> v1-16 0 ccache) this) (set! (-> v1-16 0 prim-core world-sphere quad) (-> a1-6 prim-core world-sphere quad)) (set! (-> v1-16 0 prim-core quad 1) (-> a1-6 prim-core quad 1)) ) @@ -62,7 +62,8 @@ (none) ) -(defmethod fill-from-water collide-cache ((obj collide-cache) (arg0 water-control)) +;; WARN: Function (method 21 collide-cache) has a return type of none, but the expression builder found a return statement. +(defmethod fill-from-water collide-cache ((this collide-cache) (arg0 water-control)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -71,19 +72,19 @@ (vf5 :class vf) ) (init-vf0-vector) - (when (= (-> obj num-prims) 100) + (when (= (-> this num-prims) 100) (if (= *cheat-mode* 'debug) (format 0 "ERROR: Exceeded max number of collide-cache prims!~%") ) (return #f) ) - (when (< 460 (+ (-> obj num-tris) 2)) + (when (< 460 (+ (-> this num-tris) 2)) (if (= *cheat-mode* 'debug) (print-exceeded-max-cache-tris) ) (return #f) ) - (when (not (and (logtest? (-> arg0 flags) (water-flags active)) + (if (not (and (logtest? (-> arg0 flags) (water-flags active)) (logtest? (-> arg0 flags) (water-flags can-ground)) (logtest? (-> arg0 flags) (water-flags swim-ground under-water)) (logtest? (water-flags over-water) (-> arg0 flags)) @@ -93,10 +94,10 @@ (return #f) ) (let ((v1-24 (-> arg0 collide-height))) - (.lvf vf1 (&-> obj collide-box min quad)) - (.lvf vf3 (&-> obj collide-box max quad)) - (let ((a2-6 (-> obj num-prims-u32)) - (a3-4 (the-as (inline-array collide-cache-tri) (-> obj tris (-> obj num-tris)))) + (.lvf vf1 (&-> this collide-box min quad)) + (.lvf vf3 (&-> this collide-box max quad)) + (let ((a2-6 (-> this num-prims-u32)) + (a3-4 (the-as (inline-array collide-cache-tri) (-> this tris (-> this num-tris)))) ) (.mov vf5 v1-24) (.add.x.vf vf1 vf0 vf5 :mask #b10) @@ -122,23 +123,23 @@ ) ) (let ((v1-27 *collide-shape-prim-water*) - (a1-5 (-> obj prims (-> obj num-prims))) + (a1-5 (-> this prims (-> this num-prims))) ) - (set! (-> a1-5 first-tri) (the-as uint (-> obj num-tris))) + (set! (-> a1-5 first-tri) (the-as uint (-> this num-tris))) (set! (-> a1-5 num-tris) (the-as uint 2)) (set! (-> a1-5 prim) v1-27) - (set! (-> a1-5 ccache) obj) + (set! (-> a1-5 ccache) this) (set! (-> a1-5 prim-core world-sphere quad) (-> v1-27 prim-core world-sphere quad)) (set! (-> a1-5 prim-core quad 1) (-> v1-27 prim-core quad 1)) ) - (+! (-> obj num-prims) 1) - (+! (-> obj num-tris) 2) + (+! (-> this num-prims) 1) + (+! (-> this num-tris) 2) 0 (none) ) ) -(defmethod fill-using-bounding-box collide-cache ((obj collide-cache) (arg0 collide-query)) +(defmethod fill-using-bounding-box collide-cache ((this collide-cache) (arg0 collide-query)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -162,63 +163,64 @@ (nop!) (.lvf vf2 (&-> arg0 bbox max quad)) (nop!) - (set! (-> obj ignore-processes 0) (the-as process a0-2)) + (set! (-> this ignore-processes 0) (the-as process a0-2)) (nop!) - (set! (-> obj ignore-processes 1) (the-as process a1-1)) + (set! (-> this ignore-processes 1) (the-as process a1-1)) (.mov.vf vf1 vf0 :mask #b1000) (nop!) (.mov.vf vf2 vf0 :mask #b1000) - (set! (-> obj ignore-mask) (the-as pat-surface a2-0)) + (set! (-> this ignore-mask) (the-as pat-surface a2-0)) ) ) ) (.ftoi.vf vf3 vf1) (nop!) (.ftoi.vf vf4 vf2) - (set! (-> obj num-tris) 0) + (set! (-> this num-tris) 0) (nop!) - (.svf (&-> obj collide-box min quad) vf1) + (.svf (&-> this collide-box min quad) vf1) (nop!) - (.svf (&-> obj collide-box max quad) vf2) + (.svf (&-> this collide-box max quad) vf2) (nop!) - (.svf (&-> obj collide-box4w min quad) vf3) + (.svf (&-> this collide-box4w min quad) vf3) (nop!) - (.svf (&-> obj collide-box4w max quad) vf4) + (.svf (&-> this collide-box4w max quad) vf4) (nop!) (.svf (&-> arg0 bbox4w min quad) vf3) (nop!) (.svf (&-> arg0 bbox4w max quad) vf4) (nop!) - (set! (-> obj num-prims) 0) + (set! (-> this num-prims) 0) (nop!) - (set! (-> obj collide-with) (the-as collide-spec v1-4)) + (set! (-> this collide-with) (the-as collide-spec v1-4)) ) 0 (when (logtest? (-> arg0 collide-with) (collide-spec backgnd)) (fill-from-bg - obj + this (method-of-type collide-hash fill-collide-list-from-box) collide-list-fill-bg-using-box arg0 ) - (+! (-> *collide-stats* output) (-> obj num-tris)) + (+! (-> *collide-stats* output) (-> this num-tris)) ) (when (logtest? (-> arg0 collide-with) (collide-spec water)) (let ((v1-18 (-> arg0 ignore-process0))) (if v1-18 - (fill-from-water obj (-> (the-as process-drawable v1-18) water)) + (fill-from-water this (-> (the-as process-drawable v1-18) water)) ) ) ) (if (logtest? (-> arg0 collide-with) (collide-spec hit-by-player-list hit-by-others-list player-list)) - (fill-from-fg-boxes obj) + (fill-from-fg-boxes this) ) 0 (none) ) ) -(defmethod fill-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) +(defmethod fill-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) + ;; og:preserve-this float -> uint (local-vars (v1-11 uint) (v1-20 float)) (rlet ((acc :class vf) (Q :class vf) @@ -260,7 +262,7 @@ ) (when (< 1 v1-3) (set-from-point-offset-pad! (-> arg0 bbox) (-> arg0 start-pos) (-> arg0 move-dist) (-> arg0 radius)) - (fill-using-bounding-box obj arg0) + (fill-using-bounding-box this arg0) (b! #t cfg-47 :delay (nop!)) (the-as none 0) (nop!) @@ -285,18 +287,18 @@ (.mul.vf vf8 vf3 vf3) (nop!) (.add.vf vf2 vf1 vf3) - (set! (-> obj ignore-mask) (the-as pat-surface v1-10)) + (set! (-> this ignore-mask) (the-as pat-surface v1-10)) (.add.y.vf vf8 vf8 vf8 :mask #b1) - (set! (-> obj num-tris) 0) + (set! (-> this num-tris) 0) (.min.vf vf4 vf1 vf2) - (set! (-> obj num-prims) 0) + (set! (-> this num-prims) 0) (.max.vf vf5 vf1 vf2) - (set! (-> obj collide-with) (the-as collide-spec a2-1)) + (set! (-> this collide-with) (the-as collide-spec a2-1)) ) (.sub.w.vf vf10 vf0 vf9 :mask #b111) - (set! (-> obj ignore-processes 0) (the-as process a0-14)) + (set! (-> this ignore-processes 0) (the-as process a0-14)) (.add.z.vf vf8 vf8 vf8 :mask #b1) - (set! (-> obj ignore-processes 1) (the-as process a1-3)) + (set! (-> this ignore-processes 1) (the-as process a1-3)) ) ) ) @@ -315,17 +317,17 @@ (nop!) (.svf (&-> arg0 local-box4w min quad) vf15) (.ftoi.vf vf6 vf4) - (.svf (&-> obj collide-box min quad) vf4) + (.svf (&-> this collide-box min quad) vf4) (.ftoi.vf vf7 vf5) - (.svf (&-> obj collide-box max quad) vf5) + (.svf (&-> this collide-box max quad) vf5) (nop!) (.svf (&-> arg0 bbox min quad) vf4) (nop!) (.svf (&-> arg0 bbox max quad) vf5) (nop!) - (.svf (&-> obj collide-box4w min quad) vf6) + (.svf (&-> this collide-box4w min quad) vf6) (nop!) - (.svf (&-> obj collide-box4w max quad) vf7) + (.svf (&-> this collide-box4w max quad) vf7) (nop!) (.svf (&-> arg0 bbox4w min quad) vf6) (nop!) @@ -461,22 +463,22 @@ ) (when (logtest? (-> arg0 collide-with) (collide-spec backgnd)) (fill-from-bg - obj + this (method-of-type collide-hash fill-collide-list-from-line-sphere) collide-list-fill-bg-using-line-sphere arg0 ) - (+! (-> *collide-stats* output) (-> obj num-tris)) + (+! (-> *collide-stats* output) (-> this num-tris)) ) (when (logtest? (-> arg0 collide-with) (collide-spec water)) (let ((a1-5 (-> (the-as process-drawable (-> arg0 ignore-process0)) water))) (if (nonzero? a1-5) - (fill-from-water obj a1-5) + (fill-from-water this a1-5) ) ) ) (if (logtest? (-> arg0 collide-with) (collide-spec hit-by-player-list hit-by-others-list player-list)) - (fill-from-fg-line-sphere obj arg0) + (fill-from-fg-line-sphere this arg0) ) 0 (label cfg-47) @@ -484,11 +486,11 @@ ) ) -(defmethod fill-from-fg-boxes collide-cache ((obj collide-cache)) - (let ((s5-0 (-> obj collide-with))) +(defmethod fill-from-fg-boxes collide-cache ((this collide-cache)) + (let ((s5-0 (-> this collide-with))) (set! *actor-list-length* 0) (if (logtest? s5-0 (collide-spec hit-by-others-list)) - (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (-> obj collide-box) *actor-list* 256)) + (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (-> this collide-box) *actor-list* 256)) ) (when (logtest? s5-0 (collide-spec player-list)) (let ((a0-2 (-> *collide-player-list* alive-list next0))) @@ -500,12 +502,12 @@ ) (when (logtest? s5-0 (-> a1-1 prim-core collide-as)) (let ((a1-2 (-> a1-1 prim-core))) - (when (and (>= (+ (-> a1-2 world-sphere x) (-> a1-2 world-sphere w)) (-> obj collide-box min x)) - (>= (-> obj collide-box max x) (- (-> a1-2 world-sphere x) (-> a1-2 world-sphere w))) - (>= (+ (-> a1-2 world-sphere y) (-> a1-2 world-sphere w)) (-> obj collide-box min y)) - (>= (-> obj collide-box max y) (- (-> a1-2 world-sphere y) (-> a1-2 world-sphere w))) - (>= (+ (-> a1-2 world-sphere z) (-> a1-2 world-sphere w)) (-> obj collide-box min z)) - (>= (-> obj collide-box max z) (- (-> a1-2 world-sphere z) (-> a1-2 world-sphere w))) + (when (and (>= (+ (-> a1-2 world-sphere x) (-> a1-2 world-sphere w)) (-> this collide-box min x)) + (>= (-> this collide-box max x) (- (-> a1-2 world-sphere x) (-> a1-2 world-sphere w))) + (>= (+ (-> a1-2 world-sphere y) (-> a1-2 world-sphere w)) (-> this collide-box min y)) + (>= (-> this collide-box max y) (- (-> a1-2 world-sphere y) (-> a1-2 world-sphere w))) + (>= (+ (-> a1-2 world-sphere z) (-> a1-2 world-sphere w)) (-> this collide-box min z)) + (>= (-> this collide-box max z) (- (-> a1-2 world-sphere z) (-> a1-2 world-sphere w))) ) (when (< *actor-list-length* 256) (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) @@ -532,12 +534,12 @@ ) (when (logtest? s5-0 (-> a1-13 prim-core collide-as)) (let ((a1-14 (-> a1-13 prim-core))) - (when (and (>= (+ (-> a1-14 world-sphere x) (-> a1-14 world-sphere w)) (-> obj collide-box min x)) - (>= (-> obj collide-box max x) (- (-> a1-14 world-sphere x) (-> a1-14 world-sphere w))) - (>= (+ (-> a1-14 world-sphere y) (-> a1-14 world-sphere w)) (-> obj collide-box min y)) - (>= (-> obj collide-box max y) (- (-> a1-14 world-sphere y) (-> a1-14 world-sphere w))) - (>= (+ (-> a1-14 world-sphere z) (-> a1-14 world-sphere w)) (-> obj collide-box min z)) - (>= (-> obj collide-box max z) (- (-> a1-14 world-sphere z) (-> a1-14 world-sphere w))) + (when (and (>= (+ (-> a1-14 world-sphere x) (-> a1-14 world-sphere w)) (-> this collide-box min x)) + (>= (-> this collide-box max x) (- (-> a1-14 world-sphere x) (-> a1-14 world-sphere w))) + (>= (+ (-> a1-14 world-sphere y) (-> a1-14 world-sphere w)) (-> this collide-box min y)) + (>= (-> this collide-box max y) (- (-> a1-14 world-sphere y) (-> a1-14 world-sphere w))) + (>= (+ (-> a1-14 world-sphere z) (-> a1-14 world-sphere w)) (-> this collide-box min z)) + (>= (-> this collide-box max z) (- (-> a1-14 world-sphere z) (-> a1-14 world-sphere w))) ) (when (< *actor-list-length* 256) (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) @@ -558,8 +560,8 @@ (let ((v1-26 (-> *actor-list* s4-0))) (when (logtest? s5-0 (-> v1-26 root-prim prim-core collide-as)) (let ((a0-13 (-> v1-26 process))) - (if (not (or (= a0-13 (-> obj ignore-processes 0)) (= a0-13 (-> obj ignore-processes 1)))) - (add-fg-prim-using-box (-> v1-26 root-prim) obj) + (if (not (or (= a0-13 (-> this ignore-processes 0)) (= a0-13 (-> this ignore-processes 1)))) + (add-fg-prim-using-box (-> v1-26 root-prim) this) ) ) ) @@ -571,7 +573,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod add-fg-prim-using-box collide-shape-prim ((obj collide-shape-prim) (arg0 collide-cache)) +(defmethod add-fg-prim-using-box collide-shape-prim ((this collide-shape-prim) (arg0 collide-cache)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-box!~%") (none) ) @@ -582,7 +584,7 @@ (defmethod-mips2c "(method 10 collide-shape-prim-group)" 10 collide-shape-prim-group) -(defmethod fill-from-fg-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) +(defmethod fill-from-fg-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) (local-vars (v1-9 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -696,8 +698,8 @@ (let ((v1-58 (-> *actor-list* s3-1))) (when (logtest? s4-0 (-> v1-58 root-prim prim-core collide-as)) (let ((a0-37 (-> v1-58 process))) - (if (not (or (= a0-37 (-> obj ignore-processes 0)) (= a0-37 (-> obj ignore-processes 1)))) - (add-fg-prim-using-line-sphere (-> v1-58 root-prim) obj arg0) + (if (not (or (= a0-37 (-> this ignore-processes 0)) (= a0-37 (-> this ignore-processes 1)))) + (add-fg-prim-using-line-sphere (-> v1-58 root-prim) this arg0) ) ) ) @@ -710,7 +712,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod add-fg-prim-using-line-sphere collide-shape-prim ((obj collide-shape-prim) (arg0 collide-cache) (arg1 object)) +(defmethod add-fg-prim-using-line-sphere collide-shape-prim ((this collide-shape-prim) (arg0 collide-cache) (arg1 object)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-line-sphere!~%" @@ -724,9 +726,9 @@ (defmethod-mips2c "(method 11 collide-shape-prim-group)" 11 collide-shape-prim-group) -(defmethod fill-and-probe-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) - (fill-using-line-sphere obj arg0) - (probe-using-line-sphere obj arg0) +(defmethod fill-and-probe-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) + (fill-using-line-sphere this arg0) + (probe-using-line-sphere this arg0) ) (deftype collide-puls-work (structure) @@ -740,7 +742,7 @@ ) -(defmethod probe-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) +(defmethod probe-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) (rlet ((vf0 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -755,10 +757,10 @@ (.mul.w.vf vf3 vf0 vf4 :mask #b1000) (.svf (&-> s5-0 vertex 2 quad) vf2) (.svf (&-> s5-0 vertex 1 quad) vf3) - (let ((s4-0 (the-as object (-> obj prims))) + (let ((s4-0 (the-as object (-> this prims))) (f30-0 -100000000.0) ) - (countdown (s3-0 (-> obj num-prims)) + (countdown (s3-0 (-> this num-prims)) (when (and (logtest? (-> arg0 collide-with) (-> (the-as collide-cache-prim s4-0) prim-core collide-as)) (logtest? (-> arg0 action-mask) (-> (the-as collide-cache-prim s4-0) prim-core action)) ) @@ -826,19 +828,19 @@ (defmethod-mips2c "(method 10 collide-cache-prim)" 10 collide-cache-prim) -(defmethod fill-and-probe-using-spheres collide-cache ((obj collide-cache) (arg0 collide-query)) - (fill-using-spheres obj arg0) - (probe-using-spheres obj arg0) +(defmethod fill-and-probe-using-spheres collide-cache ((this collide-cache) (arg0 collide-query)) + (fill-using-spheres this arg0) + (probe-using-spheres this arg0) ) -(defmethod fill-using-spheres collide-cache ((obj collide-cache) (arg0 collide-query)) +(defmethod fill-using-spheres collide-cache ((this collide-cache) (arg0 collide-query)) (new 'stack-no-clear 'bounding-box) (set-from-spheres! (-> arg0 bbox) (the-as (inline-array sphere) (-> arg0 best-dist)) (the-as int (-> arg0 num-spheres)) ) - (fill-using-bounding-box obj arg0) + (fill-using-bounding-box this arg0) (none) ) diff --git a/goal_src/jak2/engine/collide/collide-debug.gc b/goal_src/jak2/engine/collide/collide-debug.gc index 07f3af7560..e730db3c85 100644 --- a/goal_src/jak2/engine/collide/collide-debug.gc +++ b/goal_src/jak2/engine/collide/collide-debug.gc @@ -10,9 +10,9 @@ ;; this file is debug only (declare-file (debug)) -(defmethod debug-draw collide-cache ((obj collide-cache)) - (let ((gp-0 (the-as object (-> obj tris)))) - (countdown (s4-0 (-> obj num-tris)) +(defmethod debug-draw collide-cache ((this collide-cache)) + (let ((gp-0 (the-as object (-> this tris)))) + (countdown (s4-0 (-> this num-tris)) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-cache-tri gp-0) pat mode) color) a 64))) (add-debug-flat-triangle #t @@ -26,8 +26,8 @@ (set! gp-0 (&+ (the-as collide-cache-tri gp-0) 64)) ) ) - (let ((gp-1 (the-as object (-> obj prims)))) - (countdown (s5-1 (-> obj num-prims)) + (let ((gp-1 (the-as object (-> this prims)))) + (countdown (s5-1 (-> this num-prims)) (when (= (-> (the-as collide-cache-prim gp-1) prim-core prim-type) (prim-type sphere)) (let ((t0-1 (copy-and-set-field @@ -171,31 +171,35 @@ (none) ) -(defmethod col-rend-method-9 col-rend ((obj col-rend)) +(defmethod col-rend-method-9 col-rend ((this col-rend)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (let ((f30-0 (-> obj bbox-radius))) - (let ((v1-0 (-> obj track))) + (let ((f30-0 (-> this bbox-radius))) + (let ((v1-0 (-> this track))) (cond ((zero? v1-0) - (set! (-> obj bbox-center quad) (-> (target-pos 0) quad)) - (+! (-> obj bbox-center y) (* 0.7 f30-0)) + (set! (-> this bbox-center quad) (-> (target-pos 0) quad)) + (+! (-> this bbox-center y) (* 0.7 f30-0)) ) ((= v1-0 1) - (position-in-front-of-camera! (-> obj bbox-center) (+ (-> obj camera-to-bbox-dist) (-> obj bbox-radius)) 0.0) + (position-in-front-of-camera! + (-> this bbox-center) + (+ (-> this camera-to-bbox-dist) (-> this bbox-radius)) + 0.0 + ) ) ) ) - (set! (-> s5-0 bbox min quad) (-> obj bbox-center quad)) + (set! (-> s5-0 bbox min quad) (-> this bbox-center quad)) (set! (-> s5-0 bbox min x) (- (-> s5-0 bbox min x) f30-0)) (set! (-> s5-0 bbox min y) (- (-> s5-0 bbox min y) f30-0)) (set! (-> s5-0 bbox min z) (- (-> s5-0 bbox min z) f30-0)) - (set! (-> s5-0 bbox max quad) (-> obj bbox-center quad)) + (set! (-> s5-0 bbox max quad) (-> this bbox-center quad)) (+! (-> s5-0 bbox max x) f30-0) (+! (-> s5-0 bbox max y) f30-0) (+! (-> s5-0 bbox max z) f30-0) ) (let ((v1-9 -1)) - (let ((a0-9 (-> obj cspec))) + (let ((a0-9 (-> this cspec))) (if (not (logtest? a0-9 (collide-spec crate))) (set! v1-9 (logxor v1-9 1)) ) @@ -229,7 +233,7 @@ ) (fill-using-bounding-box *collide-cache* s5-0) ) - (let ((s5-1 (-> obj show-only)) + (let ((s5-1 (-> this show-only)) (a1-17 (new 'stack 'col-rend-filter)) ) (when (nonzero? s5-1) @@ -287,7 +291,7 @@ ) ) ) - (col-rend-draw obj a1-17) + (col-rend-draw this a1-17) ) (none) ) diff --git a/goal_src/jak2/engine/collide/collide-edge-grab-h.gc b/goal_src/jak2/engine/collide/collide-edge-grab-h.gc index 3a468d58e7..9bf0ebbdb1 100644 --- a/goal_src/jak2/engine/collide/collide-edge-grab-h.gc +++ b/goal_src/jak2/engine/collide/collide-edge-grab-h.gc @@ -30,6 +30,7 @@ :flag-assert #x900000028 ) + (deftype edge-grab-info (structure) ((world-vertex vector 8 :inline :offset-assert 0) (local-vertex vector 8 :inline :offset-assert 128) @@ -61,6 +62,7 @@ ) ) + (deftype collide-edge-tri (structure) ((ctri collide-cache-tri :offset-assert 0) (normal vector :inline :offset-assert 16) @@ -70,6 +72,7 @@ :flag-assert #x900000020 ) + (deftype collide-edge-edge (structure) ((ignore basic :offset-assert 0) (etri collide-edge-tri :offset-assert 4) @@ -85,6 +88,7 @@ ) ) + (deftype collide-edge-hold-item (structure) ((next collide-edge-hold-item :offset-assert 0) (rating float :offset-assert 4) @@ -98,6 +102,7 @@ :flag-assert #x900000030 ) + (deftype collide-edge-hold-list (structure) ((num-allocs uint32 :offset-assert 0) (num-attempts uint32 :offset-assert 4) @@ -114,6 +119,7 @@ ) ) + (deftype collide-edge-spec (structure) ((split-dists float 2 :offset-assert 0) (outward-offset vector :inline :offset-assert 16) @@ -134,6 +140,7 @@ :flag-assert #x900000140 ) + (deftype collide-edge-work (structure) ((ccache collide-cache :offset-assert 0) (cshape collide-shape :offset-assert 4) @@ -174,11 +181,12 @@ ) ) + (define *collide-edge-spec* (new 'static 'collide-edge-spec :split-dists (new 'static 'array float 2 1024.0 1433.6) :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) - :flags #x8 + :flags (collide-edge-spec-flags send-event) :ignore-pat (new 'static 'pat-surface :noentity #x1 :noedge #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) :max-dist-sqrd-to-outward-pt 37748736.0 :max-dir-cosa-delta 0.6 @@ -192,18 +200,18 @@ :max (new 'static 'vector :x 6144.0 :y 11059.2 :z 6144.0 :w 1.0) ) :local-player-spheres (new 'static 'inline-array sphere 12 - (new 'static 'sphere :x 1720.32 :y -819.2 :w 1433.6) - (new 'static 'sphere :x 2293.76 :y -3276.8 :w 1884.16) - (new 'static 'sphere :x 1966.08 :y -6144.0 :w 1556.48) - (new 'static 'sphere :x 1966.08 :y -8601.6 :w 1556.48) - (new 'static 'sphere :x 1761.28 :y -11059.2 :w 1351.68) - (new 'static 'sphere :x 1679.36 :y -13312.0 :w 1269.76) - (new 'static 'sphere :x -737.28 :y 4096.0 :w 3072.0) - (new 'static 'sphere :x -737.28 :y 6553.6 :w 3072.0) - (new 'static 'sphere :x -737.28 :y 9420.8 :w 3072.0) - (new 'static 'sphere :x 1720.32 :y 3686.4 :w 2949.12) - (new 'static 'sphere :x 1720.32 :y 5734.4 :w 2949.12) - (new 'static 'sphere :x 1720.32 :y 8601.6 :w 2949.12) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2293.76 :y -3276.8 :r 1884.16) + (new 'static 'sphere :x 1966.08 :y -6144.0 :r 1556.48) + (new 'static 'sphere :x 1966.08 :y -8601.6 :r 1556.48) + (new 'static 'sphere :x 1761.28 :y -11059.2 :r 1351.68) + (new 'static 'sphere :x 1679.36 :y -13312.0 :r 1269.76) + (new 'static 'sphere :x -737.28 :y 4096.0 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 6553.6 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 9420.8 :r 3072.0) + (new 'static 'sphere :x 1720.32 :y 3686.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 5734.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 8601.6 :r 2949.12) ) ) ) @@ -217,7 +225,3 @@ (define-perm *edge-grab-info* edge-grab-info (new 'global 'edge-grab-info)) (kmemclose) - - - - diff --git a/goal_src/jak2/engine/collide/collide-edge-grab.gc b/goal_src/jak2/engine/collide/collide-edge-grab.gc index 67b68873a1..2f2ba3bdce 100644 --- a/goal_src/jak2/engine/collide/collide-edge-grab.gc +++ b/goal_src/jak2/engine/collide/collide-edge-grab.gc @@ -7,7 +7,8 @@ ;; DECOMP BEGINS -(defmethod do-edge-grabs target ((obj target) (arg0 collide-cache) (arg1 collide-edge-spec)) +;; WARN: Function (method 27 target) has a return type of none, but the expression builder found a return statement. +(defmethod do-edge-grabs target ((this target) (arg0 collide-cache) (arg1 collide-edge-spec)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -19,11 +20,11 @@ (set! (-> *edge-grab-info* found-edge?) #f) (mem-copy! (the-as pointer (-> *collide-edge-work* spec)) (the-as pointer arg1) 320) (let ((s5-0 *collide-edge-work*)) - (set! (-> s5-0 process) (the-as (pointer process-drawable) (process->ppointer obj))) + (set! (-> s5-0 process) (the-as (pointer process-drawable) (process->ppointer this))) (set! (-> s5-0 num-verts) (the-as uint 0)) (set! (-> s5-0 num-edges) (the-as uint 0)) (set! (-> s5-0 num-tris) (the-as uint 0)) - (let ((v1-3 (-> obj control))) + (let ((v1-3 (-> this control))) (set! (-> s5-0 ccache) arg0) (.lvf vf1 (&-> s5-0 spec local-cache-fill-box min quad)) (.lvf vf2 (&-> s5-0 spec local-cache-fill-box max quad)) @@ -45,8 +46,8 @@ (.svf (&-> s5-0 within-reach-box4w min quad) vf6) (.svf (&-> s5-0 within-reach-box4w max quad) vf7) (let ((s3-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-0 collide-with) (-> obj control root-prim prim-core collide-with)) - (set! (-> s3-0 ignore-process0) obj) + (set! (-> s3-0 collide-with) (-> this control root-prim prim-core collide-with)) + (set! (-> s3-0 ignore-process0) this) (set! (-> s3-0 ignore-process1) #f) (set! (-> s3-0 ignore-pat) (-> s5-0 spec ignore-pat)) (set! (-> s3-0 action-mask) (collide-action solid)) @@ -57,24 +58,24 @@ (when (nonzero? (-> s5-0 num-tris)) (find-grabbable-edges s5-0) (when (nonzero? (-> s5-0 num-edges)) - (set! (-> s5-0 search-pt quad) (-> obj control midpoint-of-hands quad)) - (when (!= (-> *cpad-list* cpads (-> obj control cpad number) stick0-speed) 0.0) - (set! (-> s5-0 search-dir-vec quad) (-> obj control to-target-pt-xz quad)) + (set! (-> s5-0 search-pt quad) (-> this control midpoint-of-hands quad)) + (when (!= (-> *cpad-list* cpads (-> this control cpad number) stick0-speed) 0.0) + (set! (-> s5-0 search-dir-vec quad) (-> this control to-target-pt-xz quad)) (search-for-edges s5-0 (-> s5-0 hold-list)) (when (find-best-grab! s5-0 (-> s5-0 hold-list) *edge-grab-info*) (set! (-> *edge-grab-info* found-edge?) #t) (if (logtest? (-> s5-0 spec flags) (collide-edge-spec-flags send-event)) - (send-event obj 'edge-grab) + (send-event this 'edge-grab) ) (return #f) ) ) - (vector-z-quaternion! (-> s5-0 search-dir-vec) (-> obj control quat-for-control)) + (vector-z-quaternion! (-> s5-0 search-dir-vec) (-> this control quat-for-control)) (search-for-edges s5-0 (-> s5-0 hold-list)) (when (find-best-grab! s5-0 (-> s5-0 hold-list) *edge-grab-info*) (set! (-> *edge-grab-info* found-edge?) #t) (if (logtest? (-> s5-0 spec flags) (collide-edge-spec-flags send-event)) - (send-event obj 'edge-grab) + (send-event this 'edge-grab) ) ) 0 @@ -86,17 +87,18 @@ ) ) -(defmethod search-for-edges collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-list)) +;; WARN: Function (method 9 collide-edge-work) has a return type of none, but the expression builder found a return statement. +(defmethod search-for-edges collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-list)) (set! (-> arg0 num-allocs) (the-as uint 0)) (set! (-> arg0 num-attempts) (the-as uint 0)) (set! (-> arg0 head) #f) (let ((s4-0 (the-as collide-edge-hold-item (-> arg0 items))) - (s3-0 (the-as collide-edge-edge (-> obj edges))) + (s3-0 (the-as collide-edge-edge (-> this edges))) ) - (countdown (s2-0 (-> obj num-edges)) + (countdown (s2-0 (-> this num-edges)) (when (not (-> s3-0 ignore)) - (compute-center-point! obj s3-0 (-> s4-0 center-pt)) - (when (should-add-to-list? obj s4-0 s3-0) + (compute-center-point! this s3-0 (-> s4-0 center-pt)) + (when (should-add-to-list? this s4-0 s3-0) (add-to-list! arg0 s4-0) (+! (-> arg0 num-allocs) 1) (when (= (-> arg0 num-allocs) 32) @@ -126,9 +128,11 @@ :flag-assert #x900000030 ) + (defmethod-mips2c "(method 19 collide-edge-work)" 19 collide-edge-work) -(defmethod check-grab-for-collisions collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +;; WARN: Return type mismatch int vs symbol. +(defmethod check-grab-for-collisions collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (local-vars (sv-656 vector) (sv-672 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -158,7 +162,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-1 quad) vf6) ) - (let ((f0-1 (get-best-hand-point obj (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) + (let ((f0-1 (get-best-hand-point this (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) (if (< 491.52 f0-1) (return (the-as symbol #f)) ) @@ -176,7 +180,7 @@ (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> sv-672 quad) vf6) - (let ((f0-3 (get-best-hand-point obj (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) + (let ((f0-3 (get-best-hand-point this (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) (if (< 491.52 f0-3) (return (the-as symbol #f)) ) @@ -190,7 +194,7 @@ (set! (-> arg1 world-vertex 0 quad) (-> s2-0 vertex-ptr 0 0 quad)) (set! (-> arg1 world-vertex 1 quad) (-> s2-0 vertex-ptr 1 0 quad)) (set! (-> arg1 hanging-matrix vector 1 quad) - (-> (the-as collide-shape-moving (-> obj process 0 root)) dynam gravity-normal quad) + (-> (the-as collide-shape-moving (-> this process 0 root)) dynam gravity-normal quad) ) (vector-normalize! (vector-! (-> arg1 hanging-matrix vector 2) (-> arg1 world-vertex 1) (the-as vector (-> arg1 world-vertex))) @@ -212,30 +216,30 @@ (set! (-> arg1 hanging-matrix trans quad) (-> arg1 center-hold quad)) (transform-vectors! (-> arg1 hanging-matrix) - (-> obj world-player-spheres) - (-> obj spec local-player-spheres) + (-> this world-player-spheres) + (-> this spec local-player-spheres) 12 ) (let ((a1-12 (new 'stack-no-clear 'collide-query))) (let ((v1-28 a1-12)) - (set! (-> v1-28 spheres) (-> obj world-player-spheres)) + (set! (-> v1-28 best-dist) (the-as float (-> this world-player-spheres))) (set! (-> v1-28 num-spheres) (the-as uint 12)) - (set! (-> v1-28 collide-with) (-> obj cshape root-prim prim-core collide-with)) + (set! (-> v1-28 collide-with) (-> this cshape root-prim prim-core collide-with)) (set! (-> v1-28 ignore-process0) #f) (set! (-> v1-28 ignore-process1) #f) (set! (-> v1-28 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-28 best-my-prim) (the-as collide-shape-prim #t)) (set! (-> v1-28 action-mask) (collide-action solid)) ) - (if (probe-using-spheres (-> obj ccache) a1-12) + (if (probe-using-spheres (-> this ccache) a1-12) (return (the-as symbol #f)) ) ) (set! (-> arg1 status) (the-as uint 0)) - (if (logtest? (-> obj spec flags) (collide-edge-spec-flags find-adjacent-edge)) - (find-adjacent-edge obj arg0 arg1) + (if (logtest? (-> this spec flags) (collide-edge-spec-flags find-adjacent-edge)) + (find-adjacent-edge this arg0 arg1) ) - (let* ((v1-41 (the-as object (-> obj ccache prims s4-0 prim))) + (let* ((v1-41 (the-as object (-> this ccache prims s4-0 prim))) (a0-44 (-> (the-as collide-shape-prim v1-41) cshape)) ) (cond @@ -277,7 +281,8 @@ :flag-assert #x900000030 ) -(defmethod no-collision-at-edge collide-edge-edge ((obj collide-edge-edge) (arg0 collide-edge-work) (arg1 edge-grab-info)) + +(defmethod no-collision-at-edge collide-edge-edge ((this collide-edge-edge) (arg0 collide-edge-work) (arg1 edge-grab-info)) (let ((s4-0 (new 'stack-no-clear 'matrix)) (s5-0 (new 'stack-no-clear 'inline-array 'sphere 6)) ) @@ -287,14 +292,14 @@ (set! (-> s4-0 vector 1 quad) (-> (the-as collide-shape-moving (-> arg0 process 0 root)) dynam gravity-normal quad) ) - (vector-normalize! (vector-! (-> s4-0 vector 2) (-> obj vertex-ptr 1 0) (-> obj vertex-ptr 0 0)) 1.0) + (vector-normalize! (vector-! (-> s4-0 vector 2) (-> this vertex-ptr 1 0) (-> this vertex-ptr 0 0)) 1.0) (vector-normalize! (vector-cross! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2) (-> s4-0 vector 1)) 1.0) (vector-cross! (-> s4-0 vector 2) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1)) - (vector-average! (-> s4-0 trans) (-> obj vertex-ptr 1 0) (-> obj vertex-ptr 0 0)) + (vector-average! (-> s4-0 trans) (-> this vertex-ptr 1 0) (-> this vertex-ptr 0 0)) (transform-vectors! s4-0 s5-0 (-> arg0 spec local-player-spheres) 6) (let ((a1-11 (new 'stack-no-clear 'collide-query))) (let ((v1-13 a1-11)) - (set! (-> v1-13 spheres) s5-0) + (set! (-> v1-13 best-dist) (the-as float s5-0)) (set! (-> v1-13 num-spheres) (the-as uint 6)) (set! (-> v1-13 collide-with) (-> arg0 cshape root-prim prim-core collide-with)) (set! (-> v1-13 ignore-process0) #f) @@ -308,18 +313,18 @@ ) ) -(defmethod find-adjacent-edge collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod find-adjacent-edge collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (let ((s5-0 (new 'stack-no-clear 'faei-stack-vars))) (let* ((v1-0 (-> arg0 edge)) (s3-0 (-> v1-0 vertex-ptr 0 0)) (s2-0 (-> v1-0 vertex-ptr 1 0)) - (s1-0 (the-as collide-edge-edge (-> obj edges))) + (s1-0 (the-as collide-edge-edge (-> this edges))) ) (set! (-> s5-0 found-left?) #f) (set! (-> s5-0 found-right?) #f) (vector-! (-> s5-0 hold-edge-vec-norm) s2-0 s3-0) (vector-normalize! (-> s5-0 hold-edge-vec-norm) 1.0) - (countdown (s0-0 (-> obj num-edges)) + (countdown (s0-0 (-> this num-edges)) (when (not (-> s1-0 ignore)) (let ((v1-6 (-> s1-0 vertex-ptr 1 0))) (when (= v1-6 s3-0) @@ -327,7 +332,7 @@ (vector-normalize! (-> s5-0 adj-edge-vec-norm) 1.0) (let ((f30-0 (vector-dot (-> s5-0 adj-edge-vec-norm) (-> s5-0 hold-edge-vec-norm)))) (when (and (or (not (-> s5-0 found-left?)) (< (-> s5-0 left-dot) f30-0) (< -0.7 f30-0)) - (no-collision-at-edge s1-0 obj arg1) + (no-collision-at-edge s1-0 this arg1) ) (set! (-> s5-0 left-dot) f30-0) (set! (-> s5-0 found-left?) #t) @@ -343,7 +348,7 @@ (vector-normalize! (-> s5-0 adj-edge-vec-norm) 1.0) (let ((f30-1 (vector-dot (-> s5-0 adj-edge-vec-norm) (-> s5-0 hold-edge-vec-norm)))) (when (and (or (not (-> s5-0 found-right?)) (< (-> s5-0 right-dot) f30-1) (< -0.7 f30-1)) - (no-collision-at-edge s1-0 obj arg1) + (no-collision-at-edge s1-0 this arg1) ) (set! (-> s5-0 right-dot) f30-1) (set! (-> s5-0 found-right?) #t) @@ -378,11 +383,11 @@ (defmethod-mips2c "(method 16 collide-edge-work)" 16 collide-edge-work) -(defmethod get-best-hand-point collide-edge-work ((obj collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod get-best-hand-point collide-edge-work ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) (let ((f30-0 -1.0)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (dotimes (s1-0 (the-as int (-> obj num-edges))) - (let ((v1-4 (-> obj edges s1-0))) + (dotimes (s1-0 (the-as int (-> this num-edges))) + (let ((v1-4 (-> this edges s1-0))) (when (not (-> v1-4 ignore)) (when (= (-> v1-4 etri ctri prim-index) arg2) (let ((f0-0 (vector-segment-distance-point! arg1 (-> v1-4 vertex-ptr 0 0) (-> v1-4 vertex-ptr 1 0) s2-0))) @@ -402,8 +407,7 @@ (defmethod-mips2c "(method 18 collide-edge-work)" 18 collide-edge-work) - -(defmethod compute-center-point! collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) +(defmethod compute-center-point! collide-edge-work ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) (local-vars (v1-1 float) (v1-2 float) (v1-3 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -421,7 +425,7 @@ ) (init-vf0-vector) (.mov.vf vf7 vf0) - (.lvf vf1 (&-> obj search-pt quad)) + (.lvf vf1 (&-> this search-pt quad)) (let ((f0-0 0.0)) (let ((v1-0 (-> arg0 vertex-ptr 0)) (a0-1 (-> arg0 vertex-ptr 1)) @@ -469,12 +473,13 @@ ) ) -(defmethod debug-draw edge-grab-info ((obj edge-grab-info)) +;; WARN: Return type mismatch object vs none. +(defmethod debug-draw edge-grab-info ((this edge-grab-info)) (add-debug-line #t (bucket-id debug-no-zbuf1) - (the-as vector (-> obj world-vertex)) - (-> obj world-vertex 1) + (the-as vector (-> this world-vertex)) + (-> this world-vertex 1) (new 'static 'rgba :r #xff :a #x60) #f (the-as rgba -1) @@ -482,41 +487,41 @@ (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj center-hold) + (-> this center-hold) (meters 0.05) (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj left-hand-hold) + (-> this left-hand-hold) (meters 0.05) (new 'static 'rgba :r #xff :g #xff :a #x60) ) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj right-hand-hold) + (-> this right-hand-hold) (meters 0.05) (new 'static 'rgba :r #xff :g #xff :a #x60) ) - (if (logtest? (-> obj status) 1) + (if (logtest? (-> this status) 1) (add-debug-line #t (bucket-id debug-no-zbuf1) - (-> obj adjacent-edge-left-vertex) - (the-as vector (-> obj world-vertex)) + (-> this adjacent-edge-left-vertex) + (the-as vector (-> this world-vertex)) (new 'static 'rgba :r #x80 :a #x60) #f (the-as rgba -1) ) ) - (if (logtest? (-> obj status) 2) + (if (logtest? (-> this status) 2) (add-debug-line #t (bucket-id debug-no-zbuf1) - (-> obj world-vertex 1) - (-> obj adjacent-edge-right-vertex) + (-> this world-vertex 1) + (-> this adjacent-edge-right-vertex) (new 'static 'rgba :r #x80 :a #x60) #f (the-as rgba -1) @@ -525,15 +530,15 @@ (add-debug-outline-triangle #t (bucket-id debug-no-zbuf1) - (the-as vector (-> obj tri-vertex)) - (-> obj world-vertex 4) - (-> obj world-vertex 5) + (the-as vector (-> this tri-vertex)) + (-> this world-vertex 4) + (-> this world-vertex 5) (new 'static 'rgba :r #xff :a #x30) ) (cond - ((nonzero? (-> obj actor-cshape-prim-offset)) - (if (handle->process (-> obj actor-handle)) - (format *stdcon* "grab: ~A~%" (-> obj actor-handle process 0 name)) + ((nonzero? (-> this actor-cshape-prim-offset)) + (if (handle->process (-> this actor-handle)) + (format *stdcon* "grab: ~A~%" (-> this actor-handle process 0 name)) (format *stdcon* "grab: invalid handle~%") ) ) @@ -544,11 +549,11 @@ (none) ) -(defmethod debug-draw-edges collide-edge-work ((obj collide-edge-work)) +(defmethod debug-draw-edges collide-edge-work ((this collide-edge-work)) (local-vars (sv-32 (function _varargs_ object))) (let ((gp-0 0)) - (dotimes (s4-0 (the-as int (-> obj num-edges))) - (let* ((v1-3 (-> obj edges s4-0)) + (dotimes (s4-0 (the-as int (-> this num-edges))) + (let* ((v1-3 (-> this edges s4-0)) (a2-0 (-> v1-3 vertex-ptr 0 0)) (a3-0 (-> v1-3 vertex-ptr 1 0)) (s3-0 (new 'stack-no-clear 'vector)) @@ -580,7 +585,7 @@ ) (let ((s2-0 add-debug-text-3d) (s1-0 #t) - (s0-0 (bucket-id debug-no-zbuf1)) + (s0-0 318) ) (set! sv-32 format) (let ((a0-10 (clear *temp-string*)) @@ -595,13 +600,13 @@ ) ) ) - (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> obj num-edges) (the-as uint gp-0)) gp-0) + (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> this num-edges) (the-as uint gp-0)) gp-0) ) ) -(defmethod debug-draw-sphere collide-edge-work ((obj collide-edge-work)) - (dotimes (s5-0 (the-as int (-> obj num-verts))) - (let ((a2-0 (-> obj verts s5-0))) +(defmethod debug-draw-sphere collide-edge-work ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-verts))) + (let ((a2-0 (-> this verts s5-0))) (add-debug-sphere #t (bucket-id debug-no-zbuf1) a2-0 (meters 0.2) (new 'static 'rgba :r #xff :g #xff :a #x80)) ) ) @@ -609,8 +614,8 @@ (none) ) -(defmethod debug-draw collide-edge-hold-list ((obj collide-edge-hold-list)) - (let ((s4-0 (-> obj head)) +(defmethod debug-draw collide-edge-hold-list ((this collide-edge-hold-list)) + (let ((s4-0 (-> this head)) (s5-0 0) ) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -661,21 +666,21 @@ ) (format *stdcon* "hold list has ~D item(s)~%" s5-0) ) - (dotimes (s5-1 (the-as int (-> obj num-attempts))) + (dotimes (s5-1 (the-as int (-> this num-attempts))) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (the-as vector (-> obj attempts s5-1)) + (the-as vector (-> this attempts s5-1)) (meters 0.1) (new 'static 'rgba :a #x40) ) ) - (format *stdcon* "hold list has ~D attempt(s)~%" (-> obj num-attempts)) + (format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts)) ) -(defmethod debug-draw-tris collide-edge-work ((obj collide-edge-work)) - (dotimes (s5-0 (the-as int (-> obj num-tris))) - (let* ((v1-3 (-> obj tris s5-0 ctri)) +(defmethod debug-draw-tris collide-edge-work ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-tris))) + (let* ((v1-3 (-> this tris s5-0 ctri)) (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) ) (add-debug-outline-triangle @@ -724,5 +729,3 @@ (set! (-> v1-2 touch-hook) nothing) (set! (-> v1-2 active-hook) nothing) ) - - diff --git a/goal_src/jak2/engine/collide/collide-frag-h.gc b/goal_src/jak2/engine/collide/collide-frag-h.gc index 795a6b3483..ec84761bc9 100644 --- a/goal_src/jak2/engine/collide/collide-frag-h.gc +++ b/goal_src/jak2/engine/collide/collide-frag-h.gc @@ -14,6 +14,7 @@ :flag-assert #x900000010 ) + (deftype collide-frag-mesh (basic) ((packed-data uint32 :offset-assert 4) (pat-array uint32 :offset-assert 8) @@ -30,6 +31,7 @@ :flag-assert #x900000020 ) + (deftype collide-fragment (drawable) ((mesh collide-frag-mesh :offset 8) (collide-new basic :offset 12) @@ -39,6 +41,7 @@ :flag-assert #x1100000020 ) + (deftype drawable-inline-array-collide-fragment (drawable-inline-array) ((data collide-fragment 1 :inline :offset-assert 32) (pad uint32 :offset-assert 64) @@ -48,10 +51,10 @@ :flag-assert #x1100000044 ) + (deftype drawable-tree-collide-fragment (drawable-tree) () :method-count-assert 17 :size-assert #x20 :flag-assert #x1100000020 ) - diff --git a/goal_src/jak2/engine/collide/collide-frag.gc b/goal_src/jak2/engine/collide/collide-frag.gc index d5a654d35a..6307a3db05 100644 --- a/goal_src/jak2/engine/collide/collide-frag.gc +++ b/goal_src/jak2/engine/collide/collide-frag.gc @@ -11,35 +11,36 @@ Note: this is probably not used in jak 2 - this is the old tree-based background ;; DECOMP BEGINS -(defmethod login drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment)) - obj +(defmethod login drawable-tree-collide-fragment ((this drawable-tree-collide-fragment)) + this ) -(defmethod draw drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) +(defmethod draw drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) (when *display-render-collision* - (dotimes (s4-0 (-> obj length)) - (draw (-> obj data s4-0) (-> obj data s4-0) arg1) + (dotimes (s4-0 (-> this length)) + (draw (-> this data s4-0) (-> this data s4-0) arg1) ) ) 0 (none) ) -(defmethod unpack-vis drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) -(defmethod mem-usage collide-fragment ((obj collide-fragment) (arg0 memory-usage-block) (arg1 int)) +;; WARN: Return type mismatch int vs collide-fragment. +(defmethod mem-usage collide-fragment ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) (let ((s5-0 (if (logtest? arg1 1) 54 50 ) ) - (s4-0 (-> obj mesh)) + (s4-0 (-> this mesh)) ) (set! (-> arg0 data s5-0 name) (symbol->string 'collide-fragment)) (+! (-> arg0 data s5-0 count) 1) - (let ((v1-11 (+ (asize-of obj) (asize-of s4-0)))) + (let ((v1-11 (+ (asize-of this) (asize-of s4-0)))) (+! (-> arg0 data s5-0 used) v1-11) (+! (-> arg0 data s5-0 total) (logand -16 (+ v1-11 15))) ) @@ -61,21 +62,21 @@ Note: this is probably not used in jak 2 - this is the old tree-based background ) ) -(defmethod login drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment)) - obj +(defmethod login drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) + this ) -(defmethod draw collide-fragment ((obj collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) +(defmethod draw collide-fragment ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) 0 (none) ) -(defmethod draw drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) +(defmethod draw drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 drawable-inline-array-collide-fragment) (arg1 display-frame) ) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj data s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this data s4-0))) (if (sphere-cull (-> s3-0 bsphere)) (draw s3-0 s3-0 arg1) ) @@ -85,7 +86,7 @@ Note: this is probably not used in jak 2 - this is the old tree-based background (none) ) -(defmethod mem-usage drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -93,9 +94,8 @@ Note: this is probably not used in jak 2 - this is the old tree-based background (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) - diff --git a/goal_src/jak2/engine/collide/collide-mesh-h.gc b/goal_src/jak2/engine/collide/collide-mesh-h.gc index 12b286ad68..ee23dc7add 100644 --- a/goal_src/jak2/engine/collide/collide-mesh-h.gc +++ b/goal_src/jak2/engine/collide/collide-mesh-h.gc @@ -96,13 +96,13 @@ ) ) -(defmethod next-id! collide-mesh-cache ((obj collide-mesh-cache)) +(defmethod next-id! collide-mesh-cache ((this collide-mesh-cache)) "Reset all used entries in the cache and increment the id. If the id is zero, set it to 1" ;; ld v1, 12(a0) - (let ((v1 (-> obj id))) + (let ((v1 (-> this id))) ;; sw r0, 0(a0) - (set! (-> obj used-size) 0) + (set! (-> this used-size) 0) ;; daddiu v0, v1, 1 (let ((v0 (+ v1 1))) ;; beql v0, r0, L3 @@ -112,14 +112,14 @@ ) ;; L3: ;; sd v0, 12(a0) - (set! (-> obj id) v0) + (set! (-> this id) v0) v0 ) ) ) -(defmethod is-id? collide-mesh-cache ((obj collide-mesh-cache) (arg0 int)) - (= (-> obj id) arg0) +(defmethod is-id? collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) + (= (-> this id) arg0) ) (kmemopen global "collide-mesh-cache") diff --git a/goal_src/jak2/engine/collide/collide-mesh.gc b/goal_src/jak2/engine/collide/collide-mesh.gc index cd43e68d9e..e8ba407017 100644 --- a/goal_src/jak2/engine/collide/collide-mesh.gc +++ b/goal_src/jak2/engine/collide/collide-mesh.gc @@ -28,29 +28,29 @@ Another limitation is that triangles don't have per-tri pat info. ;; DECOMP BEGINS -(defmethod asize-of collide-mesh ((obj collide-mesh)) - (the-as int (+ (-> collide-mesh size) (* (+ (-> obj num-tris) -1) 8))) +(defmethod asize-of collide-mesh ((this collide-mesh)) + (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) ) -(defmethod mem-usage collide-mesh ((obj collide-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-mesh ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "collide-mesh") (+! (-> arg0 data 81 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 81 used) v1-6) (+! (-> arg0 data 81 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "collide-mesh") (+! (-> arg0 data 81 count) 1) - (let ((v1-16 (* (-> obj num-verts) 16))) + (let ((v1-16 (* (-> this num-verts) 16))) (+! (-> arg0 data 81 used) v1-16) (+! (-> arg0 data 81 total) (logand -16 (+ v1-16 15))) ) (the-as collide-mesh 0) ) -(defmethod debug-draw-tris collide-mesh ((obj collide-mesh) (arg0 process-drawable) (arg1 int)) +(defmethod debug-draw-tris collide-mesh ((this collide-mesh) (arg0 process-drawable) (arg1 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -62,10 +62,10 @@ Another limitation is that triangles don't have per-tri pat info. (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (the-as object (-> obj tris))) + (let ((s5-0 (the-as object (-> this tris))) (s4-0 (-> arg0 node-list data arg1 bone transform)) ) - (countdown (s3-0 (-> obj num-tris)) + (countdown (s3-0 (-> this num-tris)) (let ((a2-1 (new 'stack-no-clear 'vector)) (a3-0 (new 'stack-no-clear 'vector)) (t0-0 (new 'stack-no-clear 'vector)) @@ -74,9 +74,9 @@ Another limitation is that triangles don't have per-tri pat info. (.lvf vf5 (&-> s4-0 vector 1 quad)) (.lvf vf6 (&-> s4-0 vector 2 quad)) (.lvf vf7 (&-> s4-0 trans quad)) - (.lvf vf1 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) - (.lvf vf2 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) - (.lvf vf3 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 2)) quad)) + (.lvf vf1 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) + (.lvf vf2 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) + (.lvf vf3 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 2)) quad)) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-mesh-tri s5-0) pat mode) color) a 16))) (.mul.w.vf acc vf7 vf0) (.add.mul.x.vf acc vf4 vf1 acc) @@ -134,7 +134,7 @@ Another limitation is that triangles don't have per-tri pat info. :flag-assert #x900000030 ) -(defmethod should-push-away-test collide-mesh ((obj collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 collide-tri-result) (arg2 vector) (arg3 float)) +(defmethod should-push-away-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 collide-tri-result) (arg2 vector) (arg3 float)) (local-vars (v1-0 uint128) (a0-1 uint128) @@ -174,7 +174,7 @@ Another limitation is that triangles don't have per-tri pat info. (let ((s3-0 arg0)) (.lvf vf3 (&-> arg2 quad)) (nop!) - (let ((s2-0 (-> obj num-tris))) + (let ((s2-0 (-> this num-tris))) (.sub.w.vf vf12 vf3 vf3) (nop!) (.add.w.vf vf13 vf3 vf3) @@ -275,7 +275,7 @@ Another limitation is that triangles don't have per-tri pat info. ;; Collide Mesh Cache ;;;;;;;;;;;;;;;;;;;;;; -(defmethod populate-for-prim-mesh collide-mesh-cache ((obj collide-mesh-cache) (arg0 collide-shape-prim-mesh)) +(defmethod populate-for-prim-mesh collide-mesh-cache ((this collide-mesh-cache) (arg0 collide-shape-prim-mesh)) "Populate the mesh cache for the given prim-mesh. Will reuse existing data only if the transform and object are the same." (local-vars @@ -293,7 +293,7 @@ Another limitation is that triangles don't have per-tri pat info. (s4-0 (-> arg0 mesh-cache-entry)) ) (cond - ((= (-> arg0 mesh-cache-id) (-> obj id)) ;; check id first + ((= (-> arg0 mesh-cache-id) (-> this id)) ;; check id first ;; this weird pxor stuff is checking the transform for equality (let ((v1-6 (-> s5-0 vector 0 quad)) (a0-4 (-> s4-0 mat vector 0 quad)) @@ -338,12 +338,12 @@ Another limitation is that triangles don't have per-tri pat info. (let ((v1-19 (-> arg0 mesh))) (when v1-19 ;; allocate new mesh. - (set! s4-0 (allocate! obj (+ (* 96 (-> v1-19 num-tris)) 64))) + (set! s4-0 (allocate! this (+ (* 96 (-> v1-19 num-tris)) 64))) (set! (-> arg0 mesh-cache-entry) s4-0) (cond (s4-0 ;; if allocation succeeds, set up: - (set! (-> arg0 mesh-cache-id) (-> obj id)) + (set! (-> arg0 mesh-cache-id) (-> this id)) (set! (-> s4-0 mat vector 0 quad) (-> s5-0 vector 0 quad)) (set! (-> s4-0 mat vector 1 quad) (-> s5-0 vector 1 quad)) (set! (-> s4-0 mat vector 2 quad) (-> s5-0 vector 2 quad)) @@ -364,19 +364,19 @@ Another limitation is that triangles don't have per-tri pat info. ) ) -(defmethod allocate! collide-mesh-cache ((obj collide-mesh-cache) (arg0 int)) +(defmethod allocate! collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) "Allocate room in the collide-mesh-cache for an unpacked mesh with arg0 tris." (local-vars (a1-2 int) (a2-2 int)) (let* ((v1-0 (+ arg0 15)) - (a1-1 (-> obj used-size)) + (a1-1 (-> this used-size)) (v1-1 (/ v1-0 16)) - (a3-0 (-> obj data)) - (a2-0 (-> obj max-size)) + (a3-0 (-> this data)) + (a2-0 (-> this max-size)) (v1-2 (* v1-1 16)) (a3-1 (&+ a3-0 a1-1)) ) (let ((t1-0 (- a2-0 (the-as uint v1-2))) - (t0-0 (-> obj id)) + (t0-0 (-> this id)) ) (b! (< (the-as int t1-0) 0) cfg-6 :delay (set! a1-2 (the-as int (+ a1-1 v1-2)))) (b! (>= (the-as int (- a2-0 (the-as uint a1-2))) 0) cfg-5 :delay (set! a2-2 (the-as int (+ t0-0 1)))) @@ -384,10 +384,10 @@ Another limitation is that triangles don't have per-tri pat info. (b! (zero? (the-as uint a2-2)) cfg-4 :likely-delay (set! a2-2 1)) (label cfg-4) (set! a1-2 v1-2) - (set! a3-1 (-> obj data)) - (set! (-> obj id) (the-as uint a2-2)) + (set! a3-1 (-> this data)) + (set! (-> this id) (the-as uint a2-2)) (label cfg-5) - (set! (-> obj used-size) (the-as uint a1-2)) + (set! (-> this used-size) (the-as uint a1-2)) (let ((v0-0 a3-1)) (b! #t cfg-7 :delay (nop!)) (label cfg-6) @@ -399,7 +399,7 @@ Another limitation is that triangles don't have per-tri pat info. ) ) -(defmethod unpack-mesh-to-cache! collide-mesh ((obj collide-mesh) (arg0 (inline-array collide-mesh-cache-tri)) (arg1 matrix)) +(defmethod unpack-mesh-to-cache! collide-mesh ((this collide-mesh) (arg0 (inline-array collide-mesh-cache-tri)) (arg1 matrix)) "Unpack mesh and store in cache. Transform triangles, computes normals and bbox." (local-vars (t0-2 uint)) @@ -422,10 +422,10 @@ Another limitation is that triangles don't have per-tri pat info. (init-vf0-vector) (nop!) (let ((t0-0 (scratchpad-object int)) - (v1-0 (-> obj num-verts)) + (v1-0 (-> this num-verts)) ) (nop!) - (let ((a3-0 (the-as object (-> obj vertex-data)))) + (let ((a3-0 (the-as object (-> this vertex-data)))) (b! (zero? v1-0) cfg-3 :delay (.lvf vf1 (&-> arg1 vector 0 quad))) (nop!) (.lvf vf2 (&-> arg1 vector 1 quad)) @@ -488,10 +488,10 @@ Another limitation is that triangles don't have per-tri pat info. ) ) (label cfg-3) - (let ((v1-1 (the-as object (-> obj tris)))) + (let ((v1-1 (the-as object (-> this tris)))) (nop!) (let ((a2-1 (scratchpad-object int)) - (a0-1 (-> obj num-tris)) + (a0-1 (-> this num-tris)) ) (b! (zero? a0-1) cfg-6 :delay (set! t0-2 (-> (the-as (inline-array collide-mesh-tri) v1-1) 0 vertex-index 0))) (let* ((a1-1 (-> arg0 -1)) @@ -586,7 +586,7 @@ Another limitation is that triangles don't have per-tri pat info. :flag-assert #x900000030 ) -(defmethod overlap-test collide-mesh ((obj collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) +(defmethod overlap-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) (local-vars (v1-0 uint128) (a0-1 uint128) @@ -611,7 +611,7 @@ Another limitation is that triangles don't have per-tri pat info. (s4-0 arg0) ) (.lvf vf2 (&-> arg1 quad)) - (let ((s3-0 (-> obj num-tris))) + (let ((s3-0 (-> this num-tris))) (.sub.w.vf vf5 vf2 vf2) (.add.w.vf vf6 vf2 vf2) (.ftoi.vf vf5 vf5) diff --git a/goal_src/jak2/engine/collide/collide-shape-h.gc b/goal_src/jak2/engine/collide/collide-shape-h.gc index 5ae6d84e51..e755f61a6d 100644 --- a/goal_src/jak2/engine/collide/collide-shape-h.gc +++ b/goal_src/jak2/engine/collide/collide-shape-h.gc @@ -272,9 +272,9 @@ ) -(defmethod prepare collide-rider-pool ((obj collide-rider-pool)) +(defmethod prepare collide-rider-pool ((this collide-rider-pool)) "Gets this pool ready to be used to allow allocations. This should be called once at the start of every frame." - (set! (-> obj alloc-count) 0) + (set! (-> this alloc-count) 0) 0 (none) ) @@ -582,8 +582,8 @@ ) ;; WARN: Return type mismatch uint vs int. -(defmethod length collide-shape-prim-group ((obj collide-shape-prim-group)) - (the-as int (-> obj num-children)) +(defmethod length collide-shape-prim-group ((this collide-shape-prim-group)) + (the-as int (-> this num-children)) ) (defmethod new collide-shape ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) diff --git a/goal_src/jak2/engine/collide/collide-shape-rider.gc b/goal_src/jak2/engine/collide/collide-shape-rider.gc index b78a0779b1..e0fab0f9ca 100644 --- a/goal_src/jak2/engine/collide/collide-shape-rider.gc +++ b/goal_src/jak2/engine/collide/collide-shape-rider.gc @@ -7,14 +7,14 @@ ;; DECOMP BEGINS -(defmethod on-platform collide-shape ((obj collide-shape) (arg0 collide-shape) (arg1 collide-query)) +(defmethod on-platform collide-shape ((this collide-shape) (arg0 collide-shape) (arg1 collide-query)) (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) (set! (-> v1-0 best-my-prim) #f) (set! (-> v1-0 num-spheres) (the-as uint #f)) ) (set! (-> arg1 best-dist) 122.88) - (let ((s5-0 (-> obj root-prim)) + (let ((s5-0 (-> this root-prim)) (s4-0 (-> arg0 root-prim)) ) (when (and (logtest? (-> s5-0 prim-core collide-with) (-> s4-0 prim-core collide-as)) @@ -38,16 +38,16 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod on-platform-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") (none) ) -(defmethod on-platform-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (let ((s4-0 (-> arg0 prim-core collide-as)) - (s3-0 (-> obj child 0)) + (s3-0 (-> this child 0)) ) - (countdown (s2-0 (-> obj num-children)) + (countdown (s2-0 (-> this num-children)) (when (and (logtest? (-> s3-0 prim-core collide-with) s4-0) (logtest? (-> s3-0 prim-core action) (collide-action rideable)) ) @@ -71,10 +71,10 @@ ) ;; WARN: Return type mismatch pat-surface vs none. -(defmethod on-platform-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (case (-> arg0 type) ((collide-shape-prim-group) - (let ((s4-0 (-> obj prim-core collide-with)) + (let ((s4-0 (-> this prim-core collide-with)) (s3-0 (-> (the-as collide-shape-prim-group arg0) child 0)) (s2-1 (the-as object (-> (the-as collide-shape-prim-group arg0) num-children))) ) @@ -83,15 +83,15 @@ (when (and (logtest? s4-0 (-> s3-0 prim-core collide-as)) (logtest? (-> s3-0 prim-core action) (collide-action can-ride)) ) - (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> obj prim-core)) (the-as vector (-> s3-0 prim-core))) - (-> obj prim-core world-sphere w) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> this prim-core)) (the-as vector (-> s3-0 prim-core))) + (-> this prim-core world-sphere w) ) (-> s3-0 prim-core world-sphere w) ) ) ) (if (< f0-2 122.88) - (on-platform-test obj s3-0 arg1 f0-2) + (on-platform-test this s3-0 arg1 f0-2) ) ) ) @@ -100,9 +100,9 @@ ) ) ((collide-shape-prim-sphere) - (let ((s3-1 (-> obj mesh))) + (let ((s3-1 (-> this mesh))) (when s3-1 - (let ((v1-13 (populate-for-prim-mesh *collide-mesh-cache* obj))) + (let ((v1-13 (populate-for-prim-mesh *collide-mesh-cache* this))) (when v1-13 (let* ((s4-1 (new 'stack-no-clear 'collide-tri-result)) (f0-4 (sphere-on-platform-test @@ -116,7 +116,7 @@ ) (when (< f0-4 (-> arg1 best-dist)) (set! (-> arg1 best-dist) f0-4) - (set! (-> arg1 best-my-prim) obj) + (set! (-> arg1 best-my-prim) this) (set! (-> arg1 num-spheres) (the-as uint arg0)) (set! (-> arg1 best-other-tri vertex 0 quad) (-> s4-1 vertex 0 quad)) (set! (-> arg1 best-other-tri vertex 1 quad) (-> s4-1 vertex 1 quad)) @@ -135,12 +135,12 @@ (none) ) -(defmethod add-rider collide-rider-pool ((obj collide-rider-pool) (arg0 handle)) - (let ((v1-0 (-> obj alloc-count))) +(defmethod add-rider collide-rider-pool ((this collide-rider-pool) (arg0 handle)) + (let ((v1-0 (-> this alloc-count))) (cond ((< v1-0 20) - (let ((v0-0 (-> obj riders v1-0))) - (set! (-> obj alloc-count) (+ v1-0 1)) + (let ((v0-0 (-> this riders v1-0))) + (set! (-> this alloc-count) (+ v1-0 1)) (set! (-> v0-0 rider-handle) arg0) (set! (-> v0-0 sticky-prim) #f) v0-0 @@ -155,15 +155,15 @@ ) ;; WARN: Return type mismatch joint-control-status vs symbol. -(defmethod detect-riders! collide-shape ((obj collide-shape)) +(defmethod detect-riders! collide-shape ((this collide-shape)) (local-vars (v0-7 joint-control-status) (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) - (set! (-> obj num-riders) (the-as uint 0)) - (set! (-> obj riders) (the-as (inline-array collide-rider) #f)) - (let* ((s4-0 (-> obj root-prim)) + (set! (-> this num-riders) (the-as uint 0)) + (set! (-> this riders) (the-as (inline-array collide-rider) #f)) + (let* ((s4-0 (-> this root-prim)) (s5-0 (-> s4-0 prim-core collide-with)) ) (set! *actor-list-length* 0) @@ -259,18 +259,20 @@ (v1-24 (-> s3-0 root-prim)) ) (when (logtest? s5-0 (-> v1-24 prim-core collide-as)) - (when (and (logtest? (-> v1-24 prim-core action) (collide-action can-ride)) (!= (-> obj process) (-> s3-0 process))) + (when (and (logtest? (-> v1-24 prim-core action) (collide-action can-ride)) + (!= (-> this process) (-> s3-0 process)) + ) (let ((s2-0 (new 'stack-no-clear 'collide-query))) - (when (on-platform obj s3-0 s2-0) + (when (on-platform this s3-0 s2-0) (let ((s5-1 (add-rider *collide-rider-pool* (process->handle (-> s3-0 process))))) (when s5-1 - (+! (-> obj num-riders) 1) - (if (not (-> obj riders)) - (set! (-> obj riders) (the-as (inline-array collide-rider) s5-1)) + (+! (-> this num-riders) 1) + (if (not (-> this riders)) + (set! (-> this riders) (the-as (inline-array collide-rider) s5-1)) ) (let ((a0-15 (-> s2-0 best-my-prim))) (set! (-> s5-1 sticky-prim) a0-15) - (let ((s1-0 (-> obj process node-list data (-> a0-15 transform-index) bone transform))) + (let ((s1-0 (-> this process node-list data (-> a0-15 transform-index) bone transform))) (set! (-> s5-1 prim-ry) (matrix-y-angle s1-0)) (let ((s2-1 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s2-1 s1-0) @@ -279,10 +281,10 @@ ) ) ) - (send-event (-> obj process) 'ridden s5-1) + (send-event (-> this process) 'ridden s5-1) ) ) - (set! s5-0 (-> obj root-prim prim-core collide-with)) + (set! s5-0 (-> this root-prim prim-core collide-with)) ) ) ) @@ -290,12 +292,12 @@ ) ) ) - (let ((v1-58 (-> obj process skel))) + (let ((v1-58 (-> this process skel))) (the-as symbol (when (nonzero? v1-58) (cond - ((or (> (-> obj num-riders) 0) (logtest? (-> obj root-prim prim-core action) (collide-action edge-grabbed))) + ((or (> (-> this num-riders) 0) (logtest? (-> this root-prim prim-core action) (collide-action edge-grabbed))) (set! v0-7 (logior (-> v1-58 status) (joint-control-status sync-math))) (set! (-> v1-58 status) v0-7) ) @@ -312,11 +314,11 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod pull-riders! collide-shape ((obj collide-shape)) - (let ((s5-0 (-> obj riders))) +(defmethod pull-riders! collide-shape ((this collide-shape)) + (let ((s5-0 (-> this riders))) (when s5-0 (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) - (countdown (s3-0 (-> obj num-riders)) + (countdown (s3-0 (-> this num-riders)) (let* ((v1-2 (-> s5-0 s3-0)) (a0-1 (-> v1-2 rider-handle)) ) @@ -327,14 +329,14 @@ ) (let ((a0-5 (-> v1-2 sticky-prim))) (when a0-5 - (let ((s2-0 (-> obj process node-list data (-> a0-5 transform-index) bone transform))) + (let ((s2-0 (-> this process node-list data (-> a0-5 transform-index) bone transform))) (let ((s1-0 (-> s4-0 rider-dest))) (vector-matrix*! s1-0 (-> v1-2 rider-local-pos) s2-0) (vector-float*! s1-0 s1-0 (/ 1.0 (-> s1-0 w))) ) (set! (-> s4-0 rider-delta-ry) (deg- (matrix-y-angle s2-0) (-> s4-0 rider prim-ry))) ) - (pull-rider! obj s4-0) + (pull-rider! this s4-0) ) ) ) @@ -347,7 +349,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod pull-rider! collide-shape ((obj collide-shape) (arg0 pull-rider-info)) +(defmethod pull-rider! collide-shape ((this collide-shape) (arg0 pull-rider-info)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -362,9 +364,9 @@ (set! (-> s3-0 quad) (-> gp-0 trans quad)) (vector-! s2-0 (-> arg0 rider-dest) s3-0) (cond - ((logtest? (-> obj root-prim prim-core action) (collide-action pull-rider-can-collide)) - (let ((s1-0 (-> obj root-prim prim-core collide-as))) - (set! (-> obj root-prim prim-core collide-as) (collide-spec)) + ((logtest? (-> this root-prim prim-core action) (collide-action pull-rider-can-collide)) + (let ((s1-0 (-> this root-prim prim-core collide-as))) + (set! (-> this root-prim prim-core collide-as) (collide-spec)) (let ((a2-0 (new 'stack-no-clear 'collide-query))) (set! (-> a2-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) (set! (-> a2-0 ignore-process0) (-> gp-0 process)) @@ -373,7 +375,7 @@ (set! (-> a2-0 action-mask) (collide-action solid)) (fill-cache-for-shape gp-0 (+ 8192.0 (vector-length s2-0)) a2-0) ) - (set! (-> obj root-prim prim-core collide-as) s1-0) + (set! (-> this root-prim prim-core collide-as) s1-0) ) (let ((s1-1 (new 'stack-no-clear 'vector))) (set! (-> s1-1 quad) (-> s2-0 quad)) @@ -410,8 +412,8 @@ (vector-float*! (-> gp-0 rider-last-move) v1-26 (-> pp clock frames-per-second)) ) (let ((f0-4 (vector-length (-> gp-0 rider-last-move)))) - (if (< (-> obj rider-max-momentum) f0-4) - (vector-normalize! (-> gp-0 rider-last-move) (-> obj rider-max-momentum)) + (if (< (-> this rider-max-momentum) f0-4) + (vector-normalize! (-> gp-0 rider-last-move) (-> this rider-max-momentum)) ) ) (set! (-> gp-0 rider-time) (-> gp-0 process clock frame-counter)) diff --git a/goal_src/jak2/engine/collide/collide-shape.gc b/goal_src/jak2/engine/collide/collide-shape.gc index d117518852..4dc8f715c8 100644 --- a/goal_src/jak2/engine/collide/collide-shape.gc +++ b/goal_src/jak2/engine/collide/collide-shape.gc @@ -29,23 +29,23 @@ it returns a triangle and normal direction to push in. ;; PUSHER ;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod pusher-init collide-shape ((obj collide-shape)) +(defmethod pusher-init collide-shape ((this collide-shape)) "Initialize a collide-shape as a pusher and move it to the pusher pool." - (when (logtest? (collide-spec pusher) (-> obj root-prim prim-core collide-as)) - (let ((proc (the-as process-tree (-> obj process)))) + (when (logtest? (collide-spec pusher) (-> this root-prim prim-core collide-as)) + (let ((proc (the-as process-tree (-> this process)))) (while (not (logtest? (-> proc mask) (process-mask process-tree))) (set! proc (ppointer->process (-> proc parent))) ) ;; "pushers" go in a separate pool so they run after non-pushers. (if (!= proc *pusher-pool*) - (change-parent (-> obj process) *pusher-pool*) + (change-parent (-> this process) *pusher-pool*) ) ) ) (none) ) -(defmethod should-push-away collide-shape ((obj collide-shape) (other collide-shape) (cquery collide-query)) +(defmethod should-push-away collide-shape ((this collide-shape) (other collide-shape) (cquery collide-query)) "Should this shape push away the other? Most generic implementation." (local-vars (v1-2 uint) (v1-3 float) (a2-2 uint) (a3-2 uint)) (rlet ((acc :class vf) @@ -62,7 +62,7 @@ it returns a triangle and normal direction to push in. (set! (-> v1-0 best-my-prim) #f) (set! (-> v1-0 num-spheres) (the-as uint #f)) ) - (let ((a0-1 (-> obj root-prim)) + (let ((a0-1 (-> this root-prim)) (a1-1 (-> other root-prim)) ) ;; check action @@ -106,13 +106,13 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod should-push-away-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query)) +(defmethod should-push-away-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query)) "Most generic should-push-away-test - child prims are expected to override." (format 0 "ERROR: collide-shape-prim::should-push-away-test was called illegally!~%") (none) ) -(defmethod should-push-away-test collide-shape-prim-group ((obj collide-shape-prim-group) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test collide-shape-prim-group ((this collide-shape-prim-group) (other collide-shape-prim) (cquery collide-query)) "Should push away test where the pusher is a group." (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) (rlet ((acc :class vf) @@ -124,8 +124,8 @@ it returns a triangle and normal direction to push in. ) (init-vf0-vector) (nop!) - (let ((s4-0 (the-as collide-shape-prim obj)) - (s3-0 (the-as uint (-> obj num-children))) + (let ((s4-0 (the-as collide-shape-prim this)) + (s3-0 (the-as uint (-> this num-children))) ) (nop!) (let ((v1-0 (-> other prim-core collide-as))) @@ -169,7 +169,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod should-push-away-a-group-test collide-shape-prim ((obj collide-shape-prim) (other collide-shape-prim-group) (cquery collide-query)) +(defmethod should-push-away-a-group-test collide-shape-prim ((this collide-shape-prim) (other collide-shape-prim-group) (cquery collide-query)) "should-push-away-test anything vs. a group." (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) (rlet ((acc :class vf) @@ -185,9 +185,9 @@ it returns a triangle and normal direction to push in. (s3-0 (the-as uint (-> other num-children))) ) (nop!) - (let ((v1-0 (-> obj prim-core collide-with))) + (let ((v1-0 (-> this prim-core collide-with))) (nop!) - (.lvf vf2 (&-> obj prim-core world-sphere quad)) + (.lvf vf2 (&-> this prim-core world-sphere quad)) (until (> f0-0 a0-3) (until (nonzero? a0-2) (label cfg-1) @@ -215,31 +215,31 @@ it returns a triangle and normal direction to push in. (.add.w.vf vf3 vf0 vf3 :mask #b1) (.mov a0-3 vf3) ) - (should-push-away-test obj (the-as collide-shape-prim s4-0) cquery) - (set! v1-0 (-> obj prim-core collide-with)) + (should-push-away-test this (the-as collide-shape-prim s4-0) cquery) + (set! v1-0 (-> this prim-core collide-with)) ) ) - (b! #t cfg-1 :delay (.lvf vf2 (&-> obj prim-core world-sphere quad))) + (b! #t cfg-1 :delay (.lvf vf2 (&-> this prim-core world-sphere quad))) (label cfg-6) 0 (none) ) ) -(defmethod should-push-away-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (other collide-shape-prim) (cquery collide-query)) "Check if we should push away another shape (must be sphere or group)" (let ((v1-0 (-> other prim-core prim-type))) (cond ((= v1-0 (prim-type group)) ;; iterate over group - (should-push-away-a-group-test obj (the-as collide-shape-prim-group other) cquery) + (should-push-away-a-group-test this (the-as collide-shape-prim-group other) cquery) ) (else (b! (> (the-as int v1-0) 0) cfg-8 :delay (nop!)) - (let ((s2-0 (-> obj mesh))) + (let ((s2-0 (-> this mesh))) (b! (not s2-0) cfg-7 :delay (empty-form)) ;; mesh vs. sphere. Set up the collide-mesh-cache - (let ((v1-4 (populate-for-prim-mesh *collide-mesh-cache* obj))) + (let ((v1-4 (populate-for-prim-mesh *collide-mesh-cache* this))) (b! (not v1-4) cfg-7 :delay (empty-form)) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result))) ;; run the actual mesh/sphere collision @@ -255,7 +255,7 @@ it returns a triangle and normal direction to push in. (b! (>= f0-1 (-> cquery best-dist)) cfg-7 :delay #f) (set! (-> cquery best-dist) f0-1) ) - (set! (-> cquery best-my-prim) obj) + (set! (-> cquery best-my-prim) this) (set! (-> cquery num-spheres) (the-as uint other)) (set! (-> cquery best-other-tri vertex 0 quad) (-> s5-0 vertex 0 quad)) (set! (-> cquery best-other-tri vertex 1 quad) (-> s5-0 vertex 1 quad)) @@ -278,7 +278,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod should-push-away-test collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test collide-shape-prim-sphere ((this collide-shape-prim-sphere) (other collide-shape-prim) (cquery collide-query)) "Sphere against anything test." (local-vars (v1-3 float)) (rlet ((acc :class vf) @@ -297,12 +297,12 @@ it returns a triangle and normal direction to push in. (cond ((= v1-0 (prim-type group)) ;; test against a group - (should-push-away-a-group-test obj (the collide-shape-prim-group other) cquery) + (should-push-away-a-group-test this (the collide-shape-prim-group other) cquery) ) (else (b! (> (the-as int v1-0) 0) cfg-5 :delay (nop!)) ;; sphere sphere - (.lvf vf1 (&-> obj prim-core world-sphere quad)) + (.lvf vf1 (&-> this prim-core world-sphere quad)) (.lvf vf2 (&-> other prim-core world-sphere quad)) (.sub.vf vf3 vf2 vf1 :mask #b111) (.add.w.vf vf5 vf1 vf2 :mask #b1000) @@ -322,9 +322,9 @@ it returns a triangle and normal direction to push in. (.mov v1-3 vf6) (let ((f1-0 v1-3)) (b! (<= f2-0 f1-0) cfg-9) - (let ((v1-4 (-> obj pat))) + (let ((v1-4 (-> this pat))) (set! (-> cquery best-dist) f1-0) - (set! (-> cquery best-my-prim) obj) + (set! (-> cquery best-my-prim) this) (set! (-> cquery num-spheres) (the-as uint other)) (.svf (&-> cquery best-other-tri normal quad) vf3) (set! (-> cquery best-other-tri pat) v1-4) @@ -335,8 +335,8 @@ it returns a triangle and normal direction to push in. (s4-1 (-> cquery best-other-tri intersect)) ) ;; some annoying logic to fake a "triangle" on the sphere - (vector-float*! s4-1 s3-0 (-> obj prim-core world-sphere w)) - (vector+! s4-1 s4-1 (the-as vector (-> obj prim-core))) + (vector-float*! s4-1 s3-0 (-> this prim-core world-sphere w)) + (vector+! s4-1 s4-1 (the-as vector (-> this prim-core))) (set! (-> cquery best-other-tri vertex 0 quad) (-> s4-1 quad)) (point-in-plane-<-point+normal! (-> cquery best-other-tri vertex 1) s4-1 s3-0) (let* ((a0-8 (vector-normalize! @@ -374,22 +374,22 @@ it returns a triangle and normal direction to push in. s2-0 (the-as collide-mesh-cache-tri (-> v1-13 tris)) s3-1 - (the-as vector (-> obj prim-core)) + (the-as vector (-> this prim-core)) (-> cquery best-dist) ) ) ) (when (< f0-3 (-> cquery best-dist)) (set! (-> cquery best-dist) f0-3) - (set! (-> cquery best-my-prim) obj) + (set! (-> cquery best-my-prim) this) (set! (-> cquery num-spheres) (the-as uint other)) (let ((s4-2 (-> cquery best-other-tri normal))) ;; some annoying logic to fake a "triangle" on the sphere - (vector-! s4-2 (-> s3-1 intersect) (the-as vector (-> obj prim-core))) + (vector-! s4-2 (-> s3-1 intersect) (the-as vector (-> this prim-core))) (vector-normalize! s4-2 1.0) (let ((s3-2 (-> cquery best-other-tri intersect))) - (vector-float*! s3-2 s4-2 (-> obj prim-core world-sphere w)) - (vector+! s3-2 s3-2 (the-as vector (-> obj prim-core))) + (vector-float*! s3-2 s4-2 (-> this prim-core world-sphere w)) + (vector+! s3-2 s3-2 (the-as vector (-> this prim-core))) (set! (-> cquery best-other-tri vertex 0 quad) (-> s3-2 quad)) (point-in-plane-<-point+normal! (-> cquery best-other-tri vertex 1) s3-2 s4-2) (let* ((a0-23 (vector-normalize! @@ -416,7 +416,7 @@ it returns a triangle and normal direction to push in. ) ) ) - (set! (-> cquery best-other-tri pat) (-> obj pat)) + (set! (-> cquery best-other-tri pat) (-> this pat)) ) ) ) @@ -448,12 +448,12 @@ it returns a triangle and normal direction to push in. ;; NOTE: it will over-populate the list, and the user must call (update-from-step-size *touching-list* u) ;; in order to get an accurate list. -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim ((obj collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-mesh!~%") (none) ) -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) "Collide a moving sphere with a mesh in the collide cache." (rlet ((vf1 :class vf) (vf2 :class vf) @@ -466,21 +466,21 @@ it returns a triangle and normal direction to push in. (f0-1 (resolve-moving-sphere-tri arg1 gp-0 - (-> obj prim-core) + (-> this prim-core) (-> arg0 move-dist) (-> arg0 best-dist) - (-> obj prim-core action) + (-> this prim-core action) ) ) ) (when (>= f0-1 0.0) ;; did we hit anything? (let ((v1-3 (-> arg1 prim-core action)) - (a0-2 (-> obj prim-core action)) + (a0-2 (-> this prim-core action)) (a2-2 (-> arg1 prim)) ) ;; it really seems like these checks should have gone first... (let* ((v1-4 (logand a0-2 v1-3)) - (a0-3 (-> obj cshape)) + (a0-3 (-> this cshape)) (a1-2 (logand v1-4 (collide-action solid))) (v1-5 (-> a2-2 cshape)) ) @@ -507,14 +507,14 @@ it returns a triangle and normal direction to push in. (set! (-> arg0 best-other-tri collide-ptr) a1-4) ) (set! (-> arg0 num-spheres) (the-as uint a2-2)) - (set! (-> arg0 best-my-prim) obj) + (set! (-> arg0 best-my-prim) this) (label cfg-6) (b! (not v1-5) cfg-8 :delay (empty-form)) ) ;; add to touching list (add-touching-prims *touching-list* - obj + this a2-2 f0-1 (the-as collide-tri-result #f) @@ -529,18 +529,18 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) "moving mesh to mesh not supported." (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim mesh is not currently supported!~%") (none) ) -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) "Collide a group with a mesh in the collide cache." (let ((s4-0 (-> arg1 prim-core collide-as)) - (s3-0 (-> obj child 0)) + (s3-0 (-> this child 0)) ) - (countdown (s2-0 (the-as uint (-> obj num-children))) + (countdown (s2-0 (the-as uint (-> this num-children))) (if (logtest? (-> s3-0 prim-core collide-with) s4-0) (collide-with-collide-cache-prim-mesh s3-0 arg0 arg1) ) @@ -551,12 +551,12 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim ((obj collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-sphere!~%") (none) ) -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -567,7 +567,7 @@ it returns a triangle and normal direction to push in. (f0-1 (resolve-moving-sphere-sphere arg1 gp-0 - (-> obj prim-core) + (-> this prim-core) (-> arg0 move-dist) (-> arg0 best-dist) (-> arg1 prim-core action) @@ -576,11 +576,11 @@ it returns a triangle and normal direction to push in. ) (b! (< f0-1 0.0) cfg-5 :delay #f) (let ((v1-3 (-> arg1 prim-core action)) - (a0-2 (-> obj prim-core action)) + (a0-2 (-> this prim-core action)) (a2-2 (-> arg1 prim)) ) (let* ((a0-3 (logand a0-2 v1-3)) - (v1-4 (-> obj cshape)) + (v1-4 (-> this cshape)) (a1-2 (logand a0-3 (collide-action solid))) (a0-4 (-> a2-2 cshape)) ) @@ -605,11 +605,11 @@ it returns a triangle and normal direction to push in. (set! (-> arg0 best-other-tri collide-ptr) a0-6) ) (set! (-> arg0 num-spheres) (the-as uint a2-2)) - (set! (-> arg0 best-my-prim) obj) + (set! (-> arg0 best-my-prim) this) (label cfg-4) (add-touching-prims *touching-list* - obj + this a2-2 f0-1 (the-as collide-tri-result #f) @@ -623,17 +623,17 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) "Can't collide meshes with collide cache." (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim sphere is not currently supported!~%") (none) ) -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) (let ((s4-0 (-> arg1 prim-core collide-as)) - (s3-0 (-> obj child 0)) + (s3-0 (-> this child 0)) ) - (countdown (s2-0 (the-as uint (-> obj num-children))) + (countdown (s2-0 (the-as uint (-> this num-children))) (if (logtest? (-> s3-0 prim-core collide-with) s4-0) (collide-with-collide-cache-prim-sphere s3-0 arg0 arg1) ) @@ -811,55 +811,55 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod react-to-pat! collide-shape-moving ((obj collide-shape-moving) (arg0 pat-surface)) +(defmethod react-to-pat! collide-shape-moving ((this collide-shape-moving) (arg0 pat-surface)) "React to colliding with the given 'pat'." (let ((set-flags (cshape-reaction-flags))) - (set! (-> obj cur-pat) arg0) - (set! (-> obj poly-pat) arg0) + (set! (-> this cur-pat) arg0) + (set! (-> this poly-pat) arg0) ;; update the surface based on materials. (case (-> arg0 material) (((pat-material ice)) - (set! (-> obj surf) *ice-surface*) + (set! (-> this surf) *ice-surface*) ) (((pat-material gravel)) - (set! (-> obj surf) *gravel-surface*) + (set! (-> this surf) *gravel-surface*) ) (((pat-material quicksand)) - (set! (-> obj surf) *quicksand-surface*) + (set! (-> this surf) *quicksand-surface*) ) (((pat-material tube)) - (set! (-> obj surf) *no-walk-surface*) + (set! (-> this surf) *no-walk-surface*) ) (else - (set! (-> obj surf) *standard-ground-surface*) + (set! (-> this surf) *standard-ground-surface*) ) ) ;; respond to events. (when (nonzero? (-> arg0 event)) (case (-> arg0 event) (((pat-event slide)) - (set! (-> obj surf) *gravel-surface*) - (send-event (-> obj process) 'slide) + (set! (-> this surf) *gravel-surface*) + (send-event (-> this process) 'slide) ) (((pat-event slippery)) - (set! (-> obj surf) *gravel-surface*) + (set! (-> this surf) *gravel-surface*) ) (((pat-event rail)) - (let* ((s4-0 (-> obj process)) + (let* ((s4-0 (-> this process)) (a0-14 (if (type? s4-0 process-focusable) s4-0 ) ) ) (if (and a0-14 (not (logtest? (focus-status rail) (-> (the-as process-focusable a0-14) focus-status)))) - (set! (-> obj surf) *rail-surface*) + (set! (-> this surf) *rail-surface*) ) ) ) (((pat-event deadly)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) (send-event - (-> obj process) + (-> this process) 'attack #f (static-attack-info ((id (the-as uint 2)) (mode 'deadly) (shove-up (meters 3)))) @@ -868,7 +868,7 @@ it returns a triangle and normal direction to push in. (((pat-event burn)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) (send-event - (-> obj process) + (-> this process) 'attack #f (static-attack-info ((id (the-as uint 2)) (mode 'burn) (shove-up (meters 3)))) @@ -876,26 +876,26 @@ it returns a triangle and normal direction to push in. ) (((pat-event deadlyup)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) - (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'deadlyup) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'deadlyup) ) (((pat-event shockup)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) - (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'shockup) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'shockup) ) (((pat-event burnup)) - (when (not (focus-test? (the-as process-focusable (-> obj process)) pilot)) + (when (not (focus-test? (the-as process-focusable (-> this process)) pilot)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) - (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'burnup) ) ) (((pat-event melt)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) - (send-event (-> obj process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'melt)))) + (send-event (-> this process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'melt)))) ) (((pat-event endlessfall)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) (send-event - (-> obj process) + (-> this process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'endlessfall))) @@ -903,13 +903,13 @@ it returns a triangle and normal direction to push in. ) (((pat-event shock)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) - (send-event (-> obj process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'shock)))) + (send-event (-> this process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'shock)))) ) (((pat-event lip)) - (send-event (-> obj process) 'lip 'lip) + (send-event (-> this process) 'lip 'lip) ) (((pat-event lipramp)) - (send-event (-> obj process) 'lip 'lipramp) + (send-event (-> this process) 'lip 'lipramp) ) ) ) @@ -1099,7 +1099,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod step-collison! collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) +(defmethod step-collison! collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) "Main function to move forward until we hit a single thing, then react." (local-vars (sv-592 int)) (with-pp @@ -1113,7 +1113,7 @@ it returns a triangle and normal direction to push in. (set! (-> s5-0 best-dist) -100000000.0) (set! (-> s5-0 best-my-prim) #f) (set! (-> s5-0 num-spheres) (the-as uint #f)) - (let* ((s1-1 (-> obj root-prim)) + (let* ((s1-1 (-> this root-prim)) (v1-5 *collide-cache*) (s0-0 (the-as collide-cache-prim (-> v1-5 prims))) ) @@ -1144,7 +1144,7 @@ it returns a triangle and normal direction to push in. ) ;; handle collision. will move us. - (set! (-> obj prev-status) ((-> obj reaction) (the-as control-info obj) s5-0 arg0 arg1)) + (set! (-> this prev-status) ((-> this reaction) (the-as control-info this) s5-0 arg0 arg1)) ;; debug draw (when *display-collision-marks* @@ -1174,14 +1174,14 @@ it returns a triangle and normal direction to push in. (meters 0.00007324219) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) - (if (= (-> obj process type) target) + (if (= (-> this process type) target) (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> s5-0 best-other-tri intersect) - (-> obj surface-normal) + (-> this surface-normal) (meters 0.5) - (-> *pat-mode-info* (-> obj cur-pat mode) hilite-color) + (-> *pat-mode-info* (-> this cur-pat mode) hilite-color) ) ) ) @@ -1191,11 +1191,11 @@ it returns a triangle and normal direction to push in. ) (else ;; didn't collide. call no reaction and clear stuff - (set! (-> obj reaction-flag) (cshape-reaction-flags)) - ((-> obj no-reaction) obj s5-0 arg0 arg1) - (set! (-> obj prev-status) (collide-status)) + (set! (-> this reaction-flag) (cshape-reaction-flags)) + ((-> this no-reaction) this s5-0 arg0 arg1) + (set! (-> this prev-status) (collide-status)) ;; move all the way - (move-by-vector! obj s2-0) + (move-by-vector! this s2-0) (set! (-> arg0 quad) (-> arg1 quad)) 1.0 ;; return 1 to indicate that we did the whole thing. ) @@ -1213,7 +1213,7 @@ it returns a triangle and normal direction to push in. ;; this function moves collide shapes by one frame. -(defmethod integrate-and-collide! collide-shape ((obj collide-shape) (arg0 vector)) +(defmethod integrate-and-collide! collide-shape ((this collide-shape) (arg0 vector)) ;; for the simple collide shape, just move, and ignore collision. (local-vars (at-0 int)) (rlet ((vf0 :class vf) @@ -1221,7 +1221,7 @@ it returns a triangle and normal direction to push in. (vf2 :class vf) ) (init-vf0-vector) - (let ((t9-0 (method-of-object obj move-by-vector!)) + (let ((t9-0 (method-of-object this move-by-vector!)) (v1-1 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> arg0 quad)) @@ -1232,24 +1232,24 @@ it returns a triangle and normal direction to push in. (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> v1-1 quad) vf1) - (t9-0 obj v1-1) + (t9-0 this v1-1) ) (none) ) ) -(defmethod integrate-and-collide! collide-shape-moving ((obj collide-shape-moving) (arg0 vector)) +(defmethod integrate-and-collide! collide-shape-moving ((this collide-shape-moving) (arg0 vector)) "Main function to move a collide shape at a given velocity for 1 frame." ;; compute the location of our collision geometry based on transforms from animations/other places. - (update-transforms obj) + (update-transforms this) ;; set up status - (set! (-> obj trans-old-old-old quad) (-> obj trans-old-old quad)) - (set! (-> obj trans-old-old quad) (-> obj trans-old quad)) - (set! (-> obj trans-old quad) (-> obj trans quad)) - (set! (-> obj prev-status) (-> obj status)) - (logclear! (-> obj status) (collide-status + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status on-surface on-ground touch-surface @@ -1266,14 +1266,14 @@ it returns a triangle and normal direction to push in. glance ) ) - (when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset))) - (let ((v1-13 (-> obj dynam gravity-normal))) - (set! (-> obj local-normal quad) (-> v1-13 quad)) - (set! (-> obj surface-normal quad) (-> v1-13 quad)) - (set! (-> obj poly-normal quad) (-> v1-13 quad)) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) ) - (set! (-> obj coverage) 0.0) - (set! (-> obj touch-angle) 0.0) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) ) ;; collision loop: run until we: @@ -1283,11 +1283,11 @@ it returns a triangle and normal direction to push in. (let ((f30-0 1.0) (s4-0 0) ) - (while (and (< 0.05 f30-0) (and (< s4-0 (the-as int (-> obj max-iteration-count))) + (while (and (< 0.05 f30-0) (and (< s4-0 (the-as int (-> this max-iteration-count))) (not (and (= (-> arg0 x) 0.0) (= (-> arg0 y) 0.0) (= (-> arg0 z) 0.0))) ) ) - (let ((f28-0 (step-collison! obj arg0 arg0 f30-0 s4-0))) ;; move until we hit something, or travel the full distance + (let ((f28-0 (step-collison! this arg0 arg0 f30-0 s4-0))) ;; move until we hit something, or travel the full distance (update-from-step-size *touching-list* f28-0) ;; update touch list with the actual step size (set! f30-0 (- f30-0 (* f28-0 f30-0))) ;; update how much is left (fraction of what we tried) ) @@ -1298,7 +1298,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod integrate-and-collide! control-info ((obj control-info) (arg0 vector)) +(defmethod integrate-and-collide! control-info ((this control-info) (arg0 vector)) "specialization of integrate-and-collide! for the control-info used in target." (with-pp (stopwatch-start (the-as stopwatch (&-> *collide-stats* pad0 1))) ;; i think this code is just broken. @@ -1328,39 +1328,39 @@ it returns a triangle and normal direction to push in. ;; remember old before recomputing - this is how much we've cheated jak's collision geometry ;; position to account for movement in the animation frame. - (set! (-> obj old-anim-collide-offset-world quad) (-> obj anim-collide-offset-world quad)) + (set! (-> this old-anim-collide-offset-world quad) (-> this anim-collide-offset-world quad)) ;; transform this frame's anim offset to world (vector-matrix*! - (-> obj anim-collide-offset-world) - (-> obj anim-collide-offset-local) - (-> obj ctrl-orientation) + (-> this anim-collide-offset-world) + (-> this anim-collide-offset-local) + (-> this ctrl-orientation) ) ;; compute how much the anim offset changed, in world frame, since last frame. (vector-! - (-> obj anim-collide-offset-delta-world) - (-> obj anim-collide-offset-world) - (-> obj old-anim-collide-offset-world) + (-> this anim-collide-offset-delta-world) + (-> this anim-collide-offset-world) + (-> this old-anim-collide-offset-world) ) ;; compute the total offset of drawing. The draw-offset is used for non-collision animation like the zoomer bobbing. ;; Note: we subtract off the anim offset here. This way, we can add the anim offset to jak's position later on, and ;; it will move the collision geometry without changing the drawing. (let ((total-offset - (vector-! (new 'stack-no-clear 'vector) (-> obj draw-offset) (-> obj anim-collide-offset-world)) + (vector-! (new 'stack-no-clear 'vector) (-> this draw-offset) (-> this anim-collide-offset-world)) ) ) ;; and also rate limit it to prevent huge jumps in jak's animation when exiting an anim early. ;; in theory, this should follow the blending of animations, but this likely good enough. - (vector-seek! (-> obj cspace-offset) total-offset (* 16384.0 (seconds-per-frame))) + (vector-seek! (-> this cspace-offset) total-offset (* 16384.0 (seconds-per-frame))) ) ;; compute the total extra velocity to add to collide. (let ((bonus-vel (vector+float*! (new-stack-vector0) - (-> obj collide-extra-velocity) ;; some other weird offset. - (-> obj anim-collide-offset-delta-world) + (-> this collide-extra-velocity) ;; some other weird offset. + (-> this anim-collide-offset-delta-world) 60.0 ) ) @@ -1371,17 +1371,17 @@ it returns a triangle and normal direction to push in. ;; position, then overwriting the old velocity. ;; this is like trying to move the collision geometry, but if we hit something, don't go boucing off the ceiling. (when (< 0.0 (vector-length bonus-vel)) - (let ((old-iter-cnt (-> obj max-iteration-count)) + (let ((old-iter-cnt (-> this max-iteration-count)) (old-in-vel (new 'stack-no-clear 'vector)) ) (set! (-> old-in-vel quad) (-> arg0 quad)) - (let ((old-stat-flg (-> obj status))) + (let ((old-stat-flg (-> this status))) (let ((t9-4 (method-of-type collide-shape-moving integrate-and-collide!))) - (t9-4 obj bonus-vel) + (t9-4 this bonus-vel) ) - (set! (-> obj max-iteration-count) old-iter-cnt) + (set! (-> this max-iteration-count) old-iter-cnt) (set! (-> arg0 quad) (-> old-in-vel quad)) ;; set it back. - (logior! (-> obj status) old-stat-flg) + (logior! (-> this status) old-stat-flg) ) ) ) @@ -1394,7 +1394,7 @@ it returns a triangle and normal direction to push in. (set! (-> before-regular-vel quad) (-> arg0 quad)) ;; run collision! (let ((t9-5 (method-of-type collide-shape-moving integrate-and-collide!))) - (t9-5 obj regular-vel) + (t9-5 this regular-vel) ) ;; b1 and a1 are before and after velocities @@ -1406,10 +1406,10 @@ it returns a triangle and normal direction to push in. ;; this code allows the weighting of normal and parallel to gravity components, but ;; both are set up to just get normal to gravity. (let ((b1-nrm-to-grav (new-stack-vector0))) - (let ((f0-6 (vector-dot (-> obj dynam gravity-normal) b1))) + (let ((f0-6 (vector-dot (-> this dynam gravity-normal) b1))) 0.0 ;; subtract off the stuff in the direction of gravity. - (vector-! b1-nrm-to-grav b1 (vector-float*! b1-nrm-to-grav (-> obj dynam gravity-normal) f0-6)) + (vector-! b1-nrm-to-grav b1 (vector-float*! b1-nrm-to-grav (-> this dynam gravity-normal) f0-6)) ) (let* ((b1-nrm-to-grav-vel (vector-length b1-nrm-to-grav)) (f1-4 b1-nrm-to-grav-vel) ;; * 1.0 probably @@ -1417,15 +1417,15 @@ it returns a triangle and normal direction to push in. ) (vector+! b1 - (vector-float*! b1 (-> obj dynam gravity-normal) f2-0) ;; 0 + (vector-float*! b1 (-> this dynam gravity-normal) f2-0) ;; 0 (vector-float*! b1-nrm-to-grav b1-nrm-to-grav (/ b1-nrm-to-grav-vel f1-4)) ;; just normal grav ) ) ) (let ((v1-33 (new-stack-vector0))) - (let ((f0-10 (vector-dot (-> obj dynam gravity-normal) a1))) + (let ((f0-10 (vector-dot (-> this dynam gravity-normal) a1))) 0.0 - (vector-! v1-33 a1 (vector-float*! v1-33 (-> obj dynam gravity-normal) f0-10)) + (vector-! v1-33 a1 (vector-float*! v1-33 (-> this dynam gravity-normal) f0-10)) ) (let* ((f0-11 (vector-length v1-33)) (f1-6 f0-11) @@ -1433,7 +1433,7 @@ it returns a triangle and normal direction to push in. ) (vector+! a1 - (vector-float*! a1 (-> obj dynam gravity-normal) f2-1) + (vector-float*! a1 (-> this dynam gravity-normal) f2-1) (vector-float*! v1-33 v1-33 (/ f0-11 f1-6)) ) ) @@ -1449,31 +1449,31 @@ it returns a triangle and normal direction to push in. ;; the more blocked you are. (let ((ba-dot (vector-dot b1 a1))) (cond - ((and (!= (vector-length (-> obj target-transv)) 0.0) ;; standing still at wall doesn't count - (if (logtest? (-> obj status) (collide-status touch-wall)) ;; make it easier to hit blocked if touching wall. + ((and (!= (vector-length (-> this target-transv)) 0.0) ;; standing still at wall doesn't count + (if (logtest? (-> this status) (collide-status touch-wall)) ;; make it easier to hit blocked if touching wall. (< ba-dot 0.9999) (< ba-dot 0.95) ) ) ;; increase a blocked counter. - (seek! (-> obj blocked-factor) 1.0 (* 4.0 (seconds-per-frame))) + (seek! (-> this blocked-factor) 1.0 (* 4.0 (seconds-per-frame))) ;; and a "air block" counter. (seek! - (-> obj blocked-in-air-factor) - (if (= (-> obj mod-surface mode) 'air) + (-> this blocked-in-air-factor) + (if (= (-> this mod-surface mode) 'air) 1.0 0.0 ) (* 4.0 (seconds-per-frame)) ) ;; set block flag. - (logior! (-> obj status) (collide-status blocked)) + (logior! (-> this status) (collide-status blocked)) ) (else ;; not blocked, wind down counters. - (seek! (-> obj blocked-factor) 0.0 (* 2.0 (seconds-per-frame))) - (seek! (-> obj blocked-in-air-factor) 0.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this blocked-factor) 0.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this blocked-in-air-factor) 0.0 (* 2.0 (seconds-per-frame))) ) ) ) @@ -1485,23 +1485,23 @@ it returns a triangle and normal direction to push in. ;; update btransv. this is suppposed to be the last good velocity before becoming blocked, or something like that. ;; this is only increased in this function, and some other code clamps it to be no larger than your joystick command. ;; so you can increase it by actually travelling at speed, and can decrease it by letting off the joystick. - (if (and (logtest? (-> obj status) (collide-status on-surface)) ;; only update if we're on a surface - (and (not (logtest? (-> obj status) (collide-status touch-wall blocked))) ;; and not blocked - (< (vector-length (-> obj btransv)) (vector-length before-regular-vel)) ;; and faster than current btransv. + (if (and (logtest? (-> this status) (collide-status on-surface)) ;; only update if we're on a surface + (and (not (logtest? (-> this status) (collide-status touch-wall blocked))) ;; and not blocked + (< (vector-length (-> this btransv)) (vector-length before-regular-vel)) ;; and faster than current btransv. ) ) - (set! (-> obj btransv quad) (-> before-regular-vel quad)) + (set! (-> this btransv quad) (-> before-regular-vel quad)) ) ) ) ;; see how our velocity after collision compares to the velocity we got after aligning. - (let ((align-xz-dir (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj align-xz-vel) 1.0)) - (align-xz-speed (vector-length (-> obj align-xz-vel))) + (let ((align-xz-dir (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this align-xz-vel) 1.0)) + (align-xz-speed (vector-length (-> this align-xz-vel))) ) - (set! (-> obj zx-vel-frac) (if (= align-xz-speed 0.0) + (set! (-> this zx-vel-frac) (if (= align-xz-speed 0.0) 0.0 - (fmax 0.0 (/ (vector-dot (-> obj transv) align-xz-dir) align-xz-speed)) + (fmax 0.0 (/ (vector-dot (-> this transv) align-xz-dir) align-xz-speed)) ) ) ) @@ -1511,7 +1511,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod try-snap-to-surface collide-shape-moving ((obj collide-shape-moving) (vel vector) (check-dist float) (amt float) (bounce-dist float)) +(defmethod try-snap-to-surface collide-shape-moving ((this collide-shape-moving) (vel vector) (check-dist float) (amt float) (bounce-dist float)) "Strange function to try to find a surface and move to it. Teleports a distance of check-dist, then moves back to the start point plus amt. If this move hits something, moves to that surface, then an additional bounce-dist. @@ -1528,12 +1528,12 @@ it returns a triangle and normal direction to push in. (collide-vel (new 'stack-no-clear 'vector)) ) ;; remember where we started - (set! (-> initial-trans quad) (-> obj trans quad)) + (set! (-> initial-trans quad) (-> this trans quad)) ;; move the check-dist (teleporting) - (vector-normalize-copy! (-> obj trans) vel check-dist) - (vector+! (-> obj trans) (-> obj trans) initial-trans) + (vector-normalize-copy! (-> this trans) vel check-dist) + (vector+! (-> this trans) (-> this trans) initial-trans) ;; update for the start position - (update-transforms obj) + (update-transforms this) ;; compute vel to make it back (plus amt) (vector-normalize-copy! collide-vel vel (- amt check-dist)) (let ((v1-4 collide-vel)) @@ -1547,8 +1547,8 @@ it returns a triangle and normal direction to push in. (.svf (&-> v1-4 quad) vf1) ) ;; run collision. - (set! (-> obj prev-status) (-> obj status)) - (logclear! (-> obj status) (collide-status + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status on-surface on-ground touch-surface @@ -1565,16 +1565,16 @@ it returns a triangle and normal direction to push in. glance ) ) - (when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset))) - (let ((v1-13 (-> obj dynam gravity-normal))) - (set! (-> obj local-normal quad) (-> v1-13 quad)) - (set! (-> obj surface-normal quad) (-> v1-13 quad)) - (set! (-> obj poly-normal quad) (-> v1-13 quad)) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) ) - (set! (-> obj coverage) 0.0) - (set! (-> obj touch-angle) 0.0) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) ) - (let ((f30-0 (step-collison! obj collide-vel collide-vel 1.0 0))) ;; just one step. + (let ((f30-0 (step-collison! this collide-vel collide-vel 1.0 0))) ;; just one step. (update-from-step-size *touching-list* f30-0) ;; update touching list, so we hit things. (cond ((< f30-0 1.0) @@ -1583,18 +1583,18 @@ it returns a triangle and normal direction to push in. (s2-1 (new 'stack-no-clear 'vector)) ) (vector-normalize-copy! vel-dir vel 1.0) - (vector-! s2-1 (-> obj trans) initial-trans) + (vector-! s2-1 (-> this trans) initial-trans) (when (< (vector-dot vel-dir s2-1) bounce-dist) (vector-normalize-copy! s2-1 vel bounce-dist) (vector+! s2-1 s2-1 initial-trans) - (move-to-point! obj s2-1) + (move-to-point! this s2-1) ) ) #t ) (else ;; nope, revert to old position. - (move-to-point! obj initial-trans) + (move-to-point! this initial-trans) #f ) ) @@ -1604,31 +1604,31 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod fill-and-try-snap-to-surface collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 collide-query)) +(defmethod fill-and-try-snap-to-surface collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 collide-query)) "Fill the collision cache and try to snap to a nearby surface." (vector-normalize-copy! (-> arg4 start-pos) arg0 arg1) - (vector+! (-> arg4 start-pos) (-> arg4 start-pos) (-> obj trans)) + (vector+! (-> arg4 start-pos) (-> arg4 start-pos) (-> this trans)) (vector-normalize-copy! (-> arg4 move-dist) arg0 (- arg2 arg1)) (fill-using-line-sphere *collide-cache* arg4) - (try-snap-to-surface obj arg0 arg1 arg2 arg3) + (try-snap-to-surface this arg0 arg1 arg2 arg3) ) -(defmethod move-to-ground-point collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod move-to-ground-point collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) "Move to point, and treat as ground." - (move-to-point! obj arg0) + (move-to-point! this arg0) (set! (-> arg1 y) 0.0) - (set! (-> obj grount-touch-point quad) (-> arg0 quad)) - (set! (-> obj poly-normal quad) (-> arg2 quad)) - (set! (-> obj surface-normal quad) (-> arg2 quad)) - (set! (-> obj local-normal quad) (-> arg2 quad)) - (set! (-> obj ground-poly-normal quad) (-> arg2 quad)) - (logior! (-> obj status) (collide-status on-surface on-ground touch-surface)) - (set! (-> obj ground-impact-vel) (- (vector-dot arg1 (-> obj dynam gravity-normal)))) + (set! (-> this grount-touch-point quad) (-> arg0 quad)) + (set! (-> this poly-normal quad) (-> arg2 quad)) + (set! (-> this surface-normal quad) (-> arg2 quad)) + (set! (-> this local-normal quad) (-> arg2 quad)) + (set! (-> this ground-poly-normal quad) (-> arg2 quad)) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) + (set! (-> this ground-impact-vel) (- (vector-dot arg1 (-> this dynam gravity-normal)))) 0 (none) ) -(defmethod integrate-no-collide! collide-shape-moving ((obj collide-shape-moving) (arg0 vector)) +(defmethod integrate-no-collide! collide-shape-moving ((this collide-shape-moving) (arg0 vector)) "Move, ignoring all collision." (local-vars (at-0 int)) (rlet ((vf0 :class vf) @@ -1636,12 +1636,12 @@ it returns a triangle and normal direction to push in. (vf2 :class vf) ) (init-vf0-vector) - (update-transforms obj) - (set! (-> obj trans-old-old-old quad) (-> obj trans-old-old quad)) - (set! (-> obj trans-old-old quad) (-> obj trans-old quad)) - (set! (-> obj trans-old quad) (-> obj trans quad)) - (set! (-> obj prev-status) (-> obj status)) - (logclear! (-> obj status) (collide-status + (update-transforms this) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status on-surface on-ground touch-surface @@ -1658,16 +1658,16 @@ it returns a triangle and normal direction to push in. glance ) ) - (when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset))) - (let ((v1-13 (-> obj dynam gravity-normal))) - (set! (-> obj local-normal quad) (-> v1-13 quad)) - (set! (-> obj surface-normal quad) (-> v1-13 quad)) - (set! (-> obj poly-normal quad) (-> v1-13 quad)) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) ) - (set! (-> obj coverage) 0.0) - (set! (-> obj touch-angle) 0.0) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) ) - (let ((t9-1 (method-of-object obj move-by-vector!)) + (let ((t9-1 (method-of-object this move-by-vector!)) (a1-5 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> arg0 quad)) @@ -1678,30 +1678,30 @@ it returns a triangle and normal direction to push in. (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> a1-5 quad) vf1) - (t9-1 obj a1-5) + (t9-1 this a1-5) ) 0 (none) ) ) -(defmethod integrate-for-enemy-no-mtg collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 overlaps-others-params)) +(defmethod integrate-for-enemy-no-mtg collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 overlaps-others-params)) "Simpler move for enemy, with no moving to ground. Will just stop if the move collides." - (integrate-no-collide! obj arg0) - (let ((s5-1 (find-overlapping-shapes obj arg1))) + (integrate-no-collide! this arg0) + (let ((s5-1 (find-overlapping-shapes this arg1))) (if s5-1 ;; if we hit something, move back. - (move-to-point! obj (-> obj trans-old)) + (move-to-point! this (-> this trans-old)) ) s5-1 ) ) -(defmethod find-ground collide-shape-moving ((obj collide-shape-moving) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod find-ground collide-shape-moving ((this collide-shape-moving) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) "Find the ground, return #t if we found it, and fill out gspot in the collide-query." - (set! (-> obj gspot-pos quad) (-> obj trans quad)) - (set! (-> arg0 start-pos quad) (-> obj trans quad)) + (set! (-> this gspot-pos quad) (-> this trans quad)) + (set! (-> arg0 start-pos quad) (-> this trans quad)) (vector-reset! (-> arg0 move-dist)) - (let ((f0-0 (-> obj transv y))) + (let ((f0-0 (-> this transv y))) (if (< f0-0 0.0) (set! arg2 (- arg2 (fmax -40960.0 (* f0-0 (seconds-per-frame))))) ) @@ -1711,26 +1711,26 @@ it returns a triangle and normal direction to push in. (let ((v1-7 arg0)) (set! (-> v1-7 radius) arg4) (set! (-> v1-7 collide-with) arg1) - (set! (-> v1-7 ignore-process0) (-> obj process)) + (set! (-> v1-7 ignore-process0) (-> this process)) (set! (-> v1-7 ignore-process1) #f) - (set! (-> v1-7 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> obj pat-ignore-mask))) + (set! (-> v1-7 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> this pat-ignore-mask))) (set! (-> v1-7 action-mask) (collide-action solid)) ) (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* arg0) 0.0) - (set! (-> obj gspot-pos y) (-> arg0 best-other-tri intersect y)) - (set! (-> obj gspot-normal quad) (-> arg0 best-other-tri normal quad)) + (set! (-> this gspot-pos y) (-> arg0 best-other-tri intersect y)) + (set! (-> this gspot-normal quad) (-> arg0 best-other-tri normal quad)) #t ) (else - (set! (-> obj gspot-pos y) -40959590.0) - (set! (-> obj gspot-normal quad) (-> *y-vector* quad)) + (set! (-> this gspot-pos y) -40959590.0) + (set! (-> this gspot-normal quad) (-> *y-vector* quad)) #f ) ) ) -(defmethod above-ground? collide-shape ((obj collide-shape) +(defmethod above-ground? collide-shape ((this collide-shape) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) @@ -1745,72 +1745,72 @@ it returns a triangle and normal direction to push in. (let ((v1-2 arg0)) (set! (-> v1-2 radius) arg5) (set! (-> v1-2 collide-with) arg2) - (set! (-> v1-2 ignore-process0) (-> obj process)) + (set! (-> v1-2 ignore-process0) (-> this process)) (set! (-> v1-2 ignore-process1) #f) - (set! (-> v1-2 ignore-pat) (-> obj pat-ignore-mask)) + (set! (-> v1-2 ignore-pat) (-> this pat-ignore-mask)) (set! (-> v1-2 action-mask) (collide-action solid)) ) (>= (fill-and-probe-using-line-sphere *collide-cache* arg0) 0.0) ) -(defmethod move-above-ground collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 move-above-ground-params)) +(defmethod move-above-ground collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 move-above-ground-params)) "Move at the given velocity, while not going through the ground" (with-profiler 'collide *profile-collide-color* (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) - (set! (-> arg1 old-gspot-pos quad) (-> obj gspot-pos quad)) - (set! (-> arg1 old-gspot-normal quad) (-> obj gspot-normal quad)) - (set! (-> obj trans-old-old-old quad) (-> obj trans-old-old quad)) - (set! (-> obj trans-old-old quad) (-> obj trans-old quad)) - (set! (-> obj trans-old quad) (-> obj trans quad)) - (set! (-> obj prev-status) (-> obj status)) + (set! (-> arg1 old-gspot-pos quad) (-> this gspot-pos quad)) + (set! (-> arg1 old-gspot-normal quad) (-> this gspot-normal quad)) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) ;; move! note that we don't actually call move-to-point! yet - that's more ;; expensive, and we save it for when we actually know the final position. - (vector-v+! (-> obj trans) (-> obj trans) arg0) - (set! (-> arg1 new-pos quad) (-> obj trans quad)) + (vector-v+! (-> this trans) (-> this trans) arg0) + (set! (-> arg1 new-pos quad) (-> this trans quad)) ;; find the ground. (let ((s3-1 (new 'stack-no-clear 'collide-query))) (cond - ((find-ground obj s3-1 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0) - (when (>= (-> obj gspot-pos y) (-> arg1 new-pos y)) ;; check if we are at/below the ground + ((find-ground this s3-1 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0) + (when (>= (-> this gspot-pos y) (-> arg1 new-pos y)) ;; check if we are at/below the ground ;; we are (set! (-> arg1 on-ground?) #t) (set! (-> arg1 pat) (-> s3-1 best-other-tri pat)) ;; move to ground (set! (-> arg1 new-pos y) (-> s3-1 best-other-tri intersect y)) - (set! (-> obj ground-impact-vel) (- (vector-dot arg0 (-> obj dynam gravity-normal)))) + (set! (-> this ground-impact-vel) (- (vector-dot arg0 (-> this dynam gravity-normal)))) (set! (-> arg0 y) 0.0) ) ) (else ;; no ground. if hover is enabled, disable falling. (if (-> arg1 hover-if-no-ground?) - (set! (-> arg1 new-pos y) (-> obj trans-old y)) + (set! (-> arg1 new-pos y) (-> this trans-old y)) ) ) ) ) ;; do the (slightly) more expensive move - (set! (-> obj trans quad) (-> obj trans-old quad)) - (move-to-point! obj (-> arg1 new-pos)) + (set! (-> this trans quad) (-> this trans-old quad)) + (move-to-point! this (-> arg1 new-pos)) ;; see if the object should collide with foreground objects (when (logtest? (logand (-> arg1 overlaps-params collide-with-filter) (collide-spec hit-by-player-list hit-by-others-list player-list) ) - (-> obj root-prim prim-core collide-with) + (-> this root-prim prim-core collide-with) ) ;; if it does, see if we moved into overlap - (when (find-overlapping-shapes obj (-> arg1 overlaps-params)) + (when (find-overlapping-shapes this (-> arg1 overlaps-params)) (when (-> arg1 dont-move-if-overlaps?) ;; and abort the move. (set! (-> arg1 do-move?) #f) - (move-to-point! obj (-> obj trans-old)) - (set! (-> obj gspot-pos quad) (-> arg1 old-gspot-pos quad)) - (set! (-> obj gspot-normal quad) (-> arg1 old-gspot-normal quad)) + (move-to-point! this (-> this trans-old)) + (set! (-> this gspot-pos quad) (-> arg1 old-gspot-pos quad)) + (set! (-> this gspot-normal quad) (-> arg1 old-gspot-normal quad)) ) ) ) @@ -1819,23 +1819,23 @@ it returns a triangle and normal direction to push in. (when (-> arg1 do-move?) (cond ((-> arg1 on-ground?) - (let ((a1-8 (-> obj gspot-pos)) - (a0-29 (-> obj gspot-normal)) + (let ((a1-8 (-> this gspot-pos)) + (a0-29 (-> this gspot-normal)) (v1-59 (-> arg1 pat)) ) - (set! (-> obj grount-touch-point quad) (-> a1-8 quad)) - (set! (-> obj poly-normal quad) (-> a0-29 quad)) - (set! (-> obj surface-normal quad) (-> a0-29 quad)) - (set! (-> obj local-normal quad) (-> a0-29 quad)) - (set! (-> obj ground-poly-normal quad) (-> a0-29 quad)) - (set! (-> obj poly-pat) v1-59) - (set! (-> obj cur-pat) v1-59) - (set! (-> obj ground-pat) v1-59) + (set! (-> this grount-touch-point quad) (-> a1-8 quad)) + (set! (-> this poly-normal quad) (-> a0-29 quad)) + (set! (-> this surface-normal quad) (-> a0-29 quad)) + (set! (-> this local-normal quad) (-> a0-29 quad)) + (set! (-> this ground-poly-normal quad) (-> a0-29 quad)) + (set! (-> this poly-pat) v1-59) + (set! (-> this cur-pat) v1-59) + (set! (-> this ground-pat) v1-59) ) - (logior! (-> obj status) (collide-status on-surface on-ground touch-surface)) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) ) (else - (logclear! (-> obj status) (collide-status + (logclear! (-> this status) (collide-status on-surface on-ground touch-surface @@ -1852,14 +1852,14 @@ it returns a triangle and normal direction to push in. glance ) ) - (when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset))) - (let ((v1-69 (-> obj dynam gravity-normal))) - (set! (-> obj local-normal quad) (-> v1-69 quad)) - (set! (-> obj surface-normal quad) (-> v1-69 quad)) - (set! (-> obj poly-normal quad) (-> v1-69 quad)) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-69 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-69 quad)) + (set! (-> this surface-normal quad) (-> v1-69 quad)) + (set! (-> this poly-normal quad) (-> v1-69 quad)) ) - (set! (-> obj coverage) 0.0) - (set! (-> obj touch-angle) 0.0) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) ) ) ) @@ -1869,36 +1869,36 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod move-to-ground collide-shape-moving ((obj collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) +(defmethod move-to-ground collide-shape-moving ((this collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) "Find the ground a move to it." (local-vars (sv-576 profile-segment) (sv-592 int)) (with-profiler 'collide *profile-collide-color* (let ((s1-1 (new 'stack-no-clear 'collide-query))) (cond - ((find-ground obj s1-1 arg3 arg0 arg1 1024.0) + ((find-ground this s1-1 arg3 arg0 arg1 1024.0) (let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> obj trans quad)) + (set! (-> a1-4 quad) (-> this trans quad)) (set! (-> a1-4 y) (-> s1-1 best-other-tri intersect y)) - (move-to-point! obj a1-4) + (move-to-point! this a1-4) ) (let ((a1-5 (-> s1-1 best-other-tri intersect)) (a0-19 (-> s1-1 best-other-tri normal)) (v1-25 (-> s1-1 best-other-tri pat)) ) - (set! (-> obj grount-touch-point quad) (-> a1-5 quad)) - (set! (-> obj poly-normal quad) (-> a0-19 quad)) - (set! (-> obj surface-normal quad) (-> a0-19 quad)) - (set! (-> obj local-normal quad) (-> a0-19 quad)) - (set! (-> obj ground-poly-normal quad) (-> a0-19 quad)) - (set! (-> obj poly-pat) v1-25) - (set! (-> obj cur-pat) v1-25) - (set! (-> obj ground-pat) v1-25) + (set! (-> this grount-touch-point quad) (-> a1-5 quad)) + (set! (-> this poly-normal quad) (-> a0-19 quad)) + (set! (-> this surface-normal quad) (-> a0-19 quad)) + (set! (-> this local-normal quad) (-> a0-19 quad)) + (set! (-> this ground-poly-normal quad) (-> a0-19 quad)) + (set! (-> this poly-pat) v1-25) + (set! (-> this cur-pat) v1-25) + (set! (-> this ground-pat) v1-25) ) - (logior! (-> obj status) (collide-status on-surface on-ground touch-surface)) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) #t ) (else - (logclear! (-> obj status) (collide-status + (logclear! (-> this status) (collide-status on-surface on-ground touch-surface @@ -1915,17 +1915,17 @@ it returns a triangle and normal direction to push in. glance ) ) - (when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset))) - (let ((v1-36 (-> obj dynam gravity-normal))) - (set! (-> obj local-normal quad) (-> v1-36 quad)) - (set! (-> obj surface-normal quad) (-> v1-36 quad)) - (set! (-> obj poly-normal quad) (-> v1-36 quad)) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-36 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-36 quad)) + (set! (-> this surface-normal quad) (-> v1-36 quad)) + (set! (-> this poly-normal quad) (-> v1-36 quad)) ) - (set! (-> obj coverage) 0.0) - (set! (-> obj touch-angle) 0.0) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) ) (if arg2 - (format 0 "WARNING: move-to-ground: failed to locate ground for ~S!~%" (-> obj process name)) + (format 0 "WARNING: move-to-ground: failed to locate ground for ~S!~%" (-> this process name)) ) ) ) @@ -1934,14 +1934,14 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod compute-acc-due-to-gravity collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 float)) +(defmethod compute-acc-due-to-gravity collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 float)) "Adjust the velocity from the acceleration of gravity." - (let* ((s4-0 (vector-negate! (new 'stack-no-clear 'vector) (-> obj dynam gravity))) - (a2-1 (-> obj local-normal)) + (let* ((s4-0 (vector-negate! (new 'stack-no-clear 'vector) (-> this dynam gravity))) + (a2-1 (-> this local-normal)) (a2-2 (vector-reflect-flat! (new-stack-vector0) s4-0 a2-1)) ) (vector--float*! arg0 s4-0 a2-2 (cond - ((logtest? (-> obj status) (collide-status on-surface)) + ((logtest? (-> this status) (collide-status on-surface)) (empty) arg1 ) @@ -1954,7 +1954,7 @@ it returns a triangle and normal direction to push in. arg0 ) -(defmethod fill-cache-integrate-and-collide collide-shape ((obj collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters)) +(defmethod fill-cache-integrate-and-collide collide-shape ((this collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters)) "Helper to fill the collide cache and call integrate-and-collide." (local-vars (at-0 int)) (rlet ((vf0 :class vf) @@ -1975,20 +1975,20 @@ it returns a triangle and normal direction to push in. (.svf (&-> a0-1 quad) vf1) ) ;; fill the cache. - (fill-cache-for-shape obj (+ (vector-length v1-0) arg2) arg1) + (fill-cache-for-shape this (+ (vector-length v1-0) arg2) arg1) ) ;; move. - (integrate-and-collide! obj arg0) + (integrate-and-collide! this arg0) (none) ) ) -(defmethod fill-cache-for-shape collide-shape ((obj collide-shape) (arg0 float) (arg1 collide-query)) +(defmethod fill-cache-for-shape collide-shape ((this collide-shape) (arg0 float) (arg1 collide-query)) "Fill the collide cache for a collide-shape by buliding a bounding box and filling from that." (cond - ((build-bounding-box-for-shape obj (-> arg1 bbox) arg0 (-> arg1 collide-with)) + ((build-bounding-box-for-shape this (-> arg1 bbox) arg0 (-> arg1 collide-with)) (fill-using-bounding-box *collide-cache* arg1) - (if (and *display-collide-cache* (or (= (-> obj process type) target) (= (-> obj process) *debug-actor*))) + (if (and *display-collide-cache* (or (= (-> this process type) target) (= (-> this process) *debug-actor*))) (debug-draw *collide-cache*) ) ) @@ -2000,7 +2000,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod build-bounding-box-for-shape collide-shape ((obj collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-spec)) +(defmethod build-bounding-box-for-shape collide-shape ((this collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-spec)) (rlet ((vf0 :class vf) (vf24 :class vf) (vf25 :class vf) @@ -2013,7 +2013,7 @@ it returns a triangle and normal direction to push in. ) (init-vf0-vector) (let ((t0-0 (new 'static 'vector :x 4.096)) - (v1-0 (-> obj root-prim)) + (v1-0 (-> this root-prim)) ) (.mov vf31 arg1) (let ((a0-2 (logand (-> v1-0 prim-core collide-with) arg2)) @@ -2065,9 +2065,9 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod find-prim-by-id collide-shape ((obj collide-shape) (arg0 uint)) - (let ((v1-0 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) +(defmethod find-prim-by-id collide-shape ((this collide-shape) (arg0 uint)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (if (= (-> v1-0 prim-id) arg0) (return v1-0) ) @@ -2077,9 +2077,9 @@ it returns a triangle and normal direction to push in. (the-as collide-shape-prim #f) ) -(defmethod find-prim-by-id-logtest collide-shape ((obj collide-shape) (arg0 uint)) - (let ((v1-0 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) +(defmethod find-prim-by-id-logtest collide-shape ((this collide-shape) (arg0 uint)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (if (logtest? (-> v1-0 prim-id) arg0) (return v1-0) ) @@ -2156,9 +2156,9 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod debug-draw collide-shape ((obj collide-shape)) - (if (sphere-in-view-frustum? (the-as sphere (-> obj root-prim prim-core))) - (debug-draw (-> obj root-prim)) +(defmethod debug-draw collide-shape ((this collide-shape)) + (if (sphere-in-view-frustum? (the-as sphere (-> this root-prim prim-core))) + (debug-draw (-> this root-prim)) ) 0 (none) @@ -2182,7 +2182,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod update-transforms collide-shape ((obj collide-shape)) +(defmethod update-transforms collide-shape ((this collide-shape)) "Update collisision transforms." (local-vars (v1-8 float) (a1-5 float) (a1-7 float)) (rlet ((acc :class vf) @@ -2195,12 +2195,12 @@ it returns a triangle and normal direction to push in. (vf5 :class vf) ) (init-vf0-vector) - (let ((s5-0 (-> obj root-prim)) - (v1-1 (-> obj process node-list)) + (let ((s5-0 (-> this root-prim)) + (v1-1 (-> this process node-list)) ) (cond ((nonzero? v1-1) ;; using cspace stuff - (countdown (a0-1 (-> obj total-prims)) + (countdown (a0-1 (-> this total-prims)) (let ((a1-0 (-> s5-0 transform-index))) (cond ((>= a1-0 0) @@ -2225,7 +2225,7 @@ it returns a triangle and normal direction to push in. ;; -2 is magic and tied to the root trans, skip cspace math. (when (= a1-0 -2) (.lvf vf1 (&-> s5-0 local-sphere quad)) - (.lvf vf2 (&-> obj trans quad)) + (.lvf vf2 (&-> this trans quad)) (.add.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> s5-0 prim-core world-sphere quad) vf1) (.mov a1-7 vf1) @@ -2238,20 +2238,20 @@ it returns a triangle and normal direction to push in. ) (else ;; special cases for non-cspace users. - (countdown (s4-0 (-> obj total-prims)) + (countdown (s4-0 (-> this total-prims)) (case (-> s5-0 transform-index) ((-3) ;; rotate and translate from root pos/orientation (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-orient-by-quat! s3-0 (-> s5-0 local-sphere) (-> obj quat)) - (vector+! (the-as vector (-> s5-0 prim-core)) s3-0 (-> obj trans)) + (vector-orient-by-quat! s3-0 (-> s5-0 local-sphere) (-> this quat)) + (vector+! (the-as vector (-> s5-0 prim-core)) s3-0 (-> this trans)) ) (set! (-> s5-0 prim-core world-sphere w) (-> s5-0 local-sphere w)) ) ((-2) ;; just translate. (.lvf vf1 (&-> s5-0 local-sphere quad)) - (.lvf vf2 (&-> obj trans quad)) + (.lvf vf2 (&-> this trans quad)) (.add.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> s5-0 prim-core world-sphere quad) vf1) (.mov v1-8 vf1) @@ -2267,11 +2267,11 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod move-by-vector! collide-shape ((obj collide-shape) (arg0 vector)) +(defmethod move-by-vector! collide-shape ((this collide-shape) (arg0 vector)) "Move everything by a vector." - (vector+! (-> obj trans) (-> obj trans) arg0) - (let ((v1-1 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) + (vector+! (-> this trans) (-> this trans) arg0) + (let ((v1-1 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (vector+! (the-as vector (-> v1-1 prim-core)) (the-as vector (-> v1-1 prim-core)) arg0) (set! (-> v1-1 prim-core world-sphere w) (-> v1-1 local-sphere w)) (&+! v1-1 80) @@ -2281,13 +2281,13 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod move-to-point! collide-shape ((obj collide-shape) (arg0 vector)) +(defmethod move-to-point! collide-shape ((this collide-shape) (arg0 vector)) "Move root to a point." (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj trans)) - (set! (-> obj trans quad) (-> arg0 quad)) - (let ((a1-2 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) + (vector-! v1-0 arg0 (-> this trans)) + (set! (-> this trans quad) (-> arg0 quad)) + (let ((a1-2 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (vector+! (the-as vector (-> a1-2 prim-core)) (the-as vector (-> a1-2 prim-core)) v1-0) (set! (-> a1-2 prim-core world-sphere w) (-> a1-2 local-sphere w)) (&+! a1-2 80) @@ -2298,10 +2298,10 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod set-collide-with! collide-shape ((obj collide-shape) (arg0 collide-spec)) +(defmethod set-collide-with! collide-shape ((this collide-shape) (arg0 collide-spec)) "Set the collide with field of everything." - (let ((v1-0 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (set! (-> v1-0 prim-core collide-with) arg0) (nop!) (nop!) @@ -2312,10 +2312,10 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod set-collide-as! collide-shape ((obj collide-shape) (arg0 collide-spec)) +(defmethod set-collide-as! collide-shape ((this collide-shape) (arg0 collide-spec)) "Set the collide as field of everything" - (let ((v1-0 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (set! (-> v1-0 prim-core collide-as) arg0) (nop!) (nop!) @@ -2326,10 +2326,10 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod iterate-prims collide-shape ((obj collide-shape) (arg0 (function collide-shape-prim none))) +(defmethod iterate-prims collide-shape ((this collide-shape) (arg0 (function collide-shape-prim none))) "Call the given function for each prim." - (let ((s5-0 (-> obj root-prim))) - (countdown (s4-0 (-> obj total-prims)) + (let ((s5-0 (-> this root-prim))) + (countdown (s4-0 (-> this total-prims)) (arg0 s5-0) (&+! s5-0 80) ) @@ -2338,11 +2338,11 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod find-collision-meshes collide-shape ((obj collide-shape)) +(defmethod find-collision-meshes collide-shape ((this collide-shape)) "Find collision meshes for our collide prims. The collide shape system is built in code, so this function should be called to actually find the matching meshes." - (let ((s5-0 (-> obj root-prim)) + (let ((s5-0 (-> this root-prim)) (s4-0 0) ) (case (-> s5-0 prim-core prim-type) @@ -2356,7 +2356,7 @@ it returns a triangle and normal direction to push in. ) (when (nonzero? s4-0) (let ((s3-0 0)) - (let ((v1-7 (-> obj process draw)) + (let ((v1-7 (-> this process draw)) (s2-0 (the-as (array collide-mesh) #f)) ) (when (and (nonzero? v1-7) (-> v1-7 jgeo)) @@ -2392,39 +2392,39 @@ it returns a triangle and normal direction to push in. ) ) (if (nonzero? s3-0) - (format 0 "ERROR: Failed to find collision meshes for ~D prim(s) in ~A!~%" s3-0 (-> obj process name)) + (format 0 "ERROR: Failed to find collision meshes for ~D prim(s) in ~A!~%" s3-0 (-> this process name)) ) ) ) ) - (update-transforms obj) + (update-transforms this) 0 (none) ) -(defmethod debug-draw collide-shape-prim ((obj collide-shape-prim)) +(defmethod debug-draw collide-shape-prim ((this collide-shape-prim)) (add-debug-sphere #t (bucket-id debug2) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40) ) 0 (none) ) -(defmethod debug-draw collide-shape-prim-sphere ((obj collide-shape-prim-sphere)) +(defmethod debug-draw collide-shape-prim-sphere ((this collide-shape-prim-sphere)) (add-debug-sphere #t (bucket-id debug2) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) (cond - ((and (zero? (-> obj prim-core collide-as)) (zero? (-> obj prim-core collide-with))) + ((and (zero? (-> this prim-core collide-as)) (zero? (-> this prim-core collide-with))) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40) ) - ((logtest? (-> obj prim-core action) (collide-action solid)) + ((logtest? (-> this prim-core action) (collide-action solid)) (new 'static 'rgba :r #xff :g #xff :a #x40) ) (else @@ -2436,28 +2436,28 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod debug-draw collide-shape-prim-mesh ((obj collide-shape-prim-mesh)) +(defmethod debug-draw collide-shape-prim-mesh ((this collide-shape-prim-mesh)) (add-debug-sphere #t (bucket-id debug2) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) (new 'static 'rgba :b #xff :a #x40) ) 0 (none) ) -(defmethod debug-draw collide-shape-prim-group ((obj collide-shape-prim-group)) +(defmethod debug-draw collide-shape-prim-group ((this collide-shape-prim-group)) (add-debug-sphere #t (bucket-id debug2) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) (new 'static 'rgba :g #xff :a #x10) ) - (countdown (s5-0 (the-as uint (-> obj num-children))) - (debug-draw (-> obj child s5-0)) + (countdown (s5-0 (the-as uint (-> this num-children))) + (debug-draw (-> this child s5-0)) ) 0 (none) @@ -2472,7 +2472,7 @@ it returns a triangle and normal direction to push in. ) ) -(defmethod do-push-aways collide-shape ((obj collide-shape)) +(defmethod do-push-aways collide-shape ((this collide-shape)) "Push away things." (local-vars (at-0 int) (v1-55 int) (a2-5 float) (a2-12 float)) (with-pp @@ -2486,13 +2486,13 @@ it returns a triangle and normal direction to push in. (init-vf0-vector) (let ((gp-0 (new 'stack-no-clear 'do-push-aways-work))) (set! (-> gp-0 cspec) (collide-spec)) - (let ((s4-0 (-> obj root-prim prim-core collide-with))) + (let ((s4-0 (-> this root-prim prim-core collide-with))) ;; first, we build the actor list. hit-by-others now uses spatial hash. (set! *actor-list-length* 0) (if (logtest? s4-0 (collide-spec hit-by-others-list)) (set! *actor-list-length* - (fill-actor-list-for-sphere *actor-hash* (the-as sphere (-> obj root-prim prim-core)) *actor-list* 256) + (fill-actor-list-for-sphere *actor-hash* (the-as sphere (-> this root-prim prim-core)) *actor-list* 256) ) ) @@ -2508,7 +2508,7 @@ it returns a triangle and normal direction to push in. (when (logtest? s4-0 (-> a1-1 prim-core collide-as)) (let ((a1-2 (-> a1-1 prim-core))) (let ((a2-4 a1-2) - (a3-2 (-> obj root-prim prim-core)) + (a3-2 (-> this root-prim prim-core)) ) (.lvf vf2 (&-> a2-4 world-sphere quad)) (.lvf vf3 (&-> a3-2 world-sphere quad)) @@ -2519,7 +2519,7 @@ it returns a triangle and normal direction to push in. (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-5 vf1) (let ((f0-0 a2-5) - (f1-1 (+ (-> a1-2 world-sphere w) (-> obj root-prim prim-core world-sphere w))) + (f1-1 (+ (-> a1-2 world-sphere w) (-> this root-prim prim-core world-sphere w))) ) (when (< f0-0 (* f1-1 f1-1)) (when (< *actor-list-length* 256) @@ -2551,7 +2551,7 @@ it returns a triangle and normal direction to push in. (when (logtest? s4-0 (-> a1-14 prim-core collide-as)) (let ((a1-15 (-> a1-14 prim-core))) (let ((a2-11 a1-15) - (a3-4 (-> obj root-prim prim-core)) + (a3-4 (-> this root-prim prim-core)) ) (.lvf vf2 (&-> a2-11 world-sphere quad)) (.lvf vf3 (&-> a3-4 world-sphere quad)) @@ -2562,7 +2562,7 @@ it returns a triangle and normal direction to push in. (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-12 vf1) (let ((f0-1 a2-12) - (f1-5 (+ (-> a1-15 world-sphere w) (-> obj root-prim prim-core world-sphere w))) + (f1-5 (+ (-> a1-15 world-sphere w) (-> this root-prim prim-core world-sphere w))) ) (when (< f0-1 (* f1-5 f1-5)) (when (< *actor-list-length* 256) @@ -2588,9 +2588,9 @@ it returns a triangle and normal direction to push in. (s2-0 (-> s1-0 root-prim)) ) (when (logtest? s4-0 (-> s2-0 prim-core collide-as)) - (when (!= (-> obj process) (-> s1-0 process)) + (when (!= (-> this process) (-> s1-0 process)) ;; do the test - (when (and (should-push-away obj s1-0 (-> gp-0 cquery)) (>= -81.92 (-> gp-0 cquery best-dist))) + (when (and (should-push-away this s1-0 (-> gp-0 cquery)) (>= -81.92 (-> gp-0 cquery best-dist))) (set! (-> gp-0 cquery collide-with) (-> s1-0 root-prim prim-core collide-with)) (set! (-> gp-0 cquery ignore-process0) (-> s1-0 process)) (set! (-> gp-0 cquery ignore-process1) #f) @@ -2600,7 +2600,7 @@ it returns a triangle and normal direction to push in. ;; push away (fill-cache-for-shape s1-0 8192.0 (-> gp-0 cquery)) (let ((s4-1 3)) - (until (or (<= s4-1 0) (not (should-push-away obj s1-0 (-> gp-0 cquery)))) + (until (or (<= s4-1 0) (not (should-push-away this s1-0 (-> gp-0 cquery)))) (set! (-> gp-0 vec33 quad) (-> s1-0 trans quad)) (let* ((f0-4 (+ 2867.2 (-> gp-0 vec33 y))) (f2-2 (+ 5734.4 f0-4)) @@ -2649,7 +2649,7 @@ it returns a triangle and normal direction to push in. (logior! (-> gp-0 cspec) (-> s2-0 prim-core collide-as)) ) ) - (set! s4-0 (-> obj root-prim prim-core collide-with)) + (set! s4-0 (-> this root-prim prim-core collide-with)) ) ) ) @@ -2664,7 +2664,7 @@ it returns a triangle and normal direction to push in. ;; definition for method 40 of type collide-shape ;; WARN: Return type mismatch object vs symbol. -(defmethod find-overlapping-shapes collide-shape ((obj collide-shape) (arg0 overlaps-others-params)) +(defmethod find-overlapping-shapes collide-shape ((this collide-shape) (arg0 overlaps-others-params)) (local-vars (a0-10 float) (a0-14 uint) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2675,7 +2675,7 @@ it returns a triangle and normal direction to push in. ) (init-vf0-vector) (let ((gp-0 (the-as object #f))) - (let* ((s3-0 (-> obj root-prim)) + (let* ((s3-0 (-> this root-prim)) (s2-0 (the-as uint (logand (-> s3-0 prim-core collide-with) (-> arg0 collide-with-filter)))) ) (set! (-> arg0 filtered-root-collide-with) (the-as collide-spec s2-0)) @@ -2785,7 +2785,7 @@ it returns a triangle and normal direction to push in. (.sub.w.vf vf3 vf3 vf4 :mask #b1000) (let ((f0-2 0.0)) (.add.w.vf vf3 vf0 vf3 :mask #b1) - (let ((v1-28 (-> obj process))) + (let ((v1-28 (-> this process))) (.mov a0-10 vf3) (let ((a1-26 (-> s0-0 process))) (b! (< f0-2 a0-10) cfg-28) @@ -2799,7 +2799,7 @@ it returns a triangle and normal direction to push in. ) ) (let ((a0-12 (-> (the-as (pointer uint64) arg0) 0)) - (v1-31 (-> obj penetrate-using)) + (v1-31 (-> this penetrate-using)) ) (b! (not (logtest? a0-12 4)) cfg-27 :delay (set! a0-14 (the-as uint (-> arg0 tlist)))) (b! (logtest? (-> s0-0 penetrated-by) v1-31) cfg-28 :delay (nop!)) @@ -2825,14 +2825,14 @@ it returns a triangle and normal direction to push in. ) ;; definition for method 12 of type collide-shape-prim -(defmethod overlaps-others-test collide-shape-prim ((obj collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test collide-shape-prim ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (format 0 "ERROR: Unsupported call to collide-shape-prim::overlaps-others-test!~%") #f ) ;; definition for method 12 of type collide-shape-prim-group ;; WARN: Return type mismatch object vs symbol. -(defmethod overlaps-others-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (a0-3 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2842,13 +2842,13 @@ it returns a triangle and normal direction to push in. (vf4 :class vf) ) (init-vf0-vector) - (let ((s4-0 (the-as collide-shape-prim obj)) + (let ((s4-0 (the-as collide-shape-prim this)) (v1-0 (-> arg1 prim-core collide-as)) (s2-0 (the-as object #f)) ) (let ((a1-1 (-> arg0 collide-with-filter))) (nop!) - (let ((s3-0 (the-as uint (-> obj num-children))) + (let ((s3-0 (the-as uint (-> this num-children))) (v1-1 (logand v1-0 a1-1)) ) (.lvf vf1 (&-> arg1 prim-core world-sphere quad)) @@ -2891,7 +2891,7 @@ it returns a triangle and normal direction to push in. ;; definition for method 13 of type collide-shape-prim ;; WARN: Return type mismatch object vs symbol. -(defmethod overlaps-others-group collide-shape-prim ((obj collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) +(defmethod overlaps-others-group collide-shape-prim ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) (local-vars (a0-4 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2902,7 +2902,7 @@ it returns a triangle and normal direction to push in. ) (init-vf0-vector) (let ((s4-0 (the-as collide-shape-prim arg1)) - (v1-0 (-> obj prim-core collide-with)) + (v1-0 (-> this prim-core collide-with)) ) (nop!) (let ((a0-1 (-> arg0 collide-with-filter))) @@ -2910,7 +2910,7 @@ it returns a triangle and normal direction to push in. (let ((s3-0 (the-as uint (-> arg1 num-children))) (v1-1 (logand v1-0 a0-1)) ) - (.lvf vf2 (&-> obj prim-core world-sphere quad)) + (.lvf vf2 (&-> this prim-core world-sphere quad)) (let ((s2-0 (the-as object #f))) (set! (-> arg0 filtered-child-collide-with) v1-1) (label cfg-1) @@ -2932,9 +2932,9 @@ it returns a triangle and normal direction to push in. (.mov a0-4 vf3) (b! (< f0-0 a0-4) cfg-1) ) - (let ((a0-6 (overlaps-others-test obj arg0 s4-0))) + (let ((a0-6 (overlaps-others-test this arg0 s4-0))) (set! v1-1 (-> arg0 filtered-child-collide-with)) - (b! (= a0-6 #f) cfg-1 :delay (.lvf vf2 (&-> obj prim-core world-sphere quad))) + (b! (= a0-6 #f) cfg-1 :delay (.lvf vf2 (&-> this prim-core world-sphere quad))) ) (b! (!= (-> arg0 tlist) #f) cfg-1 :delay (set! s2-0 0)) (label cfg-6) @@ -2950,11 +2950,11 @@ it returns a triangle and normal direction to push in. ) ;; definition for method 12 of type collide-shape-prim-sphere -(defmethod overlaps-others-test collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (v1-11 uint) (s4-0 uint)) (let ((v1-0 (-> arg1 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) - (let ((v0-1 (overlaps-others-group obj arg0 (the-as collide-shape-prim-group arg1)))) + (let ((v0-1 (overlaps-others-group this arg0 (the-as collide-shape-prim-group arg1)))) (b! #t cfg-17 :delay (nop!)) (label cfg-2) (b! (> (the-as int v1-0) 0) cfg-4 :delay (nop!)) @@ -2965,7 +2965,7 @@ it returns a triangle and normal direction to push in. (b! (not s2-0) cfg-10 :delay (empty-form)) (let ((v1-5 (populate-for-prim-mesh *collide-mesh-cache* (the-as collide-shape-prim-mesh arg1)))) (when v1-5 - (when (overlap-test s2-0 (the-as collide-mesh-cache-tri (-> v1-5 tris)) (the-as vector (-> obj prim-core))) + (when (overlap-test s2-0 (the-as collide-mesh-cache-tri (-> v1-5 tris)) (the-as vector (-> this prim-core))) (b! #t cfg-11 :delay (nop!)) (the-as none 0) ) @@ -2978,10 +2978,10 @@ it returns a triangle and normal direction to push in. (label cfg-11) (let ((a0-8 (-> arg0 tlist))) (b! (= a0-8 #f) cfg-13 :delay (nop!)) - (add-touching-prims a0-8 obj arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + (add-touching-prims a0-8 this arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) ) (label cfg-13) - (b! (not (logtest? s4-0 1)) cfg-16 :delay (set! v1-11 (the-as uint (-> obj prim-core action)))) + (b! (not (logtest? s4-0 1)) cfg-16 :delay (set! v1-11 (the-as uint (-> this prim-core action)))) (let ((a0-9 (-> arg1 prim-core action))) (b! (logtest? (the-as collide-action (logand v1-11 1)) a0-9) cfg-16 :delay (nop!)) ) @@ -2996,18 +2996,18 @@ it returns a triangle and normal direction to push in. ) ;; definition for method 12 of type collide-shape-prim-mesh -(defmethod overlaps-others-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (v1-3 uint) (v1-11 uint) (s4-0 uint)) (let ((v1-0 (-> arg1 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) - (let ((v0-1 (overlaps-others-group obj arg0 (the-as collide-shape-prim-group arg1)))) + (let ((v0-1 (overlaps-others-group this arg0 (the-as collide-shape-prim-group arg1)))) (b! #t cfg-18 :delay (nop!)) (label cfg-2) (b! (> (the-as int v1-0) 0) cfg-10 :delay (set! v1-3 (logand s4-0 2))) (b! (nonzero? v1-3) cfg-12 :delay (nop!)) - (let ((s2-0 (-> obj mesh))) + (let ((s2-0 (-> this mesh))) (b! (not s2-0) cfg-9 :delay (empty-form)) - (let ((v1-5 (populate-for-prim-mesh *collide-mesh-cache* obj))) + (let ((v1-5 (populate-for-prim-mesh *collide-mesh-cache* this))) (b! (not v1-5) cfg-9 :delay (empty-form)) (b! (not (overlap-test s2-0 (the-as collide-mesh-cache-tri (-> v1-5 tris)) (the-as vector (-> arg1 prim-core)))) @@ -3032,10 +3032,10 @@ it returns a triangle and normal direction to push in. (label cfg-12) (let ((a0-9 (-> arg0 tlist))) (b! (= a0-9 #f) cfg-14 :delay (nop!)) - (add-touching-prims a0-9 obj arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + (add-touching-prims a0-9 this arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) ) (label cfg-14) - (b! (not (logtest? s4-0 1)) cfg-17 :delay (set! v1-11 (the-as uint (-> obj prim-core action)))) + (b! (not (logtest? s4-0 1)) cfg-17 :delay (set! v1-11 (the-as uint (-> this prim-core action)))) (let ((a0-10 (-> arg1 prim-core action))) (b! (logtest? (the-as collide-action (logand v1-11 1)) a0-10) cfg-17 :delay (nop!)) ) @@ -3051,9 +3051,9 @@ it returns a triangle and normal direction to push in. ;; definition for method 49 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod modify-collide-as! collide-shape ((obj collide-shape) (arg0 int) (arg1 collide-spec) (arg2 collide-spec)) - (let ((v1-0 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) +(defmethod modify-collide-as! collide-shape ((this collide-shape) (arg0 int) (arg1 collide-spec) (arg2 collide-spec)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (if (logtest? (-> v1-0 prim-id) arg0) (set! (-> v1-0 prim-core collide-as) (logior (logclear (-> v1-0 prim-core collide-as) arg1) arg2)) ) @@ -3064,7 +3064,7 @@ it returns a triangle and normal direction to push in. (none) ) -(defmethod send-shoves collide-shape ((obj collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) +(defmethod send-shoves collide-shape ((this collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) (local-vars (sv-144 process) (sv-160 collide-shape-prim) (sv-176 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -3082,7 +3082,7 @@ it returns a triangle and normal direction to push in. ) (when (and s0-0 gp-0) (while s0-0 - (set! sv-160 (get-touched-prim s0-0 obj arg1)) + (set! sv-160 (get-touched-prim s0-0 this arg1)) (get-touched-prim s0-0 (-> (the-as process-focusable gp-0) root) arg1) (when (logtest? (-> sv-160 prim-core action) (collide-action no-standon)) (let ((v1-12 (get-middle-of-bsphere-overlap s0-0 (new 'stack-no-clear 'vector)))) @@ -3129,9 +3129,9 @@ it returns a triangle and normal direction to push in. ;; definition for method 41 of type collide-shape ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs vector. -(defmethod shove-to-closest-point-on-path collide-shape ((obj collide-shape) (arg0 attack-info) (arg1 float)) +(defmethod shove-to-closest-point-on-path collide-shape ((this collide-shape) (arg0 attack-info) (arg1 float)) (set! (-> arg0 shove-up) arg1) - (let* ((s3-0 (-> obj process path)) + (let* ((s3-0 (-> this process path)) (s2-0 (-> s3-0 curve num-cverts)) (s4-0 (target-pos 0)) (s1-0 (new 'stack-no-clear 'vector)) diff --git a/goal_src/jak2/engine/collide/collide-touch-h.gc b/goal_src/jak2/engine/collide/collide-touch-h.gc index 5d6dd5f0bb..c82e1d73db 100644 --- a/goal_src/jak2/engine/collide/collide-touch-h.gc +++ b/goal_src/jak2/engine/collide/collide-touch-h.gc @@ -35,7 +35,7 @@ :flag-assert #xc000000e8 (:methods (get-middle-of-bsphere-overlap (_type_ vector) vector 9) - (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim 10) + (get-touched-prim (_type_ collide-shape touching-shapes-entry) collide-shape-prim 10) (get-touched-tri (_type_ collide-shape touching-shapes-entry) collide-tri-result 11) ) ) @@ -58,10 +58,10 @@ ) -(defmethod init-list! touching-prims-entry-pool ((obj touching-prims-entry-pool)) +(defmethod init-list! touching-prims-entry-pool ((this touching-prims-entry-pool)) (let ((v1-0 (the-as touching-prims-entry #f))) - (let ((a1-0 (the-as touching-prims-entry (-> obj nodes)))) - (set! (-> obj head) a1-0) + (let ((a1-0 (the-as touching-prims-entry (-> this nodes)))) + (set! (-> this head) a1-0) (countdown (a0-1 64) (set! (-> a1-0 prev) v1-0) (let ((a2-0 (&+ a1-0 240))) @@ -147,12 +147,12 @@ ) ) -(defmethod get-head touching-shapes-entry ((obj touching-shapes-entry)) - (-> obj head) +(defmethod get-head touching-shapes-entry ((this touching-shapes-entry)) + (-> this head) ) ;; WARN: Return type mismatch collide-shape vs touching-prims-entry. -(defmethod get-next touching-shapes-entry ((obj touching-shapes-entry) (arg0 touching-shapes-entry)) +(defmethod get-next touching-shapes-entry ((this touching-shapes-entry) (arg0 touching-shapes-entry)) (the-as touching-prims-entry (-> arg0 cshape1)) ) diff --git a/goal_src/jak2/engine/collide/collide-touch.gc b/goal_src/jak2/engine/collide/collide-touch.gc index 3ce04ee7ce..6c29401e09 100644 --- a/goal_src/jak2/engine/collide/collide-touch.gc +++ b/goal_src/jak2/engine/collide/collide-touch.gc @@ -7,9 +7,9 @@ ;; DECOMP BEGINS -(defmethod get-free-node-count touching-prims-entry-pool ((obj touching-prims-entry-pool)) +(defmethod get-free-node-count touching-prims-entry-pool ((this touching-prims-entry-pool)) (let ((v0-0 0)) - (let ((v1-0 (-> obj head))) + (let ((v1-0 (-> this head))) (while v1-0 (+! v0-0 1) (set! v1-0 (-> v1-0 next)) @@ -22,12 +22,12 @@ ) ) -(defmethod alloc-node touching-prims-entry-pool ((obj touching-prims-entry-pool)) - (let ((gp-0 (-> obj head))) +(defmethod alloc-node touching-prims-entry-pool ((this touching-prims-entry-pool)) + (let ((gp-0 (-> this head))) (cond (gp-0 (let ((v1-0 (-> gp-0 next))) - (set! (-> obj head) v1-0) + (set! (-> this head) v1-0) (if v1-0 (set! (-> v1-0 prev) #f) ) @@ -44,13 +44,13 @@ ) ) -(defmethod free-node touching-prims-entry-pool ((obj touching-prims-entry-pool) (arg0 touching-prims-entry)) +(defmethod free-node touching-prims-entry-pool ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) (when (-> arg0 allocated?) (set! (-> arg0 allocated?) #f) - (let ((v1-1 (-> obj head))) + (let ((v1-1 (-> this head))) (set! (-> arg0 next) v1-1) (set! (-> arg0 prev) #f) - (set! (-> obj head) arg0) + (set! (-> this head) arg0) (when v1-1 (set! (-> v1-1 prev) arg0) arg0 @@ -59,12 +59,12 @@ ) ) -(defmethod free-touching-prims-list touching-shapes-entry ((obj touching-shapes-entry)) - (when (-> obj cshape1) - (set! (-> obj cshape1) #f) - (let ((gp-0 (-> obj head))) +(defmethod free-touching-prims-list touching-shapes-entry ((this touching-shapes-entry)) + (when (-> this cshape1) + (set! (-> this cshape1) #f) + (let ((gp-0 (-> this head))) (when gp-0 - (set! (-> obj head) #f) + (set! (-> this head) #f) (let ((s5-0 *touching-prims-entry-pool*)) (while gp-0 (let ((a1-0 gp-0)) @@ -80,24 +80,24 @@ (none) ) -(defmethod free-nodes touching-list ((obj touching-list)) - (let ((s5-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (s4-0 (-> obj num-touching-shapes)) +(defmethod free-nodes touching-list ((this touching-list)) + (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) (free-touching-prims-list s5-0) (&+! s5-0 32) ) ) - (set! (-> obj num-touching-shapes) 0) - (set! (-> obj resolve-u) 0) + (set! (-> this num-touching-shapes) 0) + (set! (-> this resolve-u) 0) 0 (none) ) ;; WARN: Return type mismatch object vs touching-shapes-entry. -(defmethod get-shapes-entry touching-list ((obj touching-list) (shape1 collide-shape) (shape2 collide-shape)) - (let ((entry (the-as touching-shapes-entry (-> obj touching-shapes)))) +(defmethod get-shapes-entry touching-list ((this touching-list) (shape1 collide-shape) (shape2 collide-shape)) + (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) (let ((v1-0 (the-as touching-shapes-entry #f))) - (countdown (a3-0 (-> obj num-touching-shapes)) + (countdown (a3-0 (-> this num-touching-shapes)) (let ((t0-0 (-> entry cshape1))) (set! v1-0 (cond @@ -120,11 +120,11 @@ (set! entry v1-0) ) (else - (when (>= (-> obj num-touching-shapes) 32) + (when (>= (-> this num-touching-shapes) 32) (format 0 "ERROR: touching-list::get-shapes-entry() failed!~%") (return (the-as touching-shapes-entry #f)) ) - (+! (-> obj num-touching-shapes) 1) + (+! (-> this num-touching-shapes) 1) ) ) ) @@ -132,7 +132,7 @@ (set! (-> entry cshape2) shape2) (set! (-> entry head) #f) (set! (-> entry resolve-u) 1) - (set! (-> obj resolve-u) 1) + (set! (-> this resolve-u) 1) (set! (-> entry handle1) (process->handle (-> shape1 process))) (set! (-> entry handle2) (process->handle (-> shape2 process))) (the-as touching-shapes-entry entry) @@ -150,7 +150,7 @@ ;; WARN: Function (method 9 touching-list) has a return type of none, but the expression builder found a return statement. -(defmethod add-touching-prims touching-list ((obj touching-list) +(defmethod add-touching-prims touching-list ((this touching-list) (arg0 collide-shape-prim) (arg1 collide-shape-prim) (arg2 float) @@ -160,7 +160,7 @@ (let ((gp-0 (new 'stack-no-clear 'add-prims-touching-work))) (set! (-> gp-0 tri1) arg3) (set! (-> gp-0 tri2) arg4) - (let ((s2-0 (get-shapes-entry obj (-> arg0 cshape) (-> arg1 cshape)))) + (let ((s2-0 (get-shapes-entry this (-> arg0 cshape) (-> arg1 cshape)))) (when s2-0 (when (= (-> s2-0 cshape1) (-> arg1 cshape)) (let ((v1-4 arg0)) @@ -218,7 +218,7 @@ (set! (-> s0-1 u) arg2) (when (>= arg2 0.0) (set! (-> s2-0 resolve-u) 1) - (set! (-> obj resolve-u) 1) + (set! (-> this resolve-u) 1) ) (let ((v1-26 (-> s0-1 prim1)) (a1-4 (-> gp-0 tri1)) @@ -257,11 +257,11 @@ (none) ) -(defmethod update-from-step-size touching-list ((obj touching-list) (arg0 float)) - (when (nonzero? (-> obj resolve-u)) - (set! (-> obj resolve-u) 0) - (let ((s5-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (s4-0 (-> obj num-touching-shapes)) +(defmethod update-from-step-size touching-list ((this touching-list) (arg0 float)) + (when (nonzero? (-> this resolve-u)) + (set! (-> this resolve-u) 0) + (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) (when (nonzero? (-> s5-0 resolve-u)) (set! (-> s5-0 resolve-u) 0) (when (-> s5-0 cshape1) @@ -316,9 +316,9 @@ (none) ) -(defmethod send-events-for-touching-shapes touching-list ((obj touching-list)) - (let ((gp-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (s5-0 (-> obj num-touching-shapes)) +(defmethod send-events-for-touching-shapes touching-list ((this touching-list)) + (let ((gp-0 (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (s5-0 (-> this num-touching-shapes)) (let ((s3-0 (-> gp-0 cshape1))) (when s3-0 (let ((s4-0 (handle->process (-> gp-0 handle1))) @@ -368,10 +368,10 @@ (none) ) -(defmethod prims-touching? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape) (arg1 uint)) +(defmethod prims-touching? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 uint)) (cond - ((= (-> obj cshape1) arg0) - (let ((v1-1 (-> obj head))) + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) (while v1-1 (if (logtest? (-> v1-1 prim1 cprim prim-id) arg1) (return v1-1) @@ -380,8 +380,8 @@ ) ) ) - ((= (-> obj cshape2) arg0) - (let ((v1-4 (-> obj head))) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) (while v1-4 (if (logtest? (-> v1-4 prim2 cprim prim-id) arg1) (return v1-4) @@ -398,10 +398,10 @@ ) ;; WARN: Return type mismatch touching-prims-entry vs basic. -(defmethod prims-touching-action? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) +(defmethod prims-touching-action? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) (cond - ((= (-> obj cshape1) arg0) - (let ((v1-1 (-> obj head))) + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) (while v1-1 (let ((a0-1 (-> v1-1 prim1 cprim))) (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) @@ -412,8 +412,8 @@ ) ) ) - ((= (-> obj cshape2) arg0) - (let ((v1-4 (-> obj head))) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) (while v1-4 (let ((a0-5 (-> v1-4 prim2 cprim))) (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) @@ -431,44 +431,44 @@ (the-as basic #f) ) -(defmethod get-touched-shape touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape)) +(defmethod get-touched-shape touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape)) (cond - ((= (-> obj cshape1) arg0) - (return (-> obj cshape2)) + ((= (-> this cshape1) arg0) + (return (-> this cshape2)) ) - ((= (-> obj cshape2) arg0) - (return (-> obj cshape1)) + ((= (-> this cshape2) arg0) + (return (-> this cshape1)) ) ) (the-as collide-shape #f) ) -(defmethod get-touched-prim touching-prims-entry ((obj touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-prim touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) (cond ((= (-> arg1 cshape1) arg0) - (return (-> obj prim1 cprim)) + (return (-> this prim1 cprim)) ) ((= (-> arg1 cshape2) arg0) - (return (-> obj prim2 cprim)) + (return (-> this prim2 cprim)) ) ) (the-as collide-shape-prim #f) ) -(defmethod get-touched-tri touching-prims-entry ((obj touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-tri touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) (let ((v0-0 (the-as collide-tri-result #f))) (cond - ((not obj) + ((not this) ) ((= (-> arg1 cshape1) arg0) - (let ((v1-4 (-> obj prim1))) + (let ((v1-4 (-> this prim1))) (if (-> v1-4 has-tri?) (set! v0-0 (-> v1-4 tri)) ) ) ) ((= (-> arg1 cshape2) arg0) - (let ((v1-7 (-> obj prim2))) + (let ((v1-7 (-> this prim2))) (if (-> v1-7 has-tri?) (set! v0-0 (-> v1-7 tri)) ) @@ -479,9 +479,9 @@ ) ) -(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((obj touching-prims-entry) (arg0 vector)) - (let* ((s4-0 (-> obj prim1 cprim)) - (v1-0 (-> obj prim2 cprim)) +(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((this touching-prims-entry) (arg0 vector)) + (let* ((s4-0 (-> this prim1 cprim)) + (v1-0 (-> this prim2 cprim)) (gp-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> v1-0 prim-core)) diff --git a/goal_src/jak2/engine/collide/los-control.gc b/goal_src/jak2/engine/collide/los-control.gc index 84ead8c877..c3c6efc269 100644 --- a/goal_src/jak2/engine/collide/los-control.gc +++ b/goal_src/jak2/engine/collide/los-control.gc @@ -10,12 +10,12 @@ (define *los-time-offset* (the-as time-frame 0)) ;; WARN: Return type mismatch time-frame vs none. -(defmethod los-control-method-9 los-control ((obj los-control) (process process-focusable) (trans-vec vector) (radius float)) - (when (and (>= (- (current-time) (-> obj last-check-time)) (-> obj check-interval)) - (-> obj src-proc) - (or process (-> obj dst-proc)) +(defmethod los-control-method-9 los-control ((this los-control) (process process-focusable) (trans-vec vector) (radius float)) + (when (and (time-elapsed? (-> this last-check-time) (-> this check-interval)) + (-> this src-proc) + (or process (-> this dst-proc)) ) - (let* ((process-source (handle->process (-> obj src-proc))) + (let* ((process-source (handle->process (-> this src-proc))) (process-focus (if (type? process-source process-focusable) (the-as process-focusable process-source) ) @@ -23,7 +23,7 @@ ) (when process-focus (when (not process) - (let ((process-dest (handle->process (-> obj dst-proc)))) + (let ((process-dest (handle->process (-> this dst-proc)))) (set! process (if (type? process-dest process-focusable) (the-as process-focusable process-dest) ) @@ -43,7 +43,7 @@ (set! (-> cquery move-dist quad) (-> distance quad)) (let ((query cquery)) (set! (-> query radius) radius) - (set! (-> query collide-with) (-> obj collide-with)) + (set! (-> query collide-with) (-> this collide-with)) (set! (-> query ignore-process0) process-focus) (set! (-> query ignore-process1) process) (set! (-> query ignore-pat) (-> process-focus root pat-ignore-mask)) @@ -51,15 +51,15 @@ ) (fill-using-line-sphere *collide-cache* cquery) (let ((f30-0 (probe-using-line-sphere *collide-cache* cquery))) - (quad-copy! (the-as pointer (-> obj last-collide-result)) (the-as pointer (-> cquery best-other-tri)) 6) + (quad-copy! (the-as pointer (-> this last-collide-result)) (the-as pointer (-> cquery best-other-tri)) 6) (if (>= 0.0 f30-0) - (set! (-> obj have-no-los) (current-time)) - (set! (-> obj have-los) (current-time)) + (set-time! (-> this have-no-los)) + (set-time! (-> this have-los)) ) ) ) ) - (set! (-> obj last-check-time) (current-time)) + (set-time! (-> this last-check-time)) ) ) ) @@ -67,32 +67,32 @@ (none) ) -(defmethod check-los? los-control ((obj los-control) (arg0 time-frame)) - (and (>= (- (current-time) (-> obj have-los)) (+ (-> obj check-interval) arg0)) - (< (- (current-time) (-> obj have-no-los)) (-> obj check-interval)) +(defmethod check-los? los-control ((this los-control) (arg0 time-frame)) + (and (time-elapsed? (-> this have-los) (+ (-> this check-interval) arg0)) + (not (time-elapsed? (-> this have-no-los) (-> this check-interval))) ) ) -(defmethod skip-check-los? los-control ((obj los-control) (arg0 int)) - (and (>= (- (current-time) (-> obj have-no-los)) (+ (-> obj check-interval) arg0)) - (< (- (current-time) (-> obj have-los)) (-> obj check-interval)) +(defmethod skip-check-los? los-control ((this los-control) (arg0 int)) + (and (time-elapsed? (-> this have-no-los) (+ (-> this check-interval) arg0)) + (not (time-elapsed? (-> this have-los) (-> this check-interval))) ) ) -(defmethod set-dst-proc! los-control ((obj los-control) (dst handle)) - (set! (-> obj dst-proc) dst) +(defmethod set-dst-proc! los-control ((this los-control) (dst handle)) + (set! (-> this dst-proc) dst) 0 (none) ) -(defmethod new-source! los-control ((obj los-control) (proc process) (check-interval time-frame) (c-spec collide-spec)) - (set! (-> obj src-proc) (process->handle proc)) - (set! (-> obj dst-proc) (the-as handle #f)) - (set! (-> obj have-los) 0) - (set! (-> obj have-no-los) 0) - (set! (-> obj last-check-time) *los-time-offset*) - (set! (-> obj check-interval) check-interval) - (set! (-> obj collide-with) c-spec) +(defmethod new-source! los-control ((this los-control) (proc process) (check-interval time-frame) (c-spec collide-spec)) + (set! (-> this src-proc) (process->handle proc)) + (set! (-> this dst-proc) (the-as handle #f)) + (set! (-> this have-los) 0) + (set! (-> this have-no-los) 0) + (set! (-> this last-check-time) *los-time-offset*) + (set! (-> this check-interval) check-interval) + (set! (-> this collide-with) c-spec) (set! *los-time-offset* (+ *los-time-offset* 1)) 0 (none) diff --git a/goal_src/jak2/engine/collide/pat-h.gc b/goal_src/jak2/engine/collide/pat-h.gc index 9b16d9e1c5..a2705595d2 100644 --- a/goal_src/jak2/engine/collide/pat-h.gc +++ b/goal_src/jak2/engine/collide/pat-h.gc @@ -93,6 +93,7 @@ :flag-assert #x900000004 ) + (defun-debug pat-material->string ((arg0 pat-surface)) (enum->string pat-material (-> arg0 material)) ) @@ -116,6 +117,7 @@ :flag-assert #x900000010 ) + (define *pat-mode-info* (new 'static 'inline-array pat-mode-info 4 (new 'static 'pat-mode-info :name "ground" diff --git a/goal_src/jak2/engine/common_objs/base-plat.gc b/goal_src/jak2/engine/common_objs/base-plat.gc index 11fc897248..05c4e8b0a3 100644 --- a/goal_src/jak2/engine/common_objs/base-plat.gc +++ b/goal_src/jak2/engine/common_objs/base-plat.gc @@ -43,32 +43,32 @@ ) -(defmethod init-plat! base-plat ((obj base-plat)) +(defmethod init-plat! base-plat ((this base-plat)) "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." 0 (none) ) -(defmethod stop-bouncing! base-plat ((obj base-plat)) +(defmethod stop-bouncing! base-plat ((this base-plat)) "Sets `bouncing` to false and resets related settings to their defaults" - (set! (-> obj basetrans quad) (-> obj root trans quad)) - (set! (-> obj bouncing) #f) - (set! (-> obj bounce-scale) 819.2) + (set! (-> this basetrans quad) (-> this root trans quad)) + (set! (-> this bouncing) #f) + (set! (-> this bounce-scale) 819.2) 0 (none) ) -(defmethod start-bouncing! base-plat ((obj base-plat)) +(defmethod start-bouncing! base-plat ((this base-plat)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (activate! (-> obj smush) -1.0 60 150 1.0 1.0 (-> self clock)) - (set! (-> obj bounce-time) (current-time)) - (set! (-> obj bouncing) #t) - (sound-play "plat-bounce" :position (-> obj root trans)) - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) + (activate! (-> this smush) -1.0 60 150 1.0 1.0 (-> self clock)) + (set-time! (-> this bounce-time)) + (set! (-> this bouncing) #t) + (sound-play "plat-bounce" :position (-> this root trans)) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -127,19 +127,19 @@ If we aren't bouncing however, TODO - CSHAPE" (none) ) -(defmethod base-plat-method-32 base-plat ((obj base-plat)) +(defmethod base-plat-method-32 base-plat ((this base-plat)) 0 (none) ) -(defmethod execute-effects base-plat ((obj base-plat)) +(defmethod execute-effects base-plat ((this base-plat)) "Executes various ancillary tasks with the platform, such as spawning particles or playing the associated sound" - (if (nonzero? (-> obj part)) - (spawn (-> obj part) (-> obj root trans)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) ) - (when (nonzero? (-> obj sound)) - (set! (-> obj sound trans quad) (-> obj root trans quad)) - (update! (-> obj sound)) + (when (nonzero? (-> this sound)) + (set! (-> this sound trans quad) (-> this root trans quad)) + (update! (-> this sound)) ) (none) ) @@ -271,7 +271,7 @@ eco-door-event-handler :virtual #t :event eco-door-event-handler :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status subtask-complete) #t) (let ((prim (-> self root root-prim))) (set! (-> prim prim-core collide-as) (collide-spec)) @@ -334,21 +334,21 @@ eco-door-event-handler :post transform-post ) -(defmethod lock-according-to-task! eco-door ((obj eco-door)) +(defmethod lock-according-to-task! eco-door ((this eco-door)) "If the associated subtask is completed, lock the door if [[eco-door-flags:0]] is set otherwise, lock it if [[eco-door-flags:0]] is set" - (when (-> obj state-actor) - (if (logtest? (-> obj state-actor extra perm status) (entity-perm-status subtask-complete)) - (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf01))) - (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf00))) + (when (-> this state-actor) + (if (logtest? (-> this state-actor extra perm status) (entity-perm-status subtask-complete)) + (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf01))) + (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf00))) ) ) 0 (none) ) -(defmethod eco-door-method-25 eco-door ((obj eco-door)) - (let ((collision-shape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod eco-door-method-25 eco-door ((this eco-door)) + (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) (set! (-> collision-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> collision-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -363,55 +363,55 @@ otherwise, lock it if [[eco-door-flags:0]] is set" (set! (-> collision-shape backup-collide-as) (-> prim prim-core collide-as)) (set! (-> collision-shape backup-collide-with) (-> prim prim-core collide-with)) ) - (set! (-> obj root) collision-shape) + (set! (-> this root) collision-shape) ) 0 (none) ) -(defmethod stub eco-door ((obj eco-door)) +(defmethod stub eco-door ((this eco-door)) "@unused - Stub with no overrides" 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! eco-door ((obj eco-door) (arg0 entity-actor)) +(defmethod init-from-entity! eco-door ((this eco-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (eco-door-method-25 obj) - (process-drawable-from-entity! obj arg0) - (let ((door-scale (res-lump-float (-> obj entity) 'scale :default 1.0))) - (set-vector! (-> obj root scale) door-scale door-scale door-scale 1.0) + (eco-door-method-25 this) + (process-drawable-from-entity! this arg0) + (let ((door-scale (res-lump-float (-> this entity) 'scale :default 1.0))) + (set-vector! (-> this root scale) door-scale door-scale door-scale 1.0) ) - (set! (-> obj open-distance) 32768.0) - (set! (-> obj close-distance) 49152.0) - (set! (-> obj speed) 1.0) - (set! (-> obj state-actor) #f) + (set! (-> this open-distance) 32768.0) + (set! (-> this close-distance) 49152.0) + (set! (-> this speed) 1.0) + (set! (-> this state-actor) #f) (let ((state-actor (entity-actor-lookup arg0 'state-actor 0))) (if state-actor - (set! (-> obj state-actor) state-actor) + (set! (-> this state-actor) state-actor) ) ) - (set! (-> obj locked) #f) - (set! (-> obj flags) (res-lump-value arg0 'flags eco-door-flags :time -1000000000.0)) - (lock-according-to-task! obj) - (set! (-> obj auto-close) (logtest? (-> obj flags) (eco-door-flags auto-close))) - (set! (-> obj one-way) (logtest? (-> obj flags) (eco-door-flags one-way))) - (vector-z-quaternion! (-> obj out-dir) (-> obj root quat)) - (set! (-> obj out-dir w) (- (vector-dot (-> obj out-dir) (-> obj root trans)))) - (update-transforms (-> obj root)) - (stub obj) - (if (and (not (-> obj auto-close)) - (-> obj entity) - (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) + (set! (-> this locked) #f) + (set! (-> this flags) (res-lump-value arg0 'flags eco-door-flags :time -1000000000.0)) + (lock-according-to-task! this) + (set! (-> this auto-close) (logtest? (-> this flags) (eco-door-flags auto-close))) + (set! (-> this one-way) (logtest? (-> this flags) (eco-door-flags one-way))) + (vector-z-quaternion! (-> this out-dir) (-> this root quat)) + (set! (-> this out-dir w) (- (vector-dot (-> this out-dir) (-> this root trans)))) + (update-transforms (-> this root)) + (stub this) + (if (and (not (-> this auto-close)) + (-> this entity) + (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) ) - (go (method-of-object obj door-open)) - (go (method-of-object obj door-closed)) + (go (method-of-object this door-open)) + (go (method-of-object this door-closed)) ) (none) ) diff --git a/goal_src/jak2/engine/common_objs/basebutton.gc b/goal_src/jak2/engine/common_objs/basebutton.gc index ce46557a77..8913f45f06 100644 --- a/goal_src/jak2/engine/common_objs/basebutton.gc +++ b/goal_src/jak2/engine/common_objs/basebutton.gc @@ -60,25 +60,25 @@ :bounds (static-spherem 0 0 0 3) ) -(defmethod move-to! basebutton ((obj basebutton) (vec vector) (quat quaternion)) - (logclear! (-> obj button-status) (button-status button-status-2)) +(defmethod move-to! basebutton ((this basebutton) (vec vector) (quat quaternion)) + (logclear! (-> this button-status) (button-status button-status-2)) (if vec - (set! (-> obj move-to-pos quad) (-> vec quad)) - (set! (-> obj move-to-pos quad) (-> obj root trans quad)) + (set! (-> this move-to-pos quad) (-> vec quad)) + (set! (-> this move-to-pos quad) (-> this root trans quad)) ) (if quat - (quaternion-copy! (-> obj move-to-quat) quat) - (quaternion-copy! (-> obj move-to-quat) (-> obj root quat)) + (quaternion-copy! (-> this move-to-quat) quat) + (quaternion-copy! (-> this move-to-quat) (-> this root quat)) ) 0 (none) ) -(defmethod idle-state-transition basebutton ((obj basebutton)) +(defmethod idle-state-transition basebutton ((this basebutton)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" - (if (logtest? (-> obj button-status) (button-status pressed)) - (go (method-of-object obj down-idle)) - (go (method-of-object obj up-idle)) + (if (logtest? (-> this button-status) (button-status pressed)) + (go (method-of-object this down-idle)) + (go (method-of-object this up-idle)) ) ) @@ -188,7 +188,7 @@ ) :enter (behavior () (press! self #t) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (logtest? (-> self button-status) (button-status button-status-2)) @@ -201,7 +201,7 @@ (sleep-code) ) (else - (until (>= (- (current-time) (-> self state-time)) (the int (* 300.0 (-> self timeout)))) + (until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout)))) (suspend) ) (send-event! self (-> self event-going-up)) @@ -255,20 +255,20 @@ ) ) -(defmethod press! basebutton ((obj basebutton) (pressed? symbol)) +(defmethod press! basebutton ((this basebutton) (pressed? symbol)) (if pressed? - (logior! (-> obj button-status) (button-status pressed)) - (logclear! (-> obj button-status) (button-status pressed)) + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) ) - (when (not (logtest? (-> obj button-status) (button-status button-status-1))) + (when (not (logtest? (-> this button-status) (button-status button-status-1))) (if pressed? - (process-entity-status! obj (entity-perm-status subtask-complete) #t) - (process-entity-status! obj (entity-perm-status subtask-complete) #f) + (process-entity-status! this (entity-perm-status subtask-complete) #t) + (process-entity-status! this (entity-perm-status subtask-complete) #f) ) ) ) -(defmethod send-event! basebutton ((obj basebutton) (event-type symbol)) +(defmethod send-event! basebutton ((this basebutton) (event-type symbol)) "Prepares an [[event-message-block]] using the provided type to send an event to: - the `notify-actor` - every [[entity-actor]] in the `actor-group` array @@ -279,7 +279,7 @@ (set! (-> event num-params) 0) (set! (-> event message) event-type) (let ((func send-event-function) - (actor (-> obj notify-actor)) + (actor (-> this notify-actor)) ) (func (if actor @@ -287,8 +287,8 @@ ) event ) - (dotimes (actor-group-idx (-> obj actor-group-count)) - (let ((actor-group (-> obj actor-group actor-group-idx))) + (dotimes (actor-group-idx (-> this actor-group-count)) + (let ((actor-group (-> this actor-group actor-group-idx))) (dotimes (actor-idx (-> actor-group length)) (set! event (new 'stack-no-clear 'event-message-block)) (set! (-> event from) (process->ppointer self)) @@ -312,66 +312,66 @@ (none) ) -(defmethod reset! basebutton ((obj basebutton)) - (set! (-> obj button-status) (button-status)) - (set! (-> obj notify-actor) #f) - (set! (-> obj timeout) 0.0) - (set! (-> obj event-going-down) #f) - (set! (-> obj event-down) #f) - (set! (-> obj event-going-up) #f) - (set! (-> obj event-up) #f) - (set! (-> obj anim-speed) 1.0) +(defmethod reset! basebutton ((this basebutton)) + (set! (-> this button-status) (button-status)) + (set! (-> this notify-actor) #f) + (set! (-> this timeout) 0.0) + (set! (-> this event-going-down) #f) + (set! (-> this event-down) #f) + (set! (-> this event-going-up) #f) + (set! (-> this event-up) #f) + (set! (-> this anim-speed) 1.0) 0 (none) ) -(defmethod prepare-trigger-event! basebutton ((obj basebutton)) +(defmethod prepare-trigger-event! basebutton ((this basebutton)) "Sets `event-going-down` to `'trigger`" - (set! (-> obj event-going-down) 'trigger) + (set! (-> this event-going-down) 'trigger) 0 (none) ) -(defmethod basebutton-method-33 basebutton ((obj basebutton)) +(defmethod basebutton-method-33 basebutton ((this basebutton)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-generic-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) - (let ((channel-0 (-> obj skel root-channel 0))) + ((logtest? (-> this button-status) (button-status pressed)) + (let ((channel-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! channel-0 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> channel-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) ) ) (else - (let ((channel-1 (-> obj skel root-channel 0))) + (let ((channel-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! channel-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> channel-1 frame-num) 0.0) ) ) ) - (set! (-> obj anim-speed) 2.0) + (set! (-> this anim-speed) 2.0) (transform-post) (none) ) -(defmethod basebutton-method-34 basebutton ((obj basebutton)) +(defmethod basebutton-method-34 basebutton ((this basebutton)) "TODO - collision stuff" - (let ((collision-shape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) (set! (-> collision-mesh prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> collision-mesh prim-core collide-with) (collide-spec jak bot player-list)) @@ -387,14 +387,14 @@ (set! (-> collision-shape backup-collide-as) (-> prim prim-core collide-as)) (set! (-> collision-shape backup-collide-with) (-> prim prim-core collide-with)) ) - (set! (-> obj root) collision-shape) + (set! (-> this root) collision-shape) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! basebutton ((obj basebutton) (arg0 entity-actor)) +(defmethod init-from-entity! basebutton ((this basebutton) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -402,41 +402,41 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (reset! obj) - (set! (-> obj button-id) -1) - (let ((v1-4 (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (reset! this) + (set! (-> this button-id) -1) + (let ((v1-4 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) (if (>= (the-as int v1-4) 0) - (set! (-> obj button-id) (the-as int v1-4)) + (set! (-> this button-id) (the-as int v1-4)) ) ) - (basebutton-method-34 obj) - (process-drawable-from-entity! obj arg0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (logior! (-> obj button-status) (button-status pressed)) - (logclear! (-> obj button-status) (button-status pressed)) + (basebutton-method-34 this) + (process-drawable-from-entity! this arg0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-15 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-15 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-15 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-15)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-15)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj timeout) (res-lump-float arg0 'timeout)) - (if (not (logtest? (-> obj button-status) (button-status button-status-1))) - (nav-mesh-connect-from-ent obj) + (set! (-> this timeout) (res-lump-float arg0 'timeout)) + (if (not (logtest? (-> this button-status) (button-status button-status-1))) + (nav-mesh-connect-from-ent this) ) - (prepare-trigger-event! obj) - (basebutton-method-33 obj) - (idle-state-transition obj) + (prepare-trigger-event! this) + (basebutton-method-33 this) + (idle-state-transition this) (none) ) diff --git a/goal_src/jak2/engine/common_objs/blocking-plane.gc b/goal_src/jak2/engine/common_objs/blocking-plane.gc index 534c27a162..f652c7c428 100644 --- a/goal_src/jak2/engine/common_objs/blocking-plane.gc +++ b/goal_src/jak2/engine/common_objs/blocking-plane.gc @@ -86,14 +86,14 @@ :code sleep-code ) -(defmethod init! blocking-plane ((obj blocking-plane) (vec-pair (inline-array vector)) (height float)) +(defmethod init! blocking-plane ((this blocking-plane) (vec-pair (inline-array vector)) (height float)) "TODO - but sets up the plane given 2 vectors and a height" (let ((s3-0 (-> vec-pair 0)) (s4-0 (-> vec-pair 1)) ) 0.0 (* 0.5 (vector-vector-distance s3-0 s4-0)) - (let ((s2-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s2-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-3 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-3 prim-core collide-as) (collide-spec blocking-plane)) (set! (-> v1-3 prim-core collide-with) (collide-spec jak player-list)) @@ -107,10 +107,10 @@ (set! (-> s2-0 backup-collide-as) (-> v1-6 prim-core collide-as)) (set! (-> s2-0 backup-collide-with) (-> v1-6 prim-core collide-with)) ) - (set! (-> obj root) s2-0) + (set! (-> this root) s2-0) ) (let ((s1-0 (new 'stack-no-clear 'matrix)) - (s2-1 (-> obj root)) + (s2-1 (-> this root)) ) (vector+! (-> s2-1 trans) s3-0 s4-0) (vector-float*! (-> s2-1 trans) (-> s2-1 trans) 0.5) @@ -124,7 +124,7 @@ (vector-cross! (-> s1-0 vector 2) (the-as vector (-> s1-0 vector)) (-> s1-0 vector 1)) (vector-normalize! (-> s1-0 vector 2) 1.0) (matrix->quaternion (-> s2-1 quat) s1-0) - (let ((v1-20 (-> obj root root-prim local-sphere))) + (let ((v1-20 (-> this root root-prim local-sphere))) (set! (-> v1-20 x) 0.0) (set! (-> v1-20 y) (* 0.00024414062 (* 0.5 height))) (set! (-> v1-20 z) 0.0) @@ -139,11 +139,11 @@ ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-blocking-plane" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) (transform-post) (none) ) @@ -160,17 +160,17 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! blocking-plane ((obj blocking-plane) (arg0 entity-actor)) +(defmethod init-from-entity! blocking-plane ((this blocking-plane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (f30-0 (res-lump-float (-> obj entity) 'height :default 122880.0)) + (let ((s5-0 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (f30-0 (res-lump-float (-> this entity) 'height :default 122880.0)) ) - (set! (-> obj path) s5-0) + (set! (-> this path) s5-0) (if (or (not s5-0) (< (-> s5-0 curve num-cverts) 2)) (go process-drawable-art-error "bad path") ) @@ -184,11 +184,11 @@ This commonly includes things such as: (dotimes (s2-0 s4-0) (get-point-in-path! s5-0 (-> s3-0 0) (the float s2-0) 'interp) (get-point-in-path! s5-0 (-> s3-0 1) (the float (+ s2-0 1)) 'interp) - (process-spawn blocking-plane s3-0 f30-0 :to obj) + (process-spawn blocking-plane s3-0 f30-0 :to this) ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/engine/common_objs/collectables.gc b/goal_src/jak2/engine/common_objs/collectables.gc index 6280b51e82..11e3799df1 100644 --- a/goal_src/jak2/engine/common_objs/collectables.gc +++ b/goal_src/jak2/engine/common_objs/collectables.gc @@ -110,56 +110,58 @@ ;; WARN: Return type mismatch object vs none. -(defmethod go-to-initial-state collectable ((obj collectable)) +(defmethod go-to-initial-state collectable ((this collectable)) (cond - ((logtest? (-> obj fact options) (actor-option wait-for-task-complete)) - (go (method-of-object obj blocked)) + ((logtest? (-> this fact options) (actor-option wait-for-task-complete)) + (go (method-of-object this blocked)) ) - ((logtest? (-> obj flags) (collectable-flag bounce)) - (go (method-of-object obj deploy)) + ((logtest? (-> this flags) (collectable-flag bounce)) + (go (method-of-object this deploy)) ) (else - (go (method-of-object obj wait)) + (go (method-of-object this wait)) ) ) (none) ) -(defmethod initialize-options collectable ((obj collectable) (arg0 int) (arg1 float) (arg2 fact-info)) - (logclear! (-> obj mask) (process-mask crate enemy platform ambient)) - (logior! (-> obj mask) (process-mask bit18)) - (set! (-> obj flags) (collectable-flag pickup no-eco-blue)) - (set! (-> obj bob-amount) arg1) - (set! (-> obj bob-offset) - (the-as - seconds - (+ (the-as int (-> obj root trans x)) (the-as int (-> obj root trans y)) (the-as int (-> obj root trans z))) - ) +(defmethod initialize-options collectable ((this collectable) (arg0 int) (arg1 float) (arg2 fact-info)) + (logclear! (-> this mask) (process-mask crate enemy platform ambient)) + (logior! (-> this mask) (process-mask bit18)) + (set! (-> this flags) (collectable-flag pickup no-eco-blue)) + (set! (-> this bob-amount) arg1) + (set! (-> this bob-offset) (the-as seconds (+ (the-as int (-> this root trans x)) + (the-as int (-> this root trans y)) + (the-as int (-> this root trans z)) + ) + ) ) (cond - ((or (= (vector-length (-> obj root transv)) 0.0) (logtest? (-> obj fact options) (actor-option auto-pickup))) - (vector-reset! (-> obj root transv)) + ((or (= (vector-length (-> this root transv)) 0.0) + (logtest? (-> this fact options) (actor-option auto-pickup)) + ) + (vector-reset! (-> this root transv)) ) (else - (logior! (-> obj flags) (collectable-flag bounce)) - (logclear! (-> obj flags) (collectable-flag pickup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj bob-amount) 0.0) + (logior! (-> this flags) (collectable-flag bounce)) + (logclear! (-> this flags) (collectable-flag pickup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this bob-amount) 0.0) ) ) (when (> arg0 0) - (logior! (-> obj flags) (collectable-flag fadeout)) - (set! (-> obj fadeout-timeout) (the-as seconds arg0)) + (logior! (-> this flags) (collectable-flag fadeout)) + (set! (-> this fadeout-timeout) (the-as seconds arg0)) (if (logtest? (actor-option no-distance-check-fadeout) (-> arg2 options)) - (logior! (-> obj flags) (collectable-flag no-distance-check-fadeout)) + (logior! (-> this flags) (collectable-flag no-distance-check-fadeout)) ) ) - (set! (-> obj collect-timeout) (the-as seconds 99)) - (set! (-> obj birth-time) (current-time)) - (set! (-> obj base quad) (-> obj root trans quad)) - (set! (-> obj old-base quad) (-> obj root trans quad)) - (set! (-> obj pickup-handle) (the-as handle #f)) - (case (-> obj fact pickup-type) + (set! (-> this collect-timeout) (the-as seconds 99)) + (set-time! (-> this birth-time)) + (set! (-> this base quad) (-> this root trans quad)) + (set! (-> this old-base quad) (-> this root trans quad)) + (set! (-> this pickup-handle) (the-as handle #f)) + (case (-> this fact pickup-type) (((pickup-type eco-pill-green) (pickup-type eco-pill-dark) (pickup-type eco-green) @@ -170,13 +172,13 @@ (pickup-type health) (pickup-type trick-point) ) - (logclear! (-> obj flags) (collectable-flag no-eco-blue)) + (logclear! (-> this flags) (collectable-flag no-eco-blue)) ) ) - (if (logtest? (-> obj fact options) (actor-option big-collision)) - (set! (-> obj root root-prim local-sphere w) (* 2.5 (-> obj root root-prim local-sphere w))) + (if (logtest? (-> this fact options) (actor-option big-collision)) + (set! (-> this root root-prim local-sphere w) (* 2.5 (-> this root root-prim local-sphere w))) ) - (when (and arg2 (nonzero? (-> obj draw))) + (when (and arg2 (nonzero? (-> this draw))) (let* ((s5-0 (-> arg2 process)) (v1-56 (if (type? s5-0 process-drawable) s5-0 @@ -184,19 +186,19 @@ ) ) (if v1-56 - (set! (-> obj draw light-index) (-> (the-as process-drawable v1-56) draw light-index)) + (set! (-> this draw light-index) (-> (the-as process-drawable v1-56) draw light-index)) ) ) ) - obj + this ) -(defmethod initialize-allocations collectable ((obj collectable)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify) (the-as handle #f)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-allocations collectable ((this collectable)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -214,20 +216,20 @@ (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) 0 (none) ) ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod initialize-effects collectable ((obj collectable) (arg0 pickup-type)) +(defmethod initialize-effects collectable ((this collectable) (arg0 pickup-type)) (let ((s5-0 (the-as sparticle-launch-group #f)) (s4-0 (the-as sound-spec #f)) ) - (set! (-> obj fact pickup-type) arg0) - (case (-> obj fact pickup-type) + (set! (-> this fact pickup-type) arg0) + (case (-> this fact pickup-type) (((pickup-type eco-blue) (pickup-type eco-red) (pickup-type eco-green) @@ -236,62 +238,62 @@ (pickup-type eco-pill-dark) (pickup-type trick-point) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) ) ) (case arg0 (((pickup-type eco-yellow)) (set! s5-0 (-> *part-group-id-table* 108)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 115)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 109)) + (set! (-> this collect-effect) (-> *part-group-id-table* 115)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 109)) (set! s4-0 (static-sound-spec "yel-eco-idle" :fo-max 15)) ) (((pickup-type eco-red)) (set! s5-0 (-> *part-group-id-table* 102)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 116)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 103)) + (set! (-> this collect-effect) (-> *part-group-id-table* 116)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 103)) (set! s4-0 (static-sound-spec "red-eco-idle" :fo-max 15)) ) (((pickup-type eco-blue)) (set! s5-0 (-> *part-group-id-table* 98)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 114)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 99)) + (set! (-> this collect-effect) (-> *part-group-id-table* 114)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 99)) (set! s4-0 (static-sound-spec "blue-eco-idle" :fo-max 15)) ) (((pickup-type eco-green)) (set! s5-0 (-> *part-group-id-table* 83)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 93)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 79)) + (set! (-> this collect-effect) (-> *part-group-id-table* 93)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 79)) (set! s4-0 (static-sound-spec "green-eco-idle" :fo-max 15)) ) (((pickup-type health)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-health" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-37 (-> (the-as collide-shape (-> obj root)) root-prim local-sphere))) + (let ((v1-37 (-> (the-as collide-shape (-> this root)) root-prim local-sphere))) (set! (-> v1-37 y) 2457.6) (set! (-> v1-37 w) 4096.0) ) - (set! (-> obj collect-effect) (-> *part-group-id-table* 93)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 79)) + (set! (-> this collect-effect) (-> *part-group-id-table* 93)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 79)) (set! s4-0 (static-sound-spec "green-eco-idle" :fo-max 15)) ) (((pickup-type eco-pill-green)) (set! s5-0 (-> *part-group-id-table* 80)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 81)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 81)) ) (((pickup-type eco-pill-dark)) (set! s5-0 (-> *part-group-id-table* 82)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 92)) + (set! (-> this collect-effect) (-> *part-group-id-table* 92)) ) ) (if s5-0 - (set! (-> obj part) (create-launch-control s5-0 obj)) + (set! (-> this part) (create-launch-control s5-0 this)) ) (if s4-0 - (set! (-> obj sound) (new 'process 'ambient-sound s4-0 (-> obj root trans))) + (set! (-> this sound) (new 'process 'ambient-sound s4-0 (-> this root trans))) ) ) (none) @@ -342,57 +344,57 @@ (none) ) -(defmethod init-common collectable ((obj collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) - (set! (-> obj pickup-amount) arg2) - (set! (-> obj pickup-type) arg1) - (initialize-allocations obj) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (initialize-effects obj (-> obj fact pickup-type)) - (initialize-options obj 0 1024.0 (the-as fact-info #f)) - (update-transforms (-> obj root)) - (if (logtest? (-> obj fact options) (actor-option wait-for-task-complete)) - (go (method-of-object obj blocked)) +(defmethod init-common collectable ((this collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> this pickup-amount) arg2) + (set! (-> this pickup-type) arg1) + (initialize-allocations this) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (initialize-effects this (-> this fact pickup-type)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (if (logtest? (-> this fact options) (actor-option wait-for-task-complete)) + (go (method-of-object this blocked)) ) - (go-to-initial-state obj) + (go-to-initial-state this) (none) ) -(defmethod common-post collectable ((obj collectable)) - (let ((s5-0 (-> obj part)) - (s4-0 (-> obj root root-prim prim-core)) +(defmethod common-post collectable ((this collectable)) + (let ((s5-0 (-> this part)) + (s4-0 (-> this root root-prim prim-core)) ) - (if (nonzero? (-> obj draw)) + (if (nonzero? (-> this draw)) (ja-post) ) (if (nonzero? s5-0) (spawn s5-0 (the-as vector s4-0)) ) ) - (if (nonzero? (-> obj sound)) - (update! (-> obj sound)) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) ) 0 (none) ) -(defmethod do-pickup collectable ((obj collectable) (arg0 handle)) - (set! (-> obj pickup-handle) arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (let ((v1-3 (-> obj root root-prim))) +(defmethod do-pickup collectable ((this collectable) (arg0 handle)) + (set! (-> this pickup-handle) arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) 0 - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - (if (nonzero? (-> obj draw)) - (logior! (-> obj draw status) (draw-control-status no-draw)) + (if (nonzero? (-> this draw)) + (logior! (-> this draw status) (draw-control-status no-draw)) ) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - (case (-> obj fact pickup-type) + (case (-> this fact pickup-type) (((pickup-type eco-yellow)) (sound-play "y-eco-pickup") ) @@ -411,8 +413,8 @@ (((pickup-type eco-pill-dark)) (sound-play "pill-pickup") (when (>= (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) - (set! (-> obj collect-effect) (the-as basic 0)) - (set! (-> obj collect-effect2) (the-as basic 0)) + (set! (-> this collect-effect) (the-as basic 0)) + (set! (-> this collect-effect2) (the-as basic 0)) 0 ) ) @@ -436,7 +438,7 @@ ) ) (let ((s4-9 (handle->process arg0))) - (when (nonzero? (-> obj collect-effect)) + (when (nonzero? (-> this collect-effect)) (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s5-1 (let ((t9-21 (method-of-type part-tracker activate))) @@ -445,14 +447,14 @@ (let ((t9-22 run-function-in-process) (a0-60 s5-1) (a1-26 part-tracker-init) - (a2-11 (-> obj collect-effect)) + (a2-11 (-> this collect-effect)) (a3-10 0) (t0-8 part-tracker-track-target) (t1-8 #f) (t2-8 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root root-prim prim-core world-sphere quad)) + (set! (-> t3-0 trans quad) (-> this root root-prim prim-core world-sphere quad)) ((the-as (function object object object object object object object object none) t9-22) a0-60 a1-26 @@ -469,16 +471,16 @@ ) ) ) - (when (nonzero? (-> obj collect-effect2)) + (when (nonzero? (-> this collect-effect2)) (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s5-2 (let ((t9-24 (method-of-type part-tracker activate))) - (t9-24 (the-as part-tracker s5-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-24 (the-as part-tracker s5-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-25 run-function-in-process) (a0-63 s5-2) (a1-29 part-tracker-init) - (a2-16 (-> obj collect-effect2)) + (a2-16 (-> this collect-effect2)) (a3-12 0) (t0-9 (lambda ((arg0 part-tracker)) @@ -506,11 +508,11 @@ ) ) ) - (t1-13 (process->handle obj)) + (t1-13 (process->handle this)) (t2-9 #f) (t3-1 *launch-matrix*) ) - (set! (-> t3-1 trans quad) (-> obj root root-prim prim-core world-sphere quad)) + (set! (-> t3-1 trans quad) (-> this root root-prim prim-core world-sphere quad)) ((the-as (function object object object object object object object object none) t9-25) a0-63 a1-29 @@ -526,7 +528,7 @@ ) ) ) - (send-event (handle->process (-> obj notify)) 'notify 'pickup) + (send-event (handle->process (-> this notify)) 'notify 'pickup) 0 (none) ) @@ -607,7 +609,7 @@ ) (logior! (-> self flags) (collectable-flag suck-in)) (when (= (-> self speed w) 0.0) - (set! (-> self suck-time) (current-time)) + (set-time! (-> self suck-time)) (set! (-> self speed x) (rand-vu-float-range 327680.0 819200.0)) ) (+! (-> self speed w) (* (lerp-scale @@ -656,7 +658,7 @@ (local-vars (v0-4 object)) (when (and (or (= arg2 'touch) (= arg2 'attack)) (and (logtest? (-> self flags) (collectable-flag pickup)) - (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self collect-timeout))) + (time-elapsed? (the-as int (-> self birth-time)) (the-as time-frame (-> self collect-timeout))) (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) (send-event arg0 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) ) @@ -814,8 +816,8 @@ (let ((gp-0 (new 'stack 'trajectory))) (set! (-> self base y) (-> self jump-pos y)) (setup-from-to-duration! gp-0 (-> self root trans) (-> self jump-pos) 300.0 -2.2755556) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (let ((f0-2 (the float (- (current-time) (-> self state-time))))) (compute-trans-at-time gp-0 f0-2 (-> self root trans)) ) @@ -844,7 +846,7 @@ :virtual #t :event collectable-standard-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (case (-> self pickup-type) (((pickup-type gem)) (sound-play "gem-spawn") @@ -948,7 +950,7 @@ (go-virtual suck (process->handle proc)) ) (logtest? (-> self flags) (collectable-flag pickup)) - (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self collect-timeout))) + (time-elapsed? (the-as int (-> self birth-time)) (the-as time-frame (-> self collect-timeout))) ) ) (logclear! (-> self mask) (process-mask actor-pause)) @@ -975,9 +977,9 @@ (if (and (logtest? (-> self flags) (collectable-flag fadeout)) (begin (if (movie?) - (set! (-> self birth-time) (current-time)) + (set-time! (-> self birth-time)) ) - (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self fadeout-timeout))) + (time-elapsed? (the-as int (-> self birth-time)) (the-as time-frame (-> self fadeout-timeout))) ) (or (or (not *target*) (or (< 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (focus-test? *target* teleporting) @@ -1036,7 +1038,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flag pickup)) - (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self collect-timeout))) + (time-elapsed? (the-as int (-> self birth-time)) (the-as time-frame (-> self collect-timeout))) (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) ) @@ -1155,12 +1157,12 @@ ) -(defmethod initialize-allocations eco ((obj eco)) +(defmethod initialize-allocations eco ((this eco)) (let ((t9-0 (method-of-type collectable initialize-allocations))) - (t9-0 obj) + (t9-0 this) ) - (if (logtest? (-> obj fact options) (actor-option respawn-delay)) - (set! (-> obj respan-delay) (-> obj fact fade-time)) + (if (logtest? (-> this fact options) (actor-option respawn-delay)) + (set! (-> this respan-delay) (-> this fact fade-time)) ) 0 (none) @@ -1196,7 +1198,7 @@ (cond ((nonzero? (-> self respan-delay)) (let ((gp-0 (current-time))) - (while (< (- (current-time) gp-0) (the-as time-frame (-> self respan-delay))) + (while (not (time-elapsed? gp-0 (the-as time-frame (-> self respan-delay)))) (suspend) ) ) @@ -1246,14 +1248,14 @@ ) -(defmethod init-from-entity! eco-yellow ((obj eco-yellow) (arg0 entity-actor)) +(defmethod init-from-entity! eco-yellow ((this eco-yellow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) + (init-common this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1266,14 +1268,14 @@ This commonly includes things such as: ) -(defmethod init-from-entity! eco-red ((obj eco-red) (arg0 entity-actor)) +(defmethod init-from-entity! eco-red ((this eco-red) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) + (init-common this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1286,14 +1288,14 @@ This commonly includes things such as: ) -(defmethod init-from-entity! eco-blue ((obj eco-blue) (arg0 entity-actor)) +(defmethod init-from-entity! eco-blue ((this eco-blue) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) + (init-common this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1306,14 +1308,14 @@ This commonly includes things such as: ) -(defmethod init-from-entity! eco-green ((obj eco-green) (arg0 entity-actor)) +(defmethod init-from-entity! eco-green ((this eco-green) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) + (init-common this arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1326,14 +1328,14 @@ This commonly includes things such as: ) -(defmethod init-from-entity! health ((obj health) (arg0 entity-actor)) +(defmethod init-from-entity! health ((this health) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) + (init-common this arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) (none) ) @@ -1370,30 +1372,30 @@ This commonly includes things such as: ) ) -(defmethod init-from-entity! eco-pill ((obj eco-pill) (arg0 entity-actor)) +(defmethod init-from-entity! eco-pill ((this eco-pill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) + (init-common this arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) (none) ) -(defmethod deactivate eco-pill ((obj eco-pill)) +(defmethod deactivate eco-pill ((this eco-pill)) (+! (-> *game-info* live-eco-pill-count) -1) - ((method-of-type collectable deactivate) obj) + ((method-of-type collectable deactivate) this) (none) ) -(defmethod initialize-allocations eco-pill ((obj eco-pill)) +(defmethod initialize-allocations eco-pill ((this eco-pill)) (+! (-> *game-info* live-eco-pill-count) 1) - (stack-size-set! (-> obj main-thread) 128) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #f) - (set! (-> obj notify) (the-as handle #f)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1411,9 +1413,9 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) 0 (none) ) @@ -1427,59 +1429,59 @@ This commonly includes things such as: ) -(defmethod run-logic? money ((obj money)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) +(defmethod run-logic? money ((this money)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-control-status uninited))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) ) ) ) -(defmethod deactivate money ((obj money)) - (when (and (-> obj next-state) (= (-> obj next-state name) 'pickup)) - (case (-> obj pickup-type) +(defmethod deactivate money ((this money)) + (when (and (-> this next-state) (= (-> this next-state name) 'pickup)) + (case (-> this pickup-type) (((pickup-type gem)) - (if (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status save)))) - (format #t "~A ~A was killed in pickup~%" (-> obj type) (-> obj name)) + (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status save)))) + (format #t "~A ~A was killed in pickup~%" (-> this type) (-> this name)) ) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) ) (else - (if (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status dead)))) - (format #t "~A ~A was killed in pickup~%" (-> obj type) (-> obj name)) + (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status dead)))) + (format #t "~A ~A was killed in pickup~%" (-> this type) (-> this name)) ) ) ) ) - ((method-of-type collectable deactivate) obj) + ((method-of-type collectable deactivate) this) (none) ) -(defmethod common-post money ((obj money)) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* 40049.777 (seconds-per-frame))) - (let ((f30-0 (-> obj bob-amount))) +(defmethod common-post money ((this money)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) + (let ((f30-0 (-> this bob-amount))) (when (< 0.0 f30-0) - (set! (-> obj root trans y) - (+ (-> obj base y) - (-> obj suck-y-offset) + (set! (-> this root trans y) + (+ (-> this base y) + (-> this suck-y-offset) (* f30-0 (sin (* 109.22667 (the float - (mod (+ (- (current-time) (the-as int (-> obj birth-time))) (the-as time-frame (-> obj bob-offset))) 600) + (mod (+ (- (current-time) (the-as int (-> this birth-time))) (the-as time-frame (-> this bob-offset))) 600) ) ) ) ) ) ) - (update-transforms (-> obj root)) + (update-transforms (-> this root)) ) ) (ja-post) @@ -1525,9 +1527,9 @@ This commonly includes things such as: ) ) -(defmethod initialize-allocations money ((obj money)) - (stack-size-set! (-> obj main-thread) 128) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-allocations money ((this money)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1545,13 +1547,13 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify) (the-as handle #f)) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type money) 1.0)) - (let ((a0-11 (-> obj entity))) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type money) 1.0)) + (let ((a0-11 (-> this entity))) (if (when a0-11 (let ((a0-12 (-> a0-11 extra perm task))) (if a0-12 @@ -1559,35 +1561,35 @@ This commonly includes things such as: ) ) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (if (-> obj entity) - (nav-mesh-connect-from-ent obj) + (if (-> this entity) + (nav-mesh-connect-from-ent this) ) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) 0 (none) ) -(defmethod init-from-entity! money ((obj money) (arg0 entity-actor)) +(defmethod init-from-entity! money ((this money) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (initialize-allocations obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-options obj 0 1024.0 (the-as fact-info #f)) - (update-transforms (-> obj root)) - (go-to-initial-state obj) + (initialize-allocations this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) (none) ) @@ -1664,19 +1666,19 @@ This commonly includes things such as: ) -(defmethod deactivate gem ((obj gem)) +(defmethod deactivate gem ((this gem)) (+! (-> *game-info* live-gem-count) -1) - ((the-as (function gem none) (find-parent-method gem 10)) obj) + ((the-as (function gem none) (find-parent-method gem 10)) this) (none) ) -(defmethod common-post gem ((obj gem)) - (seek! (-> obj roty-speed) 20024.889 (* 65536.0 (seconds-per-frame))) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* (-> obj roty-speed) (seconds-per-frame))) - (logclear! (-> obj draw status) (draw-control-status no-draw-temp uninited)) - (do-joint-math (-> obj draw) (-> obj node-list) (-> obj skel)) - (let ((a0-7 (-> obj part)) - (a1-3 (-> obj draw skeleton bones 3)) +(defmethod common-post gem ((this gem)) + (seek! (-> this roty-speed) 20024.889 (* 65536.0 (seconds-per-frame))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* (-> this roty-speed) (seconds-per-frame))) + (logclear! (-> this draw status) (draw-control-status no-draw-temp uninited)) + (do-joint-math (-> this draw) (-> this node-list) (-> this skel)) + (let ((a0-7 (-> this part)) + (a1-3 (-> this draw skeleton bones 3)) ) (if (nonzero? a0-7) (spawn-with-matrix a0-7 (the-as matrix a1-3)) @@ -1788,12 +1790,12 @@ This commonly includes things such as: ) ) (if (or (and (logtest? s5-2 (collide-status on-surface)) (< (vector-length (-> gp-1 transv)) 1228.8)) - (>= (- (current-time) (-> self state-time)) (seconds 10)) + (time-elapsed? (-> self state-time) (seconds 10)) ) (go-virtual wait) ) - (when (>= (- (current-time) (the-as int (-> self bounce-time))) (seconds 0.1)) - (set! (-> self bounce-time) (current-time)) + (when (time-elapsed? (the-as int (-> self bounce-time)) (seconds 0.1)) + (set-time! (-> self bounce-time)) (sound-play-by-name (static-sound-name "gem-bounce") (new-sound-id) @@ -1805,7 +1807,7 @@ This commonly includes things such as: ) ) ) - ((>= (- (current-time) (-> self state-time)) (seconds 15)) + ((time-elapsed? (-> self state-time) (seconds 15)) (go-virtual wait) ) ) @@ -1815,10 +1817,10 @@ This commonly includes things such as: ) ) -(defmethod initialize-allocations gem ((obj gem)) +(defmethod initialize-allocations gem ((this gem)) (+! (-> *game-info* live-gem-count) 1) - (stack-size-set! (-> obj main-thread) 128) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1836,36 +1838,36 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj roty-speed) 40049.777) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (rand-vu-float-range 0.0 65536.0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #f) - (set! (-> obj notify) (the-as handle #f)) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type gem) 1.0)) - (let ((v1-22 (-> obj entity))) - (if (and (-> obj entity) + (set! (-> this roty-speed) 40049.777) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (rand-vu-float-range 0.0 65536.0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type gem) 1.0)) + (let ((v1-22 (-> this entity))) + (if (and (-> this entity) (-> v1-22 extra perm task) (= (-> v1-22 extra perm task) (game-task none)) (type-type? (-> v1-22 etype) crate) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) - (if (-> obj entity) - (nav-mesh-connect-from-ent obj) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (if (-> this entity) + (nav-mesh-connect-from-ent this) ) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 86) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 87)) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 86) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 87)) 0 (none) ) @@ -1896,9 +1898,9 @@ This commonly includes things such as: (if (and (logtest? (-> self flags) (collectable-flag fadeout)) (begin (if (movie?) - (set! (-> self birth-time) (current-time)) + (set-time! (-> self birth-time)) ) - (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self fadeout-timeout))) + (time-elapsed? (the-as int (-> self birth-time)) (the-as time-frame (-> self fadeout-timeout))) ) ) (go-virtual fade) @@ -1910,9 +1912,9 @@ This commonly includes things such as: ) ) -(defmethod initialize-allocations skill ((obj skill)) - (stack-size-set! (-> obj main-thread) 128) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-allocations skill ((this skill)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1930,13 +1932,13 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify) (the-as handle #f)) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type skill) 1.0)) - (let ((a0-11 (-> obj entity))) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type skill) 1.0)) + (let ((a0-11 (-> this entity))) (if (when a0-11 (let ((a0-12 (-> a0-11 extra perm task))) (if a0-12 @@ -1944,26 +1946,26 @@ This commonly includes things such as: ) ) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-skill" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw shadow-ctrl) *collectable-dummy-shadow-control*) - (if (-> obj entity) - (nav-mesh-connect-from-ent obj) + (set! (-> this draw shadow-ctrl) *collectable-dummy-shadow-control*) + (if (-> this entity) + (nav-mesh-connect-from-ent this) ) (cond - ((>= (-> obj pickup-amount) (-> *FACT-bank* super-skill-inc)) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.0 1.0) - (set-vector! (-> obj draw color-emissive) 0.0 1.0 0.2 1.0) + ((>= (-> this pickup-amount) (-> *FACT-bank* super-skill-inc)) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 1.0 0.2 1.0) ) (else - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) ) ) 0 @@ -1996,9 +1998,9 @@ This commonly includes things such as: ) -(defmethod initialize-allocations trick-point ((obj trick-point)) - (stack-size-set! (-> obj main-thread) 128) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-allocations trick-point ((this trick-point)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2016,31 +2018,31 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify) (the-as handle #f)) - (set! (-> obj root pause-adjust-distance) 204800.0) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type trick-point) 100.0)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 94) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 95)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this root pause-adjust-distance) 204800.0) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type trick-point) 100.0)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 94) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 95)) 0 (none) ) -(defmethod init-from-entity! trick-point ((obj trick-point) (arg0 entity-actor)) +(defmethod init-from-entity! trick-point ((this trick-point) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (initialize-allocations obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-options obj 0 1024.0 (the-as fact-info #f)) - (update-transforms (-> obj root)) - (go-to-initial-state obj) + (initialize-allocations this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) (none) ) @@ -2054,12 +2056,12 @@ This commonly includes things such as: ) -(defmethod initialize-allocations ammo-collectable ((obj ammo-collectable)) - (stack-size-set! (-> obj main-thread) 128) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #f) - (set! (-> obj notify) (the-as handle #f)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-allocations ammo-collectable ((this ammo-collectable)) + (stack-size-set! (-> this main-thread) 128) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2077,22 +2079,22 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (rand-vu-float-range 0.0 65536.0)) - (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) - (case (-> obj pickup-type) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (rand-vu-float-range 0.0 65536.0)) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + (case (-> this pickup-type) (((pickup-type ammo-yellow)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 88)) + (set! (-> this collect-effect) (-> *part-group-id-table* 88)) ) (((pickup-type ammo-red)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 89)) + (set! (-> this collect-effect) (-> *part-group-id-table* 89)) ) (((pickup-type ammo-blue)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 90)) + (set! (-> this collect-effect) (-> *part-group-id-table* 90)) ) (((pickup-type ammo-dark)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 91)) + (set! (-> this collect-effect) (-> *part-group-id-table* 91)) ) ) 0 @@ -2100,91 +2102,91 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod initialize-effects ammo-collectable ((obj ammo-collectable) (arg0 pickup-type)) - (set! (-> obj fact pickup-type) arg0) +(defmethod initialize-effects ammo-collectable ((this ammo-collectable) (arg0 pickup-type)) + (set! (-> this fact pickup-type) arg0) (case arg0 (((pickup-type ammo-yellow)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 2.5 2.5 2.5 1.0) - (set! (-> obj ammo-effect) (-> *part-group-id-table* 108)) + (set-vector! (-> this root scale) 2.5 2.5 2.5 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 108)) ) (((pickup-type ammo-red)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 4.0 4.0 4.0 1.0) - (set! (-> obj ammo-effect) (-> *part-group-id-table* 102)) + (set-vector! (-> this root scale) 4.0 4.0 4.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 102)) ) (((pickup-type ammo-blue)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 4.0 4.0 4.0 1.0) - (set! (-> obj ammo-effect) (-> *part-group-id-table* 98)) + (set-vector! (-> this root scale) 4.0 4.0 4.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 98)) ) (((pickup-type ammo-dark)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 3.0 3.0 3.0 1.0) - (set! (-> obj ammo-effect) (-> *part-group-id-table* 83)) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 83)) ) (((pickup-type gun-yellow)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-yellow-up" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 3.0 3.0 3.0 1.0) - (logclear! (-> obj flags) (collectable-flag fadeout)) - (let ((v1-34 (-> obj node-list data))) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) + (let ((v1-34 (-> this node-list data))) (set! (-> v1-34 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) - (set! (-> v1-34 0 param1) (the-as basic (-> obj root trans))) - (set! (-> v1-34 0 param2) (the-as basic (-> obj extra-trans))) + (set! (-> v1-34 0 param1) (the-as basic (-> this root trans))) + (set! (-> v1-34 0 param2) (the-as basic (-> this extra-trans))) ) - (set-vector! (-> obj extra-trans) 0.0 1638.4 0.0 1.0) + (set-vector! (-> this extra-trans) 0.0 1638.4 0.0 1.0) ) (((pickup-type gun-dark)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-dark-up" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 3.0 3.0 3.0 1.0) - (logclear! (-> obj flags) (collectable-flag fadeout)) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) ) (((pickup-type board)) - (process-entity-set! obj (the-as entity #f)) + (process-entity-set! this (the-as entity #f)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-board" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) - (let ((v1-48 (-> obj skel root-channel 0))) - (set! (-> v1-48 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((v1-48 (-> this skel root-channel 0))) + (set! (-> v1-48 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) ) - (set-vector! (-> obj root scale) 2.0 2.0 2.0 1.0) - (let ((v1-52 (-> obj node-list data))) + (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) + (let ((v1-52 (-> this node-list data))) (set! (-> v1-52 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) - (set! (-> v1-52 0 param1) (the-as basic (-> obj root trans))) - (set! (-> v1-52 0 param2) (the-as basic (-> obj extra-trans))) + (set! (-> v1-52 0 param1) (the-as basic (-> this root trans))) + (set! (-> v1-52 0 param2) (the-as basic (-> this extra-trans))) ) - (set-vector! (-> obj extra-trans) 0.0 2048.0 0.0 1.0) - (logclear! (-> obj flags) (collectable-flag fadeout)) + (set-vector! (-> this extra-trans) 0.0 2048.0 0.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) ) (((pickup-type shield)) - (set! (-> obj ammo-effect) (-> *part-group-id-table* 80)) + (set! (-> this ammo-effect) (-> *part-group-id-table* 80)) ) (((pickup-type trick-point)) ) @@ -2214,21 +2216,21 @@ This commonly includes things such as: (none) ) -(defmethod init-common ammo-collectable ((obj ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) - (set! (-> obj pickup-amount) arg2) - (set! (-> obj pickup-type) arg1) - (initialize-allocations obj) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (initialize-effects obj (-> obj fact pickup-type)) - (initialize-options obj 0 1024.0 (the-as fact-info #f)) - (update-transforms (-> obj root)) - (go-to-initial-state obj) +(defmethod init-common ammo-collectable ((this ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> this pickup-amount) arg2) + (set! (-> this pickup-type) arg1) + (initialize-allocations this) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (initialize-effects this (-> this fact pickup-type)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) (none) ) -(defmethod common-post ammo-collectable ((obj ammo-collectable)) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* 40049.777 (seconds-per-frame))) - ((method-of-type collectable common-post) obj) +(defmethod common-post ammo-collectable ((this ammo-collectable)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) + ((method-of-type collectable common-post) this) 0 (none) ) @@ -2299,52 +2301,52 @@ This commonly includes things such as: (none) ) -(defmethod init-from-entity! eco ((obj eco) (arg0 entity-actor)) +(defmethod init-from-entity! eco ((this eco) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((v1-1 (res-lump-value (-> obj entity) 'eco-info uint128 :time -1000000000.0))) - (set! (-> obj type) (cond - ((= (the-as uint v1-1) 3) - eco-blue - ) - ((= (the-as uint v1-1) 2) - eco-red - ) - ((= (the-as uint v1-1) 1) - eco-yellow - ) - ((= (the-as uint v1-1) 5) - eco-green - ) - ((= (the-as uint v1-1) 18) - health - ) - ((= (the-as uint v1-1) 9) - money - ) - ((= (the-as uint v1-1) 19) - trick-point - ) - ((= (the-as uint v1-1) 21) - gem - ) - ((= (the-as uint v1-1) 22) - skill - ) - ((= (the-as uint v1-1) 10) - fuel-cell - ) - (else - eco-pill + (let ((v1-1 (res-lump-value (-> this entity) 'eco-info uint128 :time -1000000000.0))) + (set! (-> this type) (cond + ((= (the-as uint v1-1) 3) + eco-blue ) - ) + ((= (the-as uint v1-1) 2) + eco-red + ) + ((= (the-as uint v1-1) 1) + eco-yellow + ) + ((= (the-as uint v1-1) 5) + eco-green + ) + ((= (the-as uint v1-1) 18) + health + ) + ((= (the-as uint v1-1) 9) + money + ) + ((= (the-as uint v1-1) 19) + trick-point + ) + ((= (the-as uint v1-1) 21) + gem + ) + ((= (the-as uint v1-1) 22) + skill + ) + ((= (the-as uint v1-1) 10) + fuel-cell + ) + (else + eco-pill + ) + ) ) ) - (init-from-entity! obj arg0) + (init-from-entity! this arg0) (none) ) @@ -2534,9 +2536,9 @@ This commonly includes things such as: sv-40 ) -(defmethod drop-pickup fact-info ((obj fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) - (let ((s2-0 (-> obj pickup-type)) - (f30-0 (-> obj pickup-amount)) +(defmethod drop-pickup fact-info ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) + (let ((s2-0 (-> this pickup-type)) + (f30-0 (-> this pickup-amount)) ) (when (= s2-0 (pickup-type ammo-random)) (let ((s2-1 (-> *game-info* features))) @@ -2658,7 +2660,7 @@ This commonly includes things such as: ((< 10 (-> *game-info* live-eco-pill-count)) 1.0 ) - ((type? obj fact-info-enemy) + ((type? this fact-info-enemy) (+ (rand-vu-float-range 3.0 (+ 5.0 f30-0)) (the float arg3)) ) (else @@ -2668,7 +2670,7 @@ This commonly includes things such as: ) ) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> obj process)) root trans quad)) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) (set-vector! (-> s3-1 move-dist) 0.0 -81920.0 0.0 1.0) (+! (-> s3-1 start-pos y) 12288.0) (let ((v1-75 s3-1)) @@ -2681,12 +2683,12 @@ This commonly includes things such as: ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-1) 0.0) (set! (-> s3-1 start-pos quad) (-> s3-1 best-other-tri intersect quad)) - (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> obj process)) root trans quad)) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) ) (if (= s2-0 (pickup-type fuel-cell)) (+! (-> s3-1 start-pos y) 6144.0) ) - (birth-pickup-at-point (-> s3-1 start-pos) s2-0 f30-0 arg0 arg1 obj) + (birth-pickup-at-point (-> s3-1 start-pos) s2-0 f30-0 arg0 arg1 this) ) ) ) diff --git a/goal_src/jak2/engine/common_objs/conveyor.gc b/goal_src/jak2/engine/common_objs/conveyor.gc index 6dbfff7e29..d0fd988a80 100644 --- a/goal_src/jak2/engine/common_objs/conveyor.gc +++ b/goal_src/jak2/engine/common_objs/conveyor.gc @@ -58,42 +58,42 @@ ;; WARN: Return type mismatch process-drawable vs conveyor. -(defmethod relocate conveyor ((obj conveyor) (new-addr int)) - (&+! (-> obj sections) new-addr) +(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)) obj new-addr) + ((the-as (function process-drawable int process-drawable) (find-parent-method conveyor 7)) this new-addr) ) ) ;; WARN: Return type mismatch symbol vs art-group. -(defmethod get-art-group conveyor ((obj conveyor)) +(defmethod get-art-group conveyor ((this conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (go process-drawable-art-error "invalid type") (the-as art-group #f) ) -(defmethod reset-root! conveyor ((obj conveyor)) +(defmethod reset-root! conveyor ((this conveyor)) "Re-initializes the `root` [[trsqv]]" - (set! (-> obj root) (new 'process 'trsqv)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod init! conveyor ((obj conveyor)) +(defmethod init! conveyor ((this conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (local-vars (tag res-tag)) - (set! (-> obj speed) 24576.0) - (set! (-> obj belt-radius) 11878.4) - (set! (-> obj pull-y-threshold) 10240.0) - (set! (-> obj speed-mult-array) #f) - (set! (-> obj speed-mult-array-len) 0) - (let ((entity (-> obj entity))) + (set! (-> this speed) 24576.0) + (set! (-> this belt-radius) 11878.4) + (set! (-> this pull-y-threshold) 10240.0) + (set! (-> this speed-mult-array) #f) + (set! (-> this speed-mult-array-len) 0) + (let ((entity (-> this entity))) (set! tag (new 'static 'res-tag)) (let ((scale-factor (res-lump-data entity 'scale-factor pointer :tag-ptr (& tag)))) (when scale-factor - (set! (-> obj speed-mult-array) (the-as (array float) scale-factor)) - (set! (-> obj speed-mult-array-len) (the-as int (-> tag elt-count))) + (set! (-> this speed-mult-array) (the-as (array float) scale-factor)) + (set! (-> this speed-mult-array-len) (the-as int (-> tag elt-count))) ) ) ) @@ -102,24 +102,24 @@ ) ;; WARN: Return type mismatch object vs ambient-sound. -(defmethod set-and-get-ambient-sound! conveyor ((obj conveyor)) +(defmethod set-and-get-ambient-sound! conveyor ((this conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" - (let ((actor-options (res-lump-value (-> obj entity) 'options actor-option :time -1000000000.0))) + (let ((actor-options (res-lump-value (-> this entity) 'options actor-option :time -1000000000.0))) (the-as ambient-sound (cond ((not (logtest? (actor-option no-amb-sound) actor-options)) (let ((sound - (the-as object (new 'process 'ambient-sound (static-sound-spec "conveyor" :fo-max 80) (-> obj root trans))) + (the-as object (new 'process 'ambient-sound (static-sound-spec "conveyor" :fo-max 80) (-> this root trans))) ) ) - (set! (-> obj sound) (the-as ambient-sound sound)) + (set! (-> this sound) (the-as ambient-sound sound)) sound ) ) (else - (set! (-> obj sound) (the-as ambient-sound 0)) + (set! (-> this sound) (the-as ambient-sound 0)) 0 ) ) @@ -127,13 +127,13 @@ and return it as well. Otherwise, set it to `0`" ) ) -(defmethod conveyor-method-26 conveyor ((obj conveyor) (proc-focus process-focusable)) +(defmethod conveyor-method-26 conveyor ((this conveyor) (proc-focus process-focusable)) "TODO - conveyor section related, perhaps related to moving the process along the belt?" (let ((vec (new 'stack-no-clear 'vector))) (set! (-> vec quad) (-> (get-trans proc-focus 0) quad)) (set! (-> vec w) 1.0) - (when (>= (vector4-dot vec (the-as vector (-> obj leading))) 0.0) - (let* ((sections (-> obj sections)) + (when (>= (vector4-dot vec (the-as vector (-> this leading))) 0.0) + (let* ((sections (-> this sections)) (section-count (-> sections length)) ) (dotimes (section-idx section-count) @@ -141,16 +141,16 @@ and return it as well. Otherwise, set it to `0`" (when (< (vector4-dot vec (the-as vector (-> section trailing))) 0.0) (let ((vec-temp (new 'stack-no-clear 'vector))) (vector-! vec-temp vec (-> section start)) - (when (>= (-> obj belt-radius) (fabs (vector-dot vec-temp (-> section radial-dir)))) + (when (>= (-> this belt-radius) (fabs (vector-dot vec-temp (-> section radial-dir)))) (let* ((f0-7 (vector-dot vec-temp (-> section pull-dir))) (f1-6 (- (-> vec-temp y) (* (-> section pull-dir y) f0-7))) ) - (when (>= (-> obj pull-y-threshold) (fabs f1-6)) + (when (>= (-> this pull-y-threshold) (fabs f1-6)) (let ((a2-8 (new 'stack-no-clear 'vector))) - (let ((f0-10 (-> obj speed))) - (if (< section-idx (-> obj speed-mult-array-len)) + (let ((f0-10 (-> this speed))) + (if (< section-idx (-> this speed-mult-array-len)) (set! f0-10 - (* f0-10 (-> (the-as (pointer float) (+ (the-as uint (-> obj speed-mult-array)) (* section-idx 4))))) + (* f0-10 (-> (the-as (pointer float) (+ (the-as uint (-> this speed-mult-array)) (* section-idx 4))))) ) ) (vector-float*! a2-8 (-> section pull-dir) (* f0-10 (seconds-per-frame))) @@ -171,7 +171,7 @@ and return it as well. Otherwise, set it to `0`" ) ) -(defmethod conveyor-method-27 conveyor ((obj conveyor)) +(defmethod conveyor-method-27 conveyor ((this conveyor)) "TODO - collision related, has some dead code as well (previous iteration?)" (local-vars (a0-10 float) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) @@ -184,7 +184,7 @@ and return it as well. Otherwise, set it to `0`" (init-vf0-vector) (set! *actor-list-length* 0) (if #t - (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* (-> obj collide-bounds) *actor-list* 256)) + (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* (-> this collide-bounds) *actor-list* 256)) ) (when #t (let ((a0-2 (-> *collide-player-list* alive-list next0))) @@ -197,7 +197,7 @@ and return it as well. Otherwise, set it to `0`" (when (logtest? (-> a1-1 prim-core collide-as) (collide-spec jak bot enemy hit-by-others-list player-list)) (let ((a1-2 (-> a1-1 prim-core))) (let ((a2-4 a1-2) - (a3-1 (-> obj collide-bounds)) + (a3-1 (-> this collide-bounds)) ) (.lvf vf2 (&-> a2-4 world-sphere quad)) (.lvf vf3 (&-> a3-1 quad)) @@ -208,7 +208,7 @@ and return it as well. Otherwise, set it to `0`" (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-5 vf1) (let ((f0-0 a2-5) - (f1-1 (+ (-> a1-2 world-sphere w) (-> obj collide-bounds r))) + (f1-1 (+ (-> a1-2 world-sphere w) (-> this collide-bounds r))) ) (b! (>= f0-0 (* f1-1 f1-1)) cfg-8 :delay #f) ) @@ -238,7 +238,7 @@ and return it as well. Otherwise, set it to `0`" (when (logtest? (-> a1-13 prim-core collide-as) (collide-spec jak bot enemy hit-by-others-list player-list)) (let ((a1-14 (-> a1-13 prim-core))) (let ((a2-11 a1-14) - (a3-2 (-> obj collide-bounds)) + (a3-2 (-> this collide-bounds)) ) (.lvf vf2 (&-> a2-11 world-sphere quad)) (.lvf vf3 (&-> a3-2 quad)) @@ -249,7 +249,7 @@ and return it as well. Otherwise, set it to `0`" (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-12 vf1) (let ((f0-1 a2-12) - (f1-5 (+ (-> a1-14 world-sphere w) (-> obj collide-bounds r))) + (f1-5 (+ (-> a1-14 world-sphere w) (-> this collide-bounds r))) ) (b! (>= f0-1 (* f1-5 f1-5)) cfg-17 :delay #f) ) @@ -273,7 +273,7 @@ and return it as well. Otherwise, set it to `0`" (a0-9 (-> v1-23 root-prim)) ) (when (logtest? (-> a0-9 prim-core collide-as) (collide-spec jak bot enemy hit-by-others-list player-list)) - (.lvf vf1 (&-> obj collide-bounds quad)) + (.lvf vf1 (&-> this collide-bounds quad)) (.lvf vf2 (&-> a0-9 prim-core world-sphere quad)) (.sub.vf vf3 vf1 vf2) (.add.w.vf vf4 vf1 vf2 :mask #b1000) @@ -294,7 +294,7 @@ and return it as well. Otherwise, set it to `0`" ) ) (if a1-29 - (conveyor-method-26 obj a1-29) + (conveyor-method-26 this a1-29) ) ) ) @@ -308,25 +308,25 @@ and return it as well. Otherwise, set it to `0`" ) ) -(defmethod conveyor-method-21 conveyor ((obj conveyor)) +(defmethod conveyor-method-21 conveyor ((this conveyor)) "TODO - quite dense, has to do with the conveyor sections and the path they are associated with" (local-vars (sv-32 conveyor-section) (sv-48 conveyor-section)) - (let* ((s5-0 (-> obj path)) + (let* ((s5-0 (-> this path)) (s4-0 (-> s5-0 curve num-cverts)) (s3-0 (new 'stack-no-clear 'vector)) ) (let ((s2-0 (new 'process 'conveyor-section-array (+ s4-0 -1)))) - (set! (-> obj sections) s2-0) - (set! (-> obj collide-bounds quad) (the-as uint128 0)) + (set! (-> this sections) s2-0) + (set! (-> this collide-bounds quad) (the-as uint128 0)) (get-point-in-path! s5-0 s3-0 0.0 'exact) - (vector+! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) s3-0) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (let ((s1-0 (+ s4-0 -1))) (set! sv-32 (the-as conveyor-section #f)) (dotimes (s0-0 s1-0) (set! sv-48 (-> s2-0 data s0-0)) (set! (-> sv-48 start quad) (-> s3-0 quad)) (get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'exact) - (vector+! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) s3-0) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start)) (vector-normalize! (-> sv-48 pull-dir) 1.0) (set! (-> sv-48 trailing quad) (-> sv-48 pull-dir quad)) @@ -344,25 +344,25 @@ and return it as well. Otherwise, set it to `0`" ) ) ) - (let ((s2-1 (-> obj sections data))) - (set! (-> obj leading quad) (-> s2-1 0 pull-dir quad)) - (set! (-> obj leading y) 0.0) - (vector-normalize! (-> obj leading) 1.0) - (set! (-> obj leading w) (- (vector-dot (the-as vector (-> s2-1 0)) (the-as vector (-> obj leading))))) + (let ((s2-1 (-> this sections data))) + (set! (-> this leading quad) (-> s2-1 0 pull-dir quad)) + (set! (-> this leading y) 0.0) + (vector-normalize! (-> this leading) 1.0) + (set! (-> this leading w) (- (vector-dot (the-as vector (-> s2-1 0)) (the-as vector (-> this leading))))) ) (let ((f0-19 (/ 1.0 (the float s4-0))) (f30-0 0.0) ) - (vector-float*! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) f0-19) + (vector-float*! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) f0-19) (dotimes (s2-2 s4-0) (get-point-in-path! s5-0 s3-0 (the float s2-2) 'exact) - (let ((f0-22 (vector-vector-distance-squared s3-0 (-> obj collide-bounds)))) + (let ((f0-22 (vector-vector-distance-squared s3-0 (-> this collide-bounds)))) (if (< f30-0 f0-22) (set! f30-0 f0-22) ) ) ) - (set! (-> obj collide-bounds r) (+ (sqrtf f30-0) (-> obj belt-radius))) + (set! (-> this collide-bounds r) (+ (sqrtf f30-0) (-> this belt-radius))) ) ) ) @@ -379,26 +379,26 @@ and return it as well. Otherwise, set it to `0`" ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! conveyor ((obj conveyor) (arg0 entity-actor)) +(defmethod init-from-entity! conveyor ((this conveyor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (reset-root! obj) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group (get-art-group obj)) (the-as pair 0)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (if (< (-> obj path curve num-cverts) 2) + (reset-root! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-art-group this)) (the-as pair 0)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) - (init! obj) - (set-and-get-ambient-sound! obj) - (conveyor-method-21 obj) + (init! this) + (set-and-get-ambient-sound! this) + (conveyor-method-21 this) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -416,7 +416,7 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 36) ) -(defmethod get-art-group strip-conveyor ((obj strip-conveyor)) +(defmethod get-art-group strip-conveyor ((this strip-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-strip-conveyor" (the-as (pointer uint32) #f)) ) @@ -437,17 +437,17 @@ This commonly includes things such as: :origin-joint-index 3 ) -(defmethod get-art-group lgconveyor ((obj lgconveyor)) +(defmethod get-art-group lgconveyor ((this lgconveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-lgconveyor" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch float vs none. -(defmethod init! lgconveyor ((obj lgconveyor)) +(defmethod init! lgconveyor ((this lgconveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj speed) 30720.0) - (set! (-> obj belt-radius) 11878.4) - (set! (-> obj pull-y-threshold) 10240.0) + (set! (-> this speed) 30720.0) + (set! (-> this belt-radius) 11878.4) + (set! (-> this pull-y-threshold) 10240.0) (none) ) diff --git a/goal_src/jak2/engine/common_objs/crates.gc b/goal_src/jak2/engine/common_objs/crates.gc index 731a9cf337..dcc7b1f816 100644 --- a/goal_src/jak2/engine/common_objs/crates.gc +++ b/goal_src/jak2/engine/common_objs/crates.gc @@ -847,7 +847,7 @@ ) (when (not arg0) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) (seconds 0.04)) + (until (time-elapsed? s5-1 (seconds 0.04)) (suspend) ) ) @@ -1002,13 +1002,13 @@ (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status subtask-complete) #t) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 5)) + (until (time-elapsed? gp-1 (seconds 5)) (suspend) ) ) (when (logtest? (actor-option cond-respawn) (-> self fact options)) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 15)) + (until (time-elapsed? gp-2 (seconds 15)) (suspend) ) ) @@ -1107,25 +1107,25 @@ (none) ) -(defmethod init-from-entity! crate ((obj crate) (arg0 entity-actor)) +(defmethod init-from-entity! crate ((this crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (crate-init! obj arg0) - (skel-init! obj) - (crate-method-38 obj) + (crate-init! this arg0) + (skel-init! this) + (crate-method-38 this) (none) ) ;; WARN: Return type mismatch crate vs none. -(defmethod crate-init! crate ((obj crate) (arg0 entity-actor)) +(defmethod crate-init! crate ((this crate) (arg0 entity-actor)) "Initialize the [[crate]] with the specified [[entity-actor]]." - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask crate)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask crate)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1167,29 +1167,29 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj fact) - (new 'process 'fact-info-crate obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this fact) + (new 'process 'fact-info-crate this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (when (-> obj entity) - (let ((v1-22 (-> obj entity extra perm))) - (set! (-> obj fact pickup-amount) - (fmax 0.0 (- (-> obj fact pickup-amount) (the float (-> v1-22 user-int8 1)))) + (when (-> this entity) + (let ((v1-22 (-> this entity extra perm))) + (set! (-> this fact pickup-amount) + (fmax 0.0 (- (-> this fact pickup-amount) (the float (-> v1-22 user-int8 1)))) ) ) ) - (when (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (set! (-> obj fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> obj fact pickup-amount) 0.0) + (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (set! (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-amount) 0.0) ) (when arg0 - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) ) (let ((v1-37 ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'crate-type 'interp -1000000000.0 @@ -1199,136 +1199,136 @@ This commonly includes things such as: ) ) ) - (set! (-> obj look) (the-as symbol v1-37)) - (set! (-> obj defense) (the-as symbol v1-37)) + (set! (-> this look) (the-as symbol v1-37)) + (set! (-> this defense) (the-as symbol v1-37)) ) - (set! (-> obj carry) - (new 'process 'carry-info obj 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0) + (set! (-> this carry) + (new 'process 'carry-info this 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0) ) - (set! (-> obj carry max-pull) 3686.4) - (set! (-> obj carry carry-radius) 3276.8) - (set! (-> obj target) (the-as handle #f)) + (set! (-> this carry max-pull) 3686.4) + (set! (-> this carry carry-radius) 3276.8) + (set! (-> this target) (the-as handle #f)) (none) ) ;; WARN: Return type mismatch crate vs none. -(defmethod skel-init! crate ((obj crate)) +(defmethod skel-init! crate ((this crate)) "Initialize the [[crate]]'s skeleton and other parameters based on the crate type." - (case (-> obj look) + (case (-> this look) (('iron) - (set! (-> (the-as collide-shape-moving (-> obj root)) penetrated-by) + (set! (-> (the-as collide-shape-moving (-> this root)) penetrated-by) (penetrate flop uppercut tube vehicle flut-attack board dark-skin explode) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) (('steel) - (set! (-> (the-as collide-shape-moving (-> obj root)) penetrated-by) + (set! (-> (the-as collide-shape-moving (-> this root)) penetrated-by) (penetrate tube vehicle flut-attack board dark-skin explode) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) (('darkeco) - (when (= (-> obj fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> obj fact pickup-type) (pickup-type none)) - (set! (-> obj fact pickup-amount) 0.0) + (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) ) (('none) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw)) + (logior! (-> this draw status) (draw-control-status no-draw)) ) (else (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) ) - (set! (-> obj base quad) (-> obj root trans quad)) + (set! (-> this base quad) (-> this root trans quad)) (crate-post) - (nav-mesh-connect-from-ent obj) + (nav-mesh-connect-from-ent this) (none) ) ;; WARN: Return type mismatch crate vs none. -(defmethod params-set! crate ((obj crate) (arg0 symbol) (arg1 symbol)) +(defmethod params-set! crate ((this crate) (arg0 symbol) (arg1 symbol)) "Set [[crate]] params based on the arguments." (if arg0 - (set! (-> obj look) arg0) + (set! (-> this look) arg0) ) (if arg1 - (set! (-> obj defense) arg1) + (set! (-> this defense) arg1) ) (none) ) -(defmethod crate-method-38 crate ((obj crate)) - (when (-> obj entity) - (if (>= (-> obj entity extra perm user-int8 0) 1) - (go (method-of-object obj die) #t 0) +(defmethod crate-method-38 crate ((this crate)) + (when (-> this entity) + (if (>= (-> this entity extra perm user-int8 0) 1) + (go (method-of-object this die) #t 0) ) ) (cond - ((logtest? (actor-option cond-hide) (-> obj fact options)) - (go (method-of-object obj hide)) + ((logtest? (actor-option cond-hide) (-> this fact options)) + (go (method-of-object this hide)) ) - ((logtest? (actor-option fall) (-> obj fact options)) - (go (method-of-object obj fall)) + ((logtest? (actor-option fall) (-> this fact options)) + (go (method-of-object this fall)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) 0 (none) ) -(defmethod smush-update! crate ((obj crate)) - (let ((f0-0 (update! (-> obj smush)))) - (set! (-> obj root scale x) (+ 1.0 (* -0.5 f0-0))) - (set! (-> obj root scale y) (+ 1.0 f0-0)) - (set! (-> obj root scale z) (+ 1.0 (* -0.5 f0-0))) +(defmethod smush-update! crate ((this crate)) + (let ((f0-0 (update! (-> this smush)))) + (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale y) (+ 1.0 f0-0)) + (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) ) 0 (none) ) ;; WARN: disable def twice: 57. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod crate-method-40 crate ((obj crate)) +(defmethod crate-method-40 crate ((this crate)) (cond - ((and (> (-> (the-as fact-info-crate (-> obj fact)) suck-count) 0) - (< (you-suck-stage *game-info* #f) (-> (the-as fact-info-crate (-> obj fact)) suck-count)) + ((and (> (-> (the-as fact-info-crate (-> this fact)) suck-count) 0) + (< (you-suck-stage *game-info* #f) (-> (the-as fact-info-crate (-> this fact)) suck-count)) ) #t ) - ((logtest? (actor-option cond-low-ammo) (-> obj fact options)) - (case (-> obj fact pickup-type) + ((logtest? (actor-option cond-low-ammo) (-> this fact options)) + (case (-> this fact pickup-type) (((pickup-type ammo-yellow) (pickup-type ammo-red) (pickup-type ammo-blue) (pickup-type ammo-dark)) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer self)) (set! (-> a1-4 num-params) 1) (set! (-> a1-4 message) 'test-pickup) - (set! (-> a1-4 param 0) (the-as uint (-> obj fact pickup-type))) + (set! (-> a1-4 param 0) (the-as uint (-> this fact pickup-type))) (let ((v1-15 (the-as float (send-event-function *target* a1-4)))) (or (not v1-15) (< 10.0 v1-15)) ) @@ -1356,21 +1356,21 @@ This commonly includes things such as: ;; WARN: Return type mismatch pickup-spawner vs none. -(defmethod crate-init! pickup-spawner ((obj pickup-spawner) (arg0 entity-actor)) +(defmethod crate-init! pickup-spawner ((this pickup-spawner) (arg0 entity-actor)) "Initialize the [[crate]] with the specified [[entity-actor]]." (let ((t9-0 (method-of-type crate crate-init!))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj look) 'none) - (set! (-> obj blocker) #f) - (if (logtest? (-> obj fact options) (actor-option blocked)) - (set! (-> obj blocker) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (set! (-> this look) 'none) + (set! (-> this blocker) #f) + (if (logtest? (-> this fact options) (actor-option blocked)) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) ) (none) ) -(defmethod crate-method-38 pickup-spawner ((obj pickup-spawner)) - (go (method-of-object obj idle)) +(defmethod crate-method-38 pickup-spawner ((this pickup-spawner)) + (go (method-of-object this idle)) 0 (none) ) diff --git a/goal_src/jak2/engine/common_objs/dark-eco-pool.gc b/goal_src/jak2/engine/common_objs/dark-eco-pool.gc index 7c450b2113..f662917adc 100644 --- a/goal_src/jak2/engine/common_objs/dark-eco-pool.gc +++ b/goal_src/jak2/engine/common_objs/dark-eco-pool.gc @@ -44,18 +44,18 @@ ) ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod offset! dark-eco-pool ((obj dark-eco-pool)) +(defmethod offset! dark-eco-pool ((this dark-eco-pool)) "Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`." (let ((t9-0 (method-of-type water-anim offset!))) - (t9-0 obj) + (t9-0 this) ) - (logclear! (-> obj flags) (water-flags part-water)) - (logior! (-> obj flags) (water-flags dark-eco)) - (set! (-> obj attack-event) + (logclear! (-> this flags) (water-flags part-water)) + (logior! (-> this flags) (water-flags dark-eco)) + (set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'attack-event 'interp -1000000000.0 @@ -65,26 +65,26 @@ ) ) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "eco-pool" :fo-min 30 :fo-max 50) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "eco-pool" :fo-min 30 :fo-max 50) (-> this root trans)) ) (none) ) ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! dark-eco-pool ((obj dark-eco-pool)) +(defmethod init-water! dark-eco-pool ((this dark-eco-pool)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((s5-0 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) s5-0) + (set! (-> this draw ripple) s5-0) (set! (-> s5-0 global-scale) 3072.0) (set! (-> s5-0 close-fade-dist) 163840.0) (set! (-> s5-0 far-fade-dist) 245760.0) (set! (-> s5-0 waveform) *ripple-for-dark-eco-pool*) (set! (-> s5-0 query) (new 'process 'ripple-merc-query 100)) - (case (-> obj look) + (case (-> this look) ((5) (set! (-> s5-0 waveform) *ripple-strip-dark-eco-near-lift*) ) diff --git a/goal_src/jak2/engine/common_objs/elevator.gc b/goal_src/jak2/engine/common_objs/elevator.gc index 3c30cefd7d..8cf9853558 100644 --- a/goal_src/jak2/engine/common_objs/elevator.gc +++ b/goal_src/jak2/engine/common_objs/elevator.gc @@ -124,7 +124,7 @@ ) -(defmethod move-between-points elevator ((obj elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points elevator ((this elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -133,7 +133,7 @@ #f ) -(defmethod elevator-method-48 elevator ((obj elevator)) +(defmethod elevator-method-48 elevator ((this elevator)) "TODO - collision related" (let ((target *target*)) (when target @@ -167,68 +167,68 @@ (none) ) -(defmethod init-defaults! elevator ((obj elevator)) +(defmethod init-defaults! elevator ((this elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` - `elevator-start-pos` - `elevator-move-rate` - `elevator-flags`" - (let ((entity (-> obj entity))) - (set! (-> obj params xz-threshold) ((method-of-object entity get-property-value-float) + (let ((entity (-> this entity))) + (set! (-> this params xz-threshold) ((method-of-object entity get-property-value-float) + entity + 'elevator-xz-threshold + 'interp + -1000000000.0 + 81920.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (set! entity (-> this entity)) + (set! (-> this params y-threshold) ((method-of-object entity get-property-value-float) entity - 'elevator-xz-threshold + 'elevator-y-threshold 'interp -1000000000.0 - 81920.0 + 20480.0 (the-as (pointer res-tag) #f) *res-static-buf* ) ) - (set! entity (-> obj entity)) - (set! (-> obj params y-threshold) ((method-of-object entity get-property-value-float) - entity - 'elevator-y-threshold - 'interp - -1000000000.0 - 20480.0 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) + (set! entity (-> this entity)) + (set! (-> this params start-pos) ((method-of-object entity get-property-value-float) + entity + 'elevator-start-pos + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) ) - (set! entity (-> obj entity)) - (set! (-> obj params start-pos) ((method-of-object entity get-property-value-float) - entity - 'elevator-start-pos - 'interp - -1000000000.0 - 0.0 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) + (set! entity (-> this entity)) + (set! (-> this params move-rate) ((method-of-object entity get-property-value-float) + entity + 'elevator-move-rate + 'interp + -1000000000.0 + 25600.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) ) - (set! entity (-> obj entity)) - (set! (-> obj params move-rate) ((method-of-object entity get-property-value-float) - entity - 'elevator-move-rate - 'interp - -1000000000.0 - 25600.0 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - (set! entity (-> obj entity)) - (set! (-> obj params flags) (the-as elevator-flags ((method-of-object entity get-property-value) - entity - 'elevator-flags - 'interp - -1000000000.0 - (the-as uint128 1) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (set! entity (-> this entity)) + (set! (-> this params flags) (the-as elevator-flags ((method-of-object entity get-property-value) + entity + 'elevator-flags + 'interp + -1000000000.0 + (the-as uint128 1) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) ) 0 @@ -275,7 +275,7 @@ which is obviously useful for an elevator." (('ridden) (let ((proc-focus (handle->process (-> (the-as focus (-> event param 0)) handle)))) (if (= (-> proc-focus type) target) - (set! (-> self sticky-player-last-ride-time) (current-time)) + (set-time! (-> self sticky-player-last-ride-time)) ) ) #t @@ -401,7 +401,7 @@ which is obviously useful for an elevator." ) ) -(defmethod find-closest-point-in-path! elevator ((obj elevator) (arg0 vector) (arg1 (pointer float)) (arg2 symbol) (arg3 symbol)) +(defmethod find-closest-point-in-path! elevator ((this elevator) (arg0 vector) (arg1 (pointer float)) (arg2 symbol) (arg3 symbol)) "Finds and sets the provided [[path-step]]'s `next-pos` field to the vertex index in the path which is closest to the provided [[vector]] @@ -411,19 +411,19 @@ the provided [[vector]] @param arg3 TODO @returns [[#t]] if a point in the path was found" (local-vars (path-point vector)) - (let ((elev-params (-> obj params)) + (let ((elev-params (-> this params)) (smallest-dist 0.0) (point-idx-tracker -1.0) ) - (dotimes (path-vertex-idx (-> obj path curve num-cverts)) + (dotimes (path-vertex-idx (-> this path curve num-cverts)) (set! path-point - (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float path-vertex-idx) 'interp) + (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-vertex-idx) 'interp) ) (when (and (or (not arg2) (< (vector-vector-xz-distance path-point arg0) (-> elev-params xz-threshold))) (or (not arg3) (< (fabs (- (-> path-point y) (-> arg0 y))) (-> elev-params y-threshold)) - (and (= path-vertex-idx (the int (-> obj bottom-top 0))) (< (-> arg0 y) (-> path-point y))) - (and (= path-vertex-idx (the int (-> obj bottom-top 1))) (< (-> path-point y) (-> arg0 y))) + (and (= path-vertex-idx (the int (-> this bottom-top 0))) (< (-> arg0 y) (-> path-point y))) + (and (= path-vertex-idx (the int (-> this bottom-top 1))) (< (-> path-point y) (-> arg0 y))) ) ) (let* ((t9-2 vector-vector-distance) @@ -445,7 +445,7 @@ the provided [[vector]] ) ;; WARN: Return type mismatch object vs symbol. -(defmethod elevator-method-44 elevator ((obj elevator)) +(defmethod elevator-method-44 elevator ((this elevator)) (let* ((target-temp *target*) (target (if (type? target-temp process-focusable) target-temp @@ -454,17 +454,17 @@ the provided [[vector]] ) (the-as symbol - (and target (move-between-points obj (get-trans target 0) (-> obj move-pos 0) (-> obj move-pos 1))) + (and target (move-between-points this (get-trans target 0) (-> this move-pos 0) (-> this move-pos 1))) ) ) ) -(defmethod commited-to-ride? elevator ((obj elevator)) +(defmethod commited-to-ride? elevator ((this elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" #t ) -(defmethod move-to-next-point! elevator ((obj elevator)) +(defmethod move-to-next-point! elevator ((this elevator)) "If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path do so. @see [[elevator::47]]" @@ -477,11 +477,11 @@ do so. ) ) (set! zero (the-as float 0.0)) - (when (and (find-closest-point-in-path! obj (get-trans target 0) (& zero) #t #t) (!= (-> obj move-pos 1) zero)) - (set! (-> obj move-pos 0) (-> obj move-pos 1)) - (set! (-> obj move-pos 1) zero) - (logior! (-> obj elevator-status) (elevator-status moving)) - (go (method-of-object obj running)) + (when (and (find-closest-point-in-path! this (get-trans target 0) (& zero) #t #t) (!= (-> this move-pos 1) zero)) + (set! (-> this move-pos 0) (-> this move-pos 1)) + (set! (-> this move-pos 1) zero) + (logior! (-> this elevator-status) (elevator-status moving)) + (go (method-of-object this running)) ) ) ) @@ -537,7 +537,7 @@ do so. ) ) :enter (behavior () - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (logclear! (-> self elevator-status) (elevator-status waiting-to-descend moving)) (logior! (-> self mask) (process-mask actor-pause)) (if (nonzero? (-> self sound)) @@ -547,7 +547,7 @@ do so. :trans (behavior () (plat-trans) (when (not (logtest? (-> self elevator-status) (elevator-status waiting-to-descend))) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (-> self params) (if (and (logtest? (-> self params flags) (elevator-flags elevator-flags-0)) (not (logtest? (-> self params flags) (elevator-flags elevator-flags-3))) @@ -556,7 +556,7 @@ do so. ) ) (when (and (not (logtest? (-> self params flags) (elevator-flags elevator-flags-3))) - (>= (- (current-time) (-> self ride-timer)) (seconds 1)) + (time-elapsed? (-> self ride-timer) (seconds 1)) ) (set! (-> self move-pos 0) (-> self move-pos 1)) (set! (-> self move-pos 1) (-> self path-seq data (the int (-> self move-pos 1)) next-pos)) @@ -683,7 +683,7 @@ do so. :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('ridden) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (elevator-event proc argc message block) ) (else @@ -692,7 +692,7 @@ do so. ) ) :enter (behavior () - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (if (not (-> *setting-control* user-current jump)) (remove-setting! 'jump) ) @@ -707,10 +707,10 @@ do so. (begin *target* *target*) (focus-test? *target* in-air) ) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) ) (when (or (logtest? (-> self elevator-status) (elevator-status moving)) - (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) + (time-elapsed? (-> self ride-timer) (seconds 0.5)) ) (cond ((and (logtest? (-> self params flags) (elevator-flags elevator-flags-1)) @@ -731,29 +731,29 @@ do so. :post plat-post ) -(defmethod calc-dist-between-points! elevator ((obj elevator) (path-point-x int) (path-point-y int)) +(defmethod calc-dist-between-points! elevator ((this elevator) (path-point-x int) (path-point-y int)) "Calculates the distance between two points in the elevator's path. @param path-point-x The index of the first point in the distance calculation, and where `next-pos` and `dist` are stored in the `path-seq` array @param path-point-y The second point in the distance calculation" - (set! (-> obj path-seq data path-point-x next-pos) (the float path-point-y)) - (let ((point-x (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float path-point-x) 'interp)) - (point-y (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float path-point-y) 'interp)) + (set! (-> this path-seq data path-point-x next-pos) (the float path-point-y)) + (let ((point-x (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-point-x) 'interp)) + (point-y (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-point-y) 'interp)) ) - (set! (-> obj path-seq data path-point-x dist) (vector-vector-distance point-x point-y)) + (set! (-> this path-seq data path-point-x dist) (vector-vector-distance point-x point-y)) ) 0 (none) ) -(defmethod set-ambient-sound! elevator ((obj elevator)) +(defmethod set-ambient-sound! elevator ((this elevator)) "Sets the elevator's [[ambient-sound]] up" - (set! (-> obj sound) (the-as ambient-sound 0)) + (set! (-> this sound) (the-as ambient-sound 0)) 0 (none) ) -(defmethod init-plat! elevator ((obj elevator)) +(defmethod init-plat! elevator ((this 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." 0 @@ -761,23 +761,23 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch base-plat vs elevator. -(defmethod relocate elevator ((obj elevator) (arg0 int)) - (if (nonzero? (-> obj path-seq)) - (&+! (-> obj path-seq) arg0) +(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)) obj arg0)) + (the-as elevator ((the-as (function base-plat int base-plat) (find-parent-method elevator 7)) this arg0)) ) -(defmethod activate-elevator elevator ((obj elevator)) +(defmethod activate-elevator elevator ((this elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" - (if (logtest? (-> obj params flags) (elevator-flags elevator-flags-6)) - (go (method-of-object obj arrived)) - (go (method-of-object obj waiting)) + (if (logtest? (-> this params flags) (elevator-flags elevator-flags-6)) + (go (method-of-object this arrived)) + (go (method-of-object this waiting)) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! elevator ((obj elevator) (entity entity-actor)) +(defmethod init-from-entity! elevator ((this elevator) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -785,37 +785,37 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-32 float) (sv-36 path-control) (sv-40 target)) - (init-plat-collision! obj) - (process-drawable-from-entity! obj entity) - (initialize-skeleton obj (the-as skeleton-group (get-art-group obj)) (the-as pair 0)) - (stop-bouncing! obj) - (set! (-> obj elevator-status) (elevator-status)) - (update-transforms (-> obj root)) - (base-plat-method-32 obj) - (init-defaults! obj) - (set! (-> obj on-activate) (res-lump-struct (-> obj entity) 'on-activate pair)) - (set! (-> obj on-deactivate) (res-lump-struct (-> obj entity) 'on-deactivate pair)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 entity #f)) - (if (logtest? (-> obj path flags) (path-control-flag not-found)) + (init-plat-collision! this) + (process-drawable-from-entity! this entity) + (initialize-skeleton this (the-as skeleton-group (get-art-group this)) (the-as pair 0)) + (stop-bouncing! this) + (set! (-> this elevator-status) (elevator-status)) + (update-transforms (-> this root)) + (base-plat-method-32 this) + (init-defaults! this) + (set! (-> this on-activate) (res-lump-struct (-> this entity) 'on-activate pair)) + (set! (-> this on-deactivate) (res-lump-struct (-> this entity) 'on-deactivate pair)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 entity #f)) + (if (logtest? (-> this path flags) (path-control-flag not-found)) (go process-drawable-art-error "error in path") ) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (let ((num-path-points (-> obj path curve num-cverts)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((num-path-points (-> this path curve num-cverts)) (s4-1 0) (f30-0 0.0) (f28-0 0.0) ) - (set! (-> obj path-seq) (new 'process 'path-step-inline-array num-path-points)) + (set! (-> this path-seq) (new 'process 'path-step-inline-array num-path-points)) (dotimes (path-point-idx num-path-points) - (calc-dist-between-points! obj path-point-idx (mod (+ path-point-idx 1) num-path-points)) - (let ((v1-31 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float path-point-idx) 'interp))) + (calc-dist-between-points! this path-point-idx (mod (+ path-point-idx 1) num-path-points)) + (let ((v1-31 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-point-idx) 'interp))) (when (or (not (logtest? s4-1 1)) (< (-> v1-31 y) f28-0)) - (set! (-> obj bottom-top 0) (the float path-point-idx)) + (set! (-> this bottom-top 0) (the float path-point-idx)) (set! f28-0 (-> v1-31 y)) (set! s4-1 (logior s4-1 1)) ) (when (or (not (logtest? s4-1 2)) (< f30-0 (-> v1-31 y))) - (set! (-> obj bottom-top 1) (the float path-point-idx)) + (set! (-> this bottom-top 1) (the float path-point-idx)) (set! f30-0 (-> v1-31 y)) (set! s4-1 (logior s4-1 2)) ) @@ -823,7 +823,7 @@ This commonly includes things such as: ) ) (set! sv-32 (the-as float 0.0)) - (set! sv-36 (-> obj path)) + (set! sv-36 (-> this path)) (let ((s5-2 *target*)) (set! sv-40 (if (type? s5-2 process-focusable) s5-2 @@ -831,20 +831,20 @@ This commonly includes things such as: ) ) (if (not (and sv-40 - (logtest? (-> obj params flags) (elevator-flags elevator-flags-4)) - (find-closest-point-in-path! obj (get-trans sv-40 0) (& sv-32) #f #t) + (logtest? (-> this params flags) (elevator-flags elevator-flags-4)) + (find-closest-point-in-path! this (get-trans sv-40 0) (& sv-32) #f #t) ) ) - (set! sv-32 (-> obj params start-pos)) + (set! sv-32 (-> this params start-pos)) ) - (set! (-> obj move-pos 0) sv-32) - (set! (-> obj move-pos 1) sv-32) - (get-point-in-path! sv-36 (-> obj basetrans) sv-32 'interp) - (set! (-> obj root pause-adjust-distance) - (+ 122880.0 (-> obj params xz-threshold) (total-distance (-> obj path))) + (set! (-> this move-pos 0) sv-32) + (set! (-> this move-pos 1) sv-32) + (get-point-in-path! sv-36 (-> this basetrans) sv-32 'interp) + (set! (-> this root pause-adjust-distance) + (+ 122880.0 (-> this params xz-threshold) (total-distance (-> this path))) ) - (set-ambient-sound! obj) - (init-plat! obj) - (activate-elevator obj) + (set-ambient-sound! this) + (init-plat! this) + (activate-elevator this) (none) ) diff --git a/goal_src/jak2/engine/common_objs/generic-obs.gc b/goal_src/jak2/engine/common_objs/generic-obs.gc index cd952013cb..43a76f9279 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs.gc @@ -138,41 +138,41 @@ (none) ) -(defmethod move-along-path swingpole ((obj swingpole)) +(defmethod move-along-path swingpole ((this swingpole)) (with-pp - (if (nonzero? (-> obj draw)) + (if (nonzero? (-> this draw)) (ja-post) ) (cond - ((nonzero? (-> obj path)) - (set! (-> obj path-pos) (get-norm! (-> obj sync) 0)) + ((nonzero? (-> this path)) + (set! (-> this path-pos) (get-norm! (-> this sync) 0)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (get-point-at-percent-along-path! (-> obj path) s5-0 (-> obj path-pos) 'interp) - (set! (-> obj speed) (* (vector-vector-distance s5-0 (-> obj root trans)) (-> pp clock frames-per-second))) - (move-to-point! (-> obj root) s5-0) + (get-point-at-percent-along-path! (-> this path) s5-0 (-> this path-pos) 'interp) + (set! (-> this speed) (* (vector-vector-distance s5-0 (-> this root trans)) (-> pp clock frames-per-second))) + (move-to-point! (-> this root) s5-0) ) ) - ((>= (-> obj joint-track) 0) - (let ((v1-15 (ppointer->process (-> obj parent))) + ((>= (-> this joint-track) 0) + (let ((v1-15 (ppointer->process (-> this parent))) (s5-1 (new 'stack-no-clear 'vector)) ) - (let ((s4-0 (-> (the-as process-drawable v1-15) node-list data (-> obj joint-track)))) + (let ((s4-0 (-> (the-as process-drawable v1-15) node-list data (-> this joint-track)))) (vector<-cspace! s5-1 s4-0) - (vector-normalize-copy! (-> obj dir) (the-as vector (-> s4-0 bone transform)) 1.0) + (vector-normalize-copy! (-> this dir) (the-as vector (-> s4-0 bone transform)) 1.0) ) - (move-to-point! (-> obj root) s5-1) + (move-to-point! (-> this root) s5-1) ) ) ) - (when (nonzero? (-> obj sound)) - (set! (-> obj sound trans quad) (-> obj root trans quad)) - (let ((f30-0 (lerp-scale -0.1 -0.05 (-> obj speed) 8192.0 20480.0)) - (f0-6 (lerp-scale 0.7 1.0 (-> obj speed) 8192.0 20480.0)) + (when (nonzero? (-> this sound)) + (set! (-> this sound trans quad) (-> this root trans quad)) + (let ((f30-0 (lerp-scale -0.1 -0.05 (-> this speed) 8192.0 20480.0)) + (f0-6 (lerp-scale 0.7 1.0 (-> this speed) 8192.0 20480.0)) ) - (set! (-> obj sound pitch) (the int (* 1524.0 f30-0))) - (set! (-> obj sound volume) (the int (* 1024.0 f0-6))) + (set! (-> this sound pitch) (the int (* 1524.0 f30-0))) + (set! (-> this sound volume) (the int (* 1024.0 f0-6))) ) - (update! (-> obj sound)) + (update! (-> this sound)) ) 0 (none) @@ -230,7 +230,7 @@ (suspend) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (move-along-path self) (suspend) ) @@ -240,7 +240,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! swingpole ((obj swingpole) (arg0 entity-actor)) +(defmethod init-from-entity! swingpole ((this swingpole) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -248,8 +248,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" "Copy defaults from the entity." - (stack-size-set! (-> obj main-thread) 128) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-5 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-5 prim-core collide-as) (collide-spec collectable)) (set! (-> v1-5 prim-core collide-with) (collide-spec jak player-list tobot)) @@ -262,21 +262,21 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-8 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-8 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 quat)) - (vector-identity! (-> obj root scale)) - (vector-y-quaternion! (-> obj dir) (-> obj root quat)) - (set! (-> obj joint-track) -1) - (let ((a1-8 (res-lump-struct (-> obj entity) 'art-name structure))) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (vector-y-quaternion! (-> this dir) (-> this root quat)) + (set! (-> this joint-track) -1) + (let ((a1-8 (res-lump-struct (-> this entity) 'art-name structure))) (if a1-8 - (initialize-skeleton-by-name obj (the-as string a1-8)) + (initialize-skeleton-by-name this (the-as string a1-8)) ) ) - (set! (-> obj dir y) 0.0) - (vector-normalize! (-> obj dir) 1.0) - (set! (-> obj edge-length) 8192.0) + (set! (-> this dir y) 0.0) + (vector-normalize! (-> this dir) 1.0) + (set! (-> this edge-length) 8192.0) (let ((s4-1 (new 'stack-no-clear 'sync-info-params))) (let ((a0-19 (res-lump-value arg0 'options uint128 :time -1000000000.0)) (v1-22 0) @@ -294,14 +294,14 @@ This commonly includes things such as: (set! (-> s4-1 ease-out) 0.2) (set! (-> s4-1 pause-in) 0.0) (set! (-> s4-1 pause-out) 0.0) - (initialize! (-> obj sync) s4-1) + (initialize! (-> this sync) s4-1) ) - (when (nonzero? (-> obj sync period)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (when (nonzero? (-> this sync period)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) ) - (set! (-> obj sound) (new 'process 'ambient-sound (-> obj entity) (-> obj root trans))) - (go (method-of-object obj idle)) + (set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans))) + (go (method-of-object this idle)) (none) ) @@ -337,7 +337,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! process-hidden ((obj process-hidden) (arg0 entity-actor)) +(defmethod init-from-entity! process-hidden ((this process-hidden) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -345,8 +345,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" "Copy defaults from the entity." - (process-entity-status! obj (entity-perm-status dead) #t) - (go (method-of-object obj die)) + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die)) (none) ) @@ -1025,16 +1025,16 @@ This commonly includes things such as: (none) ) -(defmethod deactivate part-tracker ((obj part-tracker)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate part-tracker ((this part-tracker)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod notify-parent-of-death part-tracker ((obj part-tracker)) +(defmethod notify-parent-of-death part-tracker ((this part-tracker)) (with-pp (let ((gp-0 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-0 from) (process->ppointer pp)) @@ -1042,7 +1042,7 @@ This commonly includes things such as: (set! (-> gp-0 message) 'notify) (set! (-> gp-0 param 0) (the-as uint 'die)) (let ((s5-0 send-event-function) - (s4-0 (ppointer->process (-> obj parent))) + (s4-0 (ppointer->process (-> this parent))) ) (s5-0 (if (type? s4-0 process) @@ -1066,9 +1066,9 @@ This commonly includes things such as: ) ) :code (behavior () - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (while (or (zero? (-> self duration)) - (< (- (current-time) (-> self start-time)) (the-as time-frame (-> self duration))) + (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self duration)))) ) (if (-> self callback) ((-> self callback) self) @@ -1098,7 +1098,7 @@ This commonly includes things such as: (suspend) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (the-as time-frame (-> self linger-duration))) + (until (time-elapsed? gp-1 (the-as time-frame (-> self linger-duration))) (if (-> self linger-callback) ((-> self linger-callback) self) ) @@ -1250,7 +1250,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod notify-parent-of-death lightning-tracker ((obj lightning-tracker)) +(defmethod notify-parent-of-death lightning-tracker ((this lightning-tracker)) (with-pp (let ((gp-0 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-0 from) (process->ppointer pp)) @@ -1258,7 +1258,7 @@ This commonly includes things such as: (set! (-> gp-0 message) 'notify) (set! (-> gp-0 param 0) (the-as uint 'die)) (let ((s5-0 send-event-function) - (s4-0 (ppointer->process (-> obj parent))) + (s4-0 (ppointer->process (-> this parent))) ) (s5-0 (if (type? s4-0 process) @@ -1272,13 +1272,13 @@ This commonly includes things such as: ) ) -(defmethod update lightning-tracker ((obj lightning-tracker)) - (if (-> obj callback) - ((-> obj callback) obj) +(defmethod update lightning-tracker ((this lightning-tracker)) + (if (-> this callback) + ((-> this callback) this) ) (let ((a0-6 (cond - ((>= (-> obj target-joint0) 0) - (let ((s5-0 (handle->process (-> obj target0)))) + ((>= (-> this target-joint0) 0) + (let ((s5-0 (handle->process (-> this target0)))) (if (type? s5-0 process-drawable) s5-0 ) @@ -1291,30 +1291,30 @@ This commonly includes things such as: ) ) (cond - ((< (-> obj target-joint0) 0) - (when (and (!= (-> obj lightning spec rand-func) 3) (!= (-> obj lightning spec rand-func) 2)) - (let ((v1-17 (-> obj lightning)) - (a0-9 (-> obj offset0)) + ((< (-> this target-joint0) 0) + (when (and (!= (-> this lightning spec rand-func) 3) (!= (-> this lightning spec rand-func) 2)) + (let ((v1-17 (-> this lightning)) + (a0-9 (-> this offset0)) ) (set! (-> v1-17 state meet data 0 quad) (-> a0-9 quad)) ) ) ) ((or (not a0-6) (zero? (-> (the-as process-focusable a0-6) root))) - (deactivate obj) + (deactivate this) ) - ((= (-> obj target-joint0) 256) - (let ((s5-1 (-> obj lightning)) + ((= (-> this target-joint0) 256) + (let ((s5-1 (-> this lightning)) (a0-12 (get-trans (the-as process-focusable a0-6) 3)) ) (set! (-> s5-1 state meet data 0 quad) (-> a0-12 quad)) ) ) (else - (let ((s5-2 (-> obj lightning)) + (let ((s5-2 (-> this lightning)) (a0-16 (vector<-cspace! (new 'stack-no-clear 'vector) - (-> (the-as process-focusable a0-6) node-list data (-> obj target-joint0)) + (-> (the-as process-focusable a0-6) node-list data (-> this target-joint0)) ) ) ) @@ -1324,8 +1324,8 @@ This commonly includes things such as: ) ) (let ((a0-22 (cond - ((>= (-> obj target-joint1) 0) - (let ((s5-3 (handle->process (-> obj target1)))) + ((>= (-> this target-joint1) 0) + (let ((s5-3 (handle->process (-> this target1)))) (if (type? s5-3 process-drawable) s5-3 ) @@ -1338,30 +1338,30 @@ This commonly includes things such as: ) ) (cond - ((< (-> obj target-joint1) 0) - (when (and (!= (-> obj lightning spec rand-func) 3) (!= (-> obj lightning spec rand-func) 2)) - (let ((a0-26 (-> obj lightning)) - (v1-44 (-> obj offset1)) + ((< (-> this target-joint1) 0) + (when (and (!= (-> this lightning spec rand-func) 3) (!= (-> this lightning spec rand-func) 2)) + (let ((a0-26 (-> this lightning)) + (v1-44 (-> this offset1)) ) (set! (-> a0-26 state meet data (+ (-> a0-26 state points-to-draw) -1) quad) (-> v1-44 quad)) ) ) ) ((or (not a0-22) (zero? (-> (the-as process-focusable a0-22) root))) - (deactivate obj) + (deactivate this) ) - ((= (-> obj target-joint1) 256) - (let ((gp-1 (-> obj lightning)) + ((= (-> this target-joint1) 256) + (let ((gp-1 (-> this lightning)) (v1-51 (get-trans (the-as process-focusable a0-22) 3)) ) (set! (-> gp-1 state meet data (+ (-> gp-1 state points-to-draw) -1) quad) (-> v1-51 quad)) ) ) (else - (let ((s5-4 (-> obj lightning)) + (let ((s5-4 (-> this lightning)) (v1-54 (vector<-cspace! (new 'stack-no-clear 'vector) - (-> (the-as process-drawable a0-22) node-list data (-> obj target-joint1)) + (-> (the-as process-drawable a0-22) node-list data (-> this target-joint1)) ) ) ) @@ -1407,7 +1407,7 @@ This commonly includes things such as: ) ) ) - (while (< (- (current-time) gp-0) s5-0) + (while (not (time-elapsed? gp-0 s5-0)) (suspend) ) ) @@ -1456,9 +1456,9 @@ This commonly includes things such as: ) (set! (-> v1-33 state mode) (the-as lightning-mode a0-10)) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (while (or (zero? (-> self duration)) - (< (- (current-time) (-> self start-time)) (the-as time-frame (-> self duration))) + (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self duration)))) ) (update self) (suspend) @@ -1483,8 +1483,8 @@ This commonly includes things such as: ) (set! (-> v1-47 state mode) (the-as lightning-mode a0-14)) ) - (set! (-> self start-time) (current-time)) - (while (< (- (current-time) (-> self start-time)) (the int f30-0)) + (set-time! (-> self start-time)) + (while (not (time-elapsed? (-> self start-time) (the int f30-0))) (suspend) ) ) @@ -1745,48 +1745,48 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! med-res-level ((obj med-res-level) (arg0 entity-actor)) +(defmethod init-from-entity! med-res-level ((this med-res-level) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 128) + (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (res-lump-struct arg0 'art-name structure)) - (s3-0 (res-lump-struct (-> obj entity) 'level structure)) - (v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0)) + (s3-0 (res-lump-struct (-> this entity) 'level structure)) + (v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0)) ) (when s3-0 - (set! (-> obj level-name) (the-as basic s3-0)) - (set! (-> obj index) (the-as int v1-5)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton-by-name obj (the-as string s4-0)) - (logior! (-> obj draw status) (draw-control-status no-closest-distance)) - (if (nonzero? (-> obj draw)) - (go (method-of-object obj idle)) + (set! (-> this level-name) (the-as basic s3-0)) + (set! (-> this index) (the-as int v1-5)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton-by-name this (the-as string s4-0)) + (logior! (-> this draw status) (draw-control-status no-closest-distance)) + (if (nonzero? (-> this draw)) + (go (method-of-object this idle)) ) ) ) (none) ) -(defmethod deactivate part-spawner ((obj part-spawner)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate part-spawner ((this part-spawner)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) -(defmethod is-in-view? part-spawner ((obj part-spawner)) - (sphere<-vector+r! (-> obj world-sphere) (-> obj root trans) (-> obj radius)) - (sphere-in-view-frustum? (-> obj world-sphere)) +(defmethod is-in-view? part-spawner ((this part-spawner)) + (sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius)) + (sphere-in-view-frustum? (-> this world-sphere)) ) (defstate active (part-spawner) @@ -1826,7 +1826,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! part-spawner ((obj part-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! part-spawner ((this part-spawner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1834,22 +1834,23 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 string)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj clock) (-> *display* part-clock)) - (set! (-> obj root) (new 'process 'trsqv)) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 quat)) - (vector-identity! (-> obj root scale)) - (set! (-> obj radius) 12288.0) - (set! (-> obj enable) - (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)))) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this clock) (-> *display* part-clock)) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (set! (-> this radius) 12288.0) + (set! (-> this enable) + (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) ) - (set! (-> obj sound) (new 'process 'ambient-sound (-> obj entity) (-> obj root trans))) + (set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans))) (set! sv-16 "#f") - (set! (-> obj mode) (entity-lookup-part-group arg0 (& sv-16) 'art-name)) - (when (-> obj mode) - (let ((a0-15 (-> obj mode 0))) + (set! (-> this mode) (entity-lookup-part-group arg0 (& sv-16) 'art-name)) + (when (-> this mode) + (let ((a0-15 (-> this mode 0))) (when (and (nonzero? a0-15) (= (-> a0-15 type) sparticle-launch-group)) (cond ((logtest? (-> a0-15 flags) (sp-group-flag unk-8)) @@ -1858,12 +1859,12 @@ This commonly includes things such as: (a3-2 (-> *part-id-table* (-> a1-8 launcher))) ) (when (nonzero? a3-2) - (let ((a2-7 (-> obj level part-engine))) + (let ((a2-7 (-> this level part-engine))) (when (and a2-7 (< (-> a2-7 length) (-> a2-7 allocated-length))) (let ((t0-7 (-> a2-7 data (-> a2-7 length)))) (set! (-> t0-7 next1) (the-as connectable a3-2)) (set! (-> t0-7 prev1) (the-as connectable (-> a1-8 hour-mask))) - (set! (-> (the-as vector (&-> t0-7 param0)) quad) (-> obj root trans quad)) + (set! (-> (the-as vector (&-> t0-7 param0)) quad) (-> this root trans quad)) (set! (-> t0-7 param3) (the-as int (-> a1-8 fade-after))) ) (+! (-> a2-7 length) 1) @@ -1872,12 +1873,12 @@ This commonly includes things such as: ) ) ) - (process-entity-status! obj (entity-perm-status dead) #t) - (deactivate obj) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) ) (else - (set! (-> obj part) (create-launch-control a0-15 obj)) - (go (method-of-object obj active)) + (set! (-> this part) (create-launch-control a0-15 this)) + (go (method-of-object this active)) ) ) ) @@ -2206,7 +2207,7 @@ This commonly includes things such as: (when (not (paused?)) (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) (send-event *camera* 'teleport) - (if (and (-> *camera* on-ground) (>= (- (current-time) gp-0) (seconds 1))) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) (send-event *camera* 'change-state cam-string (seconds 0.5)) ) ) @@ -2305,7 +2306,7 @@ This commonly includes things such as: (set! (-> self trans x) (-> *camera* tpos-curr x)) (set! (-> self trans z) (-> *camera* tpos-curr z)) (vector+! (-> self trans) (-> self trans) (-> self view-flat)) - (if (and (-> *camera* on-ground) (>= (- (current-time) gp-0) (seconds 1))) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) (send-event *camera* 'change-state cam-string (seconds 0.5)) ) ) @@ -2373,7 +2374,7 @@ This commonly includes things such as: :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (or (= message 'touch) (= message 'attack)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) (cond @@ -2415,7 +2416,7 @@ This commonly includes things such as: (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) - (< (- (current-time) (-> self state-time)) (seconds 0.5)) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) ) (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) @@ -2432,15 +2433,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! launcher ((obj launcher) (arg0 entity-actor)) +(defmethod init-from-entity! launcher ((this launcher) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 128) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-4 prim-core collide-as) (collide-spec enemy)) (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list)) @@ -2453,53 +2454,53 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-6 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-6 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (update-transforms (-> obj root)) - (set! (-> obj active-distance) 409600.0) - (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) + (process-drawable-from-entity! this arg0) + (update-transforms (-> this root)) + (set! (-> this active-distance) 409600.0) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) (let ((s4-1 (res-lump-value arg0 'mode uint128 :time -1000000000.0))) - (let ((v1-14 (-> obj level name))) - (set! (-> obj part) (create-launch-control - (cond - ((= v1-14 'beach) - (-> *part-group-id-table* 6) - ) - ((= v1-14 'swamp) - (-> *part-group-id-table* 8) - ) - (else - (-> *part-group-id-table* 7) + (let ((v1-14 (-> this level name))) + (set! (-> this part) (create-launch-control + (cond + ((= v1-14 'beach) + (-> *part-group-id-table* 6) ) - ) - obj - ) + ((= v1-14 'swamp) + (-> *part-group-id-table* 8) + ) + (else + (-> *part-group-id-table* 7) + ) + ) + this + ) ) ) (let ((v1-20 (logand (the-as int s4-1) 255))) (cond ((= (the-as uint v1-20) 1) - (set! (-> obj camera) cam-launcher-longfall) + (set! (-> this camera) cam-launcher-longfall) ) ((= (the-as uint v1-20) 2) - (set! (-> obj camera) #f) + (set! (-> this camera) #f) ) (else - (set! (-> obj camera) cam-launcher-shortfall) + (set! (-> this camera) cam-launcher-shortfall) ) ) ) ) (let ((v1-25 (res-lump-struct arg0 'alt-vector vector))) (when v1-25 - (set-vector! (-> obj dest) (-> v1-25 x) (-> v1-25 y) (-> v1-25 z) 1.0) - (set! (-> obj seek-time) (the-as time-frame (the int (* 300.0 (-> v1-25 w))))) + (set-vector! (-> this dest) (-> v1-25 x) (-> v1-25 y) (-> v1-25 z) 1.0) + (set! (-> this seek-time) (the-as time-frame (the int (* 300.0 (-> v1-25 w))))) ) ) - (set! (-> obj sound-id) (new-sound-id)) - (nav-mesh-connect-from-ent obj) - (go (method-of-object obj idle)) + (set! (-> this sound-id) (new-sound-id)) + (nav-mesh-connect-from-ent this) + (go (method-of-object this idle)) (none) ) @@ -2632,7 +2633,7 @@ This commonly includes things such as: ) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while ((-> self run-function)) (let* ((gp-0 (handle->process (-> self target))) (a0-4 (if (type? gp-0 process-drawable) @@ -2716,15 +2717,15 @@ This commonly includes things such as: (set! (-> self event) #f) (set! (-> self callback) #f) (set! (-> self run-function) - (lambda :behavior touch-tracker () (< (- (current-time) (-> self state-time)) (-> self duration))) + (lambda :behavior touch-tracker () (not (time-elapsed? (-> self state-time) (-> self duration)))) ) (set! (-> self event-hook) (-> (method-of-object self active) event)) (go-virtual active) (none) ) -(defmethod setup-explosion-collision explosion ((obj explosion)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod setup-explosion-collision explosion ((this explosion)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (set! (-> s5-0 penetrate-using) (penetrate explode)) (let ((v1-3 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> v1-3 prim-core action) (collide-action solid)) @@ -2737,14 +2738,14 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-6 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-6 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root event-self) 'touched) + (set! (-> this root event-self) 'touched) 0 (none) ) -(defmethod explosion-method-22 explosion ((obj explosion)) +(defmethod explosion-method-22 explosion ((this explosion)) 0 (none) ) @@ -2842,7 +2843,7 @@ This commonly includes things such as: ) ) :code (behavior () - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (update-transforms (-> self root)) (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-0 options) (overlaps-others-options)) @@ -2855,14 +2856,14 @@ This commonly includes things such as: (set! (-> v1-9 prim-core collide-with) (collide-spec)) ) 0 - (while (< (- (current-time) (-> self start-time)) (the-as time-frame (-> self duration))) + (while (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self duration)))) (let ((a1-1 (-> self root trans))) (spawn (-> self part) a1-1) ) (suspend) ) - (set! (-> self start-time) (current-time)) - (while (< (- (current-time) (-> self start-time)) (the-as time-frame (-> self linger-duration))) + (set-time! (-> self start-time)) + (while (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self linger-duration)))) (suspend) ) ) diff --git a/goal_src/jak2/engine/common_objs/plat.gc b/goal_src/jak2/engine/common_objs/plat.gc index edbf986c63..c663a3dcb6 100644 --- a/goal_src/jak2/engine/common_objs/plat.gc +++ b/goal_src/jak2/engine/common_objs/plat.gc @@ -29,14 +29,14 @@ :bounds (static-spherem 0 -0.5 0 3) ) -(defmethod get-art-group plat ((obj plat)) +(defmethod get-art-group plat ((this plat)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-plat" (the-as (pointer uint32) #f)) ) -(defmethod init-plat-collision! plat ((obj plat)) +(defmethod init-plat-collision! plat ((this plat)) "TODO - collision stuff for setting up the platform" - (let ((collision-shape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) (set! (-> collision-mesh prim-core collide-as) (collide-spec pusher)) (set! (-> collision-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -52,38 +52,38 @@ (set! (-> collision-shape backup-collide-as) (-> prim prim-core collide-as)) (set! (-> collision-shape backup-collide-with) (-> prim prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving collision-shape)) + (set! (-> this root) (the-as collide-shape-moving collision-shape)) ) 0 (none) ) -(defmethod init-plat! plat ((obj plat)) +(defmethod init-plat! plat ((this plat)) "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." 0 (none) ) -(defmethod base-plat-method-32 plat ((obj plat)) +(defmethod base-plat-method-32 plat ((this plat)) 0 (none) ) -(defmethod plat-path-sync plat ((obj plat)) +(defmethod plat-path-sync plat ((this plat)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @see [[sync-eased]]" (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) - (go (method-of-object obj plat-idle)) + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this plat-idle)) ) - ((> (-> obj sync period) 0) - (go (method-of-object obj plat-path-active)) + ((> (-> this sync period) 0) + (go (method-of-object this plat-path-active)) ) (else - (go (method-of-object obj plat-idle)) + (go (method-of-object this plat-idle)) ) ) ) @@ -144,26 +144,26 @@ otherwise, [[plat::34]] ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! plat ((obj plat) (entity entity-actor)) +(defmethod init-from-entity! plat ((this plat) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask platform)) - (init-plat-collision! obj) - (process-drawable-from-entity! obj entity) - (initialize-skeleton obj (the-as skeleton-group (get-art-group obj)) (the-as pair 0)) - (update-transforms (-> obj root)) - (stop-bouncing! obj) - (base-plat-method-32 obj) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logior! (-> this mask) (process-mask platform)) + (init-plat-collision! this) + (process-drawable-from-entity! this entity) + (initialize-skeleton this (the-as skeleton-group (get-art-group this)) (the-as pair 0)) + (update-transforms (-> this root)) + (stop-bouncing! this) + (base-plat-method-32 this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((params (new 'stack-no-clear 'sync-info-params))) (let ((v1-15 0)) - (if (not (logtest? (-> obj fact options) (actor-option loop))) + (if (not (logtest? (-> this fact options) (actor-option loop))) (set! v1-15 (logior v1-15 1)) ) (set! (-> params sync-type) 'sync-eased) @@ -176,28 +176,28 @@ This commonly includes things such as: (set! (-> params ease-out) 0.15) (set! (-> params pause-in) 0.0) (set! (-> params pause-out) 0.0) - (initialize! (-> obj sync) params) + (initialize! (-> this sync) params) ) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this sound-id) (new-sound-id)) (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) - (set! (-> obj path-pos) 0.0) - (init-plat! obj) - (plat-path-sync obj) + ((logtest? (-> this path flags) (path-control-flag not-found)) + (set! (-> this path-pos) 0.0) + (init-plat! this) + (plat-path-sync this) ) - ((> (-> obj sync period) 0) - (set! (-> obj path-pos) (get-norm! (-> obj sync) 0)) - (get-point-at-percent-along-path! (-> obj path) (-> obj root trans) (-> obj path-pos) 'interp) - (init-plat! obj) - (plat-path-sync obj) + ((> (-> this sync period) 0) + (set! (-> this path-pos) (get-norm! (-> this sync) 0)) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + (init-plat! this) + (plat-path-sync this) ) (else - (set! (-> obj path-pos) 0.0) - (get-point-at-percent-along-path! (-> obj path) (-> obj root trans) (-> obj path-pos) 'interp) - (init-plat! obj) - (plat-path-sync obj) + (set! (-> this path-pos) 0.0) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + (init-plat! this) + (plat-path-sync this) ) ) (none) @@ -222,18 +222,18 @@ This commonly includes things such as: ;; WARN: Return type mismatch base-plat vs drop-plat. -(defmethod relocate drop-plat ((obj drop-plat) (arg0 int)) - (if (nonzero? (-> obj break-anim-name)) - (&+! (-> obj break-anim-name) arg0) +(defmethod relocate drop-plat ((this drop-plat) (arg0 int)) + (if (nonzero? (-> this break-anim-name)) + (&+! (-> this break-anim-name) arg0) ) - (let ((v1-5 (-> obj anim anim-name))) + (let ((v1-5 (-> this anim anim-name))) (if (and (>= (the-as int v1-5) (-> *kernel-context* relocating-min)) (< (the-as int v1-5) (-> *kernel-context* relocating-max)) ) - (set! (-> obj anim anim-name) (&+ (the-as external-art-buffer (-> obj anim anim-name)) arg0)) + (set! (-> this anim anim-name) (&+ (the-as external-art-buffer (-> this anim anim-name)) arg0)) ) ) - (the-as drop-plat ((method-of-type base-plat relocate) obj arg0)) + (the-as drop-plat ((method-of-type base-plat relocate) this arg0)) ) (defstate idle (drop-plat) @@ -252,7 +252,7 @@ This commonly includes things such as: (set! (-> self safe-time) (+ (current-time) (seconds 0.2))) (return (the-as object #f)) ) - ((< (- (current-time) (-> self safe-time)) (seconds 0.05)) + ((not (time-elapsed? (-> self safe-time) (seconds 0.05))) (return (the-as object #f)) ) ) @@ -294,7 +294,7 @@ This commonly includes things such as: :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('edge-grabbed) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (send-event proc 'end-mode) ) ) @@ -304,7 +304,7 @@ This commonly includes things such as: ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) diff --git a/goal_src/jak2/engine/common_objs/powerups.gc b/goal_src/jak2/engine/common_objs/powerups.gc index 17cb6865b1..b90e4a181b 100644 --- a/goal_src/jak2/engine/common_objs/powerups.gc +++ b/goal_src/jak2/engine/common_objs/powerups.gc @@ -21,7 +21,7 @@ (s2-1 (process->handle arg1)) ) (let ((s0-0 (current-time))) - (until (>= (- (current-time) s0-0) (+ arg3 arg4)) + (until (time-elapsed? s0-0 (+ arg3 arg4)) (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) (if v1-8 (deactivate self) @@ -50,7 +50,7 @@ ) (else (let ((s4-1 (current-time))) - (until (>= (- (current-time) s4-1) arg5) + (until (time-elapsed? s4-1 arg5) (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) (arg2 a0-21) ) @@ -700,7 +700,7 @@ (defbehavior target-color-effect-process target () (when (and (-> self color-effect) - (>= (- (current-time) (-> self color-effect-start-time)) (the-as time-frame (-> self color-effect-duration))) + (time-elapsed? (-> self color-effect-start-time) (the-as time-frame (-> self color-effect-duration))) ) (set! (-> self color-effect) #f) (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) @@ -812,13 +812,13 @@ (if (and (logtest? (-> self water flags) (water-flags under-water)) (not (logtest? (-> self water flags) (water-flags swim-ground))) ) - (set! (-> self control unknown-time-frame26) (current-time)) - (set! (-> self control unknown-time-frame27) (current-time)) + (set-time! (-> self control unknown-time-frame26)) + (set-time! (-> self control unknown-time-frame27)) ) (cond ((and (= (-> self control ground-pat material) (pat-material ice)) (and (>= (-> self control ctrl-xz-vel) 204.8) - (< (- (current-time) (-> self control last-time-on-surface)) (seconds 0.05)) + (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.05))) ) ) (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 38)))) @@ -1046,7 +1046,7 @@ ((or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) (not (logtest? (-> self control status) (collide-status on-surface))) ) - (and (focus-test? self board) (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1))) + (and (focus-test? self board) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)))) ) (logior! (-> self focus-status) (focus-status in-air)) (if (logtest? (surface-flag super) (-> self control current-surface flags)) @@ -1081,7 +1081,7 @@ (logior! (-> self focus-status) (focus-status ice)) (logclear! (-> self focus-status) (focus-status ice)) ) - (if (< (- (current-time) (-> self gun fire-time)) (seconds 0.1)) + (if (not (time-elapsed? (-> self gun fire-time) (seconds 0.1))) (logior! (-> self focus-status) (focus-status shooting)) (logclear! (-> self focus-status) (focus-status shooting)) ) diff --git a/goal_src/jak2/engine/common_objs/projectile.gc b/goal_src/jak2/engine/common_objs/projectile.gc index 22d3fc53c9..0902a16cd5 100644 --- a/goal_src/jak2/engine/common_objs/projectile.gc +++ b/goal_src/jak2/engine/common_objs/projectile.gc @@ -19,26 +19,26 @@ ) ) -(defmethod play-impact-sound! projectile ((obj projectile)) +(defmethod play-impact-sound! projectile ((this projectile)) "Plays impact sound" 0 (none) ) -(defmethod event-handler! projectile ((obj projectile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-handler! projectile ((this projectile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Multiplex the projectile's event processing, called by [[projectile-event-handler]]" (case arg2 (('track) (let ((v0-0 (the-as object (process->handle (the-as process (-> arg3 param 0)))))) - (set! (-> obj last-target) (the-as handle v0-0)) + (set! (-> this last-target) (the-as handle v0-0)) v0-0 ) ) (('touched 'touch) - (handle-proj-hit! obj arg0 arg3) + (handle-proj-hit! this arg0 arg3) ) (('die) - (kill-projectile! obj) + (kill-projectile! this) ) ) ) @@ -49,33 +49,33 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod deal-damage! projectile ((obj projectile) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! projectile ((this projectile) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((v1-1 (new 'stack 'attack-info))) (let ((a0-2 v1-1)) - (set! (-> a0-2 mode) (-> obj attack-mode)) - (set! (-> a0-2 id) (-> obj attack-id)) + (set! (-> a0-2 mode) (-> this attack-mode)) + (set! (-> a0-2 id) (-> this attack-id)) (set! (-> a0-2 mask) (attack-mask mode id)) ) - (when (!= (-> obj owner-handle) #f) - (set! (-> v1-1 attacker) (-> obj owner-handle)) + (when (!= (-> this owner-handle) #f) + (set! (-> v1-1 attacker) (-> this owner-handle)) (logior! (-> v1-1 mask) (attack-mask attacker)) ) - (when (logtest? (-> obj options) (projectile-options account-for-target-velocity)) - (set! (-> v1-1 attacker-velocity quad) (-> obj pre-move-transv quad)) + (when (logtest? (-> this options) (projectile-options account-for-target-velocity)) + (set! (-> v1-1 attacker-velocity quad) (-> this pre-move-transv quad)) (logior! (-> v1-1 mask) (attack-mask attacker-velocity)) ) - (when (logtest? (-> obj options) (projectile-options deal-damage)) - (set! (-> v1-1 damage) (-> obj damage)) + (when (logtest? (-> this options) (projectile-options deal-damage)) + (set! (-> v1-1 damage) (-> this damage)) (logior! (-> v1-1 mask) (attack-mask damage)) ) - (when (logtest? (projectile-options respect-invinc-time) (-> obj options)) - (set! (-> v1-1 invinc-time) (-> obj invinc-time)) + (when (logtest? (projectile-options respect-invinc-time) (-> this options)) + (set! (-> v1-1 invinc-time) (-> this invinc-time)) (logior! (-> v1-1 mask) (attack-mask invinc-time)) ) (the-as symbol (send-event arg0 - (if (logtest? (projectile-options ignore-impact) (-> obj options)) + (if (logtest? (projectile-options ignore-impact) (-> this options)) 'attack-invinc 'attack ) @@ -86,89 +86,89 @@ ) ) -(defmethod handle-proj-hit! projectile ((obj projectile) (arg0 process) (arg1 event-message-block)) +(defmethod handle-proj-hit! projectile ((this projectile) (arg0 process) (arg1 event-message-block)) "When a projectile hits something, first deal damage via [[projectile::37]] and increment the projectiles hit count. If we've met or exceeded the projectiles maximum allowed hits, switch to the [[projectile::impact]] state" - (when (-> obj attack-mode) + (when (-> this attack-mode) (let ((a2-1 (-> arg1 param 0))) - (when (deal-damage! obj arg0 (the-as event-message-block a2-1)) - (let ((v1-3 (-> obj notify-handle))) + (when (deal-damage! this arg0 (the-as event-message-block a2-1)) + (let ((v1-3 (-> this notify-handle))) (send-event (handle->process v1-3) 'notify 'attack arg0) ) - (+! (-> obj hits) 1) - (if (and (>= (-> obj hits) (-> obj max-hits)) - (not (and (-> obj next-state) (= (-> obj next-state name) 'impact))) + (+! (-> this hits) 1) + (if (and (>= (-> this hits) (-> this max-hits)) + (not (and (-> this next-state) (= (-> this next-state name) 'impact))) ) - (go (method-of-object obj impact)) + (go (method-of-object this impact)) ) ) ) ) ) -(defmethod kill-projectile! projectile ((obj projectile)) +(defmethod kill-projectile! projectile ((this projectile)) "Transition to the [[projectile::impact]] state, always return [[#t]]" - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'impact))) - (go (method-of-object obj impact)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) + (go (method-of-object this impact)) ) #t ) -(defmethod draw-laser-sight projectile ((obj projectile)) +(defmethod draw-laser-sight projectile ((this projectile)) "TODO - confirm If applicable, draw the laser sight particles" 0 (none) ) -(defmethod spawn-impact-particles projectile ((obj projectile)) +(defmethod spawn-impact-particles projectile ((this projectile)) "Spawns associated particles with the projectile if applicable" - (if (nonzero? (-> obj part)) - (spawn (-> obj part) (-> obj root trans)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) ) 0 (none) ) -(defmethod spawn-shell-particles projectile ((obj projectile)) +(defmethod spawn-shell-particles projectile ((this projectile)) "TODO - confirm" 0 (none) ) -(defmethod unknown-particles projectile ((obj projectile)) +(defmethod unknown-particles projectile ((this projectile)) "TODO - confirm" 0 (none) ) -(defmethod play-impact-sound projectile ((obj projectile) (arg0 projectile-options)) +(defmethod play-impact-sound projectile ((this projectile) (arg0 projectile-options)) 0 (none) ) -(defmethod stop-sound! projectile ((obj projectile)) +(defmethod stop-sound! projectile ((this projectile)) "Stops the current `sound-id` if set, re-init the `sound-id` after being stopped" - (when (nonzero? (-> obj sound-id)) - (sound-stop (-> obj sound-id)) - (set! (-> obj sound-id) (new 'static 'sound-id)) + (when (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + (set! (-> this sound-id) (new 'static 'sound-id)) 0 ) 0 (none) ) -(defmethod made-impact? projectile ((obj projectile)) +(defmethod made-impact? projectile ((this projectile)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a1-0 t1-0)) (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a1-0 ignore-process0) obj) - (set! (-> a1-0 ignore-process1) (handle->process (-> obj ignore-handle))) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (handle->process (-> this ignore-handle))) (set! (-> a1-0 ignore-pat) (-> v1-0 pat-ignore-mask)) (set! (-> a1-0 action-mask) (collide-action solid)) ) @@ -281,7 +281,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (stop-sound! self) ) :trans (behavior () - (if (>= (- (current-time) (-> self spawn-time)) (-> self timeout)) + (if (time-elapsed? (-> self spawn-time) (-> self timeout)) (go-virtual dissipate) ) (let ((t9-1 (-> self pick-target))) @@ -376,15 +376,15 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ) -(defmethod init-proj-settings! projectile ((obj projectile)) +(defmethod init-proj-settings! projectile ((this projectile)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" 0 (none) ) -(defmethod init-proj-collision! projectile ((obj projectile)) +(defmethod init-proj-collision! projectile ((this projectile)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-projectile) (set! (-> s5-0 no-reaction) @@ -407,32 +407,32 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 (none) ) -(defmethod go-moving! projectile ((obj projectile)) - (go (method-of-object obj moving)) +(defmethod go-moving! projectile ((this projectile)) + (go (method-of-object this moving)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-sitting! projectile ((obj projectile)) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'impact))) - (go (method-of-object obj impact)) +(defmethod go-sitting! projectile ((this projectile)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) + (go (method-of-object this impact)) ) (none) ) -(defmethod deactivate projectile ((obj projectile)) - (stop-sound! obj) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate projectile ((this projectile)) + (stop-sound! this) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -453,7 +453,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (set! (-> self last-target) (the-as handle #f)) (set! (-> self timeout) (-> arg0 timeout)) (set! (-> self max-hits) 1) - (set! (-> self spawn-time) (current-time)) + (set-time! (-> self spawn-time)) (set! (-> self update-velocity) #f) (set! (-> self move) projectile-move-fill-line-sphere) (set! (-> self pick-target) #f) @@ -530,7 +530,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :event projectile-event-handler :trans (behavior () (noop self) - (if (>= (- (current-time) (-> self spawn-time)) (-> self timeout)) + (if (time-elapsed? (-> self spawn-time) (-> self timeout)) (go-virtual impact) ) ) @@ -538,7 +538,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :post projectile-bounce-falling-post ) -(defmethod noop projectile-bounce ((obj projectile-bounce)) +(defmethod noop projectile-bounce ((this projectile-bounce)) "Does nothing" 0 (none) @@ -552,12 +552,12 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ;; WARN: Return type mismatch object vs none. -(defmethod go-sitting! projectile-bounce ((obj projectile-bounce)) - (go (method-of-object obj sitting)) +(defmethod go-sitting! projectile-bounce ((this projectile-bounce)) + (go (method-of-object this sitting)) (none) ) -(defmethod spawn-impact-particles projectile-bounce ((obj projectile-bounce)) +(defmethod spawn-impact-particles projectile-bounce ((this projectile-bounce)) "Spawns associated particles with the projectile if applicable" (ja-post) 0 @@ -583,27 +583,27 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound! projectile-bounce ((obj projectile-bounce)) +(defmethod play-impact-sound! projectile-bounce ((this projectile-bounce)) "Plays impact sound" - (let* ((a2-0 (-> obj root)) + (let* ((a2-0 (-> this root)) (v1-0 (-> a2-0 status)) ) (if (logtest? v1-0 (collide-status touch-surface)) (vector-float*! (-> a2-0 transv) (-> a2-0 transv) 0.6) ) (when (and (logtest? v1-0 (collide-status impact-surface)) - (>= (- (current-time) (-> obj played-bounce-time)) (seconds 0.3)) + (time-elapsed? (-> this played-bounce-time) (seconds 0.3)) ) - (set! (-> obj played-bounce-time) (current-time)) + (set-time! (-> this played-bounce-time)) (sound-play "dark-shot-bounc") ) ) (none) ) -(defmethod init-proj-collision! projectile-bounce ((obj projectile-bounce)) +(defmethod init-proj-collision! projectile-bounce ((this projectile-bounce)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-bounce-reaction) (set! (-> s5-0 no-reaction) @@ -623,30 +623,30 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (set-collide-with! - (-> obj root) + (-> this root) (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) ) - (set-collide-as! (-> obj root) (collide-spec projectile)) - (set! (-> obj root pat-ignore-mask) + (set-collide-as! (-> this root) (collide-spec projectile)) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) ) -(defmethod init-proj-settings! projectile-bounce ((obj projectile-bounce)) +(defmethod init-proj-settings! projectile-bounce ((this projectile-bounce)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj max-speed) 450560.0) - (set! (-> obj timeout) (seconds 1.6)) - (set! (-> obj update-velocity) projectile-bounce-update-velocity) - (set! (-> obj move) projectile-bounce-move) - (set! (-> obj root dynam gravity y) 184320.0) - (set! (-> obj root dynam gravity-length) 184320.0) - (set! (-> obj root dynam gravity-max) 184320.0) + (set! (-> this max-speed) 450560.0) + (set! (-> this timeout) (seconds 1.6)) + (set! (-> this update-velocity) projectile-bounce-update-velocity) + (set! (-> this move) projectile-bounce-move) + (set! (-> this root dynam gravity y) 184320.0) + (set! (-> this root dynam gravity-length) 184320.0) + (set! (-> this root dynam gravity-max) 184320.0) (let ((f0-4 1092.2667)) - (quaternion-axis-angle! (-> obj tumble-quat) 1.0 0.0 0.0 f0-4) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-4) ) 0 (none) 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 35b976f9ce..c6646fef32 100644 --- a/goal_src/jak2/engine/common_objs/rigid-body-plat.gc +++ b/goal_src/jak2/engine/common_objs/rigid-body-plat.gc @@ -74,22 +74,22 @@ ;; WARN: Return type mismatch rigid-body-object vs rigid-body-platform. -(defmethod relocate rigid-body-platform ((obj rigid-body-platform) (new-addr int)) - (if (nonzero? (-> obj control-point-array)) - (&+! (-> obj control-point-array) new-addr) +(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)) - obj + this new-addr ) ) ) -(defmethod rigid-body-platform-method-53 rigid-body-platform ((obj rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-53 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) (local-vars (f0-1 object)) - (let ((v1-0 (-> obj water-anim))) + (let ((v1-0 (-> this water-anim))) 0.0 (set! f0-1 (cond (v1-0 @@ -112,32 +112,32 @@ (the-as float f0-1) ) -(defmethod rigid-body-platform-method-54 rigid-body-platform ((obj rigid-body-platform) (ctrl-point rigid-body-control-point)) +(defmethod rigid-body-platform-method-54 rigid-body-platform ((this rigid-body-platform) (ctrl-point rigid-body-control-point)) (set! (-> ctrl-point world-pos w) - (+ (rigid-body-platform-method-53 obj (-> ctrl-point world-pos)) (-> obj float-height-offset)) + (+ (rigid-body-platform-method-53 this (-> ctrl-point world-pos)) (-> this float-height-offset)) ) (let* ((s4-0 (new 'stack-no-clear 'vector)) (f0-3 (- (-> ctrl-point world-pos w) (-> ctrl-point world-pos y))) - (f30-0 (/ f0-3 (-> obj info max-buoyancy-depth))) + (f30-0 (/ f0-3 (-> this info max-buoyancy-depth))) ) (when (< 0.0 f0-3) (vector-float*! s4-0 *y-vector* - (* (-> obj rbody state info mass) + (* (-> this rbody state info mass) (fmin 1.0 f30-0) - (/ (-> obj info extra gravity) (the float (-> obj info control-point-count))) - (-> obj info buoyancy-factor) + (/ (-> this info extra gravity) (the float (-> this info control-point-count))) + (-> this info buoyancy-factor) ) ) - (let ((v1-6 (-> obj rbody)) + (let ((v1-6 (-> this rbody)) (a1-9 (-> ctrl-point world-pos)) (a2-0 s4-0) ) (rigid-body-method-18 (-> v1-6 state) a1-9 a2-0) ) - (vector-float*! s4-0 (-> ctrl-point velocity) (* -1.0 (-> obj info drag-factor) (fmin 1.0 f30-0))) - (let ((v1-11 (-> obj rbody)) + (vector-float*! s4-0 (-> ctrl-point velocity) (* -1.0 (-> this info drag-factor) (fmin 1.0 f30-0))) + (let ((v1-11 (-> this rbody)) (a1-13 (-> ctrl-point world-pos)) ) (rigid-body-method-18 (-> v1-11 state) a1-13 s4-0) @@ -149,15 +149,15 @@ (none) ) -(defmethod rigid-body-object-method-50 rigid-body-platform ((obj rigid-body-platform) (arg0 float)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force)) - (logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force)) +(defmethod rigid-body-object-method-50 rigid-body-platform ((this rigid-body-platform) (arg0 float)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) + (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force)) ) - (let ((rigid-body (-> obj rbody)) - (force-pos (-> obj player-force-position)) - (force (-> obj player-force)) - (force-dist (-> obj info player-force-distance)) + (let ((rigid-body (-> this rbody)) + (force-pos (-> this player-force-position)) + (force (-> this player-force)) + (force-dist (-> this info player-force-distance)) ) (rigid-body-method-21 (-> rigid-body state) force-pos force force-dist) ) @@ -166,25 +166,25 @@ (none) ) -(defmethod rigid-body-platform-method-55 rigid-body-platform ((obj rigid-body-platform)) +(defmethod rigid-body-platform-method-55 rigid-body-platform ((this rigid-body-platform)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (vector-float*! a1-0 *y-vector* (* -1.0 (-> obj info extra gravity) (-> obj rbody state info mass))) - (rigid-body-method-20 (-> obj rbody state) a1-0) + (vector-float*! a1-0 *y-vector* (* -1.0 (-> this info extra gravity) (-> this rbody state info mass))) + (rigid-body-method-20 (-> this rbody state) a1-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-56 rigid-body-platform ((obj rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-56 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj rbody state position)) + (vector-! v1-0 arg0 (-> this rbody state position)) (set! (-> v1-0 y) 0.0) (let* ((f0-1 (vector-length v1-0)) (f1-1 (* 10.0 (fmax 0.0 (fmin 4096.0 (+ -4096.0 f0-1))))) ) (when (< 0.0 f1-1) (vector-float*! v1-0 v1-0 (/ f1-1 f0-1)) - (rigid-body-method-20 (-> obj rbody state) v1-0) + (rigid-body-method-20 (-> this rbody state) v1-0) ) ) ) @@ -192,63 +192,63 @@ (none) ) -(defmethod rigid-body-object-method-29 rigid-body-platform ((obj rigid-body-platform) (arg0 float)) - (let ((s4-0 (-> obj rbody state matrix))) - (dotimes (s3-0 (-> obj info control-point-count)) - (let ((s2-0 (-> obj control-point-array data s3-0))) +(defmethod rigid-body-object-method-29 rigid-body-platform ((this rigid-body-platform) (arg0 float)) + (let ((s4-0 (-> this rbody state matrix))) + (dotimes (s3-0 (-> this info control-point-count)) + (let ((s2-0 (-> this control-point-array data s3-0))) (vector-matrix*! (-> s2-0 world-pos) (-> s2-0 local-pos) s4-0) - (let ((v1-4 (-> obj rbody)) + (let ((v1-4 (-> this rbody)) (a1-2 (-> s2-0 world-pos)) (a2-1 (-> s2-0 velocity)) ) (rigid-body-method-22 (-> v1-4 state) a1-2 a2-1) ) - (rigid-body-platform-method-54 obj s2-0) + (rigid-body-platform-method-54 this s2-0) ) ) ) - (rigid-body-platform-method-55 obj) - (rigid-body-object-method-50 obj arg0) + (rigid-body-platform-method-55 this) + (rigid-body-object-method-50 this arg0) 0 (none) ) -(defmethod rigid-body-object-method-30 rigid-body-platform ((obj rigid-body-platform)) - (if (-> obj info platform) - (detect-riders! (-> obj root)) +(defmethod rigid-body-object-method-30 rigid-body-platform ((this rigid-body-platform)) + (if (-> this info platform) + (detect-riders! (-> this root)) ) - (set! (-> obj player-velocity-prev quad) (-> obj player-velocity quad)) + (set! (-> this player-velocity-prev quad) (-> this player-velocity quad)) (if *target* - (set! (-> obj player-velocity quad) (-> *target* control transv quad)) - (set! (-> obj player-velocity quad) (-> *null-vector* quad)) + (set! (-> this player-velocity quad) (-> *target* control transv quad)) + (set! (-> this player-velocity quad) (-> *null-vector* quad)) ) (let ((t9-1 (method-of-type rigid-body-object rigid-body-object-method-30))) - (t9-1 obj) + (t9-1 this) ) - (logclear! (-> obj flags) (rigid-body-object-flag player-contact-force)) + (logclear! (-> this flags) (rigid-body-object-flag player-contact-force)) 0 (none) ) -(defmethod rigid-body-object-method-47 rigid-body-platform ((obj rigid-body-platform) +(defmethod rigid-body-object-method-47 rigid-body-platform ((this rigid-body-platform) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate) ) - ((method-of-type rigid-body-object rigid-body-object-method-47) obj arg0 arg1 arg2 arg3) + ((method-of-type rigid-body-object rigid-body-object-method-47) this arg0 arg1 arg2 arg3) #f ) -(defmethod rigid-body-object-method-46 rigid-body-platform ((obj rigid-body-platform) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 rigid-body-platform ((this rigid-body-platform) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('edge-grabbed) (let ((v1-1 (the-as object (-> arg3 param 0)))) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) - (logior! (-> obj flags) (rigid-body-object-flag player-contact-force)) - (set! (-> obj player-force-position quad) (-> (the-as rigid-body-control-point v1-1) velocity quad)) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (* -1.0 (-> obj info player-weight))) + (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) + (logior! (-> this flags) (rigid-body-object-flag player-contact-force)) + (set! (-> this player-force-position quad) (-> (the-as rigid-body-control-point v1-1) velocity quad)) + (vector-reset! (-> this player-force)) + (set! (-> this player-force y) (* -1.0 (-> this info player-weight))) ) ) ) @@ -265,19 +265,19 @@ (logtest? (-> v1-11 mask) (process-mask target)) (not (logtest? (-> v1-11 focus-status) (focus-status on-water under-water))) ) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) - (logior! (-> obj flags) (rigid-body-object-flag player-contact-force)) - (set! (-> obj player-force-position quad) (-> v1-11 root trans quad)) - (vector-reset! (-> obj player-force)) - (let* ((a1-5 (-> obj player-force-position)) + (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) + (logior! (-> this flags) (rigid-body-object-flag player-contact-force)) + (set! (-> this player-force-position quad) (-> v1-11 root trans quad)) + (vector-reset! (-> this player-force)) + (let* ((a1-5 (-> this player-force-position)) (f30-0 0.0) (f28-0 1.0) (f26-0 1.0) - (f0-4 (+ (- -4096.0 (-> a1-5 y)) (rigid-body-platform-method-53 obj a1-5))) + (f0-4 (+ (- -4096.0 (-> a1-5 y)) (rigid-body-platform-method-53 this a1-5))) (f1-2 12288.0) (f0-8 (fmax f30-0 (fmin f28-0 (- f26-0 (* f0-4 (/ 1.0 f1-2)))))) ) - (set! (-> obj player-force y) (* -1.0 (-> obj info player-weight) f0-8)) + (set! (-> this player-force y) (* -1.0 (-> this info player-weight) f0-8)) ) ) ) @@ -286,10 +286,11 @@ ) ) (('bonk) - (when (>= (- (current-time) (the-as int (-> obj player-bonk-timeout))) - (the-as time-frame (-> obj info player-force-timeout)) - ) - (set! (-> obj player-bonk-timeout) (the-as uint (current-time))) + (when (time-elapsed? + (the-as int (-> this player-bonk-timeout)) + (the-as time-frame (-> this info player-force-timeout)) + ) + (set! (-> this player-bonk-timeout) (the-as uint (current-time))) (let* ((s4-0 arg0) (v1-31 (if (type? s4-0 process-drawable) s4-0 @@ -297,35 +298,35 @@ ) ) (when v1-31 - (logior! (-> obj flags) (rigid-body-object-flag player-impulse-force)) - (set! (-> obj player-force-position quad) (-> v1-31 root trans quad)) + (logior! (-> this flags) (rigid-body-object-flag player-impulse-force)) + (set! (-> this player-force-position quad) (-> v1-31 root trans quad)) (let ((f0-14 (fmin (* 0.00012207031 (the-as float (-> arg3 param 1)) - (-> obj info player-bonk-factor) - (-> obj info player-weight) + (-> this info player-bonk-factor) + (-> this info player-weight) ) - (-> obj info player-force-clamp) + (-> this info player-force-clamp) ) ) ) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (- f0-14)) + (vector-reset! (-> this player-force)) + (set! (-> this player-force y) (- f0-14)) ) ) ) ) ) (else - ((method-of-type rigid-body-object rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) + ((method-of-type rigid-body-object rigid-body-object-method-46) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod rigid-body-object-method-37 rigid-body-platform ((obj rigid-body-platform)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force)) +(defmethod rigid-body-object-method-37 rigid-body-platform ((this rigid-body-platform)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) (sound-play-by-name - (string->sound-name (-> obj info sound-name)) + (string->sound-name (-> this info sound-name)) (new-sound-id) 1024 0 @@ -334,10 +335,10 @@ #t ) ) - (rigid-body-object-method-30 obj) - (quaternion-copy! (-> obj root quat) (-> obj rbody state rotation)) - (let ((v1-9 (-> obj rbody)) - (a1-2 (-> obj root trans)) + (rigid-body-object-method-30 this) + (quaternion-copy! (-> this root quat) (-> this rbody state rotation)) + (let ((v1-9 (-> this rbody)) + (a1-2 (-> this root trans)) ) (rigid-body-method-23 (-> v1-9 state) a1-2) ) @@ -345,34 +346,34 @@ (none) ) -(defmethod alloc-and-init-rigid-body-control rigid-body-platform ((obj rigid-body-platform) (arg0 rigid-body-object-constants)) - (set! (-> obj info) (the-as rigid-body-platform-constants arg0)) - (set! (-> obj rbody) (new 'process 'rigid-body-control obj)) - (set! (-> obj control-point-array) - (new 'process 'rigid-body-control-point-inline-array (-> obj info control-point-count)) +(defmethod alloc-and-init-rigid-body-control rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-object-constants)) + (set! (-> this info) (the-as rigid-body-platform-constants arg0)) + (set! (-> this rbody) (new 'process 'rigid-body-control this)) + (set! (-> this control-point-array) + (new 'process 'rigid-body-control-point-inline-array (-> this info control-point-count)) ) - (update-transforms (-> obj root)) - (let ((v1-5 (-> obj rbody)) - (a1-3 (-> obj info info)) - (a2-2 (-> obj root trans)) - (a3-0 (-> obj root quat)) - (t0-0 (method-of-object obj rigid-body-object-method-29)) + (update-transforms (-> this root)) + (let ((v1-5 (-> this rbody)) + (a1-3 (-> this info info)) + (a2-2 (-> this root trans)) + (a3-0 (-> this root quat)) + (t0-0 (method-of-object this rigid-body-object-method-29)) ) (rigid-body-method-25 (-> v1-5 state) a1-3 a2-2 a3-0 t0-0) ) - (set! (-> obj player-bonk-timeout) (the-as uint (current-time))) - (set! (-> obj player-force quad) (-> *null-vector* quad)) - (set! (-> obj player-velocity quad) (-> *null-vector* quad)) - (set! (-> obj player-velocity-prev quad) (-> *null-vector* quad)) - (set! (-> obj root max-iteration-count) (the-as uint 4)) - (set! (-> obj max-time-step) (-> arg0 extra max-time-step)) - (set! (-> obj water-anim) (the-as water-anim (entity-actor-lookup (-> obj entity) 'water-actor 0))) + (set! (-> this player-bonk-timeout) (the-as uint (current-time))) + (set! (-> this player-force quad) (-> *null-vector* quad)) + (set! (-> this player-velocity quad) (-> *null-vector* quad)) + (set! (-> this player-velocity-prev quad) (-> *null-vector* quad)) + (set! (-> this root max-iteration-count) (the-as uint 4)) + (set! (-> this max-time-step) (-> arg0 extra max-time-step)) + (set! (-> this water-anim) (the-as water-anim (entity-actor-lookup (-> this entity) 'water-actor 0))) 0 (none) ) -(defmethod allocate-and-init-cshape rigid-body-platform ((obj rigid-body-platform)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod allocate-and-init-cshape rigid-body-platform ((this rigid-body-platform)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -393,7 +394,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -433,12 +434,12 @@ ) ) -(defmethod init-skel-and-rigid-body rigid-body-platform ((obj rigid-body-platform)) - (set! (-> obj float-height-offset) 0.0) - (alloc-and-init-rigid-body-control obj *rigid-body-platform-constants*) - (let ((s5-0 (-> obj info control-point-count))) +(defmethod init-skel-and-rigid-body rigid-body-platform ((this rigid-body-platform)) + (set! (-> this float-height-offset) 0.0) + (alloc-and-init-rigid-body-control this *rigid-body-platform-constants*) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0))))) (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) (set! (-> s3-0 local-pos y) -10240.0) @@ -452,18 +453,18 @@ (none) ) -(defmethod init-from-entity! rigid-body-platform ((obj rigid-body-platform) (arg0 entity-actor)) +(defmethod init-from-entity! rigid-body-platform ((this rigid-body-platform) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask platform)) - (allocate-and-init-cshape obj) - (process-drawable-from-entity! obj arg0) - (init-skel-and-rigid-body obj) - (rigid-body-object-method-34 obj) + (logior! (-> this mask) (process-mask platform)) + (allocate-and-init-cshape this) + (process-drawable-from-entity! this arg0) + (init-skel-and-rigid-body this) + (rigid-body-object-method-34 this) 0 (none) ) diff --git a/goal_src/jak2/engine/common_objs/voicebox.gc b/goal_src/jak2/engine/common_objs/voicebox.gc index ef4ece9592..bc43d12011 100644 --- a/goal_src/jak2/engine/common_objs/voicebox.gc +++ b/goal_src/jak2/engine/common_objs/voicebox.gc @@ -89,19 +89,19 @@ :sort 1 ) -(defmethod get-track-pt-and-scale remote ((obj remote) (arg0 vector)) - (let ((s4-0 (handle->process (-> obj focus handle)))) +(defmethod get-track-pt-and-scale remote ((this remote) (arg0 vector)) + (let ((s4-0 (handle->process (-> this focus handle)))) (when s4-0 (set! (-> arg0 quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) (let ((a0-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s4-0) 0)))) - (vector+float*! arg0 arg0 a0-7 (* -16384.0 (- 1.0 (-> obj blend)))) + (vector+float*! arg0 arg0 a0-7 (* -16384.0 (- 1.0 (-> this blend)))) ) ) ) - (lerp-scale 1.0 0.0 (-> obj blend) 0.8 1.0) + (lerp-scale 1.0 0.0 (-> this blend) 0.8 1.0) ) -(defmethod post-common remote ((obj remote)) +(defmethod post-common remote ((this remote)) (with-pp (rlet ((acc :class vf) (vf0 :class vf) @@ -112,21 +112,21 @@ ) (init-vf0-vector) (ja-post) - (if (type? (-> obj root) collide-shape) - (update-transforms (the-as collide-shape (-> obj root))) + (if (type? (-> this root) collide-shape) + (update-transforms (the-as collide-shape (-> this root))) ) - (when (and (nonzero? (-> obj part)) (and (or (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (and (-> obj next-state) (= (-> obj next-state name) 'enter)) - ) - (-> obj speak-effect?) - ) + (when (and (nonzero? (-> this part)) (and (or (and (-> this next-state) (= (-> this next-state name) 'idle)) + (and (-> this next-state) (= (-> this next-state name) 'enter)) + ) + (-> this speak-effect?) + ) ) (let ((v1-15 - (vector-float*! (new 'stack-no-clear 'vector) (-> obj parent 0 velocity) (-> pp clock frames-per-second)) + (vector-float*! (new 'stack-no-clear 'vector) (-> this parent 0 velocity) (-> pp clock frames-per-second)) ) (a0-8 *particle-vel*) ) - (let ((a1-4 (-> obj node-list data 3 bone transform vector 2))) + (let ((a1-4 (-> this node-list data 3 bone transform vector 2))) (let ((a2-1 20480.0)) (.mov vf7 a2-1) ) @@ -144,7 +144,7 @@ ) (vector-float*! v1-16 a0-9 (/ 1.0 f0-2)) ) - (spawn-with-cspace (-> obj part) (-> obj node-list data 3)) + (spawn-with-cspace (-> this part) (-> this node-list data 3)) ) 0 (none) @@ -310,17 +310,17 @@ ) ;; WARN: Return type mismatch remote vs none. -(defmethod init remote ((obj remote)) - (reset-to-collide-spec (-> obj focus) (collide-spec jak player-list)) +(defmethod init remote ((this remote)) + (reset-to-collide-spec (-> this focus) (collide-spec jak player-list)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-voicebox" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj blend) 1.0) - (set! (-> obj draw light-index) (the-as uint 30)) - (set! (-> obj speak-effect?) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 77) obj)) + (set! (-> this blend) 1.0) + (set! (-> this draw light-index) (the-as uint 30)) + (set! (-> this speak-effect?) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 77) this)) (none) ) @@ -352,10 +352,10 @@ :virtual #t :code (behavior () (remove-setting! 'sound-flava) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self seeker target) 1.0) (while (and (< (-> self blend) 0.9999) (not (and (not (handle->process (-> self hint))) - (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) (-> *setting-control* user-current hint) ) ) @@ -412,24 +412,25 @@ ) -(defmethod get-track-pt-and-scale judge ((obj judge) (arg0 vector)) - (set! (-> arg0 quad) (-> obj base-trans quad)) +(defmethod get-track-pt-and-scale judge ((this judge) (arg0 vector)) + (set! (-> arg0 quad) (-> this base-trans quad)) 1.0 ) -(defmethod post-common judge ((obj judge)) +(defmethod post-common judge ((this judge)) (ja-post) - (if (type? (-> obj root) collide-shape) - (update-transforms (the-as collide-shape (-> obj root))) + (if (type? (-> this root) collide-shape) + (update-transforms (the-as collide-shape (-> this root))) ) - (when (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) - (or (= v1-6 'idle) (= v1-6 'enter)) - ) + (when (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'idle) (= v1-6 'enter)) + ) ) (if *target* (set! (-> *game-info* score) (-> *target* fact trick-point)) ) - (let ((v1-15 (the-as int (- (-> obj total-time) (- (-> *display* game-clock frame-counter) (-> obj start-time)))))) + (let ((v1-15 (the-as int (- (-> this total-time) (- (-> *display* game-clock frame-counter) (-> this start-time))))) + ) (if (< (the-as time-frame v1-15) 0) (set! v1-15 0) ) @@ -515,8 +516,8 @@ ) ) -(defmethod setup-collision judge ((obj judge)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod setup-collision judge ((this judge)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list tobot)) @@ -529,27 +530,27 @@ (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! judge ((obj judge) (arg0 entity-actor)) +(defmethod init-from-entity! judge ((this judge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (setup-collision obj) - (init obj) - (process-drawable-from-entity! obj arg0) - (+! (-> obj root trans y) 4096.0) - (set! (-> obj base-trans quad) (-> obj root trans quad)) - (set! (-> obj total-time) (seconds 90)) - (go (method-of-object obj wait)) + (setup-collision this) + (init this) + (process-drawable-from-entity! this arg0) + (+! (-> this root trans y) 4096.0) + (set! (-> this base-trans quad) (-> this root trans quad)) + (set! (-> this total-time) (seconds 90)) + (go (method-of-object this wait)) (none) ) diff --git a/goal_src/jak2/engine/common_objs/water-anim.gc b/goal_src/jak2/engine/common_objs/water-anim.gc index 2cceec54c0..eb05d42105 100644 --- a/goal_src/jak2/engine/common_objs/water-anim.gc +++ b/goal_src/jak2/engine/common_objs/water-anim.gc @@ -41,11 +41,11 @@ ) -(defmethod relocate water-anim ((obj water-anim) (arg0 int)) - (if (nonzero? (-> obj flow)) - (&+! (-> obj flow) arg0) +(defmethod relocate water-anim ((this water-anim) (arg0 int)) + (if (nonzero? (-> this flow)) + (&+! (-> this flow) arg0) ) - ((the-as (function water-anim int water-anim) (find-parent-method water-anim 7)) obj arg0) + ((the-as (function water-anim int water-anim) (find-parent-method water-anim 7)) this arg0) ) (defskelgroup skel-water-anim-nest-dark-eco-largepool water-anim-nest-dark-eco water-anim-nest-dark-eco-largepool-lod0-jg -1 @@ -436,63 +436,63 @@ ) ) -(defmethod move-to-point! water-anim ((obj water-anim) (arg0 vector)) +(defmethod move-to-point! water-anim ((this water-anim) (arg0 vector)) "Set a [[water-anim]]'s `trans` as specified by the [[vector]] and update `water-height`." - (set! (-> obj root trans quad) (-> arg0 quad)) - (set! (-> obj water-height) (-> obj root trans y)) - (if (nonzero? (-> obj sound)) - (update-trans! (-> obj sound) (-> obj root trans)) + (set! (-> this root trans quad) (-> arg0 quad)) + (set! (-> this water-height) (-> this root trans y)) + (if (nonzero? (-> this sound)) + (update-trans! (-> this sound) (-> this root trans)) ) ) -(defmethod get-ripple-height water-anim ((obj water-anim) (arg0 vector)) - (ripple-find-height obj 0 arg0) +(defmethod get-ripple-height water-anim ((this water-anim) (arg0 vector)) + (ripple-find-height this 0 arg0) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod water-anim-method-27 water-anim ((obj water-anim)) +(defmethod water-anim-method-27 water-anim ((this water-anim)) "Empty." (none) ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod offset! water-anim ((obj water-anim)) +(defmethod offset! water-anim ((this water-anim)) "Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`." (local-vars (sv-16 res-tag)) - (set! (-> obj play-ambient-sound?) #t) - (set! (-> obj visible) #t) - (set! (-> obj look) - (res-lump-value (-> obj entity) 'look int :default (the-as uint128 -1) :time -1000000000.0) + (set! (-> this play-ambient-sound?) #t) + (set! (-> this visible) #t) + (set! (-> this look) + (res-lump-value (-> this entity) 'look int :default (the-as uint128 -1) :time -1000000000.0) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-4 (res-lump-data (-> obj entity) 'trans-offset vector :tag-ptr (& sv-16)))) + (let ((v1-4 (res-lump-data (-> this entity) 'trans-offset vector :tag-ptr (& sv-16)))) (when v1-4 - (+! (-> obj root trans x) (-> v1-4 x)) - (+! (-> obj root trans y) (-> v1-4 y)) - (+! (-> obj root trans z) (-> v1-4 z)) + (+! (-> this root trans x) (-> v1-4 x)) + (+! (-> this root trans y) (-> v1-4 y)) + (+! (-> this root trans z) (-> v1-4 z)) ) ) - (let ((f0-6 (res-lump-float (-> obj entity) 'rotoffset))) + (let ((f0-6 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-6 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-6) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-6) ) ) (none) ) -(defmethod init-water! water-anim ((obj water-anim)) +(defmethod init-water! water-anim ((this water-anim)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" - (let ((s5-0 (-> obj look))) + (let ((s5-0 (-> this look))) (if (or (< s5-0 0) (>= s5-0 (-> *water-anim-look* length))) (go process-drawable-art-error "skel group") ) (let ((s5-1 (-> *water-anim-look* s5-0))) - (initialize-skeleton-by-name obj (-> s5-1 skel-group)) + (initialize-skeleton-by-name this (-> s5-1 skel-group)) (ja-channel-set! 1) - (let ((s4-0 (-> obj skel root-channel 0))) + (let ((s4-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-0 - (the-as art-joint-anim (-> obj draw art-group data (-> s5-1 anim))) + (the-as art-joint-anim (-> this draw art-group data (-> s5-1 anim))) num-func-identity ) (set! (-> s4-0 frame-num) 0.0) @@ -500,8 +500,8 @@ (let ((a2-1 (-> s5-1 ambient-sound-spec))) (when a2-1 (let ((a3-0 (new 'stack-no-clear 'vector))) - (vector+! a3-0 (-> obj root trans) (-> obj draw bounds)) - (set! (-> obj sound) (new 'process 'ambient-sound a2-1 a3-0)) + (vector+! a3-0 (-> this root trans) (-> this draw bounds)) + (set! (-> this sound) (new 'process 'ambient-sound a2-1 a3-0)) ) ) ) @@ -511,44 +511,44 @@ (none) ) -(defmethod reset-root! water-anim ((obj water-anim)) +(defmethod reset-root! water-anim ((this water-anim)) "Reset a [[water-anim]]'s `root`." (let ((v0-0 (new 'process 'trsqv))) - (set! (-> obj root) v0-0) + (set! (-> this root) v0-0) v0-0 ) ) ;; WARN: Return type mismatch water-flags vs none. -(defmethod water-anim-init! water-anim ((obj water-anim)) +(defmethod water-anim-init! water-anim ((this water-anim)) "Initialize a [[water-anim]]." (local-vars (sv-16 res-tag)) - (set! (-> obj attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) - (-> obj entity) - 'attack-event - 'interp - -1000000000.0 - (the-as structure 'drown) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) + (-> this entity) + 'attack-event + 'interp + -1000000000.0 + (the-as structure 'drown) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) - (process-drawable-from-entity! obj (-> obj entity)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj vol) (new 'process 'vol-control obj)) - (logior! (-> obj vol flags) (vol-flags display? vol-flags-1)) - (set! (-> obj bottom-height) 32768.0) + (process-drawable-from-entity! this (-> this entity)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this vol) (new 'process 'vol-control this)) + (logior! (-> this vol flags) (vol-flags display? vol-flags-1)) + (set! (-> this bottom-height) 32768.0) (let* ((v1-8 *game-info*) (a0-7 (+ (-> v1-8 attack-id) 1)) ) (set! (-> v1-8 attack-id) a0-7) - (set! (-> obj attack-id) a0-7) + (set! (-> this attack-id) a0-7) ) - (set! (-> obj target) (the-as handle #f)) + (set! (-> this target) (the-as handle #f)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-10 (the-as (pointer float) ((method-of-type res-lump get-property-data) - (-> obj entity) + (-> this entity) 'water-height 'exact -1000000000.0 @@ -560,28 +560,28 @@ ) ) (when v1-10 - (set! (-> obj water-height) (-> v1-10 0)) - (set! (-> obj wade-height) (-> v1-10 1)) - (set! (-> obj swim-height) (-> v1-10 2)) + (set! (-> this water-height) (-> v1-10 0)) + (set! (-> this wade-height) (-> v1-10 1)) + (set! (-> this swim-height) (-> v1-10 2)) (if (>= (-> sv-16 elt-count) (the-as uint 4)) - (set! (-> obj flags) (the-as water-flags (the int (-> v1-10 3)))) + (set! (-> this flags) (the-as water-flags (the int (-> v1-10 3)))) ) (if (>= (-> sv-16 elt-count) (the-as uint 5)) - (set! (-> obj bottom-height) (-> v1-10 4)) + (set! (-> this bottom-height) (-> v1-10 4)) ) ) ) - (logior! (-> obj flags) (water-flags part-water)) - (if (logtest? (-> obj flags) (water-flags flow)) - (set! (-> obj flow) (new 'process 'flow-control obj (the-as res-lump #f))) + (logior! (-> this flags) (water-flags part-water)) + (if (logtest? (-> this flags) (water-flags flow)) + (set! (-> this flow) (new 'process 'flow-control this (the-as res-lump #f))) ) (cond - ((zero? (-> obj flags)) - (if (< 0.0 (-> obj wade-height)) - (logior! (-> obj flags) (water-flags can-wade)) + ((zero? (-> this flags)) + (if (< 0.0 (-> this wade-height)) + (logior! (-> this flags) (water-flags can-wade)) ) - (if (< 0.0 (-> obj swim-height)) - (logior! (-> obj flags) (water-flags can-swim)) + (if (< 0.0 (-> this swim-height)) + (logior! (-> this flags) (water-flags can-swim)) ) ) (else @@ -603,18 +603,18 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! water-anim ((obj water-anim) (arg0 entity-actor)) +(defmethod init-from-entity! water-anim ((this water-anim) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (water-anim-method-27 obj) - (reset-root! obj) - (water-anim-init! obj) - (offset! obj) - (init-water! obj) - (go (method-of-object obj idle)) + (water-anim-method-27 this) + (reset-root! this) + (water-anim-init! this) + (offset! this) + (init-water! this) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/engine/common_objs/water-flow.gc b/goal_src/jak2/engine/common_objs/water-flow.gc index 334bc61f39..5737f0c52f 100644 --- a/goal_src/jak2/engine/common_objs/water-flow.gc +++ b/goal_src/jak2/engine/common_objs/water-flow.gc @@ -61,18 +61,18 @@ ) -(defmethod relocate flow-control ((obj flow-control) (arg0 int)) - (if (nonzero? (-> obj sections)) - (&+! (-> obj sections) arg0) +(defmethod relocate flow-control ((this flow-control) (arg0 int)) + (if (nonzero? (-> this sections)) + (&+! (-> this sections) arg0) ) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - ((the-as (function flow-control int flow-control) (find-parent-method flow-control 7)) obj arg0) + ((the-as (function flow-control int flow-control) (find-parent-method flow-control 7)) this arg0) ) -(defmethod draw-path flow-control ((obj flow-control)) - (let ((a0-1 (-> obj path))) +(defmethod draw-path flow-control ((this flow-control)) + (let ((a0-1 (-> this path))) (if (nonzero? a0-1) (debug-draw a0-1) ) @@ -82,7 +82,7 @@ ) ;; WARN: Function (method 11 flow-control) has a return type of none, but the expression builder found a return statement. -(defmethod push-process flow-control ((obj flow-control) (arg0 process-focusable)) +(defmethod push-process flow-control ((this flow-control) (arg0 process-focusable)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -94,17 +94,17 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans arg0 0) quad)) (set! (-> s5-0 w) 1.0) - (when (>= (vector4-dot s5-0 (the-as vector (-> obj leading))) 0.0) - (let* ((v1-7 (-> obj sections)) + (when (>= (vector4-dot s5-0 (the-as vector (-> this leading))) 0.0) + (let* ((v1-7 (-> this sections)) (a0-3 (-> v1-7 length)) - (a3-0 (the-as object (-> obj leading))) + (a3-0 (the-as object (-> this leading))) ) (dotimes (s3-1 a0-3) (let ((s2-0 (-> v1-7 data s3-1))) (when (< (vector4-dot s5-0 (the-as vector (-> s2-0 trailing))) 0.0) (let ((v1-8 (new 'stack-no-clear 'vector))) (vector-! v1-8 s5-0 (-> s2-0 start)) - (when (>= (-> obj belt-radius) (fabs (vector-dot v1-8 (-> s2-0 radial-dir)))) + (when (>= (-> this belt-radius) (fabs (vector-dot v1-8 (-> s2-0 radial-dir)))) (let* ((f0-7 (vector-dot v1-8 (-> s2-0 pull-dir))) (f0-9 (- (-> v1-8 y) (* (-> s2-0 pull-dir y) f0-7))) ) @@ -133,9 +133,9 @@ (let ((f0-12 (/ f30-0 (- f30-0 f0-10))) (s2-1 (new 'stack-no-clear 'vector)) ) - (displacement-between-two-points-normalized! (-> obj path) s2-1 (+ (the float s3-1) f0-12)) + (displacement-between-two-points-normalized! (-> this path) s2-1 (+ (the float s3-1) f0-12)) (let ((v1-17 (new 'stack-no-clear 'vector))) - (vector-float*! v1-17 s2-1 (* (-> obj speed) (seconds-per-frame))) + (vector-float*! v1-17 s2-1 (* (-> this speed) (seconds-per-frame))) (let ((a1-15 (new 'stack-no-clear 'vector))) (let ((a0-17 v1-17)) (let ((a2-9 2048.0)) @@ -171,7 +171,7 @@ ) ) -(defmethod find-and-push-things flow-control ((obj flow-control)) +(defmethod find-and-push-things flow-control ((this flow-control)) (local-vars (a0-10 float) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -183,7 +183,7 @@ (init-vf0-vector) (set! *actor-list-length* 0) (if #t - (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* (-> obj collide-bounds) *actor-list* 256)) + (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* (-> this collide-bounds) *actor-list* 256)) ) (when #t (let ((a0-2 (-> *collide-player-list* alive-list next0))) @@ -196,7 +196,7 @@ (when (logtest? (-> a1-1 prim-core collide-as) (collide-spec jak bot enemy hit-by-others-list player-list)) (let ((a1-2 (-> a1-1 prim-core))) (let ((a2-4 a1-2) - (a3-1 (-> obj collide-bounds)) + (a3-1 (-> this collide-bounds)) ) (.lvf vf2 (&-> a2-4 world-sphere quad)) (.lvf vf3 (&-> a3-1 quad)) @@ -207,7 +207,7 @@ (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-5 vf1) (let ((f0-0 a2-5) - (f1-1 (+ (-> a1-2 world-sphere w) (-> obj collide-bounds r))) + (f1-1 (+ (-> a1-2 world-sphere w) (-> this collide-bounds r))) ) (when (< f0-0 (* f1-1 f1-1)) (when (< *actor-list-length* 256) @@ -241,7 +241,7 @@ ) (let ((a1-14 (-> a1-13 prim-core))) (let ((a2-11 a1-14) - (a3-2 (-> obj collide-bounds)) + (a3-2 (-> this collide-bounds)) ) (.lvf vf2 (&-> a2-11 world-sphere quad)) (.lvf vf3 (&-> a3-2 quad)) @@ -252,7 +252,7 @@ (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-12 vf1) (let ((f0-1 a2-12) - (f1-5 (+ (-> a1-14 world-sphere w) (-> obj collide-bounds r))) + (f1-5 (+ (-> a1-14 world-sphere w) (-> this collide-bounds r))) ) (b! (>= f0-1 (* f1-5 f1-5)) cfg-17 :delay #f) ) @@ -278,7 +278,7 @@ (a0-9 (-> v1-23 root-prim)) ) (when (logtest? (-> a0-9 prim-core collide-as) (collide-spec jak bot enemy hit-by-others-list player-list)) - (.lvf vf1 (&-> obj collide-bounds quad)) + (.lvf vf1 (&-> this collide-bounds quad)) (.lvf vf2 (&-> a0-9 prim-core world-sphere quad)) (.sub.vf vf3 vf1 vf2) (.add.w.vf vf4 vf1 vf2 :mask #b1000) @@ -299,7 +299,7 @@ ) ) (if a1-29 - (push-process obj (the-as process-focusable a1-29)) + (push-process this (the-as process-focusable a1-29)) ) ) ) @@ -317,24 +317,24 @@ ) ) -(defmethod setup flow-control ((obj flow-control)) +(defmethod setup flow-control ((this flow-control)) (local-vars (sv-32 flow-section) (sv-48 flow-section)) - (let* ((s5-0 (-> obj path)) + (let* ((s5-0 (-> this path)) (s4-0 (-> s5-0 curve num-cverts)) (s3-0 (new 'stack-no-clear 'vector)) ) (let ((s2-0 (new 'process 'flow-section-array (+ s4-0 -1)))) - (set! (-> obj sections) s2-0) - (set! (-> obj collide-bounds quad) (the-as uint128 0)) + (set! (-> this sections) s2-0) + (set! (-> this collide-bounds quad) (the-as uint128 0)) (get-point-in-path! s5-0 s3-0 0.0 'interp) - (vector+! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) s3-0) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (let ((s1-0 (+ s4-0 -1))) (set! sv-32 (the-as flow-section #f)) (dotimes (s0-0 s1-0) (set! sv-48 (-> s2-0 data s0-0)) (set! (-> sv-48 start quad) (-> s3-0 quad)) (get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'interp) - (vector+! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) s3-0) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start)) (vector-normalize! (-> sv-48 pull-dir) 1.0) (set! (-> sv-48 trailing quad) (-> sv-48 pull-dir quad)) @@ -356,25 +356,25 @@ ) ) ) - (let ((s2-1 (-> obj sections data))) - (set! (-> obj leading quad) (-> s2-1 0 pull-dir quad)) - (set! (-> obj leading y) 0.0) - (vector-normalize! (-> obj leading) 1.0) - (set! (-> obj leading w) (- (vector-dot (the-as vector (-> s2-1 0)) (the-as vector (-> obj leading))))) + (let ((s2-1 (-> this sections data))) + (set! (-> this leading quad) (-> s2-1 0 pull-dir quad)) + (set! (-> this leading y) 0.0) + (vector-normalize! (-> this leading) 1.0) + (set! (-> this leading w) (- (vector-dot (the-as vector (-> s2-1 0)) (the-as vector (-> this leading))))) ) (let ((f0-19 (/ 1.0 (the float s4-0))) (f30-0 0.0) ) - (vector-float*! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) f0-19) + (vector-float*! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) f0-19) (dotimes (s2-2 s4-0) (get-point-in-path! s5-0 s3-0 (the float s2-2) 'interp) - (let ((f0-22 (vector-vector-distance-squared s3-0 (-> obj collide-bounds)))) + (let ((f0-22 (vector-vector-distance-squared s3-0 (-> this collide-bounds)))) (if (< f30-0 f0-22) (set! f30-0 f0-22) ) ) ) - (set! (-> obj collide-bounds r) (+ (sqrtf f30-0) (-> obj belt-radius))) + (set! (-> this collide-bounds r) (+ (sqrtf f30-0) (-> this belt-radius))) ) ) 0 diff --git a/goal_src/jak2/engine/common_objs/water-h.gc b/goal_src/jak2/engine/common_objs/water-h.gc index 48a096879c..b84f217d41 100644 --- a/goal_src/jak2/engine/common_objs/water-h.gc +++ b/goal_src/jak2/engine/common_objs/water-h.gc @@ -61,6 +61,7 @@ :flag-assert #x90000003c ) + (deftype water-control (basic) ((flags water-flags :offset-assert 4) (process target :offset-assert 8) @@ -118,7 +119,8 @@ ) ) -(defmethod display-water-marks? water-control ((obj water-control)) + +(defmethod display-water-marks? water-control ((this water-control)) *display-water-marks* ) @@ -144,8 +146,8 @@ ) ) -(defmethod distance-from-surface water-control ((obj water-control)) - (- (-> obj top 0 y) (-> obj height)) +(defmethod distance-from-surface water-control ((this water-control)) + (- (-> this top 0 y) (-> this height)) ) (deftype water-vol (process-hidden) @@ -153,4 +155,4 @@ :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 - ) \ No newline at end of file + ) diff --git a/goal_src/jak2/engine/common_objs/water.gc b/goal_src/jak2/engine/common_objs/water.gc index 47f934a052..99cf8e20cb 100644 --- a/goal_src/jak2/engine/common_objs/water.gc +++ b/goal_src/jak2/engine/common_objs/water.gc @@ -648,126 +648,130 @@ ) ) -(defmethod water-control-method-9 water-control ((obj water-control)) +(defmethod water-control-method-9 water-control ((this water-control)) 0 (none) ) -(defmethod water-control-method-10 water-control ((obj water-control)) +(defmethod water-control-method-10 water-control ((this water-control)) (local-vars (sv-272 (function vector entity-actor skeleton-group vector object none :behavior manipy)) (sv-288 vector) (sv-304 entity-actor) ) (with-pp - (let ((s4-0 (-> obj flags)) + (let ((s4-0 (-> this flags)) (s5-0 (new 'stack-no-clear 'water-info)) ) - (when (logtest? (water-flags find-water) (-> obj flags)) - (water-info-init! (the-as collide-shape (-> obj process control)) s5-0 (collide-action solid semi-solid)) - (set! (-> obj flags) + (when (logtest? (water-flags find-water) (-> this flags)) + (water-info-init! (the-as collide-shape (-> this process control)) s5-0 (collide-action solid semi-solid)) + (set! (-> this flags) (logior (logclear - (-> obj flags) + (-> this flags) (water-flags active can-wade can-swim can-ground use-ocean tar mud use-water-anim swamp over-water) ) (logclear (-> s5-0 flags) (water-flags touch-water)) ) ) - (set! (-> obj base-height) (-> s5-0 base-height)) - (set! (-> obj base-ocean-offset) (- (-> s5-0 trans y) (-> s5-0 base-height))) + (set! (-> this base-height) (-> s5-0 base-height)) + (set! (-> this base-ocean-offset) (- (-> s5-0 trans y) (-> s5-0 base-height))) ) (cond - ((not (logtest? (-> obj flags) (water-flags active))) + ((not (logtest? (-> this flags) (water-flags active))) (logclear! - (-> obj flags) + (-> this flags) (water-flags under-water head-under-water bouncing wading swimming touch-water jump-out break-surface) ) ) - ((and (logtest? (-> obj flags) (water-flags no-grab-ground)) - (logtest? (-> obj process focus-status) (focus-status grabbed)) + ((and (logtest? (-> this flags) (water-flags no-grab-ground)) + (logtest? (-> this process focus-status) (focus-status grabbed)) ) - (logior! (-> obj flags) (water-flags jump-out)) - (logclear! (-> obj flags) (water-flags break-surface)) + (logior! (-> this flags) (water-flags jump-out)) + (logclear! (-> this flags) (water-flags break-surface)) ) ((begin - (set! (-> obj top 1 quad) (-> obj top 0 quad)) - (vector<-cspace! (the-as vector (-> obj top)) (-> obj process node-list data (-> obj joint-index))) - (+! (-> obj top 0 y) (-> obj top-y-offset)) - (set! (-> obj bottom 1 quad) (-> obj bottom 0 quad)) - (set! (-> obj bottom 0 quad) (-> obj process control trans quad)) - (logclear! (-> obj flags) (water-flags under-water head-under-water bouncing wading swimming break-surface)) - (set! (-> obj bob-offset) (update! (-> obj bob))) + (set! (-> this top 1 quad) (-> this top 0 quad)) + (vector<-cspace! (the-as vector (-> this top)) (-> this process node-list data (-> this joint-index))) + (+! (-> this top 0 y) (-> this top-y-offset)) + (set! (-> this bottom 1 quad) (-> this bottom 0 quad)) + (set! (-> this bottom 0 quad) (-> this process control trans quad)) + (logclear! (-> this flags) (water-flags under-water head-under-water bouncing wading swimming break-surface)) + (set! (-> this bob-offset) (update! (-> this bob))) (cond - ((logtest? (-> obj flags) (water-flags use-ocean use-water-anim)) - (if (not (logtest? (water-flags touch-water) (-> obj flags))) - (set! (-> obj ocean-offset) (-> obj base-ocean-offset)) - (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj base-ocean-offset) 0.2)) + ((logtest? (-> this flags) (water-flags use-ocean use-water-anim)) + (if (not (logtest? (water-flags touch-water) (-> this flags))) + (set! (-> this ocean-offset) (-> this base-ocean-offset)) + (set! (-> this ocean-offset) (lerp (-> this ocean-offset) (-> this base-ocean-offset) 0.2)) ) - (set! (-> obj base-ocean-offset) 0.0) + (set! (-> this base-ocean-offset) 0.0) ) (else - (set! (-> obj base-ocean-offset) 0.0) - (set! (-> obj base-ocean-offset) 0.0) - (set! (-> obj ocean-offset) 0.0) + (set! (-> this base-ocean-offset) 0.0) + (set! (-> this base-ocean-offset) 0.0) + (set! (-> this ocean-offset) 0.0) ) ) - (if (logtest? (focus-status board pilot) (-> obj process focus-status)) - (set! (-> obj bob-offset) 0.0) + (if (logtest? (focus-status board pilot) (-> this process focus-status)) + (set! (-> this bob-offset) 0.0) ) - (set! (-> obj height) - (+ (-> obj base-height) (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)) + (set! (-> this height) + (+ (-> this base-height) (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)) ) - (set! (-> obj surface-height) (+ (-> obj base-height) (-> obj base-ocean-offset))) + (set! (-> this surface-height) (+ (-> this base-height) (-> this base-ocean-offset))) (cond - ((logtest? (focus-status board pilot) (-> obj process focus-status)) - (set! (-> obj collide-height) (+ -819.2 (-> obj base-ocean-offset) (-> obj base-height))) + ((logtest? (focus-status board pilot) (-> this process focus-status)) + (set! (-> this collide-height) (+ -819.2 (-> this base-ocean-offset) (-> this base-height))) ) - ((logtest? (-> obj flags) (water-flags swim-ground)) - (set! (-> obj collide-height) (- (-> obj height) (-> obj swim-height))) + ((logtest? (-> this flags) (water-flags swim-ground)) + (set! (-> this collide-height) (- (-> this height) (-> this swim-height))) ) (else - (set! (-> obj collide-height) (- (-> obj height) (-> obj bottom-height))) + (set! (-> this collide-height) (- (-> this height) (-> this bottom-height))) ) ) - (set! (-> obj swim-depth) (fmax 0.0 (- (- (-> obj surface-height) (-> obj swim-height)) (-> obj bottom 0 y)))) - (and (>= (-> obj height) (-> obj bottom 0 y)) (logtest? (water-flags touch-water) (-> s5-0 flags))) + (set! (-> this swim-depth) + (fmax 0.0 (- (- (-> this surface-height) (-> this swim-height)) (-> this bottom 0 y))) + ) + (and (>= (-> this height) (-> this bottom 0 y)) (logtest? (water-flags touch-water) (-> s5-0 flags))) ) - (if (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-water)) - (set! (-> obj on-water-time) (current-time)) + (if (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-water)) + (set-time! (-> this on-water-time)) ) - (when (not (logtest? (-> obj flags) (water-flags dark-eco lava))) - (set! (-> obj drip-wetness) 1.0) - (set! (-> obj drip-height) (fmax (- (-> obj surface-height) (-> obj bottom 0 y)) (-> obj drip-height))) - (set! (-> obj drip-speed) 15.0) + (when (not (logtest? (-> this flags) (water-flags dark-eco lava))) + (set! (-> this drip-wetness) 1.0) + (set! (-> this drip-height) (fmax (- (-> this surface-height) (-> this bottom 0 y)) (-> this drip-height))) + (set! (-> this drip-speed) 15.0) ) - (if (and (not (logtest? (water-flags touch-water) (-> obj flags))) - (not (logtest? (-> obj process focus-status) (focus-status touch-water))) + (if (and (not (logtest? (water-flags touch-water) (-> this flags))) + (not (logtest? (-> this process focus-status) (focus-status touch-water))) ) - (enter-water obj) + (enter-water this) ) - (logior! (-> obj flags) (water-flags touch-water)) + (logior! (-> this flags) (water-flags touch-water)) (cond - ((>= (-> obj top 0 y) (-> obj height)) + ((>= (-> this top 0 y) (-> this height)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> obj bottom 0 quad)) - (let ((v1-79 (-> obj process control transv))) + (set! (-> s3-0 quad) (-> this bottom 0 quad)) + (let ((v1-79 (-> this process control transv))) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z)))) ) - (logior! (-> obj flags) (water-flags break-surface)) - (set! (-> s3-0 y) (+ 40.96 (-> obj surface-height))) - (when (and (not (handle->process (-> obj ripple))) (>= (+ (current-time) (seconds -1.5)) (-> obj enter-water-time))) + (logior! (-> this flags) (water-flags break-surface)) + (set! (-> s3-0 y) (+ 40.96 (-> this surface-height))) + (when (and (not (handle->process (-> this ripple))) + (>= (+ (current-time) (seconds -1.5)) (-> this enter-water-time)) + ) (let* ((s1-0 (get-process *default-dead-pool* manipy #x4000)) (s2-0 (when s1-0 (let ((t9-6 (method-of-type manipy activate))) - (t9-6 (the-as manipy s1-0) (-> obj process) (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) + (t9-6 (the-as manipy s1-0) (-> this process) (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) ) (let ((s2-1 run-function-in-process) (s0-0 s1-0) ) (set! sv-272 manipy-init) (set! sv-288 s3-0) - (set! sv-304 (-> obj process entity)) + (set! sv-304 (-> this process entity)) (let ((t0-0 (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f))) (t1-0 #f) (t2-0 0) @@ -787,7 +791,7 @@ ) ) ) - (set! (-> obj ripple) (ppointer->handle s2-0)) + (set! (-> this ripple) (ppointer->handle s2-0)) (when s2-0 (send-event (ppointer->process s2-0) 'anim-mode 'loop) (send-event (ppointer->process s2-0) 'art-joint-anim "generic-ripples-cycle" 0) @@ -814,13 +818,13 @@ ) ) ) - (when (and (logtest? (-> obj process draw status) (draw-control-status on-screen)) - (zero? (-> obj process draw cur-lod)) - (logtest? (water-flags part-rings) (-> obj flags)) - (logtest? (water-flags part-water) (-> obj flags)) + (when (and (logtest? (-> this process draw status) (draw-control-status on-screen)) + (zero? (-> this process draw cur-lod)) + (logtest? (water-flags part-rings) (-> this flags)) + (logtest? (water-flags part-water) (-> this flags)) ) - (let* ((f30-0 (y-angle (-> obj process control))) - (v1-141 (-> obj process control transv)) + (let* ((f30-0 (y-angle (-> this process control))) + (v1-141 (-> this process control transv)) (f28-0 (sqrtf (+ (* (-> v1-141 x) (-> v1-141 x)) (* (-> v1-141 z) (-> v1-141 z))))) ) (set! (-> *part-id-table* 506 init-specs 4 initial-valuef) (+ 24576.0 f30-0)) @@ -828,119 +832,119 @@ (set! (-> *part-id-table* 506 init-specs 1 initial-valuef) (* 0.0000036621095 f28-0)) (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (* 0.1 f28-0)) (set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111) - (set! (-> *part-id-table* 506 init-specs 3 initial-valuef) (-> obj wake-size)) - (set! (-> *part-id-table* 506 init-specs 5 initial-valuef) (-> obj wake-size)) + (set! (-> *part-id-table* 506 init-specs 3 initial-valuef) (-> this wake-size)) + (set! (-> *part-id-table* 506 init-specs 5 initial-valuef) (-> this wake-size)) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 506) s3-0) (set! (-> *part-id-table* 509 init-specs 1 initial-valuef) (* 0.000004150391 f28-0)) (set! (-> *part-id-table* 509 init-specs 18 initial-valuef) f30-0) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 509) s3-0) (when (< f28-0 4096.0) - (set! (-> *part-id-table* 504 init-specs 2 random-rangef) (-> obj ripple-size)) + (set! (-> *part-id-table* 504 init-specs 2 random-rangef) (-> this ripple-size)) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 504) s3-0) ) ) ) - (if (< (-> obj top 1 y) (-> obj height)) - (spawn-ripples obj 0.2 s3-0 1 (-> obj process control transv) #t) + (if (< (-> this top 1 y) (-> this height)) + (spawn-ripples this 0.2 s3-0 1 (-> this process control transv) #t) ) ) ) (else - (logior! (-> obj flags) (water-flags head-under-water)) + (logior! (-> this flags) (water-flags head-under-water)) ) ) - (when (and (logtest? (water-flags part-splash) (-> obj flags)) (logtest? (water-flags part-water) (-> obj flags))) + (when (and (logtest? (water-flags part-splash) (-> this flags)) (logtest? (water-flags part-water) (-> this flags))) (cond - ((logtest? (-> obj flags) (water-flags lava)) + ((logtest? (-> this flags) (water-flags lava)) ) - ((logtest? (-> obj flags) (water-flags dark-eco)) + ((logtest? (-> this flags) (water-flags dark-eco)) ) - ((logtest? (focus-status mech) (-> obj process focus-status)) + ((logtest? (focus-status mech) (-> this process focus-status)) ) (else - (let* ((v0-17 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) - (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data v0-17))) + (let* ((v0-17 (rand-vu-int-range 3 (+ (-> this process node-list length) -1))) + (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data v0-17))) ) - (when (< (-> s3-1 y) (-> obj surface-height)) - (set! (-> *part-id-table* 502 init-specs 16 initial-valuef) (-> obj surface-height)) - (let ((f0-72 (lerp-scale 12.0 0.4 (the float (- (current-time) (-> obj enter-water-time))) 0.0 600.0)) + (when (< (-> s3-1 y) (-> this surface-height)) + (set! (-> *part-id-table* 502 init-specs 16 initial-valuef) (-> this surface-height)) + (let ((f0-72 (lerp-scale 12.0 0.4 (the float (- (current-time) (-> this enter-water-time))) 0.0 600.0)) (f1-26 0.00012207031) - (v1-222 (-> obj process control transv)) + (v1-222 (-> this process control transv)) ) (set! (-> *part-id-table* 502 init-specs 1 initial-valuef) (+ f0-72 (* f1-26 (sqrtf (+ (* (-> v1-222 x) (-> v1-222 x)) (* (-> v1-222 z) (-> v1-222 z)))))) ) ) (launch-particles (-> *part-id-table* 502) s3-1) - (set! (-> *part-id-table* 503 init-specs 16 initial-valuef) (-> obj surface-height)) + (set! (-> *part-id-table* 503 init-specs 16 initial-valuef) (-> this surface-height)) (launch-particles (-> *part-id-table* 503) s3-1) ) ) ) ) ) - (let ((f30-1 (- (+ (-> obj base-height) (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)) - (-> obj swim-height) + (let ((f30-1 (- (+ (-> this base-height) (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)) + (-> this swim-height) ) ) ) - (let* ((s3-2 (-> obj process control)) + (let* ((s3-2 (-> this process control)) (v1-236 (if (type? s3-2 control-info) s3-2 ) ) - (v1-237 (and v1-236 (< (- (current-time) (-> v1-236 last-time-on-surface)) (seconds 0.5)))) + (v1-237 (and v1-236 (not (time-elapsed? (-> v1-236 last-time-on-surface) (seconds 0.5))))) ) - (if (and (logtest? (-> obj flags) (water-flags swim-ground)) + (if (and (logtest? (-> this flags) (water-flags swim-ground)) (and v1-237 - (not (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-water))) + (not (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-water))) ) ) - (set! (-> obj bob amp) (* 0.8 (-> obj bob amp))) + (set! (-> this bob amp) (* 0.8 (-> this bob amp))) ) (cond - ((and (logtest? (-> obj flags) (water-flags can-swim)) - (or (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-water)) - (>= f30-1 (-> obj bottom 0 y)) + ((and (logtest? (-> this flags) (water-flags can-swim)) + (or (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-water)) + (>= f30-1 (-> this bottom 0 y)) (and (logtest? (water-flags swimming) s4-0) - (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status touch-surface)) - (not (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-surface)) + (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status touch-surface)) + (not (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-surface)) ) - (>= (+ 204.8 f30-1) (-> obj bottom 0 y)) + (>= (+ 204.8 f30-1) (-> this bottom 0 y)) ) ) (or (logtest? (water-flags swimming) s4-0) (let ((f0-84 12288.0) - (a0-112 (-> obj process control transv)) + (a0-112 (-> this process control transv)) ) (< f0-84 (sqrtf (+ (* (-> a0-112 x) (-> a0-112 x)) (* (-> a0-112 z) (-> a0-112 z))))) ) - (< (+ (current-time) (seconds -0.2)) (-> obj enter-water-time)) - (or (>= (+ (- 204.8 (fmin 6144.0 (+ (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)))) f30-1) - (-> obj bottom 0 y) + (< (+ (current-time) (seconds -0.2)) (-> this enter-water-time)) + (or (>= (+ (- 204.8 (fmin 6144.0 (+ (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)))) f30-1) + (-> this bottom 0 y) ) - (and (-> obj process next-state) (= (-> obj process next-state name) 'target-hit-ground)) + (and (-> this process next-state) (= (-> this process next-state name) 'target-hit-ground)) ) ) ) - (set! (-> obj swim-time) (current-time)) - (send-event (-> obj process) 'swim) - (logior! (-> obj flags) (water-flags swimming)) + (set-time! (-> this swim-time)) + (send-event (-> this process) 'swim) + (logior! (-> this flags) (water-flags swimming)) (if (not (logtest? (water-flags swimming) s4-0)) - (set! (-> obj enter-swim-time) (current-time)) + (set-time! (-> this enter-swim-time)) ) (cond - ((and (logtest? (-> obj flags) (water-flags swim-ground)) - (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status touch-surface)) - (not (logtest? (water-flags jump-out) (-> obj flags))) + ((and (logtest? (-> this flags) (water-flags swim-ground)) + (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status touch-surface)) + (not (logtest? (water-flags jump-out) (-> this flags))) ) (let ((v1-260 (new 'stack-no-clear 'vector))) - (set! (-> v1-260 quad) (-> obj bottom 0 quad)) - (set! (-> v1-260 y) (- (-> obj height) (-> obj swim-height))) - (let ((s3-3 (the-as collide-shape-moving (-> obj process control)))) + (set! (-> v1-260 quad) (-> this bottom 0 quad)) + (set! (-> v1-260 y) (- (-> this height) (-> this swim-height))) + (let ((s3-3 (the-as collide-shape-moving (-> this process control)))) (when (and (not (logtest? (-> s3-3 status) (collide-status touch-background))) - (logtest? (water-flags swimming) (-> obj flags)) - (not (logtest? (focus-status board pilot) (-> obj process focus-status))) + (logtest? (water-flags swimming) (-> this flags)) + (not (logtest? (focus-status board pilot) (-> this process focus-status))) ) (let ((a1-42 (vector-! (new 'stack-no-clear 'vector) v1-260 (-> (the-as control-info s3-3) trans)))) (vector-float*! a1-42 a1-42 (-> pp clock frames-per-second)) @@ -953,39 +957,38 @@ ) ) ) - ((and (< (-> obj bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> obj flags)))) - (logior! (-> obj flags) (water-flags under-water)) + ((and (< (-> this bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> this flags)))) + (logior! (-> this flags) (water-flags under-water)) ) ) ) ((begin - (set! v1-237 - (and (logtest? (-> obj flags) (water-flags can-wade)) - (or (not (!= (-> obj bob amp) 0.0)) (>= (- (current-time) (-> obj swim-time)) (seconds 0.05))) - (and (>= (- (-> obj height) (-> obj wade-height)) (-> obj bottom 0 y)) v1-237) - ) + (set! v1-237 (and (logtest? (-> this flags) (water-flags can-wade)) + (or (not (!= (-> this bob amp) 0.0)) (time-elapsed? (-> this swim-time) (seconds 0.05))) + (and (>= (- (-> this height) (-> this wade-height)) (-> this bottom 0 y)) v1-237) + ) ) v1-237 ) - (set! (-> obj wade-time) (current-time)) - (send-event (-> obj process) 'wade) - (logior! (-> obj flags) (water-flags wading)) + (set-time! (-> this wade-time)) + (send-event (-> this process) 'wade) + (logior! (-> this flags) (water-flags wading)) ) - ((and (< (-> obj bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> obj flags)))) - (logior! (-> obj flags) (water-flags under-water)) + ((and (< (-> this bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> this flags)))) + (logior! (-> this flags) (water-flags under-water)) ) ) ) - (when (and (logtest? (-> obj flags) (water-flags can-swim)) - (< (-> obj bottom 1 y) f30-1) - (and (< f30-1 (-> obj bottom 0 y)) (logtest? s4-0 (water-flags under-water))) + (when (and (logtest? (-> this flags) (water-flags can-swim)) + (< (-> this bottom 1 y) f30-1) + (and (< f30-1 (-> this bottom 0 y)) (logtest? s4-0 (water-flags under-water))) ) - (logior! (-> obj flags) (water-flags swimming)) + (logior! (-> this flags) (water-flags swimming)) (let ((a1-47 (new 'stack-no-clear 'vector))) - (set! (-> a1-47 quad) (-> obj bottom 0 quad)) - (let ((s4-1 (the-as collide-shape-moving (-> obj process control)))) + (set! (-> a1-47 quad) (-> this bottom 0 quad)) + (let ((s4-1 (the-as collide-shape-moving (-> this process control)))) (set! (-> a1-47 y) f30-1) - (when (not (logtest? (focus-status board pilot) (-> obj process focus-status))) + (when (not (logtest? (focus-status board pilot) (-> this process focus-status))) (let ((f30-2 (-> s4-1 ground-impact-vel))) (move-to-ground-point s4-1 a1-47 (-> (the-as control-info s4-1) transv) *up-vector*) (set! (-> (the-as control-info s4-1) status) (logior (-> s4-1 status) (collide-status on-water))) @@ -996,124 +999,131 @@ ) ) ) - (when (= (-> obj process type) target) + (when (= (-> this process type) target) (cond - ((logtest? (-> obj flags) (water-flags tar)) - (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) + ((logtest? (-> this flags) (water-flags tar)) + (when (and (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-surface on-water) ) - (not (logtest? (focus-status board pilot) (-> obj process focus-status))) + (not (logtest? (focus-status board pilot) (-> this process focus-status))) ) - (when (< (-> obj process control trans y) (+ -1228.8 (-> obj base-height))) - (send-event (-> obj process) 'no-look-around (seconds 1.5)) - (if (not (logtest? (-> obj process focus-status) (focus-status flut))) + (when (< (-> this process control trans y) (+ -1228.8 (-> this base-height))) + (send-event (-> this process) 'no-look-around (seconds 1.5)) + (if (not (logtest? (-> this process focus-status) (focus-status flut))) (send-event - (-> obj process) + (-> this process) 'attack #f - (static-attack-info ((id (-> obj attack-id)) (shove-up (meters 0.5)) (shove-back (meters 0)) (mode 'tar))) + (static-attack-info ((id (-> this attack-id)) (shove-up (meters 0.5)) (shove-back (meters 0)) (mode 'tar))) ) ) - (let ((v1-329 (-> obj process))) + (let ((v1-329 (-> this process))) (set! (-> v1-329 control surf) *tar-surface*) (set! (-> v1-329 control ground-pat) (copy-and-set-field (-> (the-as collide-shape-moving (-> v1-329 control)) ground-pat) material 4) ) ) ) - (set! (-> obj swim-height) (lerp (-> obj swim-height) 7372.8 0.05)) + (set! (-> this swim-height) (lerp (-> this swim-height) 7372.8 0.05)) ) ) - ((logtest? (-> obj flags) (water-flags lava)) - (when (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) + ((logtest? (-> this flags) (water-flags lava)) + (when (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-surface on-water) ) - (when (< (-> obj process control trans y) (+ -204.8 (-> obj base-height))) - (send-event (-> obj process) 'no-look-around (seconds 1.5)) - (send-event (-> obj process) 'attack #f (static-attack-info ((id (the-as uint 2)) - (shove-up (meters 0.5)) - (shove-back (meters 0)) - (mode 'melt) - (intersection (-> s5-0 trans)) + (when (< (-> this process control trans y) (+ -204.8 (-> this base-height))) + (send-event (-> this process) 'no-look-around (seconds 1.5)) + (send-event (-> this process) 'attack #f (static-attack-info ((id (the-as uint 2)) + (shove-up (meters 0.5)) + (shove-back (meters 0)) + (mode 'melt) + (intersection (-> s5-0 trans)) + ) ) - ) ) ) - (set! (-> obj swim-height) (lerp (-> obj swim-height) 7372.8 0.05)) + (set! (-> this swim-height) (lerp (-> this swim-height) 7372.8 0.05)) ) ) - ((and (logtest? (focus-status dark) (-> obj process focus-status)) - (nonzero? (-> obj process darkjak)) - (logtest? (-> obj process darkjak stage) (darkjak-stage giant)) + ((and (logtest? (focus-status dark) (-> this process focus-status)) + (nonzero? (-> this process darkjak)) + (logtest? (-> this process darkjak stage) (darkjak-stage giant)) ) - (set! (-> obj swim-height) 16384.0) + (set! (-> this swim-height) 16384.0) ) (else - (set! (-> obj swim-height) 8192.0) + (set! (-> this swim-height) 8192.0) ) ) ) ) (else - (if (logtest? (water-flags touch-water) (-> obj flags)) - (water-control-method-16 obj) + (if (logtest? (water-flags touch-water) (-> this flags)) + (water-control-method-16 this) ) ) ) ) - (when (not (or (not (logtest? (water-flags part-drip) (-> obj flags))) - (not (logtest? (water-flags part-water) (-> obj flags))) - (= (-> obj drip-wetness) 0.0) + (when (not (or (not (logtest? (water-flags part-drip) (-> this flags))) + (not (logtest? (water-flags part-water) (-> this flags))) + (= (-> this drip-wetness) 0.0) ) ) (cond - ((logtest? (water-flags spawn-drip) (-> obj flags)) + ((logtest? (water-flags spawn-drip) (-> this flags)) (let ((v0-34 - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data (-> obj drip-joint-index))) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data (-> this drip-joint-index))) ) ) - (set! (-> *part-id-table* 537 init-specs 18 initial-valuef) (-> obj surface-height)) - (set! (-> *part-id-table* 537 init-specs 10 initial-valuef) (* 0.05 (- (-> v0-34 x) (-> obj drip-old-pos x)))) - (set! (-> *part-id-table* 537 init-specs 11 initial-valuef) (* 0.05 (- (-> v0-34 y) (-> obj drip-old-pos y)))) - (set! (-> *part-id-table* 537 init-specs 12 initial-valuef) (* 0.05 (- (-> v0-34 z) (-> obj drip-old-pos z)))) + (set! (-> *part-id-table* 537 init-specs 18 initial-valuef) (-> this surface-height)) + (set! (-> *part-id-table* 537 init-specs 10 initial-valuef) + (* 0.05 (- (-> v0-34 x) (-> this drip-old-pos x))) + ) + (set! (-> *part-id-table* 537 init-specs 11 initial-valuef) + (* 0.05 (- (-> v0-34 y) (-> this drip-old-pos y))) + ) + (set! (-> *part-id-table* 537 init-specs 12 initial-valuef) + (* 0.05 (- (-> v0-34 z) (-> this drip-old-pos z))) + ) (launch-particles (-> *part-id-table* 537) v0-34) ) - (set! (-> obj drip-time) (current-time)) - (logclear! (-> obj flags) (water-flags spawn-drip)) - (seek! (-> obj drip-wetness) 0.0 (* 0.001 (-> obj drip-speed))) - (set! (-> obj drip-speed) (* 1.05 (-> obj drip-speed))) - (if (= (-> obj drip-wetness) 0.0) - (set! (-> obj drip-height) 0.0) + (set-time! (-> this drip-time)) + (logclear! (-> this flags) (water-flags spawn-drip)) + (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) + (if (= (-> this drip-wetness) 0.0) + (set! (-> this drip-height) 0.0) ) ) - ((>= (- (current-time) (the-as time-frame (the int (/ (the float (-> obj drip-time)) (-> obj drip-mult))))) - (the int (-> obj drip-speed)) - ) - (let* ((s5-1 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) - (v0-38 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-1))) + ((time-elapsed? + (the-as time-frame (the int (/ (the float (-> this drip-time)) (-> this drip-mult)))) + (the int (-> this drip-speed)) + ) + (let* ((s5-1 (rand-vu-int-range 3 (+ (-> this process node-list length) -1))) + (v0-38 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-1))) ) - (when (and (< (- (-> v0-38 y) (-> obj process control trans y)) (-> obj drip-height)) - (< (-> obj height) (-> v0-38 y)) + (when (and (< (- (-> v0-38 y) (-> this process control trans y)) (-> this drip-height)) + (< (-> this height) (-> v0-38 y)) ) - (set! (-> obj drip-joint-index) s5-1) - (set! (-> obj drip-old-pos quad) (-> v0-38 quad)) - (logior! (-> obj flags) (water-flags spawn-drip)) + (set! (-> this drip-joint-index) s5-1) + (set! (-> this drip-old-pos quad) (-> v0-38 quad)) + (logior! (-> this flags) (water-flags spawn-drip)) ) ) ) ) ) - (if (and (not (logtest? (water-flags break-surface) (-> obj flags))) (handle->process (-> obj ripple))) - (send-event (handle->process (-> obj ripple)) 'die) + (if (and (not (logtest? (water-flags break-surface) (-> this flags))) (handle->process (-> this ripple))) + (send-event (handle->process (-> this ripple)) 'die) ) 0 (none) ) ) -(defmethod start-bobbing! water-control ((obj water-control) (arg0 float) (arg1 int) (arg2 int)) +(defmethod start-bobbing! water-control ((this water-control) (arg0 float) (arg1 int) (arg2 int)) (with-pp - (activate! (-> obj bob) (- arg0) arg1 arg2 0.9 1.0 (-> pp clock)) + (activate! (-> this bob) (- arg0) arg1 arg2 0.9 1.0 (-> pp clock)) 0 (none) ) @@ -1200,43 +1210,43 @@ (none) ) -(defmethod enter-water water-control ((obj water-control)) +(defmethod enter-water water-control ((this water-control)) (with-pp - (logior! (-> obj flags) (water-flags touch-water)) - (logclear! (-> obj flags) (water-flags jump-out)) - (set! (-> obj enter-water-time) (current-time)) - (set-vector! (-> obj enter-water-pos) (-> obj bottom 0 x) (-> obj surface-height) (-> obj bottom 0 z) 1.0) - (when (and (logtest? (water-flags part-splash) (-> obj flags)) (logtest? (water-flags part-water) (-> obj flags))) + (logior! (-> this flags) (water-flags touch-water)) + (logclear! (-> this flags) (water-flags jump-out)) + (set-time! (-> this enter-water-time)) + (set-vector! (-> this enter-water-pos) (-> this bottom 0 x) (-> this surface-height) (-> this bottom 0 z) 1.0) + (when (and (logtest? (water-flags part-splash) (-> this flags)) (logtest? (water-flags part-water) (-> this flags))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 1) (set! (-> a1-1 message) 'query) (set! (-> a1-1 param 0) (the-as uint 'ground-height)) - (let* ((f0-4 (the-as float (send-event-function (-> obj process) a1-1))) + (let* ((f0-4 (the-as float (send-event-function (-> this process) a1-1))) (f30-0 (lerp-scale 0.3 1.0 f0-4 2048.0 24576.0)) ) - (when (not (logtest? (-> obj flags) (water-flags dark-eco lava))) - (if (nonzero? (-> obj process skel effect)) + (when (not (logtest? (-> this flags) (water-flags dark-eco lava))) + (if (nonzero? (-> this process skel effect)) (sound-play "swim-enter") ) - (spawn-ripples obj f30-0 (-> obj enter-water-pos) 1 (-> obj process control transv) #t) + (spawn-ripples this f30-0 (-> this enter-water-pos) 1 (-> this process control transv) #t) ) ) ) ) - (if (logtest? (-> obj flags) (water-flags tar lava)) - (set! (-> obj swim-height) 2867.2) + (if (logtest? (-> this flags) (water-flags tar lava)) + (set! (-> this swim-height) 2867.2) ) 0 (none) ) ) -(defmethod water-control-method-16 water-control ((obj water-control)) - (logclear! (-> obj flags) (water-flags touch-water)) - (set-zero! (-> obj bob)) - (if (logtest? (-> obj flags) (water-flags tar lava)) - (set! (-> obj swim-height) 2867.2) +(defmethod water-control-method-16 water-control ((this water-control)) + (logclear! (-> this flags) (water-flags touch-water)) + (set-zero! (-> this bob)) + (if (logtest? (-> this flags) (water-flags tar lava)) + (set! (-> this swim-height) 2867.2) ) 0 (none) @@ -1309,24 +1319,24 @@ (none) ) -(defmethod spawn-ripples water-control ((obj water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector) (arg4 symbol)) - (when (and (logtest? (water-flags part-splash) (-> obj flags)) (logtest? (water-flags part-water) (-> obj flags))) +(defmethod spawn-ripples water-control ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector) (arg4 symbol)) + (when (and (logtest? (water-flags part-splash) (-> this flags)) (logtest? (water-flags part-water) (-> this flags))) (let ((s4-1 (vector+float*! (new 'stack-no-clear 'vector) arg1 arg3 0.05))) - (set! (-> s4-1 y) (+ 40.96 (-> obj surface-height))) - (if (>= (- (current-time) (-> obj distort-time)) (seconds 0.1)) + (set! (-> s4-1 y) (+ 40.96 (-> this surface-height))) + (if (time-elapsed? (-> this distort-time) (seconds 0.1)) (splash-spawn arg0 s4-1 arg2) ) - (when (and arg4 (>= (- (current-time) (-> obj distort-time)) (seconds 0.3))) - (set! (-> obj distort-time) (current-time)) + (when (and arg4 (time-elapsed? (-> this distort-time) (seconds 0.3))) + (set-time! (-> this distort-time)) (let ((s3-1 (process-spawn manipy :init manipy-init s4-1 - (-> obj process entity) + (-> this process entity) (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f)) #f 0 - :to (-> obj process) + :to (-> this process) ) ) ) @@ -1481,7 +1491,7 @@ arg0 ) -(defmethod water-info-init! collide-shape ((obj collide-shape) (arg0 water-info) (arg1 collide-action)) +(defmethod water-info-init! collide-shape ((this collide-shape) (arg0 water-info) (arg1 collide-action)) "Initialize a [[water-info]] with the currently loaded regions." (local-vars (sv-80 int)) (let ((s3-0 (new 'stack 'water-info))) @@ -1493,7 +1503,7 @@ ;; og:preserve-this scratchpad (set! (-> (scratchpad-object region-prim-area) region-prim-list num-items) 0) (set! (-> (scratchpad-object region-prim-area) region-inside-count) 0) - (set! (-> (scratchpad-object region-prim-area) pos quad) (-> obj root-prim prim-core world-sphere quad)) + (set! (-> (scratchpad-object region-prim-area) pos quad) (-> this root-prim prim-core world-sphere quad)) (dotimes (s2-0 (-> *level* length)) (let ((v1-8 (-> *level* level s2-0))) (when (= (-> v1-8 status) 'active) @@ -1524,7 +1534,7 @@ ) ;; og:preserve-this scratchpad (countdown (s2-1 (-> (scratchpad-object region-prim-area) region-prim-list num-items)) - (water-info<-region s3-0 (-> (scratchpad-object region-prim-area) region-prim-list items s2-1) obj arg1) + (water-info<-region s3-0 (-> (scratchpad-object region-prim-area) region-prim-list items s2-1) this arg1) (when (and (logtest? (-> s3-0 flags) (water-flags active)) (logtest? (water-flags touch-water) (-> s3-0 flags)) (not (logtest? (-> s3-0 extra-flags) 1)) diff --git a/goal_src/jak2/engine/data/art-h.gc b/goal_src/jak2/engine/data/art-h.gc index 264ec3ea13..1e9b020ddf 100644 --- a/goal_src/jak2/engine/data/art-h.gc +++ b/goal_src/jak2/engine/data/art-h.gc @@ -102,6 +102,7 @@ ) +;; WARN: Return type mismatch structure vs joint-anim-frame. (defmethod new joint-anim-frame ((allocation symbol) (type-to-make type) (arg0 int)) (let ((v1-1 (max 0 (+ arg0 -2)))) (the-as @@ -342,46 +343,46 @@ (deftype draw-control (basic) - ((process process-drawable :offset-assert 4) - (status draw-control-status :offset-assert 8) - (data-format draw-control-data-format :offset-assert 10) - (global-effect draw-control-global-effect :offset-assert 11) - (art-group art-group :offset-assert 12) - (jgeo art-joint-geo :offset-assert 16) - (mgeo merc-ctrl :offset-assert 20) - (dma-add-func (function process-drawable draw-control symbol object none) :offset-assert 24) - (skeleton skeleton :offset-assert 28) - (lod-set lod-set :inline :offset-assert 32) - (max-lod int8 :offset 80) - (force-lod int8 :offset-assert 81) - (cur-lod int8 :offset-assert 82) - (desired-lod int8 :offset-assert 83) - (ripple ripple-control :offset-assert 84) - (longest-edge meters :offset-assert 88) - (longest-edge? uint32 :offset 88) - (light-index uint8 :offset-assert 92) - (shadow-mask uint8 :offset-assert 93) - (level-index uint8 :offset-assert 94) - (death-draw-overlap uint8 :offset-assert 95) - (death-timer uint8 :offset-assert 96) - (death-timer-org uint8 :offset-assert 97) - (death-vertex-skip uint16 :offset-assert 98) - (death-effect uint32 :offset-assert 100) - (shadow shadow-geo :offset-assert 104) - (shadow-ctrl shadow-control :offset-assert 108) - (distance meters :offset-assert 112) - (origin vector :inline :offset-assert 128) - (bounds vector :inline :offset-assert 144) - (radius meters :offset 156) - (color-mult rgbaf :inline :offset-assert 160) - (color-emissive rgbaf :inline :offset-assert 176) - (effect-mask uint64 :offset-assert 192) - (seg-mask uint64 :offset-assert 200) - (origin-joint-index uint8 :offset-assert 208) - (shadow-joint-index uint8 :offset-assert 209) - (force-fade uint8 :offset-assert 210) - (default-texture-page uint8 :offset-assert 211) - (shadow-values uint32 :offset-assert 212) + ((process process-drawable :offset-assert 4) + (status draw-control-status :offset-assert 8) + (data-format draw-control-data-format :offset-assert 10) + (global-effect draw-control-global-effect :offset-assert 11) + (art-group art-group :offset-assert 12) + (jgeo art-joint-geo :offset-assert 16) + (mgeo merc-ctrl :offset-assert 20) + (dma-add-func (function process-drawable draw-control symbol object none) :offset-assert 24) + (skeleton skeleton :offset-assert 28) + (lod-set lod-set :inline :offset-assert 32) + (max-lod int8 :offset 80) + (force-lod int8 :offset-assert 81) + (cur-lod int8 :offset-assert 82) + (desired-lod int8 :offset-assert 83) + (ripple ripple-control :offset-assert 84) + (longest-edge meters :offset-assert 88) + (longest-edge? uint32 :offset 88) + (light-index uint8 :offset-assert 92) + (shadow-mask uint8 :offset-assert 93) + (level-index uint8 :offset-assert 94) + (death-draw-overlap uint8 :offset-assert 95) + (death-timer uint8 :offset-assert 96) + (death-timer-org uint8 :offset-assert 97) + (death-vertex-skip uint16 :offset-assert 98) + (death-effect uint32 :offset-assert 100) + (shadow shadow-geo :offset-assert 104) + (shadow-ctrl shadow-control :offset-assert 108) + (distance meters :offset-assert 112) + (origin vector :inline :offset-assert 128) + (bounds vector :inline :offset-assert 144) + (radius meters :offset 156) + (color-mult rgbaf :inline :offset-assert 160) + (color-emissive rgbaf :inline :offset-assert 176) + (effect-mask uint64 :offset-assert 192) + (seg-mask uint64 :offset-assert 200) + (origin-joint-index uint8 :offset-assert 208) + (shadow-joint-index uint8 :offset-assert 209) + (force-fade uint8 :offset-assert 210) + (default-texture-page uint8 :offset-assert 211) + (shadow-values uint32 :offset-assert 212) ) :method-count-assert 15 :size-assert #xd8 @@ -398,10 +399,11 @@ ) -(defmethod get-skeleton-origin draw-control ((obj draw-control)) - (-> obj skeleton bones 0 transform trans) +(defmethod get-skeleton-origin draw-control ((this draw-control)) + (-> this skeleton bones 0 transform trans) ) +;; og:preserve-this ;; look up the index of an art element in an art group. (desfun art-elt->index (ag-name elt-name) (if (number? elt-name) diff --git a/goal_src/jak2/engine/debug/debug.gc b/goal_src/jak2/engine/debug/debug.gc index ea89872183..52d8ffb8f9 100644 --- a/goal_src/jak2/engine/debug/debug.gc +++ b/goal_src/jak2/engine/debug/debug.gc @@ -1463,13 +1463,13 @@ Most functions take a boolean as their first argument. If the boolean is set to ) ) -(defmethod inspect debug-vertex-stats ((obj debug-vertex-stats)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tpos-count: ~D~%" (-> obj pos-count)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj vertex)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj vertex s5-0))) +(defmethod inspect debug-vertex-stats ((this debug-vertex-stats)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tpos-count: ~D~%" (-> this pos-count)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this vertex)) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this vertex s5-0))) (format #t " ~D : trans: ~D ~D ~D ~D" @@ -1490,7 +1490,7 @@ Most functions take a boolean as their first argument. If the boolean is set to ) ) ) - obj + this ) (defun-debug history-init ((history pos-history) (num-points int)) diff --git a/goal_src/jak2/engine/debug/default-menu.gc b/goal_src/jak2/engine/debug/default-menu.gc index ddeaf8e7ec..179906ae4a 100644 --- a/goal_src/jak2/engine/debug/default-menu.gc +++ b/goal_src/jak2/engine/debug/default-menu.gc @@ -2954,6 +2954,7 @@ (let ((v1-4 (-> *game-info* play-list s4-0))) (when (-> v1-4 play-continue) (let ((s3-0 (method-of-type pair new)) + ;; og:preserve-this allocate on debug heap (s2-0 'debug) (s1-0 pair) (s0-0 (method-of-type pair new)) @@ -2979,6 +2980,7 @@ ) ) ) + ;; og:preserve-this (debug-menu-make-from-template arg0 (dcons 'menu (dcons "Play" gp-0))) ) ) @@ -4292,7 +4294,7 @@ (let ((v1-1 (process-spawn-function process (lambda () (set-master-mode 'game) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.3)) + (until (time-elapsed? gp-0 (seconds 0.3)) (suspend) ) ) diff --git a/goal_src/jak2/engine/debug/editable-player.gc b/goal_src/jak2/engine/debug/editable-player.gc index 04ddf738e9..9aee725a84 100644 --- a/goal_src/jak2/engine/debug/editable-player.gc +++ b/goal_src/jak2/engine/debug/editable-player.gc @@ -1106,101 +1106,101 @@ #t ) -(defmethod editable-array-method-9 editable-array ((obj editable-array) (arg0 editable-command) (arg1 mouse-info)) - (if (execute-select obj arg0 arg1) +(defmethod editable-array-method-9 editable-array ((this editable-array) (arg0 editable-command) (arg1 mouse-info)) + (if (execute-select this arg0 arg1) (return #f) ) - (if (execute-move obj arg0 arg1) + (if (execute-move this arg0 arg1) (return #f) ) - (if (execute-mouse-move obj arg0 arg1) + (if (execute-mouse-move this arg0 arg1) (return #f) ) (cond ((= arg0 (editable-command copy)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (set! (-> obj selection length) 0) - (let* ((s4-2 (-> obj length)) + (set! (-> this selection length) 0) + (let* ((s4-2 (-> this length)) (s3-1 0) - (s2-0 (-> obj data s3-1)) + (s2-0 (-> this data s3-1)) ) (while (< s3-1 s4-2) (when (and s2-0 (logtest? (-> s2-0 flags) (editable-flag selected))) - (editable-method-27 s2-0 obj) + (editable-method-27 s2-0 this) (when (= (-> s2-0 type) editable-light) (editable-method-23 s2-0) (update-light-hash *light-hash*) ) ) (+! s3-1 1) - (set! s2-0 (-> obj data s3-1)) + (set! s2-0 (-> this data s3-1)) ) ) - (editable-array-method-9 obj (editable-command select-none) arg1) + (editable-array-method-9 this (editable-command select-none) arg1) (let ((s5-1 (the-as editable-region #f))) - (dotimes (s4-3 (-> obj selection length)) - (let ((a0-13 (-> obj selection s4-3))) + (dotimes (s4-3 (-> this selection length)) + (let ((a0-13 (-> this selection s4-3))) (when (and a0-13 (logtest? s4-3 1)) (set! s5-1 (-> a0-13 region)) (select-editable! a0-13 #t) ) ) ) - (if (not (-> obj region-lock?)) - (set! (-> obj region) s5-1) + (if (not (-> this region-lock?)) + (set! (-> this region) s5-1) ) ) ) ((= arg0 (editable-command copy-region)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (when (and (-> obj region) (not (-> obj region locked))) - (editable-array-method-9 obj (editable-command select-current-region) arg1) - (let ((v1-52 (copy (-> obj region) 'debug))) + (when (and (-> this region) (not (-> this region locked))) + (editable-array-method-9 this (editable-command select-current-region) arg1) + (let ((v1-52 (copy (-> this region) 'debug))) (set! (-> v1-52 id) (the-as uint 0)) (set! (-> v1-52 changed) #t) - (set! (-> obj region) v1-52) + (set! (-> this region) v1-52) ) - (editable-array-method-9 obj (editable-command copy) arg1) + (editable-array-method-9 this (editable-command copy) arg1) ) ) ((= arg0 (editable-command delete)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (let* ((s5-3 (-> obj length)) + (let* ((s5-3 (-> this length)) (s4-6 0) - (s3-3 (-> obj data s4-6)) + (s3-3 (-> this data s4-6)) ) (while (< s4-6 s5-3) (when (and s3-3 (logtest? (-> s3-3 flags) (editable-flag selected))) - (editable-array-method-15 obj s3-3) + (editable-array-method-15 this s3-3) (when (= (-> s3-3 type) editable-light) (editable-method-23 s3-3) (update-light-hash *light-hash*) ) ) (+! s4-6 1) - (set! s3-3 (-> obj data s4-6)) + (set! s3-3 (-> this data s4-6)) ) ) - (if (not (-> obj region-lock?)) - (set! (-> obj region) #f) + (if (not (-> this region-lock?)) + (set! (-> this region) #f) ) ) ((= arg0 (editable-command delete-region)) - (when (-> obj region) + (when (-> this region) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (when (!= (-> obj region) *editable-light-region*) - (editable-array-method-9 obj (editable-command select-current-region) arg1) - (editable-array-method-9 obj (editable-command delete) arg1) - (set! (-> obj region) #f) + (when (!= (-> this region) *editable-light-region*) + (editable-array-method-9 this (editable-command select-current-region) arg1) + (editable-array-method-9 this (editable-command delete) arg1) + (set! (-> this region) #f) ) ) ) ((= arg0 (editable-command snap-to-ground)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((s5-5 (new 'stack-no-clear 'vector)) - (s4-9 (-> obj length)) + (s4-9 (-> this length)) (s3-5 0) - (s2-1 (-> obj data s3-5)) + (s2-1 (-> this data s3-5)) ) (while (< s3-5 s4-9) (when (and s2-1 (logtest? (-> s2-1 flags) (editable-flag selected))) @@ -1209,31 +1209,31 @@ ) ) (+! s3-5 1) - (set! s2-1 (-> obj data s3-5)) + (set! s2-1 (-> this data s3-5)) ) ) ) ((= arg0 (editable-command snap-y)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (cond - ((-> obj target) - (let* ((s5-7 (edit-get-trans (-> obj target))) - (s4-11 (-> obj length)) + ((-> this target) + (let* ((s5-7 (edit-get-trans (-> this target))) + (s4-11 (-> this length)) (s3-6 0) - (a0-37 (-> obj data s3-6)) + (a0-37 (-> this data s3-6)) ) (while (< s3-6 s4-11) (if (and a0-37 (logtest? (-> a0-37 flags) (editable-flag selected))) (edit-coord! a0-37 s5-7 (editable-flag y no-plane-snap)) ) (+! s3-6 1) - (set! a0-37 (-> obj data s3-6)) + (set! a0-37 (-> this data s3-6)) ) ) ) (else (editable-array-method-13 - obj + this (editable-command pick-target) (editable-command snap-y) "pick the editable to use the y from" @@ -1244,24 +1244,24 @@ ((= arg0 (editable-command snap-xz)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (cond - ((-> obj target) - (let* ((s5-9 (edit-get-trans (-> obj target))) - (s4-13 (-> obj length)) + ((-> this target) + (let* ((s5-9 (edit-get-trans (-> this target))) + (s4-13 (-> this length)) (s3-7 0) - (a0-41 (-> obj data s3-7)) + (a0-41 (-> this data s3-7)) ) (while (< s3-7 s4-13) (if (and a0-41 (logtest? (-> a0-41 flags) (editable-flag selected))) (edit-coord! a0-41 s5-9 (editable-flag x z no-plane-snap)) ) (+! s3-7 1) - (set! a0-41 (-> obj data s3-7)) + (set! a0-41 (-> this data s3-7)) ) ) ) (else (editable-array-method-13 - obj + this (editable-command pick-target) (editable-command snap-xz) "pick the editable to use the xz from" @@ -1270,29 +1270,29 @@ ) ) ((= arg0 (editable-command region-set)) - (when (and (-> obj region) (not (-> obj region locked))) + (when (and (-> this region) (not (-> this region locked))) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (let* ((s5-11 (-> obj length)) + (let* ((s5-11 (-> this length)) (s4-15 0) - (a0-44 (-> obj data s4-15)) + (a0-44 (-> this data s4-15)) ) (while (< s4-15 s5-11) (if (and a0-44 (logtest? (-> a0-44 flags) (editable-flag selected))) - (editable-method-21 a0-44 (-> obj region)) + (editable-method-21 a0-44 (-> this region)) ) (+! s4-15 1) - (set! a0-44 (-> obj data s4-15)) + (set! a0-44 (-> this data s4-15)) ) ) ) ) ((= arg0 (editable-command region-add)) - (when (and (-> obj region) (not (-> obj region locked))) + (when (and (-> this region) (not (-> this region locked))) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (if (-> obj target) - (editable-method-21 (-> obj target) (-> obj region)) + (if (-> this target) + (editable-method-21 (-> this target) (-> this region)) (editable-array-method-13 - obj + this (editable-command pick-target) (editable-command region-add) "pick the editable to add to current region" @@ -1302,88 +1302,88 @@ ) ((= arg0 (editable-command region-new)) (let ((v1-175 (new 'debug 'editable-region))) - (if (and (-> obj region) (not (-> obj region locked))) - (set! (-> v1-175 tree) (-> obj region tree)) + (if (and (-> this region) (not (-> this region locked))) + (set! (-> v1-175 tree) (-> this region tree)) ) - (set! (-> obj region) v1-175) + (set! (-> this region) v1-175) ) - (editable-array-method-9 obj (editable-command region-set) arg1) + (editable-array-method-9 this (editable-command region-set) arg1) ) ((= arg0 (editable-command flip-side)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (let* ((s5-14 (-> obj length)) + (let* ((s5-14 (-> this length)) (s4-18 0) - (a0-58 (-> obj data s4-18)) + (a0-58 (-> this data s4-18)) ) (while (< s4-18 s5-14) (if (and a0-58 (logtest? (-> a0-58 flags) (editable-flag selected))) (editable-method-24 a0-58) ) (+! s4-18 1) - (set! a0-58 (-> obj data s4-18)) + (set! a0-58 (-> this data s4-18)) ) ) ) ((= arg0 (editable-command rotate-level)) - (let* ((f0-1 (* 182.04445 (-> obj edit-param0))) + (let* ((f0-1 (* 182.04445 (-> this edit-param0))) (s5-15 (matrix-rotate-y! (new 'stack-no-clear 'matrix) f0-1)) - (s4-19 (-> obj length)) + (s4-19 (-> this length)) (s3-8 0) - (a0-60 (-> obj data s3-8)) + (a0-60 (-> this data s3-8)) ) (while (< s3-8 s4-19) - (if (and a0-60 region (= (-> a0-60 region level) (-> obj level))) - (editable-method-18 a0-60 (-> obj level-offset) s5-15) + (if (and a0-60 region (= (-> a0-60 region level) (-> this level))) + (editable-method-18 a0-60 (-> this level-offset) s5-15) ) (+! s3-8 1) - (set! a0-60 (-> obj data s3-8)) + (set! a0-60 (-> this data s3-8)) ) ) ) ((= arg0 (editable-command translate-y-level)) (let ((s5-16 (new 'stack-no-clear 'vector))) (set! (-> s5-16 x) 0.0) - (set! (-> s5-16 y) (* 4096.0 (-> obj edit-param0))) + (set! (-> s5-16 y) (* 4096.0 (-> this edit-param0))) (set! (-> s5-16 z) 0.0) (set! (-> s5-16 w) 1.0) - (let* ((s4-20 (-> obj length)) + (let* ((s4-20 (-> this length)) (s3-9 0) - (a0-61 (-> obj data s3-9)) + (a0-61 (-> this data s3-9)) ) (while (< s3-9 s4-20) - (if (and a0-61 region (= (-> a0-61 region level) (-> obj level))) + (if (and a0-61 region (= (-> a0-61 region level) (-> this level))) (editable-method-15 a0-61 s5-16 56) ) (+! s3-9 1) - (set! a0-61 (-> obj data s3-9)) + (set! a0-61 (-> this data s3-9)) ) ) ) ) ((= arg0 (editable-command save)) - (let* ((s5-17 (-> obj length)) + (let* ((s5-17 (-> this length)) (s4-21 0) - (v1-231 (-> obj data s4-21)) + (v1-231 (-> this data s4-21)) ) (while (< s4-21 s5-17) (if (and v1-231 (-> v1-231 region)) - (editable-region-method-9 (-> v1-231 region) obj 0 0) + (editable-region-method-9 (-> v1-231 region) this 0 0) ) (+! s4-21 1) - (set! v1-231 (-> obj data s4-21)) + (set! v1-231 (-> this data s4-21)) ) ) - (editable-region-method-9 *editable-sample-region* obj 0 0) - (editable-region-method-9 *editable-light-region* obj 0 0) - (editable-region-method-9 *editable-entity-region* obj 0 0) + (editable-region-method-9 *editable-sample-region* this 0 0) + (editable-region-method-9 *editable-light-region* this 0 0) + (editable-region-method-9 *editable-entity-region* this 0 0) ) ((= arg0 (editable-command load)) - (editable-array-method-9 obj (editable-command select-none) arg1) - (dotimes (v1-248 (-> obj length)) - (set! (-> obj data v1-248) #f) + (editable-array-method-9 this (editable-command select-none) arg1) + (dotimes (v1-248 (-> this length)) + (set! (-> this data v1-248) #f) ) - (set! (-> obj length) 0) - (let* ((s5-18 obj) + (set! (-> this length) 0) + (let* ((s5-18 this) (s4-22 (method-of-object s5-18 editable-array-method-12)) (v1-253 (level-get-target-inside *level*)) ) @@ -1394,20 +1394,20 @@ ) ) ) - (editable-array-method-9 obj (editable-command update-game) (the-as mouse-info #f)) + (editable-array-method-9 this (editable-command update-game) (the-as mouse-info #f)) ) ((= arg0 (editable-command update-game)) (reset-light-hash *light-hash*) - (let* ((s5-19 (-> obj length)) + (let* ((s5-19 (-> this length)) (s4-23 0) - (a0-76 (-> obj data s4-23)) + (a0-76 (-> this data s4-23)) ) (while (< s4-23 s5-19) (if a0-76 (editable-method-23 a0-76) ) (+! s4-23 1) - (set! a0-76 (-> obj data s4-23)) + (set! a0-76 (-> this data s4-23)) ) ) (update-light-hash *light-hash*) @@ -1419,7 +1419,7 @@ #f ) -(defmethod deactivate editable-player ((obj editable-player)) +(defmethod deactivate editable-player ((this editable-player)) ;; og:preserve-this ;; Put the pad back to normal (pc-treat-pad0-as-pad1 #f) @@ -1431,40 +1431,40 @@ ) ) (set! *editable* (the-as (pointer editable-player) #f)) - (set! *external-cam-mode* (-> obj external-cam-mode)) - ((method-of-type process-drawable deactivate) obj) + (set! *external-cam-mode* (-> this external-cam-mode)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs editable-player. -(defmethod relocate editable-player ((obj editable-player) (arg0 int)) +(defmethod relocate editable-player ((this editable-player) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (let ((v1-2 (-> obj current))) + (let ((v1-2 (-> this current))) (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) (< (the-as int v1-2) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj current) arg0) + (&+! (-> this current) arg0) ) ) - (the-as editable-player ((method-of-type process-drawable relocate) obj arg0)) + (the-as editable-player ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod editable-player-method-21 editable-player ((obj editable-player)) +(defmethod editable-player-method-21 editable-player ((this editable-player)) (set! *display-region-marks* #f) - (let* ((s5-0 (-> obj current length)) + (let* ((s5-0 (-> this current length)) (s4-0 0) - (a0-2 (-> obj current data s4-0)) + (a0-2 (-> this current data s4-0)) ) (while (< s4-0 s5-0) - (if (and a0-2 (or (and (logtest? (-> a0-2 region filter) (-> obj current filter 0)) - (logtest? (-> a0-2 region filter) (-> obj current filter 1)) + (if (and a0-2 (or (and (logtest? (-> a0-2 region filter) (-> this current filter 0)) + (logtest? (-> a0-2 region filter) (-> this current filter 1)) ) (logtest? (-> a0-2 flags) (editable-flag selected)) ) @@ -1472,7 +1472,7 @@ (editable-method-10 a0-2) ) (+! s4-0 1) - (set! a0-2 (-> obj current data s4-0)) + (set! a0-2 (-> this current data s4-0)) ) ) (when #t @@ -1482,27 +1482,27 @@ *stdcon* "~16S~16S~16S~%" (editable-command->string - (if (and (nonzero? (-> obj command 1)) (or (= (-> obj command 0) (editable-command none)) (mouse-hold? left))) - (-> obj command 1) - (-> obj command 0) + (if (and (nonzero? (-> this command 1)) (or (= (-> this command 0) (editable-command none)) (mouse-hold? left))) + (-> this command 1) + (-> this command 0) ) ) (editable-command->string - (if (and (nonzero? (-> obj command 5)) (or (= (-> obj command 4) (editable-command none)) (mouse-hold? middle))) - (-> obj command 5) - (-> obj command 4) + (if (and (nonzero? (-> this command 5)) (or (= (-> this command 4) (editable-command none)) (mouse-hold? middle))) + (-> this command 5) + (-> this command 4) ) ) (editable-command->string - (if (and (nonzero? (-> obj command 3)) (or (= (-> obj command 2) (editable-command none)) (mouse-hold? right))) - (-> obj command 3) - (-> obj command 2) + (if (and (nonzero? (-> this command 3)) (or (= (-> this command 2) (editable-command none)) (mouse-hold? right))) + (-> this command 3) + (-> this command 2) ) ) ) - (let* ((s5-2 (-> obj current length)) + (let* ((s5-2 (-> this current length)) (s4-2 0) - (v1-35 (-> obj current data s4-2)) + (v1-35 (-> this current data s4-2)) ) (while (< s4-2 s5-2) (when (and v1-35 (logtest? (-> v1-35 flags) (editable-flag selected))) @@ -1513,23 +1513,23 @@ ) ) (+! s4-2 1) - (set! v1-35 (-> obj current data s4-2)) + (set! v1-35 (-> this current data s4-2)) ) ) (when (!= *master-mode* 'menu) - (let ((a2-5 (-> obj current target-message))) + (let ((a2-5 (-> this current target-message))) (if a2-5 (format *stdcon* "~%~3L~S~0L~%" a2-5) ) ) (when (cpad-hold? 1 triangle) - (let* ((s5-3 (-> obj current length)) + (let* ((s5-3 (-> this current length)) (s4-3 0) - (a0-29 (-> obj current data s4-3)) + (a0-29 (-> this current data s4-3)) ) (while (< s4-3 s5-3) - (when (and a0-29 (or (and (logtest? (-> a0-29 region filter) (-> obj current filter 0)) - (logtest? (-> a0-29 region filter) (-> obj current filter 1)) + (when (and a0-29 (or (and (logtest? (-> a0-29 region filter) (-> this current filter 0)) + (logtest? (-> a0-29 region filter) (-> this current filter 1)) ) (logtest? (-> a0-29 flags) (editable-flag selected)) ) @@ -1543,13 +1543,13 @@ ) ) (+! s4-3 1) - (set! a0-29 (-> obj current data s4-3)) + (set! a0-29 (-> this current data s4-3)) ) ) (format *stdcon* "~%") (cond - ((-> obj current region) - (let ((s5-4 (-> obj current region))) + ((-> this current region) + (let ((s5-4 (-> this current region))) (format *stdcon* "~%region: region-~D ~S ~S~S~%" @@ -1570,22 +1570,22 @@ (format *stdcon* "no region~%") ) ) - (when (-> obj current edit-plane) - (let ((a2-13 (-> obj current edit-plane))) + (when (-> this current edit-plane) + (let ((a2-13 (-> this current edit-plane))) (format *stdcon* "~%edit-plane: ~A~%" a2-13) ) ) (format *stdcon* "~%selected:~%") - (let* ((s5-5 (-> obj current length)) + (let* ((s5-5 (-> this current length)) (s4-4 0) - (a2-14 (-> obj current data s4-4)) + (a2-14 (-> this current data s4-4)) ) (while (< s4-4 s5-5) (if (and a2-14 (logtest? (-> a2-14 flags) (editable-flag selected))) (format *stdcon* " ~A~%" a2-14) ) (+! s4-4 1) - (set! a2-14 (-> obj current data s4-4)) + (set! a2-14 (-> this current data s4-4)) ) ) ) diff --git a/goal_src/jak2/engine/debug/editable.gc b/goal_src/jak2/engine/debug/editable.gc index 726b37ddb4..c8da3fdb03 100644 --- a/goal_src/jak2/engine/debug/editable.gc +++ b/goal_src/jak2/engine/debug/editable.gc @@ -30,27 +30,27 @@ ) ) -(defmethod print editable-region ((obj editable-region)) - (format #t "#<~A region-~D ~A ~A @ #x~X>" (-> obj type) (-> obj id) (-> obj level) (-> obj tree) obj) - obj +(defmethod print editable-region ((this editable-region)) + (format #t "#<~A region-~D ~A ~A @ #x~X>" (-> this type) (-> this id) (-> this level) (-> this tree) this) + this ) -(defmethod editable-region-method-10 editable-region ((obj editable-region) (arg0 int)) +(defmethod editable-region-method-10 editable-region ((this editable-region) (arg0 int)) (local-vars (sv-16 string) (sv-32 string)) - (when (nonzero? (-> obj id)) + (when (nonzero? (-> this id)) (let ((s5-0 (clear *temp-string*))) - (format s5-0 "delete from region_sphere where region_id=~D" (-> obj id)) + (format s5-0 "delete from region_sphere where region_id=~D" (-> this id)) (let ((a2-1 (sql-query s5-0))) (when (!= (-> a2-1 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-1 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-1 this) (return #t) ) ) (clear s5-0) - (format s5-0 "select region_face_id from region_face where region_id=~D" (-> obj id)) + (format s5-0 "select region_face_id from region_face where region_id=~D" (-> this id)) (let ((s3-0 (sql-query s5-0))) (when (!= (-> s3-0 error) 'select) - (format 0 "ERROR: sql: face select error ~A for ~A~%" s3-0 obj) + (format 0 "ERROR: sql: face select error ~A for ~A~%" s3-0 this) (return #t) ) (when (> (-> s3-0 len) 0) @@ -83,26 +83,26 @@ (format s5-0 ")") (let ((a2-6 (sql-query s5-0))) (when (!= (-> a2-6 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-6 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-6 this) (return #t) ) ) ) ) (clear s5-0) - (format s5-0 "delete from region_face where region_id=~D" (-> obj id)) + (format s5-0 "delete from region_face where region_id=~D" (-> this id)) (let ((a2-8 (sql-query s5-0))) (when (!= (-> a2-8 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-8 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-8 this) (return #t) ) ) (when (zero? arg0) (clear s5-0) - (format s5-0 "delete from region where region_id=~D" (-> obj id)) + (format s5-0 "delete from region where region_id=~D" (-> this id)) (let ((a2-10 (sql-query s5-0))) (when (!= (-> a2-10 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-10 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-10 this) (return #t) ) ) @@ -112,14 +112,14 @@ #f ) -(defmethod editable-region-method-9 editable-region ((obj editable-region) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-region-method-9 editable-region ((this editable-region) (arg0 editable-array) (arg1 int) (arg2 int)) (local-vars (v0-0 symbol) (v1-5 object) (v1-28 object)) (set! v0-0 - (when (-> obj changed) - (format 0 "NOTICE: saving ~A~%" obj) + (when (-> this changed) + (format 0 "NOTICE: saving ~A~%" this) (let ((s5-0 *collapse-quote*)) (set! *collapse-quote* #f) - (let ((v1-1 (-> obj tree))) + (let ((v1-1 (-> this tree))) (b! (!= v1-1 'entity) cfg-3 :delay (nop!)) (b! #t cfg-78 :delay (nop!)) (label cfg-3) @@ -131,7 +131,7 @@ (b! #t cfg-15 :delay (nop!)) (label cfg-5) (b! (not s1-0) cfg-10 :likely-delay (set! v1-5 s1-0)) - (set! v1-5 (and (= (-> s1-0 region) obj) (not (logtest? (-> s1-0 flags) (editable-flag no-save))))) + (set! v1-5 (and (= (-> s1-0 region) this) (not (logtest? (-> s1-0 flags) (editable-flag no-save))))) (label cfg-10) (b! (not v1-5) cfg-14 :delay (empty-form)) (b! (editable-method-22 s1-0 arg0 1 0) cfg-14 :delay (empty-form)) @@ -154,7 +154,7 @@ (let ((v1-18 'modify)) (b! (= (-> a2-5 error) v1-18) cfg-21 :delay (empty-form)) ) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-5 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-5 this) ) (return #t) (label cfg-21) @@ -167,7 +167,7 @@ (let ((v1-22 'modify)) (b! (= (-> a2-7 error) v1-22) cfg-24 :delay (empty-form)) ) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-7 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-7 this) ) ) (return #t) @@ -179,7 +179,7 @@ (b! #t cfg-35 :delay (nop!)) (label cfg-25) (b! (not s1-1) cfg-30 :likely-delay (set! v1-28 s1-1)) - (set! v1-28 (and (= (-> s1-1 region) obj) (not (logtest? (-> s1-1 flags) (editable-flag no-save))))) + (set! v1-28 (and (= (-> s1-1 region) this) (not (logtest? (-> s1-1 flags) (editable-flag no-save))))) (label cfg-30) (b! (not v1-28) cfg-34 :delay (empty-form)) (b! (editable-method-22 s1-1 arg0 1 0) cfg-34 :delay (empty-form)) @@ -194,10 +194,10 @@ ) (b! #t cfg-78 :delay (nop!)) (label cfg-37) - (b! (nonzero? (-> obj id)) cfg-53 :delay (nop!)) + (b! (nonzero? (-> this id)) cfg-53 :delay (nop!)) (let ((s3-3 (clear *temp-string*))) - (format s3-3 "insert into region set level_name='~S',tree='~S'" (-> obj level) (-> obj tree)) - (let ((a2-11 (-> obj on-enter))) + (format s3-3 "insert into region set level_name='~S',tree='~S'" (-> this level) (-> this tree)) + (let ((a2-11 (-> this on-enter))) (b! (not a2-11) cfg-40 :delay (nop!)) (format s3-3 ",on_enter='~S'" a2-11) ) @@ -205,7 +205,7 @@ (label cfg-40) (format s3-3 ",on_enter=''") (label cfg-41) - (let ((a2-12 (-> obj on-exit))) + (let ((a2-12 (-> this on-exit))) (b! (not a2-12) cfg-43 :delay (nop!)) (format s3-3 ",on_exit='~S'" a2-12) ) @@ -213,7 +213,7 @@ (label cfg-43) (format s3-3 ",on_exit=''") (label cfg-44) - (let ((a2-13 (-> obj on-inside))) + (let ((a2-13 (-> this on-inside))) (b! (not a2-13) cfg-46 :delay (nop!)) (format s3-3 ",on_inside='~S'" a2-13) ) @@ -229,12 +229,12 @@ (let ((a0-36 'select)) (b! (!= (-> v1-50 error) a0-36) cfg-51 :delay (empty-form)) ) - (set! (-> obj id) (the-as uint (string->int (-> v1-50 data 0)))) + (set! (-> this id) (the-as uint (string->int (-> v1-50 data 0)))) ) (b! #t cfg-65 :delay (nop!)) (the-as none 0) (label cfg-51) - (format 0 "ERROR: sql: insert error ~A for ~A~%" s3-4 obj) + (format 0 "ERROR: sql: insert error ~A for ~A~%" s3-4 this) ) ) (set! v0-0 #f) @@ -243,8 +243,8 @@ (b! #t cfg-65 :delay (nop!)) (label cfg-53) (let ((s3-5 (clear *temp-string*))) - (format s3-5 "update region set level_name='~S',tree='~S'" (-> obj level) (-> obj tree)) - (let ((a2-16 (-> obj on-enter))) + (format s3-5 "update region set level_name='~S',tree='~S'" (-> this level) (-> this tree)) + (let ((a2-16 (-> this on-enter))) (b! (not a2-16) cfg-55 :delay (nop!)) (format s3-5 ",on_enter='~S'" a2-16) ) @@ -252,34 +252,34 @@ (label cfg-55) (format s3-5 ",on_enter=NULL") (label cfg-56) - (let ((a2-17 (-> obj on-exit))) + (let ((a2-17 (-> this on-exit))) (if a2-17 (format s3-5 ",on_exit='~S'" a2-17) (format s3-5 ",on_exit=NULL") ) ) - (let ((a2-18 (-> obj on-inside))) + (let ((a2-18 (-> this on-inside))) (if a2-18 (format s3-5 ",on_inside='~S'" a2-18) (format s3-5 ",on_inside=NULL") ) ) - (format s3-5 " where region_id=~D" (-> obj id)) + (format s3-5 " where region_id=~D" (-> this id)) (let ((a2-20 (sql-query s3-5))) (when (!= (-> a2-20 error) 'modify) - (format 0 "ERROR: sql: update error ~A for ~A~%" a2-20 obj) + (format 0 "ERROR: sql: update error ~A for ~A~%" a2-20 this) (return #f) ) ) ) (label cfg-65) - (editable-region-method-10 obj 1) + (editable-region-method-10 this 1) (let* ((s3-6 (-> arg0 length)) (s2-3 0) (s1-2 (-> arg0 data s2-3)) ) (while (< s2-3 s3-6) - (when (and s1-2 (= (-> s1-2 region) obj) (not (logtest? (-> s1-2 flags) (editable-flag no-save)))) + (when (and s1-2 (= (-> s1-2 region) this) (not (logtest? (-> s1-2 flags) (editable-flag no-save)))) (when (not (editable-method-22 s1-2 arg0 1 0)) (format 0 "ERROR: sql: insert error for ~A~%" s1-2) (return #f) @@ -290,7 +290,7 @@ ) ) (label cfg-78) - (set! (-> obj changed) #f) + (set! (-> this changed) #f) (set! v0-0 #t) (set! *collapse-quote* s5-0) ) @@ -301,7 +301,7 @@ v0-0 ) -(defmethod editable-region-method-11 editable-region ((obj editable-region) (arg0 vector) (arg1 int)) +(defmethod editable-region-method-11 editable-region ((this editable-region) (arg0 vector) (arg1 int)) (local-vars (sv-32 vector2h)) (set! sv-32 (new 'stack 'vector2h)) (add-debug-x #t (bucket-id debug-no-zbuf1) arg0 (new 'static 'rgba :r #xff :g #xff :a #x80)) @@ -309,12 +309,12 @@ (s2-0 #t) (s1-0 318) ) - (format (clear *temp-string*) "region-~D~%" (-> obj id)) + (format (clear *temp-string*) "region-~D~%" (-> this id)) (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* arg0 (font-color white) sv-32) ) (+! (-> sv-32 y) 8) (when (>= arg1 1) - (let ((s4-1 (-> obj on-enter))) + (let ((s4-1 (-> this on-enter))) (when s4-1 (let ((s3-1 add-debug-text-3d) (s2-1 #t) @@ -326,7 +326,7 @@ (+! (-> sv-32 y) 8) ) ) - (let ((s4-2 (-> obj on-inside))) + (let ((s4-2 (-> this on-inside))) (when s4-2 (let ((s3-2 add-debug-text-3d) (s2-2 #t) @@ -338,7 +338,7 @@ (+! (-> sv-32 y) 8) ) ) - (let ((s5-1 (-> obj on-exit))) + (let ((s5-1 (-> this on-exit))) (when s5-1 (let ((s4-3 add-debug-text-3d) (s3-3 #t) @@ -356,7 +356,7 @@ ) ;; WARN: Return type mismatch int vs editable-filter. -(defmethod editable-region-method-12 editable-region ((obj editable-region)) +(defmethod editable-region-method-12 editable-region ((this editable-region)) (let* ((s5-0 0) (s4-0 (lambda ((arg0 string)) (let ((gp-0 0)) (when (not (type? arg0 string)) @@ -383,16 +383,16 @@ ) ) (v0-3 - (logior (logior (logior s5-0 (s4-0 (-> obj on-inside))) (s4-0 (-> obj on-enter))) (s4-0 (-> obj on-exit))) + (logior (logior (logior s5-0 (s4-0 (-> this on-inside))) (s4-0 (-> this on-enter))) (s4-0 (-> this on-exit))) ) ) (when (zero? v0-3) - (if (and (not (-> obj on-inside)) (not (-> obj on-enter)) (not (-> obj on-exit))) + (if (and (not (-> this on-inside)) (not (-> this on-enter)) (not (-> this on-exit))) (set! v0-3 1) (set! v0-3 2) ) ) - (case (-> obj tree) + (case (-> this tree) (('target) (set! v0-3 (logior v0-3 512)) ) @@ -422,12 +422,12 @@ ) ) -(defmethod editable-method-23 editable ((obj editable)) +(defmethod editable-method-23 editable ((this editable)) #t ) -(defmethod editable-method-28 editable ((obj editable) (arg0 editable-filter)) - (let* ((s5-0 (-> obj owner)) +(defmethod editable-method-28 editable ((this editable) (arg0 editable-filter)) + (let* ((s5-0 (-> this owner)) (a0-1 (car s5-0)) ) (while (not (null? s5-0)) @@ -441,8 +441,8 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod editable-method-29 editable ((obj editable) (arg0 editable-filter)) - (let* ((s5-0 (-> obj owner)) +(defmethod editable-method-29 editable ((this editable) (arg0 editable-filter)) + (let* ((s5-0 (-> this owner)) (a0-1 (car s5-0)) ) (while (not (null? s5-0)) @@ -454,43 +454,43 @@ (the-as symbol 0) ) -(defmethod editable-method-21 editable ((obj editable) (arg0 editable-region)) - (when (not (and (-> obj region) (-> obj region locked))) +(defmethod editable-method-21 editable ((this editable) (arg0 editable-region)) + (when (not (and (-> this region) (-> this region locked))) (if arg0 (set! (-> arg0 changed) #t) ) - (if (-> obj region) - (set! (-> obj region changed) #t) + (if (-> this region) + (set! (-> this region changed) #t) ) - (logior! (-> obj flags) (editable-flag changed)) - (set! (-> obj region) arg0) + (logior! (-> this flags) (editable-flag changed)) + (set! (-> this region) arg0) ) 0 (none) ) ;; WARN: Return type mismatch int vs rgba. -(defmethod get-color editable ((obj editable) (arg0 int)) +(defmethod get-color editable ((this editable) (arg0 int)) "Returns the [[rgba]] that corresponds to the type of [[editable]] TODO - document the colors" (the-as rgba (cond - ((and (logtest? (-> obj flags) (editable-flag selected)) + ((and (logtest? (-> this flags) (editable-flag selected)) (< (mod (-> *display* real-clock frame-counter) 60) 30) ) (the-as int (the-as uint #x80ffffff)) ) - ((logtest? (-> obj flags) (editable-flag no-save)) + ((logtest? (-> this flags) (editable-flag no-save)) (shl #x80ff 16) ) - ((= (-> obj type) editable-point) + ((= (-> this type) editable-point) (the-as int (the-as uint #x800080ff)) ) - ((= (-> obj type) editable-sample) + ((= (-> this type) editable-sample) (the-as int (the-as uint #x80ff8000)) ) - ((= (-> obj type) editable-light) + ((= (-> this type) editable-light) (the-as int (the-as uint #x80ff0080)) ) - ((= (-> obj type) editable-entity) + ((= (-> this type) editable-entity) (the-as int (the-as uint #x80ff00ff)) ) (else @@ -500,46 +500,46 @@ ) ) -(defmethod editable-method-10 editable ((obj editable)) - (when (logtest? (-> obj flags) (editable-flag selected)) +(defmethod editable-method-10 editable ((this editable)) + (when (logtest? (-> this flags) (editable-flag selected)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (editable-method-11 obj s5-0) + (when (editable-method-11 this s5-0) (set! (-> s5-0 y) (-> s5-0 y)) (add-debug-x #t (bucket-id debug-no-zbuf1) s5-0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) ) ) - (add-debug-x #t (bucket-id debug-no-zbuf1) (edit-get-trans obj) (new 'static 'rgba :r #xff :g #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf1) (edit-get-trans this) (new 'static 'rgba :r #xff :g #xff :a #x80)) ) 0 (none) ) -(defmethod select-editable! editable ((obj editable) (arg0 symbol)) +(defmethod select-editable! editable ((this editable) (arg0 symbol)) (case arg0 (('toggle) - (logxor! (-> obj flags) (editable-flag selected)) + (logxor! (-> this flags) (editable-flag selected)) ) ((#f) - (logclear! (-> obj flags) (editable-flag selected)) + (logclear! (-> this flags) (editable-flag selected)) ) (else - (logior! (-> obj flags) (editable-flag selected)) + (logior! (-> this flags) (editable-flag selected)) ) ) 0 (none) ) -(defmethod edit-get-distance editable ((obj editable) (arg0 vector)) +(defmethod edit-get-distance editable ((this editable) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" -1.0 ) -(defmethod editable-method-20 editable ((obj editable) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod editable-method-20 editable ((this editable) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (local-vars (sv-48 vector) (sv-52 vector)) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) - (let ((s4-0 (edit-get-trans obj))) + (let ((s4-0 (edit-get-trans this))) (reverse-transform-point! sv-48 s4-0 arg2 arg0) (reverse-transform-point! sv-52 s4-0 arg2 arg1) (vector-! arg3 sv-52 sv-48) @@ -548,15 +548,15 @@ (if (< 20480.0 (vector-length arg3)) (vector-normalize! arg3 20480.0) ) - (editable-method-15 obj arg3 56) + (editable-method-15 this arg3 56) 0 (none) ) -(defmethod editable-method-11 editable ((obj editable) (arg0 vector)) +(defmethod editable-method-11 editable ((this editable) (arg0 vector)) (with-pp (let ((s5-0 (new 'stack 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> (edit-get-trans obj) quad)) + (set! (-> s5-0 start-pos quad) (-> (edit-get-trans this) quad)) (set-vector! (-> s5-0 move-dist) 0.0 -204800.0 0.0 1.0) (let ((v1-5 s5-0)) (set! (-> v1-5 radius) 40.96) @@ -576,62 +576,62 @@ ) ) -(defmethod editable-method-24 editable ((obj editable)) +(defmethod editable-method-24 editable ((this editable)) 0 (none) ) -(defmethod editable-method-17 editable ((obj editable) (arg0 vector)) +(defmethod editable-method-17 editable ((this editable) (arg0 vector)) 0 (none) ) -(defmethod editable-method-22 editable ((obj editable) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable ((this editable) (arg0 editable-array) (arg1 int) (arg2 int)) #t ) -(defmethod editable-method-15 editable ((obj editable) (arg0 vector) (arg1 int)) +(defmethod editable-method-15 editable ((this editable) (arg0 vector) (arg1 int)) 0 (none) ) -(defmethod edit-coord! editable ((obj editable) (arg0 vector) (arg1 editable-flag)) +(defmethod edit-coord! editable ((this editable) (arg0 vector) (arg1 editable-flag)) 0 (none) ) -(defmethod editable-method-18 editable ((obj editable) (arg0 vector) (arg1 matrix)) +(defmethod editable-method-18 editable ((this editable) (arg0 vector) (arg1 matrix)) 0 (none) ) -(defmethod edit-get-trans editable ((obj editable)) +(defmethod edit-get-trans editable ((this editable)) "Returns the `trans` [[vector]] or [[*null-vector*]]" *null-vector* ) -(defmethod editable-method-19 editable ((obj editable) (arg0 vector)) +(defmethod editable-method-19 editable ((this editable) (arg0 vector)) 0 (none) ) -(defmethod editable-method-26 editable ((obj editable) (arg0 editable) (arg1 editable-array)) +(defmethod editable-method-26 editable ((this editable) (arg0 editable) (arg1 editable-array)) 0 (none) ) -(defmethod editable-method-25 editable ((obj editable) (arg0 editable-array)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-25 editable ((this editable) (arg0 editable-array)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) - (let* ((s4-0 (-> obj owner)) + (logior! (-> this flags) (editable-flag changed)) + (let* ((s4-0 (-> this owner)) (a0-3 (car s4-0)) ) (while (not (null? s4-0)) - (editable-method-26 (the-as editable a0-3) obj arg0) + (editable-method-26 (the-as editable a0-3) this arg0) (set! s4-0 (cdr s4-0)) (set! a0-3 (car s4-0)) ) @@ -640,11 +640,11 @@ (none) ) -(defmethod editable-method-27 editable ((obj editable) (arg0 editable-array)) +(defmethod editable-method-27 editable ((this editable) (arg0 editable-array)) (local-vars (s4-0 editable)) (let ((v1-0 0)) (while (< v1-0 (-> arg0 selection length)) - (when (= obj (-> arg0 selection v1-0)) + (when (= this (-> arg0 selection v1-0)) (set! s4-0 (-> arg0 selection (+ v1-0 1))) (goto cfg-10) ) @@ -653,14 +653,14 @@ ) (let ((s3-0 (editable-array-method-11 arg0))) (set! s4-0 (when (>= s3-0 0) - (set! s4-0 (copy obj 'debug)) + (set! s4-0 (copy this 'debug)) (let ((v1-9 (-> arg0 region))) (if v1-9 (set! (-> s4-0 region) v1-9) ) ) (set! (-> s4-0 region changed) #t) - (logior! (-> obj flags) (editable-flag changed)) + (logior! (-> this flags) (editable-flag changed)) (set! (-> s4-0 id) (the-as uint 0)) (set! (-> s4-0 owner) '()) (select-editable! s4-0 #f) @@ -670,7 +670,7 @@ ) (set! *editable-temp-id* (+ *editable-temp-id* 1)) (set! (-> arg0 data s3-0) s4-0) - (set! (-> arg0 selection (-> arg0 selection length)) obj) + (set! (-> arg0 selection (-> arg0 selection length)) this) (set! (-> arg0 selection (+ (-> arg0 selection length) 1)) s4-0) (+! (-> arg0 selection length) 2) s4-0 @@ -681,53 +681,53 @@ s4-0 ) -(defmethod print editable-point ((obj editable-point)) +(defmethod print editable-point ((this editable-point)) (format #t "#<~A~S~m ~m ~m :r ~m" - (-> obj type) - (if (logtest? (-> obj flags) (editable-flag changed)) + (-> this type) + (if (logtest? (-> this flags) (editable-flag changed)) " (m)" "" ) - (-> obj trans x) - (-> obj trans y) - (-> obj trans z) - (-> obj radius) + (-> this trans x) + (-> this trans y) + (-> this trans z) + (-> this radius) ) - (format #t " @ #x~X>" obj) - obj + (format #t " @ #x~X>" this) + this ) ;; WARN: Function (method 28 editable-point) has a return type of none, but the expression builder found a return statement. -(defmethod editable-method-28 editable-point ((obj editable-point) (arg0 editable-filter)) +(defmethod editable-method-28 editable-point ((this editable-point) (arg0 editable-filter)) (if (logtest? arg0 (editable-filter water-command)) (return #f) ) (let ((s4-0 (-> *editable* 0 current))) (cond - ((logtest? (-> obj flags) (editable-flag top-set)) + ((logtest? (-> this flags) (editable-flag top-set)) (let* ((s3-0 (-> s4-0 length)) (s2-0 0) (a0-1 (-> s4-0 data s2-0)) ) (while (< s2-0 s3-0) - (if (and a0-1 (= (-> a0-1 region) (-> obj region)) (logtest? (-> a0-1 flags) (editable-flag top-set))) - (edit-coord! a0-1 (-> obj trans) (editable-flag y no-update)) + (if (and a0-1 (= (-> a0-1 region) (-> this region)) (logtest? (-> a0-1 flags) (editable-flag top-set))) + (edit-coord! a0-1 (-> this trans) (editable-flag y no-update)) ) (+! s2-0 1) (set! a0-1 (-> s4-0 data s2-0)) ) ) ) - ((logtest? (-> obj flags) (editable-flag bot-set)) + ((logtest? (-> this flags) (editable-flag bot-set)) (let* ((s3-1 (-> s4-0 length)) (s2-1 0) (a0-2 (-> s4-0 data s2-1)) ) (while (< s2-1 s3-1) - (if (and a0-2 (= (-> a0-2 region) (-> obj region)) (logtest? (-> a0-2 flags) (editable-flag bot-set))) - (edit-coord! a0-2 (-> obj trans) (editable-flag y no-update)) + (if (and a0-2 (= (-> a0-2 region) (-> this region)) (logtest? (-> a0-2 flags) (editable-flag bot-set))) + (edit-coord! a0-2 (-> this trans) (editable-flag y no-update)) ) (+! s2-1 1) (set! a0-2 (-> s4-0 data s2-1)) @@ -737,74 +737,74 @@ ) ) ((the-as (function editable-point editable-command none) (find-parent-method editable-point 28)) - obj + this (the-as editable-command arg0) ) 0 (none) ) -(defmethod editable-method-15 editable-point ((obj editable-point) (arg0 vector) (arg1 int)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-15 editable-point ((this editable-point) (arg0 vector) (arg1 int)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) - (vector+! (-> obj trans) (-> obj trans) arg0) - (editable-method-28 obj (the-as editable-filter arg1)) + (logior! (-> this flags) (editable-flag changed)) + (vector+! (-> this trans) (-> this trans) arg0) + (editable-method-28 this (the-as editable-filter arg1)) 0 (none) ) -(defmethod edit-coord! editable-point ((obj editable-point) (arg0 vector) (arg1 editable-flag)) - (let ((v1-0 (-> obj region))) +(defmethod edit-coord! editable-point ((this editable-point) (arg0 vector) (arg1 editable-flag)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) + (logior! (-> this flags) (editable-flag changed)) (if (logtest? arg1 (editable-flag x)) - (set! (-> obj trans x) (-> arg0 x)) + (set! (-> this trans x) (-> arg0 x)) ) (if (logtest? arg1 (editable-flag y)) - (set! (-> obj trans y) (-> arg0 y)) + (set! (-> this trans y) (-> arg0 y)) ) (if (logtest? arg1 (editable-flag z)) - (set! (-> obj trans z) (-> arg0 z)) + (set! (-> this trans z) (-> arg0 z)) ) - (editable-method-28 obj (the-as editable-filter arg1)) + (editable-method-28 this (the-as editable-filter arg1)) 0 (none) ) -(defmethod edit-get-trans editable-point ((obj editable-point)) +(defmethod edit-get-trans editable-point ((this editable-point)) "Returns the `trans` [[vector]] or [[*null-vector*]]" - (-> obj trans) + (-> this trans) ) -(defmethod editable-method-18 editable-point ((obj editable-point) (arg0 vector) (arg1 matrix)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-18 editable-point ((this editable-point) (arg0 vector) (arg1 matrix)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) - (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> obj trans) arg0))) + (logior! (-> this flags) (editable-flag changed)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this trans) arg0))) (vector-matrix*! s4-1 s4-1 arg1) - (vector+! (-> obj trans) s4-1 arg0) + (vector+! (-> this trans) s4-1 arg0) ) 0 (none) ) -(defmethod editable-method-10 editable-point ((obj editable-point)) +(defmethod editable-method-10 editable-point ((this editable-point)) (let* ((s5-0 vector-vector-distance) (a0-1 (math-camera-pos)) - (a1-0 (-> obj trans)) - (f0-1 (- (s5-0 a0-1 a1-0) (-> obj radius))) + (a1-0 (-> this trans)) + (f0-1 (- (s5-0 a0-1 a1-0) (-> this radius))) (s2-0 (cond - ((logtest? (-> obj flags) (editable-flag selected)) + ((logtest? (-> this flags) (editable-flag selected)) 6 ) ((>= f0-1 983040.0) @@ -824,27 +824,27 @@ ) (add-debug-sphere-from-table (bucket-id debug2) - (-> obj trans) - (-> obj radius) - (get-color obj (the-as int a1-0)) + (-> this trans) + (-> this radius) + (get-color this (the-as int a1-0)) s2-0 ) ) - ((method-of-type editable editable-method-10) obj) + ((method-of-type editable editable-method-10) this) (none) ) -(defmethod edit-get-distance editable-point ((obj editable-point) (arg0 vector)) +(defmethod edit-get-distance editable-point ((this editable-point) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((a0-1 (new 'stack-no-clear 'sphere)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-1 quad) (-> obj trans quad)) - (set! (-> a0-1 r) (-> obj radius)) + (set! (-> a0-1 quad) (-> this trans quad)) + (set! (-> a0-1 r) (-> this radius)) (when (sphere-in-view-frustum? a0-1) - (reverse-transform-point! s5-0 (-> obj trans) (-> *math-camera* inv-camera-rot vector 2) arg0) - (let ((f0-1 (vector-vector-distance (edit-get-trans obj) s5-0))) - (if (>= (-> obj radius) f0-1) + (reverse-transform-point! s5-0 (-> this trans) (-> *math-camera* inv-camera-rot vector 2) arg0) + (let ((f0-1 (vector-vector-distance (edit-get-trans this) s5-0))) + (if (>= (-> this radius) f0-1) (return f0-1) ) ) @@ -853,22 +853,22 @@ -1.0 ) -(defmethod editable-method-19 editable-point ((obj editable-point) (arg0 vector)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-19 editable-point ((this editable-point) (arg0 vector)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)))) - (vector-normalize! s4-1 (-> obj radius)) - (vector-! (-> obj trans) arg0 s4-1) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))) + (vector-normalize! s4-1 (-> this radius)) + (vector-! (-> this trans) arg0 s4-1) ) - (editable-method-28 obj (editable-filter load)) + (editable-method-28 this (editable-filter load)) 0 (none) ) -(defmethod editable-method-22 editable-point ((obj editable-point) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-point ((this editable-point) (arg0 editable-array) (arg1 int) (arg2 int)) (case arg1 ((2) (let ((s3-0 (clear *temp-string*))) @@ -876,13 +876,13 @@ s3-0 "insert into region_point set region_face_id=LAST_INSERT_ID(),idx=~D,x=~f,y=~f,z=~f" arg2 - (- (-> obj trans x) (-> arg0 level-offset x)) - (- (-> obj trans y) (-> arg0 level-offset y)) - (- (-> obj trans z) (-> arg0 level-offset z)) + (- (-> this trans x) (-> arg0 level-offset x)) + (- (-> this trans y) (-> arg0 level-offset y)) + (- (-> this trans z) (-> arg0 level-offset z)) ) (let ((a0-5 (sql-query s3-0))) (when (= (-> a0-5 error) 'modify) - (logclear! (-> obj flags) (editable-flag changed)) + (logclear! (-> this flags) (editable-flag changed)) #t ) ) @@ -894,91 +894,91 @@ ) ) -(defmethod editable-method-17 editable-sphere ((obj editable-sphere) (arg0 vector)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-17 editable-sphere ((this editable-sphere) (arg0 vector)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) + (logior! (-> this flags) (editable-flag changed)) (if (= (-> arg0 y) 0.0) - (+! (-> obj radius) (-> arg0 x)) - (set! (-> obj radius) (-> arg0 y)) + (+! (-> this radius) (-> arg0 x)) + (set! (-> this radius) (-> arg0 y)) ) - (if (< (-> obj radius) 0.0) - (set! (-> obj radius) 0.0) + (if (< (-> this radius) 0.0) + (set! (-> this radius) 0.0) ) - (editable-method-28 obj (editable-filter load)) + (editable-method-28 this (editable-filter load)) 0 (none) ) -(defmethod editable-method-22 editable-sphere ((obj editable-sphere) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-sphere ((this editable-sphere) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((gp-0 (clear *temp-string*))) (format gp-0 "insert into region_sphere set region_id=~D,x=~f,y=~f,z=~f,r=~f" - (-> obj region id) - (- (-> obj trans x) (-> arg0 level-offset x)) - (- (-> obj trans y) (-> arg0 level-offset y)) - (- (-> obj trans z) (-> arg0 level-offset z)) - (-> obj radius) + (-> this region id) + (- (-> this trans x) (-> arg0 level-offset x)) + (- (-> this trans y) (-> arg0 level-offset y)) + (- (-> this trans z) (-> arg0 level-offset z)) + (-> this radius) ) (= (-> (sql-query gp-0) error) 'modify) ) ) -(defmethod editable-method-22 editable-sample ((obj editable-sample) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-sample ((this editable-sample) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((s5-0 (clear *temp-string*))) (format s5-0 "insert into sample_point set level_info_id=~D,x=~f,y=~f,z=~f,source='manual'" (-> arg0 level-info-id) - (* 0.00024414062 (- (-> obj trans x) (-> arg0 level-offset x))) - (* 0.00024414062 (- (-> obj trans y) (-> arg0 level-offset y))) - (* 0.00024414062 (- (-> obj trans z) (-> arg0 level-offset z))) + (* 0.00024414062 (- (-> this trans x) (-> arg0 level-offset x))) + (* 0.00024414062 (- (-> this trans y) (-> arg0 level-offset y))) + (* 0.00024414062 (- (-> this trans z) (-> arg0 level-offset z))) ) (let ((a0-4 (sql-query s5-0))) (when (= (-> a0-4 error) 'modify) - (logclear! (-> obj flags) (editable-flag changed)) + (logclear! (-> this flags) (editable-flag changed)) #t ) ) ) ) -(defmethod print editable-light ((obj editable-light)) +(defmethod print editable-light ((this editable-light)) (format #t "#<~A~S ~S ~m ~m ~m" - (-> obj type) - (if (logtest? (-> obj flags) (editable-flag changed)) + (-> this type) + (if (logtest? (-> this flags) (editable-flag changed)) " (m)" "" ) - (-> obj name) - (-> obj trans x) - (-> obj trans y) - (-> obj trans z) + (-> this name) + (-> this trans x) + (-> this trans y) + (-> this trans z) ) - (format #t " :r ~m @ #x~X>" (-> obj radius) obj) - obj + (format #t " :r ~m @ #x~X>" (-> this radius) this) + this ) -(defmethod editable-method-23 editable-light ((obj editable-light)) +(defmethod editable-method-23 editable-light ((this editable-light)) (let ((v1-0 *light-hash*)) (let* ((a2-0 (-> v1-0 num-lights)) (a1-1 (-> v1-0 light-sphere-array a2-0)) ) - (set! (-> a1-1 name) (-> obj name)) - (set! (-> a1-1 decay-start) (-> obj decay-start)) - (set! (-> a1-1 ambient-point-ratio) (-> obj ambient-point-ratio)) - (set! (-> a1-1 brightness) (-> obj brightness)) - (set! (-> a1-1 bsphere quad) (-> obj trans quad)) - (set! (-> a1-1 bsphere w) (-> obj radius)) - (set! (-> a1-1 direction quad) (-> obj direction quad)) - (set! (-> a1-1 color quad) (-> obj color quad)) - (set! (-> a1-1 palette-index) (the int (-> obj color w))) + (set! (-> a1-1 name) (-> this name)) + (set! (-> a1-1 decay-start) (-> this decay-start)) + (set! (-> a1-1 ambient-point-ratio) (-> this ambient-point-ratio)) + (set! (-> a1-1 brightness) (-> this brightness)) + (set! (-> a1-1 bsphere quad) (-> this trans quad)) + (set! (-> a1-1 bsphere w) (-> this radius)) + (set! (-> a1-1 direction quad) (-> this direction quad)) + (set! (-> a1-1 color quad) (-> this color quad)) + (set! (-> a1-1 palette-index) (the int (-> this color w))) ) (+! (-> v1-0 num-lights) 1) ) @@ -1002,49 +1002,49 @@ (none) ) -(defmethod editable-method-17 editable-light ((obj editable-light) (arg0 vector)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-17 editable-light ((this editable-light) (arg0 vector)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) + (logior! (-> this flags) (editable-flag changed)) (if (= (-> arg0 y) 0.0) - (+! (-> obj radius) (-> arg0 x)) - (set! (-> obj radius) (-> arg0 y)) + (+! (-> this radius) (-> arg0 x)) + (set! (-> this radius) (-> arg0 y)) ) - (if (< (-> obj radius) 0.0) - (set! (-> obj radius) 0.0) + (if (< (-> this radius) 0.0) + (set! (-> this radius) 0.0) ) - (update-light-sphere-from-editable-light obj) - (editable-method-28 obj (editable-filter load)) + (update-light-sphere-from-editable-light this) + (editable-method-28 this (editable-filter load)) 0 (none) ) -(defmethod editable-method-15 editable-light ((obj editable-light) (arg0 vector) (arg1 int)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-15 editable-light ((this editable-light) (arg0 vector) (arg1 int)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) - (vector+! (-> obj trans) (-> obj trans) arg0) - (update-light-sphere-from-editable-light obj) - (editable-method-28 obj (the-as editable-filter arg1)) + (logior! (-> this flags) (editable-flag changed)) + (vector+! (-> this trans) (-> this trans) arg0) + (update-light-sphere-from-editable-light this) + (editable-method-28 this (the-as editable-filter arg1)) 0 (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 ((obj editable-light) (arg0 editable-array)) - ((the-as (function editable-light editable-array none) (find-parent-method editable-light 25)) obj arg0) - (when (nonzero? (-> obj id)) +(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) + (when (nonzero? (-> this id)) (let ((s5-1 (clear *temp-string*))) - (format s5-1 "delete from light where light_id=~D" (-> obj id)) + (format s5-1 "delete from light where light_id=~D" (-> this id)) (let ((a2-1 (sql-query s5-1))) (when (!= (-> a2-1 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-1 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-1 this) (return 0) ) ) @@ -1054,62 +1054,68 @@ (none) ) -(defmethod editable-method-22 editable-light ((obj editable-light) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-light ((this editable-light) (arg0 editable-array) (arg1 int) (arg2 int)) (cond - ((logtest? (-> obj flags) (editable-flag changed)) + ((logtest? (-> this flags) (editable-flag changed)) (let ((s5-0 (clear *temp-string*))) - (when (zero? (-> obj id)) - (format s5-0 "insert into light set level_name='~S'" (-> obj region level)) + (when (zero? (-> this id)) + (format s5-0 "insert into light set level_name='~S'" (-> this region level)) (let ((s3-0 (sql-query s5-0))) (when (= (-> s3-0 error) 'modify) (let ((v1-7 (sql-query "select LAST_INSERT_ID()"))) (when (= (-> v1-7 error) 'select) - (set! (-> obj id) (the-as uint (string->int (-> v1-7 data 0)))) + (set! (-> this id) (the-as uint (string->int (-> v1-7 data 0)))) (goto cfg-8) ) ) ) - (format 0 "ERROR: sql: id insert error ~A for ~A~%" s3-0 obj) + (format 0 "ERROR: sql: id insert error ~A for ~A~%" s3-0 this) ) (return #f) (label cfg-8) (let ((s3-1 (new 'debug 'string 32 (the-as string #f)))) - (format s3-1 "light-~d" (-> obj id)) - (set! (-> obj name) s3-1) + (format s3-1 "light-~d" (-> this id)) + (set! (-> this name) s3-1) ) ) - (format (clear s5-0) "update light set level_name='~S', name='~S'" (-> obj region level) (-> obj name)) + (format (clear s5-0) "update light set level_name='~S', name='~S'" (-> this region level) (-> this name)) (format s5-0 ", pos_x=~f, pos_y=~f, pos_z=~f, r=~f" - (* 0.00024414062 (- (-> obj trans x) (-> arg0 level-offset x))) - (* 0.00024414062 (- (-> obj trans y) (-> arg0 level-offset y))) - (* 0.00024414062 (- (-> obj trans z) (-> arg0 level-offset z))) - (* 0.00024414062 (-> obj radius)) + (* 0.00024414062 (- (-> this trans x) (-> arg0 level-offset x))) + (* 0.00024414062 (- (-> this trans y) (-> arg0 level-offset y))) + (* 0.00024414062 (- (-> this trans z) (-> arg0 level-offset z))) + (* 0.00024414062 (-> this radius)) ) - (if (= (-> obj direction w) 0.0) + (if (= (-> this direction w) 0.0) (format s5-0 ", dir_x=0.0, dir_y=0.0, dir_z=0.0") - (format s5-0 ", dir_x=~f, dir_y=~f, dir_z=~f" (-> obj direction x) (-> obj direction y) (-> obj direction z)) + (format + s5-0 + ", dir_x=~f, dir_y=~f, dir_z=~f" + (-> this direction x) + (-> this direction y) + (-> this direction z) + ) ) (format s5-0 ", color0_r=~f, color0_g=~f, color0_b=~f, color0_a=~f" - (-> obj color x) - (-> obj color y) - (-> obj color z) - (-> obj color w) + (-> this color x) + (-> this color y) + (-> this color z) + (-> this color w) ) (format s5-0 ", decay_start=~f, ambient_point_ratio=~f, brightness=~f" - (-> obj decay-start) - (-> obj ambient-point-ratio) - (-> obj brightness) + (-> this decay-start) + (-> this ambient-point-ratio) + (-> this brightness) ) - (format s5-0 " where light_id=~D" (-> obj id)) + (format s5-0 " where light_id=~D" (-> this id)) (let ((a0-21 (sql-query s5-0))) (when (= (-> a0-21 error) 'modify) - (logclear! (-> obj flags) (editable-flag changed)) + (logclear! (-> this flags) (editable-flag changed)) #t ) ) @@ -1121,14 +1127,14 @@ ) ) -(defmethod editable-method-10 editable-light ((obj editable-light)) - (if (!= (-> obj direction w) 0.0) +(defmethod editable-method-10 editable-light ((this editable-light)) + (if (!= (-> this direction w) 0.0) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (edit-get-trans obj) - (-> obj direction) - (* -1.2 (-> obj radius)) + (edit-get-trans this) + (-> this direction) + (* -1.2 (-> this radius)) (new 'static 'rgba :r #xff :b #xff :a #x80) ) ) @@ -1137,32 +1143,32 @@ (s4-1 #t) (s3-1 318) ) - (format (clear *temp-string*) "~S~%" (-> obj name)) - (s5-1 s4-1 (the-as bucket-id s3-1) *temp-string* (-> obj trans) (font-color white) (the-as vector2h #f)) + (format (clear *temp-string*) "~S~%" (-> this name)) + (s5-1 s4-1 (the-as bucket-id s3-1) *temp-string* (-> this trans) (font-color white) (the-as vector2h #f)) ) ) - ((method-of-type editable-sphere editable-method-10) obj) + ((method-of-type editable-sphere editable-method-10) this) (none) ) -(defmethod edit-get-trans editable-face ((obj editable-face)) +(defmethod edit-get-trans editable-face ((this editable-face)) "Returns the `trans` [[vector]] or [[*null-vector*]]" "The center of the obj." (cond - ((>= (-> obj length) 3) + ((>= (-> this length) 3) (let ((s5-0 (new 'static 'vector))) (set! (-> s5-0 quad) (the-as uint128 0)) - (vector+! s5-0 s5-0 (edit-get-trans (-> obj vertex 0))) - (vector+! s5-0 s5-0 (edit-get-trans (-> obj vertex 1))) - (vector+! s5-0 s5-0 (edit-get-trans (-> obj vertex 2))) + (vector+! s5-0 s5-0 (edit-get-trans (-> this vertex 0))) + (vector+! s5-0 s5-0 (edit-get-trans (-> this vertex 1))) + (vector+! s5-0 s5-0 (edit-get-trans (-> this vertex 2))) (vector-float*! s5-0 s5-0 0.33333334) ) ) - ((>= (-> obj length) 2) + ((>= (-> this length) 2) (let ((s5-1 (new 'static 'vector))) (set! (-> s5-1 quad) (the-as uint128 0)) - (vector+! s5-1 s5-1 (edit-get-trans (-> obj vertex 0))) - (vector+! s5-1 s5-1 (edit-get-trans (-> obj vertex 1))) + (vector+! s5-1 s5-1 (edit-get-trans (-> this vertex 0))) + (vector+! s5-1 s5-1 (edit-get-trans (-> this vertex 1))) (vector-float*! s5-1 s5-1 0.5) ) ) @@ -1172,10 +1178,10 @@ ) ) -(defmethod editable-method-22 editable-face ((obj editable-face) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-face ((this editable-face) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((s4-0 (clear *temp-string*))) - (format s4-0 "insert into region_face set kind='face',region_id=~D" (-> obj region id)) - (if (logtest? (-> obj flags) (editable-flag orient)) + (format s4-0 "insert into region_face set kind='face',region_id=~D" (-> this region id)) + (if (logtest? (-> this flags) (editable-flag orient)) (format s4-0 ",flags='orient'") ) (let ((a0-5 (sql-query s4-0))) @@ -1184,51 +1190,51 @@ ) ) ) - (dotimes (s4-1 (-> obj length)) - (editable-method-22 (-> obj vertex s4-1) arg0 2 s4-1) + (dotimes (s4-1 (-> this length)) + (editable-method-22 (-> this vertex s4-1) arg0 2 s4-1) ) - (logclear! (-> obj flags) (editable-flag changed)) + (logclear! (-> this flags) (editable-flag changed)) #t ) -(defmethod editable-method-25 editable-face ((obj editable-face) (arg0 editable-array)) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj vertex s4-0))) - (set! (-> s3-0 owner) (delete! obj (-> s3-0 owner))) +(defmethod editable-method-25 editable-face ((this editable-face) (arg0 editable-array)) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this vertex s4-0))) + (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) ) ) - ((the-as (function editable-face editable-array none) (find-parent-method editable-face 25)) obj arg0) + ((the-as (function editable-face editable-array none) (find-parent-method editable-face 25)) this arg0) (none) ) -(defmethod editable-method-26 editable-face ((obj editable-face) (arg0 editable) (arg1 editable-array)) - (-> obj length) - (countdown (v1-1 (-> obj length)) - (when (= (-> obj vertex v1-1) arg0) +(defmethod editable-method-26 editable-face ((this editable-face) (arg0 editable) (arg1 editable-array)) + (-> this length) + (countdown (v1-1 (-> this length)) + (when (= (-> this vertex v1-1) arg0) (let ((a0-5 v1-1) - (a1-2 (+ (-> obj length) -2)) + (a1-2 (+ (-> this length) -2)) ) (while (>= a1-2 a0-5) - (set! (-> obj vertex a0-5) (-> obj vertex (+ a0-5 1))) + (set! (-> this vertex a0-5) (-> this vertex (+ a0-5 1))) (+! a0-5 1) ) ) - (+! (-> obj length) -1) + (+! (-> this length) -1) ) ) - (if (< (-> obj length) 3) - (editable-array-method-15 arg1 obj) + (if (< (-> this length) 3) + (editable-array-method-15 arg1 this) ) - ((method-of-type editable editable-method-26) obj arg0 arg1) + ((method-of-type editable editable-method-26) this arg0 arg1) (none) ) ;; WARN: Return type mismatch editable-face vs editable. -(defmethod editable-method-27 editable-face ((obj editable-face) (arg0 editable-array)) +(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)) obj arg0) + ((the-as (function editable-face editable-array editable) (find-parent-method editable-face 27)) this arg0) ) ) ) @@ -1240,24 +1246,24 @@ ) ) -(defmethod editable-method-24 editable-face ((obj editable-face)) - (logxor! (-> obj flags) (editable-flag orient)) - (editable-face-method-31 obj (-> obj normal)) - (logior! (-> obj flags) (editable-flag changed)) - (set! (-> obj region changed) #t) +(defmethod editable-method-24 editable-face ((this editable-face)) + (logxor! (-> this flags) (editable-flag orient)) + (editable-face-method-31 this (-> this normal)) + (logior! (-> this flags) (editable-flag changed)) + (set! (-> this region changed) #t) 0 (none) ) -(defmethod editable-face-method-30 editable-face ((obj editable-face) (arg0 (inline-array vector))) - (let ((v1-0 (-> obj length))) +(defmethod editable-face-method-30 editable-face ((this editable-face) (arg0 (inline-array vector))) + (let ((v1-0 (-> this length))) (cond ((or (zero? v1-0) (= v1-0 1)) 0 ) ((= v1-0 2) - (let ((s4-0 (edit-get-trans (-> obj vertex 0))) - (v1-3 (edit-get-trans (-> obj vertex 1))) + (let ((s4-0 (edit-get-trans (-> this vertex 0))) + (v1-3 (edit-get-trans (-> this vertex 1))) ) (set! (-> arg0 0 quad) (-> s4-0 quad)) (set! (-> arg0 1 quad) (-> s4-0 quad)) @@ -1269,37 +1275,37 @@ 4 ) (else - (dotimes (s4-1 (-> obj length)) - (set! (-> arg0 s4-1 quad) (-> (edit-get-trans (-> obj vertex s4-1)) quad)) + (dotimes (s4-1 (-> this length)) + (set! (-> arg0 s4-1 quad) (-> (edit-get-trans (-> this vertex s4-1)) quad)) ) - (-> obj length) + (-> this length) ) ) ) ) -(defmethod editable-face-method-31 editable-face ((obj editable-face) (arg0 vector)) +(defmethod editable-face-method-31 editable-face ((this editable-face) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'matrix))) (dotimes (v1-0 6) (set! (-> s4-0 quad v1-0) (the-as uint128 0)) ) - (if (>= (editable-face-method-30 obj (the-as (inline-array vector) s4-0)) 3) + (if (>= (editable-face-method-30 this (the-as (inline-array vector) s4-0)) 3) (normal-of-plane arg0 (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) (-> s4-0 vector 2)) ) ) - (if (logtest? (-> obj flags) (editable-flag orient)) + (if (logtest? (-> this flags) (editable-flag orient)) (vector-negate! arg0 arg0) ) arg0 ) -(defmethod edit-get-distance editable-face ((obj editable-face) (arg0 vector)) +(defmethod edit-get-distance editable-face ((this editable-face) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((gp-0 (new 'stack-no-clear 'vector)) - (s5-0 (editable-face-method-31 obj (new 'stack-no-clear 'vector))) + (s5-0 (editable-face-method-31 this (new 'stack-no-clear 'vector))) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-0 quad) (-> (edit-get-trans (-> obj vertex 0)) quad)) + (set! (-> s2-0 quad) (-> (edit-get-trans (-> this vertex 0)) quad)) (transform-point-vector! gp-0 s2-0) (when (< 0.0 (-> gp-0 z)) (reverse-transform-point! gp-0 s2-0 s5-0 arg0) @@ -1307,7 +1313,7 @@ (dotimes (v1-5 6) (set! (-> points v1-5 quad) (the-as uint128 0)) ) - (let ((s4-1 (editable-face-method-30 obj points)) + (let ((s4-1 (editable-face-method-30 this points)) (s2-1 0) (s1-1 (vector-negate! (new 'stack-no-clear 'vector) s5-0)) ) @@ -1328,7 +1334,7 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod editable-method-29 editable-face ((obj editable-face) (arg0 editable-filter)) +(defmethod editable-method-29 editable-face ((this editable-face) (arg0 editable-filter)) (local-vars (sv-208 (inline-array vector)) (sv-216 int) @@ -1342,21 +1348,21 @@ (sv-400 float) ) (format 0 "ugh 1~%") - (if (or (logtest? arg0 (editable-filter water-command)) (logtest? (-> obj flags) (editable-flag mark))) + (if (or (logtest? arg0 (editable-filter water-command)) (logtest? (-> this flags) (editable-flag mark))) (return (the-as symbol #f)) ) - (logior! (-> obj flags) (editable-flag mark)) + (logior! (-> this flags) (editable-flag mark)) (format 0 "ugh 2~%") (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 6))) (dotimes (v1-7 6) (set! (-> s5-0 v1-7 quad) (the-as uint128 0)) ) (format 0 "ugh 21~%") - (let ((s4-0 (editable-face-method-30 obj s5-0))) - (when (and (>= s4-0 4) (>= (-> obj length) 3)) + (let ((s4-0 (editable-face-method-30 this s5-0))) + (when (and (>= s4-0 4) (>= (-> this length) 3)) (let ((v1-14 0)) (dotimes (a0-7 s4-0) - (if (logtest? (-> obj vertex a0-7 flags) (editable-flag selected)) + (if (logtest? (-> this vertex a0-7 flags) (editable-flag selected)) (+! v1-14 1) ) ) @@ -1373,39 +1379,39 @@ ) (set! sv-216 0) (dotimes (s2-2 s4-0) - (when (not (logtest? (-> obj vertex s2-2 flags) (editable-flag selected))) - (set! (-> sv-208 sv-216 quad) (-> (edit-get-trans (-> obj vertex s2-2)) quad)) + (when (not (logtest? (-> this vertex s2-2 flags) (editable-flag selected))) + (set! (-> sv-208 sv-216 quad) (-> (edit-get-trans (-> this vertex s2-2)) quad)) (set! sv-216 (+ sv-216 1)) ) ) (dotimes (s2-3 s4-0) - (when (logtest? (-> obj vertex s2-3 flags) (editable-flag selected)) - (set! (-> sv-208 sv-216 quad) (-> (edit-get-trans (-> obj vertex s2-3)) quad)) + (when (logtest? (-> this vertex s2-3 flags) (editable-flag selected)) + (set! (-> sv-208 sv-216 quad) (-> (edit-get-trans (-> this vertex s2-3)) quad)) (set! sv-216 (+ sv-216 1)) ) ) - (normal-of-plane (-> obj normal) (-> sv-208 0) (-> sv-208 1) (-> sv-208 2)) - (set! (-> obj center quad) (-> (edit-get-trans obj) quad)) + (normal-of-plane (-> this normal) (-> sv-208 0) (-> sv-208 1) (-> sv-208 2)) + (set! (-> this center quad) (-> (edit-get-trans this) quad)) ) ) ) (format 0 "ugh 22~%") (when (not (logtest? arg0 (editable-filter load))) - (when (= (-> obj normal w) 0.0) - (editable-face-method-31 obj (-> obj normal)) - (set! (-> obj center quad) (-> (edit-get-trans obj) quad)) + (when (= (-> this normal w) 0.0) + (editable-face-method-31 this (-> this normal)) + (set! (-> this center quad) (-> (edit-get-trans this) quad)) ) (let ((s3-2 0) - (s2-5 (-> obj normal)) - (s1-2 (-> obj center)) + (s2-5 (-> this normal)) + (s1-2 (-> this center)) ) (while (< s3-2 s4-0) - (when (logtest? (-> obj vertex s3-2 flags) (editable-flag selected)) + (when (logtest? (-> this vertex s3-2 flags) (editable-flag selected)) (let* ((a1-14 (vector-! (new 'stack-no-clear 'vector) (-> s5-0 s3-2) s1-2)) (f0-2 (vector-dot a1-14 s2-5)) ) (edit-coord! - (-> obj vertex s3-2) + (-> this vertex s3-2) (vector+float*! a1-14 (-> s5-0 s3-2) s2-5 (- f0-2)) (editable-flag x y z no-plane-snap) ) @@ -1424,13 +1430,13 @@ 6 ) ) - (set! sv-292 (+ (-> obj length) -1)) + (set! sv-292 (+ (-> this length) -1)) (set! sv-296 1) (format 0 "ugh 231~%") - (editable-face-method-31 obj (-> obj normal)) + (editable-face-method-31 this (-> this normal)) (format 0 "ugh 232~%") (dotimes (v1-85 sv-292) - (set! (-> (the-as (array editable-point) sv-288) v1-85) (-> obj vertex (+ v1-85 1))) + (set! (-> (the-as (array editable-point) sv-288) v1-85) (-> this vertex (+ v1-85 1))) ) (format 0 "ugh 233~%") (set! sv-368 (new-stack-matrix0)) @@ -1438,20 +1444,19 @@ (set! sv-372 (the-as editable-point #f)) (set! sv-376 (the-as float 0.0)) (set! sv-380 #t) - (format 0 "ugh 24~%") (vector-normalize! - (vector-! (-> sv-368 vector 2) (edit-get-trans obj) (edit-get-trans (-> obj vertex 0))) + (vector-! (-> sv-368 vector 2) (edit-get-trans this) (edit-get-trans (-> this vertex 0))) 1.0 ) - (vector-normalize! (editable-face-method-31 obj (-> sv-368 vector 1)) 1.0) + (vector-normalize! (editable-face-method-31 this (-> sv-368 vector 1)) 1.0) (vector-normalize! (vector-cross! (the-as vector (-> sv-368 vector)) (-> sv-368 vector 2) (-> sv-368 vector 1)) 1.0 ) - (set! (-> sv-368 trans quad) (-> (edit-get-trans (-> obj vertex 0)) quad)) + (set! (-> sv-368 trans quad) (-> (edit-get-trans (-> this vertex 0)) quad)) (set! (-> sv-368 trans w) 1.0) (matrix-4x4-inverse! sv-368 sv-368) - (while (< sv-296 (-> obj length)) + (while (< sv-296 (-> this length)) (set! sv-372 (the-as editable-point #f)) (dotimes (s5-4 sv-292) (when (-> (the-as (array editable-point) sv-288) s5-4) @@ -1476,7 +1481,7 @@ ) ) ) - (set! (-> obj vertex sv-296) sv-372) + (set! (-> this vertex sv-296) sv-372) (dotimes (v1-137 sv-292) (if (= sv-372 (-> (the-as (array editable-point) sv-288) v1-137)) (set! (-> (the-as (array editable-point) sv-288) v1-137) #f) @@ -1485,34 +1490,34 @@ (set! sv-296 (+ sv-296 1)) (set! sv-380 (not sv-380)) ) - (if (< (vector-dot (-> obj normal) (editable-face-method-31 obj (new 'stack-no-clear 'vector))) 0.0) - (logxor! (-> obj flags) (editable-flag orient)) + (if (< (vector-dot (-> this normal) (editable-face-method-31 this (new 'stack-no-clear 'vector))) 0.0) + (logxor! (-> this flags) (editable-flag orient)) ) ) ) ) (format 0 "ugh 3~%") - (editable-face-method-31 obj (-> obj normal)) + (editable-face-method-31 this (-> this normal)) (format 0 "ugh 4~%") ;; TODO - we set the center - ;; (set! (-> obj center quad) (-> (edit-get-trans obj) quad)) + ;; (set! (-> this center quad) (-> (edit-get-trans this) quad)) (the-as symbol 0) ) -(defmethod editable-method-10 editable-face ((obj editable-face)) +(defmethod editable-method-10 editable-face ((this editable-face)) ;; Greatly simplify the code here (let ((points (new 'stack-no-clear 'inline-array 'vector 4))) (dotimes (point-idx 4) - ;; (inspect obj) - (set! (-> points point-idx quad) (-> obj vertex point-idx trans quad)) + ;; (inspect this) + (set! (-> points point-idx quad) (-> this vertex point-idx trans quad)) ) ;; Draw the normal - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj center) (new 'static 'rgba :r #xff :g #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this center) (new 'static 'rgba :r #xff :g #xff :a #x80)) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj center) - (-> obj normal) + (-> this center) + (-> this normal) (meters 2) (new 'static 'rgba :r #xff :g #xff :a #x30) ) @@ -1522,15 +1527,15 @@ points 4 ;; 4 points ;; tone down the opacity of the boundary so you aren't blinded / can actually stand a chance at reading the text - (if (logtest? (-> obj flags) (editable-flag orient)) + (if (logtest? (-> this flags) (editable-flag orient)) (new 'static 'rgba :r #xff :a #x30) (new 'static 'rgba :r #xff :g #xff :a #x30) ) - (if (not (logtest? (-> obj flags) (editable-flag orient))) + (if (not (logtest? (-> this flags) (editable-flag orient))) (new 'static 'rgba :r #xff :a #x30) (new 'static 'rgba :r #xff :g #xff :a #x30) ) - (if (logtest? (-> obj flags) (editable-flag selected)) 1 0) + (if (logtest? (-> this flags) (editable-flag selected)) 1 0) ) ) ;; (local-vars (sv-112 int)) @@ -1538,19 +1543,19 @@ ;; (dotimes (v1-0 6) ;; (set! (-> gp-0 v1-0 quad) (the-as uint128 0)) ;; ) - ;; (set! sv-112 (editable-face-method-30 obj gp-0)) + ;; (set! sv-112 (editable-face-method-30 this gp-0)) ;; (when (>= sv-112 3) - ;; (let ((s1-0 (editable-face-method-31 obj (new 'stack-no-clear 'vector)))) + ;; (let ((s1-0 (editable-face-method-31 this (new 'stack-no-clear 'vector)))) ;; (add-debug-vector ;; #t ;; (bucket-id debug-no-zbuf1) - ;; (edit-get-trans obj) + ;; (edit-get-trans this) ;; s1-0 ;; (meters 2) ;; (new 'static 'rgba :r #xff :g #xff :a #x80) ;; ) ;; ) - ;; (when (logtest? (-> obj flags) (editable-flag selected)) + ;; (when (logtest? (-> this flags) (editable-flag selected)) ;; (dotimes (s4-1 sv-112) ;; (let ((s3-1 add-debug-text-3d) ;; (s2-1 #t) @@ -1562,7 +1567,7 @@ ;; (the-as bucket-id s1-1) ;; *temp-string* ;; (-> gp-0 s4-1) - ;; (if (logtest? (-> obj flags) (editable-flag orient)) + ;; (if (logtest? (-> this flags) (editable-flag orient)) ;; (font-color yellow) ;; (font-color white) ;; ) @@ -1575,15 +1580,15 @@ ;; (bucket-id debug2) ;; gp-0 ;; sv-112 - ;; (if (logtest? (-> obj flags) (editable-flag orient)) + ;; (if (logtest? (-> this flags) (editable-flag orient)) ;; (new 'static 'rgba :r #xff :a #x80) ;; (new 'static 'rgba :r #xff :g #xff :a #x80) ;; ) - ;; (if (not (logtest? (-> obj flags) (editable-flag orient))) + ;; (if (not (logtest? (-> this flags) (editable-flag orient))) ;; (new 'static 'rgba :r #xff :a #x80) ;; (new 'static 'rgba :r #xff :g #xff :a #x80) ;; ) - ;; (if (logtest? (-> obj flags) (editable-flag selected)) + ;; (if (logtest? (-> this flags) (editable-flag selected)) ;; 1 ;; 0 ;; ) @@ -1594,22 +1599,22 @@ (none) ) -(defmethod edit-get-trans editable-plane ((obj editable-plane)) +(defmethod edit-get-trans editable-plane ((this editable-plane)) "Returns the `trans` [[vector]] or [[*null-vector*]]" - (if (>= (-> obj length) 1) - (edit-get-trans (-> obj vertex 0)) + (if (>= (-> this length) 1) + (edit-get-trans (-> this vertex 0)) *null-vector* ) ) -(defmethod editable-method-22 editable-plane ((obj editable-plane) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-plane ((this editable-plane) (arg0 editable-array) (arg1 int) (arg2 int)) (format 0 "TODO - UPDATE THIS") ;; (let ((s4-0 (clear *temp-string*))) ;; (format ;; s4-0 ;; "insert into region_face set kind='plane',region_id=~D,radius=~f" - ;; (-> obj region id) - ;; (-> obj radius) + ;; (-> this region id) + ;; (-> this radius) ;; ) ;; (let ((a0-4 (sql-query s4-0))) ;; (if (!= (-> a0-4 error) 'modify) @@ -1617,35 +1622,35 @@ ;; ) ;; ) ;; ) - ;; (dotimes (s4-1 (-> obj length)) - ;; (editable-method-22 (-> obj vertex s4-1) arg0 2 s4-1) + ;; (dotimes (s4-1 (-> this length)) + ;; (editable-method-22 (-> this vertex s4-1) arg0 2 s4-1) ;; ) - ;; (logclear! (-> obj flags) (editable-flag changed)) + ;; (logclear! (-> this flags) (editable-flag changed)) #t ) -(defmethod editable-method-25 editable-plane ((obj editable-plane) (arg0 editable-array)) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj vertex s4-0))) - (set! (-> s3-0 owner) (delete! obj (-> s3-0 owner))) +(defmethod editable-method-25 editable-plane ((this editable-plane) (arg0 editable-array)) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this vertex s4-0))) + (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) ) ) - ((the-as (function editable-plane editable-array none) (find-parent-method editable-plane 25)) obj arg0) + ((the-as (function editable-plane editable-array none) (find-parent-method editable-plane 25)) this arg0) (none) ) -(defmethod editable-method-26 editable-plane ((obj editable-plane) (arg0 editable) (arg1 editable-array)) - (editable-array-method-15 arg1 obj) - ((method-of-type editable editable-method-26) obj arg0 arg1) +(defmethod editable-method-26 editable-plane ((this editable-plane) (arg0 editable) (arg1 editable-array)) + (editable-array-method-15 arg1 this) + ((method-of-type editable editable-method-26) this arg0 arg1) (none) ) ;; WARN: Return type mismatch editable-plane vs editable. -(defmethod editable-method-27 editable-plane ((obj editable-plane) (arg0 editable-array)) +(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)) obj arg0) + ((the-as (function editable-plane editable-array editable) (find-parent-method editable-plane 27)) this arg0) ) ) ) @@ -1657,26 +1662,34 @@ ) ) -(defmethod editable-method-24 editable-plane ((obj editable-plane)) +(defmethod editable-method-24 editable-plane ((this editable-plane)) (let ((s5-1 - (vector-! (new 'stack-no-clear 'vector) (edit-get-trans (-> obj vertex 1)) (edit-get-trans (-> obj vertex 0))) + (vector-! + (new 'stack-no-clear 'vector) + (edit-get-trans (-> this vertex 1)) + (edit-get-trans (-> this vertex 0)) + ) ) ) - (edit-coord! (-> obj vertex 1) (vector-! s5-1 (edit-get-trans (-> obj vertex 0)) s5-1) (editable-flag x y z)) + (edit-coord! + (-> this vertex 1) + (vector-! s5-1 (edit-get-trans (-> this vertex 0)) s5-1) + (editable-flag x y z) + ) ) - (set! (-> obj region changed) #t) - (logior! (-> obj flags) (editable-flag changed)) + (set! (-> this region changed) #t) + (logior! (-> this flags) (editable-flag changed)) 0 (none) ) -(defmethod editable-plane-method-30 editable-plane ((obj editable-plane) (arg0 (inline-array vector))) +(defmethod editable-plane-method-30 editable-plane ((this editable-plane) (arg0 (inline-array vector))) ;; og:preserve-this ;; This function converts 2 points (defining the normal) along with the radius into the 4 points that describe the plane ;; this means that they can only generate square planes, so this code is no longer used - ;; (case (-> obj length) + ;; (case (-> this length) ;; ((2) - ;; (let* ((v1-2 (editable-plane-method-31 obj (new 'stack-no-clear 'vector))) + ;; (let* ((v1-2 (editable-plane-method-31 this (new 'stack-no-clear 'vector))) ;; (s5-1 (vector-cross! ;; (new 'stack-no-clear 'vector) ;; v1-2 @@ -1687,9 +1700,9 @@ ;; ) ;; ) ;; (s4-1 (vector-cross! (new 'stack-no-clear 'vector) s5-1 v1-2)) - ;; (f30-0 (-> obj radius)) + ;; (f30-0 (-> this radius)) ;; ) - ;; (let ((v1-4 (edit-get-trans (-> obj vertex 0)))) + ;; (let ((v1-4 (edit-get-trans (-> this vertex 0)))) ;; (vector+float*! (-> arg0 0) v1-4 s5-1 f30-0) ;; (vector+float*! (-> arg0 0) (-> arg0 0) s4-1 (- f30-0)) ;; (vector+float*! (-> arg0 1) v1-4 s5-1 (- f30-0)) @@ -1709,11 +1722,11 @@ 0 ) -(defmethod editable-plane-method-31 editable-plane ((obj editable-plane) (arg0 vector)) - (case (-> obj length) +(defmethod editable-plane-method-31 editable-plane ((this editable-plane) (arg0 vector)) + (case (-> this length) ((2) - (let ((s3-0 (-> obj vertex 0)) - (a0-1 (-> obj vertex 1)) + (let ((s3-0 (-> this vertex 0)) + (a0-1 (-> this vertex 1)) ) (vector-! arg0 (edit-get-trans a0-1) (edit-get-trans s3-0)) ) @@ -1723,22 +1736,22 @@ arg0 ) -(defmethod edit-get-distance editable-plane ((obj editable-plane) (arg0 vector)) +(defmethod edit-get-distance editable-plane ((this editable-plane) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((gp-0 (new 'stack-no-clear 'vector)) - (s5-0 (editable-plane-method-31 obj (new 'stack-no-clear 'vector))) + (s5-0 (editable-plane-method-31 this (new 'stack-no-clear 'vector))) ) (let ((s1-0 (new 'stack-no-clear 'vector))) - (set! (-> s1-0 quad) (-> (edit-get-trans (-> obj vertex 0)) quad)) + (set! (-> s1-0 quad) (-> (edit-get-trans (-> this vertex 0)) quad)) (transform-point-vector! gp-0 s1-0) ) (when (< 0.0 (-> gp-0 z)) - (reverse-transform-point! gp-0 (edit-get-trans (-> obj vertex 0)) s5-0 arg0) + (reverse-transform-point! gp-0 (edit-get-trans (-> this vertex 0)) s5-0 arg0) (let ((points (new 'stack-no-clear 'inline-array 'vector 4))) (dotimes (v1-6 4) (set! (-> points v1-6 quad) (the-as uint128 0)) ) - (let ((s4-1 (editable-plane-method-30 obj points)) + (let ((s4-1 (editable-plane-method-30 this points)) (s2-2 0) (s1-2 (vector-negate! (new 'stack-no-clear 'vector) s5-0)) ) @@ -1758,19 +1771,19 @@ -1.0 ) -(defmethod editable-method-10 editable-plane ((obj editable-plane)) +(defmethod editable-method-10 editable-plane ((this editable-plane)) (let ((points (new 'stack-no-clear 'inline-array 'vector 4))) (dotimes (point-idx 4) - ;; (inspect obj) - (set! (-> points point-idx quad) (-> obj vertex point-idx trans quad)) + ;; (inspect this) + (set! (-> points point-idx quad) (-> this vertex point-idx trans quad)) ) ;; Draw the normal - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj position) (new 'static 'rgba :r #xff :g #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this position) (new 'static 'rgba :r #xff :g #xff :a #x80)) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj position) - (-> obj normal) + (-> this position) + (-> this normal) (meters 2) (new 'static 'rgba :r #xff :g #xff :a #x30) ) @@ -1782,67 +1795,67 @@ ;; tone down the opacity of the boundary so you aren't blinded / can actually stand a chance at reading the text (new 'static 'rgba :r #xff :g #xff :a #x30) (new 'static 'rgba :r #xff :a #x30) - (if (logtest? (-> obj flags) (editable-flag selected)) 1 0) + (if (logtest? (-> this flags) (editable-flag selected)) 1 0) ) ) 0 (none) ) -(defmethod editable-method-17 editable-plane ((obj editable-plane) (arg0 vector)) +(defmethod editable-method-17 editable-plane ((this editable-plane) (arg0 vector)) (format 0 "TODO - UPDATE THIS") - ;; (let ((v1-0 (-> obj region))) + ;; (let ((v1-0 (-> this region))) ;; (if v1-0 ;; (set! (-> v1-0 changed) #t) ;; ) ;; ) - ;; (logior! (-> obj flags) (editable-flag changed)) + ;; (logior! (-> this flags) (editable-flag changed)) ;; (if (= (-> arg0 y) 0.0) - ;; (+! (-> obj radius) (-> arg0 x)) - ;; (set! (-> obj radius) (-> arg0 y)) + ;; (+! (-> this radius) (-> arg0 x)) + ;; (set! (-> this radius) (-> arg0 y)) ;; ) - ;; (if (< (-> obj radius) 0.0) - ;; (set! (-> obj radius) 0.0) + ;; (if (< (-> this radius) 0.0) + ;; (set! (-> this radius) 0.0) ;; ) - ;; (editable-method-28 obj (editable-filter load)) + ;; (editable-method-28 this (editable-filter load)) ;; 0 (none) ) ;; WARN: Return type mismatch (array editable) vs editable-array. -(defmethod relocate editable-array ((obj editable-array) (arg0 int)) - (the-as editable-array (when (nonzero? (-> obj selection)) - (let ((v0-0 (&+ (-> obj selection) arg0))) - (set! (-> obj selection) v0-0) +(defmethod relocate editable-array ((this editable-array) (arg0 int)) + (the-as editable-array (when (nonzero? (-> this selection)) + (let ((v0-0 (&+ (-> this selection) arg0))) + (set! (-> this selection) v0-0) v0-0 ) ) ) ) -(defmethod length editable-array ((obj editable-array)) - (-> obj length) +(defmethod length editable-array ((this editable-array)) + (-> this length) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of editable-array ((obj editable-array)) - (the-as int (+ (-> obj type size) (* (-> obj allocated-length) 4))) +(defmethod asize-of editable-array ((this editable-array)) + (the-as int (+ (-> this type size) (* (-> this allocated-length) 4))) ) -(defmethod editable-array-method-11 editable-array ((obj editable-array)) - (dotimes (v1-0 (-> obj length)) - (if (not (-> obj data v1-0)) +(defmethod editable-array-method-11 editable-array ((this editable-array)) + (dotimes (v1-0 (-> this length)) + (if (not (-> this data v1-0)) (return v1-0) ) ) - (when (< (-> obj length) (-> obj allocated-length)) - (+! (-> obj length) 1) - (return (+ (-> obj length) -1)) + (when (< (-> this length) (-> this allocated-length)) + (+! (-> this length) 1) + (return (+ (-> this length) -1)) ) -1 ) -(defmethod editable-array-method-10 editable-array ((obj editable-array) (arg0 vector) (arg1 int)) +(defmethod editable-array-method-10 editable-array ((this editable-array) (arg0 vector) (arg1 int)) (when (or (!= (-> arg0 x) (-> *editable-work* last-x)) (!= (-> arg0 y) (-> *editable-work* last-y))) (set! (-> *editable-work* last-found) 0) (set! (-> *editable-work* last-x) (-> arg0 x)) @@ -1851,13 +1864,13 @@ 4095996000.0 (let ((s5-0 (the-as editable #f))) (set! (-> *editable-work* num-found) 0) - (let* ((s2-0 (-> obj length)) + (let* ((s2-0 (-> this length)) (s1-0 0) - (s0-0 (-> obj data s1-0)) + (s0-0 (-> this data s1-0)) ) (while (< s1-0 s2-0) - (when (and s0-0 (or (and (logtest? (-> s0-0 region filter) (-> obj filter 0)) - (logtest? (-> s0-0 region filter) (-> obj filter 1)) + (when (and s0-0 (or (and (logtest? (-> s0-0 region filter) (-> this filter 0)) + (logtest? (-> s0-0 region filter) (-> this filter 1)) ) (logtest? (-> s0-0 flags) (editable-flag selected)) ) @@ -1873,7 +1886,7 @@ ) ) (+! s1-0 1) - (set! s0-0 (-> obj data s1-0)) + (set! s0-0 (-> this data s1-0)) ) ) (countdown (v1-43 (-> *editable-work* num-found)) @@ -1913,12 +1926,12 @@ ) ) -(defmethod editable-array-method-14 editable-array ((obj editable-array) (arg0 (function editable editable-region symbol)) (arg1 editable-region)) - (let ((gp-0 (-> obj selection))) +(defmethod editable-array-method-14 editable-array ((this editable-array) (arg0 (function editable editable-region symbol)) (arg1 editable-region)) + (let ((gp-0 (-> this selection))) (set! (-> gp-0 length) 0) - (let* ((s2-0 (-> obj length)) + (let* ((s2-0 (-> this length)) (s1-0 0) - (s0-0 (-> obj data s1-0)) + (s0-0 (-> this data s1-0)) ) (while (< s1-0 s2-0) (when (and s0-0 (logtest? (-> s0-0 flags) (editable-flag selected))) @@ -1928,39 +1941,39 @@ ) ) (+! s1-0 1) - (set! s0-0 (-> obj data s1-0)) + (set! s0-0 (-> this data s1-0)) ) ) gp-0 ) ) -(defmethod editable-array-method-15 editable-array ((obj editable-array) (arg0 editable)) +(defmethod editable-array-method-15 editable-array ((this editable-array) (arg0 editable)) (let ((gp-0 (-> arg0 region))) (when gp-0 - (editable-method-25 arg0 obj) - (let* ((v1-3 (-> obj length)) + (editable-method-25 arg0 this) + (let* ((v1-3 (-> this length)) (a0-2 0) - (a1-4 (-> obj data a0-2)) + (a1-4 (-> this data a0-2)) ) (while (< a0-2 v1-3) (if (and a1-4 (= arg0 a1-4)) - (set! (-> obj data a0-2) #f) + (set! (-> this data a0-2) #f) ) (+! a0-2 1) - (set! a1-4 (-> obj data a0-2)) + (set! a1-4 (-> this data a0-2)) ) ) - (let* ((v1-6 (-> obj length)) + (let* ((v1-6 (-> this length)) (a0-3 0) - (a1-14 (-> obj data a0-3)) + (a1-14 (-> this data a0-3)) ) (while (< a0-3 v1-6) (if (and a1-14 (= (-> a1-14 region) gp-0) (!= a1-14 arg0)) (goto cfg-21) ) (+! a0-3 1) - (set! a1-14 (-> obj data a0-3)) + (set! a1-14 (-> this data a0-3)) ) ) (editable-region-method-10 gp-0 0) @@ -1973,7 +1986,7 @@ ;; WARN: Return type mismatch symbol vs none. ;; WARN: Function (method 12 editable-array) has a return type of none, but the expression builder found a return statement. -(defmethod editable-array-method-12 editable-array ((obj editable-array) (arg0 editable-array)) +(defmethod editable-array-method-12 editable-array ((this editable-array) (arg0 editable-array)) (local-vars (sv-16 sql-result) (sv-20 sql-result) @@ -2007,9 +2020,9 @@ (set! (-> *editable-sample-region* level) (the-as string arg0)) (set! (-> *editable-light-region* level) (the-as string arg0)) (set! (-> *editable-entity-region* level) (the-as string arg0)) - (vector-reset! (-> obj level-offset)) - (set! (-> obj level-info-id) (the-as uint -1)) - (set! (-> obj level) (the-as uint arg0)) + (vector-reset! (-> this level-offset)) + (set! (-> this level-info-id) (the-as uint -1)) + (set! (-> this level) (the-as uint arg0)) (let ((s4-0 sql-query)) (format (clear *temp-string*) @@ -2020,13 +2033,13 @@ ) (when (and (= (-> sv-16 error) 'select) (>= (-> sv-16 len) 3)) (set-vector! - (-> obj level-offset) + (-> this level-offset) (* 4096.0 (string->float (-> sv-16 data 0))) (* 4096.0 (string->float (-> sv-16 data 1))) (* 4096.0 (string->float (-> sv-16 data 2))) 1.0 ) - (set! (-> obj level-info-id) (the-as uint (string->int (-> sv-16 data 3)))) + (set! (-> this level-info-id) (the-as uint (string->int (-> sv-16 data 3)))) ) (let ((s4-2 sql-query)) (format @@ -2063,6 +2076,7 @@ (if (!= (-> sv-28 error) 'select) (return #f) ) + ;; og:preserve-this (format #t "sql: read point ~D~%" (/ (-> sv-28 len) 6)) (let ((s4-5 sql-query)) (format @@ -2099,32 +2113,32 @@ (-> sv-20 data (+ s5-1 5)) ) ) - (let* ((v1-75 (-> obj length)) + (let* ((v1-75 (-> this length)) (a0-54 0) - (a1-17 (-> obj data a0-54)) + (a1-17 (-> this data a0-54)) ) (while (< a0-54 v1-75) (if (and a1-17 (-> a1-17 region) (= (-> a1-17 region id) (-> sv-36 id))) - (set! (-> obj data a0-54) #f) + (set! (-> this data a0-54) #f) ) (+! a0-54 1) - (set! a1-17 (-> obj data a0-54)) + (set! a1-17 (-> this data a0-54)) ) ) (let ((s4-6 0)) (while (< s4-6 (-> sv-32 len)) (when (= (-> sv-36 id) (string->int (-> sv-32 data s4-6))) - (let ((s3-5 (editable-array-method-11 obj))) + (let ((s3-5 (editable-array-method-11 this))) (when (>= s3-5 0) (let ((s2-1 (new 'stack-no-clear 'vector))) (set! (-> s2-1 x) (string->float (-> sv-32 data (+ s4-6 1)))) (set! (-> s2-1 y) (string->float (-> sv-32 data (+ s4-6 2)))) (set! (-> s2-1 z) (string->float (-> sv-32 data (+ s4-6 3)))) (set! (-> s2-1 w) 1.0) - (vector+! s2-1 s2-1 (-> obj level-offset)) + (vector+! s2-1 s2-1 (-> this level-offset)) (let ((s2-2 (new 'debug 'editable-sphere s2-1 2048.0 sv-36))) (set! (-> s2-2 radius) (string->float (-> sv-32 data (+ s4-6 4)))) - (set! (-> obj data s3-5) s2-2) + (set! (-> this data s3-5) s2-2) ) ) ) @@ -2138,11 +2152,11 @@ (when (= (-> sv-36 id) (string->int (-> sv-24 data sv-64))) (cond ((string= (-> sv-24 data (+ sv-64 2)) "plane") - (set! sv-72 (editable-array-method-11 obj)) + (set! sv-72 (editable-array-method-11 this)) (set! sv-80 (new 'debug 'editable-plane sv-36)) (set! sv-84 (-> sv-24 data (+ sv-64 1))) (when (>= sv-72 0) - (set! (-> obj data sv-72) sv-80) + (set! (-> this data sv-72) sv-80) (set! (-> sv-80 normal x) (string->float (-> sv-24 data (+ sv-64 4)))) (set! (-> sv-80 normal y) (string->float (-> sv-24 data (+ sv-64 5)))) (set! (-> sv-80 normal z) (string->float (-> sv-24 data (+ sv-64 6)))) @@ -2160,12 +2174,12 @@ (set! (-> s3-6 w) (string->float (-> sv-28 data (+ (* 6 s4-7) 5)))) (set! sv-112 s3-6) ) - (vector+! sv-112 sv-112 (-> obj level-offset)) - (set! sv-120 (editable-array-method-11 obj)) + (vector+! sv-112 sv-112 (-> this level-offset)) + (set! sv-120 (editable-array-method-11 this)) (when (>= sv-120 0) (set! sv-128 (new 'debug 'editable-point sv-112 sv-36)) (set! sv-136 (string->int (-> sv-28 data (+ (* 6 s4-7) 1)))) - (set! (-> obj data sv-120) sv-128) + (set! (-> this data sv-120) sv-128) (set! (-> sv-80 vertex sv-136) sv-128) (set! (-> sv-80 length) (max (-> sv-80 length) (+ sv-136 1))) (set! (-> sv-128 owner) (cons sv-80 (-> sv-128 owner))) @@ -2177,11 +2191,11 @@ ) ) ((string= (-> sv-24 data (+ sv-64 2)) "face") - (set! sv-144 (editable-array-method-11 obj)) + (set! sv-144 (editable-array-method-11 this)) (set! sv-152 (new 'debug 'editable-face sv-36)) (set! sv-156 (-> sv-24 data (+ sv-64 1))) (when (>= sv-144 0) - (set! (-> obj data sv-144) sv-152) + (set! (-> this data sv-144) sv-152) (if (string= (-> sv-24 data (+ sv-64 3)) "orient") (logior! (-> sv-152 flags) (editable-flag orient)) ) @@ -2202,10 +2216,10 @@ (set! (-> s3-7 w) (string->float (-> sv-28 data (+ (* 6 s4-8) 5)))) (set! sv-176 s3-7) ) - (vector+! sv-176 sv-176 (-> obj level-offset)) - (let* ((s3-8 (-> obj length)) + (vector+! sv-176 sv-176 (-> this level-offset)) + (let* ((s3-8 (-> this length)) (s2-3 0) - (s1-0 (-> obj data s2-3)) + (s1-0 (-> this data s2-3)) ) (while (< s2-3 s3-8) (when (and s1-0 (= (-> s1-0 region) sv-36) (type? s1-0 editable-point)) @@ -2218,7 +2232,7 @@ ) ) (+! s2-3 1) - (set! s1-0 (-> obj data s2-3)) + (set! s1-0 (-> this data s2-3)) ) ) (if (< (-> sv-176 y) sv-40) @@ -2227,11 +2241,11 @@ (if (< sv-44 (-> sv-176 y)) (set! sv-44 (the-as float (-> sv-176 y))) ) - (set! sv-192 (editable-array-method-11 obj)) + (set! sv-192 (editable-array-method-11 this)) (when (>= sv-192 0) (set! sv-200 (new 'debug 'editable-point sv-176 sv-36)) (set! sv-208 (string->int (-> sv-28 data (+ (* 6 s4-8) 1)))) - (set! (-> obj data sv-192) sv-200) + (set! (-> this data sv-192) sv-200) (set! (-> sv-152 vertex sv-208) sv-200) (set! (-> sv-152 length) (max (-> sv-152 length) (+ sv-208 1))) (set! (-> sv-200 owner) (cons sv-152 (-> sv-200 owner))) @@ -2247,9 +2261,9 @@ ) (set! sv-64 (+ sv-64 12)) ) - (let* ((v1-293 (-> obj length)) + (let* ((v1-293 (-> this length)) (a0-158 0) - (a1-57 (-> obj data a0-158)) + (a1-57 (-> this data a0-158)) ) (while (< a0-158 v1-293) (when (and a1-57 (= (-> a1-57 region) sv-36) (= (-> a1-57 type) editable-point)) @@ -2263,7 +2277,7 @@ ) ) (+! a0-158 1) - (set! a1-57 (-> obj data a0-158)) + (set! a1-57 (-> this data a0-158)) ) ) (set! (-> sv-36 changed) #f) @@ -2274,7 +2288,7 @@ (format (clear *temp-string*) "select x,y,z from sample_point where level_info_id='~D' and source='manual'" - (-> obj level-info-id) + (-> this level-info-id) ) (set! sv-216 (s5-2 *temp-string*)) ) @@ -2283,15 +2297,15 @@ ) (let ((s5-3 0)) (while (< s5-3 (-> sv-216 len)) - (let ((s4-10 (editable-array-method-11 obj))) + (let ((s4-10 (editable-array-method-11 this))) (when (>= s4-10 0) (let ((s3-9 (new 'stack-no-clear 'vector))) (set! (-> s3-9 x) (* 4096.0 (string->float (-> sv-216 data s5-3)))) (set! (-> s3-9 y) (* 4096.0 (string->float (-> sv-216 data (+ s5-3 1))))) (set! (-> s3-9 z) (* 4096.0 (string->float (-> sv-216 data (+ s5-3 2))))) (set! (-> s3-9 w) 1.0) - (vector+! s3-9 s3-9 (-> obj level-offset)) - (set! (-> obj data s4-10) (new 'debug 'editable-sample s3-9 *editable-sample-region*)) + (vector+! s3-9 s3-9 (-> this level-offset)) + (set! (-> this data s4-10) (new 'debug 'editable-sample s3-9 *editable-sample-region*)) ) ) ) @@ -2303,7 +2317,7 @@ (format (clear *temp-string*) "select light_id,name,pos_x,pos_y,pos_z,r,dir_x,dir_y,dir_z,color0_r,color0_g,color0_b,color0_a,decay_start,ambient_point_ratio,brightness from light where level_name='~S'" - (-> obj level) + (-> this level) ) (set! sv-240 (s5-4 *temp-string*)) ) @@ -2313,16 +2327,16 @@ ) (let ((s5-5 0)) (while (< s5-5 (-> sv-240 len)) - (let ((s3-10 (editable-array-method-11 obj))) + (let ((s3-10 (editable-array-method-11 this))) (when (>= s3-10 0) (let ((s4-12 (new 'stack-no-clear 'vector))) (set! (-> s4-12 x) (* 4096.0 (string->float (-> sv-240 data (+ s5-5 2))))) (set! (-> s4-12 y) (* 4096.0 (string->float (-> sv-240 data (+ s5-5 3))))) (set! (-> s4-12 z) (* 4096.0 (string->float (-> sv-240 data (+ s5-5 4))))) (set! (-> s4-12 w) 1.0) - (vector+! s4-12 s4-12 (-> obj level-offset)) + (vector+! s4-12 s4-12 (-> this level-offset)) (let ((s4-13 (new 'debug 'editable-light s4-12 2048.0 *editable-light-region*))) - (set! (-> obj data s3-10) s4-13) + (set! (-> this data s3-10) s4-13) (set! (-> s4-13 id) (the-as uint (string->int (-> sv-240 data s5-5)))) (set! (-> s4-13 name) (-> sv-240 data (+ s5-5 1))) (set! (-> s4-13 radius) (* 4096.0 (string->float (-> sv-240 data (+ s5-5 5))))) @@ -2354,29 +2368,29 @@ ) ) (set! (-> *editable-light-region* changed) #f) - (editable-array-method-9 obj (editable-command refresh-filter) (the-as mouse-info #f)) + (editable-array-method-9 this (editable-command refresh-filter) (the-as mouse-info #f)) #t (none) ) -(defmethod editable-array-method-13 editable-array ((obj editable-array) (arg0 editable-command) (arg1 editable-command) (arg2 string)) - (set! (-> obj target) #f) - (set! (-> obj target-mode) arg0) - (set! (-> obj target-command) arg1) - (set! (-> obj target-message) arg2) +(defmethod editable-array-method-13 editable-array ((this editable-array) (arg0 editable-command) (arg1 editable-command) (arg2 string)) + (set! (-> this target) #f) + (set! (-> this target-mode) arg0) + (set! (-> this target-command) arg1) + (set! (-> this target-message) arg2) 0 (none) ) -(defmethod editable-array-method-16 editable-array ((obj editable-array)) +(defmethod editable-array-method-16 editable-array ((this editable-array)) (cond - ((-> obj edit-plane) - (editable-plane-method-31 (-> obj edit-plane) (-> obj edit-plane-normal)) - (set! (-> obj edit-plane-center quad) (-> (edit-get-trans (-> obj edit-plane vertex 0)) quad)) + ((-> this edit-plane) + (editable-plane-method-31 (-> this edit-plane) (-> this edit-plane-normal)) + (set! (-> this edit-plane-center quad) (-> (edit-get-trans (-> this edit-plane vertex 0)) quad)) ) (else - (vector-negate! (-> obj edit-plane-normal) (-> *math-camera* inv-camera-rot vector 2)) - (let ((v1-9 (vector-float*! (-> obj edit-plane-center) (-> *math-camera* inv-camera-rot vector 2) 24576.0))) + (vector-negate! (-> this edit-plane-normal) (-> *math-camera* inv-camera-rot vector 2)) + (let ((v1-9 (vector-float*! (-> this edit-plane-center) (-> *math-camera* inv-camera-rot vector 2) 24576.0))) (vector+! v1-9 v1-9 (-> *math-camera* trans)) ) ) @@ -2385,7 +2399,7 @@ (none) ) -(defmethod editable-array-method-17 editable-array ((obj editable-array) (arg0 vector) (arg1 vector)) +(defmethod editable-array-method-17 editable-array ((this editable-array) (arg0 vector) (arg1 vector)) (cond ((and (cpad-hold? 0 up) *target*) (set! (-> arg0 quad) (-> (get-trans *target* 0) quad)) @@ -2394,8 +2408,8 @@ (set! (-> arg0 quad) (-> (math-camera-pos) quad)) ) (else - (editable-array-method-16 obj) - (reverse-transform-point! arg0 (-> obj edit-plane-center) (-> obj edit-plane-normal) arg1) + (editable-array-method-16 this) + (reverse-transform-point! arg0 (-> this edit-plane-center) (-> this edit-plane-normal) arg1) ) ) arg0 diff --git a/goal_src/jak2/engine/debug/history.gc b/goal_src/jak2/engine/debug/history.gc index f2db1e377b..a425ed58cc 100644 --- a/goal_src/jak2/engine/debug/history.gc +++ b/goal_src/jak2/engine/debug/history.gc @@ -145,13 +145,13 @@ ) -(defmethod length history ((obj history)) - (-> obj allocated-length) +(defmethod length history ((this history)) + (-> this allocated-length) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of history ((obj history)) - (the-as int (+ (-> obj type size) (* 48 (-> obj allocated-length)))) +(defmethod asize-of history ((this history)) + (the-as int (+ (-> this type size) (* 48 (-> this allocated-length)))) ) (defmethod new history ((allocation symbol) (type-to-make type) (arg0 int)) @@ -161,14 +161,14 @@ ) ) -(defmethod clear-history-entries! history ((obj history)) +(defmethod clear-history-entries! history ((this history)) "Iterates through each [[history-elt]] in the `elt` dynamic array For each entry: - clear `timestamp` - clear `record-tag`" - (set! (-> obj alloc-index) 0) - (countdown (v1-0 (-> obj allocated-length)) - (let ((a1-3 (-> obj elts v1-0))) + (set! (-> this alloc-index) 0) + (countdown (v1-0 (-> this allocated-length)) + (let ((a1-3 (-> this elts v1-0))) (set! (-> a1-3 record-tag) (the-as uint 0)) (set! (-> a1-3 timestamp) 0) ) @@ -183,14 +183,14 @@ For each entry: (clear-history-entries! *history*) ;; WARN: new jak 2 until loop case, check carefully -(defmethod clear-record-tags! history ((obj history) (arg0 history-channel) (arg1 uint) (arg2 uint)) +(defmethod clear-record-tags! history ((this history) (arg0 history-channel) (arg1 uint) (arg2 uint)) "First grab the latest [[history-elt]] at `alloc-index` 1. update it's `channel`, `record-id` and `owner` from the provided args 2. - if it's `record-tag` is zero -- return it - otherwise, iterate through all `elts` until one is found that does not match it's `timestamp` - if not `0` out the `record-tag` for that elt and continue iteration" - (let* ((t1-0 (-> obj alloc-index)) - (v1-0 (-> obj elts)) + (let* ((t1-0 (-> this alloc-index)) + (v1-0 (-> this elts)) (v0-0 (-> v1-0 t1-0)) ) (let ((t2-0 (-> v0-0 record-tag)) @@ -200,10 +200,10 @@ For each entry: (set! (-> v0-0 record-id) arg1) (set! (-> v0-0 owner) arg2) (set! (-> v0-0 timestamp) (-> *display* base-clock frame-counter)) - (let* ((a1-4 (-> obj allocated-length)) + (let* ((a1-4 (-> this allocated-length)) (a2-2 (mod (+ t1-0 1) a1-4)) ) - (set! (-> obj alloc-index) a2-2) + (set! (-> this alloc-index) a2-2) (when (nonzero? t2-0) (until #f (let ((a0-4 (-> v1-0 a2-2))) @@ -235,7 +235,7 @@ For each entry: ) ) -(defmethod update-entries! history-iterator ((obj history-iterator)) +(defmethod update-entries! history-iterator ((this history-iterator)) "Iterate through each [[history-elt]] in [[*history*]] - If we hit the end set `done?` to true - If the `timestamp` on the elt, minus the current framecounter exceeds `max-age`, we are also done, return #f @@ -243,22 +243,22 @@ For each entry: (let ((v1-0 *history*) (a1-2 (-> *display* base-clock frame-counter)) ) - (while (not (-> obj done?)) - (let ((a2-1 (+ (-> obj index) -1))) + (while (not (-> this done?)) + (let ((a2-1 (+ (-> this index) -1))) (if (< a2-1 0) (set! a2-1 (+ (-> v1-0 allocated-length) -1)) ) - (set! (-> obj index) a2-1) + (set! (-> this index) a2-1) (if (= a2-1 (-> v1-0 alloc-index)) - (set! (-> obj done?) #t) + (set! (-> this done?) #t) ) (let ((a2-5 (-> v1-0 elts a2-1))) (when (nonzero? (-> a2-5 record-tag)) - (when (< (the-as time-frame (-> obj max-age)) (- a1-2 (-> a2-5 timestamp))) - (set! (-> obj done?) #t) + (when (< (the-as time-frame (-> this max-age)) (- a1-2 (-> a2-5 timestamp))) + (set! (-> this done?) #t) (return (the-as history-elt #f)) ) - (if (= (-> a2-5 owner) (-> obj owner)) + (if (= (-> a2-5 owner) (-> this owner)) (return a2-5) ) ) @@ -269,16 +269,16 @@ For each entry: (the-as history-elt #f) ) -(defmethod get-age history-iterator ((obj history-iterator) (arg0 history-elt)) +(defmethod get-age history-iterator ((this history-iterator) (arg0 history-elt)) "Get the age of a history element" (- 1.0 (fmin 1.0 (/ (the float (+ (- 1 (-> arg0 timestamp)) (-> *display* base-clock frame-counter))) - (the float (+ (-> obj max-age) 1)) + (the float (+ (-> this max-age) 1)) ) ) ) ) -(defmethod frame-counter-delta history-iterator ((obj history-iterator) (arg0 history-elt)) +(defmethod frame-counter-delta history-iterator ((this history-iterator) (arg0 history-elt)) "Returns the difference between [[*display*]]'s `base-clock.frame-counter` and the elt's `timestamp`" (- (-> *display* base-clock frame-counter) (-> arg0 timestamp)) ) @@ -558,5 +558,3 @@ For each entry: 0 (none) ) - -0 diff --git a/goal_src/jak2/engine/debug/memory-usage-h.gc b/goal_src/jak2/engine/debug/memory-usage-h.gc index 9ee39079b2..2bac1cfde5 100644 --- a/goal_src/jak2/engine/debug/memory-usage-h.gc +++ b/goal_src/jak2/engine/debug/memory-usage-h.gc @@ -137,6 +137,3 @@ (define *dma-mem-usage* (new 'debug 'memory-usage-block)) (define *temp-mem-usage* (the-as memory-usage-block #f)) - - - diff --git a/goal_src/jak2/engine/debug/memory-usage.gc b/goal_src/jak2/engine/debug/memory-usage.gc index dd315c514d..ee1007644e 100644 --- a/goal_src/jak2/engine/debug/memory-usage.gc +++ b/goal_src/jak2/engine/debug/memory-usage.gc @@ -39,31 +39,29 @@ obj ) -;; definition for method 8 of type object -(defmethod mem-usage object ((obj object) (arg0 memory-usage-block) (arg1 int)) - obj +(defmethod mem-usage object ((this object) (arg0 memory-usage-block) (arg1 int)) + this ) -;; definition for method 10 of type memory-usage-block -(defmethod calculate-total memory-usage-block ((obj memory-usage-block)) +(defmethod calculate-total memory-usage-block ((this memory-usage-block)) "@returns The total sum of all [[memory-usage-info]] `total`s" (let ((sum 0)) - (dotimes (idx (-> obj length)) - (+! sum (-> obj data idx total)) + (dotimes (idx (-> this length)) + (+! sum (-> this data idx total)) ) sum ) ) -(defmethod reset! memory-usage-block ((obj memory-usage-block)) +(defmethod reset! memory-usage-block ((this memory-usage-block)) "Sets `length` to 0 as well as resets all fields except `name` in the associated [[memory-usage-info]]" - (set! (-> obj length) 0) + (set! (-> this length) 0) (dotimes (idx 112) - (set! (-> obj data idx used) 0) - (set! (-> obj data idx total) 0) - (set! (-> obj data idx count) 0) + (set! (-> this data idx used) 0) + (set! (-> this data idx total) 0) + (set! (-> this data idx count) 0) ) - obj + this ) (defun mem-size ((data basic) (inspect-usage? symbol) (arg2 int)) @@ -80,26 +78,26 @@ ) ) -(defmethod compute-memory-usage! level ((obj level) (force? symbol)) +(defmethod compute-memory-usage! level ((this level) (force? symbol)) "Calculates the memory usage of the level, returns and stores the [[memory-usage-block]] in `mem-usage-block` as well as the total size in `mem-usage` @param force? - Will re-compute the usage if set to [[#t]], even if `mem-usage` has been set to a non-zero value @returns The [[memory-usage-block]] representing the footprint of the level @see [[memory-usage-block::10]]" - (if (zero? (-> obj mem-usage-block)) - (set! (-> obj mem-usage-block) (new 'debug 'memory-usage-block)) + (if (zero? (-> this mem-usage-block)) + (set! (-> this mem-usage-block) (new 'debug 'memory-usage-block)) ) - (set! force? (or (zero? (-> obj mem-usage-block length)) force?)) + (set! force? (or (zero? (-> this mem-usage-block length)) force?)) (when force? - (mem-usage obj (reset! (-> obj mem-usage-block)) 0) - (set! (-> obj mem-usage) (calculate-total (-> obj mem-usage-block))) + (mem-usage this (reset! (-> this mem-usage-block)) 0) + (set! (-> this mem-usage) (calculate-total (-> this mem-usage-block))) 0 ) - (-> obj mem-usage-block) + (-> this mem-usage-block) ) -(defmethod mem-usage process-tree ((obj process-tree) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage process-tree ((this process-tree) (arg0 memory-usage-block) (arg1 int)) (let ((v1-0 90)) (let* ((a0-1 *dead-pool-list*) (a3-0 (car a0-1)) @@ -144,7 +142,7 @@ in `mem-usage-block` as well as the total size in `mem-usage` ) ) (iterate-process-tree - obj + this (lambda ((arg0 process-drawable)) (let ((gp-0 *temp-mem-usage*)) (let ((s4-0 (cond @@ -307,15 +305,15 @@ in `mem-usage-block` as well as the total size in `mem-usage` ) *null-kernel-context* ) - obj + this ) (define *max-dma* 0) -(defmethod print-mem-usage memory-usage-block ((obj memory-usage-block) (level level) (fmt-dest object)) +(defmethod print-mem-usage memory-usage-block ((this memory-usage-block) (level level) (fmt-dest object)) (local-vars (sv-16 object) (sv-32 string) (sv-48 int)) (let ((s3-0 (&- (-> level heap current) (the-as uint (-> level heap base))))) - (let ((v1-2 (+ (-> obj data 61 total) (-> obj data 62 total)))) + (let ((v1-2 (+ (-> this data 61 total) (-> this data 62 total)))) (< #x10000 v1-2) ) (let* ((v1-5 @@ -393,30 +391,30 @@ in `mem-usage-block` as well as the total size in `mem-usage` (let ((t9-11 format) (a0-31 fmt-dest) (a1-11 " bsp ~192H~5DK ~280Hdebug~456H~5DK~%") - (a2-6 (sar (+ (-> obj data 58 total) (-> obj data 59 total) (-> obj data 60 total)) 10)) + (a2-6 (sar (+ (-> this data 58 total) (-> this data 59 total) (-> this data 60 total)) 10)) (a3-3 (sar (-> *dma-mem-usage* data 87 total) 10)) ) (t9-11 a0-31 a1-11 a2-6 a3-3 (the-as none t0-0) (the-as none t1-0) (the-as none t2-0)) (format fmt-dest " bsp-leaf-vis ~192H~5DK~%" - (sar (+ (-> obj data 61 total) (-> obj data 62 total)) 10) + (sar (+ (-> this data 61 total) (-> this data 62 total)) 10) (the-as none a3-3) ) - (format fmt-dest " level-code ~192H~5DK~%" (sar (-> obj data 65 total) 10) (the-as none a3-3)) + (format fmt-dest " level-code ~192H~5DK~%" (sar (-> this data 65 total) 10) (the-as none a3-3)) ) (format fmt-dest " tfrag ~192H~5DK ~280Htfragment~456H~5DK~%" (sar - (+ (-> obj data 1 total) - (-> obj data 2 total) - (-> obj data 3 total) - (-> obj data 4 total) - (-> obj data 5 total) - (-> obj data 6 total) - (-> obj data 7 total) - (-> obj data 8 total) + (+ (-> this data 1 total) + (-> this data 2 total) + (-> this data 3 total) + (-> this data 4 total) + (-> this data 5 total) + (-> this data 6 total) + (-> this data 7 total) + (-> this data 8 total) ) 10 ) @@ -426,14 +424,14 @@ in `mem-usage-block` as well as the total size in `mem-usage` fmt-dest " tie-proto ~192H~5DK ~280Hsky~456H~5DK~%" (sar - (+ (-> obj data 9 total) - (-> obj data 10 total) - (-> obj data 11 total) - (-> obj data 12 total) - (-> obj data 13 total) - (-> obj data 14 total) - (-> obj data 16 total) - (-> obj data 17 total) + (+ (-> this data 9 total) + (-> this data 10 total) + (-> this data 11 total) + (-> this data 12 total) + (-> this data 13 total) + (-> this data 14 total) + (-> this data 16 total) + (-> this data 17 total) ) 10 ) @@ -442,22 +440,22 @@ in `mem-usage-block` as well as the total size in `mem-usage` (format fmt-dest " tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%" - (sar (+ (-> obj data 18 total) (-> obj data 20 total) (-> obj data 21 total) (-> obj data 22 total)) 10) + (sar (+ (-> this data 18 total) (-> this data 20 total) (-> this data 21 total) (-> this data 22 total)) 10) (sar (-> *dma-mem-usage* data 9 total) 10) ) (format fmt-dest " shrub-proto ~192H~5DK ~280Htie-scissor~456H~5DK~%" (sar - (+ (-> obj data 25 total) - (-> obj data 26 total) - (-> obj data 27 total) - (-> obj data 28 total) - (-> obj data 29 total) - (-> obj data 30 total) - (-> obj data 31 total) - (-> obj data 32 total) - (-> obj data 33 total) + (+ (-> this data 25 total) + (-> this data 26 total) + (-> this data 27 total) + (-> this data 28 total) + (-> this data 29 total) + (-> this data 30 total) + (-> this data 31 total) + (-> this data 32 total) + (-> this data 33 total) ) 10 ) @@ -466,21 +464,21 @@ in `mem-usage-block` as well as the total size in `mem-usage` (format fmt-dest " shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%" - (sar (-> obj data 34 total) 10) + (sar (-> this data 34 total) 10) (sar (-> *dma-mem-usage* data 27 total) 10) ) (format fmt-dest " collision ~192H~5DK ~280Htie-generic~456H~5DK~%" (sar - (+ (-> obj data 50 total) - (-> obj data 51 total) - (-> obj data 52 total) - (-> obj data 53 total) - (-> obj data 54 total) - (-> obj data 55 total) - (-> obj data 56 total) - (-> obj data 57 total) + (+ (-> this data 50 total) + (-> this data 51 total) + (-> this data 52 total) + (-> this data 53 total) + (-> this data 54 total) + (-> this data 55 total) + (-> this data 56 total) + (-> this data 57 total) ) 10 ) @@ -490,22 +488,22 @@ in `mem-usage-block` as well as the total size in `mem-usage` fmt-dest " pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%" (sar - (+ (-> obj data 35 total) - (-> obj data 36 total) - (-> obj data 37 total) - (-> obj data 38 total) - (-> obj data 39 total) - (-> obj data 40 total) - (-> obj data 41 total) - (-> obj data 42 total) - (-> obj data 73 total) - (-> obj data 74 total) - (-> obj data 75 total) - (-> obj data 76 total) - (-> obj data 78 total) - (-> obj data 81 total) - (-> obj data 80 total) - (-> obj data 111 total) + (+ (-> this data 35 total) + (-> this data 36 total) + (-> this data 37 total) + (-> this data 38 total) + (-> this data 39 total) + (-> this data 40 total) + (-> this data 41 total) + (-> this data 42 total) + (-> this data 73 total) + (-> this data 74 total) + (-> this data 75 total) + (-> this data 76 total) + (-> this data 78 total) + (-> this data 81 total) + (-> this data 80 total) + (-> this data 111 total) ) 10 ) @@ -515,14 +513,14 @@ in `mem-usage-block` as well as the total size in `mem-usage` fmt-dest " pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%" (sar - (+ (-> obj data 67 total) - (-> obj data 68 total) - (-> obj data 69 total) - (-> obj data 70 total) - (-> obj data 71 total) - (-> obj data 77 total) - (-> obj data 79 total) - (-> obj data 72 total) + (+ (-> this data 67 total) + (-> this data 68 total) + (-> this data 69 total) + (-> this data 70 total) + (-> this data 71 total) + (-> this data 77 total) + (-> this data 79 total) + (-> this data 72 total) ) 10 ) @@ -531,18 +529,18 @@ in `mem-usage-block` as well as the total size in `mem-usage` (format fmt-dest " textures ~192H~5DK ~280Htextures~456H~5DK~%" - (sar (-> obj data 82 total) 10) + (sar (-> this data 82 total) 10) (sar (-> *dma-mem-usage* data 82 total) 10) ) (format fmt-dest " entity ~192H~5DK~%" (sar - (+ (-> obj data 66 total) - (-> obj data 43 total) - (-> obj data 44 total) - (-> obj data 45 total) - (-> obj data 49 total) - (-> obj data 48 total) - (-> obj data 46 total) - (-> obj data 47 total) + (+ (-> this data 66 total) + (-> this data 43 total) + (-> this data 44 total) + (-> this data 45 total) + (-> this data 49 total) + (-> this data 48 total) + (-> this data 46 total) + (-> this data 47 total) ) 10 ) @@ -551,11 +549,11 @@ in `mem-usage-block` as well as the total size in `mem-usage` fmt-dest " misc ~192H~5DK ~280Hsprite~456H~5DK~%" (sar - (+ (-> obj data 0 total) - (-> obj data 63 total) - (-> obj data 64 total) - (-> obj data 83 total) - (-> obj data 84 total) + (+ (-> this data 0 total) + (-> this data 63 total) + (-> this data 64 total) + (-> this data 83 total) + (-> this data 84 total) ) 10 ) @@ -568,7 +566,5 @@ in `mem-usage-block` as well as the total size in `mem-usage` ) ) (format fmt-dest "~1K~0L") - obj + this ) - -0 diff --git a/goal_src/jak2/engine/debug/menu.gc b/goal_src/jak2/engine/debug/menu.gc index 838818c8f7..587a958c1e 100644 --- a/goal_src/jak2/engine/debug/menu.gc +++ b/goal_src/jak2/engine/debug/menu.gc @@ -58,9 +58,9 @@ ) -(defmethod print debug-menu-node ((obj debug-menu-node)) - (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print debug-menu-node ((this debug-menu-node)) + (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) + this ) (deftype debug-menu (debug-menu-node) @@ -171,6 +171,7 @@ (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (set! (-> v0-0 name) arg0) (set! (-> v0-0 parent) #f) + ;; og:preserve-this (set! (-> v0-0 refresh-delay) (#if PC_PORT 1 23)) (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) (set! (-> v0-0 id) (the-as int arg1)) @@ -326,6 +327,7 @@ (let ((v1-2 (/ arg2 8))) (set! (-> gp-0 name) arg0) (set! (-> gp-0 parent) #f) + ;; og:preserve-this (set! (-> gp-0 refresh-delay) (#if PC_PORT 1 31)) (set! (-> gp-0 refresh-ctr) (-> gp-0 refresh-delay)) (set! (-> gp-0 id) arg1) @@ -471,7 +473,8 @@ (debug-menu-context-send-msg gp-0 (debug-menu-msg deactivate) (debug-menu-dest activation)) ) (set! (-> arg1 parent) arg0) - (set! (-> arg0 items) (the-as pair (append! (-> arg0 items) (dcons arg1 '())))) ;; changed to dcons + ;; og:preserve-this changed to dcons + (set! (-> arg0 items) (the-as pair (append! (-> arg0 items) (dcons arg1 '())))) (debug-menu-rebuild arg0) (if s4-0 (debug-menu-context-send-msg gp-0 (debug-menu-msg activate) (debug-menu-dest activation)) @@ -729,7 +732,6 @@ ) ) -;; ERROR: Failed store: (s.w! (+ v1-9 8) 0) at op 42 (defun debug-menu-item-submenu-render ((arg0 debug-menu-item-submenu) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) (let ((s5-0 (-> arg0 parent context font))) (let ((v1-2 s5-0) @@ -760,7 +762,6 @@ arg0 ) -;; ERROR: Failed store: (s.w! (+ v1-3 8) 0) at op 49 (defun debug-menu-item-function-render ((arg0 debug-menu-item-function) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) (let ((v1-2 (-> arg0 parent context font))) (let ((a0-1 v1-2) @@ -796,7 +797,6 @@ arg0 ) -;; ERROR: Failed store: (s.w! (+ v1-3 8) 0) at op 47 (defun debug-menu-item-flag-render ((arg0 debug-menu-item-flag) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) (let ((v1-2 (-> arg0 parent context font))) (let ((a0-1 v1-2) @@ -832,7 +832,6 @@ arg0 ) -;; ERROR: Failed store: (s.w! (+ v1-16 8) 0) at op 95 (defun debug-menu-item-var-render ((arg0 debug-menu-item-var) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) (let ((s5-0 (-> arg0 parent context font))) (let ((v1-2 s5-0) @@ -915,7 +914,6 @@ arg0 ) -;; ERROR: Failed store: (s.w! (+ v1-9 8) 0) at op 47 (defun debug-menu-render ((arg0 debug-menu) (arg1 int) (arg2 int) (arg3 debug-menu-node) (arg4 int)) (local-vars (sv-16 dma-buffer) (sv-32 pointer)) (let ((v1-0 0)) @@ -1460,11 +1458,13 @@ (debug-menu-context-select-new-item arg0 1) ) ((cpad-pressed? (-> arg0 joypad-number) left) + ;; og:preserve-this (debug-menu-context-select-new-item arg0 (#if PC_PORT (if (cpad-hold? (-> arg0 joypad-number) l3) -20 -5) -5)) ) ((cpad-pressed? (-> arg0 joypad-number) right) + ;; og:preserve-this (debug-menu-context-select-new-item arg0 (#if PC_PORT (if (cpad-hold? (-> arg0 joypad-number) l3) 20 5) 5)) diff --git a/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc b/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc index 6e0350edc0..2533762985 100644 --- a/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc +++ b/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc @@ -260,23 +260,23 @@ ) ) -(defmethod alloc-new-node! mysql-nav-graph ((obj mysql-nav-graph)) +(defmethod alloc-new-node! mysql-nav-graph ((this mysql-nav-graph)) "Allocates a new `[[mysql-nav-node]]`, if `node-array`'s `length` exceeds `3000` return `-1` otherwise, return the new size of the array" (cond - ((>= (-> obj node-array length) 3000) + ((>= (-> this node-array length) 3000) (format #t "mysql-nav-graph : nodes buffer too small, increase NAV_GRAPH_EDITOR_NODE_COUNT~%") -1 ) (else - (let ((gp-0 (-> obj node-array data (-> obj node-array length))) - (s5-0 (-> obj node-array length)) + (let ((gp-0 (-> this node-array data (-> this node-array length))) + (s5-0 (-> this node-array length)) ) - (+! (-> obj node-array length) 1) + (+! (-> this node-array length) 1) (set! (-> gp-0 mysql-save-flag) (mysql-save-flag)) (logior! (-> gp-0 mysql-save-flag) (mysql-save-flag insert)) (set! (-> gp-0 runtime-id) (the-as uint s5-0)) - (set! (-> gp-0 nav_graph_id) (-> obj nav_graph_id)) + (set! (-> gp-0 nav_graph_id) (-> this nav_graph_id)) (set! (-> gp-0 level_name) (-> (level-get-target-inside *level*) name)) s5-0 ) @@ -284,23 +284,23 @@ otherwise, return the new size of the array" ) ) -(defmethod alloc-new-edge! mysql-nav-graph ((obj mysql-nav-graph)) +(defmethod alloc-new-edge! mysql-nav-graph ((this mysql-nav-graph)) "Allocates a new `[[mysql-nav-edge]]`, if `edge-array`'s `length` exceeds `5000` return `-1` otherwise, return the new size of the array" (cond - ((>= (-> obj edge-array length) 5000) + ((>= (-> this edge-array length) 5000) (format #t "mysql-nav-graph : edges buffer too small, increase NAV_GRAPH_EDITOR_EDGE_COUNT~%") -1 ) (else - (let ((v1-5 (-> obj edge-array data (-> obj edge-array length))) - (v0-1 (-> obj edge-array length)) + (let ((v1-5 (-> this edge-array data (-> this edge-array length))) + (v0-1 (-> this edge-array length)) ) - (+! (-> obj edge-array length) 1) + (+! (-> this edge-array length) 1) (set! (-> v1-5 mysql-save-flag) (mysql-save-flag)) (logior! (-> v1-5 mysql-save-flag) (mysql-save-flag insert)) (set! (-> v1-5 runtime-id) (the-as uint v0-1)) - (set! (-> v1-5 nav_graph_id) (-> obj nav_graph_id)) + (set! (-> v1-5 nav_graph_id) (-> this nav_graph_id)) (set! (-> v1-5 directionality) (nav-directionality default)) v0-1 ) @@ -308,11 +308,11 @@ otherwise, return the new size of the array" ) ) -(defmethod indexof-visnode mysql-nav-graph ((obj mysql-nav-graph) (edge-id int) (node-id int)) +(defmethod indexof-visnode mysql-nav-graph ((this mysql-nav-graph) (edge-id int) (node-id int)) "Returns the index in the `visnode-array` whom's [[mysql-nav-visnode]] has the provided `runtime-edge-id` and `runtime-node-id` if none exist, return `-1`" - (dotimes (v1-0 (-> obj visnode-array length)) - (let ((a3-2 (-> obj visnode-array data v1-0))) + (dotimes (v1-0 (-> this visnode-array length)) + (let ((a3-2 (-> this visnode-array data v1-0))) (if (and (= (-> a3-2 runtime-edge-id) edge-id) (= (-> a3-2 runtime-node-id) node-id)) (return v1-0) ) @@ -321,55 +321,55 @@ if none exist, return `-1`" -1 ) -(defmethod alloc-new-visnode! mysql-nav-graph ((obj mysql-nav-graph) (edge-id int) (node-id int)) +(defmethod alloc-new-visnode! mysql-nav-graph ((this mysql-nav-graph) (edge-id int) (node-id int)) "Potentially allocates a new `[[mysql-nav-visnode]]`: - if `visnode-array`'s `length` exceeds `3000` return `-1` - otherwise, if the node already exists, TODO - if the node does not already exist, create it!" (cond - ((>= (-> obj visnode-array length) 3000) + ((>= (-> this visnode-array length) 3000) (format #t "mysql-nav-graph : visnodes buffer too small, increase NAV_GRAPH_EDITOR_VISNODE_COUNT~%") -1 ) (else - (let ((v1-3 (indexof-visnode obj edge-id node-id))) + (let ((v1-3 (indexof-visnode this edge-id node-id))) (when (>= v1-3 0) (logand! - (-> (the-as mysql-nav-visnode (+ (the-as uint (-> obj visnode-array)) (* v1-3 32))) nav_visnode_id) + (-> (the-as mysql-nav-visnode (+ (the-as uint (-> this visnode-array)) (* v1-3 32))) nav_visnode_id) -3 ) (return v1-3) ) ) - (let ((v1-9 (-> obj visnode-array data (-> obj visnode-array length))) - (v0-1 (-> obj visnode-array length)) + (let ((v1-9 (-> this visnode-array data (-> this visnode-array length))) + (v0-1 (-> this visnode-array length)) ) - (+! (-> obj visnode-array length) 1) + (+! (-> this visnode-array length) 1) (set! (-> v1-9 mysql-save-flag) (mysql-save-flag)) (logior! (-> v1-9 mysql-save-flag) (mysql-save-flag insert)) (set! (-> v1-9 runtime-edge-id) edge-id) (set! (-> v1-9 runtime-node-id) node-id) - (set! (-> v1-9 nav_graph_id) (-> obj nav_graph_id)) + (set! (-> v1-9 nav_graph_id) (-> this nav_graph_id)) v0-1 ) ) ) ) -(defmethod exec-sql! mysql-nav-node ((obj mysql-nav-node)) +(defmethod exec-sql! mysql-nav-node ((this mysql-nav-node)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag delete)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) ) (return #t) ) - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag update)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag update)) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) ) (let ((s5-0 (clear *temp-string*))) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) (((mysql-save-flag insert)) (format s5-0 "insert nav_node set ") ) @@ -380,46 +380,46 @@ if none exist, return `-1`" (format s5-0 "delete from nav_node where ") ) ) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) ((8 4) - (format s5-0 "nav_graph_id=~D," (-> obj nav_graph_id)) - (format s5-0 "x=~M," (-> obj position x)) - (format s5-0 "y=~M," (-> obj position y)) - (format s5-0 "z=~M," (-> obj position z)) - (format s5-0 "level_name='~S'," (-> obj level_name)) - (format s5-0 "angle=~R," (-> obj angle)) - (format s5-0 "radius=~M," (-> obj radius)) + (format s5-0 "nav_graph_id=~D," (-> this nav_graph_id)) + (format s5-0 "x=~M," (-> this position x)) + (format s5-0 "y=~M," (-> this position y)) + (format s5-0 "z=~M," (-> this position z)) + (format s5-0 "level_name='~S'," (-> this level_name)) + (format s5-0 "angle=~R," (-> this angle)) + (format s5-0 "radius=~M," (-> this radius)) (format s5-0 "nav_node_flag='") (let ((v1-20 #t)) - (when (logtest? (-> obj nav_node_flag) (nav-node-flag visited)) + (when (logtest? (-> this nav_node_flag) (nav-node-flag visited)) (if (not v1-20) (format s5-0 ",") ) (format s5-0 "visited") (set! v1-20 #f) ) - (when (logtest? (-> obj nav_node_flag) (nav-node-flag blocked)) + (when (logtest? (-> this nav_node_flag) (nav-node-flag blocked)) (if (not v1-20) (format s5-0 ",") ) (format s5-0 "blocked") (set! v1-20 #f) ) - (when (logtest? (-> obj nav_node_flag) (nav-node-flag pedestrian)) + (when (logtest? (-> this nav_node_flag) (nav-node-flag pedestrian)) (if (not v1-20) (format s5-0 ",") ) (format s5-0 "pedestrian") (set! v1-20 #f) ) - (when (logtest? (-> obj nav_node_flag) (nav-node-flag selected)) + (when (logtest? (-> this nav_node_flag) (nav-node-flag selected)) (if (not v1-20) (format s5-0 ",") ) (format s5-0 "selected") (set! v1-20 #f) ) - (when (logtest? (-> obj nav_node_flag) (nav-node-flag hidden)) + (when (logtest? (-> this nav_node_flag) (nav-node-flag hidden)) (if (not v1-20) (format s5-0 ",") ) @@ -427,54 +427,54 @@ if none exist, return `-1`" ) ) (format s5-0 "',") - (format s5-0 "nav_mesh_id=~D" (-> obj nav_mesh_id)) - (if (logtest? (-> obj mysql-save-flag) (mysql-save-flag update)) - (format s5-0 " where nav_node_id=~D" (-> obj nav_node_id)) + (format s5-0 "nav_mesh_id=~D" (-> this nav_mesh_id)) + (if (logtest? (-> this mysql-save-flag) (mysql-save-flag update)) + (format s5-0 " where nav_node_id=~D" (-> this nav_node_id)) ) (let ((a2-9 (sql-query s5-0))) (when (!= (-> a2-9 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-9 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-9 this) (return #f) ) ) - (when (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) + (when (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) (let ((v1-40 (sql-query "select LAST_INSERT_ID()"))) (if (= (-> v1-40 error) 'select) - (set! (-> obj nav_node_id) (the-as uint (string->int (-> v1-40 data 0)))) + (set! (-> this nav_node_id) (the-as uint (string->int (-> v1-40 data 0)))) ) ) ) ) (((mysql-save-flag delete)) - (format s5-0 "nav_node_id=~D" (-> obj nav_node_id)) + (format s5-0 "nav_node_id=~D" (-> this nav_node_id)) (let ((a2-11 (sql-query s5-0))) (when (!= (-> a2-11 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-11 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-11 this) (return #f) ) ) ) ) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag insert)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) #t ) -(defmethod exec-sql! mysql-nav-edge ((obj mysql-nav-edge)) +(defmethod exec-sql! mysql-nav-edge ((this mysql-nav-edge)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag delete)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) ) (return #t) ) - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag update)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag update)) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) ) (let ((s5-0 (clear *temp-string*))) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) (((mysql-save-flag insert)) (format s5-0 "insert nav_edge set ") ) @@ -485,15 +485,15 @@ if none exist, return `-1`" (format s5-0 "delete from nav_edge where ") ) ) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) ((8 4) - (format s5-0 "nav_graph_id=~D," (-> obj nav_graph_id)) - (format s5-0 "nav_node_id_1=~D," (-> obj nav_node_id_1)) - (format s5-0 "nav_node_id_2=~D," (-> obj nav_node_id_2)) + (format s5-0 "nav_graph_id=~D," (-> this nav_graph_id)) + (format s5-0 "nav_node_id_1=~D," (-> this nav_node_id_1)) + (format s5-0 "nav_node_id_2=~D," (-> this nav_node_id_2)) (let ((t9-7 format) (a0-21 s5-0) (a1-8 "directionality='~S',") - (v1-20 (-> obj directionality)) + (v1-20 (-> this directionality)) ) (t9-7 a0-21 a1-8 (cond ((= v1-20 (nav-directionality directed)) @@ -508,11 +508,11 @@ if none exist, return `-1`" ) ) ) - (format s5-0 "speed_limit=~M," (-> obj speed_limit)) - (format s5-0 "density=~F," (-> obj density)) + (format s5-0 "speed_limit=~M," (-> this speed_limit)) + (format s5-0 "density=~F," (-> this density)) (format s5-0 "traffic_edge_flag='") (let ((v1-21 #t)) - (when (logtest? (-> obj traffic_edge_flag) 1) + (when (logtest? (-> this traffic_edge_flag) 1) (if (not v1-21) (format s5-0 ",") ) @@ -522,56 +522,56 @@ if none exist, return `-1`" (format s5-0 "',") (format s5-0 "nav_clock_mask='") (let ((v1-24 #t)) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-1)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-1)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-1") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-1a)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-1a)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-1a") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-2)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-2)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-2") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-2a)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-2a)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-2a") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-3)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-3)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-3") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-3a)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-3a)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-3a") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-4)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-4)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-4") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-4a)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-4a)) (if (not v1-24) (format s5-0 ",") ) @@ -582,7 +582,7 @@ if none exist, return `-1`" (let ((t9-32 format) (a0-82 s5-0) (a1-33 "nav_clock_type='~S',") - (v1-41 (-> obj nav_clock_type)) + (v1-41 (-> this nav_clock_type)) ) (t9-32 a0-82 a1-33 (cond ((= v1-41 (nav-clock-type clock2)) @@ -600,31 +600,31 @@ if none exist, return `-1`" ) ) ) - (format s5-0 "width=~M," (-> obj width)) + (format s5-0 "width=~M," (-> this width)) (format s5-0 "minimap_edge_flag='") (let ((v1-42 #t)) - (when (logtest? (-> obj minimap_edge_flag) (nav-minimap-edge-flag pass-red)) + (when (logtest? (-> this minimap_edge_flag) (nav-minimap-edge-flag pass-red)) (if (not v1-42) (format s5-0 ",") ) (format s5-0 "pass-red") (set! v1-42 #f) ) - (when (logtest? (-> obj minimap_edge_flag) (nav-minimap-edge-flag pass-green)) + (when (logtest? (-> this minimap_edge_flag) (nav-minimap-edge-flag pass-green)) (if (not v1-42) (format s5-0 ",") ) (format s5-0 "pass-green") (set! v1-42 #f) ) - (when (logtest? (-> obj minimap_edge_flag) (nav-minimap-edge-flag pass-yellow)) + (when (logtest? (-> this minimap_edge_flag) (nav-minimap-edge-flag pass-yellow)) (if (not v1-42) (format s5-0 ",") ) (format s5-0 "pass-yellow") (set! v1-42 #f) ) - (when (logtest? (-> obj minimap_edge_flag) (nav-minimap-edge-flag pass-blue)) + (when (logtest? (-> this minimap_edge_flag) (nav-minimap-edge-flag pass-blue)) (if (not v1-42) (format s5-0 ",") ) @@ -632,53 +632,53 @@ if none exist, return `-1`" ) ) (format s5-0 "'") - (if (logtest? (-> obj mysql-save-flag) (mysql-save-flag update)) - (format s5-0 " where nav_edge_id=~D" (-> obj nav_edge_id)) + (if (logtest? (-> this mysql-save-flag) (mysql-save-flag update)) + (format s5-0 " where nav_edge_id=~D" (-> this nav_edge_id)) ) (let ((a2-14 (sql-query s5-0))) (when (!= (-> a2-14 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-14 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-14 this) (return #f) ) ) - (when (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) + (when (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) (let ((v1-60 (sql-query "select LAST_INSERT_ID()"))) (if (= (-> v1-60 error) 'select) - (set! (-> obj nav_edge_id) (the-as uint (string->int (-> v1-60 data 0)))) + (set! (-> this nav_edge_id) (the-as uint (string->int (-> v1-60 data 0)))) ) ) ) ) (((mysql-save-flag delete)) - (format s5-0 "nav_edge_id=~D" (-> obj nav_edge_id)) + (format s5-0 "nav_edge_id=~D" (-> this nav_edge_id)) (let ((a2-16 (sql-query s5-0))) (when (!= (-> a2-16 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-16 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-16 this) (return #f) ) ) ) ) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag insert)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) #t ) -(defmethod exec-sql! mysql-nav-visnode ((obj mysql-nav-visnode)) +(defmethod exec-sql! mysql-nav-visnode ((this mysql-nav-visnode)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag delete)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) ) (return #t) ) - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag update)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag update)) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) ) (let ((s5-0 (clear *temp-string*))) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) (((mysql-save-flag insert)) (format s5-0 "insert nav_visible_nodes set ") ) @@ -689,52 +689,52 @@ if none exist, return `-1`" (format s5-0 "delete from nav_visible_nodes where ") ) ) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) ((8 4) - (format s5-0 "nav_graph_id=~D," (-> obj nav_graph_id)) - (format s5-0 "nav_edge_id=~D," (-> obj nav_edge_id)) - (format s5-0 "nav_node_id=~D" (-> obj nav_node_id)) + (format s5-0 "nav_graph_id=~D," (-> this nav_graph_id)) + (format s5-0 "nav_edge_id=~D," (-> this nav_edge_id)) + (format s5-0 "nav_node_id=~D" (-> this nav_node_id)) (let ((a2-3 (sql-query s5-0))) (when (!= (-> a2-3 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-3 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-3 this) (return #f) ) ) ) (((mysql-save-flag delete)) - (format s5-0 "nav_graph_id=~D and " (-> obj nav_graph_id)) - (format s5-0 "nav_edge_id=~D and " (-> obj nav_edge_id)) - (format s5-0 "nav_node_id=~D" (-> obj nav_node_id)) + (format s5-0 "nav_graph_id=~D and " (-> this nav_graph_id)) + (format s5-0 "nav_edge_id=~D and " (-> this nav_edge_id)) + (format s5-0 "nav_node_id=~D" (-> this nav_node_id)) (let ((a2-7 (sql-query s5-0))) (when (!= (-> a2-7 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-7 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-7 this) (return #f) ) ) ) ) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag insert)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) #t ) -(defmethod indexof-nav-node mysql-nav-graph ((obj mysql-nav-graph) (node-id int)) +(defmethod indexof-nav-node mysql-nav-graph ((this mysql-nav-graph) (node-id int)) "Iterate through the `node-array` and return the index for the first [[mysql-nav-node]] whom's `nav_node_id` matches the provided id returns `-1` if none is found" - (dotimes (v1-0 (-> obj node-array length)) - (if (= node-id (-> (the-as mysql-nav-node (-> obj node-array data v1-0)) nav_node_id)) + (dotimes (v1-0 (-> this node-array length)) + (if (= node-id (-> (the-as mysql-nav-node (-> this node-array data v1-0)) nav_node_id)) (return v1-0) ) ) -1 ) -(defmethod indexof-nav-edge mysql-nav-graph ((obj mysql-nav-graph) (edge-id int)) +(defmethod indexof-nav-edge mysql-nav-graph ((this mysql-nav-graph) (edge-id int)) "Iterate through the `edge-array` and return the index for the first [[mysql-nav-edge]] whom's `nav_edge_id` matches the provided id returns `-1` if none is found" - (dotimes (v1-0 (-> obj edge-array length)) - (if (= edge-id (-> (the-as mysql-nav-edge (-> obj edge-array data v1-0)) nav_edge_id)) + (dotimes (v1-0 (-> this edge-array length)) + (if (= edge-id (-> (the-as mysql-nav-edge (-> this edge-array data v1-0)) nav_edge_id)) (return v1-0) ) ) @@ -748,20 +748,20 @@ returns `-1` if none is found" ;; WARN: new jak 2 until loop case, check carefully ;; WARN: new jak 2 until loop case, check carefully ;; WARN: new jak 2 until loop case, check carefully -(defmethod init-from-sql! mysql-nav-graph ((obj mysql-nav-graph) (arg0 string) (arg1 string)) +(defmethod init-from-sql! mysql-nav-graph ((this mysql-nav-graph) (arg0 string) (arg1 string)) "Query the database and initialize the [[mysql-nav-graph]] and all it's related components" (local-vars (sv-16 string) (sv-32 int) (sv-48 int) (sv-64 int)) - (set! (-> obj node-array length) 0) - (set! (-> obj edge-array length) 0) - (set! (-> obj visnode-array length) 0) + (set! (-> this node-array length) 0) + (set! (-> this edge-array length) 0) + (set! (-> this visnode-array length) 0) (let ((s3-0 (clear *temp-string*))) (format s3-0 "select nav_graph_id from nav_graph where name='~S'" arg0) (let ((a2-2 (sql-query s3-0))) (when (!= (-> a2-2 error) 'select) - (format 0 "ERROR: sql: select error ~A for ~A~%" a2-2 obj) + (format 0 "ERROR: sql: select error ~A for ~A~%" a2-2 this) (return #f) ) - (set! (-> obj nav_graph_id) (the-as uint (string->int (-> a2-2 data 0)))) + (set! (-> this nav_graph_id) (the-as uint (string->int (-> a2-2 data 0)))) ) ) (format #t "Loading nodes ...~%") @@ -780,16 +780,16 @@ returns `-1` if none is found" (format s2-0 " limit ~D,~D" s4-1 s3-1) (let ((s2-1 (sql-query s2-0))) (when (!= (-> s2-1 error) 'select) - (format 0 "ERROR: sql: select error ~A for ~A~%" s2-1 obj) + (format 0 "ERROR: sql: select error ~A for ~A~%" s2-1 this) (return #f) ) (let ((s1-0 0)) (while (< s1-0 (-> s2-1 len)) - (when (= (string->int (-> s2-1 data (+ s1-0 9))) (-> obj nav_graph_id)) - (let ((nav-node (-> obj node-array data (-> obj node-array length)))) + (when (= (string->int (-> s2-1 data (+ s1-0 9))) (-> this nav_graph_id)) + (let ((nav-node (-> this node-array data (-> this node-array length)))) (set! (-> nav-node mysql-save-flag) (mysql-save-flag)) - (set! (-> nav-node runtime-id) (the-as uint (-> obj node-array length))) - (set! (-> nav-node nav_graph_id) (-> obj nav_graph_id)) + (set! (-> nav-node runtime-id) (the-as uint (-> this node-array length))) + (set! (-> nav-node nav_graph_id) (-> this nav_graph_id)) (set! (-> nav-node nav_node_id) (the-as uint (string->int (-> s2-1 data s1-0)))) (set! (-> nav-node position x) (* 4096.0 (string->float (-> s2-1 data (+ s1-0 1))))) (set! (-> nav-node position y) (* 4096.0 (string->float (-> s2-1 data (+ s1-0 2))))) @@ -833,7 +833,7 @@ returns `-1` if none is found" (label cfg-27) (set! (-> nav-node nav_mesh_id) (the-as uint (string->int (-> s2-1 data (+ s1-0 8))))) ) - (+! (-> obj node-array length) 1) + (+! (-> this node-array length) 1) ) (+! s1-0 10) ) @@ -849,7 +849,7 @@ returns `-1` if none is found" ) #f (label cfg-34) - (format #t "~D nodes.~%" (-> obj node-array length)) + (format #t "~D nodes.~%" (-> this node-array length)) (format #t "Loading edges ...~%") (let ((s5-1 0) (s4-2 256) @@ -864,24 +864,24 @@ returns `-1` if none is found" ) (let ((s3-3 (sql-query s3-2))) (when (!= (-> s3-3 error) 'select) - (format 0 "ERROR: sql: select error ~A for ~A~%" s3-3 obj) + (format 0 "ERROR: sql: select error ~A for ~A~%" s3-3 this) (return #f) ) (let ((s2-2 0)) (while (< s2-2 (-> s3-3 len)) - (when (= (string->int (-> s3-3 data (+ s2-2 11))) (-> obj nav_graph_id)) + (when (= (string->int (-> s3-3 data (+ s2-2 11))) (-> this nav_graph_id)) (let ((s0-2 (string->int (-> s3-3 data (+ s2-2 1))))) (set! sv-32 (string->int (-> s3-3 data (+ s2-2 2)))) - (set! sv-48 (indexof-nav-node obj s0-2)) - (set! sv-64 (indexof-nav-node obj sv-32)) - (let ((nav-edge (-> obj edge-array data (-> obj edge-array length)))) + (set! sv-48 (indexof-nav-node this s0-2)) + (set! sv-64 (indexof-nav-node this sv-32)) + (let ((nav-edge (-> this edge-array data (-> this edge-array length)))) (when (and (!= sv-48 -1) (!= sv-64 -1)) - (set! (-> nav-edge nav_graph_id) (-> obj nav_graph_id)) + (set! (-> nav-edge nav_graph_id) (-> this nav_graph_id)) (set! (-> nav-edge nav_edge_id) (the-as uint (string->int (-> s3-3 data s2-2)))) (set! (-> nav-edge nav_node_id_1) (the-as uint s0-2)) (set! (-> nav-edge nav_node_id_2) (the-as uint sv-32)) (set! (-> nav-edge mysql-save-flag) (mysql-save-flag)) - (set! (-> nav-edge runtime-id) (the-as uint (-> obj edge-array length))) + (set! (-> nav-edge runtime-id) (the-as uint (-> this edge-array length))) (set! (-> nav-edge runtime-node-id-1) sv-48) (set! (-> nav-edge runtime-node-id-2) sv-64) (let ((s0-3 (-> s3-3 data (+ s2-2 3)))) @@ -1017,7 +1017,7 @@ returns `-1` if none is found" ) #f (label cfg-102) - (+! (-> obj edge-array length) 1) + (+! (-> this edge-array length) 1) ) ) ) @@ -1036,7 +1036,7 @@ returns `-1` if none is found" ) #f (label cfg-109) - (format #t "~D edges.~%" (-> obj edge-array length)) + (format #t "~D edges.~%" (-> this edge-array length)) (format #t "Loading visnodes ...~%") (let ((s5-2 0) (s4-3 256) @@ -1046,21 +1046,21 @@ returns `-1` if none is found" (format s3-4 "select nav_edge_id,nav_node_id,nav_graph_id from nav_visible_nodes limit ~D,~D" s5-2 s4-3) (let ((s3-5 (sql-query s3-4))) (when (!= (-> s3-5 error) 'select) - (format 0 "ERROR: sql: select error ~A for ~A~%" s3-5 obj) + (format 0 "ERROR: sql: select error ~A for ~A~%" s3-5 this) (return #f) ) (let ((s2-3 0)) (while (< s2-3 (-> s3-5 len)) - (when (= (string->int (-> s3-5 data (+ s2-3 2))) (-> obj nav_graph_id)) - (let ((nav-visnode (-> obj visnode-array data (-> obj visnode-array length)))) + (when (= (string->int (-> s3-5 data (+ s2-3 2))) (-> this nav_graph_id)) + (let ((nav-visnode (-> this visnode-array data (-> this visnode-array length)))) (set! (-> nav-visnode mysql-save-flag) (mysql-save-flag)) - (set! (-> nav-visnode nav_graph_id) (-> obj nav_graph_id)) + (set! (-> nav-visnode nav_graph_id) (-> this nav_graph_id)) (set! (-> nav-visnode nav_edge_id) (the-as uint (string->int (-> s3-5 data s2-3)))) (set! (-> nav-visnode nav_node_id) (the-as uint (string->int (-> s3-5 data (+ s2-3 1))))) - (set! (-> nav-visnode runtime-edge-id) (indexof-nav-edge obj (the-as int (-> nav-visnode nav_edge_id)))) - (set! (-> nav-visnode runtime-node-id) (indexof-nav-node obj (the-as int (-> nav-visnode nav_node_id)))) + (set! (-> nav-visnode runtime-edge-id) (indexof-nav-edge this (the-as int (-> nav-visnode nav_edge_id)))) + (set! (-> nav-visnode runtime-node-id) (indexof-nav-node this (the-as int (-> nav-visnode nav_node_id)))) ) - (+! (-> obj visnode-array length) 1) + (+! (-> this visnode-array length) 1) ) (+! s2-3 3) ) @@ -1076,14 +1076,14 @@ returns `-1` if none is found" ) #f (label cfg-122) - (format #t "~D visnodes.~%" (-> obj visnode-array length)) + (format #t "~D visnodes.~%" (-> this visnode-array length)) #t ) -(defmethod temp-edge-size mysql-nav-node ((obj mysql-nav-node)) +(defmethod temp-edge-size mysql-nav-node ((this mysql-nav-node)) "Returns the number of [[mysql-nav-edge]] stored in the `temp-edge-list`" (let ((v0-0 0)) - (let ((v1-0 (the-as object (-> obj temp-edge-list)))) + (let ((v1-0 (the-as object (-> this temp-edge-list)))) (while v1-0 (+! v0-0 1) (set! v1-0 (-> (the-as mysql-nav-edge v1-0) temp-next-edge)) @@ -1093,19 +1093,19 @@ returns `-1` if none is found" ) ) -(defmethod mysql-nav-graph-method-17 mysql-nav-graph ((obj mysql-nav-graph)) - (dotimes (v1-0 (-> obj node-array length)) - (set! (-> (the-as mysql-nav-node (-> obj node-array data v1-0)) temp-edge-list) +(defmethod mysql-nav-graph-method-17 mysql-nav-graph ((this mysql-nav-graph)) + (dotimes (v1-0 (-> this node-array length)) + (set! (-> (the-as mysql-nav-node (-> this node-array data v1-0)) temp-edge-list) (the-as (inline-array mysql-nav-edge) #f) ) ) - (dotimes (v1-3 (-> obj edge-array length)) - (set! (-> (the-as mysql-nav-edge (-> obj edge-array data v1-3)) temp-next-edge) #f) + (dotimes (v1-3 (-> this edge-array length)) + (set! (-> (the-as mysql-nav-edge (-> this edge-array data v1-3)) temp-next-edge) #f) ) - (countdown (v1-7 (-> obj edge-array length)) - (let ((a1-17 (-> obj edge-array data v1-7))) + (countdown (v1-7 (-> this edge-array length)) + (let ((a1-17 (-> this edge-array data v1-7))) (when (not (logtest? (-> a1-17 mysql-save-flag) (mysql-save-flag delete))) - (let ((a2-8 (-> obj node-array data (-> a1-17 runtime-node-id-1)))) + (let ((a2-8 (-> this node-array data (-> a1-17 runtime-node-id-1)))) (when (not (logtest? (-> a2-8 mysql-save-flag) (mysql-save-flag delete))) (cond ((-> a2-8 temp-edge-list) @@ -1125,11 +1125,11 @@ returns `-1` if none is found" (none) ) -(defmethod lookup-level-info2 mysql-nav-graph ((obj mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol)) +(defmethod lookup-level-info2 mysql-nav-graph ((this mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol)) "TODO - this was originally called `lookup-level-info` but it clashes with the function defined in `level`" (let ((s5-0 (the-as mysql-nav-graph-level-info #f))) - (b! (>= (-> obj level-info-last-lookup) (-> obj level-info-array-length)) cfg-3 :delay #f) - (let ((v1-5 (-> obj level-info-array (-> obj level-info-last-lookup)))) + (b! (>= (-> this level-info-last-lookup) (-> this level-info-array-length)) cfg-3 :delay #f) + (let ((v1-5 (-> this level-info-array (-> this level-info-last-lookup)))) (let ((a0-2 (-> v1-5 level))) (b! (!= (-> arg0 level_name) a0-2) cfg-3 :delay (empty-form)) ) @@ -1140,12 +1140,12 @@ returns `-1` if none is found" (let ((v1-6 0)) (b! #t cfg-9 :delay (nop!)) (label cfg-4) - (let ((a0-6 (-> obj level-info-array v1-6))) + (let ((a0-6 (-> this level-info-array v1-6))) (let ((a3-1 (-> a0-6 level))) (b! (!= (-> arg0 level_name) a3-1) cfg-8 :delay (empty-form)) ) (if arg1 - (set! (-> obj level-info-last-lookup) v1-6) + (set! (-> this level-info-last-lookup) v1-6) ) (set! s5-0 a0-6) ) @@ -1153,18 +1153,18 @@ returns `-1` if none is found" (label cfg-8) (+! v1-6 1) (label cfg-9) - (b! (< v1-6 (-> obj level-info-array-length)) cfg-4) + (b! (< v1-6 (-> this level-info-array-length)) cfg-4) ) - (let ((v1-9 (-> obj level-info-array-length))) + (let ((v1-9 (-> this level-info-array-length))) (cond ((< v1-9 32) (if arg1 - (set! (-> obj level-info-last-lookup) v1-9) + (set! (-> this level-info-last-lookup) v1-9) ) - (set! s5-0 (-> obj level-info-array v1-9)) + (set! s5-0 (-> this level-info-array v1-9)) (set! (-> s5-0 level) (-> arg0 level_name)) (set! (-> s5-0 node-count) 0) - (+! (-> obj level-info-array-length) 1) + (+! (-> this level-info-array-length) 1) ) (else (format @@ -1175,12 +1175,12 @@ returns `-1` if none is found" (let ((s4-0 0)) (b! #t cfg-16 :delay (nop!)) (label cfg-15) - (let ((v1-17 (-> obj level-info-array s4-0))) + (let ((v1-17 (-> this level-info-array s4-0))) (format 0 "~d ~s~%" s4-0 (-> v1-17 level)) ) (+! s4-0 1) (label cfg-16) - (b! (< s4-0 (-> obj level-info-array-length)) cfg-15) + (b! (< s4-0 (-> this level-info-array-length)) cfg-15) ) (break!) 0 @@ -1193,9 +1193,9 @@ returns `-1` if none is found" ) -(defmethod mysql-nav-graph-method-20 mysql-nav-graph ((obj mysql-nav-graph)) - (mysql-nav-graph-method-17 obj) - (mysql-nav-graph-method-19 obj) +(defmethod mysql-nav-graph-method-20 mysql-nav-graph ((this mysql-nav-graph)) + (mysql-nav-graph-method-17 this) + (mysql-nav-graph-method-19 this) 0 (none) ) 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 0effc984f2..4a5d9f595f 100644 --- a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc @@ -131,69 +131,69 @@ (define *nav-graph-editor* (the-as (pointer nav-graph-editor) #f)) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-62 nav-graph-editor ((obj nav-graph-editor) (arg0 symbol) (arg1 symbol)) +(defmethod nav-graph-editor-method-62 nav-graph-editor ((this nav-graph-editor) (arg0 symbol) (arg1 symbol)) (case arg0 (('minimap) - (set! (-> obj vehicle-edit-mode) #t) - (set! (-> obj default-node nav_node_flag) (nav-node-flag)) - (set! (-> obj clipping-dist) 3276800.0) + (set! (-> this vehicle-edit-mode) #t) + (set! (-> this default-node nav_node_flag) (nav-node-flag)) + (set! (-> this clipping-dist) 3276800.0) ) (('hover) - (set! (-> obj hover-edit-mode) #t) + (set! (-> this hover-edit-mode) #t) ) ) - (set! (-> obj command-array length) 0) - (init-from-sql! (-> obj nav-graph) (the-as string arg0) (the-as string arg1)) - (set! (-> obj default-node nav_graph_id) (-> obj nav-graph nav_graph_id)) - (set! (-> obj default-edge nav_graph_id) (-> obj nav-graph nav_graph_id)) + (set! (-> this command-array length) 0) + (init-from-sql! (-> this nav-graph) (the-as string arg0) (the-as string arg1)) + (set! (-> this default-node nav_graph_id) (-> this nav-graph nav_graph_id)) + (set! (-> this default-edge nav_graph_id) (-> this nav-graph nav_graph_id)) (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-63 nav-graph-editor ((obj nav-graph-editor)) - (set! (-> obj command-array length) 0) - (exec-sql! (-> obj nav-graph)) +(defmethod nav-graph-editor-method-63 nav-graph-editor ((this nav-graph-editor)) + (set! (-> this command-array length) 0) + (exec-sql! (-> this nav-graph)) (none) ) -(defmethod deactivate nav-graph-editor ((obj nav-graph-editor)) +(defmethod deactivate nav-graph-editor ((this nav-graph-editor)) (set! *nav-graph-editor* (the-as (pointer nav-graph-editor) #f)) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; WARN: Return type mismatch none vs nav-graph-editor. -(defmethod relocate nav-graph-editor ((obj nav-graph-editor) (arg0 int)) +(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)) obj arg0) + ((the-as (function process int none) (find-parent-method nav-graph-editor 7)) this arg0) ) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-60 nav-graph-editor ((obj nav-graph-editor)) - (let ((v0-0 (not (-> obj vehicle-edit-mode)))) - (set! (-> obj vehicle-edit-mode) v0-0) - (set! (-> obj default-node nav_node_flag) (if v0-0 - (nav-node-flag) - (nav-node-flag pedestrian) - ) +(defmethod nav-graph-editor-method-60 nav-graph-editor ((this nav-graph-editor)) + (let ((v0-0 (not (-> this vehicle-edit-mode)))) + (set! (-> this vehicle-edit-mode) v0-0) + (set! (-> this default-node nav_node_flag) (if v0-0 + (nav-node-flag) + (nav-node-flag pedestrian) + ) ) ) (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-61 nav-graph-editor ((obj nav-graph-editor)) - (set! (-> obj hover-edit-mode) (not (-> obj hover-edit-mode))) +(defmethod nav-graph-editor-method-61 nav-graph-editor ((this nav-graph-editor)) + (set! (-> this hover-edit-mode) (not (-> this hover-edit-mode))) (none) ) ;; WARN: Return type mismatch symbol vs none. ;; WARN: Function (method 54 nav-graph-editor) has a return type of none, but the expression builder found a return statement. -(defmethod nav-graph-editor-method-54 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (when (not (-> obj hover-edit-mode)) - (let ((gp-0 (-> obj nav-graph node-array data arg0))) +(defmethod nav-graph-editor-method-54 nav-graph-editor ((this nav-graph-editor) (arg0 int)) + (when (not (-> this hover-edit-mode)) + (let ((gp-0 (-> this nav-graph node-array data arg0))) (dotimes (s5-0 (-> *level* length)) (let ((s4-0 (-> *level* level s5-0))) (when (= (-> s4-0 status) 'active) @@ -237,8 +237,8 @@ (none) ) -(defmethod nav-graph-editor-method-30 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (let ((s3-0 (-> obj nav-graph edge-array data arg0)) +(defmethod nav-graph-editor-method-30 nav-graph-editor ((this nav-graph-editor) (arg0 int)) + (let ((s3-0 (-> this nav-graph edge-array data arg0)) (s4-0 (new 'stack-no-clear 'matrix)) ) (format *stdcon* "flags ( ") @@ -261,21 +261,21 @@ (-> s4-0 trans) (the-as vector - (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> s3-0 runtime-node-id-1))) + (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> s3-0 runtime-node-id-1))) ) (the-as vector - (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> s3-0 runtime-node-id-2))) + (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> s3-0 runtime-node-id-2))) ) ) - (dotimes (s3-1 (-> obj nav-graph visnode-array length)) - (let ((v1-23 (-> obj nav-graph visnode-array data s3-1))) + (dotimes (s3-1 (-> this nav-graph visnode-array length)) + (let ((v1-23 (-> this nav-graph visnode-array data s3-1))) (when (and (= (-> v1-23 runtime-edge-id) arg0) (not (logtest? (-> v1-23 mysql-save-flag) (mysql-save-flag delete)))) (vector-! (the-as vector (-> s4-0 vector)) (the-as vector - (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> v1-23 runtime-node-id))) + (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> v1-23 runtime-node-id))) ) (-> s4-0 trans) ) @@ -334,10 +334,10 @@ #f ) -(defmethod nav-graph-editor-method-33 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (let* ((gp-0 (-> obj nav-graph edge-array data arg0)) - (s5-0 (-> obj nav-graph node-array data (-> gp-0 runtime-node-id-1))) - (s3-0 (-> obj nav-graph node-array data (-> gp-0 runtime-node-id-2))) +(defmethod nav-graph-editor-method-33 nav-graph-editor ((this nav-graph-editor) (arg0 int)) + (let* ((gp-0 (-> this nav-graph edge-array data arg0)) + (s5-0 (-> this nav-graph node-array data (-> gp-0 runtime-node-id-1))) + (s3-0 (-> this nav-graph node-array data (-> gp-0 runtime-node-id-2))) (s4-0 (new 'stack-no-clear 'vector)) ) (vector-! s4-0 (-> s5-0 position) (-> s3-0 position)) @@ -367,7 +367,7 @@ (none) ) -(defmethod nav-graph-editor-method-31 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-31 nav-graph-editor ((this nav-graph-editor) (arg0 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -376,10 +376,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((gp-0 (-> obj nav-graph node-array data arg0))) + (let ((gp-0 (-> this nav-graph node-array data arg0))) (format *stdcon* "Radius = ~M~%" (-> gp-0 radius)) (cond - ((= (-> obj nav-graph nav_graph_id) 4) + ((= (-> this nav-graph nav_graph_id) 4) (add-debug-sphere #t (bucket-id debug2) (-> gp-0 position) (-> gp-0 radius) *color-green*) ) (else @@ -435,15 +435,16 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-29 nav-graph-editor ((obj nav-graph-editor) (arg0 string) (arg1 string) (arg2 string)) +(defmethod nav-graph-editor-method-29 nav-graph-editor ((this nav-graph-editor) (arg0 string) (arg1 string) (arg2 string)) (format *stdcon* "~0K") + ;; og:preserve-this (format *stdcon* "~%~%~3L~18S~18S~18S~%~0L" "Left button" "Middle button" "Right button") (format *stdcon* "~18S~18S~18S~%" arg0 arg1 arg2) (format *stdcon* "~1K") (none) ) -(defmethod nav-graph-editor-method-28 nav-graph-editor ((obj nav-graph-editor)) +(defmethod nav-graph-editor-method-28 nav-graph-editor ((this nav-graph-editor)) (local-vars (sv-144 int) (sv-160 (function _varargs_ object))) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -451,7 +452,7 @@ (vf6 :class vf) ) (init-vf0-vector) - (let ((gp-0 (-> obj nav-graph))) + (let ((gp-0 (-> this nav-graph))) (dotimes (s4-0 (-> gp-0 node-array length)) (let ((s2-0 (-> gp-0 node-array data s4-0))) (set! (-> s2-0 visible) #f) @@ -466,12 +467,12 @@ ) (set! (-> s2-0 cam-dist) (vector-vector-distance-squared s3-0 (camera-pos))) (let ((f0-6 (-> s2-0 cam-dist)) - (f1-0 (-> obj clipping-dist)) + (f1-0 (-> this clipping-dist)) ) (set! (-> s2-0 visible) (< f0-6 (* f1-0 f1-0))) ) - (if (or (and (-> obj vehicle-edit-mode) (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian))) - (and (not (-> obj vehicle-edit-mode)) (not (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian)))) + (if (or (and (-> this vehicle-edit-mode) (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian))) + (and (not (-> this vehicle-edit-mode)) (not (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian)))) ) (set! (-> s2-0 visible) #f) ) @@ -611,7 +612,7 @@ ) ) -(defmethod nav-graph-editor-method-34 nav-graph-editor ((obj nav-graph-editor)) +(defmethod nav-graph-editor-method-34 nav-graph-editor ((this nav-graph-editor)) (with-pp (rlet ((acc :class vf) (vf0 :class vf) @@ -621,7 +622,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (set! (-> obj mouse-pos quad) (-> (camera-pos) quad)) + (set! (-> this mouse-pos quad) (-> (camera-pos) quad)) (let ((s5-1 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -631,12 +632,12 @@ (set! (-> s4-0 quad) (-> *up-vector* quad)) (set-vector! s1-0 (-> *mouse* posx) (-> *mouse* posy) 0.0 1.0) (cond - ((not (-> obj vehicle-edit-mode)) + ((not (-> this vehicle-edit-mode)) (set! (-> s3-0 quad) (-> (camera-matrix) vector 2 quad)) (let ((s0-0 s2-0)) - (let ((s4-2 (-> obj mouse-pos))) + (let ((s4-2 (-> this mouse-pos))) (let ((v1-8 (-> (camera-matrix) vector 2))) - (let ((a0-4 (-> obj clipping-dist))) + (let ((a0-4 (-> this clipping-dist))) (.mov vf7 a0-4) ) (.lvf vf5 (&-> v1-8 quad)) @@ -650,8 +651,8 @@ ) (reverse-transform-point! s5-1 s2-0 s3-0 s1-0) (let ((s4-3 (new 'stack 'collide-query))) - (set! (-> s4-3 start-pos quad) (-> obj mouse-pos quad)) - (vector-! (-> s4-3 move-dist) s5-1 (-> obj mouse-pos)) + (set! (-> s4-3 start-pos quad) (-> this mouse-pos quad)) + (vector-! (-> s4-3 move-dist) s5-1 (-> this mouse-pos)) (let ((v1-12 s4-3)) (set! (-> v1-12 radius) 4096.0) (set! (-> v1-12 collide-with) (collide-spec backgnd obstacle hit-by-player-list hit-by-others-list)) @@ -662,7 +663,7 @@ ) (let ((f0-6 (fill-and-probe-using-line-sphere *collide-cache* s4-3))) (when (>= f0-6 0.0) - (let ((a1-3 (-> obj mouse-hit))) + (let ((a1-3 (-> this mouse-hit))) (let ((v1-16 (-> s4-3 start-pos))) (let ((a0-16 (-> s4-3 move-dist))) (let ((a2-1 f0-6)) @@ -678,11 +679,11 @@ (.svf (&-> a1-3 quad) vf6) ) (vector+! - (-> obj mouse-hit-pick) - (-> obj mouse-hit) + (-> this mouse-hit-pick) + (-> this mouse-hit) (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-3 move-dist) 4096.0) ) - (set! (-> obj mouse-normal quad) (-> s4-3 best-other-tri normal quad)) + (set! (-> this mouse-normal quad) (-> s4-3 best-other-tri normal quad)) (dotimes (s5-3 (-> *level* length)) (let ((s4-4 (-> *level* level s5-3))) (when (= (-> s4-4 status) 'active) @@ -700,7 +701,7 @@ (let ((a0-24 (-> v1-28 nav-mesh)) (a1-6 (new 'stack-no-clear 'nav-find-poly-parms)) ) - (vector-! (-> a1-6 point) (-> obj mouse-hit) (-> a0-24 bounds)) + (vector-! (-> a1-6 point) (-> this mouse-hit) (-> a0-24 bounds)) (set! (-> a1-6 y-threshold) 40960.0) (set! (-> a1-6 ignore) (the-as uint 2)) (if (find-poly-containing-point-local a0-24 a1-6) @@ -719,8 +720,8 @@ ) ) (let ((s5-4 (new 'stack-no-clear 'vector))) - (set! (-> s5-4 quad) (-> obj mouse-hit quad)) - (let ((s4-5 (quaternion-from-two-vectors! (new 'stack-no-clear 'quaternion) *up-vector* (-> obj mouse-normal)))) + (set! (-> s5-4 quad) (-> this mouse-hit quad)) + (let ((s4-5 (quaternion-from-two-vectors! (new 'stack-no-clear 'quaternion) *up-vector* (-> this mouse-normal)))) (add-debug-vector #t (bucket-id debug2) @@ -758,20 +759,20 @@ (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj mouse-hit) - (-> obj mouse-normal) + (-> this mouse-hit) + (-> this mouse-normal) (meters 5) *color-red* ) ) - ((and (-> obj next-state) (= (-> obj next-state name) 'move-plane)) + ((and (-> this next-state) (= (-> this next-state name) 'move-plane)) (vector-cross! s3-0 *up-vector* (the-as vector (-> (camera-matrix) vector))) (vector-normalize! s3-0 1.0) - (set! (-> s2-0 quad) (-> obj mouse-hit quad)) + (set! (-> s2-0 quad) (-> this mouse-hit quad)) (reverse-transform-point! s5-1 s2-0 s3-0 s1-0) - (set! (-> obj plane-height) (-> s5-1 y)) + (set! (-> this plane-height) (-> s5-1 y)) (let ((s5-5 (new 'stack-no-clear 'vector))) - (set-vector! s5-5 (-> obj mouse-hit x) (-> obj plane-height) (-> obj mouse-hit z) 1.0) + (set-vector! s5-5 (-> this mouse-hit x) (-> this plane-height) (-> this mouse-hit z) 1.0) (add-debug-vector #t (bucket-id debug2) @@ -834,8 +835,8 @@ ) (else (set! (-> s3-0 quad) (-> *up-vector* quad)) - (set! (-> s2-0 quad) (-> obj mouse-pos quad)) - (set! (-> s2-0 y) (-> obj plane-height)) + (set! (-> s2-0 quad) (-> this mouse-pos quad)) + (set! (-> s2-0 y) (-> this plane-height)) (reverse-transform-point! s5-1 s2-0 s3-0 s1-0) (set! (-> s4-0 quad) (-> s3-0 quad)) (let ((v1-57 (new 'stack-no-clear 'matrix))) @@ -848,7 +849,7 @@ (vector+! (-> v1-57 trans) s5-1 (new 'static 'vector :x -8192.0 :z 8192.0 :w 1.0)) ) (let ((f30-0 50.0)) - (if (= (-> obj nav-graph nav_graph_id) 2) + (if (= (-> this nav-graph nav_graph_id) 2) (set! f30-0 4.0) ) (add-debug-vector @@ -900,9 +901,9 @@ *color-green* ) ) - (set! (-> obj mouse-hit quad) (-> s5-1 quad)) - (set! (-> obj mouse-hit-pick quad) (-> s5-1 quad)) - (let ((v0-19 (the-as object (-> obj mouse-normal)))) + (set! (-> this mouse-hit quad) (-> s5-1 quad)) + (set! (-> this mouse-hit-pick quad) (-> s5-1 quad)) + (let ((v0-19 (the-as object (-> this mouse-normal)))) (set! (-> (the-as vector v0-19) quad) (-> s4-0 quad)) v0-19 ) @@ -913,13 +914,13 @@ ) ) -(defmethod nav-graph-editor-method-41 nav-graph-editor ((obj nav-graph-editor)) - (set! (-> obj selected-index) -1) +(defmethod nav-graph-editor-method-41 nav-graph-editor ((this nav-graph-editor)) + (set! (-> this selected-index) -1) (none) ) -(defmethod nav-graph-editor-method-42 nav-graph-editor ((obj nav-graph-editor)) - (let ((s5-0 (-> obj nav-graph))) +(defmethod nav-graph-editor-method-42 nav-graph-editor ((this nav-graph-editor)) + (let ((s5-0 (-> this nav-graph))) (dotimes (s4-0 (-> s5-0 node-array length)) (let ((s3-0 (-> s5-0 node-array data s4-0))) (when (and (-> s3-0 visible) @@ -933,17 +934,17 @@ (set! (-> v1-9 quad) (-> a0-4 quad)) (set! (-> v1-9 w) 11468.8) (when (< 0.0 (ray-sphere-intersect - (-> obj mouse-pos) - (vector-! (new 'stack-no-clear 'vector) (-> obj mouse-hit-pick) (-> obj mouse-pos)) + (-> this mouse-pos) + (vector-! (new 'stack-no-clear 'vector) (-> this mouse-hit-pick) (-> this mouse-pos)) v1-9 (-> v1-9 w) ) ) (let ((f0-8 (+ -8192.0 (-> s3-0 cam-dist)))) - (when (or (= (-> obj selected-index) -1) (< f0-8 (-> obj selected-dist))) - (set! (-> obj selected-index) s4-0) - (set! (-> obj selected-dist) f0-8) - (set! (-> obj selected-node-edge?) #t) + (when (or (= (-> this selected-index) -1) (< f0-8 (-> this selected-dist))) + (set! (-> this selected-index) s4-0) + (set! (-> this selected-dist) f0-8) + (set! (-> this selected-node-edge?) #t) ) ) ) @@ -955,20 +956,20 @@ #f ) -(defmethod nav-graph-editor-method-44 nav-graph-editor ((obj nav-graph-editor)) - (set! (-> obj closest-node) -1) - (set! (-> obj dist-closest-node) 0.0) - (let ((s5-0 (-> obj nav-graph))) +(defmethod nav-graph-editor-method-44 nav-graph-editor ((this nav-graph-editor)) + (set! (-> this closest-node) -1) + (set! (-> this dist-closest-node) 0.0) + (let ((s5-0 (-> this nav-graph))) (dotimes (s4-0 (-> s5-0 node-array length)) (let ((v1-4 (-> s5-0 node-array data s4-0))) (when (and (-> v1-4 visible) (not (logtest? (-> v1-4 nav_node_flag) (nav-node-flag hidden))) (not (logtest? (-> v1-4 mysql-save-flag) (mysql-save-flag delete))) ) - (let ((f0-1 (vector-vector-distance (-> v1-4 position) (-> obj mouse-hit)))) - (when (or (< (-> obj closest-node) 0) (< f0-1 (-> obj dist-closest-node))) - (set! (-> obj closest-node) s4-0) - (set! (-> obj dist-closest-node) f0-1) + (let ((f0-1 (vector-vector-distance (-> v1-4 position) (-> this mouse-hit)))) + (when (or (< (-> this closest-node) 0) (< f0-1 (-> this dist-closest-node))) + (set! (-> this closest-node) s4-0) + (set! (-> this dist-closest-node) f0-1) ) ) ) @@ -979,10 +980,10 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-45 nav-graph-editor ((obj nav-graph-editor)) - (set! (-> obj closest-edge) -1) - (set! (-> obj dist-closest-edge) 0.0) - (let ((s5-0 (-> obj nav-graph))) +(defmethod nav-graph-editor-method-45 nav-graph-editor ((this nav-graph-editor)) + (set! (-> this closest-edge) -1) + (set! (-> this dist-closest-edge) 0.0) + (let ((s5-0 (-> this nav-graph))) 0.0 (dotimes (s4-0 (-> s5-0 edge-array length)) (let ((a0-2 (-> s5-0 edge-array data s4-0))) @@ -997,10 +998,10 @@ (-> v1-9 visible) (-> a1-5 visible) ) - (let ((f0-2 (vector-segment-distance-point! (-> obj mouse-hit) (-> a1-5 position) (-> v1-9 position) a3-0))) - (when (or (< (-> obj closest-edge) 0) (< f0-2 (-> obj dist-closest-edge))) - (set! (-> obj closest-edge) s4-0) - (set! (-> obj dist-closest-edge) f0-2) + (let ((f0-2 (vector-segment-distance-point! (-> this mouse-hit) (-> a1-5 position) (-> v1-9 position) a3-0))) + (when (or (< (-> this closest-edge) 0) (< f0-2 (-> this dist-closest-edge))) + (set! (-> this closest-edge) s4-0) + (set! (-> this dist-closest-edge) f0-2) ) ) ) @@ -1014,7 +1015,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-43 nav-graph-editor ((obj nav-graph-editor)) +(defmethod nav-graph-editor-method-43 nav-graph-editor ((this nav-graph-editor)) (local-vars (sv-128 vector) (sv-144 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1022,7 +1023,7 @@ (vf6 :class vf) ) (init-vf0-vector) - (let ((s5-0 (-> obj nav-graph))) + (let ((s5-0 (-> this nav-graph))) (dotimes (s4-0 (-> s5-0 edge-array length)) (let ((a0-2 (-> s5-0 edge-array data s4-0))) (when (not (logtest? (-> a0-2 mysql-save-flag) (mysql-save-flag delete))) @@ -1050,10 +1051,10 @@ (let ((f30-0 0.0) (s0-1 ray-cylinder-intersect) ) - (set! sv-128 (-> obj mouse-pos)) + (set! sv-128 (-> this mouse-pos)) (set! sv-144 (new 'stack-no-clear 'vector)) - (let ((v1-18 (-> obj mouse-hit-pick)) - (a0-13 (-> obj mouse-pos)) + (let ((v1-18 (-> this mouse-hit-pick)) + (a0-13 (-> this mouse-pos)) ) (.lvf vf4 (&-> v1-18 quad)) (.lvf vf5 (&-> a0-13 quad)) @@ -1067,11 +1068,11 @@ (t2-0 s3-0) ) (when (< f30-0 (s0-1 sv-128 sv-144 s1-0 a3-3 t0-0 t1-0 t2-0)) - (let ((f0-1 (vector-vector-distance s3-0 (-> obj mouse-pos)))) - (when (or (= (-> obj selected-index) -1) (< f0-1 (-> obj selected-dist))) - (set! (-> obj selected-index) s4-0) - (set! (-> obj selected-dist) f0-1) - (set! (-> obj selected-node-edge?) #f) + (let ((f0-1 (vector-vector-distance s3-0 (-> this mouse-pos)))) + (when (or (= (-> this selected-index) -1) (< f0-1 (-> this selected-dist))) + (set! (-> this selected-index) s4-0) + (set! (-> this selected-dist) f0-1) + (set! (-> this selected-node-edge?) #f) ) ) ) @@ -1089,14 +1090,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-32 nav-graph-editor ((obj nav-graph-editor) (arg0 symbol) (arg1 int)) +(defmethod nav-graph-editor-method-32 nav-graph-editor ((this nav-graph-editor) (arg0 symbol) (arg1 int)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) ) (init-vf0-vector) - (let ((v1-0 (-> obj nav-graph))) + (let ((v1-0 (-> this nav-graph))) (when (>= arg1 0) (cond (arg0 @@ -1158,46 +1159,46 @@ ) ) -(defmethod nav-graph-editor-method-47 nav-graph-editor ((obj nav-graph-editor)) - (+! (-> obj command-id) 1) - (-> obj command-id) +(defmethod nav-graph-editor-method-47 nav-graph-editor ((this nav-graph-editor)) + (+! (-> this command-id) 1) + (-> this command-id) (none) ) -(defmethod nav-graph-editor-method-48 nav-graph-editor ((obj nav-graph-editor) (arg0 uint)) +(defmethod nav-graph-editor-method-48 nav-graph-editor ((this nav-graph-editor) (arg0 uint)) "TODO - enum / com-type" - (let* ((v1-1 (-> obj command-array length)) - (v0-0 (-> obj command-array data v1-1)) + (let* ((v1-1 (-> this command-array length)) + (v0-0 (-> this command-array data v1-1)) ) - (+! (-> obj command-array length) 1) - (set! (-> obj max-command) v1-1) + (+! (-> this command-array length) 1) + (set! (-> this max-command) v1-1) (set! (-> v0-0 com-type) arg0) - (set! (-> v0-0 id) (-> obj command-id)) + (set! (-> v0-0 id) (-> this command-id)) v0-0 ) ) -(defmethod nav-graph-editor-method-49 nav-graph-editor ((obj nav-graph-editor)) - (-> obj command-array data (+ (-> obj command-array length) -1)) +(defmethod nav-graph-editor-method-49 nav-graph-editor ((this nav-graph-editor)) + (-> this command-array data (+ (-> this command-array length) -1)) ) -(defmethod nav-graph-editor-method-50 nav-graph-editor ((obj nav-graph-editor)) - (+! (-> obj command-array length) -1) - (set! (-> obj max-command) (-> obj command-array length)) +(defmethod nav-graph-editor-method-50 nav-graph-editor ((this nav-graph-editor)) + (+! (-> this command-array length) -1) + (set! (-> this max-command) (-> this command-array length)) (none) ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-graph-editor-method-58 nav-graph-editor ((obj nav-graph-editor)) - (if (zero? (-> obj command-array length)) +(defmethod nav-graph-editor-method-58 nav-graph-editor ((this nav-graph-editor)) + (if (zero? (-> this command-array length)) (return #f) ) - (let ((s5-0 (-> obj command-array data (+ (-> obj command-array length) -1) id))) + (let ((s5-0 (-> this command-array data (+ (-> this command-array length) -1) id))) (until #f - (if (zero? (-> obj command-array length)) + (if (zero? (-> this command-array length)) (return #t) ) - (let ((s4-0 (-> obj command-array data (+ (-> obj command-array length) -1)))) + (let ((s4-0 (-> this command-array data (+ (-> this command-array length) -1)))) (if (!= s5-0 (-> s4-0 id)) (return #t) ) @@ -1206,86 +1207,86 @@ ((zero? v1-20) (format #t "Undo move-node ~D~%" (-> s4-0 id)) (vector-! - (the-as vector (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> s4-0 index)))) - (the-as vector (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> s4-0 index)))) + (the-as vector (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> s4-0 index)))) + (the-as vector (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> s4-0 index)))) (-> s4-0 move-vec) ) - (nav-graph-editor-method-54 obj (-> s4-0 index)) + (nav-graph-editor-method-54 this (-> s4-0 index)) ) ((= v1-20 1) (format #t "Undo delete-edge ~D~%" (-> s4-0 id)) - (logclear! (-> obj nav-graph edge-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logclear! (-> this nav-graph edge-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ((= v1-20 2) (format #t "Undo delete-node ~D~%" (-> s4-0 id)) - (logclear! (-> obj nav-graph node-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logclear! (-> this nav-graph node-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ((= v1-20 5) (format #t "Undo delete-visnode ~D~%" (-> s4-0 id)) - (logclear! (-> obj nav-graph visnode-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logclear! (-> this nav-graph visnode-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ((= v1-20 3) (format #t "Undo new-node ~D~%" (-> s4-0 id)) - (logior! (-> obj nav-graph node-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logior! (-> this nav-graph node-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ((= v1-20 6) (format #t "Undo new-visnode ~D~%" (-> s4-0 id)) - (logior! (-> obj nav-graph visnode-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logior! (-> this nav-graph visnode-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ((= v1-20 4) (format #t "Undo new-edge ~D~%" (-> s4-0 id)) - (logior! (-> obj nav-graph edge-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logior! (-> this nav-graph edge-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ) ) ) - (+! (-> obj command-array length) -1) + (+! (-> this command-array length) -1) ) ) #f ) -(defmethod nav-graph-editor-method-51 nav-graph-editor ((obj nav-graph-editor)) - (let ((gp-0 (alloc-new-node! (-> obj nav-graph)))) +(defmethod nav-graph-editor-method-51 nav-graph-editor ((this nav-graph-editor)) + (let ((gp-0 (alloc-new-node! (-> this nav-graph)))) (when (!= gp-0 -1) - (let ((v1-6 (-> obj nav-graph node-array data gp-0)) - (a0-4 (-> obj default-node)) + (let ((v1-6 (-> this nav-graph node-array data gp-0)) + (a0-4 (-> this default-node)) ) - (set! (-> v1-6 position quad) (-> obj mouse-hit quad)) + (set! (-> v1-6 position quad) (-> this mouse-hit quad)) (set! (-> v1-6 angle) (-> a0-4 angle)) (set! (-> v1-6 radius) (-> a0-4 radius)) (set! (-> v1-6 nav_mesh_id) (-> a0-4 nav_mesh_id)) (set! (-> v1-6 nav_node_flag) (-> a0-4 nav_node_flag)) ) - (nav-graph-editor-method-54 obj gp-0) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 3)) index) gp-0) + (nav-graph-editor-method-54 this gp-0) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 3)) index) gp-0) ) ) (none) ) -(defmethod nav-graph-editor-method-53 nav-graph-editor ((obj nav-graph-editor) (arg0 int) (arg1 int)) - (let ((s5-0 (indexof-visnode (-> obj nav-graph) arg0 arg1))) +(defmethod nav-graph-editor-method-53 nav-graph-editor ((this nav-graph-editor) (arg0 int) (arg1 int)) + (let ((s5-0 (indexof-visnode (-> this nav-graph) arg0 arg1))) (if (= s5-0 -1) - (set! s5-0 (alloc-new-visnode! (-> obj nav-graph) arg0 arg1)) + (set! s5-0 (alloc-new-visnode! (-> this nav-graph) arg0 arg1)) ) (when (!= s5-0 -1) - (logclear! (-> obj nav-graph visnode-array data s5-0 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 6)) index) s5-0) + (logclear! (-> this nav-graph visnode-array data s5-0 mysql-save-flag) (mysql-save-flag delete)) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 6)) index) s5-0) ) ) (none) ) ;; WARN: Return type mismatch int vs uint. -(defmethod nav-graph-editor-method-52 nav-graph-editor ((obj nav-graph-editor)) - (let ((gp-0 (alloc-new-edge! (-> obj nav-graph)))) +(defmethod nav-graph-editor-method-52 nav-graph-editor ((this nav-graph-editor)) + (let ((gp-0 (alloc-new-edge! (-> this nav-graph)))) (when (!= gp-0 -1) - (let ((v1-6 (-> obj nav-graph edge-array data gp-0)) - (a0-4 (-> obj default-edge)) + (let ((v1-6 (-> this nav-graph edge-array data gp-0)) + (a0-4 (-> this default-edge)) ) - (set! (-> v1-6 runtime-node-id-1) (-> obj edge-src)) - (set! (-> v1-6 runtime-node-id-2) (-> obj edge-dst)) + (set! (-> v1-6 runtime-node-id-1) (-> this edge-src)) + (set! (-> v1-6 runtime-node-id-2) (-> this edge-dst)) (set! (-> v1-6 directionality) (nav-directionality bi_directional)) (set! (-> v1-6 speed_limit) (-> a0-4 speed_limit)) (set! (-> v1-6 density) (-> a0-4 density)) @@ -1295,50 +1296,50 @@ (set! (-> v1-6 width) (-> a0-4 width)) (set! (-> v1-6 minimap_edge_flag) (-> a0-4 minimap_edge_flag)) ) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 4)) index) gp-0) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 4)) index) gp-0) ) (the-as uint gp-0) ) ) -(defmethod nav-graph-editor-method-57 nav-graph-editor ((obj nav-graph-editor) (arg0 int) (arg1 int)) - (case (indexof-visnode (-> obj nav-graph) arg0 arg1) +(defmethod nav-graph-editor-method-57 nav-graph-editor ((this nav-graph-editor) (arg0 int) (arg1 int)) + (case (indexof-visnode (-> this nav-graph) arg0 arg1) ((-1) (return (the-as int #f)) ) ) - (let ((s5-1 (alloc-new-visnode! (-> obj nav-graph) arg0 arg1))) + (let ((s5-1 (alloc-new-visnode! (-> this nav-graph) arg0 arg1))) (when (!= s5-1 -1) - (nav-graph-editor-method-47 obj) - (logior! (-> obj nav-graph visnode-array data s5-1 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 5)) index) s5-1) + (nav-graph-editor-method-47 this) + (logior! (-> this nav-graph visnode-array data s5-1 mysql-save-flag) (mysql-save-flag delete)) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 5)) index) s5-1) ) ) 0 ) -(defmethod nav-graph-editor-method-55 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (nav-graph-editor-method-47 obj) - (let ((s5-0 (-> obj nav-graph node-array data arg0))) +(defmethod nav-graph-editor-method-55 nav-graph-editor ((this nav-graph-editor) (arg0 int)) + (nav-graph-editor-method-47 this) + (let ((s5-0 (-> this nav-graph node-array data arg0))) (logior! (-> s5-0 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 2)) index) arg0) - (dotimes (s3-0 (-> obj nav-graph edge-array length)) - (let ((v1-13 (-> obj nav-graph edge-array data s3-0))) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 2)) index) arg0) + (dotimes (s3-0 (-> this nav-graph edge-array length)) + (let ((v1-13 (-> this nav-graph edge-array data s3-0))) (when (and (not (logtest? (-> v1-13 mysql-save-flag) (mysql-save-flag delete))) (or (= (-> v1-13 runtime-node-id-1) arg0) (= (-> v1-13 runtime-node-id-2) arg0)) ) (logior! (-> v1-13 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 1)) index) s3-0) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 1)) index) s3-0) ) ) ) - (dotimes (s4-1 (-> obj nav-graph visnode-array length)) - (let ((v1-23 (-> obj nav-graph visnode-array data s4-1))) + (dotimes (s4-1 (-> this nav-graph visnode-array length)) + (let ((v1-23 (-> this nav-graph visnode-array data s4-1))) (when (and (not (logtest? (-> v1-23 mysql-save-flag) (mysql-save-flag delete))) (= (-> v1-23 runtime-node-id) (-> s5-0 runtime-id)) ) (logior! (-> v1-23 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 5)) index) s4-1) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 5)) index) s4-1) ) ) ) @@ -1347,18 +1348,18 @@ (none) ) -(defmethod nav-graph-editor-method-56 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (nav-graph-editor-method-47 obj) - (let ((s5-0 (-> obj nav-graph edge-array data arg0))) +(defmethod nav-graph-editor-method-56 nav-graph-editor ((this nav-graph-editor) (arg0 int)) + (nav-graph-editor-method-47 this) + (let ((s5-0 (-> this nav-graph edge-array data arg0))) (logior! (-> s5-0 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 1)) index) arg0) - (dotimes (s4-1 (-> obj nav-graph visnode-array length)) - (let ((v1-11 (-> obj nav-graph visnode-array data s4-1))) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 1)) index) arg0) + (dotimes (s4-1 (-> this nav-graph visnode-array length)) + (let ((v1-11 (-> this nav-graph visnode-array data s4-1))) (when (and (not (logtest? (-> v1-11 mysql-save-flag) (mysql-save-flag delete))) (= (-> v1-11 runtime-edge-id) (-> s5-0 runtime-id)) ) (logior! (-> v1-11 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 5)) index) s4-1) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 5)) index) s4-1) ) ) ) @@ -1370,8 +1371,8 @@ ) (v1-19 #f) ) - (dotimes (a0-16 (-> obj nav-graph edge-array length)) - (let ((a1-7 (-> obj nav-graph edge-array data a0-16))) + (dotimes (a0-16 (-> this nav-graph edge-array length)) + (let ((a1-7 (-> this nav-graph edge-array data a0-16))) (if (and (not (logtest? (-> a1-7 mysql-save-flag) (mysql-save-flag delete))) (or (= (-> a1-7 runtime-node-id-1) s3-0) (= (-> a1-7 runtime-node-id-2) s3-0)) ) @@ -1380,10 +1381,10 @@ ) ) (when (not v1-19) - (let ((v1-24 (-> obj nav-graph node-array data s3-0))) + (let ((v1-24 (-> this nav-graph node-array data s3-0))) (logior! (-> v1-24 mysql-save-flag) (mysql-save-flag delete)) ) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 2)) index) s3-0) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 2)) index) s3-0) ) ) ) @@ -1392,9 +1393,9 @@ (none) ) -(defmethod nav-graph-editor-method-59 nav-graph-editor ((obj nav-graph-editor)) +(defmethod nav-graph-editor-method-59 nav-graph-editor ((this nav-graph-editor)) (if (cpad-pressed? 0 triangle) - (nav-graph-editor-method-58 obj) + (nav-graph-editor-method-58 this) ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (let ((v0-1 (logclear (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)))) @@ -1403,18 +1404,18 @@ ) ) -(defmethod nav-graph-editor-method-46 nav-graph-editor ((obj nav-graph-editor)) +(defmethod nav-graph-editor-method-46 nav-graph-editor ((this nav-graph-editor)) (if (cpad-pressed? 0 up) - (go (method-of-object obj create)) + (go (method-of-object this create)) ) (if (cpad-pressed? 0 down) - (go (method-of-object obj adjust-it)) + (go (method-of-object this adjust-it)) ) (if (cpad-pressed? 0 left) - (go (method-of-object obj adjust-minimap)) + (go (method-of-object this adjust-minimap)) ) (if (cpad-pressed? 0 right) - (go (method-of-object obj adjust-plane)) + (go (method-of-object this adjust-plane)) ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons up)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up)) @@ -1430,23 +1431,26 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-35 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) +(defmethod nav-graph-editor-method-35 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) (cond ((not (mouse-hold? left)) - (let ((a0-4 (nav-graph-editor-method-49 obj))) + (let ((a0-4 (nav-graph-editor-method-49 this))) (vector-! (-> a0-4 move-vec) - (the-as vector (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> obj selected-index)))) + (the-as + vector + (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> this selected-index))) + ) (-> a0-4 move-vec) ) ) - (go (method-of-object obj create)) + (go (method-of-object this create)) ) (else - (set! (-> obj nav-graph node-array data (-> obj selected-index) position quad) (-> obj mouse-hit quad)) - (nav-graph-editor-method-54 obj (-> obj selected-index)) + (set! (-> this nav-graph node-array data (-> this selected-index) position quad) (-> this mouse-hit quad)) + (nav-graph-editor-method-54 this (-> this selected-index)) ) ) (none) @@ -1531,22 +1535,22 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-38 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-41 obj) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-42 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) +(defmethod nav-graph-editor-method-38 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-41 this) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-42 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) (add-debug-line-sphere #t (bucket-id debug2) - (the-as vector (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> obj edge-src)))) + (the-as vector (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> this edge-src)))) (vector-! (new 'stack-no-clear 'vector) - (-> obj mouse-hit) - (the-as vector (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> obj edge-src)))) + (-> this mouse-hit) + (the-as vector (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> this edge-src)))) ) 1024.0 - (if (>= (-> obj selected-index) 0) + (if (>= (-> this selected-index) 0) *color-green* *color-red* ) @@ -1556,34 +1560,34 @@ (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (let ((v1-20 (logclear (-> *mouse* button0-rel 0) (mouse-buttons left)))) (set! (-> *mouse* button0-rel 0) v1-20) - (and v1-20 (!= (-> obj selected-index) (-> obj edge-src))) + (and v1-20 (!= (-> this selected-index) (-> this edge-src))) ) ) ) (cond - ((>= (-> obj selected-index) 0) - (set! (-> obj edge-dst) (-> obj selected-index)) + ((>= (-> this selected-index) 0) + (set! (-> this edge-dst) (-> this selected-index)) ) (else - (set! (-> obj edge-dst) (the-as int (nav-graph-editor-method-51 obj))) - (if (= (-> obj edge-dst) -1) - (go (method-of-object obj create)) + (set! (-> this edge-dst) (the-as int (nav-graph-editor-method-51 this))) + (if (= (-> this edge-dst) -1) + (go (method-of-object this create)) ) ) ) - (if (= (nav-graph-editor-method-52 obj) -1) - (go (method-of-object obj create)) + (if (= (nav-graph-editor-method-52 this) -1) + (go (method-of-object this create)) ) - (nav-graph-editor-method-47 obj) - (set! (-> obj edge-src) (-> obj edge-dst)) + (nav-graph-editor-method-47 this) + (set! (-> this edge-src) (-> this edge-dst)) ) ((mouse-pressed? right) - (if (= (-> obj edge-dst) -2) - (nav-graph-editor-method-58 obj) + (if (= (-> this edge-dst) -2) + (nav-graph-editor-method-58 this) ) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) - (go (method-of-object obj create)) + (go (method-of-object this create)) ) ) (none) @@ -1616,23 +1620,23 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-37 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-41 obj) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-42 obj) - (nav-graph-editor-method-43 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) +(defmethod nav-graph-editor-method-37 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-41 this) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-42 this) + (nav-graph-editor-method-43 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) (cond ((mouse-pressed? left) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) - (go (method-of-object obj create-edge)) + (go (method-of-object this create-edge)) ) - ((and (mouse-pressed? right) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?))) + ((and (mouse-pressed? right) (>= (-> this selected-index) 0) (not (-> this selected-node-edge?))) ) (else - (nav-graph-editor-method-59 obj) - (nav-graph-editor-method-46 obj) + (nav-graph-editor-method-59 this) + (nav-graph-editor-method-46 this) ) ) (none) @@ -1799,36 +1803,36 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-39 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-41 obj) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-42 obj) - (nav-graph-editor-method-43 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) - (when (>= (-> obj selected-index) 0) - (if (-> obj selected-node-edge?) - (nav-graph-editor-method-31 obj (-> obj selected-index)) - (nav-graph-editor-method-30 obj (-> obj selected-index)) +(defmethod nav-graph-editor-method-39 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-41 this) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-42 this) + (nav-graph-editor-method-43 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) + (when (>= (-> this selected-index) 0) + (if (-> this selected-node-edge?) + (nav-graph-editor-method-31 this (-> this selected-index)) + (nav-graph-editor-method-30 this (-> this selected-index)) ) ) (cond - ((and (mouse-hold? left) (>= (-> obj selected-index) 0)) - (if (-> obj selected-node-edge?) - (go (method-of-object obj adjust-node-angle)) + ((and (mouse-hold? left) (>= (-> this selected-index) 0)) + (if (-> this selected-node-edge?) + (go (method-of-object this adjust-node-angle)) ) ) - ((and (mouse-hold? right) (>= (-> obj selected-index) 0)) - (if (-> obj selected-node-edge?) - (go (method-of-object obj adjust-node-radius)) - (go (method-of-object obj adjust-edge-width)) + ((and (mouse-hold? right) (>= (-> this selected-index) 0)) + (if (-> this selected-node-edge?) + (go (method-of-object this adjust-node-radius)) + (go (method-of-object this adjust-edge-width)) ) ) - ((and (mouse-hold? middle) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?))) - (go (method-of-object obj adjust-edge-density)) + ((and (mouse-hold? middle) (>= (-> this selected-index) 0) (not (-> this selected-node-edge?))) + (go (method-of-object this adjust-edge-density)) ) (else - (nav-graph-editor-method-59 obj) - (nav-graph-editor-method-46 obj) + (nav-graph-editor-method-59 this) + (nav-graph-editor-method-46 this) ) ) (none) @@ -1858,28 +1862,28 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-40 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-41 obj) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-43 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) - (if (and (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?))) - (nav-graph-editor-method-30 obj (-> obj selected-index)) +(defmethod nav-graph-editor-method-40 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-41 this) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-43 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) + (if (and (>= (-> this selected-index) 0) (not (-> this selected-node-edge?))) + (nav-graph-editor-method-30 this (-> this selected-index)) ) (cond - ((and (mouse-hold? left) (>= (-> obj selected-index) 0)) + ((and (mouse-hold? left) (>= (-> this selected-index) 0)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) - (go (method-of-object obj adjust-edge-visibility)) + (go (method-of-object this adjust-edge-visibility)) ) ((mouse-hold? right) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) - (go (method-of-object obj draw-closest-minimap)) + (go (method-of-object this draw-closest-minimap)) ) (else - (nav-graph-editor-method-59 obj) - (nav-graph-editor-method-46 obj) + (nav-graph-editor-method-59 this) + (nav-graph-editor-method-46 this) ) ) (none) @@ -1956,34 +1960,34 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-36 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-41 obj) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-42 obj) - (nav-graph-editor-method-43 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) +(defmethod nav-graph-editor-method-36 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-41 this) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-42 this) + (nav-graph-editor-method-43 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) (cond - ((and (mouse-hold? left) (>= (-> obj selected-index) 0) (-> obj selected-node-edge?)) + ((and (mouse-hold? left) (>= (-> this selected-index) 0) (-> this selected-node-edge?)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) - (go (method-of-object obj move-node)) + (go (method-of-object this move-node)) ) ((mouse-hold? right) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) - (go (method-of-object obj create-edge)) + (go (method-of-object this create-edge)) ) - ((and (mouse-hold? middle) (>= (-> obj selected-index) 0)) + ((and (mouse-hold? middle) (>= (-> this selected-index) 0)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) - (if (-> obj selected-node-edge?) - (nav-graph-editor-method-55 obj (-> obj selected-index)) - (nav-graph-editor-method-56 obj (-> obj selected-index)) + (if (-> this selected-node-edge?) + (nav-graph-editor-method-55 this (-> this selected-index)) + (nav-graph-editor-method-56 this (-> this selected-index)) ) ) (else - (nav-graph-editor-method-59 obj) - (nav-graph-editor-method-46 obj) + (nav-graph-editor-method-59 this) + (nav-graph-editor-method-46 this) ) ) (none) diff --git a/goal_src/jak2/engine/debug/part-tester.gc b/goal_src/jak2/engine/debug/part-tester.gc index 9ece1559f4..797ab5c54f 100644 --- a/goal_src/jak2/engine/debug/part-tester.gc +++ b/goal_src/jak2/engine/debug/part-tester.gc @@ -41,11 +41,11 @@ (define *part-tester-name* (the-as string #f)) -(defmethod deactivate part-tester ((obj part-tester)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate part-tester ((this part-tester)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -69,6 +69,7 @@ (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) (let ((gp-1 (-> *part-group-id-table* 127))) + ;; og:preserve-this (#when PC_PORT (if (nonzero? (-> *part-group-id-table* *part-tester-id*)) (set! gp-1 (-> *part-group-id-table* *part-tester-id*)) diff --git a/goal_src/jak2/engine/debug/stats-h.gc b/goal_src/jak2/engine/debug/stats-h.gc index 7e331a90e6..4a8fc41a28 100644 --- a/goal_src/jak2/engine/debug/stats-h.gc +++ b/goal_src/jak2/engine/debug/stats-h.gc @@ -286,26 +286,26 @@ ) ;; definition for method 3 of type perf-stat-array -(defmethod inspect perf-stat-array ((obj perf-stat-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect perf-stat-array ((this perf-stat-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) (set! (-> perf-stat-array heap-base) (the-as uint 52)) (define *pc-perf-stat-counter* (the-as uint 0)) -(defmethod reset! perf-stat ((obj perf-stat)) - ; (let ((v1-0 (-> obj ctrl))) - (+! (-> obj count) 1) - (when (nonzero? (-> obj ctrl)) +(defmethod reset! perf-stat ((this perf-stat)) + ; (let ((v1-0 (-> this ctrl))) + (+! (-> this count) 1) + (when (nonzero? (-> this ctrl)) (set! *pc-perf-stat-counter* (get-cpu-clock)) ) ; (b! (zero? v1-0) cfg-2 :delay (nop!)) @@ -326,18 +326,18 @@ ) -(defmethod read! perf-stat ((obj perf-stat)) +(defmethod read! perf-stat ((this perf-stat)) ; (local-vars (v1-1 int) (v1-3 int)) - ; (b! (zero? (-> obj ctrl)) cfg-2 :delay (nop!)) - (when (nonzero? (-> obj ctrl)) + ; (b! (zero? (-> this ctrl)) cfg-2 :delay (nop!)) + (when (nonzero? (-> this ctrl)) ; (.mtc0 Perf r0) ; (.sync.l) ; (.sync.p) ; (.mfpc v1-1 pcr0) - (+! (-> obj accum0) (- (get-cpu-clock) *pc-perf-stat-counter*)) + (+! (-> this accum0) (- (get-cpu-clock) *pc-perf-stat-counter*)) ; (.mfpc v1-3 pcr1) - ; (+! (-> obj accum1) v1-3) - (set! (-> obj accum1) 0) + ; (+! (-> this accum1) v1-3) + (set! (-> this accum1) 0) ) ; (label cfg-2) ; 0 @@ -346,11 +346,11 @@ ;; definition for method 13 of type perf-stat ;; INFO: Return type mismatch int vs none. -(defmethod update-wait-stats perf-stat ((obj perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) - (when (nonzero? (-> obj ctrl)) - (+! (-> obj to-vu0-waits) arg0) - (+! (-> obj to-spr-waits) arg1) - (+! (-> obj from-spr-waits) arg2) +(defmethod update-wait-stats perf-stat ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) + (when (nonzero? (-> this ctrl)) + (+! (-> this to-vu0-waits) arg0) + (+! (-> this to-spr-waits) arg1) + (+! (-> this from-spr-waits) arg2) ) 0 (none) diff --git a/goal_src/jak2/engine/debug/viewer.gc b/goal_src/jak2/engine/debug/viewer.gc index 040cdb1933..cf393c041a 100644 --- a/goal_src/jak2/engine/debug/viewer.gc +++ b/goal_src/jak2/engine/debug/viewer.gc @@ -206,16 +206,16 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! viewer ((obj viewer) (arg0 entity-actor)) +(defmethod init-from-entity! viewer ((this viewer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! *viewer* obj) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! *viewer* this) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (let ((s4-0 (-> arg0 etype))) (if (valid? s4-0 type (the-as string #f) #f 0) (init-viewer (symbol->string (-> s4-0 symbol)) (res-lump-struct arg0 'name string)) diff --git a/goal_src/jak2/engine/dma/dma-buffer.gc b/goal_src/jak2/engine/dma/dma-buffer.gc index 1d93103167..9716f57ae5 100644 --- a/goal_src/jak2/engine/dma/dma-buffer.gc +++ b/goal_src/jak2/engine/dma/dma-buffer.gc @@ -114,14 +114,14 @@ note that the second vifcode can also hold other stuff depending on the mode. arg0 ) -(defmethod length dma-buffer ((obj dma-buffer)) +(defmethod length dma-buffer ((this dma-buffer)) "Get the amount of data the buffer can hold, in bytes." - (-> obj allocated-length) + (-> this allocated-length) ) -(defmethod asize-of dma-buffer ((obj dma-buffer)) +(defmethod asize-of dma-buffer ((this dma-buffer)) "Get the size in memory of the object" - (+ (-> obj allocated-length) -4 (-> dma-buffer size)) + (+ (-> this allocated-length) -4 (-> dma-buffer size)) ) (defun dma-buffer-length ((arg0 dma-buffer)) diff --git a/goal_src/jak2/engine/draw/draw-node-h.gc b/goal_src/jak2/engine/draw/draw-node-h.gc index 9bae24ae5e..098dbebbbf 100644 --- a/goal_src/jak2/engine/draw/draw-node-h.gc +++ b/goal_src/jak2/engine/draw/draw-node-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: draw-node-h ;; dgos: ENGINE, GAME +;; DECOMP BEGINS + (deftype draw-node (drawable) ((child-count uint8 :offset 6) (flags uint8 :offset 7) diff --git a/goal_src/jak2/engine/draw/drawable-actor-h.gc b/goal_src/jak2/engine/draw/drawable-actor-h.gc index e157e7d890..b6b032c9f2 100644 --- a/goal_src/jak2/engine/draw/drawable-actor-h.gc +++ b/goal_src/jak2/engine/draw/drawable-actor-h.gc @@ -15,6 +15,7 @@ :flag-assert #x1100000020 ) + (deftype drawable-tree-actor (drawable-tree) () :method-count-assert 17 @@ -31,9 +32,7 @@ :flag-assert #x1100000044 ) -(defmethod draw drawable-tree-actor ((obj drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) +(defmethod draw drawable-tree-actor ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) 0 (none) ) - - diff --git a/goal_src/jak2/engine/draw/drawable-group.gc b/goal_src/jak2/engine/draw/drawable-group.gc index 1c4c9d42b3..8d61c95ff8 100644 --- a/goal_src/jak2/engine/draw/drawable-group.gc +++ b/goal_src/jak2/engine/draw/drawable-group.gc @@ -15,50 +15,50 @@ ) ) -(defmethod print drawable-group ((obj drawable-group)) - (format #t "#<~A @ #x~X [~D]" (-> obj type) obj (-> obj length)) - (dotimes (idx (-> obj length)) - (format #t " ~A" (-> obj data idx)) +(defmethod print drawable-group ((this drawable-group)) + (format #t "#<~A @ #x~X [~D]" (-> this type) this (-> this length)) + (dotimes (idx (-> this length)) + (format #t " ~A" (-> this data idx)) ) (format #t ">") - obj + this ) -(defmethod length drawable-group ((obj drawable-group)) - (-> obj length) +(defmethod length drawable-group ((this drawable-group)) + (-> this length) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of drawable-group ((obj drawable-group)) - (the-as int (+ (-> drawable-group size) (* (-> obj length) 4))) +(defmethod asize-of drawable-group ((this drawable-group)) + (the-as int (+ (-> drawable-group size) (* (-> this length) 4))) ) -(defmethod mem-usage drawable-group ((obj drawable-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-group ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) - (let ((obj-size (asize-of obj))) + (let ((obj-size (asize-of this))) (+! (-> arg0 data 0 used) obj-size) (+! (-> arg0 data 0 total) (logand -16 (+ obj-size 15))) ) - (dotimes (idx (-> obj length)) - (mem-usage (-> obj data idx) arg0 arg1) + (dotimes (idx (-> this length)) + (mem-usage (-> this data idx) arg0 arg1) ) - obj + this ) -(defmethod login drawable-group ((obj drawable-group)) - (dotimes (idx (-> obj length)) - (login (-> obj data idx)) +(defmethod login drawable-group ((this drawable-group)) + (dotimes (idx (-> this length)) + (login (-> this data idx)) ) - obj + this ) -(defmethod draw drawable-group ((obj drawable-group) (arg0 drawable-group) (arg1 display-frame)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (idx (-> obj length)) - (draw (-> obj data idx) (-> arg0 data idx) arg1) +(defmethod draw drawable-group ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (idx (-> this length)) + (draw (-> this data idx) (-> arg0 data idx) arg1) ) ) ) @@ -66,11 +66,11 @@ (none) ) -(defmethod collect-stats drawable-group ((obj drawable-group)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (idx (-> obj length)) - (collect-stats (-> obj data idx)) +(defmethod collect-stats drawable-group ((this drawable-group)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (idx (-> this length)) + (collect-stats (-> this data idx)) ) ) ) @@ -78,11 +78,11 @@ (none) ) -(defmethod debug-draw drawable-group ((obj drawable-group) (arg0 drawable) (arg1 display-frame)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (idx (-> obj length)) - (debug-draw (-> obj data idx) (-> (the-as drawable-group arg0) data idx) arg1) +(defmethod debug-draw drawable-group ((this drawable-group) (arg0 drawable) (arg1 display-frame)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (idx (-> this length)) + (debug-draw (-> this data idx) (-> (the-as drawable-group arg0) data idx) arg1) ) ) ) @@ -90,9 +90,9 @@ (none) ) -(defmethod unpack-vis drawable-group ((obj drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) - (dotimes (idx (-> obj length)) - (set! arg1 (unpack-vis (-> obj data idx) arg0 arg1)) +(defmethod unpack-vis drawable-group ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) + (dotimes (idx (-> this length)) + (set! arg1 (unpack-vis (-> this data idx) arg0 arg1)) ) arg1 ) diff --git a/goal_src/jak2/engine/draw/drawable-h.gc b/goal_src/jak2/engine/draw/drawable-h.gc index d3e6d90bf6..6de5b9788b 100644 --- a/goal_src/jak2/engine/draw/drawable-h.gc +++ b/goal_src/jak2/engine/draw/drawable-h.gc @@ -37,8 +37,8 @@ ;; DECOMP BEGINS (deftype drawable (basic) - ((id int16 :offset-assert 4) - (bsphere vector :inline :offset-assert 16) + ((id int16 :offset-assert 4) + (bsphere vector :inline :offset-assert 16) ) :method-count-assert 17 :size-assert #x20 @@ -51,11 +51,11 @@ (collect-stats (_type_) none 13) (debug-draw (_type_ drawable display-frame) none 14) (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 15) - (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 15) (collect-regions (_type_ sphere int region-prim-list) none 16) ) ) + (deftype drawable-error (drawable) ((name string :offset-assert 32) ) diff --git a/goal_src/jak2/engine/draw/drawable-inline-array-h.gc b/goal_src/jak2/engine/draw/drawable-inline-array-h.gc index b73a7036b9..5c9ee32301 100644 --- a/goal_src/jak2/engine/draw/drawable-inline-array-h.gc +++ b/goal_src/jak2/engine/draw/drawable-inline-array-h.gc @@ -5,6 +5,8 @@ ;; name in dgo: drawable-inline-array-h ;; dgos: ENGINE, GAME +;; DECOMP BEGINS + (deftype drawable-inline-array (drawable) ((length int16 :offset 6) ) @@ -12,6 +14,3 @@ :size-assert #x20 :flag-assert #x1100000020 ) - - - diff --git a/goal_src/jak2/engine/draw/drawable-inline-array.gc b/goal_src/jak2/engine/draw/drawable-inline-array.gc index a1b885a4ed..9d3468e750 100644 --- a/goal_src/jak2/engine/draw/drawable-inline-array.gc +++ b/goal_src/jak2/engine/draw/drawable-inline-array.gc @@ -7,25 +7,25 @@ ;; DECOMP BEGINS -(defmethod length drawable-inline-array ((obj drawable-inline-array)) - (-> obj length) +(defmethod length drawable-inline-array ((this drawable-inline-array)) + (-> this length) ) -(defmethod login drawable-inline-array ((obj drawable-inline-array)) - obj +(defmethod login drawable-inline-array ((this drawable-inline-array)) + this ) -(defmethod draw drawable-inline-array ((obj drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) +(defmethod draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) 0 (none) ) -(defmethod collect-stats drawable-inline-array ((obj drawable-inline-array)) +(defmethod collect-stats drawable-inline-array ((this drawable-inline-array)) 0 (none) ) -(defmethod debug-draw drawable-inline-array ((obj drawable-inline-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) 0 (none) ) diff --git a/goal_src/jak2/engine/draw/drawable-tree.gc b/goal_src/jak2/engine/draw/drawable-tree.gc index 809f11144d..32bf7122b7 100644 --- a/goal_src/jak2/engine/draw/drawable-tree.gc +++ b/goal_src/jak2/engine/draw/drawable-tree.gc @@ -7,13 +7,13 @@ ;; DECOMP BEGINS -(defmethod draw drawable-tree-array ((obj drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) +(defmethod draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) (case (-> *level* draw-level *draw-index* display?) (('special #f) ) (else - (dotimes (idx (-> obj length)) - (draw (-> obj trees idx) (-> arg0 trees idx) arg1) + (dotimes (idx (-> this length)) + (draw (-> this trees idx) (-> arg0 trees idx) arg1) ) ) ) @@ -21,25 +21,25 @@ (none) ) -(defmethod collect-stats drawable-tree-array ((obj drawable-tree-array)) - (dotimes (idx (-> obj length)) - (collect-stats (-> obj trees idx)) +(defmethod collect-stats drawable-tree-array ((this drawable-tree-array)) + (dotimes (idx (-> this length)) + (collect-stats (-> this trees idx)) ) 0 (none) ) -(defmethod debug-draw drawable-tree-array ((obj drawable-tree-array) (arg0 drawable) (arg1 display-frame)) - (dotimes (idx (-> obj length)) - (debug-draw (-> obj trees idx) (-> (the-as drawable-tree-array arg0) trees idx) arg1) +(defmethod debug-draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) + (dotimes (idx (-> this length)) + (debug-draw (-> this trees idx) (-> (the-as drawable-tree-array arg0) trees idx) arg1) ) 0 (none) ) -(defmethod unpack-vis drawable-tree ((obj drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) (local-vars (t5-1 uint)) - (let* ((v1-0 (the-as drawable-inline-array-node (-> obj data 0))) + (let* ((v1-0 (the-as drawable-inline-array-node (-> this data 0))) (a3-1 (/ (-> v1-0 data 0 id) 8)) (t0-0 (-> v1-0 length)) (v1-1 (&+ arg0 a3-1)) @@ -53,11 +53,11 @@ (set! v1-1 (&-> v1-1 1)) ) ) - (let ((v1-5 (+ (-> obj length) -1))) + (let ((v1-5 (+ (-> this length) -1))) (when (nonzero? v1-5) (dotimes (a3-5 v1-5) - (let* ((t0-4 (-> obj data a3-5)) - (t2-0 (the-as drawable-inline-array-node (-> obj data (+ a3-5 1)))) + (let* ((t0-4 (-> this data a3-5)) + (t2-0 (the-as drawable-inline-array-node (-> this data (+ a3-5 1)))) (t1-5 (/ (-> (the-as drawable-inline-array-node t0-4) data 0 id) 8)) (t2-2 (/ (-> t2-0 data 0 id) 8)) (t0-5 (-> (the-as drawable-inline-array-node t0-4) length)) @@ -69,7 +69,7 @@ (set! t1-6 (&-> t1-6 1)) (let ((t4-0 128)) (label cfg-7) - (b! (zero? (logand t3-0 t4-0)) cfg-9 :delay (set! t5-1 (the-as uint (-> arg1 0)))) + (b! (not (logtest? t3-0 t4-0)) cfg-9 :delay (set! t5-1 (the-as uint (-> arg1 0)))) (set! arg1 (&-> arg1 1)) (set! (-> (the-as (pointer int8) t2-3) 0) (the-as int t5-1)) (label cfg-9) diff --git a/goal_src/jak2/engine/draw/drawable.gc b/goal_src/jak2/engine/draw/drawable.gc index 5f82a71081..1a0aad5760 100644 --- a/goal_src/jak2/engine/draw/drawable.gc +++ b/goal_src/jak2/engine/draw/drawable.gc @@ -285,29 +285,29 @@ ;; Generally, you shouldn't call any of these unless you know the type and ;; what they will do. -(defmethod login drawable ((obj drawable)) +(defmethod login drawable ((this drawable)) "Initialize a drawable after load." - obj + this ) -(defmethod draw drawable ((obj drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) "Draw something. The meaning of this depends on the exact drawable class, but in general the heavy work isn't here - this just adds stuff to lists." 0 (none) ) -(defmethod fill-collide-list-from-box drawable ((obj drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) +(defmethod fill-collide-list-from-box drawable ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) "Collect a list of collision meshes contained in the box." 0 ) -(defmethod fill-collide-list-from-line-sphere drawable ((obj drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) +(defmethod fill-collide-list-from-line-sphere drawable ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) "Collect a list of collision meshes contained in 'line-sphere'." 0 ) -(defmethod collect-regions drawable ((obj drawable) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions drawable ((this drawable) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @@ -317,26 +317,26 @@ (none) ) -(defmethod collect-stats drawable ((obj drawable)) +(defmethod collect-stats drawable ((this drawable)) "Collect statistics for debugging" 0 (none) ) -(defmethod debug-draw drawable ((obj drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) "Draw debug visualizations" 0 (none) ) -(defmethod draw drawable-error ((obj drawable-error) (arg0 drawable-error) (arg1 display-frame)) +(defmethod draw drawable-error ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) "Draw a debug sphere." (error-sphere arg0 (-> arg0 name)) 0 (none) ) -(defmethod unpack-vis drawable ((obj drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) "Unpack vis data from arg1 to arg0, unpacking it. Return pointer to next thing." arg1 ) diff --git a/goal_src/jak2/engine/entity/actor-link-h.gc b/goal_src/jak2/engine/entity/actor-link-h.gc index 92fd711044..61cda6c4ea 100644 --- a/goal_src/jak2/engine/entity/actor-link-h.gc +++ b/goal_src/jak2/engine/entity/actor-link-h.gc @@ -69,12 +69,12 @@ ) -(defmethod next-actor entity-actor ((obj entity-actor)) - (entity-actor-lookup obj 'next-actor 0) +(defmethod next-actor entity-actor ((this entity-actor)) + (entity-actor-lookup this 'next-actor 0) ) -(defmethod prev-actor entity-actor ((obj entity-actor)) - (entity-actor-lookup obj 'prev-actor 0) +(defmethod prev-actor entity-actor ((this entity-actor)) + (entity-actor-lookup this 'prev-actor 0) ) (defmethod new actor-link-info ((allocation symbol) (type-to-make type) (arg0 process) (arg1 symbol)) @@ -94,36 +94,36 @@ ) ) -(defmethod get-next actor-link-info ((obj actor-link-info)) - (-> obj next) +(defmethod get-next actor-link-info ((this actor-link-info)) + (-> this next) ) -(defmethod get-prev actor-link-info ((obj actor-link-info)) - (-> obj prev) +(defmethod get-prev actor-link-info ((this actor-link-info)) + (-> this prev) ) ;; WARN: Return type mismatch basic vs process. -(defmethod get-next-process actor-link-info ((obj actor-link-info)) - (the-as process (and (-> obj next) (-> obj next extra process))) +(defmethod get-next-process actor-link-info ((this actor-link-info)) + (the-as process (and (-> this next) (-> this next extra process))) ) ;; WARN: Return type mismatch basic vs process. -(defmethod get-prev-process actor-link-info ((obj actor-link-info)) - (the-as process (and (-> obj prev) (-> obj prev extra process))) +(defmethod get-prev-process actor-link-info ((this actor-link-info)) + (the-as process (and (-> this prev) (-> this prev extra process))) ) -(defmethod link-to-next-and-prev-actor actor-link-info ((obj actor-link-info)) - (let ((a0-1 (-> obj process entity))) - (set! (-> obj next) (entity-actor-lookup a0-1 'next-actor 0)) +(defmethod link-to-next-and-prev-actor actor-link-info ((this actor-link-info)) + (let ((a0-1 (-> this process entity))) + (set! (-> this next) (entity-actor-lookup a0-1 'next-actor 0)) ) - (let ((a0-2 (-> obj process entity))) - (set! (-> obj prev) (entity-actor-lookup a0-2 'prev-actor 0)) + (let ((a0-2 (-> this process entity))) + (set! (-> this prev) (entity-actor-lookup a0-2 'prev-actor 0)) ) - obj + this ) -(defmethod apply-function-forward actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) - (let ((s3-0 (-> obj next))) +(defmethod apply-function-forward actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s3-0 (-> this next))) (while s3-0 (if (arg0 s3-0 arg1) (return (the-as int #f)) @@ -134,8 +134,8 @@ 0 ) -(defmethod apply-function-reverse actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) - (let ((s3-0 (-> obj prev))) +(defmethod apply-function-reverse actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s3-0 (-> this prev))) (while s3-0 (if (arg0 s3-0 arg1) (return (the-as int #f)) @@ -146,8 +146,8 @@ 0 ) -(defmethod apply-all actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) - (let ((s4-0 (-> obj process entity))) +(defmethod apply-all actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s4-0 (-> this process entity))) (while (let ((a0-2 s4-0)) (entity-actor-lookup a0-2 'prev-actor 0) ) @@ -165,9 +165,9 @@ 0 ) -(defmethod send-to-all-after actor-link-info ((obj actor-link-info) (arg0 symbol)) +(defmethod send-to-all-after actor-link-info ((this actor-link-info) (arg0 symbol)) (with-pp - (let ((s4-0 (-> obj next)) + (let ((s4-0 (-> this next)) (s5-0 (the-as object #f)) ) (while s4-0 @@ -188,9 +188,9 @@ ) ) -(defmethod send-to-all-before actor-link-info ((obj actor-link-info) (arg0 symbol)) +(defmethod send-to-all-before actor-link-info ((this actor-link-info) (arg0 symbol)) (with-pp - (let ((s4-0 (-> obj prev)) + (let ((s4-0 (-> this prev)) (s5-0 (the-as object #f)) ) (while s4-0 @@ -212,8 +212,8 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-next actor-link-info ((obj actor-link-info) (arg0 symbol)) - (let ((a0-1 (-> obj next))) +(defmethod send-to-next actor-link-info ((this actor-link-info) (arg0 symbol)) + (let ((a0-1 (-> this next))) (when a0-1 (let ((a0-2 (-> a0-1 extra process))) (if a0-2 @@ -226,8 +226,8 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) - (let ((a0-1 (-> obj prev))) +(defmethod send-to-prev actor-link-info ((this actor-link-info) (arg0 symbol)) + (let ((a0-1 (-> this prev))) (when a0-1 (let ((a0-2 (-> a0-1 extra process))) (if a0-2 @@ -240,21 +240,21 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-next-and-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) - (send-to-next obj arg0) - (send-to-prev obj arg0) +(defmethod send-to-next-and-prev actor-link-info ((this actor-link-info) (arg0 symbol)) + (send-to-next this arg0) + (send-to-prev this arg0) (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-all actor-link-info ((obj actor-link-info) (arg0 symbol)) - (send-to-all-after obj arg0) - (send-to-all-before obj arg0) +(defmethod send-to-all actor-link-info ((this actor-link-info) (arg0 symbol)) + (send-to-all-after this arg0) + (send-to-all-before this arg0) (none) ) -(defmethod actor-count actor-link-info ((obj actor-link-info)) - (let ((s5-0 (-> obj process entity)) +(defmethod actor-count actor-link-info ((this actor-link-info)) + (let ((s5-0 (-> this process entity)) (gp-0 0) ) (while (let ((a0-2 s5-0)) @@ -272,8 +272,8 @@ ) ) -(defmethod get-matching-actor-type-mask actor-link-info ((obj actor-link-info) (arg0 type)) - (let ((s3-0 (-> obj process entity)) +(defmethod get-matching-actor-type-mask actor-link-info ((this actor-link-info) (arg0 type)) + (let ((s3-0 (-> this process entity)) (s5-0 0) ) (let ((s4-0 1)) @@ -296,8 +296,8 @@ ) ) -(defmethod actor-count-before actor-link-info ((obj actor-link-info)) - (let* ((s5-0 (-> obj process entity)) +(defmethod actor-count-before actor-link-info ((this actor-link-info)) + (let* ((s5-0 (-> this process entity)) (s4-0 s5-0) (gp-0 0) ) diff --git a/goal_src/jak2/engine/entity/entity-h.gc b/goal_src/jak2/engine/entity/entity-h.gc index 8fbe03783b..c9831dc228 100644 --- a/goal_src/jak2/engine/entity/entity-h.gc +++ b/goal_src/jak2/engine/entity/entity-h.gc @@ -208,8 +208,8 @@ ) (deftype actor-reference (structure) - ((actor entity :offset-assert 0) - (id uint32 :offset-assert 4) + ((actor entity :offset-assert 0) + (id uint32 :offset-assert 4) ) :pack-me :method-count-assert 9 diff --git a/goal_src/jak2/engine/entity/entity.gc b/goal_src/jak2/engine/entity/entity.gc index d0df3af5af..351d1568bd 100644 --- a/goal_src/jak2/engine/entity/entity.gc +++ b/goal_src/jak2/engine/entity/entity.gc @@ -18,20 +18,20 @@ (define *vis-actors* #t) ;; WARN: Return type mismatch int vs drawable-actor. -(defmethod mem-usage drawable-actor ((obj drawable-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-actor ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 44 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") (+! (-> arg0 data 43 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 43 used) v1-6) (+! (-> arg0 data 43 total) (logand -16 (+ v1-6 15))) ) - (mem-usage (-> obj actor) arg0 (logior arg1 64)) + (mem-usage (-> this actor) arg0 (logior arg1 64)) (the-as drawable-actor 0) ) ;; WARN: Return type mismatch int vs drawable-inline-array-actor. -(defmethod mem-usage drawable-inline-array-actor ((obj drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-actor ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -39,61 +39,61 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) (the-as drawable-inline-array-actor 0) ) -(defmethod print entity-links ((obj entity-links)) - (format #t "#" (-> obj process) obj) - obj +(defmethod print entity-links ((this entity-links)) + (format #t "#" (-> this process) this) + this ) -(defmethod print entity-perm ((obj entity-perm)) +(defmethod print entity-perm ((this entity-perm)) (format #t "#" - (-> obj aid) - (-> obj task) - (-> obj status) - (-> obj user-uint64) - obj + (-> this aid) + (-> this task) + (-> this status) + (-> this user-uint64) + this ) - obj + this ) -(defmethod print actor-group ((obj actor-group)) +(defmethod print actor-group ((this actor-group)) (format #t "# obj length)) - (format #t " ~A" (-> obj data s5-0 actor)) + (dotimes (s5-0 (-> this length)) + (format #t " ~A" (-> this data s5-0 actor)) ) - (format #t " @ #x~X>" obj) - obj + (format #t " @ #x~X>" this) + this ) -(defmethod birth! entity ((obj entity)) - (format #t "birth ~A~%" obj) - obj +(defmethod birth! entity ((this entity)) + (format #t "birth ~A~%" this) + this ) -(defmethod kill! entity ((obj entity)) - (format #t "kill ~A~%" obj) - obj +(defmethod kill! entity ((this entity)) + (format #t "kill ~A~%" this) + this ) -(defmethod print entity ((obj entity)) - (format #t "#<~A :name ~S @ #x~X>" (-> obj type) (res-lump-struct obj 'name structure) obj) - obj +(defmethod print entity ((this entity)) + (format #t "#<~A :name ~S @ #x~X>" (-> this type) (res-lump-struct this 'name structure) this) + this ) -(defmethod get-level entity ((obj entity)) +(defmethod get-level entity ((this entity)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) (when (= (-> a1-3 status) 'active) - (if (and (>= (the-as int obj) (the-as int (-> a1-3 heap base))) - (< (the-as int obj) (the-as int (-> a1-3 heap top-base))) + (if (and (>= (the-as int this) (the-as int (-> a1-3 heap base))) + (< (the-as int this) (the-as int (-> a1-3 heap top-base))) ) (return a1-3) ) @@ -238,11 +238,11 @@ ) ) -(defmethod update-nav-meshes-method level-group ((obj level-group)) +(defmethod update-nav-meshes-method level-group ((this level-group)) "Clashes with a function name" (when (not (paused?)) - (dotimes (s5-0 (-> obj length)) - (let ((v1-4 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-4 (-> this level s5-0))) (when (= (-> v1-4 status) 'active) (let ((s4-0 (-> v1-4 bsp nav-meshes))) (when (nonzero? s4-0) @@ -498,55 +498,55 @@ (-> arg0 level task-mask) ) -(defmethod print process ((obj process)) +(defmethod print process ((this process)) (cond - ((and (-> obj top-thread) (!= (-> obj status) 'dead)) - (format #t "#<~A ~S ~A :state ~S :flags " (-> obj type) (-> obj name) (-> obj status) (if (-> obj state) - (-> obj state name) + ((and (-> this top-thread) (!= (-> this status) 'dead)) + (format #t "#<~A ~S ~A :state ~S :flags " (-> this type) (-> this name) (-> this status) (if (-> this state) + (-> this state name) ) ) - (process-status-bits obj #t) + (process-status-bits this #t) (format #t " :stack ~D/~D :heap ~D/~D @ #x~X>" - (&- (-> obj top-thread stack-top) (the-as uint (-> obj top-thread sp))) - (-> obj main-thread stack-size) - (- (-> obj allocated-length) (&- (-> obj heap-top) (the-as uint (-> obj heap-cur)))) - (-> obj allocated-length) - obj + (&- (-> this top-thread stack-top) (the-as uint (-> this top-thread sp))) + (-> this main-thread stack-size) + (- (-> this allocated-length) (&- (-> this heap-top) (the-as uint (-> this heap-cur)))) + (-> this allocated-length) + this ) ) (else (format #t "#<~A ~S ~A :state ~S @ #x~X" - (-> obj type) - (-> obj name) - (-> obj status) - (if (-> obj state) - (-> obj state name) + (-> this type) + (-> this name) + (-> this status) + (if (-> this state) + (-> this state name) ) - obj + this ) ) ) - obj + this ) ;; WARN: Return type mismatch entity-actor vs none. -(defmethod debug-print entity-actor ((obj entity-actor) (arg0 symbol) (arg1 type)) - (let ((s4-0 (-> obj etype))) +(defmethod debug-print entity-actor ((this entity-actor) (arg0 symbol) (arg1 type)) + (let ((s4-0 (-> this etype))) (when (or (not arg1) (and s4-0 (valid? s4-0 type (the-as string #f) #f 0) (type-type? s4-0 arg1))) - (format #t "~5D #x~8X ~-26S" (-> obj extra vis-id) obj (res-lump-struct obj 'name structure)) + (format #t "~5D #x~8X ~-26S" (-> this extra vis-id) this (res-lump-struct this 'name structure)) (let ((t9-4 format) (a0-5 #t) (a1-5 "~8D ~3D ~-8S #x~4X") - (a2-4 (-> obj extra perm aid)) - (a3-3 (-> obj extra perm task)) - (t0-3 (-> obj extra level nickname)) + (a2-4 (-> this extra perm aid)) + (a3-3 (-> this extra perm task)) + (t0-3 (-> this extra level nickname)) ) (set! t0-3 (cond (t0-3 @@ -554,17 +554,17 @@ t0-3 ) (else - (-> obj extra level name) + (-> this extra level name) ) ) ) - (t9-4 a0-5 a1-5 a2-4 a3-3 t0-3 (-> obj extra perm status)) + (t9-4 a0-5 a1-5 a2-4 a3-3 t0-3 (-> this extra perm status)) ) (if (= arg0 'entity-meters) - (format #t " :trans ~14m ~14m ~14m " (-> obj extra trans x) (-> obj extra trans y) (-> obj extra trans z)) - (format #t " :trans ~14f ~14f ~14f " (-> obj extra trans x) (-> obj extra trans y) (-> obj extra trans z)) + (format #t " :trans ~14m ~14m ~14m " (-> this extra trans x) (-> this extra trans y) (-> this extra trans z)) + (format #t " :trans ~14f ~14f ~14f " (-> this extra trans x) (-> this extra trans y) (-> this extra trans z)) ) - (let* ((s3-2 (-> obj extra process)) + (let* ((s3-2 (-> this extra process)) (s4-2 (if (type? s3-2 process-drawable) s3-2 ) @@ -573,28 +573,28 @@ (format #t ":pr #x~8X ~-12S ~-21S ~-5S/~-5S " - (if (-> obj extra process) - (-> obj extra process) + (if (-> this extra process) + (-> this extra process) 0 ) - (if (-> obj extra process) - (-> obj extra process name) + (if (-> this extra process) + (-> this extra process name) "" ) - (if (and (-> obj extra process) (-> obj extra process state)) - (-> obj extra process state name) + (if (and (-> this extra process) (-> this extra process state)) + (-> this extra process state name) "" ) - (if (-> obj extra process) - (* (- (-> obj extra process allocated-length) - (&- (-> obj extra process heap-top) (the-as uint (-> obj extra process heap-cur))) + (if (-> this extra process) + (* (- (-> this extra process allocated-length) + (&- (-> this extra process heap-top) (the-as uint (-> this extra process heap-cur))) ) 8 ) "" ) - (if (-> obj extra process) - (* (-> obj extra process allocated-length) 8) + (if (-> this extra process) + (* (-> this extra process allocated-length) 8) "" ) ) @@ -602,14 +602,14 @@ ) (format #t "~%") (if (= arg0 'entity-perm) - (format #t " ~`entity-perm`P~%" (-> obj extra perm)) + (format #t " ~`entity-perm`P~%" (-> this extra perm)) ) ) ) (none) ) -(defmethod debug-print-entities level-group ((obj level-group) (arg0 symbol) (arg1 type)) +(defmethod debug-print-entities level-group ((this level-group) (arg0 symbol) (arg1 type)) (let ((t9-0 format) (a0-1 #t) (a1-1 @@ -621,8 +621,8 @@ 0 (t9-0 a0-1 a1-1) ) - (dotimes (s3-0 (-> obj length)) - (let ((s2-0 (-> obj level s3-0))) + (dotimes (s3-0 (-> this length)) + (let ((s2-0 (-> this level s3-0))) (when (= (-> s2-0 status) 'active) (case arg0 (('art-group) @@ -647,12 +647,12 @@ ) ;; WARN: Return type mismatch entity-actor vs none. -(defmethod add-to-level! entity-actor ((obj entity-actor) (arg0 level-group) (arg1 level) (arg2 actor-id)) +(defmethod add-to-level! entity-actor ((this entity-actor) (arg0 level-group) (arg1 level) (arg2 actor-id)) (let ((v1-4 (-> arg1 entity data (-> arg1 entity length)))) (+! (-> arg1 entity length) 1) (set! (-> v1-4 process) #f) - (set! (-> v1-4 entity) obj) - (set! (-> obj extra) v1-4) + (set! (-> v1-4 entity) this) + (set! (-> this extra) v1-4) (cond ((-> arg0 entity-link) (let* ((a0-6 (-> arg0 entity-link)) @@ -670,12 +670,12 @@ ) ) (set! (-> arg0 entity-link) v1-4) - (set! (-> v1-4 trans quad) (-> obj trans quad)) + (set! (-> v1-4 trans quad) (-> this trans quad)) ) - (set! (-> obj extra perm aid) arg2) - (set! (-> obj extra level) arg1) - (set! (-> obj extra kill-mask) - (logior (logand (-> obj kill-mask) + (set! (-> this extra perm aid) arg2) + (set! (-> this extra level) arg1) + (set! (-> this extra kill-mask) + (logior (logand (-> this kill-mask) (task-mask task0 task1 @@ -697,29 +697,29 @@ ) (logclear (task-mask movie0 movie1 movie2 tm19 tm20 tm21 tm22 tm23 tm24 tm25 tm26 tm27 tm28 tm29 tm30 tm31) - (-> obj kill-mask) + (-> this kill-mask) ) ) ) (if (not (-> arg1 vis-info 0)) - (set! (-> obj extra vis-dist) (res-lump-float obj 'vis-dist :default 40960000.0)) + (set! (-> this extra vis-dist) (res-lump-float this 'vis-dist :default 40960000.0)) ) (cond - ((= (-> obj type) entity-actor) - (set! (-> obj extra perm task) (-> obj task)) - (set! (-> obj extra vis-id) (-> obj vis-id)) + ((= (-> this type) entity-actor) + (set! (-> this extra perm task) (-> this task)) + (set! (-> this extra vis-id) (-> this vis-id)) ) (else - (set! (-> obj extra perm task) (game-task none)) - (set! (-> obj extra vis-id) 0) + (set! (-> this extra perm task) (game-task none)) + (set! (-> this extra vis-id) 0) 0 ) ) (none) ) -(defmethod remove-from-level! entity ((obj entity) (arg0 level-group)) - (let ((v1-0 (-> obj extra))) +(defmethod remove-from-level! entity ((this entity) (arg0 level-group)) + (let ((v1-0 (-> this extra))) (cond ((= (-> v1-0 next-link) v1-0) (set! (-> arg0 entity-link) #f) @@ -733,7 +733,7 @@ ) ) ) - obj + this ) (defun update-actor-vis-box ((arg0 process-drawable) (arg1 vector) (arg2 vector)) @@ -753,10 +753,10 @@ (none) ) -(defmethod update-vis-volumes level-group ((obj level-group)) +(defmethod update-vis-volumes level-group ((this level-group)) (local-vars (sv-16 pointer) (sv-20 pointer) (sv-24 pointer) (sv-28 process)) - (dotimes (s5-0 (-> obj length)) - (let ((v1-3 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-3 (-> this level s5-0))) (when (= (-> v1-3 status) 'active) (let ((s4-0 (-> v1-3 bsp level entity))) (dotimes (s3-0 (-> s4-0 length)) @@ -811,7 +811,7 @@ (none) ) -(defmethod update-vis-volumes-from-nav-mesh level-group ((obj level-group)) +(defmethod update-vis-volumes-from-nav-mesh level-group ((this level-group)) (local-vars (sv-16 pointer) (sv-20 vector) @@ -824,8 +824,8 @@ (sv-96 vector) (sv-112 vector) ) - (dotimes (s5-0 (-> obj length)) - (let ((v1-3 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-3 (-> this level s5-0))) (when (= (-> v1-3 status) 'active) (let ((s4-0 (-> v1-3 bsp level entity))) (dotimes (s3-0 (-> s4-0 length)) @@ -908,7 +908,7 @@ (none) ) -(defmethod print-volume-sizes level-group ((obj level-group)) +(defmethod print-volume-sizes level-group ((this level-group)) (local-vars (sv-16 pointer) (sv-20 float) @@ -921,8 +921,8 @@ (sv-80 structure) ) (let ((s5-0 0)) - (dotimes (v1-0 (-> obj length)) - (let ((a0-4 (-> obj level v1-0))) + (dotimes (v1-0 (-> this length)) + (let ((a0-4 (-> this level v1-0))) (if (= (-> a0-4 status) 'active) (+! s5-0 (-> a0-4 entity length)) ) @@ -934,8 +934,8 @@ (let ((s2-0 (the-as structure #f)) (s3-0 (the-as entity #f)) ) - (dotimes (s1-0 (-> obj length)) - (let ((v1-7 (-> obj level s1-0))) + (dotimes (s1-0 (-> this length)) + (let ((v1-7 (-> this level s1-0))) (when (= (-> v1-7 status) 'active) (let ((s0-0 (-> v1-7 entity))) (set! sv-48 (-> s0-0 length)) @@ -1193,7 +1193,7 @@ (none) ) -(defmethod debug-draw-actors level-group ((obj level-group) (arg0 symbol)) +(defmethod debug-draw-actors level-group ((this level-group) (arg0 symbol)) (local-vars (sv-16 symbol) (sv-20 vector) @@ -1232,8 +1232,8 @@ ) ) (else - (dotimes (s5-2 (-> obj length)) - (let ((v1-25 (-> obj level s5-2))) + (dotimes (s5-2 (-> this length)) + (let ((v1-25 (-> this level s5-2))) (when (= (-> v1-25 status) 'active) (let ((s4-1 (-> v1-25 bsp level entity))) (dotimes (s3-0 (-> s4-1 length)) @@ -1273,8 +1273,8 @@ ) (when (and *display-actor-vis* (not *debug-actor*)) (let ((s5-3 *display-actor-vis*)) - (dotimes (s4-2 (-> obj length)) - (let ((s3-1 (-> obj level s4-2))) + (dotimes (s4-2 (-> this length)) + (let ((s3-1 (-> this level s4-2))) (when (= (-> s3-1 status) 'active) (let ((s2-1 (-> s3-1 bsp level entity))) (dotimes (s1-1 (-> s2-1 length)) @@ -1328,7 +1328,7 @@ ) ) (if *generate-actor-vis* - (update-vis-volumes obj) + (update-vis-volumes this) ) (cond (*debug-actor* @@ -1407,8 +1407,8 @@ ) ) (*display-nav-mesh* - (dotimes (s5-5 (-> obj length)) - (let ((v1-145 (-> obj level s5-5))) + (dotimes (s5-5 (-> this length)) + (let ((v1-145 (-> this level s5-5))) (when (= (-> v1-145 status) 'active) (let ((s4-5 (-> v1-145 bsp nav-meshes))) (when (nonzero? s4-5) @@ -1427,8 +1427,8 @@ ) (else (when *display-nav-marks* - (dotimes (s5-6 (-> obj length)) - (let ((v1-163 (-> obj level s5-6))) + (dotimes (s5-6 (-> this length)) + (let ((v1-163 (-> this level s5-6))) (when (= (-> v1-163 status) 'active) (let ((s4-6 (-> v1-163 bsp nav-meshes))) (when (nonzero? s4-6) @@ -1508,8 +1508,8 @@ ) ) (when *display-split-boxes* - (dotimes (s5-7 (-> obj length)) - (let ((v1-193 (-> obj level s5-7))) + (dotimes (s5-7 (-> this length)) + (let ((v1-193 (-> this level s5-7))) (when (= (-> v1-193 status) 'active) (let ((s4-7 (-> v1-193 bsp region-tree))) (when (nonzero? s4-7) @@ -1532,8 +1532,8 @@ ) ) (when *display-region-marks* - (dotimes (s5-8 (-> obj length)) - (let ((s4-8 (-> obj level s5-8))) + (dotimes (s5-8 (-> this length)) + (let ((s4-8 (-> this level s5-8))) (when (= (-> s4-8 status) 'active) (when (nonzero? (-> s4-8 bsp region-trees)) (let* ((s3-5 (-> s4-8 bsp region-trees length)) @@ -1571,14 +1571,14 @@ (none) ) -(defmethod birth! entity-camera ((obj entity-camera)) - (add-connection *camera-engine* *camera* nothing obj #f #f) - obj +(defmethod birth! entity-camera ((this entity-camera)) + (add-connection *camera-engine* *camera* nothing this #f #f) + this ) -(defmethod kill! entity-camera ((obj entity-camera)) - (remove-by-param1 *camera-engine* (the-as int obj)) - obj +(defmethod kill! entity-camera ((this entity-camera)) + (remove-by-param1 *camera-engine* (the-as int this)) + this ) ;; WARN: Return type mismatch process vs none. @@ -1591,8 +1591,8 @@ (none) ) -(defmethod birth! entity-actor ((obj entity-actor)) - (let* ((s5-0 (-> obj etype)) +(defmethod birth! entity-actor ((this entity-actor)) + (let* ((s5-0 (-> this etype)) (v1-0 (entity-info-lookup s5-0)) (s4-0 (get-process *default-dead-pool* s5-0 (if v1-0 (-> v1-0 heap-size) @@ -1611,17 +1611,17 @@ (valid? (method-of-object s4-0 init-from-entity!) function (the-as string #f) #f 0) ) ) - (init-entity s4-0 obj s5-0) + (init-entity s4-0 this s5-0) ) (else - (when (not (birth-viewer s4-0 obj)) - (format 0 "ERROR: no proper process type named ~A exists in the code, could not start ~A~%" s5-0 obj) - (logior! (-> obj extra perm status) (entity-perm-status bit-0)) + (when (not (birth-viewer s4-0 this)) + (format 0 "ERROR: no proper process type named ~A exists in the code, could not start ~A~%" s5-0 this) + (logior! (-> this extra perm status) (entity-perm-status bit-0)) ) ) ) ) - obj + this ) ;; WARN: Return type mismatch symbol vs none. @@ -1633,63 +1633,63 @@ (none) ) -(defmethod kill! entity-actor ((obj entity-actor)) - (let ((a0-1 (-> obj extra process))) +(defmethod kill! entity-actor ((this entity-actor)) + (let ((a0-1 (-> this extra process))) (if a0-1 (deactivate a0-1) - (entity-deactivate-handler a0-1 obj) + (entity-deactivate-handler a0-1 this) ) ) - obj + this ) ;; WARN: Return type mismatch bsp-header vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s5, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod birth bsp-header ((obj bsp-header)) +(defmethod birth bsp-header ((this bsp-header)) (local-vars (v1-74 int) (s5-0 int) (sv-16 int)) (.mfc0 s5-0 Count) - (let ((a2-0 (if (nonzero? (-> obj actors)) - (-> obj actors length) + (let ((a2-0 (if (nonzero? (-> this actors)) + (-> this actors length) 0 ) ) ) (cond - ((not (-> obj level entity)) - (set! (-> obj level entity) (new 'loading-level 'entity-links-array a2-0)) + ((not (-> this level entity)) + (set! (-> this level entity) (new 'loading-level 'entity-links-array a2-0)) ) - ((< (-> obj level entity allocated-length) a2-0) + ((< (-> this level entity allocated-length) a2-0) (format 0 "ERROR: Attempting to rebirth level ~A with incorrect entity table size ~D/~D~%" - (-> obj level) + (-> this level) a2-0 - (-> obj level entity allocated-length) + (-> this level entity allocated-length) ) ) ) ) - (set! (-> obj level entity length) 0) + (set! (-> this level entity length) 0) 0 - (when (nonzero? (-> obj actors)) - (dotimes (s4-0 (-> obj actors length)) - (let* ((a0-4 (-> obj actor-birth-order s4-0)) - (v1-23 (-> obj actors data (logand a0-4 #xffff) actor)) + (when (nonzero? (-> this actors)) + (dotimes (s4-0 (-> this actors length)) + (let* ((a0-4 (-> this actor-birth-order s4-0)) + (v1-23 (-> this actors data (logand a0-4 #xffff) actor)) ) - (add-to-level! v1-23 *level* (-> obj level) (the-as actor-id (-> v1-23 aid))) + (add-to-level! v1-23 *level* (-> this level) (the-as actor-id (-> v1-23 aid))) ) ) ) - (let ((s4-1 (-> obj cameras))) + (let ((s4-1 (-> this cameras))) (when (nonzero? s4-1) (dotimes (s3-0 (-> s4-1 length)) (birth! (-> s4-1 s3-0)) ) ) ) - (let ((s4-2 (-> obj level status))) - (set! (-> obj level status) 'active) + (let ((s4-2 (-> this level status))) + (set! (-> this level status) 'active) (dotimes (s3-1 (-> *level* length)) (let ((s2-0 (-> *level* level s3-1))) (when (= (-> s2-0 status) 'active) @@ -1709,7 +1709,7 @@ ) ) ) - (set! (-> obj level status) s4-2) + (set! (-> this level status) s4-2) ) (.mfc0 v1-74 Count) (let ((a3-2 (- v1-74 s5-0))) @@ -1823,13 +1823,13 @@ ) ;; WARN: Return type mismatch bsp-header vs none. -(defmethod deactivate-entities bsp-header ((obj bsp-header)) - (let ((v1-1 (-> obj level heap base)) - (a0-2 (-> obj level heap top-base)) +(defmethod deactivate-entities bsp-header ((this bsp-header)) + (let ((v1-1 (-> this level heap base)) + (a0-2 (-> this level heap top-base)) ) - (when (nonzero? (-> obj actor-groups)) - (dotimes (a1-2 (-> obj actor-groups length)) - (let ((a2-2 (-> obj actor-groups a1-2))) + (when (nonzero? (-> this actor-groups)) + (dotimes (a1-2 (-> this actor-groups length)) + (let ((a2-2 (-> this actor-groups a1-2))) (dotimes (a3-1 (-> a2-2 length)) (let ((t0-2 (-> a2-2 data a3-1 actor))) (if (and t0-2 (not (and (>= (the-as int t0-2) (the-as int v1-1)) (< (the-as int t0-2) (the-as int a0-2))))) @@ -1843,7 +1843,7 @@ (dotimes (a1-5 (-> *level* length)) (let ((a2-10 (-> *level* level a1-5))) (when (= (-> a2-10 status) 'active) - (when (!= a2-10 (-> obj level)) + (when (!= a2-10 (-> this level)) (when (nonzero? (-> a2-10 bsp actor-groups)) (dotimes (a3-10 (-> a2-10 bsp actor-groups length)) (let ((t0-13 (-> a2-10 bsp actor-groups a3-10))) @@ -1862,7 +1862,7 @@ ) ) ) - (let ((s5-0 (-> obj actors))) + (let ((s5-0 (-> this actors))) (when (nonzero? s5-0) (dotimes (s4-0 (-> s5-0 length)) (let ((s3-0 (-> s5-0 data s4-0 actor))) @@ -1872,15 +1872,15 @@ ) ) ) - (let ((s5-1 (-> obj cameras))) + (let ((s5-1 (-> this cameras))) (when (nonzero? s5-1) (dotimes (s4-1 (-> s5-1 length)) (kill! (-> s5-1 s4-1)) ) ) ) - (let ((v1-23 (-> obj level heap base)) - (a0-7 (-> obj level heap top-base)) + (let ((v1-23 (-> this level heap base)) + (a0-7 (-> this level heap top-base)) (s5-2 (lambda ((arg0 process)) (check-for-rougue-process arg0 (-> *kernel-context* relocating-min) @@ -1892,12 +1892,12 @@ ) (set! (-> *kernel-context* relocating-min) (the-as int v1-23)) (set! (-> *kernel-context* relocating-max) (the-as int a0-7)) - (set! (-> *kernel-context* relocating-level) (-> obj level)) + (set! (-> *kernel-context* relocating-level) (-> this level)) (iterate-process-tree *pusher-pool* s5-2 *null-kernel-context*) (iterate-process-tree *entity-pool* s5-2 *null-kernel-context*) (iterate-process-tree *default-pool* s5-2 *null-kernel-context*) ) - (let ((s5-3 (-> obj nav-meshes))) + (let ((s5-3 (-> this nav-meshes))) (when (nonzero? s5-3) (dotimes (s4-2 (-> s5-3 length)) (kill! (-> s5-3 s4-2)) @@ -1927,13 +1927,13 @@ (none) ) -(defmethod update entity-perm ((obj entity-perm) (arg0 symbol) (arg1 entity-perm-status)) +(defmethod update entity-perm ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) (cond ((= arg0 'game) - (logclear! (-> obj status) arg1) + (logclear! (-> this status) arg1) ) - ((task-complete? *game-info* (-> obj task)) - (logclear! (-> obj status) (logior (if (logtest? (-> obj status) (entity-perm-status bit-4)) + ((task-complete? *game-info* (-> this task)) + (logclear! (-> this status) (logior (if (logtest? (-> this status) (entity-perm-status bit-4)) 524 0 ) @@ -1942,7 +1942,7 @@ ) ) (else - (logclear! (-> obj status) (logior arg1 (if (logtest? (-> obj status) (entity-perm-status bit-4)) + (logclear! (-> this status) (logior arg1 (if (logtest? (-> this status) (entity-perm-status bit-4)) 524 0 ) @@ -1950,11 +1950,11 @@ ) ) ) - (when (not (logtest? (-> obj status) (entity-perm-status bit-5))) - (set! (-> obj user-uint64) (the-as uint 0)) + (when (not (logtest? (-> this status) (entity-perm-status bit-5))) + (set! (-> this user-uint64) (the-as uint 0)) 0 ) - obj + this ) (defun reset-actors ((arg0 symbol)) @@ -2058,20 +2058,20 @@ (none) ) -(defmethod run-logic? process-drawable ((obj process-drawable)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) +(defmethod run-logic? process-drawable ((this process-drawable)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-control-status uninited))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) ) ) ) -(defmethod birth? entity-links ((obj entity-links) (arg0 vector)) - (and (not (logtest? (-> obj perm status) (entity-perm-status bit-0 dead))) - (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) +(defmethod birth? entity-links ((this entity-links) (arg0 vector)) + (and (not (logtest? (-> this perm status) (entity-perm-status bit-0 dead))) + (< (vector-vector-distance (-> this trans) arg0) (-> *ACTOR-bank* birth-dist)) ) ) @@ -2080,7 +2080,7 @@ ;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 ;; WARN: Function (method 17 level-group) has a return type of none, but the expression builder found a return statement. -(defmethod actors-update level-group ((obj level-group)) +(defmethod actors-update level-group ((this level-group)) (local-vars (sv-16 vector) (sv-24 int) @@ -2126,8 +2126,8 @@ ) ) (set! sv-24 0) - (dotimes (s5-2 (-> obj length)) - (let ((s4-1 (-> obj level s5-2))) + (dotimes (s5-2 (-> this length)) + (let ((s4-1 (-> this level s5-2))) (when (= (-> s4-1 status) 'active) (set! sv-32 (-> s4-1 task-mask)) (cond @@ -2331,8 +2331,8 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod toggle-status entity-actor ((obj entity-actor) (arg0 entity-perm-status) (arg1 symbol)) - (let ((v1-0 (-> obj extra))) +(defmethod toggle-status entity-actor ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) + (let ((v1-0 (-> this extra))) (if arg1 (logior! (-> v1-0 perm status) arg0) (logclear! (-> v1-0 perm status) arg0) diff --git a/goal_src/jak2/engine/entity/relocate.gc b/goal_src/jak2/engine/entity/relocate.gc index 5bbd452036..721d0e540a 100644 --- a/goal_src/jak2/engine/entity/relocate.gc +++ b/goal_src/jak2/engine/entity/relocate.gc @@ -7,22 +7,22 @@ ;; DECOMP BEGINS -(defmethod relocate process ((obj process) (arg0 int)) +(defmethod relocate process ((this process) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (&+! (-> obj ppointer 0) arg0) - (let ((v1-5 (-> obj entity))) - (if (and v1-5 (= (-> v1-5 extra process) obj)) + (&+! (-> this ppointer 0) arg0) + (let ((v1-5 (-> this entity))) + (if (and v1-5 (= (-> v1-5 extra process) this)) (&+! (-> v1-5 extra process) arg0) ) ) - (let ((v1-7 (-> obj connection-list next1))) + (let ((v1-7 (-> this connection-list next1))) (while (the-as connection v1-7) (let ((a0-14 (-> v1-7 prev1))) (if (and (>= (the-as int a0-14) (-> *kernel-context* relocating-min)) @@ -51,37 +51,37 @@ (set! v1-7 (-> (the-as connection v1-7) next1)) ) ) - (let ((v1-10 (-> obj self))) + (let ((v1-10 (-> this self))) (if (and (>= (the-as int v1-10) (-> *kernel-context* relocating-min)) (< (the-as int v1-10) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj self) arg0) + (&+! (-> this self) arg0) ) ) - (let ((v1-15 (-> obj ppointer))) + (let ((v1-15 (-> this ppointer))) (if (and (>= (the-as int v1-15) (-> *kernel-context* relocating-min)) (< (the-as int v1-15) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj ppointer) arg0) + (&+! (-> this ppointer) arg0) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Don't remove this cast ;;;;;;;;;;;;;;;;;;;;;;;;;;; - (let ((s4-0 (the-as basic (&+ (-> obj heap-base) 4)))) - (while (< (the-as int s4-0) (the-as int (-> obj heap-cur))) + (let ((s4-0 (the-as basic (&+ (-> this heap-base) 4)))) + (while (< (the-as int s4-0) (the-as int (-> this heap-cur))) (relocate s4-0 arg0) (&+! s4-0 (logand -16 (+ (asize-of s4-0) 15))) ) ) - (&+! (-> obj main-thread) arg0) - (&+! (-> obj top-thread) arg0) - (&+! (-> obj heap-base) arg0) - (&+! (-> obj heap-cur) arg0) - (&+! (-> obj heap-top) arg0) - (let ((a2-4 (asize-of obj)) - (a1-22 (&-> obj type)) + (&+! (-> this main-thread) arg0) + (&+! (-> this top-thread) arg0) + (&+! (-> this heap-base) arg0) + (&+! (-> this heap-cur) arg0) + (&+! (-> this heap-top) arg0) + (let ((a2-4 (asize-of this)) + (a1-22 (&-> this type)) ) (cond ((>= arg0 0) @@ -96,140 +96,140 @@ ) ) (set! (-> *kernel-context* relocating-process) #f) - (&+ obj arg0) + (&+ this arg0) ) -(defmethod relocate cpu-thread ((obj cpu-thread) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate cpu-thread ((this cpu-thread) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; WARN: Return type mismatch process vs process-drawable. -(defmethod relocate process-drawable ((obj process-drawable) (arg0 int)) +(defmethod relocate process-drawable ((this process-drawable) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (let ((a0-6 (-> obj nav))) + (let ((a0-6 (-> this nav))) (if (and (nonzero? a0-6) a0-6) (relocate a0-6 arg0) ) ) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj node-list)) - (&+! (-> obj node-list) arg0) + (if (nonzero? (-> this node-list)) + (&+! (-> this node-list) arg0) ) - (if (nonzero? (-> obj draw)) - (&+! (-> obj draw) arg0) + (if (nonzero? (-> this draw)) + (&+! (-> this draw) arg0) ) - (if (nonzero? (-> obj skel)) - (&+! (-> obj skel) arg0) + (if (nonzero? (-> this skel)) + (&+! (-> this skel) arg0) ) - (if (nonzero? (-> obj align)) - (&+! (-> obj align) arg0) + (if (nonzero? (-> this align)) + (&+! (-> this align) arg0) ) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - (if (nonzero? (-> obj vol)) - (&+! (-> obj vol) arg0) + (if (nonzero? (-> this vol)) + (&+! (-> this vol) arg0) ) - (if (nonzero? (-> obj fact)) - (&+! (-> obj fact) arg0) + (if (nonzero? (-> this fact)) + (&+! (-> this fact) arg0) ) - (if (nonzero? (-> obj link)) - (&+! (-> obj link) arg0) + (if (nonzero? (-> this link)) + (&+! (-> this link) arg0) ) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (if (nonzero? (-> obj water)) - (&+! (-> obj water) arg0) + (if (nonzero? (-> this water)) + (&+! (-> this water) arg0) ) - (if (nonzero? (-> obj sound)) - (&+! (-> obj sound) arg0) + (if (nonzero? (-> this sound)) + (&+! (-> this sound) arg0) ) - (if (nonzero? (-> obj carry)) - (&+! (-> obj carry) arg0) + (if (nonzero? (-> this carry)) + (&+! (-> this carry) arg0) ) - (if (nonzero? (-> obj rbody)) - (&+! (-> obj rbody) arg0) + (if (nonzero? (-> this rbody)) + (&+! (-> this rbody) arg0) ) - (the-as process-drawable ((method-of-type process relocate) obj arg0)) + (the-as process-drawable ((method-of-type process relocate) this arg0)) ) -(defmethod relocate collide-shape ((obj collide-shape) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj root-prim) arg0) - obj +(defmethod relocate collide-shape ((this collide-shape) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this root-prim) arg0) + this ) ;; WARN: Return type mismatch collide-shape vs collide-shape-moving. -(defmethod relocate collide-shape-moving ((obj collide-shape-moving) (arg0 int)) - (if (-> obj dynam) - (&+! (-> obj dynam) arg0) +(defmethod relocate collide-shape-moving ((this collide-shape-moving) (arg0 int)) + (if (-> this dynam) + (&+! (-> this dynam) arg0) ) - (the-as collide-shape-moving ((method-of-type collide-shape relocate) obj arg0)) + (the-as collide-shape-moving ((method-of-type collide-shape relocate) this arg0)) ) -(defmethod relocate collide-shape-prim ((obj collide-shape-prim) (arg0 int)) - (&+! (-> obj cshape) arg0) - obj +(defmethod relocate collide-shape-prim ((this collide-shape-prim) (arg0 int)) + (&+! (-> this cshape) arg0) + this ) -(defmethod relocate collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 int)) - (&+! (-> obj cshape) arg0) - (set! (-> obj child) (the-as (inline-array collide-shape-prim) (&+ (the-as pointer (-> obj child)) arg0))) - obj +(defmethod relocate collide-shape-prim-group ((this collide-shape-prim-group) (arg0 int)) + (&+! (-> this cshape) arg0) + (set! (-> this child) (the-as (inline-array collide-shape-prim) (&+ (the-as pointer (-> this child)) arg0))) + this ) -(defmethod relocate fact-info ((obj fact-info) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate fact-info ((this fact-info) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate draw-control ((obj draw-control) (arg0 int)) - (&+! (-> obj skeleton) arg0) - (&+! (-> obj process) arg0) - (when (-> obj ripple) - (if (-> obj ripple query) - (&+! (-> obj ripple query) arg0) +(defmethod relocate draw-control ((this draw-control) (arg0 int)) + (&+! (-> this skeleton) arg0) + (&+! (-> this process) arg0) + (when (-> this ripple) + (if (-> this ripple query) + (&+! (-> this ripple query) arg0) ) - (&+! (-> obj ripple) arg0) + (&+! (-> this ripple) arg0) ) - (let ((v1-14 (-> obj shadow-ctrl))) + (let ((v1-14 (-> this shadow-ctrl))) (if (and (>= (the-as int v1-14) (-> *kernel-context* relocating-min)) (< (the-as int v1-14) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj shadow-ctrl) arg0) + (&+! (-> this shadow-ctrl) arg0) ) ) - obj + this ) -(defmethod relocate joint-control ((obj joint-control) (arg0 int)) - (if (-> obj effect) - (&+! (-> obj effect) arg0) +(defmethod relocate joint-control ((this joint-control) (arg0 int)) + (if (-> this effect) + (&+! (-> this effect) arg0) ) - (if (-> obj top-anim) - (&+! (-> obj top-anim) arg0) + (if (-> this top-anim) + (&+! (-> this top-anim) arg0) ) - (&+! (-> obj root-channel) arg0) - (countdown (v1-10 (-> obj allocated-length)) - (&+! (-> obj channel v1-10 parent) arg0) + (&+! (-> this root-channel) arg0) + (countdown (v1-10 (-> this allocated-length)) + (&+! (-> this channel v1-10 parent) arg0) ) - obj + this ) -(defmethod relocate cspace-array ((obj cspace-array) (arg0 int)) - (countdown (v1-0 (-> obj length)) - (let ((a2-2 (-> obj data v1-0))) +(defmethod relocate cspace-array ((this cspace-array) (arg0 int)) + (countdown (v1-0 (-> this length)) + (let ((a2-2 (-> this data v1-0))) (if (-> a2-2 parent) (&+! (-> a2-2 parent) arg0) ) @@ -250,59 +250,59 @@ ) ) ) - obj + this ) -(defmethod relocate path-control ((obj path-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate path-control ((this path-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate vol-control ((obj vol-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate vol-control ((this vol-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate water-control ((obj water-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate water-control ((this water-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate actor-link-info ((obj actor-link-info) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate actor-link-info ((this actor-link-info) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate align-control ((obj align-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate align-control ((this align-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate joint-mod ((obj joint-mod) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj joint) arg0) - obj +(defmethod relocate joint-mod ((this joint-mod) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this joint) arg0) + this ) -(defmethod relocate joint-mod-wheel ((obj joint-mod-wheel) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate joint-mod-wheel ((this joint-mod-wheel) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate joint-mod-ik ((obj joint-mod-ik) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate joint-mod-ik ((this joint-mod-ik) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate effect-control ((obj effect-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate effect-control ((this effect-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod relocate sparticle-launch-control ((obj sparticle-launch-control) (arg0 int)) - (&+! (-> obj proc) arg0) - (countdown (v1-2 (-> obj length)) - (let* ((a0-4 (-> obj data v1-2)) +(defmethod relocate sparticle-launch-control ((this sparticle-launch-control) (arg0 int)) + (&+! (-> this proc) arg0) + (countdown (v1-2 (-> this length)) + (let* ((a0-4 (-> this data v1-2)) (a2-0 (-> a0-4 center)) ) (if (and (>= (the-as int a2-0) (-> *kernel-context* relocating-min)) @@ -313,7 +313,7 @@ ) ) (forall-particles-with-key - obj + this (lambda ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (let ((v1-1 (-> *kernel-context* relocating-offset))) (set! (-> arg1 key) (the-as sparticle-launch-control (+ (the-as int (-> arg1 key)) v1-1))) @@ -327,80 +327,80 @@ #t #t ) - obj + this ) ;; WARN: Return type mismatch process vs camera-master. -(defmethod relocate camera-master ((obj camera-master) (arg0 int)) - (if (nonzero? (-> obj water-drip)) - (&+! (-> obj water-drip) arg0) +(defmethod relocate camera-master ((this camera-master) (arg0 int)) + (if (nonzero? (-> this water-drip)) + (&+! (-> this water-drip) arg0) ) - (the-as camera-master ((method-of-type process relocate) obj arg0)) + (the-as camera-master ((method-of-type process relocate) this arg0)) ) ;; WARN: Return type mismatch process vs time-of-day-proc. -(defmethod relocate time-of-day-proc ((obj time-of-day-proc) (arg0 int)) - (if (nonzero? (-> obj sun)) - (&+! (-> obj sun) arg0) +(defmethod relocate time-of-day-proc ((this time-of-day-proc) (arg0 int)) + (if (nonzero? (-> this sun)) + (&+! (-> this sun) arg0) ) - (if (nonzero? (-> obj green-sun)) - (&+! (-> obj green-sun) arg0) + (if (nonzero? (-> this green-sun)) + (&+! (-> this green-sun) arg0) ) - (if (nonzero? (-> obj moon)) - (&+! (-> obj moon) arg0) + (if (nonzero? (-> this moon)) + (&+! (-> this moon) arg0) ) - (the-as time-of-day-proc ((method-of-type process relocate) obj arg0)) + (the-as time-of-day-proc ((method-of-type process relocate) this arg0)) ) ;; WARN: Return type mismatch process vs part-tracker. -(defmethod relocate part-tracker ((obj part-tracker) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate part-tracker ((this part-tracker) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (the-as part-tracker ((method-of-type process relocate) obj arg0)) + (the-as part-tracker ((method-of-type process relocate) this arg0)) ) ;; WARN: Return type mismatch process vs part-spawner. -(defmethod relocate part-spawner ((obj part-spawner) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate part-spawner ((this part-spawner) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (if (nonzero? (-> obj sound)) - (&+! (-> obj sound) arg0) + (if (nonzero? (-> this sound)) + (&+! (-> this sound) arg0) ) - (the-as part-spawner ((method-of-type process relocate) obj arg0)) + (the-as part-spawner ((method-of-type process relocate) this arg0)) ) ;; WARN: Return type mismatch process vs lightning-tracker. -(defmethod relocate lightning-tracker ((obj lightning-tracker) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate lightning-tracker ((this lightning-tracker) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj lightning)) - (&+! (-> obj lightning) arg0) + (if (nonzero? (-> this lightning)) + (&+! (-> this lightning) arg0) ) - (the-as lightning-tracker ((method-of-type process relocate) obj arg0)) + (the-as lightning-tracker ((method-of-type process relocate) this arg0)) ) ;; WARN: Return type mismatch process-drawable vs manipy. -(defmethod relocate manipy ((obj manipy) (arg0 int)) - (if (nonzero? (-> obj joint 0)) - (&+! (-> obj joint 0) arg0) +(defmethod relocate manipy ((this manipy) (arg0 int)) + (if (nonzero? (-> this joint 0)) + (&+! (-> this joint 0) arg0) ) - (if (nonzero? (-> obj joint 1)) - (&+! (-> obj joint 1) arg0) + (if (nonzero? (-> this joint 1)) + (&+! (-> this joint 1) arg0) ) - (if (nonzero? (-> obj joint 2)) - (&+! (-> obj joint 2) arg0) + (if (nonzero? (-> this joint 2)) + (&+! (-> this joint 2) arg0) ) - (if (nonzero? (-> obj joint 3)) - (&+! (-> obj joint 3) arg0) + (if (nonzero? (-> this joint 3)) + (&+! (-> this joint 3) arg0) ) - (the-as manipy ((method-of-type process-drawable relocate) obj arg0)) + (the-as manipy ((method-of-type process-drawable relocate) this arg0)) ) diff --git a/goal_src/jak2/engine/entity/res-h.gc b/goal_src/jak2/engine/entity/res-h.gc index 23c895db3d..5e9e989075 100644 --- a/goal_src/jak2/engine/entity/res-h.gc +++ b/goal_src/jak2/engine/entity/res-h.gc @@ -63,5 +63,5 @@ ) ) -(define *res-key-string* (new 'global 'string 64 (the-as string #f))) +(define *res-key-string* (new 'global 'string 64 (the-as string #f))) diff --git a/goal_src/jak2/engine/entity/res.gc b/goal_src/jak2/engine/entity/res.gc index 7b2727450d..5c699f5bf4 100644 --- a/goal_src/jak2/engine/entity/res.gc +++ b/goal_src/jak2/engine/entity/res.gc @@ -41,46 +41,46 @@ This is updated from the entity system used in Crash 2, which had most of these `(zero? (-> ,tag inlined?)) ) -(defmethod print res-tag ((obj res-tag)) +(defmethod print res-tag ((this res-tag)) "print a res-tag." - (if (res-ref? obj) + (if (res-ref? this) (format #t "#" - (-> obj name) - (-> obj key-frame) - (-> obj elt-type) - (-> obj elt-count) + (-> this name) + (-> this key-frame) + (-> this elt-type) + (-> this elt-count) ) (format #t "#" - (-> obj name) - (-> obj key-frame) - (-> obj elt-type) - (-> obj elt-count) + (-> this name) + (-> this key-frame) + (-> this elt-type) + (-> this elt-count) ) ) - obj + this ) -(defmethod length res-tag ((obj res-tag)) +(defmethod length res-tag ((this res-tag)) "get the length in bytes of this tag's resource." - (the-as int (if (zero? (-> obj inlined?)) - (* (-> obj elt-count) 4) - (* (-> obj elt-count) (-> obj elt-type size)) + (the-as int (if (zero? (-> this inlined?)) + (* (-> this elt-count) 4) + (* (-> this elt-count) (-> this elt-type size)) ) ) ) -(defmethod get-tag-index-data res-lump ((obj res-lump) (arg0 int)) +(defmethod get-tag-index-data res-lump ((this res-lump) (arg0 int)) "get the data address of the n'th tag." - (&+ (-> obj data-base) (-> obj tag arg0 data-offset)) + (&+ (-> this data-base) (-> this tag arg0 data-offset)) ) -(defmethod get-tag-data res-lump ((obj res-lump) (arg0 res-tag)) +(defmethod get-tag-data res-lump ((this res-lump) (arg0 res-tag)) "get the data address of the specified tag." - (&+ (-> obj data-base) (-> arg0 data-offset)) + (&+ (-> this data-base) (-> arg0 data-offset)) ) (defmethod new res-lump ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) @@ -95,42 +95,42 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod length res-lump ((obj res-lump)) +(defmethod length res-lump ((this res-lump)) "get the amount of resources in a res-lump." - (-> obj length) + (-> this length) ) -(defmethod asize-of res-lump ((obj res-lump)) +(defmethod asize-of res-lump ((this res-lump)) "get the allocated size of a res-lump." - (the-as int (+ (-> obj type psize) (* (-> obj allocated-length) 16) (-> obj data-size))) + (the-as int (+ (-> this type psize) (* (-> this allocated-length) 16) (-> this data-size))) ) -(defmethod inspect res-lump ((obj res-lump)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata-base: #x~X~%" (-> obj data-base)) - (format #t "~Tdata-top: #x~X~%" (-> obj data-top)) - (format #t "~Tdata-size: #x~X~%" (-> obj data-size)) - (format #t "~Ttag[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj tag)) - (dotimes (i (-> obj length)) +(defmethod inspect res-lump ((this res-lump)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata-base: #x~X~%" (-> this data-base)) + (format #t "~Tdata-top: #x~X~%" (-> this data-top)) + (format #t "~Tdata-size: #x~X~%" (-> this data-size)) + (format #t "~Ttag[~D]: @ #x~X~%" (-> this allocated-length) (-> this tag)) + (dotimes (i (-> this length)) (format #t "~T [~D] " i) - (print (-> (-> obj tag) i)) - (format #t " @ #x~X" (get-tag-index-data obj i)) + (print (-> (-> this tag) i)) + (format #t " @ #x~X" (get-tag-index-data this i)) (cond - ((res-ref? (-> obj tag i)) - (format #t " = ~A~%" (deref basic (get-tag-index-data obj i))) + ((res-ref? (-> this tag i)) + (format #t " = ~A~%" (deref basic (get-tag-index-data this i))) ) (else (format #t "~%") ) ) ) - obj + this ) -(defmethod lookup-tag-idx res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) +(defmethod lookup-tag-idx res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) "Look up the index of the tag containing with the given name and timestamp. Correct lookups return a res-tag-pair, which contains one tag index in the lower 32 bits and one in the upper 32 bits. Depending on the mode, they may be the same, or they may be two tags that you should interpolate @@ -154,7 +154,7 @@ This is updated from the entity system used in Crash 2, which had most of these (crash!) 0 ) - (if (or (not obj) (zero? obj) (<= (-> obj length) 0)) + (if (or (not this) (zero? this) (<= (-> this length) 0)) (return (new 'static 'res-tag-pair :lo #xffffffff :hi #xffffffff)) ) (let ((v1-14 -1) @@ -163,12 +163,12 @@ This is updated from the entity system used in Crash 2, which had most of these (let ((t1-0 -1) (t2-4 (-> (the-as (pointer uint64) (-> (symbol->string arg0) data)) 0)) ) - (let ((t3-1 (+ (-> obj length) -1)) + (let ((t3-1 (+ (-> this length) -1)) (t4-0 0) ) (while (>= t3-1 t4-0) (let* ((t5-2 (+ t4-0 (/ (- t3-1 t4-0) 2))) - (t6-5 (- t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag t5-2 name)) data)) 0))) + (t6-5 (- t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> this tag t5-2 name)) data)) 0))) ) (cond ((zero? t6-5) @@ -191,7 +191,7 @@ This is updated from the entity system used in Crash 2, which had most of these (return (the-as res-tag-pair t4-1)) ) (while (and (> t4-1 0) - (= t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag (+ t4-1 -1) name)) data)) 0)) + (= t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> this tag (+ t4-1 -1) name)) data)) 0)) ) (+! t4-1 -1) ) @@ -201,9 +201,9 @@ This is updated from the entity system used in Crash 2, which had most of these (goto cfg-73) ) (let ((t3-13 t4-1) - (t4-4 (&-> (-> obj tag) t4-1)) + (t4-4 (&-> (-> this tag) t4-1)) ) - (while (not (or (>= t3-13 (-> obj length)) + (while (not (or (>= t3-13 (-> this length)) (< t2-4 (-> (&+ (the-as (pointer uint64) (symbol->string (-> t4-4 0 name))) 4) 0)) ) ) @@ -239,7 +239,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod make-property-data res-lump ((obj res-lump) (arg0 float) (arg1 res-tag-pair) (arg2 pointer)) +(defmethod make-property-data res-lump ((this res-lump) (arg0 float) (arg1 res-tag-pair) (arg2 pointer)) "Returns (a pointer to) the value data of a property with the tag-pair. If tag-pair does not represent an exact point in the timeline, then the data is interpolated based on time with the result written into buf. buf must have enough space to copy all of the data. @@ -249,13 +249,13 @@ This is updated from the entity system used in Crash 2, which had most of these (vf3 :class vf) (vf4 :class vf) ) - (let* ((t0-2 (-> obj tag (-> arg1 lo))) - (t1-2 (-> obj tag (-> arg1 hi))) + (let* ((t0-2 (-> this tag (-> arg1 lo))) + (t1-2 (-> this tag (-> arg1 hi))) (v1-6 (-> t0-2 elt-count)) ) (cond ((zero? (-> t0-2 inlined?)) - (&+ (-> obj data-base) (-> t0-2 data-offset)) + (&+ (-> this data-base) (-> t0-2 data-offset)) ) ((or (not arg2) (= (-> arg1 lo) (-> arg1 hi)) @@ -263,15 +263,15 @@ This is updated from the entity system used in Crash 2, which had most of these (!= (-> t0-2 elt-type) (-> t1-2 elt-type)) ) (let ((a0-4 t0-2)) - (&+ (-> obj data-base) (-> a0-4 data-offset)) + (&+ (-> this data-base) (-> a0-4 data-offset)) ) ) (else (let* ((f0-2 (/ (- arg0 (-> t0-2 key-frame)) (- (-> t1-2 key-frame) (-> t0-2 key-frame)))) - (a1-4 obj) + (a1-4 this) (a2-7 t0-2) (a1-6 (&+ (-> a1-4 data-base) (-> a2-7 data-offset))) - (a2-13 (&+ (-> obj data-base) (-> t1-2 data-offset))) + (a2-13 (&+ (-> this data-base) (-> t1-2 data-offset))) ) (case (-> t0-2 elt-type symbol) (('float) @@ -412,7 +412,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) (else (let ((a0-27 t0-2)) - (&+ (-> obj data-base) (-> a0-27 data-offset)) + (&+ (-> this data-base) (-> a0-27 data-offset)) ) ) ) @@ -423,7 +423,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod get-property-data res-lump ((obj res-lump) +(defmethod get-property-data res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) @@ -437,15 +437,15 @@ This is updated from the entity system used in Crash 2, which had most of these tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode." - (let ((s3-0 (lookup-tag-idx obj arg0 arg1 arg2))) + (let ((s3-0 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int s3-0) 0) (empty) ) (else - (set! arg3 (make-property-data obj arg2 s3-0 arg5)) + (set! arg3 (make-property-data this arg2 s3-0 arg5)) (if arg4 - (set! (-> arg4 0) (-> obj tag (-> s3-0 lo))) + (set! (-> arg4 0) (-> this tag (-> s3-0 lo))) ) ) ) @@ -453,7 +453,7 @@ This is updated from the entity system used in Crash 2, which had most of these arg3 ) -(defmethod get-property-struct res-lump ((obj res-lump) +(defmethod get-property-struct res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) @@ -466,14 +466,14 @@ This is updated from the entity system used in Crash 2, which had most of these default is the default result returned in the case of an error. tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode." - (let ((s3-0 (lookup-tag-idx obj arg0 arg1 arg2))) + (let ((s3-0 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int s3-0) 0) (empty) ) (else - (set! arg3 (the-as structure (make-property-data obj arg2 s3-0 arg5))) - (let ((v1-4 (-> obj tag (-> s3-0 lo)))) + (set! arg3 (the-as structure (make-property-data this arg2 s3-0 arg5))) + (let ((v1-4 (-> this tag (-> s3-0 lo)))) (if arg4 (set! (-> arg4 0) v1-4) ) @@ -488,7 +488,7 @@ This is updated from the entity system used in Crash 2, which had most of these (the-as structure arg3) ) -(defmethod get-property-value res-lump ((obj res-lump) +(defmethod get-property-value res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) @@ -501,16 +501,16 @@ This is updated from the entity system used in Crash 2, which had most of these default is the default result returned in the case of an error. tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode." - (let ((a2-1 (lookup-tag-idx obj arg0 arg1 arg2))) + (let ((a2-1 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int a2-1) 0) (empty) ) (else (let* ((a0-2 (-> a2-1 lo)) - (s1-0 (-> obj tag a0-2)) + (s1-0 (-> this tag a0-2)) (s0-0 (-> s1-0 elt-type)) - (gp-1 (make-property-data obj arg2 a2-1 arg5)) + (gp-1 (make-property-data this arg2 a2-1 arg5)) ) (if arg4 (set! (-> arg4 0) s1-0) @@ -568,19 +568,19 @@ This is updated from the entity system used in Crash 2, which had most of these (the-as uint128 arg3) ) -(defmethod get-property-value-float res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) (arg3 float) (arg4 (pointer res-tag)) (arg5 pointer)) +(defmethod get-property-value-float res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) (arg3 float) (arg4 (pointer res-tag)) (arg5 pointer)) "same as get-property-value but float type is checked first?" (local-vars (v1-8 uint) (v1-11 int)) - (let ((a2-1 (lookup-tag-idx obj arg0 arg1 arg2))) + (let ((a2-1 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int a2-1) 0) (empty) ) (else (let* ((a0-2 (-> a2-1 lo)) - (s1-0 (-> obj tag a0-2)) + (s1-0 (-> this tag a0-2)) (s0-0 (-> s1-0 elt-type)) - (gp-1 (make-property-data obj arg2 a2-1 arg5)) + (gp-1 (make-property-data this arg2 a2-1 arg5)) ) (if arg4 (set! (-> arg4 0) s1-0) @@ -640,24 +640,24 @@ This is updated from the entity system used in Crash 2, which had most of these arg3 ) -(defmethod sort! res-lump ((obj res-lump)) +(defmethod sort! res-lump ((this res-lump)) "Sort all tags based on name, then key-frame." (let ((v1-0 -1)) (while (nonzero? v1-0) (set! v1-0 0) (let ((a1-0 0) - (a2-1 (+ (-> obj length) -2)) + (a2-1 (+ (-> this length) -2)) ) (while (>= a2-1 a1-0) - (let* ((a3-2 (-> obj tag a1-0)) - (t0-3 (-> obj tag (+ a1-0 1))) + (let* ((a3-2 (-> this tag a1-0)) + (t0-3 (-> this tag (+ a1-0 1))) (t1-6 (-> (the-as (pointer uint64) (-> (symbol->string (-> a3-2 name)) data)) 0)) (t2-6 (-> (the-as (pointer uint64) (-> (symbol->string (-> t0-3 name)) data)) 0)) ) (when (or (< t2-6 t1-6) (and (= t1-6 t2-6) (< (-> t0-3 key-frame) (-> a3-2 key-frame)))) (+! v1-0 1) - (set! (-> obj tag a1-0) t0-3) - (set! (-> obj tag (+ a1-0 1)) a3-2) + (set! (-> this tag a1-0) t0-3) + (set! (-> this tag (+ a1-0 1)) a3-2) ) ) (+! a1-0 1) @@ -665,18 +665,18 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) ) - obj + this ) -(defmethod allocate-data-memory-for-tag! res-lump ((obj res-lump) (arg0 res-tag)) - "Find space for the data described by arg0 in obj. +(defmethod allocate-data-memory-for-tag! res-lump ((this res-lump) (arg0 res-tag)) + "Find space for the data described by arg0 in this. Returns a tag with data-offset set correctly for this res-lump. If the lump already contains memory for the given tag, and it is big enough, it will be reused. Alignment will be at least 8 bytes. If the input tag has elt-count = 0, it will return a tag for elt-count = 1." (local-vars (resource-mem pointer)) - (let* ((tag-pair (lookup-tag-idx obj (-> arg0 name) 'exact (-> arg0 key-frame))) - (existing-tag (-> obj tag (-> tag-pair lo))) + (let* ((tag-pair (lookup-tag-idx this (-> arg0 name) 'exact (-> arg0 key-frame))) + (existing-tag (-> this tag (-> tag-pair lo))) ) 0 (if (and (>= (the-as int tag-pair) 0) (!= (-> arg0 key-frame) (-> arg0 key-frame))) @@ -688,46 +688,46 @@ This is updated from the entity system used in Crash 2, which had most of these (let ((data-size (length arg0))) (cond ((and (>= (the-as int tag-pair) 0) (>= (length existing-tag) data-size)) - (set! resource-mem (&+ (-> obj data-base) (-> existing-tag data-offset))) + (set! resource-mem (&+ (-> this data-base) (-> existing-tag data-offset))) (when (logtest? (the-as int resource-mem) 7) - (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) - (set! (-> obj data-top) (&+ resource-mem data-size)) + (set! resource-mem (logand -16 (&+ (-> this data-top) 15))) + (set! (-> this data-top) (&+ resource-mem data-size)) ) ) (else - (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) - (set! (-> obj data-top) (&+ resource-mem data-size)) + (set! resource-mem (logand -16 (&+ (-> this data-top) 15))) + (set! (-> this data-top) (&+ resource-mem data-size)) ) ) (let* ((a0-22 arg0) - (s4-1 (copy-and-set-field a0-22 data-offset (&- resource-mem (the-as uint (-> obj data-base))))) + (s4-1 (copy-and-set-field a0-22 data-offset (&- resource-mem (the-as uint (-> this data-base))))) ) - (when (>= (the-as int (&+ resource-mem data-size)) (the-as int (&+ (-> obj data-base) (-> obj data-size)))) + (when (>= (the-as int (&+ resource-mem data-size)) (the-as int (&+ (-> this data-base) (-> this data-size)))) (format 0 "ERROR: attempting to a new tag ~`res-tag`P data of #x~X bytes to ~A, but data memory is full.~%" s4-1 data-size - obj + this ) (return (the-as res-tag #f)) ) (cond ((< (the-as int tag-pair) 0) (cond - ((>= (-> obj length) (-> obj allocated-length)) - (format 0 "ERROR: attempting to a new tag ~`res-tag`P to ~A, but tag memory is full.~%" s4-1 obj) + ((>= (-> this length) (-> this allocated-length)) + (format 0 "ERROR: attempting to a new tag ~`res-tag`P to ~A, but tag memory is full.~%" s4-1 this) (return (the-as res-tag #f)) ) (else - (set! (-> obj tag (-> obj length)) s4-1) - (+! (-> obj length) 1) - (sort! obj) + (set! (-> this tag (-> this length)) s4-1) + (+! (-> this length) 1) + (sort! this) ) ) ) (else - (set! (-> obj tag (-> tag-pair lo)) s4-1) + (set! (-> this tag (-> tag-pair lo)) s4-1) ) ) s4-1 @@ -736,13 +736,13 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod add-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 pointer)) +(defmethod add-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 pointer)) "Given a tag and a pointer to its data, copy it to this res-lump. This doesn't seem to do the right thing if the given tag is a non-inline tag with > 1 element." - (let ((a0-2 (allocate-data-memory-for-tag! obj arg0))) + (let ((a0-2 (allocate-data-memory-for-tag! this arg0))) (when a0-2 - (let* ((v1-2 obj) + (let* ((v1-2 this) (a1-1 a0-2) (s4-0 (&+ (-> v1-2 data-base) (-> a1-1 data-offset))) ) @@ -760,31 +760,32 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) ) - obj + this ) -(defmethod add-32bit-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 object)) +(defmethod add-32bit-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 object)) "Add a single 32-bit value using add-data." (set! (-> arg0 inlined?) 1) - (add-data! obj arg0 (& arg1)) ;; note, only 32-bits are spilled to the stack here. + (add-data! this arg0 (& arg1)) ;; note, only 32-bits are spilled to the stack here. + ;; og:preserve-this #| (local-vars (sv-16 object)) (set! sv-16 arg1) (let* ((v1-0 arg0) (a1-4 (copy-and-set-bf v1-0 :inlined? 1)) ) - (add-data! obj a1-4 (& sv-16)) + (add-data! this a1-4 (& sv-16)) ) |# ) -(defmethod get-curve-data! res-lump ((obj res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) +(defmethod get-curve-data! res-lump ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) "Read curve data and write it to curve-target. Return #t if both control points and knots data was succesfully read, #f otherwise." (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s5-0 #f)) (set! sv-16 (new 'static 'res-tag)) (let ((a0-2 - ((method-of-object obj get-property-data) obj arg1 'exact arg3 (the-as pointer #f) (& sv-16) *res-static-buf*) + ((method-of-object this get-property-data) this arg1 'exact arg3 (the-as pointer #f) (& sv-16) *res-static-buf*) ) ) (when a0-2 @@ -801,7 +802,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) (set! sv-32 (new 'static 'res-tag)) (let ((a0-6 - ((method-of-object obj get-property-data) obj arg2 'exact arg3 (the-as pointer #f) (& sv-32) *res-static-buf*) + ((method-of-object this get-property-data) this arg2 'exact arg3 (the-as pointer #f) (& sv-32) *res-static-buf*) ) ) (when a0-6 @@ -816,7 +817,7 @@ This is updated from the entity system used in Crash 2, which had most of these ) ) -(defmethod mem-usage res-lump ((obj res-lump) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage res-lump ((this res-lump) (arg0 memory-usage-block) (arg1 int)) "Get the memory usage of this lump and its data" (local-vars (sv-16 int)) (let ((s3-0 48) @@ -839,13 +840,13 @@ This is updated from the entity system used in Crash 2, which had most of these (set! (-> arg0 length) (max (-> arg0 length) (+ s3-0 1))) (set! (-> arg0 data s3-0 name) s2-0) (+! (-> arg0 data s3-0 count) 1) - (let ((v1-19 (asize-of obj))) + (let ((v1-19 (asize-of this))) (+! (-> arg0 data s3-0 used) v1-19) (+! (-> arg0 data s3-0 total) (logand -16 (+ v1-19 15))) ) - (dotimes (s1-0 (-> obj length)) - (when (zero? (-> obj tag s1-0 inlined?)) - (let* ((a1-4 obj) + (dotimes (s1-0 (-> this length)) + (when (zero? (-> this tag s1-0 inlined?)) + (let* ((a1-4 this) (a0-15 s1-0) (s0-0 (the-as object (-> (the-as (pointer int32) (&+ (-> a1-4 data-base) (-> a1-4 tag a0-15 data-offset)))))) ) diff --git a/goal_src/jak2/engine/game/effect-control-h.gc b/goal_src/jak2/engine/game/effect-control-h.gc index ea2aa10514..3cf6132865 100644 --- a/goal_src/jak2/engine/game/effect-control-h.gc +++ b/goal_src/jak2/engine/game/effect-control-h.gc @@ -45,14 +45,14 @@ ;; DECOMP BEGINS (deftype effect-control (basic) - ((process process-drawable :offset-assert 4) - (flags effect-control-flag :offset-assert 8) - (last-frame-group art-joint-anim :offset-assert 12) - (last-frame-num float :offset-assert 16) - (channel-offset int32 :offset-assert 20) - (res res-lump :offset-assert 24) - (name (pointer res-tag) :offset-assert 28) - (param uint32 :offset-assert 32) + ((process process-drawable :offset-assert 4) + (flags effect-control-flag :offset-assert 8) + (last-frame-group art-joint-anim :offset-assert 12) + (last-frame-num float :offset-assert 16) + (channel-offset int32 :offset-assert 20) + (res res-lump :offset-assert 24) + (name (pointer res-tag) :offset-assert 28) + (param uint32 :offset-assert 32) ) :method-count-assert 15 :size-assert #x24 @@ -84,8 +84,8 @@ ) ) -(defmethod set-channel-offset! effect-control ((obj effect-control) (arg0 int)) - (set! (-> obj channel-offset) arg0) +(defmethod set-channel-offset! effect-control ((this effect-control) (arg0 int)) + (set! (-> this channel-offset) arg0) 0 (none) ) diff --git a/goal_src/jak2/engine/game/effect-control.gc b/goal_src/jak2/engine/game/effect-control.gc index 5e01794369..9da2131dd1 100644 --- a/goal_src/jak2/engine/game/effect-control.gc +++ b/goal_src/jak2/engine/game/effect-control.gc @@ -144,10 +144,10 @@ arg0 ) -(defmethod update-effects effect-control ((obj effect-control)) - (let* ((a0-1 (-> obj process skel)) - (v1-3 (if (< (the-as uint (-> obj channel-offset)) (-> a0-1 active-channels)) - (-> a0-1 root-channel (-> obj channel-offset)) +(defmethod update-effects effect-control ((this effect-control)) + (let* ((a0-1 (-> this process skel)) + (v1-3 (if (< (the-as uint (-> this channel-offset)) (-> a0-1 active-channels)) + (-> a0-1 root-channel (-> this channel-offset)) (the-as joint-control-channel #f) ) ) @@ -159,24 +159,24 @@ ) (let ((a0-3 (-> a0-1 root-channel 0 num-func))) (cond - ((!= s5-0 (-> obj last-frame-group)) - (set! (-> obj res) (-> s5-0 extra)) + ((!= s5-0 (-> this last-frame-group)) + (set! (-> this res) (-> s5-0 extra)) (let ((v1-6 (-> (lookup-tag-idx (-> s5-0 extra) 'effect-name 'base -1000000000.0) lo))) - (set! (-> obj name) (if (>= (the-as int v1-6) 0) + (set! (-> this name) (if (>= (the-as int v1-6) 0) (&-> (-> s5-0 extra tag) v1-6) (the-as (pointer res-tag) #f) ) ) ) - (if (and (-> obj name) (= (-> obj name 0 key-frame) -1000000000.0)) - (set! (-> obj name) (&-> (-> obj name) 1)) + (if (and (-> this name) (= (-> this name 0 key-frame) -1000000000.0)) + (set! (-> this name) (&-> (-> this name) 1)) ) - (play-effects-from-res-lump obj f30-0 f30-0 f30-0) + (play-effects-from-res-lump this f30-0 f30-0 f30-0) ) - ((or (not (-> obj name)) (= f30-0 (-> obj last-frame-num))) + ((or (not (-> this name)) (= f30-0 (-> this last-frame-num))) ) (else - (let ((f28-0 (-> obj last-frame-num)) + (let ((f28-0 (-> this last-frame-num)) (f26-0 f30-0) ) (cond @@ -185,12 +185,12 @@ (cond ((< f26-0 f28-0) (if (>= f28-0 f0-6) - (play-effects-from-res-lump obj f26-0 f28-0 f30-0) + (play-effects-from-res-lump this f26-0 f28-0 f30-0) ) ) (else (if (>= f0-6 f28-0) - (play-effects-from-res-lump obj f28-0 f26-0 f30-0) + (play-effects-from-res-lump this f28-0 f26-0 f30-0) ) ) ) @@ -201,43 +201,43 @@ ((>= (-> v1-3 param 0) 0.0) (cond ((< f26-0 f28-0) - (play-effects-from-res-lump obj f28-0 9999999.0 f30-0) - (play-effects-from-res-lump obj -100000000.0 f26-0 9999999.0) + (play-effects-from-res-lump this f28-0 9999999.0 f30-0) + (play-effects-from-res-lump this -100000000.0 f26-0 9999999.0) ) (else - (play-effects-from-res-lump obj f28-0 f26-0 f30-0) + (play-effects-from-res-lump this f28-0 f26-0 f30-0) ) ) ) ((< f28-0 f26-0) - (play-effects-from-res-lump obj f26-0 9999999.0 f30-0) - (play-effects-from-res-lump obj -100000000.0 f28-0 9999999.0) + (play-effects-from-res-lump this f26-0 9999999.0 f30-0) + (play-effects-from-res-lump this -100000000.0 f28-0 9999999.0) ) (else - (play-effects-from-res-lump obj f26-0 f28-0 f30-0) + (play-effects-from-res-lump this f26-0 f28-0 f30-0) ) ) ) ((= a0-3 num-func-+!) (if (>= (-> v1-3 param 0) 0.0) - (play-effects-from-res-lump obj f28-0 f26-0 f30-0) - (play-effects-from-res-lump obj f26-0 f28-0 f30-0) + (play-effects-from-res-lump this f28-0 f26-0 f30-0) + (play-effects-from-res-lump this f26-0 f28-0 f30-0) ) ) ((= a0-3 num-func-identity) - (play-effects-from-res-lump obj f30-0 f30-0 f30-0) + (play-effects-from-res-lump this f30-0 f30-0 f30-0) ) ) ) ) ) ) - (set! (-> obj last-frame-group) s5-0) - (set! (-> obj last-frame-num) f30-0) + (set! (-> this last-frame-group) s5-0) + (set! (-> this last-frame-num) f30-0) ) ) (else - (set! (-> obj last-frame-group) #f) + (set! (-> this last-frame-group) #f) ) ) ) @@ -245,19 +245,20 @@ (none) ) -(defmethod play-effects-from-res-lump effect-control ((obj effect-control) (arg0 float) (arg1 float) (arg2 float)) +(defmethod play-effects-from-res-lump effect-control ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) + ;; og:preserve-this ;; note: this check was added. I believe in the original game name could be false, and then the ;; effect-name check below would fail. This did not cause a crash on original hardware because ;; misaligned 16-byte loads silently align. This causes a crash in opengoal, so we skip it manually. ;; (also happened in jak 1) - (when (-> obj name) - (let ((s2-0 (-> obj name))) + (when (-> this name) + (let ((s2-0 (-> this name))) (while (= (-> s2-0 0 name) 'effect-name) (let ((f0-0 (-> s2-0 0 key-frame))) (when (or (and (< f0-0 arg1) (< arg0 f0-0)) (= f0-0 arg2)) - (let* ((a0-1 obj) + (let* ((a0-1 this) (t9-0 (method-of-object a0-1 do-effect)) - (v1-7 (-> obj res)) + (v1-7 (-> this res)) (a1-1 (-> s2-0 0)) ) (t9-0 @@ -286,7 +287,7 @@ ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 598] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 303] ;; WARN: Function (method 10 effect-control) has a return type of none, but the expression builder found a return statement. -(defmethod do-effect effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int)) +(defmethod do-effect effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) (local-vars (sv-320 int) (sv-336 symbol) @@ -303,12 +304,12 @@ (sv-512 res-lump) ) (cond - ((logtest? (-> obj flags) (effect-control-flag ecf2)) + ((logtest? (-> this flags) (effect-control-flag ecf2)) (return #f) ) ((= arg0 'script) (let ((gp-1 (get-property-struct - (-> obj res) + (-> this res) 'effect-script 'exact arg1 @@ -327,7 +328,7 @@ (s5-0 (cond ((< arg2 0) (let ((v0-5 (get-property-value - (-> obj res) + (-> this res) 'effect-joint 'exact arg1 @@ -350,8 +351,8 @@ ) ) ) - (when (logtest? (-> obj flags) (effect-control-flag ecf0)) - (if (send-event (-> obj process) 'effect-control arg0 arg1 s5-0) + (when (logtest? (-> this flags) (effect-control-flag ecf0)) + (if (send-event (-> this process) 'effect-control arg0 arg1 s5-0) (return 0) ) ) @@ -365,7 +366,7 @@ (= (-> v1-23 data 5) 116) (= (-> v1-23 data 6) 45) ) - (let* ((s3-1 (-> obj process root)) + (let* ((s3-1 (-> this process root)) (v1-27 (if (type? s3-1 collide-shape-moving) s3-1 ) @@ -376,7 +377,7 @@ ) ) ) - (do-effect-for-surface obj arg0 arg1 s5-0 (-> obj res) t1-2) + (do-effect-for-surface this arg0 arg1 s5-0 (-> this res) t1-2) ) ) ((let ((v1-31 (symbol->string arg0))) @@ -405,14 +406,14 @@ ) (when (and (nonzero? s3-0) (= (-> (the-as basic s3-0) type) sparticle-launch-group)) (if *debug-effect-control* - (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" (current-time) (-> obj process name) arg0 arg1 s5-0) + (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" (current-time) (-> this process name) arg0 arg1 s5-0) ) (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-1 (let ((t9-10 (method-of-type part-tracker activate))) (t9-10 (the-as part-tracker s4-1) - (-> obj process) + (-> this process) (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000) ) @@ -427,7 +428,7 @@ (set! sv-368 (the-as symbol #f)) (set! sv-400 *launch-matrix*) (set! sv-384 (-> sv-400 trans)) - (let ((v1-55 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) quad))) + (let ((v1-55 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) quad))) (set! (-> sv-384 quad) v1-55) ) ((the-as (function object object object object object object object object none) s2-1) @@ -455,23 +456,23 @@ (= (-> v1-58 data 5) 45) ) ) - (send-event (-> obj process) arg0 arg1 s5-0) + (send-event (-> this process) arg0 arg1 s5-0) ) ((= arg0 'camera-shake) (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) ) ((zero? s3-0) - (play-effect-sound obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) + (play-effect-sound this arg0 arg1 s5-0 (-> this res) (string->sound-name (symbol->string arg0))) ) ((= (-> (the-as basic s3-0) type) sparticle-launcher) (if *debug-effect-control* - (format #t "(~5D) effect part ~A ~A frame ~F joint ~D~%" (current-time) (-> obj process name) arg0 arg1 s5-0) + (format #t "(~5D) effect part ~A ~A frame ~F joint ~D~%" (current-time) (-> this process name) arg0 arg1 s5-0) ) (format #t "-----> (~5D) effect part ~A ~A frame ~F joint ~D~%" (current-time) - (-> obj process name) + (-> this process name) arg0 arg1 s5-0 @@ -481,7 +482,7 @@ (s0-2 *launch-matrix*) ) (set! (-> s0-2 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) quad) ) (s4-2 s2-2 @@ -495,14 +496,14 @@ ) ((= (-> (the-as basic s3-0) type) sparticle-launch-group) (if *debug-effect-control* - (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" (current-time) (-> obj process name) arg0 arg1 s5-0) + (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" (current-time) (-> this process name) arg0 arg1 s5-0) ) (let ((s4-3 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-3 (let ((t9-23 (method-of-type part-tracker activate))) (t9-23 (the-as part-tracker s4-3) - (-> obj process) + (-> this process) (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000) ) @@ -517,7 +518,7 @@ (set! sv-464 (the-as symbol #f)) (set! sv-496 *launch-matrix*) (set! sv-480 (-> sv-496 trans)) - (let ((v1-95 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) quad))) + (let ((v1-95 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) quad))) (set! (-> sv-480 quad) v1-95) ) ((the-as (function object object object object object object object object none) s2-3) @@ -539,12 +540,12 @@ (sound-play-by-spec (the-as sound-spec s3-0) (new-sound-id) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) ) ) ((= (-> (the-as basic s3-0) type) death-info) - (when (and (logtest? (-> obj flags) (effect-control-flag ecf1)) (zero? (-> obj process draw death-timer))) - (let ((v1-106 (-> obj process draw))) + (when (and (logtest? (-> this flags) (effect-control-flag ecf1)) (zero? (-> this process draw death-timer))) + (let ((v1-106 (-> this process draw))) (let ((a1-51 (-> (the-as death-info s3-0) vertex-skip)) (a0-77 (max @@ -576,21 +577,21 @@ (set! (-> v1-106 death-draw-overlap) (-> (the-as death-info s3-0) overlap)) ) (when (-> (the-as death-info s3-0) sound) - (let* ((s2-5 obj) + (let* ((s2-5 this) (s1-4 (method-of-object s2-5 play-effect-sound)) (s0-4 (-> (the-as death-info s3-0) sound)) ) - (set! sv-512 (-> obj res)) + (set! sv-512 (-> this res)) (let ((t1-12 (string->sound-name (symbol->string (-> (the-as death-info s3-0) sound))))) (s1-4 s2-5 s0-4 arg1 s5-0 sv-512 t1-12) ) ) ) - (send-event (-> obj process) 'death-start (the-as death-info s3-0)) + (send-event (-> this process) 'death-start (the-as death-info s3-0)) ) ) (else - (play-effect-sound obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) + (play-effect-sound this arg0 arg1 s5-0 (-> this res) (string->sound-name (symbol->string arg0))) ) ) ) @@ -599,7 +600,7 @@ (none) ) -(defmethod do-effect-for-surface effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) +(defmethod do-effect-for-surface effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) (local-vars (sv-64 (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none) @@ -661,7 +662,7 @@ ) (('effect-land-poof) (do-effect - obj + this (-> (new 'static 'boxed-array :type symbol 'group-land-poof-unk 'group-land-poof-ice @@ -701,7 +702,7 @@ ) (('effect-run-poof) (do-effect - obj + this (-> (new 'static 'boxed-array :type symbol 'group-run-poof-unk 'group-run-poof-ice @@ -741,7 +742,7 @@ ) (('effect-just-footprint) (do-effect - obj + this (-> (new 'static 'boxed-array :type symbol 'group-just-footprint-unk 'group-just-footprint-ice @@ -781,7 +782,7 @@ ) (('effect-just-poof) (do-effect - obj + this (-> (new 'static 'boxed-array :type symbol 'group-just-poof-unk 'group-just-poof-ice @@ -821,7 +822,7 @@ ) (('effect-slide-poof) (do-effect - obj + this (-> (new 'static 'boxed-array :type symbol 'group-slide-poof-unk 'group-slide-poof-ice @@ -901,7 +902,7 @@ (set! sv-80 *sp-particle-system-2d*) (set! sv-112 *launch-matrix*) (set! sv-96 (-> sv-112 trans)) - (let ((v1-63 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2)) quad))) + (let ((v1-63 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad))) (set! (-> sv-96 quad) v1-63) ) (let ((a3-6 #f) @@ -955,7 +956,7 @@ (set! sv-144 *sp-particle-system-2d*) (set! sv-176 *launch-matrix*) (set! sv-160 (-> sv-176 trans)) - (let ((v1-79 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2)) quad))) + (let ((v1-79 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad))) (set! (-> sv-160 quad) v1-79) ) (let ((a3-7 #f) @@ -1009,7 +1010,7 @@ (set! sv-208 *sp-particle-system-2d*) (set! sv-240 *launch-matrix*) (set! sv-224 (-> sv-240 trans)) - (let ((v1-96 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2)) quad))) + (let ((v1-96 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad))) (set! (-> sv-224 quad) v1-96) ) (let ((a3-8 #f) @@ -1023,21 +1024,21 @@ ) ) (if s1-0 - (play-effect-sound obj arg0 arg1 arg2 arg3 s1-0) + (play-effect-sound this arg0 arg1 arg2 arg3 s1-0) ) ) 0 (none) ) -(defmethod play-effect-sound effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) +(defmethod play-effect-sound effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) (local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float))) (set! sv-144 arg3) (let ((s0-0 arg4) (gp-0 (the-as object (new 'stack 'sound-spec))) (s5-0 (if (< arg2 0) (the-as vector #f) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) ) ) ) @@ -1060,7 +1061,7 @@ (the-as sound-spec gp-0) (the-as (pointer float) a1-6) (the-as int (-> sv-112 elt-count)) - (the-as process-focusable (-> obj process)) + (the-as process-focusable (-> this process)) ) (if (logtest? (-> (the-as sound-spec gp-0) mask) (sound-mask unk)) (return 0) @@ -1098,7 +1099,7 @@ #t "(~5D) effect sound ~A ~A (~S) frame ~F joint ~D " (current-time) - (-> obj process name) + (-> this process name) arg0 *temp-string* arg1 diff --git a/goal_src/jak2/engine/game/fact-h.gc b/goal_src/jak2/engine/game/fact-h.gc index d8db487d3a..537984951c 100644 --- a/goal_src/jak2/engine/game/fact-h.gc +++ b/goal_src/jak2/engine/game/fact-h.gc @@ -458,7 +458,7 @@ (the-as fact-info sv-16) ) -(defmethod pickup-collectable! fact-info ((obj fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! fact-info ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) 0.0 ) @@ -530,10 +530,10 @@ ) ) -(defmethod clear-mask-bits fact-info-enemy ((obj fact-info-enemy) (arg0 int)) +(defmethod clear-mask-bits fact-info-enemy ((this fact-info-enemy) (arg0 int)) (let ((v1-0 (lognot arg0))) - (dotimes (a1-1 (-> obj trig-mask-count)) - (logand! (-> obj trig-mask a1-1) v1-0) + (dotimes (a1-1 (-> this trig-mask-count)) + (logand! (-> this trig-mask a1-1) v1-0) ) ) 0 diff --git a/goal_src/jak2/engine/game/game-info-h.gc b/goal_src/jak2/engine/game/game-info-h.gc index 0ab99b12fd..98a533b799 100644 --- a/goal_src/jak2/engine/game/game-info-h.gc +++ b/goal_src/jak2/engine/game/game-info-h.gc @@ -355,9 +355,9 @@ ) -(defmethod get-next-attack-id game-info ((obj game-info)) - (let ((v0-0 (+ (-> obj attack-id) 1))) - (set! (-> obj attack-id) v0-0) +(defmethod get-next-attack-id game-info ((this game-info)) + (let ((v0-0 (+ (-> this attack-id) 1))) + (set! (-> this attack-id) v0-0) v0-0 ) ) diff --git a/goal_src/jak2/engine/game/game-info.gc b/goal_src/jak2/engine/game/game-info.gc index 8815d83ae2..002fe87f05 100644 --- a/goal_src/jak2/engine/game/game-info.gc +++ b/goal_src/jak2/engine/game/game-info.gc @@ -15,8 +15,8 @@ ;; DECOMP BEGINS -(defmethod debug-draw border-plane ((obj border-plane)) - (let* ((v1-0 (-> obj action)) +(defmethod debug-draw border-plane ((this border-plane)) + (let* ((v1-0 (-> this action)) (plane-color (if (= v1-0 'load) (the-as uint #x8000ff00) (the-as uint #x800000ff) @@ -26,16 +26,16 @@ (add-debug-text-sphere #t (bucket-id debug-no-zbuf1) - (-> obj trans) + (-> this trans) (meters 0.2) - (symbol->string (-> obj name)) + (symbol->string (-> this name)) (the-as rgba plane-color) ) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj trans) - (-> obj normal) + (-> this trans) + (-> this normal) (meters 2) (the-as rgba plane-color) ) @@ -43,15 +43,15 @@ 0 ) -(defmethod point-past-plane? border-plane ((obj border-plane) (arg0 vector)) - (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) (-> obj normal)) 0.0) +(defmethod point-past-plane? border-plane ((this border-plane) (arg0 vector)) + (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) (-> this normal)) 0.0) ) -(defmethod task-complete? game-info ((obj game-info) (arg0 game-task)) - (logtest? (-> obj task-perm-list data arg0 status) (entity-perm-status complete)) +(defmethod task-complete? game-info ((this game-info) (arg0 game-task)) + (logtest? (-> this task-perm-list data arg0 status) (entity-perm-status complete)) ) -(defmethod subtask-index-by-name game-info ((obj game-info) (arg0 string)) +(defmethod subtask-index-by-name game-info ((this game-info) (arg0 string)) (let ((subtasks (-> *game-info* sub-task-list))) (dotimes (i (-> subtasks length)) (when (nonzero? i) @@ -66,8 +66,8 @@ 0 ) -(defmethod set-subtask-hook! game-info ((obj game-info) (arg0 game-task-node) (arg1 int) (arg2 function)) - (let ((subtask (-> obj sub-task-list arg0))) +(defmethod set-subtask-hook! game-info ((this game-info) (arg0 game-task-node) (arg1 int) (arg2 function)) + (let ((subtask (-> this sub-task-list arg0))) (if (and subtask (-> subtask info)) (set! (-> subtask info hooks arg1) arg2) ) @@ -97,23 +97,23 @@ ) ) -(defmethod continue-point-method-10 continue-point ((obj continue-point) (arg0 load-state)) - (let ((v1-0 (lookup-level-info (-> obj vis-nick)))) - (set! (-> obj vis-nick) (if v1-0 +(defmethod continue-point-method-10 continue-point ((this continue-point) (arg0 load-state)) + (let ((v1-0 (lookup-level-info (-> this vis-nick)))) + (set! (-> this vis-nick) (if v1-0 (-> v1-0 name) ) ) ) (dotimes (s4-0 6) - (mem-copy! (the-as pointer (-> obj want s4-0)) (the-as pointer (-> arg0 want s4-0)) 16) + (mem-copy! (the-as pointer (-> this want s4-0)) (the-as pointer (-> arg0 want s4-0)) 16) ) (dotimes (v1-7 3) - (set! (-> obj want-sound v1-7) (-> arg0 want-sound v1-7)) + (set! (-> this want-sound v1-7) (-> arg0 want-sound v1-7)) ) - (set! (-> obj camera-trans quad) (-> *camera-combiner* trans quad)) + (set! (-> this camera-trans quad) (-> *camera-combiner* trans quad)) (when *camera-combiner* (let ((a0-10 (-> *camera-combiner* inv-camera-rot)) - (v1-14 (-> obj camera-rot)) + (v1-14 (-> this camera-rot)) ) (set! (-> v1-14 0 x) (-> a0-10 vector 0 x)) (set! (-> v1-14 0 y) (-> a0-10 vector 0 y)) @@ -127,13 +127,13 @@ ) ) (add-borrow-levels arg0) - obj + this ) -(defmethod move-camera! continue-point ((obj continue-point)) - (set! (-> *camera-combiner* trans quad) (-> obj camera-trans quad)) +(defmethod move-camera! continue-point ((this continue-point)) + (set! (-> *camera-combiner* trans quad) (-> this camera-trans quad)) (let ((gp-0 (-> *camera-combiner* inv-camera-rot)) - (s5-0 (-> obj camera-rot)) + (s5-0 (-> this camera-rot)) ) (matrix-identity! gp-0) (set! (-> gp-0 vector 0 x) (-> s5-0 0 x)) @@ -152,10 +152,10 @@ (none) ) -(defmethod get-current-continue-forced game-info ((obj game-info)) +(defmethod get-current-continue-forced game-info ((this game-info)) (cond - ((and (= (-> obj mode) 'play) (-> obj current-continue)) - (-> obj current-continue) + ((and (= (-> this mode) 'play) (-> this current-continue)) + (-> this current-continue) ) (else (let ((dfault *default-continue*)) @@ -168,7 +168,7 @@ ) ) -(defmethod get-continue-by-name game-info ((obj game-info) (arg0 string)) +(defmethod get-continue-by-name game-info ((this game-info) (arg0 string)) (if (not arg0) (return (the-as continue-point #f)) ) @@ -191,21 +191,21 @@ ) ;; WARN: Using new Jak 2 rtype-of -(defmethod set-continue! game-info ((obj game-info) (arg0 basic) (arg1 symbol)) - (let ((s5-0 (-> obj current-continue))) +(defmethod set-continue! game-info ((this game-info) (arg0 basic) (arg1 symbol)) + (let ((s5-0 (-> this current-continue))) (if (null? arg0) (set! arg0 (the-as basic #f)) ) (case (rtype-of arg0) ((string) - (let ((v1-7 (get-continue-by-name obj (the-as string arg0)))) + (let ((v1-7 (get-continue-by-name this (the-as string arg0)))) (if v1-7 - (set! (-> obj current-continue) v1-7) + (set! (-> this current-continue) v1-7) ) ) ) ((continue-point) - (set! (-> obj current-continue) (the-as continue-point arg0)) + (set! (-> this current-continue) (the-as continue-point arg0)) ) (else (let ((dfault *default-continue*)) @@ -223,28 +223,28 @@ (dotimes (v1-16 3) (set! (-> dfault want-sound v1-16) (-> *load-state* want-sound v1-16)) ) - (set! (-> obj current-continue) dfault) + (set! (-> this current-continue) dfault) ) ) ) - (if (and (logtest? (-> obj current-continue flags) (continue-flags change-continue)) - (and (!= (-> obj current-continue) *default-continue*) (not arg1)) + (if (and (logtest? (-> this current-continue flags) (continue-flags change-continue)) + (and (!= (-> this current-continue) *default-continue*) (not arg1)) ) - (set! (-> obj current-continue) s5-0) + (set! (-> this current-continue) s5-0) ) - (when (!= s5-0 (-> obj current-continue)) - (set! (-> obj continue-deaths) 0) - (set! (-> obj continue-time) (-> *display* game-clock frame-counter)) + (when (!= s5-0 (-> this current-continue)) + (set! (-> this continue-deaths) 0) + (set! (-> this continue-time) (-> *display* game-clock frame-counter)) ) ) - (-> obj current-continue) + (-> this current-continue) ) -(defmethod task-perm-by-index game-info ((obj game-info) (arg0 int)) - (-> obj task-perm-list data arg0) +(defmethod task-perm-by-index game-info ((this game-info) (arg0 int)) + (-> this task-perm-list data arg0) ) -(defmethod calculate-percentage game-info ((obj game-info)) +(defmethod calculate-percentage game-info ((this game-info)) (let ((story-total 0) (story-complete 0) ) @@ -255,7 +255,7 @@ (while (>= (the-as uint story-max) (the-as uint story-min)) (when (not (or (= story-min (game-task city-blue-gun-training)) (= story-min (game-task city-dark-gun-training)))) (+! story-total 1) - (if (task-complete? obj story-min) + (if (task-complete? this story-min) (+! story-complete 1) ) ) @@ -268,7 +268,7 @@ (bbush-max (game-task stadium-burning-bush-race-class1-r)) ) (while (>= (the-as uint bbush-max) (the-as uint bbush-min)) - (if (task-complete? obj bbush-min) + (if (task-complete? this bbush-min) (set! percent (+ 1.0 percent)) ) (+! bbush-min 1) @@ -293,32 +293,32 @@ ) ) -(defmethod initialize! game-info ((obj game-info) (arg0 symbol) (arg1 game-save) (arg2 string)) +(defmethod initialize! game-info ((this game-info) (arg0 symbol) (arg1 game-save) (arg2 string)) (local-vars (v0-3 int) (sv-96 game-task-node-info) (sv-112 symbol)) (case arg0 (('dead 'life) - (+! (-> obj total-deaths) 1) - (+! (-> obj continue-deaths) 1) - (+! (-> obj task-deaths) 1) + (+! (-> this total-deaths) 1) + (+! (-> this continue-deaths) 1) + (+! (-> this task-deaths) 1) (when *target* (let ((s4-1 (-> *target* current-level info))) - (set! (-> obj deaths-per-level (-> s4-1 task-level)) - (the-as uint (seekl (the-as int (-> obj deaths-per-level (-> s4-1 task-level))) 255 1)) + (set! (-> this deaths-per-level (-> s4-1 task-level)) + (the-as uint (seekl (the-as int (-> this deaths-per-level (-> s4-1 task-level))) 255 1)) ) ) ) - (case (-> obj mode) + (case (-> this mode) (('play) (set! arg0 'life) ) (else - (set! obj obj) + (set! this this) (goto cfg-131) ) ) ) (('try) - (+! (-> obj total-trys) 1) + (+! (-> this total-trys) 1) ) ) (case arg0 @@ -332,7 +332,7 @@ (if (open? sv-96) (set! v0-3 (when (and (= (-> s2-0 info taskname) (-> sv-96 level)) (and (or (not (-> sv-96 info)) (handle->process (-> sv-96 info manager))) - (>= (- (-> *display* game-clock frame-counter) (-> obj death-time)) (seconds 2)) + (>= (- (-> *display* game-clock frame-counter) (-> this death-time)) (seconds 2)) ) ) (format #t "death count inc for ~S~%" (-> sv-96 name)) @@ -347,20 +347,20 @@ ) ) ) - (set! (-> obj death-time) (-> *display* game-clock frame-counter)) + (set! (-> this death-time) (-> *display* game-clock frame-counter)) ) ) (kill-current-talker (the-as symbol '()) '() 'die) (case arg0 (('game) - (+! (-> obj task-counter) 1) + (+! (-> this task-counter) 1) (reset! (-> *display* total-game-clock)) - (set! (-> obj features) (game-feature sidekick)) - (set! (-> obj debug-features) (game-feature)) - (set! (-> obj secrets) (game-secrets)) - (set! (-> obj purchase-secrets) (game-secrets)) + (set! (-> this features) (game-feature sidekick)) + (set! (-> this debug-features) (game-feature)) + (set! (-> this secrets) (game-secrets)) + (set! (-> this purchase-secrets) (game-secrets)) (set-continue! - obj + this (cond (arg2 (empty) @@ -378,64 +378,64 @@ ) #f ) - (set! (-> obj auto-save-count) 0) + (set! (-> this auto-save-count) 0) (set! (-> *setting-control* user-default auto-save) #f) - (set! (-> obj money) 0.0) - (set! (-> obj money-total) 0.0) - (set! (-> obj fuel) 0.0) - (set! (-> obj buzzer-total) 0.0) - (set! (-> obj eco-pill-dark) 0.0) - (set! (-> obj eco-pill-dark-total) 0.0) - (set! (-> obj gem) 0.0) - (set! (-> obj gem-total) 0.0) - (set! (-> obj skill) 0.0) - (set! (-> obj skill-total) 0.0) - (set! (-> obj karma) 0.0) - (set! (-> obj perm-list length) 0) - (dotimes (v1-69 (-> obj unknown-pad6 allocated-length)) - (set! (-> obj unknown-pad6 v1-69) (the-as uint 0)) + (set! (-> this money) 0.0) + (set! (-> this money-total) 0.0) + (set! (-> this fuel) 0.0) + (set! (-> this buzzer-total) 0.0) + (set! (-> this eco-pill-dark) 0.0) + (set! (-> this eco-pill-dark-total) 0.0) + (set! (-> this gem) 0.0) + (set! (-> this gem-total) 0.0) + (set! (-> this skill) 0.0) + (set! (-> this skill-total) 0.0) + (set! (-> this karma) 0.0) + (set! (-> this perm-list length) 0) + (dotimes (v1-69 (-> this unknown-pad6 allocated-length)) + (set! (-> this unknown-pad6 v1-69) (the-as uint 0)) ) - (set! (-> obj death-movie-tick) (rand-vu-int-count 10)) - (set! (-> obj gun-type) 2) - (set! (-> obj gun-ammo 0) (-> *FACT-bank* ammo-yellow-start)) - (set! (-> obj gun-ammo 1) (-> *FACT-bank* ammo-red-start)) - (set! (-> obj gun-ammo 2) (-> *FACT-bank* ammo-blue-start)) - (set! (-> obj gun-ammo 3) (-> *FACT-bank* ammo-dark-start)) - (set! (-> obj shield) 100.0) - (set! (-> obj score) 0.0) - (set! (-> obj score-owner) (the-as handle #f)) - (set! (-> obj goal) 0.0) - (set! (-> obj miss) 0.0) - (set! (-> obj miss-max) 0.0) - (set! (-> obj timer) 0) - (set! (-> obj timer-flash) #f) - (set! (-> obj timer-owner) (the-as handle #f)) - (set! (-> obj counter) 0.0) - (set! (-> obj counter-flash) #f) - (set! (-> obj wanted-flash) #f) - (set! (-> obj distance) 0.0) - (set! (-> obj attack-id) (the-as uint 2)) - (set! (-> obj total-trys) 0) - (set! (-> obj total-deaths) 0) - (set! (-> obj continue-deaths) 0) - (set! (-> obj task-deaths) 0) - (set! (-> obj death-pos length) 0) - (set! (-> obj game-start-time) (-> *display* game-clock frame-counter)) - (set! (-> obj task-pickup-time) (-> *display* game-clock frame-counter)) - (set! (-> obj continue-time) (-> *display* game-clock frame-counter)) - (set! (-> obj death-time) (-> *display* game-clock frame-counter)) - (set! (-> obj hit-time) (-> *display* game-clock frame-counter)) + (set! (-> this death-movie-tick) (rand-vu-int-count 10)) + (set! (-> this gun-type) 2) + (set! (-> this gun-ammo 0) (-> *FACT-bank* ammo-yellow-start)) + (set! (-> this gun-ammo 1) (-> *FACT-bank* ammo-red-start)) + (set! (-> this gun-ammo 2) (-> *FACT-bank* ammo-blue-start)) + (set! (-> this gun-ammo 3) (-> *FACT-bank* ammo-dark-start)) + (set! (-> this shield) 100.0) + (set! (-> this score) 0.0) + (set! (-> this score-owner) (the-as handle #f)) + (set! (-> this goal) 0.0) + (set! (-> this miss) 0.0) + (set! (-> this miss-max) 0.0) + (set! (-> this timer) 0) + (set! (-> this timer-flash) #f) + (set! (-> this timer-owner) (the-as handle #f)) + (set! (-> this counter) 0.0) + (set! (-> this counter-flash) #f) + (set! (-> this wanted-flash) #f) + (set! (-> this distance) 0.0) + (set! (-> this attack-id) (the-as uint 2)) + (set! (-> this total-trys) 0) + (set! (-> this total-deaths) 0) + (set! (-> this continue-deaths) 0) + (set! (-> this task-deaths) 0) + (set! (-> this death-pos length) 0) + (set! (-> this game-start-time) (-> *display* game-clock frame-counter)) + (set! (-> this task-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this continue-time) (-> *display* game-clock frame-counter)) + (set! (-> this death-time) (-> *display* game-clock frame-counter)) + (set! (-> this hit-time) (-> *display* game-clock frame-counter)) (dotimes (v1-95 110) - (set! (-> obj unknown-array1 0) 0) - (set! (-> obj task-close-times 0) 0) + (set! (-> this unknown-array1 0) 0) + (set! (-> this task-close-times 0) 0) (nop!) ) (dotimes (v1-98 32) - (set! (-> obj money-per-level v1-98) (the-as uint 0)) - (set! (-> obj deaths-per-level v1-98) (the-as uint 0)) - (set! (-> obj task-enter-times v1-98) 0) - (set! (-> obj task-in-times v1-98) 0) - (set! (-> obj level-opened v1-98) (the-as uint 0)) + (set! (-> this money-per-level v1-98) (the-as uint 0)) + (set! (-> this deaths-per-level v1-98) (the-as uint 0)) + (set! (-> this task-enter-times v1-98) 0) + (set! (-> this task-in-times v1-98) 0) + (set! (-> this level-opened v1-98) (the-as uint 0)) (nop!) ) (let ((v1-102 (-> *game-info* sub-task-list))) @@ -451,13 +451,13 @@ ) ) ) - (dotimes (v1-105 (-> obj game-score length)) - (set! (-> obj game-score v1-105) 0.0) + (dotimes (v1-105 (-> this game-score length)) + (set! (-> this game-score v1-105) 0.0) ) (dotimes (s3-1 19) (case s3-1 ((4 5 6 7 10 11 12 13 15 14 16 17 18) - (let ((v1-112 (get-game-score-ref obj s3-1)) + (let ((v1-112 (get-game-score-ref this s3-1)) (a0-62 (-> *highscore-info-array* s3-1)) ) (set! (-> v1-112 0) (-> a0-62 gold-score)) @@ -472,29 +472,29 @@ ) (case arg0 (('game 'try 'life) - (case (-> obj mode) + (case (-> this mode) (('play) (set! *display-profile* #f) (set! *display-entity-errors* #f) ) ) - (set! (-> obj life-max) (-> *GAME-bank* life-max-default)) - (set! (-> obj life) (-> *GAME-bank* life-start-default)) - (set! (-> obj gun-ammo 0) - (fmax (-> obj gun-ammo 0) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-yellow-start))) + (set! (-> this life-max) (-> *GAME-bank* life-max-default)) + (set! (-> this life) (-> *GAME-bank* life-start-default)) + (set! (-> this gun-ammo 0) + (fmax (-> this gun-ammo 0) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-yellow-start))) ) - (set! (-> obj gun-ammo 1) - (fmax (-> obj gun-ammo 1) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-red-start))) + (set! (-> this gun-ammo 1) + (fmax (-> this gun-ammo 1) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-red-start))) ) - (set! (-> obj gun-ammo 2) - (fmax (-> obj gun-ammo 2) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-blue-start))) + (set! (-> this gun-ammo 2) + (fmax (-> this gun-ammo 2) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-blue-start))) ) - (set! (-> obj gun-ammo 3) - (fmax (-> obj gun-ammo 3) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-dark-start))) + (set! (-> this gun-ammo 3) + (fmax (-> this gun-ammo 3) (* (you-suck-scale *game-info* #f) (-> *FACT-bank* ammo-dark-start))) ) ) ) - (let ((v1-135 (-> obj mode))) + (let ((v1-135 (-> this mode))) (cond ((= v1-135 'movie) (task-node-reset arg0) @@ -503,7 +503,7 @@ ((= v1-135 'debug) (reset-actors arg0) (if arg1 - (load-game obj arg1) + (load-game this arg1) ) ) ((= v1-135 'play) @@ -546,8 +546,8 @@ ) ) ) - (set! sv-112 (-> obj mode)) - (let ((t0-3 (get-current-continue-forced obj)) + (set! sv-112 (-> this mode)) + (let ((t0-3 (get-current-continue-forced this)) (t1-3 arg1) ) (run-next-time-in-process s3-2 s0-1 sv-112 arg0 t0-3 t1-3) @@ -567,73 +567,73 @@ ) ) (label cfg-131) - obj + this ) -(defmethod give game-info ((obj game-info) (arg0 symbol) (arg1 float) (arg2 handle)) +(defmethod give game-info ((this game-info) (arg0 symbol) (arg1 float) (arg2 handle)) (local-vars (ammo-max float)) (with-pp (case arg0 (('life) (if (>= arg1 0.0) - (seek! (-> obj life) (-> obj life-max) arg1) - (seek! (-> obj life) 0.0 (- arg1)) + (seek! (-> this life) (-> this life-max) arg1) + (seek! (-> this life) 0.0 (- arg1)) ) - (-> obj life) + (-> this life) ) (('money) (if (< 0.0 arg1) - (+! (-> obj money-total) arg1) + (+! (-> this money-total) arg1) ) - (set! (-> obj money) (+ (-> obj money) arg1)) + (set! (-> this money) (+ (-> this money) arg1)) ) (('gem) (when (< 0.0 arg1) - (+! (-> obj gem-total) arg1) + (+! (-> this gem-total) arg1) (let ((v1-7 (handle->process arg2))) (if (and v1-7 (-> v1-7 entity)) (toggle-status (-> v1-7 entity) (entity-perm-status save) #t) ) ) ) - (set! (-> obj gem) (+ (-> obj gem) arg1)) + (set! (-> this gem) (+ (-> this gem) arg1)) ) (('skill) (if (< 0.0 arg1) - (+! (-> obj skill-total) arg1) + (+! (-> this skill-total) arg1) ) - (set! (-> obj skill) (+ (-> obj skill) arg1)) + (set! (-> this skill) (+ (-> this skill) arg1)) ) (('karma) - (set! (-> obj karma) (+ (-> obj karma) arg1)) + (set! (-> this karma) (+ (-> this karma) arg1)) ) (('eco-pill-dark) (cond ((< 0.0 arg1) - (seek! (-> obj eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default) arg1) - (if (and (demo?) (= (-> obj eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default))) + (seek! (-> this eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default) arg1) + (if (and (demo?) (= (-> this eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default))) (talker-spawn-func (-> *talker-speech* 79) *entity-pool* (target-pos 0) (the-as region #f)) ) - (+! (-> obj eco-pill-dark-total) arg1) + (+! (-> this eco-pill-dark-total) arg1) ) (else - (seek! (-> obj eco-pill-dark) 0.0 (- arg1)) + (seek! (-> this eco-pill-dark) 0.0 (- arg1)) ) ) - (-> obj eco-pill-dark) + (-> this eco-pill-dark) ) (('fuel-cell) (let ((task (the int arg1))) - (when (not (or (task-complete? obj (the-as game-task task)) (>= (the-as uint 1) (the-as uint task)))) - (set! (-> obj task-deaths) 0) - (set! (-> obj task-pickup-time) (-> *display* game-clock frame-counter)) - (set! (-> obj unknown-array1 task) (-> *display* game-clock frame-counter)) - (+! (-> obj fuel) 1.0) - (logior! (-> obj task-perm-list data task status) (entity-perm-status complete)) + (when (not (or (task-complete? this (the-as game-task task)) (>= (the-as uint 1) (the-as uint task)))) + (set! (-> this task-deaths) 0) + (set! (-> this task-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this unknown-array1 task) (-> *display* game-clock frame-counter)) + (+! (-> this fuel) 1.0) + (logior! (-> this task-perm-list data task status) (entity-perm-status complete)) (task-resolution-close! (the-as game-task task)) ) ) - (-> obj fuel) + (-> this fuel) ) (('buzzer) (logand (the int arg1) #xffff) @@ -663,15 +663,15 @@ ) ) ) - (if (logtest? (-> obj features) (game-feature gun-upgrade-ammo)) + (if (logtest? (-> this features) (game-feature gun-upgrade-ammo)) (set! ammo-max (* 2.0 ammo-max)) ) (if (>= arg1 0.0) - (seek! (-> obj gun-ammo ammo-kind) ammo-max arg1) - (seek! (-> obj gun-ammo ammo-kind) 0.0 (fabs arg1)) + (seek! (-> this gun-ammo ammo-kind) ammo-max arg1) + (seek! (-> this gun-ammo ammo-kind) 0.0 (fabs arg1)) ) - (set! (-> obj gun-ammo ammo-kind) (fmin (-> obj gun-ammo ammo-kind) ammo-max)) - (-> obj gun-ammo ammo-kind) + (set! (-> this gun-ammo ammo-kind) (fmin (-> this gun-ammo ammo-kind) ammo-max)) + (-> this gun-ammo ammo-kind) ) ) (('gun-yellow) @@ -692,7 +692,7 @@ ) ) ) - (if (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow)) (-> obj features)) + (if (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow)) (-> this features)) 1.0 0.0 ) @@ -715,7 +715,7 @@ ) ) ) - (if (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark)) (-> obj features)) + (if (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark)) (-> this features)) 1.0 0.0 ) @@ -723,129 +723,129 @@ (('board) (cond ((< 0.0 arg1) - (logior! (-> obj features) (game-feature board)) + (logior! (-> this features) (game-feature board)) ) ((< arg1 0.0) - (logclear! (-> obj features) (game-feature board)) + (logclear! (-> this features) (game-feature board)) ) ) - (if (logtest? (-> obj features) (game-feature board)) + (if (logtest? (-> this features) (game-feature board)) 1.0 0.0 ) ) (('shield) (if (>= arg1 0.0) - (seek! (-> obj shield) (-> *FACT-bank* shield-max) arg1) - (seek! (-> obj shield) 0.0 (fabs arg1)) + (seek! (-> this shield) (-> *FACT-bank* shield-max) arg1) + (seek! (-> this shield) 0.0 (fabs arg1)) ) - (-> obj shield) + (-> this shield) ) ) ) ) -(defmethod game-info-method-22 game-info ((obj game-info)) +(defmethod game-info-method-22 game-info ((this game-info)) 0 ) ;; WARN: Return type mismatch float vs none. -(defmethod reset! fact-info-target ((obj fact-info-target) (arg0 symbol)) +(defmethod reset! fact-info-target ((this fact-info-target) (arg0 symbol)) (when (or (not arg0) (= arg0 'eco)) - (set! (-> obj eco-timeout) 0) - (set! (-> obj eco-level) 0.0) - (set! (-> obj eco-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this eco-timeout) 0) + (set! (-> this eco-level) 0.0) + (set! (-> this eco-pickup-time) (-> *display* game-clock frame-counter)) ) (when (or (not arg0) (= arg0 'health) (= arg0 'eco-green)) - (set! (-> obj health-max) (-> *FACT-bank* health-max-default)) - (set! (-> obj health) (-> obj health-max)) - (set! (-> obj health-pickup-time) (seconds -100)) + (set! (-> this health-max) (-> *FACT-bank* health-max-default)) + (set! (-> this health) (-> this health-max)) + (set! (-> this health-pickup-time) (seconds -100)) ) (when (or (not arg0) (= arg0 'buzzer)) - (set! (-> obj buzzer-max) (-> *FACT-bank* buzzer-max-default)) - (set! (-> obj buzzer) 0.0) + (set! (-> this buzzer-max) (-> *FACT-bank* buzzer-max-default)) + (set! (-> this buzzer) 0.0) ) (when (or (not arg0) (= arg0 'eco-pill-green)) - (set! (-> obj eco-pill-green-max) (-> *FACT-bank* eco-pill-green-max-default)) - (set! (-> obj eco-pill-green) 0.0) + (set! (-> this eco-pill-green-max) (-> *FACT-bank* eco-pill-green-max-default)) + (set! (-> this eco-pill-green) 0.0) ) (when (or (not arg0) (= arg0 'trick-judge)) - (set! (-> obj trick-point-start-time) 0) - (set! (-> obj trick-point-duration) 0) + (set! (-> this trick-point-start-time) 0) + (set! (-> this trick-point-duration) 0) 0 ) (when (or (not arg0) (= arg0 'trick-point)) - (set! (-> obj trick-point) 0.0) - (set! (-> (the-as target (-> obj process)) game score) 0.0) + (set! (-> this trick-point) 0.0) + (set! (-> (the-as target (-> this process)) game score) 0.0) ) (none) ) -(defmethod pickup-collectable! fact-info-target ((obj fact-info-target) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! fact-info-target ((this fact-info-target) (arg0 pickup-type) (arg1 float) (arg2 handle)) (case arg0 (((pickup-type health) (pickup-type eco-green)) (cond ((>= arg1 0.0) (when (< 0.0 arg1) - (if (or (!= (handle->process arg2) (handle->process (-> obj eco-source))) - (>= (- (-> *display* game-clock frame-counter) (-> obj eco-source-time)) (seconds 0.5)) + (if (or (!= (handle->process arg2) (handle->process (-> this eco-source))) + (>= (- (-> *display* game-clock frame-counter) (-> this eco-source-time)) (seconds 0.5)) ) (sound-play "get-green-eco") ) - (send-event (-> obj process) 'color-effect 'health (seconds 0.2)) + (send-event (-> this process) 'color-effect 'health (seconds 0.2)) (when (handle->process arg2) - (set! (-> obj eco-source) arg2) - (set! (-> obj eco-source-time) (-> *display* game-clock frame-counter)) + (set! (-> this eco-source) arg2) + (set! (-> this eco-source-time) (-> *display* game-clock frame-counter)) ) ) - (set! (-> obj health-pickup-time) (-> *display* game-clock frame-counter)) - (seek! (-> obj health) (-> obj health-max) arg1) + (set! (-> this health-pickup-time) (-> *display* game-clock frame-counter)) + (seek! (-> this health) (-> this health-max) arg1) ) (else - (seek! (-> obj health) 0.0 (- arg1)) + (seek! (-> this health) 0.0 (- arg1)) (if (>= arg1 -10.0) - (pickup-collectable! obj (pickup-type eco-pill-green) 0.0 arg2) + (pickup-collectable! this (pickup-type eco-pill-green) 0.0 arg2) ) - (if (= (-> obj health) 0.0) - (give (-> (the-as target (-> obj process)) game) 'life (- (-> *GAME-bank* life-single-inc)) arg2) + (if (= (-> this health) 0.0) + (give (-> (the-as target (-> this process)) game) 'life (- (-> *GAME-bank* life-single-inc)) arg2) ) ) ) - (-> obj health) + (-> this health) ) (((pickup-type eco-pill-green)) (when (>= arg1 0.0) - (set! (-> obj eco-pill-green-pickup-time) (-> *display* game-clock frame-counter)) - (seek! (-> obj eco-pill-green) (-> obj eco-pill-green-max) arg1) - (when (and (>= (-> obj eco-pill-green) (-> *FACT-bank* eco-pill-green-max-default)) - (< (-> obj health) (-> obj health-max)) + (set! (-> this eco-pill-green-pickup-time) (-> *display* game-clock frame-counter)) + (seek! (-> this eco-pill-green) (-> this eco-pill-green-max) arg1) + (when (and (>= (-> this eco-pill-green) (-> *FACT-bank* eco-pill-green-max-default)) + (< (-> this health) (-> this health-max)) ) - (set! (-> obj eco-pill-green) (- (-> obj eco-pill-green) (-> *FACT-bank* eco-pill-green-max-default))) + (set! (-> this eco-pill-green) (- (-> this eco-pill-green) (-> *FACT-bank* eco-pill-green-max-default))) (pickup-collectable! - obj + this (pickup-type health) (-> *FACT-bank* health-small-inc) - (process->handle (-> obj process)) + (process->handle (-> this process)) ) ) ) - (-> obj eco-pill-green) + (-> this eco-pill-green) ) (((pickup-type eco-pill-dark)) (when (< 0.0 arg1) - (if (>= (- (-> *display* game-clock frame-counter) (-> obj eco-pill-dark-pickup-time)) (seconds 0.05)) + (if (>= (- (-> *display* game-clock frame-counter) (-> this eco-pill-dark-pickup-time)) (seconds 0.05)) (sound-play "get-dark-eco") ) - (send-event (-> obj process) 'color-effect 'eco-pill-dark (seconds 0.2)) + (send-event (-> this process) 'color-effect 'eco-pill-dark (seconds 0.2)) (cond - ((>= (- (-> *display* game-clock frame-counter) (-> (the-as target (-> obj process)) shock-effect-time)) + ((>= (- (-> *display* game-clock frame-counter) (-> (the-as target (-> this process)) shock-effect-time)) (seconds 0.1) ) - (set! (-> (the-as target (-> obj process)) shock-effect-time) (-> *display* game-clock frame-counter)) + (set! (-> (the-as target (-> this process)) shock-effect-time) (-> *display* game-clock frame-counter)) (let ((s3-3 (rand-vu-int-range 0 2))) (dotimes (s2-2 s3-3) (process-drawable-shock-effect - (the-as process-drawable (-> obj process)) + (the-as process-drawable (-> this process)) *lightning-darkjak-pill* lightning-probe-callback (the-as sparticle-launcher #f) @@ -860,22 +860,22 @@ (send-event (handle->process arg2) 'effect #f) ) ) - (set! (-> obj eco-pill-dark-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this eco-pill-dark-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'eco-pill-dark arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'eco-pill-dark arg1 arg2) ) (((pickup-type trick-judge)) (when (< 0.0 arg1) - (set! (-> obj trick-point) 0.0) - (set! (-> obj trick-point-start-time) (-> *display* game-clock frame-counter)) - (set! (-> obj trick-point-duration) (the-as time-frame (the int arg1))) + (set! (-> this trick-point) 0.0) + (set! (-> this trick-point-start-time) (-> *display* game-clock frame-counter)) + (set! (-> this trick-point-duration) (the-as time-frame (the int arg1))) ) - (the float (-> obj trick-point-duration)) + (the float (-> this trick-point-duration)) ) (((pickup-type trick-point)) - (when (nonzero? (-> obj trick-point-duration)) - (set! (-> obj trick-point-pickup-time) (-> *display* game-clock frame-counter)) - (set! (-> obj trick-point) (fmax 0.0 (fmin (+ (-> obj trick-point) arg1) (-> *FACT-bank* trick-point-max)))) + (when (nonzero? (-> this trick-point-duration)) + (set! (-> this trick-point-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this trick-point) (fmax 0.0 (fmin (+ (-> this trick-point) arg1) (-> *FACT-bank* trick-point-max)))) (when (!= arg1 0.0) (sound-play "get-trick-point") (process-spawn-function @@ -928,71 +928,71 @@ ) (none) ) - (get-trans (the-as target (-> obj process)) 3) + (get-trans (the-as target (-> this process)) 3) arg1 510 - :to (-> obj process) + :to (-> this process) ) ) ) - (-> obj trick-point) + (-> this trick-point) ) (((pickup-type money)) (when (< 0.0 arg1) - (if (>= (- (-> *display* game-clock frame-counter) (-> obj money-pickup-time)) (seconds 0.05)) + (if (>= (- (-> *display* game-clock frame-counter) (-> this money-pickup-time)) (seconds 0.05)) (sound-play "money-pickup") ) - (set! (-> obj money-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this money-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'money arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'money arg1 arg2) ) (((pickup-type gem)) (when (< 0.0 arg1) - (if (>= (- (-> *display* game-clock frame-counter) (-> obj gem-pickup-time)) (seconds 0.05)) + (if (>= (- (-> *display* game-clock frame-counter) (-> this gem-pickup-time)) (seconds 0.05)) (sound-play "gem-pickup") ) - (set! (-> obj gem-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this gem-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'gem arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'gem arg1 arg2) ) (((pickup-type skill)) (when (< 0.0 arg1) - (if (>= (- (-> *display* game-clock frame-counter) (-> obj skill-pickup-time)) (seconds 0.05)) + (if (>= (- (-> *display* game-clock frame-counter) (-> this skill-pickup-time)) (seconds 0.05)) (sound-play "skill-pickup") ) - (set! (-> obj skill-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this skill-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'skill arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'skill arg1 arg2) ) (((pickup-type karma)) (if (!= arg1 0.0) - (set! (-> obj karma-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this karma-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'karma arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'karma arg1 arg2) ) (((pickup-type fuel-cell)) (let ((s3-9 (the int arg1))) - (if (not (or (task-complete? (-> (the-as target (-> obj process)) game) (the-as game-task s3-9)) + (if (not (or (task-complete? (-> (the-as target (-> this process)) game) (the-as game-task s3-9)) (>= (the-as uint 1) (the-as uint s3-9)) ) ) - (set! (-> obj task-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this task-pickup-time) (-> *display* game-clock frame-counter)) ) ) - (give (-> (the-as target (-> obj process)) game) 'fuel-cell arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'fuel-cell arg1 arg2) ) (((pickup-type buzzer)) - (let ((f0-41 (give (-> (the-as target (-> obj process)) game) 'buzzer arg1 arg2))) - (if (!= f0-41 (-> obj buzzer)) - (set! (-> obj buzzer-pickup-time) (-> *display* game-clock frame-counter)) + (let ((f0-41 (give (-> (the-as target (-> this process)) game) 'buzzer arg1 arg2))) + (if (!= f0-41 (-> this buzzer)) + (set! (-> this buzzer-pickup-time) (-> *display* game-clock frame-counter)) ) - (set! (-> obj buzzer) f0-41) + (set! (-> this buzzer) f0-41) ) - (-> obj buzzer) + (-> this buzzer) ) (((pickup-type ammo-yellow) (pickup-type ammo-red) (pickup-type ammo-blue) (pickup-type ammo-dark)) (if (< 0.0 arg1) - (set! (-> obj ammo-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this ammo-pickup-time) (-> *display* game-clock frame-counter)) ) (let ((ammo-kind (cond ((= arg0 (pickup-type ammo-yellow)) @@ -1011,9 +1011,9 @@ ) ) (if (< 0.0 arg1) - (send-event (-> obj process) 'color-effect ammo-kind (seconds 0.2)) + (send-event (-> this process) 'color-effect ammo-kind (seconds 0.2)) ) - (give (-> (the-as target (-> obj process)) game) ammo-kind arg1 arg2) + (give (-> (the-as target (-> this process)) game) ammo-kind arg1 arg2) ) ) (((pickup-type gun-yellow) @@ -1024,7 +1024,7 @@ ) (let ((v1-192 arg0)) (give - (-> (the-as target (-> obj process)) game) + (-> (the-as target (-> this process)) game) (cond ((= v1-192 (pickup-type gun-yellow)) 'gun-yellow @@ -1049,50 +1049,50 @@ ) (((pickup-type shield)) (if (< 0.0 arg1) - (set! (-> obj shield-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this shield-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'shield arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'shield arg1 arg2) ) (((pickup-type eco-red) (pickup-type eco-blue) (pickup-type eco-yellow)) (if (= arg1 0.0) - (return (if (= (-> obj eco-type) arg0) - (-> obj eco-level) + (return (if (= (-> this eco-type) arg0) + (-> this eco-level) 0.0 ) ) ) - (when (!= (-> obj eco-type) arg0) - (set! (-> obj eco-level) 0.0) - (set! (-> obj eco-timeout) 0) + (when (!= (-> this eco-type) arg0) + (set! (-> this eco-level) 0.0) + (set! (-> this eco-timeout) 0) 0 ) - (set! (-> obj eco-type) (the-as int arg0)) - (let ((f0-49 (-> obj eco-level))) - (set! (-> obj eco-level) 1.0) - (when (and (= f0-49 0.0) (< 0.0 (-> obj eco-level))) - (set! (-> obj eco-pickup-time) (-> *display* game-clock frame-counter)) - (send-event (-> obj process) 'reset-collide) + (set! (-> this eco-type) (the-as int arg0)) + (let ((f0-49 (-> this eco-level))) + (set! (-> this eco-level) 1.0) + (when (and (= f0-49 0.0) (< 0.0 (-> this eco-level))) + (set! (-> this eco-pickup-time) (-> *display* game-clock frame-counter)) + (send-event (-> this process) 'reset-collide) ) ) - (set! (-> obj eco-timeout) + (set! (-> this eco-timeout) (the-as time-frame (min - (+ (-> obj eco-timeout) (* (the-as int (-> *FACT-bank* eco-single-timeout)) (the int arg1))) + (+ (-> this eco-timeout) (* (the-as int (-> *FACT-bank* eco-single-timeout)) (the int arg1))) (the-as time-frame - (+ (-> *FACT-bank* eco-full-timeout) (- (-> *display* game-clock frame-counter) (-> obj eco-pickup-time))) + (+ (-> *FACT-bank* eco-full-timeout) (- (-> *display* game-clock frame-counter) (-> this eco-pickup-time))) ) ) ) ) - (if (>= (- (-> obj eco-timeout) (- (-> *display* game-clock frame-counter) (-> obj eco-pickup-time))) + (if (>= (- (-> this eco-timeout) (- (-> *display* game-clock frame-counter) (-> this eco-pickup-time))) (the-as time-frame (-> *FACT-bank* eco-full-timeout)) ) - (set! (-> obj eco-level) 2.0) + (set! (-> this eco-level) 2.0) ) - (when (not (and (= (handle->process arg2) (handle->process (-> obj eco-source))) - (< (- (-> *display* game-clock frame-counter) (-> obj eco-source-time)) (seconds 0.5)) + (when (not (and (= (handle->process arg2) (handle->process (-> this eco-source))) + (< (- (-> *display* game-clock frame-counter) (-> this eco-source-time)) (seconds 0.5)) ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.2)) @@ -1112,18 +1112,18 @@ ) ) ) - (set! (-> obj eco-source) arg2) - (set! (-> obj eco-source-time) (-> *display* game-clock frame-counter)) - (-> obj eco-level) + (set! (-> this eco-source) arg2) + (set! (-> this eco-source-time) (-> *display* game-clock frame-counter)) + (-> this eco-level) ) (else - ((method-of-type fact-info pickup-collectable!) obj arg0 arg1 arg2) + ((method-of-type fact-info pickup-collectable!) this arg0 arg1 arg2) ) ) ) -(defmethod actor-perm game-info ((obj game-info) (arg0 actor-id)) - (let ((game-perms (-> obj perm-list))) +(defmethod actor-perm game-info ((this game-info) (arg0 actor-id)) + (let ((game-perms (-> this perm-list))) (countdown (i (-> game-perms length)) (if (= arg0 (-> game-perms data i aid)) (return (-> game-perms data i)) @@ -1133,14 +1133,14 @@ (the-as entity-perm #f) ) -(defmethod copy-perms-from-level! game-info ((obj game-info) (arg0 level)) - (let ((game-perms (-> obj perm-list)) +(defmethod copy-perms-from-level! game-info ((this game-info) (arg0 level)) + (let ((game-perms (-> this perm-list)) (level-entities (-> arg0 bsp level entity)) ) (dotimes (i (-> level-entities length)) (let ((entity-perm (-> level-entities data i entity extra perm))) (when (or (nonzero? (-> entity-perm task)) (logtest? (-> entity-perm status) (entity-perm-status save))) - (let ((actor-perm (actor-perm obj (-> entity-perm aid)))) + (let ((actor-perm (actor-perm this (-> entity-perm aid)))) (cond (actor-perm (set! (-> actor-perm quad) (-> entity-perm quad)) @@ -1158,11 +1158,11 @@ 0 ) -(defmethod copy-perms-to-level! game-info ((obj game-info) (arg0 level)) +(defmethod copy-perms-to-level! game-info ((this game-info) (arg0 level)) (let ((level-entities (-> arg0 bsp level entity))) (dotimes (i (-> level-entities length)) (let* ((entity-perm (-> level-entities data i entity extra perm)) - (actor-perm (actor-perm obj (-> entity-perm aid))) + (actor-perm (actor-perm this (-> entity-perm aid))) ) (when actor-perm (set! (-> entity-perm quad) (-> actor-perm quad)) @@ -1174,26 +1174,26 @@ 0 ) -(defmethod print continue-point ((obj continue-point)) - (format #t "#<~A ~S @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print continue-point ((this continue-point)) + (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) + this ) -(defmethod debug-draw continue-point ((obj continue-point)) - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj trans) (new 'static 'rgba :r #xff :a #x80)) +(defmethod debug-draw continue-point ((this continue-point)) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this trans) (new 'static 'rgba :r #xff :a #x80)) (add-debug-text-3d #t (bucket-id debug-no-zbuf1) - (-> obj name) - (-> obj trans) + (-> this name) + (-> this trans) (font-color white) (new 'static 'vector2h :data (new 'static 'array int16 2 0 8)) ) - (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (the-as quaternion (-> obj quat))))) + (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (the-as quaternion (-> this quat))))) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj trans) + (-> this trans) a3-2 (meters 2) (new 'static 'rgba :r #xff :g #x80 :a #x80) @@ -1387,12 +1387,12 @@ 0 ) -(defmethod print game-task-info ((obj game-task-info)) - (format #t "#" (-> obj name) obj) - obj +(defmethod print game-task-info ((this game-task-info)) + (format #t "#" (-> this name) this) + this ) -(defmethod debug-inspect game-info ((obj game-info) (arg0 symbol)) +(defmethod debug-inspect game-info ((this game-info) (arg0 symbol)) (local-vars (sv-16 int) (sv-24 int) @@ -1405,7 +1405,7 @@ (sv-96 string) (sv-112 string) ) - (inspect obj) + (inspect this) (when (or (not arg0) (= arg0 'game-task)) (format #t "~Tgame-task:~%") (format #t "~T~T~-32S intro play death gem skill~%" "task") @@ -1414,7 +1414,7 @@ (s3-0 109) ) (while (>= (the-as uint s3-0) (the-as uint s4-0)) - (when (task-complete? obj (the-as game-task s4-0)) + (when (task-complete? this (the-as game-task s4-0)) (set! sv-16 0) (set! sv-24 0) (set! sv-32 0) @@ -1445,8 +1445,8 @@ ) ) (label cfg-19) - (if (nonzero? (-> obj task-close-times s4-0)) - (set! sv-24 (max sv-24 (-> obj task-close-times s4-0))) + (if (nonzero? (-> this task-close-times s4-0)) + (set! sv-24 (max sv-24 (-> this task-close-times s4-0))) ) (format #t @@ -1505,9 +1505,9 @@ #t "~T~T~-32S ~3d ~6,,1f min ~6,,1f min~%" (-> *task-level* s4-2) - (-> obj deaths-per-level s4-2) - (* 0.000055555556 (the float (-> obj task-in-times s4-2))) - (* 0.000055555556 (the float (-> obj task-enter-times s4-2))) + (-> this deaths-per-level s4-2) + (* 0.000055555556 (the float (-> this task-in-times s4-2))) + (* 0.000055555556 (the float (-> this task-enter-times s4-2))) ) ) ) @@ -1515,7 +1515,7 @@ (format #t "~Tscore:~%") (format #t "~T~T--------------------~%") (dotimes (s4-3 19) - (let ((v1-71 (get-game-score-ref obj s4-3)) + (let ((v1-71 (get-game-score-ref this s4-3)) (t9-18 format) (a0-26 #t) (a1-24 "~T~T~-32S ~8,,0f ~8,,0f ~8,,0f~%") @@ -1595,16 +1595,16 @@ ) (when (= arg0 'entity-perm) (format #t "~Tentity-perm:~%") - (let ((game-perms (-> obj perm-list))) + (let ((game-perms (-> this perm-list))) (dotimes (s4-4 (-> game-perms length)) (format #t "~T~T~`entity-perm`P~%" (-> game-perms data s4-4)) ) ) ) - obj + this ) -(defmethod you-suck-stage game-info ((obj game-info) (arg0 symbol)) +(defmethod you-suck-stage game-info ((this game-info) (arg0 symbol)) (cond ((logtest? (-> *game-info* secrets) (game-secrets hero-mode)) 0 @@ -1638,21 +1638,21 @@ ) ) -(defmethod you-suck-scale game-info ((obj game-info) (arg0 object)) - (* 0.25 (the float (you-suck-stage obj #f))) +(defmethod you-suck-scale game-info ((this game-info) (arg0 object)) + (* 0.25 (the float (you-suck-stage this #f))) ) -(defmethod adjust-to-screen-flip cpad-info ((obj cpad-info)) +(defmethod adjust-to-screen-flip cpad-info ((this cpad-info)) (when (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) - (set! (-> obj leftx) (- 255 (the-as int (-> obj leftx)))) - (set! (-> obj rightx) (- 255 (the-as int (-> obj rightx)))) + (set! (-> this leftx) (- 255 (the-as int (-> this leftx)))) + (set! (-> this rightx) (- 255 (the-as int (-> this rightx)))) ) 0 ) -(defmethod game-info-method-28 game-info ((obj game-info) (arg0 game-score) (arg1 float)) +(defmethod game-info-method-28 game-info ((this game-info) (arg0 game-score) (arg1 float)) (when (!= arg1 0.0) - (let ((v1-3 (&+ (-> obj game-score data) (* (* arg0 8) 4)))) + (let ((v1-3 (&+ (-> this game-score data) (* (* arg0 8) 4)))) (case arg0 (((game-score race-1) (game-score race-2) @@ -1699,37 +1699,37 @@ -1 ) -(defmethod get-game-score-ref game-info ((obj game-info) (arg0 int)) - (&+ (-> obj game-score data) (* (* arg0 8) 4)) +(defmethod get-game-score-ref game-info ((this game-info) (arg0 int)) + (&+ (-> this game-score data) (* (* arg0 8) 4)) ) -(defmethod get-rank highscore-info ((obj highscore-info) (arg0 float)) +(defmethod get-rank highscore-info ((this highscore-info) (arg0 float)) (let ((v0-0 0)) (cond - ((logtest? (-> obj flags) (highscore-flags time)) + ((logtest? (-> this flags) (highscore-flags time)) (cond ((= arg0 0.0) ) - ((>= (-> obj gold-score) arg0) + ((>= (-> this gold-score) arg0) (set! v0-0 3) ) - ((>= (-> obj silver-score) arg0) + ((>= (-> this silver-score) arg0) (set! v0-0 2) ) - ((>= (-> obj bronze-score) arg0) + ((>= (-> this bronze-score) arg0) (set! v0-0 1) ) ) ) (else (cond - ((>= arg0 (-> obj gold-score)) + ((>= arg0 (-> this gold-score)) (set! v0-0 3) ) - ((>= arg0 (-> obj silver-score)) + ((>= arg0 (-> this silver-score)) (set! v0-0 2) ) - ((>= arg0 (-> obj bronze-score)) + ((>= arg0 (-> this bronze-score)) (set! v0-0 1) ) ) diff --git a/goal_src/jak2/engine/game/game-save.gc b/goal_src/jak2/engine/game/game-save.gc index 10210d96d5..a418dd8b44 100644 --- a/goal_src/jak2/engine/game/game-save.gc +++ b/goal_src/jak2/engine/game/game-save.gc @@ -151,8 +151,8 @@ ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of game-save ((obj game-save)) - (the-as int (+ (-> game-save size) (-> obj allocated-length))) +(defmethod asize-of game-save ((this game-save)) + (the-as int (+ (-> game-save size) (-> this allocated-length))) ) (defmethod new game-save ((allocation symbol) (type-to-make type) (arg0 int)) @@ -163,33 +163,33 @@ ) ) -(defmethod debug-inspect game-save ((obj game-save) (arg0 symbol)) +(defmethod debug-inspect game-save ((this game-save) (arg0 symbol)) (local-vars (sv-16 int) (sv-32 string) (sv-48 string)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tversion: ~D~%" (-> obj version)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~Tgem-count: ~f~%" (-> obj gem-count)) - (format #t "~Tskill-count: ~f~%" (-> obj skill-count)) - (format #t "~Tcompletion-percentage: ~f~%" (-> obj completion-percentage)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tversion: ~D~%" (-> this version)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~Tgem-count: ~f~%" (-> this gem-count)) + (format #t "~Tskill-count: ~f~%" (-> this skill-count)) + (format #t "~Tcompletion-percentage: ~f~%" (-> this completion-percentage)) (format #t "~Tsave-time: ~x:~x ~x/~x/~x~%" - (-> obj hour) - (-> obj minute) - (-> obj day) - (-> obj month) - (-> obj year) + (-> this hour) + (-> this minute) + (-> this day) + (-> this month) + (-> this year) ) - (format #t "~Tgame-time: ~E~%" (-> obj game-time)) - (format #t "~Tsecrets: #x~x~%" (-> obj secrets)) - (format #t "~Tfeatures: #x~x~%" (-> obj features)) - (format #t "~Ttag[]: @ #x~X~%" (-> obj tag)) - (let ((s4-0 (the-as object (-> obj tag))) + (format #t "~Tgame-time: ~E~%" (-> this game-time)) + (format #t "~Tsecrets: #x~x~%" (-> this secrets)) + (format #t "~Tfeatures: #x~x~%" (-> this features)) + (format #t "~Ttag[]: @ #x~X~%" (-> this tag)) + (let ((s4-0 (the-as object (-> this tag))) (s3-0 0) ) - (while (< (the-as int s4-0) (the-as int (&-> obj tag 0 user-int8 (-> obj length)))) + (while (< (the-as int s4-0) (the-as int (&-> this tag 0 user-int8 (-> this length)))) (let ((s2-0 format) (s1-0 #t) (s0-0 "~T [~3D] ~-32S [~3D/~3D] ~12D ~8f ") @@ -306,32 +306,32 @@ (+! s3-0 1) ) ) - obj + this ) -(defmethod inspect game-save ((obj game-save)) - (debug-inspect obj #f) +(defmethod inspect game-save ((this game-save)) + (debug-inspect this #f) ) -(defmethod save-game game-info ((obj game-info) (arg0 game-save) (arg1 string)) +(defmethod save-game game-info ((this game-info) (arg0 game-save) (arg1 string)) (with-pp (dotimes (s4-0 (-> *level* length)) (let ((a1-1 (-> *level* level s4-0))) (if (= (-> a1-1 status) 'active) - (copy-perms-from-level! obj a1-1) + (copy-perms-from-level! this a1-1) ) ) ) (set! (-> arg0 length) 0) (set! (-> arg0 version) 3) - (let ((s4-1 (get-continue-by-name obj (-> obj current-continue name)))) + (let ((s4-1 (get-continue-by-name this (-> this current-continue name)))) (when (not s4-1) (format 0 "ERROR: SAVE: attempting to save continue ~A which is not in level-info~%" - (-> obj current-continue name) + (-> this current-continue name) ) - (set! s4-1 (get-continue-by-name obj "title-start")) + (set! s4-1 (get-continue-by-name this "title-start")) ) (let ((v1-19 (-> *task-manager-engine* alive-list next0))) *task-manager-engine* @@ -343,7 +343,7 @@ (set! (-> a1-5 message) 'fail-continue) (let ((a1-6 (send-event-function (the-as process-tree (-> (the-as connection v1-19) param1)) a1-5))) (when a1-6 - (let ((a0-13 (get-continue-by-name obj (the-as string a1-6)))) + (let ((a0-13 (get-continue-by-name this (the-as string a1-6)))) (if a0-13 (set! s4-1 a0-13) ) @@ -358,12 +358,12 @@ ) ) (set! (-> arg0 level-index) (the-as int (-> (lookup-level-info (-> s4-1 level)) task-level))) - (set! (-> arg0 gem-count) (-> obj gem)) - (set! (-> arg0 skill-count) (-> obj skill)) - (set! (-> arg0 completion-percentage) (calculate-percentage obj)) + (set! (-> arg0 gem-count) (-> this gem)) + (set! (-> arg0 skill-count) (-> this skill)) + (set! (-> arg0 completion-percentage) (calculate-percentage this)) (set! (-> arg0 game-time) (+ -300000 (-> *display* total-game-clock frame-counter))) - (set! (-> arg0 secrets) (the-as uint (-> obj purchase-secrets))) - (set! (-> arg0 features) (the-as uint (-> obj features))) + (set! (-> arg0 secrets) (the-as uint (-> this purchase-secrets))) + (set! (-> arg0 features) (the-as uint (-> this features))) (when (string= (-> s4-1 name) "title-start") (set! (-> arg0 new-game) 1) (set! (-> arg0 level-index) 0) @@ -489,109 +489,109 @@ (let ((a0-52 (-> (the-as (inline-array game-save-tag) v1-99) 0))) (set! (-> a0-52 elt-type) (game-save-elt life)) (set! (-> a0-52 elt-count) 0) - (set! (-> a0-52 user-float0) (-> obj life)) + (set! (-> a0-52 user-float0) (-> this life)) ) (let ((v1-100 (the-as (inline-array game-save-tag) (&+ (the-as pointer v1-99) 16)))) (let ((a0-53 (-> v1-100 0))) (set! (-> a0-53 elt-type) (game-save-elt buzzer-total)) (set! (-> a0-53 elt-count) 0) - (set! (-> a0-53 user-float0) (-> obj buzzer-total)) + (set! (-> a0-53 user-float0) (-> this buzzer-total)) ) (let ((v1-101 (the-as object (-> v1-100 1)))) (let ((a0-54 (-> (the-as (inline-array game-save-tag) v1-101) 0))) (set! (-> a0-54 elt-type) (game-save-elt fuel-cell)) (set! (-> a0-54 elt-count) 0) - (set! (-> a0-54 user-float0) (-> obj fuel)) + (set! (-> a0-54 user-float0) (-> this fuel)) ) (let ((v1-102 (the-as object (&+ (the-as game-save-tag v1-101) 16)))) (let ((a0-55 (-> (the-as (inline-array game-save-tag) v1-102) 0))) (set! (-> a0-55 elt-type) (game-save-elt death-movie-tick)) (set! (-> a0-55 elt-count) 0) - (set! (-> a0-55 user-uint64) (the-as uint (-> obj death-movie-tick))) + (set! (-> a0-55 user-uint64) (the-as uint (-> this death-movie-tick))) ) (let ((v1-103 (the-as object (&+ (the-as game-save-tag v1-102) 16)))) (let ((a0-56 (-> (the-as (inline-array game-save-tag) v1-103) 0))) (set! (-> a0-56 elt-type) (game-save-elt money)) (set! (-> a0-56 elt-count) 0) - (set! (-> a0-56 user-float0) (-> obj money)) + (set! (-> a0-56 user-float0) (-> this money)) ) (let ((v1-104 (the-as (inline-array game-save-tag) (&+ (the-as game-save-tag v1-103) 16)))) (let ((a0-57 (-> v1-104 0))) (set! (-> a0-57 elt-type) (game-save-elt money-total)) (set! (-> a0-57 elt-count) 0) - (set! (-> a0-57 user-float0) (-> obj money-total)) + (set! (-> a0-57 user-float0) (-> this money-total)) ) (let ((v1-106 (the-as object (-> (the-as (inline-array game-save-tag) (-> v1-104 1)) 2)))) (let ((a0-58 (-> (the-as (inline-array game-save-tag) v1-106) 0))) (set! (-> a0-58 elt-type) (game-save-elt skill)) (set! (-> a0-58 elt-count) 0) - (set! (-> a0-58 user-float0) (-> obj skill)) + (set! (-> a0-58 user-float0) (-> this skill)) ) (let ((v1-107 (the-as object (&+ (the-as game-save-tag v1-106) 16)))) (let ((a0-59 (-> (the-as (inline-array game-save-tag) v1-107) 0))) (set! (-> a0-59 elt-type) (game-save-elt skill-total)) (set! (-> a0-59 elt-count) 0) - (set! (-> a0-59 user-float0) (-> obj skill-total)) + (set! (-> a0-59 user-float0) (-> this skill-total)) ) (let ((v1-108 (the-as object (&+ (the-as game-save-tag v1-107) 16)))) (let ((a0-60 (-> (the-as (inline-array game-save-tag) v1-108) 0))) (set! (-> a0-60 elt-type) (game-save-elt gem)) (set! (-> a0-60 elt-count) 0) - (set! (-> a0-60 user-float0) (-> obj gem)) + (set! (-> a0-60 user-float0) (-> this gem)) ) (let ((v1-109 (the-as object (&+ (the-as game-save-tag v1-108) 16)))) (let ((a0-61 (-> (the-as (inline-array game-save-tag) v1-109) 0))) (set! (-> a0-61 elt-type) (game-save-elt gem-total)) (set! (-> a0-61 elt-count) 0) - (set! (-> a0-61 user-float0) (-> obj gem-total)) + (set! (-> a0-61 user-float0) (-> this gem-total)) ) (let ((v1-110 (the-as object (&+ (the-as game-save-tag v1-109) 16)))) (let ((a0-62 (-> (the-as (inline-array game-save-tag) v1-110) 0))) (set! (-> a0-62 elt-type) (game-save-elt karma)) (set! (-> a0-62 elt-count) 0) - (set! (-> a0-62 user-float0) (-> obj karma)) + (set! (-> a0-62 user-float0) (-> this karma)) ) (let ((v1-111 (the-as object (&+ (the-as game-save-tag v1-110) 16)))) (let ((a0-63 (-> (the-as (inline-array game-save-tag) v1-111) 0))) (set! (-> a0-63 elt-type) (game-save-elt eco-pill-dark)) (set! (-> a0-63 elt-count) 0) - (set! (-> a0-63 user-float0) (-> obj eco-pill-dark)) + (set! (-> a0-63 user-float0) (-> this eco-pill-dark)) ) (let ((v1-112 (the-as object (&+ (the-as game-save-tag v1-111) 16)))) (let ((a0-64 (-> (the-as (inline-array game-save-tag) v1-112) 0))) (set! (-> a0-64 elt-type) (game-save-elt eco-pill-dark-total)) (set! (-> a0-64 elt-count) 0) - (set! (-> a0-64 user-float0) (-> obj eco-pill-dark-total)) + (set! (-> a0-64 user-float0) (-> this eco-pill-dark-total)) ) (let ((v1-113 (the-as object (&+ (the-as game-save-tag v1-112) 16)))) (let ((a0-65 (-> (the-as (inline-array game-save-tag) v1-113) 0))) (set! (-> a0-65 elt-type) (game-save-elt shield)) (set! (-> a0-65 elt-count) 0) - (set! (-> a0-65 user-float0) (-> obj shield)) + (set! (-> a0-65 user-float0) (-> this shield)) ) (let ((v1-114 (the-as object (&+ (the-as game-save-tag v1-113) 16)))) (let ((a0-66 (-> (the-as (inline-array game-save-tag) v1-114) 0))) (set! (-> a0-66 elt-type) (game-save-elt features)) (set! (-> a0-66 elt-count) 0) - (set! (-> a0-66 user-uint64) (the-as uint (-> obj features))) + (set! (-> a0-66 user-uint64) (the-as uint (-> this features))) ) (let ((v1-115 (the-as object (&+ (the-as game-save-tag v1-114) 16)))) (let ((a0-67 (-> (the-as (inline-array game-save-tag) v1-115) 0))) (set! (-> a0-67 elt-type) (game-save-elt secrets)) (set! (-> a0-67 elt-count) 0) - (set! (-> a0-67 user-uint64) (the-as uint (-> obj secrets))) + (set! (-> a0-67 user-uint64) (the-as uint (-> this secrets))) ) (let ((v1-116 (the-as object (&+ (the-as game-save-tag v1-115) 16)))) (let ((a0-68 (-> (the-as (inline-array game-save-tag) v1-116) 0))) (set! (-> a0-68 elt-type) (game-save-elt purchase-secrets)) (set! (-> a0-68 elt-count) 0) - (set! (-> a0-68 user-uint64) (the-as uint (-> obj purchase-secrets))) + (set! (-> a0-68 user-uint64) (the-as uint (-> this purchase-secrets))) ) (let ((v1-117 (the-as object (&+ (the-as game-save-tag v1-116) 16)))) (let ((a0-69 (-> (the-as (inline-array game-save-tag) v1-117) 0))) (set! (-> a0-69 elt-type) (game-save-elt gun-type)) (set! (-> a0-69 elt-count) 0) - (set! (-> a0-69 user-uint64) (the-as uint (-> obj gun-type))) + (set! (-> a0-69 user-uint64) (the-as uint (-> this gun-type))) ) (let ((v1-118 (the-as object (&+ (the-as game-save-tag v1-117) 16)))) (let ((a0-70 (-> (the-as (inline-array game-save-tag) v1-118) 0))) @@ -601,7 +601,7 @@ ) (let ((v1-119 (&+ (the-as game-save-tag v1-118) 16))) (dotimes (a0-71 4) - (set! (-> v1-119 user-object a0-71) (-> obj gun-ammo a0-71)) + (set! (-> v1-119 user-object a0-71) (-> this gun-ammo a0-71)) ) (let ((v1-120 (the-as object (&+ v1-119 16)))) (let ((a0-74 (-> (the-as (inline-array game-save-tag) v1-120) 0))) @@ -611,10 +611,10 @@ ) (let ((v1-121 (the-as object (&+ (the-as game-save-tag v1-120) 16)))) (dotimes (a0-75 32) - (set! (-> (the-as (pointer uint8) (&+ (the-as pointer v1-121) a0-75))) (-> obj level-opened a0-75)) + (set! (-> (the-as (pointer uint8) (&+ (the-as pointer v1-121) a0-75))) (-> this level-opened a0-75)) ) (let ((v1-122 (the-as object (-> (the-as (inline-array game-save-tag) v1-121) 2))) - (s3-10 (-> obj sub-task-list length)) + (s3-10 (-> this sub-task-list length)) ) (let ((a0-79 (-> (the-as (inline-array game-save-tag) v1-122) 0))) (set! (-> a0-79 elt-type) (game-save-elt node-name)) @@ -623,10 +623,10 @@ ) (let ((s4-3 (the-as object (&+ (the-as game-save-tag v1-122) 16)))) (dotimes (s2-4 s3-10) - (copyn-charp<-string (the-as (pointer uint8) s4-3) (-> obj sub-task-list s2-4 name) 64) + (copyn-charp<-string (the-as (pointer uint8) s4-3) (-> this sub-task-list s2-4 name) 64) (set! s4-3 (&+ (the-as pointer s4-3) 64)) ) - (let ((s3-11 (-> obj perm-list length))) + (let ((s3-11 (-> this perm-list length))) (let ((v1-129 (-> (the-as (inline-array game-save-tag) s4-3) 0))) (set! (-> v1-129 elt-type) (game-save-elt perm-list)) (set! (-> v1-129 elt-count) s3-11) @@ -634,10 +634,10 @@ ) (let ((s4-4 (the-as object (&+ (the-as pointer s4-3) 16)))) (dotimes (s2-5 s3-11) - (mem-copy! (&+ (the-as pointer s4-4) (* s2-5 16)) (the-as pointer (-> obj perm-list data s2-5)) 16) + (mem-copy! (&+ (the-as pointer s4-4) (* s2-5 16)) (the-as pointer (-> this perm-list data s2-5)) 16) ) (let ((v1-137 (the-as object (+ (the-as int s4-4) (logand -16 (+ (* s3-11 16) 15))))) - (s4-5 (-> obj task-perm-list length)) + (s4-5 (-> this task-perm-list length)) ) (let ((a0-88 (-> (the-as (inline-array game-save-tag) v1-137) 0))) (set! (-> a0-88 elt-type) (game-save-elt task-list)) @@ -646,10 +646,10 @@ ) (let ((s3-12 (+ (the-as int v1-137) 16))) (dotimes (s2-6 s4-5) - (mem-copy! (the-as pointer (+ s3-12 (* s2-6 16))) (the-as pointer (-> obj task-perm-list data s2-6)) 16) + (mem-copy! (the-as pointer (+ s3-12 (* s2-6 16))) (the-as pointer (-> this task-perm-list data s2-6)) 16) ) (let ((a0-92 (the-as object (+ s3-12 (logand -16 (+ (* s4-5 16) 15))))) - (v1-147 (-> obj unknown-pad6 allocated-length)) + (v1-147 (-> this unknown-pad6 allocated-length)) ) (let ((a1-88 (-> (the-as (inline-array game-save-tag) a0-92) 0))) (set! (-> a1-88 elt-type) (game-save-elt talker-state)) @@ -658,10 +658,10 @@ ) (let ((a0-93 (+ (the-as int a0-92) 16))) (dotimes (a1-89 v1-147) - (set! (-> (the-as (pointer uint16) (+ a0-93 (* a1-89 2))) 0) (-> obj unknown-pad6 a1-89)) + (set! (-> (the-as (pointer uint16) (+ a0-93 (* a1-89 2))) 0) (-> this unknown-pad6 a1-89)) ) (let ((a0-94 (the-as object (+ a0-93 (logand -16 (+ (* v1-147 2) 15))))) - (v1-153 (-> obj game-score allocated-length)) + (v1-153 (-> this game-score allocated-length)) ) (let ((a1-93 (-> (the-as (inline-array game-save-tag) a0-94) 0))) (set! (-> a1-93 elt-type) (game-save-elt scores)) @@ -670,7 +670,7 @@ ) (let ((a0-95 (+ (the-as int a0-94) 16))) (dotimes (a1-94 v1-153) - (set! (-> (the-as (pointer float) (+ a0-95 (* a1-94 4))) 0) (-> obj game-score a1-94)) + (set! (-> (the-as (pointer float) (+ a0-95 (* a1-94 4))) 0) (-> this game-score a1-94)) ) (let ((s4-6 (the-as object (+ a0-95 (logand -16 (+ (* v1-153 4) 15)))))) (compress-all *bigmap*) @@ -707,61 +707,61 @@ (let ((a0-102 (-> (the-as (inline-array game-save-tag) v1-169) 0))) (set! (-> a0-102 elt-type) (game-save-elt auto-save-count)) (set! (-> a0-102 elt-count) 0) - (set! (-> a0-102 user-uint64) (the-as uint (-> obj auto-save-count))) + (set! (-> a0-102 user-uint64) (the-as uint (-> this auto-save-count))) ) (let ((v1-170 (the-as object (+ (the-as int v1-169) 16)))) (let ((a0-103 (-> (the-as (inline-array game-save-tag) v1-170) 0))) (set! (-> a0-103 elt-type) (game-save-elt total-deaths)) (set! (-> a0-103 elt-count) 0) - (set! (-> a0-103 user-uint64) (the-as uint (-> obj total-deaths))) + (set! (-> a0-103 user-uint64) (the-as uint (-> this total-deaths))) ) (let ((v1-171 (the-as object (+ (the-as int v1-170) 16)))) (let ((a0-104 (-> (the-as (inline-array game-save-tag) v1-171) 0))) (set! (-> a0-104 elt-type) (game-save-elt total-trys)) (set! (-> a0-104 elt-count) 0) - (set! (-> a0-104 user-uint64) (the-as uint (-> obj total-trys))) + (set! (-> a0-104 user-uint64) (the-as uint (-> this total-trys))) ) (let ((v1-172 (the-as object (+ (the-as int v1-171) 16)))) (let ((a0-105 (-> (the-as (inline-array game-save-tag) v1-172) 0))) (set! (-> a0-105 elt-type) (game-save-elt continue-deaths)) (set! (-> a0-105 elt-count) 0) - (set! (-> a0-105 user-uint64) (the-as uint (-> obj continue-deaths))) + (set! (-> a0-105 user-uint64) (the-as uint (-> this continue-deaths))) ) (let ((v1-173 (the-as object (+ (the-as int v1-172) 16)))) (let ((a0-106 (-> (the-as (inline-array game-save-tag) v1-173) 0))) (set! (-> a0-106 elt-type) (game-save-elt task-deaths)) (set! (-> a0-106 elt-count) 0) - (set! (-> a0-106 user-uint64) (the-as uint (-> obj task-deaths))) + (set! (-> a0-106 user-uint64) (the-as uint (-> this task-deaths))) ) (let ((v1-174 (the-as object (+ (the-as int v1-173) 16)))) (let ((a0-107 (-> (the-as (inline-array game-save-tag) v1-174) 0))) (set! (-> a0-107 elt-type) (game-save-elt game-start-time)) (set! (-> a0-107 elt-count) 0) - (set! (-> a0-107 user-uint64) (the-as uint (-> obj game-start-time))) + (set! (-> a0-107 user-uint64) (the-as uint (-> this game-start-time))) ) (let ((v1-175 (the-as object (+ (the-as int v1-174) 16)))) (let ((a0-108 (-> (the-as (inline-array game-save-tag) v1-175) 0))) (set! (-> a0-108 elt-type) (game-save-elt continue-time)) (set! (-> a0-108 elt-count) 0) - (set! (-> a0-108 user-uint64) (the-as uint (-> obj continue-time))) + (set! (-> a0-108 user-uint64) (the-as uint (-> this continue-time))) ) (let ((v1-176 (the-as object (+ (the-as int v1-175) 16)))) (let ((a0-109 (-> (the-as (inline-array game-save-tag) v1-176) 0))) (set! (-> a0-109 elt-type) (game-save-elt death-time)) (set! (-> a0-109 elt-count) 0) - (set! (-> a0-109 user-uint64) (the-as uint (-> obj death-time))) + (set! (-> a0-109 user-uint64) (the-as uint (-> this death-time))) ) (let ((v1-177 (the-as object (+ (the-as int v1-176) 16)))) (let ((a0-110 (-> (the-as (inline-array game-save-tag) v1-177) 0))) (set! (-> a0-110 elt-type) (game-save-elt hit-time)) (set! (-> a0-110 elt-count) 0) - (set! (-> a0-110 user-uint64) (the-as uint (-> obj hit-time))) + (set! (-> a0-110 user-uint64) (the-as uint (-> this hit-time))) ) (let ((v1-178 (the-as object (+ (the-as int v1-177) 16)))) (let ((a0-111 (-> (the-as (inline-array game-save-tag) v1-178) 0))) (set! (-> a0-111 elt-type) (game-save-elt task-pickup-time)) (set! (-> a0-111 elt-count) 0) - (set! (-> a0-111 user-uint64) (the-as uint (-> obj task-pickup-time))) + (set! (-> a0-111 user-uint64) (the-as uint (-> this task-pickup-time))) ) (let ((v1-179 (the-as object (+ (the-as int v1-178) 16)))) (let ((a0-112 (-> (the-as (inline-array game-save-tag) v1-179) 0))) @@ -771,7 +771,7 @@ ) (let ((v1-180 (+ (the-as int v1-179) 16))) (dotimes (a0-113 110) - (set! (-> (the-as (pointer time-frame) (+ v1-180 (* a0-113 8))) 0) (-> obj unknown-array1 a0-113)) + (set! (-> (the-as (pointer time-frame) (+ v1-180 (* a0-113 8))) 0) (-> this unknown-array1 a0-113)) ) (let ((v1-181 (the-as object (+ v1-180 880)))) (let ((a0-116 (-> (the-as (inline-array game-save-tag) v1-181) 0))) @@ -781,7 +781,7 @@ ) (let ((v1-182 (+ (the-as int v1-181) 16))) (dotimes (a0-117 110) - (set! (-> (the-as (pointer time-frame) (+ v1-182 (* a0-117 8))) 0) (-> obj task-close-times a0-117)) + (set! (-> (the-as (pointer time-frame) (+ v1-182 (* a0-117 8))) 0) (-> this task-close-times a0-117)) ) (let ((v1-183 (the-as object (+ v1-182 880)))) (let ((a0-120 (-> (the-as (inline-array game-save-tag) v1-183) 0))) @@ -791,7 +791,7 @@ ) (let ((v1-184 (+ (the-as int v1-183) 16))) (dotimes (a0-121 32) - (set! (-> (the-as (pointer time-frame) (+ v1-184 (* a0-121 8))) 0) (-> obj task-enter-times a0-121)) + (set! (-> (the-as (pointer time-frame) (+ v1-184 (* a0-121 8))) 0) (-> this task-enter-times a0-121)) ) (let ((v1-185 (the-as object (+ v1-184 256)))) (let ((a0-124 (-> (the-as (inline-array game-save-tag) v1-185) 0))) @@ -801,10 +801,10 @@ ) (let ((v1-186 (+ (the-as int v1-185) 16))) (dotimes (a0-125 32) - (set! (-> (the-as (pointer time-frame) (+ v1-186 (* a0-125 8))) 0) (-> obj task-in-times a0-125)) + (set! (-> (the-as (pointer time-frame) (+ v1-186 (* a0-125 8))) 0) (-> this task-in-times a0-125)) ) (let ((a0-128 (the-as object (+ v1-186 256))) - (v1-188 (-> obj sub-task-list length)) + (v1-188 (-> this sub-task-list length)) ) (let ((a1-153 (-> (the-as (inline-array game-save-tag) a0-128) 0))) (set! (-> a1-153 elt-type) (game-save-elt node-death-count)) @@ -813,7 +813,7 @@ ) (let ((a0-129 (+ (the-as int a0-128) 16))) (dotimes (a1-154 v1-188) - (set! (-> (the-as (pointer uint16) (+ a0-129 (* a1-154 2))) 0) (-> obj sub-task-list a1-154 death-count)) + (set! (-> (the-as (pointer uint16) (+ a0-129 (* a1-154 2))) 0) (-> this sub-task-list a1-154 death-count)) ) (let ((a0-130 (the-as object (+ a0-129 (logand -16 (+ (* v1-188 2) 15)))))) (let ((a1-159 (-> (the-as (inline-array game-save-tag) a0-130) 0))) @@ -823,7 +823,7 @@ ) (let ((a0-131 (+ (the-as int a0-130) 16))) (dotimes (a1-160 v1-188) - (set! (-> (the-as (pointer uint16) (+ a0-131 (* a1-160 2))) 0) (-> obj sub-task-list a1-160 gem-count)) + (set! (-> (the-as (pointer uint16) (+ a0-131 (* a1-160 2))) 0) (-> this sub-task-list a1-160 gem-count)) ) (let ((a0-132 (the-as object (+ a0-131 (logand -16 (+ (* v1-188 2) 15)))))) (let ((a1-165 (-> (the-as (inline-array game-save-tag) a0-132) 0))) @@ -833,7 +833,7 @@ ) (let ((a0-133 (+ (the-as int a0-132) 16))) (dotimes (a1-166 v1-188) - (set! (-> (the-as (pointer uint16) (+ a0-133 (* a1-166 2))) 0) (-> obj sub-task-list a1-166 skill-count)) + (set! (-> (the-as (pointer uint16) (+ a0-133 (* a1-166 2))) 0) (-> this sub-task-list a1-166 skill-count)) ) (let ((a0-134 (the-as object (+ a0-133 (logand -16 (+ (* v1-188 2) 15)))))) (let ((a1-171 (-> (the-as (inline-array game-save-tag) a0-134) 0))) @@ -843,10 +843,10 @@ ) (let ((a0-135 (+ (the-as int a0-134) 16))) (dotimes (a1-172 v1-188) - (set! (-> (the-as (pointer time-frame) (+ a0-135 (* a1-172 8))) 0) (-> obj sub-task-list a1-172 close-time)) + (set! (-> (the-as (pointer time-frame) (+ a0-135 (* a1-172 8))) 0) (-> this sub-task-list a1-172 close-time)) ) (let ((a0-136 (the-as object (+ a0-135 (logand -16 (+ (* v1-188 8) 15))))) - (v1-194 (-> obj sub-task-list length)) + (v1-194 (-> this sub-task-list length)) ) (let ((a1-176 (-> (the-as (inline-array game-save-tag) a0-136) 0))) (set! (-> a1-176 elt-type) (game-save-elt task-node-list)) @@ -856,7 +856,7 @@ (let ((a0-137 (+ (the-as int a0-136) 16))) (dotimes (a1-177 v1-194) (set! (-> (the-as (pointer int8) (+ a0-137 a1-177)) 0) - (if (logtest? (-> obj sub-task-list a1-177 flags) (game-task-node-flag closed)) + (if (logtest? (-> this sub-task-list a1-177 flags) (game-task-node-flag closed)) 1 0 ) @@ -1105,7 +1105,7 @@ ) ) -(defmethod load-game game-info ((obj game-info) (arg0 game-save)) +(defmethod load-game game-info ((this game-info) (arg0 game-save)) (let ((v1-0 (the-as object (-> arg0 tag)))) (while (< (the-as int v1-0) (the-as int (&-> arg0 tag 0 user-int8 (-> arg0 length)))) (case (-> (the-as (inline-array game-save-tag) v1-0) 0 elt-type) @@ -1189,7 +1189,7 @@ (logior! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) ) ) - (set-continue! obj "game-start" #f) + (set-continue! this "game-start" #f) (set! arg0 arg0) (goto cfg-230) ) @@ -1203,8 +1203,8 @@ (case (-> (the-as game-save-tag s4-0) elt-type) (((game-save-elt node-name)) (dotimes (s2-0 (-> (the-as game-save-tag s4-0) elt-count)) - (dotimes (s1-0 (-> obj sub-task-list length)) - (let ((v1-20 (-> obj sub-task-list s1-0))) + (dotimes (s1-0 (-> this sub-task-list length)) + (let ((v1-20 (-> this sub-task-list s1-0))) (when (string-charp= (-> v1-20 name) (the-as (pointer uint8) (+ (+ (* s2-0 64) 16) (the-as int s4-0)))) (set! (-> s3-0 s2-0) (the-as uint s1-0)) (goto cfg-45) @@ -1229,88 +1229,88 @@ ) (((game-save-elt continue)) (format (clear *temp-string*) "~G" (-> (the-as (inline-array game-save-tag) s4-0) 1)) - (set-continue! obj *temp-string* #f) + (set-continue! this *temp-string* #f) ) (((game-save-elt life)) - (set! (-> obj life) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this life) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt buzzer-total)) - (set! (-> obj buzzer-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this buzzer-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt fuel-cell)) - (set! (-> obj fuel) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this fuel) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt death-movie-tick)) - (set! (-> obj death-movie-tick) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this death-movie-tick) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt skill)) - (set! (-> obj skill) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this skill) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt skill-total)) - (set! (-> obj skill-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this skill-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt gem)) - (set! (-> obj gem) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this gem) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt gem-total)) - (set! (-> obj gem-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this gem-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt karma)) - (set! (-> obj karma) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this karma) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt eco-pill-dark)) - (set! (-> obj eco-pill-dark) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this eco-pill-dark) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt eco-pill-dark-total)) - (set! (-> obj eco-pill-dark-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this eco-pill-dark-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt shield)) - (set! (-> obj shield) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this shield) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt features)) - (set! (-> obj features) (the-as game-feature (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this features) (the-as game-feature (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt secrets)) - (set! (-> obj secrets) (the-as game-secrets (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this secrets) (the-as game-secrets (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt purchase-secrets)) - (set! (-> obj purchase-secrets) + (set! (-> this purchase-secrets) (the-as game-secrets (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64)) ) ) (((game-save-elt gun-type)) - (set! (-> obj gun-type) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this gun-type) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt gun-ammo)) (let ((v1-67 (min 4 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-89 v1-67) - (set! (-> obj gun-ammo a0-89) + (set! (-> this gun-ammo a0-89) (the-as float (-> (the-as (inline-array game-save-tag) s4-0) 1 user-object a0-89)) ) ) ) ) (((game-save-elt money)) - (set! (-> obj money) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this money) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt money-total)) - (set! (-> obj money-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this money-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt level-open-list)) (let ((v1-73 (min 32 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-97 v1-73) - (set! (-> obj level-opened a0-97) + (set! (-> this level-opened a0-97) (-> (the-as (pointer uint8) (&+ (the-as pointer (-> (the-as (inline-array game-save-tag) s4-0) 1)) a0-97))) ) ) ) ) (((game-save-elt perm-list)) - (let ((s2-3 (min (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count) (-> obj perm-list allocated-length)))) - (set! (-> obj perm-list length) s2-3) + (let ((s2-3 (min (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count) (-> this perm-list allocated-length)))) + (set! (-> this perm-list length) s2-3) (dotimes (s1-1 s2-3) (mem-copy! - (the-as pointer (-> obj perm-list data s1-1)) + (the-as pointer (-> this perm-list data s1-1)) (the-as pointer (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* s1-1 16))) 16 ) @@ -1319,13 +1319,13 @@ ) (((game-save-elt task-list)) (let ((s2-5 - (min (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count) (-> obj task-perm-list allocated-length)) + (min (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count) (-> this task-perm-list allocated-length)) ) ) - (set! (-> obj task-perm-list length) s2-5) + (set! (-> this task-perm-list length) s2-5) (dotimes (s1-2 s2-5) (mem-copy! - (the-as pointer (-> obj task-perm-list data s1-2)) + (the-as pointer (-> this task-perm-list data s1-2)) (the-as pointer (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* s1-2 16))) 16 ) @@ -1333,30 +1333,30 @@ ) ) (((game-save-elt talker-state)) - (let ((v1-95 (-> obj unknown-pad6 allocated-length)) + (let ((v1-95 (-> this unknown-pad6 allocated-length)) (a0-108 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)) ) (dotimes (a1-57 v1-95) (cond ((>= a1-57 a0-108) - (set! (-> obj unknown-pad6 a1-57) (the-as uint 0)) + (set! (-> this unknown-pad6 a1-57) (the-as uint 0)) 0 ) (else - (set! (-> obj unknown-pad6 a1-57) (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 a1-57)) + (set! (-> this unknown-pad6 a1-57) (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 a1-57)) ) ) ) ) ) (((game-save-elt scores)) - (let ((v1-99 (-> obj game-score allocated-length)) + (let ((v1-99 (-> this game-score allocated-length)) (a0-111 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)) ) (dotimes (a1-58 v1-99) (if (>= a1-58 a0-111) - (set! (-> obj game-score a1-58) 0.0) - (set! (-> obj game-score a1-58) + (set! (-> this game-score a1-58) 0.0) + (set! (-> this game-score a1-58) (the-as float (-> (the-as (inline-array game-save-tag) s4-0) 1 user-object a1-58)) ) ) @@ -1397,45 +1397,45 @@ ) ) (((game-save-elt auto-save-count)) - (set! (-> obj auto-save-count) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this auto-save-count) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt total-deaths)) - (set! (-> obj total-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this total-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt total-trys)) - (set! (-> obj total-trys) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this total-trys) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt continue-deaths)) - (set! (-> obj continue-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this continue-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt task-deaths)) - (set! (-> obj task-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this task-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt game-start-time)) - (set! (-> obj game-start-time) + (set! (-> this game-start-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64)) ) ) (((game-save-elt continue-time)) - (set! (-> obj continue-time) + (set! (-> this continue-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64)) ) ) (((game-save-elt death-time)) - (set! (-> obj death-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this death-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt hit-time)) - (set! (-> obj hit-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this hit-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt task-pickup-time)) - (set! (-> obj task-pickup-time) + (set! (-> this task-pickup-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64)) ) ) (((game-save-elt enter-level-time)) (let ((v1-123 (min 32 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-145 v1-123) - (set! (-> obj task-enter-times a0-145) + (set! (-> this task-enter-times a0-145) (the-as time-frame (-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* a0-145 8))) @@ -1448,7 +1448,7 @@ (((game-save-elt in-level-time)) (let ((v1-127 (min 32 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-149 v1-127) - (set! (-> obj task-in-times a0-149) + (set! (-> this task-in-times a0-149) (the-as time-frame (-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* a0-149 8))) @@ -1461,7 +1461,7 @@ (((game-save-elt task-complete-time)) (let ((v1-131 (min 32 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-153 v1-131) - (set! (-> obj unknown-array1 a0-153) + (set! (-> this unknown-array1 a0-153) (the-as time-frame (-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* a0-153 8))) @@ -1474,7 +1474,7 @@ (((game-save-elt task-start-time)) (let ((v1-135 (min 32 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-157 v1-135) - (set! (-> obj task-close-times a0-157) + (set! (-> this task-close-times a0-157) (the-as time-frame (-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* a0-157 8))) @@ -1491,7 +1491,7 @@ ) (>= (-> (the-as (pointer int16) (&+ s3-0 (* s1-3 2)))) 0) ) - (close! (-> obj sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* s1-3 2))))) 'event) + (close! (-> this sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* s1-3 2))))) 'event) ) ) ) @@ -1500,7 +1500,7 @@ (let ((v1-155 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))) (dotimes (a0-164 v1-155) (if (>= (-> (the-as (pointer int16) (&+ s3-0 (* a0-164 2)))) 0) - (set! (-> obj sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-164 2)))) death-count) + (set! (-> this sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-164 2)))) death-count) (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 a0-164) ) ) @@ -1511,7 +1511,7 @@ (let ((v1-158 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))) (dotimes (a0-167 v1-158) (if (>= (-> (the-as (pointer int16) (&+ s3-0 (* a0-167 2)))) 0) - (set! (-> obj sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-167 2)))) gem-count) + (set! (-> this sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-167 2)))) gem-count) (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 a0-167) ) ) @@ -1522,7 +1522,7 @@ (let ((v1-161 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))) (dotimes (a0-170 v1-161) (if (>= (-> (the-as (pointer int16) (&+ s3-0 (* a0-170 2)))) 0) - (set! (-> obj sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-170 2)))) skill-count) + (set! (-> this sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-170 2)))) skill-count) (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 a0-170) ) ) @@ -1533,7 +1533,7 @@ (let ((v1-165 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))) (dotimes (a0-172 v1-165) (if (>= (-> (the-as (pointer int16) (&+ s3-0 (* a0-172 2)))) 0) - (set! (-> obj sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-172 2)))) close-time) + (set! (-> this sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-172 2)))) close-time) (the-as time-frame (-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* a0-172 8))) @@ -1560,7 +1560,7 @@ (dotimes (s4-1 (-> *level* length)) (let ((a1-106 (-> *level* level s4-1))) (if (= (-> a1-106 status) 'active) - (copy-perms-to-level! obj a1-106) + (copy-perms-to-level! this a1-106) ) ) ) @@ -1568,28 +1568,28 @@ arg0 ) -(defmethod save-to-file game-save ((obj game-save) (arg0 string)) +(defmethod save-to-file game-save ((this game-save) (arg0 string)) (let ((s5-0 (new 'stack 'file-stream arg0 'write))) - (file-stream-write s5-0 (&-> obj type) (+ (-> obj type size) (-> obj length))) + (file-stream-write s5-0 (&-> this type) (+ (-> this type size) (-> this length))) (file-stream-close s5-0) ) - obj + this ) -(defmethod load-from-file game-save ((obj game-save) (arg0 string)) +(defmethod load-from-file game-save ((this game-save) (arg0 string)) (let ((s5-0 (new 'stack 'file-stream arg0 'read))) (let ((s3-0 (file-stream-length s5-0)) - (s4-0 (-> obj allocated-length)) + (s4-0 (-> this allocated-length)) ) (cond - ((>= (asize-of obj) s3-0) + ((>= (asize-of this) s3-0) (cond - ((= (file-stream-read s5-0 (&-> obj type) s3-0) s3-0) - (set! (-> obj type) game-save) + ((= (file-stream-read s5-0 (&-> this type) s3-0) s3-0) + (set! (-> this type) game-save) ) (else (format 0 "ERROR: SAVEGAME: save file ~A did not read correctly.~%" s5-0) - (set! (-> obj length) 0) + (set! (-> this length) 0) 0 ) ) @@ -1598,16 +1598,16 @@ (format 0 "ERROR: SAVEGAME: save file ~A is too big~%" s5-0) ) ) - (set! (-> obj allocated-length) s4-0) + (set! (-> this allocated-length) s4-0) ) - (when (!= (-> obj version) 3) - (format 0 "ERROR: SAVEGAME: save file ~A was version ~d, but only ~d is supported.~%" s5-0 (-> obj version) 3) - (set! (-> obj length) 0) + (when (!= (-> this version) 3) + (format 0 "ERROR: SAVEGAME: save file ~A was version ~d, but only ~d is supported.~%" s5-0 (-> this version) 3) + (set! (-> this length) 0) 0 ) (file-stream-close s5-0) ) - obj + this ) (define *auto-save-info* (new 'global 'mc-slot-info)) diff --git a/goal_src/jak2/engine/game/idle-control.gc b/goal_src/jak2/engine/game/idle-control.gc index 70a7dc521c..3c9e996659 100644 --- a/goal_src/jak2/engine/game/idle-control.gc +++ b/goal_src/jak2/engine/game/idle-control.gc @@ -43,35 +43,35 @@ ;; WARN: Return type mismatch idle-control vs none. -(defmethod idle-control-method-9 idle-control ((obj idle-control) (arg0 (pointer idle-control-frame))) - (set! (-> obj anim) arg0) - (set! (-> obj current) arg0) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) +(defmethod idle-control-method-9 idle-control ((this idle-control) (arg0 (pointer idle-control-frame))) + (set! (-> this anim) arg0) + (set! (-> this current) arg0) + (set! (-> this counter) 0) + (set! (-> this target) 0) (none) ) ;; TODO - method manually patched (maybe incorrectly) around `self` changing ;; WARN: Function (method 10 idle-control) has a return type of none, but the expression builder found a return statement. -(defmethod idle-control-method-10 idle-control ((obj idle-control) (arg0 process-drawable)) +(defmethod idle-control-method-10 idle-control ((this idle-control) (arg0 process-drawable)) (local-vars (a1-1 int) (backup-pp process)) - (when (nonzero? (-> obj anim)) + (when (nonzero? (-> this anim)) (with-pp (set! backup-pp pp) (set! pp arg0) (loop - (let ((s4-0 (-> obj current 0))) + (let ((s4-0 (-> this current 0))) (case (-> s4-0 command) (((ic-cmd play)) (if (< (-> s4-0 anim) 0) (return #f) ) - (when (zero? (-> obj target)) + (when (zero? (-> this target)) (let ((t9-0 rand-vu-int-range) (a0-3 (-> s4-0 param0)) ) (shift-arith-right-32 a1-1 s4-0 24) - (set! (-> obj target) (t9-0 (the-as int a0-3) a1-1)) + (set! (-> this target) (t9-0 (the-as int a0-3) a1-1)) ) (ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)) :num! min) (return #f) @@ -79,12 +79,12 @@ (ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)) :num! (seek!)) (cond ((ja-done? 0) - (+! (-> obj counter) 1) + (+! (-> this counter) 1) (cond - ((>= (-> obj counter) (-> obj target)) - (set! (-> obj current) (&-> (-> obj current) 1)) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) + ((>= (-> this counter) (-> this target)) + (set! (-> this current) (&-> (-> this current) 1)) + (set! (-> this counter) 0) + (set! (-> this target) 0) 0 ) (else @@ -100,15 +100,15 @@ ) (((ic-cmd push)) (ja-channel-push! 1 (the-as time-frame (-> s4-0 param0))) - (set! (-> obj current) (&-> (-> obj current) 1)) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) + (set! (-> this current) (&-> (-> this current) 1)) + (set! (-> this counter) 0) + (set! (-> this target) 0) 0 ) (((ic-cmd restart)) - (set! (-> obj current) (-> obj anim)) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) + (set! (-> this current) (-> this anim)) + (set! (-> this counter) 0) + (set! (-> this target) 0) 0 ) ) diff --git a/goal_src/jak2/engine/game/main.gc b/goal_src/jak2/engine/game/main.gc index 356f027a43..7b69e48830 100644 --- a/goal_src/jak2/engine/game/main.gc +++ b/goal_src/jak2/engine/game/main.gc @@ -313,7 +313,7 @@ (define *screen-filter* (new 'static 'screen-filter :draw? #f :bucket (bucket-id screen-filter))) -(defmethod draw screen-filter ((obj screen-filter)) +(defmethod draw screen-filter ((this screen-filter)) (local-vars (v1-1 float)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -323,30 +323,30 @@ ) (init-vf0-vector) (when (not (paused?)) - (.lvf vf4 (&-> obj extra quad)) - (.lvf vf1 (&-> obj color-dest quad)) - (.lvf vf2 (&-> obj color quad)) + (.lvf vf4 (&-> this extra quad)) + (.lvf vf1 (&-> this color-dest quad)) + (.lvf vf2 (&-> this color quad)) (.sub.vf vf3 vf1 vf2) (.add.x.vf vf4 vf4 vf4 :mask #b10) (.min.w.vf vf4 vf4 vf0 :mask #b10) (.max.y.vf vf4 vf4 vf0 :mask #b10) (.mul.y.vf vf3 vf3 vf4) (.add.vf vf1 vf2 vf3) - (.svf (&-> obj extra quad) vf4) - (.svf (&-> obj color quad) vf1) + (.svf (&-> this extra quad) vf4) + (.svf (&-> this color quad) vf1) (.mov v1-1 vf1) ) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) - (-> obj bucket) + (-> this bucket) ) (dma-buffer-add-gs-set s4-0 (test-1 (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))) ) (let ((t1-0 (new 'static 'rgba - :r (the int (-> obj color x)) - :g (the int (-> obj color y)) - :b (the int (-> obj color z)) - :a (the int (-> obj color w)) + :r (the int (-> this color x)) + :g (the int (-> this color y)) + :b (the int (-> this color z)) + :a (the int (-> this color w)) ) ) ) @@ -358,20 +358,20 @@ ) ) -(defmethod setup screen-filter ((obj screen-filter) (arg0 vector) (arg1 vector) (arg2 float) (arg3 bucket-id)) - (set! (-> obj draw?) #t) - (set! (-> obj color quad) (-> arg0 quad)) - (set! (-> obj color-src quad) (-> arg0 quad)) - (set! (-> obj color-dest quad) (-> arg1 quad)) - (set! (-> obj extra x) arg2) - (set! (-> obj extra y) 0.0) - (set! (-> obj bucket) arg3) +(defmethod setup screen-filter ((this screen-filter) (arg0 vector) (arg1 vector) (arg2 float) (arg3 bucket-id)) + (set! (-> this draw?) #t) + (set! (-> this color quad) (-> arg0 quad)) + (set! (-> this color-src quad) (-> arg0 quad)) + (set! (-> this color-dest quad) (-> arg1 quad)) + (set! (-> this extra x) arg2) + (set! (-> this extra y) 0.0) + (set! (-> this bucket) arg3) 0 (none) ) -(defmethod disable screen-filter ((obj screen-filter)) - (set! (-> obj draw?) #f) +(defmethod disable screen-filter ((this screen-filter)) + (set! (-> this draw?) #f) 0 (none) ) diff --git a/goal_src/jak2/engine/game/settings-h.gc b/goal_src/jak2/engine/game/settings-h.gc index 42fc4cf7ff..6247b99924 100644 --- a/goal_src/jak2/engine/game/settings-h.gc +++ b/goal_src/jak2/engine/game/settings-h.gc @@ -147,7 +147,7 @@ (allow-pause symbol :offset-assert 104) (ocean-off symbol :offset-assert 108) (allow-look-around symbol :offset-assert 112) - (camera-stick-dir symbol :offset-assert 116) + (camera-stick-dir symbol :offset-assert 116) (movie-name symbol :offset 120) (weather symbol :offset-assert 124) (mouse symbol :offset-assert 128) diff --git a/goal_src/jak2/engine/game/settings.gc b/goal_src/jak2/engine/game/settings.gc index 955f0e2bf0..3749762fd4 100644 --- a/goal_src/jak2/engine/game/settings.gc +++ b/goal_src/jak2/engine/game/settings.gc @@ -15,11 +15,11 @@ (-> *setting-control* user-current language) ) -(defmethod user-setting-data-method-9 user-setting-data ((obj user-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) +(defmethod user-setting-data-method-9 user-setting-data ((this user-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) (let ((s3-0 (-> arg1 alive-list))) (while s3-0 (user-setting-data-method-10 - obj + this (-> s3-0 param 0) (the-as symbol (-> s3-0 param 1)) (the-as float (-> s3-0 param 2)) @@ -39,7 +39,7 @@ (= ((method-of-type connection get-process) (the-as connection s3-1)) (ppointer->process *progress-process*)) ) (user-setting-data-method-10 - obj + this s1-0 (the-as symbol (-> (the-as connection s3-1) param1)) (the-as float (-> (the-as connection s3-1) param2)) @@ -49,7 +49,7 @@ ) (else (user-setting-data-method-10 - obj + this s1-0 (the-as symbol (-> (the-as connection s3-1) param1)) (the-as float (-> (the-as connection s3-1) param2)) @@ -67,7 +67,7 @@ ) (while (!= v1-21 (-> arg2 alive-list-end)) (user-setting-data-method-10 - obj + this (-> (the-as connection v1-21) param0) (the-as symbol (-> (the-as connection v1-21) param1)) (the-as float (-> (the-as connection v1-21) param2)) @@ -77,416 +77,416 @@ (set! s4-1 (-> s4-1 next0)) ) ) - obj + this ) -(defmethod user-setting-data-method-10 user-setting-data ((obj user-setting-data) (arg0 object) (arg1 symbol) (arg2 float) (arg3 uint)) +(defmethod user-setting-data-method-10 user-setting-data ((this user-setting-data) (arg0 object) (arg1 symbol) (arg2 float) (arg3 uint)) "set-defaults! perhaps?" (case arg0 (('border-mode) - (set! (-> obj border-mode) arg1) + (set! (-> this border-mode) arg1) ) (('region-mode) - (set! (-> obj region-mode) arg1) + (set! (-> this region-mode) arg1) ) (('allow-look-around) - (set! (-> obj allow-look-around) arg1) + (set! (-> this allow-look-around) arg1) ) (('ocean-off) - (set! (-> obj ocean-off) arg1) + (set! (-> this ocean-off) arg1) ) (('weather) - (set! (-> obj weather) arg1) + (set! (-> this weather) arg1) ) (('mouse) - (set! (-> obj mouse) arg1) + (set! (-> this mouse) arg1) ) (('cursor) - (set! (-> obj cursor) arg1) + (set! (-> this cursor) arg1) ) (('music) - (set! (-> obj music) arg1) + (set! (-> this music) arg1) ) (('extra-bank) - (set! (-> obj extra-bank) (the-as pair arg1)) + (set! (-> this extra-bank) (the-as pair arg1)) ) (('process-mask) (case arg1 (('set) - (logior! (-> obj process-mask) arg3) + (logior! (-> this process-mask) arg3) ) (('clear) - (logclear! (-> obj process-mask) arg3) + (logclear! (-> this process-mask) arg3) ) (('abs) - (set! (-> obj process-mask) (the-as process-mask arg3)) + (set! (-> this process-mask) (the-as process-mask arg3)) ) ) ) (('task-mask) (case arg1 (('set) - (logior! (-> obj task-mask) arg3) + (logior! (-> this task-mask) arg3) ) (('clear) - (logclear! (-> obj task-mask) arg3) + (logclear! (-> this task-mask) arg3) ) (('abs) - (set! (-> obj task-mask) (the-as task-mask arg3)) + (set! (-> this task-mask) (the-as task-mask arg3)) ) ) ) (('task-manager) - (set! (-> obj task-manager) (the-as (pointer process) arg1)) + (set! (-> this task-manager) (the-as (pointer process) arg1)) ) (('task) - (set! (-> obj task) arg1) + (set! (-> this task) arg1) ) (('exclusive-task) - (set! (-> obj exclusive-task) (the-as int arg3)) + (set! (-> this exclusive-task) (the-as int arg3)) ) (('exclusive-load) - (set! (-> obj exclusive-load) arg1) + (set! (-> this exclusive-load) arg1) ) (('sfx-volume) (case arg1 (('rel) - (set! (-> obj sfx-volume) (* (-> obj sfx-volume) arg2)) + (set! (-> this sfx-volume) (* (-> this sfx-volume) arg2)) ) (else - (set! (-> obj sfx-volume) arg2) + (set! (-> this sfx-volume) arg2) ) ) ) (('music-volume) (case arg1 (('rel) - (set! (-> obj music-volume) (* (-> obj music-volume) arg2)) + (set! (-> this music-volume) (* (-> this music-volume) arg2)) ) (else - (set! (-> obj music-volume) arg2) + (set! (-> this music-volume) arg2) ) ) ) (('ambient-volume) (case arg1 (('rel) - (set! (-> obj ambient-volume) (* (-> obj ambient-volume) arg2)) + (set! (-> this ambient-volume) (* (-> this ambient-volume) arg2)) ) (else - (set! (-> obj ambient-volume) arg2) + (set! (-> this ambient-volume) arg2) ) ) ) (('dialog-volume) (case arg1 (('rel) - (set! (-> obj dialog-volume) (* (-> obj dialog-volume) arg2)) + (set! (-> this dialog-volume) (* (-> this dialog-volume) arg2)) ) (else - (set! (-> obj dialog-volume) arg2) + (set! (-> this dialog-volume) arg2) ) ) ) (('sfx-volume-movie) (case arg1 (('rel) - (set! (-> obj sfx-movie-volume) (* (-> obj sfx-movie-volume) arg2)) + (set! (-> this sfx-movie-volume) (* (-> this sfx-movie-volume) arg2)) ) (else - (set! (-> obj sfx-movie-volume) arg2) + (set! (-> this sfx-movie-volume) arg2) ) ) ) (('music-volume-movie) (case arg1 (('rel) - (set! (-> obj music-volume-movie) (* (-> obj music-volume-movie) arg2)) + (set! (-> this music-volume-movie) (* (-> this music-volume-movie) arg2)) ) (else - (set! (-> obj music-volume-movie) arg2) + (set! (-> this music-volume-movie) arg2) ) ) ) (('ambient-volume-movie) (case arg1 (('rel) - (set! (-> obj ambient-volume-move) (* (-> obj ambient-volume-move) arg2)) + (set! (-> this ambient-volume-move) (* (-> this ambient-volume-move) arg2)) ) (else - (set! (-> obj ambient-volume-move) arg2) + (set! (-> this ambient-volume-move) arg2) ) ) ) (('dialog-volume-hint) (case arg1 (('rel) - (set! (-> obj dialog-volume-hint) (* (-> obj dialog-volume-hint) arg2)) + (set! (-> this dialog-volume-hint) (* (-> this dialog-volume-hint) arg2)) ) (else - (set! (-> obj dialog-volume-hint) arg2) + (set! (-> this dialog-volume-hint) arg2) ) ) ) (('sound-flava) - (when (>= arg2 (-> obj sound-flava-priority)) - (set! (-> obj sound-flava) arg3) - (set! (-> obj sound-flava-priority) arg2) + (when (>= arg2 (-> this sound-flava-priority)) + (set! (-> this sound-flava) arg3) + (set! (-> this sound-flava-priority) arg2) ) ) (('sound-mode) - (set! (-> obj sound-mode) arg3) + (set! (-> this sound-mode) arg3) ) (('sound-tune) - (set! (-> obj sound-tune) arg3) + (set! (-> this sound-tune) arg3) ) (('sound-excitement) (case arg1 (('rel) - (set! (-> obj sound-excitement) (* (-> obj sound-excitement) arg2)) + (set! (-> this sound-excitement) (* (-> this sound-excitement) arg2)) ) (('add) - (+! (-> obj sound-excitement) arg2) + (+! (-> this sound-excitement) arg2) ) (else - (set! (-> obj sound-excitement) arg2) + (set! (-> this sound-excitement) arg2) ) ) ) (('sound-reverb) (case arg1 (('rel) - (set! (-> obj sound-reverb) (* (-> obj sound-reverb) arg2)) + (set! (-> this sound-reverb) (* (-> this sound-reverb) arg2)) ) (('add) - (+! (-> obj sound-reverb) arg2) + (+! (-> this sound-reverb) arg2) ) (else - (set! (-> obj sound-reverb) arg2) + (set! (-> this sound-reverb) arg2) ) ) ) (('mode-sound-bank) - (set! (-> obj mode-sound-bank) (the-as uint arg1)) + (set! (-> this mode-sound-bank) (the-as uint arg1)) ) (('spotlight-color) - (set! (-> obj spotlight-color) (the-as rgba arg3)) + (set! (-> this spotlight-color) (the-as rgba arg3)) ) (('bg-r) - (set! (-> obj bg-r) arg2) + (set! (-> this bg-r) arg2) ) (('bg-g) - (set! (-> obj bg-g) arg2) + (set! (-> this bg-g) arg2) ) (('bg-b) - (set! (-> obj bg-b) arg2) + (set! (-> this bg-b) arg2) ) (('bg-a) - (set! (-> obj bg-a) arg2) + (set! (-> this bg-a) arg2) ) (('bg-a-speed) - (set! (-> obj bg-a-speed) arg2) + (set! (-> this bg-a-speed) arg2) ) (('bg-a-force) - (set! (-> obj bg-a-force) arg2) + (set! (-> this bg-a-force) arg2) ) (('allow-blackout) - (set! (-> obj allow-blackout) arg1) + (set! (-> this allow-blackout) arg1) ) (('rain) - (set! (-> obj rain) arg2) + (set! (-> this rain) arg2) ) (('snow) - (set! (-> obj snow) arg2) + (set! (-> this snow) arg2) ) (('language) - (set! (-> obj language) (the-as language-enum arg3)) + (set! (-> this language) (the-as language-enum arg3)) ) (('subtitle-language) - (set! (-> obj subtitle-language) (the-as language-enum arg3)) + (set! (-> this subtitle-language) (the-as language-enum arg3)) ) (('vibration) - (set! (-> obj vibration) arg1) + (set! (-> this vibration) arg1) ) (('auto-save) - (set! (-> obj auto-save) arg1) + (set! (-> this auto-save) arg1) ) (('allow-pause) - (set! (-> obj allow-pause) arg1) + (set! (-> this allow-pause) arg1) ) (('allow-progress) - (set! (-> obj allow-progress) arg1) + (set! (-> this allow-progress) arg1) ) (('allow-continue) - (set! (-> obj allow-continue) arg1) + (set! (-> this allow-continue) arg1) ) (('allow-timeout) - (set! (-> obj allow-timeout) arg1) + (set! (-> this allow-timeout) arg1) ) (('allow-error) - (set! (-> obj allow-error) arg1) + (set! (-> this allow-error) arg1) ) (('under-water-pitch-mod) - (set! (-> obj under-water-pitch-mod) arg2) + (set! (-> this under-water-pitch-mod) arg2) ) (('sound-bank-load) - (set! (-> obj sound-bank-load) arg1) + (set! (-> this sound-bank-load) arg1) ) (('play-hints) - (set! (-> obj play-hints) arg1) + (set! (-> this play-hints) arg1) ) (('subtitle) - (set! (-> obj subtitle) arg1) + (set! (-> this subtitle) arg1) ) (('mirror) - (set! (-> obj mirror) arg1) + (set! (-> this mirror) arg1) ) (('movie) - (set! (-> obj movie) (the-as (pointer process) arg1)) + (set! (-> this movie) (the-as (pointer process) arg1)) ) (('movie-name) - (set! (-> obj movie-name) arg1) + (set! (-> this movie-name) arg1) ) (('movie-skip-frame) - (set! (-> obj movie-skip-frame) arg2) + (set! (-> this movie-skip-frame) arg2) ) (('talking) - (set! (-> obj talking) (the-as (pointer process) arg1)) + (set! (-> this talking) (the-as (pointer process) arg1)) ) (('spooling) - (set! (-> obj spooling) (the-as (pointer process) arg1)) + (set! (-> this spooling) (the-as (pointer process) arg1)) ) (('spool-anim) - (set! (-> obj spool-anim) (the-as spool-anim arg1)) + (set! (-> this spool-anim) (the-as spool-anim arg1)) ) (('hint) - (set! (-> obj hint) (the-as (pointer process) arg1)) + (set! (-> this hint) (the-as (pointer process) arg1)) ) (('ambient) - (set! (-> obj ambient) (the-as (pointer process) arg1)) + (set! (-> this ambient) (the-as (pointer process) arg1)) ) (('common-page) (case arg1 (('set) - (logior! (-> obj unknown-int32-00) arg3) + (logior! (-> this unknown-int32-00) arg3) ) (('clear) - (logclear! (-> obj unknown-int32-00) arg3) + (logclear! (-> this unknown-int32-00) arg3) ) ) ) (('duck) - (set! (-> obj duck) arg1) + (set! (-> this duck) arg1) ) (('jump) - (set! (-> obj jump) arg1) + (set! (-> this jump) arg1) ) (('double-jump) - (set! (-> obj double-jump) arg1) + (set! (-> this double-jump) arg1) ) (('darkjak) - (set! (-> obj darkjak) arg1) + (set! (-> this darkjak) arg1) ) (('endlessfall) - (set! (-> obj endlessfall) arg1) + (set! (-> this endlessfall) arg1) ) (('pilot) - (set! (-> obj pilot) arg1) + (set! (-> this pilot) arg1) ) (('pilot-exit) - (set! (-> obj pilot-exit) arg1) + (set! (-> this pilot-exit) arg1) ) (('attack) - (set! (-> obj attack) arg1) + (set! (-> this attack) arg1) ) (('board) - (set! (-> obj board) arg1) + (set! (-> this board) arg1) ) (('gun) - (set! (-> obj gun) arg1) + (set! (-> this gun) arg1) ) (('doorway) - (set! (-> obj doorway) arg1) + (set! (-> this doorway) arg1) ) (('calm) - (set! (-> obj attack) (not arg1)) - (set! (-> obj gun) (not arg1)) - (set! (-> obj board) (not arg1)) - (set! (-> obj jump) (not arg1)) - (set! (-> obj double-jump) (not arg1)) - (set! (-> obj darkjak) (not arg1)) - (set! (-> obj pilot) (not arg1)) + (set! (-> this attack) (not arg1)) + (set! (-> this gun) (not arg1)) + (set! (-> this board) (not arg1)) + (set! (-> this jump) (not arg1)) + (set! (-> this double-jump) (not arg1)) + (set! (-> this darkjak) (not arg1)) + (set! (-> this pilot) (not arg1)) (case arg1 ((#t) - (set! (-> obj speed-mult) 0.5) + (set! (-> this speed-mult) 0.5) ) ) ) (('airlock) - (set! (-> obj airlock) arg1) + (set! (-> this airlock) arg1) ) (('gun-buoy) - (set! (-> obj gun-buoy) arg1) + (set! (-> this gun-buoy) arg1) ) (('ignore-target) - (set! (-> obj ignore-target) arg1) + (set! (-> this ignore-target) arg1) ) (('speech-control) - (set! (-> obj speech-control) arg1) + (set! (-> this speech-control) arg1) ) (('vehicle-hijacking) - (set! (-> obj vehicle-hijacking) arg1) + (set! (-> this vehicle-hijacking) arg1) ) (('features) (case arg1 (('set) - (logior! (-> obj features) arg3) + (logior! (-> this features) arg3) ) (('clear) - (logclear! (-> obj features) arg3) + (logclear! (-> this features) arg3) ) (('abs) - (set! (-> obj features) (the-as game-feature arg3)) + (set! (-> this features) (the-as game-feature arg3)) ) ) ) (('gem) - (set! (-> obj gem) arg1) + (set! (-> this gem) arg1) ) (('minimap) (case arg1 (('set) - (logior! (-> obj minimap) arg3) + (logior! (-> this minimap) arg3) ) (('clear) - (logclear! (-> obj minimap) arg3) + (logclear! (-> this minimap) arg3) ) (('abs) - (set! (-> obj minimap) arg3) + (set! (-> this minimap) arg3) ) ) ) (('race-minimap) - (set! (-> obj race-minimap) (the-as int arg3)) + (set! (-> this race-minimap) (the-as int arg3)) ) (('borrow) - (set! (-> obj borrow) (the-as pair arg1)) + (set! (-> this borrow) (the-as pair arg1)) ) (('half-speed) - (set! (-> obj half-speed) arg1) + (set! (-> this half-speed) arg1) ) (('render) - (set! (-> obj render) arg1) + (set! (-> this render) arg1) ) ) - obj + this ) -(defmethod cam-setting-data-method-9 cam-setting-data ((obj cam-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) +(defmethod cam-setting-data-method-9 cam-setting-data ((this cam-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) (let ((s3-0 (-> arg1 alive-list))) (while s3-0 (cam-setting-data-method-10 - obj + this (-> s3-0 param 0) (the-as (pointer process) (-> s3-0 param 1)) (the-as float (-> s3-0 param 2)) @@ -506,7 +506,7 @@ (= ((method-of-type connection get-process) (the-as connection s3-1)) (ppointer->process *progress-process*)) ) (cam-setting-data-method-10 - obj + this s1-0 (the-as (pointer process) (-> (the-as connection s3-1) param1)) (the-as float (-> (the-as connection s3-1) param2)) @@ -516,7 +516,7 @@ ) (else (cam-setting-data-method-10 - obj + this s1-0 (the-as (pointer process) (-> (the-as connection s3-1) param1)) (the-as float (-> (the-as connection s3-1) param2)) @@ -534,7 +534,7 @@ ) (while (!= v1-21 (-> arg2 alive-list-end)) (cam-setting-data-method-10 - obj + this (-> (the-as connection v1-21) param0) (the-as (pointer process) (-> (the-as connection v1-21) param1)) (the-as float (-> (the-as connection v1-21) param2)) @@ -544,169 +544,169 @@ (set! s4-1 (-> s4-1 next0)) ) ) - obj + this ) -(defmethod cam-setting-data-method-10 cam-setting-data ((obj cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int)) +(defmethod cam-setting-data-method-10 cam-setting-data ((this cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int)) (case arg0 (('fov) (if (= arg1 'rel) - (set! (-> obj fov) (* (-> obj fov) arg2)) - (set! (-> obj fov) arg2) + (set! (-> this fov) (* (-> this fov) arg2)) + (set! (-> this fov) arg2) ) ) (('pov-handle) (let ((a0-6 (new 'static 'handle :process arg1 :pid arg3))) (when (handle->process a0-6) - (set! (-> obj pov-handle) a0-6) - (set! (-> obj pov-bone) (the int arg2)) + (set! (-> this pov-handle) a0-6) + (set! (-> this pov-bone) (the int arg2)) ) ) ) (('pov-offset) - (set! (-> obj pov-offset quad) (-> (the-as vector arg2) quad)) + (set! (-> this pov-offset quad) (-> (the-as vector arg2) quad)) ) (('string-max-length) (case arg1 (('low) - (if (-> obj string-max-length-default) - (set! (-> obj string-max-length) arg2) + (if (-> this string-max-length-default) + (set! (-> this string-max-length) arg2) ) ) (('rel) - (set! (-> obj string-max-length) (* (-> obj string-max-length) arg2)) + (set! (-> this string-max-length) (* (-> this string-max-length) arg2)) ) (else - (set! (-> obj string-max-length) arg2) + (set! (-> this string-max-length) arg2) ) ) - (set! (-> obj string-default) #f) - (set! (-> obj string-max-length-default) #f) + (set! (-> this string-default) #f) + (set! (-> this string-max-length-default) #f) ) (('string-min-length) (case arg1 (('low) - (if (-> obj string-min-length-default) - (set! (-> obj string-min-length) arg2) + (if (-> this string-min-length-default) + (set! (-> this string-min-length) arg2) ) ) (('rel) - (set! (-> obj string-min-length) (* (-> obj string-min-length) arg2)) + (set! (-> this string-min-length) (* (-> this string-min-length) arg2)) ) (else - (set! (-> obj string-min-length) arg2) + (set! (-> this string-min-length) arg2) ) ) - (set! (-> obj string-default) #f) - (set! (-> obj string-min-length-default) #f) + (set! (-> this string-default) #f) + (set! (-> this string-min-length-default) #f) ) (('string-max-height) (case arg1 (('low) - (if (-> obj string-max-height-default) - (set! (-> obj string-max-height) arg2) + (if (-> this string-max-height-default) + (set! (-> this string-max-height) arg2) ) ) (('rel) - (set! (-> obj string-max-height) (* (-> obj string-max-height) arg2)) + (set! (-> this string-max-height) (* (-> this string-max-height) arg2)) ) (else - (set! (-> obj string-max-height) arg2) + (set! (-> this string-max-height) arg2) ) ) - (set! (-> obj string-default) #f) - (set! (-> obj string-max-height-default) #f) + (set! (-> this string-default) #f) + (set! (-> this string-max-height-default) #f) ) (('string-min-height) (case arg1 (('low) - (if (-> obj string-min-height-default) - (set! (-> obj string-min-height) arg2) + (if (-> this string-min-height-default) + (set! (-> this string-min-height) arg2) ) ) (('rel) - (set! (-> obj string-min-height) (* (-> obj string-min-height) arg2)) + (set! (-> this string-min-height) (* (-> this string-min-height) arg2)) ) (else - (set! (-> obj string-min-height) arg2) + (set! (-> this string-min-height) arg2) ) ) - (set! (-> obj string-default) #f) - (set! (-> obj string-min-height-default) #f) + (set! (-> this string-default) #f) + (set! (-> this string-min-height-default) #f) ) (('string-cliff-height) - (set! (-> obj string-cliff-height) arg2) - (set! (-> obj string-default) #f) + (set! (-> this string-cliff-height) arg2) + (set! (-> this string-default) #f) ) (('string-camera-ceiling) - (set! (-> obj string-camera-ceiling) arg2) - (set! (-> obj string-default) #f) + (set! (-> this string-camera-ceiling) arg2) + (set! (-> this string-default) #f) ) (('gun-max-height) - (set! (-> obj gun-max-height) arg2) + (set! (-> this gun-max-height) arg2) ) (('gun-min-height) - (set! (-> obj gun-min-height) arg2) + (set! (-> this gun-min-height) arg2) ) (('string-local-down) - (vector-normalize-copy! (-> obj string-local-down) (the-as vector arg2) 1.0) + (vector-normalize-copy! (-> this string-local-down) (the-as vector arg2) 1.0) ) (('slave-options) (case arg1 (('set) - (logior! (-> obj slave-options) arg3) + (logior! (-> this slave-options) arg3) ) (('clear) - (logclear! (-> obj slave-options) arg3) + (logclear! (-> this slave-options) arg3) ) (('abs) - (set! (-> obj slave-options) (the-as cam-slave-options arg3)) + (set! (-> this slave-options) (the-as cam-slave-options arg3)) ) ) ) (('rapid-tracking) - (logior! (-> obj slave-options) (cam-slave-options RAPID_TRACKING)) + (logior! (-> this slave-options) (cam-slave-options RAPID_TRACKING)) ) (('bike-mode) - (logior! (-> obj slave-options) (cam-slave-options BIKE_MODE)) + (logior! (-> this slave-options) (cam-slave-options BIKE_MODE)) ) (('vertical-follow-matches-camera) - (logior! (-> obj slave-options) (cam-slave-options VERTICAL_FOLLOW_MATCHES_CAMERA)) + (logior! (-> this slave-options) (cam-slave-options VERTICAL_FOLLOW_MATCHES_CAMERA)) ) (('matrix-blend-max-angle) - (set! (-> obj matrix-blend-max-angle) arg2) + (set! (-> this matrix-blend-max-angle) arg2) ) (('matrix-blend-max-partial) - (set! (-> obj matrix-blend-max-partial) arg2) + (set! (-> this matrix-blend-max-partial) arg2) ) ;; og:preserve-this fixed copypasta bug from original game (('string-spline-max-move) - (set! (-> obj string-spline-max-move) arg2) + (set! (-> this string-spline-max-move) arg2) ) (('string-spline-accel) - (set! (-> obj string-spline-accel) arg2) + (set! (-> this string-spline-accel) arg2) ) (('string-spline-max-move-player) - (set! (-> obj string-spline-max-move-player) arg2) + (set! (-> this string-spline-max-move-player) arg2) ) (('string-spline-accel-player) - (set! (-> obj string-spline-accel-player) arg2) + (set! (-> this string-spline-accel-player) arg2) ) (('target-height) - (set! (-> obj target-height) arg2) + (set! (-> this target-height) arg2) ) (('head-offset) - (set! (-> obj head-offset) arg2) + (set! (-> this head-offset) arg2) ) (('foot-offset) - (set! (-> obj foot-offset) arg2) + (set! (-> this foot-offset) arg2) ) (('teleport-on-entity-change) - (set! (-> obj teleport-on-entity-change) (the-as symbol arg2)) + (set! (-> this teleport-on-entity-change) (the-as symbol arg2)) ) (('entity-name) (when (or *target* (and *camera* (not (send-event *camera* 'query-state cam-free-floating)))) - (set! (-> obj entity-name) (the-as string arg1)) + (set! (-> this entity-name) (the-as string arg1)) (set! arg3 (cond ((= arg3 -1) 0 @@ -717,38 +717,38 @@ ) ) ) - (set! (-> obj entity-mask) (the-as uint arg3)) - (set! (-> obj mode-name) #f) + (set! (-> this entity-mask) (the-as uint arg3)) + (set! (-> this mode-name) #f) ) ) (('mode-name) - (set! (-> obj mode-name) (the-as symbol arg1)) - (set! (-> obj entity-name) #f) + (set! (-> this mode-name) (the-as symbol arg1)) + (set! (-> this entity-name) #f) ) (('master-options) (case arg1 (('set) - (logior! (-> obj master-options) arg3) + (logior! (-> this master-options) arg3) ) (('clear) - (logclear! (-> obj master-options) arg3) + (logclear! (-> this master-options) arg3) ) (('abs) - (set! (-> obj master-options) (the-as cam-master-options arg3)) + (set! (-> this master-options) (the-as cam-master-options arg3)) ) ) ) (('immediate-string-min-max) - (logior! (-> obj master-options) (cam-master-options IMMEDIATE_STRING_MIN_MAX)) + (logior! (-> this master-options) (cam-master-options IMMEDIATE_STRING_MIN_MAX)) ) (('no-intro) - (set! (-> obj no-intro) (the-as symbol arg2)) + (set! (-> this no-intro) (the-as symbol arg2)) ) (('mouse-input) - (set! (-> obj mouse-input) (the-as symbol arg2)) + (set! (-> this mouse-input) (the-as symbol arg2)) ) (('cpad1-skip-buttons) - (set! (-> obj cpad1-skip-buttons) (the-as symbol arg2)) + (set! (-> this cpad1-skip-buttons) (the-as symbol arg2)) ) (('interp-time) (let* ((v1-91 arg1) @@ -758,69 +758,69 @@ ) ) ) - (when (>= f0-34 (the float (-> obj interp-time-priority))) - (set! (-> obj interp-time) (the-as uint (the int arg2))) - (set! (-> obj interp-time-priority) (the-as uint (the int f0-34))) + (when (>= f0-34 (the float (-> this interp-time-priority))) + (set! (-> this interp-time) (the-as uint (the int arg2))) + (set! (-> this interp-time-priority) (the-as uint (the int f0-34))) ) ) ) (('string-startup-vector) - (set! (-> obj string-use-startup-vector) #t) - (set! (-> obj string-startup-vector quad) (-> (the-as vector arg2) quad)) + (set! (-> this string-use-startup-vector) #t) + (set! (-> this string-startup-vector quad) (-> (the-as vector arg2) quad)) ) (('look-at-point) - (set! (-> obj use-look-at-point) #t) - (set! (-> obj look-at-point quad) (-> (the-as vector arg2) quad)) + (set! (-> this use-look-at-point) #t) + (set! (-> this look-at-point quad) (-> (the-as vector arg2) quad)) ) (('point-of-interest) - (set! (-> obj use-point-of-interest) #t) - (set! (-> obj point-of-interest quad) (-> (the-as vector arg2) quad)) - (set! (-> obj handle-of-interest) (the-as handle #f)) + (set! (-> this use-point-of-interest) #t) + (set! (-> this point-of-interest quad) (-> (the-as vector arg2) quad)) + (set! (-> this handle-of-interest) (the-as handle #f)) ) (('mouse-tumble-point) - (set! (-> obj use-mouse-tumble-point) #t) - (set! (-> obj mouse-tumble-point quad) (-> (the-as vector arg2) quad)) + (set! (-> this use-mouse-tumble-point) #t) + (set! (-> this mouse-tumble-point quad) (-> (the-as vector arg2) quad)) ) (('handle-of-interest) (let ((a0-118 (new 'static 'handle :process arg1 :pid arg3))) (when (handle->process a0-118) - (set! (-> obj use-point-of-interest) #f) - (set! (-> obj handle-of-interest) a0-118) + (set! (-> this use-point-of-interest) #f) + (set! (-> this handle-of-interest) a0-118) ) ) ) (('butt-handle) (let ((a0-122 (new 'static 'handle :process arg1 :pid arg3))) (when (handle->process a0-122) - (set! (-> obj butt-handle) a0-122) - (set! (-> obj butt-angle) arg2) + (set! (-> this butt-handle) a0-122) + (set! (-> this butt-angle) arg2) ) ) ) (('extra-follow-height) - (set! (-> obj extra-follow-height) arg2) + (set! (-> this extra-follow-height) arg2) ) ) - obj + this ) -(defmethod add-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod add-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) "Originally called `setting-set` see (anon-function 48 script)" - (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) + (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) -(defmethod set-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) - (remove-setting obj arg0 arg1) - (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) +(defmethod set-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) + (remove-setting this arg0 arg1) + (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) -(defmethod persist-with-delay setting-control ((obj setting-control) (arg0 symbol) (arg1 time-frame) (arg2 symbol) (arg3 symbol) (arg4 float) (arg5 int)) +(defmethod persist-with-delay setting-control ((this setting-control) (arg0 symbol) (arg1 time-frame) (arg2 symbol) (arg3 symbol) (arg4 float) (arg5 int)) "Originally called `setting-pers` see (anon-function 46 script)" - (let ((v1-1 (schedule-callback (-> obj engine-pers) arg0 arg1))) + (let ((v1-1 (schedule-callback (-> this engine-pers) arg0 arg1))) (when v1-1 (set! (-> v1-1 param 0) arg2) (set! (-> v1-1 param 1) arg3) @@ -832,9 +832,9 @@ (none) ) -(defmethod remove-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol)) +(defmethod remove-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol)) (when arg0 - (let ((s5-0 (-> obj engine)) + (let ((s5-0 (-> this engine)) (s4-0 (-> arg0 connection-list next1)) ) (while s4-0 @@ -851,10 +851,10 @@ (none) ) -(defmethod kill-persister setting-control ((obj setting-control) (arg0 engine-pers) (arg1 object)) +(defmethod kill-persister setting-control ((this setting-control) (arg0 engine-pers) (arg1 object)) "Calls [[engine-pers::kill-matching]]" (kill-matching - (-> obj engine-pers) + (-> this engine-pers) (lambda ((arg0 engine-pers) (arg1 connection-pers) (arg2 object) (arg3 object)) (and (= (-> arg1 key) arg2) (= (-> arg1 param 0) arg3)) ) @@ -865,16 +865,16 @@ (none) ) -(defmethod setting-control-method-14 setting-control ((obj setting-control) (arg0 object)) - (let ((v1-1 (-> obj engine-hi alive-list next0))) - (-> obj engine-hi) +(defmethod setting-control-method-14 setting-control ((this setting-control) (arg0 object)) + (let ((v1-1 (-> this engine-hi alive-list next0))) + (-> this engine-hi) (let ((a2-2 (-> v1-1 next0))) - (while (!= v1-1 (-> obj engine-hi alive-list-end)) + (while (!= v1-1 (-> this engine-hi alive-list-end)) (if (= (-> (the-as connection v1-1) param0) arg0) (return v1-1) ) (set! v1-1 a2-2) - (-> obj engine-hi) + (-> this engine-hi) (set! a2-2 (-> a2-2 next0)) ) ) @@ -882,26 +882,26 @@ (the-as connectable #f) ) -(defmethod remove-setting-by-arg0 setting-control ((obj setting-control) (arg0 object)) +(defmethod remove-setting-by-arg0 setting-control ((this setting-control) (arg0 object)) "Calls [[engine::remove-by-param0]] on `engine-hi`" - (remove-by-param0 (-> obj engine-hi) arg0) + (remove-by-param0 (-> this engine-hi) arg0) 0 (none) ) -(defmethod set-setting-by-param setting-control ((obj setting-control) (arg0 symbol) (arg1 object) (arg2 object) (arg3 object)) +(defmethod set-setting-by-param setting-control ((this setting-control) (arg0 symbol) (arg1 object) (arg2 object) (arg3 object)) "Same as [[setting-control::set-setting]] but will [[engine::remove-by-param0]] using the symbol provided" - (remove-by-param0 (-> obj engine-hi) arg0) - (add-connection (-> obj engine-hi) *dproc* arg0 arg1 arg2 arg3) + (remove-by-param0 (-> this engine-hi) arg0) + (add-connection (-> this engine-hi) *dproc* arg0 arg1 arg2 arg3) ) -(defmethod apply-settings setting-control ((obj setting-control)) +(defmethod apply-settings setting-control ((this setting-control)) (speech-control-method-11 *speech-control*) - (let ((s5-0 (-> obj user-current))) - (let ((s4-0 (-> obj user-target))) - (mem-copy! (the-as pointer s4-0) (the-as pointer (-> obj user-default)) 528) - (set! (-> s4-0 ambient-volume) (* (-> obj user-default sfx-volume) (-> obj user-default ambient-volume))) - (user-setting-data-method-9 s4-0 (-> obj engine) (-> obj engine-pers) (-> obj engine-hi)) + (let ((s5-0 (-> this user-current))) + (let ((s4-0 (-> this user-target))) + (mem-copy! (the-as pointer s4-0) (the-as pointer (-> this user-default)) 528) + (set! (-> s4-0 ambient-volume) (* (-> this user-default sfx-volume) (-> this user-default ambient-volume))) + (user-setting-data-method-9 s4-0 (-> this engine) (-> this engine-pers) (-> this engine-hi)) ;; og:preserve-this check for target sound mode and music instead of current sound mode (when (= (-> s4-0 sound-mode) 1) (case (-> s4-0 music) @@ -1046,20 +1046,20 @@ ) ) ) - (-> obj cam-current) - (let ((s4-1 (-> obj cam-target))) - (mem-copy! (the-as pointer s4-1) (the-as pointer (-> obj cam-default)) 780) - (cam-setting-data-method-9 s4-1 (-> obj engine) (-> obj engine-pers) (-> obj engine-hi)) + (-> this cam-current) + (let ((s4-1 (-> this cam-target))) + (mem-copy! (the-as pointer s4-1) (the-as pointer (-> this cam-default)) 780) + (cam-setting-data-method-9 s4-1 (-> this engine) (-> this engine-pers) (-> this engine-hi)) ) - (-> obj user-current) + (-> this user-current) ) -(defmethod update setting-control ((obj setting-control)) +(defmethod update setting-control ((this setting-control)) (local-vars (v1-41 symbol)) - (run-pending-updates! (-> obj engine-pers) (-> *display* base-clock frame-counter)) - (apply-settings obj) - (let ((s5-0 (-> obj user-current))) - (let ((s4-0 (-> obj user-target))) + (run-pending-updates! (-> this engine-pers) (-> *display* base-clock frame-counter)) + (apply-settings this) + (let ((s5-0 (-> this user-current))) + (let ((s4-0 (-> this user-target))) (when *sound-player-enable* (when (!= (-> s5-0 sfx-volume) (-> s4-0 sfx-volume)) (seek! (-> s5-0 sfx-volume) (-> s4-0 sfx-volume) (seconds-per-frame)) @@ -1127,10 +1127,10 @@ ) (set! (-> s4-0 sound-excitement) (fmax 0.0 (fmin 0.99 (-> s4-0 sound-excitement)))) (set! (-> s4-0 sound-reverb) (fmax 0.0 (fmin 1.0 (-> s4-0 sound-reverb)))) - (when (and (nonzero? (-> obj user-default sound-stinger)) - (>= (- (-> *display* base-clock frame-counter) (-> obj sound-stinger-time)) (seconds 0.5)) + (when (and (nonzero? (-> this user-default sound-stinger)) + (>= (- (-> *display* base-clock frame-counter) (-> this sound-stinger-time)) (seconds 0.5)) ) - (set! (-> obj user-default sound-stinger) 0) + (set! (-> this user-default sound-stinger) 0) 0 ) (when *sound-player-enable* @@ -1158,39 +1158,39 @@ (when (!= (-> s5-0 sound-stinger) (-> s4-0 sound-stinger)) (set! (-> s5-0 sound-stinger) (-> s4-0 sound-stinger)) (sound-set-midi-reg 0 (-> s5-0 sound-stinger)) - (set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter)) + (set! (-> this sound-stinger-time) (-> *display* base-clock frame-counter)) ) - (when (!= (the int (* 4.0 (-> s4-0 sound-excitement))) (the int (* 4.0 (-> obj sound-excitement-targ)))) + (when (!= (the int (* 4.0 (-> s4-0 sound-excitement))) (the int (* 4.0 (-> this sound-excitement-targ)))) (let ((v1-87 (max 0 (min 3 (the int (* 4.0 (-> s4-0 sound-excitement))))))) - (when (and (< (-> obj sound-excitement-targ) (-> s4-0 sound-excitement)) - (< (the-as int (-> obj sound-excitement-level)) v1-87) - (zero? (-> obj user-default sound-stinger)) + (when (and (< (-> this sound-excitement-targ) (-> s4-0 sound-excitement)) + (< (the-as int (-> this sound-excitement-level)) v1-87) + (zero? (-> this user-default sound-stinger)) ) - (set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter)) - (set! (-> obj sound-stinger-change-time v1-87) (-> *display* base-clock frame-counter)) - (set! (-> obj user-default sound-stinger) (+ v1-87 9)) + (set! (-> this sound-stinger-time) (-> *display* base-clock frame-counter)) + (set! (-> this sound-stinger-change-time v1-87) (-> *display* base-clock frame-counter)) + (set! (-> this user-default sound-stinger) (+ v1-87 9)) ) (cond - ((< (the-as int (-> obj sound-excitement-level)) v1-87) - (set! (-> obj sound-excitement-level) (the-as uint v1-87)) + ((< (the-as int (-> this sound-excitement-level)) v1-87) + (set! (-> this sound-excitement-level) (the-as uint v1-87)) ) - ((< v1-87 (the-as int (+ (-> obj sound-excitement-level) -1))) - (set! (-> obj sound-excitement-level) (the-as uint (+ v1-87 1))) + ((< v1-87 (the-as int (+ (-> this sound-excitement-level) -1))) + (set! (-> this sound-excitement-level) (the-as uint (+ v1-87 1))) ) ((zero? v1-87) - (set! (-> obj sound-excitement-level) (the-as uint v1-87)) + (set! (-> this sound-excitement-level) (the-as uint v1-87)) ) ) ) - (set! (-> obj sound-excitement-change-time) (-> *display* base-clock frame-counter)) - (set! (-> obj sound-excitement-targ) (-> s4-0 sound-excitement)) + (set! (-> this sound-excitement-change-time) (-> *display* base-clock frame-counter)) + (set! (-> this sound-excitement-targ) (-> s4-0 sound-excitement)) ) - (when (and (!= (the int (* 4.0 (-> s5-0 sound-excitement))) (the int (* 4.0 (-> obj sound-excitement-targ)))) - (>= (- (-> *display* base-clock frame-counter) (-> obj sound-excitement-change-time)) (seconds 0.8)) + (when (and (!= (the int (* 4.0 (-> s5-0 sound-excitement))) (the int (* 4.0 (-> this sound-excitement-targ)))) + (>= (- (-> *display* base-clock frame-counter) (-> this sound-excitement-change-time)) (seconds 0.8)) ) - (max 0 (min 3 (the int (* 4.0 (-> obj sound-excitement-targ))))) + (max 0 (min 3 (the int (* 4.0 (-> this sound-excitement-targ))))) (sound-set-midi-reg 2 (the int (* 100.0 (-> s5-0 sound-excitement)))) - (set! (-> s5-0 sound-excitement) (-> obj sound-excitement-targ)) + (set! (-> s5-0 sound-excitement) (-> this sound-excitement-targ)) (sound-set-midi-reg 16 (the int (* 100.0 (-> s5-0 sound-excitement)))) ) ) @@ -1260,8 +1260,8 @@ (set! (-> *mouse* active) (-> s5-0 mouse)) (set! (-> *mouse* cursor) (the-as basic (and (-> s5-0 mouse) (-> s5-0 cursor)))) ) - (let ((s5-1 (-> obj cam-current))) - (let ((s4-1 (-> obj cam-target))) + (let ((s5-1 (-> this cam-current))) + (let ((s4-1 (-> this cam-target))) (set! (-> s5-1 entity-or-mode-changed) #f) (if (and (not (name= (-> s5-1 entity-name) (-> s4-1 entity-name))) (or (not *target*) (not (logtest? (-> *target* focus-status) (-> s4-1 entity-mask)))) @@ -1364,7 +1364,7 @@ (set! (-> s5-1 point-of-interest quad) (-> (get-trans a0-147 4) quad)) ) ) - (set! (-> obj cam-default point-of-interest quad) (-> s5-1 point-of-interest quad)) + (set! (-> this cam-default point-of-interest quad) (-> s5-1 point-of-interest quad)) (set! (-> s5-1 butt-handle) (-> s4-1 butt-handle)) (set! (-> s5-1 butt-angle) (-> s4-1 butt-angle)) (set! (-> s5-1 extra-follow-height) (-> s4-1 extra-follow-height)) @@ -1373,7 +1373,7 @@ (cam-master-activate-slave #f) ) ) - (-> obj user-current) + (-> this user-current) ) (when (zero? *setting-control*) diff --git a/goal_src/jak2/engine/game/task/task-arrow.gc b/goal_src/jak2/engine/game/task/task-arrow.gc index f2b0335df0..37a9197bf6 100644 --- a/goal_src/jak2/engine/game/task/task-arrow.gc +++ b/goal_src/jak2/engine/game/task/task-arrow.gc @@ -68,14 +68,14 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ) -(defmethod deactivate task-arrow ((obj task-arrow)) - (send-event (handle->process (-> obj hud-dist)) 'hide-and-die) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate task-arrow ((this task-arrow)) + (send-event (handle->process (-> this hud-dist)) 'hide-and-die) + ((method-of-type process-drawable deactivate) this) 0 (none) ) -(defmethod task-arrow-method-23 task-arrow ((obj task-arrow) (arg0 vector)) +(defmethod task-arrow-method-23 task-arrow ((this task-arrow) (arg0 vector)) "Some weird debugging code left here, but checks for collisions on the arrow" (let ((s5-0 (new 'stack-no-clear 'collide-query-with-vec))) (set! (-> s5-0 vec quad) (-> arg0 quad)) @@ -101,84 +101,84 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" (none) ) -(defmethod draw-arrow task-arrow ((obj task-arrow)) +(defmethod draw-arrow task-arrow ((this task-arrow)) (cond - ((logtest? (-> obj flags) (task-arrow-flags task-arrow-flag-00)) - (if (and (not (handle->process (-> obj hud-dist))) *target*) - (set! (-> obj hud-dist) (ppointer->handle (process-spawn hud-progress :init hud-init-by-other :to *target*))) + ((logtest? (-> this flags) (task-arrow-flags task-arrow-flag-00)) + (if (and (not (handle->process (-> this hud-dist))) *target*) + (set! (-> this hud-dist) (ppointer->handle (process-spawn hud-progress :init hud-init-by-other :to *target*))) ) - (let ((s5-1 (get-trail-for-connection *minimap* (-> obj minimap) #f))) + (let ((s5-1 (get-trail-for-connection *minimap* (-> this minimap) #f))) (if (and s5-1 (nonzero? (-> s5-1 last-updated))) - (set! (-> obj dist) (get-distance-with-path s5-1 (target-pos 0) (-> obj pos))) + (set! (-> this dist) (get-distance-with-path s5-1 (target-pos 0) (-> this pos))) ) ) - (if (= (-> obj max-dist) 0.0) - (set! (-> obj max-dist) (-> obj dist)) + (if (= (-> this max-dist) 0.0) + (set! (-> this max-dist) (-> this dist)) ) - (let ((f0-4 (- (-> obj dist) (-> obj smoothed-dist)))) + (let ((f0-4 (- (-> this dist) (-> this smoothed-dist)))) (if (< (fabs f0-4) 40960.0) - (+! (-> obj smoothed-dist) (* 10.0 (seconds-per-frame) f0-4)) - (set! (-> obj smoothed-dist) (-> obj dist)) + (+! (-> this smoothed-dist) (* 10.0 (seconds-per-frame) f0-4)) + (set! (-> this smoothed-dist) (-> this dist)) ) ) - (let ((f1-5 (/ (-> obj smoothed-dist) (-> obj max-dist)))) + (let ((f1-5 (/ (-> this smoothed-dist) (-> this max-dist)))) (set! (-> *game-info* distance) (- 1.0 (fmax 0.0 (fmin 1.0 f1-5)))) ) ) (else - (let ((a0-16 (handle->process (-> obj hud-dist)))) + (let ((a0-16 (handle->process (-> this hud-dist)))) (when a0-16 (send-event a0-16 'hide-and-die) - (set! (-> obj hud-dist) (the-as handle #f)) + (set! (-> this hud-dist) (the-as handle #f)) ) ) ) ) (cond - ((-> obj moving) - (set! (-> obj rod-of-god-scale) (- (-> obj rod-of-god-scale) (* 8.0 (seconds-per-frame)))) - (when (< (-> obj rod-of-god-scale) 0.0) - (set! (-> obj rod-of-god-scale) 0.0) - (set! (-> obj moving) #f) + ((-> this moving) + (set! (-> this rod-of-god-scale) (- (-> this rod-of-god-scale) (* 8.0 (seconds-per-frame)))) + (when (< (-> this rod-of-god-scale) 0.0) + (set! (-> this rod-of-god-scale) 0.0) + (set! (-> this moving) #f) (let ((f0-15 81920.0)) (cond - ((< (* f0-15 f0-15) (vector-vector-xz-distance-squared (-> obj pos) (-> obj root trans))) - (kill-callback (-> *minimap* engine) (-> obj minimap)) - (set! (-> obj root trans quad) (-> obj pos quad)) - (set! (-> obj minimap) (add-icon! *minimap* obj (-> obj map-icon) (the-as int #f) (the-as vector #t) 0)) + ((< (* f0-15 f0-15) (vector-vector-xz-distance-squared (-> this pos) (-> this root trans))) + (kill-callback (-> *minimap* engine) (-> this minimap)) + (set! (-> this root trans quad) (-> this pos quad)) + (set! (-> this minimap) (add-icon! *minimap* this (-> this map-icon) (the-as int #f) (the-as vector #t) 0)) ) (else - (set! (-> obj root trans quad) (-> obj pos quad)) + (set! (-> this root trans quad) (-> this pos quad)) ) ) ) ) ) (else - (set! (-> obj pos quad) (-> obj root trans quad)) - (+! (-> obj rod-of-god-scale) (* 8.0 (seconds-per-frame))) - (if (< 1.0 (-> obj rod-of-god-scale)) - (set! (-> obj rod-of-god-scale) 1.0) + (set! (-> this pos quad) (-> this root trans quad)) + (+! (-> this rod-of-god-scale) (* 8.0 (seconds-per-frame))) + (if (< 1.0 (-> this rod-of-god-scale)) + (set! (-> this rod-of-god-scale) 1.0) ) ) ) (cond - ((not (logtest? (-> obj flags) (task-arrow-flags task-arrow-flag-02))) - (set! (-> *part-id-table* 267 init-specs 4 initial-valuef) (* 24576.0 (-> obj rod-of-god-scale))) - (set! (-> *part-id-table* 270 init-specs 3 initial-valuef) (* 65536.0 (-> obj rod-of-god-scale))) - (set! (-> *part-id-table* 268 init-specs 9 initial-valuef) (* 20.0 (-> obj rod-of-god-scale))) - (spawn (-> obj part) (-> obj root trans)) + ((not (logtest? (-> this flags) (task-arrow-flags task-arrow-flag-02))) + (set! (-> *part-id-table* 267 init-specs 4 initial-valuef) (* 24576.0 (-> this rod-of-god-scale))) + (set! (-> *part-id-table* 270 init-specs 3 initial-valuef) (* 65536.0 (-> this rod-of-god-scale))) + (set! (-> *part-id-table* 268 init-specs 9 initial-valuef) (* 20.0 (-> this rod-of-god-scale))) + (spawn (-> this part) (-> this root trans)) ) (else - (+! (-> obj theta) (* 32768.0 (seconds-per-frame))) - (+! (-> obj phi) (* 9102.223 (seconds-per-frame))) - (set! (-> obj root trans quad) (-> obj pos quad)) - (set! (-> obj root trans y) (+ 28672.0 (* 4096.0 (cos (-> obj theta))) (-> obj pos y))) + (+! (-> this theta) (* 32768.0 (seconds-per-frame))) + (+! (-> this phi) (* 9102.223 (seconds-per-frame))) + (set! (-> this root trans quad) (-> this pos quad)) + (set! (-> this root trans y) (+ 28672.0 (* 4096.0 (cos (-> this theta))) (-> this pos y))) ) ) - (when (logtest? (-> obj flags) (task-arrow-flags task-arrow-flag-01)) - (quaternion-axis-angle! (-> obj root quat) 0.0 1.0 0.0 (-> obj phi)) - (quaternion-normalize! (quaternion*! (-> obj root quat) (-> obj base-quat) (-> obj root quat))) + (when (logtest? (-> this flags) (task-arrow-flags task-arrow-flag-01)) + (quaternion-axis-angle! (-> this root quat) 0.0 1.0 0.0 (-> this phi)) + (quaternion-normalize! (quaternion*! (-> this root quat) (-> this base-quat) (-> this root quat))) ) (ja-post) 0 diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index dbbbcebd50..71512ae21b 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -189,14 +189,14 @@ 0 ) -(defmethod level-method-22 level ((obj level) (arg0 symbol)) +(defmethod level-method-22 level ((this level) (arg0 symbol)) (if (= arg0 'none) (return 0) ) - (set! (-> obj task-mask) - (logand (-> obj info base-task-mask) (task-mask task0 task1 task2 task3 task4 task5 task6 task7 done)) + (set! (-> this task-mask) + (logand (-> this info base-task-mask) (task-mask task0 task1 task2 task3 task4 task5 task6 task7 done)) ) - (let ((name (-> obj info taskname)) + (let ((name (-> this info taskname)) (game-subtasks (-> *game-info* sub-task-list)) ) (dotimes (i (-> game-subtasks length)) @@ -205,13 +205,13 @@ (when (and (logtest? (-> subtask flags) (game-task-node-flag closed)) (= (-> subtask level) name)) (cond ((logtest? (-> subtask flags) (game-task-node-flag abs-task-mask)) - (set! (-> obj task-mask) (-> subtask task-mask)) + (set! (-> this task-mask) (-> subtask task-mask)) ) ((logtest? (-> subtask flags) (game-task-node-flag set-task-mask)) - (logior! (-> obj task-mask) (-> subtask task-mask)) + (logior! (-> this task-mask) (-> subtask task-mask)) ) ((logtest? (-> subtask flags) (game-task-node-flag clear-task-mask)) - (logclear! (-> obj task-mask) (-> subtask task-mask)) + (logclear! (-> this task-mask) (-> subtask task-mask)) ) ) ) @@ -219,7 +219,7 @@ ) ) ) - (case (-> obj name) + (case (-> this name) (('strip) (prototypes-game-visible-set! '("strip-ev-base-ring.mb" @@ -461,7 +461,7 @@ ) ) ) - (logior! (-> obj task-mask) (-> *setting-control* user-current task-mask)) + (logior! (-> this task-mask) (-> *setting-control* user-current task-mask)) 0 ) @@ -679,25 +679,25 @@ arg0 ) -(defmethod print game-task-node-info ((obj game-task-node-info)) +(defmethod print game-task-node-info ((this game-task-node-info)) (format #t "#" - (-> obj name) + (-> this name) (cond - ((logtest? (-> obj flags) (game-task-node-flag closed)) + ((logtest? (-> this flags) (game-task-node-flag closed)) "closed" ) - ((open? obj) + ((open? this) "open" ) (else "inactive" ) ) - obj + this ) - obj + this ) (defun get-active-mission-description ((info discord-info)) @@ -790,8 +790,8 @@ ) ) -(defmethod close! game-task-node-info ((obj game-task-node-info) (arg0 symbol)) - (when (not (logtest? (-> obj flags) (game-task-node-flag closed))) +(defmethod close! game-task-node-info ((this game-task-node-info) (arg0 symbol)) + (when (not (logtest? (-> this flags) (game-task-node-flag closed))) (let ((task-node-close-func (lambda ((arg0 game-task-node-info)) (logior! (-> arg0 flags) (game-task-node-flag closed)) @@ -820,7 +820,7 @@ (let ((p-node-count 0) (s3-0 (new 'stack-no-clear 'inline-array 'qword 8)) ) - (let ((s1-0 obj)) + (let ((s1-0 this)) (loop (cond ((= (-> s1-0 parent-node 0) (game-task-node none)) @@ -863,7 +863,7 @@ (task-node-close-func (-> *game-info* sub-task-list (-> (&-> s3-0 0 hword p-node-count) 0))) ) ) - (task-node-close-func obj) + (task-node-close-func this) ) (let ((game-nodes (-> *game-info* sub-task-list))) (dotimes (i (-> game-nodes length)) @@ -892,13 +892,13 @@ 0 ) -(defmethod open! game-task-node-info ((obj game-task-node-info) (arg0 symbol)) +(defmethod open! game-task-node-info ((this game-task-node-info) (arg0 symbol)) (local-vars (v1-19 symbol)) - (when (logtest? (-> obj flags) (game-task-node-flag closed)) - (logclear! (-> obj flags) (game-task-node-flag closed)) + (when (logtest? (-> this flags) (game-task-node-flag closed)) + (logclear! (-> this flags) (game-task-node-flag closed)) (+! (-> *game-info* task-counter) 1) - (if (logtest? (-> obj flags) (game-task-node-flag close-task)) - (logclear! (-> *game-info* task-perm-list data (-> obj task) status) (entity-perm-status complete)) + (if (logtest? (-> this flags) (game-task-node-flag close-task)) + (logclear! (-> *game-info* task-perm-list data (-> this task) status) (entity-perm-status complete)) ) (let ((game-nodes (-> *game-info* sub-task-list))) (dotimes (i (-> game-nodes length)) @@ -938,10 +938,10 @@ ) ) -(defmethod open? game-task-node-info ((obj game-task-node-info)) +(defmethod open? game-task-node-info ((this game-task-node-info)) (local-vars (a1-1 symbol)) (let ((game-nodes (-> *game-info* sub-task-list)) - (node-info obj) + (node-info this) ) (and (not (logtest? (-> node-info flags) (game-task-node-flag closed))) (begin @@ -957,7 +957,7 @@ (label cfg-12) (and a1-1 (or (zero? (-> *setting-control* user-current exclusive-task)) - (= (-> *setting-control* user-current exclusive-task) (-> obj task)) + (= (-> *setting-control* user-current exclusive-task) (-> this task)) (logtest? (-> node-info flags) (game-task-node-flag auto-close)) ) (or (not (-> node-info open?)) ((-> node-info open?) node-info)) @@ -979,8 +979,8 @@ 0 ) -(defmethod eval-add game-task-node-info ((obj game-task-node-info)) - (case (-> obj add) +(defmethod eval-add game-task-node-info ((this game-task-node-info)) + (case (-> this add) (((game-task-node-command none)) ) (((game-task-node-command add-sidekick)) @@ -1129,11 +1129,11 @@ #f ) -(defmethod print game-task-event ((obj game-task-event)) +(defmethod print game-task-event ((this game-task-event)) (let* ((t9-0 format) (a0-1 #t) (a1-0 "#") - (v1-0 (-> obj actor)) + (v1-0 (-> this actor)) (a2-1 (cond ((= v1-0 (game-task-actor burning-bush-genc)) "burning-bush-genc" @@ -1344,7 +1344,7 @@ ) ) ) - (v1-1 (-> obj action)) + (v1-1 (-> this action)) ) (t9-0 a0-1 @@ -1379,11 +1379,11 @@ "*unknown*" ) ) - (-> obj scene) - obj + (-> this scene) + this ) ) - obj + this ) (defmethod new game-task-control ((allocation symbol) (type-to-make type) (arg0 game-task-actor)) @@ -1393,14 +1393,14 @@ ) ) -(defmethod get-current-task-event game-task-control ((obj game-task-control)) +(defmethod get-current-task-event game-task-control ((this game-task-control)) (with-pp (let ((gp-0 (new 'static 'game-task-event :scene #f))) (let ((s5-0 #f)) - (when (!= (-> obj counter) (-> *game-info* task-counter)) - (set! (-> obj counter) (-> *game-info* task-counter)) - (set! (-> obj current-node) (game-task-node none)) - (set! (-> obj current-event) #f) + (when (!= (-> this counter) (-> *game-info* task-counter)) + (set! (-> this counter) (-> *game-info* task-counter)) + (set! (-> this current-node) (game-task-node none)) + (set! (-> this current-event) #f) (set! s5-0 #t) (let ((game-nodes (-> *game-info* sub-task-list))) (dotimes (i (-> game-nodes length)) @@ -1410,9 +1410,9 @@ (-> node when-open) (begin (countdown (v1-12 (-> node when-open length)) - (when (= (-> obj actor) (-> node when-open v1-12 actor)) - (set! (-> obj current-event) (-> node when-open v1-12)) - (set! (-> obj current-node) (the-as game-task-node i)) + (when (= (-> this actor) (-> node when-open v1-12 actor)) + (set! (-> this current-event) (-> node when-open v1-12)) + (set! (-> this current-node) (the-as game-task-node i)) #t (goto cfg-18) ) @@ -1428,11 +1428,11 @@ ) (label cfg-18) (cond - ((= (-> obj current-node) (game-task-node none)) - (set! (-> gp-0 actor) (-> obj actor)) + ((= (-> this current-node) (game-task-node none)) + (set! (-> gp-0 actor) (-> this actor)) ) (else - (set! gp-0 (-> obj current-event)) + (set! gp-0 (-> this current-event)) (cond ((and (logtest? (-> gp-0 flags) (game-task-flags gatflag-00)) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1488,13 +1488,13 @@ ) -(defmethod run-logic? fail-mission ((obj fail-mission)) +(defmethod run-logic? fail-mission ((this fail-mission)) #t ) -(defmethod print-text fail-mission ((obj fail-mission)) - (when (and (not (logtest? (-> obj flags) (fail-mission-flags famflags-6))) - (= (get-status *gui-control* (-> obj message-id)) (gui-status active)) +(defmethod print-text fail-mission ((this fail-mission)) + (when (and (not (logtest? (-> this flags) (fail-mission-flags famflags-6))) + (= (get-status *gui-control* (-> this message-id)) (gui-status active)) ) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) @@ -1511,8 +1511,8 @@ (set! (-> v1-9 height) (the float 35)) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle middle-vert large)) - (let ((s4-0 (if (logtest? (-> obj flags) (fail-mission-flags famflags-2)) - (the-as int (-> obj fail-message)) + (let ((s4-0 (if (logtest? (-> this flags) (fail-mission-flags famflags-2)) + (the-as int (-> this fail-message)) 393 ) ) @@ -1524,7 +1524,7 @@ ) ) ) - (when (= (-> obj message) (fail-mission-message fammsg-1)) + (when (= (-> this message) (fail-mission-message fammsg-1)) (let ((v1-17 gp-0)) (set! (-> v1-17 height) (the float 95)) ) @@ -1684,14 +1684,14 @@ ) ;; WARN: Return type mismatch process vs none. -(defmethod deactivate fail-mission ((obj fail-mission)) +(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)) (update-rates! (-> *display* bg-clock) 1.0) (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)) obj) + ((the-as (function process process) (find-parent-method fail-mission 10)) this) (none) ) @@ -1840,46 +1840,46 @@ (go-virtual idle) ) -(defmethod start! fail-mission-control ((obj fail-mission-control) (arg0 fail-mission-params)) - (when (not (handle->process (-> obj process))) +(defmethod start! fail-mission-control ((this fail-mission-control) (arg0 fail-mission-params)) + (when (not (handle->process (-> this process))) (let ((v1-4 (process-spawn fail-mission arg0 :to *entity-pool*))) (when v1-4 - (set! (-> obj process) (process->handle (-> v1-4 0))) + (set! (-> this process) (process->handle (-> v1-4 0))) #t ) ) ) ) -(defmethod reset! fail-mission-control ((obj fail-mission-control)) - (send-event (handle->process (-> obj process)) 'reset) +(defmethod reset! fail-mission-control ((this fail-mission-control)) + (send-event (handle->process (-> this process)) 'reset) ) ;; WARN: Return type mismatch object vs symbol. -(defmethod reset? fail-mission-control ((obj fail-mission-control)) - (the-as symbol (send-event (handle->process (-> obj process)) 'query 'reset)) +(defmethod reset? fail-mission-control ((this fail-mission-control)) + (the-as symbol (send-event (handle->process (-> this process)) 'query 'reset)) ) ;; WARN: Return type mismatch process vs fail-mission. -(defmethod get-proc fail-mission-control ((obj fail-mission-control)) - (the-as fail-mission (handle->process (-> obj process))) +(defmethod get-proc fail-mission-control ((this fail-mission-control)) + (the-as fail-mission (handle->process (-> this process))) ) -(defmethod copy-hooks! game-task-node-info ((obj game-task-node-info) (arg0 game-task-node-info)) - (when (and (-> obj info) (-> arg0 info)) +(defmethod copy-hooks! game-task-node-info ((this game-task-node-info) (arg0 game-task-node-info)) + (when (and (-> this info) (-> arg0 info)) (countdown (v1-3 7) - (set! (-> obj info hooks v1-3) (-> arg0 info hooks v1-3)) + (set! (-> this info hooks v1-3) (-> arg0 info hooks v1-3)) ) ) - obj + this ) ;; WARN: Return type mismatch process vs task-manager. -(defmethod relocate task-manager ((obj task-manager) (arg0 int)) - (if (nonzero? (-> obj link)) - (+! (-> obj link) arg0) +(defmethod relocate task-manager ((this task-manager) (arg0 int)) + (if (nonzero? (-> this link)) + (+! (-> this link) arg0) ) - (the-as task-manager ((method-of-type process relocate) obj arg0)) + (the-as task-manager ((method-of-type process relocate) this arg0)) ) (defbehavior task-manager-init-by-other task-manager ((arg0 game-task-node-info) (arg1 symbol)) @@ -1907,21 +1907,21 @@ (go-virtual wait) ) -(defmethod kill-all-children task-manager ((obj task-manager)) - (while (-> obj child) - (deactivate (ppointer->process (-> obj child))) +(defmethod kill-all-children task-manager ((this task-manager)) + (while (-> this child) + (deactivate (ppointer->process (-> this child))) ) 0 ) -(defmethod check-time task-manager ((obj task-manager)) - (when (nonzero? (-> obj start-time)) - (let ((v1-3 (handle->process (-> obj hud-timer)))) +(defmethod check-time task-manager ((this task-manager)) + (when (nonzero? (-> this start-time)) + (let ((v1-3 (handle->process (-> this hud-timer)))) (if (and *target* (not v1-3)) - (set! (-> obj hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) + (set! (-> this hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) ) ) - (let ((v1-15 (- (-> obj time-limit) (- (current-time) (-> obj start-time))))) + (let ((v1-15 (- (-> this time-limit) (- (current-time) (-> this start-time))))) (let ((a0-15 *game-info*)) (set! (-> a0-15 timer) v1-15) (set! (-> a0-15 timer-flash) (< v1-15 (seconds 10))) @@ -1930,40 +1930,40 @@ (if *debug-segment* (format #t "task failed: ran out of time~%") ) - (send-event (handle->process (-> obj hud-timer)) 'hide-and-die) - (go (method-of-object obj fail)) + (send-event (handle->process (-> this hud-timer)) 'hide-and-die) + (go (method-of-object this fail)) ) ) ) 0 ) -(defmethod initialize! task-manager ((obj task-manager)) - (set! (-> obj info) (-> obj node-info info)) +(defmethod initialize! task-manager ((this task-manager)) + (set! (-> this info) (-> this node-info info)) (countdown (v1-2 32) - (set! (-> obj slave v1-2) (the-as handle #f)) + (set! (-> this slave v1-2) (the-as handle #f)) ) (countdown (v1-5 4) - (set! (-> obj hud v1-5) (the-as handle #f)) + (set! (-> this hud v1-5) (the-as handle #f)) ) - (set! (-> obj arrow) (the-as handle #f)) + (set! (-> this arrow) (the-as handle #f)) (countdown (v1-8 4) - (set! (-> obj minimap v1-8) #f) + (set! (-> this minimap v1-8) #f) ) (countdown (v1-11 4) - (set! (-> obj actor-group v1-11) (the-as (pointer entity-actor) #f)) + (set! (-> this actor-group v1-11) (the-as (pointer entity-actor) #f)) ) - (set! (-> obj fail-now) #f) - (set! (-> obj retry-now) #f) - (set! (-> obj allow-fail) #t) + (set! (-> this fail-now) #f) + (set! (-> this retry-now) #f) + (set! (-> this allow-fail) #t) 0 ) -(defmethod deactivate task-manager ((obj task-manager)) +(defmethod deactivate task-manager ((this task-manager)) (with-pp (let ((s5-0 pp)) - (set! pp obj) - (let ((t9-0 (-> obj info cleanup-hook))) + (set! pp this) + (let ((t9-0 (-> this info cleanup-hook))) (if t9-0 (t9-0) ) @@ -1971,9 +1971,9 @@ (set! pp s5-0) ) (countdown (s5-1 4) - (send-event (handle->process (-> obj hud s5-1)) 'hide-and-die) + (send-event (handle->process (-> this hud s5-1)) 'hide-and-die) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ) @@ -2093,14 +2093,14 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod task-manager-method-22 task-manager ((obj task-manager)) +(defmethod task-manager-method-22 task-manager ((this task-manager)) (the-as symbol - (and (or (not (logtest? (-> obj node-info flags) (game-task-node-flag city-wait))) + (and (or (not (logtest? (-> this node-info flags) (game-task-node-flag city-wait))) (let ((a0-2 (level-get-target-inside *level*))) (cond ((not (and a0-2 (logtest? (-> a0-2 info level-flags) 1))) - (set! (-> obj intro-time) (current-time)) + (set! (-> this intro-time) (current-time)) #f ) (else @@ -2109,8 +2109,8 @@ ) ) ) - (or (zero? (-> obj info intro-delay)) - (>= (- (current-time) (-> obj intro-time)) (the-as time-frame (-> obj info intro-delay))) + (or (zero? (-> this info intro-delay)) + (>= (- (current-time) (-> this intro-time)) (the-as time-frame (-> this info intro-delay))) ) (and *target* (not (logtest? (focus-status dead teleporting) (-> *target* focus-status)))) ) diff --git a/goal_src/jak2/engine/geometry/bounding-box.gc b/goal_src/jak2/engine/geometry/bounding-box.gc index 3259c5dd6c..b2517dd0ad 100644 --- a/goal_src/jak2/engine/geometry/bounding-box.gc +++ b/goal_src/jak2/engine/geometry/bounding-box.gc @@ -12,23 +12,23 @@ These boxes are used as a primitive in the foreground collision system. ;; DECOMP BEGINS -(defmethod inside-xyz? bounding-box ((obj bounding-box) (arg0 vector)) +(defmethod inside-xyz? bounding-box ((this bounding-box) (arg0 vector)) "Is the point in the box?" - (and (< (-> obj min x) (-> arg0 x)) - (< (-> obj min y) (-> arg0 y)) - (< (-> obj min z) (-> arg0 z)) - (< (-> arg0 x) (-> obj max x)) - (< (-> arg0 y) (-> obj max y)) - (< (-> arg0 z) (-> obj max z)) + (and (< (-> this min x) (-> arg0 x)) + (< (-> this min y) (-> arg0 y)) + (< (-> this min z) (-> arg0 z)) + (< (-> arg0 x) (-> this max x)) + (< (-> arg0 y) (-> this max y)) + (< (-> arg0 z) (-> this max z)) ) ) -(defmethod inside-xz? bounding-box ((obj bounding-box) (arg0 vector)) +(defmethod inside-xz? bounding-box ((this bounding-box) (arg0 vector)) "Is the point in the box? Check xz only." - (and (< (-> obj min x) (-> arg0 x)) - (< (-> obj min z) (-> arg0 z)) - (< (-> arg0 x) (-> obj max x)) - (< (-> arg0 z) (-> obj max z)) + (and (< (-> this min x) (-> arg0 x)) + (< (-> this min z) (-> arg0 z)) + (< (-> arg0 x) (-> this max x)) + (< (-> arg0 z) (-> this max z)) ) ) @@ -54,7 +54,7 @@ These boxes are used as a primitive in the foreground collision system. ) ) -(defmethod set-from-point-offset! bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector)) +(defmethod set-from-point-offset! bounding-box ((this bounding-box) (arg0 vector) (arg1 vector)) "Set to the smallest box containing arg0, (arg0 + arg1)" (rlet ((vf0 :class vf) (vf1 :class vf) @@ -71,59 +71,59 @@ These boxes are used as a primitive in the foreground collision system. (.max.vf vf2 vf4 vf5) (.mov.vf vf1 vf0 :mask #b1000) (.mov.vf vf2 vf0 :mask #b1000) - (.svf (&-> obj min quad) vf1) - (.svf (&-> obj max quad) vf2) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) 0 (none) ) ) -(defmethod add-point! bounding-box ((obj bounding-box) (arg0 vector)) +(defmethod add-point! bounding-box ((this bounding-box) (arg0 vector)) "Expand the box as needed to contain the given point." (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) - (.lvf vf1 (&-> obj min quad)) - (.lvf vf2 (&-> obj max quad)) + (.lvf vf1 (&-> this min quad)) + (.lvf vf2 (&-> this max quad)) (.lvf vf3 (&-> arg0 quad)) (.min.vf vf1 vf1 vf3) (.max.vf vf2 vf2 vf3) - (.svf (&-> obj min quad) vf1) - (.svf (&-> obj max quad) vf2) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) 0 (none) ) ) -(defmethod add-box! bounding-box ((obj bounding-box) (arg0 bounding-box)) +(defmethod add-box! bounding-box ((this bounding-box) (arg0 bounding-box)) "Expand the box as needed to contain the given box." (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) ) - (.lvf vf1 (&-> obj min quad)) - (.lvf vf2 (&-> obj max quad)) + (.lvf vf1 (&-> this min quad)) + (.lvf vf2 (&-> this max quad)) (.lvf vf3 (&-> arg0 min quad)) (.lvf vf4 (&-> arg0 max quad)) (.min.vf vf1 vf1 vf3) (.max.vf vf2 vf2 vf4) - (.svf (&-> obj min quad) vf1) - (.svf (&-> obj max quad) vf2) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) 0 ) ) -(defmethod set-to-point! bounding-box ((obj bounding-box) (arg0 vector)) +(defmethod set-to-point! bounding-box ((this bounding-box) (arg0 vector)) "Set the box to be a single point." - (set! (-> obj min quad) (-> arg0 quad)) - (set! (-> obj max quad) (-> arg0 quad)) + (set! (-> this min quad) (-> arg0 quad)) + (set! (-> this max quad) (-> arg0 quad)) 0 (none) ) -(defmethod set-from-point-offset-pad! bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod set-from-point-offset-pad! bounding-box ((this bounding-box) (arg0 vector) (arg1 vector) (arg2 float)) "Set the box to contain arg0, arg0 + offset, with some padding." (rlet ((vf0 :class vf) (vf1 :class vf) @@ -144,13 +144,13 @@ These boxes are used as a primitive in the foreground collision system. (.sub.x.vf vf2 vf2 vf1 :mask #b111) (.mov.vf vf2 vf0 :mask #b1000) (.mov.vf vf3 vf0 :mask #b1000) - (.svf (&-> obj min quad) vf2) - (.svf (&-> obj max quad) vf3) + (.svf (&-> this min quad) vf2) + (.svf (&-> this max quad) vf3) 0 ) ) -(defmethod set-from-sphere! bounding-box ((obj bounding-box) (arg0 sphere)) +(defmethod set-from-sphere! bounding-box ((this bounding-box) (arg0 sphere)) "Set the box to contain a single sphere." (rlet ((vf0 :class vf) (vf1 :class vf) @@ -163,8 +163,8 @@ These boxes are used as a primitive in the foreground collision system. (.add.w.vf vf3 vf1 vf1 :mask #b111) (.mov.vf vf2 vf0 :mask #b1000) (.mov.vf vf3 vf0 :mask #b1000) - (.svf (&-> obj min quad) vf2) - (.svf (&-> obj max quad) vf3) + (.svf (&-> this min quad) vf2) + (.svf (&-> this max quad) vf3) 0 (none) ) @@ -176,7 +176,7 @@ These boxes are used as a primitive in the foreground collision system. ;; these are used in the collision system to build bounding boxes around collision geometries, so they are quite optimized. -(defmethod add-spheres! bounding-box ((obj bounding-box) (spheres (inline-array sphere)) (count int)) +(defmethod add-spheres! bounding-box ((this bounding-box) (spheres (inline-array sphere)) (count int)) "Add count spheres." ;; the PS2 implementation is very optimized ;; It is unrolled and 'software pipelined' to do 4 at a time. @@ -189,8 +189,8 @@ These boxes are used as a primitive in the foreground collision system. (when (nonzero? count) ;; load these outside the loop - (.lvf current-min (-> obj min)) - (.lvf current-max (-> obj max)) + (.lvf current-min (-> this min)) + (.lvf current-max (-> this max)) (dotimes (i count) (.lvf sph (-> spheres i)) @@ -200,14 +200,14 @@ These boxes are used as a primitive in the foreground collision system. (.max.vf current-max current-max sph-max :mask #b111) ) - (.svf (-> obj min) current-min) - (.svf (-> obj max) current-max) + (.svf (-> this min) current-min) + (.svf (-> this max) current-max) ) ) 0 ) -(defmethod set-from-spheres! bounding-box ((obj bounding-box) (spheres (inline-array sphere)) (count int)) +(defmethod set-from-spheres! bounding-box ((this bounding-box) (spheres (inline-array sphere)) (count int)) "Reset box to hold the given spheres. Note: this implementation could be optimized." ;; This is also unrolled, but does 7 at a time. (rlet ((vf0 :class vf) @@ -238,19 +238,19 @@ These boxes are used as a primitive in the foreground collision system. ) ) - (.svf (-> obj min) current-min) - (.svf (-> obj max) current-max) + (.svf (-> this min) current-min) + (.svf (-> this max) current-max) ) 0 ) -(defmethod get-bounding-sphere bounding-box ((obj bounding-box) (arg0 vector)) +(defmethod get-bounding-sphere bounding-box ((this bounding-box) (arg0 vector)) "Get a bounding sphere for a bounding box." - (let* ((a1-2 (vector-! (new 'stack-no-clear 'vector) (-> obj max) (-> obj min))) + (let* ((a1-2 (vector-! (new 'stack-no-clear 'vector) (-> this max) (-> this min))) (a0-3 (vector-float*! (new 'stack-no-clear 'vector) a1-2 0.5)) ) - (vector+! arg0 (-> obj min) a0-3) + (vector+! arg0 (-> this min) a0-3) (set! (-> arg0 w) (vector-length a0-3)) ) arg0 @@ -304,7 +304,7 @@ These boxes are used as a primitive in the foreground collision system. #t ) -(defmethod intersects-line-segment? bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector)) +(defmethod intersects-line-segment? bounding-box ((this bounding-box) (arg0 vector) (arg1 vector)) "Check intersection in xz plane, using liang-barsky. Not sure if this actually a useful check or not..." (let ((f28-0 (- (-> arg1 x) (-> arg0 x))) @@ -315,17 +315,17 @@ These boxes are used as a primitive in the foreground collision system. (let ((f1-2 (-> arg0 x)) (f0-4 (-> arg0 z)) ) - (and (>= f1-2 (-> obj min x)) (>= (-> obj max x) f1-2) (>= f0-4 (-> obj min z)) (>= (-> obj max z) f0-4)) + (and (>= f1-2 (-> this min x)) (>= (-> this max x) f1-2) (>= f0-4 (-> this min z)) (>= (-> this max z) f0-4)) ) ) (else (let ((s4-0 (new 'stack-no-clear 'liang-barsky-line-clip-params))) (set! (-> s4-0 te) 0.0) (set! (-> s4-0 tl) 1.0) - (and (liang-barsky-line-clipt s4-0 f28-0 (- (-> obj min x) (-> arg0 x))) - (liang-barsky-line-clipt s4-0 (- f28-0) (- (-> arg0 x) (-> obj max x))) - (liang-barsky-line-clipt s4-0 f30-0 (- (-> obj min z) (-> arg0 z))) - (liang-barsky-line-clipt s4-0 (- f30-0) (- (-> arg0 z) (-> obj max z))) + (and (liang-barsky-line-clipt s4-0 f28-0 (- (-> this min x) (-> arg0 x))) + (liang-barsky-line-clipt s4-0 (- f28-0) (- (-> arg0 x) (-> this max x))) + (liang-barsky-line-clipt s4-0 f30-0 (- (-> this min z) (-> arg0 z))) + (liang-barsky-line-clipt s4-0 (- f30-0) (- (-> arg0 z) (-> this max z))) ) ) ) diff --git a/goal_src/jak2/engine/geometry/cylinder.gc b/goal_src/jak2/engine/geometry/cylinder.gc index b5993c1dbd..8a31e3e067 100644 --- a/goal_src/jak2/engine/geometry/cylinder.gc +++ b/goal_src/jak2/engine/geometry/cylinder.gc @@ -7,21 +7,21 @@ ;; DECOMP BEGINS -(defmethod ray-capsule-intersect cylinder ((obj cylinder) (ray1 vector) (ray2 vector)) +(defmethod ray-capsule-intersect cylinder ((this cylinder) (ray1 vector) (ray2 vector)) (let ((t2-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (let ((f30-0 (ray-cylinder-intersect ray1 ray2 (-> obj origin) (-> obj axis) (-> obj radius) (-> obj length) t2-0)) + (let ((f30-0 (ray-cylinder-intersect ray1 ray2 (-> this origin) (-> this axis) (-> this radius) (-> this length) t2-0)) ) - (let ((f0-5 (ray-sphere-intersect ray1 ray2 (-> obj origin) (-> obj radius)))) + (let ((f0-5 (ray-sphere-intersect ray1 ray2 (-> this origin) (-> this radius)))) (if (and (>= f0-5 0.0) (or (< f30-0 0.0) (< f0-5 f30-0))) (set! f30-0 f0-5) ) ) - (vector+float*! s4-0 (-> obj origin) (-> obj axis) (-> obj length)) - (let ((f0-8 (ray-sphere-intersect ray1 ray2 s4-0 (-> obj radius)))) + (vector+float*! s4-0 (-> this origin) (-> this axis) (-> this length)) + (let ((f0-8 (ray-sphere-intersect ray1 ray2 s4-0 (-> this radius)))) (if (and (>= f0-8 0.0) (or (< f30-0 0.0) (< f0-8 f30-0))) (set! f30-0 f0-8) ) @@ -40,7 +40,7 @@ ) -(defmethod debug-draw cylinder ((obj cylinder) (arg0 vector4w)) +(defmethod debug-draw cylinder ((this cylinder) (arg0 vector4w)) (local-vars (sv-896 matrix) (sv-912 vector) @@ -69,33 +69,33 @@ (let ((s1-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'vector)) ) - (if (< 0.999 (fabs (-> obj axis y))) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :z 1.0)) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :y 1.0)) + (if (< 0.999 (fabs (-> this axis y))) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) - (vector-normalize! s1-0 (-> obj radius)) - (vector-float*! s0-0 (-> obj axis) (* 0.125 (-> obj length))) + (vector-normalize! s1-0 (-> this radius)) + (vector-float*! s0-0 (-> this axis) (* 0.125 (-> this length))) (let ((s5-0 (new 'stack-no-clear 'cylinder-verts)) (s4-0 (new 'stack-no-clear 'cylinder-verts)) (s3-0 (new 'stack-no-clear 'matrix)) ) - (matrix-axis-angle! s3-0 (-> obj axis) 4096.0) + (matrix-axis-angle! s3-0 (-> this axis) 4096.0) (set! sv-896 (new 'stack-no-clear 'matrix)) - (vector-matrix*! (the-as vector sv-896) (-> obj origin) s3-0) + (vector-matrix*! (the-as vector sv-896) (-> this origin) s3-0) (let ((v1-6 (-> s3-0 trans))) - (.lvf vf4 (&-> (-> obj origin) quad)) + (.lvf vf4 (&-> (-> this origin) quad)) (.lvf vf5 (&-> sv-896 quad 0)) (.mov.vf vf6 vf0 :mask #b1000) (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> v1-6 quad) vf6) ) (dotimes (v1-7 8) - (vector+! (-> s5-0 vert (+ v1-7 8)) (-> obj origin) s1-0) + (vector+! (-> s5-0 vert (+ v1-7 8)) (-> this origin) s1-0) (vector+float*! (-> s5-0 vert (+ v1-7 8)) (-> s5-0 vert (+ v1-7 8)) s0-0 (the float v1-7)) ) (dotimes (s0-1 8) (set! sv-944 (-> s5-0 vert s0-1)) - (set! sv-912 (-> obj origin)) + (set! sv-912 (-> this origin)) (set! sv-928 s1-0) (let ((f0-8 (cos (* 2048.0 (the float (- 7 s0-1)))))) (.lvf vf2 (&-> sv-928 quad)) @@ -110,8 +110,8 @@ (.svf (&-> sv-944 quad) vf4) (set! sv-992 (-> s5-0 vert s0-1)) (set! sv-960 (-> s5-0 vert s0-1)) - (set! sv-976 (-> obj axis)) - (let ((f0-13 (* (- (-> obj radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))) + (set! sv-976 (-> this axis)) + (let ((f0-13 (* (- (-> this radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))) (.lvf vf2 (&-> sv-976 quad)) (.lvf vf1 (&-> sv-960 quad)) (let ((v1-33 f0-13)) @@ -123,7 +123,7 @@ (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) (.svf (&-> sv-992 quad) vf4) (set! sv-1040 (-> s5-0 vert (+ s0-1 16))) - (set! sv-1008 (-> obj origin)) + (set! sv-1008 (-> this origin)) (set! sv-1024 s1-0) (let ((f0-16 (cos (* 2048.0 (the float s0-1))))) (.lvf vf2 (&-> sv-1024 quad)) @@ -138,8 +138,8 @@ (.svf (&-> sv-1040 quad) vf4) (set! sv-1088 (-> s5-0 vert (+ s0-1 16))) (set! sv-1056 (-> s5-0 vert (+ s0-1 16))) - (set! sv-1072 (-> obj axis)) - (let ((f0-21 (+ (-> obj length) (* (-> obj radius) (sin (* 2048.0 (the float s0-1))))))) + (set! sv-1072 (-> this axis)) + (let ((f0-21 (+ (-> this length) (* (-> this radius) (sin (* 2048.0 (the float s0-1))))))) (.lvf vf2 (&-> sv-1072 quad)) (.lvf vf1 (&-> sv-1056 quad)) (let ((v1-57 f0-21)) @@ -193,22 +193,22 @@ ) ) -(defmethod ray-flat-cyl-intersect cylinder-flat ((obj cylinder-flat) (arg0 vector) (arg1 vector)) +(defmethod ray-flat-cyl-intersect cylinder-flat ((this cylinder-flat) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (let ((f30-0 (ray-cylinder-intersect arg0 arg1 (-> obj origin) (-> obj axis) (-> obj radius) (-> obj length) gp-0)) + (let ((f30-0 (ray-cylinder-intersect arg0 arg1 (-> this origin) (-> this axis) (-> this radius) (-> this length) gp-0)) ) - (let ((f0-5 (ray-arbitrary-circle-intersect arg0 arg1 (-> obj origin) (-> obj axis) (-> obj radius)))) + (let ((f0-5 (ray-arbitrary-circle-intersect arg0 arg1 (-> this origin) (-> this axis) (-> this radius)))) (when (and (>= f0-5 0.0) (or (< f30-0 0.0) (< f0-5 f30-0))) (set! f30-0 f0-5) - (set! (-> gp-0 quad) (-> obj origin quad)) + (set! (-> gp-0 quad) (-> this origin quad)) ) ) - (vector+float*! s5-0 (-> obj origin) (-> obj axis) (-> obj length)) - (let ((f0-8 (ray-arbitrary-circle-intersect arg0 arg1 s5-0 (-> obj axis) (-> obj radius)))) + (vector+float*! s5-0 (-> this origin) (-> this axis) (-> this length)) + (let ((f0-8 (ray-arbitrary-circle-intersect arg0 arg1 s5-0 (-> this axis) (-> this radius)))) (when (and (>= f0-8 0.0) (or (< f30-0 0.0) (< f0-8 f30-0))) (set! f30-0 f0-8) (set! (-> gp-0 quad) (-> s5-0 quad)) @@ -228,7 +228,7 @@ ) -(defmethod debug-draw cylinder-flat ((obj cylinder-flat) (arg0 vector4w)) +(defmethod debug-draw cylinder-flat ((this cylinder-flat) (arg0 vector4w)) (local-vars (sv-448 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -239,32 +239,32 @@ (let ((s1-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'vector)) ) - (if (< 0.999 (fabs (-> obj axis y))) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :z 1.0)) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :y 1.0)) + (if (< 0.999 (fabs (-> this axis y))) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) - (vector-normalize! s1-0 (-> obj radius)) - (vector-float*! s0-0 (-> obj axis) (* 0.14285715 (-> obj length))) + (vector-normalize! s1-0 (-> this radius)) + (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s3-0 (new 'stack-no-clear 'matrix)) ) - (matrix-axis-angle! s3-0 (-> obj axis) 4096.0) + (matrix-axis-angle! s3-0 (-> this axis) 4096.0) (set! sv-448 (new 'stack-no-clear 'vector)) - (vector-matrix*! sv-448 (-> obj origin) s3-0) + (vector-matrix*! sv-448 (-> this origin) s3-0) (let ((v1-6 (-> s3-0 trans))) - (.lvf vf4 (&-> (-> obj origin) quad)) + (.lvf vf4 (&-> (-> this origin) quad)) (.lvf vf5 (&-> sv-448 quad)) (.mov.vf vf6 vf0 :mask #b1000) (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> v1-6 quad) vf6) ) (dotimes (v1-7 8) - (vector+! (-> s5-0 vert (+ v1-7 1)) (-> obj origin) s1-0) + (vector+! (-> s5-0 vert (+ v1-7 1)) (-> this origin) s1-0) (vector+float*! (-> s5-0 vert (+ v1-7 1)) (-> s5-0 vert (+ v1-7 1)) s0-0 (the float v1-7)) ) - (set! (-> s5-0 vert 0 quad) (-> obj origin quad)) - (vector+float*! (-> s5-0 vert 9) (-> obj origin) (-> obj axis) (-> obj length)) + (set! (-> s5-0 vert 0 quad) (-> this origin quad)) + (vector+float*! (-> s5-0 vert 9) (-> this origin) (-> this axis) (-> this length)) (dotimes (s2-1 16) (dotimes (s1-1 10) (vector-matrix*! (-> s4-0 vert s1-1) (-> s5-0 vert s1-1) s3-0) diff --git a/goal_src/jak2/engine/geometry/path-h.gc b/goal_src/jak2/engine/geometry/path-h.gc index 99eb0583bf..5c1c55b227 100644 --- a/goal_src/jak2/engine/geometry/path-h.gc +++ b/goal_src/jak2/engine/geometry/path-h.gc @@ -148,24 +148,24 @@ ) ) -(defmethod should-display-marks? path-control ((obj path-control)) - (and *display-path-marks* (logtest? (-> obj flags) (path-control-flag display))) +(defmethod should-display-marks? path-control ((this path-control)) + (and *display-path-marks* (logtest? (-> this flags) (path-control-flag display))) ) -(defmethod get-num-segments path-control ((obj path-control)) - (the float (+ (-> obj curve num-cverts) -1)) +(defmethod get-num-segments path-control ((this path-control)) + (the float (+ (-> this curve num-cverts) -1)) ) -(defmethod get-num-verts path-control ((obj path-control)) - (-> obj curve num-cverts) +(defmethod get-num-verts path-control ((this path-control)) + (-> this curve num-cverts) ) -(defmethod path-distance-equal-spacing path-control ((obj path-control) (arg0 float)) - (* arg0 (get-num-segments obj)) +(defmethod path-distance-equal-spacing path-control ((this path-control) (arg0 float)) + (* arg0 (get-num-segments this)) ) -(defmethod average-segment-length path-control ((obj path-control) (arg0 float)) - (/ arg0 (get-num-segments obj)) +(defmethod average-segment-length path-control ((this path-control) (arg0 float)) + (/ arg0 (get-num-segments this)) ) (defmethod new curve-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 symbol) (arg2 float)) diff --git a/goal_src/jak2/engine/geometry/path.gc b/goal_src/jak2/engine/geometry/path.gc index c8212fc6ce..a6afbfe0c9 100644 --- a/goal_src/jak2/engine/geometry/path.gc +++ b/goal_src/jak2/engine/geometry/path.gc @@ -7,49 +7,49 @@ ;; DECOMP BEGINS -(defmethod debug-draw path-control ((obj path-control)) +(defmethod debug-draw path-control ((this path-control)) (cond - ((logtest? (-> obj flags) (path-control-flag not-found)) - (when (and (type? (-> obj process) process-drawable) *display-entity-errors*) + ((logtest? (-> this flags) (path-control-flag not-found)) + (when (and (type? (-> this process) process-drawable) *display-entity-errors*) (let ((s5-0 add-debug-text-3d) (s4-0 #t) - (s3-0 (bucket-id debug-no-zbuf1)) + (s3-0 318) ) - (format (clear *temp-string*) "path data error in ~S" (-> obj process name)) + (format (clear *temp-string*) "path data error in ~S" (-> this process name)) (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* - (-> obj process root trans) + (-> this process root trans) (font-color red) (the-as vector2h #f) ) ) ) ) - ((let ((a0-5 obj)) + ((let ((a0-5 this)) (and *display-path-marks* (logtest? (-> a0-5 flags) (path-control-flag display))) ) - (dotimes (s5-1 (-> obj curve num-cverts)) - (let ((s4-1 (-> obj curve cverts s5-1))) - (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (< s5-1 (+ (-> obj curve num-cverts) -1))) + (dotimes (s5-1 (-> this curve num-cverts)) + (let ((s4-1 (-> this curve cverts s5-1))) + (if (and (logtest? (-> this flags) (path-control-flag draw-line)) (< s5-1 (+ (-> this curve num-cverts) -1))) (add-debug-line #t (bucket-id debug-no-zbuf1) s4-1 - (-> obj curve cverts (+ s5-1 1)) + (-> this curve cverts (+ s5-1 1)) (new 'static 'rgba :r #xff :g #x80 :a #x80) #f (the-as rgba -1) ) ) - (if (logtest? (-> obj flags) (path-control-flag draw-point)) + (if (logtest? (-> this flags) (path-control-flag draw-point)) (add-debug-x #t (bucket-id debug-no-zbuf1) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) - (when (logtest? (-> obj flags) (path-control-flag draw-text)) + (when (logtest? (-> this flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) (s2-1 #t) - (s1-0 (bucket-id debug-no-zbuf1)) + (s1-0 318) ) (format (clear *temp-string*) "~D" s5-1) (s3-1 s2-1 (the-as bucket-id s1-0) *temp-string* s4-1 (font-color orange) (the-as vector2h #f)) @@ -63,28 +63,30 @@ (none) ) -(defmethod total-distance path-control ((obj path-control)) +(defmethod total-distance path-control ((this path-control)) "Calcuate the total path length by summing the distance between each adjacent [[curve]] vertex" (let ((f30-0 0.0)) - (dotimes (s5-0 (+ (-> obj curve num-cverts) -1)) - (+! f30-0 (vector-vector-distance (-> obj curve cverts s5-0) (-> obj curve cverts (+ s5-0 1)))) + (dotimes (s5-0 (+ (-> this curve num-cverts) -1)) + (+! f30-0 (vector-vector-distance (-> this curve cverts s5-0) (-> this curve cverts (+ s5-0 1)))) ) f30-0 ) ) -(defmethod total-distance curve-control ((obj curve-control)) - "Calcuate the total path length by summing the distance between each adjacent [[curve]] vertex" - (let ((f0-0 (-> obj curve length))) +(defmethod total-distance curve-control ((this curve-control)) + "Will lazily calculate and set the [[curve]]'s `length` +@returns total path length of the [[curve]] +@see [[curve-length]]" + (let ((f0-0 (-> this curve length))) (when (= f0-0 0.0) - (set! f0-0 (curve-length (-> obj curve))) - (set! (-> obj curve length) f0-0) + (set! f0-0 (curve-length (-> this curve))) + (set! (-> this curve length) f0-0) ) f0-0 ) ) -(defmethod get-point-in-path! path-control ((obj path-control) (ret vector) (idx float) (search-type symbol)) +(defmethod get-point-in-path! path-control ((this path-control) (ret vector) (idx float) (search-type symbol)) "Depending on the value of `idx`, the result can be quite different: - if `idx` is less than `0.0` - return the first vertex in the path - if `idx` is greater than the number of vertices in the path, return the last vertex @@ -96,24 +98,24 @@ using the fractional component of `idx` as the interpolant, return this result @param idx Either the vertex index or also partially the interpolant in a LERP @param search-type The only recognized value is `exact` @returns Either a distinct vertex along the path, or some fractional point between two vertices" - (let ((num-vertices (-> obj curve num-cverts)) + (let ((num-vertices (-> this curve num-cverts)) (vert-idx (the float (the int idx))) ) (cond ((< idx 0.0) - (set! (-> ret quad) (-> obj curve cverts 0 quad)) + (set! (-> ret quad) (-> this curve cverts 0 quad)) ) ((>= vert-idx (the float (+ num-vertices -1))) - (set! (-> ret quad) (-> obj curve cverts (+ num-vertices -1) quad)) + (set! (-> ret quad) (-> this curve cverts (+ num-vertices -1) quad)) ) ((or (= search-type 'exact) (= vert-idx idx)) - (set! (-> ret quad) (-> obj curve cverts (the int vert-idx) quad)) + (set! (-> ret quad) (-> this curve cverts (the int vert-idx) quad)) ) (else (vector-lerp! ret - (-> obj curve cverts (the int vert-idx)) - (-> obj curve cverts (the int (+ 1.0 vert-idx))) + (-> this curve cverts (the int vert-idx)) + (-> this curve cverts (the int (+ 1.0 vert-idx))) (- idx vert-idx) ) ) @@ -122,12 +124,12 @@ using the fractional component of `idx` as the interpolant, return this result ret ) -(defmethod get-random-point path-control ((obj path-control) (arg0 vector)) +(defmethod get-random-point path-control ((this path-control) (arg0 vector)) "Attempts to retrieve a random point along the path, returns the [[*null-vector*]] if no vertices are defined" (cond - ((> (-> obj curve num-cverts) 0) - (let ((a0-2 (rand-vu-int-count (-> obj curve num-cverts)))) - (set! (-> arg0 quad) (-> obj curve cverts a0-2 quad)) + ((> (-> this curve num-cverts) 0) + (let ((a0-2 (rand-vu-int-count (-> this curve num-cverts)))) + (set! (-> arg0 quad) (-> this curve cverts a0-2 quad)) ) ) (else @@ -141,35 +143,35 @@ using the fractional component of `idx` as the interpolant, return this result arg0 ) -(defmethod get-point-at-percent-along-path! path-control ((obj path-control) (ret vector) (percent float) (search-type symbol)) +(defmethod get-point-at-percent-along-path! path-control ((this path-control) (ret vector) (percent float) (search-type symbol)) "@param! ret The [[vector]] that is used to hold the return value @param percent The percentage along the path @param search-type The only recognized value is `exact` @returns the point closest to some arbitrary percentage along the path @see [[path-control::10]]" - (get-point-in-path! obj ret (* percent (the float (+ (-> obj curve num-cverts) -1))) search-type) + (get-point-in-path! this ret (* percent (the float (+ (-> this curve num-cverts) -1))) search-type) ) -(defmethod get-point-at-percent-along-path! curve-control ((obj curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod get-point-at-percent-along-path! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) "@param! ret The [[vector]] that is used to hold the return value @param percent The percentage along the path @param search-type The only recognized value is `exact` @returns the point closest to some arbitrary percentage along the path @see [[path-control::10]]" - (if (not (logtest? (-> obj flags) (path-control-flag not-found))) + (if (not (logtest? (-> this flags) (path-control-flag not-found))) (curve-evaluate! arg0 arg1 - (-> obj curve cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) ) arg0 ) -(defmethod get-point-in-path! curve-control ((obj curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod get-point-in-path! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) "Depending on the value of `idx`, the result can be quite different: - if `idx` is less than `0.0` - return the first vertex in the path - if `idx` is greater than the number of vertices in the path, return the last vertex @@ -181,20 +183,20 @@ using the fractional component of `idx` as the interpolant, return this result @param idx Either the vertex index or also partially the interpolant in a LERP @param search-type The only recognized value is `exact` @returns Either a distinct vertex along the path, or some fractional point between two vertices" - (if (not (logtest? (-> obj flags) (path-control-flag not-found))) + (if (not (logtest? (-> this flags) (path-control-flag not-found))) (curve-evaluate! arg0 - (/ arg1 (the float (+ (-> obj curve num-cverts) -1))) - (-> obj curve cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (/ arg1 (the float (+ (-> this curve num-cverts) -1))) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) ) arg0 ) -(defmethod displacement-between-two-points! path-control ((obj path-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-two-points! path-control ((this path-control) (ret vector) (idx float) (mag float)) "Return value can differ quite a bit: - If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]] - Otherwise, find the scaled (by `mag`) displacement vector between two points in the path: @@ -205,16 +207,16 @@ using the fractional component of `idx` as the interpolant, return this result @param idx The vertex index @param mag The magnitude to scale the resulting displacement vector by @returns The displacement [[vector]] between two points in the path, the last 2, or the [[*null-vector*]]" - (let ((num-vertices (-> obj curve num-cverts)) + (let ((num-vertices (-> this curve num-cverts)) (vert-idx (the float (the int idx))) ) (cond - ((or (logtest? (-> obj flags) (path-control-flag not-found)) (< num-vertices 2) (< idx 0.0)) + ((or (logtest? (-> this flags) (path-control-flag not-found)) (< num-vertices 2) (< idx 0.0)) (vector-reset! ret) ) (else (let ((capped-idx (fmin vert-idx (the float (+ num-vertices -2))))) - (vector-! ret (-> obj curve cverts (the int (+ 1.0 capped-idx))) (-> obj curve cverts (the int capped-idx))) + (vector-! ret (-> this curve cverts (the int (+ 1.0 capped-idx))) (-> this curve cverts (the int capped-idx))) ) (vector-float*! ret ret mag) ) @@ -223,47 +225,51 @@ using the fractional component of `idx` as the interpolant, return this result ret ) -(defmethod displacement-between-two-points-copy! path-control ((obj path-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-two-points-copy! path-control ((this path-control) (ret vector) (idx float) (mag float)) "Calls [[path-control::26]] with the provided args @see [[path-control::26]]" - (displacement-between-two-points! obj ret idx mag) + (displacement-between-two-points! this ret idx mag) ) -(defmethod displacement-between-points-at-percent-scaled! path-control ((obj path-control) (ret vector) (percent float) (mag float)) +(defmethod displacement-between-points-at-percent-scaled! path-control ((this path-control) (ret vector) (percent float) (mag float)) "Calls [[path-control::12], with the `idx` at a given percent along the path @param ret The [[vector]] that is used to hold the return value @param percent The percentage along the path to find the first index @param mag Multiplied by the number of points in the path and scales the resulting vector @returns The displacement between the last two points of the path scaled to the magnitude equal to the number of points in the path" (displacement-between-two-points-copy! - obj + this ret - (* percent (the float (+ (-> obj curve num-cverts) -1))) - (* mag (the float (+ (-> obj curve num-cverts) -1))) + (* percent (the float (+ (-> this curve num-cverts) -1))) + (* mag (the float (+ (-> this curve num-cverts) -1))) ) ) -(defmethod displacement-between-two-points-normalized! path-control ((obj path-control) (ret vector) (idx float)) +(defmethod displacement-between-two-points-normalized! path-control ((this path-control) (ret vector) (idx float)) "Calls [[path-control::26], with the provided `idx` @param! ret The [[vector]] the result is stored within @param idx The vertex index @returns The resulting displacement vector, normalized @see [[path-control::26]]" - (displacement-between-two-points! obj ret idx 1.0) + (displacement-between-two-points! this ret idx 1.0) (vector-normalize! ret 1.0) ) -(defmethod displacement-between-points-at-percent-normalized! path-control ((obj path-control) (ret vector) (percent float)) +(defmethod displacement-between-points-at-percent-normalized! path-control ((this path-control) (ret vector) (percent float)) "Calls [[path-control::13], with the `idx` at a given percent along the path @param! ret The [[vector]] the result is stored within @param percent The percentage along the path @returns The resulting displacement vector, normalized @see [[path-control::13]] @see [[path-control::14]]" - (displacement-between-two-points-normalized! obj ret (* percent (the float (+ (-> obj curve num-cverts) -1)))) + (displacement-between-two-points-normalized! + this + ret + (* percent (the float (+ (-> this curve num-cverts) -1))) + ) ) -(defmethod displacement-between-two-points! curve-control ((obj curve-control) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod displacement-between-two-points! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 float)) "Return value can differ quite a bit: - If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]] - Otherwise, find the scaled (by `mag`) displacement vector between two points in the path: @@ -274,25 +280,25 @@ using the fractional component of `idx` as the interpolant, return this result @param idx The vertex index @param mag The magnitude to scale the resulting displacement vector by @returns The displacement [[vector]] between two points in the path, the last 2, or the [[*null-vector*]]" - (when (not (logtest? (-> obj flags) (path-control-flag not-found))) + (when (not (logtest? (-> this flags) (path-control-flag not-found))) (let ((s4-0 (new 'stack-no-clear 'vector))) (curve-evaluate! arg0 arg1 - (-> obj curve cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) (cond ((< arg1 (- 1.0 arg2)) (curve-evaluate! s4-0 (+ arg1 arg2) - (-> obj curve cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) (vector-! arg0 s4-0 arg0) ) @@ -300,10 +306,10 @@ using the fractional component of `idx` as the interpolant, return this result (curve-evaluate! s4-0 (- arg1 arg2) - (-> obj curve cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) (vector-! arg0 arg0 s4-0) ) @@ -312,46 +318,41 @@ using the fractional component of `idx` as the interpolant, return this result ) ) -(defmethod displacement-between-two-points-copy! curve-control ((obj curve-control) (ret vector) (percent float) (mag float)) - "Calls [[path-control::26]] with the provided args -@see [[path-control::26]]" - (displacement-between-two-points! obj ret (/ percent (the float (+ (-> obj curve num-cverts) -1))) mag) +(defmethod displacement-between-two-points-copy! curve-control ((this curve-control) (ret vector) (percent float) (mag float)) + "Calls [[path-control::26]] with the `idx` at a given percent along the path @see [[path-control::26]]" + (displacement-between-two-points! this ret (/ percent (the float (+ (-> this curve num-cverts) -1))) mag) ) -(defmethod displacement-between-points-at-percent-scaled! curve-control ((obj curve-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-points-at-percent-scaled! curve-control ((this curve-control) (ret vector) (idx float) (mag float)) "Calls [[path-control::12], with the `idx` at a given percent along the path @param ret The [[vector]] that is used to hold the return value @param percent The percentage along the path to find the first index @param mag Multiplied by the number of points in the path and scales the resulting vector @returns The displacement between the last two points of the path scaled to the magnitude equal to the number of points in the path" - (displacement-between-two-points! obj ret idx mag) + (displacement-between-two-points! this ret idx mag) ) -(defmethod displacement-between-points-at-percent-normalized! curve-control ((obj curve-control) (ret vector) (percent float)) +(defmethod displacement-between-points-at-percent-normalized! curve-control ((this curve-control) (ret vector) (percent float)) "Calls [[path-control::13], with the `idx` at a given percent along the path @param! ret The [[vector]] the result is stored within @param percent The percentage along the path @returns The resulting displacement vector, normalized @see [[path-control::13]] @see [[path-control::14]]" - (displacement-between-two-points! obj ret percent 0.01) + (displacement-between-two-points! this ret percent 0.01) (vector-normalize! ret 1.0) ) -(defmethod displacement-between-two-points-normalized! curve-control ((obj curve-control) (ret vector) (idx float)) - "Calls [[path-control::26], with the provided `idx` -@param! ret The [[vector]] the result is stored within -@param idx The vertex index -@returns The resulting displacement vector, normalized -@see [[path-control::26]]" +(defmethod displacement-between-two-points-normalized! curve-control ((this curve-control) (ret vector) (idx float)) + "@see [[curve-control::12]]" (displacement-between-points-at-percent-normalized! - obj + this ret - (/ idx (the float (+ (-> obj curve num-cverts) -1))) + (/ idx (the float (+ (-> this curve num-cverts) -1))) ) ) -(defmethod get-furthest-point-on-path path-control ((obj path-control) (point vector)) +(defmethod get-furthest-point-on-path path-control ((this path-control) (point vector)) "@param point The point to calculate distance from @returns the `vertex-idx.interpolant` value to the point on the path furthest away from the `point` @see [[path-control::10]]" @@ -364,11 +365,11 @@ using the fractional component of `idx` as the interpolant, return this result (let ((closest-point (new 'stack-no-clear 'vector))) (set! (-> given-point quad) (-> point quad)) (set! (-> given-point y) 0.0) - (get-point-in-path! obj next-point 0.0 'interp) + (get-point-in-path! this next-point 0.0 'interp) (set! (-> next-point y) 0.0) - (dotimes (idx (+ (-> obj curve num-cverts) -1)) + (dotimes (idx (+ (-> this curve num-cverts) -1)) (set! (-> curr-point quad) (-> next-point quad)) - (get-point-in-path! obj next-point (the float (+ idx 1)) 'interp) + (get-point-in-path! this next-point (the float (+ idx 1)) 'interp) (set! (-> next-point y) 0.0) (let ((dist-to-point (vector-segment-distance-point! given-point curr-point next-point closest-point))) (when (< dist-to-point furthest-dist) @@ -386,45 +387,51 @@ using the fractional component of `idx` as the interpolant, return this result ) ) -(defmethod get-path-percentage-at-furthest-point path-control ((obj path-control) (point vector)) +(defmethod get-path-percentage-at-furthest-point path-control ((this path-control) (point vector)) "@param point The point to calculate distance from @returns the percentage of path completion from the point on the path furthest away from the `point` @see [[path-control::14]]" - (/ (get-furthest-point-on-path obj point) (the float (+ (-> obj curve num-cverts) -1))) + (/ (get-furthest-point-on-path this point) (the float (+ (-> this curve num-cverts) -1))) ) -(defmethod debug-draw curve-control ((obj curve-control)) +(defmethod debug-draw curve-control ((this curve-control)) (cond - ((logtest? (-> obj flags) (path-control-flag not-found)) - (when (and (type? (-> obj process) process-drawable) *display-entity-errors*) + ((logtest? (-> this flags) (path-control-flag not-found)) + (when (and (type? (-> this process) process-drawable) *display-entity-errors*) (let ((s5-0 add-debug-text-3d) (s4-0 #t) - (s3-0 (bucket-id debug-no-zbuf1)) + (s3-0 318) ) - (format (clear *temp-string*) "curve data error in ~S" (-> obj process name)) + (format (clear *temp-string*) "curve data error in ~S" (-> this process name)) (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* - (-> obj process root trans) + (-> this process root trans) (font-color red) (the-as vector2h #f) ) ) ) ) - ((let ((a0-5 obj)) + ((let ((a0-5 this)) (and *display-path-marks* (logtest? (-> a0-5 flags) (path-control-flag display))) ) - (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (> (-> obj curve num-cverts) 0)) - (add-debug-curve2 #t (bucket-id debug-no-zbuf1) (-> obj curve) (new 'static 'rgba :r #xff :g #x80 :a #x80) #f) + (if (and (logtest? (-> this flags) (path-control-flag draw-line)) (> (-> this curve num-cverts) 0)) + (add-debug-curve2 + #t + (bucket-id debug-no-zbuf1) + (-> this curve) + (new 'static 'rgba :r #xff :g #x80 :a #x80) + #f + ) ) - (dotimes (s5-1 (-> obj curve num-cverts)) - (let ((s4-1 (-> obj curve cverts s5-1))) - (if (logtest? (-> obj flags) (path-control-flag draw-point)) + (dotimes (s5-1 (-> this curve num-cverts)) + (let ((s4-1 (-> this curve cverts s5-1))) + (if (logtest? (-> this flags) (path-control-flag draw-point)) (add-debug-x #t (bucket-id debug-no-zbuf1) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) - (when (logtest? (-> obj flags) (path-control-flag draw-text)) + (when (logtest? (-> this flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) (s2-1 #t) (s1-0 (bucket-id debug-no-zbuf1)) @@ -441,23 +448,23 @@ using the fractional component of `idx` as the interpolant, return this result (none) ) -(defmethod path-control-method-24 path-control ((obj path-control) (arg0 vector)) +(defmethod path-control-method-24 path-control ((this path-control) (arg0 vector)) "TODO" - (let ((s4-0 (-> obj curve num-cverts))) + (let ((s4-0 (-> this curve num-cverts))) (let ((f30-0 (/ 1.0 (the float s4-0)))) (set-vector! arg0 0.0 0.0 0.0 0.0) (dotimes (s3-0 s4-0) (vector+float*! arg0 arg0 - (get-point-in-path! obj (new 'stack-no-clear 'vector) (the float s3-0) 'interp) + (get-point-in-path! this (new 'stack-no-clear 'vector) (the float s3-0) 'interp) f30-0 ) ) ) (dotimes (s3-1 s4-0) (let ((f0-10 - (vector-vector-distance arg0 (get-point-in-path! obj (new 'stack-no-clear 'vector) (the float s3-1) 'interp)) + (vector-vector-distance arg0 (get-point-in-path! this (new 'stack-no-clear 'vector) (the float s3-1) 'interp)) ) ) (if (< (-> arg0 w) f0-10) diff --git a/goal_src/jak2/engine/geometry/vol-h.gc b/goal_src/jak2/engine/geometry/vol-h.gc index 383ce98eee..a11facc696 100644 --- a/goal_src/jak2/engine/geometry/vol-h.gc +++ b/goal_src/jak2/engine/geometry/vol-h.gc @@ -117,11 +117,7 @@ ) ) -(defmethod should-display? vol-control ((obj vol-control)) +(defmethod should-display? vol-control ((this vol-control)) "Returns true/false if the volume's marks should be displayed" - (and *display-vol-marks* (logtest? (-> obj flags) (vol-flags display?))) + (and *display-vol-marks* (logtest? (-> this flags) (vol-flags display?))) ) - - - - diff --git a/goal_src/jak2/engine/geometry/vol.gc b/goal_src/jak2/engine/geometry/vol.gc index 08221ad455..6a1c203807 100644 --- a/goal_src/jak2/engine/geometry/vol.gc +++ b/goal_src/jak2/engine/geometry/vol.gc @@ -50,7 +50,7 @@ ;; WARN: Stack slot offset 148 signed mismatch ;; WARN: Stack slot offset 148 signed mismatch ;; WARN: Stack slot offset 148 signed mismatch -(defmethod plane-volume-method-9 plane-volume ((obj plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) +(defmethod plane-volume-method-9 plane-volume ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) (local-vars (sv-144 vector) (sv-148 number) @@ -63,12 +63,12 @@ (sv-240 int) (sv-256 int) ) - (set! (-> obj volume-type) arg0) - (set! (-> obj point-count) 0) - (set! (-> obj first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) - (set! (-> obj normal-count) 0) - (set! (-> obj first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) - (dotimes (s3-0 (-> obj num-planes)) + (set! (-> this volume-type) arg0) + (set! (-> this point-count) 0) + (set! (-> this first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) + (set! (-> this normal-count) 0) + (set! (-> this first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) + (dotimes (s3-0 (-> this num-planes)) (set! sv-176 (new 'stack-no-clear 'vector)) (set! (-> sv-176 quad) (the-as uint128 0)) (set! sv-192 (new 'stack-no-clear 'vector)) @@ -83,10 +83,10 @@ (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (let ((s1-0 (new-stack-vector0)) (s0-0 0) - (s2-0 (-> obj plane)) + (s2-0 (-> this plane)) ) (set! sv-240 0) - (while (< sv-240 (-> obj num-planes)) + (while (< sv-240 (-> this num-planes)) (when (!= s3-0 sv-240) (vector-float*! sv-176 (the-as vector (-> s2-0 sv-240)) (-> s2-0 sv-240 w)) (vector-cross! sv-192 (the-as vector (-> s2-0 sv-240)) (the-as vector (-> s2-0 s3-0))) @@ -102,7 +102,7 @@ (set! sv-160 (new-stack-vector0)) (set! (-> sv-144 quad) (-> sv-224 quad)) (set! sv-256 0) - (while (< sv-256 (-> obj num-planes)) + (while (< sv-256 (-> this num-planes)) (when (and (!= sv-256 s3-0) (!= sv-256 sv-240)) (let ((f0-6 (plane-volume-intersect-dist (-> s2-0 sv-256) sv-144 sv-192))) (cond @@ -142,7 +142,7 @@ ((= (the-as float sv-148) 0.0) ) (else - (dotimes (v1-79 (-> obj num-planes)) + (dotimes (v1-79 (-> this num-planes)) (when (and (!= v1-79 s3-0) (!= v1-79 sv-240)) (if (< 4096.0 (- (vector-dot sv-144 (the-as vector (-> s2-0 v1-79))) (-> s2-0 v1-79 w))) (goto cfg-42) @@ -152,13 +152,13 @@ (vector+float*! sv-224 sv-144 sv-192 (the-as float sv-148)) (cond ((< (-> arg1 allocated-length) (+ (-> arg1 length) 2)) - (format 0 "ERROR : vol-control #x~X out of volume points~%" obj) + (format 0 "ERROR : vol-control #x~X out of volume points~%" this) ) (else (set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad)) (set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad)) (+! (-> arg1 length) 2) - (+! (-> obj point-count) 2) + (+! (-> this point-count) 2) ) ) (vector+! s1-0 s1-0 sv-144) @@ -176,25 +176,25 @@ (vector-float*! s1-0 s1-0 (/ 1.0 (the float s0-0))) (cond ((< (-> arg2 allocated-length) (+ (-> arg2 length) 2)) - (format 0 "ERROR : vol-control #x~X out of volume normals~%" obj) + (format 0 "ERROR : vol-control #x~X out of volume normals~%" this) ) (else (set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad)) (set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad)) (+! (-> arg2 length) 2) - (set! (-> obj normal-count) (+ (-> obj normal-count) 2)) + (set! (-> this normal-count) (+ (-> this normal-count) 2)) ) ) ) ) ) - obj + this ) ;; definition for method 10 of type plane-volume ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw plane-volume ((obj plane-volume)) - (let* ((v1-0 (-> obj volume-type)) +(defmethod debug-draw plane-volume ((this plane-volume)) + (let* ((v1-0 (-> this volume-type)) (s5-0 (cond ((= v1-0 'vol) (the-as uint #x8000c000) @@ -207,9 +207,9 @@ ) ) ) - (s4-0 (-> obj first-point)) + (s4-0 (-> this first-point)) ) - (dotimes (s3-0 (/ (-> obj point-count) 2)) + (dotimes (s3-0 (/ (-> this point-count) 2)) (add-debug-line #t (bucket-id debug-no-zbuf1) @@ -227,10 +227,10 @@ ) ;; definition for method 11 of type plane-volume -(defmethod point-in-vol? plane-volume ((obj plane-volume) (arg0 vector) (arg1 float)) +(defmethod point-in-vol? plane-volume ((this plane-volume) (arg0 vector) (arg1 float)) "TODO - Checks if the given [[vector]] point is inside the volume defined by 6 [[plane]]s by atleast the padding value provided" - (dotimes (v1-0 (-> obj num-planes)) - (if (< arg1 (- (vector-dot arg0 (the-as vector (-> obj plane v1-0))) (-> obj plane v1-0 w))) + (dotimes (v1-0 (-> this num-planes)) + (if (< arg1 (- (vector-dot arg0 (the-as vector (-> this plane v1-0))) (-> this plane v1-0 w))) (return #f) ) ) @@ -239,41 +239,41 @@ ;; definition for method 9 of type vol-control ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw vol-control ((obj vol-control)) +(defmethod debug-draw vol-control ((this vol-control)) (with-pp - (let ((a0-1 obj)) + (let ((a0-1 this)) (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) (vol-flags display?))) - (logtest? (-> obj flags) (vol-flags vol-flags-1)) + (logtest? (-> this flags) (vol-flags vol-flags-1)) ) - (when (zero? (-> obj debug-point)) + (when (zero? (-> this debug-point)) (let ((s5-0 pp)) - (set! pp (-> obj process)) + (set! pp (-> this process)) (let ((s4-0 0)) - (dotimes (v1-8 (-> obj pos-vol-count)) - (+! s4-0 (-> obj pos-vol v1-8 num-planes)) + (dotimes (v1-8 (-> this pos-vol-count)) + (+! s4-0 (-> this pos-vol v1-8 num-planes)) ) - (dotimes (v1-11 (-> obj neg-vol-count)) - (+! s4-0 (-> obj neg-vol v1-11 num-planes)) + (dotimes (v1-11 (-> this neg-vol-count)) + (+! s4-0 (-> this neg-vol v1-11 num-planes)) ) - (set! (-> obj debug-point) (new 'debug 'vector-array (* 10 s4-0))) - (set! (-> obj debug-normal) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> this debug-point) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> this debug-normal) (new 'debug 'vector-array (* 10 s4-0))) ) (set! pp s5-0) ) - (set! (-> obj debug-point length) 0) - (set! (-> obj debug-normal length) 0) - (dotimes (s5-1 (-> obj pos-vol-count)) - (plane-volume-method-9 (-> obj pos-vol s5-1) 'vol (-> obj debug-point) (-> obj debug-normal)) + (set! (-> this debug-point length) 0) + (set! (-> this debug-normal length) 0) + (dotimes (s5-1 (-> this pos-vol-count)) + (plane-volume-method-9 (-> this pos-vol s5-1) 'vol (-> this debug-point) (-> this debug-normal)) ) - (dotimes (s5-2 (-> obj neg-vol-count)) - (plane-volume-method-9 (-> obj neg-vol s5-2) 'vol (-> obj debug-point) (-> obj debug-normal)) + (dotimes (s5-2 (-> this neg-vol-count)) + (plane-volume-method-9 (-> this neg-vol s5-2) 'vol (-> this debug-point) (-> this debug-normal)) ) ) - (dotimes (s5-3 (-> obj pos-vol-count)) - (debug-draw (-> obj pos-vol s5-3)) + (dotimes (s5-3 (-> this pos-vol-count)) + (debug-draw (-> this pos-vol s5-3)) ) - (dotimes (s5-4 (-> obj neg-vol-count)) - (debug-draw (-> obj neg-vol s5-4)) + (dotimes (s5-4 (-> this neg-vol-count)) + (debug-draw (-> this neg-vol s5-4)) ) ) ) @@ -283,14 +283,14 @@ ) ;; definition for method 10 of type vol-control -(defmethod vol-control-method-10 vol-control ((obj vol-control) (arg0 plane)) - (dotimes (s4-0 (-> obj neg-vol-count)) - (if (point-in-vol? (-> obj neg-vol s4-0) arg0 0.0) +(defmethod vol-control-method-10 vol-control ((this vol-control) (arg0 plane)) + (dotimes (s4-0 (-> this neg-vol-count)) + (if (point-in-vol? (-> this neg-vol s4-0) arg0 0.0) (return #f) ) ) - (dotimes (s4-1 (-> obj pos-vol-count)) - (if (point-in-vol? (-> obj pos-vol s4-1) arg0 0.0) + (dotimes (s4-1 (-> this pos-vol-count)) + (if (point-in-vol? (-> this pos-vol s4-1) arg0 0.0) (return #t) ) ) diff --git a/goal_src/jak2/engine/gfx/background/prototype-h.gc b/goal_src/jak2/engine/gfx/background/prototype-h.gc index e0005caf2e..8dcf36cf8d 100644 --- a/goal_src/jak2/engine/gfx/background/prototype-h.gc +++ b/goal_src/jak2/engine/gfx/background/prototype-h.gc @@ -30,28 +30,29 @@ ;; DECOMP BEGINS (deftype prototype-bucket (basic) - ((name string :offset-assert 4) - (flags prototype-flags :offset-assert 8) - (texture-masks-index uint16 :offset-assert 10) - (in-level uint16 :offset-assert 12) - (utextures uint16 :offset-assert 14) - (geometry drawable 4 :offset-assert 16) - (dists vector :inline :offset-assert 32) - (rdists vector :inline :offset-assert 48) - (near-plane meters :offset 32) - (near-stiff meters :offset 36) - (mid-plane meters :offset 40) - (far-plane meters :offset 44) - (rlength-near float :offset 48) - (rlength-stiff float :offset 52) - (rlength-mid float :offset 56) - (stiffness float :offset 60) + ((name string :offset-assert 4) + (flags prototype-flags :offset-assert 8) + (texture-masks-index uint16 :offset-assert 10) + (in-level uint16 :offset-assert 12) + (utextures uint16 :offset-assert 14) + (geometry drawable 4 :offset-assert 16) + (dists vector :inline :offset-assert 32) + (rdists vector :inline :offset-assert 48) + (near-plane meters :offset 32) + (near-stiff meters :offset 36) + (mid-plane meters :offset 40) + (far-plane meters :offset 44) + (rlength-near float :offset 48) + (rlength-stiff float :offset 52) + (rlength-mid float :offset 56) + (stiffness float :offset 60) ) :method-count-assert 9 :size-assert #x40 :flag-assert #x900000040 ) + (deftype prototype-bucket-shrub (prototype-bucket) ((next uint32 4 :offset-assert 64) (count uint16 4 :offset-assert 80) @@ -67,6 +68,7 @@ :flag-assert #x900000070 ) + (deftype prototype-inline-array-shrub (drawable) ((length int16 :offset 6) (data prototype-bucket-shrub 1 :inline :offset 32) @@ -77,6 +79,7 @@ :flag-assert #x1100000094 ) + (deftype prototype-array-shrub-info (basic) ((prototype-inline-array-shrub prototype-inline-array-shrub :offset-assert 4) (wind-vectors uint32 :offset-assert 8) @@ -87,93 +90,95 @@ :flag-assert #x900000010 ) + (deftype prototype-bucket-tie (prototype-bucket) - ((next uint32 12 :offset-assert 64) - (count uint16 12 :offset-assert 112) - (frag-count uint8 4 :offset-assert 136) - (index-start uint8 4 :offset-assert 140) - (base-qw uint16 4 :offset-assert 144) - (tie-rvanish float :offset-assert 152) - (tie-vanish-far float :offset-assert 156) - (envmap-rfade float :offset-assert 160) - (envmap-fade-far float :offset-assert 164) - (envmap-shader adgif-shader :offset-assert 168) - (tint-color uint32 :offset-assert 172) - (collide-hash-fragment-array collide-hash-fragment-array :offset-assert 176) - (tie-colors time-of-day-palette :offset-assert 180) - (data uint32 :dynamic :offset-assert 184) - (color-index-qwc uint32 :dynamic :offset-assert 184) - (scissor-frag-count uint8 :offset 136) - (near-frag-count uint8 :offset 137) - (mid-frag-count uint8 :offset 138) - (far-frag-count uint8 :offset 139) - (scissor-index-start uint8 :offset 140) - (near-index-start uint8 :offset 141) - (mid-index-start uint8 :offset 142) - (far-index-start uint8 :offset 143) - (scissor-base-qw uint16 :offset 144) - (near-base-qw uint16 :offset 146) - (mid-base-qw uint16 :offset 148) - (far-base-qw uint16 :offset 150) - (tie-next uint32 4 :offset 64) - (tie-scissor-next uint32 :offset 64) - (tie-near-next uint32 :offset 68) - (tie-mid-next uint32 :offset 72) - (tie-far-next uint32 :offset 76) - (trans-next uint32 4 :offset 64) - (trans-scissor-next uint32 4 :offset 64) - (trans-near-next uint32 :offset 68) - (trans-mid-next uint32 :offset 72) - (trans-far-next uint32 :offset 76) - (water-next uint32 4 :offset 64) - (water-scissor-next uint32 4 :offset 64) - (water-near-next uint32 :offset 68) - (water-mid-next uint32 :offset 72) - (water-far-next uint32 :offset 76) - (envmap-next uint32 4 :offset 80) - (envmap-scissor-next uint32 4 :offset 80) - (envmap-near-next uint32 :offset 84) - (envmap-mid-next uint32 :offset 88) - (envmap-far-next uint32 :offset 92) - (generic-next uint32 3 :offset 96) - (generic-near-next uint32 :offset 96) - (generic-mid-next uint32 :offset 100) - (generic-far-next uint32 :offset 104) - (vanish-next uint32 :offset 108) - (tie-count uint16 4 :offset 112) - (tie-scissor-count uint16 :offset 112) - (tie-near-count uint16 :offset 114) - (tie-mid-count uint16 :offset 116) - (tie-far-count uint16 :offset 118) - (trans-count uint16 4 :offset 112) - (trans-scissor-count uint16 :offset 112) - (trans-near-count uint16 :offset 114) - (trans-mid-count uint16 :offset 116) - (trans-far-count uint16 :offset 118) - (water-count uint16 4 :offset 112) - (water-scissor-count uint16 :offset 112) - (water-near-count uint16 :offset 114) - (water-mid-count uint16 :offset 116) - (water-far-count uint16 :offset 118) - (envmap-count uint16 4 :offset 120) - (envmap-scissor-count uint16 :offset 120) - (envmap-near-count uint16 :offset 122) - (envmap-mid-count uint16 :offset 124) - (envmap-far-count uint16 :offset 126) - (generic-count uint16 3 :offset 128) - (generic-near-count uint16 :offset 128) - (generic-mid-count uint16 :offset 130) - (generic-far-count uint16 :offset 132) - (vanish-count uint16 :offset 134) - (next-clear uint128 3 :offset 64) - (count-clear uint64 3 :offset 112) - (tie-geom prototype-tie 4 :offset 16) + ((next uint32 12 :offset-assert 64) + (count uint16 12 :offset-assert 112) + (frag-count uint8 4 :offset-assert 136) + (index-start uint8 4 :offset-assert 140) + (base-qw uint16 4 :offset-assert 144) + (tie-rvanish float :offset-assert 152) + (tie-vanish-far float :offset-assert 156) + (envmap-rfade float :offset-assert 160) + (envmap-fade-far float :offset-assert 164) + (envmap-shader adgif-shader :offset-assert 168) + (tint-color uint32 :offset-assert 172) + (collide-hash-fragment-array collide-hash-fragment-array :offset-assert 176) + (tie-colors time-of-day-palette :offset-assert 180) + (data uint32 :dynamic :offset-assert 184) + (color-index-qwc uint32 :dynamic :offset-assert 184) + (scissor-frag-count uint8 :offset 136) + (near-frag-count uint8 :offset 137) + (mid-frag-count uint8 :offset 138) + (far-frag-count uint8 :offset 139) + (scissor-index-start uint8 :offset 140) + (near-index-start uint8 :offset 141) + (mid-index-start uint8 :offset 142) + (far-index-start uint8 :offset 143) + (scissor-base-qw uint16 :offset 144) + (near-base-qw uint16 :offset 146) + (mid-base-qw uint16 :offset 148) + (far-base-qw uint16 :offset 150) + (tie-next uint32 4 :offset 64) + (tie-scissor-next uint32 :offset 64) + (tie-near-next uint32 :offset 68) + (tie-mid-next uint32 :offset 72) + (tie-far-next uint32 :offset 76) + (trans-next uint32 4 :offset 64) + (trans-scissor-next uint32 4 :offset 64) + (trans-near-next uint32 :offset 68) + (trans-mid-next uint32 :offset 72) + (trans-far-next uint32 :offset 76) + (water-next uint32 4 :offset 64) + (water-scissor-next uint32 4 :offset 64) + (water-near-next uint32 :offset 68) + (water-mid-next uint32 :offset 72) + (water-far-next uint32 :offset 76) + (envmap-next uint32 4 :offset 80) + (envmap-scissor-next uint32 4 :offset 80) + (envmap-near-next uint32 :offset 84) + (envmap-mid-next uint32 :offset 88) + (envmap-far-next uint32 :offset 92) + (generic-next uint32 3 :offset 96) + (generic-near-next uint32 :offset 96) + (generic-mid-next uint32 :offset 100) + (generic-far-next uint32 :offset 104) + (vanish-next uint32 :offset 108) + (tie-count uint16 4 :offset 112) + (tie-scissor-count uint16 :offset 112) + (tie-near-count uint16 :offset 114) + (tie-mid-count uint16 :offset 116) + (tie-far-count uint16 :offset 118) + (trans-count uint16 4 :offset 112) + (trans-scissor-count uint16 :offset 112) + (trans-near-count uint16 :offset 114) + (trans-mid-count uint16 :offset 116) + (trans-far-count uint16 :offset 118) + (water-count uint16 4 :offset 112) + (water-scissor-count uint16 :offset 112) + (water-near-count uint16 :offset 114) + (water-mid-count uint16 :offset 116) + (water-far-count uint16 :offset 118) + (envmap-count uint16 4 :offset 120) + (envmap-scissor-count uint16 :offset 120) + (envmap-near-count uint16 :offset 122) + (envmap-mid-count uint16 :offset 124) + (envmap-far-count uint16 :offset 126) + (generic-count uint16 3 :offset 128) + (generic-near-count uint16 :offset 128) + (generic-mid-count uint16 :offset 130) + (generic-far-count uint16 :offset 132) + (vanish-count uint16 :offset 134) + (next-clear uint128 3 :offset 64) + (count-clear uint64 3 :offset 112) + (tie-geom prototype-tie 4 :offset 16) ) :method-count-assert 9 :size-assert #xb8 :flag-assert #x9000000b8 ) + (deftype prototype-array-tie (array) ((array-data prototype-bucket-tie :dynamic :offset 16) ) @@ -185,6 +190,7 @@ ) ) + (deftype proxy-prototype-array-tie (basic) ((prototype-array-tie prototype-array-tie :offset-assert 4) (wind-vectors uint32 :offset-assert 8) @@ -196,14 +202,14 @@ :flag-assert #x900000010 ) + (deftype instance (drawable) - ((bucket-index uint16 :offset 6) - (origin matrix4h :inline :offset-assert 32) - (flags instance-flags :offset 46) - (wind-index uint16 :offset 62) + ((bucket-index uint16 :offset 6) + (origin matrix4h :inline :offset-assert 32) + (flags instance-flags :offset 46) + (wind-index uint16 :offset 62) ) :method-count-assert 17 :size-assert #x40 :flag-assert #x1100000040 ) - diff --git a/goal_src/jak2/engine/gfx/background/prototype.gc b/goal_src/jak2/engine/gfx/background/prototype.gc index bc976b7bc5..511f79dd4e 100644 --- a/goal_src/jak2/engine/gfx/background/prototype.gc +++ b/goal_src/jak2/engine/gfx/background/prototype.gc @@ -7,10 +7,10 @@ ;; DECOMP BEGINS -(defmethod login prototype-inline-array-shrub ((obj prototype-inline-array-shrub)) +(defmethod login prototype-inline-array-shrub ((this prototype-inline-array-shrub)) (let ((bsp-header (-> *level* level *level-index* bsp))) - (dotimes (shrub-idx (-> obj length)) - (let ((shrub (-> obj data shrub-idx))) + (dotimes (shrub-idx (-> this length)) + (let ((shrub (-> this data shrub-idx))) (when (and *debug-segment* (-> *screen-shot-work* highres-enable)) (dotimes (shrub-i 4) (+! (-> shrub dists data shrub-i) 40960000.0) @@ -28,26 +28,26 @@ ) ) ) - obj + this ) -(defmethod mem-usage prototype-array-tie ((obj prototype-array-tie) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage prototype-array-tie ((this prototype-array-tie) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 1 (-> usage length))) (set! (-> usage data 0 name) (symbol->string 'drawable-group)) (+! (-> usage data 0 count) 1) - (let ((size-of-tie (asize-of obj))) + (let ((size-of-tie (asize-of this))) (+! (-> usage data 0 used) size-of-tie) (+! (-> usage data 0 total) (logand -16 (+ size-of-tie 15))) ) - (dotimes (tie-idx (-> obj length)) - (mem-usage (-> obj array-data tie-idx) usage arg2) + (dotimes (tie-idx (-> this length)) + (mem-usage (-> this array-data tie-idx) usage arg2) ) - obj + this ) -(defmethod mem-usage prototype-bucket-tie ((obj prototype-bucket-tie) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage prototype-bucket-tie ((this prototype-bucket-tie) (usage memory-usage-block) (arg2 int)) (dotimes (idx 4) - (let ((tie-geom (-> obj tie-geom idx))) + (let ((tie-geom (-> this tie-geom idx))) (if (nonzero? tie-geom) (mem-usage tie-geom usage (logior arg2 1)) ) @@ -56,40 +56,40 @@ (set! (-> usage length) (max 84 (-> usage length))) (set! (-> usage data 83 name) "string") (+! (-> usage data 83 count) 1) - (let ((name-size (asize-of (-> obj name)))) + (let ((name-size (asize-of (-> this name)))) (+! (-> usage data 83 used) name-size) (+! (-> usage data 83 total) (logand -16 (+ name-size 15))) ) - (when (nonzero? (-> obj tie-colors)) + (when (nonzero? (-> this tie-colors)) (set! (-> usage length) (max 17 (-> usage length))) (set! (-> usage data 16 name) "tie-pal") (+! (-> usage data 16 count) 1) - (let ((color-size (asize-of (-> obj tie-colors)))) + (let ((color-size (asize-of (-> this tie-colors)))) (+! (-> usage data 16 used) color-size) (+! (-> usage data 16 total) (logand -16 (+ color-size 15))) ) ) - (if (nonzero? (-> obj collide-hash-fragment-array)) - (mem-usage (-> obj collide-hash-fragment-array) usage (logior arg2 1)) + (if (nonzero? (-> this collide-hash-fragment-array)) + (mem-usage (-> this collide-hash-fragment-array) usage (logior arg2 1)) ) - obj + this ) -(defmethod mem-usage prototype-inline-array-shrub ((obj prototype-inline-array-shrub) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage prototype-inline-array-shrub ((this prototype-inline-array-shrub) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 1 (-> usage length))) (set! (-> usage data 0 name) (symbol->string 'drawable-group)) (+! (-> usage data 0 count) 1) - (let ((shrub-size (asize-of obj))) + (let ((shrub-size (asize-of this))) (+! (-> usage data 0 used) shrub-size) (+! (-> usage data 0 total) (logand -16 (+ shrub-size 15))) ) - (dotimes (idx (-> obj length)) - (mem-usage (-> obj data idx) usage arg2) + (dotimes (idx (-> this length)) + (mem-usage (-> this data idx) usage arg2) ) - obj + this ) -(defmethod mem-usage prototype-bucket-shrub ((obj prototype-bucket-shrub) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage prototype-bucket-shrub ((this prototype-bucket-shrub) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 25 (-> usage length))) (set! (-> usage data 24 name) "prototype-bucket-shrub") (+! (-> usage data 24 count) 1) @@ -98,7 +98,7 @@ (+! (-> usage data 24 total) (logand -16 (+ proto-shrub-size 15))) ) (dotimes (idx 4) - (let ((geo (-> obj geometry idx))) + (let ((geo (-> this geometry idx))) (if (nonzero? geo) (mem-usage geo usage (logior arg2 1)) ) @@ -107,9 +107,9 @@ (set! (-> usage length) (max 84 (-> usage length))) (set! (-> usage data 83 name) "string") (+! (-> usage data 83 count) 1) - (let ((name-size (asize-of (-> obj name)))) + (let ((name-size (asize-of (-> this name)))) (+! (-> usage data 83 used) name-size) (+! (-> usage data 83 total) (logand -16 (+ name-size 15))) ) - obj + this ) diff --git a/goal_src/jak2/engine/gfx/background/tfrag/tfrag-h.gc b/goal_src/jak2/engine/gfx/background/tfrag/tfrag-h.gc index db555eda58..a471172873 100644 --- a/goal_src/jak2/engine/gfx/background/tfrag/tfrag-h.gc +++ b/goal_src/jak2/engine/gfx/background/tfrag/tfrag-h.gc @@ -22,6 +22,7 @@ :flag-assert #x900000010 ) + (deftype tfragment-debug-data (structure) ((stats tfragment-stats :inline :offset-assert 0) (debug-lines (array vector-array) :offset-assert 16) @@ -31,6 +32,7 @@ :flag-assert #x900000014 ) + (deftype generic-tfragment (structure) ((dummy int32 :offset-assert 0) ) @@ -39,6 +41,7 @@ :flag-assert #x900000004 ) + (deftype tfragment (drawable) ((color-index uint16 :offset 6) (debug-data tfragment-debug-data :offset 8) @@ -67,6 +70,7 @@ :flag-assert #x1100000040 ) + (deftype drawable-inline-array-tfrag (drawable-inline-array) ((data tfragment 1 :inline :offset-assert 32) (pad uint32 :offset-assert 96) @@ -128,6 +132,7 @@ :flag-assert #x900000040 ) + (deftype tfrag-data (structure) ((data uint32 56 :offset 0) (vector vector 14 :inline :offset 0) @@ -150,6 +155,7 @@ :flag-assert #x9000000e0 ) + (deftype tfrag-control (structure) ((num-base-points uint32 :offset-assert 0) (num-shared-base-points uint32 :offset-assert 4) @@ -177,6 +183,7 @@ :flag-assert #x900000050 ) + (deftype tfrag-stats (structure) ((from int32 :offset-assert 0) (to int32 :offset-assert 4) @@ -200,6 +207,7 @@ :flag-assert #x900000040 ) + (deftype tfrag-packet (structure) ((tag uint128 2 :offset-assert 0) ) @@ -208,6 +216,7 @@ :flag-assert #x900000020 ) + (deftype tfrag-work (structure) ((base-tmpl dma-packet :inline :offset-assert 0) (level-0-tmpl dma-packet :inline :offset-assert 16) @@ -240,6 +249,7 @@ :flag-assert #x9000000c0 ) + (deftype tfrag-dma (structure) ((banka tfragment 16 :inline :offset-assert 0) (bankb tfragment 16 :inline :offset-assert 1024) diff --git a/goal_src/jak2/engine/gfx/background/tfrag/tfrag-methods.gc b/goal_src/jak2/engine/gfx/background/tfrag/tfrag-methods.gc index b45e9b6bdc..f67735615d 100644 --- a/goal_src/jak2/engine/gfx/background/tfrag/tfrag-methods.gc +++ b/goal_src/jak2/engine/gfx/background/tfrag/tfrag-methods.gc @@ -648,11 +648,11 @@ (none) ) -(defmethod draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) - (set! (-> *background-work* tfrag-trees v1-1) obj) + (set! (-> *background-work* tfrag-trees v1-1) this) (set! (-> *background-work* tfrag-levels v1-1) a1-4) ) (+! (-> *background-work* tfrag-tree-count) 1) @@ -660,11 +660,11 @@ (none) ) -(defmethod draw drawable-tree-tfrag-trans ((obj drawable-tree-tfrag-trans) (arg0 drawable-tree-tfrag-trans) (arg1 display-frame)) +(defmethod draw drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans) (arg0 drawable-tree-tfrag-trans) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-trans-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) - (set! (-> *background-work* tfrag-trans-trees v1-1) obj) + (set! (-> *background-work* tfrag-trans-trees v1-1) this) (set! (-> *background-work* tfrag-trans-levels v1-1) a1-4) ) (+! (-> *background-work* tfrag-trans-tree-count) 1) @@ -672,11 +672,11 @@ (none) ) -(defmethod draw drawable-tree-tfrag-water ((obj drawable-tree-tfrag-water) (arg0 drawable-tree-tfrag-water) (arg1 display-frame)) +(defmethod draw drawable-tree-tfrag-water ((this drawable-tree-tfrag-water) (arg0 drawable-tree-tfrag-water) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-water-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) - (set! (-> *background-work* tfrag-water-trees v1-1) obj) + (set! (-> *background-work* tfrag-water-trees v1-1) this) (set! (-> *background-work* tfrag-water-levels v1-1) a1-4) ) (+! (-> *background-work* tfrag-water-tree-count) 1) @@ -684,13 +684,13 @@ (none) ) -(defmethod collect-stats tfragment ((obj tfragment)) - (stats-tfrag-asm obj) +(defmethod collect-stats tfragment ((this tfragment)) + (stats-tfrag-asm this) 0 (none) ) -(defmethod collect-stats drawable-tree-tfrag ((obj drawable-tree-tfrag)) +(defmethod collect-stats drawable-tree-tfrag ((this drawable-tree-tfrag)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))) @@ -703,15 +703,15 @@ (let ((v1-15 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-15) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) 0 (none) ) -(defmethod collect-stats drawable-tree-tfrag-trans ((obj drawable-tree-tfrag-trans)) +(defmethod collect-stats drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))) @@ -724,15 +724,15 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) 0 (none) ) -(defmethod collect-stats drawable-tree-tfrag-water ((obj drawable-tree-tfrag-water)) +(defmethod collect-stats drawable-tree-tfrag-water ((this drawable-tree-tfrag-water)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))) @@ -745,18 +745,18 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) 0 (none) ) -(defmethod collect-stats drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag)) +(defmethod collect-stats drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (if (vis-cull (-> s4-0 id)) (collect-stats s4-0) ) @@ -767,10 +767,10 @@ (none) ) -(defmethod collect-stats drawable-inline-array-tfrag-trans ((obj drawable-inline-array-tfrag-trans)) +(defmethod collect-stats drawable-inline-array-tfrag-trans ((this drawable-inline-array-tfrag-trans)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (if (vis-cull (-> s4-0 id)) (collect-stats s4-0) ) @@ -781,10 +781,10 @@ (none) ) -(defmethod collect-stats drawable-inline-array-tfrag-water ((obj drawable-inline-array-tfrag-water)) +(defmethod collect-stats drawable-inline-array-tfrag-water ((this drawable-inline-array-tfrag-water)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (if (vis-cull (-> s4-0 id)) (collect-stats s4-0) ) @@ -795,10 +795,10 @@ (none) ) -(defmethod debug-draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) - (dotimes (s4-0 (-> obj length)) - (let ((a1-1 (-> obj arrays s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((a1-1 (-> this arrays s4-0))) (debug-draw a1-1 a1-1 arg1) ) ) @@ -807,10 +807,10 @@ (none) ) -(defmethod debug-draw drawable-tree-tfrag-trans ((obj drawable-tree-tfrag-trans) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans) (arg0 drawable) (arg1 display-frame)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) - (dotimes (s4-0 (-> obj length)) - (let ((a1-1 (-> obj arrays s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((a1-1 (-> this arrays s4-0))) (debug-draw a1-1 a1-1 arg1) ) ) @@ -819,10 +819,10 @@ (none) ) -(defmethod debug-draw drawable-tree-tfrag-water ((obj drawable-tree-tfrag-water) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-tree-tfrag-water ((this drawable-tree-tfrag-water) (arg0 drawable) (arg1 display-frame)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) - (dotimes (s4-0 (-> obj length)) - (let ((a1-1 (-> obj arrays s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((a1-1 (-> this arrays s4-0))) (debug-draw a1-1 a1-1 arg1) ) ) @@ -831,9 +831,9 @@ (none) ) -(defmethod debug-draw drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj data s4-0))) +(defmethod debug-draw drawable-inline-array-tfrag ((this drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this data s4-0))) (if (vis-cull (-> s3-0 id)) (debug-draw s3-0 s3-0 arg1) ) @@ -843,9 +843,9 @@ (none) ) -(defmethod debug-draw tfragment ((obj tfragment) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw tfragment ((this tfragment) (arg0 drawable) (arg1 display-frame)) (-> arg1 global-buf) - (edge-debug-lines (-> obj debug-data debug-lines)) + (edge-debug-lines (-> this debug-data debug-lines)) 0 (none) ) diff --git a/goal_src/jak2/engine/gfx/background/tie/generic-tie-h.gc b/goal_src/jak2/engine/gfx/background/tie/generic-tie-h.gc index 1e19ee3c08..14bb8f7e9d 100644 --- a/goal_src/jak2/engine/gfx/background/tie/generic-tie-h.gc +++ b/goal_src/jak2/engine/gfx/background/tie/generic-tie-h.gc @@ -19,6 +19,7 @@ :flag-assert #x900000170 ) + (deftype generic-tie-input (structure) ((palette-tag dma-packet :inline :offset-assert 0) (palette rgba 128 :offset-assert 16) @@ -35,6 +36,7 @@ :flag-assert #x900000cb0 ) + (deftype generic-tie-run-control (structure) ((skip-bp2 uint8 :offset-assert 0) (skip-ips uint8 :offset-assert 1) @@ -54,6 +56,7 @@ :flag-assert #x90000000c ) + (deftype generic-tie-base-point (structure) ((data uint16 8 :offset-assert 0) (quad uint128 :offset 0) @@ -73,6 +76,7 @@ :flag-assert #x900000010 ) + (deftype generic-tie-bps (structure) ((bp generic-tie-base-point 4 :inline :offset-assert 0) ) @@ -81,6 +85,7 @@ :flag-assert #x900000040 ) + (deftype generic-tie-interp-point (structure) ((data uint16 12 :offset-assert 0) (x int16 :offset 0) @@ -105,6 +110,7 @@ :flag-assert #x900000018 ) + (deftype generic-tie-ips (structure) ((ip generic-tie-interp-point 2 :inline :offset-assert 0) ) @@ -113,6 +119,7 @@ :flag-assert #x900000030 ) + (deftype generic-tie-header (structure) ((effect uint8 :offset-assert 0) (interp-table-size uint8 :offset-assert 1) @@ -130,6 +137,7 @@ :flag-assert #x900000020 ) + (deftype generic-tie-matrix (structure) ((matrix matrix :inline :offset-assert 0) (morph vector :inline :offset-assert 64) @@ -140,6 +148,7 @@ :flag-assert #x900000060 ) + (deftype generic-tie-normal (structure) ((x int8 :offset-assert 0) (y int8 :offset-assert 1) @@ -151,6 +160,7 @@ :flag-assert #x900000004 ) + (deftype generic-tie-control (structure) ((ptr-palette uint32 :offset-assert 0) (ptr-shaders uint32 :offset-assert 4) @@ -173,6 +183,7 @@ :flag-assert #x90000003c ) + (deftype generic-tie-stats (structure) ((num-bps uint32 :offset-assert 0) (num-ips uint32 :offset-assert 4) @@ -189,6 +200,7 @@ :flag-assert #x900000024 ) + (deftype generic-tie-calls (structure) ((generic-prepare-dma-double basic :offset-assert 0) (generic-envmap-dproc basic :offset-assert 4) @@ -201,6 +213,7 @@ :flag-assert #x900000010 ) + (deftype generic-tie-shadow (structure) ((out-buf gsf-buffer :offset-assert 0) (cur-buf uint32 :offset-assert 4) @@ -218,6 +231,7 @@ :flag-assert #x900000030 ) + (deftype generic-tie-work (structure) ((control generic-tie-control :inline :offset-assert 0) (interp-job generic-interp-job :inline :offset-assert 60) diff --git a/goal_src/jak2/engine/gfx/background/tie/tie-h.gc b/goal_src/jak2/engine/gfx/background/tie/tie-h.gc index 3e571e8425..7efe52b412 100644 --- a/goal_src/jak2/engine/gfx/background/tie/tie-h.gc +++ b/goal_src/jak2/engine/gfx/background/tie/tie-h.gc @@ -25,6 +25,7 @@ :flag-assert #x900000008 ) + (deftype tie-fragment (drawable) ((gif-ref (inline-array adgif-shader) :offset 4) (point-ref uint32 :offset 8) @@ -47,6 +48,7 @@ :flag-assert #x1100000040 ) + (deftype instance-tie (instance) ((color-indices uint32 :offset 8) (bucket-ptr prototype-bucket-tie :offset 12) @@ -58,6 +60,7 @@ :flag-assert #x1100000040 ) + (deftype drawable-inline-array-instance-tie (drawable-inline-array) ((data instance-tie 1 :inline :offset-assert 32) (pad uint32 :offset-assert 96) @@ -75,6 +78,7 @@ :flag-assert #x1100000020 ) + (deftype prototype-tie (drawable-inline-array) ((data tie-fragment 1 :inline :offset-assert 32) (pad uint32 :offset-assert 96) @@ -99,6 +103,7 @@ :flag-assert #x900000060 ) + (deftype instance-tie-work (structure) ((wind-const vector :inline :offset-assert 0) (hmge-d vector :inline :offset-assert 16) @@ -152,6 +157,7 @@ :flag-assert #x90000022c ) + (deftype instance-tie-dma (structure) ((banka instance-tie 32 :inline :offset-assert 0) (bankb instance-tie 32 :inline :offset-assert 2048) @@ -164,6 +170,7 @@ :flag-assert #x900003000 ) + (deftype prototype-tie-work (structure) ((upload-flushe dma-packet :inline :offset-assert 0) (upload-palette dma-packet :inline :offset-assert 16) @@ -251,6 +258,7 @@ :flag-assert #x900000240 ) + (deftype prototype-tie-dma (structure) ((colora rgba 256 :offset-assert 0) (colorb rgba 256 :offset-assert 1024) diff --git a/goal_src/jak2/engine/gfx/background/tie/tie.gc b/goal_src/jak2/engine/gfx/background/tie/tie.gc index 890b6d7982..7ef8a9a00b 100644 --- a/goal_src/jak2/engine/gfx/background/tie/tie.gc +++ b/goal_src/jak2/engine/gfx/background/tie/tie.gc @@ -7,9 +7,9 @@ ;; DECOMP BEGINS -(defmethod login tie-fragment ((obj tie-fragment)) - (let ((s5-0 (the-as adgif-shader (-> obj gif-ref))) - (s4-0 (/ (-> obj tex-count) (the-as uint 5))) +(defmethod login tie-fragment ((this tie-fragment)) + (let ((s5-0 (the-as adgif-shader (-> this gif-ref))) + (s4-0 (/ (-> this tex-count) (the-as uint 5))) ) (dotimes (s3-0 (the-as int s4-0)) (let ((v1-1 (adgif-shader-login-no-remap s5-0))) @@ -36,52 +36,52 @@ (&+! s5-0 80) ) ) - obj + this ) -(defmethod inspect drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) -(defmethod asize-of drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie)) - (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> obj length) -1) 64))) +(defmethod asize-of drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) + (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64))) ) -; (defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) -; obj +; (defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) +; this ; ) -(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) -(defmethod inspect prototype-tie ((obj prototype-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect prototype-tie ((this prototype-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) -(defmethod login prototype-tie ((obj prototype-tie)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login prototype-tie ((this prototype-tie)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) -(defmethod mem-usage drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -89,16 +89,16 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - (mem-usage (-> obj prototypes prototype-array-tie) arg0 (logior arg1 1)) - obj + (mem-usage (-> this prototypes prototype-array-tie) arg0 (logior arg1 1)) + this ) -(defmethod mem-usage tie-fragment ((obj tie-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage tie-fragment ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) (when (logtest? arg1 2) - (let ((v1-3 (* (-> obj color-count) 4)) + (let ((v1-3 (* (-> this color-count) 4)) (a0-2 (cond ((logtest? arg1 4) 20 @@ -117,7 +117,7 @@ (+! (-> arg0 data a0-2 total) (logand -4 (+ v1-3 3))) ) (set! (-> arg0 length) (max 23 (-> arg0 length))) - (set! obj obj) + (set! this this) (goto cfg-13) ) (set! (-> arg0 length) (max 18 (-> arg0 length))) @@ -129,31 +129,31 @@ (set! (-> arg0 data 13 name) "tie-draw-points") (set! (-> arg0 data 17 name) "tie-generic") (+! (-> arg0 data 9 count) 1) - (let ((v1-21 (asize-of obj))) + (let ((v1-21 (asize-of this))) (+! (-> arg0 data 9 used) v1-21) (+! (-> arg0 data 9 total) (logand -16 (+ v1-21 15))) ) - (let ((v1-26 (* (-> obj gif-count) 16))) - (+! (-> arg0 data 10 count) (-> obj tex-count)) + (let ((v1-26 (* (-> this gif-count) 16))) + (+! (-> arg0 data 10 count) (-> this tex-count)) (+! (-> arg0 data 10 used) v1-26) (+! (-> arg0 data 10 total) (logand -16 (+ v1-26 15))) ) - (let ((v1-31 (* (-> obj vertex-count) 16))) - (+! (-> arg0 data 11 count) (-> obj vertex-count)) + (let ((v1-31 (* (-> this vertex-count) 16))) + (+! (-> arg0 data 11 count) (-> this vertex-count)) (+! (-> arg0 data 11 used) v1-31) (+! (-> arg0 data 11 total) (logand -16 (+ v1-31 15))) ) - (let ((v1-36 (* (-> obj dp-qwc) 16))) - (+! (-> arg0 data 13 count) (* (-> obj dp-qwc) 16)) + (let ((v1-36 (* (-> this dp-qwc) 16))) + (+! (-> arg0 data 13 count) (* (-> this dp-qwc) 16)) (+! (-> arg0 data 13 used) v1-36) (+! (-> arg0 data 13 total) (logand -16 (+ v1-36 15))) ) - (let ((v1-41 (* (-> obj generic-count) 16))) + (let ((v1-41 (* (-> this generic-count) 16))) (+! (-> arg0 data 17 count) 1) (+! (-> arg0 data 17 used) v1-41) (+! (-> arg0 data 17 total) (logand -16 (+ v1-41 15))) ) - (let ((s4-0 (-> obj debug debug-lines))) + (let ((s4-0 (-> this debug debug-lines))) (when (nonzero? s4-0) (dotimes (s3-0 (-> s4-0 length)) (+! (-> arg0 data 14 count) (-> s4-0 s3-0 length)) @@ -165,18 +165,18 @@ ) ) (label cfg-13) - obj + this ) -(defmethod mem-usage instance-tie ((obj instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage instance-tie ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 19 (-> arg0 length))) (set! (-> arg0 data 18 name) "instance-tie") (+! (-> arg0 data 18 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 18 used) v1-6) (+! (-> arg0 data 18 total) (logand -16 (+ v1-6 15))) ) - (when (nonzero? (-> obj color-indices)) + (when (nonzero? (-> this color-indices)) (set! (-> arg0 length) (max 24 (-> arg0 length))) (set! (-> arg0 data 23 name) "instance-tie-colors*") (set! (-> arg0 data 19 name) "instance-tie-colors0") @@ -184,7 +184,7 @@ (set! (-> arg0 data 21 name) "instance-tie-colors2") (set! (-> arg0 data 22 name) "instance-tie-colors3") (+! (-> arg0 data 23 count) 1) - (let ((s3-0 (-> obj bucket-ptr))) + (let ((s3-0 (-> this bucket-ptr))) (+ (-> arg0 data 19 used) (-> arg0 data 20 used) (-> arg0 data 21 used) (-> arg0 data 22 used)) (dotimes (s2-0 4) (let ((a0-10 (-> s3-0 tie-geom s2-0))) @@ -218,10 +218,10 @@ ) ) ) - obj + this ) -(defmethod mem-usage drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -229,13 +229,13 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod mem-usage prototype-tie ((obj prototype-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-tie ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -243,14 +243,14 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod asize-of prototype-tie ((obj prototype-tie)) - (the-as int (+ (-> prototype-tie size) (* (+ (-> obj length) -1) 64))) +(defmethod asize-of prototype-tie ((this prototype-tie)) + (the-as int (+ (-> prototype-tie size) (* (+ (-> this length) -1) 64))) ) (deftype tie-consts (structure) diff --git a/goal_src/jak2/engine/gfx/background/wind-h.gc b/goal_src/jak2/engine/gfx/background/wind-h.gc index a4424aeba3..ef9194302a 100644 --- a/goal_src/jak2/engine/gfx/background/wind-h.gc +++ b/goal_src/jak2/engine/gfx/background/wind-h.gc @@ -17,14 +17,41 @@ :flag-assert #x900000020 ) -(define *wind-scales* - (new 'static 'boxed-array :type uint8 - #x2 #x5 #x2 #x3 #x2 #x2 #x3 #x10 #xa - #x2 #x4 #x2 #x8 #x2 #x2 #x10 #x2 #x2 - #x8 #x2 #x10 #x2 #x4 #x10 #xa #x2 #x4 - #x2 #x8 #x2 #x2 #x10 - ) +(define *wind-scales* (new 'static 'boxed-array :type uint8 + #x2 + #x5 + #x2 + #x3 + #x2 + #x2 + #x3 + #x10 + #xa + #x2 + #x4 + #x2 + #x8 + #x2 + #x2 + #x10 + #x2 + #x2 + #x8 + #x2 + #x10 + #x2 + #x4 + #x10 + #xa + #x2 + #x4 + #x2 + #x8 + #x2 + #x2 + #x10 + ) ) (deftype wind-work (basic) @@ -54,6 +81,7 @@ :flag-assert #x900000584 ) + (deftype wind-dma (structure) ((buffer0 wind-vector 128 :inline :offset-assert 0) (buffer1 wind-vector 128 :inline :offset-assert 4096) diff --git a/goal_src/jak2/engine/gfx/foreground/bones-h.gc b/goal_src/jak2/engine/gfx/foreground/bones-h.gc index c0b3073b12..eb8e3b1970 100644 --- a/goal_src/jak2/engine/gfx/foreground/bones-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/bones-h.gc @@ -30,43 +30,46 @@ ;; DECOMP BEGINS (deftype bone-buffer (structure) - ((joint matrix 16 :inline :offset-assert 0) - (bone bone 16 :inline :offset-assert 1024) - (output pris-mtx 16 :inline :offset-assert 2304) + ((joint matrix 16 :inline :offset-assert 0) + (bone bone 16 :inline :offset-assert 1024) + (output pris-mtx 16 :inline :offset-assert 2304) ) :method-count-assert 9 :size-assert #x1100 :flag-assert #x900001100 ) + (deftype bone-layout (structure) - ((data uint16 8 :offset-assert 0) - (joint (inline-array matrix) 2 :offset 0) - (bone (inline-array bone) 2 :offset 8) - (output (inline-array pris-mtx) 2 :offset 16) - (unused uint32 2 :offset 24) + ((data uint16 8 :offset-assert 0) + (joint (inline-array matrix) 2 :offset 0) + (bone (inline-array bone) 2 :offset 8) + (output (inline-array pris-mtx) 2 :offset 16) + (unused uint32 2 :offset 24) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) + (deftype bone-regs (structure) - ((dma-buf basic :offset-assert 0) - (wait-count uint32 :offset-assert 4) - (in-count uint32 :offset-assert 8) - (sp-size uint32 :offset-assert 12) - (sp-bufnum uint32 :offset-assert 16) - (joint-ptr (inline-array joint) :offset-assert 20) - (bone-ptr (inline-array bone) :offset-assert 24) - (num-bones uint32 :offset-assert 28) - (mtxs (inline-array pris-mtx) :offset-assert 32) + ((dma-buf basic :offset-assert 0) + (wait-count uint32 :offset-assert 4) + (in-count uint32 :offset-assert 8) + (sp-size uint32 :offset-assert 12) + (sp-bufnum uint32 :offset-assert 16) + (joint-ptr (inline-array joint) :offset-assert 20) + (bone-ptr (inline-array bone) :offset-assert 24) + (num-bones uint32 :offset-assert 28) + (mtxs (inline-array pris-mtx) :offset-assert 32) ) :method-count-assert 9 :size-assert #x24 :flag-assert #x900000024 ) + (deftype bone-work (structure) ((layout bone-layout :inline :offset-assert 0) (regs bone-regs :inline :offset-assert 32) @@ -76,6 +79,7 @@ :flag-assert #x900000044 ) + (deftype bone-debug (structure) ((time-ctr uint32 :offset-assert 0) (timing uint32 360 :offset-assert 4) @@ -85,6 +89,7 @@ :flag-assert #x9000005a4 ) + (deftype bone-memory (structure) ((work bone-work :inline :offset-assert 0) (buffer bone-buffer 2 :inline :offset-assert 80) @@ -94,21 +99,22 @@ :flag-assert #x900002250 ) + (deftype bone-calculation (structure) - ((flags bone-calc-flags :offset-assert 0) - (num-bones uint16 :offset-assert 2) - (matrix-area (inline-array pris-mtx) :offset-assert 4) - (joints (inline-array joint) :offset-assert 8) - (bones (inline-array bone) :offset-assert 12) - (ripple-scale float :offset-assert 16) - (ripple-y-scale float :offset-assert 20) - (ripple-normal-scale float :offset-assert 24) - (ripple-area (inline-array vector) :offset-assert 28) - (ripple-vec vector :inline :offset 16) - (next bone-calculation :offset-assert 32) - (dummy-1 uint32 :offset-assert 36) - (dummy-2 uint32 :offset-assert 40) - (dummy-3 uint32 :offset-assert 44) + ((flags bone-calc-flags :offset-assert 0) + (num-bones uint16 :offset-assert 2) + (matrix-area (inline-array pris-mtx) :offset-assert 4) + (joints (inline-array joint) :offset-assert 8) + (bones (inline-array bone) :offset-assert 12) + (ripple-scale float :offset-assert 16) + (ripple-y-scale float :offset-assert 20) + (ripple-normal-scale float :offset-assert 24) + (ripple-area (inline-array vector) :offset-assert 28) + (ripple-vec vector :inline :offset 16) + (next bone-calculation :offset-assert 32) + (dummy-1 uint32 :offset-assert 36) + (dummy-2 uint32 :offset-assert 40) + (dummy-3 uint32 :offset-assert 44) ) :method-count-assert 9 :size-assert #x30 diff --git a/goal_src/jak2/engine/gfx/foreground/foreground-h.gc b/goal_src/jak2/engine/gfx/foreground/foreground-h.gc index a47a41321b..5bb174cde7 100644 --- a/goal_src/jak2/engine/gfx/foreground/foreground-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/foreground-h.gc @@ -23,6 +23,7 @@ :flag-assert #x900000014 ) + (deftype merc-chain (structure) ((first dma-packet :offset-assert 0) (patch dma-packet :offset-assert 4) @@ -34,6 +35,7 @@ :flag-assert #x90000000c ) + (deftype foreground-bucket (structure) ((merc merc-chain :inline :offset-assert 0) (emerc merc-chain :inline :offset-assert 12) @@ -44,6 +46,7 @@ :flag-assert #x90000002c ) + (deftype foreground-level-buckets (structure) ((data foreground-bucket 7 :inline :offset-assert 0) ) @@ -52,6 +55,7 @@ :flag-assert #x900000150 ) + (deftype foreground-bucket-grid (structure) ((level-buckets foreground-level-buckets LEVEL_TOTAL :inline :offset-assert 0) (warp-chain mercneric-chain :inline :offset-assert 2352) @@ -61,6 +65,7 @@ :flag-assert #x900000944 ) + (deftype foreground-regs (structure) ((dist float :offset-assert 0) (merc-used uint32 :offset-assert 4) @@ -82,6 +87,7 @@ :flag-assert #x900000038 ) + (deftype foreground-work (structure) ((regs foreground-regs :inline :offset-assert 0) (draw-index-map uint8 LEVEL_TOTAL :offset 64) @@ -97,6 +103,8 @@ ) +;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin a0, 0] +;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin a0, 1] (defun invalidate-cache-line ((arg0 pointer)) ; (.sync.l) ; (.cache dxwbin arg0 0) @@ -115,6 +123,7 @@ :flag-assert #x900000084 ) + (deftype merc-effect-bucket-info (structure) ((color-fade rgba :offset-assert 0) (alpha uint8 :offset 3) @@ -129,6 +138,7 @@ :flag-assert #x900000008 ) + (deftype merc-bucket-info (structure) ((light vu-lights :inline :offset-assert 0) (needs-clip int32 :offset-assert 112) @@ -141,6 +151,7 @@ :flag-assert #x90000027c ) + (deftype foreground-globals (structure) ((foreground-grid foreground-bucket-grid :inline :offset-assert 0) (merc-bucket-info merc-bucket-info :inline :offset-assert 2384) @@ -151,9 +162,9 @@ :flag-assert #x900000c54 ) + (define *foreground* (new 'global 'foreground-globals)) -;; definition of type shadow-dma-packet (deftype shadow-dma-packet (structure) ((tag generic-merc-tag :inline :offset-assert 0) (settings shadow-settings :inline :offset-assert 16) diff --git a/goal_src/jak2/engine/gfx/foreground/lightning-h.gc b/goal_src/jak2/engine/gfx/foreground/lightning-h.gc index 72ef443b93..5c35d2c90a 100644 --- a/goal_src/jak2/engine/gfx/foreground/lightning-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/lightning-h.gc @@ -118,30 +118,30 @@ ) -(defmethod change-mode lightning-control ((obj lightning-control) (arg0 lightning-mode)) - (let ((v1-1 (!= arg0 (-> obj state mode)))) +(defmethod change-mode lightning-control ((this lightning-control) (arg0 lightning-mode)) + (let ((v1-1 (!= arg0 (-> this state mode)))) (case arg0 (((lightning-mode lm3)) (if v1-1 - (set! (-> obj state counter) 0.0) + (set! (-> this state counter) 0.0) ) ) (((lightning-mode lm1)) - (set! (-> obj state start-color) (-> obj spec start-color)) - (set! (-> obj state end-color) (-> obj spec end-color)) + (set! (-> this state start-color) (-> this spec start-color)) + (set! (-> this state end-color) (-> this spec end-color)) ) ) ) - (set! (-> obj state mode) arg0) + (set! (-> this state mode) arg0) arg0 ) -(defmethod get-mode lightning-control ((obj lightning-control)) - (-> obj state mode) +(defmethod get-mode lightning-control ((this lightning-control)) + (-> this state mode) ) -(defmethod set-point! lightning-control ((obj lightning-control) (arg0 int) (arg1 vector)) - (let ((v1-0 (-> obj state))) +(defmethod set-point! lightning-control ((this lightning-control) (arg0 int) (arg1 vector)) + (let ((v1-0 (-> this state))) (when (and (-> v1-0 path) (>= arg0 0) (< arg0 (-> v1-0 path length))) (set! (-> v1-0 path data arg0 quad) (-> arg1 quad)) (when (and (< (+ (-> v1-0 points-to-draw) -1) arg0) (case (-> v1-0 mode) @@ -163,40 +163,40 @@ ) ;; WARN: Return type mismatch (inline-array vector) vs none. -(defmethod set-first-meet-point lightning-control ((obj lightning-control) (arg0 vector)) - (set! (-> obj state meet data 0 quad) (-> arg0 quad)) +(defmethod set-first-meet-point lightning-control ((this lightning-control) (arg0 vector)) + (set! (-> this state meet data 0 quad) (-> arg0 quad)) (none) ) ;; WARN: Return type mismatch vector vs none. -(defmethod set-last-meet-point lightning-control ((obj lightning-control) (arg0 vector)) - (set! (-> obj state meet data (+ (-> obj state points-to-draw) -1) quad) (-> arg0 quad)) +(defmethod set-last-meet-point lightning-control ((this lightning-control) (arg0 vector)) + (set! (-> this state meet data (+ (-> this state points-to-draw) -1) quad) (-> arg0 quad)) (none) ) -(defmethod relocate lightning-control ((obj lightning-control) (arg0 int)) - (&+! (-> obj state line) arg0) - (&+! (-> obj state meet) arg0) - (if (-> obj state path) - (&+! (-> obj state path) arg0) +(defmethod relocate lightning-control ((this lightning-control) (arg0 int)) + (&+! (-> this state line) arg0) + (&+! (-> this state meet) arg0) + (if (-> this state path) + (&+! (-> this state path) arg0) ) - (let ((v1-8 (-> obj spec))) + (let ((v1-8 (-> this spec))) (if (and (>= (the-as int v1-8) (-> *kernel-context* relocating-min)) (< (the-as int v1-8) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj spec) arg0) + (&+! (-> this spec) arg0) ) ) - obj + this ) ;; WARN: Return type mismatch object vs lightning-control. (defmethod new lightning-control ((allocation symbol) (type-to-make type) (arg0 lightning-spec) (arg1 process) (arg2 float)) (with-pp - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (when (zero? obj) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? this) (go process-drawable-art-error "memory") - (set! obj (the-as lightning-control 0)) + (set! this (the-as lightning-control 0)) (goto cfg-14) ) (let ((s3-0 (-> arg0 num-points))) @@ -207,28 +207,28 @@ (set! f0-0 (* f0-0 f1-1)) ) ) - (set! (-> obj state box-size) f0-0) + (set! (-> this state box-size) f0-0) ) - (set! (-> obj process) (process->ppointer arg1)) - (set! (-> obj state mode) (lightning-mode lm1)) - (set! (-> obj state line) ((method-of-type vector-array new) allocation vector-array s3-0)) - (set! (-> obj state meet) ((method-of-type vector-array new) allocation vector-array s3-0)) + (set! (-> this process) (process->ppointer arg1)) + (set! (-> this state mode) (lightning-mode lm1)) + (set! (-> this state line) ((method-of-type vector-array new) allocation vector-array s3-0)) + (set! (-> this state meet) ((method-of-type vector-array new) allocation vector-array s3-0)) (let ((v1-18 (-> arg0 rand-func))) - (set! (-> obj state path) (if (or (= v1-18 2) (= v1-18 3)) - ((method-of-type vector-array new) allocation vector-array s3-0) - (the-as vector-array #f) - ) + (set! (-> this state path) (if (or (= v1-18 2) (= v1-18 3)) + ((method-of-type vector-array new) allocation vector-array s3-0) + (the-as vector-array #f) + ) ) ) - (set! (-> obj state counter) 0.0) - (set! (-> obj state points-to-draw) s3-0) + (set! (-> this state counter) 0.0) + (set! (-> this state points-to-draw) s3-0) ) - (set! (-> obj spec) arg0) - (set! (-> obj state start-color) (-> arg0 start-color)) - (set! (-> obj state end-color) (-> arg0 end-color)) - (add-connection *lightning-engine* pp nothing obj #f #f) + (set! (-> this spec) arg0) + (set! (-> this state start-color) (-> arg0 start-color)) + (set! (-> this state end-color) (-> arg0 end-color)) + (add-connection *lightning-engine* pp nothing this #f #f) (label cfg-14) - (the-as lightning-control obj) + (the-as lightning-control this) ) ) ) diff --git a/goal_src/jak2/engine/gfx/foreground/lights-h.gc b/goal_src/jak2/engine/gfx/foreground/lights-h.gc index 215ace726b..39607cdf74 100644 --- a/goal_src/jak2/engine/gfx/foreground/lights-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/lights-h.gc @@ -23,11 +23,11 @@ ;; Note that the data is transposed to be faster for use in the VU code. ;; the w components are unused for lighting information - you can put whatever you want in them... (deftype vu-lights (structure) - ((direction vector 3 :inline :offset-assert 0) - (color vector 3 :inline :offset-assert 48) - (ambient vector :inline :offset-assert 96) - (fade-int uint32 :offset 44) - (fade-flags uint32 :offset 28) + ((direction vector 3 :inline :offset-assert 0) + (color vector 3 :inline :offset-assert 48) + (ambient vector :inline :offset-assert 96) + (fade-int uint32 :offset 44) + (fade-flags uint32 :offset 28) ) :method-count-assert 9 :size-assert #x70 @@ -71,8 +71,8 @@ ;; hash bucket for fast "which light am I in?" checks. (deftype light-hash-bucket (structure) - ((index uint16 :offset-assert 0) - (count uint16 :offset-assert 2) + ((index uint16 :offset-assert 0) + (count uint16 :offset-assert 2) ) :pack-me :method-count-assert 9 @@ -80,23 +80,25 @@ :flag-assert #x900000004 ) + (deftype light-hash (basic) - ((num-lights uint16 :offset-assert 4) - (num-indices uint16 :offset-assert 6) - (num-buckets uint16 :offset-assert 8) - (bucket-step uint8 2 :offset-assert 10) - (base-trans vector :inline :offset-assert 16) - (axis-scale vector :inline :offset-assert 32) - (dimension-array vector4w :inline :offset-assert 48) - (bucket-array (inline-array light-hash-bucket) :offset-assert 64) - (index-array pointer :offset-assert 68) - (light-sphere-array (inline-array light-sphere) :offset-assert 72) + ((num-lights uint16 :offset-assert 4) + (num-indices uint16 :offset-assert 6) + (num-buckets uint16 :offset-assert 8) + (bucket-step uint8 2 :offset-assert 10) + (base-trans vector :inline :offset-assert 16) + (axis-scale vector :inline :offset-assert 32) + (dimension-array vector4w :inline :offset-assert 48) + (bucket-array (inline-array light-hash-bucket) :offset-assert 64) + (index-array pointer :offset-assert 68) + (light-sphere-array (inline-array light-sphere) :offset-assert 72) ) :method-count-assert 9 :size-assert #x4c :flag-assert #x90000004c ) + (deftype light-hash-work (structure) ((ones vector4w :inline :offset-assert 0) ) @@ -105,22 +107,22 @@ :flag-assert #x900000010 ) + (define *light-hash* (the-as light-hash #f)) -(defmethod print light ((obj light)) +(defmethod print light ((this light)) (format #t "# obj extra x) - (-> obj direction x) - (-> obj direction y) - (-> obj direction z) + (-> this extra x) + (-> this direction x) + (-> this direction y) + (-> this direction z) ) - (format #t "~F ~F ~F @ #x~X>" (-> obj color x) (-> obj color y) (-> obj color z) obj) - obj + (format #t "~F ~F ~F @ #x~X>" (-> this color x) (-> this color y) (-> this color z) this) + this ) -;; jak1-style 3x directional + ambient lighting. (deftype light-group (structure) ((dir0 light :inline :offset-assert 0) (dir1 light :inline :offset-assert 48) diff --git a/goal_src/jak2/engine/gfx/foreground/merc/merc-h.gc b/goal_src/jak2/engine/gfx/foreground/merc/merc-h.gc index 3d6170ec76..dd1f8c2ab9 100644 --- a/goal_src/jak2/engine/gfx/foreground/merc/merc-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/merc/merc-h.gc @@ -162,10 +162,10 @@ (deftype mei-envmap-tint (structure) - ((fade0 float :offset-assert 0) - (fade1 float :offset-assert 4) - (tint rgba :offset-assert 8) - (dummy int32 :offset-assert 12) + ((fade0 float :offset-assert 0) + (fade1 float :offset-assert 4) + (tint rgba :offset-assert 8) + (dummy int32 :offset-assert 12) ) :method-count-assert 9 :size-assert #x10 diff --git a/goal_src/jak2/engine/gfx/foreground/merc/merc.gc b/goal_src/jak2/engine/gfx/foreground/merc/merc.gc index 5268832279..f6b0f6e0c7 100644 --- a/goal_src/jak2/engine/gfx/foreground/merc/merc.gc +++ b/goal_src/jak2/engine/gfx/foreground/merc/merc.gc @@ -24,13 +24,13 @@ (define *texture-login-data* (new 'global 'texture-login-data)) -(defmethod login art-joint-geo ((obj art-joint-geo)) +(defmethod login art-joint-geo ((this art-joint-geo)) (let ((s5-0 *texture-login-data*)) (set! (-> s5-0 default-texture-index) - (res-lump-value (-> obj extra) 'texture-bucket int :default (the-as uint128 1) :time -1000000000.0) + (res-lump-value (-> this extra) 'texture-bucket int :default (the-as uint128 1) :time -1000000000.0) ) ) - obj + this ) (defun texture-usage-init ((arg0 merc-ctrl)) @@ -84,12 +84,12 @@ #f ) -(defmethod asize-of merc-fragment ((obj merc-fragment)) - (the-as int (* (-> obj header mm-quadword-size) 16)) +(defmethod asize-of merc-fragment ((this merc-fragment)) + (the-as int (* (-> this header mm-quadword-size) 16)) ) -(defmethod login-adgifs merc-fragment ((obj merc-fragment)) - (let* ((s5-0 (merc-fragment-fp-data obj)) +(defmethod login-adgifs merc-fragment ((this merc-fragment)) + (let* ((s5-0 (merc-fragment-fp-data this)) (v1-1 (-> *texture-login-data* merc-ctrl-header)) (s4-0 (if (nonzero? (-> v1-1 eye-ctrl)) (-> v1-1 eye-ctrl) @@ -187,26 +187,26 @@ (&+! s3-0 80) ) ) - obj + this ) -(defmethod asize-of merc-fragment-control ((obj merc-fragment-control)) - (the-as int (+ (* (-> obj mat-xfer-count) 2) 4)) +(defmethod asize-of merc-fragment-control ((this merc-fragment-control)) + (the-as int (+ (* (-> this mat-xfer-count) 2) 4)) ) -(defmethod login-adgifs merc-effect ((obj merc-effect)) +(defmethod login-adgifs merc-effect ((this merc-effect)) (let* ((data *texture-login-data*) (a0-1 (-> data default-texture-index)) ) - (when (= (-> obj merc-effect-version) 1) - (if (!= (-> obj texture-index) 255) - (set! a0-1 (the-as int (-> obj texture-index))) + (when (= (-> this merc-effect-version) 1) + (if (!= (-> this texture-index) 255) + (set! a0-1 (the-as int (-> this texture-index))) ) ) (set! (-> data current-texture-index) a0-1) - (set! (-> obj texture-index) (the-as uint a0-1)) + (set! (-> this texture-index) (the-as uint a0-1)) ) - (let ((tex (-> obj extra-info))) + (let ((tex (-> this extra-info))) (when (nonzero? tex) (when (nonzero? (-> tex shader-offset)) (let ((a0-6 (adgif-shader-login (the-as adgif-shader (+ (the-as uint tex) (* (-> tex shader-offset) 16)))))) @@ -217,10 +217,10 @@ ) ) ) - (let ((ctrl (-> obj frag-ctrl)) - (geo (-> obj frag-geo)) + (let ((ctrl (-> this frag-ctrl)) + (geo (-> this frag-geo)) ) - (dotimes (frag-idx (the-as int (-> obj frag-count))) + (dotimes (frag-idx (the-as int (-> this frag-count))) (let ((ctrl-size (asize-of ctrl))) (let ((geo-size (asize-of geo))) (login-adgifs geo) @@ -234,14 +234,14 @@ ) -(defmethod mem-usage merc-ctrl ((obj merc-ctrl) (arg0 memory-usage-block) (arg1 int)) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 arg1) +(defmethod mem-usage merc-ctrl ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 arg1) ) - (let ((s4-0 (+ 32 128 (* (-> obj header effect-count) 32)))) - (dotimes (s3-0 (the-as int (-> obj header effect-count))) - (let ((s2-0 (the-as object (-> obj effect s3-0 frag-ctrl)))) - (dotimes (s1-0 (the-as int (-> obj effect s3-0 frag-count))) + (let ((s4-0 (+ 32 128 (* (-> this header effect-count) 32)))) + (dotimes (s3-0 (the-as int (-> this header effect-count))) + (let ((s2-0 (the-as object (-> this effect s3-0 frag-ctrl)))) + (dotimes (s1-0 (the-as int (-> this effect s3-0 frag-count))) (set! s4-0 (+ s4-0 (* (shr (+ (-> (the-as merc-fragment-control s2-0) unsigned-four-count) 3) 2) 16) (* (shr (+ (-> (the-as merc-fragment-control s2-0) lump-four-count) 3) 2) 16) @@ -260,10 +260,10 @@ (+! (-> arg0 data 78 total) (logand -16 (+ s4-0 15))) ) (let ((v1-35 0)) - (dotimes (a0-15 (the-as int (-> obj header effect-count))) - (when (nonzero? (-> obj effect a0-15 blend-frag-count)) - (let ((a1-9 (the-as object (-> obj effect a0-15 blend-ctrl)))) - (dotimes (a2-1 (the-as int (-> obj effect a0-15 blend-frag-count))) + (dotimes (a0-15 (the-as int (-> this header effect-count))) + (when (nonzero? (-> this effect a0-15 blend-frag-count)) + (let ((a1-9 (the-as object (-> this effect a0-15 blend-ctrl)))) + (dotimes (a2-1 (the-as int (-> this effect a0-15 blend-frag-count))) (let ((v1-36 (+ v1-35 (* (+ (-> (the-as merc-blend-ctrl a1-9) nonzero-index-count) 1) @@ -272,9 +272,9 @@ ) ) ) - (set! v1-35 (the-as int (+ (-> obj header blend-target-count) 2 v1-36))) + (set! v1-35 (the-as int (+ (-> this header blend-target-count) 2 v1-36))) ) - (set! a1-9 (&+ (the-as pointer a1-9) (+ (-> obj header blend-target-count) 2))) + (set! a1-9 (&+ (the-as pointer a1-9) (+ (-> this header blend-target-count) 2))) ) ) ) @@ -287,8 +287,8 @@ (+! (-> arg0 data 80 total) (logand -16 (+ v1-35 15))) ) ) - (when (and (-> obj header eye-ctrl) (nonzero? (-> obj header eye-ctrl))) - (let ((a0-29 (-> obj header eye-ctrl))) + (when (and (-> this header eye-ctrl) (nonzero? (-> this header eye-ctrl))) + (let ((a0-29 (-> this header eye-ctrl))) (set! (-> arg0 length) (max 112 (-> arg0 length))) (set! (-> arg0 data 111 name) "eye-anim") (+! (-> arg0 data 111 count) 1) @@ -298,17 +298,17 @@ ) ) ) - obj + this ) -(defmethod login merc-ctrl ((obj merc-ctrl)) - (set! (-> *kernel-context* login-object) obj) - (texture-usage-init obj) - (dotimes (s5-0 (the-as int (-> obj header effect-count))) - (login-adgifs (-> obj effect s5-0)) +(defmethod login merc-ctrl ((this merc-ctrl)) + (set! (-> *kernel-context* login-object) this) + (texture-usage-init this) + (dotimes (s5-0 (the-as int (-> this header effect-count))) + (login-adgifs (-> this effect s5-0)) ) - (when (and (-> obj header eye-ctrl) (nonzero? (-> obj header eye-ctrl))) - (let ((s5-1 (-> obj header eye-ctrl))) + (when (and (-> this header eye-ctrl) (nonzero? (-> this header eye-ctrl))) + (let ((s5-1 (-> this header eye-ctrl))) (dotimes (s4-0 (-> s5-1 shader-count)) (let ((a0-5 (adgif-shader-login (-> s5-1 shader s4-0)))) (if a0-5 @@ -319,7 +319,7 @@ ) ) (set! (-> *kernel-context* login-object) #f) - obj + this ) (defun-debug merc-stats-display ((arg0 merc-ctrl)) diff --git a/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc b/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc index 5f32373f3c..d87a480ffd 100644 --- a/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc +++ b/goal_src/jak2/engine/gfx/foreground/shadow-cpu.gc @@ -11,19 +11,19 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of shadow-geo ((obj shadow-geo)) - (the-as int (* (-> obj total-qwc) 16)) +(defmethod asize-of shadow-geo ((this shadow-geo)) + (the-as int (* (-> this total-qwc) 16)) ) -(defmethod mem-usage shadow-geo ((obj shadow-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage shadow-geo ((this shadow-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 111 (-> arg0 length))) (set! (-> arg0 data 110 name) "shadow-geo") (+! (-> arg0 data 110 count) 1) - (let ((v1-6 (* (-> obj total-qwc) 16))) + (let ((v1-6 (* (-> this total-qwc) 16))) (+! (-> arg0 data 110 used) v1-6) (+! (-> arg0 data 110 total) (logand -16 (+ v1-6 15))) ) - obj + this ) (define *shadow-data* (new 'static 'shadow-data @@ -566,8 +566,8 @@ (def-mips2c shadow-add-double-edges function) -(defmethod shadow-control-method-14 shadow-control ((obj shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float)) - (let ((gp-0 (-> obj settings))) +(defmethod shadow-control-method-14 shadow-control ((this shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float)) + (let ((gp-0 (-> this settings))) (let ((s4-0 (-> gp-0 shadow-dir))) (vector-normalize-copy! s4-0 arg1 1.0) (set! (-> gp-0 shadow-dir w) (- arg2)) @@ -790,7 +790,7 @@ (none) ) -(defmethod shadow-control-method-13 shadow-control ((obj shadow-control) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod shadow-control-method-13 shadow-control ((this shadow-control) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (with-pp (let ((s4-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 pp)) @@ -808,19 +808,19 @@ ) (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* s4-0) 0.0) - (let ((v1-5 obj)) + (let ((v1-5 this)) (logclear! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((v1-7 obj)) + (let ((v1-7 this)) (set! (-> v1-7 settings bot-plane w) (- (+ (-> s4-0 best-other-tri intersect y) arg1))) ) 0 - (set! (-> obj settings top-plane w) (- (+ (-> s4-0 best-other-tri intersect y) arg2))) + (set! (-> this settings top-plane w) (- (+ (-> s4-0 best-other-tri intersect y) arg2))) 0 ) (else - (let ((v1-10 obj)) + (let ((v1-10 this)) (logior! (-> v1-10 settings flags) (shadow-flags disable-draw)) ) 0 diff --git a/goal_src/jak2/engine/gfx/foreground/shadow-vu1.gc b/goal_src/jak2/engine/gfx/foreground/shadow-vu1.gc index 1aef8b8a7a..da1b681bf7 100644 --- a/goal_src/jak2/engine/gfx/foreground/shadow-vu1.gc +++ b/goal_src/jak2/engine/gfx/foreground/shadow-vu1.gc @@ -28,14 +28,14 @@ (deftype shadow-vu1-data (structure) - ((adgif gs-gif-tag :inline :offset-assert 0) - (ad gs-adcmd :inline :offset-assert 16) - (flush gs-adcmd :inline :offset-assert 32) - (trigif gs-gif-tag :inline :offset-assert 48) - (quadgif gs-gif-tag :inline :offset-assert 64) - (texoffset vector :inline :offset-assert 80) - (texscale vector :inline :offset-assert 96) - (clrs qword 2 :inline :offset-assert 112) + ((adgif gs-gif-tag :inline :offset-assert 0) + (ad gs-adcmd :inline :offset-assert 16) + (flush gs-adcmd :inline :offset-assert 32) + (trigif gs-gif-tag :inline :offset-assert 48) + (quadgif gs-gif-tag :inline :offset-assert 64) + (texoffset vector :inline :offset-assert 80) + (texscale vector :inline :offset-assert 96) + (clrs qword 2 :inline :offset-assert 112) ) :method-count-assert 9 :size-assert #x90 diff --git a/goal_src/jak2/engine/gfx/hw/display.gc b/goal_src/jak2/engine/gfx/hw/display.gc index 810a08110b..c29f0c2242 100644 --- a/goal_src/jak2/engine/gfx/hw/display.gc +++ b/goal_src/jak2/engine/gfx/hw/display.gc @@ -22,27 +22,27 @@ (-> *display* base-clock integral-frame-counter) ) -(defmethod set-time-ratios display ((obj display) (arg0 float)) +(defmethod set-time-ratios display ((this display) (arg0 float)) "Set the 'dog ratio'. This should be 1 when the game is running at full speed. Larger dog ratio means slower." ;; cap ratio if we're slower than 4x - (set! (-> obj dog-ratio) (fmin 4.0 arg0)) + (set! (-> this dog-ratio) (fmin 4.0 arg0)) ;; set the time per vsync. (case (get-video-mode) (('pal) - (set! (-> obj time-factor) 6.0) + (set! (-> this time-factor) 6.0) ) ;; og:preserve-this added custom video mode for high fps (('custom) - (set! (-> obj time-factor) (/ 300.0 (-> *pc-settings* target-fps))) + (set! (-> this time-factor) (/ 300.0 (-> *pc-settings* target-fps))) ) (else - (set! (-> obj time-factor) 5.0) + (set! (-> this time-factor) 5.0) ) ) - (-> obj dog-ratio) + (-> this dog-ratio) ) (defun set-display ((arg0 display)) diff --git a/goal_src/jak2/engine/gfx/mood/mood.gc b/goal_src/jak2/engine/gfx/mood/mood.gc index 5cd2666617..cf82d01064 100644 --- a/goal_src/jak2/engine/gfx/mood/mood.gc +++ b/goal_src/jak2/engine/gfx/mood/mood.gc @@ -738,17 +738,17 @@ ) ) -(defmethod apply-mood-clouds-and-fog mood-control ((obj mood-control) (arg0 mood-control-work)) - (let ((v1-0 (-> obj mood-fog-table))) +(defmethod apply-mood-clouds-and-fog mood-control ((this mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> this mood-fog-table))) (dotimes (a0-1 24) (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) ) ) - (let ((s4-0 (-> obj mood-fog-table))) + (let ((s4-0 (-> this mood-fog-table))) (let ((f30-0 (- 1.0 (-> arg0 interp cloud)))) (when (!= f30-0 0.0) (let ((f0-4 (* (- 1.0 (-> arg0 interp fog)) f30-0)) - (a2-0 (-> obj fogs (-> arg0 index 0))) + (a2-0 (-> this fogs (-> arg0 index 0))) ) (if (!= f0-4 0.0) (vector4-array-madd! @@ -761,7 +761,7 @@ ) ) (let ((f0-6 (* (-> arg0 interp fog) f30-0)) - (a2-1 (-> obj fogs (-> arg0 index 1))) + (a2-1 (-> this fogs (-> arg0 index 1))) ) (if (!= f0-6 0.0) (vector4-array-madd! @@ -778,7 +778,7 @@ (let ((f30-1 (-> arg0 interp cloud))) (when (!= f30-1 0.0) (let ((f0-10 (* (- 1.0 (-> arg0 interp fog)) f30-1)) - (a2-2 (-> obj fogs (-> arg0 index 2))) + (a2-2 (-> this fogs (-> arg0 index 2))) ) (if (!= f0-10 0.0) (vector4-array-madd! @@ -791,7 +791,7 @@ ) ) (let ((f0-12 (* (-> arg0 interp fog) f30-1)) - (a2-3 (-> obj fogs (-> arg0 index 3))) + (a2-3 (-> this fogs (-> arg0 index 3))) ) (if (!= f0-12 0.0) (vector4-array-madd! @@ -807,7 +807,7 @@ ) ) (let ((f0-13 (-> *time-of-day-context* fog-mult)) - (v1-29 (-> obj mood-fog-table)) + (v1-29 (-> this mood-fog-table)) ) (dotimes (a0-6 8) (set! (-> v1-29 data a0-6 fog-dists y) (* (-> v1-29 data a0-6 fog-dists y) f0-13)) @@ -817,15 +817,15 @@ (none) ) -(defmethod apply-mood-color mood-control ((obj mood-control) (arg0 mood-control-work)) - (let ((v1-0 (-> obj mood-color-table))) +(defmethod apply-mood-color mood-control ((this mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> this mood-color-table))) (dotimes (a0-1 16) (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) ) ) - (let ((s4-0 (-> obj mood-color-table))) + (let ((s4-0 (-> this mood-color-table))) (let ((f0-1 (- 1.0 (-> arg0 color-interp))) - (a2-0 (-> obj colors (-> arg0 color-index 0))) + (a2-0 (-> this colors (-> arg0 color-index 0))) ) (if (!= f0-1 0.0) (vector4-array-madd! @@ -838,7 +838,7 @@ ) ) (let ((f0-2 (-> arg0 color-interp)) - (a2-1 (-> obj colors (-> arg0 color-index 1))) + (a2-1 (-> this colors (-> arg0 color-index 1))) ) (if (!= f0-2 0.0) (vector4-array-madd! @@ -855,15 +855,15 @@ (none) ) -(defmethod apply-mood-channels mood-control ((obj mood-control) (arg0 mood-control-work)) - (let ((v1-0 (-> obj mood-channel-group))) +(defmethod apply-mood-channels mood-control ((this mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> this mood-channel-group))) (dotimes (a0-1 24) (set! (-> v1-0 data 0 vecs a0-1 quad) (the-as uint128 0)) ) ) - (let ((s4-0 (-> obj mood-channel-group))) + (let ((s4-0 (-> this mood-channel-group))) (let ((f0-1 (- 1.0 (-> arg0 channel-interp))) - (a2-0 (-> obj channels (-> arg0 channel-index 0))) + (a2-0 (-> this channels (-> arg0 channel-index 0))) ) (if (!= f0-1 0.0) (vector4-array-madd! @@ -876,7 +876,7 @@ ) ) (let ((f0-2 (-> arg0 channel-interp)) - (a2-1 (-> obj channels (-> arg0 channel-index 1))) + (a2-1 (-> this channels (-> arg0 channel-index 1))) ) (if (!= f0-2 0.0) (vector4-array-madd! @@ -893,12 +893,12 @@ (none) ) -(defmethod adjust-num-clouds! mood-control ((obj mood-control) (arg0 mood-control-work)) - (let ((v1-0 (-> obj mood-clouds))) +(defmethod adjust-num-clouds! mood-control ((this mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> this mood-clouds))) (set! (-> v1-0 cloud-min) 0.0) (set! (-> v1-0 cloud-max) 0.0) (let ((f0-3 (- 1.0 (-> arg0 cloud-interp))) - (a2-4 (-> obj clouds (-> arg0 cloud-index 0))) + (a2-4 (-> this clouds (-> arg0 cloud-index 0))) ) (when (!= f0-3 0.0) (set! (-> v1-0 cloud-min) (* (-> a2-4 cloud-min) f0-3)) @@ -906,7 +906,7 @@ ) ) (let ((f0-5 (-> arg0 cloud-interp)) - (a0-2 (-> obj clouds (-> arg0 cloud-index 1))) + (a0-2 (-> this clouds (-> arg0 cloud-index 1))) ) (when (!= f0-5 0.0) (+! (-> v1-0 cloud-min) (* (-> a0-2 cloud-min) f0-5)) @@ -919,7 +919,7 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod play-or-stop-lightning! mood-control ((obj mood-control) (arg0 sound-spec) (arg1 vector)) +(defmethod play-or-stop-lightning! mood-control ((this mood-control) (arg0 sound-spec) (arg1 vector)) "Handles playing/stopping of the lightning sound - Plays the lightning sound if we are not loading and `lightning-id` is zero - Stops the lightning sound first if `lightning-id` is non-zero @@ -927,21 +927,21 @@ Returns the current value of `lightning-id`" (vector+! (new 'stack-no-clear 'vector) arg1 (math-camera-pos)) (the-as sound-id (cond ((or (load-in-progress? *level*) (movie?)) - (the-as sound-id (when (nonzero? (-> obj lightning-id)) - (sound-stop (-> obj lightning-id)) - (set! (-> obj lightning-id) (new 'static 'sound-id)) + (the-as sound-id (when (nonzero? (-> this lightning-id)) + (sound-stop (-> this lightning-id)) + (set! (-> this lightning-id) (new 'static 'sound-id)) (new 'static 'sound-id) ) ) ) (else - (when (nonzero? (-> obj lightning-id)) - (sound-stop (-> obj lightning-id)) - (set! (-> obj lightning-id) (new 'static 'sound-id)) + (when (nonzero? (-> this lightning-id)) + (sound-stop (-> this lightning-id)) + (set! (-> this lightning-id) (new 'static 'sound-id)) 0 ) (let ((lightning-sound-id (sound-play-by-spec arg0 (new-sound-id) arg1))) - (set! (-> obj lightning-id) lightning-sound-id) + (set! (-> this lightning-id) lightning-sound-id) lightning-sound-id ) ) @@ -949,17 +949,15 @@ Returns the current value of `lightning-id`" ) ) -;; definition for method 17 of type mood-control -;; INFO: Used lq/sq ;; WARN: disable def twice: 141. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gen-lightning-and-thunder! mood-control ((obj mood-control)) +(defmethod gen-lightning-and-thunder! mood-control ((this mood-control)) (local-vars (a1-1 (array float))) - (let ((v1-3 (-> obj mood-channel-group data (-> obj lightning-index) vecs)) - (a1-0 (-> obj lightning-val)) - (a0-4 (/ (-> obj lightning-time) 2)) - (f0-0 (-> obj lightning-time2)) + (let ((v1-3 (-> this mood-channel-group data (-> this lightning-index) vecs)) + (a1-0 (-> this lightning-val)) + (a0-4 (/ (-> this lightning-time) 2)) + (f0-0 (-> this lightning-time2)) ) - (set! (-> obj lightning-flash) 0.0) + (set! (-> this lightning-flash) 0.0) (cond ((>= 0.0 f0-0) (cond @@ -994,23 +992,23 @@ Returns the current value of `lightning-id`" (s5-0 (new 'stack-no-clear 'vector)) ) (cond - ((= (-> obj lightning-index) 4) - (set! (-> obj lightning-flash) f30-0) + ((= (-> this lightning-index) 4) + (set! (-> this lightning-flash) f30-0) ) - ((= (-> obj lightning-index) 5) - (set! (-> obj lightning-flash) f30-0) + ((= (-> this lightning-index) 5) + (set! (-> this lightning-flash) f30-0) (dotimes (s4-0 8) (set-vector! s5-0 255.0 255.0 255.0 128.0) (vector4-lerp! - (the-as vector (-> obj mood-fog-table data s4-0)) - (the-as vector (-> obj mood-fog-table data s4-0)) + (the-as vector (-> this mood-fog-table data s4-0)) + (the-as vector (-> this mood-fog-table data s4-0)) s5-0 f30-0 ) ) ) (else - (set! (-> obj lightning-flash) (* 1.9921875 f30-0)) + (set! (-> this lightning-flash) (* 1.9921875 f30-0)) (set-vector! (-> v1-3 0) 1.0 1.0 1.0 1.0) (set! (-> v1-3 1 quad) (-> v1-3 0 quad)) (set! (-> v1-3 2 quad) (-> v1-3 0 quad)) @@ -1021,61 +1019,61 @@ Returns the current value of `lightning-id`" ) ) (when (not (paused?)) - (let ((v0-2 (the-as number (+ (-> obj lightning-time) 1)))) - (set! (-> obj lightning-time) (the-as int v0-2)) + (let ((v0-2 (the-as number (+ (-> this lightning-time) 1)))) + (set! (-> this lightning-time) (the-as int v0-2)) v0-2 ) ) ) ((and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) name) 'nest)) - (set! (-> obj lightning-time2) (rand-vu-float-range 3.0 5.0)) + (set! (-> this lightning-time2) (rand-vu-float-range 3.0 5.0)) ) (else - (set! (-> obj lightning-time2) (rand-vu-float-range 15.0 20.0)) + (set! (-> this lightning-time2) (rand-vu-float-range 15.0 20.0)) ) ) ) (else (when (not (paused?)) - (set! (-> obj lightning-time2) (- (-> obj lightning-time2) (seconds-per-frame))) - (when (>= 0.0 (-> obj lightning-time2)) - (set! (-> obj lightning-index) (mod (the-as int (rand-uint31-gen *random-generator*)) 6)) - (set! (-> obj lightning-val) (the-as int (logand (rand-uint31-gen *random-generator*) 7))) - (set! (-> obj lightning-time) 0) + (set! (-> this lightning-time2) (- (-> this lightning-time2) (seconds-per-frame))) + (when (>= 0.0 (-> this lightning-time2)) + (set! (-> this lightning-index) (mod (the-as int (rand-uint31-gen *random-generator*)) 6)) + (set! (-> this lightning-val) (the-as int (logand (rand-uint31-gen *random-generator*) 7))) + (set! (-> this lightning-time) 0) (cond - ((zero? (-> obj lightning-index)) + ((zero? (-> this lightning-index)) (play-or-stop-lightning! - obj + this (static-sound-spec "thunder-b") (new 'static 'vector :x 37109760.0 :y 16261120.0 :z 5857280.0) ) ) - ((= (-> obj lightning-index) 1) + ((= (-> this lightning-index) 1) (play-or-stop-lightning! - obj + this (static-sound-spec "thunder-b") (new 'static 'vector :x 20480000.0 :y 33341440.0 :z 12124160.0) ) ) - ((= (-> obj lightning-index) 2) + ((= (-> this lightning-index) 2) (play-or-stop-lightning! - obj + this (static-sound-spec "thunder-b") (new 'static 'vector :x -20480000.0 :y 33341440.0 :z 12124160.0) ) ) - ((= (-> obj lightning-index) 3) + ((= (-> this lightning-index) 3) (play-or-stop-lightning! - obj + this (static-sound-spec "thunder-b") (new 'static 'vector :x -37109760.0 :y 16261120.0 :z 5857280.0) ) ) - ((= (-> obj lightning-index) 4) - (play-or-stop-lightning! obj (static-sound-spec "thunder-c") (new 'static 'vector :y 40960000.0)) + ((= (-> this lightning-index) 4) + (play-or-stop-lightning! this (static-sound-spec "thunder-c") (new 'static 'vector :y 40960000.0)) ) - ((= (-> obj lightning-index) 5) - (play-or-stop-lightning! obj (static-sound-spec "thunder-a") (new 'static 'vector :y 40960000.0)) + ((= (-> this lightning-index) 5) + (play-or-stop-lightning! this (static-sound-spec "thunder-a") (new 'static 'vector :y 40960000.0)) ) ) ) @@ -1085,29 +1083,29 @@ Returns the current value of `lightning-id`" ) ) -(defmethod init-weather! mood-control ((obj mood-control)) +(defmethod init-weather! mood-control ((this mood-control)) (local-vars (v1-39 int)) (let ((s5-0 (level-get-target-inside *level*))) (when s5-0 (cond ((= (-> s5-0 info taskname) 'drill) - (mem-copy! (the-as pointer (-> obj mood-fog-table)) (the-as pointer *drill-mood-fog-table*) 384) - (mem-copy! (the-as pointer (-> obj mood-color-table)) (the-as pointer *drill-mood-color-table*) 256) - (set! (-> obj mood-direction-table) *drill-mood-direction-table*) - (set! (-> obj mood-clouds cloud-min) (-> *clouds-1000* cloud-min)) - (set! (-> obj mood-clouds cloud-max) (-> *clouds-1000* cloud-max)) + (mem-copy! (the-as pointer (-> this mood-fog-table)) (the-as pointer *drill-mood-fog-table*) 384) + (mem-copy! (the-as pointer (-> this mood-color-table)) (the-as pointer *drill-mood-color-table*) 256) + (set! (-> this mood-direction-table) *drill-mood-direction-table*) + (set! (-> this mood-clouds cloud-min) (-> *clouds-1000* cloud-min)) + (set! (-> this mood-clouds cloud-max) (-> *clouds-1000* cloud-max)) ) (else - (set! (-> obj mood-direction-table) *mood-direction-table*) + (set! (-> this mood-direction-table) *mood-direction-table*) (let ((s4-0 (new 'stack-no-clear 'mood-control-work))) (cond - ((and (-> obj overide-weather-flag) (not (movie?))) - (set! (-> s4-0 weather cloud) (* 2.0 (fmax 0.0 (fmin 1.0 (-> obj overide cloud))))) - (set! (-> s4-0 weather fog) (* 2.0 (-> obj overide fog))) + ((and (-> this overide-weather-flag) (not (movie?))) + (set! (-> s4-0 weather cloud) (* 2.0 (fmax 0.0 (fmin 1.0 (-> this overide cloud))))) + (set! (-> s4-0 weather fog) (* 2.0 (-> this overide fog))) ) (else - (set! (-> s4-0 weather cloud) (* 2.0 (fmax 0.0 (fmin 1.0 (-> obj current-interp cloud))))) - (set! (-> s4-0 weather fog) (* 2.0 (fmax 0.0 (fmin 1.0 (-> obj current-interp fog))))) + (set! (-> s4-0 weather cloud) (* 2.0 (fmax 0.0 (fmin 1.0 (-> this current-interp cloud))))) + (set! (-> s4-0 weather fog) (* 2.0 (fmax 0.0 (fmin 1.0 (-> this current-interp fog))))) ) ) (set! (-> s4-0 iweather cloud) (the int (-> s4-0 weather cloud))) @@ -1162,9 +1160,9 @@ Returns the current value of `lightning-id`" ) (set! (-> s4-0 channel-index 0) v1-39) (set! (-> s4-0 channel-index 1) (+ v1-39 1)) - (let* ((f0-33 (if (and (-> obj overide-weather-flag) (not (movie?))) - (* 8.0 (-> obj overide cloud)) - (* 8.0 (fmax 0.0 (fmin 1.0 (-> obj current-interp cloud)))) + (let* ((f0-33 (if (and (-> this overide-weather-flag) (not (movie?))) + (* 8.0 (-> this overide cloud)) + (* 8.0 (fmax 0.0 (fmin 1.0 (-> this current-interp cloud)))) ) ) (v1-52 (the int f0-33)) @@ -1173,88 +1171,88 @@ Returns the current value of `lightning-id`" (set! (-> s4-0 cloud-index 0) v1-52) (set! (-> s4-0 cloud-index 1) (+ v1-52 1)) ) - (apply-mood-clouds-and-fog obj s4-0) - (apply-mood-color obj s4-0) - (apply-mood-channels obj s4-0) - (adjust-num-clouds! obj s4-0) + (apply-mood-clouds-and-fog this s4-0) + (apply-mood-color this s4-0) + (apply-mood-channels this s4-0) + (adjust-num-clouds! this s4-0) ) - (when (not (or (paused?) (and (-> obj overide-weather-flag) (not (movie?))))) - (set! (-> obj target-interp cloud) - (fmax (fmin (-> obj target-interp cloud) (-> obj range max-cloud)) (-> obj range min-cloud)) + (when (not (or (paused?) (and (-> this overide-weather-flag) (not (movie?))))) + (set! (-> this target-interp cloud) + (fmax (fmin (-> this target-interp cloud) (-> this range max-cloud)) (-> this range min-cloud)) ) - (set! (-> obj target-interp fog) - (fmax (fmin (-> obj target-interp fog) (-> obj range max-fog)) (-> obj range min-fog)) + (set! (-> this target-interp fog) + (fmax (fmin (-> this target-interp fog) (-> this range max-fog)) (-> this range min-fog)) ) (seek! - (-> obj current-interp cloud) - (-> obj target-interp cloud) - (* (/ 1.0 (-> obj speed-interp cloud)) (seconds-per-frame)) + (-> this current-interp cloud) + (-> this target-interp cloud) + (* (/ 1.0 (-> this speed-interp cloud)) (seconds-per-frame)) ) (seek! - (-> obj current-interp fog) - (-> obj target-interp fog) - (* (/ 1.0 (-> obj speed-interp fog)) (seconds-per-frame)) + (-> this current-interp fog) + (-> this target-interp fog) + (* (/ 1.0 (-> this speed-interp fog)) (seconds-per-frame)) ) - (when (!= (-> obj time-until-random cloud) -99.0) - (set! (-> obj time-until-random cloud) (- (-> obj time-until-random cloud) (* 300.0 (seconds-per-frame)))) - (when (< (-> obj time-until-random cloud) 0.0) - (set! (-> obj time-until-random cloud) - (rand-vu-float-range (-> obj time-until-random-min cloud) (-> obj time-until-random-max cloud)) + (when (!= (-> this time-until-random cloud) -99.0) + (set! (-> this time-until-random cloud) (- (-> this time-until-random cloud) (* 300.0 (seconds-per-frame)))) + (when (< (-> this time-until-random cloud) 0.0) + (set! (-> this time-until-random cloud) + (rand-vu-float-range (-> this time-until-random-min cloud) (-> this time-until-random-max cloud)) ) - (let ((f30-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) - (f28-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) - (f26-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) - (f24-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) - (f1-36 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) + (let ((f30-0 (rand-vu-float-range (-> this range min-cloud) (-> this range max-cloud))) + (f28-0 (rand-vu-float-range (-> this range min-cloud) (-> this range max-cloud))) + (f26-0 (rand-vu-float-range (-> this range min-cloud) (-> this range max-cloud))) + (f24-0 (rand-vu-float-range (-> this range min-cloud) (-> this range max-cloud))) + (f1-36 (rand-vu-float-range (-> this range min-cloud) (-> this range max-cloud))) ) - (set! (-> obj target-interp cloud) (fabs (+ -0.25 (* 0.25 (+ f30-0 f28-0 f26-0 f24-0 f1-36))))) + (set! (-> this target-interp cloud) (fabs (+ -0.25 (* 0.25 (+ f30-0 f28-0 f26-0 f24-0 f1-36))))) ) - (set! (-> obj speed-interp cloud) (rand-vu-float-range 30.0 120.0)) + (set! (-> this speed-interp cloud) (rand-vu-float-range 30.0 120.0)) (when (and (< 0.0 (-> *setting-control* user-current rain)) - (< (-> obj target-interp cloud) 0.5) - (< 0.25 (-> obj target-interp cloud)) - (or (< (-> obj target-interp fog) 0.25) (< 0.75 (-> obj target-interp fog))) + (< (-> this target-interp cloud) 0.5) + (< 0.25 (-> this target-interp cloud)) + (or (< (-> this target-interp fog) 0.25) (< 0.75 (-> this target-interp fog))) ) - (set! (-> obj speed-interp fog) + (set! (-> this speed-interp fog) (fabs - (/ (* 1.25 (-> obj current-interp fog) (-> obj speed-interp cloud)) (+ -0.75 (-> obj current-interp cloud))) + (/ (* 1.25 (-> this current-interp fog) (-> this speed-interp cloud)) (+ -0.75 (-> this current-interp cloud))) ) ) - (set! (-> obj target-interp fog) 0.5) - (set! (-> obj time-until-random fog) (-> obj time-until-random cloud)) + (set! (-> this target-interp fog) 0.5) + (set! (-> this time-until-random fog) (-> this time-until-random cloud)) ) ) ) - (when (!= (-> obj time-until-random fog) -99.0) - (set! (-> obj time-until-random fog) (- (-> obj time-until-random fog) (* 300.0 (seconds-per-frame)))) - (when (< (-> obj time-until-random fog) 0.0) - (set! (-> obj time-until-random fog) - (rand-vu-float-range (-> obj time-until-random-min fog) (-> obj time-until-random-max fog)) + (when (!= (-> this time-until-random fog) -99.0) + (set! (-> this time-until-random fog) (- (-> this time-until-random fog) (* 300.0 (seconds-per-frame)))) + (when (< (-> this time-until-random fog) 0.0) + (set! (-> this time-until-random fog) + (rand-vu-float-range (-> this time-until-random-min fog) (-> this time-until-random-max fog)) ) - (let ((f30-1 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) - (f28-1 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) - (f26-1 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) - (f1-52 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) + (let ((f30-1 (rand-vu-float-range (-> this range min-fog) (-> this range max-fog))) + (f28-1 (rand-vu-float-range (-> this range min-fog) (-> this range max-fog))) + (f26-1 (rand-vu-float-range (-> this range min-fog) (-> this range max-fog))) + (f1-52 (rand-vu-float-range (-> this range min-fog) (-> this range max-fog))) ) - (set! (-> obj target-interp fog) (fabs (+ -1.0 (* 0.5 (+ f30-1 f28-1 f26-1 f1-52))))) + (set! (-> this target-interp fog) (fabs (+ -1.0 (* 0.5 (+ f30-1 f28-1 f26-1 f1-52))))) ) - (set! (-> obj speed-interp fog) (rand-vu-float-range 30.0 120.0)) + (set! (-> this speed-interp fog) (rand-vu-float-range 30.0 120.0)) ) ) ) - (let ((f30-2 (if (and (-> obj overide-weather-flag) (not (movie?))) - (-> obj overide cloud) - (-> obj current-interp cloud) + (let ((f30-2 (if (and (-> this overide-weather-flag) (not (movie?))) + (-> this overide cloud) + (-> this current-interp cloud) ) ) - (f26-2 (if (and (-> obj overide-weather-flag) (not (movie?))) - (-> obj overide fog) - (-> obj current-interp fog) + (f26-2 (if (and (-> this overide-weather-flag) (not (movie?))) + (-> this overide fog) + (-> this current-interp fog) ) ) (f28-2 (fmin (-> s5-0 info max-rain) (-> *time-of-day-context* max-rain))) ) - (set! (-> obj sound-pitch) (* 1.442695 (logf (-> *display* bg-clock clock-ratio)))) + (set! (-> this sound-pitch) (* 1.442695 (logf (-> *display* bg-clock clock-ratio)))) (let* ((f0-114 (fmax 0.0 (fmin (* 4.0 (fmax 0.0 (+ -0.5 f26-2)) (fmax 0.0 (+ -0.5 f30-2))) f28-2))) (f30-3 (fmin 0.75 f0-114)) ) @@ -1265,14 +1263,14 @@ Returns the current value of `lightning-id`" ) (!= *master-mode* 'progress) ) - (gen-lightning-and-thunder! obj) + (gen-lightning-and-thunder! this) (cond - ((zero? (-> obj rain-id)) - (set! (-> obj rain-id) (sound-play-by-name + ((zero? (-> this rain-id)) + (set! (-> this rain-id) (sound-play-by-name (static-sound-name "rain-hiss") (new-sound-id) (the int (* 1024.0 f30-3)) - (the int (* 1524.0 (-> obj sound-pitch))) + (the int (* 1524.0 (-> this sound-pitch))) 0 (sound-group sfx) #t @@ -1283,9 +1281,9 @@ Returns the current value of `lightning-id`" (when *sound-player-enable* (let ((v1-136 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-136 command) (sound-command set-param)) - (set! (-> v1-136 id) (-> obj rain-id)) + (set! (-> v1-136 id) (-> this rain-id)) (set! (-> v1-136 params volume) (the int (* 1024.0 f30-3))) - (set! (-> v1-136 params pitch-mod) (the int (* 1524.0 (-> obj sound-pitch)))) + (set! (-> v1-136 params pitch-mod) (the int (* 1524.0 (-> this sound-pitch)))) (set! (-> v1-136 params mask) (the-as uint 3)) (-> v1-136 id) ) @@ -1294,31 +1292,31 @@ Returns the current value of `lightning-id`" ) ) (else - (set! (-> obj lightning-flash) 0.0) - (when (nonzero? (-> obj rain-id)) - (sound-stop (-> obj rain-id)) - (set! (-> obj rain-id) (new 'static 'sound-id)) + (set! (-> this lightning-flash) 0.0) + (when (nonzero? (-> this rain-id)) + (sound-stop (-> this rain-id)) + (set! (-> this rain-id) (new 'static 'sound-id)) 0 ) ) ) ) ) - (when (-> obj display-flag) + (when (-> this display-flag) (cond - ((and (-> obj overide-weather-flag) (not (movie?))) - (format *stdcon* "overide cloud ~f~%" (-> obj overide cloud)) - (format *stdcon* "overide fog ~f~%" (-> obj overide fog)) + ((and (-> this overide-weather-flag) (not (movie?))) + (format *stdcon* "overide cloud ~f~%" (-> this overide cloud)) + (format *stdcon* "overide fog ~f~%" (-> this overide fog)) ) (else - (format *stdcon* "time until random cloud ~f~%" (* 0.0033333334 (-> obj time-until-random cloud))) - (format *stdcon* "current cloud ~f~%" (-> obj current-interp cloud)) - (format *stdcon* "target cloud ~f~%" (-> obj target-interp cloud)) - (format *stdcon* "speed cloud ~f~%" (* (/ 1.0 (-> obj speed-interp cloud)) (seconds-per-frame))) - (format *stdcon* "time until random fog ~f~%" (* 0.0033333334 (-> obj time-until-random fog))) - (format *stdcon* "current fog ~f~%" (-> obj current-interp fog)) - (format *stdcon* "target fog ~f~%" (-> obj target-interp fog)) - (format *stdcon* "speed fog ~f~%" (* (/ 1.0 (-> obj speed-interp fog)) (seconds-per-frame))) + (format *stdcon* "time until random cloud ~f~%" (* 0.0033333334 (-> this time-until-random cloud))) + (format *stdcon* "current cloud ~f~%" (-> this current-interp cloud)) + (format *stdcon* "target cloud ~f~%" (-> this target-interp cloud)) + (format *stdcon* "speed cloud ~f~%" (* (/ 1.0 (-> this speed-interp cloud)) (seconds-per-frame))) + (format *stdcon* "time until random fog ~f~%" (* 0.0033333334 (-> this time-until-random fog))) + (format *stdcon* "current fog ~f~%" (-> this current-interp fog)) + (format *stdcon* "target fog ~f~%" (-> this target-interp fog)) + (format *stdcon* "speed fog ~f~%" (* (/ 1.0 (-> this speed-interp fog)) (seconds-per-frame))) ) ) ) @@ -1330,40 +1328,40 @@ Returns the current value of `lightning-id`" (none) ) -(defmethod update-mood-weather! mood-control ((obj mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) +(defmethod update-mood-weather! mood-control ((this mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) "Set the `target-interp` and `speed-interp` for the clouds and fog If `*-speed` is 0.0, use the `*-target` args to set `current-interp` See [[mood-weather]]" - (set! (-> obj target-interp cloud) cloud-target) - (set! (-> obj target-interp fog) fog-target) - (set! (-> obj speed-interp cloud) cloud-speed) - (set! (-> obj speed-interp fog) fog-speed) + (set! (-> this target-interp cloud) cloud-target) + (set! (-> this target-interp fog) fog-target) + (set! (-> this speed-interp cloud) cloud-speed) + (set! (-> this speed-interp fog) fog-speed) (if (= cloud-speed 0.0) - (set! (-> obj current-interp cloud) cloud-target) + (set! (-> this current-interp cloud) cloud-target) ) (if (= fog-speed 0.0) - (set! (-> obj current-interp fog) fog-target) + (set! (-> this current-interp fog) fog-target) ) 0 (none) ) -(defmethod update-mood-range! mood-control ((obj mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) +(defmethod update-mood-range! mood-control ((this mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) "Set the minimum and maximum ranges of clouds and fog See [[mood-range]]" - (set! (-> obj range min-cloud) min-cloud) - (set! (-> obj range max-cloud) max-cloud) - (set! (-> obj range min-fog) min-fog) - (set! (-> obj range max-fog) max-fog) + (set! (-> this range min-cloud) min-cloud) + (set! (-> this range max-cloud) max-cloud) + (set! (-> this range min-fog) min-fog) + (set! (-> this range max-fog) max-fog) 0 (none) ) -(defmethod set-time-for-random-weather! mood-control ((obj mood-control) (arg0 float) (arg1 float)) +(defmethod set-time-for-random-weather! mood-control ((this mood-control) (arg0 float) (arg1 float)) "Set the `time-until-random`'s cloud and fog values See [[mood-weather]]" - (set! (-> obj time-until-random cloud) arg0) - (set! (-> obj time-until-random fog) arg1) + (set! (-> this time-until-random cloud) arg0) + (set! (-> this time-until-random fog) arg1) 0 (none) ) diff --git a/goal_src/jak2/engine/gfx/mood/time-of-day.gc b/goal_src/jak2/engine/gfx/mood/time-of-day.gc index 5ad884af3f..59c4e7243e 100644 --- a/goal_src/jak2/engine/gfx/mood/time-of-day.gc +++ b/goal_src/jak2/engine/gfx/mood/time-of-day.gc @@ -10,21 +10,21 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of time-of-day-palette ((obj time-of-day-palette)) - (the-as int (+ (-> obj type size) (* (* (-> obj height) (-> obj width)) 4))) +(defmethod asize-of time-of-day-palette ((this time-of-day-palette)) + (the-as int (+ (-> this type size) (* (* (-> this height) (-> this width)) 4))) ) -(defmethod deactivate time-of-day-proc ((obj time-of-day-proc)) - (if (nonzero? (-> obj sun)) - (kill-and-free-particles (-> obj sun)) +(defmethod deactivate time-of-day-proc ((this time-of-day-proc)) + (if (nonzero? (-> this sun)) + (kill-and-free-particles (-> this sun)) ) - (if (nonzero? (-> obj green-sun)) - (kill-and-free-particles (-> obj green-sun)) + (if (nonzero? (-> this green-sun)) + (kill-and-free-particles (-> this green-sun)) ) - (if (nonzero? (-> obj moon)) - (kill-and-free-particles (-> obj moon)) + (if (nonzero? (-> this moon)) + (kill-and-free-particles (-> this moon)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -454,6 +454,7 @@ (set-fog-height! f0-16) ) (if (-> arg0 sky) + ;; og:preserve-this (set! (-> (&-> *level* default-level texture-anim-array 9) 0) (#if PC_PORT (if *hires-sky* *sky-hires-texture-anim-array* *sky-texture-anim-array*) *sky-texture-anim-array*)) (set! (-> (&-> *level* default-level texture-anim-array 9) 0) #f) @@ -636,10 +637,10 @@ ) ) -(defmethod set-fade! palette-fade-controls ((obj palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) +(defmethod set-fade! palette-fade-controls ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) (cond ((and (>= arg0 0) (< arg0 8)) - (let ((v1-3 (-> obj control arg0))) + (let ((v1-3 (-> this control arg0))) (when (< arg2 (-> v1-3 actor-dist)) (if arg3 (set! (-> v1-3 trans quad) (-> arg3 quad)) @@ -655,9 +656,9 @@ ) ) -(defmethod reset! palette-fade-controls ((obj palette-fade-controls)) +(defmethod reset! palette-fade-controls ((this palette-fade-controls)) (countdown (v1-0 8) - (let ((a1-2 (-> obj control v1-0))) + (let ((a1-2 (-> this control v1-0))) (set! (-> a1-2 fade) 0.0) (set! (-> a1-2 actor-dist) 4096000000.0) ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc index 4704e37a05..974f628248 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-mid.gc @@ -9,7 +9,7 @@ (define ocean-mid-block (new 'static 'vu-function)) -(defmethod ocean-mid-setup-constants ocean ((obj ocean) (arg0 ocean-mid-constants)) +(defmethod ocean-mid-setup-constants ocean ((this ocean) (arg0 ocean-mid-constants)) (let ((v1-0 *math-camera*)) (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) @@ -230,7 +230,7 @@ (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :tcc #x1 :th (log2 128) :tw (log2 128)) ) (set! (-> arg0 drw-texture prims 1) (gs-reg64 tex0-1)) - (set! (-> arg0 drw-texture tex1) (-> obj tex1)) + (set! (-> arg0 drw-texture tex1) (-> this tex1)) (set! (-> arg0 drw-texture prims 3) (gs-reg64 tex1-1)) (set! (-> arg0 drw-texture miptbp1) (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0)) (set! (-> arg0 drw-texture prims 5) (gs-reg64 miptbp1-1)) @@ -290,7 +290,7 @@ (none) ) -(defmethod ocean-mid-add-constants ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-mid-add-constants ocean ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 36) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -302,13 +302,13 @@ ) (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) ) - (ocean-mid-setup-constants obj (the-as ocean-mid-constants (-> arg0 base))) + (ocean-mid-setup-constants this (the-as ocean-mid-constants (-> arg0 base))) (&+! (-> arg0 base) 576) 0 (none) ) -(defmethod ocean-matrix*! ocean ((obj ocean) (arg0 matrix) (arg1 matrix) (arg2 matrix)) +(defmethod ocean-matrix*! ocean ((this ocean) (arg0 matrix) (arg1 matrix) (arg2 matrix)) (rlet ((acc :class vf) (vf1 :class vf) (vf10 :class vf) @@ -355,7 +355,7 @@ ) ) -(defmethod ocean-vector-matrix*! ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 matrix)) +(defmethod ocean-vector-matrix*! ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 matrix)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -379,7 +379,7 @@ ) ) -(defmethod ocean-mid-add-matrices ocean ((obj ocean) (arg0 dma-buffer) (arg1 vector)) +(defmethod ocean-mid-add-matrices ocean ((this ocean) (arg0 dma-buffer) (arg1 vector)) (let ((s4-0 (new-stack-vector0)) (v1-3 (if (-> *time-of-day-context* use-camera-other) (-> *math-camera* camera-rot-other) @@ -418,7 +418,7 @@ (set! (-> (the-as vector s2-0) z) (-> s4-0 z)) ) (let ((a1-5 (&+ (-> arg0 base) 64))) - (ocean-matrix*! obj (the-as matrix a1-5) (the-as matrix s3-0) (-> *math-camera* perspective)) + (ocean-matrix*! this (the-as matrix a1-5) (the-as matrix s3-0) (-> *math-camera* perspective)) ) ) ) @@ -427,7 +427,7 @@ (none) ) -(defmethod ocean-mid-check ocean ((obj ocean) (arg0 pointer) (arg1 int) (arg2 int) (arg3 vector)) +(defmethod ocean-mid-check ocean ((this ocean) (arg0 pointer) (arg1 int) (arg2 int) (arg3 vector)) (local-vars (v0-0 symbol) (v1-10 float) (t0-3 float) (t0-8 float) (t0-13 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -504,7 +504,7 @@ ) ) -(defmethod ocean-mid-add-call ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-mid-add-call ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -517,7 +517,7 @@ (none) ) -(defmethod ocean-mid-add-call-flush ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint)) +(defmethod ocean-mid-add-call-flush ocean ((this ocean) (arg0 dma-buffer) (arg1 uint)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -531,7 +531,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ocean-mid-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float)) +(defmethod ocean-mid-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float)) (local-vars (sv-32 int)) (set! sv-32 arg1) (let ((s0-0 arg2) @@ -540,14 +540,14 @@ (s2-0 arg5) (s5-0 (new-stack-vector0)) ) - (let ((v1-0 (-> obj start-corner))) + (let ((v1-0 (-> this start-corner))) (set! (-> s5-0 x) (+ (-> v1-0 x) (* 3145728.0 (the float s0-0)))) (set! (-> s5-0 y) (-> v1-0 y)) (set! (-> s5-0 z) (+ (-> v1-0 z) (* 3145728.0 (the float sv-32)))) ) (set! (-> s5-0 w) 1.0) - (ocean-mid-add-matrices obj arg0 s5-0) - (let ((v1-6 (+ (the-as uint (-> obj ocean-colors)) (* (+ (* 416 sv-32) (* s0-0 8)) 4)))) + (ocean-mid-add-matrices this arg0 s5-0) + (let ((v1-6 (+ (the-as uint (-> this ocean-colors)) (* (+ (* 416 sv-32) (* s0-0 8)) 4)))) (dotimes (a0-7 9) (let* ((a1-4 arg0) (a2-2 (the-as object (-> a1-4 base))) @@ -577,8 +577,8 @@ (set! (-> v1-9 base) (&+ (the-as pointer a0-8) 16)) ) (let ((v1-10 (-> arg0 base))) - (let ((a0-12 (-> obj ocean-mid-masks data s1-0))) - (set! (-> obj mid-mask-ptrs s4-0) v1-10) + (let ((a0-12 (-> this ocean-mid-masks data s1-0))) + (set! (-> this mid-mask-ptrs s4-0) v1-10) (set! (-> (the-as (pointer uint64) v1-10)) (-> a0-12 dword)) ) (set! (-> (the-as (pointer uint64) v1-10) 1) (the-as uint 0)) @@ -586,7 +586,7 @@ (&+! (-> arg0 base) 16) (when (< s2-0 556091.4) (let* ((v1-15 (-> *math-camera* trans)) - (s4-1 (&-> obj mid-camera-masks s4-0)) + (s4-1 (&-> this mid-camera-masks s4-0)) (s3-1 (+ (the int (* 0.0000025431316 (- (-> v1-15 x) (-> s5-0 x)))) -1)) (s2-1 (+ (the int (* 0.0000025431316 (- (-> v1-15 z) (-> s5-0 z)))) -1)) ) @@ -596,7 +596,7 @@ (a3-6 (+ s1-1 s2-1)) ) (if (and (>= a2-7 0) (>= a3-6 0) (< a2-7 8) (< a3-6 8)) - (ocean-mid-check obj s4-1 a2-7 a3-6 s5-0) + (ocean-mid-check this s4-1 a2-7 a3-6 s5-0) ) ) ) @@ -607,7 +607,7 @@ (none) ) -(defmethod ocean-mid-camera-masks-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-camera-masks-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #t @@ -619,13 +619,13 @@ (v1-1 (logand arg1 7)) (a2-3 (+ (* 6 (the-as int t0-0)) a3-3)) ) - (logtest? (-> (the-as (pointer uint8) (+ (+ a1-1 (* a2-3 8)) (the-as uint obj))) 2384) (ash 1 v1-1)) + (logtest? (-> (the-as (pointer uint8) (+ (+ a1-1 (* a2-3 8)) (the-as uint this))) 2384) (ash 1 v1-1)) ) ) ) ) -(defmethod ocean-mid-mask-ptrs-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-mask-ptrs-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #t @@ -637,8 +637,8 @@ (v1-1 (logand arg1 7)) (a2-3 (+ (* 6 (the-as int t0-0)) a3-3)) ) - (if (-> obj mid-mask-ptrs a2-3) - (logtest? (-> (the-as (pointer uint8) (+ a1-1 (the-as uint (-> obj mid-mask-ptrs a2-3))))) (ash 1 v1-1)) + (if (-> this mid-mask-ptrs a2-3) + (logtest? (-> (the-as (pointer uint8) (+ a1-1 (the-as uint (-> this mid-mask-ptrs a2-3))))) (ash 1 v1-1)) #t ) ) @@ -646,7 +646,7 @@ ) ) -(defmethod ocean-mid-camera-masks-set! ocean ((obj ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-camera-masks-set! ocean ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #f @@ -657,12 +657,12 @@ (v1-1 (logand arg0 7)) (a1-1 (logand arg1 7)) (a3-4 (+ (* 6 (the-as int t0-0)) a3-3)) - (a2-5 (&-> obj mid-camera-masks a3-4)) + (a2-5 (&-> this mid-camera-masks a3-4)) ) (cond (a2-5 (cond - ((logtest? (-> (the-as (pointer uint8) (+ v1-1 (the-as uint (-> obj mid-mask-ptrs a3-4))))) (ash 1 a1-1)) + ((logtest? (-> (the-as (pointer uint8) (+ v1-1 (the-as uint (-> this mid-mask-ptrs a3-4))))) (ash 1 a1-1)) #f ) (else @@ -680,7 +680,7 @@ ) ) -(defmethod ocean-mid-add-upload-table ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) +(defmethod ocean-mid-add-upload-table ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) (local-vars (v1-13 float) (a0-20 uint128) @@ -697,15 +697,15 @@ (vf3 :class vf) (vf4 :class vf) ) - (when (ocean-mid-camera-masks-set! obj arg1 arg2) + (when (ocean-mid-camera-masks-set! this arg1 arg2) (let ((a2-2 (new-stack-vector0))) - (let ((v1-3 (-> obj start-corner))) + (let ((v1-3 (-> this start-corner))) (set! (-> a2-2 x) (+ (-> v1-3 x) (* 393216.0 (the float arg2)))) (set! (-> a2-2 y) (-> v1-3 y)) (set! (-> a2-2 z) (+ (-> v1-3 z) (* 393216.0 (the float arg1)))) ) (set! (-> a2-2 w) 1.0) - (ocean-mid-add-matrices obj arg0 a2-2) + (ocean-mid-add-matrices this arg0 a2-2) ) (let* ((a1-3 9) (v1-8 arg0) @@ -725,10 +725,10 @@ (set! (-> v1-12 1 quad) (-> *ocean-trans-st-table* 1 quad)) (set! (-> v1-12 2 quad) (-> *ocean-trans-st-table* 2 quad)) (set! (-> v1-12 3 quad) (-> *ocean-trans-st-table* 3 quad)) - (let ((a0-19 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) - (a1-12 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) - (a2-15 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) - (a3-9 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) + (let ((a0-19 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) + (a1-12 (the-as uint128 (-> this ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) + (a2-15 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) + (a3-9 (the-as uint128 (-> this ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) ) (.pextlb a0-20 0 a0-19) (nop!) @@ -781,8 +781,8 @@ (set! (-> v1-16 base) (&+ (the-as pointer a0-23) 16)) ) (if arg5 - (ocean-mid-add-call obj arg0 275) - (ocean-mid-add-call obj arg0 107) + (ocean-mid-add-call this arg0 275) + (ocean-mid-add-call this arg0 107) ) ) 0 @@ -790,35 +790,35 @@ ) ) -(defmethod ocean-mid-add-upload-top ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) - (let ((s0-0 (-> obj mid-minx)) - (s2-0 (-> obj mid-maxx)) - (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) +(defmethod ocean-mid-add-upload-top ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> this mid-minx)) + (s2-0 (-> this mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) ) (cond - ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ((ocean-mid-mask-ptrs-bit? this arg1 arg2) ) ((= arg2 s0-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) ) (else - (let ((s2-1 (ocean-mid-mask-ptrs-bit? obj (+ arg1 1) arg2)) - (v1-12 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1))) + (let ((s2-1 (ocean-mid-mask-ptrs-bit? this (+ arg1 1) arg2)) + (v1-12 (ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 1))) ) (cond ((and s2-1 v1-12) ) (s2-1 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-right-table* 7 #t) ) (v1-12 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-down-table* 7 #t) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-right-table* 10 #f) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-down-right-table* 10 #f) ) ) ) @@ -828,24 +828,24 @@ ((= arg2 s2-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) ) (else - (let ((s2-2 (ocean-mid-mask-ptrs-bit? obj (+ arg1 1) arg2)) - (v1-27 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1))) + (let ((s2-2 (ocean-mid-mask-ptrs-bit? this (+ arg1 1) arg2)) + (v1-27 (ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 -1))) ) (cond ((and s2-2 v1-27) ) (s2-2 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-left-table* 7 #t) ) (v1-27 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-down-table* 7 #t) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-left-table* 10 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-down-left-table* 10 #t) ) ) ) @@ -853,7 +853,7 @@ ) ) (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) ) ) ) @@ -861,35 +861,35 @@ (none) ) -(defmethod ocean-mid-add-upload-middle ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) - (let ((s0-0 (-> obj mid-minx)) - (s2-0 (-> obj mid-maxx)) - (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) +(defmethod ocean-mid-add-upload-middle ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> this mid-minx)) + (s2-0 (-> this mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) ) (cond - ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ((ocean-mid-mask-ptrs-bit? this arg1 arg2) ) ((= arg2 s0-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) ) - ((ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1)) + ((ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 1)) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-right-table* 7 #t) ) ) ) ((= arg2 s2-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) ) - ((ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1)) + ((ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 -1)) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-left-table* 7 #t) ) ) ) @@ -899,35 +899,35 @@ (none) ) -(defmethod ocean-mid-add-upload-bottom ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) - (let ((s0-0 (-> obj mid-minx)) - (s2-0 (-> obj mid-maxx)) - (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) +(defmethod ocean-mid-add-upload-bottom ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> this mid-minx)) + (s2-0 (-> this mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) ) (cond - ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ((ocean-mid-mask-ptrs-bit? this arg1 arg2) ) ((= arg2 s0-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) ) (else - (let ((s2-1 (ocean-mid-mask-ptrs-bit? obj (+ arg1 -1) arg2)) - (v1-12 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1))) + (let ((s2-1 (ocean-mid-mask-ptrs-bit? this (+ arg1 -1) arg2)) + (v1-12 (ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 1))) ) (cond ((and s2-1 v1-12) ) (s2-1 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-right-table* 7 #t) ) (v1-12 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-up-table* 7 #t) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-right-table* 10 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-up-right-table* 10 #t) ) ) ) @@ -937,24 +937,24 @@ ((= arg2 s2-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) ) (else - (let ((s2-2 (ocean-mid-mask-ptrs-bit? obj (+ arg1 -1) arg2)) - (v1-27 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1))) + (let ((s2-2 (ocean-mid-mask-ptrs-bit? this (+ arg1 -1) arg2)) + (v1-27 (ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 -1))) ) (cond ((and s2-2 v1-27) ) (s2-2 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-left-table* 7 #t) ) (v1-27 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-up-table* 7 #t) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-left-table* 10 #f) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-up-left-table* 10 #f) ) ) ) @@ -962,7 +962,7 @@ ) ) (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) ) ) ) @@ -970,7 +970,7 @@ (none) ) -(defmethod ocean-seams-add-constants ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-seams-add-constants ocean ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 4) (v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) @@ -993,15 +993,15 @@ (none) ) -(defmethod draw-ocean-mid-seams ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-mid-seams ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) - (ocean-seams-add-constants obj arg0) - (set! sv-32 (-> obj mid-minx)) - (set! sv-33 (-> obj mid-maxx)) - (set! sv-34 (-> obj mid-minz)) - (set! sv-35 (-> obj mid-maxz)) + (ocean-seams-add-constants this arg0) + (set! sv-32 (-> this mid-minx)) + (set! sv-33 (-> this mid-maxx)) + (set! sv-34 (-> this mid-minz)) + (set! sv-35 (-> this mid-maxz)) (set! sv-36 (new 'stack 'sphere)) - (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 y) (-> this start-corner y)) (set! (-> sv-36 r) 278045.7) (let ((s4-0 sv-34) (s3-0 sv-35) @@ -1011,18 +1011,18 @@ (s1-0 sv-33) ) (while (>= s1-0 s2-0) - (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> obj start-corner x))) - (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> obj start-corner z))) + (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> this start-corner x))) + (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> this start-corner z))) (when (sphere-cull-for-ocean sv-36) ;; modified (cond ((= s4-0 sv-34) - (ocean-mid-add-upload-top obj arg0 s4-0 s2-0) + (ocean-mid-add-upload-top this arg0 s4-0 s2-0) ) ((= s4-0 sv-35) - (ocean-mid-add-upload-bottom obj arg0 s4-0 s2-0) + (ocean-mid-add-upload-bottom this arg0 s4-0 s2-0) ) (else - (ocean-mid-add-upload-middle obj arg0 s4-0 s2-0) + (ocean-mid-add-upload-middle this arg0 s4-0 s2-0) ) ) ) @@ -1033,15 +1033,15 @@ ) ) (dotimes (v1-29 36) - (if (and (-> obj mid-mask-ptrs v1-29) (nonzero? (-> obj mid-camera-masks v1-29))) - (logior! (-> (the-as (pointer uint64) (-> obj mid-mask-ptrs v1-29))) (-> obj mid-camera-masks v1-29)) + (if (and (-> this mid-mask-ptrs v1-29) (nonzero? (-> this mid-camera-masks v1-29))) + (logior! (-> (the-as (pointer uint64) (-> this mid-mask-ptrs v1-29))) (-> this mid-camera-masks v1-29)) ) ) 0 (none) ) -(defmethod draw-ocean-mid ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-mid ocean ((this ocean) (arg0 dma-buffer)) (local-vars (v1-8 float) (v1-9 float) (sv-32 int)) (rlet ((vf16 :class vf) (vf17 :class vf) @@ -1053,8 +1053,8 @@ (vf23 :class vf) ) (dotimes (v1-0 36) - (set! (-> obj mid-mask-ptrs v1-0) (the-as pointer #f)) - (set! (-> obj mid-camera-masks v1-0) (the-as uint 0)) + (set! (-> this mid-mask-ptrs v1-0) (the-as pointer #f)) + (set! (-> this mid-camera-masks v1-0) (the-as uint 0)) ) (dma-buffer-add-vu-function arg0 ocean-mid-block 1) (let* ((v1-3 arg0) @@ -1065,8 +1065,8 @@ (set! (-> (the-as dma-packet a0-6) vif1) (new 'static 'vif-tag :imm #x76 :cmd (vif-cmd offset))) (set! (-> v1-3 base) (&+ (the-as pointer a0-6) 16)) ) - (ocean-mid-add-constants obj arg0) - (ocean-mid-add-call obj arg0 0) + (ocean-mid-add-constants this arg0) + (ocean-mid-add-call this arg0 0) (let ((v1-7 *math-camera*)) (cond ((-> *time-of-day-context* use-camera-other) @@ -1098,15 +1098,15 @@ (dotimes (s3-0 6) (dotimes (s2-0 6) (let* ((s1-0 (+ (* 6 s3-0) s2-0)) - (s0-0 (-> obj ocean-spheres spheres s1-0)) + (s0-0 (-> this ocean-spheres spheres s1-0)) ) - (set! sv-32 (-> (the-as (pointer int16) (+ (* s1-0 2) (the-as int (-> obj ocean-mid-indices)))))) + (set! sv-32 (-> (the-as (pointer int16) (+ (* s1-0 2) (the-as int (-> this ocean-mid-indices)))))) (when (sphere-cull-for-ocean s0-0) ;; modified (cond ((< sv-32 0) ) ((let ((f30-0 (- (vector-vector-distance s0-0 s4-0) (-> s0-0 r)))) - (let ((a0-16 obj) + (let ((a0-16 this) (t9-5 (method-of-type ocean ocean-mid-add-upload)) (a1-8 arg0) (a2-2 s3-0) @@ -1117,13 +1117,13 @@ ) (< f30-0 786432.0) ) - (ocean-mid-add-call obj arg0 73) + (ocean-mid-add-call this arg0 73) (+! (-> *terrain-stats* ocean-mid fragments) 1) (+! (-> *terrain-stats* ocean-mid tris) 256) (+! (-> *terrain-stats* ocean-mid dverts) 288) ) (else - (ocean-mid-add-call obj arg0 46) + (ocean-mid-add-call this arg0 46) (+! (-> *terrain-stats* ocean-mid fragments) 1) (+! (-> *terrain-stats* ocean-mid tris) 128) (+! (-> *terrain-stats* ocean-mid dverts) 144) @@ -1134,7 +1134,7 @@ ) ) ) - (when (not (or (-> obj near-off) (< 196608.0 (fabs (- (-> obj start-corner y) (-> *math-camera* trans y)))))) + (when (not (or (-> this near-off) (< 196608.0 (fabs (- (-> this start-corner y) (-> *math-camera* trans y)))))) (let ((a1-11 48) (a2-5 0) (v1-53 48) @@ -1142,7 +1142,7 @@ ) (dotimes (a3-1 6) (dotimes (t0-1 6) - (let ((t1-6 (&-> obj mid-camera-masks (+ (* 6 a3-1) t0-1)))) + (let ((t1-6 (&-> this mid-camera-masks (+ (* 6 a3-1) t0-1)))) (when (nonzero? (-> t1-6 0)) (dotimes (t2-3 8) (let ((t3-1 (-> (the-as (pointer uint8) (+ t2-3 (the-as int t1-6))) 0))) @@ -1174,19 +1174,19 @@ ) ) ) - (set! (-> obj mid-minx) (the-as uint a1-11)) - (set! (-> obj mid-maxx) (the-as uint a2-5)) - (set! (-> obj mid-minz) (the-as uint v1-53)) - (set! (-> obj mid-maxz) (the-as uint a0-25)) + (set! (-> this mid-minx) (the-as uint a1-11)) + (set! (-> this mid-maxx) (the-as uint a2-5)) + (set! (-> this mid-minz) (the-as uint v1-53)) + (set! (-> this mid-maxz) (the-as uint a0-25)) (when (and (< a1-11 a2-5) (< v1-53 a0-25)) - (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) - (ocean-mid-add-call-flush obj arg0 (the-as uint 43)) - (draw-ocean-transition obj arg0) - (draw-ocean-mid-seams obj arg0) + (ocean-mid-add-call-flush this arg0 (the-as uint 41)) + (ocean-mid-add-call-flush this arg0 (the-as uint 43)) + (draw-ocean-transition this arg0) + (draw-ocean-mid-seams this arg0) ) ) ) - (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + (ocean-mid-add-call-flush this arg0 (the-as uint 41)) 0 (none) ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc index 9beccc5bcd..7388d2684d 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-near.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-near.gc @@ -9,7 +9,7 @@ (define ocean-near-block (new 'static 'vu-function)) -(defmethod ocean-near-add-call ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-near-add-call ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -22,7 +22,7 @@ (none) ) -(defmethod ocean-near-add-call-flush ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-near-add-call-flush ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -35,7 +35,7 @@ (none) ) -(defmethod ocean-near-setup-constants ocean ((obj ocean) (arg0 ocean-near-constants)) +(defmethod ocean-near-setup-constants ocean ((this ocean) (arg0 ocean-near-constants)) (let ((v1-0 *math-camera*)) (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) @@ -300,7 +300,7 @@ (set! (-> arg0 drw-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) (set! (-> arg0 drw-texture tex0) (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :th (log2 128) :tw (log2 128))) (set! (-> arg0 drw-texture prims 1) (gs-reg64 tex0-1)) - (set! (-> arg0 drw-texture tex1) (-> obj tex1-near)) + (set! (-> arg0 drw-texture tex1) (-> this tex1-near)) (set! (-> arg0 drw-texture prims 3) (gs-reg64 tex1-1)) (set! (-> arg0 drw-texture miptbp1) (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0)) (set! (-> arg0 drw-texture prims 5) (gs-reg64 miptbp1-1)) @@ -366,7 +366,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod ocean-near-add-constants ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-near-add-constants ocean ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 37) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -378,14 +378,14 @@ ) (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) ) - (ocean-near-setup-constants obj (the-as ocean-near-constants (-> arg0 base))) + (ocean-near-setup-constants this (the-as ocean-near-constants (-> arg0 base))) (&+! (-> arg0 base) 592) (none) ) -(defmethod ocean-near-add-heights ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-near-add-heights ocean ((this ocean) (arg0 dma-buffer)) (let ((v1-0 128) - (a0-1 (-> obj heights)) + (a0-1 (-> this heights)) ) (let* ((a2-0 arg0) (a3-0 (the-as object (-> a2-0 base))) @@ -414,7 +414,7 @@ (none) ) -(defmethod ocean-near-add-matrices ocean ((obj ocean) (arg0 dma-buffer) (arg1 vector)) +(defmethod ocean-near-add-matrices ocean ((this ocean) (arg0 dma-buffer) (arg1 vector)) (let ((s4-0 (new-stack-vector0))) (if (-> *time-of-day-context* use-camera-other) (-> *math-camera* camera-rot-other) @@ -451,7 +451,7 @@ (set! (-> (the-as vector s2-0) z) (-> s4-0 z)) ) (let ((a1-7 (&+ (-> arg0 base) 64))) - (ocean-matrix*! obj (the-as matrix a1-7) (the-as matrix s3-0) (-> *math-camera* perspective)) + (ocean-matrix*! this (the-as matrix a1-7) (the-as matrix s3-0) (-> *math-camera* perspective)) ) ) ) @@ -460,7 +460,7 @@ (none) ) -(defmethod ocean-near-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-near-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (local-vars (v1-17 uint128) (v1-18 uint128) @@ -487,17 +487,17 @@ (vf8 :class vf) (vf9 :class vf) ) - (let ((s1-0 (-> obj mid-minx)) - (s2-0 (-> obj mid-minz)) + (let ((s1-0 (-> this mid-minx)) + (s2-0 (-> this mid-minz)) ) (let ((a2-1 (new-stack-vector0))) - (let ((v1-0 (-> obj start-corner))) + (let ((v1-0 (-> this start-corner))) (set! (-> a2-1 x) (+ (-> v1-0 x) (* 98304.0 (the float arg2)))) (set! (-> a2-1 y) (-> v1-0 y)) (set! (-> a2-1 z) (+ (-> v1-0 z) (* 98304.0 (the float arg1)))) ) (set! (-> a2-1 w) 1.0) - (ocean-near-add-matrices obj arg0 a2-1) + (ocean-near-add-matrices this arg0 a2-1) ) (let* ((a1-2 8) (v1-5 arg0) @@ -517,10 +517,10 @@ (a3-3 (shr a1-7 2)) (a0-7 (logand a0-6 3)) (a1-8 (logand a1-7 3)) - (a2-10 (-> (the-as (pointer int16) (+ (* (+ (* a3-3 4) a2-6) 2) (the-as uint obj))) 4002)) - (a3-7 (-> obj ocean-near-indices data a2-10)) + (a2-10 (-> (the-as (pointer int16) (+ (* (+ (* a3-3 4) a2-6) 2) (the-as uint this))) 4002)) + (a3-7 (-> this ocean-near-indices data a2-10)) (a0-13 - (-> obj ocean-mid-masks data (-> (the-as (pointer int16) (+ (* (+ (* a1-8 4) a0-7) 2) (the-as uint a3-7))))) + (-> this ocean-mid-masks data (-> (the-as (pointer int16) (+ (* (+ (* a1-8 4) a0-7) 2) (the-as uint a3-7))))) ) ) (set-vector! @@ -575,10 +575,10 @@ (.lvf vf8 (&-> (-> *ocean-trans-corner-table* 0 vector (+ a2-19 6)) quad)) ) (.mov a2-23 vf8) - (let ((a2-29 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int v1-10)) a0-15)))) - (a3-24 (the-as uint128 (-> obj ocean-colors colors (+ a0-15 1 (* 52 (the-as int v1-10)))))) - (t0-17 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ v1-10 1))) a0-15)))) - (v1-16 (the-as uint128 (-> obj ocean-colors colors (+ a0-15 1 (* 52 (the-as int (+ v1-10 1))))))) + (let ((a2-29 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int v1-10)) a0-15)))) + (a3-24 (the-as uint128 (-> this ocean-colors colors (+ a0-15 1 (* 52 (the-as int v1-10)))))) + (t0-17 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int (+ v1-10 1))) a0-15)))) + (v1-16 (the-as uint128 (-> this ocean-colors colors (+ a0-15 1 (* 52 (the-as int (+ v1-10 1))))))) ) (.pextlb a0-18 0 a2-29) (nop!) @@ -650,7 +650,7 @@ ) ) -(defmethod draw-ocean-near ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-near ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-16 uint)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))) @@ -664,31 +664,31 @@ (set! (-> (the-as dma-packet a0-8) vif1) (new 'static 'vif-tag :imm #x10 :cmd (vif-cmd offset))) (set! (-> v1-3 base) (&+ (the-as pointer a0-8) 16)) ) - (ocean-near-add-constants obj arg0) - (ocean-near-add-heights obj arg0) - (ocean-near-add-call obj arg0 0) - (let ((s4-0 (-> obj near-minx)) - (s3-0 (-> obj near-maxx)) - (s2-0 (-> obj near-minz)) - (s1-0 (-> obj near-maxz)) + (ocean-near-add-constants this arg0) + (ocean-near-add-heights this arg0) + (ocean-near-add-call this arg0 0) + (let ((s4-0 (-> this near-minx)) + (s3-0 (-> this near-maxx)) + (s2-0 (-> this near-minz)) + (s1-0 (-> this near-maxz)) ) (when (and (< s4-0 s3-0) (< s2-0 s1-0)) (while (>= s1-0 s2-0) (let ((s0-0 s4-0)) (set! sv-16 s3-0) (while (>= sv-16 s0-0) - (when (ocean-trans-camera-masks-bit? obj s2-0 s0-0) - (let* ((a1-16 (- (shr s0-0 2) (-> obj mid-minx))) - (a2-3 (- (shr s2-0 2) (-> obj mid-minz))) + (when (ocean-trans-camera-masks-bit? this s2-0 s0-0) + (let* ((a1-16 (- (shr s0-0 2) (-> this mid-minx))) + (a2-3 (- (shr s2-0 2) (-> this mid-minz))) (v1-13 (logand s0-0 3)) (a0-17 (logand s2-0 3)) - (a1-20 (-> (the-as (pointer int16) (+ (* (+ (* a2-3 4) a1-16) 2) (the-as uint obj))) 4002)) + (a1-20 (-> (the-as (pointer int16) (+ (* (+ (* a2-3 4) a1-16) 2) (the-as uint this))) 4002)) ) (when (>= a1-20 0) - (let ((a1-22 (-> obj ocean-near-indices data a1-20))) + (let ((a1-22 (-> this ocean-near-indices data a1-20))) (when (>= (-> (the-as (pointer int16) (+ (* (+ (* a0-17 4) v1-13) 2) (the-as uint a1-22)))) 0) - (ocean-near-add-upload obj arg0 s2-0 s0-0) - (ocean-near-add-call obj arg0 39) + (ocean-near-add-upload this arg0 s2-0 s0-0) + (ocean-near-add-call this arg0 39) ) ) ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc b/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc index db08e4a6e7..8f7ac460b4 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-texture.gc @@ -12,7 +12,7 @@ ;; og:preserve-this (define ocean-texture-vu1-block (new 'static 'vu-function)) -(defmethod ocean-texture-setup-constants ocean ((obj ocean) (arg0 ocean-texture-constants)) +(defmethod ocean-texture-setup-constants ocean ((this ocean) (arg0 ocean-texture-constants)) (set! (-> arg0 giftag tag) (new 'static 'gif-tag64 :nloop #x42 @@ -38,7 +38,7 @@ (none) ) -(defmethod ocean-texture-add-constants ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-constants ocean ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 7) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -50,16 +50,16 @@ ) (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) ) - (ocean-texture-setup-constants obj (the-as ocean-texture-constants (-> arg0 base))) + (ocean-texture-setup-constants this (the-as ocean-texture-constants (-> arg0 base))) (&+! (-> arg0 base) 112) 0 (none) ) -(defmethod ocean-texture-add-envmap ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-envmap ocean ((this ocean) (arg0 dma-buffer)) (let ((v1-0 (the-as object (-> arg0 base)))) - (set! (-> (the-as (inline-array vector4w) v1-0) 0 quad) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (inline-array vector4w) v1-0) 1 quad) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (inline-array vector4w) v1-0) 0 quad) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-0) 1 quad) (-> this adgif-tmpl quad 1)) (let ((s4-0 (&+ (the-as pointer v1-0) 32))) (adgif-shader<-texture-simple! (the-as adgif-shader s4-0) @@ -72,7 +72,7 @@ (none) ) -(defmethod ocean-texture-add-verts ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-texture-add-verts ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -87,7 +87,7 @@ (none) ) -(defmethod ocean-texture-add-verts-last ocean ((obj ocean) (arg0 dma-buffer) (arg1 int) (arg2 int)) +(defmethod ocean-texture-add-verts-last ocean ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -112,7 +112,7 @@ (none) ) -(defmethod ocean-texture-add-call-start ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-start ocean ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -125,7 +125,7 @@ (none) ) -(defmethod ocean-texture-add-call-rest ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-rest ocean ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -138,7 +138,7 @@ (none) ) -(defmethod ocean-texture-add-call-done ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-done ocean ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -151,9 +151,9 @@ (none) ) -(defmethod draw-ocean-texture ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod draw-ocean-texture ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) (set-display-gs-state arg0 21 128 128 0 0) - (ocean-texture-add-envmap obj arg0) + (ocean-texture-add-envmap this arg0) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) (alpha-1 (new 'static 'gs-alpha :b #x2 :d #x1)) @@ -168,29 +168,29 @@ (set! (-> (the-as dma-packet a0-10) vif1) (new 'static 'vif-tag :imm #xc0 :cmd (vif-cmd offset))) (set! (-> v1-5 base) (&+ (the-as pointer a0-10) 16)) ) - (ocean-texture-add-constants obj arg0) + (ocean-texture-add-constants this arg0) (let ((s3-0 (+ arg1 0))) - (ocean-texture-add-verts obj arg0 s3-0) + (ocean-texture-add-verts this arg0 s3-0) (let ((s3-1 (+ s3-0 3072))) - (ocean-texture-add-call-start obj arg0) + (ocean-texture-add-call-start this arg0) (dotimes (s2-0 9) - (ocean-texture-add-verts obj arg0 s3-1) + (ocean-texture-add-verts this arg0 s3-1) (+! s3-1 3072) - (ocean-texture-add-call-rest obj arg0) + (ocean-texture-add-call-rest this arg0) ) - (ocean-texture-add-verts-last obj arg0 s3-1 (+ arg1 0)) + (ocean-texture-add-verts-last this arg0 s3-1 (+ arg1 0)) ) ) - (ocean-texture-add-call-rest obj arg0) - (ocean-texture-add-call-done obj arg0) + (ocean-texture-add-call-rest this arg0) + (ocean-texture-add-call-done this arg0) ;; og:preserve-this method 81 not handled for now - ;; (ocean-method-81 obj arg0) + ;; (ocean-method-81 this arg0) ;; (reset-display-gs-state *display* arg0) 0 (none) ) -(defmethod ocean-method-79 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-79 ocean ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 53 64 64 0 0) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -201,13 +201,13 @@ (texflush 0) ) (let ((v1-17 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-17 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-17 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-17 2 quad) (-> obj color80808040 quad)) - (set! (-> v1-17 3 quad) (-> obj uv00 quad)) - (set! (-> v1-17 4 quad) (-> obj xy00 quad)) - (set! (-> v1-17 5 quad) (-> obj uv8080 quad)) - (set! (-> v1-17 6 quad) (-> obj xy4040 quad)) + (set! (-> v1-17 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-17 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-17 2 quad) (-> this color80808040 quad)) + (set! (-> v1-17 3 quad) (-> this uv00 quad)) + (set! (-> v1-17 4 quad) (-> this xy00 quad)) + (set! (-> v1-17 5 quad) (-> this uv8080 quad)) + (set! (-> v1-17 6 quad) (-> this xy4040 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 61 32 32 0 0) @@ -216,13 +216,13 @@ (texflush 0) ) (let ((v1-30 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-30 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-30 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-30 2 quad) (-> obj color80808000 quad)) - (set! (-> v1-30 3 quad) (-> obj uv00 quad)) - (set! (-> v1-30 4 quad) (-> obj xy00 quad)) - (set! (-> v1-30 5 quad) (-> obj uv4040 quad)) - (set! (-> v1-30 6 quad) (-> obj xy2020 quad)) + (set! (-> v1-30 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-30 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-30 2 quad) (-> this color80808000 quad)) + (set! (-> v1-30 3 quad) (-> this uv00 quad)) + (set! (-> v1-30 4 quad) (-> this xy00 quad)) + (set! (-> v1-30 5 quad) (-> this uv4040 quad)) + (set! (-> v1-30 6 quad) (-> this xy2020 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 63 16 16 0 0) @@ -231,13 +231,13 @@ (texflush 0) ) (let ((v1-43 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-43 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-43 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-43 2 quad) (-> obj color80808000 quad)) - (set! (-> v1-43 3 quad) (-> obj uv00 quad)) - (set! (-> v1-43 4 quad) (-> obj xy00 quad)) - (set! (-> v1-43 5 quad) (-> obj uv2020 quad)) - (set! (-> v1-43 6 quad) (-> obj xy1010 quad)) + (set! (-> v1-43 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-43 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-43 2 quad) (-> this color80808000 quad)) + (set! (-> v1-43 3 quad) (-> this uv00 quad)) + (set! (-> v1-43 4 quad) (-> this xy00 quad)) + (set! (-> v1-43 5 quad) (-> this uv2020 quad)) + (set! (-> v1-43 6 quad) (-> this xy1010 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 64 8 8 0 0) @@ -246,13 +246,13 @@ (texflush 0) ) (let ((v1-56 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-56 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-56 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-56 2 quad) (-> obj color80808000 quad)) - (set! (-> v1-56 3 quad) (-> obj uv00 quad)) - (set! (-> v1-56 4 quad) (-> obj xy00 quad)) - (set! (-> v1-56 5 quad) (-> obj uv1010 quad)) - (set! (-> v1-56 6 quad) (-> obj xy88 quad)) + (set! (-> v1-56 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-56 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-56 2 quad) (-> this color80808000 quad)) + (set! (-> v1-56 3 quad) (-> this uv00 quad)) + (set! (-> v1-56 4 quad) (-> this xy00 quad)) + (set! (-> v1-56 5 quad) (-> this uv1010 quad)) + (set! (-> v1-56 6 quad) (-> this xy88 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 65 8 8 0 0) @@ -261,22 +261,22 @@ (texflush 0) ) (let ((v1-69 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-69 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-69 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-69 2 quad) (-> obj color80808000 quad)) - (set! (-> v1-69 3 quad) (-> obj uv00 quad)) - (set! (-> v1-69 4 quad) (-> obj xy00 quad)) - (set! (-> v1-69 5 quad) (-> obj uv1010 quad)) - (set! (-> v1-69 6 quad) (-> obj xy88 quad)) + (set! (-> v1-69 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-69 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-69 2 quad) (-> this color80808000 quad)) + (set! (-> v1-69 3 quad) (-> this uv00 quad)) + (set! (-> v1-69 4 quad) (-> this xy00 quad)) + (set! (-> v1-69 5 quad) (-> this uv1010 quad)) + (set! (-> v1-69 6 quad) (-> this xy88 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 66 8 8 0 0) (let ((v1-72 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-72 0 quad) (-> obj erase-tmpl dma-vif quad)) - (set! (-> v1-72 1 quad) (-> obj erase-tmpl quad 1)) - (set! (-> v1-72 2 quad) (-> obj color80808000 quad)) - (set! (-> v1-72 3 quad) (-> obj xy00 quad)) - (set! (-> v1-72 4 quad) (-> obj xy88 quad)) + (set! (-> v1-72 0 quad) (-> this erase-tmpl dma-vif quad)) + (set! (-> v1-72 1 quad) (-> this erase-tmpl quad 1)) + (set! (-> v1-72 2 quad) (-> this color80808000 quad)) + (set! (-> v1-72 3 quad) (-> this xy00 quad)) + (set! (-> v1-72 4 quad) (-> this xy88 quad)) ) (set! (-> arg0 base) (the-as pointer (-> (the-as (inline-array vector4w) (-> arg0 base)) 5))) (reset-display-gs-state *display* arg0) @@ -284,7 +284,7 @@ (none) ) -(defmethod ocean-method-80 ocean ((obj ocean) (arg0 (pointer rgba))) +(defmethod ocean-method-80 ocean ((this ocean) (arg0 (pointer rgba))) (dotimes (v1-0 256) (let ((a0-3 (-> *clut-translate* v1-0))) (set! (-> arg0 a0-3 r) v1-0) @@ -297,26 +297,26 @@ (none) ) -(defmethod do-tex-scroll! ocean ((obj ocean)) +(defmethod do-tex-scroll! ocean ((this ocean)) (when (not (paused?)) - (+! (-> obj st-scroll x) (* 8.0 (seconds-per-frame))) - (set! (-> obj st-scroll y) (- (-> obj st-scroll y) (* 8.0 (seconds-per-frame)))) - (if (< 128.0 (-> obj st-scroll x)) - (+! (-> obj st-scroll x) -128.0) + (+! (-> this st-scroll x) (* 8.0 (seconds-per-frame))) + (set! (-> this st-scroll y) (- (-> this st-scroll y) (* 8.0 (seconds-per-frame)))) + (if (< 128.0 (-> this st-scroll x)) + (+! (-> this st-scroll x) -128.0) ) - (if (< (-> obj st-scroll y) 0.0) - (+! (-> obj st-scroll y) 128.0) + (if (< (-> this st-scroll y) 0.0) + (+! (-> this st-scroll y) 128.0) ) ) - (set! (-> obj uv-scroll-0 x) (the int (* 16.0 (-> obj st-scroll x)))) - (set! (-> obj uv-scroll-0 y) (the int (* 16.0 (+ 256.0 (-> obj st-scroll y))))) - (set! (-> obj uv-scroll-1 x) (the int (* 16.0 (+ 256.0 (-> obj st-scroll x))))) - (set! (-> obj uv-scroll-1 y) (the int (* 16.0 (-> obj st-scroll y)))) + (set! (-> this uv-scroll-0 x) (the int (* 16.0 (-> this st-scroll x)))) + (set! (-> this uv-scroll-0 y) (the int (* 16.0 (+ 256.0 (-> this st-scroll y))))) + (set! (-> this uv-scroll-1 x) (the int (* 16.0 (+ 256.0 (-> this st-scroll x))))) + (set! (-> this uv-scroll-1 y) (the int (* 16.0 (-> this st-scroll y)))) 0 (none) ) -(defmethod ocean-method-81 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-81 ocean ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 53 128 128 0 0) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -327,13 +327,13 @@ (texflush 0) ) (let ((v1-17 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-17 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-17 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-17 2 quad) (-> obj color80808080 quad)) - (set! (-> v1-17 3 quad) (-> obj uv00 quad)) - (set! (-> v1-17 4 quad) (-> obj xy00 quad)) - (set! (-> v1-17 5 quad) (-> obj uv8080 quad)) - (set! (-> v1-17 6 quad) (-> obj xy8080 quad)) + (set! (-> v1-17 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-17 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-17 2 quad) (-> this color80808080 quad)) + (set! (-> v1-17 3 quad) (-> this uv00 quad)) + (set! (-> v1-17 4 quad) (-> this xy00 quad)) + (set! (-> v1-17 5 quad) (-> this uv8080 quad)) + (set! (-> v1-17 6 quad) (-> this xy8080 quad)) ) (&+! (-> arg0 base) 112) (dma-buffer-add-gs-set arg0 @@ -343,9 +343,9 @@ (trxdir (new 'static 'gs-trxdir)) ) (let ((v1-23 (the-as object (-> arg0 base)))) - (set! (-> (the-as (inline-array vector4w) v1-23) 0 quad) (-> obj clut-tmpl dma-vif quad)) - (set! (-> (the-as (inline-array vector4w) v1-23) 1 quad) (-> obj clut-tmpl quad 1)) - (ocean-method-80 obj (the-as (pointer rgba) (&+ (the-as pointer v1-23) 32))) + (set! (-> (the-as (inline-array vector4w) v1-23) 0 quad) (-> this clut-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-23) 1 quad) (-> this clut-tmpl quad 1)) + (ocean-method-80 this (the-as (pointer rgba) (&+ (the-as pointer v1-23) 32))) ) (&+! (-> arg0 base) 1056) (set-display-gs-state arg0 85 128 128 0 0) @@ -368,13 +368,13 @@ (texflush 0) ) (let ((v1-40 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-40 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) - (set! (-> v1-40 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set! (-> v1-40 0 quad) (-> this sprite-tmpl3 dma-vif quad)) + (set! (-> v1-40 1 quad) (-> this sprite-tmpl3 quad 1)) (set-vector! (-> v1-40 2) 96 96 96 128) - (set! (-> v1-40 3 quad) (-> obj uv00 quad)) - (set! (-> v1-40 4 quad) (-> obj xy00 quad)) - (set! (-> v1-40 5 quad) (-> obj uv8080 quad)) - (set! (-> v1-40 6 quad) (-> obj xy8080 quad)) + (set! (-> v1-40 3 quad) (-> this uv00 quad)) + (set! (-> v1-40 4 quad) (-> this xy00 quad)) + (set! (-> v1-40 5 quad) (-> this uv8080 quad)) + (set! (-> v1-40 6 quad) (-> this xy8080 quad)) ) (&+! (-> arg0 base) 112) (dma-buffer-add-gs-set arg0 @@ -383,13 +383,13 @@ (texflush 0) ) (let ((v1-46 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-46 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) - (set! (-> v1-46 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set! (-> v1-46 0 quad) (-> this sprite-tmpl3 dma-vif quad)) + (set! (-> v1-46 1 quad) (-> this sprite-tmpl3 quad 1)) (set-vector! (-> v1-46 2) 64 64 64 64) - (set! (-> v1-46 3 quad) (-> obj uv-scroll-0 quad)) - (set! (-> v1-46 4 quad) (-> obj xy00 quad)) - (set! (-> v1-46 5 quad) (-> obj uv-scroll-1 quad)) - (set! (-> v1-46 6 quad) (-> obj xy8080 quad)) + (set! (-> v1-46 3 quad) (-> this uv-scroll-0 quad)) + (set! (-> v1-46 4 quad) (-> this xy00 quad)) + (set! (-> v1-46 5 quad) (-> this uv-scroll-1 quad)) + (set! (-> v1-46 6 quad) (-> this xy8080 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 21 128 128 0 0) @@ -400,13 +400,13 @@ (texflush 0) ) (let ((v1-63 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-63 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) - (set! (-> v1-63 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set! (-> v1-63 0 quad) (-> this sprite-tmpl3 dma-vif quad)) + (set! (-> v1-63 1 quad) (-> this sprite-tmpl3 quad 1)) (set-vector! (-> v1-63 2) 128 128 128 64) - (set! (-> v1-63 3 quad) (-> obj uv-scroll-0 quad)) - (set! (-> v1-63 4 quad) (-> obj xy00 quad)) - (set! (-> v1-63 5 quad) (-> obj uv-scroll-1 quad)) - (set! (-> v1-63 6 quad) (-> obj xy8080 quad)) + (set! (-> v1-63 3 quad) (-> this uv-scroll-0 quad)) + (set! (-> v1-63 4 quad) (-> this xy00 quad)) + (set! (-> v1-63 5 quad) (-> this uv-scroll-1 quad)) + (set! (-> v1-63 6 quad) (-> this xy8080 quad)) ) (&+! (-> arg0 base) 112) (let ((s5-1 128) @@ -464,7 +464,7 @@ 0 ) -(defmethod draw-envmap-debug ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-envmap-debug ocean ((this ocean) (arg0 dma-buffer)) (format *stdcon* "draw-envmap-debug~%") (-> arg0 base) (dma-buffer-add-gs-set arg0 @@ -483,12 +483,12 @@ (texflush 0) ) (let ((v1-20 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-20 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-20 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-20 2 quad) (-> obj color80808080 quad)) - (set! (-> v1-20 3 quad) (-> obj uv00 quad)) + (set! (-> v1-20 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-20 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-20 2 quad) (-> this color80808080 quad)) + (set! (-> v1-20 3 quad) (-> this uv00 quad)) (set-vector! (-> v1-20 4) #x7b50 #x8000 #xffffff 0) - (set! (-> v1-20 5 quad) (-> obj uv4040 quad)) + (set! (-> v1-20 5 quad) (-> this uv4040 quad)) (set-vector! (-> v1-20 6) #x7f60 #x8400 #xffffff 0) ) (&+! (-> arg0 base) 112) @@ -503,12 +503,12 @@ (texflush 0) ) (let ((v1-44 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-44 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-44 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-44 2 quad) (-> obj color80808080 quad)) - (set! (-> v1-44 3 quad) (-> obj uv00 quad)) + (set! (-> v1-44 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-44 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-44 2 quad) (-> this color80808080 quad)) + (set! (-> v1-44 3 quad) (-> this uv00 quad)) (set-vector! (-> v1-44 4) #x8000 #x8000 #xffffff 0) - (set! (-> v1-44 5 quad) (-> obj uv4040 quad)) + (set! (-> v1-44 5 quad) (-> this uv4040 quad)) (set-vector! (-> v1-44 6) #x8820 #x8400 #xffffff 0) ) (&+! (-> arg0 base) 112) @@ -516,7 +516,7 @@ (none) ) -(defmethod ocean-method-83 ocean ((obj ocean) (arg0 dma-buffer) (arg1 float)) +(defmethod ocean-method-83 ocean ((this ocean) (arg0 dma-buffer) (arg1 float)) (let* ((s4-0 64) (s3-0 0) (f30-0 (/ -65536.0 (the float s4-0))) @@ -536,8 +536,8 @@ (texflush 0) ) (let ((v1-16 (-> arg0 base))) - (set! (-> (the-as (pointer uint128) v1-16)) (-> obj line-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-16) 1) (-> obj line-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) v1-16)) (-> this line-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-16) 1) (-> this line-tmpl quad 1)) ) (&+! (-> arg0 base) 32) (dotimes (s2-1 s4-0) @@ -545,8 +545,8 @@ (let ((f26-1 (+ 0.5 (* 0.5 (sin f28-0)))) (f0-5 (+ 0.5 (* 0.5 (cos f28-0)))) ) - (set! (-> (the-as (inline-array vector4w) s1-1) 0 quad) (-> obj color80808000 quad)) - (set! (-> (the-as (inline-array vector4w) s1-1) 1 quad) (-> obj st0505 quad)) + (set! (-> (the-as (inline-array vector4w) s1-1) 0 quad) (-> this color80808000 quad)) + (set! (-> (the-as (inline-array vector4w) s1-1) 1 quad) (-> this st0505 quad)) (set-vector! (-> (the-as (inline-array vector4w) s1-1) 2) s3-0 0 #xffffff 0) (set-vector! (-> (the-as (inline-array vector4w) s1-1) 3) @@ -567,7 +567,7 @@ (none) ) -(defmethod ocean-method-84 ocean ((obj ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) +(defmethod ocean-method-84 ocean ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) (when (>= (-> arg1 sun 0 pos y) -150.0) (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) @@ -587,13 +587,13 @@ (t0-2 (the int t0-1)) (t1-0 (the-as (inline-array vector4w) (-> arg0 base))) ) - (set! (-> t1-0 0 quad) (-> obj sun-tmpl dma-vif quad)) - (set! (-> t1-0 1 quad) (-> obj sun-tmpl quad 1)) + (set! (-> t1-0 0 quad) (-> this sun-tmpl dma-vif quad)) + (set! (-> t1-0 1 quad) (-> this sun-tmpl quad 1)) (set! (-> t1-0 2 quad) (-> arg2 quad)) (set! (-> t1-0 2 w) (the int (* 128.0 f0-6))) - (set! (-> t1-0 3 quad) (-> obj st0000 quad)) + (set! (-> t1-0 3 quad) (-> this st0000 quad)) (set-vector! (-> t1-0 4) (- v1-14 t0-2) (- a2-3 t0-2) #xffffff 0) - (set! (-> t1-0 5 quad) (-> obj st1010 quad)) + (set! (-> t1-0 5 quad) (-> this st1010 quad)) (set-vector! (-> t1-0 6) (+ v1-14 t0-2) (+ a2-3 t0-2) #xffffff 0) ) (&+! (-> arg0 base) 112) @@ -602,12 +602,12 @@ (none) ) -(defmethod ocean-method-85 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-85 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 vector4w) (sv-64 vector4w)) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x2 :d #x1))) (let ((v1-3 (-> arg0 base))) - (set! (-> (the-as (pointer uint128) v1-3)) (-> obj haze-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-3) 1) (-> obj haze-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) v1-3)) (-> this haze-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-3) 1) (-> this haze-tmpl quad 1)) ) (&+! (-> arg0 base) 32) (let ((f30-0 0.0) @@ -618,8 +618,8 @@ ) (dotimes (s1-0 16) (let ((s0-0 (the-as object (-> arg0 base)))) - (set! sv-48 (-> obj haze-verts (* s1-0 2))) - (set! sv-64 (-> obj haze-verts (+ (* s1-0 2) 1))) + (set! sv-48 (-> this haze-verts (* s1-0 2))) + (set! sv-64 (-> this haze-verts (+ (* s1-0 2) 1))) (let ((f0-1 (+ -1024.0 (the float (-> sv-48 x)))) (f1-3 (+ -1024.0 (the float (-> sv-48 y)))) (v1-22 s2-0) @@ -629,7 +629,7 @@ (set! (-> v1-22 pos z) f1-3) (set! (-> v1-22 pos w) 1.0) ) - (add-colors! obj s3-0 s2-0) + (add-colors! this s3-0 s2-0) (vector-float*! s3-0 s3-0 0.25) (set-vector! (-> (the-as (inline-array vector4w) s0-0) 0) @@ -663,7 +663,7 @@ (none) ) -(defmethod ocean-method-86 ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod ocean-method-86 ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (local-vars (v1-1 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -687,9 +687,9 @@ (.lvf vf2 (&-> v1-0 quad)) ) (.lvf vf7 (&-> arg1 quad)) - (.lvf vf4 (&-> obj cloud-lights sun0-normal quad)) - (.lvf vf5 (&-> obj cloud-lights sun1-normal quad)) - (.lvf vf6 (&-> obj cloud-lights moon-normal quad)) + (.lvf vf4 (&-> this cloud-lights sun0-normal quad)) + (.lvf vf5 (&-> this cloud-lights sun1-normal quad)) + (.lvf vf6 (&-> this cloud-lights moon-normal quad)) (.mul.vf vf8 vf4 vf7) (.mul.vf vf9 vf5 vf7) (.mul.vf vf10 vf6 vf7) @@ -707,8 +707,8 @@ (.max.vf vf8 vf8 vf0) (.max.vf vf9 vf9 vf0) (.max.vf vf10 vf10 vf0) - (.lvf vf12 (&-> obj cloud-lights sun1-color quad)) - (.lvf vf13 (&-> obj cloud-lights moon-color quad)) + (.lvf vf12 (&-> this cloud-lights sun1-color quad)) + (.lvf vf13 (&-> this cloud-lights moon-color quad)) (.mul.w.vf acc vf3 vf0) (.add.mul.x.vf acc vf11 vf8 acc) (.add.mul.x.vf acc vf12 vf9 acc) @@ -724,14 +724,14 @@ ) ) -(defmethod ocean-method-87 ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod ocean-method-87 ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (f28-0 0.00390625) (f30-0 0.015625) ) - (let ((s3-0 (-> obj cloud-lights))) + (let ((s3-0 (-> this cloud-lights))) (set! (-> arg0 quad) (-> arg1 quad)) (vector--float*! s5-0 arg2 (-> s3-0 sun0-normal) 9.0) (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) @@ -747,7 +747,7 @@ (none) ) -(defmethod ocean-method-88 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-88 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 vector) (sv-64 uint) (sv-80 vector) (sv-96 vector) (sv-112 vector)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test @@ -782,7 +782,7 @@ (dotimes (v1-19 6) (dotimes (a0-10 6) (set-vector! - (-> obj cloud-st0 (+ (* 6 v1-19) a0-10)) + (-> this cloud-st0 (+ (* 6 v1-19) a0-10)) (+ (* 0.5 (the float a0-10)) f0-1) (+ (* 0.5 (the float v1-19)) f1-3) 1.0 @@ -793,7 +793,7 @@ ) (let ((s4-1 (new 'stack-no-clear 'vector)) (s3-1 (new 'stack-no-clear 'vector)) - (s2-2 (-> obj cloud-lights)) + (s2-2 (-> this cloud-lights)) ) (vector-float*! (-> s2-2 sun0-color) (-> s2-2 sun0-color) 0.25) (vector-float*! (-> s2-2 sun0-color-lower) (-> s2-2 sun0-color-lower) 0.25) @@ -802,17 +802,17 @@ (vector-float*! (-> s2-2 ambi-color) (-> s2-2 ambi-color) 0.25) (vector-float*! (-> s2-2 ambi-color-lower) (-> s2-2 ambi-color-lower) 0.25) (dotimes (s1-0 36) - (let ((v1-36 (-> obj cloud-verts s1-0))) - (set! sv-80 (-> obj cloud-nrms s1-0)) - (let ((s0-0 (-> obj cloud-col0 s1-0))) - (set! sv-48 (-> obj cloud-col1 s1-0)) - (set! sv-112 (-> obj cloud-st0 s1-0)) - (set! sv-96 (-> obj cloud-st1 s1-0)) - (set! sv-64 (-> obj cloud-alpha s1-0)) + (let ((v1-36 (-> this cloud-verts s1-0))) + (set! sv-80 (-> this cloud-nrms s1-0)) + (let ((s0-0 (-> this cloud-col0 s1-0))) + (set! sv-48 (-> this cloud-col1 s1-0)) + (set! sv-112 (-> this cloud-st0 s1-0)) + (set! sv-96 (-> this cloud-st1 s1-0)) + (set! sv-64 (-> this cloud-alpha s1-0)) (set! (-> s4-1 x) (* 0.140625 (+ -1024.0 (the float (-> v1-36 x))))) (set! (-> s4-1 z) (* 0.140625 (+ -1024.0 (the float (-> v1-36 z))))) (vector-negate! s3-1 sv-80) - (let ((a0-41 obj) + (let ((a0-41 this) (t9-3 (method-of-type ocean ocean-method-86)) (a1-19 s0-0) (a3-0 (-> s2-2 sun0-color)) @@ -820,12 +820,12 @@ ) (t9-3 a0-41 a1-19 sv-80 a3-0 t0-0) ) - (ocean-method-86 obj sv-48 s3-1 (-> s2-2 sun0-color-lower) (-> s2-2 ambi-color-lower)) + (ocean-method-86 this sv-48 s3-1 (-> s2-2 sun0-color-lower) (-> s2-2 ambi-color-lower)) (set! (-> s0-0 w) (the-as float sv-64)) ) ) (set! (-> sv-48 w) (the-as float sv-64)) - (let ((a0-44 obj) + (let ((a0-44 this) (t9-5 (method-of-type ocean ocean-method-87)) (a3-2 s4-1) ) @@ -835,8 +835,8 @@ ) (dotimes (v1-46 5) (let ((a0-45 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> a0-45 0 quad) (-> obj cloud-tmpl dma-vif quad)) - (set! (-> a0-45 1 quad) (-> obj cloud-tmpl quad 1)) + (set! (-> a0-45 0 quad) (-> this cloud-tmpl dma-vif quad)) + (set! (-> a0-45 1 quad) (-> this cloud-tmpl quad 1)) ) (&+! (-> arg0 base) 32) (dotimes (a0-48 6) @@ -844,20 +844,20 @@ (a2-7 (+ (* 6 (+ v1-46 1)) a0-48)) (a1-28 (the-as (inline-array vector4w) (-> arg0 base))) ) - (set! (-> a1-28 0 quad) (-> obj cloud-col0 a3-3 quad)) - (set! (-> a1-28 1 quad) (-> obj cloud-st0 a3-3 quad)) - (set! (-> a1-28 2 quad) (-> obj cloud-verts a3-3 quad)) - (set! (-> a1-28 3 quad) (-> obj cloud-col0 a2-7 quad)) - (set! (-> a1-28 4 quad) (-> obj cloud-st0 a2-7 quad)) - (set! (-> a1-28 5 quad) (-> obj cloud-verts a2-7 quad)) + (set! (-> a1-28 0 quad) (-> this cloud-col0 a3-3 quad)) + (set! (-> a1-28 1 quad) (-> this cloud-st0 a3-3 quad)) + (set! (-> a1-28 2 quad) (-> this cloud-verts a3-3 quad)) + (set! (-> a1-28 3 quad) (-> this cloud-col0 a2-7 quad)) + (set! (-> a1-28 4 quad) (-> this cloud-st0 a2-7 quad)) + (set! (-> a1-28 5 quad) (-> this cloud-verts a2-7 quad)) ) (&+! (-> arg0 base) 96) ) ) (dotimes (v1-49 5) (let ((a0-51 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> a0-51 0 quad) (-> obj cloud-tmpl dma-vif quad)) - (set! (-> a0-51 1 quad) (-> obj cloud-tmpl quad 1)) + (set! (-> a0-51 0 quad) (-> this cloud-tmpl dma-vif quad)) + (set! (-> a0-51 1 quad) (-> this cloud-tmpl quad 1)) ) (&+! (-> arg0 base) 32) (dotimes (a0-54 6) @@ -865,12 +865,12 @@ (a2-12 (+ (* 6 (+ v1-49 1)) a0-54)) (a1-37 (the-as (inline-array vector4w) (-> arg0 base))) ) - (set! (-> a1-37 0 quad) (-> obj cloud-col1 a3-13 quad)) - (set! (-> a1-37 1 quad) (-> obj cloud-st1 a3-13 quad)) - (set! (-> a1-37 2 quad) (-> obj cloud-verts a3-13 quad)) - (set! (-> a1-37 3 quad) (-> obj cloud-col1 a2-12 quad)) - (set! (-> a1-37 4 quad) (-> obj cloud-st1 a2-12 quad)) - (set! (-> a1-37 5 quad) (-> obj cloud-verts a2-12 quad)) + (set! (-> a1-37 0 quad) (-> this cloud-col1 a3-13 quad)) + (set! (-> a1-37 1 quad) (-> this cloud-st1 a3-13 quad)) + (set! (-> a1-37 2 quad) (-> this cloud-verts a3-13 quad)) + (set! (-> a1-37 3 quad) (-> this cloud-col1 a2-12 quad)) + (set! (-> a1-37 4 quad) (-> this cloud-st1 a2-12 quad)) + (set! (-> a1-37 5 quad) (-> this cloud-verts a2-12 quad)) ) (&+! (-> arg0 base) 96) ) @@ -879,20 +879,20 @@ (none) ) -(defmethod ocean-method-89 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-89 ocean ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 (the-as int (+ (-> *ocean-texture-base* vram-page) 8)) 64 64 0 0) - (vector-float*! (-> obj sky-color) (-> *time-of-day-context* current-sky-color) 0.25) - (+! (-> obj sky-color x) (* 0.5 (- (-> obj sky-color z) (-> obj sky-color x)))) - (+! (-> obj sky-color y) (* 0.5 (- (-> obj sky-color z) (-> obj sky-color y)))) + (vector-float*! (-> this sky-color) (-> *time-of-day-context* current-sky-color) 0.25) + (+! (-> this sky-color x) (* 0.5 (- (-> this sky-color z) (-> this sky-color x)))) + (+! (-> this sky-color y) (* 0.5 (- (-> this sky-color z) (-> this sky-color y)))) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) (texflush 0) ) (let ((v1-9 (the-as object (-> arg0 base)))) - (let ((a1-13 (-> obj sky-color))) - (set! (-> (the-as (inline-array vector4w) v1-9) 0 quad) (-> obj sprite-tmpl2 dma-vif quad)) - (set! (-> (the-as (inline-array vector4w) v1-9) 1 quad) (-> obj sprite-tmpl2 quad 1)) + (let ((a1-13 (-> this sky-color))) + (set! (-> (the-as (inline-array vector4w) v1-9) 0 quad) (-> this sprite-tmpl2 dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-9) 1 quad) (-> this sprite-tmpl2 quad 1)) (set-vector! (-> (the-as (inline-array vector4w) v1-9) 2) (the int (-> a1-13 x)) @@ -921,8 +921,8 @@ (texflush 0) ) (let ((v1-16 (the-as adgif-shader (-> arg0 base)))) - (set! (-> v1-16 quad 0 quad) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> v1-16 quad 1 quad) (-> obj adgif-tmpl quad 1)) + (set! (-> v1-16 quad 0 quad) (-> this adgif-tmpl dma-vif quad)) + (set! (-> v1-16 quad 1 quad) (-> this adgif-tmpl quad 1)) (let ((s4-0 (&-> v1-16 miptbp1))) (adgif-shader<-texture-simple! (the-as adgif-shader s4-0) @@ -935,7 +935,7 @@ (let ((s4-1 (-> *sky-work* upload-data)) (a3-1 (new 'stack 'vector4w)) ) - (let ((a0-28 (-> obj cloud-lights sun0-color))) + (let ((a0-28 (-> this cloud-lights sun0-color))) (set-vector! a3-1 (the int (* 128.0 (-> a0-28 x))) @@ -944,12 +944,12 @@ 1 ) ) - (ocean-method-84 obj arg0 s4-1 a3-1 80.0) + (ocean-method-84 this arg0 s4-1 a3-1 80.0) ) (let ((s4-2 (-> *sky-work* upload-data sun 1)) (a3-2 (new 'stack 'vector4w)) ) - (let ((a0-32 (-> obj cloud-lights sun1-color))) + (let ((a0-32 (-> this cloud-lights sun1-color))) (set-vector! a3-2 (the int (* 255.0 (-> a0-32 x))) @@ -958,11 +958,11 @@ 1 ) ) - (ocean-method-84 obj arg0 (the-as sky-upload-data s4-2) a3-2 64.0) + (ocean-method-84 this arg0 (the-as sky-upload-data s4-2) a3-2 64.0) ) (let ((v1-30 (the-as adgif-shader (-> arg0 base)))) - (set! (-> v1-30 quad 0 quad) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> v1-30 quad 1 quad) (-> obj adgif-tmpl quad 1)) + (set! (-> v1-30 quad 0 quad) (-> this adgif-tmpl dma-vif quad)) + (set! (-> v1-30 quad 1 quad) (-> this adgif-tmpl quad 1)) (let ((s4-3 (&-> v1-30 miptbp1))) (adgif-shader<-texture-simple! (the-as adgif-shader s4-3) @@ -975,12 +975,12 @@ (let ((a2-3 (-> *sky-work* upload-data moon)) (a3-3 (new 'static 'vector4w :x 80 :y 80 :z 80)) ) - (ocean-method-84 obj arg0 (the-as sky-upload-data a2-3) a3-3 48.0) + (ocean-method-84 this arg0 (the-as sky-upload-data a2-3) a3-3 48.0) ) - (ocean-method-85 obj arg0) - (ocean-method-88 obj arg0) + (ocean-method-85 this arg0) + (ocean-method-88 this arg0) (set-display-gs-state arg0 (the-as int (-> *ocean-envmap-texture-base* vram-page)) 64 64 0 0) - (ocean-method-83 obj arg0 32768.0) + (ocean-method-83 this arg0 32768.0) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) (tex0-1 (new 'static 'gs-tex0 @@ -998,8 +998,8 @@ ) (dma-buffer-add-gs-set arg0 (tex1-1 (new 'static 'gs-tex1)) (texflush 0)) (let ((v1-66 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-66 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-66 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-66 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-66 1 quad) (-> this sprite-tmpl quad 1)) (set-vector! (-> v1-66 2) 128 128 128 128) (set-vector! (-> v1-66 3) 8 520 0 0) (set-vector! (-> v1-66 4) 0 512 #xffffff 0) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc b/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc index 5ba8273959..e03290e4a1 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-transition.gc @@ -7,9 +7,9 @@ ;; DECOMP BEGINS -(defmethod ocean-trans-camera-masks-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) - (let ((v1-2 (- arg0 (* (-> obj mid-minz) 4))) - (a1-3 (- arg1 (* (-> obj mid-minx) 4))) +(defmethod ocean-trans-camera-masks-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) + (let ((v1-2 (- arg0 (* (-> this mid-minz) 4))) + (a1-3 (- arg1 (* (-> this mid-minx) 4))) ) (cond ((or (< v1-2 0) (>= v1-2 (the-as uint 16)) (< a1-3 0) (>= a1-3 (the-as uint 16))) @@ -22,16 +22,16 @@ (v1-3 (logand a1-3 3)) (a1-5 (+ (* t0-0 4) a3-3)) ) - (logtest? (-> (the-as (pointer uint8) (+ (+ a2-2 (* a1-5 4)) (the-as uint obj))) 2928) (ash 1 v1-3)) + (logtest? (-> (the-as (pointer uint8) (+ (+ a2-2 (* a1-5 4)) (the-as uint this))) 2928) (ash 1 v1-3)) ) ) ) ) ) -(defmethod ocean-trans-mask-ptrs-bit? ocean ((obj ocean) (arg0 int) (arg1 int)) - (let ((v1-2 (- arg0 (the-as int (* (-> obj mid-minz) 4)))) - (a1-3 (- arg1 (the-as int (* (-> obj mid-minx) 4)))) +(defmethod ocean-trans-mask-ptrs-bit? ocean ((this ocean) (arg0 int) (arg1 int)) + (let ((v1-2 (- arg0 (the-as int (* (-> this mid-minz) 4)))) + (a1-3 (- arg1 (the-as int (* (-> this mid-minx) 4)))) ) (cond ((or (< (the-as uint v1-2) 0) @@ -46,7 +46,7 @@ (a3-3 (shr a1-3 2)) (a2-2 (logand v1-2 3)) (v1-3 (logand a1-3 3)) - (a0-2 (-> obj trans-mask-ptrs (+ (* (+ (* t0-0 4) a3-3) 4) a2-2))) + (a0-2 (-> this trans-mask-ptrs (+ (* (+ (* t0-0 4) a3-3) 4) a2-2))) ) (if a0-2 (logtest? (-> (the-as (pointer int32) a0-2) 1) (ash 1 v1-3)) @@ -58,9 +58,9 @@ ) ) -(defmethod ocean-trans-mask-ptrs-set! ocean ((obj ocean) (arg0 uint) (arg1 uint)) - (let ((v1-2 (- arg0 (* (-> obj mid-minz) 4))) - (a1-3 (- arg1 (* (-> obj mid-minx) 4))) +(defmethod ocean-trans-mask-ptrs-set! ocean ((this ocean) (arg0 uint) (arg1 uint)) + (let ((v1-2 (- arg0 (* (-> this mid-minz) 4))) + (a1-3 (- arg1 (* (-> this mid-minx) 4))) ) (cond ((or (< v1-2 0) (>= v1-2 (the-as uint 16)) (< a1-3 0) (>= a1-3 (the-as uint 16))) @@ -71,7 +71,7 @@ (a2-2 (shr a1-3 2)) (v1-3 (logand v1-2 3)) (a1-4 (logand a1-3 3)) - (t0-6 (-> obj trans-mask-ptrs (+ (* (+ (* a3-3 4) a2-2) 4) v1-3))) + (t0-6 (-> this trans-mask-ptrs (+ (* (+ (* a3-3 4) a2-2) 4) v1-3))) ) (cond (t0-6 @@ -80,7 +80,7 @@ #f ) (else - (let ((a0-1 (&-> obj trans-temp-masks (+ (* a3-3 4) a2-2)))) + (let ((a0-1 (&-> this trans-temp-masks (+ (* a3-3 4) a2-2)))) (set! (-> (the-as (pointer int8) (+ v1-3 (the-as uint a0-1))) 0) (the-as int (logior (-> (the-as (pointer uint8) (+ v1-3 (the-as uint a0-1))) 0) (ash 1 a1-4))) ) @@ -99,7 +99,7 @@ ) ) -(defmethod ocean-trans-add-upload-table ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 symbol)) +(defmethod ocean-trans-add-upload-table ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 symbol)) (local-vars (v1-16 (inline-array vector4w)) (v1-18 float) @@ -126,15 +126,15 @@ (vf8 :class vf) (vf9 :class vf) ) - (when (ocean-trans-mask-ptrs-set! obj arg1 arg2) + (when (ocean-trans-mask-ptrs-set! this arg1 arg2) (let ((a2-2 (new-stack-vector0))) - (let ((v1-2 (-> obj start-corner))) + (let ((v1-2 (-> this start-corner))) (set! (-> a2-2 x) (+ (-> v1-2 x) (* 98304.0 (the float arg2)))) (set! (-> a2-2 y) (-> v1-2 y)) (set! (-> a2-2 z) (+ (-> v1-2 z) (* 98304.0 (the float arg1)))) ) (set! (-> a2-2 w) 1.0) - (ocean-mid-add-matrices obj arg0 a2-2) + (ocean-mid-add-matrices this arg0 a2-2) ) (let* ((a1-3 9) (v1-7 arg0) @@ -201,10 +201,10 @@ (.svf (&-> v1-17 2 quad) vf11) (nop!) (.svf (&-> v1-17 3 quad) vf12) - (let ((a2-16 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int a0-17)) a1-11)))) - (a3-8 (the-as uint128 (-> obj ocean-colors colors (+ a1-11 1 (* 52 (the-as int a0-17)))))) - (t0-9 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ a0-17 1))) a1-11)))) - (a0-23 (the-as uint128 (-> obj ocean-colors colors (+ a1-11 1 (* 52 (the-as int (+ a0-17 1))))))) + (let ((a2-16 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int a0-17)) a1-11)))) + (a3-8 (the-as uint128 (-> this ocean-colors colors (+ a1-11 1 (* 52 (the-as int a0-17)))))) + (t0-9 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int (+ a0-17 1))) a1-11)))) + (a0-23 (the-as uint128 (-> this ocean-colors colors (+ a1-11 1 (* 52 (the-as int (+ a0-17 1))))))) ) (.pextlb a1-14 0 a2-16) (nop!) @@ -282,15 +282,15 @@ (set! (-> v1-21 base) (&+ (the-as pointer a0-26) 16)) ) (if arg5 - (ocean-mid-add-call obj arg0 275) - (ocean-mid-add-call obj arg0 107) + (ocean-mid-add-call this arg0 275) + (ocean-mid-add-call this arg0 107) ) ) (none) ) ) -(defmethod ocean-trans-add-upload-strip ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 int)) +(defmethod ocean-trans-add-upload-strip ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 int)) (local-vars (v1-10 float) (a0-24 uint128) @@ -308,13 +308,13 @@ (vf4 :class vf) ) (let ((a2-1 (new-stack-vector0))) - (let ((v1-0 (-> obj start-corner))) + (let ((v1-0 (-> this start-corner))) (set! (-> a2-1 x) (+ (-> v1-0 x) (* 393216.0 (the float arg2)))) (set! (-> a2-1 y) (-> v1-0 y)) (set! (-> a2-1 z) (+ (-> v1-0 z) (* 393216.0 (the float arg1)))) ) (set! (-> a2-1 w) 1.0) - (ocean-mid-add-matrices obj arg0 a2-1) + (ocean-mid-add-matrices this arg0 a2-1) ) (let* ((a1-2 9) (v1-5 arg0) @@ -328,7 +328,7 @@ (set! (-> v1-5 base) (&+ (the-as pointer a0-3) 16)) ) (let ((v1-6 (the-as object (-> arg0 base)))) - (set! (-> obj trans-mask-ptrs (+ (* arg4 4) arg5)) (the-as pointer v1-6)) + (set! (-> this trans-mask-ptrs (+ (* arg4 4) arg5)) (the-as pointer v1-6)) (set! (-> (the-as vector4w v1-6) x) 10) (set! (-> (the-as vector4w v1-6) y) arg3) (set! (-> (the-as vector4w v1-6) z) 0) @@ -340,10 +340,10 @@ (set! (-> v1-9 1 quad) (-> *ocean-trans-st-table* 1 quad)) (set! (-> v1-9 2 quad) (-> *ocean-trans-st-table* 2 quad)) (set! (-> v1-9 3 quad) (-> *ocean-trans-st-table* 3 quad)) - (let ((a0-23 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) - (a1-11 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) - (a2-14 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) - (a3-9 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) + (let ((a0-23 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) + (a1-11 (the-as uint128 (-> this ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) + (a2-14 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) + (a3-9 (the-as uint128 (-> this ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) ) (.pextlb a0-24 0 a0-23) (nop!) @@ -400,13 +400,13 @@ ) (set! (-> v1-13 base) (&+ (the-as pointer a0-27) 16)) ) - (ocean-mid-add-call obj arg0 107) + (ocean-mid-add-call this arg0 107) 0 (none) ) ) -(defmethod ocean-transition-check ocean ((obj ocean) (arg0 ocean-trans-mask) (arg1 int) (arg2 int) (arg3 vector)) +(defmethod ocean-transition-check ocean ((this ocean) (arg0 ocean-trans-mask) (arg1 int) (arg2 int) (arg3 vector)) (local-vars (v1-13 float) (t0-3 float) (t0-8 float) (t0-13 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -485,34 +485,34 @@ ) ) -(defmethod ocean-make-trans-camera-masks ocean ((obj ocean) (arg0 uint) (arg1 uint) (arg2 uint) (arg3 uint)) +(defmethod ocean-make-trans-camera-masks ocean ((this ocean) (arg0 uint) (arg1 uint) (arg2 uint) (arg3 uint)) (local-vars (sv-48 ocean-trans-mask) (sv-52 vector) (sv-56 vector) (sv-60 vector)) - (set! sv-48 (the-as ocean-trans-mask (&-> obj trans-camera-masks (+ (* arg2 4) arg3)))) + (set! sv-48 (the-as ocean-trans-mask (&-> this trans-camera-masks (+ (* arg2 4) arg3)))) (set! sv-52 (-> *math-camera* trans)) (set! sv-56 (new-stack-vector0)) (set! sv-60 (new-stack-vector0)) - (set! (-> sv-56 x) (+ (-> obj start-corner x) (* 393216.0 (the float arg1)))) - (set! (-> sv-56 y) (-> obj start-corner y)) - (set! (-> sv-56 z) (+ (-> obj start-corner z) (* 393216.0 (the float arg0)))) + (set! (-> sv-56 x) (+ (-> this start-corner x) (* 393216.0 (the float arg1)))) + (set! (-> sv-56 y) (-> this start-corner y)) + (set! (-> sv-56 z) (+ (-> this start-corner z) (* 393216.0 (the float arg0)))) (set! (-> sv-56 w) 1.0) (dotimes (s5-0 4) (dotimes (s4-0 4) (set! (-> sv-60 x) (- (+ (-> sv-56 x) (* 98304.0 (the float s4-0))) (-> sv-52 x))) (set! (-> sv-60 y) (- (-> sv-56 y) (-> sv-52 y))) (set! (-> sv-60 z) (- (+ (-> sv-56 z) (* 98304.0 (the float s5-0))) (-> sv-52 z))) - (ocean-transition-check obj sv-48 s4-0 s5-0 sv-56) + (ocean-transition-check this sv-48 s4-0 s5-0 sv-56) ) ) 0 (none) ) -(defmethod ocean-trans-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) - (when (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int arg2))) - (let ((s0-0 (ocean-trans-camera-masks-bit? obj (+ arg1 -1) arg2)) - (s1-0 (ocean-trans-camera-masks-bit? obj (+ arg1 1) arg2)) - (s2-0 (ocean-trans-camera-masks-bit? obj arg1 (+ arg2 -1))) - (a0-6 (ocean-trans-camera-masks-bit? obj arg1 (+ arg2 1))) +(defmethod ocean-trans-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (when (not (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int arg2))) + (let ((s0-0 (ocean-trans-camera-masks-bit? this (+ arg1 -1) arg2)) + (s1-0 (ocean-trans-camera-masks-bit? this (+ arg1 1) arg2)) + (s2-0 (ocean-trans-camera-masks-bit? this arg1 (+ arg2 -1))) + (a0-6 (ocean-trans-camera-masks-bit? this arg1 (+ arg2 1))) (v1-7 0) ) (if s0-0 @@ -529,97 +529,97 @@ ) (cond ((= v1-7 1) - (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + (if (not (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 -1)) (the-as int arg2))) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) ) ) ((= v1-7 2) - (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + (if (not (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 1)) (the-as int arg2))) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) ) ) ((= v1-7 4) - (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + (if (not (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 -1)))) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) ) ) ((= v1-7 5) - (let ((s2-1 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) - (v1-25 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) + (let ((s2-1 (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 -1)) (the-as int arg2))) + (v1-25 (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 -1)))) ) (cond ((and s2-1 v1-25) ) (s2-1 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) ) (v1-25 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) ) (else - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-left-table*) 18 #f) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-up-left-table*) 18 #f) ) ) ) ) ((= v1-7 6) - (let ((s2-2 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) - (v1-35 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) + (let ((s2-2 (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 1)) (the-as int arg2))) + (v1-35 (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 -1)))) ) (cond ((and s2-2 v1-35) ) (s2-2 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) ) (v1-35 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) ) (else - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-left-table*) 18 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-down-left-table*) 18 #t) ) ) ) ) ((= v1-7 8) - (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + (if (not (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 1)))) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) ) ) ((= v1-7 9) - (let ((s2-3 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) - (v1-50 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) + (let ((s2-3 (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 -1)) (the-as int arg2))) + (v1-50 (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 1)))) ) (cond ((and s2-3 v1-50) ) (s2-3 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) ) (v1-50 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) ) (else - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-right-table*) 18 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-up-right-table*) 18 #t) ) ) ) ) ((= v1-7 10) - (let ((s2-4 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) - (v1-61 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) + (let ((s2-4 (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 1)) (the-as int arg2))) + (v1-61 (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 1)))) ) (cond ((and s2-4 v1-61) ) (s2-4 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) ) (v1-61 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) ) (else - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-right-table*) 18 #f) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-down-right-table*) 18 #f) ) ) ) @@ -631,14 +631,14 @@ (none) ) -(defmethod draw-ocean-transition-seams ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-transition-seams ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) - (set! sv-32 (-> obj near-minx)) - (set! sv-33 (-> obj near-maxx)) - (set! sv-34 (-> obj near-minz)) - (set! sv-35 (-> obj near-maxz)) + (set! sv-32 (-> this near-minx)) + (set! sv-33 (-> this near-maxx)) + (set! sv-34 (-> this near-minz)) + (set! sv-35 (-> this near-maxz)) (set! sv-36 (new 'stack 'sphere)) - (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 y) (-> this start-corner y)) (set! (-> sv-36 r) 69511.42) (when (and (< sv-32 sv-33) (< sv-34 sv-35)) (let ((s4-0 sv-34) @@ -649,11 +649,11 @@ (s1-0 sv-33) ) (while (>= s1-0 s2-0) - (set! (-> sv-36 x) (+ 49152.0 (* 98304.0 (the float s2-0)) (-> obj start-corner x))) - (set! (-> sv-36 z) (+ 49152.0 (* 98304.0 (the float s4-0)) (-> obj start-corner z))) + (set! (-> sv-36 x) (+ 49152.0 (* 98304.0 (the float s2-0)) (-> this start-corner x))) + (set! (-> sv-36 z) (+ 49152.0 (* 98304.0 (the float s4-0)) (-> this start-corner z))) (when (sphere-cull-for-ocean sv-36) ;; modified - (if (not (ocean-trans-camera-masks-bit? obj s4-0 s2-0)) - (ocean-trans-add-upload obj arg0 s4-0 s2-0) + (if (not (ocean-trans-camera-masks-bit? this s4-0 s2-0)) + (ocean-trans-add-upload this arg0 s4-0 s2-0) ) ) (+! s2-0 1) @@ -664,13 +664,13 @@ ) ) (dotimes (v1-28 16) - (when (nonzero? (-> obj trans-camera-masks v1-28)) + (when (nonzero? (-> this trans-camera-masks v1-28)) (dotimes (a0-12 4) - (let ((a1-8 (-> obj trans-mask-ptrs (+ (* v1-28 4) a0-12)))) + (let ((a1-8 (-> this trans-mask-ptrs (+ (* v1-28 4) a0-12)))) (if a1-8 (logior! (-> (the-as (pointer int32) a1-8) 1) - (-> (the-as (pointer uint8) (+ (+ a0-12 (* v1-28 4)) (the-as int obj))) 2992) + (-> (the-as (pointer uint8) (+ (+ a0-12 (* v1-28 4)) (the-as int this))) 2992) ) ) ) @@ -681,7 +681,7 @@ (none) ) -(defmethod ocean-trans-add-constants ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-trans-add-constants ocean ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 4) (v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) @@ -704,7 +704,7 @@ (none) ) -(defmethod draw-ocean-transition ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-transition ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) @@ -716,18 +716,18 @@ (sv-48 int) ) (dotimes (v1-0 16) - (set! (-> obj trans-camera-masks v1-0) (the-as ocean-trans-mask 0)) - (set! (-> obj near-mask-indices v1-0) (the-as uint -1)) + (set! (-> this trans-camera-masks v1-0) (the-as ocean-trans-mask 0)) + (set! (-> this near-mask-indices v1-0) (the-as uint -1)) ) (dotimes (v1-3 64) - (set! (-> obj trans-mask-ptrs v1-3) (the-as pointer #f)) + (set! (-> this trans-mask-ptrs v1-3) (the-as pointer #f)) ) - (set! sv-32 (-> obj mid-minx)) - (set! sv-33 (-> obj mid-maxx)) - (set! sv-34 (-> obj mid-minz)) - (set! sv-35 (-> obj mid-maxz)) + (set! sv-32 (-> this mid-minx)) + (set! sv-33 (-> this mid-maxx)) + (set! sv-34 (-> this mid-minz)) + (set! sv-35 (-> this mid-maxz)) (set! sv-36 (new 'stack 'sphere)) - (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 y) (-> this start-corner y)) (set! (-> sv-36 r) 278045.7) (let ((s4-0 sv-34) (s3-0 sv-35) @@ -737,12 +737,12 @@ (s1-0 sv-33) ) (while (>= s1-0 s2-0) - (when (not (ocean-mid-mask-ptrs-bit? obj s4-0 s2-0)) - (when (ocean-mid-camera-masks-bit? obj s4-0 s2-0) - (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> obj start-corner x))) - (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> obj start-corner z))) + (when (not (ocean-mid-mask-ptrs-bit? this s4-0 s2-0)) + (when (ocean-mid-camera-masks-bit? this s4-0 s2-0) + (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> this start-corner x))) + (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> this start-corner z))) (if (sphere-cull-for-ocean sv-36) ;; modified - (ocean-make-trans-camera-masks obj s4-0 s2-0 (- s4-0 sv-34) (- s2-0 sv-32)) + (ocean-make-trans-camera-masks this s4-0 s2-0 (- s4-0 sv-34) (- s2-0 sv-32)) ) ) ) @@ -765,7 +765,7 @@ (t2-0 sv-33) ) (while (>= t2-0 t1-0) - (set! sv-40 (the-as ocean-trans-mask (&-> obj trans-camera-masks (+ (* (- a3-1 sv-34) 4) (- t1-0 sv-32))))) + (set! sv-40 (the-as ocean-trans-mask (&-> this trans-camera-masks (+ (* (- a3-1 sv-34) 4) (- t1-0 sv-32))))) (when (nonzero? (-> sv-40 word)) (dotimes (t3-10 4) (let ((t4-4 (-> sv-40 mask t3-10))) @@ -800,13 +800,13 @@ (+! a3-1 1) ) ) - (set! (-> obj near-minx) (the-as uint (+ a2-3 -1))) - (set! (-> obj near-maxx) (the-as uint (+ a1-7 1))) - (set! (-> obj near-minz) (the-as uint (+ a0-11 -1))) - (set! (-> obj near-maxz) (the-as uint (+ v1-33 1))) + (set! (-> this near-minx) (the-as uint (+ a2-3 -1))) + (set! (-> this near-maxx) (the-as uint (+ a1-7 1))) + (set! (-> this near-minz) (the-as uint (+ a0-11 -1))) + (set! (-> this near-maxz) (the-as uint (+ v1-33 1))) ) (dotimes (v1-35 16) - (set! (-> obj trans-temp-masks v1-35) (the-as uint (-> obj trans-camera-masks v1-35))) + (set! (-> this trans-temp-masks v1-35) (the-as uint (-> this trans-camera-masks v1-35))) ) (let ((s4-1 sv-34) (s3-1 sv-35) @@ -816,18 +816,18 @@ (s1-1 sv-33) ) (while (>= s1-1 s2-1) - (when (not (ocean-mid-mask-ptrs-bit? obj s4-1 s2-1)) - (when (ocean-mid-camera-masks-bit? obj s4-1 s2-1) - (let ((v1-46 (-> obj ocean-trans-indices data (+ (* (the-as uint 48) s4-1) s2-1)))) + (when (not (ocean-mid-mask-ptrs-bit? this s4-1 s2-1)) + (when (ocean-mid-camera-masks-bit? this s4-1 s2-1) + (let ((v1-46 (-> this ocean-trans-indices data (+ (* (the-as uint 48) s4-1) s2-1)))) (when (>= (-> v1-46 parent) 0) (set! sv-44 (+ (* (- s4-1 sv-34) 4) (- s2-1 sv-32))) - (set! (-> obj near-mask-indices sv-44) (the-as uint (-> v1-46 child))) - (let ((s0-0 (-> obj ocean-mid-masks data (-> v1-46 parent)))) + (set! (-> this near-mask-indices sv-44) (the-as uint (-> v1-46 child))) + (let ((s0-0 (-> this ocean-mid-masks data (-> v1-46 parent)))) (set! sv-48 0) (while (< sv-48 4) (let ((t0-2 (-> s0-0 mask sv-48))) (if (!= t0-2 255) - (ocean-trans-add-upload-strip obj arg0 s4-1 s2-1 (the-as int t0-2) (the-as int sv-44) sv-48) + (ocean-trans-add-upload-strip this arg0 s4-1 s2-1 (the-as int t0-2) (the-as int sv-44) sv-48) ) ) (set! sv-48 (+ sv-48 1)) @@ -843,10 +843,10 @@ (+! s4-1 1) ) ) - (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) - (ocean-trans-add-constants obj arg0) - (draw-ocean-transition-seams obj arg0) - (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + (ocean-mid-add-call-flush this arg0 (the-as uint 41)) + (ocean-trans-add-constants this arg0) + (draw-ocean-transition-seams this arg0) + (ocean-mid-add-call-flush this arg0 (the-as uint 41)) 0 (none) ) diff --git a/goal_src/jak2/engine/gfx/ocean/ocean.gc b/goal_src/jak2/engine/gfx/ocean/ocean.gc index 61522eb6be..8c8efd546f 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean.gc @@ -9,7 +9,7 @@ ;; DECOMP BEGINS -(defmethod set-corners! ocean ((obj ocean) (corner-x float) (corner-z float)) +(defmethod set-corners! ocean ((this ocean) (corner-x float) (corner-z float)) (let* ((f2-0 (* 0.00008138021 corner-x)) (f3-0 (* 0.00008138021 corner-z)) (f0-2 f2-0) @@ -20,68 +20,68 @@ (a3-0 (logand (the int f3-0) 31)) (v1-9 (logand (+ a1-1 1) 31)) (a2-2 (logand (+ a3-0 1) 31)) - (f2-3 (-> obj heights data (+ (* a3-0 32) a1-1))) - (f3-1 (-> obj heights data (+ (* a3-0 32) v1-9))) - (f4-4 (-> obj heights data (+ (* a2-2 32) a1-1))) - (f5-0 (-> obj heights data (+ (* a2-2 32) v1-9))) + (f2-3 (-> this heights data (+ (* a3-0 32) a1-1))) + (f3-1 (-> this heights data (+ (* a3-0 32) v1-9))) + (f4-4 (-> this heights data (+ (* a2-2 32) a1-1))) + (f5-0 (-> this heights data (+ (* a2-2 32) v1-9))) (f6-1 (+ (* f3-1 f0-4) (* f2-3 (- 1.0 f0-4)))) (f0-9 (+ (* (+ (* f5-0 f0-4) (* f4-4 (- 1.0 f0-4))) f1-8) (* f6-1 (- 1.0 f1-8)))) ) - (set! (-> obj corner00) f2-3) - (set! (-> obj corner01) f3-1) - (set! (-> obj corner10) f4-4) - (set! (-> obj corner11) f5-0) + (set! (-> this corner00) f2-3) + (set! (-> this corner01) f3-1) + (set! (-> this corner10) f4-4) + (set! (-> this corner11) f5-0) f0-9 ) ) -(defmethod get-height ocean ((obj ocean) (arg0 vector) (arg1 symbol)) +(defmethod get-height ocean ((this ocean) (arg0 vector) (arg1 symbol)) (local-vars (v1-12 int)) (cond - ((and (-> obj heights) *ocean-map*) - (let* ((f30-0 (- (-> arg0 x) (-> obj start-corner x))) - (f28-0 (- (-> arg0 z) (-> obj start-corner z))) + ((and (-> this heights) *ocean-map*) + (let* ((f30-0 (- (-> arg0 x) (-> this start-corner x))) + (f28-0 (- (-> arg0 z) (-> this start-corner z))) (v1-3 (the int (* 0.0000025431316 f30-0))) (a0-2 (the int (* 0.0000025431316 f28-0))) - (v1-7 (-> obj ocean-trans-indices data (+ (* 48 a0-2) v1-3))) + (v1-7 (-> this ocean-trans-indices data (+ (* 48 a0-2) v1-3))) ) (cond ((= (-> v1-7 parent) -1) (if arg1 - (-> obj start-corner y) + (-> this start-corner y) 4095996000.0 ) ) ((begin (let ((a0-8 (logand (the int (* 0.000010172526 f30-0)) 3)) (a3-4 (logand (the int (* 0.000010172526 f28-0)) 3)) - (v1-10 (-> obj ocean-near-indices data (-> v1-7 child))) + (v1-10 (-> this ocean-near-indices data (-> v1-7 child))) ) (set! v1-12 (-> (the-as (pointer int16) (+ (* (+ (* a3-4 4) a0-8) 2) (the-as int v1-10))))) ) (= v1-12 -1) ) (if arg1 - (-> obj start-corner y) + (-> this start-corner y) 4095996000.0 ) ) (else (let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7))) (cond - ((not (logtest? (-> obj ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) (ash 1 a0-14)) + ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) (ash 1 a0-14)) ) (let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos))) (f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2)))) ) - (if (-> obj ocean-near-translucent?) - (+ (* f26-0 (set-corners! obj f30-0 f28-0)) (-> obj start-corner y)) - (-> obj start-corner y) + (if (-> this ocean-near-translucent?) + (+ (* f26-0 (set-corners! this f30-0 f28-0)) (-> this start-corner y)) + (-> this start-corner y) ) ) ) (arg1 - (-> obj start-corner y) + (-> this start-corner y) ) (else 4095996000.0 @@ -107,9 +107,9 @@ (def-mips2c render-ocean-quad (function (inline-array ocean-vertex) dma-buffer symbol)) -(defmethod add-colors! ocean ((obj ocean) (arg0 vector) (arg1 ocean-vertex)) +(defmethod add-colors! ocean ((this ocean) (arg0 vector) (arg1 ocean-vertex)) (let ((s3-0 (new 'stack-no-clear 'vector)) - (s4-0 (-> obj haze-lights)) + (s4-0 (-> this haze-lights)) ) (set! (-> s3-0 quad) (-> arg1 pos quad)) (set! (-> s3-0 y) 0.0) @@ -139,11 +139,11 @@ (none) ) -(defmethod ocean-method-60 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-60 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) - (let ((f0-0 (-> obj start-corner z))) + (let ((f0-0 (-> this start-corner z))) (let ((f1-1 (+ -5898240.0 f0-0))) (set! (-> vertices 0 pos z) f1-1) (set! (-> vertices 1 pos z) f1-1) @@ -155,12 +155,12 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 1.0) (set! (-> vertices 3 pos w) 1.0) - (set! sv-48 (-> obj start-corner x)) + (set! sv-48 (-> this start-corner x)) (set! sv-52 (new 'stack-no-clear 'vector)) (set! sv-56 (new 'stack-no-clear 'vector)) - (let ((s3-0 (-> obj ocean-colors))) + (let ((s3-0 (-> this ocean-colors))) (let ((s2-0 #f)) - (rgba-to-vector! obj sv-52 (-> s3-0 colors)) + (rgba-to-vector! this sv-52 (-> s3-0 colors)) (dotimes (s1-0 48) (let ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48))) (let ((f1-6 (+ 393216.0 f0-8))) @@ -170,7 +170,7 @@ ) (set! (-> vertices 3 pos x) f0-8) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 1) 4))) + (rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 1) 4))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) (set! (-> vertices 1 col quad) (-> sv-56 quad)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) @@ -190,7 +190,7 @@ ) ) (label cfg-9) - (let ((f0-10 (+ -5898240.0 (-> obj start-corner z)))) + (let ((f0-10 (+ -5898240.0 (-> this start-corner z)))) (let ((f1-9 (+ -5898240.0 f0-10))) (set! (-> vertices 0 pos z) f1-9) (set! (-> vertices 1 pos z) f1-9) @@ -202,9 +202,9 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.5) - (let ((s3-1 (-> obj ocean-colors))) + (let ((s3-1 (-> this ocean-colors))) (let ((s2-1 #f)) - (rgba-to-vector! obj sv-52 (-> s3-1 colors)) + (rgba-to-vector! this sv-52 (-> s3-1 colors)) (dotimes (s1-1 48) (let ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48))) (let ((f1-14 (+ 393216.0 f0-17))) @@ -214,9 +214,9 @@ ) (set! (-> vertices 3 pos x) f0-17) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 1) 4))) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 1) 4))) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) (set! (-> vertices 3 col quad) (-> sv-52 quad)) (set! (-> sv-52 quad) (-> sv-56 quad)) @@ -239,11 +239,11 @@ (none) ) -(defmethod ocean-method-61 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-61 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) - (let* ((f0-1 (+ 18874368.0 (-> obj start-corner z))) + (let* ((f0-1 (+ 18874368.0 (-> this start-corner z))) (f1-2 (+ 5898240.0 f0-1)) ) (set! (-> vertices 0 pos z) f0-1) @@ -255,12 +255,12 @@ (set! (-> vertices 1 pos w) 1.0) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.5) - (set! sv-48 (-> obj start-corner x)) + (set! sv-48 (-> this start-corner x)) (set! sv-52 (new 'stack-no-clear 'vector)) (set! sv-56 (new 'stack-no-clear 'vector)) - (let ((s3-0 (-> obj ocean-colors))) + (let ((s3-0 (-> this ocean-colors))) (let ((s2-0 #f)) - (rgba-to-vector! obj sv-52 (&-> s3-0 colors 2444)) + (rgba-to-vector! this sv-52 (&-> s3-0 colors 2444)) (dotimes (s1-0 48) (let ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48))) (let ((f1-7 (+ 393216.0 f0-9))) @@ -270,7 +270,7 @@ ) (set! (-> vertices 3 pos x) f0-9) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 2445) 4))) + (rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 2445) 4))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) (set! (-> vertices 1 col quad) (-> sv-56 quad)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) @@ -290,7 +290,7 @@ ) ) (label cfg-9) - (let* ((f0-11 (+ 24772608.0 (-> obj start-corner z))) + (let* ((f0-11 (+ 24772608.0 (-> this start-corner z))) (f1-10 (+ 5898240.0 f0-11)) ) (set! (-> vertices 0 pos z) f0-11) @@ -302,9 +302,9 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.0) - (let ((s3-1 (-> obj ocean-colors))) + (let ((s3-1 (-> this ocean-colors))) (let ((s2-1 #f)) - (rgba-to-vector! obj sv-52 (&-> s3-1 colors 2444)) + (rgba-to-vector! this sv-52 (&-> s3-1 colors 2444)) (dotimes (s1-1 48) (let ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48))) (let ((f1-15 (+ 393216.0 f0-18))) @@ -314,11 +314,11 @@ ) (set! (-> vertices 3 pos x) f0-18) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 2445) 4))) + (rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 2445) 4))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) (set! (-> vertices 1 col quad) (-> sv-56 quad)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (set! (-> sv-52 quad) (-> sv-56 quad)) (cond ((render-ocean-quad vertices arg0) @@ -339,11 +339,11 @@ (none) ) -(defmethod ocean-method-62 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-62 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) - (let* ((f0-0 (-> obj start-corner x)) + (let* ((f0-0 (-> this start-corner x)) (f1-1 (+ -5898240.0 f0-0)) ) (set! (-> vertices 0 pos x) f1-1) @@ -355,12 +355,12 @@ (set! (-> vertices 1 pos w) 1.0) (set! (-> vertices 2 pos w) 1.0) (set! (-> vertices 3 pos w) 0.5) - (set! sv-48 (-> obj start-corner z)) + (set! sv-48 (-> this start-corner z)) (set! sv-52 (new 'stack-no-clear 'vector)) (set! sv-56 (new 'stack-no-clear 'vector)) - (let ((s3-0 (-> obj ocean-colors))) + (let ((s3-0 (-> this ocean-colors))) (let ((s2-0 #f)) - (rgba-to-vector! obj sv-52 (-> s3-0 colors)) + (rgba-to-vector! this sv-52 (-> s3-0 colors)) (dotimes (s1-0 48) (let* ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48)) (f1-6 (+ 393216.0 f0-8)) @@ -370,7 +370,7 @@ (set! (-> vertices 2 pos z) f1-6) (set! (-> vertices 3 pos z) f1-6) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* 208 (+ s1-0 1)))) + (rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* 208 (+ s1-0 1)))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) (set! (-> vertices 1 col quad) (-> sv-52 quad)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) @@ -390,7 +390,7 @@ ) ) (label cfg-9) - (let* ((f0-10 (+ -5898240.0 (-> obj start-corner x))) + (let* ((f0-10 (+ -5898240.0 (-> this start-corner x))) (f1-9 (+ -5898240.0 f0-10)) ) (set! (-> vertices 0 pos x) f1-9) @@ -402,9 +402,9 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.0) - (let ((s3-1 (-> obj ocean-colors))) + (let ((s3-1 (-> this ocean-colors))) (let ((s2-1 #f)) - (rgba-to-vector! obj sv-52 (-> s3-1 colors)) + (rgba-to-vector! this sv-52 (-> s3-1 colors)) (dotimes (s1-1 48) (let* ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48)) (f1-14 (+ 393216.0 f0-17)) @@ -414,11 +414,11 @@ (set! (-> vertices 2 pos z) f1-14) (set! (-> vertices 3 pos z) f1-14) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* 208 (+ s1-1 1)))) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* 208 (+ s1-1 1)))) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) (set! (-> vertices 1 col quad) (-> sv-52 quad)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (set! (-> sv-52 quad) (-> sv-56 quad)) (cond ((render-ocean-quad vertices arg0) @@ -439,11 +439,11 @@ (none) ) -(defmethod ocean-method-63 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-63 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) - (let ((f0-1 (+ 18874368.0 (-> obj start-corner x)))) + (let ((f0-1 (+ 18874368.0 (-> this start-corner x)))) (let ((f1-2 (+ 5898240.0 f0-1))) (set! (-> vertices 0 pos x) f0-1) (set! (-> vertices 1 pos x) f1-2) @@ -455,12 +455,12 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 1.0) - (set! sv-48 (-> obj start-corner z)) + (set! sv-48 (-> this start-corner z)) (set! sv-52 (new 'stack-no-clear 'vector)) (set! sv-56 (new 'stack-no-clear 'vector)) - (let ((s3-0 (-> obj ocean-colors))) + (let ((s3-0 (-> this ocean-colors))) (let ((s2-0 #f)) - (rgba-to-vector! obj sv-52 (&-> s3-0 colors 47)) + (rgba-to-vector! this sv-52 (&-> s3-0 colors 47)) (dotimes (s1-0 48) (let* ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48)) (f1-7 (+ 393216.0 f0-9)) @@ -470,7 +470,7 @@ (set! (-> vertices 2 pos z) f1-7) (set! (-> vertices 3 pos z) f1-7) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ (* 52 (+ s1-0 1)) 47) 4))) + (rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ (* 52 (+ s1-0 1)) 47) 4))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) (set! (-> vertices 1 col quad) (-> sv-52 quad)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) @@ -490,7 +490,7 @@ ) ) (label cfg-9) - (let ((f0-11 (+ 24772608.0 (-> obj start-corner x)))) + (let ((f0-11 (+ 24772608.0 (-> this start-corner x)))) (let ((f1-10 (+ 5898240.0 f0-11))) (set! (-> vertices 0 pos x) f0-11) (set! (-> vertices 1 pos x) f1-10) @@ -502,9 +502,9 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.5) - (let ((s3-1 (-> obj ocean-colors))) + (let ((s3-1 (-> this ocean-colors))) (let ((s2-1 #f)) - (rgba-to-vector! obj sv-52 (&-> s3-1 colors 47)) + (rgba-to-vector! this sv-52 (&-> s3-1 colors 47)) (dotimes (s1-1 48) (let* ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48)) (f1-15 (+ 393216.0 f0-18)) @@ -514,10 +514,10 @@ (set! (-> vertices 2 pos z) f1-15) (set! (-> vertices 3 pos z) f1-15) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ (* 52 (+ s1-1 1)) 47) 4))) + (rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ (* 52 (+ s1-1 1)) 47) 4))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) (set! (-> vertices 3 col quad) (-> sv-56 quad)) (set! (-> sv-52 quad) (-> sv-56 quad)) (cond @@ -539,17 +539,17 @@ (none) ) -(defmethod ocean-method-64 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-64 ocean ((this ocean) (arg0 dma-buffer)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) - (let* ((v1-1 (-> obj ocean-colors)) - (f30-0 (-> obj start-corner x)) - (f28-0 (-> obj start-corner z)) + (let* ((v1-1 (-> this ocean-colors)) + (f30-0 (-> this start-corner x)) + (f28-0 (-> this start-corner z)) (f26-0 (+ -5898240.0 f30-0)) (f24-0 (+ -5898240.0 f28-0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (rgba-to-vector! obj s3-0 (-> v1-1 colors)) + (rgba-to-vector! this s3-0 (-> v1-1 colors)) (set! (-> vertices 0 pos x) f26-0) (set! (-> vertices 1 pos x) f30-0) (set! (-> vertices 2 pos x) f30-0) @@ -567,8 +567,8 @@ (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let ((f0-7 (+ -5898240.0 (-> obj start-corner x))) - (f1-1 (-> obj start-corner z)) + (let ((f0-7 (+ -5898240.0 (-> this start-corner x))) + (f1-1 (-> this start-corner z)) ) (let ((f2-1 (+ -5898240.0 f0-7)) (f3-1 (+ -5898240.0 f1-1)) @@ -587,13 +587,13 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.0) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) (set! (-> vertices 1 col quad) (-> s3-0 quad)) (set! (-> vertices 2 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) - (let ((f0-13 (+ -5898240.0 (-> obj start-corner x))) - (f1-4 (+ -5898240.0 (-> obj start-corner z))) + (let ((f0-13 (+ -5898240.0 (-> this start-corner x))) + (f1-4 (+ -5898240.0 (-> this start-corner z))) ) (let ((f2-4 (+ -5898240.0 f0-13)) (f3-3 (+ -5898240.0 f1-4)) @@ -612,13 +612,13 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.0) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) (set! (-> vertices 2 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) - (let ((f0-18 (-> obj start-corner x)) - (f1-6 (+ -5898240.0 (-> obj start-corner z))) + (let ((f0-18 (-> this start-corner x)) + (f1-6 (+ -5898240.0 (-> this start-corner z))) ) (let ((f2-7 (+ -5898240.0 f0-18)) (f3-5 (+ -5898240.0 f1-6)) @@ -637,8 +637,8 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.5) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) - (add-colors! obj (-> vertices 1 col) (-> vertices 2)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 1 col) (-> vertices 2)) (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) ) @@ -648,17 +648,17 @@ (none) ) -(defmethod ocean-method-65 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-65 ocean ((this ocean) (arg0 dma-buffer)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) - (let* ((v1-1 (-> obj ocean-colors)) - (f30-0 (+ 18874368.0 (-> obj start-corner x))) - (f28-0 (-> obj start-corner z)) + (let* ((v1-1 (-> this ocean-colors)) + (f30-0 (+ 18874368.0 (-> this start-corner x))) + (f28-0 (-> this start-corner z)) (f26-0 (+ 5898240.0 f30-0)) (f24-0 (+ -5898240.0 f28-0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (rgba-to-vector! obj s3-0 (&-> v1-1 colors 47)) + (rgba-to-vector! this s3-0 (&-> v1-1 colors 47)) (set! (-> vertices 0 pos x) f30-0) (set! (-> vertices 1 pos x) f26-0) (set! (-> vertices 2 pos x) f26-0) @@ -676,8 +676,8 @@ (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let ((f0-8 (+ 24772608.0 (-> obj start-corner x))) - (f1-2 (-> obj start-corner z)) + (let ((f0-8 (+ 24772608.0 (-> this start-corner x))) + (f1-2 (-> this start-corner z)) ) (let ((f2-1 (+ 5898240.0 f0-8)) (f3-1 (+ -5898240.0 f1-2)) @@ -697,12 +697,12 @@ (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.5) (set! (-> vertices 0 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let ((f0-14 (+ 18874368.0 (-> obj start-corner x))) - (f1-5 (+ -5898240.0 (-> obj start-corner z))) + (let ((f0-14 (+ 18874368.0 (-> this start-corner x))) + (f1-5 (+ -5898240.0 (-> this start-corner z))) ) (let ((f2-4 (+ 5898240.0 f0-14)) (f3-3 (+ -5898240.0 f1-5)) @@ -721,13 +721,13 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.5) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let ((f0-20 (+ 24772608.0 (-> obj start-corner x))) - (f1-8 (+ -5898240.0 (-> obj start-corner z))) + (let ((f0-20 (+ 24772608.0 (-> this start-corner x))) + (f1-8 (+ -5898240.0 (-> this start-corner z))) ) (let ((f2-7 (+ 5898240.0 f0-20)) (f3-5 (+ -5898240.0 f1-8)) @@ -746,9 +746,9 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.5) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) ) (render-ocean-quad vertices arg0) @@ -757,17 +757,17 @@ (none) ) -(defmethod ocean-method-66 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-66 ocean ((this ocean) (arg0 dma-buffer)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) - (let* ((v1-1 (-> obj ocean-colors)) - (f30-0 (-> obj start-corner x)) - (f28-0 (+ 18874368.0 (-> obj start-corner z))) + (let* ((v1-1 (-> this ocean-colors)) + (f30-0 (-> this start-corner x)) + (f28-0 (+ 18874368.0 (-> this start-corner z))) (f26-0 (+ -5898240.0 f30-0)) (f24-0 (+ 5898240.0 f28-0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (rgba-to-vector! obj s3-0 (&-> v1-1 colors 2444)) + (rgba-to-vector! this s3-0 (&-> v1-1 colors 2444)) (set! (-> vertices 0 pos x) f26-0) (set! (-> vertices 1 pos x) f30-0) (set! (-> vertices 2 pos x) f30-0) @@ -785,8 +785,8 @@ (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let* ((f0-8 (+ -5898240.0 (-> obj start-corner x))) - (f1-3 (+ 18874368.0 (-> obj start-corner z))) + (let* ((f0-8 (+ -5898240.0 (-> this start-corner x))) + (f1-3 (+ 18874368.0 (-> this start-corner z))) (f2-2 (+ -5898240.0 f0-8)) (f3-1 (+ 5898240.0 f1-3)) ) @@ -803,13 +803,13 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.0) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) (set! (-> vertices 1 col quad) (-> s3-0 quad)) (set! (-> vertices 2 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) - (let* ((f0-14 (+ -5898240.0 (-> obj start-corner x))) - (f1-6 (+ 24772608.0 (-> obj start-corner z))) + (let* ((f0-14 (+ -5898240.0 (-> this start-corner x))) + (f1-6 (+ 24772608.0 (-> this start-corner z))) (f2-5 (+ -5898240.0 f0-14)) (f3-3 (+ 5898240.0 f1-6)) ) @@ -826,13 +826,13 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.0) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) (set! (-> vertices 1 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) - (let* ((f0-19 (-> obj start-corner x)) - (f1-8 (+ 24772608.0 (-> obj start-corner z))) + (let* ((f0-19 (-> this start-corner x)) + (f1-8 (+ 24772608.0 (-> this start-corner z))) (f2-8 (+ -5898240.0 f0-19)) (f3-5 (+ 5898240.0 f1-8)) ) @@ -852,25 +852,25 @@ (set! (-> vertices 0 col quad) (-> s3-0 quad)) (set! (-> vertices 1 col quad) (-> s3-0 quad)) ) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) ) 0 (none) ) -(defmethod ocean-method-67 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-67 ocean ((this ocean) (arg0 dma-buffer)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) - (let* ((v1-1 (-> obj ocean-colors)) - (f30-0 (+ 18874368.0 (-> obj start-corner x))) - (f28-0 (+ 18874368.0 (-> obj start-corner z))) + (let* ((v1-1 (-> this ocean-colors)) + (f30-0 (+ 18874368.0 (-> this start-corner x))) + (f28-0 (+ 18874368.0 (-> this start-corner z))) (f26-0 (+ 5898240.0 f30-0)) (f24-0 (+ 5898240.0 f28-0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (rgba-to-vector! obj s3-0 (&-> v1-1 colors 2491)) + (rgba-to-vector! this s3-0 (&-> v1-1 colors 2491)) (set! (-> vertices 0 pos x) f30-0) (set! (-> vertices 1 pos x) f26-0) (set! (-> vertices 2 pos x) f26-0) @@ -888,8 +888,8 @@ (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let* ((f0-9 (+ 24772608.0 (-> obj start-corner x))) - (f1-4 (+ 18874368.0 (-> obj start-corner z))) + (let* ((f0-9 (+ 24772608.0 (-> this start-corner x))) + (f1-4 (+ 18874368.0 (-> this start-corner z))) (f2-2 (+ 5898240.0 f0-9)) (f3-1 (+ 5898240.0 f1-4)) ) @@ -907,12 +907,12 @@ (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.5) (set! (-> vertices 0 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let* ((f0-15 (+ 18874368.0 (-> obj start-corner x))) - (f1-7 (+ 24772608.0 (-> obj start-corner z))) + (let* ((f0-15 (+ 18874368.0 (-> this start-corner x))) + (f1-7 (+ 24772608.0 (-> this start-corner z))) (f2-5 (+ 5898240.0 f0-15)) (f3-3 (+ 5898240.0 f1-7)) ) @@ -931,11 +931,11 @@ (set! (-> vertices 3 pos w) 0.0) (set! (-> vertices 0 col quad) (-> s3-0 quad)) (set! (-> vertices 1 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) - (let* ((f0-21 (+ 24772608.0 (-> obj start-corner x))) - (f1-10 (+ 24772608.0 (-> obj start-corner z))) + (let* ((f0-21 (+ 24772608.0 (-> this start-corner x))) + (f1-10 (+ 24772608.0 (-> this start-corner z))) (f2-8 (+ 5898240.0 f0-21)) (f3-5 (+ 5898240.0 f1-10)) ) @@ -954,19 +954,19 @@ (set! (-> vertices 3 pos w) 0.0) (set! (-> vertices 0 col quad) (-> s3-0 quad)) ) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) ) 0 (none) ) -(defmethod render-ocean-far ocean ((obj ocean) (arg1 dma-buffer) (facing int)) +(defmethod render-ocean-far ocean ((this ocean) (arg1 dma-buffer) (facing int)) ;; og:preserve-this scratchpad (let ((vertices (scratchpad-object (inline-array ocean-vertex)))) - (let ((f0-0 (-> obj start-corner y))) + (let ((f0-0 (-> this start-corner y))) (set! (-> vertices 0 pos y) f0-0) (set! (-> vertices 1 pos y) f0-0) (set! (-> vertices 2 pos y) f0-0) @@ -977,20 +977,20 @@ (set-vector! (-> vertices 2 stq) 1.0 15.0 1.0 1.0) (set-vector! (-> vertices 3 stq) 0.0 15.0 1.0 1.0) (if (not (logtest? facing 2)) - (ocean-method-60 obj arg1) + (ocean-method-60 this arg1) ) (if (not (logtest? facing 4)) - (ocean-method-61 obj arg1) + (ocean-method-61 this arg1) ) (set-vector! (-> vertices 0 stq) 0.0 0.0 1.0 1.0) (set-vector! (-> vertices 1 stq) 15.0 0.0 1.0 1.0) (set-vector! (-> vertices 2 stq) 15.0 1.0 1.0 1.0) (set-vector! (-> vertices 3 stq) 0.0 1.0 1.0 1.0) (if (not (logtest? facing 16)) - (ocean-method-62 obj arg1) + (ocean-method-62 this arg1) ) (if (not (logtest? facing 8)) - (ocean-method-63 obj arg1) + (ocean-method-63 this arg1) ) (set-vector! (-> vertices 0 stq) 0.0 0.0 1.0 1.0) (set-vector! (-> vertices 1 stq) 15.0 0.0 1.0 1.0) @@ -998,39 +998,39 @@ (set-vector! (-> vertices 3 stq) 0.0 15.0 1.0 1.0) ) (if (not (or (logtest? facing 2) (logtest? facing 16))) - (ocean-method-64 obj arg1) + (ocean-method-64 this arg1) ) (if (not (or (logtest? facing 2) (logtest? facing 8))) - (ocean-method-65 obj arg1) + (ocean-method-65 this arg1) ) (if (not (or (logtest? facing 4) (logtest? facing 16))) - (ocean-method-66 obj arg1) + (ocean-method-66 this arg1) ) (if (not (or (logtest? facing 4) (logtest? facing 8))) - (ocean-method-67 obj arg1) + (ocean-method-67 this arg1) ) 0 (none) ) ;; WARN: Return type mismatch uint vs none. -(defmethod draw-ocean-far ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-far ocean ((this ocean) (arg0 dma-buffer)) (init-ocean-far-regs) (let ((gp-0 (the-as object (-> arg0 base)))) (&+! (-> arg0 base) 16) - (let ((v1-2 (-> obj ocean-facing))) + (let ((v1-2 (-> this ocean-facing))) (cond ((zero? v1-2) - (render-ocean-far obj arg0 4) + (render-ocean-far this arg0 4) ) ((= v1-2 1) - (render-ocean-far obj arg0 2) + (render-ocean-far this arg0 2) ) ((= v1-2 3) - (render-ocean-far obj arg0 8) + (render-ocean-far this arg0 8) ) ((= v1-2 2) - (render-ocean-far obj arg0 16) + (render-ocean-far this arg0 16) ) ) ) @@ -1045,13 +1045,13 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod init-buffer! ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod init-buffer! ocean ((this ocean) (arg0 dma-buffer)) "Initialize [[ocean]] DMA buffer." (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) (tex0-1 (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :th (log2 128) :tw (log2 128))) - (tex1-1 (-> obj tex1)) + (tex1-1 (-> this tex1)) (texa (new 'static 'gs-texa :ta0 #x80 :ta1 #x80)) (miptbp1-1 (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0)) (miptbp2-1 (new 'static 'gs-miptbp :tbp1 #x800 :tbp2 #x820 :tbp3 #x840)) @@ -1061,28 +1061,28 @@ (none) ) -(defmethod end-buffer! ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod end-buffer! ocean ((this ocean) (arg0 dma-buffer)) (dma-buffer-add-gs-set arg0 (texa (new 'static 'gs-texa :ta1 #x80))) 0 (none) ) -(defmethod set-height! ocean-map ((obj ocean-map) (arg0 float)) - (if obj - (set! (-> obj start-corner y) arg0) +(defmethod set-height! ocean-map ((this ocean-map) (arg0 float)) + (if this + (set! (-> this start-corner y) arg0) ) 0 (none) ) -(defmethod get-base-height ocean-map ((obj ocean-map)) - (if obj - (-> obj start-corner y) +(defmethod get-base-height ocean-map ((this ocean-map)) + (if this + (-> this start-corner y) 0.0 ) ) -(defmethod rgba-to-vector! ocean ((obj ocean) (arg0 vector) (arg1 (pointer rgba))) +(defmethod rgba-to-vector! ocean ((this ocean) (arg0 vector) (arg1 (pointer rgba))) "Pack an [[rgba]]'s bytes into a vector." (local-vars (v1-1 uint128) (v1-2 uint128)) (rlet ((vf1 :class vf)) @@ -1098,17 +1098,17 @@ ) ) -(defmethod update-map ocean ((obj ocean)) - (set! (-> obj heights) #f) - (set! (-> obj verts) #f) +(defmethod update-map ocean ((this ocean)) + (set! (-> this heights) #f) + (set! (-> this verts) #f) (let ((s5-0 *mood-control*)) - (set! (-> obj constant w) (if (and (-> s5-0 overide-weather-flag) (not (movie?))) + (set! (-> this constant w) (if (and (-> s5-0 overide-weather-flag) (not (movie?))) (-> s5-0 overide cloud) (-> s5-0 current-interp cloud) ) ) ) - (set! (-> obj constant w) (fmin 1.0 (* 2.0 (-> obj constant w)))) + (set! (-> this constant w) (fmin 1.0 (* 2.0 (-> this constant w)))) (let ((f0-5 1.0) (f30-0 1.0) ) @@ -1116,62 +1116,62 @@ (set! f0-5 0.333) (set! f30-0 0.75) ) - (set! (-> obj frame-speed) (* (+ 4.0 (-> *setting-control* user-current rain)) f0-5)) - (set! (-> obj frame-speed2) (* (+ 5.0 (-> *setting-control* user-current rain)) f0-5)) + (set! (-> this frame-speed) (* (+ 4.0 (-> *setting-control* user-current rain)) f0-5)) + (set! (-> this frame-speed2) (* (+ 5.0 (-> *setting-control* user-current rain)) f0-5)) (when (not (paused?)) - (let ((f0-8 (+ (-> obj frame-num) (* (-> obj frame-speed) (seconds-per-frame))))) - (set! (-> obj frame-num) (- f0-8 (* (the float (the int (/ f0-8 64.0))) 64.0))) + (let ((f0-8 (+ (-> this frame-num) (* (-> this frame-speed) (seconds-per-frame))))) + (set! (-> this frame-num) (- f0-8 (* (the float (the int (/ f0-8 64.0))) 64.0))) ) - (let ((f0-11 (+ (-> obj frame-num2) (* (-> obj frame-speed2) (seconds-per-frame))))) - (set! (-> obj frame-num2) (- f0-11 (* (the float (the int (/ f0-11 64.0))) 64.0))) + (let ((f0-11 (+ (-> this frame-num2) (* (-> this frame-speed2) (seconds-per-frame))))) + (set! (-> this frame-num2) (- f0-11 (* (the float (the int (/ f0-11 64.0))) 64.0))) ) ) (let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf))) - (set! (-> obj heights) (the-as ocean-height-array (-> s5-1 base))) - (interp-wave obj (the-as ocean-wave-info (-> obj heights)) (the-as uint (-> obj frame-num)) (* 0.08325 f30-0)) + (set! (-> this heights) (the-as ocean-height-array (-> s5-1 base))) + (interp-wave this (the-as ocean-wave-info (-> this heights)) (the-as uint (-> this frame-num)) (* 0.08325 f30-0)) (&+! (-> s5-1 base) 4096) - (set! (-> obj heights2) (the-as ocean-height-array (-> s5-1 base))) + (set! (-> this heights2) (the-as ocean-height-array (-> s5-1 base))) (interp-wave - obj - (the-as ocean-wave-info (-> obj heights2)) - (the-as uint (-> obj frame-num2)) + this + (the-as ocean-wave-info (-> this heights2)) + (the-as uint (-> this frame-num2)) (* 0.01665 f30-0) ) (&+! (-> s5-1 base) 4096) - (ocean-method-15 obj (the-as matrix (-> obj heights)) (the-as matrix (-> obj heights2))) - (set! (-> obj verts) (the-as ocean-vert-array (-> s5-1 base))) + (ocean-method-15 this (the-as matrix (-> this heights)) (the-as matrix (-> this heights2))) + (set! (-> this verts) (the-as ocean-vert-array (-> s5-1 base))) (&+! (-> s5-1 base) #x8000) ) ) - (when (not (or (-> obj off) (-> *blit-displays-work* menu-mode))) + (when (not (or (-> this off) (-> *blit-displays-work* menu-mode))) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask ocean)) - (mem-copy! (the-as pointer (-> obj cloud-lights)) (the-as pointer (-> *sky-work* cloud-lights)) 156) - (mem-copy! (the-as pointer (-> obj haze-lights)) (the-as pointer (-> *sky-work* haze-lights)) 124) + (mem-copy! (the-as pointer (-> this cloud-lights)) (the-as pointer (-> *sky-work* cloud-lights)) 156) + (mem-copy! (the-as pointer (-> this haze-lights)) (the-as pointer (-> *sky-work* haze-lights)) 124) (vector4-scale! - (the-as vector4 (-> obj sky-color)) + (the-as vector4 (-> this sky-color)) (the-as vector4 (-> *time-of-day-context* current-sky-color)) 0.0078125 ) - (generate-verts obj (-> obj verts) (-> obj heights)) + (generate-verts this (-> this verts) (-> this heights)) (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-2 (-> s4-0 base)) ) ;; TODO handle ocean::79 and ocean::89 ;; diasble tod ocean stuff ;; (if (-> *time-of-day-context* sky) - ;; (ocean-method-89 obj s4-0) + ;; (ocean-method-89 this s4-0) ;; ) - (draw-ocean-texture obj s4-0 (the-as int (-> obj verts))) + (draw-ocean-texture this s4-0 (the-as int (-> this verts))) ;; disable whatever this is - ;; (ocean-method-79 obj s4-0) - (init-buffer! obj s4-0) - (if (-> obj far-on) - (draw-ocean-far obj s4-0) + ;; (ocean-method-79 this s4-0) + (init-buffer! this s4-0) + (if (-> this far-on) + (draw-ocean-far this s4-0) ) - (if (not (-> obj mid-off)) - (draw-ocean-mid obj s4-0) + (if (not (-> this mid-off)) + (draw-ocean-mid this s4-0) ) - (end-buffer! obj s4-0) + (end-buffer! this s4-0) (set-dirty-mask! (-> *level* default-level) 9 #xc0000 #x2a000) (let ((a3-3 (-> s4-0 base))) (let ((v1-87 (the-as object (-> s4-0 base)))) @@ -1188,16 +1188,16 @@ ) ) ) - (when (not (or (-> obj near-off) - (or (-> obj mid-off) (< 196608.0 (fabs (- (-> obj start-corner y) (-> *math-camera* trans y))))) + (when (not (or (-> this near-off) + (or (-> this mid-off) (< 196608.0 (fabs (- (-> this start-corner y) (-> *math-camera* trans y))))) ) ) (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-3 (-> s4-1 base)) ) - (draw-ocean-texture obj s4-1 (the-as int (-> obj verts))) - (draw-ocean-near obj s4-1) - (end-buffer! obj s4-1) + (draw-ocean-texture this s4-1 (the-as int (-> this verts))) + (draw-ocean-near this s4-1) + (end-buffer! this s4-1) (set-dirty-mask! (-> *level* default-level) 7 #xc0000 #x2a000) (let ((a3-5 (-> s4-1 base))) (let ((v1-113 (the-as object (-> s4-1 base)))) @@ -1218,10 +1218,10 @@ ) ) (when (not (paused?)) - (set! (-> obj off) #f) - (set! (-> obj mid-off) #f) - (set! (-> obj near-off) (if obj - (not (-> obj ocean-near-translucent?)) + (set! (-> this off) #f) + (set! (-> this mid-off) #f) + (set! (-> this near-off) (if this + (not (-> this ocean-near-translucent?)) #f ) ) @@ -1240,15 +1240,15 @@ (the-as float #x43000000) ) -(defmethod draw! ocean ((obj ocean)) - (do-tex-scroll! obj) +(defmethod draw! ocean ((this ocean)) + (do-tex-scroll! this) (set! *ocean-map* #f) - (set! (-> obj far-on) #f) + (set! (-> this far-on) #f) (dotimes (v1-2 (-> *level* length)) (let ((a0-5 (-> *level* level v1-2))) (when (= (-> a0-5 status) 'active) (if (-> a0-5 info ocean-far?) - (set! (-> obj far-on) #t) + (set! (-> this far-on) #t) ) (let ((a1-7 (-> a0-5 info ocean))) (cond @@ -1260,7 +1260,7 @@ ) ((and a1-7 (nonzero? (-> a1-7 value))) (set! *ocean-map* (the-as ocean-map (-> a1-7 value))) - (set! (-> obj ocean-near-translucent?) (-> a0-5 info ocean-near-translucent?)) + (set! (-> this ocean-near-translucent?) (-> a0-5 info ocean-near-translucent?)) ) ) ) @@ -1269,7 +1269,7 @@ ) (label cfg-17) (if *ocean-map* - (mem-copy! (the-as pointer obj) (the-as pointer *ocean-map*) 56) + (mem-copy! (the-as pointer this) (the-as pointer *ocean-map*) 56) ) (let ((v1-9 (new 'stack-no-clear 'vector))) (if (-> *time-of-day-context* use-camera-other) @@ -1279,16 +1279,16 @@ (cond ((< (fabs (-> v1-9 z)) (fabs (-> v1-9 x))) (if (< (-> v1-9 x) 0.0) - (set! (-> obj ocean-facing) (the-as uint 3)) - (set! (-> obj ocean-facing) (the-as uint 2)) + (set! (-> this ocean-facing) (the-as uint 3)) + (set! (-> this ocean-facing) (the-as uint 2)) ) ) ((< (-> v1-9 z) 0.0) - (set! (-> obj ocean-facing) (the-as uint 0)) + (set! (-> this ocean-facing) (the-as uint 0)) 0 ) (else - (set! (-> obj ocean-facing) (the-as uint 1)) + (set! (-> this ocean-facing) (the-as uint 1)) ) ) ) diff --git a/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc b/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc index 292870b2c9..3338d71bfd 100644 --- a/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc +++ b/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc @@ -20,6 +20,7 @@ :flag-assert #x1100000070 ) + (deftype shrub-view-data (structure) ((data uint128 3 :offset-assert 0) (texture-giftag gs-gif-tag :inline :offset 0) @@ -39,6 +40,7 @@ :flag-assert #x900000030 ) + (deftype shrubbery (drawable) ((textures (inline-array adgif-shader) :offset 4) (header qword :offset 8) @@ -56,6 +58,7 @@ :flag-assert #x1100000020 ) + (deftype instance-shrubbery (instance) ((flat-normal vector :inline :offset-assert 64) (flat-hwidth float :offset 76) @@ -66,6 +69,7 @@ :flag-assert #x1100000050 ) + (deftype drawable-inline-array-instance-shrub (drawable-inline-array) ((data instance-shrubbery 1 :inline :offset-assert 32) (pad uint32 :offset-assert 112) @@ -101,6 +105,7 @@ :flag-assert #x1100000020 ) + (deftype prototype-shrubbery (drawable-inline-array) ((data shrubbery 1 :inline :offset-assert 32) (pad uint32 :offset-assert 64) @@ -133,6 +138,8 @@ :flag-assert #x900000050 ) + +;; WARN: Return type mismatch symbol vs none. (defun shrubbery-login-post-texture ((arg0 shrubbery)) (let* ((v1-1 (-> arg0 header data 0)) (a1-1 (the-as object (+ (the-as uint (-> arg0 header)) (* (+ (-> arg0 header data 1) 1) 16)))) @@ -181,6 +188,7 @@ :flag-assert #x900000090 ) + (deftype instance-shrub-work (structure) ((dummy qword 3 :inline :offset-assert 0) (chaina qword 8 :inline :offset-assert 48) @@ -255,6 +263,7 @@ :flag-assert #x9000019bc ) + (deftype instance-shrub-dma (structure) ((instancea uint128 325 :offset-assert 0) (instanceb uint128 325 :offset-assert 5200) diff --git a/goal_src/jak2/engine/gfx/shrub/shrubbery.gc b/goal_src/jak2/engine/gfx/shrub/shrubbery.gc index b59a354218..6f8692b646 100644 --- a/goal_src/jak2/engine/gfx/shrub/shrubbery.gc +++ b/goal_src/jak2/engine/gfx/shrub/shrubbery.gc @@ -10,22 +10,22 @@ ;; DECOMP BEGINS -(defmethod login billboard ((obj billboard)) +(defmethod login billboard ((this billboard)) "Set up the billboard adgif shader" - (adgif-shader-login (-> obj flat)) - obj + (adgif-shader-login (-> this flat)) + this ) -(defmethod mem-usage billboard ((obj billboard) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage billboard ((this billboard) (arg0 memory-usage-block) (arg1 int)) "Compute the memory used for the billboard." (set! (-> arg0 length) (max 34 (-> arg0 length))) (set! (-> arg0 data 33 name) "billboard") (+! (-> arg0 data 33 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 33 used) v1-6) (+! (-> arg0 data 33 total) (logand -16 (+ v1-6 15))) ) - obj + this ) (define-extern mem-usage-shrub-walk (function draw-node int memory-usage-block int draw-node)) @@ -62,7 +62,7 @@ arg0 ) -(defmethod mem-usage drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage for an entire shrub tree" (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -72,59 +72,59 @@ (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) ;; time of day colors - (when (nonzero? (-> obj colors-added)) + (when (nonzero? (-> this colors-added)) (set! (-> arg0 length) (max 33 (-> arg0 length))) (set! (-> arg0 data 32 name) "shrubbery-pal") (+! (-> arg0 data 32 count) 1) - (let ((v1-19 (asize-of (-> obj colors-added)))) + (let ((v1-19 (asize-of (-> this colors-added)))) (+! (-> arg0 data 32 used) v1-19) (+! (-> arg0 data 32 total) (logand -16 (+ v1-19 15))) ) ) ;; instance tree (mem-usage-shrub-walk - (the-as draw-node (&+ (-> obj data 0) 32)) - (-> (the-as drawable-group (-> obj data 0)) length) + (the-as draw-node (&+ (-> this data 0) 32)) + (-> (the-as drawable-group (-> this data 0)) length) arg0 arg1 ) ;; prototypes - (mem-usage (-> obj info prototype-inline-array-shrub) arg0 (logior arg1 1)) - obj + (mem-usage (-> this info prototype-inline-array-shrub) arg0 (logior arg1 1)) + this ) -(defmethod login generic-shrub-fragment ((obj generic-shrub-fragment)) +(defmethod login generic-shrub-fragment ((this generic-shrub-fragment)) "Set up shaders in a generic shrub fragment" - (let ((s5-0 (/ (-> obj cnt-qwc) (the-as uint 5)))) + (let ((s5-0 (/ (-> this cnt-qwc) (the-as uint 5)))) (dotimes (s4-0 (the-as int s5-0)) - (adgif-shader-login-no-remap (-> obj textures s4-0)) + (adgif-shader-login-no-remap (-> this textures s4-0)) ) ) - obj + this ) -(defmethod mem-usage generic-shrub-fragment ((obj generic-shrub-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage generic-shrub-fragment ((this generic-shrub-fragment) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage of generic shrub fragment" (set! (-> arg0 length) (max 27 (-> arg0 length))) (set! (-> arg0 data 25 name) "generic-shrub") (+! (-> arg0 data 25 count) 1) ;; the actual fragment object - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 25 used) v1-6) (+! (-> arg0 data 25 total) (logand -16 (+ v1-6 15))) ) ;; the referenced data (set! (-> arg0 data 26 name) "generic-shrub-data") (+! (-> arg0 data 26 count) 1) - (let ((v1-17 (* (+ (-> obj cnt-qwc) (-> obj vtx-qwc) (-> obj col-qwc) (-> obj stq-qwc)) 16))) + (let ((v1-17 (* (+ (-> this cnt-qwc) (-> this vtx-qwc) (-> this col-qwc) (-> this stq-qwc)) 16))) (+! (-> arg0 data 26 used) v1-17) (+! (-> arg0 data 26 total) (logand -16 (+ v1-17 15))) ) - obj + this ) -(defmethod mem-usage prototype-shrubbery ((obj prototype-shrubbery) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-shrubbery ((this prototype-shrubbery) (arg0 memory-usage-block) (arg1 int)) "Compute memory usage of all prototypes in a prototype array." (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) @@ -133,38 +133,38 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) -(defmethod login prototype-shrubbery ((obj prototype-shrubbery)) +(defmethod login prototype-shrubbery ((this prototype-shrubbery)) "Login all prototypes in a prototype array" - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) -(defmethod asize-of prototype-shrubbery ((obj prototype-shrubbery)) +(defmethod asize-of prototype-shrubbery ((this prototype-shrubbery)) "Compute the allocation size of a prototype shrubbery array (dynamically sized)" - (the-as int (+ (-> prototype-shrubbery size) (* (+ (-> obj length) -1) 32))) + (the-as int (+ (-> prototype-shrubbery size) (* (+ (-> this length) -1) 32))) ) -(defmethod login prototype-generic-shrub ((obj prototype-generic-shrub)) +(defmethod login prototype-generic-shrub ((this prototype-generic-shrub)) "Initialize all fragments in a generic prototype." - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) -(defmethod login shrubbery ((obj shrubbery)) +(defmethod login shrubbery ((this shrubbery)) "Initialize a shrubbery fragment." - (let ((s5-0 (* (-> obj header data 0) 2))) + (let ((s5-0 (* (-> this header data 0) 2))) (dotimes (s4-0 (the-as int s5-0)) - (let ((v1-3 (adgif-shader-login-no-remap (-> obj textures s4-0)))) + (let ((v1-3 (adgif-shader-login-no-remap (-> this textures s4-0)))) (when v1-3 (dotimes (a0-5 3) (dotimes (a1-0 3) @@ -182,56 +182,56 @@ ) ) ) - (shrubbery-login-post-texture obj) - obj + (shrubbery-login-post-texture this) + this ) -(defmethod mem-usage shrubbery ((obj shrubbery) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage shrubbery ((this shrubbery) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a shrubbery fragment." (set! (-> arg0 length) (max 28 (-> arg0 length))) (set! (-> arg0 data 27 name) "shrubbery") (+! (-> arg0 data 27 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 27 used) v1-6) (+! (-> arg0 data 27 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 30 (-> arg0 length))) (set! (-> arg0 data 29 name) "shrubbery-vertex") (+! (-> arg0 data 29 count) 1) - (let ((v1-16 (* (-> obj vtx-qwc) 16))) + (let ((v1-16 (* (-> this vtx-qwc) 16))) (+! (-> arg0 data 29 used) v1-16) (+! (-> arg0 data 29 total) (logand -16 (+ v1-16 15))) ) (set! (-> arg0 length) (max 31 (-> arg0 length))) (set! (-> arg0 data 30 name) "shrubbery-color") (+! (-> arg0 data 30 count) 1) - (let ((v1-26 (* (-> obj col-qwc) 16))) + (let ((v1-26 (* (-> this col-qwc) 16))) (+! (-> arg0 data 30 used) v1-26) (+! (-> arg0 data 30 total) (logand -16 (+ v1-26 15))) ) (set! (-> arg0 length) (max 29 (-> arg0 length))) (set! (-> arg0 data 28 name) "shrubbery-object") (+! (-> arg0 data 28 count) 1) - (let ((v1-36 (* (-> obj obj-qwc) 16))) + (let ((v1-36 (* (-> this obj-qwc) 16))) (+! (-> arg0 data 28 used) v1-36) (+! (-> arg0 data 28 total) (logand -16 (+ v1-36 15))) ) (set! (-> arg0 length) (max 32 (-> arg0 length))) (set! (-> arg0 data 31 name) "shrubbery-stq") (+! (-> arg0 data 31 count) 1) - (let ((v1-46 (* (-> obj stq-qwc) 16))) + (let ((v1-46 (* (-> this stq-qwc) 16))) (+! (-> arg0 data 31 used) v1-46) (+! (-> arg0 data 31 total) (logand -16 (+ v1-46 15))) ) - obj + this ) -(defmethod login drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub)) +(defmethod login drawable-tree-instance-shrub ((this drawable-tree-instance-shrub)) "Initialize a shrubbery tree." - (if (nonzero? (-> obj info prototype-inline-array-shrub)) - (login (-> obj info prototype-inline-array-shrub)) + (if (nonzero? (-> this info prototype-inline-array-shrub)) + (login (-> this info prototype-inline-array-shrub)) ) - obj + this ) (define shrub-vu1-block (new 'static 'vu-function)) @@ -543,11 +543,11 @@ (none) ) -(defmethod draw drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 drawable-tree-instance-shrub) (arg1 display-frame)) +(defmethod draw drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 drawable-tree-instance-shrub) (arg1 display-frame)) (let ((v1-1 (-> *background-work* shrub-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) - (set! (-> *background-work* shrub-trees v1-1) obj) + (set! (-> *background-work* shrub-trees v1-1) this) (set! (-> *background-work* shrub-levels v1-1) a1-4) ) (+! (-> *background-work* shrub-tree-count) 1) @@ -555,13 +555,13 @@ (none) ) -(defmethod unpack-vis drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) -(defmethod collect-stats drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub)) +(defmethod collect-stats drawable-tree-instance-shrub ((this drawable-tree-instance-shrub)) (when (logtest? (vu1-renderer-mask shrubbery shrub-near billboard shrubbery-vanish) (-> *display* vu1-enable-user)) - (let* ((v1-4 (-> obj info prototype-inline-array-shrub)) + (let* ((v1-4 (-> this info prototype-inline-array-shrub)) (gp-0 (the-as object (-> v1-4 data))) ) (countdown (s5-0 (-> v1-4 length)) diff --git a/goal_src/jak2/engine/gfx/sky/sky-data.gc b/goal_src/jak2/engine/gfx/sky/sky-data.gc index 3e8553f7b6..cfb11ddf28 100644 --- a/goal_src/jak2/engine/gfx/sky/sky-data.gc +++ b/goal_src/jak2/engine/gfx/sky/sky-data.gc @@ -314,24 +314,24 @@ (init-haze-vert-array) -(defmethod init-sun-data! sky-work ((obj sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init-sun-data! sky-work ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) "Sets the sun related upload data - the sun, halo and aurora" (let ((v1-0 (logand arg0 1))) - (set! (-> obj upload-data sun v1-0 r-sun) arg1) - (set! (-> obj upload-data sun v1-0 r-halo) arg2) - (set! (-> obj upload-data sun v1-0 r-aurora) arg3) + (set! (-> this upload-data sun v1-0 r-sun) arg1) + (set! (-> this upload-data sun v1-0 r-halo) arg2) + (set! (-> this upload-data sun v1-0 r-aurora) arg3) ) 0 (none) ) -(defmethod init-orbit-settings! sky-work ((obj sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) - (set! (-> obj orbit arg0 high-noon) arg1) - (set! (-> obj orbit arg0 tilt) (* 0.017453292 arg2)) - (set! (-> obj orbit arg0 rise) (* 0.017453292 arg3)) - (set! (-> obj orbit arg0 dist) arg4) - (set! (-> obj orbit arg0 min-halo) arg5) - (set! (-> obj orbit arg0 max-halo) arg6) +(defmethod init-orbit-settings! sky-work ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) + (set! (-> this orbit arg0 high-noon) arg1) + (set! (-> this orbit arg0 tilt) (* 0.017453292 arg2)) + (set! (-> this orbit arg0 rise) (* 0.017453292 arg3)) + (set! (-> this orbit arg0 dist) arg4) + (set! (-> this orbit arg0 min-halo) arg5) + (set! (-> this orbit arg0 max-halo) arg6) 0 (none) ) diff --git a/goal_src/jak2/engine/gfx/sky/sky-h.gc b/goal_src/jak2/engine/gfx/sky/sky-h.gc index 7eda005f34..bc86323b2a 100644 --- a/goal_src/jak2/engine/gfx/sky/sky-h.gc +++ b/goal_src/jak2/engine/gfx/sky/sky-h.gc @@ -262,6 +262,4 @@ ) ) -0 - (define-extern *sky-work* sky-work) \ No newline at end of file diff --git a/goal_src/jak2/engine/gfx/sky/sky-tng.gc b/goal_src/jak2/engine/gfx/sky/sky-tng.gc index c11b9237be..0fc4523d1e 100644 --- a/goal_src/jak2/engine/gfx/sky/sky-tng.gc +++ b/goal_src/jak2/engine/gfx/sky/sky-tng.gc @@ -82,13 +82,13 @@ vf31: cam 0 (premultiplied by hmge) ;; Sky Update ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod update-matrix sky-work ((obj sky-work) (arg0 matrix)) +(defmethod update-matrix sky-work ((this sky-work) (arg0 matrix)) "Update the projection matrix for sky drawing. The input matrix should not include perepctive. This function will apply the current math camera's perspective." (rlet ((vf0 :class vf)) (init-vf0-vector) - (let ((v1-0 (-> obj cam-mat))) + (let ((v1-0 (-> this cam-mat))) (let* ((a0-1 v1-0) (t0-0 arg0) (a1-1 (-> t0-0 vector 0 quad)) @@ -109,7 +109,7 @@ vf31: cam 0 (premultiplied by hmge) ) ) -(defmethod update-template-colors sky-work ((obj sky-work)) +(defmethod update-template-colors sky-work ((this sky-work)) "Update skybox colors from level/mood." (let ((v1-1 (-> *time-of-day-context* current-fog erase-color)) (a0-2 (-> *level* default-level mood-context current-sky-color)) @@ -123,17 +123,17 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod update-time-and-speed sky-work ((obj sky-work) (arg0 float) (arg1 float)) +(defmethod update-time-and-speed sky-work ((this sky-work) (arg0 float) (arg1 float)) "Update based on the given time. Time is used to place suns/moon at the right spot, speed is used to scroll clouds." (if (and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) info taskname) 'nest)) (set! arg1 (* 10.0 arg1)) ) - (sky-make-sun-data obj 0 arg0) - (sky-make-sun-data obj 1 arg0) - (sky-make-moon-data obj arg0) - (+! (-> obj off-s) (the int (* -8.0 arg1))) - (+! (-> obj off-t) (the int (* 2.0 arg1))) - (set! (-> obj time) arg0) + (sky-make-sun-data this 0 arg0) + (sky-make-sun-data this 1 arg0) + (sky-make-moon-data this arg0) + (+! (-> this off-s) (the int (* -8.0 arg1))) + (+! (-> this off-t) (the int (* 2.0 arg1))) + (set! (-> this time) arg0) 0 (none) ) @@ -141,7 +141,7 @@ vf31: cam 0 (premultiplied by hmge) ;; method 16 ;; init-regs-for-boundary-draw ;; set up vf registers for drawing large polygons -; (defmethod init-regs-for-large-polygon-draw sky-work ((obj sky-work)) +; (defmethod init-regs-for-large-polygon-draw sky-work ((this sky-work)) ; (local-vars (v1-1 float)) ; (rlet ((vf0 :class vf) ; (vf13 :class vf) @@ -159,7 +159,7 @@ vf31: cam 0 (premultiplied by hmge) ; (let ((v1-0 *math-camera*) ; (a1-0 (new-stack-vector0)) ; ) -; (let ((a2-0 (-> obj cam-mat))) +; (let ((a2-0 (-> this cam-mat))) ; (set! (-> a1-0 quad) (-> v1-0 hvdf-off quad)) ;; interestingly, they cheat the height of the sky by 1, possibly to avoid a "gap" ;; on the horizon. (but they use the wrong position if it's using other camera) @@ -167,7 +167,7 @@ vf31: cam 0 (premultiplied by hmge) ; (set! (-> a1-0 y) 2049.0) ; (set! (-> a1-0 y) 2047.0) ; ) -; (set-vector! (-> obj fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3071.0) +; (set-vector! (-> this fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3071.0) ; (.lvf vf31 (&-> a2-0 vector 0 quad)) ; (.lvf vf30 (&-> a2-0 vector 1 quad)) ; (.lvf vf29 (&-> a2-0 vector 2 quad)) @@ -177,7 +177,7 @@ vf31: cam 0 (premultiplied by hmge) ; (.lvf vf26 (&-> v1-0 inv-hmge-scale quad)) ; (.lvf vf25 (&-> a1-0 quad)) ; ) -; (.lvf vf13 (&-> obj fog quad)) +; (.lvf vf13 (&-> this fog quad)) ; (.mul.vf vf31 vf31 vf14) ; (.mul.vf vf30 vf30 vf14) ; (.mul.vf vf29 vf29 vf14) @@ -205,7 +205,7 @@ vf31: cam 0 (premultiplied by hmge) ;; vf30: cam 1 ;; vf31: cam 0 -; (defmethod init-regs-for-sky-asm sky-work ((obj sky-work)) +; (defmethod init-regs-for-sky-asm sky-work ((this sky-work)) ; (local-vars (v1-2 float)) ; (rlet ((vf0 :class vf) ; (vf13 :class vf) @@ -220,7 +220,7 @@ vf31: cam 0 (premultiplied by hmge) ; ) ; (init-vf0-vector) ; (let ((a1-0 *math-camera*)) -; (let ((v1-0 (-> obj cam-mat))) +; (let ((v1-0 (-> this cam-mat))) ; (.lvf vf31 (&-> v1-0 vector 0 quad)) ; (.lvf vf30 (&-> v1-0 vector 1 quad)) ; (.lvf vf29 (&-> v1-0 vector 2 quad)) @@ -228,7 +228,7 @@ vf31: cam 0 (premultiplied by hmge) ; ) ; (.lvf vf14 (&-> a1-0 hmge-scale quad)) ; (.lvf vf25 (&-> a1-0 hvdf-off quad)) -; (.lvf vf13 (&-> obj fog quad)) +; (.lvf vf13 (&-> this fog quad)) ; (.mov.vf vf25 vf0 :mask #b100) ; (.mov.vf vf23 vf0) ; (let ((v1-1 (new-stack-vector0))) @@ -244,7 +244,7 @@ vf31: cam 0 (premultiplied by hmge) (defmethod-mips2c "(method 17 sky-work)" 17 sky-work) -(defmethod update-colors-for-time sky-work ((obj sky-work) (arg0 float)) +(defmethod update-colors-for-time sky-work ((this sky-work) (arg0 float)) "Update sky colors for the given time." 0 0 @@ -264,36 +264,36 @@ vf31: cam 0 (premultiplied by hmge) ) (cond ((= a0-6 v1-7) - (set! (-> obj sun0-color quad) (-> s5-0 data a0-6 lgt-color quad)) + (set! (-> this sun0-color quad) (-> s5-0 data a0-6 lgt-color quad)) ) (else (let ((a1-5 (-> s5-0 data a0-6)) (v1-11 (-> s5-0 data v1-7)) ) - (vector4-lerp! (the-as vector (-> obj sun0-color)) (-> a1-5 lgt-color) (-> v1-11 lgt-color) f0-6) + (vector4-lerp! (the-as vector (-> this sun0-color)) (-> a1-5 lgt-color) (-> v1-11 lgt-color) f0-6) ) ) ) ) - (set! (-> obj sun0-color-lower quad) (-> s3-0 times 1 quad)) - (set! (-> obj ambi-color-lower quad) (-> s3-0 times 0 quad)) + (set! (-> this sun0-color-lower quad) (-> s3-0 times 1 quad)) + (set! (-> this ambi-color-lower quad) (-> s3-0 times 0 quad)) (set-vector! s4-0 1.9921875 1.9921875 1.9921875 1.0) (vector4-lerp! - (the-as vector (-> obj ambi-color)) - (the-as vector (-> obj ambi-color-lower)) + (the-as vector (-> this ambi-color)) + (the-as vector (-> this ambi-color-lower)) s4-0 (-> *mood-control* lightning-flash) ) ) - (set! (-> obj sun0-color quad) (-> obj sun0-color quad)) - (set! (-> obj sun1-color quad) (-> s5-0 data 7 lgt-color quad)) - (set! (-> obj moon-color quad) (-> s5-0 data 6 lgt-color quad)) + (set! (-> this sun0-color quad) (-> this sun0-color quad)) + (set! (-> this sun1-color quad) (-> s5-0 data 7 lgt-color quad)) + (set! (-> this moon-color quad) (-> s5-0 data 6 lgt-color quad)) ) 0 (none) ) -(defmethod cloud-vtx-light-update sky-work ((obj sky-work) (arg0 vector) (arg1 vector) (arg2 cloud-lights) (arg3 vector) (arg4 vector)) +(defmethod cloud-vtx-light-update sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 cloud-lights) (arg3 vector) (arg4 vector)) "Update lighting for cloud mesh vertex." (let ((s5-0 (new 'stack-no-clear 'vector4))) (let* ((f0-1 (vector-dot (-> arg2 sun0-normal) arg1)) @@ -317,7 +317,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod cloud-vtx-tex-update sky-work ((obj sky-work) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 cloud-lights)) +(defmethod cloud-vtx-tex-update sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 cloud-lights)) "Update texture stq for cloud mesh vertex." (let ((s5-0 (new 'stack-no-clear 'vector4)) (s2-0 (new 'stack-no-clear 'vector4)) @@ -339,14 +339,14 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod adjust-cloud-lighting sky-work ((obj sky-work)) +(defmethod adjust-cloud-lighting sky-work ((this sky-work)) "Apply lighting to cloud vertices" (let ((s5-0 *cloud-vert-array*) - (s4-0 (-> obj cloud-lights)) + (s4-0 (-> this cloud-lights)) ) - (set! (-> s4-0 sun0-normal quad) (-> obj upload-data sun 0 pos quad)) - (set! (-> s4-0 sun1-normal quad) (-> obj upload-data sun 1 pos quad)) - (set! (-> s4-0 moon-normal quad) (-> obj upload-data moon pos quad)) + (set! (-> s4-0 sun0-normal quad) (-> this upload-data sun 0 pos quad)) + (set! (-> s4-0 sun1-normal quad) (-> this upload-data sun 1 pos quad)) + (set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad)) (vector-normalize! (-> s4-0 sun0-normal) 1.0) (vector-normalize! (-> s4-0 sun1-normal) 1.0) (vector-normalize! (-> s4-0 moon-normal) 1.0) @@ -355,45 +355,45 @@ vf31: cam 0 (premultiplied by hmge) (set! (-> s4-0 moon-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 moon-normal y)))))) (let ((s1-0 (-> s4-0 ambi-color)) (s2-0 (-> s4-0 ambi-color-lower)) - (s3-0 (-> obj sun0-color-lower)) + (s3-0 (-> this sun0-color-lower)) ) (let ((f30-0 (- 1.0 (fmax 0.0 (fmin 0.75 (* 4.0 (-> s4-0 moon-normal y)))))) (f28-0 (* 0.3333 (fmax 0.0 (fmin 1.0 (+ -1.0 (* 8.0 (-> s4-0 sun0-normal y))))))) ) - (vector4-scale! (the-as vector4 s2-0) (the-as vector4 (-> obj ambi-color-lower)) f30-0) + (vector4-scale! (the-as vector4 s2-0) (the-as vector4 (-> this ambi-color-lower)) f30-0) (vector4-madd! (the-as vector4 s2-0) (the-as vector4 s2-0) (the-as vector4 s3-0) f28-0) - (vector4-scale! (the-as vector4 s1-0) (the-as vector4 (-> obj ambi-color)) f30-0) + (vector4-scale! (the-as vector4 s1-0) (the-as vector4 (-> this ambi-color)) f30-0) (vector4-madd! (the-as vector4 s1-0) (the-as vector4 s1-0) (the-as vector4 s3-0) f28-0) ) (vector4-scale! (the-as vector4 (-> s4-0 sun0-color)) - (the-as vector4 (-> obj sun0-color)) + (the-as vector4 (-> this sun0-color)) (-> s4-0 sun0-scale) ) (vector4-scale! (the-as vector4 (-> s4-0 sun1-color)) - (the-as vector4 (-> obj sun1-color)) + (the-as vector4 (-> this sun1-color)) (* 0.5 (-> s4-0 sun1-scale)) ) (vector4-scale! (the-as vector4 (-> s4-0 moon-color)) - (the-as vector4 (-> obj moon-color)) + (the-as vector4 (-> this moon-color)) (-> s4-0 moon-scale) ) (vector4-scale! (the-as vector4 (-> s4-0 sun0-color-lower)) (the-as vector4 s3-0) (-> s4-0 sun0-scale)) ) (dotimes (s3-1 100) (let ((s2-1 (-> s5-0 data s3-1))) - (cloud-vtx-light-update obj (-> s2-1 col) (-> s2-1 nrm) s4-0 (-> s4-0 sun0-color) (-> s4-0 ambi-color)) + (cloud-vtx-light-update this (-> s2-1 col) (-> s2-1 nrm) s4-0 (-> s4-0 sun0-color) (-> s4-0 ambi-color)) (cloud-vtx-light-update - obj + this (-> s2-1 col2) (-> s2-1 nrm2) s4-0 (-> s4-0 sun0-color-lower) (-> s4-0 ambi-color-lower) ) - (cloud-vtx-tex-update obj (-> s2-1 stq2) (-> s2-1 stq) (-> s2-1 pos) s4-0) + (cloud-vtx-tex-update this (-> s2-1 stq2) (-> s2-1 stq) (-> s2-1 pos) s4-0) ) ) ) @@ -401,7 +401,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod cloud-vtx1-to-sky sky-work ((obj sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) +(defmethod cloud-vtx1-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) "Convert a cloud vertex to a sky vertex, using the 'normal' stq/col" (set! (-> arg0 pos quad) (-> arg1 pos quad)) (set! (-> arg0 stq quad) (-> arg1 stq quad)) @@ -409,7 +409,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod cloud-vtx2-to-sky sky-work ((obj sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) +(defmethod cloud-vtx2-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) "Convert a cloud vertex to a sky vertex, using the '2' stq/col" (set! (-> arg0 pos quad) (-> arg1 pos quad)) (set! (-> arg0 stq quad) (-> arg1 stq2 quad)) @@ -417,7 +417,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod draw-clouds sky-work ((obj sky-work) (arg0 dma-buffer)) +(defmethod draw-clouds sky-work ((this sky-work) (arg0 dma-buffer)) "Draw the cloud layer using large polygon renderer Assumes that init-regs-for-large-polygon-draw was already called." (local-vars (v1-19 float) (sv-16 cloud-vert-array) (sv-20 (inline-array sky-vertex)) (sv-32 int)) @@ -453,15 +453,15 @@ vf31: cam 0 (premultiplied by hmge) (texflush 0) ) ;; set regs for large polygon renderer - ;(init-regs-for-large-polygon-draw obj) ;; hack hack hack hack hack! - ;;(.lvf vf27 (&-> obj giftag-roof quad)) - (set-sky-vf27 (&-> obj giftag-roof quad)) + ;(init-regs-for-large-polygon-draw this) ;; hack hack hack hack hack! + ;;(.lvf vf27 (&-> this giftag-roof quad)) + (set-sky-vf27 (&-> this giftag-roof quad)) (set-sky-vf23-value #x43c80000) ; (let ((v1-18 #x43c80000)) ; (.mov vf23 v1-18) ; ) ;(.mov v1-19 vf23) - (set-tex-offset (the-as int (-> obj off-s)) (the-as int (-> obj off-t))) + (set-tex-offset (the-as int (-> this off-s)) (the-as int (-> this off-t))) ;; convert cloud vertices to sky. (let ((s4-1 (the-as object (-> arg0 base)))) @@ -473,14 +473,14 @@ vf31: cam 0 (premultiplied by hmge) (let ((s1-0 (+ (* 10 s3-1) s2-2))) (set! sv-32 (+ (* 9 s3-1) s2-2)) (let ((s0-0 (+ s2-2 81 (* 9 s3-1)))) - (cloud-vtx1-to-sky obj (-> sv-20 (* sv-32 4)) (-> sv-16 data s1-0)) - (cloud-vtx1-to-sky obj (-> sv-20 (+ (* sv-32 4) 1)) (-> sv-16 data (+ s1-0 1))) - (cloud-vtx1-to-sky obj (-> sv-20 (+ (* sv-32 4) 2)) (-> sv-16 data (+ s1-0 11))) - (cloud-vtx1-to-sky obj (-> sv-20 (+ (* sv-32 4) 3)) (-> sv-16 data (+ s1-0 10))) - (cloud-vtx2-to-sky obj (-> sv-20 (* s0-0 4)) (-> sv-16 data s1-0)) - (cloud-vtx2-to-sky obj (-> sv-20 (+ (* s0-0 4) 1)) (-> sv-16 data (+ s1-0 1))) - (cloud-vtx2-to-sky obj (-> sv-20 (+ (* s0-0 4) 2)) (-> sv-16 data (+ s1-0 11))) - (cloud-vtx2-to-sky obj (-> sv-20 (+ (* s0-0 4) 3)) (-> sv-16 data (+ s1-0 10))) + (cloud-vtx1-to-sky this (-> sv-20 (* sv-32 4)) (-> sv-16 data s1-0)) + (cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 1)) (-> sv-16 data (+ s1-0 1))) + (cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 2)) (-> sv-16 data (+ s1-0 11))) + (cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 3)) (-> sv-16 data (+ s1-0 10))) + (cloud-vtx2-to-sky this (-> sv-20 (* s0-0 4)) (-> sv-16 data s1-0)) + (cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 1)) (-> sv-16 data (+ s1-0 1))) + (cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 2)) (-> sv-16 data (+ s1-0 11))) + (cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 3)) (-> sv-16 data (+ s1-0 10))) ) ) ) @@ -502,7 +502,7 @@ vf31: cam 0 (premultiplied by hmge) ) ) -(defmethod apply-haze-light sky-work ((obj sky-work) (arg0 vector) (arg1 vector) (arg2 haze-lights)) +(defmethod apply-haze-light sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 haze-lights)) "Apply haze lights to a vertex." (let ((s5-0 (new 'stack-no-clear 'vector4))) (let* ((f0-1 (vector-dot (-> arg2 sun0-normal) arg1)) @@ -526,14 +526,14 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod adjust-haze-lighting sky-work ((obj sky-work)) +(defmethod adjust-haze-lighting sky-work ((this sky-work)) "Adjust lighting for haze." (let ((s5-0 *haze-vert-array*) - (s4-0 (-> obj haze-lights)) + (s4-0 (-> this haze-lights)) ) - (set! (-> s4-0 sun0-normal quad) (-> obj upload-data sun 0 pos quad)) - (set! (-> s4-0 sun1-normal quad) (-> obj upload-data sun 1 pos quad)) - (set! (-> s4-0 moon-normal quad) (-> obj upload-data moon pos quad)) + (set! (-> s4-0 sun0-normal quad) (-> this upload-data sun 0 pos quad)) + (set! (-> s4-0 sun1-normal quad) (-> this upload-data sun 1 pos quad)) + (set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad)) (vector-normalize! (-> s4-0 sun0-normal) 1.0) (vector-normalize! (-> s4-0 sun1-normal) 1.0) (vector-normalize! (-> s4-0 moon-normal) 1.0) @@ -541,30 +541,30 @@ vf31: cam 0 (premultiplied by hmge) (set! (-> s4-0 sun1-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 sun1-normal y)))))) (set! (-> s4-0 moon-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 moon-normal y)))))) (let ((a0-10 (-> s4-0 ambi-color))) - (-> obj sun0-color-lower) + (-> this sun0-color-lower) (let ((f0-7 (- 1.0 (fmax 0.0 (fmin 0.75 (* 4.0 (-> s4-0 moon-normal y))))))) (* 0.3333 (fmax 0.0 (fmin 1.0 (+ -1.0 (* 8.0 (-> s4-0 sun0-normal y)))))) - (vector4-scale! (the-as vector4 a0-10) (the-as vector4 (-> obj ambi-color)) f0-7) + (vector4-scale! (the-as vector4 a0-10) (the-as vector4 (-> this ambi-color)) f0-7) ) ) (vector4-scale! (the-as vector4 (-> s4-0 sun0-color)) - (the-as vector4 (-> obj sun0-color)) + (the-as vector4 (-> this sun0-color)) (-> s4-0 sun0-scale) ) (vector4-scale! (the-as vector4 (-> s4-0 sun1-color)) - (the-as vector4 (-> obj sun1-color)) + (the-as vector4 (-> this sun1-color)) (* 0.5 (-> s4-0 sun1-scale)) ) (vector4-scale! (the-as vector4 (-> s4-0 moon-color)) - (the-as vector4 (-> obj moon-color)) + (the-as vector4 (-> this moon-color)) (-> s4-0 moon-scale) ) (dotimes (s3-0 36) (let ((v1-25 (-> s5-0 data s3-0))) - (apply-haze-light obj (-> v1-25 col) (-> v1-25 nrm) s4-0) + (apply-haze-light this (-> v1-25 col) (-> v1-25 nrm) s4-0) ) ) ) @@ -572,7 +572,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod haze-vtx-to-sky sky-work ((obj sky-work) (arg0 sky-vertex) (arg1 sky-vertex) (arg2 haze-vertex)) +(defmethod haze-vtx-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 sky-vertex) (arg2 haze-vertex)) "Convert haze vertex to sky format." (set! (-> arg0 pos quad) (-> arg2 pos quad)) (set! (-> arg0 col quad) (-> arg2 col quad)) @@ -585,7 +585,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod draw-haze sky-work ((obj sky-work) (arg0 dma-buffer)) +(defmethod draw-haze sky-work ((this sky-work) (arg0 dma-buffer)) "Draw haze using large polygon renderer. Calls init-regs-for-large-polygon-draw." (local-vars (sv-16 haze-vert-array) (sv-20 (inline-array sky-vertex))) @@ -594,9 +594,9 @@ vf31: cam 0 (premultiplied by hmge) (rlet ((vf27 :class vf)) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))) ;; set up polygon regs - (init-regs-for-large-polygon-draw obj) - ;(.lvf vf27 (&-> obj giftag-haze quad)) - (set-sky-vf27 (&-> obj giftag-haze quad)) + (init-regs-for-large-polygon-draw this) + ;(.lvf vf27 (&-> this giftag-haze quad)) + (set-sky-vf27 (&-> this giftag-haze quad)) ;; convert to sky format (let ((s4-0 (the-as object (-> arg0 base)))) @@ -604,11 +604,11 @@ vf31: cam 0 (premultiplied by hmge) (set! sv-16 *haze-vert-array*) (set! sv-20 *haze-poly*) (dotimes (s3-0 35) - (haze-vtx-to-sky obj (-> sv-20 (* s3-0 4)) (-> sv-20 (+ (* s3-0 4) 1)) (-> sv-16 data s3-0)) - (haze-vtx-to-sky obj (-> sv-20 (+ (* s3-0 4) 3)) (-> sv-20 (+ (* s3-0 4) 2)) (-> sv-16 data (+ s3-0 1))) + (haze-vtx-to-sky this (-> sv-20 (* s3-0 4)) (-> sv-20 (+ (* s3-0 4) 1)) (-> sv-16 data s3-0)) + (haze-vtx-to-sky this (-> sv-20 (+ (* s3-0 4) 3)) (-> sv-20 (+ (* s3-0 4) 2)) (-> sv-16 data (+ s3-0 1))) ) - (haze-vtx-to-sky obj (-> sv-20 140) (-> sv-20 141) (-> sv-16 data 35)) - (haze-vtx-to-sky obj (-> sv-20 143) (-> sv-20 142) (the-as haze-vertex (-> sv-16 data))) + (haze-vtx-to-sky this (-> sv-20 140) (-> sv-20 141) (-> sv-16 data 35)) + (haze-vtx-to-sky this (-> sv-20 143) (-> sv-20 142) (the-as haze-vertex (-> sv-16 data))) ;; draw! (dotimes (s5-1 36) (render-sky-quad (the-as (inline-array sky-vertex) (-> sv-20 (* s5-1 4))) arg0) @@ -633,7 +633,7 @@ vf31: cam 0 (premultiplied by hmge) (defmethod-mips2c "(method 29 sky-work)" 29 sky-work) ;; green sun (defmethod-mips2c "(method 30 sky-work)" 30 sky-work) ;; moon -(defmethod setup-stars sky-work ((obj sky-work) (arg0 matrix) (arg1 sky-upload-data)) +(defmethod setup-stars sky-work ((this sky-work) (arg0 matrix) (arg1 sky-upload-data)) "Prepare for star drawing." (set! (-> arg0 vector 2 quad) (-> arg1 sun 0 pos quad)) (vector-normalize! (-> arg0 vector 2) 1.0) @@ -647,7 +647,7 @@ vf31: cam 0 (premultiplied by hmge) (let ((f0-1 (fmax 0.0 (fmin 1.0 (* 20.0 (+ 0.05 (-> s4-1 y))))))) (dotimes (v1-7 16) (let ((f1-4 (* (- 128.0 (* 8.0 (the float v1-7))) f0-1))) - (set-vector! (-> obj star-colors v1-7) (the int f1-4) (the int f1-4) (the int f1-4) 128) + (set-vector! (-> this star-colors v1-7) (the int f1-4) (the int f1-4) (the int f1-4) 128) ) ) ) @@ -659,7 +659,7 @@ vf31: cam 0 (premultiplied by hmge) (defmethod-mips2c "(method 32 sky-work)" 32 sky-work) ;; stars transform (defmethod-mips2c "(method 33 sky-work)" 33 sky-work) ;; stars dma -(defmethod draw-roof sky-work ((obj sky-work) (arg0 dma-buffer)) +(defmethod draw-roof sky-work ((this sky-work) (arg0 dma-buffer)) "Draw the roof of the sky box. Uses large-polygon renderer." (rlet ((vf27 :class vf)) ;; GS setup @@ -669,9 +669,9 @@ vf31: cam 0 (premultiplied by hmge) (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) ) ;; large polygon reg setup - (init-regs-for-large-polygon-draw obj) - ; (.lvf vf27 (&-> obj giftag-base quad)) - (set-sky-vf27 (&-> obj giftag-base quad)) + (init-regs-for-large-polygon-draw this) + ; (.lvf vf27 (&-> this giftag-base quad)) + (set-sky-vf27 (&-> this giftag-base quad)) ;; draw! (let ((s5-1 (the-as object (-> arg0 base)))) @@ -692,7 +692,7 @@ vf31: cam 0 (premultiplied by hmge) ) ) -(defmethod draw-base sky-work ((obj sky-work) (arg0 dma-buffer)) +(defmethod draw-base sky-work ((this sky-work) (arg0 dma-buffer)) "Draw the base of the sky box. Uses large-polygon renderer." (rlet ((vf27 :class vf)) (dma-buffer-add-gs-set arg0 @@ -700,8 +700,8 @@ vf31: cam 0 (premultiplied by hmge) ) (let ((s5-0 (the-as object (-> arg0 base)))) (&+! (-> arg0 base) 16) - ;(.lvf vf27 (&-> obj giftag-base quad)) - (set-sky-vf27 (&-> obj giftag-base quad)) + ;(.lvf vf27 (&-> this giftag-base quad)) + (set-sky-vf27 (&-> this giftag-base quad)) (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 0)) arg0) (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 3)) arg0) (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 6)) arg0) @@ -718,7 +718,7 @@ vf31: cam 0 (premultiplied by hmge) ) ) -(defmethod draw-fog sky-work ((obj sky-work) (arg0 dma-buffer)) +(defmethod draw-fog sky-work ((this sky-work) (arg0 dma-buffer)) (let ((s4-0 (-> *sky-texture-anim-array* array-data 8 tex))) (if s4-0 (dma-buffer-add-gs-set arg0 @@ -758,8 +758,8 @@ vf31: cam 0 (premultiplied by hmge) (f0-2 (/ (- (-> *fog-texture-work* corner 2 y) f0-0) f4-0)) (a0-28 6400) ) - (set! (-> v1-26 0 quad) (-> obj fog-tmpl dma-vif quad)) - (set! (-> v1-26 1 quad) (-> obj fog-tmpl quad 1)) + (set! (-> v1-26 0 quad) (-> this fog-tmpl dma-vif quad)) + (set! (-> v1-26 1 quad) (-> this fog-tmpl quad 1)) (set-vector! (-> v1-26 2 vector4w) #x80 #x80 #x80 #x80) (set-vector! (-> v1-26 3 vector) f3-0 0.0 1.0 0.0) (set-vector! (-> v1-26 4 vector4w) #x7000 #x7300 a0-28 0) @@ -775,7 +775,7 @@ vf31: cam 0 (premultiplied by hmge) (none) ) -(defmethod draw sky-work ((obj sky-work)) +(defmethod draw sky-work ((this sky-work)) (let ((v1-0 *time-of-day-context*) (a0-1 #f) ) @@ -800,14 +800,14 @@ vf31: cam 0 (premultiplied by hmge) ) ) ) - (update-matrix obj a1-7) + (update-matrix this a1-7) ) - (update-template-colors obj) - (adjust-haze-lighting obj) - (adjust-cloud-lighting obj) + (update-template-colors this) + (adjust-haze-lighting this) + (adjust-cloud-lighting this) (let ((s4-0 (the-as object *fake-scratchpad-data*))) - (mem-copy! (the-as pointer s4-0) (the-as pointer obj) #x2760) - (setup-stars (the-as sky-work s4-0) (-> (the-as sky-work s4-0) star-mat) (-> obj upload-data)) + (mem-copy! (the-as pointer s4-0) (the-as pointer this) #x2760) + (setup-stars (the-as sky-work s4-0) (-> (the-as sky-work s4-0) star-mat) (-> this upload-data)) (if (nonzero? (-> (the-as sky-work s4-0) star-colors 0 x)) (stars-transform-asm (the-as sky-work s4-0)) ) @@ -863,8 +863,8 @@ vf31: cam 0 (premultiplied by hmge) ;; (a0-46 #x7800) ;; (a1-36 #x7980) ;; ) - ;; (set! (-> a2-40 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - ;; (set! (-> a2-40 1 quad) (-> obj draw-tmpl2 quad 1)) + ;; (set! (-> a2-40 0 quad) (-> this draw-tmpl2 dma-vif quad)) + ;; (set! (-> a2-40 1 quad) (-> this draw-tmpl2 quad 1)) ;; (set-vector! (-> a2-40 2 vector4w) 128 128 128 128) ;; (set-vector! (-> a2-40 3 vector4w) 8 8 0 0) ;; (set-vector! (-> a2-40 4 vector4w) a3-7 t0-1 0 0) @@ -878,8 +878,8 @@ vf31: cam 0 (premultiplied by hmge) (a0-49 #x9000) (a1-37 #x8d00) ) - (set! (-> t0-4 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - (set! (-> t0-4 1 quad) (-> obj draw-tmpl2 quad 1)) + (set! (-> t0-4 0 quad) (-> this draw-tmpl2 dma-vif quad)) + (set! (-> t0-4 1 quad) (-> this draw-tmpl2 quad 1)) (set-vector! (-> t0-4 2 vector4w) 128 128 128 128) (set-vector! (-> t0-4 3 vector4w) 8 8 0 0) (set-vector! (-> t0-4 4 vector4w) a2-42 a3-9 0 0) @@ -892,8 +892,8 @@ vf31: cam 0 (premultiplied by hmge) (texflush 0) ) (let ((t0-11 (the-as (inline-array qword) (-> s4-1 base)))) - (set! (-> t0-11 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - (set! (-> t0-11 1 quad) (-> obj draw-tmpl2 quad 1)) + (set! (-> t0-11 0 quad) (-> this draw-tmpl2 dma-vif quad)) + (set! (-> t0-11 1 quad) (-> this draw-tmpl2 quad 1)) (set-vector! (-> t0-11 2 vector4w) 128 128 128 80) (set-vector! (-> t0-11 3 vector4w) 0 0 0 0) (set-vector! (-> t0-11 4 vector4w) a2-42 a3-9 0 0) @@ -917,8 +917,8 @@ vf31: cam 0 (premultiplied by hmge) ) (let ((t1-22 (the-as (inline-array qword) (-> s4-1 base))) ) - (set! (-> t1-22 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - (set! (-> t1-22 1 quad) (-> obj draw-tmpl2 quad 1)) + (set! (-> t1-22 0 quad) (-> this draw-tmpl2 dma-vif quad)) + (set! (-> t1-22 1 quad) (-> this draw-tmpl2 quad 1)) (set-vector! (-> t1-22 2 vector4w) a0-57 a1-46 a2-55 128) (set-vector! (-> t1-22 3 vector4w) (* 0 16) v1-57 0 0) (set-vector! (-> t1-22 4 vector4w) (* 1792 16) #x7300 0 0) @@ -938,8 +938,8 @@ vf31: cam 0 (premultiplied by hmge) ;; (let ((t5-0 (* (+ (* t0-12 16) 256) 16)) ;; (t4-5 (* (+ (* (+ t0-12 1) 16) 256) 16)) ;; ) - ;; (set! (-> t1-22 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - ;; (set! (-> t1-22 1 quad) (-> obj draw-tmpl2 quad 1)) + ;; (set! (-> t1-22 0 quad) (-> this draw-tmpl2 dma-vif quad)) + ;; (set! (-> t1-22 1 quad) (-> this draw-tmpl2 quad 1)) ;; (set-vector! (-> t1-22 2 vector4w) a0-57 a1-46 a2-55 128) ;; (set-vector! (-> t1-22 3 vector4w) (+ t5-0 8) (+ v1-57 24) 0 0) ;; (set-vector! (-> t1-22 4 vector4w) t3-0 #x7300 0 0) @@ -956,8 +956,8 @@ vf31: cam 0 (premultiplied by hmge) ;; (texflush 0) ;; ) ;; (let ((v1-63 (the-as (inline-array qword) (-> s4-1 base)))) - ;; (set! (-> v1-63 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - ;; (set! (-> v1-63 1 quad) (-> obj draw-tmpl2 quad 1)) + ;; (set! (-> v1-63 0 quad) (-> this draw-tmpl2 dma-vif quad)) + ;; (set! (-> v1-63 1 quad) (-> this draw-tmpl2 quad 1)) ;; (set-vector! (-> v1-63 2 vector4w) a0-57 a1-46 a2-55 (the int (- 128.0 (* 48.0 f0-0)))) ;; (set-vector! (-> v1-63 3 vector4w) 0 24 0 0) ;; (set-vector! (-> v1-63 4 vector4w) #x7000 #x7300 0 0) @@ -987,8 +987,8 @@ vf31: cam 0 (premultiplied by hmge) ) ) (let ((v1-78 (the-as (inline-array qword) (-> s4-1 base)))) - (set! (-> v1-78 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-78 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-78 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-78 1 quad) (-> this sprite-tmpl quad 1)) ) (&+! (-> s4-1 base) 32) (let ((v1-81 (the-as (inline-array qword) (-> s4-1 base)))) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc index e3238a891f..f2582a7bde 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher.gc @@ -784,18 +784,18 @@ ) ) -(defmethod initialize sparticle-launch-control ((obj sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) +(defmethod initialize sparticle-launch-control ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) (let ((s5-0 0)) - (set! (-> obj group) arg0) - (set! (-> obj proc) (the-as process-drawable arg1)) - (set! (-> obj local-clock) 0) - (set! (-> obj fade) 1.0) - (set! (-> obj matrix) 0) - (set! (-> obj last-spawn-frame) (the-as int (+ (-> *display* real-frame-clock integral-frame-counter) -2))) - (set! (-> obj last-spawn-time) 0) - (if (logtest? (-> obj group flags) (sp-group-flag unk-4)) - (quaternion->matrix (-> obj origin) (-> (the-as process-drawable arg1) root quat)) - (matrix-identity! (-> obj origin)) + (set! (-> this group) arg0) + (set! (-> this proc) (the-as process-drawable arg1)) + (set! (-> this local-clock) 0) + (set! (-> this fade) 1.0) + (set! (-> this matrix) 0) + (set! (-> this last-spawn-frame) (the-as int (+ (-> *display* real-frame-clock integral-frame-counter) -2))) + (set! (-> this last-spawn-time) 0) + (if (logtest? (-> this group flags) (sp-group-flag unk-4)) + (quaternion->matrix (-> this origin) (-> (the-as process-drawable arg1) root quat)) + (matrix-identity! (-> this origin)) ) (when (logtest? (-> arg0 flags) (sp-group-flag unk-6)) (let ((f0-1 (-> arg0 rotate-x)) @@ -810,7 +810,7 @@ (set! (-> a1-2 z) f2-0) (set! (-> a1-2 w) 1.0) (let ((a1-3 (t9-2 a0-3 a1-2))) - (matrix*! (-> obj origin) a1-3 (-> obj origin)) + (matrix*! (-> this origin) a1-3 (-> this origin)) ) ) ) @@ -821,13 +821,13 @@ (set! (-> a1-4 z) (-> arg0 scale-z)) (set! (-> a1-4 w) 1.0) (set! (-> a1-4 w) 1.0) - (scale-matrix! (-> obj origin) a1-4 (-> obj origin)) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) ) ) (dotimes (s3-0 (-> arg0 length)) (let* ((a0-7 (-> arg0 launcher s3-0)) (a1-6 (-> *part-id-table* (-> a0-7 launcher))) - (v1-29 (-> obj data s5-0)) + (v1-29 (-> this data s5-0)) ) (when (nonzero? a1-6) (set! (-> v1-29 group-item) a0-7) @@ -846,7 +846,7 @@ ) (else (logior! (-> v1-29 flags) (sp-launch-state-flags launcher-active)) - (set! (-> v1-29 center) (-> obj origin trans)) + (set! (-> v1-29 center) (-> this origin trans)) (set! (-> v1-29 sprite3d) #f) (set! (-> v1-29 sprite) #f) ) @@ -860,63 +860,63 @@ ) ) ) - (set! (-> obj length) s5-0) + (set! (-> this length) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch object vs sparticle-launch-control. -(defmethod create-launch-control sparticle-launch-group ((obj sparticle-launch-group) (arg0 process)) - (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> obj length))))) +(defmethod create-launch-control sparticle-launch-group ((this sparticle-launch-group) (arg0 process)) + (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> this length))))) (when (zero? (the-as sparticle-launch-control gp-0)) (go process-drawable-art-error "memory") (set! gp-0 0) (goto cfg-4) ) - (initialize (the-as sparticle-launch-control gp-0) obj arg0) + (initialize (the-as sparticle-launch-control gp-0) this arg0) (label cfg-4) (the-as sparticle-launch-control gp-0) ) ) -(defmethod kill-and-free-particles sparticle-launch-control ((obj sparticle-launch-control)) - (countdown (v1-0 (-> obj length)) - (let ((a0-4 (-> obj data v1-0))) +(defmethod kill-and-free-particles sparticle-launch-control ((this sparticle-launch-control)) + (countdown (v1-0 (-> this length)) + (let ((a0-4 (-> this data v1-0))) (logclear! (-> a0-4 flags) (sp-launch-state-flags particles-active)) ) ) - (set! (-> obj local-clock) 0) - (set! (-> obj fade) 1.0) - (kill-all-particles-with-key obj) - (if (> (-> obj matrix) 0) - (sprite-release-user-hvdf (-> obj matrix)) + (set! (-> this local-clock) 0) + (set! (-> this fade) 1.0) + (kill-all-particles-with-key this) + (if (> (-> this matrix) 0) + (sprite-release-user-hvdf (-> this matrix)) ) 0 (none) ) -(defmethod kill-particles sparticle-launch-control ((obj sparticle-launch-control)) - (kill-all-particles-with-key obj) +(defmethod kill-particles sparticle-launch-control ((this sparticle-launch-control)) + (kill-all-particles-with-key this) 0 (none) ) -(defmethod is-visible? sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) - (let* ((v1-0 (-> obj group)) +(defmethod is-visible? sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) + (let* ((v1-0 (-> this group)) (f0-0 (-> v1-0 bounds r)) ) (cond ((= f0-0 0.0) #t ) - ((nonzero? (-> obj matrix)) + ((nonzero? (-> this matrix)) #t ) (else (let ((s5-1 (vector+! (new 'stack-no-clear 'vector) arg0 (the-as vector (-> v1-0 bounds))))) (set! (-> s5-1 w) f0-0) - (when (or *display-sprite-marks* *display-sprite-spheres* (and *display-actor-vis* (= (-> obj proc) *debug-actor*))) + (when (or *display-sprite-marks* *display-sprite-spheres* (and *display-actor-vis* (= (-> this proc) *debug-actor*))) (add-debug-sphere *display-sprite-spheres* (bucket-id debug2) @@ -924,7 +924,7 @@ (-> s5-1 w) (new 'static 'rgba :g #xff :a #x80) ) - (add-debug-matrix *display-sprite-marks* (bucket-id debug2) (-> obj origin) (meters 2)) + (add-debug-matrix *display-sprite-marks* (bucket-id debug2) (-> this origin) (meters 2)) ) ;; og:preserve-this ;; can we see it? @@ -942,8 +942,8 @@ ) ) -(defmethod spawn-with-matrix sparticle-launch-control ((obj sparticle-launch-control) (arg0 matrix)) - (let* ((a2-0 (-> obj origin)) +(defmethod spawn-with-matrix sparticle-launch-control ((this sparticle-launch-control) (arg0 matrix)) + (let* ((a2-0 (-> this origin)) (a3-0 arg0) (v1-0 (-> a3-0 quad 0)) (a0-1 (-> a3-0 quad 1)) @@ -955,7 +955,7 @@ (set! (-> a2-0 quad 2) a1-1) (set! (-> a2-0 trans quad) a3-1) ) - (let ((s4-0 (-> obj group))) + (let ((s4-0 (-> this group))) (when (logtest? (-> s4-0 flags) (sp-group-flag unk-6)) (let ((f0-0 (-> s4-0 rotate-x)) (f1-0 (-> s4-0 rotate-y)) @@ -969,7 +969,7 @@ (set! (-> a1-2 z) f2-0) (set! (-> a1-2 w) 1.0) (let ((a1-3 (t9-0 a0-2 a1-2))) - (matrix*! (-> obj origin) a1-3 (-> obj origin)) + (matrix*! (-> this origin) a1-3 (-> this origin)) ) ) ) @@ -980,16 +980,16 @@ (set! (-> a1-4 z) (-> s4-0 scale-z)) (set! (-> a1-4 w) 1.0) (set! (-> a1-4 w) 1.0) - (scale-matrix! (-> obj origin) a1-4 (-> obj origin)) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) ) ) ) - (spawn obj (-> arg0 trans)) + (spawn this (-> arg0 trans)) (none) ) -(defmethod spawn-with-cspace sparticle-launch-control ((obj sparticle-launch-control) (arg0 cspace)) - (let* ((v1-0 (-> obj origin)) +(defmethod spawn-with-cspace sparticle-launch-control ((this sparticle-launch-control) (arg0 cspace)) + (let* ((v1-0 (-> this origin)) (a3-0 (-> arg0 bone transform)) (a0-2 (-> a3-0 quad 0)) (a1-1 (-> a3-0 quad 1)) @@ -1001,7 +1001,7 @@ (set! (-> v1-0 quad 2) a2-0) (set! (-> v1-0 trans quad) a3-1) ) - (let ((s4-0 (-> obj group))) + (let ((s4-0 (-> this group))) (when (logtest? (-> s4-0 flags) (sp-group-flag unk-6)) (let ((f0-0 (-> s4-0 rotate-x)) (f1-0 (-> s4-0 rotate-y)) @@ -1015,7 +1015,7 @@ (set! (-> a1-2 z) f2-0) (set! (-> a1-2 w) 1.0) (let ((a1-3 (t9-0 a0-3 a1-2))) - (matrix*! (-> obj origin) a1-3 (-> obj origin)) + (matrix*! (-> this origin) a1-3 (-> this origin)) ) ) ) @@ -1026,35 +1026,35 @@ (set! (-> a1-4 z) (-> s4-0 scale-z)) (set! (-> a1-4 w) 1.0) (set! (-> a1-4 w) 1.0) - (scale-matrix! (-> obj origin) a1-4 (-> obj origin)) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) ) ) ) - (spawn obj (vector<-cspace! (-> obj origin trans) arg0)) + (spawn this (vector<-cspace! (-> this origin trans) arg0)) (none) ) ;; WARN: Function (method 11 sparticle-launch-control) has a return type of none, but the expression builder found a return statement. -(defmethod spawn sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) +(defmethod spawn sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) (with-pp - (set! (-> obj origin trans quad) (-> arg0 quad)) - (if (not (or (is-visible? obj arg0) (logtest? (-> obj group flags) (sp-group-flag always-draw screen-space)))) + (set! (-> this origin trans quad) (-> arg0 quad)) + (if (not (or (is-visible? this arg0) (logtest? (-> this group flags) (sp-group-flag always-draw screen-space)))) (return 0) ) (let ((s4-0 (the-as int (current-time))) - (s5-0 (-> obj last-spawn-time)) + (s5-0 (-> this last-spawn-time)) ) (let ((v1-10 (-> *display* real-frame-clock integral-frame-counter))) - (if (!= v1-10 (+ (-> obj last-spawn-frame) 1)) + (if (!= v1-10 (+ (-> this last-spawn-frame) 1)) (set! s5-0 (the-as int (- (the-as time-frame s4-0) (logand (the-as int (-> pp clock sparticle-data x)) 255)))) ) ) - (set! (-> obj last-spawn-frame) (the-as int (-> *display* real-frame-clock integral-frame-counter))) - (set! (-> obj last-spawn-time) s4-0) - (when (logtest? (-> obj group flags) (sp-group-flag use-local-clock)) - (set! s5-0 (-> obj local-clock)) - (+! (-> obj local-clock) (logand (the-as int (-> pp clock sparticle-data x)) 255)) - (set! s4-0 (-> obj local-clock)) + (set! (-> this last-spawn-frame) (the-as int (-> *display* real-frame-clock integral-frame-counter))) + (set! (-> this last-spawn-time) s4-0) + (when (logtest? (-> this group flags) (sp-group-flag use-local-clock)) + (set! s5-0 (-> this local-clock)) + (+! (-> this local-clock) (logand (the-as int (-> pp clock sparticle-data x)) 255)) + (set! s4-0 (-> this local-clock)) ) (let* ((f30-0 (vector-vector-distance arg0 (math-camera-pos))) (v1-26 1) @@ -1066,7 +1066,7 @@ ) ) ) - (if (nonzero? (-> obj matrix)) + (if (nonzero? (-> this matrix)) (set! f30-0 0.0) ) @@ -1075,11 +1075,11 @@ (if (not (-> *pc-settings* ps2-parts?)) (set! f30-0 0.0))) - (let ((s2-1 (-> obj length))) + (let ((s2-1 (-> this length))) (b! #t cfg-95 :delay (nop!)) (label cfg-19) (+! s2-1 -1) - (let* ((a3-0 (-> obj data s2-1)) + (let* ((a3-0 (-> this data s2-1)) (v1-33 (-> a3-0 group-item)) (a1-4 (-> *part-id-table* (-> v1-33 launcher))) ) @@ -1111,7 +1111,7 @@ (label cfg-35) (set! a0-36 *sp-particle-system-2d*) (label cfg-36) - (t9-3 a0-36 a1-4 (-> obj origin) a3-0 obj f0-5) + (t9-3 a0-36 a1-4 (-> this origin) a3-0 this f0-5) ) ) (b! #t cfg-41 :delay (nop!)) @@ -1125,7 +1125,7 @@ (a2-4 *launch-matrix*) ) (set! (-> a2-4 trans quad) (-> a3-0 center quad)) - (t9-4 a0-38 a1-4 a2-4 a3-0 obj f0-5) + (t9-4 a0-38 a1-4 a2-4 a3-0 this f0-5) ) ) ) @@ -1148,8 +1148,8 @@ 0 (let* ((a2-5 (-> v1-33 length)) (a0-57 (-> v1-33 period)) - (t0-10 (mod (+ (- s5-0 (the-as int (-> obj data s2-1 offset))) a0-57) (the-as int a0-57))) - (a0-58 (mod (the-as uint (+ (- s4-0 (the-as int (-> obj data s2-1 offset))) a0-57)) a0-57)) + (t0-10 (mod (+ (- s5-0 (the-as int (-> this data s2-1 offset))) a0-57) (the-as int a0-57))) + (a0-58 (mod (the-as uint (+ (- s4-0 (the-as int (-> this data s2-1 offset))) a0-57)) a0-57)) ) (set! f0-5 (cond ((and (< t0-10 (the-as int a2-5)) (< (the-as int a0-58) (the-as int a2-5))) @@ -1166,11 +1166,11 @@ 0 (goto cfg-93) ) - (when (< (the-as uint (- s4-0 (the-as int (-> obj data s2-1 spawn-time)))) (-> v1-33 period)) + (when (< (the-as uint (- s4-0 (the-as int (-> this data s2-1 spawn-time)))) (-> v1-33 period)) 0 (goto cfg-93) ) - (set! (-> obj data s2-1 offset) (- (-> v1-33 period) a0-58)) + (set! (-> this data s2-1 offset) (- (-> v1-33 period) a0-58)) (* 0.2 (the float (- s4-0 s5-0)) f0-5) ) ) @@ -1191,9 +1191,9 @@ *sp-particle-system-2d* ) a1-4 - (-> obj origin) + (-> this origin) :launch-state a3-0 - :launch-control obj + :launch-control this :rate f0-5 :origin-is-matrix #t ) @@ -1208,7 +1208,7 @@ (a2-22 *launch-matrix*) ) (set! (-> a2-22 trans quad) (-> a3-0 center quad)) - (t9-6 a0-83 a1-4 a2-22 a3-0 obj f0-5) + (t9-6 a0-83 a1-4 a2-22 a3-0 this f0-5) ) ) ) @@ -1979,14 +1979,14 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod get-field-spec-by-id sparticle-launcher ((obj sparticle-launcher) (arg0 sp-field-id)) +(defmethod get-field-spec-by-id sparticle-launcher ((this sparticle-launcher) (arg0 sp-field-id)) "Returns the [[sp-field-init-spec]] that has the matching [[sp-field-id]]" (let ((v1-0 0)) (until #f - (let ((a2-2 (-> obj init-specs v1-0 field))) + (let ((a2-2 (-> this init-specs v1-0 field))) (cond ((= a2-2 arg0) - (return (-> obj init-specs v1-0)) + (return (-> this init-specs v1-0)) ) ((or (< (the-as uint arg0) (the-as uint a2-2)) (= a2-2 (sp-field-id spt-end))) (return (the-as sp-field-init-spec #f)) @@ -2001,15 +2001,15 @@ (the-as sp-field-init-spec #f) ) -(defmethod setup-user-array sparticle-launcher ((obj sparticle-launcher) (arg0 string)) - (let ((s5-0 (get-field-spec-by-id obj (sp-field-id spt-texture))) +(defmethod setup-user-array sparticle-launcher ((this sparticle-launcher) (arg0 string)) + (let ((s5-0 (get-field-spec-by-id this (sp-field-id spt-texture))) (v1-1 (lookup-texture-id-by-name arg0 (the-as string #f))) ) (if s5-0 (set! (-> s5-0 initial-valuef) (the-as float v1-1)) ) ) - (let ((v1-3 (get-field-spec-by-id obj (sp-field-id spt-userdata)))) + (let ((v1-3 (get-field-spec-by-id this (sp-field-id spt-userdata)))) (when (and v1-3 (= (-> v1-3 flags) (sp-flag object))) (let ((gp-1 (the-as object (-> v1-3 initial-valuef)))) (when (and (= (logand (the-as int gp-1) 7) 4) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc index 088dc50dc7..0328291976 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle.gc @@ -12,13 +12,13 @@ ;; DECOMP BEGINS -(defmethod print sparticle-cpuinfo ((obj sparticle-cpuinfo)) +(defmethod print sparticle-cpuinfo ((this sparticle-cpuinfo)) (format #t "~%") (dotimes (s5-0 16) - (format #t "~D:~F~%" s5-0 (the-as float (-> obj data s5-0))) + (format #t "~D:~F~%" s5-0 (the-as float (-> this data s5-0))) ) - (format #t "TIMER:~D~%" (-> obj timer)) - (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> obj flags))) + (format #t "TIMER:~D~%" (-> this timer)) + (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> this flags))) ) (defun sp-particle-copy! ((arg0 sparticle-cpuinfo) (arg1 sparticle-cpuinfo)) diff --git a/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc b/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc index 361aadf532..58548f8e20 100644 --- a/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc @@ -8,18 +8,18 @@ ;; DECOMP BEGINS (deftype sprite-glow-data (structure) - ((position vector :inline :offset-assert 0) - (size-x float :offset 12) - (size-probe float :offset-assert 16) - (z-offset float :offset-assert 20) - (rot-angle float :offset-assert 24) - (size-y float :offset-assert 28) - (color rgbaf :inline :offset-assert 32) - (fade-a float :offset-assert 48) - (fade-b float :offset-assert 52) - (tex-id texture-id :offset-assert 56) - (dummy uint32 :offset-assert 60) - (quads vector 4 :inline :offset 0) + ((position vector :inline :offset-assert 0) + (size-x float :offset 12) + (size-probe float :offset-assert 16) + (z-offset float :offset-assert 20) + (rot-angle float :offset-assert 24) + (size-y float :offset-assert 28) + (color rgbaf :inline :offset-assert 32) + (fade-a float :offset-assert 48) + (fade-b float :offset-assert 52) + (tex-id texture-id :offset-assert 56) + (dummy uint32 :offset-assert 60) + (quads vector 4 :inline :offset 0) ) :method-count-assert 10 :size-assert #x40 @@ -30,19 +30,19 @@ ) -(defmethod set-trans sprite-glow-data ((obj sprite-glow-data) (arg0 vector)) - (let ((f0-0 (-> obj position w))) - (set! (-> obj position quad) (-> arg0 quad)) - (set! (-> obj position w) f0-0) +(defmethod set-trans sprite-glow-data ((this sprite-glow-data) (arg0 vector)) + (let ((f0-0 (-> this position w))) + (set! (-> this position quad) (-> arg0 quad)) + (set! (-> this position w) f0-0) ) 0 (none) ) (deftype simple-sprite-system (structure) - ((count int16 :offset-assert 0) - (max-count int16 :offset-assert 2) - (data (inline-array sprite-glow-data) :offset-assert 4) + ((count int16 :offset-assert 0) + (max-count int16 :offset-assert 2) + (data (inline-array sprite-glow-data) :offset-assert 4) ) :method-count-assert 12 :size-assert #x8 diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc b/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc index 66077fca5c..a7a370b16f 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-glow.gc @@ -581,10 +581,10 @@ (none) ) -(defmethod add! simple-sprite-system ((obj simple-sprite-system) (arg0 sprite-glow-data)) - (let ((v1-0 (-> obj count))) - (when (< v1-0 (-> obj max-count)) - (let* ((a2-3 (-> obj data v1-0)) +(defmethod add! simple-sprite-system ((this simple-sprite-system) (arg0 sprite-glow-data)) + (let ((v1-0 (-> this count))) + (when (< v1-0 (-> this max-count)) + (let* ((a2-3 (-> this data v1-0)) (v1-2 arg0) (a1-1 a2-3) (a2-4 (-> v1-2 position quad)) @@ -597,7 +597,7 @@ (set! (-> a1-1 color quad) t0-0) (set! (-> a1-1 quads 3 quad) v1-3) ) - (+! (-> obj count) 1) + (+! (-> this count) 1) ) ) 0 @@ -620,20 +620,20 @@ ) ) -(defmethod draw-all-sprites! simple-sprite-system ((obj simple-sprite-system) (arg0 dma-buffer)) +(defmethod draw-all-sprites! simple-sprite-system ((this simple-sprite-system) (arg0 dma-buffer)) (local-vars (sv-528 sprite-glow-dma-packet-data) (sv-532 (pointer texture-id)) (sv-536 pointer)) - (b! (zero? (-> obj count)) cfg-13 :delay (nop!)) + (b! (zero? (-> this count)) cfg-13 :delay (nop!)) (set! sv-528 *sprite-glow-dma-packet-data*) (set! sv-532 (new 'stack-no-clear 'array 'texture-id 128)) (set! sv-536 (-> arg0 base)) - (when (> (-> obj count) 128) - (format 0 "TOO MANY SPRITES (~D)~%" (-> obj count)) + (when (> (-> this count) 128) + (format 0 "TOO MANY SPRITES (~D)~%" (-> this count)) (break!) ) - (dotimes (v1-5 (-> obj count)) - (set! (-> sv-532 v1-5) (-> obj data v1-5 tex-id)) + (dotimes (v1-5 (-> this count)) + (set! (-> sv-532 v1-5) (-> this data v1-5 tex-id)) ) - (countdown (s4-0 (-> obj count)) + (countdown (s4-0 (-> this count)) (let ((s3-0 (-> sv-532 s4-0))) (when (nonzero? s3-0) (let ((s2-0 (add-shader-to-dma arg0))) @@ -641,7 +641,7 @@ (countdown (s1-1 (+ s4-0 1)) (when (= s3-0 (-> sv-532 s1-1)) (set! (-> sv-532 s1-1) (new 'static 'texture-id)) - (let ((a2-1 (-> obj data s1-1))) + (let ((a2-1 (-> this data s1-1))) (sprite-glow-add-simple-sprite arg0 sv-528 a2-1 (the-as pointer s2-0)) ) ) @@ -655,8 +655,8 @@ (none) ) -(defmethod clear! simple-sprite-system ((obj simple-sprite-system)) - (set! (-> obj count) 0) +(defmethod clear! simple-sprite-system ((this simple-sprite-system)) + (set! (-> this count) 0) 0 (none) ) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-h.gc b/goal_src/jak2/engine/gfx/sprite/sprite-h.gc index 9fb98a9ed1..d67e3781c3 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-h.gc @@ -43,6 +43,7 @@ :flag-assert #x900000030 ) + (deftype sprite-array-2d (basic) ((num-sprites int32 2 :offset-assert 4) (num-valid int32 2 :offset-assert 12) @@ -59,6 +60,7 @@ ) ) + (deftype sprite-vec-data-3d (structure) ((x-y-z-sx vector :inline :offset-assert 0) (qx-qy-qz-sy vector :inline :offset-assert 16) @@ -85,6 +87,7 @@ :flag-assert #x900000030 ) + (deftype sprite-array-3d (basic) ((num-sprites int32 2 :offset-assert 4) (num-valid int32 2 :offset-assert 12) diff --git a/goal_src/jak2/engine/gfx/texture/texture-anim.gc b/goal_src/jak2/engine/gfx/texture/texture-anim.gc index bec2dc0774..79300226a3 100644 --- a/goal_src/jak2/engine/gfx/texture/texture-anim.gc +++ b/goal_src/jak2/engine/gfx/texture/texture-anim.gc @@ -1830,18 +1830,18 @@ struct SlimeInput { (none) ) -(defmethod init! texture-anim-array ((obj texture-anim-array)) - (dotimes (s5-0 (-> obj length)) - (init-textures! (-> obj array-data s5-0)) +(defmethod init! texture-anim-array ((this texture-anim-array)) + (dotimes (s5-0 (-> this length)) + (init-textures! (-> this array-data s5-0)) ) - obj + this ) -(defmethod clear! texture-anim-array ((obj texture-anim-array)) - (dotimes (s5-0 (-> obj length)) - (clear-textures! (-> obj array-data s5-0)) +(defmethod clear! texture-anim-array ((this texture-anim-array)) + (dotimes (s5-0 (-> this length)) + (clear-textures! (-> this array-data s5-0)) ) - obj + this ) ;; og:preserve-this added macro @@ -1862,24 +1862,24 @@ struct SlimeInput { ;; definition for method 9 of type texture-anim ;; INFO: Used lq/sq -(defmethod init-textures! texture-anim ((obj texture-anim)) +(defmethod init-textures! texture-anim ((this texture-anim)) (local-vars (a3-3 uint128) (sv-16 texture-page)) - (when (logtest? (the-as int (-> obj func)) 1) - (assert-symbol-is-function (-> obj func)) ;; added - (set! (-> obj func) (the-as (function dma-buffer texture-anim int) (-> (the-as symbol (-> obj func)) value))) + (when (logtest? (the-as int (-> this func)) 1) + (assert-symbol-is-function (-> this func)) ;; added + (set! (-> this func) (the-as (function dma-buffer texture-anim int) (-> (the-as symbol (-> this func)) value))) ) - (when (logtest? (the-as int (-> obj init-func)) 1) + (when (logtest? (the-as int (-> this init-func)) 1) ;; og:preserve-this added - (assert-symbol-is-function (-> obj init-func)) - (set! (-> obj init-func) (the-as (function texture-anim int) (-> (the-as symbol (-> obj init-func)) value))) - (if (-> obj init-func) - ((-> obj init-func) obj) + (assert-symbol-is-function (-> this init-func)) + (set! (-> this init-func) (the-as (function texture-anim int) (-> (the-as symbol (-> this init-func)) value))) + (if (-> this init-func) + ((-> this init-func) this) ) ) - (when (-> obj tex-name) + (when (-> this tex-name) (set! sv-16 (the-as texture-page #f)) - (let ((a0-3 (lookup-level-texture-by-name (-> obj tex-name) (-> *level* loading-level) (& sv-16)))) - (set! (-> obj tex) a0-3) + (let ((a0-3 (lookup-level-texture-by-name (-> this tex-name) (-> *level* loading-level) (& sv-16)))) + (set! (-> this tex) a0-3) (when (and a0-3 sv-16) 0 (cond @@ -1890,7 +1890,7 @@ struct SlimeInput { (a1-5 (+ (-> v1-22 dest) (-> v1-22 size))) (a0-7 2048) ) - (set! (-> obj tex clutdest) (* (shr (+ a1-5 2047) 11) 32)) + (set! (-> this tex clutdest) (* (shr (+ a1-5 2047) 11) 32)) (+! (-> sv-16 size) a0-7) (+! (-> v1-22 size) a0-7) ) @@ -1904,7 +1904,7 @@ struct SlimeInput { (a1-19 (+ (-> v1-26 dest) (-> v1-26 size))) (a0-12 (shl (sar (+ (* (-> a0-3 w) (-> a0-3 h)) 2047) 11) 11)) ) - (set! (-> obj tex dest 0) (* (shr (+ a1-19 2047) 11) 32)) + (set! (-> this tex dest 0) (* (shr (+ a1-19 2047) 11) 32)) (+! (-> sv-16 size) a0-12) (+! (-> v1-26 size) a0-12) ) @@ -1915,16 +1915,16 @@ struct SlimeInput { ) ) ) - (dotimes (s5-0 (the-as int (-> obj num-layers))) - (initialize-texture! (-> obj data s5-0)) + (dotimes (s5-0 (the-as int (-> this num-layers))) + (initialize-texture! (-> this data s5-0)) ) - (let ((v1-34 (-> obj tex))) + (let ((v1-34 (-> this tex))) (when v1-34 (dotimes (a0-15 3) (set! (-> v1-34 masks data a0-15 mask quad) (the-as uint128 0)) ) - (dotimes (a0-18 (the-as int (-> obj num-layers))) - (let ((a1-33 (-> obj data a0-18 tex))) + (dotimes (a0-18 (the-as int (-> this num-layers))) + (let ((a1-33 (-> this data a0-18 tex))) (when a1-33 (dotimes (a2-8 3) (let ((a3-2 (-> v1-34 masks data a2-8 mask quad)) @@ -1939,46 +1939,46 @@ struct SlimeInput { ) ) ) - obj + this ) -(defmethod clear-textures! texture-anim ((obj texture-anim)) - (set! (-> obj tex) #f) - (dotimes (s5-0 (the-as int (-> obj num-layers))) - (clear-texture! (-> obj data s5-0)) +(defmethod clear-textures! texture-anim ((this texture-anim)) + (set! (-> this tex) #f) + (dotimes (s5-0 (the-as int (-> this num-layers))) + (clear-texture! (-> this data s5-0)) ) - obj + this ) -(defmethod initialize-texture! texture-anim-layer ((obj texture-anim-layer)) - (when (logtest? (the-as int (-> obj func)) 1) +(defmethod initialize-texture! texture-anim-layer ((this texture-anim-layer)) + (when (logtest? (the-as int (-> this func)) 1) ;; og:preserve-this added - (assert-symbol-is-function (-> obj func)) - (set! (-> obj func) (the-as + (assert-symbol-is-function (-> this func)) + (set! (-> this func) (the-as (function dma-buffer uint int int texture-anim-layer float int) - (-> (the-as symbol (-> obj func)) value) + (-> (the-as symbol (-> this func)) value) ) ) ) - (when (logtest? (the-as int (-> obj init-func)) 1) + (when (logtest? (the-as int (-> this init-func)) 1) ;; og:preserve-this added - (assert-symbol-is-function (-> obj init-func)) - (set! (-> obj init-func) - (the-as (function texture-anim-layer int) (-> (the-as symbol (-> obj init-func)) value)) + (assert-symbol-is-function (-> this init-func)) + (set! (-> this init-func) + (the-as (function texture-anim-layer int) (-> (the-as symbol (-> this init-func)) value)) ) - (if (-> obj init-func) - ((-> obj init-func) obj) + (if (-> this init-func) + ((-> this init-func) this) ) ) - (if (-> obj tex-name) - (set! (-> obj tex) - (lookup-level-texture-by-name (-> obj tex-name) (-> *level* loading-level) (the-as (pointer texture-page) #f)) + (if (-> this tex-name) + (set! (-> this tex) + (lookup-level-texture-by-name (-> this tex-name) (-> *level* loading-level) (the-as (pointer texture-page) #f)) ) ) - obj + this ) -(defmethod clear-texture! texture-anim-layer ((obj texture-anim-layer)) - (set! (-> obj tex) #f) - obj +(defmethod clear-texture! texture-anim-layer ((this texture-anim-layer)) + (set! (-> this tex) #f) + this ) \ No newline at end of file diff --git a/goal_src/jak2/engine/gfx/texture/texture.gc b/goal_src/jak2/engine/gfx/texture/texture.gc index a705d63777..62f0d1d915 100644 --- a/goal_src/jak2/engine/gfx/texture/texture.gc +++ b/goal_src/jak2/engine/gfx/texture/texture.gc @@ -60,46 +60,46 @@ additionally, some texture pages have a chunk system that allows more specific c ;; DECOMP BEGINS -(defmethod print texture-page ((obj texture-page)) +(defmethod print texture-page ((this texture-page)) "Print a texture page with name and size." (format #t "#" - (-> obj name) - (-> obj length) - (shr (-> obj segment 0 dest) 6) - (shr (+ (-> obj size) 255) 8) - obj + (-> this name) + (-> this length) + (shr (-> this segment 0 dest) 6) + (shr (+ (-> this size) 255) 8) + this ) - obj + this ) -(defmethod length texture-page ((obj texture-page)) +(defmethod length texture-page ((this texture-page)) "Get the number of textures in a texture-page." - (-> obj length) + (-> this length) ) -(defmethod asize-of texture-page ((obj texture-page)) +(defmethod asize-of texture-page ((this texture-page)) "Get the size, in bytes, of a texture-page. Note that this does not include the texture objects, or the texture data." - (the-as int (+ (-> obj type size) (* (-> obj length) 4))) + (the-as int (+ (-> this type size) (* (-> this length) 4))) ) -(defmethod mem-usage texture-page ((obj texture-page) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage texture-page ((this texture-page) (arg0 memory-usage-block) (arg1 int)) "Get the amount of memory used by a texture page, including texture and texture data." (set! (-> arg0 length) (max 83 (-> arg0 length))) (set! (-> arg0 data 82 name) "texture") - (+! (-> arg0 data 82 count) (-> obj length)) + (+! (-> arg0 data 82 count) (-> this length)) ;; og:preserve-this note: in jak 1 this + was a - for reasons I do not understand. - (let ((v1-7 (+ (asize-of obj) (* (-> obj dram-size) 4)))) + (let ((v1-7 (+ (asize-of this) (* (-> this dram-size) 4)))) ;; also add the size of the texture objects. - (dotimes (a0-6 (-> obj length)) - (if (-> obj data a0-6) + (dotimes (a0-6 (-> this length)) + (if (-> this data a0-6) (+! v1-7 112) ) ) (+! (-> arg0 data 82 used) v1-7) (+! (-> arg0 data 82 total) (logand -16 (+ v1-7 15))) ) - obj + this ) ;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -197,25 +197,25 @@ additionally, some texture pages have a chunk system that allows more specific c ;; each texture is just some metadata about a texture, including its location in vram ;; and format settings. -(defmethod print texture ((obj texture)) +(defmethod print texture ((this texture)) (format #t "# obj name) - (psm->string (-> obj psm)) ;; format - (-> obj w) - (-> obj h) - (-> obj num-mips) - (shr (-> obj size) 8) + (-> this name) + (psm->string (-> this psm)) ;; format + (-> this w) + (-> this h) + (-> this num-mips) + (shr (-> this size) 8) ) ;; print the location and size of each mip level - (dotimes (s5-1 (the-as int (-> obj num-mips))) - (format #t " #x~X/~X" (-> obj dest s5-1) (-> obj width s5-1)) + (dotimes (s5-1 (the-as int (-> this num-mips))) + (format #t " #x~X/~X" (-> this dest s5-1) (-> this width s5-1)) ) ;; print clut (color look up table) location in vram - (if (< (texture-bpp (-> obj psm)) 16) - (format #t " :clut #x~X/1" (-> obj clutdest)) + (if (< (texture-bpp (-> this psm)) 16) + (format #t " :clut #x~X/1" (-> this clutdest)) ) - (format #t " @ #x~X>" obj) - obj + (format #t " @ #x~X>" this) + this ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -393,10 +393,10 @@ additionally, some texture pages have a chunk system that allows more specific c ;; at boot time and isn't used at runtime. VRAM is often resued for multiple textures in a single frame, ;; and the common segment does more complicated management at runtime. -(defmethod allocate-vram-words! texture-pool ((obj texture-pool) (num-words int)) +(defmethod allocate-vram-words! texture-pool ((this texture-pool) (num-words int)) "Allocate the given number of vram words." - (let ((v0-0 (-> obj cur))) - (+! (-> obj cur) num-words) + (let ((v0-0 (-> this cur))) + (+! (-> this cur) num-words) v0-0 ) ) @@ -411,7 +411,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; not any specific level/art-group. ;; So it's reasonable for them to hardcode tpage-ids here. -(defmethod get-common-page-slot-by-id texture-pool ((obj texture-pool) (tpage-id int)) +(defmethod get-common-page-slot-by-id texture-pool ((this texture-pool) (tpage-id int)) "Check to see if the given tpage should go in the common page list. If so, return the slot. Otherwise, return -1." (case tpage-id @@ -427,87 +427,87 @@ additionally, some texture pages have a chunk system that allows more specific c ) ) -(defmethod initialize! texture-pool ((obj texture-pool)) +(defmethod initialize! texture-pool ((this texture-pool)) "Initialize or reset the state of the texture-pool." ;; reset allocator - (set! (-> obj cur) 0) - (set! (-> obj top) (-> obj cur)) + (set! (-> this cur) 0) + (set! (-> this top) (-> this cur)) ;; set the allocation function to default-allocate. - (set! (-> obj allocate-func) texture-page-default-allocate) + (set! (-> this allocate-func) texture-page-default-allocate) ;; allocate some textures for effects, etc - (allocate-defaults obj) + (allocate-defaults this) ;; allocate the font palette. - (format #t "font-palette start #x~x~%" (/ (-> obj cur) 64)) - (set! (-> obj font-palette) (allocate-vram-words! obj 64)) - (format #t "font-palette end #x~x~%" (/ (-> obj cur) 64)) + (format #t "font-palette start #x~x~%" (/ (-> this cur) 64)) + (set! (-> this font-palette) (allocate-vram-words! this 64)) + (format #t "font-palette end #x~x~%" (/ (-> this cur) 64)) ;; reset common-page texture-pages (dotimes (v1-8 32) - (set! (-> obj common-page v1-8) (the-as texture-page 0)) + (set! (-> this common-page v1-8) (the-as texture-page 0)) ) ;; request no common-pages - (set! (-> obj common-page-mask) 0) + (set! (-> this common-page-mask) 0) ;; enable uploads for all textures - (set! (-> obj texture-enable-user-menu) + (set! (-> this texture-enable-user-menu) (texture-enable-mask tfrag pris shrub alpha water warp sprite map sky) ) - (set! (-> obj texture-enable-user) (texture-enable-mask tfrag pris shrub alpha water warp sprite map sky)) + (set! (-> this texture-enable-user) (texture-enable-mask tfrag pris shrub alpha water warp sprite map sky)) ;; mark all vram slots as unoccupied. (dotimes (v1-13 128) - (set! (-> obj ids v1-13) (the-as uint 0)) + (set! (-> this ids v1-13) (the-as uint 0)) ) - obj + this ) -(defmethod get-leftover-block-count texture-page ((obj texture-page) (num-segments int) (upload-offset int)) +(defmethod get-leftover-block-count texture-page ((this texture-page) (num-segments int) (upload-offset int)) "Unused and somewhat useless function to figure out how many blocks we overflow into the next page. This could be used with gs-largest-block to figure out how much of a page we use if we don't fit exactly." (let ((offset upload-offset)) (dotimes (i num-segments) - (+! offset (-> obj segment i size)) + (+! offset (-> this segment i size)) ) (logand (/ offset 64) 63) ) ) -(defmethod print-usage texture-pool ((obj texture-pool)) +(defmethod print-usage texture-pool ((this texture-pool)) "Print out how much of a texture-pool is used. This is not quite right because it does not count the frame or z buffer as used space." (format #t "--------------------~%") (format #t "texture pool ~DK - ~DK (~DK used, ~DK free)~%" - (/ (-> obj top) 256) - (/ (-> obj cur) 256) - (/ (- (-> obj cur) (-> obj top)) 256) - (/ (- #xfa000 (-> obj cur)) 256) + (/ (-> this top) 256) + (/ (-> this cur) 256) + (/ (- (-> this cur) (-> this top)) 256) + (/ (- #xfa000 (-> this cur)) 256) ) (format #t "--------------------~%") - obj + this ) -(defmethod allocate-segment texture-pool ((obj texture-pool) (seg texture-pool-segment) (num-words int)) +(defmethod allocate-segment texture-pool ((this texture-pool) (seg texture-pool-segment) (num-words int)) "Assign vram to the given segment." (set! (-> seg size) (the-as uint num-words)) - (set! (-> seg dest) (the-as uint (allocate-vram-words! obj num-words))) + (set! (-> seg dest) (the-as uint (allocate-vram-words! this num-words))) seg ) -(defmethod allocate-defaults texture-pool ((obj texture-pool)) +(defmethod allocate-defaults texture-pool ((this texture-pool)) "Assign vram for the texture system." ;; this "common" segment is about 1 MB and will hold basically all textures. ;; unlike jak 1, there's no near textures. instead, there's just a lot more uploads. ;; this seems like it would put a huge pressure on vram usage because these uploads ;; aren't free. - (format #t "texture start #x~x~%" (/ (-> obj cur) 64)) - (allocate-segment obj (-> obj segment-common) #x3e000) - (format #t "texture end #x~x~%" (/ (-> obj cur) 64)) + (format #t "texture start #x~x~%" (/ (-> this cur) 64)) + (allocate-segment this (-> this segment-common) #x3e000) + (format #t "texture end #x~x~%" (/ (-> this cur) 64)) ;; these "dynamic" textures are written to by renderers, and they have a fixed address. ;; notice that some of them overlap each other. - (set! (-> *ocean-envmap-texture-base* vram-word) (the-as uint (allocate-vram-words! obj #x9400))) + (set! (-> *ocean-envmap-texture-base* vram-word) (the-as uint (allocate-vram-words! this #x9400))) (set! (-> *ocean-envmap-texture-base* vram-block) (shr (-> *ocean-envmap-texture-base* vram-word) 6)) (set! (-> *ocean-envmap-texture-base* vram-page) (shr (-> *ocean-envmap-texture-base* vram-word) 11)) (set! (-> *ocean-texture-base* vram-word) (+ (-> *ocean-envmap-texture-base* vram-word) 4096)) @@ -525,7 +525,7 @@ additionally, some texture pages have a chunk system that allows more specific c (set! (-> *skull-gem-texture-base* vram-word) (+ #x9000 (-> *ocean-envmap-texture-base* vram-word))) (set! (-> *skull-gem-texture-base* vram-block) (shr (-> *skull-gem-texture-base* vram-word) 6)) (set! (-> *skull-gem-texture-base* vram-page) (shr (-> *skull-gem-texture-base* vram-word) 11)) - (format #t "dynamic end #x~x~%" (/ (-> obj cur) 64)) + (format #t "dynamic end #x~x~%" (/ (-> this cur) 64)) 0 (none) ) @@ -541,14 +541,14 @@ additionally, some texture pages have a chunk system that allows more specific c ;; it's ok for two textures to be mapped to the same vram address as ;; long as they are in different pages. -(defmethod remove-data-from-heap texture-page ((obj texture-page) (heap kheap)) +(defmethod remove-data-from-heap texture-page ((this texture-page) (heap kheap)) "Remove a texture-page's data from main memory. This is intended to be run on textures that are permanently in VRAM. This only works if the texture-page was the last thing added to the heap, and does NO checking to make sure this is the case. The texture-page and texture records are kept (just metadata), the actual image data is discarded." - (set! (-> heap current) (-> obj segment 0 block-data)) - obj + (set! (-> heap current) (-> this segment 0 block-data)) + this ) (defun texture-page-default-allocate ((pool texture-pool) (tpage texture-page) (heap kheap) (tpage-id int)) @@ -658,7 +658,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; For warp, it's the responsibility of the texture system to update adgifs. -(defmethod lay-out-sprite-tex texture-pool ((obj texture-pool)) +(defmethod lay-out-sprite-tex texture-pool ((this texture-pool)) "Lay out sprite textures from all levels so all can fit into VRAM at the same time." @@ -700,7 +700,7 @@ additionally, some texture pages have a chunk system that allows more specific c (none) ) -(defmethod lay-out-hud-tex texture-pool ((obj texture-pool)) +(defmethod lay-out-hud-tex texture-pool ((this texture-pool)) "Lay out hud/map textures from all levels so all can fit into VRAM at the same time." (let ((level-idx 0)) @@ -740,7 +740,7 @@ additionally, some texture pages have a chunk system that allows more specific c ;; - if the texture moves, the texture system can iterate through all adgifs referencing the texture ;; and update them. The texture system stores a linked list of adgifs per texture in the texture-page-dir. -(defmethod lay-out-warp-tex texture-pool ((obj texture-pool)) +(defmethod lay-out-warp-tex texture-pool ((this texture-pool)) "Lay out warp textures from all levels so all can fit into VRAM at the same time. Also update all adgifs." @@ -814,51 +814,51 @@ additionally, some texture pages have a chunk system that allows more specific c (none) ) -(defmethod clear-ids texture-pool ((obj texture-pool)) +(defmethod clear-ids texture-pool ((this texture-pool)) "Forget everything we have in VRAM and invalidate all caching of common-segment textures." ;; this ids array tracks what the current texture-page loaded in each vram "chunk". (dotimes (v1-0 128) - (set! (-> obj ids v1-0) (the-as uint 0)) + (set! (-> this ids v1-0) (the-as uint 0)) ) 0 (none) ) -(defmethod update-sprites texture-pool ((obj texture-pool)) +(defmethod update-sprites texture-pool ((this texture-pool)) "Redo the layout of sprite textures. This should be done when a new level is added that needs new sprite textures, or a level is unloaded and its sprite textures are no longer available." ;; assign texture to vram addresses - (lay-out-sprite-tex obj) + (lay-out-sprite-tex this) ;; forget all previous ids, don't want to reuse the old sprite textures ;; as it may have the wrong layout. - (clear-ids obj) + (clear-ids this) ;; flag that we no longer need to update this. - (set! (-> obj update-sprites-flag) #f) + (set! (-> this update-sprites-flag) #f) (none) ) -(defmethod update-warp-and-hud texture-pool ((obj texture-pool)) +(defmethod update-warp-and-hud texture-pool ((this texture-pool)) "Redo the layout of warp/hud/map textures. This should be done when a new level is added that needs new sprite textures, or a level is unloaded and its sprite textures are no longer available." - (lay-out-hud-tex obj) - (lay-out-warp-tex obj) - (clear-ids obj) - (set! (-> obj update-flag) #f) + (lay-out-hud-tex this) + (lay-out-warp-tex this) + (clear-ids this) + (set! (-> this update-flag) #f) (none) ) -(defmethod mark-hud-warp-sprite-dirty texture-pool ((obj texture-pool)) +(defmethod mark-hud-warp-sprite-dirty texture-pool ((this texture-pool)) "Mark that we should update sprite/warp/hud/map before the next use. This should happen when any level is loaded/unloaded." - (set! (-> obj update-sprites-flag) #t) - (set! (-> obj update-flag) #t) + (set! (-> this update-sprites-flag) #t) + (set! (-> this update-flag) #t) (none) ) @@ -1858,14 +1858,14 @@ additionally, some texture pages have a chunk system that allows more specific c (define *txt-dma-list* (new 'global 'dma-buffer 4096)) (kmemclose) -(defmethod upload-now! texture-page ((obj texture-page) (arg0 tex-upload-mode)) +(defmethod upload-now! texture-page ((this texture-page) (arg0 tex-upload-mode)) "Send the given texture-page to VRAM right now. This function doesn't return until it has happened, and only should be used during boot." ;; og:preserve-this (#when PC_PORT ;; load it to the PC Port's texture pool. - (__pc-texture-upload-now obj arg0) + (__pc-texture-upload-now this arg0) ) (let ((gp-0 *txt-dma-list*)) @@ -1873,7 +1873,7 @@ additionally, some texture pages have a chunk system that allows more specific c (set! (-> v1-0 base) (-> v1-0 data)) (set! (-> v1-0 end) (&-> v1-0 data-buffer (-> v1-0 allocated-length))) ) - (add-to-dma-buffer obj gp-0 arg0) + (add-to-dma-buffer this gp-0 arg0) (dma-buffer-add-gs-set gp-0 (texflush 1)) (let* ((v1-6 gp-0) (a0-7 (the-as object (-> v1-6 base))) @@ -1892,7 +1892,7 @@ additionally, some texture pages have a chunk system that allows more specific c (none) ) -(defmethod add-to-dma-buffer texture-page ((obj texture-page) (arg0 dma-buffer) (arg1 tex-upload-mode)) +(defmethod add-to-dma-buffer texture-page ((this texture-page) (arg0 dma-buffer) (arg1 tex-upload-mode)) "Add upload data for a texture-page. This is a simple version for non common-segment textures." (local-vars (sv-16 int)) (let ((v1-0 arg1)) @@ -1901,21 +1901,21 @@ additionally, some texture pages have a chunk system that allows more specific c 0 ) ((= v1-0 (tex-upload-mode seg0-1)) - (the-as int (+ (-> obj segment 0 size) (-> obj segment 1 size))) + (the-as int (+ (-> this segment 0 size) (-> this segment 1 size))) ) ((= v1-0 (tex-upload-mode seg0-1-2)) - (the-as int (-> obj size)) + (the-as int (-> this size)) ) (else - (the-as int (-> obj segment (the-as int arg1) size)) + (the-as int (-> this segment (the-as int arg1) size)) ) ) ) ) (let* ((v1-7 (max 0 (the-as int arg1))) (a3-4 (* (/ (+ (/ sv-16 64) 63) 64) 32)) - (t1-0 (shr (-> obj segment v1-7 dest) 6)) - (a2-10 (-> obj segment v1-7 block-data)) + (t1-0 (shr (-> this segment v1-7 dest) 6)) + (a2-10 (-> this segment v1-7 block-data)) ) (upload-vram-data arg0 (the-as int t1-0) a2-10 a3-4 128) ) @@ -1996,11 +1996,11 @@ additionally, some texture pages have a chunk system that allows more specific c dma-buff ) -(defmethod setup-font-texture texture-pool ((obj texture-pool)) +(defmethod setup-font-texture texture-pool ((this texture-pool)) "Do relocations of font textures." (local-vars (sv-16 int) (sv-20 int)) - (let ((s3-0 (-> obj font-palette))) - (set! sv-16 (-> obj cur)) + (let ((s3-0 (-> this font-palette))) + (set! sv-16 (-> this cur)) (set! sv-20 (/ s3-0 64)) (let ((s5-0 (texture-page-login (new 'static 'texture-id :index #x1 :page #xc04) texture-page-default-allocate global) @@ -2077,8 +2077,8 @@ additionally, some texture pages have a chunk system that allows more specific c ) ) (dma-sync (the-as pointer #x10009000) 0 0) - (if (and s5-0 (-> s5-0 page) (= (-> obj cur) (+ sv-16 (-> s5-0 page size)))) - (set! (-> obj cur) sv-16) + (if (and s5-0 (-> s5-0 page) (= (-> this cur) (+ sv-16 (-> s5-0 page size)))) + (set! (-> this cur) sv-16) (format 0 "ERROR: could not resize texture pool to remove gamefont.~%") ) ) @@ -2096,33 +2096,33 @@ additionally, some texture pages have a chunk system that allows more specific c ;; one link per texture. The link is the head of a linked list through all the static adgif-shaders of the ;; level. -(defmethod asize-of texture-page-dir ((obj texture-page-dir)) +(defmethod asize-of texture-page-dir ((this texture-page-dir)) "Get the size in memory of a texture-page-dir, just the main array, not allocated link stuff." - (the-as int (+ (-> texture-page-dir size) (* 12 (+ (-> obj length) -1)))) + (the-as int (+ (-> texture-page-dir size) (* 12 (+ (-> this length) -1)))) ) -(defmethod length texture-page-dir ((obj texture-page-dir)) +(defmethod length texture-page-dir ((this texture-page-dir)) "Get the number of elements." - (-> obj length) + (-> this length) ) -(defmethod relocate texture-page-dir ((obj texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate texture-page-dir ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) "Set up a texture-page-dir when it is loaded." ;; there's just one of these, just set the global one to this. - (set! *texture-page-dir* obj) + (set! *texture-page-dir* this) (none) ) -(defmethod relocate-dests! texture-page ((obj texture-page) (new-dest int) (segs int)) +(defmethod relocate-dests! texture-page ((this texture-page) (new-dest int) (segs int)) "Update a texture-page so the texture-page and all its textures point to a new vram address." (let ((new-tbp (shr new-dest 6)) - (old-tbp (shr (-> obj segment segs dest) 6)) + (old-tbp (shr (-> this segment segs dest) 6)) ) (when (!= new-tbp old-tbp) - (dotimes (tex-idx (-> obj length)) - (when (-> obj data tex-idx) - (let* ((tex (-> obj data tex-idx)) + (dotimes (tex-idx (-> this length)) + (when (-> this data tex-idx) + (let* ((tex (-> this data tex-idx)) (num-mips (-> tex num-mips)) ) (if (zero? segs) @@ -2144,7 +2144,7 @@ additionally, some texture pages have a chunk system that allows more specific c ) ) ) - (set! (-> obj segment segs dest) (the-as uint new-dest)) + (set! (-> this segment segs dest) (the-as uint new-dest)) ) ) (none) @@ -2154,20 +2154,20 @@ additionally, some texture pages have a chunk system that allows more specific c ;; texture-page management ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod relocate texture-page ((obj texture-page) (loading-heap kheap) (name (pointer uint8))) +(defmethod relocate texture-page ((this texture-page) (loading-heap kheap) (name (pointer uint8))) "Set up a texture-page when it is loaded. This function is called by the linker when loading is completed." (cond ;; version check! - ((or (not obj) (not (file-info-correct-version? (-> obj info) (file-kind tpage) 0))) + ((or (not this) (not (file-info-correct-version? (-> this info) (file-kind tpage) 0))) (the-as texture-page #f) ) (else (let ((loading-level (-> *level* loading-level))) (when loading-level ;; if we have a currently loading-level, put this in the loaded-texture-page list - (set! (-> loading-level loaded-texture-page (-> loading-level loaded-texture-page-count)) obj) + (set! (-> loading-level loaded-texture-page (-> loading-level loaded-texture-page-count)) this) (+! (-> loading-level loaded-texture-page-count) 1) ;; move from small-edge to small-center mode if we have 2 or more tpages, I guess? @@ -2178,14 +2178,14 @@ additionally, some texture pages have a chunk system that allows more specific c ) ;; set up dests (no idea why the tpage doesn't come with this set properly) - (set! (-> obj segment 1 dest) (-> obj segment 0 size)) - (set! (-> obj segment 2 dest) (+ (-> obj segment 0 size) (-> obj segment 1 size))) + (set! (-> this segment 1 dest) (-> this segment 0 size)) + (set! (-> this segment 2 dest) (+ (-> this segment 0 size) (-> this segment 1 size))) ;; og:preserve-this added texture remap - (dotimes (texture-idx (-> obj length)) - (let ((tex (-> obj data texture-idx))) + (dotimes (texture-idx (-> this length)) + (let ((tex (-> this data texture-idx))) (when (and tex (nonzero? tex)) - (let ((offset (__pc-get-tex-remap (the int (-> obj id)) texture-idx))) + (let ((offset (__pc-get-tex-remap (the int (-> this id)) texture-idx))) (when (nonzero? offset) ) (+! (-> tex dest 0) offset) @@ -2194,7 +2194,7 @@ additionally, some texture pages have a chunk system that allows more specific c ) ) - (let* ((tpage-id (-> obj id)) + (let* ((tpage-id (-> this id)) (dir-entry (-> *texture-page-dir* entries tpage-id)) ) @@ -2203,15 +2203,15 @@ additionally, some texture pages have a chunk system that allows more specific c (set! (-> *texture-relocate-later* memcpy) #f) ;; do allocation! - ((-> *texture-pool* allocate-func) *texture-pool* obj loading-heap (the-as int tpage-id)) + ((-> *texture-pool* allocate-func) *texture-pool* this loading-heap (the-as int tpage-id)) (cond ((not (-> *texture-relocate-later* memcpy)) ;; not postponing texture memcpy, so it's safe to allocate links now. ;; (otherwise its unsafe because we'll want to kick out the texture) - (set! (-> dir-entry page) obj) + (set! (-> dir-entry page) this) (if (not (-> dir-entry link)) (set! (-> dir-entry link) - (the-as texture-link (malloc 'loading-level (* (max (-> dir-entry length) (-> obj length)) 4))) + (the-as texture-link (malloc 'loading-level (* (max (-> dir-entry length) (-> this length)) 4))) ) ) ) @@ -2219,12 +2219,12 @@ additionally, some texture pages have a chunk system that allows more specific c ;; postponing memcpy and link allocation, fill out our info. (let ((v1-19 *texture-relocate-later*)) (set! (-> v1-19 entry) dir-entry) - (set! (-> v1-19 page) obj) + (set! (-> v1-19 page) this) ) ) ) ) - obj + this ) ) ) @@ -2370,7 +2370,7 @@ additionally, some texture pages have a chunk system that allows more specific c (lookup-texture-by-name arg0 (the-as string #f) arg2) ) -(defmethod unload-page texture-pool ((obj texture-pool) (arg0 texture-page)) +(defmethod unload-page texture-pool ((this texture-pool) (arg0 texture-page)) "Unload the given texture-page from the texture-page-dir." (local-vars (a0-2 int)) (let ((v1-0 *texture-page-dir*)) @@ -2415,15 +2415,15 @@ additionally, some texture pages have a chunk system that allows more specific c ) ) -(defmethod unlink-shaders-in-heap texture-page-dir ((obj texture-page-dir) (heap kheap)) +(defmethod unlink-shaders-in-heap texture-page-dir ((this texture-page-dir) (heap kheap)) "Unlink all adgif shaders that are in heap. This iterates through _everything_ so it is somewhat slow." (local-vars (dist-past-end uint)) (let ((mem-start (-> heap base)) (mem-end (-> heap top-base)) ) - (dotimes (entry-idx (-> obj length)) - (let* ((entry (-> obj entries entry-idx)) + (dotimes (entry-idx (-> this length)) + (let* ((entry (-> this entries entry-idx)) (tex-page (-> entry page)) ) (when tex-page @@ -2817,9 +2817,9 @@ additionally, some texture pages have a chunk system that allows more specific c ) -(defmethod inspect texture-page-dir ((obj texture-page-dir)) - (texture-page-dir-inspect obj #f) - obj +(defmethod inspect texture-page-dir ((this texture-page-dir)) + (texture-page-dir-inspect this #f) + this ) (define *texture-pool* (new 'global 'texture-pool)) diff --git a/goal_src/jak2/engine/level/bsp-h.gc b/goal_src/jak2/engine/level/bsp-h.gc index 002df7d97b..22c9838560 100644 --- a/goal_src/jak2/engine/level/bsp-h.gc +++ b/goal_src/jak2/engine/level/bsp-h.gc @@ -150,15 +150,15 @@ the bsp-node class seems broken - it has int16's that get used a pointers. :flag-assert #x900000080 ) -(defmethod inspect bsp-header ((obj bsp-header)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tall-visible-list: #x~X~%" (-> obj all-visible-list)) - (format #t "~Tvisible-list-length: ~D~%" (-> obj visible-list-length)) - (format #t "~Tdrawable-trees: ~A~%" (-> obj drawable-trees)) - (format #t "~Tpat: #x~X~%" (-> obj pat)) - (format #t "~Tpat-length: ~D~%" (-> obj pat-length)) - (inspect-bsp-tree obj (-> obj nodes 0)) ;; this is probably broken.. - obj +(defmethod inspect bsp-header ((this bsp-header)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tall-visible-list: #x~X~%" (-> this all-visible-list)) + (format #t "~Tvisible-list-length: ~D~%" (-> this visible-list-length)) + (format #t "~Tdrawable-trees: ~A~%" (-> this drawable-trees)) + (format #t "~Tpat: #x~X~%" (-> this pat)) + (format #t "~Tpat-length: ~D~%" (-> this pat-length)) + (inspect-bsp-tree this (-> this nodes 0)) ;; this is probably broken.. + this ) (defun-debug inspect-bsp-tree ((arg0 bsp-header) (arg1 bsp-node)) diff --git a/goal_src/jak2/engine/level/bsp.gc b/goal_src/jak2/engine/level/bsp.gc index c19d67e688..eeac136844 100644 --- a/goal_src/jak2/engine/level/bsp.gc +++ b/goal_src/jak2/engine/level/bsp.gc @@ -36,24 +36,24 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib (none) ) -(defmethod mem-usage bsp-header ((obj bsp-header) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage bsp-header ((this bsp-header) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of everything in a bsp-header. This includes all the drawables." - (set! (-> arg0 work-bsp) obj) - (when (nonzero? (-> obj info)) + (set! (-> arg0 work-bsp) this) + (when (nonzero? (-> this info)) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") (+! (-> arg0 data 84 count) 1) - (let ((v1-8 (asize-of (-> obj info)))) + (let ((v1-8 (asize-of (-> this info)))) (+! (-> arg0 data 84 used) v1-8) (+! (-> arg0 data 84 total) (logand -16 (+ v1-8 15))) ) ) - (if (nonzero? (-> obj drawable-trees)) - (mem-usage (-> obj drawable-trees) arg0 arg1) + (if (nonzero? (-> this drawable-trees)) + (mem-usage (-> this drawable-trees) arg0 arg1) ) - (if (nonzero? (-> obj collide-hash)) - (mem-usage (-> obj collide-hash) arg0 arg1) + (if (nonzero? (-> this collide-hash)) + (mem-usage (-> this collide-hash) arg0 arg1) ) (set! (-> arg0 length) (max 65 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") @@ -70,81 +70,81 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib (set! (-> arg0 length) (max 62 (-> arg0 length))) (set! (-> arg0 data 61 name) "bsp-leaf-vis-self") (+! (-> arg0 data 61 count) 1) - (let ((v1-40 (-> obj visible-list-length))) + (let ((v1-40 (-> this visible-list-length))) (+! (-> arg0 data 61 used) v1-40) (+! (-> arg0 data 61 total) (logand -16 (+ v1-40 15))) ) (set! (-> arg0 length) (max 60 (-> arg0 length))) (set! (-> arg0 data 59 name) "bsp-misc") (+! (-> arg0 data 59 count) 1) - (let ((v1-50 (* (-> obj texture-remap-table-len) 8))) + (let ((v1-50 (* (-> this texture-remap-table-len) 8))) (+! (-> arg0 data 59 used) v1-50) (+! (-> arg0 data 59 total) (logand -16 (+ v1-50 15))) ) (set! (-> arg0 length) (max 60 (-> arg0 length))) (set! (-> arg0 data 59 name) "bsp-misc") (+! (-> arg0 data 59 count) 1) - (let ((v1-60 (* (-> obj texture-page-count) 4))) + (let ((v1-60 (* (-> this texture-page-count) 4))) (+! (-> arg0 data 59 used) v1-60) (+! (-> arg0 data 59 total) (logand -16 (+ v1-60 15))) ) - (when (nonzero? (-> obj unknown-basic)) + (when (nonzero? (-> this unknown-basic)) (set! (-> arg0 length) (max 60 (-> arg0 length))) (set! (-> arg0 data 59 name) "bsp-misc") (+! (-> arg0 data 59 count) 1) - (let ((v1-72 (asize-of (-> obj unknown-basic)))) + (let ((v1-72 (asize-of (-> this unknown-basic)))) (+! (-> arg0 data 59 used) v1-72) (+! (-> arg0 data 59 total) (logand -16 (+ v1-72 15))) ) ) - (when (nonzero? (-> obj actor-birth-order)) + (when (nonzero? (-> this actor-birth-order)) (set! (-> arg0 length) (max 60 (-> arg0 length))) (set! (-> arg0 data 59 name) "bsp-misc") (+! (-> arg0 data 59 count) 1) - (let ((v1-85 (* (-> obj actors length) 4))) + (let ((v1-85 (* (-> this actors length) 4))) (+! (-> arg0 data 59 used) v1-85) (+! (-> arg0 data 59 total) (logand -16 (+ v1-85 15))) ) ) - (+! (-> arg0 data 64 count) (-> obj pat-length)) - (let ((v1-92 (* (-> obj pat-length) 4))) + (+! (-> arg0 data 64 count) (-> this pat-length)) + (let ((v1-92 (* (-> this pat-length) 4))) (+! (-> arg0 data 64 used) v1-92) (+! (-> arg0 data 64 total) (logand -16 (+ v1-92 15))) ) - (when (nonzero? (-> obj region-trees)) - (let* ((s3-0 (-> obj region-trees length)) + (when (nonzero? (-> this region-trees)) + (let* ((s3-0 (-> this region-trees length)) (s2-0 0) - (a0-39 (-> obj region-trees s2-0)) + (a0-39 (-> this region-trees s2-0)) ) (while (< s2-0 s3-0) (mem-usage a0-39 arg0 (logior arg1 128)) (+! s2-0 1) - (set! a0-39 (-> obj region-trees s2-0)) + (set! a0-39 (-> this region-trees s2-0)) ) ) ) - (let ((s3-1 (-> obj cameras))) + (let ((s3-1 (-> this cameras))) (when (nonzero? s3-1) (dotimes (s2-1 (-> s3-1 length)) (mem-usage (-> s3-1 s2-1) arg0 (logior arg1 256)) ) ) ) - (if (nonzero? (-> obj nodes)) - (mem-usage-bsp-tree obj (-> obj nodes 0) arg0 arg1) + (if (nonzero? (-> this nodes)) + (mem-usage-bsp-tree this (-> this nodes 0) arg0 arg1) ) - obj + this ) -(defmethod login bsp-header ((obj bsp-header)) +(defmethod login bsp-header ((this bsp-header)) "Log in a bsp-header. Note that this version isn't typically used - instead level.gc does a special login that runs over multiple frames." - (if (nonzero? (-> obj drawable-trees)) - (login (-> obj drawable-trees)) + (if (nonzero? (-> this drawable-trees)) + (login (-> this drawable-trees)) ) - (set! (-> obj level tfrag-gs-test) - (if (logtest? (-> obj texture-flags 0) (texture-page-flag alpha-enable)) + (set! (-> this level tfrag-gs-test) + (if (logtest? (-> this texture-flags 0) (texture-page-flag alpha-enable)) (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest greater-equal)) (new 'static 'gs-test :ate #x1 @@ -155,17 +155,17 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib ) ) ) - obj + this ) (define *test-shrub* 0) -(defmethod draw bsp-header ((obj bsp-header) (arg0 bsp-header) (arg1 display-frame)) +(defmethod draw bsp-header ((this bsp-header) (arg0 bsp-header) (arg1 display-frame)) "Draw a bsp-header. Note that this mostly just adds drawable trees to a list which is later used by the background system. So this is probably a bit of a leftover from when drawing was done by iterating through all drawable-trees recursively." (local-vars (a3-4 uint128) (a3-5 uint128)) - (let ((s4-0 (-> obj level))) + (let ((s4-0 (-> this level))) (when (-> s4-0 render?) ;; setup for level drawing: @@ -179,7 +179,7 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib ) ;; upload visibility data to spr - (let ((a2-3 (/ (+ (-> obj visible-list-length) 15) 16))) + (let ((a2-3 (/ (+ (-> this visible-list-length) 15) 16))) (__mem-move (-> (scratchpad-object terrain-context) work background vis-list) (-> s4-0 vis-bits) (the uint (* a2-3 16))) ; (dma-send-to-spr-no-flush ; (the-as uint (-> (the-as terrain-context #x70000000) work background vis-list)) @@ -191,9 +191,9 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib ;; debug option to flip visibility bits (when *artist-flip-visible* - (let ((v1-15 (/ (+ (-> obj visible-list-length) 15) 16)) + (let ((v1-15 (/ (+ (-> this visible-list-length) 15) 16)) (a0-7 (-> (scratchpad-object terrain-context) work background vis-list)) - (a1-5 (-> obj all-visible-list)) + (a1-5 (-> this all-visible-list)) ) (dotimes (a2-4 v1-15) (let ((a3-3 (-> (the-as (pointer uint128) (+ (the-as uint a0-7) (* a2-4 16)))))) @@ -231,9 +231,9 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib ) ;; execute the draw! - (when (nonzero? (-> obj drawable-trees)) + (when (nonzero? (-> this drawable-trees)) (with-profiler 'bsp *profile-bsp-color* - (let ((a1-8 (-> obj drawable-trees))) + (let ((a1-8 (-> this drawable-trees))) (draw a1-8 a1-8 arg1) ) ) @@ -246,7 +246,7 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib ) -(defmethod debug-draw bsp-header ((obj bsp-header) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw bsp-header ((this bsp-header) (arg0 drawable) (arg1 display-frame)) "Set up and call debug-draw on a bsp-header and all its drawables. The actual use of debug-draw is up to the drawables, but this is a useful place to do random debug drawing." @@ -267,10 +267,10 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib (vf30 :class vf) (vf31 :class vf) ) - (let ((v1-0 (-> obj level))) + (let ((v1-0 (-> this level))) (set! *draw-index* (-> v1-0 draw-index)) (set! (-> *prototype-tie-work* mood) (-> v1-0 mood-context)) - (let ((a2-1 (/ (+ (-> obj visible-list-length) 15) 16))) + (let ((a2-1 (/ (+ (-> this visible-list-length) 15) 16))) (__mem-move (-> (scratchpad-object terrain-context) work background vis-list) (-> v1-0 vis-bits) (the uint (* a2-1 16))) ; (dma-send-to-spr-no-flush ; (the-as uint (+ #x38a0 #x70000000)) @@ -301,8 +301,8 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib (.lvf vf31 (&-> at-0 camera-temp trans quad)) ) ) - (when (nonzero? (-> obj drawable-trees)) - (let ((a1-4 (-> obj drawable-trees))) + (when (nonzero? (-> this drawable-trees)) + (let ((a1-4 (-> this drawable-trees))) (debug-draw a1-4 a1-4 arg1) ) ) @@ -311,7 +311,7 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib ) ) -(defmethod collect-stats bsp-header ((obj bsp-header)) +(defmethod collect-stats bsp-header ((this bsp-header)) "Set up and call collect-stats on a bsp-header. This will run (moderately) expensive checks to count triangles, visibility, etc." (rlet ((vf16 :class vf) @@ -331,8 +331,8 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib (vf30 :class vf) (vf31 :class vf) ) - (let ((v1-0 (-> obj level)) - (a2-0 (/ (+ (-> obj visible-list-length) 15) 16)) + (let ((v1-0 (-> this level)) + (a2-0 (/ (+ (-> this visible-list-length) 15) 16)) ) (__mem-move (-> (scratchpad-object terrain-context) work background vis-list) (-> v1-0 vis-bits) (the uint (* a2-0 16))) ; (dma-send-to-spr-no-flush @@ -363,8 +363,8 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib (.lvf vf31 (&-> at-0 camera-temp trans quad)) ) ) - (if (nonzero? (-> obj drawable-trees)) - (collect-stats (-> obj drawable-trees)) + (if (nonzero? (-> this drawable-trees)) + (collect-stats (-> this drawable-trees)) ) 0 (none) @@ -483,9 +483,9 @@ The "bsp-tree" is a bsp used to associate camera positions with lists of visibib ) ) -(defmethod collect-regions bsp-header ((obj bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions bsp-header ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Recursively find all regions containing the sphere, add to region-prim-list" - (let ((s3-0 (-> obj region-trees))) + (let ((s3-0 (-> this region-trees))) (dotimes (s2-0 (-> s3-0 length)) (collect-regions (-> s3-0 s2-0) arg0 arg1 arg2) ) diff --git a/goal_src/jak2/engine/level/level-h.gc b/goal_src/jak2/engine/level/level-h.gc index b53a27a35b..d360d4416d 100644 --- a/goal_src/jak2/engine/level/level-h.gc +++ b/goal_src/jak2/engine/level/level-h.gc @@ -172,8 +172,8 @@ ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of level-vis-info ((obj level-vis-info)) - (the-as int (+ (-> level-vis-info size) (-> obj dictionary-length))) +(defmethod asize-of level-vis-info ((this level-vis-info)) + (the-as int (+ (-> level-vis-info size) (-> this dictionary-length))) ) (deftype level-load-info (basic) diff --git a/goal_src/jak2/engine/level/level.gc b/goal_src/jak2/engine/level/level.gc index 7ee04daa68..83bef93953 100644 --- a/goal_src/jak2/engine/level/level.gc +++ b/goal_src/jak2/engine/level/level.gc @@ -104,7 +104,7 @@ into 7 sections, which might explain the weird sizes in the center. default-level ) -(defmethod alt-load-command-get-index level-group ((obj level-group) (arg0 symbol) (arg1 int)) +(defmethod alt-load-command-get-index level-group ((this level-group) (arg0 symbol) (arg1 int)) "Get the n-th alt-load-command for the given level. This is likely unused in jak 2 because no levels have alt-load-commands." (let ((v1-1 (-> (lookup-level-info arg0) alt-load-commands))) @@ -119,20 +119,20 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod load-in-progress? level-group ((obj level-group)) +(defmethod load-in-progress? level-group ((this level-group)) "Is a level being loaded right now?" (!= (-> *level* loading-level) (-> *level* default-level)) ) -(defmethod get-level-by-heap-ptr-and-status level-group ((obj level-group) (arg0 pointer) (arg1 symbol)) +(defmethod get-level-by-heap-ptr-and-status level-group ((this level-group) (arg0 pointer) (arg1 symbol)) "Get a level by a heap pointer and status. If no matching level is found, return #f. The purpose of the status check is possibly to prevent bugs with getting stuff from a level that's just been replaced with another." (case arg1 (('active) - (dotimes (v1-1 (-> obj length)) - (let ((a2-6 (-> obj level v1-1))) + (dotimes (v1-1 (-> this length)) + (let ((a2-6 (-> this level v1-1))) (when (= (-> a2-6 status) 'active) (if (and (>= (the-as int arg0) (the-as int (-> a2-6 heap base))) (< (the-as int arg0) (the-as int (-> a2-6 heap top-base))) @@ -144,8 +144,8 @@ into 7 sections, which might explain the weird sizes in the center. ) ) (('loading) - (dotimes (v1-5 (-> obj length)) - (let ((a2-12 (-> obj level v1-5))) + (dotimes (v1-5 (-> this length)) + (let ((a2-12 (-> this level v1-5))) (when (!= (-> a2-12 status) 'inactive) (if (and (>= (the-as int arg0) (the-as int (-> a2-12 heap base))) (< (the-as int arg0) (the-as int (-> a2-12 heap top-base))) @@ -168,22 +168,22 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod get-art-group-by-name level ((obj level) (arg0 string)) +(defmethod get-art-group-by-name level ((this level) (arg0 string)) "As the name implies, look through the art-groups of this level and get the one with the given name. Return #f if not found." - (countdown (s4-0 (-> obj art-group art-group-array length)) - (if (name= (-> obj art-group art-group-array s4-0 name) arg0) - (return (-> obj art-group art-group-array s4-0)) + (countdown (s4-0 (-> this art-group art-group-array length)) + (if (name= (-> this art-group art-group-array s4-0 name) arg0) + (return (-> this art-group art-group-array s4-0)) ) ) (the-as art-group #f) ) -(defmethod bsp-name level ((obj level)) +(defmethod bsp-name level ((this level)) "Get the name of the bsp. If this can't be done, get the name of the level." - (if (and (!= (-> obj status) 'inactive) (-> obj bsp) (nonzero? (-> obj bsp name))) - (-> obj bsp name) - (-> obj name) + (if (and (!= (-> this status) 'inactive) (-> this bsp) (nonzero? (-> this bsp name))) + (-> this bsp name) + (-> this name) ) ) @@ -199,40 +199,40 @@ into 7 sections, which might explain the weird sizes in the center. (none) ) -(defmethod print level ((obj level)) - (format #t "#<~A ~A ~S @ #x~X>" (-> obj type) (-> obj status) (-> obj name) obj) - obj +(defmethod print level ((this level)) + (format #t "#<~A ~A ~S @ #x~X>" (-> this type) (-> this status) (-> this name) this) + this ) -(defmethod relocate bsp-header ((obj bsp-header) (arg0 int)) +(defmethod relocate bsp-header ((this bsp-header) (arg0 int)) "Handle the load of a new bsp-header. The linker calls this function when the bsp-header is linked. Do some sanity checks and link the bsp-header and level to each other." (let ((s5-0 (-> *level* loading-level))) (when s5-0 (cond - (obj + (this (cond - ((not (type? obj bsp-header)) + ((not (type? this bsp-header)) (format 0 "ERROR: level ~A is not a bsp-header.~%" (-> s5-0 name)) (the-as bsp-header #f) ) - ((not (file-info-correct-version? (-> obj info) (file-kind level-bt) 0)) + ((not (file-info-correct-version? (-> this info) (file-kind level-bt) 0)) (the-as bsp-header #f) ) - ((< 2048 (-> obj visible-list-length)) + ((< 2048 (-> this visible-list-length)) (format 0 "ERROR: level ~A visible-list-length ~d is greater than 2048 (16384 drawables).~%" (-> s5-0 name) - (-> obj visible-list-length) + (-> this visible-list-length) ) (the-as bsp-header #f) ) (else - (set! (-> s5-0 bsp) obj) - (set! (-> obj level) s5-0) - obj + (set! (-> s5-0 bsp) this) + (set! (-> this level) s5-0) + this ) ) ) @@ -245,58 +245,58 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod load-required-packages level ((obj level)) +(defmethod load-required-packages level ((this level)) "Load packages for a level. This just loads common, and this feature is not really useful. Packages were only used during development, and seem only partially used in Jak 2 (the only package is common)." - (when (not (or (not (-> obj bsp)) (= *kernel-boot-mode* 'debug-boot))) - (if (not (null? (-> obj info packages))) + (when (not (or (not (-> this bsp)) (= *kernel-boot-mode* 'debug-boot))) + (if (not (null? (-> this info packages))) (load-package "common" global) ) ) - obj + this ) -(defmethod vis-clear level ((obj level)) +(defmethod vis-clear level ((this level)) "Completely invalide all visibility data, vis-info, and set all-visible? to loading." (countdown (v1-0 8) (nop!) - (set! (-> obj vis-info v1-0) #f) + (set! (-> this vis-info v1-0) #f) ) (dotimes (v1-3 128) - (set! (-> (the-as (pointer int128) (&+ (-> obj vis-bits) (* v1-3 16)))) (the int128 0)) + (set! (-> (the-as (pointer int128) (&+ (-> this vis-bits) (* v1-3 16)))) (the int128 0)) ) - (set! (-> obj all-visible?) 'loading) + (set! (-> this all-visible?) 'loading) 0 (none) ) -(defmethod init-vis-from-bsp level ((obj level)) +(defmethod init-vis-from-bsp level ((this level)) "Set up a level's vis-infos from a bsp." - (when (not (or (= (-> obj status) 'inactive) (not (-> obj bsp)))) + (when (not (or (= (-> this status) 'inactive) (not (-> this bsp)))) ;; mark our visibility as 'loading. - (set! (-> obj all-visible?) 'loading) + (set! (-> this all-visible?) 'loading) ;; check vis-info's from the loaded bsp: (dotimes (s5-0 8) - (let ((s4-0 (-> obj bsp vis-info s5-0))) + (let ((s4-0 (-> this bsp vis-info s5-0))) (cond ((and s4-0 (nonzero? s4-0) (valid? s4-0 level-vis-info (the-as string #f) #f 0)) ;; looks good ;; level -> vis info - (set! (-> obj vis-info s5-0) s4-0) + (set! (-> this vis-info s5-0) s4-0) (set! (-> s4-0 current-vis-string) (the-as uint -1)) ;; vis info -> bsp - (if (= (-> s4-0 from-level) (-> obj load-name)) - (set! (-> s4-0 from-bsp) (-> obj bsp)) + (if (= (-> s4-0 from-level) (-> this load-name)) + (set! (-> s4-0 from-bsp) (-> this bsp)) (set! (-> s4-0 from-bsp) #f) ) ;; vis info -> level's vis-bits - (set! (-> s4-0 vis-bits) (the-as uint (-> obj vis-bits))) + (set! (-> s4-0 vis-bits) (the-as uint (-> this vis-bits))) (set! (-> s4-0 flags) (the-as vis-info-flag (logclear (-> s4-0 flags) (vis-info-flag in-iop loading vis-valid))) @@ -304,7 +304,7 @@ into 7 sections, which might explain the weird sizes in the center. (set! *vis-boot* #t) ) (else - (set! (-> obj vis-info s5-0) #f) + (set! (-> this vis-info s5-0) #f) ) ) ) @@ -314,7 +314,7 @@ into 7 sections, which might explain the weird sizes in the center. (none) ) -(defmethod level-get-for-use level-group ((obj level-group) (arg0 symbol) (arg1 symbol)) +(defmethod level-get-for-use level-group ((this level-group) (arg0 symbol) (arg1 symbol)) "Request a level by name in the given state. Will return quickly (non-blocking) and might not be able to get a level in the desired state, though it will ofborrow do some small amount of work to make progress on loading. @@ -327,7 +327,7 @@ into 7 sections, which might explain the weird sizes in the center. (start-debug "level-get-for-use: ~A ~A~%" arg0 arg1) ;; make sure we have level heaps - (alloc-levels-if-needed obj #f) + (alloc-levels-if-needed this #f) ;; look up the requested level (let* ((s2-0 (lookup-level-info arg0)) @@ -337,7 +337,7 @@ into 7 sections, which might explain the weird sizes in the center. (start-debug "level info: ~A, remapped name: ~A~%" s2-0 s1-0) ;; if we already have it, try updating status, then return it - (let ((s5-0 (level-get obj s1-0))) + (let ((s5-0 (level-get this s1-0))) (when s5-0 (level-status-update! s5-0 arg1) (set! s5-1 s5-0) @@ -348,7 +348,7 @@ into 7 sections, which might explain the weird sizes in the center. (start-debug "level isn't loaded already, need to find a level~%") ;; find slot to load into - (let ((a0-7 (level-get-most-disposable obj))) + (let ((a0-7 (level-get-most-disposable this))) (start-debug "found slot: ~A~%" a0-7) ;; mark it as inactive, we're kicking it out. (set! s5-1 (if a0-7 @@ -366,8 +366,8 @@ into 7 sections, which might explain the weird sizes in the center. ) ;; remember where we were loaded - (let ((v1-13 (+ (-> obj load-order) 1))) - (set! (-> obj load-order) v1-13) + (let ((v1-13 (+ (-> this load-order) 1))) + (set! (-> this load-order) v1-13) (set! (-> s5-1 load-order) (the-as int v1-13)) ) @@ -398,7 +398,7 @@ into 7 sections, which might explain the weird sizes in the center. s5-1 ) -(defmethod level-status level-group ((obj level-group) (arg0 symbol)) +(defmethod level-status level-group ((this level-group) (arg0 symbol)) "Get the status of a level by name, return #f if no level is found." (let ((v1-1 (level-get *level* arg0))) (if v1-1 @@ -407,7 +407,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod level-status-update! level ((obj level) (arg0 symbol)) +(defmethod level-status-update! level ((this level) (arg0 symbol)) "Try to update the level to the given status, calling whatever is needed to make it happen. This can do both loading, linking, login, and activation. @@ -415,47 +415,47 @@ into 7 sections, which might explain the weird sizes in the center. the level object. This function is the way to transition from loaded to alive/active." - (start-debug "level-status-update trying to do ~A to ~A for ~A~%" (-> obj status) arg0 (-> obj name)) + (start-debug "level-status-update trying to do ~A to ~A for ~A~%" (-> this status) arg0 (-> this name)) (case arg0 (('inactive) ;; any request to go inactive should unload. - (-> obj status) - (unload! obj) + (-> this status) + (unload! this) ) (('loading) - (case (-> obj status) + (case (-> this status) (('inactive) ;; inactive -> loading transition, start the loader - (load-begin obj) + (load-begin this) ) ) ) (('loading-bt) - (case (-> obj status) + (case (-> this status) (('loading) ;; loading -> loading-bt, transition immediately and do one load-continue - (set! (-> obj status) arg0) - (load-continue obj) + (set! (-> this status) arg0) + (load-continue this) ) ) ) (('loading-done) - (case (-> obj status) + (case (-> this status) (('loading-bt) ;; loading-bt -> loading-done, the only allowed transition to loading-done - (set! (-> obj status) arg0) + (set! (-> this status) arg0) ) ) ) (('loaded) - (case (-> obj status) + (case (-> this status) (('loading-done) ;; loading-done->loaded, need to log in first - (login-begin obj) + (login-begin this) ) (('alive 'active) ;; deactivating - (deactivate obj) + (deactivate this) ) ) ) @@ -464,29 +464,29 @@ into 7 sections, which might explain the weird sizes in the center. ;; we do this twice, once to alive, then once to active. ;; alive means that entities are alive, active means alive and ;; added to draw engine. - (case (-> obj status) + (case (-> this status) (('loaded) ;; loaded (so logged in too), do birth (will set to alive), then try again - (birth obj) - (level-status-update! obj arg0) + (birth this) + (level-status-update! this arg0) ) (('alive) ;; on the second run, gets here: (when (and *dproc* (= arg0 'active)) ;; remember when - (when (zero? (-> obj display-start-time)) - (set! (-> obj display-start-time) (-> *display* real-clock frame-counter)) + (when (zero? (-> this display-start-time)) + (set! (-> this display-start-time) (-> *display* real-clock frame-counter)) 0 ) ;; add us to the background draw engine! this will cause us to be drawn. - (remove-by-param1 *background-draw-engine* (the-as int (-> obj bsp))) - (add-connection *background-draw-engine* *dproc* add-bsp-drawable (-> obj bsp) obj #f) + (remove-by-param1 *background-draw-engine* (the-as int (-> this bsp))) + (add-connection *background-draw-engine* *dproc* add-bsp-drawable (-> this bsp) this #f) ;; not sure why this becomes 0... (dotimes (v1-46 18) - (set! (-> obj closest-object-array v1-46) 0.0) - (set! (-> obj texture-mask v1-46 mask quad) (the-as uint128 0)) + (set! (-> this closest-object-array v1-46) 0.0) + (set! (-> this texture-mask v1-46 mask quad) (the-as uint128 0)) ) - (set! (-> obj status) 'active) + (set! (-> this status) 'active) ;; set up for drawing. (assign-draw-indices *level*) ) @@ -495,7 +495,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ) - obj + this ) (define *login-state* (new 'global 'login-state)) @@ -561,39 +561,39 @@ into 7 sections, which might explain the weird sizes in the center. ;; a case in the DGO loader here. If the objects come in totally corrupted, we're likely missing ;; some additional syncronization. -(defmethod load-continue level ((obj level)) +(defmethod load-continue level ((this level)) "Run the loading/login state machine. This will only make progress on loading, linking, and login for loads that have already started. No 'scary' state transitions (like birth, alive, deactivate) are made here." (local-vars (sv-16 symbol)) ;; if any linking is in progress, do that first. - (when (-> obj linking) + (when (-> this linking) (when (nonzero? (link-resume)) ;; run linker ;; linker return is nonzero, we're done! (start-debug "link done!~%") - (set! (-> obj linking) #f) - (case (-> obj status) + (set! (-> this linking) #f) + (case (-> this status) (('loading) ;; we're loading to b0/b1, not the top buffer ;; if we are doing a texture relocate later, don't do anything now, come back later. (when (not (-> *texture-relocate-later* memcpy)) (cond - ((= (-> obj load-buffer-mode) (load-buffer-mode borrow)) + ((= (-> this load-buffer-mode) (load-buffer-mode borrow)) ;; in this "borrow" mode, load directly to the heap. (start-debug "kick load borrow case~%") - (let ((a2-0 (logand -64 (&+ (-> obj heap current) 63)))) + (let ((a2-0 (logand -64 (&+ (-> this heap current) 63)))) (dgo-load-continue a2-0 a2-0 a2-0) ) ) (else ;; otherwise, continue with double buffered load to b0/b1 like normal ;; update load buffers, and make the dgo loader continue. - (load-buffer-resize obj (the-as dgo-header (-> obj load-buffer-last))) + (load-buffer-resize this (the-as dgo-header (-> this load-buffer-last))) (start-debug "kicking next load~%") (dgo-load-continue - (the-as pointer (-> obj load-buffer 0)) - (the-as pointer (-> obj load-buffer 1)) - (logand -64 (&+ (-> obj heap current) 63)) + (the-as pointer (-> this load-buffer 0)) + (the-as pointer (-> this load-buffer 1)) + (logand -64 (&+ (-> this heap current) 63)) ) ) ) @@ -601,12 +601,12 @@ into 7 sections, which might explain the weird sizes in the center. ) (('loading-bt) ;; finished linking the final object! begin login. - (level-status-update! obj 'loading-done) - (level-status-update! obj 'loaded) + (level-status-update! this 'loading-done) + (level-status-update! this 'loaded) ) ) ) - (set! obj obj) + (set! this this) (goto cfg-39) ) @@ -615,26 +615,26 @@ into 7 sections, which might explain the weird sizes in the center. ;; (note that this doens't handle mode "borrow") (when (-> *texture-relocate-later* memcpy) (relocate-later) - (load-buffer-resize obj (the-as dgo-header (-> obj load-buffer-last))) + (load-buffer-resize this (the-as dgo-header (-> this load-buffer-last))) (dgo-load-continue - (the-as pointer (-> obj load-buffer 0)) - (the-as pointer (-> obj load-buffer 1)) - (logand -64 (&+ (-> obj heap current) 63)) + (the-as pointer (-> this load-buffer 0)) + (the-as pointer (-> this load-buffer 1)) + (logand -64 (&+ (-> this heap current) 63)) ) - (set! obj obj) + (set! this this) (goto cfg-39) ) ;; not waiting on the linker, check other cases - (case (-> obj status) + (case (-> this status) (('loading) ;; if loading, we are waiting on the DGO loader. Check it again: (set! sv-16 (the-as symbol #f)) (let ((s5-0 (dgo-load-get-next (& sv-16)))) (when s5-0 ;; we got something! remember where and update stats - (set! (-> obj load-buffer-last) (the-as uint s5-0)) + (set! (-> this load-buffer-last) (the-as uint s5-0)) (+! (-> *level* load-size) (-> (the-as (pointer uint32) s5-0))) (set! (-> *level* load-time) (* 0.016666668 (the float (- (-> *display* real-clock integral-frame-counter) (the-as uint *dgo-time*)))) @@ -647,48 +647,48 @@ into 7 sections, which might explain the weird sizes in the center. ;; not the last object (cond - ((= (-> obj load-buffer-mode) (load-buffer-mode borrow)) + ((= (-> this load-buffer-mode) (load-buffer-mode borrow)) ;; start the linker. in "borrow" mode, load directly to the heap again. (cond - ((dgo-load-link (the-as dgo-header s5-0) (-> obj heap) (the-as uint (-> obj heap top-base)) *print-login* #f) + ((dgo-load-link (the-as dgo-header s5-0) (-> this heap) (the-as uint (-> this heap top-base)) *print-login* #f) ;; linker finished immediately, kick off next load (when (not (-> *texture-relocate-later* memcpy)) - (let ((a2-8 (logand -64 (&+ (-> obj heap current) 63)))) + (let ((a2-8 (logand -64 (&+ (-> this heap current) 63)))) (dgo-load-continue a2-8 a2-8 a2-8) ) ) ) (else ;; linker still going, remember and come back later. - (set! (-> obj linking) #t) + (set! (-> this linking) #t) ) ) ) ;; not borrow mode, start linker - ((dgo-load-link (the-as dgo-header s5-0) (-> obj heap) (-> obj load-buffer 1) *print-login* #f) + ((dgo-load-link (the-as dgo-header s5-0) (-> this heap) (-> this load-buffer 1) *print-login* #f) ;; finished immediately, kick off next loa (when (not (-> *texture-relocate-later* memcpy)) - (load-buffer-resize obj (the-as dgo-header s5-0)) + (load-buffer-resize this (the-as dgo-header s5-0)) (dgo-load-continue - (the-as pointer (-> obj load-buffer 0)) - (the-as pointer (-> obj load-buffer 1)) - (logand -64 (&+ (-> obj heap current) 63)) + (the-as pointer (-> this load-buffer 0)) + (the-as pointer (-> this load-buffer 1)) + (logand -64 (&+ (-> this heap current) 63)) ) ) ) (else ;; otherwise remember we're loading. - (set! (-> obj linking) #t) + (set! (-> this linking) #t) ) ) ) (else ;; we are the last object. update heap top and go to bt load. - (set! (-> obj heap top) (-> obj heap top-base)) - (level-status-update! obj 'loading-bt) + (set! (-> this heap top) (-> this heap top-base)) + (level-status-update! this 'loading-bt) ) ) ) @@ -696,28 +696,28 @@ into 7 sections, which might explain the weird sizes in the center. ) (('login) ;; logging in, load already finished. run the login state machine - (level-update-after-load obj *login-state*) + (level-update-after-load this *login-state*) ) (('loading-bt) ;; last object was loaded, start linking it. - (let ((a0-36 (logand -64 (&+ (-> obj heap current) 63)))) + (let ((a0-36 (logand -64 (&+ (-> this heap current) 63)))) (cond - ((dgo-load-link (the-as dgo-header a0-36) (-> obj heap) (the-as uint (-> obj heap top-base)) *print-login* #t) - (level-status-update! obj 'loading-done) - (level-status-update! obj 'loaded) + ((dgo-load-link (the-as dgo-header a0-36) (-> this heap) (the-as uint (-> this heap top-base)) *print-login* #t) + (level-status-update! this 'loading-done) + (level-status-update! this 'loaded) ) (else - (set! (-> obj linking) #t) + (set! (-> this linking) #t) ) ) ) ) ) (label cfg-39) - obj + this ) -(defmethod load-begin level ((obj level)) +(defmethod load-begin level ((this level)) "Begin loading a level. This assigns memory to a level and is somewhat confusing." (local-vars (bits-to-use int) (borrow-from-lev level) (found-borrow symbol)) @@ -729,13 +729,13 @@ into 7 sections, which might explain the weird sizes in the center. ;; a "borrow" level will borrow the heap of an existing level (dotimes (v1-0 2) - (set! (-> obj borrow-level v1-0) #f) ;; levels that borrow our heap + (set! (-> this borrow-level v1-0) #f) ;; levels that borrow our heap ) - (set! (-> obj borrow-from-level) #f) ;; level that we borrow our heap for. + (set! (-> this borrow-from-level) #f) ;; level that we borrow our heap for. - (set! (-> obj memory-mask) (the-as uint 0)) ;; bits representing which sections of the big level heap we use. + (set! (-> this memory-mask) (the-as uint 0)) ;; bits representing which sections of the big level heap we use. - (let ((mem-mode (-> obj info memory-mode))) + (let ((mem-mode (-> this info memory-mode))) (case mem-mode (((load-buffer-mode borrow)) ;; we need to find a level to borrow from. @@ -748,7 +748,7 @@ into 7 sections, which might explain the weird sizes in the center. (when (and (or (= (-> maybe-borrow-from-lev status) 'active) (= (-> maybe-borrow-from-lev status) 'loaded)) (begin (dotimes (check-slot-idx 2) ;; check both borrow slots in the host - (when (and (= (-> maybe-borrow-from-lev info borrow-level check-slot-idx) (-> obj name)) ;; match name! + (when (and (= (-> maybe-borrow-from-lev info borrow-level check-slot-idx) (-> this name)) ;; match name! (nonzero? (-> maybe-borrow-from-lev info borrow-size check-slot-idx)) ;; has room! ) (set! slot-in-borrow-from-lev check-slot-idx) @@ -774,22 +774,22 @@ into 7 sections, which might explain the weird sizes in the center. (cond (borrow-from-lev ;; link to borrow level - (set! (-> obj borrow-from-level) borrow-from-lev) - (set! (-> borrow-from-lev borrow-level slot-in-borrow-from-lev) obj) + (set! (-> this borrow-from-level) borrow-from-lev) + (set! (-> borrow-from-lev borrow-level slot-in-borrow-from-lev) this) ;; and copy the heap. seems kind of weird to copy the actual kheap object, but the host actually prepared ;; for this, so it should be fine. (mem-copy! - (the-as pointer (-> obj heap)) + (the-as pointer (-> this heap)) (the-as pointer (-> borrow-from-lev borrow-heap slot-in-borrow-from-lev)) 16 ) (start-debug "borrowing from ~A. heap:~%" borrow-from-lev) - (inspect (-> obj heap)) + (inspect (-> this heap)) ) (else ;; couldn't find it, die. (format 0 "ERROR: level ~A could not find free ~S bank in the level-group heap~%" - (-> obj name) + (-> this name) (enum->string load-buffer-mode mem-mode) ) (break!) @@ -914,7 +914,7 @@ into 7 sections, which might explain the weird sizes in the center. (cond ((zero? bits-to-use) ;; darn, couldn't find a spot. - (format 0 "ERROR: level ~A could not find free ~S bank in the level-group heap~%" (-> obj name) (enum->string load-buffer-mode mem-mode)) + (format 0 "ERROR: level ~A could not find free ~S bank in the level-group heap~%" (-> this name) (enum->string load-buffer-mode mem-mode)) (dotimes (s5-1 LEVEL_TOTAL) (if (!= (-> *level* level s5-1 status) 'inactive) (format @@ -933,12 +933,12 @@ into 7 sections, which might explain the weird sizes in the center. (start-debug "successfully found load: size #x~X, bits #x~X, offset ~D~%" heap-size bits-to-use offset-in-level-heap) ;; found a spot, set mask. - (set! (-> obj memory-mask) (the-as uint bits-to-use)) + (set! (-> this memory-mask) (the-as uint bits-to-use)) (cond ;; are we using debug sized large level? ((= (&- (-> *level* heap top) (the-as uint (-> *level* heap base))) DEBUG_LEVEL_HEAP_SIZE) ;; if so, everything is bigger! - (let ((v1-44 (-> obj heap))) + (let ((v1-44 (-> this heap))) (set! (-> v1-44 base) (&+ (-> *level* heap base) (* DEBUG_LEVEL_PAGE_SIZE offset-in-level-heap))) (set! (-> v1-44 current) (-> v1-44 base)) ;(set! (-> v1-44 top-base) (&+ (-> v1-44 base) (+ heap-size (/ heap-size 2)))) @@ -948,7 +948,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) (else - (let ((v1-45 (-> obj heap))) + (let ((v1-45 (-> this heap))) ;; no debug size heaps. set up our heap. ;; offset-in-level-heap is in 146ths (1 level heap page) of the total size. (set! (-> v1-45 base) (&+ (-> *level* heap base) (* LEVEL_PAGE_SIZE offset-in-level-heap))) @@ -968,56 +968,56 @@ into 7 sections, which might explain the weird sizes in the center. ;; our heap is now set up, prepare for loading. ;; the global loading-level heap is used by many relocate/top-level code to allocate on the level heap - (set! loading-level (-> obj heap)) - (set! (-> *level* loading-level) obj) + (set! loading-level (-> this heap)) + (set! (-> *level* loading-level) this) ;; start linked list of types associated with this level - (set! (-> obj level-type) #f) - (set! *level-type-list* (the-as type (&-> obj level-type))) + (set! (-> this level-type) #f) + (set! *level-type-list* (the-as type (&-> this level-type))) ;; clear stuff out (set! (-> *level* log-in-level-bsp) #f) - (set! (-> obj nickname) #f) - (set! (-> obj bsp) #f) - (set! (-> obj entity) #f) - (set! (-> obj linking) #f) - (set! (-> obj task-mask) (-> *setting-control* user-current task-mask)) - (vis-clear obj) - (set! (-> obj load-start-time) (-> *display* real-clock frame-counter)) - (set! (-> obj load-stop-time) 0) - (set! (-> obj display-start-time) 0) - (set! (-> obj part-engine) #f) + (set! (-> this nickname) #f) + (set! (-> this bsp) #f) + (set! (-> this entity) #f) + (set! (-> this linking) #f) + (set! (-> this task-mask) (-> *setting-control* user-current task-mask)) + (vis-clear this) + (set! (-> this load-start-time) (-> *display* real-clock frame-counter)) + (set! (-> this load-stop-time) 0) + (set! (-> this display-start-time) 0) + (set! (-> this part-engine) #f) (dotimes (v1-57 4) - (set! (-> obj user-object v1-57) #f) + (set! (-> this user-object v1-57) #f) ) ;; go straight to loading - (set! (-> obj status) 'loading) + (set! (-> this status) 'loading) ;; non-permanent allocator (set! (-> *texture-pool* allocate-func) texture-page-level-allocate) - (if (= (-> obj load-name) (-> obj info visname)) - (format (clear *temp-string*) "~S" (-> obj info nickname)) - (format (clear *temp-string*) "~S" (-> obj name)) + (if (= (-> this load-name) (-> this info visname)) + (format (clear *temp-string*) "~S" (-> this info nickname)) + (format (clear *temp-string*) "~S" (-> this name)) ) (set! (-> *temp-string* data 8) (the-as uint 0)) (format *temp-string* ".DGO") - (set! (-> obj heap top) (-> obj heap top-base)) - (set! (-> *level* load-level) (-> obj load-name)) + (set! (-> this heap top) (-> this heap top-base)) + (set! (-> *level* load-level) (-> this load-name)) (set! (-> *level* load-size) (the-as uint 0)) (set! (-> *level* load-time) 0.0) (set! (-> *level* load-login-time) 0.0) ;; code comes first - (set! (-> obj code-memory-start) (-> obj heap current)) + (set! (-> this code-memory-start) (-> this heap current)) (cond - ((= (-> obj info memory-mode) (load-buffer-mode borrow)) + ((= (-> this info memory-mode) (load-buffer-mode borrow)) ;; if we're borrowing, we should load directly to heap current. ;; this is somewhat strange, and has two drawbacks: ;; - we can't discard link data easily, like we would normally with the double buffer setup ;; - we can't allocate during login. Or if we allocate more than our link data, then bad things happen. - (set! (-> obj load-buffer-mode) (load-buffer-mode borrow)) - (let ((a3-19 (logand -64 (&+ (-> obj heap current) 63)))) + (set! (-> this load-buffer-mode) (load-buffer-mode borrow)) + (let ((a3-19 (logand -64 (&+ (-> this heap current) 63)))) (start-debug "DGO-LOAD-BEGIN FOR BORROW: #x~x~%" a3-19) ;; start dgo loader! (dgo-load-begin *temp-string* a3-19 a3-19 a3-19) @@ -1027,33 +1027,33 @@ into 7 sections, which might explain the weird sizes in the center. ;; normal loading into a new heap. ;; allocate the two dgo level load buffers on top, like normal (let* ((s3-1 #x1b5800) - (s4-1 (kmalloc (-> obj heap) s3-1 (kmalloc-flags align-64 top) "dgo-level-buf-2")) - (s5-4 (kmalloc (-> obj heap) s3-1 (kmalloc-flags align-64 top) "dgo-level-buf-2")) + (s4-1 (kmalloc (-> this heap) s3-1 (kmalloc-flags align-64 top) "dgo-level-buf-2")) + (s5-4 (kmalloc (-> this heap) s3-1 (kmalloc-flags align-64 top) "dgo-level-buf-2")) ) - (format 0 "-----------> begin load ~A [~S]~%" (-> obj load-name) *temp-string*) - (set! (-> obj load-buffer 0) (the-as uint s5-4)) - (set! (-> obj load-buffer 1) (the-as uint s4-1)) - (set! (-> obj load-buffer-size) (the-as uint s3-1)) + (format 0 "-----------> begin load ~A [~S]~%" (-> this load-name) *temp-string*) + (set! (-> this load-buffer 0) (the-as uint s5-4)) + (set! (-> this load-buffer 1) (the-as uint s4-1)) + (set! (-> this load-buffer-size) (the-as uint s3-1)) ;; unclear why they do this, I guess it avoids the weird "medium" case in load-buffer-resize. - (set! (-> obj load-buffer-mode) (load-buffer-mode small-edge)) + (set! (-> this load-buffer-mode) (load-buffer-mode small-edge)) - (start-debug "DGO-LOAD-BEGIN: #x~X #x~X #x~X~%" s5-4 s4-1 (logand -64 (&+ (-> obj heap current) 63))) - (dgo-load-begin *temp-string* s5-4 s4-1 (logand -64 (&+ (-> obj heap current) 63))) + (start-debug "DGO-LOAD-BEGIN: #x~X #x~X #x~X~%" s5-4 s4-1 (logand -64 (&+ (-> this heap current) 63))) + (dgo-load-begin *temp-string* s5-4 s4-1 (logand -64 (&+ (-> this heap current) 63))) ) ) ) - obj + this ) -(defmethod login-begin level ((obj level)) +(defmethod login-begin level ((this level)) "Begin login of a level after linking. The login is spread over multiple frames." ;; link done, revert allocate-func back to "normal". (set! (-> *texture-pool* allocate-func) texture-page-default-allocate) (cond - ((-> obj bsp) - (let ((s5-0 (-> obj bsp))) + ((-> this bsp) + (let ((s5-0 (-> this bsp))) (set! (-> s5-0 level tfrag-gs-test) (if (logtest? (-> s5-0 texture-flags 0) (texture-page-flag alpha-enable)) (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest greater-equal)) @@ -1066,15 +1066,15 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ) - (set! (-> *level* log-in-level-bsp) (-> obj bsp)) - (login-level-textures *texture-pool* obj (-> obj bsp texture-page-count) (-> obj bsp texture-ids)) + (set! (-> *level* log-in-level-bsp) (-> this bsp)) + (login-level-textures *texture-pool* this (-> this bsp texture-page-count) (-> this bsp texture-ids)) (dotimes (v1-10 6) - (set! (-> obj sky-mask mask data v1-10) 0) + (set! (-> this sky-mask mask data v1-10) 0) ) (dotimes (s4-0 10) - (let ((a0-8 (-> obj info texture-anim s4-0))) + (let ((a0-8 (-> this info texture-anim s4-0))) (when a0-8 - (set! (-> obj texture-anim-array s4-0) + (set! (-> this texture-anim-array s4-0) (init! (the-as texture-anim-array (-> a0-8 value))) ) ) @@ -1085,17 +1085,17 @@ into 7 sections, which might explain the weird sizes in the center. (set! (-> *login-state* state) -1) (set! (-> *login-state* pos) (the-as uint 0)) (set! (-> *login-state* elts) (the-as uint 0)) - (set! (-> obj status) 'login) + (set! (-> this status) 'login) ) (else - (level-status-update! obj 'inactive) + (level-status-update! this 'inactive) (set! loading-level global) (set! (-> *level* loading-level) (-> *level* default-level)) (set! *level-type-list* (the-as type 0)) 0 ) ) - obj + this ) (defun level-update-after-load ((lev level) (lstate login-state)) @@ -1423,50 +1423,50 @@ into 7 sections, which might explain the weird sizes in the center. lev ) -(defmethod birth level ((obj level)) +(defmethod birth level ((this level)) "Start running code for a level that has been loaded." (local-vars (sv-96 int)) - (case (-> obj status) + (case (-> this status) (('loaded) (let ((s5-0 loading-level) (s4-0 (-> *level* loading-level)) (s3-0 (-> *level* log-in-level-bsp)) (s2-1 *level-type-list*) ) - (let ((s1-0 (not (-> obj entity)))) - (set! loading-level (-> obj heap)) - (set! (-> *level* log-in-level-bsp) (-> obj bsp)) - (set! (-> *level* loading-level) obj) - (set! *level-type-list* (the-as type (&-> obj level-type))) + (let ((s1-0 (not (-> this entity)))) + (set! loading-level (-> this heap)) + (set! (-> *level* log-in-level-bsp) (-> this bsp)) + (set! (-> *level* loading-level) this) + (set! *level-type-list* (the-as type (&-> this level-type))) (cond - ((valid? (-> obj bsp light-hash) light-hash (the-as string #f) #t 0) - (set! (-> obj light-hash) (-> obj bsp light-hash)) + ((valid? (-> this bsp light-hash) light-hash (the-as string #f) #t 0) + (set! (-> this light-hash) (-> this bsp light-hash)) ) (else - (set! (-> obj light-hash) (the-as light-hash 0)) + (set! (-> this light-hash) (the-as light-hash 0)) 0 ) ) - (birth (-> obj bsp)) - (set! (-> obj status) 'alive) - (set! (-> obj render?) #t) + (birth (-> this bsp)) + (set! (-> this status) 'alive) + (set! (-> this render?) #t) - (copy-perms-to-level! *game-info* obj) - (send-event *camera* 'level-activate (-> obj name)) - (send-event *target* 'level-activate (-> obj name)) - (when (and (-> obj info login-func) s1-0) - (let ((s1-1 (-> obj info login-func value))) + (copy-perms-to-level! *game-info* this) + (send-event *camera* 'level-activate (-> this name)) + (send-event *target* 'level-activate (-> this name)) + (when (and (-> this info login-func) s1-0) + (let ((s1-1 (-> this info login-func value))) (if (and s1-1 (nonzero? s1-1) (type? s1-1 function)) - ((the (function level none) s1-1) obj) + ((the (function level none) s1-1) this) ) ) ) ) - (let ((s1-2 (-> obj status))) - (set! (-> obj status) 'active) + (let ((s1-2 (-> this status))) + (set! (-> this status) 'active) (update-task-masks 'level) (assign-draw-indices *level*) - (let ((s0-0 (-> obj bsp nav-meshes))) + (let ((s0-0 (-> this bsp nav-meshes))) (when (nonzero? s0-0) (set! sv-96 0) (while (< sv-96 (-> s0-0 length)) @@ -1475,17 +1475,17 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ) - (if (and (!= (-> obj bsp city-level-info) 0) *traffic-manager*) - (send-event *traffic-manager* 'level-loaded obj) + (if (and (!= (-> this bsp city-level-info) 0) *traffic-manager*) + (send-event *traffic-manager* 'level-loaded this) ) - (when (-> obj info activate-func) - (let ((s0-1 (-> obj info activate-func value))) + (when (-> this info activate-func) + (let ((s0-1 (-> this info activate-func value))) (if (and s0-1 (nonzero? s0-1) (type? s0-1 function)) - ((the (function level symbol none) s0-1) obj 'display) + ((the (function level symbol none) s0-1) this 'display) ) ) ) - (set! (-> obj status) s1-2) + (set! (-> this status) s1-2) ) (set! loading-level s5-0) (set! (-> *level* loading-level) s4-0) @@ -1494,57 +1494,57 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ) - obj + this ) -(defmethod deactivate level ((obj level)) +(defmethod deactivate level ((this level)) "Take a level out of active/alive" - (case (-> obj status) + (case (-> this status) (('active 'alive) - (format 0 "----------- kill ~A (status ~A)~%" obj (-> obj status)) + (format 0 "----------- kill ~A (status ~A)~%" this (-> this status)) ;; send event to traffic manager. - (if (and (!= (-> obj bsp city-level-info) 0) *traffic-manager*) - (send-event *traffic-manager* 'level-killed obj) + (if (and (!= (-> this bsp city-level-info) 0) *traffic-manager*) + (send-event *traffic-manager* 'level-killed this) ) ;; run kill callbacks - (when (-> obj info kill-func) - (let ((s5-0 (-> obj info kill-func value))) + (when (-> this info kill-func) + (let ((s5-0 (-> this info kill-func value))) (if (and s5-0 (nonzero? s5-0) (type? s5-0 function)) - ((the (function level none) s5-0) obj) + ((the (function level none) s5-0) this) ) ) ) ;; copy data from entities to permanent storage - (copy-perms-from-level! *game-info* obj) + (copy-perms-from-level! *game-info* this) ;; tell target - (send-event *target* 'level-deactivate (-> obj name)) + (send-event *target* 'level-deactivate (-> this name)) ;; remove from background draw system - (remove-by-param1 *background-draw-engine* (the-as int (-> obj bsp))) + (remove-by-param1 *background-draw-engine* (the-as int (-> this bsp))) ;; kill entities, particles, anims - (deactivate-entities (-> obj bsp)) - (kill-all-particles-in-level obj) - (unload-from-level *anim-manager* obj) + (deactivate-entities (-> this bsp)) + (kill-all-particles-in-level this) + (unload-from-level *anim-manager* this) ;; reset status - (set! (-> obj inside-boxes) #f) - (set! (-> obj meta-inside?) #f) - (set! (-> obj force-inside?) #f) - (set! (-> obj status) 'loaded) - (set! (-> obj light-hash) (the-as light-hash 0)) - (set! (-> obj all-visible?) 'loading) + (set! (-> this inside-boxes) #f) + (set! (-> this meta-inside?) #f) + (set! (-> this force-inside?) #f) + (set! (-> this status) 'loaded) + (set! (-> this light-hash) (the-as light-hash 0)) + (set! (-> this all-visible?) 'loading) ;; clear vis. (dotimes (v1-34 128) - (set! (-> (the-as (pointer int128) (&+ (-> obj vis-bits) (* v1-34 16)))) (the int128 0)) + (set! (-> (the-as (pointer int128) (&+ (-> this vis-bits) (* v1-34 16)))) (the int128 0)) ) (countdown (v1-37 8) - (let ((a0-20 (-> obj vis-info v1-37))) + (let ((a0-20 (-> this vis-info v1-37))) (if a0-20 (set! (-> a0-20 current-vis-string) (the-as uint -1)) ) @@ -1552,37 +1552,37 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ) - (if (= (-> *level* log-in-level-bsp) (-> obj bsp)) + (if (= (-> *level* log-in-level-bsp) (-> this bsp)) (set! (-> *level* log-in-level-bsp) #f) ) - obj + this ) -(defmethod unload! level ((obj level)) +(defmethod unload! level ((this level)) "Unload a level." ;; make sure it's not alive/active - (deactivate obj) + (deactivate this) - (when (!= (-> obj status) 'inactive) + (when (!= (-> this status) 'inactive) ;; first, unload anybody who borrows from us. (dotimes (s5-0 2) - (when (-> obj borrow-level s5-0) - (unload! (-> obj borrow-level s5-0)) - (set! (-> obj borrow-level s5-0) #f) + (when (-> this borrow-level s5-0) + (unload! (-> this borrow-level s5-0)) + (set! (-> this borrow-level s5-0) #f) ) ) ;; if we borrow from somebody, remove ourselves from them - (when (-> obj borrow-from-level) + (when (-> this borrow-from-level) (dotimes (v1-19 2) - (if (= obj (-> obj borrow-from-level borrow-level v1-19)) - (set! (-> obj borrow-from-level borrow-level v1-19) #f) + (if (= this (-> this borrow-from-level borrow-level v1-19)) + (set! (-> this borrow-from-level borrow-level v1-19) #f) ) ) - (set! (-> obj borrow-from-level) #f) + (set! (-> this borrow-from-level) #f) ) - (case (-> obj status) + (case (-> this status) (('loading 'loading-bt) ;; kill the linker if we're mid link. (if (nonzero? link-reset) @@ -1591,10 +1591,10 @@ into 7 sections, which might explain the weird sizes in the center. ) (('alive 'active 'loaded) ;; run deactivate func. - (when (-> obj info deactivate-func) - (let ((s5-1 (-> obj info deactivate-func value))) + (when (-> this info deactivate-func) + (let ((s5-1 (-> this info deactivate-func value))) (if (and s5-1 (nonzero? s5-1) (type? s5-1 function)) - ((the (function level none) s5-1) obj) + ((the (function level none) s5-1) this) ) ) ) @@ -1602,39 +1602,39 @@ into 7 sections, which might explain the weird sizes in the center. ) ;; unlink art groups. - (when (or (= (-> obj status) 'loaded) - (= (-> obj status) 'alive) - (= (-> obj status) 'active) - (= (-> obj status) 'login) + (when (or (= (-> this status) 'loaded) + (= (-> this status) 'alive) + (= (-> this status) 'active) + (= (-> this status) 'login) ) - (dotimes (s5-2 (-> obj art-group art-group-array length)) - (let ((s4-0 (-> obj art-group art-group-array s5-2))) + (dotimes (s5-2 (-> this art-group art-group-array length)) + (let ((s4-0 (-> this art-group art-group-array s5-2))) (if (needs-link? s4-0) (unlink-art! s4-0) ) ) ) ) - (set! (-> obj bsp) #f) - (set! (-> obj entity) #f) - (set! (-> obj status) 'inactive) - (set! (-> obj linking) #f) - (set! (-> obj art-group string-array length) 0) - (set! (-> obj art-group art-group-array length) 0) - (set! (-> obj mem-usage-block) (the-as memory-usage-block 0)) - (set! (-> obj mem-usage) 0) - (set! (-> obj part-engine) #f) + (set! (-> this bsp) #f) + (set! (-> this entity) #f) + (set! (-> this status) 'inactive) + (set! (-> this linking) #f) + (set! (-> this art-group string-array length) 0) + (set! (-> this art-group art-group-array length) 0) + (set! (-> this mem-usage-block) (the-as memory-usage-block 0)) + (set! (-> this mem-usage) 0) + (set! (-> this part-engine) #f) (dotimes (v1-60 4) - (set! (-> obj user-object v1-60) #f) + (set! (-> this user-object v1-60) #f) ) ;; kill texture anims - (let ((v1-63 (-> obj status))) + (let ((v1-63 (-> this status))) (when (or (= v1-63 'alive) (or (= v1-63 'active) (= v1-63 'loaded))) (dotimes (s5-3 10) - (let ((a0-37 (-> obj info texture-anim s5-3))) + (let ((a0-37 (-> this info texture-anim s5-3))) (if a0-37 - (set! (-> obj texture-anim-array s5-3) + (set! (-> this texture-anim-array s5-3) (clear! (the-as texture-anim-array (-> a0-37 value))) ) ) @@ -1643,27 +1643,27 @@ into 7 sections, which might explain the weird sizes in the center. ) ) (dotimes (v1-73 10) - (set! (-> obj texture-anim-array v1-73) #f) + (set! (-> this texture-anim-array v1-73) #f) ) - (countdown (s5-4 (-> obj loaded-texture-page-count)) + (countdown (s5-4 (-> this loaded-texture-page-count)) (dotimes (v1-76 32) - (when (= (-> obj loaded-texture-page s5-4) (-> *texture-pool* common-page v1-76)) + (when (= (-> this loaded-texture-page s5-4) (-> *texture-pool* common-page v1-76)) (set! (-> *texture-pool* common-page v1-76) (the-as texture-page 0)) 0 ) ) - (unload-page *texture-pool* (-> obj loaded-texture-page s5-4)) + (unload-page *texture-pool* (-> this loaded-texture-page s5-4)) ) - (set! (-> obj loaded-texture-page-count) 0) - (unlink-shaders-in-heap *texture-page-dir* (-> obj heap)) - (unlink-part-group-by-heap (-> obj heap)) - (unlink-lightning-spec-by-heap (-> obj heap)) + (set! (-> this loaded-texture-page-count) 0) + (unlink-shaders-in-heap *texture-page-dir* (-> this heap)) + (unlink-part-group-by-heap (-> this heap)) + (unlink-lightning-spec-by-heap (-> this heap)) (particle-adgif-cache-flush) - (set! (-> obj loaded-text-info-count) 0) + (set! (-> this loaded-text-info-count) 0) (dotimes (s5-5 2) (let ((v1-90 (-> *art-control* buffer s5-5 pending-load-file))) - (if (and (>= (the-as int v1-90) (the-as int (-> obj heap base))) - (< (the-as int v1-90) (the-as int (-> obj heap top-base))) + (if (and (>= (the-as int v1-90) (the-as int (-> this heap base))) + (< (the-as int v1-90) (the-as int (-> this heap top-base))) ) (set-pending-file (-> *art-control* buffer s5-5) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) @@ -1673,7 +1673,7 @@ into 7 sections, which might explain the weird sizes in the center. (dotimes (a0-59 (-> v1-100 length)) (when (nonzero? a0-59) (let ((a1-20 (-> v1-100 a0-59))) - (when (and (-> a1-20 info) (= (-> a1-20 info level) (-> obj name))) + (when (and (-> a1-20 info) (= (-> a1-20 info level) (-> this name))) (countdown (a2-6 7) (set! (-> a1-20 info hooks a2-6) #f) ) @@ -1684,7 +1684,7 @@ into 7 sections, which might explain the weird sizes in the center. ) (let ((v1-103 0) (a0-60 0) - (a1-23 (-> obj level-type)) + (a1-23 (-> this level-type)) ) (while a1-23 (+! a0-60 1) @@ -1695,7 +1695,7 @@ into 7 sections, which might explain the weird sizes in the center. (set! a1-23 (the-as type (-> a1-23 method-table 8))) ) ) - (let* ((s5-6 (-> obj info packages)) + (let* ((s5-6 (-> this info packages)) (a0-61 (car s5-6)) ) (while (not (null? s5-6)) @@ -1711,15 +1711,15 @@ into 7 sections, which might explain the weird sizes in the center. (set! a0-61 (car s5-6)) ) ) - (vis-clear obj) - (let ((v1-120 (-> obj heap))) + (vis-clear this) + (let ((v1-120 (-> this heap))) (set! (-> v1-120 current) (-> v1-120 base)) ) - (set! (-> obj memory-mask) (the-as uint 0)) - (set! (-> obj code-memory-start) (the-as pointer 0)) - (set! (-> obj code-memory-end) (the-as pointer 0)) - (set! (-> obj level-type) #f) - (when (= (-> *level* loading-level) obj) + (set! (-> this memory-mask) (the-as uint 0)) + (set! (-> this code-memory-start) (the-as pointer 0)) + (set! (-> this code-memory-end) (the-as pointer 0)) + (set! (-> this level-type) #f) + (when (= (-> *level* loading-level) this) (set! loading-level global) (set! (-> *level* loading-level) (-> *level* default-level)) (set! (-> *level* log-in-level-bsp) #f) @@ -1728,15 +1728,15 @@ into 7 sections, which might explain the weird sizes in the center. ) (assign-draw-indices *level*) ) - obj + this ) -(defmethod is-object-visible? level ((obj level) (arg0 int)) +(defmethod is-object-visible? level ((this level) (arg0 int)) "Is drawable arg0 visible? Note that this will return #f if the visibility data is not loaded." ;; check the vis bits! (let* (;; lwu v1, 388(a0) - (vis-data (-> obj vis-bits)) + (vis-data (-> this vis-bits)) ;; sra a0, a1, 3 (byte-idx (sar arg0 3)) ;; daddu v1, a0, v1 @@ -1757,7 +1757,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod inside-boxes-check level ((obj level) (arg0 vector)) +(defmethod inside-boxes-check level ((this level) (arg0 vector)) "NOTE: this function used to check if we were in boxes - here it just checks a flag. However, it is still used to set the inside-boxes field, so it keeps the name we gave it in Jak 1. @@ -1766,57 +1766,57 @@ into 7 sections, which might explain the weird sizes in the center. except for if the require-force-inside flag is set in the bsp-header, in which case it requires the level to be marked as force-inside?" (cond - ((not (-> obj bsp)) + ((not (-> this bsp)) #f ) - ((-> obj force-inside?) + ((-> this force-inside?) #t ) (else - (zero? (-> obj bsp cam-outside-bsp)) + (zero? (-> this bsp cam-outside-bsp)) ) ) ) -(defmethod debug-print-region-splitbox level ((obj level) (arg0 vector) (arg1 object)) +(defmethod debug-print-region-splitbox level ((this level) (arg0 vector) (arg1 object)) "Display debug info about the regions of a level." (cond - ((or (not (-> obj bsp)) (zero? (-> obj bsp region-tree))) + ((or (not (-> this bsp)) (zero? (-> this bsp region-tree))) ) - ((nonzero? (-> obj bsp region-tree)) - (debug-print (-> obj bsp region-tree) arg0 arg1) + ((nonzero? (-> this bsp region-tree)) + (debug-print (-> this bsp region-tree) arg0 arg1) ) ) 0 (none) ) -(defmethod mem-usage level ((obj level) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage level ((this level) (arg0 memory-usage-block) (arg1 int)) "Compute the memory usage of a level." - (when (= (-> obj status) 'active) + (when (= (-> this status) 'active) (set! (-> arg0 length) (max 67 (-> arg0 length))) (set! (-> arg0 data 66 name) "entity-links") - (+! (-> arg0 data 66 count) (-> obj entity length)) - (let ((v1-8 (asize-of (-> obj entity)))) + (+! (-> arg0 data 66 count) (-> this entity length)) + (let ((v1-8 (asize-of (-> this entity)))) (+! (-> arg0 data 66 used) v1-8) (+! (-> arg0 data 66 total) (logand -16 (+ v1-8 15))) ) - (mem-usage (-> obj art-group) arg0 arg1) + (mem-usage (-> this art-group) arg0 arg1) (set! (-> arg0 length) (max 66 (-> arg0 length))) (set! (-> arg0 data 65 name) "level-code") (+! (-> arg0 data 65 count) 1) - (let ((v1-20 (&- (-> obj code-memory-end) (the-as uint (-> obj code-memory-start))))) + (let ((v1-20 (&- (-> this code-memory-end) (the-as uint (-> this code-memory-start))))) (+! (-> arg0 data 65 used) v1-20) (+! (-> arg0 data 65 total) (logand -16 (+ v1-20 15))) ) - (countdown (s3-0 (-> obj loaded-texture-page-count)) - (mem-usage (-> obj loaded-texture-page s3-0) arg0 arg1) + (countdown (s3-0 (-> this loaded-texture-page-count)) + (mem-usage (-> this loaded-texture-page s3-0) arg0 arg1) ) - (countdown (s3-1 (-> obj loaded-text-info-count)) - (mem-usage (-> obj loaded-text-info s3-1) arg0 arg1) + (countdown (s3-1 (-> this loaded-text-info-count)) + (mem-usage (-> this loaded-text-info s3-1) arg0 arg1) ) (countdown (s3-2 8) - (let ((s2-0 (-> obj vis-info s3-2))) + (let ((s2-0 (-> this vis-info s3-2))) (when s2-0 (cond ((zero? s3-2) @@ -1842,13 +1842,13 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ;; most of this is in the bsp: - (mem-usage (-> obj bsp) arg0 arg1) + (mem-usage (-> this bsp) arg0 arg1) ) - obj + this ) -(defmethod alloc-levels-if-needed level-group ((obj level-group) (arg0 symbol)) +(defmethod alloc-levels-if-needed level-group ((this level-group) (arg0 symbol)) "Setup for playing levels by loading the required base packages (art, common) and allocating the level heap." (when (zero? (-> *level* heap base)) @@ -1868,7 +1868,7 @@ into 7 sections, which might explain the weird sizes in the center. DEBUG_LEVEL_HEAP_SIZE ) ) - (gp-1 (-> obj heap)) + (gp-1 (-> this heap)) ) (start-debug "about to allocate level heap with size #x~X (~f MB)~%" s5-1 (/ (the float s5-1) 1024.)) (set! (-> gp-1 base) (kmalloc global s5-1 (kmalloc-flags) "heap")) @@ -1882,47 +1882,47 @@ into 7 sections, which might explain the weird sizes in the center. (none) ) -(defmethod level-get-with-status level-group ((obj level-group) (arg0 symbol)) +(defmethod level-get-with-status level-group ((this level-group) (arg0 symbol)) "Get a level with the given status." - (dotimes (v1-0 (-> obj length)) - (if (= (-> obj level v1-0 status) arg0) - (return (-> obj level v1-0)) + (dotimes (v1-0 (-> this length)) + (if (= (-> this level v1-0 status) arg0) + (return (-> this level v1-0)) ) ) (the-as level #f) ) -(defmethod level-get-most-disposable level-group ((obj level-group)) +(defmethod level-get-most-disposable level-group ((this level-group)) "Get the level that's least useful." - (dotimes (v1-0 (-> obj length)) - (case (-> obj level v1-0 status) + (dotimes (v1-0 (-> this length)) + (case (-> this level v1-0 status) (('inactive) - (return (-> obj level v1-0)) + (return (-> this level v1-0)) ) ) ) - (dotimes (v1-6 (-> obj length)) - (case (-> obj level v1-6 status) + (dotimes (v1-6 (-> this length)) + (case (-> this level v1-6 status) (('loading 'loading-bt) - (return (-> obj level v1-6)) + (return (-> this level v1-6)) ) ) ) - (dotimes (v1-12 (-> obj length)) - (case (-> obj level v1-12 status) + (dotimes (v1-12 (-> this length)) + (case (-> this level v1-12 status) (('loaded) - (return (-> obj level v1-12)) + (return (-> this level v1-12)) ) ) ) (let ((v0-0 (the-as level #f))) - (dotimes (v1-18 (-> obj length)) - (case (-> obj level v1-18 status) + (dotimes (v1-18 (-> this length)) + (case (-> this level v1-18 status) (('active) - (if (and (not (-> obj level v1-18 inside-boxes)) - (or (not v0-0) (< (-> obj level v1-18 info priority) (-> v0-0 info priority))) + (if (and (not (-> this level v1-18 inside-boxes)) + (or (not v0-0) (< (-> this level v1-18 info priority) (-> v0-0 info priority))) ) - (set! v0-0 (-> obj level v1-18)) + (set! v0-0 (-> this level v1-18)) ) ) ) @@ -1931,19 +1931,19 @@ into 7 sections, which might explain the weird sizes in the center. ) ) -(defmethod level-get level-group ((obj level-group) (arg0 symbol)) +(defmethod level-get level-group ((this level-group) (arg0 symbol)) "Get a level by name or load-name" - (dotimes (v1-0 (-> obj length)) - (if (and (!= (-> obj level v1-0 status) 'inactive) - (or (= (-> obj level v1-0 name) arg0) (= (-> obj level v1-0 load-name) arg0)) + (dotimes (v1-0 (-> this length)) + (if (and (!= (-> this level v1-0 status) 'inactive) + (or (= (-> this level v1-0 name) arg0) (= (-> this level v1-0 load-name) arg0)) ) - (return (-> obj level v1-0)) + (return (-> this level v1-0)) ) ) (the-as level #f) ) -(defmethod art-group-get-by-name level-group ((obj level-group) (arg0 string) (arg1 (pointer uint32))) +(defmethod art-group-get-by-name level-group ((this level-group) (arg0 string) (arg1 (pointer uint32))) "Search all levels for an art-group. Return the art group, or #f. Optionally return the level index." (countdown (s4-0 LEVEL_TOTAL) (let ((s3-0 (-> *level* level s4-0))) @@ -1962,15 +1962,15 @@ into 7 sections, which might explain the weird sizes in the center. (the-as art-group #f) ) -(defmethod activate-levels! level-group ((obj level-group)) +(defmethod activate-levels! level-group ((this level-group)) "Set all levels to active." - (dotimes (s5-0 (-> obj length)) - (level-status-update! (-> obj level s5-0) 'active) + (dotimes (s5-0 (-> this length)) + (level-status-update! (-> this level s5-0) 'active) ) 0 ) -(defmethod level-get-target-inside level-group ((obj level-group)) +(defmethod level-get-target-inside level-group ((this level-group)) "Get the level that target is 'in'. With a bunch of tricks for what 'in' really means." (let ((s5-0 (target-pos 0))) @@ -1979,8 +1979,8 @@ into 7 sections, which might explain the weird sizes in the center. ;; this is the most 'in' level. (let ((v1-1 (-> *load-state* vis-nick))) (when v1-1 - (dotimes (a0-3 (-> obj length)) - (let ((a1-3 (-> obj level a0-3))) + (dotimes (a0-3 (-> this length)) + (let ((a1-3 (-> this level a0-3))) (when (= (-> a1-3 status) 'active) (if (= (-> a1-3 name) v1-1) (return a1-3) @@ -1993,8 +1993,8 @@ into 7 sections, which might explain the weird sizes in the center. ;; next, try the level for the continue point. (let ((v1-5 (-> *game-info* current-continue level))) - (dotimes (a0-5 (-> obj length)) - (let ((a1-8 (-> obj level a0-5))) + (dotimes (a0-5 (-> this length)) + (let ((a1-8 (-> this level a0-5))) (when (= (-> a1-8 status) 'active) (if (= (-> a1-8 name) v1-5) (return a1-8) @@ -2008,8 +2008,8 @@ into 7 sections, which might explain the weird sizes in the center. ;; (note that this is slightly broken, f30-0 is never updated) (let ((s4-0 (the-as level #f))) (let ((f30-0 0.0)) - (dotimes (s3-0 (-> obj length)) - (let ((s2-0 (-> obj level s3-0))) + (dotimes (s3-0 (-> this length)) + (let ((s2-0 (-> this level s3-0))) (when (= (-> s2-0 status) 'active) (let ((f0-0 (vector-vector-distance (-> s2-0 bsp bsphere) s5-0))) (if (and (-> s2-0 inside-boxes) (or (not s4-0) (< f0-0 f30-0))) @@ -2027,8 +2027,8 @@ into 7 sections, which might explain the weird sizes in the center. ) ;; if all that failed, try any with the meta-inside? flag. - (dotimes (v1-23 (-> obj length)) - (let ((a0-11 (-> obj level v1-23))) + (dotimes (v1-23 (-> this length)) + (let ((a0-11 (-> this level v1-23))) (when (= (-> a0-11 status) 'active) (if (-> a0-11 meta-inside?) (return a0-11) @@ -2040,8 +2040,8 @@ into 7 sections, which might explain the weird sizes in the center. ;; if that still didn't work, return any active level. (let ((v0-1 (the-as level #f))) 0.0 - (dotimes (v1-26 (-> obj length)) - (let ((a0-16 (-> obj level v1-26))) + (dotimes (v1-26 (-> this length)) + (let ((a0-16 (-> this level v1-26))) (when (= (-> a0-16 status) 'active) (if (not v0-1) (set! v0-1 a0-16) @@ -2054,18 +2054,18 @@ into 7 sections, which might explain the weird sizes in the center. ) -(defmethod load-commands-set! level-group ((obj level-group) (arg0 pair)) +(defmethod load-commands-set! level-group ((this level-group) (arg0 pair)) "Set the load-commands of a level." - (set! (-> obj load-commands) arg0) + (set! (-> this load-commands) arg0) (none) ) -(defmethod mem-usage level-group ((obj level-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage level-group ((this level-group) (arg0 memory-usage-block) (arg1 int)) "Compute mem-usage for an entire level-group." - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj level s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this level s3-0) arg0 arg1) ) - obj + this ) (defun bg ((arg0 symbol)) @@ -2389,7 +2389,7 @@ into 7 sections, which might explain the weird sizes in the center. 0 ) -(defmethod update! load-state ((obj load-state)) +(defmethod update! load-state ((this load-state)) "Update level stuff based on load state. This does scary transitions." @@ -2413,7 +2413,7 @@ into 7 sections, which might explain the weird sizes in the center. ;; check if still wanted (let ((still-wanted #f)) (dotimes (t0-2 LEVEL_MAX) - (if (= (-> unload-candidate-lev name) (-> obj want t0-2 name)) + (if (= (-> unload-candidate-lev name) (-> this want t0-2 name)) (set! still-wanted #t) ) ) @@ -2473,12 +2473,12 @@ into 7 sections, which might explain the weird sizes in the center. (set! (-> desired-levels a0-14) #f) ) (dotimes (want-lev-idx LEVEL_MAX) ;; loop over wants - (when (-> obj want want-lev-idx name) - (set! (-> desired-levels want-lev-idx) (-> obj want want-lev-idx name)) + (when (-> this want want-lev-idx name) + (set! (-> desired-levels want-lev-idx) (-> this want want-lev-idx name)) ;; check if this wanted level is already present, in any state. (dotimes (a1-17 LEVEL_MAX) (let ((a2-13 (-> *level* level a1-17))) - (if (and (!= (-> a2-13 status) 'inactive) (= (-> a2-13 name) (-> obj want want-lev-idx name))) + (if (and (!= (-> a2-13 status) 'inactive) (= (-> a2-13 name) (-> this want want-lev-idx name))) (set! (-> desired-levels want-lev-idx) #f) ;; it's already there, not candidate for load start ) ) @@ -2500,13 +2500,13 @@ into 7 sections, which might explain the weird sizes in the center. ;; loading only starts if we're not busy - there's a strange exception that if we have no levels at all, ;; and dgo is busy, we at least start the load. (when (and (or no-levels-at-all (not (check-busy *load-dgo-rpc*))) (not (load-in-progress? *level*))) - (format 0 "Adding level ~A~%" (-> obj want want-lev-idx-to-load name)) + (format 0 "Adding level ~A~%" (-> this want want-lev-idx-to-load name)) ;; do the actual level assignment - (let ((new-lev (level-get-for-use *level* (-> obj want want-lev-idx-to-load name) 'loaded))) + (let ((new-lev (level-get-for-use *level* (-> this want want-lev-idx-to-load name) 'loaded))) ;; if we have no levels at all, there's nothing we can show until this one is loading, so block here and load. - (when (and no-levels-at-all (-> obj want want-lev-idx-to-load display?)) + (when (and no-levels-at-all (-> this want want-lev-idx-to-load display?)) (format 0 "Waiting for level to load~%") (while (or (= (-> new-lev status) 'loading) (= (-> new-lev status) 'loading-bt) (= (-> new-lev status) 'login)) (load-continue new-lev) @@ -2523,36 +2523,36 @@ into 7 sections, which might explain the weird sizes in the center. ;; process other changes in want. ;; loop over all wanted levels (dotimes (want-lev-i LEVEL_MAX) - (when (-> obj want want-lev-i name) + (when (-> this want want-lev-i name) ;; and find the associated level (dotimes (lev-i LEVEL_TOTAL) (let ((lev (-> *level* level lev-i))) (when (!= (-> lev status) 'inactive) - (when (= (-> lev name) (-> obj want want-lev-i name)) + (when (= (-> lev name) (-> this want want-lev-i name)) ;; change in display: - (when (!= (-> lev display?) (-> obj want want-lev-i display?)) + (when (!= (-> lev display?) (-> this want want-lev-i display?)) (cond ((not (-> lev display?)) ;; off to on: (cond ((or (= (-> lev status) 'loaded) (= (-> lev status) 'active)) - (format 0 "Displaying level ~A [~A]~%" (-> obj want want-lev-i name) (-> obj want want-lev-i display?)) + (format 0 "Displaying level ~A [~A]~%" (-> this want want-lev-i name) (-> this want want-lev-i display?)) ;; will activate/birth, starting entities and background drawing. (level-get-for-use *level* (-> lev info name) 'active) - (set! (-> lev display?) (-> obj want want-lev-i display?)) + (set! (-> lev display?) (-> this want want-lev-i display?)) ) (else ;; but the level isn't ready! trip jak (unless we have display-no-wait.) - (if (and (-> lev info wait-for-load) (!= (-> obj want want-lev-i display?) 'display-no-wait)) + (if (and (-> lev info wait-for-load) (!= (-> this want want-lev-i display?) 'display-no-wait)) (send-event *target* 'loading) ) (if (= *cheat-mode* 'debug) - (format *stdcon* "display on for ~A but level is loading~%" (-> obj want want-lev-i name)) + (format *stdcon* "display on for ~A but level is loading~%" (-> this want want-lev-i name)) ) ) ) ) - ((not (-> obj want want-lev-i display?)) ;; on -> off. + ((not (-> this want want-lev-i display?)) ;; on -> off. (set! (-> lev display?) #f) (format 0 "Turning level ~A off~%" (-> lev name)) (deactivate lev) @@ -2560,31 +2560,31 @@ into 7 sections, which might explain the weird sizes in the center. (else ;; other change (special, etc) (format 0 "Setting level ~A display command to ~A~%" - (-> obj want want-lev-i name) - (-> obj want want-lev-i display?) + (-> this want want-lev-i name) + (-> this want want-lev-i display?) ) - (set! (-> lev display?) (-> obj want want-lev-i display?)) + (set! (-> lev display?) (-> this want want-lev-i display?)) ) ) ) ;; update force-all-visible - (when (!= (-> lev force-all-visible?) (-> obj want want-lev-i force-vis?)) - (set! (-> lev force-all-visible?) (-> obj want want-lev-i force-vis?)) + (when (!= (-> lev force-all-visible?) (-> this want want-lev-i force-vis?)) + (set! (-> lev force-all-visible?) (-> this want want-lev-i force-vis?)) (format 0 "Setting force-all-visible?[~A] to ~A~%" - (-> obj want want-lev-i name) - (-> obj want want-lev-i force-vis?) + (-> this want want-lev-i name) + (-> this want want-lev-i force-vis?) ) ) ;; update force-inside - (when (!= (-> lev force-inside?) (-> obj want want-lev-i force-inside?)) + (when (!= (-> lev force-inside?) (-> this want want-lev-i force-inside?)) (format 0 "Setting force-inside?[~A] ~A->~A~%" - (-> obj want want-lev-i name) + (-> this want want-lev-i name) (-> lev force-inside?) - (-> obj want want-lev-i force-inside?) + (-> this want want-lev-i force-inside?) ) - (set! (-> lev force-inside?) (-> obj want want-lev-i force-inside?)) + (set! (-> lev force-inside?) (-> this want want-lev-i force-inside?)) ) ) ) @@ -2602,7 +2602,7 @@ into 7 sections, which might explain the weird sizes in the center. (when (= (-> a2-32 status) 'active) ;; take any level that we're inside of, and has continue points (when (and (-> a2-32 inside-boxes) (not (null? (-> a2-32 info continues)))) - (if (= (-> a2-32 name) (-> obj vis-nick)) + (if (= (-> a2-32 name) (-> this vis-nick)) (goto cfg-125) ) (set! lev-for-vis a2-32) @@ -2611,8 +2611,8 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ) - (if (and (>= num-vis-levs 1) (!= (-> lev-for-vis name) (-> obj vis-nick))) - (want-vis-level obj (-> lev-for-vis name)) + (if (and (>= num-vis-levs 1) (!= (-> lev-for-vis name) (-> this vis-nick))) + (want-vis-level this (-> lev-for-vis name)) ) ) (label cfg-125) @@ -2625,20 +2625,20 @@ into 7 sections, which might explain the weird sizes in the center. ;; the draw-level array of level-group stores levels in the order they should be drawn. ;; eg: level3 of the DMA bucket array is actually (-> *level* draw-level 3), not (-> *level* level 3). -(defmethod assign-draw-indices level-group ((obj level-group)) +(defmethod assign-draw-indices level-group ((this level-group)) "Sort the levels by draw priority." (local-vars (t0-3 symbol)) - (set! (-> obj draw-level-count) 0) + (set! (-> this draw-level-count) 0) (dotimes (v1-0 LEVEL_TOTAL) (let ((f0-0 100000.0) (a1-1 (the-as level #f)) ) - (dotimes (a2-0 (-> obj length)) - (let ((a3-3 (-> obj level a2-0))) + (dotimes (a2-0 (-> this length)) + (let ((a3-3 (-> this level a2-0))) (when (= (-> a3-3 status) 'active) (set! t0-3 (and (< (-> a3-3 draw-priority) f0-0) (begin - (dotimes (t0-4 (-> obj draw-level-count)) - (when (= a3-3 (-> obj draw-level t0-4)) + (dotimes (t0-4 (-> this draw-level-count)) + (when (= a3-3 (-> this draw-level t0-4)) (set! t0-3 #f) (goto cfg-14) ) @@ -2656,22 +2656,22 @@ into 7 sections, which might explain the weird sizes in the center. ) ) (when a1-1 - (set! (-> obj draw-level (-> obj draw-level-count)) a1-1) - (set! (-> a1-1 draw-index) (-> obj draw-level-count)) - (+! (-> obj draw-level-count) 1) + (set! (-> this draw-level (-> this draw-level-count)) a1-1) + (set! (-> a1-1 draw-index) (-> this draw-level-count)) + (+! (-> this draw-level-count) 1) ) ) ) - (while (< (-> obj draw-level-count) LEVEL_TOTAL) - (set! (-> obj draw-level (-> obj draw-level-count)) #f) - (+! (-> obj draw-level-count) 1) + (while (< (-> this draw-level-count) LEVEL_TOTAL) + (set! (-> this draw-level (-> this draw-level-count)) #f) + (+! (-> this draw-level-count) 1) ) - (set! (-> obj draw-level LEVEL_MAX) (-> obj default-level)) - (set! (-> (&-> obj default-level draw-index) 0) LEVEL_MAX) + (set! (-> this draw-level LEVEL_MAX) (-> this default-level)) + (set! (-> (&-> this default-level draw-index) 0) LEVEL_MAX) (dotimes (v1-12 LEVEL_TOTAL) - (let ((a2-9 (-> obj level v1-12))) + (let ((a2-9 (-> this level v1-12))) (if a2-9 - (set! (-> obj draw-index-map v1-12) (the-as uint (-> a2-9 draw-index))) + (set! (-> this draw-index-map v1-12) (the-as uint (-> a2-9 draw-index))) ) ) ) @@ -2679,7 +2679,7 @@ into 7 sections, which might explain the weird sizes in the center. (none) ) -(defmethod level-update level-group ((obj level-group)) +(defmethod level-update level-group ((this level-group)) (local-vars (v1-101 symbol)) (camera-pos) @@ -2689,10 +2689,10 @@ into 7 sections, which might explain the weird sizes in the center. (update *art-control* #t) (clear-rec *art-control*) (dotimes (s5-0 LEVEL_MAX) - (load-continue (-> obj level s5-0)) + (load-continue (-> this level s5-0)) ) - (dotimes (s5-1 (-> obj length)) - (let ((s4-0 (-> obj level s5-1))) + (dotimes (s5-1 (-> this length)) + (let ((s4-0 (-> this level s5-1))) (when (= (-> s4-0 status) 'active) (set! (-> s4-0 inside-boxes) (inside-boxes-check s4-0 (-> *math-camera* trans))) (if (-> s4-0 inside-boxes) @@ -2703,12 +2703,12 @@ into 7 sections, which might explain the weird sizes in the center. ) (update! *load-state*) - (dotimes (s5-2 (-> obj length)) - (let ((s4-1 (-> obj level s5-2))) + (dotimes (s5-2 (-> this length)) + (let ((s4-1 (-> this level s5-2))) (when (= (-> s4-1 status) 'active) (when (-> s4-1 inside-boxes) - (dotimes (v1-40 (-> obj length)) - (let ((a0-13 (-> obj level v1-40))) + (dotimes (v1-40 (-> this length)) + (let ((a0-13 (-> this level v1-40))) (when (= (-> a0-13 status) 'active) (if (and (!= s4-1 a0-13) (not (-> a0-13 inside-boxes))) (set! (-> a0-13 meta-inside?) #f) @@ -2717,7 +2717,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ) - (when (and (null? (-> obj load-commands)) + (when (and (null? (-> this load-commands)) (= (-> s4-1 name) (-> *load-state* vis-nick)) (begin (set! (-> *setting-control* user-default music) (-> s4-1 info music-bank)) @@ -2764,8 +2764,8 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ) - (dotimes (v1-88 (-> obj length)) - (let ((a0-48 (-> obj level v1-88))) + (dotimes (v1-88 (-> this length)) + (let ((a0-48 (-> this level v1-88))) (when (= (-> a0-48 status) 'active) (set! (-> a0-48 vis-self-index) 0) 0 @@ -2773,8 +2773,8 @@ into 7 sections, which might explain the weird sizes in the center. ) ) (when (= *cheat-mode* 'debug) - (dotimes (s5-3 (-> obj length)) - (let ((v1-96 (-> obj level s5-3))) + (dotimes (s5-3 (-> this length)) + (let ((v1-96 (-> this level s5-3))) (when (= (-> v1-96 status) 'active) (if (and (= (-> v1-96 status) 'active) (!= (-> v1-96 display?) 'special) @@ -2787,7 +2787,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) (countdown (v1-100 LEVEL_MAX) - (when (-> obj level v1-100 inside-boxes) + (when (-> this level v1-100 inside-boxes) (set! v1-101 #f) (goto cfg-90) ) @@ -2799,8 +2799,8 @@ into 7 sections, which might explain the weird sizes in the center. 0 ) (else - (dotimes (s5-4 (-> obj length)) - (let ((s4-3 (-> obj level s5-4))) + (dotimes (s5-4 (-> this length)) + (let ((s4-3 (-> this level s5-4))) (when (= (-> s4-3 status) 'active) (dotimes (s3-1 8) (let ((s2-1 (-> s4-3 vis-info s3-1))) @@ -2811,7 +2811,7 @@ into 7 sections, which might explain the weird sizes in the center. (set! (-> s2-1 from-bsp) (-> s4-3 bsp)) ) (else - (let ((v1-114 (level-get obj (-> s2-1 from-level)))) + (let ((v1-114 (level-get this (-> s2-1 from-level)))) (set! (-> s2-1 from-bsp) (if v1-114 (-> v1-114 bsp) ) @@ -2845,7 +2845,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ) - (assign-draw-indices obj) + (assign-draw-indices this) (when (or *display-level-border* *display-texture-distances* *display-texture-download* *display-split-box-info*) (when *display-level-border* (format @@ -2876,7 +2876,7 @@ into 7 sections, which might explain the weird sizes in the center. ) ) (dotimes (s5-5 LEVEL_TOTAL) - (let ((s4-4 (-> obj level s5-5))) + (let ((s4-4 (-> this level s5-5))) (when (or (= (-> s4-4 status) 'active) (= (-> s4-4 status) 'reserved)) (let ((t9-19 format) (a0-90 *stdcon*) @@ -2926,12 +2926,12 @@ into 7 sections, which might explain the weird sizes in the center. ) ) ) - (when (and (-> obj disk-load-timing?) (-> obj load-level)) + (when (and (-> this disk-load-timing?) (-> this load-level)) (let ((s5-6 format) (s4-5 *stdcon*) (s3-2 "~0Kload ~16S ~5S ~5DK ~5,,2fs ~5,,2fs~1K ~5,,0f k/s~%") - (s2-2 (-> obj load-level)) - (v1-180 (lookup-level-info (-> obj load-level))) + (s2-2 (-> this load-level)) + (v1-180 (lookup-level-info (-> this load-level))) ) (s5-6 s4-5 @@ -2941,12 +2941,12 @@ into 7 sections, which might explain the weird sizes in the center. (-> v1-180 nickname) "" ) - (shr (-> obj load-size) 10) - (-> obj load-time) - (-> obj load-login-time) - (if (= (-> obj load-time) 0.0) + (shr (-> this load-size) 10) + (-> this load-time) + (-> this load-login-time) + (if (= (-> this load-time) 0.0) 0 - (* 0.0009765625 (/ (the float (-> obj load-size)) (-> obj load-time))) + (* 0.0009765625 (/ (the float (-> this load-size)) (-> this load-time))) ) ) ) @@ -2965,12 +2965,12 @@ into 7 sections, which might explain the weird sizes in the center. (set! (-> active-lev-names i) "none") (set! (-> lev-names i) "none") (cond - ((or (= (-> obj level i status) 'active) - (= (-> obj level i status) 'alive) - (= (-> obj level i status) 'loaded)) - (set! (-> lev-names i) (symbol->string (-> obj level i nickname))) - (if (-> obj level i display?) - (set! (-> active-lev-names i) (symbol->string (-> obj level i nickname)))) + ((or (= (-> this level i status) 'active) + (= (-> this level i status) 'alive) + (= (-> this level i status) 'loaded)) + (set! (-> lev-names i) (symbol->string (-> this level i nickname))) + (if (-> this level i display?) + (set! (-> active-lev-names i) (symbol->string (-> this level i nickname)))) ) ) ) diff --git a/goal_src/jak2/engine/level/region.gc b/goal_src/jak2/engine/level/region.gc index be053bf9cf..0b8aaeadfe 100644 --- a/goal_src/jak2/engine/level/region.gc +++ b/goal_src/jak2/engine/level/region.gc @@ -8,20 +8,20 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch int vs drawable-region-prim. -(defmethod mem-usage drawable-region-prim ((obj drawable-region-prim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-region-prim ((this drawable-region-prim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 50 (-> arg0 length))) (set! (-> arg0 data 49 name) "region") (+! (-> arg0 data 49 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 49 used) v1-6) (+! (-> arg0 data 49 total) (logand -16 (+ v1-6 15))) ) - (mem-usage (-> obj region) arg0 (logior arg1 128)) + (mem-usage (-> this region) arg0 (logior arg1 128)) (the-as drawable-region-prim 0) ) ;; WARN: Return type mismatch int vs drawable-inline-array-region-prim. -(defmethod mem-usage drawable-inline-array-region-prim ((obj drawable-inline-array-region-prim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-region-prim ((this drawable-inline-array-region-prim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -29,76 +29,76 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) (the-as drawable-inline-array-region-prim 0) ) -(defmethod draw drawable-tree-region-prim ((obj drawable-tree-region-prim) (arg0 drawable-tree-region-prim) (arg1 display-frame)) +(defmethod draw drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 drawable-tree-region-prim) (arg1 display-frame)) 0 (none) ) -(defmethod unpack-vis drawable-tree-region-prim ((obj drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) -(defmethod collect-regions drawable-region-prim ((obj drawable-region-prim) (area-of-interest sphere) (_count int) (region-list region-prim-list)) - "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count +(defmethod collect-regions drawable-region-prim ((this drawable-region-prim) (area-of-interest sphere) (_count int) (region-list region-prim-list)) + "Determines the number of [[drawable]]s in the `this` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @param! region-list Stores the overlapping regions and a count for how many were found @returns none" (dotimes (count _count) - (when (spheres-overlap? area-of-interest (the-as sphere (-> obj bsphere))) - (set! (-> region-list items (-> region-list num-items)) obj) + (when (spheres-overlap? area-of-interest (the-as sphere (-> this bsphere))) + (set! (-> region-list items (-> region-list num-items)) this) (+! (-> region-list num-items) 1) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) ) -(defmethod collect-regions drawable-inline-array-region-prim ((obj drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) - "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count +(defmethod collect-regions drawable-inline-array-region-prim ((this drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) + "Determines the number of [[drawable]]s in the `this` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @param! region-list Stores the overlapping regions and a count for how many were found @returns none" - (collect-regions (the-as drawable-region-prim (-> obj data)) arg0 (-> obj length) arg2) + (collect-regions (the-as drawable-region-prim (-> this data)) arg0 (-> this length) arg2) 0 (none) ) -(defmethod collect-regions drawable-tree-region-prim ((obj drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) - "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count +(defmethod collect-regions drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) + "Determines the number of [[drawable]]s in the `this` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @param! region-list Stores the overlapping regions and a count for how many were found @returns none" - (collect-regions (-> obj data2 0) arg0 (-> obj length) arg2) + (collect-regions (-> this data2 0) arg0 (-> this length) arg2) 0 (none) ) -(defmethod debug-draw-region drawable-region-prim ((obj drawable-region-prim) (arg0 int)) +(defmethod debug-draw-region drawable-region-prim ((this drawable-region-prim) (arg0 int)) (local-vars (sv-32 vector2h) (sv-36 vector)) (set! sv-32 (new 'stack 'vector2h)) - (set! sv-36 (-> obj bsphere)) + (set! sv-36 (-> this bsphere)) (add-debug-x #t (bucket-id debug-no-zbuf1) sv-36 (#if PC_PORT (if *debug-region-color-alt* (static-rgba #x00 #xff #x00 #x80) (new 'static 'rgba :r #xff :g #xff :a #x80)) (new 'static 'rgba :r #xff :g #xff :a #x80))) - (when (nonzero? (-> obj region)) + (when (nonzero? (-> this region)) (let ((s5-0 add-debug-text-3d) (s4-0 #t) (s3-0 (bucket-id debug-no-zbuf1)) ) - (format (clear *temp-string*) "region-~D~%" (-> obj region id)) + (format (clear *temp-string*) "region-~D~%" (-> this region id)) (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* sv-36 (font-color white) sv-32) ) (+! (-> sv-32 y) 8) - (let ((s5-1 (-> obj region on-enter))) + (let ((s5-1 (-> this region on-enter))) (when s5-1 (let ((s4-1 add-debug-text-3d) (s3-1 #t) @@ -110,7 +110,7 @@ (+! (-> sv-32 y) 8) ) ) - (let ((s5-2 (-> obj region on-inside))) + (let ((s5-2 (-> this region on-inside))) (when s5-2 (let ((s4-2 add-debug-text-3d) (s3-2 #t) @@ -122,7 +122,7 @@ (+! (-> sv-32 y) 8) ) ) - (let ((gp-1 (-> obj region on-exit))) + (let ((gp-1 (-> this region on-exit))) (when gp-1 (let ((s5-3 add-debug-text-3d) (s4-3 #t) @@ -139,126 +139,126 @@ (none) ) -(defmethod track-region drawable-region-prim ((obj drawable-region-prim) (arg0 region-prim-area)) +(defmethod track-region drawable-region-prim ((this drawable-region-prim) (arg0 region-prim-area)) "TODO" #f ) -(defmethod within-area? drawable-region-prim ((obj drawable-region-prim) (arg0 region-prim-area)) +(defmethod within-area? drawable-region-prim ((this drawable-region-prim) (arg0 region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" #f ) ;; WARN: Function (method 9 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-entered-region! region-prim-area ((obj region-prim-area) (region-sphere drawable-region-sphere)) +(defmethod track-entered-region! region-prim-area ((this region-prim-area) (region-sphere drawable-region-sphere)) "Enumerates through the objects `region-enter-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and increment `region-enter-count` @param region-sphere Defines the region in question @returns nothing" - (let ((regions-entered (-> obj region-enter-count))) + (let ((regions-entered (-> this region-enter-count))) (let ((region (-> region-sphere region))) (countdown (idx regions-entered) - (if (= (-> obj region-enter-list idx) region) + (if (= (-> this region-enter-list idx) region) (return #f) ) ) - (set! (-> obj region-enter-list regions-entered) region) + (set! (-> this region-enter-list regions-entered) region) ) - (set! (-> obj region-enter-prim-list regions-entered) region-sphere) - (set! (-> obj region-enter-count) (+ regions-entered 1)) + (set! (-> this region-enter-prim-list regions-entered) region-sphere) + (set! (-> this region-enter-count) (+ regions-entered 1)) ) 0 (none) ) ;; WARN: Function (method 10 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-exited-region! region-prim-area ((obj region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-exited-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-exit-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and increment `region-exit-count` @param region-sphere Defines the region in question @returns nothing" - (let ((regions-exited (-> obj region-exit-count))) + (let ((regions-exited (-> this region-exit-count))) (let ((region (-> arg0 region))) (countdown (idx regions-exited) - (if (= (-> obj region-exit-list idx) region) + (if (= (-> this region-exit-list idx) region) (return #f) ) ) - (set! (-> obj region-exit-list regions-exited) region) + (set! (-> this region-exit-list regions-exited) region) ) - (set! (-> obj region-exit-prim-list regions-exited) arg0) - (set! (-> obj region-exit-count) (+ regions-exited 1)) + (set! (-> this region-exit-prim-list regions-exited) arg0) + (set! (-> this region-exit-count) (+ regions-exited 1)) ) 0 (none) ) ;; WARN: Function (method 11 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-inside-region! region-prim-area ((obj region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-inside-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-inside-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and increment `region-inside-count` @param region-sphere Defines the region in question @returns nothing" - (let ((regions-inside (-> obj region-inside-count))) + (let ((regions-inside (-> this region-inside-count))) (let ((region (-> arg0 region))) (countdown (idx regions-inside) - (if (= (-> obj region-inside-list idx) region) + (if (= (-> this region-inside-list idx) region) (return #f) ) ) - (set! (-> obj region-inside-list regions-inside) region) + (set! (-> this region-inside-list regions-inside) region) ) - (set! (-> obj region-inside-prim-list regions-inside) arg0) - (set! (-> obj region-inside-count) (+ regions-inside 1)) + (set! (-> this region-inside-prim-list regions-inside) arg0) + (set! (-> this region-inside-count) (+ regions-inside 1)) ) 0 (none) ) ;; WARN: Function (method 12 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-start-region! region-prim-area ((obj region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-start-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-start-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and increment `region-start-count` @param region-sphere Defines the region in question @returns nothing" - (let ((regions-started (-> obj region-start-count))) + (let ((regions-started (-> this region-start-count))) (let ((region (-> arg0 region))) (countdown (idx regions-started) - (if (= (-> obj region-start-list idx) region) + (if (= (-> this region-start-list idx) region) (return #f) ) ) - (set! (-> obj region-start-list regions-started) region) + (set! (-> this region-start-list regions-started) region) ) - (set! (-> obj region-start-prim-list regions-started) arg0) - (set! (-> obj region-start-count) (+ regions-started 1)) + (set! (-> this region-start-prim-list regions-started) arg0) + (set! (-> this region-start-count) (+ regions-started 1)) ) 0 (none) ) -(defmethod debug-draw-region drawable-region-sphere ((obj drawable-region-sphere) (arg0 int)) +(defmethod debug-draw-region drawable-region-sphere ((this drawable-region-sphere) (arg0 int)) (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (let ((a2-0 (-> obj bsphere))) - (add-debug-sphere #t (bucket-id debug2) a2-0 (-> obj bsphere w) (#if PC_PORT (if *debug-region-color-alt* (static-rgba #xff #x00 #xff #x80) (new 'static 'rgba :r #xff :a #x80)) + (let ((a2-0 (-> this bsphere))) + (add-debug-sphere #t (bucket-id debug2) a2-0 (-> this bsphere w) (#if PC_PORT (if *debug-region-color-alt* (static-rgba #xff #x00 #xff #x80) (new 'static 'rgba :r #xff :a #x80)) (new 'static 'rgba :r #xff :a #x80))) ) 0 (none) ) -(defmethod track-region drawable-region-sphere ((obj drawable-region-sphere) (area region-prim-area)) +(defmethod track-region drawable-region-sphere ((this drawable-region-sphere) (area region-prim-area)) "TODO" - (-> obj region) - (let ((area-of-interest (-> obj bsphere))) + (-> this region) + (let ((area-of-interest (-> this bsphere))) (if (< 0.0 (ray-sphere-intersect (-> area pos) (-> area ray) area-of-interest (-> area-of-interest w))) - (track-entered-region! area obj) + (track-entered-region! area this) ) (if (< 0.0 (ray-sphere-intersect (-> area unknown-vector-uiyb1) @@ -267,62 +267,62 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (-> area-of-interest w) ) ) - (track-exited-region! area obj) + (track-exited-region! area this) ) (if (spheres-overlap? (the-as sphere (-> area pos)) (the-as sphere area-of-interest)) - (track-start-region! area obj) + (track-start-region! area this) ) (when (spheres-overlap? (the-as sphere (-> area unknown-vector-uiyb1)) (the-as sphere area-of-interest)) - (track-inside-region! area obj) + (track-inside-region! area this) #t ) ) ) -(defmethod within-area? drawable-region-sphere ((obj drawable-region-sphere) (area region-prim-area)) +(defmethod within-area? drawable-region-sphere ((this drawable-region-sphere) (area region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" - (spheres-overlap? (the-as sphere (-> area pos)) (the-as sphere (-> obj bsphere))) + (spheres-overlap? (the-as sphere (-> area pos)) (the-as sphere (-> this bsphere))) ) -(defmethod debug-draw-region drawable-region-face ((obj drawable-region-face) (arg0 int)) +(defmethod debug-draw-region drawable-region-face ((this drawable-region-face) (arg0 int)) (when (zero? arg0) (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) - (t9-0 obj arg0) + (t9-0 this arg0) ) ) (#cond (PC_PORT (when *debug-region-show-bsphere* - (let ((s5-0 (-> obj bsphere))) + (let ((s5-0 (-> this bsphere))) (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-0 - (-> obj data normal) + (-> this data normal) (meters 2) (new 'static 'rgba :r #xff :g #xff :a #x80) ) - (add-debug-sphere #t (bucket-id debug2) s5-0 (-> obj bsphere w) (new 'static 'rgba :r #xff :a #x30)) + (add-debug-sphere #t (bucket-id debug2) s5-0 (-> this bsphere w) (new 'static 'rgba :r #xff :a #x30)) ) ) ) (#t - (let ((s5-0 (-> obj bsphere))) + (let ((s5-0 (-> this bsphere))) (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-0 - (-> obj data normal) + (-> this data normal) (meters 2) (new 'static 'rgba :r #xff :g #xff :a #x80) ) - (add-debug-sphere #t (bucket-id debug2) s5-0 (-> obj bsphere w) (new 'static 'rgba :r #xff :a #x30)) + (add-debug-sphere #t (bucket-id debug2) s5-0 (-> this bsphere w) (new 'static 'rgba :r #xff :a #x30)) ) )) (add-debug-bound (bucket-id debug2) - (-> obj data points) - (the-as int (-> obj data num-points)) + (-> this data points) + (the-as int (-> this data num-points)) ;; tone down the opacity of the boundary so you aren't blinded / can actually stand a chance at reading the text (#if PC_PORT (if *debug-region-color-alt* @@ -340,11 +340,11 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (none) ) -(defmethod track-region drawable-region-face ((obj drawable-region-face) (arg0 region-prim-area)) +(defmethod track-region drawable-region-face ((this drawable-region-face) (arg0 region-prim-area)) "TODO" (local-vars (sv-48 vector) (sv-52 vector) (sv-56 object)) - (-> obj region) - (let* ((s4-0 (-> obj data)) + (-> this region) + (let* ((s4-0 (-> this data)) (v1-1 (-> s4-0 normal)) (a0-3 (>= 0.0 (- (vector-dot (-> arg0 pos) v1-1) (-> v1-1 w)))) (s3-0 (>= 0.0 (- (vector-dot (-> arg0 unknown-vector-uiyb1) v1-1) (-> v1-1 w)))) @@ -398,8 +398,8 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) (label cfg-17) (if s3-0 - (track-entered-region! arg0 (the-as drawable-region-sphere obj)) - (track-exited-region! arg0 (the-as drawable-region-sphere obj)) + (track-entered-region! arg0 (the-as drawable-region-sphere this)) + (track-exited-region! arg0 (the-as drawable-region-sphere this)) ) ) (label cfg-20) @@ -407,50 +407,50 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ) -(defmethod debug-draw-region drawable-region-volume ((obj drawable-region-volume) (arg0 int)) +(defmethod debug-draw-region drawable-region-volume ((this drawable-region-volume) (arg0 int)) (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (let* ((s5-0 (-> obj faces length)) + (let* ((s5-0 (-> this faces length)) (s4-0 0) - (a0-3 (-> obj faces data s4-0)) + (a0-3 (-> this faces data s4-0)) ) (while (< s4-0 s5-0) (debug-draw-region a0-3 1) (+! s4-0 1) - (set! a0-3 (-> obj faces data s4-0)) + (set! a0-3 (-> this faces data s4-0)) ) ) 0 (none) ) -(defmethod track-region drawable-region-volume ((obj drawable-region-volume) (area region-prim-area)) +(defmethod track-region drawable-region-volume ((this drawable-region-volume) (area region-prim-area)) "TODO" - (if (within-area? obj area) - (track-start-region! area (the-as drawable-region-sphere obj)) + (if (within-area? this area) + (track-start-region! area (the-as drawable-region-sphere this)) ) - (let* ((s4-0 (-> obj faces length)) + (let* ((s4-0 (-> this faces length)) (s3-0 0) - (a0-4 (-> obj faces data s3-0)) + (a0-4 (-> this faces data s3-0)) ) (while (< s3-0 s4-0) (if (not (track-region a0-4 area)) (return #f) ) (+! s3-0 1) - (set! a0-4 (-> obj faces data s3-0)) + (set! a0-4 (-> this faces data s3-0)) ) ) - (track-inside-region! area (the-as drawable-region-sphere obj)) + (track-inside-region! area (the-as drawable-region-sphere this)) #t ) -(defmethod within-area? drawable-region-volume ((obj drawable-region-volume) (arg0 region-prim-area)) +(defmethod within-area? drawable-region-volume ((this drawable-region-volume) (arg0 region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" - (let* ((v1-1 (-> obj faces length)) + (let* ((v1-1 (-> this faces length)) (a2-0 0) - (a3-2 (-> obj faces data a2-0)) + (a3-2 (-> this faces data a2-0)) ) (while (< a2-0 v1-1) (let ((a3-4 (-> a3-2 data normal))) @@ -459,31 +459,31 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ) (+! a2-0 1) - (set! a3-2 (-> obj faces data a2-0)) + (set! a3-2 (-> this faces data a2-0)) ) ) #t ) -(defmethod drawable-tree-region-prim-method-17 drawable-tree-region-prim ((obj drawable-tree-region-prim) (arg0 vector)) +(defmethod drawable-tree-region-prim-method-17 drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 vector)) (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area (scratchpad-object region-prim-area)) pos)) arg0 0.0) - (let* ((s5-0 (-> obj data2 (+ (-> obj length) -1) length)) + (let* ((s5-0 (-> this data2 (+ (-> this length) -1) length)) (s4-0 0) - (a0-8 (the-as object (+ (+ (* s4-0 32) 32) (the-as int (-> obj data2 (+ (-> obj length) -1)))))) + (a0-8 (the-as object (+ (+ (* s4-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1)))))) ) (while (< s4-0 s5-0) (if (within-area? (the-as drawable-region-prim a0-8) (scratchpad-object region-prim-area)) (return #t) ) (+! s4-0 1) - (set! a0-8 (+ (+ (* s4-0 32) 32) (the-as int (-> obj data2 (+ (-> obj length) -1))))) + (set! a0-8 (+ (+ (* s4-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1))))) ) ) #f ) ;; WARN: Return type mismatch int vs symbol. -(defmethod region-method-9 region ((obj region) (arg0 vector)) +(defmethod region-method-9 region ((this region) (arg0 vector)) (local-vars (sv-16 int) (sv-32 int)) (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area (scratchpad-object region-prim-area)) pos)) arg0 0.0) (dotimes (s5-0 (-> *level* length)) @@ -499,7 +499,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (set! sv-16 0) (set! sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1))))) (while (< sv-16 s0-0) - (if (and (= (-> (the-as drawable-region-prim sv-32) region) obj) + (if (and (= (-> (the-as drawable-region-prim sv-32) region) this) (within-area? (the-as drawable-region-prim sv-32) (the-as region-prim-area (-> (the-as region-prim-area (scratchpad-object region-prim-area)) region-prim-list)) @@ -522,11 +522,11 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (the-as symbol #f) ) -(defmethod debug-print drawable-tree-region-prim ((obj drawable-tree-region-prim) (arg0 vector) (arg1 object)) +(defmethod debug-print drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 vector) (arg1 object)) (sphere<-vector+r! (the-as sphere (-> (scratchpad-object region-prim-area) pos)) arg0 0.0) - (let* ((s4-0 (-> obj data2 (+ (-> obj length) -1) length)) + (let* ((s4-0 (-> this data2 (+ (-> this length) -1) length)) (s3-0 0) - (s2-0 (the-as object (+ (+ (* s3-0 32) 32) (the-as int (-> obj data2 (+ (-> obj length) -1)))))) + (s2-0 (the-as object (+ (+ (* s3-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1)))))) ) (while (< s3-0 s4-0) (if (within-area? (the-as drawable-region-prim s2-0) (scratchpad-object region-prim-area)) @@ -538,7 +538,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ) (+! s3-0 1) - (set! s2-0 (+ (+ (* s3-0 32) 32) (the-as int (-> obj data2 (+ (-> obj length) -1))))) + (set! s2-0 (+ (+ (* s3-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1))))) ) ) 0 diff --git a/goal_src/jak2/engine/load/decomp-h.gc b/goal_src/jak2/engine/load/decomp-h.gc index 7aa7d6b309..1710d346a1 100644 --- a/goal_src/jak2/engine/load/decomp-h.gc +++ b/goal_src/jak2/engine/load/decomp-h.gc @@ -20,4 +20,4 @@ :method-count-assert 9 :size-assert #x3000 :flag-assert #x900003000 - ) \ No newline at end of file + ) diff --git a/goal_src/jak2/engine/load/decomp.gc b/goal_src/jak2/engine/load/decomp.gc index 83619c30fe..0c89100f25 100644 --- a/goal_src/jak2/engine/load/decomp.gc +++ b/goal_src/jak2/engine/load/decomp.gc @@ -257,7 +257,7 @@ It's not super clear to me why they ditched this system. Maybe the visibility da ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 138] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 145] -(defmethod update-vis! level ((obj level) (vis-info level-vis-info) (unused uint) (in-bsp-vis-string (pointer uint8))) +(defmethod update-vis! level ((this level) (vis-info level-vis-info) (unused uint) (in-bsp-vis-string (pointer uint8))) (local-vars (t0-3 uint128) (extra-vis-length int) (extra-vis-dest (pointer int8))) (let* ((cam-leaf-idx (-> vis-info from-bsp current-leaf-idx)) (curr-vis-string-offset (-> vis-info current-vis-string)) @@ -272,7 +272,7 @@ It's not super clear to me why they ditched this system. Maybe the visibility da (return #f) ) (logclear! (-> vis-info flags) (vis-info-flag loading)) - (let ((vis-buf (the-as (pointer integer) (-> obj vis-buffer)))) + (let ((vis-buf (the-as (pointer integer) (-> this vis-buffer)))) (b! #t cfg-16 :delay (nop!)) (label cfg-6) (return #t) @@ -288,7 +288,7 @@ It's not super clear to me why they ditched this system. Maybe the visibility da (set! vis-buf (&+ in-bsp-vis-string desired-vis-string-offset)) (b! #t cfg-16 :delay (nop!)) (label cfg-15) - (format 0 "ERROR: ramdisk vis for level ~A, this is not supported~%" (-> obj name)) + (format 0 "ERROR: ramdisk vis for level ~A, this is not supported~%" (-> this name)) (let ((v0-1 #f)) (b! #t cfg-49 :delay (nop!)) (label cfg-16) @@ -329,7 +329,7 @@ It's not super clear to me why they ditched this system. Maybe the visibility da ) (spad-start (&-> (the-as (pointer int8) *fake-scratchpad-data*) 0)) (spad-end (the-as (pointer int8) (&+ *fake-scratchpad-data* 2048))) - (list-len (-> obj bsp visible-list-length)) + (list-len (-> this bsp visible-list-length)) ) (when (zero? (the-as vis-info-flag lower-flag-bits)) (let ((qwc (/ (+ list-len 15) 16))) @@ -348,9 +348,9 @@ It's not super clear to me why they ditched this system. Maybe the visibility da (set! (-> (the-as (pointer int128) (&+ spad-start (* a0-23 16)))) (the int128 0)) ) ) - (set! extra-vis-length (-> obj bsp extra-vis-list-length)) + (set! extra-vis-length (-> this bsp extra-vis-list-length)) (set! extra-vis-dest (&+ spad-start (- list-len extra-vis-length))) - (let ((extra-vis-in (unpack-vis (-> obj bsp drawable-trees) spad-start (the-as (pointer int8) vis-buf)))) + (let ((extra-vis-in (unpack-vis (-> this bsp drawable-trees) spad-start (the-as (pointer int8) vis-buf)))) (dotimes (extra-vis-idx extra-vis-length) (let ((vis-byte (-> extra-vis-in 0))) (set! extra-vis-in (&-> extra-vis-in 1)) @@ -383,7 +383,7 @@ It's not super clear to me why they ditched this system. Maybe the visibility da (shift-arith-right-32 lower-flag-bits lower-flag-bits 3) ) (let ((vis-ptr (the-as (pointer uint8) vis-buf)) - (all-vis-ptr (the-as (pointer uinteger) (-> obj bsp all-visible-list))) + (all-vis-ptr (the-as (pointer uinteger) (-> this bsp all-visible-list))) (vis-error #f) ) (dotimes (s0-1 list-len) @@ -415,7 +415,7 @@ It's not super clear to me why they ditched this system. Maybe the visibility da ) (let ((unpacked-vis-ptr vis-buf) (final-vis-ptr (the-as object (-> vis-info vis-bits))) - (all-vis (the-as (pointer uinteger) (-> obj bsp all-visible-list))) + (all-vis (the-as (pointer uinteger) (-> this bsp all-visible-list))) (vis-qwc (/ (+ list-len 15) 16)) ) (dotimes (a3-6 vis-qwc) diff --git a/goal_src/jak2/engine/load/file-io.gc b/goal_src/jak2/engine/load/file-io.gc index 69a465aca2..59f8c30b0d 100644 --- a/goal_src/jak2/engine/load/file-io.gc +++ b/goal_src/jak2/engine/load/file-io.gc @@ -83,18 +83,18 @@ NOTE: this is a special type in three ways: ) -(defmethod print file-info ((obj file-info)) +(defmethod print file-info ((this file-info)) "Print information about a file" (format #t "#<~A ~A :version ~D.~D @ #x~X>" - (-> obj type) - (-> obj file-name) - (-> obj major-version) - (-> obj minor-version) - obj + (-> this type) + (-> this file-name) + (-> this major-version) + (-> this minor-version) + this ) - obj + this ) (define *file-temp-string* (new 'global 'string 128 (the-as string #f))) diff --git a/goal_src/jak2/engine/load/load-dgo.gc b/goal_src/jak2/engine/load/load-dgo.gc index 740cb8e3f4..9dd835568e 100644 --- a/goal_src/jak2/engine/load/load-dgo.gc +++ b/goal_src/jak2/engine/load/load-dgo.gc @@ -32,6 +32,7 @@ :flag-assert #x900000020 ) + (deftype load-chunk-msg (structure) ((rsvd uint16 :offset-assert 0) (result load-msg-result :offset-assert 2) @@ -46,6 +47,7 @@ :flag-assert #x900000050 ) + (deftype play-chunk-msg (structure) ((rsvd uint16 :offset-assert 0) (result uint16 :offset-assert 2) @@ -60,6 +62,7 @@ :flag-assert #x9000000e0 ) + (deftype dgo-header (structure) ((length uint32 :offset-assert 0) (rootname uint8 60 :offset-assert 4) @@ -355,7 +358,6 @@ ) ) - (defun destroy-mem ((arg0 (pointer uint32)) (arg1 (pointer uint32))) (while (< (the-as int arg0) (the-as int arg1)) (set! (-> arg0 0) (the-as uint #xffffffff)) @@ -364,7 +366,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak2/engine/load/load-state.gc b/goal_src/jak2/engine/load/load-state.gc index cac9fe8310..fe95c385a5 100644 --- a/goal_src/jak2/engine/load/load-state.gc +++ b/goal_src/jak2/engine/load/load-state.gc @@ -10,82 +10,82 @@ ;; DECOMP BEGINS -(defmethod print level-buffer-state ((obj level-buffer-state)) +(defmethod print level-buffer-state ((this level-buffer-state)) (format #t "#" - (-> obj name) - (-> obj display?) - (-> obj force-vis?) - (-> obj force-inside?) - obj + (-> this name) + (-> this display?) + (-> this force-vis?) + (-> this force-inside?) + this ) - obj + this ) -(defmethod reset! load-state ((obj load-state)) +(defmethod reset! load-state ((this load-state)) (dotimes (v1-0 (-> *level* length)) - (set! (-> obj want v1-0 name) #f) - (set! (-> obj want v1-0 display?) #f) - (set! (-> obj want v1-0 force-vis?) #f) - (set! (-> obj want v1-0 force-inside?) #f) + (set! (-> this want v1-0 name) #f) + (set! (-> this want v1-0 display?) #f) + (set! (-> this want v1-0 force-vis?) #f) + (set! (-> this want v1-0 force-inside?) #f) ) (dotimes (v1-3 3) - (set! (-> obj want-sound v1-3) #f) + (set! (-> this want-sound v1-3) #f) ) - (set! (-> obj command-list) '()) + (set! (-> this command-list) '()) (dotimes (v1-7 256) - (set! (-> obj object-name v1-7) #f) - (set! (-> obj object-status v1-7) (the-as basic 0)) + (set! (-> this object-name v1-7) #f) + (set! (-> this object-status v1-7) (the-as basic 0)) ) - obj + this ) -(defmethod want-levels load-state ((obj load-state) (arg0 (pointer symbol))) +(defmethod want-levels load-state ((this load-state) (arg0 (pointer symbol))) (dotimes (v1-0 LEVEL_MAX) (dotimes (a2-0 6) - (when (= (-> obj want v1-0 name) (-> arg0 a2-0)) + (when (= (-> this want v1-0 name) (-> arg0 a2-0)) (set! (-> arg0 a2-0) #f) (goto cfg-8) ) ) - (set! (-> obj want v1-0 name) #f) + (set! (-> this want v1-0 name) #f) (label cfg-8) ) (dotimes (v1-3 6) (when (-> arg0 v1-3) (dotimes (a2-13 LEVEL_MAX) - (when (not (-> obj want a2-13 name)) - (set! (-> obj want a2-13 name) (-> arg0 v1-3)) - (set! (-> obj want a2-13 display?) #f) - (set! (-> obj want a2-13 force-vis?) #f) - (set! (-> obj want a2-13 force-inside?) #f) + (when (not (-> this want a2-13 name)) + (set! (-> this want a2-13 name) (-> arg0 v1-3)) + (set! (-> this want a2-13 display?) #f) + (set! (-> this want a2-13 force-vis?) #f) + (set! (-> this want a2-13 force-inside?) #f) (goto cfg-19) ) ) ) (label cfg-19) ) - (add-borrow-levels obj) + (add-borrow-levels this) 0 ) -(defmethod want-sound-banks load-state ((obj load-state) (arg0 (pointer symbol))) +(defmethod want-sound-banks load-state ((this load-state) (arg0 (pointer symbol))) (dotimes (v1-0 3) (dotimes (a2-0 3) - (when (= (-> obj want-sound v1-0) (-> arg0 a2-0)) + (when (= (-> this want-sound v1-0) (-> arg0 a2-0)) (set! (-> arg0 a2-0) #f) (goto cfg-8) ) ) - (set! (-> obj want-sound v1-0) #f) + (set! (-> this want-sound v1-0) #f) (label cfg-8) ) (dotimes (v1-3 3) (when (-> arg0 v1-3) (dotimes (a2-13 3) - (when (not (-> obj want-sound a2-13)) - (set! (-> obj want-sound a2-13) (-> arg0 v1-3)) + (when (not (-> this want-sound a2-13)) + (set! (-> this want-sound a2-13) (-> arg0 v1-3)) (goto cfg-19) ) ) @@ -96,11 +96,11 @@ (none) ) -(defmethod want-display-level load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-display-level load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 LEVEL_MAX) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 display?) arg1) - (add-borrow-levels obj) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 display?) arg1) + (add-borrow-levels this) (return 0) ) ) @@ -110,21 +110,21 @@ 0 ) -(defmethod want-vis-level load-state ((obj load-state) (arg0 symbol)) +(defmethod want-vis-level load-state ((this load-state) (arg0 symbol)) (let ((v1-0 (lookup-level-info arg0))) (if v1-0 (set! arg0 (-> v1-0 name)) ) ) - (set! (-> obj vis-nick) arg0) + (set! (-> this vis-nick) arg0) 0 (none) ) -(defmethod want-force-vis load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-vis load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 LEVEL_MAX) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 force-vis?) arg1) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 force-vis?) arg1) (return 0) ) ) @@ -133,10 +133,10 @@ ) ;; WARN: Function (method 16 load-state) has a return type of none, but the expression builder found a return statement. -(defmethod want-force-inside load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-inside load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 LEVEL_MAX) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 force-inside?) arg1) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 force-inside?) arg1) (return 0) ) ) @@ -145,20 +145,20 @@ (none) ) -(defmethod add-borrow-levels load-state ((obj load-state)) +(defmethod add-borrow-levels load-state ((this load-state)) "Update the load state so it includes the 'borrow' levels associated with the desired levels. This will also remove borrow levels that are no longer needed." ;; remove borrow levels (dotimes (s5-0 LEVEL_MAX) - (let ((a0-1 (-> obj want s5-0 name))) + (let ((a0-1 (-> this want s5-0 name))) (when a0-1 (let ((a0-2 (lookup-level-info a0-1))) (when (= (-> a0-2 memory-mode) (load-buffer-mode borrow)) - (set! (-> obj want s5-0 name) #f) - (set! (-> obj want s5-0 display?) #f) - (set! (-> obj want s5-0 force-vis?) #f) - (set! (-> obj want s5-0 force-inside?) #f) + (set! (-> this want s5-0 name) #f) + (set! (-> this want s5-0 display?) #f) + (set! (-> this want s5-0 force-vis?) #f) + (set! (-> this want s5-0 force-inside?) #f) ) ) ) @@ -171,20 +171,20 @@ (used-slots 0)) ; (set! (-> s5-1 length) 0) (dotimes (s4-0 LEVEL_MAX) - (let ((a0-5 (-> obj want s4-0 name))) + (let ((a0-5 (-> this want s4-0 name))) ;; add level from the want state (when a0-5 (set! (-> symbol-array used-slots) a0-5) - (set! (-> symbol-array (+ used-slots 1)) (-> obj want s4-0 display?)) - (set! (-> symbol-array (+ used-slots 2)) (-> obj want s4-0 force-vis?)) - (set! (-> symbol-array (+ used-slots 3)) (-> obj want s4-0 force-inside?)) + (set! (-> symbol-array (+ used-slots 1)) (-> this want s4-0 display?)) + (set! (-> symbol-array (+ used-slots 2)) (-> this want s4-0 force-vis?)) + (set! (-> symbol-array (+ used-slots 3)) (-> this want s4-0 force-inside?)) (+! used-slots 4) ;; and add borrows. (let ((v1-34 (lookup-level-info a0-5))) (countdown (a0-6 2) (when (and (-> v1-34 borrow-level a0-6) (< used-slots 24)) (set! (-> symbol-array used-slots) (-> v1-34 borrow-level a0-6)) - (set! (-> symbol-array (+ used-slots 1)) (if (-> obj want s4-0 display?) + (set! (-> symbol-array (+ used-slots 1)) (if (-> this want s4-0 display?) (-> v1-34 borrow-display? a0-6) ) ) @@ -201,16 +201,16 @@ (dotimes (v1-39 LEVEL_MAX) (cond ((< (* v1-39 4) used-slots) - (set! (-> obj want v1-39 name) (-> symbol-array (* v1-39 4))) - (set! (-> obj want v1-39 display?) (-> symbol-array (+ (* v1-39 4) 1))) - (set! (-> obj want v1-39 force-vis?) (-> symbol-array (+ (* v1-39 4) 2))) - (set! (-> obj want v1-39 force-inside?) (-> symbol-array (+ (* v1-39 4) 3))) + (set! (-> this want v1-39 name) (-> symbol-array (* v1-39 4))) + (set! (-> this want v1-39 display?) (-> symbol-array (+ (* v1-39 4) 1))) + (set! (-> this want v1-39 force-vis?) (-> symbol-array (+ (* v1-39 4) 2))) + (set! (-> this want v1-39 force-inside?) (-> symbol-array (+ (* v1-39 4) 3))) ) (else - (set! (-> obj want v1-39 name) #f) - (set! (-> obj want v1-39 display?) #f) - (set! (-> obj want v1-39 force-vis?) #f) - (set! (-> obj want v1-39 force-inside?) #f) + (set! (-> this want v1-39 name) #f) + (set! (-> this want v1-39 display?) #f) + (set! (-> this want v1-39 force-vis?) #f) + (set! (-> this want v1-39 force-inside?) #f) ) ) ) @@ -221,31 +221,31 @@ (define *display-load-commands* #f) -(defmethod backup-load-state-and-set-cmds load-state ((obj load-state) (arg0 pair)) +(defmethod backup-load-state-and-set-cmds load-state ((this load-state) (arg0 pair)) (dotimes (s4-0 256) - (when (-> obj object-name s4-0) - (format 0 "WARNING: load state somehow aquired object command ~A~%" (-> obj object-name s4-0)) - (set! (-> obj object-name s4-0) #f) + (when (-> this object-name s4-0) + (format 0 "WARNING: load state somehow aquired object command ~A~%" (-> this object-name s4-0)) + (set! (-> this object-name s4-0) #f) ) ) - (mem-copy! (&-> *backup-load-state* type) (&-> obj type) (psize-of load-state)) + (mem-copy! (&-> *backup-load-state* type) (&-> this type) (psize-of load-state)) (set! (-> *backup-load-state* command-list) '()) - (set! (-> obj command-list) arg0) + (set! (-> this command-list) arg0) 0 ) -(defmethod restore-load-state-and-cleanup load-state ((obj load-state)) +(defmethod restore-load-state-and-cleanup load-state ((this load-state)) (with-pp - (execute-commands-up-to obj 100000.0) + (execute-commands-up-to this 100000.0) (dotimes (s5-0 256) - (when (-> obj object-name s5-0) - (let ((a0-3 (entity-by-name (-> obj object-name s5-0)))) - (set! (-> a0-3 extra perm status) (the-as entity-perm-status (-> obj object-status s5-0))) + (when (-> this object-name s5-0) + (let ((a0-3 (entity-by-name (-> this object-name s5-0)))) + (set! (-> a0-3 extra perm status) (the-as entity-perm-status (-> this object-status s5-0))) (if (-> a0-3 extra process) (kill! a0-3) ) ) - (set! (-> obj object-name s5-0) #f) + (set! (-> this object-name s5-0) #f) ) ) (let ((s5-1 (new 'stack-no-clear 'inline-array 'level-buffer-state LEVEL_MAX))) @@ -255,7 +255,7 @@ (dotimes (s4-1 LEVEL_MAX) (mem-copy! (the-as pointer (-> s5-1 s4-1)) (the-as pointer (-> *load-state* want s4-1)) 16) ) - (mem-copy! (&-> obj type) (&-> *backup-load-state* type) (psize-of load-state)) + (mem-copy! (&-> this type) (&-> *backup-load-state* type) (psize-of load-state)) (when (!= (-> pp type) scene-player) (dotimes (gp-1 LEVEL_MAX) (mem-copy! (the-as pointer (-> *load-state* want gp-1)) (the-as pointer (-> s5-1 gp-1)) 16) @@ -267,24 +267,24 @@ ) ) -(defmethod restore-load-state load-state ((obj load-state)) +(defmethod restore-load-state load-state ((this load-state)) (dotimes (v1-0 256) - (if (-> obj object-name v1-0) - (set! (-> obj object-name v1-0) #f) + (if (-> this object-name v1-0) + (set! (-> this object-name v1-0) #f) ) ) - (mem-copy! (&-> obj type) (&-> *backup-load-state* type) (psize-of load-state)) + (mem-copy! (&-> this type) (&-> *backup-load-state* type) (psize-of load-state)) 0 ) ;; WARN: Function (method 17 load-state) has a return type of none, but the expression builder found a return statement. -(defmethod execute-commands-up-to load-state ((obj load-state) (arg0 float)) +(defmethod execute-commands-up-to load-state ((this load-state) (arg0 float)) (with-pp (let ((s4-0 (new 'stack 'script-context (process->ppointer pp) pp (the-as vector #f)))) - (set! (-> s4-0 load-state) obj) - (while (not (null? (-> obj command-list))) - (let ((f0-0 (command-get-float (car (car (-> obj command-list))) 0.0)) - (s3-0 (cdr (car (-> obj command-list)))) + (set! (-> s4-0 load-state) this) + (while (not (null? (-> this command-list))) + (let ((f0-0 (command-get-float (car (car (-> this command-list))) 0.0)) + (s3-0 (cdr (car (-> this command-list)))) ) (if (< arg0 f0-0) (return #f) @@ -307,7 +307,7 @@ ) ) ) - (set! (-> obj command-list) (cdr (-> obj command-list))) + (set! (-> this command-list) (cdr (-> this command-list))) ) ) 0 diff --git a/goal_src/jak2/engine/load/loader.gc b/goal_src/jak2/engine/load/loader.gc index a8442295fb..5685d3da1c 100644 --- a/goal_src/jak2/engine/load/loader.gc +++ b/goal_src/jak2/engine/load/loader.gc @@ -9,87 +9,87 @@ ;; DECOMP BEGINS -(defmethod mem-usage subtitle-range ((obj subtitle-range) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage subtitle-range ((this subtitle-range) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 73 (-> arg0 length))) (set! (-> arg0 data 72 name) "subtitle") (+! (-> arg0 data 72 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 72 used) v1-6) (+! (-> arg0 data 72 total) (logand -16 (+ v1-6 15))) ) - obj + this ) ;; WARN: Return type mismatch symbol vs load-dir. -(defmethod mem-usage load-dir ((obj load-dir) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage load-dir ((this load-dir) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") (+! (-> arg0 data 84 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 84 used) v1-6) (+! (-> arg0 data 84 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") (set! (-> arg0 data 84 count) (-> arg0 data 84 count)) - (let ((v1-15 (asize-of (-> obj string-array)))) + (let ((v1-15 (asize-of (-> this string-array)))) (+! (-> arg0 data 84 used) v1-15) (+! (-> arg0 data 84 total) (logand -16 (+ v1-15 15))) ) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") (set! (-> arg0 data 84 count) (-> arg0 data 84 count)) - (let ((v1-24 (asize-of (-> obj data-array)))) + (let ((v1-24 (asize-of (-> this data-array)))) (+! (-> arg0 data 84 used) v1-24) (+! (-> arg0 data 84 total) (logand -16 (+ v1-24 15))) ) - (dotimes (s3-0 (-> obj data-array length)) - (mem-usage (-> obj data-array s3-0) arg0 arg1) + (dotimes (s3-0 (-> this data-array length)) + (mem-usage (-> this data-array s3-0) arg0 arg1) ) (the-as load-dir #f) ) -(defmethod load-to-heap-by-name load-dir-art-group ((obj load-dir-art-group) (arg0 string) (arg1 symbol) (arg2 kheap) (arg3 int)) - (let ((s5-0 (-> obj string-array))) +(defmethod load-to-heap-by-name load-dir-art-group ((this load-dir-art-group) (arg0 string) (arg1 symbol) (arg2 kheap) (arg3 int)) + (let ((s5-0 (-> this string-array))) (dotimes (s3-0 (-> s5-0 length)) (when (string= arg0 (-> s5-0 s3-0)) (when arg1 (let ((v1-4 (art-group-load-check arg0 arg2 arg3))) (if v1-4 - (set! (-> obj art-group-array s3-0) v1-4) + (set! (-> this art-group-array s3-0) v1-4) ) ) ) - (return (-> obj art-group-array s3-0)) + (return (-> this art-group-array s3-0)) ) ) (let ((v0-2 (art-group-load-check arg0 arg2 arg3))) (when v0-2 (set! (-> s5-0 (-> s5-0 length)) arg0) - (set! (-> obj art-group-array (-> s5-0 length)) v0-2) + (set! (-> this art-group-array (-> s5-0 length)) v0-2) (+! (-> s5-0 length) 1) - (+! (-> obj art-group-array length) 1) + (+! (-> this art-group-array length) 1) ) v0-2 ) ) ) -(defmethod set-loaded-art load-dir-art-group ((obj load-dir-art-group) (arg0 art-group)) - (let ((s4-0 (-> obj string-array))) +(defmethod set-loaded-art load-dir-art-group ((this load-dir-art-group) (arg0 art-group)) + (let ((s4-0 (-> this string-array))) (dotimes (s3-0 (-> s4-0 length)) (when (string= (-> arg0 name) (-> s4-0 s3-0)) - (set! (-> obj art-group-array s3-0) arg0) - (set! arg0 (-> obj art-group-array s3-0)) + (set! (-> this art-group-array s3-0) arg0) + (set! arg0 (-> this art-group-array s3-0)) (goto cfg-7) ) ) (set! (-> s4-0 (-> s4-0 length)) (-> arg0 name)) - (set! (-> obj art-group-array (-> s4-0 length)) arg0) + (set! (-> this art-group-array (-> s4-0 length)) arg0) (+! (-> s4-0 length) 1) ) - (+! (-> obj art-group-array length) 1) + (+! (-> this art-group-array length) 1) (label cfg-7) arg0 ) @@ -156,17 +156,17 @@ ) ) -(defmethod print external-art-buffer ((obj external-art-buffer)) +(defmethod print external-art-buffer ((this external-art-buffer)) (format #t "#<~A ~S ~D ~A @ #x~X>" - (-> obj type) - (-> obj pending-load-file) - (-> obj pending-load-file-part) - (-> obj status) - obj + (-> this type) + (-> this pending-load-file) + (-> this pending-load-file-part) + (-> this status) + this ) - obj + this ) (defun external-art-buffer-init ((arg0 external-art-buffer)) @@ -179,36 +179,36 @@ 0 ) -(defmethod set-pending-file external-art-buffer ((obj external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) - (set! (-> obj pending-load-file) arg0) - (set! (-> obj pending-load-file-part) arg1) - (set! (-> obj pending-load-file-owner) arg2) - (set! (-> obj pending-load-file-priority) arg3) +(defmethod set-pending-file external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) + (set! (-> this pending-load-file) arg0) + (set! (-> this pending-load-file-part) arg1) + (set! (-> this pending-load-file-owner) arg2) + (set! (-> this pending-load-file-priority) arg3) 0 ) -(defmethod unlock! external-art-buffer ((obj external-art-buffer)) - (set! (-> obj locked?) #f) +(defmethod unlock! external-art-buffer ((this external-art-buffer)) + (set! (-> this locked?) #f) 0 ) -(defmethod inactive? external-art-buffer ((obj external-art-buffer)) - (!= (-> obj status) 'active) +(defmethod inactive? external-art-buffer ((this external-art-buffer)) + (!= (-> this status) 'active) ) -(defmethod file-status external-art-buffer ((obj external-art-buffer) (arg0 string) (arg1 int)) - (when (and (name= (-> obj pending-load-file) arg0) (= (-> obj pending-load-file-part) arg1)) - (if (and (name= (-> obj load-file) arg0) (= (-> obj load-file-part) arg1)) - (-> obj status) +(defmethod file-status external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int)) + (when (and (name= (-> this pending-load-file) arg0) (= (-> this pending-load-file-part) arg1)) + (if (and (name= (-> this load-file) arg0) (= (-> this load-file-part) arg1)) + (-> this status) 'pending ) ) ) -(defmethod link-art! art-group ((obj art-group)) - (when obj - (countdown (s5-0 (-> obj length)) - (let* ((s3-0 (-> obj data s5-0)) +(defmethod link-art! art-group ((this art-group)) + (when this + (countdown (s5-0 (-> this length)) + (let* ((s3-0 (-> this data s5-0)) (s4-0 (if (type? s3-0 art-joint-anim) (the-as art-joint-anim s3-0) ) @@ -248,19 +248,19 @@ ) ) (if (not s2-0) - (format 0 "ERROR: ~A could not find a master slot to link for ~A.~%" (-> obj name) s4-0) + (format 0 "ERROR: ~A could not find a master slot to link for ~A.~%" (-> this name) s4-0) ) ) ) ) ) - obj + this ) -(defmethod unlink-art! art-group ((obj art-group)) - (when obj - (countdown (s5-0 (-> obj length)) - (let* ((s3-0 (-> obj data s5-0)) +(defmethod unlink-art! art-group ((this art-group)) + (when this + (countdown (s5-0 (-> this length)) + (let* ((s3-0 (-> this data s5-0)) (s4-0 (if (type? s3-0 art-joint-anim) (the-as art-joint-anim s3-0) ) @@ -285,7 +285,7 @@ ) ) (if (not s3-1) - (format 0 "ERROR: ~A could not find a master slot to unlink for ~A.~%" (-> obj name) s4-0) + (format 0 "ERROR: ~A could not find a master slot to unlink for ~A.~%" (-> this name) s4-0) ) ) ) @@ -294,196 +294,196 @@ 0 ) -(defmethod link-file external-art-buffer ((obj external-art-buffer) (arg0 art-group)) +(defmethod link-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) (when arg0 (link-art! arg0) - (set! (-> obj art-group) arg0) + (set! (-> this art-group) arg0) ) arg0 ) -(defmethod unlink-file external-art-buffer ((obj external-art-buffer) (arg0 art-group)) +(defmethod unlink-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) (when arg0 (unlink-art! arg0) - (set! (-> obj art-group) #f) + (set! (-> this art-group) #f) ) 0 ) ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. -(defmethod update external-art-buffer ((obj external-art-buffer)) - (when (or (not (name= (-> obj pending-load-file) (-> obj load-file))) - (!= (-> obj pending-load-file-part) (-> obj load-file-part)) +(defmethod update external-art-buffer ((this external-art-buffer)) + (when (or (not (name= (-> this pending-load-file) (-> this load-file))) + (!= (-> this pending-load-file-part) (-> this load-file-part)) ) - (when (not (handle->process (-> obj pending-load-file-owner))) - (set! (-> obj pending-load-file) #f) - (set! (-> obj pending-load-file-part) -1) - (set! (-> obj pending-load-file-owner) (the-as handle #f)) - (set! (-> obj pending-load-file-priority) 100000000.0) + (when (not (handle->process (-> this pending-load-file-owner))) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) 100000000.0) ) - (when (= (-> obj status) 'initialize) - ((-> obj init-heap) obj) - (set! (-> obj status) 'inactive) + (when (= (-> this status) 'initialize) + ((-> this init-heap) this) + (set! (-> this status) 'inactive) ) (cond - ((-> obj load-file) - (if (= (-> obj status) 'loading) + ((-> this load-file) + (if (= (-> this status) 'loading) (str-load-cancel) ) - (set! (-> obj load-file) #f) - (set! (-> obj load-file-part) -1) - (set! (-> obj load-file-owner) (the-as handle #f)) - (set! (-> obj load-file-priority) 100000000.0) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) 100000000.0) ) (else - (set! (-> obj load-file) (-> obj pending-load-file)) - (set! (-> obj load-file-part) (-> obj pending-load-file-part)) - (set! (-> obj load-file-owner) (-> obj pending-load-file-owner)) - (set! (-> obj load-file-priority) (-> obj pending-load-file-priority)) + (set! (-> this load-file) (-> this pending-load-file)) + (set! (-> this load-file-part) (-> this pending-load-file-part)) + (set! (-> this load-file-owner) (-> this pending-load-file-owner)) + (set! (-> this load-file-priority) (-> this pending-load-file-priority)) ) ) ) (label cfg-18) (cond - ((-> obj load-file) - (case (-> obj status) + ((-> this load-file) + (case (-> this status) (('active 'reserved) ) (('error) - (set! (-> obj status) 'inactive) - (set! (-> obj load-file) #f) - (set! (-> obj load-file-part) -1) - (set! (-> obj load-file-owner) (the-as handle #f)) - (set! (-> obj load-file-priority) 100000000.0) - (set! (-> obj pending-load-file) #f) - (set! (-> obj pending-load-file-part) -1) - (set! (-> obj pending-load-file-owner) (the-as handle #f)) - (set! (-> obj pending-load-file-priority) 100000000.0) - (set! (-> obj art-group) #f) + (set! (-> this status) 'inactive) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) 100000000.0) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) 100000000.0) + (set! (-> this art-group) #f) ) (('inactive) - (let ((v1-31 (-> obj heap))) + (let ((v1-31 (-> this heap))) (set! (-> v1-31 current) (-> v1-31 base)) ) (cond - ((string= (-> obj load-file) "reserved") + ((string= (-> this load-file) "reserved") (cond ((-> *art-control* reserve-buffer) - (format 0 "ERROR: trying double reserve ~A when ~A is reserved~%" obj (-> *art-control* reserve-buffer)) + (format 0 "ERROR: trying double reserve ~A when ~A is reserved~%" this (-> *art-control* reserve-buffer)) ) (else - (set! (-> obj status) 'reserved) - (set! (-> *art-control* reserve-buffer) obj) + (set! (-> this status) 'reserved) + (set! (-> *art-control* reserve-buffer) this) ) ) ) - ((and (!= (-> *level* loading-level) (-> *level* default-level)) (< 81920.0 (-> obj load-file-priority))) + ((and (!= (-> *level* loading-level) (-> *level* default-level)) (< 81920.0 (-> this load-file-priority))) ) - ((let ((v1-44 (logand -64 (&+ (-> obj heap current) 63)))) - (str-load (-> obj load-file) (-> obj load-file-part) v1-44 (&- (-> obj heap top) (the-as uint v1-44))) + ((let ((v1-44 (logand -64 (&+ (-> this heap current) 63)))) + (str-load (-> this load-file) (-> this load-file-part) v1-44 (&- (-> this heap top) (the-as uint v1-44))) ) - (set! (-> obj status) 'loading) + (set! (-> this status) 'loading) 0 ) ) ) (('loading) - (case (str-load-status (&-> obj len)) + (case (str-load-status (&-> this len)) (('error) - (set! (-> obj status) 'error) + (set! (-> this status) 'error) ) (('busy) ) (else - (set! (-> obj buf) (logand -64 (&+ (-> obj heap current) 63))) - (set! (-> obj status) 'loaded) + (set! (-> this buf) (logand -64 (&+ (-> this heap current) 63))) + (set! (-> this status) 'loaded) (goto cfg-18) ) ) ) (('loaded) - (let ((a0-34 (-> obj buf))) + (let ((a0-34 (-> this buf))) (cond - ((-> obj login?) - (set! (-> obj art-group) (the-as art-group (link a0-34 (-> obj load-file data) (-> obj len) (-> obj heap) 0))) - (let ((s4-0 (-> obj art-group)) - (s3-0 (-> obj load-file)) + ((-> this login?) + (set! (-> this art-group) (the-as art-group (link a0-34 (-> this load-file data) (-> this len) (-> this heap) 0))) + (let ((s4-0 (-> this art-group)) + (s3-0 (-> this load-file)) ) (cond ((not s4-0) - (format 0 "ERROR: art-group ~A part ~D is not a valid file.~%" s3-0 (-> obj load-file-part)) - (set! (-> obj status) 'error) + (format 0 "ERROR: art-group ~A part ~D is not a valid file.~%" s3-0 (-> this load-file-part)) + (set! (-> this status) 'error) ) ((not (type? s4-0 art-group)) - (format 0 "ERROR: art-group ~A part ~D is not a art-group.~%" s3-0 (-> obj load-file-part)) - (set! (-> obj status) 'error) + (format 0 "ERROR: art-group ~A part ~D is not a art-group.~%" s3-0 (-> this load-file-part)) + (set! (-> this status) 'error) ) ((not (file-info-correct-version? (-> s4-0 info) (file-kind art-group) 0)) - (set! (-> obj status) 'error) + (set! (-> this status) 'error) ) (else (login s4-0) - (set! (-> obj status) 'locked) + (set! (-> this status) 'locked) ) ) ) ) (else - (set! (-> obj status) 'locked) - (set! (-> obj art-group) (the-as art-group a0-34)) + (set! (-> this status) 'locked) + (set! (-> this art-group) (the-as art-group a0-34)) ) ) ) ) (('locked) - (when (and (not (-> obj locked?)) (handle->process (-> obj load-file-owner))) - (if (-> obj login?) - (link-file obj (-> obj art-group)) + (when (and (not (-> this locked?)) (handle->process (-> this load-file-owner))) + (if (-> this login?) + (link-file this (-> this art-group)) ) - (if (-> obj other) - (set! (-> obj other locked?) #t) + (if (-> this other) + (set! (-> this other locked?) #t) ) - (set! (-> obj status) 'active) + (set! (-> this status) 'active) (goto cfg-18) ) ) ) ) (else - (case (-> obj status) + (case (-> this status) (('initialize) ) (('reserved) (cond - ((= (-> *art-control* reserve-buffer) obj) + ((= (-> *art-control* reserve-buffer) this) (set! (-> *art-control* reserve-buffer) #f) - (set! (-> obj status) 'inactive) + (set! (-> this status) 'inactive) ) (else - (format 0 "ERROR: trying tro free ~A when ~A is reserved~%" obj (-> *art-control* reserve-buffer)) + (format 0 "ERROR: trying tro free ~A when ~A is reserved~%" this (-> *art-control* reserve-buffer)) ) ) ) (('active) - (if (-> obj login?) - (unlink-file obj (-> obj art-group)) + (if (-> this login?) + (unlink-file this (-> this art-group)) ) - (let ((v1-86 (-> obj heap))) + (let ((v1-86 (-> this heap))) (set! (-> v1-86 current) (-> v1-86 base)) ) - (set! (-> obj art-group) #f) - (set! (-> obj status) 'inactive) - (when (and (-> obj other) (-> obj other locked?)) - (unlock! (-> obj other)) - (update (-> obj other)) + (set! (-> this art-group) #f) + (set! (-> this status) 'inactive) + (when (and (-> this other) (-> this other locked?)) + (unlock! (-> this other)) + (update (-> this other)) ) ) (else - (let ((v1-96 (-> obj heap))) + (let ((v1-96 (-> this heap))) (set! (-> v1-96 current) (-> v1-96 base)) ) - (set! (-> obj art-group) #f) - (set! (-> obj status) 'inactive) + (set! (-> this art-group) #f) + (set! (-> this status) 'inactive) ) ) ) @@ -493,9 +493,9 @@ (define *preload-spool-anims* #t) -(defmethod file-status external-art-control ((obj external-art-control) (arg0 string) (arg1 int)) +(defmethod file-status external-art-control ((this external-art-control) (arg0 string) (arg1 int)) (dotimes (s3-0 2) - (let ((v1-3 (file-status (-> obj buffer s3-0) arg0 arg1))) + (let ((v1-3 (file-status (-> this buffer s3-0) arg0 arg1))) (if v1-3 (return v1-3) ) @@ -504,31 +504,31 @@ #f ) -(defmethod update external-art-control ((obj external-art-control) (arg0 symbol)) - (if (nonzero? (-> obj reserve-buffer-count)) - (spool-push obj "reserved" 0 *dproc* (if (-> obj reserve-buffer) +(defmethod update external-art-control ((this external-art-control) (arg0 symbol)) + (if (nonzero? (-> this reserve-buffer-count)) + (spool-push this "reserved" 0 *dproc* (if (-> this reserve-buffer) -110.0 -0.5 ) ) ) (dotimes (v1-5 2) - (set! (-> obj buffer v1-5 frame-lock) #f) + (set! (-> this buffer v1-5 frame-lock) #f) ) (dotimes (v1-8 3) - (set! (-> obj rec v1-8 anim-name) #f) + (set! (-> this rec v1-8 anim-name) #f) ) (dotimes (s4-0 2) - (let ((s3-0 (-> obj rec s4-0))) + (let ((s3-0 (-> this rec s4-0))) (when (-> s3-0 name) (dotimes (s2-0 2) - (when (and (file-status (-> obj buffer s2-0) (-> s3-0 name) (-> s3-0 parts)) (not (-> obj buffer s2-0 frame-lock))) - (set! (-> obj buffer s2-0 frame-lock) #t) - (set! (-> s3-0 anim-name) (-> obj buffer s2-0)) - (set! (-> obj buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) - (set! (-> obj buffer s2-0 load-file-owner) (-> s3-0 owner)) - (set! (-> obj buffer s2-0 pending-load-file-priority) (-> s3-0 priority)) - (set! (-> obj buffer s2-0 load-file-priority) (-> s3-0 priority)) + (when (and (file-status (-> this buffer s2-0) (-> s3-0 name) (-> s3-0 parts)) (not (-> this buffer s2-0 frame-lock))) + (set! (-> this buffer s2-0 frame-lock) #t) + (set! (-> s3-0 anim-name) (-> this buffer s2-0)) + (set! (-> this buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) + (set! (-> this buffer s2-0 load-file-owner) (-> s3-0 owner)) + (set! (-> this buffer s2-0 pending-load-file-priority) (-> s3-0 priority)) + (set! (-> this buffer s2-0 load-file-priority) (-> s3-0 priority)) (goto cfg-24) ) ) @@ -537,16 +537,16 @@ (label cfg-24) ) (dotimes (s4-1 2) - (let ((s3-1 (-> obj rec s4-1))) + (let ((s3-1 (-> this rec s4-1))) (when (and (-> s3-1 name) (not (-> s3-1 anim-name))) (if (and (not *preload-spool-anims*) (>= (-> s3-1 priority) 0.0)) (goto cfg-46) ) (dotimes (s2-1 2) - (when (not (-> obj buffer s2-1 frame-lock)) - (set! (-> obj buffer s2-1 frame-lock) #t) - (set-pending-file (-> obj buffer s2-1) (-> s3-1 name) (-> s3-1 parts) (-> s3-1 owner) (-> s3-1 priority)) - (set! (-> s3-1 anim-name) (-> obj buffer s2-1)) + (when (not (-> this buffer s2-1 frame-lock)) + (set! (-> this buffer s2-1 frame-lock) #t) + (set-pending-file (-> this buffer s2-1) (-> s3-1 name) (-> s3-1 parts) (-> s3-1 owner) (-> s3-1 priority)) + (set! (-> s3-1 anim-name) (-> this buffer s2-1)) (goto cfg-46) ) ) @@ -554,8 +554,8 @@ ) (label cfg-46) ) - (when (not (-> obj reserve-buffer)) - (let ((s4-2 (-> obj rec 0 anim-name))) + (when (not (-> this reserve-buffer)) + (let ((s4-2 (-> this rec 0 anim-name))) (if (and s4-2 (-> (the-as external-art-buffer s4-2) locked?) (not (string= (-> (the-as external-art-buffer s4-2) pending-load-file) "reserved")) @@ -572,13 +572,13 @@ ) ) (dotimes (s4-3 2) - (update (-> obj buffer s4-3)) + (update (-> this buffer s4-3)) ) - (let ((s4-4 (-> obj queue-stream))) + (let ((s4-4 (-> this queue-stream))) (set! (-> s4-4 length) 0) (dotimes (s3-2 3) - (when (-> obj rec s3-2 name) - (mem-copy! (&-> (-> s4-4 (-> s4-4 length)) type) (&-> (-> obj rec s3-2) type) 44) + (when (-> this rec s3-2 name) + (mem-copy! (&-> (-> s4-4 (-> s4-4 length)) type) (&-> (-> this rec s3-2) type) 44) (+! (-> s4-4 length) 1) ) ) @@ -589,10 +589,10 @@ (a0-27 *stdcon*) (a1-8 "rec ~d ~S ~D ~f ~A~%") (a2-5 s5-1) - (a3-3 (-> obj rec s5-1 name)) - (t0-3 (-> obj rec s5-1 parts)) - (t1-0 (-> obj rec s5-1 priority)) - (v1-121 (handle->process (-> obj rec s5-1 owner))) + (a3-3 (-> this rec s5-1 name)) + (t0-3 (-> this rec s5-1 parts)) + (t1-0 (-> this rec s5-1 priority)) + (v1-121 (handle->process (-> this rec s5-1 owner))) ) (t9-8 a0-27 a1-8 a2-5 a3-3 t0-3 t1-0 (if v1-121 (-> v1-121 name) @@ -605,15 +605,15 @@ (a0-28 *stdcon*) (a1-9 "buf ~d ~C ~S ~D ~A ~A~%") (a2-6 s5-2) - (a3-4 (if (-> obj buffer s5-2 locked?) + (a3-4 (if (-> this buffer s5-2 locked?) 108 32 ) ) - (t0-4 (-> obj buffer s5-2 pending-load-file)) - (t1-1 (-> obj buffer s5-2 pending-load-file-part)) - (t2-5 (-> obj buffer s5-2 status)) - (v1-142 (handle->process (-> obj buffer s5-2 pending-load-file-owner))) + (t0-4 (-> this buffer s5-2 pending-load-file)) + (t1-1 (-> this buffer s5-2 pending-load-file-part)) + (t2-5 (-> this buffer s5-2 status)) + (v1-142 (handle->process (-> this buffer s5-2 pending-load-file-owner))) ) (t9-9 a0-28 a1-9 a2-6 a3-4 t0-4 t1-1 t2-5 (if v1-142 (-> v1-142 name) @@ -621,58 +621,58 @@ ) ) ) - (format *stdcon* " a: ~S~%" (-> obj active-stream)) + (format *stdcon* " a: ~S~%" (-> this active-stream)) ) 0 ) -(defmethod none-reserved? external-art-control ((obj external-art-control)) - (zero? (-> obj reserve-buffer-count)) +(defmethod none-reserved? external-art-control ((this external-art-control)) + (zero? (-> this reserve-buffer-count)) ) -(defmethod reserve-alloc external-art-control ((obj external-art-control)) +(defmethod reserve-alloc external-art-control ((this external-art-control)) (cond - ((or (nonzero? (-> obj dma-reserve-buffer-count)) (= *master-mode* 'progress)) - (set! (-> obj dma-reserve-buffer-count) 1) + ((or (nonzero? (-> this dma-reserve-buffer-count)) (= *master-mode* 'progress)) + (set! (-> this dma-reserve-buffer-count) 1) (when (and (-> *bigmap* drawing-flag) (zero? (-> *blit-displays-work* count-down))) - (let ((v1-8 (-> obj dma-reserve-heap))) + (let ((v1-8 (-> this dma-reserve-heap))) (set! (-> v1-8 base) (logand -64 (&+ (&+ (-> *display* frames 1 global-buf end) -252992) 63))) (set! (-> v1-8 current) (-> v1-8 base)) (set! (-> v1-8 top-base) (&+ (-> v1-8 base) #x3dc00)) (set! (-> v1-8 top) (-> v1-8 top-base)) ) - (set! (-> *display* frames 1 global-buf end) (-> obj dma-reserve-heap base)) - (-> obj dma-reserve-heap) + (set! (-> *display* frames 1 global-buf end) (-> this dma-reserve-heap base)) + (-> this dma-reserve-heap) ) ) (else - (set! (-> obj reserve-buffer-count) 1) - (if (and (-> obj reserve-buffer) (not (check-busy *load-str-rpc*))) - (-> obj reserve-buffer heap) + (set! (-> this reserve-buffer-count) 1) + (if (and (-> this reserve-buffer) (not (check-busy *load-str-rpc*))) + (-> this reserve-buffer heap) ) ) ) ) -(defmethod reserve-free external-art-control ((obj external-art-control) (arg0 kheap)) +(defmethod reserve-free external-art-control ((this external-art-control) (arg0 kheap)) (cond - ((nonzero? (-> obj dma-reserve-buffer-count)) - (set! (-> obj dma-reserve-buffer-count) 0) + ((nonzero? (-> this dma-reserve-buffer-count)) + (set! (-> this dma-reserve-buffer-count) 0) (let ((v1-3 (-> *display* frames 1 global-buf))) (set! (-> v1-3 end) (&-> v1-3 data-buffer (-> v1-3 allocated-length))) ) ) - ((and (zero? (-> obj reserve-buffer-count)) (zero? (-> obj dma-reserve-buffer-count))) + ((and (zero? (-> this reserve-buffer-count)) (zero? (-> this dma-reserve-buffer-count))) (format 0 "ERROR: illegal attempt to free a buffer #x~X which had not been reserved (none reserved).~%" arg0) ) - ((not (-> obj reserve-buffer)) - (set! (-> obj reserve-buffer-count) 0) + ((not (-> this reserve-buffer)) + (set! (-> this reserve-buffer-count) 0) 0 ) - ((= (-> obj reserve-buffer heap) arg0) - (set-pending-file (-> obj reserve-buffer) (the-as string #f) -1 (the-as handle #f) 100000000.0) - (update (-> obj reserve-buffer)) - (set! (-> obj reserve-buffer-count) 0) + ((= (-> this reserve-buffer heap) arg0) + (set-pending-file (-> this reserve-buffer) (the-as string #f) -1 (the-as handle #f) 100000000.0) + (update (-> this reserve-buffer)) + (set! (-> this reserve-buffer-count) 0) 0 ) (else @@ -682,70 +682,70 @@ 0 ) -(defmethod clear-rec external-art-control ((obj external-art-control)) +(defmethod clear-rec external-art-control ((this external-art-control)) (dotimes (v1-0 3) - (set! (-> obj rec v1-0 type) spool-anim) - (set! (-> obj rec v1-0 name) #f) - (set! (-> obj rec v1-0 priority) 100000000.0) - (set! (-> obj rec v1-0 owner) (the-as handle #f)) + (set! (-> this rec v1-0 type) spool-anim) + (set! (-> this rec v1-0 name) #f) + (set! (-> this rec v1-0 priority) 100000000.0) + (set! (-> this rec v1-0 owner) (the-as handle #f)) ) - (set! (-> obj frame-mask) (the-as uint (-> *setting-control* user-current process-mask))) + (set! (-> this frame-mask) (the-as uint (-> *setting-control* user-current process-mask))) 0 ) -(defmethod spool-push external-art-control ((obj external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) +(defmethod spool-push external-art-control ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) (when (and (= arg3 -99.0) arg2) (let ((a0-2 (target-pos 0))) (set! arg3 (vector-vector-distance a0-2 (-> (the-as process-drawable arg2) root trans))) ) ) (cond - ((and (= arg1 (-> obj rec 0 parts)) (name= arg0 (-> obj rec 0 name))) - (if (>= arg3 (-> obj rec 0 priority)) + ((and (= arg1 (-> this rec 0 parts)) (name= arg0 (-> this rec 0 name))) + (if (>= arg3 (-> this rec 0 priority)) (return (the-as int #f)) ) - (mem-copy! (&-> (-> obj rec) 0 type) (&-> (-> obj rec 1) type) 44) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec 2) type) 44) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (mem-copy! (&-> (-> this rec) 0 type) (&-> (-> this rec 1) type) 44) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec 2) type) 44) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) - ((and (= arg1 (-> obj rec 1 parts)) (name= arg0 (-> obj rec 1 name))) - (if (>= arg3 (-> obj rec 1 priority)) + ((and (= arg1 (-> this rec 1 parts)) (name= arg0 (-> this rec 1 name))) + (if (>= arg3 (-> this rec 1 priority)) (return (the-as int #f)) ) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec 2) type) 44) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec 2) type) 44) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) - ((and (= arg1 (-> obj rec 2 parts)) (name= arg0 (-> obj rec 2 name))) - (if (>= arg3 (-> obj rec 2 priority)) + ((and (= arg1 (-> this rec 2 parts)) (name= arg0 (-> this rec 2 name))) + (if (>= arg3 (-> this rec 2 priority)) (return (the-as int #f)) ) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) ) (cond - ((< arg3 (-> obj rec 0 priority)) - (mem-copy! (&-> (-> obj rec 2) type) (&-> (-> obj rec 1) type) 44) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec) 0 type) 44) - (set! (-> obj rec 0 name) arg0) - (set! (-> obj rec 0 parts) arg1) - (set! (-> obj rec 0 priority) arg3) - (set! (-> obj rec 0 owner) (process->handle arg2)) + ((< arg3 (-> this rec 0 priority)) + (mem-copy! (&-> (-> this rec 2) type) (&-> (-> this rec 1) type) 44) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec) 0 type) 44) + (set! (-> this rec 0 name) arg0) + (set! (-> this rec 0 parts) arg1) + (set! (-> this rec 0 priority) arg3) + (set! (-> this rec 0 owner) (process->handle arg2)) ) - ((< arg3 (-> obj rec 1 priority)) - (mem-copy! (&-> (-> obj rec 2) type) (&-> (-> obj rec 1) type) 44) - (set! (-> obj rec 1 name) arg0) - (set! (-> obj rec 1 parts) arg1) - (set! (-> obj rec 1 priority) arg3) - (set! (-> obj rec 1 owner) (process->handle arg2)) + ((< arg3 (-> this rec 1 priority)) + (mem-copy! (&-> (-> this rec 2) type) (&-> (-> this rec 1) type) 44) + (set! (-> this rec 1 name) arg0) + (set! (-> this rec 1 parts) arg1) + (set! (-> this rec 1 priority) arg3) + (set! (-> this rec 1 owner) (process->handle arg2)) ) - ((< arg3 (-> obj rec 2 priority)) - (set! (-> obj rec 2 name) arg0) - (set! (-> obj rec 2 parts) arg1) - (set! (-> obj rec 2 priority) arg3) - (set! (-> obj rec 2 owner) (process->handle arg2)) + ((< arg3 (-> this rec 2 priority)) + (set! (-> this rec 2 name) arg0) + (set! (-> this rec 2 parts) arg1) + (set! (-> this rec 2 priority) arg3) + (set! (-> this rec 2 owner) (process->handle arg2)) ) ) 0 @@ -1139,27 +1139,27 @@ ) -(defmethod print gui-connection ((obj gui-connection)) - (format #t "# obj name) - (-> obj anim-part) - (-> obj id) - (-> obj priority) - (enum->string gui-channel (-> obj channel)) - (enum->string gui-action (-> obj action))) - (format #t " ~6S <@ #x~A>" (enum->string gui-status (get-status *gui-control* (-> obj id))) obj) - obj +(defmethod print gui-connection ((this gui-connection)) + (format #t "# this name) + (-> this anim-part) + (-> this id) + (-> this priority) + (enum->string gui-channel (-> this channel)) + (enum->string gui-action (-> this action))) + (format #t " ~6S <@ #x~A>" (enum->string gui-status (get-status *gui-control* (-> this id))) this) + this ) -(defmethod channel-id-set! gui-control ((obj gui-control) (arg0 gui-connection) (arg1 sound-id)) - (set! (-> obj ids (-> arg0 channel)) arg1) +(defmethod channel-id-set! gui-control ((this gui-control) (arg0 gui-connection) (arg1 sound-id)) + (set! (-> this ids (-> arg0 channel)) arg1) 0 ) -(defmethod lookup-gui-connection gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) - (let ((s1-0 (the-as gui-connection (-> obj engine alive-list next0)))) - (-> obj engine) +(defmethod lookup-gui-connection gui-control ((this gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) + (let ((s1-0 (the-as gui-connection (-> this engine alive-list next0)))) + (-> this engine) (let ((s0-0 (-> s1-0 next0))) - (while (!= s1-0 (-> obj engine alive-list-end)) + (while (!= s1-0 (-> this engine alive-list-end)) (if (and (or (= arg1 (gui-channel none)) (= (-> s1-0 channel) arg1)) (or (not arg0) (= (-> arg0 type) scene-player) (= arg0 (get-process s1-0))) (or (not arg2) (string= arg2 (-> s1-0 name))) @@ -1168,13 +1168,13 @@ (return s1-0) ) (set! s1-0 (the-as gui-connection s0-0)) - (-> obj engine) + (-> this engine) (set! s0-0 (-> s0-0 next0)) ) ) ) (countdown (s1-1 32) - (let ((s0-1 (-> obj connections s1-1))) + (let ((s0-1 (-> this connections s1-1))) (if (and (nonzero? (-> s0-1 id)) (or (= arg1 (gui-channel none)) (= (-> s0-1 channel) arg1)) (and (or (not arg0) (= (-> arg0 type) scene-player) (= arg0 (handle->process (-> s0-1 handle)))) @@ -1190,11 +1190,11 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod lookup-gui-connection-id gui-control ((obj gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) - (let ((s2-0 (the-as gui-connection (-> obj engine alive-list next0)))) - (-> obj engine) +(defmethod lookup-gui-connection-id gui-control ((this gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) + (let ((s2-0 (the-as gui-connection (-> this engine alive-list next0)))) + (-> this engine) (let ((s1-0 (-> s2-0 next0))) - (while (!= s2-0 (-> obj engine alive-list-end)) + (while (!= s2-0 (-> this engine alive-list-end)) (if (and (or (= arg1 (gui-channel none)) (= arg1 (-> s2-0 channel))) (or (= arg2 (gui-action none)) (= arg2 (-> s2-0 action))) (or (not arg0) (string= arg0 (-> s2-0 name))) @@ -1202,13 +1202,13 @@ (return (-> s2-0 id)) ) (set! s2-0 (the-as gui-connection s1-0)) - (-> obj engine) + (-> this engine) (set! s1-0 (-> s1-0 next0)) ) ) ) (countdown (s2-1 32) - (let ((s1-1 (-> obj connections s2-1))) + (let ((s1-1 (-> this connections s2-1))) (if (and (nonzero? (-> s1-1 id)) (or (= arg1 (gui-channel none)) (= arg1 (-> s1-1 channel))) (or (= arg2 (gui-action none)) (= arg2 (-> s1-1 action))) @@ -1221,7 +1221,7 @@ (the-as sound-id 0) ) -(defmethod set-falloff! gui-control ((obj gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) +(defmethod set-falloff! gui-control ((this gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) (when (nonzero? arg0) (let ((v1-2 (lookup-gui-connection *gui-control* (the-as process #f) (gui-channel none) (the-as string #f) arg0))) (when v1-2 @@ -1248,7 +1248,7 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 34. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gui-control-method-18 gui-control ((obj gui-control) (arg0 gui-channel)) +(defmethod gui-control-method-18 gui-control ((this gui-control) (arg0 gui-channel)) (let ((v1-0 arg0)) (the-as symbol @@ -1269,25 +1269,25 @@ ) ) -(defmethod handle-command gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) - (let ((s5-0 (-> obj ids arg1))) +(defmethod handle-command gui-control ((this gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) + (let ((s5-0 (-> this ids arg1))) (cond ((nonzero? s5-0) (case arg2 (('wait) - (if (nonzero? (get-status obj s5-0)) + (if (nonzero? (get-status this s5-0)) (return #f) ) ) (('stop 'priority-stop) - (when (nonzero? (-> obj ids arg1)) - (let ((s2-0 (lookup-gui-connection obj (the-as process #f) arg1 (the-as string #f) s5-0))) + (when (nonzero? (-> this ids arg1)) + (let ((s2-0 (lookup-gui-connection this (the-as process #f) arg1 (the-as string #f) s5-0))) (when (and s2-0 (or (= arg2 'priority) (= s2-0 arg3) (and arg3 (< (-> arg3 priority) (-> s2-0 priority))))) - (stop-str obj s2-0) + (stop-str this s2-0) (cond ((= (shr (the-as int arg1) 4) 5) - (set! (-> obj times arg1) - (the-as time-frame (max (-> obj times arg1) (+ (-> *display* base-clock frame-counter) (seconds 0.1)))) + (set! (-> this times arg1) + (the-as time-frame (max (-> this times arg1) (+ (-> *display* base-clock frame-counter) (seconds 0.1)))) ) (set! (-> s2-0 action) (gui-action hidden)) ) @@ -1301,15 +1301,15 @@ ) ) ) - (if (nonzero? (get-status obj s5-0)) + (if (nonzero? (get-status this s5-0)) (return #f) ) ) (('hide) - (let ((v1-34 (lookup-gui-connection obj (the-as process #f) arg1 (the-as string #f) s5-0))) + (let ((v1-34 (lookup-gui-connection this (the-as process #f) arg1 (the-as string #f) s5-0))) (when (and v1-34 (!= (-> v1-34 action) 8)) (set-action! - obj + this (gui-action hide) s5-0 (gui-channel none) @@ -1318,18 +1318,18 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj times arg1) - (the-as time-frame (max (-> obj times arg1) (+ (-> *display* base-clock frame-counter) (seconds 0.1)))) + (set! (-> this times arg1) + (the-as time-frame (max (-> this times arg1) (+ (-> *display* base-clock frame-counter) (seconds 0.1)))) ) ) ) - (if (nonzero? (get-status obj s5-0)) + (if (nonzero? (get-status this s5-0)) (return #f) ) ) ) ) - ((< (-> *display* base-clock frame-counter) (-> obj times arg1)) + ((< (-> *display* base-clock frame-counter) (-> this times arg1)) (if (= arg2 'wait) (return #f) ) @@ -1339,15 +1339,15 @@ #t ) -(defmethod handle-command-list gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-connection)) +(defmethod handle-command-list gui-control ((this gui-control) (arg0 gui-channel) (arg1 gui-connection)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int)) (let ((gp-0 #t)) (cond - ((or (not (gui-control-method-18 obj arg0)) (< (-> *display* base-clock frame-counter) (-> obj times arg0))) + ((or (not (gui-control-method-18 this arg0)) (< (-> *display* base-clock frame-counter) (-> this times arg0))) #f ) - ((not (null? (-> obj cmd arg0))) - (let* ((s2-0 (-> obj cmd arg0)) + ((not (null? (-> this cmd arg0))) + (let* ((s2-0 (-> this cmd arg0)) (v1-9 (car s2-0)) ) (while (not (null? s2-0)) @@ -1359,7 +1359,7 @@ (let ((s0-0 80)) (set! sv-16 90) (while (>= (the-as uint sv-16) (the-as uint s0-0)) - (if (not (handle-command obj arg0 (the-as gui-channel s0-0) (the-as symbol s1-0) arg1)) + (if (not (handle-command this arg0 (the-as gui-channel s0-0) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-0 1) @@ -1370,7 +1370,7 @@ (let ((s0-1 66)) (set! sv-32 70) (while (>= (the-as uint sv-32) (the-as uint s0-1)) - (if (not (handle-command obj arg0 (the-as gui-channel s0-1) (the-as symbol s1-0) arg1)) + (if (not (handle-command this arg0 (the-as gui-channel s0-1) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-1 1) @@ -1381,7 +1381,7 @@ (let ((s0-2 18)) (set! sv-48 32) (while (>= (the-as uint sv-48) (the-as uint s0-2)) - (if (not (handle-command obj arg0 (the-as gui-channel s0-2) (the-as symbol s1-0) arg1)) + (if (not (handle-command this arg0 (the-as gui-channel s0-2) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-2 1) @@ -1389,7 +1389,7 @@ ) ) (else - (if (not (handle-command obj arg0 a2-1 (the-as symbol s1-0) arg1)) + (if (not (handle-command this arg0 a2-1 (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) ) @@ -1406,28 +1406,28 @@ ) ;; WARN: Return type mismatch int vs gui-status. -(defmethod get-status gui-control ((obj gui-control) (arg0 sound-id)) +(defmethod get-status gui-control ((this gui-control) (arg0 sound-id)) (let ((gp-0 (the-as gui-connection #f))) (if (zero? arg0) (return (gui-status unknown)) ) - (let ((v1-4 (-> obj engine alive-list next0))) - (-> obj engine) + (let ((v1-4 (-> this engine alive-list next0))) + (-> this engine) (let ((a0-3 (-> v1-4 next0))) - (while (!= v1-4 (-> obj engine alive-list-end)) + (while (!= v1-4 (-> this engine alive-list-end)) (when (= arg0 (-> (the-as gui-connection v1-4) id)) (set! gp-0 (the-as gui-connection v1-4)) (goto cfg-15) ) (set! v1-4 a0-3) - (-> obj engine) + (-> this engine) (set! a0-3 (-> a0-3 next0)) ) ) ) #t (countdown (v1-10 32) - (let ((a0-7 (-> obj connections v1-10))) + (let ((a0-7 (-> this connections v1-10))) (when (= arg0 (-> a0-7 id)) (set! gp-0 a0-7) (goto cfg-15) @@ -1440,10 +1440,10 @@ (cond ((= (-> gp-0 channel) (gui-channel movie)) (cond - ((= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) + ((= (-> gp-0 id) (-> this ids (-> gp-0 channel))) 3 ) - ((handle-command-list obj (-> gp-0 channel) gp-0) + ((handle-command-list this (-> gp-0 channel) gp-0) 2 ) (else @@ -1476,7 +1476,7 @@ ((logtest? (-> *sound-iop-info* stream-status s4-0) (stream-status ststatus-nine)) (return (gui-status stop)) ) - ((or (= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) (handle-command-list obj (-> gp-0 channel) gp-0)) + ((or (= (-> gp-0 id) (-> this ids (-> gp-0 channel))) (handle-command-list this (-> gp-0 channel) gp-0)) (return (gui-status ready)) ) (else @@ -1500,13 +1500,13 @@ ) ((= (shr (the-as int (-> gp-0 channel)) 4) 5) (cond - ((= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) + ((= (-> gp-0 id) (-> this ids (-> gp-0 channel))) (if (or (= (-> gp-0 action) (gui-action hide)) (= (-> gp-0 action) (gui-action hidden))) 4 3 ) ) - ((handle-command-list obj (-> gp-0 channel) gp-0) + ((handle-command-list this (-> gp-0 channel) gp-0) 2 ) (else @@ -1518,10 +1518,10 @@ (case (shr (the-as int (-> gp-0 channel)) 4) ((4 5) (cond - ((= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) + ((= (-> gp-0 id) (-> this ids (-> gp-0 channel))) 3 ) - ((handle-command-list obj (-> gp-0 channel) gp-0) + ((handle-command-list this (-> gp-0 channel) gp-0) 2 ) (else @@ -1539,7 +1539,7 @@ ) ) -(defmethod set-action! gui-control ((obj gui-control) +(defmethod set-action! gui-control ((this gui-control) (arg0 gui-action) (arg1 sound-id) (arg2 gui-channel) @@ -1553,10 +1553,10 @@ (set! sv-17 arg3) (set! sv-20 arg4) (set! sv-24 arg5) - (let ((s1-0 (the-as gui-connection (-> obj engine alive-list next0)))) - (-> obj engine) + (let ((s1-0 (the-as gui-connection (-> this engine alive-list next0)))) + (-> this engine) (let ((s0-0 (-> s1-0 next0))) - (while (!= s1-0 (-> obj engine alive-list-end)) + (while (!= s1-0 (-> this engine alive-list-end)) (when (and (or (= arg1 1) (= arg1 (-> s1-0 id))) (or (= arg2 (gui-channel none)) (= arg2 (-> s1-0 channel))) (or (= sv-17 (gui-action none)) (= sv-17 (-> s1-0 action))) @@ -1565,7 +1565,7 @@ (or (not arg6) (= arg6 (get-process s1-0))) ) (cond - ((and (= sv-16 (gui-action hide)) (!= (-> obj ids (-> s1-0 channel)) (-> s1-0 id))) + ((and (= sv-16 (gui-action hide)) (!= (-> this ids (-> s1-0 channel)) (-> s1-0 id))) (set! (-> s1-0 action) (gui-action hidden)) ) ((and (= sv-16 (gui-action play)) (= (-> s1-0 action) (gui-action playing))) @@ -1573,14 +1573,14 @@ (else (set! (-> s1-0 action) sv-16) ;; og:preserve-this fixed naughty dog bug here. was 'play instead of (gui-action play) - (if (and (= sv-16 (gui-action play)) (handle-command-list obj (-> s1-0 channel) s1-0)) - (channel-id-set! obj s1-0 (-> s1-0 id)) + (if (and (= sv-16 (gui-action play)) (handle-command-list this (-> s1-0 channel) s1-0)) + (channel-id-set! this s1-0 (-> s1-0 id)) ) ) ) ) (set! s1-0 (the-as gui-connection s0-0)) - (-> obj engine) + (-> this engine) (set! s0-0 (-> s0-0 next0)) ) ) @@ -1589,7 +1589,7 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod add-process gui-control ((obj gui-control) +(defmethod add-process gui-control ((this gui-control) (arg0 process) (arg1 gui-channel) (arg2 gui-action) @@ -1606,10 +1606,10 @@ (sv-80 int) ) (set! sv-32 (the-as gui-connection #f)) - (set! sv-48 (the-as gui-connection (-> obj engine alive-list next0))) - (-> obj engine) + (set! sv-48 (the-as gui-connection (-> this engine alive-list next0))) + (-> this engine) (set! sv-64 (the-as gui-connection (-> sv-48 next0))) - (while (!= sv-48 (-> obj engine alive-list-end)) + (while (!= sv-48 (-> this engine alive-list-end)) (when (and (= arg1 (-> (the-as gui-connection sv-48) channel)) (string= arg3 (-> (the-as gui-connection sv-48) name)) (= (get-process sv-48) arg0) @@ -1618,7 +1618,7 @@ (goto cfg-12) ) (set! sv-48 (the-as gui-connection sv-64)) - (-> obj engine) + (-> this engine) (set! sv-64 (the-as gui-connection (-> sv-64 next0))) ) (label cfg-12) @@ -1627,7 +1627,7 @@ (set! sv-80 32) (while (nonzero? sv-80) (set! sv-80 (+ sv-80 -1)) - (set! sv-20 (-> obj connections sv-80)) + (set! sv-20 (-> this connections sv-80)) (if (and (nonzero? (-> sv-20 id)) (= arg1 (-> sv-20 channel)) (string= arg3 (-> sv-20 name)) @@ -1639,7 +1639,7 @@ (if (zero? sv-16) (set! sv-16 (the-as int (new-sound-id))) ) - (set! sv-32 (the-as gui-connection (add-connection (-> obj engine) arg0 arg4 0 arg3 sv-16))) + (set! sv-32 (the-as gui-connection (add-connection (-> this engine) arg0 arg4 0 arg3 sv-16))) sv-32 ) (the-as sound-id (cond @@ -1661,16 +1661,16 @@ ) ) -(defmethod remove-process gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel)) - (let ((s3-0 (the-as gui-connection (-> obj engine alive-list next0)))) - (-> obj engine) +(defmethod remove-process gui-control ((this gui-control) (arg0 process) (arg1 gui-channel)) + (let ((s3-0 (the-as gui-connection (-> this engine alive-list next0)))) + (-> this engine) (let ((s2-0 (-> s3-0 next0))) - (while (!= s3-0 (-> obj engine alive-list-end)) + (while (!= s3-0 (-> this engine alive-list-end)) (if (and (= arg1 (-> s3-0 channel)) (= arg0 (get-process s3-0))) (move-to-dead s3-0) ) (set! s3-0 (the-as gui-connection s2-0)) - (-> obj engine) + (-> this engine) (set! s2-0 (-> s2-0 next0)) ) ) @@ -1680,7 +1680,7 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod gui-control-method-12 gui-control ((obj gui-control) +(defmethod gui-control-method-12 gui-control ((this gui-control) (arg0 process) (arg1 gui-channel) (arg2 gui-action) @@ -1703,7 +1703,7 @@ (set! sv-32 32) (while (nonzero? sv-32) (set! sv-32 (+ sv-32 -1)) - (set! sv-24 (-> obj connections sv-32)) + (set! sv-24 (-> this connections sv-32)) (when (and (nonzero? (-> sv-24 id)) (= arg1 (-> sv-24 channel)) (let ((v1-14 (handle->process (-> sv-24 handle)))) @@ -1713,7 +1713,7 @@ ) ) (when (< (-> sv-24 priority) arg5) - (set! (-> sv-24 time-stamp) (-> obj update-time)) + (set! (-> sv-24 time-stamp) (-> this update-time)) (return (-> sv-24 id)) ) (set! sv-16 sv-24) @@ -1721,7 +1721,7 @@ ) ) (countdown (v1-33 32) - (let ((a0-15 (-> obj connections v1-33))) + (let ((a0-15 (-> this connections v1-33))) (when (or (zero? (-> a0-15 id)) (not (handle->process (-> a0-15 handle)))) (set! sv-16 a0-15) (set! (-> sv-16 param3) 0) @@ -1735,7 +1735,7 @@ (sv-16 (when (zero? (-> (the-as gui-connection sv-16) id)) (when (zero? sv-20) - (let ((v1-46 (lookup-gui-connection obj arg0 arg1 arg3 (new 'static 'sound-id)))) + (let ((v1-46 (lookup-gui-connection this arg0 arg1 arg3 (new 'static 'sound-id)))) (if v1-46 (set! sv-20 (the-as int (-> v1-46 id))) ) @@ -1763,7 +1763,7 @@ ) ) ) - (set! (-> sv-16 time-stamp) (-> obj update-time)) + (set! (-> sv-16 time-stamp) (-> this update-time)) (set! (-> sv-16 handle) (process->handle arg0)) (set! (-> sv-16 priority) arg5) (set! (-> sv-16 channel) arg1) @@ -1780,10 +1780,10 @@ ) ) -(defmethod gui-control-method-21 gui-control ((obj gui-control) (arg0 gui-connection) (arg1 vector)) +(defmethod gui-control-method-21 gui-control ((this gui-control) (arg0 gui-connection) (arg1 vector)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) - (let ((s5-0 (-> obj spool-connections))) + (let ((s5-0 (-> this spool-connections))) (case (-> arg0 action) (((gui-action queue) (gui-action play) (gui-action playing) (gui-action fade)) (let ((f30-0 (-> arg0 priority))) @@ -1795,7 +1795,7 @@ ) ) (set! f30-0 (cond - ((= (-> arg0 id) (-> obj ids (-> arg0 channel))) + ((= (-> arg0 id) (-> this ids (-> arg0 channel))) -1.0 ) (v1-10 @@ -1851,16 +1851,16 @@ 0 ) -(defmethod stop-str gui-control ((obj gui-control) (arg0 gui-connection)) +(defmethod stop-str gui-control ((this gui-control) (arg0 gui-connection)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) - (if (= (get-status obj (-> arg0 id)) (gui-status active)) + (if (= (get-status this (-> arg0 id)) (gui-status active)) (str-play-stop (-> arg0 name) (-> arg0 id)) ) ) ) - (if (= (-> obj ids (-> arg0 channel)) (-> arg0 id)) - (channel-id-set! obj arg0 (new 'static 'sound-id)) + (if (= (-> this ids (-> arg0 channel)) (-> arg0 id)) + (channel-id-set! this arg0 (new 'static 'sound-id)) ) 0 ) @@ -1869,7 +1869,7 @@ (#when PC_PORT (define *gui-kick-str* #f)) -(defmethod gui-control-method-22 gui-control ((obj gui-control) (arg0 gui-connection) (arg1 process) (arg2 symbol)) +(defmethod gui-control-method-22 gui-control ((this gui-control) (arg0 gui-connection) (arg1 process) (arg2 symbol)) (local-vars (v1-66 symbol) (v1-143 symbol)) (with-pp (when (and (>= (the-as uint (-> arg0 channel)) (the-as uint 16)) @@ -1879,7 +1879,7 @@ (((gui-action queue)) (spool-push *art-control* (-> arg0 name) (the-as int (-> arg0 anim-part)) arg1 (-> arg0 priority)) (if (and (logtest? (-> arg0 flags) (gui-connection-flags gcf0)) - (= (get-status obj (-> arg0 id)) (gui-status active)) + (= (get-status this (-> arg0 id)) (gui-status active)) ) (set! (-> arg0 action) (gui-action playing)) ) @@ -1888,20 +1888,20 @@ ) (let ((v1-16 (-> arg0 action))) (b! (!= v1-16 (gui-action play)) cfg-39 :delay (empty-form)) - (if (handle-command-list obj (-> arg0 channel) arg0) - (channel-id-set! obj arg0 (-> arg0 id)) + (if (handle-command-list this (-> arg0 channel) arg0) + (channel-id-set! this arg0 (-> arg0 id)) ) (b! - (not (or (not (gui-control-method-18 obj (-> arg0 channel))) (= (get-status obj (-> arg0 id)) (gui-status stop))) + (not (or (not (gui-control-method-18 this (-> arg0 channel))) (= (get-status this (-> arg0 id)) (gui-status stop))) ) cfg-27 :delay (empty-form) ) - (if (= (-> obj ids (-> arg0 channel)) (-> arg0 id)) - (channel-id-set! obj arg0 (new 'static 'sound-id)) + (if (= (-> this ids (-> arg0 channel)) (-> arg0 id)) + (channel-id-set! this arg0 (new 'static 'sound-id)) ) (if (and arg2 (or (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)) - (= (get-status obj (-> arg0 id)) (gui-status stop)) + (= (get-status this (-> arg0 id)) (gui-status stop)) ) ) (move-to-dead arg0) @@ -1909,9 +1909,9 @@ (b! #t cfg-38 :delay (nop!)) (label cfg-27) (let ((v1-40 (-> arg0 id))) - (b! (!= (-> obj ids (-> arg0 channel)) v1-40) cfg-38 :delay (empty-form)) + (b! (!= (-> this ids (-> arg0 channel)) v1-40) cfg-38 :delay (empty-form)) ) - (let ((v1-43 (get-status obj (-> arg0 id)))) + (let ((v1-43 (get-status this (-> arg0 id)))) (b! (!= v1-43 (gui-status ready)) cfg-36 :delay (empty-form)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) @@ -1931,16 +1931,16 @@ (label cfg-39) (b! (not (or (= v1-16 (gui-action playing)) (= v1-16 (gui-action fade)))) cfg-117 :delay (empty-form)) (b! - (not (and (= (get-status obj (-> arg0 id)) (gui-status active)) - (gui-control-method-18 obj (-> arg0 channel)) + (not (and (= (get-status this (-> arg0 id)) (gui-status active)) + (gui-control-method-18 this (-> arg0 channel)) (or (= (-> arg0 action) (gui-action playing)) (< (-> arg0 fade) (the-as uint 30))) ) ) cfg-106 :delay (nop!) ) - (channel-id-set! obj arg0 (-> arg0 id)) - (set! (-> obj times 0) 0) + (channel-id-set! this arg0 (-> arg0 id)) + (set! (-> this times 0) 0) (let ((v1-64 (shr (the-as int (-> arg0 channel)) 4))) (set! v1-66 (and (or (= v1-64 1) (= v1-64 2)) @@ -2027,15 +2027,15 @@ ) (else (label cfg-106) - (when (= (-> obj ids (-> arg0 channel)) (-> arg0 id)) - (channel-id-set! obj arg0 (new 'static 'sound-id)) - (set! (-> obj times (-> arg0 channel)) (+ (-> *display* base-clock frame-counter) (-> arg0 hold-time))) + (when (= (-> this ids (-> arg0 channel)) (-> arg0 id)) + (channel-id-set! this arg0 (new 'static 'sound-id)) + (set! (-> this times (-> arg0 channel)) (+ (-> *display* base-clock frame-counter) (-> arg0 hold-time))) ) (b! (not arg2) cfg-113 :likely-delay (set! v1-143 arg2)) (let ((a0-75 (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)))) (b! a0-75 cfg-113 :likely-delay (set! v1-143 a0-75)) ) - (set! v1-143 (= (get-status obj (-> arg0 id)) (gui-status stop))) + (set! v1-143 (= (get-status this (-> arg0 id)) (gui-status stop))) (label cfg-113) (if v1-143 (move-to-dead arg0) @@ -2046,7 +2046,7 @@ (b! #t cfg-139 :delay (nop!)) (label cfg-117) (b! (!= v1-16 (gui-action stop)) cfg-121 :delay (empty-form)) - (stop-str obj arg0) + (stop-str this arg0) (if arg2 (move-to-dead arg0) ) @@ -2054,8 +2054,8 @@ (label cfg-121) (cond ((= v1-16 (gui-action abort)) - (if (= (-> obj ids (-> arg0 channel)) (-> arg0 id)) - (channel-id-set! obj arg0 (new 'static 'sound-id)) + (if (= (-> this ids (-> arg0 channel)) (-> arg0 id)) + (channel-id-set! this arg0 (new 'static 'sound-id)) ) (if arg2 (move-to-dead arg0) @@ -2066,16 +2066,16 @@ ((= v1-16 (gui-action hidden)) (cond ((or (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)) - (= (get-status obj (-> arg0 id)) (gui-status stop)) + (= (get-status this (-> arg0 id)) (gui-status stop)) ) - (stop-str obj arg0) + (stop-str this arg0) (if arg2 (move-to-dead arg0) ) ) (else - (if (= (-> obj ids (-> arg0 channel)) (-> arg0 id)) - (channel-id-set! obj arg0 (new 'static 'sound-id)) + (if (= (-> this ids (-> arg0 channel)) (-> arg0 id)) + (channel-id-set! this arg0 (new 'static 'sound-id)) ) ) ) @@ -2088,8 +2088,8 @@ ) ) -(defmethod update gui-control ((obj gui-control) (arg0 symbol)) - (set! (-> obj ids 65) +(defmethod update gui-control ((this gui-control) (arg0 symbol)) + (set! (-> this ids 65) (the-as sound-id (if (and (>= (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) (= (-> *setting-control* user-current bg-a) 0.0) (= (-> *setting-control* user-current bg-a-force) 0.0) @@ -2101,37 +2101,37 @@ ) (let ((s4-0 (target-pos 0))) (dotimes (v1-8 4) - (set! (-> obj spool-connections v1-8 param2) (the-as int #f)) - (set! (-> obj spool-connections v1-8 param3) 0) - (set! (-> obj spool-connections v1-8 priority) 100000000.0) + (set! (-> this spool-connections v1-8 param2) (the-as int #f)) + (set! (-> this spool-connections v1-8 param3) 0) + (set! (-> this spool-connections v1-8 priority) 100000000.0) ) - (let ((s3-0 (the-as gui-connection (-> obj engine alive-list next0)))) - (-> obj engine) + (let ((s3-0 (the-as gui-connection (-> this engine alive-list next0)))) + (-> this engine) (let ((s2-0 (-> s3-0 next0))) - (while (!= s3-0 (-> obj engine alive-list-end)) - (gui-control-method-21 obj s3-0 s4-0) + (while (!= s3-0 (-> this engine alive-list-end)) + (gui-control-method-21 this s3-0 s4-0) (case (-> s3-0 action) (((gui-action playing)) - (channel-id-set! obj s3-0 (-> s3-0 id)) + (channel-id-set! this s3-0 (-> s3-0 id)) ) ) (set! s3-0 (the-as gui-connection s2-0)) - (-> obj engine) + (-> this engine) (set! s2-0 (-> s2-0 next0)) ) ) ) - (let ((s3-1 (-> obj update-time))) + (let ((s3-1 (-> this update-time))) (countdown (s2-1 32) - (let ((s1-0 (-> obj connections s2-1))) + (let ((s1-0 (-> this connections s2-1))) (when (nonzero? (-> s1-0 id)) (cond ((= (-> s1-0 time-stamp) s3-1) - (gui-control-method-21 obj s1-0 s4-0) + (gui-control-method-21 this s1-0 s4-0) ) (else - (if (= (-> obj ids (-> s1-0 channel)) (-> s1-0 id)) - (channel-id-set! obj s1-0 (new 'static 'sound-id)) + (if (= (-> this ids (-> s1-0 channel)) (-> s1-0 id)) + (channel-id-set! this s1-0 (new 'static 'sound-id)) ) (set! (-> s1-0 param3) 0) 0 @@ -2147,37 +2147,37 @@ ) (let ((s2-2 (-> *setting-control* user-current movie-name))) (dotimes (s1-1 4) - (set! (-> s4-1 s1-1) (-> obj spool-connections s1-1 id)) - (when (and (-> obj spool-connections s1-1 name) (case (-> obj spool-connections s1-1 channel) + (set! (-> s4-1 s1-1) (-> this spool-connections s1-1 id)) + (when (and (-> this spool-connections s1-1 name) (case (-> this spool-connections s1-1 channel) (((gui-channel art-load) (gui-channel art-load-next)) #t ) ) ) (set! s3-2 (logior s3-2 (ash 1 s1-1))) - (if (and s2-2 (string= (-> obj spool-connections s1-1 name) (the-as string s2-2))) + (if (and s2-2 (string= (-> this spool-connections s1-1 name) (the-as string s2-2))) (set! s3-2 (logior s3-2 (ash 1 (+ s1-1 4)))) ) ) ) ) (let* ((t9-6 str-play-queue) - (v1-69 (-> obj spool-connections 0 name)) + (v1-69 (-> this spool-connections 0 name)) (a0-32 (if v1-69 v1-69 ) ) - (v1-70 (-> obj spool-connections 1 name)) + (v1-70 (-> this spool-connections 1 name)) (a1-7 (if v1-70 v1-70 ) ) - (v1-71 (-> obj spool-connections 2 name)) + (v1-71 (-> this spool-connections 2 name)) (a2-4 (if v1-71 v1-71 ) ) - (v1-72 (-> obj spool-connections 3 name)) + (v1-72 (-> this spool-connections 3 name)) ) (t9-6 a0-32 @@ -2191,29 +2191,29 @@ ) ) ) - (-> obj engine) - (let ((a0-33 (the-as connection (-> obj engine alive-list-end prev0)))) - (-> obj engine) + (-> this engine) + (let ((a0-33 (the-as connection (-> this engine alive-list-end prev0)))) + (-> this engine) (let ((s4-2 (-> a0-33 prev0))) - (while (!= a0-33 (-> obj engine alive-list)) - (gui-control-method-22 obj (the-as gui-connection a0-33) (get-process a0-33) #t) + (while (!= a0-33 (-> this engine alive-list)) + (gui-control-method-22 this (the-as gui-connection a0-33) (get-process a0-33) #t) (set! a0-33 (the-as connection s4-2)) - (-> obj engine) + (-> this engine) (set! s4-2 (-> s4-2 prev0)) ) ) ) (countdown (s4-3 32) - (let ((v1-91 (-> obj connections s4-3))) + (let ((v1-91 (-> this connections s4-3))) (if (nonzero? (-> v1-91 id)) - (gui-control-method-22 obj v1-91 (handle->process (-> v1-91 handle)) #f) + (gui-control-method-22 this v1-91 (handle->process (-> v1-91 handle)) #f) ) ) ) (when arg0 (when *display-art-control* (dotimes (s5-1 4) - (let ((a3-4 (-> obj spool-connections s5-1))) + (let ((a3-4 (-> this spool-connections s5-1))) (if (-> a3-4 name) (format *stdcon* "~D: ~`gui-connection`P~%" s5-1 a3-4) ) @@ -2232,20 +2232,20 @@ ) ) (when *display-gui-control* - (-> obj engine) - (let ((a2-12 (-> obj engine alive-list-end prev0))) - (-> obj engine) + (-> this engine) + (let ((a2-12 (-> this engine alive-list-end prev0))) + (-> this engine) (let ((s5-3 (-> a2-12 prev0))) - (while (!= a2-12 (-> obj engine alive-list)) + (while (!= a2-12 (-> this engine alive-list)) (format *stdcon* "c: ~`gui-connection`P~%" a2-12) (set! a2-12 s5-3) - (-> obj engine) + (-> this engine) (set! s5-3 (-> s5-3 prev0)) ) ) ) (countdown (s5-4 32) - (let ((a2-13 (-> obj connections s5-4))) + (let ((a2-13 (-> this connections s5-4))) (if (nonzero? (-> a2-13 id)) (format *stdcon* "l: ~`gui-connection`P~%" a2-13) ) @@ -2253,7 +2253,7 @@ ) ) ) - (set! (-> obj update-time) (-> *display* base-clock frame-counter)) + (set! (-> this update-time) (-> *display* base-clock frame-counter)) 0 ) diff --git a/goal_src/jak2/engine/load/ramdisk.gc b/goal_src/jak2/engine/load/ramdisk.gc index 2eb804f0fc..90e5372f59 100644 --- a/goal_src/jak2/engine/load/ramdisk.gc +++ b/goal_src/jak2/engine/load/ramdisk.gc @@ -18,6 +18,7 @@ :flag-assert #x900000020 ) + (deftype ramdisk-rpc-load (structure) ((rsvd int32 :offset-assert 0) (ee-id int32 :offset-assert 4) @@ -29,6 +30,7 @@ :flag-assert #x900000010 ) + (deftype ramdisk-rpc-load-to-ee (structure) ((rsvd int32 :offset-assert 0) (addr int32 :offset-assert 4) @@ -41,6 +43,7 @@ :flag-assert #x900000020 ) + (define *ramdisk-rpc* (new 'global 'rpc-buffer-pair (the-as uint 32) (the-as uint 1) 2)) (define *current-ramdisk-id* 0) @@ -60,4 +63,3 @@ 0 (none) ) - diff --git a/goal_src/jak2/engine/math/matrix.gc b/goal_src/jak2/engine/math/matrix.gc index d2389a2ee6..1095544dba 100644 --- a/goal_src/jak2/engine/math/matrix.gc +++ b/goal_src/jak2/engine/math/matrix.gc @@ -36,22 +36,22 @@ allowed to be the same memory. ;; DECOMP BEGINS -(defmethod inspect matrix ((obj matrix)) - (format #t "[~8x] matrix~%" obj) - (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj data 0) (-> obj data 1) (-> obj data 2) (-> obj data 3)) - (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj data 4) (-> obj data 5) (-> obj data 6) (-> obj data 7)) - (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj data 8) (-> obj data 9) (-> obj data 10) (-> obj data 11)) - (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) - obj +(defmethod inspect matrix ((this matrix)) + (format #t "[~8x] matrix~%" this) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this data 0) (-> this data 1) (-> this data 2) (-> this data 3)) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this data 4) (-> this data 5) (-> this data 6) (-> this data 7)) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this data 8) (-> this data 9) (-> this data 10) (-> this data 11)) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) + this ) -(defmethod inspect matrix3 ((obj matrix3)) +(defmethod inspect matrix3 ((this matrix3)) "Print out the values in a 3x3 matrix." - (format #t "[~8x] matrix3~%" obj) - (format #t "~T[~F] [~F] [~F]~%" (-> obj data 0) (-> obj data 1) (-> obj data 2)) - (format #t "~T[~F] [~F] [~F]~%" (-> obj data 4) (-> obj data 5) (-> obj data 6)) - (format #t "~T[~F] [~F] [~F]~%" (-> obj data 8) (-> obj data 9) (-> obj data 10)) - obj + (format #t "[~8x] matrix3~%" this) + (format #t "~T[~F] [~F] [~F]~%" (-> this data 0) (-> this data 1) (-> this data 2)) + (format #t "~T[~F] [~F] [~F]~%" (-> this data 4) (-> this data 5) (-> this data 6)) + (format #t "~T[~F] [~F] [~F]~%" (-> this data 8) (-> this data 9) (-> this data 10)) + this ) (defun matrix-identity! ((arg0 matrix)) @@ -1716,7 +1716,7 @@ allowed to be the same memory. ) ) -(defmethod transform-vectors! matrix ((obj _type_) (dst (inline-array vector)) (src (inline-array vector)) (count int)) +(defmethod transform-vectors! matrix ((this _type_) (dst (inline-array vector)) (src (inline-array vector)) (count int)) "Transform many vectors. This acts like w = 1, even if it isn't. The value of w is copied." (rlet ((vf0 :class vf) (vf1 :class vf) @@ -1736,16 +1736,16 @@ allowed to be the same memory. (when-goto (<= count 0) end) ;; lqc2 vf1, 0(a0) - (.lvf vf1 (-> obj vector 0)) + (.lvf vf1 (-> this vector 0)) ;; lqc2 vf2, 16(a0) - (.lvf vf2 (-> obj vector 1)) + (.lvf vf2 (-> this vector 1)) ;; lqc2 vf3, 32(a0) - (.lvf vf3 (-> obj vector 2)) + (.lvf vf3 (-> this vector 2)) ;; lqc2 vf4, 48(a0) - (.lvf vf4 (-> obj vector 3)) + (.lvf vf4 (-> this vector 3)) ;; lqc2 vf5, 0(a2) (.lvf vf5 (-> src 0)) diff --git a/goal_src/jak2/engine/math/quaternion.gc b/goal_src/jak2/engine/math/quaternion.gc index a40804c41e..a8ed57f1ea 100644 --- a/goal_src/jak2/engine/math/quaternion.gc +++ b/goal_src/jak2/engine/math/quaternion.gc @@ -7,17 +7,17 @@ ;; DECOMP BEGINS -(defmethod inspect quaternion ((obj quaternion)) +(defmethod inspect quaternion ((this quaternion)) "Print a quaternion. Prints the values and axis-angle" - (format #t "[~8x] quaternion~%" obj) - (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj x) (-> obj y) (-> obj z) (-> obj w)) - (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> obj x) (-> obj x)) (* (-> obj y) (-> obj y)) (* (-> obj z) (-> obj z))))))) - (format #t "~Taxis: ~F ~F ~F" (* f0-5 (-> obj x)) (* f0-5 (-> obj y)) (* f0-5 (-> obj z))) + (format #t "[~8x] quaternion~%" this) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) + (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> this x) (-> this x)) (* (-> this y) (-> this y)) (* (-> this z) (-> this z))))))) + (format #t "~Taxis: ~F ~F ~F" (* f0-5 (-> this x)) (* f0-5 (-> this y)) (* f0-5 (-> this z))) ) - (let ((f0-9 (* 2.0 (acos (-> obj w))))) + (let ((f0-9 (* 2.0 (acos (-> this w))))) (format #t "~T~Tangle: (deg ~R)~%" f0-9) ) - obj + this ) (defun quaternion-axis-angle! ((arg0 quaternion) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) diff --git a/goal_src/jak2/engine/math/transform.gc b/goal_src/jak2/engine/math/transform.gc index 9c470b19bb..55ce6103f3 100644 --- a/goal_src/jak2/engine/math/transform.gc +++ b/goal_src/jak2/engine/math/transform.gc @@ -7,13 +7,13 @@ ;; DECOMP BEGINS -(defmethod print transform ((obj transform)) +(defmethod print transform ((this transform)) "Print a transform." - (format #t "# obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) - (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> obj rot x) (-> obj rot y) (-> obj rot z) (-> obj rot w)) - (format #t "~T~Tscale:~F ~F ~F ~F>" (-> obj scale x) (-> obj scale y) (-> obj scale z) (-> obj scale w)) - obj + (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) + (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> this rot x) (-> this rot y) (-> this rot z) (-> this rot w)) + (format #t "~T~Tscale:~F ~F ~F ~F>" (-> this scale x) (-> this scale y) (-> this scale z) (-> this scale w)) + this ) (defmethod new trs ((allocation symbol) (type-to-make type)) diff --git a/goal_src/jak2/engine/math/transformq-h.gc b/goal_src/jak2/engine/math/transformq-h.gc index 393be4cf03..f3ff19e780 100644 --- a/goal_src/jak2/engine/math/transformq-h.gc +++ b/goal_src/jak2/engine/math/transformq-h.gc @@ -78,13 +78,13 @@ ) ) -(defmethod global-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) +(defmethod global-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) "Get the angle in the xz plane from the position of this trsqv to the point arg0. (ignores our current yaw)" - (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans))) + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) ) -(defmethod relative-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) +(defmethod relative-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) "Get the y angle between the current orientation and arg0. (how much we'd have to yaw to point at arg0)" - (deg-diff (y-angle obj) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)))) + (deg-diff (y-angle this) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))) ) diff --git a/goal_src/jak2/engine/math/transformq.gc b/goal_src/jak2/engine/math/transformq.gc index 9c58f0579d..4f59a56ae2 100644 --- a/goal_src/jak2/engine/math/transformq.gc +++ b/goal_src/jak2/engine/math/transformq.gc @@ -7,52 +7,52 @@ ;; DECOMP BEGINS -(defmethod print transformq ((obj transformq)) +(defmethod print transformq ((this transformq)) "Print a transformq" - (format #t "# obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) - (format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> obj quat x) (-> obj quat y) (-> obj quat z) (-> obj quat w)) - (format #t "~T~Tscale:~F ~F ~F ~F>" (-> obj scale x) (-> obj scale y) (-> obj scale z) (-> obj scale w)) - obj + (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) + (format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> this quat x) (-> this quat y) (-> this quat z) (-> this quat w)) + (format #t "~T~Tscale:~F ~F ~F ~F>" (-> this scale x) (-> this scale y) (-> this scale z) (-> this scale w)) + this ) -(defmethod get-quaternion trsqv ((obj trsqv)) +(defmethod get-quaternion trsqv ((this trsqv)) "Get the rotation as a quaternion." - (-> obj quat) + (-> this quat) ) -(defmethod set-quaternion! trsqv ((obj trsqv) (arg0 quaternion)) +(defmethod set-quaternion! trsqv ((this trsqv) (arg0 quaternion)) "Set the rotation as a quaternion" - (quaternion-copy! (get-quaternion obj) arg0) + (quaternion-copy! (get-quaternion this) arg0) ) -(defmethod rot->dir-targ! trsqv ((obj trsqv)) +(defmethod rot->dir-targ! trsqv ((this trsqv)) "Set the dir-targ to our current orientation" - (quaternion-copy! (-> obj dir-targ) (get-quaternion obj)) + (quaternion-copy! (-> this dir-targ) (get-quaternion this)) ) -(defmethod y-angle trsqv ((obj trsqv)) +(defmethod y-angle trsqv ((this trsqv)) "Get our current y-angle (y is up, so yaw)" - (quaternion-y-angle (get-quaternion obj)) + (quaternion-y-angle (get-quaternion this)) ) -(defmethod seek-toward-heading-vec! trsqv ((obj trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) +(defmethod seek-toward-heading-vec! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) "Adjust the orientation to point along dir, only changing our yaw. The vel is a maximum velocity limit. The frame count is the time constant (first order). There's some logic to avoid rapidly changing directions" - (let* ((f0-0 (deg-diff (quaternion-y-angle (-> obj quat)) (vector-y-angle arg0))) + (let* ((f0-0 (deg-diff (quaternion-y-angle (-> this quat)) (vector-y-angle arg0))) (f1-2 (fmin (* arg1 (seconds-per-frame)) (/ (* 5.0 (fabs f0-0)) (the float arg2)))) (f30-0 (fmax (fmin f0-0 f1-2) (- f1-2))) ) - (let ((f0-2 (-> obj old-y-angle-diff))) + (let ((f0-2 (-> this old-y-angle-diff))) (set! f30-0 (cond ((or (= f0-2 0.0) (and (< 0.0 f30-0) (< 0.0 f0-2)) - (or (and (< f30-0 0.0) (< f0-2 0.0)) (>= (- (current-time) (-> obj angle-change-time)) (seconds 0.2))) + (or (and (< f30-0 0.0) (< f0-2 0.0)) (>= (- (current-time) (-> this angle-change-time)) (seconds 0.2))) ) - (set! (-> obj angle-change-time) (current-time)) + (set! (-> this angle-change-time) (current-time)) f30-0 ) (else @@ -61,16 +61,16 @@ ) ) ) - (set! (-> obj old-y-angle-diff) f30-0) - (let ((a1-2 (get-quaternion obj))) + (set! (-> this old-y-angle-diff) f30-0) + (let ((a1-2 (get-quaternion this))) (quaternion-rotate-y! a1-2 a1-2 f30-0) ) ) ) -(defmethod set-heading-vec! trsqv ((obj trsqv) (arg0 vector)) +(defmethod set-heading-vec! trsqv ((this trsqv) (arg0 vector)) "Makes us look in the arg0 direction immediately. Pitch will be unchanged." - (let ((s3-0 (get-quaternion obj))) + (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) @@ -79,56 +79,56 @@ ) ) -(defmethod seek-to-point-toward-point! trsqv ((obj trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) +(defmethod seek-to-point-toward-point! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) "Seek toward pointing toward arg0 from our current location." - (seek-toward-heading-vec! obj (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) arg1 arg2) + (seek-toward-heading-vec! this (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) arg1 arg2) ) -(defmethod point-toward-point! trsqv ((obj trsqv) (arg0 vector)) +(defmethod point-toward-point! trsqv ((this trsqv) (arg0 vector)) "Immediately point toward arg0" - (let ((s3-0 (get-quaternion obj))) + (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0) ) ) ) -(defmethod seek-toward-yaw-angle! trsqv ((obj trsqv) (arg0 float) (arg1 float) (arg2 time-frame)) +(defmethod seek-toward-yaw-angle! trsqv ((this trsqv) (arg0 float) (arg1 float) (arg2 time-frame)) "Seek toward the given yaw angle." - (let ((s3-0 (method-of-object obj seek-toward-heading-vec!)) + (let ((s3-0 (method-of-object this seek-toward-heading-vec!)) (s2-0 (new 'stack-no-clear 'vector)) ) (set! (-> s2-0 x) (sin arg0)) (set! (-> s2-0 y) 0.0) (set! (-> s2-0 z) (cos arg0)) (set! (-> s2-0 w) 1.0) - (s3-0 obj s2-0 arg1 arg2) + (s3-0 this s2-0 arg1 arg2) ) ) -(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((obj trsqv) (arg0 float)) +(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((this trsqv) (arg0 float)) "Immediately clear our roll and pitch and set yaw to the given angle" - (let ((s5-0 (method-of-object obj set-heading-vec-clear-roll-pitch!)) + (let ((s5-0 (method-of-object this set-heading-vec-clear-roll-pitch!)) (s4-0 (new 'stack-no-clear 'vector)) ) (set! (-> s4-0 x) (sin arg0)) (set! (-> s4-0 y) 0.0) (set! (-> s4-0 z) (cos arg0)) (set! (-> s4-0 w) 1.0) - (s5-0 obj s4-0) + (s5-0 this s4-0) ) ) -(defmethod set-roll-to-grav! trsqv ((obj trsqv) (arg0 float)) +(defmethod set-roll-to-grav! trsqv ((this trsqv) (arg0 float)) "Set our roll so that our local down aligns with standard gravity" - (set-roll-to-grav-2! obj arg0) + (set-roll-to-grav-2! this arg0) ) -(defmethod set-roll-to-grav-2! trsqv ((obj trsqv) (arg0 float)) +(defmethod set-roll-to-grav-2! trsqv ((this trsqv) (arg0 float)) "Set our roll so that our local down aligns with standard gravity" - (let* ((s5-0 (get-quaternion obj)) + (let* ((s5-0 (get-quaternion this)) (s1-0 (-> *standard-dynamics* gravity-normal)) (s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) s5-0)) ) @@ -143,9 +143,9 @@ ) ) -(defmethod roll-relative-to-gravity trsqv ((obj trsqv)) +(defmethod roll-relative-to-gravity trsqv ((this trsqv)) "Get our roll, relative to 'down' from gravity" - (let* ((s5-0 (get-quaternion obj)) + (let* ((s5-0 (get-quaternion this)) (gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) s5-0)) (s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0)) (a1-2 (-> *standard-dynamics* gravity-normal)) @@ -159,7 +159,7 @@ ) ) -(defmethod rotate-toward-orientation! trsqv ((obj trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float)) +(defmethod rotate-toward-orientation! trsqv ((this trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float)) "Adjust our orientation toward target, subject to some rate limits. For jak 1, I said: I don't think this is a very robust function and probably doesn't work right in cases @@ -177,7 +177,7 @@ ) (set! sv-240 arg4) (let ((s2-0 arg5) - (s5-0 (get-quaternion obj)) + (s5-0 (get-quaternion this)) ) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (when (< 0.0 arg2) @@ -233,20 +233,20 @@ ) ) -(defmethod set-heading-vec-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector)) +(defmethod set-heading-vec-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) "Set our rotation to point along the given heading, with no roll or pitch." (forward-up->quaternion - (get-quaternion obj) + (get-quaternion this) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) (new 'static 'vector :y 1.0 :w 1.0) ) ) -(defmethod point-toward-point-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector)) +(defmethod point-toward-point-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) "Set our orientation to point toward arg0, clearing roll and pitch" (forward-up->quaternion - (get-quaternion obj) - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0) + (get-quaternion this) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) (new 'static 'vector :y 1.0 :w 1.0) ) ) diff --git a/goal_src/jak2/engine/nav/nav-control.gc b/goal_src/jak2/engine/nav/nav-control.gc index e801b5aa3a..ac474c7a76 100644 --- a/goal_src/jak2/engine/nav/nav-control.gc +++ b/goal_src/jak2/engine/nav/nav-control.gc @@ -27,160 +27,161 @@ (none) ) -(defmethod relocate nav-control ((obj nav-control) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj shape) arg0) - obj +(defmethod relocate nav-control ((this nav-control) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this shape) arg0) + this ) -(defmethod remove! nav-control ((obj nav-control)) +(defmethod remove! nav-control ((this nav-control)) "Remove this nav-control from the nav-mesh it belongs to." - (remove-nav-control (-> obj state mesh) obj) + (remove-nav-control (-> this state mesh) this) 0 (none) ) -(defmethod enable-extra-sphere! nav-control ((obj nav-control)) +(defmethod enable-extra-sphere! nav-control ((this nav-control)) "Sets a flag indicating that this nav-control has an extra-nav-sphere." - (logior! (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + (logior! (-> this shape nav-flags) (nav-flags has-extra-sphere)) 0 (none) ) -(defmethod disable-extra-sphere! nav-control ((obj nav-control)) +(defmethod disable-extra-sphere! nav-control ((this nav-control)) "Clears a flag indicating that this nav-control has an extra-nav-sphere." - (logclear! (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + (logclear! (-> this shape nav-flags) (nav-flags has-extra-sphere)) 0 (none) ) -(defmethod copy-extra-nav-sphere! nav-control ((obj nav-control) (arg0 sphere)) +(defmethod copy-extra-nav-sphere! nav-control ((this nav-control) (arg0 sphere)) "Copies the given [[sphere]] into `extra-nav-sphere`" - (mem-copy! (the-as pointer (-> obj extra-nav-sphere)) (the-as pointer arg0) 16) + (mem-copy! (the-as pointer (-> this extra-nav-sphere)) (the-as pointer arg0) 16) 0 (none) ) -(defmethod set-extra-nav-sphere-xyz! nav-control ((obj nav-control) (arg0 sphere)) +(defmethod set-extra-nav-sphere-xyz! nav-control ((this nav-control) (arg0 sphere)) "Set the `extra-nav-sphere` with the data in the given [[sphere]]" - (let ((f0-0 (-> obj extra-nav-sphere w))) - (set! (-> obj extra-nav-sphere quad) (-> arg0 quad)) - (set! (-> obj extra-nav-sphere w) f0-0) + (let ((f0-0 (-> this extra-nav-sphere w))) + (set! (-> this extra-nav-sphere quad) (-> arg0 quad)) + (set! (-> this extra-nav-sphere w) f0-0) ) 0 (none) ) -(defmethod set-extra-nav-sphere-radius! nav-control ((obj nav-control) (arg0 float)) +(defmethod set-extra-nav-sphere-radius! nav-control ((this nav-control) (arg0 float)) "Set's `extra-nav-sphere`'s radius" - (set! (-> obj extra-nav-sphere w) arg0) + (set! (-> this extra-nav-sphere w) arg0) 0 (none) ) -(defmethod set-nearest-y-thres! nav-control ((obj nav-control) (arg0 float)) +(defmethod set-nearest-y-thres! nav-control ((this nav-control) (arg0 float)) "Set `nearest-y-threshold`" - (set! (-> obj nearest-y-threshold) arg0) + (set! (-> this nearest-y-threshold) arg0) 0 (none) ) -(defmethod set-nav-cull-radius! nav-control ((obj nav-control) (arg0 meters)) +(defmethod set-nav-cull-radius! nav-control ((this nav-control) (arg0 meters)) "Set `nav-cull-radius`" - (set! (-> obj nav-cull-radius) arg0) + (set! (-> this nav-cull-radius) arg0) 0 (none) ) -(defmethod set-speed-scale! nav-control ((obj nav-control) (arg0 float)) +(defmethod set-speed-scale! nav-control ((this nav-control) (arg0 float)) "Set `speed-scale`" - (set! (-> obj speed-scale) arg0) + (set! (-> this speed-scale) arg0) 0 (none) ) -(defmethod set-target-speed! nav-control ((obj nav-control) (arg0 meters)) +(defmethod set-target-speed! nav-control ((this nav-control) (arg0 meters)) "Set `target-speed`" - (set! (-> obj target-speed) arg0) + (set! (-> this target-speed) arg0) 0 (none) ) -(defmethod get-target-speed nav-control ((obj nav-control)) - (-> obj target-speed) +(defmethod get-target-speed nav-control ((this nav-control)) + (-> this target-speed) ) -(defmethod set-acceleration! nav-control ((obj nav-control) (arg0 meters)) +(defmethod set-acceleration! nav-control ((this nav-control) (arg0 meters)) "Set `acceleration`" - (set! (-> obj acceleration) arg0) + (set! (-> this acceleration) arg0) 0 (none) ) -(defmethod set-turning-acceleration! nav-control ((obj nav-control) (arg0 meters)) +(defmethod set-turning-acceleration! nav-control ((this nav-control) (arg0 meters)) "Set `turning-acceleration`" - (set! (-> obj turning-acceleration) arg0) + (set! (-> this turning-acceleration) arg0) 0 (none) ) -(defmethod set-max-rotation-rate! nav-control ((obj nav-control) (arg0 float)) +(defmethod set-max-rotation-rate! nav-control ((this nav-control) (arg0 float)) "Set `max-rotation-rate`" - (set! (-> obj max-rotation-rate) arg0) + (set! (-> this max-rotation-rate) arg0) 0 (none) ) -(defmethod get-max-rotation-rate nav-control ((obj nav-control)) - (-> obj max-rotation-rate) +(defmethod get-max-rotation-rate nav-control ((this nav-control)) + (-> this max-rotation-rate) ) -(defmethod set-sphere-mask! nav-control ((obj nav-control) (arg0 uint)) +(defmethod set-sphere-mask! nav-control ((this nav-control) (arg0 uint)) "TODO - probably an enum - Set `sphere-mask`" - (set! (-> obj sphere-mask) arg0) + (set! (-> this sphere-mask) arg0) 0 (none) ) -(defmethod get-sphere-mask nav-control ((obj nav-control)) - (-> obj sphere-mask) +(defmethod get-sphere-mask nav-control ((this nav-control)) + (-> this sphere-mask) ) -(defmethod point-in-bsphere? nav-control ((obj nav-control) (arg0 vector)) +(defmethod point-in-bsphere? nav-control ((this nav-control) (arg0 vector)) "Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius" - (let ((v1-1 (-> obj state mesh bounds))) + (let ((v1-1 (-> this state mesh bounds))) (>= (-> v1-1 w) (vector-vector-distance arg0 v1-1)) ) ) -(defmethod display-marks? nav-control ((obj nav-control)) +(defmethod display-marks? nav-control ((this nav-control)) "Returns if navigation related marks should be displayed" - (and *display-nav-marks* (logtest? (-> obj flags) (nav-control-flag display-marks))) + (and *display-nav-marks* (logtest? (-> this flags) (nav-control-flag display-marks))) ) -(defmethod init! nav-control ((obj nav-control) (arg0 collide-shape)) +(defmethod init! nav-control ((this nav-control) (arg0 collide-shape)) "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" - (set! (-> obj callback-info) #f) - (logior! (-> obj flags) (nav-control-flag update-heading-from-facing output-sphere-hash)) - (let ((v1-2 obj)) + (set! (-> this callback-info) #f) + (logior! (-> this flags) (nav-control-flag update-heading-from-facing output-sphere-hash)) + (let ((v1-2 this)) (set! (-> v1-2 sphere-mask) (the-as uint #x800f8)) ) 0 - (set! (-> obj sphere-count) 0) - (set! (-> obj sphere-array) (the-as (inline-array sphere) #f)) - (set! (-> obj shape) arg0) - (set! (-> obj process) (-> arg0 process)) - (set! (-> obj speed-scale) 1.0) - (set! (-> obj acceleration) 4096.0) - (set! (-> obj turning-acceleration) 4096.0) - (set! (-> obj max-rotation-rate) 131072.0) - (set! (-> obj target-speed) 0.0) - (set! (-> obj nav-cull-radius) 40960.0) - (reset! (-> obj state) obj) + (set! (-> this sphere-count) 0) + (set! (-> this sphere-array) (the-as (inline-array sphere) #f)) + (set! (-> this shape) arg0) + (set! (-> this process) (-> arg0 process)) + (set! (-> this speed-scale) 1.0) + (set! (-> this acceleration) 4096.0) + (set! (-> this turning-acceleration) 4096.0) + (set! (-> this max-rotation-rate) 131072.0) + (set! (-> this target-speed) 0.0) + (set! (-> this nav-cull-radius) 40960.0) + (reset! (-> this state) this) 0 (none) ) +;; WARN: Return type mismatch object vs none. ;; WARN: Function get-nav-control has a return type of none, but the expression builder found a return statement. (defun get-nav-control ((arg0 process-drawable) (arg1 nav-mesh)) "Given a [[process-drawable]] get the associated [[nav-control]] using either: @@ -202,73 +203,73 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod find-nearest-poly-to-point nav-control ((obj nav-control) (arg0 vector)) +(defmethod find-nearest-poly-to-point nav-control ((this nav-control) (arg0 vector)) "Find the nav-poly closest to this point in the nav-mesh." (let ((gp-0 (new 'stack 'nav-find-poly-parms))) - (vector-! (-> gp-0 point) arg0 (-> obj state mesh bounds)) - (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> gp-0 point) arg0 (-> this state mesh bounds)) + (set! (-> gp-0 y-threshold) (-> this nearest-y-threshold)) (set! (-> gp-0 ignore) (the-as uint 2)) - (find-nearest-poly-to-point-local (-> obj state mesh) gp-0) + (find-nearest-poly-to-point-local (-> this state mesh) gp-0) (-> gp-0 poly) ) ) -(defmethod project-point-onto-plane-of-poly nav-control ((obj nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod project-point-onto-plane-of-poly nav-control ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) "Move a point to the be on the plane containing the given nav-poly. Return the normal too" (project-point-onto-plane-of-poly-local - (-> obj state mesh) + (-> this state mesh) arg0 arg1 arg2 - (vector-! (new 'stack-no-clear 'vector) arg3 (-> obj state mesh bounds)) + (vector-! (new 'stack-no-clear 'vector) arg3 (-> this state mesh bounds)) ) - (vector+! arg1 arg1 (-> obj state mesh bounds)) + (vector+! arg1 arg1 (-> this state mesh bounds)) 0 (none) ) -(defmethod is-in-mesh? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) +(defmethod is-in-mesh? nav-control ((this nav-control) (arg0 vector) (arg1 float)) "Is this point in the mesh?" (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj state mesh bounds)) - (let ((a1-1 (-> obj state mesh))) - (is-in-mesh-local? a1-1 v1-0 arg1 (-> obj nearest-y-threshold)) + (vector-! v1-0 arg0 (-> this state mesh bounds)) + (let ((a1-1 (-> this state mesh))) + (is-in-mesh-local? a1-1 v1-0 arg1 (-> this nearest-y-threshold)) ) ) ) -(defmethod debug-draw nav-control ((obj nav-control)) +(defmethod debug-draw nav-control ((this nav-control)) (local-vars (sv-32 nav-mesh) (sv-36 vector)) - (when (display-marks? obj) - (debug-draw (-> obj state mesh)) - (set! sv-32 (-> obj state mesh)) + (when (display-marks? this) + (debug-draw (-> this state mesh)) + (set! sv-32 (-> this state mesh)) (set! sv-36 (new 'stack-no-clear 'vector)) - (if (logtest? (-> obj shape nav-flags) (nav-flags has-root-sphere)) + (if (logtest? (-> this shape nav-flags) (nav-flags has-root-sphere)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj root-nav-sphere) - (-> obj root-nav-sphere w) + (-> this root-nav-sphere) + (-> this root-nav-sphere w) (new 'static 'rgba :g #xff :b #xff :a #x20) ) ) - (if (logtest? (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + (if (logtest? (-> this shape nav-flags) (nav-flags has-extra-sphere)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj extra-nav-sphere) - (-> obj extra-nav-sphere w) + (-> this extra-nav-sphere) + (-> this extra-nav-sphere w) (new 'static 'rgba :g #xff :b #xff :a #x20) ) ) - (dotimes (s5-0 (-> obj sphere-count)) - (let ((v1-19 (-> obj state mesh work debug sphere-array s5-0))) + (dotimes (s5-0 (-> this sphere-count)) + (let ((v1-19 (-> this state mesh work debug sphere-array s5-0))) (vector+! sv-36 (-> sv-32 bounds) (the-as vector v1-19)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) sv-36 - (- (-> v1-19 r) (-> obj shape nav-radius)) + (- (-> v1-19 r) (-> this shape nav-radius)) (new 'static 'rgba :g #xff :b #xff :a #x20) ) ) @@ -278,59 +279,59 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (add-debug-sphere #t (bucket-id debug2) s4-0 (-> s4-0 r) *color-blue*) (let ((s3-0 add-debug-text-3d) (s2-0 #t) - (s1-0 (bucket-id debug-no-zbuf1)) + (s1-0 318) ) (format (clear *temp-string*) "~D" s5-1) (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* s4-0 (font-color cyan) (the-as vector2h #f)) ) ) ) - (debug-draw (-> obj state)) + (debug-draw (-> this state)) ) 0 (none) ) -(defmethod find-poly-containing-point-1 nav-control ((obj nav-control) (arg0 vector)) +(defmethod find-poly-containing-point-1 nav-control ((this nav-control) (arg0 vector)) "Find nav-poly containing this point." (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) - (vector-! (-> v1-0 point) arg0 (-> obj state mesh bounds)) - (set! (-> v1-0 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> v1-0 point) arg0 (-> this state mesh bounds)) + (set! (-> v1-0 y-threshold) (-> this nearest-y-threshold)) (set! (-> v1-0 ignore) (the-as uint 2)) - (find-poly-containing-point-local (-> obj state mesh) v1-0) + (find-poly-containing-point-local (-> this state mesh) v1-0) ) ) -(defmethod find-poly-containing-point-2 nav-control ((obj nav-control) (arg0 vector)) +(defmethod find-poly-containing-point-2 nav-control ((this nav-control) (arg0 vector)) "Find nav-poly containing this point - same as 1" (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) - (vector-! (-> v1-0 point) arg0 (-> obj state mesh bounds)) - (set! (-> v1-0 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> v1-0 point) arg0 (-> this state mesh bounds)) + (set! (-> v1-0 y-threshold) (-> this nearest-y-threshold)) (set! (-> v1-0 ignore) (the-as uint 2)) - (find-poly-containing-point-local (-> obj state mesh) v1-0) + (find-poly-containing-point-local (-> this state mesh) v1-0) ) ) ;; WARN: Return type mismatch object vs symbol. -(defmethod is-above-poly-max-height? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) +(defmethod is-above-poly-max-height? nav-control ((this nav-control) (arg0 vector) (arg1 float)) "Is the point in a poly, and lower than a max height?" (let ((a1-1 (new 'stack-no-clear 'nav-find-poly-parms))) - (vector-! (-> a1-1 point) arg0 (-> obj state mesh bounds)) - (set! (-> a1-1 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> a1-1 point) arg0 (-> this state mesh bounds)) + (set! (-> a1-1 y-threshold) (-> this nearest-y-threshold)) (set! (-> a1-1 ignore) (the-as uint 2)) - (the-as symbol (and (find-poly-containing-point-local (-> obj state mesh) a1-1) - (< (-> arg0 y) (+ (-> obj state mesh bounds y) arg1)) + (the-as symbol (and (find-poly-containing-point-local (-> this state mesh) a1-1) + (< (-> arg0 y) (+ (-> this state mesh bounds y) arg1)) ) ) ) ) -(defmethod find-first-sphere-intersecting-ray nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod find-first-sphere-intersecting-ray nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) "Find the first sphere that this ray intersects" (let ((s5-0 (the-as sphere #f))) (let ((f30-0 -0.000001)) - (countdown (s1-0 (-> obj sphere-count)) - (let* ((s0-0 (-> obj sphere-array s1-0)) + (countdown (s1-0 (-> this sphere-count)) + (let* ((s0-0 (-> this sphere-array s1-0)) (f0-1 (ray-circle-intersect arg0 arg1 s0-0 (-> s0-0 r))) ) (when (< f30-0 f0-1) @@ -463,33 +464,33 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod find-sphere-ids-from-sphere-hash nav-control ((obj nav-control) (arg0 symbol)) +(defmethod find-sphere-ids-from-sphere-hash nav-control ((this nav-control) (arg0 symbol)) "Use sphere-hash to look up navigation sphere IDs and save them." (let ((s5-0 (new 'stack-no-clear 'find-nav-sphere-ids-params))) - (set! (-> s5-0 bsphere quad) (-> obj root-nav-sphere quad)) - (+! (-> s5-0 bsphere r) (-> obj nav-cull-radius)) + (set! (-> s5-0 bsphere quad) (-> this root-nav-sphere quad)) + (+! (-> s5-0 bsphere r) (-> this nav-cull-radius)) (set! (-> s5-0 max-len) 16) - (set! (-> s5-0 mask) (-> obj sphere-mask)) - (set! (-> s5-0 array) (-> obj sphere-id-array)) - (set! (-> s5-0 y-threshold) (-> obj nearest-y-threshold)) - (find-nav-sphere-ids (-> obj state mesh sphere-hash) s5-0) - (set! (-> obj sphere-count) (-> s5-0 len)) + (set! (-> s5-0 mask) (-> this sphere-mask)) + (set! (-> s5-0 array) (-> this sphere-id-array)) + (set! (-> s5-0 y-threshold) (-> this nearest-y-threshold)) + (find-nav-sphere-ids (-> this state mesh sphere-hash) s5-0) + (set! (-> this sphere-count) (-> s5-0 len)) ) 0 (none) ) -(defmethod set-spheres-from-nav-ids nav-control ((obj nav-control)) +(defmethod set-spheres-from-nav-ids nav-control ((this nav-control)) "Set up spheres from sphere ids previously found by find-sphere-ids-from-sphere-hash" - (let ((v1-2 (-> obj state mesh sphere-hash sphere-array)) - (a1-0 (-> obj sphere-id-array)) - (a2-1 (-> obj state mesh bounds)) - (a3-0 (-> obj root-nav-sphere)) - (t0-0 (-> obj sphere-count)) + (let ((v1-2 (-> this state mesh sphere-hash sphere-array)) + (a1-0 (-> this sphere-id-array)) + (a2-1 (-> this state mesh bounds)) + (a3-0 (-> this root-nav-sphere)) + (t0-0 (-> this sphere-count)) ) (dotimes (t1-0 t0-0) (let ((t3-0 (-> v1-2 (-> a1-0 t1-0))) - (t2-4 (-> obj sphere-array t1-0)) + (t2-4 (-> this sphere-array t1-0)) ) (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-1) (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) @@ -715,7 +716,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod avoid-spheres-1! nav-control ((obj nav-control) (arg0 nav-avoid-spheres-params)) +(defmethod avoid-spheres-1! nav-control ((this nav-control) (arg0 nav-avoid-spheres-params)) (local-vars (v1-28 int) (a0-29 int) (a1-3 float)) (rlet ((acc :class vf) (Q :class vf) @@ -762,8 +763,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (let ((f0-10 65536.0)) (set! (-> arg0 closest-sphere-dist2) (* f0-10 f0-10)) ) - (dotimes (v1-10 (-> obj sphere-count)) - (let ((a0-13 (-> obj sphere-array v1-10))) + (dotimes (v1-10 (-> this sphere-count)) + (let ((a0-13 (-> this sphere-array v1-10))) (let ((a1-2 (-> arg0 current-pos)) (a2-0 a0-13) ) @@ -799,8 +800,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (-> arg0 current-pos) (-> s5-0 in-dir) (-> s5-0 travel-len) - (-> obj sphere-count) - (-> obj sphere-array) + (-> this sphere-count) + (-> this sphere-array) (the-as int (-> s5-0 initial-ignore-mask)) ) ) @@ -813,7 +814,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (b! #t cfg-43 :delay (nop!)) (label cfg-13) (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) - (let ((a1-17 (-> obj sphere-array (-> s5-0 i-first-sphere)))) + (let ((a1-17 (-> this sphere-array (-> s5-0 i-first-sphere)))) (circle-tangent-directions (-> arg0 current-pos) a1-17 @@ -845,7 +846,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (+! (-> s5-0 ignore-mask) (ash 1 v1-28)) (circle-tangent-directions (-> arg0 current-pos) - (-> obj sphere-array v1-28) + (-> this sphere-array v1-28) (the-as vector (-> s5-0 temp-dir)) (-> s5-0 temp-dir 1) ) @@ -877,8 +878,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (-> arg0 current-pos) (-> s5-0 best-dir s3-0) (-> s5-0 travel-len) - (-> obj sphere-count) - (-> obj sphere-array) + (-> this sphere-count) + (-> this sphere-array) (the-as int (-> s5-0 ignore-mask)) ) ) @@ -890,7 +891,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (b! (< s3-0 2) cfg-20) ) (when (!= (-> s5-0 i-inside-sphere) -1) - (let ((s4-1 (-> obj sphere-array (-> s5-0 i-inside-sphere)))) + (let ((s4-1 (-> this sphere-array (-> s5-0 i-inside-sphere)))) (vector-! (-> s5-0 away-dir) (-> arg0 current-pos) (the-as vector s4-1)) (set! (-> s5-0 away-dir y) 0.0) (when (>= 40.96 (vector-length (-> s5-0 away-dir))) @@ -1013,7 +1014,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod avoid-spheres-2! nav-control ((obj nav-control) (arg0 nav-avoid-spheres-params)) +(defmethod avoid-spheres-2! nav-control ((this nav-control) (arg0 nav-avoid-spheres-params)) (local-vars (a0-32 int) (a1-3 float)) (rlet ((acc :class vf) (Q :class vf) @@ -1057,8 +1058,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (let ((f0-9 65536.0)) (set! (-> arg0 closest-sphere-dist2) (* f0-9 f0-9)) ) - (dotimes (v1-9 (-> obj sphere-count)) - (let ((a0-13 (-> obj sphere-array v1-9))) + (dotimes (v1-9 (-> this sphere-count)) + (let ((a0-13 (-> this sphere-array v1-9))) (let ((a1-2 (-> arg0 current-pos)) (a2-0 a0-13) ) @@ -1089,8 +1090,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (-> arg0 current-pos) (-> s5-0 in-dir) (-> s5-0 travel-len) - (-> obj sphere-count) - (-> obj sphere-array) + (-> this sphere-count) + (-> this sphere-array) (the-as int (-> s5-0 initial-ignore-mask)) ) ) @@ -1103,7 +1104,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (b! #t cfg-21 :delay (nop!)) (label cfg-11) (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) - (let ((a1-15 (-> obj sphere-array (-> s5-0 i-first-sphere)))) + (let ((a1-15 (-> this sphere-array (-> s5-0 i-first-sphere)))) (circle-tangent-directions (-> arg0 current-pos) a1-15 @@ -1144,13 +1145,18 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod clamp-vector-to-mesh-no-gaps nav-control ((obj nav-control) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) - (clamp-vector-to-mesh-no-gaps (-> obj state mesh) arg0 arg1 arg2 arg3) +(defmethod clamp-vector-to-mesh-no-gaps nav-control ((this nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 clamp-travel-vector-to-mesh-return-info) + ) + (clamp-vector-to-mesh-no-gaps (-> this state mesh) arg0 arg1 arg2 arg3) 0 (none) ) -(defmethod clamp-vector-to-mesh-no-gaps nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) +(defmethod clamp-vector-to-mesh-no-gaps nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) (local-vars (v1-12 symbol) (sv-112 nav-ray) @@ -1191,12 +1197,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! sv-112 (new 'stack-no-clear 'nav-ray)) (set! sv-116 (new 'stack-no-clear 'vector)) (set! sv-120 (the-as symbol #f)) - (set! sv-124 (-> obj work)) - (vector-! sv-116 arg0 (-> obj bounds)) + (set! sv-124 (-> this work)) + (vector-! sv-116 arg0 (-> this bounds)) (set! (-> sv-112 current-poly) arg1) (set! (-> sv-112 current-pos quad) (-> sv-116 quad)) (vector+! (-> sv-112 dest-pos) sv-116 arg2) - (let* ((t2-0 obj) + (let* ((t2-0 this) (v1-11 (-> sv-112 dest-pos)) (a1-4 (-> arg1 vertex-count)) (a2-1 (-> arg1 vertex)) @@ -1257,7 +1263,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr 0 (until (or (>= sv-128 15) (-> sv-112 terminated)) (set! sv-128 (+ sv-128 1)) - (let ((a1-9 obj) + (let ((a1-9 this) (v1-20 sv-112) ) (set! sv-136 -1) @@ -1345,14 +1351,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! sv-204 (* sv-204 f0-41)) ) (set! (-> arg3 found-boundary) #t) - (vector+! (-> arg3 intersection) (-> sv-112 current-pos) (-> obj bounds)) + (vector+! (-> arg3 intersection) (-> sv-112 current-pos) (-> this bounds)) (set! (-> arg3 boundary-normal x) sv-200) (set! (-> arg3 boundary-normal y) 0.0) (set! (-> arg3 boundary-normal z) sv-204) (set! (-> arg3 poly) (-> sv-112 current-poly)) (set! (-> arg3 edge) (-> sv-112 last-edge)) - (vector+! (-> arg3 vert-0) sv-192 (-> obj bounds)) - (vector+! (-> arg3 vert-1) sv-196 (-> obj bounds)) + (vector+! (-> arg3 vert-0) sv-192 (-> this bounds)) + (vector+! (-> arg3 vert-1) sv-196 (-> this bounds)) (set! (-> sv-112 dest-pos quad) (-> sv-112 current-pos quad)) (if (-> sv-112 hit-gap) (set! (-> arg3 gap-poly) (-> sv-112 next-poly)) @@ -1371,7 +1377,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Return type mismatch object vs none. ;; WARN: Function (method 21 nav-mesh) has a return type of none, but the expression builder found a return statement. -(defmethod find-adjacent-bounds-one nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) +(defmethod find-adjacent-bounds-one nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) (local-vars (sv-16 nav-poly)) (if (zero? arg3) (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> arg1 vertex-count)))) @@ -1392,11 +1398,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (if (zero? arg3) (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> s3-0 vertex-count)))) ) - (vector+! arg0 (-> s3-0 vertex arg2) (-> obj bounds)) + (vector+! arg0 (-> s3-0 vertex arg2) (-> this bounds)) (return #f) ) (else - (set! s3-0 (-> obj poly-array v1-12)) + (set! s3-0 (-> this poly-array v1-12)) (when (= s3-0 sv-16) (format 0 "ERROR: find-adjacent-bounds-one cur-poly = start-poly after step~%") (return #f) @@ -1418,9 +1424,9 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod set-normals-from-adjacent-bounds nav-mesh ((obj nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) - (find-adjacent-bounds-one obj (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) - (find-adjacent-bounds-one obj (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) +(defmethod set-normals-from-adjacent-bounds nav-mesh ((this nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) + (find-adjacent-bounds-one this (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) + (find-adjacent-bounds-one this (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) (vector-! (-> arg0 prev-normal) (-> arg0 vert-0) (-> arg0 vert-prev)) (vector-! (-> arg0 next-normal) (-> arg0 vert-next) (-> arg0 vert-1)) (vector-normalize! (-> arg0 prev-normal) 1.0) @@ -1439,7 +1445,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (none) ) -(defmethod clamp-vector-to-mesh-cross-gaps nav-mesh ((obj nav-mesh) +(defmethod clamp-vector-to-mesh-cross-gaps nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) @@ -1490,11 +1496,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! sv-96 (new 'stack-no-clear 'nav-ray)) (set! sv-100 (the-as symbol #f)) (set! sv-104 0) - (set! sv-112 (-> obj work)) + (set! sv-112 (-> this work)) (set! (-> sv-96 current-poly) arg1) (set! (-> sv-96 current-pos quad) (-> arg0 quad)) (vector+! (-> sv-96 dest-pos) arg0 arg2) - (let* ((t6-0 obj) + (let* ((t6-0 this) (t4-2 arg1) (v1-10 (-> sv-96 dest-pos)) (t3-3 (-> t4-2 vertex-count)) @@ -1557,7 +1563,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr 0 (until v1-22 (set! sv-120 (+ sv-120 1)) - (let ((t3-8 obj) + (let ((t3-8 this) (v1-19 sv-96) ) (set! sv-128 -1) @@ -1648,14 +1654,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (when arg5 (set! (-> arg5 found-boundary) #t) - (vector+! (-> arg5 intersection) (-> sv-96 current-pos) (-> obj bounds)) + (vector+! (-> arg5 intersection) (-> sv-96 current-pos) (-> this bounds)) (set! (-> arg5 boundary-normal x) sv-192) (set! (-> arg5 boundary-normal y) 0.0) (set! (-> arg5 boundary-normal z) sv-196) (set! (-> arg5 poly) (-> sv-96 current-poly)) (set! (-> arg5 edge) (-> sv-96 last-edge)) - (vector+! (-> arg5 vert-0) sv-184 (-> obj bounds)) - (vector+! (-> arg5 vert-1) sv-188 (-> obj bounds)) + (vector+! (-> arg5 vert-0) sv-184 (-> this bounds)) + (vector+! (-> arg5 vert-1) sv-188 (-> this bounds)) ) (set! (-> sv-96 dest-pos quad) (-> sv-96 current-pos quad)) (cond @@ -1691,7 +1697,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod find-first-sphere-and-update-avoid-params nav-control ((obj nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) +(defmethod find-first-sphere-and-update-avoid-params nav-control ((this nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -1700,12 +1706,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf3 :class vf) ) (init-vf0-vector) - (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root-nav-sphere) (-> obj state mesh bounds))) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this root-nav-sphere) (-> this state mesh bounds))) (f30-0 -1.0) ) (let ((s3-0 -1)) - (countdown (s1-0 (-> obj sphere-count)) - (let* ((s0-0 (-> obj sphere-array s1-0)) + (countdown (s1-0 (-> this sphere-count)) + (let* ((s0-0 (-> this sphere-array s1-0)) (f0-2 (ray-circle-intersect s2-1 arg0 s0-0 (+ -409.6 (-> s0-0 r)))) ) (when (>= f0-2 0.0) @@ -1724,11 +1730,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (when arg1 (set! (-> arg1 current-pos x) f30-0) (when (>= f30-0 0.0) - (vector+float*! (-> arg1 travel) (-> obj root-nav-sphere) arg0 f30-0) - (let ((a0-9 (-> obj sphere-array s3-0)) + (vector+float*! (-> arg1 travel) (-> this root-nav-sphere) arg0 f30-0) + (let ((a0-9 (-> this sphere-array s3-0)) (v1-19 (new 'stack-no-clear 'vector)) ) - (vector+! v1-19 (the-as vector a0-9) (-> obj state mesh bounds)) + (vector+! v1-19 (the-as vector a0-9) (-> this state mesh bounds)) (vector-! (-> arg1 pref-dir) (-> arg1 travel) v1-19) ) (set! (-> arg1 pref-dir w) 1.0) @@ -1759,143 +1765,143 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod add-root-sphere-to-hash! nav-control ((obj nav-control) (arg0 vector) (arg1 int)) +(defmethod add-root-sphere-to-hash! nav-control ((this nav-control) (arg0 vector) (arg1 int)) "Add our root sphere to the hash (if enabled with output-sphere-hash flag) at the given location." - (if (logtest? (-> obj flags) (nav-control-flag output-sphere-hash)) + (if (logtest? (-> this flags) (nav-control-flag output-sphere-hash)) (add-sphere-with-mask-and-id - (-> obj state mesh sphere-hash) + (-> this state mesh sphere-hash) arg0 (logand arg1 255) - (the-as int (-> obj root-sphere-id)) + (the-as int (-> this root-sphere-id)) ) ) ) -(defmethod reset! nav-state ((obj nav-state) (arg0 nav-control)) - (set! (-> obj nav) arg0) - (set! (-> obj flags) (nav-state-flag)) - (set! (-> obj current-poly) #f) - (set! (-> obj next-poly) #f) - (set! (-> obj target-poly) #f) - (set! (-> obj user-poly) #f) +(defmethod reset! nav-state ((this nav-state) (arg0 nav-control)) + (set! (-> this nav) arg0) + (set! (-> this flags) (nav-state-flag)) + (set! (-> this current-poly) #f) + (set! (-> this next-poly) #f) + (set! (-> this target-poly) #f) + (set! (-> this user-poly) #f) 0 (none) ) -(defmethod relocate nav-state ((obj nav-state) (arg0 int)) +(defmethod relocate nav-state ((this nav-state) (arg0 int)) (break!) - (&+! (-> obj nav) arg0) - obj + (&+! (-> this nav) arg0) + this ) -(defmethod get-velocity nav-state ((obj nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> obj velocity quad)) +(defmethod get-velocity nav-state ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this velocity quad)) arg0 ) -(defmethod get-heading nav-state ((obj nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> obj heading quad)) +(defmethod get-heading nav-state ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this heading quad)) arg0 ) -(defmethod get-target-post nav-state ((obj nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> obj target-post quad)) +(defmethod get-target-post nav-state ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this target-post quad)) arg0 ) -(defmethod get-current-poly nav-state ((obj nav-state)) +(defmethod get-current-poly nav-state ((this nav-state)) "@returns `current-poly`" - (-> obj current-poly) + (-> this current-poly) ) -(defmethod get-speed nav-state ((obj nav-state)) +(defmethod get-speed nav-state ((this nav-state)) "@returns `speed`" - (-> obj speed) + (-> this speed) ) -(defmethod get-rotation-rate nav-state ((obj nav-state)) +(defmethod get-rotation-rate nav-state ((this nav-state)) "@returns `rotation-rate`" - (-> obj rotation-rate) + (-> this rotation-rate) ) -(defmethod get-travel nav-state ((obj nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> obj travel quad)) +(defmethod get-travel nav-state ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this travel quad)) arg0 ) -(defmethod set-velocity! nav-state ((obj nav-state) (velocity vector)) - (set! (-> obj velocity quad) (-> velocity quad)) +(defmethod set-velocity! nav-state ((this nav-state) (velocity vector)) + (set! (-> this velocity quad) (-> velocity quad)) 0 (none) ) -(defmethod set-heading! nav-state ((obj nav-state) (arg0 vector)) - (set! (-> obj heading quad) (-> arg0 quad)) +(defmethod set-heading! nav-state ((this nav-state) (arg0 vector)) + (set! (-> this heading quad) (-> arg0 quad)) 0 (none) ) -(defmethod set-speed! nav-state ((obj nav-state) (arg0 meters)) - (set! (-> obj speed) arg0) +(defmethod set-speed! nav-state ((this nav-state) (arg0 meters)) + (set! (-> this speed) arg0) 0 (none) ) -(defmethod set-target-post! nav-state ((obj nav-state) (arg0 vector)) - (logclear! (-> obj flags) (nav-state-flag directional-mode)) - (logior! (-> obj flags) (nav-state-flag target-poly-dirty)) - (set! (-> obj target-post quad) (-> arg0 quad)) +(defmethod set-target-post! nav-state ((this nav-state) (arg0 vector)) + (logclear! (-> this flags) (nav-state-flag directional-mode)) + (logior! (-> this flags) (nav-state-flag target-poly-dirty)) + (set! (-> this target-post quad) (-> arg0 quad)) 0 (none) ) -(defmethod set-travel! nav-state ((obj nav-state) (arg0 vector)) - (logior! (-> obj flags) (nav-state-flag directional-mode)) - (set! (-> obj travel quad) (-> arg0 quad)) +(defmethod set-travel! nav-state ((this nav-state) (arg0 vector)) + (logior! (-> this flags) (nav-state-flag directional-mode)) + (set! (-> this travel quad) (-> arg0 quad)) 0 (none) ) -(defmethod copy-nav-state! nav-state ((obj nav-state) (arg0 (pointer nav-state))) +(defmethod copy-nav-state! nav-state ((this nav-state) (arg0 (pointer nav-state))) "Copies the [[nav-state]] the given pointer points to into the current object" - (mem-copy! (the-as pointer obj) arg0 176) + (mem-copy! (the-as pointer this) arg0 176) 0 (none) ) -(defmethod nav-state-method-10 nav-state ((obj nav-state)) +(defmethod nav-state-method-10 nav-state ((this nav-state)) 0 (none) ) -(defmethod debug-draw nav-state ((obj nav-state)) - (let ((s5-0 (-> obj mesh))) - (if (-> obj next-poly) - (debug-draw-poly s5-0 (-> obj next-poly) *color-cyan*) +(defmethod debug-draw nav-state ((this nav-state)) + (let ((s5-0 (-> this mesh))) + (if (-> this next-poly) + (debug-draw-poly s5-0 (-> this next-poly) *color-cyan*) ) - (if (-> obj target-poly) - (debug-draw-poly s5-0 (-> obj target-poly) *color-yellow*) + (if (-> this target-poly) + (debug-draw-poly s5-0 (-> this target-poly) *color-yellow*) ) - (if (-> obj current-poly) - (debug-draw-poly s5-0 (-> obj current-poly) *color-red*) + (if (-> this current-poly) + (debug-draw-poly s5-0 (-> this current-poly) *color-red*) ) ) - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj target-post) *color-yellow*) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this target-post) *color-yellow*) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj current-pos) - (-> obj travel) + (-> this current-pos) + (-> this travel) (meters 0.00024414062) *color-white* ) (let ((s5-1 (new 'stack-no-clear 'vector))) 0.0 - (-> obj mesh work debug) - (set! (-> s5-1 quad) (-> obj current-pos quad)) + (-> this mesh work debug) + (set! (-> s5-1 quad) (-> this current-pos quad)) (let ((f30-0 (-> s5-1 y))) (set! (-> s5-1 y) (+ 2048.0 f30-0)) - (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-1 (-> obj heading) (meters 1) *color-yellow*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-1 (-> this heading) (meters 1) *color-yellow*) (set! (-> s5-1 y) (+ 4096.0 f30-0)) ) ) @@ -1903,25 +1909,25 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (add-debug-x #t (bucket-id debug-no-zbuf1) - (vector+! (new 'stack-no-clear 'vector) (-> obj current-pos) (-> obj travel)) + (vector+! (new 'stack-no-clear 'vector) (-> this current-pos) (-> this travel)) *color-white* ) 0 (none) ) -(defmethod set-current-poly! nav-state ((obj nav-state) (arg0 nav-poly)) - (set! (-> obj current-poly) arg0) +(defmethod set-current-poly! nav-state ((this nav-state) (arg0 nav-poly)) + (set! (-> this current-poly) arg0) 0 (none) ) -(defmethod clamp-vector-to-mesh-cross-gaps nav-state ((obj nav-state) (arg0 vector)) - (when (-> obj current-poly) +(defmethod clamp-vector-to-mesh-cross-gaps nav-state ((this nav-state) (arg0 vector)) + (when (-> this current-poly) (clamp-vector-to-mesh-cross-gaps - (-> obj nav) - (-> obj current-pos) - (-> obj current-poly) + (-> this nav) + (-> this current-pos) + (-> this current-poly) arg0 204.8 #f @@ -1931,7 +1937,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod do-navigation-to-destination nav-state ((obj nav-state) (arg0 vector)) +(defmethod do-navigation-to-destination nav-state ((this nav-state) (arg0 vector)) (local-vars (v1-15 symbol)) (rlet ((acc :class vf) (Q :class vf) @@ -1942,17 +1948,17 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (init-vf0-vector) (cond - ((-> obj current-poly) - (let ((s3-0 (-> obj mesh)) + ((-> this current-poly) + (let ((s3-0 (-> this mesh)) (s4-0 (new 'stack-no-clear 'nav-ray)) ) (let ((s2-0 0)) - (set! (-> s4-0 current-poly) (-> obj current-poly)) - (vector-! (-> s4-0 current-pos) (-> obj current-pos) (-> s3-0 bounds)) + (set! (-> s4-0 current-poly) (-> this current-poly)) + (vector-! (-> s4-0 current-pos) (-> this current-pos) (-> s3-0 bounds)) (vector-! (-> s4-0 dest-pos) arg0 (-> s3-0 bounds)) - (b! (not (point-in-poly? s3-0 (-> obj current-poly) (-> s4-0 dest-pos))) cfg-3 :delay (empty-form)) - (logior! (-> obj flags) (nav-state-flag in-mesh)) - (set! (-> obj current-pos quad) (-> arg0 quad)) + (b! (not (point-in-poly? s3-0 (-> this current-poly) (-> s4-0 dest-pos))) cfg-3 :delay (empty-form)) + (logior! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) (b! #t cfg-17 :delay (nop!)) (label cfg-3) (let ((v1-10 s4-0)) @@ -1994,26 +2000,26 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! v1-15 (or (>= s2-0 15) (-> s4-0 terminated))) ) ) - (set! (-> obj current-poly) (-> s4-0 current-poly)) + (set! (-> this current-poly) (-> s4-0 current-poly)) (when (-> s4-0 reached-dest) - (if (not (point-in-poly? s3-0 (-> obj current-poly) (-> s4-0 dest-pos))) + (if (not (point-in-poly? s3-0 (-> this current-poly) (-> s4-0 dest-pos))) (set! (-> s4-0 reached-dest) #f) ) ) (cond ((-> s4-0 reached-dest) - (logior! (-> obj flags) (nav-state-flag in-mesh)) - (set! (-> obj current-pos quad) (-> arg0 quad)) + (logior! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) ) (else - (logclear! (-> obj flags) (nav-state-flag in-mesh)) - (set! (-> obj current-pos quad) (-> arg0 quad)) + (logclear! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) (let ((s4-1 (new 'stack 'nav-find-poly-parms))) - (vector-! (-> s4-1 point) arg0 (-> obj mesh bounds)) - (set! (-> s4-1 y-threshold) (-> obj nav nearest-y-threshold)) + (vector-! (-> s4-1 point) arg0 (-> this mesh bounds)) + (set! (-> s4-1 y-threshold) (-> this nav nearest-y-threshold)) (set! (-> s4-1 ignore) (the-as uint 1)) - (find-nearest-poly-to-point-local (-> obj mesh) s4-1) - (set! (-> obj current-poly) (-> s4-1 poly)) + (find-nearest-poly-to-point-local (-> this mesh) s4-1) + (set! (-> this current-poly) (-> s4-1 poly)) ) 0 ) @@ -2021,16 +2027,16 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) (else - (set! (-> obj current-pos quad) (-> arg0 quad)) + (set! (-> this current-pos quad) (-> arg0 quad)) (let ((s4-2 (new 'stack 'nav-find-poly-parms))) - (vector-! (-> s4-2 point) arg0 (-> obj mesh bounds)) - (set! (-> s4-2 y-threshold) (-> obj nav nearest-y-threshold)) + (vector-! (-> s4-2 point) arg0 (-> this mesh bounds)) + (set! (-> s4-2 y-threshold) (-> this nav nearest-y-threshold)) (set! (-> s4-2 ignore) (the-as uint 1)) - (find-nearest-poly-to-point-local (-> obj mesh) s4-2) - (set! (-> obj current-poly) (-> s4-2 poly)) - (logclear! (-> obj flags) (nav-state-flag in-mesh)) + (find-nearest-poly-to-point-local (-> this mesh) s4-2) + (set! (-> this current-poly) (-> s4-2 poly)) + (logclear! (-> this flags) (nav-state-flag in-mesh)) (if (-> s4-2 point-inside?) - (logior! (-> obj flags) (nav-state-flag in-mesh)) + (logior! (-> this flags) (nav-state-flag in-mesh)) ) ) ) @@ -2041,11 +2047,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod try-projecting-to-current-poly nav-state ((obj nav-state) (arg0 vector) (arg1 object) (arg2 vector)) +(defmethod try-projecting-to-current-poly nav-state ((this nav-state) (arg0 vector) (arg1 object) (arg2 vector)) (cond - ((-> obj current-poly) - (let ((s5-0 (-> obj nav)) - (v1-1 (-> obj current-poly)) + ((-> this current-poly) + (let ((s5-0 (-> this nav)) + (v1-1 (-> this current-poly)) (gp-0 arg0) ) (let ((t1-0 arg1) @@ -2070,7 +2076,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod clamp-vector-to-mesh-cross-gaps nav-control ((obj nav-control) +(defmethod clamp-vector-to-mesh-cross-gaps nav-control ((this nav-control) (arg0 vector) (arg1 nav-poly) (arg2 vector) @@ -2079,26 +2085,26 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (arg5 clamp-travel-vector-to-mesh-return-info) ) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj state mesh bounds)) - (clamp-vector-to-mesh-cross-gaps (-> obj state mesh) v1-0 arg1 arg2 arg3 arg4 arg5) + (vector-! v1-0 arg0 (-> this state mesh bounds)) + (clamp-vector-to-mesh-cross-gaps (-> this state mesh) v1-0 arg1 arg2 arg3 arg4 arg5) ) 0 (none) ) -(defmethod cloest-point-on-mesh nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) +(defmethod cloest-point-on-mesh nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) (local-vars (sv-16 vector)) (set! sv-16 arg0) (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) (set! (-> gp-0 poly) arg2) - (vector-! (-> gp-0 point) arg1 (-> obj state mesh bounds)) - (when (or (not (-> gp-0 poly)) (not (point-in-poly? (-> obj state mesh) (-> gp-0 poly) (-> gp-0 point)))) - (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> gp-0 point) arg1 (-> this state mesh bounds)) + (when (or (not (-> gp-0 poly)) (not (point-in-poly? (-> this state mesh) (-> gp-0 poly) (-> gp-0 point)))) + (set! (-> gp-0 y-threshold) (-> this nearest-y-threshold)) (set! (-> gp-0 ignore) (the-as uint 3)) - (find-nearest-poly-to-point-local (-> obj state mesh) gp-0) + (find-nearest-poly-to-point-local (-> this state mesh) gp-0) (when (-> gp-0 poly) - (project-point-into-poly-2d (-> obj state mesh) (-> gp-0 poly) sv-16 (-> gp-0 point)) - (vector+! sv-16 sv-16 (-> obj state mesh bounds)) + (project-point-into-poly-2d (-> this state mesh) (-> gp-0 poly) sv-16 (-> gp-0 point)) + (vector+! sv-16 sv-16 (-> this state mesh bounds)) ) ) (-> gp-0 poly) @@ -2117,7 +2123,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (defmethod-mips2c "(method 39 nav-state)" 39 nav-state) -(defmethod nav-state-method-50 nav-state ((obj nav-state)) +(defmethod nav-state-method-50 nav-state ((this nav-state)) 0 (none) ) @@ -2181,7 +2187,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-using-route-portals nav-state ((obj nav-state)) +(defmethod navigate-using-route-portals nav-state ((this nav-state)) (local-vars (v1-117 float) (sv-112 vector) @@ -2195,56 +2201,56 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf2 :class vf) ) (init-vf0-vector) - (set! (-> obj virtual-current-poly) (-> obj current-poly)) + (set! (-> this virtual-current-poly) (-> this current-poly)) (set! sv-112 (new 'stack-no-clear 'vector)) (set! sv-116 (new 'stack-no-clear 'nav-route-portal)) (set! sv-120 (new 'stack-no-clear 'inline-array 'vector 2)) (set! sv-124 (the-as symbol #f)) - (vector-! (-> obj current-pos-local) (-> obj current-pos) (-> obj mesh bounds)) - (set! (-> obj virtual-current-pos-local quad) (-> obj current-pos-local quad)) + (vector-! (-> this current-pos-local) (-> this current-pos) (-> this mesh bounds)) + (set! (-> this virtual-current-pos-local quad) (-> this current-pos-local quad)) (set! (-> sv-116 next-poly) #f) - (when (not (logtest? (-> obj flags) (nav-state-flag directional-mode))) + (when (not (logtest? (-> this flags) (nav-state-flag directional-mode))) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (new 'stack-no-clear 'nav-find-poly-parms))) - (vector-! s5-0 (-> obj target-post) (-> obj mesh bounds)) - (when (or (logtest? (-> obj flags) (nav-state-flag target-poly-dirty)) (not (-> obj target-poly))) + (vector-! s5-0 (-> this target-post) (-> this mesh bounds)) + (when (or (logtest? (-> this flags) (nav-state-flag target-poly-dirty)) (not (-> this target-poly))) (set! (-> s4-0 point quad) (-> s5-0 quad)) - (set! (-> s4-0 y-threshold) (-> obj nav nearest-y-threshold)) + (set! (-> s4-0 y-threshold) (-> this nav nearest-y-threshold)) (set! (-> s4-0 ignore) (the-as uint 3)) - (find-nearest-poly-to-point-local (-> obj mesh) s4-0) - (set! (-> obj target-poly) (-> s4-0 poly)) - (if (not (-> obj target-poly)) - (set! (-> obj target-poly) (-> obj current-poly)) + (find-nearest-poly-to-point-local (-> this mesh) s4-0) + (set! (-> this target-poly) (-> s4-0 poly)) + (if (not (-> this target-poly)) + (set! (-> this target-poly) (-> this current-poly)) ) - (logclear! (-> obj flags) (nav-state-flag target-poly-dirty)) + (logclear! (-> this flags) (nav-state-flag target-poly-dirty)) ) ) - (project-point-into-poly-2d (-> obj mesh) (-> obj target-poly) sv-112 s5-0) + (project-point-into-poly-2d (-> this mesh) (-> this target-poly) sv-112 s5-0) ) - (set! (-> sv-112 y) (-> obj current-pos-local y)) - (vector-! (-> obj travel) sv-112 (-> obj current-pos-local)) - (set! (-> obj travel y) 0.0) - (let* ((v1-32 (-> obj travel)) + (set! (-> sv-112 y) (-> this current-pos-local y)) + (vector-! (-> this travel) sv-112 (-> this current-pos-local)) + (set! (-> this travel y) 0.0) + (let* ((v1-32 (-> this travel)) (f0-6 (+ (* (-> v1-32 x) (-> v1-32 x)) (* (-> v1-32 z) (-> v1-32 z)))) (f1-3 4096.0) ) (if (< f0-6 (* f1-3 f1-3)) - (logior! (-> obj flags) (nav-state-flag at-target)) + (logior! (-> this flags) (nav-state-flag at-target)) ) ) - (get-route-portal (-> obj mesh) (-> obj current-poly) (-> obj target-poly) sv-116) + (get-route-portal (-> this mesh) (-> this current-poly) (-> this target-poly) sv-116) ) (cond ((not (-> sv-116 next-poly)) - (set! (-> obj next-poly) #f) + (set! (-> this next-poly) #f) ) (else - (set! (-> obj next-poly) (-> sv-116 next-poly)) + (set! (-> this next-poly) (-> sv-116 next-poly)) (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) (set! sv-124 #t) (while (and sv-124 (-> sv-116 next-poly) (test-xz-point-on-line-segment? - (-> obj current-pos-local) + (-> this current-pos-local) (the-as vector (-> sv-116 vertex)) (-> sv-116 vertex 1) 409.59998 @@ -2253,25 +2259,25 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (when #t #t (vector-segment-distance-point! - (-> obj current-pos-local) + (-> this current-pos-local) (the-as vector (-> sv-116 vertex)) (-> sv-116 vertex 1) - (-> obj virtual-current-pos-local) + (-> this virtual-current-pos-local) ) - (vector-! (-> obj travel) sv-112 (-> obj virtual-current-pos-local)) - (set! (-> obj travel y) 0.0) + (vector-! (-> this travel) sv-112 (-> this virtual-current-pos-local)) + (set! (-> this travel y) 0.0) 0 ) - (set! (-> obj virtual-current-poly) (-> sv-116 next-poly)) + (set! (-> this virtual-current-poly) (-> sv-116 next-poly)) (cond - ((get-route-portal (-> obj mesh) (-> sv-116 next-poly) (-> obj target-poly) sv-116) - (set! (-> obj next-poly) (-> sv-116 next-poly)) + ((get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) sv-116) + (set! (-> this next-poly) (-> sv-116 next-poly)) (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) 0 ) (else - (set! (-> obj next-poly) #f) + (set! (-> this next-poly) #f) (set! sv-124 (the-as symbol #f)) ) ) @@ -2286,8 +2292,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vector-! (-> sv-120 1) (-> sv-120 1) (the-as vector (-> s5-1 vector))) ) (when (not (ray-ccw-line-segment-intersection? - (-> obj virtual-current-pos-local) - (-> obj travel) + (-> this virtual-current-pos-local) + (-> this travel) (-> sv-120 0) (-> sv-120 1) ) @@ -2296,12 +2302,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (let* ((f0-8 (cos 8192.0)) (f0-10 (* f0-8 f0-8)) (v1-93 (new 'stack-no-clear 'vector)) - (a0-39 (-> obj travel)) + (a0-39 (-> this travel)) (f1-9 (+ (* (-> a0-39 x) (-> a0-39 x)) (* (-> a0-39 z) (-> a0-39 z)))) ) (countdown (a0-41 2) - (vector-! v1-93 (-> sv-120 a0-41) (-> obj virtual-current-pos-local)) - (let ((f2-5 (vector-dot (-> obj travel) v1-93))) + (vector-! v1-93 (-> sv-120 a0-41) (-> this virtual-current-pos-local)) + (let ((f2-5 (vector-dot (-> this travel) v1-93))) (when (< 0.0 f2-5) (let* ((f2-7 (* f2-5 f2-5)) (a1-26 v1-93) @@ -2321,7 +2327,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (s3-0 (new 'stack-no-clear 'nav-route-portal)) (s4-1 (new 'stack-no-clear 'vector)) ) - (get-route-portal (-> obj mesh) (-> sv-116 next-poly) (-> obj target-poly) s3-0) + (get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) s3-0) (cond ((-> s3-0 next-poly) (vector+! s4-1 (the-as vector (-> s3-0 vertex)) (the-as vector (-> s3-0 vertex 1))) @@ -2333,7 +2339,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (countdown (s3-1 2) (let* ((s2-0 (-> sv-120 s3-1)) - (f0-13 (+ (vector-vector-xz-distance-squared (-> obj virtual-current-pos-local) s2-0) + (f0-13 (+ (vector-vector-xz-distance-squared (-> this virtual-current-pos-local) s2-0) (vector-vector-xz-distance-squared s4-1 s2-0) ) ) @@ -2346,12 +2352,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) ) - (vector-! (-> obj travel) (-> sv-120 s5-2) (-> obj virtual-current-pos-local)) + (vector-! (-> this travel) (-> sv-120 s5-2) (-> this virtual-current-pos-local)) ) - (set! (-> obj travel y) 0.0) + (set! (-> this travel y) 0.0) ) ) - (.lvf vf1 (&-> (-> obj travel) quad)) + (.lvf vf1 (&-> (-> this travel) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -2359,10 +2365,10 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-117 vf1) (let ((f0-15 v1-117) - (f1-10 (-> obj nav nav-cull-radius)) + (f1-10 (-> this nav nav-cull-radius)) ) (if (< (* f1-10 f1-10) f0-15) - (vector-float*! (-> obj travel) (-> obj travel) (/ (-> obj nav nav-cull-radius) (sqrtf f0-15))) + (vector-float*! (-> this travel) (-> this travel) (/ (-> this nav nav-cull-radius) (sqrtf f0-15))) ) ) 0 @@ -2370,7 +2376,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-using-best-dir-use-existing-avoid-spheres nav-state ((obj nav-state) (arg0 nav-avoid-spheres-params)) +(defmethod navigate-using-best-dir-use-existing-avoid-spheres nav-state ((this nav-state) (arg0 nav-avoid-spheres-params)) (local-vars (sv-96 int) (sv-104 nav-mesh-work) @@ -2395,19 +2401,19 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (init-vf0-vector) (when (-> arg0 avoiding-sphere?) - (logior! (-> obj flags) (nav-state-flag avoiding-sphere)) + (logior! (-> this flags) (nav-state-flag avoiding-sphere)) (let ((f0-0 (-> arg0 closest-sphere-dist2)) (f1-0 512.0) ) (if (< f0-0 (* f1-0 f1-0)) - (logior! (-> obj flags) (nav-state-flag touching-sphere)) + (logior! (-> this flags) (nav-state-flag touching-sphere)) ) ) - (set! (-> obj travel quad) (-> arg0 out-travel 0 quad)) + (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) (let ((v1-10 (new 'stack-no-clear 'nav-ray))) - (set! (-> v1-10 current-pos quad) (-> obj virtual-current-pos-local quad)) - (set! (-> v1-10 current-poly) (-> obj virtual-current-poly)) - (vector+! (-> v1-10 dest-pos) (-> obj virtual-current-pos-local) (-> obj travel)) + (set! (-> v1-10 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> v1-10 current-poly) (-> this virtual-current-poly)) + (vector+! (-> v1-10 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) (let ((a2-5 0)) (let ((a3-3 v1-10)) (vector-! (-> a3-3 dir) (-> a3-3 dest-pos) (-> a3-3 current-pos)) @@ -2443,7 +2449,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr 0 (until (or (>= a2-5 15) (-> v1-10 terminated)) (+! a2-5 1) - (let ((t0-6 (-> obj mesh)) + (let ((t0-6 (-> this mesh)) (a3-5 v1-10) ) (set! sv-96 -1) @@ -2515,11 +2521,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (cond ((or (-> v1-10 reached-dest) (-> v1-10 hit-gap) (>= (-> v1-10 len) 4096.0)) - (set! (-> obj travel quad) (-> arg0 out-travel 0 quad)) + (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) ) (else - (set! (-> obj travel quad) (-> arg0 out-travel 1 quad)) - (logior! (-> obj flags) (nav-state-flag trapped-by-sphere)) + (set! (-> this travel quad) (-> arg0 out-travel 1 quad)) + (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) ) ) ) @@ -2529,7 +2535,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 nav-state ((obj nav-state)) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 nav-state ((this nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) @@ -2554,30 +2560,30 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (set! (-> s5-0 current-pos quad) (-> obj virtual-current-pos-local quad)) - (set! (-> s5-0 travel quad) (-> obj travel quad)) - (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> obj flags) (nav-state-flag trapped-by-sphere)) - (-> obj heading) - (-> obj travel) + (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> this travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) ) quad ) ) - (avoid-spheres-1! (-> obj nav) s5-0) + (avoid-spheres-1! (-> this nav) s5-0) (when (-> s5-0 avoiding-sphere?) - (logior! (-> obj flags) (nav-state-flag avoiding-sphere)) + (logior! (-> this flags) (nav-state-flag avoiding-sphere)) (let ((f0-0 (-> s5-0 closest-sphere-dist2)) (f1-0 512.0) ) (if (< f0-0 (* f1-0 f1-0)) - (logior! (-> obj flags) (nav-state-flag touching-sphere)) + (logior! (-> this flags) (nav-state-flag touching-sphere)) ) ) - (set! (-> obj travel quad) (-> s5-0 out-travel 0 quad)) + (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) (let ((v1-15 (new 'stack-no-clear 'nav-ray))) - (set! (-> v1-15 current-pos quad) (-> obj virtual-current-pos-local quad)) - (set! (-> v1-15 current-poly) (-> obj virtual-current-poly)) - (vector+! (-> v1-15 dest-pos) (-> obj virtual-current-pos-local) (-> obj travel)) + (set! (-> v1-15 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> v1-15 current-poly) (-> this virtual-current-poly)) + (vector+! (-> v1-15 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) (let ((a0-15 0)) (let ((a1-4 v1-15)) (vector-! (-> a1-4 dir) (-> a1-4 dest-pos) (-> a1-4 current-pos)) @@ -2613,7 +2619,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr 0 (until (or (>= a0-15 15) (-> v1-15 terminated)) (+! a0-15 1) - (let ((a2-6 (-> obj mesh)) + (let ((a2-6 (-> this mesh)) (a1-6 v1-15) ) (set! sv-192 -1) @@ -2685,11 +2691,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (cond ((or (-> v1-15 reached-dest) (-> v1-15 hit-gap) (>= (-> v1-15 len) 4096.0)) - (set! (-> obj travel quad) (-> s5-0 out-travel 0 quad)) + (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) ) (else - (set! (-> obj travel quad) (-> s5-0 out-travel 1 quad)) - (logior! (-> obj flags) (nav-state-flag trapped-by-sphere)) + (set! (-> this travel quad) (-> s5-0 out-travel 1 quad)) + (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) ) ) ) @@ -2701,7 +2707,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-within-poly nav-state ((obj nav-state)) +(defmethod navigate-within-poly nav-state ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -2710,8 +2716,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf3 :class vf) ) (init-vf0-vector) - (set! (-> obj target-dir quad) (-> obj travel quad)) - (let ((v1-1 (-> obj target-dir))) + (set! (-> this target-dir quad) (-> this travel quad)) + (let ((v1-1 (-> this target-dir))) (let ((f0-0 1.0)) (.lvf vf1 (&-> v1-1 quad)) (.mul.vf vf2 vf1 vf1 :mask #b111) @@ -2731,16 +2737,16 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (.svf (&-> v1-1 quad) vf1) ) (cond - ((logtest? (-> obj nav flags) (nav-control-flag limit-rotation-rate)) - (let ((s5-0 (nav-state-method-39 obj))) + ((logtest? (-> this nav flags) (nav-control-flag limit-rotation-rate)) + (let ((s5-0 (nav-state-method-39 this))) (let* ((f0-1 40.96) (f0-3 (* f0-1 f0-1)) - (v1-8 (-> obj travel)) + (v1-8 (-> this travel)) ) (when (< f0-3 (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) - (set! (-> obj heading quad) (-> obj travel quad)) - (set! (-> obj heading y) 0.0) - (let ((v1-12 (-> obj heading))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-12 (-> this heading))) (let ((f0-5 1.0)) (.lvf vf1 (&-> v1-12 quad)) (.mul.vf vf2 vf1 vf1 :mask #b111) @@ -2761,15 +2767,18 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) ) - (let ((f0-6 - (find-first-sphere-and-update-avoid-params (-> obj nav) (-> obj travel) (the-as nav-avoid-spheres-params #f)) - ) + (let ((f0-6 (find-first-sphere-and-update-avoid-params + (-> this nav) + (-> this travel) + (the-as nav-avoid-spheres-params #f) + ) + ) ) (when (>= f0-6 0.0) - (vector-float*! (-> obj travel) (-> obj travel) f0-6) - (let ((f0-7 (* f0-6 (-> obj nav nav-cull-radius)))) + (vector-float*! (-> this travel) (-> this travel) f0-6) + (let ((f0-7 (* f0-6 (-> this nav nav-cull-radius)))) (if (and (not s5-0) (>= 40.96 f0-7)) - (logior! (-> obj flags) (nav-state-flag blocked)) + (logior! (-> this flags) (nav-state-flag blocked)) ) ) ) @@ -2779,12 +2788,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (else (let* ((f0-8 40.96) (f0-10 (* f0-8 f0-8)) - (v1-26 (-> obj travel)) + (v1-26 (-> this travel)) ) (when (< f0-10 (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))) - (set! (-> obj heading quad) (-> obj travel quad)) - (set! (-> obj heading y) 0.0) - (let ((v1-30 (-> obj heading))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-30 (-> this heading))) (let ((f0-12 1.0)) (.lvf vf1 (&-> v1-30 quad)) (.mul.vf vf2 vf1 vf1 :mask #b111) @@ -2807,63 +2816,63 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) ) - (if (not (logtest? (-> obj flags) (nav-state-flag touching-sphere))) - (logclear! (-> obj flags) (nav-state-flag trapped-by-sphere)) + (if (not (logtest? (-> this flags) (nav-state-flag touching-sphere))) + (logclear! (-> this flags) (nav-state-flag trapped-by-sphere)) ) 0 (none) ) ) -(defmethod clamp-travel-vector nav-state ((obj nav-state)) +(defmethod clamp-travel-vector nav-state ((this nav-state)) (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-cross-gaps - (-> obj mesh) - (-> obj virtual-current-pos-local) - (-> obj virtual-current-poly) - (-> obj travel) - (-> obj mesh work nav-poly-min-dist) - (not (or (logtest? (-> obj nav flags) (nav-control-flag no-redirect-in-clamp)) - (logtest? (-> obj nav flags) (nav-control-flag limit-rotation-rate)) + (-> this mesh) + (-> this virtual-current-pos-local) + (-> this virtual-current-poly) + (-> this travel) + (-> this mesh work nav-poly-min-dist) + (not (or (logtest? (-> this nav flags) (nav-control-flag no-redirect-in-clamp)) + (logtest? (-> this nav flags) (nav-control-flag limit-rotation-rate)) ) ) s5-0 ) (when (-> s5-0 gap-poly) - (set! (-> obj next-poly) (-> s5-0 gap-poly)) - (let* ((v1-12 (-> obj travel)) + (set! (-> this next-poly) (-> s5-0 gap-poly)) + (let* ((v1-12 (-> this travel)) (f0-4 (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) (f1-3 1024.0) ) (if (< f0-4 (* f1-3 f1-3)) - (logior! (-> obj flags) (nav-state-flag at-gap)) + (logior! (-> this flags) (nav-state-flag at-gap)) ) ) ) ) (let ((v1-19 (new 'stack-no-clear 'vector))) - (vector-! v1-19 (-> obj virtual-current-pos-local) (-> obj current-pos-local)) - (vector+! (-> obj travel) (-> obj travel) v1-19) + (vector-! v1-19 (-> this virtual-current-pos-local) (-> this current-pos-local)) + (vector+! (-> this travel) (-> this travel) v1-19) ) - (set! (-> obj travel y) 0.0) + (set! (-> this travel y) 0.0) 0 (none) ) -(defmethod plan-over-pat1-polys-using-route nav-state ((obj nav-state) (arg0 nav-gap-info)) +(defmethod plan-over-pat1-polys-using-route nav-state ((this nav-state) (arg0 nav-gap-info)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) - (let ((a1-1 (-> obj next-poly))) + (let ((a1-1 (-> this next-poly))) (when (logtest? (-> a1-1 pat) 1) (while (and a1-1 (logtest? (-> a1-1 pat) 1)) - (set! a1-1 (lookup-poly-on-route-to-target (-> obj mesh) a1-1 (-> obj target-poly))) + (set! a1-1 (lookup-poly-on-route-to-target (-> this mesh) a1-1 (-> this target-poly))) ) - (when (and a1-1 (!= a1-1 (-> obj current-poly))) + (when (and a1-1 (!= a1-1 (-> this current-poly))) (set! (-> arg0 poly) a1-1) - (-> obj mesh) + (-> this mesh) (let ((s3-0 (-> arg0 poly)) (s4-0 (-> arg0 dest)) ) - (let ((s2-0 (-> obj current-pos-local))) + (let ((s2-0 (-> this current-pos-local))) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) (set! sv-56 10000000000000000000000000000000000000.0) @@ -2883,14 +2892,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (set! (-> s4-0 quad) (-> sv-52 quad)) ) - (vector+! (-> arg0 dest) (-> arg0 dest) (-> obj mesh bounds)) + (vector+! (-> arg0 dest) (-> arg0 dest) (-> this mesh bounds)) #t ) ) ) ) -(defmethod turn-and-navigate-to-destination nav-state ((obj nav-state)) +(defmethod turn-and-navigate-to-destination nav-state ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -2899,19 +2908,19 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf3 :class vf) ) (init-vf0-vector) - (set! (-> obj rotation-rate) (-> obj nav max-rotation-rate)) - (if (< 0.0 (-> obj speed)) - (set! (-> obj rotation-rate) + (set! (-> this rotation-rate) (-> this nav max-rotation-rate)) + (if (< 0.0 (-> this speed)) + (set! (-> this rotation-rate) (fmin - (-> obj rotation-rate) - (* (/ (-> obj nav turning-acceleration) (-> obj speed)) (-> obj mesh work rad-to-deg)) + (-> this rotation-rate) + (* (/ (-> this nav turning-acceleration) (-> this speed)) (-> this mesh work rad-to-deg)) ) ) ) - (when (logtest? (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (vector-z-quaternion! (-> obj heading) (-> obj nav shape quat)) - (set! (-> obj heading y) 0.0) - (let ((v1-12 (-> obj heading))) + (when (logtest? (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> this heading) (-> this nav shape quat)) + (set! (-> this heading y) 0.0) + (let ((v1-12 (-> this heading))) (let ((f0-5 1.0)) (.lvf vf1 (&-> v1-12 quad)) (.mul.vf vf2 vf1 vf1 :mask #b111) @@ -2932,16 +2941,16 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> obj nav shape trans quad)) - (if (or (not (-> obj current-poly)) - (!= (-> obj current-pos x) (-> a1-1 x)) - (!= (-> obj current-pos z) (-> a1-1 z)) + (set! (-> a1-1 quad) (-> this nav shape trans quad)) + (if (or (not (-> this current-poly)) + (!= (-> this current-pos x) (-> a1-1 x)) + (!= (-> this current-pos z) (-> a1-1 z)) ) - (do-navigation-to-destination obj a1-1) + (do-navigation-to-destination this a1-1) ) ) (logclear! - (-> obj flags) + (-> this flags) (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) ) 0 @@ -2949,27 +2958,27 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) -(defmethod navigate-using-route-portals-wrapper nav-state ((obj nav-state)) - (navigate-using-route-portals obj) +(defmethod navigate-using-route-portals-wrapper nav-state ((this nav-state)) + (navigate-using-route-portals this) 0 (none) ) -(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper nav-state ((obj nav-state)) - (navigate-using-best-dir-recompute-avoid-spheres-1 obj) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper nav-state ((this nav-state)) + (navigate-using-best-dir-recompute-avoid-spheres-1 this) 0 (none) ) -(defmethod navigate-within-poly-wrapper nav-state ((obj nav-state)) - (navigate-within-poly obj) +(defmethod navigate-within-poly-wrapper nav-state ((this nav-state)) + (navigate-within-poly this) 0 (none) ) -(defmethod compute-travel-speed nav-state ((obj nav-state)) +(defmethod compute-travel-speed nav-state ((this nav-state)) (local-vars (sv-192 float) (sv-196 float) (sv-200 float) (sv-204 float) (sv-224 vector)) - (let ((s5-0 obj)) + (let ((s5-0 this)) (let ((s4-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-cross-gaps (-> s5-0 mesh) @@ -3003,40 +3012,40 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) 0 (cond - ((logtest? (-> obj nav flags) (nav-control-flag use-momentum)) - (set! sv-192 (-> obj nav target-speed)) - (if (not (logtest? (-> obj nav flags) (nav-control-flag momentum-ignore-heading))) - (set! sv-192 (* sv-192 (fmax 0.0 (vector-dot (-> obj heading) (-> obj target-dir))))) + ((logtest? (-> this nav flags) (nav-control-flag use-momentum)) + (set! sv-192 (-> this nav target-speed)) + (if (not (logtest? (-> this nav flags) (nav-control-flag momentum-ignore-heading))) + (set! sv-192 (* sv-192 (fmax 0.0 (vector-dot (-> this heading) (-> this target-dir))))) ) - (set! sv-196 (- sv-192 (-> obj speed))) - (set! sv-200 (* (-> obj nav sec-per-frame) (-> obj nav acceleration))) + (set! sv-196 (- sv-192 (-> this speed))) + (set! sv-200 (* (-> this nav sec-per-frame) (-> this nav acceleration))) (set! sv-204 (fmin sv-200 (fabs sv-196))) (if (< sv-196 0.0) - (set! (-> obj speed) (- (-> obj speed) sv-204)) - (+! (-> obj speed) sv-204) + (set! (-> this speed) (- (-> this speed) sv-204)) + (+! (-> this speed) sv-204) ) ) (else - (set! (-> obj speed) (-> obj nav target-speed)) + (set! (-> this speed) (-> this nav target-speed)) ) ) - (let* ((f0-22 (/ (vector-length (-> obj travel)) (-> obj nav sec-per-frame))) - (f1-18 (fmin (* (-> obj nav speed-scale) (-> obj speed)) f0-22)) + (let* ((f0-22 (/ (vector-length (-> this travel)) (-> this nav sec-per-frame))) + (f1-18 (fmin (* (-> this nav speed-scale) (-> this speed)) f0-22)) ) (set! sv-224 (new 'stack-no-clear 'vector)) - (when (< f0-22 (-> obj speed)) - (set! (-> obj prev-speed) (-> obj speed)) - (set! (-> obj speed) (/ f0-22 (-> obj nav speed-scale))) + (when (< f0-22 (-> this speed)) + (set! (-> this prev-speed) (-> this speed)) + (set! (-> this speed) (/ f0-22 (-> this nav speed-scale))) ) - (vector-normalize-copy! sv-224 (-> obj travel) f1-18) + (vector-normalize-copy! sv-224 (-> this travel) f1-18) ) - (set! (-> obj velocity x) (-> sv-224 x)) - (set! (-> obj velocity z) (-> sv-224 z)) + (set! (-> this velocity x) (-> sv-224 x)) + (set! (-> this velocity z) (-> sv-224 z)) 0 (none) ) -(defmethod navigate-v1! nav-state ((obj nav-state)) +(defmethod navigate-v1! nav-state ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3045,7 +3054,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf3 :class vf) ) (init-vf0-vector) - (let ((s5-0 obj)) + (let ((s5-0 this)) (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) (if (< 0.0 (-> s5-0 speed)) (set! (-> s5-0 rotation-rate) @@ -3093,9 +3102,9 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) 0 - (navigate-using-route-portals obj) + (navigate-using-route-portals this) 0 - (let* ((v1-26 (-> obj nav)) + (let* ((v1-26 (-> this nav)) (a0-13 (-> v1-26 state mesh sphere-hash sphere-array)) (a1-2 (-> v1-26 sphere-id-array)) (a2-1 (-> v1-26 state mesh bounds)) @@ -3112,39 +3121,39 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) 0 - (navigate-using-best-dir-recompute-avoid-spheres-1 obj) + (navigate-using-best-dir-recompute-avoid-spheres-1 this) 0 - (navigate-within-poly obj) + (navigate-within-poly this) 0 - (compute-travel-speed obj) + (compute-travel-speed this) 0 (none) ) ) -(defmethod reset-target! nav-state ((obj nav-state)) - (vector-reset! (-> obj target-dir)) +(defmethod reset-target! nav-state ((this nav-state)) + (vector-reset! (-> this target-dir)) 0 (none) ) -(defmethod add-offset-to-target! nav-state ((obj nav-state) (arg0 vector)) - (vector+! (-> obj target-dir) (-> obj target-dir) arg0) +(defmethod add-offset-to-target! nav-state ((this nav-state) (arg0 vector)) + (vector+! (-> this target-dir) (-> this target-dir) arg0) 0 (none) ) -(defmethod nav-state-method-29 nav-state ((obj nav-state)) +(defmethod nav-state-method-29 nav-state ((this nav-state)) 0 (none) ) -(defmethod nav-state-method-30 nav-state ((obj nav-state)) +(defmethod nav-state-method-30 nav-state ((this nav-state)) 0 (none) ) -(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 nav-state ((obj nav-state)) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 nav-state ((this nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) @@ -3169,17 +3178,17 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (set! (-> s5-0 current-pos quad) (-> obj virtual-current-pos-local quad)) - (set! (-> s5-0 travel quad) (-> obj travel quad)) - (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> obj flags) (nav-state-flag trapped-by-sphere)) - (-> obj heading) - (-> obj travel) + (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> this travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) ) quad ) ) - (avoid-spheres-2! (-> obj nav) s5-0) - (let ((v1-5 obj)) + (avoid-spheres-2! (-> this nav) s5-0) + (let ((v1-5 this)) (when (-> s5-0 avoiding-sphere?) (logior! (-> v1-5 flags) (nav-state-flag avoiding-sphere)) (let ((f0-0 (-> s5-0 closest-sphere-dist2)) @@ -3313,15 +3322,15 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) 0 - (if (not (logtest? (-> obj flags) (nav-state-flag touching-sphere))) - (logclear! (-> obj flags) (nav-state-flag trapped-by-sphere)) + (if (not (logtest? (-> this flags) (nav-state-flag touching-sphere))) + (logclear! (-> this flags) (nav-state-flag trapped-by-sphere)) ) 0 (none) ) ) -(defmethod update-travel-dir-from-spheres nav-state ((obj nav-state)) +(defmethod update-travel-dir-from-spheres nav-state ((this nav-state)) (local-vars (v1-11 float) (v1-25 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -3331,15 +3340,15 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) (vector-reset! (-> s5-0 in-dir)) - (set! (-> s5-0 best-dir 0 quad) (-> obj travel quad)) + (set! (-> s5-0 best-dir 0 quad) (-> this travel quad)) (set! (-> s5-0 best-dir 0 y) 0.0) - (vector-normalize! (the-as vector (-> s5-0 best-dir)) (-> obj nav target-speed)) - (vector-! (-> s5-0 right-dir) (the-as vector (-> s5-0 best-dir)) (-> obj velocity)) + (vector-normalize! (the-as vector (-> s5-0 best-dir)) (-> this nav target-speed)) + (vector-! (-> s5-0 right-dir) (the-as vector (-> s5-0 best-dir)) (-> this velocity)) (vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) 4.0) (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) - (dotimes (s4-0 (-> obj nav sphere-count)) - (let ((s3-0 (-> obj nav sphere-array s4-0))) - (vector-! (-> s5-0 right-dir) (-> obj current-pos-local) (the-as vector s3-0)) + (dotimes (s4-0 (-> this nav sphere-count)) + (let ((s3-0 (-> this nav sphere-array s4-0))) + (vector-! (-> s5-0 right-dir) (-> this current-pos-local) (the-as vector s3-0)) (.lvf vf1 (&-> (-> s5-0 right-dir) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -3349,7 +3358,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (.mov v1-11 vf1) (let ((f30-0 v1-11)) (vector-normalize! (-> s5-0 right-dir) 2.0) - (let* ((f0-4 (+ (-> obj nav root-nav-sphere w) (-> s3-0 r))) + (let* ((f0-4 (+ (-> this nav root-nav-sphere w) (-> s3-0 r))) (f1-1 (* f0-4 f0-4)) (f0-7 (fmax 0.0 (/ (- f1-1 f30-0) f1-1))) ) @@ -3359,11 +3368,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) ) - (vector+! (-> obj target-dir) (-> obj target-dir) (-> s5-0 in-dir)) + (vector+! (-> this target-dir) (-> this target-dir) (-> s5-0 in-dir)) ) - (set! (-> obj target-dir y) 0.0) - (vector+float*! (-> obj velocity) (-> obj velocity) (-> obj target-dir) (-> obj nav sec-per-frame)) - (.lvf vf1 (&-> (-> obj velocity) quad)) + (set! (-> this target-dir y) 0.0) + (vector+float*! (-> this velocity) (-> this velocity) (-> this target-dir) (-> this nav sec-per-frame)) + (.lvf vf1 (&-> (-> this velocity) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -3371,19 +3380,19 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-25 vf1) (let ((f0-11 v1-25) - (f1-4 (-> obj nav target-speed)) + (f1-4 (-> this nav target-speed)) ) (if (< (* f1-4 f1-4) f0-11) - (vector-float*! (-> obj velocity) (-> obj velocity) (/ (-> obj nav target-speed) (sqrtf f0-11))) + (vector-float*! (-> this velocity) (-> this velocity) (/ (-> this nav target-speed) (sqrtf f0-11))) ) ) - (vector-float*! (-> obj travel) (-> obj velocity) (-> obj nav sec-per-frame)) + (vector-float*! (-> this travel) (-> this velocity) (-> this nav sec-per-frame)) 0 (none) ) ) -(defmethod compute-speed-simple nav-state ((obj nav-state)) +(defmethod compute-speed-simple nav-state ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3394,26 +3403,26 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-cross-gaps - (-> obj mesh) - (-> obj virtual-current-pos-local) - (-> obj virtual-current-poly) - (-> obj travel) - (-> obj mesh work nav-poly-min-dist) + (-> this mesh) + (-> this virtual-current-pos-local) + (-> this virtual-current-poly) + (-> this travel) + (-> this mesh work nav-poly-min-dist) #t s5-0 ) (if (-> s5-0 gap-poly) - (set! (-> obj next-poly) (-> s5-0 gap-poly)) + (set! (-> this next-poly) (-> s5-0 gap-poly)) ) ) (let* ((f0-1 40.96) (f0-3 (* f0-1 f0-1)) - (v1-9 (-> obj travel)) + (v1-9 (-> this travel)) ) (when (< f0-3 (+ (* (-> v1-9 x) (-> v1-9 x)) (* (-> v1-9 z) (-> v1-9 z)))) - (set! (-> obj heading quad) (-> obj travel quad)) - (set! (-> obj heading y) 0.0) - (let ((v1-13 (-> obj heading))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-13 (-> this heading))) (let ((f0-5 1.0)) (.lvf vf1 (&-> v1-13 quad)) (.mul.vf vf2 vf1 vf1 :mask #b111) @@ -3434,15 +3443,15 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) ) - (vector-float*! (-> obj velocity) (-> obj travel) (/ 1.0 (-> obj nav sec-per-frame))) - (set! (-> obj speed) (vector-length (-> obj velocity))) - (vector-reset! (-> obj target-dir)) + (vector-float*! (-> this velocity) (-> this travel) (/ 1.0 (-> this nav sec-per-frame))) + (set! (-> this speed) (vector-length (-> this velocity))) + (vector-reset! (-> this target-dir)) 0 (none) ) ) -(defmethod navigate-v2! nav-state ((obj nav-state)) +(defmethod navigate-v2! nav-state ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3451,7 +3460,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf3 :class vf) ) (init-vf0-vector) - (let ((s5-0 obj)) + (let ((s5-0 this)) (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) (if (< 0.0 (-> s5-0 speed)) (set! (-> s5-0 rotation-rate) @@ -3499,9 +3508,9 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) 0 - (navigate-using-route-portals obj) + (navigate-using-route-portals this) 0 - (let* ((v1-26 (-> obj nav)) + (let* ((v1-26 (-> this nav)) (a0-13 (-> v1-26 state mesh sphere-hash sphere-array)) (a1-2 (-> v1-26 sphere-id-array)) (a2-1 (-> v1-26 state mesh bounds)) @@ -3518,9 +3527,9 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) 0 - (navigate-using-best-dir-recompute-avoid-spheres-2 obj) - (update-travel-dir-from-spheres obj) - (compute-speed-simple obj) + (navigate-using-best-dir-recompute-avoid-spheres-2 this) + (update-travel-dir-from-spheres this) + (compute-speed-simple this) 0 (none) ) diff --git a/goal_src/jak2/engine/nav/nav-enemy.gc b/goal_src/jak2/engine/nav/nav-enemy.gc index a05642e902..e885c2cab1 100644 --- a/goal_src/jak2/engine/nav/nav-enemy.gc +++ b/goal_src/jak2/engine/nav/nav-enemy.gc @@ -7,44 +7,44 @@ ;; DECOMP BEGINS -(defmethod copy-nav-enemy-info! nav-enemy-info ((obj nav-enemy-info) (obj-to-copy nav-enemy-info)) +(defmethod copy-nav-enemy-info! nav-enemy-info ((this nav-enemy-info) (obj-to-copy nav-enemy-info)) "Copies the provided [[nav-enemy-info]] into the current object" - (mem-copy! (&-> obj type) (&-> obj-to-copy type) 492) + (mem-copy! (&-> this type) (&-> obj-to-copy type) 492) 0 (none) ) -(defmethod enemy-method-61 nav-enemy ((obj nav-enemy) (arg0 int)) +(defmethod enemy-method-61 nav-enemy ((this nav-enemy) (arg0 int)) (let* ((t9-0 (method-of-type enemy enemy-method-61)) - (s5-0 (t9-0 obj arg0)) + (s5-0 (t9-0 this arg0)) ) - (if (and (>= 1 (the-as int (-> obj focus aware))) (< 1 s5-0)) - (nav-enemy-method-161 obj) + (if (and (>= 1 (the-as int (-> this focus aware))) (< 1 s5-0)) + (nav-enemy-method-161 this) ) s5-0 ) ) -(defmethod general-event-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('nav-mesh-kill) - (deactivate obj) + (deactivate this) #t ) (('nav-mesh-new) - (set! (-> obj water-max-height) (-> obj nav state mesh water-max-height)) + (set! (-> this water-max-height) (-> this nav state mesh water-max-height)) #t ) (('debug-control-on) - (go (method-of-object obj debug-control)) + (go (method-of-object this debug-control)) ) (('debug-control-off) - (react-to-focus obj) + (react-to-focus this) ) (else - ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -59,28 +59,28 @@ ) ) -(defmethod nav-enemy-method-156 nav-enemy ((obj nav-enemy)) +(defmethod nav-enemy-method-156 nav-enemy ((this nav-enemy)) (cond - ((zero? (-> obj path)) + ((zero? (-> this path)) (go process-drawable-art-error "no path") ) (else - (let ((s4-0 (-> obj path curve num-cverts))) + (let ((s4-0 (-> this path curve num-cverts))) (if (<= s4-0 0) (go process-drawable-art-error "no path") ) - (let ((s2-0 (get-rand-int obj s4-0)) + (let ((s2-0 (get-rand-int this s4-0)) (s5-0 (new 'stack-no-clear 'vector)) ) (countdown (s3-0 s4-0) - (get-point-in-path! (-> obj path) s5-0 (the float s2-0) 'interp) - (if (< 4096.0 (vector-vector-xz-distance s5-0 (-> obj root trans))) + (get-point-in-path! (-> this path) s5-0 (the float s2-0) 'interp) + (if (< 4096.0 (vector-vector-xz-distance s5-0 (-> this root trans))) (goto cfg-11) ) (set! s2-0 (mod (+ s2-0 1) s4-0)) ) (label cfg-11) - (let ((v1-19 (-> obj nav state))) + (let ((v1-19 (-> this nav state))) (logclear! (-> v1-19 flags) (nav-state-flag directional-mode)) (logior! (-> v1-19 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-19 target-post quad) (-> s5-0 quad)) @@ -94,9 +94,9 @@ (none) ) -(defmethod enemy-method-102 nav-enemy ((obj nav-enemy)) - (let ((gp-0 (-> obj root)) - (s3-0 (-> obj nav state)) +(defmethod enemy-method-102 nav-enemy ((this nav-enemy)) + (let ((gp-0 (-> this root)) + (s3-0 (-> this nav state)) ) (do-navigation-to-destination s3-0 (-> gp-0 trans)) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -115,9 +115,9 @@ ) ) (cond - ((-> obj enemy-info move-to-ground) + ((-> this enemy-info move-to-ground) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (when (enemy-above-ground? obj s3-1 s4-0 (-> obj enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) + (when (enemy-above-ground? this s3-1 s4-0 (-> this enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) (let ((f0-4 (- (-> gp-0 trans y) (-> s3-1 best-other-tri intersect y)))) (if (and (>= 12288.0 f0-4) (< -8192.0 f0-4)) (return #f) @@ -136,20 +136,20 @@ ) ;; WARN: Return type mismatch vector vs symbol. -(defmethod enemy-method-100 nav-enemy ((obj nav-enemy)) +(defmethod enemy-method-100 nav-enemy ((this nav-enemy)) (local-vars (v0-1 vector)) - (when (not (-> obj enemy-info move-to-ground)) - (enemy-method-103 obj) + (when (not (-> this enemy-info move-to-ground)) + (enemy-method-103 this) (return (the-as symbol #f)) ) - (when (not (logtest? (enemy-flag directed) (-> obj enemy-flags))) - (let ((s5-0 (-> obj root))) - (if (focus-test? obj under-water) - (enemy-method-47 obj (-> s5-0 transv)) - (+! (-> s5-0 transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame))) + (when (not (logtest? (enemy-flag directed) (-> this enemy-flags))) + (let ((s5-0 (-> this root))) + (if (focus-test? this under-water) + (enemy-method-47 this (-> s5-0 transv)) + (+! (-> s5-0 transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) - (let ((v1-16 (-> obj enemy-info))) + (let ((v1-16 (-> this enemy-info))) (set! (-> a2-0 gnd-collide-with) (-> v1-16 recover-gnd-collide-with)) (set! (-> a2-0 popup) 8192.0) (set! (-> a2-0 dont-move-if-overlaps?) #t) @@ -159,16 +159,16 @@ ) (set! (-> a2-0 overlaps-params tlist) *touching-list*) (-> a2-0 overlaps-params) - (enemy-method-128 obj (-> s5-0 transv) a2-0) + (enemy-method-128 this (-> s5-0 transv) a2-0) ) ) ) - (logclear! (-> obj enemy-flags) (enemy-flag directed)) - (if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead)))) - (kill-prefer-falling obj) + (logclear! (-> this enemy-flags) (enemy-flag directed)) + (if (and (enemy-method-102 this) (not (logtest? (-> this focus-status) (focus-status dead)))) + (kill-prefer-falling this) ) - (the-as symbol (when (logtest? (-> obj nav state flags) (nav-state-flag in-mesh)) - (let ((s5-1 (-> obj root)) + (the-as symbol (when (logtest? (-> this nav state flags) (nav-state-flag in-mesh)) + (let ((s5-1 (-> this root)) (a1-2 (new 'stack-no-clear 'collide-query)) (s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -176,10 +176,10 @@ (set! (-> s3-0 quad) (-> s5-1 gspot-pos quad)) (set! (-> s4-0 quad) (-> s5-1 gspot-normal quad)) (cond - ((find-ground s5-1 a1-2 (-> obj enemy-info gnd-collide-with) 8192.0 81920.0 1024.0) + ((find-ground s5-1 a1-2 (-> this enemy-info gnd-collide-with) 8192.0 81920.0 1024.0) (let ((f0-4 (- (-> s5-1 trans y) (-> s5-1 gspot-pos y)))) (when (>= 409.6 (fabs f0-4)) - (enemy-method-103 obj) + (enemy-method-103 this) (return (the-as symbol #f)) v0-1 ) @@ -203,7 +203,7 @@ - looks at the target and handles attacking @TODO Not extremely well understood yet" (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) (when (logtest? (enemy-flag use-trigger) (-> self enemy-flags)) @@ -245,7 +245,7 @@ ) ) (when (and (logtest? (-> self enemy-flags) (enemy-flag attackable-backup)) - (>= (- (current-time) (-> self auto-reset-penetrate-time)) (seconds 0.1)) + (time-elapsed? (-> self auto-reset-penetrate-time) (seconds 0.1)) ) (logclear! (-> self enemy-flags) (enemy-flag attackable-backup)) (set! (-> self root penetrated-by) (get-penetrate-info self)) @@ -278,12 +278,12 @@ (none) ) -(defmethod nav-enemy-method-177 nav-enemy ((obj nav-enemy)) - (let ((v1-2 (-> obj nav state current-poly))) +(defmethod nav-enemy-method-177 nav-enemy ((this nav-enemy)) + (let ((v1-2 (-> this nav state current-poly))) (when (and v1-2 (logtest? (-> v1-2 pat) 4) (!= (-> v1-2 link) 255)) - (let ((v1-6 (-> obj nav state mesh link-array (-> v1-2 link) dest-mesh))) + (let ((v1-6 (-> this nav state mesh link-array (-> v1-2 link) dest-mesh))) (if v1-6 - (change-to v1-6 obj) + (change-to v1-6 this) ) ) ) @@ -292,56 +292,56 @@ (none) ) -(defmethod nav-enemy-method-176 nav-enemy ((obj nav-enemy)) - (nav-enemy-method-177 obj) +(defmethod nav-enemy-method-176 nav-enemy ((this nav-enemy)) + (nav-enemy-method-177 this) (cond - ((nav-enemy-method-174 obj) - (logior! (-> obj enemy-flags) (enemy-flag directed)) - (let ((s5-0 (-> obj nav))) + ((nav-enemy-method-174 this) + (logior! (-> this enemy-flags) (enemy-flag directed)) + (let ((s5-0 (-> this nav))) (when (logtest? (-> s5-0 state flags) (nav-state-flag at-gap)) (let ((s4-0 (new 'stack-no-clear 'nav-gap-info))) (when (plan-over-pat1-polys-using-route (-> s5-0 state) s4-0) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable) (-> obj enemy-flags)))) - (send-event obj 'jump 1 (-> s4-0 dest)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable) (-> this enemy-flags)))) + (send-event this 'jump 1 (-> s4-0 dest)) ) ) ) (cond - ((logtest? (enemy-flag enemy-flag38) (-> obj enemy-flags)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag38)))) + ((logtest? (enemy-flag enemy-flag38) (-> this enemy-flags)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag38)))) ) (else - (when (not (logtest? (enemy-flag enemy-flag42) (-> obj enemy-flags))) - (nav-enemy-method-142 obj s5-0) - (nav-enemy-method-143 obj s5-0) + (when (not (logtest? (enemy-flag enemy-flag42) (-> this enemy-flags))) + (nav-enemy-method-142 this s5-0) + (nav-enemy-method-143 this s5-0) ) ) ) (cond ((logtest? (-> s5-0 state flags) (nav-state-flag blocked)) - (if (zero? (-> obj blocked-start-time)) - (set! (-> obj blocked-start-time) (current-time)) + (if (zero? (-> this blocked-start-time)) + (set-time! (-> this blocked-start-time)) ) ) (else - (set! (-> obj blocked-start-time) 0) + (set! (-> this blocked-start-time) 0) 0 ) ) ) ) (else - (set! (-> obj blocked-start-time) 0) + (set! (-> this blocked-start-time) 0) 0 ) ) - (track-target! obj) - (update-transforms (-> obj root)) + (track-target! this) + (update-transforms (-> this root)) 0 (none) ) -(defmethod nav-enemy-method-145 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-145 nav-enemy ((this nav-enemy) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -403,40 +403,40 @@ ) ) -(defmethod nav-enemy-method-146 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-146 nav-enemy ((this nav-enemy) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 (none) ) -(defmethod nav-enemy-method-147 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-147 nav-enemy ((this nav-enemy) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-1 (-> arg0 state)) 0 0 (none) ) -(defmethod nav-enemy-method-148 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-148 nav-enemy ((this nav-enemy) (arg0 nav-control)) (navigate-within-poly (-> arg0 state)) 0 0 (none) ) -(defmethod nav-enemy-method-149 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-149 nav-enemy ((this nav-enemy) (arg0 nav-control)) (compute-travel-speed (-> arg0 state)) 0 (none) ) -(defmethod nav-enemy-method-155 nav-enemy ((obj nav-enemy)) - (navigate-v1! (-> obj nav state)) +(defmethod nav-enemy-method-155 nav-enemy ((this nav-enemy)) + (navigate-v1! (-> this nav state)) 0 (none) ) -(defmethod nav-enemy-method-150 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-150 nav-enemy ((this nav-enemy) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -498,32 +498,32 @@ ) ) -(defmethod nav-enemy-method-151 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-151 nav-enemy ((this nav-enemy) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 (none) ) -(defmethod nav-enemy-method-152 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-152 nav-enemy ((this nav-enemy) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg0 state)) 0 (none) ) -(defmethod nav-enemy-method-153 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-153 nav-enemy ((this nav-enemy) (arg0 nav-control)) (update-travel-dir-from-spheres (-> arg0 state)) 0 (none) ) -(defmethod nav-enemy-method-154 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-154 nav-enemy ((this nav-enemy) (arg0 nav-control)) (compute-speed-simple (-> arg0 state)) 0 (none) ) -(defmethod nav-enemy-method-142 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-142 nav-enemy ((this nav-enemy) (arg0 nav-control)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s5-0 quad) (-> a1-1 heading quad)) @@ -532,32 +532,32 @@ (vector-normalize! s5-0 1.0) ;; og:preserve-this modified for PC, see comment near definition in collide-shape-h.gc - (normalized-heading-to-quaternion! (-> obj root quat) s5-0) + (normalized-heading-to-quaternion! (-> this root quat) s5-0) ) - (quaternion-normalize! (-> obj root quat)) + (quaternion-normalize! (-> this root quat)) 0 (none) ) -(defmethod nav-enemy-method-143 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-143 nav-enemy ((this nav-enemy) (arg0 nav-control)) (let ((v1-0 (new 'stack-no-clear 'vector))) (let ((a2-0 (-> arg0 state))) (set! (-> v1-0 quad) (-> a2-0 velocity quad)) ) - (let ((a0-3 (-> obj root transv))) + (let ((a0-3 (-> this root transv))) (set! (-> a0-3 x) (-> v1-0 x)) (set! (-> a0-3 z) (-> v1-0 z)) ) ) (cond - ((-> obj enemy-info move-to-ground) - (if (focus-test? obj under-water) - (enemy-method-47 obj (-> obj root transv)) - (+! (-> obj root transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame))) + ((-> this enemy-info move-to-ground) + (if (focus-test? this under-water) + (enemy-method-47 this (-> this root transv)) + (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) (let ((a2-3 (new 'stack-no-clear 'move-above-ground-params))) - (let ((v1-14 (-> obj enemy-info))) - (set! (-> a2-3 gnd-collide-with) (the-as collide-spec (-> obj gnd-collide))) + (let ((v1-14 (-> this enemy-info))) + (set! (-> a2-3 gnd-collide-with) (the-as collide-spec (-> this gnd-collide))) (set! (-> a2-3 popup) 8192.0) (set! (-> a2-3 dont-move-if-overlaps?) #t) (set! (-> a2-3 hover-if-no-ground?) (-> v1-14 hover-if-no-ground)) @@ -566,15 +566,15 @@ ) (set! (-> a2-3 overlaps-params tlist) *touching-list*) (-> a2-3 overlaps-params) - (enemy-method-128 obj (-> obj root transv) a2-3) + (enemy-method-128 this (-> this root transv) a2-3) ) ) (else (let ((a2-4 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a2-4 options) (overlaps-others-options oo0)) - (set! (-> a2-4 collide-with-filter) (-> obj enemy-info overlaps-others-collide-with-filter)) + (set! (-> a2-4 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) (set! (-> a2-4 tlist) *touching-list*) - (integrate-for-enemy-no-mtg (-> obj root) (-> obj root transv) a2-4) + (integrate-for-enemy-no-mtg (-> this root) (-> this root transv) a2-4) ) ) ) @@ -820,45 +820,45 @@ ) ) -(defmethod nav-enemy-method-170 nav-enemy ((obj nav-enemy)) - (if (not (logtest? (enemy-flag enemy-flag36) (-> obj enemy-flags))) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> obj enemy-flags)))) +(defmethod nav-enemy-method-170 nav-enemy ((this nav-enemy)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> this enemy-flags))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> this enemy-flags)))) ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> obj enemy-flags)))) - (set! (-> obj nav callback-info) (-> obj enemy-info callback-info)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> this enemy-flags)))) + (set! (-> this nav callback-info) (-> this enemy-info callback-info)) 0 (none) ) -(defmethod nav-enemy-method-171 nav-enemy ((obj nav-enemy)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag36)))) - (set! (-> obj nav callback-info) *nav-enemy-null-callback-info*) +(defmethod nav-enemy-method-171 nav-enemy ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> this nav callback-info) *nav-enemy-null-callback-info*) 0 (none) ) -(defmethod nav-enemy-method-172 nav-enemy ((obj nav-enemy)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> obj enemy-flags)))) +(defmethod nav-enemy-method-172 nav-enemy ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> this enemy-flags)))) 0 (none) ) -(defmethod nav-enemy-method-173 nav-enemy ((obj nav-enemy)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag37)))) +(defmethod nav-enemy-method-173 nav-enemy ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag37)))) 0 (none) ) -(defmethod nav-enemy-method-174 nav-enemy ((obj nav-enemy)) - (logtest? (enemy-flag enemy-flag36) (-> obj enemy-flags)) +(defmethod nav-enemy-method-174 nav-enemy ((this nav-enemy)) + (logtest? (enemy-flag enemy-flag36) (-> this enemy-flags)) ) -(defmethod nav-enemy-method-175 nav-enemy ((obj nav-enemy)) - (logtest? (enemy-flag enemy-flag37) (-> obj enemy-flags)) +(defmethod nav-enemy-method-175 nav-enemy ((this nav-enemy)) + (logtest? (enemy-flag enemy-flag37) (-> this enemy-flags)) ) -(defmethod nav-enemy-method-157 nav-enemy ((obj nav-enemy) (arg0 vector)) - (let ((v1-0 (-> obj nav)) +(defmethod nav-enemy-method-157 nav-enemy ((this nav-enemy) (arg0 vector)) + (let ((v1-0 (-> this nav)) (a0-1 arg0) (a1-1 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -869,13 +869,13 @@ ) ) -(defmethod nav-enemy-method-158 nav-enemy ((obj nav-enemy) (arg0 vector)) - (let ((f1-0 (-> obj root trans y)) +(defmethod nav-enemy-method-158 nav-enemy ((this nav-enemy) (arg0 vector)) + (let ((f1-0 (-> this root trans y)) (f0-0 (-> arg0 y)) - (v1-1 (-> obj fact)) + (v1-1 (-> this fact)) ) (and (< f0-0 (+ f1-0 (-> v1-1 notice-top))) - (and (< (- f1-0 (-> v1-1 notice-bottom)) f0-0) (let ((v1-3 (-> obj nav)) + (and (< (- f1-0 (-> v1-1 notice-bottom)) f0-0) (let ((v1-3 (-> this nav)) (a0-1 arg0) (a1-1 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -889,20 +889,20 @@ ) ) -(defmethod nav-enemy-method-159 nav-enemy ((obj nav-enemy) (arg0 vector)) - (let ((f1-0 (-> obj root trans y)) +(defmethod nav-enemy-method-159 nav-enemy ((this nav-enemy) (arg0 vector)) + (let ((f1-0 (-> this root trans y)) (f0-0 (-> arg0 y)) - (v1-1 (-> obj fact)) + (v1-1 (-> this fact)) ) (and (< f0-0 (+ f1-0 (-> v1-1 notice-top))) (and (< (- f1-0 (-> v1-1 notice-bottom)) f0-0) - (is-in-mesh? (-> obj nav) arg0 (-> obj enemy-info notice-nav-radius)) + (is-in-mesh? (-> this nav) arg0 (-> this enemy-info notice-nav-radius)) ) ) ) ) -(defmethod in-aggro-range? nav-enemy ((obj nav-enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? nav-enemy ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -913,16 +913,16 @@ ) (when arg1 (let* ((f0-0 (-> arg1 y)) - (v1-4 (-> obj root)) + (v1-4 (-> this root)) (f1-0 (-> v1-4 trans y)) - (a0-2 (-> obj fact)) + (a0-2 (-> this fact)) ) (when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0)) - (let* ((f30-0 (-> obj enemy-info notice-nav-radius)) + (let* ((f30-0 (-> this enemy-info notice-nav-radius)) (f0-1 f30-0) ) (or (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1)) - (is-in-mesh? (-> obj nav) arg1 f30-0) + (is-in-mesh? (-> this nav) arg1 f30-0) ) ) ) @@ -930,12 +930,12 @@ ) ) -(defmethod nav-enemy-method-161 nav-enemy ((obj nav-enemy)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag not-frustrated)))) - (set! (-> obj frustration-time) (current-time)) - (let ((v1-7 (handle->process (-> obj focus handle)))) +(defmethod nav-enemy-method-161 nav-enemy ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag not-frustrated)))) + (set-time! (-> this frustration-time)) + (let ((v1-7 (handle->process (-> this focus handle)))) (if v1-7 - (set! (-> obj frustration-point quad) (-> (get-trans (the-as process-focusable v1-7) 1) quad)) + (set! (-> this frustration-point quad) (-> (get-trans (the-as process-focusable v1-7) 1) quad)) ) ) 0 @@ -943,22 +943,20 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-enemy-method-160 nav-enemy ((obj nav-enemy)) - (let ((s5-0 (handle->process (-> obj focus handle)))) +(defmethod nav-enemy-method-160 nav-enemy ((this nav-enemy)) + (let ((s5-0 (handle->process (-> this focus handle)))) (cond ((or (not s5-0) - (< 6144.0 (vector-vector-distance (get-trans (the-as process-focusable s5-0) 1) (-> obj frustration-point))) - (< (-> obj enemy-info frustration-distance) - (vector-vector-xz-distance (get-trans (the-as process-focusable s5-0) 0) (-> obj root trans)) + (< 6144.0 (vector-vector-distance (get-trans (the-as process-focusable s5-0) 1) (-> this frustration-point))) + (< (-> this enemy-info frustration-distance) + (vector-vector-xz-distance (get-trans (the-as process-focusable s5-0) 0) (-> this root trans)) ) ) - (nav-enemy-method-161 obj) + (nav-enemy-method-161 this) ) (else - (when (>= (- (current-time) (-> obj frustration-time)) - (+ (-> obj reaction-time) (-> obj enemy-info frustration-time)) - ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag not-frustrated) (-> obj enemy-flags)))) + (when (time-elapsed? (-> this frustration-time) (+ (-> this reaction-time) (-> this enemy-info frustration-time))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag not-frustrated) (-> this enemy-flags)))) 0 ) ) @@ -967,72 +965,72 @@ (none) ) -(defmethod nav-enemy-method-162 nav-enemy ((obj nav-enemy)) - (set! (-> obj blocked-start-time) 0) +(defmethod nav-enemy-method-162 nav-enemy ((this nav-enemy)) + (set! (-> this blocked-start-time) 0) 0 (none) ) -(defmethod nav-enemy-method-163 nav-enemy ((obj nav-enemy)) - (let ((v1-0 (-> obj blocked-start-time))) - (and (nonzero? v1-0) (>= (- (current-time) v1-0) (-> obj enemy-info blocked-time))) +(defmethod nav-enemy-method-163 nav-enemy ((this nav-enemy)) + (let ((v1-0 (-> this blocked-start-time))) + (and (nonzero? v1-0) (time-elapsed? v1-0 (-> this enemy-info blocked-time))) ) ) -(defmethod nav-enemy-method-164 nav-enemy ((obj nav-enemy)) - (if (-> obj enemy-info use-momentum) - (logior! (-> obj nav flags) (nav-control-flag use-momentum)) - (logclear! (-> obj nav flags) (nav-control-flag use-momentum)) +(defmethod nav-enemy-method-164 nav-enemy ((this nav-enemy)) + (if (-> this enemy-info use-momentum) + (logior! (-> this nav flags) (nav-control-flag use-momentum)) + (logclear! (-> this nav flags) (nav-control-flag use-momentum)) ) 0 (none) ) -(defmethod nav-enemy-method-167 nav-enemy ((obj nav-enemy)) - (let ((v1-0 (-> obj nav))) +(defmethod nav-enemy-method-167 nav-enemy ((this nav-enemy)) + (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) 0.0) ) 0 - (let ((v1-3 (-> obj nav state))) + (let ((v1-3 (-> this nav state))) (set! (-> v1-3 speed) 0.0) ) 0 - (let ((v1-5 (-> obj nav))) - (set! (-> v1-5 acceleration) (-> obj enemy-info walk-acceleration)) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 acceleration) (-> this enemy-info walk-acceleration)) ) 0 0 (none) ) -(defmethod nav-enemy-method-165 nav-enemy ((obj nav-enemy)) - (let ((v1-0 (-> obj nav))) - (set! (-> v1-0 target-speed) (-> obj enemy-info walk-travel-speed)) +(defmethod nav-enemy-method-165 nav-enemy ((this nav-enemy)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 target-speed) (-> this enemy-info walk-travel-speed)) ) 0 - (let ((v1-2 (-> obj nav))) - (set! (-> v1-2 acceleration) (-> obj enemy-info walk-acceleration)) + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 acceleration) (-> this enemy-info walk-acceleration)) ) 0 - (let ((v1-4 (-> obj nav))) - (set! (-> v1-4 turning-acceleration) (-> obj enemy-info walk-turning-acceleration)) + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 turning-acceleration) (-> this enemy-info walk-turning-acceleration)) ) 0 0 (none) ) -(defmethod nav-enemy-method-166 nav-enemy ((obj nav-enemy)) - (let ((v1-0 (-> obj nav))) - (set! (-> v1-0 target-speed) (-> obj enemy-info run-travel-speed)) +(defmethod nav-enemy-method-166 nav-enemy ((this nav-enemy)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 target-speed) (-> this enemy-info run-travel-speed)) ) 0 - (let ((v1-2 (-> obj nav))) - (set! (-> v1-2 acceleration) (-> obj enemy-info run-acceleration)) + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 acceleration) (-> this enemy-info run-acceleration)) ) 0 - (let ((v1-4 (-> obj nav))) - (set! (-> v1-4 turning-acceleration) (-> obj enemy-info run-turning-acceleration)) + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 turning-acceleration) (-> this enemy-info run-turning-acceleration)) ) 0 0 @@ -1040,165 +1038,167 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod set-enemy-info! nav-enemy ((obj nav-enemy) (arg0 nav-enemy-info)) +(defmethod set-enemy-info! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) "In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it @param info Set `enemy-info` accordingly" - (set! (-> obj enemy-info) arg0) + (set! (-> this enemy-info) arg0) (set! (-> arg0 callback-info) *nav-enemy-callback-info*) - (when (and (!= (-> obj enemy-info neck-joint) -1) (zero? (-> obj neck))) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj (-> obj enemy-info neck-joint))) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 102400.0) - (set! (-> obj neck ignore-angle) 16384.0) + (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) + (set! (-> this neck) + (new 'process 'joint-mod (joint-mod-mode flex-blend) this (-> this enemy-info neck-joint)) + ) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) ) (none) ) -(defmethod init-enemy-behaviour-and-stats! nav-enemy ((obj nav-enemy) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (local-vars (sv-16 res-tag)) - (when (coin-flip? obj) - (let ((a0-2 (-> obj node-list data 2))) + (when (coin-flip? this) + (let ((a0-2 (-> this node-list data 2))) (set! (-> a0-2 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!)) (set! (-> a0-2 param1) #f) (set! (-> a0-2 param2) #f) ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag dislike-combo) (-> obj enemy-flags)))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag dislike-combo) (-> this enemy-flags)))) ) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj enemy-flags) (enemy-flag notice)) - (set! (-> obj nav-radius-backup) (-> obj root nav-radius)) - (set-enemy-info! obj arg0) - (set! (-> obj enemy-info callback-info) *nav-enemy-callback-info*) - (let ((a1-2 (-> obj enemy-info idle-anim-script))) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask actor-pause)) + (logior! (-> this enemy-flags) (enemy-flag notice)) + (set! (-> this nav-radius-backup) (-> this root nav-radius)) + (set-enemy-info! this arg0) + (set! (-> this enemy-info callback-info) *nav-enemy-callback-info*) + (let ((a1-2 (-> this enemy-info idle-anim-script))) (if a1-2 - (idle-control-method-9 (-> obj idle-anim-player) a1-2) + (idle-control-method-9 (-> this idle-anim-player) a1-2) ) ) - (if (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) (new - 'process - 'shadow-control - (-> obj enemy-info shadow-min-y) - (-> obj enemy-info shadow-max-y) - (-> obj enemy-info shadow-locus-dist) - (shadow-flags shdf00 shdf04) - 245760.0 - ) + (if (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new + 'process + 'shadow-control + (-> this enemy-info shadow-min-y) + (-> this enemy-info shadow-max-y) + (-> this enemy-info shadow-locus-dist) + (shadow-flags shdf00 shdf04) + 245760.0 + ) ) - (set! (-> obj draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) + (set! (-> this draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) ) - (get-nav-control obj (-> arg0 nav-mesh)) - (set! (-> obj water-max-height) (-> obj nav state mesh water-max-height)) - (let ((v1-33 obj)) + (get-nav-control this (-> arg0 nav-mesh)) + (set! (-> this water-max-height) (-> this nav state mesh water-max-height)) + (let ((v1-33 this)) (set! (-> v1-33 enemy-flags) (the-as enemy-flag (logclear (-> v1-33 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-33 nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (let ((v1-36 obj)) + (let ((v1-36 this)) (set! (-> v1-36 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-36 enemy-flags)))) ) 0 - (logior! (-> obj nav flags) (nav-control-flag display-marks limit-rotation-rate)) - (logior! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag43) (-> obj enemy-flags)))) - (let ((v1-47 (-> obj nav))) + (logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate)) + (logior! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag43) (-> this enemy-flags)))) + (let ((v1-47 (-> this nav))) (set! (-> v1-47 target-speed) 0.0) ) 0 - (let ((v1-49 (-> obj nav))) - (set! (-> v1-49 acceleration) (-> obj enemy-info walk-acceleration)) + (let ((v1-49 (-> this nav))) + (set! (-> v1-49 acceleration) (-> this enemy-info walk-acceleration)) ) 0 - (let ((v1-51 (-> obj nav))) - (set! (-> v1-51 turning-acceleration) (-> obj enemy-info walk-turning-acceleration)) + (let ((v1-51 (-> this nav))) + (set! (-> v1-51 turning-acceleration) (-> this enemy-info walk-turning-acceleration)) ) 0 - (let ((v1-53 (-> obj nav))) - (set! (-> v1-53 max-rotation-rate) (-> obj enemy-info maximum-rotation-rate)) + (let ((v1-53 (-> this nav))) + (set! (-> v1-53 max-rotation-rate) (-> this enemy-info maximum-rotation-rate)) ) 0 - (nav-enemy-method-164 obj) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #t)) - (if (nonzero? (-> obj path)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (nav-enemy-method-164 this) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #t)) + (if (nonzero? (-> this path)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) ) (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) - (set! (-> obj hit-points) (* (-> obj enemy-info default-hit-points) 2)) - (set! (-> obj hit-points) (-> obj enemy-info default-hit-points)) + (set! (-> this hit-points) (* (-> this enemy-info default-hit-points) 2)) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) ) (let* ((v1-71 *game-info*) (a0-28 (+ (-> v1-71 attack-id) 1)) ) (set! (-> v1-71 attack-id) a0-28) - (set! (-> obj attack-id) a0-28) + (set! (-> this attack-id) a0-28) ) (let* ((v1-72 *game-info*) (a0-30 (+ (-> v1-72 attack-id) 1)) ) (set! (-> v1-72 attack-id) a0-30) - (set! (-> obj persistent-attack-id) a0-30) + (set! (-> this persistent-attack-id) a0-30) ) - (enemy-method-124 obj) - (set! (-> obj fact) (new - 'process - 'fact-info-enemy - obj - (the-as (pointer float) (-> arg0 fact-defaults)) - (pickup-type eco-pill-random) - (-> *FACT-bank* default-eco-pill-green-inc) - ) + (enemy-method-124 this) + (set! (-> this fact) (new + 'process + 'fact-info-enemy + this + (the-as (pointer float) (-> arg0 fact-defaults)) + (pickup-type eco-pill-random) + (-> *FACT-bank* default-eco-pill-green-inc) + ) ) - (let ((a1-9 (if (logtest? (enemy-option multi-focus) (-> obj fact enemy-options)) + (let ((a1-9 (if (logtest? (enemy-option multi-focus) (-> this fact enemy-options)) 1030 1026 ) ) ) - (reset-to-collide-spec (-> obj focus) (the-as collide-spec a1-9)) + (reset-to-collide-spec (-> this focus) (the-as collide-spec a1-9)) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-82 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-82 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-82 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-82)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-82)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice symbol)) - (set! (-> obj on-active) (res-lump-struct (-> obj entity) 'on-active symbol)) - (set! (-> obj on-hostile) (res-lump-struct (-> obj entity) 'on-hostile symbol)) - (set! (-> obj on-death) (res-lump-struct (-> obj entity) 'on-death symbol)) - (if (-> obj on-notice) - (logior! (-> obj enemy-flags) (enemy-flag auto-reset-penetrate)) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice symbol)) + (set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active symbol)) + (set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile symbol)) + (set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death symbol)) + (if (-> this on-notice) + (logior! (-> this enemy-flags) (enemy-flag auto-reset-penetrate)) ) - (if (-> obj on-active) - (logior! (-> obj enemy-flags) (enemy-flag jump-check-blocked)) + (if (-> this on-active) + (logior! (-> this enemy-flags) (enemy-flag jump-check-blocked)) ) - (if (-> obj on-hostile) - (logior! (-> obj enemy-flags) (enemy-flag drawn-mirrored)) + (if (-> this on-hostile) + (logior! (-> this enemy-flags) (enemy-flag drawn-mirrored)) ) - (set! (-> obj incoming attacker-handle) (the-as handle #f)) - (let ((s4-0 (-> obj root))) - (set! (-> obj penetrated-by-all) (-> obj root penetrated-by)) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) + (set! (-> this incoming attacker-handle) (the-as handle #f)) + (let ((s4-0 (-> this root))) + (set! (-> this penetrated-by-all) (-> this root penetrated-by)) + (set! (-> this root penetrated-by) (get-penetrate-info this)) (set! (-> s4-0 event-self) 'touched) ) - (set! (-> obj penetrated-flinch) (-> arg0 penetrate-flinch)) - (set! (-> obj penetrated-knocked) (-> arg0 penetrate-knocked)) - (set! (-> obj reaction-time) (the-as time-frame (get-rand-int-range obj 30 240))) - (let* ((v1-113 (-> obj enemy-flags)) - (a0-47 (-> obj fact enemy-options)) + (set! (-> this penetrated-flinch) (-> arg0 penetrate-flinch)) + (set! (-> this penetrated-knocked) (-> arg0 penetrate-knocked)) + (set! (-> this reaction-time) (the-as time-frame (get-rand-int-range this 30 240))) + (let* ((v1-113 (-> this enemy-flags)) + (a0-47 (-> this fact enemy-options)) (v1-114 (logior (enemy-flag enable-on-active checking-water @@ -1217,83 +1217,83 @@ (if (logtest? (enemy-option has-trigger) a0-47) (set! v1-114 (logior (enemy-flag called-dying) v1-114)) ) - (set! (-> obj enemy-flags) v1-114) + (set! (-> this enemy-flags) v1-114) ) - (logior! (-> obj mask) (process-mask collectable)) - (do-navigation-to-destination (-> obj nav state) (-> obj root trans)) - (if (and (-> obj enemy-info move-to-ground) - (not (logtest? (enemy-flag vulnerable-backup) (-> obj enemy-flags))) - (not (logtest? (enemy-option ambush) (-> obj fact enemy-options))) + (logior! (-> this mask) (process-mask collectable)) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) + (if (and (-> this enemy-info move-to-ground) + (not (logtest? (enemy-flag vulnerable-backup) (-> this enemy-flags))) + (not (logtest? (enemy-option ambush) (-> this fact enemy-options))) ) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) + (enemy-method-127 this 40960.0 40960.0 #t (the-as collide-spec (-> this gnd-collide))) ) - (if (zero? (-> obj draw light-index)) - (set! (-> obj draw light-index) (the-as uint 10)) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) ) 0 (none) ) -(defmethod init-from-entity! nav-enemy ((obj nav-enemy) (arg0 entity-actor)) +(defmethod init-from-entity! nav-enemy ((this nav-enemy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-enemy-collision! obj) - (process-drawable-from-entity! obj arg0) - (init-enemy! obj) - (when (> (-> obj enemy-info gem-joint) 0) + (init-enemy-collision! this) + (process-drawable-from-entity! this arg0) + (init-enemy! this) + (when (> (-> this enemy-info gem-joint) 0) (cond - ((or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status save))) - (not (-> obj entity)) + ((or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status save))) + (not (-> this entity)) ) (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-no-seg)) - (the-as int (-> obj enemy-info gem-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-no-seg)) + (the-as int (-> this enemy-info gem-seg)) ) ) (else (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-seg)) - (the-as int (-> obj enemy-info gem-no-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-seg)) + (the-as int (-> this enemy-info gem-no-seg)) ) - (add-connection *part-engine* obj (-> obj enemy-info gem-joint) obj 314 (-> obj enemy-info gem-offset)) + (add-connection *part-engine* this (-> this enemy-info gem-joint) this 314 (-> this enemy-info gem-offset)) ) ) ) - (let ((v1-25 (-> obj fact enemy-options))) + (let ((v1-25 (-> this fact enemy-options))) (cond ((logtest? (enemy-option spawner) v1-25) - (process-entity-status! obj (entity-perm-status dead) #t) - (go (method-of-object obj die-fast)) + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die-fast)) ) (*debug-view-anims* - (go (method-of-object obj view-anims)) + (go (method-of-object this view-anims)) ) ((logtest? (enemy-option dormant) v1-25) - (let ((v1-33 (-> obj root root-prim))) + (let ((v1-33 (-> this root root-prim))) (set! (-> v1-33 prim-core collide-as) (collide-spec)) (set! (-> v1-33 prim-core collide-with) (collide-spec)) ) 0 - (logior! (-> obj draw status) (draw-control-status no-draw)) - (go (method-of-object obj dormant)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this dormant)) ) ((logtest? (enemy-option dormant-aware) v1-25) - (let ((v1-43 (-> obj root root-prim))) + (let ((v1-43 (-> this root root-prim))) (set! (-> v1-43 prim-core collide-as) (collide-spec)) (set! (-> v1-43 prim-core collide-with) (collide-spec)) ) 0 - (logior! (-> obj draw status) (draw-control-status no-draw)) - (go (method-of-object obj dormant-aware)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this dormant-aware)) ) (else - (go-idle obj) + (go-idle this) ) ) ) @@ -1390,26 +1390,26 @@ This commonly includes things such as: (none) ) -(defmethod nav-enemy-method-169 nav-enemy ((obj nav-enemy) (arg0 float) (arg1 symbol)) +(defmethod nav-enemy-method-169 nav-enemy ((this nav-enemy) (arg0 float) (arg1 symbol)) (if arg1 - (set! (-> obj nav-radius-backup) arg0) + (set! (-> this nav-radius-backup) arg0) ) - (if (zero? (-> obj restore-nav-radius-time)) - (set! (-> obj root nav-radius) arg0) + (if (zero? (-> this restore-nav-radius-time)) + (set! (-> this root nav-radius) arg0) ) ) -(defmethod nav-enemy-method-168 nav-enemy ((obj nav-enemy)) - (if (zero? (-> obj restore-nav-radius-time)) - (set! (-> obj root nav-radius) (-> obj nav-radius-backup)) +(defmethod nav-enemy-method-168 nav-enemy ((this nav-enemy)) + (if (zero? (-> this restore-nav-radius-time)) + (set! (-> this root nav-radius) (-> this nav-radius-backup)) ) ) ;; WARN: Return type mismatch int vs time-frame. -(defmethod nav-enemy-method-144 nav-enemy ((obj nav-enemy)) - (set! (-> obj root nav-radius) 4.096) - (let ((s5-1 (max (-> obj restore-nav-radius-time) (+ (current-time) (get-rand-int-range obj 1500 2400))))) - (set! (-> obj restore-nav-radius-time) (the-as time-frame s5-1)) +(defmethod nav-enemy-method-144 nav-enemy ((this nav-enemy)) + (set! (-> this root nav-radius) 4.096) + (let ((s5-1 (max (-> this restore-nav-radius-time) (+ (current-time) (get-rand-int-range this 1500 2400))))) + (set! (-> this restore-nav-radius-time) (the-as time-frame s5-1)) (the-as time-frame s5-1) ) ) @@ -1432,7 +1432,7 @@ This commonly includes things such as: (nav-enemy-method-176 self) (if (and (nav-enemy-method-163 self) (zero? (-> self restore-nav-radius-time)) - (>= (- (current-time) (-> self blocked-start-time)) (seconds 4)) + (time-elapsed? (-> self blocked-start-time) (seconds 4)) ) (nav-enemy-method-144 self) ) @@ -1454,7 +1454,7 @@ This commonly includes things such as: (seek-toward-heading-vec! (-> self root) arg0 (-> self nav max-rotation-rate) (seconds 0.02)) (suspend) (ja :num! (loop! 0.75)) - (set! v1-18 (or (>= (- (current-time) s4-0) (seconds 10)) (enemy-method-94 self arg0 arg1))) + (set! v1-18 (or (time-elapsed? s4-0 (seconds 10)) (enemy-method-94 self arg0 arg1))) ) ) (forward-up->quaternion (-> self root quat) arg0 *y-vector*) @@ -1474,45 +1474,45 @@ This commonly includes things such as: (none) ) -(defmethod go-stare2 nav-enemy ((obj nav-enemy)) - (if (!= (-> obj enemy-info taunt-anim) -1) - (go (method-of-object obj taunt)) +(defmethod go-stare2 nav-enemy ((this nav-enemy)) + (if (!= (-> this enemy-info taunt-anim) -1) + (go (method-of-object this taunt)) ) - (go (method-of-object obj stare)) + (go (method-of-object this stare)) ) -(defmethod go-stare nav-enemy ((obj nav-enemy)) - (let ((s5-0 (-> obj focus aware))) +(defmethod go-stare nav-enemy ((this nav-enemy)) + (let ((s5-0 (-> this focus aware))) (cond - ((or (and (-> obj enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> obj enemy-flags))) - (nav-enemy-method-163 obj) + ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) + (nav-enemy-method-163 this) ) - (go-stare2 obj) + (go-stare2 this) ) - ((and (= s5-0 (enemy-aware enemy-aware-3)) (-> obj enemy-info use-circling)) - (go (method-of-object obj circling)) + ((and (= s5-0 (enemy-aware enemy-aware-3)) (-> this enemy-info use-circling)) + (go (method-of-object this circling)) ) ((= s5-0 (enemy-aware unaware)) - (go (method-of-object obj flee)) + (go (method-of-object this flee)) ) (else - (go-stare2 obj) + (go-stare2 this) ) ) ) ) -(defmethod go-hostile nav-enemy ((obj nav-enemy)) - (if (or (and (-> obj enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> obj enemy-flags))) - (nav-enemy-method-163 obj) +(defmethod go-hostile nav-enemy ((this nav-enemy)) + (if (or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) + (nav-enemy-method-163 this) ) - (go-stare2 obj) - (go (method-of-object obj hostile)) + (go-stare2 this) + (go (method-of-object this hostile)) ) ) -(defmethod go-flee nav-enemy ((obj nav-enemy)) - (go (method-of-object obj flee)) +(defmethod go-flee nav-enemy ((this nav-enemy)) + (go (method-of-object this flee)) ) (define *nav-enemy-debug-control-info* (new 'static 'nav-enemy-debug-control-info)) @@ -1786,7 +1786,7 @@ This commonly includes things such as: (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (nav-enemy-method-163 self) (go-stare2 self) ) @@ -1821,7 +1821,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((a1-0 (new 'stack-no-clear 'vector))) (let ((a2-0 (-> self nav state))) (set! (-> a1-0 quad) (-> a2-0 target-post quad)) @@ -1855,14 +1855,14 @@ This commonly includes things such as: (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (nav-enemy-method-163 self) (go-stare2 self) ) (let ((gp-0 (-> self focus aware))) (cond ((>= 1 (the-as int gp-0)) - (if (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) (go-virtual active) ) ) @@ -1873,7 +1873,7 @@ This commonly includes things such as: (go-flee self) ) (else - (if (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) (go-stare self) ) ) @@ -1921,7 +1921,7 @@ This commonly includes things such as: 0 (nav-enemy-method-167 self) (vector-reset! (-> self root transv)) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) :exit (behavior () (rlet ((acc :class vf) @@ -1980,9 +1980,9 @@ This commonly includes things such as: ) (let ((gp-0 (-> self focus aware))) (if (< (the-as int gp-0) 2) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) - (when (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) (not (nav-enemy-method-163 self))) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (not (nav-enemy-method-163 self))) (cond ((>= 1 (the-as int gp-0)) (go-virtual active) @@ -1990,7 +1990,7 @@ This commonly includes things such as: ((= gp-0 (enemy-aware enemy-aware-3)) (if (and (get-enemy-target self) (not (and (-> self enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> self enemy-flags)))) - (>= (- (current-time) (-> self starting-time)) (-> self reaction-time)) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) ) (go-hostile self) ) @@ -2003,7 +2003,7 @@ This commonly includes things such as: ) ((and (= gp-0 (enemy-aware enemy-aware-2)) (-> self enemy-info use-pacing) - (>= (- (current-time) (-> self starting-time)) (-> self reaction-time)) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) ) (go-virtual pacing) ) @@ -2046,7 +2046,7 @@ This commonly includes things such as: ) :exit (-> (method-of-type nav-enemy stare) exit) :trans (behavior () - (when (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) (not (nav-enemy-method-163 self))) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (not (nav-enemy-method-163 self))) (let ((v1-6 (-> self focus aware))) (cond ((>= 1 (the-as int v1-6)) @@ -2070,7 +2070,7 @@ This commonly includes things such as: :num! (loop! f28-0) :frame-num 0.0 ) - (until (>= (- (current-time) s5-0) gp-0) + (until (time-elapsed? s5-0 gp-0) (suspend) (ja :num! (loop! f28-0)) ) @@ -2094,7 +2094,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (look-at-target! self (enemy-flag lock-focus)) (logior! (-> self enemy-flags) (enemy-flag use-notice-distance)) (let ((v1-6 self)) @@ -2113,7 +2113,7 @@ This commonly includes things such as: (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self move-dest quad) (-> self root trans quad)) (set! (-> self state-timeout) (the-as time-frame (get-rand-int-range self 2100 3300))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) (if (zero? (get-rand-int self 2)) (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag40) (-> self enemy-flags)))) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag enemy-flag40)))) @@ -2133,14 +2133,14 @@ This commonly includes things such as: ) (let ((gp-1 (-> self focus aware))) (if (or (!= gp-1 3) (not (get-enemy-target self))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (>= 1 (the-as int gp-1)) (go-virtual active) ) (when (= gp-1 (enemy-aware enemy-aware-3)) - (when (and (get-enemy-target self) (>= (- (current-time) (-> self starting-time)) (-> self reaction-time))) + (when (and (get-enemy-target self) (time-elapsed? (-> self starting-time) (-> self reaction-time))) (nav-enemy-method-161 self) (go-virtual hostile) ) @@ -2151,14 +2151,14 @@ This commonly includes things such as: (if (nav-enemy-method-163 self) (go-stare2 self) ) - (when (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (nav-enemy-method-161 self) (go-stare2 self) ) ) ) (when (>= 1024.0 (vector-vector-xz-distance (-> self root trans) (-> self move-dest))) - (when (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) (zero? (get-rand-int self 3))) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (zero? (get-rand-int self 3))) (nav-enemy-method-161 self) (go-stare2 self) ) @@ -2226,7 +2226,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (look-at-target! self (enemy-flag lock-focus)) (logior! (-> self enemy-flags) (enemy-flag use-notice-distance)) (let ((v1-6 self)) @@ -2261,7 +2261,7 @@ This commonly includes things such as: ) (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag enemy-flag41)))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -2271,9 +2271,9 @@ This commonly includes things such as: ) (let ((gp-1 (-> self focus aware))) (if (or (!= gp-1 3) (not (get-enemy-target self))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (when (>= 1 (the-as int gp-1)) (nav-enemy-method-161 self) (if (-> self enemy-info use-stop-chase) @@ -2283,7 +2283,7 @@ This commonly includes things such as: ) (when (and (= gp-1 (enemy-aware enemy-aware-3)) (get-enemy-target self) - (>= (- (current-time) (-> self starting-time)) (-> self reaction-time)) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) ) (nav-enemy-method-161 self) (go-hostile self) @@ -2380,7 +2380,7 @@ This commonly includes things such as: 0 ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (let ((v1-3 (-> self focus aware))) (if (!= v1-3 (enemy-aware unaware)) (go-stare self) @@ -2548,24 +2548,24 @@ This commonly includes things such as: :post nav-enemy-die-falling-post ) -(defmethod enemy-method-82 nav-enemy ((obj nav-enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 nav-enemy ((this nav-enemy) (arg0 enemy-jump-info)) "@abstract" (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) - (set! (-> v1-0 w) (-> obj nav-radius-backup)) - (add-root-sphere-to-hash! (-> obj nav) v1-0 #x80068) + (set! (-> v1-0 w) (-> this nav-radius-backup)) + (add-root-sphere-to-hash! (-> this nav) v1-0 #x80068) ) ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-92 nav-enemy ((obj nav-enemy) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 nav-enemy ((this nav-enemy) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" (let ((v1-0 arg0)) (when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3)) - (let ((a1-4 obj)) + (let ((a1-4 this)) (if (logtest? (enemy-flag enemy-flag37) (-> a1-4 enemy-flags)) - (seek-to-point-toward-point! (-> obj root) (-> arg1 vertex2) (-> obj nav max-rotation-rate) (seconds 0.02)) + (seek-to-point-toward-point! (-> this root) (-> arg1 vertex2) (-> this nav max-rotation-rate) (seconds 0.02)) ) ) ) diff --git a/goal_src/jak2/engine/nav/nav-mesh-h.gc b/goal_src/jak2/engine/nav/nav-mesh-h.gc index 603188a952..f091e9dc30 100644 --- a/goal_src/jak2/engine/nav/nav-mesh-h.gc +++ b/goal_src/jak2/engine/nav/nav-mesh-h.gc @@ -397,8 +397,8 @@ and declared out of order (cannot use forward declared structures in inline arra #t ) -(defmethod point-in-poly? nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) - (let* ((a3-0 obj) +(defmethod point-in-poly? nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (let* ((a3-0 this) (v1-0 arg1) (a0-1 (-> arg0 vertex-count)) (a1-1 (-> arg0 vertex)) @@ -424,7 +424,7 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; WARN: Return type mismatch vector vs none. -(defmethod closest-point-on-boundary nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod closest-point-on-boundary nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) @@ -447,10 +447,10 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; WARN: Return type mismatch vector vs none. -(defmethod project-point-into-poly-2d nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-poly-2d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (cond - ((point-in-poly? obj arg0 arg2) + ((point-in-poly? this arg0 arg2) (set! (-> arg1 quad) (-> arg2 quad)) ) (else @@ -478,7 +478,7 @@ and declared out of order (cannot use forward declared structures in inline arra (none) ) -(defmethod move-along-nav-ray! nav-mesh ((obj nav-mesh) (ray nav-ray)) +(defmethod move-along-nav-ray! nav-mesh ((this nav-mesh) (ray nav-ray)) (local-vars (next-poly-idx int) (work nav-mesh-work) @@ -495,11 +495,11 @@ and declared out of order (cannot use forward declared structures in inline arra (sv-68 uint) ) (set! next-poly-idx -1) - (set! work (-> obj work)) + (set! work (-> this work)) (set! current-poly (-> ray current-poly)) (set! current-poly-vtx-count (-> ray current-poly vertex-count)) - (set! v0-table (-> obj work vert0-table)) - (set! v1-table (-> obj work vert1-table)) + (set! v0-table (-> this work vert0-table)) + (set! v1-table (-> this work vert1-table)) (set! delta-x (- (-> ray dest-pos x) (-> ray current-pos x))) (set! delta-z (- (-> ray dest-pos z) (-> ray current-pos z))) (dotimes (i (the-as int current-poly-vtx-count)) @@ -541,7 +541,7 @@ and declared out of order (cannot use forward declared structures in inline arra (+! (-> ray current-pos z) delta-z) (set! sv-68 (-> current-poly adj-poly next-poly-idx)) (if (!= sv-68 255) - (set! (-> ray next-poly) (-> obj poly-array sv-68)) + (set! (-> ray next-poly) (-> this poly-array sv-68)) ) (cond ((and (-> ray next-poly) (not (logtest? (-> ray next-poly pat) (-> ray ignore)))) diff --git a/goal_src/jak2/engine/nav/nav-mesh.gc b/goal_src/jak2/engine/nav/nav-mesh.gc index 0b6a687b4c..8fe0390249 100644 --- a/goal_src/jak2/engine/nav/nav-mesh.gc +++ b/goal_src/jak2/engine/nav/nav-mesh.gc @@ -339,44 +339,44 @@ (none) ) -(defmethod initialize-nav-mesh! entity-nav-mesh ((obj entity-nav-mesh)) +(defmethod initialize-nav-mesh! entity-nav-mesh ((this entity-nav-mesh)) "Initialize the nav-mesh in this entity." - (let ((v1-0 (-> obj nav-mesh))) + (let ((v1-0 (-> this nav-mesh))) (if (nonzero? v1-0) - (init-from-entity v1-0 obj) + (init-from-entity v1-0 this) ) ) 0 (none) ) -(defmethod birth! entity-nav-mesh ((obj entity-nav-mesh)) - (let ((a0-1 (-> obj nav-mesh))) +(defmethod birth! entity-nav-mesh ((this entity-nav-mesh)) + (let ((a0-1 (-> this nav-mesh))) (if (nonzero? a0-1) (handle-birth a0-1) ) ) - obj + this ) -(defmethod kill! entity-nav-mesh ((obj entity-nav-mesh)) - (if (-> obj nav-mesh) - (handle-kill (-> obj nav-mesh)) +(defmethod kill! entity-nav-mesh ((this entity-nav-mesh)) + (if (-> this nav-mesh) + (handle-kill (-> this nav-mesh)) ) - obj + this ) -(defmethod debug-draw entity-nav-mesh ((obj entity-nav-mesh)) +(defmethod debug-draw entity-nav-mesh ((this entity-nav-mesh)) (add-debug-x #t (bucket-id debug-no-zbuf1) - (-> obj nav-mesh bounds) + (-> this nav-mesh bounds) (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj nav-mesh bounds quad)) + (set! (-> s5-0 quad) (-> this nav-mesh bounds quad)) (let ((a0-6 (new 'stack 'random-generator))) - (set! (-> a0-6 seed) (-> obj aid)) + (set! (-> a0-6 seed) (-> this aid)) (let* ((v1-4 (rand-uint31-gen a0-6)) (f30-0 (* 182.04445 (the float (logand v1-4 #xffff)))) ) @@ -387,7 +387,7 @@ (add-debug-text-3d #t (bucket-id debug-no-zbuf1) - (res-lump-struct obj 'name string) + (res-lump-struct this 'name string) s5-0 (font-color white) (new 'static 'vector2h :data (new 'static 'array int16 2 0 8)) @@ -396,7 +396,7 @@ (s3-1 #t) (s2-1 (bucket-id debug-no-zbuf1)) ) - (format (clear *temp-string*) "aid ~D" (-> obj aid)) + (format (clear *temp-string*) "aid ~D" (-> this aid)) (s4-1 s3-1 (the-as bucket-id s2-1) @@ -407,12 +407,12 @@ ) ) ) - (debug-draw (-> obj nav-mesh)) + (debug-draw (-> this nav-mesh)) 0 (none) ) -(defmethod get-simple-travel-vector entity-actor ((obj entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) +(defmethod get-simple-travel-vector entity-actor ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) (local-vars (at-0 int) (at-1 int)) (with-pp (rlet ((vf0 :class vf) @@ -420,7 +420,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((gp-0 (nav-mesh-from-res-tag obj 'nav-mesh-actor 0))) + (let ((gp-0 (nav-mesh-from-res-tag this 'nav-mesh-actor 0))) (cond (gp-0 (let ((v1-0 arg0)) @@ -480,9 +480,9 @@ ) ) -(defmethod project-point-to-nav-mesh entity-actor ((obj entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) +(defmethod project-point-to-nav-mesh entity-actor ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) (local-vars (sv-16 vector)) - (let ((gp-0 (nav-mesh-from-res-tag obj 'nav-mesh-actor 0))) + (let ((gp-0 (nav-mesh-from-res-tag this 'nav-mesh-actor 0))) (cond (gp-0 (set! sv-16 arg0) @@ -510,13 +510,13 @@ ) ;; WARN: Return type mismatch uint vs int. -(defmethod length nav-mesh ((obj nav-mesh)) - (the-as int (-> obj poly-count)) +(defmethod length nav-mesh ((this nav-mesh)) + (the-as int (-> this poly-count)) ) -(defmethod debug-draw-poly nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 rgba)) +(defmethod debug-draw-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) - (set! (-> gp-0 0 quad) (-> obj bounds quad)) + (set! (-> gp-0 0 quad) (-> this bounds quad)) (if (logtest? (-> arg0 pat) 7) (+! (-> gp-0 0 y) 409.6) ) @@ -534,9 +534,9 @@ (set! v1-7 s2-0) ) ) - (when (and (logtest? (-> arg0 pat) 4) (< (-> arg0 link) (-> obj link-count))) - (poly-centroid obj arg0 (-> gp-0 1)) - (let ((s5-1 (-> obj link-array (-> arg0 link)))) + (when (and (logtest? (-> arg0 pat) 4) (< (-> arg0 link) (-> this link-count))) + (poly-centroid this arg0 (-> gp-0 1)) + (let ((s5-1 (-> this link-array (-> arg0 link)))) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> gp-0 1) *color-magenta*) (let ((s4-1 add-debug-text-3d) (s3-1 #t) @@ -559,30 +559,30 @@ (none) ) -(defmethod new-nav-control nav-mesh ((obj nav-mesh) (arg0 process-drawable)) +(defmethod new-nav-control nav-mesh ((this nav-mesh) (arg0 process-drawable)) (let ((gp-0 (the-as nav-control #f))) - (dotimes (v1-0 (the-as int (-> obj nav-control-count))) - (let ((a1-2 (-> obj nav-control-array v1-0))) + (dotimes (v1-0 (the-as int (-> this nav-control-count))) + (let ((a1-2 (-> this nav-control-array v1-0))) (b! (-> a1-2 process) cfg-3 :delay (empty-form)) (set! gp-0 a1-2) ) (set! (-> gp-0 process) (the-as process 0)) - (set! (-> gp-0 state mesh) obj) + (set! (-> gp-0 state mesh) this) (b! #t cfg-8 :delay (nop!)) (label cfg-3) ) - (let ((v1-3 (-> obj nav-control-count))) + (let ((v1-3 (-> this nav-control-count))) (cond - ((< v1-3 (-> obj max-nav-control-count)) - (+! (-> obj nav-control-count) 1) - (set! gp-0 (-> obj nav-control-array v1-3)) - (set! (-> gp-0 state mesh) obj) + ((< v1-3 (-> this max-nav-control-count)) + (+! (-> this nav-control-count) 1) + (set! gp-0 (-> this nav-control-array v1-3)) + (set! (-> gp-0 state mesh) this) ) (else (format 0 "nav-mesh::new-nav-control: too many users for nav-mesh ~s~%" - (res-lump-struct (-> obj entity) 'name structure) + (res-lump-struct (-> this entity) 'name structure) ) ) ) @@ -592,32 +592,32 @@ ) ) -(defmethod remove-nav-control nav-mesh ((obj nav-mesh) (arg0 nav-control)) +(defmethod remove-nav-control nav-mesh ((this nav-mesh) (arg0 nav-control)) (set! (-> arg0 process) #f) - (let ((v1-1 (+ (-> obj nav-control-count) -1))) - (while (and (>= v1-1 0) (not (-> obj nav-control-array v1-1 process))) + (let ((v1-1 (+ (-> this nav-control-count) -1))) + (while (and (>= v1-1 0) (not (-> this nav-control-array v1-1 process))) (+! v1-1 -1) ) - (set! (-> obj nav-control-count) (+ v1-1 1)) + (set! (-> this nav-control-count) (+ v1-1 1)) ) 0 (none) ) -(defmethod add-process-drawable-to-navmesh nav-mesh ((obj nav-mesh) (arg0 process-drawable) (arg1 symbol)) +(defmethod add-process-drawable-to-navmesh nav-mesh ((this nav-mesh) (arg0 process-drawable) (arg1 symbol)) (if arg1 - (change-to obj arg0) - (add-connection (-> obj user-list) arg0 nothing arg0 #f (-> arg0 root)) + (change-to this arg0) + (add-connection (-> this user-list) arg0 nothing arg0 #f (-> arg0 root)) ) 0 (none) ) -(defmethod remove-process-drawable nav-mesh ((obj nav-mesh) (arg0 process-drawable)) - (remove-from-process (-> obj user-list) arg0) +(defmethod remove-process-drawable nav-mesh ((this nav-mesh) (arg0 process-drawable)) + (remove-from-process (-> this user-list) arg0) (let ((a1-2 (-> arg0 nav))) (when (nonzero? a1-2) - (remove-nav-control obj a1-2) + (remove-nav-control this a1-2) (set! (-> arg0 nav) #f) ) ) @@ -625,10 +625,10 @@ (none) ) -(defmethod change-to nav-mesh ((obj nav-mesh) (arg0 process-drawable)) +(defmethod change-to nav-mesh ((this nav-mesh) (arg0 process-drawable)) (local-vars (v1-5 symbol)) (let ((gp-0 arg0)) - (b! (nonzero? (-> obj user-list)) cfg-2 :delay (empty-form)) + (b! (nonzero? (-> this user-list)) cfg-2 :delay (empty-form)) (go process-drawable-art-error "nav mesh not initialized") (b! #t cfg-18 :delay (nop!)) (label cfg-2) @@ -637,10 +637,10 @@ (set! s3-0 (the-as nav-control #f)) (label cfg-4) (b! (not s3-0) cfg-7 :likely-delay (set! v1-5 #t)) - (set! v1-5 (!= obj (-> s3-0 state mesh))) + (set! v1-5 (!= this (-> s3-0 state mesh))) (label cfg-7) (b! (not v1-5) cfg-18 :delay (empty-form)) - (let ((s4-0 (new-nav-control obj arg0))) + (let ((s4-0 (new-nav-control this arg0))) (b! s4-0 cfg-12 :delay (empty-form)) (b! (not *debug-segment*) cfg-11 :delay (empty-form)) (format 0 "ERROR: nav-mesh::change-to: unable to allocate nav-mesh for ~s~%" gp-0) @@ -650,7 +650,7 @@ (cond (s3-0 (quad-copy! (the-as pointer s4-0) (the-as pointer s3-0) 18) - (set! (-> s4-0 state mesh) obj) + (set! (-> s4-0 state mesh) this) (set! (-> s4-0 state nav) s4-0) (set! (-> s4-0 state current-poly) #f) (set! (-> s4-0 state virtual-current-poly) #f) @@ -666,11 +666,11 @@ (init! s4-0 (the-as collide-shape (-> gp-0 root))) ) ) - (set-nearest-y-thres! s4-0 (-> obj nearest-y-threshold)) + (set-nearest-y-thres! s4-0 (-> this nearest-y-threshold)) (set! (-> gp-0 nav) s4-0) ) ) - (add-connection (-> obj user-list) gp-0 nothing gp-0 #t (-> gp-0 root)) + (add-connection (-> this user-list) gp-0 nothing gp-0 #t (-> gp-0 root)) (send-event gp-0 'nav-mesh-new :from gp-0) ) (label cfg-18) @@ -678,7 +678,7 @@ (none) ) -(defmethod link-to-other-mesh nav-mesh ((obj nav-mesh) (arg0 nav-mesh-link)) +(defmethod link-to-other-mesh nav-mesh ((this nav-mesh) (arg0 nav-mesh-link)) (when (not (-> arg0 dest-mesh)) (let* ((s4-0 (entity-nav-mesh-by-aid (the-as actor-id (-> arg0 dest-mesh-id)))) (v1-1 (if (type? s4-0 entity-nav-mesh) @@ -703,7 +703,7 @@ (label cfg-10) (when v1-2 (set! (-> arg0 dest-mesh) a0-3) - (set! (-> v1-2 dest-mesh) obj) + (set! (-> v1-2 dest-mesh) this) (set! (-> arg0 dest-link-poly-id) (-> v1-2 src-switch-poly-id)) (set! (-> arg0 dest-switch-poly-id) (-> v1-2 src-link-poly-id)) (set! (-> v1-2 dest-link-poly-id) (-> arg0 src-switch-poly-id)) @@ -716,7 +716,7 @@ ) ) -(defmethod unlink-mesh nav-mesh ((obj nav-mesh) (arg0 nav-mesh-link)) +(defmethod unlink-mesh nav-mesh ((this nav-mesh) (arg0 nav-mesh-link)) (let ((a0-1 (-> arg0 dest-mesh))) (when a0-1 (let ((v1-0 (the-as nav-mesh-link #f))) @@ -742,11 +742,11 @@ (none) ) -(defmethod link-by-id nav-mesh ((obj nav-mesh) (arg0 uint)) +(defmethod link-by-id nav-mesh ((this nav-mesh) (arg0 uint)) "arg1 is a [[nav-mesh-link]] `id`" (let ((v1-0 (the-as nav-mesh-link #f))) - (dotimes (a2-0 (the-as int (-> obj link-count))) - (let ((a3-1 (-> obj link-array a2-0))) + (dotimes (a2-0 (the-as int (-> this link-count))) + (let ((a3-1 (-> this link-array a2-0))) (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) (set! v1-0 a3-1) ) @@ -755,16 +755,16 @@ ) (label cfg-6) (if v1-0 - (link-to-other-mesh obj v1-0) + (link-to-other-mesh this v1-0) ) ) ) -(defmethod unlink-by-id nav-mesh ((obj nav-mesh) (arg0 uint)) +(defmethod unlink-by-id nav-mesh ((this nav-mesh) (arg0 uint)) "arg1 is a [[nav-mesh-link]] `id`" (let ((v1-0 (the-as nav-mesh-link #f))) - (dotimes (a2-0 (the-as int (-> obj link-count))) - (let ((a3-1 (-> obj link-array a2-0))) + (dotimes (a2-0 (the-as int (-> this link-count))) + (let ((a3-1 (-> this link-array a2-0))) (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) (set! v1-0 a3-1) ) @@ -773,52 +773,52 @@ ) (label cfg-6) (when v1-0 - (unlink-mesh obj v1-0) + (unlink-mesh this v1-0) #t ) ) ) -(defmethod init-from-entity nav-mesh ((obj nav-mesh) (arg0 entity-nav-mesh)) +(defmethod init-from-entity nav-mesh ((this nav-mesh) (arg0 entity-nav-mesh)) "Initialize this mesh from an entity." (local-vars (sv-16 res-tag)) - (set! (-> obj entity) arg0) - (set! (-> obj work) *nav-mesh-work*) + (set! (-> this entity) arg0) + (set! (-> this work) *nav-mesh-work*) (set! sv-16 (new 'static 'res-tag)) (let ((v1-2 (res-lump-data arg0 'nav-mesh-sphere pointer :tag-ptr (& sv-16)))) (when v1-2 - (set! (-> obj static-sphere-count) (-> sv-16 elt-count)) - (set! (-> obj static-sphere) (the-as (inline-array sphere) v1-2)) + (set! (-> this static-sphere-count) (-> sv-16 elt-count)) + (set! (-> this static-sphere) (the-as (inline-array sphere) v1-2)) ) ) - (set! (-> obj nearest-y-threshold) (res-lump-float arg0 'nearest-y-threshold :default 40960.0)) - (set! (-> obj flags) (nav-mesh-flag)) - (set! (-> obj water-max-height) (res-lump-float arg0 'water-max-height :default 8192.0)) + (set! (-> this nearest-y-threshold) (res-lump-float arg0 'nearest-y-threshold :default 40960.0)) + (set! (-> this flags) (nav-mesh-flag)) + (set! (-> this water-max-height) (res-lump-float arg0 'water-max-height :default 8192.0)) (let ((s5-1 (res-lump-value arg0 'nav-max-users uint128 :default (the-as uint128 64) :time -1000000000.0))) - (set! (-> obj user-list) (new 'loading-level 'engine 'nav-engine (the-as int s5-1) connection)) - (set! (-> obj nav-control-array) + (set! (-> this user-list) (new 'loading-level 'engine 'nav-engine (the-as int s5-1) connection)) + (set! (-> this nav-control-array) (the-as (inline-array nav-control) (malloc 'loading-level (* 288 (the-as int s5-1)))) ) - (set! (-> obj nav-control-count) (the-as uint 0)) - (set! (-> obj max-nav-control-count) (the-as uint s5-1)) - (set! (-> obj sphere-hash) - (new 'loading-level 'sphere-hash 4096 (the-as int (+ s5-1 (-> obj static-sphere-count)))) + (set! (-> this nav-control-count) (the-as uint 0)) + (set! (-> this max-nav-control-count) (the-as uint s5-1)) + (set! (-> this sphere-hash) + (new 'loading-level 'sphere-hash 4096 (the-as int (+ s5-1 (-> this static-sphere-count)))) ) ) - (if (nonzero? (-> obj poly-hash)) - (set! (-> obj poly-hash work) *grid-hash-work*) + (if (nonzero? (-> this poly-hash)) + (set! (-> this poly-hash work) *grid-hash-work*) ) - (initialize-mesh! obj) + (initialize-mesh! this) 0 (none) ) -(defmethod handle-birth nav-mesh ((obj nav-mesh)) +(defmethod handle-birth nav-mesh ((this nav-mesh)) "Handle the parent nav-mesh-entity birth." - (dotimes (s5-0 (the-as int (-> obj link-count))) - (let ((a1-0 (-> obj link-array s5-0))) + (dotimes (s5-0 (the-as int (-> this link-count))) + (let ((a1-0 (-> this link-array s5-0))) (if (not (-> a1-0 dest-mesh)) - (link-to-other-mesh obj a1-0) + (link-to-other-mesh this a1-0) ) ) ) @@ -826,11 +826,11 @@ (none) ) -(defmethod handle-kill nav-mesh ((obj nav-mesh)) +(defmethod handle-kill nav-mesh ((this nav-mesh)) "Handle the parent nav-mesh-entity kill." - (when (nonzero? (-> obj user-list)) - (countdown (s5-0 (-> obj nav-control-count)) - (let* ((v1-3 (-> obj nav-control-array s5-0)) + (when (nonzero? (-> this user-list)) + (countdown (s5-0 (-> this nav-control-count)) + (let* ((v1-3 (-> this nav-control-array s5-0)) (s4-0 (-> v1-3 process)) ) (when s4-0 @@ -840,11 +840,11 @@ ) ) ) - (remove-all (-> obj user-list)) - (dotimes (s5-1 (the-as int (-> obj link-count))) - (let ((a1-2 (-> obj link-array s5-1))) + (remove-all (-> this user-list)) + (dotimes (s5-1 (the-as int (-> this link-count))) + (let ((a1-2 (-> this link-array s5-1))) (if (-> a1-2 dest-mesh) - (unlink-mesh obj a1-2) + (unlink-mesh this a1-2) ) ) ) @@ -870,23 +870,23 @@ :flag-assert #x900000010 ) -(defmethod inspect nav-engine-spr-buffer ((obj nav-engine-spr-buffer)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-engine-spr-buffer ((this nav-engine-spr-buffer)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-engine-spr-buffer) - (format #t "~1Tmem-addr: ~D~%" (-> obj mem-addr)) - (format #t "~1Tmem-nav: #x~X~%" (-> obj mem-addr)) - (format #t "~1Tspr-addr: ~D~%" (-> obj spr-addr)) - (format #t "~1Tspr-nav: #x~X~%" (-> obj spr-addr)) - (format #t "~1Tq-size: ~D~%" (-> obj q-size)) - (format #t "~1Ti-nav: ~D~%" (-> obj i-nav)) - (format #t "~1Tdone: ~D~%" (-> obj done)) - (format #t "~1Tnav-count: ~D~%" (-> obj nav-count)) - (format #t "~1Ti-pass: ~D~%" (-> obj i-pass)) + (format #t "[~8x] ~A~%" this 'nav-engine-spr-buffer) + (format #t "~1Tmem-addr: ~D~%" (-> this mem-addr)) + (format #t "~1Tmem-nav: #x~X~%" (-> this mem-addr)) + (format #t "~1Tspr-addr: ~D~%" (-> this spr-addr)) + (format #t "~1Tspr-nav: #x~X~%" (-> this spr-addr)) + (format #t "~1Tq-size: ~D~%" (-> this q-size)) + (format #t "~1Ti-nav: ~D~%" (-> this i-nav)) + (format #t "~1Tdone: ~D~%" (-> this done)) + (format #t "~1Tnav-count: ~D~%" (-> this nav-count)) + (format #t "~1Ti-pass: ~D~%" (-> this i-pass)) (label cfg-4) - obj + this ) (deftype nav-engine (structure) @@ -931,90 +931,90 @@ ) ) -(defmethod inspect nav-engine ((obj nav-engine)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-engine ((this nav-engine)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-engine) - (format #t "~1Tspr-addr: ~D~%" (-> obj spr-addr)) - (format #t "~1Tnav-work-addr: ~D~%" (-> obj nav-work-addr)) - (format #t "~1Tnav-mesh-addr: ~D~%" (-> obj nav-mesh-addr)) - (format #t "~1Tpoly-array-addr: ~D~%" (-> obj poly-array-addr)) - (format #t "~1Thash-sphere-addr: ~D~%" (-> obj hash-sphere-addr)) - (format #t "~1Thash-buckets-addr: ~D~%" (-> obj hash-buckets-addr)) - (format #t "~1Tbuf-nav-control-count: ~D~%" (-> obj buf-nav-control-count)) - (format #t "~1Tmax-pass-count: ~D~%" (-> obj max-pass-count)) - (format #t "~1Toutput-sphere-hash: ~D~%" (-> obj output-sphere-hash)) - (format #t "~1Twork-buf-array[3] @ #x~X~%" (-> obj work-buf-array)) - (format #t "~1Tspr-work: #~%" (-> obj nav-work-addr)) - (format #t "~1Tmem-work: #~%" (-> obj mem-work)) - (format #t "~1Tspr-mesh: ~A~%" (-> obj nav-mesh-addr)) - (format #t "~1Tmem-mesh: ~A~%" (-> obj mem-mesh)) - (format #t "~1Tspr-poly-array: #x~X~%" (-> obj poly-array-addr)) - (format #t "~1Tmem-poly-array: #x~X~%" (-> obj mem-poly-array)) - (format #t "~1Thash-sphere-list: #x~X~%" (-> obj hash-sphere-addr)) - (format #t "~1Thash-buckets: #x~X~%" (-> obj hash-buckets-addr)) - (format #t "~1Tto-spr-wait: ~D~%" (-> obj to-spr-wait)) - (format #t "~1Tfrom-spr-wait: ~D~%" (-> obj from-spr-wait)) + (format #t "[~8x] ~A~%" this 'nav-engine) + (format #t "~1Tspr-addr: ~D~%" (-> this spr-addr)) + (format #t "~1Tnav-work-addr: ~D~%" (-> this nav-work-addr)) + (format #t "~1Tnav-mesh-addr: ~D~%" (-> this nav-mesh-addr)) + (format #t "~1Tpoly-array-addr: ~D~%" (-> this poly-array-addr)) + (format #t "~1Thash-sphere-addr: ~D~%" (-> this hash-sphere-addr)) + (format #t "~1Thash-buckets-addr: ~D~%" (-> this hash-buckets-addr)) + (format #t "~1Tbuf-nav-control-count: ~D~%" (-> this buf-nav-control-count)) + (format #t "~1Tmax-pass-count: ~D~%" (-> this max-pass-count)) + (format #t "~1Toutput-sphere-hash: ~D~%" (-> this output-sphere-hash)) + (format #t "~1Twork-buf-array[3] @ #x~X~%" (-> this work-buf-array)) + (format #t "~1Tspr-work: #~%" (-> this nav-work-addr)) + (format #t "~1Tmem-work: #~%" (-> this mem-work)) + (format #t "~1Tspr-mesh: ~A~%" (-> this nav-mesh-addr)) + (format #t "~1Tmem-mesh: ~A~%" (-> this mem-mesh)) + (format #t "~1Tspr-poly-array: #x~X~%" (-> this poly-array-addr)) + (format #t "~1Tmem-poly-array: #x~X~%" (-> this mem-poly-array)) + (format #t "~1Thash-sphere-list: #x~X~%" (-> this hash-sphere-addr)) + (format #t "~1Thash-buckets: #x~X~%" (-> this hash-buckets-addr)) + (format #t "~1Tto-spr-wait: ~D~%" (-> this to-spr-wait)) + (format #t "~1Tfrom-spr-wait: ~D~%" (-> this from-spr-wait)) (label cfg-4) - obj + this ) -(defmethod inc-spr-addr! nav-engine ((obj nav-engine) (arg0 uint)) +(defmethod inc-spr-addr! nav-engine ((this nav-engine) (arg0 uint)) "Adds the given integer to `spr-addr` and returns it" - (let ((v0-0 (-> obj spr-addr))) - (+! (-> obj spr-addr) arg0) + (let ((v0-0 (-> this spr-addr))) + (+! (-> this spr-addr) arg0) v0-0 ) ) -(defmethod lay-out-spad-memory nav-engine ((obj nav-engine) (arg0 nav-mesh)) +(defmethod lay-out-spad-memory nav-engine ((this nav-engine) (arg0 nav-mesh)) (let ((s5-0 0)) ;; og:preserve-this scratchpad - (set! (-> obj spr-addr) (scratchpad-object uint :offset #x60)) - (let* ((v1-1 obj) + (set! (-> this spr-addr) (scratchpad-object uint :offset #x60)) + (let* ((v1-1 this) (a1-1 320) (a0-1 (-> v1-1 spr-addr)) ) (+! (-> v1-1 spr-addr) a1-1) - (set! (-> obj nav-work-addr) a0-1) + (set! (-> this nav-work-addr) a0-1) ) - (let* ((v1-2 obj) + (let* ((v1-2 this) (a1-3 112) (a0-2 (-> v1-2 spr-addr)) ) (+! (-> v1-2 spr-addr) a1-3) - (set! (-> obj nav-mesh-addr) (the-as nav-mesh a0-2)) + (set! (-> this nav-mesh-addr) (the-as nav-mesh a0-2)) ) (if (and (= (-> *nav-mesh-work* polys-in-scratch) 1) (< (-> arg0 poly-count) (the-as uint 64))) (set! s5-0 (the-as int (-> arg0 poly-count))) ) - (let* ((v1-10 obj) + (let* ((v1-10 this) (a1-5 (* s5-0 64)) (a0-4 (-> v1-10 spr-addr)) ) (+! (-> v1-10 spr-addr) a1-5) - (set! (-> obj poly-array-addr) a0-4) + (set! (-> this poly-array-addr) a0-4) ) - (let* ((v1-11 obj) + (let* ((v1-11 this) (a1-7 (* (-> arg0 sphere-hash max-object-count) 16)) (a0-7 (-> v1-11 spr-addr)) ) (+! (-> v1-11 spr-addr) a1-7) - (set! (-> obj hash-sphere-addr) a0-7) + (set! (-> this hash-sphere-addr) a0-7) ) - (let* ((v1-12 obj) + (let* ((v1-12 this) (a1-9 0) (a0-8 (-> v1-12 spr-addr)) ) (+! (-> v1-12 spr-addr) a1-9) - (set! (-> obj hash-buckets-addr) a0-8) + (set! (-> this hash-buckets-addr) a0-8) ) - (set! (-> obj buf-nav-control-count) 7) + (set! (-> this buf-nav-control-count) 7) (dotimes (v1-14 3) - (let ((a0-11 (-> obj work-buf-array v1-14))) - (let* ((a1-11 obj) + (let ((a0-11 (-> this work-buf-array v1-14))) + (let* ((a1-11 this) (a3-0 2048) (a2-5 (-> a1-11 spr-addr)) ) @@ -1027,43 +1027,43 @@ (set! (-> a0-11 i-pass) -1) ) ) - (set! (-> obj output-sphere-hash) (the-as uint 0)) - (set! (-> obj mem-mesh) arg0) + (set! (-> this output-sphere-hash) (the-as uint 0)) + (set! (-> this mem-mesh) arg0) (cond ((= (-> *nav-mesh-work* mesh-struct-in-scratch) 1) - (set! (-> obj nav-mesh-addr) (the-as nav-mesh (&-> (-> obj nav-mesh-addr) poly-array))) - (mem-copy! (&-> (-> obj nav-mesh-addr) type) (&-> arg0 type) 112) + (set! (-> this nav-mesh-addr) (the-as nav-mesh (&-> (-> this nav-mesh-addr) poly-array))) + (mem-copy! (&-> (-> this nav-mesh-addr) type) (&-> arg0 type) 112) ) (else - (set! (-> obj nav-mesh-addr) arg0) + (set! (-> this nav-mesh-addr) arg0) ) ) - (set! (-> obj mem-work) (-> arg0 work)) + (set! (-> this mem-work) (-> arg0 work)) (if (= (-> *nav-mesh-work* work-struct-in-scratch) 1) - (quad-copy! (the-as pointer (-> obj nav-work-addr)) (the-as pointer (-> obj mem-work)) 20) - (set! (-> obj nav-work-addr) (the-as uint (-> arg0 work))) + (quad-copy! (the-as pointer (-> this nav-work-addr)) (the-as pointer (-> this mem-work)) 20) + (set! (-> this nav-work-addr) (the-as uint (-> arg0 work))) ) - (set! (-> obj nav-mesh-addr work) (the-as nav-mesh-work (-> obj nav-work-addr))) - (set! (-> obj mem-poly-array) (-> arg0 poly-array)) + (set! (-> this nav-mesh-addr work) (the-as nav-mesh-work (-> this nav-work-addr))) + (set! (-> this mem-poly-array) (-> arg0 poly-array)) (when (> s5-0 0) - (quad-copy! (the-as pointer (-> obj poly-array-addr)) (the-as pointer (-> obj mem-poly-array)) (* s5-0 4)) - (set! (-> obj nav-mesh-addr poly-array) (the-as (inline-array nav-poly) (-> obj poly-array-addr))) + (quad-copy! (the-as pointer (-> this poly-array-addr)) (the-as pointer (-> this mem-poly-array)) (* s5-0 4)) + (set! (-> this nav-mesh-addr poly-array) (the-as (inline-array nav-poly) (-> this poly-array-addr))) ) ) 0 (none) ) -(defmethod set-up-mem-work nav-engine ((obj nav-engine)) - (let ((v1-0 (-> obj mem-mesh))) - (set! (-> v1-0 poly-array) (-> obj mem-poly-array)) - (set! (-> v1-0 work) (-> obj mem-work)) +(defmethod set-up-mem-work nav-engine ((this nav-engine)) + (let ((v1-0 (-> this mem-mesh))) + (set! (-> v1-0 poly-array) (-> this mem-poly-array)) + (set! (-> v1-0 work) (-> this mem-work)) ) 0 (none) ) -(defmethod add-spheres-from-mesh-user-list nav-engine ((obj nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) +(defmethod add-spheres-from-mesh-user-list nav-engine ((this nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) (countdown (s3-0 (-> arg1 static-sphere-count)) (add-a-sphere-with-flag arg0 (-> arg1 static-sphere s3-0) 64) ) @@ -1082,7 +1082,7 @@ (set! (-> s1-0 root-nav-sphere quad) (-> (the-as collide-shape s2-0) trans quad)) (set! (-> s1-0 root-nav-sphere w) (-> (the-as collide-shape s2-0) nav-radius)) (if (logtest? (-> s1-0 flags) (nav-control-flag output-sphere-hash)) - (set! (-> obj output-sphere-hash) (the-as uint 1)) + (set! (-> this output-sphere-hash) (the-as uint 1)) ) (if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) (set! (-> s1-0 root-sphere-id) @@ -1147,13 +1147,13 @@ (none) ) -(defmethod add-all-spheres nav-engine ((obj nav-engine)) - (let ((s4-0 (-> obj nav-mesh-addr)) - (gp-0 (-> obj nav-mesh-addr sphere-hash)) +(defmethod add-all-spheres nav-engine ((this nav-engine)) + (let ((s4-0 (-> this nav-mesh-addr)) + (gp-0 (-> this nav-mesh-addr sphere-hash)) ) (clear-objects! gp-0) - (set! (-> gp-0 bucket-array) (the-as (pointer grid-hash-word) (-> obj hash-buckets-addr))) - (set! (-> gp-0 sphere-array) (the-as (inline-array sphere) (-> obj hash-sphere-addr))) + (set! (-> gp-0 bucket-array) (the-as (pointer grid-hash-word) (-> this hash-buckets-addr))) + (set! (-> gp-0 sphere-array) (the-as (inline-array sphere) (-> this hash-sphere-addr))) (when *target* (let ((a1-0 (new 'stack-no-clear 'nav-vertex))) (let ((v1-8 (-> *target* control))) @@ -1163,16 +1163,16 @@ (add-a-sphere-with-flag gp-0 a1-0 2) ) ) - (add-spheres-from-mesh-user-list obj gp-0 s4-0) + (add-spheres-from-mesh-user-list this gp-0 s4-0) (let ((s3-0 (the-as nav-mesh (-> s4-0 next-nav-mesh)))) (while (and s3-0 (nonzero? s3-0)) - (add-spheres-from-mesh-user-list obj gp-0 s3-0) + (add-spheres-from-mesh-user-list this gp-0 s3-0) (set! s3-0 (the-as nav-mesh (-> s3-0 next-nav-mesh))) ) ) (let ((s4-1 (the-as nav-mesh (-> s4-0 prev-nav-mesh)))) (while (and s4-1 (nonzero? s4-1)) - (add-spheres-from-mesh-user-list obj gp-0 s4-1) + (add-spheres-from-mesh-user-list this gp-0 s4-1) (set! s4-1 (the-as nav-mesh (-> s4-1 prev-nav-mesh))) ) ) @@ -1182,16 +1182,16 @@ (none) ) -(defmethod do-sphere-lookups nav-engine ((obj nav-engine)) - (let ((s5-0 (-> obj nav-mesh-addr))) +(defmethod do-sphere-lookups nav-engine ((this nav-engine)) + (let ((s5-0 (-> this nav-mesh-addr))) (dotimes (s4-0 (the-as int (-> s5-0 nav-control-count))) (let ((a0-3 (-> s5-0 nav-control-array s4-0))) (when (-> a0-3 process) (set! (-> a0-3 sphere-count) 0) - (set! (-> a0-3 state mesh) (-> obj nav-mesh-addr)) - (set! (-> obj mem-work nav) (the-as basic a0-3)) + (set! (-> a0-3 state mesh) (-> this nav-mesh-addr)) + (set! (-> this mem-work nav) (the-as basic a0-3)) (find-sphere-ids-from-sphere-hash a0-3 #f) - (set! (-> obj mem-work nav) #f) + (set! (-> this mem-work nav) #f) ) ) ) @@ -1222,7 +1222,7 @@ (defmethod-mips2c "(method 18 nav-engine)" 18 nav-engine) -(defmethod do-callbacks nav-engine ((obj nav-engine) (arg0 nav-engine-spr-buffer)) +(defmethod do-callbacks nav-engine ((this nav-engine) (arg0 nav-engine-spr-buffer)) (local-vars (sv-16 nav-callback-info)) (with-pp (dotimes (s4-0 (-> arg0 nav-count)) @@ -1235,16 +1235,16 @@ (when (and (logtest? (-> a1-1 flags) (nav-control-flag kernel-run)) sv-16) (let ((s3-0 pp)) (set! pp a0-3) - (set! (-> obj mem-mesh work nav) (the-as basic a1-1)) + (set! (-> this mem-mesh work nav) (the-as basic a1-1)) (let ((v1-10 (-> sv-16 callback-count))) - (set! (-> obj max-pass-count) (max (-> obj max-pass-count) v1-10)) + (set! (-> this max-pass-count) (max (-> this max-pass-count) v1-10)) (if (< (-> arg0 i-pass) v1-10) ((-> sv-16 callback-array (-> arg0 i-pass)) a0-3 a1-1) ) ) (set! pp s3-0) ) - (set! (-> obj mem-mesh work nav) #f) + (set! (-> this mem-mesh work nav) #f) ) ) ) @@ -1258,7 +1258,7 @@ (defmethod-mips2c "(method 21 nav-engine)" 21 nav-engine) -(defmethod update-nav-controls-pipelined-in-spr nav-engine ((obj nav-engine)) +(defmethod update-nav-controls-pipelined-in-spr nav-engine ((this nav-engine)) (local-vars (v1-33 int) (v1-45 int) @@ -1274,37 +1274,37 @@ (sv-48 nav-engine-spr-buffer) ) (flush-cache 0) - (set! (-> obj max-pass-count) 3) + (set! (-> this max-pass-count) 3) (set! sv-16 (the-as symbol #f)) (set! sv-24 0) (set! sv-32 0) - (set! sv-40 (-> obj nav-mesh-addr nav-control-count)) - (set! sv-44 (-> obj nav-mesh-addr nav-control-array)) + (set! sv-40 (-> this nav-mesh-addr nav-control-count)) + (set! sv-44 (-> this nav-mesh-addr nav-control-array)) (let ((s5-0 2) (s3-0 1) (s4-0 0) ) (while (not sv-16) - (let ((s2-0 (-> obj work-buf-array s5-0))) + (let ((s2-0 (-> this work-buf-array s5-0))) (set! (-> s2-0 i-nav) (the-as uint sv-32)) - (set! (-> s2-0 nav-count) (min (-> obj buf-nav-control-count) (the-as int (- sv-40 (the-as uint sv-32))))) + (set! (-> s2-0 nav-count) (min (-> this buf-nav-control-count) (the-as int (- sv-40 (the-as uint sv-32))))) (set! (-> s2-0 i-pass) sv-24) (set! (-> s2-0 mem-addr) (the-as (pointer nav-mesh) (-> sv-44 sv-32))) (set! (-> s2-0 q-size) (the-as uint (* 18 (-> s2-0 nav-count)))) (set! (-> s2-0 done) 0) - (when (>= sv-24 (-> obj max-pass-count)) + (when (>= sv-24 (-> this max-pass-count)) (set! (-> s2-0 nav-count) 0) 0 ) (if (> (-> s2-0 nav-count) 0) - (upload-nav-to-spr obj s2-0) + (upload-nav-to-spr this s2-0) (dma-sync (the-as pointer #x1000d400) 0 0) ) (set! sv-32 (+ sv-32 (-> s2-0 nav-count))) (when (>= sv-32 (the-as int sv-40)) (set! sv-32 0) (set! sv-24 (+ sv-24 1)) - (if (= sv-24 (-> obj max-pass-count)) + (if (= sv-24 (-> this max-pass-count)) (set! (-> s2-0 done) 1) ) ) @@ -1316,9 +1316,9 @@ (move-if-not-zero v1-33 0 a0-14 v1-32) ) (set! s5-0 v1-33) - (let ((s2-1 (-> obj work-buf-array s4-0))) + (let ((s2-1 (-> this work-buf-array s4-0))) (when (> (-> s2-1 nav-count) 0) - (download-nav-from-spr obj s2-1) + (download-nav-from-spr this s2-1) (when (= (-> s2-1 done) 1) (dma-sync (the-as pointer #x1000d000) 0 0) (set! sv-16 #t) @@ -1332,14 +1332,14 @@ (move-if-not-zero v1-45 0 a0-19 v1-44) ) (set! s4-0 v1-45) - (set! sv-48 (-> obj work-buf-array s3-0)) + (set! sv-48 (-> this work-buf-array s3-0)) (when (> (-> sv-48 nav-count) 0) (if (zero? (-> sv-48 i-pass)) - (reloc-ptrs-to-spad obj sv-48) + (reloc-ptrs-to-spad this sv-48) ) - (do-callbacks obj sv-48) - (if (= (-> sv-48 i-pass) (+ (-> obj max-pass-count) -1)) - (reloc-ptrs-to-mem obj sv-48) + (do-callbacks this sv-48) + (if (= (-> sv-48 i-pass) (+ (-> this max-pass-count) -1)) + (reloc-ptrs-to-mem this sv-48) ) ) (let ((v1-65 (+ s3-0 1))) @@ -1355,31 +1355,31 @@ (none) ) -(defmethod update-nav-controls-in-spr nav-engine ((obj nav-engine)) +(defmethod update-nav-controls-in-spr nav-engine ((this nav-engine)) (flush-cache 0) - (set! (-> obj max-pass-count) 1) - (let ((gp-0 (the-as object (-> obj work-buf-array)))) + (set! (-> this max-pass-count) 1) + (let ((gp-0 (the-as object (-> this work-buf-array)))) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-nav) (the-as uint 0)) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count) - (the-as int (-> obj nav-mesh-addr nav-control-count)) + (the-as int (-> this nav-mesh-addr nav-control-count)) ) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) 0) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 mem-addr) - (the-as (pointer nav-mesh) (-> obj nav-mesh-addr nav-control-array)) + (the-as (pointer nav-mesh) (-> this nav-mesh-addr nav-control-array)) ) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 q-size) (the-as uint (* 18 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count))) ) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 done) 0) (when (> (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count) 0) - (upload-nav-to-spr obj (the-as nav-engine-spr-buffer gp-0)) + (upload-nav-to-spr this (the-as nav-engine-spr-buffer gp-0)) (dma-sync (the-as pointer #x1000d400) 0 0) - (reloc-ptrs-to-spad obj (the-as nav-engine-spr-buffer gp-0)) - (while (< (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) (-> obj max-pass-count)) - (do-callbacks obj (the-as nav-engine-spr-buffer gp-0)) + (reloc-ptrs-to-spad this (the-as nav-engine-spr-buffer gp-0)) + (while (< (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) (-> this max-pass-count)) + (do-callbacks this (the-as nav-engine-spr-buffer gp-0)) (+! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) 1) ) - (reloc-ptrs-to-mem obj (the-as nav-engine-spr-buffer gp-0)) + (reloc-ptrs-to-mem this (the-as nav-engine-spr-buffer gp-0)) (dotimes (s4-0 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count)) (let ((a2-1 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 spr-addr s4-0 state mesh))) ;; og:preserve-this scratchpad @@ -1390,7 +1390,7 @@ ) ) ) - (download-nav-from-spr obj (the-as nav-engine-spr-buffer gp-0)) + (download-nav-from-spr this (the-as nav-engine-spr-buffer gp-0)) (dma-sync (the-as pointer #x1000d000) 0 0) (dotimes (s5-1 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count)) (let ((a2-3 (-> (&+ (-> (the-as nav-engine-spr-buffer gp-0) mem-addr) (* 288 s5-1)) 31))) @@ -1408,19 +1408,19 @@ (none) ) -(defmethod update-navigation nav-mesh ((obj nav-mesh)) +(defmethod update-navigation nav-mesh ((this nav-mesh)) (local-vars (sp-0 int)) - (when (zero? (-> obj next-nav-mesh)) - (set! (-> obj next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> obj entity) 'next-actor 0))) - (set! (-> obj prev-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> obj entity) 'prev-actor 0))) + (when (zero? (-> this next-nav-mesh)) + (set! (-> this next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'next-actor 0))) + (set! (-> this prev-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'prev-actor 0))) ) - (when (> (-> obj nav-control-count) 0) + (when (> (-> this nav-control-count) 0) (the-as none sp-0) (set! sp-0 #x70003fc0) - (set! (-> obj work mesh) obj) + (set! (-> this work mesh) this) ;; og:preserve-this scratchpad (let ((s4-0 (scratchpad-object nav-engine))) - (lay-out-spad-memory s4-0 obj) + (lay-out-spad-memory s4-0 this) (add-all-spheres s4-0) (do-sphere-lookups s4-0) (when (nonzero? (-> s4-0 output-sphere-hash)) @@ -1435,7 +1435,7 @@ (set! (-> s3-0 sphere-array) (the-as (inline-array sphere) (-> s3-0 mem-sphere-array))) ) ) - (if (< (the-as uint (* 3 (-> s4-0 buf-nav-control-count))) (-> obj nav-control-count)) + (if (< (the-as uint (* 3 (-> s4-0 buf-nav-control-count))) (-> this nav-control-count)) (update-nav-controls-pipelined-in-spr s4-0) (update-nav-controls-in-spr s4-0) ) @@ -1446,26 +1446,26 @@ (none) ) -(defmethod debug-draw nav-mesh ((obj nav-mesh)) +(defmethod debug-draw nav-mesh ((this nav-mesh)) (local-vars (sv-32 vector) (sv-36 int)) (set! sv-32 (new 'stack-no-clear 'vector)) (set! sv-36 16) (add-debug-sphere (logtest? sv-36 4) (bucket-id debug2) - (-> obj bounds) - (-> obj bounds w) + (-> this bounds) + (-> this bounds w) (new 'static 'rgba :r #xff :g #xff :a #x20) ) - (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj bounds) *x-vector* (meters 1) *color-red*) - (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj bounds) *z-vector* (meters 1) *color-blue*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this bounds) *x-vector* (meters 1) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this bounds) *z-vector* (meters 1) *color-blue*) (when (logtest? sv-36 16) - (dotimes (s5-0 (the-as int (-> obj static-sphere-count))) + (dotimes (s5-0 (the-as int (-> this static-sphere-count))) (add-debug-sphere #t (bucket-id debug2) - (-> obj static-sphere s5-0) - (-> obj static-sphere s5-0 r) + (-> this static-sphere s5-0) + (-> this static-sphere s5-0 r) *color-light-blue* ) (let ((s4-0 add-debug-text-3d) @@ -1477,15 +1477,15 @@ s3-0 (the-as bucket-id s2-0) *temp-string* - (-> obj static-sphere s5-0) + (-> this static-sphere s5-0) (font-color cyan) (the-as vector2h #f) ) ) ) - (dotimes (s5-1 (the-as int (-> obj poly-count))) - (let ((s4-1 (-> obj poly-array s5-1))) - (debug-draw-poly obj s4-1 (cond + (dotimes (s5-1 (the-as int (-> this poly-count))) + (let ((s4-1 (-> this poly-array s5-1))) + (debug-draw-poly this s4-1 (cond ((logtest? (-> s4-1 pat) 1) *color-black* ) @@ -1493,7 +1493,7 @@ *color-gray* ) ((logtest? (-> s4-1 pat) 4) - (if (-> obj link-array (-> s4-1 link) dest-mesh) + (if (-> this link-array (-> s4-1 link) dest-mesh) *color-green* *color-light-red* ) @@ -1513,7 +1513,7 @@ s2-1 (the-as bucket-id s1-1) *temp-string* - (poly-centroid obj s4-1 sv-32) + (poly-centroid this s4-1 sv-32) (font-color cyan) (the-as vector2h #f) ) @@ -1526,7 +1526,7 @@ (none) ) -(defmethod poly-centroid-local nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod poly-centroid-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((v1-0 (new 'stack-no-clear 'nav-vertex))) @@ -1539,9 +1539,9 @@ ) ) -(defmethod poly-centroid nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) - (poly-centroid-local obj arg0 arg1) - (vector+! arg1 arg1 (-> obj bounds)) +(defmethod poly-centroid nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (poly-centroid-local this arg0 arg1) + (vector+! arg1 arg1 (-> this bounds)) ) (defun vu-point-triangle-intersection? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) @@ -1600,10 +1600,10 @@ (and (>= (+ (-> arg0 vertex3 w) arg2) arg1) (>= arg1 (- (-> arg0 vertex2 w) arg2))) ) -(defmethod find-poly-containing-point-local nav-mesh ((obj nav-mesh) (arg0 nav-find-poly-parms)) +(defmethod find-poly-containing-point-local nav-mesh ((this nav-mesh) (arg0 nav-find-poly-parms)) (local-vars (v1-6 symbol) (v1-15 int) (a0-3 symbol) (sv-16 nav-poly)) - (let ((s4-0 (search-for-point (-> obj poly-hash) (-> arg0 point))) - (s3-0 (-> obj poly-hash bucket-size)) + (let ((s4-0 (search-for-point (-> this poly-hash) (-> arg0 point))) + (s3-0 (-> this poly-hash bucket-size)) (s2-0 0) ) (until (zero? v1-15) @@ -1617,7 +1617,7 @@ (nop!) (b! (zero? v1-2) cfg-16 :delay (nop!)) ) - (set! sv-16 (-> obj poly-array s1-0)) + (set! sv-16 (-> this poly-array s1-0)) (let ((v1-5 sv-16) (f0-0 (-> arg0 point y)) (f1-0 (-> arg0 y-threshold)) @@ -1629,7 +1629,7 @@ ) (label cfg-9) (when (and v1-6 (not (logtest? (-> sv-16 pat) (-> arg0 ignore)))) - (if (point-in-poly? obj sv-16 (-> arg0 point)) + (if (point-in-poly? this sv-16 (-> arg0 point)) (return sv-16) ) ) @@ -1650,7 +1650,7 @@ (the-as nav-poly #f) ) -(defmethod is-in-mesh-local? nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod is-in-mesh-local? nav-mesh ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) (local-vars (v1-3 float) (sv-16 float) (sv-20 vector) (sv-24 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1661,7 +1661,7 @@ (set! sv-16 arg2) (set! sv-20 arg0) (set! sv-24 arg1) - (let* ((f0-3 (+ sv-24 (-> obj bounds w))) + (let* ((f0-3 (+ sv-24 (-> this bounds w))) (f0-5 (* f0-3 f0-3)) ) (.lvf vf1 (&-> sv-20 quad)) @@ -1676,14 +1676,14 @@ (set! (-> s5-0 point quad) (-> sv-20 quad)) (set! (-> s5-0 y-threshold) sv-16) (set! (-> s5-0 ignore) (the-as uint 2)) - (find-nearest-poly-to-point-local obj s5-0) + (find-nearest-poly-to-point-local this s5-0) (cond ((-> s5-0 point-inside?) #t ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) - (project-point-into-poly-2d obj (-> s5-0 poly) s4-0 sv-20) + (project-point-into-poly-2d this (-> s5-0 poly) s4-0 sv-20) (let ((f0-7 (vector-vector-xz-distance-squared s4-0 sv-20)) (f1-2 sv-24) ) @@ -1812,14 +1812,14 @@ ) ) -(defmethod try-move-along-ray nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod try-move-along-ray nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (v1-2 symbol)) (let ((gp-0 (new 'stack-no-clear 'nav-ray))) (let ((s4-0 0)) (init-ray-dir-local gp-0 arg0 arg1 arg2 arg3) (until v1-2 (+! s4-0 1) - (move-along-nav-ray! obj gp-0) + (move-along-nav-ray! this gp-0) (set! v1-2 (or (>= s4-0 15) (-> gp-0 terminated))) ) ) @@ -1909,7 +1909,7 @@ ) ) -(defmethod find-nearest-poly-to-point-local nav-mesh ((obj nav-mesh) (arg0 nav-find-poly-parms)) +(defmethod find-nearest-poly-to-point-local nav-mesh ((this nav-mesh) (arg0 nav-find-poly-parms)) (local-vars (v1-16 int) (v1-34 int) @@ -1923,9 +1923,9 @@ (sv-52 float) ) (set! sv-16 (the-as nav-poly #f)) - (set! sv-20 (search-for-sphere (-> obj poly-hash) (-> arg0 point) 12288.0)) + (set! sv-20 (search-for-sphere (-> this poly-hash) (-> arg0 point) 12288.0)) (set! (-> arg0 point-inside?) #f) - (let ((s4-0 (-> obj poly-hash bucket-size)) + (let ((s4-0 (-> this poly-hash bucket-size)) (s3-0 sv-20) (s2-0 0) ) @@ -1941,7 +1941,7 @@ (nop!) (b! (zero? v1-3) cfg-16 :delay (nop!)) ) - (set! sv-24 (-> obj poly-array s1-0)) + (set! sv-24 (-> this poly-array s1-0)) (let ((v1-6 sv-24) (f0-0 (-> arg0 point y)) (f1-0 (-> arg0 y-threshold)) @@ -1955,7 +1955,7 @@ :delay (empty-form) ) ) - (b! (not (point-in-poly? obj sv-24 (-> arg0 point))) cfg-16 :delay (empty-form)) + (b! (not (point-in-poly? this sv-24 (-> arg0 point))) cfg-16 :delay (empty-form)) (set! (-> arg0 point-inside?) #t) (set! (-> arg0 dist) 0.0) (set! sv-16 sv-24) @@ -1977,7 +1977,7 @@ (set! sv-28 (the-as float 10000000000000000000000000000000000000.0)) (set! sv-32 0) (set! sv-40 0) - (let ((s4-1 (-> obj poly-hash bucket-size)) + (let ((s4-1 (-> this poly-hash bucket-size)) (s3-1 sv-20) (s2-1 0) ) @@ -1992,7 +1992,7 @@ (nop!) (b! (zero? v1-19) cfg-33 :delay (nop!)) ) - (set! sv-48 (-> obj poly-array s1-1)) + (set! sv-48 (-> this poly-array s1-1)) (let ((v1-22 sv-48) (f0-3 (-> arg0 point y)) (f1-2 (-> arg0 y-threshold)) @@ -2001,7 +2001,7 @@ (not (logtest? (-> sv-48 pat) (-> arg0 ignore))) ) (set! sv-40 (+ sv-40 1)) - (set! sv-52 (point-poly-distance-min (-> obj work) (the-as nav-poly (-> arg0 point)) sv-28 sv-48)) + (set! sv-52 (point-poly-distance-min (-> this work) (the-as nav-poly (-> arg0 point)) sv-28 sv-48)) (when (< sv-52 sv-28) (set! sv-28 sv-52) (set! sv-16 sv-48) @@ -2023,7 +2023,7 @@ ) ) (if (not sv-16) - (set! sv-16 (-> obj poly-array 0)) + (set! sv-16 (-> this poly-array 0)) ) (set! (-> arg0 dist) sv-28) (label cfg-38) @@ -2035,15 +2035,15 @@ (* (+ arg2 (* arg1 (-> arg0 poly-count))) 2) ) -(defmethod get-route-portal nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) +(defmethod get-route-portal nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) (set! (-> arg2 next-poly) #f) (cond ((and arg0 arg1 (!= arg0 arg1)) - (let* ((a1-1 obj) + (let* ((a1-1 this) (v1-1 (-> arg0 id)) (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a1-1 poly-count))) 2)) (s3-0 - (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) + (logand (ash (-> (the-as (pointer uint8) (&+ (-> this route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) 3 ) ) @@ -2056,7 +2056,7 @@ 0 ) (set! (-> arg2 edge-index) (the-as int s3-0)) - (set! (-> arg2 next-poly) (-> obj poly-array s2-0)) + (set! (-> arg2 next-poly) (-> this poly-array s2-0)) ) (let ((a0-7 s3-0) (v1-16 (the-as int (+ s3-0 1))) @@ -2078,14 +2078,14 @@ ) ) -(defmethod lookup-poly-on-route-to-target nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) +(defmethod lookup-poly-on-route-to-target nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) (cond ((and arg0 arg1 (!= arg0 arg1)) - (let* ((a3-0 obj) + (let* ((a3-0 this) (v1-1 (-> arg0 id)) (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a3-0 poly-count))) 2)) (v1-9 - (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) + (logand (ash (-> (the-as (pointer uint8) (&+ (-> this route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) 3 ) ) @@ -2098,7 +2098,7 @@ (let ((v1-11 (-> (the-as (pointer uint8) (&+ a2-5 v1-9))))) (if (= v1-11 255) (the-as nav-poly #f) - (-> obj poly-array v1-11) + (-> this poly-array v1-11) ) ) ) @@ -2109,7 +2109,7 @@ ) ) -(defmethod compute-bounding-box-from-vertices nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector)) +(defmethod compute-bounding-box-from-vertices nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector)) (let ((f0-0 10000000000000000000000000000000000000.0) (f1-0 -10000000000000000000000000000000000000.0) ) @@ -2120,8 +2120,8 @@ (set! (-> arg1 y) f1-0) (set! (-> arg1 z) f1-0) ) - (dotimes (v1-3 (the-as int (-> obj poly-count))) - (let ((a3-1 (-> obj poly-array v1-3))) + (dotimes (v1-3 (the-as int (-> this poly-count))) + (let ((a3-1 (-> this poly-array v1-3))) (dotimes (t0-1 (the-as int (-> a3-1 vertex-count))) (let ((t1-2 (-> a3-1 vertex t0-1))) (set! (-> arg0 x) (fmin (-> arg0 x) (-> t1-2 x))) @@ -2134,13 +2134,13 @@ ) ) ) - (vector+! arg0 arg0 (-> obj bounds)) - (vector+! arg1 arg1 (-> obj bounds)) + (vector+! arg0 arg0 (-> this bounds)) + (vector+! arg1 arg1 (-> this bounds)) 0 (none) ) -(defmethod initialize-mesh! nav-mesh ((obj nav-mesh)) +(defmethod initialize-mesh! nav-mesh ((this nav-mesh)) (local-vars (sv-32 vector) (sv-36 uint) @@ -2162,13 +2162,13 @@ ) (init-vf0-vector) (set! sv-32 (new 'stack-no-clear 'vector)) - (set! sv-36 (-> obj poly-count)) + (set! sv-36 (-> this poly-count)) (set! sv-40 0) (set! sv-48 0) (set! sv-56 0) (set! sv-64 (the-as symbol #f)) (countdown (s5-0 sv-36) - (let ((v1-3 (-> obj poly-array s5-0))) + (let ((v1-3 (-> this poly-array s5-0))) (if (logtest? (-> v1-3 pat) 1) (set! sv-56 (+ sv-56 1)) ) @@ -2284,7 +2284,7 @@ ) ) -(defmethod nav-mesh-method-38 nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) +(defmethod nav-mesh-method-38 nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) (local-vars (s1-0 vector) (sv-16 int) @@ -2296,7 +2296,7 @@ (sv-44 vector) ) (set! sv-16 -1) - (set! sv-24 (-> obj work)) + (set! sv-24 (-> this work)) (set! sv-28 (-> arg0 vertex-count)) (set! sv-32 (-> sv-24 vert0-table)) (set! sv-36 (-> sv-24 vert1-table)) @@ -2328,19 +2328,19 @@ (let ((v1-16 (-> arg0 adj-poly sv-16))) (cond ((!= v1-16 255) - (set! (-> arg4 0) (-> obj poly-array v1-16)) + (set! (-> arg4 0) (-> this poly-array v1-16)) (set! sv-16 -1) ) ((let ((a1-1 (-> arg0 vertex (-> sv-32 sv-16)))) (set! s1-0 (-> arg0 vertex (-> sv-36 sv-16))) - (< (vector-vector-xz-distance arg1 a1-1) (-> obj work nav-poly-min-dist)) + (< (vector-vector-xz-distance arg1 a1-1) (-> this work nav-poly-min-dist)) ) (set! sv-16 (+ sv-16 -1)) (if (< sv-16 0) (set! sv-16 (the-as int (+ sv-28 -1))) ) ) - ((< (vector-vector-xz-distance arg1 s1-0) (-> obj work nav-poly-min-dist)) + ((< (vector-vector-xz-distance arg1 s1-0) (-> this work nav-poly-min-dist)) (set! sv-16 (+ sv-16 1)) (when (>= sv-16 (the-as int sv-28)) (set! sv-16 0) @@ -2404,7 +2404,7 @@ ) ) -(defmethod project-point-onto-plane-of-poly-local nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod project-point-onto-plane-of-poly-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (new 'stack-no-clear 'vector))) (cond @@ -2438,25 +2438,25 @@ ) ;; WARN: Return type mismatch int vs nav-mesh. -(defmethod mem-usage nav-mesh ((obj nav-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage nav-mesh ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 45 used) v1-6) (+! (-> arg0 data 45 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-16 (* (-> obj poly-count) 64))) + (let ((v1-16 (* (-> this poly-count) 64))) (+! (-> arg0 data 45 used) v1-16) (+! (-> arg0 data 45 total) (logand -16 (+ v1-16 15))) ) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let* ((v1-25 (-> obj poly-count)) + (let* ((v1-25 (-> this poly-count)) (v1-27 (shr (* v1-25 v1-25) 2)) ) (+! (-> arg0 data 45 used) v1-27) @@ -2534,19 +2534,19 @@ ) ) -(defmethod nav-mesh-method-10 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) +(defmethod nav-mesh-method-10 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) (local-vars (sv-16 vector)) (set! sv-16 arg0) (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) (set! (-> gp-0 poly) arg2) - (vector-! (-> gp-0 point) arg1 (-> obj bounds)) - (when (or (not (-> gp-0 poly)) (not (point-in-poly? obj (-> gp-0 poly) (-> gp-0 point)))) - (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> gp-0 point) arg1 (-> this bounds)) + (when (or (not (-> gp-0 poly)) (not (point-in-poly? this (-> gp-0 poly) (-> gp-0 point)))) + (set! (-> gp-0 y-threshold) (-> this nearest-y-threshold)) (set! (-> gp-0 ignore) (the-as uint 3)) - (find-nearest-poly-to-point-local obj gp-0) + (find-nearest-poly-to-point-local this gp-0) (when (-> gp-0 poly) - (project-point-into-poly-2d obj (-> gp-0 poly) sv-16 (-> gp-0 point)) - (vector+! sv-16 sv-16 (-> obj bounds)) + (project-point-into-poly-2d this (-> gp-0 poly) sv-16 (-> gp-0 point)) + (vector+! sv-16 sv-16 (-> this bounds)) ) ) (-> gp-0 poly) @@ -2582,15 +2582,15 @@ ) ) -(defmethod nav-mesh-method-34 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod nav-mesh-method-34 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) (local-vars (v1-8 symbol) (v1-13 int) (a1-2 symbol) (sv-80 vector) (sv-84 (pointer uint8))) (let ((gp-0 (new 'stack-no-clear 'nav-poly))) (set! sv-80 arg0) (set! (-> gp-0 vertex3 y) (the-as float #x7f800000)) (set! (-> gp-0 vertex3 x) arg2) (set! (-> gp-0 vertex1 quad) (-> arg1 quad)) - (set! sv-84 (search-for-sphere (-> obj poly-hash) (-> gp-0 vertex1) (-> gp-0 vertex3 x))) - (let ((s4-0 (-> obj poly-hash bucket-size)) + (set! sv-84 (search-for-sphere (-> this poly-hash) (-> gp-0 vertex1) (-> gp-0 vertex3 x))) + (let ((s4-0 (-> this poly-hash bucket-size)) (s3-0 sv-84) (s2-0 0) ) @@ -2605,10 +2605,10 @@ (nop!) (b! (zero? v1-5) cfg-13 :delay (nop!)) ) - (let ((a0-5 (-> obj poly-array s1-0))) + (let ((a0-5 (-> this poly-array s1-0))) (let ((v1-7 a0-5) (f0-3 (-> gp-0 vertex1 y)) - (f1-0 (-> obj nearest-y-threshold)) + (f1-0 (-> this nearest-y-threshold)) ) (b! (>= (+ (-> v1-7 vertex3 w) f1-0) f0-3) cfg-5 :delay (set! a1-2 #t)) (set! a1-2 #f) @@ -2645,28 +2645,28 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-mesh-method-35 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod nav-mesh-method-35 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'nav-poly 3))) (set! (-> gp-0 2 vertex3 y) arg2) - (vector-! (the-as vector (-> gp-0 0)) arg0 (-> obj bounds)) - (vector-! (-> gp-0 0 vertex1) arg1 (-> obj bounds)) + (vector-! (the-as vector (-> gp-0 0)) arg0 (-> this bounds)) + (vector-! (-> gp-0 0 vertex1) arg1 (-> this bounds)) (set! (-> gp-0 2 vertex1 quad) (-> gp-0 0 vertex0 quad)) - (set! (-> gp-0 2 vertex2 x) (-> obj nearest-y-threshold)) + (set! (-> gp-0 2 vertex2 x) (-> this nearest-y-threshold)) (set! (-> gp-0 2 data 36) (the-as uint 3)) - (let ((a1-4 (find-poly-containing-point-local obj (the-as nav-find-poly-parms (-> gp-0 2 vertex1))))) + (let ((a1-4 (find-poly-containing-point-local this (the-as nav-find-poly-parms (-> gp-0 2 vertex1))))) (cond (a1-4 (init-ray-local (the-as nav-ray (-> gp-0 1)) a1-4 (the-as vector (-> gp-0 0)) (-> gp-0 0 vertex1)) (until #f (set! (-> gp-0 2 vertex3 z) - (nav-mesh-method-34 obj (-> gp-0 0 vertex3) (the-as vector (-> gp-0 1)) (-> gp-0 2 vertex3 y)) + (nav-mesh-method-34 this (-> gp-0 0 vertex3) (the-as vector (-> gp-0 1)) (-> gp-0 2 vertex3 y)) ) (b! (>= (-> gp-0 2 vertex3 z) (-> gp-0 2 vertex3 y)) cfg-4 :delay #f) (set! (-> gp-0 2 vertex3 y) (-> gp-0 2 vertex3 z)) (set! (-> gp-0 0 vertex2 quad) (-> gp-0 0 vertex3 quad)) (label cfg-4) (b! (-> gp-0 2 vertex0 x) cfg-6 :delay (nop!)) - (move-along-nav-ray! obj (the-as nav-ray (-> gp-0 1))) + (move-along-nav-ray! this (the-as nav-ray (-> gp-0 1))) ) #f (label cfg-6) diff --git a/goal_src/jak2/engine/physics/chain-physics.gc b/goal_src/jak2/engine/physics/chain-physics.gc index d1c321471d..e10e3a5dec 100644 --- a/goal_src/jak2/engine/physics/chain-physics.gc +++ b/goal_src/jak2/engine/physics/chain-physics.gc @@ -7,53 +7,53 @@ ;; DECOMP BEGINS -(defmethod gravity-update chain-physics ((obj chain-physics) (arg0 process-drawable)) - (vector-seek-3d-smooth! (-> obj gravity) (-> obj gravity-target) 0.05 0.1) +(defmethod gravity-update chain-physics ((this chain-physics) (arg0 process-drawable)) + (vector-seek-3d-smooth! (-> this gravity) (-> this gravity-target) 0.05 0.1) 0 (none) ) -(defmethod apply-gravity chain-physics ((obj chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity chain-physics ((this chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (vector-float*! arg0 - (-> obj gravity) + (-> this gravity) (* 4096.0 (-> self clock time-adjust-ratio) (fmax 0.2 (lerp-scale 0.38 0.18 (the float arg1) 0.0 5.0))) ) 0 (none) ) -(defmethod chain-physics-method-14 chain-physics ((obj chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 chain-physics ((this chain-physics) (arg0 vector) (arg1 int)) (vector-float*! arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ arg1 1) 64))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64))) (fmin 0.9 (lerp-scale 0.2 1.0 (the float arg1) 0.0 4.0)) ) 0 (none) ) -(defmethod clamp-length chain-physics ((obj chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) +(defmethod clamp-length chain-physics ((this chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 arg0 arg1) - (vector-normalize! gp-0 (-> obj joint-length)) + (vector-normalize! gp-0 (-> this joint-length)) (vector+! arg0 gp-0 arg1) ) ) -(defmethod chain-physics-method-16 chain-physics ((obj chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 chain-physics ((this chain-physics) (arg0 int)) (lerp-scale 5461.3335 10922.667 (the float arg0) 0.0 8.0) ) -(defmethod chain-physics-method-17 chain-physics ((obj chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 chain-physics ((this chain-physics) (arg0 vector) (arg1 int)) 0 (none) ) -(defmethod initialize-chain-joints chain-physics ((obj chain-physics)) - (set! (-> obj turn-off-start) 0) - (dotimes (s5-0 (the-as int (-> obj num-joints))) - (let ((s4-0 (-> obj chain-joints s5-0))) +(defmethod initialize-chain-joints chain-physics ((this chain-physics)) + (set! (-> this turn-off-start) 0) + (dotimes (s5-0 (the-as int (-> this num-joints))) + (let ((s4-0 (-> this chain-joints s5-0))) (vector<-cspace! (-> s4-0 position) (-> s4-0 joint-mod joint)) (vector-reset! (-> s4-0 velocity)) (mode-set! (-> s4-0 joint-mod) (joint-mod-mode joint-set-world)) @@ -62,14 +62,14 @@ #f ) -(defmethod turn-off chain-physics ((obj chain-physics) (arg0 time-frame)) - (set! (-> obj turn-off-start) (current-time)) - (set! (-> obj turn-off-duration) arg0) +(defmethod turn-off chain-physics ((this chain-physics) (arg0 time-frame)) + (set-time! (-> this turn-off-start)) + (set! (-> this turn-off-duration) arg0) 0 (none) ) -(defmethod update chain-physics ((obj chain-physics) (arg0 process-drawable)) +(defmethod update chain-physics ((this chain-physics) (arg0 process-drawable)) (local-vars (v1-78 float) (f0-11 float) @@ -101,49 +101,49 @@ (vf6 :class vf) ) (init-vf0-vector) - (gravity-update obj arg0) + (gravity-update this arg0) (let ((s4-0 (new 'stack-no-clear 'matrix)) - (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg0 node-list data (-> obj root-joint-index)))) + (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg0 node-list data (-> this root-joint-index)))) (s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> arg0 node-list data (-> obj root-joint-index) bone transform vector 2) + (-> arg0 node-list data (-> this root-joint-index) bone transform vector 2) 1.0 ) ) (s1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> arg0 node-list data (-> obj root-joint-index) bone transform vector 1) + (-> arg0 node-list data (-> this root-joint-index) bone transform vector 1) 1.0 ) ) ) (new 'stack-no-clear 'vector) (let ((f30-0 1.0)) - (if (nonzero? (-> obj turn-off-start)) + (if (nonzero? (-> this turn-off-start)) (set! f30-0 (fmax 0.0 (fmin 1.0 (parameter-ease-sin-clamp - (- 1.0 (/ (the float (- (current-time) (-> obj turn-off-start))) (the float (-> obj turn-off-duration)))) + (- 1.0 (/ (the float (- (current-time) (-> this turn-off-start))) (the float (-> this turn-off-duration)))) ) ) ) ) ) - (dotimes (s0-0 (the-as int (-> obj num-joints))) - (set! sv-272 (-> obj chain-joints s0-0)) + (dotimes (s0-0 (the-as int (-> this num-joints))) + (set! sv-272 (-> this chain-joints s0-0)) (set! sv-528 (new 'stack-no-clear 'vector)) (let ((v1-27 (-> sv-272 position quad))) (set! (-> sv-528 quad) v1-27) ) (set! (-> sv-272 joint-mod flex-blend) f30-0) - (if (-> obj negate-y) + (if (-> this negate-y) (vector-negate! s1-0 s1-0) ) (set! sv-288 (new 'stack-no-clear 'vector)) - (apply-gravity obj sv-288 s0-0 arg0) + (apply-gravity this sv-288 s0-0 arg0) (let ((v1-34 sv-528)) (let ((a0-10 sv-528)) (.mov.vf vf6 vf0 :mask #b1000) @@ -153,9 +153,9 @@ (.add.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> v1-34 quad) vf6) ) - (when (< s0-0 (the-as int (+ (-> obj root-joint-index) -1))) + (when (< s0-0 (the-as int (+ (-> this root-joint-index) -1))) (set! sv-304 (new 'stack-no-clear 'vector)) - (chain-physics-method-14 obj sv-304 s0-0) + (chain-physics-method-14 this sv-304 s0-0) (let ((v1-40 sv-528)) (let ((a0-13 sv-528)) (.mov.vf vf6 vf0 :mask #b1000) @@ -166,7 +166,7 @@ (.svf (&-> v1-40 quad) vf6) ) ) - (clamp-length obj sv-528 s3-0 s0-0 arg0) + (clamp-length this sv-528 s3-0 s0-0 arg0) (set! sv-400 (new 'stack-no-clear 'vector)) (let ((v1-43 sv-528) (a0-16 s3-0) @@ -179,7 +179,7 @@ (.svf (&-> sv-400 quad) vf6) (let ((f28-1 (vector-normalize-ret-len! sv-400 1.0)) (f24-0 (vector-dot sv-400 s1-0)) - (f26-0 (chain-physics-method-16 obj s0-0)) + (f26-0 (chain-physics-method-16 this s0-0)) ) (when (< f24-0 (cos f26-0)) (vector--float*! sv-400 sv-400 s1-0 f24-0) @@ -205,7 +205,7 @@ (vector+float*! sv-528 s3-0 sv-400 f28-1) ) ) - (chain-physics-method-17 obj sv-528 s0-0) + (chain-physics-method-17 this sv-528 s0-0) (set! sv-432 (new 'stack-no-clear 'vector)) (let ((v1-61 s3-0) (a0-27 sv-528) @@ -231,12 +231,12 @@ (vector--float*! sv-416 sv-416 sv-432 f28-2) (cond ((< f28-2 0.0) - (set! f0-11 (* f28-2 (-> obj compress-vel-parallel))) - (vector-float*! sv-416 sv-416 (-> obj compress-vel)) + (set! f0-11 (* f28-2 (-> this compress-vel-parallel))) + (vector-float*! sv-416 sv-416 (-> this compress-vel)) ) (else - (set! f0-11 (* f28-2 (-> obj stretch-vel-parallel))) - (vector-float*! sv-416 sv-416 (-> obj stretch-vel)) + (set! f0-11 (* f28-2 (-> this stretch-vel-parallel))) + (vector-float*! sv-416 sv-416 (-> this stretch-vel)) ) ) ) @@ -261,7 +261,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-78 vf1) (let* ((f0-13 v1-78) - (f1-6 (* (-> obj maximum-stretch) (-> obj joint-length))) + (f1-6 (* (-> this maximum-stretch) (-> this joint-length))) (f2-3 f1-6) ) (if (< (* f2-3 f2-3) f0-13) @@ -273,10 +273,10 @@ (if (-> sv-272 joint-mod) (set! (-> sv-272 joint-mod trans quad) (-> sv-528 quad)) ) - (when (< s0-0 (the-as int (-> obj num-joints))) + (when (< s0-0 (the-as int (-> this num-joints))) (vector-! (-> s4-0 vector 1) sv-528 s3-0) (vector-normalize! (-> s4-0 vector 1) 1.0) - (if (-> obj negate-y) + (if (-> this negate-y) (vector-negate! (-> s4-0 vector 1) (-> s4-0 vector 1)) ) (vector-cross! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) s2-0) @@ -294,13 +294,13 @@ (vector-flatten! sv-496 (-> sv-272 old-x) (-> s4-0 vector 1)) (vector-normalize! sv-496 1.0) (cond - ((< (vector-dot (the-as vector (-> s4-0 vector)) sv-496) (cos (-> obj axial-slop))) + ((< (vector-dot (the-as vector (-> s4-0 vector)) sv-496) (cos (-> this axial-slop))) (vector-cross! sv-496 sv-496 (the-as vector (-> s4-0 vector))) (vector-cross! sv-496 (the-as vector (-> s4-0 vector)) sv-496) (vector-normalize! sv-496 1.0) (set! sv-464 (-> s4-0 vector)) (set! sv-448 (-> s4-0 vector)) - (let ((f0-20 (cos (-> obj axial-slop)))) + (let ((f0-20 (cos (-> this axial-slop)))) (.lvf vf1 (&-> sv-448 0 quad)) (let ((v1-107 f0-20)) (.mov vf2 v1-107) @@ -311,7 +311,7 @@ (.svf (&-> sv-464 0 quad) vf1) (set! sv-512 (-> s4-0 vector)) (set! sv-480 (-> s4-0 vector)) - (let ((f0-22 (sin (-> obj axial-slop)))) + (let ((f0-22 (sin (-> this axial-slop)))) (.lvf vf2 (&-> sv-496 quad)) (.lvf vf1 (&-> sv-480 0 quad)) (let ((v1-113 f0-22)) @@ -345,13 +345,13 @@ ) ) -(defmethod relocate chain-physics ((obj chain-physics) (arg0 int)) - (dotimes (v1-0 (the-as int (-> obj num-joints))) - (if (nonzero? (-> obj chain-joints v1-0 joint-mod)) - (&+! (-> obj chain-joints v1-0 joint-mod) arg0) +(defmethod relocate chain-physics ((this chain-physics) (arg0 int)) + (dotimes (v1-0 (the-as int (-> this num-joints))) + (if (nonzero? (-> this chain-joints v1-0 joint-mod)) + (&+! (-> this chain-joints v1-0 joint-mod) arg0) ) ) - obj + this ) (defun chain-physics-initialize ((arg0 process-drawable) (arg1 chain-physics) (arg2 int) (arg3 float) (arg4 (array chain-physics-setup))) diff --git a/goal_src/jak2/engine/physics/dynamics-h.gc b/goal_src/jak2/engine/physics/dynamics-h.gc index 048cec7d7e..408d82d12d 100644 --- a/goal_src/jak2/engine/physics/dynamics-h.gc +++ b/goal_src/jak2/engine/physics/dynamics-h.gc @@ -24,9 +24,10 @@ ) ) -(defmethod set-gravity-length dynamics ((obj dynamics) (arg0 float)) - (set! (-> obj gravity-length) arg0) - (vector-float*! (-> obj gravity) (-> obj gravity-normal) arg0) + +(defmethod set-gravity-length dynamics ((this dynamics) (arg0 float)) + (set! (-> this gravity-length) arg0) + (vector-float*! (-> this gravity) (-> this gravity-normal) arg0) 0 (none) ) diff --git a/goal_src/jak2/engine/physics/rigid-body-h.gc b/goal_src/jak2/engine/physics/rigid-body-h.gc index d465fcf1b8..e1424150c4 100644 --- a/goal_src/jak2/engine/physics/rigid-body-h.gc +++ b/goal_src/jak2/engine/physics/rigid-body-h.gc @@ -229,86 +229,86 @@ ) -(defmethod rigid-body-control-method-9 rigid-body-control ((obj rigid-body-control) (arg0 collide-shape-moving) (arg1 float)) - (rigid-body-method-9 (-> obj state) arg0 arg1) +(defmethod rigid-body-control-method-9 rigid-body-control ((this rigid-body-control) (arg0 collide-shape-moving) (arg1 float)) + (rigid-body-method-9 (-> this state) arg0 arg1) (none) ) ;; WARN: Return type mismatch none vs object. -(defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) - (rigid-body-method-10 (-> obj state)) +(defmethod rigid-body-control-method-10 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) + (rigid-body-method-10 (-> this state)) ) -(defmethod rigid-body-control-method-11 rigid-body-control ((obj rigid-body-control) (arg0 collide-shape-moving)) - (rigid-body-method-11 (-> obj state) arg0) +(defmethod rigid-body-control-method-11 rigid-body-control ((this rigid-body-control) (arg0 collide-shape-moving)) + (rigid-body-method-11 (-> this state) arg0) (none) ) -(defmethod rigid-body-control-method-12 rigid-body-control ((obj rigid-body-control) (arg0 float)) - (rigid-body-method-12 (-> obj state) arg0) +(defmethod rigid-body-control-method-12 rigid-body-control ((this rigid-body-control) (arg0 float)) + (rigid-body-method-12 (-> this state) arg0) (none) ) -(defmethod rigid-body-control-method-13 rigid-body-control ((obj rigid-body-control)) - (rigid-body-method-13 (-> obj state)) +(defmethod rigid-body-control-method-13 rigid-body-control ((this rigid-body-control)) + (rigid-body-method-13 (-> this state)) (none) ) -(defmethod rigid-body-control-method-14 rigid-body-control ((obj rigid-body-control) (arg0 float)) - (rigid-body-method-14 (-> obj state) arg0) +(defmethod rigid-body-control-method-14 rigid-body-control ((this rigid-body-control) (arg0 float)) + (rigid-body-method-14 (-> this state) arg0) (none) ) -(defmethod clear-force-torque! rigid-body-control ((obj rigid-body-control)) - (clear-force-torque! (-> obj state)) +(defmethod clear-force-torque! rigid-body-control ((this rigid-body-control)) + (clear-force-torque! (-> this state)) (none) ) -(defmethod clear-momentum! rigid-body-control ((obj rigid-body-control)) - (clear-momentum! (-> obj state)) +(defmethod clear-momentum! rigid-body-control ((this rigid-body-control)) + (clear-momentum! (-> this state)) (none) ) -(defmethod rigid-body-control-method-17 rigid-body-control ((obj rigid-body-control) (arg0 vector) (arg1 vector)) - (rigid-body-method-18 (-> obj state) arg0 arg1) +(defmethod rigid-body-control-method-17 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) + (rigid-body-method-18 (-> this state) arg0 arg1) (none) ) -(defmethod rigid-body-control-method-18 rigid-body-control ((obj rigid-body-control) (arg0 vector) (arg1 vector)) - (rigid-body-method-19 (-> obj state) arg0 arg1) +(defmethod rigid-body-control-method-18 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) + (rigid-body-method-19 (-> this state) arg0 arg1) (none) ) -(defmethod rigid-body-control-method-19 rigid-body-control ((obj rigid-body-control) (arg0 vector)) - (rigid-body-method-20 (-> obj state) arg0) +(defmethod rigid-body-control-method-19 rigid-body-control ((this rigid-body-control) (arg0 vector)) + (rigid-body-method-20 (-> this state) arg0) (none) ) -(defmethod rigid-body-control-method-20 rigid-body-control ((obj rigid-body-control) (arg0 vector) (arg1 vector) (arg2 float)) - (rigid-body-method-21 (-> obj state) arg0 arg1 arg2) +(defmethod rigid-body-control-method-20 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector) (arg2 float)) + (rigid-body-method-21 (-> this state) arg0 arg1 arg2) (none) ) -(defmethod rigid-body-control-method-21 rigid-body-control ((obj rigid-body-control) (arg0 vector) (arg1 vector)) - (rigid-body-method-22 (-> obj state) arg0 arg1) +(defmethod rigid-body-control-method-21 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) + (rigid-body-method-22 (-> this state) arg0 arg1) ) -(defmethod rigid-body-control-method-22 rigid-body-control ((obj rigid-body-control) (arg0 vector)) - (rigid-body-method-23 (-> obj state) arg0) +(defmethod rigid-body-control-method-22 rigid-body-control ((this rigid-body-control) (arg0 vector)) + (rigid-body-method-23 (-> this state) arg0) ) -(defmethod rigid-body-control-method-23 rigid-body-control ((obj rigid-body-control)) - (rigid-body-method-24 (-> obj state)) +(defmethod rigid-body-control-method-23 rigid-body-control ((this rigid-body-control)) + (rigid-body-method-24 (-> this state)) (none) ) -(defmethod rigid-body-control-method-24 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 basic)) - (rigid-body-method-25 (-> obj state) arg0 arg1 arg2 (the-as function arg3)) +(defmethod rigid-body-control-method-24 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 basic)) + (rigid-body-method-25 (-> this state) arg0 arg1 arg2 (the-as function arg3)) (none) ) -(defmethod rigid-body-control-method-25 rigid-body-control ((obj rigid-body-control) (arg0 vector) (arg1 quaternion)) - (rigid-body-method-26 (-> obj state) arg0 arg1) +(defmethod rigid-body-control-method-25 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 quaternion)) + (rigid-body-method-26 (-> this state) arg0 arg1) (none) ) diff --git a/goal_src/jak2/engine/physics/rigid-body-queue.gc b/goal_src/jak2/engine/physics/rigid-body-queue.gc index d7b31a5b60..982b572d70 100644 --- a/goal_src/jak2/engine/physics/rigid-body-queue.gc +++ b/goal_src/jak2/engine/physics/rigid-body-queue.gc @@ -7,23 +7,23 @@ ;; DECOMP BEGINS -(defmethod rigid-body-queue-method-9 rigid-body-queue ((obj rigid-body-queue)) - (set! (-> obj count) 0) +(defmethod rigid-body-queue-method-9 rigid-body-queue ((this rigid-body-queue)) + (set! (-> this count) 0) (dotimes (v1-0 128) - (set! (-> obj array v1-0) (the-as handle #f)) + (set! (-> this array v1-0) (the-as handle #f)) ) 0 (none) ) -(defmethod validate rigid-body-queue ((obj rigid-body-queue)) +(defmethod validate rigid-body-queue ((this rigid-body-queue)) (let ((gp-0 0)) - (dotimes (v1-0 (-> obj count)) - (let ((a1-2 (-> obj array v1-0)) + (dotimes (v1-0 (-> this count)) + (let ((a1-2 (-> this array v1-0)) (a2-0 (+ v1-0 1)) ) - (while (< a2-0 (-> obj count)) - (if (= a1-2 (-> obj array a2-0)) + (while (< a2-0 (-> this count)) + (if (= a1-2 (-> this array a2-0)) (+! gp-0 1) ) (+! a2-0 1) @@ -37,16 +37,16 @@ ) ) -(defmethod rigid-body-queue-method-10 rigid-body-queue ((obj rigid-body-queue)) +(defmethod rigid-body-queue-method-10 rigid-body-queue ((this rigid-body-queue)) (local-vars (s4-0 process)) (with-pp (let ((f0-0 (seconds-per-frame)) - (v1-1 (-> obj count)) + (v1-1 (-> this count)) ) (b! #t cfg-9 :delay (nop!)) (label cfg-1) (+! v1-1 -1) - (let ((a0-4 (handle->process (-> obj array v1-1)))) + (let ((a0-4 (handle->process (-> this array v1-1)))) (cond (a0-4 (let ((a0-6 (-> (the-as rigid-body-object a0-4) rbody))) @@ -65,9 +65,9 @@ ) (let ((s5-0 0)) (b! #t cfg-35 :delay (nop!)) - (until (= (-> obj array s5-0) (process->handle s4-0)) + (until (= (-> this array s5-0) (process->handle s4-0)) (label cfg-11) - (set! s4-0 (handle->process (-> obj array s5-0))) + (set! s4-0 (handle->process (-> this array s5-0))) (b! (not s4-0) cfg-34 :delay (empty-form)) (let ((s3-0 (-> (the-as rigid-body-object s4-0) rbody))) (b! @@ -84,19 +84,19 @@ (b! (not a2-2) cfg-34 :delay (empty-form)) (b! (not #t) cfg-34 :delay (empty-form)) (logior! (-> a2-2 rbody state flags) (rigid-body-flag blocker)) - (rigid-body-queue-method-13 obj s5-0 a2-2) + (rigid-body-queue-method-13 this s5-0 a2-2) ) ) ) (label cfg-34) (+! s5-0 1) (label cfg-35) - (b! (< s5-0 (-> obj count)) cfg-11) + (b! (< s5-0 (-> this count)) cfg-11) ) (let ((s5-1 0)) (b! #t cfg-48 :delay (nop!)) (label cfg-37) - (let ((a0-20 (handle->process (-> obj array s5-1)))) + (let ((a0-20 (handle->process (-> this array s5-1)))) (when (and a0-20 (logtest? (-> (the-as rigid-body-object a0-20) rbody state flags) (rigid-body-flag enable-physics)) ) @@ -109,72 +109,72 @@ ) (+! s5-1 1) (label cfg-48) - (b! (< s5-1 (-> obj count)) cfg-37) + (b! (< s5-1 (-> this count)) cfg-37) ) 0 (none) ) ) -(defmethod rigid-body-queue-method-11 rigid-body-queue ((obj rigid-body-queue) (arg0 rigid-body-object)) +(defmethod rigid-body-queue-method-11 rigid-body-queue ((this rigid-body-queue) (arg0 rigid-body-object)) (let ((v1-0 -1)) (let ((a2-0 0)) (b! #t cfg-9 :delay (nop!)) (label cfg-1) - (b! (handle->process (-> obj array a2-0)) cfg-8 :delay (empty-form)) + (b! (handle->process (-> this array a2-0)) cfg-8 :delay (empty-form)) (set! v1-0 a2-0) (b! #t cfg-11 :delay (nop!)) (label cfg-8) (+! a2-0 1) (label cfg-9) - (b! (< a2-0 (-> obj count)) cfg-1) + (b! (< a2-0 (-> this count)) cfg-1) ) (label cfg-11) (b! (= v1-0 -1) cfg-18 :delay (nop!)) - (set! (-> obj array v1-0) (process->handle arg0)) + (set! (-> this array v1-0) (process->handle arg0)) ) (b! #t cfg-25 :delay (nop!)) (label cfg-18) - (b! (>= (-> obj count) 128) cfg-25 :delay #f) - (set! (-> obj array (-> obj count)) (process->handle arg0)) - (+! (-> obj count) 1) + (b! (>= (-> this count) 128) cfg-25 :delay #f) + (set! (-> this array (-> this count)) (process->handle arg0)) + (+! (-> this count) 1) (label cfg-25) 0 0 (none) ) -(defmethod rigid-body-queue-method-12 rigid-body-queue ((obj rigid-body-queue) (arg0 int) (arg1 int)) +(defmethod rigid-body-queue-method-12 rigid-body-queue ((this rigid-body-queue) (arg0 int) (arg1 int)) (when (< arg0 arg1) (let ((v1-1 arg1) (a3-0 (+ arg1 -1)) - (a2-3 (-> obj array arg1)) + (a2-3 (-> this array arg1)) ) (while (>= a3-0 arg0) - (set! (-> obj array v1-1) (-> obj array a3-0)) + (set! (-> this array v1-1) (-> this array a3-0)) (+! a3-0 -1) (+! v1-1 -1) ) - (set! (-> obj array arg0) a2-3) + (set! (-> this array arg0) a2-3) ) ) 0 (none) ) -(defmethod rigid-body-queue-method-13 rigid-body-queue ((obj rigid-body-queue) (arg0 int) (arg1 rigid-body-object)) +(defmethod rigid-body-queue-method-13 rigid-body-queue ((this rigid-body-queue) (arg0 int) (arg1 rigid-body-object)) (let ((v1-2 (process->handle arg1)) (a2-4 (+ arg0 1)) ) (b! #t cfg-9 :delay (nop!)) (label cfg-6) - (b! (!= (-> obj array a2-4) v1-2) cfg-8 :delay (empty-form)) - (rigid-body-queue-method-12 obj arg0 a2-4) + (b! (!= (-> this array a2-4) v1-2) cfg-8 :delay (empty-form)) + (rigid-body-queue-method-12 this arg0 a2-4) (b! #t cfg-11 :delay (nop!)) (label cfg-8) (+! a2-4 1) (label cfg-9) - (b! (< a2-4 (-> obj count)) cfg-6) + (b! (< a2-4 (-> this count)) cfg-6) ) (label cfg-11) 0 @@ -182,34 +182,34 @@ (none) ) -(defmethod rigid-body-queue-method-14 rigid-body-queue ((obj rigid-body-queue) (arg0 int)) +(defmethod rigid-body-queue-method-14 rigid-body-queue ((this rigid-body-queue) (arg0 int)) (let ((v1-0 arg0) (a1-1 (+ arg0 1)) ) - (while (< a1-1 (-> obj count)) - (set! (-> obj array v1-0) (-> obj array a1-1)) + (while (< a1-1 (-> this count)) + (set! (-> this array v1-0) (-> this array a1-1)) (+! a1-1 1) (+! v1-0 1) ) ) - (+! (-> obj count) -1) + (+! (-> this count) -1) 0 (none) ) -(defmethod rigid-body-queue-method-15 rigid-body-queue ((obj rigid-body-queue) (arg0 rigid-body-object)) +(defmethod rigid-body-queue-method-15 rigid-body-queue ((this rigid-body-queue) (arg0 rigid-body-object)) (let ((v1-2 (process->handle arg0)) (a1-4 0) ) (b! #t cfg-9 :delay (nop!)) (label cfg-6) - (b! (!= (-> obj array a1-4) v1-2) cfg-8 :delay (empty-form)) - (rigid-body-queue-method-14 obj a1-4) + (b! (!= (-> this array a1-4) v1-2) cfg-8 :delay (empty-form)) + (rigid-body-queue-method-14 this a1-4) (b! #t cfg-11 :delay (nop!)) (label cfg-8) (+! a1-4 1) (label cfg-9) - (b! (< a1-4 (-> obj count)) cfg-6) + (b! (< a1-4 (-> this count)) cfg-6) ) (label cfg-11) 0 diff --git a/goal_src/jak2/engine/physics/rigid-body.gc b/goal_src/jak2/engine/physics/rigid-body.gc index b4d01db07d..060eb42b6f 100644 --- a/goal_src/jak2/engine/physics/rigid-body.gc +++ b/goal_src/jak2/engine/physics/rigid-body.gc @@ -51,109 +51,109 @@ ) ) -(defmethod relocate rigid-body-control ((obj rigid-body-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate rigid-body-control ((this rigid-body-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) -(defmethod rigid-body-info-method-9 rigid-body-info ((obj rigid-body-info)) - (let ((f24-0 (-> obj mass)) - (f28-0 (-> obj inertial-tensor-box 0)) - (f30-0 (-> obj inertial-tensor-box 1)) - (f26-0 (-> obj inertial-tensor-box 2)) +(defmethod rigid-body-info-method-9 rigid-body-info ((this rigid-body-info)) + (let ((f24-0 (-> this mass)) + (f28-0 (-> this inertial-tensor-box 0)) + (f30-0 (-> this inertial-tensor-box 1)) + (f26-0 (-> this inertial-tensor-box 2)) ) (let ((f0-0 f24-0)) - (set! (-> obj inv-mass) (/ 1.0 f0-0)) + (set! (-> this inv-mass) (/ 1.0 f0-0)) ) - (matrix-identity! (-> obj inertial-tensor)) - (matrix-identity! (-> obj inv-inertial-tensor)) + (matrix-identity! (-> this inertial-tensor)) + (matrix-identity! (-> this inv-inertial-tensor)) (let ((f0-4 (* 0.083333336 f24-0))) (let* ((f1-1 f30-0) (f1-3 (* f1-1 f1-1)) (f2-0 f26-0) ) - (set! (-> obj inertial-tensor vector 0 x) (* f0-4 (+ f1-3 (* f2-0 f2-0)))) + (set! (-> this inertial-tensor vector 0 x) (* f0-4 (+ f1-3 (* f2-0 f2-0)))) ) (let ((f1-6 f28-0)) - (set! (-> obj inertial-tensor vector 1 y) (* f0-4 (+ (* f1-6 f1-6) (* f26-0 f26-0)))) + (set! (-> this inertial-tensor vector 1 y) (* f0-4 (+ (* f1-6 f1-6) (* f26-0 f26-0)))) ) - (set! (-> obj inertial-tensor vector 2 z) (* f0-4 (+ (* f28-0 f28-0) (* f30-0 f30-0)))) + (set! (-> this inertial-tensor vector 2 z) (* f0-4 (+ (* f28-0 f28-0) (* f30-0 f30-0)))) ) ) - (let ((f0-6 (-> obj inertial-tensor vector 0 x))) - (set! (-> obj inv-inertial-tensor vector 0 x) (/ 1.0 f0-6)) + (let ((f0-6 (-> this inertial-tensor vector 0 x))) + (set! (-> this inv-inertial-tensor vector 0 x) (/ 1.0 f0-6)) ) - (let ((f0-9 (-> obj inertial-tensor vector 1 y))) - (set! (-> obj inv-inertial-tensor vector 1 y) (/ 1.0 f0-9)) + (let ((f0-9 (-> this inertial-tensor vector 1 y))) + (set! (-> this inv-inertial-tensor vector 1 y) (/ 1.0 f0-9)) ) - (let ((f0-12 (-> obj inertial-tensor vector 2 z))) - (set! (-> obj inv-inertial-tensor vector 2 z) (/ 1.0 f0-12)) + (let ((f0-12 (-> this inertial-tensor vector 2 z))) + (set! (-> this inv-inertial-tensor vector 2 z) (/ 1.0 f0-12)) ) 0 (none) ) -(defmethod clear-force-torque! rigid-body ((obj rigid-body)) - (set! (-> obj force quad) (the-as uint128 0)) - (set! (-> obj torque quad) (the-as uint128 0)) +(defmethod clear-force-torque! rigid-body ((this rigid-body)) + (set! (-> this force quad) (the-as uint128 0)) + (set! (-> this torque quad) (the-as uint128 0)) 0 (none) ) -(defmethod clear-momentum! rigid-body ((obj rigid-body)) - (set! (-> obj lin-momentum quad) (the-as uint128 0)) - (set! (-> obj ang-momentum quad) (the-as uint128 0)) +(defmethod clear-momentum! rigid-body ((this rigid-body)) + (set! (-> this lin-momentum quad) (the-as uint128 0)) + (set! (-> this ang-momentum quad) (the-as uint128 0)) 0 (none) ) -(defmethod rigid-body-method-24 rigid-body ((obj rigid-body)) +(defmethod rigid-body-method-24 rigid-body ((this rigid-body)) (when #t - (quaternion->matrix (-> obj matrix) (-> obj rotation)) + (quaternion->matrix (-> this matrix) (-> this rotation)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-rotate*! s5-0 (-> obj info cm-offset-joint) (-> obj matrix)) - (vector-! (-> obj matrix trans) (-> obj position) s5-0) + (vector-rotate*! s5-0 (-> this info cm-offset-joint) (-> this matrix)) + (vector-! (-> this matrix trans) (-> this position) s5-0) ) ) 0 (none) ) -(defmethod rigid-body-method-26 rigid-body ((obj rigid-body) (arg0 vector) (arg1 quaternion)) +(defmethod rigid-body-method-26 rigid-body ((this rigid-body) (arg0 vector) (arg1 quaternion)) (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 8))) (quaternion->matrix (the-as matrix (-> s3-0 1)) arg1) - (vector-rotate*! (-> s3-0 0) (-> obj info cm-offset-joint) (the-as matrix (-> s3-0 1))) - (vector+! (-> obj position) arg0 (-> s3-0 0)) + (vector-rotate*! (-> s3-0 0) (-> this info cm-offset-joint) (the-as matrix (-> s3-0 1))) + (vector+! (-> this position) arg0 (-> s3-0 0)) ) - (quaternion-copy! (-> obj rotation) arg1) - (quaternion-normalize! (-> obj rotation)) - (rigid-body-method-24 obj) + (quaternion-copy! (-> this rotation) arg1) + (quaternion-normalize! (-> this rotation)) + (rigid-body-method-24 this) 0 (none) ) -(defmethod rigid-body-method-25 rigid-body ((obj rigid-body) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 function)) - (set! (-> obj work) *rigid-body-work*) - (set! (-> obj info) arg0) - (set! (-> obj force-callback) (the-as (function object float none) arg3)) - (rigid-body-info-method-9 (-> obj info)) - (let ((v1-3 obj)) +(defmethod rigid-body-method-25 rigid-body ((this rigid-body) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 function)) + (set! (-> this work) *rigid-body-work*) + (set! (-> this info) arg0) + (set! (-> this force-callback) (the-as (function object float none) arg3)) + (rigid-body-info-method-9 (-> this info)) + (let ((v1-3 this)) (set! (-> v1-3 force quad) (the-as uint128 0)) (set! (-> v1-3 torque quad) (the-as uint128 0)) ) 0 - (clear-momentum! obj) - (rigid-body-method-26 obj arg1 arg2) - (rigid-body-method-13 obj) + (clear-momentum! this) + (rigid-body-method-26 this arg1 arg2) + (rigid-body-method-13 this) 0 (none) ) -(defmethod rigid-body-method-22 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) - (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj position)))) - (vector-cross! arg1 (-> obj ang-velocity) v1-1) +(defmethod rigid-body-method-22 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position)))) + (vector-cross! arg1 (-> this ang-velocity) v1-1) ) - (vector+! arg1 arg1 (-> obj lin-velocity)) + (vector+! arg1 arg1 (-> this lin-velocity)) arg1 ) @@ -179,7 +179,7 @@ arg0 ) -(defmethod rigid-body-method-12 rigid-body ((obj rigid-body) (arg0 float)) +(defmethod rigid-body-method-12 rigid-body ((this rigid-body) (arg0 float)) (local-vars (v1-6 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -191,9 +191,9 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((a2-0 (-> obj lin-momentum))) - (let ((v1-0 (-> obj lin-momentum))) - (let ((a0-1 (-> obj force))) + (let ((a2-0 (-> this lin-momentum))) + (let ((v1-0 (-> this lin-momentum))) + (let ((a0-1 (-> this force))) (let ((a3-0 arg0)) (.mov vf7 a3-0) ) @@ -206,9 +206,9 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a2-0 quad) vf6) ) - (let ((a2-1 (-> obj ang-momentum))) - (let ((v1-1 (-> obj ang-momentum))) - (let ((a0-2 (-> obj torque))) + (let ((a2-1 (-> this ang-momentum))) + (let ((v1-1 (-> this ang-momentum))) + (let ((a0-2 (-> this torque))) (let ((a1-1 arg0)) (.mov vf7 a1-1) ) @@ -221,11 +221,11 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a2-1 quad) vf6) ) - (let* ((f0-3 (* 500000000.0 (-> obj info mass))) + (let* ((f0-3 (* 500000000.0 (-> this info mass))) (f1-1 f0-3) (f1-3 (* f1-1 f1-1)) ) - (.lvf vf1 (&-> (-> obj ang-momentum) quad)) + (.lvf vf1 (&-> (-> this ang-momentum) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -233,28 +233,28 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-6 vf1) (if (< f1-3 v1-6) - (vector-normalize! (-> obj ang-momentum) f0-3) + (vector-normalize! (-> this ang-momentum) f0-3) ) ) - (set! (-> obj force quad) (the-as uint128 0)) - (set! (-> obj torque quad) (the-as uint128 0)) + (set! (-> this force quad) (the-as uint128 0)) + (set! (-> this torque quad) (the-as uint128 0)) 0 0 (none) ) ) -(defmethod rigid-body-method-13 rigid-body ((obj rigid-body)) - (let ((v1-0 (-> obj info))) - (vector-float*! (-> obj lin-velocity) (-> obj lin-momentum) (-> v1-0 inv-mass)) - (matrix-3x3-triple-transpose-product (-> obj inv-i-world) (-> obj matrix) (-> v1-0 inv-inertial-tensor)) +(defmethod rigid-body-method-13 rigid-body ((this rigid-body)) + (let ((v1-0 (-> this info))) + (vector-float*! (-> this lin-velocity) (-> this lin-momentum) (-> v1-0 inv-mass)) + (matrix-3x3-triple-transpose-product (-> this inv-i-world) (-> this matrix) (-> v1-0 inv-inertial-tensor)) ) - (vector-rotate*! (-> obj ang-velocity) (-> obj ang-momentum) (-> obj inv-i-world)) + (vector-rotate*! (-> this ang-velocity) (-> this ang-momentum) (-> this inv-i-world)) 0 (none) ) -(defmethod rigid-body-method-14 rigid-body ((obj rigid-body) (arg0 float)) +(defmethod rigid-body-method-14 rigid-body ((this rigid-body) (arg0 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -263,9 +263,9 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((a1-1 (-> obj position))) - (let ((v1-0 (-> obj position))) - (let ((a0-1 (-> obj lin-velocity))) + (let ((a1-1 (-> this position))) + (let ((v1-0 (-> this position))) + (let ((a0-1 (-> this lin-velocity))) (let ((a2-0 arg0)) (.mov vf7 a2-0) ) @@ -279,17 +279,17 @@ (.svf (&-> a1-1 quad) vf6) ) (let ((s4-0 (new 'stack-no-clear 'quaternion))) - (set! (-> (the-as vector (&-> s4-0 x)) quad) (-> obj ang-velocity quad)) + (set! (-> (the-as vector (&-> s4-0 x)) quad) (-> this ang-velocity quad)) (set! (-> s4-0 w) 0.0) - (quaternion*! s4-0 s4-0 (-> obj rotation)) + (quaternion*! s4-0 s4-0 (-> this rotation)) (quaternion-float*! s4-0 s4-0 0.5) - (+! (-> obj rotation x) (* (-> s4-0 x) arg0)) - (+! (-> obj rotation y) (* (-> s4-0 y) arg0)) - (+! (-> obj rotation z) (* (-> s4-0 z) arg0)) - (+! (-> obj rotation w) (* (-> s4-0 w) arg0)) + (+! (-> this rotation x) (* (-> s4-0 x) arg0)) + (+! (-> this rotation y) (* (-> s4-0 y) arg0)) + (+! (-> this rotation z) (* (-> s4-0 z) arg0)) + (+! (-> this rotation w) (* (-> s4-0 w) arg0)) ) - (quaternion-normalize! (-> obj rotation)) - (rigid-body-method-24 obj) + (quaternion-normalize! (-> this rotation)) + (rigid-body-method-24 this) 0 (none) ) @@ -305,11 +305,11 @@ ) ) -(defmethod rigid-body-method-9 rigid-body ((obj rigid-body) (arg0 collide-shape-moving) (arg1 float)) - (rigid-body-method-12 obj arg1) - (let ((v1-2 (-> obj info))) - (let* ((a0-2 (-> obj lin-momentum)) - (a1-2 (-> obj lin-momentum)) +(defmethod rigid-body-method-9 rigid-body ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) + (rigid-body-method-12 this arg1) + (let ((v1-2 (-> this info))) + (let* ((a0-2 (-> this lin-momentum)) + (a1-2 (-> this lin-momentum)) (f3-0 (-> v1-2 linear-damping)) (f2-0 arg1) (f0-0 0.0) @@ -319,8 +319,8 @@ ) (vector-float*! a0-2 a1-2 (fmax f0-0 (+ f1-0 (* f2-1 (/ 1.0 f3-2))))) ) - (let* ((a0-4 (-> obj ang-momentum)) - (a1-3 (-> obj ang-momentum)) + (let* ((a0-4 (-> this ang-momentum)) + (a1-3 (-> this ang-momentum)) (f3-5 (-> v1-2 angular-damping)) (f2-3 arg1) (f0-3 0.0) @@ -331,16 +331,16 @@ (vector-float*! a0-4 a1-3 (fmax f0-3 (+ f1-2 (* f2-4 (/ 1.0 f3-7))))) ) ) - (rigid-body-method-13 obj) - (if (logtest? (-> obj flags) (rigid-body-flag enable-collision)) - (collide-shape-moving-method-63 arg0 obj arg1) - (rigid-body-method-14 obj arg1) + (rigid-body-method-13 this) + (if (logtest? (-> this flags) (rigid-body-flag enable-collision)) + (collide-shape-moving-method-63 arg0 this arg1) + (rigid-body-method-14 this arg1) ) 0 (none) ) -(defmethod collide-with-all-collide-cache-prims collide-shape-moving ((obj collide-shape-moving) (arg0 matrix) (arg1 collide-query)) +(defmethod collide-with-all-collide-cache-prims collide-shape-moving ((this collide-shape-moving) (arg0 matrix) (arg1 collide-query)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -354,7 +354,7 @@ ) (init-vf0-vector) (let ((s4-0 *collide-cache*) - (s3-0 (-> obj root-prim)) + (s3-0 (-> this root-prim)) (s2-0 1) ) (b! (nonzero? (-> s3-0 prim-core prim-type)) cfg-2 :delay (empty-form)) @@ -440,7 +440,7 @@ ) ) -(defmethod collide-shape-moving-method-63 collide-shape-moving ((obj collide-shape-moving) (arg0 rigid-body) (arg1 float)) +(defmethod collide-shape-moving-method-63 collide-shape-moving ((this collide-shape-moving) (arg0 rigid-body) (arg1 float)) (local-vars (s3-0 rigid-body)) (with-pp (rlet ((acc :class vf) @@ -456,7 +456,7 @@ (set! (-> s5-0 dt) arg1) (set! (-> s5-0 float-1) 1.0) (set! (-> s5-0 cnt) 0) - (until (not (and (< 0.05 (-> s5-0 float-1)) (< (-> s5-0 cnt) (the-as int (-> obj max-iteration-count))))) + (until (not (and (< 0.05 (-> s5-0 float-1)) (< (-> s5-0 cnt) (the-as int (-> this max-iteration-count))))) (set! (-> s5-0 cquery best-dist) -100000000.0) (set! (-> s5-0 cquery best-my-prim) #f) (set! (-> s5-0 cquery num-spheres) (the-as uint #f)) @@ -467,13 +467,13 @@ (set! (-> arg0 position quad) (-> s5-0 vec-1 quad)) (quaternion-copy! (-> arg0 rotation) (-> s5-0 quat-1)) (rigid-body-method-24 arg0) - (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) - (collide-with-all-collide-cache-prims obj (-> s5-0 mat-1) (-> s5-0 cquery)) + (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) + (collide-with-all-collide-cache-prims this (-> s5-0 mat-1) (-> s5-0 cquery)) (let ((f30-0 (-> s5-0 cquery best-dist))) (b! (>= f30-0 0.0) cfg-3 :delay #f) (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt))) (rigid-body-method-13 arg0) - (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) (set! (-> s5-0 float-1) 0.0) (b! #t cfg-44 :delay (nop!)) (label cfg-3) @@ -481,7 +481,7 @@ (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt) f30-0)) ) (rigid-body-method-13 arg0) - (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) (mem-copy! (the-as pointer (-> s5-0 mat-1)) (the-as pointer (-> arg0 matrix)) 64) (set! s3-0 (the-as rigid-body #f)) (b! (not (-> s5-0 cquery num-spheres)) cfg-12 :delay (empty-form)) @@ -592,7 +592,7 @@ ) ) (set! (-> s5-0 rbody) s3-0) - (send-event (-> obj process) 'impact-impulse :from v1-103 (-> s5-0 vec-2)) + (send-event (-> this process) 'impact-impulse :from v1-103 (-> s5-0 vec-2)) ) (b! (not s3-0) cfg-32 :delay (empty-form)) (rigid-body-method-12 s3-0 1.0) @@ -602,7 +602,7 @@ (vector-float*! (-> s5-0 vec-5) (-> s5-0 vec-5) -1.0) (vector-float*! (-> s5-0 vec-3) (-> s5-0 vec-3) -1.0) (set! (-> s5-0 rbody) arg0) - (send-event (-> s2-0 process) 'impact-impulse :from (-> obj process) (-> s5-0 vec-2)) + (send-event (-> s2-0 process) 'impact-impulse :from (-> this process) (-> s5-0 vec-2)) ) (label cfg-32) (+! (-> s5-0 cnt) 1) @@ -622,7 +622,7 @@ (when (< 0.0 (-> s5-0 float-1)) (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt))) (rigid-body-method-13 arg0) - (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) (set! (-> s5-0 float-1) 0.0) ) (label cfg-44) @@ -636,7 +636,7 @@ ) ) -(defmethod rigid-body-method-15 rigid-body ((obj rigid-body) (arg0 collide-shape-moving) (arg1 float)) +(defmethod rigid-body-method-15 rigid-body ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) (local-vars (sv-576 vector) (sv-624 vector) @@ -655,13 +655,13 @@ (vf7 :class vf) ) (init-vf0-vector) - (-> obj work) - (let ((s4-0 (-> obj info)) + (-> this work) + (let ((s4-0 (-> this info)) (s3-0 (new 'stack-no-clear 'collide-query)) (f30-0 1.0) (s2-0 0) ) - (set! (-> s3-0 start-pos quad) (-> obj position quad)) + (set! (-> s3-0 start-pos quad) (-> this position quad)) (let ((v1-3 s3-0)) (set! (-> v1-3 radius) (-> arg0 root-prim prim-core world-sphere w)) (set! (-> v1-3 collide-with) (-> arg0 root-prim prim-core collide-with)) @@ -671,41 +671,41 @@ (set! (-> v1-3 action-mask) (collide-action solid)) ) (until (>= s2-0 4) - (vector-float*! (-> s3-0 move-dist) (-> obj lin-velocity) (* f30-0 arg1)) + (vector-float*! (-> s3-0 move-dist) (-> this lin-velocity) (* f30-0 arg1)) (let ((f28-0 (probe-using-line-sphere *collide-cache* s3-0))) (b! (>= f28-0 0.0) cfg-3) - (rigid-body-method-14 obj (* f30-0 arg1)) + (rigid-body-method-14 this (* f30-0 arg1)) (b! #t cfg-9 :delay (nop!)) (label cfg-3) - (rigid-body-method-14 obj (* f30-0 arg1 f28-0)) + (rigid-body-method-14 this (* f30-0 arg1 f28-0)) (set! sv-576 (new 'stack-no-clear 'vector)) (set! sv-624 (new 'stack-no-clear 'vector)) (set! sv-628 (new 'stack-no-clear 'vector)) - (vector-! sv-576 (-> obj position) (-> s3-0 best-other-tri intersect)) + (vector-! sv-576 (-> this position) (-> s3-0 best-other-tri intersect)) (vector-normalize! sv-576 1.0) - (set! sv-632 (vector-dot sv-576 (-> obj lin-momentum))) + (set! sv-632 (vector-dot sv-576 (-> this lin-momentum))) (when (< sv-632 0.0) (vector-float*! sv-624 sv-576 sv-632) - (vector-! sv-628 (-> obj lin-momentum) sv-624) + (vector-! sv-628 (-> this lin-momentum) sv-624) (vector-float*! sv-628 sv-628 (- 1.0 (-> s4-0 friction-factor))) (vector-float*! sv-624 sv-624 (- (-> s4-0 bounce-factor))) - (vector+! (-> obj lin-momentum) sv-628 sv-624) - (vector-float*! (-> obj lin-velocity) (-> obj lin-momentum) (-> s4-0 inv-mass)) + (vector+! (-> this lin-momentum) sv-628 sv-624) + (vector-float*! (-> this lin-velocity) (-> this lin-momentum) (-> s4-0 inv-mass)) ) (b! (>= f28-0 0.0001) cfg-7 :delay #f) - (vector+float*! (-> obj position) (-> obj position) sv-576 409.6) + (vector+float*! (-> this position) (-> this position) sv-576 409.6) (label cfg-7) (set! sv-704 (new 'stack-no-clear 'vector)) (set! sv-708 (new 'stack-no-clear 'vector)) (set! sv-712 (new 'stack-no-clear 'vector)) (set! sv-716 (new 'stack-no-clear 'vector)) - (vector-! sv-704 (-> s3-0 best-other-tri intersect) (-> obj position)) - (rigid-body-method-22 obj (-> s3-0 best-other-tri intersect) sv-708) + (vector-! sv-704 (-> s3-0 best-other-tri intersect) (-> this position)) + (rigid-body-method-22 this (-> s3-0 best-other-tri intersect) sv-708) (vector+float*! sv-708 sv-708 sv-576 (- (vector-dot sv-708 sv-576))) (vector-float*! sv-712 sv-708 (* -1.0 (-> s4-0 mass) (-> s4-0 friction-factor))) (vector-cross! sv-716 sv-704 sv-712) - (let ((a1-20 (-> obj ang-momentum))) - (let ((v1-46 (-> obj ang-momentum))) + (let ((a1-20 (-> this ang-momentum))) + (let ((v1-46 (-> this ang-momentum))) (let ((a0-27 sv-716)) (let ((a2-6 1.0)) (.mov vf7 a2-6) @@ -719,7 +719,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-20 quad) vf6) ) - (vector-rotate*! (-> obj ang-velocity) (-> obj ang-momentum) (-> obj inv-i-world)) + (vector-rotate*! (-> this ang-velocity) (-> this ang-momentum) (-> this inv-i-world)) (set! f30-0 (* f30-0 (- 1.0 f28-0))) ) (+! s2-0 1) @@ -732,22 +732,22 @@ ) ) -(defmethod rigid-body-method-18 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) - (vector+! (-> obj force) (-> obj force) arg1) +(defmethod rigid-body-method-18 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) + (vector+! (-> this force) (-> this force) arg1) (let ((a3-1 (new 'stack-no-clear 'vector)) (v1-1 (new 'stack-no-clear 'vector)) ) - (vector-! a3-1 arg0 (-> obj position)) + (vector-! a3-1 arg0 (-> this position)) (vector-cross! v1-1 a3-1 arg1) - (vector+! (-> obj torque) (-> obj torque) v1-1) + (vector+! (-> this torque) (-> this torque) v1-1) ) 0 (none) ) -(defmethod rigid-body-method-21 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) - (vector+! (-> obj force) (-> obj force) arg1) - (let* ((t0-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj position))) +(defmethod rigid-body-method-21 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) + (vector+! (-> this force) (-> this force) arg1) + (let* ((t0-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (v1-3 (vector-cross! (new 'stack-no-clear 'vector) t0-2 arg1)) ) (let ((f0-0 (vector-length t0-2))) @@ -755,94 +755,106 @@ (vector-float*! v1-3 v1-3 (/ arg2 f0-0)) ) ) - (vector+! (-> obj torque) (-> obj torque) v1-3) + (vector+! (-> this torque) (-> this torque) v1-3) ) 0 (none) ) -(defmethod rigid-body-method-19 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-19 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (-> obj work) - (vector-rotate*! s4-0 arg1 (-> obj matrix)) - (vector-rotate*! s5-0 arg0 (-> obj matrix)) - (vector+! s5-0 s5-0 (-> obj position)) - (rigid-body-method-18 obj s5-0 s4-0) + (-> this work) + (vector-rotate*! s4-0 arg1 (-> this matrix)) + (vector-rotate*! s5-0 arg0 (-> this matrix)) + (vector+! s5-0 s5-0 (-> this position)) + (rigid-body-method-18 this s5-0 s4-0) ) 0 (none) ) -(defmethod rigid-body-method-20 rigid-body ((obj rigid-body) (arg0 vector)) - (vector+! (-> obj force) (-> obj force) arg0) +(defmethod rigid-body-method-20 rigid-body ((this rigid-body) (arg0 vector)) + (vector+! (-> this force) (-> this force) arg0) 0 (none) ) -(defmethod rigid-body-method-23 rigid-body ((obj rigid-body) (arg0 vector)) +(defmethod rigid-body-method-23 rigid-body ((this rigid-body) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-rotate*! gp-0 (-> obj info cm-offset-joint) (-> obj matrix)) - (vector-! arg0 (-> obj position) gp-0) + (vector-rotate*! gp-0 (-> this info cm-offset-joint) (-> this matrix)) + (vector-! arg0 (-> this position) gp-0) ) arg0 ) -(defmethod print-force-torque rigid-body ((obj rigid-body) (arg0 object)) - (format arg0 " force ~M ~M ~M" (-> obj force x) (-> obj force y) (-> obj force z)) - (format arg0 " torque ~M ~M ~M~%" (-> obj torque x) (-> obj torque y) (-> obj torque z)) +(defmethod print-force-torque rigid-body ((this rigid-body) (arg0 object)) + (format arg0 " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) + (format arg0 " torque ~M ~M ~M~%" (-> this torque x) (-> this torque y) (-> this torque z)) 0 (none) ) -(defmethod print-momentum rigid-body ((obj rigid-body) (arg0 object)) - (format arg0 " lin-mom ~M ~M ~M" (-> obj lin-momentum x) (-> obj lin-momentum y) (-> obj lin-momentum z)) - (format arg0 " ang-mom ~M ~M ~M~%" (-> obj ang-momentum x) (-> obj ang-momentum y) (-> obj ang-momentum z)) - 0 - (none) - ) - -(defmethod print-velocity rigid-body ((obj rigid-body) (arg0 object)) - (format arg0 " lin-vel ~M ~M ~M" (-> obj lin-velocity x) (-> obj lin-velocity y) (-> obj lin-velocity z)) - (format arg0 " ang-vel ~f ~f ~f~%" (-> obj ang-velocity x) (-> obj ang-velocity y) (-> obj ang-velocity z)) - 0 - (none) - ) - -(defmethod print-position-rotation rigid-body ((obj rigid-body) (arg0 object)) - (format arg0 " position ~M ~M ~M" (-> obj position x) (-> obj position y) (-> obj position z)) +(defmethod print-momentum rigid-body ((this rigid-body) (arg0 object)) + (format arg0 " lin-mom ~M ~M ~M" (-> this lin-momentum x) (-> this lin-momentum y) (-> this lin-momentum z)) (format arg0 - " rotation ~f ~f ~f ~f~%" - (-> obj rotation x) - (-> obj rotation y) - (-> obj rotation z) - (-> obj rotation w) + " ang-mom ~M ~M ~M~%" + (-> this ang-momentum x) + (-> this ang-momentum y) + (-> this ang-momentum z) ) 0 (none) ) -(defmethod print-physics rigid-body ((obj rigid-body) (arg0 object)) - (print-force-torque obj arg0) - (print-position-rotation obj arg0) - (print-momentum obj arg0) - (print-velocity obj arg0) +(defmethod print-velocity rigid-body ((this rigid-body) (arg0 object)) + (format arg0 " lin-vel ~M ~M ~M" (-> this lin-velocity x) (-> this lin-velocity y) (-> this lin-velocity z)) + (format + arg0 + " ang-vel ~f ~f ~f~%" + (-> this ang-velocity x) + (-> this ang-velocity y) + (-> this ang-velocity z) + ) + 0 + (none) + ) + +(defmethod print-position-rotation rigid-body ((this rigid-body) (arg0 object)) + (format arg0 " position ~M ~M ~M" (-> this position x) (-> this position y) (-> this position z)) + (format + arg0 + " rotation ~f ~f ~f ~f~%" + (-> this rotation x) + (-> this rotation y) + (-> this rotation z) + (-> this rotation w) + ) + 0 + (none) + ) + +(defmethod print-physics rigid-body ((this rigid-body) (arg0 object)) + (print-force-torque this arg0) + (print-position-rotation this arg0) + (print-momentum this arg0) + (print-velocity this arg0) 0 (none) ) ;; WARN: Return type mismatch int vs object. -(defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) +(defmethod rigid-body-control-method-10 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) (let* ((s4-1 (max 1 (min 4 (+ (the int (* 0.9999 (/ arg1 arg2))) 1)))) (f30-0 (/ arg1 (the float s4-1))) - (s3-0 (-> obj state force-callback)) + (s3-0 (-> this state force-callback)) ) (while (nonzero? s4-1) (+! s4-1 -1) (s3-0 arg0 f30-0) - (let ((v1-2 obj) + (let ((v1-2 this) (a1-2 (-> arg0 root)) (f0-4 f30-0) ) @@ -853,40 +865,40 @@ 0 ) -(defmethod rigid-body-method-11 rigid-body ((obj rigid-body) (arg0 collide-shape-moving)) - (quaternion-copy! (-> arg0 quat) (-> obj rotation)) - (rigid-body-method-23 obj (-> arg0 trans)) - (set! (-> arg0 transv quad) (-> obj lin-velocity quad)) +(defmethod rigid-body-method-11 rigid-body ((this rigid-body) (arg0 collide-shape-moving)) + (quaternion-copy! (-> arg0 quat) (-> this rotation)) + (rigid-body-method-23 this (-> arg0 trans)) + (set! (-> arg0 transv quad) (-> this lin-velocity quad)) 0 (none) ) -(defmethod get-inv-mass rigid-body-object ((obj rigid-body-object)) - (-> obj info info inv-mass) +(defmethod get-inv-mass rigid-body-object ((this rigid-body-object)) + (-> this info info inv-mass) ) -(defmethod rigid-body-object-method-35 rigid-body-object ((obj rigid-body-object)) - (let ((a0-1 (-> obj info name))) +(defmethod rigid-body-object-method-35 rigid-body-object ((this rigid-body-object)) + (let ((a0-1 (-> this info name))) (when (nonzero? a0-1) - (set! (-> obj info) (the-as rigid-body-object-constants (-> a0-1 value))) - (set! (-> obj rbody state info) (-> obj info info)) + (set! (-> this info) (the-as rigid-body-object-constants (-> a0-1 value))) + (set! (-> this rbody state info) (-> this info info)) ) ) - (rigid-body-info-method-9 (-> obj info info)) - (set! (-> obj rbody state force-callback) (method-of-object obj rigid-body-object-method-29)) + (rigid-body-info-method-9 (-> this info info)) + (set! (-> this rbody state force-callback) (method-of-object this rigid-body-object-method-29)) 0 (none) ) -(defmethod rigid-body-object-method-50 rigid-body-object ((obj rigid-body-object) (arg0 float)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force)) - (logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force)) - (vector-float*! (-> obj player-force) (-> obj player-force) (/ 1.0 arg0)) +(defmethod rigid-body-object-method-50 rigid-body-object ((this rigid-body-object) (arg0 float)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) + (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force)) + (vector-float*! (-> this player-force) (-> this player-force) (/ 1.0 arg0)) ) - (let ((v1-10 (-> obj rbody)) - (a1-1 (-> obj player-force-position)) - (a2-2 (-> obj player-force)) + (let ((v1-10 (-> this rbody)) + (a1-1 (-> this player-force-position)) + (a2-2 (-> this player-force)) ) (rigid-body-method-18 (-> v1-10 state) a1-1 a2-2) ) @@ -895,56 +907,61 @@ (none) ) -(defmethod rigid-body-object-method-29 rigid-body-object ((obj rigid-body-object) (arg0 float)) +(defmethod rigid-body-object-method-29 rigid-body-object ((this rigid-body-object) (arg0 float)) (let ((a1-1 (new 'stack-no-clear 'vector))) (vector-reset! a1-1) - (set! (-> a1-1 y) (* -1.0 (-> obj info extra gravity) (-> obj rbody state info mass))) - (rigid-body-method-20 (-> obj rbody state) a1-1) + (set! (-> a1-1 y) (* -1.0 (-> this info extra gravity) (-> this rbody state info mass))) + (rigid-body-method-20 (-> this rbody state) a1-1) ) 0 (none) ) -(defmethod rigid-body-object-method-30 rigid-body-object ((obj rigid-body-object)) - (rigid-body-control-method-10 (-> obj rbody) obj (seconds-per-frame) (-> obj max-time-step)) - (logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force)) +(defmethod rigid-body-object-method-30 rigid-body-object ((this rigid-body-object)) + (rigid-body-control-method-10 (-> this rbody) this (seconds-per-frame) (-> this max-time-step)) + (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) 0 (none) ) -(defmethod rigid-body-object-method-51 rigid-body-object ((obj rigid-body-object)) - (rigid-body-control-method-10 (-> obj rbody) obj (-> obj rbody state time-remaining) (-> obj max-time-step)) +(defmethod rigid-body-object-method-51 rigid-body-object ((this rigid-body-object)) + (rigid-body-control-method-10 + (-> this rbody) + this + (-> this rbody state time-remaining) + (-> this max-time-step) + ) 0 (none) ) -(defmethod rigid-body-object-method-52 rigid-body-object ((obj rigid-body-object)) - (logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force)) +(defmethod rigid-body-object-method-52 rigid-body-object ((this rigid-body-object)) + (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) 0 (none) ) -(defmethod rigid-body-object-method-34 rigid-body-object ((obj rigid-body-object)) - (go (method-of-object obj idle)) +(defmethod rigid-body-object-method-34 rigid-body-object ((this rigid-body-object)) + (go (method-of-object this idle)) 0 (none) ) -(defmethod alloc-and-init-rigid-body-control rigid-body-object ((obj rigid-body-object) (arg0 rigid-body-object-constants)) - (set! (-> obj info) arg0) - (set! (-> obj rbody) (new 'process 'rigid-body-control obj)) - (update-transforms (-> obj root)) +(defmethod alloc-and-init-rigid-body-control rigid-body-object ((this rigid-body-object) (arg0 rigid-body-object-constants)) + (set! (-> this info) arg0) + (set! (-> this rbody) (new 'process 'rigid-body-control this)) + (update-transforms (-> this root)) (rigid-body-method-25 - (-> obj rbody state) - (-> obj info info) - (-> obj root trans) - (-> obj root quat) - (method-of-object obj rigid-body-object-method-29) + (-> this rbody state) + (-> this info info) + (-> this root trans) + (-> this root quat) + (method-of-object this rigid-body-object-method-29) ) - (rigid-body-object-method-35 obj) - (set! (-> obj max-time-step) (-> arg0 extra max-time-step)) - (set! (-> obj root max-iteration-count) (the-as uint 4)) - (let ((v1-15 (-> obj skel root-channel 0))) + (rigid-body-object-method-35 this) + (set! (-> this max-time-step) (-> arg0 extra max-time-step)) + (set! (-> this root max-iteration-count) (the-as uint 4)) + (let ((v1-15 (-> this skel root-channel 0))) (set! (-> v1-15 num-func) num-func-identity) (set! (-> v1-15 frame-num) 0.0) ) @@ -952,8 +969,8 @@ (none) ) -(defmethod allocate-and-init-cshape rigid-body-object ((obj rigid-body-object)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod allocate-and-init-cshape rigid-body-object ((this rigid-body-object)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -974,7 +991,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1001,37 +1018,37 @@ ) ) -(defmethod init-skel-and-rigid-body rigid-body-object ((obj rigid-body-object)) - (alloc-and-init-rigid-body-control obj *rigid-body-object-constants*) +(defmethod init-skel-and-rigid-body rigid-body-object ((this rigid-body-object)) + (alloc-and-init-rigid-body-control this *rigid-body-object-constants*) 0 (none) ) -(defmethod init-from-entity! rigid-body-object ((obj rigid-body-object) (arg0 entity-actor)) +(defmethod init-from-entity! rigid-body-object ((this rigid-body-object) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (allocate-and-init-cshape obj) - (process-drawable-from-entity! obj arg0) - (init-skel-and-rigid-body obj) - (rigid-body-object-method-34 obj) + (allocate-and-init-cshape this) + (process-drawable-from-entity! this arg0) + (init-skel-and-rigid-body this) + (rigid-body-object-method-34 this) 0 (none) ) -(defmethod do-engine-sounds rigid-body-object ((obj rigid-body-object)) +(defmethod do-engine-sounds rigid-body-object ((this rigid-body-object)) 0 (none) ) -(defmethod rigid-body-object-method-37 rigid-body-object ((obj rigid-body-object)) - (rigid-body-object-method-30 obj) - (do-engine-sounds obj) - (let ((v1-4 (-> obj rbody)) - (a1-0 (-> obj root)) +(defmethod rigid-body-object-method-37 rigid-body-object ((this rigid-body-object)) + (rigid-body-object-method-30 this) + (do-engine-sounds this) + (let ((v1-4 (-> this rbody)) + (a1-0 (-> this root)) ) (rigid-body-method-11 (-> v1-4 state) a1-0) ) @@ -1040,19 +1057,19 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-40 rigid-body-object ((obj rigid-body-object)) - (logior! (-> obj flags) (rigid-body-object-flag enable-collision)) - (let ((v1-3 (-> obj root root-prim))) - (set! (-> v1-3 prim-core collide-as) (-> obj root backup-collide-as)) - (set! (-> v1-3 prim-core collide-with) (-> obj root backup-collide-with)) +(defmethod rigid-body-object-method-40 rigid-body-object ((this rigid-body-object)) + (logior! (-> this flags) (rigid-body-object-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> this root backup-collide-with)) ) 0 (none) ) -(defmethod rigid-body-object-method-41 rigid-body-object ((obj rigid-body-object)) - (logclear! (-> obj flags) (rigid-body-object-flag enable-collision)) - (let ((v1-3 (-> obj root root-prim))) +(defmethod rigid-body-object-method-41 rigid-body-object ((this rigid-body-object)) + (logclear! (-> this flags) (rigid-body-object-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) @@ -1061,60 +1078,60 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-38 rigid-body-object ((obj rigid-body-object)) - (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (rigid-body-method-26 (-> obj rbody state) (-> obj root trans) (-> obj root quat)) - (vector-float*! (-> obj rbody state lin-momentum) (-> obj root transv) (-> obj info info mass)) - (vector-reset! (-> obj rbody state ang-momentum)) +(defmethod rigid-body-object-method-38 rigid-body-object ((this rigid-body-object)) + (when (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) + (logior! (-> this rbody state flags) (rigid-body-flag enable-physics)) + (rigid-body-method-26 (-> this rbody state) (-> this root trans) (-> this root quat)) + (vector-float*! (-> this rbody state lin-momentum) (-> this root transv) (-> this info info mass)) + (vector-reset! (-> this rbody state ang-momentum)) ) 0 (none) ) -(defmethod rigid-body-object-method-39 rigid-body-object ((obj rigid-body-object)) - (logclear! (-> obj rbody state flags) (rigid-body-flag enable-physics)) +(defmethod rigid-body-object-method-39 rigid-body-object ((this rigid-body-object)) + (logclear! (-> this rbody state flags) (rigid-body-flag enable-physics)) 0 (none) ) -(defmethod rigid-body-object-method-42 rigid-body-object ((obj rigid-body-object)) - (logior! (-> obj flags) (rigid-body-object-flag disturbed)) - (set! (-> obj disturbed-time) (current-time)) - (if (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) - (rigid-body-object-method-38 obj) +(defmethod rigid-body-object-method-42 rigid-body-object ((this rigid-body-object)) + (logior! (-> this flags) (rigid-body-object-flag disturbed)) + (set-time! (-> this disturbed-time)) + (if (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) + (rigid-body-object-method-38 this) ) 0 (none) ) -(defmethod rigid-body-object-method-43 rigid-body-object ((obj rigid-body-object)) - (go (method-of-object obj active)) +(defmethod rigid-body-object-method-43 rigid-body-object ((this rigid-body-object)) + (go (method-of-object this active)) 0 (none) ) -(defmethod apply-damage rigid-body-object ((obj rigid-body-object) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage rigid-body-object ((this rigid-body-object) (arg0 float) (arg1 rigid-body-impact)) 0 (none) ) -(defmethod rigid-body-object-method-45 rigid-body-object ((obj rigid-body-object) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 rigid-body-object ((this rigid-body-object) (arg0 rigid-body-impact)) 0 (none) ) -(defmethod rigid-body-object-method-49 rigid-body-object ((obj rigid-body-object) (arg0 rigid-body-impact) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-49 rigid-body-object ((this rigid-body-object) (arg0 rigid-body-impact) (arg1 touching-shapes-entry)) (set! (-> arg0 rbody) #f) (set! (-> arg0 prim-id) (the-as uint 0)) (vector-reset! (-> arg0 normal)) (vector-reset! (-> arg0 velocity)) - (set! (-> arg0 point quad) (-> obj root trans quad)) + (set! (-> arg0 point quad) (-> this root trans quad)) (when arg1 (let ((s3-0 (-> arg1 head))) (when s3-0 - (get-intersect-point (-> arg0 point) s3-0 (-> obj root) arg1) - (let ((s5-1 (get-touched-prim s3-0 (-> obj root) arg1))) + (get-intersect-point (-> arg0 point) s3-0 (-> this root) arg1) + (let ((s5-1 (get-touched-prim s3-0 (-> this root) arg1))) (when s5-1 (set! (-> arg0 prim-id) (-> s5-1 prim-id)) (vector-! (-> arg0 normal) (-> arg0 point) (the-as vector (-> s5-1 prim-core))) @@ -1134,7 +1151,7 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-47 rigid-body-object ((obj rigid-body-object) +(defmethod rigid-body-object-method-47 rigid-body-object ((this rigid-body-object) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) @@ -1143,7 +1160,7 @@ This commonly includes things such as: (local-vars (f0-2 float)) (when arg2 (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact))) - (rigid-body-object-method-49 obj s5-0 arg2) + (rigid-body-object-method-49 this s5-0 arg2) (if (logtest? (attack-mask attacker-velocity) (-> arg1 mask)) (set! (-> s5-0 velocity quad) (-> arg1 attacker-velocity quad)) (vector-! (-> s5-0 velocity) (-> s5-0 point) (-> arg0 root trans)) @@ -1182,41 +1199,41 @@ This commonly includes things such as: ) ) ) - (set! (-> s5-0 impulse) (* f0-2 (-> obj info extra attack-force-scale))) - (apply-damage obj (* 0.667 f1-0) s5-0) + (set! (-> s5-0 impulse) (* f0-2 (-> this info extra attack-force-scale))) + (apply-damage this (* 0.667 f1-0) s5-0) ) - (rigid-body-object-method-42 obj) + (rigid-body-object-method-42 this) (let ((s4-1 (new 'stack-no-clear 'vector))) (set! (-> s4-1 quad) (-> s5-0 velocity quad)) (vector-normalize! s4-1 1.0) (vector-float*! s4-1 s4-1 (-> s5-0 impulse)) - (let ((v1-46 (-> obj rbody)) + (let ((v1-46 (-> this rbody)) (a1-6 (-> s5-0 point)) (a2-3 s4-1) ) (rigid-body-method-18 (-> v1-46 state) a1-6 a2-3) ) - (let ((v1-49 (-> obj rbody)) + (let ((v1-49 (-> this rbody)) (f0-7 1.0) ) (rigid-body-method-12 (-> v1-49 state) f0-7) ) - (rigid-body-method-13 (-> obj rbody state)) + (rigid-body-method-13 (-> this rbody state)) (when #t (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 point) *color-blue*) (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> s5-0 point) s4-1 (meters 0.00024414062) *color-blue*) ) ) - (rigid-body-object-method-45 obj s5-0) + (rigid-body-object-method-45 this s5-0) ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (rigid-body-object-method-43 obj) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (rigid-body-object-method-43 this) ) #t ) ) -(defmethod rigid-body-object-method-48 rigid-body-object ((obj rigid-body-object) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-48 rigid-body-object ((this rigid-body-object) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (v1-2 symbol)) (b! (not (logtest? (process-mask target crate enemy) (-> arg0 mask))) cfg-5 :likely-delay (set! v1-2 #t)) (b! (not (logtest? (-> arg0 mask) (process-mask target))) cfg-5 :likely-delay (set! v1-2 #f)) @@ -1227,10 +1244,10 @@ This commonly includes things such as: (s4-0 (new 'stack-no-clear 'vector)) (f30-0 (get-inv-mass arg0)) ) - (rigid-body-object-method-49 obj s5-0 arg1) + (rigid-body-object-method-49 this s5-0 arg1) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (let ((v1-14 (-> obj rbody)) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (let ((v1-14 (-> this rbody)) (a1-3 (-> s5-0 point)) (a2-2 (-> s5-0 velocity)) ) @@ -1238,7 +1255,7 @@ This commonly includes things such as: ) ) (else - (set! (-> s5-0 velocity quad) (-> obj root transv quad)) + (set! (-> s5-0 velocity quad) (-> this root transv quad)) ) ) (let ((v1-18 (-> arg0 root))) @@ -1247,24 +1264,24 @@ This commonly includes things such as: ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) (when (< f0-1 0.0) - (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info info inv-mass)))) + (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> this info info inv-mass)))) (vector+float*! s4-0 s4-0 (-> s5-0 normal) (* -3.1 f30-0 (-> s5-0 impulse))) (set! (-> s4-0 y) (fmax (* 49152.0 f30-0) (-> s4-0 y))) - (rigid-body-object-method-42 obj) + (rigid-body-object-method-42 this) (let ((a2-4 (new 'stack-no-clear 'vector))) (vector-float*! a2-4 (-> s5-0 normal) (-> s5-0 impulse)) - (let ((v1-31 (-> obj rbody)) + (let ((v1-31 (-> this rbody)) (a1-8 (-> s5-0 point)) ) (rigid-body-method-18 (-> v1-31 state) a1-8 a2-4) ) ) - (let ((v1-34 (-> obj rbody)) + (let ((v1-34 (-> this rbody)) (f0-10 1.0) ) (rigid-body-method-12 (-> v1-34 state) f0-10) ) - (rigid-body-method-13 (-> obj rbody state)) + (rigid-body-method-13 (-> this rbody state)) (when #f (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 point) *color-blue*) (add-debug-vector @@ -1276,9 +1293,9 @@ This commonly includes things such as: *color-blue* ) ) - (rigid-body-object-method-45 obj s5-0) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (rigid-body-object-method-43 obj) + (rigid-body-object-method-45 this s5-0) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (rigid-body-object-method-43 this) ) ) ) @@ -1287,21 +1304,21 @@ This commonly includes things such as: #t ) -(defmethod rigid-body-object-method-46 rigid-body-object ((obj rigid-body-object) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 rigid-body-object ((this rigid-body-object) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-impulse) (let ((s5-1 (-> arg3 param 0))) - (if (!= obj arg0) - (rigid-body-object-method-42 obj) + (if (!= this arg0) + (rigid-body-object-method-42 this) ) - (rigid-body-object-method-45 obj (the-as rigid-body-impact s5-1)) + (rigid-body-object-method-45 this (the-as rigid-body-impact s5-1)) ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (rigid-body-object-method-43 obj) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (rigid-body-object-method-43 this) ) ) (('touched) - (if (= obj *debug-actor*) + (if (= this *debug-actor*) (format *stdcon* "rigid-body-object got touched~%") ) (when (zero? (-> arg0 rbody)) @@ -1312,12 +1329,12 @@ This commonly includes things such as: ) (when s3-0 (when (logtest? (-> s3-0 mask) (process-mask target)) - (logior! (-> obj flags) (rigid-body-object-flag player-touching)) - (set! (-> obj player-touch-time) (current-time)) - (rigid-body-object-method-42 obj) + (logior! (-> this flags) (rigid-body-object-flag player-touching)) + (set-time! (-> this player-touch-time)) + (rigid-body-object-method-42 this) ) (if (not (logtest? (-> s3-0 mask) (process-mask target))) - (rigid-body-object-method-48 obj s3-0 (the-as touching-shapes-entry (-> arg3 param 0))) + (rigid-body-object-method-48 this s3-0 (the-as touching-shapes-entry (-> arg3 param 0))) ) ) ) @@ -1327,15 +1344,15 @@ This commonly includes things such as: (let ((s3-1 (the-as attack-info (-> arg3 param 1))) (t0-1 (get-penetrate-using-from-attack-event arg0 arg3)) ) - (when (!= (-> s3-1 id) (-> obj incoming-attack-id)) - (set! (-> obj incoming-attack-id) (-> s3-1 id)) - (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) t0-1) + (when (!= (-> s3-1 id) (-> this incoming-attack-id)) + (set! (-> this incoming-attack-id) (-> s3-1 id)) + (rigid-body-object-method-47 this arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) t0-1) ) ) ) (('edge-grabbed 'pilot-edge-grab) (let ((s5-2 (the-as object (-> arg3 param 0)))) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) + (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) (let ((a0-25 (if (type? arg0 process-focusable) (the-as process-focusable arg0) ) @@ -1343,16 +1360,16 @@ This commonly includes things such as: ) (when a0-25 (let ((f0-1 (/ 163840.0 (get-inv-mass a0-25)))) - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-edge-grabbing player-contact-force)) - (set! (-> obj player-force-position quad) (-> (the-as attack-info s5-2) attacker-velocity quad)) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (* -1.0 f0-1)) + (logior! (-> this flags) (rigid-body-object-flag player-touching player-edge-grabbing player-contact-force)) + (set! (-> this player-force-position quad) (-> (the-as attack-info s5-2) attacker-velocity quad)) + (vector-reset! (-> this player-force)) + (set! (-> this player-force y) (* -1.0 f0-1)) ) ) ) ) ) - (not (logtest? (-> obj focus-status) (focus-status dead inactive))) + (not (logtest? (-> this focus-status) (focus-status dead inactive))) ) (('ridden) (let ((v1-45 (the-as object (-> arg3 param 0)))) @@ -1367,14 +1384,14 @@ This commonly includes things such as: (logtest? (-> a0-34 mask) (process-mask target)) (not (logtest? (-> a0-34 focus-status) (focus-status on-water under-water))) ) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) - (set! (-> obj player-force-position quad) (-> a0-34 root trans quad)) - (vector-reset! (-> obj player-force)) + (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) + (logior! (-> this flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) + (set! (-> this player-force-position quad) (-> a0-34 root trans quad)) + (vector-reset! (-> this player-force)) (let ((f0-4 (/ 163840.0 (get-inv-mass a0-34))) (f1-1 1.0) ) - (set! (-> obj player-force y) (* -1.0 f0-4 f1-1)) + (set! (-> this player-force y) (* -1.0 f0-4 f1-1)) ) ) ) @@ -1390,20 +1407,20 @@ This commonly includes things such as: ) ) (when a0-38 - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-impulse-force)) - (set! (-> obj player-force-position quad) (-> a0-38 root trans quad)) + (logior! (-> this flags) (rigid-body-object-flag player-touching player-impulse-force)) + (set! (-> this player-force-position quad) (-> a0-38 root trans quad)) (let ((f30-2 (* 0.00012207031 (the-as float (-> arg3 param 1)))) (f0-9 (/ 163840.0 (get-inv-mass a0-38))) ) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (* -0.1 f0-9 f30-2)) + (vector-reset! (-> this player-force)) + (set! (-> this player-force y) (* -0.1 f0-9 f30-2)) ) ) ) ) ) (('enable-physics) - (rigid-body-object-method-42 obj) + (rigid-body-object-method-42 this) ) ) ) diff --git a/goal_src/jak2/engine/physics/trajectory.gc b/goal_src/jak2/engine/physics/trajectory.gc index 6953a853c6..ccc777b091 100644 --- a/goal_src/jak2/engine/physics/trajectory.gc +++ b/goal_src/jak2/engine/physics/trajectory.gc @@ -7,44 +7,44 @@ ;; DECOMP BEGINS -(defmethod compute-trans-at-time trajectory ((obj trajectory) (arg0 float) (arg1 vector)) - (vector+float*! arg1 (-> obj initial-position) (-> obj initial-velocity) arg0) - (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> obj gravity))) +(defmethod compute-trans-at-time trajectory ((this trajectory) (arg0 float) (arg1 vector)) + (vector+float*! arg1 (-> this initial-position) (-> this initial-velocity) arg0) + (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> this gravity))) arg1 ) -(defmethod compute-transv-at-time trajectory ((obj trajectory) (arg0 float) (arg1 vector)) - (set! (-> arg1 quad) (-> obj initial-velocity quad)) - (+! (-> arg1 y) (* arg0 (-> obj gravity))) +(defmethod compute-transv-at-time trajectory ((this trajectory) (arg0 float) (arg1 vector)) + (set! (-> arg1 quad) (-> this initial-velocity quad)) + (+! (-> arg1 y) (* arg0 (-> this gravity))) arg1 ) -(defmethod compute-time-until-apex trajectory ((obj trajectory)) - (/ (- (-> obj initial-velocity y)) (-> obj gravity)) +(defmethod compute-time-until-apex trajectory ((this trajectory)) + (/ (- (-> this initial-velocity y)) (-> this gravity)) ) -(defmethod setup-from-to-duration! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) - (set! (-> obj initial-position quad) (-> arg0 quad)) - (set! (-> obj gravity) arg3) - (set! (-> obj time) arg2) +(defmethod setup-from-to-duration! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + (set! (-> this initial-position quad) (-> arg0 quad)) + (set! (-> this gravity) arg3) + (set! (-> this time) arg2) (let ((f0-3 (/ (vector-vector-xz-distance arg1 arg0) arg2))) - (vector-! (-> obj initial-velocity) arg1 arg0) - (vector-xz-normalize! (-> obj initial-velocity) f0-3) + (vector-! (-> this initial-velocity) arg1 arg0) + (vector-xz-normalize! (-> this initial-velocity) f0-3) ) - (set! (-> obj initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* 0.5 arg2 (-> obj gravity)))) + (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* 0.5 arg2 (-> this gravity)))) 0 (none) ) -(defmethod setup-from-to-xz-vel! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-xz-vel! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let ((f0-1 (/ (vector-vector-xz-distance arg1 arg0) arg2))) - (setup-from-to-duration! obj arg0 arg1 f0-1 arg3) + (setup-from-to-duration! this arg0 arg1 f0-1 arg3) ) 0 (none) ) -(defmethod setup-from-to-y-vel! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-y-vel! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let* ((f0-0 arg2) (f1-3 (- (* f0-0 f0-0) (* 2.0 (- (-> arg0 y) (-> arg1 y)) arg3))) (f0-3 900.0) @@ -54,13 +54,13 @@ (set! f0-3 (fmax (/ (- (- arg2) f0-4) arg3) (/ (+ (- arg2) f0-4) arg3))) ) ) - (setup-from-to-duration! obj arg0 arg1 f0-3 arg3) + (setup-from-to-duration! this arg0 arg1 f0-3 arg3) ) 0 (none) ) -(defmethod setup-from-to-height! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let* ((f0-1 (+ arg2 (fmax (-> arg0 y) (-> arg1 y)))) (f1-4 (* 2.0 (- (-> arg0 y) f0-1) arg3)) (f0-4 4096.0) @@ -68,14 +68,14 @@ (if (< 0.0 f1-4) (set! f0-4 (sqrtf f1-4)) ) - (setup-from-to-y-vel! obj arg0 arg1 f0-4 arg3) + (setup-from-to-y-vel! this arg0 arg1 f0-4 arg3) ) 0 (none) ) ;; WARN: Function (method 16 trajectory) has a return type of none, but the expression builder found a return statement. -(defmethod setup-from-to-duration-and-height! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-duration-and-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let ((f0-1 (- (-> arg1 y) (-> arg0 y)))) (cond ((= f0-1 0.0) @@ -84,7 +84,7 @@ (f0-3 (* -8.0 arg3)) (f1-3 arg2) ) - (t9-0 obj arg0 arg1 v1-2 (/ f0-3 (* f1-3 f1-3))) + (t9-0 this arg0 arg1 v1-2 (/ f0-3 (* f1-3 f1-3))) ) (return 0) ) @@ -100,23 +100,23 @@ (f1-18 (/ (- 1.0 f1-14) (- arg2 (* arg2 (sqrtf f1-14))))) (f0-8 (* f0-6 (* f1-18 f1-18) arg3)) ) - (setup-from-to-duration! obj arg0 arg1 arg2 f0-8) + (setup-from-to-duration! this arg0 arg1 arg2 f0-8) ) ) 0 (none) ) -(defmethod debug-draw trajectory ((obj trajectory)) +(defmethod debug-draw trajectory ((this trajectory)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 10) ) - (set! (-> s4-0 quad) (-> obj initial-position quad)) + (set! (-> s4-0 quad) (-> this initial-position quad)) (dotimes (s2-0 s3-0) (set! (-> s5-0 quad) (-> s4-0 quad)) - (let ((f0-1 (* (-> obj time) (/ (+ 1.0 (the float s2-0)) (the float s3-0))))) - (compute-trans-at-time obj f0-1 s4-0) + (let ((f0-1 (* (-> this time) (/ (+ 1.0 (the float s2-0)) (the float s3-0))))) + (compute-trans-at-time this f0-1 s4-0) ) (add-debug-line #t @@ -133,42 +133,42 @@ (none) ) -(defmethod initialize impact-control ((obj impact-control) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) - (set! (-> obj start-time) (current-time)) - (set! (-> obj process) (the-as (pointer process-drawable) (process->ppointer arg0))) - (set! (-> obj joint) arg1) - (set! (-> obj radius) arg2) - (set! (-> obj collide-with) (logclear arg3 (collide-spec water))) - (set! (-> obj trans 0 quad) (the-as uint128 0)) - (set! (-> obj trans 1 quad) (the-as uint128 0)) - obj +(defmethod initialize impact-control ((this impact-control) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) + (set-time! (-> this start-time)) + (set! (-> this process) (the-as (pointer process-drawable) (process->ppointer arg0))) + (set! (-> this joint) arg1) + (set! (-> this radius) arg2) + (set! (-> this collide-with) (logclear arg3 (collide-spec water))) + (set! (-> this trans 0 quad) (the-as uint128 0)) + (set! (-> this trans 1 quad) (the-as uint128 0)) + this ) -(defmethod update-from-cspace impact-control ((obj impact-control)) - (when (>= (-> obj joint) 0) - (set! (-> obj trans 1 quad) (-> obj trans 0 quad)) - (vector<-cspace! (the-as vector (-> obj trans)) (-> obj process 0 node-list data (-> obj joint))) - (vector-! (-> obj dir) (the-as vector (-> obj trans)) (-> obj trans 1)) +(defmethod update-from-cspace impact-control ((this impact-control)) + (when (>= (-> this joint) 0) + (set! (-> this trans 1 quad) (-> this trans 0 quad)) + (vector<-cspace! (the-as vector (-> this trans)) (-> this process 0 node-list data (-> this joint))) + (vector-! (-> this dir) (the-as vector (-> this trans)) (-> this trans 1)) ) 0 (none) ) -(defmethod impact-control-method-11 impact-control ((obj impact-control) (arg0 collide-query) (arg1 process) (arg2 pat-surface)) - (set! (-> arg0 start-pos quad) (-> obj trans 1 quad)) - (set! (-> arg0 move-dist quad) (-> obj dir quad)) - (let ((v1-2 (ppointer->process (-> obj process))) +(defmethod impact-control-method-11 impact-control ((this impact-control) (arg0 collide-query) (arg1 process) (arg2 pat-surface)) + (set! (-> arg0 start-pos quad) (-> this trans 1 quad)) + (set! (-> arg0 move-dist quad) (-> this dir quad)) + (let ((v1-2 (ppointer->process (-> this process))) (a0-6 arg0) ) - (set! (-> a0-6 radius) (-> obj radius)) - (set! (-> a0-6 collide-with) (-> obj collide-with)) + (set! (-> a0-6 radius) (-> this radius)) + (set! (-> a0-6 collide-with) (-> this collide-with)) (set! (-> a0-6 ignore-process0) v1-2) (set! (-> a0-6 ignore-process1) #f) (set! (-> a0-6 ignore-pat) arg2) (set! (-> a0-6 action-mask) (collide-action solid)) ) (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* arg0))) - (when (and arg1 (>= f30-0 0.0) (>= 0.0 (vector-dot (-> arg0 best-other-tri normal) (-> obj dir)))) + (when (and arg1 (>= f30-0 0.0) (>= 0.0 (vector-dot (-> arg0 best-other-tri normal) (-> this dir)))) (let* ((s3-0 (new 'stack-no-clear 'touching-shapes-entry)) (s2-0 (-> arg0 best-other-tri collide-ptr)) (v1-12 (if (type? s2-0 collide-shape-prim) @@ -192,7 +192,7 @@ ) #f s3-0 - obj + this arg0 ) ) @@ -201,13 +201,13 @@ ) ) -(defmethod initialize point-tracker ((obj point-tracker) (arg0 vector) (arg1 vector)) - (set! (-> obj trans 0 quad) (-> arg0 quad)) - (set! (-> obj trans 1 quad) (-> arg1 quad)) - obj +(defmethod initialize point-tracker ((this point-tracker) (arg0 vector) (arg1 vector)) + (set! (-> this trans 0 quad) (-> arg0 quad)) + (set! (-> this trans 1 quad) (-> arg1 quad)) + this ) -(defmethod point-tracker-method-10 point-tracker ((obj point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-10 point-tracker ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (cond ((>= 0.0 arg3) (set! (-> arg0 quad) (-> arg1 quad)) @@ -224,9 +224,9 @@ arg0 ) -(defmethod point-tracker-method-11 point-tracker ((obj point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-11 point-tracker ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (with-pp - (let ((v1-1 (point-tracker-method-10 obj (new 'stack-no-clear 'vector) arg1 arg2 arg3))) + (let ((v1-1 (point-tracker-method-10 this (new 'stack-no-clear 'vector) arg1 arg2 arg3))) (vector-! arg0 v1-1 arg1) ) (vector-float*! arg0 arg0 (-> pp clock frames-per-second)) @@ -234,7 +234,7 @@ ) ) -(defmethod combo-tracker-method-13 combo-tracker ((obj combo-tracker) (arg0 handle) (arg1 vector) (arg2 float) (arg3 vector) (arg4 float)) +(defmethod combo-tracker-method-13 combo-tracker ((this combo-tracker) (arg0 handle) (arg1 vector) (arg2 float) (arg3 vector) (arg4 float)) (cond ((send-event (handle->process arg0) 'combo) (let ((gp-1 (handle->process arg0))) @@ -285,14 +285,14 @@ ) ) -(defmethod combo-tracker-method-12 combo-tracker ((obj combo-tracker) (arg0 vector) (arg1 vector) (arg2 process) (arg3 time-frame)) - (initialize obj arg0 arg1) - (set! (-> obj target) (process->handle arg2)) - (set! (-> obj move-start-time) arg3) - obj +(defmethod combo-tracker-method-12 combo-tracker ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 process) (arg3 time-frame)) + (initialize this arg0 arg1) + (set! (-> this target) (process->handle arg2)) + (set! (-> this move-start-time) arg3) + this ) -(defmethod point-tracker-method-11 combo-tracker ((obj combo-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-11 combo-tracker ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -300,14 +300,14 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((v1-1 (point-tracker-method-10 obj (new 'stack-no-clear 'vector) arg1 arg2 arg3))) + (let ((v1-1 (point-tracker-method-10 this (new 'stack-no-clear 'vector) arg1 arg2 arg3))) (vector-! arg0 v1-1 arg1) ) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer pp)) (set! (-> a1-4 num-params) 0) (set! (-> a1-4 message) 'nav-control) - (let* ((s3-0 (send-event-function (handle->process (-> obj target)) a1-4)) + (let* ((s3-0 (send-event-function (handle->process (-> this target)) a1-4)) (s4-1 (if (type? s3-0 nav-control) s3-0 ) @@ -398,7 +398,7 @@ ) ) -(defmethod cubic-curve-method-9 cubic-curve ((obj cubic-curve) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod cubic-curve-method-9 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -407,8 +407,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (set! (-> obj mat quad 0) (-> arg0 quad)) - (set! (-> obj mat vector 1 quad) (-> arg1 quad)) + (set! (-> this mat quad 0) (-> arg0 quad)) + (set! (-> this mat vector 1 quad) (-> arg1 quad)) (let ((v1-2 (new 'stack-no-clear 'trajectory))) (vector-! (-> v1-2 initial-velocity) arg2 arg0) (vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) 3.0) @@ -428,59 +428,59 @@ (.svf (&-> t1-7 quad) vf6) ) (vector-! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3) - (set! (-> obj mat vector 2 quad) (-> v1-2 initial-position quad)) + (set! (-> this mat vector 2 quad) (-> v1-2 initial-position quad)) (vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) -2.0) (vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg1) (vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3) - (set! (-> obj mat trans quad) (-> v1-2 initial-position quad)) + (set! (-> this mat trans quad) (-> v1-2 initial-position quad)) ) (dotimes (v1-5 4) - (set! (-> obj mat vector v1-5 w) 0.0) + (set! (-> this mat vector v1-5 w) 0.0) ) 0 (none) ) ) -(defmethod cubic-curve-method-10 cubic-curve ((obj cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-10 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (let ((f0-1 (* arg1 arg1))) (set-vector! (-> v1-0 initial-position) 1.0 arg1 f0-1 (* f0-1 arg1)) ) - (vector-matrix*! arg0 (-> v1-0 initial-position) (-> obj mat)) + (vector-matrix*! arg0 (-> v1-0 initial-position) (-> this mat)) ) (set! (-> arg0 w) 1.0) arg0 ) -(defmethod cubic-curve-method-11 cubic-curve ((obj cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-11 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (set-vector! (-> v1-0 initial-position) 0.0 1.0 (* 2.0 arg1) (* 3.0 arg1 arg1)) - (vector-matrix*! arg0 (-> v1-0 initial-position) (-> obj mat)) + (vector-matrix*! arg0 (-> v1-0 initial-position) (-> this mat)) ) (set! (-> arg0 w) 1.0) arg0 ) -(defmethod cubic-curve-method-12 cubic-curve ((obj cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-12 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (set-vector! (-> v1-0 initial-position) 0.0 0.0 2.0 (* 6.0 arg1)) - (vector-matrix*! arg0 (-> v1-0 initial-position) (-> obj mat)) + (vector-matrix*! arg0 (-> v1-0 initial-position) (-> this mat)) ) (set! (-> arg0 w) 1.0) arg0 ) -(defmethod debug-draw-curve cubic-curve ((obj cubic-curve)) +(defmethod debug-draw-curve cubic-curve ((this cubic-curve)) (let ((s5-0 (new 'stack-no-clear 'trajectory)) (s4-0 10) ) - (cubic-curve-method-10 obj (-> s5-0 initial-velocity) 0.0) + (cubic-curve-method-10 this (-> s5-0 initial-velocity) 0.0) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 initial-velocity) *color-red*) (dotimes (s3-0 s4-0) (set! (-> s5-0 initial-position quad) (-> s5-0 initial-velocity quad)) (let ((f0-2 (/ (+ 1.0 (the float s3-0)) (the float s4-0)))) - (cubic-curve-method-10 obj (-> s5-0 initial-velocity) f0-2) + (cubic-curve-method-10 this (-> s5-0 initial-velocity) f0-2) ) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 initial-velocity) *color-red*) (add-debug-line diff --git a/goal_src/jak2/engine/process-drawable/focus.gc b/goal_src/jak2/engine/process-drawable/focus.gc index 5ba5fbe957..7dca3d6886 100644 --- a/goal_src/jak2/engine/process-drawable/focus.gc +++ b/goal_src/jak2/engine/process-drawable/focus.gc @@ -24,14 +24,14 @@ ) -(defmethod reset-to-collide-spec focus ((obj focus) (arg0 collide-spec)) - (set! (-> obj collide-with) arg0) - (set! (-> obj handle) (the-as handle #f)) +(defmethod reset-to-collide-spec focus ((this focus) (arg0 collide-spec)) + (set! (-> this collide-with) arg0) + (set! (-> this handle) (the-as handle #f)) 0 (none) ) -(defmethod collide-check? focus ((obj focus) (arg0 process-focusable)) +(defmethod collide-check? focus ((this focus) (arg0 process-focusable)) (when (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead)))) (let* ((s5-0 (-> arg0 root)) (v1-2 (if (type? s5-0 collide-shape) @@ -39,20 +39,20 @@ ) ) ) - (and v1-2 (logtest? (-> obj collide-with) (-> v1-2 root-prim prim-core collide-as))) + (and v1-2 (logtest? (-> this collide-with) (-> v1-2 root-prim prim-core collide-as))) ) ) ) -(defmethod try-update-focus focus ((obj focus) (arg0 process-focusable)) - (when (!= (handle->process (-> obj handle)) arg0) - (set! (-> obj handle) (process->handle arg0)) +(defmethod try-update-focus focus ((this focus) (arg0 process-focusable)) + (when (!= (handle->process (-> this handle)) arg0) + (set! (-> this handle) (process->handle arg0)) #t ) ) -(defmethod clear-focused focus ((obj focus)) - (set! (-> obj handle) (the-as handle #f)) +(defmethod clear-focused focus ((this focus)) + (set! (-> this handle) (the-as handle #f)) 0 (none) ) diff --git a/goal_src/jak2/engine/process-drawable/process-drawable.gc b/goal_src/jak2/engine/process-drawable/process-drawable.gc index 249316b6ad..e6d69cb733 100644 --- a/goal_src/jak2/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak2/engine/process-drawable/process-drawable.gc @@ -23,12 +23,12 @@ #f ) -(defun-debug draw-bone-lines ((obj process-drawable)) +(defun-debug draw-bone-lines ((this process-drawable)) "Added in PC port to debug bones" - (dotimes (i (-> obj node-list length)) - (let ((parent (-> obj node-list data i parent))) + (dotimes (i (-> this node-list length)) + (let ((parent (-> this node-list data i parent))) (when (and parent (nonzero? parent) (-> parent joint) (-> parent parent)) - (let ((child (vector<-cspace! (new-stack-vector0) (-> obj node-list data i))) + (let ((child (vector<-cspace! (new-stack-vector0) (-> this node-list data i))) ) (add-debug-line #t (bucket-id debug2) child (vector<-cspace! (new-stack-vector0) parent) (new 'static 'rgba :g #xff :a #x40) #f (the rgba -1)) ) @@ -39,13 +39,13 @@ ;; DECOMP BEGINS -(defmethod add-to-loading-level skeleton-group ((obj skeleton-group)) +(defmethod add-to-loading-level skeleton-group ((this skeleton-group)) (let ((v1-1 (-> *level* loading-level))) (if v1-1 - (set-loaded-art (-> v1-1 art-group) obj) + (set-loaded-art (-> v1-1 art-group) this) ) ) - obj + this ) (defun cspace-by-name ((arg0 process-drawable) (arg1 string)) @@ -234,14 +234,14 @@ ) ) -(defmethod lod-set! draw-control ((obj draw-control) (arg0 int)) - (let ((v1-1 (max 0 (min arg0 (-> obj lod-set max-lod))))) - (set! (-> obj desired-lod) v1-1) - (when (!= (-> obj cur-lod) v1-1) - (set! (-> obj mgeo) (-> obj lod-set lod v1-1 geo)) - (set! (-> obj cur-lod) v1-1) - (if (nonzero? (-> obj seg-mask)) - (setup-masks obj 0 0) +(defmethod lod-set! draw-control ((this draw-control) (arg0 int)) + (let ((v1-1 (max 0 (min arg0 (-> this lod-set max-lod))))) + (set! (-> this desired-lod) v1-1) + (when (!= (-> this cur-lod) v1-1) + (set! (-> this mgeo) (-> this lod-set lod v1-1 geo)) + (set! (-> this cur-lod) v1-1) + (if (nonzero? (-> this seg-mask)) + (setup-masks this 0 0) ) ) ) @@ -249,36 +249,36 @@ (none) ) -(defmethod lods-assign! draw-control ((obj draw-control) (arg0 lod-set)) - (mem-copy! (the-as pointer (-> obj lod-set)) (the-as pointer arg0) 49) - (let ((a1-2 (min (-> obj cur-lod) (-> obj lod-set max-lod)))) - (set! (-> obj cur-lod) -1) - (lod-set! obj a1-2) +(defmethod lods-assign! draw-control ((this draw-control) (arg0 lod-set)) + (mem-copy! (the-as pointer (-> this lod-set)) (the-as pointer arg0) 49) + (let ((a1-2 (min (-> this cur-lod) (-> this lod-set max-lod)))) + (set! (-> this cur-lod) -1) + (lod-set! this a1-2) ) 0 (none) ) -(defmethod setup-masks draw-control ((obj draw-control) (arg0 int) (arg1 int)) +(defmethod setup-masks draw-control ((this draw-control) (arg0 int) (arg1 int)) "TODO - use the enum types" (local-vars (v1-4 int) (a2-1 (array uint64))) - (let ((a1-2 (logior (logclear (-> obj seg-mask) arg0) arg1))) - (set! (-> obj seg-mask) a1-2) + (let ((a1-2 (logior (logclear (-> this seg-mask) arg0) arg1))) + (set! (-> this seg-mask) a1-2) (cond ((zero? a1-2) - (set! (-> obj effect-mask) (the-as uint 0)) + (set! (-> this effect-mask) (the-as uint 0)) 0 ) - ((begin (set! a2-1 (-> obj mgeo seg-table)) (set! v1-4 0) (nonzero? a2-1)) + ((begin (set! a2-1 (-> this mgeo seg-table)) (set! v1-4 0) (nonzero? a2-1)) (countdown (a3-0 (-> a2-1 length)) (if (logtest? a1-2 (ash 1 a3-0)) (set! v1-4 (logior v1-4 (-> a2-1 a3-0))) ) ) - (set! (-> obj effect-mask) (the-as uint v1-4)) + (set! (-> this effect-mask) (the-as uint v1-4)) ) (else - (set! (-> obj effect-mask) (the-as uint 0)) + (set! (-> this effect-mask) (the-as uint 0)) 0 ) ) @@ -287,28 +287,28 @@ (none) ) -(defmethod setup-lods! lod-set ((obj lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) +(defmethod setup-lods! lod-set ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) (local-vars (sv-16 res-tag)) (let ((v1-0 (-> arg1 length)) (s3-0 (-> arg0 max-lod)) ) - (set! (-> obj max-lod) s3-0) + (set! (-> this max-lod) s3-0) (dotimes (a0-1 (+ s3-0 1)) (when (or (< (-> arg0 mgeo a0-1) 0) (>= (-> arg0 mgeo a0-1) v1-0)) - (set! obj (the-as lod-set #f)) + (set! this (the-as lod-set #f)) (goto cfg-22) ) (let ((a1-14 (-> arg1 data (-> arg0 mgeo a0-1)))) (when (or (zero? a1-14) (!= (-> a1-14 type) merc-ctrl)) - (set! obj (the-as lod-set #f)) + (set! this (the-as lod-set #f)) (goto cfg-22) ) - (set! (-> obj lod a0-1 geo) (the-as merc-ctrl a1-14)) + (set! (-> this lod a0-1 geo) (the-as merc-ctrl a1-14)) ) - (set! (-> obj lod a0-1 dist) (-> arg0 lod-dist a0-1)) + (set! (-> this lod a0-1 dist) (-> arg0 lod-dist a0-1)) ) - (if (= (-> obj lod s3-0 dist) 4095996000.0) - (set! (-> obj lod s3-0 dist) (res-lump-float arg2 'vis-dist :default 4095996000.0)) + (if (= (-> this lod s3-0 dist) 4095996000.0) + (set! (-> this lod s3-0 dist) (res-lump-float arg2 'vis-dist :default 4095996000.0)) ) ) (let ((v1-14 (-> arg1 data (-> arg0 jgeo)))) @@ -316,19 +316,19 @@ (let ((v1-15 (res-lump-data (-> v1-14 extra) 'lod-dist pointer :tag-ptr (& sv-16)))) (when v1-15 (dotimes (a0-6 (the-as int (-> sv-16 elt-count))) - (set! (-> obj lod a0-6 dist) (-> (the-as (pointer float) (&+ v1-15 (* a0-6 4))))) + (set! (-> this lod a0-6 dist) (-> (the-as (pointer float) (&+ v1-15 (* a0-6 4))))) ) ) ) ) (label cfg-22) - obj + this ) -(defmethod setup-cspace-and-add draw-control ((obj draw-control) (arg0 art-joint-geo) (arg1 symbol)) +(defmethod setup-cspace-and-add draw-control ((this draw-control) (arg0 art-joint-geo) (arg1 symbol)) (let ((s5-0 ((method-of-type cspace-array new) arg1 cspace-array (+ (-> arg0 length) 1)))) (let ((v0-1 ((method-of-type skeleton new) arg1 skeleton (+ (-> arg0 length) 1)))) - (set! (-> obj skeleton) v0-1) + (set! (-> this skeleton) v0-1) (let ((s3-1 v0-1)) (when (or (zero? s5-0) (zero? s3-1)) (go process-drawable-art-error "memory") @@ -340,7 +340,7 @@ ) (let ((v1-10 (-> s5-0 data))) (set! (-> v1-10 0 param0) (the-as (function cspace transformq none) cspace<-transformq!)) - (set! (-> v1-10 0 param1) (the-as basic (-> (the-as process-drawable (-> obj process)) root trans))) + (set! (-> v1-10 0 param1) (the-as basic (-> (the-as process-drawable (-> this process)) root trans))) ) (let ((v1-12 (reset-and-assign-geo! (-> s5-0 data 1) (the-as drawable #f)))) (set! (-> v1-12 joint) (-> arg0 data 0)) @@ -352,7 +352,7 @@ (set! (-> v1-14 bone) (-> s3-1 bones 2)) (set! (-> v1-14 parent) (the-as cspace (-> s5-0 data))) (set! (-> v1-14 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint!)) - (set! (-> v1-14 param1) (-> obj process)) + (set! (-> v1-14 param1) (-> this process)) ) (let ((s2-0 3)) (while (< s2-0 (-> s5-0 length)) @@ -373,7 +373,7 @@ ) ) ) - (add-connection *foreground-draw-engine* (-> obj process) add-process-drawable (-> obj process) obj #f) + (add-connection *foreground-draw-engine* (-> this process) add-process-drawable (-> this process) this #f) (label cfg-13) s5-0 ) @@ -396,27 +396,27 @@ 0 ) -(defmethod do-joint-math draw-control ((obj draw-control) (arg0 cspace-array) (arg1 joint-control)) +(defmethod do-joint-math draw-control ((this draw-control) (arg0 cspace-array) (arg1 joint-control)) (with-pp (cond - ((logtest? (-> obj status) (draw-control-status no-draw no-draw-temp)) + ((logtest? (-> this status) (draw-control-status no-draw no-draw-temp)) ) ((zero? arg1) (matrix<-transformq+trans! - (the-as matrix (-> obj skeleton bones 3)) - (the-as transformq (-> (the-as process-drawable (-> obj process)) root trans)) - (-> obj skeleton bones 0 transform trans) + (the-as matrix (-> this skeleton bones 3)) + (the-as transformq (-> (the-as process-drawable (-> this process)) root trans)) + (-> this skeleton bones 0 transform trans) ) - (vector+! (-> obj origin) (-> obj skeleton bones 3 transform trans) (-> obj bounds)) - (set! (-> obj origin w) (-> obj bounds w)) + (vector+! (-> this origin) (-> this skeleton bones 3 transform trans) (-> this bounds)) + (set! (-> this origin w) (-> this bounds w)) ) (else - (let* ((s2-0 (-> obj mgeo num-joints)) + (let* ((s2-0 (-> this mgeo num-joints)) (s1-0 (+ s2-0 2)) ) (+ s1-0 1) (let ((s5-0 pp)) - (set! pp (-> obj process)) + (set! pp (-> this process)) ;; og:preserve-this scratchpad ((-> arg1 generate-frame-function) (the-as joint-anim-frame (+ 2400 (scratchpad-object int))) s1-0 arg1) (if (-> arg1 prebind-function) @@ -457,15 +457,15 @@ ) ) (if (-> arg1 postbind-function) - ((-> arg1 postbind-function) obj arg0 arg1) + ((-> arg1 postbind-function) this arg0 arg1) ) (let ((a1-11 (new 'stack-no-clear 'vector))) - (set! (-> a1-11 quad) (-> obj bounds quad)) + (set! (-> a1-11 quad) (-> this bounds quad)) (set! (-> a1-11 w) 1.0) - (vector-matrix*! (-> obj origin) a1-11 (the-as matrix (-> obj skeleton bones (-> obj origin-joint-index)))) + (vector-matrix*! (-> this origin) a1-11 (the-as matrix (-> this skeleton bones (-> this origin-joint-index)))) ) - (let ((f0-2 (-> obj bounds w))) - (set! (-> obj origin w) f0-2) + (let ((f0-2 (-> this bounds w))) + (set! (-> this origin w) f0-2) f0-2 ) (set! pp s5-0) @@ -476,33 +476,33 @@ ;; og:preserve-this (#when PC_PORT (when *debug-segment* (if *display-bones* - (draw-bone-lines (the-as process-drawable (-> obj process)))) + (draw-bone-lines (the-as process-drawable (-> this process)))) (if *display-joint-names* - (draw-joint-spheres (the-as process-drawable (-> obj process)))) + (draw-joint-spheres (the-as process-drawable (-> this process)))) )) 0 (none) ) ) -(defmethod cleanup-for-death process-drawable ((obj process-drawable)) - (when (type? (-> obj root) collide-shape) - (let ((v1-2 (-> (the-as collide-shape (-> obj root)) root-prim))) +(defmethod cleanup-for-death process-drawable ((this process-drawable)) + (when (type? (-> this root) collide-shape) + (let ((v1-2 (-> (the-as collide-shape (-> this root)) root-prim))) (set! (-> v1-2 prim-core collide-as) (collide-spec)) (set! (-> v1-2 prim-core collide-with) (collide-spec)) ) 0 ) - (if (nonzero? (-> obj skel)) + (if (nonzero? (-> this skel)) (ja-channel-set! 0) ) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) 0 (none) ) -(defmethod relocate-nav process-drawable ((obj process-drawable) (arg0 int)) - (set! (-> obj nav) (the-as nav-control (&+ (the-as pointer (-> obj nav)) arg0))) +(defmethod relocate-nav process-drawable ((this process-drawable) (arg0 int)) + (set! (-> this nav) (the-as nav-control (&+ (the-as pointer (-> this nav)) arg0))) 0 (none) ) @@ -556,19 +556,19 @@ (none) ) -(defmethod deactivate process-drawable ((obj process-drawable)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate process-drawable ((this process-drawable)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - (let ((a0-3 (-> obj nav))) + (let ((a0-3 (-> this nav))) (if (and a0-3 (nonzero? a0-3)) (remove! a0-3) ) ) - (let* ((s5-0 (-> obj root)) + (let* ((s5-0 (-> this root)) (a0-5 (if (type? s5-0 collide-shape) s5-0 ) @@ -585,7 +585,7 @@ ) ) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -753,13 +753,13 @@ s2-0 ) -(defmethod initialize-skeleton process-drawable ((obj process-drawable) (arg0 skeleton-group) (arg1 pair)) +(defmethod initialize-skeleton process-drawable ((this process-drawable) (arg0 skeleton-group) (arg1 pair)) (local-vars (v1-14 art-element)) (if (not arg0) (go process-drawable-art-error "skel-group") ) - (set! (-> obj draw) (skeleton-group->draw-control obj arg0 (&-> obj node-list))) - (let* ((s3-0 (-> obj draw)) + (set! (-> this draw) (skeleton-group->draw-control this arg0 (&-> this node-list))) + (let* ((s3-0 (-> this draw)) (a2-3 (res-lump-value (-> s3-0 jgeo extra) 'joint-channel uint128 :default (the-as uint128 6) :time -1000000000.0) ) @@ -768,7 +768,7 @@ ((> (the-as int a2-3) 0) (logior! (-> s3-0 status) (draw-control-status math-skel)) (let ((v0-3 (new 'process 'joint-control (the-as int a2-3)))) - (set! (-> obj skel) v0-3) + (set! (-> this skel) v0-3) (let ((s4-0 v0-3)) (let ((s3-1 (-> s3-0 art-group))) (cond @@ -781,7 +781,7 @@ (return (the-as draw-control #f)) ) (ja-channel-set! 1) - (let ((s2-0 (-> obj skel root-channel 0))) + (let ((s2-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s2-0 (the-as art-joint-anim (-> s3-1 data (-> arg0 janim))) @@ -795,7 +795,7 @@ ) ) ) - (set! (-> s4-0 effect) (new 'process 'effect-control obj)) + (set! (-> s4-0 effect) (new 'process 'effect-control this)) ) ) ) @@ -816,36 +816,36 @@ ) ) ) - (let ((s5-3 (-> obj root))) + (let ((s5-3 (-> this root))) (if (and s5-3 (nonzero? s5-3) (type? s5-3 collide-shape)) (find-collision-meshes (the-as collide-shape s5-3)) ) ) - (-> obj draw) + (-> this draw) ) -(defmethod initialize-skeleton-by-name process-drawable ((obj process-drawable) (arg0 string)) +(defmethod initialize-skeleton-by-name process-drawable ((this process-drawable) (arg0 string)) (let* ((s4-0 *level*) (s3-0 (method-of-object s4-0 art-group-get-by-name)) ) (format (clear *temp-string*) "skel-~S" arg0) (let ((s4-1 (s3-0 s4-0 *temp-string* (the-as (pointer uint32) #f)))) (if (and (nonzero? s4-1) (valid? s4-1 skeleton-group (the-as string #f) #f 0)) - (initialize-skeleton obj (the-as skeleton-group s4-1) (the-as pair 0)) + (initialize-skeleton this (the-as skeleton-group s4-1) (the-as pair 0)) (go process-drawable-art-error arg0) ) ) ) - (-> obj draw) + (-> this draw) ) -(defmethod apply-alignment process-drawable ((obj process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment process-drawable ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (with-pp (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) - (let* ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat))) + (let* ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (s0-0 (matrix-transpose! (new 'stack-no-clear 'matrix) s3-0)) (s2-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> *standard-dynamics* gravity) s0-0)) - (a1-5 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj root transv) s0-0)) + (a1-5 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this root transv) s0-0)) ) (if (logtest? arg0 (align-opts no-gravity)) (set-vector! s2-0 0.0 0.0 0.0 1.0) @@ -873,13 +873,13 @@ (set! (-> a1-5 x) 0.0) ) ) - (vector-matrix*! (-> obj root transv) a1-5 s3-0) + (vector-matrix*! (-> this root transv) a1-5 s3-0) ) ) (if (logtest? arg0 (align-opts adjust-quat)) - (quaternion-normalize! (quaternion*! (-> obj root quat) (-> obj root quat) (-> arg1 quat))) + (quaternion-normalize! (quaternion*! (-> this root quat) (-> this root quat) (-> arg1 quat))) ) - (-> obj root) + (-> this root) ) ) @@ -1192,11 +1192,11 @@ 0 ) -(defmethod update-anim-data joint-control ((obj joint-control)) +(defmethod update-anim-data joint-control ((this joint-control)) (local-vars (s7-0 none) (ra-0 int)) - (let ((s5-0 (+ (-> obj active-channels) (-> obj float-channels)))) + (let ((s5-0 (+ (-> this active-channels) (-> this float-channels)))) (dotimes (s4-0 (the-as int s5-0)) - (let ((s3-0 (-> obj channel s4-0))) + (let ((s3-0 (-> this channel s4-0))) (case (-> s3-0 command) (((joint-control-command stack) (joint-control-command stack1)) ) @@ -1233,9 +1233,9 @@ ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod evaluate-joint-control process-drawable ((obj process-drawable)) +(defmethod evaluate-joint-control process-drawable ((this process-drawable)) (local-vars (s1-0 joint-control-channel) (s2-0 int) (s4-0 uint) (s7-0 none) (ra-0 int)) - (let ((gp-0 (-> obj skel))) + (let ((gp-0 (-> this skel))) (let ((a0-1 (-> gp-0 top-anim))) (b! (not a0-1) cfg-2 :delay (empty-form)) (update a0-1) @@ -1244,7 +1244,7 @@ (label cfg-2) (set! s4-0 (+ (-> gp-0 active-channels) (-> gp-0 float-channels))) (let ((s3-0 (current-time))) - (b! (logtest? (-> obj draw status) (draw-control-status no-draw)) cfg-45 :delay (empty-form)) + (b! (logtest? (-> this draw status) (draw-control-status no-draw)) cfg-45 :delay (empty-form)) (set! s2-0 0) (b! #t cfg-30 :delay (nop!)) (label cfg-4) @@ -1301,13 +1301,13 @@ (set! (-> gp-0 channel v1-56 frame-interp 1) (fmax 0.0 (fmin 1.0 (-> gp-0 channel v1-56 frame-interp 1)))) ) (if (or (zero? s4-0) (or (not (-> gp-0 root-channel 0 frame-group)) (zero? (-> gp-0 active-channels)))) - (logior! (-> obj draw status) (draw-control-status no-draw-temp)) + (logior! (-> this draw status) (draw-control-status no-draw-temp)) ) - (if (logtest? (-> obj skel status) (joint-control-status blend-shape blend-shape-valid)) - (merc-blend-shape obj) + (if (logtest? (-> this skel status) (joint-control-status blend-shape blend-shape-valid)) + (merc-blend-shape this) ) - (if (logtest? (-> obj skel status) (joint-control-status eye-anim-valid eye-anim)) - (merc-eye-anim obj) + (if (logtest? (-> this skel status) (joint-control-status eye-anim-valid eye-anim)) + (merc-eye-anim this) ) (label cfg-45) (let ((a0-26 (-> gp-0 effect))) @@ -1345,11 +1345,11 @@ (none) ) -(defmethod current-cycle-distance joint-control ((obj joint-control)) +(defmethod current-cycle-distance joint-control ((this joint-control)) (cond - ((< (the-as int (-> obj root-channel)) (the-as int (-> obj channel (-> obj active-channels)))) - (let ((s4-0 (-> obj root-channel (-> obj root-channel 0 group-size))) - (s3-0 (the-as joint-control-channel (-> obj root-channel))) + ((< (the-as int (-> this root-channel)) (the-as int (-> this channel (-> this active-channels)))) + (let ((s4-0 (-> this root-channel (-> this root-channel 0 group-size))) + (s3-0 (the-as joint-control-channel (-> this root-channel))) (s5-0 (the-as (pointer float) (new 'stack-no-clear 'vector))) ) (while (< (the-as int s3-0) (the-as int s4-0)) @@ -1359,10 +1359,10 @@ (set! s5-0 (&-> s5-0 1)) ) (((joint-control-command blend) (joint-control-command push1) (joint-control-command float)) - (set! (-> s5-0 -1) (lerp (-> s5-0 -1) (-> s3-0 dist) (-> s3-0 frame-interp (-> obj active-frame-interp)))) + (set! (-> s5-0 -1) (lerp (-> s5-0 -1) (-> s3-0 dist) (-> s3-0 frame-interp (-> this active-frame-interp)))) ) (((joint-control-command stack)) - (set! (-> s5-0 -2) (lerp (-> s5-0 -2) (-> s5-0 -1) (-> s3-0 frame-interp (-> obj active-frame-interp)))) + (set! (-> s5-0 -2) (lerp (-> s5-0 -2) (-> s5-0 -1) (-> s3-0 frame-interp (-> this active-frame-interp)))) (set! s5-0 (&-> s5-0 -1)) ) ) @@ -1391,8 +1391,8 @@ ) ;; WARN: Return type mismatch top-anim-joint-control vs none. -(defmethod reset top-anim-joint-control ((obj top-anim-joint-control)) - (let ((v0-0 obj)) +(defmethod reset top-anim-joint-control ((this top-anim-joint-control)) + (let ((v0-0 this)) (set! (-> v0-0 interp) 0.0) (set! (-> v0-0 frame-targ) #f) (set! (-> v0-0 frame-group) #f) @@ -1409,12 +1409,12 @@ (none) ) -(defmethod get-channel top-anim-joint-control ((obj top-anim-joint-control) (arg0 int)) +(defmethod get-channel top-anim-joint-control ((this top-anim-joint-control) (arg0 int)) (case arg0 ((1) - (case (-> obj process 0 skel float-channels) + (case (-> this process 0 skel float-channels) ((2) - (-> obj process 0 skel channel (-> obj process 0 skel active-channels)) + (-> this process 0 skel channel (-> this process 0 skel active-channels)) ) (else (the-as joint-control-channel #f) @@ -1422,12 +1422,12 @@ ) ) (else - (case (-> obj process 0 skel float-channels) + (case (-> this process 0 skel float-channels) ((1) - (-> obj process 0 skel channel (-> obj process 0 skel active-channels)) + (-> this process 0 skel channel (-> this process 0 skel active-channels)) ) ((2) - (-> obj process 0 skel channel (+ (-> obj process 0 skel active-channels) 1)) + (-> this process 0 skel channel (+ (-> this process 0 skel active-channels) 1)) ) (else (the-as joint-control-channel #f) @@ -1437,7 +1437,7 @@ ) ) -(defmethod push-anim-to-targ top-anim-joint-control ((obj top-anim-joint-control) +(defmethod push-anim-to-targ top-anim-joint-control ((this top-anim-joint-control) (arg0 art-joint-anim) (arg1 float) (arg2 int) @@ -1446,8 +1446,8 @@ (arg5 float) (arg6 symbol) ) - (when (!= (-> obj interp) 0.0) - (let ((v1-1 obj)) + (when (!= (-> this interp) 0.0) + (let ((v1-1 this)) (set! (-> v1-1 frame-targ) arg0) (set! (-> v1-1 frame-speed) arg4) (set! (-> v1-1 frame-start) (/ arg1 (-> arg0 artist-step))) @@ -1473,61 +1473,61 @@ (none) ) -(defmethod update top-anim-joint-control ((obj top-anim-joint-control)) +(defmethod update top-anim-joint-control ((this top-anim-joint-control)) (with-pp - (let* ((v1-0 (-> obj process)) + (let* ((v1-0 (-> this process)) (pp (if v1-0 (the-as process-drawable (-> v1-0 0 self)) ) ) - (s3-0 (get-channel obj 1)) - (s5-0 (get-channel obj 0)) - (s4-0 (-> obj base-anim)) + (s3-0 (get-channel this 1)) + (s5-0 (get-channel this 0)) + (s4-0 (-> this base-anim)) ) - (set! (-> obj frame-group-push) #f) + (set! (-> this frame-group-push) #f) (cond - ((= (-> obj interp) 0.0) + ((= (-> this interp) 0.0) (when s5-0 (seek! (-> s5-0 frame-interp 1) 0.0 (* 8.0 (seconds-per-frame))) (if s3-0 (set! (-> s3-0 frame-interp 1) (fmin (-> s3-0 frame-interp 1) (-> s5-0 frame-interp 1))) ) (when (= (-> s5-0 frame-interp 1) 0.0) - (set! (-> obj frame-post-put-away) #f) - (when (= (-> obj interp) 0.0) + (set! (-> this frame-post-put-away) #f) + (when (= (-> this interp) 0.0) (joint-channel-float-delete! s5-0) - (set! (-> obj frame-group) #f) - (set! (-> obj frame-num) 0.0) + (set! (-> this frame-group) #f) + (set! (-> this frame-num) 0.0) (set! (-> pp skel generate-frame-function) create-interpolated-joint-animation-frame) ) (when s3-0 (joint-channel-float-delete! s3-0) - (set! (-> obj frame-group-push) #f) + (set! (-> this frame-group-push) #f) ) ) ) ) (else (when (or (not s5-0) - (or (and (-> obj frame-targ) - (and (!= (-> obj frame-blend) 0.0) - (or (!= (-> s5-0 frame-group) (-> obj frame-targ)) (< (-> obj update-time) (-> obj frame-push-time))) + (or (and (-> this frame-targ) + (and (!= (-> this frame-blend) 0.0) + (or (!= (-> s5-0 frame-group) (-> this frame-targ)) (< (-> this update-time) (-> this frame-push-time))) ) ) - (and (not (-> obj frame-targ)) + (and (not (-> this frame-targ)) (!= (-> s5-0 frame-group) s4-0) - (set! (-> obj frame-blend) (-> obj frame-post-blend)) + (set! (-> this frame-blend) (-> this frame-post-blend)) ) ) ) (when s3-0 (joint-channel-float-delete! s3-0) - (set! (-> obj frame-group-push) #f) - (set! s5-0 (get-channel obj 0)) - (set! (-> s5-0 frame-interp 1) (-> obj interp)) + (set! (-> this frame-group-push) #f) + (set! s5-0 (get-channel this 0)) + (set! (-> s5-0 frame-interp 1) (-> this interp)) ) (set! (-> pp skel generate-frame-function) create-interpolated2-joint-animation-frame) - (let ((s2-0 (the-as basic (-> obj frame-targ)))) + (let ((s2-0 (the-as basic (-> this frame-targ)))) (set! s2-0 (cond ((the-as art-joint-anim s2-0) (empty) @@ -1540,7 +1540,7 @@ ) (set! s3-0 s5-0) (if s3-0 - (set! (-> obj frame-group-push) (-> s3-0 frame-group)) + (set! (-> this frame-group-push) (-> s3-0 frame-group)) ) (cond ((= s4-0 s2-0) @@ -1553,26 +1553,26 @@ ) ) (when s5-0 - (set! (-> s5-0 frame-num) (-> obj frame-start)) - (set! (-> obj base-anim-speed) 1.0) - (set! (-> obj base-anim-blend) 0.1333333) + (set! (-> s5-0 frame-num) (-> this frame-start)) + (set! (-> this base-anim-speed) 1.0) + (set! (-> this base-anim-blend) 0.1333333) ) ) - ((>= (-> obj frame-speed) 0.0) + ((>= (-> this frame-speed) 0.0) (let ((v1-35 (ja-channel-float! (the-as art-joint-anim s2-0) 0.0 0.0 0.0))) (set! s5-0 (when v1-35 (set! (-> v1-35 param 0) - (- (the float (+ (-> (the-as art-joint-anim s2-0) frames num-frames) -1)) (-> obj frame-post-end)) + (- (the float (+ (-> (the-as art-joint-anim s2-0) frames num-frames) -1)) (-> this frame-post-end)) ) - (set! (-> v1-35 param 1) (-> obj frame-speed)) + (set! (-> v1-35 param 1) (-> this frame-speed)) (set! (-> v1-35 num-func) num-func-seek!) v1-35 ) ) ) (if s5-0 - (set! (-> s5-0 frame-num) (-> obj frame-start)) + (set! (-> s5-0 frame-num) (-> this frame-start)) ) ) (else @@ -1580,36 +1580,36 @@ (let ((v1-39 (ja-channel-float! (the-as art-joint-anim s2-0) 0.0 0.0 0.0))) (set! s5-0 (when v1-39 (set! (-> v1-39 param 0) 0.0) - (set! (-> v1-39 param 1) (fabs (-> obj frame-speed))) + (set! (-> v1-39 param 1) (fabs (-> this frame-speed))) (set! (-> v1-39 num-func) num-func-seek!) v1-39 ) ) ) (when s5-0 - (set! (-> s5-0 frame-num) (- (the float (+ (-> s5-0 frame-group frames num-frames) -1)) (-> obj frame-start))) - (set! (-> obj base-anim-speed) 1.0) - (set! (-> obj base-anim-blend) 0.1333333) + (set! (-> s5-0 frame-num) (- (the float (+ (-> s5-0 frame-group frames num-frames) -1)) (-> this frame-start))) + (set! (-> this base-anim-speed) 1.0) + (set! (-> this base-anim-blend) 0.1333333) ) ) ) ) ) (when s5-0 - (set! (-> obj frame-group) (-> s5-0 frame-group)) - (set! (-> obj frame-num) (-> s5-0 frame-num)) - (set! (-> obj frame-cur-blend) (-> obj frame-blend)) + (set! (-> this frame-group) (-> s5-0 frame-group)) + (set! (-> this frame-num) (-> s5-0 frame-num)) + (set! (-> this frame-cur-blend) (-> this frame-blend)) ) ) (when s5-0 - (set! (-> pp skel interp-select 0) (the-as int (-> obj interp-select 0))) - (set! (-> pp skel interp-select 1) (the-as int (-> obj interp-select 1))) + (set! (-> pp skel interp-select 0) (the-as int (-> this interp-select 0))) + (set! (-> pp skel interp-select 1) (the-as int (-> this interp-select 1))) (let ((f0-35 (cond - ((not (-> obj frame-targ)) - (-> obj base-anim-blend) + ((not (-> this frame-targ)) + (-> this base-anim-blend) ) (s3-0 - (-> obj frame-cur-blend) + (-> this frame-cur-blend) ) (else 0.1333333 @@ -1618,24 +1618,24 @@ ) ) (if (= f0-35 0.0) - (set! (-> s5-0 frame-interp 1) (-> obj interp)) - (seek! (-> s5-0 frame-interp 1) (-> obj interp) (* f0-35 (-> pp clock time-adjust-ratio))) + (set! (-> s5-0 frame-interp 1) (-> this interp)) + (seek! (-> s5-0 frame-interp 1) (-> this interp) (* f0-35 (-> pp clock time-adjust-ratio))) ) ) (when s3-0 - (set! (-> obj frame-group-push) (-> s3-0 frame-group)) - (set! (-> s3-0 frame-interp 1) (-> obj interp)) + (set! (-> this frame-group-push) (-> s3-0 frame-group)) + (set! (-> s3-0 frame-interp 1) (-> this interp)) (if (!= (-> s3-0 eval-time) (current-time)) (joint-control-channel-eval s3-0) ) - (when (= (-> s5-0 frame-interp 1) (-> obj interp)) + (when (= (-> s5-0 frame-interp 1) (-> this interp)) (joint-channel-float-delete! s3-0) - (set! (-> obj frame-group-push) #f) - (set! s5-0 (get-channel obj 0)) - (set! (-> s5-0 frame-interp 1) (-> obj interp)) + (set! (-> this frame-group-push) #f) + (set! s5-0 (get-channel this 0)) + (set! (-> s5-0 frame-interp 1) (-> this interp)) ) ) - (let ((v1-70 (-> obj frame-targ))) + (let ((v1-70 (-> this frame-targ))) (cond (v1-70 (cond @@ -1644,14 +1644,14 @@ (joint-control-channel-eval s5-0) ) (when (= (-> s5-0 frame-num) (-> s5-0 param 0)) - (set! (-> obj frame-targ) #f) - (set! (-> obj frame-start) 0.0) + (set! (-> this frame-targ) #f) + (set! (-> this frame-start) 0.0) (cond - ((-> obj frame-post-put-away) - (set! (-> obj interp) 0.0) - (set! (-> obj frame-post-put-away) #f) + ((-> this frame-post-put-away) + (set! (-> this interp) 0.0) + (set! (-> this frame-post-put-away) #f) ) - ((!= (-> obj frame-post-blend) 0.0) + ((!= (-> this frame-post-blend) 0.0) (set! (-> s5-0 param 0) (the float (+ (-> s5-0 frame-group frames num-frames) -1))) ) (else @@ -1666,42 +1666,42 @@ (else (set! (-> s5-0 eval-time) (the-as uint (current-time))) (set! (-> s5-0 frame-group) v1-70) - (set! (-> s5-0 frame-num) (if (< (-> obj frame-speed) 0.0) - (- (the float (+ (-> v1-70 frames num-frames) -1)) (-> obj frame-start)) - (set! (-> s5-0 frame-num) (-> obj frame-start)) + (set! (-> s5-0 frame-num) (if (< (-> this frame-speed) 0.0) + (- (the float (+ (-> v1-70 frames num-frames) -1)) (-> this frame-start)) + (set! (-> s5-0 frame-num) (-> this frame-start)) ) ) (set! (-> s5-0 num-func) num-func-seek!) - (if (>= (-> obj frame-speed) 0.0) + (if (>= (-> this frame-speed) 0.0) (set! (-> s5-0 param 0) - (- (the float (+ (-> s5-0 frame-group frames num-frames) -1)) (-> obj frame-post-end)) + (- (the float (+ (-> s5-0 frame-group frames num-frames) -1)) (-> this frame-post-end)) ) (set! (-> s5-0 param 0) 0.0) ) - (set! (-> s5-0 param 1) (fabs (-> obj frame-speed))) + (set! (-> s5-0 param 1) (fabs (-> this frame-speed))) ) ) ) (else (when (!= (-> s5-0 frame-group) s4-0) (set! (-> s5-0 frame-num) 0.0) - (set! (-> obj base-anim-speed) 1.0) - (set! (-> obj base-anim-blend) 0.1333333) + (set! (-> this base-anim-speed) 1.0) + (set! (-> this base-anim-blend) 0.1333333) ) (set! (-> s5-0 frame-group) (the-as art-joint-anim s4-0)) (set! (-> s5-0 num-func) num-func-loop!) - (set! (-> s5-0 param 0) (-> obj base-anim-speed)) - (set! (-> obj frame-post-blend) 0.1333333) + (set! (-> s5-0 param 0) (-> this base-anim-speed)) + (set! (-> this frame-post-blend) 0.1333333) ) ) ) - (set! (-> obj frame-group) (-> s5-0 frame-group)) - (set! (-> obj frame-num) (-> s5-0 frame-num)) + (set! (-> this frame-group) (-> s5-0 frame-group)) + (set! (-> this frame-num) (-> s5-0 frame-num)) ) ) ) ) - (set! (-> obj update-time) (current-time)) + (set! (-> this update-time) (current-time)) 0 (none) ) diff --git a/goal_src/jak2/engine/process-drawable/process-focusable.gc b/goal_src/jak2/engine/process-drawable/process-focusable.gc index 4e3e145f8a..b29bb4ef28 100644 --- a/goal_src/jak2/engine/process-drawable/process-focusable.gc +++ b/goal_src/jak2/engine/process-drawable/process-focusable.gc @@ -65,9 +65,9 @@ ;; WARN: Return type mismatch structure vs vector. -(defmethod get-trans process-focusable ((obj process-focusable) (arg0 int)) +(defmethod get-trans process-focusable ((this process-focusable) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((gp-0 (-> obj root))) + (let ((gp-0 (-> this root))) (the-as vector (cond ((zero? arg0) (-> gp-0 trans) @@ -77,7 +77,7 @@ ) ((and (or (= arg0 2) (= arg0 3)) (type? gp-0 collide-shape)) ;; og:preserve-this added check here so we don't use invalid bones - (if (logtest? (-> obj draw status) (draw-control-status uninited)) + (if (logtest? (-> this draw status) (draw-control-status uninited)) (-> gp-0 trans) (-> gp-0 root-prim prim-core)) ) @@ -89,29 +89,29 @@ ) ) -(defmethod get-transv process-focusable ((obj process-focusable)) - (-> obj root transv) +(defmethod get-transv process-focusable ((this process-focusable)) + (-> this root transv) ) -(defmethod get-quat process-focusable ((obj process-focusable) (arg0 int)) - (-> obj root quat) +(defmethod get-quat process-focusable ((this process-focusable) (arg0 int)) + (-> this root quat) ) -(defmethod time-to-apex-or-ground process-focusable ((obj process-focusable) (arg0 int)) +(defmethod time-to-apex-or-ground process-focusable ((this process-focusable) (arg0 int)) 0 ) ;; WARN: Return type mismatch int vs meters. -(defmethod get-water-height process-focusable ((obj process-focusable)) +(defmethod get-water-height process-focusable ((this process-focusable)) (the-as meters 0) ) -(defmethod get-inv-mass process-focusable ((obj process-focusable)) +(defmethod get-inv-mass process-focusable ((this process-focusable)) 0.0 ) ;; WARN: Return type mismatch int vs time-frame. -(defmethod get-notice-time process-focusable ((obj process-focusable)) +(defmethod get-notice-time process-focusable ((this process-focusable)) (the-as time-frame 0) ) diff --git a/goal_src/jak2/engine/process-drawable/process-taskable-h.gc b/goal_src/jak2/engine/process-drawable/process-taskable-h.gc index d54cf38241..d4d6b75575 100644 --- a/goal_src/jak2/engine/process-drawable/process-taskable-h.gc +++ b/goal_src/jak2/engine/process-drawable/process-taskable-h.gc @@ -11,7 +11,7 @@ ((task game-task-control :offset-assert 204) (ambient ambient-control :inline :offset-assert 208) (neck-joint-index int32 :offset-assert 224) - (talk-message text-id :offset-assert 228) + (talk-message text-id :offset-assert 228) (bounce-away symbol :offset-assert 232) (will-talk symbol :offset-assert 236) (look-at-me symbol :offset-assert 240) diff --git a/goal_src/jak2/engine/process-drawable/process-taskable.gc b/goal_src/jak2/engine/process-drawable/process-taskable.gc index 6294b76f5f..0b6521068c 100644 --- a/goal_src/jak2/engine/process-drawable/process-taskable.gc +++ b/goal_src/jak2/engine/process-drawable/process-taskable.gc @@ -8,11 +8,11 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch process-focusable vs process-taskable. -(defmethod relocate process-taskable ((obj process-taskable) (arg0 int)) - (if (nonzero? (-> obj task)) - (&+! (-> obj task) arg0) +(defmethod relocate process-taskable ((this process-taskable) (arg0 int)) + (if (nonzero? (-> this task)) + (&+! (-> this task) arg0) ) - (the-as process-taskable ((method-of-type process-focusable relocate) obj arg0)) + (the-as process-taskable ((method-of-type process-focusable relocate) this arg0)) ) (defbehavior process-taskable-anim-loop process-taskable ((arg0 (function process-taskable object))) @@ -36,34 +36,34 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (none) ) -(defmethod process-taskable-method-34 process-taskable ((obj process-taskable)) +(defmethod process-taskable-method-34 process-taskable ((this process-taskable)) #t ) ;; WARN: Return type mismatch art-joint-anim vs art-element. -(defmethod get-art-elem process-taskable ((obj process-taskable)) +(defmethod get-art-elem process-taskable ((this process-taskable)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (the-as art-element (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (the-as art-element (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) -(defmethod process-taskable-method-36 process-taskable ((obj process-taskable)) +(defmethod process-taskable-method-36 process-taskable ((this process-taskable)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod process-taskable-method-37 process-taskable ((obj process-taskable)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-37 process-taskable ((this process-taskable)) + (let ((v1-1 (-> this draw shadow-ctrl))) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) ) - (shadow-control-method-13 v1-1 (-> obj draw origin) -4096.0 4096.0 32768.0) + (shadow-control-method-13 v1-1 (-> this draw origin) -4096.0 4096.0 32768.0) ) (else (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) @@ -87,7 +87,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self draw status) (draw-control-status no-draw-bounds)) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (collide-spec)) @@ -106,7 +106,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (let ((v1-1 (get-current-task-event (-> self task)))) (if (and (nonzero? (-> v1-1 action)) (or (not (logtest? (-> self draw status) (draw-control-status on-screen))) (logtest? (-> v1-1 flags) (game-task-flags gatflag-01)) - (< (- (current-time) (-> self birth-time)) (seconds 0.1)) + (not (time-elapsed? (-> self birth-time) (seconds 0.1))) ) ) (go-virtual idle) @@ -142,7 +142,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) @@ -197,7 +197,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (< (vector-vector-distance (target-pos 0) s5-0) f30-0)) ) ) - (< (- (current-time) (-> self want-to-say)) (seconds 4)) + (not (time-elapsed? (-> self want-to-say) (seconds 4))) ) (or (not (load-in-progress? *level*)) (= (-> gp-0 action) (game-task-action say))) (and (not (movie?)) @@ -217,7 +217,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) (process-taskable-method-34 self) ) - (when (or (= (-> gp-0 action) (game-task-action say)) (< (- (current-time) (-> self want-to-say)) (seconds 4))) + (when (or (= (-> gp-0 action) (game-task-action say)) (not (time-elapsed? (-> self want-to-say) (seconds 4)))) (case (-> gp-0 action) (((game-task-action play)) (go-virtual play-game gp-0) @@ -274,6 +274,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (logclear! (-> self draw status) (draw-control-status no-draw)) ) (when (-> self look-at-me) + ;; og:preserve-this macro (target-look-at-me! :trans (get-trans self 2)) ) (transform-post) @@ -290,7 +291,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) :exit (behavior () (set! (-> self last-talk) (-> *display* game-clock frame-counter)) - (if (< (- (current-time) (-> self want-to-say)) (seconds 4)) + (if (not (time-elapsed? (-> self want-to-say) (seconds 4))) (set! (-> self will-talk) #t) (set! (-> self will-talk) #f) ) @@ -329,7 +330,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy :exit (-> (method-of-type process-taskable active) exit) :code (behavior ((arg0 game-task-event)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.5)) + (until (time-elapsed? gp-0 (seconds 0.5)) (suspend) ) ) @@ -338,8 +339,8 @@ Seen take in - `true-func` which takes no args TODO - seems fishy :post (-> (method-of-type process-taskable idle) post) ) -(defmethod process-taskable-method-31 process-taskable ((obj process-taskable)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod process-taskable-method-31 process-taskable ((this process-taskable)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s5-0 total-prims) (the-as uint 4)) (set! (-> s4-0 prim-core collide-as) (collide-spec civilian)) @@ -371,33 +372,33 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod process-taskable-method-32 process-taskable ((obj process-taskable)) - (logior! (-> obj skel status) (joint-control-status eye-anim)) - (set! (-> obj talk-message) (text-id press-triangle-to-talk)) - (set! (-> obj bounce-away) #t) - (set! (-> obj will-talk) #t) - (set! (-> obj look-at-me) #t) - (set! (-> obj hide-during-movie) #t) - (set! (-> obj neck-joint-index) -1) - (set! (-> obj talk-distance) (res-lump-float (-> obj entity) 'distance :default 32768.0)) - (set! (-> obj talk-height) (res-lump-float (-> obj entity) 'height :default 8192.0)) - (set! (-> obj slave) (the-as handle #f)) - (set! (-> obj draw shadow-ctrl) +(defmethod process-taskable-method-32 process-taskable ((this process-taskable)) + (logior! (-> this skel status) (joint-control-status eye-anim)) + (set! (-> this talk-message) (text-id press-triangle-to-talk)) + (set! (-> this bounce-away) #t) + (set! (-> this will-talk) #t) + (set! (-> this look-at-me) #t) + (set! (-> this hide-during-movie) #t) + (set! (-> this neck-joint-index) -1) + (set! (-> this talk-distance) (res-lump-float (-> this entity) 'distance :default 32768.0)) + (set! (-> this talk-height) (res-lump-float (-> this entity) 'height :default 8192.0)) + (set! (-> this slave) (the-as handle #f)) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (shadow-flags shdf02 shdf03 shdf04 disable-draw) 245760.0) ) (let ((s5-0 0)) - (let ((v1-15 (the-as joint (get-art-by-name-method (-> obj draw jgeo) "main" (the-as type #f))))) + (let ((v1-15 (the-as joint (get-art-by-name-method (-> this draw jgeo) "main" (the-as type #f))))) (if v1-15 (set! s5-0 (+ (-> v1-15 number) 1)) ) ) - (let ((v1-19 (the-as collide-shape-prim-group (-> obj root root-prim)))) + (let ((v1-19 (the-as collide-shape-prim-group (-> this root root-prim)))) (set! (-> v1-19 transform-index) s5-0) (dotimes (a0-7 (the-as int (-> v1-19 num-children))) (set! (-> v1-19 child a0-7 transform-index) s5-0) @@ -408,36 +409,36 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (none) ) -(defmethod init-art! process-taskable ((obj process-taskable)) +(defmethod init-art! process-taskable ((this process-taskable)) "@see [[initialize-skeleton]]" 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! process-taskable ((obj process-taskable) (arg0 entity-actor)) +(defmethod init-from-entity! process-taskable ((this process-taskable) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (process-taskable-method-31 obj) - (process-drawable-from-entity! obj arg0) - (set! (-> obj task) + (stack-size-set! (-> this main-thread) 512) + (process-taskable-method-31 this) + (process-drawable-from-entity! this arg0) + (set! (-> this task) (new 'process 'game-task-control (res-lump-value arg0 'task-actor game-task-actor :time -1000000000.0)) ) - (init-art! obj) - (process-taskable-method-32 obj) + (init-art! this) + (process-taskable-method-32 this) (when (logtest? #x1000000 (res-lump-value arg0 'options uint128 :time -1000000000.0)) (let* ((s5-1 *level*) (s4-2 (method-of-object s5-1 art-group-get-by-name)) ) - (format (clear *temp-string*) "skel-~S" (-> obj draw art-group name)) + (format (clear *temp-string*) "skel-~S" (-> this draw art-group name)) (let ((s4-3 (s4-2 s5-1 *temp-string* (the-as (pointer uint32) #f)))) (when s4-3 - (let ((s5-2 (process-spawn manipy :init manipy-init (-> obj root trans) (-> obj entity) s4-3 #f 0 :to obj))) + (let ((s5-2 (process-spawn manipy :init manipy-init (-> this root trans) (-> this entity) s4-3 #f 0 :to this))) (send-event (ppointer->process s5-2) 'anim-mode 'mirror) (send-event (ppointer->process s5-2) 'mirror #t) ) @@ -445,7 +446,7 @@ This commonly includes things such as: ) ) ) - (set! (-> obj event-hook) (-> (method-of-object obj idle) event)) - (go (method-of-object obj hide)) + (set! (-> this event-hook) (-> (method-of-object this idle) event)) + (go (method-of-object this hide)) (none) ) diff --git a/goal_src/jak2/engine/process-drawable/simple-focus.gc b/goal_src/jak2/engine/process-drawable/simple-focus.gc index 14d170b58c..541a6c4600 100644 --- a/goal_src/jak2/engine/process-drawable/simple-focus.gc +++ b/goal_src/jak2/engine/process-drawable/simple-focus.gc @@ -20,14 +20,14 @@ ) -(defmethod get-trans simple-focus ((obj simple-focus) (arg0 int)) +(defmethod get-trans simple-focus ((this simple-focus) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (-> obj root trans) + (-> this root trans) ) -(defmethod run-logic? simple-focus ((obj simple-focus)) - (when (-> obj first-time?) - (set! (-> obj first-time?) #f) +(defmethod run-logic? simple-focus ((this simple-focus)) + (when (-> this first-time?) + (set! (-> this first-time?) #f) #t ) ) diff --git a/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc b/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc index 70814b6641..9569fd663e 100644 --- a/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc +++ b/goal_src/jak2/engine/process-drawable/simple-nav-sphere.gc @@ -45,16 +45,16 @@ ) ) -(defmethod run-logic? simple-nav-sphere ((obj simple-nav-sphere)) +(defmethod run-logic? simple-nav-sphere ((this simple-nav-sphere)) (cond (*display-nav-marks* #t ) - ((>= (-> obj track-joint) 0) + ((>= (-> this track-joint) 0) #t ) - ((-> obj first-time?) - (set! (-> obj first-time?) #f) + ((-> this first-time?) + (set! (-> this first-time?) #f) #t ) ) diff --git a/goal_src/jak2/engine/ps2/rpc-h.gc b/goal_src/jak2/engine/ps2/rpc-h.gc index d8fea49d3f..79d1ec855c 100644 --- a/goal_src/jak2/engine/ps2/rpc-h.gc +++ b/goal_src/jak2/engine/ps2/rpc-h.gc @@ -23,6 +23,7 @@ ) ) + (defmethod new rpc-buffer ((allocation symbol) (type-to-make type) (arg0 uint) (arg1 uint)) (let* ((a2-2 (+ (-> type-to-make size) 63 (* (the-as int arg0) (the-as int arg1)))) (v0-0 (object-new allocation type-to-make (the-as int a2-2))) @@ -35,6 +36,7 @@ v0-0 ) ) + (deftype rpc-buffer-pair (basic) ((buffer rpc-buffer 2 :offset-assert 4) (current rpc-buffer :offset-assert 12) @@ -55,6 +57,7 @@ ) ) + (defmethod new rpc-buffer-pair ((allocation symbol) (type-to-make type) (arg0 uint) (arg1 uint) (arg2 int)) (let ((s3-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (set! (-> s3-0 buffer 0) (new 'global 'rpc-buffer arg0 arg1)) @@ -66,19 +69,19 @@ ) ) -(defmethod sync rpc-buffer-pair ((obj rpc-buffer-pair) (arg0 symbol)) - (let ((s5-0 (if (= (-> obj current) (-> obj buffer 0)) - (-> obj buffer 1) - (-> obj buffer 0) +(defmethod sync rpc-buffer-pair ((this rpc-buffer-pair) (arg0 symbol)) + (let ((s5-0 (if (= (-> this current) (-> this buffer 0)) + (-> this buffer 1) + (-> this buffer 0) ) ) ) (when (-> s5-0 busy) - (when (nonzero? (rpc-busy? (-> obj rpc-port))) + (when (nonzero? (rpc-busy? (-> this rpc-port))) (if arg0 - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) ) - (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (while (nonzero? (rpc-busy? (-> this rpc-port))) (nop!) (nop!) (nop!) @@ -97,15 +100,15 @@ 0 ) -(defmethod check-busy rpc-buffer-pair ((obj rpc-buffer-pair)) - (let ((gp-0 (if (= (-> obj current) (-> obj buffer 0)) - (-> obj buffer 1) - (-> obj buffer 0) +(defmethod check-busy rpc-buffer-pair ((this rpc-buffer-pair)) + (let ((gp-0 (if (= (-> this current) (-> this buffer 0)) + (-> this buffer 1) + (-> this buffer 0) ) ) ) (when (-> gp-0 busy) - (if (nonzero? (rpc-busy? (-> obj rpc-port))) + (if (nonzero? (rpc-busy? (-> this rpc-port))) (return #t) ) (set! (-> gp-0 busy) #f) @@ -116,18 +119,18 @@ #f ) -(defmethod call rpc-buffer-pair ((obj rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) - (when (nonzero? (-> obj current elt-used)) - (let ((s2-0 (if (= (-> obj current) (-> obj buffer 0)) - (-> obj buffer 1) - (-> obj buffer 0) +(defmethod call rpc-buffer-pair ((this rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) + (when (nonzero? (-> this current elt-used)) + (let ((s2-0 (if (= (-> this current) (-> this buffer 0)) + (-> this buffer 1) + (-> this buffer 0) ) ) ) (when (-> s2-0 busy) - (when (nonzero? (rpc-busy? (-> obj rpc-port))) - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) - (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (when (nonzero? (rpc-busy? (-> this rpc-port))) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) + (while (nonzero? (rpc-busy? (-> this rpc-port))) (nop!) (nop!) (nop!) @@ -142,9 +145,9 @@ (set! (-> s2-0 elt-used) (the-as uint 0)) 0 ) - (let ((s1-0 (-> obj current))) + (let ((s1-0 (-> this current))) (rpc-call - (-> obj rpc-port) + (-> this rpc-port) arg0 (the-as uint 1) (the-as uint (-> s1-0 base)) @@ -154,28 +157,28 @@ ) (set! (-> s1-0 busy) (the-as basic #t)) ) - (set! (-> obj last-recv-buffer) arg1) - (set! (-> obj current) s2-0) + (set! (-> this last-recv-buffer) arg1) + (set! (-> this current) s2-0) ) ) 0 ) -(defmethod pop-last-received rpc-buffer-pair ((obj rpc-buffer-pair)) - (let ((v0-0 (-> obj last-recv-buffer))) - (set! (-> obj last-recv-buffer) (the-as pointer #f)) +(defmethod pop-last-received rpc-buffer-pair ((this rpc-buffer-pair)) + (let ((v0-0 (-> this last-recv-buffer))) + (set! (-> this last-recv-buffer) (the-as pointer #f)) v0-0 ) ) -(defmethod add-element rpc-buffer-pair ((obj rpc-buffer-pair)) - (let ((v1-0 (-> obj current))) +(defmethod add-element rpc-buffer-pair ((this rpc-buffer-pair)) + (let ((v1-0 (-> this current))) (when (= (-> v1-0 elt-used) (-> v1-0 elt-count)) - (if (zero? (-> obj rpc-port)) + (if (zero? (-> this rpc-port)) (format 0 "WARNING: too many sound commands queued~%") ) - (call obj (the-as uint 0) (the-as pointer 0) (the-as uint 0)) - (set! v1-0 (-> obj current)) + (call this (the-as uint 0) (the-as pointer 0) (the-as uint 0)) + (set! v1-0 (-> this current)) ) (let ((v0-2 (&+ (-> v1-0 base) (* (-> v1-0 elt-used) (-> v1-0 elt-size))))) (+! (-> v1-0 elt-used) 1) @@ -184,9 +187,9 @@ ) ) -(defmethod decrement-elt-used rpc-buffer-pair ((obj rpc-buffer-pair)) - (if (> (-> obj current elt-used) 0) - (+! (-> obj current elt-used) -1) +(defmethod decrement-elt-used rpc-buffer-pair ((this rpc-buffer-pair)) + (if (> (-> this current elt-used) 0) + (+! (-> this current elt-used) -1) ) 0 ) diff --git a/goal_src/jak2/engine/ps2/timer.gc b/goal_src/jak2/engine/ps2/timer.gc index cb2a1899d6..5aaa012076 100644 --- a/goal_src/jak2/engine/ps2/timer.gc +++ b/goal_src/jak2/engine/ps2/timer.gc @@ -67,103 +67,103 @@ ;; Stopwatch (CPU clock cycle counting) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(defun stopwatch-init ((obj stopwatch)) +(defun stopwatch-init ((this stopwatch)) "Init a stopwatch" - (set! (-> obj begin-level) 0) - (set! (-> obj prev-time-elapsed) 0) + (set! (-> this begin-level) 0) + (set! (-> this prev-time-elapsed) 0) ) -(defun stopwatch-reset ((obj stopwatch)) +(defun stopwatch-reset ((this stopwatch)) "Restart a stopwatch's times" - (set! (-> obj prev-time-elapsed) 0) - (when (> (-> obj begin-level) 0) + (set! (-> this prev-time-elapsed) 0) + (when (> (-> this begin-level) 0) (let ((count 0)) (.mfc0 count Count) (#when PC_PORT (set! count (the int (get-cpu-clock))) ) - (set! (-> obj start-time) count) + (set! (-> this start-time) count) ) ) ) -(defun stopwatch-start ((obj stopwatch)) +(defun stopwatch-start ((this stopwatch)) "Start a stopwatch from scratch" - (when (zero? (-> obj begin-level)) - (set! (-> obj begin-level) 1) + (when (zero? (-> this begin-level)) + (set! (-> this begin-level) 1) (let ((count 0)) (.mfc0 count Count) (#when PC_PORT (set! count (the int (get-cpu-clock))) ) - (set! (-> obj start-time) count) + (set! (-> this start-time) count) ) ) ) -(defun stopwatch-stop ((obj stopwatch)) +(defun stopwatch-stop ((this stopwatch)) "Fully stop a stopwatch and save its elapsed time" - (when (> (-> obj begin-level) 0) - (set! (-> obj begin-level) 0) + (when (> (-> this begin-level) 0) + (set! (-> this begin-level) 0) (let ((count 0)) (let ((count 0)) (.mfc0 count Count) ;; wrong register? a typo in a rlet? who knows. (#when PC_PORT (set! count (the int (get-cpu-clock))) ) - (+! (-> obj prev-time-elapsed) (- count (-> obj start-time))) + (+! (-> this prev-time-elapsed) (- count (-> this start-time))) ) ) ) (none) ) -(defun stopwatch-begin ((obj stopwatch)) +(defun stopwatch-begin ((this stopwatch)) "Begin a stopwatch level, and starts it if it hasn't yet" - (when (zero? (-> obj begin-level)) + (when (zero? (-> this begin-level)) (let ((count 0)) (.mfc0 count Count) (#when PC_PORT (set! count (the int (get-cpu-clock))) ) - (set! (-> obj start-time) count) + (set! (-> this start-time) count) ) ) - (+! (-> obj begin-level) 1) + (+! (-> this begin-level) 1) ) -(defun stopwatch-end ((obj stopwatch)) +(defun stopwatch-end ((this stopwatch)) "End a stopwatch level. Stops the stopwatch if it's back to level zero. There is no guard against ending a stopwatch too many times, and a negative level will cause errors!" - (+! (-> obj begin-level) -1) - (when (zero? (-> obj begin-level)) - (set! (-> obj begin-level) 0) + (+! (-> this begin-level) -1) + (when (zero? (-> this begin-level)) + (set! (-> this begin-level) 0) (let ((count 0)) (.mfc0 count Count) (#when PC_PORT (set! count (the int (get-cpu-clock))) ) - (+! (-> obj prev-time-elapsed) (- count (-> obj start-time))) + (+! (-> this prev-time-elapsed) (- count (-> this start-time))) ) ) (none) ) -(defun stopwatch-elapsed-ticks ((obj stopwatch)) +(defun stopwatch-elapsed-ticks ((this stopwatch)) "Returns the elapsed time so far (in clock cycles) of a stopwatch" - (let ((elapsed (-> obj prev-time-elapsed))) - (when (> (-> obj begin-level) 0) + (let ((elapsed (-> this prev-time-elapsed))) + (when (> (-> this begin-level) 0) (let ((count 0)) (.mfc0 count Count) (#when PC_PORT (set! count (the int (get-cpu-clock))) ) - (+! elapsed (- count (-> obj start-time))) + (+! elapsed (- count (-> this start-time))) (set! count elapsed) ;; ?? ) ) @@ -175,16 +175,16 @@ (defmacro cpu-ticks-to-seconds (ticks) `(* ,EE_SECONDS_PER_TICK ,ticks) ) -(defun stopwatch-elapsed-seconds ((obj stopwatch)) +(defun stopwatch-elapsed-seconds ((this stopwatch)) "Returns the elapsed time so far (in seconds) of a stopwatch" - (cpu-ticks-to-seconds (stopwatch-elapsed-ticks obj)) + (cpu-ticks-to-seconds (stopwatch-elapsed-ticks this)) ) -(defmethod update-rates! clock ((obj clock) (arg0 float)) +(defmethod update-rates! clock ((this clock) (arg0 float)) "Recompute all clock values for the given clock ratio (arg0)." ;; remember our ratio - (set! (-> obj clock-ratio) arg0) + (set! (-> this clock-ratio) arg0) ;; next, compute the time adjust ratio. This will be 1.0 for NTSC 60 fps. ;; It will be adjusted for PAL (1.2), and also for lag (dog-ratio). @@ -195,95 +195,95 @@ ) ) ) - (set! (-> obj time-adjust-ratio) (* 0.2 f0-6)) ;; will be 5 for no-lag 60fps. + (set! (-> this time-adjust-ratio) (* 0.2 f0-6)) ;; will be 5 for no-lag 60fps. ) ;; real seconds per frame (of game logic, not vsycns) - (set! (-> obj seconds-per-frame) (* 0.016666668 (-> obj time-adjust-ratio))) + (set! (-> this seconds-per-frame) (* 0.016666668 (-> this time-adjust-ratio))) ;; inverse of the above. - (set! (-> obj frames-per-second) (if (= (-> obj time-adjust-ratio) 0.0) + (set! (-> this frames-per-second) (if (= (-> this time-adjust-ratio) 0.0) 0.0 - (* 60.0 (/ 1.0 (-> obj time-adjust-ratio))) + (* 60.0 (/ 1.0 (-> this time-adjust-ratio))) ) ) ;; convert to sparticle format. - (let* ((v1-12 (- (-> obj frame-counter) (-> obj old-frame-counter))) + (let* ((v1-12 (- (-> this frame-counter) (-> this old-frame-counter))) (f0-14 v1-12) (f1-9 (* 0.2 (the float v1-12))) ) - (set-vector! (-> obj sparticle-data) (the-as float f0-14) (* 5.0 f1-9) f1-9 f1-9) + (set-vector! (-> this sparticle-data) (the-as float f0-14) (* 5.0 f1-9) f1-9 f1-9) ) arg0 ) -(defmethod advance-by! clock ((obj clock) (arg0 float)) +(defmethod advance-by! clock ((this clock) (arg0 float)) "Advance the clock by arg0 timeframes (as a float). Both counters keep a separate fractional and integer counter." - (the int (+ arg0 (-> obj accum))) ;; unused + (the int (+ arg0 (-> this accum))) ;; unused ;; add to accumulated time - (+! (-> obj integral-accum) arg0) + (+! (-> this integral-accum) arg0) ;; remember the old frame-count from last time - (set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter)) + (set! (-> this old-integral-frame-counter) (-> this integral-frame-counter)) ;; time-factor tells us how much time per vsync, if we've accumulated at least that much, increment integral ;; frame counter as needed. - (while (>= (-> obj integral-accum) (-> *display* time-factor)) - (+! (-> obj integral-frame-counter) 1) - (set! (-> obj integral-accum) (- (-> obj integral-accum) (-> *display* time-factor))) + (while (>= (-> this integral-accum) (-> *display* time-factor)) + (+! (-> this integral-frame-counter) 1) + (set! (-> this integral-accum) (- (-> this integral-accum) (-> *display* time-factor))) ) ;; now the same for timeframe counter. - (let ((v1-7 (the int (+ arg0 (-> obj accum))))) - (set! (-> obj accum) (- (+ arg0 (-> obj accum)) (the float v1-7))) - (set! (-> obj old-frame-counter) (-> obj frame-counter)) - (+! (-> obj frame-counter) v1-7) + (let ((v1-7 (the int (+ arg0 (-> this accum))))) + (set! (-> this accum) (- (+ arg0 (-> this accum)) (the float v1-7))) + (set! (-> this old-frame-counter) (-> this frame-counter)) + (+! (-> this frame-counter) v1-7) ) ;; recompute rates. - (update-rates! obj (-> obj clock-ratio)) - obj + (update-rates! this (-> this clock-ratio)) + this ) -(defmethod tick! clock ((obj clock)) +(defmethod tick! clock ((this clock)) "Per-game-frame clock tick forward." - (if (zero? (logand (-> obj mask) (-> *kernel-context* prevent-from-run))) + (if (zero? (logand (-> this mask) (-> *kernel-context* prevent-from-run))) ;; include: ntsc/pal scale, lag, and clock ratio. - (advance-by! obj (* (-> *display* time-factor) (-> *display* dog-ratio) (-> obj clock-ratio))) - (set! (-> obj sparticle-data x) 0.0) + (advance-by! this (* (-> *display* time-factor) (-> *display* dog-ratio) (-> this clock-ratio))) + (set! (-> this sparticle-data x) 0.0) ) - obj + this ) -(defmethod reset! clock ((obj clock)) +(defmethod reset! clock ((this clock)) "Reset a clock to 1000s, rate of 1." - (set! (-> obj frame-counter) (seconds 1000)) - (set! (-> obj integral-frame-counter) (the-as uint #x493e0)) - (set! (-> obj accum) 0.0) - (set! (-> obj old-frame-counter) (+ (-> obj frame-counter) -1)) - (set! (-> obj old-integral-frame-counter) (+ (-> obj integral-frame-counter) -1)) - (update-rates! obj 1.0) + (set! (-> this frame-counter) (seconds 1000)) + (set! (-> this integral-frame-counter) (the-as uint #x493e0)) + (set! (-> this accum) 0.0) + (set! (-> this old-frame-counter) (+ (-> this frame-counter) -1)) + (set! (-> this old-integral-frame-counter) (+ (-> this integral-frame-counter) -1)) + (update-rates! this 1.0) 0 (none) ) -(defmethod save! clock ((obj clock) (arg0 (pointer uint64))) +(defmethod save! clock ((this clock) (arg0 (pointer uint64))) "Save a clock's state to a buffer, return bytes used." - (set! (-> arg0 0) (the-as uint (-> obj frame-counter))) - (set! (-> arg0 1) (-> obj integral-frame-counter)) + (set! (-> arg0 0) (the-as uint (-> this frame-counter))) + (set! (-> arg0 1) (-> this integral-frame-counter)) 16 ) -(defmethod load! clock ((obj clock) (arg0 (pointer uint64))) +(defmethod load! clock ((this clock) (arg0 (pointer uint64))) "Load a clock's state from a buffer, return bytes used." - (set! (-> obj frame-counter) (the-as time-frame (-> arg0 0))) - (set! (-> obj integral-frame-counter) (-> arg0 1)) - (set! (-> obj accum) 0.0) - (set! (-> obj integral-accum) 0.0) - (set! (-> obj old-frame-counter) (-> obj frame-counter)) - (set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter)) + (set! (-> this frame-counter) (the-as time-frame (-> arg0 0))) + (set! (-> this integral-frame-counter) (-> arg0 1)) + (set! (-> this accum) 0.0) + (set! (-> this integral-accum) 0.0) + (set! (-> this old-frame-counter) (-> this frame-counter)) + (set! (-> this old-integral-frame-counter) (-> this integral-frame-counter)) 16 ) diff --git a/goal_src/jak2/engine/ps2/vif-h.gc b/goal_src/jak2/engine/ps2/vif-h.gc index 8d23e4078a..6226b9fc98 100644 --- a/goal_src/jak2/engine/ps2/vif-h.gc +++ b/goal_src/jak2/engine/ps2/vif-h.gc @@ -34,6 +34,7 @@ Types related to VIF: the PS2's Vector Interface. :flag-assert #x900000004 ) + (deftype vif-fbrst (uint32) ((rst uint8 :offset 0 :size 1) (fbk uint8 :offset 1 :size 1) diff --git a/goal_src/jak2/engine/scene/scene.gc b/goal_src/jak2/engine/scene/scene.gc index dbd07321a3..1172bb4ce8 100644 --- a/goal_src/jak2/engine/scene/scene.gc +++ b/goal_src/jak2/engine/scene/scene.gc @@ -15,17 +15,17 @@ ) -(defmethod print scene ((obj scene)) - (format #t "#" (-> obj art-group) (-> obj anim) obj) - obj +(defmethod print scene ((this scene)) + (format #t "#" (-> this art-group) (-> this anim) this) + this ) ;; WARN: Return type mismatch spool-anim vs none. -(defmethod scene-method-15 scene ((obj scene) (arg0 spool-anim)) - (set! (-> arg0 name) (-> obj anim)) - (set! (-> arg0 anim-name) (-> obj anim)) - (set! (-> arg0 parts) (-> obj parts)) - (set! (-> arg0 command-list) (-> obj command-list)) +(defmethod scene-method-15 scene ((this scene) (arg0 spool-anim)) + (set! (-> arg0 name) (-> this anim)) + (set! (-> arg0 anim-name) (-> this anim)) + (set! (-> arg0 parts) (-> this parts)) + (set! (-> arg0 command-list) (-> this command-list)) (none) ) @@ -48,10 +48,10 @@ ) ) -(defmethod scene-actor-method-9 scene-actor ((obj scene-actor) (arg0 scene-player)) +(defmethod scene-actor-method-9 scene-actor ((this scene-actor) (arg0 scene-player)) (local-vars (s4-0 (pointer process)) (sv-96 process) (sv-112 process)) - (let ((s1-0 (if (-> obj level) - (level-get *level* (-> obj level)) + (let ((s1-0 (if (-> this level) + (level-get *level* (-> this level)) (-> *level* default-level) ) ) @@ -69,16 +69,16 @@ (goto cfg-211) ) ) - (let* ((s4-1 (art-group-get-by-name *level* (-> obj art-group) (the-as (pointer uint32) #f))) + (let* ((s4-1 (art-group-get-by-name *level* (-> this art-group) (the-as (pointer uint32) #f))) (s2-0 (if (type? s4-1 skeleton-group) (the-as skeleton-group s4-1) ) ) (s0-0 (-> arg0 level)) (s3-0 - (or (string= (-> obj name) "jak-highres") - (string= (-> obj name) "jak-highres-prison") - (string= (-> obj name) "darkjak-highres") + (or (string= (-> this name) "jak-highres") + (string= (-> this name) "jak-highres-prison") + (string= (-> this name) "darkjak-highres") ) ) ) @@ -94,7 +94,7 @@ (set! sv-96 (get-process *default-dead-pool* manipy #x4000)) (set! s4-0 (when sv-96 (let ((t9-7 (method-of-type manipy activate))) - (t9-7 (the-as manipy sv-96) arg0 (-> obj name) (the-as pointer #x70004000)) + (t9-7 (the-as manipy sv-96) arg0 (-> this name) (the-as pointer #x70004000)) ) (run-now-in-process sv-96 @@ -114,31 +114,31 @@ (set! (-> arg0 level) s0-0) (send-event (ppointer->process s4-0) 'anim-mode 'clone-anim) (send-event (ppointer->process s4-0) 'blend-shape #t) - (send-event (ppointer->process s4-0) 'prefix (-> obj prefix)) + (send-event (ppointer->process s4-0) 'prefix (-> this prefix)) (cond - ((zero? (-> obj light-index)) + ((zero? (-> this light-index)) (if (zero? (-> s2-0 light-index)) (send-event (ppointer->process s4-0) 'light-index 80) ) ) (else - (send-event (ppointer->process s4-0) 'light-index (* (-> obj light-index) 8)) + (send-event (ppointer->process s4-0) 'light-index (* (-> this light-index) 8)) ) ) - (if (nonzero? (-> obj shadow-mask)) - (send-event (ppointer->process s4-0) 'shadow-mask (* (-> obj shadow-mask) 8)) + (if (nonzero? (-> this shadow-mask)) + (send-event (ppointer->process s4-0) 'shadow-mask (* (-> this shadow-mask) 8)) ) - (if (nonzero? (-> obj shadow-values)) - (send-event (ppointer->process s4-0) 'shadow-values (* (-> obj shadow-values) 8)) + (if (nonzero? (-> this shadow-values)) + (send-event (ppointer->process s4-0) 'shadow-values (* (-> this shadow-values) 8)) ) - (if (and s4-0 (not (logtest? (-> obj flags) 1)) (nonzero? (-> (the-as process-drawable (-> s4-0 0)) draw))) + (if (and s4-0 (not (logtest? (-> this flags) 1)) (nonzero? (-> (the-as process-drawable (-> s4-0 0)) draw))) (logior! (-> (the-as process-drawable (-> s4-0 0)) draw status) (draw-control-status no-draw-bounds)) ) - (if (-> obj shadow-volume-joint) - (send-event (ppointer->process s4-0) 'shadow-volume (-> obj shadow-volume-joint) (-> obj shadow-flags)) + (if (-> this shadow-volume-joint) + (send-event (ppointer->process s4-0) 'shadow-volume (-> this shadow-volume-joint) (-> this shadow-flags)) ) - (if (or (nonzero? (-> obj draw-seg)) (nonzero? (-> obj no-draw-seg))) - (send-event (ppointer->process s4-0) 'segment (* (-> obj draw-seg) 8) (* (-> obj no-draw-seg) 8)) + (if (or (nonzero? (-> this draw-seg)) (nonzero? (-> this no-draw-seg))) + (send-event (ppointer->process s4-0) 'segment (* (-> this draw-seg) 8) (* (-> this no-draw-seg) 8)) ) (when s3-0 (if (not (-> *setting-control* user-current beard)) @@ -167,11 +167,11 @@ ) ) ) - (when (and s4-0 (logtest? (-> obj flags) 2)) + (when (and s4-0 (logtest? (-> this flags) 2)) (set! sv-112 (get-process *default-dead-pool* manipy #x4000)) (let ((s0-1 (when sv-112 (let ((t9-24 (method-of-type manipy activate))) - (t9-24 (the-as manipy sv-112) (ppointer->process s4-0) (-> obj name) (the-as pointer #x70004000)) + (t9-24 (the-as manipy sv-112) (ppointer->process s4-0) (-> this name) (the-as pointer #x70004000)) ) (run-now-in-process sv-112 manipy-init (-> arg0 root trans) s1-1 s2-0 #f 0) (-> sv-112 ppointer) @@ -180,23 +180,23 @@ ) (send-event (ppointer->process s0-1) 'mirror #t) (send-event (ppointer->process s0-1) 'anim-mode 'mirror) - (if (nonzero? (-> obj light-index)) - (send-event (ppointer->process s0-1) 'light-index (* (-> obj light-index) 8)) + (if (nonzero? (-> this light-index)) + (send-event (ppointer->process s0-1) 'light-index (* (-> this light-index) 8)) ) - (if (nonzero? (-> obj shadow-mask)) - (send-event (ppointer->process s0-1) 'shadow-mask (* (-> obj shadow-mask) 8)) + (if (nonzero? (-> this shadow-mask)) + (send-event (ppointer->process s0-1) 'shadow-mask (* (-> this shadow-mask) 8)) ) - (if (nonzero? (-> obj shadow-values)) - (send-event (ppointer->process s0-1) 'shadow-values (* (-> obj shadow-values) 8)) + (if (nonzero? (-> this shadow-values)) + (send-event (ppointer->process s0-1) 'shadow-values (* (-> this shadow-values) 8)) ) - (if (and s0-1 (not (logtest? (-> obj flags) 1)) (nonzero? (-> (the-as process-drawable (-> s0-1 0)) draw))) + (if (and s0-1 (not (logtest? (-> this flags) 1)) (nonzero? (-> (the-as process-drawable (-> s0-1 0)) draw))) (logior! (-> (the-as process-drawable (-> s0-1 0)) draw status) (draw-control-status no-draw-bounds)) ) - (if (-> obj shadow-volume-joint) - (send-event (ppointer->process s0-1) 'shadow-volume (-> obj shadow-volume-joint) (-> obj shadow-flags)) + (if (-> this shadow-volume-joint) + (send-event (ppointer->process s0-1) 'shadow-volume (-> this shadow-volume-joint) (-> this shadow-flags)) ) - (if (or (nonzero? (-> obj draw-seg)) (nonzero? (-> obj no-draw-seg))) - (send-event (ppointer->process s0-1) 'segment (* (-> obj draw-seg) 8) (* (-> obj no-draw-seg) 8)) + (if (or (nonzero? (-> this draw-seg)) (nonzero? (-> this no-draw-seg))) + (send-event (ppointer->process s0-1) 'segment (* (-> this draw-seg) 8) (* (-> this no-draw-seg) 8)) ) (when s3-0 (if (not (-> *setting-control* user-current beard)) @@ -206,18 +206,18 @@ ) ) ) - (when (nonzero? (-> obj camera)) + (when (nonzero? (-> this camera)) (cond ((handle->process (-> arg0 camera)) (change-parent (handle->process (-> arg0 camera)) (ppointer->process s4-0)) (send-event (handle->process (-> arg0 camera)) 'target (ppointer->process s4-0)) - (send-event (handle->process (-> arg0 camera)) 'joint (* (-> obj camera) 8)) + (send-event (handle->process (-> arg0 camera)) 'joint (* (-> this camera) 8)) ) (else (set! (-> arg0 camera) (ppointer->handle (process-spawn othercam (ppointer->process s4-0) - (-> obj camera) + (-> this camera) #t 'scene-player :to (ppointer->process s4-0) @@ -236,37 +236,37 @@ s4-0 ) -(defmethod deactivate scene-player ((obj scene-player)) +(defmethod deactivate scene-player ((this scene-player)) (set! *scene-player* (the-as (pointer scene-player) #f)) (kill-persister *setting-control* (the-as engine-pers 'blackout) 'bg-a-force) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs scene-player. -(defmethod relocate scene-player ((obj scene-player) (arg0 int)) +(defmethod relocate scene-player ((this scene-player) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (let ((v1-2 (-> obj scene-list))) + (let ((v1-2 (-> this scene-list))) (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) (< (the-as int v1-2) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj scene-list) arg0) + (&+! (-> this scene-list) arg0) ) ) - (the-as scene-player ((method-of-type process-drawable relocate) obj arg0)) + (the-as scene-player ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod scene-player-method-25 scene-player ((obj scene-player) (arg0 float)) +(defmethod scene-player-method-25 scene-player ((this scene-player) (arg0 float)) (local-vars (v1-11 symbol) (v1-40 symbol) (s0-0 object) (s0-1 object)) - (dotimes (s4-0 (-> obj scene actor length)) - (let ((s3-0 (-> obj scene actor s4-0))) + (dotimes (s4-0 (-> this scene actor length)) + (let ((s3-0 (-> this scene actor s4-0))) (let* ((s2-0 (-> s3-0 draw-frames)) (s1-0 (car s2-0)) ) @@ -290,7 +290,7 @@ (cond (v1-11 (if (not (handle->process (-> s3-0 process))) - (set! (-> s3-0 process) (ppointer->handle (scene-actor-method-9 s3-0 obj))) + (set! (-> s3-0 process) (ppointer->handle (scene-actor-method-9 s3-0 this))) ) (let ((s2-1 (handle->process (-> s3-0 process)))) (when (and s2-1 (nonzero? (-> (the-as process-drawable s2-1) draw))) @@ -373,7 +373,7 @@ ) ;; WARN: Return type mismatch basic vs scene. -(defmethod scene-player-method-24 scene-player ((obj scene-player) (arg0 basic) (arg1 symbol)) +(defmethod scene-player-method-24 scene-player ((this scene-player) (arg0 basic) (arg1 symbol)) "TODO - arg1 can be string/scene" (when (= (-> arg0 type) string) (let ((v1-2 (scene-lookup arg0))) @@ -388,16 +388,16 @@ ) (when arg1 (let ((s4-1 (get-level-by-heap-ptr-and-status *level* (the-as pointer arg0) 'active))) - (scene-method-15 (the-as scene arg0) (-> obj anim)) - (set! (-> obj level) s4-1) + (scene-method-15 (the-as scene arg0) (-> this anim)) + (set! (-> this level) s4-1) ) - (set! (-> obj scene) (the-as scene arg0)) + (set! (-> this scene) (the-as scene arg0)) ) (the-as scene arg0) ) -(defmethod scene-player-method-23 scene-player ((obj scene-player) (arg0 string) (arg1 symbol)) - (let ((gp-0 (scene-player-method-24 obj arg0 #t))) +(defmethod scene-player-method-23 scene-player ((this scene-player) (arg0 string) (arg1 symbol)) + (let ((gp-0 (scene-player-method-24 this arg0 #t))) (when (-> gp-0 peaceful) (let ((s3-0 *traffic-manager*)) (send-event s3-0 'decrease-alert-level 0) @@ -410,15 +410,15 @@ (format 0 "ERROR: SCENE: scene ~A can not find entity ~A~%" (-> gp-0 name) (-> gp-0 entity)) (go process-drawable-art-error (-> gp-0 entity)) ) - (set! (-> obj main-entity) (the-as entity-actor s3-1)) + (set! (-> this main-entity) (the-as entity-actor s3-1)) (cond (s3-1 - (process-drawable-from-entity! obj (-> obj main-entity)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this (-> this main-entity)) + (logclear! (-> this mask) (process-mask actor-pause)) ) (else - (vector-reset! (-> obj root trans)) - (quaternion-identity! (-> obj root quat)) + (vector-reset! (-> this root trans)) + (quaternion-identity! (-> this root quat)) ) ) ) @@ -427,36 +427,36 @@ (format 0 "ERROR: SCENE: scene ~A can not find art-group ~A~%" (-> gp-0 name) (-> gp-0 art-group)) (go process-drawable-art-error (-> gp-0 art-group)) ) - (set! (-> obj draw art-group) s3-2) + (set! (-> this draw art-group) s3-2) (countdown (v1-33 (-> s3-2 length)) (when (-> s3-2 data v1-33) (cond ((= (-> s3-2 data v1-33 type) merc-ctrl) - (set! (-> obj draw mgeo) (the-as merc-ctrl (-> s3-2 data v1-33))) + (set! (-> this draw mgeo) (the-as merc-ctrl (-> s3-2 data v1-33))) ) ((= (-> s3-2 data v1-33 type) art-joint-geo) - (set! (-> obj draw jgeo) (the-as art-joint-geo (-> s3-2 data v1-33))) + (set! (-> this draw jgeo) (the-as art-joint-geo (-> s3-2 data v1-33))) ) ) ) ) ) (cond - ((< (+ (-> obj scene-index) 1) (-> obj scene-list length)) - (let ((a0-34 (scene-player-method-24 obj (-> obj scene-list (+ (-> obj scene-index) 1)) #f))) + ((< (+ (-> this scene-index) 1) (-> this scene-list length)) + (let ((a0-34 (scene-player-method-24 this (-> this scene-list (+ (-> this scene-index) 1)) #f))) (cond (a0-34 - (scene-method-15 a0-34 (-> obj next-anim)) + (scene-method-15 a0-34 (-> this next-anim)) ) (else - (set! (-> obj next-anim anim-name) (the-as basic 0)) + (set! (-> this next-anim anim-name) (the-as basic 0)) 0 ) ) ) ) (else - (set! (-> obj next-anim anim-name) (the-as basic 0)) + (set! (-> this next-anim anim-name) (the-as basic 0)) 0 ) ) @@ -501,12 +501,12 @@ ) ) ) - (process-entity-status! obj (entity-perm-status no-kill) #t) + (process-entity-status! this (entity-perm-status no-kill) #t) (when arg1 (set-setting! 'region-mode #f 0.0 0) (set-setting! 'process-mask 'set 0.0 (-> gp-0 mask-to-clear)) (set-setting! 'sound-bank-load #f 0.0 0) - (set-setting! 'movie (process->ppointer obj) 0.0 0) + (set-setting! 'movie (process->ppointer this) 0.0 0) (set-setting! 'movie-name (-> gp-0 name) 0.0 0) (set-setting! 'music-volume @@ -1630,11 +1630,11 @@ (none) ) -(defmethod scene-method-16 scene ((obj scene)) +(defmethod scene-method-16 scene ((this scene)) (let ((v1-1 (-> *level* loading-level))) (if v1-1 - (set-loaded-art (-> v1-1 art-group) obj) + (set-loaded-art (-> v1-1 art-group) this) ) ) - obj + this ) diff --git a/goal_src/jak2/engine/sound/gsound.gc b/goal_src/jak2/engine/sound/gsound.gc index 9d01ea1957..feae1c1f79 100644 --- a/goal_src/jak2/engine/sound/gsound.gc +++ b/goal_src/jak2/engine/sound/gsound.gc @@ -14,7 +14,7 @@ :flag-assert #xf00000020 ) -(defmethod kill-callback engine-sound-pers ((obj engine-sound-pers) (arg0 connection-pers)) +(defmethod kill-callback engine-sound-pers ((this engine-sound-pers) (arg0 connection-pers)) (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) (set! (-> v1-0 id) (the-as sound-id (-> arg0 param-int64 0))) @@ -665,38 +665,38 @@ otherwise, an explicit [[vector]] can be provided" ) ) -(defmethod update! ambient-sound ((obj ambient-sound)) +(defmethod update! ambient-sound ((this ambient-sound)) (with-pp (if (not *ambient-sound-class*) (return (the-as int #f)) ) (cond - ((-> obj spec) - (when (or (< (-> obj time-base) 0) (>= (current-time) (-> obj play-time))) - (when (>= (-> obj time-base) 0) - (set! (-> obj play-time) - (+ (current-time) (-> obj time-base) (rand-vu-int-count (the-as int (-> obj time-random)))) + ((-> this spec) + (when (or (< (-> this time-base) 0) (>= (current-time) (-> this play-time))) + (when (>= (-> this time-base) 0) + (set! (-> this play-time) + (+ (current-time) (-> this time-base) (rand-vu-int-count (the-as int (-> this time-random)))) ) - (set! (-> obj playing-id) (new-sound-id)) + (set! (-> this playing-id) (new-sound-id)) ) - (let ((s5-1 (-> obj spec))) + (let ((s5-1 (-> this spec))) (when (= s5-1 *ambient-spec*) - (set! (-> s5-1 volume) (-> obj volume)) - (set! (-> s5-1 pitch-mod) (-> obj pitch)) + (set! (-> s5-1 volume) (-> this volume)) + (set! (-> s5-1 pitch-mod) (-> this pitch)) (set! (-> s5-1 bend) 0) - (set! (-> s5-1 sound-name) (-> obj name)) - (set! (-> s5-1 fo-max) (-> obj falloff-far)) + (set! (-> s5-1 sound-name) (-> this name)) + (set! (-> s5-1 fo-max) (-> this falloff-far)) (set! (-> s5-1 mask) (sound-mask)) - (if (-> obj params) - (effect-param->sound-spec s5-1 (-> obj params) (-> obj param-count) (the-as process-focusable pp)) + (if (-> this params) + (effect-param->sound-spec s5-1 (-> this params) (-> this param-count) (the-as process-focusable pp)) ) ) (let ((v1-23 (-> s5-1 fo-max))) - (if (and (nonzero? v1-23) (< (* 4096.0 (the float v1-23)) (vector-vector-distance (ear-trans 0) (-> obj trans)))) + (if (and (nonzero? v1-23) (< (* 4096.0 (the float v1-23)) (vector-vector-distance (ear-trans 0) (-> this trans)))) (return 0) ) ) - (when (and *debug-effect-control* (>= (-> obj time-base) 0)) + (when (and *debug-effect-control* (>= (-> this time-base) 0)) (format #t "(~5D) effect sound ~A ~G " (current-time) (-> pp name) (&-> s5-1 sound-name)) (format #t @@ -706,45 +706,45 @@ otherwise, an explicit [[vector]] can be provided" ) ) (let ((s4-2 (-> s5-1 volume))) - (set! (-> s5-1 volume) (-> obj volume)) - (set! (-> obj playing-id) (sound-play-by-spec s5-1 (-> obj playing-id) (-> obj trans))) + (set! (-> s5-1 volume) (-> this volume)) + (set! (-> this playing-id) (sound-play-by-spec s5-1 (-> this playing-id) (-> this trans))) (set! (-> s5-1 volume) s4-2) ) ) ) ) - ((< (-> obj time-base) 0) - (let ((v1-39 (-> obj falloff-far))) - (if (and (nonzero? v1-39) (< (* 4096.0 (the float v1-39)) (vector-vector-distance (ear-trans 0) (-> obj trans)))) + ((< (-> this time-base) 0) + (let ((v1-39 (-> this falloff-far))) + (if (and (nonzero? v1-39) (< (* 4096.0 (the float v1-39)) (vector-vector-distance (ear-trans 0) (-> this trans)))) (return 0) ) ) - (set! (-> obj playing-id) (sound-play-by-name - (-> obj name) - (-> obj playing-id) - (-> obj volume) - (-> obj pitch) + (set! (-> this playing-id) (sound-play-by-name + (-> this name) + (-> this playing-id) + (-> this volume) + (-> this pitch) 0 (sound-group sfx) - (-> obj trans) + (-> this trans) ) ) ) (else - (when (>= (current-time) (-> obj play-time)) - (set! (-> obj playing-id) + (when (>= (current-time) (-> this play-time)) + (set! (-> this playing-id) (sound-play-by-name - (-> obj name) + (-> this name) (new-sound-id) - (-> obj volume) - (-> obj pitch) + (-> this volume) + (-> this pitch) 0 (sound-group sfx) - (-> obj trans) + (-> this trans) ) ) - (set! (-> obj play-time) - (+ (current-time) (-> obj time-base) (rand-vu-int-count (the-as int (-> obj time-random)))) + (set! (-> this play-time) + (+ (current-time) (-> this time-base) (rand-vu-int-count (the-as int (-> this time-random)))) ) ) ) @@ -753,19 +753,19 @@ otherwise, an explicit [[vector]] can be provided" ) ) -(defmethod stop! ambient-sound ((obj ambient-sound)) - (sound-stop (-> obj playing-id)) +(defmethod stop! ambient-sound ((this ambient-sound)) + (sound-stop (-> this playing-id)) 0 ) -(defmethod update-trans! ambient-sound ((obj ambient-sound) (arg0 vector)) +(defmethod update-trans! ambient-sound ((this ambient-sound) (arg0 vector)) (with-pp - (set! (-> obj trans quad) (-> arg0 quad)) - (when (nonzero? (-> obj playing-id)) + (set! (-> this trans quad) (-> arg0 quad)) + (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) - (set! (-> s5-0 id) (-> obj playing-id)) + (set! (-> s5-0 id) (-> this playing-id)) (let ((s4-1 (the-as process-drawable pp))) (when (= arg0 #t) (if (and s4-1 (type? s4-1 process-drawable) (nonzero? (-> s4-1 root))) @@ -784,50 +784,50 @@ otherwise, an explicit [[vector]] can be provided" ) ) -(defmethod update-vol! ambient-sound ((obj ambient-sound) (arg0 float)) - (when (nonzero? (-> obj playing-id)) +(defmethod update-vol! ambient-sound ((this ambient-sound) (arg0 float)) + (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-4 command) (sound-command set-param)) - (set! (-> v1-4 id) (-> obj playing-id)) + (set! (-> v1-4 id) (-> this playing-id)) (set! (-> v1-4 params volume) (the int (* 1024.0 arg0))) (set! (-> v1-4 params mask) (the-as uint 1)) (-> v1-4 id) ) ) ) - (set! (-> obj volume) (the int (* 1024.0 arg0))) + (set! (-> this volume) (the int (* 1024.0 arg0))) 0 ) -(defmethod update-pitch-mod! ambient-sound ((obj ambient-sound) (arg0 float)) - (when (nonzero? (-> obj playing-id)) +(defmethod update-pitch-mod! ambient-sound ((this ambient-sound) (arg0 float)) + (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-4 command) (sound-command set-param)) - (set! (-> v1-4 id) (-> obj playing-id)) + (set! (-> v1-4 id) (-> this playing-id)) (set! (-> v1-4 params pitch-mod) (the int (* 1524.0 arg0))) (set! (-> v1-4 params mask) (the-as uint 2)) (-> v1-4 id) ) ) ) - (set! (-> obj pitch) (the int (* 1524.0 arg0))) + (set! (-> this pitch) (the int (* 1524.0 arg0))) 0 (none) ) -(defmethod set-falloff-far! ambient-sound ((obj ambient-sound) (arg0 float)) - (set! (-> obj falloff-far) (the int (* 0.00024414062 arg0))) +(defmethod set-falloff-far! ambient-sound ((this ambient-sound) (arg0 float)) + (set! (-> this falloff-far) (the int (* 0.00024414062 arg0))) 0 (none) ) -(defmethod change-sound! ambient-sound ((obj ambient-sound) (arg0 sound-name)) - (when (not (and (= (the-as uint (-> obj name)) (the-as uint arg0)) (= (-> arg0 hi) (-> obj name hi)))) - (stop! obj) - (set! (-> obj playing-id) (new-sound-id)) - (set! (-> obj name) arg0) +(defmethod change-sound! ambient-sound ((this ambient-sound) (arg0 sound-name)) + (when (not (and (= (the-as uint (-> this name)) (the-as uint arg0)) (= (-> arg0 hi) (-> this name hi)))) + (stop! this) + (set! (-> this playing-id) (new-sound-id)) + (set! (-> this name) arg0) ) 0 ) diff --git a/goal_src/jak2/engine/sound/speech.gc b/goal_src/jak2/engine/sound/speech.gc index bc26343ff3..204f7a06c6 100644 --- a/goal_src/jak2/engine/sound/speech.gc +++ b/goal_src/jak2/engine/sound/speech.gc @@ -7,58 +7,58 @@ ;; DECOMP BEGINS -(defmethod speech-channel-method-12 speech-channel ((obj speech-channel)) - (set! (-> obj request handle) (the-as handle #f)) - (set! (-> obj request priority) -10000000000000000000000000000000000000.0) +(defmethod speech-channel-method-12 speech-channel ((this speech-channel)) + (set! (-> this request handle) (the-as handle #f)) + (set! (-> this request priority) -10000000000000000000000000000000000000.0) 0 (none) ) -(defmethod speech-channel-method-13 speech-channel ((obj speech-channel)) - (set! (-> obj id) (new 'static 'sound-id)) - (set! (-> obj last-request handle) (the-as handle #f)) - (set! (-> obj last-request priority) -10000000000000000000000000000000000000.0) +(defmethod speech-channel-method-13 speech-channel ((this speech-channel)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) + (set! (-> this last-request priority) -10000000000000000000000000000000000000.0) 0 (none) ) -(defmethod speech-channel-method-11 speech-channel ((obj speech-channel)) +(defmethod speech-channel-method-11 speech-channel ((this speech-channel)) (local-vars (v1-44 int)) (with-pp - (logclear! (-> obj flags) (speech-channel-flag disable)) + (logclear! (-> this flags) (speech-channel-flag disable)) (if (or (not (-> *setting-control* user-current speech-control)) (load-in-progress? *level*) - (nonzero? (-> obj id)) + (nonzero? (-> this id)) ) - (logior! (-> obj flags) (speech-channel-flag disable)) + (logior! (-> this flags) (speech-channel-flag disable)) ) - (set! (-> obj target-pos quad) (-> (target-pos 0) quad)) - (when (not (logtest? (-> obj flags) (speech-channel-flag disable))) - (let ((s5-1 (-> obj speech-table (-> obj request speech-type)))) + (set! (-> this target-pos quad) (-> (target-pos 0) quad)) + (when (not (logtest? (-> this flags) (speech-channel-flag disable))) + (let ((s5-1 (-> this speech-table (-> this request speech-type)))) (cond (s5-1 - (let ((a0-8 (- (-> obj update-time) (-> obj request time))) - (v1-20 (handle->process (-> obj request handle))) + (let ((a0-8 (- (-> this update-time) (-> this request time))) + (v1-20 (handle->process (-> this request handle))) ) (if (or (< (the-as time-frame (-> s5-1 request-timeout)) a0-8) (or (not v1-20) (let ((f0-0 245760.0)) (< (* f0-0 f0-0) - (vector-vector-distance-squared (-> obj target-pos) (-> (the-as process-drawable v1-20) root trans)) + (vector-vector-distance-squared (-> this target-pos) (-> (the-as process-drawable v1-20) root trans)) ) ) ) ) - (speech-channel-method-12 obj) + (speech-channel-method-12 this) ) ) - (let ((s4-0 (handle->process (-> obj request handle)))) + (let ((s4-0 (handle->process (-> this request handle)))) (when s4-0 - (when (or (and (>= (-> obj request priority) 0.0) - (>= (- (current-time) (-> obj end-time)) (the-as time-frame (-> s5-1 delay))) + (when (or (and (>= (-> this request priority) 0.0) + (>= (- (current-time) (-> this end-time)) (the-as time-frame (-> s5-1 delay))) ) - (and (>= (- (current-time) (-> obj end-time)) (the-as time-frame (-> s5-1 delay))) - (>= (- (current-time) (-> obj end-time)) (the-as time-frame (-> obj delay))) + (and (>= (- (current-time) (-> this end-time)) (the-as time-frame (-> s5-1 delay))) + (>= (- (current-time) (-> this end-time)) (the-as time-frame (-> this delay))) ) ) (let ((s3-0 (-> s5-1 list length)) @@ -84,16 +84,16 @@ ) (set! (-> s5-1 play-index) v1-44) (let ((s3-1 (-> s5-1 list v1-44))) - (mem-copy! (the-as pointer (-> obj last-request)) (the-as pointer (-> obj request)) 21) - (set! (-> obj start-time) (current-time)) - (set! (-> obj delay) + (mem-copy! (the-as pointer (-> this last-request)) (the-as pointer (-> this request)) 21) + (set! (-> this start-time) (current-time)) + (set! (-> this delay) (the-as uint (rand-vu-int-range (the-as int (-> s5-1 min-delay)) (the-as int (-> s5-1 max-delay)))) ) - (set! (-> s5-1 delay) (-> obj delay)) - (set! (-> obj id) (add-process *gui-control* s4-0 (-> obj gui-channel) (gui-action play) s3-1 -99.0 0)) + (set! (-> s5-1 delay) (-> this delay)) + (set! (-> this id) (add-process *gui-control* s4-0 (-> this gui-channel) (gui-action play) s3-1 -99.0 0)) ) - (speech-channel-method-12 obj) - (logior! (-> obj flags) (speech-channel-flag disable)) + (speech-channel-method-12 this) + (logior! (-> this flags) (speech-channel-flag disable)) ) ) ) @@ -101,20 +101,20 @@ ) ) (else - (speech-channel-method-12 obj) + (speech-channel-method-12 this) ) ) ) ) - (set! (-> obj update-time) (current-time)) - (when (nonzero? (-> obj id)) - (let ((s4-1 (handle->process (-> obj last-request handle)))) + (set! (-> this update-time) (current-time)) + (when (nonzero? (-> this id)) + (let ((s4-1 (handle->process (-> this last-request handle)))) (cond ((and s4-1 (-> *setting-control* user-current speech-control)) (when *sound-player-enable* (let ((s5-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-2 command) (sound-command set-param)) - (set! (-> s5-2 id) (-> obj id)) + (set! (-> s5-2 id) (-> this id)) (set! (-> s5-2 params fo-min) 15) (set! (-> s5-2 params fo-max) 90) (set! (-> s5-2 params fo-curve) 9) @@ -138,39 +138,39 @@ (set-action! *gui-control* (gui-action stop) - (-> obj id) + (-> this id) (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj id) (new 'static 'sound-id)) + (set! (-> this id) (new 'static 'sound-id)) 0 ) ) ) - (case (get-status *gui-control* (-> obj id)) + (case (get-status *gui-control* (-> this id)) (((gui-status pending)) - (when (>= (- (current-time) (-> obj start-time)) (seconds 1)) + (when (>= (- (current-time) (-> this start-time)) (seconds 1)) (set-action! *gui-control* (gui-action stop) - (-> obj id) + (-> this id) (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj id) (new 'static 'sound-id)) - (set! (-> obj end-time) (-> obj update-time)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this end-time) (-> this update-time)) ) ) (((gui-status unknown)) - (set! (-> obj id) (new 'static 'sound-id)) - (set! (-> obj last-request handle) (the-as handle #f)) - (set! (-> obj end-time) (-> obj update-time)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) + (set! (-> this end-time) (-> this update-time)) ) ) ) @@ -179,20 +179,20 @@ ) ) -(defmethod speech-channel-method-9 speech-channel ((obj speech-channel) (arg0 process-drawable) (arg1 speech-type)) - (let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> obj target-pos))) +(defmethod speech-channel-method-9 speech-channel ((this speech-channel) (arg0 process-drawable) (arg1 speech-type)) + (let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> this target-pos))) (f1-0 245760.0) ) (when (< f0-0 (* f1-0 f1-0)) (let* ((f1-3 -1.0) (f2-0 409600.0) - (f0-2 (+ (* f0-0 (/ f1-3 (* f2-0 f2-0))) (the float (-> obj speech-table arg1 priority)))) + (f0-2 (+ (* f0-0 (/ f1-3 (* f2-0 f2-0))) (the float (-> this speech-table arg1 priority)))) ) - (when (< (-> obj request priority) f0-2) - (set! (-> obj request priority) f0-2) - (set! (-> obj request handle) (process->handle arg0)) - (set! (-> obj request speech-type) arg1) - (set! (-> obj request time) (current-time)) + (when (< (-> this request priority) f0-2) + (set! (-> this request priority) f0-2) + (set! (-> this request handle) (process->handle arg0)) + (set! (-> this request speech-type) arg1) + (set! (-> this request time) (current-time)) ) ) ) @@ -201,29 +201,29 @@ (none) ) -(defmethod speech-channel-method-10 speech-channel ((obj speech-channel) (arg0 handle)) - (when (= arg0 (handle->process (-> obj last-request handle))) +(defmethod speech-channel-method-10 speech-channel ((this speech-channel) (arg0 handle)) + (when (= arg0 (handle->process (-> this last-request handle))) (set-action! *gui-control* (gui-action stop) - (-> obj id) + (-> this id) (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj id) (new 'static 'sound-id)) - (set! (-> obj last-request handle) (the-as handle #f)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) ) 0 (none) ) -(defmethod speech-control-method-12 speech-control ((obj speech-control) (arg0 process-drawable) (arg1 speech-type)) - (let ((v1-2 (-> obj speech-table arg1))) +(defmethod speech-control-method-12 speech-control ((this speech-control) (arg0 process-drawable) (arg1 speech-type)) + (let ((v1-2 (-> this speech-table arg1))) (when v1-2 - (let ((a0-1 (-> obj channel-array (-> v1-2 channel)))) + (let ((a0-1 (-> this channel-array (-> v1-2 channel)))) (if (not (logtest? (-> a0-1 flags) (speech-channel-flag disable))) (speech-channel-method-9 a0-1 arg0 arg1) ) @@ -234,57 +234,57 @@ (none) ) -(defmethod speech-control-method-11 speech-control ((obj speech-control)) +(defmethod speech-control-method-11 speech-control ((this speech-control)) (dotimes (s5-0 2) - (speech-channel-method-11 (-> obj channel-array s5-0)) + (speech-channel-method-11 (-> this channel-array s5-0)) ) 0 (none) ) -(defmethod speech-table-set! speech-control ((obj speech-control) (arg0 speech-type) (arg1 speech-type-info)) - (set! (-> obj speech-table arg0) arg1) +(defmethod speech-table-set! speech-control ((this speech-control) (arg0 speech-type) (arg1 speech-type-info)) + (set! (-> this speech-table arg0) arg1) 0 (none) ) -(defmethod speech-control-method-13 speech-control ((obj speech-control) (arg0 handle)) +(defmethod speech-control-method-13 speech-control ((this speech-control) (arg0 handle)) (dotimes (s4-0 2) - (speech-channel-method-10 (-> obj channel-array s4-0) arg0) + (speech-channel-method-10 (-> this channel-array s4-0) arg0) ) 0 (none) ) -(defmethod speech-control-method-14 speech-control ((obj speech-control)) - (speech-control-method-9 obj) - (let ((s5-0 (-> obj channel-array))) +(defmethod speech-control-method-14 speech-control ((this speech-control)) + (speech-control-method-9 this) + (let ((s5-0 (-> this channel-array))) ((method-of-type speech-channel speech-channel-method-13) (the-as speech-channel s5-0)) - (set! (-> s5-0 0 speech-table) (-> obj speech-table)) + (set! (-> s5-0 0 speech-table) (-> this speech-table)) (set! (-> s5-0 0 gui-channel) (gui-channel guard)) ) - (let ((s5-1 (-> obj channel-array 1))) + (let ((s5-1 (-> this channel-array 1))) (speech-channel-method-13 s5-1) - (set! (-> s5-1 speech-table) (-> obj speech-table)) + (set! (-> s5-1 speech-table) (-> this speech-table)) (set! (-> s5-1 gui-channel) (gui-channel citizen)) ) 0 (none) ) -(defmethod speech-control-method-15 speech-control ((obj speech-control) (arg0 process-drawable)) - (when (not (logtest? (-> obj channel-array 0 flags) (speech-channel-flag disable))) +(defmethod speech-control-method-15 speech-control ((this speech-control) (arg0 process-drawable)) + (when (not (logtest? (-> this channel-array 0 flags) (speech-channel-flag disable))) (let ((v1-3 *target*)) (when v1-3 (cond ((focus-test? v1-3 dark) - (speech-control-method-12 obj arg0 (speech-type speech-type-8)) + (speech-control-method-12 this arg0 (speech-type speech-type-8)) ) ((focus-test? v1-3 pilot) - (speech-control-method-12 obj arg0 (speech-type speech-type-7)) + (speech-control-method-12 this arg0 (speech-type speech-type-7)) ) (else - (speech-control-method-12 obj arg0 (speech-type speech-type-6)) + (speech-control-method-12 this arg0 (speech-type speech-type-6)) ) ) ) @@ -294,7 +294,7 @@ (none) ) -(defmethod speech-control-method-16 speech-control ((obj speech-control)) +(defmethod speech-control-method-16 speech-control ((this speech-control)) (set-action! *gui-control* (gui-action stop) @@ -316,20 +316,20 @@ (the-as process #f) ) (dotimes (s5-0 2) - (speech-channel-method-12 (-> obj channel-array s5-0)) + (speech-channel-method-12 (-> this channel-array s5-0)) ) 0 (none) ) -(defmethod speech-control-method-9 speech-control ((obj speech-control)) +(defmethod speech-control-method-9 speech-control ((this speech-control)) (dotimes (v1-0 57) - (set! (-> obj speech-table v1-0) #f) + (set! (-> this speech-table v1-0) #f) ) (dotimes (s5-0 2) - (speech-channel-method-12 (-> obj channel-array s5-0)) + (speech-channel-method-12 (-> this channel-array s5-0)) ) - (speech-table-set! obj (speech-type speech-type-0) (new 'static 'speech-type-info + (speech-table-set! this (speech-type speech-type-0) (new 'static 'speech-type-info :priority 3 :request-timeout #x12c :min-delay (seconds 1) @@ -337,7 +337,7 @@ :list (new 'static 'boxed-array :type string) ) ) - (speech-table-set! obj (speech-type speech-type-3) (new 'static 'speech-type-info + (speech-table-set! this (speech-type speech-type-3) (new 'static 'speech-type-info :priority 3 :request-timeout #x12c :min-delay (seconds 1) @@ -359,7 +359,7 @@ ) ) ) - (speech-table-set! obj (speech-type speech-type-9) (new 'static 'speech-type-info + (speech-table-set! this (speech-type speech-type-9) (new 'static 'speech-type-info :priority 1 :min-delay (seconds 2) :max-delay (seconds 4) @@ -421,7 +421,7 @@ ) ) ) - (speech-table-set! obj (speech-type speech-type-10) (new 'static 'speech-type-info + (speech-table-set! this (speech-type speech-type-10) (new 'static 'speech-type-info :flags (speech-type-flag random-order) :priority 10 :request-timeout #x258 @@ -465,7 +465,7 @@ ) ) ) - (speech-table-set! obj (speech-type speech-type-11) (new 'static 'speech-type-info + (speech-table-set! this (speech-type speech-type-11) (new 'static 'speech-type-info :priority 2 :min-delay (seconds 0.1) :max-delay (seconds 0.1) diff --git a/goal_src/jak2/engine/spatial-hash/actor-hash.gc b/goal_src/jak2/engine/spatial-hash/actor-hash.gc index f67f481dd6..c3e311b280 100644 --- a/goal_src/jak2/engine/spatial-hash/actor-hash.gc +++ b/goal_src/jak2/engine/spatial-hash/actor-hash.gc @@ -8,7 +8,9 @@ ;; DECOMP BEGINS (kmemopen global "actor-hash") + (define *actor-hash* (new 'global 'spatial-hash 4096 256)) + (kmemclose) (deftype actor-cshape-ptr (structure) @@ -19,6 +21,7 @@ :flag-assert #x900000004 ) + (deftype actor-hash-bucket (structure) ((length int16 :offset-assert 0) (max-length int16 :offset-assert 2) @@ -33,11 +36,12 @@ ) ) -(defmethod add-actor-cshape actor-hash-bucket ((obj actor-hash-bucket) (arg0 collide-shape)) - (let ((v1-0 (-> obj length))) - (when (< v1-0 (-> obj max-length)) - (set! (-> obj data v1-0 cshape) arg0) - (set! (-> obj length) (+ v1-0 1)) + +(defmethod add-actor-cshape actor-hash-bucket ((this actor-hash-bucket) (arg0 collide-shape)) + (let ((v1-0 (-> this length))) + (when (< v1-0 (-> this max-length)) + (set! (-> this data v1-0 cshape) arg0) + (set! (-> this length) (+ v1-0 1)) ) ) 0 @@ -58,19 +62,20 @@ ) ) -(defmethod hash-actors actor-hash-buckets ((obj actor-hash-buckets)) + +(defmethod hash-actors actor-hash-buckets ((this actor-hash-buckets)) (local-vars (sv-16 hash-object-info) (sv-32 collide-prim-core) (sv-48 collide-shape) (sv-64 hash-object-info)) - (set! (-> obj hash) *actor-hash*) - (set! (-> obj list) *collide-hit-by-others-list*) - (clear-objects! (-> obj hash)) + (set! (-> this hash) *actor-hash*) + (set! (-> this list) *collide-hit-by-others-list*) + (clear-objects! (-> this hash)) (cond - ((>= 256 (-> obj list length)) - (let ((v1-5 (-> obj list alive-list next0))) - (-> obj list) + ((>= 256 (-> this list length)) + (let ((v1-5 (-> this list alive-list next0))) + (-> this list) (let ((s5-0 (-> v1-5 next0))) - (while (!= v1-5 (-> obj list alive-list-end)) + (while (!= v1-5 (-> this list alive-list-end)) (let* ((s4-0 (the-as collide-shape (-> (the-as connection v1-5) param1))) - (s3-0 (-> obj hash)) + (s3-0 (-> this hash)) (s1-0 (-> s4-0 root-prim prim-core)) (s0-0 s4-0) (s2-0 (-> s3-0 object-count)) @@ -102,55 +107,55 @@ (set! (-> s4-0 actor-hash-index) s2-0) ) (set! v1-5 s5-0) - (-> obj list) + (-> this list) (set! s5-0 (-> s5-0 next0)) ) ) ) ) (else - (set! (-> obj tpos quad) (-> (target-pos 0) quad)) + (set! (-> this tpos quad) (-> (target-pos 0) quad)) (dotimes (v1-21 4) - (set! (-> obj data v1-21 length) 0) + (set! (-> this data v1-21 length) 0) ) - (let ((v1-25 (-> obj list alive-list next0))) - (-> obj list) + (let ((v1-25 (-> this list alive-list next0))) + (-> this list) (let ((s5-2 (-> v1-25 next0))) - (while (!= v1-25 (-> obj list alive-list-end)) + (while (!= v1-25 (-> this list alive-list-end)) (let* ((s4-1 (the-as collide-shape (-> (the-as connection v1-25) param1))) - (f0-4 (vector-vector-distance-squared (-> obj tpos) (-> s4-1 trans))) + (f0-4 (vector-vector-distance-squared (-> this tpos) (-> s4-1 trans))) (f1-4 102400.0) ) (cond ((< f0-4 (* f1-4 f1-4)) - ((method-of-type actor-hash-bucket add-actor-cshape) (the-as actor-hash-bucket (-> obj data)) s4-1) + ((method-of-type actor-hash-bucket add-actor-cshape) (the-as actor-hash-bucket (-> this data)) s4-1) ) ((let ((f1-7 204800.0)) (< f0-4 (* f1-7 f1-7)) ) - (add-actor-cshape (-> obj data 1) s4-1) + (add-actor-cshape (-> this data 1) s4-1) ) ((let ((f1-10 307200.0)) (< f0-4 (* f1-10 f1-10)) ) - (add-actor-cshape (-> obj data 2) s4-1) + (add-actor-cshape (-> this data 2) s4-1) ) (else - (add-actor-cshape (-> obj data 3) s4-1) + (add-actor-cshape (-> this data 3) s4-1) ) ) ) (set! v1-25 s5-2) - (-> obj list) + (-> this list) (set! s5-2 (-> s5-2 next0)) ) ) ) (dotimes (s5-3 4) - (let ((s4-2 (-> obj data s5-3))) + (let ((s4-2 (-> this data s5-3))) (countdown (s3-1 (-> s4-2 length)) (let ((s2-1 (-> s4-2 data s3-1 cshape)) - (s1-1 (-> obj hash)) + (s1-1 (-> this hash)) ) (set! sv-32 (-> s2-1 root-prim prim-core)) (set! sv-48 s2-1) @@ -187,7 +192,7 @@ ) ) ) - (update-from-spheres (-> obj hash)) + (update-from-spheres (-> this hash)) 0 (none) ) @@ -209,7 +214,3 @@ (read! (-> *perf-stats* data (perf-stat-bucket actor-hash))) (none) ) - - - - diff --git a/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc b/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc index 681f91dbe3..cb64567e71 100644 --- a/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc +++ b/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc @@ -28,6 +28,7 @@ :flag-assert #x900000804 ) + (deftype collide-hash-bucket (structure) ((index int16 :offset-assert 0) (count int16 :offset-assert 2) @@ -37,6 +38,7 @@ :flag-assert #x900000004 ) + (deftype collide-hash-item (structure) ((id uint32 :offset-assert 0) (collidable basic :offset-assert 4) @@ -47,6 +49,7 @@ :flag-assert #x900000008 ) + (deftype collide-hash-poly (structure) ((data uint8 4 :offset-assert 0) (vert-index0 uint8 :offset 0) @@ -60,6 +63,7 @@ :flag-assert #x900000004 ) + (deftype collide-hash-fragment-stats (structure) ((num-verts uint16 :offset-assert 0) (num-polys uint8 :offset-assert 2) @@ -71,6 +75,7 @@ :flag-assert #x900000004 ) + (deftype collide-hash-fragment (drawable) ((num-buckets uint16 :offset 4) (num-indices uint16 :offset 6) @@ -95,27 +100,30 @@ :flag-assert #x1100000070 ) + (deftype collide-hash-fragment-array (array) - ((fragments collide-hash-fragment :dynamic :offset 16)) + ((fragments collide-hash-fragment :dynamic :offset 16) + ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) + (deftype collide-hash (drawable) - ((num-ids uint16 :offset 4) - (id-count uint16 :offset 6) - (num-buckets uint32 :offset 8) - (qwc-id-bits uint32 :offset 12) - (grid-step vector :inline :offset 16) - (bbox bounding-box :inline :offset-assert 32) - (bbox4w bounding-box4w :inline :offset-assert 64) - (axis-scale vector :inline :offset 48) - (avg-extents vector :inline :offset 64) - (bucket-array uint32 :offset 44) - (item-array (inline-array collide-hash-item) :offset 60) - (dimension-array uint32 3 :offset 76) - (num-items uint32 :offset 92) + ((num-ids uint16 :offset 4) + (id-count uint16 :offset 6) + (num-buckets uint32 :offset 8) + (qwc-id-bits uint32 :offset 12) + (grid-step vector :inline :offset 16) + (bbox bounding-box :inline :offset-assert 32) + (bbox4w bounding-box4w :inline :offset-assert 64) + (axis-scale vector :inline :offset 48) + (avg-extents vector :inline :offset 64) + (bucket-array uint32 :offset 44) + (item-array (inline-array collide-hash-item) :offset 60) + (dimension-array uint32 3 :offset 76) + (num-items uint32 :offset 92) ) :method-count-assert 17 :size-assert #x60 diff --git a/goal_src/jak2/engine/spatial-hash/collide-hash.gc b/goal_src/jak2/engine/spatial-hash/collide-hash.gc index 9b6f219003..341c221623 100644 --- a/goal_src/jak2/engine/spatial-hash/collide-hash.gc +++ b/goal_src/jak2/engine/spatial-hash/collide-hash.gc @@ -514,47 +514,47 @@ the side length. ) ) -(defmethod mem-usage collide-hash ((obj collide-hash) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-hash ((this collide-hash) (arg0 memory-usage-block) (arg1 int)) "This one is a bit weird because it touches stuff in the scratchpad... It's called from the bsp-header's mem-usage function, so it should be fine." (set! (-> arg0 length) (max 51 (-> arg0 length))) (set! (-> arg0 data 50 name) (symbol->string 'collision)) (+! (-> arg0 data 50 count) 1) - (let ((v1-10 (+ (* (-> obj num-items) 8) 96 (* (-> obj num-buckets) 4)))) + (let ((v1-10 (+ (* (-> this num-items) 8) 96 (* (-> this num-buckets) 4)))) (+! (-> arg0 data 50 used) v1-10) (+! (-> arg0 data 50 total) (logand -16 (+ v1-10 15))) ) - (dotimes (v1-14 (the-as int (-> obj qwc-id-bits))) + (dotimes (v1-14 (the-as int (-> this qwc-id-bits))) (set! (-> (scratchpad-object collide-hash-scratch) collidable-bits v1-14) (the-as uint128 0)) ) - (dotimes (s3-0 (the-as int (-> obj num-items))) - (let* ((a0-12 (-> obj item-array s3-0 id)) + (dotimes (s3-0 (the-as int (-> this num-items))) + (let* ((a0-12 (-> this item-array s3-0 id)) (v1-19 (shr a0-12 5)) ) (when (not (logtest? (-> (scratchpad-object collide-hash-scratch) id-bits v1-19) (ash 1 (logand a0-12 31)))) (logior! (-> (scratchpad-object collide-hash-scratch) id-bits v1-19) (ash 1 (logand a0-12 31))) - (if (= (-> obj item-array s3-0 collidable type) collide-hash-fragment) - (mem-usage (-> obj item-array s3-0 collidable) arg0 arg1) + (if (= (-> this item-array s3-0 collidable type) collide-hash-fragment) + (mem-usage (-> this item-array s3-0 collidable) arg0 arg1) ) ) ) ) - obj + this ) -(defmethod mem-usage collide-hash-fragment ((obj collide-hash-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-hash-fragment ((this collide-hash-fragment) (arg0 memory-usage-block) (arg1 int)) (cond ((logtest? arg1 1) (set! (-> arg0 length) (max 58 (-> arg0 length))) (set! (-> arg0 data 55 name) (symbol->string 'prototype-fragment)) (+! (-> arg0 data 55 count) 1) (set! (-> arg0 data 56 name) (symbol->string 'prototype-poly)) - (+! (-> arg0 data 56 count) (the-as int (-> obj stats num-polys))) + (+! (-> arg0 data 56 count) (the-as int (-> this stats num-polys))) (set! (-> arg0 data 57 name) (symbol->string 'prototype-vertex)) - (+! (-> arg0 data 57 count) (the-as int (-> obj stats num-verts))) - (let ((a3-0 (+ (-> obj num-indices) 112 (* (-> obj num-buckets) 4))) - (a2-9 (* (-> obj stats num-polys) 4)) - (v1-22 (* (the-as uint 6) (the-as uint (-> obj stats num-verts)))) + (+! (-> arg0 data 57 count) (the-as int (-> this stats num-verts))) + (let ((a3-0 (+ (-> this num-indices) 112 (* (-> this num-buckets) 4))) + (a2-9 (* (-> this stats num-polys) 4)) + (v1-22 (* (the-as uint 6) (the-as uint (-> this stats num-verts)))) ) (+! (-> arg0 data 55 used) a3-0) (+! (-> arg0 data 55 total) (- (logand -16 (+ v1-22 15 a2-9 a3-0)) (the-as int (+ a2-9 v1-22)))) @@ -569,12 +569,12 @@ the side length. (set! (-> arg0 data 51 name) (symbol->string 'collision-fragment)) (+! (-> arg0 data 51 count) 1) (set! (-> arg0 data 52 name) (symbol->string 'collision-poly)) - (+! (-> arg0 data 52 count) (the-as int (-> obj stats num-polys))) + (+! (-> arg0 data 52 count) (the-as int (-> this stats num-polys))) (set! (-> arg0 data 53 name) (symbol->string 'collision-vertex)) - (+! (-> arg0 data 53 count) (the-as int (-> obj stats num-verts))) - (let ((a3-8 (+ (-> obj num-indices) 112 (* (-> obj num-buckets) 4))) - (a2-22 (* (-> obj stats num-polys) 4)) - (v1-45 (* (the-as uint 6) (the-as uint (-> obj stats num-verts)))) + (+! (-> arg0 data 53 count) (the-as int (-> this stats num-verts))) + (let ((a3-8 (+ (-> this num-indices) 112 (* (-> this num-buckets) 4))) + (a2-22 (* (-> this stats num-polys) 4)) + (v1-45 (* (the-as uint 6) (the-as uint (-> this stats num-verts)))) ) (+! (-> arg0 data 51 used) a3-8) (+! (-> arg0 data 51 total) (- (logand -16 (+ v1-45 15 a2-22 a3-8)) (the-as int (+ a2-22 v1-45)))) @@ -585,19 +585,19 @@ the side length. ) ) ) - obj + this ) -(defmethod mem-usage collide-hash-fragment-array ((obj collide-hash-fragment-array) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-hash-fragment-array ((this collide-hash-fragment-array) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 55 (-> arg0 length))) (set! (-> arg0 data 54 name) (symbol->string 'prototype-collision)) (+! (-> arg0 data 54 count) 1) - (let ((v1-8 (asize-of obj))) + (let ((v1-8 (asize-of this))) (+! (-> arg0 data 54 used) v1-8) (+! (-> arg0 data 54 total) (logand -16 (+ v1-8 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj fragments s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this fragments s3-0) arg0 arg1) ) - obj + this ) diff --git a/goal_src/jak2/engine/spatial-hash/spatial-hash.gc b/goal_src/jak2/engine/spatial-hash/spatial-hash.gc index 211545ce91..81084d1fad 100644 --- a/goal_src/jak2/engine/spatial-hash/spatial-hash.gc +++ b/goal_src/jak2/engine/spatial-hash/spatial-hash.gc @@ -52,13 +52,12 @@ ) ) - -(defmethod verify-bits-in-bucket grid-hash ((obj grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) +(defmethod verify-bits-in-bucket grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) (let ((s5-0 0)) 0 (let ((v1-1 8) - (a0-1 (-> obj object-count)) - (a1-2 (* (-> obj bucket-size) 8)) + (a0-1 (-> this object-count)) + (a1-2 (* (-> this bucket-size) 8)) ) (while (< a0-1 a1-2) (let ((a3-0 (- a0-1 (* (/ a0-1 v1-1) v1-1)))) @@ -67,8 +66,8 @@ (+! a0-1 1) ) ) - (dotimes (s4-0 (-> obj bucket-count)) - (let ((a3-2 (-> obj bucket-array (+ (-> obj bucket-size) -1 (* s4-0 (-> obj bucket-size)))))) + (dotimes (s4-0 (-> this bucket-count)) + (let ((a3-2 (-> this bucket-array (+ (-> this bucket-size) -1 (* s4-0 (-> this bucket-size)))))) (when (logtest? a3-2 s5-0) (format 0 "bad bits in bucket ~d bucket-word ~8x test-word ~8x~%" s4-0 a3-2 s5-0) (break!) @@ -81,18 +80,18 @@ (none) ) -(defmethod box-of-everything grid-hash ((obj grid-hash) (arg0 object) (arg1 grid-hash-box)) +(defmethod box-of-everything grid-hash ((this grid-hash) (arg0 object) (arg1 grid-hash-box)) (dotimes (v1-0 3) - (set! (-> arg1 min v1-0) (-> obj dimension-array v1-0)) + (set! (-> arg1 min v1-0) (-> this dimension-array v1-0)) (set! (-> arg1 max v1-0) -1) ) - (let* ((v1-3 (-> obj bucket-size)) - (a3-4 (* (-> obj dimension-array 0) v1-3)) - (t0-3 (* (-> obj dimension-array 2) a3-4)) - (t1-0 (-> obj dimension-array 0)) - (t2-0 (-> obj dimension-array 2)) - (t3-0 (-> obj dimension-array 1)) - (a0-2 (&-> (-> obj bucket-array) (/ (the-as int arg0) 8))) + (let* ((v1-3 (-> this bucket-size)) + (a3-4 (* (-> this dimension-array 0) v1-3)) + (t0-3 (* (-> this dimension-array 2) a3-4)) + (t1-0 (-> this dimension-array 0)) + (t2-0 (-> this dimension-array 2)) + (t3-0 (-> this dimension-array 1)) + (a0-2 (&-> (-> this bucket-array) (/ (the-as int arg0) 8))) (a1-2 (ash 1 (logand (the-as int arg0) 7))) ) (dotimes (t4-3 t3-0) @@ -121,6 +120,7 @@ (none) ) +;; WARN: Return type mismatch int vs symbol. (defun-debug validate-bucket-bits ((arg0 grid-hash) (arg1 (pointer grid-hash-word))) (let ((s3-0 (-> arg0 object-count)) (s2-0 (* (-> arg0 bucket-size) 8)) @@ -149,36 +149,29 @@ (the-as symbol 0) ) -;; definition for method 18 of type grid-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 18 grid-hash)" 18 grid-hash) -;; definition for method 19 of type grid-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 19 grid-hash)" 19 grid-hash) -;; definition for method 20 of type grid-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 20 grid-hash)" 20 grid-hash) - -(defmethod set-up-box grid-hash ((obj grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) +(defmethod set-up-box grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) (dotimes (v1-0 3) (set! (-> arg0 min v1-0) (the int (fmax 0.0 (fmin - (* (- (-> arg1 data v1-0) (-> obj box-min v1-0)) (-> obj axis-scale v1-0)) - (the float (+ (-> obj dimension-array v1-0) -1)) + (* (- (-> arg1 data v1-0) (-> this box-min v1-0)) (-> this axis-scale v1-0)) + (the float (+ (-> this dimension-array v1-0) -1)) ) ) ) ) (set! (-> arg0 max v1-0) (the int (fmax 0.0 (fmin - (* (- (-> arg2 data v1-0) (-> obj box-min v1-0)) (-> obj axis-scale v1-0)) - (the float (+ (-> obj dimension-array v1-0) -1)) + (* (- (-> arg2 data v1-0) (-> this box-min v1-0)) (-> this axis-scale v1-0)) + (the float (+ (-> this dimension-array v1-0) -1)) ) ) ) @@ -188,12 +181,9 @@ (none) ) -;; definition for method 22 of type grid-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 22 grid-hash)" 22 grid-hash) - -(defmethod line-sphere-to-grid-box grid-hash ((obj grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod line-sphere-to-grid-box grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) (let ((s4-0 (new 'stack-no-clear 'grid-hash-box)) (s5-0 (new 'stack-no-clear 'grid-hash-box)) ) @@ -204,8 +194,8 @@ (vector+! s2-0 arg1 arg2) (set! (-> v1-0 w) arg3) (set! (-> s2-0 w) arg3) - (sphere-to-grid-box obj s4-0 (the-as sphere v1-0)) - (sphere-to-grid-box obj s5-0 (the-as sphere s2-0)) + (sphere-to-grid-box this s4-0 (the-as sphere v1-0)) + (sphere-to-grid-box this s5-0 (the-as sphere s2-0)) ) (set! (-> arg0 min 0) (min (-> s4-0 min 0) (-> s5-0 min 0))) (set! (-> arg0 min 1) (min (-> s4-0 min 1) (-> s5-0 min 1))) @@ -218,16 +208,16 @@ (none) ) -(defmethod clear-bucket-array grid-hash ((obj grid-hash)) - (let ((v1-5 (/ (+ (* (* (* (-> obj dimension-array 0) (-> obj dimension-array 1)) (-> obj dimension-array 2)) - (-> obj bucket-size) +(defmethod clear-bucket-array grid-hash ((this grid-hash)) + (let ((v1-5 (/ (+ (* (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)) + (-> this bucket-size) ) 15 ) 16 ) ) - (a0-1 (the-as (pointer uinteger) (-> obj bucket-array))) + (a0-1 (the-as (pointer uinteger) (-> this bucket-array))) ) (while (nonzero? v1-5) (+! v1-5 -1) @@ -239,25 +229,25 @@ (none) ) -(defmethod update-grid grid-hash ((obj grid-hash)) +(defmethod update-grid grid-hash ((this grid-hash)) (let ((v1-0 (new 'stack-no-clear 'vector))) (dotimes (a1-0 3) - (set! (-> v1-0 data a1-0) (fmax (-> obj min-cell-size) (- (-> obj box-max a1-0) (-> obj box-min a1-0)))) + (set! (-> v1-0 data a1-0) (fmax (-> this min-cell-size) (- (-> this box-max a1-0) (-> this box-min a1-0)))) ) (b! - (and (> (-> obj object-count) 0) (< 0.0 (-> v1-0 x)) (< 0.0 (-> v1-0 y)) (< 0.0 (-> v1-0 z))) + (and (> (-> this object-count) 0) (< 0.0 (-> v1-0 x)) (< 0.0 (-> v1-0 y)) (< 0.0 (-> v1-0 z))) cfg-23 :delay (empty-form) ) - (set! (-> obj bucket-count) 1) - (set! (-> obj bucket-size) 1) + (set! (-> this bucket-count) 1) + (set! (-> this bucket-size) 1) (dotimes (v1-3 3) - (set! (-> obj box-min v1-3) 0.0) - (set! (-> obj box-max v1-3) 0.0) - (set! (-> obj axis-scale v1-3) 0.0) - (set! (-> obj dimension-array v1-3) 1) + (set! (-> this box-min v1-3) 0.0) + (set! (-> this box-max v1-3) 0.0) + (set! (-> this axis-scale v1-3) 0.0) + (set! (-> this dimension-array v1-3) 1) ) - (let* ((v1-6 obj) + (let* ((v1-6 this) (a0-6 (/ (+ (* (* (* (-> v1-6 dimension-array 0) (-> v1-6 dimension-array 1)) (-> v1-6 dimension-array 2)) (-> v1-6 bucket-size) @@ -279,21 +269,21 @@ (b! #t cfg-41 :delay (nop!)) (label cfg-23) (let ((a1-18 8)) - (set! (-> obj bucket-size) (/ (+ a1-18 -1 (-> obj object-count)) a1-18)) + (set! (-> this bucket-size) (/ (+ a1-18 -1 (-> this object-count)) a1-18)) ) - (set! (-> obj bucket-count) - (min (* (-> obj object-count) 16) (/ (-> obj bucket-memory-size) (-> obj bucket-size))) + (set! (-> this bucket-count) + (min (* (-> this object-count) 16) (/ (-> this bucket-memory-size) (-> this bucket-size))) ) (let ((f0-11 (sqrtf - (/ (the float (-> obj bucket-count)) (* (-> v1-0 x) (-> v1-0 z) (the float (-> obj vertical-cell-count)))) + (/ (the float (-> this bucket-count)) (* (-> v1-0 x) (-> v1-0 z) (the float (-> this vertical-cell-count)))) ) ) ) - (let ((a1-27 (min 126 (+ (-> obj bucket-count) -1)))) - (set! (-> obj dimension-array 0) (max 1 (min (the int (* f0-11 (-> v1-0 x))) a1-27))) - (set! (-> obj dimension-array 1) (-> obj vertical-cell-count)) - (set! (-> obj dimension-array 2) (max 1 (min (the int (* f0-11 (-> v1-0 z))) a1-27))) + (let ((a1-27 (min 126 (+ (-> this bucket-count) -1)))) + (set! (-> this dimension-array 0) (max 1 (min (the int (* f0-11 (-> v1-0 x))) a1-27))) + (set! (-> this dimension-array 1) (-> this vertical-cell-count)) + (set! (-> this dimension-array 2) (max 1 (min (the int (* f0-11 (-> v1-0 z))) a1-27))) ) (let* ((f1-15 (* f0-11 (-> v1-0 z))) (f1-17 (- f1-15 (the float (the int f1-15)))) @@ -301,17 +291,17 @@ ) (cond ((< f1-17 (- f0-12 (the float (the int f0-12)))) - (if (>= (-> obj bucket-count) - (* (* (+ (-> obj dimension-array 0) 1) (-> obj dimension-array 1)) (-> obj dimension-array 2)) + (if (>= (-> this bucket-count) + (* (* (+ (-> this dimension-array 0) 1) (-> this dimension-array 1)) (-> this dimension-array 2)) ) - (+! (-> obj dimension-array 0) 1) + (+! (-> this dimension-array 0) 1) ) ) (else - (if (>= (-> obj bucket-count) - (* (* (-> obj dimension-array 0) (-> obj dimension-array 1)) (+ (-> obj dimension-array 2) 1)) + (if (>= (-> this bucket-count) + (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (+ (-> this dimension-array 2) 1)) ) - (+! (-> obj dimension-array 2) 1) + (+! (-> this dimension-array 2) 1) ) ) ) @@ -319,20 +309,20 @@ ) (dotimes (a1-40 2) (let* ((a2-26 (* a1-40 2)) - (a3-12 (max 1 (the int (/ (-> v1-0 data a2-26) (-> obj min-cell-size))))) + (a3-12 (max 1 (the int (/ (-> v1-0 data a2-26) (-> this min-cell-size))))) ) - (set! (-> (the-as (pointer uint8) (+ a2-26 (the-as int obj))) 24) - (the-as uint (min (-> (the-as (pointer int8) (+ a2-26 (the-as int obj))) 24) a3-12)) + (set! (-> (the-as (pointer uint8) (+ a2-26 (the-as int this))) 24) + (the-as uint (min (-> (the-as (pointer int8) (+ a2-26 (the-as int this))) 24) a3-12)) ) ) ) (dotimes (a1-43 3) - (set! (-> obj axis-scale a1-43) (/ (the float (-> obj dimension-array a1-43)) (-> v1-0 data a1-43))) + (set! (-> this axis-scale a1-43) (/ (the float (-> this dimension-array a1-43)) (-> v1-0 data a1-43))) ) ) - (let ((a2-34 (* (* (-> obj dimension-array 0) (-> obj dimension-array 1)) (-> obj dimension-array 2)))) - (b! (< (-> obj bucket-count) a2-34) cfg-40) - (let* ((v1-16 obj) + (let ((a2-34 (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)))) + (b! (< (-> this bucket-count) a2-34) cfg-40) + (let* ((v1-16 this) (a0-12 (/ (+ (* (* (* (-> v1-16 dimension-array 0) (-> v1-16 dimension-array 1)) (-> v1-16 dimension-array 2)) (-> v1-16 bucket-size) @@ -357,9 +347,9 @@ *stdcon* "grid-hash::update-grid: bucket overflow! ~d dim ~d ~d ~d~%" a2-34 - (-> obj dimension-array 0) - (-> obj dimension-array 1) - (-> obj dimension-array 2) + (-> this dimension-array 0) + (-> this dimension-array 1) + (-> this dimension-array 2) ) ) (label cfg-41) @@ -367,19 +357,18 @@ (none) ) -(defmethod update-grid-for-objects-in-box grid-hash ((obj grid-hash) (arg0 int) (arg1 vector) (arg2 vector)) - (set! (-> obj object-count) arg0) +(defmethod update-grid-for-objects-in-box grid-hash ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector)) + (set! (-> this object-count) arg0) (dotimes (v1-0 3) - (set! (-> obj box-min v1-0) (-> arg1 data v1-0)) - (set! (-> obj box-max v1-0) (-> arg2 data v1-0)) + (set! (-> this box-min v1-0) (-> arg1 data v1-0)) + (set! (-> this box-max v1-0) (-> arg2 data v1-0)) ) - (update-grid obj) + (update-grid this) 0 (none) ) - -(defmethod setup-search-box grid-hash ((obj grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod setup-search-box grid-hash ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((v1-0 (new 'stack-no-clear 'vector)) (t1-0 (new 'stack-no-clear 'vector)) ) @@ -387,8 +376,8 @@ (set! (-> v1-0 data t2-0) (fmin (fmin (-> arg1 data t2-0) (-> arg2 data t2-0)) (-> arg3 data t2-0))) (set! (-> t1-0 data t2-0) (fmax (fmax (-> arg1 data t2-0) (-> arg2 data t2-0)) (-> arg3 data t2-0))) ) - (let ((a2-3 obj) - (a3-1 (-> obj search-box)) + (let ((a2-3 this) + (a3-1 (-> this search-box)) ) (dotimes (t0-1 3) (set! (-> a3-1 min t0-1) @@ -414,9 +403,9 @@ ) ) 0 - (set! (-> obj work object-id) arg0) - (let* ((t1-1 obj) - (t2-21 (-> obj search-box)) + (set! (-> this work object-id) arg0) + (let* ((t1-1 this) + (t2-21 (-> this search-box)) (a3-2 arg0) (v1-5 (-> t1-1 bucket-size)) (a0-2 (* (-> t1-1 dimension-array 0) v1-5)) @@ -451,6 +440,7 @@ (set! (-> (the-as (pointer uint8) t6-0)) t7-1) ) ) + ;; og:preserve-this (b! (nonzero? t5-2) cfg-12 :delay (set! t6-0 (&+ (the-as pointer t6-0) v1-5))) ) (+! t3-23 -1) @@ -466,9 +456,9 @@ (none) ) -(defmethod search-for-point grid-hash ((obj grid-hash) (arg0 vector)) - (let ((v1-0 obj) - (a0-1 (-> obj search-box)) +(defmethod search-for-point grid-hash ((this grid-hash) (arg0 vector)) + (let ((v1-0 this) + (a0-1 (-> this search-box)) (a2-0 arg0) ) (dotimes (a3-0 3) @@ -494,39 +484,40 @@ ) ) 0 - (do-search! obj (-> obj search-box) (-> obj work result-words)) - (-> obj work result-words) + (do-search! this (-> this search-box) (-> this work result-words)) + (-> this work result-words) ) -(defmethod search-for-sphere grid-hash ((obj grid-hash) (arg0 vector) (arg1 float)) +;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. +(defmethod search-for-sphere grid-hash ((this grid-hash) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'sphere))) (set! (-> v1-0 quad) (-> arg0 quad)) (set! (-> v1-0 r) arg1) - (sphere-to-grid-box obj (-> obj search-box) v1-0) + (sphere-to-grid-box this (-> this search-box) v1-0) ) - (let ((s5-0 (-> obj work result-words)) + (let ((s5-0 (-> this work result-words)) (s4-0 0) ) (label cfg-1) - (do-search! obj (-> obj search-box) s5-0) - (dotimes (v1-5 (-> obj bucket-size)) + (do-search! this (-> this search-box) s5-0) + (dotimes (v1-5 (-> this bucket-size)) (set! s4-0 (logior s4-0 (-> s5-0 v1-5))) ) (when (zero? s4-0) - (when (or (> (-> obj search-box min 0) 0) - (> (-> obj search-box min 2) 0) - (< (-> obj search-box max 0) (+ (-> obj dimension-array 0) -1)) - (< (-> obj search-box max 2) (+ (-> obj dimension-array 2) -1)) + (when (or (> (-> this search-box min 0) 0) + (> (-> this search-box min 2) 0) + (< (-> this search-box max 0) (+ (-> this dimension-array 0) -1)) + (< (-> this search-box max 2) (+ (-> this dimension-array 2) -1)) ) - (set! (-> obj search-box min 0) (max 0 (+ (-> obj search-box min 0) -1))) - (set! (-> obj search-box min 2) (max 0 (+ (-> obj search-box min 2) -1))) - (set! (-> obj search-box max 0) (min (+ (-> obj dimension-array 0) -1) (+ (-> obj search-box max 0) 1))) - (set! (-> obj search-box max 2) (min (+ (-> obj dimension-array 2) -1) (+ (-> obj search-box max 2) 1))) + (set! (-> this search-box min 0) (max 0 (+ (-> this search-box min 0) -1))) + (set! (-> this search-box min 2) (max 0 (+ (-> this search-box min 2) -1))) + (set! (-> this search-box max 0) (min (+ (-> this dimension-array 0) -1) (+ (-> this search-box max 0) 1))) + (set! (-> this search-box max 2) (min (+ (-> this dimension-array 2) -1) (+ (-> this search-box max 2) 1))) (goto cfg-1) ) ) ) - (-> obj work result-words) + (-> this work result-words) ) (defun-debug draw-grid ((arg0 vector) (arg1 vector) (arg2 (pointer int8)) (arg3 rgba)) @@ -574,47 +565,46 @@ (none) ) -(defmethod draw grid-hash ((obj grid-hash) (arg0 rgba)) +(defmethod draw grid-hash ((this grid-hash) (arg0 rgba)) "Draws the grid-hash" (let ((v1-0 (new 'stack-no-clear 'vector)) (t0-0 (new 'stack-no-clear 'vector)) ) (dotimes (a2-0 3) - (set! (-> v1-0 data a2-0) (-> obj box-min a2-0)) - (set! (-> t0-0 data a2-0) (-> obj box-max a2-0)) + (set! (-> v1-0 data a2-0) (-> this box-min a2-0)) + (set! (-> t0-0 data a2-0) (-> this box-max a2-0)) ) - (draw-grid v1-0 t0-0 (-> obj dimension-array) arg0) + (draw-grid v1-0 t0-0 (-> this dimension-array) arg0) ) 0 (none) ) -(defmethod dump-grid-info grid-hash ((obj grid-hash)) +(defmethod dump-grid-info grid-hash ((this grid-hash)) "Prints out info about the grid-hash, also draws via [[grid-hash::draw-grid]] if `debug-draw` is `#t`" - (if (-> obj debug-draw) - (draw obj *color-light-blue*) + (if (-> this debug-draw) + (draw this *color-light-blue*) ) (format *stdcon* "bucket memory ~d, bucket-size ~d, word-size ~d bits~%" - (-> obj bucket-memory-size) - (-> obj bucket-size) + (-> this bucket-memory-size) + (-> this bucket-size) 8 ) (format *stdcon* "bucket dimensions ~d ~d ~d~%" - (-> obj dimension-array 0) - (-> obj dimension-array 1) - (-> obj dimension-array 2) + (-> this dimension-array 0) + (-> this dimension-array 1) + (-> this dimension-array 2) ) - (format *stdcon* "object-count ~d, bucket-count ~d~%" (-> obj object-count) (-> obj bucket-count)) + (format *stdcon* "object-count ~d, bucket-count ~d~%" (-> this object-count) (-> this bucket-count)) 0 (none) ) (defun-debug draw-sphere-box ((arg0 sphere) (arg1 rgba)) - (local-vars (a1-0 none)) (let ((a2-0 (new 'stack-no-clear 'vector)) (a3-0 (new 'stack-no-clear 'vector)) ) @@ -638,7 +628,7 @@ (none) ) - +;; WARN: Return type mismatch object vs sphere-hash. (defmethod new sphere-hash ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) (let ((s5-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) (when (zero? (the-as sphere-hash s5-0)) @@ -668,44 +658,40 @@ ) ) -(defmethod clear-objects! sphere-hash ((obj sphere-hash)) - (set! (-> obj object-count) 0) +(defmethod clear-objects! sphere-hash ((this sphere-hash)) + (set! (-> this object-count) 0) (dotimes (v1-0 3) - (set! (-> obj box-min v1-0) 10000000000000000000000000000000000000.0) - (set! (-> obj box-max v1-0) -10000000000000000000000000000000000000.0) + (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) + (set! (-> this box-max v1-0) -10000000000000000000000000000000000000.0) ) (cond - ((-> obj use-scratch-ram) - (set! (-> obj sphere-array) (the-as (inline-array sphere) (-> obj spr-sphere-array))) - (set! (-> obj bucket-array) (-> obj spr-bucket-array)) + ((-> this use-scratch-ram) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this spr-sphere-array))) + (set! (-> this bucket-array) (-> this spr-bucket-array)) ) (else - (set! (-> obj sphere-array) (the-as (inline-array sphere) (-> obj mem-sphere-array))) - (set! (-> obj bucket-array) (-> obj mem-bucket-array)) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this mem-sphere-array))) + (set! (-> this bucket-array) (-> this mem-bucket-array)) ) ) 0 (none) ) -;; definition for method 28 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 28 sphere-hash)" 28 sphere-hash) - -;; definition for method 26 of type sphere-hash -(defmethod add-a-sphere sphere-hash ((obj sphere-hash) (arg0 vector)) - (let ((gp-0 (-> obj object-count))) +(defmethod add-a-sphere sphere-hash ((this sphere-hash) (arg0 vector)) + (let ((gp-0 (-> this object-count))) (cond - ((< gp-0 (-> obj max-object-count)) - (let ((a0-2 (-> obj sphere-array gp-0))) + ((< gp-0 (-> this max-object-count)) + (let ((a0-2 (-> this sphere-array gp-0))) (mem-copy! (the-as pointer a0-2) (the-as pointer arg0) 16) ) (dotimes (v1-2 3) - (set! (-> obj box-min v1-2) (fmin (-> obj box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) - (set! (-> obj box-max v1-2) (fmax (-> obj box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-min v1-2) (fmin (-> this box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-max v1-2) (fmax (-> this box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) ) - (+! (-> obj object-count) 1) + (+! (-> this object-count) 1) gp-0 ) (else @@ -715,20 +701,19 @@ ) ) -;; definition for method 27 of type sphere-hash -(defmethod add-a-sphere-with-flag sphere-hash ((obj sphere-hash) (arg0 vector) (arg1 int)) - (let ((gp-0 (-> obj object-count))) +(defmethod add-a-sphere-with-flag sphere-hash ((this sphere-hash) (arg0 vector) (arg1 int)) + (let ((gp-0 (-> this object-count))) (cond - ((< gp-0 (-> obj max-object-count)) - (let ((s2-0 (the-as object (-> obj sphere-array gp-0)))) + ((< gp-0 (-> this max-object-count)) + (let ((s2-0 (the-as object (-> this sphere-array gp-0)))) (mem-copy! (the-as pointer s2-0) (the-as pointer arg0) 16) (dotimes (v1-2 3) - (set! (-> obj box-min v1-2) (fmin (-> obj box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) - (set! (-> obj box-max v1-2) (fmax (-> obj box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-min v1-2) (fmin (-> this box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-max v1-2) (fmax (-> this box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) ) (set! (-> (the-as (pointer int8) s2-0) 12) arg1) ) - (+! (-> obj object-count) 1) + (+! (-> this object-count) 1) gp-0 ) (else @@ -738,42 +723,33 @@ ) ) -;; definition for method 33 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 33 sphere-hash)" 33 sphere-hash) -;; definition for method 29 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 29 sphere-hash)" 29 sphere-hash) -;; definition for method 30 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 30 sphere-hash)" 30 sphere-hash) -;; definition for method 31 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 31 sphere-hash)" 31 sphere-hash) -;; definition for method 32 of type sphere-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 32 sphere-hash)" 32 sphere-hash) -(defmethod dump-grid-info sphere-hash ((obj sphere-hash)) +(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)) obj) + ((the (function sphere-hash none) (find-parent-method sphere-hash 15)) this) (new 'stack-no-clear 'vector) (let ((f30-0 6144.0)) - (set! (-> obj work temp-box-min quad) (-> (target-pos 0) quad)) - (+! (-> obj work temp-box-min y) f30-0) + (set! (-> this work temp-box-min quad) (-> (target-pos 0) quad)) + (+! (-> this work temp-box-min y) f30-0) ) - (set! (-> obj work temp-box-max quad) (-> obj work temp-box-min quad)) - (set! (-> obj work visit-count) 0) - (set! (-> obj debug-draw) #t) - (set! (-> obj work add-object-time) (the-as uint 0)) + (set! (-> this work temp-box-max quad) (-> this work temp-box-min quad)) + (set! (-> this work visit-count) 0) + (set! (-> this debug-draw) #t) + (set! (-> this work add-object-time) (the-as uint 0)) 0 (none) ) +;; WARN: Return type mismatch object vs spatial-hash. (defmethod new spatial-hash ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) (when (zero? (the-as spatial-hash gp-0)) @@ -810,49 +786,45 @@ ) ) -(defmethod clear-objects! spatial-hash ((obj spatial-hash)) - (set! (-> obj object-count) 0) +(defmethod clear-objects! spatial-hash ((this spatial-hash)) + (set! (-> this object-count) 0) (dotimes (v1-0 3) - (set! (-> obj box-min v1-0) 10000000000000000000000000000000000000.0) - (set! (-> obj box-max v1-0) -10000000000000000000000000000000000000.0) + (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) + (set! (-> this box-max v1-0) -10000000000000000000000000000000000000.0) ) (cond - ((-> obj use-scratch-ram) - (set! (-> obj sphere-array) (the-as (inline-array sphere) (-> obj spr-sphere-array))) - (set! (-> obj object-array) (-> obj spr-object-array)) - (set! (-> obj bucket-array) (-> obj spr-bucket-array)) + ((-> this use-scratch-ram) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this spr-sphere-array))) + (set! (-> this object-array) (-> this spr-object-array)) + (set! (-> this bucket-array) (-> this spr-bucket-array)) ) (else - (set! (-> obj sphere-array) (the-as (inline-array sphere) (-> obj mem-sphere-array))) - (set! (-> obj object-array) (-> obj mem-object-array)) - (set! (-> obj bucket-array) (-> obj mem-bucket-array)) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this mem-sphere-array))) + (set! (-> this object-array) (-> this mem-object-array)) + (set! (-> this bucket-array) (-> this mem-bucket-array)) ) ) 0 (none) ) -;; definition for method 33 of type spatial-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 33 spatial-hash)" 33 spatial-hash) - -;; definition for method 34 of type spatial-hash -(defmethod add-an-object spatial-hash ((obj spatial-hash) (arg0 vector) (arg1 hash-object-info)) - (let ((gp-0 (-> obj object-count))) +(defmethod add-an-object spatial-hash ((this spatial-hash) (arg0 vector) (arg1 hash-object-info)) + (let ((gp-0 (-> this object-count))) (cond - ((< gp-0 (-> obj max-object-count)) - (let ((a0-2 (-> obj sphere-array gp-0)) - (s2-0 (-> obj object-array gp-0)) + ((< gp-0 (-> this max-object-count)) + (let ((a0-2 (-> this sphere-array gp-0)) + (s2-0 (-> this object-array gp-0)) ) (mem-copy! (the-as pointer a0-2) (the-as pointer arg0) 16) (set! (-> s2-0 object) (the-as basic arg1)) ) (dotimes (v1-3 3) - (set! (-> obj box-min v1-3) (fmin (-> obj box-min v1-3) (- (-> arg0 data v1-3) (-> arg0 w)))) - (set! (-> obj box-max v1-3) (fmax (-> obj box-max v1-3) (+ (-> arg0 data v1-3) (-> arg0 w)))) + (set! (-> this box-min v1-3) (fmin (-> this box-min v1-3) (- (-> arg0 data v1-3) (-> arg0 w)))) + (set! (-> this box-max v1-3) (fmax (-> this box-max v1-3) (+ (-> arg0 data v1-3) (-> arg0 w)))) ) - (+! (-> obj object-count) 1) + (+! (-> this object-count) 1) gp-0 ) (else @@ -862,38 +834,25 @@ ) ) -;; definition for method 39 of type spatial-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 39 spatial-hash)" 39 spatial-hash) -;; definition for method 36 of type spatial-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 36 spatial-hash)" 36 spatial-hash) -;; definition for method 37 of type spatial-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 37 spatial-hash)" 37 spatial-hash) -;; definition for method 35 of type spatial-hash -;; ERROR: function was not converted to expressions. Cannot decompile. (defmethod-mips2c "(method 35 spatial-hash)" 35 spatial-hash) -;; definition for method 38 of type spatial-hash -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. -(defmethod fill-actor-list-for-vec+r spatial-hash ((obj spatial-hash) (arg0 vector) (arg1 (pointer collide-shape)) (arg2 int)) +(defmethod fill-actor-list-for-vec+r spatial-hash ((this spatial-hash) (arg0 vector) (arg1 (pointer collide-shape)) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'sphere))) (set! (-> v1-0 quad) (-> arg0 quad)) (set! (-> v1-0 r) 0.0) - (fill-actor-list-for-sphere obj v1-0 arg1 arg2) + (fill-actor-list-for-sphere this v1-0 arg1 arg2) ) ) -;; definition for method 40 of type spatial-hash -;; WARN: Return type mismatch int vs none. -(defmethod validate-objects spatial-hash ((obj spatial-hash)) - (dotimes (s5-0 (-> obj object-count)) - (let ((a0-2 (-> obj object-array s5-0 object))) +(defmethod validate-objects spatial-hash ((this spatial-hash)) + (dotimes (s5-0 (-> this object-count)) + (let ((a0-2 (-> this object-array s5-0 object))) (when (not (valid? a0-2 basic "" #t 0)) (break!) 0 @@ -903,7 +862,3 @@ 0 (none) ) - - - - diff --git a/goal_src/jak2/engine/target/board/board-h.gc b/goal_src/jak2/engine/target/board/board-h.gc index a977d13fb6..af3cbcd3b7 100644 --- a/goal_src/jak2/engine/target/board/board-h.gc +++ b/goal_src/jak2/engine/target/board/board-h.gc @@ -265,13 +265,13 @@ (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) ) (not *pause-lock*) - (>= (- (current-time) (-> self control time-of-last-debug-heal)) (seconds 0.1)) + (time-elapsed? (-> self control time-of-last-debug-heal) (seconds 0.1)) (>= (-> self control last-time-on-surface) (-> self control time-of-last-debug-float)) ) (-> self board latch?) ) (not (focus-test? self dead hit grabbed in-head edge-grab pole board pilot mech dark)) - (or (zero? (-> self board)) (>= (- (current-time) (-> self board board-time)) (seconds 0.5))) + (or (zero? (-> self board)) (time-elapsed? (-> self board board-time) (seconds 0.5))) (not (logtest? (state-flags prevent-board) (-> self state-flags))) (< (-> self board board-time) (-> self control list-time-on-ground)) (not (logtest? (surface-flag no-board) (-> self control current-surface flags))) @@ -320,7 +320,7 @@ #f #t ) - (begin (set! (-> self board latch?) #t) (>= (- (current-time) (-> self gun gun-time)) (seconds 0.4))) + (begin (set! (-> self board latch?) #t) (time-elapsed? (-> self gun gun-time) (seconds 0.4))) ) ) ) diff --git a/goal_src/jak2/engine/target/board/board-states.gc b/goal_src/jak2/engine/target/board/board-states.gc index fa0d81d6c3..7015d0dc21 100644 --- a/goal_src/jak2/engine/target/board/board-states.gc +++ b/goal_src/jak2/engine/target/board/board-states.gc @@ -107,7 +107,7 @@ ) (set! (-> self board turn-anim-duck-vel) (* 0.98 (-> self board turn-anim-duck-vel))) (+! (-> self board turn-anim-duck-vel) (* -8.0 (seconds-per-frame))) - (when (and (board-on-ground?) (>= (- (current-time) (-> self board unknown-time-frame02)) (seconds 0.2))) + (when (and (board-on-ground?) (time-elapsed? (-> self board unknown-time-frame02) (seconds 0.2))) (if (logtest? (-> self control status) (collide-status impact-surface)) (+! (-> self board turn-anim-duck-vel) (lerp-scale 0.0 15.0 (-> self control normal-impact-vel) 0.0 81920.0)) ) @@ -124,19 +124,19 @@ (defbehavior target-board-spin-check target () (when (and (or (cpad-pressed? (-> self control cpad number) r1) (and (cpad-hold? (-> self control cpad number) r1) - (>= (- (current-time) (-> self board spin-check-time)) (seconds 0.3)) + (time-elapsed? (-> self board spin-check-time) (seconds 0.3)) ) ) (not (and (and (-> self next-state) (let ((v1-24 (-> self next-state name))) (or (= v1-24 'target-board-trickx) (= v1-24 'target-board-hold)) ) ) - (< (- (current-time) (-> self board spin-start-time)) (seconds 0.5)) + (not (time-elapsed? (-> self board spin-start-time) (seconds 0.5))) ) ) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) ) - (set! (-> self board spin-start-time) (current-time)) + (set-time! (-> self board spin-start-time)) (set! (-> self board spin-start-dir quad) (-> self node-list data 3 bone transform vector 2 quad)) (vector-flatten! (-> self control turn-to-alt-heading) (-> self control c-R-w vector 2) *up-vector*) (vector-normalize! (-> self control turn-to-alt-heading) 1.0) @@ -159,14 +159,14 @@ (cond ((and (cpad-hold? (-> self control cpad number) r1) (and (or (= (-> self control mod-surface name) 'spin) - (< (- (current-time) (-> self board spin-time)) (seconds 0.05)) + (not (time-elapsed? (-> self board spin-time) (seconds 0.05))) ) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) ) ) (set! (-> self board turn-anim-tilt?) #f) (set! (-> self control mod-surface) *board-spin-mods*) - (set! (-> self board spin-time) (current-time)) + (set-time! (-> self board spin-time)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) (set! (-> gp-0 y) 0.0) @@ -213,7 +213,7 @@ (set! (-> self control mod-surface) (the-as surface (-> self board mods-backup))) ) ) - (set! (-> self board spin-check-time) (current-time)) + (set-time! (-> self board spin-check-time)) (when (and (or (cpad-pressed? (-> self control cpad number) l1) (< (-> self control last-time-on-surface) (-> self board unknown-time-frame06)) ) @@ -221,7 +221,7 @@ ) (set! (-> self board turn-anim-tilt?) #f) (set! (-> self control mod-surface) *board-spin-mods*) - (set! (-> self board unknown-time-frame03) (current-time)) + (set-time! (-> self board unknown-time-frame03)) (let ((gp-2 (new 'stack-no-clear 'vector))) (set! (-> gp-2 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) (set! (-> gp-2 y) 0.0) @@ -239,7 +239,7 @@ (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (and (>= (target-height-above-ground) 4096.0) (< (seconds 0.165) (target-time-to-ground)) - (>= (- (current-time) (-> self board unknown-time-frame05)) (seconds 0.05)) + (time-elapsed? (-> self board unknown-time-frame05) (seconds 0.05)) (< (-> self board unknown-time-frame05) (-> self board unknown-time-frame06)) ) ) @@ -263,7 +263,7 @@ (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (and (>= (target-height-above-ground) 4096.0) (< (seconds 0.165) (target-time-to-ground)) - (>= (- (current-time) (-> self board unknown-time-frame05)) (seconds 0.05)) + (time-elapsed? (-> self board unknown-time-frame05) (seconds 0.05)) ) ) ) @@ -331,7 +331,7 @@ ) (set! (-> self board troty-cum) 0.0) (set! (-> self board flip-count) 0) - (if (>= (- (current-time) (-> self board in-air-time)) (seconds 0.2)) + (if (time-elapsed? (-> self board in-air-time) (seconds 0.2)) (flush-trick-list (-> self board)) ) 0 @@ -346,7 +346,7 @@ (f28-0 (vector-y-angle (-> self control transv))) (f0-2 (y-angle (-> self control))) ) - (if (< (- (current-time) (-> self board halfpipe-time)) (seconds 0.1)) + (if (not (time-elapsed? (-> self board halfpipe-time) (seconds 0.1))) (set! f28-0 (+ 32768.0 f28-0)) ) (let ((f0-5 (fabs (deg-diff f0-2 f28-0)))) @@ -452,7 +452,7 @@ (< 0.0 (vector-dot (-> self control transv) gp-0)) (and (< (-> self control surface-angle) 0.3) (zero? (-> self board halfpipe-side-time))) ) - (set! (-> self board halfpipe-side-time) (current-time)) + (set-time! (-> self board halfpipe-side-time)) (set! v0-3 (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset))) (set! (-> self control root-prim prim-core action) v0-3) v0-3 @@ -460,11 +460,11 @@ (else (if (and (not (board-on-ground?)) (nonzero? (-> self board halfpipe-side-time)) - (>= (- (current-time) (-> self board halfpipe-side-time)) (seconds 0.05)) + (time-elapsed? (-> self board halfpipe-side-time) (seconds 0.05)) ) (go target-board-halfpipe) ) - (when (>= (- (current-time) (-> self board halfpipe-side-time)) (seconds 0.2)) + (when (time-elapsed? (-> self board halfpipe-side-time) (seconds 0.2)) (set! (-> self board halfpipe-side-time) 0) (set! v0-3 (logclear (-> self control root-prim prim-core action) (collide-action no-normal-reset))) (set! (-> self control root-prim prim-core action) v0-3) @@ -477,10 +477,10 @@ (defbehavior target-board-jump-trans target () (when (and (!= (-> self state-time) (current-time)) (jump-hit-ground-stuck?)) - (set! (-> self board jump-land-time) (current-time)) + (set-time! (-> self board jump-land-time)) (go target-board-hit-ground) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (target-board-smack-surface?) ) (if (and (cpad-pressed? (-> self control cpad number) x) @@ -525,8 +525,8 @@ (< 0.0 (vector-dot (-> self control transv) s5-0)) ) ) - (set! (-> self board halfpipe-lip-time) (current-time)) - (set! (-> self board halfpipe-side-time) (current-time)) + (set-time! (-> self board halfpipe-lip-time)) + (set-time! (-> self board halfpipe-side-time)) (set! (-> self board halfpipe-lip-event) (the-as symbol (-> block param 0))) (let ((v0-2 (the-as object (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset)))) ) @@ -579,9 +579,8 @@ :trans (behavior () (if (and (cpad-hold? (-> self control cpad number) l1) (not (logtest? (-> self state-flags) (state-flags prevent-duck))) - (< (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (not (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) + ) ) (go target-board-duck-stance) ) @@ -603,7 +602,7 @@ ) (vector-normalize! gp-0 1.0) (cond - ((and (< (- (current-time) (-> self board halfpipe-jump-time)) (seconds 0.5)) + ((and (not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) (= (-> self control ground-pat mode) (pat-mode halfpipe)) ) ) @@ -611,7 +610,7 @@ (< 0.0 (vector-dot (-> self control transv) gp-0)) (< (-> self control surface-angle) 0.5) ) - (set! (-> self board halfpipe-jump-time) (current-time)) + (set-time! (-> self board halfpipe-jump-time)) (vector-float*! (-> self control transv) (-> self control transv) 1.5) ) (else @@ -622,14 +621,14 @@ ) ) (if (cpad-pressed? (-> self control cpad number) r1) - (set! (-> self board spin-ground-press-time) (current-time)) + (set-time! (-> self board spin-ground-press-time)) ) (if (and (cpad-hold? (-> self control cpad number) r1) (can-feet? #t) - (< (- (current-time) (-> self board spin-ground-press-time)) (seconds 0.3)) + (not (time-elapsed? (-> self board spin-ground-press-time) (seconds 0.3))) (turn-around?) ) - (set! (-> self board spin-ground-start-time) (current-time)) + (set-time! (-> self board spin-ground-start-time)) ) (target-board-halfpipe-check) (if (target-board-smack-surface?) @@ -642,7 +641,7 @@ (set! (-> self control mod-surface) *board-walk-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) ) - ((and (>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1)) + ((and (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) (or (= (-> self control mod-surface name) 'spin) (< 4096.0 (target-height-above-ground))) ) (set! (-> self control mod-surface) *board-jump-mods*) @@ -763,9 +762,7 @@ :trans (behavior () (if (and (or (not (cpad-hold? (-> self control cpad number) l1)) (logtest? (-> self state-flags) (state-flags prevent-duck)) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) ) (can-exit-duck? self) ) @@ -789,7 +786,7 @@ ) (vector-normalize! gp-0 1.0) (cond - ((and (< (- (current-time) (-> self board halfpipe-jump-time)) (seconds 0.5)) + ((and (not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) (= (-> self control ground-pat mode) (pat-mode halfpipe)) ) ) @@ -797,7 +794,7 @@ (< 0.0 (vector-dot (-> self control transv) gp-0)) (< (-> self control surface-angle) 0.5) ) - (set! (-> self board halfpipe-jump-time) (current-time)) + (set-time! (-> self board halfpipe-jump-time)) (vector-float*! (-> self control transv) (-> self control transv) 1.5) ) (else @@ -817,14 +814,14 @@ ) ) (if (cpad-pressed? (-> self control cpad number) r1) - (set! (-> self board spin-ground-press-time) (current-time)) + (set-time! (-> self board spin-ground-press-time)) ) (if (and (cpad-hold? (-> self control cpad number) r1) (can-feet? #t) - (< (- (current-time) (-> self board spin-ground-press-time)) (seconds 0.3)) + (not (time-elapsed? (-> self board spin-ground-press-time) (seconds 0.3))) (turn-around?) ) - (set! (-> self board spin-ground-start-time) (current-time)) + (set-time! (-> self board spin-ground-start-time)) ) (target-board-halfpipe-check) (if (target-board-smack-surface?) @@ -838,7 +835,7 @@ (set! (-> self control mod-surface) *board-duck-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) ) - ((and (>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1)) + ((and (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) (or (= (-> self control mod-surface name) 'spin) (< 4096.0 (target-height-above-ground))) ) (set! (-> self control mod-surface) *board-duck-jump-mods*) @@ -857,7 +854,7 @@ (defstate target-board-jump (target) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (if (and (= message 'edge-grab) (< (- (current-time) (-> self state-time)) (seconds 0.1))) + (if (and (= message 'edge-grab) (not (time-elapsed? (-> self state-time) (seconds 0.1)))) (return #f) ) (target-board-handler proc argc message block) @@ -870,7 +867,7 @@ (if (= arg2 'hit) (set! arg2 #f) ) - (when (< (- (current-time) (-> self board ride-time)) (seconds 0.5)) + (when (not (time-elapsed? (-> self board ride-time) (seconds 0.5))) (set! arg2 (the-as symbol *board-ride-jump-mods*)) (let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0))) (forward-up-nopitch->quaternion @@ -886,12 +883,12 @@ ) ) (set! (-> self control dynam gravity-length) 245760.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((f30-0 0.0)) (cond ((and (< 0.0 (-> self board shock-offsetv)) - (< (- (current-time) (-> self board jump-land-time)) (seconds 0.5)) - (>= (- (current-time) (-> self board ride-time)) (seconds 0.5)) + (not (time-elapsed? (-> self board jump-land-time) (seconds 0.5))) + (time-elapsed? (-> self board ride-time) (seconds 0.5)) ) (let ((s3-2 (new 'stack-no-clear 'vector))) (set! (-> s3-2 quad) (-> self control trans quad)) @@ -983,7 +980,7 @@ #t #f (-> self control transv) - (if (>= (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) + (if (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)) 2.0 0.0 ) @@ -1142,7 +1139,7 @@ ) :enter (behavior () (logior! (-> self focus-status) (focus-status halfpipe)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) (set! (-> self control mod-surface) *board-halfpipe-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) @@ -1216,7 +1213,7 @@ ) :trans (behavior () (when (and (or (= (the-as int (-> self control did-move-to-pole-or-max-jump-height)) #t) - (and (< (- (current-time) (-> self board halfpipe-lip-time)) (seconds 0.1)) + (and (not (time-elapsed? (-> self board halfpipe-lip-time) (seconds 0.1))) (= (-> self board halfpipe-lip-event) 'lipramp) ) ) @@ -1242,20 +1239,20 @@ ) ) ) - (set! (-> self board halfpipe-time) (current-time)) + (set-time! (-> self board halfpipe-time)) (if (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) - (set! (-> self board halfpipe-gspot-time) (current-time)) + (set-time! (-> self board halfpipe-gspot-time)) ) (when (jump-hit-ground-stuck?) (vector-float*! (-> self control transv) (-> self control transv) 1.5) (go target-board-turn-to (-> self control transv) (seconds 0.5)) ) (when (and (cpad-pressed? (-> self control cpad number) x) - (>= (- (current-time) (-> self board halfpipe-jump-time)) (seconds 0.6)) - (< (- (current-time) (-> self state-time)) (the-as time-frame (-> *TARGET-bank* ground-timeout))) + (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.6)) + (not (time-elapsed? (-> self state-time) (the-as time-frame (-> *TARGET-bank* ground-timeout)))) (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (set! (-> self board halfpipe-jump-time) (current-time)) + (set-time! (-> self board halfpipe-jump-time)) (vector-float*! (-> self control transv) (-> self control transv) 1.5) ) (target-board-spin-check) @@ -1285,7 +1282,7 @@ ) ) (when (or (>= (-> self control sliding-start-time) (seconds 0.05)) - (and (>= (- (current-time) (-> self board halfpipe-gspot-time)) (seconds 0.5)) + (and (time-elapsed? (-> self board halfpipe-gspot-time) (seconds 0.5)) (< (-> self board halfpipe-lip-time) (+ (-> self state-time) (seconds -0.2))) ) ) @@ -1297,7 +1294,7 @@ ) :code (behavior () (cond - ((< (- (current-time) (-> self board halfpipe-jump-time)) (seconds 0.5)) + ((not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 155) :num! (seek! (ja-aframe 8.0 0) 0.5) :frame-num 0.0) (until (ja-done? 0) @@ -1411,7 +1408,7 @@ (defstate target-board-jump-kick (target) :event target-board-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *board-jump-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) (sound-play "board-k-jump") @@ -1423,10 +1420,10 @@ ) (target-board-smack-surface?) (cond - ((< (- (current-time) (-> self board smack-surface-time)) (seconds 0.2)) + ((not (time-elapsed? (-> self board smack-surface-time) (seconds 0.2))) (go target-board-wall-kick (-> self board smack-normal) (-> self board smack-speed)) ) - ((< (- (current-time) (-> self board glance-time)) (seconds 0.2)) + ((not (time-elapsed? (-> self board glance-time) (seconds 0.2))) (go target-board-wall-kick (vector-normalize-copy! (-> self control unknown-vector38) (-> self board glance-out-transv) 1.0) @@ -1467,7 +1464,7 @@ (* 0.008333334 (- (-> self control dynam gravity-length))) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *board-wall-kick-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) (set! (-> self board smack-surface-time) 0) @@ -1507,7 +1504,7 @@ (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) ) (set! (-> self control dynam gravity-length) 245760.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (cond ((= arg2 'halfpipe) (logior! (-> self focus-status) (focus-status halfpipe)) @@ -1672,8 +1669,8 @@ (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) ) (set! (-> self control dynam gravity-length) 245760.0) - (set! (-> self state-time) (current-time)) - (set! (-> self board unknown-time-frame04) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self board unknown-time-frame04)) (cond ((= arg2 'halfpipe) (logior! (-> self focus-status) (focus-status halfpipe)) @@ -1693,7 +1690,7 @@ ) :exit (behavior () (set! (-> self board unknown-float01) 0.0) - (set! (-> self board unknown-time-frame05) (current-time)) + (set-time! (-> self board unknown-time-frame05)) (let ((v1-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-3 command) (sound-command set-param)) (set! (-> v1-3 id) (-> self board unknown-sound-id01)) @@ -1863,7 +1860,7 @@ (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) ) (when (jump-hit-ground-stuck?) - (set! (-> self board jump-land-time) (current-time)) + (set-time! (-> self board jump-land-time)) (go target-board-hit-ground) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) @@ -2023,7 +2020,7 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *board-turn-to-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) (set! (-> self control sliding-start-time) arg1) @@ -2049,7 +2046,7 @@ (flush-trick-list (-> self board)) (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) ) - (if (>= (- (current-time) (-> self state-time)) (-> self control sliding-start-time)) + (if (time-elapsed? (-> self state-time) (-> self control sliding-start-time)) (go target-board-stance) ) (target-board-anim-trans) @@ -2087,7 +2084,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self focus-status) (focus-status rail)) (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) (set! (-> self control mod-surface) *board-ride-mods*) @@ -2211,7 +2208,7 @@ (set! (-> self control unknown-word04) (the-as uint #f)) ) (if (-> self control unknown-spool-anim00) - (set! (-> self board ride-button-time) (current-time)) + (set-time! (-> self board ride-button-time)) ) (set! (-> self board turn-anim-targ) (* (-> self board ride-lean) (- (-> *TARGET_BOARD-bank* turn-frames)))) (cond @@ -2320,7 +2317,7 @@ :enter (behavior ((arg0 handle)) (logior! (-> self focus-status) (focus-status halfpipe)) (set! (-> self control unknown-handle02) arg0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) (set! (-> self control mod-surface) *board-halfpipe-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) @@ -2348,11 +2345,11 @@ ((-> target-board-halfpipe exit)) ) :trans (behavior () - (set! (-> self board halfpipe-time) (current-time)) + (set-time! (-> self board halfpipe-time)) (if (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) - (set! (-> self board halfpipe-gspot-time) (current-time)) + (set-time! (-> self board halfpipe-gspot-time)) ) - (if (< (- (current-time) (-> self state-time)) (seconds 1)) + (if (not (time-elapsed? (-> self state-time) (seconds 1))) (vector+float*! (-> self control transv) (-> self control transv) @@ -2364,7 +2361,7 @@ (vector-float*! (-> self control transv) (-> self control transv) 1.5) (go target-board-turn-to (-> self control transv) (seconds 0.5)) ) - (when (>= (- (current-time) (-> self board halfpipe-gspot-time)) (seconds 0.5)) + (when (time-elapsed? (-> self board halfpipe-gspot-time) (seconds 0.5)) (+! (-> self control transv x) (* 20480.0 (-> self control edge-grab-across-edge-dir x))) (+! (-> self control transv z) (* 20480.0 (-> self control edge-grab-across-edge-dir z))) (go target-board-stance) @@ -2431,7 +2428,7 @@ ) :enter (behavior () (set! (-> self board shock-offsetv) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *board-jump-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) @@ -2575,7 +2572,7 @@ :enter (behavior ((arg0 handle)) (logclear! (-> self focus-status) (focus-status halfpipe)) (set! (-> self board shock-offsetv) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) ) :exit target-board-exit @@ -2662,7 +2659,7 @@ ) (logclear! (-> self focus-status) (focus-status halfpipe)) (set! (-> self board shock-offsetv) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) (new 'static 'surface :name 'jump @@ -2949,7 +2946,7 @@ :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) - (set! (-> self control time-of-last-debug-heal) (current-time)) + (set-time! (-> self control time-of-last-debug-heal)) (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) (go target-board-stance) ) @@ -2958,7 +2955,7 @@ :code (behavior ((arg0 vector) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) (logclear! (-> self focus-status) (focus-status halfpipe)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((v1-6 gp-0)) @@ -3007,7 +3004,7 @@ (cond ((= arg0 'attack) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('endlessfall) (cond @@ -3016,7 +3013,7 @@ (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) (let ((s3-1 (current-time))) - (until (>= (- (current-time) s3-1) (seconds 1)) + (until (time-elapsed? s3-1 (seconds 1)) (suspend) ) ) diff --git a/goal_src/jak2/engine/target/board/board-util.gc b/goal_src/jak2/engine/target/board/board-util.gc index a08b760355..2a97c52d5c 100644 --- a/goal_src/jak2/engine/target/board/board-util.gc +++ b/goal_src/jak2/engine/target/board/board-util.gc @@ -14,11 +14,11 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch process-drawable vs board. -(defmethod relocate board ((obj board) (arg0 int)) - (if (nonzero? (-> obj main)) - (&+! (-> obj main) arg0) +(defmethod relocate board ((this board) (arg0 int)) + (if (nonzero? (-> this main)) + (&+! (-> this main) arg0) ) - (the-as board ((method-of-type process-drawable relocate) obj arg0)) + (the-as board ((method-of-type process-drawable relocate) this arg0)) ) (defbehavior board-post board () diff --git a/goal_src/jak2/engine/target/board/target-board.gc b/goal_src/jak2/engine/target/board/target-board.gc index 8951530c19..55d08796be 100644 --- a/goal_src/jak2/engine/target/board/target-board.gc +++ b/goal_src/jak2/engine/target/board/target-board.gc @@ -35,21 +35,21 @@ (define *board-trick-tracker* (new 'static 'board-trick-tracker)) -(defmethod reset-combo! board-trick-tracker ((obj board-trick-tracker)) - (set! (-> obj num-tricks-in-combo) 0) - (set! (-> obj points-in-combo) 0.0) +(defmethod reset-combo! board-trick-tracker ((this board-trick-tracker)) + (set! (-> this num-tricks-in-combo) 0) + (set! (-> this points-in-combo) 0.0) (countdown (idx 16) - (set! (-> obj tricks-in-combo idx) (board-tricks none))) + (set! (-> this tricks-in-combo idx) (board-tricks none))) (none)) -(defmethod add-trick-to-combo! board-trick-tracker ((obj board-trick-tracker) (trick board-tricks) (points float)) - (when (not (-> obj combo-in-progress?)) - (set! (-> obj combo-in-progress?) #t) - (reset-combo! obj)) - (when (< (-> obj num-tricks-in-combo) 15) - (set! (-> obj tricks-in-combo (-> obj num-tricks-in-combo)) trick) - (set! (-> obj num-tricks-in-combo) (inc (-> obj num-tricks-in-combo))) - (set! (-> obj points-in-combo) (+ (-> obj points-in-combo) points))) +(defmethod add-trick-to-combo! board-trick-tracker ((this board-trick-tracker) (trick board-tricks) (points float)) + (when (not (-> this combo-in-progress?)) + (set! (-> this combo-in-progress?) #t) + (reset-combo! this)) + (when (< (-> this num-tricks-in-combo) 15) + (set! (-> this tricks-in-combo (-> this num-tricks-in-combo)) trick) + (set! (-> this num-tricks-in-combo) (inc (-> this num-tricks-in-combo))) + (set! (-> this points-in-combo) (+ (-> this points-in-combo) points))) (none)) @@ -105,7 +105,7 @@ "*unknown*" ))) -(defmethod render-combo board-trick-tracker ((obj board-trick-tracker)) +(defmethod render-combo board-trick-tracker ((this board-trick-tracker)) (when (not (-> *pc-settings* jetboard-trick-text?)) (return 0)) (clear *temp-string*) @@ -119,14 +119,14 @@ (set! (-> freq i) 0) (set! (-> printed i) #f)) ;; Build up a frequency list, god i wish i had a map - (while (< idx (-> obj num-tricks-in-combo)) - (let ((trick (-> obj tricks-in-combo idx))) + (while (< idx (-> this num-tricks-in-combo)) + (let ((trick (-> this tricks-in-combo idx))) (set! (-> freq trick) (inc (-> freq trick))) (set! idx (inc idx)))) ;; Now we can construct the string (set! idx 0) - (while (< idx (-> obj num-tricks-in-combo)) - (let* ((trick (-> obj tricks-in-combo idx)) + (while (< idx (-> this num-tricks-in-combo)) + (let* ((trick (-> this tricks-in-combo idx)) (times (-> freq trick)) (skip? (-> printed trick)) (color (case trick @@ -150,15 +150,15 @@ )) (set! idx (inc idx)))) ;; Add points - (when (> (-> obj points-in-combo) 0.0) - (format *temp-string* "~%~S~D" "~[~38L" (the int (-> obj points-in-combo)))) + (when (> (-> this points-in-combo) 0.0) + (format *temp-string* "~%~S~D" "~[~38L" (the int (-> this points-in-combo)))) ;; Print it finally (let ((font-ctx (new 'stack 'font-context *font-default-matrix* 0 325 0.0 (font-color default) (font-flags shadow kerning middle)))) (print-game-text-scaled *temp-string* 1.0 font-ctx (bucket-id progress))) (none)) -(defmethod end-combo! board-trick-tracker ((obj board-trick-tracker)) - (set! (-> obj combo-in-progress?) #f) +(defmethod end-combo! board-trick-tracker ((this board-trick-tracker)) + (set! (-> this combo-in-progress?) #f) (none)) ) @@ -200,7 +200,7 @@ (case arg3 ((1) (if (< 0.9 (-> self control surface-angle)) - (set! (-> self board on-flat-time) (current-time)) + (set-time! (-> self board on-flat-time)) ) (set! (-> self board slip-factor) (lerp-scale 1.0 (-> arg0 slip-factor) (fabs (-> self control ctrl-slope-heading)) 0.0 1.0) @@ -232,9 +232,9 @@ (set! (-> arg0 turnv) (lerp-scale 91022.22 (-> arg1 turnv) (the float (- (current-time) (-> self board spin-time))) 0.0 600.0) ) - (when (< (- (current-time) (-> self board spin-ground-start-time)) (seconds 0.3)) - (set! (-> self control last-attack-end-time) (current-time)) - (set! (-> self board spin-ground-time) (current-time)) + (when (not (time-elapsed? (-> self board spin-ground-start-time) (seconds 0.3))) + (set-time! (-> self control last-attack-end-time)) + (set-time! (-> self board spin-ground-time)) (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) (set! (-> arg0 vel-turn) 131072.0) @@ -450,7 +450,7 @@ ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) (case arg3 ((1) - (when (< (- (current-time) (-> self state-time)) (seconds 0.05)) + (when (not (time-elapsed? (-> self state-time) (seconds 0.05))) (set! (-> arg0 turnv) 0.0) (set! (-> arg0 turnvf) 0.0) ) @@ -660,7 +660,7 @@ ) (vector+float*! s5-1 (-> self control trans) (-> self control c-R-w vector 2) (* 40960.0 (seconds-per-frame))) (let ((f0-2 (vector-segment-overlap s5-1 (the-as vector (-> gp-1 world-vertex)) (-> gp-1 world-vertex 1)))) - (if (and (>= (- (current-time) (-> self board ride-time)) (seconds 0.4)) + (if (and (time-elapsed? (-> self board ride-time) (seconds 0.4)) (>= f0-2 0.0) (>= 1.0 f0-2) (not (and (-> self next-state) (= (-> self next-state name) 'target-board-duck-stance))) @@ -808,10 +808,10 @@ (set! (-> self board unknown-sound-id00) (new 'static 'sound-id)) (set-setting! 'mode-sound-bank 'board 0.0 0) (set-setting! 'sound-flava #f 30.0 2) - (set! (-> self board board-get-on-time) (current-time)) + (set-time! (-> self board board-get-on-time)) (set! (-> self board stick-lock) #f) (set! (-> self board stick-off) #f) - (set! (-> self board unstuck-time) (current-time)) + (set-time! (-> self board unstuck-time)) (set! (-> self board stuck-count) 0) (set! (-> self board slip-factor) 1.0) (set! (-> self board unknown-symbol00) #f) @@ -971,7 +971,7 @@ (not (logtest? (-> self control status) (collide-status touch-actor))) ) ) - (set! (-> self board smack-surface-time) (current-time)) + (set-time! (-> self board smack-surface-time)) (set! (-> self board smack-speed) (-> self control ctrl-xz-vel)) (set! (-> self board smack-normal quad) (-> self control wall-contact-normal quad)) #t @@ -1043,14 +1043,14 @@ (set! f0-28 0.0) (set! f1-23 0.0) ) - (when (and (< (- (current-time) (-> self control last-time-touching-actor)) (seconds 1)) + (when (and (not (time-elapsed? (-> self control last-time-touching-actor) (seconds 1))) (>= f28-0 0.5) (< (vector-dot (-> self control wall-contact-normal) (-> self control to-target-pt-xz)) -0.7) (logtest? (-> self control mod-surface flags) (surface-flag air)) (< 0.0 (-> gp-0 y)) ) (cond - ((and (>= (- (current-time) (-> self control last-time-touching-actor)) (seconds 0.1)) + ((and (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.1)) (< 0.3 (-> self control blocked-factor)) ) (set! f0-28 f1-23) @@ -1152,7 +1152,7 @@ (logtest? (state-flags prevent-board) (-> self state-flags)) (not (logtest? (-> *game-info* features) (game-feature board))) ) - (and (>= (- (current-time) (-> self board board-get-on-time)) (seconds 1)) + (and (time-elapsed? (-> self board board-get-on-time) (seconds 1)) (< (-> self board board-get-on-time) (max (-> self control list-time-on-ground) (-> self control last-time-of-stuck)) ) @@ -1316,7 +1316,7 @@ (defbehavior target-board-physics target ((arg0 vector)) (let ((f30-0 0.5)) - (if (>= (- (current-time) (-> self board unknown-time-frame02)) (seconds 0.3)) + (if (time-elapsed? (-> self board unknown-time-frame02) (seconds 0.3)) (+! (-> self board shock-offsetv) (* (- (-> arg0 y) (-> self control transv y)) f30-0)) (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) ) @@ -1334,7 +1334,7 @@ (set! (-> self board shock-offsetv) 0.0) (set! (-> self board shock-offset) (* 0.96 (-> self board shock-offset))) ) - ((and (or (< (- (current-time) (-> self control last-time-on-surface)) (seconds 0.2)) + ((and (or (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.2))) (< (-> self board shock-offset) 0.0) ) (!= (-> self control mod-surface mode) 'air) @@ -1517,7 +1517,7 @@ (not (and (-> self next-state) (= (-> self next-state name) 'target-board-smack))) (not (focus-test? self halfpipe)) (!= (-> self control ground-pat mode) 3) - (>= (- (current-time) (-> self board halfpipe-time)) (seconds 0.1)) + (time-elapsed? (-> self board halfpipe-time) (seconds 0.1)) ) ) (let ((s5-3 (new 'stack-no-clear 'vector))) @@ -1538,7 +1538,7 @@ (s3-3 (vector-matrix*! (new 'stack-no-clear 'vector) s3-2 (-> self control w-R-c))) ) (logior! (-> self control status) (collide-status glance)) - (set! (-> self board glance-time) (current-time)) + (set-time! (-> self board glance-time)) (let ((v1-99 s2-2)) (set! (-> self board glance-speed) (sqrtf (+ (* (-> v1-99 x) (-> v1-99 x)) (* (-> v1-99 z) (-> v1-99 z))))) ) @@ -1606,7 +1606,7 @@ (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) - (set! (-> self control last-time-of-stuck) (current-time)) + (set-time! (-> self control last-time-of-stuck)) ) 0 (none) @@ -1632,7 +1632,7 @@ (not (logtest? (-> self control status) (collide-status on-surface))) ) (begin - (set! (-> self board in-air-time) (current-time)) + (set-time! (-> self board in-air-time)) (and (not (and (-> self next-state) (let ((v1-12 (-> self next-state name))) (or (= v1-12 'target-board-stance) (= v1-12 'target-board-duck-stance) (= v1-12 'target-board-turn-to)) @@ -1671,7 +1671,7 @@ ) ) ) - (>= (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.2)) + (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.2)) ) ) ) @@ -1682,7 +1682,7 @@ (else (set! (-> self control bend-speed) 1024.0) (set! (-> self control bend-target) 1.0) - (when (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) + (when (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1))) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) @@ -1736,7 +1736,7 @@ (#f (set! (-> self control dynam gravity-length) 245760.0) ) - ((>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1)) + ((time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) (seek! (-> self control dynam gravity-length) 245760.0 (* 245760.0 (seconds-per-frame))) ) (else @@ -1785,15 +1785,15 @@ ) (when (and (zero? (shr (shl (-> self board unknown-int00) 54) 61)) (!= (shr (shl (-> self board unknown-int00) 40) 58) 13) - (>= (- (current-time) (-> self board unknown-time-frame02)) (seconds 0.2)) + (time-elapsed? (-> self board unknown-time-frame02) (seconds 0.2)) (< 819.2 (- f30-0 f0-36)) (or (< (-> self board unknown-time-frame01) (-> self control last-time-on-surface)) - (< (- (current-time) (-> self board unknown-time-frame01)) (seconds 0.2)) + (not (time-elapsed? (-> self board unknown-time-frame01) (seconds 0.2))) ) (< 0.98 (vector-dot (-> self board unknown-vector01) (-> self control standard-dynamics gravity-normal))) (< f26-0 8192.0) (< f30-0 8192.0) - (or (< (* 0.2 f28-0) f30-0) (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1))) + (or (< (* 0.2 f28-0) f30-0) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)))) ) (vector+float*! (-> self control transv) @@ -1801,25 +1801,25 @@ (-> self control dynam gravity-normal) (* 7.0 (fmin 4096.0 f30-0)) ) - (if (>= (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) - (set! (-> self board unknown-time-frame01) (current-time)) + (if (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)) + (set-time! (-> self board unknown-time-frame01)) ) - (set! (-> self board unknown-time-frame00) (current-time)) + (set-time! (-> self board unknown-time-frame00)) ) ) (when (and (not (logtest? (-> self control status) (collide-status on-surface))) (< 0.0 f28-0) (or (and (or (< (target-height-above-ground) 4096.0) - (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) + (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1))) ) (< 8192.0 (- f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self board slow-transv)))) ) - (< (- (current-time) (-> self board unknown-time-frame02)) (seconds 0.1)) + (not (time-elapsed? (-> self board unknown-time-frame02) (seconds 0.1))) ) (>= 204.8 f30-0) (not (and (-> self next-state) (= (-> self next-state name) 'target-board-jump))) ) - (set! (-> self board unknown-time-frame02) (current-time)) + (set-time! (-> self board unknown-time-frame02)) (vector-length (-> self control transv)) (let ((v1-303 (new-stack-vector0)) (f0-51 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -1889,14 +1889,14 @@ (if (and (= (-> self control pad-magnitude) 0.0) (>= (current-time) (-> self control turn-lockout-end-time)) (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) - (>= (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) + (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)) ) (rot->dir-targ! (-> self control)) ) - (when (and (< (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1)) + (when (and (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1))) (>= (current-time) (-> self control turn-lockout-end-time)) (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) - (>= (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) + (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)) ) (let* ((s3-0 (vector-flatten! @@ -1922,7 +1922,7 @@ ) ) (if (cpad-pressed? (-> self control cpad number) l1) - (set! (-> self board unknown-time-frame06) (current-time)) + (set-time! (-> self board unknown-time-frame06)) ) (board-add-thrust) (add-gravity) @@ -1996,7 +1996,7 @@ (set! (-> self board trotyv) 0.0) ) ((and (= (-> self control danger-mode) 'board-spin) - (or (board-on-ground?) (>= (- (current-time) (-> self board spin-time)) (seconds 0.5))) + (or (board-on-ground?) (time-elapsed? (-> self board spin-time) (seconds 0.5))) ) (target-danger-set! 'harmless #f) ) @@ -2088,7 +2088,7 @@ (joint-points) (do-target-gspot) (target-powerup-process) - (set! (-> self board board-time) (current-time)) + (set-time! (-> self board board-time)) (target-board-exit-check) (target-board-effect) (when (board-on-ground?) @@ -2144,9 +2144,9 @@ (return (the-as time-frame #f)) ) (vector-normalize-copy! (-> self board ride-dir) (-> self board ride-segment) 1.0) - (when (>= (- (current-time) (-> self board ride-time)) (seconds 0.2)) + (when (time-elapsed? (-> self board ride-time) (seconds 0.2)) (set! (-> self board ride-lock-on) #f) - (set! (-> self board ride-start-time) (current-time)) + (set-time! (-> self board ride-start-time)) (vector-normalize-copy! (-> self board ride-dir) (-> self control transv) 1.0) (dotimes (v1-25 3) (vector-reset! (-> self board ride-vertex-old v1-25)) @@ -2238,7 +2238,7 @@ ) ) (when (and (< (-> self board ride-vertex-index) 0.0) - (< (- (current-time) (-> self board ride-time)) (seconds 0.2)) + (not (time-elapsed? (-> self board ride-time) (seconds 0.2))) (zero? s3-3) ) (+! s3-3 1) @@ -2266,7 +2266,7 @@ (dotimes (v1-127 3) (set! (-> self board ride-vertex v1-127 w) 1.0) ) - (when (>= (- (current-time) (-> self board ride-time)) (seconds 0.2)) + (when (time-elapsed? (-> self board ride-time) (seconds 0.2)) (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-segment))) (set! (-> self board ride-rtv-abs) 0.0) ) @@ -2313,7 +2313,7 @@ ) ) (let ((s4-3 0)) - (if (and (< (fabs f30-2) 16384.0) (< (- (current-time) (-> self board ride-start-time)) (seconds 0.1))) + (if (and (< (fabs f30-2) 16384.0) (not (time-elapsed? (-> self board ride-start-time) (seconds 0.1)))) (set! s4-3 (logior s4-3 1)) ) (if (or (< (vector-dot @@ -2407,7 +2407,7 @@ (set! s4-3 (logior s4-3 8)) ) ) - (if (>= (- (current-time) (-> self board ride-button-time)) (seconds 0.05)) + (if (time-elapsed? (-> self board ride-button-time) (seconds 0.05)) (set! s4-3 (logior s4-3 16)) ) (if (< (vector-length (-> self board ride-segment)) @@ -2419,7 +2419,7 @@ (set! s4-3 (logior s4-3 64)) ) (logclear! (-> self control status) (collide-status probe-hit)) - (when (and (< (- (current-time) (-> self board ride-time)) (seconds 0.2)) (nonzero? s4-3)) + (when (and (not (time-elapsed? (-> self board ride-time) (seconds 0.2))) (nonzero? s4-3)) (if (logtest? s4-3 1) (format #t "exit speed ~M~%" f30-2) ) @@ -2495,7 +2495,7 @@ (-> self control to-target-pt-xz) (+ (-> self board ride-rot) (* -2730.6667 (-> self board ride-lean))) ) - (set! (-> self board ride-time) (current-time)) + (set-time! (-> self board ride-time)) (set! (-> self board ride-speed) f30-2) ) ) @@ -2647,7 +2647,7 @@ (when (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags two)) (cond - ((>= (- (current-time) (-> self board ride-time)) (seconds 0.2)) + ((time-elapsed? (-> self board ride-time) (seconds 0.2)) (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one)) (set! (-> *collide-edge-board-spec* touching-segment) #f) ) @@ -2773,7 +2773,7 @@ (target-powerup-process) (target-board-exit-check) (target-board-effect) - (set! (-> self board board-time) (current-time)) + (set-time! (-> self board board-time)) 0 (none) ) @@ -2895,29 +2895,29 @@ (none) ) -(defmethod add-to-trick-list board-info ((obj board-info) (arg0 board-tricks) (arg1 float)) +(defmethod add-to-trick-list board-info ((this board-info) (arg0 board-tricks) (arg1 float)) "Add specified trick and point amount to trick list." - (send-event (handle->process (-> obj process 0 notify)) 'notify 'trick-point arg0) - (when (and (< (-> obj trick-count) 16) - (and (< 0.0 arg1) (nonzero? (-> (the-as fact-info-target (-> obj process 0 fact)) trick-point-duration))) + (send-event (handle->process (-> this process 0 notify)) 'notify 'trick-point arg0) + (when (and (< (-> this trick-count) 16) + (and (< 0.0 arg1) (nonzero? (-> (the-as fact-info-target (-> this process 0 fact)) trick-point-duration))) ) (let ((s4-0 0)) (when (>= (- (-> *display* game-clock frame-counter) - (-> (the-as fact-info-target (-> obj process 0 fact)) trick-point-pickup-time) + (-> (the-as fact-info-target (-> this process 0 fact)) trick-point-pickup-time) ) (seconds 30) ) (countdown (v1-20 16) - (set! (-> obj trick-list 0) (board-tricks none)) + (set! (-> this trick-list 0) (board-tricks none)) ) ) (countdown (v1-23 15) - (if (= (-> obj trick-list v1-23) arg0) + (if (= (-> this trick-list v1-23) arg0) (+! s4-0 1) ) - (set! (-> obj trick-list (+ v1-23 1)) (-> obj trick-list v1-23)) + (set! (-> this trick-list (+ v1-23 1)) (-> this trick-list v1-23)) ) - (set! (-> obj trick-list 0) arg0) + (set! (-> this trick-list 0) arg0) (let* ((a0-24 (* arg1 (lerp-scale 1.0 0.1 (the float s4-0) 2.0 6.0))) (s3-1 (the float (* 25 (/ (+ (the int a0-24) 24) 25)))) ) @@ -2937,49 +2937,49 @@ ) ;; og:preserve-this jetboard trick tracker (let ((total-points s3-1)) - (when (nonzero? (-> obj trick-count)) - (format #t " + combo ~,,0f" (-> obj trick-points-array (+ (-> obj trick-count) -1))) - (+! total-points (-> obj trick-points-array (+ (-> obj trick-count) -1))) - (+! (-> obj trick-points-array (+ (-> obj trick-count) -1)) - (-> obj trick-points-array (+ (-> obj trick-count) -1)) + (when (nonzero? (-> this trick-count)) + (format #t " + combo ~,,0f" (-> this trick-points-array (+ (-> this trick-count) -1))) + (+! total-points (-> this trick-points-array (+ (-> this trick-count) -1))) + (+! (-> this trick-points-array (+ (-> this trick-count) -1)) + (-> this trick-points-array (+ (-> this trick-count) -1)) ) ) (format #t "~%") - (set! (-> obj trick-array (-> obj trick-count)) arg0) - (set! (-> obj trick-points-array (-> obj trick-count)) s3-1) + (set! (-> this trick-array (-> this trick-count)) arg0) + (set! (-> this trick-points-array (-> this trick-count)) s3-1) (#when PC_PORT (add-trick-to-combo! *board-trick-tracker* arg0 total-points))) ) ) - (+! (-> obj trick-count) 1) + (+! (-> this trick-count) 1) ) 0 (none) ) -(defmethod flush-trick-list board-info ((obj board-info)) +(defmethod flush-trick-list board-info ((this board-info)) "Flush trick list and give out points." (let ((f30-0 0.0)) - (dotimes (v1-0 (-> obj trick-count)) - (+! f30-0 (-> obj trick-points-array v1-0)) + (dotimes (v1-0 (-> this trick-count)) + (+! f30-0 (-> this trick-points-array v1-0)) ) (when (< 0.0 f30-0) (send-event - (handle->process (-> obj process 0 notify)) + (handle->process (-> this process 0 notify)) 'notify 'trick-flush f30-0 - (-> obj trick-list) - (-> obj trick-count) + (-> this trick-list) + (-> this trick-count) ) - (send-event (ppointer->process (-> obj process)) 'get-pickup (pickup-type trick-point) f30-0) + (send-event (ppointer->process (-> this process)) 'get-pickup (pickup-type trick-point) f30-0) (sound-play "trick-score") ;; og:preserve-this (#when PC_PORT (end-combo! *board-trick-tracker*)) ) ) - (set! (-> obj trick-count) 0) + (set! (-> this trick-count) 0) 0 0 (none) diff --git a/goal_src/jak2/engine/target/collide-reaction-target.gc b/goal_src/jak2/engine/target/collide-reaction-target.gc index 788a0897b0..e5b31465a3 100644 --- a/goal_src/jak2/engine/target/collide-reaction-target.gc +++ b/goal_src/jak2/engine/target/collide-reaction-target.gc @@ -131,9 +131,9 @@ ) ) (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf07))) - (set! (-> arg0 time-of-last-lc-touch-edge) (current-time)) + (set-time! (-> arg0 time-of-last-lc-touch-edge)) (set! sv-40 (logior sv-40 (collide-status touch-edge))) - (set! (-> arg0 time-of-last-lc) (current-time)) + (set-time! (-> arg0 time-of-last-lc)) (let ((f30-0 (vector-dot tangent (-> arg0 turn-to-target))) (f0-27 (if (logtest? sv-32 (cshape-reaction-flags csrf01)) (cos (- 16384.0 (acos (-> arg0 coverage)))) @@ -183,13 +183,13 @@ ) (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf06))) (set! sv-40 (logior sv-40 (collide-status touch-edge))) - (set! (-> arg0 time-of-last-lc) (current-time)) + (set-time! (-> arg0 time-of-last-lc)) (set! sv-48 (the-as symbol #f)) ) (#t (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf06))) (set! sv-40 (logior sv-40 (collide-status touch-edge))) - (set! (-> arg0 time-of-last-lc) (current-time)) + (set-time! (-> arg0 time-of-last-lc)) ) ) ) @@ -368,7 +368,7 @@ (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-other-tri intersect) (-> arg0 grount-touch-point)) ) ) - (< (- (current-time) (-> arg0 list-time-on-ground)) (seconds 0.3)) + (not (time-elapsed? (-> arg0 list-time-on-ground) (seconds 0.3))) ) (logtest? sv-104 (cshape-reaction-flags csrf15)) ) @@ -439,7 +439,7 @@ (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) (set! (-> arg0 ground-contact-normal quad) (-> sv-84 quad)) (set! (-> arg0 ground-local-norm-dot-grav) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) - (set! (-> arg0 list-time-on-ground) (current-time)) + (set-time! (-> arg0 list-time-on-ground)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) (set! (-> arg0 grount-touch-point quad) (-> arg1 best-other-tri intersect quad)) (set! (-> arg0 ground-contact-sphere-center quad) (-> arg1 best-my-prim prim-core world-sphere quad)) @@ -562,7 +562,7 @@ ) (defbehavior rail-surface-touch target () - (when (>= (- (current-time) (-> self control time-of-last-surface-change)) (seconds 0.2)) + (when (time-elapsed? (-> self control time-of-last-surface-change) (seconds 0.2)) (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one send-event)) (set! (-> *collide-edge-board-spec* touching-segment) #f) (do-edge-grabs *target* *collide-cache* *collide-edge-board-spec*) diff --git a/goal_src/jak2/engine/target/gun/gun-blue-shot.gc b/goal_src/jak2/engine/target/gun/gun-blue-shot.gc index 64f80a2f7d..51915d3fd6 100644 --- a/goal_src/jak2/engine/target/gun/gun-blue-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-blue-shot.gc @@ -50,46 +50,46 @@ ) -(defmethod draw-laser-sight gun-blue-shot ((obj gun-blue-shot)) +(defmethod draw-laser-sight gun-blue-shot ((this gun-blue-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (let* ((s5-0 (ppointer->process (-> obj parent))) + (let* ((s5-0 (ppointer->process (-> this parent))) (s4-0 (-> *part-id-table* 196)) (s3-0 (get-field-spec-by-id s4-0 (sp-field-id spt-omega))) (s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as projectile s5-0) node-list data 16))) ) (when s3-0 - (let ((s1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 1.0)) + (let ((s1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 1.0)) (s2-0 (new 'stack-no-clear 'collide-query)) ) (vector-rotate-y! s1-0 s1-0 16384.0) (vector+float*! s1-0 s5-1 s1-0 -8806.4) (set! (-> s2-0 start-pos quad) (-> s1-0 quad)) - (vector-float*! (-> s2-0 move-dist) (-> obj root dynam gravity-normal) -81920.0) + (vector-float*! (-> s2-0 move-dist) (-> this root dynam gravity-normal) -81920.0) (let ((v1-11 s2-0)) (set! (-> v1-11 radius) 1228.8) (set! (-> v1-11 collide-with) (collide-spec backgnd obstacle hit-by-player-list hit-by-others-list)) - (set! (-> v1-11 ignore-process0) obj) - (set! (-> v1-11 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> v1-11 ignore-process0) this) + (set! (-> v1-11 ignore-process1) (ppointer->process (-> this parent))) (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-11 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) (set! (-> s3-0 initial-valuef) - (fmin (+ 1638.4 (-> s2-0 best-other-tri intersect y)) (+ -1228.8 (-> obj starting-pos y))) + (fmin (+ 1638.4 (-> s2-0 best-other-tri intersect y)) (+ -1228.8 (-> this starting-pos y))) ) - (set! (-> s3-0 initial-valuef) (+ -81920.0 (-> obj starting-pos y))) + (set! (-> s3-0 initial-valuef) (+ -81920.0 (-> this starting-pos y))) ) ) ) (let ((s4-1 (get-field-spec-by-id s4-0 (sp-field-id spt-rotate-y)))) (if s4-1 - (set! (-> s4-1 initial-valuef) (y-angle (-> obj root))) + (set! (-> s4-1 initial-valuef) (y-angle (-> this root))) ) ) (launch-particles (-> *part-id-table* 196) s5-1) (let ((s4-2 (get-field-spec-by-id (-> *part-id-table* 195) (sp-field-id spt-rotate-y)))) (if s4-2 - (set! (-> s4-2 initial-valuef) (y-angle (-> obj root))) + (set! (-> s4-2 initial-valuef) (y-angle (-> this root))) ) ) (launch-particles (-> *part-id-table* 195) s5-1) @@ -98,7 +98,7 @@ (none) ) -(defmethod spawn-shell-particles gun-blue-shot ((obj gun-blue-shot)) +(defmethod spawn-shell-particles gun-blue-shot ((this gun-blue-shot)) "TODO - confirm" (rlet ((vf0 :class vf) (vf4 :class vf) @@ -106,14 +106,14 @@ (vf6 :class vf) ) (init-vf0-vector) - (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> obj init-pos)))) - (draw-beam (-> *part-id-table* 191) (-> obj init-pos) s3-1 #t #t) - (draw-beam (-> *part-id-table* 194) (-> obj init-pos) (-> obj starting-dir) #f #t) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this init-pos)))) + (draw-beam (-> *part-id-table* 191) (-> this init-pos) s3-1 #t #t) + (draw-beam (-> *part-id-table* 194) (-> this init-pos) (-> this starting-dir) #f #t) (let ((s5-0 (-> *part-id-table* 206)) (s4-0 (-> *part-id-table* 205)) ) (new 'stack-no-clear 'vector) - (let ((s2-0 (vector-reflect! (new 'stack-no-clear 'vector) s3-1 (-> obj collide-normal)))) + (let ((s2-0 (vector-reflect! (new 'stack-no-clear 'vector) s3-1 (-> this collide-normal)))) (vector-normalize! s2-0 1.0) (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-x)) (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-y)) @@ -164,7 +164,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-13) a0-19 a1-15 @@ -184,16 +184,16 @@ ) ) -(defmethod unknown-particles gun-blue-shot ((obj gun-blue-shot)) +(defmethod unknown-particles gun-blue-shot ((this gun-blue-shot)) "TODO - confirm" - (draw-beam (-> *part-id-table* 191) (-> obj init-pos) (-> obj init-dir) #f #t) - (draw-beam (-> *part-id-table* 194) (-> obj init-pos) (-> obj starting-dir) #f #t) + (draw-beam (-> *part-id-table* 191) (-> this init-pos) (-> this init-dir) #f #t) + (draw-beam (-> *part-id-table* 194) (-> this init-pos) (-> this starting-dir) #f #t) 0 (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound gun-blue-shot ((obj gun-blue-shot) (arg0 projectile-options)) +(defmethod play-impact-sound gun-blue-shot ((this gun-blue-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -207,16 +207,16 @@ (none) ) -(defmethod made-impact? gun-blue-shot ((obj gun-blue-shot)) +(defmethod made-impact? gun-blue-shot ((this gun-blue-shot)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a1-0 t1-0)) (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a1-0 ignore-process0) obj) - (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-0 action-mask) (collide-action solid)) ) @@ -247,9 +247,9 @@ ) ) -(defmethod init-proj-collision! gun-blue-shot ((obj gun-blue-shot)) +(defmethod init-proj-collision! gun-blue-shot ((this gun-blue-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-blue-shot) (set! (-> s5-0 no-reaction) @@ -287,31 +287,31 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 (none) ) -(defmethod init-proj-settings! gun-blue-shot ((obj gun-blue-shot)) +(defmethod init-proj-settings! gun-blue-shot ((this gun-blue-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (with-pp (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (set! (-> obj init-pos quad) (-> obj root trans quad)) - (set! (-> obj init-dir quad) (-> obj starting-dir quad)) - (vector-normalize-copy! (-> obj root transv) (-> obj init-dir) (* 327680.0 (-> pp clock frames-per-second))) - (set! (-> obj attack-mode) 'eco-blue) - (set! (-> obj max-speed) (* 327680.0 (-> pp clock frames-per-second))) - (set! (-> obj timeout) 1) - (set! (-> obj move) gun-blue-shot-move) - (vector-reset! (-> obj collide-normal)) - (set! (-> obj damage) (if (logtest? (game-feature gun-upgrade-damage) (-> *game-info* features)) - 4.0 - 2.0 - ) + (set! (-> this init-pos quad) (-> this root trans quad)) + (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this attack-mode) 'eco-blue) + (set! (-> this max-speed) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this timeout) 1) + (set! (-> this move) gun-blue-shot-move) + (vector-reset! (-> this collide-normal)) + (set! (-> this damage) (if (logtest? (game-feature gun-upgrade-damage) (-> *game-info* features)) + 4.0 + 2.0 + ) ) 0 (none) diff --git a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc index 79b2154a13..832e458ee2 100644 --- a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc @@ -142,51 +142,51 @@ ) ) -(defmethod init-proj-settings! gun-dark-shot ((obj gun-dark-shot)) +(defmethod init-proj-settings! gun-dark-shot ((this gun-dark-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj attack-mode) 'eco-dark) - (vector-normalize! (-> obj root transv) (+ 225280.0 (* 225280.0 (-> obj charge-level)))) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 72) obj)) - (set! (-> obj blast-radius) 40960.0) - (set! (-> obj size-t) 0.0) - (set! (-> obj charge-sound) (new-sound-id)) - (set! (-> obj fire-sound) (new-sound-id)) - (set! (-> obj trail-sound) (new-sound-id)) - (set! (-> obj explode-sound) - (add-process *gui-control* obj (gui-channel background) (gui-action queue) "pmkrxplo" -99.0 0) + (set! (-> this attack-mode) 'eco-dark) + (vector-normalize! (-> this root transv) (+ 225280.0 (* 225280.0 (-> this charge-level)))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 72) this)) + (set! (-> this blast-radius) 40960.0) + (set! (-> this size-t) 0.0) + (set! (-> this charge-sound) (new-sound-id)) + (set! (-> this fire-sound) (new-sound-id)) + (set! (-> this trail-sound) (new-sound-id)) + (set! (-> this explode-sound) + (add-process *gui-control* this (gui-channel background) (gui-action queue) "pmkrxplo" -99.0 0) ) - (set-falloff! *gui-control* (-> obj explode-sound) #t 50 150 11) - (set! (-> obj start-pilot?) (the-as basic (and *target* (focus-test? *target* pilot)))) - ((method-of-type projectile init-proj-settings!) obj) + (set-falloff! *gui-control* (-> this explode-sound) #t 50 150 11) + (set! (-> this start-pilot?) (the-as basic (and *target* (focus-test? *target* pilot)))) + ((method-of-type projectile init-proj-settings!) this) 0 (none) ) -(defmethod spawn-impact-particles gun-dark-shot ((obj gun-dark-shot)) +(defmethod spawn-impact-particles gun-dark-shot ((this gun-dark-shot)) "Spawns associated particles with the projectile if applicable" (cond - ((and (and (-> obj next-state) (= (-> obj next-state name) 'startup)) + ((and (and (-> this next-state) (= (-> this next-state name) 'startup)) (and *target* (focus-test? *target* in-head)) ) - (kill-and-free-particles (-> obj part)) + (kill-and-free-particles (-> this part)) ) (else - (set! (-> *part-id-table* 219 init-specs 2 initial-valuef) (lerp 409.6 9216.0 (-> obj size-t))) - (set! (-> *part-id-table* 219 init-specs 8 initial-valuef) (lerp 0.0 32.0 (-> obj size-t))) - (set! (-> *part-id-table* 220 init-specs 2 initial-valuef) (lerp 409.6 32768.0 (-> obj size-t))) - (set! (-> *part-id-table* 220 init-specs 8 initial-valuef) (lerp 0.0 16.0 (-> obj size-t))) - (set! (-> *part-id-table* 218 init-specs 2 initial-valuef) (lerp 409.6 8192.0 (-> obj size-t))) - (set! (-> *part-id-table* 217 init-specs 1 initial-valuef) (lerp 0.1 1.0 (-> obj size-t))) - (set! (-> *part-id-table* 217 init-specs 2 initial-valuef) (lerp 409.6 3686.4 (-> obj size-t))) - (spawn (-> obj part) (-> obj root trans)) + (set! (-> *part-id-table* 219 init-specs 2 initial-valuef) (lerp 409.6 9216.0 (-> this size-t))) + (set! (-> *part-id-table* 219 init-specs 8 initial-valuef) (lerp 0.0 32.0 (-> this size-t))) + (set! (-> *part-id-table* 220 init-specs 2 initial-valuef) (lerp 409.6 32768.0 (-> this size-t))) + (set! (-> *part-id-table* 220 init-specs 8 initial-valuef) (lerp 0.0 16.0 (-> this size-t))) + (set! (-> *part-id-table* 218 init-specs 2 initial-valuef) (lerp 409.6 8192.0 (-> this size-t))) + (set! (-> *part-id-table* 217 init-specs 1 initial-valuef) (lerp 0.1 1.0 (-> this size-t))) + (set! (-> *part-id-table* 217 init-specs 2 initial-valuef) (lerp 409.6 3686.4 (-> this size-t))) + (spawn (-> this part) (-> this root trans)) ) ) (ja-post) (none) ) -(defmethod go-moving! gun-dark-shot ((obj gun-dark-shot)) - (go (method-of-object obj startup)) +(defmethod go-moving! gun-dark-shot ((this gun-dark-shot)) + (go (method-of-object this startup)) 0 (none) ) diff --git a/goal_src/jak2/engine/target/gun/gun-h.gc b/goal_src/jak2/engine/target/gun/gun-h.gc index b683fc052c..ecc5618832 100644 --- a/goal_src/jak2/engine/target/gun/gun-h.gc +++ b/goal_src/jak2/engine/target/gun/gun-h.gc @@ -143,7 +143,7 @@ (defbehavior want-to-gun? process ((arg0 target) (arg1 symbol)) (local-vars (v1-36 symbol)) (and (logtest? (-> arg0 game features) (game-feature gun)) - (>= (- (current-time) (-> arg0 gun gun-time)) (seconds 0.1)) + (time-elapsed? (-> arg0 gun gun-time) (seconds 0.1)) (not (focus-test? arg0 dead hit board mech dark teleporting)) (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> arg0 control current-surface flags))) (not (logtest? (state-flags prevent-gun) (-> arg0 state-flags))) @@ -165,7 +165,7 @@ (-> arg0 gun latch?) ) (not (-> arg0 skel top-anim frame-group)) - (>= (- (current-time) (-> arg0 control time-of-last-debug-float)) (seconds 0.1)) + (time-elapsed? (-> arg0 control time-of-last-debug-float) (seconds 0.1)) ) ) @@ -197,11 +197,11 @@ ) ) -(defmethod get-gun-ammo fact-info-target ((obj fact-info-target)) - (let ((current-gun (gun->ammo (-> (the-as target (-> obj process)) gun gun-type)))) +(defmethod get-gun-ammo fact-info-target ((this fact-info-target)) + (let ((current-gun (gun->ammo (-> (the-as target (-> this process)) gun gun-type)))) (if (zero? current-gun) 0.0 - (-> (the-as target (-> obj process)) game gun-ammo (+ current-gun -13)) + (-> (the-as target (-> this process)) game gun-ammo (+ current-gun -13)) ) ) ) diff --git a/goal_src/jak2/engine/target/gun/gun-red-shot.gc b/goal_src/jak2/engine/target/gun/gun-red-shot.gc index 35b7c6435c..78ce6b76df 100644 --- a/goal_src/jak2/engine/target/gun/gun-red-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-red-shot.gc @@ -131,7 +131,7 @@ ) ) -(defmethod fire! gun-red-shot ((obj gun-red-shot) (arg0 process-drawable) (arg1 int)) +(defmethod fire! gun-red-shot ((this gun-red-shot) (arg0 process-drawable) (arg1 int)) (let* ((s5-0 arg0) (v1-0 (if (type? s5-0 process-drawable) s5-0 @@ -139,7 +139,7 @@ ) ) (when v1-0 - (let* ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> v1-0 root trans) (-> obj start-pos))) + (let* ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> v1-0 root trans) (-> this start-pos))) (f30-0 (* (if (< (vector-length s5-2) 24576.0) 3.0 2.0 @@ -153,15 +153,15 @@ ) (let ((s2-0 (new 'stack-no-clear 'vector))) (rot-zxy-from-vector! s2-0 s5-2) - (let ((f28-0 (deg- (-> s2-0 x) (-> obj start-rot x))) - (f0-6 (deg- (-> s2-0 y) (-> obj start-rot y))) + (let ((f28-0 (deg- (-> s2-0 x) (-> this start-rot x))) + (f0-6 (deg- (-> s2-0 y) (-> this start-rot y))) ) (when (or (< 2730.6667 (fabs f28-0)) (< 8192.0 (fabs f0-6))) (let ((f1-5 (fmax -2730.6667 (fmin 2730.6667 f28-0))) (f0-8 (fmax -8192.0 (fmin 8192.0 f0-6))) ) - (set! (-> s2-0 x) (+ (-> obj start-rot x) f1-5)) - (set! (-> s2-0 y) (+ (-> obj start-rot y) f0-8)) + (set! (-> s2-0 x) (+ (-> this start-rot x) f1-5)) + (set! (-> s2-0 y) (+ (-> this start-rot y) f0-8)) ) (set-vector! s5-2 0.0 0.0 1.0 1.0) (vector-rotate-around-x! s5-2 s5-2 (-> s2-0 x)) @@ -173,22 +173,22 @@ arg0 'attack arg1 - (static-attack-info ((id (-> obj attack-id)) (mode 'eco-red) (attacker-velocity s5-2) (damage f30-0))) + (static-attack-info ((id (-> this attack-id)) (mode 'eco-red) (attacker-velocity s5-2) (damage f30-0))) ) ) ) ) ) -(defmethod noop gun-red-shot ((obj gun-red-shot)) +(defmethod noop gun-red-shot ((this gun-red-shot)) "Does nothing" 0 (none) ) -(defmethod init-probes! gun-red-shot ((obj gun-red-shot) (arg0 collide-shape)) +(defmethod init-probes! gun-red-shot ((this gun-red-shot) (arg0 collide-shape)) "Create all 19 probe vectors" - (let ((s5-0 (-> obj probe-count))) + (let ((s5-0 (-> this probe-count))) (when (< s5-0 19) (let* ((s4-0 (-> arg0 process)) (a0-2 (if (type? s4-0 process-focusable) @@ -201,19 +201,19 @@ (set! (-> s4-1 quad) (-> (get-trans a0-2 3) quad)) (set! (-> s4-1 quad) (-> arg0 root-prim prim-core world-sphere quad)) ) - (vector-! s4-1 s4-1 (-> obj start-pos)) + (vector-! s4-1 s4-1 (-> this start-pos)) (vector-normalize! s4-1 1.0) (let ((s3-2 (new 'stack-no-clear 'vector))) (rot-zxy-from-vector! s3-2 s4-1) - (let ((f30-0 (deg- (-> s3-2 x) (-> obj start-rot x))) - (f0-4 (deg- (-> s3-2 y) (-> obj start-rot y))) + (let ((f30-0 (deg- (-> s3-2 x) (-> this start-rot x))) + (f0-4 (deg- (-> s3-2 y) (-> this start-rot y))) ) (when (or (< 2730.6667 (fabs f30-0)) (< 8192.0 (fabs f0-4))) (let ((f1-3 (fmax -2730.6667 (fmin 2730.6667 f30-0))) (f0-6 (fmax -8192.0 (fmin 8192.0 f0-4))) ) - (set! (-> s3-2 x) (+ (-> obj start-rot x) f1-3)) - (set! (-> s3-2 y) (+ (-> obj start-rot y) f0-6)) + (set! (-> s3-2 x) (+ (-> this start-rot x) f1-3)) + (set! (-> s3-2 y) (+ (-> this start-rot y) f0-6)) ) (set-vector! s4-1 0.0 0.0 1.0 1.0) (vector-rotate-around-x! s4-1 s4-1 (-> s3-2 x)) @@ -221,26 +221,26 @@ ) ) ) - (set! (-> obj probe-dir s5-0 quad) (-> s4-1 quad)) + (set! (-> this probe-dir s5-0 quad) (-> s4-1 quad)) ) - (set! (-> obj probe-count) (+ s5-0 1)) + (set! (-> this probe-count) (+ s5-0 1)) ) ) (none) ) -(defmethod gun-red-shot-method-26 gun-red-shot ((obj gun-red-shot)) +(defmethod gun-red-shot-method-26 gun-red-shot ((this gun-red-shot)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj start-dir quad)) + (set! (-> s5-0 quad) (-> this start-dir quad)) (vector-float*! s5-0 s5-0 43417.6) - (vector+! s5-0 s5-0 (-> obj start-pos)) + (vector+! s5-0 s5-0 (-> this start-pos)) (set! (-> s5-0 w) 43827.2) - (let ((s4-0 (-> obj root root-prim prim-core collide-with))) + (let ((s4-0 (-> this root root-prim prim-core collide-with))) (set! *actor-list-length* 0) (if (logtest? s4-0 (collide-spec hit-by-others-list)) (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* (the-as sphere s5-0) *actor-list* 256)) @@ -330,39 +330,39 @@ (dotimes (s5-1 *actor-list-length*) (let ((a1-28 (-> *actor-list* s5-1))) (if (logtest? s4-0 (-> a1-28 root-prim prim-core collide-as)) - (init-probes! obj a1-28) + (init-probes! this a1-28) ) ) ) ) ) - (set! (-> obj actor-count) (-> obj probe-count)) + (set! (-> this actor-count) (-> this probe-count)) 0 (none) ) ) -(defmethod gun-red-shot-method-27 gun-red-shot ((obj gun-red-shot)) - (gun-red-shot-method-26 obj) - (let ((s5-0 (-> obj probe-count))) +(defmethod gun-red-shot-method-27 gun-red-shot ((this gun-red-shot)) + (gun-red-shot-method-26 this) + (let ((s5-0 (-> this probe-count))) (while (< s5-0 19) (let ((f28-0 (rand-vu-float-range -2730.6667 2730.6667)) (f30-0 (rand-vu-float-range -8192.0 8192.0)) - (s4-0 (-> obj probe-dir s5-0)) + (s4-0 (-> this probe-dir s5-0)) ) (set-vector! s4-0 0.0 0.0 1.0 1.0) - (vector-rotate-around-x! s4-0 s4-0 (+ (-> obj start-rot x) f28-0)) - (vector-rotate-around-y! s4-0 s4-0 (+ (-> obj start-rot y) f30-0)) + (vector-rotate-around-x! s4-0 s4-0 (+ (-> this start-rot x) f28-0)) + (vector-rotate-around-y! s4-0 s4-0 (+ (-> this start-rot y) f30-0)) ) (+! s5-0 1) ) - (set! (-> obj probe-count) s5-0) + (set! (-> this probe-count) s5-0) ) 0 (none) ) -(defmethod gun-red-shot-method-28 gun-red-shot ((obj gun-red-shot) (arg0 vector)) +(defmethod gun-red-shot-method-28 gun-red-shot ((this gun-red-shot) (arg0 vector)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -370,15 +370,15 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((gp-0 (-> obj root))) + (let ((gp-0 (-> this root))) (let ((v1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> gp-0 trans quad) (-> obj start-pos quad)) + (set! (-> gp-0 trans quad) (-> this start-pos quad)) (vector-float*! (-> gp-0 transv) arg0 61440.0) (let ((a1-1 v1-0)) (set! (-> a1-1 radius) (-> gp-0 root-prim local-sphere w)) (set! (-> a1-1 collide-with) (-> gp-0 root-prim prim-core collide-with)) - (set! (-> a1-1 ignore-process0) obj) - (set! (-> a1-1 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-1 ignore-process0) this) + (set! (-> a1-1 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a1-1 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-1 action-mask) (collide-action solid)) ) @@ -405,15 +405,15 @@ ) ) -(defmethod gun-red-shot-method-24 gun-red-shot ((obj gun-red-shot)) - (let ((v1-0 (-> obj root)) +(defmethod gun-red-shot-method-24 gun-red-shot ((this gun-red-shot)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a1-0 t1-0)) (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a1-0 ignore-process0) obj) - (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-0 action-mask) (collide-action solid)) ) @@ -426,8 +426,8 @@ (defstate debug-idle (gun-red-shot) :virtual #t :code (behavior () - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 3)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (let ((gp-0 (new 'stack-no-clear 'vector))) (dotimes (s5-0 (-> self probe-count)) (vector-float*! gp-0 (-> self probe-dir s5-0) 61440.0) diff --git a/goal_src/jak2/engine/target/gun/gun-states.gc b/goal_src/jak2/engine/target/gun/gun-states.gc index 9440a4cd65..60b0fd0a38 100644 --- a/goal_src/jak2/engine/target/gun/gun-states.gc +++ b/goal_src/jak2/engine/target/gun/gun-states.gc @@ -48,7 +48,7 @@ (logior! (-> self state-flags) (state-flags lleg-still rleg-still)) (set! (-> self control mod-surface) *gun-walk-mods*) (set! (-> self control unknown-word04) (the-as uint #f)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (set! (-> self control bend-target) 0.0) @@ -124,7 +124,7 @@ (= gp-0 (-> self draw art-group data 264)) ) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! gp-0 :num! (seek! (the float (+ (-> gp-0 frames num-frames) -1))) :frame-num 0.0) + (ja-no-eval :group! gp-0 :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -159,10 +159,7 @@ (or (= gp-1 (-> self draw art-group data 244)) (= gp-1 (-> self draw art-group data 253))) ) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 269) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 269)) frames num-frames) -1))) - :frame-num 0.0 - ) + (ja-no-eval :group! (-> self draw art-group data 269) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -176,10 +173,7 @@ ) ) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 270) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 270)) frames num-frames) -1))) - :frame-num 0.0 - ) + (ja-no-eval :group! (-> self draw art-group data 270) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -193,10 +187,7 @@ ) ) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 268) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 268)) frames num-frames) -1))) - :frame-num 0.0 - ) + (ja-no-eval :group! (-> self draw art-group data 268) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -210,10 +201,7 @@ ) ) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 252) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 252)) frames num-frames) -1))) - :frame-num 0.0 - ) + (ja-no-eval :group! (-> self draw art-group data 252) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -233,7 +221,7 @@ (suspend) (ja :num! (loop!)) (when (can-play-stance-amibent?) - (set! (-> self ambient-time) (current-time)) + (set-time! (-> self ambient-time)) (target-gun-end-mode #t) ) (cond @@ -243,6 +231,7 @@ (ja-channel-push! 1 0) (ja :group! (-> self control unknown-spool-anim00)) (suspend) + ;; og:preserve-this ;(b! #t cfg-94) ; branch to the next instruction... (until (not v1-232) (let ((v1-231 (get-channel (-> self skel top-anim) 0))) @@ -268,12 +257,7 @@ ) (else (ja-channel-push! 1 0) - (ja-no-eval :group! (-> self control unknown-spool-anim00) - :num! (seek! - (the float (+ (-> (the-as art-joint-anim (-> self control unknown-spool-anim00)) frames num-frames) -1)) - ) - :frame-num 0.0 - ) + (ja-no-eval :group! (-> self control unknown-spool-anim00) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) @@ -289,7 +273,7 @@ (= gp-2 (-> self draw art-group data 264)) ) (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! gp-2 :num! (seek! 0.0) :frame-num (the float (+ (-> gp-2 frames num-frames) -1))) + (ja-no-eval :group! gp-2 :num! (seek! 0.0) :frame-num max) (until (ja-done? 0) (suspend) (ja :num! (seek! 0.0)) @@ -313,7 +297,7 @@ (defstate target-gun-walk (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *gun-walk-mods*) (case (-> self gun gun-type) (((pickup-type eco-yellow) (pickup-type eco-blue)) diff --git a/goal_src/jak2/engine/target/gun/gun-util.gc b/goal_src/jak2/engine/target/gun/gun-util.gc index 5be6cf7396..5fbd984093 100644 --- a/goal_src/jak2/engine/target/gun/gun-util.gc +++ b/goal_src/jak2/engine/target/gun/gun-util.gc @@ -16,24 +16,24 @@ ) -(defmethod init-proj-settings! gun-eject ((obj gun-eject)) +(defmethod init-proj-settings! gun-eject ((this gun-eject)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gun" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) - (let ((v1-5 (-> obj skel root-channel 0))) - (set! (-> v1-5 frame-group) (-> (the-as gun (-> obj parent 0)) skel channel 0 frame-group)) + (let ((v1-5 (-> this skel root-channel 0))) + (set! (-> v1-5 frame-group) (-> (the-as gun (-> this parent 0)) skel channel 0 frame-group)) ) (let ((t9-3 (method-of-type projectile-bounce init-proj-settings!))) - (t9-3 obj) + (t9-3 this) ) - (quaternion-copy! (-> obj root quat) (-> (the-as gun (-> obj parent 0)) root quat)) - (set! (-> obj timeout) (seconds 4)) - (set! (-> (the-as collide-shape (-> obj root)) root-prim local-sphere w) 3276.8) - (logclear! (-> obj mask) (process-mask projectile)) + (quaternion-copy! (-> this root quat) (-> (the-as gun (-> this parent 0)) root quat)) + (set! (-> this timeout) (seconds 4)) + (set! (-> (the-as collide-shape (-> this root)) root-prim local-sphere w) 3276.8) + (logclear! (-> this mask) (process-mask projectile)) 0 (none) ) @@ -47,17 +47,17 @@ ) -(defmethod init-proj-settings! gun-mag-yellow ((obj gun-mag-yellow)) +(defmethod init-proj-settings! gun-mag-yellow ((this gun-mag-yellow)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj timeout) (seconds 4)) + (set! (-> this timeout) (seconds 4)) (sound-play "dark-shot-fire") 0 (none) @@ -72,17 +72,17 @@ ) -(defmethod init-proj-settings! gun-mag-red ((obj gun-mag-red)) +(defmethod init-proj-settings! gun-mag-red ((this gun-mag-red)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj timeout) (seconds 4)) + (set! (-> this timeout) (seconds 4)) (sound-play "dark-shot-fire") 0 (none) @@ -97,17 +97,17 @@ ) -(defmethod init-proj-settings! gun-mag-blue ((obj gun-mag-blue)) +(defmethod init-proj-settings! gun-mag-blue ((this gun-mag-blue)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj timeout) (seconds 4)) + (set! (-> this timeout) (seconds 4)) (sound-play "dark-shot-fire") 0 (none) @@ -122,17 +122,17 @@ ) -(defmethod init-proj-settings! gun-mag-dark ((obj gun-mag-dark)) +(defmethod init-proj-settings! gun-mag-dark ((this gun-mag-dark)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj timeout) (seconds 4)) + (set! (-> this timeout) (seconds 4)) (sound-play "dark-shot-fire") 0 (none) @@ -264,16 +264,16 @@ ) ;; WARN: Return type mismatch process-drawable vs gun. -(defmethod relocate gun ((obj gun) (arg0 int)) - (if (nonzero? (-> obj barrel)) - (&+! (-> obj barrel) arg0) +(defmethod relocate gun ((this gun) (arg0 int)) + (if (nonzero? (-> this barrel)) + (&+! (-> this barrel) arg0) ) (dotimes (v1-4 4) - (if (nonzero? (-> obj mag v1-4)) - (&+! (-> obj mag v1-4) arg0) + (if (nonzero? (-> this mag v1-4)) + (&+! (-> this mag v1-4) arg0) ) ) - (the-as gun ((method-of-type process-drawable relocate) obj arg0)) + (the-as gun ((method-of-type process-drawable relocate) this arg0)) ) (defbehavior gun-post gun () @@ -480,7 +480,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self draw shadow) (-> self shadow-backup)) (logior! (-> self skel status) (joint-control-status sync-math)) ) @@ -885,23 +885,23 @@ (none) ) -(defmethod gun-info-method-9 gun-info ((obj gun-info)) - (when (and (-> obj laser-active?) - (-> obj active?) - (not (logtest? (-> obj gun 0 draw status) (draw-control-status no-draw))) +(defmethod gun-info-method-9 gun-info ((this gun-info)) + (when (and (-> this laser-active?) + (-> this active?) + (not (logtest? (-> this gun 0 draw status) (draw-control-status no-draw))) #t ) - (let ((s5-0 (-> obj laser-point)) + (let ((s5-0 (-> this laser-point)) (s4-0 (new 'stack-no-clear 'collide-query)) - (s3-0 (-> obj laser-dir)) - (f30-0 (rotate-y<-vector+vector (the-as vector (-> obj laser-dir)) (-> obj laser-dir 1))) + (s3-0 (-> this laser-dir)) + (f30-0 (rotate-y<-vector+vector (the-as vector (-> this laser-dir)) (-> this laser-dir 1))) ) (vector+float*! (-> s4-0 start-pos) s5-0 (the-as vector s3-0) -8192.0) (vector-float*! (-> s4-0 move-dist) (the-as vector s3-0) 163840.0) (let ((v1-13 s4-0)) - (set! (-> v1-13 radius) (-> obj track-beam-size)) - (set! (-> v1-13 collide-with) (-> obj process 0 control root-prim prim-core collide-with)) - (set! (-> v1-13 ignore-process0) (ppointer->process (-> obj process))) + (set! (-> v1-13 radius) (-> this track-beam-size)) + (set! (-> v1-13 collide-with) (-> this process 0 control root-prim prim-core collide-with)) + (set! (-> v1-13 ignore-process0) (ppointer->process (-> this process))) (set! (-> v1-13 ignore-process1) #f) (set! (-> v1-13 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) @@ -912,7 +912,7 @@ (cond ((>= f0-3 0.0) (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) (-> s4-0 move-dist) f0-3) - (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) (the-as vector s3-0) (-> obj track-beam-size)) + (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) (the-as vector s3-0) (-> this track-beam-size)) (let* ((s2-0 (-> s4-0 best-other-tri collide-ptr)) (s0-0 (if (type? s2-0 collide-shape-prim) (the-as collide-shape-prim s2-0) @@ -925,9 +925,9 @@ (cond ((and s0-0 (or (logtest? (process-mask enemy guard) (-> s0-0 cshape process mask)) - (= (handle->process (-> obj track-target 0 handle)) (-> s0-0 cshape process)) + (= (handle->process (-> this track-target 0 handle)) (-> s0-0 cshape process)) ) - (>= (-> obj fire-range) (vector-vector-distance s2-1 s5-0)) + (>= (-> this fire-range) (vector-vector-distance s2-1 s5-0)) ) (vector+! s2-1 s2-1 s1-0) (launch-particles (-> *part-id-table* 185) s2-1) @@ -945,7 +945,7 @@ ) ) ) - (set! (-> obj laser-hit-point quad) (-> s4-0 start-pos quad)) + (set! (-> this laser-hit-point quad) (-> s4-0 start-pos quad)) (let ((s1-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (camera-pos) s5-0) 1.0)) (t9-10 vector-normalize!) (a0-41 (new 'stack-no-clear 'vector)) @@ -1004,5 +1004,5 @@ ) ) ) - (-> obj laser-dir) + (-> this laser-dir) ) diff --git a/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc b/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc index d9c92d05fe..8b90a6d437 100644 --- a/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-yellow-shot.gc @@ -63,14 +63,14 @@ ) -(defmethod draw-laser-sight gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod draw-laser-sight gun-yellow-shot ((this gun-yellow-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 227) (-> obj tail-pos) (-> obj starting-dir) #f #t) + (draw-beam (-> *part-id-table* 227) (-> this tail-pos) (-> this starting-dir) #f #t) 0 (none) ) -(defmethod spawn-impact-particles gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod spawn-impact-particles gun-yellow-shot ((this gun-yellow-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -80,8 +80,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((s4-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((s4-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) s4-0 a1-0)) (f30-0 (vector-length s5-1)) (gp-0 (new 'stack-no-clear 'vector)) @@ -136,20 +136,20 @@ ) ) -(defmethod deal-damage! gun-yellow-shot ((obj gun-yellow-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! gun-yellow-shot ((this gun-yellow-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) - (when (t9-0 obj arg0 arg1) - (set! (-> obj hit-actor?) #t) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) #t ) ) ) -(defmethod spawn-shell-particles gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod spawn-shell-particles gun-yellow-shot ((this gun-yellow-shot)) "TODO - confirm" (cond - ((-> obj hit-actor?) + ((-> this hit-actor?) (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) (when s5-0 (let ((t9-1 (method-of-type part-tracker activate))) @@ -170,7 +170,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -207,7 +207,7 @@ (t2-1 #f) (t3-1 *launch-matrix*) ) - (set! (-> t3-1 trans quad) (-> obj root trans quad)) + (set! (-> t3-1 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-5) a0-6 a1-5 @@ -229,7 +229,7 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound gun-yellow-shot ((obj gun-yellow-shot) (arg0 projectile-options)) +(defmethod play-impact-sound gun-yellow-shot ((this gun-yellow-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -242,29 +242,29 @@ (sound-play "yellow-shot-fiz") ) (else - (sound-play "yellow-shot-std" :id (-> obj sound-id) :position (-> obj root trans)) + (sound-play "yellow-shot-std" :id (-> this sound-id) :position (-> this root trans)) ) ) ) (none) ) -(defmethod made-impact? gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod made-impact? gun-yellow-shot ((this gun-yellow-shot)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a0-1 t1-0)) (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a0-1 ignore-process0) obj) - (set! (-> a0-1 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) (set! (-> a0-1 action-mask) (collide-action solid)) ) (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -10240.0 12697.6 -4096.0 t1-0) - (if (logtest? (-> obj root status) (collide-status touch-actor)) - (set! (-> obj hit-actor?) #t) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) ) #t ) @@ -301,9 +301,9 @@ (none) ) -(defmethod init-proj-collision! gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod init-proj-collision! gun-yellow-shot ((this gun-yellow-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -344,29 +344,29 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 (none) ) -(defmethod init-proj-settings! gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod init-proj-settings! gun-yellow-shot ((this gun-yellow-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj hit-actor?) #f) - (set! (-> obj tail-pos quad) (-> obj root trans quad)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj max-speed) 819200.0) - (set! (-> obj move) gun-yellow-shot-move) - (set! (-> obj timeout) (seconds 0.5)) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj damage) (if (logtest? (game-feature gun-upgrade-damage) (-> *game-info* features)) - 4.0 - 2.0 - ) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) gun-yellow-shot-move) + (set! (-> this timeout) (seconds 0.5)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this damage) (if (logtest? (game-feature gun-upgrade-damage) (-> *game-info* features)) + 4.0 + 2.0 + ) ) 0 (none) diff --git a/goal_src/jak2/engine/target/logic-target.gc b/goal_src/jak2/engine/target/logic-target.gc index 9b9e24d1fe..5adc193660 100644 --- a/goal_src/jak2/engine/target/logic-target.gc +++ b/goal_src/jak2/engine/target/logic-target.gc @@ -31,7 +31,7 @@ (defbehavior build-conversions target ((arg0 vector)) (when (!= (-> self control prev-surf) (-> self control surf)) (set! (-> self control prev-surf) (-> self control surf)) - (set! (-> self control time-of-last-surface-change) (current-time)) + (set-time! (-> self control time-of-last-surface-change)) ) (surface-mult! (-> self control current-surface) (-> self control mod-surface) (-> self control surf)) (when (and (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 3) @@ -639,14 +639,14 @@ (set! (-> self control idx-of-fastest-xz-vel) a0-3) (set! (-> self control average-xz-vel) f1-1) (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) - (set! (-> v1-7 0) (current-time)) + (set-time! (-> v1-7 0)) ) - (and (>= (the-as uint (- (current-time) (-> v1-7 0))) (the-as uint 300)) + (and (time-elapsed? (-> v1-7 0) (seconds 1)) (< f0-1 0.0) (< 32768.0 f1-1) (< 0.7 (-> self control pad-magnitude)) - (>= (- (current-time) (-> self control last-time-touching-actor)) (seconds 0.3)) - (>= (- (current-time) (-> self control time-of-last-lc)) (seconds 0.3)) + (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.3)) + (time-elapsed? (-> self control time-of-last-lc) (seconds 0.3)) (logtest? (-> self control status) (collide-status on-surface)) (and (< 0.7 (-> self control surface-angle)) #t) ) @@ -668,11 +668,11 @@ ) ) ) - (if (>= (- (current-time) (-> self control time-of-last-wall-hide-first-check-pass)) (seconds 0.1)) - (set! (-> self control time-of-first-wall-hide-first-check-pass) (current-time)) + (if (time-elapsed? (-> self control time-of-last-wall-hide-first-check-pass) (seconds 0.1)) + (set-time! (-> self control time-of-first-wall-hide-first-check-pass)) ) - (set! (-> self control time-of-last-wall-hide-first-check-pass) (current-time)) - (when (>= (- (current-time) (-> self control time-of-first-wall-hide-first-check-pass)) (seconds 0.5)) + (set-time! (-> self control time-of-last-wall-hide-first-check-pass)) + (when (time-elapsed? (-> self control time-of-first-wall-hide-first-check-pass) (seconds 0.5)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((v1-34 (-> gp-0 bbox)) (a0-13 (-> self control trans)) @@ -728,7 +728,7 @@ (defbehavior target-log-trans target () (let ((v1-1 (-> self control trans-log-idx))) - (set! (-> self control trans-log-times v1-1) (current-time)) + (set-time! (-> self control trans-log-times v1-1)) (set! (-> self control trans-log-trans v1-1 quad) (-> self control trans quad)) (set! (-> self control trans-log-idx) (logand (+ v1-1 1) 127)) ) @@ -745,7 +745,7 @@ (let* ((v1-0 127) (a1-2 (logand (+ (-> s4-0 trans-log-idx) v1-0) 127)) ) - (while (and (< (- (current-time) (-> s4-0 trans-log-times a1-2)) arg0) (> v1-0 0)) + (while (and (not (time-elapsed? (-> s4-0 trans-log-times a1-2) arg0)) (> v1-0 0)) (vector+! s5-0 s5-0 (-> s4-0 trans-log-trans a1-2)) (+! gp-0 1) (+! v1-0 -1) @@ -987,9 +987,9 @@ ) ) ) - (set! (-> self control time-of-last-clear-wall-in-jump) (current-time)) + (set-time! (-> self control time-of-last-clear-wall-in-jump)) ) - (if (< (- (current-time) (-> self control time-of-last-clear-wall-in-jump)) (seconds 0.2)) + (if (not (time-elapsed? (-> self control time-of-last-clear-wall-in-jump) (seconds 0.2))) (set! f30-0 (+ 204800.0 f30-0)) ) (if (and (not (logtest? (-> self control status) (collide-status touch-wall))) @@ -1132,14 +1132,14 @@ (collide-status on-surface touch-surface) ) ) - (< (- (current-time) (-> self control last-time-touching-actor)) (seconds 0.5)) + (not (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.5))) (not (and (-> self next-state) (let ((v1-15 (-> self next-state name))) (or (= v1-15 'target-walk) (= v1-15 'target-gun-walk)) ) ) ) - (< (- (current-time) (-> self state-time)) (seconds 0.5)) - (< (- (current-time) (-> self control time-of-last-lc)) (seconds 0.5)) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) + (not (time-elapsed? (-> self control time-of-last-lc) (seconds 0.5))) (logtest? (-> self control current-surface flags) (surface-flag turn-to-pad)) (!= (-> self control force-turn-to-strength) 0.0) ) @@ -1561,11 +1561,11 @@ (if (zero? (-> self control time-between-zero-inputs)) (set! (-> self control time-between-zero-inputs) (- (current-time) (-> self control time-of-last-zero-input))) ) - (set! (-> self control time-of-last-zero-input) (current-time)) + (set-time! (-> self control time-of-last-zero-input)) (quaternion-copy! (-> self control last-nonzero-input-dir-targ) (-> self control dir-targ)) ) (else - (set! (-> self control time-of-last-nonzero-input) (current-time)) + (set-time! (-> self control time-of-last-nonzero-input)) (set! (-> self control time-between-zero-inputs) 0) 0 ) @@ -1576,7 +1576,7 @@ ((-> self control current-surface active-hook)) (cond ((logtest? (-> self control status) (collide-status on-surface)) - (set! (-> self control last-time-on-surface) (current-time)) + (set-time! (-> self control last-time-on-surface)) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) (if (and (>= (-> self control coverage) 1.0) (not (logtest? (-> self control status) (collide-status touch-actor on-water))) @@ -1614,7 +1614,7 @@ (logtest? (-> self control mod-surface flags) (surface-flag look-around)) (not (focus-test? self edge-grab pole flut tube board pilot dark)) (-> *setting-control* user-current allow-look-around) - (>= (- (current-time) (the-as int (-> self no-look-around-wait))) (seconds 0.05)) + (time-elapsed? (the-as int (-> self no-look-around-wait)) (seconds 0.05)) (not (and (= (-> self control ground-pat material) (pat-material ice)) (< 4096.0 (-> self control ctrl-xz-vel))) ) ) @@ -1670,7 +1670,7 @@ ) ) (send-event *camera* 'reset-follow) - (set! (-> self control time-of-last-debug-float) (current-time)) + (set-time! (-> self control time-of-last-debug-float)) (cond ((focus-test? self mech indax) (if (not (and (-> self next-state) (let ((v1-179 (-> self next-state name))) @@ -1754,7 +1754,7 @@ ) ) (let ((v1-229 (-> self current-level))) - (if (and (or (>= (- (current-time) (-> self control last-time-on-surface)) (seconds 2)) (focus-test? self pilot)) + (if (and (or (time-elapsed? (-> self control last-time-on-surface) (seconds 2)) (focus-test? self pilot)) (and v1-229 (< (-> self control trans y) (-> v1-229 info buttom-height)) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) @@ -1788,19 +1788,19 @@ (defbehavior post-flag-setup target () (if (logtest? (-> self control status) (collide-status touch-wall touch-actor)) - (set! (-> self control last-time-touching-actor) (current-time)) + (set-time! (-> self control last-time-touching-actor)) ) (when (logtest? (-> self state-flags) (state-flags tinvul1)) (if (< (logand (- (current-time) (-> self control invul1-on-time)) 3) 1) (logior! (-> self draw status) (draw-control-status no-draw-bounds)) (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) ) - (if (>= (- (current-time) (-> self control invul1-on-time)) (-> self control invul1-off-time)) + (if (time-elapsed? (-> self control invul1-on-time) (-> self control invul1-off-time)) (target-timed-invulnerable-off self 1) ) ) (when (logtest? (state-flags tinvul2) (-> self state-flags)) - (if (>= (- (current-time) (-> self control invul2-on-time)) (-> self control invul2-off-time)) + (if (time-elapsed? (-> self control invul2-on-time) (-> self control invul2-off-time)) (target-timed-invulnerable-off self 2) ) ) @@ -2024,7 +2024,7 @@ (set! (-> self control hand-to-edge-dist) (vector-length s4-1)) (cond ((and (< 819.2 (-> self control hand-to-edge-dist)) - (>= (- (current-time) (-> self control last-successful-compute-edge-time)) (seconds 0.2)) + (time-elapsed? (-> self control last-successful-compute-edge-time) (seconds 0.2)) ) (cond ((-> s5-0 pilot-edge-grab?) @@ -2070,7 +2070,7 @@ ) ) (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) - (set! (-> self control rider-time) (current-time)) + (set-time! (-> self control rider-time)) (vector+! s3-1 s3-1 (-> self control cspace-offset)) (move-to-point! (-> self control) s3-1) ) @@ -2083,9 +2083,9 @@ (move-by-vector! (-> self control) a1-20) ) (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) - (set! (-> self control rider-time) (current-time)) - (if (and (>= (- (current-time) (-> self control edge-grab-start-time)) (seconds 0.5)) - (>= (- (current-time) (-> self control last-successful-compute-edge-time)) (seconds 0.5)) + (set-time! (-> self control rider-time)) + (if (and (time-elapsed? (-> self control edge-grab-start-time) (seconds 0.5)) + (time-elapsed? (-> self control last-successful-compute-edge-time) (seconds 0.5)) ) (send-event self 'end-mode) ) @@ -2096,13 +2096,13 @@ (let ((a1-23 (new 'stack-no-clear 'vector))) (vector-! a1-23 (-> s5-0 center-hold) (-> self control ctrl-to-hands-offset)) (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) - (set! (-> self control rider-time) (current-time)) + (set-time! (-> self control rider-time)) (vector+! a1-23 a1-23 (-> self control cspace-offset)) (move-to-point! (-> self control) a1-23) ) (set! (-> self control hand-to-edge-dist) 0.0) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) - (set! (-> self control last-successful-compute-edge-time) (current-time)) + (set-time! (-> self control last-successful-compute-edge-time)) ) ) ) @@ -2173,7 +2173,7 @@ ) (let ((a1-15 (vector-! (new-stack-vector0) (-> gp-0 center-hold) (-> gp-0 center-hold-old)))) (vector-float*! (-> self control rider-last-move) a1-15 (-> self clock frames-per-second)) - (set! (-> self control rider-time) (current-time)) + (set-time! (-> self control rider-time)) (move-by-vector! (-> self control) a1-15) ) ) @@ -2211,7 +2211,7 @@ (send-event *camera* 'ease-in 0.5 v1-10) ) (vector-segment-distance-point! (-> self control midpoint-of-hands) s4-1 s3-1 s5-0) - (if (< (- (current-time) (-> self state-time)) (seconds 0.05)) + (if (not (time-elapsed? (-> self state-time) (seconds 0.05))) (set! (-> self control hand-to-edge-dist) (fmax 0.0 (fmin 1.0 (/ (vector-vector-distance s4-1 s5-0) (* 2.0 (-> (the-as swingpole s2-0) edge-length))))) ) @@ -3036,7 +3036,7 @@ (set! (-> self control bent-gravity-normal quad) (-> self control standard-dynamics gravity-normal quad)) (quaternion-identity! (-> self control override-quat)) (set! (-> self control override-quat-alpha) 0.0) - (set! (-> self control last-time-on-surface) (current-time)) + (set-time! (-> self control last-time-on-surface)) (set! (-> self control bend-amount) 0.0) (set! (-> self control bend-speed) 32.0) (set! (-> self cam-user-mode) 'normal) @@ -3047,12 +3047,12 @@ self ) -(defmethod init-target target ((obj target) (arg0 continue-point) (arg1 symbol)) +(defmethod init-target target ((this target) (arg0 continue-point) (arg1 symbol)) (local-vars (s1-0 int) (s2-0 int) (s3-0 int) (s4-0 int) (sv-16 collide-shape-prim-group)) - (set! (-> obj tobot?) arg1) - (set! (-> obj tobot-recorder) #f) - (set! (-> obj mode-cache) #f) - (set! (-> obj color-effect) #f) + (set! (-> this tobot?) arg1) + (set! (-> this tobot-recorder) #f) + (set! (-> this mode-cache) #f) + (set! (-> this color-effect) #f) (set-setting! 'allow-pause #f 0.0 0) (set-setting! 'allow-progress #f 0.0 0) (set! (-> *setting-control* cam-default mode-name) 'cam-string) @@ -3062,11 +3062,11 @@ ) (set-continue! *game-info* arg0 #f) ;; og:preserve-this changed from 1024 - (stack-size-set! (-> obj main-thread) 2048) - (logior! (-> obj mask) (process-mask target)) - (set! (-> obj state-hook) (the-as (function none :behavior target) nothing)) + (stack-size-set! (-> this main-thread) 2048) + (logior! (-> this mask) (process-mask target)) + (set! (-> this state-hook) (the-as (function none :behavior target) nothing)) (cond - ((= (-> obj tobot?) 'tobot) + ((= (-> this tobot?) 'tobot) (set! s4-0 #x40000) (set! s3-0 #x2183f7f) (set! s2-0 #x40000) @@ -3079,7 +3079,7 @@ (set! s1-0 #x21c377c) ) ) - (let ((s0-0 (new 'process 'control-info obj (collide-list-enum hit-by-others)))) + (let ((s0-0 (new 'process 'control-info this (collide-list-enum hit-by-others)))) (set! (-> s0-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s0-0 reaction) target-collision-reaction) (set! (-> s0-0 no-reaction) target-collision-no-reaction) @@ -3152,9 +3152,9 @@ (set! (-> s0-0 backup-collide-with) (-> v1-66 prim-core collide-with)) ) (set! (-> s0-0 event-priority) (the-as uint 9)) - (set! (-> obj control) s0-0) + (set! (-> this control) s0-0) ) - (let ((v1-69 (-> obj control))) + (let ((v1-69 (-> this control))) (set! (-> v1-69 default-collide-as-all) (the-as collide-spec s4-0)) (set! (-> v1-69 default-collide-with-all) (the-as collide-spec s3-0)) (set! (-> v1-69 default-collide-as-fgnd) (the-as collide-spec s2-0)) @@ -3162,115 +3162,124 @@ (set! (-> v1-69 max-iteration-count) (the-as uint 8)) (set! (-> v1-69 event-self) 'touched) ) - (set! (-> obj game) *game-info*) - (move-to-point! (-> obj control) (-> arg0 trans)) - (set! (-> obj control camera-pos quad) (-> arg0 trans quad)) - (set! (-> obj focus-search) (new 'process 'boxed-array collide-shape 128)) - (set! (-> obj focus-search length) 0) - (set! (-> obj control cpad) (-> *cpad-list* cpads 0)) - (set! (-> obj control current-surface) (new 'process 'surface)) - (set! (-> obj control current-surface name) 'current) - (set! (-> obj control current-surface active-hook) nothing) - (set! (-> obj control current-surface touch-hook) nothing) - (set! (-> obj control send-attack-dest) (the-as handle #f)) + (set! (-> this game) *game-info*) + (move-to-point! (-> this control) (-> arg0 trans)) + (set! (-> this control camera-pos quad) (-> arg0 trans quad)) + (set! (-> this focus-search) (new 'process 'boxed-array collide-shape 128)) + (set! (-> this focus-search length) 0) + (set! (-> this control cpad) (-> *cpad-list* cpads 0)) + (set! (-> this control current-surface) (new 'process 'surface)) + (set! (-> this control current-surface name) 'current) + (set! (-> this control current-surface active-hook) nothing) + (set! (-> this control current-surface touch-hook) nothing) + (set! (-> this control send-attack-dest) (the-as handle #f)) (dotimes (v1-84 8) - (set! (-> obj attack-info-old v1-84 attacker) (the-as handle #f)) + (set! (-> this attack-info-old v1-84 attacker) (the-as handle #f)) ) - (set! (-> obj notify) (the-as handle #f)) - (set! (-> obj mirror) (the-as (pointer process-drawable) #f)) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this mirror) (the-as (pointer process-drawable) #f)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj skel effect flags) (effect-control-flag ecf0 ecf1)) - (let ((v1-94 (-> obj node-list data))) + (logior! (-> this skel effect flags) (effect-control-flag ecf0 ecf1)) + (let ((v1-94 (-> this node-list data))) (set! (-> v1-94 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) - (set! (-> v1-94 0 param1) (the-as basic (-> obj control trans))) - (set! (-> v1-94 0 param2) (the-as basic (-> obj control cspace-offset))) + (set! (-> v1-94 0 param1) (the-as basic (-> this control trans))) + (set! (-> v1-94 0 param2) (the-as basic (-> this control cspace-offset))) ) - (set! (-> obj skel override) (new 'process 'boxed-array float 54)) - (set! (-> obj draw light-index) (the-as uint 30)) - (set! (-> obj beard?) #t) - (set! (-> obj draw lod-set max-lod) 0) - (logior! (-> obj skel status) (joint-control-status sync-math blend-shape eye-anim)) - (set! (-> obj draw shadow-ctrl) *target-shadow-control*) - (set! (-> obj shadow-backup) (-> obj draw shadow)) - (set! (-> obj carry) - (new 'process 'carry-info obj 41 (new 'static 'vector :w 1.0) (new 'static 'vector :z 1.0 :w 1.0) 12743.111) + (set! (-> this skel override) (new 'process 'boxed-array float 54)) + (set! (-> this draw light-index) (the-as uint 30)) + (set! (-> this beard?) #t) + (set! (-> this draw lod-set max-lod) 0) + (logior! (-> this skel status) (joint-control-status sync-math blend-shape eye-anim)) + (set! (-> this draw shadow-ctrl) *target-shadow-control*) + (set! (-> this shadow-backup) (-> this draw shadow)) + (set! (-> this carry) + (new 'process 'carry-info this 41 (new 'static 'vector :w 1.0) (new 'static 'vector :z 1.0 :w 1.0) 12743.111) ) - (set! (-> obj control lhand-cspace) (-> obj node-list data 45)) - (set! (-> obj control rhand-cspace) (-> obj node-list data 55)) - (set! (-> obj control rhand-cspace) (-> obj node-list data 55)) - (set! (-> obj control sidekick-root parent) (-> obj node-list data 23)) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-mode look-at) obj 8)) - (set! (-> obj neck parented-scale?) #t) - (set! (-> obj neck base-joint) (the-as uint 6)) - (set! (-> obj neck ignore-angle) 16384.0) - (set! (-> obj head) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 7)) - (set! (-> obj head parented-scale?) #t) - (set! (-> obj upper-body) (new 'process 'joint-mod (joint-mod-mode gun-look-at) obj 4)) - (set! (-> obj upper-body parented-scale?) #t) - (set! (-> obj horns) (new 'process 'joint-mod (joint-mod-mode joint-set) obj 42)) - (set! (-> obj horns parented-scale?) #t) - (set! (-> obj horns track-mode) (track-mode no-trans no-rotate)) - (set! (-> obj hair 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 9)) - (set! (-> obj hair 0 parented-scale?) #t) - (set! (-> obj hair 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 10)) - (set! (-> obj hair 1 parented-scale?) #t) - (set! (-> obj arm-ik 0) (new 'process 'joint-mod-ik obj 17 1228.8)) - (set! (-> obj arm-ik 1) (new 'process 'joint-mod-ik obj 21 -1228.8)) - (set! (-> obj arm-ik 1 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj arm-ik 1 elbow-rotation-axis) (the-as uint 0)) - (set! (-> obj leg-ik 0) (new 'process 'joint-mod-ik obj 28 1687.552)) - (set! (-> obj leg-ik 0 callback) (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback)) - (set! (-> obj leg-ik 0 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj leg-ik 0 elbow-rotation-axis) (the-as uint 0)) - (logior! (-> obj leg-ik 0 flags) (joint-mod-ik-flags elbow-trans-neg)) - (set! (-> obj leg-ik 1) (new 'process 'joint-mod-ik obj 35 -1687.552)) - (set! (-> obj leg-ik 1 callback) (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback)) - (set! (-> obj leg-ik 1 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj leg-ik 1 elbow-rotation-axis) (the-as uint 0)) - (set! (-> obj foot 0) (new 'process 'joint-mod (joint-mod-mode foot-rot) obj 29)) - (set! (-> obj foot 1) (new 'process 'joint-mod (joint-mod-mode foot-rot) obj 36)) - (set! (-> obj fact) - (new 'process 'fact-info-target obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this control lhand-cspace) (-> this node-list data 45)) + (set! (-> this control rhand-cspace) (-> this node-list data 55)) + (set! (-> this control rhand-cspace) (-> this node-list data 55)) + (set! (-> this control sidekick-root parent) (-> this node-list data 23)) + (set! (-> this neck) (new 'process 'joint-mod (joint-mod-mode look-at) this 8)) + (set! (-> this neck parented-scale?) #t) + (set! (-> this neck base-joint) (the-as uint 6)) + (set! (-> this neck ignore-angle) 16384.0) + (set! (-> this head) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 7)) + (set! (-> this head parented-scale?) #t) + (set! (-> this upper-body) (new 'process 'joint-mod (joint-mod-mode gun-look-at) this 4)) + (set! (-> this upper-body parented-scale?) #t) + (set! (-> this horns) (new 'process 'joint-mod (joint-mod-mode joint-set) this 42)) + (set! (-> this horns parented-scale?) #t) + (set! (-> this horns track-mode) (track-mode no-trans no-rotate)) + (set! (-> this hair 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 9)) + (set! (-> this hair 0 parented-scale?) #t) + (set! (-> this hair 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 10)) + (set! (-> this hair 1 parented-scale?) #t) + (set! (-> this arm-ik 0) (new 'process 'joint-mod-ik this 17 1228.8)) + (set! (-> this arm-ik 1) (new 'process 'joint-mod-ik this 21 -1228.8)) + (set! (-> this arm-ik 1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this arm-ik 1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this leg-ik 0) (new 'process 'joint-mod-ik this 28 1687.552)) + (set! (-> this leg-ik 0 callback) + (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback) ) - (target-gun-setup (logtest? (-> obj game features) (game-feature gun))) - (target-board-setup (logtest? (-> obj game features) (game-feature board))) - (target-sidekick-setup (logtest? (-> obj game features) (game-feature sidekick))) - (target-darkjak-setup (logtest? (-> obj game features) (game-feature darkjak))) + (set! (-> this leg-ik 0 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this leg-ik 0 elbow-rotation-axis) (the-as uint 0)) + (logior! (-> this leg-ik 0 flags) (joint-mod-ik-flags elbow-trans-neg)) + (set! (-> this leg-ik 1) (new 'process 'joint-mod-ik this 35 -1687.552)) + (set! (-> this leg-ik 1 callback) + (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback) + ) + (set! (-> this leg-ik 1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this leg-ik 1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this foot 0) (new 'process 'joint-mod (joint-mod-mode foot-rot) this 29)) + (set! (-> this foot 1) (new 'process 'joint-mod (joint-mod-mode foot-rot) this 36)) + (set! (-> this fact) (new + 'process + 'fact-info-target + this + (pickup-type eco-pill-random) + (-> *FACT-bank* default-eco-pill-green-inc) + ) + ) + (target-gun-setup (logtest? (-> this game features) (game-feature gun))) + (target-board-setup (logtest? (-> this game features) (game-feature board))) + (target-sidekick-setup (logtest? (-> this game features) (game-feature sidekick))) + (target-darkjak-setup (logtest? (-> this game features) (game-feature darkjak))) (target-collide-set! 'normal 0.0) - (let ((v1-163 (-> obj control root-prim))) - (set! (-> obj control backup-collide-as) (-> v1-163 prim-core collide-as)) - (set! (-> obj control backup-collide-with) (-> v1-163 prim-core collide-with)) + (let ((v1-163 (-> this control root-prim))) + (set! (-> this control backup-collide-as) (-> v1-163 prim-core collide-as)) + (set! (-> this control backup-collide-with) (-> v1-163 prim-core collide-with)) ) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj control trans))) - (set! (-> obj control unknown-sound-id04) (new-sound-id)) - (set! (-> obj control bubbles-sound) (new-sound-id)) - (set! (-> obj control board-jump-and-swim-sound) (new-sound-id)) - (if (and *debug-segment* (!= (-> obj tobot?) 'tobot)) - (add-connection *debug-engine* obj target-print-stats obj *stdcon0* #f) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this control trans))) + (set! (-> this control unknown-sound-id04) (new-sound-id)) + (set! (-> this control bubbles-sound) (new-sound-id)) + (set! (-> this control board-jump-and-swim-sound) (new-sound-id)) + (if (and *debug-segment* (!= (-> this tobot?) 'tobot)) + (add-connection *debug-engine* this target-print-stats this *stdcon0* #f) ) - (if (!= (-> obj tobot?) 'tobot) - (activate-hud obj) + (if (!= (-> this tobot?) 'tobot) + (activate-hud this) ) - (set! (-> obj fp-hud) (the-as handle #f)) - (set! (-> obj burn-proc) (the-as handle #f)) - (set! (-> obj water) (new 'process 'water-control obj 10 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags swim-ground part-splash part-drip part-rings part-water find-water)) + (set! (-> this fp-hud) (the-as handle #f)) + (set! (-> this burn-proc) (the-as handle #f)) + (set! (-> this water) (new 'process 'water-control this 10 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags swim-ground part-splash part-drip part-rings part-water find-water)) (reset-target-state #t) - (set! (-> obj control last-trans-any-surf quad) (-> obj control trans quad)) - (+! (-> obj control last-trans-any-surf y) -819200.0) - (set! (-> obj align) (new 'process 'align-control obj)) - (set! (-> obj manipy) (the-as (pointer manipy) #f)) - (set! (-> obj event-hook) target-generic-event-handler) - (set! (-> obj current-level) #f) + (set! (-> this control last-trans-any-surf quad) (-> this control trans quad)) + (+! (-> this control last-trans-any-surf y) -819200.0) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this manipy) (the-as (pointer manipy) #f)) + (set! (-> this event-hook) target-generic-event-handler) + (set! (-> this current-level) #f) (level-setup) - (set! (-> obj pre-joint-hook) (the-as (function none :behavior target) nothing)) - (set! (-> obj init-time) (current-time)) - (set! (-> obj spool-anim) (the-as spool-anim #t)) - (set! (-> obj ambient-time) (current-time)) + (set! (-> this pre-joint-hook) (the-as (function none :behavior target) nothing)) + (set-time! (-> this init-time)) + (set! (-> this spool-anim) (the-as spool-anim #t)) + (set-time! (-> this ambient-time)) 0 (none) ) @@ -3294,14 +3303,14 @@ (none) ) -(defmethod deactivate target ((obj target)) +(defmethod deactivate target ((this target)) (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) - (if (nonzero? (-> obj darkjak)) - (sound-stop (-> obj darkjak tone)) + (if (nonzero? (-> this darkjak)) + (sound-stop (-> this darkjak tone)) ) (set! (-> *setting-control* cam-default mode-name) #f) (set-zero! *camera-smush-control*) - ((the-as (function target none) (find-parent-method target 10)) obj) + ((the-as (function target none) (find-parent-method target 10)) this) (none) ) diff --git a/goal_src/jak2/engine/target/mech/carry-h.gc b/goal_src/jak2/engine/target/mech/carry-h.gc index a8aa8f3484..d8e8fc9e9c 100644 --- a/goal_src/jak2/engine/target/mech/carry-h.gc +++ b/goal_src/jak2/engine/target/mech/carry-h.gc @@ -104,76 +104,76 @@ ) ) -(defmethod carry-info-method-9 carry-info ((obj carry-info)) - (let ((s5-0 (-> obj process 0 node-list data (-> obj joint) bone transform))) - (vector-rotate*! (-> obj normal) (-> obj local-normal) s5-0) - (vector-matrix*! (-> obj point) (-> obj local-point) s5-0) +(defmethod carry-info-method-9 carry-info ((this carry-info)) + (let ((s5-0 (-> this process 0 node-list data (-> this joint) bone transform))) + (vector-rotate*! (-> this normal) (-> this local-normal) s5-0) + (vector-matrix*! (-> this point) (-> this local-point) s5-0) ) 0 (none) ) -(defmethod distance-from-destination carry-info ((obj carry-info) (arg0 carry-info)) +(defmethod distance-from-destination carry-info ((this carry-info) (arg0 carry-info)) "Returns the distance from the current `point` and the provided [[carry-info]]'s `point`. Returns `-1.0` if it exceeds the maximum allowed" - (let* ((f28-0 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> arg0 point) (-> obj point)))) - (f30-0 (fabs (deg-diff f28-0 (vector-y-angle (-> obj normal))))) + (let* ((f28-0 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> arg0 point) (-> this point)))) + (f30-0 (fabs (deg-diff f28-0 (vector-y-angle (-> this normal))))) (f28-1 (fabs (deg-diff (+ 32768.0 f28-0) (vector-y-angle (-> arg0 normal))))) - (f26-0 (vector-vector-distance (-> obj point) (-> arg0 point))) + (f26-0 (vector-vector-distance (-> this point) (-> arg0 point))) ) (cond - ((or (< (-> obj max-distance) f26-0) + ((or (< (-> this max-distance) f26-0) (< (-> arg0 max-distance) f26-0) - (< (-> obj max-angle) f30-0) - (or (< (-> arg0 max-angle) f28-1) (not (logtest? (-> obj mode) (-> arg0 mode)))) + (< (-> this max-angle) f30-0) + (or (< (-> arg0 max-angle) f28-1) (not (logtest? (-> this mode) (-> arg0 mode)))) ) - (if (< (-> obj max-distance) f26-0) + (if (< (-> this max-distance) f26-0) (format #t " ~A ~A failed for this distance ~M ~M~%" - (-> obj process 0 name) + (-> this process 0 name) (-> arg0 process 0 name) f26-0 - (-> obj max-distance) + (-> this max-distance) ) ) (if (< (-> arg0 max-distance) f26-0) (format #t " ~A ~A failed for other distance ~M ~M~%" - (-> obj process 0 name) + (-> this process 0 name) (-> arg0 process 0 name) f26-0 (-> arg0 max-distance) ) ) - (if (< (-> obj max-angle) f30-0) + (if (< (-> this max-angle) f30-0) (format #t " ~A ~A failed for this angle ~R ~R~%" - (-> obj process 0 name) + (-> this process 0 name) (-> arg0 process 0 name) f30-0 - (-> obj max-angle) + (-> this max-angle) ) ) (if (< (-> arg0 max-angle) f28-1) (format #t " ~A ~A failed for other angle ~R ~R~%" - (-> obj process 0 name) + (-> this process 0 name) (-> arg0 process 0 name) f28-1 (-> arg0 max-angle) ) ) - (if (not (logtest? (-> obj mode) (-> arg0 mode))) + (if (not (logtest? (-> this mode) (-> arg0 mode))) (format #t " ~A ~A failed for mode ~X ~X~%" - (-> obj process 0 name) + (-> this process 0 name) (-> arg0 process 0 name) - (-> obj mode) + (-> this mode) (-> arg0 mode) ) ) @@ -186,18 +186,18 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) -(defmethod drag! carry-info ((obj carry-info) (arg0 carry-info)) +(defmethod drag! carry-info ((this carry-info) (arg0 carry-info)) (let ((v1-0 (-> arg0 process))) - (set! (-> obj other) (the-as handle (logior (if v1-0 - (new 'static 'handle :pid (-> v1-0 0 pid)) - (new 'static 'handle) - ) - (new 'static 'handle :process v1-0) - ) - ) + (set! (-> this other) (the-as handle (logior (if v1-0 + (new 'static 'handle :pid (-> v1-0 0 pid)) + (new 'static 'handle) + ) + (new 'static 'handle :process v1-0) + ) + ) ) ) - (let ((v1-3 (-> obj process))) + (let ((v1-3 (-> this process))) (set! (-> arg0 other) (the-as handle (logior (if v1-3 (new 'static 'handle :pid (-> v1-3 0 pid)) (new 'static 'handle) @@ -207,7 +207,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) ) - (set! (-> obj pickup-time) (-> obj process 0 clock frame-counter)) + (set! (-> this pickup-time) (-> this process 0 clock frame-counter)) (set! (-> arg0 pickup-time) (-> arg0 process 0 clock frame-counter)) (set! (-> arg0 grab-trans-blend) 1.0) (let* ((s4-0 (the-as collide-shape (-> arg0 process 0 control))) @@ -221,7 +221,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) (quaternion-copy! (-> arg0 grab-quat) (-> arg0 process 0 control quat)) - (quaternion-rotate-y! (-> arg0 grab-quat) (-> arg0 grab-quat) (- (vector-y-angle (-> obj normal)))) + (quaternion-rotate-y! (-> arg0 grab-quat) (-> arg0 grab-quat) (- (vector-y-angle (-> this normal)))) (let* ((f30-0 (quaternion-y-angle (-> arg0 grab-quat))) (f0-8 (the float (the int (* 0.000061035156 (+ 73728.0 (the float (sar (shl (the int f30-0) 48) 48))))))) (f28-0 (the float (sar (shl (the int (* 16384.0 f0-8)) 48) 48))) @@ -233,7 +233,7 @@ Returns `-1.0` if it exceeds the maximum allowed" (-> arg0 process 0 node-list data (-> arg0 joint) bone transform) ) ) - (s4-3 (vector-negate! (new 'stack-no-clear 'vector) (-> obj normal))) + (s4-3 (vector-negate! (new 'stack-no-clear 'vector) (-> this normal))) ) (set! (-> s4-3 y) 0.0) (vector-xz-normalize! s4-3 (-> arg0 max-pull)) @@ -255,7 +255,7 @@ Returns `-1.0` if it exceeds the maximum allowed" (-> arg0 local-point z) ) ) - (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> obj process))) + (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> this process))) (let ((v1-49 (-> (the-as collide-shape (-> (the-as process-drawable (ppointer->process (-> arg0 process))) root)) root-prim ) @@ -285,7 +285,7 @@ Returns `-1.0` if it exceeds the maximum allowed" (none) ) -(defmethod drop-impl! carry-info ((obj carry-info) (arg0 carry-info)) +(defmethod drop-impl! carry-info ((this carry-info) (arg0 carry-info)) (let ((a1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 process 0 control quat)))) (set! (-> a1-2 y) 0.0) (set-heading-vec-clear-roll-pitch! (-> arg0 process 0 control) a1-2) @@ -300,7 +300,7 @@ Returns `-1.0` if it exceeds the maximum allowed" (set! (-> v1-9 root-prim local-sphere w) (-> arg0 backup-radius)) ) ) - (set! (-> obj other) (the-as handle #f)) + (set! (-> this other) (the-as handle #f)) (set! (-> arg0 other) (the-as handle #f)) (change-parent (ppointer->process (-> arg0 process)) *entity-pool*) (let ((v1-16 @@ -324,21 +324,25 @@ Returns `-1.0` if it exceeds the maximum allowed" (none) ) -(defmethod carry-info-method-13 carry-info ((obj carry-info)) +(defmethod carry-info-method-13 carry-info ((this carry-info)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'carry-info) - (let* ((s4-0 (the-as carry-info (send-event-function (handle->process (-> obj other)) a1-0))) - (s2-0 (-> obj process 0 node-list data (-> obj joint) bone transform)) - (v1-10 - (vector-matrix*! - (new 'stack-no-clear 'vector) - (vector-lerp! (new 'stack-no-clear 'vector) (-> obj hold-trans) (-> obj grab-trans) (-> obj grab-trans-blend)) - s2-0 - ) - ) - (s3-2 (vector-! (new 'stack-no-clear 'vector) v1-10 (-> obj process 0 control trans))) + (let* ((s4-0 (the-as carry-info (send-event-function (handle->process (-> this other)) a1-0))) + (s2-0 (-> this process 0 node-list data (-> this joint) bone transform)) + (v1-10 (vector-matrix*! + (new 'stack-no-clear 'vector) + (vector-lerp! + (new 'stack-no-clear 'vector) + (-> this hold-trans) + (-> this grab-trans) + (-> this grab-trans-blend) + ) + s2-0 + ) + ) + (s3-2 (vector-! (new 'stack-no-clear 'vector) v1-10 (-> this process 0 control trans))) ) (when s4-0 (let ((s5-1 (new 'stack-no-clear 'matrix))) @@ -358,25 +362,25 @@ Returns `-1.0` if it exceeds the maximum allowed" (vector-normalize! (-> s5-1 vector 2) 1.0) (vector-reset! (-> s5-1 trans)) (let* ((a1-8 (quaternion-normalize! (matrix->quaternion (new 'stack-no-clear 'quaternion) s5-1))) - (s5-3 (quaternion-normalize! (quaternion*! a1-8 a1-8 (-> obj grab-quat)))) + (s5-3 (quaternion-normalize! (quaternion*! a1-8 a1-8 (-> this grab-quat)))) (v1-19 (vector-! (new 'stack-no-clear 'vector) (-> s4-0 point) s3-2)) - (f30-0 (* 0.033333335 (the float (- (current-time) (-> obj pickup-time))))) + (f30-0 (* 0.033333335 (the float (- (current-time) (-> this pickup-time))))) ) (cond - ((>= (- (current-time) (-> obj pickup-time)) (seconds 1)) - (set! (-> obj process 0 control trans quad) (-> v1-19 quad)) - (quaternion-copy! (-> obj process 0 control quat) s5-3) + ((time-elapsed? (-> this pickup-time) (seconds 1)) + (set! (-> this process 0 control trans quad) (-> v1-19 quad)) + (quaternion-copy! (-> this process 0 control quat) s5-3) ) (else (vector-lerp! - (-> obj process 0 control trans) - (-> obj process 0 control trans) + (-> this process 0 control trans) + (-> this process 0 control trans) v1-19 (fmin 1.0 (* f30-0 (-> self clock time-adjust-ratio))) ) (quaternion-slerp! - (-> obj process 0 control quat) - (-> obj process 0 control quat) + (-> this process 0 control quat) + (-> this process 0 control quat) s5-3 (fmin 1.0 (* f30-0 (-> self clock time-adjust-ratio))) ) @@ -391,18 +395,18 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ;; WARN: Return type mismatch vector vs none. -(defmethod carry! carry-info ((obj carry-info) (arg0 carry-info) (arg1 vector) (arg2 vector)) +(defmethod carry! carry-info ((this carry-info) (arg0 carry-info) (arg1 vector) (arg2 vector)) (let ((v1-0 (-> arg0 process))) - (set! (-> obj other) (the-as handle (logior (if v1-0 - (new 'static 'handle :pid (-> v1-0 0 pid)) - (new 'static 'handle) - ) - (new 'static 'handle :process v1-0) - ) - ) + (set! (-> this other) (the-as handle (logior (if v1-0 + (new 'static 'handle :pid (-> v1-0 0 pid)) + (new 'static 'handle) + ) + (new 'static 'handle :process v1-0) + ) + ) ) ) - (let ((v1-3 (-> obj process))) + (let ((v1-3 (-> this process))) (set! (-> arg0 other) (the-as handle (logior (if v1-3 (new 'static 'handle :pid (-> v1-3 0 pid)) (new 'static 'handle) @@ -412,7 +416,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) ) - (set! (-> obj pickup-time) (-> obj process 0 clock frame-counter)) + (set! (-> this pickup-time) (-> this process 0 clock frame-counter)) (set! (-> arg0 pickup-time) (-> arg0 process 0 clock frame-counter)) (set! (-> arg0 grab-trans-blend) 1.0) (let* ((s2-0 (the-as collide-shape (-> arg0 process 0 control))) @@ -427,13 +431,13 @@ Returns `-1.0` if it exceeds the maximum allowed" ) (quaternion-copy! (-> arg0 grab-quat) (-> arg0 process 0 control quat)) (set! (-> arg0 grab-trans quad) (-> arg0 process 0 control trans quad)) - (set! (-> arg0 hold-trans quad) (-> obj process 0 control trans quad)) - (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (-> obj point) (-> arg0 point)))) + (set! (-> arg0 hold-trans quad) (-> this process 0 control trans quad)) + (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (-> this point) (-> arg0 point)))) (vector-xz-normalize! s2-2 (-> arg0 max-pull)) (vector+! s2-2 s2-2 (-> arg0 point)) (let ((f30-0 (y-angle (-> arg0 process 0 control)))) - (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-2 (-> obj process 0 control trans))) - (let* ((f0-5 (the float (-> obj face-dir))) + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-2 (-> this process 0 control trans))) + (let* ((f0-5 (the float (-> this face-dir))) (f28-0 (the float (sar (shl (the int (* 16384.0 f0-5)) 48) 48))) ) (set-vector! arg2 (sin (+ f30-0 f28-0)) 0.0 (cos (+ f30-0 f28-0)) 1.0) @@ -441,7 +445,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) (vector+float*! arg1 (-> arg0 point) arg2 (- (-> arg0 carry-radius))) - (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> obj process))) + (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> this process))) (let ((v1-49 (-> (the-as collide-shape (-> (the-as process-drawable (ppointer->process (-> arg0 process))) root)) root-prim ) @@ -470,15 +474,15 @@ Returns `-1.0` if it exceeds the maximum allowed" (none) ) -(defmethod translate! carry-info ((obj carry-info)) +(defmethod translate! carry-info ((this carry-info)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'carry-info) - (let ((a0-6 (the-as carry-info (send-event-function (handle->process (-> obj other)) a1-0)))) + (let ((a0-6 (the-as carry-info (send-event-function (handle->process (-> this other)) a1-0)))) (when a0-6 - (let ((v1-6 (vector-! (new 'stack-no-clear 'vector) (-> obj grab-trans) (-> obj hold-trans)))) - (vector+! (-> obj process 0 control trans) (-> a0-6 process 0 control trans) v1-6) + (let ((v1-6 (vector-! (new 'stack-no-clear 'vector) (-> this grab-trans) (-> this hold-trans)))) + (vector+! (-> this process 0 control trans) (-> a0-6 process 0 control trans) v1-6) ) #t ) @@ -486,7 +490,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) -(defmethod drop! carry-info ((obj carry-info) (arg0 carry-info)) - (drop-impl! obj arg0) +(defmethod drop! carry-info ((this carry-info) (arg0 carry-info)) + (drop-impl! this arg0) (none) ) diff --git a/goal_src/jak2/engine/target/mech/grunt-mech.gc b/goal_src/jak2/engine/target/mech/grunt-mech.gc index bc6595514c..e43e100052 100644 --- a/goal_src/jak2/engine/target/mech/grunt-mech.gc +++ b/goal_src/jak2/engine/target/mech/grunt-mech.gc @@ -93,32 +93,32 @@ ) ) -(defmethod grunt-mech-info-method-10 grunt-mech-info ((obj grunt-mech-info)) +(defmethod grunt-mech-info-method-10 grunt-mech-info ((this grunt-mech-info)) (let ((s5-0 (current-time))) - (when (!= (-> obj last-update-time) s5-0) - (when (< s5-0 (-> obj last-update-time)) + (when (!= (-> this last-update-time) s5-0) + (when (< s5-0 (-> this last-update-time)) (countdown (v1-4 6) - (let ((a0-4 (-> obj holds v1-4))) + (let ((a0-4 (-> this holds v1-4))) (set! (-> a0-4 grunt-handle) (the-as handle #f)) (set! (-> a0-4 timeout) (the-as uint 0)) ) 0 ) - (set! (-> obj reserved-mask) (the-as uint 0)) + (set! (-> this reserved-mask) (the-as uint 0)) 0 ) - (set! (-> obj last-update-time) s5-0) + (set! (-> this last-update-time) s5-0) (let ((v1-8 *target*)) (cond ((and v1-8 (focus-test? v1-8 mech)) (let ((s4-0 (-> v1-8 manipy 0 node-list data 3))) (dotimes (s3-0 6) - (let ((s2-0 (-> obj holds s3-0))) + (let ((s2-0 (-> this holds s3-0))) (matrix*! (-> s2-0 world-mat) (-> s2-0 local-mat) (-> s4-0 bone transform)) (vector-float*! (-> s2-0 world-mat trans) (-> s2-0 world-mat trans) (/ 1.0 (-> s2-0 world-mat trans w))) (when (and (!= (-> s2-0 grunt-handle) #f) (>= s5-0 (the-as time-frame (-> s2-0 timeout)))) (set! (-> s2-0 grunt-handle) (the-as handle #f)) - (logclear! (-> obj reserved-mask) (-> s2-0 reserve-mask)) + (logclear! (-> this reserved-mask) (-> s2-0 reserve-mask)) ) ) ) @@ -126,13 +126,13 @@ ) (else (countdown (v1-25 6) - (let ((a0-16 (-> obj holds v1-25))) + (let ((a0-16 (-> this holds v1-25))) (set! (-> a0-16 grunt-handle) (the-as handle #f)) (set! (-> a0-16 timeout) (the-as uint 0)) ) 0 ) - (set! (-> obj reserved-mask) (the-as uint 0)) + (set! (-> this reserved-mask) (the-as uint 0)) 0 ) ) @@ -142,18 +142,18 @@ (none) ) -(defmethod grunt-mech-info-method-9 grunt-mech-info ((obj grunt-mech-info) (arg0 int) (arg1 process) (arg2 symbol)) - (grunt-mech-info-method-10 obj) +(defmethod grunt-mech-info-method-9 grunt-mech-info ((this grunt-mech-info) (arg0 int) (arg1 process) (arg2 symbol)) + (grunt-mech-info-method-10 this) (let ((v1-2 *target*)) (when (and v1-2 (focus-test? v1-2 mech) (not (logtest? (-> v1-2 focus-status) (focus-status dead ignore)))) - (let ((v1-8 (-> obj holds arg0))) + (let ((v1-8 (-> this holds arg0))) (when (and (!= (-> v1-8 grunt-handle) #f) (= (handle->process (-> v1-8 grunt-handle)) arg1)) (set! (-> v1-8 timeout) (the-as uint (+ (current-time) (seconds 0.5)))) (return #t) ) - (when (not (logtest? (-> obj reserved-mask) (-> v1-8 reserve-mask))) + (when (not (logtest? (-> this reserved-mask) (-> v1-8 reserve-mask))) (when (not arg2) - (logior! (-> obj reserved-mask) (-> v1-8 reserve-mask)) + (logior! (-> this reserved-mask) (-> v1-8 reserve-mask)) (set! (-> v1-8 grunt-handle) (process->handle arg1)) (set! (-> v1-8 timeout) (the-as uint (+ (current-time) (seconds 0.5)))) ) @@ -187,12 +187,12 @@ ) -(defmethod track-target! grunt-mech ((obj grunt-mech)) +(defmethod track-target! grunt-mech ((this grunt-mech)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - ((method-of-type grunt track-target!) obj) + ((method-of-type grunt track-target!) this) 0 (none) ) @@ -200,23 +200,23 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod grunt-mech-method-193 grunt-mech ((obj grunt-mech)) +(defmethod grunt-mech-method-193 grunt-mech ((this grunt-mech)) (local-vars (f0-3 float) (sv-592 vector)) (let ((s4-0 *grunt-mech-info*)) (grunt-mech-info-method-10 s4-0) (let ((gp-0 -1)) (let ((f30-0 0.0) - (s3-0 (-> obj root trans)) + (s3-0 (-> this root trans)) ) (countdown (s2-0 4) (let ((s1-0 (-> s4-0 holds s2-0))) - (when (grunt-mech-info-method-9 s4-0 s2-0 obj #t) + (when (grunt-mech-info-method-9 s4-0 s2-0 this #t) (let ((s0-0 (new 'stack-no-clear 'vector))) (set! sv-592 (new 'stack-no-clear 'vector)) (set! (-> s0-0 quad) (-> s1-0 world-mat vector 2 quad)) (set! (-> s0-0 y) 0.0) (vector-normalize! s0-0 1.0) - (vector-! sv-592 (-> s1-0 world-mat trans) (-> obj root trans)) + (vector-! sv-592 (-> s1-0 world-mat trans) (-> this root trans)) (set! (-> sv-592 y) 0.0) (vector-normalize! sv-592 1.0) (let ((f0-2 (-> sv-592 x)) @@ -226,6 +226,7 @@ (f4-0 (-> s0-0 y)) (f5-0 (-> s0-0 z)) ) + ;; og:preserve-this inlined vector-dot ;; (.mula.s f0-2 f3-0) ;; (.madda.s f1-0 f4-0) ;; (.madd.s f0-3 f2-0 f5-0) @@ -247,17 +248,17 @@ (when (!= gp-0 -1) (let ((s3-1 (-> s4-0 holds gp-0 lower-hold))) (when (!= s3-1 -1) - (if (and (or (zero? (get-rand-int obj 2)) - (>= 14336.0 (vector-vector-xz-distance-squared (-> obj root trans) (target-pos 0))) + (if (and (or (zero? (get-rand-int this 2)) + (>= 14336.0 (vector-vector-xz-distance-squared (-> this root trans) (target-pos 0))) ) - (grunt-mech-info-method-9 s4-0 s3-1 obj #t) + (grunt-mech-info-method-9 s4-0 s3-1 this #t) ) (set! gp-0 s3-1) ) ) ) (let ((a1-9 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-9 start-pos quad) (-> obj root trans quad)) + (set! (-> a1-9 start-pos quad) (-> this root trans quad)) (+! (-> a1-9 start-pos y) 6144.0) (vector-! (-> a1-9 move-dist) @@ -267,7 +268,7 @@ (let ((v1-41 a1-9)) (set! (-> v1-41 radius) 2048.0) (set! (-> v1-41 collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) - (set! (-> v1-41 ignore-process0) obj) + (set! (-> v1-41 ignore-process0) this) (set! (-> v1-41 ignore-process1) #f) (set! (-> v1-41 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-41 action-mask) (collide-action solid)) @@ -282,7 +283,7 @@ ) ) -(defmethod grunt-method-184 grunt-mech ((obj grunt-mech) (arg0 float)) +(defmethod grunt-method-184 grunt-mech ((this grunt-mech) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -290,14 +291,14 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((gp-0 (get-enemy-target obj))) + (let ((gp-0 (get-enemy-target this))) (when gp-0 (cond ((focus-test? gp-0 mech) (let ((v1-4 (get-trans gp-0 0)) (a1-2 (new 'stack-no-clear 'vector)) ) - (vector-! a1-2 v1-4 (-> obj root trans)) + (vector-! a1-2 v1-4 (-> this root trans)) (.lvf vf1 (&-> a1-2 quad)) ) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -310,15 +311,15 @@ (f1-0 28672.0) ) (when (>= (* f1-0 f1-0) f0-0) - (let ((a1-3 (grunt-mech-method-193 obj))) + (let ((a1-3 (grunt-mech-method-193 this))) (cond ((= a1-3 -1) - (go (method-of-object obj mech-pre-circling)) + (go (method-of-object this mech-pre-circling)) ) (else - (set! (-> obj hold-id) a1-3) - (grunt-mech-info-method-9 *grunt-mech-info* a1-3 obj #f) - (go (method-of-object obj mech-lunge)) + (set! (-> this hold-id) a1-3) + (grunt-mech-info-method-9 *grunt-mech-info* a1-3 this #f) + (go (method-of-object this mech-lunge)) ) ) ) @@ -327,7 +328,7 @@ gp-0 ) (else - ((method-of-type grunt grunt-method-184) obj arg0) + ((method-of-type grunt grunt-method-184) this arg0) ) ) ) @@ -405,7 +406,7 @@ (none) ) -(defmethod grunt-mech-method-195 grunt-mech ((obj grunt-mech) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod grunt-mech-method-195 grunt-mech ((this grunt-mech) (arg0 vector) (arg1 vector) (arg2 vector)) (local-vars (v1-13 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -414,16 +415,16 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (vector-! (-> s5-0 current-pos) (-> obj root trans) (-> obj nav state mesh bounds)) + (vector-! (-> s5-0 current-pos) (-> this root trans) (-> this nav state mesh bounds)) (vector-normalize-copy! (-> s5-0 travel) arg0 (the-as float arg1)) (set! (-> s5-0 pref-dir quad) (-> s5-0 travel quad)) - (avoid-spheres-1! (-> obj nav) s5-0) + (avoid-spheres-1! (-> this nav) s5-0) (when (>= (fabs (vector-dot (the-as vector (-> s5-0 out-travel)) arg2)) 0.0) (let ((t0-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-no-gaps - (-> obj nav) - (-> obj root trans) - (-> obj nav state current-poly) + (-> this nav) + (-> this root trans) + (-> this nav state current-poly) (the-as vector (-> s5-0 out-travel)) t0-0 ) @@ -441,14 +442,14 @@ (when (>= f0-3 (* f1-1 f1-1)) (let ((a1-3 (new 'stack-no-clear 'vector))) (set! (-> a1-3 quad) (-> s5-0 out-travel 0 quad)) - (set! (-> a1-3 w) (-> obj nav-radius-backup)) - (when (not (add-root-sphere-to-hash! (-> obj nav) a1-3 #x80068)) + (set! (-> a1-3 w) (-> this nav-radius-backup)) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-3 #x80068)) (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector+! s4-1 (-> obj root trans) (the-as vector (-> s5-0 out-travel))) + (vector+! s4-1 (-> this root trans) (the-as vector (-> s5-0 out-travel))) (let ((s5-1 (new 'stack-no-clear 'collide-query))) - (when (enemy-above-ground? obj s5-1 s4-1 (the-as collide-spec (-> obj gnd-collide)) 4096.0 122880.0 1024.0) + (when (enemy-above-ground? this s5-1 s4-1 (the-as collide-spec (-> this gnd-collide)) 4096.0 122880.0 1024.0) (set! (-> s4-1 y) (-> s5-1 best-other-tri intersect y)) - (set! (-> obj dismount-dest quad) (-> s4-1 quad)) + (set! (-> this dismount-dest quad) (-> s4-1 quad)) #t ) ) @@ -462,17 +463,17 @@ ) ) -(defmethod grunt-mech-method-192 grunt-mech ((obj grunt-mech)) - (do-navigation-to-destination (-> obj nav state) (-> obj root trans)) +(defmethod grunt-mech-method-192 grunt-mech ((this grunt-mech)) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) (let ((a1-1 *target*)) (if (or (not a1-1) (not (logtest? (focus-status mech) (-> a1-1 focus-status)))) (return #t) ) ) - (when (logtest? (-> obj nav state flags) (nav-state-flag in-mesh)) + (when (logtest? (-> this nav state flags) (nav-state-flag in-mesh)) (let ((s5-0 *grunt-mech-info*)) (grunt-mech-info-method-10 s5-0) - (let* ((v1-15 (-> obj nav)) + (let* ((v1-15 (-> this nav)) (a0-7 (-> v1-15 state mesh sphere-hash sphere-array)) (a1-3 (-> v1-15 sphere-id-array)) (a2-1 (-> v1-15 state mesh bounds)) @@ -489,7 +490,7 @@ ) ) 0 - (let ((v1-22 (-> s5-0 holds (-> obj hold-id))) + (let ((v1-22 (-> s5-0 holds (-> this hold-id))) (s5-1 (new 'stack-no-clear 'vector)) ) (vector-negate! s5-1 (-> v1-22 world-mat vector 2)) @@ -497,8 +498,8 @@ (vector-normalize! s5-1 1.0) (countdown (s4-0 3) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-rotate-around-y! s3-0 s5-1 (get-rand-float-range obj -10922.667 10922.667)) - (when (grunt-mech-method-195 obj s3-0 (the-as vector (get-rand-float-range obj 16384.0 24576.0)) s5-1) + (vector-rotate-around-y! s3-0 s5-1 (get-rand-float-range this -10922.667 10922.667)) + (when (grunt-mech-method-195 this s3-0 (the-as vector (get-rand-float-range this 16384.0 24576.0)) s5-1) #t (goto cfg-16) ) @@ -508,10 +509,10 @@ ) ) (label cfg-16) - (let ((a0-15 (-> obj root trans))) - (if (or (>= 0.0 (- (-> a0-15 y) (-> obj dismount-dest y))) + (let ((a0-15 (-> this root trans))) + (if (or (>= 0.0 (- (-> a0-15 y) (-> this dismount-dest y))) (let ((f0-4 40960.0)) - (< (* f0-4 f0-4) (vector-vector-xz-distance-squared a0-15 (-> obj dismount-dest))) + (< (* f0-4 f0-4) (vector-vector-xz-distance-squared a0-15 (-> this dismount-dest))) ) ) (return #t) @@ -521,15 +522,15 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod grunt-mech-method-194 grunt-mech ((obj grunt-mech)) +(defmethod grunt-mech-method-194 grunt-mech ((this grunt-mech)) (send-event *target* 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'grunt)))) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod grunt-mech-method-191 grunt-mech ((obj grunt-mech)) - (if (>= (current-time) (-> obj state-timeout)) - (go (method-of-object obj mech-dismount)) +(defmethod grunt-mech-method-191 grunt-mech ((this grunt-mech)) + (if (>= (current-time) (-> this state-timeout)) + (go (method-of-object this mech-dismount)) ) (none) ) @@ -538,7 +539,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (set! (-> self root root-prim prim-core collide-as) (collide-spec)) (stop-looking-at-target! self) @@ -668,7 +669,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root root-prim prim-core collide-as) (collide-spec)) (let* ((v1-4 (-> self nav)) (a1-0 (-> self dismount-dest)) @@ -762,9 +763,9 @@ ) (let ((gp-1 (-> self focus aware))) (if (or (!= gp-1 3) (not (get-enemy-target self))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (when (>= 1 (the-as int gp-1)) (nav-enemy-method-161 self) (if (-> self enemy-info use-stop-chase) @@ -783,7 +784,7 @@ ) ) (else - (when (>= (- (current-time) (-> self starting-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self starting-time) (-> self reaction-time)) (nav-enemy-method-161 self) (go-hostile self) ) diff --git a/goal_src/jak2/engine/target/mech/mech-states.gc b/goal_src/jak2/engine/target/mech/mech-states.gc index b1509b3663..9a42832f66 100644 --- a/goal_src/jak2/engine/target/mech/mech-states.gc +++ b/goal_src/jak2/engine/target/mech/mech-states.gc @@ -60,7 +60,7 @@ ) 1820.4445 ) - (>= (- (current-time) (-> self control time-of-last-zero-input)) (seconds 0.05)) + (time-elapsed? (-> self control time-of-last-zero-input) (seconds 0.05)) ) ) (go target-mech-walk) @@ -502,7 +502,7 @@ ) ) (set! (-> self control send-attack-dest) (process->handle s5-2)) - (set! (-> self control send-attack-time) (current-time)) + (set-time! (-> self control send-attack-time)) #t ) ) @@ -561,7 +561,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *mech-punch-mods*) (set! (-> self mech state-impact? 0) #f) (rot->dir-targ! (-> self control)) @@ -569,7 +569,7 @@ :exit (behavior () (set! (-> *mech-punch-mods* turnvv) 0.0) (set! (-> self mech state-impact? 0) #f) - (set! (-> self control last-running-attack-end-time) (current-time)) + (set-time! (-> self control last-running-attack-end-time)) (target-exit) (target-mech-exit) ) @@ -722,9 +722,7 @@ ) ) ) - (set! s3-2 - (and (>= (- (current-time) (-> self state-time)) s4-0) (and (>= (-> self mech forward-vel) 0.0) s3-2)) - ) + (set! s3-2 (and (time-elapsed? (-> self state-time) s4-0) (and (>= (-> self mech forward-vel) 0.0) s3-2))) (set! (-> self mech state-impact? 0) s3-2) (set-forward-vel (-> self mech forward-vel)) (when (< 20480.0 (vector-length (-> self control transv))) @@ -756,7 +754,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *mech-jump-mods*) (set! (-> self mech jump-thrust) 0.0) (let* ((v1-4 *game-info*) @@ -783,7 +781,7 @@ ) (when (if (and (and v1-9 (= v1-9 (-> self draw art-group data 330))) (< f0-0 (-> *TARGET-bank* stuck-distance)) - (and (>= (- (current-time) (-> self state-time)) (seconds 2)) + (and (time-elapsed? (-> self state-time) (seconds 2)) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) ) @@ -884,7 +882,7 @@ (defstate target-mech-jump (target) :event (-> target-mech-falling event) :enter (behavior ((arg0 float) (arg1 float) (arg2 surface)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (let* ((v1-4 *game-info*) (a2-5 (+ (-> v1-4 attack-id) 1)) @@ -924,7 +922,7 @@ (-> v1-0 id) ) (set! (-> self mech jump-thrust-fuel) (-> *TARGET-bank* mech-jump-thrust-fuel)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (cond ((= arg0 'stuck) ) @@ -954,7 +952,7 @@ (if (and (cpad-pressed? (-> self control cpad number) circle square) (can-hands? #t)) (go target-mech-punch) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.25)) + (when (time-elapsed? (-> self state-time) (seconds 0.25)) (if (move-legs?) (go target-mech-walk) ) @@ -1002,7 +1000,7 @@ :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) - (set! (-> self control time-of-last-debug-heal) (current-time)) + (set-time! (-> self control time-of-last-debug-heal)) (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) (go target-mech-stance) ) @@ -1010,7 +1008,7 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self attack-info)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -1057,7 +1055,7 @@ (cond ((= arg0 'attack) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('endlessfall) (cond @@ -1066,7 +1064,7 @@ (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) (let ((s3-1 (current-time))) - (until (>= (- (current-time) s3-1) (seconds 1)) + (until (time-elapsed? s3-1 (seconds 1)) (suspend) ) ) @@ -1205,7 +1203,7 @@ (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! (-> self draw art-group data 330) :num! (loop! 0.5) :frame-num 0.0) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.8)) + (until (time-elapsed? gp-3 (seconds 0.8)) (ja :group! (-> self draw art-group data 330) :num! (loop! 0.5)) (suspend) ) @@ -1330,7 +1328,7 @@ (ja :num! (seek!)) ) (let ((gp-9 (current-time))) - (until (>= (- (current-time) gp-9) (seconds 2)) + (until (time-elapsed? gp-9 (seconds 2)) (suspend) ) ) @@ -1341,7 +1339,7 @@ (if (!= (-> self game mode) 'play) (go target-jump 16384.0 16384.0 (the-as surface #f)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sleep-code) ) :post target-mech-post @@ -1432,7 +1430,7 @@ :enter (behavior () (set! (-> self control mod-surface) *mech-pickup-mods*) (set! (-> self mech stick-off) (the-as basic #t)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) (set! (-> self carry other) (the-as handle #f)) (set! (-> self carry other-value) 100000000000.0) @@ -1672,7 +1670,7 @@ ) :enter (behavior () (set! (-> self control mod-surface) *mech-walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) (set! (-> self mech stick-off) (the-as basic #t)) ) @@ -1835,7 +1833,7 @@ (set! (-> self control mod-surface turnvv) 20024.889) (set! (-> self control did-move-to-pole-or-max-jump-height) 0.0) (rot->dir-targ! (-> self control)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () ((-> target-mech-carry-pickup exit)) @@ -1848,13 +1846,13 @@ ) 1820.4445 ) - (>= (- (current-time) (-> self control time-of-last-zero-input)) (seconds 0.05)) + (time-elapsed? (-> self control time-of-last-zero-input) (seconds 0.05)) ) ) (go target-mech-carry-walk) ) (if (and (cpad-pressed? (-> self control cpad number) r1) - (>= (- (current-time) (-> self carry pickup-time)) (seconds 0.1)) + (time-elapsed? (-> self carry pickup-time) (seconds 0.1)) ) (go target-mech-carry-drop) ) @@ -1926,7 +1924,7 @@ (defstate target-mech-carry-walk (target) :event (-> target-mech-carry-stance event) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *mech-carry-walk-mods*) (set! (-> self control unknown-word04) (the-as uint 0.0)) ) @@ -1949,7 +1947,7 @@ ) ) (if (and (cpad-pressed? (-> self control cpad number) r1) - (>= (- (current-time) (-> self carry pickup-time)) (seconds 0.1)) + (time-elapsed? (-> self carry pickup-time) (seconds 0.1)) ) (go target-mech-carry-drop) ) @@ -2052,7 +2050,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control sliding-start-time) 0) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self control mod-surface) *mech-carry-drag-mods*) @@ -2084,7 +2082,7 @@ ) :trans (behavior () (when (and (not (cpad-hold? (-> self control cpad number) r1)) - (>= (- (current-time) (-> self carry pickup-time)) (seconds 0.5)) + (time-elapsed? (-> self carry pickup-time) (seconds 0.5)) ) (sound-play "mech-drag-off") (if (or (and (>= (-> self mech back-touch-time) (-> self state-time)) @@ -2262,7 +2260,7 @@ ) :enter (behavior () (set! (-> self control mod-surface) *mech-carry-jump-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (-> target-mech-carry-pickup exit) :trans (behavior () @@ -2270,7 +2268,7 @@ (go target-mech-carry-hit-ground #f) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) #t @@ -2378,7 +2376,7 @@ (defstate target-mech-carry-jump (target) :event (-> target-mech-carry-falling event) :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *mech-carry-jump-mods*) @@ -2449,7 +2447,7 @@ :event (-> target-mech-carry-drop event) :enter (behavior () (set! (-> self control mod-surface) *mech-walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) (set! (-> self mech stick-off) (the-as basic #t)) ) diff --git a/goal_src/jak2/engine/target/mech/mech.gc b/goal_src/jak2/engine/target/mech/mech.gc index e15a87e2d4..84f74019ff 100644 --- a/goal_src/jak2/engine/target/mech/mech.gc +++ b/goal_src/jak2/engine/target/mech/mech.gc @@ -38,11 +38,11 @@ ) -(defmethod mech-method-24 mech ((obj mech)) - (if (nonzero? (-> obj part)) - (spawn (-> obj part) (-> obj root trans)) +(defmethod mech-method-24 mech ((this mech)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) ) - (update! (-> obj sound)) + (update! (-> this sound)) 0 (none) ) @@ -126,7 +126,7 @@ (let ((f30-0 20480.0)) (until #f (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) - (>= (- (current-time) (-> self probe-time)) (seconds 1)) + (time-elapsed? (-> self probe-time) (seconds 1)) ) (move-to-ground (-> self root) @@ -135,7 +135,7 @@ #t (collide-spec backgnd obstacle hit-by-player-list hit-by-others-list pusher) ) - (set! (-> self probe-time) (current-time)) + (set-time! (-> self probe-time)) ) (when (and (and *target* (and (>= f30-0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (not (logtest? (focus-status teleporting) (-> *target* focus-status))) @@ -240,7 +240,7 @@ (suspend) ) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 1)) + (until (time-elapsed? s5-0 (seconds 1)) (mech-method-24 self) (suspend) ) @@ -351,7 +351,7 @@ (none) ) -(defmethod init-from-entity! mech ((obj mech) (arg0 entity-actor)) +(defmethod init-from-entity! mech ((this mech) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -385,7 +385,7 @@ This commonly includes things such as: :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('look-at-point) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (go-virtual active) ) ) @@ -417,7 +417,7 @@ This commonly includes things such as: :virtual #t :event (-> (method-of-type mech-target idle) event) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (and (or (or (not *target*) (or (< 106496.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) @@ -426,7 +426,7 @@ This commonly includes things such as: ) (not (logtest? (focus-status mech) (-> *target* focus-status))) ) - (>= (- (current-time) (-> self state-time)) (seconds 10)) + (time-elapsed? (-> self state-time) (seconds 10)) ) (go-virtual idle) ) diff --git a/goal_src/jak2/engine/target/sidekick.gc b/goal_src/jak2/engine/target/sidekick.gc index 4ff2475005..6f49cb0fcc 100644 --- a/goal_src/jak2/engine/target/sidekick.gc +++ b/goal_src/jak2/engine/target/sidekick.gc @@ -68,7 +68,7 @@ ,(lambda :behavior sidekick ((arg0 object) (arg1 vector) (arg2 object)) (let ((gp-0 (ppointer->process (-> self parent)))) - (when (>= (- (current-time) (-> self special-anim-time)) (seconds 1)) + (when (time-elapsed? (-> self special-anim-time) (seconds 1)) (set! (-> self special-anim-interp) 0.0) (set! (-> self special-anim-frame) 0.0) ) @@ -78,7 +78,7 @@ ) (case arg2 ((1) - (set! (-> self special-anim-time) (current-time)) + (set-time! (-> self special-anim-time)) (cond ((= (-> gp-0 control mod-surface name) 'spin) (set! (-> arg1 z) diff --git a/goal_src/jak2/engine/target/surface-h.gc b/goal_src/jak2/engine/target/surface-h.gc index f70e82d012..fa52a429d6 100644 --- a/goal_src/jak2/engine/target/surface-h.gc +++ b/goal_src/jak2/engine/target/surface-h.gc @@ -130,20 +130,20 @@ ) ;; ERROR: Function may read a register that is not set: t3 -(defmethod print surface ((obj surface)) +(defmethod print surface ((this surface)) (local-vars (t3-0 none)) (format #t "# obj turnv) - (-> obj turnvv) - (-> obj tiltv) - (-> obj tiltvv) - (-> obj transv-max) + (-> this turnv) + (-> this turnvv) + (-> this tiltv) + (-> this tiltvv) + (-> this transv-max) t3-0 ) - (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> obj target-speed) (-> obj seek0) (-> obj seek90) obj) - obj + (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> this target-speed) (-> this seek0) (-> this seek90) this) + this ) (defun surface-interp! ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 float)) diff --git a/goal_src/jak2/engine/target/target-anim.gc b/goal_src/jak2/engine/target/target-anim.gc index 24217e8670..387f792021 100644 --- a/goal_src/jak2/engine/target/target-anim.gc +++ b/goal_src/jak2/engine/target/target-anim.gc @@ -535,8 +535,8 @@ (cond ((and v1-52 (= v1-52 jakb-roll-flip-ja)) (let ((s5-0 (current-time))) - (while (or (= arg0 -1) (< (- (current-time) s5-0) arg0)) - (when (>= (- (current-time) s5-0) (seconds 0.01)) + (while (or (= arg0 -1) (not (time-elapsed? s5-0 arg0))) + (when (time-elapsed? s5-0 (seconds 0.01)) (let ((v1-62 (ja-group))) (when (not (and v1-62 (= v1-62 jakb-jump-loop-ja))) (ja-channel-push! 1 (seconds 0.1)) @@ -586,7 +586,7 @@ (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) (let ((s5-1 (current-time))) (while (or (= arg0 -1) - (and (< (- (current-time) s5-1) arg0) (not (logtest? (-> self control status) (collide-status on-surface)))) + (and (not (time-elapsed? s5-1 arg0)) (not (logtest? (-> self control status) (collide-status on-surface)))) ) (suspend) (ja :group! jakb-jump-loop-ja :num! (loop!)) @@ -987,7 +987,7 @@ ) ) ) - (until (and (>= arg0 0) (>= (- (current-time) s4-10) arg0)) + (until (and (>= arg0 0) (time-elapsed? s4-10 arg0)) (let ((f20-0 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control local-slope-z))))) (f22-1 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) ) @@ -1560,7 +1560,7 @@ (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) (while (not (or (and (< (fabs (/ f0-11 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) - (>= (- (current-time) (-> self state-time)) (seconds 1.7)) + (time-elapsed? (-> self state-time) (seconds 1.7)) ) ) (quaternion-rotate-y! diff --git a/goal_src/jak2/engine/target/target-carry.gc b/goal_src/jak2/engine/target/target-carry.gc index c93decc719..bb00e4fcf6 100644 --- a/goal_src/jak2/engine/target/target-carry.gc +++ b/goal_src/jak2/engine/target/target-carry.gc @@ -152,7 +152,7 @@ ) :enter (behavior () (set! (-> self control mod-surface) *walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) (set! (-> self carry other) (the-as handle #f)) (set! (-> self carry other-value) 100000000000.0) @@ -291,7 +291,7 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control mod-surface) *walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) ) :code (behavior () @@ -413,7 +413,7 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control mod-surface) *carry-walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () ((-> target-carry-pickup exit)) @@ -465,7 +465,7 @@ (defstate target-carry-walk (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *carry-walk-mods*) ) :exit (behavior () @@ -523,7 +523,7 @@ :event target-jump-event-handler :enter (behavior () (set! (-> self control mod-surface) *carry-jump-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (logtest? (-> self control status) (collide-status on-surface)) @@ -539,7 +539,7 @@ ) (when (if (and (< f0-0 (-> *TARGET-bank* stuck-distance)) (and (>= v1-12 0) - (>= (- (current-time) (-> self state-time)) v1-12) + (time-elapsed? (-> self state-time) v1-12) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) ) @@ -630,7 +630,7 @@ (defstate target-carry-jump (target) :event target-jump-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 70) (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) @@ -694,7 +694,7 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control mod-surface) *walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) ) :code (behavior () diff --git a/goal_src/jak2/engine/target/target-darkjak.gc b/goal_src/jak2/engine/target/target-darkjak.gc index 51f28757b4..1dcfb97975 100644 --- a/goal_src/jak2/engine/target/target-darkjak.gc +++ b/goal_src/jak2/engine/target/target-darkjak.gc @@ -56,7 +56,7 @@ ) ) (or (and (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) - (and (>= (- (current-time) (-> (the-as fact-info-target (-> self fact)) darkjak-start-time)) (seconds 0.05)) + (and (time-elapsed? (-> (the-as fact-info-target (-> self fact)) darkjak-start-time) (seconds 0.05)) (>= (-> self game eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) ) ) @@ -112,9 +112,10 @@ ) (target-danger-set! (-> self control danger-mode) #f) (update-transforms (-> self control)) - (if (and (or (>= (- (current-time) (-> (the-as fact-info-target (-> self fact)) darkjak-start-time)) - (-> (the-as fact-info-target (-> self fact)) darkjak-effect-time) - ) + (if (and (or (time-elapsed? + (-> (the-as fact-info-target (-> self fact)) darkjak-start-time) + (-> (the-as fact-info-target (-> self fact)) darkjak-effect-time) + ) (not (-> *setting-control* user-current darkjak)) ) (not (focus-test? self dead dangerous hit grabbed)) @@ -192,7 +193,7 @@ ) (set-darkjak-texture-morph! f30-0) (cond - ((and (= f30-0 0.0) (< (- (current-time) (-> self teleport-time)) (seconds 0.5))) + ((and (= f30-0 0.0) (not (time-elapsed? (-> self teleport-time) (seconds 0.5)))) (set! (-> self skel override 0) 0.00001) (set! (-> self skel override 41) 0.000001) ) @@ -303,12 +304,12 @@ (set! (-> self darkjak want-stage) (-> self darkjak stage)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control mod-surface) *darkjak-trans-mods*) - (set! (-> self darkjak start-time) (current-time)) + (set-time! (-> self darkjak start-time)) (set! (-> self darkjak attack-count) (the-as uint 0)) (set! (-> self darkjak-giant-interp) 1.0) (set-setting! 'sound-flava #f 30.0 4) (logior! (-> self focus-status) (focus-status dark)) - (set! (-> (the-as fact-info-target (-> self fact)) darkjak-start-time) (current-time)) + (set-time! (-> (the-as fact-info-target (-> self fact)) darkjak-start-time)) (set! (-> (the-as fact-info-target (-> self fact)) darkjak-effect-time) (seconds 20)) (if (logtest? (-> self darkjak stage) (darkjak-stage invinc)) (logior! (-> self state-flags) (state-flags sf4)) @@ -659,7 +660,7 @@ ) (set! sv-40 (the-as int (current-time))) ) - (when (>= (- (current-time) (the-as time-frame sv-40)) (seconds 0.5)) + (when (time-elapsed? (the-as time-frame sv-40) (seconds 0.5)) (set! sv-40 0) 0 ) @@ -724,13 +725,11 @@ (cond ((and (>= (ja-frame-num 0) 20.0) (and (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) - (>= (- (current-time) (-> self control sliding-start-time)) (seconds 0.04)) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) ) ) (go target-falling #f) @@ -750,8 +749,8 @@ ) (let ((s5-1 (get-trans (the-as process-focusable gp-0) 3))) (when (and (< 2048.0 (vector-vector-distance (-> self control trans) s5-1)) - (or (and (= gp-0 (handle->process sv-56)) (< (- (current-time) (the-as time-frame sv-64)) (seconds 0.1))) - (>= (- (current-time) (the-as time-frame sv-64)) (seconds 1)) + (or (and (= gp-0 (handle->process sv-56)) (not (time-elapsed? (the-as time-frame sv-64) (seconds 0.1)))) + (time-elapsed? (the-as time-frame sv-64) (seconds 1)) ) ) (forward-up-nopitch->quaternion @@ -785,13 +784,13 @@ (set-forward-vel sv-16) ) ((and (nonzero? (-> self control unknown-time-frame18)) - (>= (- (current-time) (-> self control unknown-time-frame18)) (seconds 0.04)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) ) (set-forward-vel 0.0) ) ((and (not (cpad-hold? (-> self control cpad number) square)) (zero? sv-32) - (>= (- (current-time) (-> self control unknown-combo-tracker00 move-start-time)) (seconds 0.2)) + (time-elapsed? (-> self control unknown-combo-tracker00 move-start-time) (seconds 0.2)) ) (if (= (-> self control ground-pat material) (pat-material ice)) (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) @@ -933,7 +932,7 @@ ) (suspend) (ja :num! (seek! max (* (-> self control current-surface align-speed) (the-as float sv-48)))) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (if (< 2 sv-24) @@ -942,9 +941,7 @@ (set! sv-24 (+ sv-24 1)) ) (if (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) @@ -955,30 +952,30 @@ :post target-post ) -(defmethod update-clock! darkjak-info ((obj darkjak-info) (arg0 int)) - (when (-> obj clock-on) - (+! (-> obj clock-pos) (* (-> obj clock-vel) (seconds-per-frame))) - (+! (-> obj clock-vel) (* 4.0 (seconds-per-frame))) +(defmethod update-clock! darkjak-info ((this darkjak-info) (arg0 int)) + (when (-> this clock-on) + (+! (-> this clock-pos) (* (-> this clock-vel) (seconds-per-frame))) + (+! (-> this clock-vel) (* 4.0 (seconds-per-frame))) (cond - ((< 1.0 (-> obj clock-pos)) - (set! (-> obj clock-pos) 1.0) - (set! (-> obj clock-vel) 0.0) + ((< 1.0 (-> this clock-pos)) + (set! (-> this clock-pos) 1.0) + (set! (-> this clock-vel) 0.0) ) - ((< (-> obj clock-pos) 0.05) - (set! (-> obj clock-pos) 0.05) - (set! (-> obj clock-vel) 1.0) + ((< (-> this clock-pos) 0.05) + (set! (-> this clock-pos) 0.05) + (set! (-> this clock-vel) 1.0) ) ) - (update-rates! (-> *display* entity-clock) (-> obj clock-pos)) - (update-rates! (-> *display* bg-clock) (-> obj clock-pos)) + (update-rates! (-> *display* entity-clock) (-> this clock-pos)) + (update-rates! (-> *display* bg-clock) (-> this clock-pos)) (if (= arg0 4) - (update-rates! (-> *display* target-clock) (-> obj clock-pos)) + (update-rates! (-> *display* target-clock) (-> this clock-pos)) ) (when *sound-player-enable* (let ((v1-27 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-27 command) (sound-command set-param)) - (set! (-> v1-27 id) (-> obj process 0 control unknown-sound-id00)) - (set! (-> v1-27 params pitch-mod) (the int (* 1524.0 (- (- 1.0 (-> obj clock-pos)))))) + (set! (-> v1-27 id) (-> this process 0 control unknown-sound-id00)) + (set! (-> v1-27 params pitch-mod) (the int (* 1524.0 (- (- 1.0 (-> this clock-pos)))))) (set! (-> v1-27 params mask) (the-as uint 2)) (-> v1-27 id) ) @@ -1789,7 +1786,7 @@ (ja-channel-push! 2 (seconds 0.05)) (ja :group! jakb-darkjak-attack-ice-loop-ja) (ja :chan 1 :group! jakb-darkjak-attack-ice-loop2-ja) - (while (or (< sv-64 sv-48) (< (- (current-time) sv-80) (seconds 1.5))) + (while (or (< sv-64 sv-48) (not (time-elapsed? sv-80 (seconds 1.5)))) (let ((v1-77 (new-stack-vector0))) (let ((f0-8 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) 0.0 @@ -1809,11 +1806,11 @@ (set! (-> self darkjak clock-vel) -4.0) (set! (-> self darkjak clock-on) #t) (send-event *camera* 'joystick -0.25 1.0) - (when (>= (- (current-time) sv-72) (seconds 0.1)) + (when (time-elapsed? sv-72 (seconds 0.1)) (set! sv-72 (current-time)) (target-bomb1-fire-shot sv-60 sv-64 sv-48 (the-as int sv-104)) (set! sv-64 (+ sv-64 1)) - (if (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (set! sv-92 1.0) ) ) @@ -1843,7 +1840,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self gun surpress-time) (current-time)) + (set-time! (-> self gun surpress-time)) (send-event (handle->process (-> self notify)) 'notify 'attack 17) (go target-darkjak-get-off) ) diff --git a/goal_src/jak2/engine/target/target-death.gc b/goal_src/jak2/engine/target/target-death.gc index a5b5dc9b34..f7a9703448 100644 --- a/goal_src/jak2/engine/target/target-death.gc +++ b/goal_src/jak2/engine/target/target-death.gc @@ -96,7 +96,7 @@ (apply-settings *setting-control*) (logclear! (-> self focus-status) (focus-status teleporting)) (set! (-> self mode-cache) #f) - (set! (-> self teleport-time) (current-time)) + (set-time! (-> self teleport-time)) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) (set! (-> self game kiosk-timeout) (the-as uint (-> *display* game-clock frame-counter))) ) @@ -104,7 +104,7 @@ (local-vars (v1-96 symbol)) (set! *spawn-actors* #f) (set! (-> self control unknown-word04) (the-as uint #f)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self focus-status) (focus-status teleporting)) (let ((a0-3 (get-continue-by-name (-> self game) (-> arg0 name)))) (cond @@ -310,7 +310,7 @@ ) ) (let ((s5-6 (current-time))) - (until (>= (- (current-time) s5-6) (seconds 0.05)) + (until (time-elapsed? s5-6 (seconds 0.05)) (suspend) ) ) @@ -337,7 +337,7 @@ ) ((logtest? (-> arg0 flags) (continue-flags warp-gate)) (let ((s5-7 (current-time))) - (until (>= (- (current-time) s5-7) (seconds 0.05)) + (until (time-elapsed? s5-7 (seconds 0.05)) (suspend) ) ) @@ -370,7 +370,7 @@ ) (else (let ((s5-9 (current-time))) - (until (>= (- (current-time) s5-9) (seconds 0.05)) + (until (time-elapsed? s5-9 (seconds 0.05)) (suspend) ) ) @@ -681,9 +681,7 @@ (if (and (cpad-pressed? (-> self control cpad number) square) (and (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (>= (- (current-time) (-> self control last-time-of-stuck)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -705,7 +703,7 @@ ) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - (and (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> *TARGET-bank* stuck-time))) + (and (time-elapsed? (-> self state-time) (the-as time-frame (-> *TARGET-bank* stuck-time))) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) ) @@ -954,7 +952,7 @@ :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) - (set! (-> self control time-of-last-debug-heal) (current-time)) + (set-time! (-> self control time-of-last-debug-heal)) (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) (go target-stance) ) @@ -963,7 +961,7 @@ :code (behavior ((arg0 symbol) (arg1 attack-info)) (local-vars (sv-32 attack-info) (sv-36 vector)) (logclear! (-> self water flags) (water-flags jump-out)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self neck flex-blend) 0.0) (set! sv-32 (-> self attack-info)) (set! sv-36 (new 'stack-no-clear 'vector)) @@ -1018,7 +1016,7 @@ ((= arg0 'attack) (send-event (handle->process (-> self notify)) 'notify 'hit (-> sv-32 mode)) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (case (-> sv-32 mode) (('endlessfall) (cond @@ -1027,7 +1025,7 @@ (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) (seconds 1)) + (until (time-elapsed? s5-1 (seconds 1)) (suspend) ) ) @@ -1462,7 +1460,7 @@ (the-as game-save #f) (the-as string #f) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sleep-code) 0 (none) @@ -1649,7 +1647,7 @@ (ja-channel-set! 0) (ja-post) (let ((s5-3 (current-time))) - (until (>= (- (current-time) s5-3) (seconds 2)) + (until (time-elapsed? s5-3 (seconds 2)) (suspend) ) ) @@ -1726,7 +1724,7 @@ (ja :num! (seek!)) ) (while (not (or (logtest? (-> self control status) (collide-status on-surface)) - (>= (- (current-time) (-> self state-time)) (seconds 2)) + (time-elapsed? (-> self state-time) (seconds 2)) ) ) (suspend) @@ -1764,7 +1762,7 @@ (ja :num! (seek!)) ) (let ((s5-7 (current-time))) - (until (>= (- (current-time) s5-7) (seconds 2)) + (until (time-elapsed? s5-7 (seconds 2)) (suspend) ) ) @@ -1817,7 +1815,7 @@ (ja-channel-set! 0) (ja-post) (let ((s5-10 (current-time))) - (until (>= (- (current-time) s5-10) (seconds 2)) + (until (time-elapsed? s5-10 (seconds 2)) (suspend) ) ) @@ -1837,7 +1835,7 @@ (ja-channel-set! 0) (ja-post) (let ((s5-11 (current-time))) - (until (>= (- (current-time) s5-11) (seconds 1.2)) + (until (time-elapsed? s5-11 (seconds 1.2)) (suspend) ) ) @@ -1879,7 +1877,7 @@ (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.8)) + (until (time-elapsed? gp-1 (seconds 0.8)) (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) (set! v1-24 'target-hit-ground-hard) (goto cfg-17) @@ -1925,7 +1923,7 @@ (ja :num! (seek!)) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 2)) + (until (time-elapsed? gp-2 (seconds 2)) (suspend) ) ) @@ -2018,7 +2016,7 @@ (ja :num! (seek!)) ) (let ((s5-13 (current-time))) - (until (>= (- (current-time) s5-13) (seconds 2)) + (until (time-elapsed? s5-13 (seconds 2)) (suspend) ) ) diff --git a/goal_src/jak2/engine/target/target-gun.gc b/goal_src/jak2/engine/target/target-gun.gc index 23b34bc659..1e565fe6b9 100644 --- a/goal_src/jak2/engine/target/target-gun.gc +++ b/goal_src/jak2/engine/target/target-gun.gc @@ -207,7 +207,7 @@ (set! (-> self gun top-anim-twist-reset) (the-as uint 0)) (set! (-> gp-0 gun-type) (pickup-type eco-yellow)) (target-gun-type-set! arg0) - (set! (-> gp-0 gun-get-on-time) (current-time)) + (set-time! (-> gp-0 gun-get-on-time)) ) (set! (-> self board latch?) #f) (set! (-> self gun put-away?) #f) @@ -1176,7 +1176,7 @@ (logclear! (-> self gun track?) (gun-track-flags gutflags-3)) ) (let ((gp-0 (the-as basic #f))) - (when (and (or (< (- (current-time) (-> self control time-of-last-nonzero-input)) (seconds 0.2)) + (when (and (or (not (time-elapsed? (-> self control time-of-last-nonzero-input) (seconds 0.2))) (and (logtest? (-> self control mod-surface flags) (surface-flag air)) (not (logtest? (-> self control status) (collide-status on-surface))) ) @@ -1258,9 +1258,9 @@ (the-as focus (-> self gun track-target)) (the-as process-focusable gp-0) ) - (set! (-> self gun track-start-time) (current-time)) - (if (< (- (current-time) (-> self control time-of-last-nonzero-input)) (seconds 0.2)) - (set! (-> self gun track-press-start-time) (current-time)) + (set-time! (-> self gun track-start-time)) + (if (not (time-elapsed? (-> self control time-of-last-nonzero-input) (seconds 0.2))) + (set-time! (-> self gun track-press-start-time)) ) ) (if (logtest? (process-mask enemy guard) (-> (the-as process-focusable gp-0) mask)) @@ -1461,7 +1461,7 @@ ) (set! (-> self gun top-anim-low-high) 1.0) (if (zero? (-> self gun fire-pending)) - (set! (-> self gun fire-time) (current-time)) + (set-time! (-> self gun fire-time)) ) ) (((pickup-type eco-blue)) @@ -1510,14 +1510,12 @@ (if (!= (not (logtest? (-> self game features) (game-feature gun))) (not (-> self gun gun))) (target-gun-setup (logtest? (-> self game features) (game-feature gun))) ) - (if (and (>= (- (current-time) (-> self gun combo-window-start)) (seconds 0.7)) - (zero? (-> self gun fire-pending)) - ) + (if (and (time-elapsed? (-> self gun combo-window-start) (seconds 0.7)) (zero? (-> self gun fire-pending))) (set! (-> self gun combo-window-state) #f) ) (cond ((and (cpad-pressed? (-> self control cpad number) r1) - (< (- (current-time) (-> self gun combo-window-start)) (seconds 0.7)) + (not (time-elapsed? (-> self gun combo-window-start) (seconds 0.7))) (not (focus-test? self mech dark)) (not (logtest? (surface-flag gun-off) (-> self control current-surface flags))) (not (logtest? (state-flags prevent-gun) (-> self state-flags))) @@ -1555,7 +1553,7 @@ (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) - (set! (-> self gun fire-pending-time) (current-time)) + (set-time! (-> self gun fire-pending-time)) (target-gun-combo-start 20 (seconds 0.4)) (send-event self 'gun-combo #t) (case (-> self gun combo-window-state) @@ -1583,7 +1581,7 @@ (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) - (set! (-> self gun fire-pending-time) (current-time)) + (set-time! (-> self gun fire-pending-time)) (target-top-anim-base-mode 60) (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) (set! (-> self gun turn-fast-hold-time) (+ (current-time) (seconds 0.2))) @@ -1597,7 +1595,7 @@ (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) - (set! (-> self gun fire-pending-time) (current-time)) + (set-time! (-> self gun fire-pending-time)) ) ) ) @@ -1774,7 +1772,7 @@ ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) (logtest? (process-mask enemy guard) (-> (handle->process (-> self gun track-target 0 handle)) mask)) ) - (if (and (< (- (current-time) (-> self gun track-press-start-time)) (seconds 0.5)) + (if (and (not (time-elapsed? (-> self gun track-press-start-time) (seconds 0.5))) (< (-> self control time-between-zero-inputs) (seconds 0.5)) (and (= (-> self control turn-to-magnitude) 0.0) (not (logtest? (-> self control current-surface flags) (surface-flag air attack))) @@ -1855,7 +1853,7 @@ ) ) (set! (-> self gun upper-body track-mode) (the-as track-mode (-> self gun track?))) - (when (< (- (current-time) (-> self gun fire-time)) (seconds 1.5)) + (when (not (time-elapsed? (-> self gun fire-time) (seconds 1.5))) (let ((v1-459 (-> self neck))) (set! (-> v1-459 blend) 0.0) ) @@ -1919,7 +1917,7 @@ jakb-gun-stance-yellow-low-ja ) (else - (when (and (>= (- (current-time) (-> self gun fire-time)) (seconds 1.5)) + (when (and (time-elapsed? (-> self gun fire-time) (seconds 1.5)) (let ((v1-50 (-> self skel top-anim frame-group))) (or (= v1-50 jakb-gun-yellow-highlow-ja) (= v1-50 jakb-gun-stance-yellow-ja)) ) @@ -1966,8 +1964,8 @@ jakb-gun-stance-ja ) (else - (when (and (or (>= (- (current-time) (-> self gun fire-time)) (seconds 2.5)) - (and (< 4096.0 (-> self control ctrl-xz-vel)) (>= (- (current-time) (-> self gun fire-time)) (seconds 1.25))) + (when (and (or (time-elapsed? (-> self gun fire-time) (seconds 2.5)) + (and (< 4096.0 (-> self control ctrl-xz-vel)) (time-elapsed? (-> self gun fire-time) (seconds 1.25))) ) (let ((v1-104 (-> self skel top-anim frame-group))) (or (= v1-104 jakb-gun-stance-red-sideways-ja) @@ -1997,7 +1995,7 @@ (let ((v1-119 (ja-group))) (cond ((and (and v1-119 (or (= v1-119 self) (= v1-119 jakb-gun-walk-side-ja))) - (and (< (-> self gun top-anim-low-high) 0.5) (>= (- (current-time) (-> self gun fire-time)) (seconds 0.2))) + (and (< (-> self gun top-anim-low-high) 0.5) (time-elapsed? (-> self gun fire-time) (seconds 0.2))) ) (let ((s5-2 (get-channel (-> self skel top-anim) 0))) (set! gp-0 (if (< 0.9 (-> self control unknown-float002)) @@ -2134,7 +2132,7 @@ ) (set! (-> self gun active?) (and (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> self control current-surface flags))) - (and (>= (- (current-time) (-> self gun gun-get-on-time)) (seconds 0.1)) + (and (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) (>= (current-time) (-> self gun surpress-time)) (let ((v1-35 (-> self skel top-anim frame-group)) (f0-13 (-> self skel top-anim frame-num)) @@ -2202,19 +2200,19 @@ ) ) (if (-> self gun active?) - (set! (-> self gun active-time) (current-time)) + (set-time! (-> self gun active-time)) ) (set! (-> self gun laser-active?) (not (logtest? (surface-flag gun-inactive gun-hide gun-off laser-hide) (-> self control current-surface flags)) ) ) (when (and (not (and (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> self control current-surface flags))) - (>= (- (current-time) (-> self gun gun-get-on-time)) (seconds 0.1)) + (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) (>= (current-time) (-> self gun surpress-time)) ) ) - (and (>= (- (current-time) (-> self gun fire-pending-time)) (seconds 0.2)) - (>= (- (current-time) (-> self gun active-time)) (seconds 0.2)) + (and (time-elapsed? (-> self gun fire-pending-time) (seconds 0.2)) + (time-elapsed? (-> self gun active-time) (seconds 0.2)) (= (-> self gun fire-pending) 1) ) ) @@ -2278,7 +2276,7 @@ ) ) ) - (>= (- (current-time) (-> self gun gun-get-on-time)) (seconds 0.1)) + (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) (let ((v1-110 (-> self skel top-anim frame-targ))) (or (not v1-110) (= v1-110 jakb-gun-side-jump-ja) @@ -2455,7 +2453,7 @@ ) (set! (-> self gun top-anim-low-high) 0.0) ) - ((and (rand-vu-percent? 0.2) (< (- (current-time) (-> self gun fire-time)) (seconds 2))) + ((and (rand-vu-percent? 0.2) (not (time-elapsed? (-> self gun fire-time) (seconds 2)))) (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-dark-fire-twirl-ja) @@ -2471,7 +2469,7 @@ ) ) ((and (or (rand-vu-percent? 0.2) (= (-> self skel top-anim frame-targ) jakb-gun-red-fire-ja)) - (< (- (current-time) (-> self gun fire-time)) (seconds 2)) + (not (time-elapsed? (-> self gun fire-time) (seconds 2))) ) (push-anim-to-targ (-> self skel top-anim) @@ -2570,23 +2568,23 @@ (set! (-> gp-0 combo-window-state) 'target-attack-air) ) (if (cpad-pressed? (-> self control cpad number) r1) - (set! (-> gp-0 fire-start-time) (current-time)) + (set-time! (-> gp-0 fire-start-time)) ) (case (-> gp-0 gun-control) ((1) (when (and (cpad-pressed? (-> self control cpad number) r1) (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) ) - (set! (-> gp-0 fire-pending-time) (current-time)) + (set-time! (-> gp-0 fire-pending-time)) (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) (set! (-> gp-0 fire-charge) 0.5) ) - (when (and (or (>= (- (current-time) (-> gp-0 fire-time)) (the-as time-frame (-> gp-0 fire-delay))) + (when (and (or (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) (case (-> gp-0 combo-window-state) (('target-attack-air 'target-attack 'target-running-attack) - (>= (- (current-time) (-> gp-0 fire-time)) (the-as time-frame (-> gp-0 combo-fire-delay))) + (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 combo-fire-delay))) ) ) ) @@ -2596,7 +2594,7 @@ (seekl! (-> self gun fire-pending) 0 1) (cond ((send-event self 'gun (-> gp-0 gun-type)) - (set! (-> self gun fire-time) (current-time)) + (set-time! (-> self gun fire-time)) ) (else (set! (-> self gun fire-time) 0) @@ -2612,20 +2610,20 @@ (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) ) ) - (set! (-> gp-0 fire-pending-time) (current-time)) + (set-time! (-> gp-0 fire-pending-time)) (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) (set! (-> gp-0 fire-charge) 0.5) ) - (when (and (>= (- (current-time) (-> gp-0 fire-time)) (the-as time-frame (-> gp-0 fire-delay))) + (when (and (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) (> (-> gp-0 fire-pending) 0) (-> self gun active?) ) (seekl! (-> self gun fire-pending) 0 1) (cond ((send-event self 'gun (-> gp-0 gun-type)) - (set! (-> self gun fire-time) (current-time)) + (set-time! (-> self gun fire-time)) ) (else (set! (-> self gun fire-time) 0) @@ -2687,20 +2685,20 @@ (-> self gun active?) (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) ) - (set! (-> gp-0 fire-pending-time) (current-time)) + (set-time! (-> gp-0 fire-pending-time)) (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) (set! (-> gp-0 fire-charge) 0.5) ) - (when (and (>= (- (current-time) (-> gp-0 fire-time)) (the-as time-frame (-> gp-0 fire-delay))) + (when (and (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) (> (-> gp-0 fire-pending) 0) (-> self gun active?) ) (seekl! (-> self gun fire-pending) 0 1) (cond ((send-event self 'gun (-> gp-0 gun-type)) - (set! (-> self gun fire-time) (current-time)) + (set-time! (-> self gun fire-time)) ) (else (set! (-> self gun fire-time) 0) @@ -2739,7 +2737,7 @@ ) ) ) - (set! (-> gp-0 gun-time) (current-time)) + (set-time! (-> gp-0 gun-time)) ) ) 0 diff --git a/goal_src/jak2/engine/target/target-handler.gc b/goal_src/jak2/engine/target/target-handler.gc index 43946db70c..33cba16f3d 100644 --- a/goal_src/jak2/engine/target/target-handler.gc +++ b/goal_src/jak2/engine/target/target-handler.gc @@ -268,8 +268,9 @@ ) (when sv-96 (set! (-> self control send-attack-dest) (process->handle arg0)) - (set! (-> self control send-attack-time) (current-time)) + (set-time! (-> self control send-attack-time)) (send-event self 'hit arg1 arg0 arg2) + ;; og:preserve-this process cast (set! arg0 (the process (and (and (focus-test? self dark) (nonzero? (-> self darkjak)) (logtest? (-> self darkjak stage) (darkjak-stage active)) @@ -285,7 +286,8 @@ (lambda :behavior target ((arg0 handle)) (local-vars (sv-112 vector) (sv-128 matrix)) - (stack-size-set! (-> self main-thread) 512) ;; added + ;; og:preserve-this added + (stack-size-set! (-> self main-thread) 512) (let ((gp-0 (-> self parent))) (let ((s4-0 0) (s3-0 (current-time)) @@ -321,7 +323,7 @@ ) ) ) - (< (- (current-time) s3-0) (seconds 15)) + (not (time-elapsed? s3-0 (seconds 15))) (not (logtest? (-> (the-as process-focusable (-> gp-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) ) ) @@ -350,10 +352,10 @@ ) ) (send-event (ppointer->process gp-0) 'color-effect 'dark (seconds 0.2)) - (when (>= (- (current-time) (the-as time-frame s4-0)) (seconds 0.05)) + (when (time-elapsed? (the-as time-frame s4-0) (seconds 0.05)) (set! s4-0 (the-as int (current-time))) (cond - ((and (< (- (current-time) s3-0) (seconds 0.5)) (handle->process arg0)) + ((and (not (time-elapsed? s3-0 (seconds 0.5))) (handle->process arg0)) (process-drawable2-shock-effect (the-as process-drawable (handle->process arg0)) (the-as process-drawable (ppointer->process gp-0)) @@ -639,7 +641,7 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.2)) ) ((= v1-37 'darkjak) - (set! (-> self darkjak attack-time) (current-time)) + (set-time! (-> self darkjak attack-time)) (let* ((v1-160 *game-info*) (a0-102 (+ (-> v1-160 attack-id) 1)) ) @@ -816,7 +818,7 @@ ) (('color-effect) (set! (-> self color-effect) (the-as basic (-> arg3 param 0))) - (set! (-> self color-effect-start-time) (current-time)) + (set-time! (-> self color-effect-start-time)) (set! v0-0 (-> arg3 param 1)) (set! (-> self color-effect-duration) (the-as uint v0-0)) v0-0 @@ -1096,7 +1098,7 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> v1-15 quad) vf1) ) - (set! (-> self control additional-decaying-velocity-end-time) (current-time)) + (set-time! (-> self control additional-decaying-velocity-end-time)) (set! (-> self control additional-decaying-velocity-decay-start-time) (+ (current-time) (the-as time-frame (-> arg3 param 1))) ) @@ -1105,7 +1107,7 @@ (label cfg-23) (b! (!= v1-0 'push-transv) cfg-25 :delay (nop!)) (set! (-> self control additional-decaying-velocity quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self control additional-decaying-velocity-end-time) (current-time)) + (set-time! (-> self control additional-decaying-velocity-end-time)) (set! (-> self control additional-decaying-velocity-decay-start-time) (+ (current-time) (the-as time-frame (-> arg3 param 1))) ) diff --git a/goal_src/jak2/engine/target/target-part.gc b/goal_src/jak2/engine/target/target-part.gc index 1a32639d11..05367e8c7b 100644 --- a/goal_src/jak2/engine/target/target-part.gc +++ b/goal_src/jak2/engine/target/target-part.gc @@ -2116,7 +2116,7 @@ ) (set! (-> s5-1 quad) (-> (the-as process-drawable (-> s4-1 0)) draw color-mult quad)) (let ((s2-1 (vector-float*! (the-as vector (new 'stack 'rgbaf)) (the-as vector s5-1) 0.0))) - (while (< (- (current-time) s3-0) arg0) + (while (not (time-elapsed? s3-0 arg0)) (let ((v1-8 (- (current-time) s3-0))) (if (< v1-8 (the-as time-frame (/ arg0 2))) (vector-lerp! @@ -2496,7 +2496,7 @@ (set! (-> v1-29 action-mask) (collide-action solid)) ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-688) 0.0) - (set! (-> s5-0 last-valid-time) (current-time)) + (set-time! (-> s5-0 last-valid-time)) (set! (-> s5-0 src-joint-index) (the-as uint sv-656)) (set! (-> s5-0 end-pos quad) (-> sv-688 best-other-tri intersect quad)) (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-688 start-pos))) @@ -2711,6 +2711,7 @@ #f (label cfg-24) (when v1-18 + ;; og:preserve-this stack array ;; (let ((s5-1 (the-as (array cspace) (new 'stack 'array cspace 32)))) (let ((s5-1 (new 'static 'boxed-array :type cspace :length 0 :allocated-length 32))) (let ((v1-21 0)) diff --git a/goal_src/jak2/engine/target/target-swim.gc b/goal_src/jak2/engine/target/target-swim.gc index 383ff096e1..f0b11da7b5 100644 --- a/goal_src/jak2/engine/target/target-swim.gc +++ b/goal_src/jak2/engine/target/target-swim.gc @@ -10,7 +10,7 @@ (defstate target-wade-stance (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *wade-mods*) (set-zero! (-> self water bob)) ) @@ -25,7 +25,7 @@ :trans (behavior () ((-> self state-hook)) (when (and (not (logtest? (water-flags wading) (-> self water flags))) - (>= (- (current-time) (-> self water wade-time)) (seconds 0.05)) + (time-elapsed? (-> self water wade-time) (seconds 0.05)) ) (if (logtest? (water-flags swimming) (-> self water flags)) (go target-swim-stance) @@ -77,7 +77,7 @@ :trans (behavior () ((-> self state-hook)) (when (and (not (logtest? (water-flags wading) (-> self water flags))) - (>= (- (current-time) (-> self water wade-time)) (seconds 0.1)) + (time-elapsed? (-> self water wade-time) (seconds 0.1)) ) (if (logtest? (water-flags swimming) (-> self water flags)) (go target-swim-stance) @@ -287,7 +287,7 @@ (ja :chan 2 :num! (chan 0)) (ja :chan 3 :num! (chan 0)) (ja :chan 4 :num! (chan 0)) - (when (and (>= (- (current-time) (the-as time-frame gp-6)) (seconds 0.2)) + (when (and (time-elapsed? (the-as time-frame gp-6) (seconds 0.2)) (< (- (-> self water height) (-> self control trans y)) 4096.0) ) (case (the int (ja-aframe-num 0)) @@ -357,7 +357,7 @@ (defstate target-swim-stance (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *swim-mods*) (logior! (-> self water flags) (water-flags swim-ground)) (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik)) @@ -402,7 +402,7 @@ (set-zero! (-> self water bob)) ) (when (and (not (logtest? (water-flags swimming) (-> self water flags))) - (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (if (logtest? (water-flags wading) (-> self water flags)) (go target-wade-stance) @@ -417,7 +417,7 @@ (pad-buttons x) ) (can-jump? #f) - (>= (- (current-time) (-> self water enter-swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) ) (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) ) @@ -519,7 +519,7 @@ (set-zero! (-> self water bob)) ) (when (and (not (logtest? (water-flags swimming) (-> self water flags))) - (>= (- (current-time) (-> self water swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water swim-time) (seconds 0.1)) ) (if (logtest? (water-flags wading) (-> self water flags)) (go target-wade-stance) @@ -534,7 +534,7 @@ (pad-buttons x) ) (can-jump? #f) - (>= (- (current-time) (-> self water enter-swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) ) (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) ) @@ -553,7 +553,7 @@ ) (cond ((= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (if (>= (the-as uint (- (current-time) (the-as int (-> self control unknown-word04)))) (the-as uint 15)) + (if (time-elapsed? (the-as int (-> self control unknown-word04)) (seconds 0.05)) (go target-swim-stance) ) ) @@ -654,13 +654,13 @@ (target-standard-event-handler proc argc message block) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik)) (logclear! (-> self water flags) (water-flags swim-ground)) (set! (-> self control mod-surface) *dive-mods*) (set! (-> self control dynam gravity-max) 16384.0) (set! (-> self control dynam gravity-length) 16384.0) - (set! (-> self water swim-time) (current-time)) + (set-time! (-> self water swim-time)) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self neck flex-blend) 0.0) ) @@ -698,11 +698,11 @@ (set! (-> self neck flex-blend) 1.0) ) :trans (behavior () - (if (>= (- (current-time) (-> self water swim-time)) (seconds 0.5)) + (if (time-elapsed? (-> self water swim-time) (seconds 0.5)) (go target-stance) ) (cond - ((>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1)) + ((time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) (set! (-> self control mod-surface) *dive-mods*) (if (and (-> self next-state) (= (-> self next-state name) 'target-swim-down)) (target-swim-tilt -0.9 1.0 0.0 0.5) @@ -783,21 +783,21 @@ ) ) (until #f - (when (and (!= (-> self tobot?) 'tobot) (>= (- (current-time) (-> self state-time)) (seconds 0.05))) + (when (and (!= (-> self tobot?) 'tobot) (time-elapsed? (-> self state-time) (seconds 0.05))) (if (and (or (not (cpad-hold? (-> self control cpad number) circle square)) (-> self control unknown-spool-anim00)) - (>= (- (current-time) (-> self state-time)) gp-0) + (time-elapsed? (-> self state-time) gp-0) ) (go target-swim-up) ) - (if (or (>= (- (current-time) (-> self control unknown-time-frame27)) s5-0) + (if (or (time-elapsed? (-> self control unknown-time-frame27) s5-0) (and (logtest? (-> self control status) (collide-status on-surface)) - (and (< (-> self water swim-depth) 8192.0) (>= (- (current-time) (-> self state-time)) gp-0)) + (and (< (-> self water swim-depth) 8192.0) (time-elapsed? (-> self state-time) gp-0)) ) ) (go target-swim-up) ) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (sound-play "water-bubbles" :id (-> self control bubbles-sound)) ) (let ((s4-3 (new-stack-vector0)) @@ -844,17 +844,17 @@ (the-as surface #f) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 10)) + (if (and (time-elapsed? (-> self state-time) (seconds 10)) (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) ) (send-event self 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'drown-death)))) ) (if (and (cpad-pressed? (-> self control cpad number) circle square) - (or (< (- (current-time) (-> self control unknown-time-frame27)) (seconds 10)) + (or (not (time-elapsed? (-> self control unknown-time-frame27) (seconds 10))) (logtest? (-> self control status) (collide-status touch-ceiling)) ) (and (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) - (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) ) ) (go target-swim-down) @@ -937,7 +937,7 @@ #f (label cfg-51) (logior! (-> self water flags) (water-flags swim-ground)) - (set! (-> self water swim-time) (current-time)) + (set-time! (-> self water swim-time)) (start-bobbing! (-> self water) -4096.0 600 1500) (set! (-> self water bob start-time) (+ (current-time) (seconds -0.05))) (go target-swim-stance) @@ -951,7 +951,7 @@ :exit target-exit :trans (behavior () (cond - ((< (- (current-time) (-> self state-time)) (seconds 0.5)) + ((not (time-elapsed? (-> self state-time) (seconds 0.5))) (logior! (-> self water flags) (water-flags jump-out)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) ) diff --git a/goal_src/jak2/engine/target/target-tube.gc b/goal_src/jak2/engine/target/target-tube.gc index 196ee65dd1..4513c8d628 100644 --- a/goal_src/jak2/engine/target/target-tube.gc +++ b/goal_src/jak2/engine/target/target-tube.gc @@ -583,7 +583,7 @@ (set! (-> self tube entity) (-> a0-4 entity)) ) ) - (set! (-> self tube start-time) (current-time)) + (set-time! (-> self tube start-time)) (set! (-> self tube tube-sound-id) (new-sound-id)) (set! (-> self tube tube-sound-vol) 0.0) (set! (-> self tube tube-sound-pitch) 0.0) @@ -732,7 +732,7 @@ (defstate target-tube-jump (target) :event (-> target-tube-start event) :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *tube-jump-mods*) @@ -806,9 +806,9 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (let ((gp-0 (-> self attack-info))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (when (not (logtest? (-> arg1 mask) (attack-mask vector))) (vector-! (-> arg1 vector) @@ -857,7 +857,7 @@ (when (= arg0 'attack) (send-event (handle->process (-> self notify)) 'notify 'hit (-> gp-0 mode)) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('bot) (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) @@ -939,10 +939,10 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'life (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until v1-42 (suspend) - (set! v1-42 (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (movie?)))) + (set! v1-42 (and (time-elapsed? (-> self state-time) (seconds 1)) (not (movie?)))) ) (go target-tube) ) @@ -1100,19 +1100,19 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! slide-control ((obj slide-control) (arg0 entity-actor)) +(defmethod init-from-entity! slide-control ((this slide-control) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj target) (the-as handle #f)) - (go (method-of-object obj slide-control-watch)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this target) (the-as handle #f)) + (go (method-of-object this slide-control-watch)) (none) ) diff --git a/goal_src/jak2/engine/target/target-turret-shot.gc b/goal_src/jak2/engine/target/target-turret-shot.gc index ffd833bb3b..6b335dedc0 100644 --- a/goal_src/jak2/engine/target/target-turret-shot.gc +++ b/goal_src/jak2/engine/target/target-turret-shot.gc @@ -236,7 +236,7 @@ ) ) -(defmethod spawn-impact-particles turret-shot ((obj turret-shot)) +(defmethod spawn-impact-particles turret-shot ((this turret-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -246,8 +246,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((gp-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) (f30-0 (vector-length s5-1)) ) @@ -293,10 +293,10 @@ ) ) -(defmethod spawn-shell-particles turret-shot ((obj turret-shot)) +(defmethod spawn-shell-particles turret-shot ((this turret-shot)) "TODO - confirm" - (let* ((root (-> obj root)) - (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> root trans)) 2048.0)) + (let* ((root (-> this root)) + (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> root trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> root trans quad)) @@ -341,7 +341,7 @@ (none) ) -(defmethod play-impact-sound turret-shot ((obj turret-shot) (proj-options projectile-options)) +(defmethod play-impact-sound turret-shot ((this turret-shot) (proj-options projectile-options)) (let ((options proj-options)) (cond ((zero? options) @@ -357,21 +357,21 @@ ) ;; WARN: Return type mismatch projectile-options vs none. -(defmethod init-proj-settings! turret-shot ((obj turret-shot)) +(defmethod init-proj-settings! turret-shot ((this turret-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) + (set! (-> this tail-pos quad) (-> this root trans quad)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (set! (-> obj attack-mode) 'turret) - (set! (-> obj max-speed) 1228800.0) - (set! (-> obj move) guard-shot-move) - (set! (-> obj damage) 1.0) - (logior! (-> obj options) (projectile-options deal-damage)) + (set! (-> this attack-mode) 'turret) + (set! (-> this max-speed) 1228800.0) + (set! (-> this move) guard-shot-move) + (set! (-> this damage) 1.0) + (logior! (-> this options) (projectile-options deal-damage)) (none) ) -(defmethod init-proj-collision! turret-shot ((obj turret-shot)) +(defmethod init-proj-collision! turret-shot ((this turret-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -437,9 +437,9 @@ ) (set! (-> cshape max-iteration-count) (the-as uint 1)) (set! (-> cshape event-self) 'touched) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 diff --git a/goal_src/jak2/engine/target/target-turret.gc b/goal_src/jak2/engine/target/target-turret.gc index 35cf2fcdc6..bf6a3a123e 100644 --- a/goal_src/jak2/engine/target/target-turret.gc +++ b/goal_src/jak2/engine/target/target-turret.gc @@ -266,10 +266,10 @@ ) -(defmethod draw hud-turret-health ((obj hud-turret-health)) +(defmethod draw hud-turret-health ((this hud-turret-health)) (with-pp (seek! - (-> obj fade-interp) + (-> this fade-interp) (if (>= (-> *camera-combiner* interp-val) 1.0) 80.0 0.0 @@ -277,35 +277,35 @@ (-> pp clock time-adjust-ratio) ) (dotimes (v1-3 30) - (set! (-> obj sprites v1-3 color w) (the int (* (-> obj fade-interp) (- 1.0 (-> obj offset))))) + (set! (-> this sprites v1-3 color w) (the int (* (-> this fade-interp) (- 1.0 (-> this offset))))) ) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) 44 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites)) 0 44) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites)) 44 44) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 44 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) 0 44) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) 44 44) (dotimes (v1-6 16) - (set! (-> obj sprites (- 19 v1-6) scale-x) (if (< v1-6 (-> obj values 0 current)) + (set! (-> this sprites (- 19 v1-6) scale-x) (if (< v1-6 (-> this values 0 current)) 0.7 0.0 ) ) ) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites)) 13 6) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites)) 25 10) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites)) 34 19) - (set-as-offset-from! (-> obj sprites 7) (the-as vector4w (-> obj sprites)) 39 32) - (set-as-offset-from! (-> obj sprites 8) (the-as vector4w (-> obj sprites)) 39 47) - (set-as-offset-from! (-> obj sprites 9) (the-as vector4w (-> obj sprites)) 34 59) - (set-as-offset-from! (-> obj sprites 10) (the-as vector4w (-> obj sprites)) 25 67) - (set-as-offset-from! (-> obj sprites 11) (the-as vector4w (-> obj sprites)) 13 71) - (set-as-offset-from! (-> obj sprites 12) (the-as vector4w (-> obj sprites)) -1 71) - (set-as-offset-from! (-> obj sprites 13) (the-as vector4w (-> obj sprites)) -14 67) - (set-as-offset-from! (-> obj sprites 14) (the-as vector4w (-> obj sprites)) -22 59) - (set-as-offset-from! (-> obj sprites 15) (the-as vector4w (-> obj sprites)) -27 47) - (set-as-offset-from! (-> obj sprites 16) (the-as vector4w (-> obj sprites)) -27 32) - (set-as-offset-from! (-> obj sprites 17) (the-as vector4w (-> obj sprites)) -22 19) - (set-as-offset-from! (-> obj sprites 18) (the-as vector4w (-> obj sprites)) -14 10) - (set-as-offset-from! (-> obj sprites 19) (the-as vector4w (-> obj sprites)) -1 6) - (let ((f0-9 (the float (-> obj values 1 current)))) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) 13 6) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites)) 25 10) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites)) 34 19) + (set-as-offset-from! (-> this sprites 7) (the-as vector4w (-> this sprites)) 39 32) + (set-as-offset-from! (-> this sprites 8) (the-as vector4w (-> this sprites)) 39 47) + (set-as-offset-from! (-> this sprites 9) (the-as vector4w (-> this sprites)) 34 59) + (set-as-offset-from! (-> this sprites 10) (the-as vector4w (-> this sprites)) 25 67) + (set-as-offset-from! (-> this sprites 11) (the-as vector4w (-> this sprites)) 13 71) + (set-as-offset-from! (-> this sprites 12) (the-as vector4w (-> this sprites)) -1 71) + (set-as-offset-from! (-> this sprites 13) (the-as vector4w (-> this sprites)) -14 67) + (set-as-offset-from! (-> this sprites 14) (the-as vector4w (-> this sprites)) -22 59) + (set-as-offset-from! (-> this sprites 15) (the-as vector4w (-> this sprites)) -27 47) + (set-as-offset-from! (-> this sprites 16) (the-as vector4w (-> this sprites)) -27 32) + (set-as-offset-from! (-> this sprites 17) (the-as vector4w (-> this sprites)) -22 19) + (set-as-offset-from! (-> this sprites 18) (the-as vector4w (-> this sprites)) -14 10) + (set-as-offset-from! (-> this sprites 19) (the-as vector4w (-> this sprites)) -1 6) + (let ((f0-9 (the float (-> this values 1 current)))) (cond ((>= f0-9 100.0) (let ((f0-10 (if (< 100 (mod (-> *display* game-clock frame-counter) 200)) @@ -314,63 +314,63 @@ ) ) ) - (set! (-> obj sprites 26 angle) (* 182.04445 (- 270.0 f0-10))) - (set! (-> obj sprites 24 angle) (* 182.04445 (- f0-10))) - (set! (-> obj sprites 22 angle) (* 182.04445 (- 90.0 f0-10))) - (set! (-> obj sprites 20 angle) (* 182.04445 (- 180.0 f0-10))) + (set! (-> this sprites 26 angle) (* 182.04445 (- 270.0 f0-10))) + (set! (-> this sprites 24 angle) (* 182.04445 (- f0-10))) + (set! (-> this sprites 22 angle) (* 182.04445 (- 90.0 f0-10))) + (set! (-> this sprites 20 angle) (* 182.04445 (- 180.0 f0-10))) ) ) ((< 75.0 f0-9) - (set! (-> obj sprites 26 angle) (* 182.04445 (- 180.0 (* 3.6 (+ -75.0 f0-9))))) - (set! (-> obj sprites 24 angle) 32768.0) - (set! (-> obj sprites 22 angle) 49152.0) - (set! (-> obj sprites 20 angle) 0.0) + (set! (-> this sprites 26 angle) (* 182.04445 (- 180.0 (* 3.6 (+ -75.0 f0-9))))) + (set! (-> this sprites 24 angle) 32768.0) + (set! (-> this sprites 22 angle) 49152.0) + (set! (-> this sprites 20 angle) 0.0) ) ((< 50.0 f0-9) - (set! (-> obj sprites 26 angle) 32768.0) - (set! (-> obj sprites 24 angle) (* 182.04445 (- 270.0 (* 3.6 (+ -50.0 f0-9))))) - (set! (-> obj sprites 22 angle) 49152.0) - (set! (-> obj sprites 20 angle) 0.0) + (set! (-> this sprites 26 angle) 32768.0) + (set! (-> this sprites 24 angle) (* 182.04445 (- 270.0 (* 3.6 (+ -50.0 f0-9))))) + (set! (-> this sprites 22 angle) 49152.0) + (set! (-> this sprites 20 angle) 0.0) ) ((< 25.0 f0-9) - (set! (-> obj sprites 26 angle) 32768.0) - (set! (-> obj sprites 24 angle) 49152.0) - (set! (-> obj sprites 22 angle) (* 182.04445 (- (* 3.6 (+ -25.0 f0-9))))) - (set! (-> obj sprites 20 angle) 0.0) + (set! (-> this sprites 26 angle) 32768.0) + (set! (-> this sprites 24 angle) 49152.0) + (set! (-> this sprites 22 angle) (* 182.04445 (- (* 3.6 (+ -25.0 f0-9))))) + (set! (-> this sprites 20 angle) 0.0) ) (else - (set! (-> obj sprites 26 angle) 32768.0) - (set! (-> obj sprites 24 angle) 49152.0) - (set! (-> obj sprites 22 angle) 0.0) - (set! (-> obj sprites 20 angle) (* 182.04445 (- 90.0 (* 3.6 f0-9)))) + (set! (-> this sprites 26 angle) 32768.0) + (set! (-> this sprites 24 angle) 49152.0) + (set! (-> this sprites 22 angle) 0.0) + (set! (-> this sprites 20 angle) (* 182.04445 (- 90.0 (* 3.6 f0-9)))) ) ) ) - (set-as-offset-from! (-> obj sprites 20) (the-as vector4w (-> obj sprites)) 0 45) - (set-as-offset-from! (-> obj sprites 22) (the-as vector4w (-> obj sprites)) 0 44) - (set-as-offset-from! (-> obj sprites 24) (the-as vector4w (-> obj sprites)) 2 44) - (set-as-offset-from! (-> obj sprites 26) (the-as vector4w (-> obj sprites)) 2 45) - (set-as-offset-from! (-> obj sprites 21) (the-as vector4w (-> obj sprites)) 0 14) - (set-as-offset-from! (-> obj sprites 23) (the-as vector4w (-> obj sprites)) 0 44) - (set-as-offset-from! (-> obj sprites 25) (the-as vector4w (-> obj sprites)) -30 44) - (set-as-offset-from! (-> obj sprites 27) (the-as vector4w (-> obj sprites)) -30 14) - (set-as-offset-from! (-> obj sprites 29) (the-as vector4w (-> obj sprites)) -10 36) - (let ((f0-34 (if (and (= (-> obj values 4 current) 1) (< 25 (mod (-> *display* game-clock frame-counter) 50))) + (set-as-offset-from! (-> this sprites 20) (the-as vector4w (-> this sprites)) 0 45) + (set-as-offset-from! (-> this sprites 22) (the-as vector4w (-> this sprites)) 0 44) + (set-as-offset-from! (-> this sprites 24) (the-as vector4w (-> this sprites)) 2 44) + (set-as-offset-from! (-> this sprites 26) (the-as vector4w (-> this sprites)) 2 45) + (set-as-offset-from! (-> this sprites 21) (the-as vector4w (-> this sprites)) 0 14) + (set-as-offset-from! (-> this sprites 23) (the-as vector4w (-> this sprites)) 0 44) + (set-as-offset-from! (-> this sprites 25) (the-as vector4w (-> this sprites)) -30 44) + (set-as-offset-from! (-> this sprites 27) (the-as vector4w (-> this sprites)) -30 14) + (set-as-offset-from! (-> this sprites 29) (the-as vector4w (-> this sprites)) -10 36) + (let ((f0-34 (if (and (= (-> this values 4 current) 1) (< 25 (mod (-> *display* game-clock frame-counter) 50))) 250.0 100.0 ) ) ) - (set! (-> obj sprites 29 color x) (the int f0-34)) - (set! (-> obj sprites 29 color y) (the int (if (>= (-> obj values 1 current) 100) + (set! (-> this sprites 29 color x) (the int f0-34)) + (set! (-> this sprites 29 color y) (the int (if (>= (-> this values 1 current) 100) 0.0 f0-34 ) ) ) ) - (set! (-> obj sprites 29 color z) (-> obj sprites 29 color y)) - (let ((f30-0 (- (the float (-> obj values 3 current))))) + (set! (-> this sprites 29 color z) (-> this sprites 29 color y)) + (let ((f30-0 (- (the float (-> this values 3 current))))) (let ((a1-31 (new 'stack-no-clear 'vector))) (set! (-> a1-31 x) 128.0) (set! (-> a1-31 y) 128.0) @@ -382,65 +382,65 @@ (set! (-> a2-29 z) 32.0) (set! (-> a2-29 w) 0.0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-lerp! s5-0 a1-31 a2-29 (* 0.01 (the float (-> obj values 5 current)))) - (vector-cvt.w.s! (the-as vector (-> obj sprites 28 color2)) s5-0) + (vector-lerp! s5-0 a1-31 a2-29 (* 0.01 (the float (-> this values 5 current)))) + (vector-cvt.w.s! (the-as vector (-> this sprites 28 color2)) s5-0) ) ) ) - (set! (-> obj sprites 28 color w) - (the int (* 0.00390625 (-> obj fade-interp) (the float (-> obj values 2 current)))) + (set! (-> this sprites 28 color w) + (the int (* 0.00390625 (-> this fade-interp) (the float (-> this values 2 current)))) ) (set-as-offset-from! - (-> obj sprites 28) - (the-as vector4w (-> obj sprites)) + (-> this sprites 28) + (the-as vector4w (-> this sprites)) (the int (* -70.0 (sin f30-0))) (+ (the int (* -70.0 (cos f30-0))) 44) ) - (set! (-> obj sprites 28 angle) (+ -8192.0 f30-0)) + (set! (-> this sprites 28 angle) (+ -8192.0 f30-0)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ) -(defmethod update-values hud-turret-health ((obj hud-turret-health)) - (set! (-> obj values 0 target) (the int (-> *game-info* score))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-turret-health ((this hud-turret-health)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod event-callback hud-turret-health ((obj hud-turret-health) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-callback hud-turret-health ((this hud-turret-health) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('set-heat) - (set! (-> obj values 1 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) + (set! (-> this values 1 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) ) (('set-arrow-alpha) - (set! (-> obj values 2 target) (the int (* 256.0 (the-as float (-> arg3 param 0))))) + (set! (-> this values 2 target) (the int (* 256.0 (the-as float (-> arg3 param 0))))) ) (('set-arrow-angle) - (set! (-> obj values 3 target) (the int (the-as float (-> arg3 param 0)))) + (set! (-> this values 3 target) (the int (the-as float (-> arg3 param 0)))) ) (('set-target-flash) - (set! (-> obj values 4 target) (if (-> arg3 param 0) + (set! (-> this values 4 target) (if (-> arg3 param 0) 1 0 ) ) ) (('set-arrow-red) - (set! (-> obj values 5 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) + (set! (-> this values 5 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) ) (('set-hud-pos) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) (the-as int (-> arg3 param 0)) (the-as int (+ (-> arg3 param 1) -4)) ) ) ) - ((method-of-type hud event-callback) obj arg0 arg1 arg2 arg3) + ((method-of-type hud event-callback) this arg0 arg1 arg2 arg3) ) (defun init-turret-hud ((arg0 hud-turret-health) (arg1 string)) @@ -559,10 +559,10 @@ ) -(defmethod init-callback hud-drill-turret-health ((obj hud-drill-turret-health)) - (set! (-> obj level) (level-get *level* 'drillmid)) - (init-turret-hud obj "drillmid-minimap") - ((method-of-type hud init-callback) obj) +(defmethod init-callback hud-drill-turret-health ((this hud-drill-turret-health)) + (set! (-> this level) (level-get *level* 'drillmid)) + (init-turret-hud this "drillmid-minimap") + ((method-of-type hud init-callback) this) 0 (none) ) @@ -576,10 +576,10 @@ ) -(defmethod init-callback hud-port-turret-health ((obj hud-port-turret-health)) - (set! (-> obj level) (level-get *level* 'portblmp)) - (init-turret-hud obj "portblmp-minimap") - ((method-of-type hud init-callback) obj) +(defmethod init-callback hud-port-turret-health ((this hud-port-turret-health)) + (set! (-> this level) (level-get *level* 'portblmp)) + (init-turret-hud this "portblmp-minimap") + ((method-of-type hud init-callback) this) 0 (none) ) @@ -737,101 +737,101 @@ ;; WARN: Return type mismatch process-drawable vs base-turret. -(defmethod relocate base-turret ((obj base-turret) (arg0 int)) +(defmethod relocate base-turret ((this base-turret) (arg0 int)) (countdown (v1-0 4) - (if (-> obj gun-recoil-jmod v1-0) - (&+! (-> obj gun-recoil-jmod v1-0) arg0) + (if (-> this gun-recoil-jmod v1-0) + (&+! (-> this gun-recoil-jmod v1-0) arg0) ) ) - (the-as base-turret ((method-of-type process-drawable relocate) obj arg0)) + (the-as base-turret ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod base-turret-method-34 base-turret ((obj base-turret) (arg0 process)) +(defmethod base-turret-method-34 base-turret ((this base-turret) (arg0 process)) 0 (none) ) -(defmethod base-turret-method-35 base-turret ((obj base-turret)) - (send-event (handle->process (-> obj hud)) 'force-show) +(defmethod base-turret-method-35 base-turret ((this base-turret)) + (send-event (handle->process (-> this hud)) 'force-show) 0 (none) ) -(defmethod base-turret-method-36 base-turret ((obj base-turret)) - (if (nonzero? (-> obj part)) - (spawn (-> obj part) (-> obj root trans)) +(defmethod base-turret-method-36 base-turret ((this base-turret)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) ) 0 (none) ) -(defmethod base-turret-method-40 base-turret ((obj base-turret)) +(defmethod base-turret-method-40 base-turret ((this base-turret)) (let ((s3-0 (new 'stack-no-clear 'matrix)) (s4-0 (new 'stack-no-clear 'matrix)) (gp-0 (new 'stack-no-clear 'quaternion)) ) - (matrix-rotate-y! s3-0 (-> obj roty)) - (matrix-rotate-x! s4-0 (-> obj rotx)) + (matrix-rotate-y! s3-0 (-> this roty)) + (matrix-rotate-x! s4-0 (-> this rotx)) (matrix*! s3-0 s4-0 s3-0) (matrix->quaternion gp-0 s3-0) - (quaternion-smooth-seek! (-> obj target-quat) (-> obj target-quat) gp-0 0.33) - (let ((f0-2 (update! (-> obj smush-control)))) - (quaternion-rotate-local-x! (-> obj root quat) gp-0 (* -910.2222 f0-2)) + (quaternion-smooth-seek! (-> this target-quat) (-> this target-quat) gp-0 0.33) + (let ((f0-2 (update! (-> this smush-control)))) + (quaternion-rotate-local-x! (-> this root quat) gp-0 (* -910.2222 f0-2)) ) ) 0 (none) ) -(defmethod base-turret-method-37 base-turret ((obj base-turret)) - (let ((f30-0 (fabs (* 0.00006866455 (-> obj rotyv)))) - (f28-0 (fabs (* 0.00010986328 (-> obj rotxv)))) +(defmethod base-turret-method-37 base-turret ((this base-turret)) + (let ((f30-0 (fabs (* 0.00006866455 (-> this rotyv)))) + (f28-0 (fabs (* 0.00010986328 (-> this rotxv)))) (f26-0 0.33333334) (f24-0 0.5) - (s5-0 (-> obj sound-playing 0)) - (s4-0 (-> obj sound-playing 1)) + (s5-0 (-> this sound-playing 0)) + (s4-0 (-> this sound-playing 1)) ) (cond - ((and (-> obj sound-playing 0) (< f30-0 f26-0)) - (sound-stop (-> obj sound-id 0)) - (set! (-> obj sound-playing 0) #f) + ((and (-> this sound-playing 0) (< f30-0 f26-0)) + (sound-stop (-> this sound-id 0)) + (set! (-> this sound-playing 0) #f) ) ((< (* 1.2 f26-0) f30-0) - (sound-play "drill-turret-lp" :id (-> obj sound-id 0) :position (-> obj root trans)) - (set! (-> obj sound-playing 0) #t) + (sound-play "drill-turret-lp" :id (-> this sound-id 0) :position (-> this root trans)) + (set! (-> this sound-playing 0) #t) ) ) (cond - ((and (-> obj sound-playing 1) (< f28-0 f24-0)) - (sound-stop (-> obj sound-id 1)) - (set! (-> obj sound-playing 1) #f) + ((and (-> this sound-playing 1) (< f28-0 f24-0)) + (sound-stop (-> this sound-id 1)) + (set! (-> this sound-playing 1) #f) ) ((< (* 1.2 f24-0) f28-0) - (sound-play "drill-turret-l2" :id (-> obj sound-id 1) :position (-> obj root trans)) - (set! (-> obj sound-playing 1) #t) + (sound-play "drill-turret-l2" :id (-> this sound-id 1) :position (-> this root trans)) + (set! (-> this sound-playing 1) #t) ) ) (if (and (or s5-0 s4-0) (< f30-0 f26-0) (< f28-0 f24-0)) - (sound-play "drill-tur-stop" :position (-> obj root trans)) + (sound-play "drill-tur-stop" :position (-> this root trans)) ) ) - (case (-> obj path-mode) + (case (-> this path-mode) ((2 3 4) (sound-play-by-name (static-sound-name "turret-track") - (-> obj sound-id 2) - (the int (* 1024.0 (lerp-clamp 0.0 1.0 (-> obj path-speed-mult)))) - (the int (* 1524.0 (lerp-scale -0.3 0.3 (-> obj path-speed-mult) 0.0 4.0))) + (-> this sound-id 2) + (the int (* 1024.0 (lerp-clamp 0.0 1.0 (-> this path-speed-mult)))) + (the int (* 1524.0 (lerp-scale -0.3 0.3 (-> this path-speed-mult) 0.0 4.0))) 0 (sound-group sfx) - (-> obj root trans) + (-> this root trans) ) - (set! (-> obj sound-playing 2) #t) + (set! (-> this sound-playing 2) #t) ) (else - (when (-> obj sound-playing 2) - (sound-stop (-> obj sound-id 2)) - (set! (-> obj sound-playing 2) #f) + (when (-> this sound-playing 2) + (sound-stop (-> this sound-id 2)) + (set! (-> this sound-playing 2) #f) ) ) ) @@ -839,32 +839,32 @@ (none) ) -(defmethod turret-event-handler base-turret ((obj base-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod turret-event-handler base-turret ((this base-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('trans) (set! v0-0 (-> arg3 param 0)) - (set! (-> (the-as vector v0-0) quad) (-> obj root trans quad)) + (set! (-> (the-as vector v0-0) quad) (-> this root trans quad)) v0-0 ) (('quat) - (quaternion-copy! (the-as quaternion (-> arg3 param 0)) (-> obj target-quat)) + (quaternion-copy! (the-as quaternion (-> arg3 param 0)) (-> this target-quat)) ) (('path) - (if (not (logtest? (-> obj path flags) (path-control-flag not-found))) - (-> obj path) + (if (not (logtest? (-> this path flags) (path-control-flag not-found))) + (-> this path) #f ) ) (('shadow) (cond ((-> arg3 param 0) - (set! v0-0 (-> obj shadow-backup)) - (set! (-> obj draw shadow) (the-as shadow-geo v0-0)) + (set! v0-0 (-> this shadow-backup)) + (set! (-> this draw shadow) (the-as shadow-geo v0-0)) v0-0 ) (else - (set! (-> obj draw shadow) #f) + (set! (-> this draw shadow) #f) #f ) ) @@ -876,11 +876,11 @@ (turret-event-handler self arg0 arg1 arg2 arg3) ) -(defmethod get-trans base-turret ((obj base-turret) (arg0 int)) +(defmethod get-trans base-turret ((this base-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (if (= arg0 1) - (-> obj root trans) - ((method-of-type process-focusable get-trans) obj arg0) + (-> this root trans) + ((method-of-type process-focusable get-trans) this arg0) ) ) @@ -1549,12 +1549,12 @@ ) ;; WARN: Return type mismatch symbol vs process. -(defmethod base-turret-method-46 base-turret ((obj base-turret) (arg0 process)) +(defmethod base-turret-method-46 base-turret ((this base-turret) (arg0 process)) (the-as process #t) ) -(defmethod base-turret-method-47 base-turret ((obj base-turret)) - (let ((a0-1 (-> obj root trans)) +(defmethod base-turret-method-47 base-turret ((this base-turret)) + (let ((a0-1 (-> this root trans)) (f30-0 0.0) (s4-0 (the-as process-drawable #f)) ) @@ -1581,11 +1581,11 @@ (logtest? (process-mask enemy) (-> s2-1 mask)) (logtest? (process-mask collectable) (-> s2-1 mask)) (not (focus-test? (the-as process-focusable s2-1) disable dead ignore inactive)) - (!= s2-1 obj) + (!= s2-1 this) (!= s2-1 *target*) - (base-turret-method-46 obj s2-1) + (base-turret-method-46 this s2-1) ) - (let ((f0-1 (vector-vector-xz-distance (-> obj root trans) (-> s2-1 root trans)))) + (let ((f0-1 (vector-vector-xz-distance (-> this root trans) (-> s2-1 root trans)))) (when (or (not s4-0) (< f0-1 f30-0)) (set! s4-0 s2-1) (set! f30-0 f0-1) @@ -1605,43 +1605,43 @@ (set! (-> s5-1 z) 0.0) (set! (-> s5-1 w) 1.0) (let ((s1-1 (new 'stack-no-clear 'vector)) - (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 12))) - (s2-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 12))) + (s2-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (vector-matrix*! s5-1 s5-1 (-> (the-as process-focusable s4-0) node-list data 0 bone transform)) (vector-line-distance-point! s5-1 s3-1 (vector+float*! (new 'stack-no-clear 'vector) s3-1 s2-2 4096.0) s1-1) (let* ((a1-10 (vector-! (new 'stack-no-clear 'vector) s5-1 s1-1)) - (s4-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) a1-10 (-> obj root quat))) + (s4-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) a1-10 (-> this root quat))) (f30-1 (vector-vector-angle-safe s2-2 (vector-! (new 'stack-no-clear 'vector) s5-1 s3-1))) ) (let ((f0-10 (- (atan (-> s4-1 x) (-> s4-1 y))))) (if (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! f0-10 (* -1.0 f0-10)) ) - (set! (-> obj arrow-angle) (deg-seek (-> obj arrow-angle) f0-10 (* 65536.0 (seconds-per-frame)))) + (set! (-> this arrow-angle) (deg-seek (-> this arrow-angle) f0-10 (* 65536.0 (seconds-per-frame)))) ) (cond ((< 910.2222 f30-1) - (seek! (-> obj arrow-alpha) 1.0 (seconds-per-frame)) - (send-event (handle->process (-> obj hud)) 'set-target-flash #f) + (seek! (-> this arrow-alpha) 1.0 (seconds-per-frame)) + (send-event (handle->process (-> this hud)) 'set-target-flash #f) ) (else - (seek! (-> obj arrow-alpha) 0.0 (* 4.0 (seconds-per-frame))) - (send-event (handle->process (-> obj hud)) 'set-target-flash #t) + (seek! (-> this arrow-alpha) 0.0 (* 4.0 (seconds-per-frame))) + (send-event (handle->process (-> this hud)) 'set-target-flash #t) ) ) ) ) (seek! - (-> obj arrow-red) - (lerp-scale 1.0 0.0 (vector-vector-distance s5-1 (-> obj root trans)) 122880.0 245760.0) + (-> this arrow-red) + (lerp-scale 1.0 0.0 (vector-vector-distance s5-1 (-> this root trans)) 122880.0 245760.0) (seconds-per-frame) ) ) ) (else - (seek! (-> obj arrow-alpha) 0.0 (seconds-per-frame)) - (send-event (handle->process (-> obj hud)) 'set-target-flash #f) + (seek! (-> this arrow-alpha) 0.0 (seconds-per-frame)) + (send-event (handle->process (-> this hud)) 'set-target-flash #f) ) ) ) @@ -1649,22 +1649,22 @@ (none) ) -(defmethod base-turret-method-43 base-turret ((obj base-turret)) - (set! (-> obj roty) (y-angle (-> obj root))) - (set! (-> obj rotyv) 0.0) - (set! (-> obj rotyvv) 0.0) - (set! (-> obj rotx) 0.0) - (set! (-> obj rotxv) 0.0) - (set! (-> obj rotxvv) 0.0) +(defmethod base-turret-method-43 base-turret ((this base-turret)) + (set! (-> this roty) (y-angle (-> this root))) + (set! (-> this rotyv) 0.0) + (set! (-> this rotyvv) 0.0) + (set! (-> this rotx) 0.0) + (set! (-> this rotxv) 0.0) + (set! (-> this rotxvv) 0.0) 0 (none) ) -(defmethod turret-init! base-turret ((obj base-turret) (arg0 entity-actor) (arg1 matrix)) +(defmethod turret-init! base-turret ((this base-turret) (arg0 entity-actor) (arg1 matrix)) (local-vars (sv-16 res-tag)) ;; og:preserve-this changed from 512 - (stack-size-set! (-> obj main-thread) 1024) - (let ((s3-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s3-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s3-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s3-0 reaction) cshape-reaction-default) (set! (-> s3-0 no-reaction) @@ -1693,109 +1693,109 @@ (set! (-> s3-0 backup-collide-as) (-> v1-19 prim-core collide-as)) (set! (-> s3-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) - (set! (-> obj root) s3-0) + (set! (-> this root) s3-0) ) (when arg0 - (process-drawable-from-entity! obj arg0) - (set-yaw-angle-clear-roll-pitch! (-> obj root) (res-lump-float arg0 'rotoffset)) + (process-drawable-from-entity! this arg0) + (set-yaw-angle-clear-roll-pitch! (-> this root) (res-lump-float arg0 'rotoffset)) ) (when arg1 - (set! (-> obj root trans quad) (-> arg1 vector 0 quad)) - (quaternion-copy! (-> obj root quat) (the-as quaternion (-> arg1 vector 1))) + (set! (-> this root trans quad) (-> arg1 vector 0 quad)) + (quaternion-copy! (-> this root quat) (the-as quaternion (-> arg1 vector 1))) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-turret" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj shadow-backup) (the-as symbol (-> obj draw shadow))) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj condition) (res-lump-value arg0 'index int :time -1000000000.0)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this shadow-backup) (the-as symbol (-> this draw shadow))) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this condition) (res-lump-value arg0 'index int :time -1000000000.0)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (if (-> obj entity) - (move-to-ground (the-as collide-shape-moving (-> obj root)) 40960.0 40960.0 #t (collide-spec backgnd)) + (if (-> this entity) + (move-to-ground (the-as collide-shape-moving (-> this root)) 40960.0 40960.0 #t (collide-spec backgnd)) ) - (set-zero! (-> obj smush-control)) - (set! (-> obj hud) (the-as handle #f)) - (base-turret-method-43 obj) - (set! (-> obj alt-actor) (the-as symbol (entity-actor-lookup (-> obj entity) 'alt-actor 0))) + (set-zero! (-> this smush-control)) + (set! (-> this hud) (the-as handle #f)) + (base-turret-method-43 this) + (set! (-> this alt-actor) (the-as symbol (entity-actor-lookup (-> this entity) 'alt-actor 0))) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-49 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-49 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-49 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-49)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-49)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj sound-id 0) (new-sound-id)) - (set! (-> obj sound-id 1) (new-sound-id)) - (set! (-> obj sound-id 2) (new-sound-id)) - (set! (-> obj sound-playing 0) #f) - (set! (-> obj sound-playing 1) #f) - (set! (-> obj sound-playing 2) #f) - (let ((s5-1 (new 'process 'curve-control obj 'path -1000000000.0))) - (set! (-> obj path) s5-1) - (set! (-> obj path-u) 0.0) - (set! (-> obj path-u-prev) 0.0) - (set! (-> obj path-speed) (/ 16384.0 (total-distance s5-1))) - (set! (-> obj path-speed-mult) 0.0) - (set! (-> obj path-speed-mult-final) 1.0) - (set! (-> obj path-direction) #f) + (set! (-> this sound-id 0) (new-sound-id)) + (set! (-> this sound-id 1) (new-sound-id)) + (set! (-> this sound-id 2) (new-sound-id)) + (set! (-> this sound-playing 0) #f) + (set! (-> this sound-playing 1) #f) + (set! (-> this sound-playing 2) #f) + (let ((s5-1 (new 'process 'curve-control this 'path -1000000000.0))) + (set! (-> this path) s5-1) + (set! (-> this path-u) 0.0) + (set! (-> this path-u-prev) 0.0) + (set! (-> this path-speed) (/ 16384.0 (total-distance s5-1))) + (set! (-> this path-speed-mult) 0.0) + (set! (-> this path-speed-mult-final) 1.0) + (set! (-> this path-direction) #f) (cond ((logtest? (-> s5-1 flags) (path-control-flag not-found)) - (set! (-> obj path-mode) (the-as uint 0)) + (set! (-> this path-mode) (the-as uint 0)) 0 ) (else - (set! (-> obj path-mode) (the-as uint 1)) + (set! (-> this path-mode) (the-as uint 1)) ) ) (logior! (-> s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) ) - (when (not (logtest? (-> obj path flags) (path-control-flag not-found))) - (get-point-at-percent-along-path! (-> obj path) (-> obj root trans) 0.0 'interp) - (set! (-> obj path-old-pos quad) (-> obj root trans quad)) + (when (not (logtest? (-> this path flags) (path-control-flag not-found))) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) 0.0 'interp) + (set! (-> this path-old-pos quad) (-> this root trans quad)) ) - (set! (-> obj path-speed-mult) 1.0) - (quaternion-copy! (-> obj target-quat) *unity-quaternion*) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (set! (-> obj gun-index) 0) - (set! (-> obj shot-timeout) (seconds 0.667)) - (set! (-> obj gun-recoil-jmod 0) (new 'process 'joint-mod-add-local obj 5 #t #f #f)) - (set! (-> obj gun-recoil-jmod 0 enable) #f) - (set! (-> obj gun-recoil-jmod 1) (new 'process 'joint-mod-add-local obj 11 #t #f #f)) - (set! (-> obj gun-recoil-jmod 1 enable) #f) - (set! (-> obj gun-recoil-jmod 2) (new 'process 'joint-mod-add-local obj 7 #t #f #f)) - (set! (-> obj gun-recoil-jmod 2 enable) #f) - (set! (-> obj gun-recoil-jmod 3) (new 'process 'joint-mod-add-local obj 9 #t #f #f)) - (set! (-> obj gun-recoil-jmod 3 enable) #f) - (set! (-> obj health) 16.0) - (set! (-> obj heat) 0.0) - (set! (-> obj heat-target) 0.0) - (set! (-> obj arrow-angle) 0.0) - (set! (-> obj enable-controls) #t) - (set! (-> obj available-for-pickup) #t) - (set! (-> obj rotx-min) -10922.667) - (set! (-> obj rotx-max) 5461.3335) - (set! (-> obj roty-min) 0.0) - (set! (-> obj roty-max) 0.0) - (set! (-> obj fire-time-interval) (seconds 0.15)) + (set! (-> this path-speed-mult) 1.0) + (quaternion-copy! (-> this target-quat) *unity-quaternion*) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (set! (-> this gun-index) 0) + (set! (-> this shot-timeout) (seconds 0.667)) + (set! (-> this gun-recoil-jmod 0) (new 'process 'joint-mod-add-local this 5 #t #f #f)) + (set! (-> this gun-recoil-jmod 0 enable) #f) + (set! (-> this gun-recoil-jmod 1) (new 'process 'joint-mod-add-local this 11 #t #f #f)) + (set! (-> this gun-recoil-jmod 1 enable) #f) + (set! (-> this gun-recoil-jmod 2) (new 'process 'joint-mod-add-local this 7 #t #f #f)) + (set! (-> this gun-recoil-jmod 2 enable) #f) + (set! (-> this gun-recoil-jmod 3) (new 'process 'joint-mod-add-local this 9 #t #f #f)) + (set! (-> this gun-recoil-jmod 3 enable) #f) + (set! (-> this health) 16.0) + (set! (-> this heat) 0.0) + (set! (-> this heat-target) 0.0) + (set! (-> this arrow-angle) 0.0) + (set! (-> this enable-controls) #t) + (set! (-> this available-for-pickup) #t) + (set! (-> this rotx-min) -10922.667) + (set! (-> this rotx-max) 5461.3335) + (set! (-> this roty-min) 0.0) + (set! (-> this roty-max) 0.0) + (set! (-> this fire-time-interval) (seconds 0.15)) 0 (none) ) -(defmethod base-turret-method-41 base-turret ((obj base-turret) (arg0 vector)) +(defmethod base-turret-method-41 base-turret ((this base-turret) (arg0 vector)) (local-vars (sv-592 int)) - (let* ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj init-quat))) - (s1-0 (-> obj root trans)) + (let* ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this init-quat))) + (s1-0 (-> this root trans)) (s5-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack 'collide-query)) (s0-0 8) @@ -1813,9 +1813,9 @@ (let ((v1-9 s2-0)) (set! (-> v1-9 radius) 409.6) (set! (-> v1-9 collide-with) (collide-spec backgnd)) - (set! (-> v1-9 ignore-process0) obj) + (set! (-> v1-9 ignore-process0) this) (set! (-> v1-9 ignore-process1) #f) - (set! (-> v1-9 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-9 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-9 action-mask) (collide-action solid)) ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) @@ -1829,37 +1829,37 @@ #f ) -(defmethod base-turret-method-44 base-turret ((obj base-turret) (arg0 vector) (arg1 vector)) +(defmethod base-turret-method-44 base-turret ((this base-turret) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> gp-0 ent) (-> obj entity)) + (set! (-> gp-0 ent) (-> this entity)) (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options account-for-target-velocity proj-options-8000)) (set! (-> gp-0 pos quad) (-> arg0 quad)) (set! (-> gp-0 vel quad) (-> (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1228800.0) quad)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) - (set! (-> gp-0 ignore-handle) (process->handle obj)) + (set! (-> gp-0 ignore-handle) (process->handle this)) (let* ((v1-9 *game-info*) (a0-9 (+ (-> v1-9 attack-id) 1)) ) (set! (-> v1-9 attack-id) a0-9) (set! (-> gp-0 attack-id) a0-9) ) - (set! (-> gp-0 timeout) (-> obj shot-timeout)) - (spawn-projectile turret-shot gp-0 obj *default-dead-pool*) + (set! (-> gp-0 timeout) (-> this shot-timeout)) + (spawn-projectile turret-shot gp-0 this *default-dead-pool*) ) 0 (none) ) -(defmethod base-turret-method-42 base-turret ((obj base-turret) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod base-turret-method-42 base-turret ((this base-turret) (arg0 vector) (arg1 vector) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set! (-> s5-0 start-pos quad) (-> arg0 quad)) (vector-normalize-copy! (-> s5-0 move-dist) arg1 819200.0) (let ((v1-1 s5-0)) (set! (-> v1-1 radius) 2048.0) (set! (-> v1-1 collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) - (set! (-> v1-1 ignore-process0) obj) + (set! (-> v1-1 ignore-process0) this) (set! (-> v1-1 ignore-process1) #f) (set! (-> v1-1 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-1 action-mask) (collide-action solid)) @@ -1878,7 +1878,7 @@ ) ) -(defmethod base-turret-method-45 base-turret ((obj base-turret) (arg0 object) (arg1 symbol)) +(defmethod base-turret-method-45 base-turret ((this base-turret) (arg0 object) (arg1 symbol)) (local-vars (sv-112 vector) (sv-128 vector) (sv-144 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1888,24 +1888,24 @@ (vf4 :class vf) ) (init-vf0-vector) - (when (< (-> obj heat) 1.0) + (when (< (-> this heat) 1.0) (let ((s3-0 (new 'static 'array int32 4 5 11 7 9)) - (s4-0 (* (-> obj gun-index) 2)) - (s2-0 (+ (* (-> obj gun-index) 2) 1)) - (s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (s4-0 (* (-> this gun-index) 2)) + (s2-0 (+ (* (-> this gun-index) 2) 1)) + (s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) - (set-recoil (the-as joint-mod (-> obj gun-recoil-jmod s4-0)) -819.2 arg1) - (set-recoil (the-as joint-mod (-> obj gun-recoil-jmod s2-0)) 819.2 arg1) - (let ((s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> s3-0 s4-0)))) - (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> s3-0 s2-0)))) - (s0-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 12))) + (set-recoil (the-as joint-mod (-> this gun-recoil-jmod s4-0)) -819.2 arg1) + (set-recoil (the-as joint-mod (-> this gun-recoil-jmod s2-0)) 819.2 arg1) + (let ((s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> s3-0 s4-0)))) + (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> s3-0 s2-0)))) + (s0-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 12))) (s1-0 (new 'stack-no-clear 'vector)) (s2-1 (new 'stack-no-clear 'vector)) ) (set! sv-144 s0-0) (set! sv-112 s0-0) (set! sv-128 s5-0) - (let ((f0-2 (+ 20480.0 (base-turret-method-42 obj s0-0 s5-0 819200.0)))) + (let ((f0-2 (+ 20480.0 (base-turret-method-42 this s0-0 s5-0 819200.0)))) (.lvf vf2 (&-> sv-128 quad)) (.lvf vf1 (&-> sv-112 quad)) (let ((v1-25 f0-2)) @@ -1920,20 +1920,20 @@ (vector-! s2-1 s0-0 s3-1) (vector-normalize! s1-0 1.0) (vector-normalize! s2-1 1.0) - (base-turret-method-44 obj s4-1 s1-0) - (base-turret-method-44 obj s3-1 s2-1) + (base-turret-method-44 this s4-1 s1-0) + (base-turret-method-44 this s3-1 s2-1) ) ) - (set! (-> obj gun-index) (- 1 (-> obj gun-index))) - (activate! (-> obj smush-control) 0.1 30 120 0.8 0.9 (-> *display* entity-clock)) + (set! (-> this gun-index) (- 1 (-> this gun-index))) + (activate! (-> this smush-control) 0.1 30 120 0.8 0.9 (-> *display* entity-clock)) ) - (seek! (-> obj heat-target) 1.05 0.1) + (seek! (-> this heat-target) 1.05 0.1) 0 (none) ) ) -(defmethod base-turret-method-39 base-turret ((obj base-turret) (arg0 turret-path-event)) +(defmethod base-turret-method-39 base-turret ((this base-turret) (arg0 turret-path-event)) (case (-> arg0 event-type) (('script) (script-eval (the-as pair (-> arg0 param))) @@ -1946,50 +1946,50 @@ ) ) (('pause-until) - (set! (-> obj path-mode) (the-as uint 3)) - (set! (-> obj pause-proc) (the-as (function base-turret symbol) (-> arg0 param))) - (set! (-> obj path-speed-mult-final) 0.0) + (set! (-> this path-mode) (the-as uint 3)) + (set! (-> this pause-proc) (the-as (function base-turret symbol) (-> arg0 param))) + (set! (-> this path-speed-mult-final) 0.0) ) (('pause-while) - (set! (-> obj path-mode) (the-as uint 4)) - (set! (-> obj pause-proc) (the-as (function base-turret symbol) (-> arg0 param))) - (set! (-> obj path-speed-mult-final) 0.0) + (set! (-> this path-mode) (the-as uint 4)) + (set! (-> this pause-proc) (the-as (function base-turret symbol) (-> arg0 param))) + (set! (-> this path-speed-mult-final) 0.0) ) (('set-speed-mult) ;; og:preserve-this cast to (array int32) has been added because the turret-path params were changed to boxed int arrays - (set! (-> obj path-speed-mult-final) (* 0.1 (the float (/ (-> (the-as (array int32) (-> arg0 param)) 0) 8)))) + (set! (-> this path-speed-mult-final) (* 0.1 (the float (/ (-> (the-as (array int32) (-> arg0 param)) 0) 8)))) ) (('enable-controls) - (set! (-> obj enable-controls) #t) + (set! (-> this enable-controls) #t) ) (('disable-controls) - (set! (-> obj enable-controls) #f) + (set! (-> this enable-controls) #f) ) (('set-roty-min) - (set! (-> obj roty-min) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) + (set! (-> this roty-min) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) ) (('set-roty-max) - (set! (-> obj roty-max) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) + (set! (-> this roty-max) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) ) (('set-rotyvv) - (set! (-> obj rotyvv) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) + (set! (-> this rotyvv) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) ) ) 0 (none) ) -(defmethod base-turret-method-38 base-turret ((obj base-turret)) - (when (nonzero? (-> obj path-event)) - (let* ((s5-0 (-> obj path-event)) - (f0-0 (get-num-segments (-> obj path))) - (f30-0 (* f0-0 (-> obj path-u))) - (f28-0 (* f0-0 (-> obj path-u-prev))) +(defmethod base-turret-method-38 base-turret ((this base-turret)) + (when (nonzero? (-> this path-event)) + (let* ((s5-0 (-> this path-event)) + (f0-0 (get-num-segments (-> this path))) + (f30-0 (* f0-0 (-> this path-u))) + (f28-0 (* f0-0 (-> this path-u-prev))) ) (dotimes (s4-0 (-> s5-0 event-count)) (let ((a1-0 (-> s5-0 event-tbl s4-0))) (if (and (>= f30-0 (-> a1-0 pos)) (< f28-0 (-> a1-0 pos))) - (base-turret-method-39 obj a1-0) + (base-turret-method-39 this a1-0) ) ) ) @@ -1999,27 +1999,27 @@ (none) ) -(defmethod deactivate base-turret ((obj base-turret)) - (if (valid? (-> obj hud) (the-as type #f) "" #t 0) - (send-event (handle->process (-> obj hud)) 'hide-and-die) +(defmethod deactivate base-turret ((this base-turret)) + (if (valid? (-> this hud) (the-as type #f) "" #t 0) + (send-event (handle->process (-> this hud)) 'hide-and-die) ) - (sound-stop (-> obj sound-id 0)) - (sound-stop (-> obj sound-id 1)) - (sound-stop (-> obj sound-id 2)) - ((method-of-type process-drawable deactivate) obj) + (sound-stop (-> this sound-id 0)) + (sound-stop (-> this sound-id 1)) + (sound-stop (-> this sound-id 2)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! base-turret ((obj base-turret) (arg0 entity-actor)) +(defmethod init-from-entity! base-turret ((this base-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (turret-init! obj arg0 (the-as matrix #f)) - (go (method-of-object obj idle)) + (turret-init! this arg0 (the-as matrix #f)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/engine/target/target-util.gc b/goal_src/jak2/engine/target/target-util.gc index 3b34b56bff..e153631dd7 100644 --- a/goal_src/jak2/engine/target/target-util.gc +++ b/goal_src/jak2/engine/target/target-util.gc @@ -990,8 +990,8 @@ 0 ) -(defmethod get-quaternion control-info ((obj control-info)) - (-> obj quat-for-control) +(defmethod get-quaternion control-info ((this control-info)) + (-> this quat-for-control) ) (defbehavior debounce-speed target ((arg0 float) (arg1 float) (arg2 vector) (arg3 vector)) @@ -1011,12 +1011,12 @@ ) ) -(defmethod get-inv-mass target ((obj target)) - (if (or (and (focus-test? obj dark) - (nonzero? (-> obj darkjak)) - (logtest? (-> obj darkjak stage) (darkjak-stage giant)) +(defmethod get-inv-mass target ((this target)) + (if (or (and (focus-test? this dark) + (nonzero? (-> this darkjak)) + (logtest? (-> this darkjak stage) (darkjak-stage giant)) ) - (focus-test? obj mech) + (focus-test? this mech) ) 0.1 1.0 @@ -1024,16 +1024,16 @@ ) ;; WARN: Return type mismatch control-info vs trsqv. -(defmethod apply-alignment target ((obj target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment target ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (with-pp (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg2 quad)) (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) - (let* ((s3-0 (-> obj control c-R-w)) - (s0-0 (-> obj control w-R-c)) - (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control dynam gravity) s0-0)) - (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control transv) s0-0)) + (let* ((s3-0 (-> this control c-R-w)) + (s0-0 (-> this control w-R-c)) + (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control dynam gravity) s0-0)) + (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control transv) s0-0)) ) (if (logtest? arg0 (align-opts no-gravity)) (set-vector! s1-0 0.0 0.0 0.0 1.0) @@ -1061,16 +1061,16 @@ (set! (-> a1-3 x) 0.0) ) ) - (vector-matrix*! (-> obj control transv) a1-3 s3-0) + (vector-matrix*! (-> this control transv) a1-3 s3-0) ) ) ) (if (logtest? arg0 (align-opts adjust-quat)) (quaternion-normalize! - (quaternion*! (-> obj control quat-for-control) (-> obj control quat-for-control) (-> arg1 quat)) + (quaternion*! (-> this control quat-for-control) (-> this control quat-for-control) (-> arg1 quat)) ) ) - (the-as trsqv (-> obj control)) + (the-as trsqv (-> this control)) ) ) @@ -1093,7 +1093,7 @@ (>= (- (-> *display* base-clock frame-counter) (-> self control cpad change-time)) (seconds 60)) (>= (- (-> *display* game-clock frame-counter) (the-as int (-> self game kiosk-timeout))) (seconds 60)) ) - (and (>= (- (current-time) (-> self ambient-time)) (seconds 30)) + (and (time-elapsed? (-> self ambient-time) (seconds 30)) (not (logtest? (-> self control status) (collide-status touch-actor))) (logtest? (-> self control status) (collide-status on-surface)) (not (or (logtest? (water-flags touch-water) (-> self water flags)) @@ -1135,15 +1135,14 @@ (defbehavior can-jump? target ((arg0 symbol)) (and (or (logtest? (-> self control status) (collide-status on-surface)) - (< (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (not (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) + ) (and (logtest? (-> self control status) (collide-status on-surface)) (< 0.866 (-> self control surface-angle)) ) (and (= arg0 'board) - (or (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.05)) - (and (< (- (current-time) (-> self control last-time-of-stuck)) (seconds 0.5)) + (or (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.05))) + (and (not (time-elapsed? (-> self control last-time-of-stuck) (seconds 0.5))) (< (target-height-above-ground) 2048.0) ) ) @@ -1175,7 +1174,7 @@ (when (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) - (set! (-> self control last-time-of-stuck) (current-time)) + (set-time! (-> self control last-time-of-stuck)) #t ) ) @@ -1199,13 +1198,11 @@ ;; WARN: Return type mismatch object vs none. (defbehavior fall-test target ((arg0 (state symbol target)) (arg1 float)) (when (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) arg1) ) - (if (< (- (current-time) (-> self control rider-time)) (the-as time-frame (-> *TARGET-bank* ground-timeout))) + (if (not (time-elapsed? (-> self control rider-time) (the-as time-frame (-> *TARGET-bank* ground-timeout)))) (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) ) (go arg0 #f) @@ -1216,9 +1213,7 @@ ;; WARN: Return type mismatch object vs none. (defbehavior slide-down-test target () (if (and (not (logtest? (-> self control status) (collide-status on-surface touch-edge))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (logtest? (-> self control status) (collide-status touch-surface)) (< 0.5 (-> self control surface-angle)) ) @@ -1244,11 +1239,11 @@ (< (-> self control local-slope-z) 0.7) (not (logtest? (-> self state-flags) (state-flags prevent-attack prevent-duck))) (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) - (>= (- (current-time) (the-as int (-> *TARGET-bank* roll-timeout))) (-> self control last-roll-end-time)) + (time-elapsed? (the-as int (-> *TARGET-bank* roll-timeout)) (-> self control last-roll-end-time)) (or (not (enabled-gun? self)) (not (-> *TARGET-bank* strafe-duck-jump)) (and (< 0.3 (vector-dot (-> self control to-target-pt-xz) (-> self control c-R-w vector 2))) - (>= (- (current-time) (-> self control time-of-last-zero-input)) (seconds 0.3)) + (time-elapsed? (-> self control time-of-last-zero-input) (seconds 0.3)) ) ) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -1308,24 +1303,24 @@ #f ) ((and (or (not arg0) - (and (< (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (and (not (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) + ) (< (-> self control local-slope-z) 0.7) ) ) - (>= (- (current-time) (-> self control last-running-attack-end-time)) - (the-as time-frame (if (and (= (-> self fact eco-type) 1) (>= (-> self fact eco-level) 1.0)) - (-> *TARGET-bank* yellow-attack-timeout) - (-> *TARGET-bank* attack-timeout) - ) - ) - ) + (time-elapsed? + (-> self control last-running-attack-end-time) + (the-as time-frame (if (and (= (-> self fact eco-type) 1) (>= (-> self fact eco-level) 1.0)) + (-> *TARGET-bank* yellow-attack-timeout) + (-> *TARGET-bank* attack-timeout) + ) + ) + ) ) #t ) (else - (set! (-> self control last-hands-attempt-time) (current-time)) + (set-time! (-> self control last-hands-attempt-time)) #f ) ) @@ -1338,13 +1333,11 @@ ) #f ) - ((>= (- (current-time) (-> self control last-attack-end-time)) - (the-as time-frame (-> *TARGET-bank* attack-timeout)) - ) + ((time-elapsed? (-> self control last-attack-end-time) (the-as time-frame (-> *TARGET-bank* attack-timeout))) #t ) (else - (set! (-> self control last-feet-attempt-time) (current-time)) + (set-time! (-> self control last-feet-attempt-time)) #f ) ) @@ -1421,12 +1414,12 @@ (case arg2 ((1) (logior! (-> arg1 state-flags) (state-flags tinvul1)) - (set! (-> arg1 control invul1-on-time) (current-time)) + (set-time! (-> arg1 control invul1-on-time)) (set! (-> arg1 control invul1-off-time) arg0) ) ((2) (logior! (-> arg1 state-flags) (state-flags tinvul2)) - (set! (-> arg1 control invul2-on-time) (current-time)) + (set-time! (-> arg1 control invul2-on-time)) (set! (-> arg1 control invul2-off-time) arg0) ) ) @@ -1466,9 +1459,8 @@ (dotimes (a2-2 8) (let ((v1-9 (-> self attack-info-old a2-2))) (when (= (-> arg0 id) (-> v1-9 id)) - (if (< (- (current-time) (-> v1-9 attack-time)) - (the-as time-frame (-> *TARGET-bank* same-attack-invulnerable-timeout)) - ) + (if (not (time-elapsed? (-> v1-9 attack-time) (the-as time-frame (-> *TARGET-bank* same-attack-invulnerable-timeout))) + ) (return #f) ) (cond @@ -1496,7 +1488,7 @@ #t ) -(defmethod attack-info-method-9 attack-info ((obj attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable)) +(defmethod attack-info-method-9 attack-info ((this attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable)) (local-vars (v1-14 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1515,8 +1507,8 @@ ) ) (cond - ((logtest? (attack-mask attacker-velocity) (-> obj mask)) - (set! (-> arg0 attacker-velocity quad) (-> obj attacker-velocity quad)) + ((logtest? (attack-mask attacker-velocity) (-> this mask)) + (set! (-> arg0 attacker-velocity quad) (-> this attacker-velocity quad)) (vector-normalize-copy! (-> arg0 trans) (-> arg0 attacker-velocity) 1.0) ) (v1-0 @@ -1567,135 +1559,135 @@ ) ) -(defmethod compute-intersect-info attack-info ((obj attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry)) +(defmethod compute-intersect-info attack-info ((this attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry)) (when (and arg3 arg1) (let ((a1-2 (prims-touching? arg3 (the-as collide-shape (-> arg1 root)) (the-as uint -1)))) (when a1-2 - (get-intersect-point (-> obj intersection) a1-2 (the-as collide-shape (-> arg1 root)) arg3) - (logior! (-> obj mask) (attack-mask intersection)) + (get-intersect-point (-> this intersection) a1-2 (the-as collide-shape (-> arg1 root)) arg3) + (logior! (-> this mask) (attack-mask intersection)) ) ) ) (when arg1 - (set! (-> obj prev-state) (-> arg1 state)) - (logior! (-> obj mask) (attack-mask prev-state)) + (set! (-> this prev-state) (-> arg1 state)) + (logior! (-> this mask) (attack-mask prev-state)) ) - (when (not (logtest? (-> obj mask) (attack-mask attacker))) - (set! (-> obj attacker) (process->handle arg2)) - (logior! (-> obj mask) (attack-mask attacker)) + (when (not (logtest? (-> this mask) (attack-mask attacker))) + (set! (-> this attacker) (process->handle arg2)) + (logior! (-> this mask) (attack-mask attacker)) ) - (when (not (logtest? (-> obj mask) (attack-mask attack-time))) - (set! (-> obj attack-time) (-> *display* base-clock frame-counter)) - (logior! (-> obj mask) (attack-mask attack-time)) + (when (not (logtest? (-> this mask) (attack-mask attack-time))) + (set! (-> this attack-time) (-> *display* base-clock frame-counter)) + (logior! (-> this mask) (attack-mask attack-time)) ) - (if (not (logtest? (attack-mask damage) (-> obj mask))) - (set! (-> obj damage) (-> *FACT-bank* health-default-inc)) + (if (not (logtest? (attack-mask damage) (-> this mask))) + (set! (-> this damage) (-> *FACT-bank* health-default-inc)) ) - obj + this ) -(defmethod combine! attack-info ((obj attack-info) (arg0 attack-info) (arg1 process-drawable)) +(defmethod combine! attack-info ((this attack-info) (arg0 attack-info) (arg1 process-drawable)) (let ((s4-0 (-> arg0 mask))) - (set! (-> obj mask) (-> arg0 mask)) + (set! (-> this mask) (-> arg0 mask)) (if (logtest? s4-0 (attack-mask attacker)) - (set! (-> obj attacker) (-> arg0 attacker)) + (set! (-> this attacker) (-> arg0 attacker)) ) (if (logtest? s4-0 (attack-mask mode)) - (set! (-> obj mode) (-> arg0 mode)) + (set! (-> this mode) (-> arg0 mode)) ) (if (logtest? s4-0 (attack-mask angle)) - (set! (-> obj angle) (-> arg0 angle)) + (set! (-> this angle) (-> arg0 angle)) ) (if (logtest? s4-0 (attack-mask dist)) - (set! (-> obj dist) (-> arg0 dist)) + (set! (-> this dist) (-> arg0 dist)) ) (if (logtest? s4-0 (attack-mask control)) - (set! (-> obj control) (-> arg0 control)) + (set! (-> this control) (-> arg0 control)) ) (if (logtest? s4-0 (attack-mask speed)) - (set! (-> obj speed) (-> arg0 speed)) + (set! (-> this speed) (-> arg0 speed)) ) (if (logtest? (attack-mask penetrate-using) s4-0) - (set! (-> obj penetrate-using) (-> arg0 penetrate-using)) + (set! (-> this penetrate-using) (-> arg0 penetrate-using)) ) (if (logtest? (attack-mask damage) s4-0) - (set! (-> obj damage) (-> arg0 damage)) + (set! (-> this damage) (-> arg0 damage)) ) (if (logtest? (attack-mask shield-damage) s4-0) - (set! (-> obj shield-damage) (-> arg0 shield-damage)) + (set! (-> this shield-damage) (-> arg0 shield-damage)) ) (if (logtest? (attack-mask knock) s4-0) - (set! (-> obj knock) (-> arg0 knock)) + (set! (-> this knock) (-> arg0 knock)) ) (if (logtest? (attack-mask count) s4-0) - (set! (-> obj count) (-> arg0 count)) + (set! (-> this count) (-> arg0 count)) ) (if (logtest? s4-0 (attack-mask id)) - (set! (-> obj id) (-> arg0 id)) + (set! (-> this id) (-> arg0 id)) ) (if (logtest? s4-0 (attack-mask shove-back)) - (set! (-> obj shove-back) (-> arg0 shove-back)) + (set! (-> this shove-back) (-> arg0 shove-back)) ) (if (logtest? s4-0 (attack-mask shove-up)) - (set! (-> obj shove-up) (-> arg0 shove-up)) + (set! (-> this shove-up) (-> arg0 shove-up)) ) (if (logtest? s4-0 (attack-mask invinc-time)) - (set! (-> obj invinc-time) (-> arg0 invinc-time)) + (set! (-> this invinc-time) (-> arg0 invinc-time)) ) (if (logtest? s4-0 (attack-mask rotate-to)) - (set! (-> obj rotate-to) (-> arg0 rotate-to)) + (set! (-> this rotate-to) (-> arg0 rotate-to)) ) (if (logtest? s4-0 (attack-mask intersection)) - (set! (-> obj intersection quad) (-> arg0 intersection quad)) + (set! (-> this intersection quad) (-> arg0 intersection quad)) ) (if (logtest? (attack-mask attacker-velocity) s4-0) - (set! (-> obj attacker-velocity quad) (-> arg0 attacker-velocity quad)) + (set! (-> this attacker-velocity quad) (-> arg0 attacker-velocity quad)) ) (cond ((not (logtest? s4-0 (attack-mask vector))) - (let* ((s2-0 (handle->process (-> obj attacker))) + (let* ((s2-0 (handle->process (-> this attacker))) (v1-65 (if (type? s2-0 process-drawable) s2-0 ) ) ) (when (and v1-65 (nonzero? (-> (the-as process-drawable v1-65) root))) - (set! (-> obj trans quad) (-> (the-as process-drawable v1-65) root trans quad)) - (vector-! (-> obj vector) (-> arg1 root trans) (-> (the-as process-drawable v1-65) root trans)) - (logior! (-> obj mask) (attack-mask vector)) + (set! (-> this trans quad) (-> (the-as process-drawable v1-65) root trans quad)) + (vector-! (-> this vector) (-> arg1 root trans) (-> (the-as process-drawable v1-65) root trans)) + (logior! (-> this mask) (attack-mask vector)) ) ) ) (else - (let* ((s3-1 (handle->process (-> obj attacker))) + (let* ((s3-1 (handle->process (-> this attacker))) (v1-72 (if (type? s3-1 process-drawable) s3-1 ) ) ) (if (and v1-72 (nonzero? (-> (the-as process-drawable v1-72) root))) - (set! (-> obj trans quad) (-> (the-as process-drawable v1-72) root trans quad)) + (set! (-> this trans quad) (-> (the-as process-drawable v1-72) root trans quad)) ) ) - (set! (-> obj vector quad) (-> arg0 vector quad)) + (set! (-> this vector quad) (-> arg0 vector quad)) (when (not (logtest? s4-0 (attack-mask shove-back))) - (let ((v1-79 (-> obj vector))) - (set! (-> obj shove-back) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z))))) + (let ((v1-79 (-> this vector))) + (set! (-> this shove-back) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z))))) ) ) (if (not (logtest? s4-0 (attack-mask shove-up))) - (set! (-> obj shove-up) (-> obj vector y)) + (set! (-> this shove-up) (-> this vector y)) ) ) ) - (if (not (logtest? (-> obj mask) (attack-mask dist))) - (set! (-> obj dist) (fabs (-> obj shove-back))) + (if (not (logtest? (-> this mask) (attack-mask dist))) + (set! (-> this dist) (fabs (-> this shove-back))) ) (if (logtest? s4-0 (attack-mask trans)) - (set! (-> obj trans quad) (-> arg0 trans quad)) + (set! (-> this trans quad) (-> arg0 trans quad)) ) ) - obj + this ) (defbehavior ground-tween-initialize target ((arg0 ground-tween-info) @@ -1860,24 +1852,24 @@ ) ) -(defmethod get-trans target ((obj target) (arg0 int)) +(defmethod get-trans target ((this target) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (v0-0 vector)) - (let ((v1-0 (-> obj control))) + (let ((v1-0 (-> this control))) (cond ((zero? arg0) (-> v1-0 trans) ) ((= arg0 1) - (let ((a1-2 (-> obj water flags))) + (let ((a1-2 (-> this water flags))) (cond ((and (logtest? (water-flags touch-water) a1-2) (logtest? (water-flags under-water swimming) a1-2) - (not (logtest? (focus-status mech) (-> obj focus-status))) + (not (logtest? (focus-status mech) (-> this focus-status))) ) (set! v0-0 (new 'static 'vector :w 1.0)) - (set! (-> v0-0 quad) (-> obj control trans quad)) - (set! (-> v0-0 y) (-> obj water height)) + (set! (-> v0-0 quad) (-> this control trans quad)) + (set! (-> v0-0 y) (-> this water height)) v0-0 ) (else @@ -1887,10 +1879,10 @@ ) ) ((= arg0 2) - (vector<-cspace! (new 'static 'vector) (-> obj node-list data 8)) + (vector<-cspace! (new 'static 'vector) (-> this node-list data 8)) ) ((= arg0 3) - (set! v0-0 (vector<-cspace! (new 'static 'vector) (-> obj node-list data 6))) + (set! v0-0 (vector<-cspace! (new 'static 'vector) (-> this node-list data 6))) (set! (-> v0-0 w) 4096.0) v0-0 ) @@ -1898,15 +1890,15 @@ (target-cam-pos) ) ((= arg0 5) - (if (= (-> obj draw origin w) 0.0) + (if (= (-> this draw origin w) 0.0) (-> v1-0 trans) - (-> obj draw origin) + (-> this draw origin) ) ) ((= arg0 6) (let ((f0-4 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) (cond - ((and (< 0.0 f0-4) (focus-test? obj in-air)) + ((and (< 0.0 f0-4) (focus-test? this in-air)) (let* ((v0-1 (new 'static 'vector)) (f0-5 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-4)) (f0-8 (/ (* 0.5 f0-5 f0-5) (-> v1-0 dynam gravity-length))) @@ -1933,19 +1925,19 @@ ) ) -(defmethod time-to-apex-or-ground target ((obj target) (arg0 int)) - (let ((v1-0 (-> obj control))) +(defmethod time-to-apex-or-ground target ((this target) (arg0 int)) + (let ((v1-0 (-> this control))) (cond ((zero? arg0) (let ((f0-1 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) - (if (and (< 0.0 f0-1) (focus-test? obj in-air)) + (if (and (< 0.0 f0-1) (focus-test? this in-air)) (time-to-apex f0-1 (- (-> v1-0 dynam gravity-length))) 0 ) ) ) ((= arg0 1) - (if (focus-test? obj in-air) + (if (focus-test? this in-air) (the-as int (target-time-to-ground)) 0 ) @@ -1957,39 +1949,39 @@ ) ) -(defmethod get-quat target ((obj target) (arg0 int)) +(defmethod get-quat target ((this target) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (-> obj control quat) + (-> this control quat) ) ((= v1-0 1) - (-> obj control quat-for-control) + (-> this control quat-for-control) ) ((= v1-0 2) - (-> obj control dir-targ) + (-> this control dir-targ) ) ((= v1-0 3) - (if (using-gun? obj) + (if (using-gun? this) (forward-up->quaternion (new 'static 'quaternion) - (-> obj gun fire-dir-out) - (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj control quat-for-control)) + (-> this gun fire-dir-out) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this control quat-for-control)) ) - (-> obj control quat) + (-> this control quat) ) ) (else - (-> obj control quat) + (-> this control quat) ) ) ) ) -(defmethod get-water-height target ((obj target)) - (-> obj water surface-height) +(defmethod get-water-height target ((this target)) + (-> this water surface-height) ) -(defmethod get-notice-time target ((obj target)) - (-> obj neck notice-time) +(defmethod get-notice-time target ((this target)) + (-> this neck notice-time) ) diff --git a/goal_src/jak2/engine/target/target.gc b/goal_src/jak2/engine/target/target.gc index d14fceb1a8..18d7747e6b 100644 --- a/goal_src/jak2/engine/target/target.gc +++ b/goal_src/jak2/engine/target/target.gc @@ -19,7 +19,7 @@ ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) (>= arg1 0) - (>= (- (current-time) (-> self state-time)) arg1) + (time-elapsed? (-> self state-time) arg1) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) #t @@ -48,7 +48,7 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control mod-surface) *walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) @@ -146,7 +146,7 @@ (if (and (using-gun? self) (-> self next-state) (= (-> self next-state name) 'target-walk)) (go target-gun-walk) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *walk-mods*) ) :exit (behavior () @@ -217,7 +217,7 @@ ) (go target-running-attack) ) - (when (and (turn-around?) (>= (- (current-time) (-> self state-time)) (seconds 0.3))) + (when (and (turn-around?) (time-elapsed? (-> self state-time) (seconds 0.3))) (set! (-> self control transv quad) (-> self control transv-history (-> self control idx-of-fastest-xz-vel) quad) ) @@ -281,7 +281,7 @@ (go target-running-attack) ) (if (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.08)) + (time-elapsed? (-> self control last-time-on-surface) (seconds 0.08)) ) (go target-falling #f) ) @@ -314,7 +314,7 @@ (set! (-> self control mod-surface) *jump-mods*) ) :exit (behavior () - (set! (-> self control unknown-time-frame13) (current-time)) + (set-time! (-> self control unknown-time-frame13)) ) :trans (behavior () (when (or (logtest? (-> self control status) (collide-status on-surface)) @@ -424,7 +424,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *slide-down-mods*) (set! (-> self control sliding-start-time) 0) (set! (-> self control force-turn-to-strength) 1.0) @@ -433,7 +433,7 @@ :exit (behavior () (target-effect-exit) (target-exit) - (set! (-> self control unknown-time-frame13) (current-time)) + (set-time! (-> self control unknown-time-frame13)) ) :trans (behavior () (if (and (or (and (logtest? (-> self control status) (collide-status on-surface)) @@ -452,7 +452,7 @@ ) (zero? (-> self control sliding-start-time)) ) - (set! (-> self control sliding-start-time) (current-time)) + (set-time! (-> self control sliding-start-time)) ) (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) @@ -492,7 +492,7 @@ (pad-buttons square) ) (can-hands? #t) - (>= (- (current-time) (-> self control last-running-attack-end-time)) (seconds 0.7)) + (time-elapsed? (-> self control last-running-attack-end-time) (seconds 0.7)) (!= (-> self state-time) (current-time)) ) (go target-running-attack) @@ -554,7 +554,7 @@ (set! arg1 (* arg1 (-> self darkjak-giant-interp))) ) (logclear! (-> self control status) (collide-status touch-ceiling-sticky)) - (set! (-> self control unknown-time-frame19) (current-time)) + (set-time! (-> self control unknown-time-frame19)) (delete-back-vel) (let* ((f0-4 arg5) (f1-2 0.0) @@ -566,7 +566,7 @@ (s3-1 (+ arg0 f0-5)) ) (let ((s2-1 (+ arg1 f0-5))) - (when (< (- (current-time) (-> self control rider-time)) (seconds 0.05)) + (when (not (time-elapsed? (-> self control rider-time) (seconds 0.05))) (let ((f0-8 (fmax 0.0 @@ -761,7 +761,7 @@ :event target-standard-event-handler :enter (behavior ((arg0 symbol)) (if (not arg0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (set! (-> self control bend-target) 1.0) (set! (-> self control mod-surface) *duck-mods*) @@ -913,7 +913,7 @@ :event target-standard-event-handler :enter (behavior ((arg0 symbol)) (if (not arg0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (set! (-> self control bend-target) 1.0) (target-collide-set! 'duck 1.0) @@ -1061,7 +1061,7 @@ (go target-launch (the-as float a0-7) (the-as symbol a1-3) a2-3 (-> self control unknown-dword10)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 70) (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) @@ -1118,9 +1118,7 @@ (* 26624.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) ) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (>= (- (current-time) (-> self control last-time-of-stuck)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -1312,7 +1310,7 @@ (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-0 (-> self control unknown-dword10)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (if (!= (-> self control mod-surface) *slide-jump-mods*) @@ -1335,9 +1333,7 @@ (if (and (cpad-pressed? (-> self control cpad number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (>= (- (current-time) (-> self control last-time-of-stuck)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -1434,7 +1430,7 @@ (if (or (= arg2 'duck) (= arg2 'launch)) (go target-duck-high-jump arg0 arg1 (the-as symbol arg2)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (sound-play "jump" :pitch 0.3) (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) @@ -1476,9 +1472,7 @@ ) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (>= (- (current-time) (-> self control last-time-of-stuck)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -1509,7 +1503,7 @@ (defstate target-duck-high-jump (target) :event target-standard-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *turn-around-mods*) (case arg2 @@ -1556,7 +1550,7 @@ :event target-jump-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self control unknown-symbol03) (the-as float arg2)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 80 :pitch -0.4) (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) @@ -1699,7 +1693,7 @@ ) ) (set! (-> self control unknown-word04) (the-as uint arg0)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (target-falling-trans @@ -1970,7 +1964,7 @@ (the-as int (-> self control attack-count)) (-> self control penetrate-using) ) - (set! (-> self gun combo-window-start) (current-time)) + (set-time! (-> self gun combo-window-start)) (let ((v0-2 (the-as object (-> self state name)))) (set! (-> self gun combo-window-state) (the-as symbol v0-2)) v0-2 @@ -2003,7 +1997,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (target-start-attack) (target-danger-set! 'spin #f) (set! (-> self control mod-surface) *attack-mods*) @@ -2026,7 +2020,7 @@ (if (zero? (-> self gun track-target-hold-time)) (quaternion-copy! (-> self control dir-targ) (-> self control unknown-quaternion04)) ) - (set! (-> self control last-attack-end-time) (current-time)) + (set-time! (-> self control last-attack-end-time)) (target-exit) ) :code (behavior () @@ -2218,8 +2212,8 @@ ) ) (when gp-1 - (set! (-> self control sliding-start-time) (current-time)) - (set! (-> self gun combo-window-start) (current-time)) + (set-time! (-> self control sliding-start-time)) + (set-time! (-> self gun combo-window-start)) (set! (-> self gun combo-window-state) (-> self state name)) (let ((v1-13 (if (type? proc process-focusable) proc @@ -2286,7 +2280,7 @@ ) (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square)) (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons square)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (combo-tracker-method-12 (-> self control unknown-combo-tracker00) *null-vector* @@ -2321,7 +2315,7 @@ (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) - (set! (-> self control last-running-attack-end-time) (current-time)) + (set-time! (-> self control last-running-attack-end-time)) (target-exit) ) :trans (behavior () @@ -2332,7 +2326,7 @@ ) ) (begin - (set! (-> self control unknown-time-frame18) (current-time)) + (set-time! (-> self control unknown-time-frame18)) (set! (-> self control bend-target) 0.0) (let ((v1-11 (new-stack-vector0)) (f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -2353,14 +2347,14 @@ #t ) (or (zero? (-> self control sliding-start-time)) - (>= (- (current-time) (-> self control sliding-start-time)) (seconds 0.04)) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) ) (!= (-> self control unknown-word04) 1) ) ) (if (and (cpad-pressed? (-> self control cpad number) x) (< 4096.0 (-> self control ctrl-xz-vel)) - (or (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (or (time-elapsed? (-> self state-time) (seconds 0.1)) (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square))) ) (not (logtest? (-> self state-flags) (state-flags prevent-jump prevent-attack))) @@ -2466,13 +2460,11 @@ (cond ((and (>= (ja-aframe-num 0) 20.0) (and (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) - (>= (- (current-time) (-> self control sliding-start-time)) (seconds 0.04)) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) ) ) (go target-falling #f) @@ -2482,12 +2474,12 @@ (set-forward-vel (the-as float f26-0)) ) ((and (nonzero? (-> self control unknown-time-frame18)) - (>= (- (current-time) (-> self control unknown-time-frame18)) (seconds 0.04)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) ) (set-forward-vel 0.0) ) ((and (not (cpad-hold? (-> self control cpad number) square)) - (>= (- (current-time) (-> self control unknown-combo-tracker00 move-start-time)) (seconds 0.05)) + (time-elapsed? (-> self control unknown-combo-tracker00 move-start-time) (seconds 0.05)) ) (if (= (-> self control ground-pat material) (pat-material ice)) (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) @@ -2605,7 +2597,7 @@ ) (suspend) (ja :num! (seek! max (* (-> self control current-surface align-speed) f28-0))) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (if (< 2 gp-2) @@ -2615,9 +2607,7 @@ ) ) (if (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) @@ -2726,7 +2716,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (target-start-attack) (target-danger-set! 'spin-air #f) @@ -2802,7 +2792,7 @@ :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) - (set! (-> self control last-attack-end-time) (current-time)) + (set-time! (-> self control last-attack-end-time)) (target-exit) ) :trans (behavior () @@ -2810,14 +2800,14 @@ (set-quaternion! (-> self control) (-> self control dir-targ)) (go target-hit-ground #f) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (seek! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length) (* 245760.0 (seconds-per-frame)) ) ) - (when (and (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.05)) (< (vector-dot (-> self control dynam gravity-normal) (-> self control last-transv)) (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) ) @@ -2901,7 +2891,7 @@ (defstate target-attack-uppercut (target) :event target-dangerous-event-handler :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (target-start-attack) (target-danger-set! 'uppercut #f) (set! (-> self control mod-surface) *uppercut-mods*) @@ -3054,14 +3044,14 @@ (if (and (= (-> self control ground-pat material) (pat-material ice)) (< 32768.0 (-> self control ctrl-xz-vel))) (set-forward-vel 32768.0) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control mod-surface) *uppercut-jump-mods*) (target-start-attack) (target-danger-set! 'uppercut #f) - (set! (-> self gun combo-window-start) (current-time)) + (set-time! (-> self gun combo-window-start)) (set! (-> self gun combo-window-state) (-> self state name)) (set! (-> self gun track-target-hold-time) 0) 0 @@ -3074,9 +3064,7 @@ (when (and (cpad-pressed? (-> self control cpad number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (>= (- (current-time) (-> self control last-time-of-stuck)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -3184,7 +3172,7 @@ ) ) ) - (set! (-> self gun surpress-time) (current-time)) + (set-time! (-> self gun surpress-time)) (go target-falling #f) ) :post target-post @@ -3236,7 +3224,7 @@ (set-forward-vel arg2) (set-forward-vel (-> self control ctrl-xz-vel)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *flop-mods*) (set! (-> self neck flex-blend) 0.0) @@ -3289,7 +3277,7 @@ (not (logtest? (-> self control status) (collide-status touch-actor))) (>= (-> self control unknown-word04) (the-as uint 2)) ) - (set! (-> self control last-time-of-stuck) (current-time)) + (set-time! (-> self control last-time-of-stuck)) (set! gp-1 'stuck) ) ) @@ -3436,7 +3424,7 @@ ) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> *TARGET-bank* fall-timeout))) + (if (and (time-elapsed? (-> self state-time) (the-as time-frame (-> *TARGET-bank* fall-timeout))) (!= (-> self tobot?) 'tobot) ) (go target-falling #f) @@ -3487,7 +3475,7 @@ ) (target-land-effect) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control unknown-word04) (the-as uint arg0)) (set-forward-vel 0.0) (set! (-> self control mod-surface) *flop-land-mods*) @@ -3517,7 +3505,7 @@ ) ) (when (and (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (< (- (current-time) (-> self state-time)) (seconds 0.25)) + (not (time-elapsed? (-> self state-time) (seconds 0.25))) ) (do-effect (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) (if (rand-vu-percent? 0.5) 22 @@ -3567,7 +3555,7 @@ ) :enter (behavior () (target-collide-set! 'duck 1.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self neck flex-blend) 0.0) (set! (-> self neck base-joint) (the-as uint 8)) (set! (-> self control mod-surface) *roll-mods*) @@ -3587,7 +3575,7 @@ :exit (behavior () (when (not (and (-> self next-state) (= (-> self next-state name) 'target-roll))) (set! (-> self control unknown-word02) 0) - (set! (-> self control last-roll-end-time) (current-time)) + (set-time! (-> self control last-roll-end-time)) ) (target-exit) (target-collide-set! 'normal 0.0) @@ -3614,14 +3602,14 @@ (if (cpad-pressed? (-> self control cpad number) x) (set! gp-0 (the-as int (current-time))) ) - (when (and (not s4-0) (>= (- (current-time) (-> self state-time)) (seconds 0.2))) + (when (and (not s4-0) (time-elapsed? (-> self state-time) (seconds 0.2))) (set! s4-0 #t) - (set! (-> self gun combo-window-start) (current-time)) + (set-time! (-> self gun combo-window-start)) (set! (-> self gun combo-window-state) (-> self state name)) ) (when (and (or (smack-surface? #f) (>= (-> self control surface-slope-z) 0.7)) - (>= (the-as uint (- (current-time) (the-as int (-> self control unknown-word04)))) (the-as uint 3)) - (>= (- (current-time) (-> self state-time)) 1) + (time-elapsed? (the-as int (-> self control unknown-word04)) (seconds 0.01)) + (time-elapsed? (-> self state-time) 1) ) (when (>= 6.0 (ja-aframe-num 0)) (if (using-gun? self) @@ -3659,7 +3647,7 @@ (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) ) ) - (if (and (or (< (- (current-time) (the-as time-frame gp-0)) (the-as time-frame (-> *TARGET-bank* roll-jump-pre-window))) + (if (and (or (not (time-elapsed? (the-as time-frame gp-0) (the-as time-frame (-> *TARGET-bank* roll-jump-pre-window)))) (cpad-pressed? (-> self control cpad number) x) ) (can-jump? 'target-roll-flip) @@ -3667,12 +3655,12 @@ (go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist)) ) ) - (set! (-> self state-hook-time) (current-time)) + (set-time! (-> self state-hook-time)) (set! (-> self state-hook) (lambda :behavior target () (cond - ((>= (- (current-time) (-> self state-hook-time)) (the-as time-frame (-> *TARGET-bank* roll-jump-post-window))) + ((time-elapsed? (-> self state-hook-time) (the-as time-frame (-> *TARGET-bank* roll-jump-post-window))) (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) ) (else @@ -3723,7 +3711,7 @@ (set! (-> self neck flex-blend) 0.0) (set! (-> self neck base-joint) (the-as uint 8)) (set! (-> self gun track-target-hold-time) 0) - (set! (-> self gun combo-window-start) (current-time)) + (set-time! (-> self gun combo-window-start)) (set! (-> self gun combo-window-state) (-> self state name)) (target-collide-set! 'duck 1.0) ) @@ -3795,9 +3783,9 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while (not (logtest? (-> self control status) (collide-status on-surface))) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.01)) + (when (time-elapsed? (-> self state-time) (seconds 0.01)) (let ((v1-50 (ja-group))) (when (not (and v1-50 (= v1-50 jakb-jump-loop-ja))) (ja-channel-push! 1 (seconds 0.1)) @@ -3831,12 +3819,12 @@ ) (target-land-effect) (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.1))) - (set! (-> self state-hook-time) (current-time)) + (set-time! (-> self state-hook-time)) (set! (-> self state-hook) (lambda :behavior target () (cond - ((>= (- (current-time) (-> self state-hook-time)) (seconds 0.1)) + ((time-elapsed? (-> self state-hook-time) (seconds 0.1)) (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) ) (else diff --git a/goal_src/jak2/engine/target/target2.gc b/goal_src/jak2/engine/target/target2.gc index b6b349447c..668819c4f0 100644 --- a/goal_src/jak2/engine/target/target2.gc +++ b/goal_src/jak2/engine/target/target2.gc @@ -19,7 +19,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('loading) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) #f ) (else @@ -30,8 +30,8 @@ :exit target-exit :code (behavior () (set! (-> self control mod-surface) *trip-mods*) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 0.05)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.05))) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! jakb-trip-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -51,7 +51,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.3)) + (until (time-elapsed? gp-0 (seconds 0.3)) (suspend) (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) (suspend) @@ -127,10 +127,10 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () - (set! (-> self ambient-time) (current-time)) + (set-time! (-> self ambient-time)) (let ((a0-0 (-> self spool-anim))) (when (and a0-0 (= (-> *setting-control* user-current spooling) (process->ppointer self))) (ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1) @@ -191,8 +191,8 @@ (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'dist-from-interp-src) - (and (or (< (send-event-function *camera* a1-0) 4915.2) (< (- (current-time) (-> self state-time)) (seconds 0.05))) - (and (< (- (current-time) (-> self state-time)) (seconds 0.07)) (zero? (ja-group-size))) + (and (or (< (send-event-function *camera* a1-0) 4915.2) (not (time-elapsed? (-> self state-time) (seconds 0.05)))) + (and (not (time-elapsed? (-> self state-time) (seconds 0.07))) (zero? (ja-group-size))) ) ) (suspend) @@ -365,7 +365,7 @@ (logior! (-> self skel effect flags) (effect-control-flag ecf2)) ) :exit (behavior () - (set! (-> self ambient-time) (current-time)) + (set-time! (-> self ambient-time)) (logclear! (-> self state-flags) (state-flags sf2)) (target-exit) ) @@ -515,7 +515,7 @@ ) :enter (behavior ((arg0 handle)) (set! (-> self control anim-handle) arg0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *pole-mods*) (logior! (-> self focus-status) (focus-status pole)) (target-collide-set! 'pole 0.0) @@ -539,7 +539,7 @@ (pad-buttons x) ) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) - (>= (- (current-time) (-> self state-time)) (seconds 0.4)) + (time-elapsed? (-> self state-time) (seconds 0.4)) ) (set! (-> self control transv quad) (the-as uint128 0)) (cond @@ -728,11 +728,11 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> *edge-grab-info* pilot-edge-grab?) #f) (set! (-> self control unknown-handle000) (the-as handle #f)) (set! (-> self control mod-surface) *edge-grab-mods*) - (set! (-> self control edge-grab-start-time) (current-time)) + (set-time! (-> self control edge-grab-start-time)) (logior! (-> self control root-prim prim-core action) (collide-action dont-push-away)) (logior! (-> self focus-status) (focus-status edge-grab)) (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) @@ -765,7 +765,7 @@ (set! (-> self control draw-offset y) 0.0) ) :trans (behavior () - (when (and (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) ) @@ -995,7 +995,7 @@ (logclear! (-> self control root-prim prim-core action) (collide-action dont-push-away)) (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) (vector-float*! (-> self control transv) (-> self control edge-grab-across-edge-dir) -40960.0) - (if (< (- (current-time) (-> self control rider-time)) (seconds 0.2)) + (if (not (time-elapsed? (-> self control rider-time) (seconds 0.2))) (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) ) (go target-falling 'target-edge-grab) @@ -1103,7 +1103,7 @@ (-> self control wall-contact-normal) (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (if (using-gun? self) @@ -1120,7 +1120,7 @@ (go target-ice-stance) ) (if (and (move-legs?) - (and (>= (- (current-time) (-> self state-time)) (seconds 1)) + (and (time-elapsed? (-> self state-time) (seconds 1)) (let ((f0-1 (vector-dot (-> self control to-target-pt-xz) (-> self control wall-contact-normal)))) (< 0.1 f0-1) ) @@ -1233,7 +1233,7 @@ (let ((s5-0 (rand-vu-int-range 30 600))) (ja :group! jakb-wall-hide-head-ja) (let ((s4-0 (current-time))) - (until (>= (- (current-time) s4-0) s5-0) + (until (time-elapsed? s4-0 s5-0) (gp-0) (suspend) ) @@ -1277,7 +1277,7 @@ (let ((s5-2 (rand-vu-int-range 60 300)) (s4-2 (current-time)) ) - (until (>= (- (current-time) s4-2) s5-2) + (until (time-elapsed? s4-2 s5-2) (gp-0) (suspend) ) @@ -1299,7 +1299,7 @@ (let ((s5-3 (rand-vu-int-range 60 300)) (s4-3 (current-time)) ) - (until (>= (- (current-time) s4-3) s5-3) + (until (time-elapsed? s4-3 s5-3) (gp-0) (suspend) ) @@ -1328,7 +1328,7 @@ ) ) :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *turn-around-mods*) (ja-channel-push! 1 (seconds 0.15)) (set-forward-vel 0.0) @@ -1352,7 +1352,7 @@ (set! sv-40 v1-2) ) (set! sv-44 #t) - (until (>= (- (current-time) sv-32) arg1) + (until (time-elapsed? sv-32 arg1) (let ((s4-0 (ppointer->process (-> self parent)))) (cond ((and sv-44 @@ -1496,7 +1496,7 @@ ) (rot->dir-targ! (-> self control)) (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) - (set! (-> self control last-time-on-surface) (current-time)) + (set-time! (-> self control last-time-on-surface)) (ja-channel-set! 0) (ja-post) (target-exit) @@ -1559,7 +1559,7 @@ ) ) :trans (behavior () - (set! (-> self control time-of-last-debug-float) (current-time)) + (set-time! (-> self control time-of-last-debug-float)) (cond ;; og:preserve-this no debug hover when paused. ((and (cpad-hold? (-> self control cpad number) r2) diff --git a/goal_src/jak2/engine/ui/bigmap.gc b/goal_src/jak2/engine/ui/bigmap.gc index 4e616d91b3..86d04e57d6 100644 --- a/goal_src/jak2/engine/ui/bigmap.gc +++ b/goal_src/jak2/engine/ui/bigmap.gc @@ -19,15 +19,15 @@ ;; The bit-mask data can be compressed, for including it in saves. -(defmethod set-pos! bigmap ((obj bigmap) (arg0 vector)) - "Set (-> obj pos) to the integer cell index for the given floating-point position." +(defmethod set-pos! bigmap ((this bigmap) (arg0 vector)) + "Set (-> this pos) to the integer cell index for the given floating-point position." (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) (.lvf vf1 (&-> arg0 quad)) - (.lvf vf2 (&-> obj offset quad)) + (.lvf vf2 (&-> this offset quad)) ;; move z to y. We want the 2D position in xy. (.add.z.vf vf1 vf0 vf1 :mask #b10) ;; apply offset @@ -36,32 +36,32 @@ (.mul.w.vf vf1 vf1 vf2) ;; convert to integer (.ftoi.vf vf1 vf1) - (.svf (&-> obj pos quad) vf1) + (.svf (&-> this pos quad) vf1) 0 ) ) -(defmethod decompress-current-masks! bigmap ((obj bigmap)) - "Decompress the layer set by (-> obj mask-index). - The decompressed result will be stored in (-> obj bit-mask data). +(defmethod decompress-current-masks! bigmap ((this bigmap)) + "Decompress the layer set by (-> this mask-index). + The decompressed result will be stored in (-> this bit-mask data). If it was never compressed, the data will be set to 0." - (let ((compressed-mask-data (-> obj compressed-masks (-> obj mask-index)))) + (let ((compressed-mask-data (-> this compressed-masks (-> this mask-index)))) ;; mark compressed data as invalid as we will remove the compressed data after decompression. - (set! (-> obj compressed-masks (-> obj mask-index)) (the-as (pointer int8) #f)) + (set! (-> this compressed-masks (-> this mask-index)) (the-as (pointer int8) #f)) ;; check if we have compressed data (cond (compressed-mask-data - ;; decompress to (-> obj bit-mask data) - (let* ((decompressed-data-end (unpack-comp-rle (the-as (pointer int8) (-> obj bit-mask data)) compressed-mask-data)) + ;; decompress to (-> this bit-mask data) + (let* ((decompressed-data-end (unpack-comp-rle (the-as (pointer int8) (-> this bit-mask data)) compressed-mask-data)) (decompressed-size (&- decompressed-data-end (the-as uint compressed-mask-data))) ) ;; we no longer need to keep this compressed data. - ;; there is a single buffer (-> obj compressed-data) that stores all compressed layers. + ;; there is a single buffer (-> this compressed-data) that stores all compressed layers. ;; when removing a layer, we need to compact the heap by shifting things in memory after this one backward. ;; determine how many bytes are in use after the compressed data we just used (let ((bytes-to-shift-back - (+ (- (the-as int compressed-mask-data)) (-> obj compressed-data) (-> obj compressed-next-index)) + (+ (- (the-as int compressed-mask-data)) (-> this compressed-data) (-> this compressed-next-index)) ) ) ;; copy backward. @@ -73,21 +73,21 @@ ) ;; update references to the compressed arrays we just moved. (dotimes (layer-idx 20) - (let ((layer-data (-> obj compressed-masks layer-idx))) + (let ((layer-data (-> this compressed-masks layer-idx))) ;; only update if past this compressed layer and was moved. (if (and layer-data (>= (the-as int layer-data) (the-as int compressed-mask-data))) ;; og:preserve-this cast - (set! (-> obj compressed-masks layer-idx) (the (pointer int8) (&- layer-data (the-as uint decompressed-size)))) + (set! (-> this compressed-masks layer-idx) (the (pointer int8) (&- layer-data (the-as uint decompressed-size)))) ) ) ) ;; update end-of-heap pointer to account for the memory we just freed. - (set! (-> obj compressed-next-index) (- (-> obj compressed-next-index) (the-as uint decompressed-size))) + (set! (-> this compressed-next-index) (- (-> this compressed-next-index) (the-as uint decompressed-size))) ) ) (else ;; there was no compressed data. Initialize masks to 0. - (let ((data (-> obj bit-mask data))) + (let ((data (-> this bit-mask data))) (dotimes (qw-idx 416) ;; og:preserve-this cast (set! (-> (the-as (pointer int128) (&+ data (* qw-idx 16)))) (the int128 0)) @@ -99,30 +99,30 @@ 0 ) -(defmethod compress-current-masks! bigmap ((obj bigmap)) - "Take the current (-> obj bit-mask data), and store it in the compressed layer buffer." +(defmethod compress-current-masks! bigmap ((this bigmap)) + "Take the current (-> this bit-mask data), and store it in the compressed layer buffer." ;; store at the end of the buffer - (let* ((compressed-data-dest (+ (-> obj compressed-next-index) 0 (-> obj compressed-data))) + (let* ((compressed-data-dest (+ (-> this compressed-next-index) 0 (-> this compressed-data))) ;; compress! (compressed-data-size (pack-comp-rle (the-as (pointer uint8) compressed-data-dest) - (-> obj bit-mask data) + (-> this bit-mask data) 6656 - (the-as int (- #x8000 (the-as int (-> obj compressed-next-index)))) + (the-as int (- #x8000 (the-as int (-> this compressed-next-index)))) ) ) ) ;; store pointer to the compressed data - (set! (-> obj compressed-masks (-> obj mask-index)) (the-as (pointer int8) compressed-data-dest)) + (set! (-> this compressed-masks (-> this mask-index)) (the-as (pointer int8) compressed-data-dest)) ;; update end of the heap - (set! (-> obj compressed-next-index) - (the-as uint (+ (-> obj compressed-next-index) (the-as uint compressed-data-size))) + (set! (-> this compressed-next-index) + (the-as uint (+ (-> this compressed-next-index) (the-as uint compressed-data-size))) ) ) ;; track max buffer use. - (set! (-> obj max-next-index) - (the-as uint (max (the-as int (-> obj max-next-index)) (the-as int (-> obj compressed-next-index)))) + (set! (-> this max-next-index) + (the-as uint (max (the-as int (-> this max-next-index)) (the-as int (-> this compressed-next-index)))) ) 0 ) @@ -183,37 +183,37 @@ ) ) -(defmethod set-enable-from-position! bigmap ((obj bigmap)) +(defmethod set-enable-from-position! bigmap ((this bigmap)) "Read the value of the layer-mask at the current position. Future calls to maybe-fill-for-position will only succeed if they correspond to a cell with the same layer-mask value as this position." ;; each byte stores 2 mask values. - (let ((v1-4 (-> obj layer-mask data (+ (* (-> obj pos y) 128) (/ (-> obj pos x) 2))))) + (let ((v1-4 (-> this layer-mask data (+ (* (-> this pos y) 128) (/ (-> this pos x) 2))))) ;; pick the low/high part of the byte. - (if (not (logtest? (-> obj pos x) 1)) - (set! (-> obj layer-mask-enable) (shr v1-4 4)) - (set! (-> obj layer-mask-enable) (logand v1-4 15)) + (if (not (logtest? (-> this pos x) 1)) + (set! (-> this layer-mask-enable) (shr v1-4 4)) + (set! (-> this layer-mask-enable) (logand v1-4 15)) ) ) 0 ) -(defmethod maybe-fill-for-position bigmap ((obj bigmap) (arg0 int) (arg1 int)) +(defmethod maybe-fill-for-position bigmap ((this bigmap) (arg0 int) (arg1 int)) "Check the layer-mask for this position. If it matches the value read from set-enable-from-position, then set the bit in the bit-mask." (local-vars (v1-3 uint)) (let* ((v1-1 (+ (* arg1 128) (/ arg0 2))) - (a3-3 (-> obj layer-mask data v1-1)) + (a3-3 (-> this layer-mask data v1-1)) ) (if (not (logtest? v1-1 1)) (set! v1-3 (shr a3-3 4)) (set! v1-3 (logand a3-3 15)) ) ) - (when (= (-> obj layer-mask-enable) v1-3) + (when (= (-> this layer-mask-enable) v1-3) (let ((v1-5 (+ (* arg1 32) (/ arg0 8))) - (a0-1 (-> obj bit-mask)) + (a0-1 (-> this bit-mask)) (a2-2 (logand arg0 7)) ) (logior! (-> a0-1 data v1-5) (ash 1 a2-2)) @@ -242,11 +242,11 @@ ) ) -(defmethod mask-image-from-bit-mask bigmap ((obj bigmap)) +(defmethod mask-image-from-bit-mask bigmap ((this bigmap)) "Modify the image-data in place to mask out parts of the map that have not been seen." - (let* ((v1-0 (the-as object (-> obj bit-mask))) + (let* ((v1-0 (the-as object (-> this bit-mask))) (a1-0 *image-mask-table*) - (a0-2 (the-as object (-> obj bigmap-image art-group))) + (a0-2 (the-as object (-> this bigmap-image art-group))) (a0-3 (the-as (pointer int64) (+ (+ #x34000 (-> (the-as (pointer uint32) a0-2) 1) 16) (the-as uint a0-2)))) ) (dotimes (a2-3 208) @@ -304,7 +304,7 @@ (pc-texture-anim-flag finish-anim-array dma-buf) ) -(defmethod texture-upload-dma bigmap ((obj bigmap) (arg0 dma-buffer) (arg1 (pointer uint32)) (arg2 int) (arg3 int) (arg4 int) (arg5 gs-psm)) +(defmethod texture-upload-dma bigmap ((this bigmap) (arg0 dma-buffer) (arg1 (pointer uint32)) (arg2 int) (arg3 int) (arg4 int) (arg5 gs-psm)) "Add a texture upload to the DMA buffer." (local-vars (sv-16 int)) (set! sv-16 arg2) @@ -319,12 +319,12 @@ (none) ) -(defmethod sprite-dma bigmap ((obj bigmap) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) +(defmethod sprite-dma bigmap ((this bigmap) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) "Generate DMA for drawing a single sprite." (let ((v1-0 (-> arg0 base))) - (set! (-> (the-as (pointer uint128) v1-0) 0) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-0) 1) (-> obj sprite-tmpl quad 1)) - (set! (-> (the-as (pointer uint128) v1-0) 2) (-> obj color quad)) + (set! (-> (the-as (pointer uint128) v1-0) 0) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-0) 1) (-> this sprite-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) v1-0) 2) (-> this color quad)) (set-vector! (the-as vector4w (&+ v1-0 48)) 0 0 0 0) (set-vector! (the-as vector4w (&+ v1-0 64)) (* arg1 16) (* arg2 16) #xfffff0 0) (set-vector! (the-as vector4w (&+ v1-0 80)) 8192 3328 0 0) @@ -334,18 +334,18 @@ (none) ) -(defmethod draw-non-city-map bigmap ((obj bigmap) (arg0 dma-buffer)) +(defmethod draw-non-city-map bigmap ((this bigmap) (arg0 dma-buffer)) "Generate DMA to draw a non-city map using the loaded bigmap image. This appears to have 3 layers." - (let ((s4-0 (the-as (pointer uint32) (-> obj bigmap-image art-group)))) + (let ((s4-0 (the-as (pointer uint32) (-> this bigmap-image art-group)))) (let ((v1-1 (-> s4-0 0)) (s3-0 (-> s4-0 1)) ) ;; og:preserve-this - ;; (texture-upload-dma obj arg0 (the-as (pointer uint32) (+ (+ v1-1 16) (the-as uint s4-0))) 0 16 16 (gs-psm ct32)) + ;; (texture-upload-dma this arg0 (the-as (pointer uint32) (+ (+ v1-1 16) (the-as uint s4-0))) 0 16 16 (gs-psm ct32)) ;; (dma-buffer-add-gs-set arg0 (texflush 1)) - ;; (texture-upload-dma obj arg0 (the-as (pointer uint32) (+ (+ s3-0 16) (the-as uint s4-0))) 8 512 208 (gs-psm mt8)) + ;; (texture-upload-dma this arg0 (the-as (pointer uint32) (+ (+ s3-0 16) (the-as uint s4-0))) 8 512 208 (gs-psm mt8)) ;; og:preserve-this added (pc-upload-map-texture arg0 (&+ s4-0 s3-0 16) (&+ s4-0 v1-1 16) 512 208 8 0) ) @@ -355,20 +355,20 @@ (tex1-1 (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) (texflush 1) ) - (sprite-dma obj arg0 (-> obj x0) (-> obj y0) (-> obj x1) (-> obj y2)) + (sprite-dma this arg0 (-> this x0) (-> this y0) (-> this x1) (-> this y2)) (let ((v1-16 (+ #x1a000 (-> s4-0 1)))) ;; og:preserve-this - ;;(texture-upload-dma obj arg0 (the-as (pointer uint32) (+ (+ v1-16 16) (the-as uint s4-0))) 8 512 208 (gs-psm mt8)) + ;;(texture-upload-dma this arg0 (the-as (pointer uint32) (+ (+ v1-16 16) (the-as uint s4-0))) 8 512 208 (gs-psm mt8)) (pc-upload-map-texture arg0 (&+ s4-0 v1-16 16) (&+ s4-0 (-> s4-0 0) 16) 512 208 8 0) ) (dma-buffer-add-gs-set arg0 (texflush 0)) - (sprite-dma obj arg0 (-> obj x0) (-> obj y2) (-> obj x1) (-> obj y1)) + (sprite-dma this arg0 (-> this x0) (-> this y2) (-> this x1) (-> this y1)) (let ((v1-25 (+ (-> s4-0 0) 1024)) (s3-1 (+ #x34000 (-> s4-0 1))) ) ;; og:preserve-this - ;; (texture-upload-dma obj arg0 (the-as (pointer uint32) (+ (+ v1-25 16) (the-as uint s4-0))) 0 16 16 (gs-psm ct32)) - ;; (texture-upload-dma obj arg0 (the-as (pointer uint32) (+ (+ s3-1 16) (the-as uint s4-0))) 8 512 208 (gs-psm mt8)) + ;; (texture-upload-dma this arg0 (the-as (pointer uint32) (+ (+ v1-25 16) (the-as uint s4-0))) 0 16 16 (gs-psm ct32)) + ;; (texture-upload-dma this arg0 (the-as (pointer uint32) (+ (+ s3-1 16) (the-as uint s4-0))) 8 512 208 (gs-psm mt8)) (pc-upload-map-texture arg0 (&+ s4-0 s3-1 16) (&+ s4-0 v1-25 16) 512 208 8 0) ) (dma-buffer-add-gs-set arg0 @@ -376,28 +376,28 @@ (tex1-1 (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) (texflush 1) ) - (sprite-dma obj arg0 (-> obj x0) (-> obj y0) (-> obj x1) (-> obj y2)) + (sprite-dma this arg0 (-> this x0) (-> this y0) (-> this x1) (-> this y2)) (let ((v1-37 (+ #x4e000 (-> s4-0 1)))) ;; og:preserve-this - ;; (texture-upload-dma obj arg0 (the-as (pointer uint32) (+ (+ v1-37 16) (the-as uint s4-0))) 8 512 208 (gs-psm mt8)) + ;; (texture-upload-dma this arg0 (the-as (pointer uint32) (+ (+ v1-37 16) (the-as uint s4-0))) 8 512 208 (gs-psm mt8)) (pc-upload-map-texture arg0 (&+ s4-0 v1-37 16) (&+ s4-0 (+ (-> s4-0 0) 1024) 16) 512 208 8 0) ) ) (dma-buffer-add-gs-set arg0 (texflush 1)) - (sprite-dma obj arg0 (-> obj x0) (-> obj y2) (-> obj x1) (-> obj y1)) + (sprite-dma this arg0 (-> this x0) (-> this y2) (-> this x1) (-> this y1)) (none) ) -(defmethod draw-city-map bigmap ((obj bigmap) (arg0 dma-buffer)) +(defmethod draw-city-map bigmap ((this bigmap) (arg0 dma-buffer)) "Generate DMA to draw the city map. This has only 2 layers, but has scrolling." - (let ((s4-0 (the-as (pointer uint32) (-> obj bigmap-image art-group)))) + (let ((s4-0 (the-as (pointer uint32) (-> this bigmap-image art-group)))) ;; og:preserve-this - ; (texture-upload-dma obj arg0 (the-as (pointer uint32) (+ (+ (-> s4-0 0) 16) (the-as uint s4-0))) 0 16 16 (gs-psm ct32)) + ; (texture-upload-dma this arg0 (the-as (pointer uint32) (+ (+ (-> s4-0 0) 16) (the-as uint s4-0))) 0 16 16 (gs-psm ct32)) ; (dma-buffer-add-gs-set arg0 (texflush 0)) - (let ((v1-10 (+ (* (the int (-> obj scroll y)) 512) (-> s4-0 1)))) + (let ((v1-10 (+ (* (the int (-> this scroll y)) 512) (-> s4-0 1)))) ;; og:preserve-this - ; (texture-upload-dma obj arg0 (the-as (pointer uint32) (+ (+ v1-10 16) (the-as int s4-0))) 8 512 208 (gs-psm mt8)) + ; (texture-upload-dma this arg0 (the-as (pointer uint32) (+ (+ v1-10 16) (the-as int s4-0))) 8 512 208 (gs-psm mt8)) (pc-upload-map-texture arg0 ;; dma (&+ s4-0 v1-10 16) ;; image data @@ -414,10 +414,10 @@ (tex1-1 (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) (texflush 1) ) - (sprite-dma obj arg0 (-> obj x0) (-> obj y0) (-> obj x1) (-> obj y2)) - (let ((v1-21 (+ (* (+ (the int (-> obj scroll y)) 208) 512) (-> s4-0 1)))) + (sprite-dma this arg0 (-> this x0) (-> this y0) (-> this x1) (-> this y2)) + (let ((v1-21 (+ (* (+ (the int (-> this scroll y)) 208) 512) (-> s4-0 1)))) ;; og:preserve-this - ;(texture-upload-dma obj arg0 (the-as (pointer uint32) (+ (+ v1-21 16) (the-as int s4-0))) 8 512 208 (gs-psm mt8)) + ;(texture-upload-dma this arg0 (the-as (pointer uint32) (+ (+ v1-21 16) (the-as int s4-0))) 8 512 208 (gs-psm mt8)) (pc-upload-map-texture arg0 ;; dma (&+ s4-0 v1-21 16) ;; image data @@ -430,11 +430,11 @@ ) ) ;(dma-buffer-add-gs-set arg0 (texflush 1)) - (sprite-dma obj arg0 (-> obj x0) (-> obj y2) (-> obj x1) (-> obj y1)) + (sprite-dma this arg0 (-> this x0) (-> this y2) (-> this x1) (-> this y1)) (none) ) -(defmethod draw-from-minimap bigmap ((obj bigmap) (arg0 dma-buffer) (arg1 connection-minimap)) +(defmethod draw-from-minimap bigmap ((this bigmap) (arg0 dma-buffer) (arg1 connection-minimap)) "Read data from a minimap connection and draw it on the bigmap." (rlet ((vf0 :class vf) (vf1 :class vf) @@ -487,20 +487,20 @@ (let ((f1-0 (-> *video-params* relative-x-scale))) (-> arg1 class) (.lvf vf1 (&-> arg1 last-world-pos quad)) - (.lvf vf2 (&-> obj draw-offset quad)) + (.lvf vf2 (&-> this draw-offset quad)) (.add.z.vf vf1 vf0 vf1 :mask #b10) (.sub.vf vf1 vf1 vf2) (.mul.w.vf vf1 vf1 vf2) (.ftoi.vf vf1 vf1) (.svf (&-> a3-0 quad) vf1) (if (logtest? (-> arg1 class flags) (minimap-flag goal)) - (set! (-> arg1 class icon-xy x) (the-as uint (mod (the int (-> obj goal-time)) 6))) + (set! (-> arg1 class icon-xy x) (the-as uint (mod (the int (-> this goal-time)) 6))) ) (if (-> *blit-displays-work* horizontal-flip-flag) (set! f1-0 (- f1-0)) ) - (set! (-> a2-1 x) (+ (the float (-> obj x0)) (* 2.0 f1-0 (the float (-> a3-0 x))))) - (set! (-> a2-1 y) (- (the float (+ (* (-> a3-0 y) 2) 1840)) (-> obj scroll y))) + (set! (-> a2-1 x) (+ (the float (-> this x0)) (* 2.0 f1-0 (the float (-> a3-0 x))))) + (set! (-> a2-1 y) (- (the float (+ (* (-> a3-0 y) 2) 1840)) (-> this scroll y))) (let ((f1-2 (* 20.0 f1-0 f0-0)) (f0-1 (* 20.0 f0-0)) ) @@ -517,8 +517,8 @@ (a3-11 (+ t2-0 312)) (t0-15 (-> arg0 base)) ) - (set! (-> (the-as (pointer uint128) t0-15) 0) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) t0-15) 1) (-> obj sprite-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) t0-15) 0) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) t0-15) 1) (-> this sprite-tmpl quad 1)) (set-vector! (the-as vector4w (&+ t0-15 32)) (the-as int (-> a1-5 r)) @@ -549,51 +549,51 @@ ) ) -(defmethod initialize bigmap ((obj bigmap)) - (set! (-> obj bigmap-index) (the-as uint 20)) - (set-pending-file (-> obj bigmap-image) (the-as string #f) 0 (process->handle *dproc*) 0.0) - (set! (-> obj compressed-next-index) (the-as uint 0)) - (set! (-> obj max-next-index) (the-as uint 0)) +(defmethod initialize bigmap ((this bigmap)) + (set! (-> this bigmap-index) (the-as uint 20)) + (set-pending-file (-> this bigmap-image) (the-as string #f) 0 (process->handle *dproc*) 0.0) + (set! (-> this compressed-next-index) (the-as uint 0)) + (set! (-> this max-next-index) (the-as uint 0)) (dotimes (v1-5 20) - (set! (-> obj compressed-masks v1-5) (the-as (pointer int8) #f)) + (set! (-> this compressed-masks v1-5) (the-as (pointer int8) #f)) ) - (set! (-> obj mask-index) (the-as uint 20)) - (set! (-> obj layer-index) (the-as uint 20)) - (set! (-> obj layer-mask-enable) (the-as uint 0)) + (set! (-> this mask-index) (the-as uint 20)) + (set! (-> this layer-index) (the-as uint 20)) + (set! (-> this layer-mask-enable) (the-as uint 0)) 0 (none) ) -(defmethod update bigmap ((obj bigmap)) +(defmethod update bigmap ((this bigmap)) (let ((v1-1 (level-get-target-inside *level*))) (if v1-1 - (set! (-> obj bigmap-index) (the-as uint (-> v1-1 info bigmap-id))) + (set! (-> this bigmap-index) (the-as uint (-> v1-1 info bigmap-id))) ) ) (cond - ((-> obj drawing-flag) + ((-> this drawing-flag) (cond ((= (-> *blit-displays-work* count-down) 1) (set-pending-file - (-> obj bigmap-image) + (-> this bigmap-image) "world-map" - (the-as int (-> obj load-index)) + (the-as int (-> this load-index)) (process->handle *dproc*) 0.0 ) - (set-pending-file (-> obj tpage) "progress-minimap" 0 (process->handle *dproc*) 0.0) - (set! (-> obj loading-flag) #t) + (set-pending-file (-> this tpage) "progress-minimap" 0 (process->handle *dproc*) 0.0) + (set! (-> this loading-flag) #t) ) (else - (update (-> obj bigmap-image)) - (update (-> obj tpage)) - (when (and (-> obj loading-flag) - (= (file-status (-> obj bigmap-image) "world-map" (the-as int (-> obj load-index))) 'active) - (= (file-status (-> obj tpage) "progress-minimap" 0) 'active) + (update (-> this bigmap-image)) + (update (-> this tpage)) + (when (and (-> this loading-flag) + (= (file-status (-> this bigmap-image) "world-map" (the-as int (-> this load-index))) 'active) + (= (file-status (-> this tpage) "progress-minimap" 0) 'active) (not (load-in-progress? *level*)) ) - (if (!= (-> obj bigmap-index) 20) - (mask-image-from-bit-mask obj) + (if (!= (-> this bigmap-index) 20) + (mask-image-from-bit-mask this) ) (let ((s5-0 (-> *level* loading-level)) (s4-0 (-> *texture-pool* allocate-func)) @@ -602,55 +602,55 @@ (set! (-> *texture-pool* allocate-func) texture-page-common-boot-allocate) (set! (-> *level* loading-level) #f) (set! (-> *texture-relocate-later* memcpy) #f) - (set! (-> obj progress-minimap) + (set! (-> this progress-minimap) (the-as texture-page - (link (-> obj tpage buf) (-> obj tpage load-file data) (-> obj tpage len) (-> obj tpage heap) 4) + (link (-> this tpage buf) (-> this tpage load-file data) (-> this tpage len) (-> this tpage heap) 4) ) ) (set! (-> *level* loading-level) s5-0) (set! (-> *texture-pool* allocate-func) s4-0) (set! (-> *texture-relocate-later* memcpy) s3-0) ) - (set! (-> obj loading-flag) #f) + (set! (-> this loading-flag) #f) ) ) ) ) - ((!= (-> obj bigmap-index) 20) - (set! (-> obj offset quad) (-> *bigmap-info-array* data (-> obj mask-index) quad)) - (when (!= (-> obj bigmap-index) (-> obj mask-index)) - (if (!= (-> obj mask-index) 20) - (compress-current-masks! obj) + ((!= (-> this bigmap-index) 20) + (set! (-> this offset quad) (-> *bigmap-info-array* data (-> this mask-index) quad)) + (when (!= (-> this bigmap-index) (-> this mask-index)) + (if (!= (-> this mask-index) 20) + (compress-current-masks! this) ) - (set! (-> obj mask-index) (-> obj bigmap-index)) - (decompress-current-masks! obj) + (set! (-> this mask-index) (-> this bigmap-index)) + (decompress-current-masks! this) ) - (when (!= (-> obj bigmap-index) (-> obj layer-index)) - (set! (-> obj layer-index) (-> obj bigmap-index)) + (when (!= (-> this bigmap-index) (-> this layer-index)) + (set! (-> this layer-index) (-> this bigmap-index)) (unpack-comp-rle - (the-as (pointer int8) (-> obj layer-mask data)) - (the-as (pointer int8) (-> obj compressed-layers data (-> obj layer-index))) + (the-as (pointer int8) (-> this layer-mask data)) + (the-as (pointer int8) (-> this compressed-layers data (-> this layer-index))) ) ) - (set-pos! obj (target-pos 0)) - (set-enable-from-position! obj) + (set-pos! this (target-pos 0)) + (set-enable-from-position! this) (cond - ((-> obj recording-flag) - (when (-> obj fill-flag) - (let ((a1-9 (-> obj pos x)) - (a2-5 (-> obj pos y)) + ((-> this recording-flag) + (when (-> this fill-flag) + (let ((a1-9 (-> this pos x)) + (a2-5 (-> this pos y)) ) (if (and (>= a1-9 0) (< a1-9 256) (>= a2-5 0) (< a2-5 208)) - (maybe-fill-for-position obj a1-9 a2-5) + (maybe-fill-for-position this a1-9 a2-5) ) ) ) ) (else - (let* ((f0-1 (* 131072.0 (-> obj offset w))) + (let* ((f0-1 (* 131072.0 (-> this offset w))) (f30-0 (* f0-1 f0-1)) - (s4-2 (the int (* 131072.0 (-> obj offset w)))) + (s4-2 (the int (* 131072.0 (-> this offset w)))) (s5-2 (- s4-2)) ) (while (>= s4-2 s5-2) @@ -659,11 +659,11 @@ (s3-1 (- s2-0)) ) (while (>= s2-0 s3-1) - (let ((a1-10 (+ (-> obj pos x) s3-1)) - (a2-6 (+ (-> obj pos y) s5-2)) + (let ((a1-10 (+ (-> this pos x) s3-1)) + (a2-6 (+ (-> this pos y) s5-2)) ) (if (and (>= a1-10 0) (< a1-10 256) (>= a2-6 0) (< a2-6 208)) - (maybe-fill-for-position obj a1-10 a2-6) + (maybe-fill-for-position this a1-10 a2-6) ) ) (+! s3-1 1) @@ -676,33 +676,33 @@ ) ) (else - (set-vector! (-> obj offset) -2621440.0 -4456448.0 16384.0 0.000030517578) + (set-vector! (-> this offset) -2621440.0 -4456448.0 16384.0 0.000030517578) ) ) 0 (none) ) -(defmethod draw bigmap ((obj bigmap) (arg0 int) (arg1 int) (arg2 int) (arg3 int)) +(defmethod draw bigmap ((this bigmap) (arg0 int) (arg1 int) (arg2 int) (arg3 int)) (local-vars (sv-96 pointer) (sv-100 texture) (sv-104 matrix) (sv-112 int)) - (when (and (= (file-status (-> obj bigmap-image) "world-map" (the-as int (-> obj load-index))) 'active) - (not (-> obj loading-flag)) + (when (and (= (file-status (-> this bigmap-image) "world-map" (the-as int (-> this load-index))) 'active) + (not (-> this loading-flag)) ) (let ((f0-0 (-> *video-params* relative-x-scale))) (cond ((-> *blit-displays-work* horizontal-flip-flag) - (set! (-> obj x0) (+ (the int (* (the float (+ arg2 -2048)) f0-0)) 2048)) - (set! (-> obj x1) (+ (the int (* (the float (+ arg0 -2048)) f0-0)) 2048)) + (set! (-> this x0) (+ (the int (* (the float (+ arg2 -2048)) f0-0)) 2048)) + (set! (-> this x1) (+ (the int (* (the float (+ arg0 -2048)) f0-0)) 2048)) ) (else - (set! (-> obj x0) (+ (the int (* (the float (+ arg0 -2048)) f0-0)) 2048)) - (set! (-> obj x1) (+ (the int (* (the float (+ arg2 -2048)) f0-0)) 2048)) + (set! (-> this x0) (+ (the int (* (the float (+ arg0 -2048)) f0-0)) 2048)) + (set! (-> this x1) (+ (the int (* (the float (+ arg2 -2048)) f0-0)) 2048)) ) ) ) - (set! (-> obj y0) arg1) - (set! (-> obj y1) arg3) - (set! (-> obj y2) (/ (+ arg1 arg3) 2)) + (set! (-> this y0) arg1) + (set! (-> this y1) arg3) + (set! (-> this y2) (/ (+ arg1 arg3) 2)) (with-dma-buffer-add-bucket ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id tex-all-map) ) @@ -711,21 +711,21 @@ (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) (clamp-1 (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) ) - (if (= (-> obj bigmap-index) 20) - (draw-city-map obj s4-1) - (draw-non-city-map obj s4-1) + (if (= (-> this bigmap-index) 20) + (draw-city-map this s4-1) + (draw-non-city-map this s4-1) ) ) (with-dma-buffer-add-bucket ((s4-2 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id tex-all-map) ) - (when (= (-> obj y0) 1840) + (when (= (-> this y0) 1840) (let ((s2-1 (-> s4-2 base)) (s3-1 (lookup-texture-by-id-fast (new 'static 'texture-id :index #x15 :page #xc93))) ) (when s3-1 - (set! (-> (the-as (pointer uint128) s2-1) 0) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s2-1) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s2-1) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s2-1) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s2-1 32)) s3-1) (&+! (-> s4-2 base) 112) ) @@ -738,12 +738,12 @@ (let ((a2-3 (the-as connection-minimap s3-2))) (when (logtest? (-> a2-3 class flags) (minimap-flag bigmap)) (cond - ((= (-> obj bigmap-index) 20) - (draw-from-minimap obj s4-2 a2-3) + ((= (-> this bigmap-index) 20) + (draw-from-minimap this s4-2 a2-3) ) (else (if (not (logtest? (-> a2-3 class flags) (minimap-flag city-only))) - (draw-from-minimap obj s4-2 a2-3) + (draw-from-minimap this s4-2 a2-3) ) ) ) @@ -764,7 +764,7 @@ (set! sv-104 (new 'stack-no-clear 'matrix)) (set! sv-112 (the int (* 56.0 f30-0))) (when sv-100 - (set-pos! obj (target-pos 0)) + (set-pos! this (target-pos 0)) (if (-> *blit-displays-work* horizontal-flip-flag) (set! f30-0 (- f30-0)) ) @@ -773,62 +773,62 @@ (set-vector! (-> (the-as matrix sv-104) vector 2) (* (-> s3-3 x) f30-0) 0.0 (-> s3-3 z) 1.0) (set-vector! (-> (the-as matrix sv-104) trans) - (+ (the float (-> obj x0)) (* 2.0 f30-0 (the float (-> obj pos x)))) + (+ (the float (-> this x0)) (* 2.0 f30-0 (the float (-> this pos x)))) 0.0 - (- (the float (+ (* (-> obj pos y) 2) 1840)) (-> obj scroll y)) + (- (the float (+ (* (-> this pos y) 2) 1840)) (-> this scroll y)) 1.0 ) - (set-vector! (-> obj corner 0) 0.0 0.0 -7.0 1.0) - (set-vector! (-> obj corner 1) 7.0 0.0 0.0 1.0) - (set-vector! (-> obj corner 2) -7.0 0.0 0.0 1.0) - (set-vector! (-> obj corner 3) 0.0 0.0 7.0 1.0) - (vector-matrix*! (the-as vector (-> obj corner)) (the-as vector (-> obj corner)) sv-104) - (vector-matrix*! (-> obj corner 1) (-> obj corner 1) sv-104) - (vector-matrix*! (-> obj corner 2) (-> obj corner 2) sv-104) - (vector-matrix*! (-> obj corner 3) (-> obj corner 3) sv-104) - (let ((v1-101 (-> obj adgif-tmpl dma-vif quad))) + (set-vector! (-> this corner 0) 0.0 0.0 -7.0 1.0) + (set-vector! (-> this corner 1) 7.0 0.0 0.0 1.0) + (set-vector! (-> this corner 2) -7.0 0.0 0.0 1.0) + (set-vector! (-> this corner 3) 0.0 0.0 7.0 1.0) + (vector-matrix*! (the-as vector (-> this corner)) (the-as vector (-> this corner)) sv-104) + (vector-matrix*! (-> this corner 1) (-> this corner 1) sv-104) + (vector-matrix*! (-> this corner 2) (-> this corner 2) sv-104) + (vector-matrix*! (-> this corner 3) (-> this corner 3) sv-104) + (let ((v1-101 (-> this adgif-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-96)) v1-101) ) - (let ((v1-102 (-> obj adgif-tmpl quad 1))) + (let ((v1-102 (-> this adgif-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-96) 1) v1-102) ) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ sv-96 32)) sv-100) - (let ((v1-104 (-> obj draw-tmpl dma-vif quad))) + (let ((v1-104 (-> this draw-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-96) 7) v1-104) ) - (let ((v1-105 (-> obj draw-tmpl quad 1))) + (let ((v1-105 (-> this draw-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-96) 8) v1-105) ) (set-vector! (the-as vector4w (&+ sv-96 144)) 0 255 255 128) (set-vector! (the-as vector4w (&+ sv-96 160)) 0 0 0 0) (set-vector! (the-as vector4w (&+ sv-96 176)) - (the int (* 16.0 (-> obj corner 0 x))) - (the int (* 16.0 (-> obj corner 0 z))) + (the int (* 16.0 (-> this corner 0 x))) + (the int (* 16.0 (-> this corner 0 z))) #xffffff 0 ) (set-vector! (the-as vector4w (&+ sv-96 192)) 256 0 0 0) (set-vector! (the-as vector4w (&+ sv-96 208)) - (the int (* 16.0 (-> obj corner 1 x))) - (the int (* 16.0 (-> obj corner 1 z))) + (the int (* 16.0 (-> this corner 1 x))) + (the int (* 16.0 (-> this corner 1 z))) #xffffff 0 ) (set-vector! (the-as vector4w (&+ sv-96 224)) 0 256 0 0) (set-vector! (the-as vector4w (&+ sv-96 240)) - (the int (* 16.0 (-> obj corner 2 x))) - (the int (* 16.0 (-> obj corner 2 z))) + (the int (* 16.0 (-> this corner 2 x))) + (the int (* 16.0 (-> this corner 2 z))) #xffffff 0 ) (set-vector! (the-as vector4w (&+ sv-96 256)) 256 256 0 0) (set-vector! (the-as vector4w (&+ sv-96 272)) - (the int (* 16.0 (-> obj corner 3 x))) - (the int (* 16.0 (-> obj corner 3 z))) + (the int (* 16.0 (-> this corner 3 x))) + (the int (* 16.0 (-> this corner 3 z))) #xffffff 0 ) @@ -837,111 +837,111 @@ ) ) ) - (+! (-> obj goal-time) (* 16.0 (seconds-per-frame))) + (+! (-> this goal-time) (* 16.0 (seconds-per-frame))) (set-dirty-mask! (-> *level* default-level) 4 #x1a400 0) ) 0 ) -(defmethod handle-cpad-inputs bigmap ((obj bigmap)) +(defmethod handle-cpad-inputs bigmap ((this bigmap)) (cond - ((= (-> obj bigmap-index) 20) + ((= (-> this bigmap-index) 20) (let* ((v1-2 (-> *cpad-list* cpads 0)) (f1-0 (analog-input (the-as int (-> v1-2 lefty)) 128.0 32.0 110.0 4.0)) ) - (set! (-> obj scroll y) (fmax 0.0 (fmin 416.0 (+ (-> obj scroll y) f1-0)))) + (set! (-> this scroll y) (fmax 0.0 (fmin 416.0 (+ (-> this scroll y) f1-0)))) ) ) (else - (set! (-> obj scroll quad) (the-as uint128 0)) + (set! (-> this scroll quad) (the-as uint128 0)) 0 ) ) 0 ) -(defmethod compress-all bigmap ((obj bigmap)) - (when (!= (-> obj mask-index) 20) - (compress-current-masks! obj) - (set! (-> obj mask-index) (the-as uint 20)) +(defmethod compress-all bigmap ((this bigmap)) + (when (!= (-> this mask-index) 20) + (compress-current-masks! this) + (set! (-> this mask-index) (the-as uint 20)) ) 0 ) -(defmethod enable-drawing bigmap ((obj bigmap)) - (set! (-> obj bigmap-index) (the-as uint (-> (level-get-target-inside *level*) info bigmap-id))) +(defmethod enable-drawing bigmap ((this bigmap)) + (set! (-> this bigmap-index) (the-as uint (-> (level-get-target-inside *level*) info bigmap-id))) (cond - ((= (-> obj bigmap-index) 20) - (set-pos! obj (target-pos 0)) - (set! (-> obj scroll y) (the float (max 0 (+ (* (-> obj pos y) 2) -208)))) - (set-vector! (-> obj draw-offset) -2621440.0 -4456448.0 16384.0 0.000030517578) + ((= (-> this bigmap-index) 20) + (set-pos! this (target-pos 0)) + (set! (-> this scroll y) (the float (max 0 (+ (* (-> this pos y) 2) -208)))) + (set-vector! (-> this draw-offset) -2621440.0 -4456448.0 16384.0 0.000030517578) (cond ((logtest? (game-feature pass-red) (-> *game-info* features)) (cond ((and (logtest? (game-feature pass-green) (-> *game-info* features)) (logtest? (game-feature pass-yellow) (-> *game-info* features)) ) - (set! (-> obj load-index) (the-as uint 24)) + (set! (-> this load-index) (the-as uint 24)) ) ((logtest? (game-feature pass-green) (-> *game-info* features)) - (set! (-> obj load-index) (the-as uint 23)) + (set! (-> this load-index) (the-as uint 23)) ) ((logtest? (game-feature pass-yellow) (-> *game-info* features)) - (set! (-> obj load-index) (the-as uint 22)) + (set! (-> this load-index) (the-as uint 22)) ) (else - (set! (-> obj load-index) (the-as uint 21)) + (set! (-> this load-index) (the-as uint 21)) ) ) ) (else - (set! (-> obj load-index) (the-as uint 20)) + (set! (-> this load-index) (the-as uint 20)) ) ) ) (else - (set! (-> obj scroll y) 0.0) - (set! (-> obj draw-offset quad) (-> *bigmap-info-array* data (-> obj bigmap-index) quad)) - (set! (-> obj load-index) (-> obj bigmap-index)) + (set! (-> this scroll y) 0.0) + (set! (-> this draw-offset quad) (-> *bigmap-info-array* data (-> this bigmap-index) quad)) + (set! (-> this load-index) (-> this bigmap-index)) ) ) - (set! (-> obj drawing-flag) #t) + (set! (-> this drawing-flag) #t) (none) ) -(defmethod disable-drawing bigmap ((obj bigmap)) +(defmethod disable-drawing bigmap ((this bigmap)) (set-pending-file - (-> obj bigmap-image) + (-> this bigmap-image) (the-as string #f) - (the-as int (-> obj bigmap-index)) + (the-as int (-> this bigmap-index)) (process->handle *dproc*) 0.0 ) - (set-pending-file (-> obj tpage) (the-as string #f) 0 (process->handle *dproc*) 0.0) + (set-pending-file (-> this tpage) (the-as string #f) 0 (process->handle *dproc*) 0.0) (let ((v1-8 #f)) (while (not v1-8) - (update (-> obj bigmap-image)) - (update (-> obj tpage)) - (set! v1-8 (and (= (-> obj bigmap-image status) 'inactive) (= (-> obj tpage status) 'inactive))) + (update (-> this bigmap-image)) + (update (-> this tpage)) + (set! v1-8 (and (= (-> this bigmap-image status) 'inactive) (= (-> this tpage status) 'inactive))) ) ) - (when (-> obj progress-minimap) - (unload-page *texture-pool* (-> obj progress-minimap)) + (when (-> this progress-minimap) + (unload-page *texture-pool* (-> this progress-minimap)) (set! (-> *level* default-level texture-page 3) (the-as texture-page 0)) - (set! (-> obj progress-minimap) #f) + (set! (-> this progress-minimap) #f) ) - (set! (-> obj drawing-flag) #f) - (set! (-> obj loading-flag) #f) + (set! (-> this drawing-flag) #f) + (set! (-> this loading-flag) #f) 0 ) (define *map-save-ptr* (the-as (pointer uint64) #f)) -(defmethod dump-to-file bigmap ((obj bigmap)) +(defmethod dump-to-file bigmap ((this bigmap)) (if (not *map-save-ptr*) (set! *map-save-ptr* (the-as (pointer uint64) (malloc 'debug #xd0000))) ) - (let ((v1-3 (the-as (pointer uint8) (-> obj bit-mask))) + (let ((v1-3 (the-as (pointer uint8) (-> this bit-mask))) (a0-2 *map-save-ptr*) ) (dotimes (a1-1 208) diff --git a/goal_src/jak2/engine/ui/hud-classes.gc b/goal_src/jak2/engine/ui/hud-classes.gc index 5c0d0aece5..52b53dd014 100644 --- a/goal_src/jak2/engine/ui/hud-classes.gc +++ b/goal_src/jak2/engine/ui/hud-classes.gc @@ -7,40 +7,40 @@ ;; DECOMP BEGINS -(defmethod draw hud-map ((obj hud-map)) +(defmethod draw hud-map ((this hud-map)) (set-hud-piece-position! - (-> obj sprites 1) - (the int (+ 492.0 (* 140.0 (-> obj offset)))) - (the int (+ 281.0 (* 140.0 (-> obj offset)))) + (-> this sprites 1) + (the int (+ 492.0 (* 140.0 (-> this offset)))) + (the int (+ 281.0 (* 140.0 (-> this offset)))) ) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) 11 -11) - (set! (-> obj sprites 0 color w) - (the int (+ 70.0 (* 70.0 (sin (* 182.04445 (the float (-> obj values 1 current))))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) 11 -11) + (set! (-> this sprites 0 color w) + (the int (+ 70.0 (* 70.0 (sin (* 182.04445 (the float (-> this values 1 current))))))) ) (set! (-> *minimap* color y) - (the int (- 96.0 (* 32.0 (sin (* 182.04445 (the float (-> obj values 1 current))))))) + (the int (- 96.0 (* 32.0 (sin (* 182.04445 (the float (-> this values 1 current))))))) ) (set! (-> *minimap* color z) - (the int (- 96.0 (* 32.0 (sin (* 182.04445 (the float (-> obj values 1 current))))))) + (the int (- 96.0 (* 32.0 (sin (* 182.04445 (the float (-> this values 1 current))))))) ) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) (when (>= (-> *setting-control* user-current race-minimap) 0) - (set! (-> obj sprites 0 scale-x) 0.0) - (set! (-> obj sprites 0 scale-y) 0.0) - (set! (-> obj sprites 1 scale-x) 0.0) - (set! (-> obj sprites 1 scale-y) 0.0) + (set! (-> this sprites 0 scale-x) 0.0) + (set! (-> this sprites 0 scale-y) 0.0) + (set! (-> this sprites 1 scale-x) 0.0) + (set! (-> this sprites 1 scale-y) 0.0) ) (let ((t9-5 (method-of-type hud draw))) - (t9-5 obj) + (t9-5 this) ) (cond ((< (-> *setting-control* user-current race-minimap) 0) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 2 -3) - (draw-1 *minimap* s4-0 (the-as vector4w (-> obj sprites 2)) #t) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 2 -3) + (draw-1 *minimap* s4-0 (the-as vector4w (-> this sprites 2)) #t) ) ) ((zero? (-> *setting-control* user-current race-minimap)) @@ -56,8 +56,8 @@ (with-dma-buffer-add-bucket ((s4-2 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 10 -15) - (draw-sprite2 *minimap* s4-2 (the-as vector4w (-> obj sprites 2)) #t) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 10 -15) + (draw-sprite2 *minimap* s4-2 (the-as vector4w (-> this sprites 2)) #t) ) ) ) @@ -75,8 +75,8 @@ (with-dma-buffer-add-bucket ((s4-4 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 20 -8) - (draw-sprite2 *minimap* s4-4 (the-as vector4w (-> obj sprites 2)) #t) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 20 -8) + (draw-sprite2 *minimap* s4-4 (the-as vector4w (-> this sprites 2)) #t) ) ) ) @@ -94,8 +94,8 @@ (with-dma-buffer-add-bucket ((s4-6 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 10 -8) - (draw-sprite2 *minimap* s4-6 (the-as vector4w (-> obj sprites 2)) #t) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 10 -8) + (draw-sprite2 *minimap* s4-6 (the-as vector4w (-> this sprites 2)) #t) ) ) ) @@ -108,25 +108,25 @@ (none) ) -(defmethod update-values hud-map ((obj hud-map)) +(defmethod update-values hud-map ((this hud-map)) (cond ((update! *minimap*) - (logior! (-> obj flags) (hud-flags show)) + (logior! (-> this flags) (hud-flags show)) (let ((t9-1 (method-of-type hud update-values))) - (t9-1 obj) + (t9-1 this) ) ) (else - (send-event obj 'force-hide) + (send-event this 'force-hide) ) ) (when (not (paused?)) (let ((v1-10 8)) - (if (and (< (-> obj values 1 target) 270) (< 270 (+ (-> obj values 1 target) v1-10))) - (set! (-> obj values 1 target) 270) + (if (and (< (-> this values 1 target) 270) (< 270 (+ (-> this values 1 target) v1-10))) + (set! (-> this values 1 target) 270) ) - (if (or (-> *game-info* wanted-flash) (!= (-> obj values 1 target) 270)) - (set! (-> obj values 1 target) (mod (+ (-> obj values 1 target) v1-10) 360)) + (if (or (-> *game-info* wanted-flash) (!= (-> this values 1 target) 270)) + (set! (-> this values 1 target) (mod (+ (-> this values 1 target) v1-10) 360)) ) ) ) @@ -134,217 +134,217 @@ (none) ) -(defmethod init-callback hud-map ((obj hud-map)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-map ((this hud-map)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 pos z) #xffff00) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x67a))) - (set! (-> obj sprites 1 scale-x) 0.85) - (set! (-> obj sprites 1 scale-y) 0.85) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 1 pos z) #xffff00) - (set! (-> obj values 0 current) 0) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 pos z) #xffff00) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x67a))) + (set! (-> this sprites 1 scale-x) 0.85) + (set! (-> this sprites 1 scale-y) 0.85) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 1 pos z) #xffff00) + (set! (-> this values 0 current) 0) (update! *minimap*) 0 (none) ) -(defmethod draw hud-health ((obj hud-health)) +(defmethod draw hud-health ((this hud-health)) (set-hud-piece-position! - (-> obj sprites 8) - (the int (+ (* -130.0 (-> obj offset)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) - 20.0 - 30.0 - ) + (-> this sprites 8) + (the int (+ (* -130.0 (-> this offset)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 20.0 + 30.0 + ) ) ) - (the int (+ 306.0 (* 130.0 (-> obj offset)))) + (the int (+ 306.0 (* 130.0 (-> this offset)))) ) - (set-as-offset-from! (-> obj sprites 9) (the-as vector4w (-> obj sprites 8)) 40 0) - (set-as-offset-from! (-> obj sprites 10) (the-as vector4w (-> obj sprites 8)) 0 40) - (set-as-offset-from! (-> obj sprites 11) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 12) (the-as vector4w (-> obj sprites 8)) 2 32) - (set-as-offset-from! (-> obj sprites 13) (the-as vector4w (-> obj sprites 8)) 7 60) - (set-as-offset-from! (-> obj sprites 14) (the-as vector4w (-> obj sprites 8)) 40 60) - (set-as-offset-from! (-> obj sprites 15) (the-as vector4w (-> obj sprites 8)) 63 32) - (set-as-offset-from! (-> obj sprites 16) (the-as vector4w (-> obj sprites 8)) 63 16) - (set-as-offset-from! (-> obj sprites 17) (the-as vector4w (-> obj sprites 8)) 41 4) - (set-as-offset-from! (-> obj sprites 18) (the-as vector4w (-> obj sprites 8)) 6 4) - (set-as-offset-from! (-> obj sprites 19) (the-as vector4w (-> obj sprites 8)) 2 17) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 7) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 21) (the-as vector4w (-> obj sprites 8)) 25 25) + (set-as-offset-from! (-> this sprites 9) (the-as vector4w (-> this sprites 8)) 40 0) + (set-as-offset-from! (-> this sprites 10) (the-as vector4w (-> this sprites 8)) 0 40) + (set-as-offset-from! (-> this sprites 11) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 12) (the-as vector4w (-> this sprites 8)) 2 32) + (set-as-offset-from! (-> this sprites 13) (the-as vector4w (-> this sprites 8)) 7 60) + (set-as-offset-from! (-> this sprites 14) (the-as vector4w (-> this sprites 8)) 40 60) + (set-as-offset-from! (-> this sprites 15) (the-as vector4w (-> this sprites 8)) 63 32) + (set-as-offset-from! (-> this sprites 16) (the-as vector4w (-> this sprites 8)) 63 16) + (set-as-offset-from! (-> this sprites 17) (the-as vector4w (-> this sprites 8)) 41 4) + (set-as-offset-from! (-> this sprites 18) (the-as vector4w (-> this sprites 8)) 6 4) + (set-as-offset-from! (-> this sprites 19) (the-as vector4w (-> this sprites 8)) 2 17) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 7) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 21) (the-as vector4w (-> this sprites 8)) 25 25) (let ((v1-12 (+ (the int (* 127.0 (sin (* 182.04445 (the float (* (-> *display* game-clock frame-counter) 2)))))) 127) ) ) - (set! (-> obj sprites 1 color x) v1-12) - (set! (-> obj sprites 1 color y) v1-12) - (set! (-> obj sprites 1 color z) v1-12) + (set! (-> this sprites 1 color x) v1-12) + (set! (-> this sprites 1 color y) v1-12) + (set! (-> this sprites 1 color z) v1-12) ) - (set! (-> obj sprites 3 color x) (-> obj sprites 1 color x)) - (set! (-> obj sprites 5 color x) (-> obj sprites 1 color x)) - (set! (-> obj sprites 7 color x) (-> obj sprites 1 color x)) - (set! (-> obj sprites 3 color y) (-> obj sprites 1 color y)) - (set! (-> obj sprites 5 color y) (-> obj sprites 1 color y)) - (set! (-> obj sprites 7 color y) (-> obj sprites 1 color y)) - (set! (-> obj sprites 3 color z) (-> obj sprites 1 color z)) - (set! (-> obj sprites 5 color z) (-> obj sprites 1 color z)) - (set! (-> obj sprites 7 color z) (-> obj sprites 1 color z)) - (let ((f30-1 (the float (-> obj values 2 current)))) + (set! (-> this sprites 3 color x) (-> this sprites 1 color x)) + (set! (-> this sprites 5 color x) (-> this sprites 1 color x)) + (set! (-> this sprites 7 color x) (-> this sprites 1 color x)) + (set! (-> this sprites 3 color y) (-> this sprites 1 color y)) + (set! (-> this sprites 5 color y) (-> this sprites 1 color y)) + (set! (-> this sprites 7 color y) (-> this sprites 1 color y)) + (set! (-> this sprites 3 color z) (-> this sprites 1 color z)) + (set! (-> this sprites 5 color z) (-> this sprites 1 color z)) + (set! (-> this sprites 7 color z) (-> this sprites 1 color z)) + (let ((f30-1 (the float (-> this values 2 current)))) (if (= f30-1 100.0) - (set! (-> obj sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1f :page #x67a))) - (set! (-> obj sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #x67a))) + (set! (-> this sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1f :page #x67a))) + (set! (-> this sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #x67a))) ) (cond ((< 75.0 f30-1) - (set! (-> obj sprites 0 angle) (* 182.04445 (- 180.0 (* 3.6 (+ -75.0 f30-1))))) - (set! (-> obj sprites 2 angle) 32768.0) - (set! (-> obj sprites 4 angle) 49152.0) - (set! (-> obj sprites 6 angle) 0.0) + (set! (-> this sprites 0 angle) (* 182.04445 (- 180.0 (* 3.6 (+ -75.0 f30-1))))) + (set! (-> this sprites 2 angle) 32768.0) + (set! (-> this sprites 4 angle) 49152.0) + (set! (-> this sprites 6 angle) 0.0) ) ((< 50.0 f30-1) - (set! (-> obj sprites 0 angle) 32768.0) - (set! (-> obj sprites 2 angle) (* 182.04445 (- 270.0 (* 3.6 (+ -50.0 f30-1))))) - (set! (-> obj sprites 4 angle) 49152.0) - (set! (-> obj sprites 6 angle) 0.0) + (set! (-> this sprites 0 angle) 32768.0) + (set! (-> this sprites 2 angle) (* 182.04445 (- 270.0 (* 3.6 (+ -50.0 f30-1))))) + (set! (-> this sprites 4 angle) 49152.0) + (set! (-> this sprites 6 angle) 0.0) ) ((< 25.0 f30-1) - (set! (-> obj sprites 0 angle) 32768.0) - (set! (-> obj sprites 2 angle) 49152.0) - (set! (-> obj sprites 4 angle) (* 182.04445 (- (* 3.6 (+ -25.0 f30-1))))) - (set! (-> obj sprites 6 angle) 0.0) + (set! (-> this sprites 0 angle) 32768.0) + (set! (-> this sprites 2 angle) 49152.0) + (set! (-> this sprites 4 angle) (* 182.04445 (- (* 3.6 (+ -25.0 f30-1))))) + (set! (-> this sprites 6 angle) 0.0) ) (else - (set! (-> obj sprites 0 angle) 32768.0) - (set! (-> obj sprites 2 angle) 49152.0) - (set! (-> obj sprites 4 angle) 0.0) - (set! (-> obj sprites 6 angle) (* 182.04445 (- 90.0 (* 3.6 f30-1)))) + (set! (-> this sprites 0 angle) 32768.0) + (set! (-> this sprites 2 angle) 49152.0) + (set! (-> this sprites 4 angle) 0.0) + (set! (-> this sprites 6 angle) (* 182.04445 (- 90.0 (* 3.6 f30-1)))) ) ) ) - (let ((v1-55 (-> obj values 0 current)) + (let ((v1-55 (-> this values 0 current)) (a0-25 12) ) (while (< a0-25 20) - (set! (-> obj sprites a0-25 scale-x) (if (> v1-55 0) - 1.0 - 0.0 - ) + (set! (-> this sprites a0-25 scale-x) (if (> v1-55 0) + 1.0 + 0.0 + ) ) (+! a0-25 1) (+! v1-55 -10) ) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-health ((obj hud-health)) - (set! (-> obj values 0 target) (the int (* 10.0 (-> *target* fact health)))) - (set! (-> obj values 1 target) (the-as int (-> *target* fact health-pickup-time))) - (set! (-> obj values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) - (set! (-> obj values 3 target) (the-as int (-> *target* fact eco-pill-dark-pickup-time))) - (if (and (zero? (-> obj values 2 target)) (!= (-> *target* game eco-pill-dark) 0.0)) - (set! (-> obj values 2 target) 100) +(defmethod update-values hud-health ((this hud-health)) + (set! (-> this values 0 target) (the int (* 10.0 (-> *target* fact health)))) + (set! (-> this values 1 target) (the-as int (-> *target* fact health-pickup-time))) + (set! (-> this values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) + (set! (-> this values 3 target) (the-as int (-> *target* fact eco-pill-dark-pickup-time))) + (if (and (zero? (-> this values 2 target)) (!= (-> *target* game eco-pill-dark) 0.0)) + (set! (-> this values 2 target) 100) ) - ((method-of-type hud update-values) obj) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-health ((obj hud-health)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-left-1) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-health ((this hud-health)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left-1) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 pos z) #xfffff1) - (set! (-> obj sprites 0 scale-x) 8.0) - (set! (-> obj sprites 0 scale-y) 8.0) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) - (set! (-> obj sprites 1 angle) 32768.0) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 2 pos z) #xfffff3) - (set! (-> obj sprites 2 scale-x) 8.0) - (set! (-> obj sprites 2 scale-y) 8.0) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) - (set! (-> obj sprites 3 angle) 49152.0) - (set! (-> obj sprites 3 pos z) #xfffff2) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 4 pos z) #xfffff5) - (set! (-> obj sprites 4 scale-x) 8.0) - (set! (-> obj sprites 4 scale-y) 8.0) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) - (set! (-> obj sprites 5 angle) 0.0) - (set! (-> obj sprites 5 pos z) #xfffff4) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 6 pos z) #xfffff7) - (set! (-> obj sprites 6 scale-x) 8.0) - (set! (-> obj sprites 6 scale-y) 8.0) - (set! (-> obj sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) - (set! (-> obj sprites 7 angle) 16384.0) - (set! (-> obj sprites 7 pos z) #xfffff6) - (set! (-> obj sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x67a))) - (set! (-> obj sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x67a))) - (set! (-> obj sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x67a))) - (set! (-> obj sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #x67a))) - (set! (-> obj sprites 12 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) - (set! (-> obj sprites 12 flags) (the-as uint 3)) - (set! (-> obj sprites 12 scale-x) 0.9) - (set! (-> obj sprites 12 scale-y) 1.0) - (set! (-> obj sprites 13 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) - (set! (-> obj sprites 13 flags) (the-as uint 3)) - (set! (-> obj sprites 13 scale-x) 0.9) - (set! (-> obj sprites 13 scale-y) 1.0) - (set! (-> obj sprites 14 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) - (set! (-> obj sprites 14 flags) (the-as uint 2)) - (set! (-> obj sprites 14 scale-x) 0.9) - (set! (-> obj sprites 14 scale-y) 1.0) - (set! (-> obj sprites 15 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) - (set! (-> obj sprites 15 flags) (the-as uint 2)) - (set! (-> obj sprites 15 scale-x) 0.9) - (set! (-> obj sprites 15 scale-y) 1.0) - (set! (-> obj sprites 16 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) - (set! (-> obj sprites 16 scale-x) 0.9) - (set! (-> obj sprites 16 scale-y) 1.0) - (set! (-> obj sprites 17 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) - (set! (-> obj sprites 17 scale-x) 0.9) - (set! (-> obj sprites 17 scale-y) 1.0) - (set! (-> obj sprites 18 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) - (set! (-> obj sprites 18 flags) (the-as uint 1)) - (set! (-> obj sprites 18 scale-x) 0.9) - (set! (-> obj sprites 18 scale-y) 1.0) - (set! (-> obj sprites 19 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) - (set! (-> obj sprites 19 flags) (the-as uint 1)) - (set! (-> obj sprites 19 scale-x) 0.9) - (set! (-> obj sprites 19 scale-y) 1.0) - (set! (-> obj sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #x67a))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 pos z) #xfffff1) + (set! (-> this sprites 0 scale-x) 8.0) + (set! (-> this sprites 0 scale-y) 8.0) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> this sprites 1 angle) 32768.0) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 2 pos z) #xfffff3) + (set! (-> this sprites 2 scale-x) 8.0) + (set! (-> this sprites 2 scale-y) 8.0) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> this sprites 3 angle) 49152.0) + (set! (-> this sprites 3 pos z) #xfffff2) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 4 pos z) #xfffff5) + (set! (-> this sprites 4 scale-x) 8.0) + (set! (-> this sprites 4 scale-y) 8.0) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> this sprites 5 angle) 0.0) + (set! (-> this sprites 5 pos z) #xfffff4) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 6 pos z) #xfffff7) + (set! (-> this sprites 6 scale-x) 8.0) + (set! (-> this sprites 6 scale-y) 8.0) + (set! (-> this sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> this sprites 7 angle) 16384.0) + (set! (-> this sprites 7 pos z) #xfffff6) + (set! (-> this sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x67a))) + (set! (-> this sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x67a))) + (set! (-> this sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x67a))) + (set! (-> this sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #x67a))) + (set! (-> this sprites 12 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> this sprites 12 flags) (the-as uint 3)) + (set! (-> this sprites 12 scale-x) 0.9) + (set! (-> this sprites 12 scale-y) 1.0) + (set! (-> this sprites 13 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> this sprites 13 flags) (the-as uint 3)) + (set! (-> this sprites 13 scale-x) 0.9) + (set! (-> this sprites 13 scale-y) 1.0) + (set! (-> this sprites 14 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> this sprites 14 flags) (the-as uint 2)) + (set! (-> this sprites 14 scale-x) 0.9) + (set! (-> this sprites 14 scale-y) 1.0) + (set! (-> this sprites 15 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> this sprites 15 flags) (the-as uint 2)) + (set! (-> this sprites 15 scale-x) 0.9) + (set! (-> this sprites 15 scale-y) 1.0) + (set! (-> this sprites 16 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> this sprites 16 scale-x) 0.9) + (set! (-> this sprites 16 scale-y) 1.0) + (set! (-> this sprites 17 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> this sprites 17 scale-x) 0.9) + (set! (-> this sprites 17 scale-y) 1.0) + (set! (-> this sprites 18 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> this sprites 18 flags) (the-as uint 1)) + (set! (-> this sprites 18 scale-x) 0.9) + (set! (-> this sprites 18 scale-y) 1.0) + (set! (-> this sprites 19 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> this sprites 19 flags) (the-as uint 1)) + (set! (-> this sprites 19 scale-x) 0.9) + (set! (-> this sprites 19 scale-y) 1.0) + (set! (-> this sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #x67a))) 0 (none) ) -(defmethod draw hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) +(defmethod draw hud-dark-eco-symbol ((this hud-dark-eco-symbol)) (let ((v1-0 (process-by-name "hud-health" *active-pool*)) - (f30-0 (-> obj offset)) + (f30-0 (-> this offset)) ) (if (and v1-0 (< (-> (the-as hud-health v1-0) offset) f30-0)) (set! f30-0 (-> (the-as hud-health v1-0) offset)) ) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) (the int (+ 13.0 (* -130.0 f30-0))) (the int (+ 25.0 (* -130.0 f30-0))) @@ -352,195 +352,199 @@ (the int (+ 299.0 (* 130.0 f30-0))) ) (cond - ((or (= (-> obj values 2 target) 100) (= (-> *target* game eco-pill-dark) 100.0)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x11 :page #x67a))) + ((or (= (-> this values 2 target) 100) (= (-> *target* game eco-pill-dark) 100.0)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x11 :page #x67a))) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) (the int (+ 13.0 (* -130.0 f30-0))) (the int (+ 25.0 (* -130.0 f30-0))) ) (the int (+ 299.0 (* 130.0 f30-0))) ) - (set! (-> obj sprites 0 scale-x) 1.5) - (set! (-> obj sprites 0 scale-y) 1.5) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this sprites 0 scale-y) 1.5) (let ((v1-31 (+ (the int (* 15.0 (sin (* 182.04445 (the float (* (-> *display* game-clock frame-counter) 4)))))) 160) ) ) - (set! (-> obj sprites 0 color x) v1-31) - (set! (-> obj sprites 0 color y) v1-31) - (set! (-> obj sprites 0 color z) v1-31) + (set! (-> this sprites 0 color x) v1-31) + (set! (-> this sprites 0 color y) v1-31) + (set! (-> this sprites 0 color z) v1-31) ) ) (else - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #x67a))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #x67a))) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) (the int (+ 29.0 (* -130.0 f30-0))) (the int (+ 36.0 (* -130.0 f30-0))) ) (the int (+ 315.0 (* 130.0 f30-0))) ) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (set! (-> obj sprites 0 color x) 128) - (set! (-> obj sprites 0 color y) 128) - (set! (-> obj sprites 0 color z) 128) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 color x) 128) + (set! (-> this sprites 0 color y) 128) + (set! (-> this sprites 0 color z) 128) ) ) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) - (set! (-> obj values 0 target) (the int (* 10.0 (-> *target* fact health)))) - (set! (-> obj values 1 target) (the-as int (-> *target* fact health-pickup-time))) - (set! (-> obj values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) - (set! (-> obj values 3 target) (the-as int (-> *target* fact eco-pill-dark-pickup-time))) - (if (and (or (and (zero? (-> obj values 2 target)) (!= (-> *target* game eco-pill-dark) 0.0)) +(defmethod update-values hud-dark-eco-symbol ((this hud-dark-eco-symbol)) + (set! (-> this values 0 target) (the int (* 10.0 (-> *target* fact health)))) + (set! (-> this values 1 target) (the-as int (-> *target* fact health-pickup-time))) + (set! (-> this values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) + (set! (-> this values 3 target) (the-as int (-> *target* fact eco-pill-dark-pickup-time))) + (if (and (or (and (zero? (-> this values 2 target)) (!= (-> *target* game eco-pill-dark) 0.0)) (focus-test? *target* dark) ) (and (not (focus-test? *target* indax)) (-> *setting-control* user-current darkjak)) ) - (set! (-> obj values 2 target) 100) + (set! (-> this values 2 target) 100) ) - (if (= (-> obj values 2 target) 100) - (+! (-> obj values 4 target) 1) + (if (= (-> this values 2 target) 100) + (+! (-> this values 4 target) 1) ) - ((method-of-type hud update-values) obj) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-left-2) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-dark-eco-symbol ((this hud-dark-eco-symbol)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left-2) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.5) - (set! (-> obj sprites 0 scale-y) 1.5) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this sprites 0 scale-y) 1.5) 0 (none) ) (define *hud-skullgem* (the-as (pointer hud-skullgem) #f)) -(defmethod draw hud-skullgem ((obj hud-skullgem)) +(defmethod draw hud-skullgem ((this hud-skullgem)) (set-hud-piece-position! - (the-as hud-sprite (-> obj icons 0 pos)) - (the int (+ 60.0 (* -130.0 (-> obj offset)))) + (the-as hud-sprite (-> this icons 0 pos)) + (the int (+ 60.0 (* -130.0 (-> this offset)))) 150 ) (set-as-offset-from! - (the-as hud-sprite (-> obj sprites)) - (the-as vector4w (-> obj icons 0 pos)) + (the-as hud-sprite (-> this sprites)) + (the-as vector4w (-> this icons 0 pos)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) -27 -35 ) 20 ) - (set! (-> obj sprites 0 scale-x) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) - 0.86 - 1.1 - ) + (set! (-> this sprites 0 scale-x) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 0.86 + 1.1 + ) ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj icons 0 pos)) 0 45) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this icons 0 pos)) 0 45) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-skullgem ((obj hud-skullgem)) - (set! (-> obj values 0 target) (the int (-> *target* game gem))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-skullgem ((this hud-skullgem)) + (set! (-> this values 0 target) (the int (-> *target* game gem))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-skullgem ((obj hud-skullgem)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-center-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-skullgem ((this hud-skullgem)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (hud-create-icon obj 0 (the-as int (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f)))) - (set! (-> obj icons 0 scale-x) 0.025) - (set! (-> obj icons 0 scale-y) 0.035) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 0.86) - (set! (-> obj sprites 0 scale-y) 1.05) - (set! (-> obj sprites 0 pos z) #xfff9ff) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 scale) 0.5) + (hud-create-icon this 0 (the-as int (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f)))) + (set! (-> this icons 0 scale-x) 0.025) + (set! (-> this icons 0 scale-y) 0.035) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x67a))) + (set! (-> this sprites 0 scale-x) 0.86) + (set! (-> this sprites 0 scale-y) 1.05) + (set! (-> this sprites 0 pos z) #xfff9ff) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 scale) 0.5) 0 (none) ) -(defmethod draw hud-skill ((obj hud-skill)) +(defmethod draw hud-skill ((this hud-skill)) (set-hud-piece-position! - (the-as hud-sprite (-> obj icons 0 pos)) - (the int (+ 60.0 (* -130.0 (-> obj offset)))) + (the-as hud-sprite (-> this icons 0 pos)) + (the int (+ 60.0 (* -130.0 (-> this offset)))) 270 ) (set-as-offset-from! - (the-as hud-sprite (-> obj sprites)) - (the-as vector4w (-> obj icons 0 pos)) + (the-as hud-sprite (-> this sprites)) + (the-as vector4w (-> this icons 0 pos)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) -19 -25 ) -39 ) - (set! (-> obj sprites 0 scale-x) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) - 0.62 - 0.77 - ) + (set! (-> this sprites 0 scale-x) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 0.62 + 0.77 + ) ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj icons 0 pos)) 0 -5) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this icons 0 pos)) 0 -5) (when (not (paused?)) (let ((s5-1 (new 'stack-no-clear 'quaternion))) (quaternion-axis-angle! s5-1 0.0 1.0 0.0 364.0889) - (quaternion*! (-> obj icons 0 icon 0 root quat) s5-1 (-> obj icons 0 icon 0 root quat)) + (quaternion*! (-> this icons 0 icon 0 root quat) s5-1 (-> this icons 0 icon 0 root quat)) ) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-skill ((obj hud-skill)) - (set! (-> obj values 0 target) (the int (-> *target* game skill))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-skill ((this hud-skill)) + (set! (-> this values 0 target) (the int (-> *target* game skill))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-skill ((obj hud-skill)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-skill ((this hud-skill)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (hud-create-icon obj 0 (the-as int (art-group-get-by-name *level* "skel-skill" (the-as (pointer uint32) #f)))) - (set! (-> obj icons 0 scale-x) 0.009) - (set! (-> obj icons 0 scale-y) -0.018) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 0.62) - (set! (-> obj sprites 0 scale-y) 1.34) - (set! (-> obj sprites 0 pos z) #xfff9ff) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 scale) 0.5) - (logior! (-> obj values 0 flags) 1) + (hud-create-icon + this + 0 + (the-as int (art-group-get-by-name *level* "skel-skill" (the-as (pointer uint32) #f))) + ) + (set! (-> this icons 0 scale-x) 0.009) + (set! (-> this icons 0 scale-y) -0.018) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x67a))) + (set! (-> this sprites 0 scale-x) 0.62) + (set! (-> this sprites 0 scale-y) 1.34) + (set! (-> this sprites 0 pos z) #xfff9ff) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 scale) 0.5) + (logior! (-> this values 0 flags) 1) 0 (none) ) -(defmethod update-value-callback hud-skill ((obj hud-skill) (arg0 int) (arg1 int)) +(defmethod update-value-callback hud-skill ((this hud-skill) (arg0 int) (arg1 int)) (if (> arg1 0) (sound-play "skill-pickup" :pitch 0.5) ) @@ -548,189 +552,194 @@ (none) ) -(defmethod draw hud-score ((obj hud-score)) +(defmethod draw hud-score ((this hud-score)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 480.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 480.0 (* 130.0 (-> this offset)))) 140 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -12 8) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -12 8) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-score ((obj hud-score)) - (set! (-> obj values 0 target) (the int (-> *game-info* score))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-score ((this hud-score)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-score ((obj hud-score)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-center-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-score ((this hud-score)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.5) - (set! (-> obj strings 0 scale) 0.5) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning right large)) - (set! (-> obj strings 0 color) (font-color red)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning right large)) + (set! (-> this strings 0 color) (font-color red)) 0 (none) ) -(defmethod draw hud-timer ((obj hud-timer)) +(defmethod draw hud-timer ((this hud-timer)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 264 - (the int (+ 50.0 (* -100.0 (-> obj offset)))) + (the int (+ 50.0 (* -100.0 (-> this offset)))) ) - (format (clear (-> obj strings 0 text)) "~1,'0D" (/ (-> obj values 0 current) 10)) - (format (clear (-> obj strings 1 text)) "~1,'0D" (mod (-> obj values 0 current) 10)) - (format (clear (-> obj strings 2 text)) ":") - (format (clear (-> obj strings 3 text)) "~1,'0D" (/ (-> obj values 1 current) 10)) - (format (clear (-> obj strings 4 text)) "~1,'0D" (mod (-> obj values 1 current) 10)) + (format (clear (-> this strings 0 text)) "~1,'0D" (/ (-> this values 0 current) 10)) + (format (clear (-> this strings 1 text)) "~1,'0D" (mod (-> this values 0 current) 10)) + (format (clear (-> this strings 2 text)) ":") + (format (clear (-> this strings 3 text)) "~1,'0D" (/ (-> this values 1 current) 10)) + (format (clear (-> this strings 4 text)) "~1,'0D" (mod (-> this values 1 current) 10)) (let ((s5-5 20) (s4-0 -42) ) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) s4-0 -24) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) s4-0 -24) (let ((s4-1 (+ s4-0 s5-5))) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj sprites)) s4-1 -24) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) s4-1 -24) (let ((s4-2 (+ s4-1 16))) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 2 pos)) (the-as vector4w (-> obj sprites)) s4-2 -24) + (set-as-offset-from! (the-as hud-sprite (-> this strings 2 pos)) (the-as vector4w (-> this sprites)) s4-2 -24) (let ((s4-3 (+ s4-2 16))) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 3 pos)) (the-as vector4w (-> obj sprites)) s4-3 -24) + (set-as-offset-from! (the-as hud-sprite (-> this strings 3 pos)) (the-as vector4w (-> this sprites)) s4-3 -24) (let ((a2-13 (+ s4-3 s5-5))) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 4 pos)) (the-as vector4w (-> obj sprites)) a2-13 -24) + (set-as-offset-from! + (the-as hud-sprite (-> this strings 4 pos)) + (the-as vector4w (-> this sprites)) + a2-13 + -24 + ) ) ) ) ) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-timer ((obj hud-timer)) - (set! (-> obj values 0 target) (/ (-> *game-info* timer) #x4650)) - (set! (-> obj values 1 target) (/ (mod (-> *game-info* timer) #x4650) 300)) - (let ((v1-8 (abs (- (-> obj values 1 target) (-> obj values 2 target))))) +(defmethod update-values hud-timer ((this hud-timer)) + (set! (-> this values 0 target) (/ (-> *game-info* timer) #x4650)) + (set! (-> this values 1 target) (/ (mod (-> *game-info* timer) #x4650) 300)) + (let ((v1-8 (abs (- (-> this values 1 target) (-> this values 2 target))))) (when (> v1-8 0) - (set! (-> obj values 2 target) (-> obj values 1 target)) - (if (and (< (-> obj values 0 target) 1) (< (-> obj values 1 target) 10)) + (set! (-> this values 2 target) (-> this values 1 target)) + (if (and (< (-> this values 0 target) 1) (< (-> this values 1 target) 10)) (sound-play "timer-warn") (sound-play "timer-beep") ) ) ) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-timer ((obj hud-timer)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-center) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-timer ((this hud-timer)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 8)) - (set! (-> obj sprites 0 scale-x) 2.2) - (set! (-> obj sprites 0 scale-y) 2.0) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 8)) + (set! (-> this sprites 0 scale-x) 2.2) + (set! (-> this sprites 0 scale-y) 2.0) (dotimes (s5-0 5) - (alloc-string-if-needed obj s5-0) - (set! (-> obj strings s5-0 scale) 0.8) - (set! (-> obj strings s5-0 flags) (font-flags kerning middle large)) - (set! (-> obj strings s5-0 color) (font-color green)) + (alloc-string-if-needed this s5-0) + (set! (-> this strings s5-0 scale) 0.8) + (set! (-> this strings s5-0 flags) (font-flags kerning middle large)) + (set! (-> this strings s5-0 color) (font-color green)) ) - (set! (-> obj values 2 target) (-> obj values 1 target)) + (set! (-> this values 2 target) (-> this values 1 target)) 0 (none) ) -(defmethod draw hud-big-score ((obj hud-big-score)) +(defmethod draw hud-big-score ((this hud-big-score)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 264 - (the int (+ 50.0 (* -100.0 (-> obj offset)))) + (the int (+ 50.0 (* -100.0 (-> this offset)))) ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -7 -24) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -7 -24) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-big-score ((obj hud-big-score)) - (set! (-> obj values 0 target) (the int (-> *game-info* score))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-big-score ((this hud-big-score)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-big-score ((obj hud-big-score)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-center) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-big-score ((this hud-big-score)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 8)) - (set! (-> obj sprites 0 scale-x) 2.7) - (set! (-> obj sprites 0 scale-y) 2.0) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.8) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color green)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 8)) + (set! (-> this sprites 0 scale-x) 2.7) + (set! (-> this sprites 0 scale-y) 2.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.8) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color green)) 0 (none) ) -(defmethod draw hud-goal ((obj hud-goal)) +(defmethod draw hud-goal ((this hud-goal)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 65.0 (* -130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 65.0 (* -130.0 (-> this offset)))) 70 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) 0 -8) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj sprites)) 0 -40) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 0 -40) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-goal ((obj hud-goal)) - (set! (-> obj values 0 target) (the int (-> *game-info* goal))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-goal ((this hud-goal)) + (set! (-> this values 0 target) (the int (-> *game-info* goal))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-goal ((obj hud-goal)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-goal ((this hud-goal)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 flags) (the-as uint 8)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.5) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color red)) - (alloc-string-if-needed obj 1) - (set! (-> obj strings 1 scale) 0.75) - (set! (-> obj strings 1 flags) (font-flags kerning middle large)) - (set! (-> obj strings 1 color) (font-color red)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 flags) (the-as uint 8)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.75) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color red)) (let ((s5-0 format) - (gp-1 (clear (-> obj strings 1 text))) + (gp-1 (clear (-> this strings 1 text))) (s4-0 "~S") ) (format (clear *temp-string*) (lookup-text! *common-text* (text-id highscore-text-goal) #f)) @@ -740,56 +749,56 @@ (none) ) -(defmethod draw hud-miss ((obj hud-miss)) +(defmethod draw hud-miss ((this hud-miss)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 448.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 448.0 (* 130.0 (-> this offset)))) 70 ) - (format (clear (-> obj strings 0 text)) "~D/~D" (-> obj values 0 current) (-> obj values 1 current)) + (format (clear (-> this strings 0 text)) "~D/~D" (-> this values 0 current) (-> this values 1 current)) (let ((s5-1 format) - (s4-0 (clear (-> obj strings 1 text))) + (s4-0 (clear (-> this strings 1 text))) (s3-0 "~S") ) (format (clear *temp-string*) (lookup-text! *common-text* (text-id miss) #f)) (s5-1 s4-0 s3-0 *temp-string*) ) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) 0 -8) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj sprites)) 0 -40) - ((method-of-type hud draw) obj) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 0 -40) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-miss ((obj hud-miss)) - (set! (-> obj values 0 target) (the int (-> *game-info* miss))) - (set! (-> obj values 1 target) (the int (-> *game-info* miss-max))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-miss ((this hud-miss)) + (set! (-> this values 0 target) (the int (-> *game-info* miss))) + (set! (-> this values 1 target) (the int (-> *game-info* miss-max))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-miss ((obj hud-miss)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-miss ((this hud-miss)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 flags) (the-as uint 8)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.5) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color red)) - (alloc-string-if-needed obj 1) - (set! (-> obj strings 1 scale) 0.75) - (set! (-> obj strings 1 flags) (font-flags kerning middle large)) - (set! (-> obj strings 1 color) (font-color red)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 flags) (the-as uint 8)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.75) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color red)) 0 (none) ) -(defmethod draw hud-progress ((obj hud-progress)) +(defmethod draw hud-progress ((this hud-progress)) (with-pp (let ((f0-0 (if (process-by-name "hud-timer" *active-pool*) 65.0 @@ -797,56 +806,56 @@ ) ) ) - (seek! (-> obj sprites 2 scale-y) f0-0 (* 2.0 (-> pp clock time-adjust-ratio))) + (seek! (-> this sprites 2 scale-y) f0-0 (* 2.0 (-> pp clock time-adjust-ratio))) ) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 256 - (the int (+ (* -100.0 (-> obj offset)) (-> obj sprites 2 scale-y))) + (the int (+ (* -100.0 (-> this offset)) (-> this sprites 2 scale-y))) ) (set-as-offset-from! - (-> obj sprites 1) - (the-as vector4w (-> obj sprites)) - (+ (the int (* 0.09 (the float (-> obj values 0 current)))) -42) + (-> this sprites 1) + (the-as vector4w (-> this sprites)) + (+ (the int (* 0.09 (the float (-> this values 0 current)))) -42) 0 ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ) -(defmethod update-values hud-progress ((obj hud-progress)) - (set! (-> obj values 0 target) (the int (* 1000.0 (-> *game-info* distance)))) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-progress ((this hud-progress)) + (set! (-> this values 0 target) (the int (* 1000.0 (-> *game-info* distance)))) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-progress ((obj hud-progress)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-center-2) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-progress ((this hud-progress)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x33 :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 8)) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x34 :page #x67a))) - (set! (-> obj sprites 1 flags) (the-as uint 8)) - (set! (-> obj sprites 1 scale-x) 1.8) - (set! (-> obj sprites 1 scale-y) 1.8) - (set! (-> obj sprites 2 scale-y) (if (process-by-name "hud-timer" *active-pool*) - 65.0 - 35.0 - ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x33 :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 8)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x34 :page #x67a))) + (set! (-> this sprites 1 flags) (the-as uint 8)) + (set! (-> this sprites 1 scale-x) 1.8) + (set! (-> this sprites 1 scale-y) 1.8) + (set! (-> this sprites 2 scale-y) (if (process-by-name "hud-timer" *active-pool*) + 65.0 + 35.0 + ) ) 0 (none) ) -(defmethod draw hud-gun ((obj hud-gun)) +(defmethod draw hud-gun ((this hud-gun)) (local-vars (s3-0 int) (sv-16 int) (sv-32 dma-buffer)) (let ((s4-0 0) (s5-0 0) @@ -854,43 +863,43 @@ 0 (let ((s2-0 20)) (cond - ((= (-> obj values 0 current) 1) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xf :page #x67a))) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x23 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.1) - (set! (-> obj sprites 0 scale-y) 1.5) - (set! (-> obj sprites 1 scale-x) 0.0) + ((= (-> this values 0 current) 1) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xf :page #x67a))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x23 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.1) + (set! (-> this sprites 0 scale-y) 1.5) + (set! (-> this sprites 1 scale-x) 0.0) (set! s5-0 -3) (set! s3-0 (the int (-> *FACT-bank* ammo-yellow-max))) ) - ((= (-> obj values 0 current) 4) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #x67a))) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x21 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.8) - (set! (-> obj sprites 0 scale-y) 1.6) - (set! (-> obj sprites 1 scale-x) 0.0) + ((= (-> this values 0 current) 4) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #x67a))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x21 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.8) + (set! (-> this sprites 0 scale-y) 1.6) + (set! (-> this sprites 1 scale-x) 0.0) (set! s4-0 14) (set! s3-0 (the int (-> *FACT-bank* ammo-dark-max))) (set! s2-0 10) ) - ((= (-> obj values 0 current) 3) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #x67a))) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #x67a))) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x20 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.4) - (set! (-> obj sprites 0 scale-y) 1.4) - (set! (-> obj sprites 1 scale-x) 1.4) - (set! (-> obj sprites 1 scale-y) 1.4) + ((= (-> this values 0 current) 3) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #x67a))) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #x67a))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x20 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.4) + (set! (-> this sprites 0 scale-y) 1.4) + (set! (-> this sprites 1 scale-x) 1.4) + (set! (-> this sprites 1 scale-y) 1.4) (set! s4-0 43) (set! s5-0 6) (set! s3-0 (the int (-> *FACT-bank* ammo-blue-max))) ) (else - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xe :page #x67a))) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x22 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.8) - (set! (-> obj sprites 0 scale-y) 1.6) - (set! (-> obj sprites 1 scale-x) 0.0) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xe :page #x67a))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x22 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.8) + (set! (-> this sprites 0 scale-y) 1.6) + (set! (-> this sprites 1 scale-x) 0.0) (set! s4-0 14) (set! s5-0 -2) (set! s3-0 (the int (-> *FACT-bank* ammo-red-max))) @@ -901,35 +910,35 @@ (set! s3-0 (* s3-0 2)) ) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (- (the int (+ 507.0 (* 130.0 (-> obj offset)))) s4-0) - (the int (+ (- 25.0 (the float s5-0)) (* -100.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (- (the int (+ 507.0 (* 130.0 (-> this offset)))) s4-0) + (the int (+ (- 25.0 (the float s5-0)) (* -100.0 (-> this offset)))) ) (let ((f30-0 1.0)) (cond - ((zero? (-> obj values 0 current)) + ((zero? (-> this values 0 current)) (set! f30-0 0.0) - (set! (-> obj strings 0 pos 0) 0) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) -3 0) + (set! (-> this strings 0 pos 0) 0) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -3 0) ) (else - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) -4 11) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -4 11) (set-as-offset-from! - (the-as hud-sprite (-> obj strings 0 pos)) - (the-as vector4w (-> obj sprites)) + (the-as hud-sprite (-> this strings 0 pos)) + (the-as vector4w (-> this sprites)) (+ s4-0 -70) (+ s5-0 18) ) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites)) (+ s4-0 -68) (+ (if (= s2-0 20) - 98 - 73 - ) - s5-0 - ) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites)) (+ s4-0 -68) (+ (if (= s2-0 20) + 98 + 73 + ) + s5-0 + ) ) - (set! (-> obj sprites 6 scale-x) 1.0) - (let ((s0-0 (mod (-> obj values 1 current) s2-0))) - (if (and (zero? s0-0) (nonzero? (-> obj values 1 current))) + (set! (-> this sprites 6 scale-x) 1.0) + (let ((s0-0 (mod (-> this values 1 current) s2-0))) + (if (and (zero? s0-0) (nonzero? (-> this values 1 current))) (set! s0-0 s2-0) ) (set! sv-32 (-> *display* frames (-> *display* on-screen) global-buf)) @@ -937,17 +946,17 @@ (set! sv-16 0) (while (< sv-16 s2-0) (if (= sv-16 s0-0) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x24 :page #x67a))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x24 :page #x67a))) ) - (draw (-> obj sprites 6) sv-32 (-> obj level)) - (+! (-> obj sprites 6 pos y) -5) + (draw (-> this sprites 6) sv-32 (-> this level)) + (+! (-> this sprites 6 pos y) -5) (if (= sv-16 (+ (/ s2-0 2) -1)) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites)) (+ s4-0 -83) (+ (if (= s2-0 20) - 98 - 73 - ) - s5-0 - ) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites)) (+ s4-0 -83) (+ (if (= s2-0 20) + 98 + 73 + ) + s5-0 + ) ) ) (set! sv-16 (+ sv-16 1)) @@ -970,8 +979,8 @@ ) ) ) - (set! (-> obj sprites 6 scale-x) 0.0) - (set! (-> obj sprites 2 scale-x) + (set! (-> this sprites 6 scale-x) 0.0) + (set! (-> this sprites 2 scale-x) (if (and (logtest? (-> *target* game features) (game-feature gun)) (-> *setting-control* user-current gun) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue)) @@ -982,7 +991,7 @@ 0.0 ) ) - (set! (-> obj sprites 3 scale-x) + (set! (-> this sprites 3 scale-x) (if (and (logtest? (-> *target* game features) (game-feature gun)) (and (-> *setting-control* user-current gun) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark)) @@ -994,7 +1003,7 @@ 0.0 ) ) - (set! (-> obj sprites 4 scale-x) + (set! (-> this sprites 4 scale-x) (if (and (logtest? (-> *target* game features) (game-feature gun)) (and (-> *setting-control* user-current gun) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red)) @@ -1006,7 +1015,7 @@ 0.0 ) ) - (set! (-> obj sprites 5 scale-x) + (set! (-> this sprites 5 scale-x) (if (and (logtest? (-> *target* game features) (game-feature gun)) (and (-> *setting-control* user-current gun) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow)) @@ -1020,94 +1029,94 @@ ) ) ) - (format (clear (-> obj strings 0 text)) "~D/~D" (-> obj values 1 current) s3-0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites)) (+ s4-0 -110) (+ s5-0 18)) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites)) (+ s4-0 -36) (+ s5-0 19)) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites)) (+ s4-0 -78) (+ s5-0 7)) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites)) (+ s4-0 -78) (+ s5-0 37)) + (format (clear (-> this strings 0 text)) "~D/~D" (-> this values 1 current) s3-0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) (+ s4-0 -110) (+ s5-0 18)) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) (+ s4-0 -36) (+ s5-0 19)) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) (+ s4-0 -78) (+ s5-0 7)) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites)) (+ s4-0 -78) (+ s5-0 37)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-gun ((obj hud-gun)) +(defmethod update-values hud-gun ((this hud-gun)) (cond ((focus-test? *target* gun) - (set! (-> obj values 0 target) (the-as int (-> *target* gun gun-type))) - (set! (-> obj values 1 target) (the int (get-gun-ammo (-> *target* fact)))) - (logclear! (-> obj flags) (hud-flags disable)) - (logior! (-> obj flags) (hud-flags show)) + (set! (-> this values 0 target) (the-as int (-> *target* gun gun-type))) + (set! (-> this values 1 target) (the int (get-gun-ammo (-> *target* fact)))) + (logclear! (-> this flags) (hud-flags disable)) + (logior! (-> this flags) (hud-flags show)) ) (else - (logior! (-> obj flags) (hud-flags disable)) - (logclear! (-> obj flags) (hud-flags show)) - (send-event obj 'hide) + (logior! (-> this flags) (hud-flags disable)) + (logclear! (-> this flags) (hud-flags show)) + (send-event this 'hide) ) ) - ((method-of-type hud update-values) obj) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-gun ((obj hud-gun)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-gun ((this hud-gun)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x67a))) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x9 :page #x67a))) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xa :page #x67a))) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x7 :page #x67a))) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 scale) 0.5) - (logior! (-> obj flags) (hud-flags disable)) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x67a))) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x9 :page #x67a))) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xa :page #x67a))) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x7 :page #x67a))) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 scale) 0.5) + (logior! (-> this flags) (hud-flags disable)) 0 (none) ) -(defmethod draw hud-samos-young ((obj hud-samos-young)) +(defmethod draw hud-samos-young ((this hud-samos-young)) (set-hud-piece-position! - (-> obj sprites 2) - (the int (+ 30.0 (* -130.0 (-> obj offset)))) - (the int (+ 30.0 (* -100.0 (-> obj offset)))) + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 7 5) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 7 5) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-samos-young ((obj hud-samos-young)) - (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-samos-young ((this hud-samos-young)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-samos-young ((obj hud-samos-young)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-samos-young ((this hud-samos-young)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 scale-x) 12.0) - (set! (-> obj sprites 0 scale-y) 11.2) - (set! (-> obj sprites 0 pos z) #xfffff2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 3 tex) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tex) (lookup-texture-by-name "hud-samos-young-head-01" (the-as string #f) (the-as (pointer texture-page) #f)) ) - (set! (-> obj sprites 3 scale-x) 0.8) - (set! (-> obj sprites 3 scale-y) 0.8) - (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 scale-x) 0.8) + (set! (-> this sprites 3 scale-y) 0.8) + (set! (-> this sprites 3 pos z) #xffffff) 0 (none) ) diff --git a/goal_src/jak2/engine/ui/minimap.gc b/goal_src/jak2/engine/ui/minimap.gc index 3de25ca8da..935cae41ba 100644 --- a/goal_src/jak2/engine/ui/minimap.gc +++ b/goal_src/jak2/engine/ui/minimap.gc @@ -841,10 +841,10 @@ ) ) -(defmethod debug-draw minimap ((obj minimap)) +(defmethod debug-draw minimap ((this minimap)) (when *trail-graph* (dotimes (s5-0 6) - (let ((s4-0 (-> obj trail s5-0))) + (let ((s4-0 (-> this trail s5-0))) (when (and (-> s4-0 used-by) (>= (-> s4-0 node-count) 0) (< (- (current-time) (the-as int (-> s4-0 last-updated))) (seconds 5)) @@ -889,7 +889,7 @@ ) ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod update-trails minimap ((obj minimap)) +(defmethod update-trails minimap ((this minimap)) "Main function to do trail search per-frame" (let ((s5-0 *trail-graph*)) (when s5-0 @@ -905,7 +905,7 @@ (let ((v1-5 -1)) (let ((a0-5 0)) (countdown (a1-1 6) - (let* ((a2-3 (-> obj trail a1-1)) + (let* ((a2-3 (-> this trail a1-1)) (a3-0 (-> a2-3 used-by)) ) (when (and a3-0 (and (< 0.0 (-> a3-0 alpha)) (or (< v1-5 0) (< (the-as int (-> a2-3 last-updated)) a0-5)))) @@ -920,7 +920,7 @@ ) ) ) - (let ((s4-0 (-> obj trail v1-5)) + (let ((s4-0 (-> this trail v1-5)) (s3-0 (the-as object #f)) ) (let* ((v1-9 (-> s4-0 used-by)) @@ -973,7 +973,7 @@ ) ((or (= v1-2 3) (= v1-2 2)) (countdown (v1-33 6) - (let ((s4-1 (-> obj trail v1-33))) + (let ((s4-1 (-> this trail v1-33))) (when (and (= (-> s4-1 search-id) (-> s5-0 search-id)) (-> s4-1 used-by)) (set! (-> s4-1 node-count) (get-path-to-root s5-0 (-> s4-1 node-id) 64 (&-> s4-1 goal-node-id) (&-> s4-1 node-path-dist)) @@ -1001,11 +1001,11 @@ (none) ) -(defmethod get-trail-for-connection minimap ((obj minimap) (arg0 connection-minimap) (arg1 symbol)) +(defmethod get-trail-for-connection minimap ((this minimap) (arg0 connection-minimap) (arg1 symbol)) "Get a trail for connection. If arg1 is set, allow allocating a new one." (local-vars (gp-0 minimap-trail)) (countdown (v1-0 6) - (let ((a3-3 (-> obj trail v1-0))) + (let ((a3-3 (-> this trail v1-0))) (when (= (-> a3-3 used-by) arg0) (set! gp-0 a3-3) (goto cfg-14) @@ -1014,7 +1014,7 @@ ) (when arg1 (dotimes (v1-4 6) - (let ((a3-7 (-> obj trail v1-4))) + (let ((a3-7 (-> this trail v1-4))) (when (not (-> a3-7 used-by)) (set! (-> a3-7 used-by) arg0) (set! gp-0 a3-7) @@ -1032,10 +1032,10 @@ ) ;; WARN: Function (method 13 minimap) has a return type of none, but the expression builder found a return statement. -(defmethod free-trail-by-connection minimap ((obj minimap) (arg0 connection-minimap)) +(defmethod free-trail-by-connection minimap ((this minimap) (arg0 connection-minimap)) "Free the trail associated with this connection." (countdown (v1-0 6) - (let ((a2-3 (-> obj trail v1-0))) + (let ((a2-3 (-> this trail v1-0))) (when (= (-> a2-3 used-by) arg0) (set! (-> a2-3 used-by) #f) (reset a2-3) @@ -1047,15 +1047,15 @@ (none) ) -(defmethod reset minimap-trail ((obj minimap-trail)) - (set! (-> obj node-count) -1) - (set! (-> obj search-id) (the-as uint 0)) - (set! (-> obj last-updated) (the-as uint 0)) - (set! (-> obj cached-info goal-conn-id) -1) +(defmethod reset minimap-trail ((this minimap-trail)) + (set! (-> this node-count) -1) + (set! (-> this search-id) (the-as uint 0)) + (set! (-> this last-updated) (the-as uint 0)) + (set! (-> this cached-info goal-conn-id) -1) (none) ) -(defmethod get-icon-draw-pos minimap ((obj minimap) (arg0 connection-minimap) (arg1 minimap-trail) (arg2 vector) (arg3 float) (arg4 vector)) +(defmethod get-icon-draw-pos minimap ((this minimap) (arg0 connection-minimap) (arg1 minimap-trail) (arg2 vector) (arg3 float) (arg4 vector)) "Follow the path from the start until it reaches the border of the map, then get this position." (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 4))) (vector-reset! (-> s5-0 2)) @@ -1097,18 +1097,18 @@ #f ) -(defmethod get-distance-with-path minimap-trail ((obj minimap-trail) (arg0 vector) (arg1 vector)) +(defmethod get-distance-with-path minimap-trail ((this minimap-trail) (arg0 vector) (arg1 vector)) "Assuming we go from a to b, using this path in the middle, how long is it?" 0.0 (let ((s4-0 *trail-graph*)) (cond - ((and s4-0 (> (-> obj node-count) 0)) - (let ((f30-0 (-> obj node-path-dist)) + ((and s4-0 (> (-> this node-count) 0)) + (let ((f30-0 (-> this node-path-dist)) (s2-0 (new 'stack-no-clear 'vector)) ) - (get-node-location-by-id s4-0 (-> obj node-id 0) s2-0) + (get-node-location-by-id s4-0 (-> this node-id 0) s2-0) (let ((f30-1 (+ f30-0 (vector-vector-xz-distance arg0 s2-0)))) - (get-node-location-by-id s4-0 (the-as uint (-> obj goal-node-id)) s2-0) + (get-node-location-by-id s4-0 (the-as uint (-> this goal-node-id)) s2-0) (+ f30-1 (vector-vector-xz-distance arg1 s2-0)) ) ) @@ -1120,22 +1120,22 @@ ) ) -(defmethod print connection-minimap ((obj connection-minimap)) +(defmethod print connection-minimap ((this connection-minimap)) (format #t "#" - (-> obj class name) - (-> obj flags) - (handle->process (-> obj handle)) - obj + (-> this class name) + (-> this flags) + (handle->process (-> this handle)) + this ) - obj + this ) -(defmethod run-pending-updates! engine-minimap ((obj engine-minimap) (arg0 time-frame)) - (let ((s2-0 (the-as (pointer connection-pers) (&-> obj alive-list))) - (s3-0 (-> obj alive-list)) +(defmethod run-pending-updates! engine-minimap ((this engine-minimap) (arg0 time-frame)) + (let ((s2-0 (the-as (pointer connection-pers) (&-> this alive-list))) + (s3-0 (-> this alive-list)) ) (while s3-0 (let ((s4-0 (-> s3-0 next))) @@ -1170,11 +1170,11 @@ ) (cond ((and (logtest? (-> s3-0 flags) (minimap-flag fade-out)) (= (-> s3-0 alpha) 0.0)) - (kill-callback obj s3-0) + (kill-callback this s3-0) (set! (-> s2-0 0) (-> s3-0 next)) - (set! (-> s3-0 next) (-> obj dead-list)) - (set! (-> obj dead-list) s3-0) - (+! (-> obj length) -1) + (set! (-> s3-0 next) (-> this dead-list)) + (set! (-> this dead-list) s3-0) + (+! (-> this length) -1) ) ((and (handle->process (-> s3-0 handle)) (not (and (= (logand (the-as int (-> s3-0 position)) 7) 4) @@ -1185,12 +1185,12 @@ ) ) ) - (update-callback obj) + (update-callback this) (set! s2-0 (&-> s3-0 next)) ) (else (logior! (-> s3-0 flags) (minimap-flag fade-out)) - (update-callback obj) + (update-callback this) (set! s2-0 (&-> s3-0 next)) ) ) @@ -1198,12 +1198,12 @@ ) ) ) - (set! (-> obj execute-time) arg0) + (set! (-> this execute-time) arg0) 0 (none) ) -(defmethod add-icon! minimap ((obj minimap) (arg0 process) (arg1 uint) (arg2 int) (arg3 vector) (arg4 int)) +(defmethod add-icon! minimap ((this minimap) (arg0 process) (arg1 uint) (arg2 int) (arg3 vector) (arg4 int)) "Add an icon to the map!" (when (not arg2) (let ((v1-3 (+ (-> *minimap* engine-key) 1))) @@ -1211,7 +1211,7 @@ (set! arg2 (the-as int v1-3)) ) ) - (let ((s3-0 (the-as connection-minimap (schedule-callback (-> obj engine) arg2 0)))) + (let ((s3-0 (the-as connection-minimap (schedule-callback (-> this engine) arg2 0)))) (let ((s2-1 (-> *minimap-class-list* arg1))) (when s3-0 (when (not (logtest? (-> s3-0 flags) (minimap-flag active))) @@ -1241,7 +1241,7 @@ ) ;; WARN: Function (method 10 engine-minimap) has a return type of none, but the expression builder found a return statement. -(defmethod kill-callback engine-minimap ((obj engine-minimap) (arg0 connection-pers)) +(defmethod kill-callback engine-minimap ((this engine-minimap) (arg0 connection-pers)) (if (not arg0) (return #f) ) @@ -1249,7 +1249,7 @@ (free-trail-by-connection *minimap* (the-as connection-minimap arg0)) ) (set! (-> arg0 update-time) (the-as time-frame #f)) - ((method-of-type engine-pers kill-callback) obj arg0) + ((method-of-type engine-pers kill-callback) this arg0) (none) ) @@ -1279,29 +1279,29 @@ (the-as texture #f) ) -(defmethod update! minimap ((obj minimap)) - (set! (-> obj ctywide) (level-get *level* 'ctywide)) - (set! (-> obj map-bits) (the-as uint 0)) +(defmethod update! minimap ((this minimap)) + (set! (-> this ctywide) (level-get *level* 'ctywide)) + (set! (-> this map-bits) (the-as uint 0)) (dotimes (v1-2 (-> *level* length)) (let ((a0-5 (-> *level* level v1-2))) (if (= (-> a0-5 status) 'active) - (logior! (-> obj map-bits) (-> a0-5 info city-map-bits)) + (logior! (-> this map-bits) (-> a0-5 info city-map-bits)) ) ) ) (let ((s5-0 (the int (* 0.0000006357829 (+ 3145728.0 (-> (target-pos 0) x))))) (v1-9 (the int (* 0.0000006357829 (+ 3145728.0 (-> (target-pos 0) z))))) ) - (when (and (< s5-0 5) (< v1-9 7) (logtest? (-> obj map-bits) (ash 1 (+ (* 5 v1-9) s5-0)))) + (when (and (< s5-0 5) (< v1-9 7) (logtest? (-> this map-bits) (ash 1 (+ (* 5 v1-9) s5-0)))) (let ((a0-19 (-> *minimap-texture-name-array* data (+ (* 5 v1-9) s5-0)))) (when a0-19 - (set! (-> obj last-name) a0-19) - (set! (-> obj minimap-corner quad) (-> *minimap-corner-array* data (+ (* 5 v1-9) s5-0) quad)) + (set! (-> this last-name) a0-19) + (set! (-> this minimap-corner quad) (-> *minimap-corner-array* data (+ (* 5 v1-9) s5-0) quad)) (dotimes (a0-21 (-> *level* length)) (let ((a1-23 (-> *level* level a0-21))) (when (= (-> a1-23 status) 'active) (if (logtest? (-> a1-23 info city-map-bits) (ash 1 (+ (* 5 v1-9) s5-0))) - (set! (-> obj level) a1-23) + (set! (-> this level) a1-23) ) ) ) @@ -1310,23 +1310,23 @@ ) ) ) - (set! (-> obj last-tex) - (lookup-minimap-texture-by-name (-> obj last-name) (the-as string #f) (the-as (pointer texture-page) #f)) + (set! (-> this last-tex) + (lookup-minimap-texture-by-name (-> this last-name) (the-as string #f) (the-as (pointer texture-page) #f)) ) (let ((f30-2 (seconds-per-frame))) - (let ((v1-12 (-> obj last-tex))) + (let ((v1-12 (-> this last-tex))) (cond - ((or (not (-> obj level)) (zero? (-> obj level)) (!= (-> obj level status) 'active) (not v1-12)) - (set! (-> obj offset w) 0.0) + ((or (not (-> this level)) (zero? (-> this level)) (!= (-> this level status) 'active) (not v1-12)) + (set! (-> this offset w) 0.0) ) ((not (logtest? (-> *setting-control* user-current minimap) 128)) - (seek! (-> obj offset w) 0.0 f30-2) + (seek! (-> this offset w) 0.0 f30-2) ) - ((and *target* (nonzero? (-> obj map-bits))) - (set! (-> obj offset w) (fmin 0.5 (+ (-> obj offset w) f30-2))) + ((and *target* (nonzero? (-> this map-bits))) + (set! (-> this offset w) (fmin 0.5 (+ (-> this offset w) f30-2))) ) (else - (set! (-> obj offset w) 0.0) + (set! (-> this offset w) 0.0) ) ) ) @@ -1337,29 +1337,29 @@ (f2-0 122880.0) (v1-33 (-> *target* control transv)) ) - (set! (-> obj target-inv-scale) + (set! (-> this target-inv-scale) (fmax f0-14 (* f1-2 (fmin f2-0 (sqrtf (+ (* (-> v1-33 x) (-> v1-33 x)) (* (-> v1-33 z) (-> v1-33 z))))))) ) ) ) (else - (set! (-> obj target-inv-scale) 0.5) + (set! (-> this target-inv-scale) 0.5) ) ) - (seek! (-> obj offset y) (-> obj target-inv-scale) (* 0.5 f30-2)) + (seek! (-> this offset y) (-> this target-inv-scale) (* 0.5 f30-2)) ) - (run-pending-updates! (-> obj engine) (-> *display* base-clock frame-counter)) - (when (and (-> obj ctywide) (and (= (-> obj ctywide status) 'active) (!= (-> obj offset w) 0.0))) - (update-trails obj) + (run-pending-updates! (-> this engine) (-> *display* base-clock frame-counter)) + (when (and (-> this ctywide) (and (= (-> this ctywide status) 'active) (!= (-> this offset w) 0.0))) + (update-trails this) (if *display-trail-graph* - (debug-draw obj) + (debug-draw this) ) #t ) ) ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-racer-2 minimap ((obj minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-racer-2 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1392,8 +1392,8 @@ (set! (-> sv-220 vector 0 y) 0.0) (set! (-> sv-220 vector 0 w) 0.0) (vector-! sv-212 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) - (let ((f0-4 (/ (-> sv-212 x) (* 16384.0 (-> obj offset y)))) - (f1-3 (/ (-> sv-212 z) (* 16384.0 (-> obj offset y)))) + (let ((f0-4 (/ (-> sv-212 x) (* 16384.0 (-> this offset y)))) + (f1-3 (/ (-> sv-212 z) (* 16384.0 (-> this offset y)))) ) (set-vector! (-> sv-224 vector 0) (-> sv-216 z) 0.0 (- (-> sv-216 x)) 0.0) (set-vector! (-> sv-224 vector 1) 0.0 1.0 0.0 0.0) @@ -1416,20 +1416,20 @@ (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-228) (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-228) (let* ((a0-38 (-> arg1 class color)) - (a0-45 (copy-and-set-field a0-38 r (shr (* (-> a0-38 r) (the-as uint (-> obj color x))) 7))) - (a0-52 (copy-and-set-field a0-45 g (shr (* (-> a0-45 g) (the-as uint (-> obj color y))) 7))) + (a0-45 (copy-and-set-field a0-38 r (shr (* (-> a0-38 r) (the-as uint (-> this color x))) 7))) + (a0-52 (copy-and-set-field a0-45 g (shr (* (-> a0-45 g) (the-as uint (-> this color y))) 7))) (v1-57 (copy-and-set-field - (copy-and-set-field a0-52 b (shr (* (-> a0-52 b) (the-as uint (-> obj color z))) 7)) + (copy-and-set-field a0-52 b (shr (* (-> a0-52 b) (the-as uint (-> this color z))) 7)) a (the int (* 128.0 (-> arg1 alpha))) ) ) ) - (let ((a0-64 (-> obj draw4-tmpl dma-vif quad))) + (let ((a0-64 (-> this draw4-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-208)) a0-64) ) - (let ((a0-65 (-> obj draw4-tmpl quad 1))) + (let ((a0-65 (-> this draw4-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-208) 1) a0-65) ) (set-vector! @@ -1478,7 +1478,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-racer-1 minimap ((obj minimap) (arg0 minimap-draw-work) (arg1 connection-minimap) (arg2 float) (arg3 float) (arg4 float)) +(defmethod draw-racer-1 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap) (arg2 float) (arg3 float) (arg4 float)) (local-vars (sv-16 process) (sv-20 float) @@ -1505,7 +1505,7 @@ (vector-xz-normalize! sv-136 -1.0) (set! (-> sv-136 y) 0.0) (set! (-> sv-136 w) 0.0) - (vector-! sv-132 (-> (the-as process-drawable sv-16) root trans) (-> obj race-corner)) + (vector-! sv-132 (-> (the-as process-drawable sv-16) root trans) (-> this race-corner)) (cond ((-> *blit-displays-work* horizontal-flip-flag) (let ((f0-4 (+ arg3 (* (- 128.0 (/ (-> sv-132 x) arg2)) sv-20))) @@ -1539,20 +1539,20 @@ (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-140) (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-140) (let* ((a0-32 (-> arg1 class color)) - (a0-39 (copy-and-set-field a0-32 r (shr (* (-> a0-32 r) (the-as uint (-> obj color x))) 7))) - (a0-46 (copy-and-set-field a0-39 g (shr (* (-> a0-39 g) (the-as uint (-> obj color y))) 7))) + (a0-39 (copy-and-set-field a0-32 r (shr (* (-> a0-32 r) (the-as uint (-> this color x))) 7))) + (a0-46 (copy-and-set-field a0-39 g (shr (* (-> a0-39 g) (the-as uint (-> this color y))) 7))) (v1-59 (copy-and-set-field - (copy-and-set-field a0-46 b (shr (* (-> a0-46 b) (the-as uint (-> obj color z))) 7)) + (copy-and-set-field a0-46 b (shr (* (-> a0-46 b) (the-as uint (-> this color z))) 7)) a (the int (* 128.0 (-> arg1 alpha))) ) ) ) - (let ((a0-58 (-> obj draw4-tmpl dma-vif quad))) + (let ((a0-58 (-> this draw4-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-128)) a0-58) ) - (let ((a0-59 (-> obj draw4-tmpl quad 1))) + (let ((a0-59 (-> this draw4-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-128) 1) a0-59) ) (set-vector! @@ -1601,7 +1601,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-frustum-1 minimap ((obj minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-frustum-1 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1643,8 +1643,8 @@ (set! (-> sv-224 vector 0 y) 0.0) (set! (-> sv-224 vector 0 w) 0.0) (vector-! sv-216 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) - (let ((f0-4 (/ (-> sv-216 x) (* 16384.0 (-> obj offset y)))) - (f1-3 (/ (-> sv-216 z) (* 16384.0 (-> obj offset y)))) + (let ((f0-4 (/ (-> sv-216 x) (* 16384.0 (-> this offset y)))) + (f1-3 (/ (-> sv-216 z) (* 16384.0 (-> this offset y)))) ) (set-vector! (-> sv-228 vector 0) (-> sv-220 z) 0.0 (- (-> sv-220 x)) 0.0) (set-vector! (-> sv-228 vector 1) 0.0 1.0 0.0 0.0) @@ -1656,7 +1656,7 @@ (set-vector! (-> sv-232 trans) f0-4 0.0 f1-3 1.0) ) (matrix*! sv-232 sv-232 sv-228) - (let ((f0-8 (/ -10.0 (-> obj offset y)))) + (let ((f0-8 (/ -10.0 (-> this offset y)))) (set-vector! (-> arg0 corner 0) 0.0 0.0 0.0 1.0) (set-vector! (-> arg0 corner 1) (- f0-8) 0.0 f0-8 1.0) (set-vector! (-> arg0 corner 2) f0-8 0.0 f0-8 1.0) @@ -1683,27 +1683,27 @@ (.svf (&-> v1-49 quad) vf5) (when (and (< (-> a0-40 x) 228.0) (< (-> a0-40 z) 228.0) (< 100.0 (-> v1-49 x)) (< 100.0 (-> v1-49 z))) (let* ((a0-46 (-> arg1 class color)) - (a0-53 (copy-and-set-field a0-46 r (shr (* (-> a0-46 r) (the-as uint (-> obj color x))) 7))) - (a0-60 (copy-and-set-field a0-53 g (shr (* (-> a0-53 g) (the-as uint (-> obj color y))) 7))) + (a0-53 (copy-and-set-field a0-46 r (shr (* (-> a0-46 r) (the-as uint (-> this color x))) 7))) + (a0-60 (copy-and-set-field a0-53 g (shr (* (-> a0-53 g) (the-as uint (-> this color y))) 7))) (s4-1 (copy-and-set-field - (copy-and-set-field a0-60 b (shr (* (-> a0-60 b) (the-as uint (-> obj color z))) 7)) + (copy-and-set-field a0-60 b (shr (* (-> a0-60 b) (the-as uint (-> this color z))) 7)) a - (the int (* 128.0 (-> obj frustum-alpha) (-> arg1 alpha))) + (the int (* 128.0 (-> this frustum-alpha) (-> arg1 alpha))) ) ) ) - (let ((v1-60 (-> obj adgif-tmpl dma-vif quad))) + (let ((v1-60 (-> this adgif-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-208)) v1-60) ) - (let ((v1-61 (-> obj adgif-tmpl quad 1))) + (let ((v1-61 (-> this adgif-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-208) 1) v1-61) ) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ sv-208 32)) sv-212) - (let ((v1-63 (-> obj draw4-tmpl dma-vif quad))) + (let ((v1-63 (-> this draw4-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-208) 7) v1-63) ) - (let ((v1-64 (-> obj draw4-tmpl quad 1))) + (let ((v1-64 (-> this draw4-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-208) 8) v1-64) ) (set-vector! @@ -1756,7 +1756,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-frustum-2 minimap ((obj minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-frustum-2 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1792,8 +1792,8 @@ (set! (-> sv-224 vector 0 y) 0.0) (set! (-> sv-224 vector 0 w) 0.0) (vector-! sv-216 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) - (let ((f0-4 (/ (-> sv-216 x) (* 16384.0 (-> obj offset y)))) - (f1-3 (/ (-> sv-216 z) (* 16384.0 (-> obj offset y)))) + (let ((f0-4 (/ (-> sv-216 x) (* 16384.0 (-> this offset y)))) + (f1-3 (/ (-> sv-216 z) (* 16384.0 (-> this offset y)))) ) (set-vector! (-> sv-228 vector 0) (-> sv-220 z) 0.0 (- (-> sv-220 x)) 0.0) (set-vector! (-> sv-228 vector 1) 0.0 1.0 0.0 0.0) @@ -1821,20 +1821,20 @@ (v1-54 (+ a2-6 304)) (a0-43 (+ a1-12 304)) ) - (let* ((t0-2 (copy-and-set-field a3-0 r (shr (* (-> a3-0 r) (the-as uint (-> obj color x))) 7))) - (t0-9 (copy-and-set-field t0-2 g (shr (* (-> t0-2 g) (the-as uint (-> obj color y))) 7))) + (let* ((t0-2 (copy-and-set-field a3-0 r (shr (* (-> a3-0 r) (the-as uint (-> this color x))) 7))) + (t0-9 (copy-and-set-field t0-2 g (shr (* (-> t0-2 g) (the-as uint (-> this color y))) 7))) (a3-13 (copy-and-set-field - (copy-and-set-field t0-9 b (shr (* (-> t0-9 b) (the-as uint (-> obj color z))) 7)) + (copy-and-set-field t0-9 b (shr (* (-> t0-9 b) (the-as uint (-> this color z))) 7)) a (the int (* 128.0 (-> arg1 alpha))) ) ) ) - (let ((t0-21 (-> obj draw3-tmpl dma-vif quad))) + (let ((t0-21 (-> this draw3-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-208)) t0-21) ) - (let ((t0-22 (-> obj draw3-tmpl quad 1))) + (let ((t0-22 (-> this draw3-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-208) 1) t0-22) ) (set-vector! @@ -1888,13 +1888,13 @@ (none) ) -(defmethod sub-draw-1-1 minimap ((obj minimap) (arg0 minimap-draw-work)) +(defmethod sub-draw-1-1 minimap ((this minimap) (arg0 minimap-draw-work)) (let ((s5-0 (-> arg0 buf))) (set-display-gs-state s5-0 (the-as int (-> *map-texture-base* vram-page)) 128 128 0 0) (let ((s3-0 (-> s5-0 base))) - (set! (-> (the-as (pointer uint128) s3-0)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-0) 1) (-> obj adgif-tmpl quad 1)) - (let ((a1-2 (-> obj last-tex))) + (set! (-> (the-as (pointer uint128) s3-0)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-0) 1) (-> this adgif-tmpl quad 1)) + (let ((a1-2 (-> this last-tex))) (if (not a1-2) (set! a1-2 (lookup-texture-by-id-fast (new 'static 'texture-id :index #x9b :page #xb))) ) @@ -1910,8 +1910,8 @@ (let ((s3-1 (the-as object (-> s5-0 base)))) ;; og:preserve-this this fixes minimap stretching at non-4x3 aspeect ratio (let ((f30-0 (#if PC_PORT 1.0 (-> *video-params* relative-x-scale)))) - (set! (-> (the-as (pointer uint128) s3-1)) (-> obj draw2-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-1) 1) (-> obj draw2-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-1)) (-> this draw2-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-1) 1) (-> this draw2-tmpl quad 1)) (let ((s2-0 (new-stack-vector0))) (let ((s1-0 (new-stack-vector0))) (set! (-> s1-0 quad) (-> (matrix-local->world #f #f) vector 2 quad)) @@ -1926,24 +1926,24 @@ (set-vector! (-> arg0 mat vector 1) 0.0 1.0 0.0 0.0) (set-vector! (-> arg0 mat vector 2) (* (-> s1-0 x) f30-0) 0.0 (-> s1-0 z) 0.0) ) - (vector-! s2-0 (target-pos 0) (-> obj minimap-corner)) + (vector-! s2-0 (target-pos 0) (-> this minimap-corner)) (set! (-> s2-0 x) (* 0.00000023841858 (-> s2-0 x))) (set! (-> s2-0 z) (* 0.00000023841858 (-> s2-0 z))) - (vector+! (-> arg0 mat trans) s2-0 (-> obj offset)) + (vector+! (-> arg0 mat trans) s2-0 (-> this offset)) ) ) (set! (-> arg0 mat trans y) 0.0) - (set! (-> arg0 corner 0 x) (* 0.25 (-> obj offset y))) - (set! (-> arg0 corner 0 z) (* 0.25 (-> obj offset y))) + (set! (-> arg0 corner 0 x) (* 0.25 (-> this offset y))) + (set! (-> arg0 corner 0 z) (* 0.25 (-> this offset y))) (set! (-> arg0 corner 0 w) 1.0) - (set! (-> arg0 corner 1 x) (* -0.25 (-> obj offset y))) - (set! (-> arg0 corner 1 z) (* 0.25 (-> obj offset y))) + (set! (-> arg0 corner 1 x) (* -0.25 (-> this offset y))) + (set! (-> arg0 corner 1 z) (* 0.25 (-> this offset y))) (set! (-> arg0 corner 1 w) 1.0) - (set! (-> arg0 corner 2 x) (* 0.25 (-> obj offset y))) - (set! (-> arg0 corner 2 z) (* -0.25 (-> obj offset y))) + (set! (-> arg0 corner 2 x) (* 0.25 (-> this offset y))) + (set! (-> arg0 corner 2 z) (* -0.25 (-> this offset y))) (set! (-> arg0 corner 2 w) 1.0) - (set! (-> arg0 corner 3 x) (* -0.25 (-> obj offset y))) - (set! (-> arg0 corner 3 z) (* -0.25 (-> obj offset y))) + (set! (-> arg0 corner 3 x) (* -0.25 (-> this offset y))) + (set! (-> arg0 corner 3 z) (* -0.25 (-> this offset y))) (set! (-> arg0 corner 3 w) 1.0) (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) (-> arg0 mat)) (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) (-> arg0 mat)) @@ -1966,15 +1966,15 @@ (set! f0-57 0.0) ) ) - (seek! (-> obj frustum-alpha) f0-57 (seconds-per-frame)) + (seek! (-> this frustum-alpha) f0-57 (seconds-per-frame)) ) (dma-buffer-add-gs-set s5-0 (xyoffset-1 (new 'static 'gs-xy-offset :ofx #x640 :ofy #x640))) - (when (!= (-> obj frustum-alpha) 0.0) + (when (!= (-> this frustum-alpha) 0.0) (let ((s3-2 (the-as connection-pers (-> *minimap* engine alive-list)))) (while s3-2 (let ((a2-6 s3-2)) (if (logtest? (-> (the-as connection-minimap a2-6) class flags) (minimap-flag frustum)) - (draw-frustum-1 obj arg0 (the-as connection-minimap a2-6)) + (draw-frustum-1 this arg0 (the-as connection-minimap a2-6)) ) ) (set! s3-2 (-> s3-2 next)) @@ -1985,8 +1985,8 @@ (s3-3 (lookup-texture-by-id-fast (new 'static 'texture-id :page #x679))) ) (when s3-3 - (set! (-> (the-as (pointer uint128) s2-1)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s2-1) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s2-1)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s2-1) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s2-1 32)) s3-3) (&+! (-> arg0 buf base) 112) ) @@ -1998,7 +1998,7 @@ (while s3-4 (let ((a2-7 s3-4)) (if (logtest? (-> (the-as connection-minimap a2-7) class flags) (minimap-flag frustum)) - (draw-frustum-2 obj arg0 (the-as connection-minimap a2-7)) + (draw-frustum-2 this arg0 (the-as connection-minimap a2-7)) ) ) (set! s3-4 (-> s3-4 next)) @@ -2008,8 +2008,8 @@ (a1-32 (lookup-texture-by-id-fast (new 'static 'texture-id :index #x42 :page #xb))) ) (when a1-32 - (set! (-> (the-as (pointer uint128) s3-5)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-5) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-5)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-5) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s3-5 32)) a1-32) (&+! (-> arg0 buf base) 112) ) @@ -2018,7 +2018,7 @@ (while s3-6 (let ((a2-8 s3-6)) (if (logtest? (-> (the-as connection-minimap a2-8) class flags) (minimap-flag racer)) - (draw-racer-2 obj arg0 (the-as connection-minimap a2-8)) + (draw-racer-2 this arg0 (the-as connection-minimap a2-8)) ) ) (set! s3-6 (-> s3-6 next)) @@ -2030,14 +2030,14 @@ (xyoffset-1 (new 'static 'gs-xy-offset)) ) (let ((s3-7 (the-as object (-> s5-0 base)))) - (set! (-> (the-as (pointer uint128) s3-7)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-7) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-7)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-7) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s3-7) 2)) (lookup-texture-by-id-fast (new 'static 'texture-id :index #x2a :page #x67a)) ) - (set! (-> (the-as (pointer uint128) s3-7) 7) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-7) 8) (-> obj sprite-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-7) 7) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-7) 8) (-> this sprite-tmpl quad 1)) (set-vector! (-> (the-as (inline-array vector4w) s3-7) 9) 128 128 128 128) (set-vector! (-> (the-as (inline-array vector4w) s3-7) 10) 0 0 0 0) (set-vector! (-> (the-as (inline-array vector4w) s3-7) 11) 0 0 #xffffff 0) @@ -2051,7 +2051,7 @@ (none) ) -(defmethod sub-draw-1-2 minimap ((obj minimap) (arg0 minimap-draw-work)) +(defmethod sub-draw-1-2 minimap ((this minimap) (arg0 minimap-draw-work)) (local-vars (a3-4 int) (t0-4 int) (sv-48 vector) (sv-52 matrix) (sv-56 vector)) (let ((s5-0 (-> arg0 buf))) (reset-display-gs-state *display* s5-0) @@ -2090,9 +2090,9 @@ (set! t0-4 (* (+ t0-0 1792 (-> arg0 draw-pos x)) 16)) ) ) - (set! (-> (the-as (pointer uint128) v1-20)) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-20) 1) (-> obj sprite-tmpl quad 1)) - (let ((t1-5 (-> obj color quad))) + (set! (-> (the-as (pointer uint128) v1-20)) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-20) 1) (-> this sprite-tmpl quad 1)) + (let ((t1-5 (-> this color quad))) (set! (-> (the-as (pointer uint128) (&+ (the-as pointer v1-20) 32))) t1-5) ) (cond @@ -2193,11 +2193,11 @@ (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) s1-2) (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) s1-2) (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) s1-2) - (set! (-> (the-as (pointer uint128) s3-2)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-2) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-2)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-2) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s3-2) 2)) s2-1) - (set! (-> (the-as (pointer uint128) s3-2) 7) (-> obj draw-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-2) 8) (-> obj draw-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-2) 7) (-> this draw-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-2) 8) (-> this draw-tmpl quad 1)) (set-vector! (-> (the-as (inline-array vector4w) s3-2) 9) 0 255 255 128) (set-vector! (-> (the-as (inline-array vector4w) s3-2) 10) 0 0 #xffffff 0) (set-vector! @@ -2248,7 +2248,7 @@ ) ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-connection minimap ((obj minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-connection minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (let ((s1-0 (target-pos 0))) (cond ((= (-> arg1 position) #t) @@ -2297,7 +2297,7 @@ (let ((s3-2 (new 'stack-no-clear 'vector)) (s2-0 #f) ) - (let ((f30-0 (/ 1.0 (* 16384.0 (-> obj offset y))))) + (let ((f30-0 (/ 1.0 (* 16384.0 (-> this offset y))))) 0.0 (set! (-> s3-2 quad) (-> arg1 last-relative-pos quad)) (set! (-> s3-2 x) (* (-> s3-2 x) f30-0)) @@ -2311,11 +2311,11 @@ ((logtest? (-> arg1 class flags) (minimap-flag trail)) (cond (*trail-graph* - (let ((a2-2 (get-trail-for-connection obj arg1 #f))) + (let ((a2-2 (get-trail-for-connection this arg1 #f))) (cond ((not a2-2) (when (!= (-> arg1 alpha) 0.0) - (when (not (get-trail-for-connection obj arg1 #t)) + (when (not (get-trail-for-connection this arg1 #t)) (let ((s2-1 (the-as connection-pers (-> *minimap* engine alive-list)))) (while s2-1 (let ((a1-12 s2-1)) @@ -2435,18 +2435,18 @@ (set! s2-0 #t) ) (if (logtest? (-> arg1 class flags) (minimap-flag goal)) - (set! (-> arg1 class icon-xy x) (the-as uint (mod (the int (-> obj goal-time)) 6))) + (set! (-> arg1 class icon-xy x) (the-as uint (mod (the int (-> this goal-time)) 6))) ) (when (not s2-0) (vector-matrix*! s3-2 s3-2 (-> arg0 mat)) (let ((v1-115 (the-as object (-> arg0 buf base)))) (let* ((f0-48 (-> arg1 class scale)) (a1-25 (-> arg1 class color)) - (a1-32 (copy-and-set-field a1-25 r (shr (* (-> a1-25 r) (the-as uint (-> obj color x))) 7))) - (a1-39 (copy-and-set-field a1-32 g (shr (* (-> a1-32 g) (the-as uint (-> obj color y))) 7))) + (a1-32 (copy-and-set-field a1-25 r (shr (* (-> a1-25 r) (the-as uint (-> this color x))) 7))) + (a1-39 (copy-and-set-field a1-32 g (shr (* (-> a1-32 g) (the-as uint (-> this color y))) 7))) (a0-70 (copy-and-set-field - (copy-and-set-field a1-39 b (shr (* (-> a1-39 b) (the-as uint (-> obj color z))) 7)) + (copy-and-set-field a1-39 b (shr (* (-> a1-39 b) (the-as uint (-> this color z))) 7)) a (the int (* 128.0 (-> arg1 alpha))) ) @@ -2474,8 +2474,8 @@ (a1-61 (+ a3-1 312)) (a2-14 (+ t0-1 312)) ) - (set! (-> (the-as (pointer uint128) v1-115)) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-115) 1) (-> obj sprite-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) v1-115)) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-115) 1) (-> this sprite-tmpl quad 1)) (set-vector! (-> (the-as (inline-array vector4w) v1-115) 2) (the-as int (-> a0-70 r)) @@ -2509,23 +2509,23 @@ (none) ) -(defmethod draw-1 minimap ((obj minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) +(defmethod draw-1 minimap ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) (local-vars (v1-19 uint128)) (when (= (level-status *level* 'ctywide) 'active) (let ((s5-1 (new 'stack-no-clear 'minimap-draw-work))) (set! (-> s5-1 buf) arg0) (set! (-> s5-1 draw-pos quad) (-> arg1 quad)) (set! (-> s5-1 justify-right) arg2) - (sub-draw-1-1 obj s5-1) - (sub-draw-1-2 obj s5-1) - (set! (-> obj ctywide) (level-get *level* 'ctywide)) + (sub-draw-1-1 this s5-1) + (sub-draw-1-2 this s5-1) + (set! (-> this ctywide) (level-get *level* 'ctywide)) (let ((s2-1 (-> s5-1 buf base)) (s4-1 (lookup-texture-by-id-fast (new 'static 'texture-id :page #x679))) ) - (let ((s3-1 (-> obj ctywide texture-mask 8))) + (let ((s3-1 (-> this ctywide texture-mask 8))) (when s4-1 - (set! (-> (the-as (pointer uint128) s2-1)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s2-1) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s2-1)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s2-1) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s2-1 32)) s4-1) (&+! (-> s5-1 buf base) 112) (let ((v1-18 (-> s3-1 mask quad)) @@ -2543,13 +2543,13 @@ (let ((s4-2 (the-as connection-pers (-> *minimap* engine alive-list)))) (while s4-2 (let ((a2-1 s4-2)) - (draw-connection obj s5-1 (the-as connection-minimap a2-1)) + (draw-connection this s5-1 (the-as connection-minimap a2-1)) ) (set! s4-2 (-> s4-2 next)) ) ) (if (not (paused?)) - (+! (-> obj goal-time) (* 14.0 (seconds-per-frame))) + (+! (-> this goal-time) (* 14.0 (seconds-per-frame))) ) (reset-display-gs-state *display* (-> s5-1 buf)) ) @@ -2558,20 +2558,20 @@ (none) ) -(defmethod draw-sprite2 minimap ((obj minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) +(defmethod draw-sprite2 minimap ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) (local-vars (v1-24 uint128) (a0-8 uint128) (a3-5 int) (t0-4 int)) - (when (-> obj race-tex) + (when (-> this race-tex) (let ((s5-0 (new 'stack-no-clear 'minimap-draw-work))) (set! (-> s5-0 buf) arg0) (set! (-> s5-0 draw-pos quad) (-> arg1 quad)) (set! (-> s5-0 justify-right) arg2) (let ((v1-4 (-> s5-0 buf base)) - (s3-0 (-> obj race-tex)) - (s2-0 (-> obj race-level texture-mask 8)) + (s3-0 (-> this race-tex)) + (s2-0 (-> this race-level texture-mask 8)) ) (when s3-0 - (set! (-> (the-as (pointer uint128) v1-4)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-4) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) v1-4)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-4) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ v1-4 32)) s3-0) (&+! (-> s5-0 buf base) 112) (let ((v1-8 (-> s2-0 mask quad)) @@ -2604,9 +2604,9 @@ ) (set! (-> s5-0 draw-pos x) a3-5) (set! (-> s5-0 draw-pos y) a2-1) - (set! (-> (the-as (pointer uint128) v1-10)) (-> obj sprite2-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-10) 1) (-> obj sprite2-tmpl quad 1)) - (let ((t1-5 (-> obj color quad))) + (set! (-> (the-as (pointer uint128) v1-10)) (-> this sprite2-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-10) 1) (-> this sprite2-tmpl quad 1)) + (let ((t1-5 (-> this color quad))) (set! (-> (the-as (pointer uint128) (&+ (the-as pointer v1-10) 32))) t1-5) ) (cond @@ -2628,11 +2628,11 @@ (&+! (-> arg0 base) 112) (let ((s2-1 (-> s5-0 buf base)) (s4-1 (lookup-texture-by-id-fast (new 'static 'texture-id :index #x42 :page #xb))) - (s3-1 (-> obj ctywide texture-mask 8)) + (s3-1 (-> this ctywide texture-mask 8)) ) (when s4-1 - (set! (-> (the-as (pointer uint128) s2-1)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s2-1) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s2-1)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s2-1) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s2-1 32)) s4-1) (&+! (-> s5-0 buf base) 112) (let ((v1-23 (-> s3-1 mask quad)) @@ -2653,7 +2653,7 @@ (when (logtest? (-> (the-as connection-minimap s2-2) class flags) (minimap-flag racer)) (if (string= (the-as string (-> (the-as connection-minimap s2-2) class name)) "racer-target") (set! s4-2 s2-2) - (draw-racer-1 obj s5-0 (the-as connection-minimap s2-2) (-> obj race-scale) f30-0 f28-0) + (draw-racer-1 this s5-0 (the-as connection-minimap s2-2) (-> this race-scale) f30-0 f28-0) ) ) ) @@ -2661,7 +2661,7 @@ ) ) (if s4-2 - (draw-racer-1 obj s5-0 (the-as connection-minimap s4-2) (-> obj race-scale) f30-0 f28-0) + (draw-racer-1 this s5-0 (the-as connection-minimap s4-2) (-> this race-scale) f30-0 f28-0) ) ) ) @@ -2670,23 +2670,23 @@ (none) ) -(defmethod set-race-texture minimap ((obj minimap) (arg0 texture) (arg1 float) (arg2 level)) - (set! (-> obj race-tex) arg0) - (set! (-> obj race-scale) arg1) - (set! (-> obj race-level) arg2) +(defmethod set-race-texture minimap ((this minimap) (arg0 texture) (arg1 float) (arg2 level)) + (set! (-> this race-tex) arg0) + (set! (-> this race-scale) arg1) + (set! (-> this race-level) arg2) 0 (none) ) -(defmethod set-race-corner minimap ((obj minimap) (arg0 float) (arg1 float)) - (set! (-> obj race-corner x) arg0) - (set! (-> obj race-corner z) arg1) +(defmethod set-race-corner minimap ((this minimap) (arg0 float) (arg1 float)) + (set! (-> this race-corner x) arg0) + (set! (-> this race-corner z) arg1) 0 (none) ) -(defmethod set-color minimap ((obj minimap) (arg0 vector)) - (set! (-> obj color quad) (-> arg0 quad)) +(defmethod set-color minimap ((this minimap) (arg0 vector)) + (set! (-> this color quad) (-> arg0 quad)) 0 (none) ) diff --git a/goal_src/jak2/engine/ui/progress/progress-draw.gc b/goal_src/jak2/engine/ui/progress/progress-draw.gc index c883fffeb2..0d5fbd6a9f 100644 --- a/goal_src/jak2/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak2/engine/ui/progress/progress-draw.gc @@ -627,16 +627,16 @@ (the-as pointer 0) ) -(defmethod draw-option menu-option ((obj menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-option ((this menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) 0 (none) ) -(defmethod draw-option menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-on-off-option ((this menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-8 string) (sv-16 string)) (let ((s3-0 (if arg3 (&-> *progress-state* on-off-choice) - (-> obj value-to-modify) + (-> this value-to-modify) ) ) ) @@ -647,7 +647,7 @@ (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress-force-selected)) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond ((-> s3-0 0) @@ -676,7 +676,7 @@ (s1-2 (clear *temp-string*)) (s0-2 "~S: ~S") ) - (set! sv-16 (lookup-text! *common-text* (-> obj name) #f)) + (set! sv-16 (lookup-text! *common-text* (-> this name) #f)) (let ((a3-4 (if (-> s3-0 0) (lookup-text! *common-text* (text-id progress-on) #f) (lookup-text! *common-text* (text-id progress-off) #f) @@ -691,12 +691,12 @@ ) ) ) - (print-menu-text a0-8 (-> obj scale) arg1 arg0) + (print-menu-text a0-8 (-> this scale) arg1 arg0) 0 (none) ) -(defmethod draw-option menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-yes-no-option ((this menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-8 string)) (let ((s3-0 (&-> *progress-state* yes-no-choice))) (set! a0-8 @@ -706,7 +706,7 @@ (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress-force-selected)) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond ((-> s3-0 0) @@ -731,18 +731,18 @@ a0-8 ) (else - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) *temp-string* ) ) ) ) - (print-menu-text a0-8 (-> obj scale) arg1 arg0) + (print-menu-text a0-8 (-> this scale) arg1 arg0) 0 (none) ) -(defmethod draw-option menu-video-mode-option ((obj menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-video-mode-option ((this menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((s3-0 (&-> *progress-state* video-mode-choice)) (f28-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (f30-0 (-> arg1 origin y)) @@ -772,7 +772,7 @@ (set! (-> a0-6 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 44 f28-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 20.0) (cond ((= (-> s3-0 0) 'pal) @@ -814,7 +814,7 @@ ) ) (+! (-> arg1 origin y) -8.0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 20.0) (cond ((= (-> s3-0 0) 'pal) @@ -843,7 +843,7 @@ (-> *progress-state* graphic-options-item-picked) ) ) - (print-menu-text s2-0 (-> obj scale) arg1 arg0) + (print-menu-text s2-0 (-> this scale) arg1 arg0) ) ) (set! (-> arg1 origin y) f30-0) @@ -852,7 +852,7 @@ (none) ) -(defmethod draw-option menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-unlocked-menu-option ((this menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((s5-0 (memcard-unlocked-secrets? #t)) (f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) ) @@ -862,7 +862,7 @@ (let ((v1-4 arg1)) (set! (-> v1-4 scale) 0.6) ) - (when (nonzero? (-> obj name)) + (when (nonzero? (-> this name)) (cond ((= arg2 (-> arg0 option-index)) (progress-selected 0) @@ -874,7 +874,7 @@ ) (+! (-> arg1 origin y) 8.0) (cond - ((= (-> obj name) (text-id progress-main-secrets-scrapbook)) + ((= (-> this name) (text-id progress-main-secrets-scrapbook)) (cond ((logtest? s5-0 (game-secrets scrap-book-1)) (print-game-text @@ -893,7 +893,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-mega-scrapbook)) + ((= (-> this name) (text-id progress-main-secrets-mega-scrapbook)) (cond ((logtest? s5-0 (game-secrets scrap-book-2)) (print-game-text @@ -912,7 +912,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-scrapbook-3)) + ((= (-> this name) (text-id progress-main-secrets-scrapbook-3)) (cond ((logtest? s5-0 (game-secrets scrap-book-3)) (print-game-text @@ -931,7 +931,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-sceneplayer-1)) + ((= (-> this name) (text-id progress-main-secrets-sceneplayer-1)) (cond ((logtest? s5-0 (game-secrets scene-player-1)) (print-game-text @@ -950,7 +950,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-sceneplayer-2)) + ((= (-> this name) (text-id progress-main-secrets-sceneplayer-2)) (cond ((logtest? s5-0 (game-secrets scene-player-2)) (print-game-text @@ -969,7 +969,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-sceneplayer-3)) + ((= (-> this name) (text-id progress-main-secrets-sceneplayer-3)) (cond ((logtest? s5-0 (game-secrets scene-player-3)) (print-game-text @@ -988,7 +988,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-hero-mode)) + ((= (-> this name) (text-id progress-main-secrets-hero-mode)) (cond ((logtest? s5-0 (game-secrets hero-mode)) (print-game-text @@ -1007,7 +1007,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-levelselect)) + ((= (-> this name) (text-id progress-main-secrets-levelselect)) (cond ((logtest? s5-0 (game-secrets level-select)) (print-game-text @@ -1033,10 +1033,10 @@ (none) ) -(defmethod draw-option menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-main-menu-option ((this menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (-> arg1 flags) (when (and (= (-> arg0 menu-transition) 0.0) (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) - (nonzero? (-> obj name)) + (nonzero? (-> this name)) (= arg2 (-> arg0 option-index)) ) ) @@ -1074,11 +1074,11 @@ (*! (-> arg1 width) (-> *pc-settings* aspect-ratio-reciprocal)) )) (cond - ((= (-> obj name) (text-id progress-root-show-map)) + ((= (-> this name) (text-id progress-root-show-map)) (when (= (-> *setting-control* user-default language) (language-enum french)) (set-scale! arg1 0.7) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (set! (-> arg1 origin y) (the float (if (= (get-aspect-ratio) 'aspect4x3) 210 200 @@ -1272,7 +1272,7 @@ ) ) (else - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) ) ) @@ -1949,7 +1949,7 @@ ) ) -(defmethod draw-option menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-memcard-slot-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (v0-74 pointer) (sv-16 float) @@ -2035,7 +2035,7 @@ ) ) ) - (set-vector! (-> obj box 0 color) 64 128 128 (the int (* 128.0 sv-16))) + (set-vector! (-> this box 0 color) 64 128 128 (the int (* 128.0 sv-16))) (when (= arg2 sv-20) (cond ((!= *save-options-title* (-> arg0 current-options)) @@ -2048,7 +2048,7 @@ ) ) (draw-savegame-box - obj + this (the float sv-64) (the float (+ sv-64 sv-80)) (the float (+ sv-72 (* sv-88 arg2))) @@ -2056,14 +2056,14 @@ ) (when (!= arg2 3) (draw-savegame-box - obj + this (the float sv-64) (the float (+ sv-64 sv-80)) (the float (+ sv-72 sv-88 (* sv-88 arg2))) (the float (+ sv-72 sv-88 (* sv-88 arg2))) ) (draw-savegame-box - obj + this (the float (+ sv-64 sv-80)) (the float (+ sv-64 sv-80)) (the float (+ sv-72 sv-88 (* sv-88 arg2))) @@ -2071,7 +2071,7 @@ ) ) (draw-savegame-box - obj + this (the float (+ sv-64 sv-80)) (the float (+ sv-64 sv-80)) (the float sv-72) @@ -2099,7 +2099,7 @@ (set! sv-80 166) (set! sv-88 42) (draw-savegame-box - obj + this (the float (+ sv-64 sv-80)) (the float (+ sv-64 sv-80)) (the float (+ sv-72 sv-88 (* sv-88 arg2))) @@ -2108,7 +2108,7 @@ ) ) (draw-savegame-box - obj + this (the float sv-64) (the float (+ sv-64 sv-80)) (the float (+ sv-72 (* sv-88 arg2))) @@ -2116,14 +2116,14 @@ ) (when (!= arg2 4) (draw-savegame-box - obj + this (the float sv-64) (the float (+ sv-64 sv-80)) (the float (+ sv-72 sv-88 (* sv-88 arg2))) (the float (+ sv-72 sv-88 (* sv-88 arg2))) ) (draw-savegame-box - obj + this (the float (+ sv-64 sv-80)) (the float (+ sv-64 sv-80)) (the float (+ sv-72 sv-88 (* sv-88 arg2))) @@ -2131,7 +2131,7 @@ ) ) (draw-savegame-box - obj + this (the float (+ sv-64 sv-80)) (the float (+ sv-64 sv-80)) (the float sv-72) @@ -2201,67 +2201,67 @@ (set! (-> arg1 height) 190.0) (let ((s2-8 (-> *progress-save-info* file arg2 level-index))) (when (= arg2 sv-20) - (let ((v1-199 (-> obj sprites 0 color2))) + (let ((v1-199 (-> this sprites 0 color2))) (set! (-> v1-199 0) 128) (set! (-> v1-199 1) 128) (set! (-> v1-199 2) 128) (set! (-> v1-199 3) (the int (* 128.0 sv-16))) ) - (let ((v1-200 (-> obj sprites 1 color2))) + (let ((v1-200 (-> this sprites 1 color2))) (set! (-> v1-200 0) 128) (set! (-> v1-200 1) 128) (set! (-> v1-200 2) 128) (set! (-> v1-200 3) (the int (* 128.0 sv-16))) ) - (set! (-> obj sprites 1 pos z) #xffffff) - (set! (-> obj sprites 1 pos w) 1) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 s2-8))) - (set! (-> obj sprites 1 scale-x) 1.0) - (set! (-> obj sprites 1 scale-y) 1.0) - (set-hud-piece-position! (-> obj sprites 1) sv-40 sv-48) - (let ((v1-205 (-> obj sprites 2 color2))) + (set! (-> this sprites 1 pos z) #xffffff) + (set! (-> this sprites 1 pos w) 1) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 s2-8))) + (set! (-> this sprites 1 scale-x) 1.0) + (set! (-> this sprites 1 scale-y) 1.0) + (set-hud-piece-position! (-> this sprites 1) sv-40 sv-48) + (let ((v1-205 (-> this sprites 2 color2))) (set! (-> v1-205 0) 128) (set! (-> v1-205 1) 128) (set! (-> v1-205 2) 128) (set! (-> v1-205 3) (the int (* 128.0 sv-16))) ) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 2 pos w) 1) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 s2-8))) - (set! (-> obj sprites 2 scale-x) 1.0) - (set! (-> obj sprites 2 scale-y) 1.0) - (set-hud-piece-position! (-> obj sprites 2) (+ sv-40 sv-56) sv-48) - (let ((v1-211 (-> obj sprites 3 color2))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 2 pos w) 1) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 s2-8))) + (set! (-> this sprites 2 scale-x) 1.0) + (set! (-> this sprites 2 scale-y) 1.0) + (set-hud-piece-position! (-> this sprites 2) (+ sv-40 sv-56) sv-48) + (let ((v1-211 (-> this sprites 3 color2))) (set! (-> v1-211 0) 128) (set! (-> v1-211 1) 128) (set! (-> v1-211 2) 128) (set! (-> v1-211 3) (the int (* 128.0 sv-16))) ) - (set! (-> obj sprites 3 pos z) #xffffff) - (set! (-> obj sprites 3 pos w) 1) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 s2-8))) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.0) - (set-hud-piece-position! (-> obj sprites 3) sv-40 (+ sv-48 64)) - (let ((v1-217 (-> obj sprites 4 color2))) + (set! (-> this sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 pos w) 1) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 s2-8))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set-hud-piece-position! (-> this sprites 3) sv-40 (+ sv-48 64)) + (let ((v1-217 (-> this sprites 4 color2))) (set! (-> v1-217 0) 128) (set! (-> v1-217 1) 128) (set! (-> v1-217 2) 128) (set! (-> v1-217 3) (the int (* 128.0 sv-16))) ) - (set! (-> obj sprites 4 pos z) #xffffff) - (set! (-> obj sprites 4 pos w) 1) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 s2-8))) - (set! (-> obj sprites 4 scale-x) 1.0) - (set! (-> obj sprites 4 scale-y) 1.0) - (set-hud-piece-position! (-> obj sprites 4) (+ sv-40 sv-56) (+ sv-48 64)) + (set! (-> this sprites 4 pos z) #xffffff) + (set! (-> this sprites 4 pos w) 1) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 s2-8))) + (set! (-> this sprites 4 scale-x) 1.0) + (set! (-> this sprites 4 scale-y) 1.0) + (set-hud-piece-position! (-> this sprites 4) (+ sv-40 sv-56) (+ sv-48 64)) (with-dma-buffer-add-bucket ((s1-7 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (draw (-> obj sprites 1) s1-7 (-> *level* default-level)) - (draw (-> obj sprites 2) s1-7 (-> *level* default-level)) - (draw (-> obj sprites 3) s1-7 (-> *level* default-level)) - (draw (-> obj sprites 4) s1-7 (-> *level* default-level)) + (draw (-> this sprites 1) s1-7 (-> *level* default-level)) + (draw (-> this sprites 2) s1-7 (-> *level* default-level)) + (draw (-> this sprites 3) s1-7 (-> *level* default-level)) + (draw (-> this sprites 4) s1-7 (-> *level* default-level)) ) (let ((v1-245 arg1)) (set! (-> v1-245 scale) 0.6) @@ -2270,14 +2270,14 @@ (set! (-> arg1 origin y) 263.0) (set! (-> arg1 width) 170.0) (set! (-> arg1 height) 52.0) - (set! (-> obj sprites 0 scale-x) 0.7) - (set! (-> obj sprites 0 scale-y) 0.7) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xc93))) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 265 263) + (set! (-> this sprites 0 scale-x) 0.7) + (set! (-> this sprites 0 scale-y) 0.7) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 265 263) (with-dma-buffer-add-bucket ((s1-8 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-8 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s1-8 (-> *level* default-level)) ) (+! (-> arg1 origin y) 1.0) (+! (-> arg1 origin x) 28.0) @@ -2291,38 +2291,38 @@ (s1-9 *temp-string* arg1 #f 44 (bucket-id progress)) ) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #xc93))) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 368 263) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 368 263) (with-dma-buffer-add-bucket ((s1-10 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-10 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s1-10 (-> *level* default-level)) ) (+! (-> arg1 origin x) 100.0) (let ((s2-13 print-game-text)) (format (clear *temp-string*) "~D%" (the int (-> *progress-save-info* file arg2 completion-percentage))) (s2-13 *temp-string* arg1 #f 44 (bucket-id progress)) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 368 289) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 368 289) (with-dma-buffer-add-bucket ((s1-12 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-12 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s1-12 (-> *level* default-level)) ) (+! (-> arg1 origin y) 28.0) (let ((s2-15 print-game-text)) (format (clear *temp-string*) "~D" (the int (-> *progress-save-info* file arg2 skill-count))) (s2-15 *temp-string* arg1 #f 44 (bucket-id progress)) ) - (set! (-> obj sprites 0 scale-x) 0.6) - (set! (-> obj sprites 0 scale-y) 0.6) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x82 :page #xc93))) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 253 290) + (set! (-> this sprites 0 scale-x) 0.6) + (set! (-> this sprites 0 scale-y) 0.6) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x82 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 253 290) (with-dma-buffer-add-bucket ((s1-14 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-14 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s1-14 (-> *level* default-level)) ) (+! (-> arg1 origin x) -100.0) (let ((s2-17 print-game-text)) @@ -2372,7 +2372,7 @@ (set! (-> arg1 width) sv-32) (set! (-> arg1 height) sv-36) (if (zero? arg2) - (draw-decoration-load-save obj arg1 sv-16 (if (= (-> arg0 current) 'select-load) + (draw-decoration-load-save this arg1 sv-16 (if (= (-> arg0 current) 'select-load) (text-id progress-select-file-to-load) (text-id progress-select-file-to-save) ) @@ -2385,7 +2385,7 @@ (none) ) -(defmethod draw-option menu-loading-option ((obj menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-loading-option ((this menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-3 arg1)) @@ -2440,7 +2440,7 @@ (none) ) -(defmethod draw-option menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-insufficient-space-option ((this menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (when (!= (-> arg0 current) 'none) (let ((v1-3 arg1)) @@ -2531,7 +2531,7 @@ (none) ) -(defmethod draw-option menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-secrets-insufficient-space-option ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2576,7 +2576,7 @@ (none) ) -(defmethod draw-option menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-insert-card-option ((this menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2622,7 +2622,7 @@ (none) ) -(defmethod draw-option menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-error-loading-option ((this menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2689,7 +2689,7 @@ (none) ) -(defmethod draw-option menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-error-auto-saving-option ((this menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2764,7 +2764,7 @@ (none) ) -(defmethod draw-option menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-card-removed-option ((this menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2825,7 +2825,7 @@ (none) ) -(defmethod draw-option menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-error-disc-removed-option ((this menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -2883,7 +2883,7 @@ (none) ) -(defmethod draw-option menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-error-reading-option ((this menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -2939,7 +2939,7 @@ (none) ) -(defmethod draw-option menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-icon-info-option ((this menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -2948,22 +2948,22 @@ (set! (-> v1-2 scale) 0.5) ) (set! (-> *bigmap* auto-save-icon-flag) #t) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x48 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (let ((v1-6 (-> obj sprites 0 color2))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x48 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (let ((v1-6 (-> this sprites 0 color2))) (set! (-> v1-6 0) 128) (set! (-> v1-6 1) 128) (set! (-> v1-6 2) 128) (set! (-> v1-6 3) (the int (* 128.0 (- 1.0 (-> arg0 menu-transition))))) ) - (set! (-> obj sprites 0 pos z) #xffffff) - (set! (-> obj sprites 0 pos w) 0) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 240 160) + (set! (-> this sprites 0 pos z) #xffffff) + (set! (-> this sprites 0 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 240 160) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s3-0 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s3-0 (-> *level* default-level)) ) (let ((a0-16 arg1)) (set! (-> a0-16 flags) (font-flags kerning middle middle-vert large)) @@ -3013,7 +3013,7 @@ (none) ) -(defmethod draw-option menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-format-card-option ((this menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3056,7 +3056,7 @@ (none) ) -(defmethod draw-option menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-already-exists-option ((this menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3093,7 +3093,7 @@ (none) ) -(defmethod draw-option menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-create-game-option ((this menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3127,7 +3127,7 @@ (none) ) -(defmethod draw-option menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-video-mode-warning-option ((this menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3182,7 +3182,7 @@ (none) ) -(defmethod draw-option menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-video-mode-ok-option ((this menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3219,7 +3219,7 @@ (none) ) -(defmethod draw-option menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-progressive-mode-warning-option ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.5) @@ -3274,7 +3274,7 @@ (none) ) -(defmethod draw-option menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-progressive-mode-ok-option ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.55) @@ -3311,7 +3311,7 @@ (none) ) -(defmethod draw-option menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-quit-option ((this menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (set-color! arg1 (font-color progress)) (set-scale! arg1 0.55) @@ -3341,7 +3341,7 @@ (defglobalconstant COMPACT_SELECT_START #f) ;; WARN: disable def twice: 147. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod draw-option menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-select-start-option ((this menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-48 int) (sv-64 int) @@ -3351,7 +3351,7 @@ (sv-128 hud-box) ) (let* ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) - (s3-0 (-> obj task-index)) + (s3-0 (-> this task-index)) (s2-0 0) (s1-0 (#if COMPACT_SELECT_START 25 50)) (f28-0 (* (-> arg0 sliding-height) (the float s1-0))) @@ -3390,8 +3390,8 @@ (if (or (= (-> *setting-control* user-default language) (language-enum french)) (= (-> *setting-control* user-default language) (language-enum spanish)) ) - (draw-decoration obj arg1 f30-0 (the-as text-id a3-1) #t 0.7) - (draw-decoration obj arg1 f30-0 (the-as text-id a3-1) #t 0.95) + (draw-decoration this arg1 f30-0 (the-as text-id a3-1) #t 0.7) + (draw-decoration this arg1 f30-0 (the-as text-id a3-1) #t 0.95) ) ) (begin-scissor-level sv-128) @@ -3446,7 +3446,7 @@ (set! sv-80 (-> *game-info* play-list sv-64)) (cond ((zero? s2-0) - (set! (-> obj real-task-index) sv-64) + (set! (-> this real-task-index) sv-64) (set! sv-96 arg1) (set! (-> sv-96 color) (progress-selected 0)) ;; og:preserve-this added this check here so we dont double-draw the highlight @@ -3483,10 +3483,10 @@ (none) ) -(defmethod draw-option menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-select-scene-option ((this menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-48 int)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) - (s4-0 (-> obj task-index)) + (s4-0 (-> this task-index)) (s3-0 0) (s2-0 *hud-select-scene-act1*) ) @@ -3527,8 +3527,8 @@ (if (or (= (-> *setting-control* user-default language) (language-enum french)) (= (-> *setting-control* user-default language) (language-enum spanish)) ) - (draw-decoration obj arg1 f30-0 (text-id progress-select-scene) #t 0.7) - (draw-decoration obj arg1 f30-0 (text-id progress-select-scene) #t 0.95) + (draw-decoration this arg1 f30-0 (text-id progress-select-scene) #t 0.7) + (draw-decoration this arg1 f30-0 (text-id progress-select-scene) #t 0.95) ) (begin-scissor-scene s1-0) (set-scale! arg1 0.5) @@ -3580,7 +3580,7 @@ (none) ) -(defmethod draw-option menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-bigmap-option ((this menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) 0 (none) ) @@ -3721,7 +3721,7 @@ ) ) -(defmethod draw-option menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-missions-option ((this menu-missions-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (f0-50 float) (sv-16 float) @@ -3796,13 +3796,13 @@ (let ((a0-21 arg1)) (set! (-> a0-21 color) (font-color progress)) ) - (let ((v1-40 (-> obj page-index))) + (let ((v1-40 (-> this page-index))) (cond ((zero? v1-40) - (draw-missions-decoration obj arg1 sv-16 (text-id progress-root-missions)) + (draw-missions-decoration this arg1 sv-16 (text-id progress-root-missions)) ) ((= v1-40 1) - (draw-missions-decoration obj arg1 sv-16 (text-id progress-root-missions)) + (draw-missions-decoration this arg1 sv-16 (text-id progress-root-missions)) ) ) ) @@ -3822,8 +3822,8 @@ (let ((v1-52 arg1)) (set! (-> v1-52 scale) sv-284) ) - (when (zero? (-> obj page-index)) - (set! sv-24 (-> obj task-line-index)) + (when (zero? (-> this page-index)) + (set! sv-24 (-> this task-line-index)) (set! sv-20 0) (let ((v1-57 (+ sv-56 44))) (set! sv-56 v1-57) @@ -4116,7 +4116,7 @@ (none) ) -(defmethod draw-option menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-secret-option ((this menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-16 float) (sv-20 symbol) @@ -4144,54 +4144,54 @@ (set! sv-48 arg0) (set! sv-96 (if (not sv-20) 0 - (-> obj num-items) + (-> this num-items) ) ) (set! sv-104 (if (not sv-20) - (-> obj num-items) - (+ (-> obj num-items) (-> obj num-hero-items)) + (-> this num-items) + (+ (-> this num-items) (-> this num-hero-items)) ) ) (set! sv-108 (* (-> sv-48 sliding) sv-36)) - (set! sv-112 (-> obj item-index)) - (set! sv-116 (-> obj prev-item-index)) + (set! sv-112 (-> this item-index)) + (set! sv-116 (-> this prev-item-index)) (set! sv-120 (new 'stack-no-clear 'hud-box)) (set! sv-128 205) (if (< sv-16 0.0) (set! sv-16 (the-as float 0.0)) ) (cond - ((or (not (-> *bigmap* progress-minimap)) (< (-> obj item-index) sv-96) (< sv-104 (-> obj item-index))) + ((or (not (-> *bigmap* progress-minimap)) (< (-> this item-index) sv-96) (< sv-104 (-> this item-index))) (draw-busy-loading arg1) ) (else (#when PC_PORT (if (not (-> *pc-settings* use-vis?)) (*! sv-32 (-> *pc-settings* aspect-ratio-reciprocal)))) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.64) - (set! (-> obj sprites 0 scale-y) 0.64) - (let ((v1-32 (-> obj sprites 0 color2))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.64) + (set! (-> this sprites 0 scale-y) 0.64) + (let ((v1-32 (-> this sprites 0 color2))) (set! (-> v1-32 0) 128) (set! (-> v1-32 1) 128) (set! (-> v1-32 2) 128) (set! (-> v1-32 3) (the int (* 128.0 sv-16))) ) - (set! (-> obj sprites 0 pos z) #xffffff) - (set! (-> obj sprites 0 pos w) 0) + (set! (-> this sprites 0 pos z) #xffffff) + (set! (-> this sprites 0 pos w) 0) (#cond (PC_PORT (if (not (-> *pc-settings* use-vis?)) - (set-hud-piece-position! (-> obj sprites 0) (adjust-game-x 100.0) 128) - (set-hud-piece-position! (-> obj sprites 0) 100 128))) + (set-hud-piece-position! (-> this sprites 0) (adjust-game-x 100.0) 128) + (set-hud-piece-position! (-> this sprites 0) 100 128))) (#t - (set-hud-piece-position! (-> obj sprites 0) 100 128)) + (set-hud-piece-position! (-> this sprites 0) 100 128)) ) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (draw (-> obj sprites 0) s3-0 (-> *level* default-level)) + (draw (-> this sprites 0) s3-0 (-> *level* default-level)) ) (set! (-> arg1 alpha) sv-16) (let ((a0-21 arg1)) @@ -4214,7 +4214,7 @@ (#when PC_PORT (if (not (-> *pc-settings* use-vis?)) (set! (-> arg1 origin x) (the float (adjust-game-x (-> arg1 origin x)))))) - (draw-decoration-secrets obj arg1 sv-16 (text-id progress-root-secrets)) + (draw-decoration-secrets this arg1 sv-16 (text-id progress-root-secrets)) (let ((v1-58 arg1)) (set! (-> v1-58 scale) 0.45) ) @@ -4268,67 +4268,67 @@ (cond (sv-40 (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) - (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + (draw-secret-list (-> this secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) ) ((>= (- sv-112 sv-116) 0) (when (>= (+ sv-112 -3) sv-96) (set! (-> arg1 origin y) (the float (+ (the int sv-108) -50 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 -3)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 -3)) sv-48 arg1 0 sv-40 sv-108) ) (when (>= (+ sv-112 -2) sv-96) (set! (-> arg1 origin y) (the float (+ (the int sv-108) -25 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) ) (set! (-> arg1 origin y) (the float (+ sv-128 (the int sv-108)))) (when (>= (+ sv-112 -1) sv-96) (draw-highlight (+ sv-128 22) 22 sv-16) - (draw-secret-list (-> obj secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) ) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) ;; og:preserve-this added check so we don't double-draw the highlight (when (< (+ sv-112 -1) sv-96) (draw-highlight (+ sv-128 22) 22 sv-16)) - (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + (draw-secret-list (-> this secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) (when (< (+ sv-112 1) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 50 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) ) (when (< (+ sv-112 2) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 75 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) ) (when (< (+ sv-112 3) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 100 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) ) ) (else (when (>= (+ sv-112 -2) sv-96) (set! (-> arg1 origin y) (the float (+ (the int sv-108) -25 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) ) (set! (-> arg1 origin y) (the float (+ sv-128 (the int sv-108)))) (if (>= (+ sv-112 -1) sv-96) - (draw-secret-list (-> obj secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) ) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) (draw-highlight (+ sv-128 22) 22 sv-16) - (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + (draw-secret-list (-> this secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) (when (< (+ sv-112 1) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 50 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) ) (when (< (+ sv-112 2) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 75 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) ) (when (< (+ sv-112 3) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 100 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) ) (when (< (+ sv-112 4) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 125 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 4)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 4)) sv-48 arg1 0 sv-40 sv-108) ) ) ) @@ -5152,7 +5152,7 @@ ) ) -(defmethod draw-option menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-highscores-option ((this menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-96 float) (sv-100 float) @@ -5175,12 +5175,12 @@ (set! sv-112 (new 'stack-no-clear 'hud-box)) (set! sv-116 (new 'stack 'print-highscore-obj)) (set! sv-120 (* (-> arg0 sliding) sv-104)) - (set! sv-124 (* (-> arg0 sliding-off) (-> obj slide-dir) sv-104)) + (set! sv-124 (* (-> arg0 sliding-off) (-> this slide-dir) sv-104)) (set! sv-128 arg3) (set! sv-132 arg2) (set! sv-136 arg0) (set! sv-140 arg1) - (set! sv-144 obj) + (set! sv-144 this) (if (< sv-96 0.0) (set! sv-96 (the-as float 0.0)) ) @@ -5455,7 +5455,7 @@ (none) ) -(defmethod draw-option menu-on-off-game-vibrations-option ((obj menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-on-off-game-vibrations-option ((this menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-10 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -5474,7 +5474,7 @@ (set! (-> a0-2 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond (s3-0 @@ -5512,7 +5512,7 @@ ) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond (s3-0 @@ -5538,12 +5538,12 @@ ) ) ) - (print-menu-text a0-10 (-> obj scale) arg1 arg0) + (print-menu-text a0-10 (-> this scale) arg1 arg0) 0 (none) ) -(defmethod draw-option menu-on-off-game-subtitles-option ((obj menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-on-off-game-subtitles-option ((this menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-11 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -5562,7 +5562,7 @@ (set! (-> a0-3 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond (s3-0 @@ -5600,7 +5600,7 @@ ) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond (s3-0 @@ -5626,12 +5626,12 @@ ) ) ) - (print-menu-text a0-11 (-> obj scale) arg1 arg0) + (print-menu-text a0-11 (-> this scale) arg1 arg0) 0 (none) ) -(defmethod draw-option menu-subtitle-language-game-option ((obj menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-subtitle-language-game-option ((this menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (with-pp (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (let ((v1-2 arg1)) @@ -5659,18 +5659,18 @@ (set! (-> a0-7 color) (font-color progress-force-selected)) ) (draw-highlight (the int (-> arg1 origin y)) 44 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 24.0) - (-> obj language-selection) + (-> this language-selection) (let ((s4-1 (-> s4-0 0))) 7 - (if (-> obj language-transition) - (seekl! (-> obj language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) + (if (-> this language-transition) + (seekl! (-> this language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) ) - (when (>= (-> obj language-x-offset) 75) - (set! (-> obj language-selection) (the-as uint s4-1)) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) + (when (>= (-> this language-x-offset) 75) + (set! (-> this language-selection) (the-as uint s4-1)) + (set! (-> this language-transition) #f) + (set! (-> this language-x-offset) 0) 0 ) ) @@ -5730,7 +5730,7 @@ (let ((v1-52 arg1)) (set! (-> v1-52 scale) 0.65) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (let ((v1-54 arg1)) (set! (-> v1-54 scale) 0.5) ) @@ -5764,7 +5764,7 @@ ) ) -(defmethod draw-option menu-language-game-option ((obj menu-language-game-option) +(defmethod draw-option menu-language-game-option ((this menu-language-game-option) (progress progress) (font-ctx font-context) (option-index int) @@ -5798,20 +5798,20 @@ ) (draw-highlight (the int (-> font-ctx origin y)) 44 alpha) (let ((print-game-text-fn-1 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) (print-game-text-fn-1 *temp-string* font-ctx #f 44 (bucket-id progress)) ) (+! (-> font-ctx origin y) 24.0) - (-> obj language-selection) + (-> this language-selection) (let ((curr-language (-> curr-language-ptr 0))) 7 - (if (-> obj language-transition) - (seekl! (-> obj language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) + (if (-> this language-transition) + (seekl! (-> this language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) ) - (when (>= (-> obj language-x-offset) 75) - (set! (-> obj language-selection) (the-as uint curr-language)) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) + (when (>= (-> this language-x-offset) 75) + (set! (-> this language-selection) (the-as uint curr-language)) + (set! (-> this language-transition) #f) + (set! (-> this language-x-offset) 0) 0 ) ) @@ -5873,7 +5873,7 @@ (set! (-> font-ctx-10 scale) 0.65) ) (let ((print-game-text-fn-4 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) (print-game-text-fn-4 *temp-string* font-ctx #f 44 (bucket-id progress)) ) (let ((font-ctx-11 font-ctx)) @@ -5916,7 +5916,7 @@ ) ) -(defmethod draw-option menu-sub-menu-game-option ((obj menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-sub-menu-game-option ((this menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) 395.0 (-> arg1 origin y) @@ -5929,15 +5929,15 @@ (set! (-> a1-1 flags) (font-flags kerning middle large)) ) (if (= (-> *setting-control* user-default language) (language-enum spanish)) - (draw-decoration obj arg1 f0-1 (text-id progress-root-game-options) #f 0.85) - (draw-decoration obj arg1 f0-1 (text-id progress-root-game-options) #f 0.95) + (draw-decoration this arg1 f0-1 (text-id progress-root-game-options) #f 0.85) + (draw-decoration this arg1 f0-1 (text-id progress-root-game-options) #f 0.95) ) ) 0 (none) ) -(defmethod draw-option menu-aspect-ratio-option ((obj menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-aspect-ratio-option ((this menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-12 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -5962,7 +5962,7 @@ (set! (-> a0-4 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 42 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 23.0) (cond ((= s3-0 'aspect4x3) @@ -6004,7 +6004,7 @@ ) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) (+! (-> arg1 origin y) 23.0) (cond @@ -6034,15 +6034,15 @@ (-> *progress-state* graphic-options-item-picked) ) ) - (print-menu-text a0-12 (-> obj scale) arg1 arg0) + (print-menu-text a0-12 (-> this scale) arg1 arg0) ) - (draw-decoration obj arg1 f30-0 (text-id progress-root-graphic-options) #f 0.95) + (draw-decoration this arg1 f30-0 (text-id progress-root-graphic-options) #f 0.95) ) 0 (none) ) -(defmethod draw-option menu-on-off-progressive-scan-graphic-option ((obj menu-on-off-progressive-scan-graphic-option) +(defmethod draw-option menu-on-off-progressive-scan-graphic-option ((this menu-on-off-progressive-scan-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) @@ -6069,7 +6069,7 @@ (set! (-> a0-3 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 42 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond (s3-0 @@ -6111,7 +6111,7 @@ ) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) (+! (-> arg1 origin y) 18.0) (cond @@ -6142,13 +6142,13 @@ (-> *progress-state* graphic-options-item-picked) ) ) - (print-menu-text a0-11 (-> obj scale) arg1 arg0) + (print-menu-text a0-11 (-> this scale) arg1 arg0) ) 0 (none) ) -(defmethod draw-option menu-center-screen-graphic-option ((obj menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-center-screen-graphic-option ((this menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) (set! f30-0 0.0) @@ -6245,7 +6245,7 @@ ) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) ) ) @@ -6253,7 +6253,7 @@ (none) ) -(defmethod draw-option menu-restart-mission-qr-option ((obj menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-restart-mission-qr-option ((this menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-11 string)) (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f0-1 0.0) @@ -6273,7 +6273,7 @@ (set! (-> a0-2 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 50 f0-1) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 25.0) (let ((v1-17 arg1)) (set! (-> v1-17 scale) 0.6) @@ -6304,7 +6304,7 @@ (if (and (= (-> arg0 option-index) arg2) (zero? (-> *progress-state* qr-options-item-selected))) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 26 f0-1) ) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) *temp-string* ) ) @@ -6316,7 +6316,7 @@ (none) ) -(defmethod draw-option menu-quit-qr-option ((obj menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-quit-qr-option ((this menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-12 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -6336,7 +6336,7 @@ (set! (-> a0-3 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 50 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 25.0) (let ((v1-18 arg1)) (set! (-> v1-18 scale) 0.6) @@ -6367,7 +6367,7 @@ (if (and (= (-> arg0 option-index) arg2) (= (-> *progress-state* qr-options-item-selected) 1)) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 26 f30-0) ) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) *temp-string* ) ) @@ -6376,13 +6376,13 @@ (print-game-text a0-12 arg1 #f 44 (bucket-id progress)) (cond ((= (-> *setting-control* user-default language) (language-enum french)) - (draw-decoration obj arg1 f30-0 (text-id progress-restart-quit) #f 0.8) + (draw-decoration this arg1 f30-0 (text-id progress-restart-quit) #f 0.8) ) ((= (-> *setting-control* user-default language) (language-enum german)) - (draw-decoration obj arg1 f30-0 (text-id progress-restart-quit) #f 0.7) + (draw-decoration this arg1 f30-0 (text-id progress-restart-quit) #f 0.7) ) (else - (draw-decoration obj arg1 f30-0 (text-id progress-restart-quit) #f 0.95) + (draw-decoration this arg1 f30-0 (text-id progress-restart-quit) #f 0.95) ) ) ) @@ -6390,7 +6390,7 @@ (none) ) -(defmethod draw-option menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-slider-option ((this menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (v0-42 pointer) (sv-16 progress) @@ -6492,14 +6492,14 @@ (set! (-> s5-0 origin x) (the float sv-48)) (cond (sv-32 - (set! sv-128 (-> obj value-to-modify)) + (set! sv-128 (-> this value-to-modify)) (+! (-> s5-0 origin y) -8.0) (let ((a0-12 s5-0)) (set! (-> a0-12 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> s5-0 origin y))) 52 f30-0) (set! sv-144 print-game-text) - (let ((a0-15 (lookup-text! *common-text* (-> obj name) #f)) + (let ((a0-15 (lookup-text! *common-text* (-> this name) #f)) (a1-3 s5-0) (a2-3 #f) (a3-1 44) @@ -6524,61 +6524,61 @@ (shr (shl (the int (* 128.0 f30-0)) 56) 32) ) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) - (set! (-> obj sprites 0 scale-x) f28-0) - (set! (-> obj sprites 0 scale-y) 0.7) - (let ((v1-57 (-> obj sprites 0 color2))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) + (set! (-> this sprites 0 scale-x) f28-0) + (set! (-> this sprites 0 scale-y) 0.7) + (let ((v1-57 (-> this sprites 0 color2))) (set! (-> v1-57 0) 128) (set! (-> v1-57 1) 128) (set! (-> v1-57 2) 128) (set! (-> v1-57 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 0 pos z) #x3fffff) - (set! (-> obj sprites 0 pos w) 0) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) - (set! (-> obj sprites 1 scale-x) 0.2) - (set! (-> obj sprites 1 scale-y) 1.33) - (let ((v1-62 (-> obj sprites 1 color2))) + (set! (-> this sprites 0 pos z) #x3fffff) + (set! (-> this sprites 0 pos w) 0) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) + (set! (-> this sprites 1 scale-x) 0.2) + (set! (-> this sprites 1 scale-y) 1.33) + (let ((v1-62 (-> this sprites 1 color2))) (set! (-> v1-62 0) 128) (set! (-> v1-62 1) 128) (set! (-> v1-62 2) 128) (set! (-> v1-62 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 1 pos z) #x3fffff) - (set! (-> obj sprites 1 pos w) 0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) - (set! (-> obj sprites 2 scale-x) 1.0) - (set! (-> obj sprites 2 scale-y) 1.0) - (let ((v1-67 (-> obj sprites 2 color2))) + (set! (-> this sprites 1 pos z) #x3fffff) + (set! (-> this sprites 1 pos w) 0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) + (set! (-> this sprites 2 scale-x) 1.0) + (set! (-> this sprites 2 scale-y) 1.0) + (let ((v1-67 (-> this sprites 2 color2))) (set! (-> v1-67 0) sv-80) (set! (-> v1-67 1) sv-96) (set! (-> v1-67 2) sv-112) (set! (-> v1-67 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 2 pos w) 0) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.0) - (let ((v1-72 (-> obj sprites 3 color2))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 2 pos w) 0) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (let ((v1-72 (-> this sprites 3 color2))) (set! (-> v1-72 0) sv-80) (set! (-> v1-72 1) sv-96) (set! (-> v1-72 2) sv-112) (set! (-> v1-72 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 3 pos z) #xffffff) - (set! (-> obj sprites 3 pos w) 0) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) + (set! (-> this sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) s1-0 s2-0) (set-hud-piece-position! - (-> obj sprites 1) + (-> this sprites 1) (+ s1-0 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) (+ s2-0 -4) ) - (set-hud-piece-position! (-> obj sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) - (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) + (set-hud-piece-position! (-> this sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) + (set-hud-piece-position! (-> this sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) (set! sv-176 (-> *display* frames (-> *display* on-screen) global-buf)) (set! sv-192 (-> sv-176 base)) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) sv-176 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) sv-176 (-> *level* default-level)) (draw-sprite2d-xy sv-176 (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) @@ -6587,9 +6587,9 @@ 9 (the-as rgba sv-160) ) - (draw (-> obj sprites 1) sv-176 (-> *level* default-level)) - (draw (-> obj sprites 2) sv-176 (-> *level* default-level)) - (draw (-> obj sprites 3) sv-176 (-> *level* default-level)) + (draw (-> this sprites 1) sv-176 (-> *level* default-level)) + (draw (-> this sprites 2) sv-176 (-> *level* default-level)) + (draw (-> this sprites 3) sv-176 (-> *level* default-level)) (let ((a3-6 (-> sv-176 base))) (let ((v1-100 (the-as object (-> sv-176 base)))) (set! (-> (the-as dma-packet v1-100) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -6617,7 +6617,7 @@ ) ) (else - (set! sv-208 (-> obj value-to-modify)) + (set! sv-208 (-> this value-to-modify)) (+! (-> s5-0 origin y) -8.0) (when (or (= (-> *setting-control* user-default language) (language-enum german)) (= (-> *setting-control* user-default language) (language-enum french)) @@ -6630,7 +6630,7 @@ (draw-highlight (the int (+ -2.0 (-> s5-0 origin y))) 24 f30-0) ) (set! sv-224 print-game-text) - (let ((a0-81 (lookup-text! *common-text* (-> obj name) #f)) + (let ((a0-81 (lookup-text! *common-text* (-> this name) #f)) (a1-21 s5-0) (a2-18 #f) (a3-8 44) @@ -6655,62 +6655,62 @@ (shr (shl (the int (* 128.0 f30-0)) 56) 32) ) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) - (set! (-> obj sprites 0 scale-x) f28-0) - (set! (-> obj sprites 0 scale-y) 0.7) - (let ((v1-140 (-> obj sprites 0 color2))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) + (set! (-> this sprites 0 scale-x) f28-0) + (set! (-> this sprites 0 scale-y) 0.7) + (let ((v1-140 (-> this sprites 0 color2))) (set! (-> v1-140 0) 128) (set! (-> v1-140 1) 128) (set! (-> v1-140 2) 128) (set! (-> v1-140 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 0 pos z) #x3fffff) - (set! (-> obj sprites 0 pos w) 0) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) - (set! (-> obj sprites 1 scale-x) 0.2) - (set! (-> obj sprites 1 scale-y) 1.33) - (let ((v1-145 (-> obj sprites 1 color2))) + (set! (-> this sprites 0 pos z) #x3fffff) + (set! (-> this sprites 0 pos w) 0) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) + (set! (-> this sprites 1 scale-x) 0.2) + (set! (-> this sprites 1 scale-y) 1.33) + (let ((v1-145 (-> this sprites 1 color2))) (set! (-> v1-145 0) 128) (set! (-> v1-145 1) 128) (set! (-> v1-145 2) 128) (set! (-> v1-145 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 1 pos z) #x3fffff) - (set! (-> obj sprites 1 pos w) 0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) - (set! (-> obj sprites 2 scale-x) 1.0) - (set! (-> obj sprites 2 scale-y) 1.0) - (let ((v1-150 (-> obj sprites 2 color2))) + (set! (-> this sprites 1 pos z) #x3fffff) + (set! (-> this sprites 1 pos w) 0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) + (set! (-> this sprites 2 scale-x) 1.0) + (set! (-> this sprites 2 scale-y) 1.0) + (let ((v1-150 (-> this sprites 2 color2))) (set! (-> v1-150 0) sv-80) (set! (-> v1-150 1) sv-96) (set! (-> v1-150 2) sv-112) (set! (-> v1-150 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 2 pos w) 0) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.0) - (let ((v1-155 (-> obj sprites 3 color2))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 2 pos w) 0) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (let ((v1-155 (-> this sprites 3 color2))) (set! (-> v1-155 0) sv-80) (set! (-> v1-155 1) sv-96) (set! (-> v1-155 2) sv-112) (set! (-> v1-155 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 3 pos z) #xffffff) - (set! (-> obj sprites 3 pos w) 0) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) + (set! (-> this sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) s1-0 s2-0) (set-hud-piece-position! - (-> obj sprites 1) + (-> this sprites 1) (+ s1-0 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) (+ s2-0 -4) ) - (set-hud-piece-position! (-> obj sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) - (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) + (set-hud-piece-position! (-> this sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) + (set-hud-piece-position! (-> this sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) (set! sv-256 (-> *display* frames (-> *display* on-screen) global-buf)) (set! sv-272 (-> sv-256 base)) ;; bar - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) sv-256 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) sv-256 (-> *level* default-level)) ;; bar background (draw-sprite2d-xy sv-256 @@ -6721,11 +6721,11 @@ (the-as rgba sv-240) ) ;; notch - (draw (-> obj sprites 1) sv-256 (-> *level* default-level)) + (draw (-> this sprites 1) sv-256 (-> *level* default-level)) ;; left icon - (draw (-> obj sprites 2) sv-256 (-> *level* default-level)) + (draw (-> this sprites 2) sv-256 (-> *level* default-level)) ;; right icon - (draw (-> obj sprites 3) sv-256 (-> *level* default-level)) + (draw (-> this sprites 3) sv-256 (-> *level* default-level)) (let ((a3-13 (-> sv-256 base))) (let ((v1-183 (the-as object (-> sv-256 base)))) (set! (-> (the-as dma-packet v1-183) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -6754,7 +6754,7 @@ ) ) (if (zero? gp-0) - (draw-sound-options-decoration obj s5-0 f30-0 (text-id progress-root-sound-options) #f) + (draw-sound-options-decoration this s5-0 f30-0 (text-id progress-root-sound-options) #f) ) ) ) @@ -6766,7 +6766,7 @@ (none) ) -(defmethod draw-option menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-stereo-mode-sound-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (s5-0 int)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (let ((v1-2 arg1)) @@ -6800,7 +6800,7 @@ ) (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 42 f30-0) (let ((s3-1 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) (s3-1 *temp-string* arg1 #f 44 (bucket-id progress)) ) (+! (-> arg1 origin y) 22.0) @@ -6847,7 +6847,7 @@ (set! (-> v1-37 scale) 0.65) ) (let ((s3-4 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) (s3-4 *temp-string* arg1 #f 44 (bucket-id progress)) ) (let ((v1-39 arg1)) @@ -6875,7 +6875,7 @@ ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 361] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 417] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 435] -(defmethod draw-option menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-sub-menu-option ((this menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-16 dma-buffer)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (s2-0 (the int (+ -1.0 (-> arg1 origin y)))) @@ -6912,7 +6912,7 @@ (+! s2-0 -28) ) ) - (when (nonzero? (-> obj name)) + (when (nonzero? (-> this name)) (let ((s0-0 arg1)) (set! (-> s0-0 color) (if (= arg2 (-> arg0 option-index)) (the-as font-color (the-as int (progress-selected 0))) @@ -6932,8 +6932,8 @@ ) ) ) - (if (and (and (= arg2 (-> arg0 option-index)) (!= 298 (-> obj name))) - (not (and (= (-> obj name) (text-id progress-root-secrets)) + (if (and (and (= arg2 (-> arg0 option-index)) (!= 298 (-> this name))) + (not (and (= (-> this name) (text-id progress-root-secrets)) (= *title* (-> arg0 current-options)) (not (memcard-unlocked-secrets? #f)) (= (-> arg0 option-index) 3) @@ -6945,7 +6945,7 @@ (cond ((= *save-options-title* (-> arg0 current-options)) (cond - ((= (-> obj name) (text-id progress-continue-without-saving)) + ((= (-> this name) (text-id progress-continue-without-saving)) (cond ((= arg2 (-> arg0 option-index)) (let ((v1-39 arg1)) @@ -6973,7 +6973,7 @@ ) ) (set! (-> arg1 height) 260.0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (when (= arg2 (-> arg0 option-index)) (let ((s4-1 69) (s2-4 110) @@ -7013,16 +7013,16 @@ ) ) ) - (set-vector! (-> obj box 0 color) 64 128 128 (the int (* 128.0 f30-0))) + (set-vector! (-> this box 0 color) 64 128 128 (the int (* 128.0 f30-0))) (draw-savegame-box - obj + this (the float s4-1) (the float (+ s4-1 s3-1)) (the float (+ s2-4 (* s1-1 arg2))) (the float (+ s2-4 (* s1-1 arg2))) ) (draw-savegame-box - obj + this (the float (+ s4-1 s3-1)) (the float (+ s4-1 s3-1)) (the float s2-4) @@ -7052,16 +7052,16 @@ ((= *load-save-options* (-> arg0 current-options)) (+! (-> arg1 origin x) -100.0) (+! (-> arg1 origin y) -25.0) - (print-menu-text (lookup-text! *common-text* (-> obj name) #f) (-> obj scale) arg1 arg0) + (print-menu-text (lookup-text! *common-text* (-> this name) #f) (-> this scale) arg1 arg0) ) ((and (= *title* (-> arg0 current-options)) - (= (text-id progress-root-secrets) (-> obj name)) + (= (text-id progress-root-secrets) (-> this name)) (memcard-unlocked-secrets? #f) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) - ((!= (-> obj name) (text-id progress-root-secrets)) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + ((!= (-> this name) (text-id progress-root-secrets)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) ) ) diff --git a/goal_src/jak2/engine/ui/progress/progress-h.gc b/goal_src/jak2/engine/ui/progress/progress-h.gc index 3233a9db78..81ba178c5a 100644 --- a/goal_src/jak2/engine/ui/progress/progress-h.gc +++ b/goal_src/jak2/engine/ui/progress/progress-h.gc @@ -340,8 +340,8 @@ (deftype menu-select-start-option (menu-option) - ((task-index int32 :offset-assert 48) - (real-task-index int32 :offset-assert 52) + ((task-index int32 :offset-assert 48) + (real-task-index int32 :offset-assert 52) (last-move time-frame :offset-assert 56) ) :method-count-assert 12 @@ -351,7 +351,7 @@ (deftype menu-select-scene-option (menu-option) - ((task-index int32 :offset-assert 48) + ((task-index int32 :offset-assert 48) (last-move time-frame :offset-assert 56) ) :method-count-assert 12 @@ -381,7 +381,7 @@ (deftype menu-missions-option (paged-menu-option) - ((task-line-index int32 :offset-assert 64) + ((task-line-index int32 :offset-assert 64) (last-move time-frame :offset-assert 72) ) :method-count-assert 12 @@ -391,7 +391,7 @@ (deftype menu-highscores-option (paged-menu-option) - ((last-move time-frame :offset-assert 64) + ((last-move time-frame :offset-assert 64) (sprites hud-sprite 2 :inline :offset 80) ) :method-count-assert 12 @@ -418,7 +418,7 @@ (num-items int32 :offset-assert 56) (num-hero-items int32 :offset-assert 60) (secret-items (array secret-item-option) :offset-assert 64) - (last-move time-frame :offset-assert 72) + (last-move time-frame :offset-assert 72) (sprites hud-sprite 2 :inline :offset 80) ) :method-count-assert 12 @@ -440,8 +440,8 @@ (deftype menu-qr-option (menu-option) - ((last-move time-frame :offset-assert 48) - (value-to-modify function :offset 60) + ((last-move time-frame :offset-assert 48) + (value-to-modify function :offset 60) ) :method-count-assert 12 :size-assert #x40 @@ -477,8 +477,8 @@ (deftype menu-graphic-option (menu-option) - ((last-move time-frame :offset-assert 48) - (value-to-modify pointer :offset 60) + ((last-move time-frame :offset-assert 48) + (value-to-modify pointer :offset 60) ) :method-count-assert 12 :size-assert #x40 @@ -520,8 +520,8 @@ (deftype menu-game-option (menu-option) - ((last-move time-frame :offset-assert 48) - (value-to-modify pointer :offset 60) + ((last-move time-frame :offset-assert 48) + (value-to-modify pointer :offset 60) ) :method-count-assert 12 :size-assert #x40 diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index e1ca9646e1..4ba6329a89 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -103,7 +103,7 @@ (set-master-mode 'game) 0) -(defmethod init-defaults progress ((obj progress)) +(defmethod init-defaults progress ((this progress)) "Initialize default menu settings." (set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio)) (set! (-> *progress-state* video-mode-choice) (get-video-mode)) @@ -131,10 +131,10 @@ (set! (-> *progress-state* total-num-tasks) 0) (set! (-> *progress-state* secrets-unlocked) #f) (set! (-> *progress-state* clear-screen) #f) - (set! (-> obj sliding) 0.0) - (set! (-> obj sliding-height) 0.0) - (set! (-> obj sliding-off) 1.0) - (set! (-> obj scanlines-alpha) 0.0) + (set! (-> this sliding) 0.0) + (set! (-> this sliding-height) 0.0) + (set! (-> this sliding-off) 1.0) + (set! (-> this scanlines-alpha) 0.0) (set! (-> (the-as menu-on-off-game-vibrations-option (-> *game-options* options 0)) value-to-modify) (&-> *setting-control* user-default vibration) ) @@ -462,7 +462,7 @@ (none) ) -(defmethod deactivate progress ((obj progress)) +(defmethod deactivate progress ((this progress)) (remove-setting-by-arg0 *setting-control* 'extra-bank) (disable-drawing *bigmap*) (set! (-> *blit-displays-work* menu-mode) #f) @@ -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)) obj) + ((the-as (function progress none) (find-parent-method progress 10)) this) (none) ) @@ -490,7 +490,7 @@ (none) ) -(defmethod gone? progress ((obj progress)) +(defmethod gone? progress ((this progress)) (and *progress-process* (-> *progress-process* 0 next-state) (= (-> *progress-process* 0 next-state name) 'gone) @@ -522,27 +522,27 @@ ) ) -(defmethod can-go-back? progress ((obj progress)) - (and (= (-> obj menu-transition) 0.0) - (not (-> obj selected-option)) - (!= (-> obj current) 'loading) - (!= (-> obj current) 'saving) - (!= (-> obj current) 'formatting) - (!= (-> obj current) 'creating) - (!= (-> obj current) 'error-disc-removed) - (!= (-> obj current) 'error-reading) - (!= (-> obj current) 'card-removed) - (!= (-> obj current) 'error-auto-saving) - (!= (-> obj current) 'title) - (!= (-> obj current) 'insufficient-space) - (!= (-> obj current) 'secrets-insufficient-space) - (!= (-> obj current) 'no-memory-card) - (!= (-> obj current) 'icon-info) - (!= (-> obj current) 'insert-card) - (!= (-> obj current) 'progressive-mode-ok) - (!= (-> obj current) 'video-mode-ok) - (!= (-> obj current) 'progressive-mode-warning) - (!= (-> obj current) 'video-mode-warning) +(defmethod can-go-back? progress ((this progress)) + (and (= (-> this menu-transition) 0.0) + (not (-> this selected-option)) + (!= (-> this current) 'loading) + (!= (-> this current) 'saving) + (!= (-> this current) 'formatting) + (!= (-> this current) 'creating) + (!= (-> this current) 'error-disc-removed) + (!= (-> this current) 'error-reading) + (!= (-> this current) 'card-removed) + (!= (-> this current) 'error-auto-saving) + (!= (-> this current) 'title) + (!= (-> this current) 'insufficient-space) + (!= (-> this current) 'secrets-insufficient-space) + (!= (-> this current) 'no-memory-card) + (!= (-> this current) 'icon-info) + (!= (-> this current) 'insert-card) + (!= (-> this current) 'progressive-mode-ok) + (!= (-> this current) 'video-mode-ok) + (!= (-> this current) 'progressive-mode-warning) + (!= (-> this current) 'video-mode-warning) ) ) @@ -580,12 +580,12 @@ (none) ) -(defmethod get-state-check-card progress ((obj progress) (arg0 symbol)) +(defmethod get-state-check-card progress ((this progress) (arg0 symbol)) (let ((v1-0 *progress-save-info*) (v0-0 arg0) ) (when v1-0 - (when (and v1-0 (= (-> obj menu-transition) 0.0)) + (when (and v1-0 (= (-> this menu-transition) 0.0)) (case arg0 (('insufficient-space 'no-memory-card 'unformatted-card) (cond @@ -594,7 +594,7 @@ ) ((zero? (-> v1-0 formatted)) (cond - ((or (zero? (-> obj state-pos)) (!= (-> *progress-state* starting-state) 'title)) + ((or (zero? (-> this state-pos)) (!= (-> *progress-state* starting-state) 'title)) (set! v0-0 'go-away) ) (else @@ -607,7 +607,7 @@ ((and (zero? (-> v1-0 inited)) (< (-> v1-0 mem-actual) (-> v1-0 mem-required))) (set! v0-0 'insufficient-space) ) - ((or (zero? (-> obj state-pos)) (!= (-> *progress-state* starting-state) 'title)) + ((or (zero? (-> this state-pos)) (!= (-> *progress-state* starting-state) 'title)) (set! v0-0 'go-away) ) (else @@ -677,13 +677,13 @@ ) ) -(defmethod push-state progress ((obj progress)) - (let ((v1-0 (-> obj state-pos))) +(defmethod push-state progress ((this progress)) + (let ((v1-0 (-> this state-pos))) (cond ((< v1-0 5) - (set! (-> obj state-stack v1-0) (-> obj current)) - (set! (-> obj option-index-stack v1-0) (-> obj option-index)) - (set! (-> obj state-pos) (+ v1-0 1)) + (set! (-> this state-stack v1-0) (-> this current)) + (set! (-> this option-index-stack v1-0) (-> this option-index)) + (set! (-> this state-pos) (+ v1-0 1)) ) (else (format #t "ERROR: Can't push any more states on the state-stack.~%") @@ -693,17 +693,17 @@ 0 ) -(defmethod pop-state progress ((obj progress)) - (let ((v1-0 (-> obj state-pos))) +(defmethod pop-state progress ((this progress)) + (let ((v1-0 (-> this state-pos))) (cond ((> v1-0 0) (let ((a2-0 (+ v1-0 -1))) - (set! (-> obj state-pos) a2-0) - (set-next-state obj (-> obj state-stack a2-0) (-> obj option-index-stack a2-0)) + (set! (-> this state-pos) a2-0) + (set-next-state this (-> this state-stack a2-0) (-> this option-index-stack a2-0)) ) ) (else - (set-next-state obj 'go-away 0) + (set-next-state this 'go-away 0) ) ) ) @@ -716,26 +716,26 @@ 0 ) -(defmethod set-next-state progress ((obj progress) (arg0 symbol) (arg1 int)) +(defmethod set-next-state progress ((this progress) (arg0 symbol) (arg1 int)) "Set the next menu state specified by arg0 at the index specified by arg1." (set! (-> *progress-state* clear-screen) #f) - (when (!= arg0 (-> obj current)) + (when (!= arg0 (-> this current)) (set! (-> *progress-state* yes-no-choice) #f) - (set! (-> obj selected-option) #f) - (set! (-> obj next-option-index) arg1) - (set! (-> obj next) arg0) - (case (-> obj next) + (set! (-> this selected-option) #f) + (set! (-> this next-option-index) arg1) + (set! (-> this next) arg0) + (case (-> this next) (('select-load 'select-save 'select-save-title 'select-save-title-hero) - (set! (-> obj next) (get-state-check-card obj (-> obj next))) + (set! (-> this next) (get-state-check-card this (-> this next))) ) ) - (case (-> obj next) + (case (-> this next) (('creating) - (auto-save-command 'create-file 0 0 obj #f) + (auto-save-command 'create-file 0 0 this #f) ) (('loading) (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which-slot)) - (auto-save-command 'restore 0 (-> *progress-state* which-slot) obj #f) + (auto-save-command 'restore 0 (-> *progress-state* which-slot) this #f) (set! (-> (the-as menu-missions-option (-> (the-as (array menu-option) (-> *missions-options* options)) 0)) task-line-index ) @@ -745,13 +745,13 @@ ) (('saving) (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which-slot)) - (auto-save-command 'save 0 (-> *progress-state* which-slot) obj #f) + (auto-save-command 'save 0 (-> *progress-state* which-slot) this #f) ) (('formatting) - (auto-save-command 'format-card 0 0 obj #f) + (auto-save-command 'format-card 0 0 this #f) ) (('select-save 'select-load) - (set! (-> obj next-option-index) (max 0 (-> *progress-state* last-slot-saved))) + (set! (-> this next-option-index) (max 0 (-> *progress-state* last-slot-saved))) ) (('card-removed) (set! (-> *progress-state* last-slot-saved) 0) @@ -762,15 +762,15 @@ 0 ) -(defmethod set-menu-options progress ((obj progress) (arg0 symbol)) +(defmethod set-menu-options progress ((this progress) (arg0 symbol)) "Set the menu options for the menu state specified by arg0." - (set! (-> obj current-options) #f) + (set! (-> this current-options) #f) (case arg0 (('go-away) - (go (method-of-object obj go-away)) + (go (method-of-object this go-away)) ) (('main) - (set! (-> obj current-options) (cond + (set! (-> this current-options) (cond (*cheat-mode* *main-options* ) @@ -787,7 +787,7 @@ ) ) (('game-options) - (set! (-> obj current-options) + (set! (-> this current-options) (cond ((demo?) (if (= (scf-get-territory) GAME_TERRITORY_SCEE) @@ -805,7 +805,7 @@ ) ) (('graphic-options) - (set! (-> obj current-options) + (set! (-> this current-options) (if (or (= (scf-get-territory) GAME_TERRITORY_SCEE) (and (= *progress-cheat* 'pal) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) *graphic-title-options-pal* *graphic-options* @@ -813,81 +813,81 @@ ) ) (('sound-options) - (set! (-> obj current-options) *sound-options*) + (set! (-> this current-options) *sound-options*) ) (('select-load 'select-save) - (set! (-> obj current-options) *load-save-options*) + (set! (-> this current-options) *load-save-options*) ) (('select-save-title) - (set! (-> obj current-options) *save-options-title*) + (set! (-> this current-options) *save-options-title*) ) (('select-save-title-hero) (logior! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) (logior! (-> *game-info* secrets) (game-secrets hero-mode)) - (set! (-> obj current-options) *save-options-title*) + (set! (-> this current-options) *save-options-title*) ) (('loading 'saving 'creating 'formatting) - (set! (-> obj current-options) *loading-options*) + (set! (-> this current-options) *loading-options*) ) (('unformatted-card 'insufficient-space 'no-memory-card) - (set! (-> obj current-options) *insufficient-space-options*) + (set! (-> this current-options) *insufficient-space-options*) ) (('secrets-insufficient-space 'secrets-no-memory-card) - (set! (-> obj current-options) *secrets-insufficient-space-options*) + (set! (-> this current-options) *secrets-insufficient-space-options*) ) (('insert-card) - (set! (-> obj current-options) *insert-card-options*) + (set! (-> this current-options) *insert-card-options*) ) (('error-loading 'error-saving 'error-formatting 'error-creating) - (set! (-> obj current-options) *error-loading-options*) + (set! (-> this current-options) *error-loading-options*) ) (('error-auto-saving) - (set! (-> obj current-options) *error-auto-saving-options*) + (set! (-> this current-options) *error-auto-saving-options*) ) (('card-removed) - (set! (-> obj current-options) *card-removed-options*) + (set! (-> this current-options) *card-removed-options*) ) (('error-disc-removed) - (set! (-> obj current-options) *error-disc-removed-options*) + (set! (-> this current-options) *error-disc-removed-options*) ) (('error-reading) - (set! (-> obj current-options) *error-reading-options*) + (set! (-> this current-options) *error-reading-options*) ) (('icon-info) - (set! (-> obj current-options) *icon-info-options*) + (set! (-> this current-options) *icon-info-options*) ) (('format-card) - (set! (-> obj current-options) *format-card-options*) + (set! (-> this current-options) *format-card-options*) ) (('already-exists) - (set! (-> obj current-options) *already-exists-options*) + (set! (-> this current-options) *already-exists-options*) ) (('create-game) - (set! (-> obj current-options) *create-game-options*) + (set! (-> this current-options) *create-game-options*) ) (('video-mode-warning) - (set! (-> obj current-options) *video-mode-warning-options*) + (set! (-> this current-options) *video-mode-warning-options*) ) (('video-mode-ok) - (set! (-> obj current-options) *video-mode-ok-options*) + (set! (-> this current-options) *video-mode-ok-options*) ) (('progressive-mode-warning) - (set! (-> obj current-options) *progressive-mode-warning-options*) + (set! (-> this current-options) *progressive-mode-warning-options*) ) (('progressive-mode-ok) - (set! (-> obj current-options) *progressive-mode-ok-options*) + (set! (-> this current-options) *progressive-mode-ok-options*) ) (('quit) - (set! (-> obj current-options) *quit-options*) + (set! (-> this current-options) *quit-options*) ) (('title) - (set! (-> obj current-options) *title*) + (set! (-> this current-options) *title*) ) (('title-options) - (set! (-> obj current-options) *options*) + (set! (-> this current-options) *options*) ) (('select-start 'select-pre-start 'select-kiosk-start) - (set! (-> obj current-options) *select-start-options*) + (set! (-> this current-options) *select-start-options*) (set! (-> (the-as menu-select-start-option (-> (the-as (array menu-option) (-> *select-start-options* options)) 0)) task-index ) @@ -896,7 +896,7 @@ 0 ) (('select-scene) - (set! (-> obj current-options) *select-scene-options*) + (set! (-> this current-options) *select-scene-options*) (set! (-> (the-as menu-select-scene-option (-> (the-as (array menu-option) (-> *select-scene-options* options)) 0)) task-index ) @@ -906,28 +906,28 @@ ) (('select-scene-special) (set! (-> *progress-state* starting-state) 'title) - (set! (-> obj state-pos) 0) - (let ((v1-67 (-> obj state-pos))) - (set! (-> obj state-stack v1-67) 'title) - (set! (-> obj option-index-stack v1-67) 3) + (set! (-> this state-pos) 0) + (let ((v1-67 (-> this state-pos))) + (set! (-> this state-stack v1-67) 'title) + (set! (-> this option-index-stack v1-67) 3) (let ((v1-68 (+ v1-67 1))) - (set! (-> obj state-stack v1-68) 'unlocked-secrets) - (set! (-> obj option-index-stack v1-68) (-> obj option-index)) - (set! (-> obj state-pos) (+ v1-68 1)) + (set! (-> this state-stack v1-68) 'unlocked-secrets) + (set! (-> this option-index-stack v1-68) (-> this option-index)) + (set! (-> this state-pos) (+ v1-68 1)) ) ) - (dotimes (s5-1 (-> obj state-pos)) + (dotimes (s5-1 (-> this state-pos)) (format #t "select-scene-special: ~S ~D~%" - (symbol->string (-> obj state-stack s5-1)) - (-> obj option-index-stack s5-1) + (symbol->string (-> this state-stack s5-1)) + (-> this option-index-stack s5-1) ) ) - (set! (-> obj current-options) *select-scene-options*) + (set! (-> this current-options) *select-scene-options*) ) (('bigmap) - (set! (-> obj current-options) *bigmap-options*) + (set! (-> this current-options) *bigmap-options*) ) (('missions) (set! (-> *progress-state* missions-total-spacing) 0.0) @@ -936,7 +936,7 @@ ) 0 ) - (set! (-> obj current-options) *missions-options*) + (set! (-> this current-options) *missions-options*) ) (('highscores) (set! (-> (the-as menu-highscores-option (-> (the-as (array menu-option) (-> *highscores-options* options)) 0)) @@ -949,48 +949,48 @@ ) 0 ) - (set! (-> obj current-options) *highscores-options*) + (set! (-> this current-options) *highscores-options*) ) (('secret) - (set! (-> obj secret-buying) #f) - (set! (-> obj current-options) *secret-options*) + (set! (-> this secret-buying) #f) + (set! (-> this current-options) *secret-options*) ) (('quit-restart) - (set! (-> obj current-options) *quit-restart-options*) + (set! (-> this current-options) *quit-restart-options*) ) (('unlocked-secrets) - (set! (-> obj current-options) *unlocked-secrets*) + (set! (-> this current-options) *unlocked-secrets*) ) ) - (when (= (-> obj current-options) #f) + (when (= (-> this current-options) #f) (format #t "Didn't find new menu settings!!~%") - (pop-state obj) + (pop-state this) ) 0 ) -(defmethod respond-to-cpad progress ((obj progress)) +(defmethod respond-to-cpad progress ((this progress)) (mc-get-slot-info 0 *progress-save-info*) - (when (-> obj current-options) - (let ((option-array (-> obj current-options options))) - (when (and option-array (= (-> obj menu-transition) 0.0)) + (when (-> this current-options) + (let ((option-array (-> this current-options options))) + (when (and option-array (= (-> this menu-transition) 0.0)) (respond-progress - (the-as menu-option (-> option-array (-> obj option-index))) - obj - (and (= (-> obj menu-transition) 0.0) (-> obj selected-option)) + (the-as menu-option (-> option-array (-> this option-index))) + this + (and (= (-> this menu-transition) 0.0) (-> this selected-option)) ) (cond - ((-> obj selected-option) + ((-> this selected-option) (cond ((cpad-pressed? 0 confirm) - (set! (-> obj selected-option) #f) + (set! (-> this selected-option) #f) ) ((cpad-pressed? 0 triangle) - (if (= (-> obj current-options) *main-options*) + (if (= (-> this current-options) *main-options*) (sound-play "window-contract") (sound-play "generic-beep") ) - (set! (-> obj selected-option) #f) + (set! (-> this selected-option) #f) ) ) ) @@ -998,28 +998,28 @@ (cond ((cpad-pressed? 0 up l-analog-up) (cond - ((= (-> obj current-options) *main-options*) + ((= (-> this current-options) *main-options*) (sound-play "ring-select") ) ((!= (length option-array) 1) (sound-play "roll-over") ) ) - (if (and (= *title* (-> obj current-options)) (not (memcard-unlocked-secrets? #f)) (zero? (-> obj option-index))) - (set! (-> obj option-index) 3) + (if (and (= *title* (-> this current-options)) (not (memcard-unlocked-secrets? #f)) (zero? (-> this option-index))) + (set! (-> this option-index) 3) ) (cond - ((> (-> obj want-option-index) 0) - (set! (-> obj want-option-index) -1) + ((> (-> this want-option-index) 0) + (set! (-> this want-option-index) -1) ) - ((< -2 (-> obj want-option-index)) - (+! (-> obj want-option-index) -1) + ((< -2 (-> this want-option-index)) + (+! (-> this want-option-index) -1) ) ) ) ((cpad-pressed? 0 down l-analog-down) (cond - ((= (-> obj current-options) *main-options*) + ((= (-> this current-options) *main-options*) (sound-play "ring-select") ) ((!= (length option-array) 1) @@ -1027,11 +1027,11 @@ ) ) (cond - ((< (-> obj want-option-index) 0) - (set! (-> obj want-option-index) 1) + ((< (-> this want-option-index) 0) + (set! (-> this want-option-index) 1) ) - ((< (-> obj want-option-index) 2) - (+! (-> obj want-option-index) 1) + ((< (-> this want-option-index) 2) + (+! (-> this want-option-index) 1) ) ) ) @@ -1041,17 +1041,17 @@ (if (not (-> *progress-state* clear-screen)) (sound-play "generic-beep") ) - (set! (-> obj selected-option) #t) + (set! (-> this selected-option) #t) ) ((cpad-pressed? 0 triangle) - (when (can-go-back? obj) + (when (can-go-back? this) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (if (and (= (-> *progress-state* starting-state) 'main) (!= (-> obj current-options) *main-options*)) + (if (and (= (-> *progress-state* starting-state) 'main) (!= (-> this current-options) *main-options*)) (sound-play "window-contract") (sound-play "generic-beep") ) - (pop-state obj) + (pop-state this) ) ) ) @@ -1715,12 +1715,12 @@ ) ) -(defmethod respond-progress menu-option ((obj menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-option ((this menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." 0 ) -(defmethod respond-progress menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-on-off-option ((this menu-on-off-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* on-off-choice)) (gp-0 #f) @@ -1731,7 +1731,7 @@ ((cpad-pressed? 0 left l-analog-left) (when (not (-> v1-1 0)) (set! gp-0 #t) - (when (= (-> obj value-to-modify) (&-> *setting-control* user-default vibration)) + (when (= (-> this value-to-modify) (&-> *setting-control* user-default vibration)) (set! (-> *cpad-list* cpads 0 buzz-pause-val 0) (the-as uint 255)) (set! (-> *cpad-list* cpads 0 buzz-pause-time) (the-as uint 15)) ) @@ -1744,14 +1744,14 @@ ) ((cpad-pressed? 0 confirm) (cond - ((and (-> v1-1 0) (= (-> obj value-to-modify) (&-> *setting-control* user-default use-progressive-scan))) + ((and (-> v1-1 0) (= (-> this value-to-modify) (&-> *setting-control* user-default use-progressive-scan))) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (push-state arg0) (set-next-state arg0 'progressive-mode-warning 0) ) (else - (set! (-> obj value-to-modify 0) (-> *progress-state* on-off-choice)) + (set! (-> this value-to-modify 0) (-> *progress-state* on-off-choice)) ) ) ) @@ -1759,7 +1759,7 @@ ) (else (if (cpad-pressed? 0 confirm) - (set! (-> *progress-state* on-off-choice) (-> obj value-to-modify 0)) + (set! (-> *progress-state* on-off-choice) (-> this value-to-modify 0)) ) ) ) @@ -1770,7 +1770,7 @@ 0 ) -(defmethod respond-progress menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-yes-no-option ((this menu-yes-no-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -1789,13 +1789,13 @@ ) ((cpad-pressed? 0 confirm) (cond - ((and (-> v1-1 0) (= (-> obj name) (text-id progress-root-restart-mission))) + ((and (-> v1-1 0) (= (-> this name) (text-id progress-root-restart-mission))) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (restart-mission) (set-next-state arg0 'go-away 0) ) - ((and (-> v1-1 0) (= (-> obj name) (text-id progress-quit))) + ((and (-> v1-1 0) (= (-> this name) (text-id progress-quit))) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (initialize! *game-info* 'game (the-as game-save #f) "title-restart") @@ -1811,10 +1811,10 @@ 0 ) -(defmethod respond-progress menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-slider-option ((this menu-slider-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (-> *bigmap* progress-minimap) - (let ((gp-0 (-> obj value-to-modify)) + (let ((gp-0 (-> this value-to-modify)) (s4-0 #f) ) (cond @@ -1869,7 +1869,7 @@ ) (when s4-0 (let ((f30-0 1.0)) - (case (-> obj name) + (case (-> this name) (((text-id progress-sound-music-volume) (text-id progress-sound-speech-volume)) (set! f30-0 (-> (the-as (pointer float) gp-0))) ) @@ -1893,7 +1893,7 @@ 0 ) -(defmethod respond-progress menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-stereo-mode-sound-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (-> *bigmap* progress-minimap) (let ((a0-1 (-> *setting-control* user-default stereo-mode)) @@ -1931,7 +1931,7 @@ 0 ) -(defmethod respond-progress menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-main-menu-option ((this menu-main-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (cond ((cpad-pressed? 0 start) @@ -1943,7 +1943,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) (when (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) #t) (cond - ((= (-> obj name) (text-id progress-demo-exit)) + ((= (-> this name) (text-id progress-demo-exit)) (case *kernel-boot-message* (('demo-shared) (set! *master-exit* 'force) @@ -1955,11 +1955,11 @@ ) ) ) - ((or (= (-> obj name) (text-id progress-main-secrets-sceneplayer-1)) - (= (-> obj name) (text-id progress-main-secrets-sceneplayer-2)) - (= (-> obj name) (text-id progress-main-secrets-sceneplayer-3)) + ((or (= (-> this name) (text-id progress-main-secrets-sceneplayer-1)) + (= (-> this name) (text-id progress-main-secrets-sceneplayer-2)) + (= (-> this name) (text-id progress-main-secrets-sceneplayer-3)) ) - (case (-> obj name) + (case (-> this name) (((text-id progress-main-secrets-sceneplayer-2)) (set! (-> *progress-state* scene-player-act) 2) ) @@ -1972,12 +1972,12 @@ ) (sound-play "window-expand") (push-state arg0) - (set-next-state arg0 (-> obj next-state) 0) + (set-next-state arg0 (-> this next-state) 0) ) - ((= (-> obj next-state) 'back) + ((= (-> this next-state) 'back) (pop-state arg0) ) - ((= (-> obj next-state) 'restart) + ((= (-> this next-state) 'restart) (sound-volume-off) (restart-mission) (pop-state arg0) @@ -1985,7 +1985,7 @@ (else (sound-play "window-expand") (push-state arg0) - (set-next-state arg0 (-> obj next-state) 0) + (set-next-state arg0 (-> this next-state) 0) ) ) ) @@ -2026,7 +2026,7 @@ 0 ) -(defmethod respond-progress menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-sub-menu-option ((this menu-sub-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (and (-> *progress-state* secrets-unlocked) (not (memcard-unlocked-secrets? #f)) @@ -2041,12 +2041,12 @@ (set! (-> arg0 state-pos) 0) (set-next-state arg0 'secrets-insufficient-space 0) ) - (when (= (-> obj name) (text-id progress-continue-without-saving)) + (when (= (-> this name) (text-id progress-continue-without-saving)) (let ((a1-3 (get-state-check-card arg0 (-> arg0 current)))) (set-next-state arg0 a1-3 0) ) ) - (when (and (= (-> obj name) (text-id progress-root-secrets)) + (when (and (= (-> this name) (text-id progress-root-secrets)) (= *title* (-> arg0 current-options)) (not (memcard-unlocked-secrets? #f)) (= (-> arg0 option-index) 3) @@ -2058,7 +2058,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (cond - ((= (-> obj name) (text-id progress-demo-exit)) + ((= (-> this name) (text-id progress-demo-exit)) (case *kernel-boot-message* (('demo-shared) (set! *master-exit* 'force) @@ -2070,23 +2070,23 @@ ) ) ) - ((= (-> obj name) (text-id progress-continue-without-saving)) + ((= (-> this name) (text-id progress-continue-without-saving)) (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) ) - ((= (-> obj next-state) 'back) + ((= (-> this next-state) 'back) (pop-state arg0) ) (else (sound-play "generic-beep") (push-state arg0) - (set-next-state arg0 (-> obj next-state) 0) + (set-next-state arg0 (-> this next-state) 0) ) ) ) 0 ) -(defmethod respond-progress menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-unlocked-menu-option ((this menu-unlocked-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (memcard-unlocked-secrets? #t))) (logclear! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) @@ -2101,7 +2101,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (cond - ((and (= (-> obj name) (text-id progress-main-secrets-scrapbook)) (logtest? s4-0 (game-secrets scrap-book-1))) + ((and (= (-> this name) (text-id progress-main-secrets-scrapbook)) (logtest? s4-0 (game-secrets scrap-book-1))) (sound-play "generic-beep") (cond ((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 1) @@ -2115,7 +2115,7 @@ ) ) ) - ((and (= (-> obj name) (text-id progress-main-secrets-mega-scrapbook)) + ((and (= (-> this name) (text-id progress-main-secrets-mega-scrapbook)) (logtest? s4-0 (game-secrets scrap-book-2)) ) (sound-play "generic-beep") @@ -2131,7 +2131,7 @@ ) ) ) - ((and (= (-> obj name) (text-id progress-main-secrets-scrapbook-3)) + ((and (= (-> this name) (text-id progress-main-secrets-scrapbook-3)) (logtest? s4-0 (game-secrets scrap-book-3)) ) (sound-play "generic-beep") @@ -2147,7 +2147,7 @@ ) ) ) - ((and (= (-> obj name) (text-id progress-main-secrets-sceneplayer-1)) + ((and (= (-> this name) (text-id progress-main-secrets-sceneplayer-1)) (logtest? s4-0 (game-secrets scene-player-1)) ) (set! (-> *progress-state* scene-player-act) 1) @@ -2155,7 +2155,7 @@ (push-state arg0) (set-next-state arg0 'select-scene 0) ) - ((and (= (-> obj name) (text-id progress-main-secrets-sceneplayer-2)) + ((and (= (-> this name) (text-id progress-main-secrets-sceneplayer-2)) (logtest? s4-0 (game-secrets scene-player-2)) ) (set! (-> *progress-state* scene-player-act) 2) @@ -2163,7 +2163,7 @@ (push-state arg0) (set-next-state arg0 'select-scene 0) ) - ((and (= (-> obj name) (text-id progress-main-secrets-sceneplayer-3)) + ((and (= (-> this name) (text-id progress-main-secrets-sceneplayer-3)) (logtest? s4-0 (game-secrets scene-player-3)) ) (set! (-> *progress-state* scene-player-act) 3) @@ -2171,19 +2171,19 @@ (push-state arg0) (set-next-state arg0 'select-scene 0) ) - ((and (= (-> obj name) (text-id progress-main-secrets-hero-mode)) (logtest? s4-0 (game-secrets hero-mode))) + ((and (= (-> this name) (text-id progress-main-secrets-hero-mode)) (logtest? s4-0 (game-secrets hero-mode))) (sound-play "generic-beep") (push-state arg0) (set-next-state arg0 'select-save-title-hero 0) ) - ((and (= (-> obj name) (text-id progress-main-secrets-levelselect)) + ((and (= (-> this name) (text-id progress-main-secrets-levelselect)) (logtest? s4-0 (game-secrets level-select)) ) (sound-play "generic-beep") (push-state arg0) (set-next-state arg0 'select-start 0) ) - ((= (-> obj next-state) 'back) + ((= (-> this next-state) 'back) (pop-state arg0) ) ) @@ -2223,7 +2223,7 @@ 0 ) -(defmethod respond-progress menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-memcard-slot-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (memcard-unlocked-secrets? #t) (let ((a1-2 (get-state-check-card arg0 (-> arg0 current)))) @@ -2268,7 +2268,7 @@ 0 ) -(defmethod respond-progress menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-already-exists-option ((this menu-already-exists-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (a1-2 (get-state-check-card arg0 'select-save)) @@ -2310,7 +2310,7 @@ 0 ) -(defmethod respond-progress menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-create-game-option ((this menu-create-game-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2355,7 +2355,7 @@ 0 ) -(defmethod respond-progress menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-insufficient-space-option ((this menu-insufficient-space-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s5-0 (&-> *progress-state* yes-no-choice)) (s3-0 (get-state-check-card arg0 'select-save)) @@ -2394,7 +2394,7 @@ ) (else (sound-play "generic-beep") - (set! (-> obj last-move) (current-time)) + (set! (-> this last-move) (current-time)) (set! (-> arg0 current) 'none) (set-next-state arg0 s3-0 0) ) @@ -2450,7 +2450,7 @@ 0 ) -(defmethod respond-progress menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-secrets-insufficient-space-option ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (&-> *progress-state* yes-no-choice) (cond @@ -2468,7 +2468,7 @@ 0 ) -(defmethod respond-progress menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-video-mode-warning-option ((this menu-video-mode-warning-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2506,7 +2506,7 @@ 0 ) -(defmethod respond-progress menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-video-mode-ok-option ((this menu-video-mode-ok-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (s5-0 #f) @@ -2552,7 +2552,7 @@ 0 ) -(defmethod respond-progress menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-progressive-mode-warning-option ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2597,7 +2597,7 @@ 0 ) -(defmethod respond-progress menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-progressive-mode-ok-option ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (s5-0 #f) @@ -2645,7 +2645,7 @@ 0 ) -(defmethod respond-progress menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-card-removed-option ((this menu-card-removed-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2656,7 +2656,7 @@ 0 ) -(defmethod respond-progress menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-insert-card-option ((this menu-insert-card-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." *progress-save-info* (cond @@ -2673,7 +2673,7 @@ 0 ) -(defmethod respond-progress menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-error-loading-option ((this menu-error-loading-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2684,7 +2684,7 @@ 0 ) -(defmethod respond-progress menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-error-auto-saving-option ((this menu-error-auto-saving-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2695,7 +2695,7 @@ 0 ) -(defmethod respond-progress menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-error-disc-removed-option ((this menu-error-disc-removed-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2708,7 +2708,7 @@ 0 ) -(defmethod respond-progress menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-error-reading-option ((this menu-error-reading-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2719,7 +2719,7 @@ 0 ) -(defmethod respond-progress menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-icon-info-option ((this menu-icon-info-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2730,7 +2730,7 @@ 0 ) -(defmethod respond-progress menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-quit-option ((this menu-quit-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2774,7 +2774,7 @@ 0 ) -(defmethod respond-progress menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-format-card-option ((this menu-format-card-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2819,7 +2819,7 @@ ) ;; WARN: disable def twice: 110. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod respond-progress menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-select-start-option ((this menu-select-start-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -2838,19 +2838,19 @@ ) (cond ((or (cpad-pressed? 0 up l-analog-up) - (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> this last-move)) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (> (-> obj task-index) 0) + (set! (-> this last-move) (current-time)) + (when (> (-> this task-index) 0) (set! s4-0 #t) - (+! (-> obj task-index) -1) + (+! (-> this task-index) -1) (set! (-> arg0 sliding-height) -1.0) ) ) ((or (cpad-pressed? 0 down l-analog-down) - (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> this last-move)) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) + (set! (-> this last-move) (current-time)) (let ((s3-0 -1)) (dotimes (s2-0 (-> *game-info* play-list length)) (let* ((v1-41 (-> *game-info* play-list s2-0)) @@ -2873,22 +2873,22 @@ ) ) ) - (when (< (-> obj task-index) s3-0) + (when (< (-> this task-index) s3-0) (set! s4-0 #t) - (+! (-> obj task-index) 1) + (+! (-> this task-index) 1) (set! (-> arg0 sliding-height) 1.0) ) ) ) ;; og:preserve-this - Added to make scrolling these menus faster (jak3 has this) - ((or (cpad-pressed? 0 left l-analog-left) (and (cpad-hold? 0 left l-analog-left) (>= (- (current-time) (-> obj last-move)) (seconds 0.075)))) - (when (> (-> obj task-index) 0) - (set! (-> obj last-move) (current-time)) + ((or (cpad-pressed? 0 left l-analog-left) (and (cpad-hold? 0 left l-analog-left) (>= (- (current-time) (-> this last-move)) (seconds 0.075)))) + (when (> (-> this task-index) 0) + (set! (-> this last-move) (current-time)) (set! s4-0 #t) - (set! (-> obj task-index) (max (- (-> obj task-index) 5) 0)) + (set! (-> this task-index) (max (- (-> this task-index) 5) 0)) (set! (-> arg0 sliding-height) 0.0))) ;; og:preserve-this - Added to make scrolling these menus faster (jak3 has this) - ((or (cpad-pressed? 0 right l-analog-right) (and (cpad-hold? 0 right l-analog-right) (>= (- (current-time) (-> obj last-move)) (seconds 0.075)))) + ((or (cpad-pressed? 0 right l-analog-right) (and (cpad-hold? 0 right l-analog-right) (>= (- (current-time) (-> this last-move)) (seconds 0.075)))) (let ((max-task-index -1)) (dotimes (s2-0 (-> *game-info* play-list length)) (let* ((v1-41 (-> *game-info* play-list s2-0)) @@ -2911,17 +2911,17 @@ ) ) ) - (when (< (-> obj task-index) max-task-index) - (set! (-> obj last-move) (current-time)) + (when (< (-> this task-index) max-task-index) + (set! (-> this last-move) (current-time)) (set! s4-0 #t) - (set! (-> obj task-index) (min (+ (-> obj task-index) 5) max-task-index)) + (set! (-> this task-index) (min (+ (-> this task-index) 5) max-task-index)) (set! (-> arg0 sliding-height) 0.0)))) ((cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (sound-play "generic-beep") (let* ((t9-6 play-task) - (a0-40 (-> obj real-task-index)) + (a0-40 (-> this real-task-index)) (a1-8 'debug) (v1-64 (-> arg0 current)) (a1-9 (t9-6 (the-as game-task a0-40) a1-8 (cond @@ -2950,7 +2950,7 @@ 0 ) -(defmethod respond-progress menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-select-scene-option ((this menu-select-scene-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -2981,22 +2981,22 @@ ) (cond ((or (cpad-pressed? 0 up l-analog-up) - (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> this last-move)) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (> (-> obj task-index) 0) + (set! (-> this last-move) (current-time)) + (when (> (-> this task-index) 0) (set! gp-0 #t) - (+! (-> obj task-index) -1) + (+! (-> this task-index) -1) (set! (-> arg0 sliding-height) -1.0) ) ) ((or (cpad-pressed? 0 down l-analog-down) - (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> this last-move)) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (< (-> obj task-index) (+ (length s4-0) -1)) + (set! (-> this last-move) (current-time)) + (when (< (-> this task-index) (+ (length s4-0) -1)) (set! gp-0 #t) - (+! (-> obj task-index) 1) + (+! (-> this task-index) 1) (set! (-> arg0 sliding-height) 1.0) ) ) @@ -3009,7 +3009,7 @@ (set! *display-profile* s3-2) ) (set! (-> *game-info* mode) 'play) - (let ((s5-1 (-> s4-0 (-> obj task-index)))) + (let ((s5-1 (-> s4-0 (-> this task-index)))) (set! (-> *game-info* demo-state) (the-as uint 100)) (logior! (-> *game-info* secrets) (game-secrets scene-player-1)) (process-spawn scene-player :init scene-player-init (-> s5-1 info) #t (-> s5-1 continue)) @@ -3025,7 +3025,7 @@ 0 ) -(defmethod respond-progress menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-bigmap-option ((this menu-bigmap-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (handle-cpad-inputs *bigmap*) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -3033,7 +3033,7 @@ 0 ) -(defmethod respond-progress menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-missions-option ((this menu-missions-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -3046,21 +3046,21 @@ (let ((s5-0 #f)) (cond ((or (cpad-pressed? 0 up l-analog-up) - (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> this last-move)) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (> (-> obj task-line-index) 0) + (set! (-> this last-move) (current-time)) + (when (> (-> this task-line-index) 0) (set! s5-0 #t) - (+! (-> obj task-line-index) -1) + (+! (-> this task-line-index) -1) (set! (-> arg0 sliding-height) -1.0) ) ) ((or (cpad-pressed? 0 down l-analog-down) - (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> this last-move)) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (< (-> obj task-line-index) (+ (-> *progress-state* total-num-tasks) -1)) - (+! (-> obj task-line-index) 1) + (set! (-> this last-move) (current-time)) + (when (< (-> this task-line-index) (+ (-> *progress-state* total-num-tasks) -1)) + (+! (-> this task-line-index) 1) (set! (-> arg0 sliding-height) 1.0) (set! s5-0 #t) ) @@ -3082,7 +3082,7 @@ 0 ) -(defmethod respond-progress menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-highscores-option ((this menu-highscores-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding) (seek-ease (-> arg0 sliding) @@ -3105,30 +3105,30 @@ (cond ((or (cpad-pressed? 0 right l-analog-right) (and (cpad-hold? 0 right l-analog-right) - (>= (- (current-time) (-> obj last-move)) (seconds 0.2)) + (>= (- (current-time) (-> this last-move)) (seconds 0.2)) ) ) (when (< 1 (get-num-highscores)) - (set! (-> obj last-move) (current-time)) + (set! (-> this last-move) (current-time)) (set! s5-0 #t) - (set! (-> obj prev-page-index) (-> obj page-index)) - (set! (-> obj page-index) (get-next-highscore (-> obj page-index))) + (set! (-> this prev-page-index) (-> this page-index)) + (set! (-> this page-index) (get-next-highscore (-> this page-index))) (set! (-> arg0 sliding) 1.0) (set! (-> arg0 sliding-off) 0.0) - (set! (-> obj slide-dir) -1.0) + (set! (-> this slide-dir) -1.0) ) ) ((or (cpad-pressed? 0 left l-analog-left) - (and (cpad-hold? 0 left l-analog-left) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 left l-analog-left) (>= (- (current-time) (-> this last-move)) (seconds 0.2))) ) (when (< 1 (get-num-highscores)) - (set! (-> obj last-move) (current-time)) - (set! (-> obj prev-page-index) (-> obj page-index)) - (set! (-> obj page-index) (get-prev-highscore (-> obj page-index))) + (set! (-> this last-move) (current-time)) + (set! (-> this prev-page-index) (-> this page-index)) + (set! (-> this page-index) (get-prev-highscore (-> this page-index))) (set! s5-0 #t) (set! (-> arg0 sliding) -1.0) (set! (-> arg0 sliding-off) 0.0) - (set! (-> obj slide-dir) 1.0) + (set! (-> this slide-dir) 1.0) ) ) ((cpad-pressed? 0 triangle confirm) @@ -3151,17 +3151,17 @@ 0 ) -(defmethod respond-progress menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-secret-option ((this menu-secret-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let* ((s5-1 (logtest? (-> *game-info* secrets) (game-secrets hero-mode))) (s3-0 (if (not s5-1) 0 - (-> obj num-items) + (-> this num-items) ) ) (s2-0 (if (not s5-1) - (+ (-> obj num-items) -1) - (+ (-> obj num-items) -1 (-> obj num-hero-items)) + (+ (-> this num-items) -1) + (+ (-> this num-items) -1 (-> this num-hero-items)) ) ) ) @@ -3174,16 +3174,16 @@ ) ) (cond - ((and s5-1 (< (-> obj item-index) s3-0)) - (set! (-> obj item-index) s3-0) - (set! (-> obj prev-item-index) s3-0) + ((and s5-1 (< (-> this item-index) s3-0)) + (set! (-> this item-index) s3-0) + (set! (-> this prev-item-index) s3-0) ) - ((and (not s5-1) (< s2-0 (-> obj item-index))) - (set! (-> obj item-index) s3-0) - (set! (-> obj prev-item-index) s3-0) + ((and (not s5-1) (< s2-0 (-> this item-index))) + (set! (-> this item-index) s3-0) + (set! (-> this prev-item-index) s3-0) ) ) - (menu-update-purchase-secrets obj) + (menu-update-purchase-secrets this) (when (-> *bigmap* progress-minimap) (let ((s5-2 #f)) (cond @@ -3198,24 +3198,24 @@ (else (cond ((or (cpad-pressed? 0 down l-analog-down) - (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> this last-move)) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (< (-> obj item-index) s2-0) - (set! (-> obj prev-item-index) (-> obj item-index)) + (set! (-> this last-move) (current-time)) + (when (< (-> this item-index) s2-0) + (set! (-> this prev-item-index) (-> this item-index)) (set! s5-2 #t) - (+! (-> obj item-index) 1) + (+! (-> this item-index) 1) (set! (-> arg0 sliding) 1.0) (set! (-> arg0 sliding-off) 0.0) ) ) ((or (cpad-pressed? 0 up l-analog-up) - (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> this last-move)) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (< s3-0 (-> obj item-index)) - (set! (-> obj prev-item-index) (-> obj item-index)) - (+! (-> obj item-index) -1) + (set! (-> this last-move) (current-time)) + (when (< s3-0 (-> this item-index)) + (set! (-> this prev-item-index) (-> this item-index)) + (+! (-> this item-index) -1) (set! s5-2 #t) (set! (-> arg0 sliding) -1.0) (set! (-> arg0 sliding-off) 0.0) @@ -3224,19 +3224,19 @@ ((cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) - (let ((v1-74 (-> obj item-index))) - (-> obj secret-items v1-74 cost) - (let ((a0-54 (-> obj secret-items v1-74 flag)) - (a1-9 (= (-> obj secret-items v1-74 can-toggle) #t)) + (let ((v1-74 (-> this item-index))) + (-> this secret-items v1-74 cost) + (let ((a0-54 (-> this secret-items v1-74 flag)) + (a1-9 (= (-> this secret-items v1-74 can-toggle) #t)) ) - (-> obj secret-items v1-74 avail-after) + (-> this secret-items v1-74 avail-after) (the int (-> *game-info* skill)) (cond ((and (logtest? (-> *game-info* purchase-secrets) a0-54) a1-9) (set! (-> arg0 selected-option) #t) (sound-play "generic-beep") ) - ((= (-> obj secret-items v1-74 can-toggle) 'auto) + ((= (-> this secret-items v1-74 can-toggle) 'auto) ) ((logtest? (-> *game-info* purchase-secrets) a0-54) (set! (-> arg0 selected-option) #t) @@ -3269,7 +3269,7 @@ 0 ) -(defmethod respond-progress menu-game-option ((obj menu-game-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-game-option ((this menu-game-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* game-options-vibrations) (-> *progress-state* game-options-subtitles) @@ -3490,7 +3490,7 @@ 0 ) -(defmethod respond-progress menu-graphic-option ((obj menu-graphic-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-graphic-option ((this menu-graphic-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* graphic-options-aspect-ratio) (-> *progress-state* graphic-options-progressive-scan) @@ -3583,7 +3583,7 @@ ((and (zero? (-> *progress-state* graphic-options-item-selected)) (cpad-pressed? 0 up right down left l-analog-up l-analog-right l-analog-down l-analog-left) ) - (update-center-screen obj arg0 #t) + (update-center-screen this arg0 #t) ) ((and (= (-> *progress-state* graphic-options-item-selected) 1) (cpad-pressed? 0 left l-analog-left)) (sound-play "generic-beep") @@ -3623,7 +3623,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (sound-play "generic-beep") (if (zero? (-> *progress-state* graphic-options-item-selected)) - (update-center-screen obj arg0 #t) + (update-center-screen this arg0 #t) ) (when (= (-> *progress-state* graphic-options-item-selected) 1) (if (!= (-> *progress-state* graphic-options-aspect-ratio) (-> *setting-control* user-default aspect-ratio)) @@ -3702,7 +3702,7 @@ 0 ) -(defmethod respond-progress menu-qr-option ((obj menu-qr-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-qr-option ((this menu-qr-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* qr-options-restart) (-> *progress-state* qr-options-quit) @@ -3790,19 +3790,19 @@ ) ((and (zero? (-> *progress-state* qr-options-item-selected)) (cpad-pressed? 0 left l-analog-left)) (sound-play "generic-beep") - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) ((and (zero? (-> *progress-state* qr-options-item-selected)) (cpad-pressed? 0 right l-analog-right)) (sound-play "generic-beep") - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) ((and (= (-> *progress-state* qr-options-item-selected) 1) (cpad-pressed? 0 left l-analog-left)) (sound-play "generic-beep") - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) ((and (= (-> *progress-state* qr-options-item-selected) 1) (cpad-pressed? 0 right l-analog-right)) (sound-play "generic-beep") - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) ((cpad-pressed? 0 triangle) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) @@ -3816,12 +3816,12 @@ (when (zero? (-> *progress-state* qr-options-item-selected)) (set! (-> arg0 selected-option) #t) (set! (-> arg0 option-index) 0) - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) (when (= (-> *progress-state* qr-options-item-selected) 1) (set! (-> arg0 selected-option) #t) (set! (-> arg0 option-index) 1) - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) (set! (-> *progress-state* qr-options-item-picked) #f) (set! (-> *progress-state* yes-no-choice) #f) diff --git a/goal_src/jak2/engine/ui/text-h.gc b/goal_src/jak2/engine/ui/text-h.gc index fd54b097d9..611910ca34 100644 --- a/goal_src/jak2/engine/ui/text-h.gc +++ b/goal_src/jak2/engine/ui/text-h.gc @@ -18,7 +18,7 @@ (deftype game-text (structure) ((id text-id :offset-assert 0) - (text string :offset-assert 4) + (text string :offset-assert 4) ) :pack-me :method-count-assert 9 diff --git a/goal_src/jak2/engine/ui/text.gc b/goal_src/jak2/engine/ui/text.gc index 9894892471..795f1d4c9e 100644 --- a/goal_src/jak2/engine/ui/text.gc +++ b/goal_src/jak2/engine/ui/text.gc @@ -32,50 +32,50 @@ (kmemclose) -(defmethod relocate game-text-info ((obj game-text-info) (arg0 int)) +(defmethod relocate game-text-info ((this game-text-info) (arg0 int)) (let ((v1-1 (-> *level* loading-level))) (when v1-1 - (set! (-> v1-1 loaded-text-info (-> v1-1 loaded-text-info-count)) obj) + (set! (-> v1-1 loaded-text-info (-> v1-1 loaded-text-info-count)) this) (+! (-> v1-1 loaded-text-info-count) 1) ) ) - obj + this ) -(defmethod length game-text-info ((obj game-text-info)) - (-> obj length) +(defmethod length game-text-info ((this game-text-info)) + (-> this length) ) ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of game-text-info ((obj game-text-info)) - (the-as int (+ (-> obj type size) (* (-> obj length) 8))) +(defmethod asize-of game-text-info ((this game-text-info)) + (the-as int (+ (-> this type size) (* (-> this length) 8))) ) -(defmethod mem-usage game-text-info ((obj game-text-info) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage game-text-info ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 84 (-> arg0 length))) (set! (-> arg0 data 83 name) "string") (+! (-> arg0 data 83 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 83 used) v1-6) (+! (-> arg0 data 83 total) (logand -16 (+ v1-6 15))) ) - (dotimes (s4-0 (-> obj length)) + (dotimes (s4-0 (-> this length)) (set! (-> arg0 length) (max 84 (-> arg0 length))) (set! (-> arg0 data 83 name) "string") (+! (-> arg0 data 83 count) 1) - (let ((v1-18 (asize-of (-> obj data s4-0 text)))) + (let ((v1-18 (asize-of (-> this data s4-0 text)))) (+! (-> arg0 data 83 used) v1-18) (+! (-> arg0 data 83 total) (logand -16 (+ v1-18 15))) ) ) - obj + this ) (defun convert-korean-text ((arg0 string)) "Converts the provided [[string]] of [[game-text]] into korean. Returns a [[string]]" (local-vars (v1-21 int)) - (let ((gp-0 (-> arg0 data))) + (let ((charp (-> arg0 data))) *expanded-text-line0* (let ((s4-0 0)) 0 @@ -93,26 +93,26 @@ (clear s3-0) (while (< s4-0 s5-0) (cond - ((= (-> gp-0 s4-0) 3) + ((= (-> charp s4-0) 3) (+! s4-0 1) - (while (and (< s4-0 s5-0) (!= (-> gp-0 s4-0) 3) (!= (-> gp-0 s4-0) 4)) - (set! (-> s3-0 data s1-0) (-> gp-0 s4-0)) + (while (and (< s4-0 s5-0) (!= (-> charp s4-0) 3) (!= (-> charp s4-0) 4)) + (set! (-> s3-0 data s1-0) (-> charp s4-0)) (+! s4-0 1) (+! s1-0 1) ) ) (else (let ((v1-17 (+ s4-0 1))) - (-> gp-0 v1-17) + (-> charp v1-17) (set! s4-0 (+ v1-17 1)) ) (set! (-> s3-0 data s1-0) (the-as uint 126)) (let ((v1-19 (+ s1-0 1))) (set! (-> s3-0 data v1-19) (the-as uint 89)) (let ((v1-20 (+ v1-19 1))) - (while (and (< s4-0 s5-0) (< v1-20 s2-0) (!= (-> gp-0 s4-0) 3) (!= (-> gp-0 s4-0) 4)) + (while (and (< s4-0 s5-0) (< v1-20 s2-0) (!= (-> charp s4-0) 3) (!= (-> charp s4-0) 4)) (cond - ((= (-> gp-0 s4-0) 5) + ((= (-> charp s4-0) 5) (set! (-> s3-0 data v1-20) (the-as uint 1)) (+! s4-0 1) (set! v1-21 (+ v1-20 1)) @@ -122,7 +122,7 @@ (set! v1-21 (+ v1-20 1)) ) ) - (set! (-> s3-0 data v1-21) (-> gp-0 s4-0)) + (set! (-> s3-0 data v1-21) (-> charp s4-0)) (+! s4-0 1) (let ((v1-22 (+ v1-21 1))) (set! (-> s3-0 data v1-22) (the-as uint 126)) @@ -160,9 +160,9 @@ ) ) -(defmethod lookup-text! game-text-info ((obj game-text-info) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text! game-text-info ((this game-text-info) (arg0 text-id) (arg1 symbol)) (cond - ((= obj #f) + ((= this #f) (cond (arg1 (the-as string #f) @@ -175,12 +175,12 @@ ) (else (let* ((a1-2 0) - (a3-0 (+ (-> obj length) 1)) + (a3-0 (+ (-> this length) 1)) (v1-2 (/ (+ a1-2 a3-0) 2)) ) (let ((t0-0 -1)) - (while (and (!= (-> obj data v1-2 id) arg0) (!= v1-2 t0-0)) - (if (< (the-as uint arg0) (the-as uint (-> obj data v1-2 id))) + (while (and (!= (-> this data v1-2 id) arg0) (!= v1-2 t0-0)) + (if (< (the-as uint arg0) (the-as uint (-> this data v1-2 id))) (set! a3-0 v1-2) (set! a1-2 v1-2) ) @@ -189,7 +189,7 @@ ) ) (cond - ((!= (-> obj data v1-2 id) arg0) + ((!= (-> this data v1-2 id) arg0) (cond (arg1 (the-as string #f) @@ -200,11 +200,11 @@ ) ) ) - ((= (-> obj language-id) 6) - (convert-korean-text (-> obj data v1-2 text)) + ((= (-> this language-id) 6) + (convert-korean-text (-> this data v1-2 text)) ) (else - (-> obj data v1-2 text) + (-> this data v1-2 text) ) ) ) @@ -212,11 +212,11 @@ ) ) -(defmethod lookup-text level ((obj level) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text level ((this level) (arg0 text-id) (arg1 symbol)) (let ((v1-0 *common-text*)) - (dotimes (a3-0 (-> obj loaded-text-info-count)) - (if (= (-> obj loaded-text-info a3-0 language-id) (-> *setting-control* user-current language)) - (set! v1-0 (-> obj loaded-text-info a3-0)) + (dotimes (a3-0 (-> this loaded-text-info-count)) + (if (= (-> this loaded-text-info a3-0 language-id) (-> *setting-control* user-current language)) + (set! v1-0 (-> this loaded-text-info a3-0)) ) ) (lookup-text! v1-0 arg0 arg1) @@ -234,7 +234,7 @@ the game-text-info, and heap is the heap to load to. The heap will be cleared." (set! sv-24 (the-as int (-> *setting-control* user-current language))) (set! sv-32 0) (set! sv-40 (&- (-> arg2 top) (the-as uint (-> arg2 base)))) - (if (and (= (scf-get-territory) GAME_TERRITORY_SCEE) (= sv-24 (language-enum english)) (not (demo?))) + (if (and (= (scf-get-territory) 1) (= sv-24 (language-enum english)) (not (demo?))) (set! sv-24 7) ) (when (or (= sv-16 #f) (!= (-> sv-16 language-id) sv-24) (not (string= (-> sv-16 group-name) arg0))) @@ -567,6 +567,7 @@ in a single text group and file." (set! (-> arg1 origin y) sv-20) (set! (-> arg1 flags) sv-24) (set! (-> arg1 color) sv-28) + ;; og:preserve-this (#when PC_PORT (if (and *debug-segment* *display-text-box*) (draw-debug-text-box arg1))) diff --git a/goal_src/jak2/engine/util/glist-h.gc b/goal_src/jak2/engine/util/glist-h.gc index 73ec91dae1..ad642204be 100644 --- a/goal_src/jak2/engine/util/glist-h.gc +++ b/goal_src/jak2/engine/util/glist-h.gc @@ -21,16 +21,16 @@ ) ;; definition for method 3 of type glst-node -(defmethod inspect glst-node ((obj glst-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect glst-node ((this glst-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'glst-node) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tprev: #~%" (-> obj prev)) + (format #t "[~8x] ~A~%" this 'glst-node) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) (label cfg-4) - obj + this ) ;; definition of type glst-named-node @@ -43,17 +43,17 @@ ) ;; definition for method 3 of type glst-named-node -(defmethod inspect glst-named-node ((obj glst-named-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect glst-named-node ((this glst-named-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'glst-named-node) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tprev: #~%" (-> obj prev)) - (format #t "~1Tprivname: ~A~%" (-> obj privname)) + (format #t "[~8x] ~A~%" this 'glst-named-node) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) + (format #t "~1Tprivname: ~A~%" (-> this privname)) (label cfg-4) - obj + this ) ;; definition of type glst-list @@ -69,18 +69,18 @@ ) ;; definition for method 3 of type glst-list -(defmethod inspect glst-list ((obj glst-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect glst-list ((this glst-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'glst-list) - (format #t "~1Thead: #~%" (-> obj head)) - (format #t "~1Ttail: #~%" (-> obj tail)) - (format #t "~1Ttailpred: #~%" (-> obj tailpred)) - (format #t "~1Tnumelem: ~D~%" (-> obj numelem)) + (format #t "[~8x] ~A~%" this 'glst-list) + (format #t "~1Thead: #~%" (-> this head)) + (format #t "~1Ttail: #~%" (-> this tail)) + (format #t "~1Ttailpred: #~%" (-> this tailpred)) + (format #t "~1Tnumelem: ~D~%" (-> this numelem)) (label cfg-4) - obj + this ) ;; definition for function glst-next diff --git a/goal_src/jak2/engine/util/profile-h.gc b/goal_src/jak2/engine/util/profile-h.gc index 01c583b34b..459c91d239 100644 --- a/goal_src/jak2/engine/util/profile-h.gc +++ b/goal_src/jak2/engine/util/profile-h.gc @@ -87,10 +87,10 @@ The "count" can be used for whatever you want (ex: fragments, VU calls, etc) ) -(defmethod get-total-time profile-segment-array ((obj profile-segment-array)) +(defmethod get-total-time profile-segment-array ((this profile-segment-array)) "Get the total time spent." ;; assuming 0 is "all" here. - (- (-> obj data 0 end-time) (-> obj data 0 start-time)) + (- (-> this data 0 end-time) (-> this data 0 start-time)) ) (define *profile-gap-color* (new 'static 'rgba :r #x30 :g #x30 :b #x30 :a #x80)) diff --git a/goal_src/jak2/engine/util/profile.gc b/goal_src/jak2/engine/util/profile.gc index fd78c95f4a..f9e508f386 100644 --- a/goal_src/jak2/engine/util/profile.gc +++ b/goal_src/jak2/engine/util/profile.gc @@ -60,47 +60,47 @@ (define *profile-h* 8) (define *profile-ticks* #f) -(defmethod start-frame! profile-segment-array ((obj profile-segment-array)) +(defmethod start-frame! profile-segment-array ((this profile-segment-array)) "Start a frame." - (set! (-> obj count) 0) - (set! (-> obj depth) 0) - (set! (-> obj max-depth) 0) - (set! (-> obj base-time) (the-as int (timer-count (the-as timer-bank #x10000800)))) - (start-segment! obj 'all *profile-all-color*) + (set! (-> this count) 0) + (set! (-> this depth) 0) + (set! (-> this max-depth) 0) + (set! (-> this base-time) (the-as int (timer-count (the-as timer-bank #x10000800)))) + (start-segment! this 'all *profile-all-color*) 0 (none) ) -(defmethod start-segment! profile-segment-array ((obj profile-segment-array) (arg0 symbol) (arg1 rgba)) +(defmethod start-segment! profile-segment-array ((this profile-segment-array) (arg0 symbol) (arg1 rgba)) "Push a new segment onto the profiling stack." (when (and *dproc* *debug-segment*) - (let ((s4-0 (-> obj data (-> obj count)))) - (let ((s3-0 (-> obj base-time))) + (let ((s4-0 (-> this data (-> this count)))) + (let ((s3-0 (-> this base-time))) (set! (-> s4-0 name) arg0) (set! (-> s4-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-0)))) ) - (set! (-> s4-0 depth) (the-as uint (-> obj depth))) + (set! (-> s4-0 depth) (the-as uint (-> this depth))) (set! (-> s4-0 color) arg1) - (set! (-> obj segment (-> obj depth)) s4-0) + (set! (-> this segment (-> this depth)) s4-0) ) - (+! (-> obj count) 1) - (+! (-> obj depth) 1) - (set! (-> obj max-depth) (max (-> obj max-depth) (-> obj depth))) + (+! (-> this count) 1) + (+! (-> this depth) 1) + (set! (-> this max-depth) (max (-> this max-depth) (-> this depth))) ) 0 (none) ) -(defmethod end-segment! profile-segment-array ((obj profile-segment-array)) +(defmethod end-segment! profile-segment-array ((this profile-segment-array)) "Pop the last pushed segment." (when (and *dproc* *debug-segment*) - (let* ((v1-4 (+ (-> obj depth) -1)) - (s5-0 (-> obj segment v1-4)) - (s4-0 (-> obj base-time)) + (let* ((v1-4 (+ (-> this depth) -1)) + (s5-0 (-> this segment v1-4)) + (s4-0 (-> this base-time)) ) (when (>= v1-4 0) (set! (-> s5-0 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-0)))) - (+! (-> obj depth) -1) + (+! (-> this depth) -1) ) ) ) @@ -381,7 +381,7 @@ ) ) -(defmethod setup-categories! profile-array ((obj profile-array)) +(defmethod setup-categories! profile-array ((this profile-array)) "Summarize data collected." ;; loop over both EE and VU profilers @@ -392,7 +392,7 @@ (let ((s3-0 (-> *profile-array* data s5-0)) (s4-0 *profile-collapse*) ) - (mem-copy! (&-> s3-0 type) (&-> (-> obj data s5-0) type) 8240) + (mem-copy! (&-> s3-0 type) (&-> (-> this data s5-0) type) 8240) (cond ((zero? s5-0) @@ -550,7 +550,7 @@ (none) ) -(defmethod draw-bars! profile-array ((obj profile-array) (arg0 dma-buffer) (arg1 int)) +(defmethod draw-bars! profile-array ((this profile-array) (arg0 dma-buffer) (arg1 int)) "Draw the two bars at the top." (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object))) (dma-buffer-add-gs-set arg0 @@ -575,7 +575,7 @@ ) (&+! (-> arg0 base) 80) (dotimes (s3-0 2) - (let* ((v1-12 (-> obj data s3-0)) + (let* ((v1-12 (-> this data s3-0)) (a0-11 (-> v1-12 max-depth)) (s2-1 (max 14 (* a0-11 2))) ) @@ -728,7 +728,7 @@ ) -(defmethod draw-text! profile-array ((obj profile-array)) +(defmethod draw-text! profile-array ((this profile-array)) "Draw the table of times." (let ((gp-0 *profile-collapse*)) (dotimes (s5-0 (-> gp-0 count)) diff --git a/goal_src/jak2/engine/util/smush-control-h.gc b/goal_src/jak2/engine/util/smush-control-h.gc index dd069caa1a..1c40148822 100644 --- a/goal_src/jak2/engine/util/smush-control-h.gc +++ b/goal_src/jak2/engine/util/smush-control-h.gc @@ -31,40 +31,40 @@ ) -(defmethod nonzero-amplitude? smush-control ((obj smush-control)) - (!= (-> obj amp) 0.0) +(defmethod nonzero-amplitude? smush-control ((this smush-control)) + (!= (-> this amp) 0.0) ) -(defmethod set-zero! smush-control ((obj smush-control)) - (set! (-> obj period) 0.0) - (set! (-> obj duration) 0.0) - (set! (-> obj amp) 0.0) - (set! (-> obj damp-amp) 0.0) - (set! (-> obj damp-period) 0.0) - (set! (-> obj ticks) 0.0) - obj +(defmethod set-zero! smush-control ((this smush-control)) + (set! (-> this period) 0.0) + (set! (-> this duration) 0.0) + (set! (-> this amp) 0.0) + (set! (-> this damp-amp) 0.0) + (set! (-> this damp-period) 0.0) + (set! (-> this ticks) 0.0) + this ) -(defmethod update! smush-control ((obj smush-control)) +(defmethod update! smush-control ((this smush-control)) (cond - ((!= (-> obj amp) 0.0) - (let* ((f30-0 (the float (- (current-time) (-> obj start-time)))) - (f0-2 (-> obj period)) + ((!= (-> this amp) 0.0) + (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) + (f0-2 (-> this period)) (f28-0 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) ) - (when (>= (- f30-0 (-> obj ticks)) (-> obj period)) - (set! (-> obj amp) (* (-> obj amp) (-> obj damp-amp))) - (set! (-> obj period) (* (-> obj period) (-> obj damp-period))) - (set! (-> obj ticks) f30-0) - (if (< (-> obj damp-period) 0.0) - (set-zero! obj) + (when (>= (- f30-0 (-> this ticks)) (-> this period)) + (set! (-> this amp) (* (-> this amp) (-> this damp-amp))) + (set! (-> this period) (* (-> this period) (-> this damp-period))) + (set! (-> this ticks) f30-0) + (if (< (-> this damp-period) 0.0) + (set-zero! this) ) ) - (if (>= f30-0 (-> obj duration)) - (set-zero! obj) + (if (>= f30-0 (-> this duration)) + (set-zero! this) ) - (* (sin (/ (* 65536.0 f28-0) (-> obj period))) - (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + (* (sin (/ (* 65536.0 f28-0) (-> this period))) + (* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration))) ) ) ) @@ -74,15 +74,15 @@ ) ) -(defmethod get-no-update smush-control ((obj smush-control)) +(defmethod get-no-update smush-control ((this smush-control)) (cond - ((!= (-> obj amp) 0.0) - (let* ((f30-0 (the float (- (current-time) (-> obj start-time)))) - (f0-2 (-> obj period)) + ((!= (-> this amp) 0.0) + (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) + (f0-2 (-> this period)) (f0-4 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) ) - (* (sin (/ (* 65536.0 f0-4) (-> obj period))) - (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + (* (sin (/ (* 65536.0 f0-4) (-> this period))) + (* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration))) ) ) ) @@ -92,22 +92,22 @@ ) ) -(defmethod die-on-next-update! smush-control ((obj smush-control)) - (if (!= (-> obj amp) 0.0) - (set! (-> obj damp-period) -1.0) +(defmethod die-on-next-update! smush-control ((this smush-control)) + (if (!= (-> this amp) 0.0) + (set! (-> this damp-period) -1.0) ) - obj + this ) -(defmethod activate! smush-control ((obj smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) - (when (>= (fabs (* 0.2 (-> obj amp))) (fabs (get-no-update obj))) - (set! (-> obj amp) arg0) - (set! (-> obj period) (the float arg1)) - (set! (-> obj duration) (the float arg2)) - (set! (-> obj damp-amp) arg3) - (set! (-> obj damp-period) arg4) - (set! (-> obj ticks) 0.0) - (set! (-> obj start-time) (-> arg5 frame-counter)) +(defmethod activate! smush-control ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) + (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) + (set! (-> this amp) arg0) + (set! (-> this period) (the float arg1)) + (set! (-> this duration) (the float arg2)) + (set! (-> this damp-amp) arg3) + (set! (-> this damp-period) arg4) + (set! (-> this ticks) 0.0) + (set! (-> this start-time) (-> arg5 frame-counter)) ) - obj + this ) diff --git a/goal_src/jak2/engine/util/sync-info.gc b/goal_src/jak2/engine/util/sync-info.gc index 0cb6c60d5a..7c535d3bb0 100644 --- a/goal_src/jak2/engine/util/sync-info.gc +++ b/goal_src/jak2/engine/util/sync-info.gc @@ -8,68 +8,68 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch object vs none. -(defmethod initialize! sync-info ((obj sync-info) (arg0 sync-info-params)) +(defmethod initialize! sync-info ((this sync-info) (arg0 sync-info-params)) "Set up a sync-info from params." (format 0 "ERROR: Invalid call to sync-info::initialize!~%") (none) ) -(defmethod get-current-phase-no-mod sync-info ((obj sync-info)) +(defmethod get-current-phase-no-mod sync-info ((this sync-info)) "Get the current value, with no fancy modifications." - (let* ((v1-0 (-> obj period)) + (let* ((v1-0 (-> this period)) (f0-1 (the float v1-0)) - (f1-2 (+ (the float (mod (the-as uint (current-time)) v1-0)) (-> obj offset))) + (f1-2 (+ (the float (mod (the-as uint (current-time)) v1-0)) (-> this offset))) ) (/ (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)) f0-1) ) ) -(defmethod get-phase-offset sync-info ((obj sync-info)) +(defmethod get-phase-offset sync-info ((this sync-info)) "Get the offset, as a fraction of period" - (/ (-> obj offset) (the float (-> obj period))) + (/ (-> this offset) (the float (-> this period))) ) -(defmethod sync-now! sync-info ((obj sync-info) (arg0 float)) +(defmethod sync-now! sync-info ((this sync-info) (arg0 float)) "Adjust our offset so our current phase is the given phase." - (let* ((a2-0 (-> obj period)) + (let* ((a2-0 (-> this period)) (f0-1 (the float a2-0)) (v1-0 (- arg0 (* (the float (the int (/ arg0 f0-1))) f0-1))) - (f1-4 (+ (the float (mod (the-as uint (current-time)) a2-0)) (-> obj offset))) + (f1-4 (+ (the float (mod (the-as uint (current-time)) a2-0)) (-> this offset))) (f1-6 (/ (- f1-4 (* (the float (the int (/ f1-4 f0-1))) f0-1)) f0-1)) - (f1-10 (+ (* (- v1-0 f1-6) f0-1) f0-1 (-> obj offset))) + (f1-10 (+ (* (- v1-0 f1-6) f0-1) f0-1 (-> this offset))) ) - (set! (-> obj offset) (- f1-10 (* (the float (the int (/ f1-10 f0-1))) f0-1))) + (set! (-> this offset) (- f1-10 (* (the float (the int (/ f1-10 f0-1))) f0-1))) ) 0 (none) ) -(defmethod get-norm! sync-info ((obj sync-info) (arg0 int)) +(defmethod get-norm! sync-info ((this sync-info) (arg0 int)) "Get the current value, from 0 to 1." (format 0 "ERROR: Unsupported sync-info::get-norm!~%") 0.0 ) -(defmethod get-scaled-val! sync-info ((obj sync-info) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! sync-info ((this sync-info) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" - (* (get-norm! obj arg1) arg0) + (* (get-norm! this arg1) arg0) ) -(defmethod get-timeframe-offset! sync-info ((obj sync-info) (arg0 time-frame)) +(defmethod get-timeframe-offset! sync-info ((this sync-info) (arg0 time-frame)) "Get the difference between the given time-frame and when this sync-info is at 0." (if (zero? arg0) (set! arg0 (current-time)) ) - (let* ((v1-4 (-> obj period)) + (let* ((v1-4 (-> this period)) (f0-1 (the float v1-4)) - (f1-2 (+ (the float (mod arg0 (the-as time-frame v1-4))) (-> obj offset))) + (f1-2 (+ (the float (mod arg0 (the-as time-frame v1-4))) (-> this offset))) ) (+ arg0 (the int (- f0-1 (* (/ (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)) f0-1) f0-1)))) ) ) ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-linear ((obj sync-linear) (arg0 sync-info-params)) +(defmethod initialize! sync-linear ((this sync-linear) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-linear) @@ -79,7 +79,7 @@ (-> arg0 sync-type) ) ) - (set! (-> obj sync-flags) (-> arg0 sync-flags)) + (set! (-> this sync-flags) (-> arg0 sync-flags)) (let ((s4-0 (the-as int (-> arg0 period))) (f30-0 (-> arg0 percent)) ) @@ -94,28 +94,28 @@ ) ) ) - (set! (-> obj period) (the-as uint s4-0)) + (set! (-> this period) (the-as uint s4-0)) (let* ((f0-4 (the float s4-0)) (f1-1 (* f30-0 f0-4)) ) - (set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) + (set! (-> this offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) ) ) (none) ) -(defmethod get-norm! sync-linear ((obj sync-linear) (arg0 int)) +(defmethod get-norm! sync-linear ((this sync-linear) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) ) - (let* ((v1-4 (-> obj period)) + (let* ((v1-4 (-> this period)) (f0-1 (the float v1-4)) ) (cond - ((logtest? (-> obj sync-flags) (sync-flags pong)) + ((logtest? (-> this sync-flags) (sync-flags pong)) (let* ((f1-0 2.0) - (f2-2 (+ (the float (mod arg0 (the-as int v1-4))) (-> obj offset))) + (f2-2 (+ (the float (mod arg0 (the-as int v1-4))) (-> this offset))) (f0-3 (* f1-0 (/ (- f2-2 (* (the float (the int (/ f2-2 f0-1))) f0-1)) f0-1))) ) (if (>= f0-3 1.0) @@ -125,7 +125,7 @@ ) ) (else - (let ((f1-5 (+ (the float (mod arg0 (the-as int v1-4))) (-> obj offset)))) + (let ((f1-5 (+ (the float (mod arg0 (the-as int v1-4))) (-> this offset)))) (/ (- f1-5 (* (the float (the int (/ f1-5 f0-1))) f0-1)) f0-1) ) ) @@ -133,13 +133,13 @@ ) ) -(defmethod get-scaled-val! sync-linear ((obj sync-linear) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! sync-linear ((this sync-linear) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" - (* (get-norm! obj arg1) arg0) + (* (get-norm! this arg1) arg0) ) ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-eased ((obj sync-eased) (arg0 sync-info-params)) +(defmethod initialize! sync-eased ((this sync-eased) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-eased) @@ -149,7 +149,7 @@ (-> arg0 sync-type) ) ) - (set! (-> obj sync-flags) (-> arg0 sync-flags)) + (set! (-> this sync-flags) (-> arg0 sync-flags)) (let ((s5-0 (the-as int (-> arg0 period))) (f22-0 (-> arg0 percent)) (f24-0 (-> arg0 pause-in)) @@ -176,11 +176,11 @@ ) ) ) - (set! (-> obj period) (the-as uint s5-0)) + (set! (-> this period) (the-as uint s5-0)) (let* ((f0-4 (the float s5-0)) (f1-1 (* f22-0 f0-4)) ) - (set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) + (set! (-> this offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) ) (cond ((< f26-0 0.0) @@ -199,8 +199,8 @@ ) ) (let ((f0-14 (the float s5-0))) - (set! (-> obj pause-in) (* f24-0 f0-14)) - (set! (-> obj pause-out) (* f26-0 f0-14)) + (set! (-> this pause-in) (* f24-0 f0-14)) + (set! (-> this pause-out) (* f26-0 f0-14)) ) (if (< f30-0 0.0) (set! f30-0 0.0) @@ -227,32 +227,32 @@ (f4-3 (/ f0-21 (- 1.0 f1-7))) (f3-4 (+ (* (- 1.0 f1-7) (- 1.0 f1-7) f4-3) f3-3)) ) - (set! (-> obj tlo) f0-21) - (set! (-> obj thi) f1-7) - (set! (-> obj ylo) f2-3) - (set! (-> obj m2) f4-3) - (set! (-> obj yend) f3-4) + (set! (-> this tlo) f0-21) + (set! (-> this thi) f1-7) + (set! (-> this ylo) f2-3) + (set! (-> this m2) f4-3) + (set! (-> this yend) f3-4) ) ) ) (none) ) -(defmethod get-norm! sync-eased ((obj sync-eased) (arg0 int)) +(defmethod get-norm! sync-eased ((this sync-eased) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) ) - (let* ((v1-4 (-> obj period)) + (let* ((v1-4 (-> this period)) (f3-0 (the float v1-4)) - (f0-1 (-> obj pause-in)) - (f2-0 (-> obj pause-out)) + (f0-1 (-> this pause-in)) + (f2-0 (-> this pause-out)) (f1-1 (* 0.5 (- f3-0 (+ f0-1 f2-0)))) ) (the int (+ f0-1 f2-0 f3-0)) (cond - ((logtest? (-> obj sync-flags) (sync-flags pong)) - (let* ((f4-7 (+ (the float (mod arg0 (the-as int v1-4))) (-> obj offset))) + ((logtest? (-> this sync-flags) (sync-flags pong)) + (let* ((f4-7 (+ (the float (mod arg0 (the-as int v1-4))) (-> this offset))) (f3-2 (- f4-7 (* (the float (the int (/ f4-7 f3-0))) f3-0))) (v1-6 #f) ) @@ -271,21 +271,21 @@ ) ) (let* ((f0-3 (/ (- f3-2 f0-1) f1-1)) - (f1-2 (-> obj tlo)) + (f1-2 (-> this tlo)) (f0-8 (/ (cond ((< f0-3 f1-2) (* f0-3 f0-3) ) - ((< f0-3 (-> obj thi)) - (+ (* 2.0 f1-2 (- f0-3 f1-2)) (-> obj ylo)) + ((< f0-3 (-> this thi)) + (+ (* 2.0 f1-2 (- f0-3 f1-2)) (-> this ylo)) ) (else (let ((f1-5 (- 1.0 f0-3))) - (- (-> obj yend) (* f1-5 f1-5 (-> obj m2))) + (- (-> this yend) (* f1-5 f1-5 (-> this m2))) ) ) ) - (-> obj yend) + (-> this yend) ) ) ) @@ -304,13 +304,13 @@ ) ) -(defmethod get-scaled-val! sync-eased ((obj sync-eased) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! sync-eased ((this sync-eased) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" - (* (get-norm! obj arg1) arg0) + (* (get-norm! this arg1) arg0) ) ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-paused ((obj sync-paused) (arg0 sync-info-params)) +(defmethod initialize! sync-paused ((this sync-paused) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-paused) @@ -320,7 +320,7 @@ (-> arg0 sync-type) ) ) - (set! (-> obj sync-flags) (-> arg0 sync-flags)) + (set! (-> this sync-flags) (-> arg0 sync-flags)) (let ((s5-0 (the-as int (-> arg0 period))) (f26-0 (-> arg0 percent)) (f28-0 (-> arg0 pause-in)) @@ -341,11 +341,11 @@ ) ) ) - (set! (-> obj period) (the-as uint s5-0)) + (set! (-> this period) (the-as uint s5-0)) (let* ((f0-4 (the float s5-0)) (f1-1 (* f26-0 f0-4)) ) - (set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) + (set! (-> this offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) ) (cond ((< f30-0 0.0) @@ -364,27 +364,27 @@ ) ) (let ((f0-14 (the float s5-0))) - (set! (-> obj pause-in) (* f28-0 f0-14)) - (set! (-> obj pause-out) (* f30-0 f0-14)) + (set! (-> this pause-in) (* f28-0 f0-14)) + (set! (-> this pause-out) (* f30-0 f0-14)) ) ) (none) ) -(defmethod get-norm! sync-paused ((obj sync-paused) (arg0 int)) +(defmethod get-norm! sync-paused ((this sync-paused) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) ) - (let* ((v1-4 (-> obj period)) + (let* ((v1-4 (-> this period)) (f2-0 (the float v1-4)) - (f0-1 (-> obj pause-in)) - (f1-0 (-> obj pause-out)) + (f0-1 (-> this pause-in)) + (f1-0 (-> this pause-out)) ) (the int (+ f0-1 f1-0 f2-0)) (cond - ((logtest? (-> obj sync-flags) (sync-flags pong)) - (let* ((f3-5 (+ (the float (mod arg0 (the-as int v1-4))) (-> obj offset))) + ((logtest? (-> this sync-flags) (sync-flags pong)) + (let* ((f3-5 (+ (the float (mod arg0 (the-as int v1-4))) (-> this offset))) (f3-6 (- f3-5 (* (the float (the int (/ f3-5 f2-0))) f2-0))) (f2-2 (* 0.5 (- f2-0 (+ f0-1 f1-0)))) (v1-7 #f) @@ -405,7 +405,7 @@ ) ) (else - (let* ((f3-9 (+ (the float (mod arg0 (the-as int v1-4))) (-> obj offset))) + (let* ((f3-9 (+ (the float (mod arg0 (the-as int v1-4))) (-> this offset))) (f3-10 (- f3-9 (* (the float (the int (/ f3-9 f2-0))) f2-0))) (f1-5 (- f2-0 (+ f0-1 f1-0))) (f1-6 (/ (- f3-10 f0-1) f1-5)) @@ -417,67 +417,67 @@ ) ) -(defmethod get-scaled-val! sync-paused ((obj sync-paused) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! sync-paused ((this sync-paused) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" - (* (get-norm! obj arg1) arg0) + (* (get-norm! this arg1) arg0) ) -(defmethod set-params! delayed-rand-float ((obj delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) - (set! (-> obj min-time) arg0) - (set! (-> obj max-time) arg1) - (set! (-> obj max-val) (* 0.5 arg2)) - (set! (-> obj start-time) 0) - (set! (-> obj timer) 0) - (set! (-> obj value) 0.0) - (-> obj value) +(defmethod set-params! delayed-rand-float ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) + (set! (-> this min-time) arg0) + (set! (-> this max-time) arg1) + (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this start-time) 0) + (set! (-> this timer) 0) + (set! (-> this value) 0.0) + (-> this value) ) -(defmethod reset! delayed-rand-float ((obj delayed-rand-float)) - (set! (-> obj start-time) (current-time)) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value) (rand-vu-float-range (- (-> obj max-val)) (-> obj max-val))) +(defmethod reset! delayed-rand-float ((this delayed-rand-float)) + (set-time! (-> this start-time)) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value) (rand-vu-float-range (- (-> this max-val)) (-> this max-val))) ) -(defmethod update! delayed-rand-float ((obj delayed-rand-float)) - (if (>= (- (current-time) (-> obj start-time)) (-> obj timer)) - (reset! obj) +(defmethod update! delayed-rand-float ((this delayed-rand-float)) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (reset! this) ) - (-> obj value) + (-> this value) ) ;; WARN: Return type mismatch float vs none. -(defmethod update-and-clear! delayed-rand-float ((obj delayed-rand-float)) - (if (>= (- (current-time) (-> obj start-time)) (-> obj timer)) - (reset! obj) - (set! (-> obj value) 0.0) +(defmethod update-and-clear! delayed-rand-float ((this delayed-rand-float)) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (reset! this) + (set! (-> this value) 0.0) ) - (-> obj value) + (-> this value) (none) ) -(defmethod set-params! oscillating-float ((obj oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (set! (-> obj value) arg0) - (set! (-> obj target) arg0) - (set! (-> obj vel) 0.0) - (set! (-> obj max-vel) arg2) - (set! (-> obj damping) arg3) - (set! (-> obj accel) arg1) - (-> obj value) +(defmethod set-params! oscillating-float ((this oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> this value) arg0) + (set! (-> this target) arg0) + (set! (-> this vel) 0.0) + (set! (-> this max-vel) arg2) + (set! (-> this damping) arg3) + (set! (-> this accel) arg1) + (-> this value) ) -(defmethod update! oscillating-float ((obj oscillating-float) (arg0 float)) +(defmethod update! oscillating-float ((this oscillating-float) (arg0 float)) (with-pp - (let ((f0-3 (* (- (+ (-> obj target) arg0) (-> obj value)) (* (-> obj accel) (-> pp clock time-adjust-ratio))))) - (+! (-> obj vel) f0-3) + (let ((f0-3 (* (- (+ (-> this target) arg0) (-> this value)) (* (-> this accel) (-> pp clock time-adjust-ratio))))) + (+! (-> this vel) f0-3) ) - (set! (-> obj vel) (fmin (-> obj max-vel) (fmax (- (-> obj max-vel)) (-> obj vel)))) - (set! (-> obj vel) (* (-> obj vel) (-> obj damping))) - (+! (-> obj value) (* (-> obj vel) (-> pp clock time-adjust-ratio))) - (-> obj value) + (set! (-> this vel) (fmin (-> this max-vel) (fmax (- (-> this max-vel)) (-> this vel)))) + (set! (-> this vel) (* (-> this vel) (-> this damping))) + (+! (-> this value) (* (-> this vel) (-> pp clock time-adjust-ratio))) + (-> this value) ) ) -(defmethod set-params! bouncing-float ((obj bouncing-float) +(defmethod set-params! bouncing-float ((this bouncing-float) (arg0 float) (arg1 float) (arg2 float) @@ -486,118 +486,118 @@ (arg5 float) (arg6 float) ) - (set-params! (-> obj osc) arg0 arg4 arg5 arg6) - (set! (-> obj max-value) arg1) - (set! (-> obj min-value) arg2) - (set! (-> obj elasticity) arg3) - (set! (-> obj state) 0) - (-> obj osc value) + (set-params! (-> this osc) arg0 arg4 arg5 arg6) + (set! (-> this max-value) arg1) + (set! (-> this min-value) arg2) + (set! (-> this elasticity) arg3) + (set! (-> this state) 0) + (-> this osc value) ) -(defmethod update! bouncing-float ((obj bouncing-float) (arg0 float)) - (update! (-> obj osc) arg0) - (set! (-> obj state) 0) - (when (>= (-> obj osc value) (-> obj max-value)) - (set! (-> obj osc value) (-> obj max-value)) - (if (< 0.0 (-> obj osc vel)) - (set! (-> obj osc vel) (* (-> obj osc vel) (- (-> obj elasticity)))) +(defmethod update! bouncing-float ((this bouncing-float) (arg0 float)) + (update! (-> this osc) arg0) + (set! (-> this state) 0) + (when (>= (-> this osc value) (-> this max-value)) + (set! (-> this osc value) (-> this max-value)) + (if (< 0.0 (-> this osc vel)) + (set! (-> this osc vel) (* (-> this osc vel) (- (-> this elasticity)))) ) - (set! (-> obj state) 1) + (set! (-> this state) 1) ) - (when (>= (-> obj min-value) (-> obj osc value)) - (set! (-> obj osc value) (-> obj min-value)) - (if (< (-> obj osc vel) 0.0) - (set! (-> obj osc vel) (* (-> obj osc vel) (- (-> obj elasticity)))) + (when (>= (-> this min-value) (-> this osc value)) + (set! (-> this osc value) (-> this min-value)) + (if (< (-> this osc vel) 0.0) + (set! (-> this osc vel) (* (-> this osc vel) (- (-> this elasticity)))) ) - (set! (-> obj state) -1) + (set! (-> this state) -1) ) - (-> obj osc value) + (-> this osc value) ) -(defmethod at-min? bouncing-float ((obj bouncing-float)) - (= (-> obj state) -1) +(defmethod at-min? bouncing-float ((this bouncing-float)) + (= (-> this state) -1) ) -(defmethod at-max? bouncing-float ((obj bouncing-float)) - (= (-> obj state) 1) +(defmethod at-max? bouncing-float ((this bouncing-float)) + (= (-> this state) 1) ) -(defmethod set-params! delayed-rand-vector ((obj delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) - (set! (-> obj min-time) arg0) - (set! (-> obj max-time) arg1) - (set! (-> obj xz-max) (* 0.5 arg2)) - (set! (-> obj y-max) (* 0.5 arg3)) - (set! (-> obj start-time) 0) - (set! (-> obj timer) 0) - (vector-reset! (-> obj value)) - (-> obj value) +(defmethod set-params! delayed-rand-vector ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) + (set! (-> this min-time) arg0) + (set! (-> this max-time) arg1) + (set! (-> this xz-max) (* 0.5 arg2)) + (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this start-time) 0) + (set! (-> this timer) 0) + (vector-reset! (-> this value)) + (-> this value) ) -(defmethod update-now! delayed-rand-vector ((obj delayed-rand-vector)) - (set! (-> obj start-time) (current-time)) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value x) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (set! (-> obj value y) (rand-vu-float-range (- (-> obj y-max)) (-> obj y-max))) - (set! (-> obj value z) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (-> obj value) +(defmethod update-now! delayed-rand-vector ((this delayed-rand-vector)) + (set-time! (-> this start-time)) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (set! (-> this value y) (rand-vu-float-range (- (-> this y-max)) (-> this y-max))) + (set! (-> this value z) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (-> this value) ) -(defmethod update-with-delay! delayed-rand-vector ((obj delayed-rand-vector)) - (if (>= (- (current-time) (-> obj start-time)) (-> obj timer)) - (update-now! obj) +(defmethod update-with-delay! delayed-rand-vector ((this delayed-rand-vector)) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (update-now! this) ) - (-> obj value) + (-> this value) ) -(defmethod update-with-delay-or-reset! delayed-rand-vector ((obj delayed-rand-vector)) - (if (>= (- (current-time) (-> obj start-time)) (-> obj timer)) - (update-now! obj) - (vector-reset! (-> obj value)) +(defmethod update-with-delay-or-reset! delayed-rand-vector ((this delayed-rand-vector)) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (update-now! this) + (vector-reset! (-> this value)) ) - (-> obj value) + (-> this value) ) -(defmethod set-params! oscillating-vector ((obj oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod set-params! oscillating-vector ((this oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> obj value quad) (-> arg0 quad)) - (set! (-> obj target quad) (-> arg0 quad)) + (set! (-> this value quad) (-> arg0 quad)) + (set! (-> this target quad) (-> arg0 quad)) ) (else - (vector-reset! (-> obj value)) - (vector-reset! (-> obj target)) + (vector-reset! (-> this value)) + (vector-reset! (-> this target)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj max-vel) arg2) - (set! (-> obj damping) arg3) - (set! (-> obj accel) arg1) - (-> obj value) + (vector-reset! (-> this vel)) + (set! (-> this max-vel) arg2) + (set! (-> this damping) arg3) + (set! (-> this accel) arg1) + (-> this value) ) -(defmethod update! oscillating-vector ((obj oscillating-vector) (arg0 vector)) +(defmethod update! oscillating-vector ((this oscillating-vector) (arg0 vector)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vector))) (cond (arg0 - (vector+! v1-0 (-> obj target) arg0) - (vector-! v1-0 v1-0 (-> obj value)) + (vector+! v1-0 (-> this target) arg0) + (vector-! v1-0 v1-0 (-> this value)) ) (else - (vector-! v1-0 (-> obj target) (-> obj value)) + (vector-! v1-0 (-> this target) (-> this value)) ) ) - (vector-float*! v1-0 v1-0 (* (-> obj accel) (-> pp clock time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) v1-0) - (let ((f0-2 (vector-length (-> obj vel)))) - (if (< (-> obj max-vel) f0-2) - (vector-float*! (-> obj vel) (-> obj vel) (/ (-> obj max-vel) f0-2)) + (vector-float*! v1-0 v1-0 (* (-> this accel) (-> pp clock time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) v1-0) + (let ((f0-2 (vector-length (-> this vel)))) + (if (< (-> this max-vel) f0-2) + (vector-float*! (-> this vel) (-> this vel) (/ (-> this max-vel) f0-2)) ) ) - (vector-float*! (-> obj vel) (-> obj vel) (-> obj damping)) - (vector-float*! v1-0 (-> obj vel) (-> pp clock time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) v1-0) + (vector-float*! (-> this vel) (-> this vel) (-> this damping)) + (vector-float*! v1-0 (-> this vel) (-> pp clock time-adjust-ratio)) + (vector+! (-> this value) (-> this value) v1-0) ) - (-> obj value) + (-> this value) ) ) diff --git a/goal_src/jak2/kernel/dgo-h.gc b/goal_src/jak2/kernel/dgo-h.gc index 797b79127f..4e4edd4c47 100644 --- a/goal_src/jak2/kernel/dgo-h.gc +++ b/goal_src/jak2/kernel/dgo-h.gc @@ -22,6 +22,7 @@ see also load-dgo.gc's dgo-header. :flag-assert #x900000008 ) + (deftype dgo-file (basic) ((num-go-files uint32 :offset-assert 4) (total-length uint32 :offset-assert 8) diff --git a/goal_src/jak2/kernel/gcommon.gc b/goal_src/jak2/kernel/gcommon.gc index 509a07b838..d7d5037aba 100644 --- a/goal_src/jak2/kernel/gcommon.gc +++ b/goal_src/jak2/kernel/gcommon.gc @@ -187,15 +187,15 @@ :flag-assert #x900000010 ) -(defmethod print vec4s ((obj vec4s)) +(defmethod print vec4s ((this vec4s)) "Custom print for vec4s that prints the 4 values." (format #t "#" - (-> obj x) - (-> obj y) - (-> obj z) - (-> obj w) - obj) - obj + (-> this x) + (-> this y) + (-> this z) + (-> this w) + this) + this ) ;; vector: main 4-element floating point vector. @@ -242,18 +242,18 @@ :flag-assert #x900000008 ) -(defmethod print bfloat ((obj bfloat)) - (format #t "~f" (-> obj data)) - obj +(defmethod print bfloat ((this bfloat)) + (format #t "~f" (-> this data)) + this ) ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type System ;;;;;;;;;;;;;;;;;;;;;;;;;; -(defmethod asize-of type ((obj type)) +(defmethod asize-of type ((this type)) "Get the size in memory of a type. The value calculated here is wrong." - (the-as int (logand (the-as uint #xfffffff0) (+ (* (-> obj allocated-length) 4) 43))) + (the-as int (logand (the-as uint #xfffffff0) (+ (* (-> this allocated-length) 4) 43))) ) (defun basic-type? ((arg0 basic) (arg1 type)) @@ -333,15 +333,15 @@ (car arg0) ) -(defmethod length pair ((obj pair)) +(defmethod length pair ((this pair)) "Get the length of a linked list." (local-vars (v0-0 int)) (cond - ((null? obj) + ((null? this) (set! v0-0 0) ) (else - (let ((v1-1 (cdr obj))) + (let ((v1-1 (cdr this))) (set! v0-0 1) (while (and (not (null? v1-1)) (pair? v1-1)) (+! v0-0 1) @@ -353,7 +353,7 @@ v0-0 ) -(defmethod asize-of pair ((obj pair)) +(defmethod asize-of pair ((this pair)) "Get the size in memory of a pair." (the-as int (-> pair size)) ) @@ -371,7 +371,7 @@ ) (defun member ((arg0 object) (arg1 object)) - "Is obj in the list lst? Returns pair with obj as its car, or #f if not found." + "Is this in the list lst? Returns pair with this as its car, or #f if not found." (let ((v1-0 arg1)) (while (not (or (null? v1-0) (= (car v1-0) arg0))) (set! v1-0 (cdr v1-0)) @@ -386,7 +386,7 @@ (define-extern name= (function object object symbol)) (defun nmember ((arg0 basic) (arg1 object)) - "Is obj in the list lst? Check with the name= function." + "Is this in the list lst? Check with the name= function." (while (not (or (null? arg1) (name= (car arg1) arg0))) (set! arg1 (cdr arg1)) ) @@ -610,15 +610,15 @@ ) ) -(defmethod length inline-array-class ((obj inline-array-class)) +(defmethod length inline-array-class ((this inline-array-class)) "Get the length of the inline-array-class. This is the length field, not how much storage there is" - (-> obj length) + (-> this length) ) -(defmethod asize-of inline-array-class ((obj inline-array-class)) +(defmethod asize-of inline-array-class ((this inline-array-class)) "Get the size in memory of an inline-array-class." - (the-as int (+ (-> obj type size) (* (-> obj allocated-length) (the-as int (-> obj type heap-base))))) + (the-as int (+ (-> this type size) (* (-> this allocated-length) (the-as int (-> this type heap-base))))) ) ;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -657,241 +657,241 @@ ) ) -(defmethod print array ((obj array)) +(defmethod print array ((this array)) (format #t "#(") (cond - ((type-type? (-> obj content-type) integer) - (case (-> obj content-type symbol) + ((type-type? (-> this content-type) integer) + (case (-> this content-type symbol) (('int32) - (dotimes (s5-0 (-> obj length)) + (dotimes (s5-0 (-> this length)) (format #t (if (zero? s5-0) "~D" " ~D" ) - (-> (the-as (array int32) obj) s5-0) + (-> (the-as (array int32) this) s5-0) ) ) ) (('uint32) - (dotimes (s5-1 (-> obj length)) + (dotimes (s5-1 (-> this length)) (format #t (if (zero? s5-1) "~D" " ~D" ) - (-> (the-as (array uint32) obj) s5-1) + (-> (the-as (array uint32) this) s5-1) ) ) ) (('int64) - (dotimes (s5-2 (-> obj length)) + (dotimes (s5-2 (-> this length)) (format #t (if (zero? s5-2) "~D" " ~D" ) - (-> (the-as (array int64) obj) s5-2) + (-> (the-as (array int64) this) s5-2) ) ) ) (('uint64) - (dotimes (s5-3 (-> obj length)) + (dotimes (s5-3 (-> this length)) (format #t (if (zero? s5-3) "#x~X" " #x~X" ) - (-> (the-as (array uint64) obj) s5-3) + (-> (the-as (array uint64) this) s5-3) ) ) ) (('int8) - (dotimes (s5-4 (-> obj length)) + (dotimes (s5-4 (-> this length)) (format #t (if (zero? s5-4) "~D" " ~D" ) - (-> (the-as (array int8) obj) s5-4) + (-> (the-as (array int8) this) s5-4) ) ) ) (('uint8) - (dotimes (s5-5 (-> obj length)) + (dotimes (s5-5 (-> this length)) (format #t (if (zero? s5-5) "~D" " ~D" ) - (-> (the-as (array uint8) obj) s5-5) + (-> (the-as (array uint8) this) s5-5) ) ) ) (('int16) - (dotimes (s5-6 (-> obj length)) + (dotimes (s5-6 (-> this length)) (format #t (if (zero? s5-6) "~D" " ~D" ) - (-> (the-as (array int16) obj) s5-6) + (-> (the-as (array int16) this) s5-6) ) ) ) (('uint16) - (dotimes (s5-7 (-> obj length)) + (dotimes (s5-7 (-> this length)) (format #t (if (zero? s5-7) "~D" " ~D" ) - (-> (the-as (array uint16) obj) s5-7) + (-> (the-as (array uint16) this) s5-7) ) ) ) (('uint128 'int128) - (dotimes (s5-8 (-> obj length)) + (dotimes (s5-8 (-> this length)) (format #t (if (zero? s5-8) "#x~X" " #x~X" ) - (-> (the-as (array uint128) obj) s5-8) + (-> (the-as (array uint128) this) s5-8) ) ) ) (else - (dotimes (s5-9 (-> obj length)) + (dotimes (s5-9 (-> this length)) (format #t (if (zero? s5-9) "~D" " ~D" ) - (-> (the-as (array int32) obj) s5-9) + (-> (the-as (array int32) this) s5-9) ) ) ) ) ) - ((= (-> obj content-type) float) - (dotimes (s5-10 (-> obj length)) + ((= (-> this content-type) float) + (dotimes (s5-10 (-> this length)) (if (zero? s5-10) - (format #t "~f" (-> (the-as (array float) obj) s5-10)) - (format #t " ~f" (-> (the-as (array float) obj) s5-10)) + (format #t "~f" (-> (the-as (array float) this) s5-10)) + (format #t " ~f" (-> (the-as (array float) this) s5-10)) ) ) ) (else - (dotimes (s5-11 (-> obj length)) + (dotimes (s5-11 (-> this length)) (if (zero? s5-11) - (format #t "~A" (-> (the-as (array basic) obj) s5-11)) - (format #t " ~A" (-> (the-as (array basic) obj) s5-11)) + (format #t "~A" (-> (the-as (array basic) this) s5-11)) + (format #t " ~A" (-> (the-as (array basic) this) s5-11)) ) ) ) ) (format #t ")") - obj + this ) -(defmethod inspect array ((obj array)) +(defmethod inspect array ((this array)) "Inspect an array" - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tcontent-type: ~A~%" (-> obj content-type)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tcontent-type: ~A~%" (-> this content-type)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this allocated-length) (-> this data)) (cond - ((and (= (logand (the-as int (-> obj content-type)) 7) 4) (type-type? (-> obj content-type) integer)) - (case (-> obj content-type symbol) + ((and (= (logand (the-as int (-> this content-type)) 7) 4) (type-type? (-> this content-type) integer)) + (case (-> this content-type symbol) (('int32) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-0 (-> (the-as (array int32) obj) s5-0)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~D~%" s5-0 (-> (the-as (array int32) this) s5-0)) ) ) (('uint32) - (dotimes (s5-1 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-1 (-> (the-as (array uint32) obj) s5-1)) + (dotimes (s5-1 (-> this length)) + (format #t "~T [~D] ~D~%" s5-1 (-> (the-as (array uint32) this) s5-1)) ) ) (('int64) - (dotimes (s5-2 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-2 (-> (the-as (array int64) obj) s5-2)) + (dotimes (s5-2 (-> this length)) + (format #t "~T [~D] ~D~%" s5-2 (-> (the-as (array int64) this) s5-2)) ) ) (('uint64) - (dotimes (s5-3 (-> obj length)) - (format #t "~T [~D] #x~X~%" s5-3 (-> (the-as (array uint64) obj) s5-3)) + (dotimes (s5-3 (-> this length)) + (format #t "~T [~D] #x~X~%" s5-3 (-> (the-as (array uint64) this) s5-3)) ) ) (('int8) - (dotimes (s5-4 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-4 (-> (the-as (array int8) obj) s5-4)) + (dotimes (s5-4 (-> this length)) + (format #t "~T [~D] ~D~%" s5-4 (-> (the-as (array int8) this) s5-4)) ) ) (('uint8) - (dotimes (s5-5 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-5 (-> (the-as (array int8) obj) s5-5)) + (dotimes (s5-5 (-> this length)) + (format #t "~T [~D] ~D~%" s5-5 (-> (the-as (array int8) this) s5-5)) ) ) (('int16) - (dotimes (s5-6 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-6 (-> (the-as (array int16) obj) s5-6)) + (dotimes (s5-6 (-> this length)) + (format #t "~T [~D] ~D~%" s5-6 (-> (the-as (array int16) this) s5-6)) ) ) (('uint16) - (dotimes (s5-7 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-7 (-> (the-as (array uint16) obj) s5-7)) + (dotimes (s5-7 (-> this length)) + (format #t "~T [~D] ~D~%" s5-7 (-> (the-as (array uint16) this) s5-7)) ) ) (('int128 'uint128) - (dotimes (s5-8 (-> obj length)) - (format #t "~T [~D] #x~X~%" s5-8 (-> (the-as (array uint128) obj) s5-8)) + (dotimes (s5-8 (-> this length)) + (format #t "~T [~D] #x~X~%" s5-8 (-> (the-as (array uint128) this) s5-8)) ) ) (else - (dotimes (s5-9 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-9 (-> (the-as (array int32) obj) s5-9)) + (dotimes (s5-9 (-> this length)) + (format #t "~T [~D] ~D~%" s5-9 (-> (the-as (array int32) this) s5-9)) ) ) ) ) - ((= (-> obj content-type) float) - (dotimes (s5-10 (-> obj length)) - (format #t "~T [~D] ~f~%" s5-10 (-> (the-as (array float) obj) s5-10)) + ((= (-> this content-type) float) + (dotimes (s5-10 (-> this length)) + (format #t "~T [~D] ~f~%" s5-10 (-> (the-as (array float) this) s5-10)) ) ) (else - (dotimes (s5-11 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-11 (-> (the-as (array basic) obj) s5-11)) + (dotimes (s5-11 (-> this length)) + (format #t "~T [~D] ~A~%" s5-11 (-> (the-as (array basic) this) s5-11)) ) ) ) - obj + this ) -(defmethod length array ((obj array)) +(defmethod length array ((this array)) "Get the length of an array" - (-> obj length) + (-> this length) ) -(defmethod asize-of array ((obj array)) +(defmethod asize-of array ((this array)) "Get the size in memory of an array" (the-as int - (+ (-> obj type size) (* (-> obj allocated-length) (if (type-type? (-> obj content-type) number) - (the-as int (-> obj content-type size)) + (+ (-> this type size) (* (-> this allocated-length) (if (type-type? (-> this content-type) number) + (the-as int (-> this content-type size)) 4 ) ) @@ -1008,15 +1008,15 @@ ((method-of-type (rtype-of arg0) print) arg0) ) -(defmacro printl (obj) +(defmacro printl (this) "Print out a boxed object and a newline. Note: we define both a macro and a function on purpose. The compiler will use the macro over the function, which will allow it to pick the correct print method for non-boxed objects" `(begin - (print ,obj) + (print ,this) (format #t "~%") - ,obj + ,this ) ) @@ -1091,7 +1091,7 @@ (define-extern boolean type) ;; not really... but they use it here as if it was one. (define-extern valid? (function object type string symbol object symbol)) -(defun valid? ((obj object) (expected-type type) (name string) (allow-false symbol) (print-dest object)) +(defun valid? ((this object) (expected-type type) (name string) (allow-false symbol) (print-dest object)) "Check if the given object is valid. This will work for structures, pairs, basics, bintegers, symbols, and types. If you set expected-type to #f, it just checks for a 4-byte aligned address that's in GOAL memory. If you're checking a structure, set expected-type to structure. This requires 16-byte alignment @@ -1105,21 +1105,21 @@ Use a name of #f to suppress error prints. " (let ((v1-1 - (and (>= (the-as uint obj) (start-of-symbol-table)) (< (the-as uint obj) END_OF_MEMORY)) + (and (>= (the-as uint this) (start-of-symbol-table)) (< (the-as uint this) END_OF_MEMORY)) ) ) (cond ((not expected-type) (cond - ((logtest? (the-as int obj) 3) + ((logtest? (the-as int this) 3) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object (misaligned)~%" obj name) + (format print-dest "ERROR: object #x~X ~S is not a valid object (misaligned)~%" this name) ) #f ) ((not v1-1) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object (bad address)~%" obj name) + (format print-dest "ERROR: object #x~X ~S is not a valid object (bad address)~%" this name) ) #f ) @@ -1128,20 +1128,20 @@ ) ) ) - ((and allow-false (not obj)) + ((and allow-false (not this)) #t ) ((= expected-type structure) (cond - ((logtest? (the-as int obj) 15) + ((logtest? (the-as int this) 15) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type) ) #f ) - ((or (not v1-1) (< (the-as uint obj) (end-of-symbol-table))) + ((or (not v1-1) (< (the-as uint this) (end-of-symbol-table))) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" this name expected-type) ) #f ) @@ -1152,15 +1152,15 @@ ) ((= expected-type pair) (cond - ((not (pair? obj)) + ((not (pair? this)) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type) ) #f ) ((not v1-1) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" this name expected-type) ) #f ) @@ -1171,12 +1171,12 @@ ) ((= expected-type binteger) (cond - ((zero? (logand (the-as int obj) 7)) + ((zero? (logand (the-as int this) 7)) #t ) (else (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type) ) #f ) @@ -1184,15 +1184,15 @@ ) ((or (= expected-type symbol) (= expected-type boolean)) (cond - ((zero? (logand (the-as int obj) 1)) + ((zero? (logand (the-as int this) 1)) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type) ) #f ) - ((or (not v1-1) (< (the-as int obj) (start-of-symbol-table))(>= (the-as int obj) (end-of-symbol-table))) + ((or (not v1-1) (< (the-as int this) (start-of-symbol-table))(>= (the-as int this) (end-of-symbol-table))) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" this name expected-type) ) #f ) @@ -1201,65 +1201,65 @@ ) ) ) - ((!= (logand (the-as int obj) 7) 4) + ((!= (logand (the-as int this) 7) 4) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" this name expected-type) ) #f ) ((not v1-1) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" obj name expected-type) + (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" this name expected-type) ) #f ) - ((and (= expected-type type) (!= (rtype-of obj) type)) + ((and (= expected-type type) (!= (rtype-of this) type)) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (invalid type #x~X)~%" - obj + this name expected-type - (rtype-of obj) + (rtype-of this) ) ) #f ) - ((and (!= expected-type type) (not (valid? (rtype-of obj) type (the-as string #f) #t 0))) + ((and (!= expected-type type) (not (valid? (rtype-of this) type (the-as string #f) #t 0))) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (invalid type #x~X)~%" - obj + this name expected-type - (rtype-of obj) + (rtype-of this) ) ) #f ) - ((not (type? obj expected-type)) + ((not (type? this expected-type)) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (is type '~A' instead)~%" - obj + this name expected-type - (rtype-of obj) + (rtype-of this) ) ) #f ) ((= expected-type symbol) (cond - ((>= (the-as uint obj) (end-of-symbol-table)) + ((>= (the-as uint this) (end-of-symbol-table)) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (not in symbol table)~%" - obj + this name expected-type ) @@ -1271,12 +1271,12 @@ ) ) ) - ((< (the-as uint obj) (end-of-symbol-table)) + ((< (the-as uint this) (end-of-symbol-table)) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (inside symbol table)~%" - obj + this name expected-type ) diff --git a/goal_src/jak2/kernel/gkernel-h.gc b/goal_src/jak2/kernel/gkernel-h.gc index b16e98b648..784d9869ce 100644 --- a/goal_src/jak2/kernel/gkernel-h.gc +++ b/goal_src/jak2/kernel/gkernel-h.gc @@ -456,14 +456,14 @@ :flag-assert #x900000008 ) -(defmethod inspect handle ((obj handle)) - (when (not obj) - (return obj) +(defmethod inspect handle ((this handle)) + (when (not this) + (return this) ) - (format #t "[~8x] ~A~%" obj 'handle) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Tpid: ~D~%" (-> obj pid)) - obj + (format #t "[~8x] ~A~%" this 'handle) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + this ) (defmacro handle->process (handle) @@ -507,12 +507,12 @@ `(ppointer->handle (process->ppointer (the-as process ,proc))) ) -(defmethod print handle ((obj handle)) - (if (nonzero? obj) - (format #t "#" (handle->process obj) (-> obj pid)) +(defmethod print handle ((this handle)) + (if (nonzero? this) + (format #t "#" (handle->process this) (-> this pid)) (format #t "#") ) - obj + this ) ;; A "state" defines functions that a process should run when it is in that state. @@ -603,14 +603,14 @@ ) ) -(defmethod print sql-result ((obj sql-result)) +(defmethod print sql-result ((this sql-result)) "Print a sql-result as an array of symbols." - (format #t "#(~A" (-> obj error)) - (dotimes (s5-0 (-> obj len)) - (format #t " ~A" (-> obj data s5-0)) + (format #t "#(~A" (-> this error)) + (dotimes (s5-0 (-> this len)) + (format #t " ~A" (-> this data s5-0)) ) (format #t ")") - obj + this ) ;; the result that the C Kernel will send us. @@ -775,3 +775,11 @@ (-> PP clock seconds-per-frame) ) ) + +(defmacro set-time! (time) + `(set! ,time (current-time)) + ) + +(defmacro time-elapsed? (time duration) + `(>= (- (current-time) ,time) ,duration) + ) \ No newline at end of file diff --git a/goal_src/jak2/kernel/gkernel.gc b/goal_src/jak2/kernel/gkernel.gc index 701c9fc2ba..94740dc174 100644 --- a/goal_src/jak2/kernel/gkernel.gc +++ b/goal_src/jak2/kernel/gkernel.gc @@ -41,9 +41,9 @@ (define *last-loado-global-usage* 0) (define *last-loado-debug-usage* 0) -(defmethod relocate object ((obj object) (arg0 int)) +(defmethod relocate object ((this object) (arg0 int)) "Most general relocate method." - obj + this ) ;;;;;;;;;;;;;;;;;; @@ -154,34 +154,34 @@ ;; Thread ;;;;;;;;;;;;; -(defmethod delete thread ((obj thread)) +(defmethod delete thread ((this thread)) "Restore the previous thread as the top-thread." ;; make sure we aren't actually trying to delete the main thread. - (when (= obj (-> obj process main-thread)) + (when (= this (-> this process main-thread)) (break!) ) - (set! (-> obj process top-thread) (the-as cpu-thread (-> obj previous))) + (set! (-> this process top-thread) (the-as cpu-thread (-> this previous))) (none) ) -(defmethod print thread ((obj thread)) - (format #t "#<~A ~S of ~S pc: #x~X @ #x~X>" (-> obj type) (-> obj name) (-> obj process name) (-> obj pc) obj) - obj +(defmethod print thread ((this thread)) + (format #t "#<~A ~S of ~S pc: #x~X @ #x~X>" (-> this type) (-> this name) (-> this process name) (-> this pc) this) + this ) -(defmethod stack-size-set! thread ((obj thread) (arg0 int)) +(defmethod stack-size-set! thread ((this thread) (arg0 int)) "Modify the backup stack size of a thread. Must be called from the main thread, before any allocations have been done on the process heap." - (let ((a2-0 (-> obj process))) + (let ((a2-0 (-> this process))) (cond - ((!= obj (-> a2-0 main-thread)) + ((!= this (-> a2-0 main-thread)) (format 0 "ERROR: illegal attempt change stack size of ~A when the main-thread is not the top-thread.~%" a2-0) ) - ((= (-> obj stack-size) arg0) + ((= (-> this stack-size) arg0) ) - ((= (-> a2-0 heap-cur) (+ (+ (-> obj stack-size) -4 (-> obj type size)) (the-as int obj))) - (set! (-> a2-0 heap-cur) (the-as pointer (+ (+ arg0 -4 (-> obj type size)) (the-as int obj)))) - (set! (-> obj stack-size) arg0) + ((= (-> a2-0 heap-cur) (+ (+ (-> this stack-size) -4 (-> this type size)) (the-as int this))) + (set! (-> a2-0 heap-cur) (the-as pointer (+ (+ arg0 -4 (-> this type size)) (the-as int this)))) + (set! (-> this stack-size) arg0) ) (else (format 0 "ERROR: illegal attempt change stack size of ~A after more heap allocation has occured.~%" a2-0) @@ -227,9 +227,9 @@ ) ) -(defmethod asize-of cpu-thread ((obj cpu-thread)) +(defmethod asize-of cpu-thread ((this cpu-thread)) "Get the size in memory of a cpu-thread." - (the-as int (+ (-> obj type size) (-> obj stack-size))) + (the-as int (+ (-> this type size) (-> this stack-size))) ) ;;;;;;;;;;;;;;; @@ -257,10 +257,10 @@ (define *master-mode* 'game) (define *pause-lock* #f) -(defmethod print process-tree ((obj process-tree)) +(defmethod print process-tree ((this process-tree)) "Print a process tree." - (format #t "#<~A ~S @ #x~X>" (-> obj type) (-> obj name) obj) - obj + (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) + this ) (defmethod new process-tree ((allocation symbol) (type-to-make type) (arg0 string)) @@ -278,18 +278,18 @@ ) ) -(defmethod inspect process-tree ((obj process-tree)) +(defmethod inspect process-tree ((this process-tree)) "Inspect a process-tree" - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~S~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (stream<-process-mask #t (-> obj mask)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~S~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (stream<-process-mask #t (-> this mask)) (format #t ")~%") - (format #t "~Tclock: ~A~%" (-> obj clock)) - (format #t "~Tparent: ~A~%" (ppointer->process (-> obj parent))) - (format #t "~Tbrother: ~A~%" (ppointer->process (-> obj brother))) - (format #t "~Tchild: ~A~%" (ppointer->process (-> obj child))) - obj + (format #t "~Tclock: ~A~%" (-> this clock)) + (format #t "~Tparent: ~A~%" (ppointer->process (-> this parent))) + (format #t "~Tbrother: ~A~%" (ppointer->process (-> this brother))) + (format #t "~Tchild: ~A~%" (ppointer->process (-> this child))) + this ) (defmethod new process ((allocation symbol) (type-to-make type) (arg0 string) (arg1 int)) @@ -334,11 +334,11 @@ ) ) -(defun inspect-process-heap ((obj process)) +(defun inspect-process-heap ((this process)) "Inspect each object on the process heap." - (let ((ptr (&+ (-> obj heap-base) *gtype-basic-offset*))) ; point to first basic + (let ((ptr (&+ (-> this heap-base) *gtype-basic-offset*))) ; point to first basic ;; loop over objects - (while (< (the int ptr) (the int (-> obj heap-cur))) + (while (< (the int ptr) (the int (-> this heap-cur))) ;; inspect the object (inspect (the basic ptr)) ;; seek to the next object on the heap. @@ -348,83 +348,83 @@ #f ) -(defmethod inspect process ((obj process)) +(defmethod inspect process ((this process)) "Inspect process and all objects on the heap.. Autogenerated proces inspects will eventually call this one." - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~S~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (stream<-process-mask #t (-> obj mask)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~S~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (stream<-process-mask #t (-> this mask)) (format #t ")~%") - (format #t "~Tclock: ~A~%" (-> obj clock)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tlevel: ~A~%" (-> obj level)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tparent: ~A~%" (ppointer->process (-> obj parent))) - (format #t "~Tbrother: ~A~%" (ppointer->process (-> obj brother))) - (format #t "~Tchild: ~A~%" (ppointer->process (-> obj child))) - (format #t "~Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) + (format #t "~Tclock: ~A~%" (-> this clock)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tlevel: ~A~%" (-> this level)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tparent: ~A~%" (ppointer->process (-> this parent))) + (format #t "~Tbrother: ~A~%" (ppointer->process (-> this brother))) + (format #t "~Tchild: ~A~%" (ppointer->process (-> this child))) + (format #t "~Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) (let ((s5-0 *print-column*)) (set! *print-column* (+ *print-column* *tab-size*)) (format #t "----~%") - (inspect-process-heap obj) + (inspect-process-heap this) (format #t "----~%") (set! *print-column* s5-0) ) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tstack[~D] @ #x~X~%" (-> obj allocated-length) (-> obj stack)) - obj + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tstack[~D] @ #x~X~%" (-> this allocated-length) (-> this stack)) + this ) -(defmethod asize-of process ((obj process)) +(defmethod asize-of process ((this process)) "Get the size in memory of a process." - (the-as int (+ (-> process size) (-> obj allocated-length))) + (the-as int (+ (-> process size) (-> this allocated-length))) ) -(defmethod print process ((obj process)) +(defmethod print process ((this process)) "Print a process." ;; new: for jak 2, they don't print garbage stack/heap sizes when the process isn't ;; activated yet. (cond - ((and (-> obj top-thread) (!= (-> obj status) 'dead)) + ((and (-> this top-thread) (!= (-> this status) 'dead)) (format #t "#<~A ~S ~A :state ~S " - (-> obj type) - (-> obj name) - (-> obj status) - (if (-> obj state) (-> obj state name)) + (-> this type) + (-> this name) + (-> this status) + (if (-> this state) (-> this state name)) ) (format #t ":stack ~D/~D :heap ~D/~D @ #x~X>" - (&- (-> obj top-thread stack-top) (the-as uint (-> obj top-thread sp))) - (-> obj main-thread stack-size) - (- (-> obj allocated-length) (&- (-> obj heap-top) (the-as uint (-> obj heap-cur)))) - (-> obj allocated-length) - obj + (&- (-> this top-thread stack-top) (the-as uint (-> this top-thread sp))) + (-> this main-thread stack-size) + (- (-> this allocated-length) (&- (-> this heap-top) (the-as uint (-> this heap-cur)))) + (-> this allocated-length) + this ) ) (else (format #t "#<~A ~S ~A :state ~S @ #x~X" - (-> obj type) - (-> obj name) - (-> obj status) - (if (-> obj state) - (-> obj state name) + (-> this type) + (-> this name) + (-> this status) + (if (-> this state) + (-> this state name) ) - obj + this ) ) ) - obj + this ) ;; decomp deviation @@ -527,7 +527,7 @@ ) ) -(defun reset-and-call ((obj thread) (func function)) +(defun reset-and-call ((this thread) (func function)) "Make the given thread the top thread, reset the stack, and call the function. Sets up a return trampoline so when the function returns it will return to the kernel context. Will NOT deactivate on return, so this is intended for temporary threads. @@ -548,10 +548,10 @@ ) ;; set up the process pointer - (set! pp (-> obj process)) + (set! pp (-> this process)) ;; mark the process as running and set its top thread (set! (-> pp status) 'running) - (set! (-> pp top-thread) (the cpu-thread obj)) + (set! (-> pp top-thread) (the cpu-thread this)) ;; save the current kernel regs (.push :color #f s0) @@ -566,7 +566,7 @@ (set! *kernel-sp* (the pointer sp)) ;; todo, asm form here? ;; setup the rsp for the new thread - (set! sp (the uint (-> obj stack-top))) + (set! sp (the uint (-> this stack-top))) (.add sp off) ;; push the return trampoline to the stack for the user code to return to @@ -587,7 +587,7 @@ ;; we begin this function with the thread object in pp. ;; not sure why we do this, maybe at one point suspending didn't clobber ;; temp registers? - (rlet ((obj :reg r13 :type cpu-thread) + (rlet ((this :reg r13 :type cpu-thread) (temp :reg rax :type uint) (off :reg r15 :type uint) (sp :reg rsp :type uint) @@ -612,48 +612,48 @@ ;; convert to a GOAL address (.sub temp off) ;; store return address in thread - (set! (-> obj pc) (the pointer temp)) + (set! (-> this pc) (the pointer temp)) ;; convert our stack pointer to a GOAL address (.sub sp off) ;; store in thread. - (set! (-> obj sp) (the pointer sp)) + (set! (-> this sp) (the pointer sp)) ;; back up registers (.mov :color #f temp s0) - (set! (-> obj rreg 0) temp) + (set! (-> this rreg 0) temp) (.mov :color #f temp s1) - (set! (-> obj rreg 1) temp) + (set! (-> this rreg 1) temp) (.mov :color #f temp s2) - (set! (-> obj rreg 2) temp) + (set! (-> this rreg 2) temp) (.mov :color #f temp s3) - (set! (-> obj rreg 3) temp) + (set! (-> this rreg 3) temp) (.mov :color #f temp s4) - (set! (-> obj rreg 4) temp) + (set! (-> this rreg 4) temp) ;; back up fprs (.mov :color #f temp xmm8) - (set! (-> obj freg 0) (the-as float temp)) + (set! (-> this freg 0) (the-as float temp)) (.mov :color #f temp xmm9) - (set! (-> obj freg 1) (the-as float temp)) + (set! (-> this freg 1) (the-as float temp)) (.mov :color #f temp xmm10) - (set! (-> obj freg 2) (the-as float temp)) + (set! (-> this freg 2) (the-as float temp)) (.mov :color #f temp xmm11) - (set! (-> obj freg 3) (the-as float temp)) + (set! (-> this freg 3) (the-as float temp)) (.mov :color #f temp xmm12) - (set! (-> obj freg 4) (the-as float temp)) + (set! (-> this freg 4) (the-as float temp)) (.mov :color #f temp xmm13) - (set! (-> obj freg 5) (the-as float temp)) + (set! (-> this freg 5) (the-as float temp)) (.mov :color #f temp xmm14) - (set! (-> obj freg 6) (the-as float temp)) + (set! (-> this freg 6) (the-as float temp)) (.mov :color #f temp xmm15) - (set! (-> obj freg 7) (the-as float temp)) + (set! (-> this freg 7) (the-as float temp)) ;; get our process - (let ((proc (-> obj process))) - (when (> (process-stack-used proc) (-> obj stack-size)) + (let ((proc (-> this process))) + (when (> (process-stack-used proc) (-> this stack-size)) (break) ;; too much stack has been used and we can't suspend! ;; if you hit this, try with DEBUG_PRINT_SUSPEND_FAIL set to #t (see gkernel-h.gc) ;; it will print more info before reaching here. @@ -661,8 +661,8 @@ ;; mark the process as suspended and copy the stack (set! (-> proc status) 'suspended) - (let ((cur (the (pointer uint64) (-> obj stack-top))) - (save (&+ (the (pointer uint64) (-> obj stack)) (-> obj stack-size))) + (let ((cur (the (pointer uint64) (-> this stack-top))) + (save (&+ (the (pointer uint64) (-> this stack)) (-> this stack-size))) ) (while (> (the int cur) (the int sp)) (set! cur (the (pointer uint64) (&- cur 8))) @@ -673,7 +673,7 @@ ) ;; actually setting pp to 0 - (set! obj (the cpu-thread 0)) + (set! this (the cpu-thread 0)) ;; get the kernel stack pointer as a GOAL pointer (.load-sym :sext #f sp *kernel-sp*) @@ -701,7 +701,7 @@ ;;(print-asm) ) - (rlet ((obj :reg r13 :type cpu-thread) + (rlet ((this :reg r13 :type cpu-thread) (temp :reg rax :type uint) (off :reg r15 :type uint) (sp :reg rsp :type uint) @@ -737,14 +737,14 @@ (set! *kernel-sp* (the pointer sp)) ;; todo, asm form here? ;; temp, stash thread in process-pointer - (set! obj thread-to-resume) + (set! this thread-to-resume) ;; set stack pointer for the thread. leave it as a GOAL pointer for now.. - (set! sp (the uint (-> obj sp))) + (set! sp (the uint (-> this sp))) ;; restore the stack (sp is a GOAL pointer) - (let ((cur (the (pointer uint64) (-> obj stack-top))) - (restore (&+ (the (pointer uint64) (-> obj stack)) (-> obj stack-size))) + (let ((cur (the (pointer uint64) (-> this stack-top))) + (restore (&+ (the (pointer uint64) (-> this stack)) (-> this stack-size))) ) (while (> (the int cur) (the int sp)) (set! cur (the (pointer uint64) (&- cur 8))) @@ -757,35 +757,35 @@ (.add sp off) ;; setup process - (set! (-> (-> obj process) top-thread) obj) - (set! (-> (-> obj process) status) 'running) + (set! (-> (-> this process) top-thread) this) + (set! (-> (-> this process) status) 'running) ;; restore reg - (set! temp (-> obj rreg 0)) + (set! temp (-> this rreg 0)) (.mov :color #f s0 temp) - (set! temp (-> obj rreg 1)) + (set! temp (-> this rreg 1)) (.mov :color #f s1 temp) - (set! temp (-> obj rreg 2)) + (set! temp (-> this rreg 2)) (.mov :color #f s2 temp) - (set! temp (-> obj rreg 3)) + (set! temp (-> this rreg 3)) (.mov :color #f s3 temp) - (set! temp (-> obj rreg 4)) + (set! temp (-> this rreg 4)) (.mov :color #f s4 temp) - (set! temp-float (-> obj freg 0)) + (set! temp-float (-> this freg 0)) (.mov :color #f xmm8 temp-float) - (set! temp-float (-> obj freg 1)) + (set! temp-float (-> this freg 1)) (.mov :color #f xmm9 temp-float) - (set! temp-float (-> obj freg 2)) + (set! temp-float (-> this freg 2)) (.mov :color #f xmm10 temp-float) - (set! temp-float (-> obj freg 3)) + (set! temp-float (-> this freg 3)) (.mov :color #f xmm11 temp-float) - (set! temp-float (-> obj freg 4)) + (set! temp-float (-> this freg 4)) (.mov :color #f xmm12 temp-float) - (set! temp-float (-> obj freg 5)) + (set! temp-float (-> this freg 5)) (.mov :color #f xmm13 temp-float) - (set! temp-float (-> obj freg 6)) + (set! temp-float (-> this freg 6)) (.mov :color #f xmm14 temp-float) - (set! temp-float (-> obj freg 7)) + (set! temp-float (-> this freg 7)) (.mov :color #f xmm15 temp-float) ;; hack for set-to-run-bootstrap. The set-to-run-bootstrap in MIPS @@ -798,17 +798,17 @@ ;; so we load the a4/a5 argument registers with rreg 5 and rreg 6 ;; In the case where we are doing a normal resume, the ;; compiler should assume that these registers are overwritten anyway. - (set! temp (-> obj rreg 5)) + (set! temp (-> this rreg 5)) (.mov a4 temp) - (set! temp (-> obj rreg 6)) + (set! temp (-> this rreg 6)) (.mov a5 temp) ;; get the resume address - (set! temp (the uint (-> obj pc))) + (set! temp (the uint (-> this pc))) (.add temp off) ;; setup the process - (set! obj (the cpu-thread (-> obj process))) + (set! this (the cpu-thread (-> this process))) ;; resume! (.jr temp) (.add a4 a4) @@ -844,12 +844,12 @@ ) ;; decomp deviation -(defmethod get-process dead-pool ((obj dead-pool) (arg0 type) (arg1 int)) +(defmethod get-process dead-pool ((this dead-pool) (arg0 type) (arg1 int)) "Try to get a process from this dead pool. If it fails, try the debug dead pool and complain." ;; grab the first child - (let ((s4-0 (the-as object (-> obj child)))) - (when (and (not (the-as (pointer process-tree) s4-0)) *debug-segment* (!= obj *debug-dead-pool*)) + (let ((s4-0 (the-as object (-> this child)))) + (when (and (not (the-as (pointer process-tree) s4-0)) *debug-segment* (!= this *debug-dead-pool*)) ;; didn't work, but we have the debug dead pool to try ;; NOTE: this is a type bug here, s4-0 should be (pointer process), but this uses process. (set! s4-0 (get-process *debug-dead-pool* arg0 arg1)) @@ -859,7 +859,7 @@ (format 0 "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%" arg0 #f ;; (ppointer->process (the-as process s4-0)) bugged in original game - (-> obj name) + (-> this name) ) ) ;; this didn't work right in the original game, just crash here. @@ -876,7 +876,7 @@ (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" arg0 (ppointer->process (the-as (pointer process) s4-0)) - (-> obj name) + (-> this name) ) (the-as process #f) ) @@ -885,9 +885,9 @@ ) ;; decomp deviation -(defmethod return-process dead-pool ((obj dead-pool) (arg0 process)) +(defmethod return-process dead-pool ((this dead-pool) (arg0 process)) "Return a process to the dead pool." - (change-parent arg0 obj) + (change-parent arg0 this) (none) ) @@ -907,64 +907,64 @@ ) ) -(defmethod init dead-pool-heap ((obj dead-pool-heap) (arg0 symbol) (arg1 int)) +(defmethod init dead-pool-heap ((this dead-pool-heap) (arg0 symbol) (arg1 int)) "Initialize the heap." ;; setup the records in a linked list, all referring to *null-process*. - (countdown (v1-0 (-> obj allocated-length)) - (let ((a0-4 (-> obj process-list v1-0))) + (countdown (v1-0 (-> this allocated-length)) + (let ((a0-4 (-> this process-list v1-0))) (set! (-> a0-4 process) *null-process*) - (set! (-> a0-4 next) (-> obj process-list (+ v1-0 1))) + (set! (-> a0-4 next) (-> this process-list (+ v1-0 1))) ) ) ;; set the dead list to that list - (set! (-> obj dead-list next) (the-as dead-pool-heap-rec (-> obj process-list))) + (set! (-> this dead-list next) (the-as dead-pool-heap-rec (-> this process-list))) ;; clear alive list - (set! (-> obj alive-list process) #f) + (set! (-> this alive-list process) #f) ;; terminate dead list. - (set! (-> obj process-list (+ (-> obj allocated-length) -1) next) #f) - (set! (-> obj alive-list prev) (-> obj alive-list)) - (set! (-> obj alive-list next) #f) - (set! (-> obj alive-list process) #f) - (set! (-> obj first-gap) (-> obj alive-list)) - (set! (-> obj first-shrink) #f) + (set! (-> this process-list (+ (-> this allocated-length) -1) next) #f) + (set! (-> this alive-list prev) (-> this alive-list)) + (set! (-> this alive-list next) #f) + (set! (-> this alive-list process) #f) + (set! (-> this first-gap) (-> this alive-list)) + (set! (-> this first-shrink) #f) (cond ((zero? arg1) ;; explicit support for a 0 size heap. - (set! (-> obj heap base) (the-as pointer 0)) - (set! (-> obj heap current) (the-as pointer 0)) - (set! (-> obj heap top) (the-as pointer 0)) - (set! (-> obj heap top-base) (the-as pointer 0)) + (set! (-> this heap base) (the-as pointer 0)) + (set! (-> this heap current) (the-as pointer 0)) + (set! (-> this heap top) (the-as pointer 0)) + (set! (-> this heap top-base) (the-as pointer 0)) 0 ) (else ;; otherwise allocate a heap. - (set! (-> obj heap base) (malloc arg0 arg1)) - (set! (-> obj heap current) (-> obj heap base)) - (set! (-> obj heap top) (&+ (-> obj heap base) arg1)) - (set! (-> obj heap top-base) (-> obj heap top)) + (set! (-> this heap base) (malloc arg0 arg1)) + (set! (-> this heap current) (-> this heap base)) + (set! (-> this heap top) (&+ (-> this heap base) arg1)) + (set! (-> this heap top-base) (-> this heap top)) ) ) (none) ) -(defmethod gap-location dead-pool-heap ((obj dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-location dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) "Get the location of the first possible gap after the given record." (the-as pointer (if (-> arg0 process) ;; if we have a process, after that process (+ (+ (-> arg0 process allocated-length) -4 (-> process size)) (the-as int (-> arg0 process))) ;; no process, just the start of the dead pool's big heap. - (-> obj heap base) + (-> this heap base) ) ) ) -(defmethod gap-size dead-pool-heap ((obj dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-size dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) "Get the size of the gap after the given record (possibly 0)" (cond ((-> arg0 process) @@ -974,131 +974,131 @@ ;; and there's a next process, just get the gap in between those (&- (the-as pointer (-> arg0 next process)) (the-as uint v1-3)) ;; no next process, the gap is just the distance to the end of the dead pool's heap. - (&- (-> obj heap top) (the-as uint (&+ v1-3 4))) + (&- (-> this heap top) (the-as uint (&+ v1-3 4))) ) ) ) ((-> arg0 next) ;; record has no proc, go from start of dead pool heap to the next process. - (&- (the-as pointer (-> arg0 next process)) (the-as uint (&+ (-> obj heap base) 4))) + (&- (the-as pointer (-> arg0 next process)) (the-as uint (&+ (-> this heap base) 4))) ) (else ;; no processes at all, the gap is the entire heap. - (&- (-> obj heap top) (the-as uint (-> obj heap base))) + (&- (-> this heap top) (the-as uint (-> this heap base))) ) ) ) -(defmethod find-gap dead-pool-heap ((obj dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod find-gap dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) "Iterate through records, starting at the given one, and find the first one with a gap after it." - (while (and (-> arg0 next) (zero? (gap-size obj arg0))) + (while (and (-> arg0 next) (zero? (gap-size this arg0))) (set! arg0 (-> arg0 next)) ) arg0 ) -(defmethod inspect dead-pool-heap ((obj dead-pool-heap)) +(defmethod inspect dead-pool-heap ((this dead-pool-heap)) "Inspect a dead-pool heap, printing proccesses and gaps." - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (stream<-process-mask #t (-> obj mask)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (stream<-process-mask #t (-> this mask)) (format #t ")~%") - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Theap: #~%" (-> obj heap)) - (format #t "~Tfirst-gap: #~%" (-> obj first-gap)) - (format #t "~Tfirst-shrink: #~%" (-> obj first-shrink)) - (format #t "~Talive-list: #~%" (-> obj alive-list)) - (format #t "~Tlast: #~%" (-> obj alive-list prev)) - (format #t "~Tdead-list: #~%" (-> obj dead-list)) - (let* ((s5-0 (&- (-> obj heap top) (the-as uint (-> obj heap base)))) - (v1-3 (if (-> obj alive-list prev) - (gap-size obj (-> obj alive-list prev)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Theap: #~%" (-> this heap)) + (format #t "~Tfirst-gap: #~%" (-> this first-gap)) + (format #t "~Tfirst-shrink: #~%" (-> this first-shrink)) + (format #t "~Talive-list: #~%" (-> this alive-list)) + (format #t "~Tlast: #~%" (-> this alive-list prev)) + (format #t "~Tdead-list: #~%" (-> this dead-list)) + (let* ((s5-0 (&- (-> this heap top) (the-as uint (-> this heap base)))) + (v1-3 (if (-> this alive-list prev) + (gap-size this (-> this alive-list prev)) s5-0 ) ) ) - (format #t "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%" (-> obj process-list) (- s5-0 v1-3) s5-0) + (format #t "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%" (-> this process-list) (- s5-0 v1-3) s5-0) ) - (let ((s5-1 (-> obj alive-list)) + (let ((s5-1 (-> this alive-list)) (s4-0 0) ) (while s5-1 (if (-> s5-1 process) (format #t "~T [~3D] # ~A~%" s4-0 s5-1 (-> s5-1 process)) ) - (let ((s3-0 (gap-size obj s5-1))) + (let ((s3-0 (gap-size this s5-1))) (if (nonzero? s3-0) - (format #t "~T gap: ~D bytes @ #x~X~%" s3-0 (gap-location obj s5-1)) + (format #t "~T gap: ~D bytes @ #x~X~%" s3-0 (gap-location this s5-1)) ) ) (set! s5-1 (-> s5-1 next)) (+! s4-0 1) ) ) - obj + this ) -(defmethod asize-of dead-pool-heap ((obj dead-pool-heap)) +(defmethod asize-of dead-pool-heap ((this dead-pool-heap)) "Get the size in memory of a dead-pool-heap." - (the-as int (+ (-> obj type size) (* 12 (-> obj allocated-length)))) + (the-as int (+ (-> this type size) (* 12 (-> this allocated-length)))) ) -(defmethod memory-used dead-pool-heap ((obj dead-pool-heap)) +(defmethod memory-used dead-pool-heap ((this dead-pool-heap)) "Get the amount of used memory. Gaps in between processes are considered used." - (if (-> obj alive-list prev) - (- (memory-total obj) (gap-size obj (-> obj alive-list prev))) + (if (-> this alive-list prev) + (- (memory-total this) (gap-size this (-> this alive-list prev))) 0 ) ) -(defmethod memory-total dead-pool-heap ((obj dead-pool-heap)) +(defmethod memory-total dead-pool-heap ((this dead-pool-heap)) "Get the total size of the heap." - (&- (-> obj heap top) (the-as uint (-> obj heap base))) + (&- (-> this heap top) (the-as uint (-> this heap base))) ) -(defmethod memory-free dead-pool-heap ((obj dead-pool-heap)) +(defmethod memory-free dead-pool-heap ((this dead-pool-heap)) "Get the amount of free memory. Does not include gaps in between processes." - (let ((v1-0 (-> obj heap top))) - (if (-> obj alive-list prev) - (gap-size obj (-> obj alive-list prev)) - (&- v1-0 (the-as uint (-> obj heap base))) + (let ((v1-0 (-> this heap top))) + (if (-> this alive-list prev) + (gap-size this (-> this alive-list prev)) + (&- v1-0 (the-as uint (-> this heap base))) ) ) ) -(defmethod compact-time dead-pool-heap ((obj dead-pool-heap)) +(defmethod compact-time dead-pool-heap ((this dead-pool-heap)) "Not working, likely was supposed to return how long the compaction took." ;; never set. - (-> obj compact-time) + (-> this compact-time) ) -(defmethod find-gap-by-size dead-pool-heap ((obj dead-pool-heap) (arg0 int)) +(defmethod find-gap-by-size dead-pool-heap ((this dead-pool-heap) (arg0 int)) "Find the first gap which is at least the given size." - (let ((gp-0 (-> obj first-gap))) - (while (and gp-0 (< (gap-size obj gp-0) arg0)) + (let ((gp-0 (-> this first-gap))) + (while (and gp-0 (< (gap-size this gp-0) arg0)) (set! gp-0 (-> gp-0 next)) ) gp-0 ) ) -(defmethod get-process dead-pool-heap ((obj dead-pool-heap) (arg0 type) (arg1 int)) +(defmethod get-process dead-pool-heap ((this dead-pool-heap) (arg0 type) (arg1 int)) "Get a process!" - (let ((s4-0 (-> obj dead-list next)) + (let ((s4-0 (-> this dead-list next)) (s3-0 (the-as process #f)) ) ;; find a gap! - (let ((s1-0 (find-gap-by-size obj (the-as int (+ (-> process size) arg1))))) + (let ((s1-0 (find-gap-by-size this (the-as int (+ (-> process size) arg1))))) (cond - ((and s4-0 s1-0 (nonzero? (-> obj heap base))) ;; have record, gap, and heap, we are good! + ((and s4-0 s1-0 (nonzero? (-> this heap base))) ;; have record, gap, and heap, we are good! ;; get record - (set! (-> obj dead-list next) (-> s4-0 next)) + (set! (-> this dead-list next) (-> s4-0 next)) (let ((v1-6 (-> s1-0 next))) (set! (-> s1-0 next) s4-0) (set! (-> s4-0 next) v1-6) @@ -1107,12 +1107,12 @@ ) ) (set! (-> s4-0 prev) s1-0) - (if (= s1-0 (-> obj alive-list prev)) - (set! (-> obj alive-list prev) s4-0) + (if (= s1-0 (-> this alive-list prev)) + (set! (-> this alive-list prev) s4-0) ) ;; construct process in-place - (let ((a0-5 (gap-location obj s1-0))) + (let ((a0-5 (gap-location this s1-0))) (set! s3-0 ((method-of-type process new) (the-as symbol a0-5) process "process" arg1)) ) @@ -1121,20 +1121,20 @@ (set! (-> s3-0 ppointer) (&-> s4-0 process)) ;; update gap/shrinks - (if (= (-> obj first-gap) s1-0) - (set! (-> obj first-gap) (find-gap obj s4-0)) + (if (= (-> this first-gap) s1-0) + (set! (-> this first-gap) (find-gap this s4-0)) ) - (if (or (not (-> obj first-shrink)) (< (the-as int s3-0) (the-as int (-> obj first-shrink process)))) - (set! (-> obj first-shrink) s4-0) + (if (or (not (-> this first-shrink)) (< (the-as int s3-0) (the-as int (-> this first-shrink process)))) + (set! (-> this first-shrink) s4-0) ) ;; setup process - (set! (-> s3-0 parent) (-> obj ppointer)) - (set! (-> s3-0 pool) obj) - (set! (-> obj child) (&-> s4-0 process)) + (set! (-> s3-0 parent) (-> this ppointer)) + (set! (-> s3-0 pool) this) + (set! (-> this child) (&-> s4-0 process)) ) (else - (when (and *debug-segment* (!= obj *debug-dead-pool*)) + (when (and *debug-segment* (!= this *debug-dead-pool*)) (set! s3-0 (get-process *debug-dead-pool* arg0 arg1)) (if (and s3-0 *vis-boot*) (format @@ -1142,7 +1142,7 @@ "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%" arg0 s3-0 - (-> obj name) + (-> this name) ) ) ) @@ -1151,45 +1151,45 @@ ) (if s3-0 (set! (-> s3-0 type) arg0) - (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" arg0 s3-0 (-> obj name)) + (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" arg0 s3-0 (-> this name)) ) s3-0 ) ) ;; decomp deviation -(defmethod return-process dead-pool-heap ((obj dead-pool-heap) (proc process)) +(defmethod return-process dead-pool-heap ((this dead-pool-heap) (proc process)) "Return a process to a dead pool heap" ;; check we are returning to the correct pool - (unless (eq? obj (-> proc pool)) - (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" proc obj) + (unless (eq? this (-> proc pool)) + (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" proc this) ) ;; reclaim us. - (change-parent proc obj) + (change-parent proc this) ;; we don't maintain a real tree for a dead-pool-heap, so undo any change to child ;; done by change-parent - (set! (-> obj child) #f) + (set! (-> this child) #f) ;; we know our ppointer is really a rec for a dead-pool-heap process, so we can use ;; this trick to quickly find our rec. (let ((rec (the dead-pool-heap-rec (-> proc ppointer)))) ;; if we are at or below the first gap, update first gap. - (when (or (eq? (-> obj first-gap) rec) - (< (the int (gap-location obj rec)) (the int (gap-location obj (-> obj first-gap)))) + (when (or (eq? (-> this first-gap) rec) + (< (the int (gap-location this rec)) (the int (gap-location this (-> this first-gap)))) ) - (set! (-> obj first-gap) (-> rec prev)) + (set! (-> this first-gap) (-> rec prev)) ) ;; update the first-shrink. We aren't smart about this and just move it backward. - (when (eq? (-> obj first-shrink) rec) - (set! (-> obj first-shrink) (-> rec prev)) - (when (not (-> obj first-shrink process)) - (set! (-> obj first-shrink) #f)) + (when (eq? (-> this first-shrink) rec) + (set! (-> this first-shrink) (-> rec prev)) + (when (not (-> this first-shrink process)) + (set! (-> this first-shrink) #f)) ) ;; remove us from list @@ -1201,20 +1201,20 @@ ) (else ;; we were last, update that. - (set! (-> obj last) (-> rec prev)) + (set! (-> this last) (-> rec prev)) ) ) ;; insert at the front of the dead list. - (set! (-> rec next) (-> obj dead-list next)) - (set! (-> obj dead-list next) rec) + (set! (-> rec next) (-> this dead-list next)) + (set! (-> this dead-list next) rec) (set! (-> rec process) *null-process*) (none) ) ) -(defmethod shrink-heap dead-pool-heap ((obj dead-pool-heap) (proc process)) +(defmethod shrink-heap dead-pool-heap ((this dead-pool-heap) (proc process)) "Shrink the heap of a process. This resizes the process heap to be the exact size it is currently using." (when proc @@ -1230,8 +1230,8 @@ (set! (-> proc heap-top) (&-> (-> proc stack) (-> proc allocated-length))) ;; update first gap - (when (< (the int proc) (the int (gap-location obj (-> obj first-gap)))) - (set! (-> obj first-gap) (find-gap obj rec)) + (when (< (the int proc) (the int (gap-location this (-> this first-gap)))) + (set! (-> this first-gap) (find-gap this rec)) ) ;; mark us as shrunk @@ -1239,26 +1239,26 @@ ) ;; update first shrink - (when (eq? (-> obj first-shrink) rec) - (set! (-> obj first-shrink) (-> rec next)) + (when (eq? (-> this first-shrink) rec) + (set! (-> this first-shrink) (-> rec next)) ) ) ) - obj + this ) ;; decomp deviation -(defmethod compact dead-pool-heap ((obj dead-pool-heap) (arg0 int)) +(defmethod compact dead-pool-heap ((this dead-pool-heap) (arg0 int)) "Relocate processes to remove gaps and increase free memory." ;; skip if we're an empty dead-pool-heap - (if (zero? (-> obj heap base)) + (if (zero? (-> this heap base)) (return 0) ) ;; if we're almost out of memory, increase the compaction amount. - (let* ((s4-0 (memory-free obj)) - (v1-5 (memory-total obj)) + (let* ((s4-0 (memory-free this)) + (v1-5 (memory-total this)) (f0-2 (/ (the float s4-0) (the float v1-5))) ) (cond @@ -1277,30 +1277,30 @@ ) ) ) - (set! (-> obj compact-count-targ) (the-as uint arg0)) - (set! (-> obj compact-count) (the-as uint 0)) + (set! (-> this compact-count-targ) (the-as uint arg0)) + (set! (-> this compact-count) (the-as uint 0)) ;; loop over compactions. (while (nonzero? arg0) (+! arg0 -1) ;; try to get something to shrink - (let ((v1-19 (-> obj first-shrink))) + (let ((v1-19 (-> this first-shrink))) (when (not v1-19) - (set! v1-19 (-> obj alive-list next)) - (set! (-> obj first-shrink) v1-19) + (set! v1-19 (-> this alive-list next)) + (set! (-> this first-shrink) v1-19) ) (if v1-19 ;; got something, shrink it. - (shrink-heap obj (-> v1-19 process)) + (shrink-heap this (-> v1-19 process)) ) ) ;; move to fill the gap. - (let ((s4-1 (-> obj first-gap))) + (let ((s4-1 (-> this first-gap))) (when (-> s4-1 next) (let ((s3-0 (-> s4-1 next process)) - (s2-0 (gap-size obj s4-1)) + (s2-0 (gap-size this s4-1)) ) (when (nonzero? s2-0) (when (< s2-0 0) @@ -1308,12 +1308,12 @@ (break!) ) ;; shrink before moving. - (shrink-heap obj s3-0) + (shrink-heap this s3-0) ;; do the relocation! the relocate method of process does the actual memcpy. (relocate s3-0 (- s2-0)) ;; update gaps - (set! (-> obj first-gap) (find-gap obj s4-1)) - (+! (-> obj compact-count) 1) + (set! (-> this first-gap) (find-gap this s4-1)) + (+! (-> this compact-count) 1) ) ) ) @@ -1323,29 +1323,29 @@ (none) ) -(defmethod churn dead-pool-heap ((obj dead-pool-heap) (arg0 int)) +(defmethod churn dead-pool-heap ((this dead-pool-heap) (arg0 int)) "Relocate processes to debug process relocation." (while (nonzero? arg0) (+! arg0 -1) - (let ((s4-0 (-> obj alive-list next))) + (let ((s4-0 (-> this alive-list next))) (when s4-0 - (if (or (= (-> obj first-gap) s4-0) - (< (the-as int (gap-location obj s4-0)) (the-as int (gap-location obj (-> obj first-gap)))) + (if (or (= (-> this first-gap) s4-0) + (< (the-as int (gap-location this s4-0)) (the-as int (gap-location this (-> this first-gap)))) ) - (set! (-> obj first-gap) (-> s4-0 prev)) + (set! (-> this first-gap) (-> s4-0 prev)) ) - (when (= (-> obj first-shrink) s4-0) - (set! (-> obj first-shrink) (-> s4-0 prev)) - (if (not (-> obj first-shrink process)) - (set! (-> obj first-shrink) #f) + (when (= (-> this first-shrink) s4-0) + (set! (-> this first-shrink) (-> s4-0 prev)) + (if (not (-> this first-shrink process)) + (set! (-> this first-shrink) #f) ) ) (set! (-> s4-0 prev next) (-> s4-0 next)) (if (-> s4-0 next) (set! (-> s4-0 next prev) (-> s4-0 prev)) - (set! (-> obj alive-list prev) (-> s4-0 prev)) + (set! (-> this alive-list prev) (-> s4-0 prev)) ) - (let ((a1-3 (-> obj alive-list prev))) + (let ((a1-3 (-> this alive-list prev))) (let ((v1-19 (-> a1-3 next))) (set! (-> a1-3 next) s4-0) (set! (-> s4-0 next) v1-19) @@ -1354,9 +1354,9 @@ ) ) (set! (-> s4-0 prev) a1-3) - (set! (-> obj alive-list prev) s4-0) + (set! (-> this alive-list prev) s4-0) (set! (-> s4-0 process) - (relocate (-> s4-0 process) (&- (gap-location obj a1-3) (the-as uint (&-> (-> s4-0 process) type)))) + (relocate (-> s4-0 process) (&- (gap-location this a1-3) (the-as uint (&-> (-> s4-0 process) type)))) ) ) ) @@ -1467,7 +1467,7 @@ #f ) -(defmethod run-logic? process ((obj process)) +(defmethod run-logic? process ((this process)) "Should this process be run by the kernel?" #t ) @@ -1813,56 +1813,56 @@ ) ;; we treat the allocation as an address. - (let ((obj (the catch-frame (&+ (the pointer allocation) *gtype-basic-offset*)))) + (let ((this (the catch-frame (&+ (the pointer allocation) *gtype-basic-offset*)))) ;; setup catch frame - (set! (-> obj type) type-to-make) - (set! (-> obj name) name) + (set! (-> this type) type-to-make) + (set! (-> this name) name) ;; get the return address (the compiler won't touch the stack because we're an asm-func) (.pop temp) (.push temp) ;; make it a GOAL address so it fits in 32 bits (.sub temp off) ;; store it - (set! (-> obj ra) (the int temp)) + (set! (-> this ra) (the int temp)) ;; todo, do we need a stack offset here? ;; remember the stack pointer (set! temp sp) (.sub temp off) - (set! (-> obj sp) (the int temp)) + (set! (-> this sp) (the int temp)) ;; back up registers we care about (.mov :color #f temp s0) - (set-u128-as-u64! (-> obj rreg 0) temp) + (set-u128-as-u64! (-> this rreg 0) temp) (.mov :color #f temp s1) - (set-u128-as-u64! (-> obj rreg 1) temp) + (set-u128-as-u64! (-> this rreg 1) temp) (.mov :color #f temp s2) - (set-u128-as-u64! (-> obj rreg 2) temp) + (set-u128-as-u64! (-> this rreg 2) temp) (.mov :color #f temp s3) - (set-u128-as-u64! (-> obj rreg 3) temp) + (set-u128-as-u64! (-> this rreg 3) temp) (.mov :color #f temp s4) - (set-u128-as-u64! (-> obj rreg 4) temp) + (set-u128-as-u64! (-> this rreg 4) temp) (.mov :color #f temp xmm8) - (set! (-> obj freg 0) (the-as float temp)) + (set! (-> this freg 0) (the-as float temp)) (.mov :color #f temp xmm9) - (set! (-> obj freg 1) (the-as float temp)) + (set! (-> this freg 1) (the-as float temp)) (.mov :color #f temp xmm10) - (set! (-> obj freg 2) (the-as float temp)) + (set! (-> this freg 2) (the-as float temp)) (.mov :color #f temp xmm11) - (set! (-> obj freg 3) (the-as float temp)) + (set! (-> this freg 3) (the-as float temp)) (.mov :color #f temp xmm12) - (set! (-> obj freg 4) (the-as float temp)) + (set! (-> this freg 4) (the-as float temp)) (.mov :color #f temp xmm13) - (set! (-> obj freg 5) (the-as float temp)) + (set! (-> this freg 5) (the-as float temp)) (.mov :color #f temp xmm14) - (set! (-> obj freg 6) (the-as float temp)) + (set! (-> this freg 6) (the-as float temp)) (.mov :color #f temp xmm15) - (set! (-> obj freg 7) (the-as float temp)) + (set! (-> this freg 7) (the-as float temp)) ;; push this stack frame - (set! (-> obj next) (-> pp stack-frame-top)) - (set! (-> pp stack-frame-top) obj) + (set! (-> this next) (-> pp stack-frame-top)) + (set! (-> pp stack-frame-top) this) ;; help coloring, it isn't smart enough to realize it's "safe" to use these registers. (.push :color #f s3) @@ -1892,7 +1892,7 @@ ) ) -(defun throw-dispatch ((obj catch-frame) value) +(defun throw-dispatch ((this catch-frame) value) "Throw the given value to the catch frame. Only can throw a 64-bit value. The original could throw 128 bits." (declare (asm-func none)) @@ -1919,44 +1919,44 @@ ) ;; pop everything we threw past - (set! (-> pp stack-frame-top) (-> obj next)) + (set! (-> pp stack-frame-top) (-> this next)) ;; restore regs we care about. - (set-u64-from-u128! temp (-> obj rreg 0)) + (set-u64-from-u128! temp (-> this rreg 0)) (.mov :color #f s0 temp) - (set-u64-from-u128! temp (-> obj rreg 1)) + (set-u64-from-u128! temp (-> this rreg 1)) (.mov :color #f s1 temp) - (set-u64-from-u128! temp (-> obj rreg 2)) + (set-u64-from-u128! temp (-> this rreg 2)) (.mov :color #f s2 temp) - (set-u64-from-u128! temp (-> obj rreg 3)) + (set-u64-from-u128! temp (-> this rreg 3)) (.mov :color #f s3 temp) - (set-u64-from-u128! temp (-> obj rreg 4)) + (set-u64-from-u128! temp (-> this rreg 4)) (.mov :color #f s4 temp) - (set! temp-float (-> obj freg 0)) + (set! temp-float (-> this freg 0)) (.mov :color #f xmm8 temp-float) - (set! temp-float (-> obj freg 1)) + (set! temp-float (-> this freg 1)) (.mov :color #f xmm9 temp-float) - (set! temp-float (-> obj freg 2)) + (set! temp-float (-> this freg 2)) (.mov :color #f xmm10 temp-float) - (set! temp-float (-> obj freg 3)) + (set! temp-float (-> this freg 3)) (.mov :color #f xmm11 temp-float) - (set! temp-float (-> obj freg 4)) + (set! temp-float (-> this freg 4)) (.mov :color #f xmm12 temp-float) - (set! temp-float (-> obj freg 5)) + (set! temp-float (-> this freg 5)) (.mov :color #f xmm13 temp-float) - (set! temp-float (-> obj freg 6)) + (set! temp-float (-> this freg 6)) (.mov :color #f xmm14 temp-float) - (set! temp-float (-> obj freg 7)) + (set! temp-float (-> this freg 7)) (.mov :color #f xmm15 temp-float) ;; set stack pointer - (set! sp (the uint (-> obj sp))) + (set! sp (the uint (-> this sp))) (.add sp off) ;; overwrite our return address (.pop temp) - (set! temp (the uint (-> obj ra))) + (set! temp (the uint (-> this ra))) (.add temp off) (.push temp) @@ -2136,7 +2136,7 @@ ) ;; decomp deviation -(defmethod activate process ((obj process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) +(defmethod activate process ((this process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) "Start a process!" ;; if we got the scratchpad stack, move to the fake scratchpad. (#when PC_PORT @@ -2144,53 +2144,53 @@ (set! arg2 (&+ *fake-scratchpad-stack* (* 32 1024))) ) ) - (set! (-> obj mask) (logclear (-> arg0 mask) (process-mask sleep sleep-code process-tree heap-shrunk))) + (set! (-> this mask) (logclear (-> arg0 mask) (process-mask sleep sleep-code process-tree heap-shrunk))) ;; inherit clock - (set! (-> obj clock) (-> arg0 clock)) - (set! (-> obj status) 'ready) + (set! (-> this clock) (-> arg0 clock)) + (set! (-> this status) 'ready) ;; get unique pid (let ((v1-5 (-> *kernel-context* next-pid))) - (set! (-> obj pid) v1-5) + (set! (-> this pid) v1-5) (set! (-> *kernel-context* next-pid) (+ v1-5 1)) ) - (set! (-> obj top-thread) #f) - (set! (-> obj main-thread) #f) - (set! (-> obj name) (the-as string arg1)) + (set! (-> this top-thread) #f) + (set! (-> this main-thread) #f) + (set! (-> this name) (the-as string arg1)) ;; adjust heap to leave a gap for child of process fields - (let ((v1-10 (&-> obj stack (-> obj type heap-base)))) - (set! (-> obj heap-cur) v1-10) - (set! (-> obj heap-base) v1-10) + (let ((v1-10 (&-> this stack (-> this type heap-base)))) + (set! (-> this heap-cur) v1-10) + (set! (-> this heap-base) v1-10) ) - (set! (-> obj stack-frame-top) #f) + (set! (-> this stack-frame-top) #f) ;; clear the heap - (mem-set32! (-> obj stack) (the-as int (shr (-> obj type heap-base) 2)) 0) - (set! (-> obj trans-hook) #f) - (set! (-> obj post-hook) #f) - (set! (-> obj event-hook) #f) - (set! (-> obj state) #f) - (set! (-> obj next-state) #f) + (mem-set32! (-> this stack) (the-as int (shr (-> this type heap-base) 2)) 0) + (set! (-> this trans-hook) #f) + (set! (-> this post-hook) #f) + (set! (-> this event-hook) #f) + (set! (-> this state) #f) + (set! (-> this next-state) #f) (cond ((logtest? (-> arg0 mask) (process-mask process-tree)) ;; spawned with a tree as the parent, which doesn't have a level/entity. So pick defaults - (set! (-> obj entity) #f) - (set! (-> obj level) *default-level*) + (set! (-> this entity) #f) + (set! (-> this level) *default-level*) ) (else ;; parent is another process, inherit level/entity. - (set! (-> obj entity) (-> (the-as process arg0) entity)) - (set! (-> obj level) (-> (the-as process arg0) level)) + (set! (-> this entity) (-> (the-as process arg0) entity)) + (set! (-> this level) (-> (the-as process arg0) level)) ) ) - (set! (-> obj connection-list next1) #f) - (set! (-> obj connection-list prev1) #f) + (set! (-> this connection-list next1) #f) + (set! (-> this connection-list prev1) #f) ;; set up main thread that can be suspended. - (set! (-> obj main-thread) (new 'process 'cpu-thread obj 'code 256 arg2)) + (set! (-> this main-thread) (new 'process 'cpu-thread this 'code 256 arg2)) ;; move to the active pool - (change-parent obj arg0) + (change-parent this arg0) ) -(defun run-function-in-process ((obj process) (func function) a0 a1 a2 a3 a4 a5) +(defun run-function-in-process ((this process) (func function) a0 a1 a2 a3 a4 a5) "Switch to the given process and run the function. This is used to initialize a process. The function will run until it attempts to change state. At the first attempt to change state, this function will return. The idea is that you use this when you want to initialize a process NOW. @@ -2215,7 +2215,7 @@ (let* ((old-pp pp) (func-val (begin ;; set the process - (set! pp obj) + (set! pp this) ;; set us as initializing (set! (-> pp status) 'initialize) ;; run! @@ -2326,7 +2326,7 @@ ) ) -(defmethod deactivate process-tree ((obj process-tree)) +(defmethod deactivate process-tree ((this process-tree)) (none) ) @@ -2346,24 +2346,24 @@ (define entity-deactivate-handler (the-as (function process entity-actor none) nothing)) ;; decomp deviation -(defmethod deactivate process ((obj process)) +(defmethod deactivate process ((this process)) "Kill a process." (with-pp ;; only if we're not already dead - (when (!= (-> obj status) 'dead) + (when (!= (-> this status) 'dead) ;; set our next-state to dead. We'll run the exit function of the current state, and it can look at this ;; to tell that process is being killed. - (set! (-> obj next-state) dead-state) + (set! (-> this next-state) dead-state) ;; clean up entity stuff. - (if (-> obj entity) - (entity-deactivate-handler obj (the-as entity-actor (-> obj entity))) + (if (-> this entity) + (entity-deactivate-handler this (the-as entity-actor (-> this entity))) ) ;; clean up stack frames. This will run the exit function of the current state (let ((s5-0 pp)) ;; set process pointer to the deactivating process, to allow deactivations from another process. - (set! pp obj) + (set! pp this) (let ((s4-0 (-> pp stack-frame-top))) (while (the-as protect-frame s4-0) (case (-> s4-0 type) @@ -2380,11 +2380,11 @@ ;; clean up connection/engine stuff (if (!= 0 (the uint process-disconnect)) - (process-disconnect obj) + (process-disconnect this) ) ;; kill our children - (let ((v1-12 (-> obj child))) + (let ((v1-12 (-> this child))) (while v1-12 (let ((s5-1 (-> v1-12 0 brother))) (deactivate (-> v1-12 0)) @@ -2394,33 +2394,33 @@ ) ;; return process memory to the pool - (return-process (-> obj pool) obj) + (return-process (-> this pool) this) ;; clear fields to avoid confusion - (set! (-> obj state) #f) - (set! (-> obj next-state) #f) - (set! (-> obj entity) #f) - (set! (-> obj pid) 0) + (set! (-> this state) #f) + (set! (-> this next-state) #f) + (set! (-> this entity) #f) + (set! (-> this pid) 0) ;; now we have to leave this function... (cond ;; if you deactivated yourself, sneak a 'dead into our status, ;; then go back to the kernel dispatcher immediately. - ((= (-> *kernel-context* current-process) obj) - (set! (-> obj status) 'dead) + ((= (-> *kernel-context* current-process) this) + (set! (-> this status) 'dead) (abandon-thread) ) ;; if you deactivated yourself while initializing, we should go back to ;; the place where initialize was called in another process, not all the way back to the kernel. - ((= (-> obj status) 'initialize) - (set! (-> obj status) 'dead) + ((= (-> this status) 'initialize) + (set! (-> this status) 'dead) ;; the initialization code is protected in a catch block. (throw 'initialize #f) ) ) ;; if you deactivated somebody else, just return as normal - (set! (-> obj status) 'dead) + (set! (-> this status) 'dead) ) 0 (none) @@ -2435,10 +2435,10 @@ (kmemopen global "process-buffers") ;; set up the listener process to run functions sent from the REPL. -(let ((obj (define *listener-process* (new 'global 'process "listener" 2048)))) - (set! (-> obj status) 'ready) - (set! (-> obj pid) 1) - (set! (-> obj main-thread) (new 'process 'cpu-thread obj 'main 256 *kernel-dram-stack*)) +(let ((this (define *listener-process* (new 'global 'process "listener" 2048)))) + (set! (-> this status) 'ready) + (set! (-> this pid) 1) + (set! (-> this main-thread) (new 'process 'cpu-thread this 'main 256 *kernel-dram-stack*)) ) ;; an always dead process used as a placeholder diff --git a/goal_src/jak2/kernel/gstate.gc b/goal_src/jak2/kernel/gstate.gc index e2a0792994..52c6400fed 100644 --- a/goal_src/jak2/kernel/gstate.gc +++ b/goal_src/jak2/kernel/gstate.gc @@ -269,16 +269,16 @@ It type checks the arguments for the entry function. (event (function process int symbol event-message-block object))) "Allocate a new state. It seems like this isn't really used much and most states are statically allocated and as a result don't have the constructor called." - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj name) name) - (set! (-> obj next) #f) - (set! (-> obj exit) exit) - (set! (-> obj code) code) - (set! (-> obj trans) trans) - (set! (-> obj post) #f) - (set! (-> obj enter) enter) - (set! (-> obj event) event) - obj + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this name) name) + (set! (-> this next) #f) + (set! (-> this exit) exit) + (set! (-> this code) code) + (set! (-> this trans) trans) + (set! (-> this post) #f) + (set! (-> this enter) enter) + (set! (-> this event) event) + this ) ) @@ -303,10 +303,10 @@ It type checks the arguments for the entry function. child ) -(defmethod print state ((obj state)) +(defmethod print state ((this state)) "Print a state." - (format '#t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) - obj + (format '#t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) + this ) (define-extern enter-state (function object object object object object object object)) @@ -480,10 +480,10 @@ It type checks the arguments for the entry function. ) ) -(defmethod send-all! event-message-block-array ((obj event-message-block-array)) +(defmethod send-all! event-message-block-array ((this event-message-block-array)) "Send all pending messages. Will only do the send if both the sender and receiver are still alive." - (dotimes (s5-0 (-> obj length)) - (let* ((a1-0 (-> obj data s5-0)) + (dotimes (s5-0 (-> this length)) + (let* ((a1-0 (-> this data s5-0)) (a0-2 (handle->process (-> a1-0 to-handle))) ) (if (and a0-2 (handle->process (-> a1-0 form-handle))) @@ -491,7 +491,7 @@ It type checks the arguments for the entry function. ) ) ) - (set! (-> obj length) 0) + (set! (-> this length) 0) 0 (none) ) diff --git a/goal_src/jak2/kernel/gstring.gc b/goal_src/jak2/kernel/gstring.gc index 71b58c0ce8..f64ccd6c36 100644 --- a/goal_src/jak2/kernel/gstring.gc +++ b/goal_src/jak2/kernel/gstring.gc @@ -7,22 +7,22 @@ ;; DECOMP BEGINS -(defmethod length string ((obj string)) +(defmethod length string ((this string)) "Get the length of a string. Like strlen" - (let ((v1-0 (-> obj data))) + (let ((v1-0 (-> this data))) (while (nonzero? (-> v1-0 0)) (nop!) (nop!) (nop!) (set! v1-0 (&-> v1-0 1)) ) - (&- v1-0 (the-as uint (-> obj data))) + (&- v1-0 (the-as uint (-> this data))) ) ) -(defmethod asize-of string ((obj string)) +(defmethod asize-of string ((this string)) "get the size in bytes of a string." - (+ (-> obj allocated-length) 1 (-> string size)) + (+ (-> this allocated-length) 1 (-> string size)) ) (defun copy-string<-string ((arg0 string) (arg1 string)) diff --git a/goal_src/jak2/levels/atoll/ash1-course.gc b/goal_src/jak2/levels/atoll/ash1-course.gc index d3677fbb61..f66a2f733b 100644 --- a/goal_src/jak2/levels/atoll/ash1-course.gc +++ b/goal_src/jak2/levels/atoll/ash1-course.gc @@ -20,10 +20,12 @@ ) -(defmethod set-frontline-dist! ashelin-battle ((obj ashelin-battle)) +(defmethod set-frontline-dist! ashelin-battle ((this ashelin-battle)) (let ((a0-1 *target*)) (when a0-1 - (set! (-> obj frontline w) (- (+ 40960.0 (vector-dot (the-as vector (-> obj frontline)) (get-trans a0-1 0))))) + (set! (-> this frontline w) + (- (+ 40960.0 (vector-dot (the-as vector (-> this frontline)) (get-trans a0-1 0)))) + ) 0 ) ) @@ -90,12 +92,12 @@ ) ) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (let ((s5-0 (get-current-task-event (-> arg1 task)))) (cond ((and (nonzero? (-> arg1 waypoint-time0)) - (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) + (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 1)) (let ((f0-0 143360.0)) (and (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg1 root trans))) (= (-> s5-0 action) (game-task-action say)) @@ -194,13 +196,13 @@ (with-pp (when (not (channel-active? arg1 (the-as uint 0))) (cond - ((and (not (speech-playing? arg1 45)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2.5))) + ((and (not (speech-playing? arg1 45)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.5))) (play-speech arg1 45) ) - ((and (not (speech-playing? arg1 46)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 7))) + ((and (not (speech-playing? arg1 46)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 7))) (play-speech arg1 46) ) - ((and (not (speech-playing? arg1 47)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 14))) + ((and (not (speech-playing? arg1 47)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 14))) (play-speech arg1 47) ) ) @@ -238,9 +240,9 @@ (set-frontline-dist! arg0) (let ((s5-0 (target-pos 0))) (if (>= (-> s5-0 y) 176128.0) - (set! (-> arg0 player-in-bounds-time) (current-time)) + (set-time! (-> arg0 player-in-bounds-time)) ) - (if (>= (- (current-time) (-> arg0 player-in-bounds-time)) (seconds 4)) + (if (time-elapsed? (-> arg0 player-in-bounds-time) (seconds 4)) (send-event arg0 'instant-death) ) (if (< (-> s5-0 y) 192512.0) @@ -297,7 +299,7 @@ (set! (-> v1-22 bytes 8) 7) (let ((v0-12 (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.5)) (let ((s5-0 (get-current-task-event (-> arg1 task)))) (when (and (= (-> s5-0 action) (game-task-action say)) (not (channel-active? arg1 (the-as uint 0))) diff --git a/goal_src/jak2/levels/atoll/atoll-obs.gc b/goal_src/jak2/levels/atoll/atoll-obs.gc index 5b34b8c394..9db0f871cc 100644 --- a/goal_src/jak2/levels/atoll/atoll-obs.gc +++ b/goal_src/jak2/levels/atoll/atoll-obs.gc @@ -115,14 +115,14 @@ ) ) -(defmethod deactivate piston ((obj piston)) - (sound-stop (-> obj looping-id)) - ((method-of-type process-focusable deactivate) obj) +(defmethod deactivate piston ((this piston)) + (sound-stop (-> this looping-id)) + ((method-of-type process-focusable deactivate) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! piston ((obj piston) (arg0 entity-actor)) +(defmethod init-from-entity! piston ((this piston) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -130,7 +130,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-64 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -146,23 +146,23 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj sound-trans quad) (-> obj root trans quad)) - (+! (-> obj root trans y) 53248.0) + (process-drawable-from-entity! this arg0) + (set! (-> this sound-trans quad) (-> this root trans quad)) + (+! (-> this root trans y) 53248.0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-piston" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj focus-status) (focus-status ignore)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logior! (-> this focus-status) (focus-status ignore)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj piston-id) - (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) + (set! (-> this piston-id) + (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) ) (let ((a1-8 (new 'stack-no-clear 'sync-info-params))) (let ((v1-29 0)) @@ -173,13 +173,13 @@ This commonly includes things such as: (set! (-> a1-8 sync-flags) (the-as sync-flags v1-29)) ) (set! (-> a1-8 period) (the-as uint 1500)) - (set! (-> a1-8 entity) (-> obj entity)) + (set! (-> a1-8 entity) (-> this entity)) (set! (-> a1-8 percent) 0.0) (set! (-> a1-8 ease-in) 0.15) (set! (-> a1-8 ease-out) 0.15) (set! (-> a1-8 pause-in) 0.0) (set! (-> a1-8 pause-out) 0.0) - (initialize! (-> obj sync) a1-8) + (initialize! (-> this sync) a1-8) ) (let ((f28-0 -3.0) (f30-0 3.0) @@ -191,29 +191,29 @@ This commonly includes things such as: (set! f30-0 (-> v1-40 1)) ) ) - (set! (-> obj range-bottom) (* 4096.0 f28-0)) - (set! (-> obj range-top) (* 4096.0 f30-0)) + (set! (-> this range-bottom) (* 4096.0 f28-0)) + (set! (-> this range-top) (* 4096.0 f30-0)) ) - (set! (-> obj init-height) (-> obj root trans y)) - (+! (-> obj root trans y) -40960.0) + (set! (-> this init-height) (-> this root trans y)) + (+! (-> this root trans y) -40960.0) (cond - ((logtest? (actor-option user18) (-> obj fact options)) - (set! (-> obj looping-id) (new-sound-id)) + ((logtest? (actor-option user18) (-> this fact options)) + (set! (-> this looping-id) (new-sound-id)) ) (else - (set! (-> obj looping-id) (new 'static 'sound-id)) + (set! (-> this looping-id) (new 'static 'sound-id)) 0 ) ) (ja-channel-push! 1 0) - (let ((a0-26 (-> obj skel root-channel 0))) - (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-26 (-> this skel root-channel 0))) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-26 param 0) 1.0) (set! (-> a0-26 frame-num) 0.0) - (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-loop!) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -287,7 +287,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! turbine ((obj turbine) (arg0 entity-actor)) +(defmethod init-from-entity! turbine ((this turbine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -295,7 +295,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -311,18 +311,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (+! (-> obj root trans y) 73728.0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (+! (-> this root trans y) 73728.0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-turbine" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj dest-height) (-> obj root trans y)) - (set! (-> obj risen) #f) + (set! (-> this dest-height) (-> this root trans y)) + (set! (-> this risen) #f) (let ((f30-0 8192.0) (f28-0 0.0) ) @@ -338,21 +338,21 @@ This commonly includes things such as: (set! f28-0 (-> (the-as (pointer float) v1-27))) ) ) - (set! (-> obj rotspeed) f30-0) - (set! (-> obj rise-height) f28-0) + (set! (-> this rotspeed) f30-0) + (set! (-> this rise-height) f28-0) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "turbine" :fo-max 50) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "turbine" :fo-max 50) (-> this root trans)) ) (ja-channel-push! 1 0) - (let ((a0-19 (-> obj skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-19 (-> this skel root-channel 0))) + (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-19 param 0) 1.0) (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-loop!) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -404,7 +404,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "liftcat") ) :trans (behavior () @@ -413,7 +413,7 @@ This commonly includes things such as: (if (>= (-> self down-y) (-> gp-0 trans y)) (go-virtual idle-down) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (set! (-> self root transv y) -8192.0) (set! (-> self root transv y) 0.0) ) @@ -443,7 +443,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! liftcat ((obj liftcat) (arg0 entity-actor)) +(defmethod init-from-entity! liftcat ((this liftcat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -451,7 +451,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -467,10 +467,10 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (let ((s4-1 (-> obj root))) + (process-drawable-from-entity! this arg0) + (let ((s4-1 (-> this root))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-15 (res-lump-data arg0 'trans-offset vector :tag-ptr (& sv-16)))) (when v1-15 @@ -488,40 +488,40 @@ This commonly includes things such as: ) ) ) - (+! (-> obj root trans y) 55558.145) + (+! (-> this root trans y) 55558.145) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-liftcat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-24 (-> obj root))) - (set! (-> obj down-y) (-> v1-24 trans y)) + (let ((v1-24 (-> this root))) + (set! (-> this down-y) (-> v1-24 trans y)) (+! (-> v1-24 trans y) 28672.0) - (set! (-> obj up-y) (-> v1-24 trans y)) + (set! (-> this up-y) (-> v1-24 trans y)) (vector-reset! (-> v1-24 transv)) ) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (if (task-complete? *game-info* (game-task atoll-sig)) - (process-entity-status! obj (entity-perm-status subtask-complete) #t) + (process-entity-status! this (entity-perm-status subtask-complete) #t) ) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (set! (-> obj root trans y) (-> obj down-y)) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (set! (-> this root trans y) (-> this down-y)) (transform-post) - (go (method-of-object obj idle-down)) + (go (method-of-object this idle-down)) ) (else - (set! (-> obj root trans y) (-> obj up-y)) + (set! (-> this root trans y) (-> this up-y)) (transform-post) - (go (method-of-object obj idle-up)) + (go (method-of-object this idle-up)) ) ) (none) @@ -573,20 +573,20 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (the int (-> self cycle-offset))) + (until (time-elapsed? gp-0 (the int (-> self cycle-offset))) (suspend) ) ) (until #f (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (the int (-> self cycle-time))) + (until (time-elapsed? gp-1 (the int (-> self cycle-time))) (suspend) ) ) (activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock)) (sound-play "rot-pipe-wiggle" :position (-> self root trans)) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.75)) + (until (time-elapsed? gp-3 (seconds 0.75)) (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) (suspend) ) @@ -594,7 +594,7 @@ This commonly includes things such as: (set! (-> self shudder-angle) 0.0) (set-zero! (-> self smush)) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.25)) + (until (time-elapsed? gp-4 (seconds 0.25)) (suspend) ) ) @@ -603,7 +603,7 @@ This commonly includes things such as: (f30-1 (* 16384.0 f0-7)) (gp-6 (current-time)) ) - (until (>= (- (current-time) gp-6) (seconds 0.5)) + (until (time-elapsed? gp-6 (seconds 0.5)) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) @@ -629,7 +629,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atollrotpipe ((obj atollrotpipe) (arg0 entity-actor)) +(defmethod init-from-entity! atollrotpipe ((this atollrotpipe) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -637,7 +637,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -653,24 +653,24 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (set! (-> obj root rider-max-momentum) 8192.0) - (process-drawable-from-entity! obj arg0) + (set! (-> this root rider-max-momentum) 8192.0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atollrotpipe" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj rot-angle) 0.0) - (set! (-> obj shudder-angle) 0.0) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this rot-angle) 0.0) + (set! (-> this shudder-angle) 0.0) + (quaternion-copy! (-> this init-quat) (-> this root quat)) (ja-channel-push! 1 0) - (let ((s4-2 (-> obj skel root-channel 0))) + (let ((s4-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-2 frame-num) 0.0) @@ -686,10 +686,10 @@ This commonly includes things such as: (set! f30-0 (-> v1-29 1)) ) ) - (set! (-> obj cycle-time) (the float (max 0 (+ (the int (* 300.0 f28-0)) -375)))) - (set! (-> obj cycle-offset) (the float (the int (* 300.0 f30-0)))) + (set! (-> this cycle-time) (the float (max 0 (+ (the int (* 300.0 f28-0)) -375)))) + (set! (-> this cycle-offset) (the float (the int (* 300.0 f30-0)))) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -723,7 +723,7 @@ This commonly includes things such as: :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('touch 'attack) - (when (>= (- (current-time) (the-as int (-> self collide-off-timer))) (seconds 2)) + (when (time-elapsed? (the-as int (-> self collide-off-timer)) (seconds 2)) (let* ((s4-0 proc) (s3-0 (if (type? s4-0 process-focusable) s4-0 @@ -799,38 +799,38 @@ This commonly includes things such as: ) ) -(defmethod run-logic? slider ((obj slider)) +(defmethod run-logic? slider ((this slider)) #t ) -(defmethod deactivate slider ((obj slider)) - (sound-stop (the-as sound-id (-> obj sound-id))) - ((the-as (function process-drawable none) (find-parent-method slider 10)) obj) +(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) (none) ) ;; WARN: Return type mismatch process-drawable vs slider. -(defmethod relocate slider ((obj slider) (arg0 int)) +(defmethod relocate slider ((this slider) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj l-bolts v1-0)) - (&+! (-> obj l-bolts v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method slider 7)) this arg0) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! slider ((obj slider) (arg0 entity-actor)) +(defmethod init-from-entity! slider ((this slider) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -844,12 +844,12 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-drawable-from-entity! obj arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-slider" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -862,31 +862,31 @@ This commonly includes things such as: (set! (-> a1-7 sync-flags) (the-as sync-flags v1-12)) ) (set! (-> a1-7 period) (the-as uint 2400)) - (set! (-> a1-7 entity) (-> obj entity)) + (set! (-> a1-7 entity) (-> this entity)) (set! (-> a1-7 percent) 0.0) (set! (-> a1-7 ease-in) 0.15) (set! (-> a1-7 ease-out) 0.15) (set! (-> a1-7 pause-in) 0.0) (set! (-> a1-7 pause-out) 0.0) - (initialize! (-> obj sync) a1-7) + (initialize! (-> this sync) a1-7) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-pos) 0.0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-pos) 0.0) (let* ((v1-24 *game-info*) (a0-20 (+ (-> v1-24 attack-id) 1)) ) (set! (-> v1-24 attack-id) a0-20) - (set! (-> obj attack-id) a0-20) + (set! (-> this attack-id) a0-20) ) - (set! (-> obj sound-id) (the-as uint (new-sound-id))) - (set! (-> obj collide-off-timer) (the-as uint 0)) - (set-vector! (-> obj l-points 0) 19660.8 20480.0 1638.4 0.0) - (set-vector! (-> obj l-points 1) 0.0 24576.0 1638.4 0.0) - (set-vector! (-> obj l-points 2) -19660.8 20480.0 1638.4 0.0) - (set-vector! (-> obj l-points 3) 19660.8 20480.0 -1638.4 0.0) - (set-vector! (-> obj l-points 4) 0.0 24576.0 -1638.4 0.0) - (set-vector! (-> obj l-points 5) -19660.8 20480.0 -1638.4 0.0) + (set! (-> this sound-id) (the-as uint (new-sound-id))) + (set! (-> this collide-off-timer) (the-as uint 0)) + (set-vector! (-> this l-points 0) 19660.8 20480.0 1638.4 0.0) + (set-vector! (-> this l-points 1) 0.0 24576.0 1638.4 0.0) + (set-vector! (-> this l-points 2) -19660.8 20480.0 1638.4 0.0) + (set-vector! (-> this l-points 3) 19660.8 20480.0 -1638.4 0.0) + (set-vector! (-> this l-points 4) 0.0 24576.0 -1638.4 0.0) + (set-vector! (-> this l-points 5) -19660.8 20480.0 -1638.4 0.0) (let ((s5-2 (new 'static 'lightning-spec :name #f @@ -907,11 +907,11 @@ This commonly includes things such as: :sound #f ) ) - (s4-2 (-> obj l-points)) - (s3-0 (-> obj root trans)) + (s4-2 (-> this l-points)) + (s3-0 (-> this root trans)) ) (dotimes (s2-0 4) - (set! (-> obj l-bolts s2-0) (new 'process 'lightning-control s5-2 obj 0.0)) + (set! (-> this l-bolts s2-0) (new 'process 'lightning-control s5-2 this 0.0)) (let* ((a1-10 (if (< s2-0 1) (+ s2-0 1) s2-0 @@ -920,27 +920,27 @@ This commonly includes things such as: (a0-39 (vector+! (new 'stack-no-clear 'vector) s3-0 (-> s4-2 a1-10))) (v1-37 (vector+! (new 'stack-no-clear 'vector) s3-0 (-> s4-2 (+ a1-10 1)))) ) - (set! (-> obj l-bolts s2-0 state meet data 0 quad) (-> a0-39 quad)) - (let ((a0-43 (-> obj l-bolts s2-0))) + (set! (-> this l-bolts s2-0 state meet data 0 quad) (-> a0-39 quad)) + (let ((a0-43 (-> this l-bolts s2-0))) (set! (-> a0-43 state meet data (+ (-> a0-43 state points-to-draw) -1) quad) (-> v1-37 quad)) ) ) ) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "slider" :fo-max 50) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "slider" :fo-max 50) (-> this root trans)) ) (ja-channel-push! 1 0) - (let ((s5-3 (-> obj skel root-channel 0))) + (let ((s5-3 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-3 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-3 frame-num) 0.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -989,14 +989,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-windmill ((obj atoll-windmill) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-windmill ((this atoll-windmill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) + (logior! (-> this mask) (process-mask ambient)) (let ((a1-1 (new 'stack-no-clear 'sync-info-params))) (let ((v1-2 0)) (if #f @@ -1008,33 +1008,33 @@ This commonly includes things such as: (set! (-> a1-1 entity) arg0) (set! (-> a1-1 period) (the-as uint 3000)) (set! (-> a1-1 percent) 0.0) - (initialize! (-> obj sync) a1-1) + (initialize! (-> this sync) a1-1) ) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-windmill" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-copy! (-> obj orig-quat) (-> obj root quat)) - (vector-z-quaternion! (-> obj blade-normal) (-> obj root quat)) - (vector-normalize! (-> obj blade-normal) 1.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "atoll-windmill" :fo-max 50) (-> obj root trans)) + (quaternion-copy! (-> this orig-quat) (-> this root quat)) + (vector-z-quaternion! (-> this blade-normal) (-> this root quat)) + (vector-normalize! (-> this blade-normal) 1.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "atoll-windmill" :fo-max 50) (-> this root trans)) ) (ja-channel-push! 1 0) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1062,24 +1062,24 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-valve ((obj atoll-valve) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-valve ((this atoll-valve) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-valve" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1107,48 +1107,48 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-hatch ((obj atoll-hatch) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-hatch ((this atoll-hatch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-hatch" (the-as (pointer uint32) #f))) (the-as pair 0) ) (cond ((task-complete? *game-info* (game-task atoll-water)) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) 1.0) (set! (-> a0-8 frame-num) 1.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-seek!) ) ) (else - (let ((a0-9 (-> obj skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-9 (-> this skel root-channel 0))) + (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) (set! (-> a0-9 param 1) 1.0) (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-seek!) + (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-seek!) ) ) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1178,14 +1178,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-hellcat ((obj atoll-hellcat) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-hellcat ((this atoll-hellcat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core action) (collide-action solid)) @@ -1199,22 +1199,22 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-hellcat" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((a1-7 (new 'stack-no-clear 'vector))) (set-vector! a1-7 0.0 19441.436 0.0 1.0) - (quaternion-zxy! (-> obj root quat) a1-7) + (quaternion-zxy! (-> this root quat) a1-7) ) (transform-post) (if (task-complete? *game-info* (game-task atoll-battle)) - (go (method-of-object obj die-fast)) - (go (method-of-object obj idle)) + (go (method-of-object this die-fast)) + (go (method-of-object this idle)) ) (none) ) @@ -1243,22 +1243,22 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-mar-symbol ((obj atoll-mar-symbol) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-mar-symbol ((this atoll-mar-symbol) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-mar-symbol" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1270,9 +1270,9 @@ This commonly includes things such as: () (local-vars (v1-31 symbol)) (set! (-> self data-int32 0) 0) - (set! (-> self beep-time) (current-time)) + (set-time! (-> self beep-time)) (until #f - (when (>= (- (current-time) (-> self beep-time)) (seconds 40)) + (when (time-elapsed? (-> self beep-time) (seconds 40)) (let ((v1-7 (logand (-> self data-int32 0) 3))) (cond ((zero? v1-7) @@ -1289,7 +1289,7 @@ This commonly includes things such as: ) ) ) - (set! (-> self beep-time) (current-time)) + (set-time! (-> self beep-time)) (+! (-> self data-int32 0) 1) ) (b! diff --git a/goal_src/jak2/levels/atoll/atoll-tank.gc b/goal_src/jak2/levels/atoll/atoll-tank.gc index 5cb2bd1dfa..7bb7507d9e 100644 --- a/goal_src/jak2/levels/atoll/atoll-tank.gc +++ b/goal_src/jak2/levels/atoll/atoll-tank.gc @@ -1595,29 +1595,29 @@ ) -(defmethod deactivate atoll-tank ((obj atoll-tank)) - (if (nonzero? (-> obj aftermath-part)) - (kill-and-free-particles (-> obj aftermath-part)) +(defmethod deactivate atoll-tank ((this atoll-tank)) + (if (nonzero? (-> this aftermath-part)) + (kill-and-free-particles (-> this aftermath-part)) ) - ((method-of-type process-focusable deactivate) obj) + ((method-of-type process-focusable deactivate) this) (none) ) ;; WARN: Return type mismatch process-focusable vs atoll-tank. -(defmethod relocate atoll-tank ((obj atoll-tank) (arg0 int)) - (if (nonzero? (-> obj aftermath-part)) - (&+! (-> obj aftermath-part) arg0) +(defmethod relocate atoll-tank ((this atoll-tank) (arg0 int)) + (if (nonzero? (-> this aftermath-part)) + (&+! (-> this aftermath-part) arg0) ) - (the-as atoll-tank ((method-of-type process-focusable relocate) obj arg0)) + (the-as atoll-tank ((method-of-type process-focusable relocate) this arg0)) ) -(defmethod run-logic? atoll-tank ((obj atoll-tank)) +(defmethod run-logic? atoll-tank ((this atoll-tank)) #t ) -(defmethod get-trans atoll-tank ((obj atoll-tank) (arg0 int)) +(defmethod get-trans atoll-tank ((this atoll-tank) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((v1-0 (-> obj root))) + (let ((v1-0 (-> this root))) (case arg0 ((3 2) (let ((v0-0 (new 'static 'vector :w 1.0))) @@ -1698,15 +1698,15 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-tank ((obj atoll-tank) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-tank ((this atoll-tank) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj is-master?) #t) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this is-master?) #t) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s4-0 total-prims) (the-as uint 10)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1774,45 +1774,45 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-28 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-28 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-tank-a-debris" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj focus-status) (focus-status ignore)) + (logior! (-> this focus-status) (focus-status ignore)) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (transform-post) - (setup-masks (-> obj draw) 0 2) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 321) obj)) - (set! (-> obj aftermath-part) (create-launch-control (-> *part-group-id-table* 322) obj)) + (setup-masks (-> this draw) 0 2) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 321) this)) + (set! (-> this aftermath-part) (create-launch-control (-> *part-group-id-table* 322) this)) (cond ((task-node-closed? (game-task-node atoll-sig-tank)) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) (else - (logior! (-> obj draw status) (draw-control-status no-draw)) - (let ((v1-54 (-> obj root root-prim))) + (logior! (-> this draw status) (draw-control-status no-draw)) + (let ((v1-54 (-> this root root-prim))) (set! (-> v1-54 prim-core collide-as) (collide-spec)) (set! (-> v1-54 prim-core collide-with) (collide-spec)) ) - (set! (-> obj root backup-collide-as) (collide-spec)) - (set! (-> obj root backup-collide-with) (collide-spec)) + (set! (-> this root backup-collide-as) (collide-spec)) + (set! (-> this root backup-collide-with) (collide-spec)) 0 - (go (method-of-object obj dormant)) + (go (method-of-object this dormant)) ) ) (none) diff --git a/goal_src/jak2/levels/atoll/juicer.gc b/goal_src/jak2/levels/atoll/juicer.gc index 1e8f0d0170..3d3dcb6900 100644 --- a/goal_src/jak2/levels/atoll/juicer.gc +++ b/goal_src/jak2/levels/atoll/juicer.gc @@ -118,26 +118,26 @@ ) -(defmethod event-handler! juicer-shot ((obj juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-handler! juicer-shot ((this juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Multiplex the projectile's event processing, called by [[projectile-event-handler]]" (case arg2 (('reset) (let ((v1-1 (the-as object (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> (the-as matrix v1-1) trans quad)) - (set! (-> obj starting-pos quad) (-> (the-as matrix v1-1) trans quad)) - (set! (-> obj root transv quad) (-> (&+ (the-as matrix v1-1) 64) quad 0)) - (set! (-> obj pre-move-transv quad) (-> (&+ (the-as matrix v1-1) 64) quad 0)) + (set! (-> this root trans quad) (-> (the-as matrix v1-1) trans quad)) + (set! (-> this starting-pos quad) (-> (the-as matrix v1-1) trans quad)) + (set! (-> this root transv quad) (-> (&+ (the-as matrix v1-1) 64) quad 0)) + (set! (-> this pre-move-transv quad) (-> (&+ (the-as matrix v1-1) 64) quad 0)) ) - (set! (-> obj hits) 0) - (set! (-> obj spawn-time) (current-time)) - (if (made-impact? obj) - (go (method-of-object obj impact)) - (go (method-of-object obj moving)) + (set! (-> this hits) 0) + (set-time! (-> this spawn-time)) + (if (made-impact? this) + (go (method-of-object this impact)) + (go (method-of-object this moving)) ) #t ) (else - ((method-of-type projectile event-handler!) obj arg0 arg1 arg2 arg3) + ((method-of-type projectile event-handler!) this arg0 arg1 arg2 arg3) ) ) ) @@ -149,7 +149,7 @@ ) ) -(defmethod deal-damage! juicer-shot ((obj juicer-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! juicer-shot ((this juicer-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((a0-2 (if (type? arg0 process-focusable) arg0 @@ -157,16 +157,16 @@ ) ) (when a0-2 - (set! (-> obj victim) (process->handle a0-2)) + (set! (-> this victim) (process->handle a0-2)) #t ) ) ) -(defmethod spawn-impact-particles juicer-shot ((obj juicer-shot)) +(defmethod spawn-impact-particles juicer-shot ((this juicer-shot)) "Spawns associated particles with the projectile if applicable" - (let ((s5-0 (-> obj starting-pos)) - (s4-0 (-> obj root trans)) + (let ((s5-0 (-> this starting-pos)) + (s4-0 (-> this root trans)) ) (when (line-in-view-frustum? s5-0 s4-0) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -175,7 +175,7 @@ ) (launch-particles (-> *part-id-table* 4637) s5-0) (launch-particles (-> *part-id-table* 4638) s5-0) - (when (not (handle->process (-> obj victim))) + (when (not (handle->process (-> this victim))) (launch-particles (-> *part-id-table* 4637) s4-0) (launch-particles (-> *part-id-table* 4638) s4-0) ) @@ -188,12 +188,12 @@ (dotimes (s0-0 5) (vector-matrix*! s3-0 s3-0 s1-0) (vector+! s2-0 s3-0 s5-0) - (let ((a0-17 (-> obj lightning s0-0)) + (let ((a0-17 (-> this lightning s0-0)) (v1-21 s2-0) ) (set! (-> a0-17 state meet data 0 quad) (-> v1-21 quad)) ) - (let ((a0-20 (-> obj lightning s0-0)) + (let ((a0-20 (-> this lightning s0-0)) (v1-25 s4-0) ) (set! (-> a0-20 state meet data (+ (the-as int (-> a0-20 state points-to-draw)) -1) quad) (-> v1-25 quad)) @@ -206,9 +206,9 @@ (none) ) -(defmethod spawn-shell-particles juicer-shot ((obj juicer-shot)) +(defmethod spawn-shell-particles juicer-shot ((this juicer-shot)) "TODO - confirm" - (spawn-impact-particles obj) + (spawn-impact-particles this) (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) (when s5-0 (let ((t9-2 (method-of-type part-tracker activate))) @@ -229,7 +229,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-3) a0-4 a1-2 @@ -248,20 +248,20 @@ (none) ) -(defmethod made-impact? juicer-shot ((obj juicer-shot)) +(defmethod made-impact? juicer-shot ((this juicer-shot)) "TODO - queries the collision cache, return true/false" - (let ((gp-0 (-> obj root)) + (let ((gp-0 (-> this root)) (s5-0 (new 'stack-no-clear 'collide-query)) ) (let ((v1-0 s5-0)) (set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w)) (set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) - (set! (-> v1-0 ignore-process0) obj) - (set! (-> v1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> v1-0 ignore-process0) this) + (set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> v1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-0 action-mask) (collide-action solid)) ) - (let ((a0-2 (handle->process (-> obj notify-handle)))) + (let ((a0-2 (handle->process (-> this notify-handle)))) (when a0-2 (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans (the-as process-focusable a0-2) 3))) (f0-2 (- (vector-length s4-1))) @@ -292,9 +292,9 @@ (none) ) -(defmethod init-proj-collision! juicer-shot ((obj juicer-shot)) +(defmethod init-proj-collision! juicer-shot ((this juicer-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -329,61 +329,61 @@ (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) ) ;; WARN: Return type mismatch projectile vs juicer-shot. -(defmethod relocate juicer-shot ((obj juicer-shot) (arg0 int)) +(defmethod relocate juicer-shot ((this juicer-shot) (arg0 int)) (dotimes (v1-0 5) - (if (nonzero? (-> obj lightning v1-0)) - (&+! (-> obj lightning v1-0) arg0) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) arg0) ) ) - (the-as juicer-shot ((method-of-type projectile relocate) obj arg0)) + (the-as juicer-shot ((method-of-type projectile relocate) this arg0)) ) -(defmethod init-proj-settings! juicer-shot ((obj juicer-shot)) +(defmethod init-proj-settings! juicer-shot ((this juicer-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (logior! (-> obj options) (projectile-options proj-options-8000)) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj move) juicer-proj-move) - (set! (-> obj root dynam gravity y) 0.0) - (set! (-> obj root dynam gravity-length) 0.0) - (set! (-> obj root dynam gravity-max) 0.0) - (set! (-> obj attack-mode) 'shock-red) + (logior! (-> this options) (projectile-options proj-options-8000)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this move) juicer-proj-move) + (set! (-> this root dynam gravity y) 0.0) + (set! (-> this root dynam gravity-length) 0.0) + (set! (-> this root dynam gravity-max) 0.0) + (set! (-> this attack-mode) 'shock-red) (dotimes (s5-0 5) - (set! (-> obj lightning s5-0) (new - 'process - 'lightning-control - (new 'static 'lightning-spec - :name #f - :flags (lightning-spec-flags lsf0) - :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) - :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) - :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) - :fade-start-factor 0.2 - :fade-time 120.0 - :texture (new 'static 'texture-id :index #x86 :page #xc) - :reduction 0.42 - :num-points 8 - :box-size 8192.0 - :merge-factor 0.5 - :merge-count 2 - :radius 1433.6 - :duration -1.0 - :sound #f - ) - obj - 0.0 - ) + (set! (-> this lightning s5-0) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x86 :page #xc) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1433.6 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) ) ) - (set! (-> obj victim) (the-as handle #f)) + (set! (-> this victim) (the-as handle #f)) 0 (none) ) @@ -648,20 +648,20 @@ (set! (-> *juicer-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod juicer-method-182 juicer ((obj juicer)) - (let ((s3-0 (handle->process (-> obj focus handle)))) +(defmethod juicer-method-182 juicer ((this juicer)) + (let ((s3-0 (handle->process (-> this focus handle)))) (when s3-0 - (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 4))) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) (let ((s3-1 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 4 bone transform vector 2) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 4 bone transform vector 2) 1.0) ) ) (vector-! s5-0 s5-0 s4-0) (vector-normalize! s5-0 1.0) - (quaternion-from-two-vectors-partial! (-> obj joint quat) s3-1 s5-0 (-> obj joint-blend)) + (quaternion-from-two-vectors-partial! (-> this joint quat) s3-1 s5-0 (-> this joint-blend)) ) ) ) @@ -670,18 +670,18 @@ (none) ) -(defmethod juicer-method-183 juicer ((obj juicer)) +(defmethod juicer-method-183 juicer ((this juicer)) (cond - ((-> obj torso-track-player) - (set! (-> obj joint-enable) #t) - (seek! (-> obj joint-blend) 1.0 (* 2.0 (seconds-per-frame))) - (juicer-method-182 obj) + ((-> this torso-track-player) + (set! (-> this joint-enable) #t) + (seek! (-> this joint-blend) 1.0 (* 2.0 (seconds-per-frame))) + (juicer-method-182 this) ) - ((-> obj joint-enable) - (seek! (-> obj joint-blend) 0.0 (* 4.0 (seconds-per-frame))) - (juicer-method-182 obj) - (if (= (-> obj joint-blend) 0.0) - (set! (-> obj joint-enable) #f) + ((-> this joint-enable) + (seek! (-> this joint-blend) 0.0 (* 4.0 (seconds-per-frame))) + (juicer-method-182 this) + (if (= (-> this joint-blend) 0.0) + (set! (-> this joint-enable) #f) ) ) ) @@ -689,64 +689,64 @@ (none) ) -(defmethod track-target! juicer ((obj juicer)) +(defmethod track-target! juicer ((this juicer)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) - (juicer-method-183 obj) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (juicer-method-183 this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod juicer-method-180 juicer ((obj juicer)) - (if (and (= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) - (or (= v1-6 'knocked) (= v1-6 'jump) (= v1-6 'jump-land)) - ) +(defmethod juicer-method-180 juicer ((this juicer)) + (if (and (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (not (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'knocked) (= v1-6 'jump) (= v1-6 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) - (go (method-of-object obj knocked)) + (kill-prefer-falling this) + (go (method-of-object this knocked)) ) (none) ) -(defmethod general-event-handler juicer ((obj juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler juicer ((this juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit-flinch) (cond - ((zero? (-> obj hit-points)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + ((zero? (-> this hit-points)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (juicer-method-180 obj) + (juicer-method-180 this) ) (else - (let ((v1-31 (ja-channel-float! (the-as art-joint-anim (-> obj draw art-group data 11)) 0.0 0.0 0.0))) + (let ((v1-31 (ja-channel-float! (the-as art-joint-anim (-> this draw art-group data 11)) 0.0 0.0 0.0))) (when v1-31 (set! (-> v1-31 param 0) 1.0) (set! (-> v1-31 param 1) 0.75) @@ -759,59 +759,59 @@ #t ) (('hit) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (if (zero? (-> obj hit-points)) - (juicer-method-180 obj) - (go (method-of-object obj hit)) + (if (zero? (-> this hit-points)) + (juicer-method-180 this) + (go (method-of-object this hit)) ) #t ) (('instant-death) - (when (> (-> obj hit-points) 0) - (set! (-> obj hit-points) 0) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) - (let ((s4-0 (enemy-method-50 obj (new 'stack-no-clear 'vector)))) - (vector-z-quaternion! s4-0 (-> obj root quat)) + (when (> (-> this hit-points) 0) + (set! (-> this hit-points) 0) + (set! (-> this root penetrated-by) (get-penetrate-info this)) + (let ((s4-0 (enemy-method-50 this (new 'stack-no-clear 'vector)))) + (vector-z-quaternion! s4-0 (-> this root quat)) (vector-float*! s4-0 s4-0 -1.0) (vector-normalize! s4-0 1.0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (juicer-method-180 obj) + (juicer-method-180 this) ) #t ) (('notify) - (if (and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) (handle->process (-> obj focus handle)))) - (set! (-> obj hit-focus) (the-as enemy-focus #t)) + (if (and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) (handle->process (-> this focus handle)))) + (set! (-> this hit-focus) (the-as enemy-focus #t)) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -887,29 +887,29 @@ ) ) -(defmethod enemy-method-84 juicer ((obj juicer) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 juicer ((this juicer) (arg0 enemy-jump-info)) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user8)) + ((logtest? (-> this fact enemy-options) (enemy-option user8)) (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)) (let ((f0-1 8192.0)) (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f0-1 -4.551111) ) ) (else - ((method-of-type nav-enemy enemy-method-84) obj arg0) + ((method-of-type nav-enemy enemy-method-84) this arg0) ) ) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 juicer ((obj juicer)) - (case (-> obj jump-why) +(defmethod enemy-method-93 juicer ((this juicer)) + (case (-> this jump-why) ((2) - (go (method-of-object obj ambush-cont)) + (go (method-of-object this ambush-cont)) ) (else - ((method-of-type nav-enemy enemy-method-93) obj) + ((method-of-type nav-enemy enemy-method-93) this) ) ) (none) @@ -1136,11 +1136,9 @@ (when (and (or (logtest? (-> self nav state flags) (nav-state-flag blocked)) (logtest? (-> self nav state flags) (nav-state-flag at-target)) ) - (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) - ) - (if (and (>= (- (current-time) (-> self last-fire-time)) (rand-vu-int-range (seconds 1) (seconds 2))) - (< 20480.0 f30-0) + (time-elapsed? (-> self state-time) (-> self reaction-time)) ) + (if (and (time-elapsed? (-> self last-fire-time) (rand-vu-int-range (seconds 1) (seconds 2))) (< 20480.0 f30-0)) (go-virtual attack) (go-virtual circling) ) @@ -1149,9 +1147,7 @@ ) (if (and (check-los? (-> self los) 0) (or (>= 11468.8 f30-0) - (and (>= (- (current-time) (-> self last-fire-time)) (rand-vu-int-range (seconds 5) (seconds 8))) - (>= 53248.0 f30-0) - ) + (and (time-elapsed? (-> self last-fire-time) (rand-vu-int-range (seconds 5) (seconds 8))) (>= 53248.0 f30-0)) ) ) (go-virtual attack) @@ -1202,29 +1198,29 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod fire-projectile juicer ((obj juicer) (arg0 process-focusable) (arg1 uint)) +(defmethod fire-projectile juicer ((this juicer) (arg0 process-focusable) (arg1 uint)) (with-pp - (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 20))) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 20))) (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (when (not (handle->process (-> obj current-projectile))) - (set! (-> s5-0 ent) (-> obj entity)) + (when (not (handle->process (-> this current-projectile))) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options)) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (set! (-> s5-0 attack-id) arg1) (set! (-> s5-0 timeout) (seconds 4)) ) (vector-normalize! (vector-! (-> s5-0 pos) (get-trans arg0 3) s4-0) 1.0) (vector-float*! (-> s5-0 vel) (-> s5-0 pos) (* 24576.0 (-> pp clock frames-per-second))) (vector+float*! (-> s5-0 pos) s4-0 (-> s5-0 pos) -1024.0) - (let ((a0-20 (handle->process (-> obj current-projectile)))) + (let ((a0-20 (handle->process (-> this current-projectile)))) (if a0-20 (send-event a0-20 'reset s5-0) - (set! (-> obj current-projectile) - (ppointer->handle (spawn-projectile juicer-shot s5-0 obj *default-dead-pool*)) + (set! (-> this current-projectile) + (ppointer->handle (spawn-projectile juicer-shot s5-0 this *default-dead-pool*)) ) ) ) @@ -1260,7 +1256,7 @@ (set! (-> self torso-track-player) #f) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (juicer-method-184 self #f) - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -1288,7 +1284,7 @@ ) (set! (-> v1-29 attack-id) s5-0) (let ((s4-0 (current-time))) - (until (>= (- (current-time) s4-0) (seconds 0.25)) + (until (time-elapsed? s4-0 (seconds 0.25)) (ja-no-eval :group! juicer-attack0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((s3-0 (handle->process (-> self focus handle)))) @@ -1499,7 +1495,7 @@ :num! (loop! f28-0) :frame-num 0.0 ) - (until (>= (- (current-time) s5-0) gp-0) + (until (time-elapsed? s5-0 gp-0) (suspend) (ja :num! (loop! f28-0)) ) @@ -1518,17 +1514,17 @@ ) ) -(defmethod enemy-method-77 juicer ((obj juicer) (arg0 (pointer float))) +(defmethod enemy-method-77 juicer ((this juicer) (arg0 (pointer float))) (local-vars (a2-2 int)) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 0) (let* ((a2-0 (ash 1 (-> *juicer-global-info* prev-yellow-hit))) - (v1-3 (enemy-method-120 obj 4 a2-0)) - (a1-6 (-> obj draw art-group data (-> *juicer-global-info* yellow-hit-anim v1-3))) + (v1-3 (enemy-method-120 this 4 a2-0)) + (a1-6 (-> this draw art-group data (-> *juicer-global-info* yellow-hit-anim v1-3))) ) (set! (-> *juicer-global-info* prev-yellow-hit) v1-3) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) (set! (-> a0-13 param 1) (-> arg0 0)) @@ -1539,26 +1535,26 @@ ) (((knocked-type knocked-type-6)) (let ((v1-11 (ash 1 (-> *juicer-global-info* prev-blue-hit)))) - (if (zero? (-> obj charge-index)) + (if (zero? (-> this charge-index)) (set! a2-2 (logior v1-11 56)) (set! a2-2 (logior v1-11 7)) ) ) - (let* ((v1-15 (enemy-method-120 obj 6 a2-2)) - (s5-1 (-> obj draw art-group data (-> *juicer-global-info* blue-hit-anim v1-15))) + (let* ((v1-15 (enemy-method-120 this 6 a2-2)) + (s5-1 (-> this draw art-group data (-> *juicer-global-info* blue-hit-anim v1-15))) ) (set! (-> *juicer-global-info* prev-blue-hit) v1-15) - (let ((v1-18 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-18 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-18 (= v1-18 (-> obj draw art-group data 32))) + (if (and v1-18 (= v1-18 (-> this draw art-group data 32))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-32 (-> obj skel root-channel 0))) + (let ((a0-32 (-> this skel root-channel 0))) (set! (-> a0-32 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-32 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-32 param 1) 1.0) @@ -1568,9 +1564,9 @@ ) ) (else - (let ((s4-1 (-> obj draw art-group data (-> *juicer-global-info* knocked-anim (get-rand-int obj 2))))) + (let ((s4-1 (-> this draw art-group data (-> *juicer-global-info* knocked-anim (get-rand-int this 2))))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-37 (-> obj skel root-channel 0))) + (let ((a0-37 (-> this skel root-channel 0))) (set! (-> a0-37 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-37 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-37 param 1) (-> arg0 0)) @@ -1583,13 +1579,13 @@ #t ) -(defmethod enemy-method-78 juicer ((obj juicer) (arg0 (pointer float))) +(defmethod enemy-method-78 juicer ((this juicer) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((s4-0 (-> obj draw art-group data 32))) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 32))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-3 param 1) (-> arg0 0)) @@ -1600,19 +1596,19 @@ #t ) ) - ((!= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (let* ((v1-14 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((!= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (let* ((v1-14 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) - (s4-1 (if (and v1-14 (= v1-14 (-> obj draw art-group data 18))) - (-> obj draw art-group data 19) - (-> obj draw art-group data 17) + (s4-1 (if (and v1-14 (= v1-14 (-> this draw art-group data 18))) + (-> this draw art-group data 19) + (-> this draw art-group data 17) ) ) ) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-10 param 1) (-> arg0 0)) @@ -1626,8 +1622,8 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod juicer-method-184 juicer ((obj juicer) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod juicer-method-184 juicer ((this juicer) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) (if arg0 @@ -1641,18 +1637,18 @@ ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 juicer ((obj juicer) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 juicer ((this juicer) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 obj arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 this arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) ) -(defmethod init-enemy-collision! juicer ((obj juicer)) +(defmethod init-enemy-collision! juicer ((this juicer)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1736,83 +1732,83 @@ (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-focusable vs juicer. -(defmethod relocate juicer ((obj juicer) (arg0 int)) - (if (nonzero? (-> obj intro-path)) - (&+! (-> obj intro-path) arg0) +(defmethod relocate juicer ((this juicer) (arg0 int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) arg0) ) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) arg0) ) (the-as juicer - ((the-as (function process-focusable int process-focusable) (find-parent-method juicer 7)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method juicer 7)) this arg0) ) ) -(defmethod init-enemy! juicer ((obj juicer)) +(defmethod init-enemy! juicer ((this juicer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-juicer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *juicer-nav-enemy-info*) - (let ((v1-5 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *juicer-nav-enemy-info*) + (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) (set! (-> v1-5 ear) (the-as uint 0)) (set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0) (set! (-> v1-5 ignore-angle) 30947.555) ) - (let ((v1-7 (-> obj nav))) + (let ((v1-7 (-> this nav))) (set! (-> v1-7 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (set! (-> obj last-fire-time) 0) - (set! (-> obj heading) (the-as basic (if (rand-vu-percent? 0.5) - #t - #f - ) - ) + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this last-fire-time) 0) + (set! (-> this heading) (the-as basic (if (rand-vu-percent? 0.5) + #t + #f + ) + ) ) - (set! (-> obj move-angle) 5461.3335) - (set! (-> obj torso-track-player) #f) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd obstacle)) - (set! (-> obj joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) obj 5)) - (set! (-> obj using-turn-anim) #f) - (let ((v1-18 (new 'process 'path-control obj 'intro 0.0 (the-as entity #f) #t))) - (set! (-> obj intro-path) v1-18) + (set! (-> this move-angle) 5461.3335) + (set! (-> this torso-track-player) #f) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle)) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 5)) + (set! (-> this using-turn-anim) #f) + (let ((v1-18 (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t))) + (set! (-> this intro-path) v1-18) (if (nonzero? v1-18) (logior! (-> v1-18 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) (add-connection *part-engine* - obj + this 34 - obj + this 318 (new 'static 'vector :x 901.12 :y -1146.88 :z 1269.76 :w 163840.0) ) (add-connection *part-engine* - obj + this 34 - obj + this 318 (new 'static 'vector :x -901.12 :y -1146.88 :z 1269.76 :w 163840.0) ) - (add-connection *part-engine* obj 20 obj 4635 (new 'static 'vector :w 163840.0)) - (set! (-> obj root pause-adjust-distance) 81920.0) - (set! (-> obj current-projectile) (the-as handle #f)) + (add-connection *part-engine* this 20 this 4635 (new 'static 'vector :w 163840.0)) + (set! (-> this root pause-adjust-distance) 81920.0) + (set! (-> this current-projectile) (the-as handle #f)) 0 (none) ) diff --git a/goal_src/jak2/levels/atoll/sig0-course.gc b/goal_src/jak2/levels/atoll/sig0-course.gc index b097421499..85eaca13e9 100644 --- a/goal_src/jak2/levels/atoll/sig0-course.gc +++ b/goal_src/jak2/levels/atoll/sig0-course.gc @@ -34,41 +34,41 @@ ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? sig-atoll ((obj sig-atoll)) +(defmethod alive? sig-atoll ((this sig-atoll)) (let ((t9-0 (method-of-type bot alive?))) - (the-as symbol (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'waiting-far) - (= v1-3 'waiting-close) - (= v1-3 'waiting-turn) - (= v1-3 'waiting-crouched) - (= v1-3 'charge-plasma) - ) - ) + (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'waiting-far) + (= v1-3 'waiting-close) + (= v1-3 'waiting-turn) + (= v1-3 'waiting-crouched) + (= v1-3 'charge-plasma) + ) + ) ) ) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig-atoll ((obj sig-atoll)) +(defmethod go-idle sig-atoll ((this sig-atoll)) (cond ((task-node-closed? (game-task-node atoll-sig-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj waiting-crouched)) + (go (method-of-object this waiting-crouched)) ) ) (none) ) ;; WARN: Return type mismatch object vs symbol. -(defmethod sig-atoll-method-259 sig-atoll ((obj sig-atoll)) +(defmethod sig-atoll-method-259 sig-atoll ((this sig-atoll)) (let ((v1-0 *target*)) (the-as symbol (and v1-0 (not (focus-test? v1-0 edge-grab)) - (>= (- (-> v1-0 control trans y) (-> obj sig-course spots 11 center y)) -819.2) + (>= (- (-> v1-0 control trans y) (-> this sig-course spots 11 center y)) -819.2) ) ) ) @@ -885,14 +885,14 @@ ) ) (when (and (demo?) - (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 1)) + (time-elapsed? (-> arg0 waypoint-time0) (seconds 1)) (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) ) (logclear! (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) (talker-spawn-func (-> *talker-speech* 80) *entity-pool* (target-pos 0) (the-as region #f)) ) (when (or (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-3))) - (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8)) + (time-elapsed? (-> arg0 waypoint-time0) (seconds 8)) ) (if (and (demo?) (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-3)))) (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) @@ -909,7 +909,7 @@ (set! (-> s5-4 liftcat-speech-index) v1-62) ) ) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) ) ) ) @@ -961,7 +961,7 @@ (process-grab? arg1 #t) (process-grab? *target* #t) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (process-grab? arg1 #f) (process-grab? *target* #f) @@ -978,7 +978,7 @@ ) ) ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 4.5)) (process-release? arg1) (process-release? *target*) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -988,7 +988,7 @@ ) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (set-setting! 'sound-mode #f 0.0 1) @@ -1215,11 +1215,11 @@ :on-update (lambda ((arg0 sig-atoll)) (with-pp (b! (not (channel-active? arg0 (the-as uint 0))) cfg-2 :delay (empty-form)) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) (b! #t cfg-21 :delay (nop!)) (label cfg-2) (b! - (not (and (not (speech-playing? arg0 12)) (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.75)))) + (not (and (not (speech-playing? arg0 12)) (time-elapsed? (-> arg0 waypoint-time0) (seconds 0.75)))) cfg-7 :delay (empty-form) ) @@ -1227,7 +1227,7 @@ (b! #t cfg-21 :delay (nop!)) (label cfg-7) (if (and (not (speech-playing? arg0 13)) - (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.5)) + (time-elapsed? (-> arg0 waypoint-time0) (seconds 0.5)) (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) (process->ppointer pp)) @@ -1389,7 +1389,7 @@ (process-grab? arg1 #t) (process-grab? *target* #t) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (process-grab? arg1 #f) (process-grab? *target* #f) (play-speech arg1 15) @@ -1405,7 +1405,7 @@ ) ) ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 4.5)) (process-release? arg1) (process-release? *target*) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -1415,7 +1415,7 @@ ) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) @@ -1615,7 +1615,7 @@ (none) ) :on-update (lambda ((arg0 sig-atoll)) - (if (and (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 1.5)) + (if (and (time-elapsed? (-> arg0 waypoint-time0) (seconds 1.5)) (not (speech-playing? arg0 18)) (not (channel-active? arg0 (the-as uint 0))) ) @@ -1672,7 +1672,7 @@ ) ) (when (or (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 8)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 8)) ) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let* ((s5-1 (-> arg1 sig-course)) @@ -1686,7 +1686,7 @@ (set! (-> s5-1 liftcat-speech-index) v1-35) ) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) ) ) @@ -1791,7 +1791,7 @@ (process-grab? arg1 #t) (process-grab? *target* #t) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (process-grab? arg1 #f) (process-grab? *target* #f) (reset-warn-time! arg1) @@ -1807,7 +1807,7 @@ ) ) ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 4.5)) (process-release? arg1) (process-release? *target*) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -1817,7 +1817,7 @@ ) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) @@ -2138,7 +2138,7 @@ (process-grab? arg1 #t) (process-grab? *target* #t) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (process-grab? arg1 #f) (process-grab? *target* #f) (reset-warn-time! arg1) @@ -2155,12 +2155,12 @@ ) ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) ) (remove-setting! 'string-startup-vector) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3.5)) (process-release? arg1) (process-release? *target*) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -2170,7 +2170,7 @@ ) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) @@ -2377,7 +2377,7 @@ (with-pp (cond ((not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-2))) - (when (and (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.25)) + (when (and (time-elapsed? (-> arg0 waypoint-time0) (seconds 0.25)) (< (-> arg0 sig-course spots 36 center x) (-> (target-pos 0) x)) ) (logior! (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) @@ -2467,7 +2467,7 @@ :on-update (lambda ((arg0 sig-atoll)) (sig0-say-look-out-if-should arg0) (when (and (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) - (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8)) + (time-elapsed? (-> arg0 waypoint-time0) (seconds 8)) ) (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (logior! (-> arg0 focus-status) (focus-status disable)) @@ -2568,7 +2568,7 @@ (with-pp (cond ((not (speech-playing? arg0 27)) - (if (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.5)) + (if (time-elapsed? (-> arg0 waypoint-time0) (seconds 0.5)) (play-speech arg0 27) ) ) @@ -2577,7 +2577,7 @@ (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (logclear! (-> arg0 focus-status) (focus-status disable)) (set! (-> arg0 notice-enemy-dist) 122880.0) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) ) ) ((not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-1))) @@ -2601,13 +2601,13 @@ ) 5 ) - (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 10)) + (time-elapsed? (-> arg0 waypoint-time0) (seconds 10)) ) (logior! (-> arg0 bot-flags) (bot-flags bf21)) (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) ) (else - (if (and (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 4)) (not (speech-playing? arg0 28))) + (if (and (time-elapsed? (-> arg0 waypoint-time0) (seconds 4)) (not (speech-playing? arg0 28))) (play-speech arg0 28) ) ) @@ -2762,7 +2762,7 @@ (process-grab? arg1 #t) (process-grab? *target* #t) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (process-grab? arg1 #f) (process-grab? *target* #f) (reset-warn-time! arg1) @@ -2779,12 +2779,12 @@ ) ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) ) (remove-setting! 'string-startup-vector) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 4.5)) (process-release? arg1) (process-release? *target*) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -2794,7 +2794,7 @@ ) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x -1.0) 0) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) diff --git a/goal_src/jak2/levels/atoll/sniper.gc b/goal_src/jak2/levels/atoll/sniper.gc index 96e638d6a8..2b8519b184 100644 --- a/goal_src/jak2/levels/atoll/sniper.gc +++ b/goal_src/jak2/levels/atoll/sniper.gc @@ -192,21 +192,21 @@ (set! (-> *sniper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod run-logic? sniper ((obj sniper)) +(defmethod run-logic? sniper ((this sniper)) (let ((f0-0 573440.0)) - (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) + (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> this root trans) (camera-pos))) ) ) -(defmethod enemy-method-129 sniper ((obj sniper)) +(defmethod enemy-method-129 sniper ((this sniper)) (let ((a0-1 *target*)) (if a0-1 - (set! (-> obj focus handle) (process->handle a0-1)) - (set! (-> obj focus handle) (the-as handle #f)) + (set! (-> this focus handle) (process->handle a0-1)) + (set! (-> this focus handle) (the-as handle #f)) ) ) - (set! (-> obj focus aware) - (if (>= (vector-vector-distance (-> obj root trans) (camera-pos)) (-> obj fact idle-distance)) + (set! (-> this focus aware) + (if (>= (vector-vector-distance (-> this root trans) (camera-pos)) (-> this fact idle-distance)) (enemy-aware enemy-aware-0) (enemy-aware enemy-aware-1) ) @@ -214,23 +214,23 @@ (none) ) -(defmethod nav-enemy-method-156 sniper ((obj sniper)) - (let ((s4-0 (-> obj path curve num-cverts))) +(defmethod nav-enemy-method-156 sniper ((this sniper)) + (let ((s4-0 (-> this path curve num-cverts))) (if (<= s4-0 0) (go process-drawable-art-error "no path") ) - (let ((s2-0 (get-rand-int obj s4-0)) + (let ((s2-0 (get-rand-int this s4-0)) (gp-0 (new 'stack-no-clear 'vector)) ) (countdown (s3-0 s4-0) - (get-point-in-path! (-> obj path) gp-0 (the float s2-0) 'interp) - (if (< 409.6 (vector-vector-xz-distance gp-0 (-> obj root trans))) + (get-point-in-path! (-> this path) gp-0 (the float s2-0) 'interp) + (if (< 409.6 (vector-vector-xz-distance gp-0 (-> this root trans))) (goto cfg-9) ) (set! s2-0 (mod (+ s2-0 1) s4-0)) ) (label cfg-9) - (let ((v1-16 (-> obj nav state))) + (let ((v1-16 (-> this nav state))) (logclear! (-> v1-16 flags) (nav-state-flag directional-mode)) (logior! (-> v1-16 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-16 target-post quad) (-> gp-0 quad)) @@ -250,7 +250,7 @@ (t9-0) ) ) - (set! (-> self next-pick-time) (current-time)) + (set-time! (-> self next-pick-time)) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -281,44 +281,44 @@ ) ) -(defmethod init-enemy! sniper ((obj sniper)) +(defmethod init-enemy! sniper ((this sniper)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type spyder init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set-enemy-info! obj *sniper-nav-enemy-info*) - (logior! (-> obj focus-status) (focus-status ignore)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) + (set-enemy-info! this *sniper-nav-enemy-info*) + (logior! (-> this focus-status) (focus-status ignore)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag check-water)) 0 (none) ) -(defmethod init-enemy-collision! sniper ((obj sniper)) +(defmethod init-enemy-collision! sniper ((this sniper)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((t9-0 (method-of-type spyder init-enemy-collision!))) - (t9-0 obj) + (t9-0 this) ) - (let ((v1-2 (-> obj root root-prim))) + (let ((v1-2 (-> this root root-prim))) (set! (-> v1-2 prim-core collide-as) (collide-spec)) (set! (-> v1-2 prim-core collide-with) (collide-spec)) ) - (set! (-> obj root backup-collide-as) (collide-spec)) - (set! (-> obj root backup-collide-with) (collide-spec)) + (set! (-> this root backup-collide-as) (collide-spec)) + (set! (-> this root backup-collide-with) (collide-spec)) 0 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sniper ((obj sniper)) +(defmethod go-idle sniper ((this sniper)) (cond - ((script-eval (res-lump-struct (-> obj entity) 'on-activate pair)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + ((script-eval (res-lump-struct (-> this entity) 'on-activate pair)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) diff --git a/goal_src/jak2/levels/castle/boss/castle-baron.gc b/goal_src/jak2/levels/castle/boss/castle-baron.gc index a3ae7b7c7b..2399aef37c 100644 --- a/goal_src/jak2/levels/castle/boss/castle-baron.gc +++ b/goal_src/jak2/levels/castle/boss/castle-baron.gc @@ -40,21 +40,21 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cboss-tractor ((obj cboss-tractor) (arg0 entity-actor)) +(defmethod init-from-entity! cboss-tractor ((this cboss-tractor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cboss-tractor" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -103,45 +103,45 @@ This commonly includes things such as: ) ) -(defmethod get-art-group cboss-elevator ((obj cboss-elevator)) +(defmethod get-art-group cboss-elevator ((this cboss-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cboss-elevator" (the-as (pointer uint32) #f)) ) -(defmethod deactivate cboss-elevator ((obj cboss-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method cboss-elevator 10)) obj) +(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) (none) ) -(defmethod init-plat! cboss-elevator ((obj cboss-elevator)) +(defmethod init-plat! cboss-elevator ((this cboss-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." - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this sound-id) (new-sound-id)) 0 (none) ) -(defmethod move-between-points cboss-elevator ((obj cboss-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points cboss-elevator ((this cboss-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) ) ) ) ) -(defmethod commited-to-ride? cboss-elevator ((obj cboss-elevator)) +(defmethod commited-to-ride? cboss-elevator ((this cboss-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -151,9 +151,9 @@ For example for an elevator pre-compute the distance between the first and last ) (when a0-2 (let* ((v1-1 (get-trans a0-2 0)) - (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> obj root trans))) + (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this root trans))) ) - (vector-inv-orient-by-quat! gp-2 gp-2 (-> obj root quat)) + (vector-inv-orient-by-quat! gp-2 gp-2 (-> this root quat)) (and (< (fabs (-> gp-2 x)) 40960.0) (< (fabs (-> gp-2 z)) 40960.0)) ) ) @@ -161,9 +161,9 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! cboss-elevator ((obj cboss-elevator)) +(defmethod init-plat-collision! cboss-elevator ((this cboss-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -191,7 +191,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) @@ -715,53 +715,53 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> *krew-boss-clone-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod track-target! krew-boss-clone ((obj krew-boss-clone)) +(defmethod track-target! krew-boss-clone ((this krew-boss-clone)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s5-0 (-> obj node-list data 36)) + (vector<-cspace! s5-0 (-> this node-list data 36)) (dotimes (s3-0 4) (let ((v1-2 s3-0)) (cond ((zero? v1-2) - (vector<-cspace! s5-0 (-> obj node-list data 7)) - (vector<-cspace! s4-0 (-> obj node-list data 15)) + (vector<-cspace! s5-0 (-> this node-list data 7)) + (vector<-cspace! s4-0 (-> this node-list data 15)) ) ((= v1-2 1) - (vector<-cspace! s5-0 (-> obj node-list data 6)) - (vector<-cspace! s4-0 (-> obj node-list data 7)) + (vector<-cspace! s5-0 (-> this node-list data 6)) + (vector<-cspace! s4-0 (-> this node-list data 7)) ) ((= v1-2 2) - (vector<-cspace! s5-0 (-> obj node-list data 19)) - (vector<-cspace! s4-0 (-> obj node-list data 27)) + (vector<-cspace! s5-0 (-> this node-list data 19)) + (vector<-cspace! s4-0 (-> this node-list data 27)) ) (else - (vector<-cspace! s5-0 (-> obj node-list data 18)) - (vector<-cspace! s4-0 (-> obj node-list data 19)) + (vector<-cspace! s5-0 (-> this node-list data 18)) + (vector<-cspace! s4-0 (-> this node-list data 19)) ) ) ) - (let ((a0-13 (-> obj lightning s3-0)) + (let ((a0-13 (-> this lightning s3-0)) (v1-17 s5-0) ) (set! (-> a0-13 state meet data 0 quad) (-> v1-17 quad)) ) - (let ((a0-16 (-> obj lightning s3-0)) + (let ((a0-16 (-> this lightning s3-0)) (v1-21 s4-0) ) (set! (-> a0-16 state meet data (+ (-> a0-16 state points-to-draw) -1) quad) (-> v1-21 quad)) ) - (when (not (and (-> obj next-state) (= (-> obj next-state name) 'die-falling))) - (case (-> obj lightning s3-0 state mode) + (when (not (and (-> this next-state) (= (-> this next-state name) 'die-falling))) + (case (-> this lightning s3-0 state mode) (((lightning-mode lm0) (lightning-mode lm3)) - (let ((v1-35 (-> obj lightning s3-0)) + (let ((v1-35 (-> this lightning s3-0)) (a0-22 1) ) (let ((a1-14 (!= a0-22 (-> v1-35 state mode)))) @@ -784,20 +784,20 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (if (< (-> obj root trans y) 1228800.0) - (deactivate obj) + (if (< (-> this root trans y) 1228800.0) + (deactivate this) ) 0 (none) ) -(defmethod general-event-handler krew-boss-clone ((obj krew-boss-clone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler krew-boss-clone ((this krew-boss-clone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (with-pp (case arg2 (('touch 'bonk 'attack) - (when (and (-> obj next-state) (= (-> obj next-state name) 'hostile)) + (when (and (-> this next-state) (= (-> this next-state name) 'hostile)) (send-event arg0 'attack @@ -808,30 +808,30 @@ For example for an elevator pre-compute the distance between the first and last ) (cond ((!= arg0 *target*) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-15 (-> obj skel root-channel 0))) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) ) (set! (-> a0-15 param 0) 0.0) (set! (-> a0-15 param 1) (* 2.0 (-> pp clock time-adjust-ratio))) (set! (-> a0-15 frame-num) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim))) frames num-frames) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) frames num-frames) -1 ) ) ) (joint-control-channel-group! a0-15 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) num-func-seek! ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ) ) @@ -839,18 +839,18 @@ For example for an elevator pre-compute the distance between the first and last (('track) (cond ((-> arg3 param 0) - (if (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (if (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) #t 'abort ) ) (else - (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -917,37 +917,37 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod enemy-method-77 krew-boss-clone ((obj krew-boss-clone) (arg0 (pointer float))) +(defmethod enemy-method-77 krew-boss-clone ((this krew-boss-clone) (arg0 (pointer float))) (with-pp (ja-channel-push! 1 0) (cond - ((<= (-> obj hit-points) 0) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim)))) + ((<= (-> this hit-points) 0) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim)))) (set! (-> a0-2 param 0) 0.0) (set! (-> a0-2 param 1) (* 2.0 (-> pp clock time-adjust-ratio))) (set! (-> a0-2 frame-num) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim))) frames num-frames) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) frames num-frames) -1 ) ) ) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) num-func-seek! ) ) ) (else - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) ) (set! (-> a0-3 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) frames num-frames) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) frames num-frames) -1 ) ) @@ -956,7 +956,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> a0-3 frame-num) 0.0) (joint-control-channel-group! a0-3 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) num-func-seek! ) ) @@ -966,16 +966,16 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod enemy-method-78 krew-boss-clone ((obj krew-boss-clone) (arg0 (pointer float))) - (when (> (-> obj hit-points) 0) +(defmethod enemy-method-78 krew-boss-clone ((this krew-boss-clone) (arg0 (pointer float))) + (when (> (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) ) (set! (-> a0-2 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) frames num-frames ) @@ -987,7 +987,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) num-func-seek! ) ) @@ -995,12 +995,12 @@ For example for an elevator pre-compute the distance between the first and last #t ) -(defmethod enemy-method-79 krew-boss-clone ((obj krew-boss-clone) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 krew-boss-clone ((this krew-boss-clone) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (enemy-method-77 obj (the-as (pointer float) arg1)) + (enemy-method-77 this (the-as (pointer float) arg1)) #f ) ((= v1-0 1) @@ -1009,8 +1009,8 @@ For example for an elevator pre-compute the distance between the first and last s5-0 ) ((= v1-0 2) - (set! s5-0 (not (enemy-method-78 obj (the-as (pointer float) arg1)))) - (set! (-> obj incoming blue-juggle-count) (the-as uint 0)) + (set! s5-0 (not (enemy-method-78 this (the-as (pointer float) arg1)))) + (set! (-> this incoming blue-juggle-count) (the-as uint 0)) s5-0 ) ((= v1-0 3) @@ -1019,7 +1019,7 @@ For example for an elevator pre-compute the distance between the first and last s5-0 ) ((= v1-0 4) - (vector-reset! (-> obj root transv)) + (vector-reset! (-> this root transv)) #t ) (else @@ -1029,21 +1029,21 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod krew-boss-clone-method-180 krew-boss-clone ((obj krew-boss-clone)) +(defmethod krew-boss-clone-method-180 krew-boss-clone ((this krew-boss-clone)) (let* ((f0-0 (rand-vu-float-range 0.0 1.0)) (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) ) (+ 1.0 (* 0.2 f0-0)) - (set! (-> obj delta-wiggle-angle) (* 182.04445 f1-1)) - (set! (-> obj wiggle-factor) (* 2.0 f2-4)) + (set! (-> this delta-wiggle-angle) (* 182.04445 f1-1)) + (set! (-> this wiggle-factor) (* 2.0 f2-4)) ) 0 (none) ) -(defmethod krew-boss-clone-method-179 krew-boss-clone ((obj krew-boss-clone) (arg0 vector)) +(defmethod krew-boss-clone-method-179 krew-boss-clone ((this krew-boss-clone) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1052,16 +1052,16 @@ For example for an elevator pre-compute the distance between the first and last (vf7 :class vf) ) (init-vf0-vector) - (+! (-> obj wiggle-angle) (-> obj delta-wiggle-angle)) - (if (< 65536.0 (-> obj wiggle-angle)) - (+! (-> obj wiggle-angle) -65536.0) + (+! (-> this wiggle-angle) (-> this delta-wiggle-angle)) + (if (< 65536.0 (-> this wiggle-angle)) + (+! (-> this wiggle-angle) -65536.0) ) - (let* ((v1-5 (-> obj root trans)) + (let* ((v1-5 (-> this root trans)) (a1-2 (vector-! (new 'stack-no-clear 'vector) v1-5 arg0)) (s3-0 (vector-rotate-around-y! (new 'stack-no-clear 'vector) a1-2 16384.0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (let ((v1-6 (* (-> obj wiggle-factor) (sin (-> obj wiggle-angle))))) + (let ((v1-6 (* (-> this wiggle-factor) (sin (-> this wiggle-angle))))) (.mov vf7 v1-6) ) (.lvf vf5 (&-> s3-0 quad)) @@ -1070,7 +1070,7 @@ For example for an elevator pre-compute the distance between the first and last (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s4-0 quad) vf6) - (let ((v1-8 (-> obj nav state))) + (let ((v1-8 (-> this nav state))) (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-8 target-post quad) (-> s4-0 quad)) @@ -1082,8 +1082,8 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod go-stare2 krew-boss-clone ((obj krew-boss-clone)) - (go (method-of-object obj hostile)) +(defmethod go-stare2 krew-boss-clone ((this krew-boss-clone)) + (go (method-of-object this hostile)) ) (defstate hostile (krew-boss-clone) @@ -1173,9 +1173,9 @@ For example for an elevator pre-compute the distance between the first and last :post enemy-simple-post ) -(defmethod init-enemy-collision! krew-boss-clone ((obj krew-boss-clone)) +(defmethod init-enemy-collision! krew-boss-clone ((this krew-boss-clone)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1232,43 +1232,43 @@ For example for an elevator pre-compute the distance between the first and last ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :probe #x1 :noendlessfall #x1)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod coin-flip? krew-boss-clone ((obj krew-boss-clone)) +(defmethod coin-flip? krew-boss-clone ((this krew-boss-clone)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch nav-enemy vs krew-boss-clone. -(defmethod relocate krew-boss-clone ((obj krew-boss-clone) (arg0 int)) +(defmethod relocate krew-boss-clone ((this krew-boss-clone) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj lightning v1-0)) - (&+! (-> obj lightning v1-0) arg0) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) arg0) ) ) - (the-as krew-boss-clone ((method-of-type nav-enemy relocate) obj arg0)) + (the-as krew-boss-clone ((method-of-type nav-enemy relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-enemy! krew-boss-clone ((obj krew-boss-clone)) +(defmethod init-enemy! krew-boss-clone ((this krew-boss-clone)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-krew-boss-clone" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> obj enemy-flags)))) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> this enemy-flags)))) (set! (-> *krew-boss-clone-nav-enemy-info* nav-mesh) - (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 1) + (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 1) ) - (init-enemy-behaviour-and-stats! obj *krew-boss-clone-nav-enemy-info*) + (init-enemy-behaviour-and-stats! this *krew-boss-clone-nav-enemy-info*) (dotimes (s5-1 4) - (set! (-> obj lightning s5-1) (new + (set! (-> this lightning s5-1) (new 'process 'lightning-control (new 'static 'lightning-spec @@ -1288,11 +1288,11 @@ For example for an elevator pre-compute the distance between the first and last :duration 30.0 :sound #f ) - obj + this 0.0 ) ) - (let ((v1-17 (-> obj lightning s5-1)) + (let ((v1-17 (-> this lightning s5-1)) (a0-8 0) ) (let ((a1-6 (!= a0-8 (-> v1-17 state mode)))) @@ -1311,28 +1311,28 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-17 state mode) (the-as lightning-mode a0-8)) ) ) - (let ((v1-20 (-> obj neck))) + (let ((v1-20 (-> this neck))) (set! (-> v1-20 up) (the-as uint 1)) (set! (-> v1-20 nose) (the-as uint 2)) (set! (-> v1-20 ear) (the-as uint 0)) (set-vector! (-> v1-20 twist-max) 3640.889 11832.889 0.0 1.0) (set! (-> v1-20 ignore-angle) 15473.777) ) - (let ((v1-22 (-> obj nav))) + (let ((v1-22 (-> this nav))) (set! (-> v1-22 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (set-vector! (-> obj root scale) 0.8 0.8 0.8 1.0) - (set! (-> obj draw light-index) (the-as uint 1)) - (set-vector! (-> obj draw color-emissive) 0.0 1.0 0.0 0.0) - (set! (-> obj wiggle-angle) 0.0) - (set! (-> obj delta-wiggle-angle) 182.04445) - (set! (-> obj wiggle-factor) 2.0) - (set! (-> obj id) (new 'static 'sound-id)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj spawning)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set-vector! (-> this root scale) 0.8 0.8 0.8 1.0) + (set! (-> this draw light-index) (the-as uint 1)) + (set-vector! (-> this draw color-emissive) 0.0 1.0 0.0 0.0) + (set! (-> this wiggle-angle) 0.0) + (set! (-> this delta-wiggle-angle) 182.04445) + (set! (-> this wiggle-factor) 2.0) + (set! (-> this id) (new 'static 'sound-id)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this spawning)) (none) ) @@ -1351,16 +1351,16 @@ For example for an elevator pre-compute the distance between the first and last (none) ) -(defmethod init-proj-settings! krew-boss-shot ((obj krew-boss-shot)) +(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)) obj) - (set! (-> obj move) krew-boss-shot-move) - (set! (-> obj max-speed) 245760.0) - (set! (-> obj timeout) (seconds 5)) + ((the-as (function projectile none) (find-parent-method krew-boss-shot 31)) this) + (set! (-> this move) krew-boss-shot-move) + (set! (-> this max-speed) 245760.0) + (set! (-> this timeout) (seconds 5)) (none) ) -(defmethod play-impact-sound krew-boss-shot ((obj krew-boss-shot) (arg0 projectile-options)) +(defmethod play-impact-sound krew-boss-shot ((this krew-boss-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -1384,56 +1384,56 @@ For example for an elevator pre-compute the distance between the first and last ) -(defmethod draw hud-krew-boss ((obj hud-krew-boss)) - (set-hud-piece-position! (-> obj sprites 1) (the int (+ 462.0 (* 130.0 (-> obj offset)))) 350) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -32 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) -96 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 1)) -62 14) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 1)) -32 14) - (let ((s5-0 (-> obj values 0 current)) - (f28-0 (* 0.01 (the float (-> obj values 1 current)))) - (f30-0 (* 0.01 (the float (-> obj values 2 current)))) +(defmethod draw hud-krew-boss ((this hud-krew-boss)) + (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) -96 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites 1)) -32 14) + (let ((s5-0 (-> this values 0 current)) + (f28-0 (* 0.01 (the float (-> this values 1 current)))) + (f30-0 (* 0.01 (the float (-> this values 2 current)))) ) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 1)) -92 15) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 1)) -92 15) (cond ((zero? s5-0) - (set! (-> obj sprites 3 color x) 0) - (set! (-> obj sprites 3 color y) 255) + (set! (-> this sprites 3 color x) 0) + (set! (-> this sprites 3 color y) 255) (set! f28-0 (+ 2.0 f28-0)) ) ((= s5-0 1) - (set! (-> obj sprites 3 color y) 255) - (set! (-> obj sprites 3 color x) 255) + (set! (-> this sprites 3 color y) 255) + (set! (-> this sprites 3 color x) 255) (set! f28-0 (+ 1.0 f28-0)) ) (else - (set! (-> obj sprites 3 color x) 255) - (set! (-> obj sprites 3 color y) 0) + (set! (-> this sprites 3 color x) 255) + (set! (-> this sprites 3 color y) 0) 0 ) ) - (set! (-> obj sprites 3 scale-x) (* -7.25 f28-0)) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 1)) -84 4) + (set! (-> this sprites 3 scale-x) (* -7.25 f28-0)) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 1)) -84 4) (cond ((< f30-0 0.5) - (set! (-> obj sprites 4 color x) 255) - (set! (-> obj sprites 4 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-0)))) + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-0)))) ) (else - (set! (-> obj sprites 4 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-0))))) - (set! (-> obj sprites 4 color y) 255) + (set! (-> this sprites 4 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-0))))) + (set! (-> this sprites 4 color y) 255) ) ) - (set! (-> obj sprites 4 scale-x) (* -18.25 f30-0)) + (set! (-> this sprites 4 scale-x) (* -18.25 f30-0)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-krew-boss ((obj hud-krew-boss)) - (set! (-> obj values 0 target) (+ (-> (the-as krew-boss (-> obj parent 0)) gameplay-pass) -1)) - (let ((v1-7 (/ (-> (the-as krew-boss (-> obj parent 0)) hit-points) +(defmethod update-values hud-krew-boss ((this hud-krew-boss)) + (set! (-> this values 0 target) (+ (-> (the-as krew-boss (-> this parent 0)) gameplay-pass) -1)) + (let ((v1-7 (/ (-> (the-as krew-boss (-> this parent 0)) hit-points) (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) 2 1 @@ -1441,59 +1441,59 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (case (-> (the-as krew-boss (-> obj parent 0)) gameplay-pass) + (case (-> (the-as krew-boss (-> this parent 0)) gameplay-pass) ((1) - (set! (-> obj values 1 target) (the int (* 3.3333333 (the float (+ v1-7 -70))))) + (set! (-> this values 1 target) (the int (* 3.3333333 (the float (+ v1-7 -70))))) ) ((2) - (set! (-> obj values 1 target) (the int (* 3.3333333 (the float (+ v1-7 -40))))) + (set! (-> this values 1 target) (the int (* 3.3333333 (the float (+ v1-7 -40))))) ) (else - (set! (-> obj values 1 target) (the int (* 2.5 (the float v1-7)))) + (set! (-> this values 1 target) (the int (* 2.5 (the float v1-7)))) ) ) ) - (when (< (-> obj values 1 target) 0) - (set! (-> obj values 1 target) 0) + (when (< (-> this values 1 target) 0) + (set! (-> this values 1 target) 0) 0 ) - ((method-of-type hud update-values) obj) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-krew-boss ((obj hud-krew-boss)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-krew-boss ((this hud-krew-boss)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj values 0 target) 0) - (set! (-> obj values 1 target) 100) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 2 tex) + (set! (-> this values 0 target) 0) + (set! (-> this values 1 target) 100) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 2 tex) (lookup-texture-by-name "hud-baronsymbol-01" (the-as string #f) (the-as (pointer texture-page) #f)) ) - (set! (-> obj sprites 2 flags) (the-as uint 4)) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 5 scale-x) 0.5) - (set! (-> obj sprites 5 flags) (the-as uint 4)) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 6 scale-x) 0.5) - (set! (-> obj sprites 6 flags) (the-as uint 4)) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 3 scale-y) 3.25) - (set! (-> obj sprites 3 color z) 0) - (set! (-> obj sprites 3 flags) (the-as uint 4)) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 4 scale-y) 1.5) - (set! (-> obj sprites 4 color z) 0) - (set! (-> obj sprites 4 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning large)) - (set! (-> obj strings 0 scale) 0.5) + (set! (-> this sprites 2 flags) (the-as uint 4)) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 5 scale-x) 0.5) + (set! (-> this sprites 5 flags) (the-as uint 4)) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 6 scale-x) 0.5) + (set! (-> this sprites 6 flags) (the-as uint 4)) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 3 scale-y) 3.25) + (set! (-> this sprites 3 color z) 0) + (set! (-> this sprites 3 flags) (the-as uint 4)) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 4 scale-y) 1.5) + (set! (-> this sprites 4 color z) 0) + (set! (-> this sprites 4 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning large)) + (set! (-> this strings 0 scale) 0.5) 0 (none) ) @@ -1835,68 +1835,68 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod init-enemy! krew-boss ((obj krew-boss)) +(defmethod init-enemy! krew-boss ((this krew-boss)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-krew-boss" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *krew-boss-nav-enemy-info*) - (let ((v1-5 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *krew-boss-nav-enemy-info*) + (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) (set! (-> v1-5 ear) (the-as uint 0)) (set-vector! (-> v1-5 twist-max) 3640.889 11832.889 0.0 1.0) (set! (-> v1-5 ignore-angle) 15473.777) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (let ((v1-9 (-> obj nav))) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((v1-9 (-> this nav))) (set! (-> v1-9 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (set-vector! (-> obj root trans) -1302528.0 -1449984.0 -6836224.0 1.0) - (let ((v1-20 (-> obj nav state)) - (a0-17 (-> obj root trans)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set-vector! (-> this root trans) -1302528.0 -1449984.0 -6836224.0 1.0) + (let ((v1-20 (-> this nav state)) + (a0-17 (-> this root trans)) ) (logclear! (-> v1-20 flags) (nav-state-flag directional-mode)) (logior! (-> v1-20 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-20 target-post quad) (-> a0-17 quad)) ) 0 - (set! (-> obj next-clone-side) 0) - (set! (-> obj last-closest-spawn) 0) - (set! (-> obj next-shooting-frame) 0) - (set! (-> obj floating) #f) - (set! (-> obj next-path-point) 0) - (set! (-> obj num-clones-to-spawn) 0) - (set! (-> obj gameplay-pass) 0) - (set! (-> obj hud-handle) (the-as handle #f)) - (set! (-> obj id) (new 'static 'sound-id)) - (set! (-> obj channel) (the-as uint 35)) - (set! (-> obj play-clone-wave-speech) #f) - (set! (-> obj spawn-charge) #f) + (set! (-> this next-clone-side) 0) + (set! (-> this last-closest-spawn) 0) + (set! (-> this next-shooting-frame) 0) + (set! (-> this floating) #f) + (set! (-> this next-path-point) 0) + (set! (-> this num-clones-to-spawn) 0) + (set! (-> this gameplay-pass) 0) + (set! (-> this hud-handle) (the-as handle #f)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this channel) (the-as uint 35)) + (set! (-> this play-clone-wave-speech) #f) + (set! (-> this spawn-charge) #f) (dotimes (v1-24 8) - (set! (-> obj clones v1-24) (the-as handle #f)) + (set! (-> this clones v1-24) (the-as handle #f)) ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag36)))) - (set! (-> obj nav callback-info) *nav-enemy-null-callback-info*) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> this nav callback-info) *nav-enemy-null-callback-info*) 0 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle krew-boss ((obj krew-boss)) +(defmethod go-idle krew-boss ((this krew-boss)) (cond ((task-node-closed? (game-task-node castle-boss-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj hidden)) + (go (method-of-object this hidden)) ) ) (none) @@ -1954,66 +1954,66 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler krew-boss ((obj krew-boss) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler krew-boss ((this krew-boss) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('track) (cond ((-> arg3 param 0) - (if (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (if (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) #t 'abort ) ) (else - (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) ) ) ) (('notify) (case (-> arg3 param 0) (('hit) - (krew-hits-jak-speech obj) - (set! (-> obj next-shooting-frame) 100) - (set! (-> obj spawn-charge) #t) + (krew-hits-jak-speech this) + (set! (-> this next-shooting-frame) 100) + (set! (-> this spawn-charge) #t) (let ((v0-0 (the-as object (current-time)))) - (set! (-> obj state-time) (the-as time-frame v0-0)) + (set! (-> this state-time) (the-as time-frame v0-0)) v0-0 ) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod enemy-method-102 krew-boss ((obj krew-boss)) +(defmethod enemy-method-102 krew-boss ((this krew-boss)) #f ) -(defmethod enemy-method-77 krew-boss ((obj krew-boss) (arg0 (pointer float))) +(defmethod enemy-method-77 krew-boss ((this krew-boss) (arg0 (pointer float))) (with-pp (ja-channel-push! 1 0) (cond - ((<= (-> obj hit-points) 0) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 14))) + ((<= (-> this hit-points) 0) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) (set! (-> a0-2 param 0) (-> pp clock time-adjust-ratio)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 14)) num-func-loop!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-loop!) ) ) (else - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) ) (set! (-> a0-3 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) frames num-frames) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) frames num-frames) -1 ) ) @@ -2022,7 +2022,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> a0-3 frame-num) 0.0) (joint-control-channel-group! a0-3 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) num-func-seek! ) ) @@ -2032,20 +2032,20 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod enemy-method-78 krew-boss ((obj krew-boss) (arg0 (pointer float))) +(defmethod enemy-method-78 krew-boss ((this krew-boss) (arg0 (pointer float))) (cond - ((<= (-> obj hit-points) 0) + ((<= (-> this hit-points) 0) #f ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) ) (set! (-> a0-2 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) frames num-frames ) @@ -2057,7 +2057,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) num-func-seek! ) ) @@ -2066,7 +2066,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod enemy-method-81 krew-boss ((obj krew-boss)) +(defmethod enemy-method-81 krew-boss ((this krew-boss)) #f ) @@ -2135,9 +2135,9 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod init-enemy-collision! krew-boss ((obj krew-boss)) +(defmethod init-enemy-collision! krew-boss ((this krew-boss)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2187,13 +2187,13 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod coin-flip? krew-boss ((obj krew-boss)) +(defmethod coin-flip? krew-boss ((this krew-boss)) "@returns The result of a 50/50 RNG roll" #f ) @@ -2563,14 +2563,14 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod damage-amount-from-attack krew-boss ((obj krew-boss) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack krew-boss ((this krew-boss) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let ((v1-0 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg1))) (cond ((or (logtest? (penetrate jak-blue-shot) v1-0) (logtest? (penetrate jak-dark-shot) v1-0)) (cond - ((>= (- (current-time) (-> obj last-damage-time)) (seconds 5)) - (set! (-> obj last-damage-time) (current-time)) + ((>= (- (current-time) (-> this last-damage-time)) (seconds 5)) + (set! (-> this last-damage-time) (current-time)) 5 ) (else @@ -2588,12 +2588,12 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod nav-enemy-method-142 krew-boss ((obj krew-boss) (arg0 nav-control)) +(defmethod nav-enemy-method-142 krew-boss ((this krew-boss) (arg0 nav-control)) (with-pp (cond - ((not (logtest? (-> obj nav flags) (nav-control-flag update-heading-from-facing))) - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root trans))) - (s3-0 (quaternion->matrix (new-stack-matrix0) (-> obj root quat))) + ((not (logtest? (-> this nav flags) (nav-control-flag update-heading-from-facing))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (s3-0 (quaternion->matrix (new-stack-matrix0) (-> this root quat))) ) (vector-normalize! s5-1 1.0) (let* ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s3-0 vector 1) 1.0)) @@ -2605,10 +2605,10 @@ For example for an elevator pre-compute the distance between the first and last (f2-0 182.04445) ) (cond - ((= (-> obj gameplay-pass) 2) + ((= (-> this gameplay-pass) 2) (set! f2-0 273.06668) ) - ((= (-> obj gameplay-pass) 3) + ((= (-> this gameplay-pass) 3) (set! f2-0 364.0889) ) ) @@ -2623,13 +2623,13 @@ For example for an elevator pre-compute the distance between the first and last ) ) (let ((f0-3 (seek f30-0 f0-0 (* f2-0 (-> pp clock time-adjust-ratio))))) - (quaternion-axis-angle! (-> obj root quat) 0.0 1.0 0.0 f0-3) + (quaternion-axis-angle! (-> this root quat) 0.0 1.0 0.0 f0-3) ) ) ) ) (else - ((method-of-type nav-enemy nav-enemy-method-142) obj arg0) + ((method-of-type nav-enemy nav-enemy-method-142) this arg0) ) ) 0 @@ -2934,15 +2934,15 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod kill-prefer-falling krew-boss ((obj krew-boss)) +(defmethod kill-prefer-falling krew-boss ((this krew-boss)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (when (handle->process (-> obj hud-handle)) - (send-event (-> obj hud-handle process 0) 'hide-and-die) - (set! (-> obj hud-handle) (the-as handle #f)) + (when (handle->process (-> this hud-handle)) + (send-event (-> this hud-handle process 0) 'hide-and-die) + (set! (-> this hud-handle) (the-as handle #f)) ) (send-event *target* 'get-notify #f) - (add-process *gui-control* obj (the-as gui-channel (-> obj channel)) (gui-action play) "ds269" -99.0 0) - ((method-of-type nav-enemy kill-prefer-falling) obj) + (add-process *gui-control* this (the-as gui-channel (-> this channel)) (gui-action play) "ds269" -99.0 0) + ((method-of-type nav-enemy kill-prefer-falling) this) ) (define *krew-boss-die-positions* (new 'static 'boxed-array :type vector diff --git a/goal_src/jak2/levels/castle/castle-obs.gc b/goal_src/jak2/levels/castle/castle-obs.gc index 9facf7c466..348d55296e 100644 --- a/goal_src/jak2/levels/castle/castle-obs.gc +++ b/goal_src/jak2/levels/castle/castle-obs.gc @@ -24,24 +24,24 @@ ) -(defmethod init! cas-conveyor ((obj cas-conveyor)) +(defmethod init! cas-conveyor ((this cas-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (let ((t9-0 (method-of-type conveyor init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj speed) (res-lump-float (-> obj entity) 'speed :default 30720.0)) - (set! (-> obj belt-radius) (res-lump-float (-> obj entity) 'center-radius :default 15974.4)) - (set! (-> obj texture-anim-index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) - (set! (-> obj my-id) - (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) + (set! (-> this speed) (res-lump-float (-> this entity) 'speed :default 30720.0)) + (set! (-> this belt-radius) (res-lump-float (-> this entity) 'center-radius :default 15974.4)) + (set! (-> this texture-anim-index) (res-lump-value (-> this entity) 'index uint :time -1000000000.0)) + (set! (-> this my-id) + (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) ) - (set! (-> obj pull-y-threshold) 409.6) + (set! (-> this pull-y-threshold) 409.6) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-conveyor ((obj cas-conveyor) (arg0 entity-actor)) +(defmethod init-from-entity! cas-conveyor ((this cas-conveyor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -49,37 +49,37 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (reset-root! obj) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (if (< (-> obj path curve num-cverts) 2) + (reset-root! this) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) - (init! obj) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj target-speed) (-> obj speed)) - (conveyor-method-21 obj) + (init! this) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this target-speed) (-> this speed)) + (conveyor-method-21 this) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-16 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-16 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-16 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-16)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-16)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) -(defmethod deactivate cas-conveyor ((obj cas-conveyor)) - (sound-stop (-> obj sound-id)) - ((the-as (function conveyor none) (find-parent-method cas-conveyor 10)) obj) +(defmethod deactivate cas-conveyor ((this cas-conveyor)) + (sound-stop (-> this sound-id)) + ((the-as (function conveyor none) (find-parent-method cas-conveyor 10)) this) (none) ) @@ -350,7 +350,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-conveyor-switch ((obj cas-conveyor-switch) (arg0 entity-actor)) +(defmethod init-from-entity! cas-conveyor-switch ((this cas-conveyor-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -358,7 +358,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) @@ -373,48 +373,48 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-conveyor-switch" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (if (!= (-> obj path curve num-cverts) 2) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (!= (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) - (get-point-in-path! (-> obj path) (-> obj red-pos) 0.0 'exact) - (get-point-in-path! (-> obj path) (-> obj blue-pos) 1.0 'exact) - (set! (-> obj lightning-timer) 0) + (get-point-in-path! (-> this path) (-> this red-pos) 0.0 'exact) + (get-point-in-path! (-> this path) (-> this blue-pos) 1.0 'exact) + (set! (-> this lightning-timer) 0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-27 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-27 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-27 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-27)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-27)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj quat0 quad) (-> obj root quat quad)) - (quaternion-rotate-y! (-> obj quat180) (-> obj quat0) 32768.0) - (set! (-> obj speed) (res-lump-float (-> obj entity) 'speed :default 30720.0)) - (set! (-> obj target-speed) (-> obj speed)) - (go (method-of-object obj idle)) + (set! (-> this quat0 quad) (-> this root quat quad)) + (quaternion-rotate-y! (-> this quat180) (-> this quat0) 32768.0) + (set! (-> this speed) (res-lump-float (-> this entity) 'speed :default 30720.0)) + (set! (-> this target-speed) (-> this speed)) + (go (method-of-object this idle)) (none) ) @@ -492,7 +492,7 @@ This commonly includes things such as: (suspend) (logior! (-> self entity extra perm status) (entity-perm-status dead)) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 4)) + (until (time-elapsed? gp-2 (seconds 4)) (suspend) ) ) @@ -634,14 +634,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-electric-fence ((obj cas-electric-fence) (arg0 entity-actor)) +(defmethod init-from-entity! cas-electric-fence ((this cas-electric-fence) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) @@ -657,24 +657,24 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-electric-fence" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj next-spawn-time) 0) - (set! (-> obj stop) #f) + (set! (-> this next-spawn-time) 0) + (set! (-> this stop) #f) (ja-channel-set! 1) - (let ((a0-14 (-> obj skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -695,9 +695,9 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 2.25) ) -(defmethod basebutton-method-34 cas-button ((obj cas-button)) +(defmethod basebutton-method-34 cas-button ((this cas-button)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -713,15 +713,15 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod prepare-trigger-event! cas-button ((obj cas-button)) +(defmethod prepare-trigger-event! cas-button ((this cas-button)) "Sets `event-going-down` to `'trigger`" - (set! (-> obj event-down) 'shutdown) + (set! (-> this event-down) 'shutdown) 0 (none) ) @@ -749,39 +749,39 @@ This commonly includes things such as: ) ) -(defmethod basebutton-method-33 cas-button ((obj cas-button)) +(defmethod basebutton-method-33 cas-button ((this cas-button)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) - (let ((s5-1 (-> obj skel root-channel 0))) + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) ) ) (else - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) ) ) - (set! (-> obj anim-speed) 2.0) + (set! (-> this anim-speed) 2.0) (transform-post) (none) ) @@ -804,16 +804,16 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 9) ) -(defmethod get-art-group cas-elevator ((obj cas-elevator)) +(defmethod get-art-group cas-elevator ((this cas-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cas-elevator" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch float vs none. -(defmethod cas-elevator-method-49 cas-elevator ((obj cas-elevator)) - (let* ((f0-1 (fmax 0.0 (- (-> obj root trans y) (-> obj bottom-top 0)))) +(defmethod cas-elevator-method-49 cas-elevator ((this cas-elevator)) + (let* ((f0-1 (fmax 0.0 (- (-> this root trans y) (-> this bottom-top 0)))) (f0-3 (* 0.001171875 (- f0-1 (* (the float (the int (/ f0-1 30720.0))) 30720.0)))) - (v1-6 (-> obj skel root-channel 0)) + (v1-6 (-> this skel root-channel 0)) ) (set! (-> v1-6 num-func) num-func-identity) (set! (-> v1-6 frame-num) f0-3) @@ -821,15 +821,15 @@ This commonly includes things such as: (none) ) -(defmethod move-between-points cas-elevator ((obj cas-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points cas-elevator ((this cas-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s5-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s5-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((a0-8 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) @@ -839,7 +839,7 @@ This commonly includes things such as: ) ) -(defmethod commited-to-ride? cas-elevator ((obj cas-elevator)) +(defmethod commited-to-ride? cas-elevator ((this cas-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) @@ -849,7 +849,7 @@ This commonly includes things such as: ) (when a0-2 (let* ((a0-3 (get-trans a0-2 0)) - (v1-2 (vector-! (new 'stack-no-clear 'vector) a0-3 (-> obj root trans))) + (v1-2 (vector-! (new 'stack-no-clear 'vector) a0-3 (-> this root trans))) ) (< (sqrtf (+ (* (-> v1-2 x) (-> v1-2 x)) (* (-> v1-2 z) (-> v1-2 z)))) 28672.0) ) @@ -933,23 +933,23 @@ This commonly includes things such as: ) ) -(defmethod deactivate cas-elevator ((obj cas-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method cas-elevator 10)) obj) +(defmethod deactivate cas-elevator ((this cas-elevator)) + (sound-stop (-> this sound-id)) + ((the-as (function elevator none) (find-parent-method cas-elevator 10)) this) (none) ) -(defmethod init-plat! cas-elevator ((obj cas-elevator)) +(defmethod init-plat! cas-elevator ((this cas-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." - (set! (-> obj sound-id) (new-sound-id)) - (cas-elevator-method-49 obj) + (set! (-> this sound-id) (new-sound-id)) + (cas-elevator-method-49 this) (none) ) -(defmethod init-plat-collision! cas-elevator ((obj cas-elevator)) +(defmethod init-plat-collision! cas-elevator ((this cas-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -970,7 +970,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1251,14 +1251,14 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-rot-bridge ((obj cas-rot-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! cas-rot-bridge ((this cas-rot-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) (set! (-> s4-0 total-prims) (the-as uint 6)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1308,39 +1308,39 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-rot-bridge" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) 16384.0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) - (let ((v1-30 (-> obj index))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) 16384.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this index) (res-lump-value (-> this entity) 'index uint :time -1000000000.0)) + (let ((v1-30 (-> this index))) (cond ((zero? v1-30) - (+! (-> obj root trans x) 5734.4) - (let ((s5-2 (-> obj skel root-channel 0))) - (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-identity) + (+! (-> this root trans x) 5734.4) + (let ((s5-2 (-> this skel root-channel 0))) + (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> this draw art-group data 6)) num-func-identity) (set! (-> s5-2 frame-num) 0.0) ) ) ((= v1-30 1) - (let ((s5-3 (-> obj skel root-channel 0))) - (joint-control-channel-group! s5-3 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (let ((s5-3 (-> this skel root-channel 0))) + (joint-control-channel-group! s5-3 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) (set! (-> s5-3 frame-num) 0.0) ) ) ) ) - (set! (-> obj draw light-index) (the-as uint 1)) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj sound-flag) #f) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this sound-flag) #f) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1482,7 +1482,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-switch ((obj cas-switch) (arg0 entity-actor)) +(defmethod init-from-entity! cas-switch ((this cas-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1490,7 +1490,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1519,35 +1519,35 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-switch" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-22 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-22 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-22 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-22)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-22)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj anim-index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) - (set! (-> obj direction) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0)) - (let ((s5-2 (-> obj root trans)) - (s4-2 (-> obj root trans)) + (set! (-> this anim-index) (res-lump-value (-> this entity) 'index uint :time -1000000000.0)) + (set! (-> this direction) (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0)) + (let ((s5-2 (-> this root trans)) + (s4-2 (-> this root trans)) (t9-10 (method-of-type res-lump get-property-struct)) - (a0-27 (-> obj entity)) + (a0-27 (-> this entity)) (a1-19 'trans-offset) (a2-9 'interp) (a3-7 -1000000000.0) @@ -1563,14 +1563,14 @@ This commonly includes things such as: (the-as vector (t9-10 a0-27 a1-19 a2-9 a3-7 t0-6 (the-as (pointer res-tag) #f) *res-static-buf*)) ) ) - (set! (-> obj y-start) (-> obj root trans y)) - (if (zero? (-> obj direction)) - (set! (-> obj y-delta) -12288.0) - (set! (-> obj y-delta) 12288.0) + (set! (-> this y-start) (-> this root trans y)) + (if (zero? (-> this direction)) + (set! (-> this y-delta) -12288.0) + (set! (-> this y-delta) 12288.0) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj sound-flag) #f) - (go (method-of-object obj idle)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this sound-flag) #f) + (go (method-of-object this idle)) (none) ) @@ -1682,7 +1682,7 @@ This commonly includes things such as: (suspend) (ja-channel-set! 0) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -1696,14 +1696,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-trapdoor ((obj cas-trapdoor) (arg0 entity-actor)) +(defmethod init-from-entity! cas-trapdoor ((this cas-trapdoor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1718,24 +1718,24 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) (if (not (task-node-closed? (game-task-node castle-boss-resolution))) - (set! (-> obj root penetrated-by) (penetrate flop)) + (set! (-> this root penetrated-by) (penetrate flop)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-trapdoor" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-14 (-> obj skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1795,14 +1795,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-chain-plat ((obj cas-chain-plat) (arg0 entity-actor)) +(defmethod init-from-entity! cas-chain-plat ((this cas-chain-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) @@ -1817,16 +1817,16 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-chain-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask enemy)) + (go (method-of-object this idle)) (none) ) @@ -1913,14 +1913,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-rot-blade ((obj cas-rot-blade) (arg0 entity-actor)) +(defmethod init-from-entity! cas-rot-blade ((this cas-rot-blade) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1949,15 +1949,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-rot-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 2)) + (set! (-> this draw light-index) (the-as uint 2)) (let ((a1-10 (new 'stack-no-clear 'sync-info-params))) (let ((v1-20 0)) (if #t @@ -1973,21 +1973,21 @@ This commonly includes things such as: (set! (-> a1-10 ease-out) 0.15) (set! (-> a1-10 pause-in) 0.2) (set! (-> a1-10 pause-out) 0.0) - (initialize! (-> obj sync) a1-10) + (initialize! (-> this sync) a1-10) ) - (let ((a0-26 (-> obj node-list data 4))) + (let ((a0-26 (-> this node-list data 4))) (set! (-> a0-26 param0) cas-rot-blade-callback) - (set! (-> a0-26 param1) obj) + (set! (-> a0-26 param1) this) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj draw shadow-ctrl) *cas-rot-blade-shadow-control*) - (go (method-of-object obj idle)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this draw shadow-ctrl) *cas-rot-blade-shadow-control*) + (go (method-of-object this idle)) (none) ) -(defmethod deactivate cas-rot-blade ((obj cas-rot-blade)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method cas-rot-blade 10)) obj) +(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) (none) ) @@ -2024,21 +2024,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-flag-a ((obj cas-flag-a) (arg0 entity-actor)) +(defmethod init-from-entity! cas-flag-a ((this cas-flag-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-flag-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2075,21 +2075,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-flag-b ((obj cas-flag-b) (arg0 entity-actor)) +(defmethod init-from-entity! cas-flag-b ((this cas-flag-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-flag-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2134,10 +2134,10 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.6)) + (when (time-elapsed? (-> self state-time) (seconds 0.6)) (let ((a0-1 *target*)) (if (and a0-1 (not (focus-test? a0-1 disable dead)) @@ -2146,7 +2146,7 @@ This commonly includes things such as: (go-virtual spawning) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) :code sleep-code @@ -2165,19 +2165,19 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self spawn-count) 0) (set! (-> self spawn-count-total) 0) (set! (-> self player-dist) (-> self notice-dist)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.6)) + (when (time-elapsed? (-> self state-time) (seconds 0.6)) (let ((a0-1 *target*)) (if (and a0-1 (not (logtest? (-> a0-1 focus-status) (focus-status disable dead)))) (set! (-> self player-dist) (vector-vector-distance (get-trans a0-1 0) (-> self root trans))) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) :code (behavior () @@ -2189,7 +2189,7 @@ This commonly includes things such as: (ja :num! (seek!)) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (suspend) ) ) @@ -2229,14 +2229,14 @@ This commonly includes things such as: ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (the int (* 300.0 (rand-vu-float-range 0.5 1.0)))) + (until (time-elapsed? gp-3 (the int (* 300.0 (rand-vu-float-range 0.5 1.0)))) (suspend) ) ) ) (while (> (-> self spawn-count) 0) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.43)) + (until (time-elapsed? gp-4 (seconds 0.43)) (suspend) ) ) @@ -2258,7 +2258,7 @@ This commonly includes things such as: ) ) (let ((gp-5 (current-time))) - (until (>= (- (current-time) gp-5) (seconds 2)) + (until (time-elapsed? gp-5 (seconds 2)) (suspend) ) ) @@ -2292,7 +2292,7 @@ This commonly includes things such as: ) ) (let ((gp-7 (current-time))) - (until (>= (- (current-time) gp-7) (seconds 1)) + (until (time-elapsed? gp-7 (seconds 1)) (suspend) ) ) @@ -2326,7 +2326,7 @@ This commonly includes things such as: (ja :num! (seek! 0.0)) ) (let ((gp-10 (current-time))) - (until (>= (- (current-time) gp-10) (seconds 1)) + (until (time-elapsed? gp-10 (seconds 1)) (suspend) ) ) @@ -2366,7 +2366,7 @@ This commonly includes things such as: (not v1-28) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.51)) + (until (time-elapsed? gp-1 (seconds 0.51)) (suspend) ) ) @@ -2380,7 +2380,7 @@ This commonly includes things such as: ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 1)) + (until (time-elapsed? gp-2 (seconds 1)) (suspend) ) ) @@ -2420,7 +2420,7 @@ This commonly includes things such as: ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 2.5)) + (until (time-elapsed? gp-3 (seconds 2.5)) (suspend) ) ) @@ -2433,7 +2433,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-robot-door ((obj cas-robot-door) (arg0 entity-actor)) +(defmethod init-from-entity! cas-robot-door ((this cas-robot-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2441,9 +2441,9 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 512) + (stack-size-set! (-> this main-thread) 512) (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) @@ -2458,54 +2458,54 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-robot-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj spawner-actor) (the-as symbol (entity-actor-lookup arg0 'alt-actor 0))) - (set! (-> obj door-actor 0) (entity-actor-lookup arg0 'alt-actor 1)) - (set! (-> obj door-actor 1) (entity-actor-lookup arg0 'alt-actor 2)) - (set! (-> obj spawn-max) 5) - (set! (-> obj spawn-total) -1) - (set! (-> obj last-guard) (the-as handle #f)) + (set! (-> this spawner-actor) (the-as symbol (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this door-actor 0) (entity-actor-lookup arg0 'alt-actor 1)) + (set! (-> this door-actor 1) (entity-actor-lookup arg0 'alt-actor 2)) + (set! (-> this spawn-max) 5) + (set! (-> this spawn-total) -1) + (set! (-> this last-guard) (the-as handle #f)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-13 (res-lump-data arg0 'extra-id (pointer int32) :tag-ptr (& sv-16)))) (when v1-13 - (set! (-> obj spawn-max) (-> v1-13 0)) + (set! (-> this spawn-max) (-> v1-13 0)) (if (< (the-as uint 1) (-> sv-16 elt-count)) - (set! (-> obj spawn-total) (-> v1-13 1)) + (set! (-> this spawn-total) (-> v1-13 1)) ) ) ) - (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default 122880.0)) - (set! (-> obj anim-index) - (res-lump-value (-> obj entity) 'index int :default (the-as uint128 -1) :time -1000000000.0) + (set! (-> this notice-dist) (res-lump-float arg0 'notice-dist :default 122880.0)) + (set! (-> this anim-index) + (res-lump-value (-> this entity) 'index int :default (the-as uint128 -1) :time -1000000000.0) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-17 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (let ((v1-17 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-32)))) (cond ((and v1-17 (nonzero? (-> sv-32 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-17)) - (set! (-> obj actor-group-count) (the-as int (-> sv-32 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-17)) + (set! (-> this actor-group-count) (the-as int (-> sv-32 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (let ((a0-27 (-> obj skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-27 (-> this skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2547,7 +2547,7 @@ This commonly includes things such as: :virtual #t :code sleep-code :post (behavior () - (when (>= (- (current-time) (-> self timer)) (seconds 0.08)) + (when (time-elapsed? (-> self timer) (seconds 0.08)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((f30-1 (* 182.04445 (rand-vu-float-range -20.0 20.0))) (f28-1 (* 182.04445 (rand-vu-float-range -180.0 180.0))) @@ -2583,20 +2583,20 @@ This commonly includes things such as: ) ) ) - (set! (-> self timer) (current-time)) + (set-time! (-> self timer)) ) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! lightning-ball ((obj lightning-ball) (arg0 entity-actor)) +(defmethod init-from-entity! lightning-ball ((this lightning-ball) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core action) (collide-action solid)) @@ -2609,11 +2609,11 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj timer) (current-time)) - (update-transforms (-> obj root)) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (set-time! (-> this timer)) + (update-transforms (-> this root)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/castle/pad/caspad-obs.gc b/goal_src/jak2/levels/castle/pad/caspad-obs.gc index ca27fe9fd1..c56edebe07 100644 --- a/goal_src/jak2/levels/castle/pad/caspad-obs.gc +++ b/goal_src/jak2/levels/castle/pad/caspad-obs.gc @@ -25,31 +25,31 @@ :bounds (static-spherem 0 0 0 18) ) -(defmethod get-art-group cpad-elevator ((obj cpad-elevator)) +(defmethod get-art-group cpad-elevator ((this cpad-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cpad-elevator" (the-as (pointer uint32) #f)) ) -(defmethod move-between-points cpad-elevator ((obj cpad-elevator) (vec vector) (point-a float) (point-b float)) +(defmethod move-between-points cpad-elevator ((this cpad-elevator) (vec vector) (point-a float) (point-b float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((path-point-a (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) point-a 'interp)) - (path-point-b (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) point-b 'interp)) - (elevator-trans (-> obj root trans)) + (let ((path-point-a (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-a 'interp)) + (path-point-b (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-b 'interp)) + (elevator-trans (-> this root trans)) ) (when (and (< (-> path-point-b y) (-> path-point-a y)) (< (-> vec y) (+ -8192.0 (-> elevator-trans y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) vec elevator-trans))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 49152.0) (< (fabs (-> s4-2 z)) 49152.0)) ) ) ) ) -(defmethod commited-to-ride? cpad-elevator ((obj cpad-elevator)) +(defmethod commited-to-ride? cpad-elevator ((this cpad-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((target *target*) (target-proc (if (type? target process-focusable) @@ -59,19 +59,19 @@ ) (when target-proc (let* ((target-pos (get-trans target-proc 0)) - (dist-from-center (vector-! (new 'stack-no-clear 'vector) target-pos (-> obj root trans))) + (dist-from-center (vector-! (new 'stack-no-clear 'vector) target-pos (-> this root trans))) ) - (vector-inv-orient-by-quat! dist-from-center dist-from-center (-> obj root quat)) + (vector-inv-orient-by-quat! dist-from-center dist-from-center (-> this root quat)) (and (< (fabs (-> dist-from-center x)) 40960.0) (< (fabs (-> dist-from-center z)) 40960.0)) ) ) ) ) -(defmethod configure-collision cpad-elevator ((obj cpad-elevator) (collide-with-jak? symbol)) +(defmethod configure-collision cpad-elevator ((this cpad-elevator) (collide-with-jak? symbol)) "Appropriately sets the collision on the elevator @param collide-with-jak? If set, the elevator will collide with Jak" - (let ((prim (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) + (let ((prim (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (collide-with-jak? (set! (-> prim prim-core collide-as) (collide-spec obstacle pusher)) @@ -111,7 +111,7 @@ ) :code (behavior () (let ((frame-counter (current-time))) - (until (>= (- (current-time) frame-counter) (seconds 1)) + (until (time-elapsed? frame-counter (seconds 1)) (suspend) ) ) @@ -142,45 +142,45 @@ ) ) -(defmethod activate-elevator cpad-elevator ((obj cpad-elevator)) +(defmethod activate-elevator cpad-elevator ((this cpad-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (if (task-node-closed? (game-task-node dig-knock-down-introduction)) - (go (method-of-object obj arrived)) - (go (method-of-object obj dormant)) + (go (method-of-object this arrived)) + (go (method-of-object this dormant)) ) ) -(defmethod deactivate cpad-elevator ((obj cpad-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method cpad-elevator 10)) obj) +(defmethod deactivate cpad-elevator ((this cpad-elevator)) + (sound-stop (-> this sound-id)) + ((the-as (function elevator none) (find-parent-method cpad-elevator 10)) this) (none) ) ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod set-ambient-sound! cpad-elevator ((obj cpad-elevator)) +(defmethod set-ambient-sound! cpad-elevator ((this cpad-elevator)) "Sets the elevator's [[ambient-sound]] up" - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "cpad-elevator-l" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "cpad-elevator-l" :fo-max 70) (-> this root trans)) ) (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! cpad-elevator ((obj cpad-elevator)) +(defmethod init-plat! cpad-elevator ((this cpad-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." - (let ((last-path-index (+ (-> obj path curve num-cverts) -1))) - (calc-dist-between-points! obj 0 last-path-index) - (calc-dist-between-points! obj last-path-index 0) + (let ((last-path-index (+ (-> this path curve num-cverts) -1))) + (calc-dist-between-points! this 0 last-path-index) + (calc-dist-between-points! this last-path-index 0) ) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this sound-id) (new-sound-id)) (none) ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! cpad-elevator ((obj cpad-elevator)) +(defmethod init-plat-collision! cpad-elevator ((this cpad-elevator)) "TODO - collision stuff for setting up the platform" - (let ((cshape-moving (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape-moving dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape-moving reaction) cshape-reaction-default) (set! (-> cshape-moving no-reaction) @@ -213,7 +213,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> cshape-moving backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape-moving backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape-moving) + (set! (-> this root) cshape-moving) ) (none) ) diff --git a/goal_src/jak2/levels/castle/pad/castle-tasks.gc b/goal_src/jak2/levels/castle/pad/castle-tasks.gc index 1848c9cb1d..68b3f5fcd7 100644 --- a/goal_src/jak2/levels/castle/pad/castle-tasks.gc +++ b/goal_src/jak2/levels/castle/pad/castle-tasks.gc @@ -24,7 +24,7 @@ (when (< (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) (send-event (handle->process (-> self arrow)) 'leave) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.007)) + (until (time-elapsed? gp-2 (seconds 0.007)) (suspend) ) ) diff --git a/goal_src/jak2/levels/castle/roboguard-level.gc b/goal_src/jak2/levels/castle/roboguard-level.gc index 4ea8c01ea2..2d27093fca 100644 --- a/goal_src/jak2/levels/castle/roboguard-level.gc +++ b/goal_src/jak2/levels/castle/roboguard-level.gc @@ -480,7 +480,7 @@ ) :post (behavior () (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) (ja-post) @@ -574,7 +574,7 @@ ) 0 (logior! (-> self focus-status) (focus-status dangerous)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (roboguard-level-method-185 self (the-as symbol 1)) (vector-z-quaternion! (-> self roll-dir) (-> self root quat)) (set! (-> self roll-timer) 0) @@ -746,8 +746,8 @@ ) ) -(defmethod go-hostile roboguard-level ((obj roboguard-level)) - (go (method-of-object obj roll-enter)) +(defmethod go-hostile roboguard-level ((this roboguard-level)) + (go (method-of-object this roll-enter)) ) (defstate die (roboguard-level) @@ -824,8 +824,8 @@ :post #f ) -(defmethod roboguard-level-method-185 roboguard-level ((obj roboguard-level) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim)) +(defmethod roboguard-level-method-185 roboguard-level ((this roboguard-level) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim)) (a0-1 arg0) ) (cond @@ -890,108 +890,108 @@ (none) ) -(defmethod enemy-method-77 roboguard-level ((obj roboguard-level) (arg0 (pointer float))) +(defmethod enemy-method-77 roboguard-level ((this roboguard-level) (arg0 (pointer float))) (ja-channel-push! 1 0) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-0) (knocked-type knocked-type-1) (knocked-type knocked-type-4) (knocked-type knocked-type-6) ) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 21)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) ) ) (else - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) (-> arg0 0)) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) ) ) #t ) -(defmethod enemy-method-78 roboguard-level ((obj roboguard-level) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 roboguard-level ((this roboguard-level) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-0) (knocked-type knocked-type-1) (knocked-type knocked-type-4) (knocked-type knocked-type-6) ) - (let ((v1-4 (-> obj skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> v1-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> v1-4 param 1) (-> arg0 0)) (set! (-> v1-4 frame-num) 0.0) - (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) ) (else - (let ((v1-8 (-> obj skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 24))) + (let ((v1-8 (-> this skel root-channel 0))) + (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 24))) (set! (-> v1-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 24)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 24)) frames num-frames) -1)) ) (set! (-> v1-8 param 1) (-> arg0 0)) (set! (-> v1-8 frame-num) 0.0) - (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> obj draw art-group data 24)) num-func-seek!) + (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> this draw art-group data 24)) num-func-seek!) ) ) ) #t ) -(defmethod general-event-handler roboguard-level ((obj roboguard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler roboguard-level ((this roboguard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) (cond - ((logtest? (-> obj flags) 4) + ((logtest? (-> this flags) 4) (let ((v1-3 (the-as object (-> arg3 param 1))) (a0-2 arg0) ) (cond - ((!= (-> (the-as attack-info v1-3) id) (-> obj incoming-attack-id)) - (set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-3) id)) + ((!= (-> (the-as attack-info v1-3) id) (-> this incoming-attack-id)) + (set! (-> this incoming-attack-id) (-> (the-as attack-info v1-3) id)) (when (and a0-2 (not (logtest? (process-mask enemy) (-> a0-2 mask)))) (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info v1-3)))) (when s5-0 (new 'stack-no-clear 'vector) (set! (-> (new 'stack-no-clear 'vector) quad) (-> s5-0 root trans quad)) - (if (< (-> obj roll-attack-count) (the-as uint 3)) - (+! (-> obj roll-attack-count) 1) + (if (< (-> this roll-attack-count) (the-as uint 3)) + (+! (-> this roll-attack-count) 1) ) - (vector-! (-> obj roll-dir) (-> obj root trans) (-> s5-0 root trans)) - (set! (-> obj roll-dir y) 0.0) - (vector-xz-normalize! (-> obj roll-dir) 1.0) - (set! (-> obj speed) (+ 245760.0 (vector-length (-> s5-0 root transv)))) - (let ((a0-9 (-> obj nav state)) - (v1-19 (vector-float*! (new 'stack-no-clear 'vector) (-> obj roll-dir) (-> obj speed))) + (vector-! (-> this roll-dir) (-> this root trans) (-> s5-0 root trans)) + (set! (-> this roll-dir y) 0.0) + (vector-xz-normalize! (-> this roll-dir) 1.0) + (set! (-> this speed) (+ 245760.0 (vector-length (-> s5-0 root transv)))) + (let ((a0-9 (-> this nav state)) + (v1-19 (vector-float*! (new 'stack-no-clear 'vector) (-> this roll-dir) (-> this speed))) ) (set! (-> a0-9 velocity quad) (-> v1-19 quad)) ) 0 - (let ((v1-23 (-> obj nav state))) - (set! (-> v1-23 speed) (-> obj speed)) + (let ((v1-23 (-> this nav state))) + (set! (-> v1-23 speed) (-> this speed)) ) 0 - (let ((v1-25 (-> obj nav))) - (set! (-> v1-25 target-speed) (-> obj speed)) + (let ((v1-25 (-> this nav))) + (set! (-> v1-25 target-speed) (-> this speed)) ) 0 (sound-play "robo-ball-kick") @@ -1007,14 +1007,14 @@ ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('hit 'hit-knocked 'hit-flinch) - (when (not (logtest? (-> obj flags) 4)) + (when (not (logtest? (-> this flags) 4)) (let ((s5-2 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> s5-2 fountain-rand-transv-lo quad) (-> obj incoming attacker-pos quad)) + (set! (-> s5-2 fountain-rand-transv-lo quad) (-> this incoming attacker-pos quad)) (set! (-> s5-2 fountain-rand-transv-hi x) 4096.0) (set! (-> s5-2 fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -1023,21 +1023,21 @@ 31 s5-2 *roboguard-level-exploder-params* - :to obj + :to this ) ) - (dispose! obj) - (go (method-of-object obj explode)) + (dispose! this) + (go (method-of-object this explode)) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 roboguard-level ((obj roboguard-level) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 roboguard-level ((this roboguard-level) (arg0 process) (arg1 event-message-block)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1049,8 +1049,8 @@ (the-as symbol (cond - ((or (= (-> arg0 type) target) (not (logtest? (-> obj flags) 4))) - ((method-of-type nav-enemy enemy-method-76) obj arg0 arg1) + ((or (= (-> arg0 type) target) (not (logtest? (-> this flags) 4))) + ((method-of-type nav-enemy enemy-method-76) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -1063,7 +1063,7 @@ ) (when (and s1-0 (logtest? (process-mask enemy) (-> s1-0 mask))) (let ((s2-1 - (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> (the-as process-drawable s1-0) root trans)) + (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> (the-as process-drawable s1-0) root trans)) ) ) (new 'stack-no-clear 'vector) @@ -1071,10 +1071,10 @@ (let ((s3-1 (new 'stack-no-clear 'vector))) (vector-normalize! s2-1 1.0) (let ((f0-3 - (- (vector-dot (-> obj root transv) s2-1) (vector-dot (-> (the-as process-drawable s1-0) root transv) s2-1)) + (- (vector-dot (-> this root transv) s2-1) (vector-dot (-> (the-as process-drawable s1-0) root transv) s2-1)) ) ) - (let ((a1-5 (-> obj nav state))) + (let ((a1-5 (-> this nav state))) (set! (-> s3-1 quad) (-> a1-5 velocity quad)) ) (let ((a0-16 s3-1)) @@ -1091,34 +1091,34 @@ (.svf (&-> a0-16 quad) vf6) ) ) - (let ((a0-17 (-> obj nav state)) + (let ((a0-17 (-> this nav state)) (v1-22 s3-1) ) (set! (-> a0-17 velocity quad) (-> v1-22 quad)) ) 0 - (set! (-> obj speed) (vector-length s3-1)) - (let ((v1-28 (-> obj nav state))) - (set! (-> v1-28 speed) (-> obj speed)) + (set! (-> this speed) (vector-length s3-1)) + (let ((v1-28 (-> this nav state))) + (set! (-> v1-28 speed) (-> this speed)) ) 0 - (let ((v1-30 (-> obj nav))) - (set! (-> v1-30 target-speed) (-> obj speed)) + (let ((v1-30 (-> this nav))) + (set! (-> v1-30 target-speed) (-> this speed)) ) 0 - (set! (-> obj roll-timer) (+ (current-time) (the int (* 300.0 (get-rand-float-range obj 3.0 5.0))))) - (set! (-> obj roll-dir quad) (-> s3-1 quad)) + (set! (-> this roll-timer) (+ (current-time) (the int (* 300.0 (get-rand-float-range this 3.0 5.0))))) + (set! (-> this roll-dir quad) (-> s3-1 quad)) ) ) - (set! (-> obj roll-dir y) 0.0) - (vector-xz-normalize! (-> obj roll-dir) 1.0) - (let ((a0-22 (-> obj nav state)) - (v1-40 (-> obj roll-dir)) + (set! (-> this roll-dir y) 0.0) + (vector-xz-normalize! (-> this roll-dir) 1.0) + (let ((a0-22 (-> this nav state)) + (v1-40 (-> this roll-dir)) ) (set! (-> a0-22 heading quad) (-> v1-40 quad)) ) 0 - (logior! (-> obj flags) 64) + (logior! (-> this flags) 64) ) ) (send-event arg0 'touch (-> arg1 param 0)) @@ -1129,7 +1129,7 @@ ) ) -(defmethod nav-enemy-method-142 roboguard-level ((obj roboguard-level) (arg0 nav-control)) +(defmethod nav-enemy-method-142 roboguard-level ((this roboguard-level) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s3-0 quad) (-> a1-1 heading quad)) @@ -1137,7 +1137,7 @@ (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (let ((gp-0 (new 'stack-no-clear 'quaternion)) - (s5-1 (-> obj root quat)) + (s5-1 (-> this root quat)) ) (quaternion-set! gp-0 0.0 (-> s3-0 x) 0.0 (+ 1.0 (-> s3-0 z))) (quaternion-normalize! gp-0) @@ -1153,54 +1153,54 @@ (none) ) -(defmethod nav-enemy-method-176 roboguard-level ((obj roboguard-level)) - (nav-enemy-method-177 obj) - (let ((a0-2 obj)) +(defmethod nav-enemy-method-176 roboguard-level ((this roboguard-level)) + (nav-enemy-method-177 this) + (let ((a0-2 this)) (when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags)) (cond - ((logtest? (enemy-flag enemy-flag38) (-> obj enemy-flags)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag38)))) - (set! (-> obj root gspot-pos quad) (-> obj root trans quad)) + ((logtest? (enemy-flag enemy-flag38) (-> this enemy-flags)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag38)))) + (set! (-> this root gspot-pos quad) (-> this root trans quad)) ) (else - (nav-enemy-method-142 obj (-> obj nav)) - (nav-enemy-method-143 obj (-> obj nav)) + (nav-enemy-method-142 this (-> this nav)) + (nav-enemy-method-143 this (-> this nav)) ) ) ) ) - (track-target! obj) - (update-transforms (-> obj root)) + (track-target! this) + (update-transforms (-> this root)) 0 (none) ) -(defmethod dispose! roboguard-level ((obj roboguard-level)) +(defmethod dispose! roboguard-level ((this roboguard-level)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) - (send-event (ppointer->process (-> obj parent)) 'roboguard-die) - ((method-of-type nav-enemy dispose!) obj) + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) + (send-event (ppointer->process (-> this parent)) 'roboguard-die) + ((method-of-type nav-enemy dispose!) this) ) (none) ) -(defmethod deactivate roboguard-level ((obj roboguard-level)) - (sound-stop (-> obj roll-sound)) - ((the-as (function nav-enemy none) (find-parent-method roboguard-level 10)) obj) +(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) (none) ) ;; WARN: Return type mismatch nav-enemy vs roboguard-level. -(defmethod relocate roboguard-level ((obj roboguard-level) (arg0 int)) +(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)) obj arg0) + ((the-as (function nav-enemy int nav-enemy) (find-parent-method roboguard-level 7)) this arg0) ) ) -(defmethod init-enemy-collision! roboguard-level ((obj roboguard-level)) +(defmethod init-enemy-collision! roboguard-level ((this roboguard-level)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1250,32 +1250,32 @@ (set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! roboguard-level ((obj roboguard-level)) +(defmethod init-enemy! roboguard-level ((this roboguard-level)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard-level" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> obj enemy-flags)))) - (init-enemy-behaviour-and-stats! obj *roboguard-level-nav-enemy-info*) - (let ((v1-8 (-> obj nav))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> this enemy-flags)))) + (init-enemy-behaviour-and-stats! this *roboguard-level-nav-enemy-info*) + (let ((v1-8 (-> this nav))) (set! (-> v1-8 nav-cull-radius) 81920.0) ) 0 - (set! (-> obj fact cam-horz) 98304.0) - (set! (-> obj fact cam-vert) 24576.0) - (set! (-> obj fact cam-notice-dist) 122880.0) - (let ((v1-16 (-> obj nav))) + (set! (-> this fact cam-horz) 98304.0) + (set! (-> this fact cam-vert) 24576.0) + (set! (-> this fact cam-notice-dist) 122880.0) + (let ((v1-16 (-> this nav))) (logclear! (-> v1-16 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43)))) (let ((a0-13 v1-16)) (set! (-> a0-13 sphere-mask) (the-as uint #x800fe)) ) @@ -1286,8 +1286,8 @@ 0 (logclear! (-> v1-16 flags) (nav-control-flag output-sphere-hash)) ) - (set! (-> obj enemy-info callback-info) *nav-enemy-physics-callback-info*) - (let ((v1-18 obj)) + (set! (-> this enemy-info callback-info) *nav-enemy-physics-callback-info*) + (let ((v1-18 this)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-18 enemy-flags))) (set! (-> v1-18 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-18 enemy-flags)))) ) @@ -1295,8 +1295,8 @@ (set! (-> v1-18 nav callback-info) (-> v1-18 enemy-info callback-info)) ) 0 - (set! (-> obj roll-sound) (new-sound-id)) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> this roll-sound) (new-sound-id)) + (set! (-> this flags) (the-as uint 0)) 0 (none) ) diff --git a/goal_src/jak2/levels/city/bombbot/bombbot.gc b/goal_src/jak2/levels/city/bombbot/bombbot.gc index 97c72f163f..18d096f405 100644 --- a/goal_src/jak2/levels/city/bombbot/bombbot.gc +++ b/goal_src/jak2/levels/city/bombbot/bombbot.gc @@ -762,11 +762,11 @@ ) ) -(defmethod bombbot-method-180 bombbot ((obj bombbot)) +(defmethod bombbot-method-180 bombbot ((this bombbot)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) - (set! (-> a1-0 sphere quad) (-> obj root trans quad)) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> obj root transv quad)) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) (vector-reset! (-> a1-0 velocity)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) @@ -796,7 +796,7 @@ ;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 -(defmethod bombbot-method-179 bombbot ((obj bombbot)) +(defmethod bombbot-method-179 bombbot ((this bombbot)) (local-vars (at-0 int) (sv-864 vector) @@ -820,7 +820,7 @@ (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 (-> s5-0 bbox)) - (a0-2 (-> obj root trans)) + (a0-2 (-> this root trans)) (a1-0 (new 'stack-no-clear 'vector)) ) (set! (-> a1-0 x) 24576.0) @@ -830,7 +830,7 @@ (vector-! (the-as vector v1-0) a0-2 a1-0) ) (let ((v1-2 (-> s5-0 bbox max)) - (a0-4 (-> obj root trans)) + (a0-4 (-> this root trans)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 x) 24576.0) @@ -845,28 +845,28 @@ (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (fill-using-bounding-box *collide-cache* s5-0) (dotimes (s4-0 4) - (-> obj joint-ik s4-0 shoulder-matrix-no-ik) - (-> obj joint-ik s4-0 elbow-matrix-no-ik) + (-> this joint-ik s4-0 shoulder-matrix-no-ik) + (-> this joint-ik s4-0 elbow-matrix-no-ik) (new 'stack-no-clear 'vector) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> obj node-list data 3 bone transform vector 1 quad)) + (set! (-> s2-0 quad) (-> this node-list data 3 bone transform vector 1 quad)) (new 'stack-no-clear 'vector) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((f30-0 0.4)) (vector-normalize! s2-0 1.0) - (let ((s1-0 (-> obj feet s4-0))) + (let ((s1-0 (-> this feet s4-0))) (let* ((f0-10 (+ (* 0.0033333334 (the float (mod (current-time) 300))) (-> s1-0 offset))) (f28-0 (- f0-10 (* (the float (the int (/ f0-10 1.0))) 1.0))) (s0-0 (new 'stack-no-clear 'vector)) ) (cond ((>= f30-0 f28-0) - (vector-orient-by-quat! s3-0 (-> s1-0 pos-offset) (-> obj root quat)) + (vector-orient-by-quat! s3-0 (-> s1-0 pos-offset) (-> this root quat)) (let ((f26-0 (- f30-0 f28-0))) (set! sv-880 s0-0) (set! sv-864 (new 'stack-no-clear 'vector)) (set! (-> sv-864 x) 0.0) - (set! (-> sv-864 y) (sin (* (-> obj y-angular-velocity) (-> pp clock frames-per-second)))) + (set! (-> sv-864 y) (sin (* (-> this y-angular-velocity) (-> pp clock frames-per-second)))) (set! (-> sv-864 z) 0.0) (set! (-> sv-864 w) 1.0) (let ((v1-39 s3-0)) @@ -880,7 +880,7 @@ (v1-41 s0-0) (a0-11 (new 'stack-no-clear 'vector)) ) - (.lvf vf1 (&-> (-> obj linear-speed) quad)) + (.lvf vf1 (&-> (-> this linear-speed) quad)) (let ((f0-17 (-> pp clock frames-per-second))) (.mov at-0 f0-17) ) @@ -921,7 +921,7 @@ (.svf (&-> a1-8 quad) vf6) ) ) - (vector+! s3-0 s3-0 (-> obj root trans)) + (vector+! s3-0 s3-0 (-> this root trans)) (let ((a1-11 (-> s5-0 start-pos))) (let ((v1-45 s3-0)) (let ((a0-17 s2-0)) @@ -1036,7 +1036,7 @@ (let ((s0-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s0-2 (let ((t9-11 (method-of-type part-tracker activate))) - (t9-11 (the-as part-tracker s0-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-11 (the-as part-tracker s0-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-12 run-function-in-process) (a0-39 s0-2) @@ -1130,15 +1130,15 @@ (let ((f0-64 (- (-> s3-0 y) (-> s0-4 y)))) (lerp-scale 1.0 0.0 f0-64 0.0 8192.0) ) - (- (-> s0-4 y) (-> obj root trans y)) - (vector-dot s2-0 (vector-! (new 'stack-no-clear 'vector) s0-4 (-> obj root trans))) + (- (-> s0-4 y) (-> this root trans y)) + (vector-dot s2-0 (vector-! (new 'stack-no-clear 'vector) s0-4 (-> this root trans))) ) ) ) (set! (-> s1-0 real-position quad) (-> s3-0 quad)) ) ) - (handle-copy! (-> obj joint-ik s4-0) s3-0) + (handle-copy! (-> this joint-ik s4-0) s3-0) ) ) ) @@ -1149,46 +1149,46 @@ ) ) -(defmethod track-target! bombbot ((obj bombbot)) +(defmethod track-target! bombbot ((this bombbot)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (local-vars (sv-16 sparticle-launcher) (sv-20 sparticle-launcher)) (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) (cond - ((= (-> obj nav state mesh) *default-nav-mesh*) + ((= (-> this nav state mesh) *default-nav-mesh*) (dotimes (s5-0 4) - (enable-set! (-> obj joint-ik s5-0) #f) + (enable-set! (-> this joint-ik s5-0) #f) ) ) (else - (bombbot-method-179 obj) + (bombbot-method-179 this) (dotimes (s5-1 4) - (enable-set! (-> obj joint-ik s5-1) #t) + (enable-set! (-> this joint-ik s5-1) #t) ) ) ) - (vector-! (-> obj linear-speed) (-> obj root trans) (-> obj last-trans)) - (set! (-> obj last-trans quad) (-> obj root trans quad)) - (set! (-> obj y-angular-velocity) - (deg- (quaternion-y-angle (-> obj root quat)) (quaternion-y-angle (-> obj last-quat))) + (vector-! (-> this linear-speed) (-> this root trans) (-> this last-trans)) + (set! (-> this last-trans quad) (-> this root trans quad)) + (set! (-> this y-angular-velocity) + (deg- (quaternion-y-angle (-> this root quat)) (quaternion-y-angle (-> this last-quat))) ) - (quaternion-copy! (-> obj last-quat) (-> obj root quat)) - (set! (-> obj rigidbody state force-callback) - (the-as (function object float none) (method-of-object obj bombbot-method-183)) + (quaternion-copy! (-> this last-quat) (-> this root quat)) + (set! (-> this rigidbody state force-callback) + (the-as (function object float none) (method-of-object this bombbot-method-183)) ) - (bombbot-method-184 obj) + (bombbot-method-184 this) (set! sv-16 (the-as sparticle-launcher #f)) (set! sv-20 (the-as sparticle-launcher #f)) (cond - ((< (-> obj hit-points) 30) + ((< (-> this hit-points) 30) (set! sv-16 (-> *part-id-table* 778)) (set! sv-20 (-> *part-id-table* 774)) ) - ((< (-> obj hit-points) 60) + ((< (-> this hit-points) 60) (set! sv-16 (-> *part-id-table* 781)) ) (else @@ -1198,7 +1198,7 @@ ) ) (when sv-16 - (let ((gp-1 (-> obj node-list data 4 bone transform)) + (let ((gp-1 (-> this node-list data 4 bone transform)) (s5-3 (new 'stack-no-clear 'vector)) ) (dotimes (s4-1 2) @@ -1239,29 +1239,29 @@ (none) ) -(defmethod run-logic? bombbot ((obj bombbot)) +(defmethod run-logic? bombbot ((this bombbot)) #t ) -(defmethod enemy-method-58 bombbot ((obj bombbot) (arg0 process) (arg1 event-message-block)) - ((method-of-type nav-enemy enemy-method-58) obj arg0 arg1) +(defmethod enemy-method-58 bombbot ((this bombbot) (arg0 process) (arg1 event-message-block)) + ((method-of-type nav-enemy enemy-method-58) this arg0 arg1) 'hit-flinch ) -(defmethod damage-amount-from-attack bombbot ((obj bombbot) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack bombbot ((this bombbot) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (-> arg1 param 1) - (let ((f0-1 (the float (penetrate-using->damage (the-as penetrate (-> obj incoming penetrate-using)))))) + (let ((f0-1 (the float (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using)))))) (cond - ((logtest? #xc0000 (-> obj incoming penetrate-using)) - (if (and (logtest? #x40000 (-> obj incoming penetrate-using)) - (logtest? #x80000 (-> obj incoming penetrate-using)) + ((logtest? #xc0000 (-> this incoming penetrate-using)) + (if (and (logtest? #x40000 (-> this incoming penetrate-using)) + (logtest? #x80000 (-> this incoming penetrate-using)) ) #x42c80000 (the int (* 1.8 f0-1)) ) ) - ((logtest? #x20000 (-> obj incoming penetrate-using)) + ((logtest? #x20000 (-> this incoming penetrate-using)) (the int (* 2.0 f0-1)) ) (else @@ -1271,20 +1271,20 @@ ) ) -(defmethod general-event-handler bombbot ((obj bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler bombbot ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('nav-mesh-kill) - (change-to *default-nav-mesh* obj) + (change-to *default-nav-mesh* this) #t ) (('hit-flinch) (send-event *traffic-manager* 'set-alert-level 1) (cond - ((zero? (-> obj hit-points)) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'die))) - (kill-prefer-falling obj) + ((zero? (-> this hit-points)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'die))) + (kill-prefer-falling this) ) ) (else @@ -1295,7 +1295,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector))) (let ((s4-1 (new 'stack-no-clear 'vector))) (set! (-> s4-1 quad) (-> v1-14 root trans quad)) - (let ((s3-1 (matrix->trans (-> obj node-list data 3 bone transform) (new 'stack-no-clear 'vector)))) + (let ((s3-1 (matrix->trans (-> this node-list data 3 bone transform) (new 'stack-no-clear 'vector)))) (+! (-> s4-1 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) (+! (-> s4-1 y) (* 4096.0 (rand-vu-float-range -20.0 20.0))) (+! (-> s4-1 z) (* 4096.0 (rand-vu-float-range -20.0 20.0))) @@ -1303,9 +1303,9 @@ ) ) (vector-normalize! s5-1 4096000.0) - (vector-inv-orient-by-quat! s5-1 s5-1 (-> obj root quat)) - (let* ((s4-2 (-> obj rigidbody)) - (v1-26 (-> obj rigidbody)) + (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) + (let* ((s4-2 (-> this rigidbody)) + (v1-26 (-> this rigidbody)) (a1-10 (new 'stack-no-clear 'vector)) (a1-11 (rigid-body-method-23 (-> v1-26 state) a1-10)) ) @@ -1321,18 +1321,18 @@ ) ) (('explode) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'explode))) - (go (method-of-object obj explode)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'explode))) + (go (method-of-object this explode)) ) ) (('touched 'touch 'attack) (if (logtest? (process-mask vehicle) (-> arg0 mask)) (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((id (new-attack-id)) (mode 'mine)))) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -1349,7 +1349,7 @@ ) ) -(defmethod bombbot-method-181 bombbot ((obj bombbot) (arg0 vector)) +(defmethod bombbot-method-181 bombbot ((this bombbot) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1377,17 +1377,17 @@ ) ) (when (and s1-1 - (!= obj s1-1) - (not (focus-test? obj inactive)) - (not (focus-test? obj disable)) - (not (focus-test? obj dead)) + (!= this s1-1) + (not (focus-test? this inactive)) + (not (focus-test? this disable)) + (not (focus-test? this dead)) (not (logtest? (process-mask guard) (-> s1-1 mask))) (not (logtest? (process-mask crate) (-> s1-1 mask))) (logtest? (process-mask vehicle) (-> s1-1 mask)) s1-1 (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) ) - (let ((f0-0 (vector-vector-xz-distance (-> obj root trans) (-> s1-1 root trans)))) + (let ((f0-0 (vector-vector-xz-distance (-> this root trans) (-> s1-1 root trans)))) (when (or (not gp-0) (< f0-0 f30-0)) (set! gp-0 s1-1) (set! f30-0 f0-0) @@ -1404,8 +1404,8 @@ ) (cond (gp-0 - (set! (-> obj target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) - (let ((v1-34 (-> obj target-pos))) + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) + (let ((v1-34 (-> this target-pos))) (let ((a0-16 (-> gp-0 root trans))) (let ((a1-8 (-> gp-0 root transv))) (let ((a2-1 0.0)) @@ -1420,12 +1420,12 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-34 quad) vf6) ) - (set! (-> obj start-target-pos quad) (-> gp-0 root trans quad)) - (set! (-> obj start-target-vel quad) (-> gp-0 root transv quad)) - (try-update-focus (-> obj focus) (the-as process-focusable gp-0) obj) + (set! (-> this start-target-pos quad) (-> gp-0 root trans quad)) + (set! (-> this start-target-vel quad) (-> gp-0 root transv quad)) + (try-update-focus (-> this focus) (the-as process-focusable gp-0) this) ) (else - (clear-focused (-> obj focus)) + (clear-focused (-> this focus)) ) ) ) @@ -1587,7 +1587,7 @@ ) ) -(defmethod bombbot-method-182 bombbot ((obj bombbot)) +(defmethod bombbot-method-182 bombbot ((this bombbot)) (local-vars (v1-28 symbol) (sv-880 matrix) @@ -1609,9 +1609,9 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s2-0 (handle->process (-> obj focus handle)))) + (let ((s2-0 (handle->process (-> this focus handle)))) (set! sv-880 (new 'stack-no-clear 'matrix)) - (let* ((a0-4 (-> obj node-list data 6 bone transform)) + (let* ((a0-4 (-> this node-list data 6 bone transform)) (a2-0 (-> a0-4 quad 0)) (a1-1 (-> a0-4 quad 1)) (v1-7 (-> a0-4 quad 2)) @@ -1662,7 +1662,7 @@ player-list ) ) - (set! (-> v1-14 ignore-process0) obj) + (set! (-> v1-14 ignore-process0) this) (set! (-> v1-14 ignore-process1) #f) (set! (-> v1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-14 action-mask) (collide-action solid)) @@ -1758,12 +1758,12 @@ (not (logtest? (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead ignore grabbed))) ) (let ((s2-1 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> s2-1 ent) (-> obj entity)) + (set! (-> s2-1 ent) (-> this entity)) (set! (-> s2-1 charge) 1.0) (set! (-> s2-1 options) (projectile-options)) - (set! (-> s2-1 notify-handle) (process->handle obj)) + (set! (-> s2-1 notify-handle) (process->handle this)) (set! (-> s2-1 owner-handle) (the-as handle #f)) - (set! (-> s2-1 ignore-handle) (process->handle obj)) + (set! (-> s2-1 ignore-handle) (process->handle this)) (let* ((v1-69 *game-info*) (a0-67 (+ (-> v1-69 attack-id) 1)) ) @@ -1774,18 +1774,18 @@ (set! (-> s2-1 pos quad) (-> s3-0 start-pos quad)) (vector+! (-> s2-1 vel) (-> s3-0 start-pos) s5-0) (vector-normalize-copy! (-> s2-1 vel) (-> s3-0 move-dist) 40960000.0) - (spawn-projectile guard-lazer-shot s2-1 obj *default-dead-pool*) + (spawn-projectile guard-lazer-shot s2-1 this *default-dead-pool*) ) ) ) ) - (when (zero? (-> obj lazer-sound)) + (when (zero? (-> this lazer-sound)) (let ((s3-1 sound-play-by-spec) (s2-2 (static-sound-spec "bb-laser-fire" :volume 0.0 :mask (pitch))) ) (set! (-> s2-2 volume) 1024) (set! (-> s2-2 pitch-mod) 0) - (set! (-> obj lazer-sound) (s3-1 s2-2 (new-sound-id) s4-0)) + (set! (-> this lazer-sound) (s3-1 s2-2 (new-sound-id) s4-0)) ) ) (set! (-> *part-id-table* 4630 init-specs 4 initial-valuef) (vector-length s5-0)) @@ -1919,7 +1919,7 @@ ) ) (if (= (vector-length (-> self root transv)) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (set! (-> self last-head-roty-speed) (-> self head-roty-speed)) (set! (-> self head-roty-speed) (vector-y-angle (-> self node-list data 4 bone transform vector 2))) @@ -2035,7 +2035,7 @@ ) (set! (-> self explosing) #f) (set! (-> self beep-time) 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let ((v1-0 (-> self nav))) @@ -2047,16 +2047,16 @@ (if (>= (- (current-time) (-> self state-time)) 0) (seek! (-> self legs-strength 0) 0.8 (* 10.0 (seconds-per-frame))) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.8)) + (if (time-elapsed? (-> self state-time) (seconds 0.8)) (seek! (-> self legs-strength 3) 0.4 (* 10.0 (seconds-per-frame))) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 1.6)) + (if (time-elapsed? (-> self state-time) (seconds 1.6)) (seek! (-> self legs-strength 1) 0.0 (* 10.0 (seconds-per-frame))) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 2.4)) + (if (time-elapsed? (-> self state-time) (seconds 2.4)) (seek! (-> self legs-strength 2) 0.5 (* 10.0 (seconds-per-frame))) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 2.8)) + (when (time-elapsed? (-> self state-time) (seconds 2.8)) (sound-play "bb-explode") (go-virtual explode) ) @@ -2091,7 +2091,7 @@ (set! (-> self minimap) #f) ) (set! (-> self explosing) #f) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) (set! (-> gp-0 fountain-rand-transv-lo quad) (-> self root trans quad)) (set! (-> gp-0 duration) (seconds 3)) @@ -2164,21 +2164,21 @@ ) ;; WARN: Return type mismatch nav-enemy vs bombbot. -(defmethod relocate bombbot ((obj bombbot) (arg0 int)) +(defmethod relocate bombbot ((this bombbot) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj joint-ik v1-0)) - (&+! (-> obj joint-ik v1-0) arg0) + (if (nonzero? (-> this joint-ik v1-0)) + (&+! (-> this joint-ik v1-0) arg0) ) ) - (if (nonzero? (-> obj rigidbody)) - (&+! (-> obj rigidbody) arg0) + (if (nonzero? (-> this rigidbody)) + (&+! (-> this rigidbody) arg0) ) - (the-as bombbot ((the-as (function nav-enemy int nav-enemy) (find-parent-method bombbot 7)) obj arg0)) + (the-as bombbot ((the-as (function nav-enemy int nav-enemy) (find-parent-method bombbot 7)) this arg0)) ) -(defmethod init-enemy-collision! bombbot ((obj bombbot)) +(defmethod init-enemy-collision! bombbot ((this bombbot)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2429,13 +2429,13 @@ (set! (-> s5-0 backup-collide-as) (-> v1-78 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-78 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod coin-flip? bombbot ((obj bombbot)) +(defmethod coin-flip? bombbot ((this bombbot)) "@returns The result of a 50/50 RNG roll" #f ) @@ -2697,7 +2697,7 @@ ) ) -(defmethod bombbot-method-183 bombbot ((obj bombbot)) +(defmethod bombbot-method-183 bombbot ((this bombbot)) (local-vars (at-0 int) (sv-160 vector) (sv-176 vector)) (with-pp (rlet ((vf0 :class vf) @@ -2710,16 +2710,16 @@ (init-vf0-vector) (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-reset! a1-0) - (set! (-> a1-0 y) (* -1.0 (-> obj info extra gravity) (-> obj rigidbody state info mass))) - (rigid-body-method-20 (-> obj rigidbody state) a1-0) + (set! (-> a1-0 y) (* -1.0 (-> this info extra gravity) (-> this rigidbody state info mass))) + (rigid-body-method-20 (-> this rigidbody state) a1-0) ) - (rigid-body-method-24 (-> obj rigidbody state)) - (logclear! (-> obj rigidbody state flags) (rigid-body-flag active)) + (rigid-body-method-24 (-> this rigidbody state)) + (logclear! (-> this rigidbody state flags) (rigid-body-flag active)) (dotimes (s5-0 4) (let ((s4-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> *bombbot-spring-setup* s5-0 bpos1) - (-> obj rigidbody state matrix) + (-> this rigidbody state matrix) ) ) ) @@ -2733,12 +2733,12 @@ (s1-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> sv-160 y) (* (-> obj legs-strength s5-0) (-> sv-160 y))) - (+! (-> sv-160 y) (-> obj feet s5-0 main-y)) + (set! (-> sv-160 y) (* (-> this legs-strength s5-0) (-> sv-160 y))) + (+! (-> sv-160 y) (-> this feet s5-0 main-y)) 0.0 0.0 0.0 - (let ((v1-33 (-> obj rigidbody)) + (let ((v1-33 (-> this rigidbody)) (a1-3 s4-0) (a2-1 sv-176) ) @@ -2764,12 +2764,12 @@ (vector-float*! s3-0 s2-0 (- (+ f0-12 f1-8))) ) ) - (rigid-body-method-18 (-> obj rigidbody state) s4-0 s3-0) + (rigid-body-method-18 (-> this rigidbody state) s4-0 s3-0) ) ) ) (let ((v1-54 (new 'stack-no-clear 'vector))) - (.lvf vf1 (&-> (-> obj linear-speed) quad)) + (.lvf vf1 (&-> (-> this linear-speed) quad)) (let ((f0-15 (-> pp clock frames-per-second))) (.mov at-0 f0-15) ) @@ -2784,10 +2784,10 @@ ) ) -(defmethod bombbot-method-184 bombbot ((obj bombbot)) +(defmethod bombbot-method-184 bombbot ((this bombbot)) (rigid-body-control-method-10 - (-> obj rigidbody) - (the-as rigid-body-object obj) + (-> this rigidbody) + (the-as rigid-body-object this) (seconds-per-frame) 0.033333335 ) @@ -2795,123 +2795,123 @@ (none) ) -(defmethod init-enemy! bombbot ((obj bombbot)) +(defmethod init-enemy! bombbot ((this bombbot)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *bombbot-nav-enemy-info*) - (set-vector! (-> obj root scale) 1.0 1.0 1.0 1.0) - (let ((v1-7 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *bombbot-nav-enemy-info*) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (let ((v1-7 (-> this nav))) (set! (-> v1-7 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) (dotimes (s5-1 4) - (set! (-> obj joint-ik s5-1) + (set! (-> this joint-ik s5-1) (new 'process 'joint-mod-ik - obj + this (-> *bombbot-ik-setup* s5-1 elbow-index) (-> *bombbot-ik-setup* s5-1 hand-dist) ) ) - (set! (-> obj joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) ) - (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) - (logior! (-> obj joint-ik 3 flags) (joint-mod-ik-flags elbow-trans-neg)) - (logior! (-> obj joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) - (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) - (logior! (-> obj joint-ik 2 flags) (joint-mod-ik-flags elbow-rot-neg)) - (logior! (-> obj joint-ik 3 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 3 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 2 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 3 flags) (joint-mod-ik-flags elbow-rot-neg)) (let ((f1-0 11878.4) (f0-6 10240.0) ) (let ((f2-0 -10240.0)) - (let ((v1-51 (-> obj feet))) + (let ((v1-51 (-> this feet))) (set! (-> v1-51 0 pos-offset x) f1-0) (set! (-> v1-51 0 pos-offset y) 0.0) (set! (-> v1-51 0 pos-offset z) f0-6) (set! (-> v1-51 0 pos-offset w) 1.0) ) - (set! (-> obj feet 0 offset) 0.0) - (let ((v1-52 (-> obj feet 1))) + (set! (-> this feet 0 offset) 0.0) + (let ((v1-52 (-> this feet 1))) (set! (-> v1-52 pos-offset x) f1-0) (set! (-> v1-52 pos-offset y) 0.0) (set! (-> v1-52 pos-offset z) f2-0) (set! (-> v1-52 pos-offset w) 1.0) ) - (set! (-> obj feet 1 offset) 0.5) - (let ((v1-54 (-> obj feet 2))) + (set! (-> this feet 1 offset) 0.5) + (let ((v1-54 (-> this feet 2))) (set! (-> v1-54 pos-offset x) (- f1-0)) (set! (-> v1-54 pos-offset y) 0.0) (set! (-> v1-54 pos-offset z) f2-0) (set! (-> v1-54 pos-offset w) 1.0) ) ) - (set! (-> obj feet 2 offset) 0.1) - (let ((v1-56 (-> obj feet 3))) + (set! (-> this feet 2 offset) 0.1) + (let ((v1-56 (-> this feet 3))) (set! (-> v1-56 pos-offset x) (- f1-0)) (set! (-> v1-56 pos-offset y) 0.0) (set! (-> v1-56 pos-offset z) f0-6) (set! (-> v1-56 pos-offset w) 1.0) ) ) - (set! (-> obj feet 3 offset) 0.6) - (quaternion-copy! (-> obj last-quat) (-> obj root quat)) - (quaternion-copy! (-> obj main-quat) *unity-quaternion*) - (let ((v1-60 (-> obj nav))) + (set! (-> this feet 3 offset) 0.6) + (quaternion-copy! (-> this last-quat) (-> this root quat)) + (quaternion-copy! (-> this main-quat) *unity-quaternion*) + (let ((v1-60 (-> this nav))) (set! (-> v1-60 sphere-mask) (the-as uint 64)) ) 0 - (let ((a0-28 (-> obj node-list data 3))) + (let ((a0-28 (-> this node-list data 3))) (set! (-> a0-28 param0) bombbot-callback) - (set! (-> a0-28 param1) obj) + (set! (-> a0-28 param1) this) ) - (let ((a0-29 (-> obj node-list data 4))) + (let ((a0-29 (-> this node-list data 4))) (set! (-> a0-29 param0) bombbot-head-callback) - (set! (-> a0-29 param1) obj) + (set! (-> a0-29 param1) this) ) - (let ((a0-30 (-> obj node-list data 5))) + (let ((a0-30 (-> this node-list data 5))) (set! (-> a0-30 param0) bombbot-gun-swivel-callback) - (set! (-> a0-30 param1) obj) + (set! (-> a0-30 param1) this) ) - (let ((a0-31 (-> obj node-list data 6))) + (let ((a0-31 (-> this node-list data 6))) (set! (-> a0-31 param0) bombbot-gun-callback) - (set! (-> a0-31 param1) obj) + (set! (-> a0-31 param1) this) ) - (set! (-> obj rigidbody) (new 'process 'rigid-body-control obj)) - (set! (-> obj info) *bombbot-body-constants*) + (set! (-> this rigidbody) (new 'process 'rigid-body-control this)) + (set! (-> this info) *bombbot-body-constants*) (rigid-body-method-25 - (-> obj rigidbody state) - (-> obj info info) + (-> this rigidbody state) + (-> this info info) *null-vector* *unity-quaternion* - (method-of-object obj bombbot-method-183) + (method-of-object this bombbot-method-183) ) - (set! (-> obj shield-hit-points) 3.0) - (set! (-> obj lazer-sound) (new-sound-id)) - (set! (-> obj head-sound) (new 'static 'sound-id)) - (set! (-> obj cannon-sound) (new 'static 'sound-id)) + (set! (-> this shield-hit-points) 3.0) + (set! (-> this lazer-sound) (new-sound-id)) + (set! (-> this head-sound) (new 'static 'sound-id)) + (set! (-> this cannon-sound) (new 'static 'sound-id)) (transform-post) (dotimes (s5-2 4) - (let ((s4-1 (-> obj feet s5-2))) + (let ((s4-1 (-> this feet s5-2))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-orient-by-quat! s3-0 (-> s4-1 pos-offset) (-> obj root quat)) - (vector+! s3-0 s3-0 (-> obj root trans)) + (vector-orient-by-quat! s3-0 (-> s4-1 pos-offset) (-> this root quat)) + (vector+! s3-0 s3-0 (-> this root trans)) (set! (-> s4-1 next-position quad) (-> s3-0 quad)) (set! (-> s4-1 position quad) (-> s3-0 quad)) ) (set! (-> s4-1 delta-y) 0.0) ) - (set! (-> obj legs-strength s5-2) 1.0) + (set! (-> this legs-strength s5-2) 1.0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) @@ -3074,7 +3074,7 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (talker-spawn-func (-> *talker-speech* 117) *entity-pool* (target-pos 0) (the-as region #f)) (none) ) @@ -3095,8 +3095,8 @@ ((= (level-status *level* 'ctysluma) 'active) (set-setting! 'entity-name "camera-236" 0.0 0) (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (add-process *gui-control* self (gui-channel sig) (gui-action play) "bbotxplo" -99.0 0) @@ -3112,8 +3112,8 @@ ) ) ) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 0.3)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.3))) (suspend) ) (setup @@ -3123,7 +3123,7 @@ (seconds-per-frame) (bucket-id tex-all-map) ) - (while (< (- (current-time) (-> self state-time)) (seconds 1)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (suspend) ) (set-setting! 'interp-time 'abs 0.0 0) @@ -3219,7 +3219,7 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (suspend) ) diff --git a/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc b/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc index 46ba2186cb..37668d73a5 100644 --- a/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc +++ b/goal_src/jak2/levels/city/burning-bush/ctywide-bbush.gc @@ -369,7 +369,7 @@ (cond ((handle->process (-> self part-track)) (if (-> self keep-part-track-alive) - (set! (-> (the-as part-tracker (-> self part-track process 0)) start-time) (current-time)) + (set-time! (-> (the-as part-tracker (-> self part-track process 0)) start-time)) ) ) (else @@ -455,22 +455,22 @@ ) ) -(defmethod race-ring-method-22 race-ring ((obj race-ring)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod race-ring-method-22 race-ring ((this race-ring)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod race-ring-method-23 race-ring ((obj race-ring)) - (add-icon! *minimap* obj (the-as uint 15) (the-as int #f) (the-as vector #t) 0) - (set! (-> obj keep-part-track-alive) #f) - (set! (-> obj part-track) (the-as handle #f)) - (set! (-> obj rot-y) (+ 16384.0 (quaternion-y-angle (-> obj root quat)))) - (set! (-> obj last-target-pos quad) (-> (target-pos 0) quad)) - (set-vector! (-> obj cyl axis) (cos (-> obj rot-y)) 0.0 (- (sin (-> obj rot-y))) 1.0) - (vector+float*! (the-as vector (-> obj cyl)) (-> obj root trans) (-> obj cyl axis) -2048.0) - (set! (-> obj cyl radius) 24576.0) - (set! (-> obj cyl length) 4096.0) +(defmethod race-ring-method-23 race-ring ((this race-ring)) + (add-icon! *minimap* this (the-as uint 15) (the-as int #f) (the-as vector #t) 0) + (set! (-> this keep-part-track-alive) #f) + (set! (-> this part-track) (the-as handle #f)) + (set! (-> this rot-y) (+ 16384.0 (quaternion-y-angle (-> this root quat)))) + (set! (-> this last-target-pos quad) (-> (target-pos 0) quad)) + (set-vector! (-> this cyl axis) (cos (-> this rot-y)) 0.0 (- (sin (-> this rot-y))) 1.0) + (vector+float*! (the-as vector (-> this cyl)) (-> this root trans) (-> this cyl axis) -2048.0) + (set! (-> this cyl radius) 24576.0) + (set! (-> this cyl length) 4096.0) 0 (none) ) @@ -1485,7 +1485,7 @@ ) ) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (+! (-> self sub-state) 1) ) ) @@ -1507,7 +1507,7 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (none) @@ -1648,8 +1648,8 @@ ) -(defmethod bush-collect-method-22 bush-collect ((obj bush-collect)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod bush-collect-method-22 bush-collect ((this bush-collect)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1669,13 +1669,13 @@ (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod bush-collect-method-23 bush-collect ((obj bush-collect)) +(defmethod bush-collect-method-23 bush-collect ((this bush-collect)) 0 (none) ) @@ -1745,14 +1745,14 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! bush-collect ((obj bush-collect) (arg0 entity-actor)) +(defmethod init-from-entity! bush-collect ((this bush-collect) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -1832,9 +1832,9 @@ This commonly includes things such as: ) -(defmethod burning-bush-collection-info-method-9 burning-bush-collection-info ((obj burning-bush-collection-info) (arg0 object)) +(defmethod burning-bush-collection-info-method-9 burning-bush-collection-info ((this burning-bush-collection-info) (arg0 object)) (format arg0 "(static-burning-bush-collection-info~%") - (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%)~%" (-> obj pos x) (-> obj pos y) (-> obj pos z)) + (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%)~%" (-> this pos x) (-> this pos y) (-> this pos z)) 0 (none) ) @@ -2616,7 +2616,7 @@ This commonly includes things such as: ) ) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self time-limit) (-> gp-0 time)) ) (none) @@ -2659,7 +2659,7 @@ This commonly includes things such as: *game-info* (game-task-node city-burning-bush-collection-1-resolution) TASK_MANAGER_CODE_HOOK - (lambda :behavior task-manager () (set! (-> self state-time) (current-time)) (none)) + (lambda :behavior task-manager () (set-time! (-> self state-time)) (none)) ) ;; og:preserve-this added complete hook for collection bbush tasks where we wait for the hud to die first @@ -2881,7 +2881,7 @@ This commonly includes things such as: ) ) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self time-limit) (the-as time-frame (the int (+ 300.0 (-> *burning-bush-get-on-info* (-> self info index) time)))) ) @@ -2918,7 +2918,7 @@ This commonly includes things such as: (send-event *camera* 'teleport-to-transformq gp-0) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 3)) + (until (time-elapsed? gp-1 (seconds 3)) (suspend) ) ) @@ -3030,111 +3030,111 @@ This commonly includes things such as: (-> *game-info* sub-task-list (game-task-node city-burning-bush-get-to-1-resolution)) ) -(defmethod draw hud-homing-beacon ((obj hud-homing-beacon)) +(defmethod draw hud-homing-beacon ((this hud-homing-beacon)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 160 ) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj strings 0 scale) 0.5) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -16 60) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 60) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-homing-beacon ((obj hud-homing-beacon)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-homing-beacon ((this hud-homing-beacon)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-homing-beacon ((obj hud-homing-beacon)) - (set! (-> obj level) (level-get *level* 'lbbush)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-homing-beacon ((this hud-homing-beacon)) + (set! (-> this level) (level-get *level* 'lbbush)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd89))) - (alloc-string-if-needed obj 0) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd89))) + (alloc-string-if-needed this 0) 0 (none) ) -(defmethod draw hud-dark-eco-pickup ((obj hud-dark-eco-pickup)) +(defmethod draw hud-dark-eco-pickup ((this hud-dark-eco-pickup)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 180 ) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 scale) 0.5) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -16 26) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 scale) 0.5) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 26) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-dark-eco-pickup ((obj hud-dark-eco-pickup)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-dark-eco-pickup ((this hud-dark-eco-pickup)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-dark-eco-pickup ((obj hud-dark-eco-pickup)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-dark-eco-pickup ((this hud-dark-eco-pickup)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x46 :page #x67a))) - (alloc-string-if-needed obj 0) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x46 :page #x67a))) + (alloc-string-if-needed this 0) 0 (none) ) -(defmethod draw hud-green-eco-pickup ((obj hud-green-eco-pickup)) +(defmethod draw hud-green-eco-pickup ((this hud-green-eco-pickup)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 180 ) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 scale) 0.5) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -16 26) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 scale) 0.5) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 26) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-green-eco-pickup ((obj hud-green-eco-pickup)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-green-eco-pickup ((this hud-green-eco-pickup)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-green-eco-pickup ((obj hud-green-eco-pickup)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-green-eco-pickup ((this hud-green-eco-pickup)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x47 :page #x67a))) - (alloc-string-if-needed obj 0) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x47 :page #x67a))) + (alloc-string-if-needed this 0) 0 (none) ) diff --git a/goal_src/jak2/levels/city/common/height-map.gc b/goal_src/jak2/levels/city/common/height-map.gc index ea5eaf9f68..bc4ae8602b 100644 --- a/goal_src/jak2/levels/city/common/height-map.gc +++ b/goal_src/jak2/levels/city/common/height-map.gc @@ -7,27 +7,27 @@ ;; DECOMP BEGINS -(defmethod debug-print xz-height-map ((obj xz-height-map)) +(defmethod debug-print xz-height-map ((this xz-height-map)) (format #t "(define *traffic-height-map*~%") (format #t " (static-height-map~%") (format #t " :offset ((meters ~M) (meters ~M) (meters ~M))~%" - (-> obj x-offset) - (-> obj y-offset) - (-> obj z-offset) + (-> this x-offset) + (-> this y-offset) + (-> this z-offset) ) - (format #t " :x-spacing (meters ~M)~%" (/ 1.0 (-> obj x-inv-spacing))) - (format #t " :z-spacing (meters ~M)~%" (/ 1.0 (-> obj z-inv-spacing))) - (format #t " :y-scale (meters ~M)~%" (-> obj y-scale)) - (format #t " :x-dim ~d~%" (-> obj x-dim)) - (format #t " :z-dim ~d~%" (-> obj z-dim)) + (format #t " :x-spacing (meters ~M)~%" (/ 1.0 (-> this x-inv-spacing))) + (format #t " :z-spacing (meters ~M)~%" (/ 1.0 (-> this z-inv-spacing))) + (format #t " :y-scale (meters ~M)~%" (-> this y-scale)) + (format #t " :x-dim ~d~%" (-> this x-dim)) + (format #t " :z-dim ~d~%" (-> this z-dim)) (format #t " :data~%") (format #t " (~%") (let ((s5-0 0)) - (dotimes (s4-0 (-> obj z-dim)) - (dotimes (s3-0 (-> obj x-dim)) - (format #t " ~2d" (-> obj data s5-0)) + (dotimes (s4-0 (-> this z-dim)) + (dotimes (s3-0 (-> this x-dim)) + (format #t " ~2d" (-> this data s5-0)) (+! s5-0 1) ) (format #t "~%") @@ -40,14 +40,14 @@ (none) ) -(defmethod debug-add-offset xz-height-map ((obj xz-height-map) (arg0 vector) (arg1 int)) +(defmethod debug-add-offset xz-height-map ((this xz-height-map) (arg0 vector) (arg1 int)) "Add an offset to the given point, likely for debugging purposes." - (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> obj x-offset)) (-> obj x-inv-spacing))))) - (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> obj z-offset)) (-> obj z-inv-spacing))))) + (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> this x-offset)) (-> this x-inv-spacing))))) + (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> this z-offset)) (-> this z-inv-spacing))))) ) - (when (and (>= v1-1 0) (< v1-1 (-> obj x-dim)) (>= a1-1 0) (< a1-1 (-> obj z-dim))) - (let ((v1-2 (+ v1-1 (* a1-1 (-> obj x-dim))))) - (+! (-> obj data v1-2) arg1) + (when (and (>= v1-1 0) (< v1-1 (-> this x-dim)) (>= a1-1 0) (< a1-1 (-> this z-dim))) + (let ((v1-2 (+ v1-1 (* a1-1 (-> this x-dim))))) + (+! (-> this data v1-2) arg1) ) ) ) @@ -55,21 +55,21 @@ (none) ) -(defmethod debug-draw-at-point xz-height-map ((obj xz-height-map) (arg0 vector)) - (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> obj x-offset)) (-> obj x-inv-spacing))))) - (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> obj z-offset)) (-> obj z-inv-spacing))))) - (a2-1 (-> obj x-dim)) - (a3-0 (-> obj z-dim)) +(defmethod debug-draw-at-point xz-height-map ((this xz-height-map) (arg0 vector)) + (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> this x-offset)) (-> this x-inv-spacing))))) + (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> this z-offset)) (-> this z-inv-spacing))))) + (a2-1 (-> this x-dim)) + (a3-0 (-> this z-dim)) ) (when (and (>= v1-1 0) (< v1-1 a2-1) (>= a1-1 0) (< a1-1 a3-0)) (let* ((a2-3 (+ v1-1 (* a1-1 a2-1))) - (gp-0 (-> obj data a2-3)) + (gp-0 (-> this data a2-3)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 x) (+ (-> obj x-offset) (/ (the float v1-1) (-> obj x-inv-spacing)))) + (set! (-> s5-0 x) (+ (-> this x-offset) (/ (the float v1-1) (-> this x-inv-spacing)))) (set! (-> s5-0 y) 0.0) - (set! (-> s5-0 z) (+ (-> obj z-offset) (/ (the float a1-1) (-> obj z-inv-spacing)))) - (set! (-> s5-0 y) (get-height-at-point obj s5-0)) + (set! (-> s5-0 z) (+ (-> this z-offset) (/ (the float a1-1) (-> this z-inv-spacing)))) + (set! (-> s5-0 y) (get-height-at-point this s5-0)) (let ((s4-0 add-debug-text-3d) (s3-0 #t) (s2-0 318) @@ -91,19 +91,19 @@ (none) ) -(defmethod get-height-at-point xz-height-map ((obj xz-height-map) (arg0 vector)) - (let* ((f0-1 (fmax 0.0 (* (-> obj x-inv-spacing) (- (-> arg0 x) (-> obj x-offset))))) - (f2-4 (fmax 0.0 (* (-> obj z-inv-spacing) (- (-> arg0 z) (-> obj z-offset))))) +(defmethod get-height-at-point xz-height-map ((this xz-height-map) (arg0 vector)) + (let* ((f0-1 (fmax 0.0 (* (-> this x-inv-spacing) (- (-> arg0 x) (-> this x-offset))))) + (f2-4 (fmax 0.0 (* (-> this z-inv-spacing) (- (-> arg0 z) (-> this z-offset))))) (a2-0 (the int f0-1)) (a1-1 (the int f2-4)) (f1-7 (- f0-1 (the float a2-0))) (f0-4 (- f2-4 (the float a1-1))) - (v1-0 (-> obj x-dim)) - (a3-0 (-> obj z-dim)) + (v1-0 (-> this x-dim)) + (a3-0 (-> this z-dim)) (a1-7 (the-as (pointer int8) - (+ (+ (min a2-0 (+ v1-0 -2)) (* (min a1-1 (+ a3-0 -2)) v1-0) 0) (the-as int (the-as pointer (-> obj data)))) + (+ (+ (min a2-0 (+ v1-0 -2)) (* (min a1-1 (+ a3-0 -2)) v1-0) 0) (the-as int (the-as pointer (-> this data)))) ) ) (f3-3 (the float (-> a1-7 0))) @@ -113,7 +113,7 @@ (f3-5 (+ (* f3-3 (- 1.0 f1-7)) (* f4-1 f1-7))) (f1-9 (+ (* f2-8 (- 1.0 f1-7)) (* f5-1 f1-7))) ) - (+ (* (+ (* f3-5 (- 1.0 f0-4)) (* f1-9 f0-4)) (-> obj y-scale)) (-> obj y-offset)) + (+ (* (+ (* f3-5 (- 1.0 f0-4)) (* f1-9 f0-4)) (-> this y-scale)) (-> this y-offset)) ) ) @@ -127,31 +127,31 @@ ) ) -(defmethod debug-draw-mesh xz-height-map ((obj xz-height-map) (arg0 vector)) +(defmethod debug-draw-mesh xz-height-map ((this xz-height-map) (arg0 vector)) (local-vars (sv-80 int) (sv-96 int)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'matrix))) (mem-copy! (the-as pointer (-> s5-0 vector 2)) (the-as pointer arg0) 32) (.svf (&-> (-> s5-0 vector) 0 quad) vf0) - (let ((f30-0 (/ 1.0 (-> obj z-inv-spacing))) - (f28-0 (/ 1.0 (-> obj x-inv-spacing))) - (s4-0 (-> obj x-dim)) - (s3-0 (-> obj z-dim)) + (let ((f30-0 (/ 1.0 (-> this z-inv-spacing))) + (f28-0 (/ 1.0 (-> this x-inv-spacing))) + (s4-0 (-> this x-dim)) + (s3-0 (-> this z-dim)) ) - (let ((s2-0 (&-> (-> obj data) 0))) - (set! (-> s5-0 vector 0 z) (-> obj z-offset)) + (let ((s2-0 (&-> (-> this data) 0))) + (set! (-> s5-0 vector 0 z) (-> this z-offset)) (countdown (s1-0 s3-0) (let ((s0-0 s2-0)) - (set! (-> s5-0 vector 0 x) (-> obj x-offset)) - (set! (-> s5-0 vector 0 y) (+ (-> obj y-offset) (* (the float (-> s0-0 0)) (-> obj y-scale)))) + (set! (-> s5-0 vector 0 x) (-> this x-offset)) + (set! (-> s5-0 vector 0 y) (+ (-> this y-offset) (* (the float (-> s0-0 0)) (-> this y-scale)))) (set! sv-80 (+ s4-0 -1)) (while (nonzero? sv-80) (set! sv-80 (+ sv-80 -1)) (set! (-> s5-0 vector 1 quad) (-> s5-0 vector 0 quad)) (+! (-> s5-0 vector 0 x) f28-0) (set! s0-0 (&-> s0-0 1)) - (set! (-> s5-0 vector 0 y) (+ (-> obj y-offset) (* (the float (-> s0-0 0)) (-> obj y-scale)))) + (set! (-> s5-0 vector 0 y) (+ (-> this y-offset) (* (the float (-> s0-0 0)) (-> this y-scale)))) (if (and (point-in-bbox? (the-as bounding-box (-> s5-0 vector 2)) (the-as vector (-> s5-0 vector))) (point-in-bbox? (the-as bounding-box (-> s5-0 vector 2)) (-> s5-0 vector 1)) ) @@ -171,13 +171,13 @@ (&+! s2-0 s4-0) ) ) - (let ((s2-1 (&-> (-> obj data) 0))) - (set! (-> s5-0 vector 0 x) (-> obj x-offset)) + (let ((s2-1 (&-> (-> this data) 0))) + (set! (-> s5-0 vector 0 x) (-> this x-offset)) (countdown (s1-1 s4-0) (let ((s0-1 (the-as pointer s2-1))) - (set! (-> s5-0 vector 0 z) (-> obj z-offset)) + (set! (-> s5-0 vector 0 z) (-> this z-offset)) (set! (-> s5-0 vector 0 y) - (+ (-> obj y-offset) (* (the float (-> (the-as (pointer int8) s0-1) 0)) (-> obj y-scale))) + (+ (-> this y-offset) (* (the float (-> (the-as (pointer int8) s0-1) 0)) (-> this y-scale))) ) (set! sv-96 (+ s3-0 -1)) (while (nonzero? sv-96) @@ -186,7 +186,7 @@ (+! (-> s5-0 vector 0 z) f30-0) (&+! s0-1 s4-0) (set! (-> s5-0 vector 0 y) - (+ (-> obj y-offset) (* (the float (-> (the-as (pointer int8) s0-1))) (-> obj y-scale))) + (+ (-> this y-offset) (* (the float (-> (the-as (pointer int8) s0-1))) (-> this y-scale))) ) (if (and (point-in-bbox? (the-as bounding-box (-> s5-0 vector 2)) (the-as vector (-> s5-0 vector))) (point-in-bbox? (the-as bounding-box (-> s5-0 vector 2)) (-> s5-0 vector 1)) @@ -214,7 +214,7 @@ ) ) -(defmethod debug-draw xz-height-map ((obj xz-height-map) (arg0 vector)) +(defmethod debug-draw xz-height-map ((this xz-height-map) (arg0 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) @@ -244,9 +244,9 @@ (.add.x.vf vf5 vf4 vf6 :mask #b111) (.svf (&-> a1-2 quad) vf5) ) - (debug-draw-mesh obj (the-as vector (-> v1-0 vector))) + (debug-draw-mesh this (the-as vector (-> v1-0 vector))) ) - (debug-draw-at-point obj arg0) + (debug-draw-at-point this arg0) 0 (none) ) diff --git a/goal_src/jak2/levels/city/common/nav-graph-h.gc b/goal_src/jak2/levels/city/common/nav-graph-h.gc index dcb9017481..7b90189f4b 100644 --- a/goal_src/jak2/levels/city/common/nav-graph-h.gc +++ b/goal_src/jak2/levels/city/common/nav-graph-h.gc @@ -128,49 +128,49 @@ ) -(defmethod get-density nav-branch ((obj nav-branch)) +(defmethod get-density nav-branch ((this nav-branch)) "TODO @returns `density * 0.0078125` - is this some kind of trick?" - (* 0.0078125 (the float (-> obj density))) + (* 0.0078125 (the float (-> this density))) ) -(defmethod get-speed-limit nav-branch ((obj nav-branch)) +(defmethod get-speed-limit nav-branch ((this nav-branch)) "TODO @returns `speed-limit * 1024.0`" - (* 1024.0 (the float (-> obj speed-limit))) + (* 1024.0 (the float (-> this speed-limit))) ) -(defmethod get-width nav-branch ((obj nav-branch)) +(defmethod get-width nav-branch ((this nav-branch)) "TODO @returns `width * 256.0`" - (* 256.0 (the float (-> obj width))) + (* 256.0 (the float (-> this width))) ) -(defmethod user-limit-reached? nav-branch ((obj nav-branch)) - (>= (-> obj user-count) (-> obj max-user-count)) +(defmethod user-limit-reached? nav-branch ((this nav-branch)) + (>= (-> this user-count) (-> this max-user-count)) ) -(defmethod dest-node-id-at-max? nav-branch ((obj nav-branch)) +(defmethod dest-node-id-at-max? nav-branch ((this nav-branch)) "@returns if `dest-node`'s `id` is equal to `#FFFF` @see [[nav-node]]" - (!= (-> obj dest-node id) #xffff) + (!= (-> this dest-node id) #xffff) ) -(defmethod get-radius nav-node ((obj nav-node)) +(defmethod get-radius nav-node ((this nav-node)) "TODO @returns `radius * 1024.0" - (* 1024.0 (the float (-> obj radius))) + (* 1024.0 (the float (-> this radius))) ) -(defmethod get-angle nav-node ((obj nav-node)) - (the float (-> obj angle)) +(defmethod get-angle nav-node ((this nav-node)) + (the float (-> this angle)) ) -(defmethod calc-sine-and-cosine! nav-node ((obj nav-node) (ret vector)) +(defmethod calc-sine-and-cosine! nav-node ((this nav-node) (ret vector)) "Computes the sine and cosine of the `angle`. @param! ret The result @returns Nothing, the result will be in `ret`" - (let ((angle (the float (-> obj angle))) + (let ((angle (the float (-> this angle))) (sin-cos-result (new 'stack-no-clear 'vector)) ) (sincos! sin-cos-result angle) @@ -182,10 +182,10 @@ ret ) -(defmethod get-position nav-node ((obj nav-node) (ret vector)) +(defmethod get-position nav-node ((this nav-node) (ret vector)) "@param! ret The [[vector]] that is modified to hold the result @returns the `position` [[vector]] with a `w` component of `1.0`" - (set! (-> ret quad) (-> obj position quad)) + (set! (-> ret quad) (-> this position quad)) (set! (-> ret w) 1.0) ret ) @@ -263,13 +263,13 @@ ) -(defmethod node-at-idx nav-graph ((obj nav-graph) (idx int)) +(defmethod node-at-idx nav-graph ((this nav-graph) (idx int)) "Get the `nav-node` at a given position. @param idx The position in the `node-array` to return @returns the [[nav-node]] if it can be found, otherwise return [[#f]]" (let ((v0-0 (the-as nav-node #f))) - (if (and (>= idx 0) (< idx (-> obj node-count))) - (set! v0-0 (-> obj node-array idx)) + (if (and (>= idx 0) (< idx (-> this node-count))) + (set! v0-0 (-> this node-array idx)) ) v0-0 ) diff --git a/goal_src/jak2/levels/city/common/nav-graph.gc b/goal_src/jak2/levels/city/common/nav-graph.gc index e75a3a9eae..de49046706 100644 --- a/goal_src/jak2/levels/city/common/nav-graph.gc +++ b/goal_src/jak2/levels/city/common/nav-graph.gc @@ -7,45 +7,45 @@ ;; DECOMP BEGINS -(defmethod set-density nav-branch ((obj nav-branch) (arg0 float)) - (set! (-> obj density) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 128.0 arg0))))))) +(defmethod set-density nav-branch ((this nav-branch) (arg0 float)) + (set! (-> this density) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 128.0 arg0))))))) 0 (none) ) -(defmethod set-speed-limit nav-branch ((obj nav-branch) (arg0 float)) - (set! (-> obj speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) +(defmethod set-speed-limit nav-branch ((this nav-branch) (arg0 float)) + (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) 0 (none) ) -(defmethod set-width nav-branch ((obj nav-branch) (arg0 float)) - (set! (-> obj width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) +(defmethod set-width nav-branch ((this nav-branch) (arg0 float)) + (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) 0 (none) ) -(defmethod set-src-node nav-branch ((obj nav-branch) (arg0 nav-node)) - (set! (-> obj src-node) arg0) +(defmethod set-src-node nav-branch ((this nav-branch) (arg0 nav-node)) + (set! (-> this src-node) arg0) 0 (none) ) -(defmethod set-dst-node nav-branch ((obj nav-branch) (arg0 nav-node)) - (set! (-> obj dest-node) arg0) +(defmethod set-dst-node nav-branch ((this nav-branch) (arg0 nav-node)) + (set! (-> this dest-node) arg0) 0 (none) ) -(defmethod set-default-density-speed-and-width nav-branch ((obj nav-branch)) - (set-density obj 0.25) - (set-speed-limit obj 61440.0) - (set-width obj 16384.0) +(defmethod set-default-density-speed-and-width nav-branch ((this nav-branch)) + (set-density this 0.25) + (set-speed-limit this 61440.0) + (set-width this 16384.0) 0 (none) ) -(defmethod debug-draw nav-node ((obj nav-node)) +(defmethod debug-draw nav-node ((this nav-node)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) @@ -55,17 +55,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'sphere)) ) - (let ((a1-0 obj) + (let ((a1-0 this) (v1-0 gp-0) ) (set! (-> v1-0 quad) (-> a1-0 position quad)) (set! (-> v1-0 w) 1.0) ) (set! (-> s4-0 quad) (-> gp-0 quad)) - (let ((v1-2 obj)) + (let ((v1-2 this)) (set! (-> s4-0 r) (* 1024.0 (the float (-> v1-2 radius)))) ) - (when (logtest? (-> obj flags) (nav-node-flag-byte selected)) + (when (logtest? (-> this flags) (nav-node-flag-byte selected)) (let ((v1-8 (new 'stack-no-clear 'nav-graph-link))) (let ((a1-3 (&-> v1-8 id))) (let ((a0-6 gp-0)) @@ -98,7 +98,7 @@ ) ) ) - (when (and (not (logtest? (-> obj flags) (nav-node-flag-byte hidden))) + (when (and (not (logtest? (-> this flags) (nav-node-flag-byte hidden))) (let ((f0-6 (vector-vector-distance-squared gp-0 (camera-pos))) (f1-2 327680.0) ) @@ -110,13 +110,13 @@ (s3-1 #t) (s2-1 324) ) - (format (clear *temp-string*) "~D ~D" (-> obj id) (-> obj nav-mesh-id)) + (format (clear *temp-string*) "~D ~D" (-> this id) (-> this nav-mesh-id)) (s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* gp-0 - (if (logtest? (-> obj flags) (nav-node-flag-byte blocked)) + (if (logtest? (-> this flags) (nav-node-flag-byte blocked)) (font-color red) (font-color cyan) ) @@ -128,7 +128,7 @@ (s2-2 324) (s1-1 (new 'stack-no-clear 'vector)) ) - (let ((f0-8 (the float (-> obj angle))) + (let ((f0-8 (the float (-> this angle))) (s5-1 (new 'stack-no-clear 'vector)) ) (sincos! s5-1 f0-8) @@ -146,13 +146,13 @@ ) ) -(defmethod debug-print nav-branch ((obj nav-branch) (arg0 object) (arg1 int)) - (format arg0 "~S~T~T~T (new-nav-branch :dest-node-id ~d~%" arg1 (-> obj dest-node id)) +(defmethod debug-print nav-branch ((this nav-branch) (arg0 object) (arg1 int)) + (format arg0 "~S~T~T~T (new-nav-branch :dest-node-id ~d~%" arg1 (-> this dest-node id)) (let ((t9-1 format) (a0-2 arg0) (a1-2 "~S~T~T~T~T~T :density ~4,,3f~%") (a2-2 arg1) - (v1-1 obj) + (v1-1 this) ) (t9-1 a0-2 a1-2 a2-2 (* 0.0078125 (the float (-> v1-1 density)))) ) @@ -160,7 +160,7 @@ (a0-3 arg0) (a1-3 "~S~T~T~T~T~T :width ~4,,3M~%") (a2-3 arg1) - (v1-3 obj) + (v1-3 this) ) (t9-2 a0-3 a1-3 a2-3 (* 256.0 (the float (-> v1-3 width)))) ) @@ -168,16 +168,16 @@ (a0-4 arg0) (a1-4 "~S~T~T~T~T~T :speed-limit ~4,,3M~%") (a2-4 arg1) - (v1-5 obj) + (v1-5 this) ) (t9-3 a0-4 a1-4 a2-4 (* 1024.0 (the float (-> v1-5 speed-limit)))) ) - (when (nonzero? (-> obj clock-type)) + (when (nonzero? (-> this clock-type)) (let ((t9-4 format) (a0-5 arg0) (a1-5 "~S~T~T~T~T~T :clock-type ~S~%") (a2-5 arg1) - (v1-9 (-> obj clock-type)) + (v1-9 (-> this clock-type)) ) (t9-4 a0-5 a1-5 a2-5 (cond ((= v1-9 (nav-branch-clock-type clock3)) @@ -199,7 +199,7 @@ ) ) (format arg0 "~S~T~T~T~T~T :clock-mask (" arg1) - (let ((s4-1 (-> obj clock-mask))) + (let ((s4-1 (-> this clock-mask))) (if (= (logand s4-1 (nav-branch-clock-mask phase-1a)) (nav-branch-clock-mask phase-1a)) (format arg0 "phase-1a ") ) @@ -232,14 +232,14 @@ (none) ) -(defmethod debug-print nav-node ((obj nav-node) (arg0 symbol) (arg1 string)) - (format arg0 "~S (new-nav-node :id ~d~%" arg1 (-> obj id)) +(defmethod debug-print nav-node ((this nav-node) (arg0 symbol) (arg1 string)) + (format arg0 "~S (new-nav-node :id ~d~%" arg1 (-> this id)) (format arg0 "~S~T :branch-list (~%" arg1) - (dotimes (s3-0 (-> obj branch-count)) - (debug-print (-> obj branch-array s3-0) arg0 (the-as int arg1)) + (dotimes (s3-0 (-> this branch-count)) + (debug-print (-> this branch-array s3-0) arg0 (the-as int arg1)) ) (format arg0 "~S~T~T~T )~%" arg1) - (let* ((v1-6 (-> obj flags)) + (let* ((v1-6 (-> this flags)) (s3-1 (logclear v1-6 (nav-node-flag-byte visited blocked))) ) (when (nonzero? s3-1) @@ -263,7 +263,7 @@ ) ) (let ((v1-24 (new 'stack-no-clear 'vector))) - (let ((a2-6 obj) + (let ((a2-6 this) (a0-19 v1-24) ) (set! (-> a0-19 quad) (-> a2-6 position quad)) @@ -271,98 +271,98 @@ ) (format arg0 "~S~T :position (~4,,2M ~4,,2M ~4,,2M)~%" arg1 (-> v1-24 x) (-> v1-24 y) (-> v1-24 z)) ) - (format arg0 "~S~T :angle ~4,,3f~%" arg1 (* 0.005493164 (the float (-> obj angle)))) + (format arg0 "~S~T :angle ~4,,3f~%" arg1 (* 0.005493164 (the float (-> this angle)))) (let ((t9-13 format) (a0-22 arg0) (a1-16 "~S~T :radius ~4,,2M~%") (a2-11 arg1) - (v1-30 obj) + (v1-30 this) ) (t9-13 a0-22 a1-16 a2-11 (* 1024.0 (the float (-> v1-30 radius)))) ) - (if (nonzero? (-> obj nav-mesh-id)) - (format arg0 "~S~T :nav-mesh-id ~d~%" arg1 (-> obj nav-mesh-id)) + (if (nonzero? (-> this nav-mesh-id)) + (format arg0 "~S~T :nav-mesh-id ~d~%" arg1 (-> this nav-mesh-id)) ) - (if (-> obj level) - (format arg0 "~S~T :level ~s~%" arg1 (-> obj level)) + (if (-> this level) + (format arg0 "~S~T :level ~s~%" arg1 (-> this level)) ) (format arg0 "~S~T )~%" arg1) 0 (none) ) -(defmethod set-pos-xyz nav-node ((obj nav-node) (arg0 vector)) - (let ((f0-0 (-> obj position w))) - (set! (-> obj position quad) (-> arg0 quad)) - (set! (-> obj position w) f0-0) +(defmethod set-pos-xyz nav-node ((this nav-node) (arg0 vector)) + (let ((f0-0 (-> this position w))) + (set! (-> this position quad) (-> arg0 quad)) + (set! (-> this position w) f0-0) ) 0 (none) ) -(defmethod set-angle-from-heading nav-node ((obj nav-node) (arg0 vector)) - (set! (-> obj angle) (the-as uint (the int (atan (- (-> arg0 z)) (-> arg0 x))))) +(defmethod set-angle-from-heading nav-node ((this nav-node) (arg0 vector)) + (set! (-> this angle) (the-as uint (the int (atan (- (-> arg0 z)) (-> arg0 x))))) 0 (none) ) -(defmethod set-radius nav-node ((obj nav-node) (arg0 float)) - (set! (-> obj radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) +(defmethod set-radius nav-node ((this nav-node) (arg0 float)) + (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) 0 (none) ) -(defmethod set-angle nav-node ((obj nav-node) (arg0 float)) - (set! (-> obj angle) (the-as uint (the int (+ 0.5 arg0)))) +(defmethod set-angle nav-node ((this nav-node) (arg0 float)) + (set! (-> this angle) (the-as uint (the int (+ 0.5 arg0)))) 0 (none) ) -(defmethod set-id-and-link-branches-back nav-node ((obj nav-node) (arg0 uint)) - (set! (-> obj id) arg0) - (dotimes (v1-0 (-> obj branch-count)) - (set! (-> obj branch-array v1-0 src-node) obj) +(defmethod set-id-and-link-branches-back nav-node ((this nav-node) (arg0 uint)) + (set! (-> this id) arg0) + (dotimes (v1-0 (-> this branch-count)) + (set! (-> this branch-array v1-0 src-node) this) ) 0 (none) ) -(defmethod init-from-pt-and-heading nav-node ((obj nav-node) (arg0 vector) (arg1 vector)) - (set-pos-xyz obj arg0) - (set-angle-from-heading obj arg1) - (set! (-> obj flags) (nav-node-flag-byte pedestrian selected)) - (set-radius obj 32768.0) - (set! (-> obj level) 'ctyport) - (set! (-> obj nav-mesh-id) (the-as uint 0)) - (dotimes (s5-1 (-> obj branch-count)) - (set-default-density-speed-and-width (-> obj branch-array s5-1)) +(defmethod init-from-pt-and-heading nav-node ((this nav-node) (arg0 vector) (arg1 vector)) + (set-pos-xyz this arg0) + (set-angle-from-heading this arg1) + (set! (-> this flags) (nav-node-flag-byte pedestrian selected)) + (set-radius this 32768.0) + (set! (-> this level) 'ctyport) + (set! (-> this nav-mesh-id) (the-as uint 0)) + (dotimes (s5-1 (-> this branch-count)) + (set-default-density-speed-and-width (-> this branch-array s5-1)) ) 0 (none) ) -(defmethod remove-branch-by-idx nav-node ((obj nav-node) (arg0 int)) - (when (and (>= arg0 0) (< arg0 (-> obj branch-count))) +(defmethod remove-branch-by-idx nav-node ((this nav-node) (arg0 int)) + (when (and (>= arg0 0) (< arg0 (-> this branch-count))) (let ((s5-0 (+ arg0 1)) (s4-0 arg0) ) - (while (< s5-0 (-> obj branch-count)) - (mem-copy! (the-as pointer (-> obj branch-array s4-0)) (the-as pointer (-> obj branch-array s5-0)) 16) + (while (< s5-0 (-> this branch-count)) + (mem-copy! (the-as pointer (-> this branch-array s4-0)) (the-as pointer (-> this branch-array s5-0)) 16) (+! s5-0 1) (+! s4-0 1) ) ) - (+! (-> obj branch-count) -1) + (+! (-> this branch-count) -1) ) 0 (none) ) -(defmethod debug-reset-branch-array nav-graph ((obj nav-graph) (arg0 nav-node) (arg1 int)) +(defmethod debug-reset-branch-array nav-graph ((this nav-graph) (arg0 nav-node) (arg1 int)) "kinda dangerous" - (set! (-> arg0 branch-array) (the-as (inline-array nav-branch) (-> obj branch-array (-> obj branch-count)))) + (set! (-> arg0 branch-array) (the-as (inline-array nav-branch) (-> this branch-array (-> this branch-count)))) (set! (-> arg0 branch-count) arg1) - (+! (-> obj branch-count) arg1) + (+! (-> this branch-count) arg1) (dotimes (s4-0 arg1) (let ((s3-0 (-> arg0 branch-array s4-0))) (set-default-density-speed-and-width s3-0) @@ -374,28 +374,28 @@ (none) ) -(defmethod debug-add-node nav-graph ((obj nav-graph) (arg0 int)) +(defmethod debug-add-node nav-graph ((this nav-graph) (arg0 int)) (let ((s4-0 (the-as nav-node #f))) - (let ((s5-0 (-> obj node-count)) - (v1-1 (+ arg0 -1 (-> obj branch-count))) + (let ((s5-0 (-> this node-count)) + (v1-1 (+ arg0 -1 (-> this branch-count))) ) (when (and (< s5-0 2000) (< v1-1 2500)) - (set! s4-0 (-> obj node-array s5-0)) - (debug-reset-branch-array obj s4-0 arg0) + (set! s4-0 (-> this node-array s5-0)) + (debug-reset-branch-array this s4-0 arg0) (set-id-and-link-branches-back s4-0 (the-as uint s5-0)) - (+! (-> obj node-count) 1) + (+! (-> this node-count) 1) ) ) s4-0 ) ) -(defmethod debug-link-node-to-graph nav-graph ((obj nav-graph) (arg0 nav-node)) +(defmethod debug-link-node-to-graph nav-graph ((this nav-graph) (arg0 nav-node)) (when (> (-> arg0 branch-count) 0) (let ((a0-1 (-> arg0 branch-array 0)) (t9-0 (method-of-type nav-branch set-dst-node)) - (a2-0 obj) - (v1-4 (-> obj first-node)) + (a2-0 this) + (v1-4 (-> this first-node)) (a1-1 (the-as nav-node #f)) ) (if (and (>= v1-4 0) (< v1-4 (-> a2-0 node-count))) @@ -404,8 +404,8 @@ (t9-0 a0-1 a1-1) ) (let ((v1-9 (+ (-> arg0 id) -1))) - (when (>= v1-9 (the-as uint (-> obj first-node))) - (let ((v1-11 (-> obj node-array v1-9))) + (when (>= v1-9 (the-as uint (-> this first-node))) + (let ((v1-11 (-> this node-array v1-9))) (set! (-> v1-11 branch-count) 1) (set-dst-node (-> v1-11 branch-array 0) arg0) ) @@ -416,20 +416,20 @@ (none) ) -(defmethod nav-graph-method-13 nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (when (and (< arg0 (-> obj node-count)) (> arg1 0)) - (let ((s4-1 (min arg1 (- (-> obj node-count) arg0)))) - (dotimes (s3-0 (-> obj node-count)) - (let ((s2-0 (-> obj node-array s3-0))) +(defmethod nav-graph-method-13 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (when (and (< arg0 (-> this node-count)) (> arg1 0)) + (let ((s4-1 (min arg1 (- (-> this node-count) arg0)))) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) (dotimes (s1-0 (-> s2-0 branch-count)) - (let ((v1-9 (nav-graph-method-40 obj (the-as int (-> s2-0 branch-array s1-0 dest-node))))) + (let ((v1-9 (nav-graph-method-40 this (the-as int (-> s2-0 branch-array s1-0 dest-node))))) (when (and (>= v1-9 arg0) (< v1-9 (+ arg0 s4-1))) - (let ((v1-11 (-> obj node-array v1-9))) + (let ((v1-11 (-> this node-array v1-9))) (cond ((= (-> v1-11 branch-count) 1) (let ((v1-14 (-> v1-11 branch-array 0 dest-node id))) (if (or (< v1-14 (the-as uint arg0)) (>= v1-14 (the-as uint (+ arg0 s4-1)))) - (set-dst-node (-> s2-0 branch-array s1-0) (-> obj node-array v1-14)) + (set-dst-node (-> s2-0 branch-array s1-0) (-> this node-array v1-14)) (remove-branch-by-idx s2-0 s1-0) ) ) @@ -444,22 +444,22 @@ ) ) ) - (dotimes (s3-1 (-> obj node-count)) - (let ((s2-1 (-> obj node-array s3-1))) + (dotimes (s3-1 (-> this node-count)) + (let ((s2-1 (-> this node-array s3-1))) (dotimes (s1-1 (-> s2-1 branch-count)) - (let ((v1-28 (nav-graph-method-40 obj (the-as int (-> s2-1 branch-array s1-1 dest-node))))) + (let ((v1-28 (nav-graph-method-40 this (the-as int (-> s2-1 branch-array s1-1 dest-node))))) (if (>= v1-28 (+ arg0 s4-1)) - (set-dst-node (-> s2-1 branch-array s1-1) (-> obj node-array (- v1-28 s4-1))) + (set-dst-node (-> s2-1 branch-array s1-1) (-> this node-array (- v1-28 s4-1))) ) ) ) ) ) (let ((s3-2 arg0) - (s2-2 (-> obj node-array (+ arg0 s4-1))) - (s1-2 (-> obj node-array arg0)) + (s2-2 (-> this node-array (+ arg0 s4-1))) + (s1-2 (-> this node-array arg0)) ) - (countdown (s0-0 (- (-> obj node-count) (+ arg0 s4-1))) + (countdown (s0-0 (- (-> this node-count) (+ arg0 s4-1))) (mem-copy! (the-as pointer s1-2) (the-as pointer s2-2) 32) (set-id-and-link-branches-back s1-2 (the-as uint s3-2)) (&+! s2-2 32) @@ -467,9 +467,9 @@ (+! s3-2 1) ) ) - (set! (-> obj node-count) (- (-> obj node-count) s4-1)) - (if (< arg0 (-> obj first-node)) - (set! (-> obj first-node) (- (-> obj first-node) s4-1)) + (set! (-> this node-count) (- (-> this node-count) s4-1)) + (if (< arg0 (-> this first-node)) + (set! (-> this first-node) (- (-> this first-node) s4-1)) ) ) ) @@ -477,42 +477,43 @@ (none) ) -(defmethod nav-graph-method-14 nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (when (and (< arg0 (-> obj node-count)) (> arg1 0)) - (dotimes (s3-0 (-> obj node-count)) - (let ((s2-0 (-> obj node-array s3-0))) +(defmethod nav-graph-method-14 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (when (and (< arg0 (-> this node-count)) (> arg1 0)) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) (dotimes (s1-0 (-> s2-0 branch-count)) - (let ((v1-7 (nav-graph-method-40 obj (the-as int (-> s2-0 branch-array s1-0 dest-node))))) + (let ((v1-7 (nav-graph-method-40 this (the-as int (-> s2-0 branch-array s1-0 dest-node))))) (if (< arg0 v1-7) - (set-dst-node (-> s2-0 branch-array s1-0) (-> obj node-array (+ v1-7 arg1))) + (set-dst-node (-> s2-0 branch-array s1-0) (-> this node-array (+ v1-7 arg1))) ) ) ) ) ) - (let* ((s3-1 (+ arg1 -1 (-> obj node-count))) - (s2-1 (-> obj node-array (- s3-1 arg1))) - (s1-1 (-> obj node-array s3-1)) + (let* ((s3-1 (+ arg1 -1 (-> this node-count))) + (s2-1 (-> this node-array (- s3-1 arg1))) + (s1-1 (-> this node-array s3-1)) ) - (countdown (s0-0 (- (-> obj node-count) arg0)) + (countdown (s0-0 (- (-> this node-count) arg0)) (mem-copy! (the-as pointer s1-1) (the-as pointer s2-1) 32) (set-id-and-link-branches-back s1-1 (the-as uint s3-1)) + ;; og:preserve-this (set! s2-1 (&+ s2-1 -32)) (set! s1-1 (&+ s1-1 -32)) (+! s3-1 -1) ) ) - (+! (-> obj node-count) arg1) - (+! (-> obj first-node) arg1) - (let ((s3-2 (-> obj node-array arg0)) - (s2-2 (-> obj node-array arg0)) + (+! (-> this node-count) arg1) + (+! (-> this first-node) arg1) + (let ((s3-2 (-> this node-array arg0)) + (s2-2 (-> this node-array arg0)) ) (dotimes (s1-2 arg1) (mem-copy! (the-as pointer s2-2) (the-as pointer s3-2) 32) (set-id-and-link-branches-back s2-2 (the-as uint arg0)) (+! (-> s2-2 position y) (* 8192.0 (the float (+ s1-2 1)))) - (debug-reset-branch-array obj s2-2 1) - (set-dst-node (-> s2-2 branch-array 0) (-> obj node-array (+ arg0 1))) + (debug-reset-branch-array this s2-2 1) + (set-dst-node (-> s2-2 branch-array 0) (-> this node-array (+ arg0 1))) (&+! s2-2 32) (+! arg0 1) ) @@ -522,30 +523,30 @@ (none) ) -(defmethod debug-reset nav-graph ((obj nav-graph)) - (set! (-> obj node-count) 0) - (set! (-> obj branch-count) 0) - (set! (-> obj first-node) 0) - (set! (-> obj patched) #f) +(defmethod debug-reset nav-graph ((this nav-graph)) + (set! (-> this node-count) 0) + (set! (-> this branch-count) 0) + (set! (-> this first-node) 0) + (set! (-> this patched) #f) 0 (none) ) -(defmethod nav-graph-method-12 nav-graph ((obj nav-graph)) - (set! (-> obj first-node) (-> obj node-count)) +(defmethod nav-graph-method-12 nav-graph ((this nav-graph)) + (set! (-> this first-node) (-> this node-count)) 0 (none) ) -(defmethod print-selected-nodes nav-graph ((obj nav-graph)) +(defmethod print-selected-nodes nav-graph ((this nav-graph)) (let ((s4-0 0) (s1-0 0) (v1-0 #f) (s3-0 0) (gp-0 0) ) - (dotimes (s2-0 (-> obj node-count)) - (let* ((a0-2 (-> obj node-array s2-0)) + (dotimes (s2-0 (-> this node-count)) + (let* ((a0-2 (-> this node-array s2-0)) (s0-1 (logtest? (-> a0-2 flags) (nav-node-flag-byte selected))) ) (when s0-1 @@ -556,7 +557,7 @@ (set! s1-0 s2-0) ) (set! v1-0 (and (not s0-1) v1-0)) - (when (or v1-0 (and s0-1 (= s2-0 (+ (-> obj node-count) -1)))) + (when (or v1-0 (and s0-1 (= s2-0 (+ (-> this node-count) -1)))) (if (> s3-0 0) (format #t ", ") ) @@ -576,66 +577,66 @@ (none) ) -(defmethod select-nodes-in-range nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (when (< arg0 (-> obj node-count)) - (let ((v1-3 (min arg1 (+ (-> obj node-count) -1))) +(defmethod select-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) ) (+ (- 1 arg0) v1-3) (while (>= v1-3 a2-3) - (let ((a1-4 (-> obj node-array a2-3))) + (let ((a1-4 (-> this node-array a2-3))) (logior! (-> a1-4 flags) (nav-node-flag-byte selected)) ) (+! a2-3 1) ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) -(defmethod deselect-nodes-in-range nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (when (< arg0 (-> obj node-count)) - (let ((v1-3 (min arg1 (+ (-> obj node-count) -1))) +(defmethod deselect-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) ) (+ (- 1 arg0) v1-3) (while (>= v1-3 a2-3) - (let ((a1-4 (-> obj node-array a2-3))) + (let ((a1-4 (-> this node-array a2-3))) (logclear! (-> a1-4 flags) (nav-node-flag-byte selected)) ) (+! a2-3 1) ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) -(defmethod toggle-select-nodes-in-range nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (when (< arg0 (-> obj node-count)) - (let ((v1-3 (min arg1 (+ (-> obj node-count) -1))) +(defmethod toggle-select-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) ) (+ (- 1 arg0) v1-3) (while (>= v1-3 a2-3) - (let ((a1-4 (-> obj node-array a2-3))) + (let ((a1-4 (-> this node-array a2-3))) (logxor! (-> a1-4 flags) (nav-node-flag-byte selected)) ) (+! a2-3 1) ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) -(defmethod select-nodes-in-level nav-graph ((obj nav-graph) (arg0 symbol) (arg1 symbol)) - (dotimes (v1-0 (-> obj node-count)) - (let* ((a3-1 (-> obj node-array v1-0)) +(defmethod select-nodes-in-level nav-graph ((this nav-graph) (arg0 symbol) (arg1 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((a3-1 (-> this node-array v1-0)) (t0-2 (= (-> a3-1 level) arg0)) ) (case arg1 @@ -658,14 +659,14 @@ ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) -(defmethod select-nodes-by-nav-mesh-id nav-graph ((obj nav-graph) (arg0 int) (arg1 symbol)) - (dotimes (v1-0 (-> obj node-count)) - (let* ((a3-1 (-> obj node-array v1-0)) +(defmethod select-nodes-by-nav-mesh-id nav-graph ((this nav-graph) (arg0 int) (arg1 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((a3-1 (-> this node-array v1-0)) (t0-2 (= (-> a3-1 nav-mesh-id) arg0)) ) (case arg1 @@ -688,14 +689,14 @@ ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) -(defmethod select-nodes-by-flags nav-graph ((obj nav-graph) (arg0 nav-node-flag-byte) (arg1 nav-node-flag-byte) (arg2 symbol)) - (dotimes (v1-0 (-> obj node-count)) - (let* ((t0-1 (-> obj node-array v1-0)) +(defmethod select-nodes-by-flags nav-graph ((this nav-graph) (arg0 nav-node-flag-byte) (arg1 nav-node-flag-byte) (arg2 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((t0-1 (-> this node-array v1-0)) (t1-3 (= (logand (-> t0-1 flags) arg1) arg0)) ) (case arg2 @@ -718,14 +719,14 @@ ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) -(defmethod assign-selected-nodes-to-level nav-graph ((obj nav-graph) (arg0 symbol)) - (dotimes (v1-0 (-> obj node-count)) - (let ((a2-1 (-> obj node-array v1-0))) +(defmethod assign-selected-nodes-to-level nav-graph ((this nav-graph) (arg0 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) (set! (-> a2-1 level) arg0) ) @@ -735,9 +736,9 @@ (none) ) -(defmethod assign-selected-nodes-to-nav-mesh nav-graph ((obj nav-graph) (arg0 uint)) - (dotimes (v1-0 (-> obj node-count)) - (let ((a2-1 (-> obj node-array v1-0))) +(defmethod assign-selected-nodes-to-nav-mesh nav-graph ((this nav-graph) (arg0 uint)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) (set! (-> a2-1 nav-mesh-id) arg0) ) @@ -747,9 +748,9 @@ (none) ) -(defmethod set-radius-of-selected-nodes nav-graph ((obj nav-graph) (arg0 float)) - (dotimes (s4-0 (-> obj node-count)) - (let ((a0-2 (-> obj node-array s4-0))) +(defmethod set-radius-of-selected-nodes nav-graph ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((a0-2 (-> this node-array s4-0))) (if (logtest? (-> a0-2 flags) (nav-node-flag-byte selected)) (set-radius a0-2 arg0) ) @@ -759,9 +760,9 @@ (none) ) -(defmethod or-flags-of-selected-nodes nav-graph ((obj nav-graph) (arg0 nav-node-flag-byte)) - (dotimes (v1-0 (-> obj node-count)) - (let ((a2-1 (-> obj node-array v1-0))) +(defmethod or-flags-of-selected-nodes nav-graph ((this nav-graph) (arg0 nav-node-flag-byte)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) (logior! (-> a2-1 flags) arg0) ) @@ -771,10 +772,10 @@ (none) ) -(defmethod and-flags-of-selected-nodes nav-graph ((obj nav-graph) (arg0 nav-node-flag-byte)) +(defmethod and-flags-of-selected-nodes nav-graph ((this nav-graph) (arg0 nav-node-flag-byte)) (let ((v1-0 (lognot arg0))) - (dotimes (a1-1 (-> obj node-count)) - (let ((a2-1 (-> obj node-array a1-1))) + (dotimes (a1-1 (-> this node-count)) + (let ((a2-1 (-> this node-array a1-1))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) (logand! (-> a2-1 flags) v1-0) ) @@ -785,9 +786,9 @@ (none) ) -(defmethod set-speed-limit-of-selected nav-graph ((obj nav-graph) (arg0 float)) - (dotimes (s4-0 (-> obj node-count)) - (let ((s3-0 (-> obj node-array s4-0))) +(defmethod set-speed-limit-of-selected nav-graph ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) (dotimes (s2-0 (-> s3-0 branch-count)) (set-speed-limit (-> s3-0 branch-array s2-0) arg0) @@ -799,9 +800,9 @@ (none) ) -(defmethod set-density-of-selected nav-graph ((obj nav-graph) (arg0 float)) - (dotimes (s4-0 (-> obj node-count)) - (let ((s3-0 (-> obj node-array s4-0))) +(defmethod set-density-of-selected nav-graph ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) (dotimes (s2-0 (-> s3-0 branch-count)) (set-density (-> s3-0 branch-array s2-0) arg0) @@ -813,9 +814,9 @@ (none) ) -(defmethod set-width-of-selected nav-graph ((obj nav-graph) (arg0 float)) - (dotimes (s4-0 (-> obj node-count)) - (let ((s3-0 (-> obj node-array s4-0))) +(defmethod set-width-of-selected nav-graph ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) (dotimes (s2-0 (-> s3-0 branch-count)) (set-width (-> s3-0 branch-array s2-0) arg0) @@ -827,10 +828,10 @@ (none) ) -(defmethod offset-pos-of-selected nav-graph ((obj nav-graph) (arg0 vector)) +(defmethod offset-pos-of-selected nav-graph ((this nav-graph) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (dotimes (s3-0 (-> obj node-count)) - (let ((a0-2 (-> obj node-array s3-0))) + (dotimes (s3-0 (-> this node-count)) + (let ((a0-2 (-> this node-array s3-0))) (when (logtest? (-> a0-2 flags) (nav-node-flag-byte selected)) (let ((a2-0 a0-2) (v1-4 s4-0) @@ -848,12 +849,12 @@ (none) ) -(defmethod nav-graph-method-38 nav-graph ((obj nav-graph)) +(defmethod nav-graph-method-38 nav-graph ((this nav-graph)) (let ((s5-0 (new 'stack-no-clear 'vehicle-controller)) (s4-0 (new 'stack-no-clear 'vector)) ) - (dotimes (s3-0 (-> obj node-count)) - (let ((s2-0 (-> obj node-array s3-0))) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) (when (and (logtest? (-> s2-0 flags) (nav-node-flag-byte selected)) (= (-> s2-0 branch-count) 1)) (let ((a1-0 (-> s2-0 branch-array 0))) (-> a1-0 dest-node) @@ -872,10 +873,10 @@ (none) ) -(defmethod debug-draw-nodes nav-graph ((obj nav-graph)) +(defmethod debug-draw-nodes nav-graph ((this nav-graph)) (let ((s5-0 (new 'stack-no-clear 'matrix))) - (dotimes (s4-0 (-> obj node-count)) - (let ((s3-0 (-> obj node-array s4-0))) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) (when (not (logtest? (-> s3-0 flags) (nav-node-flag-byte hidden))) (debug-draw s3-0) (let ((a1-0 s3-0) @@ -931,13 +932,13 @@ ) ;; WARN: Return type mismatch nav-node vs none. -(defmethod nav-graph-method-10 nav-graph ((obj nav-graph) (arg0 vector) (arg1 int)) +(defmethod nav-graph-method-10 nav-graph ((this nav-graph) (arg0 vector) (arg1 int)) (let* ((gp-0 (the-as nav-node #f)) (f0-0 409600000.0) (f30-0 (* f0-0 f0-0)) ) - (dotimes (s2-0 (-> obj node-count)) - (let ((s1-0 (-> obj node-array s2-0)) + (dotimes (s2-0 (-> this node-count)) + (let ((s1-0 (-> this node-array s2-0)) (a1-1 (new 'stack-no-clear 'vector)) ) (when (and (not (logtest? (-> s1-0 flags) (nav-node-flag-byte hidden))) @@ -962,9 +963,9 @@ (none) ) -(defmethod move-selected-to-height-map-height nav-graph ((obj nav-graph)) - (dotimes (s5-0 (-> obj node-count)) - (let ((s4-0 (-> obj node-array s5-0)) +(defmethod move-selected-to-height-map-height nav-graph ((this nav-graph)) + (dotimes (s5-0 (-> this node-count)) + (let ((s4-0 (-> this node-array s5-0)) (s3-0 (new 'stack-no-clear 'vector)) ) (when (and (not (logtest? (-> s4-0 flags) (nav-node-flag-byte hidden))) @@ -988,10 +989,10 @@ (none) ) -(defmethod nav-graph-method-39 nav-graph ((obj nav-graph)) +(defmethod nav-graph-method-39 nav-graph ((this nav-graph)) (local-vars (sv-80 entity-nav-mesh) (sv-96 entity-nav-mesh)) - (dotimes (s5-0 (-> obj node-count)) - (let ((s4-0 (-> obj node-array s5-0)) + (dotimes (s5-0 (-> this node-count)) + (let ((s4-0 (-> this node-array s5-0)) (s3-0 (new 'stack-no-clear 'vector)) ) (let ((a1-0 s4-0) @@ -1041,48 +1042,48 @@ (none) ) -(defmethod nav-graph-method-19 nav-graph ((obj nav-graph) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) - (let ((gp-0 (-> obj node-array arg0)) - (s0-0 (-> obj node-array arg1)) - (s4-0 (-> obj node-array arg2)) - (s2-0 (-> obj node-array arg3)) - (s1-0 (-> obj node-array arg4)) - (s3-0 (-> obj node-array arg5)) +(defmethod nav-graph-method-19 nav-graph ((this nav-graph) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) + (let ((gp-0 (-> this node-array arg0)) + (s0-0 (-> this node-array arg1)) + (s4-0 (-> this node-array arg2)) + (s2-0 (-> this node-array arg3)) + (s1-0 (-> this node-array arg4)) + (s3-0 (-> this node-array arg5)) ) - (debug-reset-branch-array obj s0-0 2) + (debug-reset-branch-array this s0-0 2) (set-dst-node (-> s0-0 branch-array 0) s4-0) (set-dst-node (-> s0-0 branch-array 1) s1-0) - (debug-reset-branch-array obj s2-0 2) + (debug-reset-branch-array this s2-0 2) (set-dst-node (-> s2-0 branch-array 0) s1-0) (set-dst-node (-> s2-0 branch-array 1) gp-0) - (debug-reset-branch-array obj s3-0 2) + (debug-reset-branch-array this s3-0 2) (set-dst-node (-> s3-0 branch-array 0) gp-0) (set-dst-node (-> s3-0 branch-array 1) s4-0) ) (none) ) -(defmethod nav-graph-method-40 nav-graph ((obj nav-graph) (arg0 int)) +(defmethod nav-graph-method-40 nav-graph ((this nav-graph) (arg0 int)) -1 - (shr (- arg0 (the-as int (-> obj node-array 0))) 5) + (shr (- arg0 (the-as int (-> this node-array 0))) 5) ) -(defmethod nav-graph-method-20 nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (let ((gp-0 (-> obj node-array arg0)) - (s5-0 (-> obj node-array arg1)) +(defmethod nav-graph-method-20 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (let ((gp-0 (-> this node-array arg0)) + (s5-0 (-> this node-array arg1)) ) - (debug-reset-branch-array obj gp-0 1) + (debug-reset-branch-array this gp-0 1) (set-dst-node (-> gp-0 branch-array 0) s5-0) ) (none) ) -(defmethod nav-graph-method-11 nav-graph ((obj nav-graph)) +(defmethod nav-graph-method-11 nav-graph ((this nav-graph)) (format #t "(define *traffic-nav-graph*~%") (format #t " (new-nav-graph~%") (format #t " :node-list (~%") - (dotimes (s5-0 (-> obj node-count)) - (let ((a0-5 (-> obj node-array s5-0))) + (dotimes (s5-0 (-> this node-count)) + (let ((a0-5 (-> this node-array s5-0))) (set! (-> a0-5 id) (the-as uint s5-0)) (debug-print a0-5 #t " ") ) @@ -1094,20 +1095,20 @@ (none) ) -(defmethod patch-nodes nav-graph ((obj nav-graph)) +(defmethod patch-nodes nav-graph ((this nav-graph)) "Patch nodes. Node pointers are stored as indices into arrays to be allocated on the level heap and patched at runtime after loading." - (when (not (-> obj patched)) - (set! (-> obj patched) #t) + (when (not (-> this patched)) + (set! (-> this patched) #t) (let ((s5-0 0)) - (dotimes (s4-0 (-> obj node-count)) - (let ((s3-0 (-> obj node-array s4-0))) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) (dotimes (s2-0 (-> s3-0 branch-count)) (let ((s1-0 (-> s3-0 branch-array s2-0))) (+! s5-0 1) (set-src-node s1-0 s3-0) (let ((v1-7 (the-as object (-> s1-0 dest-node)))) - (set-dst-node s1-0 (-> obj node-array (the-as uint v1-7))) + (set-dst-node s1-0 (-> this node-array (the-as uint v1-7))) ) ) ) @@ -1120,7 +1121,7 @@ and patched at runtime after loading." ) ;; WARN: Function (method 43 nav-graph) has a return type of none, but the expression builder found a return statement. -(defmethod copy-to-mysql-graph nav-graph ((obj nav-graph) (arg0 mysql-nav-graph) (arg1 string)) +(defmethod copy-to-mysql-graph nav-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 string)) (set! (-> arg0 node-array length) 0) (set! (-> arg0 edge-array length) 0) (set! (-> arg0 visnode-array length) 0) @@ -1128,15 +1129,15 @@ and patched at runtime after loading." (format s3-0 "select nav_graph_id from nav_graph where name='~S'" arg1) (let ((a2-2 (sql-query s3-0))) (when (!= (-> a2-2 error) 'select) - (format 0 "ERROR: sql: select error ~A for ~A~%" a2-2 obj) + (format 0 "ERROR: sql: select error ~A for ~A~%" a2-2 this) (return #f) ) (set! (-> arg0 nav_graph_id) (the-as uint (string->int (-> a2-2 data 0)))) ) ) - (dotimes (v1-7 (-> obj node-count)) + (dotimes (v1-7 (-> this node-count)) (let ((a1-6 (-> arg0 node-array data (-> arg0 node-array length))) - (a0-11 (-> obj node-array v1-7)) + (a0-11 (-> this node-array v1-7)) ) (logior! (-> a1-6 mysql-save-flag) (mysql-save-flag insert)) (set! (-> a1-6 runtime-id) (-> a0-11 id)) @@ -1210,7 +1211,7 @@ and patched at runtime after loading." ) ) -(defmethod from-editor nav-graph ((obj nav-graph) (arg0 mysql-nav-graph) (arg1 symbol)) +(defmethod from-editor nav-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 symbol)) (local-vars (v1-4 symbol) (v1-6 symbol) @@ -1223,9 +1224,9 @@ and patched at runtime after loading." (sv-96 nav-node) (sv-112 int) ) - (set! (-> obj node-count) 0) - (set! (-> obj branch-count) 0) - (set! (-> obj link-count) 0) + (set! (-> this node-count) 0) + (set! (-> this branch-count) 0) + (set! (-> this link-count) 0) (mysql-nav-graph-method-20 arg0) (let ((s5-0 0)) (let ((s2-0 0)) @@ -1242,7 +1243,7 @@ and patched at runtime after loading." (label cfg-7) (b! (not v1-6) cfg-27 :delay (nop!)) (set! sv-16 (temp-edge-size s0-0)) - (let ((s1-0 (debug-add-node obj sv-16))) + (let ((s1-0 (debug-add-node this sv-16))) (b! (not s1-0) cfg-36 :delay (nop!)) (set! (-> s1-0 id) (the-as uint (if arg1 (-> s0-0 level-node-index) @@ -1256,7 +1257,7 @@ and patched at runtime after loading." (set-radius s1-0 (-> s0-0 radius)) (set! (-> s1-0 level) (-> s0-0 level_name)) (set! (-> s1-0 nav-mesh-id) (-> s0-0 nav_mesh_id)) - (when (!= (-> obj branch-array s5-0) (-> s1-0 branch-array 0)) + (when (!= (-> this branch-array s5-0) (-> s1-0 branch-array 0)) (format 0 "nav-graph::from-editor: ERROR something went awry in allocate-branches~%") (break!) 0 @@ -1266,7 +1267,7 @@ and patched at runtime after loading." (b! #t cfg-25 :delay (nop!)) (label cfg-15) (set! sv-32 (+ sv-32 -1)) - (set! sv-64 (-> obj branch-array s5-0)) + (set! sv-64 (-> this branch-array s5-0)) (set-src-node sv-64 s1-0) (set-speed-limit sv-64 (-> (the-as mysql-nav-edge s0-1) speed_limit)) (set-density sv-64 (-> (the-as mysql-nav-edge s0-1) density)) @@ -1281,10 +1282,10 @@ and patched at runtime after loading." (label cfg-18) (b! (not v1-37) cfg-23 :delay (nop!)) (let ((t9-11 (method-of-type nav-branch set-dst-node)) - (a1-11 (-> obj node-array (if arg1 - (-> sv-48 level-node-index) - (-> (the-as mysql-nav-edge s0-1) runtime-node-id-2) - ) + (a1-11 (-> this node-array (if arg1 + (-> sv-48 level-node-index) + (-> (the-as mysql-nav-edge s0-1) runtime-node-id-2) + ) ) ) ) @@ -1293,8 +1294,8 @@ and patched at runtime after loading." (b! #t cfg-24 :delay (nop!)) (label cfg-23) (set-dst-node sv-64 (the-as nav-node #f)) - (set! sv-112 (-> obj link-count)) - (set! sv-80 (-> obj link-array sv-112)) + (set! sv-112 (-> this link-count)) + (set! sv-80 (-> this link-array sv-112)) (set! (-> sv-80 dest-graph-id) (-> (lookup-level-info2 arg0 sv-48 #f) level-id)) (set! (-> sv-80 src-branch-id) (the-as uint s5-0)) (set! (-> sv-80 dest-node-id) (the-as uint (-> sv-48 level-node-index))) @@ -1309,7 +1310,7 @@ and patched at runtime after loading." (set! (-> sv-96 nav-mesh-id) (-> sv-48 nav_mesh_id)) (set-dst-node sv-64 (-> sv-80 dummy-node)) (format #t "outputting link ~d~%" sv-112) - (+! (-> obj link-count) 1) + (+! (-> this link-count) 1) (label cfg-24) (+! s5-0 1) (set! s0-1 (-> (the-as mysql-nav-edge s0-1) temp-next-edge)) @@ -1336,7 +1337,7 @@ and patched at runtime after loading." ) (format #t "branch-count ~d~%" s5-0) ) - (set! (-> obj patched) #t) + (set! (-> this patched) #t) (label cfg-36) 0 (none) diff --git a/goal_src/jak2/levels/city/common/pilot-states.gc b/goal_src/jak2/levels/city/common/pilot-states.gc index b97a3b0899..20e93e4f75 100644 --- a/goal_src/jak2/levels/city/common/pilot-states.gc +++ b/goal_src/jak2/levels/city/common/pilot-states.gc @@ -767,7 +767,7 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (local-vars (sv-16 attack-info)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self neck flex-blend) 0.0) (set! sv-16 (-> self attack-info)) (let ((v1-4 sv-16)) @@ -824,7 +824,7 @@ (case arg0 (('melt 'grenade 'explode) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 0.2)) + (until (time-elapsed? s5-0 (seconds 0.2)) (suspend) ) ) @@ -951,7 +951,7 @@ 0 (ja-channel-set! 0) (let ((s5-7 (current-time))) - (until (>= (- (current-time) s5-7) (seconds 1.8)) + (until (time-elapsed? s5-7 (seconds 1.8)) (suspend) ) ) @@ -984,7 +984,7 @@ ) ) (let ((s5-9 (current-time))) - (until (>= (- (current-time) s5-9) (seconds 0.5)) + (until (time-elapsed? s5-9 (seconds 0.5)) (suspend) ) ) diff --git a/goal_src/jak2/levels/city/common/searchlight.gc b/goal_src/jak2/levels/city/common/searchlight.gc index 2bce49ae60..322d6356a2 100644 --- a/goal_src/jak2/levels/city/common/searchlight.gc +++ b/goal_src/jak2/levels/city/common/searchlight.gc @@ -71,24 +71,24 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! searchlight ((obj searchlight) (arg0 entity-actor)) +(defmethod init-from-entity! searchlight ((this searchlight) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-searchlight" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status disable-fog)) - (set! (-> obj root scale y) (rand-vu-float-range 1.8 2.0)) - (set-vector! (-> obj draw color-mult) 0.0 0.0 0.0 0.0) + (logior! (-> this draw status) (draw-control-status disable-fog)) + (set! (-> this root scale y) (rand-vu-float-range 1.8 2.0)) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.0 0.0) (let ((s4-1 (new 'stack-no-clear 'sync-info-params))) (let ((v1-12 0)) (if #t @@ -104,8 +104,8 @@ This commonly includes things such as: (set! (-> s4-1 ease-out) 0.15) (set! (-> s4-1 pause-in) 0.0) (set! (-> s4-1 pause-out) 0.0) - (initialize! (-> obj sync) s4-1) + (initialize! (-> this sync) s4-1) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/city/common/trail.gc b/goal_src/jak2/levels/city/common/trail.gc index 600897b4d2..7fe04fe380 100644 --- a/goal_src/jak2/levels/city/common/trail.gc +++ b/goal_src/jak2/levels/city/common/trail.gc @@ -8,9 +8,9 @@ ;; DECOMP BEGINS ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw trail-conn ((obj trail-conn) (arg0 trail-graph) (arg1 int)) - (let ((a2-3 (-> arg0 node (-> obj head-id))) - (v1-2 (-> arg0 node (-> obj tail-id))) +(defmethod debug-draw trail-conn ((this trail-conn) (arg0 trail-graph) (arg1 int)) + (let ((a2-3 (-> arg0 node (-> this head-id))) + (v1-2 (-> arg0 node (-> this tail-id))) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -49,11 +49,11 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw trail-node ((obj trail-node) (arg0 int)) +(defmethod debug-draw trail-node ((this trail-node) (arg0 int)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'sphere)) ) - (set-vector! s5-0 (* 4096.0 (the float (-> obj x))) 53248.0 (* 4096.0 (the float (-> obj z))) 1.0) + (set-vector! s5-0 (* 4096.0 (the float (-> this x))) 53248.0 (* 4096.0 (the float (-> this z))) 1.0) (set! (-> s4-0 quad) (-> s5-0 quad)) (set! (-> s4-0 r) 4096.0) (let ((f0-7 (vector-vector-distance-squared s5-0 (math-camera-pos))) @@ -75,9 +75,9 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw-cell trail-graph ((obj trail-graph) (arg0 int)) +(defmethod debug-draw-cell trail-graph ((this trail-graph) (arg0 int)) (local-vars (sv-80 int) (sv-96 (function _varargs_ object))) - (let* ((s5-0 (-> obj conn-hash)) + (let* ((s5-0 (-> this conn-hash)) (s4-0 (-> s5-0 cell arg0)) (s3-0 (new 'stack-no-clear 'inline-array 'vector 2)) ) @@ -127,12 +127,12 @@ ) ) (countdown (s2-1 (-> s4-0 conn-count)) - (let ((s1-1 (-> obj conn (-> s5-0 conn-ids (+ s2-1 (-> s4-0 first-conn)))))) - (get-position (-> obj node (-> s1-1 head-id)) (-> s3-0 0)) + (let ((s1-1 (-> this conn (-> s5-0 conn-ids (+ s2-1 (-> s4-0 first-conn)))))) + (get-position (-> this node (-> s1-1 head-id)) (-> s3-0 0)) (set! (-> s3-0 0 y) 53248.0) (+! (-> s3-0 0 x) -2048.0) (+! (-> s3-0 0 z) -2048.0) - (get-position (-> obj node (-> s1-1 tail-id)) (-> s3-0 1)) + (get-position (-> this node (-> s1-1 tail-id)) (-> s3-0 1)) ) (set! (-> s3-0 1 y) 53248.0) (+! (-> s3-0 1 x) -2048.0) @@ -144,7 +144,7 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod debug-draw-path trail-graph ((obj trail-graph) (arg0 int) (arg1 (pointer uint16)) (arg2 vector) (arg3 vector) (arg4 rgba) (arg5 float)) +(defmethod debug-draw-path trail-graph ((this trail-graph) (arg0 int) (arg1 (pointer uint16)) (arg2 vector) (arg3 vector) (arg4 rgba) (arg5 float)) (local-vars (sv-48 int)) (let ((s0-0 (new 'stack-no-clear 'inline-array 'vector 2))) (set-vector! (-> s0-0 1) (+ (-> arg2 x) arg5) 53248.0 (+ (-> arg2 z) arg5) 1.0) @@ -153,7 +153,7 @@ (set! (-> s0-0 0 quad) (-> s0-0 1 quad)) (cond ((< sv-48 arg0) - (let ((a0-7 (-> obj node (-> arg1 sv-48)))) + (let ((a0-7 (-> this node (-> arg1 sv-48)))) (set-vector! (-> s0-0 1) (+ (* 4096.0 (the float (-> a0-7 x))) arg5) @@ -178,17 +178,17 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod debug-draw trail-graph ((obj trail-graph)) - (when (= (-> obj mode) 3) +(defmethod debug-draw trail-graph ((this trail-graph)) + (when (= (-> this mode) 3) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s5-0 1 quad) (-> obj orig-goal-pos quad)) + (set! (-> s5-0 1 quad) (-> this orig-goal-pos quad)) (set! (-> s5-0 1 y) 53248.0) - (let ((v1-4 (-> obj goal-node-id))) + (let ((v1-4 (-> this goal-node-id))) (until #f (set! (-> s5-0 0 quad) (-> s5-0 1 quad)) (cond ((>= v1-4 0) - (let ((s4-0 (-> obj node v1-4))) + (let ((s4-0 (-> this node v1-4))) (set-vector! (-> s5-0 1) (+ 2048.0 (* 4096.0 (the float (-> s4-0 x)))) @@ -201,7 +201,7 @@ ) ) (else - (set! (-> s5-0 1 quad) (-> obj orig-start-pos quad)) + (set! (-> s5-0 1 quad) (-> this orig-start-pos quad)) (set! (-> s5-0 1 y) 53248.0) (add-debug-line #t (bucket-id debug2) (-> s5-0 0) (-> s5-0 1) *color-green* #f (the-as rgba -1)) (goto cfg-7) @@ -213,74 +213,74 @@ #f ) (label cfg-7) - (case (-> obj mode) + (case (-> this mode) ((1 2 3) (let ((s5-1 (new 'stack-no-clear 'vector))) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj orig-start-pos) + (-> this orig-start-pos) (meters 1) (new 'static 'rgba :r #xff :a #x80) ) - (set! (-> s5-1 quad) (-> obj conn-start-pos quad)) + (set! (-> s5-1 quad) (-> this conn-start-pos quad)) (set! (-> s5-1 y) 53248.0) (add-debug-sphere #t (bucket-id debug-no-zbuf1) s5-1 (meters 0.25) (new 'static 'rgba :r #xff :a #x80)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj orig-goal-pos) + (-> this orig-goal-pos) (meters 1) (new 'static 'rgba :g #xff :a #x80) ) - (set! (-> s5-1 quad) (-> obj conn-goal-pos quad)) + (set! (-> s5-1 quad) (-> this conn-goal-pos quad)) (set! (-> s5-1 y) 53248.0) (add-debug-sphere #t (bucket-id debug-no-zbuf1) s5-1 (meters 0.25) (new 'static 'rgba :g #xff :a #x80)) ) ) ) - (dotimes (s5-2 (the-as int (-> obj conn-count))) - (debug-draw (-> obj conn s5-2) obj s5-2) + (dotimes (s5-2 (the-as int (-> this conn-count))) + (debug-draw (-> this conn s5-2) this s5-2) ) - (dotimes (s5-3 (the-as int (-> obj node-count))) - (debug-draw (-> obj node s5-3) s5-3) + (dotimes (s5-3 (the-as int (-> this node-count))) + (debug-draw (-> this node s5-3) s5-3) ) 0 (none) ) -(defmethod get-position trail-node ((obj trail-node) (arg0 vector)) +(defmethod get-position trail-node ((this trail-node) (arg0 vector)) "Unpack the position to a vector" (let ((v0-0 arg0)) - (set! (-> v0-0 x) (* 4096.0 (the float (-> obj x)))) + (set! (-> v0-0 x) (* 4096.0 (the float (-> this x)))) (set! (-> v0-0 y) 0.0) - (set! (-> v0-0 z) (* 4096.0 (the float (-> obj z)))) + (set! (-> v0-0 z) (* 4096.0 (the float (-> this z)))) (set! (-> v0-0 w) 1.0) v0-0 ) ) -(defmethod get-node-location-by-id trail-graph ((obj trail-graph) (arg0 uint) (arg1 vector)) +(defmethod get-node-location-by-id trail-graph ((this trail-graph) (arg0 uint) (arg1 vector)) "Get the location of the node with the given ID" - (get-position (-> obj node (the-as int arg0)) arg1) + (get-position (-> this node (the-as int arg0)) arg1) ) -(defmethod get-path-to-root trail-graph ((obj trail-graph) (arg0 (pointer uint16)) (arg1 int) (arg2 (pointer int32)) (arg3 (pointer float))) +(defmethod get-path-to-root trail-graph ((this trail-graph) (arg0 (pointer uint16)) (arg1 int) (arg2 (pointer int32)) (arg3 (pointer float))) "Get the path from goal to root, following parent-id" (set! (-> arg3 0) 0.0) - (set! (-> arg2 0) (-> obj goal-node-id)) + (set! (-> arg2 0) (-> this goal-node-id)) (let ((v0-0 -1)) - (when (= (-> obj mode) 3) - (let ((v1-3 (-> obj node)) + (when (= (-> this mode) 3) + (let ((v1-3 (-> this node)) (a3-2 0) ) - (let ((t1-0 (-> obj goal-node-id))) + (let ((t1-0 (-> this goal-node-id))) (while (>= t1-0 0) (+! a3-2 1) (set! t1-0 (-> v1-3 t1-0 parent-id)) ) ) - (let ((t1-4 (-> obj goal-node-id))) + (let ((t1-4 (-> this goal-node-id))) (let ((t2-1 (- a3-2 arg1))) (cond ((> t2-1 0) @@ -301,7 +301,7 @@ ) ) (when (> a3-2 0) - (let ((a0-3 (-> v1-3 (-> obj goal-node-id))) + (let ((a0-3 (-> v1-3 (-> this goal-node-id))) (v1-4 (-> v1-3 (-> arg0 0))) ) (set! (-> arg3 0) @@ -315,39 +315,39 @@ ) ) -(defmethod try-initialize trail-graph ((obj trail-graph)) +(defmethod try-initialize trail-graph ((this trail-graph)) "Init and verify that constants are good." - (let ((a3-0 (shr (+ (-> obj node-count) 127) 7))) + (let ((a3-0 (shr (+ (-> this node-count) 127) 7))) (when (!= a3-0 6) (format 0 "ERROR: TRAIL_NODE_BIT_ARRAY_QUAD_COUNT is ~d, but should be ~d! Please change it!~%" 6 a3-0) (return #f) ) ) - (let ((a3-1 (shr (+ (-> obj conn-count) 127) 7))) + (let ((a3-1 (shr (+ (-> this conn-count) 127) 7))) (when (!= a3-1 7) (format 0 "ERROR: TRAIL_CONN_BIT_ARRAY_QUAD_COUNT is ~d, but should be ~d! Please change it!~%" 7 a3-1) (return #f) ) ) - (set! (-> obj mode) (the-as uint 0)) - (set! (-> obj goal-conn-id) -1) - (set! (-> obj goal-node-id) -1) - (set! (-> obj open-head-id) -1) + (set! (-> this mode) (the-as uint 0)) + (set! (-> this goal-conn-id) -1) + (set! (-> this goal-node-id) -1) + (set! (-> this open-head-id) -1) #t ) -(defmethod reset-search-state trail-graph ((obj trail-graph)) +(defmethod reset-search-state trail-graph ((this trail-graph)) "Reset the search/goal." - (when (nonzero? (-> obj mode)) - (set! (-> obj goal-node-id) -1) - (let ((a1-0 (-> obj goal-conn-id))) + (when (nonzero? (-> this mode)) + (set! (-> this goal-node-id) -1) + (let ((a1-0 (-> this goal-conn-id))) (when (>= a1-0 0) - (update-node-flags-for-conn obj a1-0 (trail-node-flag) (trail-node-flag tnf0)) - (set! (-> obj goal-conn-id) -1) + (update-node-flags-for-conn this a1-0 (trail-node-flag) (trail-node-flag tnf0)) + (set! (-> this goal-conn-id) -1) ) ) - (set! (-> obj open-head-id) -1) - (let ((v1-7 (-> obj open-quads))) + (set! (-> this open-head-id) -1) + (let ((v1-7 (-> this open-quads))) (set! (-> v1-7 0 quad) (the-as uint128 0)) (set! (-> v1-7 1 quad) (the-as uint128 0)) (set! (-> v1-7 2 quad) (the-as uint128 0)) @@ -356,7 +356,7 @@ (set! (-> v1-7 5 quad) (the-as uint128 0)) ) 0 - (let ((v1-9 (-> obj closed-quads))) + (let ((v1-9 (-> this closed-quads))) (set! (-> v1-9 0 quad) (the-as uint128 0)) (set! (-> v1-9 1 quad) (the-as uint128 0)) (set! (-> v1-9 2 quad) (the-as uint128 0)) @@ -365,24 +365,24 @@ (set! (-> v1-9 5 quad) (the-as uint128 0)) ) 0 - (set! (-> obj mode) (the-as uint 0)) + (set! (-> this mode) (the-as uint 0)) 0 ) (none) ) ;; WARN: Return type mismatch trail-node-flag vs none. -(defmethod update-node-flags-for-conn trail-graph ((obj trail-graph) (arg0 int) (arg1 trail-node-flag) (arg2 trail-node-flag)) +(defmethod update-node-flags-for-conn trail-graph ((this trail-graph) (arg0 int) (arg1 trail-node-flag) (arg2 trail-node-flag)) "Set arg1, clear arg2" (let* ((v1-0 (lognot arg2)) - (a3-2 (-> obj conn arg0)) + (a3-2 (-> this conn arg0)) (t0-0 (-> a3-2 visgroup-id)) - (a1-2 (-> obj node)) + (a1-2 (-> this node)) ) (cond ((> t0-0 0) - (let* ((a3-4 (-> obj visgroup (+ t0-0 -1))) - (a0-2 (&-> (-> obj visnode-ids) (-> a3-4 first-conn))) + (let* ((a3-4 (-> this visgroup (+ t0-0 -1))) + (a0-2 (&-> (-> this visnode-ids) (-> a3-4 first-conn))) ) (countdown (a3-5 (-> a3-4 conn-count)) (let ((t0-8 (-> a1-2 (-> a0-2 0)))) @@ -406,7 +406,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod trail-graph-method-25 trail-graph ((obj trail-graph) (arg0 trail-conn-search) (arg1 int) (arg2 int)) +(defmethod trail-graph-method-25 trail-graph ((this trail-graph) (arg0 trail-conn-search) (arg1 int) (arg2 int)) (let* ((v1-1 (+ (* arg2 16) arg1)) (a0-1 (/ v1-1 8)) (a1-2 (ash 1 (logand v1-1 7))) @@ -414,8 +414,8 @@ ) (when (not (logtest? a2-4 a1-2)) (set! (-> arg0 cell-quads 0 byte a0-1) (logior a2-4 a1-2)) - (let* ((v1-3 (-> obj conn-hash cell v1-1)) - (s4-0 (&-> (-> obj conn-hash conn-ids) (-> v1-3 first-conn))) + (let* ((v1-3 (-> this conn-hash cell v1-1)) + (s4-0 (&-> (-> this conn-hash conn-ids) (-> v1-3 first-conn))) ) (countdown (s3-0 (-> v1-3 conn-count)) (let* ((s2-0 (-> s4-0 0)) @@ -425,12 +425,12 @@ ) (when (not (logtest? a2-5 a1-7)) (set! (-> arg0 conn-quads 0 byte v1-4) (logior a2-5 a1-7)) - (let* ((v1-7 (-> obj conn s2-0)) + (let* ((v1-7 (-> this conn s2-0)) (a0-14 (-> v1-7 flags)) ) - (when (= (logand (the-as conn-flag (-> obj conn-mask)) a0-14) a0-14) - (let ((a3-2 (-> obj node (-> v1-7 head-id))) - (v1-10 (-> obj node (-> v1-7 tail-id))) + (when (= (logand (the-as conn-flag (-> this conn-mask)) a0-14) a0-14) + (let ((a3-2 (-> this node (-> v1-7 head-id))) + (v1-10 (-> this node (-> v1-7 tail-id))) (a1-14 (new 'stack-no-clear 'vector)) (a2-7 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) @@ -469,8 +469,8 @@ (none) ) -(defmethod do-path trail-graph ((obj trail-graph) (arg0 vector) (arg1 vector)) - (let ((v1-0 (-> obj conn-hash)) +(defmethod do-path trail-graph ((this trail-graph) (arg0 vector) (arg1 vector)) + (let ((v1-0 (-> this conn-hash)) (s5-0 (new 'stack-no-clear 'trail-conn-search)) ) (set! (-> s5-0 src-pos) arg0) @@ -511,7 +511,7 @@ (until (< (-> s5-0 bounds max z) s3-0) (let ((s2-0 (-> s5-0 bounds min x))) (until (< (-> s5-0 bounds max x) s2-0) - (trail-graph-method-25 obj s5-0 s2-0 s3-0) + (trail-graph-method-25 this s5-0 s2-0 s3-0) (+! s2-0 1) ) ) @@ -527,15 +527,15 @@ ) (let ((s3-1 (-> s5-0 bounds min x))) (until (< (-> s5-0 bounds max x) s3-1) - (trail-graph-method-25 obj s5-0 s3-1 (-> s5-0 bounds min z)) - (trail-graph-method-25 obj s5-0 s3-1 (-> s5-0 bounds max z)) + (trail-graph-method-25 this s5-0 s3-1 (-> s5-0 bounds min z)) + (trail-graph-method-25 this s5-0 s3-1 (-> s5-0 bounds max z)) (+! s3-1 1) ) ) (let ((s3-2 (-> s5-0 bounds min z))) (until (< (-> s5-0 bounds max z) s3-2) - (trail-graph-method-25 obj s5-0 (-> s5-0 bounds min x) s3-2) - (trail-graph-method-25 obj s5-0 (-> s5-0 bounds max x) s3-2) + (trail-graph-method-25 this s5-0 (-> s5-0 bounds min x) s3-2) + (trail-graph-method-25 this s5-0 (-> s5-0 bounds max x) s3-2) (+! s3-2 1) ) ) @@ -545,37 +545,37 @@ ) ) -(defmethod trail-graph-method-9 trail-graph ((obj trail-graph) (arg0 int)) - (let ((s4-0 (-> obj node arg0))) - (set! (-> s4-0 cost-from-start) (get-dist-score s4-0 (-> obj orig-start-pos))) - (set! (-> s4-0 cost-to-goal) (get-dist-score s4-0 (-> obj orig-goal-pos))) +(defmethod trail-graph-method-9 trail-graph ((this trail-graph) (arg0 int)) + (let ((s4-0 (-> this node arg0))) + (set! (-> s4-0 cost-from-start) (get-dist-score s4-0 (-> this orig-start-pos))) + (set! (-> s4-0 cost-to-goal) (get-dist-score s4-0 (-> this orig-goal-pos))) ) - (trail-graph-method-11 obj arg0 -1) + (trail-graph-method-11 this arg0 -1) 0 (none) ) -(defmethod trail-graph-method-10 trail-graph ((obj trail-graph) (arg0 int)) - (let* ((s5-0 (-> obj conn arg0)) +(defmethod trail-graph-method-10 trail-graph ((this trail-graph) (arg0 int)) + (let* ((s5-0 (-> this conn arg0)) (v1-1 (-> s5-0 visgroup-id)) ) (cond ((> v1-1 0) - (let* ((v1-4 (-> obj visgroup (+ v1-1 -1))) - (s5-1 (&-> (-> obj visnode-ids) (-> v1-4 first-conn))) + (let* ((v1-4 (-> this visgroup (+ v1-1 -1))) + (s5-1 (&-> (-> this visnode-ids) (-> v1-4 first-conn))) (s4-0 (-> v1-4 conn-count)) ) - (-> obj visnode-ids) + (-> this visnode-ids) (while (nonzero? s4-0) (+! s4-0 -1) - (trail-graph-method-9 obj (the-as int (-> s5-1 0))) + (trail-graph-method-9 this (the-as int (-> s5-1 0))) (set! s5-1 (&-> s5-1 1)) ) ) ) (else - (trail-graph-method-9 obj (the-as int (-> s5-0 head-id))) - (trail-graph-method-9 obj (the-as int (-> s5-0 tail-id))) + (trail-graph-method-9 this (the-as int (-> s5-0 head-id))) + (trail-graph-method-9 this (the-as int (-> s5-0 tail-id))) ) ) ) @@ -583,18 +583,18 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod trail-graph-method-11 trail-graph ((obj trail-graph) (arg0 int) (arg1 int)) +(defmethod trail-graph-method-11 trail-graph ((this trail-graph) (arg0 int) (arg1 int)) (let ((v1-0 (/ arg0 8)) (a3-1 (ash 1 (logand arg0 7))) ) - (logior! (-> obj open-quads 0 byte v1-0) a3-1) + (logior! (-> this open-quads 0 byte v1-0) a3-1) ) - (let* ((v1-2 (-> obj node)) + (let* ((v1-2 (-> this node)) (v0-0 (-> v1-2 arg0)) ) (set! (-> v0-0 parent-id) arg1) (let ((a3-6 (+ (-> v0-0 cost-from-start) (-> v0-0 cost-to-goal))) - (t0-4 (-> obj open-head-id)) + (t0-4 (-> this open-head-id)) (a2-2 -1) ) (until #f @@ -603,7 +603,7 @@ (set! (-> v0-0 prev-id) a2-2) (if (>= a2-2 0) (set! (-> v1-2 a2-2 next-id) arg0) - (set! (-> obj open-head-id) arg0) + (set! (-> this open-head-id) arg0) ) (return v0-0) ) @@ -614,7 +614,7 @@ (set! (-> t1-4 prev-id) arg0) (if (>= a2-2 0) (set! (-> v1-2 a2-2 next-id) arg0) - (set! (-> obj open-head-id) arg0) + (set! (-> this open-head-id) arg0) ) (return v0-0) ) @@ -628,13 +628,13 @@ ) ) -(defmethod trail-graph-method-22 trail-graph ((obj trail-graph) (arg0 int)) +(defmethod trail-graph-method-22 trail-graph ((this trail-graph) (arg0 int)) (let ((v1-0 (/ arg0 8)) (a2-1 (ash 1 (logand arg0 7))) ) - (logior! (-> obj open-quads 0 byte v1-0) a2-1) + (logior! (-> this open-quads 0 byte v1-0) a2-1) ) - (let* ((v1-2 (-> obj node)) + (let* ((v1-2 (-> this node)) (a2-4 (-> v1-2 arg0)) (a1-2 (-> a2-4 prev-id)) (a2-5 (-> a2-4 next-id)) @@ -647,7 +647,7 @@ ) ) (else - (set! (-> obj open-head-id) a2-5) + (set! (-> this open-head-id) a2-5) (if (>= a2-5 0) (set! (-> v1-2 a2-5 prev-id) -1) ) @@ -657,13 +657,13 @@ (none) ) -(defmethod get-next-to-explore trail-graph ((obj trail-graph)) - (let ((v0-0 (-> obj open-head-id))) +(defmethod get-next-to-explore trail-graph ((this trail-graph)) + (let ((v0-0 (-> this open-head-id))) (when (>= v0-0 0) - (let* ((v1-1 (-> obj node)) + (let* ((v1-1 (-> this node)) (a2-0 (-> v1-1 v0-0 next-id)) ) - (set! (-> obj open-head-id) a2-0) + (set! (-> this open-head-id) a2-0) (if (>= a2-0 0) (set! (-> v1-1 a2-0 prev-id) -1) ) @@ -671,8 +671,8 @@ (let ((v1-3 (/ v0-0 8)) (a1-6 (ash 1 (logand v0-0 7))) ) - (logior! (-> obj closed-quads 0 byte v1-3) a1-6) - (logxor! (-> obj open-quads 0 byte v1-3) (the-as uint a1-6)) + (logior! (-> this closed-quads 0 byte v1-3) a1-6) + (logxor! (-> this open-quads 0 byte v1-3) (the-as uint a1-6)) ) ) v0-0 @@ -680,56 +680,56 @@ ) ;; WARN: Return type mismatch int vs uint. -(defmethod get-dist-score trail-node ((obj trail-node) (arg0 vector)) - (let* ((f0-1 (- (-> arg0 x) (* 4096.0 (the float (-> obj x))))) - (f1-3 (- (-> arg0 z) (* 4096.0 (the float (-> obj z))))) +(defmethod get-dist-score trail-node ((this trail-node) (arg0 vector)) + (let* ((f0-1 (- (-> arg0 x) (* 4096.0 (the float (-> this x))))) + (f1-3 (- (-> arg0 z) (* 4096.0 (the float (-> this z))))) (f0-4 (sqrtf (+ (* f0-1 f0-1) (* f1-3 f1-3)))) ) (the uint (fmin 65535.0 (* 0.00024414062 (* 8.0 f0-4)))) ) ) -(defmethod do-some-work trail-graph ((obj trail-graph)) - (let ((s5-0 (get-next-to-explore obj))) +(defmethod do-some-work trail-graph ((this trail-graph)) + (let ((s5-0 (get-next-to-explore this))) (if (< s5-0 0) (return 2) ) - (let ((s4-0 (-> obj node s5-0))) + (let ((s4-0 (-> this node s5-0))) (when (logtest? (-> s4-0 flags) (trail-node-flag tnf0)) - (set! (-> obj goal-node-id) s5-0) + (set! (-> this goal-node-id) s5-0) (return 3) ) - (let ((s3-0 (&-> (-> obj conn-ids) (-> s4-0 first-conn)))) + (let ((s3-0 (&-> (-> this conn-ids) (-> s4-0 first-conn)))) (countdown (s2-0 (-> s4-0 conn-count)) - (let* ((a0-7 (-> obj conn (-> s3-0 0))) + (let* ((a0-7 (-> this conn (-> s3-0 0))) (v1-12 (-> a0-7 flags)) ) - (when (= (logand (the-as conn-flag (-> obj conn-mask)) v1-12) v1-12) + (when (= (logand (the-as conn-flag (-> this conn-mask)) v1-12) v1-12) (let ((s1-0 (-> a0-7 tail-id))) (if (= s1-0 s5-0) (set! s1-0 (-> a0-7 head-id)) ) - (let ((s0-0 (-> obj node s1-0)) + (let ((s0-0 (-> this node s1-0)) (v1-17 (min #xffff (the-as int (+ (-> a0-7 cost) (-> s4-0 cost-from-start))))) (a0-10 (shr s1-0 3)) (a1-7 (ash 1 (logand s1-0 7))) ) (cond - ((logtest? (-> obj open-quads 0 byte a0-10) a1-7) + ((logtest? (-> this open-quads 0 byte a0-10) a1-7) (when (< (the-as uint v1-17) (-> s0-0 cost-from-start)) (set! (-> s0-0 cost-from-start) (the-as uint v1-17)) - (trail-graph-method-22 obj (the-as int s1-0)) - (trail-graph-method-11 obj (the-as int s1-0) s5-0) + (trail-graph-method-22 this (the-as int s1-0)) + (trail-graph-method-11 this (the-as int s1-0) s5-0) ) ) - ((not (logtest? (-> obj closed-quads 0 byte a0-10) a1-7)) + ((not (logtest? (-> this closed-quads 0 byte a0-10) a1-7)) (set! (-> s0-0 cost-from-start) (the-as uint v1-17)) - (set! (-> s0-0 cost-to-goal) (get-dist-score s0-0 (-> obj orig-goal-pos))) - (trail-graph-method-11 obj (the-as int s1-0) s5-0) + (set! (-> s0-0 cost-to-goal) (get-dist-score s0-0 (-> this orig-goal-pos))) + (trail-graph-method-11 this (the-as int s1-0) s5-0) ) ((< (the-as uint v1-17) (-> s0-0 cost-from-start)) (set! (-> s0-0 cost-from-start) (the-as uint v1-17)) - (trail-graph-method-11 obj (the-as int s1-0) s5-0) + (trail-graph-method-11 this (the-as int s1-0) s5-0) ) ) ) @@ -746,20 +746,21 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod run-until-done-or-timeout trail-graph ((obj trail-graph) (arg0 int)) +(defmethod run-until-done-or-timeout trail-graph ((this trail-graph) (arg0 int)) (local-vars (v1-1 int)) - (let ((v0-0 (the-as int (-> obj mode)))) + (let ((v0-0 (the-as int (-> this mode)))) 0 (.mfc0 v1-1 Count) (while (and (= v0-0 1) + ;; og:preserve-this ;; changed in PC port: they used to abort early if searching takes too long ;; it is fast enough on PC that we don't care. ;; (< (the-as uint v1-1) (the-as uint arg0)) HACK ) - (set! v0-0 (do-some-work obj)) + (set! v0-0 (do-some-work this)) (.mfc0 v1-1 Count) ) - (set! (-> obj mode) (the-as uint v0-0)) + (set! (-> this mode) (the-as uint v0-0)) ) (none) ) @@ -778,9 +779,9 @@ ) -(defmethod trail-graph-method-19 trail-graph ((obj trail-graph) (arg0 int) (arg1 int)) +(defmethod trail-graph-method-19 trail-graph ((this trail-graph) (arg0 int) (arg1 int)) (local-vars (s4-1 symbol)) - (let* ((s4-0 (-> obj node)) + (let* ((s4-0 (-> this node)) (v1-2 (-> s4-0 arg1)) (s5-0 (new 'stack-no-clear 'trail-vis-work)) ) @@ -788,16 +789,16 @@ (set-vector! (-> s5-0 p0) (* 4096.0 (the float (-> v1-2 x))) - (-> obj orig-goal-pos y) + (-> this orig-goal-pos y) (* 4096.0 (the float (-> v1-2 z))) 1.0 ) (set! (-> s5-0 p1 quad) (-> s5-0 p0 quad)) (set! (-> s5-0 best-count) (the-as uint 0)) (set! (-> s5-0 best-dist) -1.0) - (let ((s2-0 (&-> (-> obj conn-ids) (-> v1-2 first-conn)))) + (let ((s2-0 (&-> (-> this conn-ids) (-> v1-2 first-conn)))) (countdown (s1-0 (-> v1-2 conn-count)) - (let* ((v1-4 (-> obj conn (-> s2-0 0))) + (let* ((v1-4 (-> this conn (-> s2-0 0))) (s0-0 (-> v1-4 tail-id)) ) (if (= s0-0 arg1) @@ -807,7 +808,7 @@ (set! (-> s5-0 p1 x) (* 4096.0 (the float (-> v1-8 x)))) (set! (-> s5-0 p1 z) (* 4096.0 (the float (-> v1-8 z)))) ) - (let ((f0-11 (vector-segment-distance-point! (-> obj orig-goal-pos) (-> s5-0 p0) (-> s5-0 p1) (the-as vector #f))) + (let ((f0-11 (vector-segment-distance-point! (-> this orig-goal-pos) (-> s5-0 p0) (-> s5-0 p1) (the-as vector #f))) (f1-8 (-> s5-0 best-dist)) ) (cond @@ -830,7 +831,12 @@ (set! s2-0 (&-> s2-0 1)) ) ) - (update-node-flags-for-conn obj (the-as int (-> s5-0 start-conn-id)) (trail-node-flag tnf1) (trail-node-flag)) + (update-node-flags-for-conn + this + (the-as int (-> s5-0 start-conn-id)) + (trail-node-flag tnf1) + (trail-node-flag) + ) (countdown (v1-20 (-> s5-0 best-count)) (let ((a1-14 (-> s4-0 (-> s5-0 best-node-id v1-20)))) (when (= (logand (-> a1-14 flags) (trail-node-flag tnf0 tnf1)) (trail-node-flag tnf0 tnf1)) @@ -841,15 +847,20 @@ ) (set! s4-1 #f) (label cfg-22) - (update-node-flags-for-conn obj (the-as int (-> s5-0 start-conn-id)) (trail-node-flag) (trail-node-flag tnf1)) + (update-node-flags-for-conn + this + (the-as int (-> s5-0 start-conn-id)) + (trail-node-flag) + (trail-node-flag tnf1) + ) ) s4-1 ) -(defmethod do-search! trail-graph ((obj trail-graph) (arg0 vector) (arg1 vector) (arg2 trail-cached-search-info)) - (reset-search-state obj) - (+! (-> obj search-id) 1) - (set! (-> obj orig-start-pos quad) (-> arg0 quad)) +(defmethod do-search! trail-graph ((this trail-graph) (arg0 vector) (arg1 vector) (arg2 trail-cached-search-info)) + (reset-search-state this) + (+! (-> this search-id) 1) + (set! (-> this orig-start-pos quad) (-> arg0 quad)) (let ((a1-1 -1)) (when arg2 (let ((v1-6 (-> arg2 goal-conn-id))) @@ -859,21 +870,21 @@ (= (-> arg2 orig-goal-pos z) (-> arg1 z)) ) (set! a1-1 v1-6) - (set! (-> obj conn-goal-pos quad) (-> arg2 conn-goal-pos quad)) + (set! (-> this conn-goal-pos quad) (-> arg2 conn-goal-pos quad)) ) ) ) - (set! (-> obj orig-goal-pos quad) (-> arg1 quad)) + (set! (-> this orig-goal-pos quad) (-> arg1 quad)) (when (< a1-1 0) - (set! a1-1 (do-path obj (-> obj orig-goal-pos) (-> obj conn-goal-pos))) + (set! a1-1 (do-path this (-> this orig-goal-pos) (-> this conn-goal-pos))) (when arg2 (set! (-> arg2 goal-conn-id) a1-1) - (set! (-> arg2 orig-goal-pos quad) (-> obj orig-goal-pos quad)) - (set! (-> arg2 conn-goal-pos quad) (-> obj conn-goal-pos quad)) + (set! (-> arg2 orig-goal-pos quad) (-> this orig-goal-pos quad)) + (set! (-> arg2 conn-goal-pos quad) (-> this conn-goal-pos quad)) ) ) - (set! (-> obj goal-conn-id) a1-1) - (update-node-flags-for-conn obj a1-1 (trail-node-flag tnf0) (trail-node-flag)) + (set! (-> this goal-conn-id) a1-1) + (update-node-flags-for-conn this a1-1 (trail-node-flag tnf0) (trail-node-flag)) ) (let ((v1-17 -1)) (let ((a0-16 (-> *game-info* features))) @@ -890,14 +901,14 @@ (set! v1-17 (logand -9 v1-17)) ) ) - (set! (-> obj conn-mask) (the-as uint v1-17)) + (set! (-> this conn-mask) (the-as uint v1-17)) ) - (let ((s5-1 (do-path obj (-> obj orig-start-pos) (-> obj conn-start-pos)))) - (trail-graph-method-10 obj s5-1) - (let ((a2-5 (-> obj open-head-id))) - (if (and (logtest? (-> obj node a2-5 flags) (trail-node-flag tnf0)) (trail-graph-method-19 obj s5-1 a2-5)) - (set! (-> obj mode) (the-as uint 3)) - (set! (-> obj mode) (the-as uint 1)) + (let ((s5-1 (do-path this (-> this orig-start-pos) (-> this conn-start-pos)))) + (trail-graph-method-10 this s5-1) + (let ((a2-5 (-> this open-head-id))) + (if (and (logtest? (-> this node a2-5 flags) (trail-node-flag tnf0)) (trail-graph-method-19 this s5-1 a2-5)) + (set! (-> this mode) (the-as uint 3)) + (set! (-> this mode) (the-as uint 1)) ) ) ) diff --git a/goal_src/jak2/levels/city/ctyport-obs.gc b/goal_src/jak2/levels/city/ctyport-obs.gc index 0e12415754..49ad03f8cb 100644 --- a/goal_src/jak2/levels/city/ctyport-obs.gc +++ b/goal_src/jak2/levels/city/ctyport-obs.gc @@ -140,7 +140,7 @@ ) -(defmethod boat-base-method-144 boat-base ((obj boat-base) (arg0 nav-control)) +(defmethod boat-base-method-144 boat-base ((this boat-base) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -202,26 +202,26 @@ ) ) -(defmethod boat-base-method-145 boat-base ((obj boat-base) (arg0 nav-control)) +(defmethod boat-base-method-145 boat-base ((this boat-base) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 (none) ) -(defmethod boat-base-method-146 boat-base ((obj boat-base) (arg0 nav-control)) +(defmethod boat-base-method-146 boat-base ((this boat-base) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg0 state)) 0 (none) ) -(defmethod boat-base-method-147 boat-base ((obj boat-base) (arg0 nav-control)) +(defmethod boat-base-method-147 boat-base ((this boat-base) (arg0 nav-control)) (update-travel-dir-from-spheres (-> arg0 state)) 0 (none) ) -(defmethod boat-base-method-148 boat-base ((obj boat-base) (arg0 nav-control)) +(defmethod boat-base-method-148 boat-base ((this boat-base) (arg0 nav-control)) (compute-speed-simple (-> arg0 state)) 0 (none) @@ -345,42 +345,42 @@ ) ) -(defmethod apply-damage boat-base ((obj boat-base) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage boat-base ((this boat-base) (arg0 float) (arg1 rigid-body-impact)) 0 (none) ) -(defmethod rigid-body-object-method-47 boat-base ((obj boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) - ((method-of-type vehicle rigid-body-object-method-47) obj arg0 arg1 arg2 arg3) +(defmethod rigid-body-object-method-47 boat-base ((this boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + ((method-of-type vehicle rigid-body-object-method-47) this arg0 arg1 arg2 arg3) #f ) -(defmethod vehicle-method-120 boat-base ((obj boat-base)) +(defmethod vehicle-method-120 boat-base ((this boat-base)) (let ((t9-0 (method-of-type vehicle vehicle-method-120))) - (t9-0 obj) + (t9-0 this) ) - (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) - (let ((a1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (when (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) + (let ((a1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'quaternion)) ) (quaternion-from-two-vectors-max-angle! s5-0 a1-1 *up-vector* (* 728.1778 (seconds-per-frame))) - (quaternion*! (-> obj root quat) s5-0 (-> obj root quat)) + (quaternion*! (-> this root quat) s5-0 (-> this root quat)) ) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (new 'stack-no-clear 'vector) - (let ((a1-4 (-> obj nav state))) + (let ((a1-4 (-> this nav state))) (set! (-> s4-0 quad) (-> a1-4 velocity quad)) ) (let ((s1-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) ) - (let ((s0-0 (-> obj nav state current-poly))) + (let ((s0-0 (-> this nav state current-poly))) (vector-xz-normalize-copy! s1-0 s4-0 163840.0) (set! (-> s2-0 quad) (-> s1-0 quad)) - (clamp-vector-to-mesh-no-gaps (-> obj nav) (-> obj root trans) s0-0 s2-0 s3-0) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s0-0 s2-0 s3-0) ) (when (-> s3-0 found-boundary) (let ((f30-0 (vector-length s4-0))) @@ -388,53 +388,53 @@ (vector-rotate90-around-y! s4-0 (-> s3-0 boundary-normal)) (vector-normalize! s4-0 f30-0) ) - (when (= obj *debug-actor*) - (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj root trans) s4-0 (meters 10) *color-blue*) + (when (= this *debug-actor*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this root trans) s4-0 (meters 10) *color-blue*) (format *stdcon* "avoid border~%") ) ) ) - (set! (-> obj y-rot) (- (-> obj y-rot) (* 2.0 (seconds-per-frame) (-> obj y-rot)))) - (+! (-> obj y-rot) + (set! (-> this y-rot) (- (-> this y-rot) (* 2.0 (seconds-per-frame) (-> this y-rot)))) + (+! (-> this y-rot) (* 10.0 (seconds-per-frame) - (deg- (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> obj root quat))) (-> obj y-rot)) + (deg- (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> this root quat))) (-> this y-rot)) ) ) - (set! (-> obj y-rot) (fmax -10922.667 (fmin 10922.667 (-> obj y-rot)))) - (set! (-> obj y-rot) (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> obj root quat)))) - (quaternion-rotate-local-y! (-> obj root quat) (-> obj root quat) (* (-> obj y-rot) (seconds-per-frame))) - (vector-v*float+! (-> obj root trans) (-> obj root trans) s5-1 8954.266) + (set! (-> this y-rot) (fmax -10922.667 (fmin 10922.667 (-> this y-rot)))) + (set! (-> this y-rot) (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> this root quat)))) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) (* (-> this y-rot) (seconds-per-frame))) + (vector-v*float+! (-> this root trans) (-> this root trans) s5-1 8954.266) ) - (seek! (-> obj root trans y) 4096.0 (* 4096.0 (seconds-per-frame))) - (when (= obj *debug-actor*) + (seek! (-> this root trans y) 4096.0 (* 4096.0 (seconds-per-frame))) + (when (= this *debug-actor*) (format *stdcon* "no physics~%") - (format *stdcon* "~M~%" (-> obj root trans y)) + (format *stdcon* "~M~%" (-> this root trans y)) ) ) - (if (= obj *debug-actor*) - (format *stdcon* "speed ~M~%" (vector-length (-> obj root transv))) + (if (= this *debug-actor*) + (format *stdcon* "speed ~M~%" (vector-length (-> this root transv))) ) - (let ((s4-2 (ppointer->process (-> obj parent))) + (let ((s4-2 (ppointer->process (-> this parent))) (s5-2 (new 'stack-no-clear 'vector)) ) (when s4-2 - (let ((a1-24 (-> obj nav state))) + (let ((a1-24 (-> this nav state))) (set! (-> s5-2 quad) (-> a1-24 target-post quad)) ) - (when (< (vector-vector-xz-distance (-> obj root trans) s5-2) 163840.0) - (+! (-> obj path-index) 0.01) - (let ((f0-22 (-> obj path-index))) - (set! (-> obj path-index) (- f0-22 (* (the float (the int (/ f0-22 1.0))) 1.0))) + (when (< (vector-vector-xz-distance (-> this root trans) s5-2) 163840.0) + (+! (-> this path-index) 0.01) + (let ((f0-22 (-> this path-index))) + (set! (-> this path-index) (- f0-22 (* (the float (the int (/ f0-22 1.0))) 1.0))) ) ) (get-point-at-percent-along-path! - (-> (the-as boat-manager (+ (* (-> obj path-num) 4) (the-as uint s4-2))) paths 0) + (-> (the-as boat-manager (+ (* (-> this path-num) 4) (the-as uint s4-2))) paths 0) s5-2 - (-> obj path-index) + (-> this path-index) 'interp ) - (let ((v1-76 (-> obj nav state))) + (let ((v1-76 (-> this nav state))) (logclear! (-> v1-76 flags) (nav-state-flag directional-mode)) (logior! (-> v1-76 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-76 target-post quad) (-> s5-2 quad)) @@ -442,11 +442,11 @@ 0 ) ) - (draw-thrusters obj) + (draw-thrusters this) (none) ) -(defmethod rigid-body-object-method-29 boat-base ((obj boat-base) (arg0 float)) +(defmethod rigid-body-object-method-29 boat-base ((this boat-base) (arg0 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -455,18 +455,18 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s3-0 (-> obj rbody)) - (s2-0 (-> obj info)) + (let ((s3-0 (-> this rbody)) + (s2-0 (-> this info)) (s4-0 (new 'stack-no-clear 'matrix)) ) - (let ((a1-1 (-> obj nav state))) + (let ((a1-1 (-> this nav state))) (set! (-> s4-0 vector 1 quad) (-> a1-1 velocity quad)) ) (vector-! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) (-> s3-0 state lin-velocity)) (vector-float*! (the-as vector (-> s4-0 vector)) (the-as vector (-> s4-0 vector)) (* 4.0 (-> s2-0 info mass))) (let ((s1-0 (-> s4-0 vector 2))) - (let ((s0-0 (-> obj root trans))) - (let ((v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s0-0 (-> this root trans))) + (let ((v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-6 40960.0)) (.mov vf7 a0-6) ) @@ -481,7 +481,7 @@ ) (let ((s0-1 (-> s4-0 vector 2))) (let ((s1-1 (-> s4-0 vector 2))) - (let ((v1-9 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((v1-9 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-9 -32768.0)) (.mov vf7 a0-9) ) @@ -506,70 +506,70 @@ (rigid-body-method-20 (-> s3-0 state) (the-as vector a1-10)) ) ) - (rigid-body-object-method-50 obj arg0) - (vehicle-method-99 obj arg0) + (rigid-body-object-method-50 this arg0) + (vehicle-method-99 this arg0) (none) ) ) -(defmethod vehicle-method-96 boat-base ((obj boat-base)) +(defmethod vehicle-method-96 boat-base ((this boat-base)) 0 (none) ) -(defmethod do-engine-sounds boat-base ((obj boat-base)) +(defmethod do-engine-sounds boat-base ((this boat-base)) 0 (none) ) -(defmethod vehicle-method-135 boat-base ((obj boat-base) (arg0 traffic-object-spawn-params)) - (get-nav-control obj (-> arg0 nav-mesh)) - (set! (-> obj nav callback-info) *boat-nav-callback-info*) - (logior! (-> obj nav flags) (nav-control-flag display-marks limit-rotation-rate update-heading-from-facing)) - (let ((v1-4 (-> obj nav))) +(defmethod vehicle-method-135 boat-base ((this boat-base) (arg0 traffic-object-spawn-params)) + (get-nav-control this (-> arg0 nav-mesh)) + (set! (-> this nav callback-info) *boat-nav-callback-info*) + (logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate update-heading-from-facing)) + (let ((v1-4 (-> this nav))) (set! (-> v1-4 target-speed) 40960.0) ) 0 - (let ((v1-6 (-> obj nav))) + (let ((v1-6 (-> this nav))) (set! (-> v1-6 acceleration) 8192.0) ) 0 - (let ((v1-8 (-> obj nav))) + (let ((v1-8 (-> this nav))) (set! (-> v1-8 turning-acceleration) 8192.0) ) 0 - (let ((v1-10 (-> obj nav))) + (let ((v1-10 (-> this nav))) (set! (-> v1-10 max-rotation-rate) 9102.223) ) 0 - (let ((v1-12 (-> obj nav))) + (let ((v1-12 (-> this nav))) (set! (-> v1-12 nav-cull-radius) 122880.0) ) 0 - (let ((v1-14 (-> obj nav))) + (let ((v1-14 (-> this nav))) (set! (-> v1-14 sphere-mask) (the-as uint 64)) ) 0 - (set! (-> obj path-num) (-> arg0 user-data)) - (set! (-> obj path-index) (+ 0.05 (-> arg0 position w))) - (logior! (-> obj root root-prim prim-core collide-as) (collide-spec pusher)) - (let ((v1-21 (-> obj root root-prim))) - (set! (-> obj root backup-collide-as) (-> v1-21 prim-core collide-as)) - (set! (-> obj root backup-collide-with) (-> v1-21 prim-core collide-with)) + (set! (-> this path-num) (-> arg0 user-data)) + (set! (-> this path-index) (+ 0.05 (-> arg0 position w))) + (logior! (-> this root root-prim prim-core collide-as) (collide-spec pusher)) + (let ((v1-21 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-21 prim-core collide-with)) ) 0 (none) ) -(defmethod alloc-and-init-rigid-body-control boat-base ((obj boat-base) (arg0 rigid-body-vehicle-constants)) - ((method-of-type vehicle alloc-and-init-rigid-body-control) obj arg0) +(defmethod alloc-and-init-rigid-body-control boat-base ((this boat-base) (arg0 rigid-body-vehicle-constants)) + ((method-of-type vehicle alloc-and-init-rigid-body-control) this arg0) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-113 boat-base ((obj boat-base)) - (go (method-of-object obj idle)) +(defmethod vehicle-method-113 boat-base ((this boat-base)) + (go (method-of-object this idle)) (none) ) @@ -598,7 +598,7 @@ :event vehicle-event-handler :enter (behavior () (logior! (-> self flags) (rigid-body-object-flag riding)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () '() @@ -628,7 +628,7 @@ ) -(defmethod vehicle-method-120 barge ((obj barge)) +(defmethod vehicle-method-120 barge ((this barge)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -638,11 +638,11 @@ ) (init-vf0-vector) (let ((t9-0 (method-of-type boat-base vehicle-method-120))) - (t9-0 obj) + (t9-0 this) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (let ((s4-0 (-> obj root trans))) - (let ((v1-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s4-0 (-> this root trans))) + (let ((v1-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-4 -61440.0)) (.mov vf7 a0-4) ) @@ -657,17 +657,17 @@ (cond ((< (vector-vector-distance s5-0 (camera-pos)) 614400.0) (let ((a0-6 (static-sound-spec "barge-engine"))) - (sound-play-by-spec a0-6 (-> obj engine) s5-0) + (sound-play-by-spec a0-6 (-> this engine) s5-0) ) ) (else - (sound-stop (-> obj engine)) + (sound-stop (-> this engine)) ) ) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (let ((s4-2 (-> obj root trans))) - (let ((v1-9 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s4-2 (-> this root trans))) + (let ((v1-9 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-10 61440.0)) (.mov vf7 a0-10) ) @@ -682,11 +682,11 @@ (cond ((< (vector-vector-distance s5-1 (camera-pos)) 614400.0) (let ((a0-12 (static-sound-spec "bow-wash"))) - (sound-play-by-spec a0-12 (-> obj bow-wash) s5-1) + (sound-play-by-spec a0-12 (-> this bow-wash) s5-1) ) ) (else - (sound-stop (-> obj bow-wash)) + (sound-stop (-> this bow-wash)) ) ) ) @@ -694,8 +694,8 @@ ) ) -(defmethod allocate-and-init-cshape barge ((obj barge)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape barge ((this barge)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -808,24 +808,24 @@ (set! (-> s5-0 backup-collide-as) (-> v1-49 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-49 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-skel-and-rigid-body barge ((obj barge)) +(defmethod init-skel-and-rigid-body barge ((this barge)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-barge" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *barge-constants*) - (set! (-> obj draw lod-set lod 0 dist) 1228800.0) - (set! (-> obj engine) (new-sound-id)) - (set! (-> obj bow-wash) (new-sound-id)) + (alloc-and-init-rigid-body-control this *barge-constants*) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this engine) (new-sound-id)) + (set! (-> this bow-wash) (new-sound-id)) (iterate-prims - (-> obj root) + (-> this root) (lambda ((arg0 collide-shape-prim)) (case (-> arg0 prim-core prim-type) (((prim-type sphere)) @@ -878,13 +878,13 @@ ) ;; WARN: Return type mismatch process vs boat-manager. -(defmethod relocate boat-manager ((obj boat-manager) (arg0 int)) +(defmethod relocate boat-manager ((this boat-manager) (arg0 int)) (dotimes (v1-0 4) - (if (-> obj paths v1-0) - (&+! (-> obj paths v1-0) arg0) + (if (-> this paths v1-0) + (&+! (-> this paths v1-0) arg0) ) ) - (the-as boat-manager ((method-of-type process relocate) obj arg0)) + (the-as boat-manager ((method-of-type process relocate) this arg0)) ) (defstate idle (boat-manager) @@ -908,21 +908,21 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! boat-manager ((obj boat-manager) (arg0 entity-actor)) +(defmethod init-from-entity! boat-manager ((this boat-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) - (set! (-> obj entity) arg0) - (when (-> obj mesh) + (set! (-> this mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) + (set! (-> this entity) arg0) + (when (-> this mesh) (dotimes (s5-1 4) - (set! (-> obj paths s5-1) (new 'process 'curve-control obj 'path (the float s5-1))) - (when (-> obj paths s5-1) - (logior! (-> obj paths s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) - (let ((s4-0 (-> obj paths s5-1)) + (set! (-> this paths s5-1) (new 'process 'curve-control this 'path (the float s5-1))) + (when (-> this paths s5-1) + (logior! (-> this paths s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s4-0 (-> this paths s5-1)) (s3-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (f30-0 0.0) @@ -936,13 +936,13 @@ This commonly includes things such as: (let ((s1-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> s1-0 behavior) (the-as uint 1)) (set! (-> s1-0 id) (the-as uint 0)) - (set! (-> s1-0 nav-mesh) (the-as nav-mesh (-> obj mesh))) + (set! (-> s1-0 nav-mesh) (the-as nav-mesh (-> this mesh))) (set! (-> s1-0 position quad) (-> s3-0 quad)) (quaternion-look-at! (-> s1-0 rotation) s2-0 *up-vector*) (set! (-> s1-0 user-data) (the-as uint s5-1)) (set! (-> s1-0 position w) f30-0) (logior! (-> s1-0 flags) (traffic-spawn-flags trsflags-00)) - (process->handle (vehicle-spawn obj barge s1-0)) + (process->handle (vehicle-spawn this barge s1-0)) ) (+! f30-0 (/ (* 4096.0 (+ 150.0 (* 150.0 (rand-vu)))) (total-distance s4-0))) ) @@ -950,6 +950,6 @@ This commonly includes things such as: ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/city/ctywide-obs.gc b/goal_src/jak2/levels/city/ctywide-obs.gc index 423fcf1b56..5828a1e418 100644 --- a/goal_src/jak2/levels/city/ctywide-obs.gc +++ b/goal_src/jak2/levels/city/ctywide-obs.gc @@ -39,149 +39,149 @@ :bounds (static-spherem 0 0 0 100.1) ) -(defmethod security-wall-method-23 security-wall ((obj security-wall)) - (when (< (-> obj next-message-time) (current-time)) - (set! (-> obj next-message-time) +(defmethod security-wall-method-23 security-wall ((this security-wall)) + (when (< (-> this next-message-time) (current-time)) + (set! (-> this next-message-time) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) ) (let ((v1-6 (rand-vu-int-count 15))) (cond ((zero? v1-6) - (case (-> obj pass) + (case (-> this pass) ((29) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) ) ((30) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) ) ((31) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) ) ((32) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) ) ) ) ((= v1-6 1) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) ) ((= v1-6 2) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) ) ((= v1-6 3) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) ) ((= v1-6 4) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) ) ((= v1-6 5) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv011" -99.0 0) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) ) ((= v1-6 6) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) ) ((= v1-6 7) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) ) ((= v1-6 8) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv014" -99.0 0) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) ) ((= v1-6 9) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) ) ((= v1-6 10) (let ((v1-45 (rand-vu-int-count 3))) (cond ((zero? v1-45) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv035" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv035" -99.0 0) ) ((= v1-45 1) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv038" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv038" -99.0 0) ) ((= v1-45 2) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv058" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv058" -99.0 0) ) ) ) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) ) ((= v1-6 11) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) (let ((v1-57 (rand-vu-int-count 3))) (cond ((zero? v1-57) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv035" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv035" -99.0 0) ) ((= v1-57 1) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv038" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv038" -99.0 0) ) ((= v1-57 2) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv058" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv058" -99.0 0) ) ) ) ) ((= v1-6 12) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv014" -99.0 0) - (case (-> obj pass) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (case (-> this pass) ((29) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) ) ((30) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) ) ((31) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) ) ((32) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) ) ) ) ((= v1-6 13) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv011" -99.0 0) - (case (-> obj pass) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (case (-> this pass) ((29) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) ) ((30) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) ) ((31) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) ) ((32) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) ) ) ) ((= v1-6 14) - (case (-> obj pass) + (case (-> this pass) ((29) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) ) ((30) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) ) ((31) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) ) ((32) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) ) ) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) ) ) ) - (+! (-> obj message) 1) - (when (>= (-> obj message) 5) - (set! (-> obj message) 0) + (+! (-> this message) 1) + (when (>= (-> this message) 5) + (set! (-> this message) 0) 0 ) ) @@ -189,33 +189,33 @@ (none) ) -(defmethod security-wall-method-24 security-wall ((obj security-wall)) +(defmethod security-wall-method-24 security-wall ((this security-wall)) (let ((s4-0 *target*)) (when s4-0 - (let* ((f0-0 (vector-vector-distance-squared (-> obj root trans) (-> s4-0 control trans))) - (f30-0 (+ 40960.0 (-> obj root root-prim local-sphere w))) + (let* ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> s4-0 control trans))) + (f30-0 (+ 40960.0 (-> this root root-prim local-sphere w))) (f1-1 f30-0) ) (when (< f0-0 (* f1-1 f1-1)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1))) (set! (-> s5-0 0 quad) (-> s4-0 control trans quad)) - (when (< (vector-vector-distance-squared (-> obj root trans) (-> obj target-pos)) (* f30-0 f30-0)) - (let ((f0-3 (vector4-dot (-> obj target-pos) (the-as vector (-> obj plane)))) - (f1-7 (vector4-dot (-> s5-0 0) (the-as vector (-> obj plane)))) + (when (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) (* f30-0 f30-0)) + (let ((f0-3 (vector4-dot (-> this target-pos) (the-as vector (-> this plane)))) + (f1-7 (vector4-dot (-> s5-0 0) (the-as vector (-> this plane)))) ) (if (and (< (fabs f1-7) 16384.0) (< (fabs f0-3) 16384.0) (or (and (< f0-3 0.0) (>= f1-7 0.0)) (and (< f1-7 0.0) (>= f0-3 0.0))) ) - (set! (-> obj breach) #t) + (set! (-> this breach) #t) ) ) ) - (set! (-> obj target-pos quad) (-> s5-0 0 quad)) + (set! (-> this target-pos quad) (-> s5-0 0 quad)) ) - (when (-> obj breach) + (when (-> this breach) (if (send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'grenade)))) - (set! (-> obj breach) #f) + (set! (-> this breach) #f) ) ) ) @@ -471,7 +471,7 @@ ) ) -(defmethod security-wall-method-22 security-wall ((obj security-wall) (arg0 path-control) (arg1 float)) +(defmethod security-wall-method-22 security-wall ((this security-wall) (arg0 path-control) (arg1 float)) (let ((s4-0 (new 'static 'vector)) (s3-0 (new 'static 'vector)) ) @@ -479,7 +479,7 @@ (get-point-in-path! arg0 s4-0 0.0 'exact) (get-point-in-path! arg0 s3-0 1.0 'exact) (* 0.5 (vector-vector-distance s4-0 s3-0)) - (let ((s2-1 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s2-1 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-7 (new 'process 'collide-shape-prim-mesh s2-1 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-7 prim-core collide-as) (collide-spec blocking-plane camera-blocker)) (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list)) @@ -493,10 +493,10 @@ (set! (-> s2-1 backup-collide-as) (-> v1-10 prim-core collide-as)) (set! (-> s2-1 backup-collide-with) (-> v1-10 prim-core collide-with)) ) - (set! (-> obj root) s2-1) + (set! (-> this root) s2-1) ) (let ((s2-2 (new 'stack-no-clear 'matrix)) - (s1-0 (-> obj root)) + (s1-0 (-> this root)) ) (vector+! (-> s1-0 trans) s4-0 s3-0) (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) @@ -510,9 +510,9 @@ (vector-cross! (-> s2-2 vector 2) (the-as vector (-> s2-2 vector)) (-> s2-2 vector 1)) (vector-normalize! (-> s2-2 vector 2) 1.0) (matrix->quaternion (-> s1-0 quat) s2-2) - (set! (-> obj plane quad) (-> s2-2 vector 2 quad)) - (set! (-> obj plane w) (- (vector-dot (-> s2-2 vector 2) (-> obj root trans)))) - (let ((v0-8 (-> obj root root-prim local-sphere))) + (set! (-> this plane quad) (-> s2-2 vector 2 quad)) + (set! (-> this plane w) (- (vector-dot (-> s2-2 vector 2) (-> this root trans)))) + (let ((v0-8 (-> this root root-prim local-sphere))) (set! (-> v0-8 x) 0.0) (set! (-> v0-8 y) (* 0.00024414062 (* 0.5 arg1))) (set! (-> v0-8 z) 0.0) @@ -530,7 +530,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! security-wall ((obj security-wall) (arg0 entity-actor)) +(defmethod init-from-entity! security-wall ((this security-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -538,50 +538,50 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (ctywide-entity-hack) - (set! (-> obj breach) #f) - (set! (-> obj pass) (res-lump-value arg0 'pickup-type int :time -1000000000.0)) - (let ((v1-3 (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f))) - (set! (-> obj path) v1-3) + (set! (-> this breach) #f) + (set! (-> this pass) (res-lump-value arg0 'pickup-type int :time -1000000000.0)) + (let ((v1-3 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))) + (set! (-> this path) v1-3) (if (or (not v1-3) (!= (-> v1-3 curve num-cverts) 2)) (go process-drawable-art-error "bad path") ) ) - (security-wall-method-22 obj (-> obj path) 122880.0) + (security-wall-method-22 this (-> this path) 122880.0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-security-wall" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj root event-self) 'touched) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (logior! (-> obj draw status) (draw-control-status disable-fog)) - (set-security-texture-masks! (the-as vector (-> obj draw mgeo header texture-usage-group data 4))) - (set-vector! (-> obj color) 1.0 1.0 1.0 1.0) + (set! (-> this root event-self) 'touched) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this draw status) (draw-control-status disable-fog)) + (set-security-texture-masks! (the-as vector (-> this draw mgeo header texture-usage-group data 4))) + (set-vector! (-> this color) 1.0 1.0 1.0 1.0) (cond - ((= (-> obj pass) 29) - (set-vector! (-> obj color) 1.0 0.0 0.0 1.0) + ((= (-> this pass) 29) + (set-vector! (-> this color) 1.0 0.0 0.0 1.0) ) - ((= (-> obj pass) 31) - (set-vector! (-> obj color) 1.0 1.0 0.0 1.0) + ((= (-> this pass) 31) + (set-vector! (-> this color) 1.0 1.0 0.0 1.0) ) - ((= (-> obj pass) 30) - (set-vector! (-> obj color) 0.0 1.0 0.0 1.0) + ((= (-> this pass) 30) + (set-vector! (-> this color) 0.0 1.0 0.0 1.0) ) - ((= (-> obj pass) 32) - (set-vector! (-> obj color) 0.0 0.0 1.0 1.0) + ((= (-> this pass) 32) + (set-vector! (-> this color) 0.0 0.0 1.0 1.0) ) ) - (set-security-color! (-> obj color)) - (set-vector! (-> obj draw color-mult) 0.0 0.0 0.0 0.0) - (set-vector! (-> obj draw color-emissive) 1.0 1.0 1.0 1.0) + (set-security-color! (-> this color)) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.0 0.0) + (set-vector! (-> this draw color-emissive) 1.0 1.0 1.0 1.0) (transform-post) - (if (or (and (logtest? (game-feature pass-red) (-> *game-info* features)) (= 29 (-> obj pass))) - (and (logtest? (game-feature pass-green) (-> *game-info* features)) (= 30 (-> obj pass))) - (and (logtest? (game-feature pass-yellow) (-> *game-info* features)) (= 31 (-> obj pass))) - (and (logtest? (game-feature pass-blue) (-> *game-info* features)) (= 32 (-> obj pass))) + (if (or (and (logtest? (game-feature pass-red) (-> *game-info* features)) (= 29 (-> this pass))) + (and (logtest? (game-feature pass-green) (-> *game-info* features)) (= 30 (-> this pass))) + (and (logtest? (game-feature pass-yellow) (-> *game-info* features)) (= 31 (-> this pass))) + (and (logtest? (game-feature pass-blue) (-> *game-info* features)) (= 32 (-> this pass))) ) - (go (method-of-object obj idle-open)) - (go (method-of-object obj idle-close)) + (go (method-of-object this idle-open)) + (go (method-of-object this idle-close)) ) (none) ) @@ -952,8 +952,8 @@ This commonly includes things such as: ) ) -(defmethod fruit-stand-method-28 fruit-stand ((obj fruit-stand)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod fruit-stand-method-28 fruit-stand ((this fruit-stand)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -973,36 +973,36 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod fruit-stand-method-29 fruit-stand ((obj fruit-stand)) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 185) obj)) +(defmethod fruit-stand-method-29 fruit-stand ((this fruit-stand)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 185) this)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fruit-stand ((obj fruit-stand) (arg0 entity-actor)) +(defmethod init-from-entity! fruit-stand ((this fruit-stand) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (fruit-stand-method-28 obj) - (process-drawable-from-entity! obj arg0) + (fruit-stand-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fruit-stand" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (fruit-stand-method-29 obj) - (go (method-of-object obj idle)) + (fruit-stand-method-29 this) + (go (method-of-object this idle)) (none) ) @@ -1374,13 +1374,13 @@ This commonly includes things such as: ) ) -(defmethod get-trans cty-guard-turret ((obj cty-guard-turret) (arg0 int)) +(defmethod get-trans cty-guard-turret ((this cty-guard-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((v1-0 (-> obj root))) + (let ((v1-0 (-> this root))) (cond ((= arg0 3) - (let ((v0-0 (vector<-cspace! (new 'static 'vector) (-> obj node-list data 6)))) - (set! (-> v0-0 w) (-> obj root root-prim prim-core world-sphere w)) + (let ((v0-0 (vector<-cspace! (new 'static 'vector) (-> this node-list data 6)))) + (set! (-> v0-0 w) (-> this root root-prim prim-core world-sphere w)) v0-0 ) ) @@ -1391,7 +1391,7 @@ This commonly includes things such as: ) ) -(defmethod get-inv-mass cty-guard-turret ((obj cty-guard-turret)) +(defmethod get-inv-mass cty-guard-turret ((this cty-guard-turret)) 0.01 ) @@ -1534,7 +1534,7 @@ This commonly includes things such as: ) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 2)) + (until (time-elapsed? gp-0 (seconds 2)) (let ((a1-1 (new 'stack-no-clear 'vector))) (set! (-> a1-1 quad) (-> self root trans quad)) (+! (-> a1-1 y) 10240.0) @@ -1578,7 +1578,7 @@ This commonly includes things such as: (ja :num! (seek! 32.0 0.5)) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 3)) + (until (time-elapsed? gp-1 (seconds 3)) (suspend) ) ) @@ -1726,7 +1726,7 @@ This commonly includes things such as: (ja :num! (seek! (ja-aframe 32.0 0))) ) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 5)) + (until (time-elapsed? gp-4 (seconds 5)) (suspend) ) ) @@ -1740,7 +1740,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod cty-guard-turret-method-34 cty-guard-turret ((obj cty-guard-turret)) +(defmethod cty-guard-turret-method-34 cty-guard-turret ((this cty-guard-turret)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1749,8 +1749,8 @@ This commonly includes things such as: (vf7 :class vf) ) (init-vf0-vector) - (let ((s2-0 (-> obj node-list data 7 bone transform)) - (s5-0 (-> obj node-list data 8 bone transform)) + (let ((s2-0 (-> this node-list data 7 bone transform)) + (s5-0 (-> this node-list data 8 bone transform)) (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) (let ((s1-0 (new 'stack-no-clear 'vector)) @@ -1788,12 +1788,12 @@ This commonly includes things such as: (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-3 quad) vf6) ) - (set! (-> s4-0 ent) (-> obj entity)) + (set! (-> s4-0 ent) (-> this entity)) (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options)) - (set! (-> s4-0 notify-handle) (process->handle obj)) + (set! (-> s4-0 notify-handle) (process->handle this)) (set! (-> s4-0 owner-handle) (the-as handle #f)) - (set! (-> s4-0 ignore-handle) (process->handle obj)) + (set! (-> s4-0 ignore-handle) (process->handle this)) (let* ((v1-14 *game-info*) (a0-14 (+ (-> v1-14 attack-id) 1)) ) @@ -1804,18 +1804,18 @@ This commonly includes things such as: (set! (-> s4-0 pos quad) (-> s1-0 quad)) (set! (-> s4-0 vel quad) (-> s2-0 vector 2 quad)) (vector-normalize! (-> s4-0 vel) 819200.0) - (spawn-projectile guard-shot s4-0 obj *default-dead-pool*) + (spawn-projectile guard-shot s4-0 this *default-dead-pool*) (set! (-> s4-0 pos quad) (-> s3-0 quad)) ) (vector-negate! (-> s4-0 vel) (-> s5-0 vector 2)) (vector-normalize! (-> s4-0 vel) 819200.0) - (spawn-projectile guard-shot s4-0 obj *default-dead-pool*) + (spawn-projectile guard-shot s4-0 this *default-dead-pool*) ) (none) ) ) -(defmethod cty-guard-turret-method-35 cty-guard-turret ((obj cty-guard-turret)) +(defmethod cty-guard-turret-method-35 cty-guard-turret ((this cty-guard-turret)) (local-vars (sv-192 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1825,12 +1825,12 @@ This commonly includes things such as: (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (handle->process (-> obj focus handle)))) + (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) (let ((s0-0 (new 'stack-no-clear 'vector))) - (let ((v1-8 (-> obj root trans))) + (let ((v1-8 (-> this root trans))) (let ((a0-5 *y-vector*)) (let ((a1-3 10240.0)) (.mov vf7 a1-3) @@ -1862,13 +1862,13 @@ This commonly includes things such as: (.svf (&-> a0-7 quad) vf6) ) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 s0-0)) - (s1-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (s1-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (set! sv-192 (new 'stack-no-clear 'vector)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (-> obj node-list data 6 bone transform) - (-> obj node-list data 7 bone transform) - (-> obj node-list data 8 bone transform) + (-> this node-list data 6 bone transform) + (-> this node-list data 7 bone transform) + (-> this node-list data 8 bone transform) (vector-rotate90-around-y! sv-192 s3-1) (set! (-> sv-192 y) 0.0) (vector-normalize! sv-192 1.0) @@ -1902,27 +1902,27 @@ This commonly includes things such as: (set! (-> s4-1 y) (deg- (-> s2-0 y) (-> s0-1 y))) (cond ((focus-test? (the-as process-focusable s5-0) pilot) - (set! (-> obj angle-turret) (deg-seek (-> obj angle-turret) (-> s4-1 y) (* 36408.89 (seconds-per-frame)))) - (set! (-> obj angle-guns) (deg-seek (-> obj angle-guns) (-> s4-1 x) (* 7281.778 (seconds-per-frame)))) + (set! (-> this angle-turret) (deg-seek (-> this angle-turret) (-> s4-1 y) (* 36408.89 (seconds-per-frame)))) + (set! (-> this angle-guns) (deg-seek (-> this angle-guns) (-> s4-1 x) (* 7281.778 (seconds-per-frame)))) ) (else - (set! (-> obj angle-turret) (deg-seek (-> obj angle-turret) (-> s4-1 y) (* 18204.445 (seconds-per-frame)))) - (set! (-> obj angle-guns) (deg-seek (-> obj angle-guns) (-> s4-1 x) (* 7281.778 (seconds-per-frame)))) + (set! (-> this angle-turret) (deg-seek (-> this angle-turret) (-> s4-1 y) (* 18204.445 (seconds-per-frame)))) + (set! (-> this angle-guns) (deg-seek (-> this angle-guns) (-> s4-1 x) (* 7281.778 (seconds-per-frame)))) ) ) - (quaternion-axis-angle! (-> obj jm-turret quat) 0.0 1.0 0.0 (-> obj angle-turret)) - (when (= (+ (fabs (- (-> obj angle-turret) (-> s4-1 y))) (fabs (- (-> obj angle-guns) (-> s4-1 x)))) 0.0) - (set! (-> obj next-time-shot) (+ (current-time) (seconds 1))) - (set! (-> obj num-shots) (the-as uint 0)) + (quaternion-axis-angle! (-> this jm-turret quat) 0.0 1.0 0.0 (-> this angle-turret)) + (when (= (+ (fabs (- (-> this angle-turret) (-> s4-1 y))) (fabs (- (-> this angle-guns) (-> s4-1 x)))) 0.0) + (set! (-> this next-time-shot) (+ (current-time) (seconds 1))) + (set! (-> this num-shots) (the-as uint 0)) 0 ) ) (let ((s5-1 (new 'stack-no-clear 'quaternion))) (let ((f0-42 (/ 45511.11 (* 0.00024414062 f30-0)))) - (quaternion-axis-angle! s5-1 1.0 0.0 0.0 (fmax (fmin (-> obj angle-guns) f0-42) (- f0-42))) + (quaternion-axis-angle! s5-1 1.0 0.0 0.0 (fmax (fmin (-> this angle-guns) f0-42) (- f0-42))) ) (quaternion*! - (-> obj jm-gunsL quat) + (-> this jm-gunsL quat) (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (+ -16384.0 f28-1)) s5-1 ) @@ -1934,7 +1934,7 @@ This commonly includes things such as: ) ) ) - (quaternion-copy! (-> obj jm-gunsR quat) (-> obj jm-gunsL quat)) + (quaternion-copy! (-> this jm-gunsR quat) (-> this jm-gunsL quat)) ) ) ) @@ -1944,7 +1944,7 @@ This commonly includes things such as: :virtual #t :event cty-guard-turret-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self num-shots) (the-as uint 0)) 0 ) @@ -2020,24 +2020,27 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-focusable vs cty-guard-turret. -(defmethod relocate cty-guard-turret ((obj cty-guard-turret) (arg0 int)) - (if (nonzero? (-> obj jm-turret)) - (&+! (-> obj jm-turret) arg0) +(defmethod relocate cty-guard-turret ((this cty-guard-turret) (arg0 int)) + (if (nonzero? (-> this jm-turret)) + (&+! (-> this jm-turret) arg0) ) - (if (nonzero? (-> obj jm-gunsL)) - (&+! (-> obj jm-gunsL) arg0) + (if (nonzero? (-> this jm-gunsL)) + (&+! (-> this jm-gunsL) arg0) ) - (if (nonzero? (-> obj jm-gunsR)) - (&+! (-> obj jm-gunsR) arg0) + (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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method cty-guard-turret 7)) + this + arg0 + ) ) ) -(defmethod cty-guard-turret-method-32 cty-guard-turret ((obj cty-guard-turret)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod cty-guard-turret-method-32 cty-guard-turret ((this cty-guard-turret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2102,20 +2105,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-22 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod cty-guard-turret-method-33 cty-guard-turret ((obj cty-guard-turret)) - (logior! (-> obj mask) (process-mask enemy)) +(defmethod cty-guard-turret-method-33 cty-guard-turret ((this cty-guard-turret)) + (logior! (-> this mask) (process-mask enemy)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cty-guard-turret ((obj cty-guard-turret) (arg0 entity-actor)) +(defmethod init-from-entity! cty-guard-turret ((this cty-guard-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2124,26 +2127,26 @@ This commonly includes things such as: - sounds" (local-vars (v1-23 handle)) (with-pp - (cty-guard-turret-method-32 obj) - (set! (-> obj entity) arg0) - (process-drawable-from-entity! obj arg0) + (cty-guard-turret-method-32 this) + (set! (-> this entity) arg0) + (process-drawable-from-entity! this arg0) (ctywide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-guard-turret" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (cty-guard-turret-method-33 obj) - (reset-to-collide-spec (-> obj focus) (collide-spec jak player-list)) - (set! (-> obj jm-turret) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 6)) - (set! (-> obj jm-gunsL) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 7)) - (set! (-> obj jm-gunsR) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 8)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 186) obj)) - (set! (-> obj id) (res-lump-value arg0 'extra-id int :default (the-as uint128 -1) :time -1000000000.0)) - (set! (-> obj destroyed) #f) - (set! (-> obj hit-points) 6) + (cty-guard-turret-method-33 this) + (reset-to-collide-spec (-> this focus) (collide-spec jak player-list)) + (set! (-> this jm-turret) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 6)) + (set! (-> this jm-gunsL) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 7)) + (set! (-> this jm-gunsR) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 8)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 186) this)) + (set! (-> this id) (res-lump-value arg0 'extra-id int :default (the-as uint128 -1) :time -1000000000.0)) + (set! (-> this destroyed) #f) + (set! (-> this hit-points) 6) (cond - ((and (>= (-> obj id) 0) + ((and (>= (-> this id) 0) (begin (let ((v1-21 (-> *game-info* sub-task-list (game-task-node city-power-resolution)))) (set! v1-23 (if (-> v1-21 info) @@ -2164,8 +2167,8 @@ This commonly includes things such as: (set! (-> a1-11 from) (process->ppointer pp)) (set! (-> a1-11 num-params) 2) (set! (-> a1-11 message) 'guard-turret-status) - (set! (-> a1-11 param 0) (the-as uint (-> obj id))) - (set! (-> a1-11 param 1) (the-as uint (-> obj root trans))) + (set! (-> a1-11 param 0) (the-as uint (-> this id))) + (set! (-> a1-11 param 1) (the-as uint (-> this root trans))) (let* ((t9-12 send-event-function) (v1-33 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) (v1-38 (t9-12 @@ -2180,23 +2183,23 @@ This commonly includes things such as: ) (cond ((zero? v1-38) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-38 1) - (go (method-of-object obj wait-for-pushing)) + (go (method-of-object this wait-for-pushing)) ) ((= v1-38 2) - (go (method-of-object obj pushed)) + (go (method-of-object this pushed)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) ) ) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -2223,9 +2226,9 @@ This commonly includes things such as: ) -(defmethod parking-spot-method-24 parking-spot ((obj parking-spot)) +(defmethod parking-spot-method-24 parking-spot ((this parking-spot)) (let ((gp-0 (new 'stack-no-clear 'collide-query-with-2vec))) - (set! (-> gp-0 vec quad) (-> obj root trans quad)) + (set! (-> gp-0 vec quad) (-> this root trans quad)) (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec quad)) (vector-reset! (-> gp-0 vec2)) (set! (-> gp-0 vec2 y) 1.0) @@ -2242,45 +2245,45 @@ This commonly includes things such as: (when (>= f30-0 0.0) (vector+float*! (-> gp-0 vec) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) (set! (-> gp-0 vec2 quad) (-> gp-0 cquery best-other-tri normal quad)) - (set! (-> obj root trans quad) (-> gp-0 vec quad)) + (set! (-> this root trans quad) (-> gp-0 vec quad)) (format #t "parking-spot::find-ground: ground y ~M~%" (-> gp-0 vec y)) ) (if (< f30-0 0.0) (format #t "parking-spot::find-ground: could not find ground~%") ) ) - (set! (-> obj root trans quad) (-> gp-0 vec quad)) - (forward-up-nopitch->quaternion (-> obj root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec2)) + (set! (-> this root trans quad) (-> gp-0 vec quad)) + (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec2)) ) 0 (none) ) -(defmethod parking-spot-method-21 parking-spot ((obj parking-spot)) - (let ((s5-0 (handle->process (-> obj vehicle)))) +(defmethod parking-spot-method-21 parking-spot ((this parking-spot)) + (let ((s5-0 (handle->process (-> this vehicle)))) (cond (s5-0 (cond ((or (focus-test? (the-as vehicle s5-0) dead inactive) (not (logtest? (-> (the-as vehicle s5-0) flags) (rigid-body-object-flag waiting-for-player))) - (let ((f0-0 (-> obj test-sphere r))) - (< (* f0-0 f0-0) (vector-vector-distance-squared (-> (the-as vehicle s5-0) root trans) (-> obj test-sphere))) + (let ((f0-0 (-> this test-sphere r))) + (< (* f0-0 f0-0) (vector-vector-distance-squared (-> (the-as vehicle s5-0) root trans) (-> this test-sphere))) ) ) (logclear! (-> (the-as vehicle s5-0) flags) (rigid-body-object-flag persistent)) - (set! (-> obj vehicle) (the-as handle #f)) + (set! (-> this vehicle) (the-as handle #f)) ) (else - (if (not (-> obj minimap)) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 17) (the-as int #f) (the-as vector #t) 0)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 17) (the-as int #f) (the-as vector #t) 0)) ) ) ) ) (else - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) ) ) @@ -2289,13 +2292,13 @@ This commonly includes things such as: (none) ) -(defmethod parking-spot-method-23 parking-spot ((obj parking-spot) (arg0 uint)) +(defmethod parking-spot-method-23 parking-spot ((this parking-spot) (arg0 uint)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'collide-query 1))) (let* ((a0-1 (new 'stack-no-clear 'inline-array 'vector 1)) (a1-1 #x813f9) (a2-1 (logand -2 a1-1)) ) - (set! (-> a0-1 0 quad) (-> obj test-sphere quad)) + (set! (-> a0-1 0 quad) (-> this test-sphere quad)) (let ((a1-3 (-> v1-0 0))) (set! (-> a1-3 best-dist) (the-as float a0-1)) (set! (-> a1-3 num-spheres) (the-as uint 1)) @@ -2310,16 +2313,16 @@ This commonly includes things such as: 0 (when (not (fill-and-probe-using-spheres *collide-cache* (-> v1-0 0))) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 position quad) (-> obj root trans quad)) - (mem-copy! (the-as pointer (-> s4-0 rotation)) (the-as pointer (-> obj root quat)) 16) + (set! (-> s4-0 position quad) (-> this root trans quad)) + (mem-copy! (the-as pointer (-> s4-0 rotation)) (the-as pointer (-> this root quat)) 16) (+! (-> s4-0 position y) 14336.0) (set! (-> s4-0 behavior) (the-as uint 0)) (set! (-> s4-0 object-type) (the-as traffic-type arg0)) (set! (-> s4-0 id) (the-as uint 0)) (send-event *traffic-manager* 'activate-object s4-0) (when (-> s4-0 proc) - (set! (-> obj vehicle) (process->handle (-> s4-0 proc))) - (set! (-> obj spawned) #t) + (set! (-> this vehicle) (process->handle (-> s4-0 proc))) + (set! (-> this spawned) #t) ) ) ) @@ -2329,34 +2332,34 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! parking-spot ((obj parking-spot) (arg0 entity-actor)) +(defmethod init-from-entity! parking-spot ((this parking-spot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (set! (-> obj minimap) #f) - (set! (-> obj vehicle) (the-as handle #f)) - (set! (-> obj spawned) #f) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause movie)) - (let ((f0-0 (res-lump-float (-> obj entity) 'rotoffset))) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this minimap) #f) + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this spawned) #f) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-0 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) ) ) - (parking-spot-method-24 obj) - (set! (-> obj test-sphere quad) (-> obj root trans quad)) - (set! (-> obj test-sphere r) 24576.0) - (set! (-> obj state-time) (current-time)) + (parking-spot-method-24 this) + (set! (-> this test-sphere quad) (-> this root trans quad)) + (set! (-> this test-sphere r) 24576.0) + (set-time! (-> this state-time)) (let ((a1-5 (get-random-parking-spot-type *traffic-engine*))) (if (!= a1-5 (traffic-type traffic-type-21)) - (parking-spot-method-23 obj (the-as uint a1-5)) + (parking-spot-method-23 this (the-as uint a1-5)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2368,8 +2371,8 @@ This commonly includes things such as: ) :code sleep-code :post (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.25)) - (set! (-> self state-time) (current-time)) + (when (time-elapsed? (-> self state-time) (seconds 0.25)) + (set-time! (-> self state-time)) (parking-spot-method-21 self) (when (not (-> self spawned)) (let ((f0-0 (vector-vector-distance-squared (camera-pos) (-> self test-sphere))) @@ -2752,7 +2755,7 @@ This commonly includes things such as: ) ) -(defmethod propa-method-31 propa ((obj propa) (arg0 vector)) +(defmethod propa-method-31 propa ((this propa) (arg0 vector)) (let ((s5-0 (the-as process-focusable #f))) (let ((f30-0 (the-as float #x7f800000)) (s3-0 (new 'stack-no-clear 'array 'collide-shape 64)) @@ -2772,7 +2775,7 @@ This commonly includes things such as: ) ) (when (and s1-1 - (!= obj s1-1) + (!= this s1-1) (not (focus-test? s1-1 inactive)) (not (focus-test? s1-1 disable)) (not (focus-test? s1-1 dead)) @@ -2780,7 +2783,7 @@ This commonly includes things such as: (not (logtest? (process-mask crate) (-> s1-1 mask))) (not (logtest? (process-mask vehicle) (-> s1-1 mask))) ) - (let ((f0-0 (vector-vector-xz-distance (-> obj root trans) (-> s1-1 root trans)))) + (let ((f0-0 (vector-vector-xz-distance (-> this root trans) (-> s1-1 root trans)))) (when (or (not s5-0) (< f0-0 f30-0)) (set! s5-0 s1-1) (set! f30-0 f0-0) @@ -2796,16 +2799,16 @@ This commonly includes things such as: (set! s5-0 *target*) ) (if s5-0 - (set! (-> obj handle) (process->handle s5-0)) - (set! (-> obj handle) (the-as handle #f)) + (set! (-> this handle) (process->handle s5-0)) + (set! (-> this handle) (the-as handle #f)) ) ) 0 (none) ) -(defmethod propa-method-29 propa ((obj propa)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod propa-method-29 propa ((this propa)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2836,42 +2839,42 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod propa-method-30 propa ((obj propa)) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 170) obj)) +(defmethod propa-method-30 propa ((this propa)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 170) this)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! propa ((obj propa) (arg0 entity-actor)) +(defmethod init-from-entity! propa ((this propa) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (propa-method-29 obj) - (process-drawable-from-entity! obj arg0) + (propa-method-29 this) + (process-drawable-from-entity! this arg0) (ctywide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-propa" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (propa-method-30 obj) - (set! (-> obj sound-index) (the-as uint (rand-vu-int-count (-> *propa-sounds* length)))) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 4 0) - (set! (-> obj hit-points) 10) + (propa-method-30 this) + (set! (-> this sound-index) (the-as uint (rand-vu-int-count (-> *propa-sounds* length)))) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 4 0) + (set! (-> this hit-points) 10) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2892,7 +2895,7 @@ This commonly includes things such as: :bounds (static-spherem 0 75 0 83) ) -(defmethod run-logic? baron-statue ((obj baron-statue)) +(defmethod run-logic? baron-statue ((this baron-statue)) #t ) @@ -2902,26 +2905,26 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! baron-statue ((obj baron-statue) (arg0 entity-actor)) +(defmethod init-from-entity! baron-statue ((this baron-statue) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-baron-statue" (the-as (pointer uint32) #f))) (the-as pair 0) ) (when (task-node-closed? (game-task-node canyon-insert-items-resolution)) - (cleanup-for-death obj) + (cleanup-for-death this) (go empty-state) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3187,7 +3190,7 @@ This commonly includes things such as: (add-setting! 'music-volume 'rel (-> *setting-control* user-current music-volume-movie) 0) (add-setting! 'sfx-volume 'rel (-> *setting-control* user-current sfx-movie-volume) 0) (add-setting! 'dialog-volume 'rel (-> *setting-control* user-current dialog-volume-hint) 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let* ((v1-21 (get-current-task-event (-> self task))) (gp-0 (add-process *gui-control* @@ -3265,7 +3268,7 @@ This commonly includes things such as: :enter (behavior () (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self time) -1.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (remove-setting! 'minimap) @@ -3307,7 +3310,7 @@ This commonly includes things such as: (vf7 :class vf) ) (init-vf0-vector) - (when (>= (- (current-time) (-> self state-time)) (seconds 1.5)) + (when (time-elapsed? (-> self state-time) (seconds 1.5)) (let ((gp-0 0) (s5-0 0) ) @@ -3744,10 +3747,10 @@ This commonly includes things such as: ) ) -(defmethod burning-bush-method-32 burning-bush ((obj burning-bush)) - (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root trans))) - (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) gp-1)) - (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) gp-1)) +(defmethod burning-bush-method-32 burning-bush ((this burning-bush)) + (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) + (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) ) (and *target* (not (focus-test? *target* pilot)) @@ -3758,8 +3761,8 @@ This commonly includes things such as: ) ) -(defmethod burning-bush-method-30 burning-bush ((obj burning-bush)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod burning-bush-method-30 burning-bush ((this burning-bush)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -3779,77 +3782,77 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod burning-bush-method-31 burning-bush ((obj burning-bush)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 173) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 171) obj)) - (set! (-> obj part-alert) (create-launch-control (-> *part-group-id-table* 172) obj)) +(defmethod burning-bush-method-31 burning-bush ((this burning-bush)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 173) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 171) this)) + (set! (-> this part-alert) (create-launch-control (-> *part-group-id-table* 172) this)) 0 (none) ) ;; WARN: Return type mismatch process-focusable vs burning-bush. -(defmethod relocate burning-bush ((obj burning-bush) (arg0 int)) - (if (nonzero? (-> obj task)) - (&+! (-> obj task) arg0) +(defmethod relocate burning-bush ((this burning-bush) (arg0 int)) + (if (nonzero? (-> this task)) + (&+! (-> this task) arg0) ) - (if (nonzero? (-> obj part-off)) - (&+! (-> obj part-off) arg0) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) arg0) ) - (if (nonzero? (-> obj part-alert)) - (&+! (-> obj part-alert) arg0) + (if (nonzero? (-> this part-alert)) + (&+! (-> this part-alert) arg0) ) - (the-as burning-bush ((method-of-type process-focusable relocate) obj arg0)) + (the-as burning-bush ((method-of-type process-focusable relocate) this arg0)) ) -(defmethod run-logic? burning-bush ((obj burning-bush)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) +(defmethod run-logic? burning-bush ((this burning-bush)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-control-status uninited))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) ) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! burning-bush ((obj burning-bush) (arg0 entity-actor)) +(defmethod init-from-entity! burning-bush ((this burning-bush) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (burning-bush-method-30 obj) - (process-drawable-from-entity! obj arg0) + (burning-bush-method-30 this) + (process-drawable-from-entity! this arg0) (ctywide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-burning-bush" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (burning-bush-method-31 obj) - (let ((f0-0 (res-lump-float (-> obj entity) 'rotoffset))) + (burning-bush-method-31 this) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-0 0.0) - (quaternion-rotate-local-y! (-> obj root quat) (-> obj root quat) f0-0) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-0) ) ) - (set! (-> obj task) + (set! (-> this task) (new 'process 'game-task-control (res-lump-value arg0 'task-actor game-task-actor :time -1000000000.0)) ) - (set! (-> obj angle) 0.0) - (set! (-> obj root pause-adjust-distance) 819200.0) + (set! (-> this angle) 0.0) + (set! (-> this root pause-adjust-distance) 819200.0) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3875,7 +3878,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! barons-ship-lores ((obj barons-ship-lores) (arg0 entity-actor)) +(defmethod init-from-entity! barons-ship-lores ((this barons-ship-lores) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3883,26 +3886,26 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (when (demo?) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (go empty-state) ) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-barons-ship-lores" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj root pause-adjust-distance) 32768000.0) - (set! (-> obj paths 0) (new 'process 'curve-control obj 'path 0.0)) - (set! (-> obj paths 1) (new 'process 'curve-control obj 'path 1.0)) - (set! (-> obj paths 2) (new 'process 'curve-control obj 'path 2.0)) - (set! (-> obj current-path) 0) - (set! (-> obj forward-backward) #t) - (logior! (-> obj paths 0 flags) (path-control-flag display draw-line draw-point draw-text)) - (logior! (-> obj paths 1 flags) (path-control-flag display draw-line draw-point draw-text)) - (logior! (-> obj paths 2 flags) (path-control-flag display draw-line draw-point draw-text)) - (logior! (-> obj mask) (process-mask no-kill)) + (set! (-> this root pause-adjust-distance) 32768000.0) + (set! (-> this paths 0) (new 'process 'curve-control this 'path 0.0)) + (set! (-> this paths 1) (new 'process 'curve-control this 'path 1.0)) + (set! (-> this paths 2) (new 'process 'curve-control this 'path 2.0)) + (set! (-> this current-path) 0) + (set! (-> this forward-backward) #t) + (logior! (-> this paths 0 flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this paths 1 flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this paths 2 flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this mask) (process-mask no-kill)) (let ((a1-9 (new 'stack-no-clear 'sync-info-params))) (let ((v1-24 0)) (if #t @@ -3918,26 +3921,26 @@ This commonly includes things such as: (set! (-> a1-9 ease-out) 0.15) (set! (-> a1-9 pause-in) 0.05) (set! (-> a1-9 pause-out) 0.0) - (initialize! (-> obj sync) a1-9) + (initialize! (-> this sync) a1-9) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) ;; WARN: Return type mismatch process-drawable vs barons-ship-lores. -(defmethod relocate barons-ship-lores ((obj barons-ship-lores) (arg0 int)) - (if (nonzero? (-> obj paths 0)) - (&+! (-> obj paths 0) arg0) +(defmethod relocate barons-ship-lores ((this barons-ship-lores) (arg0 int)) + (if (nonzero? (-> this paths 0)) + (&+! (-> this paths 0) arg0) ) - (if (nonzero? (-> obj paths 1)) - (&+! (-> obj paths 1) arg0) + (if (nonzero? (-> this paths 1)) + (&+! (-> this paths 1) arg0) ) - (if (nonzero? (-> obj paths 2)) - (&+! (-> obj paths 2) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method barons-ship-lores 7)) this arg0) ) ) @@ -4006,27 +4009,27 @@ This commonly includes things such as: :post ja-post ) -(defmethod city-race-ring-info-method-9 city-race-ring-info ((obj city-race-ring-info) (arg0 symbol)) +(defmethod city-race-ring-info-method-9 city-race-ring-info ((this city-race-ring-info) (arg0 symbol)) (format arg0 "(static-race-ring-info~%") - (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%" (-> obj pos x) (-> obj pos y) (-> obj pos z)) - (let ((f0-3 (-> obj pos w))) + (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%" (-> this pos x) (-> this pos y) (-> this pos z)) + (let ((f0-3 (-> this pos w))) (format arg0 " :angle (deg ~f)~%" (* 0.005493164 f0-3)) ) - (if (!= (-> obj boost) 1.0) - (format arg0 " :boost ~4,,2f~%" (-> obj boost)) + (if (!= (-> this boost) 1.0) + (format arg0 " :boost ~4,,2f~%" (-> this boost)) ) - (format arg0 " :dist (meters ~4,,2M)~%" (-> obj dist)) + (format arg0 " :dist (meters ~4,,2M)~%" (-> this dist)) (format arg0 " ~%)~%") 0 (none) ) -(defmethod city-ambush-info-method-9 city-ambush-info ((obj city-ambush-info) (arg0 traffic-object-spawn-params)) - (set! (-> arg0 position quad) (-> obj array 0 pos quad)) +(defmethod city-ambush-info-method-9 city-ambush-info ((this city-ambush-info) (arg0 traffic-object-spawn-params)) + (set! (-> arg0 position quad) (-> this array 0 pos quad)) (set! (-> arg0 nav-mesh) (find-nearest-nav-mesh (-> arg0 position) (the-as float #x7f800000))) (vector-reset! (-> arg0 velocity)) - (dotimes (s4-0 (-> obj count)) - (let ((v1-3 (-> obj array s4-0))) + (dotimes (s4-0 (-> this count)) + (let ((v1-3 (-> this array s4-0))) (set! (-> arg0 position quad) (-> v1-3 pos quad)) (set! (-> arg0 object-type) (the-as traffic-type (-> v1-3 obj-type))) ) @@ -4091,8 +4094,8 @@ This commonly includes things such as: ) ) -(defmethod lurker-pipe-lid-method-28 lurker-pipe-lid ((obj lurker-pipe-lid)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod lurker-pipe-lid-method-28 lurker-pipe-lid ((this lurker-pipe-lid)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -4112,38 +4115,38 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod lurker-pipe-lid-method-29 lurker-pipe-lid ((obj lurker-pipe-lid)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod lurker-pipe-lid-method-29 lurker-pipe-lid ((this lurker-pipe-lid)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! lurker-pipe-lid ((obj lurker-pipe-lid) (arg0 entity-actor)) +(defmethod init-from-entity! lurker-pipe-lid ((this lurker-pipe-lid) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (lurker-pipe-lid-method-28 obj) - (process-drawable-from-entity! obj arg0) + (lurker-pipe-lid-method-28 this) + (process-drawable-from-entity! this arg0) (ctywide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-lurker-pipe-lid" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (lurker-pipe-lid-method-29 obj) - (set! (-> obj angle) 0.0) + (lurker-pipe-lid-method-29 this) + (set! (-> this angle) 0.0) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -4233,8 +4236,8 @@ This commonly includes things such as: :post #f ) -(defmethod ctyn-lamp-method-29 ctyn-lamp ((obj ctyn-lamp)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod ctyn-lamp-method-29 ctyn-lamp ((this ctyn-lamp)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -4272,35 +4275,35 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod ctyn-lamp-method-30 ctyn-lamp ((obj ctyn-lamp)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod ctyn-lamp-method-30 ctyn-lamp ((this ctyn-lamp)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctyn-lamp ((obj ctyn-lamp) (arg0 entity-actor)) +(defmethod init-from-entity! ctyn-lamp ((this ctyn-lamp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (ctyn-lamp-method-29 obj) - (process-drawable-from-entity! obj arg0) + (ctyn-lamp-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyn-lamp" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (ctyn-lamp-method-30 obj) + (ctyn-lamp-method-30 this) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/city/ctywide-part.gc b/goal_src/jak2/levels/city/ctywide-part.gc index 45c1335d04..d4f7e3083a 100644 --- a/goal_src/jak2/levels/city/ctywide-part.gc +++ b/goal_src/jak2/levels/city/ctywide-part.gc @@ -59,6 +59,7 @@ ) ) ) + ;; og:preserve-this (#when PC_PORT (unless (-> *pc-settings* ps2-parts?) (set! (-> arg2 r-g-b-a w) 128.0))) diff --git a/goal_src/jak2/levels/city/ctywide-tasks.gc b/goal_src/jak2/levels/city/ctywide-tasks.gc index 639acfe66f..fd67185f06 100644 --- a/goal_src/jak2/levels/city/ctywide-tasks.gc +++ b/goal_src/jak2/levels/city/ctywide-tasks.gc @@ -46,8 +46,8 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (none) @@ -93,8 +93,8 @@ (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'leave) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (none) @@ -182,7 +182,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -235,7 +235,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -247,7 +247,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 1)) + (until (time-elapsed? gp-3 (seconds 1)) (suspend) ) ) @@ -272,7 +272,7 @@ (wait-for-speech-end (-> self sound-id 0)) (set! (-> self sub-state) (the-as uint 2)) (let ((gp-6 (current-time))) - (until (>= (- (current-time) gp-6) (seconds 1)) + (until (time-elapsed? gp-6 (seconds 1)) (suspend) ) ) @@ -320,7 +320,7 @@ ) ) (else - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -340,7 +340,7 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (until (>= (- (current-time) (-> self state-time)) (seconds 60)) + (until (time-elapsed? (-> self state-time) (seconds 60)) (suspend) ) (set! (-> self sub-state) (the-as uint 1)) @@ -349,7 +349,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -367,7 +367,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 3)) + (until (time-elapsed? gp-4 (seconds 3)) (suspend) ) ) @@ -460,7 +460,7 @@ ) ) (set-setting! 'airlock #f 0.0 0) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (none) ) ) @@ -475,8 +475,8 @@ (send-event *traffic-manager* 'set-alert-duration (seconds 30)) (send-event *target* 'end-mode) (set-setting! 'pilot #f 0.0 0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (script-eval '(send-event "keira-npc-1" 'say)) @@ -764,7 +764,7 @@ (set! (-> self arrow) (process->handle a0-20)) ) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self time-limit) (the-as time-frame (the int (-> gp-0 time)))) ) (none) @@ -816,8 +816,8 @@ () (send-event *target* 'end-mode) (set-setting! 'pilot #f 0.0 0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) ;; unnecessary - the task manager can take care of this diff --git a/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc b/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc index 1c9acf9253..51669bf80c 100644 --- a/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc +++ b/goal_src/jak2/levels/city/farm/ctyfarm-obs.gc @@ -900,17 +900,17 @@ ;; WARN: Return type mismatch float vs none. -(defmethod shaker-method-9 shaker ((obj shaker)) - (let ((s5-0 (- (current-time) (-> obj start-time)))) - (set! (-> obj shake) (* (-> obj amplitude) - (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> obj decay-time)) - (cos (* 65536.0 (/ (the float s5-0) (-> obj freq)))) - ) +(defmethod shaker-method-9 shaker ((this shaker)) + (let ((s5-0 (- (current-time) (-> this start-time)))) + (set! (-> this shake) (* (-> this amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this freq)))) + ) ) - (set! (-> obj y-shake) (* (-> obj y-amplitude) - (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> obj y-decay-time)) - (cos (* 65536.0 (/ (the float s5-0) (-> obj y-freq)))) - ) + (set! (-> this y-shake) (* (-> this y-amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this y-decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this y-freq)))) + ) ) ) (none) @@ -1061,7 +1061,7 @@ ) (let ((v1-10 (-> self shakers))) (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) - (set! (-> v1-10 0 start-time) (current-time)) + (set-time! (-> v1-10 0 start-time)) (set! (-> v1-10 0 decay-time) 300.0) (set! (-> v1-10 0 freq) 150.0) (set! (-> v1-10 0 amplitude) 1820.4445) @@ -1179,8 +1179,8 @@ ) ) -(defmethod farm-marrow-method-29 farm-marrow ((obj farm-marrow)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-marrow-method-29 farm-marrow ((this farm-marrow)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1200,40 +1200,40 @@ (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod farm-marrow-method-30 farm-marrow ((obj farm-marrow)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-marrow-method-30 farm-marrow ((this farm-marrow)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-marrow ((obj farm-marrow) (arg0 entity-actor)) +(defmethod init-from-entity! farm-marrow ((this farm-marrow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-marrow-method-29 obj) - (process-drawable-from-entity! obj arg0) + (farm-marrow-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-marrow" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (farm-marrow-method-30 obj) - (quaternion-vector-angle! (-> obj root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (farm-marrow-method-30 this) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) (let ((f0-2 (rand-vu-float-range 0.9 1.1))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1351,7 +1351,7 @@ This commonly includes things such as: ) (let ((v1-10 (-> self shakers))) (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) - (set! (-> v1-10 0 start-time) (current-time)) + (set-time! (-> v1-10 0 start-time)) (set! (-> v1-10 0 decay-time) 300.0) (set! (-> v1-10 0 freq) 150.0) (set! (-> v1-10 0 amplitude) 1820.4445) @@ -1428,8 +1428,8 @@ This commonly includes things such as: ) ) -(defmethod farm-beetree-method-29 farm-beetree ((obj farm-beetree)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-beetree-method-29 farm-beetree ((this farm-beetree)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1449,40 +1449,40 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod farm-beetree-method-30 farm-beetree ((obj farm-beetree)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-beetree-method-30 farm-beetree ((this farm-beetree)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-beetree ((obj farm-beetree) (arg0 entity-actor)) +(defmethod init-from-entity! farm-beetree ((this farm-beetree) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-beetree-method-29 obj) - (process-drawable-from-entity! obj arg0) + (farm-beetree-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-beetree" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (farm-beetree-method-30 obj) - (quaternion-vector-angle! (-> obj root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (farm-beetree-method-30 this) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) (let ((f0-2 (rand-vu-float-range 0.9 1.1))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1596,7 +1596,7 @@ This commonly includes things such as: ) (let ((v1-10 (-> self shakers))) (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) - (set! (-> v1-10 0 start-time) (current-time)) + (set-time! (-> v1-10 0 start-time)) (set! (-> v1-10 0 decay-time) 300.0) (set! (-> v1-10 0 freq) 150.0) (set! (-> v1-10 0 amplitude) 1820.4445) @@ -1673,8 +1673,8 @@ This commonly includes things such as: ) ) -(defmethod farm-cabbage-method-29 farm-cabbage ((obj farm-cabbage)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-cabbage-method-29 farm-cabbage ((this farm-cabbage)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1694,40 +1694,40 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod farm-cabbage-method-30 farm-cabbage ((obj farm-cabbage)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-cabbage-method-30 farm-cabbage ((this farm-cabbage)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-cabbage ((obj farm-cabbage) (arg0 entity-actor)) +(defmethod init-from-entity! farm-cabbage ((this farm-cabbage) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-cabbage-method-29 obj) - (process-drawable-from-entity! obj arg0) + (farm-cabbage-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-cabbage" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (farm-cabbage-method-30 obj) - (quaternion-vector-angle! (-> obj root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (farm-cabbage-method-30 this) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) (let ((f0-2 (rand-vu-float-range 0.9 1.1))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1843,7 +1843,7 @@ This commonly includes things such as: ) (let ((v1-10 (-> self shakers))) (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) - (set! (-> v1-10 0 start-time) (current-time)) + (set-time! (-> v1-10 0 start-time)) (set! (-> v1-10 0 decay-time) 300.0) (set! (-> v1-10 0 freq) 150.0) (set! (-> v1-10 0 amplitude) 910.2222) @@ -1905,8 +1905,8 @@ This commonly includes things such as: ) ) -(defmethod farm-small-cabbage-method-29 farm-small-cabbage ((obj farm-small-cabbage)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-small-cabbage-method-29 farm-small-cabbage ((this farm-small-cabbage)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1926,40 +1926,40 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod farm-small-cabbage-method-30 farm-small-cabbage ((obj farm-small-cabbage)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-small-cabbage-method-30 farm-small-cabbage ((this farm-small-cabbage)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-small-cabbage ((obj farm-small-cabbage) (arg0 entity-actor)) +(defmethod init-from-entity! farm-small-cabbage ((this farm-small-cabbage) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-small-cabbage-method-29 obj) - (process-drawable-from-entity! obj arg0) + (farm-small-cabbage-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-small-cabbage" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (farm-small-cabbage-method-30 obj) - (quaternion-vector-angle! (-> obj root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (farm-small-cabbage-method-30 this) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) (let ((f0-2 (rand-vu-float-range 0.9 1.1))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2075,7 +2075,7 @@ This commonly includes things such as: ) (let ((v1-10 (-> self shakers))) (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) - (set! (-> v1-10 0 start-time) (current-time)) + (set-time! (-> v1-10 0 start-time)) (set! (-> v1-10 0 decay-time) 300.0) (set! (-> v1-10 0 freq) 150.0) (set! (-> v1-10 0 amplitude) 1820.4445) @@ -2181,8 +2181,8 @@ This commonly includes things such as: ) ) -(defmethod farm-chilirots-method-29 farm-chilirots ((obj farm-chilirots)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-chilirots-method-29 farm-chilirots ((this farm-chilirots)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2202,40 +2202,40 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod farm-chilirots-method-30 farm-chilirots ((obj farm-chilirots)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-chilirots-method-30 farm-chilirots ((this farm-chilirots)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-chilirots ((obj farm-chilirots) (arg0 entity-actor)) +(defmethod init-from-entity! farm-chilirots ((this farm-chilirots) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-chilirots-method-29 obj) - (process-drawable-from-entity! obj arg0) + (farm-chilirots-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-chilirots" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (farm-chilirots-method-30 obj) - (quaternion-vector-angle! (-> obj root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (farm-chilirots-method-30 this) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) (let ((f0-2 (rand-vu-float-range 0.9 1.1))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2275,8 +2275,8 @@ This commonly includes things such as: ) ) -(defmethod farm-sprinkler-barrels-method-28 farm-sprinkler-barrels ((obj farm-sprinkler-barrels)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-sprinkler-barrels-method-28 farm-sprinkler-barrels ((this farm-sprinkler-barrels)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2309,40 +2309,40 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod farm-sprinkler-barrels-method-29 farm-sprinkler-barrels ((obj farm-sprinkler-barrels)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-sprinkler-barrels-method-29 farm-sprinkler-barrels ((this farm-sprinkler-barrels)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-sprinkler-barrels ((obj farm-sprinkler-barrels) (arg0 entity-actor)) +(defmethod init-from-entity! farm-sprinkler-barrels ((this farm-sprinkler-barrels) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-sprinkler-barrels-method-28 obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (farm-sprinkler-barrels-method-28 this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-sprinkler-barrels" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (farm-sprinkler-barrels-method-29 obj) + (farm-sprinkler-barrels-method-29 this) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/city/farm/yakow.gc b/goal_src/jak2/levels/city/farm/yakow.gc index 822e1168e9..8301b08c0f 100644 --- a/goal_src/jak2/levels/city/farm/yakow.gc +++ b/goal_src/jak2/levels/city/farm/yakow.gc @@ -202,45 +202,45 @@ (set! (-> *yakow-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod damage-amount-from-attack yakow ((obj yakow) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack yakow ((this yakow) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) -(defmethod general-event-handler yakow ((obj yakow) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler yakow ((this yakow) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) (let ((v1-1 (the-as object (-> arg3 param 1)))) - (when (!= (-> (the-as attack-info v1-1) id) (-> obj incoming-attack-id)) - (set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-1) id)) - (go (method-of-object obj kicked)) + (when (!= (-> (the-as attack-info v1-1) id) (-> this incoming-attack-id)) + (set! (-> this incoming-attack-id) (-> (the-as attack-info v1-1) id)) + (go (method-of-object this kicked)) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod enemy-method-123 yakow ((obj yakow) (arg0 float)) +(defmethod enemy-method-123 yakow ((this yakow) (arg0 float)) "TODO" (>= arg0 (rand-vu)) ) ;; WARN: Function (method 156 yakow) has a return type of none, but the expression builder found a return statement. -(defmethod nav-enemy-method-156 yakow ((obj yakow)) +(defmethod nav-enemy-method-156 yakow ((this yakow)) (dotimes (s5-0 16) - (let ((f30-1 (* 4096.0 (get-rand-float-range obj -10.0 10.0))) - (f0-2 (* 4096.0 (get-rand-float-range obj -10.0 10.0))) + (let ((f30-1 (* 4096.0 (get-rand-float-range this -10.0 10.0))) + (f0-2 (* 4096.0 (get-rand-float-range this -10.0 10.0))) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> obj root trans quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) (+! (-> s4-0 x) f30-1) (+! (-> s4-0 z) f0-2) - (let ((v1-7 (-> obj nav)) + (let ((v1-7 (-> this nav)) (a0-6 s4-0) (a1-2 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -248,7 +248,7 @@ (set! (-> a1-2 y-threshold) (-> v1-7 nearest-y-threshold)) (set! (-> a1-2 ignore) (the-as uint 2)) (when (find-poly-containing-point-local (-> v1-7 state mesh) a1-2) - (let ((v1-12 (-> obj nav state))) + (let ((v1-12 (-> this nav state))) (logclear! (-> v1-12 flags) (nav-state-flag directional-mode)) (logior! (-> v1-12 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-12 target-post quad) (-> s4-0 quad)) @@ -289,7 +289,7 @@ ) :post (behavior () (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) (ja-post) @@ -299,7 +299,7 @@ (defstate active (yakow) :virtual #t :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (< (the-as int (-> self focus aware)) 1) (go-virtual idle) ) @@ -395,7 +395,7 @@ (set! (-> v1-0 nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () '() @@ -415,9 +415,9 @@ :post ja-post ) -(defmethod init-enemy-collision! yakow ((obj yakow)) +(defmethod init-enemy-collision! yakow ((this yakow)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -455,25 +455,25 @@ (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! yakow ((obj yakow)) +(defmethod init-enemy! yakow ((this yakow)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-yakow" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *yakow-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *yakow-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 327680.0) + (set-gravity-length (-> this root dynam) 327680.0) 0 (none) ) diff --git a/goal_src/jak2/levels/city/generic/neon-praxis-part.gc b/goal_src/jak2/levels/city/generic/neon-praxis-part.gc index 5518b169e3..803d21c67b 100644 --- a/goal_src/jak2/levels/city/generic/neon-praxis-part.gc +++ b/goal_src/jak2/levels/city/generic/neon-praxis-part.gc @@ -1048,57 +1048,57 @@ ) -(defmethod deactivate city-neon-praxis ((obj city-neon-praxis)) +(defmethod deactivate city-neon-praxis ((this city-neon-praxis)) (dotimes (s5-0 2) - (let ((a0-1 (-> obj parts s5-0))) + (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs city-neon-praxis. -(defmethod relocate city-neon-praxis ((obj city-neon-praxis) (arg0 int)) +(defmethod relocate city-neon-praxis ((this city-neon-praxis) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj parts v1-0)) - (&+! (-> obj parts v1-0) arg0) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) arg0) ) ) - (the-as city-neon-praxis ((method-of-type process-drawable relocate) obj arg0)) + (the-as city-neon-praxis ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod city-neon-praxis-method-21 city-neon-praxis ((obj city-neon-praxis)) - (+! (-> obj parts 1 state-counter) 1) - (when (!= (-> obj parts 1 state-mode 0) (-> obj praxis-mode)) - (set! (-> obj parts 1 state-mode 0) (-> obj praxis-mode)) - (set! (-> obj parts 1 state-counter) (the-as uint 0)) +(defmethod city-neon-praxis-method-21 city-neon-praxis ((this city-neon-praxis)) + (+! (-> this parts 1 state-counter) 1) + (when (!= (-> this parts 1 state-mode 0) (-> this praxis-mode)) + (set! (-> this parts 1 state-mode 0) (-> this praxis-mode)) + (set! (-> this parts 1 state-counter) (the-as uint 0)) 0 ) - (+! (-> obj parts 0 state-counter) 1) - (when (!= (-> obj parts 0 state-mode 0) (-> obj back-mode)) - (set! (-> obj parts 0 state-mode 0) (-> obj back-mode)) - (set! (-> obj parts 0 state-counter) (the-as uint 0)) + (+! (-> this parts 0 state-counter) 1) + (when (!= (-> this parts 0 state-mode 0) (-> this back-mode)) + (set! (-> this parts 0 state-mode 0) (-> this back-mode)) + (set! (-> this parts 0 state-counter) (the-as uint 0)) 0 ) - (let ((s5-0 (-> obj master-enable)) + (let ((s5-0 (-> this master-enable)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) - (f30-0 (-> obj rot y)) + (f30-0 (-> this rot y)) ) (set-vector! s4-0 (* 3276.8 (cos (- 49152.0 f30-0))) 0.0 (* 3276.8 (sin (- 49152.0 f30-0))) 1.0) - (vector-! s3-0 (camera-pos) (-> obj root trans)) + (vector-! s3-0 (camera-pos) (-> this root trans)) (when (< (vector-dot s4-0 s3-0) 0.0) (vector-negate! s4-0 s4-0) (set! f30-0 (+ 32768.0 f30-0)) ) - (vector+! s4-0 s4-0 (-> obj root trans)) + (vector+! s4-0 s4-0 (-> this root trans)) (dotimes (s3-1 2) (when (logtest? s5-0 1) - (let ((s2-3 (-> obj parts s3-1))) + (let ((s2-3 (-> this parts s3-1))) (matrix-rotate-y! (-> s2-3 origin) (+ 16384.0 f30-0)) (spawn s2-3 s4-0) ) @@ -1154,35 +1154,35 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! city-neon-praxis ((obj city-neon-praxis) (arg0 entity-actor)) +(defmethod init-from-entity! city-neon-praxis ((this city-neon-praxis) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause enemy)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj master-enable) (the-as uint -1)) - (set! (-> obj praxis-mode) (the-as uint (rand-vu-int-count 5))) - (set! (-> obj back-mode) (the-as uint (rand-vu-int-count 8))) - (-> obj rot y) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause enemy)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this master-enable) (the-as uint -1)) + (set! (-> this praxis-mode) (the-as uint (rand-vu-int-count 5))) + (set! (-> this back-mode) (the-as uint (rand-vu-int-count 8))) + (-> this rot y) (let ((f0-1 16384.0)) - (set! (-> obj rot y) f0-1) - (quaternion-vector-angle! (-> obj root quat) (new 'static 'vector :y 1.0 :w 1.0) f0-1) + (set! (-> this rot y) f0-1) + (quaternion-vector-angle! (-> this root quat) (new 'static 'vector :y 1.0 :w 1.0) f0-1) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (vector-z-quaternion! s5-1 (-> obj root quat)) + (vector-z-quaternion! s5-1 (-> this root quat)) (vector-normalize! s5-1 -4096.0) - (vector+! (-> obj root trans) (-> obj root trans) s5-1) + (vector+! (-> this root trans) (-> this root trans) s5-1) ) (let ((s5-2 *city-neon-praxis-group-ids*)) (dotimes (s4-0 2) - (set! (-> obj parts s4-0) (create-launch-control (-> *part-group-id-table* (-> s5-2 s4-0)) obj)) + (set! (-> this parts s4-0) (create-launch-control (-> *part-group-id-table* (-> s5-2 s4-0)) this)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/city/kiddogescort/crocesc-states.gc b/goal_src/jak2/levels/city/kiddogescort/crocesc-states.gc index d9546c7ae9..0ccd2a06ce 100644 --- a/goal_src/jak2/levels/city/kiddogescort/crocesc-states.gc +++ b/goal_src/jak2/levels/city/kiddogescort/crocesc-states.gc @@ -11,7 +11,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -154,7 +154,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -197,7 +197,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -223,10 +223,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (go-idle-or-move self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -256,7 +256,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -285,10 +285,10 @@ (logclear! (-> self bot-flags) (bot-flags bf15)) (go-idle-or-move self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -341,7 +341,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -508,7 +508,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -581,7 +581,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -741,7 +741,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -758,7 +758,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -782,7 +782,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (not (nav-enemy-method-163 self)) (go-virtual traveling) ) @@ -857,7 +857,7 @@ 0.0 (until #f (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) @@ -895,7 +895,7 @@ (defstate failed (crocadog-escort) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -913,7 +913,7 @@ (logclear! (-> self bot-flags) (bot-flags bf19)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (when (not (logtest? (bot-flags bf19) (-> self bot-flags))) (logior! (-> self bot-flags) (bot-flags bf19)) (fail-mission! self) @@ -928,7 +928,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/goal_src/jak2/levels/city/kiddogescort/crocesc-task.gc b/goal_src/jak2/levels/city/kiddogescort/crocesc-task.gc index 0847a2d263..c1201a02b0 100644 --- a/goal_src/jak2/levels/city/kiddogescort/crocesc-task.gc +++ b/goal_src/jak2/levels/city/kiddogescort/crocesc-task.gc @@ -7,42 +7,42 @@ ;; DECOMP BEGINS -(defmethod reset-task! crocesct-wait-spot ((obj crocesct-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! crocesct-wait-spot ((this crocesct-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 crocesct-wait-spot ((obj crocesct-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 crocesct-wait-spot ((this crocesct-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as crocadog-escort arg0)) + ((-> this check-done) this (the-as crocadog-escort arg0)) (none) ) diff --git a/goal_src/jak2/levels/city/kiddogescort/crocesc.gc b/goal_src/jak2/levels/city/kiddogescort/crocesc.gc index 9a201ac0df..c26b6e2ed4 100644 --- a/goal_src/jak2/levels/city/kiddogescort/crocesc.gc +++ b/goal_src/jak2/levels/city/kiddogescort/crocesc.gc @@ -180,44 +180,44 @@ (set! (-> *crocadog-escort-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler crocadog-escort ((obj crocadog-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler crocadog-escort ((this crocadog-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) #f ) (('nav-mesh-kill) - (change-to *default-nav-mesh* obj) + (change-to *default-nav-mesh* this) #t ) (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod get-penetrate-info crocadog-escort ((obj crocadog-escort)) +(defmethod get-penetrate-info crocadog-escort ((this crocadog-escort)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" - (let ((v1-1 ((method-of-type bot get-penetrate-info) obj))) + (let ((v1-1 ((method-of-type bot get-penetrate-info) this))) (logior (penetrate jak-yellow-shot jak-red-shot jak-blue-shot) v1-1) ) ) -(defmethod bot-method-193 crocadog-escort ((obj crocadog-escort)) +(defmethod bot-method-193 crocadog-escort ((this crocadog-escort)) (let* ((t9-0 (method-of-type bot bot-method-193)) - (v0-0 (t9-0 obj)) + (v0-0 (t9-0 this)) ) - (if (and (not v0-0) (logtest? #x1c00000 (-> obj incoming penetrate-using))) + (if (and (not v0-0) (logtest? #x1c00000 (-> this incoming penetrate-using))) (set! v0-0 #t) ) v0-0 ) ) -(defmethod enemy-method-79 crocadog-escort ((obj crocadog-escort) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 crocadog-escort ((this crocadog-escort) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (gp-0 symbol)) (case arg0 ((3) @@ -226,7 +226,7 @@ (if (>= (ja-aframe-num 0) 4.0) (set! f30-0 0.25) ) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) f30-0) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) @@ -234,29 +234,29 @@ ) ) (else - (set! gp-0 ((method-of-type bot enemy-method-79) obj arg0 arg1)) + (set! gp-0 ((method-of-type bot enemy-method-79) this arg0 arg1)) ) ) gp-0 ) -(defmethod want-exit-vehicle? crocadog-escort ((obj crocadog-escort) (arg0 vector)) - (let ((s3-0 (handle->process (-> obj vehicle-handle)))) - (if (or (not s3-0) (not (-> obj nav))) +(defmethod want-exit-vehicle? crocadog-escort ((this crocadog-escort) (arg0 vector)) + (let ((s3-0 (handle->process (-> this vehicle-handle)))) + (if (or (not s3-0) (not (-> this nav))) (return #f) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (compute-seat-position (the-as vehicle s3-0) s4-0 (-> obj vehicle-seat-index)) + (compute-seat-position (the-as vehicle s3-0) s4-0 (-> this vehicle-seat-index)) (vector-! s4-0 s4-0 (-> (the-as vehicle s3-0) root trans)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 (+ 12288.0 (vector-length s4-0))) (vector+! s4-0 s4-0 (-> (the-as vehicle s3-0) root trans)) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (when (enemy-above-ground? obj s3-1 s4-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (when (enemy-above-ground? this s3-1 s4-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s4-0 y) (-> s3-1 best-other-tri intersect y)) (let ((s3-2 (new 'stack-no-clear 'vector))) - (do-navigation-to-destination (-> obj nav state) (-> obj root trans)) - (when (cloest-point-on-mesh (-> obj nav) s3-2 s4-0 (the-as nav-poly #f)) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) + (when (cloest-point-on-mesh (-> this nav) s3-2 s4-0 (the-as nav-poly #f)) (let ((f0-4 2048.0)) (when (>= (* f0-4 f0-4) (vector-vector-xz-distance-squared s3-2 s4-0)) (set! (-> arg0 quad) (-> s3-2 quad)) @@ -271,32 +271,32 @@ ) ) -(defmethod run-logic? crocadog-escort ((obj crocadog-escort)) +(defmethod run-logic? crocadog-escort ((this crocadog-escort)) (or (not (logtest? (process-mask enemy) (-> *setting-control* user-current process-mask))) - (logtest? (-> obj bot-flags) (bot-flags bf09)) + (logtest? (-> this bot-flags) (bot-flags bf09)) ) ) -(defmethod enemy-method-97 crocadog-escort ((obj crocadog-escort)) - (let* ((s4-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 crocadog-escort ((this crocadog-escort)) + (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) ) (when s5-0 - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 3)) + (when (time-elapsed? (-> this attacker-time) (seconds 3)) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) - (handle->process (-> obj kid-handle)) + (handle->process (-> this kid-handle)) (cond (s5-0 (empty) ) ((begin - (let ((s4-1 (handle->process (-> obj poi-handle)))) + (let ((s4-1 (handle->process (-> this poi-handle)))) (set! s5-0 (if (type? s4-1 process-focusable) s4-1 ) @@ -307,13 +307,13 @@ (empty) ) (else - (set! s5-0 (select-focus! obj)) + (set! s5-0 (select-focus! this)) (cond (s5-0 (empty) ) (else - (let ((s4-2 (handle->process (-> obj kid-handle)))) + (let ((s4-2 (handle->process (-> this kid-handle)))) (set! s5-0 (if (type? s4-2 process-focusable) s4-2 ) @@ -321,10 +321,10 @@ ) *target* (let ((f30-0 -1.0) - (f28-0 (vector-vector-distance (target-pos 0) (-> obj root trans))) + (f28-0 (vector-vector-distance (target-pos 0) (-> this root trans))) ) (if s5-0 - (set! f30-0 (vector-vector-distance (get-trans (the-as process-focusable s5-0) 0) (-> obj root trans))) + (set! f30-0 (vector-vector-distance (get-trans (the-as process-focusable s5-0) 0) (-> this root trans))) ) (if (and s5-0 (>= (* 2.0 f28-0) f30-0)) (empty) @@ -337,14 +337,14 @@ ) (cond (s5-0 - (try-update-focus (-> obj focus) (the-as process-focusable s5-0) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s5-0 type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s5-0) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s5-0 type) target)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s5-0 @@ -352,31 +352,31 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? crocadog-escort ((obj crocadog-escort)) +(defmethod alive? crocadog-escort ((this crocadog-escort)) (let ((t9-0 (method-of-type bot alive?))) - (the-as symbol (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) - ) + (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) + ) ) ) ) ) -(defmethod init-from-entity! crocadog-escort ((obj crocadog-escort) (arg0 entity-actor)) +(defmethod init-from-entity! crocadog-escort ((this crocadog-escort) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - ((method-of-type bot init-from-entity!) obj arg0) + (stack-size-set! (-> this main-thread) 512) + ((method-of-type bot init-from-entity!) this arg0) (none) ) -(defmethod init-enemy-collision! crocadog-escort ((obj crocadog-escort)) +(defmethod init-enemy-collision! crocadog-escort ((this crocadog-escort)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -425,42 +425,42 @@ This commonly includes things such as: ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 1)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init! crocadog-escort ((obj crocadog-escort)) +(defmethod init! crocadog-escort ((this crocadog-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj min-speed) 9011.2) - (set! (-> obj max-speed) 28672.0) - (set! (-> obj channel) (the-as uint 31)) - (set! (-> obj notice-enemy-dist) 24576.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 0.0) - (set-vector! (-> obj root scale) 1.2 1.2 1.2 1.0) - (set! (-> obj spot-color) (the-as uint #x5000ff00)) - (set! (-> obj kid-handle) (the-as handle #f)) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (set-vector! (-> obj local-seat-pos) 0.0 819.2 -1638.4 1.0) + (set! (-> this min-speed) 9011.2) + (set! (-> this max-speed) 28672.0) + (set! (-> this channel) (the-as uint 31)) + (set! (-> this notice-enemy-dist) 24576.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 0.0) + (set-vector! (-> this root scale) 1.2 1.2 1.2 1.0) + (set! (-> this spot-color) (the-as uint #x5000ff00)) + (set! (-> this kid-handle) (the-as handle #f)) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set-vector! (-> this local-seat-pos) 0.0 819.2 -1638.4 1.0) 0 (none) ) -(defmethod init-enemy! crocadog-escort ((obj crocadog-escort)) +(defmethod init-enemy! crocadog-escort ((this crocadog-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) + (init! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crocadog-escort" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *crocadog-escort-nav-enemy-info*) - (let ((v1-7 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *crocadog-escort-nav-enemy-info*) + (let ((v1-7 (-> this neck))) (set! (-> v1-7 up) (the-as uint 1)) (set! (-> v1-7 nose) (the-as uint 2)) (set! (-> v1-7 ear) (the-as uint 0)) @@ -468,53 +468,53 @@ This commonly includes things such as: (set! (-> v1-7 ignore-angle) 30947.555) ) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (let ((v1-10 (-> obj nav))) + (let ((v1-10 (-> this nav))) (set! (-> v1-10 sphere-mask) (the-as uint 126)) ) 0 - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) -(defmethod bot-method-214 crocadog-escort ((obj crocadog-escort)) +(defmethod bot-method-214 crocadog-escort ((this crocadog-escort)) #f ) -(defmethod check-vehicle-exit crocadog-escort ((obj crocadog-escort)) +(defmethod check-vehicle-exit crocadog-escort ((this crocadog-escort)) (local-vars (v1-22 enemy-flag)) - (when (focus-test? obj pilot) - (let ((v1-4 (handle->process (-> obj vehicle-handle)))) + (when (focus-test? this pilot) + (let ((v1-4 (handle->process (-> this vehicle-handle)))) (when (or (not v1-4) (logtest? (-> (the-as vehicle v1-4) flags) (rigid-body-object-flag dead))) - (logior! (-> obj bot-flags) (bot-flags bf17)) - (logclear! (-> obj bot-flags) (bot-flags bf15)) - (logclear! (-> obj focus-status) (focus-status pilot-riding pilot)) - (set! (-> obj vehicle-seat-index) -1) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (logior! (-> obj root nav-flags) (nav-flags has-root-sphere)) - (let* ((s5-0 (-> obj root quat)) + (logior! (-> this bot-flags) (bot-flags bf17)) + (logclear! (-> this bot-flags) (bot-flags bf15)) + (logclear! (-> this focus-status) (focus-status pilot-riding pilot)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this vehicle-handle) (the-as handle #f)) + (logior! (-> this root nav-flags) (nav-flags has-root-sphere)) + (let* ((s5-0 (-> this root quat)) (f30-0 (quaternion-y-angle s5-0)) ) (quaternion-identity! s5-0) (quaternion-rotate-y! s5-0 s5-0 f30-0) ) - (let ((v1-21 (-> obj enemy-flags))) + (let ((v1-21 (-> this enemy-flags))) (if (logtest? v1-21 (enemy-flag checking-water)) (set! v1-22 (logior v1-21 (enemy-flag enable-on-active))) (set! v1-22 (logclear v1-21 (enemy-flag enable-on-active))) ) ) - (set! (-> obj enemy-flags) v1-22) - (let ((f30-2 (+ 16384.0 (quaternion-y-angle (-> obj root quat)))) + (set! (-> this enemy-flags) v1-22) + (let ((f30-2 (+ 16384.0 (quaternion-y-angle (-> this root quat)))) (s5-1 (new 'stack-no-clear 'vector)) ) (set-vector! s5-1 (sin f30-2) 0.0 (cos f30-2) 1.0) (vector-normalize! s5-1 65536.0) (send-event - obj + this 'attack #f (static-attack-info ((id (new-attack-id)) (vector s5-1) (attacker-velocity s5-1) (knock (the-as uint 8)))) @@ -527,94 +527,94 @@ This commonly includes things such as: (none) ) -(defmethod go-hostile crocadog-escort ((obj crocadog-escort)) +(defmethod go-hostile crocadog-escort ((this crocadog-escort)) (cond - ((logtest? (bot-flags bf17) (-> obj bot-flags)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (logior! (-> obj focus-status) (focus-status disable)) - (go (method-of-object obj knocked-off-vehicle)) + ((logtest? (bot-flags bf17) (-> this bot-flags)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag check-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (logior! (-> this focus-status) (focus-status disable)) + (go (method-of-object this knocked-off-vehicle)) ) (else - (react-to-focus obj) + (react-to-focus this) ) ) ) ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus crocadog-escort ((obj crocadog-escort)) +(defmethod react-to-focus crocadog-escort ((this crocadog-escort)) "@TODO - flesh out docs" - (go-idle-or-move obj) + (go-idle-or-move this) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-waiting-turn crocadog-escort ((obj crocadog-escort)) - (go (method-of-object obj waiting-turn)) +(defmethod go-waiting-turn crocadog-escort ((this crocadog-escort)) + (go (method-of-object this waiting-turn)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle-or-move crocadog-escort ((obj crocadog-escort)) - (if (logtest? (-> obj bot-flags) (bot-flags bf15)) - (go (method-of-object obj move-to-vehicle)) - (go (method-of-object obj waiting-idle)) +(defmethod go-idle-or-move crocadog-escort ((this crocadog-escort)) + (if (logtest? (-> this bot-flags) (bot-flags bf15)) + (go (method-of-object this move-to-vehicle)) + (go (method-of-object this waiting-idle)) ) (none) ) -(defmethod play-walk-anim crocadog-escort ((obj crocadog-escort)) +(defmethod play-walk-anim crocadog-escort ((this crocadog-escort)) (with-pp - (let ((f30-0 (-> obj nav state speed))) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 9011.2 28672.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-7 (= v1-7 (-> obj draw art-group data 7))) - (let ((v1-12 (-> obj skel root-channel 1))) + ((and v1-7 (= v1-7 (-> this draw art-group data 7))) + (let ((v1-12 (-> this skel root-channel 1))) (set! (-> v1-12 frame-interp 1) f28-0) (set! (-> v1-12 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 28672.0 (* 0.15707962 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 7.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) - (a0-10 (-> obj skel root-channel 0)) + (a0-10 (-> this skel root-channel 0)) ) (set! (-> a0-10 param 0) f0-11) (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-11 (-> obj skel root-channel 1))) + (let ((a0-11 (-> this skel root-channel 1))) (set! (-> a0-11 param 0) 0.0) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 dist) 4206.592) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 7))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 7))) (set! (-> a0-13 param 0) 1.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 7)) num-func-loop!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 7)) num-func-loop!) ) - (let ((a0-14 (-> obj skel root-channel 1))) + (let ((a0-14 (-> this skel root-channel 1))) (set! (-> a0-14 frame-interp 1) f28-0) (set! (-> a0-14 frame-interp 0) f28-0) (set! (-> a0-14 dist) 13393.92) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 8))) (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 8)) num-func-chan) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 8)) num-func-chan) ) ) ) @@ -624,19 +624,19 @@ This commonly includes things such as: ) ) -(defmethod damage-amount-from-attack crocadog-escort ((obj crocadog-escort) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack crocadog-escort ((this crocadog-escort) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) -(defmethod bot-method-190 crocadog-escort ((obj crocadog-escort)) +(defmethod bot-method-190 crocadog-escort ((this crocadog-escort)) #t ) -(defmethod enemy-method-78 crocadog-escort ((obj crocadog-escort) (arg0 (pointer float))) +(defmethod enemy-method-78 crocadog-escort ((this crocadog-escort) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -648,14 +648,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle crocadog-escort ((obj crocadog-escort)) +(defmethod go-idle crocadog-escort ((this crocadog-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go-idle-or-move obj) + (go-idle-or-move this) ) ) (none) diff --git a/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc b/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc index 626fd1b1fc..5d8f956ada 100644 --- a/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc +++ b/goal_src/jak2/levels/city/kiddogescort/hal4-course.gc @@ -47,72 +47,72 @@ ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hal-escort ((obj hal-escort)) +(defmethod go-idle hal-escort ((this hal-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) ) -(defmethod init! hal-escort ((obj hal-escort)) +(defmethod init! hal-escort ((this hal-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type hal init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) - (set! (-> obj arrow-handle) (the-as handle #f)) - (set! (-> obj too-far-warn-dist-default) 61440.0) - (set! (-> obj too-far-fail-dist-delta-default) 2048000.0) - (set! (-> obj warn-to-fail-timeout) (the-as uint #x1b7740)) - (set! (-> obj warn-min-delay) (the-as uint 1200)) - (set! (-> obj warn-max-delay) (the-as uint 2100)) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set! (-> this arrestor-handle) (the-as handle #f)) + (set! (-> this arrow-handle) (the-as handle #f)) + (set! (-> this too-far-warn-dist-default) 61440.0) + (set! (-> this too-far-fail-dist-delta-default) 2048000.0) + (set! (-> this warn-to-fail-timeout) (the-as uint #x1b7740)) + (set! (-> this warn-min-delay) (the-as uint 1200)) + (set! (-> this warn-max-delay) (the-as uint 2100)) 0 (none) ) -(defmethod general-event-handler hal-escort ((obj hal-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler hal-escort ((this hal-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('notify) (case (-> arg3 param 0) (('arrest) - (set! (-> obj arrestor-handle) (process->handle (the-as process (-> arg3 param 1)))) + (set! (-> this arrestor-handle) (process->handle (the-as process (-> arg3 param 1)))) (let ((v0-0 (the-as object (current-time)))) - (set! (-> obj arrestor-time) (the-as time-frame v0-0)) + (set! (-> this arrestor-time) (the-as time-frame v0-0)) v0-0 ) ) (else - ((method-of-type hal general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hal general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type hal general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hal general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod init-enemy! hal-escort ((obj hal-escort)) +(defmethod init-enemy! hal-escort ((this hal-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type hal init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj channel) (the-as uint 20)) + (set! (-> this channel) (the-as uint 20)) 0 (none) ) -(defmethod hal-escort-method-235 hal-escort ((obj hal-escort)) - (let* ((s5-0 (handle->process (-> obj arrestor-handle))) +(defmethod hal-escort-method-235 hal-escort ((this hal-escort)) + (let* ((s5-0 (handle->process (-> this arrestor-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 ) @@ -120,52 +120,50 @@ ) (when v1-3 (cond - ((>= (- (current-time) (-> obj arrestor-time)) (seconds 4)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + ((time-elapsed? (-> this arrestor-time) (seconds 4)) + (set! (-> this arrestor-handle) (the-as handle #f)) ) ((focus-test? (the-as process-focusable v1-3) hit) - (when (and (>= (- (current-time) (-> obj played-defend-time)) (seconds 6)) - (not (channel-active? obj (the-as uint 0))) - ) + (when (and (time-elapsed? (-> this played-defend-time) (seconds 6)) (not (channel-active? this (the-as uint 0)))) (let ((a1-5 (bot-speech-list-method-9 - (-> obj hal4-course defend-speeches) - obj - (-> obj hal4-course speeches) + (-> this hal4-course defend-speeches) + this + (-> this hal4-course speeches) (speech-flags) ) ) ) (when (>= a1-5 0) - (play-speech obj a1-5) - (set! (-> obj played-defend-time) (current-time)) + (play-speech this a1-5) + (set-time! (-> this played-defend-time)) ) ) ) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this arrestor-handle) (the-as handle #f)) ) ) ) ) - (if (and (not (speech-playing? obj 30)) - (nonzero? (-> obj played-defend-time)) - (>= (- (current-time) (-> obj played-defend-time)) (seconds 3)) - (not (channel-active? obj (the-as uint 0))) + (if (and (not (speech-playing? this 30)) + (nonzero? (-> this played-defend-time)) + (time-elapsed? (-> this played-defend-time) (seconds 3)) + (not (channel-active? this (the-as uint 0))) ) - (play-speech obj 30) + (play-speech this 30) ) (none) ) -(defmethod vehicle-destroyed? hal-escort ((obj hal-escort)) - (let ((v1-1 (handle->process (-> obj vehicle-handle)))) +(defmethod vehicle-destroyed? hal-escort ((this hal-escort)) + (let ((v1-1 (handle->process (-> this vehicle-handle)))) (or (not v1-1) (logtest? (-> (the-as vehicle v1-1) flags) (rigid-body-object-flag dead))) ) ) -(defmethod hal-escort-method-227 hal-escort ((obj hal-escort)) +(defmethod hal-escort-method-227 hal-escort ((this hal-escort)) (let ((s5-0 *target*)) (when (focus-test? s5-0 pilot-riding pilot) - (let* ((a0-2 (-> obj actor-group 0 data 1 actor)) + (let* ((a0-2 (-> this actor-group 0 data 1 actor)) (v1-5 (when a0-2 (let ((s4-0 (-> a0-2 extra process))) (if (type? s4-0 process-focusable) @@ -176,7 +174,7 @@ ) ) (when (focus-test? (the-as process-focusable v1-5) pilot-riding pilot) - (let* ((v1-12 (-> obj actor-group 0 data 2 actor)) + (let* ((v1-12 (-> this actor-group 0 data 2 actor)) (a0-5 (when v1-12 (let ((s4-1 (-> v1-12 extra process))) (if (type? s4-1 process-focusable) @@ -191,7 +189,7 @@ (and (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-5) 0) (get-trans s5-0 0)) ) - (>= (current-time) (-> obj dont-fail-until)) + (>= (current-time) (-> this dont-fail-until)) ) ) ) @@ -203,8 +201,8 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod hal-escort-method-228 hal-escort ((obj hal-escort)) - (let* ((v1-3 (-> obj actor-group 0 data 1 actor)) +(defmethod hal-escort-method-228 hal-escort ((this hal-escort)) + (let* ((v1-3 (-> this actor-group 0 data 1 actor)) (a0-1 (when v1-3 (let ((s5-0 (-> v1-3 extra process))) (if (type? s5-0 process-focusable) @@ -223,7 +221,7 @@ (and (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-1) 0) (get-trans s5-1 0)) ) - (>= (current-time) (-> obj dont-fail-until)) + (>= (current-time) (-> this dont-fail-until)) ) ) ) @@ -232,9 +230,9 @@ ) ) -(defmethod hal-escort-method-234 hal-escort ((obj hal-escort) (arg0 nav-mesh)) +(defmethod hal-escort-method-234 hal-escort ((this hal-escort) (arg0 nav-mesh)) (let ((s2-0 (the-as process #f))) - (let* ((v1-3 (-> obj actor-group 0 data 1 actor)) + (let* ((v1-3 (-> this actor-group 0 data 1 actor)) (gp-0 (when v1-3 (let ((s5-0 (-> v1-3 extra process))) (if (type? s5-0 process-focusable) @@ -271,7 +269,7 @@ (set! (-> s2-2 nav-mesh) arg0) (set! (-> s2-2 nav-branch) #f) (set! (-> s2-2 proc) #f) - (let ((v1-25 (-> obj actor-group 0 data 1 actor))) + (let ((v1-25 (-> this actor-group 0 data 1 actor))) (set! (-> s2-2 handle) (process->handle (when v1-25 (let ((s4-1 (-> v1-25 extra process))) (if (type? s4-1 process-focusable) @@ -300,10 +298,10 @@ ) ) -(defmethod try-enter-vehicle hal-escort ((obj hal-escort)) +(defmethod try-enter-vehicle hal-escort ((this hal-escort)) "Returns seat index" - (let* ((gp-0 (handle->process (-> obj vehicle-handle))) - (v1-6 (-> obj actor-group 0 data 1 actor)) + (let* ((gp-0 (handle->process (-> this vehicle-handle))) + (v1-6 (-> this actor-group 0 data 1 actor)) (s5-0 (when v1-6 (let ((s4-0 (-> v1-6 extra process))) (if (type? s4-0 process-focusable) @@ -331,9 +329,9 @@ ) ) -(defmethod hal-escort-method-232 hal-escort ((obj hal-escort)) +(defmethod hal-escort-method-232 hal-escort ((this hal-escort)) (let* ((target *target*) - (v1-3 (-> obj actor-group 0 data 1 actor)) + (v1-3 (-> this actor-group 0 data 1 actor)) (s5-0 (when v1-3 (let ((s3-0 (-> v1-3 extra process))) (if (type? s3-0 process-focusable) @@ -342,7 +340,7 @@ ) ) ) - (a0-2 (-> obj actor-group 0 data 2 actor)) + (a0-2 (-> this actor-group 0 data 2 actor)) (v1-8 (when a0-2 (let ((s3-1 (-> a0-2 extra process))) (if (type? s3-1 process-focusable) @@ -359,7 +357,7 @@ v1-8 (not (focus-test? (the-as process-focusable s5-0) pilot-riding)) (not (focus-test? (the-as process-focusable v1-8) pilot-riding)) - (>= (- (current-time) (-> obj locked-player-time)) (seconds 10)) + (time-elapsed? (-> this locked-player-time) (seconds 10)) ) (remove-setting! 'pilot-exit) (set-setting! 'pilot #f 0.0 0) @@ -368,7 +366,7 @@ ) ((focus-test? target pilot-riding) (when (and (nonzero? (-> target pilot)) - (and (= (handle->process (-> target pilot vehicle)) (handle->process (-> obj vehicle-handle))) + (and (= (handle->process (-> target pilot vehicle)) (handle->process (-> this vehicle-handle))) (or (and s5-0 (focus-test? (the-as process-focusable s5-0) pilot)) (and v1-8 (focus-test? (the-as process-focusable v1-8) pilot)) ) @@ -376,7 +374,7 @@ ) (set-setting! 'pilot-exit #f 0.0 0) (apply-settings *setting-control*) - (set! (-> obj locked-player-time) (current-time)) + (set-time! (-> this locked-player-time)) ) ) ) @@ -387,7 +385,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-traffic-params! hal-escort ((obj hal-escort) (arg0 symbol)) +(defmethod init-traffic-params! hal-escort ((this hal-escort) (arg0 symbol)) (let ((gp-0 *traffic-manager*)) (send-event gp-0 'deactivate-all) (send-event gp-0 'set-guard-multi-focus #t) @@ -401,7 +399,7 @@ (when arg0 (send-event gp-0 'set-guard-force-visible #t) (let ((s4-1 (new 'stack 'traffic-object-spawn-params))) - (let ((v1-51 (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 0))) + (let ((v1-51 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))) (set! (-> s4-1 object-type) (traffic-type crimson-guard-1)) (set! (-> s4-1 behavior) (the-as uint 3)) (set! (-> s4-1 id) (the-as uint 0)) @@ -414,7 +412,7 @@ (set! (-> s4-1 flags) (traffic-spawn-flags)) (set! (-> s4-1 guard-type) (the-as uint 7)) (vector-reset! (-> s4-1 velocity)) - (set! (-> s4-1 position quad) (-> obj hal4-course spots 5 center quad)) + (set! (-> s4-1 position quad) (-> this hal4-course spots 5 center quad)) (quaternion-identity! (-> s4-1 rotation)) (send-event gp-0 'activate-object s4-1) ) @@ -423,7 +421,7 @@ (none) ) -(defmethod set-traffic-danger! hal-escort ((obj hal-escort)) +(defmethod set-traffic-danger! hal-escort ((this hal-escort)) (let ((a0-1 *target*)) (when a0-1 (let ((gp-0 (new 'stack-no-clear 'traffic-danger-info))) @@ -443,7 +441,7 @@ (none) ) -(defmethod hal-escort-method-230 hal-escort ((obj hal-escort)) +(defmethod hal-escort-method-230 hal-escort ((this hal-escort)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -452,7 +450,7 @@ (let ((gp-0 (new 'stack-no-clear 'matrix)) (s5-0 528) ) - (let ((v1-2 (-> obj hal4-course spots 9))) + (let ((v1-2 (-> this hal4-course spots 9))) (set! (-> gp-0 vector 1 quad) (-> v1-2 center quad)) (set! (-> gp-0 vector 1 w) (+ 81920.0 (-> v1-2 center w))) ) @@ -571,10 +569,10 @@ ) ) -(defmethod play-too-far-warn-speech hal-escort ((obj hal-escort)) - (when (not (channel-active? obj (the-as uint 0))) +(defmethod play-too-far-warn-speech hal-escort ((this hal-escort)) + (when (not (channel-active? this (the-as uint 0))) (let ((s5-0 0)) - (let* ((v1-5 (-> obj actor-group 0 data 1 actor)) + (let* ((v1-5 (-> this actor-group 0 data 1 actor)) (s4-0 (when v1-5 (let ((s3-0 (-> v1-5 extra process))) (if (type? s3-0 process-focusable) @@ -584,7 +582,7 @@ ) ) ) - (let* ((a0-3 (-> obj actor-group 0 data 2 actor)) + (let* ((a0-3 (-> this actor-group 0 data 2 actor)) (v1-10 (when a0-3 (let ((s3-1 (-> a0-3 extra process))) (if (type? s3-1 process-focusable) @@ -601,7 +599,7 @@ ) ) (let ((s3-2 #f)) - (when (and (>= (-> obj waypoint waypoint-id) 19) *target*) + (when (and (>= (-> this waypoint waypoint-id) 19) *target*) (let* ((f30-0 (-> (get-trans (the-as process-focusable s4-0) 1) y)) (f0-1 (- (-> (get-trans *target* 1) y) f30-0)) ) @@ -621,7 +619,7 @@ (let ((s3-3 (new 'stack-no-clear 'vector))) (vector-! s3-3 (target-pos 0) (-> (the-as process-focusable s4-0) root trans)) (vector-normalize! s3-3 1.0) - (if (>= (vector-dot s3-3 (-> obj follow-dir)) 0.0) + (if (>= (vector-dot s3-3 (-> this follow-dir)) 0.0) (set! s5-0 (logior s5-0 8)) (set! s5-0 (logior s5-0 16)) ) @@ -630,15 +628,15 @@ ) ) (let ((a1-7 (bot-speech-list-method-9 - (-> obj hal4-course too-far-warn-speeches) - obj - (-> obj hal4-course speeches) + (-> this hal4-course too-far-warn-speeches) + this + (-> this hal4-course speeches) (the-as speech-flags s5-0) ) ) ) (when (>= a1-7 0) - (play-speech obj a1-7) + (play-speech this a1-7) #t ) ) @@ -949,7 +947,7 @@ (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-escort)) (if (and (not (speech-playing? arg1 3)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1)) (not (channel-active? arg1 (the-as uint 0))) ) (play-speech arg1 3) @@ -1200,7 +1198,7 @@ ) (if (and (not (speech-playing? arg1 14)) (not (-> *setting-control* user-current pilot-exit)) - (>= (- (current-time) (-> arg1 locked-player-time)) (seconds 1.5)) + (time-elapsed? (-> arg1 locked-player-time) (seconds 1.5)) ) (play-speech arg1 14) ) @@ -1302,7 +1300,7 @@ ) (when (and (zero? (-> arg0 locked-player-time)) (or (not (speech-playing? arg0 33)) (not (speech-playing? arg0 34))) - (>= (- (current-time) (-> arg0 played-get-in-time)) (seconds 6)) + (time-elapsed? (-> arg0 played-get-in-time) (seconds 6)) (not (channel-active? arg0 (the-as uint 0))) ) (let ((a0-18 (handle->process (-> arg0 vehicle-handle)))) @@ -1314,7 +1312,7 @@ 33 ) ) - (set! (-> arg0 played-get-in-time) (current-time)) + (set-time! (-> arg0 played-get-in-time)) ) ) ) @@ -1335,44 +1333,42 @@ (set! (-> v1-1 bytes 6) 7) (set! (-> v1-1 bytes 4) 0) (set! (-> (the-as halt-wait-spot v1-1) check-done) - (the-as - (function halt-wait-spot hal symbol) - (lambda ((arg0 object) (arg1 hal-escort)) - (if (!= (level-status *level* 'ctyinda) 'active) - (set! (-> arg1 waypoint-time0) (current-time)) + (the-as (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-escort)) + (if (!= (level-status *level* 'ctyinda) 'active) + (set-time! (-> arg1 waypoint-time0)) + ) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.25)) + (let* ((v1-11 (-> arg1 actor-group 0 data 2 actor)) + (s5-1 (when v1-11 + (let ((s4-0 (-> v1-11 extra process))) + (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + ) + (v1-16 (-> arg1 actor-group 0 data 1 actor)) + (s4-1 (when v1-16 + (let ((s3-0 (-> v1-16 extra process))) + (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + ) + ) + (send-event s5-1 'hide #f) + (send-event s4-1 'hide #f) + (send-event s5-1 'skip) + (send-event s4-1 'skip) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 19 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.25)) - (let* ((v1-11 (-> arg1 actor-group 0 data 2 actor)) - (s5-1 (when v1-11 - (let ((s4-0 (-> v1-11 extra process))) - (if (type? s4-0 process-focusable) - s4-0 - ) - ) - ) - ) - (v1-16 (-> arg1 actor-group 0 data 1 actor)) - (s4-1 (when v1-16 - (let ((s3-0 (-> v1-16 extra process))) - (if (type? s3-0 process-focusable) - s3-0 - ) - ) - ) - ) - ) - (send-event s5-1 'hide #f) - (send-event s4-1 'hide #f) - (send-event s5-1 'skip) - (send-event s4-1 'skip) - ) - (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) - (go-to-waypoint! arg1 19 #f) - (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) - #t - ) - ) - ) ) ) (none) @@ -1436,7 +1432,7 @@ (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-escort)) (when (and (not (speech-playing? arg1 4)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (not (channel-active? arg1 (the-as uint 0))) ) (play-speech arg1 15) @@ -1674,7 +1670,7 @@ ) ) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.75)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.75)) ) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let ((s5-0 *traffic-manager*)) @@ -1685,7 +1681,7 @@ ) ) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.2)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.2)) ) (let* ((v1-55 (-> arg1 actor-group 0 data 2 actor)) (s5-1 (when v1-55 @@ -1713,7 +1709,7 @@ (send-event s5-1 'request 'waypoint 26) ) ) - (when (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (not (channel-active? arg1 (the-as uint 0))) (scene-play arg1 "dig-knock-down-scaffolding-intro" #t) ) @@ -1815,7 +1811,7 @@ (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-escort)) (with-pp - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) diff --git a/goal_src/jak2/levels/city/kiddogescort/kidesc-states.gc b/goal_src/jak2/levels/city/kiddogescort/kidesc-states.gc index 1e7a4450c5..6f190e63dc 100644 --- a/goal_src/jak2/levels/city/kiddogescort/kidesc-states.gc +++ b/goal_src/jak2/levels/city/kiddogescort/kidesc-states.gc @@ -11,7 +11,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -86,7 +86,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -136,7 +136,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -168,10 +168,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (check-arrest self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -202,7 +202,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -238,10 +238,10 @@ (logclear! (-> self bot-flags) (bot-flags bf15)) (check-arrest self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -295,7 +295,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -443,7 +443,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -525,7 +525,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -679,7 +679,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -703,7 +703,7 @@ ) (go-virtual arrested) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (if (logtest? (-> self bot-flags) (bot-flags bf15)) (go-virtual move-to-vehicle) (go-virtual traveling) @@ -739,7 +739,7 @@ (go-virtual arrested) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (when (not (nav-enemy-method-163 self)) (if (logtest? (-> self bot-flags) (bot-flags bf15)) (go-virtual move-to-vehicle) @@ -807,7 +807,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -885,7 +885,7 @@ (when (not (logtest? (bot-flags bf19) (-> self bot-flags))) (until #f (until (ja-done? 0) - (if (>= (- (current-time) (-> self state-time)) (seconds 2.5)) + (if (time-elapsed? (-> self state-time) (seconds 2.5)) (goto cfg-27) ) (suspend) @@ -907,11 +907,11 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) @@ -949,7 +949,7 @@ (until #f (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) @@ -982,7 +982,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/goal_src/jak2/levels/city/kiddogescort/kidesc-task.gc b/goal_src/jak2/levels/city/kiddogescort/kidesc-task.gc index f3f8c9472a..7c46f8a656 100644 --- a/goal_src/jak2/levels/city/kiddogescort/kidesc-task.gc +++ b/goal_src/jak2/levels/city/kiddogescort/kidesc-task.gc @@ -7,42 +7,42 @@ ;; DECOMP BEGINS -(defmethod reset-task! kidesct-wait-spot ((obj kidesct-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! kidesct-wait-spot ((this kidesct-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kidesct-wait-spot ((obj kidesct-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 kidesct-wait-spot ((this kidesct-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as kid-escort arg0)) + ((-> this check-done) this (the-as kid-escort arg0)) (none) ) diff --git a/goal_src/jak2/levels/city/kiddogescort/kidesc.gc b/goal_src/jak2/levels/city/kiddogescort/kidesc.gc index 3638d07b58..691699f8f3 100644 --- a/goal_src/jak2/levels/city/kiddogescort/kidesc.gc +++ b/goal_src/jak2/levels/city/kiddogescort/kidesc.gc @@ -180,76 +180,73 @@ (set! (-> *kid-escort-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler kid-escort ((obj kid-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler kid-escort ((this kid-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('arrest) - (let* ((s4-0 (handle->process (-> obj arrestor-handle))) + (let* ((s4-0 (handle->process (-> this arrestor-handle))) (v1-4 (if (type? s4-0 process-focusable) s4-0 ) ) ) - (when (or (not v1-4) - (= v1-4 arg0) - (and (!= v1-4 arg0) (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.1))) - ) - (set! (-> obj arrestor-handle) (process->handle arg0)) - (set! (-> obj arrest-attempt-time) (current-time)) + (when (or (not v1-4) (= v1-4 arg0) (and (!= v1-4 arg0) (time-elapsed? (-> this arrest-attempt-time) (seconds 0.1)))) + (set! (-> this arrestor-handle) (process->handle arg0)) + (set-time! (-> this arrest-attempt-time)) (if (!= v1-4 arg0) - (send-event (handle->process (-> obj master-handle)) 'notify 'arrest arg0) + (send-event (handle->process (-> this master-handle)) 'notify 'arrest arg0) ) ) ) #t ) (('instant-arrest) - (logior! (-> obj bot-flags) (bot-flags bf19)) + (logior! (-> this bot-flags) (bot-flags bf19)) (let ((s5-1 (the-as crimson-guard (-> arg3 param 0)))) - (set! (-> obj arrestor-handle) (process->handle s5-1)) - (set! (-> obj arrest-attempt-time) (current-time)) + (set! (-> this arrestor-handle) (process->handle s5-1)) + (set-time! (-> this arrest-attempt-time)) (let ((a1-11 (new 'stack-no-clear 'vector))) - (vector-! a1-11 (-> s5-1 root trans) (-> obj root trans)) + (vector-! a1-11 (-> s5-1 root trans) (-> this root trans)) (set! (-> a1-11 y) 0.0) - (forward-up->quaternion (-> obj root quat) a1-11 *up-vector*) + (forward-up->quaternion (-> this root quat) a1-11 *up-vector*) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (send-event (handle->process (-> obj master-handle)) 'notify 'arrest s5-1) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (send-event (handle->process (-> this master-handle)) 'notify 'arrest s5-1) ) - (go (method-of-object obj arrested)) + (go (method-of-object this arrested)) ) (('attack) - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) #f ) (('nav-mesh-kill) - (change-to *default-nav-mesh* obj) + (change-to *default-nav-mesh* this) #t ) (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod run-logic? kid-escort ((obj kid-escort)) +(defmethod run-logic? kid-escort ((this kid-escort)) (or (not (logtest? (process-mask enemy) (-> *setting-control* user-current process-mask))) - (logtest? (-> obj bot-flags) (bot-flags bf09)) + (logtest? (-> this bot-flags) (bot-flags bf09)) ) ) -(defmethod enemy-method-97 kid-escort ((obj kid-escort)) - (let* ((s4-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 kid-escort ((this kid-escort)) + (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) - (s3-0 (handle->process (-> obj arrestor-handle))) + (s3-0 (handle->process (-> this arrestor-handle))) (s4-1 (if (type? s3-0 process-focusable) s3-0 ) @@ -258,33 +255,33 @@ (when s5-0 (cond ((= (-> s5-0 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 1.5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 6)) + (when (time-elapsed? (-> this attacker-time) (seconds 6)) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) (when s4-1 - (when (or (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.5)) + (when (or (time-elapsed? (-> this arrest-attempt-time) (seconds 0.5)) (focus-test? (the-as process-focusable s4-1) dead hit) ) (set! s4-1 (the-as process #f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this arrestor-handle) (the-as handle #f)) ) ) - (let ((v1-34 (-> obj focus-mode)) + (let ((v1-34 (-> this focus-mode)) (s3-1 (the-as process #f)) ) (cond @@ -296,11 +293,11 @@ (s5-0 (set! s3-1 s5-0) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else - (let ((s5-1 (handle->process (-> obj poi-handle)))) + (let ((s5-1 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-1 process-focusable) s5-1 ) @@ -322,7 +319,7 @@ (set! s3-1 s5-0) ) (else - (let ((s5-2 (handle->process (-> obj poi-handle)))) + (let ((s5-2 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-2 process-focusable) s5-2 ) @@ -332,7 +329,7 @@ (s3-1 (empty) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else @@ -345,14 +342,14 @@ ) (cond (s3-1 - (try-update-focus (-> obj focus) (the-as process-focusable s3-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s3-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s3-1 @@ -361,31 +358,31 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? kid-escort ((obj kid-escort)) +(defmethod alive? kid-escort ((this kid-escort)) (let ((t9-0 (method-of-type bot alive?))) - (the-as symbol (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) - ) + (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) + ) ) ) ) ) -(defmethod init-from-entity! kid-escort ((obj kid-escort) (arg0 entity-actor)) +(defmethod init-from-entity! kid-escort ((this kid-escort) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - ((method-of-type bot init-from-entity!) obj arg0) + (stack-size-set! (-> this main-thread) 512) + ((method-of-type bot init-from-entity!) this arg0) (none) ) -(defmethod init-enemy-collision! kid-escort ((obj kid-escort)) +(defmethod init-enemy-collision! kid-escort ((this kid-escort)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -450,41 +447,41 @@ This commonly includes things such as: ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init! kid-escort ((obj kid-escort)) +(defmethod init! kid-escort ((this kid-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj min-speed) 18022.4) - (set! (-> obj max-speed) 18432.0) - (set! (-> obj channel) (the-as uint 26)) - (set! (-> obj notice-enemy-dist) 122880.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 0.0) - (set-vector! (-> obj root scale) 1.2 1.2 1.2 1.0) - (set! (-> obj spot-color) (the-as uint #x60004f8f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) - (set! (-> obj crocadog-handle) (the-as handle #f)) + (set! (-> this min-speed) 18022.4) + (set! (-> this max-speed) 18432.0) + (set! (-> this channel) (the-as uint 26)) + (set! (-> this notice-enemy-dist) 122880.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 0.0) + (set-vector! (-> this root scale) 1.2 1.2 1.2 1.0) + (set! (-> this spot-color) (the-as uint #x60004f8f)) + (set! (-> this arrestor-handle) (the-as handle #f)) + (set! (-> this crocadog-handle) (the-as handle #f)) 0 (none) ) -(defmethod init-enemy! kid-escort ((obj kid-escort)) +(defmethod init-enemy! kid-escort ((this kid-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) + (init! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-kid-escort" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *kid-escort-nav-enemy-info*) - (let ((v1-7 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *kid-escort-nav-enemy-info*) + (let ((v1-7 (-> this neck))) (set! (-> v1-7 up) (the-as uint 1)) (set! (-> v1-7 nose) (the-as uint 2)) (set! (-> v1-7 ear) (the-as uint 0)) @@ -492,70 +489,70 @@ This commonly includes things such as: (set! (-> v1-7 ignore-angle) 30947.555) ) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (let ((v1-10 (-> obj nav))) + (let ((v1-10 (-> this nav))) (set! (-> v1-10 sphere-mask) (the-as uint 126)) ) 0 - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) -(defmethod bot-method-214 kid-escort ((obj kid-escort)) +(defmethod bot-method-214 kid-escort ((this kid-escort)) #f ) ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kid-escort ((obj kid-escort)) +(defmethod react-to-focus kid-escort ((this kid-escort)) "@TODO - flesh out docs" - (check-arrest obj) + (check-arrest this) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-waiting-turn kid-escort ((obj kid-escort)) - (go (method-of-object obj waiting-turn)) +(defmethod go-waiting-turn kid-escort ((this kid-escort)) + (go (method-of-object this waiting-turn)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod check-arrest kid-escort ((obj kid-escort)) - (let ((s5-0 (handle->process (-> obj arrestor-handle)))) +(defmethod check-arrest kid-escort ((this kid-escort)) + (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) s5-0 ) - (go (method-of-object obj arrested)) + (go (method-of-object this arrested)) ) - ((logtest? (-> obj bot-flags) (bot-flags bf15)) - (go (method-of-object obj move-to-vehicle)) + ((logtest? (-> this bot-flags) (bot-flags bf15)) + (go (method-of-object this move-to-vehicle)) ) (else - (go (method-of-object obj waiting-idle)) + (go (method-of-object this waiting-idle)) ) ) ) (none) ) -(defmethod play-walk-anim kid-escort ((obj kid-escort)) +(defmethod play-walk-anim kid-escort ((this kid-escort)) (with-pp - (let ((f30-0 (-> obj nav state speed)) - (v1-5 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f30-0 (-> this nav state speed)) + (v1-5 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-5 (= v1-5 (-> obj draw art-group data 4))) - (let* ((f28-0 (current-cycle-distance (-> obj skel))) - (f0-1 (quaternion-y-angle (-> obj root quat))) - (f1-0 (deg- f0-1 (-> obj travel-prev-ry))) + ((and v1-5 (= v1-5 (-> this draw art-group data 4))) + (let* ((f28-0 (current-cycle-distance (-> this skel))) + (f0-1 (quaternion-y-angle (-> this root quat))) + (f1-0 (deg- f0-1 (-> this travel-prev-ry))) (f0-4 (fmin 18432.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-0)))) (f0-7 (/ (* 8.0 (fmax f30-0 f0-4)) (* 15.0 f28-0))) - (a0-8 (-> obj skel root-channel 0)) + (a0-8 (-> this skel root-channel 0)) ) (set! (-> a0-8 param 0) f0-7) (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) @@ -563,11 +560,11 @@ This commonly includes things such as: ) (else (ja-channel-push! 1 (seconds 0.15)) - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 dist) 6553.6) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-10 param 0) 1.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-loop!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-loop!) ) ) ) @@ -576,19 +573,19 @@ This commonly includes things such as: ) ) -(defmethod damage-amount-from-attack kid-escort ((obj kid-escort) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack kid-escort ((this kid-escort) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) -(defmethod bot-method-190 kid-escort ((obj kid-escort)) +(defmethod bot-method-190 kid-escort ((this kid-escort)) #t ) -(defmethod enemy-method-78 kid-escort ((obj kid-escort) (arg0 (pointer float))) +(defmethod enemy-method-78 kid-escort ((this kid-escort) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -600,44 +597,44 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kid-escort ((obj kid-escort) (arg0 vector)) +(defmethod set-cam-height! kid-escort ((this kid-escort) (arg0 vector)) (the-as meters (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'arrested)) + ((and (-> this next-state) (= (-> this next-state name) 'arrested)) (set-vector! arg0 49152.0 12288.0 49152.0 1.0) - (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) - (if (focus-test? obj under-water) - (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) ) ) (else - ((method-of-type bot set-cam-height!) obj arg0) + ((method-of-type bot set-cam-height!) this arg0) ) ) ) ) -(defmethod get-penetrate-info kid-escort ((obj kid-escort)) +(defmethod get-penetrate-info kid-escort ((this kid-escort)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" - (let ((v1-1 ((method-of-type bot get-penetrate-info) obj))) + (let ((v1-1 ((method-of-type bot get-penetrate-info) this))) (logior (penetrate jak-yellow-shot jak-red-shot jak-blue-shot) v1-1) ) ) -(defmethod bot-method-193 kid-escort ((obj kid-escort)) +(defmethod bot-method-193 kid-escort ((this kid-escort)) (let* ((t9-0 (method-of-type bot bot-method-193)) - (v0-0 (t9-0 obj)) + (v0-0 (t9-0 this)) ) - (if (and (not v0-0) (logtest? #x1c00000 (-> obj incoming penetrate-using))) + (if (and (not v0-0) (logtest? #x1c00000 (-> this incoming penetrate-using))) (set! v0-0 #t) ) v0-0 ) ) -(defmethod enemy-method-79 kid-escort ((obj kid-escort) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 kid-escort ((this kid-escort) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (gp-0 symbol)) (case arg0 ((3) @@ -646,7 +643,7 @@ This commonly includes things such as: (if (>= (ja-aframe-num 0) 5.0) (set! f30-0 0.28) ) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) f30-0) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) @@ -654,29 +651,29 @@ This commonly includes things such as: ) ) (else - (set! gp-0 ((method-of-type bot enemy-method-79) obj arg0 arg1)) + (set! gp-0 ((method-of-type bot enemy-method-79) this arg0 arg1)) ) ) gp-0 ) -(defmethod want-exit-vehicle? kid-escort ((obj kid-escort) (arg0 vector)) - (let ((s3-0 (handle->process (-> obj vehicle-handle)))) - (if (or (not s3-0) (not (-> obj nav))) +(defmethod want-exit-vehicle? kid-escort ((this kid-escort) (arg0 vector)) + (let ((s3-0 (handle->process (-> this vehicle-handle)))) + (if (or (not s3-0) (not (-> this nav))) (return #f) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (compute-seat-position (the-as vehicle s3-0) s4-0 (-> obj vehicle-seat-index)) + (compute-seat-position (the-as vehicle s3-0) s4-0 (-> this vehicle-seat-index)) (vector-! s4-0 s4-0 (-> (the-as vehicle s3-0) root trans)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 (+ 14336.0 (vector-length s4-0))) (vector+! s4-0 s4-0 (-> (the-as vehicle s3-0) root trans)) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (when (enemy-above-ground? obj s3-1 s4-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (when (enemy-above-ground? this s3-1 s4-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s4-0 y) (-> s3-1 best-other-tri intersect y)) (let ((s3-2 (new 'stack-no-clear 'vector))) - (do-navigation-to-destination (-> obj nav state) (-> obj root trans)) - (when (cloest-point-on-mesh (-> obj nav) s3-2 s4-0 (the-as nav-poly #f)) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) + (when (cloest-point-on-mesh (-> this nav) s3-2 s4-0 (the-as nav-poly #f)) (let ((f0-4 2048.0)) (when (>= (* f0-4 f0-4) (vector-vector-xz-distance-squared s3-2 s4-0)) (set! (-> arg0 quad) (-> s3-2 quad)) @@ -691,37 +688,37 @@ This commonly includes things such as: ) ) -(defmethod check-vehicle-exit kid-escort ((obj kid-escort)) +(defmethod check-vehicle-exit kid-escort ((this kid-escort)) (local-vars (v1-25 enemy-flag)) - (when (focus-test? obj pilot) - (let ((s5-0 (handle->process (-> obj vehicle-handle)))) + (when (focus-test? this pilot) + (let ((s5-0 (handle->process (-> this vehicle-handle)))) (when (or (not s5-0) (logtest? (-> (the-as vehicle s5-0) flags) (rigid-body-object-flag dead))) - (logior! (-> obj bot-flags) (bot-flags bf17)) - (logclear! (-> obj bot-flags) (bot-flags bf15)) - (logclear! (-> obj focus-status) (focus-status pilot-riding pilot)) + (logior! (-> this bot-flags) (bot-flags bf17)) + (logclear! (-> this bot-flags) (bot-flags bf15)) + (logclear! (-> this focus-status) (focus-status pilot-riding pilot)) (if (the-as vehicle s5-0) - (remove-rider (the-as vehicle s5-0) obj) + (remove-rider (the-as vehicle s5-0) this) ) - (set! (-> obj vehicle-seat-index) -1) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (logior! (-> obj root nav-flags) (nav-flags has-root-sphere)) - (let* ((s4-0 (-> obj root quat)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this vehicle-handle) (the-as handle #f)) + (logior! (-> this root nav-flags) (nav-flags has-root-sphere)) + (let* ((s4-0 (-> this root quat)) (f30-0 (quaternion-y-angle s4-0)) ) (quaternion-identity! s4-0) (quaternion-rotate-y! s4-0 s4-0 f30-0) ) - (let ((v1-24 (-> obj enemy-flags))) + (let ((v1-24 (-> this enemy-flags))) (if (logtest? v1-24 (enemy-flag checking-water)) (set! v1-25 (logior v1-24 (enemy-flag enable-on-active))) (set! v1-25 (logclear v1-24 (enemy-flag enable-on-active))) ) ) - (set! (-> obj enemy-flags) v1-25) - (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> (the-as vehicle s5-0) root trans)))) + (set! (-> this enemy-flags) v1-25) + (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> (the-as vehicle s5-0) root trans)))) (vector-normalize! s4-2 57344.0) (send-event - obj + this 'attack #f (static-attack-info ((id (new-attack-id)) (vector s4-2) (attacker-velocity s4-2) (knock (the-as uint 8)))) @@ -734,42 +731,42 @@ This commonly includes things such as: (none) ) -(defmethod go-hostile kid-escort ((obj kid-escort)) +(defmethod go-hostile kid-escort ((this kid-escort)) (cond - ((logtest? (bot-flags bf17) (-> obj bot-flags)) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (logior! (-> obj focus-status) (focus-status disable)) - (go (method-of-object obj knocked-off-vehicle)) + ((logtest? (bot-flags bf17) (-> this bot-flags)) + (logior! (-> this bot-flags) (bot-flags bf09)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag check-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (logior! (-> this focus-status) (focus-status disable)) + (go (method-of-object this knocked-off-vehicle)) ) (else - (react-to-focus obj) + (react-to-focus this) ) ) ) -(defmethod enemy-method-102 kid-escort ((obj kid-escort)) - (if (logtest? (bot-flags bf19) (-> obj bot-flags)) +(defmethod enemy-method-102 kid-escort ((this kid-escort)) + (if (logtest? (bot-flags bf19) (-> this bot-flags)) #f - ((method-of-type bot enemy-method-102) obj) + ((method-of-type bot enemy-method-102) this) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kid-escort ((obj kid-escort)) +(defmethod go-idle kid-escort ((this kid-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (check-arrest obj) + (check-arrest this) ) ) (none) diff --git a/goal_src/jak2/levels/city/kiddogescort/kidesc4-course.gc b/goal_src/jak2/levels/city/kiddogescort/kidesc4-course.gc index 55d18bbebf..6aabf6b013 100644 --- a/goal_src/jak2/levels/city/kiddogescort/kidesc4-course.gc +++ b/goal_src/jak2/levels/city/kiddogescort/kidesc4-course.gc @@ -365,7 +365,7 @@ (the-as (function kidesct-wait-spot kid-escort symbol) (lambda ((arg0 object) (arg1 kid-escort)) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (let ((v1-4 (-> arg1 spot))) (set! (-> v1-4 center quad) (-> arg1 root trans quad)) (set! (-> v1-4 center w) 20480.0) diff --git a/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc b/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc index 685dc48984..91aad3d094 100644 --- a/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc +++ b/goal_src/jak2/levels/city/market/ashelin/ash4-course.gc @@ -21,26 +21,26 @@ ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ashelin-tanker ((obj ashelin-tanker)) +(defmethod go-idle ashelin-tanker ((this ashelin-tanker)) (cond ((task-node-closed? (game-task-node city-intercept-tanker-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj hidden)) + (go (method-of-object this hidden)) ) ) (none) ) ;; WARN: Return type mismatch vector vs none. -(defmethod init! ashelin-tanker ((obj ashelin-tanker)) +(defmethod init! ashelin-tanker ((this ashelin-tanker)) "Set defaults for various fields." (let ((t9-0 (method-of-type ashelin init!))) - (t9-0 obj) + (t9-0 this) ) - (let ((v1-1 (-> obj suppress))) + (let ((v1-1 (-> this suppress))) (set! (-> v1-1 duration) (seconds 1)) (set! (-> v1-1 id) -1) (let ((a0-4 (-> v1-1 bbox))) @@ -54,7 +54,7 @@ (none) ) -(defmethod suppress-traffic ashelin-tanker ((obj ashelin-tanker)) +(defmethod suppress-traffic ashelin-tanker ((this ashelin-tanker)) (when *traffic-manager* (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> (new 'static 'vector :x 1837465.6 :y 34406.4 :z 1868103.6 :w 225280.0) quad)) @@ -329,7 +329,7 @@ :nav-mesh-index -1 :skip-to -1 :on-set (lambda ((arg0 ashelin-tanker)) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) (ashelin-method-250 arg0 #f) (task-node-close! (game-task-node city-intercept-tanker-battle)) (remove-setting! 'sound-mode) diff --git a/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc b/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc index 7eb66943e7..1062215023 100644 --- a/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc +++ b/goal_src/jak2/levels/city/market/ashelin/ctyasha-obs.gc @@ -860,72 +860,72 @@ ) -(defmethod general-event-handler tanker-grunt ((obj tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler tanker-grunt ((this tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('skip-intro) - (when (and (-> obj next-state) - (let ((v1-4 (-> obj next-state name))) + (when (and (-> this next-state) + (let ((v1-4 (-> this next-state name))) (or (= v1-4 'ambush) (= v1-4 'jumping-ambush) (= v1-4 'dormant) (= v1-4 'jump) (= v1-4 'jump-blocked)) ) ) - (let ((s5-0 (-> obj intro-path))) + (let ((s5-0 (-> this intro-path))) (when (nonzero? s5-0) (let ((f30-0 (get-num-segments s5-0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (get-point-at-percent-along-path! s5-0 (-> obj root trans) f30-0 'interp) + (get-point-at-percent-along-path! s5-0 (-> this root trans) f30-0 'interp) (displacement-between-points-at-percent-normalized! s5-0 s4-0 f30-0) - (forward-up->quaternion (-> obj root quat) s4-0 *up-vector*) + (forward-up->quaternion (-> this root quat) s4-0 *up-vector*) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (set-vector! (-> obj root scale) 1.0 1.0 1.0 1.0) - (go-hostile obj) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (go-hostile this) #t ) ) ) ) (else - ((method-of-type grunt general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type grunt general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; WARN: Return type mismatch vector vs none. -(defmethod init-enemy! tanker-grunt ((obj tanker-grunt)) +(defmethod init-enemy! tanker-grunt ((this tanker-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (set! (-> obj expensive-gnd-collide?) #t) + (set! (-> this expensive-gnd-collide?) #t) (let ((t9-0 (method-of-type grunt init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set-vector! (-> obj root scale) 0.0 0.0 0.0 1.0) + (set-vector! (-> this root scale) 0.0 0.0 0.0 1.0) (none) ) ;; WARN: Return type mismatch uint vs collide-spec. -(defmethod enemy-method-124 tanker-grunt ((obj tanker-grunt)) +(defmethod enemy-method-124 tanker-grunt ((this tanker-grunt)) "TODO" (let ((t9-0 (method-of-type grunt enemy-method-124))) - (t9-0 obj) + (t9-0 this) ) - (the-as collide-spec (when (-> obj expensive-gnd-collide?) - (let ((v0-1 (logior (-> obj gnd-collide) 577))) - (set! (-> obj gnd-collide) v0-1) + (the-as collide-spec (when (-> this expensive-gnd-collide?) + (let ((v0-1 (logior (-> this gnd-collide) 577))) + (set! (-> this gnd-collide) v0-1) v0-1 ) ) ) ) -(defmethod go-hostile tanker-grunt ((obj tanker-grunt)) - (set! (-> obj expensive-gnd-collide?) #f) - (enemy-method-124 obj) - ((method-of-type grunt go-hostile) obj) +(defmethod go-hostile tanker-grunt ((this tanker-grunt)) + (set! (-> this expensive-gnd-collide?) #f) + (enemy-method-124 this) + ((method-of-type grunt go-hostile) this) ) (defstate jump (tanker-grunt) @@ -963,71 +963,71 @@ ) -(defmethod general-event-handler tanker-juicer ((obj tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler tanker-juicer ((this tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('skip-intro) - (when (and (-> obj next-state) (let ((v1-4 (-> obj next-state name))) - (or (= v1-4 'ambush) (= v1-4 'dormant) (= v1-4 'jump) (= v1-4 'jump-blocked)) - ) + (when (and (-> this next-state) (let ((v1-4 (-> this next-state name))) + (or (= v1-4 'ambush) (= v1-4 'dormant) (= v1-4 'jump) (= v1-4 'jump-blocked)) + ) ) - (let ((s5-0 (-> obj intro-path))) + (let ((s5-0 (-> this intro-path))) (when (nonzero? s5-0) (let ((f30-0 (get-num-segments s5-0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (get-point-at-percent-along-path! s5-0 (-> obj root trans) f30-0 'interp) + (get-point-at-percent-along-path! s5-0 (-> this root trans) f30-0 'interp) (displacement-between-points-at-percent-normalized! s5-0 s4-0 f30-0) - (forward-up->quaternion (-> obj root quat) s4-0 *up-vector*) + (forward-up->quaternion (-> this root quat) s4-0 *up-vector*) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (set-vector! (-> obj root scale) 1.0 1.0 1.0 1.0) - (go-hostile obj) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (go-hostile this) #t ) ) ) ) (else - ((method-of-type juicer general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type juicer general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; WARN: Return type mismatch vector vs none. -(defmethod init-enemy! tanker-juicer ((obj tanker-juicer)) +(defmethod init-enemy! tanker-juicer ((this tanker-juicer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (set! (-> obj expensive-gnd-collide?) #t) + (set! (-> this expensive-gnd-collide?) #t) (let ((t9-0 (method-of-type juicer init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set-vector! (-> obj root scale) 0.0 0.0 0.0 1.0) + (set-vector! (-> this root scale) 0.0 0.0 0.0 1.0) (none) ) ;; WARN: Return type mismatch uint vs collide-spec. -(defmethod enemy-method-124 tanker-juicer ((obj tanker-juicer)) +(defmethod enemy-method-124 tanker-juicer ((this tanker-juicer)) "TODO" (let ((t9-0 (method-of-type juicer enemy-method-124))) - (t9-0 obj) + (t9-0 this) ) - (the-as collide-spec (when (-> obj expensive-gnd-collide?) - (let ((v0-1 (logior (-> obj gnd-collide) 577))) - (set! (-> obj gnd-collide) v0-1) + (the-as collide-spec (when (-> this expensive-gnd-collide?) + (let ((v0-1 (logior (-> this gnd-collide) 577))) + (set! (-> this gnd-collide) v0-1) v0-1 ) ) ) ) -(defmethod go-hostile tanker-juicer ((obj tanker-juicer)) - (set! (-> obj expensive-gnd-collide?) #f) - (enemy-method-124 obj) - ((method-of-type juicer go-hostile) obj) +(defmethod go-hostile tanker-juicer ((this tanker-juicer)) + (set! (-> this expensive-gnd-collide?) #f) + (enemy-method-124 this) + ((method-of-type juicer go-hostile) this) ) (defstate jump (tanker-juicer) @@ -1071,14 +1071,14 @@ ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod tanker-container-method-22 tanker-container ((obj tanker-container)) +(defmethod tanker-container-method-22 tanker-container ((this tanker-container)) (process-spawn simple-nav-sphere #x46733333 (new 'static 'vector :x 1719500.8 :y 35225.6 :z 1837465.6 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1086,7 +1086,7 @@ (new 'static 'vector :x 1730560.0 :y 35225.6 :z 1855488.0 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1094,7 +1094,7 @@ (new 'static 'vector :x 1738752.0 :y 35225.6 :z 1884160.0 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1102,7 +1102,7 @@ (new 'static 'vector :x 1751040.0 :y 35225.6 :z 1910374.4 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1110,7 +1110,7 @@ (new 'static 'vector :x 1763737.6 :y 35225.6 :z 1936588.8 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1118,7 +1118,7 @@ (new 'static 'vector :x 1853849.6 :y 35225.6 :z 1918566.4 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1126,7 +1126,7 @@ (new 'static 'vector :x 1867776.0 :y 35225.6 :z 1934131.2 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1134,7 +1134,7 @@ (new 'static 'vector :x 1962803.2 :y 35225.6 :z 1739980.8 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1142,7 +1142,7 @@ (new 'static 'vector :x 1916108.8 :y 35225.6 :z 1705164.8 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1150,7 +1150,7 @@ (new 'static 'vector :x 1863270.4 :y 35225.6 :z 1699430.4 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1158,7 +1158,7 @@ (new 'static 'vector :x 1862860.8 :y 35225.6 :z 1814118.4 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1166,7 +1166,7 @@ (new 'static 'vector :x 1810841.6 :y 35225.6 :z 1800192.0 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1174,7 +1174,7 @@ (new 'static 'vector :x 1781350.4 :y 35225.6 :z 1774387.2 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1182,7 +1182,7 @@ (new 'static 'vector :x 1771110.4 :y 35225.6 :z 1799782.4 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1190,7 +1190,7 @@ (new 'static 'vector :x 1784217.6 :y 35225.6 :z 1828864.0 :w 1.0) #f -1 - :to obj + :to this ) (none) ) @@ -1238,14 +1238,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tanker-container ((obj tanker-container) (arg0 entity-actor)) +(defmethod init-from-entity! tanker-container ((this tanker-container) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1277,33 +1277,33 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tanker-container" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (transform-post) - (let ((v1-26 (-> obj root root-prim))) + (let ((v1-26 (-> this root root-prim))) (set! (-> v1-26 prim-core collide-as) (collide-spec)) (set! (-> v1-26 prim-core collide-with) (collide-spec)) ) 0 - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (if (task-node-closed? (game-task-node city-intercept-tanker-introduction)) - (go (method-of-object obj idle)) - (go (method-of-object obj dormant)) + (go (method-of-object this idle)) + (go (method-of-object this dormant)) ) (none) ) @@ -1359,14 +1359,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tanker-crash ((obj tanker-crash) (arg0 entity-actor)) +(defmethod init-from-entity! tanker-crash ((this tanker-crash) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1398,33 +1398,33 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tanker-crash" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (transform-post) - (let ((v1-26 (-> obj root root-prim))) + (let ((v1-26 (-> this root root-prim))) (set! (-> v1-26 prim-core collide-as) (collide-spec)) (set! (-> v1-26 prim-core collide-with) (collide-spec)) ) 0 - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (if (task-node-closed? (game-task-node city-intercept-tanker-introduction)) - (go (method-of-object obj idle)) - (go (method-of-object obj dormant)) + (go (method-of-object this idle)) + (go (method-of-object this dormant)) ) (none) ) @@ -1447,7 +1447,7 @@ This commonly includes things such as: ) -(defmethod run-logic? tanker-deadly ((obj tanker-deadly)) +(defmethod run-logic? tanker-deadly ((this tanker-deadly)) #t ) diff --git a/goal_src/jak2/levels/city/market/ctymark-obs.gc b/goal_src/jak2/levels/city/market/ctymark-obs.gc index ec94b23d39..455a599bd2 100644 --- a/goal_src/jak2/levels/city/market/ctymark-obs.gc +++ b/goal_src/jak2/levels/city/market/ctymark-obs.gc @@ -1047,7 +1047,7 @@ ) (process-entity-status! self (entity-perm-status dead) #t) (let ((frame (current-time))) - (until (>= (- (current-time) frame) (seconds 5)) + (until (time-elapsed? frame (seconds 5)) (suspend) ) ) @@ -1076,14 +1076,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-basket-a ((obj market-basket-a) (arg0 entity-actor)) +(defmethod init-from-entity! market-basket-a ((this market-basket-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) (set! (-> prim-mesh prim-core action) (collide-action solid)) @@ -1117,20 +1117,20 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask crate)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask crate)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-market-basket-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part-explode) (-> *part-group-id-table* 1007)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this part-explode) (-> *part-group-id-table* 1007)) + (set! (-> this draw light-index) (the-as uint 10)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1156,14 +1156,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-basket-b ((obj market-basket-b) (arg0 entity-actor)) +(defmethod init-from-entity! market-basket-b ((this market-basket-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) (set! (-> prim-mesh prim-core action) (collide-action solid)) @@ -1197,20 +1197,20 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask crate)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask crate)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-market-basket-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part-explode) (-> *part-group-id-table* 1008)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this part-explode) (-> *part-group-id-table* 1008)) + (set! (-> this draw light-index) (the-as uint 10)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1236,14 +1236,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-crate ((obj market-crate) (arg0 entity-actor)) +(defmethod init-from-entity! market-crate ((this market-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) (set! (-> prim-mesh prim-core action) (collide-action solid)) @@ -1277,20 +1277,20 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask crate)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask crate)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-market-crate" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part-explode) (-> *part-group-id-table* 1006)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this part-explode) (-> *part-group-id-table* 1006)) + (set! (-> this draw light-index) (the-as uint 10)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1316,14 +1316,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-sack-a ((obj market-sack-a) (arg0 entity-actor)) +(defmethod init-from-entity! market-sack-a ((this market-sack-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) (set! (-> prim-mesh prim-core action) (collide-action solid)) @@ -1357,20 +1357,20 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask crate)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask crate)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-market-sack-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part-explode) (-> *part-group-id-table* 1009)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this part-explode) (-> *part-group-id-table* 1009)) + (set! (-> this draw light-index) (the-as uint 10)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1396,14 +1396,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-sack-b ((obj market-sack-b) (arg0 entity-actor)) +(defmethod init-from-entity! market-sack-b ((this market-sack-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) (set! (-> prim-mesh prim-core action) (collide-action solid)) @@ -1437,20 +1437,20 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask crate)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask crate)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-market-sack-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part-explode) (-> *part-group-id-table* 1010)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this part-explode) (-> *part-group-id-table* 1010)) + (set! (-> this draw light-index) (the-as uint 10)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc b/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc index aeb1081821..fa1c9bdf12 100644 --- a/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc +++ b/goal_src/jak2/levels/city/meet-brutter/meet-brutter.gc @@ -15,39 +15,39 @@ ;; DECOMP BEGINS -(defmethod draw hud-lurker ((obj hud-lurker)) +(defmethod draw hud-lurker ((this hud-lurker)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 205 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 27) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -19 27) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-lurker ((obj hud-lurker)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-lurker ((this hud-lurker)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-lurker ((obj hud-lurker)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-lurker ((this hud-lurker)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x679))) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x679))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -254,8 +254,8 @@ ) -(defmethod allocate-and-init-cshape paddywagon ((obj paddywagon)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape paddywagon ((this paddywagon)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -303,7 +303,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -439,79 +439,79 @@ ) ) -(defmethod init-skel-and-rigid-body paddywagon ((obj paddywagon)) +(defmethod init-skel-and-rigid-body paddywagon ((this paddywagon)) (with-pp (set! (-> pp level) (level-get *level* 'lmeetbrt)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-paddywagon" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *paddywagon-constants*) - (set! (-> obj draw lod-set lod 0 dist) 819200.0) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag no-hijack) (-> obj flags))) + (alloc-and-init-rigid-body-control this *paddywagon-constants*) + (set! (-> this draw lod-set lod 0 dist) 819200.0) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag no-hijack) (-> this flags))) ) - (set! (-> obj controller choose-branch-callback) choose-next-branch-no-exit-level) + (set! (-> this controller choose-branch-callback) choose-next-branch-no-exit-level) 0 (none) ) ) -(defmethod vehicle-method-120 paddywagon ((obj paddywagon)) +(defmethod vehicle-method-120 paddywagon ((this paddywagon)) (let ((t9-0 (method-of-type vehicle-guard vehicle-method-120))) - (t9-0 obj) + (t9-0 this) ) - (if (logtest? (-> obj controller flags) (vehicle-controller-flag attached)) - (set! (-> obj current-level) (-> obj controller branch dest-node level)) - (set! (-> obj current-level) #f) + (if (logtest? (-> this controller flags) (vehicle-controller-flag attached)) + (set! (-> this current-level) (-> this controller branch dest-node level)) + (set! (-> this current-level) #f) ) - (vehicle-method-119 obj) + (vehicle-method-119 this) 0 (none) ) -(defmethod vehicle-method-128 paddywagon ((obj paddywagon)) +(defmethod vehicle-method-128 paddywagon ((this paddywagon)) (let ((t9-0 (method-of-type vehicle vehicle-method-128))) - (t9-0 obj) + (t9-0 this) ) - (logior! (-> obj flags) (rigid-body-object-flag persistent)) + (logior! (-> this flags) (rigid-body-object-flag persistent)) 0 (none) ) -(defmethod vehicle-method-127 paddywagon ((obj paddywagon)) - ((method-of-type vehicle vehicle-method-127) obj) +(defmethod vehicle-method-127 paddywagon ((this paddywagon)) + ((method-of-type vehicle vehicle-method-127) this) 0 (none) ) -(defmethod vehicle-method-129 paddywagon ((obj paddywagon)) - ((method-of-type vehicle vehicle-method-129) obj) +(defmethod vehicle-method-129 paddywagon ((this paddywagon)) + ((method-of-type vehicle vehicle-method-129) this) 0 (none) ) -(defmethod vehicle-method-134 paddywagon ((obj paddywagon) (arg0 process)) +(defmethod vehicle-method-134 paddywagon ((this paddywagon) (arg0 process)) "Stubbed" - (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others)) - (set! (-> obj controller target-speed-offset) 81920.0) - (set! (-> obj pursuit-target) (process->handle arg0)) - (logior! (-> obj flags) (rigid-body-object-flag alert)) + (logior! (-> this controller flags) (vehicle-controller-flag ignore-others)) + (set! (-> this controller target-speed-offset) 81920.0) + (set! (-> this pursuit-target) (process->handle arg0)) + (logior! (-> this flags) (rigid-body-object-flag alert)) (if (task-node-open? (game-task-node city-save-lurkers-save-lurkers)) - (vehicle-method-111 obj 1 (the-as target arg0)) - (vehicle-method-111 obj 2 (the-as target arg0)) + (vehicle-method-111 this 1 (the-as target arg0)) + (vehicle-method-111 this 2 (the-as target arg0)) ) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) 0 (none) ) -(defmethod vehicle-method-108 paddywagon ((obj paddywagon)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> obj flags))) +(defmethod vehicle-method-108 paddywagon ((this paddywagon)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> this flags))) ) - (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others)) + (logior! (-> this controller flags) (vehicle-controller-flag ignore-others)) 0 (none) ) @@ -975,7 +975,7 @@ ) ) -(defmethod get-inv-mass city-lurker ((obj city-lurker)) +(defmethod get-inv-mass city-lurker ((this city-lurker)) 0.25 ) @@ -1184,7 +1184,7 @@ (set! (-> self gnd-height) (-> self root gspot-pos y)) (logior! (-> self flags) (citizen-flag persistent)) (logior! (-> self focus-status) (focus-status pilot-riding pilot)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-31 (-> self root root-prim))) (set! (-> v1-31 prim-core collide-as) (collide-spec)) (set! (-> v1-31 prim-core collide-with) (collide-spec)) @@ -1235,14 +1235,14 @@ ) (let ((s5-3 (new 'stack-no-clear 'vector))) (let ((s4-0 (new 'stack-no-clear 'quaternion))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while (not (civilian-method-217 self s5-3)) (let ((s3-0 (handle->process (-> self vehicle)))) (new 'stack-no-clear 'vector) (quaternion-copy! (-> self root quat) (-> (the-as vehicle s3-0) root quat)) (compute-seat-position (the-as vehicle s3-0) (-> self root trans) (-> self seat)) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (go-virtual ride) ) (suspend) @@ -1302,7 +1302,7 @@ ) ) (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-15 (-> self nav))) (set! (-> v1-15 target-speed) (* (-> self speed-scale) (-> self speed-run))) @@ -1429,7 +1429,7 @@ :event enemy-event-handler :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-6 (-> self nav))) (set! (-> v1-6 target-speed) (* (-> self speed-scale) (-> self speed-run))) @@ -1483,7 +1483,7 @@ (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable)))) (send-event self 'jump 0 (-> self end-pos)) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (logtest? (-> self nav state flags) (nav-state-flag at-target)) ) (go-virtual wait-at-end) @@ -1519,7 +1519,7 @@ :event enemy-event-handler :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-6 (-> self nav))) (set! (-> v1-6 target-speed) (* (-> self speed-scale) (-> self speed-run))) @@ -1607,45 +1607,45 @@ ) ) -(defmethod enemy-method-86 city-lurker ((obj city-lurker)) - (let ((gp-0 (-> obj root))) +(defmethod enemy-method-86 city-lurker ((this city-lurker)) + (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) - (when (and (< (-> gp-0 trans y) (+ 8192.0 (-> obj end-pos y))) (-> obj jump-in-pipe?)) - (send-event (process-by-name (-> obj pipe-name) *active-pool*) 'spin) - (set! (-> obj jump-in-pipe?) #f) + (when (and (< (-> gp-0 trans y) (+ 8192.0 (-> this end-pos y))) (-> this jump-in-pipe?)) + (send-event (process-by-name (-> this pipe-name) *active-pool*) 'spin) + (set! (-> this jump-in-pipe?) #f) ) - (>= (-> obj end-pos y) (-> gp-0 trans y)) + (>= (-> this end-pos y) (-> gp-0 trans y)) ) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 city-lurker ((obj city-lurker)) - (go (method-of-object obj inactive)) +(defmethod enemy-method-93 city-lurker ((this city-lurker)) + (go (method-of-object this inactive)) (none) ) -(defmethod enemy-method-89 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) #f ) -(defmethod enemy-method-87 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-87 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((s5-0 (-> obj skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (let ((s5-0 (-> this skel root-channel 0))) + (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) (set! (-> s5-0 param 0) (ja-aframe 6.0 0)) (set! (-> s5-0 param 1) 0.5) (set! (-> s5-0 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) ) #t ) -(defmethod enemy-method-88 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) #f ) @@ -1654,7 +1654,7 @@ :event enemy-event-handler :enter (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 self)) (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) @@ -1707,12 +1707,12 @@ ) ) -(defmethod coin-flip? city-lurker ((obj city-lurker)) +(defmethod coin-flip? city-lurker ((this city-lurker)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod damage-amount-from-attack city-lurker ((obj city-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack city-lurker ((this city-lurker) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) @@ -1774,7 +1774,7 @@ (citizen-init! self) (set! (-> self hit-points) 100) (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-8 (-> self root root-prim))) (set! (-> v1-8 prim-core collide-as) (collide-spec)) (set! (-> v1-8 prim-core collide-with) (collide-spec)) @@ -1887,29 +1887,29 @@ ) ) -(defmethod set-behavior! city-lurker ((obj city-lurker) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! city-lurker ((this city-lurker) (arg0 traffic-object-spawn-params)) (format #t "go-traffic-startup ~D~%" (-> arg0 behavior)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-0 2) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ((= v1-0 3) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) ((= v1-0 6) - (logior! (-> obj flags) (citizen-flag persistent)) - (go (method-of-object obj idle)) + (logior! (-> this flags) (citizen-flag persistent)) + (go (method-of-object this idle)) ) ((= v1-0 7) - (logior! (-> obj flags) (citizen-flag persistent)) - (go (method-of-object obj wait-for-ride)) + (logior! (-> this flags) (citizen-flag persistent)) + (go (method-of-object this wait-for-ride)) ) (else - (go-inactive obj) + (go-inactive this) ) ) ) @@ -1917,21 +1917,21 @@ (none) ) -(defmethod citizen-init! city-lurker ((obj city-lurker)) +(defmethod citizen-init! city-lurker ((this city-lurker)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (let ((v1-1 (-> obj nav))) + (let ((v1-1 (-> this nav))) (set! (-> v1-1 sphere-mask) (the-as uint #x800fe)) ) 0 (none) ) -(defmethod init-enemy-collision! city-lurker ((obj city-lurker)) +(defmethod init-enemy-collision! city-lurker ((this city-lurker)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1987,67 +1987,67 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! city-lurker ((obj city-lurker)) +(defmethod init-enemy! city-lurker ((this city-lurker)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-city-lurker" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *city-lurker-nav-enemy-info*) - (set! (-> obj info) *city-lurker-global-info*) - (let ((v1-6 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *city-lurker-nav-enemy-info*) + (set! (-> this info) *city-lurker-global-info*) + (let ((v1-6 (-> this nav))) (set! (-> v1-6 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 409600.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (set! (-> obj speed-run) 20480.0) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (set! (-> obj water-anim) 20) - (set! (-> obj jump-in-pipe?) #f) - (set! (-> obj task-done?) #f) - (set! (-> obj coming-from-pw) #f) + (set! (-> this draw lod-set lod 0 dist) 409600.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this speed-run) 20480.0) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (set! (-> this water-anim) 20) + (set! (-> this jump-in-pipe?) #f) + (set! (-> this task-done?) #f) + (set! (-> this coming-from-pw) #f) 0 (none) ) -(defmethod general-event-handler city-lurker ((obj city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler city-lurker ((this city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('nav-mesh-kill) - (format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> obj name) arg2) - (change-to *default-nav-mesh* obj) + (format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> this name) arg2) + (change-to *default-nav-mesh* this) #t ) (('traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (set! (-> this controller traffic) (the-as traffic-engine (-> arg3 param 1))) (let ((s5-0 (the-as object (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-0) position quad)) - (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-0) rotation)) - (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-0) velocity quad)) + (set! (-> this root trans quad) (-> (the-as traffic-object-spawn-params s5-0) position quad)) + (quaternion-copy! (-> this root quat) (-> (the-as traffic-object-spawn-params s5-0) rotation)) + (set! (-> this root transv quad) (-> (the-as traffic-object-spawn-params s5-0) velocity quad)) (let ((a0-10 (-> (the-as traffic-object-spawn-params s5-0) nav-mesh))) (when a0-10 - (change-to a0-10 obj) - (if (not (-> obj nav)) - (go-inactive obj) + (change-to a0-10 this) + (if (not (-> this nav)) + (go-inactive this) ) - (let ((v1-17 (-> obj nav state))) + (let ((v1-17 (-> this nav state))) (set! (-> v1-17 current-poly) (the-as nav-poly #f)) ) 0 (let ((a1-5 (-> (the-as traffic-object-spawn-params s5-0) nav-branch))) (when a1-5 - (vehicle-controller-method-13 (-> obj controller) a1-5 (-> obj root trans)) - (let ((a0-14 (-> obj nav state)) - (v1-24 (-> obj controller turn-exit-point)) + (vehicle-controller-method-13 (-> this controller) a1-5 (-> this root trans)) + (let ((a0-14 (-> this nav state)) + (v1-24 (-> this controller turn-exit-point)) ) (logclear! (-> a0-14 flags) (nav-state-flag directional-mode)) (logior! (-> a0-14 flags) (nav-state-flag target-poly-dirty)) @@ -2056,13 +2056,13 @@ 0 ) ) - (citizen-nav-init! obj) - (citizen-init! obj) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) - (set! (-> obj gnd-height) (-> obj root gspot-pos y)) + (citizen-nav-init! this) + (citizen-init! this) + (enemy-method-127 this 40960.0 40960.0 #t (the-as collide-spec (-> this gnd-collide))) + (set! (-> this gnd-height) (-> this root gspot-pos y)) ) ) - (set-behavior! obj (the-as traffic-object-spawn-params s5-0)) + (set-behavior! this (the-as traffic-object-spawn-params s5-0)) ) ) (('traffic-off) @@ -2075,10 +2075,10 @@ #f ) (('hit 'hit-flinch 'hit-knocked) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type civilian general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type civilian general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -2588,8 +2588,8 @@ (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) (suspend) (send-event *traffic-manager* 'set-target-level 0.75) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (none) @@ -2612,8 +2612,8 @@ (send-event *traffic-manager* 'decrease-alert-level 0) (send-event *traffic-manager* 'set-alert-duration (seconds 30)) (send-event *target* 'end-mode) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (task-node-close! (game-task-node city-meet-brutter-meet-brutter)) @@ -3154,8 +3154,8 @@ (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) (suspend) (send-event *traffic-manager* 'set-target-level 0.75) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (none) @@ -3175,7 +3175,7 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (let ((v1-2 0)) (dotimes (a0-0 6) diff --git a/goal_src/jak2/levels/city/onintent/onin-game.gc b/goal_src/jak2/levels/city/onintent/onin-game.gc index 078c93236c..aec326186e 100644 --- a/goal_src/jak2/levels/city/onintent/onin-game.gc +++ b/goal_src/jak2/levels/city/onintent/onin-game.gc @@ -1844,7 +1844,7 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.25)) + (until (time-elapsed? gp-1 (seconds 0.25)) (suspend) ) ) @@ -2000,7 +2000,7 @@ (defbehavior onin-game-bubble-init onin-game-bubble ((arg0 vector) (arg1 int) (arg2 meters) (arg3 float) (arg4 float)) "TODO - bubble type enum" (sound-play "onin-launch") - (set! (-> self bubble-start-time) (current-time)) + (set-time! (-> self bubble-start-time)) (set! (-> self bubble-type) arg1) (set! (-> self gravity) arg2) (set! (-> self angle) arg3) @@ -2080,7 +2080,7 @@ ;; ERROR: Stack slot load at 112 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 112 mismatch: defined as size 4, got size 16 -(defmethod onin-game-method-25 onin-game ((obj onin-game)) +(defmethod onin-game-method-25 onin-game ((this onin-game)) (local-vars (v0-18 int) (sv-32 process) @@ -2090,10 +2090,10 @@ (sv-96 meters) (sv-112 float) ) - (when (>= (- (current-time) (-> obj game-start-time)) (seconds 2)) - (let ((s5-0 (-> obj game (-> obj wave)))) - (when (>= (- (current-time) (the-as int (-> obj wave-length))) (-> obj wave-time)) - (let ((s4-0 (-> obj child))) + (when (time-elapsed? (-> this game-start-time) (seconds 2)) + (let ((s5-0 (-> this game (-> this wave)))) + (when (time-elapsed? (the-as int (-> this wave-length)) (-> this wave-time)) + (let ((s4-0 (-> this child))) (while s4-0 (if (type? (ppointer->process s4-0) onin-game-bubble) (goto cfg-58) @@ -2101,27 +2101,27 @@ (set! s4-0 (-> s4-0 0 brother)) ) ) - (if (zero? (-> obj wave-delay-time)) - (set! (-> obj wave-delay-time) (current-time)) + (if (zero? (-> this wave-delay-time)) + (set-time! (-> this wave-delay-time)) ) - (if (< (- (current-time) (-> obj wave-delay-time)) (the-as time-frame (-> s5-0 wave-delay))) + (if (not (time-elapsed? (-> this wave-delay-time) (the-as time-frame (-> s5-0 wave-delay)))) (goto cfg-58) ) - (set! (-> obj event-length) (the-as uint 0)) - (+! (-> obj wave) 1) - (set! s5-0 (-> obj game (-> obj wave))) + (set! (-> this event-length) (the-as uint 0)) + (+! (-> this wave) 1) + (set! s5-0 (-> this game (-> this wave))) (when (zero? (-> s5-0 min-count)) - (set! (-> obj wave) (the-as int (-> s5-0 max-count))) - (set! s5-0 (-> obj game (-> obj wave))) + (set! (-> this wave) (the-as int (-> s5-0 max-count))) + (set! s5-0 (-> this game (-> this wave))) ) - (set! (-> obj wave-time) (current-time)) - (set! (-> obj wave-length) + (set-time! (-> this wave-time)) + (set! (-> this wave-length) (the-as uint (rand-vu-int-range (the-as int (-> s5-0 min-wave)) (the-as int (-> s5-0 max-wave)))) ) - (set! (-> obj wave-delay-time) 0) - (when (< 1 (-> obj wave)) + (set! (-> this wave-delay-time) 0) + (when (< 1 (-> this wave)) (cond - ((< 4 (- (-> obj miss-count) (-> obj wave-start-miss))) + ((< 4 (- (-> this miss-count) (-> this wave-start-miss))) (let ((v0-2 (rand-vu-int-count 5))) (cond ((zero? v0-2) @@ -2142,7 +2142,7 @@ ) ) ) - ((>= 1 (- (-> obj miss-count) (-> obj wave-start-miss))) + ((>= 1 (- (-> this miss-count) (-> this wave-start-miss))) (let ((v0-9 (rand-vu-int-count 7))) (cond ((zero? v0-9) @@ -2171,27 +2171,27 @@ ) ) ) - (set! (-> obj wave-start-miss) (-> obj miss-count)) + (set! (-> this wave-start-miss) (-> this miss-count)) ) (set! v0-18 - (when (>= (- (current-time) (-> obj event-time)) (the-as time-frame (-> obj event-length))) - (set! (-> obj event-time) (current-time)) - (let ((s4-14 (vector+! (new 'stack-no-clear 'vector) (-> obj root trans) (new 'static 'vector :w 1.0))) + (when (time-elapsed? (-> this event-time) (the-as time-frame (-> this event-length))) + (set-time! (-> this event-time)) + (let ((s4-14 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (new 'static 'vector :w 1.0))) (s3-12 (rand-vu-int-range (the-as int (-> s5-0 min-count)) (the-as int (-> s5-0 max-count)))) ) (dotimes (s2-12 s3-12) - (let ((f0-0 (-> obj last-angle))) - (while (< (fabs (- (-> obj last-angle) f0-0)) 819.2) + (let ((f0-0 (-> this last-angle))) + (while (< (fabs (- (-> this last-angle) f0-0)) 819.2) (set! f0-0 (rand-vu-float-range -1720.32 1720.32)) ) - (set! (-> obj last-angle) f0-0) + (set! (-> this last-angle) f0-0) ) (let ((s1-0 (get-process *default-dead-pool* onin-game-bubble #x4000))) (when s1-0 (let ((t9-31 (method-of-type onin-game-bubble activate))) (t9-31 (the-as onin-game-bubble s1-0) - obj + this (symbol->string (-> onin-game-bubble symbol)) (the-as pointer #x70004000) ) @@ -2202,7 +2202,7 @@ (set! sv-64 s4-14) (set! sv-80 (rand-vu-int-range 0 3)) (set! sv-96 (-> s5-0 gravity)) - (set! sv-112 (-> obj last-angle)) + (set! sv-112 (-> this last-angle)) (let ((t2-0 (rand-vu-float-range 4096.0 7372.8))) ((the-as (function object object object object object object object none) s0-0) sv-32 @@ -2221,40 +2221,40 @@ ) ) (set! v0-18 (rand-vu-int-range (the-as int (-> s5-0 min-event)) (the-as int (-> s5-0 max-event)))) - (set! (-> obj event-length) (the-as uint v0-18)) + (set! (-> this event-length) (the-as uint v0-18)) v0-18 ) ) ) ) (label cfg-58) - (onin-game-method-26 obj) + (onin-game-method-26 this) 0 (none) ) -(defmethod onin-game-method-26 onin-game ((obj onin-game)) +(defmethod onin-game-method-26 onin-game ((this onin-game)) (cond - ((>= (-> *game-info* score) (-> obj score)) - (set! (-> *game-info* score) (-> obj score)) + ((>= (-> *game-info* score) (-> this score)) + (set! (-> *game-info* score) (-> this score)) ) - ((and (< (-> *game-info* score) (-> obj score)) (>= (- (current-time) (-> obj score-time)) (seconds 0.1))) + ((and (< (-> *game-info* score) (-> this score)) (time-elapsed? (-> this score-time) (seconds 0.1))) (sound-play "onin-score") - (seek! (-> *game-info* score) (-> obj score) 1.0) - (set! (-> obj score-time) (current-time)) + (seek! (-> *game-info* score) (-> this score) 1.0) + (set-time! (-> this score-time)) ) ) - (set! (-> *game-info* miss) (the float (-> obj miss-count))) + (set! (-> *game-info* miss) (the float (-> this miss-count))) 0 (none) ) ;; WARN: Return type mismatch number vs none. -(defmethod onin-game-method-27 onin-game ((obj onin-game) (arg0 int)) +(defmethod onin-game-method-27 onin-game ((this onin-game) (arg0 int)) "TODO - bubble type" (let ((s4-0 (the-as onin-game-bubble #f))) (let ((s3-0 0) - (s2-0 (-> obj child)) + (s2-0 (-> this child)) ) (while s2-0 (let* ((s1-0 (ppointer->process s2-0)) @@ -2275,24 +2275,24 @@ (s4-0 (when (send-event s4-0 'attack #f) (cond - ((= arg0 (-> obj last-type)) - (+! (-> obj current-bonus) (-> obj current-bonus)) - (if (>= (-> obj current-bonus) 16.0) - (set! (-> obj current-bonus) 16.0) + ((= arg0 (-> this last-type)) + (+! (-> this current-bonus) (-> this current-bonus)) + (if (>= (-> this current-bonus) 16.0) + (set! (-> this current-bonus) 16.0) ) ) (else - (set! (-> obj current-bonus) 1.0) + (set! (-> this current-bonus) 1.0) ) ) - (set! (-> obj last-type) arg0) - (+! (-> obj score) (-> obj current-bonus)) + (set! (-> this last-type) arg0) + (+! (-> this score) (-> this current-bonus)) ) ) (else (sound-play "onin-wrong") - (set! (-> obj last-type) -1) - (+! (-> obj miss-count) 1) + (set! (-> this last-type) -1) + (+! (-> this miss-count) 1) (let ((v1-20 (rand-vu-int-count 4))) (cond ((zero? v1-20) @@ -2400,7 +2400,7 @@ (set! (-> self hud-score) (ppointer->handle (process-spawn hud-big-score :init hud-init-by-other :to self))) (set! (-> self hud-goal) (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :to self))) (set! (-> self hud-miss) (ppointer->handle (process-spawn hud-miss :init hud-init-by-other :to self))) - (set! (-> self game-start-time) (current-time)) + (set-time! (-> self game-start-time)) (send-event *target* 'draw #f) (set-setting! 'gun #f 0.0 0) (set-setting! 'calm #t 0.0 0) @@ -2546,7 +2546,7 @@ :code (behavior ((arg0 symbol)) (ja-channel-set! 0) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -2642,7 +2642,7 @@ (not (task-node-closed? (game-task-node city-play-onin-game-skill))) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -2672,7 +2672,7 @@ (suspend) ) (let ((s5-3 (current-time))) - (until (>= (- (current-time) s5-3) (seconds 2)) + (until (time-elapsed? s5-3 (seconds 2)) (suspend) ) ) diff --git a/goal_src/jak2/levels/city/oracle/oracle-scenes.gc b/goal_src/jak2/levels/city/oracle/oracle-scenes.gc index ab1a88be04..a9ed7df24c 100644 --- a/goal_src/jak2/levels/city/oracle/oracle-scenes.gc +++ b/goal_src/jak2/levels/city/oracle/oracle-scenes.gc @@ -825,10 +825,10 @@ ) -(defmethod init-art! oracle-npc ((obj oracle-npc)) +(defmethod init-art! oracle-npc ((this oracle-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sidekick-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -836,14 +836,14 @@ (none) ) -(defmethod get-art-elem oracle-npc ((obj oracle-npc)) +(defmethod get-art-elem oracle-npc ((this oracle-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) - (let ((root-prim (-> obj root root-prim))) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) diff --git a/goal_src/jak2/levels/city/oracle/oracle-training.gc b/goal_src/jak2/levels/city/oracle/oracle-training.gc index 93a400cc82..cfb0c41761 100644 --- a/goal_src/jak2/levels/city/oracle/oracle-training.gc +++ b/goal_src/jak2/levels/city/oracle/oracle-training.gc @@ -207,7 +207,7 @@ (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) (send-event *target* 'get-notify self) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (none) ) ) diff --git a/goal_src/jak2/levels/city/package/delivery-task.gc b/goal_src/jak2/levels/city/package/delivery-task.gc index 5331516cba..a6f0df3d87 100644 --- a/goal_src/jak2/levels/city/package/delivery-task.gc +++ b/goal_src/jak2/levels/city/package/delivery-task.gc @@ -29,25 +29,25 @@ ) -(defmethod krew-package-method-22 krew-package ((obj krew-package)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod krew-package-method-22 krew-package ((this krew-package)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod krew-package-method-23 krew-package ((obj krew-package)) +(defmethod krew-package-method-23 krew-package ((this krew-package)) (with-pp (set! (-> pp level) (level-get *level* 'lpackage)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-krew-package" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj scale) 1.0) - (set! (-> obj draw lod-set lod 0 dist) 81920.0) - (set! (-> obj draw lod-set lod 1 dist) 204800.0) - (set! (-> obj draw lod-set lod 1 dist) 327680.0) - (logior! (-> obj skel status) (joint-control-status sync-math)) + (set! (-> this scale) 1.0) + (set! (-> this draw lod-set lod 0 dist) 81920.0) + (set! (-> this draw lod-set lod 1 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 327680.0) + (logior! (-> this skel status) (joint-control-status sync-math)) 0 (none) ) @@ -89,14 +89,14 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! krew-package ((obj krew-package) (arg0 entity-actor)) +(defmethod init-from-entity! krew-package ((this krew-package) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -519,8 +519,8 @@ This commonly includes things such as: (send-event *target* 'change-mode 'normal) ) (set-setting! 'pilot #f 0.0 0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (none) diff --git a/goal_src/jak2/levels/city/palace/ctypal-obs.gc b/goal_src/jak2/levels/city/palace/ctypal-obs.gc index d71cb3ed20..4b351347da 100644 --- a/goal_src/jak2/levels/city/palace/ctypal-obs.gc +++ b/goal_src/jak2/levels/city/palace/ctypal-obs.gc @@ -43,19 +43,19 @@ ) ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-ctypal ((obj water-anim-ctypal)) +(defmethod init-water! water-anim-ctypal ((this water-anim-ctypal)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) (set! (-> v1-2 waveform) ripple-for-water-anim-ctypal) - (case (-> obj look) + (case (-> this look) ((32 30) (set! (-> v1-2 waveform) ripple-ctypal-smlground-pool) ) @@ -79,15 +79,16 @@ ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! palace-door ((obj palace-door) (arg0 entity-actor)) +(defmethod init-from-entity! palace-door ((this palace-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + ;; og:preserve-this added + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -113,24 +114,24 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-palace-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj pre-open-frame) 48.0) - (set! (-> obj lock-frame) 60.0) - (set! (-> obj open-frame) 60.0) - (set! (-> obj sound-pre-open) (static-sound-spec "pal-door-open-1")) - (set! (-> obj sound-open) (static-sound-spec "pal-door-open-2")) - (set! (-> obj sound-close) (static-sound-spec "pal-door-close")) - (set! (-> obj sound-post-close) (static-sound-spec "pal-door-close2")) - (set! (-> obj sound-behind?) #t) - (set! (-> obj door-radius) 40960.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this pre-open-frame) 48.0) + (set! (-> this lock-frame) 60.0) + (set! (-> this open-frame) 60.0) + (set! (-> this sound-pre-open) (static-sound-spec "pal-door-open-1")) + (set! (-> this sound-open) (static-sound-spec "pal-door-open-2")) + (set! (-> this sound-close) (static-sound-spec "pal-door-close")) + (set! (-> this sound-post-close) (static-sound-spec "pal-door-close2")) + (set! (-> this sound-behind?) #t) + (set! (-> this door-radius) 40960.0) + (go (method-of-object this close) #t) (none) ) @@ -177,15 +178,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctypal-broke-wall ((obj ctypal-broke-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ctypal-broke-wall ((this ctypal-broke-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (format #t "~A initialising~%" (-> obj name)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (format #t "~A initialising~%" (-> this name)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -200,14 +201,14 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ctypal-broke-wall" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-10 (-> obj root))) + (let ((v1-10 (-> this root))) (format 0 "trans ~F ~F ~F~%" @@ -216,8 +217,8 @@ This commonly includes things such as: (* 0.00024414062 (-> v1-10 trans z)) ) ) - (set! (-> obj ent) arg0) - (go (method-of-object obj idle)) + (set! (-> this ent) arg0) + (go (method-of-object this idle)) (none) ) @@ -238,7 +239,7 @@ This commonly includes things such as: :bounds (static-spherem 0 5 0 72) ) -(defmethod run-logic? ctypal-baron-statue-broken ((obj ctypal-baron-statue-broken)) +(defmethod run-logic? ctypal-baron-statue-broken ((this ctypal-baron-statue-broken)) #t ) @@ -248,17 +249,17 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctypal-baron-statue-broken ((obj ctypal-baron-statue-broken) (arg0 entity-actor)) +(defmethod init-from-entity! ctypal-baron-statue-broken ((this ctypal-baron-statue-broken) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ctypal-baron-statue-broken" (the-as (pointer uint32) #f)) @@ -266,9 +267,9 @@ This commonly includes things such as: (the-as pair 0) ) (if (not (task-node-closed? (game-task-node canyon-insert-items-resolution))) - (logior! (-> obj draw status) (draw-control-status no-draw)) + (logior! (-> this draw status) (draw-control-status no-draw)) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/city/port/ctyport-part.gc b/goal_src/jak2/levels/city/port/ctyport-part.gc index 65ac2798be..1d44f768f5 100644 --- a/goal_src/jak2/levels/city/port/ctyport-part.gc +++ b/goal_src/jak2/levels/city/port/ctyport-part.gc @@ -3374,40 +3374,40 @@ ) -(defmethod deactivate hiphog-exterior-marquee ((obj hiphog-exterior-marquee)) +(defmethod deactivate hiphog-exterior-marquee ((this hiphog-exterior-marquee)) (dotimes (s5-0 1) - (let ((a0-1 (-> obj parts s5-0))) + (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs hiphog-exterior-marquee. -(defmethod relocate hiphog-exterior-marquee ((obj hiphog-exterior-marquee) (arg0 int)) +(defmethod relocate hiphog-exterior-marquee ((this hiphog-exterior-marquee) (arg0 int)) (dotimes (v1-0 1) - (if (nonzero? (-> obj parts v1-0)) - (&+! (-> obj parts v1-0) arg0) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) arg0) ) ) - (the-as hiphog-exterior-marquee ((method-of-type process-drawable relocate) obj arg0)) + (the-as hiphog-exterior-marquee ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod hiphog-exterior-marquee-method-21 hiphog-exterior-marquee ((obj hiphog-exterior-marquee)) - (+! (-> obj parts 0 state-counter) 1) - (when (!= (-> obj parts 0 state-mode 0) (-> obj mode)) - (set! (-> obj parts 0 state-mode 0) (-> obj mode)) - (set! (-> obj parts 0 state-counter) (the-as uint 0)) +(defmethod hiphog-exterior-marquee-method-21 hiphog-exterior-marquee ((this hiphog-exterior-marquee)) + (+! (-> this parts 0 state-counter) 1) + (when (!= (-> this parts 0 state-mode 0) (-> this mode)) + (set! (-> this parts 0 state-mode 0) (-> this mode)) + (set! (-> this parts 0 state-counter) (the-as uint 0)) 0 ) - (let ((s5-0 (-> obj master-enable))) + (let ((s5-0 (-> this master-enable))) (dotimes (s4-0 1) (if (logtest? s5-0 1) - (spawn (-> obj parts s4-0) (-> obj root trans)) + (spawn (-> this parts s4-0) (-> this root trans)) ) (set! s5-0 (shr s5-0 1)) ) @@ -3444,19 +3444,19 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hiphog-exterior-marquee ((obj hiphog-exterior-marquee) (arg0 entity-actor)) +(defmethod init-from-entity! hiphog-exterior-marquee ((this hiphog-exterior-marquee) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause enemy)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj master-enable) (the-as uint -1)) - (set! (-> obj mode) (the-as uint (rand-vu-int-count 8))) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause enemy)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this master-enable) (the-as uint -1)) + (set! (-> this mode) (the-as uint (rand-vu-int-count 8))) (let ((s5-1 (if (task-node-closed? (game-task-node nest-boss-resolution)) *hiphog-exterior-marquee-daxter-group-ids* *hiphog-exterior-marquee-group-ids* @@ -3464,10 +3464,10 @@ This commonly includes things such as: ) ) (dotimes (s4-0 1) - (set! (-> obj parts s4-0) (create-launch-control (-> *part-group-id-table* (-> s5-1 s4-0)) obj)) + (set! (-> this parts s4-0) (create-launch-control (-> *part-group-id-table* (-> s5-1 s4-0)) this)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3561,34 +3561,34 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farthy ((obj farthy) (arg0 entity-actor)) +(defmethod init-from-entity! farthy ((this farthy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj root pause-adjust-distance) 1228800.0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this root pause-adjust-distance) 1228800.0) (cond ((task-node-closed? (game-task-node nest-boss-resolution)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mecha-daxter" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) (else (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farthy" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 969) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 969) this)) ) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/city/port/portrun/portrun.gc b/goal_src/jak2/levels/city/port/portrun/portrun.gc index 122fcb94d1..b2402f0fee 100644 --- a/goal_src/jak2/levels/city/port/portrun/portrun.gc +++ b/goal_src/jak2/levels/city/port/portrun/portrun.gc @@ -185,39 +185,39 @@ :init-specs ((:r 32.0) (:g 32.0 16.0) (:b 48.0 16.0)) ) -(defmethod draw hud-cargo ((obj hud-cargo)) +(defmethod draw hud-cargo ((this hud-cargo)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 205 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 27) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -19 27) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-cargo ((obj hud-cargo)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-cargo ((this hud-cargo)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-cargo ((obj hud-cargo)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-cargo ((this hud-cargo)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x679))) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x679))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -228,11 +228,11 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) - (while (or (< (- (current-time) (-> self state-time)) (seconds 30)) + (set-time! (-> self state-time)) + (while (or (not (time-elapsed? (-> self state-time) (seconds 30))) (let ((a0-3 (level-get-target-inside *level*))) (when (not (and a0-3 (logtest? (-> a0-3 info level-flags) 1))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) #t ) ) @@ -865,7 +865,7 @@ ;; WARN: Return type mismatch float vs none. -(defmethod ctyport-mine-method-23 ctyport-mine ((obj ctyport-mine)) +(defmethod ctyport-mine-method-23 ctyport-mine ((this ctyport-mine)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -875,17 +875,17 @@ ) (init-vf0-vector) (get-base-height *ocean-map-city*) - (let ((f0-1 (-> obj period)) + (let ((f0-1 (-> this period)) (t9-1 sin-rad) (f1-0 -3.1415925) (f2-0 6.283185) - (f3-1 (the float (+ (current-time) (the-as time-frame (-> obj time-skew))))) + (f3-1 (the float (+ (current-time) (the-as time-frame (-> this time-skew))))) ) (t9-1 (+ f1-0 (* f2-0 (/ (- f3-1 (* (the float (the int (/ f3-1 f0-1))) f0-1)) f0-1)))) ) - (let ((s5-0 (-> obj info))) + (let ((s5-0 (-> this info))) (cond - ((zero? (-> obj info type)) + ((zero? (-> this info type)) (let* ((f0-8 (+ (* 2.0 (-> s5-0 offset)) (/ (* 0.0033333334 (the float (current-time))) (-> s5-0 speed)))) (f0-9 (- f0-8 (* (the float (the int (/ f0-8 2.0))) 2.0))) ) @@ -893,7 +893,7 @@ (set! f0-9 (- 2.0 f0-9)) ) (let ((f0-13 (* 0.5 (- 1.0 (cos (* 32768.0 f0-9)))))) - (let ((v1-23 (-> obj root trans)) + (let ((v1-23 (-> this root trans)) (a0-5 (new 'stack-no-clear 'vector)) ) (set! (-> a0-5 x) (-> s5-0 pos1-x)) @@ -902,8 +902,8 @@ (set! (-> a0-5 w) 1.0) (vector-float*! v1-23 a0-5 f0-13) ) - (let ((s4-0 (-> obj root trans))) - (let ((v1-27 (-> obj root trans))) + (let ((s4-0 (-> this root trans))) + (let ((v1-27 (-> this root trans))) (let ((a0-6 (new 'stack-no-clear 'vector))) (set! (-> a0-6 x) (-> s5-0 pos2-x)) (set! (-> a0-6 y) (-> s5-0 pos2-y)) @@ -925,7 +925,7 @@ ) ) (else - (let ((s4-1 (-> obj root trans))) + (let ((s4-1 (-> this root trans))) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 x) (-> s5-0 pos1-x)) (set! (-> s3-0 y) (-> s5-0 pos1-y)) @@ -954,13 +954,13 @@ ) ) ) - (+! (-> obj speed-y) - (* 10.0 (seconds-per-frame) (- (get-height *ocean* (-> obj root trans) #t) (-> obj trans-y))) + (+! (-> this speed-y) + (* 10.0 (seconds-per-frame) (- (get-height *ocean* (-> this root trans) #t) (-> this trans-y))) ) - (set! (-> obj speed-y) (- (-> obj speed-y) (* (-> obj speed-y) (seconds-per-frame)))) - (set! (-> obj speed-y) (- (-> obj speed-y) (* 4096.0 (seconds-per-frame)))) - (+! (-> obj trans-y) (* (-> obj speed-y) (seconds-per-frame))) - (set! (-> obj root trans y) (+ 2048.0 (-> obj trans-y))) + (set! (-> this speed-y) (- (-> this speed-y) (* (-> this speed-y) (seconds-per-frame)))) + (set! (-> this speed-y) (- (-> this speed-y) (* 4096.0 (seconds-per-frame)))) + (+! (-> this trans-y) (* (-> this speed-y) (seconds-per-frame))) + (set! (-> this root trans y) (+ 2048.0 (-> this trans-y))) (none) ) ) @@ -968,13 +968,13 @@ (defstate die (ctyport-mine) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self beep-time) 0) 0 ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 3)) + (until (time-elapsed? gp-0 (seconds 3)) (suspend) ) ) @@ -982,7 +982,7 @@ ) :post (behavior () (cond - ((and (-> self beep) (< (- (current-time) (-> self state-time)) (seconds 1))) + ((and (-> self beep) (not (time-elapsed? (-> self state-time) (seconds 1)))) (vector-seek! (-> self beep-color) *null-vector* (* 4.0 (seconds-per-frame))) (when (< (-> self beep-time) (current-time)) (sound-play "cargo-beep") @@ -1195,10 +1195,10 @@ (defstate idle (ctyport-spy) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.3)) + (when (time-elapsed? (-> self state-time) (seconds 0.3)) (+! (-> self trans-y) (* (-> self root transv y) (seconds-per-frame))) (+! (-> self root transv y) (* -8.0 (seconds-per-frame) (-> self root transv y))) (set! (-> self root trans y) @@ -1437,10 +1437,10 @@ :post transform-post ) -(defmethod ctyport-cargo-method-30 ctyport-cargo ((obj ctyport-cargo)) - (send-event *camera* 'change-target obj) +(defmethod ctyport-cargo-method-30 ctyport-cargo ((this ctyport-cargo)) + (send-event *camera* 'change-target this) (let ((gp-0 (new 'stack 'transformq))) - (vector+! (-> gp-0 trans) (-> obj root trans) (new 'static 'vector :y 16384.0 :z 28672.0 :w 1.0)) + (vector+! (-> gp-0 trans) (-> this root trans) (new 'static 'vector :y 16384.0 :z 28672.0 :w 1.0)) (set-vector! (-> gp-0 scale) 1.0 1.0 1.0 1.0) (quaternion-zxy! (-> gp-0 quat) (new 'static 'vector :x 1820.4445 :y 32768.0 :w 1.0)) (send-event *camera* 'teleport-to-transformq gp-0) @@ -1488,7 +1488,7 @@ :virtual #t :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1757,7 +1757,7 @@ ) (cond ((and (= (-> self count) (-> self max-count)) (zero? (-> self data-int32 22))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ((and (or (and (zero? (-> self data-int32 20)) (= (-> self count) (+ (-> self max-count) -1))) (= (-> self data-int32 22) 1) @@ -1768,7 +1768,7 @@ (set! (-> self data-int32 20) 1) (+! (-> self data-int32 22) 1) (set! (-> self time-limit) (seconds 135)) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-cargo :init hud-init-by-other :to self))) ) ) @@ -1841,8 +1841,8 @@ (lambda :behavior task-manager () (send-event *traffic-manager* 'set-target-level 1.0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (send-event *traffic-manager* 'set-alert-level 1) @@ -1879,7 +1879,7 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 2)) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) @@ -1894,8 +1894,8 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (suspend) ) (task-node-close! (game-task-node city-port-run-post-win)) diff --git a/goal_src/jak2/levels/city/port/race/errol-chal.gc b/goal_src/jak2/levels/city/port/race/errol-chal.gc index 71f928f9a2..fe9b8190e6 100644 --- a/goal_src/jak2/levels/city/port/race/errol-chal.gc +++ b/goal_src/jak2/levels/city/port/race/errol-chal.gc @@ -404,29 +404,29 @@ :bounds (static-spherem 0 2 0 3) ) -(defmethod initialize-collision errol-racer ((obj errol-racer)) - (set! (-> obj level) (level-get *level* 'lerlchal)) - (stack-size-set! (-> obj main-thread) 256) - (when (not (-> obj level)) +(defmethod initialize-collision errol-racer ((this errol-racer)) + (set! (-> this level) (level-get *level* 'lerlchal)) + (stack-size-set! (-> this main-thread) 256) + (when (not (-> this level)) (format 0 "errol-racer::initialize-collision: ERROR, no lerlchal level~%") (go process-drawable-art-error "no lerlchal level") ) - (set! (-> obj root) (the-as collide-shape (new 'process 'trsqv))) + (set! (-> this root) (the-as collide-shape (new 'process 'trsqv))) 0 (none) ) -(defmethod vehicle-rider-method-32 errol-racer ((obj errol-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 errol-racer ((this errol-racer) (arg0 traffic-object-spawn-params)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-errol-racer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj flags) 1) - (set! (-> obj draw lod-set lod 0 dist) 286720.0) - (vehicle-rider-method-33 obj) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 38) (the-as int #f) (the-as vector #t) 0)) - (set! (-> obj riding-anim) 4) + (logior! (-> this flags) 1) + (set! (-> this draw lod-set lod 0 dist) 286720.0) + (vehicle-rider-method-33 this) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 38) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this riding-anim) 4) 0 (none) ) @@ -486,18 +486,18 @@ ) -(defmethod vehicle-method-117 vehicle-city-racer ((obj vehicle-city-racer) (arg0 vector) (arg1 int) (arg2 int)) - ((method-of-type vehicle vehicle-method-117) obj arg0 arg1 arg2) +(defmethod vehicle-method-117 vehicle-city-racer ((this vehicle-city-racer) (arg0 vector) (arg1 int) (arg2 int)) + ((method-of-type vehicle vehicle-method-117) this arg0 arg1 arg2) 0 (none) ) -(defmethod vehicle-method-137 vehicle-city-racer ((obj vehicle-city-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 vehicle-city-racer ((this vehicle-city-racer) (arg0 traffic-object-spawn-params)) (let ((t9-0 vehicle-rider-spawn) (v1-0 (-> arg0 user-data)) ) (t9-0 - obj + this (if (= v1-0 2) errol-racer citizen-norm-rider @@ -509,33 +509,33 @@ (none) ) -(defmethod vehicle-racer-method-154 vehicle-city-racer ((obj vehicle-city-racer)) +(defmethod vehicle-racer-method-154 vehicle-city-racer ((this vehicle-city-racer)) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (let ((f0-0 368640.0)) - (if (or (< (* f0-0 f0-0) (-> obj player-dist2)) + (if (or (< (* f0-0 f0-0) (-> this player-dist2)) (let ((f0-3 102400.0)) - (and (< (* f0-3 f0-3) (-> obj player-dist2)) - (not (logtest? (-> obj draw status) (draw-control-status on-screen))) + (and (< (* f0-3 f0-3) (-> this player-dist2)) + (not (logtest? (-> this draw status) (draw-control-status on-screen))) ) ) ) - (rigid-body-object-method-39 obj) + (rigid-body-object-method-39 this) ) ) ) (else - (let ((f0-6 (-> obj player-dist2)) + (let ((f0-6 (-> this player-dist2)) (f1-2 348160.0) ) (if (and (< f0-6 (* f1-2 f1-2)) - (let ((f0-7 (-> obj player-dist2)) + (let ((f0-7 (-> this player-dist2)) (f1-5 81920.0) ) - (or (< f0-7 (* f1-5 f1-5)) (logtest? (-> obj draw status) (draw-control-status on-screen))) + (or (< f0-7 (* f1-5 f1-5)) (logtest? (-> this draw status) (draw-control-status on-screen))) ) ) - (rigid-body-object-method-38 obj) + (rigid-body-object-method-38 this) ) ) ) @@ -554,12 +554,12 @@ ;; WARN: Return type mismatch vehicle-city-racer vs race-bike-a. -(defmethod relocate race-bike-a ((obj race-bike-a) (arg0 int)) - (the-as race-bike-a ((method-of-type vehicle-city-racer relocate) obj arg0)) +(defmethod relocate race-bike-a ((this race-bike-a) (arg0 int)) + (the-as race-bike-a ((method-of-type vehicle-city-racer relocate) this arg0)) ) -(defmethod allocate-and-init-cshape race-bike-a ((obj race-bike-a)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape race-bike-a ((this race-bike-a)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -605,21 +605,21 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-skel-and-rigid-body race-bike-a ((obj race-bike-a)) +(defmethod init-skel-and-rigid-body race-bike-a ((this race-bike-a)) (lwide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj rider-hand-joint) 0) - (alloc-and-init-rigid-body-control obj *race-bike-a-constants*) + (set! (-> this rider-hand-joint) 0) + (alloc-and-init-rigid-body-control this *race-bike-a-constants*) 0 (none) ) @@ -634,12 +634,12 @@ ;; WARN: Return type mismatch vehicle-racer vs race-bike-b. -(defmethod relocate race-bike-b ((obj race-bike-b) (arg0 int)) - (the-as race-bike-b ((method-of-type vehicle-racer relocate) obj arg0)) +(defmethod relocate race-bike-b ((this race-bike-b) (arg0 int)) + (the-as race-bike-b ((method-of-type vehicle-racer relocate) this arg0)) ) -(defmethod allocate-and-init-cshape race-bike-b ((obj race-bike-b)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape race-bike-b ((this race-bike-b)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -685,21 +685,21 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-skel-and-rigid-body race-bike-b ((obj race-bike-b)) +(defmethod init-skel-and-rigid-body race-bike-b ((this race-bike-b)) (lwide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikeb" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj rider-hand-joint) 0) - (alloc-and-init-rigid-body-control obj *race-bike-b-constants*) + (set! (-> this rider-hand-joint) 0) + (alloc-and-init-rigid-body-control this *race-bike-b-constants*) 0 (none) ) @@ -759,7 +759,7 @@ (when (< f0-5 (* f1-0 f1-0)) (when (or (and (< f30-0 0.0) (>= f28-0 0.0)) (and (< f28-0 0.0) (>= f30-0 0.0))) (send-event proc 'turbo-ring (-> self boost)) - (set! (-> self touch-time) (current-time)) + (set-time! (-> self touch-time)) (process-spawn part-tracker :init part-tracker-init @@ -790,7 +790,7 @@ :code sleep-code :post (behavior () (if (and (-> self player-got) - (>= (- (current-time) (-> self touch-time)) (seconds 3)) + (time-elapsed? (-> self touch-time) (seconds 3)) (or (not *target*) (or (< 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (focus-test? *target* teleporting) ) @@ -807,20 +807,20 @@ (defstate die (turbo-ring) :virtual #t :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-3 (-> self root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) 0 - (until (>= (- (current-time) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (suspend) ) ) ) -(defmethod turbo-ring-method-22 turbo-ring ((obj turbo-ring)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod turbo-ring-method-22 turbo-ring ((this turbo-ring)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrate-using) (the-as penetrate -1)) (set! (-> s5-0 penetrated-by) (the-as penetrate -1)) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) @@ -835,29 +835,29 @@ (set! (-> s5-0 backup-collide-with) (-> v1-7 prim-core collide-with)) ) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod turbo-ring-method-23 turbo-ring ((obj turbo-ring)) - (let ((s5-0 (-> obj mat))) +(defmethod turbo-ring-method-23 turbo-ring ((this turbo-ring)) + (let ((s5-0 (-> this mat))) (let ((s4-0 (new 'stack-no-clear 'quaternion))) - (quaternion-rotate-local-y! s4-0 (-> obj root quat) 16384.0) + (quaternion-rotate-local-y! s4-0 (-> this root quat) 16384.0) (quaternion->matrix s5-0 s4-0) ) - (set! (-> s5-0 trans quad) (-> obj root trans quad)) - (set! (-> obj plane quad) (-> s5-0 vector 0 quad)) + (set! (-> s5-0 trans quad) (-> this root trans quad)) + (set! (-> this plane quad) (-> s5-0 vector 0 quad)) ) - (set! (-> obj plane w) (- (vector-dot (-> obj plane) (-> obj root trans)))) - (update-transforms (-> obj root)) - (set! (-> obj player-got) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1058) obj)) - (if (not (-> obj persistent)) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 15) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this plane w) (- (vector-dot (-> this plane) (-> this root trans)))) + (update-transforms (-> this root)) + (set! (-> this player-got) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1058) this)) + (if (not (-> this persistent)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 15) (the-as int #f) (the-as vector #t) 0)) ) - (set! (-> obj touch-time) (current-time)) + (set-time! (-> this touch-time)) 0 (none) ) @@ -1228,7 +1228,7 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while (not (logtest? (-> *race-state* flags) (race-flags begun))) (let ((f0-0 (-> self begin-pos w))) (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) @@ -1428,7 +1428,7 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while (not (logtest? (-> *race-state* flags) (race-flags begun))) (let ((f0-0 (-> self begin-pos w))) (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) diff --git a/goal_src/jak2/levels/city/power/ctypower.gc b/goal_src/jak2/levels/city/power/ctypower.gc index 97392d688d..10eb04d3cb 100644 --- a/goal_src/jak2/levels/city/power/ctypower.gc +++ b/goal_src/jak2/levels/city/power/ctypower.gc @@ -7,39 +7,39 @@ ;; DECOMP BEGINS -(defmethod draw hud-turret ((obj hud-turret)) +(defmethod draw hud-turret ((this hud-turret)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 205 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 22) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -19 22) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-turret ((obj hud-turret)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-turret ((this hud-turret)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-turret ((obj hud-turret)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-turret ((this hud-turret)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x679))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x679))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -113,7 +113,7 @@ ) ) (if (= (-> self count) (-> self max-count)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (set! (-> *game-info* counter) (the float (-> self count))) ) @@ -153,8 +153,8 @@ () (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-turret :init hud-init-by-other :to self))) (send-event *traffic-manager* 'set-target-level 1.0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (send-event *traffic-manager* 'set-alert-level 1) @@ -186,8 +186,8 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (suspend) ) (task-node-close! (game-task-node city-power-post-win)) diff --git a/goal_src/jak2/levels/city/protect/protect.gc b/goal_src/jak2/levels/city/protect/protect.gc index e7712f7aea..406c10af3c 100644 --- a/goal_src/jak2/levels/city/protect/protect.gc +++ b/goal_src/jak2/levels/city/protect/protect.gc @@ -30,23 +30,23 @@ ) -(defmethod seal-of-mar-method-22 seal-of-mar ((obj seal-of-mar)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod seal-of-mar-method-22 seal-of-mar ((this seal-of-mar)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod seal-of-mar-method-23 seal-of-mar ((obj seal-of-mar)) +(defmethod seal-of-mar-method-23 seal-of-mar ((this seal-of-mar)) (with-pp (set! (-> pp level) (level-get *level* 'lprotect)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-seal-of-mar-game" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw force-lod) 0) - (set! (-> obj scale) 1.0) - (set! (-> obj draw lod-set lod 0 dist) 409600.0) + (set! (-> this draw force-lod) 0) + (set! (-> this scale) 1.0) + (set! (-> this draw lod-set lod 0 dist) 409600.0) 0 (none) ) @@ -69,14 +69,14 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! seal-of-mar ((obj seal-of-mar) (arg0 entity-actor)) +(defmethod init-from-entity! seal-of-mar ((this seal-of-mar) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -527,8 +527,8 @@ This commonly includes things such as: (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'leave) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (talker-spawn-func (-> *talker-speech* 185) *entity-pool* (target-pos 0) (the-as region #f)) diff --git a/goal_src/jak2/levels/city/sack/collection-task.gc b/goal_src/jak2/levels/city/sack/collection-task.gc index 1930154661..ca79f16ba1 100644 --- a/goal_src/jak2/levels/city/sack/collection-task.gc +++ b/goal_src/jak2/levels/city/sack/collection-task.gc @@ -7,39 +7,39 @@ ;; DECOMP BEGINS -(defmethod draw hud-moneybag ((obj hud-moneybag)) +(defmethod draw hud-moneybag ((this hud-moneybag)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 462.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 462.0 (* 130.0 (-> this offset)))) 210 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -25 25) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -25 25) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-moneybag ((obj hud-moneybag)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-moneybag ((this hud-moneybag)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-moneybag ((obj hud-moneybag)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-moneybag ((this hud-moneybag)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x7 :page #x679))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x7 :page #x679))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -64,12 +64,12 @@ ) -(defmethod find-ground krew-collection-item ((obj krew-collection-item)) +(defmethod find-ground krew-collection-item ((this krew-collection-item)) "TODO - understand the collision query stuff more @returns whether or not the [[self]] is above the ground" (let ((on-ground? #f)) (let ((query (new 'stack-no-clear 'collide-query-with-2vec))) - (set! (-> query vec quad) (-> obj root trans quad)) + (set! (-> query vec quad) (-> this root trans quad)) (set! (-> query cquery start-pos quad) (-> query vec quad)) (vector-reset! (-> query vec2)) (set! (-> query vec2 y) 1.0) @@ -93,8 +93,8 @@ (format #t "krew-collection-item::find-ground: ground y ~M~%" (-> query vec y)) ) ) - (set! (-> obj root trans quad) (-> query vec quad)) - (forward-up-nopitch->quaternion (-> obj root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> query vec2)) + (set! (-> this root trans quad) (-> query vec quad)) + (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> query vec2)) ) on-ground? ) @@ -307,7 +307,7 @@ (when krew-item (set! (-> self slave 0) (process->handle krew-item)) (set! (-> self time-limit) (the-as time-frame (-> self data-int32 task-count))) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (+! (-> self count) 1) ) ) @@ -347,8 +347,8 @@ (ppointer->handle (process-spawn hud-moneybag :init hud-init-by-other :to *target*)) ) (send-event *traffic-manager* 'set-target-level 1.0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (send-event *traffic-manager* 'set-alert-level 2) @@ -371,8 +371,8 @@ () (send-event *traffic-manager* 'decrease-alert-level 0) (send-event *traffic-manager* 'set-alert-duration (seconds 30)) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (talker-spawn-func (-> *talker-speech* 88) *entity-pool* (target-pos 0) (the-as region #f)) diff --git a/goal_src/jak2/levels/city/shuttle/shuttle.gc b/goal_src/jak2/levels/city/shuttle/shuttle.gc index bc0ca87dcc..62374834fe 100644 --- a/goal_src/jak2/levels/city/shuttle/shuttle.gc +++ b/goal_src/jak2/levels/city/shuttle/shuttle.gc @@ -7,39 +7,39 @@ ;; DECOMP BEGINS -(defmethod draw hud-citizen ((obj hud-citizen)) +(defmethod draw hud-citizen ((this hud-citizen)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 452.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 452.0 (* 130.0 (-> this offset)))) 195 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -15 47) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -15 47) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-citizen ((obj hud-citizen)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-citizen ((this hud-citizen)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-citizen ((obj hud-citizen)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-citizen ((this hud-citizen)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x679))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.9) - (set! (-> obj sprites 0 scale-y) 0.9) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x679))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.9) + (set! (-> this sprites 0 scale-y) 0.9) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -261,15 +261,15 @@ ) -(defmethod cleanup-for-death citizen-rebel ((obj citizen-rebel)) +(defmethod cleanup-for-death citizen-rebel ((this citizen-rebel)) (with-pp - (when (and (zero? (-> obj hit-points)) (not (-> obj done?))) + (when (and (zero? (-> this hit-points)) (not (-> this done?))) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'fail) (let ((t9-0 send-event-function) - (v1-9 (-> *game-info* sub-task-list (-> obj task-node))) + (v1-9 (-> *game-info* sub-task-list (-> this task-node))) ) (t9-0 (handle->process (if (-> v1-9 info) @@ -282,7 +282,7 @@ ) ) ) - ((method-of-type citizen-norm cleanup-for-death) obj) + ((method-of-type citizen-norm cleanup-for-death) this) (none) ) ) @@ -391,7 +391,7 @@ (set! (-> self gnd-height) (-> self root gspot-pos y)) (logior! (-> self flags) (citizen-flag persistent)) (logior! (-> self focus-status) (focus-status pilot-riding pilot)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-31 (-> self root root-prim))) (set! (-> v1-31 prim-core collide-as) (collide-spec)) (set! (-> v1-31 prim-core collide-with) (collide-spec)) @@ -421,7 +421,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'quaternion)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while (not (civilian-method-217 self gp-0)) (let ((s4-0 (handle->process (-> self vehicle))) (s3-0 (new 'stack-no-clear 'quaternion)) @@ -430,7 +430,7 @@ (compute-seat-position (the-as vehicle s4-0) (-> self root trans) (-> self seat)) (quaternion-copy! (-> self root quat) s3-0) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 2)) + (when (time-elapsed? (-> self state-time) (seconds 2)) (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) (go-virtual ride) ) @@ -643,69 +643,69 @@ ) ;; WARN: disable def twice: 51. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler citizen-rebel ((obj citizen-rebel) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler citizen-rebel ((this citizen-rebel) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) - (when (nonzero? (-> obj gui-id)) + (when (nonzero? (-> this gui-id)) (set-action! *gui-control* (gui-action stop) - (-> obj gui-id) + (-> this gui-id) (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj gui-id) (new 'static 'sound-id)) + (set! (-> this gui-id) (new 'static 'sound-id)) 0 ) - ((method-of-type civilian general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type civilian general-event-handler) this arg0 arg1 arg2 arg3) ) (('play-speech) (let ((s5-1 (-> arg3 param 0))) - (when (= (get-status *gui-control* (-> obj gui-id)) (gui-status unknown)) + (when (= (get-status *gui-control* (-> this gui-id)) (gui-status unknown)) (let ((v0-1 (the-as object - (add-process *gui-control* obj (gui-channel citizen) (gui-action play) (the-as string s5-1) -99.0 0) + (add-process *gui-control* this (gui-channel citizen) (gui-action play) (the-as string s5-1) -99.0 0) ) ) ) - (set! (-> obj gui-id) (the-as sound-id v0-1)) + (set! (-> this gui-id) (the-as sound-id v0-1)) v0-1 ) ) ) ) (('nav-mesh-kill) - (format 0 "nav-mesh-kill event recieved by ~s~%" (-> obj name)) - (set! (-> obj nav-mesh-aid) (the-as actor-id (-> obj nav state mesh entity aid))) - (change-to *default-nav-mesh* obj) + (format 0 "nav-mesh-kill event recieved by ~s~%" (-> this name)) + (set! (-> this nav-mesh-aid) (the-as actor-id (-> this nav state mesh entity aid))) + (change-to *default-nav-mesh* this) #t ) (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod enemy-method-58 citizen-rebel ((obj citizen-rebel) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 citizen-rebel ((this citizen-rebel) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (if (logtest? #x4000000 (-> obj incoming penetrate-using)) + (if (logtest? #x4000000 (-> this incoming penetrate-using)) (set! v0-0 #f) ) v0-0 ) ) -(defmethod get-penetrate-info citizen-rebel ((obj citizen-rebel)) +(defmethod get-penetrate-info citizen-rebel ((this citizen-rebel)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" - (let ((v1-1 ((method-of-type nav-enemy get-penetrate-info) obj))) + (let ((v1-1 ((method-of-type nav-enemy get-penetrate-info) this))) (logior (penetrate enemy-yellow-shot) v1-1) ) ) @@ -764,94 +764,94 @@ ) ) -(defmethod init-enemy! citizen-rebel ((obj citizen-rebel)) +(defmethod init-enemy! citizen-rebel ((this citizen-rebel)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-rebel" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *citizen-rebel-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *citizen-rebel-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 491520.0) - (try-update-focus (-> obj focus) *target* obj) - (-> obj neck) - (set! (-> obj info) *citizen-rebel-global-info*) - (set! (-> obj anim-shuffle) 10) - (let ((v1-16 (get-rand-int obj 3))) + (set! (-> this draw lod-set lod 0 dist) 491520.0) + (try-update-focus (-> this focus) *target* this) + (-> this neck) + (set! (-> this info) *citizen-rebel-global-info*) + (set! (-> this anim-shuffle) 10) + (let ((v1-16 (get-rand-int this 3))) (cond ((zero? v1-16) - (set! (-> obj anim-walk) 11) - (set! (-> obj dist-walk-anim) 8736.768) - (set! (-> obj speed-walk) 10240.0) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 8736.768) + (set! (-> this speed-walk) 10240.0) ) ((= v1-16 1) - (set! (-> obj anim-walk) 12) - (set! (-> obj dist-walk-anim) 13107.2) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 12) + (set! (-> this dist-walk-anim) 13107.2) + (set! (-> this speed-walk) 12288.0) ) ((= v1-16 2) - (set! (-> obj anim-walk) 13) - (set! (-> obj dist-walk-anim) 4370.432) - (set! (-> obj speed-walk) 4096.0) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 4370.432) + (set! (-> this speed-walk) 4096.0) ) ) ) - (let ((v1-31 (get-rand-int obj 3))) + (let ((v1-31 (get-rand-int this 3))) (cond ((zero? v1-31) - (set! (-> obj anim-panic-run) 17) + (set! (-> this anim-panic-run) 17) ) ((= v1-31 1) - (set! (-> obj anim-panic-run) 18) + (set! (-> this anim-panic-run) 18) ) ((= v1-31 2) - (set! (-> obj anim-panic-run) 14) + (set! (-> this anim-panic-run) 14) ) ) ) - (set! (-> obj dist-run-anim) 28672.0) - (let ((v1-38 (get-rand-int obj 3))) + (set! (-> this dist-run-anim) 28672.0) + (let ((v1-38 (get-rand-int this 3))) (cond ((zero? v1-38) - (set! (-> obj anim-run) 14) + (set! (-> this anim-run) 14) ) ((= v1-38 1) - (set! (-> obj anim-run) 15) + (set! (-> this anim-run) 15) ) ((= v1-38 2) - (set! (-> obj anim-run) 16) + (set! (-> this anim-run) 16) ) ) ) - (set! (-> obj speed-run) 49152.0) - (set! (-> obj anim-on-ground) 20) - (set! (-> obj anim-dive) 19) - (set! (-> obj anim-get-up-front) 25) - (set! (-> obj anim-get-up-back) 26) - (let ((f30-0 (get-rand-float-range obj 1.0 1.25)) - (f0-10 (get-rand-float-range obj 1.0 1.25)) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-on-ground) 20) + (set! (-> this anim-dive) 19) + (set! (-> this anim-get-up-front) 25) + (set! (-> this anim-get-up-back) 26) + (let ((f30-0 (get-rand-float-range this 1.0 1.25)) + (f0-10 (get-rand-float-range this 1.0 1.25)) ) - (set-vector! (-> obj root scale) f0-10 f30-0 f0-10 1.0) + (set-vector! (-> this root scale) f0-10 f30-0 f0-10 1.0) ) - (let ((f0-12 (get-rand-float-range obj 0.9 1.0))) - (set-vector! (-> obj draw color-mult) f0-12 f0-12 f0-12 1.0) + (let ((f0-12 (get-rand-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-12 f0-12 f0-12 1.0) ) - (set! (-> obj water-anim) 32) - (set! (-> obj water) (new 'process 'water-control obj 5 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags active part-splash part-rings part-water)) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 12288.0) + (set! (-> this water-anim) 32) + (set! (-> this water) (new 'process 'water-control this 5 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags active part-splash part-rings part-water)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 12288.0) 0 (none) ) -(defmethod init-enemy-collision! citizen-rebel ((obj citizen-rebel)) +(defmethod init-enemy-collision! citizen-rebel ((this citizen-rebel)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -907,47 +907,47 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod citizen-init! citizen-rebel ((obj citizen-rebel)) +(defmethod citizen-init! citizen-rebel ((this citizen-rebel)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj dive-reaction) (+ 0.09 (* 0.15 (rand-vu)))) - (logclear! (-> obj mask) (process-mask enemy)) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 4 0) - (setup-masks (-> obj draw) 16 0) - (setup-masks (-> obj draw) 64 0) - (let ((v1-14 (get-rand-int obj 3))) + (set! (-> this dive-reaction) (+ 0.09 (* 0.15 (rand-vu)))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 4 0) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 64 0) + (let ((v1-14 (get-rand-int this 3))) (cond ((zero? v1-14) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) ((= v1-14 1) - (setup-masks (-> obj draw) 8 0) + (setup-masks (-> this draw) 8 0) ) ((= v1-14 2) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ) ) - (let ((v1-23 (get-rand-int obj 2))) + (let ((v1-23 (get-rand-int this 2))) (cond ((zero? v1-23) - (setup-masks (-> obj draw) 32 0) + (setup-masks (-> this draw) 32 0) ) ((= v1-23 1) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ) ) - (let ((v1-29 (-> obj nav))) + (let ((v1-29 (-> this nav))) (set! (-> v1-29 sphere-mask) (the-as uint #x800fe)) ) 0 @@ -1040,7 +1040,7 @@ (check-time arg0) ) (else - (set! (-> arg0 start-time) (current-time)) + (set-time! (-> arg0 start-time)) (when (< (vector-vector-xz-distance (target-pos 0) (-> arg0 begin-pos)) 102400.0) (set-setting! 'airlock #f 0.0 0) (set! (-> arg0 data-int32 9) 1) @@ -1292,7 +1292,7 @@ (when (zero? (-> arg0 data-int32 s3-2)) (send-event (handle->process (-> arg0 arrow)) 'set-position (-> arg1 s3-2 pos)) (set! (-> arg0 time-limit) (-> arg1 s3-2 time)) - (set! (-> arg0 start-time) (current-time)) + (set-time! (-> arg0 start-time)) (set! (-> arg0 data-int32 s3-2) 1) ) (let ((s1-2 (find-nearest-nav-mesh (-> arg1 s3-2 pos) (the-as float #x7f800000)))) @@ -1516,8 +1516,8 @@ (while (zero? (-> self sub-state)) (suspend) ) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (send-event *traffic-manager* 'set-alert-level 2) @@ -1539,7 +1539,7 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (talker-spawn-func (-> *talker-speech* 97) *entity-pool* (target-pos 0) (the-as region #f)) (let ((gp-1 (current-time))) (until #f @@ -1551,7 +1551,7 @@ ) ) ) - (if (or (>= v1-4 4) (>= (- (current-time) gp-1) (seconds 10))) + (if (or (>= v1-4 4) (time-elapsed? gp-1 (seconds 10))) (goto cfg-23) ) ) @@ -1687,8 +1687,8 @@ (while (zero? (-> self sub-state)) (suspend) ) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (send-event *traffic-manager* 'set-alert-level 2) @@ -1710,7 +1710,7 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (let ((v1-2 0)) (dotimes (a0-0 4) diff --git a/goal_src/jak2/levels/city/slums/kor/kid-h.gc b/goal_src/jak2/levels/city/slums/kor/kid-h.gc index a37988b8ff..20ab67bc4f 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid-h.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid-h.gc @@ -31,10 +31,10 @@ ) -(defskelgroup skel-kid kid 0 3 - ((1 (meters 999999))) +(defskelgroup skel-kid kid kid-lod0-jg kid-idle0-ja + ((kid-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 2) - :shadow 2 + :shadow kid-shadow-mg :origin-joint-index 13 ) diff --git a/goal_src/jak2/levels/city/slums/kor/kid-states.gc b/goal_src/jak2/levels/city/slums/kor/kid-states.gc index 4b90977c2c..4b7fbb15ab 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid-states.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid-states.gc @@ -13,7 +13,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -83,7 +83,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -235,7 +235,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -305,7 +305,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -334,10 +334,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (kid-method-232 self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -368,7 +368,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -392,7 +392,7 @@ ) (go-virtual arrested) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -425,7 +425,7 @@ (go-virtual arrested) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (not (nav-enemy-method-163 self)) (go-virtual traveling) ) @@ -496,7 +496,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -564,12 +564,12 @@ (ja-channel-push! 1 (seconds 0.1)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (ja-no-eval :group! (-> self draw art-group data 16) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 4)) + (time-elapsed? (-> self state-time) (seconds 4)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) diff --git a/goal_src/jak2/levels/city/slums/kor/kid-task.gc b/goal_src/jak2/levels/city/slums/kor/kid-task.gc index 665b674fe4..680d11bf9c 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid-task.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid-task.gc @@ -7,42 +7,42 @@ ;; DECOMP BEGINS -(defmethod reset-task! kidt-wait-spot ((obj kidt-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! kidt-wait-spot ((this kidt-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kidt-wait-spot ((obj kidt-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 kidt-wait-spot ((this kidt-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as kid arg0)) + ((-> this check-done) this (the-as kid arg0)) (none) ) diff --git a/goal_src/jak2/levels/city/slums/kor/kid.gc b/goal_src/jak2/levels/city/slums/kor/kid.gc index f35903bb32..08a193e34b 100644 --- a/goal_src/jak2/levels/city/slums/kor/kid.gc +++ b/goal_src/jak2/levels/city/slums/kor/kid.gc @@ -180,64 +180,61 @@ (set! (-> *kid-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler kid ((obj kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler kid ((this kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('arrest) - (let* ((s4-0 (handle->process (-> obj arrestor-handle))) + (let* ((s4-0 (handle->process (-> this arrestor-handle))) (v1-4 (if (type? s4-0 process-focusable) s4-0 ) ) ) - (when (or (not v1-4) - (= v1-4 arg0) - (and (!= v1-4 arg0) (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.1))) - ) - (set! (-> obj arrestor-handle) (process->handle arg0)) - (set! (-> obj arrest-attempt-time) (current-time)) + (when (or (not v1-4) (= v1-4 arg0) (and (!= v1-4 arg0) (time-elapsed? (-> this arrest-attempt-time) (seconds 0.1)))) + (set! (-> this arrestor-handle) (process->handle arg0)) + (set-time! (-> this arrest-attempt-time)) 0 ) ) #t ) (('instant-arrest) - (logior! (-> obj bot-flags) (bot-flags bf20)) + (logior! (-> this bot-flags) (bot-flags bf20)) (let ((v1-18 (the-as object (-> arg3 param 0)))) - (set! (-> obj arrestor-handle) (process->handle (the-as process v1-18))) - (set! (-> obj arrest-attempt-time) (current-time)) + (set! (-> this arrestor-handle) (process->handle (the-as process v1-18))) + (set-time! (-> this arrest-attempt-time)) (let ((a1-8 (new 'stack-no-clear 'vector))) - (vector-! a1-8 (-> (the-as process-drawable v1-18) root trans) (-> obj root trans)) + (vector-! a1-8 (-> (the-as process-drawable v1-18) root trans) (-> this root trans)) (set! (-> a1-8 y) 0.0) - (forward-up->quaternion (-> obj root quat) a1-8 *up-vector*) + (forward-up->quaternion (-> this root quat) a1-8 *up-vector*) ) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (send-event (handle->process (-> obj master-handle)) 'notify 'arrest #f) - (go (method-of-object obj arrested)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (send-event (handle->process (-> this master-handle)) 'notify 'arrest #f) + (go (method-of-object this arrested)) ) (('attack) - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) #f ) (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod enemy-method-97 kid ((obj kid)) - (let* ((s4-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 kid ((this kid)) + (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) - (s3-0 (handle->process (-> obj arrestor-handle))) + (s3-0 (handle->process (-> this arrestor-handle))) (s4-1 (if (type? s3-0 process-focusable) s3-0 ) @@ -246,33 +243,33 @@ (when s5-0 (cond ((= (-> s5-0 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 1.5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 6)) + (when (time-elapsed? (-> this attacker-time) (seconds 6)) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) (when s4-1 - (when (or (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.5)) + (when (or (time-elapsed? (-> this arrest-attempt-time) (seconds 0.5)) (focus-test? (the-as process-focusable s4-1) dead hit) ) (set! s4-1 (the-as process #f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this arrestor-handle) (the-as handle #f)) ) ) - (let ((v1-34 (-> obj focus-mode)) + (let ((v1-34 (-> this focus-mode)) (s3-1 (the-as process #f)) ) (cond @@ -284,11 +281,11 @@ (s5-0 (set! s3-1 s5-0) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else - (let ((s5-1 (handle->process (-> obj poi-handle)))) + (let ((s5-1 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-1 process-focusable) s5-1 ) @@ -310,7 +307,7 @@ (set! s3-1 s5-0) ) (else - (let ((s5-2 (handle->process (-> obj poi-handle)))) + (let ((s5-2 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-2 process-focusable) s5-2 ) @@ -320,7 +317,7 @@ (s3-1 (empty) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else @@ -333,14 +330,14 @@ ) (cond (s3-1 - (try-update-focus (-> obj focus) (the-as process-focusable s3-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s3-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s3-1 @@ -348,22 +345,22 @@ ) ) -(defmethod alive? kid ((obj kid)) +(defmethod alive? kid ((this kid)) (let ((t9-0 (method-of-type bot alive?))) - (and (t9-0 obj) - (not (and (-> obj next-state) (let ((v1-4 (-> obj next-state name))) - (or (= v1-4 'arrested) (= v1-4 'die) (= v1-4 'die-falling)) - ) + (and (t9-0 this) + (not (and (-> this next-state) (let ((v1-4 (-> this next-state name))) + (or (= v1-4 'arrested) (= v1-4 'die) (= v1-4 'die-falling)) + ) ) ) - (not (logtest? (bot-flags bf20) (-> obj bot-flags))) + (not (logtest? (bot-flags bf20) (-> this bot-flags))) ) ) ) -(defmethod init-enemy-collision! kid ((obj kid)) +(defmethod init-enemy-collision! kid ((this kid)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -428,40 +425,40 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init! kid ((obj kid)) +(defmethod init! kid ((this kid)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj min-speed) 6144.0) - (set! (-> obj max-speed) 22528.0) - (set! (-> obj channel) (the-as uint 26)) - (set! (-> obj notice-enemy-dist) 122880.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 0.0) - (set-vector! (-> obj root scale) 1.2 1.2 1.2 1.0) - (set! (-> obj spot-color) (the-as uint #x60004f8f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this min-speed) 6144.0) + (set! (-> this max-speed) 22528.0) + (set! (-> this channel) (the-as uint 26)) + (set! (-> this notice-enemy-dist) 122880.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 0.0) + (set-vector! (-> this root scale) 1.2 1.2 1.2 1.0) + (set! (-> this spot-color) (the-as uint #x60004f8f)) + (set! (-> this arrestor-handle) (the-as handle #f)) 0 (none) ) -(defmethod init-enemy! kid ((obj kid)) +(defmethod init-enemy! kid ((this kid)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) + (init! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-kid" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *kid-nav-enemy-info*) - (let ((v1-7 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *kid-nav-enemy-info*) + (let ((v1-7 (-> this neck))) (set! (-> v1-7 up) (the-as uint 1)) (set! (-> v1-7 nose) (the-as uint 2)) (set! (-> v1-7 ear) (the-as uint 0)) @@ -469,102 +466,102 @@ (set! (-> v1-7 ignore-angle) 30947.555) ) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) 0 (none) ) -(defmethod bot-method-214 kid ((obj kid)) +(defmethod bot-method-214 kid ((this kid)) #f ) ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile kid ((obj kid)) - (kid-method-232 obj) +(defmethod go-hostile kid ((this kid)) + (kid-method-232 this) ) ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kid ((obj kid)) +(defmethod react-to-focus kid ((this kid)) "@TODO - flesh out docs" - (kid-method-232 obj) + (kid-method-232 this) ) ;; WARN: Return type mismatch object vs none. -(defmethod kid-method-233 kid ((obj kid)) - (go (method-of-object obj waiting-turn)) +(defmethod kid-method-233 kid ((this kid)) + (go (method-of-object this waiting-turn)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod kid-method-232 kid ((obj kid)) - (let ((s5-0 (handle->process (-> obj arrestor-handle)))) +(defmethod kid-method-232 kid ((this kid)) + (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) s5-0 ) - (go (method-of-object obj arrested)) + (go (method-of-object this arrested)) ) - ((logtest? (bot-flags bf19) (-> obj bot-flags)) - (go (method-of-object obj scared-idle)) + ((logtest? (bot-flags bf19) (-> this bot-flags)) + (go (method-of-object this scared-idle)) ) (else - (go (method-of-object obj waiting-idle)) + (go (method-of-object this waiting-idle)) ) ) ) (none) ) -(defmethod kid-method-234 kid ((obj kid)) +(defmethod kid-method-234 kid ((this kid)) (with-pp - (let ((f30-0 (-> obj nav state speed))) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 6144.0 22528.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-7 (= v1-7 (-> obj draw art-group data 5))) - (let ((v1-12 (-> obj skel root-channel 1))) + ((and v1-7 (= v1-7 (-> this draw art-group data 5))) + (let ((v1-12 (-> this skel root-channel 1))) (set! (-> v1-12 frame-interp 1) f28-0) (set! (-> v1-12 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 22528.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 8.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) - (a0-10 (-> obj skel root-channel 0)) + (a0-10 (-> this skel root-channel 0)) ) (set! (-> a0-10 param 0) f0-11) (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-11 (-> obj skel root-channel 1))) + (let ((a0-11 (-> this skel root-channel 1))) (set! (-> a0-11 param 0) 0.0) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 dist) 3276.8) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 5))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) (set! (-> a0-13 param 0) 1.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 5)) num-func-loop!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-loop!) ) - (let ((a0-14 (-> obj skel root-channel 1))) + (let ((a0-14 (-> this skel root-channel 1))) (set! (-> a0-14 frame-interp 1) f28-0) (set! (-> a0-14 frame-interp 0) f28-0) (set! (-> a0-14 dist) 8737.997) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-chan) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 6)) num-func-chan) ) ) ) @@ -574,22 +571,22 @@ ) ) -(defmethod damage-amount-from-attack kid ((obj kid) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack kid ((this kid) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" - (if (= (-> obj course course-id) 7) + (if (= (-> this course course-id) 7) 0 - ((method-of-type bot damage-amount-from-attack) obj arg0 arg1) + ((method-of-type bot damage-amount-from-attack) this arg0 arg1) ) ) -(defmethod bot-method-190 kid ((obj kid)) +(defmethod bot-method-190 kid ((this kid)) #t ) -(defmethod enemy-method-78 kid ((obj kid) (arg0 (pointer float))) +(defmethod enemy-method-78 kid ((this kid) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -601,47 +598,47 @@ ) ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kid ((obj kid) (arg0 vector)) +(defmethod set-cam-height! kid ((this kid) (arg0 vector)) (the-as meters (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'arrested)) + ((and (-> this next-state) (= (-> this next-state name) 'arrested)) (set-vector! arg0 49152.0 12288.0 49152.0 1.0) - (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) - (if (focus-test? obj under-water) - (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) ) ) (else - ((method-of-type bot set-cam-height!) obj arg0) + ((method-of-type bot set-cam-height!) this arg0) ) ) ) ) -(defmethod enemy-method-102 kid ((obj kid)) - (if (logtest? (bot-flags bf20) (-> obj bot-flags)) +(defmethod enemy-method-102 kid ((this kid)) + (if (logtest? (bot-flags bf20) (-> this bot-flags)) #f - ((method-of-type bot enemy-method-102) obj) + ((method-of-type bot enemy-method-102) this) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kid ((obj kid)) +(defmethod go-idle kid ((this kid)) (cond - ((= (-> obj course course-id) 7) + ((= (-> this course course-id) 7) (cond ((task-node-closed? (game-task-node city-help-kid-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj waiting-with-kor)) + (go (method-of-object this waiting-with-kor)) ) ) ) (else - (go (method-of-object obj waiting-idle)) + (go (method-of-object this waiting-idle)) ) ) (none) diff --git a/goal_src/jak2/levels/city/slums/kor/kor-h.gc b/goal_src/jak2/levels/city/slums/kor/kor-h.gc index 66bf6ea839..56660f3335 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor-h.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor-h.gc @@ -31,10 +31,10 @@ ) -(defskelgroup skel-kor kor 0 3 - ((1 (meters 999999))) +(defskelgroup skel-kor kor kor-lod0-jg kor-idle0-ja + ((kor-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 2.5) - :shadow 2 + :shadow kor-shadow-mg :origin-joint-index 13 ) diff --git a/goal_src/jak2/levels/city/slums/kor/kor-states.gc b/goal_src/jak2/levels/city/slums/kor/kor-states.gc index 7c4b6a5bbc..d4fe958755 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor-states.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor-states.gc @@ -11,7 +11,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -81,7 +81,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -244,7 +244,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -314,7 +314,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -343,10 +343,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (kor-method-232 self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -377,7 +377,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -401,7 +401,7 @@ ) (go-virtual arrested) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -434,7 +434,7 @@ (go-virtual arrested) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (not (nav-enemy-method-163 self)) (go-virtual traveling) ) @@ -505,7 +505,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -552,7 +552,7 @@ (ja-channel-push! 1 (seconds 0.25)) (cond ((and (not (logtest? (bot-flags bf20) (-> self bot-flags))) - (< (- (current-time) (-> self arrest-attempt-time)) (seconds 0.8)) + (not (time-elapsed? (-> self arrest-attempt-time) (seconds 0.8))) ) (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -585,12 +585,12 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (ja-no-eval :group! (-> self draw art-group data 18) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) diff --git a/goal_src/jak2/levels/city/slums/kor/kor-task.gc b/goal_src/jak2/levels/city/slums/kor/kor-task.gc index 69a4fdf173..d52c76b74e 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor-task.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor-task.gc @@ -7,42 +7,42 @@ ;; DECOMP BEGINS -(defmethod reset-task! kort-wait-spot ((obj kort-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! kort-wait-spot ((this kort-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kort-wait-spot ((obj kort-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 kort-wait-spot ((this kort-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as kor arg0)) + ((-> this check-done) this (the-as kor arg0)) (none) ) diff --git a/goal_src/jak2/levels/city/slums/kor/kor.gc b/goal_src/jak2/levels/city/slums/kor/kor.gc index c75effa73b..491a8f3655 100644 --- a/goal_src/jak2/levels/city/slums/kor/kor.gc +++ b/goal_src/jak2/levels/city/slums/kor/kor.gc @@ -189,59 +189,56 @@ (set! (-> *kor-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler kor ((obj kor) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler kor ((this kor) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('arrest) - (let* ((s4-0 (handle->process (-> obj arrestor-handle))) + (let* ((s4-0 (handle->process (-> this arrestor-handle))) (v1-4 (if (type? s4-0 process-focusable) s4-0 ) ) ) - (when (or (not v1-4) - (= v1-4 arg0) - (and (!= v1-4 arg0) (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.1))) - ) - (set! (-> obj arrestor-handle) (process->handle arg0)) - (set! (-> obj arrest-attempt-time) (current-time)) + (when (or (not v1-4) (= v1-4 arg0) (and (!= v1-4 arg0) (time-elapsed? (-> this arrest-attempt-time) (seconds 0.1)))) + (set! (-> this arrestor-handle) (process->handle arg0)) + (set-time! (-> this arrest-attempt-time)) 0 ) ) #t ) (('instant-arrest) - (logior! (-> obj bot-flags) (bot-flags bf20)) + (logior! (-> this bot-flags) (bot-flags bf20)) (let ((v1-18 (the-as object (-> arg3 param 0)))) - (set! (-> obj arrestor-handle) (process->handle (the-as process v1-18))) - (set! (-> obj arrest-attempt-time) (current-time)) + (set! (-> this arrestor-handle) (process->handle (the-as process v1-18))) + (set-time! (-> this arrest-attempt-time)) (let ((a1-8 (new 'stack-no-clear 'vector))) - (vector-! a1-8 (-> (the-as process-drawable v1-18) root trans) (-> obj root trans)) + (vector-! a1-8 (-> (the-as process-drawable v1-18) root trans) (-> this root trans)) (set! (-> a1-8 y) 0.0) - (forward-up->quaternion (-> obj root quat) a1-8 *up-vector*) + (forward-up->quaternion (-> this root quat) a1-8 *up-vector*) ) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (go (method-of-object obj arrested)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (go (method-of-object this arrested)) ) (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod enemy-method-97 kor ((obj kor)) - (let* ((s4-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 kor ((this kor)) + (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) - (s3-0 (handle->process (-> obj arrestor-handle))) + (s3-0 (handle->process (-> this arrestor-handle))) (s4-1 (if (type? s3-0 process-focusable) s3-0 ) @@ -250,33 +247,33 @@ (when s5-0 (cond ((= (-> s5-0 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 1.5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 6)) + (when (time-elapsed? (-> this attacker-time) (seconds 6)) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) (when s4-1 - (when (or (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.5)) + (when (or (time-elapsed? (-> this arrest-attempt-time) (seconds 0.5)) (focus-test? (the-as process-focusable s4-1) dead hit) ) (set! s4-1 (the-as process #f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this arrestor-handle) (the-as handle #f)) ) ) - (let ((v1-34 (-> obj focus-mode)) + (let ((v1-34 (-> this focus-mode)) (s3-1 (the-as process #f)) ) (cond @@ -288,11 +285,11 @@ (s5-0 (set! s3-1 s5-0) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else - (let ((s5-1 (handle->process (-> obj poi-handle)))) + (let ((s5-1 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-1 process-focusable) s5-1 ) @@ -314,7 +311,7 @@ (set! s3-1 s5-0) ) (else - (let ((s5-2 (handle->process (-> obj poi-handle)))) + (let ((s5-2 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-2 process-focusable) s5-2 ) @@ -324,7 +321,7 @@ (s3-1 (empty) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else @@ -337,14 +334,14 @@ ) (cond (s3-1 - (try-update-focus (-> obj focus) (the-as process-focusable s3-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s3-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s3-1 @@ -352,22 +349,22 @@ ) ) -(defmethod alive? kor ((obj kor)) +(defmethod alive? kor ((this kor)) (let ((t9-0 (method-of-type bot alive?))) - (and (t9-0 obj) - (not (and (-> obj next-state) (let ((v1-4 (-> obj next-state name))) - (or (= v1-4 'arrested) (= v1-4 'die) (= v1-4 'die-falling)) - ) + (and (t9-0 this) + (not (and (-> this next-state) (let ((v1-4 (-> this next-state name))) + (or (= v1-4 'arrested) (= v1-4 'die) (= v1-4 'die-falling)) + ) ) ) - (not (logtest? (bot-flags bf20) (-> obj bot-flags))) + (not (logtest? (bot-flags bf20) (-> this bot-flags))) ) ) ) -(defmethod init-enemy-collision! kor ((obj kor)) +(defmethod init-enemy-collision! kor ((this kor)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -432,40 +429,40 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 2)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init! kor ((obj kor)) +(defmethod init! kor ((this kor)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj min-speed) 6144.0) - (set! (-> obj max-speed) 20889.6) - (set! (-> obj channel) (the-as uint 27)) - (set! (-> obj notice-enemy-dist) 122880.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 0.0) - (set-vector! (-> obj root scale) 1.2 1.2 1.2 1.0) - (set! (-> obj spot-color) (the-as uint #x508f2f00)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this min-speed) 6144.0) + (set! (-> this max-speed) 20889.6) + (set! (-> this channel) (the-as uint 27)) + (set! (-> this notice-enemy-dist) 122880.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 0.0) + (set-vector! (-> this root scale) 1.2 1.2 1.2 1.0) + (set! (-> this spot-color) (the-as uint #x508f2f00)) + (set! (-> this arrestor-handle) (the-as handle #f)) 0 (none) ) -(defmethod init-enemy! kor ((obj kor)) +(defmethod init-enemy! kor ((this kor)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) + (init! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-kor" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *kor-nav-enemy-info*) - (let ((v1-7 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *kor-nav-enemy-info*) + (let ((v1-7 (-> this neck))) (set! (-> v1-7 up) (the-as uint 1)) (set! (-> v1-7 nose) (the-as uint 2)) (set! (-> v1-7 ear) (the-as uint 0)) @@ -473,102 +470,102 @@ (set! (-> v1-7 ignore-angle) 30947.555) ) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) 0 (none) ) -(defmethod bot-method-214 kor ((obj kor)) +(defmethod bot-method-214 kor ((this kor)) #f ) ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile kor ((obj kor)) - (kor-method-232 obj) +(defmethod go-hostile kor ((this kor)) + (kor-method-232 this) ) ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kor ((obj kor)) +(defmethod react-to-focus kor ((this kor)) "@TODO - flesh out docs" - (kor-method-232 obj) + (kor-method-232 this) ) ;; WARN: Return type mismatch object vs none. -(defmethod kor-method-233 kor ((obj kor)) - (go (method-of-object obj waiting-turn)) +(defmethod kor-method-233 kor ((this kor)) + (go (method-of-object this waiting-turn)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod kor-method-232 kor ((obj kor)) - (let ((s5-0 (handle->process (-> obj arrestor-handle)))) +(defmethod kor-method-232 kor ((this kor)) + (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) s5-0 ) - (go (method-of-object obj arrested)) + (go (method-of-object this arrested)) ) - ((logtest? (bot-flags bf19) (-> obj bot-flags)) - (go (method-of-object obj scared-idle)) + ((logtest? (bot-flags bf19) (-> this bot-flags)) + (go (method-of-object this scared-idle)) ) (else - (go (method-of-object obj waiting-idle)) + (go (method-of-object this waiting-idle)) ) ) ) (none) ) -(defmethod kor-method-234 kor ((obj kor)) +(defmethod kor-method-234 kor ((this kor)) (with-pp - (let ((f30-0 (-> obj nav state speed))) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 6144.0 20889.6))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-7 (= v1-7 (-> obj draw art-group data 5))) - (let ((v1-12 (-> obj skel root-channel 1))) + ((and v1-7 (= v1-7 (-> this draw art-group data 5))) + (let ((v1-12 (-> this skel root-channel 1))) (set! (-> v1-12 frame-interp 1) f28-0) (set! (-> v1-12 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f0-7 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f0-7 (deg- f0-5 (-> this travel-prev-ry))) (f0-10 (fmin 20889.6 (* 0.35342914 (-> pp clock frames-per-second) (fabs f0-7)))) (f0-13 (/ (* 24.0 (fmax f30-0 f0-10)) (* 15.0 f28-1))) - (a0-10 (-> obj skel root-channel 0)) + (a0-10 (-> this skel root-channel 0)) ) (set! (-> a0-10 param 0) f0-13) (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-11 (-> obj skel root-channel 1))) + (let ((a0-11 (-> this skel root-channel 1))) (set! (-> a0-11 param 0) 0.0) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.3)) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 dist) 9830.4) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 5))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) (set! (-> a0-13 param 0) 1.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 5)) num-func-loop!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-loop!) ) - (let ((a0-14 (-> obj skel root-channel 1))) + (let ((a0-14 (-> this skel root-channel 1))) (set! (-> a0-14 frame-interp 1) f28-0) (set! (-> a0-14 frame-interp 0) f28-0) (set! (-> a0-14 dist) 19660.8) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-chan) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 6)) num-func-chan) ) ) ) @@ -578,19 +575,19 @@ ) ) -(defmethod damage-amount-from-attack kor ((obj kor) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack kor ((this kor) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) -(defmethod bot-method-190 kor ((obj kor)) +(defmethod bot-method-190 kor ((this kor)) #t ) -(defmethod enemy-method-78 kor ((obj kor) (arg0 (pointer float))) +(defmethod enemy-method-78 kor ((this kor) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -602,47 +599,47 @@ ) ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kor ((obj kor) (arg0 vector)) +(defmethod set-cam-height! kor ((this kor) (arg0 vector)) (the-as meters (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'arrested)) + ((and (-> this next-state) (= (-> this next-state name) 'arrested)) (set-vector! arg0 49152.0 12288.0 49152.0 1.0) - (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) - (if (focus-test? obj under-water) - (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) ) ) (else - ((method-of-type bot set-cam-height!) obj arg0) + ((method-of-type bot set-cam-height!) this arg0) ) ) ) ) -(defmethod enemy-method-102 kor ((obj kor)) - (if (logtest? (bot-flags bf20) (-> obj bot-flags)) +(defmethod enemy-method-102 kor ((this kor)) + (if (logtest? (bot-flags bf20) (-> this bot-flags)) #f - ((method-of-type bot enemy-method-102) obj) + ((method-of-type bot enemy-method-102) this) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kor ((obj kor)) +(defmethod go-idle kor ((this kor)) (cond - ((= (-> obj course course-id) 8) + ((= (-> this course course-id) 8) (cond ((task-node-closed? (game-task-node city-help-kid-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj waiting-with-kid)) + (go (method-of-object this waiting-with-kid)) ) ) ) (else - (go (method-of-object obj waiting-idle)) + (go (method-of-object this waiting-idle)) ) ) (none) diff --git a/goal_src/jak2/levels/city/slums/neon-baron-part.gc b/goal_src/jak2/levels/city/slums/neon-baron-part.gc index 782dc3ae7e..b45037d126 100644 --- a/goal_src/jak2/levels/city/slums/neon-baron-part.gc +++ b/goal_src/jak2/levels/city/slums/neon-baron-part.gc @@ -3180,40 +3180,40 @@ ) -(defmethod deactivate neon-baron ((obj neon-baron)) +(defmethod deactivate neon-baron ((this neon-baron)) (dotimes (s5-0 1) - (let ((a0-1 (-> obj parts s5-0))) + (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; WARN: Return type mismatch process vs neon-baron. -(defmethod relocate neon-baron ((obj neon-baron) (arg0 int)) +(defmethod relocate neon-baron ((this neon-baron) (arg0 int)) (dotimes (v1-0 1) - (if (nonzero? (-> obj parts v1-0)) - (&+! (-> obj parts v1-0) arg0) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) arg0) ) ) - (the-as neon-baron ((method-of-type process relocate) obj arg0)) + (the-as neon-baron ((method-of-type process relocate) this arg0)) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-parts neon-baron ((obj neon-baron)) - (+! (-> obj parts 0 state-counter) 1) - (when (!= (-> obj parts 0 state-mode 0) (-> obj flags)) - (set! (-> obj parts 0 state-mode 0) (the-as uint (-> obj flags))) - (set! (-> obj parts 0 state-counter) (the-as uint 0)) +(defmethod spawn-parts neon-baron ((this neon-baron)) + (+! (-> this parts 0 state-counter) 1) + (when (!= (-> this parts 0 state-mode 0) (-> this flags)) + (set! (-> this parts 0 state-mode 0) (the-as uint (-> this flags))) + (set! (-> this parts 0 state-counter) (the-as uint 0)) 0 ) - (let ((s5-0 (-> obj master-enable))) + (let ((s5-0 (-> this master-enable))) (dotimes (s4-0 1) (if (logtest? s5-0 1) - (spawn-with-matrix (-> obj parts s4-0) (-> obj mat)) + (spawn-with-matrix (-> this parts s4-0) (-> this mat)) ) (set! s5-0 (/ s5-0 2)) ) @@ -3221,8 +3221,8 @@ (none) ) -(defmethod update-mode neon-baron ((obj neon-baron)) - (set! (-> obj mode) (rand-vu-int-count-excluding 12 (ash 1 (-> obj mode)))) +(defmethod update-mode neon-baron ((this neon-baron)) + (set! (-> this mode) (rand-vu-int-count-excluding 12 (ash 1 (-> this mode)))) (none) ) @@ -3284,16 +3284,16 @@ 600 (dotimes (gp-0 19) (let ((s5-0 (-> *neon-baron-flashing-acc* (* gp-0 2)))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 8) - (until (>= (- (current-time) (-> self state-time)) (the-as time-frame s5-0)) + (until (time-elapsed? (-> self state-time) (the-as time-frame s5-0)) (suspend) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 9) (let ((s5-1 (-> *neon-baron-flashing-acc* (+ (* gp-0 2) 1)))) - (until (>= (- (current-time) (-> self state-time)) (the-as time-frame s5-1)) + (until (time-elapsed? (-> self state-time) (the-as time-frame s5-1)) (suspend) ) ) @@ -3301,28 +3301,28 @@ ) ((zero? v1-2) (dotimes (gp-1 3) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 8) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 9) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) ) ((= v1-2 1) (dotimes (gp-2 3) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 8) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 9) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) ) @@ -3331,16 +3331,16 @@ 600 (dotimes (gp-3 19) (let ((s5-2 (-> *neon-baron-flashing-acc* (* gp-3 2)))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 3) - (until (>= (- (current-time) (-> self state-time)) (the-as time-frame s5-2)) + (until (time-elapsed? (-> self state-time) (the-as time-frame s5-2)) (suspend) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 2) (let ((s5-3 (-> *neon-baron-flashing-acc* (+ (* gp-3 2) 1)))) - (until (>= (- (current-time) (-> self state-time)) (the-as time-frame s5-3)) + (until (time-elapsed? (-> self state-time) (the-as time-frame s5-3)) (suspend) ) ) @@ -3348,28 +3348,28 @@ ) ((= v1-2 8) (dotimes (gp-4 3) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 3) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 2) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) ) ((= v1-2 9) (dotimes (gp-5 3) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 3) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 2) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) ) @@ -3453,8 +3453,8 @@ (set! (-> self flags) 1) (let ((gp-11 (rand-vu-int-range 3 6))) (dotimes (s5-9 gp-11) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) @@ -3468,26 +3468,26 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! neon-baron ((obj neon-baron) (arg0 entity-actor)) +(defmethod init-from-entity! neon-baron ((this neon-baron) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (matrix-rotate-y! (-> obj mat) (quaternion-y-angle (-> arg0 quat))) - (set! (-> obj mat trans quad) (-> arg0 extra trans quad)) - (set! (-> obj master-enable) -1) - (set! (-> obj flags) 9) - (set! (-> obj mode) 0) - (set! (-> obj sign) *baron-neon-skull*) + (matrix-rotate-y! (-> this mat) (quaternion-y-angle (-> arg0 quat))) + (set! (-> this mat trans quad) (-> arg0 extra trans quad)) + (set! (-> this master-enable) -1) + (set! (-> this flags) 9) + (set! (-> this mode) 0) + (set! (-> this sign) *baron-neon-skull*) (let ((s5-1 *city-baron-group-ids*)) (dotimes (s4-1 1) - (set! (-> obj parts s4-1) (create-launch-control (-> *part-group-id-table* (-> s5-1 s4-1)) obj)) + (set! (-> this parts s4-1) (create-launch-control (-> *part-group-id-table* (-> s5-1 s4-1)) this)) ) ) - (update-mode obj) - (go (method-of-object obj idle)) + (update-mode this) + (go (method-of-object this idle)) (none) ) @@ -3506,15 +3506,16 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-door-a ((obj hide-door-a) (arg0 entity-actor)) +(defmethod init-from-entity! hide-door-a ((this hide-door-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 1024) ;; added - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + ;; og:preserve-this added + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) (set! (-> s5-0 total-prims) (the-as uint 2)) @@ -3537,19 +3538,19 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hide-door-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "hide-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "hide-door-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "hide-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "hide-door-hit")) - (set! (-> obj door-radius) 12288.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "hide-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "hide-door-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "hide-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "hide-door-hit")) + (set! (-> this door-radius) 12288.0) + (go (method-of-object this close) #t) (none) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc index 2b5f74cb94..baf1d3a93a 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-chick.gc @@ -219,20 +219,20 @@ (set! (-> *citizen-chick-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod get-inv-mass citizen-chick ((obj citizen-chick)) +(defmethod get-inv-mass citizen-chick ((this citizen-chick)) 0.5 ) -(defmethod enemy-method-51 citizen-chick ((obj citizen-chick)) - (let ((f30-0 (quaternion-y-angle (-> obj root quat)))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-51 citizen-chick ((this citizen-chick)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (let ((a0-5 (handle->process (-> obj focus handle)))) + (let ((a0-5 (handle->process (-> this focus handle)))) (when a0-5 (get-trans (the-as process-focusable a0-5) 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root transv quad)) - (if (< (vector-dot (-> obj root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) (vector-negate-in-place! s5-0) @@ -244,14 +244,14 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> obj root transv quad)) - (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) 0.0) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) (f1-2 (deg- f30-0 f28-0)) (f2-0 (fabs f1-2)) - (f0-8 (-> obj enemy-info knocked-seek-ry-clamp)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) ) (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) (set! f30-0 (+ (cond @@ -283,26 +283,26 @@ ) ) -(defmethod enemy-method-79 citizen-chick ((obj citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 citizen-chick ((this citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let ((s5-0 (ja-done? 0))) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) ) (when s5-0 (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-6 (-> obj skel root-channel 0))) + (let ((a0-6 (-> this skel root-channel 0))) (set! (-> a0-6 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) ) (set! (-> a0-6 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) frames num-frames ) @@ -314,7 +314,7 @@ (set! (-> a0-6 frame-num) 3.0) (joint-control-channel-group! a0-6 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) num-func-seek! ) ) @@ -323,28 +323,28 @@ ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) -(defmethod enemy-method-77 citizen-chick ((obj citizen-chick) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 citizen-chick ((this citizen-chick) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.01)) - (let* ((a2-0 (ash 1 (-> obj info prev-yellow-hit))) - (v1-3 (enemy-method-120 obj 1 a2-0)) + (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) + (v1-3 (enemy-method-120 this 1 a2-0)) (a1-7 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-3 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-3 8)) (the-as uint (-> this info)))) yellow-hit-anim 0 anim-index-front @@ -352,8 +352,8 @@ ) ) ) - (set! (-> obj info prev-yellow-hit) v1-3) - (let ((a0-15 (-> obj skel root-channel 0))) + (set! (-> this info prev-yellow-hit) v1-3) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) (set! (-> a0-15 param 1) (-> arg0 0)) @@ -364,14 +364,14 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let* ((a2-2 (ash 1 (-> obj info prev-blue-hit))) - (v1-12 (enemy-method-120 obj 3 a2-2)) + (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) + (v1-12 (enemy-method-120 this 3 a2-2)) (a1-14 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-12 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-12 8)) (the-as uint (-> this info)))) blue-hit-anim 0 anim-index-front @@ -379,8 +379,8 @@ ) ) ) - (set! (-> obj info prev-blue-hit) v1-12) - (let ((a0-30 (-> obj skel root-channel 0))) + (set! (-> this info prev-blue-hit) v1-12) + (let ((a0-30 (-> this skel root-channel 0))) (set! (-> a0-30 frame-group) (the-as art-joint-anim a1-14)) (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim a1-14) frames num-frames) -1))) (set! (-> a0-30 param 1) 1.0) @@ -390,14 +390,14 @@ ) ) (else - (let ((s4-0 (if (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) ) ) ) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-39 (-> obj skel root-channel 0))) + (let ((a0-39 (-> this skel root-channel 0))) (set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-39 param 1) (-> arg0 0)) @@ -410,15 +410,15 @@ #t ) -(defmethod enemy-method-78 citizen-chick ((obj citizen-chick) (arg0 (pointer float))) +(defmethod enemy-method-78 citizen-chick ((this citizen-chick) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) ) (set! (-> a0-2 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) frames num-frames ) @@ -430,7 +430,7 @@ (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) num-func-seek! ) ) @@ -510,9 +510,9 @@ ) ) -(defmethod init-enemy-collision! citizen-chick ((obj citizen-chick)) +(defmethod init-enemy-collision! citizen-chick ((this citizen-chick)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -562,180 +562,180 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! citizen-chick ((obj citizen-chick)) +(defmethod init-enemy! citizen-chick ((this citizen-chick)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-chick" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *citizen-chick-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *citizen-chick-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 204800.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (set! (-> obj info) *citizen-chick-global-info*) - (try-update-focus (-> obj focus) *target* obj) - (set-vector! (-> obj neck twist-max) 10922.667 18204.445 0.0 1.0) - (set! (-> obj anim-shuffle) 26) - (let ((v1-18 (get-rand-int obj 3))) + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this info) *citizen-chick-global-info*) + (try-update-focus (-> this focus) *target* this) + (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) + (set! (-> this anim-shuffle) 26) + (let ((v1-18 (get-rand-int this 3))) (cond ((zero? v1-18) - (set! (-> obj anim-walk) 4) - (set! (-> obj dist-walk-anim) 15728.64) - (set! (-> obj speed-walk) 14745.6) + (set! (-> this anim-walk) 4) + (set! (-> this dist-walk-anim) 15728.64) + (set! (-> this speed-walk) 14745.6) ) ((= v1-18 1) - (set! (-> obj anim-walk) 5) - (set! (-> obj dist-walk-anim) 8736.768) - (set! (-> obj speed-walk) 8192.0) + (set! (-> this anim-walk) 5) + (set! (-> this dist-walk-anim) 8736.768) + (set! (-> this speed-walk) 8192.0) ) ((= v1-18 2) - (set! (-> obj anim-walk) 6) - (set! (-> obj dist-walk-anim) 15728.64) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 6) + (set! (-> this dist-walk-anim) 15728.64) + (set! (-> this speed-walk) 12288.0) ) ) ) - (let ((v1-33 (get-rand-int obj 3))) + (let ((v1-33 (get-rand-int this 3))) (cond ((zero? v1-33) - (set! (-> obj anim-panic-run) 11) + (set! (-> this anim-panic-run) 11) ) ((= v1-33 1) - (set! (-> obj anim-panic-run) 11) + (set! (-> this anim-panic-run) 11) ) ((= v1-33 2) - (set! (-> obj anim-panic-run) 7) + (set! (-> this anim-panic-run) 7) ) ) ) - (let ((v1-39 (get-rand-int obj 3))) + (let ((v1-39 (get-rand-int this 3))) (cond ((zero? v1-39) - (set! (-> obj dist-run-anim) 26214.4) - (set! (-> obj anim-run) 7) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 7) ) ((= v1-39 1) - (set! (-> obj dist-run-anim) 28385.28) - (set! (-> obj anim-run) 8) + (set! (-> this dist-run-anim) 28385.28) + (set! (-> this anim-run) 8) ) ((= v1-39 2) - (set! (-> obj dist-run-anim) 26214.4) - (set! (-> obj anim-run) 9) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 9) ) ) ) - (set! (-> obj speed-run) 49152.0) - (set! (-> obj anim-on-ground) 13) - (set! (-> obj anim-dive) 17) - (set! (-> obj anim-get-up-back) 25) - (set! (-> obj anim-get-up-front) 24) - (let ((f30-0 (get-rand-float-range obj 1.0 1.25)) - (f0-17 (get-rand-float-range obj 1.0 1.25)) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-on-ground) 13) + (set! (-> this anim-dive) 17) + (set! (-> this anim-get-up-back) 25) + (set! (-> this anim-get-up-front) 24) + (let ((f30-0 (get-rand-float-range this 1.0 1.25)) + (f0-17 (get-rand-float-range this 1.0 1.25)) ) - (set-vector! (-> obj root scale) f0-17 f30-0 f0-17 1.0) + (set-vector! (-> this root scale) f0-17 f30-0 f0-17 1.0) ) - (let ((f0-19 (get-rand-float-range obj 0.9 1.0))) - (set-vector! (-> obj draw color-mult) f0-19 f0-19 f0-19 1.0) + (let ((f0-19 (get-rand-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-19 f0-19 f0-19 1.0) ) - (set! (-> obj water-anim) 12) - (logior! (-> obj flags) (citizen-flag female)) + (set! (-> this water-anim) 12) + (logior! (-> this flags) (citizen-flag female)) 0 (none) ) -(defmethod citizen-init! citizen-chick ((obj citizen-chick)) +(defmethod citizen-init! citizen-chick ((this citizen-chick)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj dive-reaction) (* 0.2 (rand-vu))) - (logclear! (-> obj mask) (process-mask enemy)) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 16 0) - (setup-masks (-> obj draw) 8 0) - (let ((v1-11 (get-rand-int obj 3))) + (set! (-> this dive-reaction) (* 0.2 (rand-vu))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 8 0) + (let ((v1-11 (get-rand-int this 3))) (cond ((zero? v1-11) - (setup-masks (-> obj draw) 32 0) + (setup-masks (-> this draw) 32 0) ) ((= v1-11 1) - (setup-masks (-> obj draw) #x4000 0) + (setup-masks (-> this draw) #x4000 0) ) ((= v1-11 2) - (setup-masks (-> obj draw) #x8000 0) + (setup-masks (-> this draw) #x8000 0) ) ) ) - (let ((v1-20 (get-rand-int obj 3))) + (let ((v1-20 (get-rand-int this 3))) (cond ((zero? v1-20) - (setup-masks (-> obj draw) 64 0) + (setup-masks (-> this draw) 64 0) ) ((= v1-20 1) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) ((= v1-20 2) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ) ) - (let ((v1-29 (get-rand-int obj 3))) + (let ((v1-29 (get-rand-int this 3))) (cond ((zero? v1-29) - (setup-masks (-> obj draw) 4 0) + (setup-masks (-> this draw) 4 0) ) ((= v1-29 1) - (setup-masks (-> obj draw) 512 0) + (setup-masks (-> this draw) 512 0) ) ((= v1-29 2) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ) ) - (let ((v1-38 (get-rand-int obj 3))) + (let ((v1-38 (get-rand-int this 3))) (cond ((zero? v1-38) - (setup-masks (-> obj draw) 2 0) - (let ((v1-42 (get-rand-int obj 2))) + (setup-masks (-> this draw) 2 0) + (let ((v1-42 (get-rand-int this 2))) (cond ((zero? v1-42) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-42 1) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ) ) ) ((= v1-38 1) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ((= v1-38 2) - (setup-masks (-> obj draw) 2048 0) - (let ((v1-54 (get-rand-int obj 2))) + (setup-masks (-> this draw) 2048 0) + (let ((v1-54 (get-rand-int this 2))) (cond ((zero? v1-54) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-54 1) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ) ) ) ) ) - (logior! (-> obj flags) (citizen-flag female)) + (logior! (-> this flags) (citizen-flag female)) 0 (none) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc index 17b12bf47e..52d02cd4b1 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-enemy.gc @@ -22,41 +22,41 @@ ) -(defmethod track-target! citizen-enemy ((obj citizen-enemy)) +(defmethod track-target! citizen-enemy ((this citizen-enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-0 options) (overlaps-others-options)) - (set! (-> a1-0 collide-with-filter) (-> obj enemy-info overlaps-others-collide-with-filter)) + (set! (-> a1-0 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) (set! (-> a1-0 tlist) *touching-list*) - (find-overlapping-shapes (-> obj root) a1-0) + (find-overlapping-shapes (-> this root) a1-0) ) - (when (and (not (focus-test? obj disable dead ignore inactive)) - (< (-> obj next-update-target) (current-time)) - (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (-> obj next-state) - (= (-> obj next-state name) 'active) + (when (and (not (focus-test? this disable dead ignore inactive)) + (< (-> this next-update-target) (current-time)) + (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) + (-> this next-state) + (= (-> this next-state name) 'active) ) - (citizen-enemy-method-202 obj) - (set! (-> obj next-update-target) (+ (current-time) (seconds 0.2))) - (traffic-danger-init! obj) + (citizen-enemy-method-202 this) + (set! (-> this next-update-target) (+ (current-time) (seconds 0.2))) + (traffic-danger-init! this) ) - ((method-of-type citizen track-target!) obj) + ((method-of-type citizen track-target!) this) (none) ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 citizen-enemy ((obj citizen-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 citizen-enemy ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond - ((and (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'knocked) (= v1-3 'jump)) - ) + ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) ) - ((method-of-type citizen enemy-method-76) obj arg0 arg1) + ((method-of-type citizen enemy-method-76) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -68,30 +68,30 @@ ) ) (cond - ((and (focus-test? obj dangerous) + ((and (focus-test? this dangerous) (logtest? (process-mask guard civilian) (-> arg0 mask)) (and v1-6 (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) ) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s3-0) - (-> obj root) + (-> this root) (collide-action deadly) (collide-action) ) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s3-0) - (-> obj root) + (-> this root) (collide-action persistent-attack) (collide-action) ) - (-> obj persistent-attack-id) - (-> obj attack-id) + (-> this persistent-attack-id) + (-> this attack-id) ) ) ) - (enemy-method-104 obj arg0 (the-as touching-shapes-entry s3-0) a3-2) + (enemy-method-104 this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -105,7 +105,7 @@ ) ) -(defmethod general-event-handler citizen-enemy ((obj citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler citizen-enemy ((this citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -116,11 +116,11 @@ (case (-> arg3 param 0) (('death-default) (cond - ((> (-> obj hit-points) 0) + ((> (-> this hit-points) 0) #t ) (else - (let ((v1-4 (-> obj root root-prim))) + (let ((v1-4 (-> this root root-prim))) (set! (-> v1-4 prim-core collide-as) (collide-spec)) (set! (-> v1-4 prim-core collide-with) (collide-spec)) ) @@ -135,37 +135,37 @@ ) ) (('end-task) - (let ((v0-0 (the-as object (logclear (-> obj flags) (citizen-flag persistent))))) - (set! (-> obj flags) (the-as citizen-flag v0-0)) + (let ((v0-0 (the-as object (logclear (-> this flags) (citizen-flag persistent))))) + (set! (-> this flags) (the-as citizen-flag v0-0)) v0-0 ) ) (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod traffic-danger-init! citizen-enemy ((obj citizen-enemy)) +(defmethod traffic-danger-init! citizen-enemy ((this citizen-enemy)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) - (set! (-> a1-0 sphere quad) (-> obj root trans quad)) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> obj root transv quad)) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) (set! (-> a1-0 decay-rate) 0.0) (set! (-> a1-0 flags) (traffic-danger-flags tdf0)) (set! (-> a1-0 danger-type) (traffic-danger-type tdt7)) - (set! (-> a1-0 handle) (process->handle obj)) - (add-danger (-> obj controller traffic) a1-0) + (set! (-> a1-0 handle) (process->handle this)) + (add-danger (-> this controller traffic) a1-0) ) 0 (none) ) -(defmethod citizen-enemy-method-202 citizen-enemy ((obj citizen-enemy)) +(defmethod citizen-enemy-method-202 citizen-enemy ((this citizen-enemy)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root trans quad)) + (set! (-> s5-0 quad) (-> this root trans quad)) (set! (-> s5-0 w) 122880.0) (let ((s4-0 (the-as process-drawable #f))) (let ((f30-0 122880.0)) @@ -185,7 +185,7 @@ ) ) (when (and s1-1 - (!= obj s1-1) + (!= this s1-1) (not (focus-test? (the-as process-focusable s1-1) inactive)) (not (focus-test? (the-as process-focusable s1-1) disable)) (not (logtest? (process-mask enemy) (-> s1-1 mask))) @@ -194,7 +194,7 @@ s1-1 (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) ) - (let ((f0-1 (vector-vector-xz-distance (-> obj root trans) (-> s1-1 root trans)))) + (let ((f0-1 (vector-vector-xz-distance (-> this root trans) (-> s1-1 root trans)))) (when (or (not s4-0) (< f0-1 f30-0)) (set! s4-0 s1-1) (set! f30-0 f0-1) @@ -211,8 +211,8 @@ ) ) (when s4-0 - (try-update-focus (-> obj focus) (the-as process-focusable s4-0) obj) - (go-hostile obj) + (try-update-focus (-> this focus) (the-as process-focusable s4-0) this) + (go-hostile this) ) ) ) @@ -255,54 +255,54 @@ ) ) -(defmethod citizen-init! citizen-enemy ((obj citizen-enemy)) +(defmethod citizen-init! citizen-enemy ((this citizen-enemy)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (if (-> obj skel effect) - (logior! (-> obj skel effect flags) (effect-control-flag ecf0)) + (if (-> this skel effect) + (logior! (-> this skel effect flags) (effect-control-flag ecf0)) ) - (logior! (-> obj mask) (process-mask enemy)) - (reset-to-collide-spec (-> obj focus) (collide-spec jak civilian player-list bot-targetable jak-vehicle)) - (let ((v1-12 (-> obj nav))) + (logior! (-> this mask) (process-mask enemy)) + (reset-to-collide-spec (-> this focus) (collide-spec jak civilian player-list bot-targetable jak-vehicle)) + (let ((v1-12 (-> this nav))) (set! (-> v1-12 sphere-mask) (the-as uint #x800e8)) ) 0 - (set! (-> obj anim-shuffle) (-> obj enemy-info walk-anim)) - (set! (-> obj anim-walk) (-> obj enemy-info walk-anim)) - (set! (-> obj speed-walk) (-> obj enemy-info walk-travel-speed)) - (set! (-> obj dist-walk-anim) (-> obj enemy-info walk-travel-speed)) - (set! (-> obj anim-run) (-> obj enemy-info run-anim)) - (set! (-> obj dist-run-anim) (-> obj enemy-info run-travel-speed)) - (set! (-> obj speed-run) (-> obj enemy-info walk-travel-speed)) - (set! (-> obj fated-time) 0) - (logior! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logior! (-> obj enemy-flags) (enemy-flag check-water)) - (logior! (-> obj enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) - (logclear! (-> obj focus-status) (focus-status dead)) - (logior! (-> obj mask) (process-mask collectable)) - (logior! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (if (not (-> obj minimap)) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this anim-shuffle) (-> this enemy-info walk-anim)) + (set! (-> this anim-walk) (-> this enemy-info walk-anim)) + (set! (-> this speed-walk) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-walk-anim) (-> this enemy-info walk-travel-speed)) + (set! (-> this anim-run) (-> this enemy-info run-anim)) + (set! (-> this dist-run-anim) (-> this enemy-info run-travel-speed)) + (set! (-> this speed-run) (-> this enemy-info walk-travel-speed)) + (set! (-> this fated-time) 0) + (logior! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag check-water)) + (logior! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) + (logclear! (-> this focus-status) (focus-status dead)) + (logior! (-> this mask) (process-mask collectable)) + (logior! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) ) (ja-channel-set! 0) 0 (none) ) -(defmethod kill-prefer-falling citizen-enemy ((obj citizen-enemy)) +(defmethod kill-prefer-falling citizen-enemy ((this citizen-enemy)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - ((method-of-type nav-enemy kill-prefer-falling) obj) + ((method-of-type nav-enemy kill-prefer-falling) this) ) -(defmethod go-hostile citizen-enemy ((obj citizen-enemy)) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'hostile))) - (go (method-of-object obj hostile)) +(defmethod go-hostile citizen-enemy ((this citizen-enemy)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (go (method-of-object this hostile)) ) ) -(defmethod go-stare citizen-enemy ((obj citizen-enemy)) - (go (method-of-object obj active)) +(defmethod go-stare citizen-enemy ((this citizen-enemy)) + (go (method-of-object this active)) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc index 82006a0193..06d1f6e904 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-fat.gc @@ -219,20 +219,20 @@ (set! (-> *citizen-fat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod get-inv-mass citizen-fat ((obj citizen-fat)) +(defmethod get-inv-mass citizen-fat ((this citizen-fat)) 0.5 ) -(defmethod enemy-method-51 citizen-fat ((obj citizen-fat)) - (let ((f30-0 (quaternion-y-angle (-> obj root quat)))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-51 citizen-fat ((this citizen-fat)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (let ((a0-5 (handle->process (-> obj focus handle)))) + (let ((a0-5 (handle->process (-> this focus handle)))) (when a0-5 (get-trans (the-as process-focusable a0-5) 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root transv quad)) - (if (< (vector-dot (-> obj root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) (vector-negate-in-place! s5-0) @@ -244,14 +244,14 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> obj root transv quad)) - (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) 0.0) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) (f1-2 (deg- f30-0 f28-0)) (f2-0 (fabs f1-2)) - (f0-8 (-> obj enemy-info knocked-seek-ry-clamp)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) ) (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) (set! f30-0 (+ (cond @@ -283,26 +283,26 @@ ) ) -(defmethod enemy-method-79 citizen-fat ((obj citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 citizen-fat ((this citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let ((s5-0 (ja-done? 0))) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) ) (when s5-0 (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-6 (-> obj skel root-channel 0))) + (let ((a0-6 (-> this skel root-channel 0))) (set! (-> a0-6 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) ) (set! (-> a0-6 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) frames num-frames ) @@ -314,7 +314,7 @@ (set! (-> a0-6 frame-num) 3.0) (joint-control-channel-group! a0-6 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) num-func-seek! ) ) @@ -323,28 +323,28 @@ ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) -(defmethod enemy-method-77 citizen-fat ((obj citizen-fat) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 citizen-fat ((this citizen-fat) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.01)) - (let* ((a2-0 (ash 1 (-> obj info prev-yellow-hit))) - (v1-3 (enemy-method-120 obj 1 a2-0)) + (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) + (v1-3 (enemy-method-120 this 1 a2-0)) (a1-7 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-3 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-3 8)) (the-as uint (-> this info)))) yellow-hit-anim 0 anim-index-front @@ -352,8 +352,8 @@ ) ) ) - (set! (-> obj info prev-yellow-hit) v1-3) - (let ((a0-15 (-> obj skel root-channel 0))) + (set! (-> this info prev-yellow-hit) v1-3) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) (set! (-> a0-15 param 1) (-> arg0 0)) @@ -364,14 +364,14 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let* ((a2-2 (ash 1 (-> obj info prev-blue-hit))) - (v1-12 (enemy-method-120 obj 3 a2-2)) + (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) + (v1-12 (enemy-method-120 this 3 a2-2)) (a1-14 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-12 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-12 8)) (the-as uint (-> this info)))) blue-hit-anim 0 anim-index-front @@ -379,8 +379,8 @@ ) ) ) - (set! (-> obj info prev-blue-hit) v1-12) - (let ((a0-30 (-> obj skel root-channel 0))) + (set! (-> this info prev-blue-hit) v1-12) + (let ((a0-30 (-> this skel root-channel 0))) (set! (-> a0-30 frame-group) (the-as art-joint-anim a1-14)) (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim a1-14) frames num-frames) -1))) (set! (-> a0-30 param 1) 1.0) @@ -390,14 +390,14 @@ ) ) (else - (let ((s4-0 (if (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) ) ) ) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-39 (-> obj skel root-channel 0))) + (let ((a0-39 (-> this skel root-channel 0))) (set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-39 param 1) (-> arg0 0)) @@ -410,15 +410,15 @@ #t ) -(defmethod enemy-method-78 citizen-fat ((obj citizen-fat) (arg0 (pointer float))) +(defmethod enemy-method-78 citizen-fat ((this citizen-fat) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) ) (set! (-> a0-2 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) frames num-frames ) @@ -430,7 +430,7 @@ (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) num-func-seek! ) ) @@ -547,9 +547,9 @@ ) ) -(defmethod init-enemy-collision! citizen-fat ((obj citizen-fat)) +(defmethod init-enemy-collision! citizen-fat ((this citizen-fat)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -599,222 +599,222 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! citizen-fat ((obj citizen-fat)) +(defmethod init-enemy! citizen-fat ((this citizen-fat)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-fat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *citizen-fat-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *citizen-fat-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 204800.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (set! (-> obj info) *citizen-fat-global-info*) - (try-update-focus (-> obj focus) *target* obj) - (set-vector! (-> obj neck twist-max) 10922.667 18204.445 0.0 1.0) - (set! (-> obj anim-shuffle) 12) - (let ((v1-18 (get-rand-int obj 3))) + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this info) *citizen-fat-global-info*) + (try-update-focus (-> this focus) *target* this) + (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) + (set! (-> this anim-shuffle) 12) + (let ((v1-18 (get-rand-int this 3))) (cond ((zero? v1-18) - (set! (-> obj anim-walk) 11) - (set! (-> obj dist-walk-anim) 16384.0) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) ) ((= v1-18 1) - (set! (-> obj anim-walk) 13) - (set! (-> obj dist-walk-anim) 16384.0) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) ) ((= v1-18 2) - (set! (-> obj anim-walk) 14) - (set! (-> obj dist-walk-anim) 16384.0) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 14) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) ) ) ) - (let ((v1-33 (get-rand-int obj 3))) + (let ((v1-33 (get-rand-int this 3))) (cond ((zero? v1-33) - (set! (-> obj anim-panic-run) 17) + (set! (-> this anim-panic-run) 17) ) ((= v1-33 1) - (set! (-> obj anim-panic-run) 17) + (set! (-> this anim-panic-run) 17) ) ((= v1-33 2) - (set! (-> obj anim-panic-run) 15) + (set! (-> this anim-panic-run) 15) ) ) ) - (set! (-> obj dist-run-anim) 20480.0) - (let ((v1-40 (get-rand-int obj 3))) + (set! (-> this dist-run-anim) 20480.0) + (let ((v1-40 (get-rand-int this 3))) (cond ((zero? v1-40) - (set! (-> obj anim-run) 15) + (set! (-> this anim-run) 15) ) ((= v1-40 1) - (set! (-> obj anim-run) 16) + (set! (-> this anim-run) 16) ) ((= v1-40 2) - (set! (-> obj anim-run) 16) + (set! (-> this anim-run) 16) ) ) ) - (set! (-> obj speed-run) 32768.0) - (set! (-> obj anim-on-ground) 19) - (set! (-> obj anim-dive) 18) - (set! (-> obj anim-get-up-back) 25) - (set! (-> obj anim-get-up-front) 24) - (let ((f30-0 (get-rand-float-range obj 1.0 1.25)) - (f0-15 (get-rand-float-range obj 1.0 1.25)) + (set! (-> this speed-run) 32768.0) + (set! (-> this anim-on-ground) 19) + (set! (-> this anim-dive) 18) + (set! (-> this anim-get-up-back) 25) + (set! (-> this anim-get-up-front) 24) + (let ((f30-0 (get-rand-float-range this 1.0 1.25)) + (f0-15 (get-rand-float-range this 1.0 1.25)) ) - (set-vector! (-> obj root scale) f0-15 f30-0 f0-15 1.0) + (set-vector! (-> this root scale) f0-15 f30-0 f0-15 1.0) ) - (let ((f0-17 (get-rand-float-range obj 0.9 1.0))) - (set-vector! (-> obj draw color-mult) f0-17 f0-17 f0-17 1.0) + (let ((f0-17 (get-rand-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-17 f0-17 f0-17 1.0) ) - (set! (-> obj water-anim) 32) + (set! (-> this water-anim) 32) 0 (none) ) -(defmethod citizen-init! citizen-fat ((obj citizen-fat)) +(defmethod citizen-init! citizen-fat ((this citizen-fat)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj dive-reaction) (* 0.2 (rand-vu))) - (logclear! (-> obj mask) (process-mask enemy)) - (setup-masks (-> obj draw) 0 -1) - (let ((v1-7 (get-rand-int obj 2))) + (set! (-> this dive-reaction) (* 0.2 (rand-vu))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (let ((v1-7 (get-rand-int this 2))) (cond ((zero? v1-7) - (setup-masks (-> obj draw) 8 0) - (let ((v1-11 (get-rand-int obj 3))) + (setup-masks (-> this draw) 8 0) + (let ((v1-11 (get-rand-int this 3))) (cond ((zero? v1-11) - (setup-masks (-> obj draw) 4 0) + (setup-masks (-> this draw) 4 0) ) ((= v1-11 1) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ((= v1-11 2) - (setup-masks (-> obj draw) #x8000 0) + (setup-masks (-> this draw) #x8000 0) ) ) ) - (let ((v1-20 (get-rand-int obj 4))) + (let ((v1-20 (get-rand-int this 4))) (cond ((zero? v1-20) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) ((= v1-20 1) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-20 2) - (setup-masks (-> obj draw) 130 0) + (setup-masks (-> this draw) 130 0) ) ) ) - (setup-masks (-> obj draw) 512 0) - (let ((v1-31 (get-rand-int obj 3))) + (setup-masks (-> this draw) 512 0) + (let ((v1-31 (get-rand-int this 3))) (cond ((zero? v1-31) - (setup-masks (-> obj draw) 64 0) + (setup-masks (-> this draw) 64 0) ) ((= v1-31 1) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ((= v1-31 2) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ) ) - (let ((v1-40 (get-rand-int obj 3))) + (let ((v1-40 (get-rand-int this 3))) (cond ((zero? v1-40) - (setup-masks (-> obj draw) 32 0) + (setup-masks (-> this draw) 32 0) ) ((= v1-40 1) - (setup-masks (-> obj draw) 2048 0) + (setup-masks (-> this draw) 2048 0) ) ((= v1-40 2) - (setup-masks (-> obj draw) #x20000 0) + (setup-masks (-> this draw) #x20000 0) ) ) ) - (let ((v1-49 (get-rand-int obj 3))) + (let ((v1-49 (get-rand-int this 3))) (cond ((zero? v1-49) - (setup-masks (-> obj draw) 16 0) + (setup-masks (-> this draw) 16 0) ) ((= v1-49 1) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) ((= v1-49 2) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ) ) ) ((= v1-7 1) - (setup-masks (-> obj draw) #x400000 0) - (setup-masks (-> obj draw) #x200000 0) - (let ((v1-63 (get-rand-int obj 2))) + (setup-masks (-> this draw) #x400000 0) + (setup-masks (-> this draw) #x200000 0) + (let ((v1-63 (get-rand-int this 2))) (cond ((zero? v1-63) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ((= v1-63 1) - (setup-masks (-> obj draw) #x80000 0) + (setup-masks (-> this draw) #x80000 0) ) ) ) - (let ((v1-70 (get-rand-int obj 2))) + (let ((v1-70 (get-rand-int this 2))) (cond ((zero? v1-70) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ((= v1-70 1) - (setup-masks (-> obj draw) #x100000 0) + (setup-masks (-> this draw) #x100000 0) ) ) ) - (let ((v1-77 (get-rand-int obj 4))) + (let ((v1-77 (get-rand-int this 4))) (cond ((zero? v1-77) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) ((= v1-77 1) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-77 2) - (setup-masks (-> obj draw) 130 0) + (setup-masks (-> this draw) 130 0) ) ) ) - (if (zero? (get-rand-int obj 1)) - (setup-masks (-> obj draw) #x20000 0) + (if (zero? (get-rand-int this 1)) + (setup-masks (-> this draw) #x20000 0) ) - (let ((v1-91 (get-rand-int obj 3))) + (let ((v1-91 (get-rand-int this 3))) (cond ((zero? v1-91) - (setup-masks (-> obj draw) 16 0) + (setup-masks (-> this draw) 16 0) ) ((= v1-91 1) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) ((= v1-91 2) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc index 1b0bda9252..f216136855 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen-norm.gc @@ -228,21 +228,21 @@ (set! (-> *citizen-norm-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod enemy-method-51 citizen-norm ((obj citizen-norm)) +(defmethod enemy-method-51 citizen-norm ((this citizen-norm)) (cond - ((logtest? (-> obj flags) (citizen-flag knocked-out-car knocked-out-bike)) - ((method-of-type nav-enemy enemy-method-51) obj) + ((logtest? (-> this flags) (citizen-flag knocked-out-car knocked-out-bike)) + ((method-of-type nav-enemy enemy-method-51) this) ) (else - (let ((f30-0 (quaternion-y-angle (-> obj root quat)))) - (case (-> obj incoming knocked-type) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (let ((a0-6 (handle->process (-> obj focus handle)))) + (let ((a0-6 (handle->process (-> this focus handle)))) (when a0-6 (get-trans (the-as process-focusable a0-6) 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root transv quad)) - (if (< (vector-dot (-> obj root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) (vector-negate-in-place! s5-0) @@ -254,14 +254,14 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> obj root transv quad)) - (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) 0.0) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) (f1-2 (deg- f30-0 f28-0)) (f2-0 (fabs f1-2)) - (f0-8 (-> obj enemy-info knocked-seek-ry-clamp)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) ) (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) (set! f30-0 (+ (cond @@ -295,26 +295,26 @@ ) ) -(defmethod enemy-method-79 citizen-norm ((obj citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 citizen-norm ((this citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let ((s5-0 (ja-done? 0))) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) ) (when s5-0 (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-6 (-> obj skel root-channel 0))) + (let ((a0-6 (-> this skel root-channel 0))) (set! (-> a0-6 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) ) (set! (-> a0-6 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) frames num-frames ) @@ -326,7 +326,7 @@ (set! (-> a0-6 frame-num) 3.0) (joint-control-channel-group! a0-6 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) num-func-seek! ) ) @@ -335,55 +335,55 @@ ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) -(defmethod enemy-method-77 citizen-norm ((obj citizen-norm) (arg0 (pointer float))) +(defmethod enemy-method-77 citizen-norm ((this citizen-norm) (arg0 (pointer float))) (local-vars (v1-36 knocked-type)) (cond - ((logtest? (-> obj flags) (citizen-flag knocked-out-car)) + ((logtest? (-> this flags) (citizen-flag knocked-out-car)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 33))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 33)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 33)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) ) - (logclear! (-> obj flags) (citizen-flag knocked-out-car)) + (logclear! (-> this flags) (citizen-flag knocked-out-car)) ) - ((logtest? (-> obj flags) (citizen-flag knocked-out-bike)) + ((logtest? (-> this flags) (citizen-flag knocked-out-bike)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 34))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 34))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 34)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 34)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 34)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 34)) num-func-seek!) ) - (logclear! (-> obj flags) (citizen-flag knocked-out-bike)) + (logclear! (-> this flags) (citizen-flag knocked-out-bike)) ) - ((begin (set! v1-36 (-> obj incoming knocked-type)) (= v1-36 (knocked-type knocked-type-4))) + ((begin (set! v1-36 (-> this incoming knocked-type)) (= v1-36 (knocked-type knocked-type-4))) (ja-channel-push! 1 (seconds 0.1)) - (let* ((a2-2 (ash 1 (-> obj info prev-yellow-hit))) - (v1-39 (enemy-method-120 obj 1 a2-2)) + (let* ((a2-2 (ash 1 (-> this info prev-yellow-hit))) + (v1-39 (enemy-method-120 this 1 a2-2)) (a1-11 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-39 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-39 8)) (the-as uint (-> this info)))) yellow-hit-anim 0 anim-index-front @@ -391,8 +391,8 @@ ) ) ) - (set! (-> obj info prev-yellow-hit) v1-39) - (let ((a0-21 (-> obj skel root-channel 0))) + (set! (-> this info prev-yellow-hit) v1-39) + (let ((a0-21 (-> this skel root-channel 0))) (set! (-> a0-21 frame-group) (the-as art-joint-anim a1-11)) (set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1))) (set! (-> a0-21 param 1) (-> arg0 0)) @@ -403,14 +403,14 @@ ) ((= v1-36 (knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let* ((a2-4 (ash 1 (-> obj info prev-blue-hit))) - (v1-48 (enemy-method-120 obj 3 a2-4)) + (let* ((a2-4 (ash 1 (-> this info prev-blue-hit))) + (v1-48 (enemy-method-120 this 3 a2-4)) (a1-18 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-48 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-48 8)) (the-as uint (-> this info)))) blue-hit-anim 0 anim-index-front @@ -418,8 +418,8 @@ ) ) ) - (set! (-> obj info prev-blue-hit) v1-48) - (let ((a0-36 (-> obj skel root-channel 0))) + (set! (-> this info prev-blue-hit) v1-48) + (let ((a0-36 (-> this skel root-channel 0))) (set! (-> a0-36 frame-group) (the-as art-joint-anim a1-18)) (set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-18) frames num-frames) -1))) (set! (-> a0-36 param 1) 1.0) @@ -429,19 +429,19 @@ ) ) (else - (let ((s4-0 (if (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) ) ) ) (ja-channel-push! 1 (seconds 0.1)) - (if (or (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (= (-> obj incoming knocked-type) (knocked-type knocked-type-3)) + (if (or (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (= (-> this incoming knocked-type) (knocked-type knocked-type-3)) ) (set! (-> arg0 0) (* 0.5 (-> arg0 0))) ) - (let ((a0-47 (-> obj skel root-channel 0))) + (let ((a0-47 (-> this skel root-channel 0))) (set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-47 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-47 param 1) (-> arg0 0)) @@ -454,16 +454,16 @@ #t ) -(defmethod enemy-method-78 citizen-norm ((obj citizen-norm) (arg0 (pointer float))) +(defmethod enemy-method-78 citizen-norm ((this citizen-norm) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (set! (-> arg0 0) 1.0) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) ) (set! (-> a0-2 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) frames num-frames ) @@ -475,7 +475,7 @@ (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) num-func-seek! ) ) @@ -592,82 +592,82 @@ ) ) -(defmethod set-behavior! citizen-norm ((obj citizen-norm) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! citizen-norm ((this citizen-norm) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((11) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-22)) - (set! (-> obj root trans quad) (-> arg0 position quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 rotation)) - (set! (-> obj vehicle) (-> arg0 handle)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-22)) + (set! (-> this root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> this root quat) (-> arg0 rotation)) + (set! (-> this vehicle) (-> arg0 handle)) (ja-channel-set! 1) - (case (-> (the-as vehicle (handle->process (-> obj vehicle))) info object-type) + (case (-> (the-as vehicle (handle->process (-> this vehicle))) info object-type) ((11 12 13) - (logior! (-> obj flags) (citizen-flag knocked-out-bike)) - (let ((v1-16 (-> obj skel root-channel 0))) - (set! (-> v1-16 frame-group) (the-as art-joint-anim (-> obj draw art-group data 30))) + (logior! (-> this flags) (citizen-flag knocked-out-bike)) + (let ((v1-16 (-> this skel root-channel 0))) + (set! (-> v1-16 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) ) ) ((14 15 16) - (logior! (-> obj flags) (citizen-flag knocked-out-car)) - (let ((v1-22 (-> obj skel root-channel 0))) - (set! (-> v1-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 31))) + (logior! (-> this flags) (citizen-flag knocked-out-car)) + (let ((v1-22 (-> this skel root-channel 0))) + (set! (-> v1-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 31))) ) ) ) (ja-post) - (setup-masks (-> obj draw) 0 -1) + (setup-masks (-> this draw) 0 -1) (let ((s5-1 (-> arg0 user-data))) (if (not (logtest? s5-1 32)) - (setup-masks (-> obj draw) 32 0) + (setup-masks (-> this draw) 32 0) ) (if (not (logtest? s5-1 16)) - (setup-masks (-> obj draw) 16 0) + (setup-masks (-> this draw) 16 0) ) (if (not (logtest? s5-1 2)) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) (if (not (logtest? s5-1 4096)) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) (if (not (logtest? s5-1 8)) - (setup-masks (-> obj draw) 8 0) + (setup-masks (-> this draw) 8 0) ) (if (not (logtest? s5-1 512)) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) (if (not (logtest? s5-1 #x4000)) - (setup-masks (-> obj draw) #x8000 0) + (setup-masks (-> this draw) #x8000 0) ) (if (not (logtest? s5-1 4)) - (setup-masks (-> obj draw) 4 0) + (setup-masks (-> this draw) 4 0) ) (if (not (logtest? s5-1 256)) - (setup-masks (-> obj draw) 512 0) + (setup-masks (-> this draw) 512 0) ) (if (not (logtest? s5-1 8192)) - (setup-masks (-> obj draw) #x4000 0) + (setup-masks (-> this draw) #x4000 0) ) (if (not (logtest? s5-1 64)) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) (if (not (logtest? s5-1 2048)) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) (if (not (logtest? #x10000 s5-1)) - (setup-masks (-> obj draw) #x20000 0) + (setup-masks (-> this draw) #x20000 0) ) (if (not (logtest? s5-1 128)) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) (if (logtest? #x40000 s5-1) - (setup-masks (-> obj draw) 2048 0) - (setup-masks (-> obj draw) 2048 0) + (setup-masks (-> this draw) 2048 0) + (setup-masks (-> this draw) 2048 0) ) ) - (go (method-of-object obj knocked-off-vehicle)) + (go (method-of-object this knocked-off-vehicle)) ) (else - ((method-of-type civilian set-behavior!) obj arg0) + ((method-of-type civilian set-behavior!) this arg0) ) ) 0 @@ -686,9 +686,9 @@ ) ) -(defmethod init-enemy-collision! citizen-norm ((obj citizen-norm)) +(defmethod init-enemy-collision! citizen-norm ((this citizen-norm)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -744,188 +744,188 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! citizen-norm ((obj citizen-norm)) +(defmethod init-enemy! citizen-norm ((this citizen-norm)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *citizen-norm-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *citizen-norm-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 204800.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (try-update-focus (-> obj focus) *target* obj) - (-> obj neck) - (set! (-> obj info) *citizen-norm-global-info*) - (set! (-> obj anim-shuffle) 11) - (let ((v1-18 (get-rand-int obj 3))) + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (try-update-focus (-> this focus) *target* this) + (-> this neck) + (set! (-> this info) *citizen-norm-global-info*) + (set! (-> this anim-shuffle) 11) + (let ((v1-18 (get-rand-int this 3))) (cond ((zero? v1-18) - (set! (-> obj anim-walk) 12) - (set! (-> obj dist-walk-anim) 8736.768) - (set! (-> obj speed-walk) 10240.0) + (set! (-> this anim-walk) 12) + (set! (-> this dist-walk-anim) 8736.768) + (set! (-> this speed-walk) 10240.0) ) ((= v1-18 1) - (set! (-> obj anim-walk) 13) - (set! (-> obj dist-walk-anim) 13107.2) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 13107.2) + (set! (-> this speed-walk) 12288.0) ) ((= v1-18 2) - (set! (-> obj anim-walk) 11) - (set! (-> obj dist-walk-anim) 4370.432) - (set! (-> obj speed-walk) 4096.0) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 4370.432) + (set! (-> this speed-walk) 4096.0) ) ) ) - (let ((v1-33 (get-rand-int obj 3))) + (let ((v1-33 (get-rand-int this 3))) (cond ((zero? v1-33) - (set! (-> obj anim-panic-run) 15) + (set! (-> this anim-panic-run) 15) ) ((= v1-33 1) - (set! (-> obj anim-panic-run) 15) + (set! (-> this anim-panic-run) 15) ) ((= v1-33 2) - (set! (-> obj anim-panic-run) 14) + (set! (-> this anim-panic-run) 14) ) ) ) - (set! (-> obj dist-run-anim) 28672.0) - (let ((v1-40 (get-rand-int obj 3))) + (set! (-> this dist-run-anim) 28672.0) + (let ((v1-40 (get-rand-int this 3))) (cond ((zero? v1-40) - (set! (-> obj anim-run) 14) + (set! (-> this anim-run) 14) ) ((= v1-40 1) - (set! (-> obj anim-run) 14) + (set! (-> this anim-run) 14) ) ((= v1-40 2) - (set! (-> obj anim-run) 14) + (set! (-> this anim-run) 14) ) ) ) - (set! (-> obj speed-run) 49152.0) - (set! (-> obj anim-on-ground) 17) - (set! (-> obj anim-dive) 16) - (set! (-> obj anim-get-up-front) 22) - (set! (-> obj anim-get-up-back) 23) - (let ((f30-0 (get-rand-float-range obj 1.0 1.25)) - (f0-11 (get-rand-float-range obj 1.0 1.25)) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-on-ground) 17) + (set! (-> this anim-dive) 16) + (set! (-> this anim-get-up-front) 22) + (set! (-> this anim-get-up-back) 23) + (let ((f30-0 (get-rand-float-range this 1.0 1.25)) + (f0-11 (get-rand-float-range this 1.0 1.25)) ) - (set-vector! (-> obj root scale) f0-11 f30-0 f0-11 1.0) + (set-vector! (-> this root scale) f0-11 f30-0 f0-11 1.0) ) - (let ((f0-13 (get-rand-float-range obj 0.9 1.0))) - (set-vector! (-> obj draw color-mult) f0-13 f0-13 f0-13 1.0) + (let ((f0-13 (get-rand-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-13 f0-13 f0-13 1.0) ) - (set! (-> obj water-anim) 29) + (set! (-> this water-anim) 29) 0 (none) ) -(defmethod citizen-init! citizen-norm ((obj citizen-norm)) +(defmethod citizen-init! citizen-norm ((this citizen-norm)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj dive-reaction) (+ 0.09 (* 0.15 (rand-vu)))) - (logclear! (-> obj mask) (process-mask enemy)) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 32 0) - (let ((v1-10 (get-rand-int obj 4))) + (set! (-> this dive-reaction) (+ 0.09 (* 0.15 (rand-vu)))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 32 0) + (let ((v1-10 (get-rand-int this 4))) (cond ((zero? v1-10) - (setup-masks (-> obj draw) 64 0) + (setup-masks (-> this draw) 64 0) ) ((= v1-10 1) - (setup-masks (-> obj draw) 2048 0) + (setup-masks (-> this draw) 2048 0) ) ((= v1-10 2) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ((= v1-10 3) - (setup-masks (-> obj draw) #x200000 0) + (setup-masks (-> this draw) #x200000 0) ) ) ) - (let ((v1-21 (get-rand-int obj 3))) + (let ((v1-21 (get-rand-int this 3))) (cond ((zero? v1-21) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) ((= v1-21 1) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ((= v1-21 2) - (setup-masks (-> obj draw) #x40000 0) + (setup-masks (-> this draw) #x40000 0) ) ) ) - (let ((v1-30 (get-rand-int obj 4))) + (let ((v1-30 (get-rand-int this 4))) (cond ((zero? v1-30) - (setup-masks (-> obj draw) 8 0) + (setup-masks (-> this draw) 8 0) ) ((= v1-30 1) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) ((= v1-30 2) - (setup-masks (-> obj draw) #x8000 0) + (setup-masks (-> this draw) #x8000 0) ) ((= v1-30 3) - (setup-masks (-> obj draw) #x100000 0) + (setup-masks (-> this draw) #x100000 0) ) ) ) - (let ((v1-41 (get-rand-int obj 5))) + (let ((v1-41 (get-rand-int this 5))) (cond ((zero? v1-41) - (setup-masks (-> obj draw) 4 0) + (setup-masks (-> this draw) 4 0) ) ((= v1-41 1) - (setup-masks (-> obj draw) 512 0) + (setup-masks (-> this draw) 512 0) ) ((= v1-41 2) - (setup-masks (-> obj draw) #x4000 0) + (setup-masks (-> this draw) #x4000 0) ) ((= v1-41 3) - (setup-masks (-> obj draw) #x80000 0) + (setup-masks (-> this draw) #x80000 0) ) ) ) - (let ((v1-52 (get-rand-int obj 4))) + (let ((v1-52 (get-rand-int this 4))) (cond ((zero? v1-52) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-52 1) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ((= v1-52 2) - (setup-masks (-> obj draw) #x20000 0) + (setup-masks (-> this draw) #x20000 0) ) ((= v1-52 3) - (setup-masks (-> obj draw) #x400000 0) + (setup-masks (-> this draw) #x400000 0) ) ) ) - (setup-masks (-> obj draw) 16 0) - (let ((v1-65 (get-rand-int obj 4))) + (setup-masks (-> this draw) 16 0) + (let ((v1-65 (get-rand-int this 4))) (cond ((zero? v1-65) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ((= v1-65 1) - (setup-masks (-> obj draw) #x800000 0) + (setup-masks (-> this draw) #x800000 0) ) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/citizen.gc b/goal_src/jak2/levels/city/traffic/citizen/citizen.gc index 65af12629c..e8d19cc5dd 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/citizen.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/citizen.gc @@ -9,12 +9,12 @@ (define *citizen-debug* #f) -(defmethod citizen-nav-init! citizen ((obj citizen)) +(defmethod citizen-nav-init! citizen ((this citizen)) "Initialize nav related fields." - (let ((v1-0 (-> obj nav))) + (let ((v1-0 (-> this nav))) (logclear! (-> v1-0 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43)))) (let ((a1-6 v1-0)) (set! (-> a1-6 sphere-mask) (the-as uint #x800fe)) ) @@ -25,8 +25,8 @@ 0 (logclear! (-> v1-0 flags) (nav-control-flag output-sphere-hash)) ) - (set! (-> obj enemy-info callback-info) *nav-enemy-physics-callback-info*) - (let ((v1-2 obj)) + (set! (-> this enemy-info callback-info) *nav-enemy-physics-callback-info*) + (let ((v1-2 this)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) ) @@ -38,69 +38,69 @@ (none) ) -(defmethod citizen-init! citizen ((obj citizen)) +(defmethod citizen-init! citizen ((this citizen)) "Initialize [[citizen]] defaults." - (logior! (-> obj fact enemy-options) (enemy-option knocked-into-water)) - (if (-> obj skel effect) - (logclear! (-> obj skel effect flags) (effect-control-flag ecf2)) + (logior! (-> this fact enemy-options) (enemy-option knocked-into-water)) + (if (-> this skel effect) + (logclear! (-> this skel effect flags) (effect-control-flag ecf2)) ) - (set! (-> obj draw death-draw-overlap) (the-as uint 0)) - (set! (-> obj draw death-timer) (the-as uint 0)) - (set! (-> obj draw death-timer-org) (the-as uint 0)) - (set! (-> obj draw death-vertex-skip) (the-as uint 0)) - (set! (-> obj draw death-effect) (the-as uint 0)) - (logclear! (-> obj focus-status) (focus-status disable dead inactive hit)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (clear-focused (-> obj focus)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logand (enemy-flag dislike-combo) (-> obj enemy-flags)))) - (logclear! (-> obj draw status) (draw-control-status no-draw lod-set)) - (set! (-> obj draw death-timer) (the-as uint 0)) - (logior! (-> obj root nav-flags) (nav-flags has-root-sphere)) - (let ((v1-28 (-> obj root root-prim))) - (set! (-> v1-28 prim-core collide-as) (-> obj root backup-collide-as)) - (set! (-> v1-28 prim-core collide-with) (-> obj root backup-collide-with)) + (set! (-> this draw death-draw-overlap) (the-as uint 0)) + (set! (-> this draw death-timer) (the-as uint 0)) + (set! (-> this draw death-timer-org) (the-as uint 0)) + (set! (-> this draw death-vertex-skip) (the-as uint 0)) + (set! (-> this draw death-effect) (the-as uint 0)) + (logclear! (-> this focus-status) (focus-status disable dead inactive hit)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (clear-focused (-> this focus)) + (set! (-> this enemy-flags) (the-as enemy-flag (logand (enemy-flag dislike-combo) (-> this enemy-flags)))) + (logclear! (-> this draw status) (draw-control-status no-draw lod-set)) + (set! (-> this draw death-timer) (the-as uint 0)) + (logior! (-> this root nav-flags) (nav-flags has-root-sphere)) + (let ((v1-28 (-> this root root-prim))) + (set! (-> v1-28 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-28 prim-core collide-with) (-> this root backup-collide-with)) ) - (set! (-> obj root penetrated-by) (penetrate - generic-attack - lunge - flop - punch - spin - roll - uppercut - bonk - tube - vehicle - flut-attack - board - mech-punch - dark-punch - dark-giant - ) + (set! (-> this root penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) ) - (logior! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logior! (-> obj enemy-flags) (enemy-flag check-water)) - (logior! (-> obj enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) - (logior! (-> obj mask) (process-mask collectable)) - (logior! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (set! (-> obj hit-points) (-> obj enemy-info default-hit-points)) - (set! (-> obj fated-time) 0) - (set! (-> obj hit-by-player-count) 0) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj draw color-emissive) 0.0 0.0 0.0 1.0) - (update-transforms (-> obj root)) + (logior! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag check-water)) + (logior! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) + (logior! (-> this mask) (process-mask collectable)) + (logior! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) + (set! (-> this fated-time) 0) + (set! (-> this hit-by-player-count) 0) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 0.0 0.0 1.0) + (update-transforms (-> this root)) 0 (none) ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! citizen ((obj citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! citizen ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" (when arg1 - (let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> obj root trans)))) + (let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans)))) (when (< f0-0 (-> arg1 rating)) (set! (-> arg1 rating) f0-0) (set! (-> arg1 proc) arg0) @@ -111,54 +111,54 @@ (the-as enemy-aware 3) ) -(defmethod enemy-method-61 citizen ((obj citizen) (arg0 int)) +(defmethod enemy-method-61 citizen ((this citizen) (arg0 int)) 3 ) -(defmethod go-stare citizen ((obj citizen)) - (go (method-of-object obj flee)) +(defmethod go-stare citizen ((this citizen)) + (go (method-of-object this flee)) ) ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile citizen ((obj citizen)) - (go-inactive obj) +(defmethod go-hostile citizen ((this citizen)) + (go-inactive this) ) -(defmethod go-flee citizen ((obj citizen)) - (go (method-of-object obj flee)) +(defmethod go-flee citizen ((this citizen)) + (go (method-of-object this flee)) ) -(defmethod react-to-focus citizen ((obj citizen)) +(defmethod react-to-focus citizen ((this citizen)) "@TODO - flesh out docs" - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ;; WARN: Return type mismatch none vs object. -(defmethod kill-prefer-falling citizen ((obj citizen)) +(defmethod kill-prefer-falling citizen ((this citizen)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (logclear! (-> obj flags) (citizen-flag persistent)) - (send-event (ppointer->process (-> obj parent)) 'child-killed) - (go-inactive obj) + (logclear! (-> this flags) (citizen-flag persistent)) + (send-event (ppointer->process (-> this parent)) 'child-killed) + (go-inactive this) ) -(defmethod cleanup-for-death citizen ((obj citizen)) - (logclear! (-> obj flags) (citizen-flag persistent)) - (send-event (ppointer->process (-> obj parent)) 'child-killed) - (go-inactive obj) +(defmethod cleanup-for-death citizen ((this citizen)) + (logclear! (-> this flags) (citizen-flag persistent)) + (send-event (ppointer->process (-> this parent)) 'child-killed) + (go-inactive this) (none) ) -(defmethod go-inactive citizen ((obj citizen)) - (vehicle-controller-method-11 (-> obj controller)) - (logior! (-> obj focus-status) (focus-status inactive)) - (set! (-> obj event-hook) (-> (method-of-object obj inactive) event)) - (go (method-of-object obj inactive)) +(defmethod go-inactive citizen ((this citizen)) + (vehicle-controller-method-11 (-> this controller)) + (logior! (-> this focus-status) (focus-status inactive)) + (set! (-> this event-hook) (-> (method-of-object this inactive) event)) + (go (method-of-object this inactive)) 0 (none) ) -(defmethod trigger-alert citizen ((obj citizen) (arg0 int) (arg1 target)) - (let ((a0-1 (-> obj controller traffic))) +(defmethod trigger-alert citizen ((this citizen) (arg0 int) (arg1 target)) + (let ((a0-1 (-> this controller traffic))) (when (and (nonzero? a0-1) arg1) (if #t (increase-alert-level a0-1 arg0 arg1) @@ -169,8 +169,8 @@ (none) ) -(defmethod decrease-alert citizen ((obj citizen) (arg0 object)) - (let ((a0-1 (-> obj controller traffic))) +(defmethod decrease-alert citizen ((this citizen) (arg0 object)) + (let ((a0-1 (-> this controller traffic))) (if (nonzero? a0-1) (decrease-alert-level a0-1 (the-as int arg0)) ) @@ -179,35 +179,35 @@ (none) ) -(defmethod get-inv-mass citizen ((obj citizen)) +(defmethod get-inv-mass citizen ((this citizen)) 1.0 ) -(defmethod find-segment citizen ((obj citizen) (arg0 vector) (arg1 vector)) - (find-best-segment (-> obj controller traffic) arg0 arg1 1) +(defmethod find-segment citizen ((this citizen) (arg0 vector) (arg1 vector)) + (find-best-segment (-> this controller traffic) arg0 arg1 1) ) -(defmethod nav-segment-callback citizen ((obj citizen) +(defmethod nav-segment-callback citizen ((this citizen) (arg0 vector) (arg1 traffic-find-segment-struct) (arg2 (function traffic-find-segment-struct nav-segment none)) ) - (callback-on-nav-segments-in-sphere (-> obj controller traffic) arg0 1 arg1 arg2) + (callback-on-nav-segments-in-sphere (-> this controller traffic) arg0 1 arg1 arg2) 0 (none) ) -(defmethod citizen-method-186 citizen ((obj citizen) (arg0 nav-segment)) - (vehicle-controller-method-11 (-> obj controller)) - (vehicle-controller-method-13 (-> obj controller) (-> arg0 branch) (the-as vector (-> arg0 vertex))) +(defmethod citizen-method-186 citizen ((this citizen) (arg0 nav-segment)) + (vehicle-controller-method-11 (-> this controller)) + (vehicle-controller-method-13 (-> this controller) (-> arg0 branch) (the-as vector (-> arg0 vertex))) 0 (none) ) -(defmethod citizen-method-187 citizen ((obj citizen)) - (let* ((v1-0 (-> obj controller)) +(defmethod citizen-method-187 citizen ((this citizen)) + (let* ((v1-0 (-> this controller)) (gp-1 (vector-! (new 'stack-no-clear 'vector) (-> v1-0 turn-exit-point) (-> v1-0 path-prev-point))) - (s5-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> v1-0 turn-exit-point))) + (s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> v1-0 turn-exit-point))) ) (set! (-> s5-1 y) 0.0) (set! (-> gp-1 y) 0.0) @@ -216,20 +216,20 @@ ) ) -(defmethod set-behavior! citizen ((obj citizen) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! citizen ((this citizen) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-0 2) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ((= v1-0 3) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) (else - (go-inactive obj) + (go-inactive this) ) ) ) @@ -237,13 +237,13 @@ (none) ) -(defmethod general-event-handler citizen ((obj citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler citizen ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) (let ((v1-1 #f)) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6) (knocked-type knocked-type-5) @@ -252,54 +252,54 @@ (set! v1-1 #t) ) (((knocked-type knocked-type-0)) - (+! (-> obj hit-by-player-count) 1) - (set! v1-1 (>= (-> obj hit-by-player-count) 2)) + (+! (-> this hit-by-player-count) 1) + (set! v1-1 (>= (-> this hit-by-player-count) 2)) ) ) (when v1-1 - (let* ((s5-0 (handle->process (-> obj incoming attacker-handle))) + (let* ((s5-0 (handle->process (-> this incoming attacker-handle))) (a2-5 (if (type? s5-0 process-focusable) s5-0 ) ) ) (if a2-5 - (trigger-alert obj 1 (the-as target a2-5)) + (trigger-alert this 1 (the-as target a2-5)) ) ) ) ) - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) (('traffic-off) - (if (not (logtest? (-> obj flags) (citizen-flag persistent))) - (go-inactive obj) + (if (not (logtest? (-> this flags) (citizen-flag persistent))) + (go-inactive this) ) ) (('traffic-off-force) - (go-inactive obj) + (go-inactive this) ) (('traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (set! (-> this controller traffic) (the-as traffic-engine (-> arg3 param 1))) (let ((s5-1 (the-as object (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-1) position quad)) - (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-1) rotation)) - (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-1) velocity quad)) + (set! (-> this root trans quad) (-> (the-as traffic-object-spawn-params s5-1) position quad)) + (quaternion-copy! (-> this root quat) (-> (the-as traffic-object-spawn-params s5-1) rotation)) + (set! (-> this root transv quad) (-> (the-as traffic-object-spawn-params s5-1) velocity quad)) (let ((a0-24 (-> (the-as traffic-object-spawn-params s5-1) nav-mesh))) (when a0-24 - (change-to a0-24 obj) - (if (not (-> obj nav)) - (go-inactive obj) + (change-to a0-24 this) + (if (not (-> this nav)) + (go-inactive this) ) - (let ((v1-31 (-> obj nav state))) + (let ((v1-31 (-> this nav state))) (set! (-> v1-31 current-poly) (the-as nav-poly #f)) ) 0 (let ((a1-11 (-> (the-as traffic-object-spawn-params s5-1) nav-branch))) (when a1-11 - (vehicle-controller-method-13 (-> obj controller) a1-11 (-> obj root trans)) - (let ((a0-28 (-> obj nav state)) - (v1-38 (-> obj controller turn-exit-point)) + (vehicle-controller-method-13 (-> this controller) a1-11 (-> this root trans)) + (let ((a0-28 (-> this nav state)) + (v1-38 (-> this controller turn-exit-point)) ) (logclear! (-> a0-28 flags) (nav-state-flag directional-mode)) (logior! (-> a0-28 flags) (nav-state-flag target-poly-dirty)) @@ -308,39 +308,39 @@ 0 ) ) - (citizen-nav-init! obj) - (citizen-init! obj) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) - (set! (-> obj gnd-height) (-> obj root gspot-pos y)) - (set-behavior! obj (the-as traffic-object-spawn-params s5-1)) + (citizen-nav-init! this) + (citizen-init! this) + (enemy-method-127 this 40960.0 40960.0 #t (the-as collide-spec (-> this gnd-collide))) + (set! (-> this gnd-height) (-> this root gspot-pos y)) + (set-behavior! this (the-as traffic-object-spawn-params s5-1)) ) ) ) ) (('nav-mesh-kill) - (remove-process-drawable (-> obj nav state mesh) obj) - (set! (-> obj nav) #f) - (go-inactive obj) + (remove-process-drawable (-> this nav state mesh) this) + (set! (-> this nav) #f) + (go-inactive this) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod citizen-method-200 citizen ((obj citizen)) - (set! (-> obj root transv x) 0.0) - (set! (-> obj root transv z) 0.0) - (when (-> obj enemy-info move-to-ground) - (if (focus-test? obj under-water) - (enemy-method-47 obj (-> obj root transv)) - (+! (-> obj root transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame))) +(defmethod citizen-method-200 citizen ((this citizen)) + (set! (-> this root transv x) 0.0) + (set! (-> this root transv z) 0.0) + (when (-> this enemy-info move-to-ground) + (if (focus-test? this under-water) + (enemy-method-47 this (-> this root transv)) + (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) ) (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) - (let ((v1-15 (-> obj enemy-info))) - (set! (-> a2-0 gnd-collide-with) (the-as collide-spec (-> obj gnd-collide))) + (let ((v1-15 (-> this enemy-info))) + (set! (-> a2-0 gnd-collide-with) (the-as collide-spec (-> this gnd-collide))) (set! (-> a2-0 popup) 8192.0) (set! (-> a2-0 dont-move-if-overlaps?) #t) (set! (-> a2-0 hover-if-no-ground?) (-> v1-15 hover-if-no-ground)) @@ -349,62 +349,62 @@ ) (set! (-> a2-0 overlaps-params tlist) *touching-list*) (-> a2-0 overlaps-params) - (enemy-method-128 obj (-> obj root transv) a2-0) + (enemy-method-128 this (-> this root transv) a2-0) ) 0 (none) ) -(defmethod track-target! citizen ((obj citizen)) +(defmethod track-target! citizen ((this citizen)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (when (< (-> obj next-time-look-at) (current-time)) - (when (nonzero? (-> obj neck)) - (let ((a0-4 (handle->process (-> obj focus handle)))) + (when (< (-> this next-time-look-at) (current-time)) + (when (nonzero? (-> this neck)) + (let ((a0-4 (handle->process (-> this focus handle)))) (when a0-4 (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-4) 2) quad)) - (if (and (-> obj next-state) (= (-> obj next-state name) 'flee)) - (set! (-> s5-0 quad) (-> obj danger-pos quad)) + (if (and (-> this next-state) (= (-> this next-state name) 'flee)) + (set! (-> s5-0 quad) (-> this danger-pos quad)) ) - (when (< (vector-vector-distance s5-0 (-> obj root trans)) 122880.0) - (look-at-target! obj (enemy-flag lock-focus)) - (target-set! (-> obj neck) s5-0) + (when (< (vector-vector-distance s5-0 (-> this root trans)) 122880.0) + (look-at-target! this (enemy-flag lock-focus)) + (target-set! (-> this neck) s5-0) ) ) ) ) - (when (< (-> obj stop-time-look-at) (current-time)) - (shut-down (-> obj neck)) - (set! (-> obj next-time-look-at) (+ (current-time) (the int (* 300.0 (get-rand-float-range obj 0.0 20.0))))) - (set! (-> obj stop-time-look-at) - (+ (-> obj next-time-look-at) (the int (* 300.0 (get-rand-float-range obj 5.0 10.0)))) + (when (< (-> this stop-time-look-at) (current-time)) + (shut-down (-> this neck)) + (set! (-> this next-time-look-at) (+ (current-time) (the int (* 300.0 (get-rand-float-range this 0.0 20.0))))) + (set! (-> this stop-time-look-at) + (+ (-> this next-time-look-at) (the int (* 300.0 (get-rand-float-range this 5.0 10.0)))) ) ) ) ) - (let ((a0-18 (-> obj enemy-flags))) + (let ((a0-18 (-> this enemy-flags))) (when (and (logtest? a0-18 (enemy-flag attackable-backup)) - (>= (- (current-time) (-> obj auto-reset-penetrate-time)) (seconds 0.1)) + (time-elapsed? (-> this auto-reset-penetrate-time) (seconds 0.1)) ) - (set! (-> obj enemy-flags) (logclear a0-18 (enemy-flag attackable-backup))) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) + (set! (-> this enemy-flags) (logclear a0-18 (enemy-flag attackable-backup))) + (set! (-> this root penetrated-by) (get-penetrate-info this)) (let ((v1-50 0)) - (if (logtest? (penetrate knocked) (-> obj root penetrate-using)) + (if (logtest? (penetrate knocked) (-> this root penetrate-using)) (set! v1-50 (logior (shl 1 32) v1-50)) ) - (set! (-> obj root penetrate-using) (the-as penetrate v1-50)) + (set! (-> this root penetrate-using) (the-as penetrate v1-50)) ) ) ) - (if (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-control-status on-screen))) - (set! (-> obj last-draw-time) (current-time)) + (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) + (set-time! (-> this last-draw-time)) ) - (let ((s5-3 (-> obj draw shadow-ctrl))) + (let ((s5-3 (-> this draw shadow-ctrl))) (when (!= *nav-enemy-dummy-shadow-control* s5-3) - (let ((f0-7 (vector-vector-distance (camera-pos) (-> obj root trans)))) + (let ((f0-7 (vector-vector-distance (camera-pos) (-> this root trans)))) (cond ((< 163840.0 f0-7) (logior! (-> s5-3 settings flags) (shadow-flags disable-draw)) @@ -425,12 +425,12 @@ ) ) ) - (when (logtest? (enemy-flag trackable-backup directed-ready) (-> obj enemy-flags)) - (enemy-method-54 obj) - (when (and (focus-test? obj touch-water) (< (-> obj root trans y) (+ -11468.8 (-> obj water-surface-height)))) - (set! (-> obj root trans y) (+ -11468.8 (-> obj water-surface-height))) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'in-ditch))) - (go (method-of-object obj in-ditch)) + (when (logtest? (enemy-flag trackable-backup directed-ready) (-> this enemy-flags)) + (enemy-method-54 this) + (when (and (focus-test? this touch-water) (< (-> this root trans y) (+ -11468.8 (-> this water-surface-height)))) + (set! (-> this root trans y) (+ -11468.8 (-> this water-surface-height))) + (if (not (and (-> this next-state) (= (-> this next-state name) 'in-ditch))) + (go (method-of-object this in-ditch)) ) ) ) @@ -439,7 +439,7 @@ (none) ) -(defmethod enemy-method-128 citizen ((obj citizen) (arg0 vector) (arg1 move-above-ground-params)) +(defmethod enemy-method-128 citizen ((this citizen) (arg0 vector) (arg1 move-above-ground-params)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -448,7 +448,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((gp-0 (-> obj root))) + (let ((gp-0 (-> this root))) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) (set! (-> arg1 old-gspot-pos quad) (-> gp-0 gspot-pos quad)) @@ -459,10 +459,10 @@ (set! (-> gp-0 prev-status) (-> gp-0 status)) (vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0) (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) - (when (= (-> obj controller traffic sync-mask-8) (ash 1 (logand (-> obj traffic-id) 7))) + (when (= (-> this controller traffic sync-mask-8) (ash 1 (logand (-> this traffic-id) 7))) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (logclear! (-> gp-0 status) (collide-status on-ground)) - (let* ((a0-14 obj) + (let* ((a0-14 this) (t9-1 (method-of-object a0-14 enemy-above-ground?)) (a1-2 s2-0) (a2-2 (new 'stack-no-clear 'vector)) @@ -489,18 +489,18 @@ ) ) ) - (set! (-> obj gnd-height) (-> gp-0 gspot-pos y)) + (set! (-> this gnd-height) (-> gp-0 gspot-pos y)) (set! (-> gp-0 gspot-pos y) (-> arg1 old-gspot-pos y)) ) - (let ((f0-5 (- (-> obj gnd-height) (-> gp-0 gspot-pos y)))) + (let ((f0-5 (- (-> this gnd-height) (-> gp-0 gspot-pos y)))) (cond ((< 0.0 f0-5) (+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5)) ) (else (+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5)) - (if (< (-> gp-0 gspot-pos y) (-> obj gnd-height)) - (set! (-> gp-0 gspot-pos y) (-> obj gnd-height)) + (if (< (-> gp-0 gspot-pos y) (-> this gnd-height)) + (set! (-> gp-0 gspot-pos y) (-> this gnd-height)) ) ) ) @@ -567,7 +567,7 @@ ) ) -(defmethod nav-enemy-method-142 citizen ((obj citizen) (arg0 nav-control)) +(defmethod nav-enemy-method-142 citizen ((this citizen) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s3-0 quad) (-> a1-1 heading quad)) @@ -575,7 +575,7 @@ (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (let ((gp-0 (new 'stack-no-clear 'quaternion)) - (s5-1 (-> obj root quat)) + (s5-1 (-> this root quat)) ) ;; og:preserve-this modified for PC, see comment near definition in collide-shape-h.gc (normalized-heading-to-quaternion! gp-0 s3-0) @@ -591,62 +591,62 @@ (none) ) -(defmethod nav-enemy-method-176 citizen ((obj citizen)) - (nav-enemy-method-177 obj) - (let ((a0-2 obj)) +(defmethod nav-enemy-method-176 citizen ((this citizen)) + (nav-enemy-method-177 this) + (let ((a0-2 this)) (when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags)) (cond - ((logtest? (enemy-flag enemy-flag38) (-> obj enemy-flags)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag38)))) - (set! (-> obj root gspot-pos quad) (-> obj root trans quad)) - (set! (-> obj gnd-height) (-> obj root gspot-pos y)) + ((logtest? (enemy-flag enemy-flag38) (-> this enemy-flags)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag38)))) + (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (set! (-> this gnd-height) (-> this root gspot-pos y)) ) (else - (nav-enemy-method-142 obj (-> obj nav)) - (nav-enemy-method-143 obj (-> obj nav)) + (nav-enemy-method-142 this (-> this nav)) + (nav-enemy-method-143 this (-> this nav)) ) ) ) ) - (track-target! obj) - (update-transforms (-> obj root)) + (track-target! this) + (update-transforms (-> this root)) 0 (none) ) -(defmethod go-idle citizen ((obj citizen)) - (go (method-of-object obj active)) +(defmethod go-idle citizen ((this citizen)) + (go (method-of-object this active)) 0 (none) ) -(defmethod init-enemy-behaviour-and-stats! citizen ((obj citizen) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! citizen ((this citizen) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-behaviour-and-stats!))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj speed-scale) (get-rand-float-range obj 0.9 1.1)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (vehicle-controller-method-9 (-> obj controller)) - (citizen-init! obj) - (if (zero? (-> obj draw light-index)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this speed-scale) (get-rand-float-range this 0.9 1.1)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (vehicle-controller-method-9 (-> this controller)) + (citizen-init! this) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) ) 0 (none) ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! citizen ((obj citizen) (arg0 entity-actor)) +(defmethod init-from-entity! citizen ((this citizen) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -672,8 +672,8 @@ This commonly includes things such as: (none) ) -(defmethod get-run-anim citizen ((obj citizen)) - (-> obj anim-run) +(defmethod get-run-anim citizen ((this citizen)) + (-> this anim-run) ) ;; WARN: new jak 2 until loop case, check carefully @@ -777,29 +777,29 @@ This commonly includes things such as: #f ) -(defmethod citizen-method-188 citizen ((obj citizen) (arg0 vector)) +(defmethod citizen-method-188 citizen ((this citizen) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) ) - (let ((s1-0 (-> obj nav state current-poly))) - (let ((a1-2 (-> obj nav state))) + (let ((s1-0 (-> this nav state current-poly))) + (let ((a1-2 (-> this nav state))) (set! (-> s5-0 quad) (-> a1-2 heading quad)) ) (set! (-> s5-0 y) 0.0) (vector-xz-normalize! s5-0 20480.0) (set! (-> s4-0 quad) (-> s5-0 quad)) - (clamp-vector-to-mesh-no-gaps (-> obj nav) (-> obj root trans) s1-0 s4-0 s2-0) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s1-0 s4-0 s2-0) ) (cond ((-> s2-0 found-boundary) (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) - (-> obj controller turn-exit-point) - (-> obj controller path-prev-point) + (-> this controller turn-exit-point) + (-> this controller path-prev-point) ) ) - (s0-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 intersection) (-> obj controller path-prev-point))) + (s0-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 intersection) (-> this controller path-prev-point))) ) (vector-! (new 'stack-no-clear 'vector) s5-0 s4-0) (set! (-> s1-2 y) 0.0) @@ -821,12 +821,12 @@ This commonly includes things such as: (none) ) -(defmethod calc-danger-vec citizen ((obj citizen) (arg0 vector) (arg1 vector)) +(defmethod calc-danger-vec citizen ((this citizen) (arg0 vector) (arg1 vector)) (let ((s2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> obj root trans quad)) - (let ((a1-1 (-> obj nav state))) + (set! (-> s5-0 quad) (-> this root trans quad)) + (let ((a1-1 (-> this nav state))) (set! (-> s2-0 quad) (-> a1-1 heading quad)) ) (set! (-> s2-0 y) 0.0) @@ -840,11 +840,11 @@ This commonly includes things such as: 0.0 (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) - (-> obj controller turn-exit-point) - (-> obj controller path-prev-point) + (-> this controller turn-exit-point) + (-> this controller path-prev-point) ) ) - (s1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj controller path-prev-point))) + (s1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this controller path-prev-point))) ) (set! (-> s2-2 y) 0.0) (vector-xz-normalize! s2-2 1.0) @@ -883,35 +883,35 @@ This commonly includes things such as: (none) ) -(defmethod citizen-method-190 citizen ((obj citizen) (arg0 vector)) +(defmethod citizen-method-190 citizen ((this citizen) (arg0 vector)) (local-vars (sv-288 nav-poly) (sv-304 clamp-travel-vector-to-mesh-return-info) (sv-320 vector)) - (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (the-as vector (-> obj cp-sphere)))) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (the-as vector (-> this cp-sphere)))) (s4-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) ) 0.0 (set! (-> arg0 quad) (the-as uint128 0)) - (when (-> obj cp-valid?) - (set! (-> obj cp-valid?) #f) - (set! (-> s2-0 quad) (-> obj cp-vec quad)) + (when (-> this cp-valid?) + (set! (-> this cp-valid?) #f) + (set! (-> s2-0 quad) (-> this cp-vec quad)) (set! (-> s2-0 y) 0.0) (vector-xz-normalize! s2-0 1.0) (vector-rotate90-around-y! s2-0 s2-0) (set! (-> s3-1 y) 0.0) (vector-*! s4-0 s3-1 s2-0 (vector-dot s3-1 s2-0)) - (let ((f30-0 (- 1.0 (/ (vector-length s4-0) (vector-length (-> obj cp-vec)))))) - (vector+! s4-0 s4-0 (the-as vector (-> obj cp-sphere))) + (let ((f30-0 (- 1.0 (/ (vector-length s4-0) (vector-length (-> this cp-vec)))))) + (vector+! s4-0 s4-0 (the-as vector (-> this cp-sphere))) (let ((s0-0 (new 'stack-no-clear 'vector))) (set! sv-320 (new 'stack-no-clear 'vector)) (let ((s1-0 (new 'stack-no-clear 'vector))) (set! sv-304 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) - (set! sv-288 (-> obj nav state current-poly)) - (let ((f28-0 (+ (-> obj cp-sphere r) (-> obj nav-radius-backup)))) + (set! sv-288 (-> this nav state current-poly)) + (let ((f28-0 (+ (-> this cp-sphere r) (-> this nav-radius-backup)))) (when sv-288 (vector-normalize-copy! s0-0 s2-0 f28-0) (vector-normalize-copy! sv-320 s2-0 (- f28-0)) - (clamp-vector-to-mesh-no-gaps (-> obj nav) s4-0 sv-288 s0-0 sv-304) - (let ((a0-12 (-> obj nav)) + (clamp-vector-to-mesh-no-gaps (-> this nav) s4-0 sv-288 s0-0 sv-304) + (let ((a0-12 (-> this nav)) (t9-7 (method-of-type nav-control clamp-vector-to-mesh-no-gaps)) (a1-10 s4-0) (a3-3 sv-320) @@ -940,13 +940,13 @@ This commonly includes things such as: ) (set! (-> arg0 quad) (-> s1-0 quad)) (let ((a1-11 (new 'stack-no-clear 'vector))) - (set! (-> a1-11 quad) (-> obj root trans quad)) + (set! (-> a1-11 quad) (-> this root trans quad)) (set! (-> a1-11 y) 0.0) (let ((f0-15 (- f28-0 (vector-vector-xz-distance s4-0 a1-11)))) (if (< f0-15 0.0) (set! f0-15 0.0) ) - (vector-normalize! arg0 (* (-> obj cp-factor) f0-15 f30-0)) + (vector-normalize! arg0 (* (-> this cp-factor) f0-15 f30-0)) ) ) ) @@ -1061,13 +1061,13 @@ This commonly includes things such as: ) ) -(defmethod gen-clear-path citizen ((obj citizen)) +(defmethod gen-clear-path citizen ((this citizen)) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'iter-seg)) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> obj cp-vec quad)) - (set! (-> s4-0 quad) (-> obj root trans quad)) + (set! (-> s3-0 quad) (-> this cp-vec quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) (set! (-> s4-0 w) 81920.0) (set! (-> gp-0 seg) #f) (set! (-> gp-0 score) 0.0) @@ -1075,17 +1075,17 @@ This commonly includes things such as: (vector-rotate90-around-y! s3-0 s3-0) (vector-normalize! s3-0 1.0) (set! (-> gp-0 cp-plane quad) (-> s3-0 quad)) - (set! (-> gp-0 cp-plane w) (- (vector-dot s3-0 (the-as vector (-> obj cp-sphere))))) + (set! (-> gp-0 cp-plane w) (- (vector-dot s3-0 (the-as vector (-> this cp-sphere))))) ) - (when (< (vector4-dot (the-as vector (-> gp-0 cp-plane)) (-> obj root trans)) 0.0) + (when (< (vector4-dot (the-as vector (-> gp-0 cp-plane)) (-> this root trans)) 0.0) (set! (-> gp-0 cp-plane x) (- (-> gp-0 cp-plane x))) (set! (-> gp-0 cp-plane y) (- (-> gp-0 cp-plane y))) (set! (-> gp-0 cp-plane z) (- (-> gp-0 cp-plane z))) (set! (-> gp-0 cp-plane w) (- (-> gp-0 cp-plane w))) ) - (set! (-> gp-0 self) obj) + (set! (-> gp-0 self) this) (nav-segment-callback - obj + this s4-0 (the-as traffic-find-segment-struct gp-0) (the-as (function traffic-find-segment-struct nav-segment none) iter-seg-clear-path) @@ -1107,12 +1107,12 @@ This commonly includes things such as: ) ) -(defmethod citizen-method-192 citizen ((obj citizen)) - (when (-> obj cp-valid?) +(defmethod citizen-method-192 citizen ((this citizen)) + (when (-> this cp-valid?) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj cp-force quad)) + (set! (-> s4-0 quad) (-> this cp-force quad)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (let ((a1-0 (-> obj nav state))) + (let ((a1-0 (-> this nav state))) (set! (-> s5-0 quad) (-> a1-0 heading quad)) ) (set! (-> s5-0 y) 0.0) @@ -1120,9 +1120,9 @@ This commonly includes things such as: (vector-xz-normalize! s4-0 1.0) (when (< (fabs (vector-dot s4-0 s5-0)) (cos 14563.556)) (vector-negate! (new 'stack-no-clear 'vector) s5-0) - (let ((a1-6 (gen-clear-path obj))) + (let ((a1-6 (gen-clear-path this))) (if a1-6 - (citizen-method-186 obj a1-6) + (citizen-method-186 this a1-6) ) ) ) @@ -1165,20 +1165,20 @@ This commonly includes things such as: (none) ) -(defmethod gen-new-dir citizen ((obj citizen) (arg0 vector) (arg1 float)) +(defmethod gen-new-dir citizen ((this citizen) (arg0 vector) (arg1 float)) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'iter-seg)) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> obj cp-vec quad)) - (set! (-> s4-0 quad) (-> obj root trans quad)) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> this cp-vec quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) (set! (-> s4-0 w) arg1) (set! (-> gp-0 seg) #f) (set! (-> gp-0 score) 0.0) (set! (-> gp-0 desired-dir quad) (-> arg0 quad)) (vector-normalize! (-> gp-0 desired-dir) 1.0) - (set! (-> gp-0 self) obj) + (set! (-> gp-0 self) this) (nav-segment-callback - obj + this s4-0 (the-as traffic-find-segment-struct gp-0) (the-as (function traffic-find-segment-struct nav-segment none) iter-seg-new-dir) @@ -1201,11 +1201,11 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch int vs symbol. -(defmethod citizen-method-195 citizen ((obj citizen) (arg0 vector)) +(defmethod citizen-method-195 citizen ((this citizen) (arg0 vector)) (dotimes (s4-0 6) - (let ((a1-2 (gen-new-dir obj arg0 (* 81920.0 (the float (+ s4-0 1)))))) + (let ((a1-2 (gen-new-dir this arg0 (* 81920.0 (the float (+ s4-0 1)))))) (when a1-2 - (citizen-method-186 obj a1-2) + (citizen-method-186 this a1-2) (return (the-as symbol #f)) ) ) @@ -1213,14 +1213,14 @@ This commonly includes things such as: (the-as symbol 0) ) -(defmethod throw-off-vehicle citizen ((obj citizen)) - (let ((s4-0 (handle->process (-> obj vehicle)))) - (let ((v1-4 (-> obj root root-prim))) - (set! (-> v1-4 prim-core collide-as) (-> obj root backup-collide-as)) - (set! (-> v1-4 prim-core collide-with) (-> obj root backup-collide-with)) +(defmethod throw-off-vehicle citizen ((this citizen)) + (let ((s4-0 (handle->process (-> this vehicle)))) + (let ((v1-4 (-> this root root-prim))) + (set! (-> v1-4 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-4 prim-core collide-with) (-> this root backup-collide-with)) ) (when s4-0 - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> (the-as vehicle s4-0) root trans)))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> (the-as vehicle s4-0) root trans)))) (let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> (the-as vehicle s4-0) root quat))) (v1-10 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as vehicle s4-0) root quat))) ) @@ -1232,7 +1232,7 @@ This commonly includes things such as: (vector-normalize! s5-1 32768.0) (set! (-> s5-1 y) 71680.0) (vector+! s5-1 s5-1 (-> (the-as vehicle s4-0) root transv)) - (send-event obj 'attack #f (static-attack-info ((id (new-attack-id)) (vector s5-1) (knock (the-as uint 7))))) + (send-event this 'attack #f (static-attack-info ((id (new-attack-id)) (vector s5-1) (knock (the-as uint 7))))) ) ) ) @@ -1244,7 +1244,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1316,7 +1316,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1331,7 +1331,7 @@ This commonly includes things such as: '() ) :trans (behavior () - (if (and (-> self wait-return-state) (>= (- (current-time) (-> self state-time)) (-> self wait-time))) + (if (and (-> self wait-return-state) (time-elapsed? (-> self state-time) (-> self wait-time))) (go (-> self wait-return-state)) ) ) @@ -1361,7 +1361,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1399,13 +1399,13 @@ This commonly includes things such as: '() ) :trans (behavior () - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) (< (-> self root trans y) 4096.0) ) (go-virtual in-ditch) ) - (when (>= (- (current-time) (-> self state-time)) (-> self wait-time)) + (when (time-elapsed? (-> self state-time) (-> self wait-time)) (let ((f0-2 (-> self nav state speed))) (set! (-> self nav target-speed) (seek f0-2 0.0 (* 12288.0 (seconds-per-frame)))) ) @@ -1420,7 +1420,7 @@ This commonly includes things such as: (v1-36 (-> self root transv)) ) (if (< f0-8 (sqrtf (+ (* (-> v1-36 x) (-> v1-36 x)) (* (-> v1-36 z) (-> v1-36 z))))) - (set! (-> self cp-next-time) (current-time)) + (set-time! (-> self cp-next-time)) ) ) (when (< (+ (-> self cp-next-time) (seconds 2)) (current-time)) @@ -1431,7 +1431,7 @@ This commonly includes things such as: ) ) ) - (set! (-> self cp-next-time) (current-time)) + (set-time! (-> self cp-next-time)) (citizen-method-195 self a1-3) ) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc index 329387af4c..9043a8648d 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/civilian.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/civilian.gc @@ -96,59 +96,59 @@ ) -(defmethod get-run-anim civilian ((obj civilian)) - (if (and (-> obj next-state) (= (-> obj next-state name) 'flee)) - (-> obj anim-panic-run) - (-> obj anim-run) +(defmethod get-run-anim civilian ((this civilian)) + (if (and (-> this next-state) (= (-> this next-state name) 'flee)) + (-> this anim-panic-run) + (-> this anim-run) ) ) -(defmethod enemy-method-81 civilian ((obj civilian)) +(defmethod enemy-method-81 civilian ((this civilian)) #f ) ;; WARN: Return type mismatch object vs none. -(defmethod cleanup-for-death civilian ((obj civilian)) +(defmethod cleanup-for-death civilian ((this civilian)) (cond - ((zero? (-> obj hit-points)) - (logclear! (-> obj flags) (citizen-flag persistent)) - (send-event (ppointer->process (-> obj parent)) 'child-killed) + ((zero? (-> this hit-points)) + (logclear! (-> this flags) (citizen-flag persistent)) + (send-event (ppointer->process (-> this parent)) 'child-killed) (let ((a1-1 (new 'stack-no-clear 'traffic-danger-info))) - (set! (-> a1-1 sphere quad) (-> obj root trans quad)) + (set! (-> a1-1 sphere quad) (-> this root trans quad)) (set! (-> a1-1 sphere r) 40960.0) - (set! (-> a1-1 velocity quad) (-> obj root transv quad)) + (set! (-> a1-1 velocity quad) (-> this root transv quad)) (set! (-> a1-1 notify-radius) 122880.0) (set! (-> a1-1 danger-level) 1.0) (set! (-> a1-1 decay-rate) 0.0) (set! (-> a1-1 flags) (traffic-danger-flags tdf0)) (set! (-> a1-1 danger-type) (traffic-danger-type tdt7)) - (set! (-> a1-1 handle) (process->handle obj)) + (set! (-> a1-1 handle) (process->handle this)) (set! (-> a1-1 handle) (the-as handle #f)) - (add-danger (-> obj controller traffic) a1-1) + (add-danger (-> this controller traffic) a1-1) ) - (go-inactive obj) + (go-inactive this) ) (else - (set! (-> obj hit-points) (-> obj enemy-info default-hit-points)) - (set! (-> obj hit-points) (rand-vu-int-range 1 4)) - (set! (-> obj fated-time) 0) - (logior! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logior! (-> obj enemy-flags) (enemy-flag check-water)) - (logior! (-> obj enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) - (logclear! (-> obj focus-status) (focus-status dead)) - (logior! (-> obj mask) (process-mask collectable)) - (logior! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (if (zero? (-> obj hit-face)) - (go (method-of-object obj get-up-front)) - (go (method-of-object obj get-up-back)) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) + (set! (-> this hit-points) (rand-vu-int-range 1 4)) + (set! (-> this fated-time) 0) + (logior! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag check-water)) + (logior! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) + (logclear! (-> this focus-status) (focus-status dead)) + (logior! (-> this mask) (process-mask collectable)) + (logior! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (if (zero? (-> this hit-face)) + (go (method-of-object this get-up-front)) + (go (method-of-object this get-up-back)) ) ) ) (none) ) -(defmethod damage-amount-from-attack civilian ((obj civilian) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack civilian ((this civilian) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (cond ;; og:preserve-this constant @@ -166,7 +166,7 @@ 0 ) ((or (logtest? (process-mask enemy) (-> v1-0 mask)) (logtest? (process-mask guard) (-> v1-0 mask))) - ((method-of-type nav-enemy damage-amount-from-attack) obj arg0 arg1) + ((method-of-type nav-enemy damage-amount-from-attack) this arg0 arg1) ) (else 0 @@ -186,44 +186,44 @@ ) ) (else - ((method-of-type nav-enemy damage-amount-from-attack) obj arg0 arg1) + ((method-of-type nav-enemy damage-amount-from-attack) this arg0 arg1) ) ) ) -(defmethod enemy-method-108 civilian ((obj civilian) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 civilian ((this civilian) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile civilian ((obj civilian)) - (cleanup-for-death obj) +(defmethod go-hostile civilian ((this civilian)) + (cleanup-for-death this) ) ;; WARN: Return type mismatch none vs object. -(defmethod kill-prefer-falling civilian ((obj civilian)) +(defmethod kill-prefer-falling civilian ((this civilian)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (cleanup-for-death obj) + (cleanup-for-death this) ) -(defmethod set-behavior! civilian ((obj civilian) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! civilian ((this civilian) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-0 2) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ((= v1-0 3) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) ((= v1-0 7) - (logior! (-> obj flags) (citizen-flag persistent)) - (go (method-of-object obj wait-for-ride)) + (logior! (-> this flags) (citizen-flag persistent)) + (go (method-of-object this wait-for-ride)) ) (else - (go-inactive obj) + (go-inactive this) ) ) ) @@ -231,36 +231,36 @@ (none) ) -(defmethod citizen-init! civilian ((obj civilian)) +(defmethod citizen-init! civilian ((this civilian)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj mask) (the-as process-mask (logior (process-mask civilian) (-> obj mask)))) - (set! (-> obj hit-points) (rand-vu-int-range 1 4)) - (set! (-> obj hit-points) 4) - (set! (-> obj fact pickup-type) (pickup-type none)) - (set! (-> obj fact pickup-amount) 0.0) - (set! (-> obj fact pickup-spawn-amount) 0.0) + (set! (-> this mask) (the-as process-mask (logior (process-mask civilian) (-> this mask)))) + (set! (-> this hit-points) (rand-vu-int-range 1 4)) + (set! (-> this hit-points) 4) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) + (set! (-> this fact pickup-spawn-amount) 0.0) 0 (none) ) ;; WARN: Return type mismatch nav-segment vs none. -(defmethod civilian-method-215 civilian ((obj civilian) (arg0 vector)) +(defmethod civilian-method-215 civilian ((this civilian) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> obj root trans quad)) + (set! (-> v1-0 quad) (-> this root trans quad)) (set! (-> v1-0 w) 81920.0) - (let ((s5-0 (find-segment obj v1-0 arg0))) + (let ((s5-0 (find-segment this v1-0 arg0))) (if s5-0 - (citizen-method-186 obj s5-0) + (citizen-method-186 this s5-0) ) ) ) (none) ) -(defmethod general-event-handler civilian ((obj civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler civilian ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -271,109 +271,109 @@ #f ) (('touched) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) (('panic) (let ((a0-6 (-> arg3 param 0))) - (set! (-> obj danger-pos quad) (-> (the-as sphere (+ a0-6 0)) quad)) + (set! (-> this danger-pos quad) (-> (the-as sphere (+ a0-6 0)) quad)) ) - (if (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) - (or (= v1-6 'active) (= v1-6 'wait) (= v1-6 'avoid-danger)) - ) + (if (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'active) (= v1-6 'wait) (= v1-6 'avoid-danger)) + ) ) - (go (method-of-object obj flee)) + (go (method-of-object this flee)) ) ) (('event-death) - (if (zero? (-> obj hit-points)) - (do-effect (-> obj skel effect) 'death-default 0.0 -1) + (if (zero? (-> this hit-points)) + (do-effect (-> this skel effect) 'death-default 0.0 -1) ) ) (('avoid) - (set! (-> obj last-danger-time) (current-time)) + (set-time! (-> this last-danger-time)) (let ((a0-15 (-> arg3 param 0))) - (set! (-> obj danger-pos quad) (-> (the-as vector (+ a0-15 0)) quad)) + (set! (-> this danger-pos quad) (-> (the-as vector (+ a0-15 0)) quad)) ) - (if (and (-> obj next-state) (let ((v1-18 (-> obj next-state name))) - (or (= v1-18 'active) (= v1-18 'wait)) - ) + (if (and (-> this next-state) (let ((v1-18 (-> this next-state name))) + (or (= v1-18 'active) (= v1-18 'wait)) + ) ) - (go (method-of-object obj avoid-danger)) + (go (method-of-object this avoid-danger)) ) ) (('clear-path) - (set! (-> obj last-danger-time) (current-time)) + (set-time! (-> this last-danger-time)) (let ((v1-23 (the-as traffic-danger-info (-> arg3 param 0)))) - (set! (-> obj cp-valid?) #t) - (set! (-> obj cp-sphere quad) (-> v1-23 sphere quad)) - (set! (-> obj cp-vec quad) (-> v1-23 velocity quad)) + (set! (-> this cp-valid?) #t) + (set! (-> this cp-sphere quad) (-> v1-23 sphere quad)) + (set! (-> this cp-vec quad) (-> v1-23 velocity quad)) (case (-> v1-23 danger-type) (((traffic-danger-type tdt0)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 20.0) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 20.0) ) (((traffic-danger-type tdt1)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 20.0) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 20.0) ) (((traffic-danger-type tdt2)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) ) (((traffic-danger-type tdt3)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) ) (((traffic-danger-type tdt4)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 2.0) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 2.0) ) (((traffic-danger-type tdt5)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) ) (((traffic-danger-type tdt6)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) ) ) ) - (let ((s5-1 (-> obj cp-plane))) - (set! (-> s5-1 quad) (-> obj cp-vec quad)) + (let ((s5-1 (-> this cp-plane))) + (set! (-> s5-1 quad) (-> this cp-vec quad)) (set! (-> s5-1 y) 0.0) (vector-rotate90-around-y! s5-1 s5-1) (vector-normalize! s5-1 1.0) - (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> obj cp-sphere))))) + (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> this cp-sphere))))) ) - (set! (-> obj cp-exit-time) (+ (current-time) (seconds 4))) - (if (and (-> obj next-state) (let ((v1-54 (-> obj next-state name))) - (or (= v1-54 'active) (= v1-54 'wait) (= v1-54 'avoid-danger)) - ) + (set! (-> this cp-exit-time) (+ (current-time) (seconds 4))) + (if (and (-> this next-state) (let ((v1-54 (-> this next-state name))) + (or (= v1-54 'active) (= v1-54 'wait) (= v1-54 'avoid-danger)) + ) ) - (go (method-of-object obj clear-path)) + (go (method-of-object this clear-path)) ) ) (('hit 'hit-flinch 'hit-knocked) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (if (logtest? (-> obj flags) (citizen-flag female)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-27)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-19)) + (speech-control-method-13 *speech-control* (the-as handle this)) + (if (logtest? (-> this flags) (citizen-flag female)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-27)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-19)) ) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) (('end-task) - (let ((v0-0 (the-as object (logclear (-> obj flags) (citizen-flag persistent))))) - (set! (-> obj flags) (the-as citizen-flag v0-0)) + (let ((v0-0 (the-as object (logclear (-> this flags) (citizen-flag persistent))))) + (set! (-> this flags) (the-as citizen-flag v0-0)) v0-0 ) ) (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod civilian-method-214 civilian ((obj civilian) (arg0 nav-branch) (arg1 int) (arg2 vector) (arg3 float)) +(defmethod civilian-method-214 civilian ((this civilian) (arg0 nav-branch) (arg1 int) (arg2 vector) (arg3 float)) (when (nonzero? arg1) (-> arg0 src-node) (let* ((s3-0 (-> arg0 dest-node)) @@ -389,7 +389,7 @@ (f30-0 0.0) ) (dotimes (s0-0 s2-0) - (+! f30-0 (civilian-method-214 obj (-> s3-0 branch-array s0-0) (+ arg1 -1) arg2 s1-0)) + (+! f30-0 (civilian-method-214 this (-> s3-0 branch-array s0-0) (+ arg1 -1) arg2 s1-0)) ) ;; og:preserve-this changed to fix a divide by zero crash (set! arg3 (+ s1-0 (the float (/-0-guard (the int f30-0) s2-0)))) @@ -500,7 +500,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -545,7 +545,7 @@ (speech-control-method-12 *speech-control* self (speech-type speech-type-16)) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.1)) (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) (< (-> self root trans y) 4096.0) ) @@ -712,7 +712,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -889,7 +889,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -976,10 +976,10 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-dive civilian ((obj civilian)) - (if (< (-> obj nav state speed) 8192.0) - (go (method-of-object obj on-ground)) - (go (method-of-object obj dive)) +(defmethod go-dive civilian ((this civilian)) + (if (< (-> this nav state speed) 8192.0) + (go (method-of-object this on-ground)) + (go (method-of-object this dive)) ) (none) ) @@ -988,7 +988,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1047,7 +1047,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1145,7 +1145,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1237,7 +1237,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1288,7 +1288,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1381,7 +1381,7 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -1425,7 +1425,7 @@ ) :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 self)) (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) @@ -1478,17 +1478,17 @@ ) ) -(defmethod civilian-method-217 civilian ((obj civilian) (arg0 vector)) - (let ((s3-0 (handle->process (-> obj vehicle))) +(defmethod civilian-method-217 civilian ((this civilian) (arg0 vector)) + (let ((s3-0 (handle->process (-> this vehicle))) (s4-0 (new 'stack 'collide-query)) ) - (compute-seat-position (the-as vehicle s3-0) arg0 (-> obj seat)) + (compute-seat-position (the-as vehicle s3-0) arg0 (-> this seat)) (vector-! arg0 arg0 (-> (the-as vehicle s3-0) root trans)) (vector-normalize! arg0 (+ 14336.0 (vector-length arg0))) (vector+! arg0 arg0 (-> (the-as vehicle s3-0) root trans)) - (when (enemy-above-ground? obj s4-0 arg0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (when (enemy-above-ground? this s4-0 arg0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> arg0 y) (-> s4-0 best-other-tri intersect y)) - (let ((v1-14 (-> obj nav)) + (let ((v1-14 (-> this nav)) (a1-10 (new 'stack-no-clear 'nav-find-poly-parms)) ) (vector-! (-> a1-10 point) arg0 (-> v1-14 state mesh bounds)) @@ -1578,7 +1578,7 @@ ) :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-4 enemy-flags))) (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-4 enemy-flags)))) @@ -1691,7 +1691,7 @@ ) :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-5 (-> self root root-prim))) (set! (-> v1-5 prim-core collide-as) (collide-spec)) (set! (-> v1-5 prim-core collide-with) (collide-spec)) @@ -1817,7 +1817,7 @@ (let ((a0-1 (the-as object (-> block param 0)))) (set! (-> self event-param-point quad) (-> (the-as vector a0-1) quad)) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (go-virtual exit-vehicle) ) ) @@ -1831,7 +1831,7 @@ ) :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-5 (-> self root root-prim))) (set! (-> v1-5 prim-core collide-as) (collide-spec)) (set! (-> v1-5 prim-core collide-with) (collide-spec)) @@ -1907,7 +1907,7 @@ (set! (-> self gnd-height) (-> self root gspot-pos y)) (logior! (-> self flags) (citizen-flag persistent)) (logior! (-> self focus-status) (focus-status pilot-riding pilot)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-28 (-> self root root-prim))) (set! (-> v1-28 prim-core collide-as) (collide-spec)) (set! (-> v1-28 prim-core collide-with) (collide-spec)) @@ -2033,7 +2033,7 @@ :event enemy-event-handler :enter (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 self)) (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/goal_src/jak2/levels/city/traffic/citizen/guard.gc b/goal_src/jak2/levels/city/traffic/citizen/guard.gc index 7aa9f2432b..a565e26199 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/guard.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/guard.gc @@ -324,7 +324,7 @@ ) -(defmethod crimson-guard-method-218 crimson-guard ((obj crimson-guard) (arg0 vector)) +(defmethod crimson-guard-method-218 crimson-guard ((this crimson-guard) (arg0 vector)) (local-vars (sv-240 vector) (sv-256 (function vector vector vector)) @@ -343,7 +343,7 @@ (init-vf0-vector) (set! sv-240 arg0) (let ((s0-0 (new 'stack-no-clear 'vector))) - (let ((v1-1 (-> obj root trans))) + (let ((v1-1 (-> this root trans))) (let ((a0-1 *y-vector*)) (let ((a1-2 8192.0)) (.mov vf7 a1-2) @@ -362,14 +362,14 @@ (s2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (-> obj node-list data 4 bone transform) - (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (-> this node-list data 4 bone transform) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) - (set! (-> s0-0 quad) (-> obj root trans quad)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (set! (-> s0-0 quad) (-> this root trans quad)) (cond - ((logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + ((logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) (let ((a1-6 s0-0)) (let ((v1-14 s0-0)) (let ((a0-9 s4-0)) @@ -432,7 +432,7 @@ (vector+! sv-288 sv-288 v0-5) ) (vector-normalize! (vector-! sv-320 sv-288 s0-0) 1.0) - (vector-z-quaternion! sv-304 (-> obj root quat)) + (vector-z-quaternion! sv-304 (-> this root quat)) (rot-zxy-from-vector! s2-0 sv-304) (rot-zxy-from-vector! s1-0 sv-320) (set! (-> s5-0 x) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 x) (-> s2-0 x))))) @@ -444,7 +444,7 @@ (quaternion-vector-angle! s1-1 s3-0 (-> s5-0 y)) (quaternion*! s2-1 s1-1 s2-1) ) - (quaternion-pseudo-seek (-> obj joint quat) (-> obj joint quat) s2-1 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) s2-1 (seconds-per-frame)) ) ) ) @@ -454,110 +454,110 @@ ) ) -(defmethod crimson-guard-method-219 crimson-guard ((obj crimson-guard)) - (quaternion-pseudo-seek (-> obj joint quat) (-> obj joint quat) *unity-quaternion* (seconds-per-frame)) +(defmethod crimson-guard-method-219 crimson-guard ((this crimson-guard)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) *unity-quaternion* (seconds-per-frame)) 0 (none) ) (define *guard-min-id-hack* 255) -(defmethod track-target! crimson-guard ((obj crimson-guard)) +(defmethod track-target! crimson-guard ((this crimson-guard)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type citizen track-target!))) - (t9-0 obj) + (t9-0 this) ) - (update-transforms (-> obj root)) - (if (< (-> obj traffic-id) *guard-min-id-hack*) - (set! *guard-min-id-hack* (-> obj traffic-id)) + (update-transforms (-> this root)) + (if (< (-> this traffic-id) *guard-min-id-hack*) + (set! *guard-min-id-hack* (-> this traffic-id)) ) - (if (-> obj joint-enable) - (crimson-guard-method-218 obj (-> obj target-pos-predict-miss)) - (crimson-guard-method-219 obj) + (if (-> this joint-enable) + (crimson-guard-method-218 this (-> this target-pos-predict-miss)) + (crimson-guard-method-219 this) ) (none) ) -(defmethod kill-prefer-falling crimson-guard ((obj crimson-guard)) +(defmethod kill-prefer-falling crimson-guard ((this crimson-guard)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - ((method-of-type nav-enemy kill-prefer-falling) obj) + ((method-of-type nav-enemy kill-prefer-falling) this) ) -(defmethod react-to-focus crimson-guard ((obj crimson-guard)) +(defmethod react-to-focus crimson-guard ((this crimson-guard)) "@TODO - flesh out docs" - (if (not (logtest? (-> obj flags) (citizen-flag hostile))) - (go (method-of-object obj active)) - (go-hostile obj) + (if (not (logtest? (-> this flags) (citizen-flag hostile))) + (go (method-of-object this active)) + (go-hostile this) ) ) -(defmethod damage-amount-from-attack crimson-guard ((obj crimson-guard) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack crimson-guard ((this crimson-guard) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" - (let ((v0-0 ((method-of-type nav-enemy damage-amount-from-attack) obj arg0 arg1))) + (let ((v0-0 ((method-of-type nav-enemy damage-amount-from-attack) this arg0 arg1))) (-> arg1 param 1) v0-0 ) ) ;; WARN: disable def twice: 122. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler crimson-guard ((obj crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler crimson-guard ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (logior! (-> obj flags) (citizen-flag hostile)) - (let* ((s0-0 (handle->process (-> obj incoming attacker-handle))) + (speech-control-method-13 *speech-control* (the-as handle this)) + (logior! (-> this flags) (citizen-flag hostile)) + (let* ((s0-0 (handle->process (-> this incoming attacker-handle))) (s1-0 (if (type? s0-0 process-focusable) s0-0 ) ) ) (when s1-0 - (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) - (trigger-alert obj 1 (the-as target s1-0)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-11)) + (trigger-alert this 1 (the-as target s1-0)) ) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('event-death) - (if (zero? (-> obj hit-points)) - (do-effect (-> obj skel effect) 'death-default 0.0 -1) + (if (zero? (-> this hit-points)) + (do-effect (-> this skel effect) 'death-default 0.0 -1) ) ) (('bouncing-off) - (when (or (and (-> obj next-state) (= (-> obj next-state name) 'active)) - (and (-> obj next-state) (= (-> obj next-state name) 'wait)) + (when (or (and (-> this next-state) (= (-> this next-state name) 'active)) + (and (-> this next-state) (= (-> this next-state name) 'wait)) ) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-14)) - (go (method-of-object obj close-attack-active)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-14)) + (go (method-of-object this close-attack-active)) ) ) (('combo) - (and (not (and (-> obj next-state) (= (-> obj next-state name) 'inactive))) - (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) + (and (not (and (-> this next-state) (= (-> this next-state name) 'inactive))) + (and (not (logtest? (enemy-flag multi-focus) (-> this enemy-flags))) (nonzero? (-> this hit-points))) ) ) (('avoid) #f ) (('panic) - (set! (-> obj last-danger-time) (current-time)) + (set-time! (-> this last-danger-time)) (let ((v1-38 (the-as traffic-danger-info (-> arg3 param 0)))) (case (-> v1-38 danger-type) (((traffic-danger-type tdt7)) - (set! (-> obj cp-factor) 20.0) - (let ((s5-1 (method-of-object obj trigger-alert)) + (set! (-> this cp-factor) 20.0) + (let ((s5-1 (method-of-object this trigger-alert)) (s4-1 1) (s3-1 (handle->process (-> v1-38 handle))) ) - (s5-1 obj s4-1 (the-as target (if (type? s3-1 process-focusable) - s3-1 - ) - ) + (s5-1 this s4-1 (the-as target (if (type? s3-1 process-focusable) + s3-1 + ) + ) ) ) ) @@ -565,14 +565,14 @@ ) ) (('clear-path) - (set! (-> obj last-danger-time) (current-time)) + (set-time! (-> this last-danger-time)) (let ((v1-44 (the-as traffic-danger-info (-> arg3 param 0)))) - (set! (-> obj cp-valid?) #t) - (set! (-> obj cp-sphere quad) (-> v1-44 sphere quad)) - (set! (-> obj cp-vec quad) (-> v1-44 velocity quad)) + (set! (-> this cp-valid?) #t) + (set! (-> this cp-sphere quad) (-> v1-44 sphere quad)) + (set! (-> this cp-vec quad) (-> v1-44 velocity quad)) (case (-> v1-44 danger-type) (((traffic-danger-type tdt0)) - (trigger-alert obj 1 *target*) + (trigger-alert this 1 *target*) ) (((traffic-danger-type tdt1)) ) @@ -587,58 +587,58 @@ (((traffic-danger-type tdt6)) ) (((traffic-danger-type tdt7)) - (trigger-alert obj 1 *target*) + (trigger-alert this 1 *target*) ) ) ) - (let ((s5-2 (-> obj cp-plane))) - (set! (-> s5-2 quad) (-> obj cp-vec quad)) + (let ((s5-2 (-> this cp-plane))) + (set! (-> s5-2 quad) (-> this cp-vec quad)) (set! (-> s5-2 y) 0.0) (vector-rotate90-around-y! s5-2 s5-2) (vector-normalize! s5-2 1.0) - (set! (-> s5-2 w) (- (vector-dot (the-as vector s5-2) (the-as vector (-> obj cp-sphere))))) + (set! (-> s5-2 w) (- (vector-dot (the-as vector s5-2) (the-as vector (-> this cp-sphere))))) ) (let ((v0-4 (the-as object (+ (current-time) (seconds 1))))) - (set! (-> obj cp-exit-time) (the-as time-frame v0-4)) + (set! (-> this cp-exit-time) (the-as time-frame v0-4)) v0-4 ) ) (('end-pursuit) (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> obj pid)) + (when (focus-test? this inactive) + (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> this pid)) (break!) 0 ) ) - (when (not (focus-test? obj dead)) - (when (logtest? (-> obj flags) (citizen-flag hostile)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (go (method-of-object obj active)) + (when (not (focus-test? this dead)) + (when (logtest? (-> this flags) (citizen-flag hostile)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (citizen-method-195 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) ) ) ) (('alert-begin) (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> obj pid)) + (when (focus-test? this inactive) + (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> this pid)) (break!) 0 ) ) - (when (not (focus-test? obj dead)) - (when (not (logtest? (-> obj flags) (citizen-flag hostile))) + (when (not (focus-test? this dead)) + (when (not (logtest? (-> this flags) (citizen-flag hostile))) (let ((a1-27 (the-as object (-> arg3 param 0)))) (when (and (the-as uint a1-27) (not (logtest? (-> (the-as process-focusable a1-27) focus-status) (focus-status disable dead inactive))) ) - (set! (-> obj traffic-target-status handle) (process->handle (the-as process-focusable a1-27))) - (try-update-focus (-> obj focus) (the-as process-focusable a1-27) obj) - (if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'jump))) - (not (and (-> obj next-state) (= (-> obj next-state name) 'exit-transport))) + (set! (-> this traffic-target-status handle) (process->handle (the-as process-focusable a1-27))) + (try-update-focus (-> this focus) (the-as process-focusable a1-27) this) + (if (and (not (and (-> this next-state) (= (-> this next-state name) 'jump))) + (not (and (-> this next-state) (= (-> this next-state name) 'exit-transport))) ) - (go-hostile obj) + (go-hostile this) ) ) ) @@ -647,25 +647,25 @@ ) (('alert-end) (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> obj pid)) + (when (focus-test? this inactive) + (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> this pid)) (break!) 0 ) ) - (when (not (focus-test? obj dead)) - (when (logtest? (-> obj flags) (citizen-flag hostile)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-5)) - (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (go (method-of-object obj active)) + (when (not (focus-test? this dead)) + (when (logtest? (-> this flags) (citizen-flag hostile)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-5)) + (citizen-method-195 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) ) ) ) (('track) - (if (and (-> obj next-state) (let ((v1-129 (-> obj next-state name))) - (or (= v1-129 'exit-transport) (= v1-129 'jump)) - ) + (if (and (-> this next-state) (let ((v1-129 (-> this next-state name))) + (or (= v1-129 'exit-transport) (= v1-129 'jump)) + ) ) #f #t @@ -679,19 +679,19 @@ (when (logtest? (-> (the-as process-focusable v1-130) mask) (process-mask target)) (when (focus-test? (the-as process-focusable v1-130) dead) (format #t "guard killed player~%") - (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-10)) ) ) ) ) ) (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod get-inv-mass crimson-guard ((obj crimson-guard)) +(defmethod get-inv-mass crimson-guard ((this crimson-guard)) 0.6666667 ) @@ -699,7 +699,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -760,7 +760,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -868,51 +868,51 @@ ) ) -(defmethod enemy-method-77 crimson-guard ((obj crimson-guard) (arg0 (pointer float))) +(defmethod enemy-method-77 crimson-guard ((this crimson-guard) (arg0 (pointer float))) (cond - ((logtest? (-> obj flags) (citizen-flag knocked-out-car)) + ((logtest? (-> this flags) (citizen-flag knocked-out-car)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 42))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 42))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 42)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 42)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 42)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 42)) num-func-seek!) ) - (logclear! (-> obj flags) (citizen-flag knocked-out-car)) + (logclear! (-> this flags) (citizen-flag knocked-out-car)) ) - ((logtest? (-> obj flags) (citizen-flag knocked-out-bike)) + ((logtest? (-> this flags) (citizen-flag knocked-out-bike)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 43))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 43))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 43)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 43)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 43)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 43)) num-func-seek!) ) - (logclear! (-> obj flags) (citizen-flag knocked-out-bike)) + (logclear! (-> this flags) (citizen-flag knocked-out-bike)) ) ((begin - (let ((v1-37 (-> obj root transv))) + (let ((v1-37 (-> this root transv))) (cond ((< (sqrtf (+ (* (-> v1-37 x) (-> v1-37 x)) (* (-> v1-37 z) (-> v1-37 z)))) 32768.0) - (set! (-> obj small-hit) 1) + (set! (-> this small-hit) 1) ) (else - (set! (-> obj small-hit) 0) + (set! (-> this small-hit) 0) 0 ) ) ) - (<= (-> obj hit-points) 0) + (<= (-> this hit-points) 0) ) (ja-channel-push! 1 (seconds 0.01)) - (let ((a1-6 (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) - (a0-11 (-> obj skel root-channel 0)) + (let ((a1-6 (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + (a0-11 (-> this skel root-channel 0)) ) (set! (-> a0-11 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-11 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) @@ -922,19 +922,19 @@ ) ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-5) (knocked-type knocked-type-7)) (ja-channel-push! 1 (seconds 0.01)) (cond - ((= (-> obj small-hit) 1) - (set! (-> obj yellow-anim) (the-as uint (get-rand-int obj 2))) - (let ((a1-12 (-> obj + ((= (-> this small-hit) 1) + (set! (-> this yellow-anim) (the-as uint (get-rand-int this 2))) + (let ((a1-12 (-> this draw art-group data (-> (the-as guard-global-info - (+ (+ (* (-> obj hit-face) 4) (* (-> obj yellow-anim) 8)) (the-as uint (-> obj info))) + (+ (+ (* (-> this hit-face) 4) (* (-> this yellow-anim) 8)) (the-as uint (-> this info))) ) yellow-hit-anim 0 @@ -942,7 +942,7 @@ ) ) ) - (a0-23 (-> obj skel root-channel 0)) + (a0-23 (-> this skel root-channel 0)) ) (set! (-> a0-23 frame-group) (the-as art-joint-anim a1-12)) (set! (-> a0-23 param 0) (the float (+ (-> (the-as art-joint-anim a1-12) frames num-frames) -1))) @@ -952,8 +952,8 @@ ) ) (else - (let ((a1-13 (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) - (a0-27 (-> obj skel root-channel 0)) + (let ((a1-13 (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + (a0-27 (-> this skel root-channel 0)) ) (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-13)) (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-13) frames num-frames) -1))) @@ -966,21 +966,21 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-30 (-> obj skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> obj draw art-group data 10))) + (let ((a0-30 (-> this skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> this draw art-group data 10))) (set! (-> a0-30 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 10)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1)) ) (set! (-> a0-30 param 1) (-> arg0 0)) (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> obj draw art-group data 10)) num-func-seek!) + (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!) ) ) (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-17 (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))))) + (let ((a1-17 (-> this draw art-group data (-> this info knocked (-> this hit-face))))) (set! (-> arg0 0) (* 0.5 (-> arg0 0))) - (let ((a0-36 (-> obj skel root-channel 0))) + (let ((a0-36 (-> this skel root-channel 0))) (set! (-> a0-36 frame-group) (the-as art-joint-anim a1-17)) (set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-17) frames num-frames) -1))) (set! (-> a0-36 param 1) (-> arg0 0)) @@ -991,8 +991,8 @@ ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-19 (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) - (a0-41 (-> obj skel root-channel 0)) + (let ((a1-19 (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + (a0-41 (-> this skel root-channel 0)) ) (set! (-> a0-41 frame-group) (the-as art-joint-anim a1-19)) (set! (-> a0-41 param 0) (the float (+ (-> (the-as art-joint-anim a1-19) frames num-frames) -1))) @@ -1007,12 +1007,12 @@ #t ) -(defmethod enemy-method-78 crimson-guard ((obj crimson-guard) (arg0 (pointer float))) +(defmethod enemy-method-78 crimson-guard ((this crimson-guard) (arg0 (pointer float))) (cond - ((<= (-> obj hit-points) 0) + ((<= (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) - (a0-5 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + (a0-5 (-> this skel root-channel 0)) ) (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -1020,22 +1020,22 @@ (set! (-> a0-5 frame-num) 0.0) (joint-control-channel-group! a0-5 (the-as art-joint-anim a1-2) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-5) (knocked-type knocked-type-7)) (ja-channel-push! 1 (seconds 0.1)) (cond - ((= (-> obj small-hit) 1) - (let ((a1-7 (-> obj + ((= (-> this small-hit) 1) + (let ((a1-7 (-> this draw art-group data (-> (the-as guard-global-info - (+ (+ (* (-> obj hit-face) 4) (* (-> obj yellow-anim) 8)) (the-as uint (-> obj info))) + (+ (+ (* (-> this hit-face) 4) (* (-> this yellow-anim) 8)) (the-as uint (-> this info))) ) yellow-land-anim 0 @@ -1043,7 +1043,7 @@ ) ) ) - (a0-16 (-> obj skel root-channel 0)) + (a0-16 (-> this skel root-channel 0)) ) (set! (-> a0-16 frame-group) (the-as art-joint-anim a1-7)) (set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) @@ -1051,12 +1051,12 @@ (set! (-> a0-16 frame-num) 0.0) (joint-control-channel-group! a0-16 (the-as art-joint-anim a1-7) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else - (let ((a1-8 (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) - (a0-20 (-> obj skel root-channel 0)) + (let ((a1-8 (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + (a0-20 (-> this skel root-channel 0)) ) (set! (-> a0-20 frame-group) (the-as art-joint-anim a1-8)) (set! (-> a0-20 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1))) @@ -1070,23 +1070,23 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-23 (-> obj skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> obj draw art-group data 11))) + (let ((a0-23 (-> this skel root-channel 0))) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 11)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) ) (set! (-> a0-23 param 1) (-> arg0 0)) (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> obj draw art-group data 11)) num-func-seek!) + (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-12 (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face))))) + (let ((a1-12 (-> this draw art-group data (-> this info knocked-land (-> this hit-face))))) (set! (-> arg0 0) 1.0) - (let ((a0-28 (-> obj skel root-channel 0))) + (let ((a0-28 (-> this skel root-channel 0))) (set! (-> a0-28 frame-group) (the-as art-joint-anim a1-12)) (set! (-> a0-28 param 0) (the float (+ (-> (the-as art-joint-anim a1-12) frames num-frames) -1))) (set! (-> a0-28 param 1) (-> arg0 0)) @@ -1101,16 +1101,16 @@ ) ) -(defmethod set-behavior! crimson-guard ((obj crimson-guard) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! crimson-guard ((this crimson-guard) (arg0 traffic-object-spawn-params)) (let ((a1-1 (-> arg0 guard-type))) - (if (or (and (!= a1-1 7) (!= a1-1 (-> obj guard-type))) (= (-> arg0 behavior) 11)) - (crimson-guard-method-225 obj a1-1 (= (-> arg0 behavior) 11)) + (if (or (and (!= a1-1 7) (!= a1-1 (-> this guard-type))) (= (-> arg0 behavior) 11)) + (crimson-guard-method-225 this a1-1 (= (-> arg0 behavior) 11)) ) ) (case (-> arg0 behavior) ((5) - (logior! (-> obj flags) (citizen-flag persistent hostile)) - (let ((s4-0 (-> obj focus)) + (logior! (-> this flags) (citizen-flag persistent hostile)) + (let ((s4-0 (-> this focus)) (s3-0 (method-of-type enemy-focus enemy-focus-method-13)) (s5-1 (handle->process (-> arg0 handle))) ) @@ -1123,58 +1123,58 @@ (enemy-aware enemy-aware-3) ) ) - (go (method-of-object obj arrest)) + (go (method-of-object this arrest)) ) ((6) - (logior! (-> obj flags) (citizen-flag persistent)) - (logior! (-> obj flags) (citizen-flag hostile)) - (set! (-> obj transport) (-> arg0 handle)) - (set! (-> obj transport-side) (-> arg0 user-data)) - (crimson-guard-method-223 obj 0.0) - (let* ((s4-1 (-> obj controller traffic)) + (logior! (-> this flags) (citizen-flag persistent)) + (logior! (-> this flags) (citizen-flag hostile)) + (set! (-> this transport) (-> arg0 handle)) + (set! (-> this transport-side) (-> arg0 user-data)) + (crimson-guard-method-223 this 0.0) + (let* ((s4-1 (-> this controller traffic)) (s5-2 (get-target s4-1)) ) (if (and (>= (the-as uint (get-alert-level s4-1)) (the-as uint 1)) s5-2) - (try-update-focus (-> obj focus) s5-2 obj) + (try-update-focus (-> this focus) s5-2 this) ) ) - (go (method-of-object obj exit-transport)) + (go (method-of-object this exit-transport)) ) ((9) - (logior! (-> obj flags) (citizen-flag persistent)) - (set! (-> obj focus handle) (-> arg0 handle)) - (set! (-> obj traffic-target-status handle) (-> arg0 handle)) - (go (method-of-object obj waiting-ambush)) + (logior! (-> this flags) (citizen-flag persistent)) + (set! (-> this focus handle) (-> arg0 handle)) + (set! (-> this traffic-target-status handle) (-> arg0 handle)) + (go (method-of-object this waiting-ambush)) ) ((3) - (set! (-> obj focus handle) (-> arg0 handle)) - (set! (-> obj traffic-target-status handle) (-> arg0 handle)) - (go (method-of-object obj hostile)) + (set! (-> this focus handle) (-> arg0 handle)) + (set! (-> this traffic-target-status handle) (-> arg0 handle)) + (go (method-of-object this hostile)) ) ((11) - (set! (-> obj root trans quad) (-> arg0 position quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 rotation)) - (set! (-> obj vehicle) (-> arg0 handle)) + (set! (-> this root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> this root quat) (-> arg0 rotation)) + (set! (-> this vehicle) (-> arg0 handle)) (ja-channel-set! 1) - (case (-> (the-as vehicle (handle->process (-> obj vehicle))) info object-type) + (case (-> (the-as vehicle (handle->process (-> this vehicle))) info object-type) ((11 12 13 18) - (logior! (-> obj flags) (citizen-flag knocked-out-bike)) - (let ((v1-64 (-> obj skel root-channel 0))) - (set! (-> v1-64 frame-group) (the-as art-joint-anim (-> obj draw art-group data 35))) + (logior! (-> this flags) (citizen-flag knocked-out-bike)) + (let ((v1-64 (-> this skel root-channel 0))) + (set! (-> v1-64 frame-group) (the-as art-joint-anim (-> this draw art-group data 35))) ) ) ((14 15 16 19) - (logior! (-> obj flags) (citizen-flag knocked-out-car)) - (let ((v1-70 (-> obj skel root-channel 0))) - (set! (-> v1-70 frame-group) (the-as art-joint-anim (-> obj draw art-group data 36))) + (logior! (-> this flags) (citizen-flag knocked-out-car)) + (let ((v1-70 (-> this skel root-channel 0))) + (set! (-> v1-70 frame-group) (the-as art-joint-anim (-> this draw art-group data 36))) ) ) ) (ja-post) - (go (method-of-object obj knocked-off-vehicle)) + (go (method-of-object this knocked-off-vehicle)) ) (else - ((method-of-type citizen set-behavior!) obj arg0) + ((method-of-type citizen set-behavior!) this arg0) ) ) 0 @@ -1194,44 +1194,44 @@ ) ;; WARN: Return type mismatch int vs object. -(defmethod go-hostile crimson-guard ((obj crimson-guard)) +(defmethod go-hostile crimson-guard ((this crimson-guard)) (cond - ((handle->process (-> obj focus handle)) - (logior! (-> obj flags) (citizen-flag hostile)) - (let ((v1-6 (-> obj hit-face))) + ((handle->process (-> this focus handle)) + (logior! (-> this flags) (citizen-flag hostile)) + (let ((v1-6 (-> this hit-face))) (cond ((zero? v1-6) - (go (method-of-object obj get-up-front)) + (go (method-of-object this get-up-front)) ) ((= v1-6 1) - (go (method-of-object obj get-up-back)) + (go (method-of-object this get-up-back)) ) (else - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) ) ) ) (else - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ) 0 ) -(defmethod crimson-guard-method-214 crimson-guard ((obj crimson-guard)) - (let* ((s4-0 (-> obj target-pos-predict-miss)) - (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) +(defmethod crimson-guard-method-214 crimson-guard ((this crimson-guard)) + (let* ((s4-0 (-> this target-pos-predict-miss)) + (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (v1-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v1-2) 1.0)) (s4-1 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (set! (-> s4-1 ent) (-> obj entity)) + (set! (-> s4-1 ent) (-> this entity)) (set! (-> s4-1 charge) 1.0) (set! (-> s4-1 options) (projectile-options)) - (set! (-> s4-1 notify-handle) (process->handle obj)) + (set! (-> s4-1 notify-handle) (process->handle this)) (set! (-> s4-1 owner-handle) (the-as handle #f)) - (set! (-> s4-1 ignore-handle) (process->handle obj)) + (set! (-> s4-1 ignore-handle) (process->handle this)) (let* ((a0-13 *game-info*) (a1-12 (+ (-> a0-13 attack-id) 1)) ) @@ -1242,7 +1242,7 @@ (set! (-> s4-1 pos quad) (-> s5-0 quad)) (set! (-> s4-1 vel quad) (-> v1-3 quad)) (vector-normalize! (-> s4-1 vel) 819200.0) - (spawn-projectile guard-shot s4-1 obj *default-dead-pool*) + (spawn-projectile guard-shot s4-1 this *default-dead-pool*) ) 0 (none) @@ -1360,7 +1360,7 @@ ) ) -(defmethod crimson-guard-method-217 crimson-guard ((obj crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod crimson-guard-method-217 crimson-guard ((this crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1378,8 +1378,8 @@ (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) (set! (-> v1-4 collide-with) (collide-spec backgnd)) - (set! (-> v1-4 ignore-process0) obj) - (set! (-> v1-4 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) ) @@ -1437,8 +1437,8 @@ (let ((v1-17 s5-0)) (set! (-> v1-17 radius) f30-0) (set! (-> v1-17 collide-with) (collide-spec civilian enemy obstacle hit-by-player-list hit-by-others-list)) - (set! (-> v1-17 ignore-process0) obj) - (set! (-> v1-17 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-17 ignore-process0) this) + (set! (-> v1-17 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-17 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-17 action-mask) (collide-action solid)) ) @@ -1469,7 +1469,7 @@ ) ) -(defmethod crimson-guard-method-220 crimson-guard ((obj crimson-guard)) +(defmethod crimson-guard-method-220 crimson-guard ((this crimson-guard)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1479,43 +1479,47 @@ ) (init-vf0-vector) (cond - ((logtest? (-> obj controller traffic alert-state flags) (traffic-alert-flag guard-multi-focus)) - (logior! (-> obj enemy-flags) (enemy-flag trackable)) - (when (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (let ((a0-4 (find-closest-to-with-collide-lists (-> obj controller traffic) obj (-> obj focus collide-with)))) + ((logtest? (-> this controller traffic alert-state flags) (traffic-alert-flag guard-multi-focus)) + (logior! (-> this enemy-flags) (enemy-flag trackable)) + (when (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) + (let ((a0-4 (find-closest-to-with-collide-lists (-> this controller traffic) this (-> this focus collide-with)))) (if a0-4 - (set! (-> obj traffic-target-status handle) (process->handle a0-4)) - (set! (-> obj traffic-target-status handle) (the-as handle #f)) + (set! (-> this traffic-target-status handle) (process->handle a0-4)) + (set! (-> this traffic-target-status handle) (the-as handle #f)) ) ) ) ) (else - (when (logtest? (enemy-flag trackable) (-> obj enemy-flags)) - (logclear! (-> obj enemy-flags) (enemy-flag trackable)) - (let* ((s5-0 (handle->process (-> obj traffic-target-status handle))) + (when (logtest? (enemy-flag trackable) (-> this enemy-flags)) + (logclear! (-> this enemy-flags) (enemy-flag trackable)) + (let* ((s5-0 (handle->process (-> this traffic-target-status handle))) (v1-21 (if (type? s5-0 process-focusable) s5-0 ) ) ) (if (and v1-21 (!= (-> v1-21 type) target)) - (set! (-> obj traffic-target-status handle) (the-as handle #f)) + (set! (-> this traffic-target-status handle) (the-as handle #f)) ) ) ) ) ) (let ((a1-3 (new 'stack-no-clear 'vector))) - (set! (-> a1-3 quad) (-> obj root trans quad)) + (set! (-> a1-3 quad) (-> this root trans quad)) (+! (-> a1-3 y) 8192.0) - (let ((s5-1 - (traffic-engine-method-49 (-> obj controller traffic) a1-3 (-> obj traffic-id) (-> obj traffic-target-status)) - ) + (let ((s5-1 (traffic-engine-method-49 + (-> this controller traffic) + a1-3 + (-> this traffic-id) + (-> this traffic-target-status) + ) + ) ) - (let* ((s4-0 obj) + (let* ((s4-0 this) (s3-0 (method-of-object s4-0 enemy-method-63)) - (s2-0 (handle->process (-> obj traffic-target-status handle))) + (s2-0 (handle->process (-> this traffic-target-status handle))) ) (s3-0 s4-0 @@ -1526,28 +1530,28 @@ (the-as enemy-aware #f) ) ) - (let ((s4-1 (handle->process (-> obj focus handle)))) + (let ((s4-1 (handle->process (-> this focus handle)))) (cond ((and s4-1 (not (logtest? (-> (the-as process-focusable s4-1) focus-status) (focus-status disable dead inactive))) ) (when (logtest? (-> s5-1 flags) (traffic-target-flag updated)) - (logclear! (-> obj flags) (citizen-flag target-in-sight)) - (if (crimson-guard-method-215 obj) - (logior! (-> obj flags) (citizen-flag target-in-sight)) + (logclear! (-> this flags) (citizen-flag target-in-sight)) + (if (crimson-guard-method-215 this) + (logior! (-> this flags) (citizen-flag target-in-sight)) ) ) - (set! (-> obj target-flags) (the-as uint (-> s5-1 flags))) - (set! (-> obj target-pos quad) (-> (get-trans (the-as process-focusable s4-1) 3) quad)) - (set! (-> obj target-vel-vec quad) (-> (the-as process-focusable s4-1) root transv quad)) - (set! (-> obj target-vel) (vector-length (-> obj target-vel-vec))) - (let ((s5-4 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> obj target-pos)))) + (set! (-> this target-flags) (the-as uint (-> s5-1 flags))) + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable s4-1) 3) quad)) + (set! (-> this target-vel-vec quad) (-> (the-as process-focusable s4-1) root transv quad)) + (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) + (let ((s5-4 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this target-pos)))) (let* ((f0-3 (vector-length s5-4)) (f0-4 (* 0.0000012207031 f0-3)) - (a1-9 (-> obj target-pos-predict)) + (a1-9 (-> this target-pos-predict)) ) - (let ((v1-62 (-> obj target-pos))) - (let ((a0-36 (-> obj target-vel-vec))) + (let ((v1-62 (-> this target-pos))) + (let ((a0-36 (-> this target-vel-vec))) (let ((a2-3 f0-4)) (.mov vf7 a2-3) ) @@ -1562,26 +1566,26 @@ ) (set! (-> s5-4 y) 0.0) (vector-rotate90-around-y! s5-4 s5-4) - (if (-> obj other-side) + (if (-> this other-side) (vector-negate! s5-4 s5-4) ) - (vector-normalize! s5-4 (-> obj miss-amount)) - (vector+! (-> obj target-pos-predict-miss) (-> obj target-pos-predict) s5-4) + (vector-normalize! s5-4 (-> this miss-amount)) + (vector+! (-> this target-pos-predict-miss) (-> this target-pos-predict) s5-4) ) - (vector-! (-> obj target-self) (-> obj target-pos) (-> obj root trans)) - (set! (-> obj target-self-xz quad) (-> obj target-self quad)) - (set! (-> obj target-self-xz y) 0.0) - (set! (-> obj target-self-dist) (vector-length (-> obj target-self))) - (set! (-> obj target-self-xz-dist) (vector-length (-> obj target-self-xz))) - (set! (-> obj target-y-angle) - (deg-diff (quaternion-y-angle (-> obj root quat)) (vector-y-angle (-> obj target-self))) + (vector-! (-> this target-self) (-> this target-pos) (-> this root trans)) + (set! (-> this target-self-xz quad) (-> this target-self quad)) + (set! (-> this target-self-xz y) 0.0) + (set! (-> this target-self-dist) (vector-length (-> this target-self))) + (set! (-> this target-self-xz-dist) (vector-length (-> this target-self-xz))) + (set! (-> this target-y-angle) + (deg-diff (quaternion-y-angle (-> this root quat)) (vector-y-angle (-> this target-self))) ) ) (else - (set! (-> obj traffic-target-status handle) (the-as handle #f)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (go (method-of-object obj active)) + (set! (-> this traffic-target-status handle) (the-as handle #f)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (citizen-method-195 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) ) ) ) @@ -1592,43 +1596,43 @@ ) ) -(defmethod crimson-guard-method-221 crimson-guard ((obj crimson-guard)) +(defmethod crimson-guard-method-221 crimson-guard ((this crimson-guard)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) - (set! (-> a1-0 sphere quad) (-> obj root trans quad)) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> obj root transv quad)) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) (set! (-> a1-0 decay-rate) 0.0) (set! (-> a1-0 flags) (traffic-danger-flags tdf0)) (set! (-> a1-0 danger-type) (traffic-danger-type tdt0)) - (add-danger (-> obj controller traffic) a1-0) + (add-danger (-> this controller traffic) a1-0) ) (none) ) -(defmethod crimson-guard-method-215 crimson-guard ((obj crimson-guard)) - (let ((s5-0 (get-trans obj 3)) +(defmethod crimson-guard-method-215 crimson-guard ((this crimson-guard)) + (let ((s5-0 (get-trans this 3)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> obj target-pos quad)) + (set! (-> s4-0 quad) (-> this target-pos quad)) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0))) (vector-normalize! s3-1 409600.0) - (zero? (crimson-guard-method-217 obj s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s3-1) s4-0)) + (zero? (crimson-guard-method-217 this s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s3-1) s4-0)) ) ) ) -(defmethod crimson-guard-method-216 crimson-guard ((obj crimson-guard)) +(defmethod crimson-guard-method-216 crimson-guard ((this crimson-guard)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj target-pos-predict-miss quad)) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) + (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a0-3)) ) (vector-normalize! s3-1 409600.0) - (and (crimson-guard-method-215 obj) - (zero? (crimson-guard-method-217 obj s4-0 (vector+! (new 'stack-no-clear 'vector) s4-0 s3-1) s5-0)) + (and (crimson-guard-method-215 this) + (zero? (crimson-guard-method-217 this s4-0 (vector+! (new 'stack-no-clear 'vector) s4-0 s3-1) s5-0)) ) ) ) @@ -1638,7 +1642,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1785,7 +1789,7 @@ (t9-1) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-11 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-11 enemy-flags))) (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-11 enemy-flags)))) @@ -1879,7 +1883,7 @@ (when (and (< (-> self target-self-xz-dist) 163840.0) (or (< 40960.0 (-> self target-self-xz-dist)) (>= 2 (the-as int (-> self focus aware)))) ) - (if (and (>= (- (current-time) (-> self state-time)) (the int (* 300.0 (get-rand-float-range self 1.0 3.0)))) + (if (and (time-elapsed? (-> self state-time) (the int (* 300.0 (get-rand-float-range self 1.0 3.0)))) (logtest? (-> self flags) (citizen-flag target-in-sight)) ) (go-virtual gun-shoot) @@ -2069,8 +2073,8 @@ (set! (-> a0-9 velocity quad) (-> v1-15 quad)) ) 0 - (set! (-> self state-time) (current-time)) - (set! (-> self last-time-see-target) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-time-see-target)) (crimson-guard-method-220 self) (set! (-> self miss-amount) (lerp-scale 0.0 16384.0 (-> self target-self-dist) 40960.0 122880.0)) (set! (-> self miss-amount) 16384.0) @@ -2105,7 +2109,7 @@ ) (go-virtual close-attack) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (or (not (logtest? (-> self flags) (citizen-flag target-in-sight))) (< 184320.0 (-> self target-self-xz-dist)) (< 10922.667 (fabs (-> self target-y-angle))) @@ -2136,7 +2140,7 @@ (set! v1-35 #t) (goto cfg-10) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (set! v1-35 #f) (goto cfg-10) ) @@ -2144,7 +2148,7 @@ (b! (not #f) cfg-3 :delay (set! v1-35 #f)) (label cfg-10) (when v1-35 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 3)) (until #f (ja-channel-push! 1 (seconds 0.1)) @@ -2208,9 +2212,9 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-method-226 crimson-guard ((obj crimson-guard)) - (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s5-0 (-> obj root)) +(defmethod crimson-guard-method-226 crimson-guard ((this crimson-guard)) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (-> this root)) (s3-0 (lambda ((arg0 crimson-guard) (arg1 collide-shape-moving) (arg2 vector)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -2252,14 +2256,14 @@ ) ) (cond - ((s3-0 obj s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 24576.0)) - (go (method-of-object obj roll-right)) + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 24576.0)) + (go (method-of-object this roll-right)) ) - ((s3-0 obj s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 -24576.0)) - (go (method-of-object obj roll-left)) + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 -24576.0)) + (go (method-of-object this roll-left)) ) (else - (go-hostile obj) + (go-hostile this) ) ) ) @@ -2490,8 +2494,8 @@ (set! (-> a0-9 velocity quad) (-> v1-12 quad)) ) 0 - (set! (-> self state-time) (current-time)) - (set! (-> self last-time-see-target) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-time-see-target)) (set! (-> self miss-amount) 0.0) (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) @@ -2570,7 +2574,7 @@ (set! (-> a0-9 velocity quad) (-> v1-12 quad)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self miss-amount) 0.0) (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) @@ -2765,7 +2769,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-method-222 crimson-guard ((obj crimson-guard)) +(defmethod crimson-guard-method-222 crimson-guard ((this crimson-guard)) (local-vars (sv-800 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2775,11 +2779,11 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (s2-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v0-1) 16384.0)) (s1-0 - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj target-pos-predict-miss) s4-0) 16384.0) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict-miss) s4-0) 16384.0) ) (s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'collide-query)) @@ -2817,7 +2821,7 @@ ) (set! (-> s3-0 start-pos quad) (-> s4-0 quad)) (set! (-> s3-0 move-dist quad) (-> s1-0 quad)) - (set! (-> obj l-control state points-to-draw) 0) + (set! (-> this l-control state points-to-draw) 0) (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) (s2-1 (new 'stack-no-clear 'vector)) ) @@ -2840,7 +2844,7 @@ (let ((s1-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s1-2 (let ((t9-14 (method-of-type part-tracker activate))) - (t9-14 (the-as part-tracker s1-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-14 (the-as part-tracker s1-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-15 run-function-in-process) (a0-33 s1-2) @@ -2870,7 +2874,7 @@ (let ((s1-3 (get-process *default-dead-pool* part-tracker #x4000))) (when s1-3 (let ((t9-17 (method-of-type part-tracker activate))) - (t9-17 (the-as part-tracker s1-3) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-17 (the-as part-tracker s1-3) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-18 run-function-in-process) (a0-36 s1-3) @@ -2897,10 +2901,10 @@ (-> s1-3 ppointer) ) ) - (set-point! (-> obj l-control) 0 s4-0) - (set-point! (-> obj l-control) 1 s5-0) - (set! (-> obj l-control spec) (-> *lightning-spec-id-table* 13)) - (+! (-> obj l-control state points-to-draw) 2) + (set-point! (-> this l-control) 0 s4-0) + (set-point! (-> this l-control) 1 s5-0) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 13)) + (+! (-> this l-control state points-to-draw) 2) (let* ((s1-4 (-> s3-0 best-other-tri collide-ptr)) (v1-43 (if (type? s1-4 collide-shape-prim) s1-4 @@ -2911,28 +2915,28 @@ (when v1-43 (set! s1-5 #f) (let ((s0-1 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> s0-1 ent) (-> obj entity)) + (set! (-> s0-1 ent) (-> this entity)) (set! (-> s0-1 charge) 1.0) (set! (-> s0-1 options) (projectile-options)) - (set! (-> s0-1 notify-handle) (process->handle obj)) + (set! (-> s0-1 notify-handle) (process->handle this)) (set! (-> s0-1 owner-handle) (the-as handle #f)) - (set! (-> s0-1 ignore-handle) (process->handle obj)) - (set! (-> s0-1 attack-id) (-> obj attack-id)) + (set! (-> s0-1 ignore-handle) (process->handle this)) + (set! (-> s0-1 attack-id) (-> this attack-id)) (set! (-> s0-1 timeout) (seconds 4)) (set! (-> s0-1 pos quad) (-> s4-0 quad)) (vector-! (-> s0-1 vel) s5-0 s4-0) (vector-normalize! (-> s0-1 vel) 131072.0) - (spawn-projectile guard-lazer-shot s0-1 obj *default-dead-pool*) + (spawn-projectile guard-lazer-shot s0-1 this *default-dead-pool*) ) ) ) - (spread-lightning-lazer (-> obj l-control) s5-0 s2-1 (-> s3-0 best-other-tri normal)) + (spread-lightning-lazer (-> this l-control) s5-0 s2-1 (-> s3-0 best-other-tri normal)) ) (else (let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s3-1 (let ((t9-26 (method-of-type part-tracker activate))) - (t9-26 (the-as part-tracker s3-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-26 (the-as part-tracker s3-1) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-27 run-function-in-process) (a0-59 s3-1) @@ -2962,7 +2966,7 @@ (let ((s3-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s3-2 (let ((t9-29 (method-of-type part-tracker activate))) - (t9-29 (the-as part-tracker s3-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-29 (the-as part-tracker s3-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-30 run-function-in-process) (a0-62 s3-2) @@ -2989,12 +2993,12 @@ (-> s3-2 ppointer) ) ) - (set! (-> obj l-control state points-to-draw) 9) - (set! (-> obj l-control spec) (-> *lightning-spec-id-table* 14)) + (set! (-> this l-control state points-to-draw) 9) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 14)) (let ((v1-77 s4-0)) - (set! (-> obj l-control state meet data 0 quad) (-> v1-77 quad)) + (set! (-> this l-control state meet data 0 quad) (-> v1-77 quad)) ) - (let ((a0-68 (-> obj l-control)) + (let ((a0-68 (-> this l-control)) (v1-79 s5-0) ) (set! (-> a0-68 state meet data (+ (-> a0-68 state points-to-draw) -1) quad) (-> v1-79 quad)) @@ -3024,7 +3028,7 @@ ) 0 (set! (-> self miss-amount) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self lazer-sound) (new 'static 'sound-id)) 0 ) @@ -3063,7 +3067,7 @@ ) :trans (behavior () (crimson-guard-method-220 self) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (or (< 32768.0 (-> self target-self-xz-dist)) (not (logtest? (-> self flags) (citizen-flag target-in-sight)))) ) (go-hostile self) @@ -3207,7 +3211,7 @@ (f30-1 1.0) ) (ja-no-eval :group! (-> self draw art-group data 22) :num! (loop! f30-1) :frame-num 0.0) - (until (>= (- (current-time) s5-1) s4-1) + (until (time-elapsed? s5-1 s4-1) (crimson-guard-method-222 self) (suspend) (ja :num! (loop! f30-1)) @@ -3258,8 +3262,8 @@ ) ) -(defmethod crimson-guard-method-223 crimson-guard ((obj crimson-guard) (arg0 float)) - (let* ((s3-0 (handle->process (-> obj transport))) +(defmethod crimson-guard-method-223 crimson-guard ((this crimson-guard) (arg0 float)) + (let* ((s3-0 (handle->process (-> this transport))) (s4-0 (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) ) @@ -3269,7 +3273,7 @@ (let ((s2-0 (matrix<-transformq! (new 'stack-no-clear 'matrix) (the-as transformq (-> s4-0 root trans)))) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 x) (if (zero? (-> obj transport-side)) + (set! (-> s3-1 x) (if (zero? (-> this transport-side)) -8192.0 8192.0 ) @@ -3277,13 +3281,13 @@ (set! (-> s3-1 y) 12288.0) (set! (-> s3-1 z) (lerp-scale -16384.0 -49152.0 arg0 0.0 1.0)) (set! (-> s3-1 w) 1.0) - (quaternion-rotate-local-y! (-> obj root quat) (-> s4-0 root quat) 32768.0) - (vector-matrix*! (-> obj root trans) s3-1 s2-0) + (quaternion-rotate-local-y! (-> this root quat) (-> s4-0 root quat) 32768.0) + (vector-matrix*! (-> this root trans) s3-1 s2-0) ) ) ) (let ((f0-5 (fmax 0.0 (fmin 1.0 (* 3.3333333 arg0))))) - (set-vector! (-> obj draw color-mult) f0-5 f0-5 f0-5 1.0) + (set-vector! (-> this draw color-mult) f0-5 f0-5 f0-5 1.0) ) 0 (none) @@ -3292,7 +3296,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod crimson-guard-method-224 crimson-guard ((obj crimson-guard) (arg0 vector)) +(defmethod crimson-guard-method-224 crimson-guard ((this crimson-guard) (arg0 vector)) (local-vars (f0-8 float) (sv-768 vector) @@ -3309,7 +3313,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (f30-0 0.0) ) (dotimes (s3-0 2) @@ -3321,7 +3325,7 @@ ) (vector-rotate-around-y! sv-768 s4-0 (* 182.04445 (the float (+ (* 23 s2-0) -70)))) (let ((v1-10 s1-0)) - (let ((a0-6 (-> obj root trans))) + (let ((a0-6 (-> this root trans))) (let ((a1-5 sv-768)) (let ((a2-2 1.0)) (.mov vf7 a2-2) @@ -3335,10 +3339,10 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-10 quad) vf6) ) - (if (enemy-above-ground? obj s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) ) - (let ((v1-14 (-> obj nav)) + (let ((v1-14 (-> this nav)) (a0-8 s1-0) (a1-7 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -3367,12 +3371,12 @@ (let ((a1-8 (new 'stack-no-clear 'vector))) (set! (-> a1-8 quad) (-> s1-0 quad)) (set! (-> a1-8 w) 8192.0) - (when (not (add-root-sphere-to-hash! (-> obj nav) a1-8 32)) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-8 32)) (when (< f30-0 f28-0) (set! f30-0 f28-0) (set! sv-784 (new 'stack-no-clear 'vector)) (let ((a3-3 (new 'stack-no-clear 'vector))) - (set! sv-800 (-> obj nav)) + (set! sv-800 (-> this nav)) (set! sv-832 sv-784) (let* ((v1-29 s1-0) (a0-18 (-> sv-800 state mesh)) @@ -3394,7 +3398,7 @@ ) 0 (set! (-> s1-0 y) (-> sv-784 y)) - (if (enemy-above-ground? obj s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) ) (set! (-> arg0 quad) (-> s1-0 quad)) @@ -3412,78 +3416,78 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 crimson-guard ((obj crimson-guard)) - (let ((s5-0 (-> obj nav state)) - (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) +(defmethod enemy-method-93 crimson-guard ((this crimson-guard)) + (let ((s5-0 (-> this nav state)) + (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (set! (-> s5-0 heading quad) (-> v1-2 quad)) ) 0 - (let ((s5-1 (-> obj nav state)) - (v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s5-1 (-> this nav state)) + (v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (logior! (-> s5-1 flags) (nav-state-flag directional-mode)) (set! (-> s5-1 travel quad) (-> v1-7 quad)) ) 0 - (let ((s5-2 (-> obj nav state)) - (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s5-2 (-> this nav state)) + (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (set! (-> s5-2 velocity quad) (-> v1-12 quad)) ) 0 - (crimson-guard-method-220 obj) - (set! (-> obj move-position quad) (-> obj target-pos quad)) - (go (method-of-object obj hostile)) + (crimson-guard-method-220 this) + (set! (-> this move-position quad) (-> this target-pos quad)) + (go (method-of-object this hostile)) (none) ) -(defmethod enemy-method-89 crimson-guard ((obj crimson-guard) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) #f ) -(defmethod enemy-method-87 crimson-guard ((obj crimson-guard) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-87 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((s4-0 (-> obj skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 38))) + (let ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) (set! (-> s4-0 param 0) (ja-aframe 3.0 0)) (set! (-> s4-0 param 1) (-> arg0 anim-speed)) (set! (-> s4-0 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> obj draw art-group data 38)) num-func-seek!) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) ) #t ) -(defmethod enemy-method-88 crimson-guard ((obj crimson-guard) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-88 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.01)) - (let ((s4-0 (-> obj skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 38))) + (let ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) (set! (-> s4-0 param 0) (ja-aframe 9.0 0)) (set! (-> s4-0 param 1) (-> arg0 anim-speed)) (set! (-> s4-0 frame-num) (ja-aframe 4.0 0)) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> obj draw art-group data 38)) num-func-seek!) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) ) #t ) -(defmethod enemy-method-90 crimson-guard ((obj crimson-guard) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 crimson-guard ((this crimson-guard) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (not (enemy-method-89 obj arg1)) + (not (enemy-method-89 this arg1)) ) ((= v1-0 1) (set! s5-0 (ja-done? 0)) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) (set! (-> s4-1 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) @@ -3492,12 +3496,12 @@ s5-0 ) ((= v1-0 2) - (enemy-method-87 obj arg1) + (enemy-method-87 this arg1) #f ) ((= v1-0 3) (set! s5-0 (ja-done? 0)) - (let ((s4-2 (-> obj skel root-channel 0))) + (let ((s4-2 (-> this skel root-channel 0))) (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) (set! (-> s4-2 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) @@ -3506,11 +3510,11 @@ s5-0 ) ((= v1-0 4) - (not (enemy-method-88 obj arg1)) + (not (enemy-method-88 this arg1)) ) ((= v1-0 5) (set! s5-0 (ja-done? 0)) - (let ((s4-3 (-> obj skel root-channel 0))) + (let ((s4-3 (-> this skel root-channel 0))) (set! (-> s4-3 param 0) (ja-aframe 9.0 0)) (set! (-> s4-3 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim #f) num-func-seek!) @@ -3529,7 +3533,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) (logclear! (-> self flags) (citizen-flag hostile)) (nav-enemy-method-166 self) @@ -3604,14 +3608,14 @@ (while (not (-> self already-shot)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (ja-channel-set! 1) (let ((gp-0 (current-time)) (s5-0 150) (f30-0 2.0) ) (ja-no-eval :group! (-> self draw art-group data 6) :num! (loop! f30-0) :frame-num 0.0) - (until (>= (- (current-time) gp-0) s5-0) + (until (time-elapsed? gp-0 s5-0) (crimson-guard-method-223 self (* 0.006666667 (the float (- (current-time) (-> self state-time))))) (suspend) (ja :num! (loop! f30-0)) @@ -3629,9 +3633,9 @@ ) ) -(defmethod init-enemy-collision! crimson-guard ((obj crimson-guard)) +(defmethod init-enemy-collision! crimson-guard ((this crimson-guard)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -3695,81 +3699,81 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-drawable vs crimson-guard. -(defmethod relocate crimson-guard ((obj crimson-guard) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(defmethod relocate crimson-guard ((this crimson-guard) (arg0 int)) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) arg0) ) - (if (nonzero? (-> obj l-control)) - (&+! (-> obj l-control) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method crimson-guard 7)) this arg0) ) ) -(defmethod init-enemy! crimson-guard ((obj crimson-guard)) +(defmethod init-enemy! crimson-guard ((this crimson-guard)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) obj 4)) - (set! (-> obj info) *crimson-guard-global-info*) - (init-enemy-behaviour-and-stats! obj *crimson-guard-nav-enemy-info*) - (let ((v1-7 (-> obj nav))) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 4)) + (set! (-> this info) *crimson-guard-global-info*) + (init-enemy-behaviour-and-stats! this *crimson-guard-nav-enemy-info*) + (let ((v1-7 (-> this nav))) (set! (-> v1-7 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 143360.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (set! (-> obj anim-shuffle) 5) - (set! (-> obj anim-walk) 5) - (set! (-> obj speed-walk) 12288.0) - (set! (-> obj dist-walk-anim) 12288.0) - (set! (-> obj dist-run-anim) 34078.72) - (set! (-> obj anim-run) 6) - (set! (-> obj speed-run) 49152.0) - (set! (-> obj anim-get-up-front) 33) - (set! (-> obj anim-get-up-back) 34) - (set! (-> obj l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 13) obj 0.0)) - (set! (-> obj l-control state points-to-draw) 0) - (set! (-> obj water-anim) -1) - (set! (-> obj minimap) #f) + (set! (-> this draw lod-set lod 0 dist) 143360.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this anim-shuffle) 5) + (set! (-> this anim-walk) 5) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 12288.0) + (set! (-> this dist-run-anim) 34078.72) + (set! (-> this anim-run) 6) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-get-up-front) 33) + (set! (-> this anim-get-up-back) 34) + (set! (-> this l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 13) this 0.0)) + (set! (-> this l-control state points-to-draw) 0) + (set! (-> this water-anim) -1) + (set! (-> this minimap) #f) 0 (none) ) -(defmethod crimson-guard-method-225 crimson-guard ((obj crimson-guard) (arg0 uint) (arg1 symbol)) - (set! (-> obj guard-type) arg0) - (set! (-> obj settings) - (get-traffic-guard-type-settings (-> obj controller traffic) (the-as int (-> obj guard-type))) +(defmethod crimson-guard-method-225 crimson-guard ((this crimson-guard) (arg0 uint) (arg1 symbol)) + (set! (-> this guard-type) arg0) + (set! (-> this settings) + (get-traffic-guard-type-settings (-> this controller traffic) (the-as int (-> this guard-type))) ) - (setup-masks (-> obj draw) 0 30) + (setup-masks (-> this draw) 0 30) (cond - ((zero? (-> obj guard-type)) - (setup-masks (-> obj draw) 16 0) - (set! (-> obj root nav-radius) 8192.0) + ((zero? (-> this guard-type)) + (setup-masks (-> this draw) 16 0) + (set! (-> this root nav-radius) 8192.0) ) (else - (setup-masks (-> obj draw) 8 0) - (set! (-> obj root nav-radius) 6144.0) + (setup-masks (-> this draw) 8 0) + (set! (-> this root nav-radius) 6144.0) ) ) (cond - ((and (not arg1) (logtest? (-> obj flags) (citizen-flag dark-guard))) - (setup-masks (-> obj draw) 5 0) - (set-vector! (-> obj root scale) 1.1 1.1 1.1 1.0) - (set-vector! (-> obj joint scale) 1.1 1.0 1.1 1.0) - (let* ((a0-16 (-> obj neck)) + ((and (not arg1) (logtest? (-> this flags) (citizen-flag dark-guard))) + (setup-masks (-> this draw) 5 0) + (set-vector! (-> this root scale) 1.1 1.1 1.1 1.0) + (set-vector! (-> this joint scale) 1.1 1.0 1.1 1.0) + (let* ((a0-16 (-> this neck)) (t9-5 (method-of-object a0-16 trs-set!)) (a1-6 #f) (a2-5 #f) @@ -3781,15 +3785,15 @@ (set! (-> a3-0 w) 1.0) (t9-5 a0-16 (the-as vector a1-6) (the-as quaternion a2-5) a3-0) ) - (mode-set! (-> obj neck) (joint-mod-mode rotate2)) - (set! (-> obj joint parented-scale?) #t) - (set! (-> obj neck parented-scale?) #t) + (mode-set! (-> this neck) (joint-mod-mode rotate2)) + (set! (-> this joint parented-scale?) #t) + (set! (-> this neck parented-scale?) #t) ) (else - (setup-masks (-> obj draw) 3 0) - (set-vector! (-> obj root scale) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj joint scale) 1.0 1.0 1.0 1.0) - (let* ((a0-29 (-> obj neck)) + (setup-masks (-> this draw) 3 0) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (set-vector! (-> this joint scale) 1.0 1.0 1.0 1.0) + (let* ((a0-29 (-> this neck)) (t9-8 (method-of-object a0-29 trs-set!)) (a1-9 #f) (a2-7 #f) @@ -3801,72 +3805,72 @@ (set! (-> a3-1 w) 1.0) (t9-8 a0-29 (the-as vector a1-9) (the-as quaternion a2-7) a3-1) ) - (mode-set! (-> obj neck) (joint-mod-mode reset)) + (mode-set! (-> this neck) (joint-mod-mode reset)) ) ) 0 (none) ) -(defmethod citizen-init! crimson-guard ((obj crimson-guard)) +(defmethod citizen-init! crimson-guard ((this crimson-guard)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (if (logtest? (-> obj flags) (citizen-flag dark-guard)) - (set! (-> obj hit-points) (the int (* 2.0 (the float (-> obj enemy-info default-hit-points))))) + (if (logtest? (-> this flags) (citizen-flag dark-guard)) + (set! (-> this hit-points) (the int (* 2.0 (the float (-> this enemy-info default-hit-points))))) ) - (set! (-> obj hit-face) (the-as uint -1)) - (crimson-guard-method-225 obj (get-guard-type-for-traffic-obj (-> obj controller traffic) 6) #f) - (let ((v1-12 (-> obj nav))) + (set! (-> this hit-face) (the-as uint -1)) + (crimson-guard-method-225 this (get-guard-type-for-traffic-obj (-> this controller traffic) 6) #f) + (let ((v1-12 (-> this nav))) (set! (-> v1-12 sphere-mask) (the-as uint #x800de)) ) 0 - (set! (-> obj joint-enable) #f) - (logclear! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask guard)) - (set! (-> obj fact pickup-type) (pickup-type ammo-random)) - (set! (-> obj fact pickup-amount) 10.0) - (set! (-> obj fact pickup-spawn-amount) 1.0) - (set! (-> obj traffic-target-status handle) (the-as handle #f)) - (let ((v1-24 (get-rand-int obj 2))) + (set! (-> this joint-enable) #f) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask guard)) + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + (set! (-> this fact pickup-amount) 10.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this traffic-target-status handle) (the-as handle #f)) + (let ((v1-24 (get-rand-int this 2))) (cond ((zero? v1-24) - (set! (-> obj anim-shoot 0 anim-index) 19) - (set! (-> obj anim-shoot 0 start) 1.0) - (set! (-> obj anim-shoot 0 end) 12.0) - (set! (-> obj anim-shoot 1 anim-index) 26) - (set! (-> obj anim-shoot 1 start) 12.0) - (set! (-> obj anim-shoot 1 end) 22.0) - (set! (-> obj anim-shoot 2 anim-index) 24) - (set! (-> obj anim-shoot 2 start) 20.0) - (set! (-> obj anim-shoot 2 end) 30.0) + (set! (-> this anim-shoot 0 anim-index) 19) + (set! (-> this anim-shoot 0 start) 1.0) + (set! (-> this anim-shoot 0 end) 12.0) + (set! (-> this anim-shoot 1 anim-index) 26) + (set! (-> this anim-shoot 1 start) 12.0) + (set! (-> this anim-shoot 1 end) 22.0) + (set! (-> this anim-shoot 2 anim-index) 24) + (set! (-> this anim-shoot 2 start) 20.0) + (set! (-> this anim-shoot 2 end) 30.0) ) ((= v1-24 1) - (set! (-> obj anim-shoot 0 anim-index) 27) - (set! (-> obj anim-shoot 0 start) 2.0) - (set! (-> obj anim-shoot 0 end) 9.0) - (set! (-> obj anim-shoot 1 anim-index) 29) - (set! (-> obj anim-shoot 1 start) 18.0) - (set! (-> obj anim-shoot 1 end) 26.0) - (set! (-> obj anim-shoot 2 anim-index) 30) - (set! (-> obj anim-shoot 2 start) 26.0) - (set! (-> obj anim-shoot 2 end) 35.0) + (set! (-> this anim-shoot 0 anim-index) 27) + (set! (-> this anim-shoot 0 start) 2.0) + (set! (-> this anim-shoot 0 end) 9.0) + (set! (-> this anim-shoot 1 anim-index) 29) + (set! (-> this anim-shoot 1 start) 18.0) + (set! (-> this anim-shoot 1 end) 26.0) + (set! (-> this anim-shoot 2 anim-index) 30) + (set! (-> this anim-shoot 2 start) 26.0) + (set! (-> this anim-shoot 2 end) 35.0) ) ) ) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (if (logtest? (-> obj controller traffic alert-state flags) (traffic-alert-flag target-jak)) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (if (logtest? (-> this controller traffic alert-state flags) (traffic-alert-flag target-jak)) (reset-to-collide-spec - (-> obj focus) + (-> this focus) (collide-spec jak enemy hit-by-others-list player-list bot-targetable jak-vehicle) ) - (reset-to-collide-spec (-> obj focus) (collide-spec enemy hit-by-others-list bot-targetable)) + (reset-to-collide-spec (-> this focus) (collide-spec enemy hit-by-others-list bot-targetable)) ) - (if (not (-> obj minimap)) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 32) (the-as int #f) (the-as vector #t) 0)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 32) (the-as int #f) (the-as vector #t) 0)) ) - (set! (-> obj move-index) -1) + (set! (-> this move-index) -1) (ja-channel-set! 0) 0 (none) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc index 42f40dae42..6254cb06bd 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-flitter.gc @@ -189,13 +189,13 @@ (set! (-> *metalhead-flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod metalhead-flitter-method-207 metalhead-flitter ((obj metalhead-flitter) (arg0 process-focusable)) - (and (logtest? (-> obj draw status) (draw-control-status on-screen)) +(defmethod metalhead-flitter-method-207 metalhead-flitter ((this metalhead-flitter) (arg0 process-focusable)) + (and (logtest? (-> this draw status) (draw-control-status on-screen)) (let ((s4-0 (camera-matrix))) (camera-pos) (let* ((s3-0 (get-trans arg0 0)) (s5-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 vector 2) 1.0)) - (v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) s3-0) 1.0)) + (v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s3-0) 1.0)) ) (< 0.0 (vector-dot s5-1 v1-7)) ) @@ -203,74 +203,74 @@ ) ) -(defmethod enemy-method-77 metalhead-flitter ((obj metalhead-flitter) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 metalhead-flitter ((this metalhead-flitter) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) #t ) (((knocked-type knocked-type-6)) - (let ((v1-17 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-17 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-17 (= v1-17 (-> obj draw art-group data 21))) + (if (and v1-17 (= v1-17 (-> this draw art-group data 21))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) 1.0) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) #t ) (else - ((method-of-type nav-enemy enemy-method-77) obj arg0) + ((method-of-type nav-enemy enemy-method-77) this arg0) ) ) ) -(defmethod enemy-method-78 metalhead-flitter ((obj metalhead-flitter) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 metalhead-flitter ((this metalhead-flitter) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((v1-4 (-> obj skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> v1-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> v1-4 param 1) 1.0) (set! (-> v1-4 frame-num) 0.0) - (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) ) (else - ((method-of-type citizen-enemy enemy-method-78) obj arg0) + ((method-of-type citizen-enemy enemy-method-78) this arg0) ) ) ) -(defmethod go-stare2 metalhead-flitter ((obj metalhead-flitter)) - (if (and (= (-> obj focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 obj))) - (go (method-of-object obj pacing)) - (go (method-of-object obj stare)) +(defmethod go-stare2 metalhead-flitter ((this metalhead-flitter)) + (if (and (= (-> this focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 this))) + (go (method-of-object this pacing)) + (go (method-of-object this stare)) ) ) @@ -385,14 +385,14 @@ ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.6)) + (until (time-elapsed? gp-2 (seconds 0.6)) (suspend) ) ) (+! (-> self root trans y) -8192.0) (logior! (-> self draw status) (draw-control-status no-draw)) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) + (until (time-elapsed? gp-3 (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) (suspend) ) ) @@ -418,7 +418,7 @@ ) 0 (look-at-target! self (enemy-flag lock-focus)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self root))) (vector-reset! (-> gp-0 transv)) (set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 34.0 38.0))) @@ -515,12 +515,12 @@ :post nav-enemy-falling-post ) -(defmethod enemy-method-99 metalhead-flitter ((obj metalhead-flitter) (arg0 process-focusable)) +(defmethod enemy-method-99 metalhead-flitter ((this metalhead-flitter) (arg0 process-focusable)) (focus-test? arg0 mech) ) -(defmethod metalhead-flitter-method-205 metalhead-flitter ((obj metalhead-flitter)) - (let* ((s5-0 (handle->process (-> obj focus handle))) +(defmethod metalhead-flitter-method-205 metalhead-flitter ((this metalhead-flitter)) + (let* ((s5-0 (handle->process (-> this focus handle))) (s3-0 (if (type? s5-0 process-focusable) s5-0 ) @@ -528,55 +528,55 @@ ) (when s3-0 (let* ((s5-1 (get-trans (the-as process-focusable s3-0) 0)) - (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> obj root trans))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this root trans))) (f30-0 (vector-length s4-1)) ) (cond - ((enemy-method-99 obj (the-as process-focusable s3-0)) - (go-flee obj) + ((enemy-method-99 this (the-as process-focusable s3-0)) + (go-flee this) ) - ((and (< f30-0 32768.0) (not (metalhead-flitter-method-207 obj (the-as process-focusable s3-0)))) - (go (method-of-object obj circling)) + ((and (< f30-0 32768.0) (not (metalhead-flitter-method-207 this (the-as process-focusable s3-0)))) + (go (method-of-object this circling)) ) - ((< f30-0 (-> obj enemy-info notice-nav-radius)) - (set! (-> obj target-pos quad) (-> s5-1 quad)) + ((< f30-0 (-> this enemy-info notice-nav-radius)) + (set! (-> this target-pos quad) (-> s5-1 quad)) (let ((s3-1 (new 'stack-no-clear 'vector))) (set! (-> s3-1 quad) (-> s4-1 quad)) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> obj root transv quad)) + (set! (-> s5-2 quad) (-> this root transv quad)) (vector-normalize! s5-2 f30-0) (if (>= (vector-dot s3-1 s5-2) 0.98) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) ) ) ) ((< f30-0 32768.0) - (set! (-> obj target-pos quad) (-> s5-1 quad)) + (set! (-> this target-pos quad) (-> s5-1 quad)) ) - ((or (>= (- (current-time) (the-as int (-> obj last-change-dir))) (-> obj change-dir-time)) - (< (vector-vector-distance-squared (-> obj root trans) (-> obj target-pos)) 0.1) + ((or (time-elapsed? (the-as int (-> this last-change-dir)) (-> this change-dir-time)) + (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1) ) - (set! (-> obj last-change-dir) (the-as uint (current-time))) - (set! (-> obj change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) + (set! (-> this last-change-dir) (the-as uint (current-time))) + (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> obj move-angle)))) + (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) - (if (-> obj heading) + (if (-> this heading) (set-vector! s3-2 (-> s4-1 z) (-> s4-1 y) (- (-> s4-1 x)) 1.0) (set-vector! s3-2 (- (-> s4-1 z)) (-> s4-1 y) (-> s4-1 x) 1.0) ) - (set! (-> obj heading) (not (-> obj heading))) + (set! (-> this heading) (not (-> this heading))) (let ((f28-1 (rand-vu-float-range (* 0.75 f0-9) f0-9)) (s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 (* -0.6 f30-0))) ) (vector-normalize! s3-2 f28-1) (vector+! s3-2 s3-2 s4-2) ) - (clamp-vector-to-mesh-cross-gaps (-> obj nav state) s3-2) + (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) (vector+! s2-0 s5-1 s3-2) - (set! (-> obj target-pos quad) (-> s2-0 quad)) + (set! (-> this target-pos quad) (-> s2-0 quad)) ) ) ) @@ -589,12 +589,10 @@ ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod metalhead-flitter-method-206 metalhead-flitter ((obj metalhead-flitter)) - (when (>= (- (current-time) (the-as int (-> obj amb-sound-timer))) - (the int (* 300.0 (rand-vu-float-range 1.5 3.0))) - ) - (sound-play "flitter-amb" :position (-> obj root trans)) - (set! (-> obj amb-sound-timer) (the-as uint (current-time))) +(defmethod metalhead-flitter-method-206 metalhead-flitter ((this metalhead-flitter)) + (when (time-elapsed? (the-as int (-> this amb-sound-timer)) (the int (* 300.0 (rand-vu-float-range 1.5 3.0)))) + (sound-play "flitter-amb" :position (-> this root trans)) + (set! (-> this amb-sound-timer) (the-as uint (current-time))) ) (none) ) @@ -611,7 +609,7 @@ ) (set! (-> self root transv y) 33775.48) (ja :num-func num-func-identity :frame-num 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) (until v1-29 (let ((f0-2 102400.0)) @@ -620,7 +618,7 @@ ) (suspend) (ja :num! (seek! max arg1)) - (set! v1-29 (or (ja-done? 0) (>= (- (current-time) (-> self state-time)) arg2))) + (set! v1-29 (or (ja-done? 0) (time-elapsed? (-> self state-time) arg2))) ) ) ) @@ -751,15 +749,15 @@ ) ) -(defmethod metalhead-flitter-method-209 metalhead-flitter ((obj metalhead-flitter)) - (lerp-scale 0.0 1.0 (- (-> obj attack-pos y) (-> obj root trans y)) 13926.4 25600.0) +(defmethod metalhead-flitter-method-209 metalhead-flitter ((this metalhead-flitter)) + (lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0) ) (defstate attack (metalhead-flitter) :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -796,7 +794,7 @@ (set! s5-2 (cond ((and gp-0 - (< (- (current-time) (-> self state-time)) (seconds 1.5)) + (not (time-elapsed? (-> self state-time) (seconds 1.5))) gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) @@ -943,7 +941,7 @@ (if gp-0 (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-11 (-> self focus aware))) (cond ((= v1-11 (enemy-aware enemy-aware-3)) @@ -960,7 +958,7 @@ ) ) ) - (if (and (get-enemy-target self) (>= (- (current-time) (the-as int (-> self off-screen-timer))) (seconds 0.3))) + (if (and (get-enemy-target self) (time-elapsed? (the-as int (-> self off-screen-timer)) (seconds 0.3))) (go-hostile self) ) ) @@ -1000,8 +998,8 @@ ) ) -(defmethod metalhead-flitter-method-208 metalhead-flitter ((obj metalhead-flitter) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod metalhead-flitter-method-208 metalhead-flitter ((this metalhead-flitter) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) (if arg0 @@ -1015,9 +1013,9 @@ (none) ) -(defmethod init-enemy-collision! metalhead-flitter ((obj metalhead-flitter)) +(defmethod init-enemy-collision! metalhead-flitter ((this metalhead-flitter)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1062,60 +1060,60 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 8)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod init-enemy! metalhead-flitter ((obj metalhead-flitter)) +(defmethod init-enemy! metalhead-flitter ((this metalhead-flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flitter" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *metalhead-flitter-nav-enemy-info*) - (set! (-> obj move-angle) 10922.667) - (set! (-> obj heading) (if (= (rand-vu-int-range 0 1) 1) - #t - #f - ) + (init-enemy-behaviour-and-stats! this *metalhead-flitter-nav-enemy-info*) + (set! (-> this move-angle) 10922.667) + (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) + #t + #f + ) ) - (set! (-> obj change-dir-time) 0) - (set! (-> obj off-screen-timer) (the-as uint 0)) - (set! (-> obj amb-sound-timer) (the-as uint 0)) + (set! (-> this change-dir-time) 0) + (set! (-> this off-screen-timer) (the-as uint 0)) + (set! (-> this amb-sound-timer) (the-as uint 0)) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x 942.08 :y -860.16 :z 1269.76 :w 163840.0) ) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x -942.08 :y -860.16 :z 1269.76 :w 163840.0) ) - (set-gravity-length (-> obj root dynam) 491520.0) - (set! (-> obj minimap) #f) + (set-gravity-length (-> this root dynam) 491520.0) + (set! (-> this minimap) #f) (none) ) -(defmethod citizen-init! metalhead-flitter ((obj metalhead-flitter)) +(defmethod citizen-init! metalhead-flitter ((this metalhead-flitter)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen-enemy citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj speed-walk) (-> obj enemy-info walk-travel-speed)) - (set! (-> obj dist-walk-anim) (-> obj enemy-info walk-travel-speed)) - (set! (-> obj dist-run-anim) (-> obj enemy-info run-travel-speed)) - (set! (-> obj speed-run) (-> obj enemy-info walk-travel-speed)) + (set! (-> this speed-walk) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-walk-anim) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-run-anim) (-> this enemy-info run-travel-speed)) + (set! (-> this speed-run) (-> this enemy-info walk-travel-speed)) 0 (none) ) diff --git a/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc b/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc index ac931f5848..89af60cff7 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-grunt.gc @@ -254,76 +254,76 @@ ) -(defmethod general-event-handler metalhead-grunt ((obj metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler metalhead-grunt ((this metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (let ((s5-1 (-> obj incoming knocked-type))) + ((zero? (-> this hit-points)) + (let ((s5-1 (-> this incoming knocked-type))) (cond ((and (= s5-1 (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-33 (-> obj next-state name))) - (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) - ) + (not (and (-> this next-state) (let ((v1-33 (-> this next-state name))) + (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ((or (= s5-1 (knocked-type knocked-type-4)) (= s5-1 (knocked-type knocked-type-6))) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - (go (method-of-object obj knocked)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) + (go (method-of-object this knocked)) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t ) (else - ((method-of-type citizen-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod go-ambush metalhead-grunt ((obj metalhead-grunt)) +(defmethod go-ambush metalhead-grunt ((this metalhead-grunt)) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user10)) - (go (method-of-object obj falling-ambush)) + ((logtest? (-> this fact enemy-options) (enemy-option user10)) + (go (method-of-object this falling-ambush)) ) - ((logtest? (-> obj fact enemy-options) (enemy-option user11)) - (go (method-of-object obj jumping-ambush)) + ((logtest? (-> this fact enemy-options) (enemy-option user11)) + (go (method-of-object this jumping-ambush)) ) (else - (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> obj name)) - (go-hostile obj) + (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> this name)) + (go-hostile this) ) ) ) @@ -379,13 +379,13 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 metalhead-grunt ((obj metalhead-grunt)) - (case (-> obj jump-why) +(defmethod enemy-method-93 metalhead-grunt ((this metalhead-grunt)) + (case (-> this jump-why) ((2) - (go (method-of-object obj jumping-ambush-cont)) + (go (method-of-object this jumping-ambush-cont)) ) (else - ((method-of-type citizen-enemy enemy-method-93) obj) + ((method-of-type citizen-enemy enemy-method-93) this) ) ) (none) @@ -575,7 +575,7 @@ ) ) -(defmethod metalhead-grunt-method-209 metalhead-grunt ((obj metalhead-grunt) (arg0 float)) +(defmethod metalhead-grunt-method-209 metalhead-grunt ((this metalhead-grunt) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -583,12 +583,12 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((gp-0 (get-enemy-target obj))) + (let ((gp-0 (get-enemy-target this))) (when gp-0 (let ((v1-3 (get-trans gp-0 0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector-! s4-0 v1-3 (-> obj root trans)) + (vector-! s4-0 v1-3 (-> this root trans)) (.lvf vf1 (&-> s4-0 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -602,18 +602,18 @@ (f0-2 12288.0) ) (when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0)) - (let ((f26-0 (quaternion-y-angle (-> obj root quat))) + (let ((f26-0 (quaternion-y-angle (-> this root quat))) (f0-7 (atan (-> s4-0 x) (-> s4-0 z))) (f1-0 1228.8) ) (cond ((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7)))) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) ((let ((f0-10 12288.0)) (< f30-0 (* f0-10 f0-10)) ) - (go (method-of-object obj spin-attack)) + (go (method-of-object this spin-attack)) ) ) ) @@ -929,39 +929,39 @@ ) ) -(defmethod enemy-method-77 metalhead-grunt ((obj metalhead-grunt) (arg0 (pointer float))) +(defmethod enemy-method-77 metalhead-grunt ((this metalhead-grunt) (arg0 (pointer float))) (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (let ((v1-2 (ash 1 (-> *grunt-global-info* prev-yellow-hit-anim-index))) - (a0-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (a0-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and a0-7 (or (= a0-7 (-> obj draw art-group data 16)) - (= a0-7 (-> obj draw art-group data 38)) - (= a0-7 (-> obj draw art-group data 39)) - (= a0-7 (-> obj draw art-group data 40)) + (if (and a0-7 (or (= a0-7 (-> this draw art-group data 16)) + (= a0-7 (-> this draw art-group data 38)) + (= a0-7 (-> this draw art-group data 39)) + (= a0-7 (-> this draw art-group data 40)) ) ) (set! a2-3 (logior v1-2 4)) (set! a2-3 (logior v1-2 8)) ) ) - (let ((s4-0 (enemy-method-120 obj 4 a2-3))) + (let ((s4-0 (enemy-method-120 this 4 a2-3))) (set! (-> *grunt-global-info* prev-yellow-hit-anim-index) s4-0) - (set! (-> obj yellow-hit-anim) (-> *grunt-global-info* yellow-hit-anim s4-0)) - (let ((v1-11 (get-rand-int obj 3))) + (set! (-> this yellow-hit-anim) (-> *grunt-global-info* yellow-hit-anim s4-0)) + (let ((v1-11 (get-rand-int this 3))) (if (= s4-0 3) (set! v1-11 2) ) - (set! (-> obj use-charge-anim-index) v1-11) + (set! (-> this use-charge-anim-index) v1-11) ) ) - (let ((s4-1 (-> obj draw art-group data (-> obj yellow-hit-anim anim-index)))) + (let ((s4-1 (-> this draw art-group data (-> this yellow-hit-anim anim-index)))) (ja-channel-push! 1 0) - (let ((a0-19 (-> obj skel root-channel 0))) + (let ((a0-19 (-> this skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-19 param 1) (-> arg0 0)) @@ -972,33 +972,33 @@ #t ) (((knocked-type knocked-type-6)) - (let* ((v1-24 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let* ((v1-24 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) - (s4-2 (and v1-24 (or (= v1-24 (-> obj draw art-group data 16)) - (= v1-24 (-> obj draw art-group data 38)) - (= v1-24 (-> obj draw art-group data 39)) - (= v1-24 (-> obj draw art-group data 40)) + (s4-2 (and v1-24 (or (= v1-24 (-> this draw art-group data 16)) + (= v1-24 (-> this draw art-group data 38)) + (= v1-24 (-> this draw art-group data 39)) + (= v1-24 (-> this draw art-group data 40)) ) ) ) ) - (if (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (logior! (-> obj grunt-flags) 2) + (if (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (logior! (-> this grunt-flags) 2) ) (cond - ((and (not s4-2) (logtest? (-> obj grunt-flags) 2)) + ((and (not s4-2) (logtest? (-> this grunt-flags) 2)) (set! s4-2 #t) (ja-channel-push! 1 (seconds 0.17)) ) (else - (let ((v1-36 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-36 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-36 (= v1-36 (-> obj draw art-group data 44))) + (if (and v1-36 (= v1-36 (-> this draw art-group data 44))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) @@ -1011,22 +1011,22 @@ (set! a2-5 (logior v1-42 7)) ) ) - (let ((v1-46 (enemy-method-120 obj 6 a2-5))) + (let ((v1-46 (enemy-method-120 this 6 a2-5))) (set! (-> *grunt-global-info* prev-blue-hit-anim-index) v1-46) - (set! (-> obj blue-hit-anim) (-> *grunt-global-info* blue-hit-anim v1-46)) + (set! (-> this blue-hit-anim) (-> *grunt-global-info* blue-hit-anim v1-46)) ) (let ((a2-6 0)) - (when (not (logtest? (-> obj grunt-flags) 2)) + (when (not (logtest? (-> this grunt-flags) 2)) (if s4-2 (set! a2-6 (logior a2-6 3)) (set! a2-6 (logior a2-6 4)) ) ) - (set! (-> obj use-charge-anim-index) (enemy-method-120 obj 3 a2-6)) + (set! (-> this use-charge-anim-index) (enemy-method-120 this 3 a2-6)) ) ) - (let ((a1-26 (-> obj draw art-group data (-> obj blue-hit-anim anim-index))) - (a0-51 (-> obj skel root-channel 0)) + (let ((a1-26 (-> this draw art-group data (-> this blue-hit-anim anim-index))) + (a0-51 (-> this skel root-channel 0)) ) (set! (-> a0-51 frame-group) (the-as art-joint-anim a1-26)) (set! (-> a0-51 param 0) (the float (+ (-> (the-as art-joint-anim a1-26) frames num-frames) -1))) @@ -1039,28 +1039,28 @@ (else 0 (cond - ((or (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (= (-> obj incoming knocked-type) (knocked-type knocked-type-3)) + ((or (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (= (-> this incoming knocked-type) (knocked-type knocked-type-3)) ) (set! v1-72 3) ) (else (let ((s4-3 (ash 1 (-> *grunt-global-info* prev-knocked-anim-index)))) - (let ((s3-0 (-> obj root))) + (let ((s3-0 (-> this root))) (if (>= 16384.0 (fabs (deg- (quaternion-y-angle (-> s3-0 quat)) (atan (-> s3-0 transv x) (-> s3-0 transv z))))) (set! s4-3 (logior s4-3 4)) ) ) - (set! v1-72 (enemy-method-120 obj 3 s4-3)) + (set! v1-72 (enemy-method-120 this 3 s4-3)) ) ) ) (set! (-> *grunt-global-info* prev-knocked-anim-index) v1-72) - (set! (-> obj knocked-anim-index) v1-72) - (set! (-> obj knocked-anim) (-> *grunt-global-info* knocked-anim v1-72)) - (let ((s4-4 (-> obj draw art-group data (-> obj knocked-anim anim-index)))) + (set! (-> this knocked-anim-index) v1-72) + (set! (-> this knocked-anim) (-> *grunt-global-info* knocked-anim v1-72)) + (let ((s4-4 (-> this draw art-group data (-> this knocked-anim anim-index)))) (ja-channel-push! 1 0) - (let ((a0-68 (-> obj skel root-channel 0))) + (let ((a0-68 (-> this skel root-channel 0))) (set! (-> a0-68 frame-group) (the-as art-joint-anim s4-4)) (set! (-> a0-68 param 0) (the float (+ (-> (the-as art-joint-anim s4-4) frames num-frames) -1))) (set! (-> a0-68 param 1) (-> arg0 0)) @@ -1073,26 +1073,26 @@ ) ) -(defmethod enemy-method-78 metalhead-grunt ((obj metalhead-grunt) (arg0 (pointer float))) +(defmethod enemy-method-78 metalhead-grunt ((this metalhead-grunt) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (or (logtest? (-> obj grunt-flags) 2) (let ((v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) - ) - ) - (not (and v1-7 (or (= v1-7 (-> obj draw art-group data 16)) - (= v1-7 (-> obj draw art-group data 38)) - (= v1-7 (-> obj draw art-group data 39)) - (= v1-7 (-> obj draw art-group data 40)) - ) - ) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (or (logtest? (-> this grunt-flags) 2) (let ((v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) ) - ) + (not (and v1-7 (or (= v1-7 (-> this draw art-group data 16)) + (= v1-7 (-> this draw art-group data 38)) + (= v1-7 (-> this draw art-group data 39)) + (= v1-7 (-> this draw art-group data 40)) + ) + ) + ) + ) ) - (let ((s4-0 (-> obj draw art-group data 44))) + (let ((s4-0 (-> this draw art-group data 44))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-16 (-> obj skel root-channel 0))) + (let ((a0-16 (-> this skel root-channel 0))) (set! (-> a0-16 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-16 param 1) (-> arg0 0)) @@ -1100,15 +1100,19 @@ (joint-control-channel-group! a0-16 (the-as art-joint-anim s4-0) num-func-seek!) ) ) - (logand! (-> obj grunt-flags) -3) + (logand! (-> this grunt-flags) -3) #t ) ) - ((!= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (let ((a1-6 - (-> obj draw art-group data (-> *grunt-global-info* knocked-land-anim (-> obj knocked-anim-index) anim-index)) - ) - (a0-23 (-> obj skel root-channel 0)) + ((!= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (let ((a1-6 (-> this + draw + art-group + data + (-> *grunt-global-info* knocked-land-anim (-> this knocked-anim-index) anim-index) + ) + ) + (a0-23 (-> this skel root-channel 0)) ) (set! (-> a0-23 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-23 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) @@ -1168,22 +1172,22 @@ :post (-> (method-of-type nav-enemy idle) post) ) -(defmethod metalhead-grunt-method-211 metalhead-grunt ((obj metalhead-grunt)) +(defmethod metalhead-grunt-method-211 metalhead-grunt ((this metalhead-grunt)) 0 (none) ) ;; WARN: Return type mismatch citizen-enemy vs metalhead-grunt. -(defmethod relocate metalhead-grunt ((obj metalhead-grunt) (arg0 int)) - (if (nonzero? (-> obj intro-path)) - (&+! (-> obj intro-path) arg0) +(defmethod relocate metalhead-grunt ((this metalhead-grunt) (arg0 int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) arg0) ) - (the-as metalhead-grunt ((method-of-type citizen-enemy relocate) obj arg0)) + (the-as metalhead-grunt ((method-of-type citizen-enemy relocate) this arg0)) ) -(defmethod init-enemy-collision! metalhead-grunt ((obj metalhead-grunt)) +(defmethod init-enemy-collision! metalhead-grunt ((this metalhead-grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1270,67 +1274,67 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 8)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod get-nav-info metalhead-grunt ((obj metalhead-grunt)) +(defmethod get-nav-info metalhead-grunt ((this metalhead-grunt)) *metalhead-grunt-nav-enemy-info* ) -(defmethod init-enemy! metalhead-grunt ((obj metalhead-grunt)) +(defmethod init-enemy! metalhead-grunt ((this metalhead-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj (get-nav-info obj)) - (let ((v1-6 (-> obj neck))) + (init-enemy-behaviour-and-stats! this (get-nav-info this)) + (let ((v1-6 (-> this neck))) (set! (-> v1-6 up) (the-as uint 1)) (set! (-> v1-6 nose) (the-as uint 2)) (set! (-> v1-6 ear) (the-as uint 0)) (set-vector! (-> v1-6 twist-max) 11832.889 11832.889 0.0 1.0) (set! (-> v1-6 ignore-angle) 30947.555) ) - (let ((v1-8 (-> obj nav))) + (let ((v1-8 (-> this nav))) (set! (-> v1-8 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) + (set-gravity-length (-> this root dynam) 573440.0) (let ((s5-2 *grunt-global-info*)) - (set! (-> obj patrol-anim) (-> s5-2 patrol-anim (get-rand-int obj 4))) - (set! (-> obj charge-anim) (-> s5-2 charge-anim (get-rand-int obj 3))) - (set! (-> obj attack-anim) (-> s5-2 attack-anim (get-rand-int obj 2))) + (set! (-> this patrol-anim) (-> s5-2 patrol-anim (get-rand-int this 4))) + (set! (-> this charge-anim) (-> s5-2 charge-anim (get-rand-int this 3))) + (set! (-> this attack-anim) (-> s5-2 attack-anim (get-rand-int this 2))) ) - (set! (-> obj use-charge-anim-index) -1) - (if (zero? (get-rand-int obj 2)) - (logior! (-> obj grunt-flags) 1) + (set! (-> this use-charge-anim-index) -1) + (if (zero? (get-rand-int this 2)) + (logior! (-> this grunt-flags) 1) ) - (if (zero? (get-rand-int obj 2)) - (logior! (-> obj grunt-flags) 4) + (if (zero? (get-rand-int this 2)) + (logior! (-> this grunt-flags) 4) ) - (set! (-> obj intro-path) (new 'process 'path-control obj 'intro 0.0 (the-as entity #f) #t)) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x 1433.6 :y 2785.28 :z -1761.28 :w 163840.0) ) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x -1433.6 :y 2785.28 :z -1761.28 :w 163840.0) ) - (set! (-> obj water-anim) -1) - (set! (-> obj minimap) #f) + (set! (-> this water-anim) -1) + (set! (-> this minimap) #f) 0 (none) ) 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 1a53f0ce96..750a2dc3e8 100644 --- a/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc +++ b/goal_src/jak2/levels/city/traffic/citizen/metalhead-predator.gc @@ -17,27 +17,27 @@ ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound metalhead-predator-shot ((obj metalhead-predator-shot) (arg0 projectile-options)) +(defmethod play-impact-sound metalhead-predator-shot ((this metalhead-predator-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "pred-shot-hit") ) (((projectile-options lose-altitude proj-options-2)) - (let ((f0-0 (doppler-pitch-shift (-> obj root trans) (-> obj root transv))) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) (a0-8 (static-sound-spec "pred-shot-loop" :volume 0.0 :mask (pitch reg0))) ) (set! (-> a0-8 volume) 1024) (set! (-> a0-8 pitch-mod) (the int (* 1524.0 f0-0))) - (sound-play-by-spec a0-8 (-> obj sound-id) (-> obj root trans)) + (sound-play-by-spec a0-8 (-> this sound-id) (-> this root trans)) ) ) ) (none) ) -(defmethod init-proj-collision! metalhead-predator-shot ((obj metalhead-predator-shot)) +(defmethod init-proj-collision! metalhead-predator-shot ((this metalhead-predator-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -79,24 +79,24 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) ) -(defmethod init-proj-settings! metalhead-predator-shot ((obj metalhead-predator-shot)) +(defmethod init-proj-settings! metalhead-predator-shot ((this metalhead-predator-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'predator-shot) - (set! (-> obj max-speed) 532480.0) - (set! (-> obj move) metalhead-shot-move) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj timeout) (seconds 0.767)) - (set! (-> obj sound-id) (new-sound-id)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'predator-shot) + (set! (-> this max-speed) 532480.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.767)) + (set! (-> this sound-id) (new-sound-id)) + (set-gravity-length (-> this root dynam) 573440.0) (none) ) @@ -330,47 +330,47 @@ ) ) -(defmethod metalhead-predator-method-208 metalhead-predator ((obj metalhead-predator)) +(defmethod metalhead-predator-method-208 metalhead-predator ((this metalhead-predator)) (cond - ((< (-> obj hit-points) 2) - (when (!= (-> obj dest-fade) 128.0) + ((< (-> this hit-points) 2) + (when (!= (-> this dest-fade) 128.0) (sound-play "pred-uncloak") - (set! (-> obj sound) (the-as ambient-sound 0)) + (set! (-> this sound) (the-as ambient-sound 0)) 0 ) - (set! (-> obj dest-fade) 128.0) + (set! (-> this dest-fade) 128.0) ) (else - (set! (-> obj dest-fade) 0.0) + (set! (-> this dest-fade) 0.0) ) ) - (seek! (-> obj fade) (-> obj dest-fade) (* 60.0 (seconds-per-frame))) - (set! (-> obj draw force-fade) (the-as uint (the int (-> obj fade)))) + (seek! (-> this fade) (-> this dest-fade) (* 60.0 (seconds-per-frame))) + (set! (-> this draw force-fade) (the-as uint (the int (-> this fade)))) (cond - ((zero? (-> obj draw force-fade)) - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 0 4) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((zero? (-> this draw force-fade)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 0 4) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) - ((= (-> obj draw force-fade) 128) - (setup-masks (-> obj draw) 0 8) - (setup-masks (-> obj draw) 4 0) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((= (-> this draw force-fade) 128) + (setup-masks (-> this draw) 0 8) + (setup-masks (-> this draw) 4 0) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) (else - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 4 0) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 4 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) ) - (if (< 245760.0 (vector-vector-distance (-> obj root trans) (camera-pos))) - (setup-masks (-> obj draw) 0 8) + (if (< 245760.0 (vector-vector-distance (-> this root trans) (camera-pos))) + (setup-masks (-> this draw) 0 8) ) - (when (< (current-time) (-> obj shock-effect-end)) - (when (>= (- (current-time) (-> obj shock-effect-time)) (seconds 0.04)) - (set! (-> obj shock-effect-time) (current-time)) + (when (< (current-time) (-> this shock-effect-end)) + (when (time-elapsed? (-> this shock-effect-time) (seconds 0.04)) + (set-time! (-> this shock-effect-time)) (process-drawable-shock-skel-effect - obj + this (-> *lightning-spec-id-table* 15) lightning-probe-callback (-> *part-id-table* 166) @@ -384,97 +384,97 @@ (none) ) -(defmethod track-target! metalhead-predator ((obj metalhead-predator)) +(defmethod track-target! metalhead-predator ((this metalhead-predator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type citizen-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (metalhead-predator-method-208 obj) - (set-dst-proc! (-> obj los) (-> obj focus handle)) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (metalhead-predator-method-208 this) + (set-dst-proc! (-> this los) (-> this focus handle)) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) (none) ) ;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler metalhead-predator ((obj metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler metalhead-predator ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) - (set! (-> obj shock-effect-end) (the-as int (+ (current-time) (seconds 1)))) - ((method-of-type citizen-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (set! (-> this shock-effect-end) (the-as int (+ (current-time) (seconds 1)))) + ((method-of-type citizen-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('combo) - (and (not (and (-> obj next-state) (= (-> obj next-state name) 'inactive))) - (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) + (and (not (and (-> this next-state) (= (-> this next-state name) 'inactive))) + (and (not (logtest? (enemy-flag multi-focus) (-> this enemy-flags))) (nonzero? (-> this hit-points))) ) ) (else - ((method-of-type citizen-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod enemy-method-77 metalhead-predator ((obj metalhead-predator) (arg0 (pointer float))) +(defmethod enemy-method-77 metalhead-predator ((this metalhead-predator) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + ((zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 14))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 14)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 14)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!) ) ) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((v1-32 (get-rand-int obj 2))) + (let ((v1-32 (get-rand-int this 2))) (cond ((zero? v1-32) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 21)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) (-> arg0 0)) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) ) ) ((= v1-32 1) - (let ((a0-12 (-> obj skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-12 param 1) (-> arg0 0)) (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) ) ) @@ -482,26 +482,26 @@ ) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-15 (-> obj skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-15 param 1) (-> arg0 0)) (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-17 (-> obj skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (let ((a0-17 (-> this skel root-channel 0))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) ) (set! (-> a0-17 param 1) (-> arg0 0)) (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) ) ) ) @@ -510,73 +510,73 @@ ) ) -(defmethod enemy-method-78 metalhead-predator ((obj metalhead-predator) (arg0 (pointer float))) +(defmethod enemy-method-78 metalhead-predator ((this metalhead-predator) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + ((zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 15))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 15)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 15)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) ) ) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) (-> arg0 0)) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) ) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-11 (-> obj skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19))) + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) ) (set! (-> a0-11 param 1) (-> arg0 0)) (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-13 (-> obj skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 13))) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 13)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) ) (set! (-> a0-13 param 1) (-> arg0 0)) (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 13)) num-func-seek!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) ) ) ) @@ -585,11 +585,11 @@ ) ) -(defmethod get-inv-mass metalhead-predator ((obj metalhead-predator)) +(defmethod get-inv-mass metalhead-predator ((this metalhead-predator)) 0.5 ) -(defmethod metalhead-predator-method-207 metalhead-predator ((obj metalhead-predator) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod metalhead-predator-method-207 metalhead-predator ((this metalhead-predator) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f0-0 1228.8) (f30-0 6144.0) @@ -599,8 +599,8 @@ (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) (set! (-> v1-4 collide-with) (collide-spec backgnd)) - (set! (-> v1-4 ignore-process0) obj) - (set! (-> v1-4 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) ) @@ -629,8 +629,8 @@ (let ((v1-14 s5-0)) (set! (-> v1-14 radius) f30-0) (set! (-> v1-14 collide-with) (collide-spec enemy hit-by-player-list hit-by-others-list)) - (set! (-> v1-14 ignore-process0) obj) - (set! (-> v1-14 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-14 ignore-process0) this) + (set! (-> v1-14 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-14 action-mask) (collide-action solid)) ) @@ -659,7 +659,7 @@ ) ) -(defmethod metalhead-predator-method-206 metalhead-predator ((obj metalhead-predator) (arg0 int) (arg1 float)) +(defmethod metalhead-predator-method-206 metalhead-predator ((this metalhead-predator) (arg0 int) (arg1 float)) (local-vars (sv-240 vector) (sv-256 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -669,15 +669,15 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((a1-1 (-> obj node-list data arg0)) + (let ((a1-1 (-> this node-list data arg0)) (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options)) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (let* ((v1-10 *game-info*) (a0-11 (+ (-> v1-10 attack-id) 1)) ) @@ -686,11 +686,11 @@ ) (set! (-> s5-0 timeout) (seconds 4)) (vector<-cspace! (-> s5-0 pos) a1-1) - (let ((s3-0 (handle->process (-> obj focus handle))) + (let ((s3-0 (handle->process (-> this focus handle))) (s2-0 (new 'stack-no-clear 'vector)) ) (when s3-0 - (seek! (-> obj miss-amount) (* 0.2 (vector-length (-> (the-as process-drawable s3-0) root transv))) 4096.0) + (seek! (-> this miss-amount) (* 0.2 (vector-length (-> (the-as process-drawable s3-0) root transv))) 4096.0) (set! (-> s2-0 quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) (set! sv-240 (new 'stack-no-clear 'vector)) (let ((v1-25 (-> s5-0 pos)) @@ -729,19 +729,19 @@ (vector-normalize! sv-256 1.0) (vector-cross! s0-0 sv-240 sv-256) (vector-normalize! s0-0 1.0) - (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-240 (-> obj shoot-angle)))) + (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-240 (-> this shoot-angle)))) (vector-orient-by-quat! sv-256 sv-256 a2-5) ) (let* ((t9-9 quaternion-vector-angle!) (a0-27 (new 'stack-no-clear 'quaternion)) - (a2-6 (-> obj shoot-angle)) + (a2-6 (-> this shoot-angle)) (a2-7 (t9-9 a0-27 sv-240 a2-6)) ) (vector-orient-by-quat! s0-0 s0-0 a2-7) ) (let ((a0-29 s1-1)) (let ((v1-33 s2-0)) - (let ((a1-17 (-> obj miss-amount))) + (let ((a1-17 (-> this miss-amount))) (.mov vf7 a1-17) ) (.lvf vf5 (&-> sv-256 quad)) @@ -753,7 +753,7 @@ (.svf (&-> a0-29 quad) vf6) ) (let ((v1-34 s2-0)) - (let ((a0-30 (* arg1 (-> obj miss-amount)))) + (let ((a0-30 (* arg1 (-> this miss-amount)))) (.mov vf7 a0-30) ) (.lvf vf5 (&-> s0-0 quad)) @@ -768,13 +768,13 @@ (vector-! (-> s5-0 vel) s2-0 (-> s5-0 pos)) (vector-normalize! (-> s5-0 vel) 409600.0) (when (metalhead-predator-method-207 - obj + this (-> s5-0 pos) (vector+! (new 'stack-no-clear 'vector) (-> s5-0 pos) (-> s5-0 vel)) (get-trans (the-as process-focusable s3-0) 3) ) (vector-normalize! (-> s5-0 vel) 532480.0) - (spawn-projectile metalhead-predator-shot s5-0 obj *default-dead-pool*) + (spawn-projectile metalhead-predator-shot s5-0 this *default-dead-pool*) ) ) ) @@ -812,7 +812,7 @@ ) ) (set! (-> self want-stop) #f) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self next-change) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 4.0 8.0)))))) (if (zero? (get-rand-int self 3)) (sound-play "pred-talk") @@ -835,7 +835,7 @@ (go-virtual active) ) (when (get-enemy-target self) - (when (and gp-0 (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + (when (and gp-0 (time-elapsed? (-> self state-time) (-> self reaction-time))) (cond ((< (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)) 16384.0) (go-virtual close-attack) @@ -1001,8 +1001,8 @@ :post nav-enemy-chase-post ) -(defmethod metalhead-predator-method-205 metalhead-predator ((obj metalhead-predator) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod metalhead-predator-method-205 metalhead-predator ((this metalhead-predator) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (+ (-> v1-1 specific 0) -2))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child (+ a0-1 2)))) (if arg0 @@ -1016,9 +1016,9 @@ (none) ) -(defmethod init-enemy-collision! metalhead-predator ((obj metalhead-predator)) +(defmethod init-enemy-collision! metalhead-predator ((this metalhead-predator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1090,65 +1090,75 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 8)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-drawable vs metalhead-predator. -(defmethod relocate metalhead-predator ((obj metalhead-predator) (arg0 int)) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method metalhead-predator 7)) + this + arg0 + ) ) ) -(defmethod init-enemy! metalhead-predator ((obj metalhead-predator)) +(defmethod init-enemy! metalhead-predator ((this metalhead-predator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-metalhead-predator" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *metalhead-predator-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *metalhead-predator-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 491520.0) - (set! (-> obj draw lod-set lod 1 dist) 573440.0) - (set! (-> obj anim-shuffle) 6) - (set! (-> obj anim-walk) 6) - (set! (-> obj speed-walk) 12288.0) - (set! (-> obj dist-walk-anim) 16179.2) - (set! (-> obj dist-run-anim) 26214.4) - (set! (-> obj anim-run) 7) - (set! (-> obj speed-run) 49152.0) - (set! (-> obj water-anim) -1) - (add-connection *part-engine* obj 8 obj 318 (new 'static 'vector :x 1228.8 :y 450.56 :z 983.04 :w 614400.0)) - (add-connection *part-engine* obj 8 obj 318 (new 'static 'vector :x -1228.8 :y 450.56 :z 983.04 :w 614400.0)) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd obstacle)) - (set! (-> obj minimap) #f) + (set! (-> this draw lod-set lod 0 dist) 491520.0) + (set! (-> this draw lod-set lod 1 dist) 573440.0) + (set! (-> this anim-shuffle) 6) + (set! (-> this anim-walk) 6) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 16179.2) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 7) + (set! (-> this speed-run) 49152.0) + (set! (-> this water-anim) -1) + (add-connection *part-engine* this 8 this 318 (new 'static 'vector :x 1228.8 :y 450.56 :z 983.04 :w 614400.0)) + (add-connection + *part-engine* + this + 8 + this + 318 + (new 'static 'vector :x -1228.8 :y 450.56 :z 983.04 :w 614400.0) + ) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle)) + (set! (-> this minimap) #f) 0 (none) ) -(defmethod citizen-init! metalhead-predator ((obj metalhead-predator)) +(defmethod citizen-init! metalhead-predator ((this metalhead-predator)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen-enemy citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 0 4) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) - (set! (-> obj draw force-fade) (the-as uint 0)) - (set! (-> obj fade) 0.0) - (set! (-> obj dest-fade) 0.0) - (set! (-> obj curr-node) -1) - (set! (-> obj next-change) 0) - (set! (-> obj miss-amount) 16384.0) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 0 4) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> this draw force-fade) (the-as uint 0)) + (set! (-> this fade) 0.0) + (set! (-> this dest-fade) 0.0) + (set! (-> this curr-node) -1) + (set! (-> this next-change) 0) + (set! (-> this miss-amount) 16384.0) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) 0 (none) ) diff --git a/goal_src/jak2/levels/city/traffic/traffic-engine.gc b/goal_src/jak2/levels/city/traffic/traffic-engine.gc index 5e5cdc9a72..bd537ac7e9 100644 --- a/goal_src/jak2/levels/city/traffic/traffic-engine.gc +++ b/goal_src/jak2/levels/city/traffic/traffic-engine.gc @@ -37,9 +37,9 @@ (none) ) -(defmethod debug-draw vis-cell ((obj vis-cell)) - (dotimes (s5-0 (-> obj segment-count)) - (let ((s4-0 (-> obj segment-array s5-0))) +(defmethod debug-draw vis-cell ((this vis-cell)) + (dotimes (s5-0 (-> this segment-count)) + (let ((s4-0 (-> this segment-array s5-0))) (add-debug-line #t (bucket-id debug2) @@ -56,25 +56,25 @@ (none) ) -(defmethod reset-segment-counts vis-cell ((obj vis-cell)) - (set! (-> obj incoming-segment-count) 0) - (set! (-> obj segment-count) 0) +(defmethod reset-segment-counts vis-cell ((this vis-cell)) + (set! (-> this incoming-segment-count) 0) + (set! (-> this segment-count) 0) 0 (none) ) -(defmethod setup-grid-from-bounding-box grid-info ((obj grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int)) +(defmethod setup-grid-from-bounding-box grid-info ((this grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int)) "Set up a grid which fills the given bounding box" - (mem-copy! (the-as pointer (-> obj box)) arg0 32) + (mem-copy! (the-as pointer (-> this box)) arg0 32) (let ((v1-0 (new 'stack-no-clear 'vector))) (dotimes (a0-2 3) - (set! (-> v1-0 data a0-2) (- (-> obj box max data a0-2) (-> obj box min data a0-2))) + (set! (-> v1-0 data a0-2) (- (-> this box max data a0-2) (-> this box min data a0-2))) ) (let ((f0-5 (sqrtf (/ (the float arg1) (* (-> v1-0 x) (-> v1-0 z) (the float arg2)))))) (let ((a0-6 (min 126 (+ arg1 -1)))) - (set! (-> obj dimension-array 0) (max 1 (min (the int (* f0-5 (-> v1-0 x))) a0-6))) - (set! (-> obj dimension-array 1) arg2) - (set! (-> obj dimension-array 2) (max 1 (min (the int (* f0-5 (-> v1-0 z))) a0-6))) + (set! (-> this dimension-array 0) (max 1 (min (the int (* f0-5 (-> v1-0 x))) a0-6))) + (set! (-> this dimension-array 1) arg2) + (set! (-> this dimension-array 2) (max 1 (min (the int (* f0-5 (-> v1-0 z))) a0-6))) ) (let* ((f1-11 (* f0-5 (-> v1-0 z))) (f1-13 (- f1-11 (the float (the int f1-11)))) @@ -82,52 +82,52 @@ ) (cond ((< f1-13 (- f0-6 (the float (the int f0-6)))) - (if (>= arg1 (* (* (+ (-> obj dimension-array 0) 1) (-> obj dimension-array 1)) (-> obj dimension-array 2))) - (+! (-> obj dimension-array 0) 1) + (if (>= arg1 (* (* (+ (-> this dimension-array 0) 1) (-> this dimension-array 1)) (-> this dimension-array 2))) + (+! (-> this dimension-array 0) 1) ) ) (else - (if (>= arg1 (* (* (-> obj dimension-array 0) (-> obj dimension-array 1)) (+ (-> obj dimension-array 2) 1))) - (+! (-> obj dimension-array 2) 1) + (if (>= arg1 (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (+ (-> this dimension-array 2) 1))) + (+! (-> this dimension-array 2) 1) ) ) ) ) ) (dotimes (a0-24 3) - (set! (-> obj axis-scale a0-24) (/ (the float (-> obj dimension-array a0-24)) (-> v1-0 data a0-24))) - (set! (-> obj cell-size data a0-24) (/ (-> v1-0 data a0-24) (the float (-> obj dimension-array a0-24)))) + (set! (-> this axis-scale a0-24) (/ (the float (-> this dimension-array a0-24)) (-> v1-0 data a0-24))) + (set! (-> this cell-size data a0-24) (/ (-> v1-0 data a0-24) (the float (-> this dimension-array a0-24)))) ) ) 0 (none) ) -(defmethod lookup-cell-for-point grid-info ((obj grid-info) (arg0 vis-grid-pos) (arg1 vector)) +(defmethod lookup-cell-for-point grid-info ((this grid-info) (arg0 vis-grid-pos) (arg1 vector)) "Get the grid cell containing the point (or closest, if outside the grid)" (set! (-> arg0 x) (max 0 - (min (the int (* (- (-> arg1 x) (-> obj box min x)) (-> obj axis-scale 0))) (+ (-> obj dimension-array 0) -1)) + (min (the int (* (- (-> arg1 x) (-> this box min x)) (-> this axis-scale 0))) (+ (-> this dimension-array 0) -1)) ) ) (set! (-> arg0 y) (max 0 - (min (the int (* (- (-> arg1 y) (-> obj box min y)) (-> obj axis-scale 1))) (+ (-> obj dimension-array 1) -1)) + (min (the int (* (- (-> arg1 y) (-> this box min y)) (-> this axis-scale 1))) (+ (-> this dimension-array 1) -1)) ) ) (set! (-> arg0 z) (max 0 - (min (the int (* (- (-> arg1 z) (-> obj box min z)) (-> obj axis-scale 2))) (+ (-> obj dimension-array 2) -1)) + (min (the int (* (- (-> arg1 z) (-> this box min z)) (-> this axis-scale 2))) (+ (-> this dimension-array 2) -1)) ) ) 0 (none) ) -(defmethod lookup-box-for-sphere grid-info ((obj grid-info) (arg0 vis-grid-box) (arg1 vector)) +(defmethod lookup-box-for-sphere grid-info ((this grid-info) (arg0 vis-grid-box) (arg1 vector)) "Get the box of cells containing the given sphere" (rlet ((vf0 :class vf) (vf4 :class vf) @@ -158,40 +158,40 @@ (.add.x.vf vf5 vf4 vf6 :mask #b111) (.svf (&-> a0-2 quad) vf5) ) - (lookup-cell-for-point obj (-> arg0 min) (-> s5-0 min)) - (lookup-cell-for-point obj (-> arg0 max) (-> s5-0 max)) + (lookup-cell-for-point this (-> arg0 min) (-> s5-0 min)) + (lookup-cell-for-point this (-> arg0 max) (-> s5-0 max)) ) 0 (none) ) ) -(defmethod debug-draw-cell grid-info ((obj grid-info) (arg0 vis-grid-pos) (arg1 rgba)) +(defmethod debug-draw-cell grid-info ((this grid-info) (arg0 vis-grid-pos) (arg1 rgba)) (let ((v1-0 (new 'stack-no-clear 'bounding-box))) (dotimes (a3-0 3) (set! (-> v1-0 min data a3-0) - (+ (-> obj box min data a3-0) (* (the float (-> arg0 data a3-0)) (-> obj cell-size data a3-0))) + (+ (-> this box min data a3-0) (* (the float (-> arg0 data a3-0)) (-> this cell-size data a3-0))) ) ) - (vector+! (-> v1-0 max) (-> v1-0 min) (-> obj cell-size)) + (vector+! (-> v1-0 max) (-> v1-0 min) (-> this cell-size)) (add-debug-box #t (bucket-id debug2) (-> v1-0 min) (-> v1-0 max) arg1) ) 0 (none) ) -(defmethod debug-draw-grid grid-info ((obj grid-info) (arg0 rgba)) - (draw-grid (the-as vector (-> obj box)) (-> obj box max) (-> obj dimension-array) arg0) +(defmethod debug-draw-grid grid-info ((this grid-info) (arg0 rgba)) + (draw-grid (the-as vector (-> this box)) (-> this box max) (-> this dimension-array) arg0) 0 (none) ) -(defmethod try-creating-new-suppression-box traffic-suppression-params ((obj traffic-suppression-params)) +(defmethod try-creating-new-suppression-box traffic-suppression-params ((this traffic-suppression-params)) "Try getting new suppression box, return if it succeeded. ID is stored in the params." (cond - ((= (-> obj id) -1) - (send-event *traffic-manager* 'new-suppression-box obj) - (!= (-> obj id) -1) + ((= (-> this id) -1) + (send-event *traffic-manager* 'new-suppression-box this) + (!= (-> this id) -1) ) (else #t @@ -199,38 +199,38 @@ ) ) -(defmethod create-or-update-suppression-box traffic-suppression-params ((obj traffic-suppression-params)) +(defmethod create-or-update-suppression-box traffic-suppression-params ((this traffic-suppression-params)) "If the params are already associated with a box, update. Otherwise, attempt to create a new one." (cond - ((= (-> obj id) -1) - (send-event *traffic-manager* 'new-suppression-box obj) - (!= (-> obj id) -1) + ((= (-> this id) -1) + (send-event *traffic-manager* 'new-suppression-box this) + (!= (-> this id) -1) ) (else - (send-event *traffic-manager* 'update-suppression-box obj) + (send-event *traffic-manager* 'update-suppression-box this) #t ) ) ) -(defmethod kill-suppression-box traffic-suppression-params ((obj traffic-suppression-params)) +(defmethod kill-suppression-box traffic-suppression-params ((this traffic-suppression-params)) "Kill a suppression box, and inform the traffic manager by setting duration to 0." - (when (!= (-> obj id) -1) - (let ((s5-0 (-> obj duration))) - (set! (-> obj duration) 0) - (send-event *traffic-manager* 'update-suppression-box obj) - (set! (-> obj duration) s5-0) + (when (!= (-> this id) -1) + (let ((s5-0 (-> this duration))) + (set! (-> this duration) 0) + (send-event *traffic-manager* 'update-suppression-box this) + (set! (-> this duration) s5-0) ) - (set! (-> obj id) -1) + (set! (-> this id) -1) ) (none) ) -(defmethod reset-boxes traffic-suppressor ((obj traffic-suppressor)) +(defmethod reset-boxes traffic-suppressor ((this traffic-suppressor)) "Clears some flags, mark all boxes as disabled." - (logclear! (-> obj flags) (traffic-suppression-flags tfs0 needs-update)) + (logclear! (-> this flags) (traffic-suppression-flags tfs0 needs-update)) (dotimes (v1-2 16) - (let ((a1-3 (-> obj array v1-2))) + (let ((a1-3 (-> this array v1-2))) (logclear! (-> a1-3 flags) (traffic-suppression-box-flags in-use tfsb1)) ) ) @@ -238,19 +238,19 @@ (none) ) -(defmethod add-new-supression-box traffic-suppressor ((obj traffic-suppressor) (arg0 traffic-suppression-params)) +(defmethod add-new-supression-box traffic-suppressor ((this traffic-suppressor) (arg0 traffic-suppression-params)) "Create a suppression box for these params. The param object is updated with the ID of the box and can be later used with update-box-from-params." (set! (-> arg0 id) -1) (let ((v1-1 0)) (b! #t cfg-4 :delay (nop!)) (label cfg-1) - (let ((a2-2 (-> obj array v1-1))) + (let ((a2-2 (-> this array v1-1))) (b! (logtest? (-> a2-2 flags) (traffic-suppression-box-flags in-use)) cfg-3 :delay (empty-form)) (set! (-> arg0 id) v1-1) (set! (-> a2-2 flags) (traffic-suppression-box-flags in-use)) ) - (update-box-from-params obj arg0) + (update-box-from-params this arg0) (b! #t cfg-6 :delay (nop!)) (label cfg-3) (+! v1-1 1) @@ -262,11 +262,11 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod remove-box-by-id traffic-suppressor ((obj traffic-suppressor) (arg0 int)) +(defmethod remove-box-by-id traffic-suppressor ((this traffic-suppressor) (arg0 int)) "Remove a box that was previously added, by its ID." (when (!= arg0 -1) - (logior! (-> obj flags) (traffic-suppression-flags needs-update)) - (let ((v1-6 (-> obj array arg0))) + (logior! (-> this flags) (traffic-suppression-flags needs-update)) + (let ((v1-6 (-> this array arg0))) (logclear! (-> v1-6 flags) (traffic-suppression-box-flags in-use)) ) ) @@ -274,12 +274,12 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod update-box-from-params traffic-suppressor ((obj traffic-suppressor) (arg0 traffic-suppression-params)) +(defmethod update-box-from-params traffic-suppressor ((this traffic-suppressor) (arg0 traffic-suppression-params)) "Update a box that was previously added" (let ((v1-0 (-> arg0 id))) (when (!= v1-0 -1) - (logior! (-> obj flags) (traffic-suppression-flags needs-update)) - (let* ((s5-0 (-> obj array v1-0)) + (logior! (-> this flags) (traffic-suppression-flags needs-update)) + (let* ((s5-0 (-> this array v1-0)) (s4-1 (logior (-> s5-0 flags) (traffic-suppression-box-flags tfsb1))) ) (mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer (-> arg0 bbox)) 32) @@ -292,12 +292,12 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod debug-draw traffic-suppressor ((obj traffic-suppressor)) +(defmethod debug-draw traffic-suppressor ((this traffic-suppressor)) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) (new 'stack-no-clear 'vector4w) (let ((s4-0 *color-red*)) (dotimes (s3-0 16) - (let ((v1-3 (-> obj array s3-0))) + (let ((v1-3 (-> this array s3-0))) (when (logtest? (-> v1-3 flags) (traffic-suppression-box-flags in-use)) (set! (-> s5-0 min quad) (-> v1-3 bbox min quad)) (set! (-> s5-0 max quad) (-> v1-3 bbox max quad)) @@ -313,12 +313,12 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod for-all-active-processes traffic-tracker ((obj traffic-tracker) (arg0 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes traffic-tracker ((this traffic-tracker) (arg0 (function process-focusable traffic-object-type-info none))) "Call the given function on all active processes." - (let ((s4-0 (-> obj traffic))) - (countdown (s3-0 (-> obj active-object-count)) - (let ((a1-1 (-> s4-0 object-type-info-array (-> obj active-object-type-list s3-0))) - (a0-2 (handle->process (-> obj active-object-list s3-0))) + (let ((s4-0 (-> this traffic))) + (countdown (s3-0 (-> this active-object-count)) + (let ((a1-1 (-> s4-0 object-type-info-array (-> this active-object-type-list s3-0))) + (a0-2 (handle->process (-> this active-object-list s3-0))) ) (if (not (focus-test? (the-as process-focusable a0-2) inactive)) (arg0 (the-as process-focusable a0-2) a1-1) @@ -330,14 +330,14 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod for-all-active-processes-of-type traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes-of-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 (function process-focusable traffic-object-type-info none))) "Call the given function on all active processes matching the given type." - (let ((s3-0 (-> obj traffic))) - (countdown (s2-0 (-> obj active-object-count)) - (let ((a0-1 (-> obj active-object-type-list s2-0))) + (let ((s3-0 (-> this traffic))) + (countdown (s2-0 (-> this active-object-count)) + (let ((a0-1 (-> this active-object-type-list s2-0))) (when (= a0-1 arg0) (let ((a1-1 (-> s3-0 object-type-info-array a0-1)) - (a0-3 (handle->process (-> obj active-object-list s2-0))) + (a0-3 (handle->process (-> this active-object-list s2-0))) ) (if (not (focus-test? (the-as process-focusable a0-3) inactive)) (arg1 (the-as process-focusable a0-3) a1-1) @@ -351,14 +351,14 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod add-active-process traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod add-active-process traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Add a process as active." - (let ((v1-0 (-> obj active-object-count))) + (let ((v1-0 (-> this active-object-count))) (when (< v1-0 (the-as uint 126)) - (set! (-> obj active-object-list v1-0) arg1) - (set! (-> obj active-object-type-list v1-0) arg0) - (+! (-> obj active-object-count) 1) - (let ((v1-6 (-> obj traffic object-type-info-array arg0))) + (set! (-> this active-object-list v1-0) arg1) + (set! (-> this active-object-type-list v1-0) arg0) + (+! (-> this active-object-count) 1) + (let ((v1-6 (-> this traffic object-type-info-array arg0))) (+! (-> v1-6 active-count) 1) ) ) @@ -367,17 +367,17 @@ The param object is updated with the ID of the box and can be later used with up (none) ) -(defmethod remove-active-process traffic-tracker ((obj traffic-tracker) (arg0 int)) +(defmethod remove-active-process traffic-tracker ((this traffic-tracker) (arg0 int)) "Remove a process from the tracking list." - (let ((v0-0 (-> obj active-object-list arg0))) - (let ((v1-3 (-> obj active-object-type-list arg0)) - (a2-1 (+ (-> obj active-object-count) -1)) + (let ((v0-0 (-> this active-object-list arg0))) + (let ((v1-3 (-> this active-object-type-list arg0)) + (a2-1 (+ (-> this active-object-count) -1)) ) (when (>= a2-1 0) - (set! (-> obj active-object-list arg0) (-> obj active-object-list a2-1)) - (set! (-> obj active-object-type-list arg0) (-> obj active-object-type-list a2-1)) - (+! (-> obj active-object-count) -1) - (let ((v1-6 (-> obj traffic object-type-info-array v1-3))) + (set! (-> this active-object-list arg0) (-> this active-object-list a2-1)) + (set! (-> this active-object-type-list arg0) (-> this active-object-type-list a2-1)) + (+! (-> this active-object-count) -1) + (let ((v1-6 (-> this traffic object-type-info-array v1-3))) (+! (-> v1-6 active-count) -1) ) ) @@ -386,25 +386,25 @@ The param object is updated with the ID of the box and can be later used with up ) ) -(defmethod add-reserved-process traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod add-reserved-process traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Add a process to the reserve list for a type. This process is allocated, but not yet activated." - (let* ((v1-2 (-> obj traffic object-type-info-array arg0)) + (let* ((v1-2 (-> this traffic object-type-info-array arg0)) (a1-2 (-> v1-2 inactive-count)) ) (when (< a1-2 20) (set! (-> v1-2 array a1-2) arg1) (+! (-> v1-2 inactive-count) 1) (+! (-> v1-2 reserve-count) 1) - (+! (-> obj inactive-object-count) 1) + (+! (-> this inactive-object-count) 1) ) ) 0 (none) ) -(defmethod get-from-inactive-by-type traffic-tracker ((obj traffic-tracker) (arg0 traffic-type)) +(defmethod get-from-inactive-by-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type)) "Get any handle from the inactive list of this type, and remove it from the list." - (let ((v1-2 (-> obj traffic object-type-info-array arg0)) + (let ((v1-2 (-> this traffic object-type-info-array arg0)) (a1-2 0) (v0-0 (the-as handle #f)) ) @@ -414,16 +414,16 @@ The param object is updated with the ID of the box and can be later used with up (set! (-> v1-2 array a1-2) (-> v1-2 array a2-1)) (+! (-> v1-2 inactive-count) -1) (+! (-> v1-2 reserve-count) -1) - (+! (-> obj inactive-object-count) -1) + (+! (-> this inactive-object-count) -1) ) ) v0-0 ) ) -(defmethod get-from-inactive-by-handle traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod get-from-inactive-by-handle traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Remove the given handle from the inactive list of the given type." - (let ((v1-2 (-> obj traffic object-type-info-array arg0)) + (let ((v1-2 (-> this traffic object-type-info-array arg0)) (v0-0 (the-as handle #f)) ) (let* ((a3-0 (+ (-> v1-2 inactive-count) -1)) @@ -436,20 +436,20 @@ The param object is updated with the ID of the box and can be later used with up (set! v0-0 (-> v1-2 array a1-3)) (set! (-> v1-2 array a1-3) (-> v1-2 array a3-0)) (+! (-> v1-2 inactive-count) -1) - (+! (-> obj inactive-object-count) -1) + (+! (-> this inactive-object-count) -1) ) ) v0-0 ) ) -(defmethod deactivate-object traffic-tracker ((obj traffic-tracker) (arg0 int) (arg1 symbol)) +(defmethod deactivate-object traffic-tracker ((this traffic-tracker) (arg0 int) (arg1 symbol)) "Send a traffic-off event (or traffic-off-force) to deactivate an object, specified by index in active object array. Process is recycled and moved to reserved, if it deactivates." (with-pp - (let* ((s3-0 (-> obj active-object-type-list arg0)) + (let* ((s3-0 (-> this active-object-type-list arg0)) (gp-0 'traffic-off) - (s2-0 (remove-active-process obj arg0)) + (s2-0 (remove-active-process this arg0)) (s1-0 (handle->process s2-0)) (v1-5 (the-as object #t)) ) @@ -467,10 +467,10 @@ Process is recycled and moved to reserved, if it deactivates." ) (cond (v1-5 - (add-reserved-process obj s3-0 s2-0) + (add-reserved-process this s3-0 s2-0) ) (else - (add-active-process obj s3-0 s2-0) + (add-active-process this s3-0 s2-0) (when *debug-segment* (when arg1 (format 0 "traffic-engine::deactivate-object: ~s event refused~%" gp-0) @@ -486,7 +486,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod set-process-to-killed traffic-tracker ((obj traffic-tracker) (arg0 process)) +(defmethod set-process-to-killed traffic-tracker ((this traffic-tracker) (arg0 process)) "Move from active to killed. Separate from reserve." (let ((v1-0 -1)) (let ((a0-1 (process->ppointer arg0))) @@ -497,12 +497,12 @@ Process is recycled and moved to reserved, if it deactivates." (set! a1-3 (new 'static 'handle)) (label cfg-5) (let ((a0-3 (logior a1-3 (new 'static 'handle :process a0-1))) - (a1-4 (-> obj active-object-count)) + (a1-4 (-> this active-object-count)) ) (b! #t cfg-8 :delay (nop!)) (label cfg-6) (+! a1-4 -1) - (b! (!= (-> obj active-object-list a1-4) a0-3) cfg-8 :delay (empty-form)) + (b! (!= (-> this active-object-list a1-4) a0-3) cfg-8 :delay (empty-form)) (set! v1-0 (the-as int a1-4)) (b! #t cfg-10 :delay (nop!)) (label cfg-8) @@ -512,11 +512,11 @@ Process is recycled and moved to reserved, if it deactivates." ) (label cfg-10) (when (!= v1-0 -1) - (let ((s5-0 (-> obj active-object-type-list v1-0))) - (let ((a2-4 (remove-active-process obj v1-0))) - (add-reserved-process obj s5-0 a2-4) + (let ((s5-0 (-> this active-object-type-list v1-0))) + (let ((a2-4 (remove-active-process this v1-0))) + (add-reserved-process this s5-0 a2-4) ) - (let ((v1-5 (-> obj traffic object-type-info-array s5-0))) + (let ((v1-5 (-> this traffic object-type-info-array s5-0))) (+! (-> v1-5 killed-count) 1) (+! (-> v1-5 reserve-count) -1) ) @@ -528,44 +528,44 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod deactivate-all-of-type traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 symbol)) +(defmethod deactivate-all-of-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 symbol)) "Deactivate all processes of given type" - (countdown (s3-0 (-> obj active-object-count)) - (if (= (-> obj active-object-type-list s3-0) arg0) - (deactivate-object obj (the-as int s3-0) arg1) + (countdown (s3-0 (-> this active-object-count)) + (if (= (-> this active-object-type-list s3-0) arg0) + (deactivate-object this (the-as int s3-0) arg1) ) ) 0 (none) ) -(defmethod deactivate-all traffic-tracker ((obj traffic-tracker) (arg0 symbol)) +(defmethod deactivate-all traffic-tracker ((this traffic-tracker) (arg0 symbol)) "Deactivate all processes that are tracked" - (countdown (s4-0 (-> obj active-object-count)) - (deactivate-object obj (the-as int s4-0) arg0) + (countdown (s4-0 (-> this active-object-count)) + (deactivate-object this (the-as int s4-0) arg0) ) 0 (none) ) -(defmethod activate-from-params traffic-tracker ((obj traffic-tracker) (arg0 traffic-object-spawn-params)) +(defmethod activate-from-params traffic-tracker ((this traffic-tracker) (arg0 traffic-object-spawn-params)) "Get a reserved process, and activate with the given params." (local-vars (sv-16 handle)) (let ((gp-0 (-> arg0 object-type))) (set! (-> arg0 proc) #f) - (let ((v1-2 (-> obj traffic object-type-info-array gp-0))) + (let ((v1-2 (-> this traffic object-type-info-array gp-0))) (when (and (> (-> v1-2 inactive-count) 0) (> (-> v1-2 reserve-count) 0)) - (set! sv-16 (get-from-inactive-by-type obj gp-0)) + (set! sv-16 (get-from-inactive-by-type this gp-0)) (let ((s3-0 (handle->process sv-16))) (when s3-0 (cond - ((send-event s3-0 'traffic-activate arg0 (-> obj traffic)) + ((send-event s3-0 'traffic-activate arg0 (-> this traffic)) (set! (-> arg0 proc) s3-0) - (add-active-process obj gp-0 sv-16) + (add-active-process this gp-0 sv-16) 0 ) (else - (add-reserved-process obj gp-0 sv-16) + (add-reserved-process this gp-0 sv-16) ) ) ) @@ -578,16 +578,16 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod activate-by-type traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 nav-segment) (arg2 float)) +(defmethod activate-by-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 nav-segment) (arg2 float)) "If possible, activate a process of the given type." - (let ((v1-2 (-> obj traffic object-type-info-array arg0))) + (let ((v1-2 (-> this traffic object-type-info-array arg0))) (when (and (> (-> v1-2 inactive-count) 0) (> (-> v1-2 reserve-count) 0) (< (-> v1-2 active-count) (-> v1-2 target-count)) (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-2)) (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-3)) (or (not (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-0))) - (not (logtest? (-> obj traffic alert-state flags) (traffic-alert-flag alert-ending))) + (not (logtest? (-> this traffic alert-state flags) (traffic-alert-flag alert-ending))) ) ) (let ((s4-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params))) @@ -612,11 +612,11 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (set! (-> s4-0 vector 2 y) - (+ (* 0.5 (-> s4-0 vector 2 x)) (* (-> obj rand) (-> obj traffic inv-density-factor) (-> arg1 spawn-spacing))) + (+ (* 0.5 (-> s4-0 vector 2 x)) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))) ) (vector-float*! (-> s4-0 params velocity) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 x)) (vector-float*! (-> s4-0 vector 1) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 y)) - (when (not (sphere-hash-method-32 (-> obj object-hash) (-> s4-0 params position) (-> s4-0 vector 1) 20480.0 -1)) + (when (not (sphere-hash-method-32 (-> this object-hash) (-> s4-0 params position) (-> s4-0 vector 1) 20480.0 -1)) (set! (-> s4-0 params behavior) (the-as uint 2)) (set! (-> s4-0 params nav-mesh) #f) (-> arg1 nav-mesh-id) @@ -628,8 +628,8 @@ Process is recycled and moved to reserved, if it deactivates." (the-as vector (-> s4-0 vector)) (new 'static 'vector :y 1.0 :w 1.0) ) - (set! (-> obj rand) (rand-vu)) - (activate-from-params obj (-> s4-0 params)) + (set! (-> this rand) (rand-vu)) + (activate-from-params this (-> s4-0 params)) ) ) ) @@ -638,23 +638,23 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod activate-by-handle traffic-tracker ((obj traffic-tracker) (arg0 traffic-object-spawn-params)) +(defmethod activate-by-handle traffic-tracker ((this traffic-tracker) (arg0 traffic-object-spawn-params)) "Activate, using the handle in the params." (local-vars (sv-16 handle)) (let ((gp-0 (-> arg0 object-type))) (set! (-> arg0 proc) #f) - (when (> (-> obj traffic object-type-info-array gp-0 inactive-count) 0) - (set! sv-16 (get-from-inactive-by-handle obj gp-0 (-> arg0 handle))) + (when (> (-> this traffic object-type-info-array gp-0 inactive-count) 0) + (set! sv-16 (get-from-inactive-by-handle this gp-0 (-> arg0 handle))) (let ((s3-0 (handle->process sv-16))) (when s3-0 (cond - ((send-event s3-0 'traffic-activate arg0 (-> obj traffic)) + ((send-event s3-0 'traffic-activate arg0 (-> this traffic)) (set! (-> arg0 proc) s3-0) - (add-active-process obj gp-0 sv-16) + (add-active-process this gp-0 sv-16) 0 ) (else - (add-reserved-process obj gp-0 sv-16) + (add-reserved-process this gp-0 sv-16) ) ) ) @@ -666,50 +666,50 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod reset traffic-level-data ((obj traffic-level-data)) - (set! (-> obj city-info) (the-as city-level-info 0)) - (set! (-> obj active-cell-count) (the-as uint 0)) - (set! (-> obj newly-active-cell-count) (the-as uint 0)) +(defmethod reset traffic-level-data ((this traffic-level-data)) + (set! (-> this city-info) (the-as city-level-info 0)) + (set! (-> this active-cell-count) (the-as uint 0)) + (set! (-> this newly-active-cell-count) (the-as uint 0)) 0 (none) ) -(defmethod reset traffic-tracker ((obj traffic-tracker) (arg0 uint) (arg1 traffic-engine)) - (set! (-> obj traffic) arg1) - (set! (-> obj object-hash) (-> arg1 object-hash)) - (set! (-> obj rand) 0.5) - (set! (-> obj id) arg0) - (set! (-> obj active-object-count) (the-as uint 0)) - (set! (-> obj inactive-object-count) 0) +(defmethod reset traffic-tracker ((this traffic-tracker) (arg0 uint) (arg1 traffic-engine)) + (set! (-> this traffic) arg1) + (set! (-> this object-hash) (-> arg1 object-hash)) + (set! (-> this rand) 0.5) + (set! (-> this id) arg0) + (set! (-> this active-object-count) (the-as uint 0)) + (set! (-> this inactive-object-count) 0) 0 (none) ) -(defmethod reset traffic-alert-state ((obj traffic-alert-state)) - (set! (-> obj flags) (traffic-alert-flag)) - (set! (-> obj level) (the-as uint 0)) - (set! (-> obj duration) (the-as uint 9000)) - (set! (-> obj alarm-sound-id) (new-sound-id)) - (set! (-> obj guard-inaccuracy-factor) 1.0) +(defmethod reset traffic-alert-state ((this traffic-alert-state)) + (set! (-> this flags) (traffic-alert-flag)) + (set! (-> this level) (the-as uint 0)) + (set! (-> this duration) (the-as uint 9000)) + (set! (-> this alarm-sound-id) (new-sound-id)) + (set! (-> this guard-inaccuracy-factor) 1.0) (dotimes (v1-2 3) - (let ((a0-4 (-> obj target-status-array v1-2))) + (let ((a0-4 (-> this target-status-array v1-2))) (set! (-> a0-4 flags) (traffic-target-flag)) (set! (-> a0-4 handle) (the-as handle #f)) ) ) - (set! (-> obj guard-type-info-array 0 object-type) (traffic-type crimson-guard-1)) - (set! (-> obj guard-type-info-array 1 object-type) (traffic-type crimson-guard-1)) - (set! (-> obj guard-type-info-array 2 object-type) (traffic-type crimson-guard-1)) - (set! (-> obj guard-type-info-array 3 object-type) (traffic-type crimson-guard-2)) - (set! (-> obj guard-type-info-array 4 object-type) (traffic-type guard-bike)) - (set! (-> obj guard-type-info-array 5 object-type) (traffic-type hellcat)) + (set! (-> this guard-type-info-array 0 object-type) (traffic-type crimson-guard-1)) + (set! (-> this guard-type-info-array 1 object-type) (traffic-type crimson-guard-1)) + (set! (-> this guard-type-info-array 2 object-type) (traffic-type crimson-guard-1)) + (set! (-> this guard-type-info-array 3 object-type) (traffic-type crimson-guard-2)) + (set! (-> this guard-type-info-array 4 object-type) (traffic-type guard-bike)) + (set! (-> this guard-type-info-array 5 object-type) (traffic-type hellcat)) (dotimes (v1-11 21) - (set! (-> obj guard-type-mask-from-object-type v1-11) (the-as uint 0)) + (set! (-> this guard-type-mask-from-object-type v1-11) (the-as uint 0)) ) (dotimes (v1-14 6) - (let ((a0-10 (-> obj guard-type-info-array v1-14 object-type))) - (set! (-> obj guard-type-mask-from-object-type a0-10) - (the-as uint (logior (ash 1 v1-14) (-> obj guard-type-mask-from-object-type a0-10))) + (let ((a0-10 (-> this guard-type-info-array v1-14 object-type))) + (set! (-> this guard-type-mask-from-object-type a0-10) + (the-as uint (logior (ash 1 v1-14) (-> this guard-type-mask-from-object-type a0-10))) ) ) ) @@ -717,15 +717,15 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod reset-and-init-from-manager traffic-engine ((obj traffic-engine) (arg0 process)) +(defmethod reset-and-init-from-manager traffic-engine ((this traffic-engine) (arg0 process)) "Reset the traffic engine" - (set! (-> obj manager) (process->handle arg0)) - (set! (-> obj flags) (the-as uint 0)) - (set! (-> obj danger-sphere-count) 0) + (set! (-> this manager) (process->handle arg0)) + (set! (-> this flags) (the-as uint 0)) + (set! (-> this danger-sphere-count) 0) (set! (-> *game-info* wanted-flash) #f) - (let ((v1-4 (-> obj inactive-object-array))) + (let ((v1-4 (-> this inactive-object-array))) (dotimes (a0-5 21) - (let ((a1-3 (-> obj object-type-info-array a0-5))) + (let ((a1-3 (-> this object-type-info-array a0-5))) (set! (-> a1-3 flags) (traffic-type-flags trtflags-1 trtflags-2)) (set! (-> a1-3 inactive-count) 0) (set! (-> a1-3 active-count) 0) @@ -738,26 +738,26 @@ Process is recycled and moved to reserved, if it deactivates." (set! v1-4 (&-> v1-4 20)) ) ) - (set! (-> obj object-type-info-array 6 guard-type) (the-as uint 0)) - (set! (-> obj object-type-info-array 20 level) 'ctywide) + (set! (-> this object-type-info-array 6 guard-type) (the-as uint 0)) + (set! (-> this object-type-info-array 20 level) 'ctywide) (let ((v1-8 11)) (dotimes (a0-6 10) - (set! (-> obj object-type-info-array v1-8 tracker-index) (the-as uint 0)) + (set! (-> this object-type-info-array v1-8 tracker-index) (the-as uint 0)) (+! v1-8 1) ) ) (let ((v1-11 0)) (dotimes (a0-7 11) - (set! (-> obj object-type-info-array v1-11 tracker-index) (the-as uint 1)) + (set! (-> this object-type-info-array v1-11 tracker-index) (the-as uint 1)) (+! v1-11 1) ) ) (dotimes (s5-0 2) - (reset (-> obj tracker-array s5-0) (the-as uint s5-0) obj) + (reset (-> this tracker-array s5-0) (the-as uint s5-0) this) ) - (reset-boxes (-> obj suppressor)) - (set! (-> obj object-hash object-count) 0) - (let* ((v1-24 (-> obj object-hash)) + (reset-boxes (-> this suppressor)) + (set! (-> this object-hash object-count) 0) + (let* ((v1-24 (-> this object-hash)) (a0-15 (/ (+ (* (* (* (-> v1-24 dimension-array 0) (-> v1-24 dimension-array 1)) (-> v1-24 dimension-array 2)) (-> v1-24 bucket-size) @@ -777,27 +777,27 @@ Process is recycled and moved to reserved, if it deactivates." ) 0 (dotimes (s5-1 2) - (reset (-> obj level-data-array s5-1)) + (reset (-> this level-data-array s5-1)) ) (dotimes (s5-2 (-> *level* length)) (let ((a1-12 (-> *level* level s5-2))) (if (= (-> a1-12 status) 'active) - (level-link obj a1-12) + (level-link this a1-12) ) ) ) - (reset (-> obj alert-state)) + (reset (-> this alert-state)) 0 (none) ) -(defmethod stop-alarm-sound traffic-engine ((obj traffic-engine)) - (sound-stop (-> obj alert-state alarm-sound-id)) +(defmethod stop-alarm-sound traffic-engine ((this traffic-engine)) + (sound-stop (-> this alert-state alarm-sound-id)) 0 (none) ) -(defmethod level-link traffic-engine ((obj traffic-engine) (arg0 level)) +(defmethod level-link traffic-engine ((this traffic-engine) (arg0 level)) "Call after loading a level to patch the data in the bsp" (format #t "traffic-engine: level birth ~S~%" (-> arg0 nickname)) (cond @@ -882,7 +882,7 @@ Process is recycled and moved to reserved, if it deactivates." ) (let ((s4-1 (the-as traffic-level-data #f))) (dotimes (v1-31 2) - (let ((a0-34 (-> obj level-data-array v1-31))) + (let ((a0-34 (-> this level-data-array v1-31))) (if (zero? (-> a0-34 city-info)) (set! s4-1 a0-34) ) @@ -929,11 +929,11 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod level-unlink traffic-engine ((obj traffic-engine) (arg0 level)) +(defmethod level-unlink traffic-engine ((this traffic-engine) (arg0 level)) "Call after removing a level. Kills processes and unlinks nav" (let ((s4-0 (-> arg0 bsp city-level-info nav-graph))) (dotimes (v1-2 2) - (let ((a0-4 (-> obj level-data-array v1-2))) + (let ((a0-4 (-> this level-data-array v1-2))) (when (= (-> a0-4 city-info) (-> arg0 bsp city-level-info)) (set! (-> a0-4 city-info) (the-as city-level-info 0)) 0 @@ -974,22 +974,22 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (deactivate-all-from-level obj (-> arg0 name)) + (deactivate-all-from-level this (-> arg0 name)) 0 (none) ) -(defmethod for-all-active-processes traffic-engine ((obj traffic-engine) (arg0 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes traffic-engine ((this traffic-engine) (arg0 (function process-focusable traffic-object-type-info none))) (dotimes (s4-0 2) - (for-all-active-processes (-> obj tracker-array s4-0) arg0) + (for-all-active-processes (-> this tracker-array s4-0) arg0) ) 0 (none) ) -(defmethod add-object traffic-engine ((obj traffic-engine) (arg0 traffic-type) (arg1 process)) +(defmethod add-object traffic-engine ((this traffic-engine) (arg0 traffic-type) (arg1 process)) (add-reserved-process - (-> obj tracker-array (-> obj object-type-info-array arg0 tracker-index)) + (-> this tracker-array (-> this object-type-info-array arg0 tracker-index)) arg0 (process->handle arg1) ) @@ -997,14 +997,14 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod child-killed traffic-engine ((obj traffic-engine) (arg0 process)) +(defmethod child-killed traffic-engine ((this traffic-engine) (arg0 process)) "handle killing a child process" (cond ((type? arg0 citizen) - (set-process-to-killed (-> obj vehicle-tracker-array) arg0) + (set-process-to-killed (-> this vehicle-tracker-array) arg0) ) ((type? arg0 vehicle) - (set-process-to-killed (-> obj citizen-tracker-array) arg0) + (set-process-to-killed (-> this citizen-tracker-array) arg0) ) (else 0 @@ -1014,65 +1014,65 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod activate-one-citizen traffic-engine ((obj traffic-engine) (arg0 nav-segment) (arg1 float)) +(defmethod activate-one-citizen traffic-engine ((this traffic-engine) (arg0 nav-segment) (arg1 float)) (let ((a1-1 (+ (rand-vu-int-count 10) 11))) - (activate-by-type (-> obj citizen-tracker-array) (the-as traffic-type a1-1) arg0 arg1) + (activate-by-type (-> this citizen-tracker-array) (the-as traffic-type a1-1) arg0 arg1) ) 0 (none) ) -(defmethod activate-one-vehicle traffic-engine ((obj traffic-engine) (arg0 nav-segment) (arg1 float)) +(defmethod activate-one-vehicle traffic-engine ((this traffic-engine) (arg0 nav-segment) (arg1 float)) (let ((a1-1 0)) (dotimes (v1-0 11) - (if (zero? (-> obj object-type-info-array v1-0 inactive-count)) + (if (zero? (-> this object-type-info-array v1-0 inactive-count)) (set! a1-1 (logior a1-1 (ash 1 v1-0))) ) ) (let ((a1-2 (rand-vu-int-count-excluding 11 a1-1))) - (activate-by-type (-> obj vehicle-tracker-array) (the-as traffic-type a1-2) arg0 arg1) + (activate-by-type (-> this vehicle-tracker-array) (the-as traffic-type a1-2) arg0 arg1) ) ) 0 (none) ) -(defmethod handle-new-vis-cell traffic-engine ((obj traffic-engine) (arg0 vis-cell)) +(defmethod handle-new-vis-cell traffic-engine ((this traffic-engine) (arg0 vis-cell)) (dotimes (s4-0 (-> arg0 segment-count)) (let* ((s3-0 (-> arg0 segment-array s4-0)) (s1-0 (-> s3-0 tracker-id)) ) (when (and (logtest? (logxor (-> arg0 flags) (the-as uint (-> arg0 prev-flags))) (ash 1 s1-0)) (and (not (logtest? (-> arg0 flags) (vis-cell-flag suppress))) - (not (or (can-dest-be-used? obj (-> s3-0 branch)) (let ((a0-7 (-> s3-0 branch))) + (not (or (can-dest-be-used? this (-> s3-0 branch)) (let ((a0-7 (-> s3-0 branch))) (>= (-> a0-7 user-count) (-> a0-7 max-user-count)) ) ) ) ) ) - (let* ((s2-0 (-> obj tracker-array s1-0)) - (f30-0 (* (-> s2-0 rand) (-> obj inv-density-factor) (-> s3-0 spawn-spacing))) + (let* ((s2-0 (-> this tracker-array s1-0)) + (f30-0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing))) ) (cond ((= s1-0 1) (when (nonzero? (-> s3-0 nav-mesh-id)) (while (and (< f30-0 (-> s3-0 length)) (> (-> s2-0 inactive-object-count) 0)) - (activate-one-vehicle obj s3-0 f30-0) - (set! f30-0 (+ 24576.0 (* (-> s2-0 rand) (-> obj inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) + (activate-one-vehicle this s3-0 f30-0) + (set! f30-0 (+ 24576.0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) ) ) ) (else (while (and (< f30-0 (-> s3-0 length)) (> (-> s2-0 inactive-object-count) 0)) - (activate-one-citizen obj s3-0 f30-0) - (set! f30-0 (+ 49152.0 (* (-> s2-0 rand) (-> obj inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) + (activate-one-citizen this s3-0 f30-0) + (set! f30-0 (+ 49152.0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) ) ) ) (if (>= f30-0 (-> s3-0 length)) (set! (-> s2-0 rand) - (fmax 0.0 (- (-> s2-0 rand) (/ (-> s3-0 length) (* (-> s3-0 spawn-spacing) (-> obj inv-density-factor))))) + (fmax 0.0 (- (-> s2-0 rand) (/ (-> s3-0 length) (* (-> s3-0 spawn-spacing) (-> this inv-density-factor))))) ) ) ) @@ -1083,18 +1083,18 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod debug-draw traffic-level-data ((obj traffic-level-data)) +(defmethod debug-draw traffic-level-data ((this traffic-level-data)) (local-vars (sv-16 nav-node) (sv-20 nav-branch) (sv-80 nav-node) (sv-84 vector) (sv-88 vector) (sv-92 vector)) - (when (and (nonzero? (-> obj city-info)) (nonzero? (-> obj city-info nav-graph))) - (let ((s5-0 (-> obj city-info nav-graph))) + (when (and (nonzero? (-> this city-info)) (nonzero? (-> this city-info nav-graph))) + (let ((s5-0 (-> this city-info nav-graph))) (let ((v1-6 (-> s5-0 node-array 0))) (countdown (a0-3 (-> s5-0 node-count)) (logclear! (-> v1-6 flags) (nav-node-flag-byte visited)) (&+! v1-6 32) ) ) - (dotimes (s4-0 (the-as int (-> obj active-cell-count))) - (let ((a0-4 (-> obj active-cell-list s4-0))) + (dotimes (s4-0 (the-as int (-> this active-cell-count))) + (let ((a0-4 (-> this active-cell-list s4-0))) (dotimes (v1-11 (-> a0-4 segment-count)) (let ((a1-5 (-> a0-4 segment-array v1-11 branch src-node))) (logior! (-> a1-5 flags) (nav-node-flag-byte visited)) @@ -1155,7 +1155,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod debug-unused traffic-engine ((obj traffic-engine)) +(defmethod debug-unused traffic-engine ((this traffic-engine)) (dotimes (v1-0 (-> *level* length)) (let ((a0-4 (-> *level* level v1-0))) (when (= (-> a0-4 status) 'active) @@ -1170,9 +1170,9 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod sphere-in-loaded-city-infos? traffic-engine ((obj traffic-engine) (arg0 vector) (arg1 int)) +(defmethod sphere-in-loaded-city-infos? traffic-engine ((this traffic-engine) (arg0 vector) (arg1 int)) (dotimes (s3-0 2) - (let ((v1-3 (-> obj level-data-array s3-0))) + (let ((v1-3 (-> this level-data-array s3-0))) (when (nonzero? (-> v1-3 city-info)) (if (sphere-in-grid? (-> v1-3 city-info) arg0 arg1) (return #t) @@ -1183,7 +1183,7 @@ Process is recycled and moved to reserved, if it deactivates." #f ) -(defmethod can-dest-be-used? traffic-engine ((obj traffic-engine) (arg0 nav-branch)) +(defmethod can-dest-be-used? traffic-engine ((this traffic-engine) (arg0 nav-branch)) (let ((v1-0 (-> arg0 src-node))) (or (logtest? (-> arg0 flags) (nav-branch-flags nabflags-0)) (logtest? (-> v1-0 flags) (nav-node-flag-byte blocked)) @@ -1193,15 +1193,15 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod update-sync-from-frame-counter traffic-engine ((obj traffic-engine)) - (+! (-> obj sync-clock) 1) - (set! (-> obj sync-mask-8) (the-as uint (ash 1 (logand (-> obj sync-clock) 7)))) - (set! (-> obj sync-mask-16) (the-as uint (ash 1 (logand (-> obj sync-clock) 15)))) - (set! (-> obj sync-mask-32) (the-as uint (ash 1 (logand (-> obj sync-clock) 31)))) +(defmethod update-sync-from-frame-counter traffic-engine ((this traffic-engine)) + (+! (-> this sync-clock) 1) + (set! (-> this sync-mask-8) (the-as uint (ash 1 (logand (-> this sync-clock) 7)))) + (set! (-> this sync-mask-16) (the-as uint (ash 1 (logand (-> this sync-clock) 15)))) + (set! (-> this sync-mask-32) (the-as uint (ash 1 (logand (-> this sync-clock) 31)))) (let ((v1-10 (/ (current-time) 300))) - (set! (-> obj sync-array 0) (the-as uint 255)) + (set! (-> this sync-array 0) (the-as uint 255)) (let ((a1-12 (mod v1-10 20))) - (set! (-> obj sync-array 1) (the-as uint (cond + (set! (-> this sync-array 1) (the-as uint (cond ((>= 6 a1-12) 1 ) @@ -1219,7 +1219,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (let ((a1-15 (mod v1-10 30))) - (set! (-> obj sync-array 2) (the-as uint (cond + (set! (-> this sync-array 2) (the-as uint (cond ((>= 6 a1-15) 1 ) @@ -1243,7 +1243,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (let ((v1-11 (mod v1-10 40))) - (set! (-> obj sync-array 3) (the-as uint (cond + (set! (-> this sync-array 3) (the-as uint (cond ((>= 6 v1-11) 1 ) @@ -1277,7 +1277,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod update-danger-from-target traffic-engine ((obj traffic-engine)) +(defmethod update-danger-from-target traffic-engine ((this traffic-engine)) "make people run away from jak when he is dangerous." (local-vars (v1-20 float) (v1-32 float)) (rlet ((acc :class vf) @@ -1288,7 +1288,7 @@ Process is recycled and moved to reserved, if it deactivates." (init-vf0-vector) (let ((s5-0 *target*)) (when s5-0 - (let ((v1-1 (-> obj danger-sphere-array))) + (let ((v1-1 (-> this danger-sphere-array))) (set! (-> v1-1 0 handle) (process->handle s5-0)) (let ((a0-4 (-> s5-0 focus-status)) (notify-radius 0.0) @@ -1419,7 +1419,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> s2-1 sphere r) f30-0) (set! (-> s2-1 velocity quad) (-> s4-0 0 bbox min quad)) (let ((gp-1 (fill-actor-list-for-line-sphere - (-> obj object-hash) + (-> this object-hash) (-> s2-1 sphere) (-> s2-1 velocity) (-> s2-1 sphere r) @@ -1452,18 +1452,18 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod update-danger traffic-engine ((obj traffic-engine)) +(defmethod update-danger traffic-engine ((this traffic-engine)) "see what's dangerous and make people avoid it." - (update-danger-from-target obj) - (dotimes (s5-0 (-> obj danger-sphere-count)) - (let ((s4-0 (-> obj danger-sphere-array s5-0))) + (update-danger-from-target this) + (dotimes (s5-0 (-> this danger-sphere-count)) + (let ((s4-0 (-> this danger-sphere-array s5-0))) (when (< 0.0 (-> s4-0 danger-level)) (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 40)) (a1-0 (new 'stack-no-clear 'sphere)) ) (set! (-> a1-0 quad) (-> s4-0 sphere quad)) (set! (-> a1-0 r) (-> s4-0 notify-radius)) - (let ((s2-0 (fill-actor-list-for-sphere (-> obj object-hash) a1-0 s3-0 40))) + (let ((s2-0 (fill-actor-list-for-sphere (-> this object-hash) a1-0 s3-0 40))) (dotimes (s1-0 s2-0) (let* ((s0-0 (-> s3-0 s1-0)) (a0-6 (if (type? s0-0 citizen) @@ -1488,12 +1488,12 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (set! (-> obj danger-sphere-count) 1) + (set! (-> this danger-sphere-count) 1) 0 (none) ) -(defmethod add-danger traffic-engine ((obj traffic-engine) (arg0 traffic-danger-info)) +(defmethod add-danger traffic-engine ((this traffic-engine) (arg0 traffic-danger-info)) "Add a danger sphere and suppression box." (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1525,14 +1525,14 @@ Process is recycled and moved to reserved, if it deactivates." (.svf (&-> a0-2 quad) vf5) ) (set! (-> a1-1 duration) (seconds 5)) - (new-suppression-box obj a1-1) + (new-suppression-box this a1-1) ) - (let ((v1-5 (-> obj danger-sphere-count))) + (let ((v1-5 (-> this danger-sphere-count))) (when (< v1-5 4) - (let ((a0-5 (-> obj danger-sphere-array v1-5))) + (let ((a0-5 (-> this danger-sphere-array v1-5))) (mem-copy! (the-as pointer a0-5) (the-as pointer arg0) 54) ) - (+! (-> obj danger-sphere-count) 1) + (+! (-> this danger-sphere-count) 1) ) ) 0 @@ -1540,7 +1540,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod kill-traffic-sphere traffic-engine ((obj traffic-engine) (arg0 sphere)) +(defmethod kill-traffic-sphere traffic-engine ((this traffic-engine) (arg0 sphere)) "Kill everything in the sphere with a traffic-off-force." (let ((gp-0 (new 'stack-no-clear 'array 'collide-shape 64))) (countdown (s5-0 (fill-actor-list-for-sphere *actor-hash* arg0 gp-0 64)) @@ -1560,11 +1560,11 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod update-traffic-amount traffic-engine ((obj traffic-engine)) +(defmethod update-traffic-amount traffic-engine ((this traffic-engine)) "kills inactive traffic and spawns more if needed." (local-vars (sv-48 int) (sv-64 nav-segment)) - (set! (-> obj object-hash object-count) 0) - (let* ((v1-1 (-> obj object-hash)) + (set! (-> this object-hash object-count) 0) + (let* ((v1-1 (-> this object-hash)) (a0-6 (/ (+ (* (* (* (-> v1-1 dimension-array 0) (-> v1-1 dimension-array 1)) (-> v1-1 dimension-array 2)) (-> v1-1 bucket-size) ) @@ -1592,7 +1592,7 @@ Process is recycled and moved to reserved, if it deactivates." (let ((a2-1 (handle->process (-> a2-0 pilot vehicle)))) (when a2-1 (set! (-> s5-0 quad) (-> (the-as process-focusable a2-1) root root-prim prim-core world-sphere quad)) - (spatial-hash-method-39 (-> obj object-hash) s5-0 (the-as hash-object-info a2-1)) + (spatial-hash-method-39 (-> this object-hash) s5-0 (the-as hash-object-info a2-1)) ) ) ) @@ -1600,80 +1600,80 @@ Process is recycled and moved to reserved, if it deactivates." (else (set! (-> s5-0 quad) (-> a2-0 control trans quad)) (set! (-> s5-0 w) 20480.0) - (spatial-hash-method-39 (-> obj object-hash) s5-0 (the-as hash-object-info a2-0)) + (spatial-hash-method-39 (-> this object-hash) s5-0 (the-as hash-object-info a2-0)) ) ) ) ) - (countdown (s4-0 (-> obj citizen-tracker-array active-object-count)) - (let ((s3-0 (handle->process (-> obj citizen-tracker-array active-object-list s4-0)))) + (countdown (s4-0 (-> this citizen-tracker-array active-object-count)) + (let ((s3-0 (handle->process (-> this citizen-tracker-array active-object-list s4-0)))) (cond (s3-0 (cond ((focus-test? (the-as vehicle s3-0) inactive) - (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #f) + (deactivate-object (-> this citizen-tracker-array) (the-as int s4-0) #f) ) ((begin (let ((v1-33 (-> (the-as vehicle s3-0) root))) (set! (-> s5-0 quad) (-> v1-33 trans quad)) (set! (-> s5-0 w) (-> v1-33 root-prim prim-core world-sphere w)) ) - (sphere-in-loaded-city-infos? obj s5-0 0) + (sphere-in-loaded-city-infos? this s5-0 0) ) (set! (-> (the-as vehicle s3-0) traffic-hash-id) - (spatial-hash-method-39 (-> obj object-hash) s5-0 (the-as hash-object-info s3-0)) + (spatial-hash-method-39 (-> this object-hash) s5-0 (the-as hash-object-info s3-0)) ) ) (else - (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #f) + (deactivate-object (-> this citizen-tracker-array) (the-as int s4-0) #f) ) ) ) (else - (remove-active-process (-> obj citizen-tracker-array) (the-as int s4-0)) + (remove-active-process (-> this citizen-tracker-array) (the-as int s4-0)) ) ) ) ) - (countdown (s4-1 (-> obj vehicle-tracker-array active-object-count)) - (let ((s3-1 (handle->process (-> obj vehicle-tracker-array active-object-list s4-1)))) + (countdown (s4-1 (-> this vehicle-tracker-array active-object-count)) + (let ((s3-1 (handle->process (-> this vehicle-tracker-array active-object-list s4-1)))) (cond (s3-1 (cond ((focus-test? (the-as process-focusable s3-1) inactive) - (deactivate-object (-> obj vehicle-tracker-array) (the-as int s4-1) #f) + (deactivate-object (-> this vehicle-tracker-array) (the-as int s4-1) #f) ) ((begin (let ((v1-54 (-> (the-as process-focusable s3-1) root))) (set! (-> s5-0 quad) (-> v1-54 trans quad)) (set! (-> s5-0 w) (-> v1-54 root-prim prim-core world-sphere w)) ) - (sphere-in-loaded-city-infos? obj s5-0 1) + (sphere-in-loaded-city-infos? this s5-0 1) ) - (spatial-hash-method-39 (-> obj object-hash) s5-0 (the-as hash-object-info s3-1)) + (spatial-hash-method-39 (-> this object-hash) s5-0 (the-as hash-object-info s3-1)) ) (else - (deactivate-object (-> obj vehicle-tracker-array) (the-as int s4-1) #f) + (deactivate-object (-> this vehicle-tracker-array) (the-as int s4-1) #f) ) ) ) (else - (remove-active-process (-> obj vehicle-tracker-array) (the-as int s4-1)) + (remove-active-process (-> this vehicle-tracker-array) (the-as int s4-1)) ) ) ) ) ) (dotimes (s5-1 2) - (let ((s4-2 (-> obj level-data-array s5-1))) + (let ((s4-2 (-> this level-data-array s5-1))) (when (nonzero? (-> s4-2 city-info)) (dotimes (s3-2 (the-as int (-> s4-2 newly-active-cell-count))) (let ((a1-22 (-> s4-2 newly-active-cell-list s3-2))) - (handle-new-vis-cell obj a1-22) + (handle-new-vis-cell this a1-22) ) ) (dotimes (s3-3 2) - (when (> (-> obj tracker-array s3-3 inactive-object-count) 0) + (when (> (-> this tracker-array s3-3 inactive-object-count) 0) (let ((s2-0 (the-as nav-segment #f))) (let ((f30-0 10000000000000000000000000000000000000.0)) (dotimes (s1-0 (the-as int (-> s4-2 active-cell-count))) @@ -1700,15 +1700,15 @@ Process is recycled and moved to reserved, if it deactivates." ) (when s2-0 (let ((a0-51 (-> s2-0 branch))) - (when (not (or (>= (-> a0-51 user-count) (-> a0-51 max-user-count)) (can-dest-be-used? obj (-> s2-0 branch)))) + (when (not (or (>= (-> a0-51 user-count) (-> a0-51 max-user-count)) (can-dest-be-used? this (-> s2-0 branch)))) (cond ((= s3-3 1) (if (nonzero? (-> s2-0 nav-mesh-id)) - (activate-one-vehicle obj s2-0 0.0) + (activate-one-vehicle this s2-0 0.0) ) ) (else - (activate-one-citizen obj s2-0 0.0) + (activate-one-citizen this s2-0 0.0) ) ) ) @@ -1724,9 +1724,9 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod update-traffic traffic-engine ((obj traffic-engine)) - (update-sync-from-frame-counter obj) - (update-suppressor obj) +(defmethod update-traffic traffic-engine ((this traffic-engine)) + (update-sync-from-frame-counter this) + (update-suppressor this) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) (set-vector! (-> s5-0 min) @@ -1743,7 +1743,7 @@ Process is recycled and moved to reserved, if it deactivates." 1.0 ) (dotimes (s4-0 2) - (let ((s3-0 (-> obj level-data-array s4-0))) + (let ((s3-0 (-> this level-data-array s4-0))) (when (nonzero? (-> s3-0 city-info)) (per-frame-cell-update s3-0) (add-box! s5-0 (-> s3-0 active-cell-box)) @@ -1751,25 +1751,25 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (update-grid-for-objects-in-box (-> obj object-hash) 253 (-> s5-0 min) (-> s5-0 max)) + (update-grid-for-objects-in-box (-> this object-hash) 253 (-> s5-0 min) (-> s5-0 max)) ) - (update-traffic-amount obj) - (set! (-> obj alert-state guard-aim-count) 0) - (update-alert-state obj) - (update-guards obj) - (update-danger obj) + (update-traffic-amount this) + (set! (-> this alert-state guard-aim-count) 0) + (update-alert-state this) + (update-guards this) + (update-danger this) 0 (none) ) -(defmethod callback-on-nav-segments-in-sphere traffic-engine ((obj traffic-engine) +(defmethod callback-on-nav-segments-in-sphere traffic-engine ((this traffic-engine) (arg0 vector) (arg1 int) (arg2 traffic-find-segment-struct) (arg3 (function traffic-find-segment-struct nav-segment none)) ) (dotimes (s1-0 2) - (let ((v1-3 (-> obj level-data-array s1-0))) + (let ((v1-3 (-> this level-data-array s1-0))) (if (nonzero? (-> v1-3 city-info)) (callback-on-nav-segments-in-sphere (-> v1-3 city-info) arg0 arg1 arg2 arg3) ) @@ -1790,13 +1790,13 @@ Process is recycled and moved to reserved, if it deactivates." ) -(defmethod find-best-segment traffic-engine ((obj traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod find-best-segment traffic-engine ((this traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) (let ((gp-0 (new 'stack-no-clear 'traffic-find-segment-struct))) (set! (-> gp-0 dir quad) (-> arg1 quad)) (set! (-> gp-0 best-rating) -10000000000000000000000000000000000000.0) (set! (-> gp-0 best-seg) #f) (callback-on-nav-segments-in-sphere - obj + this arg0 arg2 gp-0 @@ -1823,58 +1823,58 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod maybe-increase-guard-aim-count traffic-engine ((obj traffic-engine)) - (when (< (-> obj alert-state guard-aim-count) 2) - (+! (-> obj alert-state guard-aim-count) 1) +(defmethod maybe-increase-guard-aim-count traffic-engine ((this traffic-engine)) + (when (< (-> this alert-state guard-aim-count) 2) + (+! (-> this alert-state guard-aim-count) 1) #t ) ) -(defmethod increase-alert-level traffic-engine ((obj traffic-engine) (arg0 int) (arg1 target)) - (when (and (logtest? (-> obj alert-state flags) (traffic-alert-flag target-jak)) +(defmethod increase-alert-level traffic-engine ((this traffic-engine) (arg0 int) (arg1 target)) + (when (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) (logtest? (-> arg1 mask) (process-mask target)) ) - (let ((v1-6 (min arg0 (the-as int (-> obj alert-state max-level))))) + (let ((v1-6 (min arg0 (the-as int (-> this alert-state max-level))))) (when #t - (set! (-> obj alert-state start-time) (current-time)) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) + (set! (-> this alert-state start-time) (current-time)) + (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) ) - (set! (-> obj alert-state level) (the-as uint (max (the-as int (-> obj alert-state level)) v1-6))) + (set! (-> this alert-state level) (the-as uint (max (the-as int (-> this alert-state level)) v1-6))) ) ) 0 (none) ) -(defmethod decrease-alert-level traffic-engine ((obj traffic-engine) (arg0 int)) - (if (logtest? (-> obj alert-state flags) (traffic-alert-flag target-jak)) - (set! (-> obj alert-state level) (the-as uint (min (the-as int (-> obj alert-state level)) arg0))) +(defmethod decrease-alert-level traffic-engine ((this traffic-engine) (arg0 int)) + (if (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) + (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) ) 0 (none) ) -(defmethod set-alert-level traffic-engine ((obj traffic-engine) (arg0 int)) - (set! (-> obj alert-state level) (the-as uint arg0)) - (set! (-> obj alert-state start-time) (current-time)) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) +(defmethod set-alert-level traffic-engine ((this traffic-engine) (arg0 int)) + (set! (-> this alert-state level) (the-as uint arg0)) + (set! (-> this alert-state start-time) (current-time)) + (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) 0 (none) ) -(defmethod set-max-alert-level traffic-engine ((obj traffic-engine) (arg0 int)) - (set! (-> obj alert-state max-level) (the-as uint arg0)) - (set! (-> obj alert-state level) (the-as uint (min (the-as int (-> obj alert-state level)) arg0))) +(defmethod set-max-alert-level traffic-engine ((this traffic-engine) (arg0 int)) + (set! (-> this alert-state max-level) (the-as uint arg0)) + (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) 0 (none) ) ;; WARN: Return type mismatch uint vs int. -(defmethod get-alert-level traffic-engine ((obj traffic-engine)) - (the-as int (-> obj alert-state level)) +(defmethod get-alert-level traffic-engine ((this traffic-engine)) + (the-as int (-> this alert-state level)) ) -(defmethod get-target traffic-engine ((obj traffic-engine)) +(defmethod get-target traffic-engine ((this traffic-engine)) "@returns [[*target*]]" *target* ) @@ -2027,7 +2027,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod find-closest-to-with-collide-lists traffic-engine ((obj traffic-engine) (arg0 process-drawable) (arg1 collide-spec)) +(defmethod find-closest-to-with-collide-lists traffic-engine ((this traffic-engine) (arg0 process-drawable) (arg1 collide-spec)) "Iterate through collide lists, find the closest thing to the given process." (let ((gp-0 (the-as process-focusable #f))) (let ((f30-0 (the-as float #x7f800000))) @@ -2131,7 +2131,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod traffic-engine-method-49 traffic-engine ((obj traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status)) +(defmethod traffic-engine-method-49 traffic-engine ((this traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status)) (local-vars ;; og:preserve-this stack array -> pointer (guards (pointer crimson-guard)) @@ -2142,7 +2142,7 @@ Process is recycled and moved to reserved, if it deactivates." ) (logclear! (-> target-status flags) (traffic-target-flag visible-now updated)) (cond - ((= (-> obj sync-mask-16) (ash 1 (logand arg2 15))) + ((= (-> this sync-mask-16) (ash 1 (logand arg2 15))) (logior! (-> target-status flags) (traffic-target-flag updated)) (let ((target-proc (handle->process (-> target-status handle))) (target-pos (new 'stack-no-clear 'vector)) @@ -2151,7 +2151,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> target-pos quad) (-> (get-trans (the-as process-focusable target-proc) 3) quad)) (cond ((= (-> (the-as process-focusable target-proc) type) target) - (let ((s1-1 (-> obj alert-state target-status-array))) + (let ((s1-1 (-> this alert-state target-status-array))) (logclear! (-> s1-1 0 flags) (traffic-target-flag visible-now updated)) (logior! (-> s1-1 0 flags) (traffic-target-flag updated)) (cond @@ -2186,10 +2186,10 @@ Process is recycled and moved to reserved, if it deactivates." (set! guards (new 'stack-no-clear 'array 'crimson-guard 16)) (set! guard-target-dists (new 'stack-no-clear 'array 'float 16)) (set! guard-idx 0) - (dotimes (guard-count (the-as int (-> obj vehicle-tracker-array active-object-count))) - (case (-> obj vehicle-tracker-array active-object-type-list guard-count) + (dotimes (guard-count (the-as int (-> this vehicle-tracker-array active-object-count))) + (case (-> this vehicle-tracker-array active-object-type-list guard-count) (((traffic-type crimson-guard-1)) - (let ((guard (handle->process (-> obj vehicle-tracker-array active-object-list guard-count)))) + (let ((guard (handle->process (-> this vehicle-tracker-array active-object-list guard-count)))) (when (and guard (not (focus-test? (the-as process-focusable guard) dead inactive)) (= (-> (the-as crimson-guard guard) traffic-target-status handle) (-> target-status handle)) @@ -2266,7 +2266,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> s3-3 quad) (-> (get-trans (the-as process-focusable s5-1) 3) quad)) (cond ((= (-> s5-1 type) target) - (mem-copy! (the-as pointer target-status) (the-as pointer (-> obj alert-state target-status-array)) 80) + (mem-copy! (the-as pointer target-status) (the-as pointer (-> this alert-state target-status-array)) 80) ) (else ) @@ -2279,24 +2279,24 @@ Process is recycled and moved to reserved, if it deactivates." target-status ) -(defmethod set-alert-duration traffic-engine ((obj traffic-engine) (arg0 time-frame)) - (set! (-> obj alert-state duration) (the-as uint arg0)) +(defmethod set-alert-duration traffic-engine ((this traffic-engine) (arg0 time-frame)) + (set! (-> this alert-state duration) (the-as uint arg0)) 0 (none) ) -(defmethod guard-count traffic-engine ((obj traffic-engine)) +(defmethod guard-count traffic-engine ((this traffic-engine)) (let ((v0-0 0)) (dotimes (v1-0 6) - (+! v0-0 (-> obj alert-state guard-type-info-array v1-0 count)) + (+! v0-0 (-> this alert-state guard-type-info-array v1-0 count)) ) v0-0 ) ) -(defmethod end-pursuit-by-type traffic-engine ((obj traffic-engine) (arg0 traffic-type)) +(defmethod end-pursuit-by-type traffic-engine ((this traffic-engine) (arg0 traffic-type)) (for-all-active-processes-of-type - (-> obj tracker-array (-> obj object-type-info-array arg0 tracker-index)) + (-> this tracker-array (-> this object-type-info-array arg0 tracker-index)) arg0 (the-as (function process-focusable traffic-object-type-info none) @@ -2307,10 +2307,10 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-target-level traffic-engine ((obj traffic-engine) (arg0 float)) - (set! (-> obj alert-state guard-target-level) arg0) +(defmethod set-target-level traffic-engine ((this traffic-engine) (arg0 float)) + (set! (-> this alert-state guard-target-level) arg0) (dotimes (v1-0 21) - (let ((a2-2 (-> obj object-type-info-array v1-0))) + (let ((a2-2 (-> this object-type-info-array v1-0))) (set! (-> a2-2 target-count) (the int (* arg0 (the float (max 0 (+ (-> a2-2 want-count) -1)))))) ) ) @@ -2318,8 +2318,8 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-guard-target-level traffic-engine ((obj traffic-engine) (arg0 float)) - (set! (-> obj alert-state guard-target-level) arg0) +(defmethod set-guard-target-level traffic-engine ((this traffic-engine) (arg0 float)) + (set! (-> this alert-state guard-target-level) arg0) 0 (none) ) @@ -2578,24 +2578,24 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod get-traffic-guard-type-settings traffic-engine ((obj traffic-engine) (arg0 int)) +(defmethod get-traffic-guard-type-settings traffic-engine ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" - (-> obj alert-state settings guard-settings-array arg0) + (-> this alert-state settings guard-settings-array arg0) ) -(defmethod get-guard-type-for-traffic-obj traffic-engine ((obj traffic-engine) (arg0 int)) +(defmethod get-guard-type-for-traffic-obj traffic-engine ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" - (-> obj object-type-info-array arg0 guard-type) + (-> this object-type-info-array arg0 guard-type) ) -(defmethod get-traffic-guard-change-to-type traffic-engine ((obj traffic-engine) (arg0 int)) +(defmethod get-traffic-guard-change-to-type traffic-engine ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" - (-> obj alert-state guard-type-info-array arg0 change-to-type) + (-> this alert-state guard-type-info-array arg0 change-to-type) ) -(defmethod update-guards traffic-engine ((obj traffic-engine)) +(defmethod update-guards traffic-engine ((this traffic-engine)) (dotimes (v1-0 6) - (set! (-> obj alert-state guard-type-info-array v1-0 count) 0) + (set! (-> this alert-state guard-type-info-array v1-0 count) 0) ) (let* ((f0-0 122880.0) (f0-2 (* f0-0 f0-0)) @@ -2603,16 +2603,16 @@ Process is recycled and moved to reserved, if it deactivates." (v1-5 0) ) (let ((a1-0 0)) - (dotimes (a2-0 (the-as int (-> obj citizen-tracker-array active-object-count))) - (case (-> obj citizen-tracker-array active-object-type-list a2-0) + (dotimes (a2-0 (the-as int (-> this citizen-tracker-array active-object-count))) + (case (-> this citizen-tracker-array active-object-type-list a2-0) (((traffic-type guard-bike) (traffic-type hellcat)) - (let ((a3-6 (handle->process (-> obj citizen-tracker-array active-object-list a2-0)))) + (let ((a3-6 (handle->process (-> this citizen-tracker-array active-object-list a2-0)))) (when (and a3-6 (not (focus-test? (the-as vehicle a3-6) dead inactive)) (logtest? (rigid-body-object-flag alert) (-> (the-as vehicle a3-6) flags)) ) (let ((t0-13 (-> (the-as vehicle a3-6) info guard-type))) - (+! (-> obj alert-state guard-type-info-array t0-13 count) 1) + (+! (-> this alert-state guard-type-info-array t0-13 count) 1) ) (when (and (logtest? (rigid-body-object-flag in-pursuit) (-> (the-as vehicle a3-6) flags)) (logtest? (rigid-body-object-flag target-in-sight) (-> (the-as vehicle a3-6) flags)) @@ -2633,10 +2633,10 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (set! (-> obj alert-state guards-in-sight-of-target) a1-0) + (set! (-> this alert-state guards-in-sight-of-target) a1-0) ) (when (< 2 v1-5) - (if (not (logtest? (-> obj alert-state flags) (traffic-alert-flag disable-pursuit-control))) + (if (not (logtest? (-> this alert-state flags) (traffic-alert-flag disable-pursuit-control))) (send-event a0-3 'end-pursuit) ) ) @@ -2647,10 +2647,10 @@ Process is recycled and moved to reserved, if it deactivates." ) (let ((s3-0 0)) (let ((s2-0 0)) - (dotimes (s1-0 (the-as int (-> obj vehicle-tracker-array active-object-count))) - (case (-> obj vehicle-tracker-array active-object-type-list s1-0) + (dotimes (s1-0 (the-as int (-> this vehicle-tracker-array active-object-count))) + (case (-> this vehicle-tracker-array active-object-type-list s1-0) (((traffic-type crimson-guard-1)) - (let ((s0-0 (handle->process (-> obj vehicle-tracker-array active-object-list s1-0)))) + (let ((s0-0 (handle->process (-> this vehicle-tracker-array active-object-list s1-0)))) (when (and s0-0 (not (logtest? (-> (the-as crimson-guard s0-0) focus-status) (focus-status dead inactive)))) (when (and (logtest? (-> (the-as crimson-guard s0-0) flags) (citizen-flag in-pursuit)) (logtest? (-> (the-as crimson-guard s0-0) flags) (citizen-flag target-in-sight)) @@ -2664,7 +2664,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! s5-0 (the-as crimson-guard s0-0)) ) (if (and (< 327680.0 f0-3) - (not (logtest? (-> obj alert-state flags) (traffic-alert-flag disable-pursuit-control))) + (not (logtest? (-> this alert-state flags) (traffic-alert-flag disable-pursuit-control))) ) (send-event (the-as crimson-guard s0-0) 'end-pursuit) ) @@ -2674,7 +2674,7 @@ Process is recycled and moved to reserved, if it deactivates." (let ((v1-42 (-> s0-0 stack 860))) (when (< v1-42 (the-as uint 6)) (+! s2-0 1) - (+! (-> obj alert-state guard-type-info-array v1-42 count) 1) + (+! (-> this alert-state guard-type-info-array v1-42 count) 1) ) ) ) @@ -2683,10 +2683,10 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (+! (-> obj alert-state guards-in-sight-of-target) s3-0) + (+! (-> this alert-state guards-in-sight-of-target) s3-0) ) (when (< 2 s4-0) - (if (not (logtest? (-> obj alert-state flags) (traffic-alert-flag disable-pursuit-control))) + (if (not (logtest? (-> this alert-state flags) (traffic-alert-flag disable-pursuit-control))) (send-event s5-0 'end-pursuit) ) ) @@ -2698,8 +2698,8 @@ Process is recycled and moved to reserved, if it deactivates." (a2-4 9) ) (dotimes (a3-9 6) - (when (= (-> obj alert-state guard-type-info-array a3-9 object-type) (traffic-type crimson-guard-1)) - (let ((t1-15 (-> obj alert-state guard-type-info-array a3-9))) + (when (= (-> this alert-state guard-type-info-array a3-9 object-type) (traffic-type crimson-guard-1)) + (let ((t1-15 (-> this alert-state guard-type-info-array a3-9))) (set! (-> t1-15 change-to-type) (the-as uint a3-9)) (let ((t0-33 (- (-> t1-15 target-count) (-> t1-15 count)))) (when (< a1-6 t0-33) @@ -2716,30 +2716,30 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (when (and (!= v1-58 -1) (!= a0-25 -1)) - (set! (-> obj alert-state guard-type-info-array a0-25 change-to-type) (the-as uint v1-58)) - (set! (-> obj object-type-info-array 6 guard-type) (the-as uint v1-58)) + (set! (-> this alert-state guard-type-info-array a0-25 change-to-type) (the-as uint v1-58)) + (set! (-> this object-type-info-array 6 guard-type) (the-as uint v1-58)) ) ) 0 (none) ) -(defmethod update-alert-state traffic-engine ((obj traffic-engine)) - (if (and (logtest? (-> obj alert-state flags) (traffic-alert-flag target-jak)) *target*) - (set! (-> obj alert-state target-status-array 0 handle) (process->handle *target*)) +(defmethod update-alert-state traffic-engine ((this traffic-engine)) + (if (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) *target*) + (set! (-> this alert-state target-status-array 0 handle) (process->handle *target*)) ) (when #t (mem-copy! - (the-as pointer (-> obj alert-state settings)) - (the-as pointer (-> *alert-level-settings* (-> obj alert-state level))) + (the-as pointer (-> this alert-state settings)) + (the-as pointer (-> *alert-level-settings* (-> this alert-state level))) 96 ) (dotimes (v1-10 6) - (let ((a1-3 (-> obj alert-state settings guard-settings-array v1-10)) - (a0-10 (-> obj alert-state guard-type-info-array v1-10)) + (let ((a1-3 (-> this alert-state settings guard-settings-array v1-10)) + (a0-10 (-> this alert-state guard-type-info-array v1-10)) ) (set! (-> a1-3 inaccuracy) - (fmax 0.0 (fmin 1.0 (* (-> a1-3 inaccuracy) (-> obj alert-state guard-inaccuracy-factor)))) + (fmax 0.0 (fmin 1.0 (* (-> a1-3 inaccuracy) (-> this alert-state guard-inaccuracy-factor)))) ) (when *target* (when (focus-test? *target* pilot) @@ -2751,7 +2751,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> a0-10 target-count) (max (min - (the int (* (the float (-> a1-3 target-count)) (-> obj alert-state guard-target-level))) + (the int (* (the float (-> a1-3 target-count)) (-> this alert-state guard-target-level))) (-> a0-10 max-target-count) ) (-> a0-10 min-target-count) @@ -2761,8 +2761,8 @@ Process is recycled and moved to reserved, if it deactivates." (#when PC_PORT (when (and (pc-cheats? (-> *pc-settings* cheats) city-peace) (not (task-node-open? (game-task-node city-help-kid-battle)))) (set! (-> a0-10 target-count) (-> a0-10 min-target-count)) - (set! (-> obj alert-state level) 0) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) + (set! (-> this alert-state level) 0) + (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) (if (zero? (-> a0-10 target-count)) (send-event *traffic-manager* 'deactivate-by-type (-> a0-10 object-type))) ) @@ -2771,49 +2771,49 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (dotimes (v1-13 21) - (let ((a1-8 (-> obj alert-state guard-type-mask-from-object-type v1-13))) + (let ((a1-8 (-> this alert-state guard-type-mask-from-object-type v1-13))) (when (nonzero? a1-8) (let ((a2-18 0) (a0-14 0) ) (while (nonzero? a1-8) (if (logtest? a1-8 1) - (+! a0-14 (-> obj alert-state guard-type-info-array a2-18 target-count)) + (+! a0-14 (-> this alert-state guard-type-info-array a2-18 target-count)) ) (+! a2-18 1) (set! a1-8 (shr a1-8 1)) ) - (set! (-> obj object-type-info-array v1-13 target-count) a0-14) + (set! (-> this object-type-info-array v1-13 target-count) a0-14) ) ) ) ) (let ((s5-0 #f)) (when *traffic-alert-level-force* - (set! (-> obj alert-state level) (the-as uint 3)) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) - (set! (-> obj alert-state start-time) (current-time)) + (set! (-> this alert-state level) (the-as uint 3)) + (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) + (set! (-> this alert-state start-time) (current-time)) ) - (when (>= (-> obj alert-state level) (the-as uint 1)) + (when (>= (-> this alert-state level) (the-as uint 1)) (set! s5-0 #t) (cond - ((logtest? (-> obj alert-state flags) (traffic-alert-flag alert-ending)) + ((logtest? (-> this alert-state flags) (traffic-alert-flag alert-ending)) (cond - ((> (guard-count obj) 0) - (set! (-> obj alert-state start-time) (current-time)) + ((> (guard-count this) 0) + (set! (-> this alert-state start-time) (current-time)) ) (else - (when (>= (- (current-time) (-> obj alert-state start-time)) (seconds 3)) + (when (>= (- (current-time) (-> this alert-state start-time)) (seconds 3)) (set! s5-0 #f) - (set! (-> obj alert-state level) (the-as uint 0)) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) + (set! (-> this alert-state level) (the-as uint 0)) + (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) ) ) ) ) (else (let ((v1-39 - (+ (- (-> obj alert-state start-time) (current-time)) (the-as time-frame (-> obj alert-state duration))) + (+ (- (-> this alert-state start-time) (current-time)) (the-as time-frame (-> this alert-state duration))) ) ) (if (and *target* (-> *target* next-state) (= (-> *target* next-state name) 'target-hide)) @@ -2821,7 +2821,7 @@ Process is recycled and moved to reserved, if it deactivates." ) (if (> v1-39 0) 0 - (logior! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) + (logior! (-> this alert-state flags) (traffic-alert-flag alert-ending)) ) ) ) @@ -2829,8 +2829,8 @@ Process is recycled and moved to reserved, if it deactivates." ) (cond (s5-0 - (when (not (logtest? (-> obj alert-state flags) (traffic-alert-flag alarm-on))) - (logior! (-> obj alert-state flags) (traffic-alert-flag alarm-on)) + (when (not (logtest? (-> this alert-state flags) (traffic-alert-flag alarm-on))) + (logior! (-> this alert-state flags) (traffic-alert-flag alarm-on)) (set! (-> *game-info* wanted-flash) #t) ;; og:preserve-this moved this condition later and changed it ;; (if (= (-> *setting-control* user-current music) 'city1) @@ -2845,39 +2845,39 @@ Process is recycled and moved to reserved, if it deactivates." (if (or (= (-> *setting-control* user-default music-volume) 0.0) (!= (-> *setting-control* user-current music) 'city1) ) - (sound-play "city-alarm" :id (-> obj alert-state alarm-sound-id) :position s5-1) + (sound-play "city-alarm" :id (-> this alert-state alarm-sound-id) :position s5-1) ) ) (if #t - (send-alert-events obj) + (send-alert-events this) ) (let ((v1-67 0)) (dotimes (a0-45 21) - (let ((a1-19 (-> obj object-type-info-array a0-45))) + (let ((a1-19 (-> this object-type-info-array a0-45))) (if #t (+! v1-67 (-> a1-19 killed-count)) ) ) ) - (if (and (>= v1-67 (the-as int (* (-> obj alert-state level) 8))) - (< (-> obj alert-state level) (-> obj alert-state max-level)) + (if (and (>= v1-67 (the-as int (* (-> this alert-state level) 8))) + (< (-> this alert-state level) (-> this alert-state max-level)) ) - (set-alert-level obj (the-as int (+ (-> obj alert-state level) 1))) + (set-alert-level this (the-as int (+ (-> this alert-state level) 1))) ) ) ) (else - (when (logtest? (-> obj alert-state flags) (traffic-alert-flag alarm-on)) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alarm-on)) + (when (logtest? (-> this alert-state flags) (traffic-alert-flag alarm-on)) + (logclear! (-> this alert-state flags) (traffic-alert-flag alarm-on)) (set! (-> *game-info* wanted-flash) #f) (remove-setting! 'sound-mode) - (sound-stop (-> obj alert-state alarm-sound-id)) - (send-alert-events obj) - (let ((v1-84 (-> obj alert-state target-status-array))) + (sound-stop (-> this alert-state alarm-sound-id)) + (send-alert-events this) + (let ((v1-84 (-> this alert-state target-status-array))) (logclear! (-> v1-84 0 flags) (traffic-target-flag visible-now visible-recently visible-ever)) ) (dotimes (v1-85 21) - (set! (-> obj object-type-info-array v1-85 killed-count) (the-as uint 0)) + (set! (-> this object-type-info-array v1-85 killed-count) (the-as uint 0)) 0 ) ) @@ -2888,15 +2888,15 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod send-alert-events traffic-engine ((obj traffic-engine)) - (set! (-> obj alert-state notify-time) (current-time)) +(defmethod send-alert-events traffic-engine ((this traffic-engine)) + (set! (-> this alert-state notify-time) (current-time)) (cond - ((> (-> obj alert-state level) 0) - (if (and (logtest? (-> obj alert-state flags) (traffic-alert-flag target-jak)) - (not (logtest? (-> obj alert-state flags) (traffic-alert-flag alert-ending))) + ((> (-> this alert-state level) 0) + (if (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) + (not (logtest? (-> this alert-state flags) (traffic-alert-flag alert-ending))) *target* ) - (for-all-active-processes obj (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) + (for-all-active-processes this (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) (if (logtest? (-> arg1 flags) (traffic-type-flags trtflags-0)) (send-event arg0 'alert-begin *target*) ) @@ -2906,7 +2906,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (else - (for-all-active-processes obj (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) + (for-all-active-processes this (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) (if (logtest? (-> arg1 flags) (traffic-type-flags trtflags-0)) (send-event arg0 'alert-end) ) @@ -2919,25 +2919,25 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod restore-default-settings traffic-engine ((obj traffic-engine)) +(defmethod restore-default-settings traffic-engine ((this traffic-engine)) (restore-city-speeches) (logclear! - (-> obj alert-state flags) + (-> this alert-state flags) (traffic-alert-flag guard-multi-focus sticky-guard-settings disable-pursuit-control) ) - (set! (-> obj inv-density-factor) 5.0) + (set! (-> this inv-density-factor) 5.0) (if (demo?) - (set! (-> obj inv-density-factor) 1.25) + (set! (-> this inv-density-factor) 1.25) ) - (let ((v1-6 (-> obj alert-state target-status-array))) + (let ((v1-6 (-> this alert-state target-status-array))) (logclear! (-> v1-6 0 flags) (traffic-target-flag force-visible)) ) - (set-target-level obj 1.0) - (set-alert-duration obj (seconds 30)) - (set-max-alert-level obj 4) + (set-target-level this 1.0) + (set-alert-duration this (seconds 30)) + (set-max-alert-level this 4) (let ((v1-13 42)) (dotimes (a0-7 21) - (let ((a1-6 (-> obj object-type-info-array a0-7))) + (let ((a1-6 (-> this object-type-info-array a0-7))) (set! (-> a1-6 flags) (traffic-type-flags trtflags-1 trtflags-2)) (set! (-> a1-6 reserve-count) (the-as uint (max 1000 (min #xfde8 (* 1000 (-> a1-6 want-count)))))) (set! (-> a1-6 killed-count) (the-as uint 0)) @@ -2953,39 +2953,39 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (let ((v1-16 (-> obj object-type-info-array 6))) + (let ((v1-16 (-> this object-type-info-array 6))) (logior! (-> v1-16 flags) (traffic-type-flags trtflags-0)) ) - (let ((v1-17 (-> obj object-type-info-array 7))) + (let ((v1-17 (-> this object-type-info-array 7))) (logior! (-> v1-17 flags) (traffic-type-flags trtflags-0)) ) - (let ((v1-18 (-> obj object-type-info-array 18))) + (let ((v1-18 (-> this object-type-info-array 18))) (logior! (-> v1-18 flags) (traffic-type-flags trtflags-0)) ) - (let ((v1-19 (-> obj object-type-info-array 19))) + (let ((v1-19 (-> this object-type-info-array 19))) (logior! (-> v1-19 flags) (traffic-type-flags trtflags-0)) ) - (let ((v1-20 (-> obj object-type-info-array 20))) + (let ((v1-20 (-> this object-type-info-array 20))) (logior! (-> v1-20 flags) (traffic-type-flags trtflags-0)) ) - (let ((v1-21 (-> obj object-type-info-array 5))) + (let ((v1-21 (-> this object-type-info-array 5))) (set! (-> v1-21 target-count) 0) (logclear! (-> v1-21 flags) (traffic-type-flags trtflags-1 trtflags-2)) ) - (let ((v1-22 (-> obj object-type-info-array 3))) + (let ((v1-22 (-> this object-type-info-array 3))) (set! (-> v1-22 target-count) 0) (logclear! (-> v1-22 flags) (traffic-type-flags trtflags-2)) ) - (let ((v1-23 (-> obj object-type-info-array 4))) + (let ((v1-23 (-> this object-type-info-array 4))) (set! (-> v1-23 target-count) 0) (logclear! (-> v1-23 flags) (traffic-type-flags trtflags-2)) ) - (let ((v1-24 (-> obj object-type-info-array 17))) + (let ((v1-24 (-> this object-type-info-array 17))) (set! (-> v1-24 target-count) 0) (logclear! (-> v1-24 flags) (traffic-type-flags trtflags-1 trtflags-2)) ) (dotimes (v1-25 6) - (let ((a0-28 (-> obj alert-state guard-type-info-array v1-25))) + (let ((a0-28 (-> this alert-state guard-type-info-array v1-25))) (set! (-> a0-28 min-target-count) 0) (set! (-> a0-28 max-target-count) 127) ) @@ -2994,36 +2994,36 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod deactivate-all traffic-engine ((obj traffic-engine)) - (deactivate-all (-> obj citizen-tracker-array) #t) - (deactivate-all (-> obj vehicle-tracker-array) #t) +(defmethod deactivate-all traffic-engine ((this traffic-engine)) + (deactivate-all (-> this citizen-tracker-array) #t) + (deactivate-all (-> this vehicle-tracker-array) #t) 0 (none) ) -(defmethod deactivate-by-type traffic-engine ((obj traffic-engine) (arg0 traffic-type)) - (let ((a2-0 (-> obj object-type-info-array arg0))) - (deactivate-all-of-type (-> obj tracker-array (-> a2-0 tracker-index)) arg0 #t) +(defmethod deactivate-by-type traffic-engine ((this traffic-engine) (arg0 traffic-type)) + (let ((a2-0 (-> this object-type-info-array arg0))) + (deactivate-all-of-type (-> this tracker-array (-> a2-0 tracker-index)) arg0 #t) ) 0 (none) ) -(defmethod deactivate-all-from-level traffic-engine ((obj traffic-engine) (arg0 symbol)) +(defmethod deactivate-all-from-level traffic-engine ((this traffic-engine) (arg0 symbol)) (local-vars (v1-6 nav-branch)) - (countdown (s4-0 (-> obj citizen-tracker-array active-object-count)) - (let ((v1-3 (handle->process (-> obj citizen-tracker-array active-object-list s4-0)))) + (countdown (s4-0 (-> this citizen-tracker-array active-object-count)) + (let ((v1-3 (handle->process (-> this citizen-tracker-array active-object-list s4-0)))) (when v1-3 (cond ((focus-test? (the-as process-focusable v1-3) inactive) - (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #f) + (deactivate-object (-> this citizen-tracker-array) (the-as int s4-0) #f) ) ((begin (set! v1-6 (-> (the-as vehicle v1-3) controller branch)) (and v1-6 (nonzero? v1-6))) (let ((v1-7 (-> v1-6 dest-node))) (cond (v1-7 (if (= arg0 (-> v1-7 level)) - (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #t) + (deactivate-object (-> this citizen-tracker-array) (the-as int s4-0) #t) ) ) (else @@ -3043,8 +3043,8 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-object-auto-activate traffic-engine ((obj traffic-engine) (arg0 int) (arg1 object)) - (let ((v1-2 (-> obj object-type-info-array arg0))) +(defmethod set-object-auto-activate traffic-engine ((this traffic-engine) (arg0 int) (arg1 object)) + (let ((v1-2 (-> this object-type-info-array arg0))) (if arg1 (logior! (-> v1-2 flags) (traffic-type-flags trtflags-2)) (logclear! (-> v1-2 flags) (traffic-type-flags trtflags-2)) @@ -3054,22 +3054,22 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-object-target-level traffic-engine ((obj traffic-engine) (arg0 int) (arg1 float)) - (let ((v1-2 (-> obj object-type-info-array arg0))) +(defmethod set-object-target-level traffic-engine ((this traffic-engine) (arg0 int) (arg1 float)) + (let ((v1-2 (-> this object-type-info-array arg0))) (set! (-> v1-2 target-count) (the int (* arg1 (the float (max 0 (+ (-> v1-2 want-count) -1)))))) ) 0 (none) ) -(defmethod set-object-target-count traffic-engine ((obj traffic-engine) (arg0 int) (arg1 int)) - (set! (-> obj object-type-info-array arg0 target-count) arg1) +(defmethod set-object-target-count traffic-engine ((this traffic-engine) (arg0 int) (arg1 int)) + (set! (-> this object-type-info-array arg0 target-count) arg1) 0 (none) ) -(defmethod set-guard-target-count-range traffic-engine ((obj traffic-engine) (arg0 int) (arg1 int) (arg2 int)) - (let ((v1-2 (-> obj alert-state guard-type-info-array arg0))) +(defmethod set-guard-target-count-range traffic-engine ((this traffic-engine) (arg0 int) (arg1 int) (arg2 int)) + (let ((v1-2 (-> this alert-state guard-type-info-array arg0))) (set! (-> v1-2 min-target-count) (max 0 (min 127 arg1))) (set! (-> v1-2 max-target-count) (max 0 (min 127 arg2))) ) @@ -3077,25 +3077,25 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod set-object-reserve-count traffic-engine ((obj traffic-engine) (arg0 int) (arg1 uint)) - (set! (-> obj object-type-info-array arg0 reserve-count) arg1) +(defmethod set-object-reserve-count traffic-engine ((this traffic-engine) (arg0 int) (arg1 uint)) + (set! (-> this object-type-info-array arg0 reserve-count) arg1) 0 (none) ) ;; WARN: Return type mismatch uint vs int. -(defmethod get-object-reserve-count traffic-engine ((obj traffic-engine) (arg0 int)) - (the-as int (-> obj object-type-info-array arg0 reserve-count)) +(defmethod get-object-reserve-count traffic-engine ((this traffic-engine) (arg0 int)) + (the-as int (-> this object-type-info-array arg0 reserve-count)) ) -(defmethod get-object-remaining-count traffic-engine ((obj traffic-engine) (arg0 int)) - (let ((a0-1 (-> obj object-type-info-array arg0))) +(defmethod get-object-remaining-count traffic-engine ((this traffic-engine) (arg0 int)) + (let ((a0-1 (-> this object-type-info-array arg0))) (+ (-> a0-1 active-count) (-> a0-1 reserve-count)) ) ) -(defmethod set-parking-spot-prob traffic-engine ((obj traffic-engine) (arg0 int) (arg1 float)) - (let ((v1-2 (-> obj object-type-info-array arg0))) +(defmethod set-parking-spot-prob traffic-engine ((this traffic-engine) (arg0 int) (arg1 float)) + (let ((v1-2 (-> this object-type-info-array arg0))) (set! (-> v1-2 parking-spot-prob) (the-as uint (min 255 (the int (* 256.0 arg1))))) ) 0 @@ -3103,13 +3103,13 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; WARN: Return type mismatch int vs traffic-type. -(defmethod get-random-parking-spot-type traffic-engine ((obj traffic-engine)) +(defmethod get-random-parking-spot-type traffic-engine ((this traffic-engine)) (let ((s5-0 11)) (let ((s4-0 (the int (* 256.0 (rand-vu)))) (s3-0 0) ) (while (< (the-as uint s5-0) (the-as uint 21)) - (let ((s2-0 (-> obj object-type-info-array s5-0))) + (let ((s2-0 (-> this object-type-info-array s5-0))) (when (and (logtest? (-> s2-0 flags) (traffic-type-flags trtflags-3)) (= (level-status *level* (-> s2-0 level)) 'active) ) @@ -3126,47 +3126,47 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod activate-object traffic-engine ((obj traffic-engine) (arg0 traffic-object-spawn-params)) - (let ((a2-0 (-> obj object-type-info-array (-> arg0 object-type)))) - (activate-from-params (-> obj tracker-array (-> a2-0 tracker-index)) arg0) +(defmethod activate-object traffic-engine ((this traffic-engine) (arg0 traffic-object-spawn-params)) + (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) + (activate-from-params (-> this tracker-array (-> a2-0 tracker-index)) arg0) ) 0 (none) ) -(defmethod activate-by-handle traffic-engine ((obj traffic-engine) (arg0 traffic-object-spawn-params)) - (let ((a2-0 (-> obj object-type-info-array (-> arg0 object-type)))) - (activate-by-handle (-> obj tracker-array (-> a2-0 tracker-index)) arg0) +(defmethod activate-by-handle traffic-engine ((this traffic-engine) (arg0 traffic-object-spawn-params)) + (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) + (activate-by-handle (-> this tracker-array (-> a2-0 tracker-index)) arg0) ) 0 (none) ) -(defmethod new-suppression-box traffic-engine ((obj traffic-engine) (arg0 traffic-suppression-params)) - (add-new-supression-box (-> obj suppressor) arg0) +(defmethod new-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) + (add-new-supression-box (-> this suppressor) arg0) (none) ) -(defmethod remove-suppression-box traffic-engine ((obj traffic-engine) (arg0 traffic-suppression-params)) - (remove-box-by-id (-> obj suppressor) (the-as int arg0)) +(defmethod remove-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) + (remove-box-by-id (-> this suppressor) (the-as int arg0)) (none) ) -(defmethod update-suppression-box traffic-engine ((obj traffic-engine) (arg0 traffic-suppression-params)) - (update-box-from-params (-> obj suppressor) arg0) +(defmethod update-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) + (update-box-from-params (-> this suppressor) arg0) (none) ) -(defmethod update-suppressor traffic-engine ((obj traffic-engine)) +(defmethod update-suppressor traffic-engine ((this traffic-engine)) (let ((v1-3 (- (-> *display* game-clock frame-counter) (-> *display* game-clock old-frame-counter)))) (dotimes (a1-3 16) - (let ((a2-2 (-> obj suppressor array a1-3))) + (let ((a2-2 (-> this suppressor array a1-3))) (when (logtest? (-> a2-2 flags) (traffic-suppression-box-flags in-use)) (let ((a3-3 (the-as int (-> a2-2 duration)))) (cond ((< (the-as uint a3-3) (the-as uint v1-3)) (logclear! (-> a2-2 flags) (traffic-suppression-box-flags in-use)) - (logior! (-> obj suppressor flags) (traffic-suppression-flags needs-update)) + (logior! (-> this suppressor flags) (traffic-suppression-flags needs-update)) ) (else (set! (-> a2-2 duration) (the-as uint (- (the-as time-frame a3-3) v1-3))) @@ -3177,19 +3177,19 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (when (logtest? (-> obj suppressor flags) (traffic-suppression-flags needs-update)) - (logclear! (-> obj suppressor flags) (traffic-suppression-flags needs-update)) - (recompute-supressions obj) + (when (logtest? (-> this suppressor flags) (traffic-suppression-flags needs-update)) + (logclear! (-> this suppressor flags) (traffic-suppression-flags needs-update)) + (recompute-supressions this) ) 0 (none) ) -(defmethod recompute-supressions traffic-engine ((obj traffic-engine)) +(defmethod recompute-supressions traffic-engine ((this traffic-engine)) (dotimes (s5-0 2) - (let ((v1-3 (-> obj level-data-array s5-0))) + (let ((v1-3 (-> this level-data-array s5-0))) (if (nonzero? (-> v1-3 city-info)) - (update-suppressions-from-traffic-engine (-> v1-3 city-info) obj) + (update-suppressions-from-traffic-engine (-> v1-3 city-info) this) ) ) ) @@ -3204,22 +3204,22 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod get-first-cell-in-box city-level-info ((obj city-level-info) (arg0 vis-grid-box)) - (-> obj +(defmethod get-first-cell-in-box city-level-info ((this city-level-info) (arg0 vis-grid-box)) + (-> this cell-array (+ (-> arg0 min x) - (* (-> arg0 min z) (-> obj grid-info dimension-array 0)) - (* (* (-> arg0 min y) (-> obj grid-info dimension-array 0)) (-> obj grid-info dimension-array 2)) + (* (-> arg0 min z) (-> this grid-info dimension-array 0)) + (* (* (-> arg0 min y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) ) ) ) -(defmethod sphere-in-grid? city-level-info ((obj city-level-info) (arg0 vector) (arg1 int)) +(defmethod sphere-in-grid? city-level-info ((this city-level-info) (arg0 vector) (arg1 int)) (let ((gp-0 #f)) (let ((s3-0 (new 'stack-no-clear 'vis-grid-box)) (s2-0 (new 'stack-no-clear 'vis-grid-box)) ) - (lookup-box-for-sphere (-> obj grid-info) s2-0 arg0) + (lookup-box-for-sphere (-> this grid-info) s2-0 arg0) (set! (-> s3-0 min y) (-> s2-0 min y)) (let ((v1-6 (+ (- 1 (-> s2-0 min y)) (-> s2-0 max y)))) (b! #t cfg-13 :delay (nop!)) @@ -3235,7 +3235,7 @@ Process is recycled and moved to reserved, if it deactivates." (b! #t cfg-9 :delay (nop!)) (label cfg-3) (+! a1-7 -1) - (let ((a3-0 obj) + (let ((a3-0 this) (t1-0 s3-0) ) (b! @@ -3275,7 +3275,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod callback-on-nav-segments-in-sphere city-level-info ((obj city-level-info) +(defmethod callback-on-nav-segments-in-sphere city-level-info ((this city-level-info) (arg0 vector) (arg1 int) (arg2 traffic-find-segment-struct) @@ -3290,7 +3290,7 @@ Process is recycled and moved to reserved, if it deactivates." (sv-80 vis-grid-box) (sv-84 vis-grid-box) ) - (set! sv-16 obj) + (set! sv-16 this) (set! sv-20 arg0) (set! sv-24 arg1) (set! sv-28 arg2) @@ -3336,10 +3336,10 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod update-suppressions-from-traffic-engine city-level-info ((obj city-level-info) (arg0 traffic-engine)) - (let ((v1-0 (-> obj cell-count))) +(defmethod update-suppressions-from-traffic-engine city-level-info ((this city-level-info) (arg0 traffic-engine)) + (let ((v1-0 (-> this cell-count))) (dotimes (a0-1 (the-as int v1-0)) - (let ((a1-2 (-> obj cell-array a0-1))) + (let ((a1-2 (-> this cell-array a0-1))) (logclear! (-> a1-2 flags) (vis-cell-flag suppress)) ) ) @@ -3348,15 +3348,15 @@ Process is recycled and moved to reserved, if it deactivates." (dotimes (s3-0 16) (let ((s2-0 (-> arg0 suppressor array s3-0))) (when (logtest? (-> s2-0 flags) (traffic-suppression-box-flags in-use)) - (lookup-cell-for-point (-> obj grid-info) (-> s4-0 1) (the-as vector (-> s2-0 bbox))) - (lookup-cell-for-point (-> obj grid-info) (-> s4-0 2) (-> s2-0 bbox max)) + (lookup-cell-for-point (-> this grid-info) (-> s4-0 1) (the-as vector (-> s2-0 bbox))) + (lookup-cell-for-point (-> this grid-info) (-> s4-0 2) (-> s2-0 bbox max)) (set! (-> s4-0 0 y) (-> s4-0 1 y)) (countdown (v1-15 (+ (- 1 (-> s4-0 1 y)) (-> s4-0 2 y))) (set! (-> s4-0 0 z) (-> s4-0 1 z)) (countdown (a0-9 (+ (- 1 (-> s4-0 1 z)) (-> s4-0 2 z))) (set! (-> s4-0 0 x) (-> s4-0 1 x)) (countdown (a1-10 (+ (- 1 (-> s4-0 1 x)) (-> s4-0 2 x))) - (let* ((a3-1 obj) + (let* ((a3-1 this) (t1-0 (-> s4-0 0)) (a2-8 (-> a3-1 cell-array @@ -3383,43 +3383,43 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod add-active-cell traffic-level-data ((obj traffic-level-data) (arg0 vis-cell)) - (let ((v1-0 (-> obj active-cell-count))) +(defmethod add-active-cell traffic-level-data ((this traffic-level-data) (arg0 vis-cell)) + (let ((v1-0 (-> this active-cell-count))) (when (< v1-0 (the-as uint 255)) - (set! (-> obj active-cell-list v1-0) arg0) - (+! (-> obj active-cell-count) 1) + (set! (-> this active-cell-list v1-0) arg0) + (+! (-> this active-cell-count) 1) ) ) 0 (none) ) -(defmethod remove-active-cell traffic-level-data ((obj traffic-level-data) (arg0 int)) - (let ((v1-1 (+ (-> obj active-cell-count) -1))) +(defmethod remove-active-cell traffic-level-data ((this traffic-level-data) (arg0 int)) + (let ((v1-1 (+ (-> this active-cell-count) -1))) (when (>= v1-1 0) - (set! (-> obj active-cell-list arg0) (-> obj active-cell-list v1-1)) - (+! (-> obj active-cell-count) -1) + (set! (-> this active-cell-list arg0) (-> this active-cell-list v1-1)) + (+! (-> this active-cell-count) -1) ) ) 0 (none) ) -(defmethod add-newly-active-cell traffic-level-data ((obj traffic-level-data) (arg0 vis-cell)) - (let ((v1-0 (-> obj newly-active-cell-count))) +(defmethod add-newly-active-cell traffic-level-data ((this traffic-level-data) (arg0 vis-cell)) + (let ((v1-0 (-> this newly-active-cell-count))) (when (< v1-0 (the-as uint 255)) - (set! (-> obj newly-active-cell-list v1-0) arg0) - (+! (-> obj newly-active-cell-count) 1) + (set! (-> this newly-active-cell-list v1-0) arg0) + (+! (-> this newly-active-cell-count) 1) ) ) 0 (none) ) -(defmethod per-frame-cell-update traffic-level-data ((obj traffic-level-data)) - (set! (-> obj newly-active-cell-count) (the-as uint 0)) - (dotimes (v1-0 (the-as int (-> obj active-cell-count))) - (let ((a0-3 (-> obj active-cell-list v1-0))) +(defmethod per-frame-cell-update traffic-level-data ((this traffic-level-data)) + (set! (-> this newly-active-cell-count) (the-as uint 0)) + (dotimes (v1-0 (the-as int (-> this active-cell-count))) + (let ((a0-3 (-> this active-cell-list v1-0))) (set! (-> a0-3 prev-flags) (-> a0-3 flags)) ) ) @@ -3428,8 +3428,8 @@ Process is recycled and moved to reserved, if it deactivates." (f28-0 (meters 200)) (f26-0 (meters 120)) ) - (dotimes (s4-0 (the-as int (-> obj city-info cell-count))) - (let ((s3-0 (-> obj city-info cell-array s4-0))) + (dotimes (s4-0 (the-as int (-> this city-info cell-count))) + (let ((s3-0 (-> this city-info cell-array s4-0))) (let ((f24-0 (vector-vector-distance-squared (-> s3-0 sphere) s5-0)) (f0-1 (+ (-> s3-0 sphere r) f28-0)) ) @@ -3455,25 +3455,25 @@ Process is recycled and moved to reserved, if it deactivates." (if (< (the-as uint (logand (-> s3-0 prev-flags) (vis-cell-flag active-vehicle active-pedestrian))) (the-as uint (logand (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian))) ) - (add-newly-active-cell obj s3-0) + (add-newly-active-cell this s3-0) ) ) ) ) - (countdown (s5-1 (-> obj active-cell-count)) - (let ((v1-32 (-> obj active-cell-list s5-1))) + (countdown (s5-1 (-> this active-cell-count)) + (let ((v1-32 (-> this active-cell-list s5-1))) (when (not (logtest? (-> v1-32 flags) (vis-cell-flag active-vehicle active-pedestrian))) (logclear! (-> v1-32 prev-flags) (vis-cell-flag active-vehicle active-pedestrian)) - (remove-active-cell obj (the-as int s5-1)) + (remove-active-cell this (the-as int s5-1)) ) ) ) - (dotimes (s5-2 (the-as int (-> obj newly-active-cell-count))) - (let ((a1-5 (-> obj newly-active-cell-list s5-2))) - (add-active-cell obj a1-5) + (dotimes (s5-2 (the-as int (-> this newly-active-cell-count))) + (let ((a1-5 (-> this newly-active-cell-list s5-2))) + (add-active-cell this a1-5) ) ) - (let ((v1-43 (-> obj active-cell-box))) + (let ((v1-43 (-> this active-cell-box))) (set-vector! (-> v1-43 min) 10000000000000000000000000000000000000.0 @@ -3488,8 +3488,8 @@ Process is recycled and moved to reserved, if it deactivates." -10000000000000000000000000000000000000.0 1.0 ) - (countdown (a0-23 (-> obj active-cell-count)) - (let ((a1-16 (-> obj active-cell-list a0-23))) + (countdown (a0-23 (-> this active-cell-count)) + (let ((a1-16 (-> this active-cell-list a0-23))) (set! (-> v1-43 min x) (fmin (-> v1-43 min x) (- (-> a1-16 sphere x) (-> a1-16 sphere r)))) (set! (-> v1-43 min y) (fmin (-> v1-43 min y) (- (-> a1-16 sphere y) (-> a1-16 sphere r)))) (set! (-> v1-43 min z) (fmin (-> v1-43 min z) (- (-> a1-16 sphere z) (-> a1-16 sphere r)))) @@ -3503,20 +3503,20 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod lookup-cell-by-position city-level-info ((obj city-level-info) (arg0 vector)) +(defmethod lookup-cell-by-position city-level-info ((this city-level-info) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'vis-grid-pos))) - (lookup-cell-for-point (-> obj grid-info) s5-0 arg0) - (-> obj + (lookup-cell-for-point (-> this grid-info) s5-0 arg0) + (-> this cell-array (+ (-> s5-0 x) - (* (-> s5-0 z) (-> obj grid-info dimension-array 0)) - (* (* (-> s5-0 y) (-> obj grid-info dimension-array 0)) (-> obj grid-info dimension-array 2)) + (* (-> s5-0 z) (-> this grid-info dimension-array 0)) + (* (* (-> s5-0 y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) ) ) ) ) -(defmethod init-vis-ray city-level-info ((obj city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) +(defmethod init-vis-ray city-level-info ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) (set! (-> arg0 pos quad) (-> arg1 quad)) (set! (-> arg0 dest-pos quad) (-> arg2 quad)) (let ((v1-2 (new 'stack-no-clear 'vector))) @@ -3528,13 +3528,13 @@ Process is recycled and moved to reserved, if it deactivates." (vector-float*! a0-9 v1-2 (/ 1.0 f0-1)) ) ) - (lookup-cell-for-point (-> obj grid-info) (-> arg0 grid-pos) arg1) - (set! (-> arg0 cell) (lookup-cell-by-position obj arg1)) + (lookup-cell-for-point (-> this grid-info) (-> arg0 grid-pos) arg1) + (set! (-> arg0 cell) (lookup-cell-by-position this arg1)) 0 (none) ) -(defmethod city-level-info-method-11 city-level-info ((obj city-level-info) (arg0 vis-ray)) +(defmethod city-level-info-method-11 city-level-info ((this city-level-info) (arg0 vis-ray)) (local-vars (a3-3 int)) (let ((f0-0 (-> arg0 len)) (s4-0 -1) @@ -3545,7 +3545,7 @@ Process is recycled and moved to reserved, if it deactivates." ) (set! (-> a1-1 quad) (the-as uint128 0)) (set! (-> a1-1 data a0-1) -1.0) - (let ((f1-1 (-> obj grid-info box min data a0-1)) + (let ((f1-1 (-> this grid-info box min data a0-1)) (a2-6 1) ) (let ((a3-2 (-> arg0 dir data a0-1))) @@ -3554,7 +3554,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> a1-1 w) (+ f1-1 (* (the float (+ (- a2-6 (logand a3-3 1)) (-> (the-as (pointer int8) (+ a0-1 (the-as int arg0))) 64))) - (-> obj grid-info cell-size data a0-1) + (-> this grid-info cell-size data a0-1) ) ) ) @@ -3585,11 +3585,11 @@ Process is recycled and moved to reserved, if it deactivates." ) (let ((a1-4 (-> arg0 grid-pos))) (set! (-> arg0 cell) - (-> obj + (-> this cell-array (+ (-> a1-4 x) - (* (-> a1-4 z) (-> obj grid-info dimension-array 0)) - (* (* (-> a1-4 y) (-> obj grid-info dimension-array 0)) (-> obj grid-info dimension-array 2)) + (* (-> a1-4 z) (-> this grid-info dimension-array 0)) + (* (* (-> a1-4 y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) ) ) ) @@ -3601,7 +3601,7 @@ Process is recycled and moved to reserved, if it deactivates." (none) ) -(defmethod city-level-info-method-12 city-level-info ((obj city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector)) +(defmethod city-level-info-method-12 city-level-info ((this city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -3719,10 +3719,10 @@ Process is recycled and moved to reserved, if it deactivates." ) ) -(defmethod city-level-info-method-18 city-level-info ((obj city-level-info)) +(defmethod city-level-info-method-18 city-level-info ((this city-level-info)) (local-vars (sv-48 int)) (let ((gp-0 (new 'stack-no-clear 'bounding-box)) - (s5-0 (-> obj nav-graph)) + (s5-0 (-> this nav-graph)) ) (set! sv-48 (-> s5-0 node-count)) (dotimes (s4-0 sv-48) @@ -3763,7 +3763,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; WARN: Return type mismatch object vs symbol. -(defmethod city-level-info-method-9 city-level-info ((obj city-level-info)) +(defmethod city-level-info-method-9 city-level-info ((this city-level-info)) (local-vars (sv-96 (inline-array nav-node)) (sv-100 int) @@ -3783,22 +3783,22 @@ Process is recycled and moved to reserved, if it deactivates." (sv-260 vis-cell) (sv-264 int) ) - (set! (-> obj cell-count) - (the-as uint (* (* (-> obj grid-info dimension-array 0) (-> obj grid-info dimension-array 1)) - (-> obj grid-info dimension-array 2) + (set! (-> this cell-count) + (the-as uint (* (* (-> this grid-info dimension-array 0) (-> this grid-info dimension-array 1)) + (-> this grid-info dimension-array 2) ) ) ) - (let ((s5-0 (-> obj cell-count))) + (let ((s5-0 (-> this cell-count))) (dotimes (s4-0 (the-as int s5-0)) - (reset-segment-counts (-> obj cell-array s4-0)) + (reset-segment-counts (-> this cell-array s4-0)) ) - (when (< 0.01 (-> obj grid-info axis-scale 0)) + (when (< 0.01 (-> this grid-info axis-scale 0)) (format 0 "segments not generates~%") (return (the-as symbol #t)) ) - (set! sv-96 (-> obj nav-graph node-array)) - (set! sv-100 (-> obj nav-graph node-count)) + (set! sv-96 (-> this nav-graph node-array)) + (set! sv-100 (-> this nav-graph node-count)) (set! sv-104 (new 'stack-no-clear 'vis-ray)) (set! sv-112 0) (dotimes (s4-1 sv-100) @@ -3830,13 +3830,13 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (else - (city-level-info-method-12 obj sv-168 a2-0 sv-164) + (city-level-info-method-12 this sv-168 a2-0 sv-164) ) ) - (init-vis-ray obj sv-104 sv-168 sv-164) + (init-vis-ray this sv-104 sv-168 sv-164) (while (< 0.0 (-> sv-104 len)) (set! sv-172 (-> sv-104 cell)) - (city-level-info-method-11 obj sv-104) + (city-level-info-method-11 this sv-104) (+! (-> sv-172 segment-count) 1) (set! sv-112 (+ sv-112 1)) (if (> sv-176 0) @@ -3850,14 +3850,14 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (format 0 "~d segments were generated~%" sv-112) - (set! (-> obj segment-array) (the-as (inline-array nav-segment) (malloc 'debug (* 48 sv-112)))) + (set! (-> this segment-array) (the-as (inline-array nav-segment) (malloc 'debug (* 48 sv-112)))) (let ((v1-59 0)) (dotimes (a0-20 (the-as int s5-0)) - (let ((a1-14 (-> obj cell-array a0-20))) + (let ((a1-14 (-> this cell-array a0-20))) (set! (-> a1-14 id) (the-as uint a0-20)) (set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) #f)) (when (> (-> a1-14 segment-count) 0) - (set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) (-> obj segment-array v1-59))) + (set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) (-> this segment-array v1-59))) (dotimes (a2-8 (-> a1-14 segment-count)) (let ((a3-5 (-> a1-14 segment-array a2-8))) (set! (-> a3-5 id) (the-as uint v1-59)) @@ -3872,7 +3872,7 @@ Process is recycled and moved to reserved, if it deactivates." ) 0 ) - (set! (-> obj segment-count) v1-59) + (set! (-> this segment-count) v1-59) ) ) (dotimes (s5-1 sv-100) @@ -3906,14 +3906,14 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (else - (city-level-info-method-12 obj sv-244 sv-184 sv-252) + (city-level-info-method-12 this sv-244 sv-184 sv-252) ) ) - (init-vis-ray obj sv-104 sv-244 sv-252) + (init-vis-ray this sv-104 sv-244 sv-252) (while (< 0.0 (-> sv-104 len)) (set! (-> sv-248 quad) (-> sv-104 pos quad)) (set! sv-260 (-> sv-104 cell)) - (city-level-info-method-11 obj sv-104) + (city-level-info-method-11 this sv-104) (let ((a2-14 (-> sv-260 incoming-segment-count))) (if (zero? sv-264) (set! a2-14 @@ -3973,8 +3973,8 @@ Process is recycled and moved to reserved, if it deactivates." (the-as symbol 0) ) -(defmethod debug-check-proc-in-tracker traffic-engine ((obj traffic-engine) (arg0 process) (arg1 int)) - (let ((v1-3 (-> obj tracker-array arg1)) +(defmethod debug-check-proc-in-tracker traffic-engine ((this traffic-engine) (arg0 process) (arg1 int)) + (let ((v1-3 (-> this tracker-array arg1)) (a0-3 (process->handle arg0)) (a3-4 0) ) diff --git a/goal_src/jak2/levels/city/traffic/traffic-manager.gc b/goal_src/jak2/levels/city/traffic/traffic-manager.gc index 3e5836cb39..9e9b636372 100644 --- a/goal_src/jak2/levels/city/traffic/traffic-manager.gc +++ b/goal_src/jak2/levels/city/traffic/traffic-manager.gc @@ -54,12 +54,12 @@ (none) ) -(defmethod update traffic-manager ((obj traffic-manager)) - (update-traffic (-> obj traffic-engine)) - (kill-excess-once obj) - (spawn-all obj) +(defmethod update traffic-manager ((this traffic-manager)) + (update-traffic (-> this traffic-engine)) + (kill-excess-once this) + (spawn-all this) (if *debug-segment* - (debug-unused (-> obj traffic-engine)) + (debug-unused (-> this traffic-engine)) ) (if *display-traffic-height-map* (debug-draw *traffic-height-map* (target-pos 0)) @@ -75,15 +75,15 @@ (none) ) -(defmethod kill-excess-once traffic-manager ((obj traffic-manager)) +(defmethod kill-excess-once traffic-manager ((this traffic-manager)) (let ((type-i 0)) (while (< (the-as uint type-i) (the-as uint 21)) - (let ((traffic (-> obj traffic-engine object-type-info-array type-i))) + (let ((traffic (-> this traffic-engine object-type-info-array type-i))) (when (logtest? (-> traffic flags) (traffic-type-flags trtflags-1)) (let ((total-count (+ (-> traffic active-count) (-> traffic inactive-count)))) (when (< (-> traffic want-count) total-count) (let ((a0-10 (handle->process (get-from-inactive-by-type - (-> obj traffic-engine tracker-array (-> traffic tracker-index)) + (-> this traffic-engine tracker-array (-> traffic tracker-index)) (the-as traffic-type type-i) ) ) @@ -104,13 +104,13 @@ (none) ) -(defmethod kill-all-inactive traffic-manager ((obj traffic-manager)) +(defmethod kill-all-inactive traffic-manager ((this traffic-manager)) (let ((s5-0 0)) (while (< (the-as uint s5-0) (the-as uint 21)) - (let ((s4-0 (-> obj traffic-engine object-type-info-array s5-0))) + (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) (countdown (s3-0 (-> s4-0 inactive-count)) (let ((a0-6 (handle->process (get-from-inactive-by-type - (-> obj traffic-engine tracker-array (-> s4-0 tracker-index)) + (-> this traffic-engine tracker-array (-> s4-0 tracker-index)) (the-as traffic-type s5-0) ) ) @@ -129,14 +129,14 @@ (none) ) -(defmethod spawn-all traffic-manager ((obj traffic-manager)) +(defmethod spawn-all traffic-manager ((this traffic-manager)) ;; rewritten to remove asm branches ;; (let ((s5-0 0)) ;; (b! #t cfg-4 :delay (nop!)) ;; (label cfg-1) - ;; (let ((s4-0 (-> obj traffic-engine object-type-info-array s5-0))) + ;; (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) ;; (logclear! (-> s4-0 flags) (traffic-type-flags trtflags-3)) ;; (if (= (level-status *level* (-> s4-0 level)) 'active) ;; (logior! (-> s4-0 flags) (traffic-type-flags trtflags-3)) @@ -147,7 +147,7 @@ ;; (b! (< s5-0 21) cfg-1) ;; ) (dotimes (i 21) - (let ((s4-0 (-> obj traffic-engine object-type-info-array i))) + (let ((s4-0 (-> this traffic-engine object-type-info-array i))) (logclear! (-> s4-0 flags) (traffic-type-flags trtflags-3)) (if (= (level-status *level* (-> s4-0 level)) 'active) (logior! (-> s4-0 flags) (traffic-type-flags trtflags-3)) @@ -158,16 +158,16 @@ ;; (spawned-nb 0) ;; (spawn-mask #x1fffff) ;; ) - ;; (if (-> obj fast-spawn) + ;; (if (-> this fast-spawn) ;; (set! max-to-spawn 120) ;; ) ;; (b! #t cfg-36 :delay (nop!)) ;; (label cfg-8) - ;; (let* ((spawn-params (-> obj spawn-params)) + ;; (let* ((spawn-params (-> this spawn-params)) ;; (spawn-type (-> spawn-params object-type)) ;; ) ;; (when (logtest? spawn-mask (ash 1 spawn-type)) - ;; (let ((s0-0 (-> obj traffic-engine object-type-info-array spawn-type))) + ;; (let ((s0-0 (-> this traffic-engine object-type-info-array spawn-type))) ;; (let ((v1-21 (+ (-> s0-0 active-count) (-> s0-0 inactive-count)))) ;; (b! ;; (not (and (logtest? (-> s0-0 flags) (traffic-type-flags trtflags-1)) @@ -181,8 +181,8 @@ ;; (set! (-> spawn-params flags) (logand -9 (-> spawn-params flags))) ;; (b! ;; (not (and (= (-> spawn-params object-type) (traffic-type crimson-guard-1)) - ;; (> (-> obj dark-guard-ratio) 0) - ;; (zero? (mod v1-21 (-> obj dark-guard-ratio))) + ;; (> (-> this dark-guard-ratio) 0) + ;; (zero? (mod v1-21 (-> this dark-guard-ratio))) ;; ) ;; ) ;; cfg-25 @@ -191,9 +191,9 @@ ;; ) ;; (logior! (-> spawn-params flags) 8) ;; (label cfg-25) - ;; (let ((traffic-obj (traffic-object-spawn obj spawn-params))) + ;; (let ((traffic-obj (traffic-object-spawn this spawn-params))) ;; (b! (not traffic-obj) cfg-27 :delay (nop!)) - ;; (add-object (-> obj traffic-engine) spawn-type traffic-obj) + ;; (add-object (-> this traffic-engine) spawn-type traffic-obj) ;; ) ;; (+! (-> s0-0 reserve-count) -1) ;; ) @@ -220,20 +220,20 @@ ;; (b! (and (< spawned-nb max-to-spawn) (nonzero? spawn-mask)) cfg-8 :delay (nop!)) ;; ) ;; (label cfg-41) - ;; (set! (-> obj fast-spawn) #f) + ;; (set! (-> this fast-spawn) #f) (let ((max-to-spawn 1) (spawned-nb 0) (spawn-mask #x1fffff) ) - (if (-> obj fast-spawn) + (if (-> this fast-spawn) (set! max-to-spawn 120) ) (while (and (< spawned-nb max-to-spawn) (nonzero? spawn-mask)) - (let* ((spawn-params (-> obj spawn-params)) + (let* ((spawn-params (-> this spawn-params)) (spawn-type (-> spawn-params object-type)) ) (when (logtest? spawn-mask (ash 1 spawn-type)) - (let ((s0-0 (-> obj traffic-engine object-type-info-array spawn-type))) + (let ((s0-0 (-> this traffic-engine object-type-info-array spawn-type))) (let ((v1-21 (+ (-> s0-0 active-count) (-> s0-0 inactive-count)))) (cond ((and (logtest? (-> s0-0 flags) (traffic-type-flags trtflags-1)) @@ -241,13 +241,13 @@ (< v1-21 (-> s0-0 want-count))) (logclear! (-> spawn-params flags) (traffic-spawn-flags dark-guard)) (when (and (= (-> spawn-params object-type) (traffic-type crimson-guard-1)) - (> (-> obj dark-guard-ratio) 0) - (zero? (mod v1-21 (-> obj dark-guard-ratio)))) + (> (-> this dark-guard-ratio) 0) + (zero? (mod v1-21 (-> this dark-guard-ratio)))) (logior! (-> spawn-params flags) (traffic-spawn-flags dark-guard))) - (let ((traffic-obj (traffic-object-spawn obj spawn-params))) + (let ((traffic-obj (traffic-object-spawn this spawn-params))) (cond (traffic-obj - (add-object (-> obj traffic-engine) spawn-type traffic-obj) + (add-object (-> this traffic-engine) spawn-type traffic-obj) (+! (-> s0-0 reserve-count) -1) (+! (-> spawn-params id) 1) (+! spawned-nb 1) @@ -273,7 +273,7 @@ ) ) (label cfg-41) - (set! (-> obj fast-spawn) #f) + (set! (-> this fast-spawn) #f) 0 0 (none) @@ -424,34 +424,34 @@ ) ) -(defmethod reset-and-init traffic-manager ((obj traffic-manager)) - (set! (-> obj traffic-engine) *traffic-engine*) - (reset-and-init-from-manager (-> obj traffic-engine) obj) +(defmethod reset-and-init traffic-manager ((this traffic-manager)) + (set! (-> this traffic-engine) *traffic-engine*) + (reset-and-init-from-manager (-> this traffic-engine) this) (restore-city-speeches) 0 (none) ) ;; WARN: Return type mismatch process vs traffic-manager. -(defmethod relocate traffic-manager ((obj traffic-manager) (arg0 int)) - (set! *traffic-manager* obj) +(defmethod relocate traffic-manager ((this traffic-manager) (arg0 int)) + (set! *traffic-manager* this) (if *traffic-manager* (set! *traffic-manager* (&+ *traffic-manager* arg0)) ) - (the-as traffic-manager ((method-of-type process relocate) obj arg0)) + (the-as traffic-manager ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate traffic-manager ((obj traffic-manager)) - (stop-alarm-sound (-> obj traffic-engine)) +(defmethod deactivate traffic-manager ((this traffic-manager)) + (stop-alarm-sound (-> this traffic-engine)) (set! *traffic-manager* #f) - (remove-setting *setting-control* obj 'task-mask) + (remove-setting *setting-control* this 'task-mask) (apply-settings *setting-control*) (speech-control-method-9 *speech-control*) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) -(defmethod init-params traffic-manager ((obj traffic-manager)) +(defmethod init-params traffic-manager ((this traffic-manager)) (let ((traffic-want-counts (new 'stack-no-clear 'array 'int8 21))) (set! (-> traffic-want-counts 11) 8) (set! (-> traffic-want-counts 12) 8) @@ -472,15 +472,15 @@ (set! (-> traffic-want-counts 8) 14) (set! (-> traffic-want-counts 9) 14) (set! (-> traffic-want-counts 10) 14) - (set! (-> obj fast-spawn) *traffic-fast-spawn*) - (reset-and-init obj) - (let ((v1-20 (-> obj traffic-engine))) + (set! (-> this fast-spawn) *traffic-fast-spawn*) + (reset-and-init this) + (let ((v1-20 (-> this traffic-engine))) (dotimes (a0-2 21) (set! (-> v1-20 object-type-info-array a0-2 want-count) (-> traffic-want-counts a0-2)) ) ) ) - (let ((params (-> obj spawn-params))) + (let ((params (-> this spawn-params))) (set! (-> params object-type) (traffic-type crimson-guard-1)) (set! (-> params behavior) (the-as uint 1)) (set! (-> params id) (the-as uint 0)) @@ -500,13 +500,13 @@ ) (set! (-> params id) (the-as uint 1)) ) - (set! (-> obj dark-guard-ratio) (if (task-node-closed? (game-task-node tomb-boss-resolution)) + (set! (-> this dark-guard-ratio) (if (task-node-closed? (game-task-node tomb-boss-resolution)) 5 0 ) ) - (restore-default-settings (-> obj traffic-engine)) - (set! *traffic-manager* obj) + (restore-default-settings (-> this traffic-engine)) + (set! *traffic-manager* this) 0 (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc index d0f9db04d4..3e32a5fff7 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/bike.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/bike.gc @@ -919,18 +919,18 @@ ) -(defmethod do-engine-sounds bike-base ((obj bike-base)) - ((the-as (function object none) (find-parent-method bike-base 36)) obj) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (if (zero? (-> obj roll-sound-id)) - (set! (-> obj roll-sound-id) (new-sound-id)) +(defmethod do-engine-sounds bike-base ((this bike-base)) + ((the-as (function object none) (find-parent-method bike-base 36)) 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)) ) (let* ((f0-4 (* 4.0 - (-> obj force-scale) - (-> obj sputter-sound-envelope) - (-> obj info inv-max-engine-thrust) - (+ (-> obj roll-thrust 0) (-> obj roll-thrust 1)) + (-> this force-scale) + (-> this sputter-sound-envelope) + (-> this info inv-max-engine-thrust) + (+ (-> this roll-thrust 0) (-> this roll-thrust 1)) ) ) (f1-6 (* 0.32 f0-4)) @@ -938,7 +938,7 @@ ) (sound-play-by-name (static-sound-name "bike-thrust") - (-> obj roll-sound-id) + (-> this roll-sound-id) (the int (* 1024.0 f1-6)) (the int (* 1524.0 f0-5)) 0 @@ -951,12 +951,12 @@ (none) ) -(defmethod draw-thrusters bike-base ((obj bike-base)) - ((the-as (function object none) (find-parent-method bike-base 85)) obj) - (when (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) +(defmethod draw-thrusters bike-base ((this bike-base)) + ((the-as (function object none) (find-parent-method bike-base 85)) 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))) - (a3-0 (-> obj node-list data 0 bone transform)) + (a3-0 (-> this node-list data 0 bone transform)) (a0-5 (-> a3-0 quad 0)) (a1-1 (-> a3-0 quad 1)) (a2-0 (-> a3-0 quad 2)) @@ -981,23 +981,23 @@ ) ) (dotimes (s2-0 2) - (when (< 0.0 (-> obj roll-thrust s2-0)) + (when (< 0.0 (-> this roll-thrust s2-0)) (vector-rotate*! (-> s5-0 0 vector 1) (-> s3-0 s2-0) (the-as matrix (-> s5-0 0 vector 2))) (vector-matrix*! (the-as vector (-> s5-0 0)) (-> s4-0 s2-0) (the-as matrix (-> s5-0 0 vector 2))) - (let* ((a0-11 obj) + (let* ((a0-11 this) (t9-5 (method-of-object a0-11 draw-thruster)) (a1-5 (-> s5-0 0)) (a2-4 (-> s5-0 0 vector 1)) (a3-2 1638.4) (f0-5 12288.0) - (f1-1 (-> obj info extra gravity)) + (f1-1 (-> this info extra gravity)) ) (t9-5 a0-11 (the-as vector a1-5) a2-4 a3-2 - (* f0-5 (/ 1.0 f1-1) (-> obj info info inv-mass) (-> obj force-scale) (-> obj roll-thrust s2-0)) + (* f0-5 (/ 1.0 f1-1) (-> this info info inv-mass) (-> this force-scale) (-> this roll-thrust s2-0)) ) ) ) @@ -1025,33 +1025,33 @@ ) -(defmethod relocate bikea ((obj bikea) (arg0 int)) - (if (nonzero? (-> obj fin-fl)) - (&+! (-> obj fin-fl) arg0) +(defmethod relocate bikea ((this bikea) (arg0 int)) + (if (nonzero? (-> this fin-fl)) + (&+! (-> this fin-fl) arg0) ) - (if (nonzero? (-> obj fin-fr)) - (&+! (-> obj fin-fr) arg0) + (if (nonzero? (-> this fin-fr)) + (&+! (-> this fin-fr) arg0) ) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - (if (nonzero? (-> obj rudder)) - (&+! (-> obj rudder) arg0) + (if (nonzero? (-> this rudder)) + (&+! (-> this rudder) arg0) ) - (if (nonzero? (-> obj brake-l)) - (&+! (-> obj brake-l) arg0) + (if (nonzero? (-> this brake-l)) + (&+! (-> this brake-l) arg0) ) - (if (nonzero? (-> obj brake-r)) - (&+! (-> obj brake-r) arg0) + (if (nonzero? (-> this brake-r)) + (&+! (-> this brake-r) arg0) ) - ((the-as (function object int bikea) (find-parent-method bikea 7)) obj arg0) + ((the-as (function object int bikea) (find-parent-method bikea 7)) this arg0) ) -(defmethod allocate-and-init-cshape bikea ((obj bikea)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape bikea ((this bikea)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1097,44 +1097,44 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod update-joint-mods bikea ((obj bikea)) - (let ((f30-0 (* 5461.3335 (-> obj controls steering))) - (f26-0 (* -5461.3335 (-> obj controls lean-z))) - (f28-0 (* -13653.333 (-> obj controls brake))) +(defmethod update-joint-mods bikea ((this bikea)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f26-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* -13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin-fl rotation) s5-0 (- (* -0.2 f26-0) f30-0)) - (quaternion-vector-angle! (-> obj fin-fr rotation) s5-0 (- (* 0.2 f26-0) f30-0)) - (quaternion-vector-angle! (-> obj rudder rotation) s5-0 f30-0) - (quaternion-vector-angle! (-> obj brake-l rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj brake-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (* -0.2 f26-0) f30-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (* 0.2 f26-0) f30-0)) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) ) 0 (none) ) -(defmethod init-skel-and-rigid-body bikea ((obj bikea)) +(defmethod init-skel-and-rigid-body bikea ((this bikea)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *bikea-constants*) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj brake-l) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj brake-r) (new 'process 'joint-mod-rotate-local obj 10 #t)) + (alloc-and-init-rigid-body-control this *bikea-constants*) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 10 #t)) 0 (none) ) @@ -1156,36 +1156,36 @@ ) -(defmethod relocate bikeb ((obj bikeb) (arg0 int)) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) +(defmethod relocate bikeb ((this bikeb) (arg0 int)) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - (if (nonzero? (-> obj rudder)) - (&+! (-> obj rudder) arg0) + (if (nonzero? (-> this rudder)) + (&+! (-> this rudder) arg0) ) - (if (nonzero? (-> obj rudder-f)) - (&+! (-> obj rudder-f) arg0) + (if (nonzero? (-> this rudder-f)) + (&+! (-> this rudder-f) arg0) ) - (if (nonzero? (-> obj brake-l)) - (&+! (-> obj brake-l) arg0) + (if (nonzero? (-> this brake-l)) + (&+! (-> this brake-l) arg0) ) - (if (nonzero? (-> obj brake-r)) - (&+! (-> obj brake-r) arg0) + (if (nonzero? (-> this brake-r)) + (&+! (-> this brake-r) arg0) ) - (if (nonzero? (-> obj flap-l)) - (&+! (-> obj flap-l) arg0) + (if (nonzero? (-> this flap-l)) + (&+! (-> this flap-l) arg0) ) - (if (nonzero? (-> obj flap-r)) - (&+! (-> obj flap-r) arg0) + (if (nonzero? (-> this flap-r)) + (&+! (-> this flap-r) arg0) ) - ((the-as (function object int bikeb) (find-parent-method bikeb 7)) obj arg0) + ((the-as (function object int bikeb) (find-parent-method bikeb 7)) this arg0) ) -(defmethod allocate-and-init-cshape bikeb ((obj bikeb)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape bikeb ((this bikeb)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1231,46 +1231,46 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod update-joint-mods bikeb ((obj bikeb)) - (let ((f30-0 (* 5461.3335 (-> obj controls steering))) - (f26-0 (* -5461.3335 (-> obj controls lean-z))) - (f28-0 (* 13653.333 (-> obj controls brake))) +(defmethod update-joint-mods bikeb ((this bikeb)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f26-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj rudder rotation) s5-0 f30-0) - (quaternion-vector-angle! (-> obj rudder-f rotation) s5-0 (- f30-0)) - (quaternion-vector-angle! (-> obj brake-l rotation) s5-0 (- f28-0)) - (quaternion-vector-angle! (-> obj brake-r rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj flap-l rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj flap-r rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this rudder-f rotation) s5-0 (- f30-0)) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this flap-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this flap-r rotation) s5-0 (- f28-0)) ) 0 (none) ) -(defmethod init-skel-and-rigid-body bikeb ((obj bikeb)) +(defmethod init-skel-and-rigid-body bikeb ((this bikeb)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikeb" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *bikeb-constants*) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj rudder-f) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj brake-l) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj brake-r) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj flap-l) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj flap-r) (new 'process 'joint-mod-rotate-local obj 11 #t)) + (alloc-and-init-rigid-body-control this *bikeb-constants*) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this rudder-f) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this flap-l) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this flap-r) (new 'process 'joint-mod-rotate-local this 11 #t)) 0 (none) ) @@ -1295,45 +1295,45 @@ ) -(defmethod relocate bikec ((obj bikec) (arg0 int)) - (if (nonzero? (-> obj fin-fl)) - (&+! (-> obj fin-fl) arg0) +(defmethod relocate bikec ((this bikec) (arg0 int)) + (if (nonzero? (-> this fin-fl)) + (&+! (-> this fin-fl) arg0) ) - (if (nonzero? (-> obj fin-fr)) - (&+! (-> obj fin-fr) arg0) + (if (nonzero? (-> this fin-fr)) + (&+! (-> this fin-fr) arg0) ) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - (if (nonzero? (-> obj fin2-fl)) - (&+! (-> obj fin2-fl) arg0) + (if (nonzero? (-> this fin2-fl)) + (&+! (-> this fin2-fl) arg0) ) - (if (nonzero? (-> obj fin2-fr)) - (&+! (-> obj fin2-fr) arg0) + (if (nonzero? (-> this fin2-fr)) + (&+! (-> this fin2-fr) arg0) ) - (if (nonzero? (-> obj rudder)) - (&+! (-> obj rudder) arg0) + (if (nonzero? (-> this rudder)) + (&+! (-> this rudder) arg0) ) - (if (nonzero? (-> obj brake-l)) - (&+! (-> obj brake-l) arg0) + (if (nonzero? (-> this brake-l)) + (&+! (-> this brake-l) arg0) ) - (if (nonzero? (-> obj brake-r)) - (&+! (-> obj brake-r) arg0) + (if (nonzero? (-> this brake-r)) + (&+! (-> this brake-r) arg0) ) - (if (nonzero? (-> obj spoiler-l)) - (&+! (-> obj spoiler-l) arg0) + (if (nonzero? (-> this spoiler-l)) + (&+! (-> this spoiler-l) arg0) ) - (if (nonzero? (-> obj spoiler-r)) - (&+! (-> obj spoiler-r) arg0) + (if (nonzero? (-> this spoiler-r)) + (&+! (-> this spoiler-r) arg0) ) - ((the-as (function object int bikec) (find-parent-method bikec 7)) obj arg0) + ((the-as (function object int bikec) (find-parent-method bikec 7)) this arg0) ) -(defmethod allocate-and-init-cshape bikec ((obj bikec)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape bikec ((this bikec)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1379,52 +1379,52 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod update-joint-mods bikec ((obj bikec)) - (let ((f30-0 (* 5461.3335 (-> obj controls steering))) - (f26-0 (* -5461.3335 (-> obj controls lean-z))) - (f28-0 (* 13653.333 (-> obj controls brake))) +(defmethod update-joint-mods bikec ((this bikec)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f26-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj fin-fl rotation) s5-0 (- f26-0)) - (quaternion-vector-angle! (-> obj fin-fr rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> obj fin2-fl rotation) s5-0 (- f26-0)) - (quaternion-vector-angle! (-> obj fin2-fr rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> obj fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj rudder rotation) s5-0 f30-0) - (quaternion-vector-angle! (-> obj brake-l rotation) s5-0 (- f28-0)) - (quaternion-vector-angle! (-> obj brake-r rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj spoiler-l rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj spoiler-r rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin2-fl rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this fin2-fr rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this spoiler-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this spoiler-r rotation) s5-0 (- f28-0)) ) 0 (none) ) -(defmethod init-skel-and-rigid-body bikec ((obj bikec)) +(defmethod init-skel-and-rigid-body bikec ((this bikec)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikec" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *bikec-constants*) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj fin2-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin2-fr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj brake-l) (new 'process 'joint-mod-rotate-local obj 11 #t)) - (set! (-> obj brake-r) (new 'process 'joint-mod-rotate-local obj 12 #t)) - (set! (-> obj spoiler-l) (new 'process 'joint-mod-rotate-local obj 13 #t)) - (set! (-> obj spoiler-r) (new 'process 'joint-mod-rotate-local obj 14 #t)) + (alloc-and-init-rigid-body-control this *bikec-constants*) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this fin2-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin2-fr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 11 #t)) + (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 12 #t)) + (set! (-> this spoiler-l) (new 'process 'joint-mod-rotate-local this 13 #t)) + (set! (-> this spoiler-r) (new 'process 'joint-mod-rotate-local this 14 #t)) 0 (none) ) @@ -1460,25 +1460,25 @@ ) -(defmethod relocate guard-bike ((obj guard-bike) (arg0 int)) - (if (nonzero? (-> obj turret-jm)) - (&+! (-> obj turret-jm) arg0) +(defmethod relocate guard-bike ((this guard-bike) (arg0 int)) + (if (nonzero? (-> this turret-jm)) + (&+! (-> this turret-jm) arg0) ) - ((the-as (function object int guard-bike) (find-parent-method guard-bike 7)) obj arg0) + ((the-as (function object int guard-bike) (find-parent-method guard-bike 7)) this arg0) ) -(defmethod start-jump guard-bike ((obj guard-bike)) - (when (not (logtest? (rigid-body-object-flag jump-sound) (-> obj flags))) - (logior! (-> obj flags) (rigid-body-object-flag jump-sound)) +(defmethod start-jump guard-bike ((this guard-bike)) + (when (not (logtest? (rigid-body-object-flag jump-sound) (-> this flags))) + (logior! (-> this flags) (rigid-body-object-flag jump-sound)) (sound-play "bike-hop") ) - (logior! (-> obj flags) (rigid-body-object-flag jump)) + (logior! (-> this flags) (rigid-body-object-flag jump)) 0 (none) ) -(defmethod allocate-and-init-cshape guard-bike ((obj guard-bike)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape guard-bike ((this guard-bike)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1524,27 +1524,27 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod update-joint-mods guard-bike ((obj guard-bike)) - (update-joint-mod (-> obj turret) (-> obj turret-jm)) +(defmethod update-joint-mods guard-bike ((this guard-bike)) + (update-joint-mod (-> this turret) (-> this turret-jm)) 0 (none) ) -(defmethod init-skel-and-rigid-body guard-bike ((obj guard-bike)) +(defmethod init-skel-and-rigid-body guard-bike ((this guard-bike)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-guard-bike" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *guard-bike-constants*) - (set-info (-> obj turret) *guard-bike-turret-control-info*) - (set! (-> obj turret-jm) (new 'process 'joint-mod-rotate-local obj (-> obj turret info joint-index) #t)) + (alloc-and-init-rigid-body-control this *guard-bike-constants*) + (set-info (-> this turret) *guard-bike-turret-control-info*) + (set! (-> this turret-jm) (new 'process 'joint-mod-rotate-local this (-> this turret info joint-index) #t)) 0 (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/car.gc b/goal_src/jak2/levels/city/traffic/vehicle/car.gc index a8998a1663..fc52f261f4 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/car.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/car.gc @@ -1114,11 +1114,11 @@ ) -(defmethod vehicle-method-117 car-base ((obj car-base) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 car-base ((this car-base) (arg0 vector) (arg1 int) (arg2 int)) (vector-matrix*! arg0 - (-> obj info rider-hand-offset arg2) - (-> obj node-list data (-> obj rider-hand-joint-array arg1) bone transform) + (-> this info rider-hand-offset arg2) + (-> this node-list data (-> this rider-hand-joint-array arg1) bone transform) ) 0 (none) @@ -1142,39 +1142,39 @@ ) -(defmethod relocate cara ((obj cara) (arg0 int)) - (if (nonzero? (-> obj steering-wheel-l)) - (&+! (-> obj steering-wheel-l) arg0) +(defmethod relocate cara ((this cara) (arg0 int)) + (if (nonzero? (-> this steering-wheel-l)) + (&+! (-> this steering-wheel-l) arg0) ) - (if (nonzero? (-> obj steering-wheel-r)) - (&+! (-> obj steering-wheel-r) arg0) + (if (nonzero? (-> this steering-wheel-r)) + (&+! (-> this steering-wheel-r) arg0) ) - (if (nonzero? (-> obj fin-fl)) - (&+! (-> obj fin-fl) arg0) + (if (nonzero? (-> this fin-fl)) + (&+! (-> this fin-fl) arg0) ) - (if (nonzero? (-> obj fin-fr)) - (&+! (-> obj fin-fr) arg0) + (if (nonzero? (-> this fin-fr)) + (&+! (-> this fin-fr) arg0) ) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - (if (nonzero? (-> obj rudder)) - (&+! (-> obj rudder) arg0) + (if (nonzero? (-> this rudder)) + (&+! (-> this rudder) arg0) ) - (if (nonzero? (-> obj rudder-l)) - (&+! (-> obj rudder-l) arg0) + (if (nonzero? (-> this rudder-l)) + (&+! (-> this rudder-l) arg0) ) - (if (nonzero? (-> obj rudder-r)) - (&+! (-> obj rudder-r) arg0) + (if (nonzero? (-> this rudder-r)) + (&+! (-> this rudder-r) arg0) ) - ((the-as (function object object cara) (find-parent-method cara 7)) obj arg0) + ((the-as (function object object cara) (find-parent-method cara 7)) this arg0) ) -(defmethod allocate-and-init-cshape cara ((obj cara)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape cara ((this cara)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1230,48 +1230,48 @@ (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod update-joint-mods cara ((obj cara)) - (let ((f30-0 (* 3640.889 (-> obj controls steering))) - (f26-0 (* 9102.223 (-> obj controls steering))) - (f28-0 (* -3640.889 (-> obj controls lean-z))) +(defmethod update-joint-mods cara ((this cara)) + (let ((f30-0 (* 3640.889 (-> this controls steering))) + (f26-0 (* 9102.223 (-> this controls steering))) + (f28-0 (* -3640.889 (-> this controls lean-z))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj steering-wheel-l rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> obj steering-wheel-r rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> obj fin-fl rotation) s5-0 (- f28-0)) - (quaternion-vector-angle! (-> obj fin-fr rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj fin-rl rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj fin-rr rotation) s5-0 (- f28-0)) - (quaternion-vector-angle! (-> obj rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this steering-wheel-l rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this steering-wheel-r rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) ) 0 (none) ) -(defmethod init-skel-and-rigid-body cara ((obj cara)) +(defmethod init-skel-and-rigid-body cara ((this cara)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cara" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *cara-constants*) - (set! (-> obj rider-hand-joint-array 0) 11) - (set! (-> obj rider-hand-joint-array 1) 12) - (set! (-> obj steering-wheel-l) (new 'process 'joint-mod-rotate-local obj 11 #t)) - (set! (-> obj steering-wheel-r) (new 'process 'joint-mod-rotate-local obj 12 #t)) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj rudder-l) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj rudder-r) (new 'process 'joint-mod-rotate-local obj 9 #t)) + (alloc-and-init-rigid-body-control this *cara-constants*) + (set! (-> this rider-hand-joint-array 0) 11) + (set! (-> this rider-hand-joint-array 1) 12) + (set! (-> this steering-wheel-l) (new 'process 'joint-mod-rotate-local this 11 #t)) + (set! (-> this steering-wheel-r) (new 'process 'joint-mod-rotate-local this 12 #t)) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this rudder-l) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this rudder-r) (new 'process 'joint-mod-rotate-local this 9 #t)) 0 (none) ) @@ -1291,30 +1291,30 @@ ) -(defmethod relocate carb ((obj carb) (arg0 int)) - (if (nonzero? (-> obj steering-wheel-l)) - (&+! (-> obj steering-wheel-l) arg0) +(defmethod relocate carb ((this carb) (arg0 int)) + (if (nonzero? (-> this steering-wheel-l)) + (&+! (-> this steering-wheel-l) arg0) ) - (if (nonzero? (-> obj steering-wheel-r)) - (&+! (-> obj steering-wheel-r) arg0) + (if (nonzero? (-> this steering-wheel-r)) + (&+! (-> this steering-wheel-r) arg0) ) - (if (nonzero? (-> obj fin-fl)) - (&+! (-> obj fin-fl) arg0) + (if (nonzero? (-> this fin-fl)) + (&+! (-> this fin-fl) arg0) ) - (if (nonzero? (-> obj fin-fr)) - (&+! (-> obj fin-fr) arg0) + (if (nonzero? (-> this fin-fr)) + (&+! (-> this fin-fr) arg0) ) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - ((the-as (function object object carb) (find-parent-method carb 7)) obj arg0) + ((the-as (function object object carb) (find-parent-method carb 7)) this arg0) ) -(defmethod allocate-and-init-cshape carb ((obj carb)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape carb ((this carb)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1370,43 +1370,43 @@ (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod update-joint-mods carb ((obj carb)) - (let ((f30-0 (* -5461.3335 (-> obj controls lean-z))) - (f28-0 (* 9102.223 (-> obj controls steering))) +(defmethod update-joint-mods carb ((this carb)) + (let ((f30-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 9102.223 (-> this controls steering))) (gp-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj steering-wheel-l rotation) gp-0 f28-0) - (quaternion-vector-angle! (-> obj steering-wheel-r rotation) gp-0 f28-0) - (quaternion-vector-angle! (-> obj fin-fl rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) - (quaternion-vector-angle! (-> obj fin-fr rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) - (quaternion-vector-angle! (-> obj fin-rl rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) - (quaternion-vector-angle! (-> obj fin-rr rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this steering-wheel-l rotation) gp-0 f28-0) + (quaternion-vector-angle! (-> this steering-wheel-r rotation) gp-0 f28-0) + (quaternion-vector-angle! (-> this fin-fl rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-fr rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) ) 0 (none) ) -(defmethod init-skel-and-rigid-body carb ((obj carb)) +(defmethod init-skel-and-rigid-body carb ((this carb)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-carb" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *carb-constants*) - (set! (-> obj rider-hand-joint-array 0) 8) - (set! (-> obj rider-hand-joint-array 1) 9) - (set! (-> obj steering-wheel-l) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj steering-wheel-r) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 7 #t)) + (alloc-and-init-rigid-body-control this *carb-constants*) + (set! (-> this rider-hand-joint-array 0) 8) + (set! (-> this rider-hand-joint-array 1) 9) + (set! (-> this steering-wheel-l) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this steering-wheel-r) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 7 #t)) 0 (none) ) @@ -1428,33 +1428,33 @@ ;; WARN: Return type mismatch carb vs carc. -(defmethod relocate carc ((obj carc) (arg0 int)) - (if (nonzero? (-> obj steering-wheel)) - (&+! (-> obj steering-wheel) arg0) +(defmethod relocate carc ((this carc) (arg0 int)) + (if (nonzero? (-> this steering-wheel)) + (&+! (-> this steering-wheel) arg0) ) - (if (nonzero? (-> obj fin-fl)) - (&+! (-> obj fin-fl) arg0) + (if (nonzero? (-> this fin-fl)) + (&+! (-> this fin-fl) arg0) ) - (if (nonzero? (-> obj fin-fr)) - (&+! (-> obj fin-fr) arg0) + (if (nonzero? (-> this fin-fr)) + (&+! (-> this fin-fr) arg0) ) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - (if (nonzero? (-> obj fin2-rl)) - (&+! (-> obj fin2-rl) arg0) + (if (nonzero? (-> this fin2-rl)) + (&+! (-> this fin2-rl) arg0) ) - (if (nonzero? (-> obj fin2-rr)) - (&+! (-> obj fin2-rr) arg0) + (if (nonzero? (-> this fin2-rr)) + (&+! (-> this fin2-rr) arg0) ) - (the-as carc ((the-as (function object object carb) (find-parent-method carc 7)) obj arg0)) + (the-as carc ((the-as (function object object carb) (find-parent-method carc 7)) this arg0)) ) -(defmethod allocate-and-init-cshape carc ((obj carc)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape carc ((this carc)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1505,45 +1505,45 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod update-joint-mods carc ((obj carc)) - (let ((f30-0 (* -5461.3335 (-> obj controls steering))) - (f28-0 (* -5461.3335 (-> obj controls lean-z))) - (f0-3 (* 9102.223 (-> obj controls steering))) +(defmethod update-joint-mods carc ((this carc)) + (let ((f30-0 (* -5461.3335 (-> this controls steering))) + (f28-0 (* -5461.3335 (-> this controls lean-z))) + (f0-3 (* 9102.223 (-> this controls steering))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj steering-wheel rotation) s5-0 f0-3) - (quaternion-vector-angle! (-> obj fin-fl rotation) s5-0 (- f28-0)) - (quaternion-vector-angle! (-> obj fin-fr rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) - (quaternion-vector-angle! (-> obj fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this steering-wheel rotation) s5-0 f0-3) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) + (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) ) 0 (none) ) -(defmethod init-skel-and-rigid-body carc ((obj carc)) +(defmethod init-skel-and-rigid-body carc ((this carc)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-carc" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *carc-constants*) - (set! (-> obj rider-hand-joint-array 0) 10) - (set! (-> obj steering-wheel) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj fin2-rl) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin2-rr) (new 'process 'joint-mod-rotate-local obj 7 #t)) + (alloc-and-init-rigid-body-control this *carc-constants*) + (set! (-> this rider-hand-joint-array 0) 10) + (set! (-> this steering-wheel) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this fin2-rl) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin2-rr) (new 'process 'joint-mod-rotate-local this 7 #t)) 0 (none) ) @@ -1579,15 +1579,15 @@ ) -(defmethod relocate hellcat ((obj hellcat) (arg0 int)) - (if (nonzero? (-> obj turret-jm)) - (&+! (-> obj turret-jm) arg0) +(defmethod relocate hellcat ((this hellcat) (arg0 int)) + (if (nonzero? (-> this turret-jm)) + (&+! (-> this turret-jm) arg0) ) - ((the-as (function object object hellcat) (find-parent-method hellcat 7)) obj arg0) + ((the-as (function object object hellcat) (find-parent-method hellcat 7)) this arg0) ) -(defmethod allocate-and-init-cshape hellcat ((obj hellcat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape hellcat ((this hellcat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1642,27 +1642,27 @@ (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod update-joint-mods hellcat ((obj hellcat)) - (update-joint-mod (-> obj turret) (-> obj turret-jm)) +(defmethod update-joint-mods hellcat ((this hellcat)) + (update-joint-mod (-> this turret) (-> this turret-jm)) 0 (none) ) -(defmethod init-skel-and-rigid-body hellcat ((obj hellcat)) +(defmethod init-skel-and-rigid-body hellcat ((this hellcat)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hellcat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *hellcat-constants*) - (set-info (-> obj turret) *hellcat-front-turret-control-info*) - (set! (-> obj turret-jm) (new 'process 'joint-mod-rotate-local obj (-> obj turret info joint-index) #t)) + (alloc-and-init-rigid-body-control this *hellcat-constants*) + (set-info (-> this turret) *hellcat-front-turret-control-info*) + (set! (-> this turret-jm) (new 'process 'joint-mod-rotate-local this (-> this turret info joint-index) #t)) 0 (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/test-bike.gc b/goal_src/jak2/levels/city/traffic/vehicle/test-bike.gc index c4657c31c3..bd5bb3230a 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/test-bike.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/test-bike.gc @@ -223,24 +223,24 @@ ) ) -(defmethod init-skel-and-rigid-body test-bike ((obj test-bike)) +(defmethod init-skel-and-rigid-body test-bike ((this test-bike)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikec" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *test-bike-constants*) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj fin2-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin2-fr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj brake-l) (new 'process 'joint-mod-rotate-local obj 11 #t)) - (set! (-> obj brake-r) (new 'process 'joint-mod-rotate-local obj 12 #t)) - (set! (-> obj spoiler-l) (new 'process 'joint-mod-rotate-local obj 13 #t)) - (set! (-> obj spoiler-r) (new 'process 'joint-mod-rotate-local obj 14 #t)) + (alloc-and-init-rigid-body-control this *test-bike-constants*) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this fin2-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin2-fr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 11 #t)) + (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 12 #t)) + (set! (-> this spoiler-l) (new 'process 'joint-mod-rotate-local this 13 #t)) + (set! (-> this spoiler-r) (new 'process 'joint-mod-rotate-local this 14 #t)) 0 (none) ) @@ -459,20 +459,20 @@ ) ) -(defmethod init-skel-and-rigid-body evan-test-bike ((obj evan-test-bike)) +(defmethod init-skel-and-rigid-body evan-test-bike ((this evan-test-bike)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *evan-test-bike-constants*) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj brake-l) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj brake-r) (new 'process 'joint-mod-rotate-local obj 10 #t)) + (alloc-and-init-rigid-body-control this *evan-test-bike-constants*) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 10 #t)) 0 (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/test-car.gc b/goal_src/jak2/levels/city/traffic/vehicle/test-car.gc index 4ef43e2dc2..603b35119f 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/test-car.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/test-car.gc @@ -267,24 +267,24 @@ ) ) -(defmethod init-skel-and-rigid-body test-car ((obj test-car)) +(defmethod init-skel-and-rigid-body test-car ((this test-car)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cara" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *test-car-constants*) - (set! (-> obj rider-hand-joint-array 0) 11) - (set! (-> obj rider-hand-joint-array 1) 12) - (set! (-> obj steering-wheel-l) (new 'process 'joint-mod-rotate-local obj 11 #t)) - (set! (-> obj steering-wheel-r) (new 'process 'joint-mod-rotate-local obj 12 #t)) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj rudder-l) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj rudder-r) (new 'process 'joint-mod-rotate-local obj 9 #t)) + (alloc-and-init-rigid-body-control this *test-car-constants*) + (set! (-> this rider-hand-joint-array 0) 11) + (set! (-> this rider-hand-joint-array 1) 12) + (set! (-> this steering-wheel-l) (new 'process 'joint-mod-rotate-local this 11 #t)) + (set! (-> this steering-wheel-r) (new 'process 'joint-mod-rotate-local this 12 #t)) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this rudder-l) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this rudder-r) (new 'process 'joint-mod-rotate-local this 9 #t)) 0 (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/transport.gc b/goal_src/jak2/levels/city/traffic/vehicle/transport.gc index 2c11654b81..2ce98bf2b5 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/transport.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/transport.gc @@ -44,8 +44,8 @@ ) -(defmethod vehicle-turret-method-29 vehicle-turret ((obj vehicle-turret)) - (let* ((s4-0 (ppointer->process (-> obj parent))) +(defmethod vehicle-turret-method-29 vehicle-turret ((this vehicle-turret)) + (let* ((s4-0 (ppointer->process (-> this parent))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) @@ -58,9 +58,9 @@ ) ) ) - (vector-matrix*! (-> obj root trans) (new 'static 'vector :y 8601.6 :z 12288.0 :w 1.0) a2-0) + (vector-matrix*! (-> this root trans) (new 'static 'vector :y 8601.6 :z 12288.0 :w 1.0) a2-0) ) - (quaternion-copy! (-> obj root quat) (-> (the-as process-drawable s5-0) root quat)) + (quaternion-copy! (-> this root quat) (-> (the-as process-drawable s5-0) root quat)) ) ) 0 @@ -89,8 +89,8 @@ :post transform-post ) -(defmethod vehicle-turret-method-28 vehicle-turret ((obj vehicle-turret)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod vehicle-turret-method-28 vehicle-turret ((this vehicle-turret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -111,26 +111,26 @@ (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-drawable vs vehicle-turret. -(defmethod relocate vehicle-turret ((obj vehicle-turret) (arg0 int)) - (if (nonzero? (-> obj turret-jm)) - (&+! (-> obj turret-jm) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method vehicle-turret 7)) this arg0) ) ) -(defmethod vehicle-turret-method-30 vehicle-turret ((obj vehicle-turret)) - (set! (-> obj turret-jm) - (the-as joint-mod (new 'process 'joint-mod-rotate-local obj (-> obj turret info joint-index) #t)) +(defmethod vehicle-turret-method-30 vehicle-turret ((this vehicle-turret)) + (set! (-> this turret-jm) + (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this turret info joint-index) #t)) ) 0 (none) @@ -252,26 +252,26 @@ ) ) -(defmethod run-logic? transport ((obj transport)) +(defmethod run-logic? transport ((this transport)) #t ) -(defmethod transport-method-35 transport ((obj transport)) - (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> obj root transv y)) 0.0 122880.0)) - (f0-4 (lerp-scale 0.0 1.0 (- (-> obj root trans y) (-> obj y-dest)) 143360.0 20480.0)) +(defmethod transport-method-35 transport ((this transport)) + (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> this root transv y)) 0.0 122880.0)) + (f0-4 (lerp-scale 0.0 1.0 (- (-> this root trans y) (-> this y-dest)) 143360.0 20480.0)) (a0-3 (static-sound-spec "transport" :volume 0.0 :mask (pitch reg0))) ) (set! (-> a0-3 volume) (the int (* 1024.0 f0-4))) (set! (-> a0-3 pitch-mod) (the int (* 1524.0 f30-0))) - (sound-play-by-spec a0-3 (-> obj ambient-sound-id) (-> obj root trans)) + (sound-play-by-spec a0-3 (-> this ambient-sound-id) (-> this root trans)) ) 0 (none) ) -(defmethod deactivate transport ((obj transport)) - (sound-stop (-> obj ambient-sound-id)) - ((the-as (function process-drawable none) (find-parent-method transport 10)) obj) +(defmethod deactivate transport ((this transport)) + (sound-stop (-> this ambient-sound-id)) + ((the-as (function process-drawable none) (find-parent-method transport 10)) this) (none) ) @@ -279,8 +279,8 @@ :virtual #t :event transport-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) - (set! (-> self last-guard-spawn-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-guard-spawn-time)) ) :code (behavior () (ja-channel-push! 1 0) @@ -307,7 +307,7 @@ :virtual #t :event transport-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root transv y) 0.0) (set! (-> self last-guard-spawn-time) 0) 0 @@ -376,7 +376,7 @@ :virtual #t :event transport-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root transv y) 0.0) ) :code (behavior () @@ -404,36 +404,36 @@ ) ) -(defmethod transport-method-33 transport ((obj transport)) - (when (>= (- (current-time) (-> obj last-guard-spawn-time)) 0) +(defmethod transport-method-33 transport ((this transport)) + (when (>= (- (current-time) (-> this last-guard-spawn-time)) 0) (let ((s5-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> s5-0 object-type) (traffic-type crimson-guard-1)) (set! (-> s5-0 behavior) (the-as uint 6)) (set! (-> s5-0 id) (the-as uint 0)) - (set! (-> s5-0 nav-mesh) (-> obj nav-mesh)) + (set! (-> s5-0 nav-mesh) (-> this nav-mesh)) (set! (-> s5-0 nav-branch) #f) (set! (-> s5-0 proc) #f) - (set! (-> s5-0 handle) (process->handle obj)) - (set! (-> s5-0 user-data) (-> obj spawn-side)) + (set! (-> s5-0 handle) (process->handle this)) + (set! (-> s5-0 user-data) (-> this spawn-side)) (set! (-> s5-0 flags) (traffic-spawn-flags)) (set! (-> s5-0 guard-type) (the-as uint 7)) (vector-reset! (-> s5-0 velocity)) - (set! (-> s5-0 position quad) (-> obj root trans quad)) + (set! (-> s5-0 position quad) (-> this root trans quad)) (+! (-> s5-0 position y) 8192.0) - (quaternion-rotate-local-y! (-> s5-0 rotation) (-> obj root quat) 32768.0) + (quaternion-rotate-local-y! (-> s5-0 rotation) (-> this root quat) 32768.0) (send-event *traffic-manager* 'activate-object s5-0) (when (-> s5-0 proc) - (set! (-> obj spawn-side) (- 1 (the-as int (-> obj spawn-side)))) - (if (logtest? (-> obj draw status) (draw-control-status on-screen)) - (set! (-> obj last-guard-spawn-time) (+ (current-time) (seconds 1))) - (set! (-> obj last-guard-spawn-time) (+ (current-time) (seconds 2))) + (set! (-> this spawn-side) (- 1 (the-as int (-> this spawn-side)))) + (if (logtest? (-> this draw status) (draw-control-status on-screen)) + (set! (-> this last-guard-spawn-time) (+ (current-time) (seconds 1))) + (set! (-> this last-guard-spawn-time) (+ (current-time) (seconds 2))) ) - (+! (-> obj count-guard) 1) + (+! (-> this count-guard) 1) ) (when (not (-> s5-0 proc)) - (if (logtest? (-> obj draw status) (draw-control-status on-screen)) - (set! (-> obj last-guard-spawn-time) (+ (current-time) (seconds 0.1))) - (set! (-> obj last-guard-spawn-time) (+ (current-time) (seconds 1))) + (if (logtest? (-> this draw status) (draw-control-status on-screen)) + (set! (-> this last-guard-spawn-time) (+ (current-time) (seconds 0.1))) + (set! (-> this last-guard-spawn-time) (+ (current-time) (seconds 1))) ) ) ) @@ -441,8 +441,8 @@ (none) ) -(defmethod transport-method-34 transport ((obj transport) (arg0 process)) - (let ((v1-1 (handle->process (-> obj turret)))) +(defmethod transport-method-34 transport ((this transport) (arg0 process)) + (let ((v1-1 (handle->process (-> this turret)))) (if v1-1 (set! (-> (the-as vehicle-turret v1-1) target) (process->handle arg0)) ) @@ -451,8 +451,8 @@ (none) ) -(defmethod transport-method-31 transport ((obj transport)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod transport-method-31 transport ((this transport)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -486,14 +486,14 @@ (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod transport-method-32 transport ((obj transport)) - (set! (-> obj spawn-side) (the-as uint 0)) +(defmethod transport-method-32 transport ((this transport)) + (set! (-> this spawn-side) (the-as uint 0)) 0 (none) ) @@ -530,22 +530,22 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! transport ((obj transport) (arg0 entity-actor)) +(defmethod init-from-entity! transport ((this transport) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (transport-method-31 obj) - (process-drawable-from-entity! obj arg0) + (transport-method-31 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-transport" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (transport-method-32 obj) - (set! (-> obj spawn?) #t) - (go (method-of-object obj come-down)) + (transport-method-32 this) + (set! (-> this spawn?) #t) + (go (method-of-object this come-down)) (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-control.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-control.gc index 179dfad2a7..867641b48f 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-control.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-control.gc @@ -9,9 +9,9 @@ (define *vehicle-control-debug-obj* (the-as object #f)) -(defmethod vehicle-controller-method-21 vehicle-controller ((obj vehicle-controller)) - (when (logtest? (-> obj flags) (vehicle-controller-flag attached)) - (let ((v1-3 (-> obj branch))) +(defmethod vehicle-controller-method-21 vehicle-controller ((this vehicle-controller)) + (when (logtest? (-> this flags) (vehicle-controller-flag attached)) + (let ((v1-3 (-> this branch))) (when (or (not v1-3) (zero? v1-3)) (break!) 0 @@ -36,7 +36,7 @@ (none) ) -(defmethod vehicle-controller-method-20 vehicle-controller ((obj vehicle-controller) (arg0 object) (arg1 float)) +(defmethod vehicle-controller-method-20 vehicle-controller ((this vehicle-controller) (arg0 object) (arg1 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -45,19 +45,19 @@ (vf7 :class vf) ) (init-vf0-vector) - (set! (-> obj max-turn-speed) (sqrtf (* (fmax 16384.0 arg1) (-> obj turn-accel)))) + (set! (-> this max-turn-speed) (sqrtf (* (fmax 16384.0 arg1) (-> this turn-accel)))) (let ((v1-1 (new 'stack-no-clear 'vehicle-control-point))) - (vector-! (-> v1-1 normal) (-> obj turn-exit-point) (the-as vector arg0)) - (set! (-> v1-1 local-pos quad) (-> obj turn-exit-dir quad)) - (set! (-> v1-1 local-pos x) (-> obj turn-exit-dir z)) - (set! (-> v1-1 local-pos z) (- (-> obj turn-exit-dir x))) - (logior! (-> obj flags) (vehicle-controller-flag left-turn)) + (vector-! (-> v1-1 normal) (-> this turn-exit-point) (the-as vector arg0)) + (set! (-> v1-1 local-pos quad) (-> this turn-exit-dir quad)) + (set! (-> v1-1 local-pos x) (-> this turn-exit-dir z)) + (set! (-> v1-1 local-pos z) (- (-> this turn-exit-dir x))) + (logior! (-> this flags) (vehicle-controller-flag left-turn)) (when (< 0.0 (vector-dot (-> v1-1 normal) (-> v1-1 local-pos))) - (logclear! (-> obj flags) (vehicle-controller-flag left-turn)) + (logclear! (-> this flags) (vehicle-controller-flag left-turn)) (vector-float*! (-> v1-1 local-pos) (-> v1-1 local-pos) -1.0) ) - (let ((a1-6 (-> obj dest-circle))) - (let ((a0-12 (-> obj turn-exit-point))) + (let ((a1-6 (-> this dest-circle))) + (let ((a0-12 (-> this turn-exit-point))) (let ((v1-2 (-> v1-1 local-pos))) (let ((a3-3 arg1)) (.mov vf7 a3-3) @@ -72,21 +72,21 @@ (.svf (&-> a1-6 quad) vf6) ) ) - (set! (-> obj dest-circle w) arg1) + (set! (-> this dest-circle w) arg1) 0 - (vehicle-controller-method-16 obj (-> obj path-prev-point) (-> obj turn-enter-point)) - (set! (-> obj target-point quad) (-> obj turn-enter-point quad)) - (vector-! (-> obj turn-enter-dir) (-> obj turn-enter-point) (-> obj path-prev-point)) - (set! (-> obj turn-enter-dir y) 0.0) - (vector-normalize! (-> obj turn-enter-dir) 1.0) + (vehicle-controller-method-16 this (-> this path-prev-point) (-> this turn-enter-point)) + (set! (-> this target-point quad) (-> this turn-enter-point quad)) + (vector-! (-> this turn-enter-dir) (-> this turn-enter-point) (-> this path-prev-point)) + (set! (-> this turn-enter-dir y) 0.0) + (vector-normalize! (-> this turn-enter-dir) 1.0) (let ((f0-12 (cos 8192.0)) - (f30-0 (vector-dot (-> obj turn-enter-dir) (-> obj turn-exit-dir))) + (f30-0 (vector-dot (-> this turn-enter-dir) (-> this turn-exit-dir))) ) - (set! (-> obj max-turn-speed) - (* (-> obj max-turn-speed) (+ 1.0 (fmax 0.0 (/ (- f30-0 f0-12) (- 1.0 f0-12))))) + (set! (-> this max-turn-speed) + (* (-> this max-turn-speed) (+ 1.0 (fmax 0.0 (/ (- f30-0 f0-12) (- 1.0 f0-12))))) ) (if (>= f30-0 (cos 1820.4445)) - (set! (-> obj max-turn-speed) 409600.0) + (set! (-> this max-turn-speed) 409600.0) ) ) 0 @@ -94,36 +94,36 @@ ) ) -(defmethod vehicle-controller-method-19 vehicle-controller ((obj vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector)) - (set! (-> obj path-prev-point quad) (-> arg0 quad)) +(defmethod vehicle-controller-method-19 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector)) + (set! (-> this path-prev-point quad) (-> arg0 quad)) (vector-vector-distance arg0 arg2) - (set! (-> obj target-speed) (vector-length arg3)) - (set! (-> obj turn-exit-point quad) (-> arg2 quad)) - (set! (-> obj turn-exit-dir quad) (-> arg3 quad)) - (set! (-> obj turn-exit-dir y) 0.0) - (vector-normalize! (-> obj turn-exit-dir) 1.0) - (vehicle-controller-method-20 obj arg0 (the-as float arg1)) - (logior! (-> obj flags) (vehicle-controller-flag on-straightaway)) + (set! (-> this target-speed) (vector-length arg3)) + (set! (-> this turn-exit-point quad) (-> arg2 quad)) + (set! (-> this turn-exit-dir quad) (-> arg3 quad)) + (set! (-> this turn-exit-dir y) 0.0) + (vector-normalize! (-> this turn-exit-dir) 1.0) + (vehicle-controller-method-20 this arg0 (the-as float arg1)) + (logior! (-> this flags) (vehicle-controller-flag on-straightaway)) 0 (none) ) -(defmethod vehicle-controller-method-13 vehicle-controller ((obj vehicle-controller) (arg0 nav-branch) (arg1 vector)) - (vehicle-controller-method-10 obj (the-as traffic-tracker arg0)) - (set! (-> obj path-prev-point quad) (-> arg1 quad)) - (set! (-> obj branch) arg0) +(defmethod vehicle-controller-method-13 vehicle-controller ((this vehicle-controller) (arg0 nav-branch) (arg1 vector)) + (vehicle-controller-method-10 this (the-as traffic-tracker arg0)) + (set! (-> this path-prev-point quad) (-> arg1 quad)) + (set! (-> this branch) arg0) (let ((v1-3 arg0)) - (set! (-> obj target-speed) (* 1024.0 (the float (-> v1-3 speed-limit)))) + (set! (-> this target-speed) (* 1024.0 (the float (-> v1-3 speed-limit)))) ) (let ((s4-1 (-> arg0 dest-node))) (let ((a1-2 s4-1) - (v1-6 (-> obj turn-exit-point)) + (v1-6 (-> this turn-exit-point)) ) (set! (-> v1-6 quad) (-> a1-2 position quad)) (set! (-> v1-6 w) 1.0) ) (let ((v1-7 s4-1) - (s3-0 (-> obj turn-exit-dir)) + (s3-0 (-> this turn-exit-dir)) ) (let ((f0-5 (the float (-> v1-7 angle))) (s2-0 (new 'stack-no-clear 'vector)) @@ -135,16 +135,16 @@ ) (set! (-> s3-0 w) 1.0) ) - (vehicle-controller-method-20 obj arg1 (* 1024.0 (the float (-> s4-1 radius)))) + (vehicle-controller-method-20 this arg1 (* 1024.0 (the float (-> s4-1 radius)))) ) - (logior! (-> obj flags) (vehicle-controller-flag on-straightaway)) + (logior! (-> this flags) (vehicle-controller-flag on-straightaway)) 0 (none) ) -(defmethod vehicle-controller-method-15 vehicle-controller ((obj vehicle-controller)) +(defmethod vehicle-controller-method-15 vehicle-controller ((this vehicle-controller)) (let ((gp-0 (the-as nav-branch #f))) - (let* ((s5-0 (-> obj branch dest-node)) + (let* ((s5-0 (-> this branch dest-node)) (s4-0 (-> s5-0 branch-count)) ) (b! (!= s4-0 1) cfg-4 :delay (empty-form)) @@ -182,20 +182,20 @@ ) ) -(defmethod vehicle-controller-method-14 vehicle-controller ((obj vehicle-controller) (arg0 vehicle)) +(defmethod vehicle-controller-method-14 vehicle-controller ((this vehicle-controller) (arg0 vehicle)) (let ((s4-0 (new 'stack-no-clear 'vector)) - (gp-0 ((-> obj choose-branch-callback) obj arg0)) + (gp-0 ((-> this choose-branch-callback) this arg0)) ) (when gp-0 - (vehicle-controller-method-11 obj) - (set! (-> s4-0 quad) (-> obj turn-exit-point quad)) - (vehicle-controller-method-13 obj gp-0 s4-0) + (vehicle-controller-method-11 this) + (set! (-> s4-0 quad) (-> this turn-exit-point quad)) + (vehicle-controller-method-13 this gp-0 s4-0) ) gp-0 ) ) -(defmethod vehicle-controller-method-16 vehicle-controller ((obj vehicle-controller) (arg0 vector) (arg1 vector)) +(defmethod vehicle-controller-method-16 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -205,17 +205,17 @@ ) (init-vf0-vector) (let ((s4-0 (new 'stack-no-clear 'vehicle-control-point))) - (vector-! (-> s4-0 local-pos) (-> obj dest-circle) arg0) + (vector-! (-> s4-0 local-pos) (-> this dest-circle) arg0) (set! (-> s4-0 local-pos y) 0.0) (let* ((v1-1 (-> s4-0 local-pos)) (f30-0 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) - (f28-0 (-> obj dest-circle w)) + (f28-0 (-> this dest-circle w)) ) (vector-xz-normalize! (-> s4-0 local-pos) 1.0) (set! (-> s4-0 normal x) (-> s4-0 local-pos z)) (set! (-> s4-0 normal y) 0.0) (set! (-> s4-0 normal z) (- (-> s4-0 local-pos x))) - (if (logtest? (-> obj flags) (vehicle-controller-flag left-turn)) + (if (logtest? (-> this flags) (vehicle-controller-flag left-turn)) (vector-float*! (-> s4-0 normal) (-> s4-0 normal) -1.0) ) (let* ((f0-10 f30-0) @@ -260,7 +260,7 @@ ) ) ) - (set! (-> arg1 y) (-> obj turn-exit-point y)) + (set! (-> arg1 y) (-> this turn-exit-point y)) 0 (none) ) @@ -285,7 +285,7 @@ ) ) -(defmethod vehicle-controller-method-18 vehicle-controller ((obj vehicle-controller) (arg0 vector) (arg1 vector) (arg2 vehicle) (arg3 float)) +(defmethod vehicle-controller-method-18 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector) (arg2 vehicle) (arg3 float)) (local-vars (v1-24 float) (v1-88 float) @@ -324,22 +324,22 @@ (set! sv-20 arg3) (set! sv-24 (-> arg2 info info inv-mass)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 16))) - (set! (-> gp-0 15 x) (+ (-> obj target-speed) (-> obj target-speed-offset))) + (set! (-> gp-0 15 x) (+ (-> this target-speed) (-> this target-speed-offset))) (set! (-> gp-0 1 quad) (-> arg1 quad)) (set! (-> gp-0 0 quad) (-> arg2 root trans quad)) (vector-z-quaternion! (-> gp-0 3) (-> arg2 root quat)) (vector-reset! (-> gp-0 2)) (cond - ((logtest? (-> obj flags) (vehicle-controller-flag on-straightaway)) - (vector-! (-> gp-0 6) (-> obj turn-enter-point) (-> gp-0 0)) - (let ((f0-5 (vector-dot (-> gp-0 6) (-> obj turn-enter-dir)))) - (vector+float*! (-> gp-0 4) (-> obj turn-enter-point) (-> obj turn-enter-dir) (- f0-5)) - (set! (-> gp-0 5 quad) (-> obj turn-enter-dir quad)) + ((logtest? (-> this flags) (vehicle-controller-flag on-straightaway)) + (vector-! (-> gp-0 6) (-> this turn-enter-point) (-> gp-0 0)) + (let ((f0-5 (vector-dot (-> gp-0 6) (-> this turn-enter-dir)))) + (vector+float*! (-> gp-0 4) (-> this turn-enter-point) (-> this turn-enter-dir) (- f0-5)) + (set! (-> gp-0 5 quad) (-> this turn-enter-dir quad)) (if (>= 0.0 f0-5) - (logclear! (-> obj flags) (vehicle-controller-flag on-straightaway)) + (logclear! (-> this flags) (vehicle-controller-flag on-straightaway)) ) - (when (not (logtest? (-> obj flags) (vehicle-controller-flag no-slowing-for-turns))) - (let ((f1-4 (* 0.5 (/ 1.0 (-> obj turn-accel))))) + (when (not (logtest? (-> this flags) (vehicle-controller-flag no-slowing-for-turns))) + (let ((f1-4 (* 0.5 (/ 1.0 (-> this turn-accel))))) (.lvf vf1 (&-> arg1 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -348,10 +348,10 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-24 vf1) (let ((f2-2 v1-24) - (f3-1 (-> obj max-turn-speed)) + (f3-1 (-> this max-turn-speed)) ) (if (>= (* f1-4 (- f2-2 (* f3-1 f3-1))) f0-5) - (set! (-> gp-0 15 x) (fmin (-> gp-0 15 x) (-> obj max-turn-speed))) + (set! (-> gp-0 15 x) (fmin (-> gp-0 15 x) (-> this max-turn-speed))) ) ) ) @@ -359,25 +359,25 @@ ) ) (else - (if (not (logtest? (-> obj flags) (vehicle-controller-flag no-slowing-for-turns))) - (set! (-> gp-0 15 x) (fmin (-> gp-0 15 x) (-> obj max-turn-speed))) + (if (not (logtest? (-> this flags) (vehicle-controller-flag no-slowing-for-turns))) + (set! (-> gp-0 15 x) (fmin (-> gp-0 15 x) (-> this max-turn-speed))) ) - (vector-! (-> gp-0 6) (-> gp-0 0) (-> obj dest-circle)) + (vector-! (-> gp-0 6) (-> gp-0 0) (-> this dest-circle)) (vector-normalize! (-> gp-0 6) 1.0) (set! (-> gp-0 5 x) (- (-> gp-0 6 z))) (set! (-> gp-0 5 y) 0.0) (set! (-> gp-0 5 z) (-> gp-0 6 x)) - (if (logtest? (-> obj flags) (vehicle-controller-flag left-turn)) + (if (logtest? (-> this flags) (vehicle-controller-flag left-turn)) (vector-float*! (-> gp-0 5) (-> gp-0 5) -1.0) ) - (vector-float*! (-> gp-0 6) (-> gp-0 6) (-> obj dest-circle w)) - (vector+! (-> gp-0 4) (-> obj dest-circle) (-> gp-0 6)) - (when (logtest? (-> obj flags) (vehicle-controller-flag attached)) - (vector-! (-> gp-0 9) (-> obj turn-exit-point) (-> gp-0 0)) - (when (and (< (vector-dot (-> obj turn-exit-dir) (-> gp-0 9)) 0.0) - (>= (vector-dot (-> obj turn-exit-dir) (-> gp-0 3)) (cos 8192.0)) + (vector-float*! (-> gp-0 6) (-> gp-0 6) (-> this dest-circle w)) + (vector+! (-> gp-0 4) (-> this dest-circle) (-> gp-0 6)) + (when (logtest? (-> this flags) (vehicle-controller-flag attached)) + (vector-! (-> gp-0 9) (-> this turn-exit-point) (-> gp-0 0)) + (when (and (< (vector-dot (-> this turn-exit-dir) (-> gp-0 9)) 0.0) + (>= (vector-dot (-> this turn-exit-dir) (-> gp-0 3)) (cos 8192.0)) ) - (if (not (vehicle-controller-method-14 obj arg2)) + (if (not (vehicle-controller-method-14 this arg2)) (set! (-> gp-0 15 x) 0.0) ) ) @@ -385,8 +385,8 @@ ) ) (set! (-> gp-0 4 y) (-> gp-0 0 y)) - (when (and (nonzero? (-> obj traffic)) - (not (logtest? (-> obj flags) (vehicle-controller-flag ignore-others))) + (when (and (nonzero? (-> this traffic)) + (not (logtest? (-> this flags) (vehicle-controller-flag ignore-others))) (let ((f0-22 (-> arg2 camera-dist2)) (f1-9 1228800.0) ) @@ -397,7 +397,7 @@ (f30-1 (-> arg2 root root-prim prim-core world-sphere w)) ) (countdown (s4-1 (fill-actor-list-for-line-sphere - (-> obj traffic object-hash) + (-> this traffic object-hash) (-> gp-0 0) (-> gp-0 1) (* 1.5 f30-1) @@ -467,7 +467,7 @@ ) ) ) - (when (not (logtest? (-> obj flags) (vehicle-controller-flag ignore-others))) + (when (not (logtest? (-> this flags) (vehicle-controller-flag ignore-others))) (vector-! (-> gp-0 6) (-> gp-0 4) (-> gp-0 0)) (.lvf vf1 (&-> (-> gp-0 6) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -477,10 +477,10 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-88 vf1) (let ((f0-39 v1-88)) - (logclear! (-> obj flags) (vehicle-controller-flag off-path)) + (logclear! (-> this flags) (vehicle-controller-flag off-path)) (let ((f1-23 4096.0)) (when (< (* f1-23 f1-23) f0-39) - (logior! (-> obj flags) (vehicle-controller-flag off-path)) + (logior! (-> this flags) (vehicle-controller-flag off-path)) (let ((t9-8 vector-normalize!) (a0-69 (-> gp-0 6)) (f1-26 12288.0) @@ -496,8 +496,8 @@ (vector-! (-> gp-0 2) (-> gp-0 2) (-> gp-0 6)) ) (cond - ((logtest? (-> obj flags) (vehicle-controller-flag direct-mode)) - (vector-! (-> gp-0 7) (-> obj turn-exit-point) (-> gp-0 0)) + ((logtest? (-> this flags) (vehicle-controller-flag direct-mode)) + (vector-! (-> gp-0 7) (-> this turn-exit-point) (-> gp-0 0)) (vector-normalize! (-> gp-0 7) (-> gp-0 15 x)) (vector-! (-> gp-0 6) (-> gp-0 7) (-> gp-0 1)) (vector-float*! (-> gp-0 6) (-> gp-0 6) 3.0) @@ -509,25 +509,25 @@ ) (else (vector+float*! (-> gp-0 8) (-> gp-0 0) (-> gp-0 1) 0.4) - (vector-! (-> gp-0 6) (-> gp-0 8) (-> obj turn-enter-point)) + (vector-! (-> gp-0 6) (-> gp-0 8) (-> this turn-enter-point)) (cond - ((< (vector-dot (-> gp-0 6) (-> obj turn-enter-dir)) 0.0) - (vector-! (-> gp-0 7) (-> obj turn-enter-point) (-> gp-0 0)) + ((< (vector-dot (-> gp-0 6) (-> this turn-enter-dir)) 0.0) + (vector-! (-> gp-0 7) (-> this turn-enter-point) (-> gp-0 0)) ) ((begin - (vector-! (-> gp-0 6) (-> gp-0 8) (-> obj turn-exit-point)) - (< (vector-dot (-> gp-0 6) (-> obj turn-exit-dir)) 0.0) + (vector-! (-> gp-0 6) (-> gp-0 8) (-> this turn-exit-point)) + (< (vector-dot (-> gp-0 6) (-> this turn-exit-dir)) 0.0) ) - (vector-! (-> gp-0 6) (-> gp-0 8) (-> obj dest-circle)) + (vector-! (-> gp-0 6) (-> gp-0 8) (-> this dest-circle)) (set! (-> gp-0 7 x) (- (-> gp-0 6 z))) (set! (-> gp-0 7 y) 0.0) (set! (-> gp-0 7 z) (-> gp-0 6 x)) - (if (logtest? (-> obj flags) (vehicle-controller-flag left-turn)) + (if (logtest? (-> this flags) (vehicle-controller-flag left-turn)) (vector-float*! (-> gp-0 7) (-> gp-0 7) -1.0) ) ) (else - (set! (-> gp-0 7 quad) (-> obj turn-exit-dir quad)) + (set! (-> gp-0 7 quad) (-> this turn-exit-dir quad)) ) ) (let ((f0-60 (vector-length (-> gp-0 7)))) @@ -559,37 +559,37 @@ ) ) -(defmethod vehicle-controller-method-10 vehicle-controller ((obj vehicle-controller) (arg0 traffic-tracker)) - (when (not (logtest? (-> obj flags) (vehicle-controller-flag attached))) - (logior! (-> obj flags) (vehicle-controller-flag attached)) +(defmethod vehicle-controller-method-10 vehicle-controller ((this vehicle-controller) (arg0 traffic-tracker)) + (when (not (logtest? (-> this flags) (vehicle-controller-flag attached))) + (logior! (-> this flags) (vehicle-controller-flag attached)) (+! (-> arg0 active-object-count) 1) ) 0 (none) ) -(defmethod vehicle-controller-method-11 vehicle-controller ((obj vehicle-controller)) - (when (logtest? (-> obj flags) (vehicle-controller-flag attached)) - (logclear! (-> obj flags) (vehicle-controller-flag attached)) - (let ((v1-5 (-> obj branch))) +(defmethod vehicle-controller-method-11 vehicle-controller ((this vehicle-controller)) + (when (logtest? (-> this flags) (vehicle-controller-flag attached)) + (logclear! (-> this flags) (vehicle-controller-flag attached)) + (let ((v1-5 (-> this branch))) (if (> (-> v1-5 user-count) 0) (+! (-> v1-5 user-count) -1) ) ) - (when (logtest? (-> obj flags) (vehicle-controller-flag blocking-dest-node)) - (logclear! (-> obj flags) (vehicle-controller-flag blocking-dest-node)) - (logclear! (-> obj branch dest-node flags) (nav-node-flag-byte blocked)) + (when (logtest? (-> this flags) (vehicle-controller-flag blocking-dest-node)) + (logclear! (-> this flags) (vehicle-controller-flag blocking-dest-node)) + (logclear! (-> this branch dest-node flags) (nav-node-flag-byte blocked)) ) ) - (set! (-> obj branch) (the-as nav-branch 0)) - (if (logtest? (-> obj flags) (vehicle-controller-flag blocking-dest-node)) + (set! (-> this branch) (the-as nav-branch 0)) + (if (logtest? (-> this flags) (vehicle-controller-flag blocking-dest-node)) (format #t "blocking-dest-node bit set after detach~%") ) 0 (none) ) -(defmethod vehicle-controller-method-12 vehicle-controller ((obj vehicle-controller) +(defmethod vehicle-controller-method-12 vehicle-controller ((this vehicle-controller) (arg0 rigid-body-vehicle-constants) (arg1 vector) (arg2 float) @@ -614,7 +614,7 @@ ) (else (set! (-> arg0 sample-index) arg3) - (set! (-> arg0 sample-time) (current-time)) + (set-time! (-> arg0 sample-time)) (set! (-> arg0 sample-dir quad) (-> s3-0 quad)) ) ) @@ -623,35 +623,35 @@ (none) ) -(defmethod draw-debug-info vehicle-controller ((obj vehicle-controller)) - (add-debug-sphere #t (bucket-id debug2) (-> obj dest-circle) (-> obj dest-circle w) *color-green*) - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj target-point) *color-white*) +(defmethod draw-debug-info vehicle-controller ((this vehicle-controller)) + (add-debug-sphere #t (bucket-id debug2) (-> this dest-circle) (-> this dest-circle w) *color-green*) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this target-point) *color-white*) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj turn-exit-point) - (-> obj turn-exit-dir) + (-> this turn-exit-point) + (-> this turn-exit-dir) (meters 2) *color-red* ) - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj turn-enter-point) *color-dark-red*) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this turn-enter-point) *color-dark-red*) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj turn-enter-point) - (-> obj turn-enter-dir) + (-> this turn-enter-point) + (-> this turn-enter-dir) (meters 2) *color-dark-red* ) - (when (logtest? (-> obj flags) (vehicle-controller-flag on-straightaway)) + (when (logtest? (-> this flags) (vehicle-controller-flag on-straightaway)) (let ((a3-5 (new 'stack-no-clear 'vector))) - (vector-! a3-5 (-> obj target-point) (-> obj path-prev-point)) + (vector-! a3-5 (-> this target-point) (-> this path-prev-point)) (add-debug-line-sphere #t (bucket-id debug2) - (-> obj path-prev-point) + (-> this path-prev-point) a3-5 - (-> obj dest-circle w) + (-> this dest-circle w) *color-yellow* ) ) @@ -660,14 +660,14 @@ (none) ) -(defmethod vehicle-controller-method-9 vehicle-controller ((obj vehicle-controller)) - (set! (-> obj traffic) *traffic-engine*) - (set! (-> obj choose-branch-callback) (the-as - (function vehicle-controller vehicle nav-branch) - (method-of-type vehicle-controller vehicle-controller-method-15) - ) +(defmethod vehicle-controller-method-9 vehicle-controller ((this vehicle-controller)) + (set! (-> this traffic) *traffic-engine*) + (set! (-> this choose-branch-callback) (the-as + (function vehicle-controller vehicle nav-branch) + (method-of-type vehicle-controller vehicle-controller-method-15) + ) ) - (set! (-> obj turn-accel) 49152.0) + (set! (-> this turn-accel) 49152.0) 0 (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc index 4d3dae3e57..f267c127b0 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-effects.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod do-engine-sounds vehicle ((obj vehicle)) +(defmethod do-engine-sounds vehicle ((this vehicle)) (local-vars (v1-36 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -15,59 +15,60 @@ (vf2 :class vf) ) (init-vf0-vector) - (if (logtest? (rigid-body-object-flag ignition) (-> obj flags)) - (seek! (-> obj engine-sound-envelope) 1.0 (* 2.0 (seconds-per-frame))) - (seek! (-> obj engine-sound-envelope) 0.0 (seconds-per-frame)) + (if (logtest? (rigid-body-object-flag ignition) (-> this flags)) + (seek! (-> this engine-sound-envelope) 1.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this engine-sound-envelope) 0.0 (seconds-per-frame)) ) (cond - ((< 0.0 (-> obj scrape-sound-envelope)) - (if (zero? (-> obj scrape-sound-id)) - (set! (-> obj scrape-sound-id) (new-sound-id)) + ((< 0.0 (-> this scrape-sound-envelope)) + (if (zero? (-> this scrape-sound-id)) + (set! (-> this scrape-sound-id) (new-sound-id)) ) (sound-play-by-name - (-> obj info scrape-sound) - (-> obj scrape-sound-id) - (the int (* 1024.0 (-> obj scrape-sound-envelope))) + (-> this info scrape-sound) + (-> this scrape-sound-id) + (the int (* 1024.0 (-> this scrape-sound-envelope))) 0 0 (sound-group sfx) - (-> obj impact-pos) + (-> this impact-pos) ) ) (else - (when (nonzero? (-> obj scrape-sound-id)) - (sound-stop (-> obj scrape-sound-id)) - (set! (-> obj scrape-sound-id) (new 'static 'sound-id)) + (when (nonzero? (-> this scrape-sound-id)) + (sound-stop (-> this scrape-sound-id)) + (set! (-> this scrape-sound-id) (new 'static 'sound-id)) 0 ) ) ) (cond - ((< 0.0 (* (-> obj force-scale) (-> obj engine-sound-envelope))) - (when (zero? (-> obj engine-sound-id)) - (set! (-> obj engine-sound-id) (new-sound-id)) - (set! (-> obj extra-sound-id) (new-sound-id)) + ((< 0.0 (* (-> this force-scale) (-> this engine-sound-envelope))) + (when (zero? (-> this engine-sound-id)) + (set! (-> this engine-sound-id) (new-sound-id)) + (set! (-> this extra-sound-id) (new-sound-id)) ) - (let* ((f30-0 (fabs (* (-> obj engine-thrust) (-> obj power-level) (-> obj force-scale)))) - (f28-0 (* (-> obj engine-sound-envelope) (+ 0.6 (* 0.4 f30-0)))) - (f26-0 (doppler-pitch-shift (-> obj root trans) (-> obj root transv))) - (f0-22 - (+ (-> obj info engine-pitch-offset) - (* (-> obj info engine-pitch-scale) f30-0) - (* (-> obj info engine-pitch-mod-amp) (sin (* 109.22667 (the float (- (current-time) (-> obj state-time)))))) - f26-0 - ) - ) + (let* ((f30-0 (fabs (* (-> this engine-thrust) (-> this power-level) (-> this force-scale)))) + (f28-0 (* (-> this engine-sound-envelope) (+ 0.6 (* 0.4 f30-0)))) + (f26-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (f0-22 (+ (-> this info engine-pitch-offset) + (* (-> this info engine-pitch-scale) f30-0) + (* (-> this info engine-pitch-mod-amp) + (sin (* 109.22667 (the float (- (current-time) (-> this state-time))))) + ) + f26-0 + ) + ) (a0-9 (static-sound-spec "vehicle-engine" :volume 0.0 :mask (pitch reg0))) ) - (set! (-> a0-9 sound-name) (-> obj info engine-sound)) - (set! (-> obj engine-sound-factor) f30-0) + (set! (-> a0-9 sound-name) (-> this info engine-sound)) + (set! (-> this engine-sound-factor) f30-0) (cond (#f (let* ((f0-23 40960.0) (f0-25 (* f0-23 f0-23)) ) - (.lvf vf1 (&-> (-> obj rbody state lin-velocity) quad)) + (.lvf vf1 (&-> (-> this rbody state lin-velocity) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -76,28 +77,28 @@ (.mov v1-36 vf1) (cond ((< f0-25 v1-36) - (format *stdcon* "accel-to-steady ~d~%" (-> obj engine-sound-id)) - (when (logtest? (rigid-body-object-flag idle-sound) (-> obj flags)) + (format *stdcon* "accel-to-steady ~d~%" (-> this engine-sound-id)) + (when (logtest? (rigid-body-object-flag idle-sound) (-> this flags)) (format *stdcon* "new engine sound~%") - (sound-stop (-> obj engine-sound-id)) - (set! (-> obj engine-sound-id) (new-sound-id)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag idle-sound))) + (sound-stop (-> this engine-sound-id)) + (set! (-> this engine-sound-id) (new-sound-id)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag idle-sound))) ) ) - (sound-play "accel-to-steady" :id (-> obj engine-sound-id) :position (-> obj root trans)) + (sound-play "accel-to-steady" :id (-> this engine-sound-id) :position (-> this root trans)) ) (else - (format *stdcon* "decel-to-idle id ~d~%" (-> obj engine-sound-id)) - (when (not (logtest? (rigid-body-object-flag idle-sound) (-> obj flags))) + (format *stdcon* "decel-to-idle id ~d~%" (-> this engine-sound-id)) + (when (not (logtest? (rigid-body-object-flag idle-sound) (-> this flags))) (format *stdcon* "new engine sound~%") - (sound-stop (-> obj engine-sound-id)) - (set! (-> obj engine-sound-id) (new-sound-id)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag idle-sound) (-> obj flags))) + (sound-stop (-> this engine-sound-id)) + (set! (-> this engine-sound-id) (new-sound-id)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag idle-sound) (-> this flags))) ) ) - (sound-play "decel-to-idle" :id (-> obj engine-sound-id) :position (-> obj root trans)) + (sound-play "decel-to-idle" :id (-> this engine-sound-id) :position (-> this root trans)) ) ) ) @@ -105,45 +106,45 @@ (else (set! (-> a0-9 volume) (the int (* 1024.0 f28-0))) (set! (-> a0-9 pitch-mod) (the int (* 1524.0 f0-22))) - (set! (-> a0-9 reg 0) (the-as uint (-> obj info engine-sound-select))) - (set! (-> a0-9 reg 1) (the-as uint (the int (* 127.0 (-> obj hit-points))))) - (sound-play-by-spec a0-9 (-> obj engine-sound-id) (-> obj root trans)) + (set! (-> a0-9 reg 0) (the-as uint (-> this info engine-sound-select))) + (set! (-> a0-9 reg 1) (the-as uint (the int (* 127.0 (-> this hit-points))))) + (sound-play-by-spec a0-9 (-> this engine-sound-id) (-> this root trans)) ) ) ) 0 ) (else - (when (nonzero? (-> obj engine-sound-id)) - (sound-stop (-> obj engine-sound-id)) - (set! (-> obj engine-sound-id) (new 'static 'sound-id)) + (when (nonzero? (-> this engine-sound-id)) + (sound-stop (-> this engine-sound-id)) + (set! (-> this engine-sound-id) (new 'static 'sound-id)) 0 ) ) ) - (when (or (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (nonzero? (-> obj thrust-sound-id))) - (if (zero? (-> obj thrust-sound-id)) - (set! (-> obj thrust-sound-id) (new-sound-id)) + (when (or (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (nonzero? (-> this thrust-sound-id))) + (if (zero? (-> this thrust-sound-id)) + (set! (-> this thrust-sound-id) (new-sound-id)) ) - (seek! (-> obj sputter-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this sputter-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) (cond - ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> obj sputter-sound-envelope) (fmax (-> obj sputter-sound-envelope) (-> obj power-level))) + ((logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (set! (-> this sputter-sound-envelope) (fmax (-> this sputter-sound-envelope) (-> this power-level))) (let ((f1-25 (fmin 1.0 (* 0.7 - (-> obj force-scale) - (-> obj sputter-sound-envelope) - (+ (-> obj engine-sound-factor) (-> obj jump-thrust)) + (-> this force-scale) + (-> this sputter-sound-envelope) + (+ (-> this engine-sound-factor) (-> this jump-thrust)) ) ) ) (f0-38 0.0) ) (sound-play-by-name - (-> obj info thrust-sound) - (-> obj thrust-sound-id) + (-> this info thrust-sound) + (-> this thrust-sound-id) (the int (* 1024.0 f1-25)) (the int (* 1524.0 f0-38)) 0 @@ -153,16 +154,16 @@ ) ) (else - (when (= (-> obj sputter-sound-envelope) 0.0) - (sound-stop (-> obj thrust-sound-id)) - (set! (-> obj thrust-sound-id) (new 'static 'sound-id)) + (when (= (-> this sputter-sound-envelope) 0.0) + (sound-stop (-> this thrust-sound-id)) + (set! (-> this thrust-sound-id) (new 'static 'sound-id)) 0 ) ) ) ) - (if (< (rand-vu) (-> obj power-fluctuation-factor)) - (sound-play "damage-pops" :id (-> obj damage-pop-sound-id)) + (if (< (rand-vu) (-> this power-fluctuation-factor)) + (sound-play "damage-pops" :id (-> this damage-pop-sound-id)) ) 0 (none) @@ -218,7 +219,7 @@ ) ) -(defmethod draw-thruster vehicle ((obj vehicle) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod draw-thruster vehicle ((this vehicle) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -231,7 +232,7 @@ (s4-1 (* arg3 f0-0)) (s0-0 (fmin (* arg2 f0-0) (* 0.5 s4-1))) (s3-1 (new 'stack-no-clear 'inline-array 'vehicle-control-point 3)) - (s2-0 (-> obj info)) + (s2-0 (-> this info)) ) (let ((a1-2 (-> s3-1 0 normal))) (let ((v1-2 arg0)) @@ -257,9 +258,9 @@ (set! (-> v1-3 local-pos w) f0-5) ) 0 - (let ((f28-0 (/ s4-1 (-> obj info thruster-flame-length)))) + (let ((f28-0 (/ s4-1 (-> this info thruster-flame-length)))) (set! (-> s3-1 2 local-pos y) (rand-vu-float-range 0.0 64.0)) - (set! (-> s3-1 2 local-pos w) (* (-> obj fog-fade) (+ (* 16.0 f28-0) (* 4.0 (rand-vu))))) + (set! (-> s3-1 2 local-pos w) (* (-> this fog-fade) (+ (* 16.0 f28-0) (* 4.0 (rand-vu))))) ) (let ((f0-14 (* 4.0 s0-0))) (set! (-> s3-1 1 local-pos w) f0-14) @@ -267,7 +268,7 @@ (set! (-> s3-1 1 normal x) (* 0.025 f0-14)) ) (add! *simple-sprite-system* (the-as sprite-glow-data (-> s3-1 1))) - (forward-up->quaternion (the-as quaternion (-> s3-1 0)) arg1 (the-as vector (-> obj rbody state matrix))) + (forward-up->quaternion (the-as quaternion (-> s3-1 0)) arg1 (the-as vector (-> this rbody state matrix))) (quaternion-rotate-local-x! (the-as quaternion (-> s3-1 0)) (the-as quaternion (-> s3-1 0)) 32768.0) (let ((v1-16 (-> s3-1 0 normal))) (let ((a0-10 (* 0.5 s4-1))) @@ -307,45 +308,45 @@ ) ) -(defmethod draw-thrusters vehicle ((obj vehicle)) +(defmethod draw-thrusters vehicle ((this vehicle)) (local-vars (sv-272 sparticle-launcher) (sv-276 sparticle-launcher)) - (when (= (-> obj controller traffic sync-mask-32) (ash 1 (logand (-> obj traffic-priority-id) 31))) + (when (= (-> this controller traffic sync-mask-32) (ash 1 (logand (-> this traffic-priority-id) 31))) (let ((f0-1 - (+ (-> *time-of-day-context* time) (* 0.048387095 (the float (logand (-> obj traffic-priority-id) 31)))) + (+ (-> *time-of-day-context* time) (* 0.048387095 (the float (logand (-> this traffic-priority-id) 31)))) ) ) (cond - ((and (logtest? (-> obj flags) (rigid-body-object-flag riding)) (or (< f0-1 7.0) (< 19.0 f0-1))) - (if (not (logtest? (rigid-body-object-flag lights-on) (-> obj flags))) - (vehicle-method-131 obj) + ((and (logtest? (-> this flags) (rigid-body-object-flag riding)) (or (< f0-1 7.0) (< 19.0 f0-1))) + (if (not (logtest? (rigid-body-object-flag lights-on) (-> this flags))) + (vehicle-method-131 this) ) ) (else - (if (logtest? (rigid-body-object-flag lights-on) (-> obj flags)) - (vehicle-method-132 obj) + (if (logtest? (rigid-body-object-flag lights-on) (-> this flags)) + (vehicle-method-132 this) ) ) ) ) ) - (when (logtest? (rigid-body-object-flag lights-update) (-> obj flags)) - (let ((f30-0 (if (logtest? (rigid-body-object-flag lights-on) (-> obj flags)) + (when (logtest? (rigid-body-object-flag lights-update) (-> this flags)) + (let ((f30-0 (if (logtest? (rigid-body-object-flag lights-on) (-> this flags)) 1.0 0.0 ) ) ) - (seek! (-> obj lights-factor) f30-0 (* 2.0 (seconds-per-frame))) - (if (= (-> obj lights-factor) f30-0) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag lights-update))) + (seek! (-> this lights-factor) f30-0 (* 2.0 (seconds-per-frame))) + (if (= (-> this lights-factor) f30-0) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag lights-update))) ) ) ) ) (let ((s5-0 (new 'stack-no-clear 'inline-array 'matrix 2))) (let* ((v1-38 (-> s5-0 1)) - (a3-0 (-> obj node-list data 0 bone transform)) + (a3-0 (-> this node-list data 0 bone transform)) (a0-16 (-> a3-0 quad 0)) (a1-1 (-> a3-0 quad 1)) (a2-1 (-> a3-0 quad 2)) @@ -358,15 +359,15 @@ ) (set-vector! (-> s5-0 0 vector 1) 0.0 0.0 -1.0 1.0) (vector-rotate*! (-> s5-0 0 vector 1) (-> s5-0 0 vector 1) (-> s5-0 1)) - (set! (-> obj fog-fade) (calc-fade-from-fog (-> obj root trans))) - (let ((f30-1 (* (-> obj fog-fade) (-> obj lights-factor)))) + (set! (-> this fog-fade) (calc-fade-from-fog (-> this root trans))) + (let ((f30-1 (* (-> this fog-fade) (-> this lights-factor)))) (when (< 0.0 f30-1) (let ((s4-0 (new 'stack-no-clear 'sprite-glow-data)) (s3-0 *vehicle-headlight-glow-template*) ) - (dotimes (s2-0 (-> obj info headlight-count)) + (dotimes (s2-0 (-> this info headlight-count)) (quad-copy! (the-as pointer s4-0) (the-as pointer s3-0) 4) - (vector-matrix*! (the-as vector (-> s5-0 0)) (-> obj info headlight-local-pos s2-0) (-> s5-0 1)) + (vector-matrix*! (the-as vector (-> s5-0 0)) (-> this info headlight-local-pos s2-0) (-> s5-0 1)) (let* ((v1-44 s4-0) (a1-6 (-> s5-0 0)) (f0-14 (-> v1-44 position w)) @@ -380,7 +381,7 @@ (set! (-> s4-0 color y) (rand-vu-float-range 192.0 255.0)) (set! (-> s4-0 color w) (* f30-1 (rand-vu-float-range 16.0 18.0))) (add! *simple-sprite-system* s4-0) - (let ((f0-21 (-> obj camera-dist2)) + (let ((f0-21 (-> this camera-dist2)) (f1-6 245760.0) ) (when (< f0-21 (* f1-6 f1-6)) @@ -399,8 +400,8 @@ ) (let ((s4-1 (new 'stack-no-clear 'sprite-glow-data))) (quad-copy! (the-as pointer s4-1) (the-as pointer *vehicle-taillight-glow-template*) 4) - (dotimes (s3-1 (-> obj info taillight-count)) - (vector-matrix*! (the-as vector (-> s5-0 0)) (-> obj info taillight-local-pos s3-1) (-> s5-0 1)) + (dotimes (s3-1 (-> this info taillight-count)) + (vector-matrix*! (the-as vector (-> s5-0 0)) (-> this info taillight-local-pos s3-1) (-> s5-0 1)) (let* ((v1-66 s4-1) (a1-18 (-> s5-0 0)) (f0-28 (-> v1-66 position w)) @@ -417,26 +418,26 @@ ) ) ) - (when (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) + (when (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (let* ((f30-2 (fmax 0.0 - (* (-> obj info thruster-flame-length) (-> obj power-level) (-> obj force-scale) (-> obj engine-thrust)) + (* (-> this info thruster-flame-length) (-> this power-level) (-> this force-scale) (-> this engine-thrust)) ) ) - (f28-3 (fmin (-> obj info thruster-flame-width) f30-2)) + (f28-3 (fmin (-> this info thruster-flame-width) f30-2)) ) (dotimes (s4-2 2) - (vector-matrix*! (the-as vector (-> s5-0 0)) (-> obj info thruster-local-pos s4-2) (-> s5-0 1)) - (draw-thruster obj (the-as vector (-> s5-0 0)) (-> s5-0 0 vector 1) f28-3 f30-2) + (vector-matrix*! (the-as vector (-> s5-0 0)) (-> this info thruster-local-pos s4-2) (-> s5-0 1)) + (draw-thruster this (the-as vector (-> s5-0 0)) (-> s5-0 0 vector 1) f28-3 f30-2) ) ) - (when (logtest? (rigid-body-object-flag ignition) (-> obj flags)) + (when (logtest? (rigid-body-object-flag ignition) (-> this flags)) (set! (-> *part-id-table* 776 init-specs 2 initial-valuef) - (* 6.0 (+ 0.25 (-> obj engine-power-factor)) (rand-vu)) + (* 6.0 (+ 0.25 (-> this engine-power-factor)) (rand-vu)) ) (let* ((f0-40 1.0) - (f1-15 (-> obj engine-power-factor)) + (f1-15 (-> this engine-power-factor)) (f0-41 (- f0-40 (* f1-15 f1-15))) ) (set! (-> *part-id-table* 776 init-specs 9 initial-valuef) (* 16.0 f0-41)) @@ -444,23 +445,23 @@ ) (let ((s4-3 (-> *part-id-table* 776))) (dotimes (s3-2 2) - (vector-matrix*! (the-as vector (-> s5-0 0)) (-> obj info exhaust-local-pos s3-2) (-> s5-0 1)) - (vector-rotate*! (-> s5-0 0 vector 1) (-> obj info exhaust-local-dir s3-2) (-> s5-0 1)) + (vector-matrix*! (the-as vector (-> s5-0 0)) (-> this info exhaust-local-pos s3-2) (-> s5-0 1)) + (vector-rotate*! (-> s5-0 0 vector 1) (-> this info exhaust-local-dir s3-2) (-> s5-0 1)) (vector+float*! - (-> obj info part-vel) - (-> obj rbody state lin-velocity) + (-> this info part-vel) + (-> this rbody state lin-velocity) (-> s5-0 0 vector 1) - (* 0.2 (-> obj info max-engine-thrust) (+ 0.5 (-> obj engine-power-factor))) + (* 0.2 (-> this info max-engine-thrust) (+ 0.5 (-> this engine-power-factor))) ) - (let ((v1-117 (-> obj info part-vel)) - (a0-45 (-> obj info part-vel)) + (let ((v1-117 (-> this info part-vel)) + (a0-45 (-> this info part-vel)) (f0-46 300.0) ) (vector-float*! v1-117 a0-45 (/ 1.0 f0-46)) ) - (set! (-> s4-3 birthaccum) (the-as float (-> obj exhaust-part-accum s3-2))) + (set! (-> s4-3 birthaccum) (the-as float (-> this exhaust-part-accum s3-2))) (let ((t9-25 sp-launch-particles-var) - (a0-46 (-> obj info particle-system-2d)) + (a0-46 (-> this info particle-system-2d)) (a1-34 s4-3) (a2-14 *launch-matrix*) ) @@ -474,11 +475,11 @@ 1.0 ) ) - (set! (-> obj exhaust-part-accum s3-2) (the-as basic (-> s4-3 birthaccum))) + (set! (-> this exhaust-part-accum s3-2) (the-as basic (-> s4-3 birthaccum))) ) ) ) - (when (< (-> obj hit-points) 0.75) + (when (< (-> this hit-points) 0.75) (let* ((f28-5 (+ -32768.0 (* 32768.0 (rand-vu)))) (f24-0 (* 65536.0 (rand-vu))) (f30-6 (cos f28-5)) @@ -492,11 +493,11 @@ (set! sv-272 (the-as sparticle-launcher #f)) (set! sv-276 (the-as sparticle-launcher #f)) (cond - ((< (-> obj hit-points) 0.25) + ((< (-> this hit-points) 0.25) (set! sv-272 (-> *part-id-table* 778)) (set! sv-276 (-> *part-id-table* 774)) ) - ((< (-> obj hit-points) 0.5) + ((< (-> this hit-points) 0.5) (set! sv-272 (-> *part-id-table* 781)) ) (else @@ -508,19 +509,19 @@ (when sv-272 (let ((s3-3 #f)) (dotimes (s4-4 2) - (vector-rotate*! (-> s5-0 0 vector 2) (-> obj info smoke-local-vel s4-4) (-> s5-0 1)) - (vector+! (-> s5-0 0 vector 2) (-> s5-0 0 vector 2) (-> obj rbody state lin-velocity)) + (vector-rotate*! (-> s5-0 0 vector 2) (-> this info smoke-local-vel s4-4) (-> s5-0 1)) + (vector+! (-> s5-0 0 vector 2) (-> s5-0 0 vector 2) (-> this rbody state lin-velocity)) (vector+float*! (-> s5-0 0 vector 2) (-> s5-0 0 vector 2) (-> s5-0 0 trans) (* 24576.0 (rand-vu))) - (let ((v1-152 (-> obj info part-vel)) + (let ((v1-152 (-> this info part-vel)) (a0-54 (-> s5-0 0 vector 2)) (f0-63 300.0) ) (vector-float*! v1-152 a0-54 (/ 1.0 f0-63)) ) - (vector-matrix*! (the-as vector (-> s5-0 0)) (-> obj info smoke-local-pos s4-4) (-> s5-0 1)) + (vector-matrix*! (the-as vector (-> s5-0 0)) (-> this info smoke-local-pos s4-4) (-> s5-0 1)) (when (and sv-276 (< (rand-vu) 0.005)) (let ((t9-37 sp-launch-particles-var) - (a0-56 (-> obj info particle-system-2d)) + (a0-56 (-> this info particle-system-2d)) (a1-44 sv-276) (a2-17 *launch-matrix*) ) @@ -536,9 +537,9 @@ ) (set! s3-3 #t) ) - (set! (-> sv-272 birthaccum) (the-as float (-> obj smoke-part-accum s4-4))) + (set! (-> sv-272 birthaccum) (the-as float (-> this smoke-part-accum s4-4))) (let ((t9-38 sp-launch-particles-var) - (a0-57 (-> obj info particle-system-2d)) + (a0-57 (-> this info particle-system-2d)) (a1-45 sv-272) (a2-18 *launch-matrix*) ) @@ -552,21 +553,21 @@ 1.0 ) ) - (set! (-> obj smoke-part-accum s4-4) (the-as basic (-> sv-272 birthaccum))) + (set! (-> this smoke-part-accum s4-4) (the-as basic (-> sv-272 birthaccum))) ) (if s3-3 - (sound-play "damage-zaps" :id (-> obj damage-zap-sound-id)) + (sound-play "damage-zaps" :id (-> this damage-zap-sound-id)) ) ) ) ) - (when (>= (-> obj scrape-sound-envelope) 0.75) + (when (>= (-> this scrape-sound-envelope) 0.75) (let ((a1-47 (-> *part-id-table* 773)) (t9-40 sp-launch-particles-var) - (a0-60 (-> obj info particle-system-2d)) + (a0-60 (-> this info particle-system-2d)) (a2-20 *launch-matrix*) ) - (set! (-> a2-20 trans quad) (-> obj impact-pos quad)) + (set! (-> a2-20 trans quad) (-> this impact-pos quad)) (t9-40 (the-as sparticle-system a0-60) a1-47 diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc index c75ea80ba6..936461bb10 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-guard.gc @@ -116,17 +116,17 @@ ) -(defmethod set-info turret-control ((obj turret-control) (arg0 turret-control-info)) - (set! (-> obj info) arg0) - (set! (-> obj owner-handle) (the-as handle #f)) +(defmethod set-info turret-control ((this turret-control) (arg0 turret-control-info)) + (set! (-> this info) arg0) + (set! (-> this owner-handle) (the-as handle #f)) 0 (none) ) -(defmethod update-joint-mod turret-control ((obj turret-control) (arg0 joint-mod-rotate-local)) +(defmethod update-joint-mod turret-control ((this turret-control) (arg0 joint-mod-rotate-local)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 x) (- (-> obj aim-rot-x))) - (set! (-> v1-0 y) (-> obj aim-rot-y)) + (set! (-> v1-0 x) (- (-> this aim-rot-x))) + (set! (-> v1-0 y) (-> this aim-rot-y)) (set! (-> v1-0 z) 0.0) (quaternion-zxy! (-> arg0 rotation) v1-0) ) @@ -134,23 +134,24 @@ (none) ) -(defmethod turret-control-method-13 turret-control ((obj turret-control)) - (let ((f30-0 - (/ (* 298261630.0 (-> obj inaccuracy) (-> obj guard-settings inaccuracy)) (fmax 40960.0 (-> obj target-dist))) - ) +(defmethod turret-control-method-13 turret-control ((this turret-control)) + (let ((f30-0 (/ (* 298261630.0 (-> this inaccuracy) (-> this guard-settings inaccuracy)) + (fmax 40960.0 (-> this target-dist)) + ) + ) ) - (set! (-> obj aim-rot-offset 0) (* f30-0 (cos (-> obj aim-offset-angle)))) - (set! (-> obj aim-rot-offset 1) (* f30-0 (sin (-> obj aim-offset-angle)))) + (set! (-> this aim-rot-offset 0) (* f30-0 (cos (-> this aim-offset-angle)))) + (set! (-> this aim-rot-offset 1) (* f30-0 (sin (-> this aim-offset-angle)))) ) - (+! (-> obj aim-offset-angle) (* 32768.0 (rand-vu))) + (+! (-> this aim-offset-angle) (* 32768.0 (rand-vu))) 0 (none) ) -(defmethod turret-control-method-14 turret-control ((obj turret-control)) - (logclear! (-> obj flags) (turret-flag firing aiming)) - (set! (-> obj burst-count) 0) - (set! (-> obj aim-offset-angle) (* 65536.0 (rand-vu))) +(defmethod turret-control-method-14 turret-control ((this turret-control)) + (logclear! (-> this flags) (turret-flag firing aiming)) + (set! (-> this burst-count) 0) + (set! (-> this aim-offset-angle) (* 65536.0 (rand-vu))) 0 (none) ) @@ -271,11 +272,11 @@ (none) ) -(defmethod turret-control-method-9 turret-control ((obj turret-control) (arg0 vehicle) (arg1 vector) (arg2 vector)) +(defmethod turret-control-method-9 turret-control ((this turret-control) (arg0 vehicle) (arg1 vector) (arg2 vector)) (let ((gp-0 (new 'stack-no-clear 'turret-unknown-stack-structure))) (set! (-> gp-0 vec-12 x) (seconds-per-frame)) (let* ((v1-1 (-> gp-0 mat-1)) - (a3-1 (-> arg0 node-list data (-> obj info joint-index) bone transform)) + (a3-1 (-> arg0 node-list data (-> this info joint-index) bone transform)) (a0-4 (-> a3-1 quad 0)) (a1-4 (-> a3-1 quad 1)) (a2-1 (-> a3-1 quad 2)) @@ -286,15 +287,15 @@ (set! (-> v1-1 quad 2) a2-1) (set! (-> v1-1 trans quad) a3-2) ) - (set! (-> obj target-dist) (vector-vector-distance (-> gp-0 mat-1 trans) arg1)) - (let ((f0-3 (/ (-> obj target-dist) (-> obj info shot-speed)))) + (set! (-> this target-dist) (vector-vector-distance (-> gp-0 mat-1 trans) arg1)) + (let ((f0-3 (/ (-> this target-dist) (-> this info shot-speed)))) (vector+float*! (-> gp-0 vec-1) arg1 arg2 f0-3) ) - (when (not (logtest? (-> obj flags) (turret-flag aiming))) - (logior! (-> obj flags) (turret-flag aiming)) - (turret-control-method-13 obj) + (when (not (logtest? (-> this flags) (turret-flag aiming))) + (logior! (-> this flags) (turret-flag aiming)) + (turret-control-method-13 this) ) - (vector-matrix*! (-> gp-0 vec-6) (-> obj info local-pos) (-> gp-0 mat-1)) + (vector-matrix*! (-> gp-0 vec-6) (-> this info local-pos) (-> gp-0 mat-1)) (vector-! (-> gp-0 vec-5) (-> gp-0 vec-1) (-> gp-0 vec-6)) (let* ((v1-14 (-> gp-0 mat-1)) (a3-3 (-> arg0 node-list data 0 bone transform)) @@ -316,47 +317,47 @@ ) (set! (-> gp-0 vec-4 x) (atan (-> gp-0 vec-3 y) f0-11)) ) - (+! (-> gp-0 vec-4 x) (-> obj aim-rot-offset 0)) - (+! (-> gp-0 vec-4 y) (-> obj aim-rot-offset 1)) + (+! (-> gp-0 vec-4 x) (-> this aim-rot-offset 0)) + (+! (-> gp-0 vec-4 y) (-> this aim-rot-offset 1)) (dotimes (s3-1 2) - (+! (-> obj aim-rot-vel s3-1) + (+! (-> this aim-rot-vel s3-1) (* 5.0 - (- (* 8.0 (if (or (zero? s3-1) (not (logtest? (-> obj flags) (turret-flag no-rot-y-clamp)))) - (- (-> gp-0 vec-4 data s3-1) (-> obj aim-rot s3-1)) - (deg- (-> gp-0 vec-4 data s3-1) (-> obj aim-rot s3-1)) + (- (* 8.0 (if (or (zero? s3-1) (not (logtest? (-> this flags) (turret-flag no-rot-y-clamp)))) + (- (-> gp-0 vec-4 data s3-1) (-> this aim-rot s3-1)) + (deg- (-> gp-0 vec-4 data s3-1) (-> this aim-rot s3-1)) ) ) - (-> obj aim-rot-vel s3-1) + (-> this aim-rot-vel s3-1) ) (-> gp-0 vec-12 x) ) ) - (set! (-> obj aim-rot-vel s3-1) (* (-> obj aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) - (+! (-> obj aim-rot s3-1) (* (-> obj aim-rot-vel s3-1) (-> gp-0 vec-12 x))) - (when (or (zero? s3-1) (not (logtest? (-> obj flags) (turret-flag no-rot-y-clamp)))) - (let ((f0-31 (-> obj info rot-min s3-1))) - (when (< (-> obj aim-rot s3-1) f0-31) - (set! (-> obj aim-rot s3-1) f0-31) - (set! (-> obj aim-rot-vel s3-1) 0.0) + (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) + (+! (-> this aim-rot s3-1) (* (-> this aim-rot-vel s3-1) (-> gp-0 vec-12 x))) + (when (or (zero? s3-1) (not (logtest? (-> this flags) (turret-flag no-rot-y-clamp)))) + (let ((f0-31 (-> this info rot-min s3-1))) + (when (< (-> this aim-rot s3-1) f0-31) + (set! (-> this aim-rot s3-1) f0-31) + (set! (-> this aim-rot-vel s3-1) 0.0) ) ) - (let ((f0-33 (-> obj info rot-max s3-1))) - (when (< f0-33 (-> obj aim-rot s3-1)) - (set! (-> obj aim-rot s3-1) f0-33) - (set! (-> obj aim-rot-vel s3-1) 0.0) + (let ((f0-33 (-> this info rot-max s3-1))) + (when (< f0-33 (-> this aim-rot s3-1)) + (set! (-> this aim-rot s3-1) f0-33) + (set! (-> this aim-rot-vel s3-1) 0.0) ) ) ) ) - (logclear! (-> obj flags) (turret-flag should-shoot)) - (when (and (< (fabs (deg- (-> obj aim-rot-x) (-> gp-0 vec-4 x))) 2912.7112) - (< (fabs (deg- (-> obj aim-rot-y) (-> gp-0 vec-4 y))) 2912.7112) - (< (-> obj target-dist) (-> obj info attack-range)) + (logclear! (-> this flags) (turret-flag should-shoot)) + (when (and (< (fabs (deg- (-> this aim-rot-x) (-> gp-0 vec-4 x))) 2912.7112) + (< (fabs (deg- (-> this aim-rot-y) (-> gp-0 vec-4 y))) 2912.7112) + (< (-> this target-dist) (-> this info attack-range)) ) - (logior! (-> obj flags) (turret-flag should-shoot)) - (when (logtest? (-> obj flags) (turret-flag targetting-laser)) + (logior! (-> this flags) (turret-flag should-shoot)) + (when (logtest? (-> this flags) (turret-flag targetting-laser)) (let* ((v1-88 (-> gp-0 mat-1)) - (a3-5 (-> arg0 node-list data (-> obj info joint-index) bone transform)) + (a3-5 (-> arg0 node-list data (-> this info joint-index) bone transform)) (a0-29 (-> a3-5 quad 0)) (a1-20 (-> a3-5 quad 1)) (a2-5 (-> a3-5 quad 2)) @@ -370,7 +371,7 @@ (set! (-> gp-0 vec-7 quad) (-> gp-0 mat-1 vector 2 quad)) (let ((s3-2 (new 'stack-no-clear 'collide-query))) (set! (-> s3-2 start-pos quad) (-> gp-0 vec-6 quad)) - (vector-float*! (-> s3-2 move-dist) (-> gp-0 vec-7) (-> obj info attack-range)) + (vector-float*! (-> s3-2 move-dist) (-> gp-0 vec-7) (-> this info attack-range)) (let ((v1-93 s3-2)) (set! (-> v1-93 radius) 409.6) (set! (-> v1-93 collide-with) @@ -421,62 +422,62 @@ (none) ) -(defmethod turret-control-method-10 turret-control ((obj turret-control) (arg0 vehicle)) +(defmethod turret-control-method-10 turret-control ((this turret-control) (arg0 vehicle)) (cond - ((logtest? (-> obj flags) (turret-flag should-shoot)) + ((logtest? (-> this flags) (turret-flag should-shoot)) (cond - ((logtest? (-> obj flags) (turret-flag firing)) + ((logtest? (-> this flags) (turret-flag firing)) (cond - ((> (-> obj shot-count) 0) - (if (>= (- (current-time) (-> obj shoot-time)) (the-as time-frame (-> obj guard-settings shot-delay))) - (turret-control-method-17 obj arg0) + ((> (-> this shot-count) 0) + (if (time-elapsed? (-> this shoot-time) (the-as time-frame (-> this guard-settings shot-delay))) + (turret-control-method-17 this arg0) ) ) (else - (logclear! (-> obj flags) (turret-flag firing)) - (+! (-> obj burst-count) 1) - (turret-control-method-13 obj) + (logclear! (-> this flags) (turret-flag firing)) + (+! (-> this burst-count) 1) + (turret-control-method-13 this) ) ) ) (else - (when (and (>= (- (current-time) (-> obj shoot-time)) (the-as time-frame (-> obj guard-settings burst-delay))) - (>= (- (current-time) (-> obj aim-acquire-time)) (the-as time-frame (-> obj guard-settings acquire-delay))) + (when (and (time-elapsed? (-> this shoot-time) (the-as time-frame (-> this guard-settings burst-delay))) + (time-elapsed? (-> this aim-acquire-time) (the-as time-frame (-> this guard-settings acquire-delay))) ) - (set! (-> obj shot-count) - (+ (-> obj guard-settings shot-count) (rand-vu-int-count (+ (-> obj guard-settings rand-shot-count) 1))) + (set! (-> this shot-count) + (+ (-> this guard-settings shot-count) (rand-vu-int-count (+ (-> this guard-settings rand-shot-count) 1))) ) - (logior! (-> obj flags) (turret-flag firing)) + (logior! (-> this flags) (turret-flag firing)) ) ) ) ) (else - (set! (-> obj aim-acquire-time) (current-time)) - (turret-control-method-14 obj) + (set-time! (-> this aim-acquire-time)) + (turret-control-method-14 this) ) ) 0 (none) ) -(defmethod turret-control-method-11 turret-control ((obj turret-control) (arg0 object) (arg1 object) (arg2 vector)) - (when (nonzero? (-> obj info)) - (set! (-> obj inaccuracy) (* 0.000012207031 (+ 20480.0 (vector-length arg2)))) - (turret-control-method-9 obj (the-as vehicle arg0) (the-as vector arg1) arg2) - (turret-control-method-10 obj (the-as vehicle arg0)) +(defmethod turret-control-method-11 turret-control ((this turret-control) (arg0 object) (arg1 object) (arg2 vector)) + (when (nonzero? (-> this info)) + (set! (-> this inaccuracy) (* 0.000012207031 (+ 20480.0 (vector-length arg2)))) + (turret-control-method-9 this (the-as vehicle arg0) (the-as vector arg1) arg2) + (turret-control-method-10 this (the-as vehicle arg0)) ) 0 (none) ) -(defmethod turret-control-method-17 turret-control ((obj turret-control) (arg0 vehicle)) +(defmethod turret-control-method-17 turret-control ((this turret-control) (arg0 vehicle)) (let ((s4-0 (new 'stack-no-clear 'turret-unknown-stack-structure2))) (set! (-> s4-0 proj-params ent) (-> arg0 entity)) (set! (-> s4-0 proj-params charge) 1.0) (set! (-> s4-0 proj-params options) (projectile-options)) (set! (-> s4-0 proj-params notify-handle) (process->handle arg0)) - (set! (-> s4-0 proj-params owner-handle) (process->handle (handle->process (-> obj owner-handle)))) + (set! (-> s4-0 proj-params owner-handle) (process->handle (handle->process (-> this owner-handle)))) (set! (-> s4-0 proj-params ignore-handle) (process->handle arg0)) (let* ((v1-14 *game-info*) (a0-16 (+ (-> v1-14 attack-id) 1)) @@ -486,7 +487,7 @@ ) (set! (-> s4-0 proj-params timeout) (seconds 4)) (let* ((v1-16 (-> s4-0 mat-1)) - (a3-0 (-> arg0 node-list data (-> obj info joint-index) bone transform)) + (a3-0 (-> arg0 node-list data (-> this info joint-index) bone transform)) (a0-20 (-> a3-0 quad 0)) (a1-6 (-> a3-0 quad 1)) (a2-0 (-> a3-0 quad 2)) @@ -497,36 +498,36 @@ (set! (-> v1-16 quad 2) a2-0) (set! (-> v1-16 trans quad) a3-1) ) - (dotimes (s3-0 (-> obj info barrel-count)) - (vector-matrix*! (-> s4-0 vec-1) (the-as vector (-> obj info barrel-array s3-0)) (-> s4-0 mat-1)) + (dotimes (s3-0 (-> this info barrel-count)) + (vector-matrix*! (-> s4-0 vec-1) (the-as vector (-> this info barrel-array s3-0)) (-> s4-0 mat-1)) (set! (-> s4-0 vec-2 quad) (-> s4-0 mat-1 vector 2 quad)) (set! (-> s4-0 proj-params pos quad) (-> s4-0 vec-1 quad)) - (vector-float*! (-> s4-0 proj-params vel) (-> s4-0 vec-2) (-> obj info shot-speed)) + (vector-float*! (-> s4-0 proj-params vel) (-> s4-0 vec-2) (-> this info shot-speed)) (spawn-projectile guard-shot (-> s4-0 proj-params) arg0 *default-dead-pool*) ) ) - (set! (-> obj shoot-time) (current-time)) - (+! (-> obj shot-count) -1) + (set-time! (-> this shoot-time)) + (+! (-> this shot-count) -1) 0 (none) ) -(defmethod turret-control-method-16 turret-control ((obj turret-control) (arg0 float) (arg1 float)) +(defmethod turret-control-method-16 turret-control ((this turret-control) (arg0 float) (arg1 float)) (let ((f0-0 (seconds-per-frame))) - (set! (-> obj aim-rot-vel-x) arg1) - (set! (-> obj aim-rot-vel-y) arg0) + (set! (-> this aim-rot-vel-x) arg1) + (set! (-> this aim-rot-vel-y) arg0) (dotimes (v1-1 2) - (+! (-> obj aim-rot v1-1) (* f0-0 (-> obj aim-rot-vel v1-1))) - (let ((f1-4 (-> obj info rot-min v1-1))) - (when (< (-> obj aim-rot v1-1) f1-4) - (set! (-> obj aim-rot v1-1) f1-4) - (set! (-> obj aim-rot-vel v1-1) 0.0) + (+! (-> this aim-rot v1-1) (* f0-0 (-> this aim-rot-vel v1-1))) + (let ((f1-4 (-> this info rot-min v1-1))) + (when (< (-> this aim-rot v1-1) f1-4) + (set! (-> this aim-rot v1-1) f1-4) + (set! (-> this aim-rot-vel v1-1) 0.0) ) ) - (let ((f1-6 (-> obj info rot-max v1-1))) - (when (< f1-6 (-> obj aim-rot v1-1)) - (set! (-> obj aim-rot v1-1) f1-6) - (set! (-> obj aim-rot-vel v1-1) 0.0) + (let ((f1-6 (-> this info rot-max v1-1))) + (when (< f1-6 (-> this aim-rot v1-1)) + (set! (-> this aim-rot v1-1) f1-6) + (set! (-> this aim-rot-vel v1-1) 0.0) ) ) ) @@ -592,23 +593,23 @@ ) -(defmethod vehicle-guard-method-153 vehicle-guard ((obj vehicle-guard) (arg0 target)) +(defmethod vehicle-guard-method-153 vehicle-guard ((this vehicle-guard) (arg0 target)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans arg0 3) quad)) - (turret-control-method-11 (-> obj turret) obj s5-0 (-> arg0 control transv)) + (turret-control-method-11 (-> this turret) this s5-0 (-> arg0 control transv)) ) 0 (none) ) -(defmethod vehicle-guard-method-151 vehicle-guard ((obj vehicle-guard) (arg0 vehicle-guard-target-data)) - (let ((s5-0 (handle->process (-> obj pursuit-target)))) +(defmethod vehicle-guard-method-151 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) + (let ((s5-0 (handle->process (-> this pursuit-target)))) (set! (-> arg0 target) (the-as target s5-0)) (when s5-0 (set! (-> arg0 tpos quad) (-> (the-as process-drawable s5-0) root trans quad)) - (set! (-> arg0 spos quad) (-> obj root trans quad)) + (set! (-> arg0 spos quad) (-> this root trans quad)) (set! (-> arg0 tvel quad) (-> (the-as process-drawable s5-0) root transv quad)) - (set! (-> arg0 svel quad) (-> obj root transv quad)) + (set! (-> arg0 svel quad) (-> this root transv quad)) (vector-normalize-copy! (-> arg0 tdir) (-> arg0 tvel) 1.0) (vector-normalize-copy! (-> arg0 sdir) (-> arg0 svel) 1.0) (+! (-> arg0 tpos y) 4096.0) @@ -632,13 +633,13 @@ (none) ) -(defmethod vehicle-guard-method-152 vehicle-guard ((obj vehicle-guard) (arg0 vehicle-guard-target-data)) - (let ((s4-0 (handle->process (-> obj pursuit-target)))) +(defmethod vehicle-guard-method-152 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) + (let ((s4-0 (handle->process (-> this pursuit-target)))) (cond - ((logtest? (rigid-body-object-flag target-in-sight) (-> obj flags)) - (logclear! (-> obj controller flags) (vehicle-controller-flag direct-mode)) + ((logtest? (rigid-body-object-flag target-in-sight) (-> this flags)) + (logclear! (-> this controller flags) (vehicle-controller-flag direct-mode)) (when (>= (- (vector-dot (-> arg0 to-target-dir) (-> arg0 tdir))) (cos 21845.334)) - (logior! (-> obj controller flags) (vehicle-controller-flag direct-mode)) + (logior! (-> this controller flags) (vehicle-controller-flag direct-mode)) (vector-! (-> arg0 temp) (-> arg0 svel) (-> arg0 tvel)) (let* ((f2-0 (vector-dot (-> arg0 temp) (-> arg0 to-target-dir))) (f0-5 (fmax 0.0 (fmin 1.0 (/ (-> arg0 dist) (fmax 4096.0 f2-0))))) @@ -656,23 +657,23 @@ ) ) ) - (vehicle-controller-method-19 (-> obj controller) (-> arg0 spos) #x43cccccd (-> arg0 tpos) (-> arg0 tvel)) - (vector-! (-> arg0 to-target) (-> obj controller target-point) (-> arg0 spos)) + (vehicle-controller-method-19 (-> this controller) (-> arg0 spos) #x43cccccd (-> arg0 tpos) (-> arg0 tvel)) + (vector-! (-> arg0 to-target) (-> this controller target-point) (-> arg0 spos)) (vector-normalize-copy! (-> arg0 to-target-dir) (-> arg0 to-target) 1.0) (cond ((< -12288.0 (- (-> arg0 tpos y) (-> arg0 spos y))) - (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others no-slowing-for-turns)) - (let* ((f0-9 (* 2.0 (-> obj info max-xz-speed))) + (logior! (-> this controller flags) (vehicle-controller-flag ignore-others no-slowing-for-turns)) + (let* ((f0-9 (* 2.0 (-> this info max-xz-speed))) (f1-8 (fmax 0.0 (vector-dot (-> arg0 sdir) (-> arg0 to-target-dir)))) (f0-10 (* f0-9 (* f1-8 f1-8))) ) - (+! (-> obj controller target-speed) f0-10) + (+! (-> this controller target-speed) f0-10) ) ) (else - (logclear! (-> obj controller flags) (vehicle-controller-flag ignore-others no-slowing-for-turns)) - (let ((f0-13 (* (-> obj info max-xz-speed) (fmax 0.0 (vector-dot (-> arg0 sdir) (-> arg0 to-target-dir)))))) - (+! (-> obj controller target-speed) f0-13) + (logclear! (-> this controller flags) (vehicle-controller-flag ignore-others no-slowing-for-turns)) + (let ((f0-13 (* (-> this info max-xz-speed) (fmax 0.0 (vector-dot (-> arg0 sdir) (-> arg0 to-target-dir)))))) + (+! (-> this controller target-speed) f0-13) ) ) ) @@ -685,79 +686,79 @@ (none) ) -(defmethod vehicle-guard-method-150 vehicle-guard ((obj vehicle-guard)) +(defmethod vehicle-guard-method-150 vehicle-guard ((this vehicle-guard)) (cond - ((handle->process (-> obj pursuit-target)) + ((handle->process (-> this pursuit-target)) (let ((v1-3 (new 'stack-no-clear 'vehicle-control-point))) - (set! (-> v1-3 local-pos quad) (-> obj root trans quad)) + (set! (-> v1-3 local-pos quad) (-> this root trans quad)) (let ((v1-4 (traffic-engine-method-49 - (-> obj controller traffic) + (-> this controller traffic) (-> v1-3 local-pos) - (-> obj traffic-priority-id) - (the-as traffic-target-status (&-> obj traffic-target-status)) + (-> this traffic-priority-id) + (the-as traffic-target-status (&-> this traffic-target-status)) ) ) ) (when (logtest? (-> v1-4 flags) (traffic-target-flag updated)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag target-in-sight))) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag target-in-sight))) ) (when (logtest? (-> v1-4 flags) (traffic-target-flag visible-now)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag target-in-sight) (-> obj flags))) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag target-in-sight) (-> this flags))) ) - (set! (-> obj target-in-sight-time) (current-time)) + (set-time! (-> this target-in-sight-time)) ) ) - (set! (-> obj target-flags) (the-as turret-flag (-> v1-4 flags))) + (set! (-> this target-flags) (the-as turret-flag (-> v1-4 flags))) ) ) - (when (not (logtest? (rigid-body-object-flag in-pursuit) (-> obj flags))) - (if (logtest? (rigid-body-object-flag target-in-sight) (-> obj flags)) - (vehicle-method-108 obj) + (when (not (logtest? (rigid-body-object-flag in-pursuit) (-> this flags))) + (if (logtest? (rigid-body-object-flag target-in-sight) (-> this flags)) + (vehicle-method-108 this) ) ) ) (else - (vehicle-method-109 obj) + (vehicle-method-109 this) ) ) - (let ((v1-22 (if (logtest? (rigid-body-object-flag in-pursuit) (-> obj flags)) - (-> obj draw lod-set lod 1 geo) - (-> obj lod2) + (let ((v1-22 (if (logtest? (rigid-body-object-flag in-pursuit) (-> this flags)) + (-> this draw lod-set lod 1 geo) + (-> this lod2) ) ) ) - (when (!= v1-22 (-> obj draw lod-set lod 2 geo)) - (set! (-> obj draw lod-set lod 2 geo) (the-as merc-ctrl v1-22)) - (set! (-> obj draw cur-lod) -1) - (lod-set! (-> obj draw) (-> obj draw desired-lod)) + (when (!= v1-22 (-> this draw lod-set lod 2 geo)) + (set! (-> this draw lod-set lod 2 geo) (the-as merc-ctrl v1-22)) + (set! (-> this draw cur-lod) -1) + (lod-set! (-> this draw) (-> this draw desired-lod)) ) ) 0 (none) ) -(defmethod vehicle-guard-method-155 vehicle-guard ((obj vehicle-guard) (arg0 vector) (arg1 vector)) +(defmethod vehicle-guard-method-155 vehicle-guard ((this vehicle-guard) (arg0 vector) (arg1 vector)) (cond (#f (let ((s5-0 (new 'stack-no-clear 'traj3d-params))) (let ((f0-2 (+ 0.5 (* 0.5 (rand-vu))))) - (set! (-> s5-0 src quad) (-> obj root trans quad)) + (set! (-> s5-0 src quad) (-> this root trans quad)) (vector+float*! (-> s5-0 dest) arg0 arg1 f0-2) ) (set! (-> s5-0 initial-tilt) 8192.0) (set! (-> s5-0 gravity) 184320.0) (when (traj3d-calc-initial-velocity-using-tilt s5-0) (let ((a1-1 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> a1-1 ent) (-> obj entity)) + (set! (-> a1-1 ent) (-> this entity)) (set! (-> a1-1 charge) 1.0) (set! (-> a1-1 options) (projectile-options)) (set! (-> a1-1 pos quad) (-> s5-0 src quad)) (set! (-> a1-1 vel quad) (-> s5-0 initial-velocity quad)) (set! (-> a1-1 notify-handle) (the-as handle #f)) (set! (-> a1-1 owner-handle) (the-as handle #f)) - (set! (-> a1-1 ignore-handle) (process->handle obj)) + (set! (-> a1-1 ignore-handle) (process->handle this)) (let* ((v1-15 *game-info*) (a0-14 (+ (-> v1-15 attack-id) 1)) ) @@ -765,10 +766,10 @@ (set! (-> a1-1 attack-id) a0-14) ) (set! (-> a1-1 timeout) (seconds 4)) - (spawn-projectile vehicle-grenade a1-1 obj *default-dead-pool*) + (spawn-projectile vehicle-grenade a1-1 this *default-dead-pool*) ) (let ((a1-2 (new 'stack-no-clear 'traffic-danger-info))) - (set! (-> a1-2 sphere quad) (-> obj root trans quad)) + (set! (-> a1-2 sphere quad) (-> this root trans quad)) (set! (-> a1-2 sphere r) 40960.0) (set! (-> a1-2 velocity quad) (-> s5-0 initial-velocity quad)) (set! (-> a1-2 notify-radius) 122880.0) @@ -777,22 +778,22 @@ (set! (-> a1-2 flags) (traffic-danger-flags tdf0)) (set! (-> a1-2 danger-type) (traffic-danger-type tdt6)) (set! (-> a1-2 handle) (the-as handle #f)) - (add-danger (-> obj controller traffic) a1-2) + (add-danger (-> this controller traffic) a1-2) ) ) ) ) (else (let ((s5-1 (new 'stack-no-clear 'turret-unknown-stack-structure2))) - (set! (-> s5-1 mat-1 quad 0) (-> obj root trans quad)) + (set! (-> s5-1 mat-1 quad 0) (-> this root trans quad)) (vector-! (-> s5-1 mat-1 vector 1) arg0 (the-as vector (-> s5-1 mat-1))) (vector-normalize! (-> s5-1 mat-1 vector 1) 1.0) - (set! (-> s5-1 proj-params ent) (-> obj entity)) + (set! (-> s5-1 proj-params ent) (-> this entity)) (set! (-> s5-1 proj-params charge) 1.0) (set! (-> s5-1 proj-params options) (projectile-options)) - (set! (-> s5-1 proj-params notify-handle) (process->handle obj)) + (set! (-> s5-1 proj-params notify-handle) (process->handle this)) (set! (-> s5-1 proj-params owner-handle) (the-as handle #f)) - (set! (-> s5-1 proj-params ignore-handle) (process->handle obj)) + (set! (-> s5-1 proj-params ignore-handle) (process->handle this)) (let* ((v1-38 *game-info*) (a0-36 (+ (-> v1-38 attack-id) 1)) ) @@ -802,7 +803,7 @@ (set! (-> s5-1 proj-params timeout) (seconds 4)) (vector+float*! (-> s5-1 proj-params pos) (the-as vector (-> s5-1 mat-1)) (-> s5-1 mat-1 vector 1) 16384.0) (vector-float*! (-> s5-1 proj-params vel) (-> s5-1 mat-1 vector 1) 819200.0) - (spawn-projectile guard-shot (-> s5-1 proj-params) obj *default-dead-pool*) + (spawn-projectile guard-shot (-> s5-1 proj-params) this *default-dead-pool*) ) ) ) @@ -810,94 +811,98 @@ (none) ) -(defmethod vehicle-method-134 vehicle-guard ((obj vehicle-guard) (arg0 process)) +(defmethod vehicle-method-134 vehicle-guard ((this vehicle-guard) (arg0 process)) "Stubbed" - (set! (-> obj pursuit-target) (process->handle arg0)) - (logior! (-> obj flags) (rigid-body-object-flag alert)) - (vehicle-method-111 obj 2 (the-as target arg0)) + (set! (-> this pursuit-target) (process->handle arg0)) + (logior! (-> this flags) (rigid-body-object-flag alert)) + (vehicle-method-111 this 2 (the-as target arg0)) 0 (none) ) ;; WARN: disable def twice: 112. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod rigid-body-object-method-46 vehicle-guard ((obj vehicle-guard) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 vehicle-guard ((this vehicle-guard) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-impulse) (let ((s5-1 (the-as matrix (-> arg3 param 0)))) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (when (not (logtest? (-> this flags) (rigid-body-object-flag player-driving))) (let ((a1-2 (find-offending-process-focusable arg0 (the-as attack-info #f)))) (when a1-2 (cond - ((logtest? (rigid-body-object-flag in-pursuit) (-> obj flags)) - (if (= (handle->process (-> obj pursuit-target)) a1-2) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag rammed-target) (-> obj flags))) + ((logtest? (rigid-body-object-flag in-pursuit) (-> this flags)) + (if (= (handle->process (-> this pursuit-target)) a1-2) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag rammed-target) (-> this flags))) ) ) ) (else - (if (and (< (* 49152.0 (-> obj info info mass)) (-> s5-1 trans x)) + (if (and (< (* 49152.0 (-> this info info mass)) (-> s5-1 trans x)) (logtest? (-> a1-2 mask) (process-mask target)) ) - (vehicle-method-134 obj a1-2) + (vehicle-method-134 this a1-2) ) ) ) ) ) ) - (rigid-body-object-method-42 obj) - (rigid-body-object-method-45 obj (the-as rigid-body-impact s5-1)) + (rigid-body-object-method-42 this) + (rigid-body-object-method-45 this (the-as rigid-body-impact s5-1)) ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (go (method-of-object obj waiting)) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (go (method-of-object this waiting)) ) ) (('track) - (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (not (logtest? (-> this flags) (rigid-body-object-flag player-driving))) ) (('alert-begin) - (when (and (not (focus-test? obj dead)) - (not (logtest? (rigid-body-object-flag alert) (-> obj flags))) - (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) - (>= (the-as uint (get-alert-level (-> obj controller traffic))) (the-as uint 2)) + (when (and (not (focus-test? this dead)) + (not (logtest? (rigid-body-object-flag alert) (-> this flags))) + (logtest? (rigid-body-object-flag ai-driving) (-> this flags)) + (>= (the-as uint (get-alert-level (-> this controller traffic))) (the-as uint 2)) ) - (logior! (-> obj flags) (rigid-body-object-flag alert)) + (logior! (-> this flags) (rigid-body-object-flag alert)) (let ((v0-4 (the-as object (process->handle (the-as process (-> arg3 param 0)))))) - (set! (-> obj pursuit-target) (the-as handle v0-4)) + (set! (-> this pursuit-target) (the-as handle v0-4)) v0-4 ) ) ) (('alert-end) - (when (not (focus-test? obj dead)) - (when (logtest? (rigid-body-object-flag alert) (-> obj flags)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag persistent alert in-pursuit))) + (when (not (focus-test? this dead)) + (when (logtest? (rigid-body-object-flag alert) (-> this flags)) + (set! (-> this flags) (the-as + rigid-body-object-flag + (logclear (-> this flags) (rigid-body-object-flag persistent alert in-pursuit)) + ) ) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-5)) - (vehicle-method-109 obj) - (go (method-of-object obj active)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-5)) + (vehicle-method-109 this) + (go (method-of-object this active)) ) ) ) (('end-pursuit) - (when (logtest? (rigid-body-object-flag alert) (-> obj flags)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag persistent alert in-pursuit))) + (when (logtest? (rigid-body-object-flag alert) (-> this flags)) + (set! (-> this flags) (the-as + rigid-body-object-flag + (logclear (-> this flags) (rigid-body-object-flag persistent alert in-pursuit)) + ) ) - (vehicle-method-109 obj) - (go (method-of-object obj active)) + (vehicle-method-109 this) + (go (method-of-object this active)) ) ) (else - ((method-of-type vehicle rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) + ((method-of-type vehicle rigid-body-object-method-46) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod vehicle-method-137 vehicle-guard ((obj vehicle-guard) (arg0 traffic-object-spawn-params)) - (vehicle-rider-spawn obj crimson-guard-rider arg0) +(defmethod vehicle-method-137 vehicle-guard ((this vehicle-guard) (arg0 traffic-object-spawn-params)) + (vehicle-rider-spawn this crimson-guard-rider arg0) 0 (none) ) @@ -943,73 +948,73 @@ ) ) -(defmethod alloc-and-init-rigid-body-control vehicle-guard ((obj vehicle-guard) (arg0 rigid-body-vehicle-constants)) +(defmethod alloc-and-init-rigid-body-control vehicle-guard ((this vehicle-guard) (arg0 rigid-body-vehicle-constants)) (let ((t9-0 (method-of-type vehicle alloc-and-init-rigid-body-control))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (logior! (-> obj mask) (process-mask enemy guard)) - (set! (-> obj pursuit-target) (the-as handle #f)) - (set! (-> obj minimap) #f) - (set! (-> obj lod2) (the-as symbol (-> obj draw lod-set lod 2 geo))) - (set! (-> obj controller choose-branch-callback) vehicle-guard-choose-branch) + (logior! (-> this mask) (process-mask enemy guard)) + (set! (-> this pursuit-target) (the-as handle #f)) + (set! (-> this minimap) #f) + (set! (-> this lod2) (the-as symbol (-> this draw lod-set lod 2 geo))) + (set! (-> this controller choose-branch-callback) vehicle-guard-choose-branch) 0 (none) ) ;; WARN: Return type mismatch traffic-guard-type-settings vs none. -(defmethod vehicle-method-82 vehicle-guard ((obj vehicle-guard)) +(defmethod vehicle-method-82 vehicle-guard ((this vehicle-guard)) (let ((t9-0 (method-of-type vehicle vehicle-method-82))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj turret guard-settings) - (get-traffic-guard-type-settings (-> obj controller traffic) (the-as int (-> obj info guard-type))) + (set! (-> this turret guard-settings) + (get-traffic-guard-type-settings (-> this controller traffic) (the-as int (-> this info guard-type))) ) (none) ) -(defmethod vehicle-method-128 vehicle-guard ((obj vehicle-guard)) - (if (not (-> obj minimap)) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 14) (the-as int #f) (the-as vector #t) 0)) +(defmethod vehicle-method-128 vehicle-guard ((this vehicle-guard)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 14) (the-as int #f) (the-as vector #t) 0)) ) - ((method-of-type vehicle vehicle-method-128) obj) + ((method-of-type vehicle vehicle-method-128) this) (none) ) -(defmethod vehicle-method-127 vehicle-guard ((obj vehicle-guard)) - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) +(defmethod vehicle-method-127 vehicle-guard ((this vehicle-guard)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) - ((method-of-type vehicle vehicle-method-127) obj) + ((method-of-type vehicle vehicle-method-127) this) (none) ) -(defmethod vehicle-method-129 vehicle-guard ((obj vehicle-guard)) - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) +(defmethod vehicle-method-129 vehicle-guard ((this vehicle-guard)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) - ((method-of-type vehicle vehicle-method-129) obj) + ((method-of-type vehicle vehicle-method-129) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-130 vehicle-guard ((obj vehicle-guard) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-130 vehicle-guard ((this vehicle-guard) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((9) - (vehicle-method-128 obj) - (logior! (-> obj flags) (rigid-body-object-flag persistent alert)) - (set! (-> obj pursuit-target) (-> arg0 handle)) - (go (method-of-object obj waiting-ambush)) + (vehicle-method-128 this) + (logior! (-> this flags) (rigid-body-object-flag persistent alert)) + (set! (-> this pursuit-target) (-> arg0 handle)) + (go (method-of-object this waiting-ambush)) ) (else - ((method-of-type vehicle vehicle-method-130) obj arg0) + ((method-of-type vehicle vehicle-method-130) this arg0) ) ) (none) ) -(defmethod vehicle-guard-method-157 vehicle-guard ((obj vehicle-guard) (arg0 vehicle-guard-target-data)) +(defmethod vehicle-guard-method-157 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) (local-vars (v1-11 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1017,9 +1022,9 @@ (vf2 :class vf) ) (init-vf0-vector) - (and (logtest? (rigid-body-object-flag target-in-sight) (-> obj flags)) + (and (logtest? (rigid-body-object-flag target-in-sight) (-> this flags)) (or (and (not (logtest? (focus-status pilot) (-> arg0 target focus-status))) (< (-> arg0 dist) 184320.0)) - (and (< (-> arg0 tpos y) (+ -16384.0 (-> obj root trans y))) + (and (< (-> arg0 tpos y) (+ -16384.0 (-> this root trans y))) (begin (.lvf vf1 (&-> (-> arg0 tvel) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -1041,95 +1046,95 @@ ) ) -(defmethod vehicle-guard-method-156 vehicle-guard ((obj vehicle-guard)) +(defmethod vehicle-guard-method-156 vehicle-guard ((this vehicle-guard)) (let ((f30-0 (seconds-per-frame))) - (seek! (-> obj controls throttle) 0.0 (* 4.0 f30-0)) - (+! (-> obj controls brake) (* (- 1.0 (-> obj controls brake)) (fmin 1.0 (* 8.0 f30-0)))) - (let ((s4-0 (-> obj rbody state matrix)) - (s3-0 (-> obj rbody state matrix vector 2)) + (seek! (-> this controls throttle) 0.0 (* 4.0 f30-0)) + (+! (-> this controls brake) (* (- 1.0 (-> this controls brake)) (fmin 1.0 (* 8.0 f30-0)))) + (let ((s4-0 (-> this rbody state matrix)) + (s3-0 (-> this rbody state matrix vector 2)) (s5-0 (new 'stack-no-clear 'vector)) ) (vector-reset! s5-0) - (let ((v1-9 (handle->process (-> obj pursuit-target))) + (let ((v1-9 (handle->process (-> this pursuit-target))) (f28-0 0.0) ) - (when (and v1-9 (logtest? (rigid-body-object-flag target-in-sight) (-> obj flags))) - (vector-! s5-0 (-> (the-as process-drawable v1-9) root trans) (-> obj root trans)) + (when (and v1-9 (logtest? (rigid-body-object-flag target-in-sight) (-> this flags))) + (vector-! s5-0 (-> (the-as process-drawable v1-9) root trans) (-> this root trans)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) (if (< (vector-dot s3-0 s5-0) (cos 2730.6667)) (set! f28-0 (vector-dot (the-as vector s4-0) s5-0)) ) ) - (+! (-> obj controls steering) (* (- f28-0 (-> obj controls steering)) (fmin 1.0 (* 8.0 f30-0)))) + (+! (-> this controls steering) (* (- f28-0 (-> this controls steering)) (fmin 1.0 (* 8.0 f30-0)))) ) ) ) - (when (zero? (-> obj flight-level-index)) - (if (logtest? (-> obj flags) (rigid-body-object-flag riding)) - (vehicle-method-80 obj) + (when (zero? (-> this flight-level-index)) + (if (logtest? (-> this flags) (rigid-body-object-flag riding)) + (vehicle-method-80 this) ) ) 0 (none) ) -(defmethod vehicle-guard-method-154 vehicle-guard ((obj vehicle-guard)) - (if (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) - (rigid-body-object-method-38 obj) +(defmethod vehicle-guard-method-154 vehicle-guard ((this vehicle-guard)) + (if (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) + (rigid-body-object-method-38 this) ) - (set! (-> obj camera-dist2) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (vehicle-controller-method-18 - (-> obj controller) - (-> obj target-acceleration) - (-> obj root transv) - obj + (-> this controller) + (-> this target-acceleration) + (-> this root transv) + this (/ 1.0 (seconds-per-frame)) ) - ((-> obj ai-hook) obj) - (vehicle-method-121 obj) - (vehicle-method-106 obj) - (when (not (logtest? (rigid-body-object-flag in-pursuit) (-> obj flags))) - (if (not (logtest? (-> obj target-flags) (turret-flag aiming))) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-2)) + ((-> this ai-hook) this) + (vehicle-method-121 this) + (vehicle-method-106 this) + (when (not (logtest? (rigid-body-object-flag in-pursuit) (-> this flags))) + (if (not (logtest? (-> this target-flags) (turret-flag aiming))) + (speech-control-method-12 *speech-control* this (speech-type speech-type-2)) ) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) 0 (none) ) -(defmethod vehicle-guard-method-158 vehicle-guard ((obj vehicle-guard)) - (vehicle-guard-method-150 obj) +(defmethod vehicle-guard-method-158 vehicle-guard ((this vehicle-guard)) + (vehicle-guard-method-150 this) (let ((s5-0 (new 'stack-no-clear 'vehicle-guard-target-data))) - (vehicle-guard-method-151 obj s5-0) + (vehicle-guard-method-151 this s5-0) (let ((a1-1 (-> s5-0 target))) (when a1-1 (cond - ((logtest? (rigid-body-object-flag target-in-sight) (-> obj flags)) - (vehicle-guard-method-153 obj a1-1) - (speech-control-method-15 *speech-control* obj) + ((logtest? (rigid-body-object-flag target-in-sight) (-> this flags)) + (vehicle-guard-method-153 this a1-1) + (speech-control-method-15 *speech-control* this) ) (else - (if (and (>= (- (current-time) (-> obj target-in-sight-time)) (seconds 4)) (< 368640.0 (-> s5-0 dist))) - (vehicle-method-109 obj) + (if (and (time-elapsed? (-> this target-in-sight-time) (seconds 4)) (< 368640.0 (-> s5-0 dist))) + (vehicle-method-109 this) ) ) ) ) ) ) - (if (not (logtest? (rigid-body-object-flag in-pursuit) (-> obj flags))) - (go (method-of-object obj active)) + (if (not (logtest? (rigid-body-object-flag in-pursuit) (-> this flags))) + (go (method-of-object this active)) ) - (rigid-body-object-method-42 obj) - (vehicle-method-122 obj) + (rigid-body-object-method-42 this) + (vehicle-method-122 this) 0 (none) ) -(defmethod vehicle-method-94 vehicle-guard ((obj vehicle-guard)) +(defmethod vehicle-method-94 vehicle-guard ((this vehicle-guard)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1140,7 +1145,7 @@ (init-vf0-vector) (let ((v1-0 (new 'stack-no-clear 'camera-free-floating-move-info))) (let* ((a0-1 (-> v1-0 tm)) - (t0-0 (-> obj rbody state matrix)) + (t0-0 (-> this rbody state matrix)) (a1-1 (-> t0-0 quad 0)) (a2-0 (-> t0-0 quad 1)) (a3-0 (-> t0-0 quad 2)) @@ -1152,7 +1157,7 @@ (set! (-> a0-1 trans quad) t0-1) ) (let ((a0-2 (-> v1-0 rv))) - (let ((a1-3 (-> obj rbody state position))) + (let ((a1-3 (-> this rbody state position))) (let ((a2-1 (-> v1-0 tm vector 2))) (let ((a3-2 163840.0)) (.mov vf7 a3-2) @@ -1167,17 +1172,17 @@ (.svf (&-> a0-2 quad) vf6) ) (vector-reset! (-> v1-0 up)) - (set! (-> obj turret inaccuracy) 0.0) - (turret-control-method-9 (-> obj turret) obj (-> v1-0 rv) (-> v1-0 up)) + (set! (-> this turret inaccuracy) 0.0) + (turret-control-method-9 (-> this turret) this (-> v1-0 rv) (-> v1-0 up)) ) (when (cpad-hold? 0 r1) - (when (>= (- (current-time) (-> obj turret shoot-time)) (seconds 0.35)) - (set! (-> obj turret owner-handle) (process->handle *target*)) - (turret-control-method-17 (-> obj turret) obj) - (set! (-> obj turret owner-handle) (the-as handle #f)) + (when (time-elapsed? (-> this turret shoot-time) (seconds 0.35)) + (set! (-> this turret owner-handle) (process->handle *target*)) + (turret-control-method-17 (-> this turret) this) + (set! (-> this turret owner-handle) (the-as handle #f)) ) ) - ((method-of-type vehicle vehicle-method-94) obj) + ((method-of-type vehicle vehicle-method-94) this) 0 (none) ) @@ -1218,9 +1223,9 @@ (go-virtual hostile) ) (speech-control-method-12 *speech-control* self (speech-type speech-type-4)) - (if (or (>= (- (current-time) (-> self state-time)) (seconds 8)) (let ((f0-0 409600.0)) - (< (* f0-0 f0-0) (-> self player-dist2)) - ) + (if (or (time-elapsed? (-> self state-time) (seconds 8)) (let ((f0-0 409600.0)) + (< (* f0-0 f0-0) (-> self player-dist2)) + ) ) (logclear! (-> self flags) (rigid-body-object-flag persistent alert)) ) @@ -1245,9 +1250,9 @@ :post (behavior () (vehicle-guard-method-150 self) (when (logtest? (rigid-body-object-flag in-pursuit) (-> self flags)) - (if (or (>= (- (current-time) (-> self target-in-sight-time)) (seconds 8)) + (if (or (time-elapsed? (-> self target-in-sight-time) (seconds 8)) (and (>= (-> self controller traffic alert-state guards-in-sight-of-target) 2) - (>= (- (current-time) (-> self target-in-sight-time)) (seconds 0.5)) + (time-elapsed? (-> self target-in-sight-time) (seconds 0.5)) ) ) (vehicle-method-109 self) @@ -1313,7 +1318,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self ai-hook) (method-of-object self vehicle-guard-method-156)) ) :trans #f @@ -1326,7 +1331,7 @@ (when gp-0 (when (or (< (-> s5-0 attack-range) (-> s5-0 dist)) (not (logtest? (rigid-body-object-flag target-in-sight) (-> self flags))) - (>= (- (current-time) (-> self state-time)) (seconds 2)) + (time-elapsed? (-> self state-time) (seconds 2)) ) (set! (-> self flags) (the-as rigid-body-object-flag (logclear (-> self flags) (rigid-body-object-flag rammed-target))) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc index f0fe8d93af..aeda59fddb 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-physics.gc @@ -7,12 +7,12 @@ ;; DECOMP BEGINS -(defmethod vehicle-method-99 vehicle ((obj vehicle) (arg0 float)) +(defmethod vehicle-method-99 vehicle ((this vehicle) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'vehicle-grab-rail-info)) - (s3-0 (-> obj root root-prim)) + (s3-0 (-> this root root-prim)) (s2-0 1) ) - (when (< (-> obj rbody state position y) (+ (-> obj water-height) (-> s3-0 local-sphere w))) + (when (< (-> this rbody state position y) (+ (-> this water-height) (-> s3-0 local-sphere w))) (when (= (-> s3-0 prim-core prim-type) (prim-type group)) (let ((v1-5 (the-as collide-shape-prim-group s3-0))) (set! s3-0 (-> v1-5 child 0)) @@ -24,15 +24,15 @@ (let* ((s0-0 (-> s3-0 prim-core)) (f0-2 (- (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))) ) - (when (< f0-2 (-> obj water-height)) + (when (< f0-2 (-> this water-height)) (set! (-> s4-0 local-pos 0 quad) (-> s0-0 world-sphere quad)) - (let ((f1-5 (fmin (-> obj water-height) (+ (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))))) + (let ((f1-5 (fmin (-> this water-height) (+ (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))))) 0.0 - (let* ((f2-5 (fmax -1.0 (fmin 1.0 (/ (- (-> obj water-height) (-> s0-0 world-sphere y)) (-> s0-0 world-sphere w))))) + (let* ((f2-5 (fmax -1.0 (fmin 1.0 (/ (- (-> this water-height) (-> s0-0 world-sphere y)) (-> s0-0 world-sphere w))))) (f30-0 (+ 0.5 (* -0.25 f2-5 f2-5 f2-5) (* 0.75 f2-5))) ) (set! (-> s4-0 local-pos 0 y) (* 0.5 (+ f0-2 f1-5))) - (let ((v1-18 (-> obj rbody)) + (let ((v1-18 (-> this rbody)) (a1-1 (-> s4-0 local-pos)) (a2-0 (-> s4-0 normal)) ) @@ -43,11 +43,11 @@ (f0-8 (* f0-7 (* f1-8 f1-8))) (f1-11 4096.0) (f1-13 (* f1-11 f1-11)) - (f0-10 (fmin (* f0-8 (/ 1.0 f1-13)) (/ (-> obj info info mass) (* 2.0 arg0 (the float s2-0))))) + (f0-10 (fmin (* f0-8 (/ 1.0 f1-13)) (/ (-> this info info mass) (* 2.0 arg0 (the float s2-0))))) ) (vector-float*! (-> s4-0 local-pos 1) (-> s4-0 normal) (* -1.0 f0-10)) ) - (let ((v1-34 (-> obj rbody)) + (let ((v1-34 (-> this rbody)) (a1-3 (-> s4-0 local-pos)) (a2-1 (-> s4-0 local-pos 1)) ) @@ -58,14 +58,14 @@ (f1-19 4096.0) (f2-13 4096.0) (f1-20 (* f1-19 (* f2-13 f2-13))) - (f0-16 (* f0-12 (/ 1.0 f1-20) (-> obj info buoyancy-factor) f30-0 (-> s0-0 world-sphere w))) + (f0-16 (* f0-12 (/ 1.0 f1-20) (-> this info buoyancy-factor) f30-0 (-> s0-0 world-sphere w))) (f1-25 (-> s0-0 world-sphere w)) ) (set! (-> s4-0 local-pos 1 y) (* f0-16 (* f1-25 f1-25))) ) ) ) - (let ((v1-46 (-> obj rbody)) + (let ((v1-46 (-> this rbody)) (a1-4 (-> s4-0 local-pos)) (a2-2 (-> s4-0 local-pos 1)) ) @@ -127,7 +127,7 @@ ) -(defmethod vehicle-method-100 vehicle ((obj vehicle) (arg0 float) (arg1 vehicle-physics-work)) +(defmethod vehicle-method-100 vehicle ((this vehicle) (arg0 float) (arg1 vehicle-physics-work)) (local-vars (v1-81 float) (v1-184 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -139,10 +139,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (+! (-> obj physics-counter) 1) - (let ((s3-0 (-> obj rbody))) + (+! (-> this physics-counter) 1) + (let ((s3-0 (-> this rbody))) (mem-copy! (the-as pointer (-> arg1 mat)) (the-as pointer (-> s3-0 state matrix)) 64) - (let* ((f28-0 (* -1.0 (-> obj controls steering) (-> obj info tire-steering-angle))) + (let* ((f28-0 (* -1.0 (-> this controls steering) (-> this info tire-steering-angle))) (f30-0 (cos f28-0)) (f0-2 (sin f28-0)) ) @@ -151,18 +151,18 @@ (set! (-> arg1 steering-axis z) f0-2) ) (vector-rotate*! (-> arg1 steering-axis) (-> arg1 steering-axis) (-> arg1 mat)) - (logior! (-> obj flags) (rigid-body-object-flag in-air)) - (logclear! (-> obj flags) (rigid-body-object-flag on-ground on-flight-level)) + (logior! (-> this flags) (rigid-body-object-flag in-air)) + (logclear! (-> this flags) (rigid-body-object-flag on-ground on-flight-level)) (vector-reset! (-> arg1 ground-normal)) (set! (-> arg1 ground-normal y) 1.0) - (let ((f30-1 (-> obj info ground-probe-distance))) + (let ((f30-1 (-> this info ground-probe-distance))) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (vector-reset! (-> arg1 lift-dir)) (set! (-> arg1 lift-dir y) -1.0) (set! (-> arg1 speed-factor) (fmax 0.0 (fmin 0.9 (* 0.000008138021 (+ -40960.0 (vector-length (-> s3-0 state lin-velocity)))))) ) - (when (logtest? (-> obj info flags) 1) + (when (logtest? (-> this info flags) 1) (vector-float*! (-> arg1 tmp) (-> arg1 mat vector 1) -1.0) (let ((t9-4 vector-lerp!) (a0-7 (-> arg1 lift-dir)) @@ -194,8 +194,8 @@ (set! (-> v1-28 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) (set! (-> v1-28 action-mask) (collide-action solid)) ) - (dotimes (s1-0 (-> obj info lift-thruster-count)) - (let ((v1-31 (-> obj info lift-thruster-array s1-0)) + (dotimes (s1-0 (-> this info lift-thruster-count)) + (let ((v1-31 (-> this info lift-thruster-array s1-0)) (s0-0 (-> arg1 probe-work-array s1-0)) ) (vector-reset! (-> s0-0 tire-force)) @@ -205,7 +205,7 @@ (let ((a1-9 (-> s0-0 probe-pos))) (let ((v1-34 (-> s0-0 world-pos))) (let ((a0-22 (-> arg1 mat vector 1))) - (let ((a2-6 (-> obj info ground-probe-offset))) + (let ((a2-6 (-> this info ground-probe-offset))) (.mov vf7 a2-6) ) (.lvf vf5 (&-> a0-22 quad)) @@ -234,13 +234,13 @@ (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) (set! (-> s0-0 ground-pos y) 0.0) (vector-reset! (-> s0-0 ground-normal)) - (when (logtest? (-> obj flags) (rigid-body-object-flag enable-collision)) + (when (logtest? (-> this flags) (rigid-body-object-flag enable-collision)) (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) (cond ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) - (logclear! (-> obj flags) (rigid-body-object-flag in-air)) - (logior! (-> obj flags) (rigid-body-object-flag on-ground)) + (logclear! (-> this flags) (rigid-body-object-flag in-air)) + (logior! (-> this flags) (rigid-body-object-flag on-ground)) (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) @@ -255,23 +255,23 @@ ) ) ) - (set! (-> obj lift-thrust 0) 0.0) - (set! (-> obj lift-thrust 1) 0.0) - (set! (-> obj roll-thrust 0) 0.0) - (set! (-> obj roll-thrust 1) 0.0) - (set! (-> obj roll-thrust 0) 0.0) - (set! (-> obj roll-thrust 1) 0.0) - (when (>= 1 (-> obj force-level)) - (dotimes (s2-1 (-> obj info lift-thruster-count)) + (set! (-> this lift-thrust 0) 0.0) + (set! (-> this lift-thrust 1) 0.0) + (set! (-> this roll-thrust 0) 0.0) + (set! (-> this roll-thrust 1) 0.0) + (set! (-> this roll-thrust 0) 0.0) + (set! (-> this roll-thrust 1) 0.0) + (when (>= 1 (-> this force-level)) + (dotimes (s2-1 (-> this info lift-thruster-count)) (let ((s1-1 (-> arg1 probe-work-array s2-1))) (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) (let ((f28-1 (-> s1-1 probe-pos y))) - (when (> (-> obj flight-level-index) 0) - (set! f28-1 (- f28-1 (+ 6144.0 (-> obj flight-level)))) + (when (> (-> this flight-level-index) 0) + (set! f28-1 (- f28-1 (+ 6144.0 (-> this flight-level)))) (when (>= 0.0 f28-1) - (logclear! (-> obj flags) (rigid-body-object-flag in-air)) - (logior! (-> obj flags) (rigid-body-object-flag on-flight-level)) + (logclear! (-> this flags) (rigid-body-object-flag in-air)) + (logior! (-> this flags) (rigid-body-object-flag on-flight-level)) (.lvf vf1 (&-> (-> s1-1 ground-normal) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -284,18 +284,18 @@ ) ) ) - (when (or (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (and (> (-> obj flight-level-index) 0) (< f28-1 0.0)) + (when (or (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) + (and (> (-> this flight-level-index) 0) (< f28-1 0.0)) ) - (if (zero? (-> obj flight-level-index)) + (if (zero? (-> this flight-level-index)) (set! f28-1 40960.0) ) (let* ((f0-37 (* -1.0 - (-> obj force-scale) - (-> obj info inv-lift-thruster-count) - (-> obj info info mass) - (-> obj info extra gravity) - (+ 1.0 (* 2.0 (the float (-> obj flight-level-index)))) + (-> this force-scale) + (-> this info inv-lift-thruster-count) + (-> this info info mass) + (-> this info extra gravity) + (+ 1.0 (* 2.0 (the float (-> this flight-level-index)))) ) ) (f1-17 -1.0) @@ -307,10 +307,10 @@ (f0-38 (* f0-37 (fmax f1-17 (fmin f2-4 (+ f3-7 (* f4-2 (/ 1.0 f5-0) (-> arg1 velocity y))))))) ) (let ((f1-20 (fmax 0.0 f0-38))) - (+! (-> obj lift-thrust s2-1) f1-20) - (when (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (+! (-> obj roll-thrust 0) (* 0.05 f1-20)) - (+! (-> obj roll-thrust 1) (* 0.05 f1-20)) + (+! (-> this lift-thrust s2-1) f1-20) + (when (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) + (+! (-> this roll-thrust 0) (* 0.05 f1-20)) + (+! (-> this roll-thrust 1) (* 0.05 f1-20)) ) ) (vector-reset! (-> arg1 force)) @@ -325,17 +325,17 @@ (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) ) (let ((f0-40 (+ 4096.0 f28-1))) - (when (or (and (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) + (when (or (and (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) (< 0.0 f0-40) (< 0.0 (-> arg1 velocity y)) ) - (and (> (-> obj flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) + (and (> (-> this flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) ) (vector-reset! (-> arg1 force)) - (let ((f0-43 (* -0.25 (-> obj info inv-lift-thruster-count))) + (let ((f0-43 (* -0.25 (-> this info inv-lift-thruster-count))) (f1-28 arg0) ) - (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> obj info info mass) (-> arg1 velocity y))) + (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> this info info mass) (-> arg1 velocity y))) ) (let ((v1-140 s3-0) (a1-16 (-> arg1 world-pos)) @@ -350,7 +350,7 @@ (let* ((f1-36 (fmax 4096.0 (fmin (- (-> s1-1 probe-pos y) (-> s1-1 ground-pos y)) f30-1))) (f28-2 (- 1.0 (/ (+ -4096.0 f1-36) (+ -4096.0 f30-1)))) ) - (if (>= (-> obj info cos-ground-effect-angle) (vector-dot (-> s1-1 ground-normal) (-> arg1 mat vector 1))) + (if (>= (-> this info cos-ground-effect-angle) (vector-dot (-> s1-1 ground-normal) (-> arg1 mat vector 1))) (set! f28-2 0.0) ) (set! (-> arg1 tmp y) 0.0) @@ -370,8 +370,8 @@ ) (vector-float*! v1-155 a0-55 (* f0-58 (/ 1.0 f1-41) - (-> obj info inv-lift-thruster-count) - (-> obj info info mass) + (-> this info inv-lift-thruster-count) + (-> this info info mass) (fmax 0.0 (- (vector-dot (-> arg1 velocity) (-> arg1 normal)))) ) ) @@ -383,17 +383,18 @@ (rigid-body-method-18 (-> v1-157 state) a1-28 a2-13) ) (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - (let ((f0-72 - (* 8.0 - (-> obj info info mass) - (-> obj info extra gravity) - (-> obj info inv-lift-thruster-count) - (+ (* (-> obj info spring-lift-factor) f28-2) (* 0.75 (-> obj jump-thrust) (-> obj info jump-thrust-factor))) - (- (+ 1.0 (* 2.0 (rand-vu) (-> obj power-fluctuation-factor))) (-> obj power-fluctuation-factor)) - ) - ) + (let ((f0-72 (* 8.0 + (-> this info info mass) + (-> this info extra gravity) + (-> this info inv-lift-thruster-count) + (+ (* (-> this info spring-lift-factor) f28-2) + (* 0.75 (-> this jump-thrust) (-> this info jump-thrust-factor)) + ) + (- (+ 1.0 (* 2.0 (rand-vu) (-> this power-fluctuation-factor))) (-> this power-fluctuation-factor)) + ) + ) ) - (+! (-> obj lift-thrust s2-1) f0-72) + (+! (-> this lift-thrust s2-1) f0-72) (vector-float*! (-> arg1 force) (-> arg1 lift-dir) (* -1.0 f0-72)) ) ) @@ -404,16 +405,16 @@ (rigid-body-method-18 (-> v1-176 state) a1-32 a2-14) ) (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - (when (and (< 0.0 (-> obj info tire-friction-factor)) (let ((f0-75 0.0)) - (.lvf vf1 (&-> (-> s1-1 ground-normal) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov v1-184 vf1) - (< f0-75 v1-184) - ) + (when (and (< 0.0 (-> this info tire-friction-factor)) (let ((f0-75 0.0)) + (.lvf vf1 (&-> (-> s1-1 ground-normal) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-184 vf1) + (< f0-75 v1-184) + ) ) (vector+float*! (-> arg1 normal) @@ -432,20 +433,20 @@ (let ((f0-82 (fabs (-> arg1 vel-dot-norm)))) (set! (-> arg1 friction-coef) (smooth-interp - (-> obj info tire-static-friction) - (-> obj info tire-dynamic-friction) + (-> this info tire-static-friction) + (-> this info tire-dynamic-friction) f0-82 - (-> obj info tire-static-friction-speed) - (-> obj info tire-dynamic-friction-speed) + (-> this info tire-static-friction-speed) + (-> this info tire-dynamic-friction-speed) ) ) ) (set! (-> arg1 friction-coef) - (* (-> arg1 friction-coef) (+ 1.0 (* -0.75 (fmax 0.0 (fmin 1.0 (-> obj engine-thrust)))))) + (* (-> arg1 friction-coef) (+ 1.0 (* -0.75 (fmax 0.0 (fmin 1.0 (-> this engine-thrust)))))) ) (let ((f0-90 (* (-> arg1 friction-coef) - (-> obj info tire-friction-factor) + (-> this info tire-friction-factor) (fmax 0.0 (vector-dot (-> s1-1 ground-normal) (-> s1-1 tire-force))) ) ) @@ -475,18 +476,18 @@ ) ) -(defmethod rigid-body-object-method-29 vehicle ((obj vehicle) (arg0 float)) +(defmethod rigid-body-object-method-29 vehicle ((this vehicle) (arg0 float)) (local-vars (sv-624 float) (sv-720 float) (sv-724 float)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((gp-0 (new 'stack-no-clear 'inline-array 'matrix 9)) - (s5-0 (-> obj rbody)) - (s4-0 (-> obj info)) + (s5-0 (-> this rbody)) + (s4-0 (-> this info)) ) (mem-copy! (the-as pointer (-> gp-0 0)) (the-as pointer (-> s5-0 state matrix)) 64) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) - (vehicle-method-100 obj arg0 (the-as vehicle-physics-work gp-0)) - (when (>= 1 (-> obj force-level)) + (when (not (logtest? (-> this flags) (rigid-body-object-flag dead))) + (vehicle-method-100 this arg0 (the-as vehicle-physics-work gp-0)) + (when (>= 1 (-> this force-level)) (set! sv-624 (* (-> s4-0 info mass) (-> s4-0 extra gravity))) (when (!= (-> s4-0 pitch-control-factor) 0.0) (set! (-> gp-0 3 vector 2 quad) (-> gp-0 0 quad 0)) @@ -527,8 +528,8 @@ ) ) (let ((s1-1 (new 'stack-no-clear 'inline-array 'vector 5))) - (let ((f0-12 (* -1.0 (-> obj controls steering) (-> gp-0 4 vector 1 w) (-> s4-0 roll-angle)))) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) + (let ((f0-12 (* -1.0 (-> this controls steering) (-> gp-0 4 vector 1 w) (-> s4-0 roll-angle)))) + (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) (set! f0-12 0.0) ) (quaternion-vector-angle! (the-as quaternion (-> s1-1 0)) (-> gp-0 0 vector 2) f0-12) @@ -558,13 +559,13 @@ ) (when (< 0.0 f30-1) (let ((f30-2 - (* (+ f30-1 (+ (- (-> obj power-fluctuation-factor)) (* 2.0 (rand-vu) (-> obj power-fluctuation-factor)))) + (* (+ f30-1 (+ (- (-> this power-fluctuation-factor)) (* 2.0 (rand-vu) (-> this power-fluctuation-factor)))) (-> s4-0 roll-control-factor) sv-720 ) ) ) - (+! (-> obj roll-thrust s1-2) (fmax 0.0 f30-2)) + (+! (-> this roll-thrust s1-2) (fmax 0.0 f30-2)) (vector-matrix*! (-> gp-0 1 vector 2) (-> s0-1 local-pos) (-> gp-0 0)) (vector-rotate*! (-> gp-0 1 trans) (-> s0-1 normal) (-> gp-0 0)) (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) (* -1.0 f30-2)) @@ -581,19 +582,19 @@ ) ) (when #t - (let* ((f0-30 (-> obj controls steering)) + (let* ((f0-30 (-> this controls steering)) (f1-23 (-> s4-0 steering-thruster-half-gain-speed)) (f2-10 (-> s4-0 steering-thruster-half-gain-speed)) (v1-65 (-> s5-0 state lin-velocity)) (f2-12 (/ f1-23 (+ f2-10 (sqrtf (+ (* (-> v1-65 x) (-> v1-65 x)) (* (-> v1-65 z) (-> v1-65 z))))))) ) - (if (< (-> obj controls throttle) 0.0) + (if (< (-> this controls throttle) 0.0) (set! f0-30 (* -1.0 f0-30)) ) (set! (-> gp-0 3 vector 2 quad) (-> gp-0 0 vector 1 quad)) (let ((f30-3 (* 8192.0 (-> s4-0 info mass) - (-> obj power-level) + (-> this power-level) (- (* f0-30 f2-12 (-> s4-0 steering-thruster-max-gain)) (vector-dot (-> gp-0 3 vector 2) (-> s5-0 state ang-velocity)) ) @@ -601,7 +602,7 @@ ) ) ) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) + (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) (set! f30-3 (* f30-3 (-> s4-0 air-steering-factor))) ) (let ((s1-3 (the-as object (-> s4-0 steering-thruster-array)))) @@ -625,15 +626,15 @@ ) ) ) - (seek! (-> obj jump-thrust) 0.0 (* 6.0 arg0)) - (when (logtest? (rigid-body-object-flag ignition) (-> obj flags)) + (seek! (-> this jump-thrust) 0.0 (* 6.0 arg0)) + (when (logtest? (rigid-body-object-flag ignition) (-> this flags)) (vector-matrix*! (-> gp-0 1 vector 2) (-> s4-0 engine-thrust-local-pos) (-> gp-0 0)) (set! (-> gp-0 3 trans quad) (-> gp-0 0 vector 2 quad)) - (let ((f0-45 (* (-> obj engine-thrust) + (let ((f0-45 (* (-> this engine-thrust) (-> s4-0 max-engine-thrust) (-> s4-0 info mass) - (-> obj power-level) - (-> obj force-scale) + (-> this power-level) + (-> this force-scale) ) ) ) @@ -648,7 +649,7 @@ ) ) ) - (let ((f30-4 (-> obj controls brake))) + (let ((f30-4 (-> this controls brake))) (when (< 0.0 f30-4) (vector-matrix*! (-> gp-0 1 vector 2) (-> s4-0 brake-local-pos) (-> gp-0 0)) (let ((v1-98 s5-0) @@ -681,18 +682,18 @@ (* (-> s4-0 stabilizer-count) 2) ) (let ((s0-3 (-> s1-4 3 normal))) - (let ((f0-57 (* -3640.889 (-> obj controls lean-z)))) + (let ((f0-57 (* -3640.889 (-> this controls lean-z)))) (vector-rotate-around-x! s0-3 s0-3 f0-57) ) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) + (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) (set! (-> s0-3 w) (* 10.0 (-> s0-3 w))) ) - (if (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) + (if (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) (set! (-> s0-3 w) 0.0) ) ) - (let ((f30-5 (* -0.0000006103516 (-> obj force-scale) (-> s4-0 info mass) (-> s4-0 drag-force-factor)))) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) + (let ((f30-5 (* -0.0000006103516 (-> this force-scale) (-> s4-0 info mass) (-> s4-0 drag-force-factor)))) + (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) (set! f30-5 (* f30-5 (-> s4-0 air-drag-factor))) ) (let ((s1-5 (-> s1-4 0))) @@ -709,7 +710,7 @@ (* -0.06125 (vector-dot (-> gp-0 1 trans) (-> gp-0 1 vector 1)) (-> s1-5 normal w) - (-> obj force-scale) + (-> this force-scale) (-> s4-0 info mass) (-> s4-0 airfoil-factor) ) @@ -717,7 +718,7 @@ ) (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) f0-70) ) - (when (<= (-> obj force-level) 0) + (when (<= (-> this force-level) 0) (let ((v1-138 s5-0) (a1-29 (-> gp-0 1 vector 2)) (a2-23 (-> gp-0 1)) @@ -733,7 +734,7 @@ (+ (* 0.15 (vector-length (-> gp-0 1 vector 1))) (fabs (vector-dot (-> gp-0 1 trans) (-> gp-0 1 vector 1)))) ) ) - (when (<= (-> obj force-level) 0) + (when (<= (-> this force-level) 0) (let ((v1-145 s5-0) (a1-35 (-> gp-0 1 vector 2)) (a2-25 (-> gp-0 1)) @@ -749,7 +750,7 @@ (.svf (&-> (-> gp-0 1) quad 0) vf0) (set! (-> gp-0 1 vector 0 y) (* -1.0 (-> s4-0 extra gravity) - (if (< 1 (-> obj force-level)) + (if (< 1 (-> this force-level)) 2.0 1.0 ) @@ -761,10 +762,10 @@ ) (rigid-body-method-20 (-> v1-154 state) (the-as vector a1-36)) ) - (when (logtest? (-> obj flags) (rigid-body-object-flag riding)) + (when (logtest? (-> this flags) (rigid-body-object-flag riding)) (set! (-> gp-0 2 quad 0) (-> s4-0 info cm-offset-joint quad)) - (+! (-> gp-0 2 vector 0 x) (* (-> obj controls steering) (-> s4-0 player-shift-x))) - (+! (-> gp-0 2 vector 0 z) (* (-> obj controls lean-z) (-> s4-0 player-shift-z))) + (+! (-> gp-0 2 vector 0 x) (* (-> this controls steering) (-> s4-0 player-shift-x))) + (+! (-> gp-0 2 vector 0 z) (* (-> this controls lean-z) (-> s4-0 player-shift-z))) (vector-matrix*! (-> gp-0 1 vector 2) (the-as vector (-> gp-0 2)) (-> gp-0 0)) (.svf (&-> (-> gp-0 1) quad 0) vf0) (set! (-> gp-0 1 vector 0 y) (- (-> s4-0 player-weight))) @@ -776,9 +777,9 @@ ) 0 ) - (rigid-body-object-method-50 obj arg0) - (vehicle-method-99 obj arg0) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) + (rigid-body-object-method-50 this arg0) + (vehicle-method-99 this arg0) + (when (not (logtest? (-> this flags) (rigid-body-object-flag dead))) (set! (-> gp-0 1 trans quad) (-> s5-0 state lin-momentum quad)) (set! (-> gp-0 1 trans y) 0.0) (vector-normalize! (-> gp-0 1 trans) 1.0) @@ -789,7 +790,7 @@ (f1-67 -1.0) (f2-29 (* (-> s4-0 speed-limiting-drag) (vector-dot (-> s5-0 state force) (-> gp-0 1 trans)))) (f3-19 - (* (fabs (-> obj engine-thrust)) (-> s4-0 speed-scrubbing-drag) (vector-length (-> s5-0 state lin-momentum))) + (* (fabs (-> this engine-thrust)) (-> s4-0 speed-scrubbing-drag) (vector-length (-> s5-0 state lin-momentum))) ) (f4-6 (- 1.0 (fabs (vector-dot (-> s5-0 state matrix vector 2) (-> gp-0 1 trans))))) ) @@ -805,12 +806,12 @@ ) ) -(defmethod vehicle-method-125 vehicle ((obj vehicle) (arg0 float)) - (rigid-body-object-method-29 obj arg0) +(defmethod vehicle-method-125 vehicle ((this vehicle) (arg0 float)) + (rigid-body-object-method-29 this arg0) (none) ) -(defmethod vehicle-method-126 vehicle ((obj vehicle) (arg0 float)) - (rigid-body-object-method-29 obj arg0) +(defmethod vehicle-method-126 vehicle ((this vehicle) (arg0 float)) + (rigid-body-object-method-29 this arg0) (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 673e551cd4..2e9353d780 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-rider.gc @@ -33,77 +33,77 @@ ) -(defmethod get-trans vehicle-rider ((obj vehicle-rider) (arg0 int)) +(defmethod get-trans vehicle-rider ((this vehicle-rider) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (-> obj root trans) + (-> this root trans) ) -(defmethod vehicle-rider-method-33 vehicle-rider ((obj vehicle-rider)) - (let* ((s4-0 (ppointer->process (-> obj parent))) +(defmethod vehicle-rider-method-33 vehicle-rider ((this vehicle-rider)) + (let* ((s4-0 (ppointer->process (-> this parent))) (s5-0 (if (type? s4-0 vehicle) s4-0 ) ) ) - (logand! (-> obj flags) -5) + (logand! (-> this flags) -5) (if (and s5-0 (nonzero? (vehicle-method-72 s5-0))) - (logior! (-> obj flags) 4) + (logior! (-> this flags) 4) ) - (put-rider-in-seat s5-0 (-> obj seat-index) obj) + (put-rider-in-seat s5-0 (-> this seat-index) this) ) - (set! (-> obj anim-speed) (rand-vu-float-range 0.8 1.2)) + (set! (-> this anim-speed) (rand-vu-float-range 0.8 1.2)) 0 (none) ) -(defmethod vehicle-rider-method-35 vehicle-rider ((obj vehicle-rider)) - (logior! (-> obj draw status) (draw-control-status no-draw)) +(defmethod vehicle-rider-method-35 vehicle-rider ((this vehicle-rider)) + (logior! (-> this draw status) (draw-control-status no-draw)) (put-rider-in-seat - (the-as vehicle (ppointer->process (-> obj parent))) - (-> obj seat-index) + (the-as vehicle (ppointer->process (-> this parent))) + (-> this seat-index) (the-as process-focusable #f) ) - (go (method-of-object obj inactive)) + (go (method-of-object this inactive)) 0 (none) ) -(defmethod initialize-collision vehicle-rider ((obj vehicle-rider)) - (stack-size-set! (-> obj main-thread) 16) +(defmethod initialize-collision vehicle-rider ((this vehicle-rider)) + (stack-size-set! (-> this main-thread) 16) (lwide-entity-hack) - (when (not (-> obj entity)) + (when (not (-> this entity)) (format 0 "vehicle-rider::initialize-collision: ERROR, no lwide entity found~%") - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (go process-drawable-art-error "no lwide entity found") ) - (set! (-> obj root) (the-as collide-shape (new 'process 'trsqv))) + (set! (-> this root) (the-as collide-shape (new 'process 'trsqv))) 0 (none) ) -(defmethod vehicle-rider-method-32 vehicle-rider ((obj vehicle-rider) (arg0 traffic-object-spawn-params)) - (logior! (-> obj flags) 1) - (set! (-> obj draw lod-set lod 0 dist) 40960.0) - (set! (-> obj draw lod-set lod 1 dist) 122880.0) - (set! (-> obj draw lod-set lod 2 dist) 245760.0) - (set! (-> obj draw lod-set lod 3 dist) 614400.0) - (set! (-> obj seat-index) 0) - (set! (-> obj anim-t) (* 65536.0 (rand-vu))) - (vehicle-rider-method-33 obj) +(defmethod vehicle-rider-method-32 vehicle-rider ((this vehicle-rider) (arg0 traffic-object-spawn-params)) + (logior! (-> this flags) 1) + (set! (-> this draw lod-set lod 0 dist) 40960.0) + (set! (-> this draw lod-set lod 1 dist) 122880.0) + (set! (-> this draw lod-set lod 2 dist) 245760.0) + (set! (-> this draw lod-set lod 3 dist) 614400.0) + (set! (-> this seat-index) 0) + (set! (-> this anim-t) (* 65536.0 (rand-vu))) + (vehicle-rider-method-33 this) 0 (none) ) -(defmethod vehicle-rider-method-34 vehicle-rider ((obj vehicle-rider)) - (let ((a0-1 (ppointer->process (-> obj parent)))) +(defmethod vehicle-rider-method-34 vehicle-rider ((this vehicle-rider)) + (let ((a0-1 (ppointer->process (-> this parent)))) (when a0-1 - (+! (-> obj anim-t) (* 41870.223 (-> obj anim-speed) (seconds-per-frame))) - (if (< 65536.0 (-> obj anim-t)) - (+! (-> obj anim-t) -65536.0) + (+! (-> this anim-t) (* 41870.223 (-> this anim-speed) (seconds-per-frame))) + (if (< 65536.0 (-> this anim-t)) + (+! (-> this anim-t) -65536.0) ) (let* ((f0-5 (vehicle-method-75 a0-1)) - (f0-9 (+ (* 5.0 (- 1.0 f0-5)) (sin (-> obj anim-t)))) - (gp-1 (-> obj skel root-channel 0)) + (f0-9 (+ (* 5.0 (- 1.0 f0-5)) (sin (-> this anim-t)))) + (gp-1 (-> this skel root-channel 0)) ) (set! (-> gp-1 num-func) num-func-identity) (set! (-> gp-1 frame-num) (ja-aframe f0-9 0)) @@ -230,14 +230,14 @@ ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! vehicle-rider ((obj vehicle-rider) (arg0 entity-actor)) +(defmethod init-from-entity! vehicle-rider ((this vehicle-rider) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -294,87 +294,87 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 3) ) -(defmethod vehicle-rider-method-33 citizen-norm-rider ((obj citizen-norm-rider)) - ((the-as (function vehicle-rider none) (find-parent-method citizen-norm-rider 33)) obj) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 32 0) +(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) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 32 0) (cond - ((logtest? (-> obj flags) 4) - (set! (-> obj riding-anim) 5) - (setup-masks (-> obj draw) #x40000 0) + ((logtest? (-> this flags) 4) + (set! (-> this riding-anim) 5) + (setup-masks (-> this draw) #x40000 0) ) (else - (set! (-> obj riding-anim) 4) - (setup-masks (-> obj draw) #x20000 0) + (set! (-> this riding-anim) 4) + (setup-masks (-> this draw) #x20000 0) ) ) (let ((v1-12 (rand-vu-int-count 2))) (cond ((zero? v1-12) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) ((= v1-12 1) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ) ) (let ((v1-18 (rand-vu-int-count 3))) (cond ((zero? v1-18) - (setup-masks (-> obj draw) 8 0) + (setup-masks (-> this draw) 8 0) ) ((= v1-18 1) - (setup-masks (-> obj draw) 512 0) + (setup-masks (-> this draw) 512 0) ) ((= v1-18 2) - (setup-masks (-> obj draw) #x4000 0) + (setup-masks (-> this draw) #x4000 0) ) ) ) (let ((v1-26 (rand-vu-int-count 4))) (cond ((zero? v1-26) - (setup-masks (-> obj draw) 4 0) + (setup-masks (-> this draw) 4 0) ) ((= v1-26 1) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ((= v1-26 2) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ) ) (let ((v1-34 (rand-vu-int-count 3))) (cond ((zero? v1-34) - (setup-masks (-> obj draw) 64 0) + (setup-masks (-> this draw) 64 0) ) ((= v1-34 1) - (setup-masks (-> obj draw) 2048 0) + (setup-masks (-> this draw) 2048 0) ) ((= v1-34 2) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ) ) - (setup-masks (-> obj draw) 16 0) + (setup-masks (-> this draw) 16 0) (if (zero? (rand-vu-int-count 3)) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) 0 (none) ) -(defmethod vehicle-rider-method-32 citizen-norm-rider ((obj citizen-norm-rider) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 citizen-norm-rider ((this citizen-norm-rider) (arg0 traffic-object-spawn-params)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm-rider" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj flags) 1) - (set! (-> obj draw lod-set lod 0 dist) 122880.0) - (set! (-> obj draw lod-set lod 1 dist) 286720.0) - (vehicle-rider-method-33 obj) + (logior! (-> this flags) 1) + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 286720.0) + (vehicle-rider-method-33 this) 0 (none) ) @@ -393,31 +393,31 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 3) ) -(defmethod vehicle-rider-method-33 crimson-guard-rider ((obj crimson-guard-rider)) - ((the-as (function vehicle-rider none) (find-parent-method crimson-guard-rider 33)) obj) - (setup-masks (-> obj draw) 0 28) - (setup-masks (-> obj draw) 3 0) - (if (logtest? (-> obj flags) 4) - (set! (-> obj riding-anim) 36) - (set! (-> obj riding-anim) 35) +(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) + (setup-masks (-> this draw) 0 28) + (setup-masks (-> this draw) 3 0) + (if (logtest? (-> this flags) 4) + (set! (-> this riding-anim) 36) + (set! (-> this riding-anim) 35) ) 0 (none) ) -(defmethod vehicle-rider-method-32 crimson-guard-rider ((obj crimson-guard-rider) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 crimson-guard-rider ((this crimson-guard-rider) (arg0 traffic-object-spawn-params)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard-rider" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj flags) 9) - (set! (-> obj draw lod-set lod 0 dist) 122880.0) - (set! (-> obj draw lod-set lod 1 dist) 286720.0) - (vehicle-rider-method-33 obj) + (logior! (-> this flags) 9) + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 286720.0) + (vehicle-rider-method-33 this) 0 (none) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-states.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-states.gc index df63fcb4df..40b3066b07 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-states.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-states.gc @@ -15,7 +15,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (rigid-body-object-method-39 self) (go-virtual waiting) ) @@ -53,7 +53,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (vehicle-method-139 self) (logior! (-> self flags) (rigid-body-object-flag riding ai-driving)) (vehicle-method-142 self) @@ -74,7 +74,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (vehicle-method-140 self) (set! (-> self flags) (the-as rigid-body-object-flag @@ -129,7 +129,7 @@ :event vehicle-event-handler :enter (behavior () (set-setting! 'sound-flava #f 31.0 5) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (iterate-prims (-> self root) (lambda ((arg0 collide-shape-prim)) (when (!= (-> arg0 prim-core prim-type) (prim-type mesh)) (logior! (-> arg0 prim-core collide-as) (collide-spec jak)) @@ -180,7 +180,7 @@ (remove-setting! 'sound-flava) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (not *target*) (go-virtual waiting) ) @@ -238,7 +238,7 @@ :event vehicle-event-handler :enter (behavior () (logclear! (-> self flags) (rigid-body-object-flag player-driving)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (vehicle-method-129 self) (set! (-> self crash-level) 3) (vehicle-method-88 self) @@ -248,7 +248,7 @@ ) :trans (behavior () (set! (-> self hit-points) (- (-> self hit-points) (* 0.5 (seconds-per-frame)))) - (if (and (>= (- (current-time) (-> self state-time)) 1) (< (-> self hit-points) -0.25)) + (if (and (time-elapsed? (-> self state-time) 1) (< (-> self hit-points) -0.25)) (go-virtual explode) ) ) @@ -270,12 +270,12 @@ (set! (-> self player-dist2) (vector-vector-distance-squared (-> self root trans) (target-pos 0))) (cond ((logtest? (-> self draw status) (draw-control-status on-screen)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (else - (if (or (>= (- (current-time) (-> self state-time)) (seconds 5)) (let ((f0-2 409600.0)) - (< (* f0-2 f0-2) (-> self camera-dist2)) - ) + (if (or (time-elapsed? (-> self state-time) (seconds 5)) (let ((f0-2 409600.0)) + (< (* f0-2 f0-2) (-> self camera-dist2)) + ) ) (go-virtual die) ) @@ -442,7 +442,7 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) :code sleep-code 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 8526724fab..a45f78fb4f 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle-util.gc @@ -7,14 +7,14 @@ ;; DECOMP BEGINS -(defmethod rigid-body-vehicle-constants-method-9 rigid-body-vehicle-constants ((obj rigid-body-vehicle-constants)) - (set! (-> obj particle-system-2d) *sp-particle-system-2d*) - (set! (-> obj particle-system-3d) *sp-particle-system-3d*) - (set! (-> obj part-quat) *particle-quat*) - (set! (-> obj part-vel) *particle-vel*) - (set! (-> obj part-thruster) (-> *part-id-table* 775)) - (set! (-> obj part-thruster-scale-x) (-> *part-id-table* 775 init-specs 3)) - (set! (-> obj part-thruster-scale-y) (-> *part-id-table* 775 init-specs 4)) +(defmethod rigid-body-vehicle-constants-method-9 rigid-body-vehicle-constants ((this rigid-body-vehicle-constants)) + (set! (-> this particle-system-2d) *sp-particle-system-2d*) + (set! (-> this particle-system-3d) *sp-particle-system-3d*) + (set! (-> this part-quat) *particle-quat*) + (set! (-> this part-vel) *particle-vel*) + (set! (-> this part-thruster) (-> *part-id-table* 775)) + (set! (-> this part-thruster-scale-x) (-> *part-id-table* 775 init-specs 3)) + (set! (-> this part-thruster-scale-y) (-> *part-id-table* 775 init-specs 4)) 0 (none) ) @@ -52,9 +52,9 @@ ) -(defmethod vehicle-hud-requests-method-9 vehicle-hud-requests ((obj vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-9 vehicle-hud-requests ((this vehicle-hud-requests)) (dotimes (v1-0 4) - (let ((a1-2 (-> obj requests v1-0))) + (let ((a1-2 (-> this requests v1-0))) (set! (-> a1-2 handle) (the-as handle #f)) (set! (-> a1-2 priority) 0.0) ) @@ -63,11 +63,11 @@ (none) ) -(defmethod vehicle-hud-requests-method-10 vehicle-hud-requests ((obj vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-10 vehicle-hud-requests ((this vehicle-hud-requests)) (let ((v1-0 0)) (let ((f0-0 0.0)) (countdown (a1-0 4) - (let ((a2-2 (-> obj requests a1-0))) + (let ((a2-2 (-> this requests a1-0))) (when (and (handle->process (-> a2-2 handle)) (< f0-0 (-> a2-2 priority))) (set! v1-0 a1-0) (set! f0-0 (-> a2-2 priority)) @@ -75,11 +75,11 @@ ) ) ) - (-> obj requests v1-0) + (-> this requests v1-0) ) ) -(defmethod vehicle-hud-requests-method-11 vehicle-hud-requests ((obj vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-11 vehicle-hud-requests ((this vehicle-hud-requests)) (let ((v1-0 0)) (let ((f0-0 (the-as float #x7f800000)) (a1-1 4) @@ -87,7 +87,7 @@ (b! #t cfg-10 :delay (nop!)) (label cfg-1) (+! a1-1 -1) - (let ((a2-2 (-> obj requests a1-1))) + (let ((a2-2 (-> this requests a1-1))) (b! (handle->process (-> a2-2 handle)) cfg-8 :delay (empty-form)) (set! v1-0 a1-1) (set! (-> a2-2 priority) 0.0) @@ -102,7 +102,7 @@ (b! (nonzero? a1-1) cfg-1 :delay (nop!)) ) (label cfg-12) - (-> obj requests v1-0) + (-> this requests v1-0) ) ) @@ -119,25 +119,25 @@ ) -(defmethod vehicle-hud-chooser-method-9 vehicle-hud-chooser ((obj vehicle-hud-chooser) (arg0 handle) (arg1 float)) +(defmethod vehicle-hud-chooser-method-9 vehicle-hud-chooser ((this vehicle-hud-chooser) (arg0 handle) (arg1 float)) (let ((s3-0 (current-time))) - (when (!= s3-0 (-> obj cur time)) - (if (zero? (-> obj cur time)) - (vehicle-hud-requests-method-9 (-> obj cur)) + (when (!= s3-0 (-> this cur time)) + (if (zero? (-> this cur time)) + (vehicle-hud-requests-method-9 (-> this cur)) ) - (mem-copy! (the-as pointer (-> obj last)) (the-as pointer (-> obj cur)) 72) - (set! (-> obj cur time) s3-0) - (vehicle-hud-requests-method-9 (-> obj cur)) + (mem-copy! (the-as pointer (-> this last)) (the-as pointer (-> this cur)) 72) + (set! (-> this cur time) s3-0) + (vehicle-hud-requests-method-9 (-> this cur)) ) ) - (let ((v1-10 (vehicle-hud-requests-method-11 (-> obj cur)))) + (let ((v1-10 (vehicle-hud-requests-method-11 (-> this cur)))) (when (< (-> v1-10 priority) arg1) (set! (-> v1-10 handle) arg0) (set! (-> v1-10 priority) arg1) ) ) (let ((s4-1 #f)) - (let ((v1-12 (vehicle-hud-requests-method-10 (-> obj last)))) + (let ((v1-12 (vehicle-hud-requests-method-10 (-> this last)))) (if (and (handle->process arg0) (= (-> v1-12 handle) arg0)) (set! s4-1 #t) ) @@ -150,55 +150,55 @@ (define *pilot-edge-grab-info* (new 'static 'pilot-edge-grab-info)) -(defmethod deactivate vehicle ((obj vehicle)) - (vehicle-method-110 obj) - ((the-as (function rigid-body-object none) (find-parent-method vehicle 10)) obj) +(defmethod deactivate vehicle ((this vehicle)) + (vehicle-method-110 this) + ((the-as (function rigid-body-object none) (find-parent-method vehicle 10)) this) (none) ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! vehicle ((obj vehicle) (arg0 entity-actor)) +(defmethod init-from-entity! vehicle ((this vehicle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) -(defmethod rigid-body-object-method-35 vehicle ((obj vehicle)) +(defmethod rigid-body-object-method-35 vehicle ((this vehicle)) (let ((t9-0 (method-of-type rigid-body-object rigid-body-object-method-35))) - (t9-0 obj) + (t9-0 this) ) (cond - ((logtest? (-> obj info flags) 2048) - (set! (-> obj rbody state force-callback) (method-of-object obj vehicle-method-125)) + ((logtest? (-> this info flags) 2048) + (set! (-> this rbody state force-callback) (method-of-object this vehicle-method-125)) ) - ((logtest? (-> obj info flags) 4096) - (set! (-> obj rbody state force-callback) (method-of-object obj vehicle-method-126)) + ((logtest? (-> this info flags) 4096) + (set! (-> this rbody state force-callback) (method-of-object this vehicle-method-126)) ) ) - (rigid-body-vehicle-constants-method-9 (-> obj info)) + (rigid-body-vehicle-constants-method-9 (-> this info)) (none) ) -(defmethod check-player-get-on vehicle ((obj vehicle)) +(defmethod check-player-get-on vehicle ((this vehicle)) (with-pp - (let ((f0-0 (-> obj player-dist2)) + (let ((f0-0 (-> this player-dist2)) (f1-0 102400.0) ) (when (< f0-0 (* f1-0 f1-0)) (let ((s5-0 (new 'stack-no-clear 'mystery-vehicle-type))) - (set! (-> s5-0 floats 4) (+ 8192.0 (-> obj root root-prim local-sphere w))) - (if (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) + (set! (-> s5-0 floats 4) (+ 8192.0 (-> this root root-prim local-sphere w))) + (if (logtest? (rigid-body-object-flag ai-driving) (-> this flags)) (set! (-> s5-0 floats 4) (* 1.5 (-> s5-0 floats 4))) ) (set! (-> s5-0 matrices 0 vector 1 quad) (-> (target-pos 0) quad)) (+! (-> s5-0 matrices 0 vector 1 y) 8192.0) (let* ((v1-14 (-> s5-0 matrices 1)) - (a3-0 (-> obj node-list data 0 bone transform)) + (a3-0 (-> this node-list data 0 bone transform)) (a0-5 (-> a3-0 quad 0)) (a1-0 (-> a3-0 quad 1)) (a2-0 (-> a3-0 quad 2)) @@ -220,7 +220,7 @@ This commonly includes things such as: *target* (not (focus-test? *target* dead grabbed in-head under-water pole flut tube pilot dark)) (or (not (focus-test? *target* edge-grab)) - (logtest? (-> obj flags) (rigid-body-object-flag player-edge-grabbing)) + (logtest? (-> this flags) (rigid-body-object-flag player-edge-grabbing)) ) (-> *setting-control* user-current pilot) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -230,7 +230,7 @@ This commonly includes things such as: (set! (-> a1-2 param 0) (the-as uint 'mode)) (let ((v1-37 (send-event-function *target* a1-2))) (and (or (= v1-37 #f) (= v1-37 'board)) - (or (logtest? (-> obj flags) (rigid-body-object-flag waiting-for-player)) + (or (logtest? (-> this flags) (rigid-body-object-flag waiting-for-player)) (-> *setting-control* user-current vehicle-hijacking) ) ) @@ -241,9 +241,9 @@ This commonly includes things such as: (s4-1 #f) (s3-0 #f) ) - (let ((a2-2 (get-best-seat-for-vehicle obj (-> s5-0 matrices 0 vector 1) 1 0))) + (let ((a2-2 (get-best-seat-for-vehicle this (-> s5-0 matrices 0 vector 1) 1 0))) (when (!= a2-2 -1) - (compute-seat-position obj (-> s5-0 matrices 0 vector 2) a2-2) + (compute-seat-position this (-> s5-0 matrices 0 vector 2) a2-2) (vector+float*! (-> s5-0 matrices 0 vector 2) (-> s5-0 matrices 0 vector 2) @@ -280,7 +280,7 @@ This commonly includes things such as: obstacle-for-jak ) ) - (set! (-> v1-54 ignore-process0) obj) + (set! (-> v1-54 ignore-process0) this) (set! (-> v1-54 ignore-process1) #f) (set! (-> v1-54 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-54 action-mask) (collide-action solid)) @@ -290,11 +290,11 @@ This commonly includes things such as: ) ) (when s2-0 - (when (and (or (< -14336.0 (-> s5-0 floats 2)) (logtest? (-> obj flags) (rigid-body-object-flag player-edge-grabbing))) - (not (logtest? (rigid-body-object-flag no-hijack) (-> obj flags))) + (when (and (or (< -14336.0 (-> s5-0 floats 2)) (logtest? (-> this flags) (rigid-body-object-flag player-edge-grabbing))) + (not (logtest? (rigid-body-object-flag no-hijack) (-> this flags))) ) (set! s4-1 #t) - (set! (-> s5-0 floats 3) (* (-> obj hit-points) (/ 40960.0 (sqrtf (-> s5-0 floats 1))))) + (set! (-> s5-0 floats 3) (* (-> this hit-points) (/ 40960.0 (sqrtf (-> s5-0 floats 1))))) ) (when (and (not s4-1) (and (< (-> s5-0 floats 2) -8192.0) (not (logtest? (-> *target* focus-status) (focus-status edge-grab)))) @@ -302,8 +302,8 @@ This commonly includes things such as: (matrix-4x4-inverse! (-> s5-0 matrices 2) (-> s5-0 matrices 1)) (vector-matrix*! (the-as vector (-> s5-0 matrices)) (-> s5-0 matrices 0 vector 1) (-> s5-0 matrices 2)) (set! (-> s5-0 floats 0) 81920.0) - (dotimes (s2-1 (-> obj info grab-rail-count)) - (let ((s1-0 (-> obj info grab-rail-array s2-1))) + (dotimes (s2-1 (-> this info grab-rail-count)) + (let ((s1-0 (-> this info grab-rail-array s2-1))) (vector-! (-> s5-0 matrices 0 trans) (the-as vector (-> s5-0 matrices)) (the-as vector (-> s1-0 local-pos))) (when #t (let ((f30-0 (vector-segment-distance-point! @@ -320,7 +320,7 @@ This commonly includes things such as: (vector-! (-> s5-0 vectors 1) (-> s1-0 local-pos 1) (the-as vector (-> s1-0 local-pos))) (vector-normalize! (-> s5-0 vectors 1) 1.0) (set! s3-0 #t) - (set! (-> s5-0 floats 3) (* (-> obj hit-points) (/ 40960.0 f30-0))) + (set! (-> s5-0 floats 3) (* (-> this hit-points) (/ 40960.0 f30-0))) ) ) ) @@ -329,8 +329,8 @@ This commonly includes things such as: ) ) (set! s3-0 (or s4-1 s3-0)) - (when (and s3-0 (and (vehicle-hud-chooser-method-9 *vehicle-hud-chooser* (process->handle obj) (-> s5-0 floats 3)) - (can-display-query? obj (the-as string #f) (/ 1.0 (-> s5-0 floats 3))) + (when (and s3-0 (and (vehicle-hud-chooser-method-9 *vehicle-hud-chooser* (process->handle this) (-> s5-0 floats 3)) + (can-display-query? this (the-as string #f) (/ 1.0 (-> s5-0 floats 3))) ) ) (let ((s3-1 @@ -358,14 +358,14 @@ This commonly includes things such as: (when (cpad-pressed? 0 triangle) (cond (s4-1 - (when (send-event *target* 'change-mode 'pilot obj 0 #f) - (logior! (-> obj flags) (rigid-body-object-flag player-driving)) - (logclear! (-> obj flags) (rigid-body-object-flag ai-driving)) - (vehicle-method-87 obj) + (when (send-event *target* 'change-mode 'pilot this 0 #f) + (logior! (-> this flags) (rigid-body-object-flag player-driving)) + (logclear! (-> this flags) (rigid-body-object-flag ai-driving)) + (vehicle-method-87 this) ) ) (else - (set! (-> s5-0 handles 0) (process->handle obj)) + (set! (-> s5-0 handles 0) (process->handle this)) (mem-copy! (the-as pointer *pilot-edge-grab-info*) (the-as pointer (-> s5-0 vectors)) 40) (if (send-event *target* 'pilot-edge-grab *pilot-edge-grab-info*) (format 0 "vehicle::check-player-get-on: (send-event *target* 'pilot-edge-grab self)~%") @@ -382,14 +382,14 @@ This commonly includes things such as: ) ) (cond - ((and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) *target* (!= (-> obj crash-level) 3)) + ((and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) *target* (!= (-> this crash-level) 3)) (when (focus-test? *target* pilot-riding) - (vehicle-controller-method-11 (-> obj controller)) - (vehicle-method-138 obj) + (vehicle-controller-method-11 (-> this controller)) + (vehicle-method-138 this) ) ) (else - (vehicle-method-88 obj) + (vehicle-method-88 this) ) ) 0 @@ -397,89 +397,89 @@ This commonly includes things such as: ) ) -(defmethod vehicle-method-110 vehicle ((obj vehicle)) - (sound-stop (-> obj scrape-sound-id)) - (sound-stop (-> obj engine-sound-id)) - (sound-stop (-> obj thrust-sound-id)) - (set! (-> obj scrape-sound-envelope) 0.0) - (set! (-> obj engine-sound-envelope) 0.0) +(defmethod vehicle-method-110 vehicle ((this vehicle)) + (sound-stop (-> this scrape-sound-id)) + (sound-stop (-> this engine-sound-id)) + (sound-stop (-> this thrust-sound-id)) + (set! (-> this scrape-sound-envelope) 0.0) + (set! (-> this engine-sound-envelope) 0.0) 0 (none) ) -(defmethod vehicle-method-62 vehicle ((obj vehicle) (arg0 float)) - (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> obj flags))) - (set! (-> obj controls steering) (fmax -1.0 (fmin 1.0 arg0))) +(defmethod vehicle-method-62 vehicle ((this vehicle) (arg0 float)) + (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> this flags))) + (set! (-> this controls steering) (fmax -1.0 (fmin 1.0 arg0))) ) 0 (none) ) -(defmethod vehicle-method-63 vehicle ((obj vehicle) (arg0 float)) - (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> obj flags))) - (set! (-> obj controls throttle) (fmax -0.5 (fmin 1.0 arg0))) +(defmethod vehicle-method-63 vehicle ((this vehicle) (arg0 float)) + (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> this flags))) + (set! (-> this controls throttle) (fmax -0.5 (fmin 1.0 arg0))) ) 0 (none) ) -(defmethod vehicle-method-98 vehicle ((obj vehicle) (arg0 float)) - (let* ((v1-1 (-> obj rbody state lin-velocity)) +(defmethod vehicle-method-98 vehicle ((this vehicle) (arg0 float)) + (let* ((v1-1 (-> this rbody state lin-velocity)) (f0-4 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) (f0-6 (/ (- arg0 f0-4) arg0)) (f1-6 (* 0.005 f0-6)) ) - (set! (-> obj controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> obj controls throttle) f1-6)))) + (set! (-> this controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) f1-6)))) ) 0 (none) ) -(defmethod start-jump vehicle ((obj vehicle)) - (when (logtest? (-> obj info flags) 16) - (when (not (logtest? (rigid-body-object-flag jump-sound) (-> obj flags))) - (logior! (-> obj flags) (rigid-body-object-flag jump-sound)) +(defmethod start-jump vehicle ((this vehicle)) + (when (logtest? (-> this info flags) 16) + (when (not (logtest? (rigid-body-object-flag jump-sound) (-> this flags))) + (logior! (-> this flags) (rigid-body-object-flag jump-sound)) (sound-play "bike-hop") ) - (logior! (-> obj flags) (rigid-body-object-flag jump)) + (logior! (-> this flags) (rigid-body-object-flag jump)) ) 0 (none) ) -(defmethod vehicle-method-66 vehicle ((obj vehicle)) +(defmethod vehicle-method-66 vehicle ((this vehicle)) 0 (none) ) -(defmethod get-seat-count vehicle ((obj vehicle)) - (-> obj info seat-count) +(defmethod get-seat-count vehicle ((this vehicle)) + (-> this info seat-count) ) -(defmethod compute-seat-position vehicle ((obj vehicle) (arg0 vector) (arg1 int)) +(defmethod compute-seat-position vehicle ((this vehicle) (arg0 vector) (arg1 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> obj info seat-array arg1 position quad)) + (set! (-> v1-0 quad) (-> this info seat-array arg1 position quad)) (set! (-> v1-0 w) 1.0) - (vector-matrix*! arg0 v1-0 (-> obj node-list data 0 bone transform)) + (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) ) 0 (none) ) -(defmethod get-rider-in-seat vehicle ((obj vehicle) (arg0 int)) +(defmethod get-rider-in-seat vehicle ((this vehicle) (arg0 int)) (let ((v0-0 (the-as process #f))) - (if (< arg0 (-> obj info seat-count)) - (set! v0-0 (handle->process (-> obj rider-array arg0))) + (if (< arg0 (-> this info seat-count)) + (set! v0-0 (handle->process (-> this rider-array arg0))) ) v0-0 ) ) -(defmethod vehicle-method-70 vehicle ((obj vehicle)) +(defmethod vehicle-method-70 vehicle ((this vehicle)) (let ((gp-0 (the-as process #f))) - (countdown (s4-0 (-> obj info seat-count)) - (when (logtest? (-> obj info seat-array s4-0 flags) 1) - (let ((v1-7 (get-rider-in-seat obj s4-0))) + (countdown (s4-0 (-> this info seat-count)) + (when (logtest? (-> this info seat-array s4-0 flags) 1) + (let ((v1-7 (get-rider-in-seat this s4-0))) (if v1-7 (set! gp-0 v1-7) ) @@ -490,29 +490,29 @@ This commonly includes things such as: ) ) -(defmethod get-best-seat-for-vehicle vehicle ((obj vehicle) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod get-best-seat-for-vehicle vehicle ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) (let ((gp-0 -1)) (let ((f30-0 (the-as float #x7f800000)) (s1-0 (new 'stack-no-clear 'vector)) ) - (countdown (s0-0 (-> obj info seat-count)) - (when (logtest? arg1 (-> obj info seat-array s0-0 flags)) + (countdown (s0-0 (-> this info seat-count)) + (when (logtest? arg1 (-> this info seat-array s0-0 flags)) (let ((v1-7 arg2)) (when (cond ((zero? v1-7) #t ) ((= v1-7 1) - (not (get-rider-in-seat obj s0-0)) + (not (get-rider-in-seat this s0-0)) ) ((= v1-7 2) - (get-rider-in-seat obj s0-0) + (get-rider-in-seat this s0-0) ) (else #f ) ) - (compute-seat-position obj s1-0 s0-0) + (compute-seat-position this s1-0 s0-0) (let ((f0-0 (vector-vector-distance-squared arg0 s1-0))) (when (< f0-0 f30-0) (set! f30-0 f0-0) @@ -528,11 +528,11 @@ This commonly includes things such as: ) ) -(defmethod remove-rider vehicle ((obj vehicle) (arg0 process)) - (let ((v1-1 (-> obj info seat-count))) +(defmethod remove-rider vehicle ((this vehicle) (arg0 process)) + (let ((v1-1 (-> this info seat-count))) (dotimes (a2-0 v1-1) - (if (= arg0 (handle->process (-> obj rider-array a2-0))) - (set! (-> obj rider-array a2-0) (the-as handle #f)) + (if (= arg0 (handle->process (-> this rider-array a2-0))) + (set! (-> this rider-array a2-0) (the-as handle #f)) ) ) ) @@ -540,44 +540,44 @@ This commonly includes things such as: (none) ) -(defmethod put-rider-in-seat vehicle ((obj vehicle) (arg0 int) (arg1 process-focusable)) - (if (< arg0 (-> obj info seat-count)) - (set! (-> obj rider-array arg0) (process->handle arg1)) +(defmethod put-rider-in-seat vehicle ((this vehicle) (arg0 int) (arg1 process-focusable)) + (if (< arg0 (-> this info seat-count)) + (set! (-> this rider-array arg0) (process->handle arg1)) ) 0 (none) ) -(defmethod vehicle-method-117 vehicle ((obj vehicle) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 vehicle ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector+! v1-0 (-> obj info seat-array arg1 position) (-> obj info rider-hand-offset arg2)) - (vector-matrix*! arg0 v1-0 (-> obj node-list data 0 bone transform)) + (vector+! v1-0 (-> this info seat-array arg1 position) (-> this info rider-hand-offset arg2)) + (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) ) 0 (none) ) -(defmethod vehicle-method-72 vehicle ((obj vehicle)) - (-> obj info rider-stance) +(defmethod vehicle-method-72 vehicle ((this vehicle)) + (-> this info rider-stance) ) -(defmethod vehicle-method-75 vehicle ((obj vehicle)) - (-> obj controls steering) +(defmethod vehicle-method-75 vehicle ((this vehicle)) + (-> this controls steering) ) -(defmethod vehicle-method-115 vehicle ((obj vehicle) (arg0 vector)) - (set! (-> arg0 quad) (-> obj lin-acceleration quad)) +(defmethod vehicle-method-115 vehicle ((this vehicle) (arg0 vector)) + (set! (-> arg0 quad) (-> this lin-acceleration quad)) 0 (none) ) -(defmethod vehicle-method-116 vehicle ((obj vehicle) (arg0 (pointer vehicle-controls))) - (mem-copy! arg0 (the-as pointer (-> obj controls)) 16) +(defmethod vehicle-method-116 vehicle ((this vehicle) (arg0 (pointer vehicle-controls))) + (mem-copy! arg0 (the-as pointer (-> this controls)) 16) 0 (none) ) -(defmethod apply-damage vehicle ((obj vehicle) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage vehicle ((this vehicle) (arg0 float) (arg1 rigid-body-impact)) (cond (#f ) @@ -594,21 +594,21 @@ This commonly includes things such as: *target* (focus-test? *target* pilot) (nonzero? (-> *target* pilot)) - (= obj (handle->process (-> *target* pilot vehicle)))) + (= this (handle->process (-> *target* pilot vehicle)))) (if (!= (-> arg1 pat event) (pat-event melt)) (set! arg0 0.0)) ) ) - (set! (-> obj hit-points) (- (-> obj hit-points) (* arg0 (-> obj damage-factor)))) + (set! (-> this hit-points) (- (-> this hit-points) (* arg0 (-> this damage-factor)))) (let ((s4-1 (-> arg1 prim-id)) (s3-0 0) ) (while (nonzero? s4-1) - (when (and (logtest? s4-1 1) (< s3-0 (-> obj info section-count))) - (let ((v1-14 (-> obj section-array s3-0))) - (+! (-> v1-14 damage) (* 4.0 (-> obj damage-factor) arg0)) + (when (and (logtest? s4-1 1) (< s3-0 (-> this info section-count))) + (let ((v1-14 (-> this section-array s3-0))) + (+! (-> v1-14 damage) (* 4.0 (-> this damage-factor) arg0)) ) - (vehicle-method-118 obj s3-0) + (vehicle-method-118 this s3-0) ) (set! s4-1 (shr s4-1 1)) (+! s3-0 1) @@ -620,9 +620,9 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-118 vehicle ((obj vehicle) (arg0 int)) - (let* ((v1-2 (-> obj section-array arg0)) - (s4-0 (-> obj info section-array arg0)) +(defmethod vehicle-method-118 vehicle ((this vehicle) (arg0 int)) + (let* ((v1-2 (-> this section-array arg0)) + (s4-0 (-> this info section-array arg0)) (s5-1 (max 0 @@ -636,180 +636,180 @@ This commonly includes things such as: (set! a2-0 (logior a2-0 (-> s4-0 damage-seg-array v1-6))) ) ) - (setup-masks (-> obj draw) 0 a2-0) + (setup-masks (-> this draw) 0 a2-0) ) - (setup-masks (-> obj draw) (the-as int (-> s4-0 damage-seg-array s5-1)) 0) + (setup-masks (-> this draw) (the-as int (-> s4-0 damage-seg-array s5-1)) 0) (when (> s5-1 0) - (if (not (logtest? (rigid-body-object-flag lights-dead) (-> obj flags))) + (if (not (logtest? (rigid-body-object-flag lights-dead) (-> this flags))) (sound-play "headlight-pop") ) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-dead) (-> obj flags))) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-dead) (-> this flags))) ) - (vehicle-method-132 obj) + (vehicle-method-132 this) ) ) 0 (none) ) -(defmethod vehicle-method-82 vehicle ((obj vehicle)) - (set! (-> obj flags) (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag - disturbed - damaged - dead - player-touching - player-edge-grabbing - player-standing-on - persistent - in-air - riding - player-driving - waiting-for-player - ignition - turbo-boost - reverse-gear - slide - hard-turn - jump - ai-driving - flight-level-transition - alert - in-pursuit - target-in-sight - rammed-target - lights-on - lights-update - lights-dead - ) - ) - ) +(defmethod vehicle-method-82 vehicle ((this vehicle)) + (set! (-> this flags) (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag + disturbed + damaged + dead + player-touching + player-edge-grabbing + player-standing-on + persistent + in-air + riding + player-driving + waiting-for-player + ignition + turbo-boost + reverse-gear + slide + hard-turn + jump + ai-driving + flight-level-transition + alert + in-pursuit + target-in-sight + rammed-target + lights-on + lights-update + lights-dead + ) + ) + ) ) - (set! (-> obj vehicle-jkhn1b23jn1) (the-as int (-> obj flags))) - (logior! (-> obj rbody state flags) (rigid-body-flag active)) - (logclear! (-> obj focus-status) (focus-status disable dead inactive)) - (rigid-body-object-method-35 obj) - (rigid-body-object-method-39 obj) - (vehicle-method-103 obj) - (set! (-> obj hit-points) 1.0) - (set! (-> obj damage-factor) (-> obj info damage-factor)) - (set! (-> obj crash-level) 0) - (set! (-> obj power-fluctuation-factor) 0.02) - (set! (-> obj power-level) 1.0) - (set! (-> obj flight-level-index) 0) - (let ((a1-0 (-> obj root trans))) - (set! (-> obj flight-level) (get-height-at-point *traffic-height-map* a1-0)) + (set! (-> this vehicle-jkhn1b23jn1) (the-as int (-> this flags))) + (logior! (-> this rbody state flags) (rigid-body-flag active)) + (logclear! (-> this focus-status) (focus-status disable dead inactive)) + (rigid-body-object-method-35 this) + (rigid-body-object-method-39 this) + (vehicle-method-103 this) + (set! (-> this hit-points) 1.0) + (set! (-> this damage-factor) (-> this info damage-factor)) + (set! (-> this crash-level) 0) + (set! (-> this power-fluctuation-factor) 0.02) + (set! (-> this power-level) 1.0) + (set! (-> this flight-level-index) 0) + (let ((a1-0 (-> this root trans))) + (set! (-> this flight-level) (get-height-at-point *traffic-height-map* a1-0)) ) - (set! (-> obj lights-factor) 0.0) - (let ((a0-8 (-> obj info color-option-select))) - (set! (-> obj draw color-mult quad) (-> obj info color-option-array a0-8 quad)) + (set! (-> this lights-factor) 0.0) + (let ((a0-8 (-> this info color-option-select))) + (set! (-> this draw color-mult quad) (-> this info color-option-array a0-8 quad)) ) - (+! (-> obj info color-option-select) 1) - (when (>= (-> obj info color-option-select) (-> obj info color-option-count)) - (set! (-> obj info color-option-select) 0) + (+! (-> this info color-option-select) 1) + (when (>= (-> this info color-option-select) (-> this info color-option-count)) + (set! (-> this info color-option-select) 0) 0 ) - (dotimes (s5-0 (-> obj info section-count)) - (let ((v1-34 (-> obj section-array s5-0))) + (dotimes (s5-0 (-> this info section-count)) + (let ((v1-34 (-> this section-array s5-0))) (set! (-> v1-34 damage) 0.0) ) - (vehicle-method-118 obj s5-0) + (vehicle-method-118 this s5-0) ) 0 (none) ) -(defmethod vehicle-method-101 vehicle ((obj vehicle)) - (set! (-> obj hit-points) 1.0) +(defmethod vehicle-method-101 vehicle ((this vehicle)) + (set! (-> this hit-points) 1.0) 0 (none) ) -(defmethod vehicle-method-134 vehicle ((obj vehicle) (arg0 process)) +(defmethod vehicle-method-134 vehicle ((this vehicle) (arg0 process)) "Stubbed" 0 (none) ) -(defmethod vehicle-method-76 vehicle ((obj vehicle) (arg0 int) (arg1 uint)) - (when (< (-> obj crash-level) arg0) - (set! (-> obj crash-level) arg0) - (set! (-> obj crash-duration) arg1) - (set! (-> obj crash-time) (current-time)) - (set! (-> obj force-scale) 0.0) - (when (>= (-> obj crash-level) 2) +(defmethod vehicle-method-76 vehicle ((this vehicle) (arg0 int) (arg1 uint)) + (when (< (-> this crash-level) arg0) + (set! (-> this crash-level) arg0) + (set! (-> this crash-duration) arg1) + (set-time! (-> this crash-time)) + (set! (-> this force-scale) 0.0) + (when (>= (-> this crash-level) 2) (sound-play "bike-engine-off") - (vehicle-method-83 obj) + (vehicle-method-83 this) ) ) - (when (and (>= 0.0 (-> obj hit-points)) (!= (-> obj crash-level) 3)) - (logior! (-> obj flags) (rigid-body-object-flag dead)) - (set! (-> obj crash-level) 3) - (set! (-> obj crash-duration) (the-as uint 1500)) - (set! (-> obj crash-time) (current-time)) + (when (and (>= 0.0 (-> this hit-points)) (!= (-> this crash-level) 3)) + (logior! (-> this flags) (rigid-body-object-flag dead)) + (set! (-> this crash-level) 3) + (set! (-> this crash-duration) (the-as uint 1500)) + (set-time! (-> this crash-time)) ) 0 (none) ) -(defmethod vehicle-method-77 vehicle ((obj vehicle)) - (set! (-> obj crash-level) 0) +(defmethod vehicle-method-77 vehicle ((this vehicle)) + (set! (-> this crash-level) 0) 0 (none) ) -(defmethod vehicle-method-78 vehicle ((obj vehicle) (arg0 int)) - (set! (-> obj flight-level-index-prev) (-> obj flight-level-index)) - (set! (-> obj flight-level-index) arg0) - (logior! (-> obj flags) (rigid-body-object-flag flight-level-transition camera-rapid-track-mode)) - (logclear! (-> obj flags) (rigid-body-object-flag flight-level-transition-ending)) - (set! (-> obj transition-time) (current-time)) - (vehicle-method-91 obj) +(defmethod vehicle-method-78 vehicle ((this vehicle) (arg0 int)) + (set! (-> this flight-level-index-prev) (-> this flight-level-index)) + (set! (-> this flight-level-index) arg0) + (logior! (-> this flags) (rigid-body-object-flag flight-level-transition camera-rapid-track-mode)) + (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) + (set-time! (-> this transition-time)) + (vehicle-method-91 this) 0 (none) ) -(defmethod vehicle-method-79 vehicle ((obj vehicle)) - (logclear! (-> obj flags) (rigid-body-object-flag flight-level-transition)) - (logior! (-> obj flags) (rigid-body-object-flag flight-level-transition-ending)) - (set! (-> obj transition-end-time) (current-time)) +(defmethod vehicle-method-79 vehicle ((this vehicle)) + (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition)) + (logior! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) + (set-time! (-> this transition-end-time)) 0 (none) ) -(defmethod vehicle-method-131 vehicle ((obj vehicle)) - (if (not (logtest? (rigid-body-object-flag lights-dead) (-> obj flags))) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-on lights-update) (-> obj flags))) +(defmethod vehicle-method-131 vehicle ((this vehicle)) + (if (not (logtest? (rigid-body-object-flag lights-dead) (-> this flags))) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-on lights-update) (-> this flags))) ) ) 0 (none) ) -(defmethod vehicle-method-132 vehicle ((obj vehicle)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag lights-on))) +(defmethod vehicle-method-132 vehicle ((this vehicle)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag lights-on))) ) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-update) (-> obj flags))) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-update) (-> this flags))) ) 0 (none) ) -(defmethod vehicle-method-139 vehicle ((obj vehicle)) - (when (not (logtest? (rigid-body-object-flag ignition) (-> obj flags))) - (logior! (-> obj flags) (rigid-body-object-flag ignition)) +(defmethod vehicle-method-139 vehicle ((this vehicle)) + (when (not (logtest? (rigid-body-object-flag ignition) (-> this flags))) + (logior! (-> this flags) (rigid-body-object-flag ignition)) (sound-play "vehicl-ignition") - (let ((s5-1 (-> obj node-list data 0 bone transform)) + (let ((s5-1 (-> this node-list data 0 bone transform)) (s4-1 (new 'stack-no-clear 'merc-matrix)) ) (set-vector! (-> s4-1 vector 2) 0.0 1.0 0.0 1.0) (mem-copy! (the-as pointer (-> s4-1 vector 4)) (the-as pointer s5-1) 64) (dotimes (s3-0 2) - (vector-matrix*! (the-as vector (-> s4-1 vector)) (-> obj info exhaust-local-pos s3-0) s5-1) - (vector-rotate*! (-> s4-1 vector 1) (-> obj info exhaust-local-dir s3-0) s5-1) + (vector-matrix*! (the-as vector (-> s4-1 vector)) (-> this info exhaust-local-pos s3-0) s5-1) + (vector-rotate*! (-> s4-1 vector 1) (-> this info exhaust-local-dir s3-0) s5-1) (vector-cross! (-> s4-1 vector 3) (-> s4-1 vector 1) (-> s4-1 vector 2)) (vector-normalize! (-> s4-1 vector 3) 1.0) (vector-cross! (-> s4-1 vector 6) (-> s4-1 vector 3) (-> s4-1 vector 1)) @@ -835,67 +835,67 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-140 vehicle ((obj vehicle)) - (if (logtest? (rigid-body-object-flag ignition) (-> obj flags)) - (logclear! (-> obj flags) (rigid-body-object-flag ignition)) +(defmethod vehicle-method-140 vehicle ((this vehicle)) + (if (logtest? (rigid-body-object-flag ignition) (-> this flags)) + (logclear! (-> this flags) (rigid-body-object-flag ignition)) ) 0 (none) ) -(defmethod vehicle-method-141 vehicle ((obj vehicle)) - (let ((a0-2 (find-nearest-nav-mesh (-> obj root trans) (the-as float #x7f800000)))) +(defmethod vehicle-method-141 vehicle ((this vehicle)) + (let ((a0-2 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) (when a0-2 - (add-process-drawable-to-navmesh a0-2 obj #t) - (logclear! (-> obj nav flags) (nav-control-flag output-sphere-hash)) + (add-process-drawable-to-navmesh a0-2 this #t) + (logclear! (-> this nav flags) (nav-control-flag output-sphere-hash)) ) ) 0 (none) ) -(defmethod vehicle-method-142 vehicle ((obj vehicle)) - (let ((v1-0 (-> obj nav))) +(defmethod vehicle-method-142 vehicle ((this vehicle)) + (let ((v1-0 (-> this nav))) (when v1-0 - (remove-process-drawable (-> v1-0 state mesh) obj) - (set! (-> obj nav) #f) + (remove-process-drawable (-> v1-0 state mesh) this) + (set! (-> this nav) #f) ) ) 0 (none) ) -(defmethod vehicle-method-143 vehicle ((obj vehicle)) - (let ((v1-2 (or (logtest? (-> obj flags) (rigid-body-object-flag dead waiting-for-player)) - (and (logtest? (rigid-body-object-flag player-driving ai-driving) (-> obj flags)) - (not (logtest? (-> obj flags) (rigid-body-object-flag on-flight-level))) +(defmethod vehicle-method-143 vehicle ((this vehicle)) + (let ((v1-2 (or (logtest? (-> this flags) (rigid-body-object-flag dead waiting-for-player)) + (and (logtest? (rigid-body-object-flag player-driving ai-driving) (-> this flags)) + (not (logtest? (-> this flags) (rigid-body-object-flag on-flight-level))) ) ) ) - (s5-0 (-> obj nav)) + (s5-0 (-> this nav)) ) (cond (v1-2 (cond (s5-0 - (do-navigation-to-destination (-> s5-0 state) (-> obj root trans)) + (do-navigation-to-destination (-> s5-0 state) (-> this root trans)) (when (not (logtest? (-> s5-0 state flags) (nav-state-flag in-mesh))) - (let ((a0-6 (find-nearest-nav-mesh (-> obj root trans) (the-as float #x7f800000)))) + (let ((a0-6 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) (when (and a0-6 (!= a0-6 (-> s5-0 state mesh))) - (change-to a0-6 obj) - (logclear! (-> obj nav flags) (nav-control-flag output-sphere-hash)) + (change-to a0-6 this) + (logclear! (-> this nav flags) (nav-control-flag output-sphere-hash)) ) ) ) ) (else - (vehicle-method-141 obj) + (vehicle-method-141 this) ) ) ) (else (if s5-0 - (vehicle-method-142 obj) + (vehicle-method-142 this) ) ) ) @@ -904,20 +904,20 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-87 vehicle ((obj vehicle)) - (when (not (logtest? (rigid-body-object-flag camera) (-> obj flags))) - (logior! (-> obj flags) (rigid-body-object-flag camera)) - (set! (-> obj cam-speed-interp) 0.0) - (set-setting! 'string-min-height 'abs (-> obj info camera-string-min-height) 0) - (set-setting! 'string-max-height 'abs (-> obj info camera-string-max-height) 0) - (set-setting! 'head-offset 'abs (-> obj info camera-head-offset) 0) - (set-setting! 'foot-offset 'abs (-> obj info camera-foot-offset) 0) +(defmethod vehicle-method-87 vehicle ((this vehicle)) + (when (not (logtest? (rigid-body-object-flag camera) (-> this flags))) + (logior! (-> this flags) (rigid-body-object-flag camera)) + (set! (-> this cam-speed-interp) 0.0) + (set-setting! 'string-min-height 'abs (-> this info camera-string-min-height) 0) + (set-setting! 'string-max-height 'abs (-> this info camera-string-max-height) 0) + (set-setting! 'head-offset 'abs (-> this info camera-head-offset) 0) + (set-setting! 'foot-offset 'abs (-> this info camera-foot-offset) 0) (set-setting! 'target-height 'abs (meters 0) 0) - (vehicle-method-92 obj) - (vehicle-method-89 obj) + (vehicle-method-92 this) + (vehicle-method-89 this) (persist-with-delay *setting-control* 'mode-name (seconds 0.2) 'mode-name 'cam-fixed 0.0 0) (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) - (let ((v1-27 (process->ppointer obj))) + (let ((v1-27 (process->ppointer this))) (persist-with-delay *setting-control* 'butt-handle @@ -933,10 +933,10 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-88 vehicle ((obj vehicle)) - (when (logtest? (rigid-body-object-flag camera) (-> obj flags)) - (vehicle-method-92 obj) - (vehicle-method-90 obj) +(defmethod vehicle-method-88 vehicle ((this vehicle)) + (when (logtest? (rigid-body-object-flag camera) (-> this flags)) + (vehicle-method-92 this) + (vehicle-method-90 this) (remove-setting! 'rapid-tracking) (remove-setting! 'fov) (remove-setting! 'string-camera-ceiling) @@ -962,61 +962,61 @@ This commonly includes things such as: 0.0 0 ) - (logclear! (-> obj flags) (rigid-body-object-flag camera)) + (logclear! (-> this flags) (rigid-body-object-flag camera)) ) 0 (none) ) -(defmethod vehicle-method-89 vehicle ((obj vehicle)) - (when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> obj flags))) - (logior! (-> obj flags) (rigid-body-object-flag camera-bike-mode)) +(defmethod vehicle-method-89 vehicle ((this vehicle)) + (when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags))) + (logior! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (set-setting! 'bike-mode #f 0.0 0) ) 0 (none) ) -(defmethod vehicle-method-90 vehicle ((obj vehicle)) - (when (logtest? (rigid-body-object-flag camera-bike-mode) (-> obj flags)) - (logclear! (-> obj flags) (rigid-body-object-flag camera-bike-mode)) +(defmethod vehicle-method-90 vehicle ((this vehicle)) + (when (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags)) + (logclear! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (remove-setting! 'bike-mode) ) 0 (none) ) -(defmethod vehicle-method-91 vehicle ((obj vehicle)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (logior! (-> obj flags) (rigid-body-object-flag camera-rapid-track-mode)) +(defmethod vehicle-method-91 vehicle ((this vehicle)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (logior! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (set-setting! 'rapid-tracking #f 0.0 0) ) 0 (none) ) -(defmethod vehicle-method-92 vehicle ((obj vehicle)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (logclear! (-> obj flags) (rigid-body-object-flag camera-rapid-track-mode)) +(defmethod vehicle-method-92 vehicle ((this vehicle)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (logclear! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (remove-setting! 'rapid-tracking) ) 0 (none) ) -(defmethod rigid-body-object-method-40 vehicle ((obj vehicle)) - (logior! (-> obj flags) (rigid-body-object-flag enable-collision)) - (let ((v1-3 (-> obj root root-prim))) - (set! (-> v1-3 prim-core collide-as) (-> obj root backup-collide-as)) - (set! (-> v1-3 prim-core collide-with) (-> obj root backup-collide-with)) +(defmethod rigid-body-object-method-40 vehicle ((this vehicle)) + (logior! (-> this flags) (rigid-body-object-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> this root backup-collide-with)) ) 0 (none) ) -(defmethod rigid-body-object-method-41 vehicle ((obj vehicle)) - (logclear! (-> obj flags) (rigid-body-object-flag enable-collision)) - (let ((v1-3 (-> obj root root-prim))) +(defmethod rigid-body-object-method-41 vehicle ((this vehicle)) + (logclear! (-> this flags) (rigid-body-object-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) @@ -1025,8 +1025,8 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-102 vehicle ((obj vehicle)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod vehicle-method-102 vehicle ((this vehicle)) + (let ((v1-1 (-> this draw shadow-ctrl))) (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 @@ -1034,8 +1034,8 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-103 vehicle ((obj vehicle)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod vehicle-method-103 vehicle ((this vehicle)) + (let ((v1-1 (-> this draw shadow-ctrl))) (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 @@ -1043,28 +1043,28 @@ This commonly includes things such as: (none) ) -(defmethod rigid-body-object-method-38 vehicle ((obj vehicle)) - (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (rigid-body-method-26 (-> obj rbody state) (-> obj root trans) (-> obj root quat)) - (vector-float*! (-> obj rbody state lin-momentum) (-> obj root transv) (-> obj info info mass)) - (vector-reset! (-> obj rbody state ang-momentum)) - (vector-reset! (-> obj lin-acceleration)) +(defmethod rigid-body-object-method-38 vehicle ((this vehicle)) + (when (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) + (logior! (-> this rbody state flags) (rigid-body-flag enable-physics)) + (rigid-body-method-26 (-> this rbody state) (-> this root trans) (-> this root quat)) + (vector-float*! (-> this rbody state lin-momentum) (-> this root transv) (-> this info info mass)) + (vector-reset! (-> this rbody state ang-momentum)) + (vector-reset! (-> this lin-acceleration)) ) 0 (none) ) -(defmethod rigid-body-object-method-39 vehicle ((obj vehicle)) - (set! (-> obj force-scale) 1.0) - (logclear! (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (vehicle-method-110 obj) +(defmethod rigid-body-object-method-39 vehicle ((this vehicle)) + (set! (-> this force-scale) 1.0) + (logclear! (-> this rbody state flags) (rigid-body-flag enable-physics)) + (vehicle-method-110 this) 0 (none) ) -(defmethod vehicle-method-111 vehicle ((obj vehicle) (arg0 object) (arg1 target)) - (let ((a0-1 (-> obj controller traffic))) +(defmethod vehicle-method-111 vehicle ((this vehicle) (arg0 object) (arg1 target)) + (let ((a0-1 (-> this controller traffic))) (when (and (nonzero? a0-1) arg1) (if #t (increase-alert-level a0-1 (the-as int arg0) arg1) @@ -1075,21 +1075,21 @@ This commonly includes things such as: (none) ) -(defmethod decrease-traffic-alert-level vehicle ((obj vehicle) (arg0 int)) - (decrease-alert-level (-> obj controller traffic) arg0) +(defmethod decrease-traffic-alert-level vehicle ((this vehicle) (arg0 int)) + (decrease-alert-level (-> this controller traffic) arg0) 0 ) -(defmethod vehicle-method-80 vehicle ((obj vehicle)) - (when (and (logtest? (-> obj info flags) 64) (< (-> obj flight-level-index) 1)) +(defmethod vehicle-method-80 vehicle ((this vehicle)) + (when (and (logtest? (-> this info flags) 64) (< (-> this flight-level-index) 1)) 1 (cond - ((< (+ 8192.0 (-> obj rbody state position y)) (-> obj flight-level)) + ((< (+ 8192.0 (-> this rbody state position y)) (-> this flight-level)) (sound-play "bike-up") - (vehicle-method-78 obj 1) + (vehicle-method-78 this 1) ) (else - (set! (-> obj flight-level-index) 1) + (set! (-> this flight-level-index) 1) ) ) ) @@ -1097,127 +1097,129 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-81 vehicle ((obj vehicle)) - (when (and (logtest? (-> obj info flags) 64) (> (-> obj flight-level-index) 0)) +(defmethod vehicle-method-81 vehicle ((this vehicle)) + (when (and (logtest? (-> this info flags) 64) (> (-> this flight-level-index) 0)) (sound-play "bike-down") - (vehicle-method-78 obj 0) + (vehicle-method-78 this 0) ) 0 (none) ) -(defmethod vehicle-method-83 vehicle ((obj vehicle)) - (logclear! (-> obj flags) (rigid-body-object-flag flight-level-transition)) - (vehicle-method-92 obj) - (set! (-> obj flight-level-index) 0) +(defmethod vehicle-method-83 vehicle ((this vehicle)) + (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition)) + (vehicle-method-92 this) + (set! (-> this flight-level-index) 0) 0 (none) ) -(defmethod vehicle-method-108 vehicle ((obj vehicle)) - (vehicle-controller-method-11 (-> obj controller)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> obj flags))) +(defmethod vehicle-method-108 vehicle ((this vehicle)) + (vehicle-controller-method-11 (-> this controller)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> this flags))) ) - (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others)) + (logior! (-> this controller flags) (vehicle-controller-flag ignore-others)) 0 (none) ) -(defmethod vehicle-method-109 vehicle ((obj vehicle)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag in-pursuit))) +(defmethod vehicle-method-109 vehicle ((this vehicle)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag in-pursuit))) ) - (logclear! (-> obj controller flags) (vehicle-controller-flag ignore-others direct-mode)) - (vehicle-method-107 obj) + (logclear! (-> this controller flags) (vehicle-controller-flag ignore-others direct-mode)) + (vehicle-method-107 this) 0 (none) ) -(defmethod rigid-body-object-method-42 vehicle ((obj vehicle)) - (if (and (not (focus-test? obj inactive)) (not (and (-> obj next-state) (= (-> obj next-state name) 'explode)))) - ((method-of-type rigid-body-object rigid-body-object-method-42) obj) +(defmethod rigid-body-object-method-42 vehicle ((this vehicle)) + (if (and (not (focus-test? this inactive)) + (not (and (-> this next-state) (= (-> this next-state name) 'explode))) + ) + ((method-of-type rigid-body-object rigid-body-object-method-42) this) ) 0 (none) ) -(defmethod vehicle-method-113 vehicle ((obj vehicle)) - (vehicle-method-127 obj) - (logior! (-> obj focus-status) (focus-status inactive)) - (set! (-> obj event-hook) (-> (method-of-object obj inactive) event)) - (go (method-of-object obj inactive)) +(defmethod vehicle-method-113 vehicle ((this vehicle)) + (vehicle-method-127 this) + (logior! (-> this focus-status) (focus-status inactive)) + (set! (-> this event-hook) (-> (method-of-object this inactive) event)) + (go (method-of-object this inactive)) 0 (none) ) -(defmethod vehicle-method-114 vehicle ((obj vehicle)) - (if (focus-test? obj inactive) - (vehicle-method-128 obj) +(defmethod vehicle-method-114 vehicle ((this vehicle)) + (if (focus-test? this inactive) + (vehicle-method-128 this) ) - (go (method-of-object obj active)) + (go (method-of-object this active)) 0 (none) ) -(defmethod rigid-body-object-method-43 vehicle ((obj vehicle)) - (go (method-of-object obj waiting)) +(defmethod rigid-body-object-method-43 vehicle ((this vehicle)) + (go (method-of-object this waiting)) 0 (none) ) -(defmethod vehicle-method-138 vehicle ((obj vehicle)) - (go (method-of-object obj player-control)) +(defmethod vehicle-method-138 vehicle ((this vehicle)) + (go (method-of-object this player-control)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-130 vehicle ((obj vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-130 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) - (vehicle-method-82 obj) - (logior! (-> obj flags) (rigid-body-object-flag persistent)) - (logclear! (-> obj draw status) (draw-control-status no-draw)) - (logior! (-> obj skel status) (joint-control-status sync-math)) + (vehicle-method-82 this) + (logior! (-> this flags) (rigid-body-object-flag persistent)) + (logclear! (-> this draw status) (draw-control-status no-draw)) + (logior! (-> this skel status) (joint-control-status sync-math)) (ja-post) - (update-transforms (-> obj root)) - (logclear! (-> obj skel status) (joint-control-status sync-math)) - (go (method-of-object obj idle)) + (update-transforms (-> this root)) + (logclear! (-> this skel status) (joint-control-status sync-math)) + (go (method-of-object this idle)) ) ((= v1-0 2) (let ((a1-1 (-> arg0 nav-branch))) (if a1-1 - (vehicle-controller-method-13 (-> obj controller) a1-1 (-> obj root trans)) + (vehicle-controller-method-13 (-> this controller) a1-1 (-> this root trans)) ) ) - (vehicle-method-128 obj) - (go (method-of-object obj active)) + (vehicle-method-128 this) + (go (method-of-object this active)) ) (else - (vehicle-method-113 obj) + (vehicle-method-113 this) ) ) ) (none) ) -(defmethod vehicle-method-136 vehicle ((obj vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-136 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((= v1-0 1) - (vehicle-method-135 obj arg0) - (vehicle-method-113 obj) + (vehicle-method-135 this arg0) + (vehicle-method-113 this) ) ((zero? v1-0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-0 4) - (go (method-of-object obj player-control)) + (go (method-of-object this player-control)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) ) @@ -1225,28 +1227,28 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-127 vehicle ((obj vehicle)) - (let ((s5-0 (-> obj child))) +(defmethod vehicle-method-127 vehicle ((this vehicle)) + (let ((s5-0 (-> this child))) (while s5-0 (send-event (ppointer->process s5-0) 'traffic-off) (set! s5-0 (-> s5-0 0 brother)) ) ) - (dotimes (s5-1 (-> obj info seat-count)) - (put-rider-in-seat obj s5-1 (the-as process-focusable #f)) + (dotimes (s5-1 (-> this info seat-count)) + (put-rider-in-seat this s5-1 (the-as process-focusable #f)) ) - (vehicle-method-142 obj) - (vehicle-controller-method-11 (-> obj controller)) - (vehicle-method-110 obj) + (vehicle-method-142 this) + (vehicle-controller-method-11 (-> this controller)) + (vehicle-method-110 this) 0 (none) ) -(defmethod vehicle-method-128 vehicle ((obj vehicle)) - (vehicle-method-82 obj) - (set! (-> obj root trans y) (-> obj flight-level)) - (logior! (-> obj flags) (rigid-body-object-flag ignition ai-driving)) - (let ((gp-1 (-> obj child))) +(defmethod vehicle-method-128 vehicle ((this vehicle)) + (vehicle-method-82 this) + (set! (-> this root trans y) (-> this flight-level)) + (logior! (-> this flags) (rigid-body-object-flag ignition ai-driving)) + (let ((gp-1 (-> this child))) (while gp-1 (send-event (ppointer->process gp-1) 'traffic-on) (set! gp-1 (-> gp-1 0 brother)) @@ -1256,37 +1258,37 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-129 vehicle ((obj vehicle)) - (if (= obj *debug-actor*) +(defmethod vehicle-method-129 vehicle ((this vehicle)) + (if (= this *debug-actor*) (format #t "hook-dead~%") ) - (logior! (-> obj focus-status) (focus-status dead)) - (vehicle-controller-method-11 (-> obj controller)) - (vehicle-method-140 obj) - (set! (-> obj flags) + (logior! (-> this focus-status) (focus-status dead)) + (vehicle-controller-method-11 (-> this controller)) + (vehicle-method-140 this) + (set! (-> this flags) (the-as rigid-body-object-flag - (logclear (-> obj flags) (rigid-body-object-flag riding player-driving in-pursuit target-in-sight)) + (logclear (-> this flags) (rigid-body-object-flag riding player-driving in-pursuit target-in-sight)) ) ) - (set! (-> obj controls throttle) 0.0) - (set! (-> obj controls steering) 0.0) - (vehicle-method-83 obj) + (set! (-> this controls throttle) 0.0) + (set! (-> this controls steering) 0.0) + (vehicle-method-83 this) 0 (none) ) -(defmethod vehicle-method-137 vehicle ((obj vehicle) (arg0 traffic-object-spawn-params)) - (vehicle-rider-spawn obj citizen-norm-rider arg0) +(defmethod vehicle-method-137 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) + (vehicle-rider-spawn this citizen-norm-rider arg0) 0 (none) ) -(defmethod vehicle-method-105 vehicle ((obj vehicle)) - (logtest? (rigid-body-object-flag disturbed player-touching player-driving in-pursuit) (-> obj flags)) +(defmethod vehicle-method-105 vehicle ((this vehicle)) + (logtest? (rigid-body-object-flag disturbed player-touching player-driving in-pursuit) (-> this flags)) ) -(defmethod vehicle-method-106 vehicle ((obj vehicle)) +(defmethod vehicle-method-106 vehicle ((this vehicle)) (local-vars (v1-13 float) (v1-25 float) (v1-30 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1294,13 +1296,13 @@ This commonly includes things such as: (vf2 :class vf) ) (init-vf0-vector) - (when (>= (- (current-time) (-> obj disturbed-time)) (seconds 2)) + (when (time-elapsed? (-> this disturbed-time) (seconds 2)) (cond - ((logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) - (when (and (not (logtest? (-> obj controller flags) (vehicle-controller-flag off-path))) - (>= (-> obj rbody state matrix vector 1 y) (cos 910.2222)) + ((logtest? (rigid-body-object-flag ai-driving) (-> this flags)) + (when (and (not (logtest? (-> this controller flags) (vehicle-controller-flag off-path))) + (>= (-> this rbody state matrix vector 1 y) (cos 910.2222)) ) - (.lvf vf1 (&-> (-> obj rbody state ang-velocity) quad)) + (.lvf vf1 (&-> (-> this rbody state ang-velocity) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -1311,18 +1313,18 @@ This commonly includes things such as: (f1-0 0.5) ) (if (< f0-1 (* f1-0 f1-0)) - (logclear! (-> obj flags) (rigid-body-object-flag disturbed)) + (logclear! (-> this flags) (rigid-body-object-flag disturbed)) ) ) ) ) (else - (when (>= (-> obj rbody state matrix vector 1 y) (cos 910.2222)) - (let* ((f0-3 (-> obj camera-dist2)) + (when (>= (-> this rbody state matrix vector 1 y) (cos 910.2222)) + (let* ((f0-3 (-> this camera-dist2)) (f1-3 0.000024414063) (f0-4 (* f0-3 (* f1-3 f1-3))) ) - (.lvf vf1 (&-> (-> obj rbody state ang-velocity) quad)) + (.lvf vf1 (&-> (-> this rbody state ang-velocity) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -1330,7 +1332,7 @@ This commonly includes things such as: (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-25 vf1) (when (and (< v1-25 f0-4) (begin - (.lvf vf1 (&-> (-> obj rbody state lin-velocity) quad)) + (.lvf vf1 (&-> (-> this rbody state lin-velocity) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -1344,8 +1346,8 @@ This commonly includes things such as: ) ) ) - (logclear! (-> obj flags) (rigid-body-object-flag disturbed)) - (clear-momentum! (-> obj rbody state)) + (logclear! (-> this flags) (rigid-body-object-flag disturbed)) + (clear-momentum! (-> this rbody state)) ) ) ) @@ -1357,29 +1359,29 @@ This commonly includes things such as: ) ) -(defmethod update-joint-mods vehicle ((obj vehicle)) +(defmethod update-joint-mods vehicle ((this vehicle)) 0 (none) ) ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. -(defmethod vehicle-method-107 vehicle ((obj vehicle)) - (logclear! (-> obj controller flags) (vehicle-controller-flag ignore-others direct-mode)) +(defmethod vehicle-method-107 vehicle ((this vehicle)) + (logclear! (-> this controller flags) (vehicle-controller-flag ignore-others direct-mode)) (let ((s5-0 (new 'stack-no-clear 'vehicle-control-point))) - (set! (-> s5-0 local-pos quad) (-> obj root trans quad)) - (set! (-> s5-0 normal quad) (-> obj root transv quad)) + (set! (-> s5-0 local-pos quad) (-> this root trans quad)) + (set! (-> s5-0 normal quad) (-> this root transv quad)) (set! (-> s5-0 local-pos w) 40960.0) (let ((s4-0 0)) (label cfg-1) - (let ((v1-7 (find-best-segment (-> obj controller traffic) (-> s5-0 local-pos) (-> s5-0 normal) 0))) + (let ((v1-7 (find-best-segment (-> this controller traffic) (-> s5-0 local-pos) (-> s5-0 normal) 0))) (when (and (not v1-7) (< s4-0 3)) (+! (-> s5-0 local-pos w) 40960.0) (+! s4-0 1) (goto cfg-1) ) (if v1-7 - (vehicle-controller-method-13 (-> obj controller) (-> v1-7 branch) (-> obj root trans)) - (vehicle-method-113 obj) + (vehicle-controller-method-13 (-> this controller) (-> v1-7 branch) (-> this root trans)) + (vehicle-method-113 this) ) ) ) @@ -1388,14 +1390,14 @@ This commonly includes things such as: (none) ) -(defmethod vehicle-method-119 vehicle ((obj vehicle)) - (dotimes (s5-0 (-> obj info seat-count)) - (let ((s4-0 (handle->process (-> obj rider-array s5-0)))) +(defmethod vehicle-method-119 vehicle ((this vehicle)) + (dotimes (s5-0 (-> this info seat-count)) + (let ((s4-0 (handle->process (-> this rider-array s5-0)))) (when (and s4-0 (focus-test? (the-as vehicle-rider s4-0) pilot-riding)) - (compute-seat-position obj (-> (the-as vehicle-rider s4-0) root trans) s5-0) - (set! (-> (the-as vehicle-rider s4-0) root transv quad) (-> obj root transv quad)) - (let ((f0-1 (the float (-> obj info seat-array s5-0 angle)))) - (quaternion-rotate-local-y! (-> (the-as vehicle-rider s4-0) root quat) (-> obj root quat) f0-1) + (compute-seat-position this (-> (the-as vehicle-rider s4-0) root trans) s5-0) + (set! (-> (the-as vehicle-rider s4-0) root transv quad) (-> this root transv quad)) + (let ((f0-1 (the float (-> this info seat-array s5-0 angle)))) + (quaternion-rotate-local-y! (-> (the-as vehicle-rider s4-0) root quat) (-> this root quat) f0-1) ) ) ) diff --git a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc index d1dd809f8a..7280b4e320 100644 --- a/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak2/levels/city/traffic/vehicle/vehicle.gc @@ -78,7 +78,7 @@ ) ) -(defmethod rigid-body-object-method-45 vehicle ((obj vehicle) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 vehicle ((this vehicle) (arg0 rigid-body-impact)) (local-vars (v1-63 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -86,35 +86,35 @@ (vf2 :class vf) ) (init-vf0-vector) - (set! (-> obj impact-pos quad) (-> arg0 point quad)) + (set! (-> this impact-pos quad) (-> arg0 point quad)) (let* ((f0-0 1.0) (f1-0 (-> arg0 impulse)) (f2-0 61440.0) - (f30-0 (fmin f0-0 (* f1-0 (/ 1.0 f2-0) (-> obj info info inv-mass)))) - (f28-0 (* (-> obj info info mass) (-> obj info toughness-factor))) + (f30-0 (fmin f0-0 (* f1-0 (/ 1.0 f2-0) (-> this info info inv-mass)))) + (f28-0 (* (-> this info info mass) (-> this info toughness-factor))) ) - (set! (-> obj crash-impulse) (-> arg0 impulse)) + (set! (-> this crash-impulse) (-> arg0 impulse)) (cond ((< (* 286720.0 f28-0) (-> arg0 impulse)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 1)) ) - (apply-damage obj 1.0 arg0) - (vehicle-method-76 obj 2 (the-as uint 300)) + (apply-damage this 1.0 arg0) + (vehicle-method-76 this 2 (the-as uint 300)) ) ((< (* 131072.0 f28-0) (-> arg0 impulse)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) ) - (apply-damage obj 0.25 arg0) - (vehicle-method-76 obj 1 (the-as uint 75)) + (apply-damage this 0.25 arg0) + (vehicle-method-76 this 1 (the-as uint 75)) ) ((< (* 102400.0 f28-0) (-> arg0 impulse)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.25)) ) - (apply-damage obj 0.125 arg0) - (vehicle-method-76 obj 1 (the-as uint 75)) + (apply-damage this 0.125 arg0) + (vehicle-method-76 this 1 (the-as uint 75)) ) (else (let* ((f0-9 0.0) @@ -122,16 +122,16 @@ (f2-5 (* 16384000.0 f28-0)) (f0-10 (fmax f0-9 (* f1-7 (/ 1.0 f2-5)))) ) - (apply-damage obj f0-10 arg0) + (apply-damage this f0-10 arg0) ) (when (< (* 32768.0 f28-0) (-> arg0 impulse)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) ) ) (if (< 0.1 f30-0) (sound-play-by-name - (-> obj info glance-sound) + (-> this info glance-sound) (new-sound-id) (the int (* 1024.0 f30-0)) 0 @@ -144,7 +144,7 @@ ) (when (< (* 102400.0 f28-0) (-> arg0 impulse)) (sound-play-by-name - (-> obj info impact-sound) + (-> this info impact-sound) (new-sound-id) (the int (* 1024.0 f30-0)) 0 @@ -152,7 +152,7 @@ (sound-group sfx) #t ) - (logclear! (-> obj flags) (rigid-body-object-flag turbo-boost)) + (logclear! (-> this flags) (rigid-body-object-flag turbo-boost)) ) ) (let ((a0-17 (new 'stack-no-clear 'vector))) @@ -174,37 +174,37 @@ (f1-11 12288.0) ) (when (< (* f1-11 f1-11) f0-25) - (set! (-> obj scrape-sound-envelope) 1.0) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (set! (-> this scrape-sound-envelope) 1.0) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.05)) ) ) ) - (if (>= 0.0 (-> obj hit-points)) - (vehicle-method-76 obj 2 (the-as uint 300)) + (if (>= 0.0 (-> this hit-points)) + (vehicle-method-76 this 2 (the-as uint 300)) ) 0 (none) ) ) -(defmethod vehicle-method-104 vehicle ((obj vehicle)) - (when (= (-> obj controller traffic sync-mask-8) (ash 1 (logand (-> obj traffic-priority-id) 7))) - (let ((a1-0 (-> obj root trans))) - (set! (-> obj flight-level) (get-height-at-point *traffic-height-map* a1-0)) +(defmethod vehicle-method-104 vehicle ((this vehicle)) + (when (= (-> this controller traffic sync-mask-8) (ash 1 (logand (-> this traffic-priority-id) 7))) + (let ((a1-0 (-> this root trans))) + (set! (-> this flight-level) (get-height-at-point *traffic-height-map* a1-0)) ) ) - (set! (-> obj target-acceleration y) - (- (* 8.0 (- (-> obj flight-level) (-> obj root trans y))) (-> obj root transv y)) + (set! (-> this target-acceleration y) + (- (* 8.0 (- (-> this flight-level) (-> this root trans y))) (-> this root transv y)) ) - (vector-v++! (-> obj root transv) (-> obj target-acceleration)) - (vector-v++! (-> obj root trans) (-> obj root transv)) - (let* ((v1-14 (-> obj root transv)) + (vector-v++! (-> this root transv) (-> this target-acceleration)) + (vector-v++! (-> this root trans) (-> this root transv)) + (let* ((v1-14 (-> this root transv)) (f30-0 (sqrtf (+ (* (-> v1-14 x) (-> v1-14 x)) (* (-> v1-14 z) (-> v1-14 z))))) (s5-0 (new 'stack-no-clear 'vehicle-control-point)) ) (when (< 40.96 f30-0) - (vector-float*! (-> s5-0 normal) (-> obj root transv) (/ 1.0 f30-0)) + (vector-float*! (-> s5-0 normal) (-> this root transv) (/ 1.0 f30-0)) (quaternion-set! (the-as quaternion (-> s5-0 local-pos)) 0.0 @@ -216,11 +216,11 @@ (quaternion-rotate-local-z! (the-as quaternion (-> s5-0 local-pos)) (the-as quaternion (-> s5-0 local-pos)) - (* -0.08886719 (-> obj controls steering) (fmin 81920.0 f30-0)) + (* -0.08886719 (-> this controls steering) (fmin 81920.0 f30-0)) ) (quaternion-smooth-seek! - (-> obj root quat) - (-> obj root quat) + (-> this root quat) + (-> this root quat) (the-as quaternion (-> s5-0 local-pos)) (* 0.00014686584 (seconds-per-frame) f30-0) ) @@ -230,35 +230,35 @@ (none) ) -(defmethod vehicle-method-93 vehicle ((obj vehicle)) +(defmethod vehicle-method-93 vehicle ((this vehicle)) (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 vector 2 quad) (-> obj rbody state matrix quad 0)) - (set! (-> s5-0 trans quad) (-> obj rbody state matrix vector 2 quad)) - (let ((f28-0 (* (-> obj rbody state ang-velocity y) (vector-length (-> obj rbody state lin-velocity)))) + (set! (-> s5-0 vector 2 quad) (-> this rbody state matrix quad 0)) + (set! (-> s5-0 trans quad) (-> this rbody state matrix vector 2 quad)) + (let ((f28-0 (* (-> this rbody state ang-velocity y) (vector-length (-> this rbody state lin-velocity)))) (f30-0 (seconds-per-frame)) ) - (when (zero? (-> obj flight-level-index)) - (if (logtest? (-> obj flags) (rigid-body-object-flag riding)) - (vehicle-method-80 obj) + (when (zero? (-> this flight-level-index)) + (if (logtest? (-> this flags) (rigid-body-object-flag riding)) + (vehicle-method-80 this) ) ) - (vector-! (-> s5-0 vector 1) (-> obj target-acceleration) (-> obj lin-acceleration)) + (vector-! (-> s5-0 vector 1) (-> this target-acceleration) (-> this lin-acceleration)) (let ((f0-3 (* 0.00006 (vector-dot (-> s5-0 trans) (-> s5-0 vector 1)) f30-0))) (set! (-> s5-0 vector 0 y) (fmax 0.0 (fmin 1.0 (* 20.0 f0-3)))) (set! (-> s5-0 vector 0 z) (fmax 0.0 (fmin 1.0 (* -40.0 f0-3)))) - (if (= obj *debug-actor*) + (if (= this *debug-actor*) (format *stdcon* "delta-throttle ~f~%" f0-3) ) ) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-edge-grabbing)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-edge-grabbing)) (set! (-> s5-0 vector 0 y) 0.0) (set! (-> s5-0 vector 0 z) 1.0) - (logclear! (-> obj flags) (rigid-body-object-flag reverse-gear)) + (logclear! (-> this flags) (rigid-body-object-flag reverse-gear)) ) (let ((f0-7 (* 6.0 f30-0)) (f4-0 (* 0.00018024445 - (- (vector-dot (-> s5-0 vector 2) (-> obj target-acceleration)) f28-0) - (if (< (-> obj controls throttle) 0.0) + (- (vector-dot (-> s5-0 vector 2) (-> this target-acceleration)) f28-0) + (if (< (-> this controls throttle) 0.0) -1.0 1.0 ) @@ -267,17 +267,17 @@ ) ) (set! (-> s5-0 vector 0 x) - (fmax -1.0 (fmin 1.0 (+ (-> obj controls steering) (fmax (fmin f4-0 f0-7) (- f0-7))))) + (fmax -1.0 (fmin 1.0 (+ (-> this controls steering) (fmax (fmin f4-0 f0-7) (- f0-7))))) ) ) ) (set! (-> s5-0 vector 0 w) 0.0) - (vehicle-method-95 obj (the-as vector (-> s5-0 vector))) - (when (= obj *debug-actor*) + (vehicle-method-95 this (the-as vector (-> s5-0 vector))) + (when (= this *debug-actor*) (let ((v1-43 (-> s5-0 vector))) (format *stdcon* "steer ~f, throttle ~f, brake ~f~%" (-> v1-43 0 x) (-> v1-43 0 y) (-> v1-43 0 z)) ) - (let ((v1-45 (-> obj controls))) + (let ((v1-45 (-> this controls))) (format *stdcon* "steer ~f, throttle ~f, brake ~f~%" (-> v1-45 steering) (-> v1-45 throttle) (-> v1-45 brake)) ) ) @@ -286,26 +286,26 @@ (none) ) -(defmethod vehicle-method-95 vehicle ((obj vehicle) (arg0 vector)) - (seek! (-> obj controls steering) (-> arg0 x) (* 8.0 (seconds-per-frame))) - (seek! (-> obj controls lean-z) (-> arg0 w) (* 8.0 (seconds-per-frame))) - (logclear! (-> obj flags) (rigid-body-object-flag slide)) +(defmethod vehicle-method-95 vehicle ((this vehicle) (arg0 vector)) + (seek! (-> this controls steering) (-> arg0 x) (* 8.0 (seconds-per-frame))) + (seek! (-> this controls lean-z) (-> arg0 w) (* 8.0 (seconds-per-frame))) + (logclear! (-> this flags) (rigid-body-object-flag slide)) (let ((f0-10 (-> arg0 y)) (f30-0 (-> arg0 z)) ) (set! f30-0 (cond ((< 0.0 f0-10) - (logclear! (-> obj flags) (rigid-body-object-flag reverse-gear)) + (logclear! (-> this flags) (rigid-body-object-flag reverse-gear)) (when (< 0.0 f30-0) (set! f30-0 0.25) - (logior! (-> obj flags) (rigid-body-object-flag slide)) + (logior! (-> this flags) (rigid-body-object-flag slide)) ) f30-0 ) ((< 0.0 f30-0) (cond - ((logtest? (rigid-body-object-flag reverse-gear) (-> obj flags)) + ((logtest? (rigid-body-object-flag reverse-gear) (-> this flags)) (let ((f0-11 -0.5) (f1-5 0.0) (f2-0 -40960.0) @@ -313,23 +313,25 @@ (set! f0-10 (fmax f0-11 - (fmin f1-5 (* (/ 1.0 f2-0) - f30-0 - (- 8192.0 (vector-dot (-> obj rbody state lin-velocity) (-> obj rbody state matrix vector 2))) - ) - ) + (fmin + f1-5 + (* (/ 1.0 f2-0) + f30-0 + (- 8192.0 (vector-dot (-> this rbody state lin-velocity) (-> this rbody state matrix vector 2))) + ) + ) ) ) ) 0.0 ) (else - (let* ((v1-25 (-> obj rbody state lin-velocity)) + (let* ((v1-25 (-> this rbody state lin-velocity)) (f1-10 (+ (* (-> v1-25 x) (-> v1-25 x)) (* (-> v1-25 z) (-> v1-25 z)))) (f2-8 8192.0) ) (if (< f1-10 (* f2-8 f2-8)) - (logior! (-> obj flags) (rigid-body-object-flag reverse-gear)) + (logior! (-> this flags) (rigid-body-object-flag reverse-gear)) ) ) f30-0 @@ -337,43 +339,43 @@ ) ) (else - (logclear! (-> obj flags) (rigid-body-object-flag reverse-gear)) + (logclear! (-> this flags) (rigid-body-object-flag reverse-gear)) f30-0 ) ) ) - (seek! (-> obj controls throttle) f0-10 (* 4.0 (seconds-per-frame))) - (+! (-> obj controls brake) (* (- f30-0 (-> obj controls brake)) (fmin 1.0 (* 8.0 (seconds-per-frame))))) + (seek! (-> this controls throttle) f0-10 (* 4.0 (seconds-per-frame))) + (+! (-> this controls brake) (* (- f30-0 (-> this controls brake)) (fmin 1.0 (* 8.0 (seconds-per-frame))))) ) 0 (none) ) -(defmethod vehicle-method-94 vehicle ((obj vehicle)) +(defmethod vehicle-method-94 vehicle ((this vehicle)) (cond - ((or (logtest? (rigid-body-object-flag player-grabbed) (-> obj flags)) + ((or (logtest? (rigid-body-object-flag player-grabbed) (-> this flags)) (and *target* (focus-test? *target* dead grabbed)) ) (let ((v1-7 (new 'stack-no-clear 'vector))) (set! (-> v1-7 x) 0.0) (set! (-> v1-7 w) 0.0) (set! (-> v1-7 y) 0.0) - (set! (-> v1-7 z) (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) + (set! (-> v1-7 z) (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) 0.0 1.0 ) ) - (logclear! (-> obj flags) (rigid-body-object-flag reverse-gear)) - (vehicle-method-95 obj (the-as vector (&-> v1-7 x))) + (logclear! (-> this flags) (rigid-body-object-flag reverse-gear)) + (vehicle-method-95 this (the-as vector (&-> v1-7 x))) ) ) - ((and (zero? (-> obj crash-level)) - (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> obj flags))) + ((and (zero? (-> this crash-level)) + (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> this flags))) ) (when (and (cpad-pressed? 0 r2) (not *pause-lock*)) - (if (zero? (-> obj flight-level-index)) - (vehicle-method-80 obj) - (vehicle-method-81 obj) + (if (zero? (-> this flight-level-index)) + (vehicle-method-80 this) + (vehicle-method-81 this) ) ) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -381,13 +383,13 @@ (set! (-> s5-0 w) (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) (set! (-> s5-0 y) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 6))))) (set! (-> s5-0 z) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 7))))) - (vehicle-method-95 obj (the-as vector (&-> s5-0 x))) + (vehicle-method-95 this (the-as vector (&-> s5-0 x))) ) - (if (or (cpad-hold? 0 l1) (and (logtest? (-> obj info flags) 512) (cpad-hold? 0 r1))) - (start-jump obj) + (if (or (cpad-hold? 0 l1) (and (logtest? (-> this info flags) 512) (cpad-hold? 0 r1))) + (start-jump this) ) (if (cpad-pressed? 0 circle) - (vehicle-method-66 obj) + (vehicle-method-66 this) ) ) ) @@ -395,167 +397,167 @@ (none) ) -(defmethod vehicle-method-96 vehicle ((obj vehicle)) - (when (and *target* (logtest? (rigid-body-object-flag ignition) (-> obj flags))) - (when (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (zero? (-> obj root num-riders)) - (or (not *target*) (or (< 32768.0 (vector-vector-distance (-> obj root trans) (-> *target* control trans))) +(defmethod vehicle-method-96 vehicle ((this vehicle)) + (when (and *target* (logtest? (rigid-body-object-flag ignition) (-> this flags))) + (when (and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (zero? (-> this root num-riders)) + (or (not *target*) (or (< 32768.0 (vector-vector-distance (-> this root trans) (-> *target* control trans))) (focus-test? *target* teleporting) ) ) ) - (set! (-> obj controls throttle) 0.0) - (set! (-> obj controls steering) 0.0) - (set! (-> obj controls lean-z) 0.0) - (mem-copy! (the-as pointer (-> obj prev-controls)) (the-as pointer (-> obj controls)) 16) + (set! (-> this controls throttle) 0.0) + (set! (-> this controls steering) 0.0) + (set! (-> this controls lean-z) 0.0) + (mem-copy! (the-as pointer (-> this prev-controls)) (the-as pointer (-> this controls)) 16) ) ) (cond - ((zero? (-> obj crash-level)) - (seek! (-> obj force-scale) 1.0 (seconds-per-frame)) + ((zero? (-> this crash-level)) + (seek! (-> this force-scale) 1.0 (seconds-per-frame)) ) - ((< (-> obj crash-level) 3) - (when (>= (- (current-time) (-> obj crash-time)) (the-as time-frame (-> obj crash-duration))) - (if (or (>= (-> obj rbody state matrix vector 1 y) (cos 18204.445)) - (>= (- (current-time) (-> obj crash-time)) (seconds 3)) + ((< (-> this crash-level) 3) + (when (time-elapsed? (-> this crash-time) (the-as time-frame (-> this crash-duration))) + (if (or (>= (-> this rbody state matrix vector 1 y) (cos 18204.445)) + (time-elapsed? (-> this crash-time) (seconds 3)) ) - (vehicle-method-77 obj) + (vehicle-method-77 this) ) ) ) ) - (set! (-> obj force-level) (-> obj crash-level)) + (set! (-> this force-level) (-> this crash-level)) (cond - ((>= (-> obj hit-points) 0.9) - (set! (-> obj power-fluctuation-factor) 0.01) + ((>= (-> this hit-points) 0.9) + (set! (-> this power-fluctuation-factor) 0.01) ) - ((>= (-> obj hit-points) 0.75) - (set! (-> obj power-fluctuation-factor) 0.02) + ((>= (-> this hit-points) 0.75) + (set! (-> this power-fluctuation-factor) 0.02) ) - ((>= (-> obj hit-points) 0.5) - (set! (-> obj power-fluctuation-factor) 0.04) + ((>= (-> this hit-points) 0.5) + (set! (-> this power-fluctuation-factor) 0.04) ) - ((>= (-> obj hit-points) 0.3) - (set! (-> obj power-fluctuation-factor) 0.08) + ((>= (-> this hit-points) 0.3) + (set! (-> this power-fluctuation-factor) 0.08) ) - ((>= (-> obj hit-points) 0.15) - (set! (-> obj power-fluctuation-factor) 0.16) + ((>= (-> this hit-points) 0.15) + (set! (-> this power-fluctuation-factor) 0.16) ) - ((>= (-> obj hit-points) 0.05) - (set! (-> obj power-fluctuation-factor) 0.32) + ((>= (-> this hit-points) 0.05) + (set! (-> this power-fluctuation-factor) 0.32) ) (else - (set! (-> obj power-fluctuation-factor) 0.7) + (set! (-> this power-fluctuation-factor) 0.7) ) ) (let ((f1-6 0.0)) - (when (logtest? (rigid-body-object-flag ignition) (-> obj flags)) - (let ((f0-23 (- 1.0 (* (rand-vu) (-> obj power-fluctuation-factor))))) + (when (logtest? (rigid-body-object-flag ignition) (-> this flags)) + (let ((f0-23 (- 1.0 (* (rand-vu) (-> this power-fluctuation-factor))))) (set! f1-6 (* f0-23 f0-23)) ) - (if (not (logtest? (-> obj flags) (rigid-body-object-flag riding))) + (if (not (logtest? (-> this flags) (rigid-body-object-flag riding))) (set! f1-6 (* 0.5 f1-6)) ) ) - (+! (-> obj power-level) - (* (- f1-6 (-> obj power-level)) - (fmin 1.0 (* (+ 1.0 (* 50.0 (-> obj power-fluctuation-factor))) (seconds-per-frame))) + (+! (-> this power-level) + (* (- f1-6 (-> this power-level)) + (fmin 1.0 (* (+ 1.0 (* 50.0 (-> this power-fluctuation-factor))) (seconds-per-frame))) ) ) ) - (when (logtest? (rigid-body-object-flag turbo-boost) (-> obj flags)) - (if (or (>= (- (current-time) (-> obj turbo-boost-time)) (the-as time-frame (-> obj turbo-boost-duration))) - (and (>= (- (current-time) (-> obj turbo-boost-time)) (seconds 0.1)) (>= (-> obj controls brake) 0.75)) + (when (logtest? (rigid-body-object-flag turbo-boost) (-> this flags)) + (if (or (time-elapsed? (-> this turbo-boost-time) (the-as time-frame (-> this turbo-boost-duration))) + (and (time-elapsed? (-> this turbo-boost-time) (seconds 0.1)) (>= (-> this controls brake) 0.75)) ) - (logclear! (-> obj flags) (rigid-body-object-flag turbo-boost)) + (logclear! (-> this flags) (rigid-body-object-flag turbo-boost)) ) ) (cond - ((logtest? (rigid-body-object-flag ignition) (-> obj flags)) - (-> obj controls throttle) + ((logtest? (rigid-body-object-flag ignition) (-> this flags)) + (-> this controls throttle) (let* ((f1-13 (fmax 0.0 - (fmin 1.0 (/ (* (vector-length (-> obj rbody state lin-velocity)) (-> obj info engine-intake-factor)) - (-> obj info max-xz-speed) + (fmin 1.0 (/ (* (vector-length (-> this rbody state lin-velocity)) (-> this info engine-intake-factor)) + (-> this info max-xz-speed) ) ) ) ) - (f1-16 (fmin (-> obj controls throttle) (* 0.83333 (+ 0.5 f1-13)))) + (f1-16 (fmin (-> this controls throttle) (* 0.83333 (+ 0.5 f1-13)))) ) 0 - (if (logtest? (rigid-body-object-flag turbo-boost) (-> obj flags)) - (set! f1-16 (+ 1.0 (* (-> obj turbo-boost-factor) (-> obj info turbo-boost-factor)))) + (if (logtest? (rigid-body-object-flag turbo-boost) (-> this flags)) + (set! f1-16 (+ 1.0 (* (-> this turbo-boost-factor) (-> this info turbo-boost-factor)))) ) - (if (< (-> obj engine-thrust) f1-16) - (+! (-> obj engine-thrust) - (* (- f1-16 (-> obj engine-thrust)) (fmin 1.0 (* (-> obj info engine-response-rate) (seconds-per-frame)))) + (if (< (-> this engine-thrust) f1-16) + (+! (-> this engine-thrust) + (* (- f1-16 (-> this engine-thrust)) (fmin 1.0 (* (-> this info engine-response-rate) (seconds-per-frame)))) ) - (seek! (-> obj engine-thrust) f1-16 (seconds-per-frame)) + (seek! (-> this engine-thrust) f1-16 (seconds-per-frame)) ) ) ) (else - (set! (-> obj engine-thrust) 0.0) + (set! (-> this engine-thrust) 0.0) ) ) - (set! (-> obj engine-power-factor) (fabs (-> obj engine-thrust))) - (if (and (logtest? (rigid-body-object-flag jump) (-> obj flags)) (< 0.0 (-> obj jump-time))) - (set! (-> obj jump-thrust) 1.0) - (set! (-> obj jump-thrust) 0.0) + (set! (-> this engine-power-factor) (fabs (-> this engine-thrust))) + (if (and (logtest? (rigid-body-object-flag jump) (-> this flags)) (< 0.0 (-> this jump-time))) + (set! (-> this jump-thrust) 1.0) + (set! (-> this jump-thrust) 0.0) ) (cond - ((logtest? (rigid-body-object-flag jump) (-> obj flags)) - (seek! (-> obj jump-time) 0.0 (seconds-per-frame)) + ((logtest? (rigid-body-object-flag jump) (-> this flags)) + (seek! (-> this jump-time) 0.0 (seconds-per-frame)) ) - ((not (logtest? (-> obj flags) (rigid-body-object-flag in-air))) - (if (< 0.0 (-> obj jump-time)) - (logclear! (-> obj flags) (rigid-body-object-flag jump-sound)) + ((not (logtest? (-> this flags) (rigid-body-object-flag in-air))) + (if (< 0.0 (-> this jump-time)) + (logclear! (-> this flags) (rigid-body-object-flag jump-sound)) ) - (seek! (-> obj jump-time) 0.1 (* 0.5 (seconds-per-frame))) + (seek! (-> this jump-time) 0.1 (* 0.5 (seconds-per-frame))) ) ) - (when (and (logtest? (rigid-body-object-flag jump) (-> obj flags)) - (not (logtest? (-> obj flags) (rigid-body-object-flag in-air))) - (logtest? (-> obj vehicle-jkhn1b23jn1) 1024) + (when (and (logtest? (rigid-body-object-flag jump) (-> this flags)) + (not (logtest? (-> this flags) (rigid-body-object-flag in-air))) + (logtest? (-> this vehicle-jkhn1b23jn1) 1024) ) - (logior! (-> obj flags) (rigid-body-object-flag hard-turn)) - (set! (-> obj turn-time) (current-time)) + (logior! (-> this flags) (rigid-body-object-flag hard-turn)) + (set-time! (-> this turn-time)) ) - (if (or (not (logtest? (rigid-body-object-flag jump) (-> obj flags))) - (>= (- (current-time) (-> obj turn-time)) (seconds 1)) + (if (or (not (logtest? (rigid-body-object-flag jump) (-> this flags))) + (time-elapsed? (-> this turn-time) (seconds 1)) ) - (logclear! (-> obj flags) (rigid-body-object-flag hard-turn)) + (logclear! (-> this flags) (rigid-body-object-flag hard-turn)) ) - (if (logtest? (-> obj flags) (rigid-body-object-flag on-ground on-flight-level)) - (set! (-> obj air-time) (current-time)) + (if (logtest? (-> this flags) (rigid-body-object-flag on-ground on-flight-level)) + (set-time! (-> this air-time)) ) - (when (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (if (or (and (> (-> obj flight-level-index) 0) - (< (fabs (- (-> obj flight-level) (-> obj rbody state position y))) 8192.0) - (< (fabs (-> obj rbody state lin-velocity y)) 8192.0) + (when (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) + (if (or (and (> (-> this flight-level-index) 0) + (< (fabs (- (-> this flight-level) (-> this rbody state position y))) 8192.0) + (< (fabs (-> this rbody state lin-velocity y)) 8192.0) ) - (and (zero? (-> obj flight-level-index)) (logtest? (-> obj flags) (rigid-body-object-flag on-ground))) + (and (zero? (-> this flight-level-index)) (logtest? (-> this flags) (rigid-body-object-flag on-ground))) ) - (vehicle-method-79 obj) + (vehicle-method-79 this) ) - (when (and (> (-> obj flight-level-index) 0) (>= (- (current-time) (-> obj transition-time)) (seconds 2))) - (vehicle-method-79 obj) - (vehicle-method-83 obj) + (when (and (> (-> this flight-level-index) 0) (time-elapsed? (-> this transition-time) (seconds 2))) + (vehicle-method-79 this) + (vehicle-method-83 this) ) ) - (when (and (logtest? (rigid-body-object-flag flight-level-transition-ending) (-> obj flags)) - (>= (- (current-time) (-> obj transition-end-time)) (seconds 1)) + (when (and (logtest? (rigid-body-object-flag flight-level-transition-ending) (-> this flags)) + (time-elapsed? (-> this transition-end-time) (seconds 1)) ) - (logclear! (-> obj flags) (rigid-body-object-flag flight-level-transition-ending)) - (vehicle-method-92 obj) + (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) + (vehicle-method-92 this) ) 0 (none) ) -(defmethod vehicle-method-97 vehicle ((obj vehicle)) +(defmethod vehicle-method-97 vehicle ((this vehicle)) (local-vars (v1-88 float) (v1-98 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -563,7 +565,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (when (logtest? (rigid-body-object-flag camera) (-> obj flags)) + (when (logtest? (rigid-body-object-flag camera) (-> this flags)) (let ((f0-0 -4096000.0)) (dotimes (v1-4 (-> *level* length)) (let ((a0-5 (-> *level* level v1-4))) @@ -584,64 +586,64 @@ (set-setting! 'string-camera-ceiling 'abs f0-0 0) ) (cond - ((logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (when (or (< 55296.0 (-> obj rbody state lin-velocity y)) (>= (- (current-time) (-> obj air-time)) (seconds 0.75))) + ((logtest? (-> this flags) (rigid-body-object-flag in-air)) + (when (or (< 55296.0 (-> this rbody state lin-velocity y)) (time-elapsed? (-> this air-time) (seconds 0.75))) (set-setting! 'extra-follow-height 'abs (meters -4) 0) - (send-event *camera* 'set-max-angle-offset (-> obj info camera-air-max-angle-offset)) + (send-event *camera* 'set-max-angle-offset (-> this info camera-air-max-angle-offset)) ) ) (else (remove-setting! 'extra-follow-height) - (send-event *camera* 'set-max-angle-offset (-> obj info camera-normal-max-angle-offset)) + (send-event *camera* 'set-max-angle-offset (-> this info camera-normal-max-angle-offset)) ) ) - (let ((f0-5 (vector-dot (-> obj rbody state lin-velocity) (-> obj rbody state matrix vector 2)))) + (let ((f0-5 (vector-dot (-> this rbody state lin-velocity) (-> this rbody state matrix vector 2)))) (cond - ((= (-> obj crash-level) 2) - (vehicle-method-90 obj) + ((= (-> this crash-level) 2) + (vehicle-method-90 this) ) - ((< f0-5 (-> obj info camera-max-lookaround-speed)) - (vehicle-method-90 obj) + ((< f0-5 (-> this info camera-max-lookaround-speed)) + (vehicle-method-90 this) ) - ((< (+ 4096.0 (-> obj info camera-max-lookaround-speed)) f0-5) - (vehicle-method-89 obj) + ((< (+ 4096.0 (-> this info camera-max-lookaround-speed)) f0-5) + (vehicle-method-89 this) ) ) ) - (when (not (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags))) + (when (not (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags))) (let* ((f0-6 1.0) - (v1-57 (-> obj rbody state lin-velocity)) + (v1-57 (-> this rbody state lin-velocity)) (f0-7 (fmin f0-6 - (/ (sqrtf (+ (* (-> v1-57 x) (-> v1-57 x)) (* (-> v1-57 z) (-> v1-57 z)))) (-> obj info max-xz-speed)) + (/ (sqrtf (+ (* (-> v1-57 x) (-> v1-57 x)) (* (-> v1-57 z) (-> v1-57 z)))) (-> this info max-xz-speed)) ) ) ) - (seek! (-> obj cam-speed-interp) f0-7 (* 0.1 (seconds-per-frame))) + (seek! (-> this cam-speed-interp) f0-7 (* 0.1 (seconds-per-frame))) ) - (let ((f30-0 (-> obj cam-speed-interp))) + (let ((f30-0 (-> this cam-speed-interp))) (if #f (set! f30-0 (fmax 0.0 (fmin 1.0 (analog-input (the-as int (-> *cpad-list* cpads 1 righty)) 128.0 48.0 110.0 -1.0))) ) ) - (let ((f0-15 (lerp-scale (-> obj info camera-min-fov) (-> obj info camera-max-fov) f30-0 0.0 1.0))) + (let ((f0-15 (lerp-scale (-> this info camera-min-fov) (-> this info camera-max-fov) f30-0 0.0 1.0))) (set-setting! 'fov 'abs f0-15 0) ) (let ((f30-2 (lerp-scale 1.0 0.6 f30-0 0.0 1.0))) - (set-setting! 'string-min-length 'abs (* f30-2 (-> obj info camera-string-min-length)) 0) - (set-setting! 'string-max-length 'abs (* f30-2 (-> obj info camera-string-max-length)) 0) + (set-setting! 'string-min-length 'abs (* f30-2 (-> this info camera-string-min-length)) 0) + (set-setting! 'string-max-length 'abs (* f30-2 (-> this info camera-string-max-length)) 0) ) ) ) (when *target* (let ((v1-83 (-> *target* draw shadow-ctrl settings shadow-dir quad))) - (set! (-> obj draw shadow-ctrl settings shadow-dir quad) v1-83) + (set! (-> this draw shadow-ctrl settings shadow-dir quad) v1-83) ) (cond - ((logtest? (rigid-body-object-flag camera-rapid-track-mode) (-> obj flags)) - (.lvf vf1 (&-> (-> obj root transv) quad)) + ((logtest? (rigid-body-object-flag camera-rapid-track-mode) (-> this flags)) + (.lvf vf1 (&-> (-> this root transv) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -652,7 +654,7 @@ (f1-13 122880.0) ) (if (< f0-20 (* f1-13 f1-13)) - (vehicle-method-92 obj) + (vehicle-method-92 this) ) ) ) @@ -660,7 +662,7 @@ (let* ((f0-21 143360.0) (f0-23 (* f0-21 f0-21)) ) - (.lvf vf1 (&-> (-> obj root transv) quad)) + (.lvf vf1 (&-> (-> this root transv) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -668,7 +670,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-98 vf1) (if (< f0-23 v1-98) - (vehicle-method-91 obj) + (vehicle-method-91 this) ) ) ) @@ -688,7 +690,7 @@ (set-setting! 'vertical-follow-matches-camera #f 0.0 0) ) (else - (if (< (fabs (-> obj root transv y)) 8192.0) + (if (< (fabs (-> this root transv y)) 8192.0) (remove-setting! 'vertical-follow-matches-camera) ) ) @@ -703,20 +705,20 @@ ) ) -(defmethod vehicle-method-120 vehicle ((obj vehicle)) - (let ((s5-0 (-> obj draw shadow-ctrl))) +(defmethod vehicle-method-120 vehicle ((this vehicle)) + (let ((s5-0 (-> this draw shadow-ctrl))) (when (!= *vehicle-shadow-control-disabled* s5-0) - (let ((f30-0 (vector-vector-xz-distance (camera-pos) (-> obj root trans)))) + (let ((f30-0 (vector-vector-xz-distance (camera-pos) (-> this root trans)))) (cond ((< 245760.0 f30-0) (logior! (-> s5-0 settings flags) (shadow-flags disable-draw)) 0 - (set! (-> obj draw bounds w) (-> obj bound-radius)) + (set! (-> this draw bounds w) (-> this bound-radius)) ) (else - (let ((s4-1 (-> obj root))) + (let ((s4-1 (-> this root))) (when (or (logtest? (-> s5-0 settings flags) (shadow-flags disable-draw)) - (= (-> obj controller traffic sync-mask-8) (ash 1 (logand (-> obj traffic-priority-id) 7))) + (= (-> this controller traffic sync-mask-8) (ash 1 (logand (-> this traffic-priority-id) 7))) ) (let ((s3-0 (new 'stack-no-clear 'collide-query))) (logclear! (-> s4-1 status) (collide-status on-ground)) @@ -727,8 +729,8 @@ (set! (-> s4-1 gspot-normal quad) (-> s3-0 best-other-tri normal quad)) (set! (-> s4-1 ground-pat) (-> s3-0 best-other-tri pat)) (when (logtest? (-> s5-0 settings flags) (shadow-flags disable-draw)) - (set! (-> s5-0 settings top-plane w) (- (-> s5-0 settings center y) (-> obj root gspot-pos y))) - (set! (-> s5-0 settings bot-plane w) (- (-> s5-0 settings center y) (-> obj root gspot-pos y))) + (set! (-> s5-0 settings top-plane w) (- (-> s5-0 settings center y) (-> this root gspot-pos y))) + (set! (-> s5-0 settings bot-plane w) (- (-> s5-0 settings center y) (-> this root gspot-pos y))) ) (let ((v1-29 s5-0)) (logclear! (-> v1-29 settings flags) (shadow-flags disable-draw)) @@ -745,20 +747,20 @@ ) ) ) - (set! (-> obj draw bounds w) (lerp-scale - (- (-> s5-0 settings center y) (-> obj root gspot-pos y)) - (-> obj bound-radius) - f30-0 - 81920.0 - 122880.0 - ) + (set! (-> this draw bounds w) (lerp-scale + (- (-> s5-0 settings center y) (-> this root gspot-pos y)) + (-> this bound-radius) + f30-0 + 81920.0 + 122880.0 + ) ) - (if (< (-> obj draw bounds w) (-> obj bound-radius)) - (set! (-> obj draw bounds w) (-> obj bound-radius)) + (if (< (-> this draw bounds w) (-> this bound-radius)) + (set! (-> this draw bounds w) (-> this bound-radius)) ) (let* ((f0-13 (lerp-scale 0.0 1.0 f30-0 245760.0 40960.0)) - (f30-1 (* 4096.0 (+ 5.0 (* 5.0 (- 1.0 (-> obj root gspot-normal y)))))) - (f28-0 (- (-> s5-0 settings center y) (-> obj root gspot-pos y))) + (f30-1 (* 4096.0 (+ 5.0 (* 5.0 (- 1.0 (-> this root gspot-normal y)))))) + (f28-0 (- (-> s5-0 settings center y) (-> this root gspot-pos y))) (f0-16 (fmax 0.01 (+ (* -2.0 f0-13 f0-13 f0-13) (* 3.0 f0-13 f0-13)))) ) (set! (-> s5-0 settings shadow-dir w) (+ 20480.0 (* 409600.0 f0-16) f28-0)) @@ -772,52 +774,53 @@ ) ) ) - (set! (-> obj vehicle-jkhn1b23jn1) (the-as int (-> obj flags))) + (set! (-> this vehicle-jkhn1b23jn1) (the-as int (-> this flags))) (ja-post) 0 (none) ) -(defmethod rigid-body-object-method-51 vehicle ((obj vehicle)) +(defmethod rigid-body-object-method-51 vehicle ((this vehicle)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f30-0 -4096000.0)) - (set! (-> s5-0 start-pos quad) (-> obj rbody state position quad)) - (vector-float*! (-> s5-0 move-dist) (-> obj rbody state lin-velocity) (seconds-per-frame)) + (set! (-> s5-0 start-pos quad) (-> this rbody state position quad)) + (vector-float*! (-> s5-0 move-dist) (-> this rbody state lin-velocity) (seconds-per-frame)) (let ((v1-4 s5-0)) - (set! (-> v1-4 radius) (+ 4096.0 (-> obj root root-prim local-sphere w))) - (set! (-> v1-4 collide-with) (collide-spec - backgnd - crate - civilian - enemy - obstacle - vehicle-sphere - hit-by-player-list - hit-by-others-list - collectable - blocking-plane - pusher - vehicle-mesh-probeable - ) + (set! (-> v1-4 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) + (set! (-> v1-4 collide-with) + (collide-spec + backgnd + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + blocking-plane + pusher + vehicle-mesh-probeable + ) ) - (set! (-> v1-4 ignore-process0) obj) + (set! (-> v1-4 ignore-process0) this) (set! (-> v1-4 ignore-process1) #f) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) ) - (if (focus-test? obj dead) + (if (focus-test? this dead) (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) ) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-touching)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-touching)) (logclear! (-> s5-0 collide-with) (collide-spec jak player-list)) ) (let ((s4-0 (new 'stack-no-clear 'water-info))) - (water-info-init! (-> obj root) s4-0 (collide-action solid semi-solid)) + (water-info-init! (-> this root) s4-0 (collide-action solid semi-solid)) (if (and (logtest? (-> s4-0 flags) (water-flags active)) (logtest? (water-flags over-water) (-> s4-0 flags))) (set! f30-0 (-> s4-0 base-height)) ) ) - (set! (-> obj water-height) f30-0) + (set! (-> this water-height) f30-0) (when (< (- (+ (-> s5-0 start-pos y) (fmin 0.0 (-> s5-0 move-dist y))) (-> s5-0 radius)) f30-0) (let ((v1-23 (new 'static 'water-control :flags (water-flags active swim-ground can-ground over-water) :joint-index 3) @@ -826,35 +829,40 @@ (logior! (-> s5-0 collide-with) (collide-spec water)) (set! (-> v1-23 height) f30-0) (set! (-> v1-23 collide-height) f30-0) - (set! (-> obj water) v1-23) + (set! (-> this water) v1-23) ) ) ) (fill-using-line-sphere *collide-cache* s5-0) ) - (set! (-> obj water) (the-as water-control 0)) + (set! (-> this water) (the-as water-control 0)) 0 - (rigid-body-control-method-10 (-> obj rbody) obj (-> obj rbody state time-remaining) (-> obj max-time-step)) + (rigid-body-control-method-10 + (-> this rbody) + this + (-> this rbody state time-remaining) + (-> this max-time-step) + ) 0 (none) ) -(defmethod rigid-body-object-method-52 vehicle ((obj vehicle)) +(defmethod rigid-body-object-method-52 vehicle ((this vehicle)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vehicle-control-point))) - (set! (-> v1-0 local-pos quad) (-> obj root transv quad)) - (vector-! (-> v1-0 normal) (-> obj rbody state lin-velocity) (-> v1-0 local-pos)) - (vector-float*! (-> obj lin-acceleration) (-> v1-0 normal) (-> pp clock frames-per-second)) + (set! (-> v1-0 local-pos quad) (-> this root transv quad)) + (vector-! (-> v1-0 normal) (-> this rbody state lin-velocity) (-> v1-0 local-pos)) + (vector-float*! (-> this lin-acceleration) (-> v1-0 normal) (-> pp clock frames-per-second)) ) - (set! (-> obj root transv quad) (-> obj rbody state lin-velocity quad)) - (quaternion-copy! (-> obj root quat) (-> obj rbody state rotation)) - (let ((v1-6 (-> obj rbody)) - (a1-7 (-> obj root trans)) + (set! (-> this root transv quad) (-> this rbody state lin-velocity quad)) + (quaternion-copy! (-> this root quat) (-> this rbody state rotation)) + (let ((v1-6 (-> this rbody)) + (a1-7 (-> this root trans)) ) (rigid-body-method-23 (-> v1-6 state) a1-7) ) - (let* ((v1-11 (-> obj node-list data 0 bone transform)) - (a3-0 (-> obj rbody state matrix)) + (let* ((v1-11 (-> this node-list data 0 bone transform)) + (a3-0 (-> this rbody state matrix)) (a0-13 (-> a3-0 quad 0)) (a1-8 (-> a3-0 quad 1)) (a2-1 (-> a3-0 quad 2)) @@ -865,92 +873,92 @@ (set! (-> v1-11 quad 2) a2-1) (set! (-> v1-11 trans quad) a3-1) ) - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) - (vehicle-method-119 obj) - (let ((f0-1 (-> obj player-dist2)) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (vehicle-method-119 this) + (let ((f0-1 (-> this player-dist2)) (f1-0 245760.0) ) (if (< f0-1 (* f1-0 f1-0)) - (do-engine-sounds obj) + (do-engine-sounds this) ) ) - (when (logtest? (-> obj draw status) (draw-control-status on-screen)) + (when (logtest? (-> this draw status) (draw-control-status on-screen)) (if #t - (draw-thrusters obj) + (draw-thrusters this) ) - (let ((f0-2 (-> obj camera-dist2)) + (let ((f0-2 (-> this camera-dist2)) (f1-3 245760.0) ) (if (< f0-2 (* f1-3 f1-3)) - (update-joint-mods obj) + (update-joint-mods this) ) ) ) - (vehicle-method-120 obj) - (let ((s5-0 (-> obj root))) + (vehicle-method-120 this) + (let ((s5-0 (-> this root))) (update-transforms s5-0) - (when (and (logtest? (-> obj flags) (rigid-body-object-flag player-touching)) - (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (when (and (logtest? (-> this flags) (rigid-body-object-flag player-touching)) + (not (logtest? (-> this flags) (rigid-body-object-flag player-driving))) ) (pull-riders! s5-0) (cond ((logtest? (do-push-aways s5-0) (collide-spec jak)) - (+! (-> obj overlap-player-counter) 1) - (when (< (the-as uint 60) (-> obj overlap-player-counter)) + (+! (-> this overlap-player-counter) 1) + (when (< (the-as uint 60) (-> this overlap-player-counter)) (send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'smush) (damage 1000.0))) ) - (set! (-> obj overlap-player-counter) (the-as uint 0)) + (set! (-> this overlap-player-counter) (the-as uint 0)) 0 ) ) (else - (set! (-> obj overlap-player-counter) (the-as uint 0)) + (set! (-> this overlap-player-counter) (the-as uint 0)) 0 ) ) ) ) - (if (and (logtest? (-> obj flags) (rigid-body-object-flag dead)) - (not (logtest? (-> obj focus-status) (focus-status dead))) + (if (and (logtest? (-> this flags) (rigid-body-object-flag dead)) + (not (logtest? (-> this focus-status) (focus-status dead))) ) - (go (method-of-object obj crash)) + (go (method-of-object this crash)) ) - (if (logtest? (rigid-body-object-flag nav-spheres) (-> obj flags)) - (vehicle-method-143 obj) + (if (logtest? (rigid-body-object-flag nav-spheres) (-> this flags)) + (vehicle-method-143 this) ) - (seek! (-> obj scrape-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) - (mem-copy! (the-as pointer (-> obj prev-controls)) (the-as pointer (-> obj controls)) 16) - (logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force jump)) + (seek! (-> this scrape-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) + (mem-copy! (the-as pointer (-> this prev-controls)) (the-as pointer (-> this controls)) 16) + (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force jump)) 0 (none) ) ) -(defmethod vehicle-method-121 vehicle ((obj vehicle)) - (if (>= (- (current-time) (-> obj player-touch-time)) (seconds 0.1)) - (logclear! (-> obj flags) (rigid-body-object-flag player-touching player-edge-grabbing player-standing-on)) +(defmethod vehicle-method-121 vehicle ((this vehicle)) + (if (time-elapsed? (-> this player-touch-time) (seconds 0.1)) + (logclear! (-> this flags) (rigid-body-object-flag player-touching player-edge-grabbing player-standing-on)) ) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-touching)) - (detect-riders! (-> obj root)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-touching)) + (detect-riders! (-> this root)) 0 ) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-touching player-driving)) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (logclear! (-> obj skel status) (joint-control-status sync-math)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-touching player-driving)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (logclear! (-> this skel status) (joint-control-status sync-math)) ) - (vehicle-method-96 obj) - (let ((a1-0 (-> obj rbody state position))) - (set! (-> obj flight-level) (get-height-at-point *traffic-height-map* a1-0)) + (vehicle-method-96 this) + (let ((a1-0 (-> this rbody state position))) + (set! (-> this flight-level) (get-height-at-point *traffic-height-map* a1-0)) ) 0 (none) ) -(defmethod rigid-body-object-method-37 vehicle ((obj vehicle)) +(defmethod rigid-body-object-method-37 vehicle ((this vehicle)) (local-vars (a0-14 int) (a0-16 int) (a0-19 int) (a0-21 int)) (let* ((v1-1 (-> *perf-stats* data 37)) (a0-1 (-> v1-1 ctrl)) @@ -970,24 +978,24 @@ (.sync.p) (label cfg-2) 0 - (set! (-> obj camera-dist2) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (if (not (vehicle-method-105 obj)) - (rigid-body-object-method-39 obj) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (if (not (vehicle-method-105 this)) + (rigid-body-object-method-39 this) ) ) (else - (if (vehicle-method-105 obj) - (rigid-body-object-method-38 obj) + (if (vehicle-method-105 this) + (rigid-body-object-method-38 this) ) ) ) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (vehicle-method-121 obj) - (vehicle-method-106 obj) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (vehicle-method-121 this) + (vehicle-method-106 this) ) (else (let* ((v1-26 (-> *perf-stats* data 20)) @@ -1008,7 +1016,7 @@ (.sync.p) (label cfg-12) 0 - (vehicle-method-120 obj) + (vehicle-method-120 this) (let ((v1-31 (-> *perf-stats* data 20))) (b! (zero? (-> v1-31 ctrl)) cfg-14 :delay (nop!)) (.mtc0 Perf 0) @@ -1039,25 +1047,25 @@ (none) ) -(defmethod vehicle-method-123 vehicle ((obj vehicle)) +(defmethod vehicle-method-123 vehicle ((this vehicle)) (local-vars (v1-4 symbol) (a0-21 int) (a0-23 int)) - (set! (-> obj camera-dist2) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (b! - (not (logtest? (rigid-body-object-flag traffic-managed) (-> obj flags))) + (not (logtest? (rigid-body-object-flag traffic-managed) (-> this flags))) cfg-3 :likely-delay (set! v1-4 #f) ) - (set! v1-4 (not (logtest? (-> obj flags) (rigid-body-object-flag persistent)))) + (set! v1-4 (not (logtest? (-> this flags) (rigid-body-object-flag persistent)))) (label cfg-3) (b! (not v1-4) cfg-20 :delay (empty-form)) - (let ((f0-3 (fmin (-> obj player-dist2) (-> obj camera-dist2)))) + (let ((f0-3 (fmin (-> this player-dist2) (-> this camera-dist2)))) (let ((f1-1 819200.0)) (b! (>= (* f1-1 f1-1) f0-3) cfg-8) ) (let ((f1-4 819200.0)) (if (< (* f1-4 f1-4) f0-3) - (vehicle-method-113 obj) + (vehicle-method-113 this) ) ) (b! #t cfg-19 :delay (nop!)) @@ -1065,44 +1073,44 @@ (let ((f1-7 81920.0)) (b! (>= (* f1-7 f1-7) f0-3) cfg-18) ) - (b! (not (logtest? (-> obj draw status) (draw-control-status on-screen))) cfg-11 :delay (nop!)) - (set! (-> obj state-time) (current-time)) + (b! (not (logtest? (-> this draw status) (draw-control-status on-screen))) cfg-11 :delay (nop!)) + (set-time! (-> this state-time)) (b! #t cfg-17 :delay (nop!)) (label cfg-11) - (if (or (>= (- (current-time) (-> obj state-time)) (seconds 10)) (let ((f1-10 409600.0)) - (< (* f1-10 f1-10) f0-3) - ) + (if (or (time-elapsed? (-> this state-time) (seconds 10)) (let ((f1-10 409600.0)) + (< (* f1-10 f1-10) f0-3) + ) ) - (vehicle-method-113 obj) + (vehicle-method-113 this) ) ) (label cfg-17) (b! #t cfg-19 :delay (nop!)) (label cfg-18) - (set! (-> obj state-time) (current-time)) + (set-time! (-> this state-time)) (label cfg-19) 0 (label cfg-20) - (check-player-get-on obj) - (b! (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) cfg-24 :delay (nop!)) - (if (not (vehicle-method-105 obj)) - (rigid-body-object-method-39 obj) + (check-player-get-on this) + (b! (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) cfg-24 :delay (nop!)) + (if (not (vehicle-method-105 this)) + (rigid-body-object-method-39 this) ) (b! #t cfg-26 :delay (nop!)) (label cfg-24) - (if (vehicle-method-105 obj) - (rigid-body-object-method-38 obj) + (if (vehicle-method-105 this) + (rigid-body-object-method-38 this) ) (label cfg-26) - (b! (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) cfg-31 :delay (nop!)) - (vector-reset! (-> obj target-acceleration)) - (when (logtest? (-> obj flags) (rigid-body-object-flag disturbed)) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (set! (-> obj disturbed-time) (current-time)) + (b! (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) cfg-31 :delay (nop!)) + (vector-reset! (-> this target-acceleration)) + (when (logtest? (-> this flags) (rigid-body-object-flag disturbed)) + (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) + (set-time! (-> this disturbed-time)) ) ) - (vehicle-method-121 obj) - (vehicle-method-106 obj) + (vehicle-method-121 this) + (vehicle-method-106 this) (b! #t cfg-36 :delay (nop!)) (label cfg-31) (let* ((v1-65 (-> *perf-stats* data 20)) @@ -1123,7 +1131,7 @@ (.sync.p) (label cfg-33) 0 - (vehicle-method-120 obj) + (vehicle-method-120 this) (let ((v1-70 (-> *perf-stats* data 20))) (b! (zero? (-> v1-70 ctrl)) cfg-35 :delay (nop!)) (.mtc0 Perf 0) @@ -1141,7 +1149,7 @@ (none) ) -(defmethod vehicle-method-122 vehicle ((obj vehicle)) +(defmethod vehicle-method-122 vehicle ((this vehicle)) (local-vars (a0-23 int) (a0-25 int) (a0-35 int) (a0-37 int) (a0-40 int) (a0-42 int)) (let* ((v1-1 (-> *perf-stats* data 37)) (a0-1 (-> v1-1 ctrl)) @@ -1161,42 +1169,42 @@ (.sync.p) (label cfg-2) 0 - (set! (-> obj camera-dist2) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (vehicle-controller-method-18 - (-> obj controller) - (-> obj target-acceleration) - (-> obj root transv) - obj + (-> this controller) + (-> this target-acceleration) + (-> this root transv) + this (/ 1.0 (seconds-per-frame)) ) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (if (not (vehicle-method-105 obj)) - (rigid-body-object-method-39 obj) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (if (not (vehicle-method-105 this)) + (rigid-body-object-method-39 this) ) ) (else - (if (vehicle-method-105 obj) - (rigid-body-object-method-38 obj) + (if (vehicle-method-105 this) + (rigid-body-object-method-38 this) ) ) ) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (vehicle-method-93 obj) - (vehicle-method-106 obj) - (vehicle-method-121 obj) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (vehicle-method-93 this) + (vehicle-method-106 this) + (vehicle-method-121 this) ) (else (let ((f1-3 (* 0.000024414063 - (vector-dot (the-as vector (-> obj node-list data 0 bone transform)) (-> obj target-acceleration)) + (vector-dot (the-as vector (-> this node-list data 0 bone transform)) (-> this target-acceleration)) ) ) ) - (+! (-> obj controls steering) (* 0.1 (- f1-3 (-> obj controls steering)))) + (+! (-> this controls steering) (* 0.1 (- f1-3 (-> this controls steering)))) ) - (set! (-> obj controls steering) (fmax -1.0 (fmin 1.0 (-> obj controls steering)))) + (set! (-> this controls steering) (fmax -1.0 (fmin 1.0 (-> this controls steering)))) (let* ((v1-42 (-> *perf-stats* data 19)) (a0-14 (-> v1-42 ctrl)) ) @@ -1215,21 +1223,21 @@ (.sync.p) (label cfg-12) 0 - (vehicle-method-104 obj) - (let ((f0-9 (-> obj player-dist2)) + (vehicle-method-104 this) + (let ((f0-9 (-> this player-dist2)) (f1-8 245760.0) ) (when (< f0-9 (* f1-8 f1-8)) - (let ((f0-10 (vector-length (-> obj root transv)))) - (seek! (-> obj engine-power-factor) (* 0.000016276043 f0-10) (* 6.0 (seconds-per-frame))) + (let ((f0-10 (vector-length (-> this root transv)))) + (seek! (-> this engine-power-factor) (* 0.000016276043 f0-10) (* 6.0 (seconds-per-frame))) ) - (do-engine-sounds obj) + (do-engine-sounds this) ) ) - (when (logtest? (-> obj draw status) (draw-control-status on-screen)) + (when (logtest? (-> this draw status) (draw-control-status on-screen)) (when #t - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) - (draw-thrusters obj) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (draw-thrusters this) ) ) (let ((v1-70 (-> *perf-stats* data 19))) @@ -1262,10 +1270,10 @@ (.sync.p) (label cfg-21) 0 - (vehicle-method-120 obj) - (update-transforms (-> obj root)) - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) - (vehicle-method-119 obj) + (vehicle-method-120 this) + (update-transforms (-> this root)) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (vehicle-method-119 this) (let ((v1-85 (-> *perf-stats* data 20))) (b! (zero? (-> v1-85 ctrl)) cfg-23 :delay (nop!)) (.mtc0 Perf 0) @@ -1296,12 +1304,12 @@ (none) ) -(defmethod vehicle-method-124 vehicle ((obj vehicle)) +(defmethod vehicle-method-124 vehicle ((this vehicle)) ;; og:preserve-this vehicle hp display cheat (#when PC_PORT (when (pc-cheats? (-> *pc-settings* cheats) vehicle-health-bars) (when (and *target* (focus-test? *target* pilot) (nonzero? (-> *target* pilot))) - (when (= (handle->process (-> *target* pilot vehicle)) obj) + (when (= (handle->process (-> *target* pilot vehicle)) this) (let ((x 0) (y 0) (w 0) (h 0) (screen-pos (new 'static 'vector4w))) @@ -1315,22 +1323,22 @@ (set! x (- (+ (/ (-> screen-pos x) 16) -1792) (/ w 2))) (set! y (+ (+ (/ (-> screen-pos y) 16) -1855) 20)) - (draw-health-bar x y w h (-> obj hit-points) (bucket-id debug-no-zbuf1)) + (draw-health-bar x y w h (-> this hit-points) (bucket-id debug-no-zbuf1)) ))) ) ) ) - (vehicle-method-94 obj) - (vehicle-method-121 obj) - (vehicle-method-97 obj) + (vehicle-method-94 this) + (vehicle-method-121 this) + (vehicle-method-97 this) 0 (none) ) -(defmethod alloc-and-init-rigid-body-control vehicle ((obj vehicle) (arg0 rigid-body-vehicle-constants)) +(defmethod alloc-and-init-rigid-body-control vehicle ((this vehicle) (arg0 rigid-body-vehicle-constants)) (if (logtest? (-> arg0 flags) 8) (iterate-prims - (-> obj root) + (-> this root) (lambda ((arg0 collide-shape-prim)) (case (-> arg0 prim-core prim-type) (((prim-type sphere)) @@ -1378,7 +1386,7 @@ ) ) (iterate-prims - (-> obj root) + (-> this root) (lambda ((arg0 collide-shape-prim)) (set! (-> arg0 prim-core collide-with) (collide-spec backgnd @@ -1400,67 +1408,67 @@ ) ) ) - (set! (-> obj bound-radius) (-> obj draw bounds w)) - (if (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) + (set! (-> this bound-radius) (-> this draw bounds w)) + (if (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -2048.0 -61440.0 69632.0 (shadow-flags shdf03) 245760.0) ) - (set! (-> obj draw shadow-ctrl) *vehicle-shadow-control-disabled*) + (set! (-> this draw shadow-ctrl) *vehicle-shadow-control-disabled*) ) - (logior! (-> obj root root-prim prim-core action) (collide-action pull-rider-can-collide)) - (set! (-> obj root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) - (set! (-> obj root event-self) 'touched) + (logior! (-> this root root-prim prim-core action) (collide-action pull-rider-can-collide)) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) + (set! (-> this root event-self) 'touched) (let ((t9-3 (method-of-type rigid-body-object alloc-and-init-rigid-body-control))) - (t9-3 obj arg0) + (t9-3 this arg0) ) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-collision)) - (set! (-> obj root max-iteration-count) (the-as uint 8)) - (set! (-> obj max-time-step) 0.033333335) - (logior! (-> obj mask) (process-mask vehicle)) - (logclear! (-> obj mask) (process-mask actor-pause movie)) - (logclear! (-> obj skel status) (joint-control-status sync-math)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj nav) #f) - (let ((v1-32 (-> obj root root-prim))) - (set! (-> obj root backup-collide-as) (-> v1-32 prim-core collide-as)) - (set! (-> obj root backup-collide-with) (-> v1-32 prim-core collide-with)) + (logior! (-> this rbody state flags) (rigid-body-flag enable-collision)) + (set! (-> this root max-iteration-count) (the-as uint 8)) + (set! (-> this max-time-step) 0.033333335) + (logior! (-> this mask) (process-mask vehicle)) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (logclear! (-> this skel status) (joint-control-status sync-math)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this nav) #f) + (let ((v1-32 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-32 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-32 prim-core collide-with)) ) - (rigid-body-object-method-40 obj) - (vehicle-controller-method-9 (-> obj controller)) - (vehicle-method-82 obj) - (set! (-> obj power-level) 0.5) - (set! (-> obj lights-factor) 0.0) - (set! (-> obj jump-thrust) 1.0) - (set! (-> obj turbo-boost-factor) 1.0) + (rigid-body-object-method-40 this) + (vehicle-controller-method-9 (-> this controller)) + (vehicle-method-82 this) + (set! (-> this power-level) 0.5) + (set! (-> this lights-factor) 0.0) + (set! (-> this jump-thrust) 1.0) + (set! (-> this turbo-boost-factor) 1.0) (dotimes (v1-43 4) - (set! (-> obj rider-array v1-43) (the-as handle #f)) + (set! (-> this rider-array v1-43) (the-as handle #f)) ) - (set! (-> obj engine-sound-id) (new 'static 'sound-id)) - (set! (-> obj thrust-sound-id) (new 'static 'sound-id)) - (set! (-> obj roll-sound-id) (new 'static 'sound-id)) - (set! (-> obj scrape-sound-id) (new 'static 'sound-id)) - (set! (-> obj extra-sound-id) (new 'static 'sound-id)) - (set! (-> obj damage-zap-sound-id) (new-sound-id)) - (set! (-> obj damage-pop-sound-id) (new-sound-id)) - (set! (-> obj controller target-speed-offset) (* (rand-vu) (-> arg0 target-speed-offset))) - (set! (-> obj draw lod-set lod 0 dist) 122880.0) - (set! (-> obj draw lod-set lod 1 dist) 204800.0) - (set! (-> obj draw lod-set lod 2 dist) 819200.0) - (if (zero? (-> obj draw light-index)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this engine-sound-id) (new 'static 'sound-id)) + (set! (-> this thrust-sound-id) (new 'static 'sound-id)) + (set! (-> this roll-sound-id) (new 'static 'sound-id)) + (set! (-> this scrape-sound-id) (new 'static 'sound-id)) + (set! (-> this extra-sound-id) (new 'static 'sound-id)) + (set! (-> this damage-zap-sound-id) (new-sound-id)) + (set! (-> this damage-pop-sound-id) (new-sound-id)) + (set! (-> this controller target-speed-offset) (* (rand-vu) (-> arg0 target-speed-offset))) + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 204800.0) + (set! (-> this draw lod-set lod 2 dist) 819200.0) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) ) (rigid-body-queue-method-11 - (if (logtest? (-> obj info flags) 1024) + (if (logtest? (-> this info flags) 1024) *race-rigid-body-queue* *traffic-rigid-body-queue* ) - obj + this ) 0 (none) ) -(defmethod rigid-body-object-method-47 vehicle ((obj vehicle) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) +(defmethod rigid-body-object-method-47 vehicle ((this vehicle) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) (local-vars (f0-2 float) (sv-96 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1469,7 +1477,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'matrix))) - (rigid-body-object-method-49 obj (the-as rigid-body-impact s5-0) arg2) + (rigid-body-object-method-49 this (the-as rigid-body-impact s5-0) arg2) (cond ((logtest? (attack-mask attacker-velocity) (-> arg1 mask)) (set! (-> s5-0 vector 2 quad) (-> arg1 attacker-velocity quad)) @@ -1509,14 +1517,14 @@ (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'eco-dark)) ) (set! (-> s5-0 vector 2 y) (* 0.1 (-> s5-0 vector 2 y))) - (set! f0-2 (* 409600.0 (-> obj info info mass))) - (/ 0.4 (-> obj info damage-factor)) + (set! f0-2 (* 409600.0 (-> this info info mass))) + (/ 0.4 (-> this info damage-factor)) ) ((or (logtest? (penetrate dark-punch dark-bomb) arg3) (and (logtest? (penetrate dark-skin) arg3) (logtest? arg3 (penetrate punch spin))) ) - (set! f0-2 (* 204800.0 (-> obj info info mass))) - (/ 0.2 (-> obj info damage-factor)) + (set! f0-2 (* 204800.0 (-> this info info mass))) + (/ 0.2 (-> this info damage-factor)) ) ((logtest? (penetrate enemy-yellow-shot) arg3) (set! f0-2 49152.0) @@ -1565,27 +1573,27 @@ ) ) (set! (-> s5-0 trans x) f0-2) - (apply-damage obj (* 0.667 f1-0) (the-as rigid-body-impact s5-0)) + (apply-damage this (* 0.667 f1-0) (the-as rigid-body-impact s5-0)) ) - (rigid-body-object-method-42 obj) + (rigid-body-object-method-42 this) (let ((s3-1 (new 'stack-no-clear 'vector))) (set! (-> s3-1 quad) (-> s5-0 vector 2 quad)) (vector-normalize! s3-1 1.0) (vector-float*! s3-1 s3-1 (-> s5-0 trans x)) - (let ((v1-90 (-> obj rbody)) + (let ((v1-90 (-> this rbody)) (a1-11 (-> s5-0 vector)) (a2-3 s3-1) ) (rigid-body-method-18 (-> v1-90 state) (the-as vector a1-11) a2-3) ) - (let ((v1-93 (-> obj rbody)) + (let ((v1-93 (-> this rbody)) (f0-10 1.0) ) (rigid-body-method-12 (-> v1-93 state) f0-10) ) - (rigid-body-method-13 (-> obj rbody state)) + (rigid-body-method-13 (-> this rbody state)) (when #f - (set! (-> *debug-vehicle-work* impact-time) (current-time)) + (set-time! (-> *debug-vehicle-work* impact-time)) (mem-copy! (the-as pointer (-> *debug-vehicle-work* impact)) (the-as pointer s5-0) 64) (let ((v1-103 (-> arg2 head))) (set! (-> *debug-vehicle-work* prim-sphere1 quad) (-> v1-103 prim1 cprim prim-core world-sphere quad)) @@ -1602,16 +1610,16 @@ ) ) ) - (rigid-body-object-method-45 obj (the-as rigid-body-impact s5-0)) + (rigid-body-object-method-45 this (the-as rigid-body-impact s5-0)) ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (go (method-of-object obj waiting)) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (go (method-of-object this waiting)) ) #t ) ) -(defmethod rigid-body-object-method-48 vehicle ((obj vehicle) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-48 vehicle ((this vehicle) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (v1-2 symbol) (v1-30 symbol) (a0-19 object)) (with-pp (b! @@ -1626,10 +1634,10 @@ (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact))) (let ((s2-0 (new 'stack-no-clear 'vector))) (let ((f30-0 (get-inv-mass arg0))) - (rigid-body-object-method-49 obj s5-0 arg1) + (rigid-body-object-method-49 this s5-0 arg1) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (let ((v1-14 (-> obj rbody)) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (let ((v1-14 (-> this rbody)) (a1-3 (-> s5-0 point)) (a2-2 (-> s5-0 velocity)) ) @@ -1637,7 +1645,7 @@ ) ) (else - (set! (-> s5-0 velocity quad) (-> obj root transv quad)) + (set! (-> s5-0 velocity quad) (-> this root transv quad)) ) ) (let ((v1-18 (-> arg0 root))) @@ -1646,22 +1654,22 @@ ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) (b! (>= f0-1 0.0) cfg-32 :delay #f) - (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info info inv-mass)))) + (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> this info info inv-mass)))) ) (vector+float*! s2-0 s2-0 (-> s5-0 normal) (* -3.1 f30-0 (-> s5-0 impulse))) (set! (-> s2-0 y) (fmax (* 49152.0 f30-0) (-> s2-0 y))) ) - (b! (logtest? (rigid-body-object-flag in-pursuit) (-> obj flags)) cfg-13 :likely-delay (set! v1-30 #t)) + (b! (logtest? (rigid-body-object-flag in-pursuit) (-> this flags)) cfg-13 :likely-delay (set! v1-30 #t)) (set! v1-30 (!= arg0 *target*)) (label cfg-13) (b! (not v1-30) cfg-25 :delay (empty-form)) - (when (>= (- (current-time) (-> obj sent-attack-time)) (seconds 0.5)) - (set! (-> obj sent-attack-time) (current-time)) + (when (time-elapsed? (-> this sent-attack-time) (seconds 0.5)) + (set-time! (-> this sent-attack-time)) (let* ((v1-39 *game-info*) (a0-18 (+ (-> v1-39 attack-id) 1)) ) (set! (-> v1-39 attack-id) a0-18) - (set! (-> obj outgoing-attack-id) a0-18) + (set! (-> this outgoing-attack-id) a0-18) ) ) (let ((f30-1 (+ 0.5 (* 0.000024414063 (- (-> s5-0 impulse))))) @@ -1677,8 +1685,8 @@ (set! (-> s1-0 message) 'attack) (set! (-> s1-0 param 0) (the-as uint arg1)) (set! (-> s1-0 param 1) - (the-as uint (static-attack-info ((id (-> obj outgoing-attack-id)) - (attacker (process->handle (vehicle-method-70 obj))) + (the-as uint (static-attack-info ((id (-> this outgoing-attack-id)) + (attacker (process->handle (vehicle-method-70 this))) (mode 'vehicle) (vector s2-0) (penetrate-using (penetrate vehicle)) @@ -1691,23 +1699,23 @@ ) ) (label cfg-25) - (rigid-body-object-method-42 obj) + (rigid-body-object-method-42 this) (let ((a2-4 (new 'stack-no-clear 'vector))) (vector-float*! a2-4 (-> s5-0 normal) (-> s5-0 impulse)) - (let ((v1-60 (-> obj rbody)) + (let ((v1-60 (-> this rbody)) (a1-9 (-> s5-0 point)) ) (rigid-body-method-18 (-> v1-60 state) a1-9 a2-4) ) ) - (let ((v1-63 (-> obj rbody)) + (let ((v1-63 (-> this rbody)) (f0-11 1.0) ) (rigid-body-method-12 (-> v1-63 state) f0-11) ) - (rigid-body-method-13 (-> obj rbody state)) + (rigid-body-method-13 (-> this rbody state)) (when #f - (set! (-> *debug-vehicle-work* impact-time) (current-time)) + (set-time! (-> *debug-vehicle-work* impact-time)) (mem-copy! (the-as pointer (-> *debug-vehicle-work* impact)) (the-as pointer s5-0) 64) (let ((v1-73 (-> arg1 head))) (set! (-> *debug-vehicle-work* prim-sphere1 quad) (-> v1-73 prim1 cprim prim-core world-sphere quad)) @@ -1723,16 +1731,16 @@ *color-blue* ) ) - (rigid-body-object-method-45 obj s5-0) + (rigid-body-object-method-45 this s5-0) ) - (b! (not (and (-> obj next-state) (= (-> obj next-state name) 'idle))) cfg-32 :delay (empty-form)) - (go (method-of-object obj waiting)) + (b! (not (and (-> this next-state) (= (-> this next-state name) 'idle))) cfg-32 :delay (empty-form)) + (go (method-of-object this waiting)) (label cfg-32) #t ) ) -(defmethod rigid-body-object-method-46 vehicle ((obj vehicle) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 vehicle ((this vehicle) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (= arg2 'touched) arg0 (logtest? (process-mask bit18) (-> arg0 mask))) (dotimes (s1-0 4) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1745,71 +1753,71 @@ (set! (-> a1-2 param 3) (-> arg3 param 3)) (set! (-> a1-2 param 4) (-> arg3 param 4)) (set! (-> a1-2 param 5) (-> arg3 param 5)) - (send-event-function (handle->process (-> obj rider-array s1-0)) a1-2) + (send-event-function (handle->process (-> this rider-array s1-0)) a1-2) ) ) ) (case arg2 (('traffic-off) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag persistent))) + (when (not (logtest? (-> this flags) (rigid-body-object-flag persistent))) (cond - ((logtest? (-> obj flags) (rigid-body-object-flag dead)) - (go (method-of-object obj die)) + ((logtest? (-> this flags) (rigid-body-object-flag dead)) + (go (method-of-object this die)) ) (else - (if (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) - (vehicle-method-113 obj) + (if (logtest? (rigid-body-object-flag ai-driving) (-> this flags)) + (vehicle-method-113 this) ) ) ) ) ) (('traffic-off-force) - (vehicle-method-113 obj) + (vehicle-method-113 this) ) (('traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) - (logior! (-> obj flags) (rigid-body-object-flag traffic-managed)) + (set! (-> this controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (logior! (-> this flags) (rigid-body-object-flag traffic-managed)) (let ((s5-1 (the-as traffic-object-spawn-params (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> s5-1 position quad)) - (quaternion-copy! (-> obj root quat) (-> s5-1 rotation)) - (set! (-> obj root transv quad) (-> s5-1 velocity quad)) - (vehicle-method-130 obj s5-1) + (set! (-> this root trans quad) (-> s5-1 position quad)) + (quaternion-copy! (-> this root quat) (-> s5-1 rotation)) + (set! (-> this root transv quad) (-> s5-1 velocity quad)) + (vehicle-method-130 this s5-1) ) ) (('attack) (let ((s3-1 (the-as attack-info (-> arg3 param 1))) (s2-1 (get-penetrate-using-from-attack-event arg0 arg3)) ) - (when (and (!= (-> s3-1 id) (-> obj incoming-attack-id)) - (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) - (or (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (when (and (!= (-> s3-1 id) (-> this incoming-attack-id)) + (not (logtest? (-> this flags) (rigid-body-object-flag dead))) + (or (not (logtest? (-> this flags) (rigid-body-object-flag player-driving))) (not (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) ) ) - (set! (-> obj incoming-attack-id) (-> s3-1 id)) - (when (and (logtest? (-> obj info flags) 4) (logtest? (rigid-body-object-flag ai-driving) (-> obj flags))) + (set! (-> this incoming-attack-id) (-> s3-1 id)) + (when (and (logtest? (-> this info flags) 4) (logtest? (rigid-body-object-flag ai-driving) (-> this flags))) (let ((a1-8 (find-offending-process-focusable arg0 s3-1))) (if (and a1-8 (logtest? (-> a1-8 mask) (process-mask target))) - (vehicle-method-134 obj a1-8) + (vehicle-method-134 this a1-8) ) ) ) - (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) s2-1) + (rigid-body-object-method-47 this arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) s2-1) ) ) ) (('turbo-ring) - (set! (-> obj turbo-boost-factor) (the-as float (-> arg3 param 0))) - (set! (-> obj turbo-boost-time) (current-time)) - (set! (-> obj turbo-boost-duration) (the-as uint 75)) - (logior! (-> obj flags) (rigid-body-object-flag turbo-boost)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (set! (-> this turbo-boost-factor) (the-as float (-> arg3 param 0))) + (set-time! (-> this turbo-boost-time)) + (set! (-> this turbo-boost-duration) (the-as uint 75)) + (logior! (-> this flags) (rigid-body-object-flag turbo-boost)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (sound-play "boost-ring") ) ) (('get-offending-focusable) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) *target* ) ) @@ -1822,37 +1830,37 @@ ) ) (when s5-3 - (format #t "vehicle::event-handler: pilot-on (pid ~d) from pid ~d~%" (-> obj pid) (-> arg0 pid)) - (logior! (-> obj flags) (rigid-body-object-flag riding)) - (put-rider-in-seat obj (the-as int s3-2) (the-as process-focusable s5-3)) + (format #t "vehicle::event-handler: pilot-on (pid ~d) from pid ~d~%" (-> this pid) (-> arg0 pid)) + (logior! (-> this flags) (rigid-body-object-flag riding)) + (put-rider-in-seat this (the-as int s3-2) (the-as process-focusable s5-3)) (if (logtest? (-> s5-3 mask) (process-mask target)) - (logior! (-> obj flags) (rigid-body-object-flag player-driving)) + (logior! (-> this flags) (rigid-body-object-flag player-driving)) ) #t ) ) ) (('player-get-off) - (if (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (!= (-> obj crash-level) 3)) - (go (method-of-object obj waiting)) + (if (and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (!= (-> this crash-level) 3)) + (go (method-of-object this waiting)) ) ) (('rider-off) - (send-event (ppointer->process (-> obj child)) 'rider-off) + (send-event (ppointer->process (-> this child)) 'rider-off) ) (('rider-on) - (send-event (ppointer->process (-> obj child)) 'rider-on) + (send-event (ppointer->process (-> this child)) 'rider-on) ) (('nav-mesh-kill) - (vehicle-method-142 obj) + (vehicle-method-142 this) ) (else - ((method-of-type rigid-body-object rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) + ((method-of-type rigid-body-object rigid-body-object-method-46) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod vehicle-method-135 vehicle ((obj vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-135 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) 0 (none) ) diff --git a/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc b/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc index ab9e802e9b..b5bc052856 100644 --- a/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc +++ b/goal_src/jak2/levels/city/vinroom/vinroom-obs.gc @@ -192,32 +192,32 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-turbine ((obj vin-turbine) (arg0 entity-actor)) +(defmethod init-from-entity! vin-turbine ((this vin-turbine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-turbine" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj outside-plane) 0.707 0.0 0.707 -6377922.5) - (set! (-> obj lightning-plane quad) (-> obj outside-plane quad)) - (set! (-> obj lightning-plane w) -6419865.5) - (set! (-> obj dont-draw-outside?) - (nonzero? (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0)) + (set-vector! (-> this outside-plane) 0.707 0.0 0.707 -6377922.5) + (set! (-> this lightning-plane quad) (-> this outside-plane quad)) + (set! (-> this lightning-plane w) -6419865.5) + (set! (-> this dont-draw-outside?) + (nonzero? (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0)) ) - (set! (-> obj lightning-timer) (the-as uint 0)) - (if (and (-> obj dont-draw-outside?) - (< (vector4-dot (the-as vector (-> obj outside-plane)) (math-camera-pos)) 0.0) + (set! (-> this lightning-timer) (the-as uint 0)) + (if (and (-> this dont-draw-outside?) + (< (vector4-dot (the-as vector (-> this outside-plane)) (math-camera-pos)) 0.0) ) - (go (method-of-object obj dormant)) - (go (method-of-object obj idle)) + (go (method-of-object this dormant)) + (go (method-of-object this idle)) ) (none) ) @@ -237,7 +237,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-door ((obj vin-door) (arg0 entity-actor)) +(defmethod init-from-entity! vin-door ((this vin-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -245,8 +245,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -275,19 +275,19 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (set! (-> obj door-radius) 12288.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> this door-radius) 12288.0) + (go (method-of-object this close) #t) (none) ) diff --git a/goal_src/jak2/levels/city/vinroom/vinroom-scenes.gc b/goal_src/jak2/levels/city/vinroom/vinroom-scenes.gc index 61aefe84ee..da723dfe1a 100644 --- a/goal_src/jak2/levels/city/vinroom/vinroom-scenes.gc +++ b/goal_src/jak2/levels/city/vinroom/vinroom-scenes.gc @@ -24,10 +24,10 @@ ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! vin-npc ((obj vin-npc)) +(defmethod init-art! vin-npc ((this vin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vin" (the-as (pointer uint32) #f))) (the-as pair 0) ) diff --git a/goal_src/jak2/levels/common/ai/ai-task-h.gc b/goal_src/jak2/levels/common/ai/ai-task-h.gc index bcbebb3332..8eaeedd1c9 100644 --- a/goal_src/jak2/levels/common/ai/ai-task-h.gc +++ b/goal_src/jak2/levels/common/ai/ai-task-h.gc @@ -67,32 +67,32 @@ ) -(defmethod ai-task-method-11 ai-task ((obj ai-task) (arg0 bot)) +(defmethod ai-task-method-11 ai-task ((this ai-task) (arg0 bot)) 0 (none) ) -(defmethod ai-task-method-10 ai-task ((obj ai-task) (arg0 bot)) +(defmethod ai-task-method-10 ai-task ((this ai-task) (arg0 bot)) 0 (none) ) -(defmethod reset-task! ai-task ((obj ai-task)) +(defmethod reset-task! ai-task ((this ai-task)) 0 (none) ) ;; WARN: Return type mismatch (pointer uint32) vs ai-task. -(defmethod ai-task-pool-method-11 ai-task-pool ((obj ai-task-pool)) - (set! (-> obj unique-id) (the-as uint 0)) +(defmethod ai-task-pool-method-11 ai-task-pool ((this ai-task-pool)) + (set! (-> this unique-id) (the-as uint 0)) (let ((t0-0 (the-as (pointer uint32) #f)) (a1-0 (the-as (pointer uint32) #f)) - (v1-0 (-> obj tasks)) + (v1-0 (-> this tasks)) ) - (let ((a2-0 (-> obj tasks-length))) + (let ((a2-0 (-> this tasks-length))) (dotimes (a3-0 (the-as int a2-0)) (set! a1-0 (&+ v1-0 (* 48 a3-0))) - (set! (-> a1-0 2) (the-as uint obj)) + (set! (-> a1-0 2) (the-as uint this)) (set! (-> a1-0 3) (the-as uint 0)) (set! (-> a1-0 1) (the-as uint t0-0)) (if t0-0 @@ -103,26 +103,26 @@ ) (set! (-> a1-0 0) (the-as uint #f)) (let ((v0-0 (&-> v1-0 0))) - (set! (-> obj anchor) (the-as ai-task v0-0)) + (set! (-> this anchor) (the-as ai-task v0-0)) (the-as ai-task v0-0) ) ) ) -(defmethod assign-ids! ai-task-pool ((obj ai-task-pool) (arg0 type)) +(defmethod assign-ids! ai-task-pool ((this ai-task-pool) (arg0 type)) "Assign unique IDs to the [[ai-task-pool]] and its `anchor`s `next`" - (let ((v1-1 (-> obj anchor next))) + (let ((v1-1 (-> this anchor next))) (when v1-1 (let ((a2-0 (-> v1-1 prev)) (a3-0 (-> v1-1 next)) ) (set! (-> v1-1 prev) #f) (set! (-> v1-1 next) #f) - (let ((t0-1 (the-as int (+ (-> obj unique-id) 1)))) + (let ((t0-1 (the-as int (+ (-> this unique-id) 1)))) (if (zero? (the-as uint t0-1)) (set! t0-1 1) ) - (set! (-> obj unique-id) (the-as uint t0-1)) + (set! (-> this unique-id) (the-as uint t0-1)) (set! (-> v1-1 unique-id) (the-as uint t0-1)) ) (set! (-> a2-0 next) a3-0) @@ -137,9 +137,9 @@ ) ;; WARN: Return type mismatch ai-task vs none. -(defmethod set-next-task! ai-task-pool ((obj ai-task-pool) (arg0 ai-task)) +(defmethod set-next-task! ai-task-pool ((this ai-task-pool) (arg0 ai-task)) "Set the next task in the [[ai-task-pool]] to the specified [[ai-task]]." - (let* ((v1-0 (-> obj anchor)) + (let* ((v1-0 (-> this anchor)) (v0-0 (-> v1-0 next)) ) (set! (-> v1-0 next) arg0) @@ -157,9 +157,9 @@ ) ) -(defmethod ai-task-control-method-12 ai-task-control ((obj ai-task-control) (arg0 bot)) - (let ((gp-0 (-> obj anchor))) - (let ((s3-0 (-> obj anchor next))) +(defmethod ai-task-control-method-12 ai-task-control ((this ai-task-control) (arg0 bot)) + (let ((gp-0 (-> this anchor))) + (let ((s3-0 (-> this anchor next))) (while s3-0 (let ((s4-0 (-> s3-0 next))) (if arg0 @@ -177,20 +177,20 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-control-method-9 ai-task-control ((obj ai-task-control)) - (ai-task-control-method-12 obj (the-as bot #f)) - (let ((a1-1 (-> obj anchor))) +(defmethod ai-task-control-method-9 ai-task-control ((this ai-task-control)) + (ai-task-control-method-12 this (the-as bot #f)) + (let ((a1-1 (-> this anchor))) (when a1-1 (set-next-task! (-> a1-1 pool) a1-1) - (set! (-> obj anchor) #f) + (set! (-> this anchor) #f) ) ) (none) ) -(defmethod init-task! ai-task-control ((obj ai-task-control) (arg0 type) (arg1 bot)) +(defmethod init-task! ai-task-control ((this ai-task-control) (arg0 type) (arg1 bot)) "Initialize a task of the given type in the [[ai-task-control]]'s pool." - (let ((s5-0 (assign-ids! (-> obj pool) arg0))) + (let ((s5-0 (assign-ids! (-> this pool) arg0))) (if s5-0 (reset-task! s5-0) ) @@ -199,9 +199,9 @@ ) ;; WARN: Return type mismatch ai-task vs none. -(defmethod set-next-task! ai-task-control ((obj ai-task-control) (arg0 ai-task)) +(defmethod set-next-task! ai-task-control ((this ai-task-control) (arg0 ai-task)) "Set `next` of this [[ai-task-control]]'s `anchor` to the given [[ai-task]]." - (let* ((v1-0 (-> obj anchor)) + (let* ((v1-0 (-> this anchor)) (a0-1 (-> v1-0 next)) ) (set! (-> v1-0 next) arg0) @@ -211,28 +211,28 @@ (none) ) -(defmethod set-next-task-for-pool! ai-task-control ((obj ai-task-control) (arg0 ai-task)) - (set-next-task! (-> obj pool) arg0) +(defmethod set-next-task-for-pool! ai-task-control ((this ai-task-control) (arg0 ai-task)) + (set-next-task! (-> this pool) arg0) (none) ) -(defmethod get-task-by-type ai-task-control ((obj ai-task-control) (arg0 type) (arg1 bot)) - (let ((s5-0 (init-task! obj arg0 arg1))) +(defmethod get-task-by-type ai-task-control ((this ai-task-control) (arg0 type) (arg1 bot)) + (let ((s5-0 (init-task! this arg0 arg1))) (if s5-0 - (set-next-task! obj s5-0) + (set-next-task! this s5-0) ) s5-0 ) ) -(defmethod ai-task-control-method-13 ai-task-control ((obj ai-task-control) (arg0 ai-task) (arg1 bot)) +(defmethod ai-task-control-method-13 ai-task-control ((this ai-task-control) (arg0 ai-task) (arg1 bot)) (let ((gp-0 (-> arg0 prev)) (s5-0 (-> arg0 next)) ) (if arg1 (ai-task-method-10 arg0 arg1) ) - (set-next-task! (-> obj pool) arg0) + (set-next-task! (-> this pool) arg0) (if gp-0 (set! (-> gp-0 next) s5-0) ) @@ -243,8 +243,8 @@ ) ) -(defmethod ai-task-control-method-10 ai-task-control ((obj ai-task-control) (arg0 bot)) - (let ((a0-1 (-> obj anchor next))) +(defmethod ai-task-control-method-10 ai-task-control ((this ai-task-control) (arg0 bot)) + (let ((a0-1 (-> this anchor next))) (if a0-1 (ai-task-method-11 a0-1 arg0) ) @@ -252,8 +252,8 @@ (none) ) -(defmethod ai-task-control-method-14 ai-task-control ((obj ai-task-control) (arg0 ai-task) (arg1 bot)) - (let ((a0-1 (ai-task-control-method-13 obj arg0 arg1))) +(defmethod ai-task-control-method-14 ai-task-control ((this ai-task-control) (arg0 ai-task) (arg1 bot)) + (let ((a0-1 (ai-task-control-method-13 this arg0 arg1))) (if a0-1 (ai-task-method-11 a0-1 arg1) ) diff --git a/goal_src/jak2/levels/common/ai/ashelin/ash-h.gc b/goal_src/jak2/levels/common/ai/ashelin/ash-h.gc index 5e03a01aed..3d6645a29c 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash-h.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash-h.gc @@ -61,10 +61,10 @@ ) -(defskelgroup skel-ashelin ashelin 0 3 - ((1 (meters 999999))) +(defskelgroup skel-ashelin ashelin ashelin-lod0-jg ashelin-idle0-ja + ((ashelin-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 2.7) - :shadow 2 + :shadow ashelin-shadow-mg :origin-joint-index 13 ) 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 5f8d9a5845..99fe11e689 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash-shot.gc @@ -255,14 +255,14 @@ ) -(defmethod draw-laser-sight ashelin-shot ((obj ashelin-shot)) +(defmethod draw-laser-sight ashelin-shot ((this ashelin-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 675) (-> obj tail-pos) (-> obj starting-dir) #f #t) + (draw-beam (-> *part-id-table* 675) (-> this tail-pos) (-> this starting-dir) #f #t) 0 (none) ) -(defmethod spawn-impact-particles ashelin-shot ((obj ashelin-shot)) +(defmethod spawn-impact-particles ashelin-shot ((this ashelin-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -272,8 +272,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((v1-1 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((v1-1 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -317,7 +317,7 @@ ) ) -(defmethod spawn-shell-particles ashelin-shot ((obj ashelin-shot)) +(defmethod spawn-shell-particles ashelin-shot ((this ashelin-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -339,7 +339,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -358,7 +358,8 @@ (none) ) -(defmethod play-impact-sound ashelin-shot ((obj ashelin-shot) (arg0 projectile-options)) +;; WARN: Return type mismatch object vs none. +(defmethod play-impact-sound ashelin-shot ((this ashelin-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -368,23 +369,23 @@ (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)) obj arg0) + ((the-as (function projectile projectile-options none) (find-parent-method ashelin-shot 28)) this arg0) ) ) ) (none) ) -(defmethod made-impact? ashelin-shot ((obj ashelin-shot)) +(defmethod made-impact? ashelin-shot ((this ashelin-shot)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a1-0 t1-0)) (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a1-0 ignore-process0) obj) - (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-0 action-mask) (collide-action solid)) ) @@ -420,9 +421,9 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod init-proj-collision! ashelin-shot ((obj ashelin-shot)) +(defmethod init-proj-collision! ashelin-shot ((this ashelin-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -463,12 +464,12 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) - (let ((v1-23 (-> obj parent))) + (let ((v1-23 (-> this parent))) (when (not (logtest? (-> (the-as ashelin (if v1-23 (the-as ashelin (-> v1-23 0 self)) ) @@ -478,7 +479,7 @@ (bot-flags attacked) ) ) - (let* ((a0-17 (-> obj root)) + (let* ((a0-17 (-> this root)) (v1-27 (-> a0-17 root-prim)) ) (countdown (a0-18 (-> a0-17 total-prims)) @@ -491,12 +492,12 @@ (none) ) -(defmethod init-proj-settings! ashelin-shot ((obj ashelin-shot)) +(defmethod init-proj-settings! ashelin-shot ((this ashelin-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj max-speed) 307200.0) - (set! (-> obj move) ashelin-shot-move) - (set! (-> obj timeout) (seconds 1.335)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this max-speed) 307200.0) + (set! (-> this move) ashelin-shot-move) + (set! (-> this timeout) (seconds 1.335)) (none) ) diff --git a/goal_src/jak2/levels/common/ai/ashelin/ash-states.gc b/goal_src/jak2/levels/common/ai/ashelin/ash-states.gc index 8fb9f3f536..b5eece7c35 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash-states.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash-states.gc @@ -11,7 +11,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -100,7 +100,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -159,7 +159,7 @@ (ashelin-method-240 self a1-6) ) (else - (if (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) (ashelin-method-247 self)) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (ashelin-method-247 self)) (go-virtual chase) ) ) @@ -177,7 +177,7 @@ ) ) (else - (if (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (if (time-elapsed? (-> self state-time) (-> self reaction-time)) (ashelin-method-239 self) ) ) @@ -239,7 +239,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -323,7 +323,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -352,10 +352,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (ashelin-method-239 self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -385,7 +385,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -405,7 +405,7 @@ ((bot-method-214 self) (go-hostile self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -430,7 +430,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (when (bot-method-214 self) (if (ashelin-method-238 self #t #f) (go-virtual standing-idle) @@ -510,14 +510,14 @@ :trans (behavior () (bot-method-223 self #t) (cond - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ((not (bot-method-214 self)) (go-virtual traveling) ) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (or (ashelin-method-238 self #t #f) (ashelin-method-248 self)) (go-virtual standing-idle) ) @@ -558,7 +558,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -687,7 +687,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -809,7 +809,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/goal_src/jak2/levels/common/ai/ashelin/ash.gc b/goal_src/jak2/levels/common/ai/ashelin/ash.gc index ae78ee3727..eb1c4bcc9c 100644 --- a/goal_src/jak2/levels/common/ai/ashelin/ash.gc +++ b/goal_src/jak2/levels/common/ai/ashelin/ash.gc @@ -209,13 +209,13 @@ (set! (-> *ashelin-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod get-penetrate-info ashelin ((obj ashelin)) +(defmethod get-penetrate-info ashelin ((this ashelin)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (let* ((t9-0 (method-of-type bot get-penetrate-info)) - (v0-0 (t9-0 obj)) + (v0-0 (t9-0 this)) ) - (if (logtest? (bot-flags bf22) (-> obj bot-flags)) + (if (logtest? (bot-flags bf22) (-> this bot-flags)) (set! v0-0 (logior (penetrate jak-yellow-shot) v0-0)) ) v0-0 @@ -223,53 +223,53 @@ ) ;; WARN: Return type mismatch penetrate vs none. -(defmethod ashelin-method-250 ashelin ((obj ashelin) (arg0 symbol)) +(defmethod ashelin-method-250 ashelin ((this ashelin) (arg0 symbol)) (if arg0 - (logior! (-> obj bot-flags) (bot-flags bf22)) - (logclear! (-> obj bot-flags) (bot-flags bf22)) + (logior! (-> this bot-flags) (bot-flags bf22)) + (logclear! (-> this bot-flags) (bot-flags bf22)) ) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) + (set! (-> this root penetrated-by) (get-penetrate-info this)) (none) ) -(defmethod bot-method-193 ashelin ((obj ashelin)) +(defmethod bot-method-193 ashelin ((this ashelin)) (let* ((t9-0 (method-of-type bot bot-method-193)) - (v0-0 (t9-0 obj)) + (v0-0 (t9-0 this)) ) - (when (and (not v0-0) (logtest? #x400000 (-> obj incoming penetrate-using))) - (if (logtest? (bot-flags bf22) (-> obj bot-flags)) + (when (and (not v0-0) (logtest? #x400000 (-> this incoming penetrate-using))) + (if (logtest? (bot-flags bf22) (-> this bot-flags)) (set! v0-0 #t) ) - (logior! (-> obj bot-flags) (bot-flags bf21)) + (logior! (-> this bot-flags) (bot-flags bf21)) ) v0-0 ) ) -(defmethod enemy-method-106 ashelin ((obj ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ashelin ((this ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type bot enemy-method-106))) - (t9-0 obj arg0 arg1 arg2 arg3) + (t9-0 this arg0 arg1 arg2 arg3) ) - (if (!= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-1)) + (if (!= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-1)) ) (none) ) -(defmethod enemy-method-104 ashelin ((obj ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ashelin ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (if (and (= (-> arg0 type) target) - (-> obj next-state) - (let ((v1-4 (-> obj next-state name))) + (-> this next-state) + (let ((v1-4 (-> this next-state name))) (or (= v1-4 'back-spring) (= v1-4 'cartwheel-left) (= v1-4 'tumble-right)) ) ) #f - ((method-of-type bot enemy-method-104) obj arg0 arg1 arg2) + ((method-of-type bot enemy-method-104) this arg0 arg1 arg2) ) ) -(defmethod enemy-method-97 ashelin ((obj ashelin)) - (let* ((s5-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 ashelin ((this ashelin)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 ) @@ -278,25 +278,25 @@ (when v1-3 (cond ((= (-> v1-3 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! v1-3 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 2.5)) + (when (time-elapsed? (-> this attacker-time) (seconds 2.5)) (set! v1-3 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) - (let ((a0-21 (-> obj focus-mode)) + (let ((a0-21 (-> this focus-mode)) (s5-1 (the-as process #f)) ) (cond @@ -305,11 +305,11 @@ (v1-3 (set! s5-1 v1-3) ) - ((begin (set! s5-1 (select-focus! obj)) s5-1) + ((begin (set! s5-1 (select-focus! this)) s5-1) (empty) ) (else - (let ((s4-0 (handle->process (-> obj poi-handle)))) + (let ((s4-0 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-0 process-focusable) s4-0 ) @@ -328,7 +328,7 @@ (set! s5-1 v1-3) ) (else - (let ((s4-1 (handle->process (-> obj poi-handle)))) + (let ((s4-1 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-1 process-focusable) s4-1 ) @@ -338,7 +338,7 @@ (s5-1 (empty) ) - ((begin (set! s5-1 (select-focus! obj)) s5-1) + ((begin (set! s5-1 (select-focus! this)) s5-1) (empty) ) (else @@ -351,14 +351,14 @@ ) (cond (s5-1 - (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s5-1 type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s5-1 type) target)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s5-1 @@ -367,21 +367,21 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? ashelin ((obj ashelin)) +(defmethod alive? ashelin ((this ashelin)) (let ((t9-0 (method-of-type bot alive?))) (the-as symbol - (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'waiting-idle) (= v1-3 'hidden) (= v1-3 'traveling)) - ) + (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'waiting-idle) (= v1-3 'hidden) (= v1-3 'traveling)) + ) ) ) ) ) -(defmethod init-enemy-collision! ashelin ((obj ashelin)) +(defmethod init-enemy-collision! ashelin ((this ashelin)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -428,27 +428,27 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 7)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! ashelin ((obj ashelin)) +(defmethod init-enemy! ashelin ((this ashelin)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) - (set! (-> obj channel) (the-as uint 22)) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 204800.0) - (set! (-> obj hit-invuln-ignore-me-delay) (the-as uint 0)) - (set! (-> obj hit-invuln-focus-disable-delay) (the-as uint 750)) + (init! this) + (set! (-> this channel) (the-as uint 22)) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 204800.0) + (set! (-> this hit-invuln-ignore-me-delay) (the-as uint 0)) + (set! (-> this hit-invuln-focus-disable-delay) (the-as uint 750)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ashelin" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *ashelin-nav-enemy-info*) - (let ((v1-10 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *ashelin-nav-enemy-info*) + (let ((v1-10 (-> this neck))) (set! (-> v1-10 up) (the-as uint 1)) (set! (-> v1-10 nose) (the-as uint 2)) (set! (-> v1-10 ear) (the-as uint 0)) @@ -456,17 +456,17 @@ (set! (-> v1-10 ignore-angle) 30947.555) ) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) 0 (none) ) ;; WARN: disable def twice: 25. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod ashelin-method-238 ashelin ((obj ashelin) (arg0 symbol) (arg1 symbol)) +(defmethod ashelin-method-238 ashelin ((this ashelin) (arg0 symbol) (arg1 symbol)) (cond - ((and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target)) + ((and (logtest? (-> this bot-flags) (bot-flags attacked)) (= (-> this focus-info fproc type) target)) #t ) (else @@ -474,8 +474,8 @@ (if arg1 (set! f0-0 (+ 6144.0 f0-0)) ) - (when (>= f0-0 (-> obj focus-info bullseye-xz-dist)) - (let ((v1-9 (-> obj focus-info los))) + (when (>= f0-0 (-> this focus-info bullseye-xz-dist)) + (let ((v1-9 (-> this focus-info los))) (if arg0 (or (= v1-9 1) (= v1-9 4)) (= v1-9 1) @@ -487,30 +487,30 @@ ) ) -(defmethod ashelin-method-235 ashelin ((obj ashelin) (arg0 symbol)) - (and (>= (- (current-time) (-> obj last-fire-time)) (seconds 1)) - (and (>= 8556.089 (fabs (-> obj focus-info ry-diff))) (ashelin-method-238 obj arg0 #t)) +(defmethod ashelin-method-235 ashelin ((this ashelin) (arg0 symbol)) + (and (time-elapsed? (-> this last-fire-time) (seconds 1)) + (and (>= 8556.089 (fabs (-> this focus-info ry-diff))) (ashelin-method-238 this arg0 #t)) ) ) -(defmethod ashelin-method-243 ashelin ((obj ashelin) (arg0 float)) - (let ((f30-0 (deg- arg0 (-> obj focus-info my-facing-ry)))) +(defmethod ashelin-method-243 ashelin ((this ashelin) (arg0 float)) + (let ((f30-0 (deg- arg0 (-> this focus-info my-facing-ry)))) (when (>= 16384.0 (fabs f30-0)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (ashelin-method-236 obj s5-0 (+ 32768.0 arg0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s5-0 (-> obj root trans)) + (when (ashelin-method-236 this s5-0 (+ 32768.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) (return 1) ) (cond ((< 0.0 f30-0) - (when (ashelin-method-236 obj s5-0 (+ -16384.0 arg0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s5-0 (-> obj root trans)) + (when (ashelin-method-236 this s5-0 (+ -16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) (return 2) ) ) (else - (when (ashelin-method-236 obj s5-0 (+ 16384.0 arg0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s5-0 (-> obj root trans)) + (when (ashelin-method-236 this s5-0 (+ 16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) (return 3) ) ) @@ -521,47 +521,47 @@ 0 ) -(defmethod ashelin-method-246 ashelin ((obj ashelin)) - (when (>= 32768.0 (-> obj focus-info bullseye-xz-dist)) - (let ((f0-1 (-> obj focus-info bullseye-ry))) - (return (ashelin-method-243 obj f0-1)) +(defmethod ashelin-method-246 ashelin ((this ashelin)) + (when (>= 32768.0 (-> this focus-info bullseye-xz-dist)) + (let ((f0-1 (-> this focus-info bullseye-ry))) + (return (ashelin-method-243 this f0-1)) ) ) - (when (logtest? (bot-flags bf20) (-> obj bot-flags)) - (set! (-> obj root trans w) 1.0) - (when (>= (vector4-dot (the-as vector (-> obj frontline)) (-> obj root trans)) 12288.0) - (let ((f0-7 (atan (-> obj frontline x) (-> obj frontline z)))) - (return (ashelin-method-243 obj f0-7)) + (when (logtest? (bot-flags bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (when (>= (vector4-dot (the-as vector (-> this frontline)) (-> this root trans)) 12288.0) + (let ((f0-7 (atan (-> this frontline x) (-> this frontline z)))) + (return (ashelin-method-243 this f0-7)) ) ) ) 0 ) -(defmethod ashelin-method-241 ashelin ((obj ashelin)) +(defmethod ashelin-method-241 ashelin ((this ashelin)) (let* ((v1-0 (target-pos 0)) - (a1-0 (-> obj root trans)) + (a1-0 (-> this root trans)) (f30-0 (atan (- (-> a1-0 x) (-> v1-0 x)) (- (-> a1-0 z) (-> v1-0 z)))) - (f0-5 (deg- f30-0 (-> obj focus-info my-facing-ry))) + (f0-5 (deg- f30-0 (-> this focus-info my-facing-ry))) (s5-0 0) ) (cond ((or (>= 8192.0 (fabs f0-5)) (>= (fabs f0-5) 24576.0)) - (let ((s3-1 (zero? (get-rand-int obj 2))) + (let ((s3-1 (zero? (get-rand-int this 2))) (s4-0 (new 'stack-no-clear 'vector)) ) (countdown (s2-0 2) (cond (s3-1 - (when (ashelin-method-236 obj s4-0 (+ 16384.0 f30-0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s4-0 (-> obj root trans)) + (when (ashelin-method-236 this s4-0 (+ 16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) (set! s5-0 3) (goto cfg-20) ) ) (else - (when (ashelin-method-236 obj s4-0 (+ -16384.0 f30-0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s4-0 (-> obj root trans)) + (when (ashelin-method-236 this s4-0 (+ -16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) (set! s5-0 2) (goto cfg-20) ) @@ -574,8 +574,8 @@ ) (else (let ((s4-1 (new 'stack-no-clear 'vector))) - (when (ashelin-method-236 obj s4-1 (+ 32768.0 f30-0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s4-1 (-> obj root trans)) + (when (ashelin-method-236 this s4-1 (+ 32768.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-1 (-> this root trans)) (set! s5-0 1) ) ) @@ -585,24 +585,24 @@ ) ) -(defmethod ashelin-method-242 ashelin ((obj ashelin)) +(defmethod ashelin-method-242 ashelin ((this ashelin)) (let ((s5-0 0)) (cond - ((zero? (get-rand-int obj 2)) - (when (>= 16384.0 (fabs (-> obj focus-info ry-diff))) + ((zero? (get-rand-int this 2)) + (when (>= 16384.0 (fabs (-> this focus-info ry-diff))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (when (ashelin-method-236 obj s4-0 (+ 16384.0 (-> obj focus-info bullseye-ry)) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s4-0 (-> obj root trans)) + (when (ashelin-method-236 this s4-0 (+ 16384.0 (-> this focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) (set! s5-0 3) ) ) ) ) (else - (when (>= 16384.0 (fabs (-> obj focus-info ry-diff))) + (when (>= 16384.0 (fabs (-> this focus-info ry-diff))) (let ((s4-1 (new 'stack-no-clear 'vector))) - (when (ashelin-method-236 obj s4-1 (+ -16384.0 (-> obj focus-info bullseye-ry)) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s4-1 (-> obj root trans)) + (when (ashelin-method-236 this s4-1 (+ -16384.0 (-> this focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-1 (-> this root trans)) (set! s5-0 2) ) ) @@ -614,37 +614,37 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod ashelin-method-240 ashelin ((obj ashelin) (arg0 int)) +(defmethod ashelin-method-240 ashelin ((this ashelin) (arg0 int)) (case arg0 ((3) - (go (method-of-object obj cartwheel-left)) + (go (method-of-object this cartwheel-left)) ) ((2) - (go (method-of-object obj tumble-right)) + (go (method-of-object this tumble-right)) ) (else - (go (method-of-object obj back-spring)) + (go (method-of-object this back-spring)) ) ) (none) ) -(defmethod ashelin-method-247 ashelin ((obj ashelin)) +(defmethod ashelin-method-247 ashelin ((this ashelin)) (cond - ((logtest? (bot-flags bf20) (-> obj bot-flags)) - (set! (-> obj root trans w) 1.0) - (set! (-> obj focus-info bullseye w) 1.0) - (let ((f30-0 (vector4-dot (the-as vector (-> obj frontline)) (-> obj root trans)))) - (let ((f0-4 (vector4-dot (the-as vector (-> obj frontline)) (-> obj focus-info bullseye)))) + ((logtest? (bot-flags bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (set! (-> this focus-info bullseye w) 1.0) + (let ((f30-0 (vector4-dot (the-as vector (-> this frontline)) (-> this root trans)))) + (let ((f0-4 (vector4-dot (the-as vector (-> this frontline)) (-> this focus-info bullseye)))) (if (or (>= 0.0 f0-4) (>= -8192.0 f30-0)) (return #t) ) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> obj focus-info bullseye) (-> obj root trans)) + (vector-! s5-0 (-> this focus-info bullseye) (-> this root trans)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) - (if (>= -0.342 (vector-dot s5-0 (the-as vector (-> obj frontline)))) + (if (>= -0.342 (vector-dot s5-0 (the-as vector (-> this frontline)))) (return #t) ) (if (>= f30-0 0.0) @@ -653,10 +653,10 @@ (let ((a2-0 (new 'stack-no-clear 'vector)) (a0-8 (new 'stack-no-clear 'vector)) ) - (vector-float*! a2-0 (the-as vector (-> obj frontline)) (- (-> obj frontline w))) - (set! (-> a0-8 quad) (-> obj root trans quad)) + (vector-float*! a2-0 (the-as vector (-> this frontline)) (- (-> this frontline w))) + (set! (-> a0-8 quad) (-> this root trans quad)) (set! (-> a0-8 y) 0.0) - (>= (intersect-ray-plane a0-8 s5-0 a2-0 (-> obj frontline)) 8192.0) + (>= (intersect-ray-plane a0-8 s5-0 a2-0 (-> this frontline)) 8192.0) ) ) ) @@ -667,77 +667,77 @@ ) ) -(defmethod ashelin-method-248 ashelin ((obj ashelin)) - (when (logtest? (bot-flags bf20) (-> obj bot-flags)) - (set! (-> obj root trans w) 1.0) - (set! (-> obj focus-info bullseye w) 1.0) - (let ((f0-3 (vector4-dot (the-as vector (-> obj frontline)) (-> obj root trans))) - (f1-1 (vector4-dot (the-as vector (-> obj frontline)) (-> obj focus-info bullseye))) +(defmethod ashelin-method-248 ashelin ((this ashelin)) + (when (logtest? (bot-flags bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (set! (-> this focus-info bullseye w) 1.0) + (let ((f0-3 (vector4-dot (the-as vector (-> this frontline)) (-> this root trans))) + (f1-1 (vector4-dot (the-as vector (-> this frontline)) (-> this focus-info bullseye))) ) (when (and (< 0.0 f1-1) (< 0.0 f0-3)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> obj focus-info bullseye) (-> obj root trans)) + (vector-! s5-0 (-> this focus-info bullseye) (-> this root trans)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) - (>= (vector-dot s5-0 (the-as vector (-> obj frontline))) 0.0) + (>= (vector-dot s5-0 (the-as vector (-> this frontline))) 0.0) ) ) ) ) ) -(defmethod go-hostile ashelin ((obj ashelin)) - (bot-method-223 obj #t) +(defmethod go-hostile ashelin ((this ashelin)) + (bot-method-223 this #t) (cond - ((not (bot-method-214 obj)) - (react-to-focus obj) + ((not (bot-method-214 this)) + (react-to-focus this) ) - ((ashelin-method-238 obj #t #f) - (go (method-of-object obj standing-idle)) + ((ashelin-method-238 this #t #f) + (go (method-of-object this standing-idle)) ) - ((ashelin-method-247 obj) - (go (method-of-object obj chase)) + ((ashelin-method-247 this) + (go (method-of-object this chase)) ) (else - (go (method-of-object obj standing-idle)) + (go (method-of-object this standing-idle)) ) ) ) -(defmethod react-to-focus ashelin ((obj ashelin)) +(defmethod react-to-focus ashelin ((this ashelin)) "@TODO - flesh out docs" - (if (bot-method-214 obj) - (go-hostile obj) - (ashelin-method-239 obj) + (if (bot-method-214 this) + (go-hostile this) + (ashelin-method-239 this) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod ashelin-method-239 ashelin ((obj ashelin)) - (if (bot-method-214 obj) - (go (method-of-object obj standing-idle)) - (go (method-of-object obj waiting-idle)) +(defmethod ashelin-method-239 ashelin ((this ashelin)) + (if (bot-method-214 this) + (go (method-of-object this standing-idle)) + (go (method-of-object this waiting-idle)) ) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ashelin ((obj ashelin)) - (go (method-of-object obj hidden)) +(defmethod go-idle ashelin ((this ashelin)) + (go (method-of-object this hidden)) (none) ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fire-projectile ashelin ((obj ashelin) (arg0 vector)) - (set! (-> obj last-fire-time) (current-time)) - (+! (-> obj fired-gun-count) 1) +(defmethod fire-projectile ashelin ((this ashelin) (arg0 vector)) + (set-time! (-> this last-fire-time)) + (+! (-> this fired-gun-count) 1) (let ((s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> s4-0 ent) (-> obj entity)) + (set! (-> s4-0 ent) (-> this entity)) (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options account-for-target-velocity proj-options-8000)) - (set! (-> s4-0 notify-handle) (process->handle obj)) + (set! (-> s4-0 notify-handle) (process->handle this)) (set! (-> s4-0 owner-handle) (the-as handle #f)) - (set! (-> s4-0 ignore-handle) (process->handle obj)) + (set! (-> s4-0 ignore-handle) (process->handle this)) (let* ((v1-13 *game-info*) (a0-10 (+ (-> v1-13 attack-id) 1)) ) @@ -745,40 +745,40 @@ (set! (-> s4-0 attack-id) a0-10) ) (set! (-> s4-0 timeout) (seconds 4)) - (vector<-cspace! (-> s4-0 pos) (-> obj node-list data 22)) + (vector<-cspace! (-> s4-0 pos) (-> this node-list data 22)) (set! (-> s4-0 vel quad) (-> arg0 quad)) (vector-! (-> s4-0 vel) (-> s4-0 vel) (-> s4-0 pos)) (vector-normalize! (-> s4-0 vel) 307200.0) - (spawn-projectile ashelin-shot s4-0 obj *default-dead-pool*) + (spawn-projectile ashelin-shot s4-0 this *default-dead-pool*) ) (none) ) -(defmethod ashelin-method-249 ashelin ((obj ashelin)) +(defmethod ashelin-method-249 ashelin ((this ashelin)) (with-pp - (let* ((f30-0 (-> obj nav state speed)) + (let* ((f30-0 (-> this nav state speed)) (f0-1 (lerp-scale 0.0 2.0 f30-0 12288.0 40960.0)) - (f1-0 (-> obj travel-anim-interp)) - (v1-5 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (f1-0 (-> this travel-anim-interp)) + (v1-5 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-5 (= v1-5 (-> obj draw art-group data 5))) + ((and v1-5 (= v1-5 (-> this draw art-group data 5))) (let ((f28-0 f1-0) (f0-4 (seek f1-0 f0-1 (* 4.0 (seconds-per-frame)))) ) (cond - ((logtest? (bot-flags bf19) (-> obj bot-flags)) + ((logtest? (bot-flags bf19) (-> this bot-flags)) (if (< f0-4 1.0) (set! f0-4 (cond ((= f28-0 1.0) - (let ((v1-17 (-> obj skel root-channel 1))) + (let ((v1-17 (-> this skel root-channel 1))) (set! (-> v1-17 dist) 13107.2) - (set! (-> v1-17 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (set! (-> v1-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) ) - (logclear! (-> obj bot-flags) (bot-flags bf19)) + (logclear! (-> this bot-flags) (bot-flags bf19)) f0-4 ) (else @@ -792,11 +792,11 @@ (if (< 1.0 f0-4) (set! f0-4 (cond ((= f28-0 1.0) - (let ((v1-27 (-> obj skel root-channel 1))) + (let ((v1-27 (-> this skel root-channel 1))) (set! (-> v1-27 dist) 43690.68) - (set! (-> v1-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + (set! (-> v1-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) ) - (logior! (-> obj bot-flags) (bot-flags bf19)) + (logior! (-> this bot-flags) (bot-flags bf19)) f0-4 ) (else @@ -807,69 +807,69 @@ ) ) ) - (set! (-> obj travel-anim-interp) f0-4) - (let ((f0-7 (if (logtest? (bot-flags bf19) (-> obj bot-flags)) + (set! (-> this travel-anim-interp) f0-4) + (let ((f0-7 (if (logtest? (bot-flags bf19) (-> this bot-flags)) (+ -1.0 f0-4) (- 1.0 f0-4) ) ) - (v1-39 (-> obj skel root-channel 1)) + (v1-39 (-> this skel root-channel 1)) ) (set! (-> v1-39 frame-interp 1) f0-7) (set! (-> v1-39 frame-interp 0) f0-7) ) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-8 (quaternion-y-angle (-> obj root quat))) - (f1-10 (deg- f0-8 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-8 (quaternion-y-angle (-> this root quat))) + (f1-10 (deg- f0-8 (-> this travel-prev-ry))) (f0-11 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-10)))) (f0-14 (/ (* 16.0 (fmax f30-0 f0-11)) (* 15.0 f28-1))) - (a0-22 (-> obj skel root-channel 0)) + (a0-22 (-> this skel root-channel 0)) ) (set! (-> a0-22 param 0) f0-14) (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-23 (-> obj skel root-channel 1))) + (let ((a0-23 (-> this skel root-channel 1))) (set! (-> a0-23 param 0) 0.0) (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-chan) ) ) (else (let ((f30-1 (seek f1-0 f0-1 (* 4.0 (seconds-per-frame))))) - (set! (-> obj travel-anim-interp) f30-1) + (set! (-> this travel-anim-interp) f30-1) (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-26 (-> obj skel root-channel 0))) + (let ((a0-26 (-> this skel root-channel 0))) (set! (-> a0-26 dist) 26214.4) - (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> obj draw art-group data 5))) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) (set! (-> a0-26 param 0) 1.0) - (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> obj draw art-group data 5)) num-func-loop!) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-loop!) ) (cond ((< f30-1 1.0) (let ((f0-22 (- 1.0 f30-1)) - (a0-27 (-> obj skel root-channel 1)) + (a0-27 (-> this skel root-channel 1)) ) (set! (-> a0-27 frame-interp 1) f0-22) (set! (-> a0-27 frame-interp 0) f0-22) (set! (-> a0-27 dist) 13107.2) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-27 param 0) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-chan) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-chan) ) - (logclear! (-> obj bot-flags) (bot-flags bf19)) + (logclear! (-> this bot-flags) (bot-flags bf19)) ) (else (let ((f0-26 (+ -1.0 f30-1)) - (a0-29 (-> obj skel root-channel 1)) + (a0-29 (-> this skel root-channel 1)) ) (set! (-> a0-29 frame-interp 1) f0-26) (set! (-> a0-29 frame-interp 0) f0-26) (set! (-> a0-29 dist) 43690.68) - (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) (set! (-> a0-29 param 0) 0.0) - (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-chan) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> this draw art-group data 6)) num-func-chan) ) - (logior! (-> obj bot-flags) (bot-flags bf19)) + (logior! (-> this bot-flags) (bot-flags bf19)) ) ) ) @@ -880,17 +880,17 @@ ) ) -(defmethod enemy-method-51 ashelin ((obj ashelin)) +(defmethod enemy-method-51 ashelin ((this ashelin)) (local-vars (v1-36 art-element)) - (let ((f28-0 (quaternion-y-angle (-> obj root quat)))) - (case (-> obj incoming knocked-type) + (let ((f28-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (let ((a0-4 (handle->process (-> obj focus handle)))) + (let ((a0-4 (handle->process (-> this focus handle)))) (when a0-4 (get-trans (the-as process-focusable a0-4) 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root transv quad)) - (if (< (vector-dot (-> obj root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) (vector-negate-in-place! s5-0) @@ -904,9 +904,9 @@ (let ((s5-1 (new 'stack-no-clear 'vector))) 0.0 0.0 - (vector-z-quaternion! s5-1 (-> obj root quat)) + (vector-z-quaternion! s5-1 (-> this root quat)) (let ((f28-1 (atan (-> s5-1 x) (-> s5-1 z)))) - (enemy-method-50 obj s5-1) + (enemy-method-50 this s5-1) (let* ((f30-0 (atan (-> s5-1 x) (-> s5-1 z))) (f0-10 (deg- f30-0 f28-1)) ) @@ -917,42 +917,42 @@ ) (cond ((and (>= 8192.0 f0-10) (>= f0-10 -16384.0)) - (set! v1-36 (-> obj draw art-group data 10)) + (set! v1-36 (-> this draw art-group data 10)) ) ((>= f0-10 8192.0) - (set! v1-36 (-> obj draw art-group data 7)) + (set! v1-36 (-> this draw art-group data 7)) (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) ) - ((zero? (get-rand-int obj 3)) - (set! v1-36 (-> obj draw art-group data 10)) + ((zero? (get-rand-int this 3)) + (set! v1-36 (-> this draw art-group data 10)) ) (else - (set! v1-36 (-> obj draw art-group data 7)) + (set! v1-36 (-> this draw art-group data 7)) (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) ) ) ) ) ) - (set! (-> obj knocked-anim) (the-as art-joint-anim v1-36)) + (set! (-> this knocked-anim) (the-as art-joint-anim v1-36)) ) ) f28-0 ) ) -(defmethod enemy-method-77 ashelin ((obj ashelin) (arg0 (pointer float))) +(defmethod enemy-method-77 ashelin ((this ashelin) (arg0 (pointer float))) (local-vars (a2-0 int)) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let ((s5-1 (ash 1 (-> *ashelin-global-info* prev-blue-hit))) (s4-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (vector-z-quaternion! s4-0 (-> obj root quat)) + (vector-z-quaternion! s4-0 (-> this root quat)) (let ((f30-0 (atan (-> s4-0 x) (-> s4-0 z)))) - (enemy-method-50 obj s4-0) + (enemy-method-50 this s4-0) (let* ((f0-6 (atan (-> s4-0 x) (-> s4-0 z))) (f0-8 (fabs (deg- f0-6 f30-0))) ) @@ -963,28 +963,28 @@ ) ) ) - (let* ((v1-9 (enemy-method-120 obj 6 a2-0)) - (s5-2 (-> obj draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9))) + (let* ((v1-9 (enemy-method-120 this 6 a2-0)) + (s5-2 (-> this draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9))) ) (set! (-> *ashelin-global-info* prev-blue-hit) v1-9) - (let ((v1-12 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-12 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-12 (or (= v1-12 (-> obj draw art-group data 16)) - (= v1-12 (-> obj draw art-group data 17)) - (= v1-12 (-> obj draw art-group data 18)) - (= v1-12 (-> obj draw art-group data 22)) - (= v1-12 (-> obj draw art-group data 23)) - (= v1-12 (-> obj draw art-group data 24)) + (if (and v1-12 (or (= v1-12 (-> this draw art-group data 16)) + (= v1-12 (-> this draw art-group data 17)) + (= v1-12 (-> this draw art-group data 18)) + (= v1-12 (-> this draw art-group data 22)) + (= v1-12 (-> this draw art-group data 23)) + (= v1-12 (-> this draw art-group data 24)) ) ) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-38 (-> obj skel root-channel 0))) + (let ((a0-38 (-> this skel root-channel 0))) (set! (-> a0-38 frame-group) (the-as art-joint-anim s5-2)) (set! (-> a0-38 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) (set! (-> a0-38 param 1) 1.0) @@ -996,26 +996,26 @@ ) (else (ja-channel-push! 1 (seconds 0.03)) - (let ((a0-40 (-> obj skel root-channel 0))) - (set! (-> a0-40 frame-group) (-> obj knocked-anim)) - (set! (-> a0-40 param 0) (the float (+ (-> obj knocked-anim frames num-frames) -1))) + (let ((a0-40 (-> this skel root-channel 0))) + (set! (-> a0-40 frame-group) (-> this knocked-anim)) + (set! (-> a0-40 param 0) (the float (+ (-> this knocked-anim frames num-frames) -1))) (set! (-> a0-40 param 1) (-> arg0 0)) (set! (-> a0-40 frame-num) 0.0) - (joint-control-channel-group! a0-40 (-> obj knocked-anim) num-func-seek!) + (joint-control-channel-group! a0-40 (-> this knocked-anim) num-func-seek!) ) #t ) ) ) -(defmethod enemy-method-78 ashelin ((obj ashelin) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 ashelin ((this ashelin) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((v1-1 *ashelin-global-info*) - (s5-0 (-> obj draw art-group data (-> v1-1 blue-hit-land-anim (-> v1-1 prev-blue-hit)))) + (s5-0 (-> this draw art-group data (-> v1-1 blue-hit-land-anim (-> v1-1 prev-blue-hit)))) ) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-7 (-> obj skel root-channel 0))) + (let ((a0-7 (-> this skel root-channel 0))) (set! (-> a0-7 frame-group) (the-as art-joint-anim s5-0)) (set! (-> a0-7 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) (set! (-> a0-7 param 1) 1.0) @@ -1026,65 +1026,65 @@ #t ) (else - (let ((v1-15 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-15 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-15 (= v1-15 (-> obj draw art-group data 7))) + ((and v1-15 (= v1-15 (-> this draw art-group data 7))) (cond - ((or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) + ((or (zero? (-> this hit-points)) (nonzero? (-> this fated-time))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-14 (-> obj skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 9))) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 9))) (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 9)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 9)) frames num-frames) -1)) ) (set! (-> a0-14 param 1) 1.0) (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 9)) num-func-seek!) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 9)) num-func-seek!) ) #f ) (else (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-16 (-> obj skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (let ((a0-16 (-> this skel root-channel 0))) + (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> this draw art-group data 8))) (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 8)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 8)) frames num-frames) -1)) ) (set! (-> a0-16 param 1) 1.0) (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> obj draw art-group data 8)) num-func-seek!) + (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> this draw art-group data 8)) num-func-seek!) ) #t ) ) ) - ((and (or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) (nonzero? (get-rand-int obj 3))) + ((and (or (zero? (-> this hit-points)) (nonzero? (-> this fated-time))) (nonzero? (get-rand-int this 3))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-20 (-> obj skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (let ((a0-20 (-> this skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) ) (set! (-> a0-20 param 1) 1.0) (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) ) #f ) (else (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-22 (-> obj skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 11))) + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 11)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) ) (set! (-> a0-22 param 1) 1.0) (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 11)) num-func-seek!) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) ) #t ) @@ -1094,95 +1094,95 @@ ) ) -(defmethod enemy-method-79 ashelin ((obj ashelin) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ashelin ((this ashelin) (arg0 int) (arg1 enemy-knocked-info)) (cond ((= arg0 3) (let ((s5-0 (ja-done? 0))) (cond - ((and s5-0 (let ((v1-4 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((and s5-0 (let ((v1-4 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-4 (or (= v1-4 (-> obj draw art-group data 16)) - (= v1-4 (-> obj draw art-group data 17)) - (= v1-4 (-> obj draw art-group data 18)) - (= v1-4 (-> obj draw art-group data 22)) - (= v1-4 (-> obj draw art-group data 23)) - (= v1-4 (-> obj draw art-group data 24)) + (and v1-4 (or (= v1-4 (-> this draw art-group data 16)) + (= v1-4 (-> this draw art-group data 17)) + (= v1-4 (-> this draw art-group data 18)) + (= v1-4 (-> this draw art-group data 22)) + (= v1-4 (-> this draw art-group data 23)) + (= v1-4 (-> this draw art-group data 24)) ) ) ) ) (ja-channel-push! 1 (seconds 0.03)) - (let ((a0-21 (-> obj skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> obj draw art-group data 25))) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 25))) (set! (-> a0-21 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 25)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 25)) frames num-frames) -1)) ) (set! (-> a0-21 param 1) 1.0) (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> obj draw art-group data 25)) num-func-seek!) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 25)) num-func-seek!) ) (set! s5-0 #f) ) (else - (let ((v1-25 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-25 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-25 (= v1-25 (-> obj draw art-group data 8))) + ((and v1-25 (= v1-25 (-> this draw art-group data 8))) (let ((f0-4 (ja-aframe-num 0))) (cond ((>= f0-4 22.0) - (when (focus-test? obj dangerous) - (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj focus-status) (focus-status dangerous)) + (when (focus-test? this dangerous) + (if (logtest? (-> this enemy-flags) (enemy-flag check-water)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this focus-status) (focus-status dangerous)) ) ) ) ((>= f0-4 16.0) - (when (not (focus-test? obj dangerous)) - (logior! (-> obj focus-status) (focus-status dangerous)) + (when (not (focus-test? this dangerous)) + (logior! (-> this focus-status) (focus-status dangerous)) (let* ((v1-42 *game-info*) (a0-34 (+ (-> v1-42 attack-id) 1)) ) (set! (-> v1-42 attack-id) a0-34) - (set! (-> obj attack-id) a0-34) + (set! (-> this attack-id) a0-34) ) ) ) ) ) ) - ((let ((v1-45 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((let ((v1-45 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-45 (= v1-45 (-> obj draw art-group data 11))) + (and v1-45 (= v1-45 (-> this draw art-group data 11))) ) (let ((f0-5 (ja-aframe-num 0))) (cond ((>= f0-5 32.0) - (when (focus-test? obj dangerous) - (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj focus-status) (focus-status dangerous)) + (when (focus-test? this dangerous) + (if (logtest? (-> this enemy-flags) (enemy-flag check-water)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this focus-status) (focus-status dangerous)) ) ) ) ((>= f0-5 25.0) - (when (not (focus-test? obj dangerous)) - (logior! (-> obj focus-status) (focus-status dangerous)) + (when (not (focus-test? this dangerous)) + (logior! (-> this focus-status) (focus-status dangerous)) (let* ((v1-62 *game-info*) (a0-47 (+ (-> v1-62 attack-id) 1)) ) (set! (-> v1-62 attack-id) a0-47) - (set! (-> obj attack-id) a0-47) + (set! (-> this attack-id) a0-47) ) ) ) @@ -1191,7 +1191,7 @@ ) ) ) - (let ((a0-48 (-> obj skel root-channel 0))) + (let ((a0-48 (-> this skel root-channel 0))) (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group frames num-frames) -1))) (set! (-> a0-48 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-48 (the-as art-joint-anim #f) num-func-seek!) @@ -1202,12 +1202,12 @@ ) ) (else - ((method-of-type bot enemy-method-79) obj arg0 arg1) + ((method-of-type bot enemy-method-79) this arg0 arg1) ) ) ) -(defmethod ashelin-method-236 ashelin ((obj ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) +(defmethod ashelin-method-236 ashelin ((this ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) (local-vars (v1-23 float) (sv-272 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1215,7 +1215,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (let* ((v1-0 (-> obj nav)) + (let* ((v1-0 (-> this nav)) (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) (a1-1 (-> v1-0 sphere-id-array)) (a2-2 (-> v1-0 state mesh bounds)) @@ -1233,7 +1233,7 @@ ) 0 (let ((s0-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (vector-! (-> s0-0 current-pos) (-> obj root trans) (-> obj nav state mesh bounds)) + (vector-! (-> s0-0 current-pos) (-> this root trans) (-> this nav state mesh bounds)) (set! sv-272 (-> s0-0 travel)) (set! (-> sv-272 x) (sin arg1)) (set! (-> sv-272 y) 0.0) @@ -1241,13 +1241,13 @@ (set! (-> sv-272 w) 1.0) (vector-float*! (-> s0-0 travel) (-> s0-0 travel) arg3) (set! (-> s0-0 pref-dir quad) (-> s0-0 travel quad)) - (avoid-spheres-1! (-> obj nav) s0-0) + (avoid-spheres-1! (-> this nav) s0-0) (set! (-> arg0 quad) (-> s0-0 out-travel 0 quad)) ) 0 (when (>= arg2 (fabs (deg- arg1 (atan (-> arg0 x) (-> arg0 z))))) (let ((t0-2 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) - (clamp-vector-to-mesh-no-gaps (-> obj nav) (-> obj root trans) (-> obj nav state current-poly) arg0 t0-2) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) (-> this nav state current-poly) arg0 t0-2) ) (.lvf vf1 (&-> arg0 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -1265,144 +1265,150 @@ ) ) -(defmethod nav-enemy-method-142 ashelin ((obj ashelin) (arg0 nav-control)) - (if (not (and (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'back-spring) (= v1-3 'cartwheel-left) (= v1-3 'tumble-right)) - ) +(defmethod nav-enemy-method-142 ashelin ((this ashelin) (arg0 nav-control)) + (if (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'back-spring) (= v1-3 'cartwheel-left) (= v1-3 'tumble-right)) + ) ) ) - ((method-of-type bot nav-enemy-method-142) obj arg0) + ((method-of-type bot nav-enemy-method-142) this arg0) ) (none) ) -(defmethod bot-method-216 ashelin ((obj ashelin)) - (set! (-> obj health-handle) (ppointer->handle (process-spawn hud-ashelin :init hud-init-by-other :to obj))) +(defmethod bot-method-216 ashelin ((this ashelin)) + (set! (-> this health-handle) (ppointer->handle (process-spawn hud-ashelin :init hud-init-by-other :to this))) 0 (none) ) -(defmethod play-attacked-speech ashelin ((obj ashelin)) +(defmethod play-attacked-speech ashelin ((this ashelin)) (local-vars (v1-3 int) (a3-0 int)) - (when (not (channel-active? obj (the-as uint 0))) + (when (not (channel-active? this (the-as uint 0))) (let ((v1-2 0)) - (if (logtest? #x3c00000 (-> obj incoming penetrate-using)) + (if (logtest? #x3c00000 (-> this incoming penetrate-using)) (set! v1-3 (logior v1-2 128)) (set! v1-3 (logior v1-2 64)) ) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) (set! a3-0 (logior v1-3 256)) (set! a3-0 (logior v1-3 512)) ) (let ((a1-3 (bot-speech-list-method-9 - (-> obj ash-course attack-player-speeches) - obj - (-> obj ash-course speeches) + (-> this ash-course attack-player-speeches) + this + (-> this ash-course speeches) (the-as speech-flags a3-0) ) ) ) (if (>= a1-3 0) - (play-speech obj a1-3) + (play-speech this a1-3) ) ) ) (none) ) -(defmethod ashelin-method-244 ashelin ((obj ashelin)) - (when (not (channel-active? obj (the-as uint 0))) - (let ((a1-2 - (bot-speech-list-method-9 (-> obj ash-course ouch-speeches) obj (-> obj ash-course speeches) (speech-flags)) - ) +(defmethod ashelin-method-244 ashelin ((this ashelin)) + (when (not (channel-active? this (the-as uint 0))) + (let ((a1-2 (bot-speech-list-method-9 + (-> this ash-course ouch-speeches) + this + (-> this ash-course speeches) + (speech-flags) + ) + ) ) (if (>= a1-2 0) - (play-speech obj a1-2) + (play-speech this a1-2) ) ) ) (none) ) -(defmethod ashelin-method-245 ashelin ((obj ashelin)) - (when (and (not (channel-active? obj (the-as uint 0))) (>= (current-time) (-> obj victory-speech-time))) +(defmethod ashelin-method-245 ashelin ((this ashelin)) + (when (and (not (channel-active? this (the-as uint 0))) (>= (current-time) (-> this victory-speech-time))) (let ((s5-0 (bot-speech-list-method-9 - (-> obj ash-course victory-speeches) - obj - (-> obj ash-course speeches) + (-> this ash-course victory-speeches) + this + (-> this ash-course speeches) (speech-flags) ) ) ) (when (>= s5-0 0) - (set! (-> obj victory-speech-time) (the-as time-frame (+ (get-rand-int-range obj 1200 2100) (current-time)))) - (play-speech obj s5-0) + (set! (-> this victory-speech-time) + (the-as time-frame (+ (get-rand-int-range this 1200 2100) (current-time))) + ) + (play-speech this s5-0) ) ) ) (none) ) -(defmethod enemy-method-136 ashelin ((obj ashelin)) - (when (>= (- (current-time) (-> obj hit-focus-time)) (seconds 2)) - (let ((v0-0 (logclear (-> obj enemy-flags) (enemy-flag look-at-focus)))) - (set! (-> obj enemy-flags) v0-0) +(defmethod enemy-method-136 ashelin ((this ashelin)) + (when (time-elapsed? (-> this hit-focus-time) (seconds 2)) + (let ((v0-0 (logclear (-> this enemy-flags) (enemy-flag look-at-focus)))) + (set! (-> this enemy-flags) v0-0) v0-0 ) ) ) ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod play-speech ashelin ((obj ashelin) (arg0 int)) +(defmethod play-speech ashelin ((this ashelin) (arg0 int)) (let ((t9-0 (method-of-type bot play-speech))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-focus)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-focus)) (none) ) -(defmethod draw hud-ashelin ((obj hud-ashelin)) +(defmethod draw hud-ashelin ((this hud-ashelin)) (set-hud-piece-position! - (-> obj sprites 2) - (the int (+ 30.0 (* -130.0 (-> obj offset)))) - (the int (+ 30.0 (* -100.0 (-> obj offset)))) + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 8 2) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 8 2) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-ashelin ((obj hud-ashelin)) - (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-ashelin ((this hud-ashelin)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-ashelin ((obj hud-ashelin)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-ashelin ((this hud-ashelin)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 scale-x) 12.0) - (set! (-> obj sprites 0 scale-y) 11.2) - (set! (-> obj sprites 0 pos z) #xfffff2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 3 tex) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tex) (lookup-texture-by-name "hud-ashlyn-head" (the-as string #f) (the-as (pointer texture-page) #f)) ) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.4) - (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.4) + (set! (-> this sprites 3 pos z) #xffffff) 0 (none) ) diff --git a/goal_src/jak2/levels/common/ai/bot-h.gc b/goal_src/jak2/levels/common/ai/bot-h.gc index 3f7dc22b21..b0432a7862 100644 --- a/goal_src/jak2/levels/common/ai/bot-h.gc +++ b/goal_src/jak2/levels/common/ai/bot-h.gc @@ -588,11 +588,11 @@ ) -(defmethod reset-index bot-speech-list ((obj bot-speech-list) (arg0 symbol)) +(defmethod reset-index bot-speech-list ((this bot-speech-list) (arg0 symbol)) (if arg0 - (logand! (-> obj flags) -2) + (logand! (-> this flags) -2) ) - (set! (-> obj last-local-index) -1) + (set! (-> this last-local-index) -1) (none) ) @@ -654,70 +654,70 @@ ) -(defmethod reset-index bot-speech-list-shuffle ((obj bot-speech-list-shuffle) (arg0 symbol)) +(defmethod reset-index bot-speech-list-shuffle ((this bot-speech-list-shuffle) (arg0 symbol)) (let ((t9-0 (method-of-type bot-speech-list reset-index))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj history-mask) (the-as uint 0)) - (when (zero? (-> obj history-mask-full)) + (set! (-> this history-mask) (the-as uint 0)) + (when (zero? (-> this history-mask-full)) (let ((v0-2 0)) (let ((v1-2 1)) - (countdown (a0-3 (-> obj speech-indexes length)) + (countdown (a0-3 (-> this speech-indexes length)) (set! v0-2 (logior v0-2 v1-2)) (set! v1-2 (* v1-2 2)) ) ) - (set! (-> obj history-mask-full) (the-as uint v0-2)) + (set! (-> this history-mask-full) (the-as uint v0-2)) ) ) (none) ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod bot-speech-list-method-9 bot-speech-list-shuffle ((obj bot-speech-list-shuffle) (bot bot) (sp-info (inline-array bot-speech-info)) (sp-flags speech-flags)) +(defmethod bot-speech-list-method-9 bot-speech-list-shuffle ((this bot-speech-list-shuffle) (bot bot) (sp-info (inline-array bot-speech-info)) (sp-flags speech-flags)) (local-vars (sv-16 int)) (let ((course-cookie (-> bot course retry-cookie))) - (when (!= course-cookie (-> obj retry-cookie)) - (set! (-> obj retry-cookie) (-> bot course retry-cookie)) - (reset-index obj #t) + (when (!= course-cookie (-> this retry-cookie)) + (set! (-> this retry-cookie) (-> bot course retry-cookie)) + (reset-index this #t) ) ) - (set! sv-16 (-> obj last-local-index)) + (set! sv-16 (-> this last-local-index)) (when (< sv-16 0) - (when (not (logtest? (-> obj flags) 1)) - (logior! (-> obj flags) 1) + (when (not (logtest? (-> this flags) 1)) + (logior! (-> this flags) 1) (set! sp-flags (logior sp-flags (speech-flags sf02))) ) - (reset-index obj #f) + (reset-index this #f) ) (let ((history-mask 0)) (if (>= sv-16 0) (set! history-mask (ash 1 sv-16)) ) - (if (logtest? (-> obj flags) 8) - (set! history-mask (logior history-mask (-> obj history-mask))) + (if (logtest? (-> this flags) 8) + (set! history-mask (logior history-mask (-> this history-mask))) ) (until #f - (when (and (= history-mask (-> obj history-mask-full)) (logtest? (-> obj flags) 8)) - (if (not (logtest? (-> obj flags) 2)) + (when (and (= history-mask (-> this history-mask-full)) (logtest? (-> this flags) 8)) + (if (not (logtest? (-> this flags) 2)) (return -1) ) - (reset-index obj #f) + (reset-index this #f) (if (>= sv-16 0) (set! history-mask (ash 1 sv-16)) (set! history-mask 0) ) ) - (let* ((last-idx (enemy-method-120 bot (-> obj speech-indexes length) history-mask)) - (speech-idx (-> obj speech-indexes last-idx)) + (let* ((last-idx (enemy-method-120 bot (-> this speech-indexes length) history-mask)) + (speech-idx (-> this speech-indexes last-idx)) (v1-47 (-> sp-info speech-idx flags)) ) (set! history-mask (logior history-mask (ash 1 last-idx))) (when (and (not (logtest? sp-flags v1-47)) (or (not (logtest? v1-47 (speech-flags sf11))) (not (speech-playing? bot speech-idx))) ) - (set! (-> obj last-local-index) last-idx) - (logior! (-> obj history-mask) (ash 1 last-idx)) + (set! (-> this last-local-index) last-idx) + (logior! (-> this history-mask) (ash 1 last-idx)) (return speech-idx) ) ) diff --git a/goal_src/jak2/levels/common/ai/bot-states.gc b/goal_src/jak2/levels/common/ai/bot-states.gc index 3e2676b0c8..c70bfefe73 100644 --- a/goal_src/jak2/levels/common/ai/bot-states.gc +++ b/goal_src/jak2/levels/common/ai/bot-states.gc @@ -82,7 +82,7 @@ (bot-method-191 self) (when (zero? (-> self hit-points)) (set! (-> self hit-points) 1) - (set! (-> self fated-time) (current-time)) + (set-time! (-> self fated-time)) ) (logclear! (-> self bot-flags) (bot-flags bf11)) (let ((t9-2 (-> (method-of-type nav-enemy knocked) enter))) @@ -196,7 +196,7 @@ :trans (behavior () ((-> (method-of-type bot die-falling) trans)) (if (channel-active? self (the-as uint 0)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) :code (behavior () @@ -208,7 +208,7 @@ (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (when (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) (reset? *fail-mission-control*) ) (cleanup-for-death self) diff --git a/goal_src/jak2/levels/common/ai/bot.gc b/goal_src/jak2/levels/common/ai/bot.gc index 0de8ed6158..7bf9222cab 100644 --- a/goal_src/jak2/levels/common/ai/bot.gc +++ b/goal_src/jak2/levels/common/ai/bot.gc @@ -7,19 +7,19 @@ ;; DECOMP BEGINS -(defmethod run-logic? bot ((obj bot)) +(defmethod run-logic? bot ((this bot)) #t ) ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-sphere bot ((obj bot) (arg0 vector) (arg1 rgba)) +(defmethod bot-debug-draw-sphere bot ((this bot) (arg0 vector) (arg1 rgba)) (add-debug-sphere #t (bucket-id debug2) (the-as vector (&-> arg0 x)) (-> arg0 w) arg1) (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-spot-sphere bot ((obj bot) (arg0 int) (arg1 (pointer uint)) (arg2 int)) - (let* ((s2-0 (-> obj spot-color)) +(defmethod bot-debug-draw-spot-sphere bot ((this bot) (arg0 int) (arg1 (pointer uint)) (arg2 int)) + (let* ((s2-0 (-> this spot-color)) (s1-0 s2-0) ) (if (>= arg2 0) @@ -30,12 +30,12 @@ ) (dotimes (s0-0 arg0) (let* ((v1-5 (-> (the-as (pointer uint8) (&+ arg1 s0-0)))) - (a1-2 (-> obj course spots v1-5)) + (a1-2 (-> this course spots v1-5)) ) - (bot-debug-draw-sphere obj (the-as vector a1-2) (if (= v1-5 arg2) - (the-as rgba s2-0) - (the-as rgba s1-0) - ) + (bot-debug-draw-sphere this (the-as vector a1-2) (if (= v1-5 arg2) + (the-as rgba s2-0) + (the-as rgba s1-0) + ) ) ) ) @@ -44,11 +44,11 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-spot-id bot ((obj bot)) - (let ((course (-> obj course))) +(defmethod bot-debug-draw-spot-id bot ((this bot)) + (let ((course (-> this course))) (countdown (i (-> course spot-count)) (let ((spot (-> course spots i))) - (bot-debug-draw-sphere obj (the-as vector spot) (the-as rgba (-> obj spot-color))) + (bot-debug-draw-sphere this (the-as vector spot) (the-as rgba (-> this spot-color))) (format (clear *temp-string*) "~d" i) (let ((spot-id *temp-string*)) (add-debug-text-3d @@ -66,13 +66,13 @@ (none) ) -(defmethod outside-spot-radius? bot ((obj bot) (spot bot-spot) (bot-trans vector) (arg3 symbol)) +(defmethod outside-spot-radius? bot ((this bot) (spot bot-spot) (bot-trans vector) (arg3 symbol)) "Are we outside of the given [[bot-spot]] radius?" (if (not spot) - (set! spot (-> obj spot)) + (set! spot (-> this spot)) ) (if (not bot-trans) - (set! bot-trans (-> obj root trans)) + (set! bot-trans (-> this root trans)) ) (let ((f0-0 (vector-vector-xz-distance (-> spot center) bot-trans))) (if arg3 @@ -82,21 +82,21 @@ ) ) -(defmethod player-blocking-spot? bot ((obj bot) (spot bot-spot)) +(defmethod player-blocking-spot? bot ((this bot) (spot bot-spot)) (let ((f0-0 (-> spot blocked-xz-dist))) (and (!= f0-0 0.0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> spot center)))) ) ) -(defmethod choose-spot bot ((obj bot) (num-spots int) (spot-indices (pointer uint))) +(defmethod choose-spot bot ((this bot) (num-spots int) (spot-indices (pointer uint))) "Choose the closest [[bot-spot]] that is not blocked by the player." (let ((spot-idx 0)) (let ((f30-0 -1.0) - (bot-trans (-> obj root trans)) + (bot-trans (-> this root trans)) ) (countdown (i num-spots) - (let ((spot (-> obj course spots (-> (the-as (pointer uint8) (&+ spot-indices i)))))) - (when (not (player-blocking-spot? obj spot)) + (let ((spot (-> this course spots (-> (the-as (pointer uint8) (&+ spot-indices i)))))) + (when (not (player-blocking-spot? this spot)) (let ((spot-dist (vector-vector-xz-distance bot-trans (-> spot center)))) (when (or (< f30-0 0.0) (< spot-dist f30-0)) (set! f30-0 spot-dist) @@ -111,41 +111,41 @@ ) ) -(defmethod enemy-method-108 bot ((obj bot) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 bot ((this bot) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; WARN: Return type mismatch symbol vs none. -(defmethod reset-attacker! bot ((obj bot)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) - (let* ((s5-0 (handle->process (-> obj attacker-handle))) +(defmethod reset-attacker! bot ((this bot)) + (logclear! (-> this bot-flags) (bot-flags attacked)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-5 (if (type? s5-0 process-focusable) s5-0 ) ) ) (if (and v1-5 (= (-> v1-5 type) target)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (none) ) -(defmethod bot-method-193 bot ((obj bot)) +(defmethod bot-method-193 bot ((this bot)) (let ((gp-0 #f)) - (let ((v1-0 (-> obj incoming penetrate-using))) + (let ((v1-0 (-> this incoming penetrate-using))) (cond ((logtest? #x800000 v1-0) (when *target* (let ((s5-0 (new 'stack-no-clear 'vector)) (s3-0 (-> *target* gun fire-dir-out)) ) - (vector-! s5-0 (-> obj root trans) (target-pos 0)) + (vector-! s5-0 (-> this root trans) (target-pos 0)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) - (if (or (< 28672.0 (vector-vector-xz-distance (-> obj root trans) (target-pos 0))) + (if (or (< 28672.0 (vector-vector-xz-distance (-> this root trans) (target-pos 0))) (< (vector-dot s3-0 s5-0) (cos 3640.889)) ) (set! gp-0 #t) @@ -162,19 +162,19 @@ ) ) -(defmethod bot-method-190 bot ((obj bot)) +(defmethod bot-method-190 bot ((this bot)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) (cond - ((< 0.0 (-> obj notice-enemy-dist)) + ((< 0.0 (-> this notice-enemy-dist)) (let ((s5-0 (new 'stack-no-clear 'connection-pers)) (s4-0 544) ) - (set! (-> (the-as sphere (-> s5-0 param)) quad) (-> obj root trans quad)) - (set! (-> s5-0 param 3) (-> obj notice-enemy-dist)) + (set! (-> (the-as sphere (-> s5-0 param)) quad) (-> this root trans quad)) + (set! (-> s5-0 param 3) (-> this notice-enemy-dist)) (set! (-> s5-0 next) #f) (set! (-> s5-0 key) 409600000.0) (set! (-> s5-0 update-time) 0) @@ -276,7 +276,7 @@ ) ) (when a1-26 - (set-next-focus! obj (the-as enemy a1-26) (the-as enemy-best-focus (&-> s5-0 next))) + (set-next-focus! this (the-as enemy a1-26) (the-as enemy-best-focus (&-> s5-0 next))) (if (-> s5-0 next) (return #t) ) @@ -295,12 +295,12 @@ ) ) -(defmethod enemy-method-106 bot ((obj bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 bot ((this bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) - (t9-0 obj arg0 arg1 arg2 arg3) + (t9-0 this arg0 arg1 arg2 arg3) ) - (logclear! (-> obj bot-flags) (bot-flags bf03 bf04)) - (let* ((s3-0 (handle->process (-> obj incoming attacker-handle))) + (logclear! (-> this bot-flags) (bot-flags bf03 bf04)) + (let* ((s3-0 (handle->process (-> this incoming attacker-handle))) (s5-0 (if (type? s3-0 process-focusable) s3-0 ) @@ -309,22 +309,22 @@ (when s5-0 (cond ((= (-> s5-0 type) target) - (logior! (-> obj bot-flags) (bot-flags bf04)) + (logior! (-> this bot-flags) (bot-flags bf04)) (cond - ((bot-method-193 obj) - (logior! (-> obj bot-flags) (bot-flags bf03)) + ((bot-method-193 this) + (logior! (-> this bot-flags) (bot-flags bf03)) ) (else - (+! (-> obj hit-by-player-count) 1) - (when (not (bot-method-190 obj)) - (logior! (-> obj bot-flags) (bot-flags attacked)) + (+! (-> this hit-by-player-count) 1) + (when (not (bot-method-190 this)) + (logior! (-> this bot-flags) (bot-flags attacked)) (cond - ((attacked-by-player? obj (the-as process-focusable s5-0)) - (set! (-> obj attacker-handle) (process->handle s5-0)) - (set! (-> obj attacker-time) (current-time)) + ((attacked-by-player? this (the-as process-focusable s5-0)) + (set! (-> this attacker-handle) (process->handle s5-0)) + (set-time! (-> this attacker-time)) ) (else - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) ) @@ -332,13 +332,13 @@ ) ) ((type? s5-0 enemy) - (+! (-> obj hit-by-enemy-count) 1) - (when (attacked-by-player? obj (the-as process-focusable s5-0)) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (+! (-> this hit-by-enemy-count) 1) + (when (attacked-by-player? this (the-as process-focusable s5-0)) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) - (set! (-> obj attacker-handle) (process->handle s5-0)) - (set! (-> obj attacker-time) (current-time)) + (set! (-> this attacker-handle) (process->handle s5-0)) + (set-time! (-> this attacker-time)) ) ) ) @@ -347,21 +347,23 @@ (none) ) -(defmethod damage-amount-from-attack bot ((obj bot) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack bot ((this bot) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (let ((v1-1 (-> obj bot-flags))) + (let ((v1-1 (-> this bot-flags))) (cond ((logtest? v1-1 (bot-flags bf03 too-far-fail bf09)) (set! v0-0 0) ) ((logtest? v1-1 (bot-flags bf10)) - (set! v0-0 (-> obj hit-points)) + (set! v0-0 (-> this hit-points)) ) (else - (if (and (logtest? (-> obj bot-flags) (bot-flags bf04)) (not (logtest? (-> obj bot-flags) (bot-flags attacked)))) + (if (and (logtest? (-> this bot-flags) (bot-flags bf04)) + (not (logtest? (-> this bot-flags) (bot-flags attacked))) + ) (set! v0-0 0) ) ) @@ -371,34 +373,34 @@ ) ) -(defmethod enemy-method-58 bot ((obj bot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 bot ((this bot) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (if (logtest? (-> obj bot-flags) (bot-flags bf03)) + (if (logtest? (-> this bot-flags) (bot-flags bf03)) (set! v0-0 #f) ) v0-0 ) ) -(defmethod clear-poi-and-focus! bot ((obj bot)) +(defmethod clear-poi-and-focus! bot ((this bot)) "Clear our point of interest and focus handles." - (let* ((s4-0 (handle->process (-> obj poi-handle))) + (let* ((s4-0 (handle->process (-> this poi-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) ) (when s5-0 - (set! (-> obj poi-handle) (the-as handle #f)) - (let ((s4-1 (handle->process (-> obj focus handle)))) + (set! (-> this poi-handle) (the-as handle #f)) + (let ((s4-1 (handle->process (-> this focus handle)))) (if (= (if (type? s4-1 process-focusable) s4-1 ) s5-0 ) - (clear-focused (-> obj focus)) + (clear-focused (-> this focus)) ) ) ) @@ -407,63 +409,63 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod attacked-by-player? bot ((obj bot) (fproc process-focusable)) +(defmethod attacked-by-player? bot ((this bot) (fproc process-focusable)) "Were we attacked by the player?" (the-as symbol (and (and fproc (not (logtest? (-> fproc focus-status) (focus-status disable dead ignore grabbed)))) (or (logtest? (process-mask enemy) (-> fproc mask)) - (and (logtest? (-> fproc mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked))) + (and (logtest? (-> fproc mask) (process-mask target)) (logtest? (-> this bot-flags) (bot-flags attacked))) ) ) ) ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! bot ((obj bot) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! bot ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" (the-as enemy-aware 3) ) -(defmethod enemy-method-61 bot ((obj bot) (arg0 int)) +(defmethod enemy-method-61 bot ((this bot) (arg0 int)) 3 ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-129 bot ((obj bot)) +(defmethod enemy-method-129 bot ((this bot)) (local-vars (s5-1 process)) - (let ((s5-0 (-> obj focus))) + (let ((s5-0 (-> this focus))) (cond - ((logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags)) + ((logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags)) (set! s5-1 (handle->process (-> s5-0 handle))) ) (else - (enemy-method-97 obj) + (enemy-method-97 this) (set! s5-1 (handle->process (-> s5-0 handle))) ) ) ) (let ((s4-0 #f)) - (when (or (logtest? (bot-flags bf18) (-> obj bot-flags)) - (and s5-1 (attacked-by-player? obj (the-as process-focusable s5-1))) + (when (or (logtest? (bot-flags bf18) (-> this bot-flags)) + (and s5-1 (attacked-by-player? this (the-as process-focusable s5-1))) ) - (set! (-> obj danger-time) (current-time)) + (set-time! (-> this danger-time)) (set! s4-0 #t) ) - (when (nonzero? (-> obj swivel-joint-mod)) - (if (and s4-0 s5-1 (logtest? (-> obj bot-flags) (bot-flags bf11))) - (bot-method-222 obj (get-trans (the-as process-focusable s5-1) 3)) - (bot-method-221 obj) + (when (nonzero? (-> this swivel-joint-mod)) + (if (and s4-0 s5-1 (logtest? (-> this bot-flags) (bot-flags bf11))) + (bot-method-222 this (get-trans (the-as process-focusable s5-1) 3)) + (bot-method-221 this) ) ) ) (none) ) -(defmethod enemy-method-97 bot ((obj bot)) - (let* ((s5-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 bot ((this bot)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 ) @@ -472,25 +474,25 @@ (when v1-3 (cond ((= (-> v1-3 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 1.5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! v1-3 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 6)) + (when (time-elapsed? (-> this attacker-time) (seconds 6)) (set! v1-3 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) - (let ((a0-21 (-> obj focus-mode)) + (let ((a0-21 (-> this focus-mode)) (s5-1 (the-as process #f)) ) (cond @@ -499,11 +501,11 @@ (v1-3 (set! s5-1 v1-3) ) - ((begin (set! s5-1 (select-focus! obj)) s5-1) + ((begin (set! s5-1 (select-focus! this)) s5-1) (empty) ) (else - (let ((s4-0 (handle->process (-> obj poi-handle)))) + (let ((s4-0 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-0 process-focusable) s4-0 ) @@ -522,7 +524,7 @@ (set! s5-1 v1-3) ) (else - (let ((s4-1 (handle->process (-> obj poi-handle)))) + (let ((s4-1 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-1 process-focusable) s4-1 ) @@ -532,7 +534,7 @@ (s5-1 (empty) ) - ((begin (set! s5-1 (select-focus! obj)) s5-1) + ((begin (set! s5-1 (select-focus! this)) s5-1) (empty) ) (else @@ -545,14 +547,16 @@ ) (cond (s5-1 - (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> (the-as process-focusable s5-1) type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) + (!= (-> (the-as process-focusable s5-1) type) target) + ) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s5-1 @@ -560,7 +564,7 @@ ) ) -(defmethod select-focus! bot ((obj bot)) +(defmethod select-focus! bot ((this bot)) "Find enemies around our `notice-enemy-dist` and choose a target." (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) @@ -571,14 +575,14 @@ (focus (new 'stack-no-clear 'enemy-best-focus)) ) (let ((sphere (new 'stack-no-clear 'sphere)) - (enemy-dist (-> obj notice-enemy-dist)) + (enemy-dist (-> this notice-enemy-dist)) ) (set! (-> focus proc) #f) (set! (-> focus rating) 409600000.0) (set! (-> focus aware) (enemy-aware enemy-aware-0)) (when (< 0.0 enemy-dist) - (set! (-> sphere quad) (-> obj root trans quad)) - (set! (-> sphere r) (-> obj notice-enemy-dist)) + (set! (-> sphere quad) (-> this root trans quad)) + (set! (-> sphere r) (-> this notice-enemy-dist)) (set! *actor-list-length* 0) (if (logtest? (the-as int coll-spec) (collide-spec hit-by-others-list)) (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* sphere *actor-list* 256)) @@ -678,7 +682,7 @@ enemy (not (logtest? (-> (the-as process-focusable enemy) focus-status) (focus-status disable dead))) ) - (set-next-focus! obj (the-as enemy enemy) focus) + (set-next-focus! this (the-as enemy enemy) focus) ) ) ) @@ -692,11 +696,14 @@ ) ;; WARN: Return type mismatch enemy vs none. -(defmethod set-next-focus! bot ((obj bot) (enemy enemy) (arg2 enemy-best-focus)) +(defmethod set-next-focus! bot ((this bot) (enemy enemy) (arg2 enemy-best-focus)) (let ((enemy-dist (new 'stack-no-clear 'vector))) - (vector-! enemy-dist (-> enemy root trans) (-> obj root trans)) + (vector-! enemy-dist (-> enemy root trans) (-> this root trans)) (let ((rating (vector-length enemy-dist))) - (when (and (>= (-> obj notice-enemy-dist) rating) (< rating (-> arg2 rating)) (>= 24576.0 (fabs (-> enemy-dist y)))) + (when (and (>= (-> this notice-enemy-dist) rating) + (< rating (-> arg2 rating)) + (>= 24576.0 (fabs (-> enemy-dist y))) + ) (set! (-> arg2 rating) rating) (set! (-> arg2 proc) enemy) ) @@ -705,12 +712,12 @@ (none) ) -(defmethod alive? bot ((obj bot)) - (and (not (focus-test? obj dead grabbed)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) +(defmethod alive? bot ((this bot)) + (and (not (focus-test? this dead grabbed)) (nonzero? (-> this hit-points)) (zero? (-> this fated-time))) ) ;; WARN: disable def twice: 280. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler bot ((obj bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler bot ((this bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v0-0 object)) @@ -724,43 +731,43 @@ (('query) (case (-> arg3 param 0) (('waypoint) - (-> obj waypoint waypoint-id) + (-> this waypoint waypoint-id) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('request) (case (-> arg3 param 0) (('waypoint) - (set! (-> obj waypoint-request) (the-as int (-> arg3 param 1))) + (set! (-> this waypoint-request) (the-as int (-> arg3 param 1))) #t ) (('health-meter) (cond ((-> arg3 param 1) - (set! v0-0 (logior (-> obj bot-flags) (bot-flags bf06))) - (set! (-> obj bot-flags) (the-as bot-flags v0-0)) + (set! v0-0 (logior (-> this bot-flags) (bot-flags bf06))) + (set! (-> this bot-flags) (the-as bot-flags v0-0)) ) (else - (set! v0-0 (logclear (-> obj bot-flags) (bot-flags bf06))) - (set! (-> obj bot-flags) (the-as bot-flags v0-0)) + (set! v0-0 (logclear (-> this bot-flags) (bot-flags bf06))) + (set! (-> this bot-flags) (the-as bot-flags v0-0)) ) ) v0-0 ) (('too-far-fail) - (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail bf09))) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (go (method-of-object obj failed)) + (when (not (logtest? (-> this bot-flags) (bot-flags too-far-fail bf09))) + (logior! (-> this bot-flags) (bot-flags bf09)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag check-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (go (method-of-object this failed)) ) ) (('move-to-vehicle) @@ -769,25 +776,25 @@ ((>= (the-as int a0-19) 0) (let ((v1-29 (the-as object (-> arg3 param 1)))) (cond - ((focus-test? obj pilot) - (if (= (-> obj vehicle-seat-index) a0-19) - (= (the-as uint v1-29) (handle->process (-> obj vehicle-handle))) + ((focus-test? this pilot) + (if (= (-> this vehicle-seat-index) a0-19) + (= (the-as uint v1-29) (handle->process (-> this vehicle-handle))) ) ) (else - (set! (-> obj vehicle-seat-index) (the-as int a0-19)) - (set! (-> obj vehicle-handle) (process->handle (the-as uint v1-29))) - (logior! (-> obj bot-flags) (bot-flags bf15)) + (set! (-> this vehicle-seat-index) (the-as int a0-19)) + (set! (-> this vehicle-handle) (process->handle (the-as uint v1-29))) + (logior! (-> this bot-flags) (bot-flags bf15)) #t ) ) ) ) (else - (when (not (focus-test? obj pilot)) - (set! (-> obj vehicle-seat-index) -1) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (logclear! (-> obj bot-flags) (bot-flags bf15)) + (when (not (focus-test? this pilot)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this vehicle-handle) (the-as handle #f)) + (logclear! (-> this bot-flags) (bot-flags bf15)) #t ) ) @@ -795,20 +802,20 @@ ) ) (('exit-vehicle) - (when (focus-test? obj pilot) + (when (focus-test? this pilot) (let ((v1-43 (-> arg3 param 1)) (s5-1 (-> arg3 param 2)) ) (cond (v1-43 - (logior! (-> obj bot-flags) (bot-flags bf16)) - (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> obj nav-mesh-index))) - (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor (the-as int s5-1)) obj) - (set! (-> obj nav-mesh-index) (the-as int s5-1)) + (logior! (-> this bot-flags) (bot-flags bf16)) + (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> this nav-mesh-index))) + (change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor (the-as int s5-1)) this) + (set! (-> this nav-mesh-index) (the-as int s5-1)) ) ) (else - (logclear! (-> obj bot-flags) (bot-flags bf16)) + (logclear! (-> this bot-flags) (bot-flags bf16)) ) ) ) @@ -816,11 +823,11 @@ ) ) (('slave-id) - (set! (-> obj slave-id) (the-as int (-> arg3 param 1))) + (set! (-> this slave-id) (the-as int (-> arg3 param 1))) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -831,64 +838,64 @@ (when (if (type? s5-2 process-focusable) s5-2 ) - (logior! (-> obj enemy-flags) (enemy-flag look-at-focus)) - (set! (-> obj hit-focus-time) (current-time)) + (logior! (-> this enemy-flags) (enemy-flag look-at-focus)) + (set-time! (-> this hit-focus-time)) ) ) #t ) (('mission-failed) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (logclear! (-> obj bot-flags) (bot-flags bf06)) + (logior! (-> this bot-flags) (bot-flags bf09)) + (logclear! (-> this bot-flags) (bot-flags bf06)) #t ) (('follow-dir) - (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (set! (-> this follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('set-task) (let ((a1-11 (/ (the-as int (-> arg3 param 0)) 8))) - (logior! (-> obj bot-task-bits) (ash 1 a1-11)) + (logior! (-> this bot-task-bits) (ash 1 a1-11)) ) #t ) (('clear-task) (let ((a1-13 (/ (the-as int (-> arg3 param 0)) 8))) - (logclear! (-> obj bot-task-bits) (ash 1 a1-13)) + (logclear! (-> this bot-task-bits) (ash 1 a1-13)) ) #t ) (('skip) - (skip-waypoint obj) + (skip-waypoint this) ) (('change-mode) (when (= (-> arg3 param 0) 'grab) - (set! v0-0 (alive? obj)) + (set! v0-0 (alive? this)) (if (and (the-as symbol v0-0) (-> arg3 param 1)) - (logior! (-> obj focus-status) (focus-status grabbed)) + (logior! (-> this focus-status) (focus-status grabbed)) ) v0-0 ) ) (('end-mode) - (when (focus-test? obj grabbed) - (logclear! (-> obj focus-status) (focus-status grabbed)) + (when (focus-test? this grabbed) + (logclear! (-> this focus-status) (focus-status grabbed)) #t ) ) (('hide) (cond ((-> arg3 param 0) - (go (method-of-object obj hidden)) + (go (method-of-object this hidden)) ) (else - (if (and (-> obj next-state) (= (-> obj next-state name) 'hidden)) - (react-to-focus obj) + (if (and (-> this next-state) (= (-> this next-state name) 'hidden)) + (react-to-focus this) ) ) ) @@ -896,45 +903,45 @@ (('draw) (cond ((-> arg3 param 0) - (set! v0-0 (logclear (-> obj draw status) (draw-control-status no-draw))) - (set! (-> obj draw status) (the-as draw-control-status v0-0)) + (set! v0-0 (logclear (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) ) (else - (set! v0-0 (logior (-> obj draw status) (draw-control-status no-draw))) - (set! (-> obj draw status) (the-as draw-control-status v0-0)) + (set! v0-0 (logior (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) ) ) v0-0 ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod enemy-method-104 bot ((obj bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 bot ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (cond - ((and (= (-> arg0 type) target) (not (logtest? (-> obj bot-flags) (bot-flags attacked)))) + ((and (= (-> arg0 type) target) (not (logtest? (-> this bot-flags) (bot-flags attacked)))) (when (send-event arg0 'shove #f (static-attack-info ((id (new-attack-id)) (shove-back (meters 2)) (shove-up (meters 1.5)))) ) - (set! (-> obj root penetrated-by) (the-as penetrate -1)) - (enemy-method-49 obj) + (set! (-> this root penetrated-by) (the-as penetrate -1)) + (enemy-method-49 this) #t ) ) (else (when (send-event arg0 'attack arg1 (static-attack-info ((id arg2) - (shove-back (-> obj enemy-info attack-shove-back)) - (shove-up (-> obj enemy-info attack-shove-up)) - (mode (-> obj enemy-info attack-mode)) + (shove-back (-> this enemy-info attack-shove-back)) + (shove-up (-> this enemy-info attack-shove-up)) + (mode (-> this enemy-info attack-mode)) ) ) ) - (enemy-method-105 obj arg0) + (enemy-method-105 this arg0) #t ) ) @@ -942,15 +949,15 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 bot ((obj bot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 bot ((this bot) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond - ((and (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'knocked) (= v1-3 'jump)) - ) + ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) ) - ((method-of-type nav-enemy enemy-method-76) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-76) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -962,30 +969,30 @@ ) ) (cond - ((and (focus-test? obj dangerous) + ((and (focus-test? this dangerous) (logtest? (process-mask enemy) (-> arg0 mask)) (and v1-6 (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) ) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry touch-entry) - (-> obj root) + (-> this root) (collide-action deadly) (collide-action) ) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry touch-entry) - (-> obj root) + (-> this root) (collide-action persistent-attack) (collide-action) ) - (-> obj persistent-attack-id) - (-> obj attack-id) + (-> this persistent-attack-id) + (-> this attack-id) ) ) ) - (enemy-method-104 obj arg0 (the-as touching-shapes-entry touch-entry) a3-2) + (enemy-method-104 this arg0 (the-as touching-shapes-entry touch-entry) a3-2) ) ) (else @@ -1015,14 +1022,18 @@ ) ) -(defmethod play-too-far-warn-speech bot ((obj bot)) - (when (not (channel-active? obj (the-as uint 0))) - (let ((idx - (bot-speech-list-method-9 (-> obj course too-far-warn-speeches) obj (-> obj course speeches) (speech-flags)) - ) +(defmethod play-too-far-warn-speech bot ((this bot)) + (when (not (channel-active? this (the-as uint 0))) + (let ((idx (bot-speech-list-method-9 + (-> this course too-far-warn-speeches) + this + (-> this course speeches) + (speech-flags) + ) + ) ) (when (>= idx 0) - (play-speech obj idx) + (play-speech this idx) #t ) ) @@ -1035,46 +1046,46 @@ ) ;; WARN: Using new Jak 2 rtype-of -(defmethod bot-check-too-far bot ((obj bot)) +(defmethod bot-check-too-far bot ((this bot)) "Call the current [[bot-waypoint]]'s `check-too-far` function if available, otherwise use the default `course` one. If the player is too far, play a warning speech." (let ((result 0)) - (let ((too-far-check (-> obj delay-too-far-check))) + (let ((too-far-check (-> this delay-too-far-check))) (cond ((> too-far-check 0) - (set! (-> obj delay-too-far-check) (+ too-far-check -1)) + (set! (-> this delay-too-far-check) (+ too-far-check -1)) ) - ((and (zero? too-far-check) *target* (not (logtest? (-> obj focus-status) (focus-status grabbed)))) - (let ((check-too-far-func (the-as object (-> obj waypoint check-too-far)))) + ((and (zero? too-far-check) *target* (not (logtest? (-> this focus-status) (focus-status grabbed)))) + (let ((check-too-far-func (the-as object (-> this waypoint check-too-far)))) (if (not (the-as symbol check-too-far-func)) - (set! check-too-far-func (-> obj course default-check-too-far)) + (set! check-too-far-func (-> this course default-check-too-far)) ) (when (the-as symbol check-too-far-func) (cond ((logtest? (the-as int check-too-far-func) 1) - (set! result ((the-as (function bot int) (-> (the-as symbol check-too-far-func) value)) obj)) + (set! result ((the-as (function bot int) (-> (the-as symbol check-too-far-func) value)) this)) ) ((= (rtype-of (the-as symbol check-too-far-func)) function) - (set! result ((the-as (function bot int) check-too-far-func) obj)) + (set! result ((the-as (function bot int) check-too-far-func) this)) ) ) ) ) (if (and (= result 1) - (nonzero? (-> obj started-warning-time)) - (>= (- (current-time) (-> obj started-warning-time)) (the-as time-frame (-> obj warn-to-fail-timeout))) + (nonzero? (-> this started-warning-time)) + (time-elapsed? (-> this started-warning-time) (the-as time-frame (-> this warn-to-fail-timeout))) ) (set! result 2) ) (case result ((1) - (if (zero? (-> obj started-warning-time)) - (set! (-> obj started-warning-time) (current-time)) + (if (zero? (-> this started-warning-time)) + (set-time! (-> this started-warning-time)) ) - (if (and (>= (current-time) (-> obj next-too-far-warn-time)) (play-too-far-warn-speech obj)) - (set! (-> obj next-too-far-warn-time) + (if (and (>= (current-time) (-> this next-too-far-warn-time)) (play-too-far-warn-speech this)) + (set! (-> this next-too-far-warn-time) (+ (current-time) - (get-rand-int-range obj (the-as int (-> obj warn-min-delay)) (the-as int (-> obj warn-max-delay))) + (get-rand-int-range this (the-as int (-> this warn-min-delay)) (the-as int (-> this warn-max-delay))) ) ) ) @@ -1084,7 +1095,7 @@ If the player is too far, play a warning speech." ) ) (when (zero? result) - (set! (-> obj started-warning-time) 0) + (set! (-> this started-warning-time) 0) 0 ) (= result 2) @@ -1092,100 +1103,100 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod reset-warn-time! bot ((obj bot)) - (set! (-> obj started-warning-time) 0) - (set! (-> obj next-too-far-warn-time) +(defmethod reset-warn-time! bot ((this bot)) + (set! (-> this started-warning-time) 0) + (set! (-> this next-too-far-warn-time) (+ (current-time) - (get-rand-int-range obj (the-as int (-> obj warn-min-delay)) (the-as int (-> obj warn-max-delay))) + (get-rand-int-range this (the-as int (-> this warn-min-delay)) (the-as int (-> this warn-max-delay))) ) ) (none) ) -(defmethod track-target! bot ((obj bot)) +(defmethod track-target! bot ((this bot)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (set! (-> obj travel-prev-ry) (-> obj travel-prev-ry1)) - (set! (-> obj travel-prev-ry1) (quaternion-y-angle (-> obj root quat))) - (let ((f0-4 (/ (the float (-> obj hit-points)) (the float (-> obj enemy-info default-hit-points))))) - (if (nonzero? (-> obj fated-time)) + (set! (-> this travel-prev-ry) (-> this travel-prev-ry1)) + (set! (-> this travel-prev-ry1) (quaternion-y-angle (-> this root quat))) + (let ((f0-4 (/ (the float (-> this hit-points)) (the float (-> this enemy-info default-hit-points))))) + (if (nonzero? (-> this fated-time)) (set! f0-4 0.0) ) - (set! (-> *game-info* bot-health (-> obj bot-health-index)) f0-4) + (set! (-> *game-info* bot-health (-> this bot-health-index)) f0-4) ) (cond - ((logtest? (-> obj bot-flags) (bot-flags bf06)) - (if (and (not (handle->process (-> obj health-handle))) *target*) - (bot-method-216 obj) + ((logtest? (-> this bot-flags) (bot-flags bf06)) + (if (and (not (handle->process (-> this health-handle))) *target*) + (bot-method-216 this) ) ) (else - (send-event (handle->process (-> obj health-handle)) 'hide-and-die) + (send-event (handle->process (-> this health-handle)) 'hide-and-die) ) ) - (let ((a0-13 obj)) + (let ((a0-13 this)) (when (not (logtest? (enemy-flag enemy-flag36) (-> a0-13 enemy-flags))) (let ((a1-4 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-4 options) (overlaps-others-options)) (set! (-> a1-4 collide-with-filter) (the-as collide-spec -1)) (set! (-> a1-4 tlist) *touching-list*) - (find-overlapping-shapes (-> obj root) a1-4) + (find-overlapping-shapes (-> this root) a1-4) ) ) ) (let ((t9-4 (method-of-type nav-enemy track-target!))) - (t9-4 obj) + (t9-4 this) ) - (when (not (logtest? (-> obj bot-flags) (bot-flags bf09))) - (let ((t9-5 (-> obj waypoint on-update))) + (when (not (logtest? (-> this bot-flags) (bot-flags bf09))) + (let ((t9-5 (-> this waypoint on-update))) (if t9-5 - (t9-5 obj) + (t9-5 this) ) ) ) - (if (and (bot-check-too-far obj) (not (logtest? (-> obj bot-flags) (bot-flags bf09)))) - (go (method-of-object obj failed)) + (if (and (bot-check-too-far this) (not (logtest? (-> this bot-flags) (bot-flags bf09)))) + (go (method-of-object this failed)) ) - (if (not (logtest? (-> obj bot-flags) (bot-flags bf09))) - (ai-task-control-method-10 (-> obj ai-ctrl) obj) + (if (not (logtest? (-> this bot-flags) (bot-flags bf09))) + (ai-task-control-method-10 (-> this ai-ctrl) this) ) - (if (logtest? (-> obj bot-flags) (bot-flags bf02)) - (bot-method-192 obj) + (if (logtest? (-> this bot-flags) (bot-flags bf02)) + (bot-method-192 this) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc08)) - (bot-debug-draw-spot-id obj) + (bot-debug-draw-spot-id this) ) (none) ) -(defmethod scene-play bot ((obj bot) (scene string) (grab? symbol)) +(defmethod scene-play bot ((this bot) (scene string) (grab? symbol)) "Spawn a [[scene-player]] process for the given scene." - (when (and (process-grab? obj #t) (or grab? (process-grab? *target* #t))) - (process-grab? obj #f) + (when (and (process-grab? this #t) (or grab? (process-grab? *target* #t))) + (process-grab? this #f) (if (not grab?) (process-grab? *target* #f) ) - (set! (-> obj scene-player-handle) + (set! (-> this scene-player-handle) (ppointer->handle (process-spawn scene-player :init scene-player-init scene #t #f)) ) #t ) ) -(defmethod scene-release? bot ((obj bot)) - (when (not (handle->process (-> obj scene-player-handle))) - (process-release? obj) +(defmethod scene-release? bot ((this bot)) + (when (not (handle->process (-> this scene-player-handle))) + (process-release? this) #t ) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod clear-speech-flags! bot ((obj bot)) +(defmethod clear-speech-flags! bot ((this bot)) "Clear the `playing` flag for all of our speeches." - (let ((speeches (-> obj course speeches))) - (countdown (i (-> obj course speech-count)) + (let ((speeches (-> this course speeches))) + (countdown (i (-> this course speech-count)) (let ((speech (-> speeches i))) (logclear! (-> speech flags) (speech-flags playing)) ) @@ -1195,8 +1206,8 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch gui-connection vs none. -(defmethod play-speech bot ((obj bot) (idx int)) - (let* ((course (-> obj course)) +(defmethod play-speech bot ((this bot) (idx int)) + (let* ((course (-> this course)) (speech (-> course speeches idx)) ) (logior! (-> speech flags) (speech-flags playing)) @@ -1204,8 +1215,8 @@ If the player is too far, play a warning speech." (proc (add-process *gui-control* - obj - (the-as gui-channel (-> obj channel)) + this + (the-as gui-channel (-> this channel)) (gui-action play) (-> speech name) -99.0 @@ -1228,12 +1239,12 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-death-sound bot ((obj bot) (sound string)) +(defmethod play-death-sound bot ((this bot) (sound string)) "Play one of our death sounds." (add-process *gui-control* - obj - (the-as gui-channel (-> obj channel)) + this + (the-as gui-channel (-> this channel)) (gui-action play) sound -99.0 @@ -1242,9 +1253,9 @@ If the player is too far, play a warning speech." (none) ) -(defmethod speech-ended? bot ((obj bot) (idx int)) +(defmethod speech-ended? bot ((this bot) (idx int)) "Is the given speech active?" - (let ((speech (-> obj course speeches idx))) + (let ((speech (-> this course speeches idx))) (= (get-status *gui-control* (lookup-gui-connection-id *gui-control* (-> speech name) (gui-channel none) (gui-action none)) @@ -1254,17 +1265,17 @@ If the player is too far, play a warning speech." ) ) -(defmethod speech-playing? bot ((obj bot) (idx int)) +(defmethod speech-playing? bot ((this bot) (idx int)) "Is the given speech playing?" - (let ((v1-2 (-> obj course speeches idx))) + (let ((v1-2 (-> this course speeches idx))) (logtest? (-> v1-2 flags) (speech-flags playing)) ) ) -(defmethod channel-active? bot ((obj bot) (channel uint)) +(defmethod channel-active? bot ((this bot) (channel uint)) "Is the given [[gui-channel]] active?" (if (zero? channel) - (set! channel (-> obj channel)) + (set! channel (-> this channel)) ) (nonzero? (get-status *gui-control* @@ -1273,9 +1284,9 @@ If the player is too far, play a warning speech." ) ) -(defmethod stop-speech bot ((obj bot) (channel uint) (arg1 symbol)) +(defmethod stop-speech bot ((this bot) (channel uint) (arg1 symbol)) (if (zero? channel) - (set! channel (-> obj channel)) + (set! channel (-> this channel)) ) (if arg1 (set-action! @@ -1316,36 +1327,36 @@ If the player is too far, play a warning speech." (none) ) -(defmethod go-to-waypoint! bot ((obj bot) (id int) (skipped? symbol)) +(defmethod go-to-waypoint! bot ((this bot) (id int) (skipped? symbol)) "Start moving to the given [[bot-waypoint]]." - (let* ((course (-> obj course)) + (let* ((course (-> this course)) (waypoint-count (-> course waypoints length)) ) (dotimes (i waypoint-count) (let ((waypoint (-> course waypoints i))) (when (= (-> waypoint waypoint-id) id) - (set! (-> obj waypoint) waypoint) - (set! (-> obj waypoint-bits) (waypoint-bits)) - (set! (-> obj waypoint-time0) (current-time)) - (set! (-> obj too-far-warn-dist) (-> obj too-far-warn-dist-default)) - (set! (-> obj too-far-fail-dist-delta) (-> obj too-far-fail-dist-delta-default)) + (set! (-> this waypoint) waypoint) + (set! (-> this waypoint-bits) (waypoint-bits)) + (set-time! (-> this waypoint-time0)) + (set! (-> this too-far-warn-dist) (-> this too-far-warn-dist-default)) + (set! (-> this too-far-fail-dist-delta) (-> this too-far-fail-dist-delta-default)) (let ((mesh-idx (-> waypoint nav-mesh-index))) - (when (and (>= mesh-idx 0) (!= (-> obj nav-mesh-index) mesh-idx)) - (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor mesh-idx) obj) - (set! (-> obj nav-mesh-index) mesh-idx) + (when (and (>= mesh-idx 0) (!= (-> this nav-mesh-index) mesh-idx)) + (change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor mesh-idx) this) + (set! (-> this nav-mesh-index) mesh-idx) ) ) (when skipped? (let ((on-skip (-> waypoint on-skipping-here))) (when on-skip - (process-entity-status! obj (entity-perm-status no-kill) #t) - (on-skip obj) + (process-entity-status! this (entity-perm-status no-kill) #t) + (on-skip this) ) ) ) (let ((on-set (-> waypoint on-set))) (if on-set - (on-set obj) + (on-set this) ) ) (return #f) @@ -1357,102 +1368,103 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch object vs none. -(defmethod skip-waypoint bot ((obj bot)) - (let ((skip-id (-> obj waypoint skip-to))) +(defmethod skip-waypoint bot ((this bot)) + (let ((skip-id (-> this waypoint skip-to))) (when (>= skip-id 0) - (stop-speech obj (the-as uint 0) #f) - (set! (-> obj delay-too-far-check) 10) - (go-to-waypoint! obj skip-id #t) + (stop-speech this (the-as uint 0) #f) + (set! (-> this delay-too-far-check) 10) + (go-to-waypoint! this skip-id #t) ) ) (none) ) ;; WARN: Return type mismatch nav-enemy vs bot. -(defmethod relocate bot ((obj bot) (arg0 int)) - (if (nonzero? (-> obj ai-ctrl)) - (&+! (-> obj ai-ctrl) arg0) +(defmethod relocate bot ((this bot) (arg0 int)) + (if (nonzero? (-> this ai-ctrl)) + (&+! (-> this ai-ctrl) arg0) ) - (if (nonzero? (-> obj task)) - (&+! (-> obj task) arg0) + (if (nonzero? (-> this task)) + (&+! (-> this task) arg0) ) - (if (nonzero? (-> obj swivel-joint-mod)) - (&+! (-> obj swivel-joint-mod) arg0) + (if (nonzero? (-> this swivel-joint-mod)) + (&+! (-> this swivel-joint-mod) arg0) ) - (the-as bot ((method-of-type nav-enemy relocate) obj arg0)) + (the-as bot ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod deactivate bot ((obj bot)) - (send-event (handle->process (-> obj health-handle)) 'hide-and-die) - (if (nonzero? (-> obj ai-ctrl)) - (ai-task-control-method-9 (-> obj ai-ctrl)) +(defmethod deactivate bot ((this bot)) + (send-event (handle->process (-> this health-handle)) 'hide-and-die) + (if (nonzero? (-> this ai-ctrl)) + (ai-task-control-method-9 (-> this ai-ctrl)) ) - ((method-of-type nav-enemy deactivate) obj) + ((method-of-type nav-enemy deactivate) this) (none) ) -(defmethod init! bot ((obj bot)) +(defmethod init! bot ((this bot)) "Set defaults for various fields." - (set! (-> obj master-handle) (the-as handle #f)) - (set! (-> obj health-handle) (the-as handle #f)) - (set! (-> obj scene-player-handle) (the-as handle #f)) - (set! (-> obj poi-handle) (the-as handle #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (set! (-> obj focus-mode) 0) - (set! (-> obj hit-invuln-ignore-me-delay) (the-as uint 180)) - (set! (-> obj warn-to-fail-timeout) (the-as uint #x34bc)) - (set! (-> obj warn-min-delay) (the-as uint 2400)) - (set! (-> obj warn-max-delay) (the-as uint 4200)) - (set! (-> obj vehicle-seat-index) -1) - (set! (-> obj nav-mesh-index) -1) - (set! (-> obj too-far-warn-dist-default) 184320.0) - (set! (-> obj too-far-fail-dist-delta-default) 122880.0) - (logior! (-> obj bot-flags) (bot-flags bf11)) - (set! (-> obj delay-too-far-check) 10) - (set! (-> obj focus collide-with) (collide-spec jak enemy hit-by-others-list player-list)) - (set! (-> obj spot-color) (the-as uint #x500000ff)) - (set-vector! (-> obj follow-dir) 0.0 0.0 1.0 1.0) + (set! (-> this master-handle) (the-as handle #f)) + (set! (-> this health-handle) (the-as handle #f)) + (set! (-> this scene-player-handle) (the-as handle #f)) + (set! (-> this poi-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set! (-> this focus-mode) 0) + (set! (-> this hit-invuln-ignore-me-delay) (the-as uint 180)) + (set! (-> this warn-to-fail-timeout) (the-as uint #x34bc)) + (set! (-> this warn-min-delay) (the-as uint 2400)) + (set! (-> this warn-max-delay) (the-as uint 4200)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this nav-mesh-index) -1) + (set! (-> this too-far-warn-dist-default) 184320.0) + (set! (-> this too-far-fail-dist-delta-default) 122880.0) + (logior! (-> this bot-flags) (bot-flags bf11)) + (set! (-> this delay-too-far-check) 10) + (set! (-> this focus collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> this spot-color) (the-as uint #x500000ff)) + (set-vector! (-> this follow-dir) 0.0 0.0 1.0 1.0) 0 (none) ) -(defmethod init-enemy! bot ((obj bot)) +(defmethod init-enemy! bot ((this bot)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (process-entity-status! obj (entity-perm-status bit-4) #t) - (set! (-> obj ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) - (logclear! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask bot)) - (logior! (-> obj enemy-flags) (enemy-flag use-notice-distance multi-focus)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logior! (-> obj focus-status) (focus-status disable)) - (let ((v1-13 (-> obj nav))) + (process-entity-status! this (entity-perm-status bit-4) #t) + (set! (-> this ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask bot)) + (logior! (-> this enemy-flags) (enemy-flag use-notice-distance multi-focus)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logior! (-> this focus-status) (focus-status disable)) + (let ((v1-13 (-> this nav))) (set! (-> v1-13 sphere-mask) (the-as uint 78)) ) 0 - (logclear! (-> obj root nav-flags) (nav-flags has-extra-sphere)) - (let ((v1-17 (-> obj nav))) + (logclear! (-> this root nav-flags) (nav-flags has-extra-sphere)) + (let ((v1-17 (-> this nav))) (set! (-> v1-17 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (let ((a2-3 (res-lump-value (-> obj entity) 'task-actor uint128 :time -1000000000.0))) + (set-gravity-length (-> this root dynam) 573440.0) + (let ((a2-3 (res-lump-value (-> this entity) 'task-actor uint128 :time -1000000000.0))) (if (nonzero? a2-3) - (set! (-> obj task) (new 'process 'game-task-control (the-as game-task-actor a2-3))) + (set! (-> this task) (new 'process 'game-task-control (the-as game-task-actor a2-3))) ) ) - (let ((s5-0 (res-lump-value (-> obj entity) 'bot-course uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (let ((s5-0 (res-lump-value (-> this entity) 'bot-course uint128 :default (the-as uint128 -1) :time -1000000000.0)) + ) (if (< (the-as int s5-0) 0) (go process-drawable-art-error "no course") ) (let ((s5-1 (-> *bot-course-table* course s5-0))) - (set! (-> obj course) s5-1) + (set! (-> this course) s5-1) (+! (-> s5-1 retry-cookie) 1) - (mem-copy! (the-as pointer (-> obj spot)) (the-as pointer (-> s5-1 spots 0)) 20) + (mem-copy! (the-as pointer (-> this spot)) (the-as pointer (-> s5-1 spots 0)) 20) (let ((v1-36 (-> s5-1 waypoints 0))) - (set! (-> obj nav-mesh-index) (-> v1-36 nav-mesh-index)) - (go-to-waypoint! obj (-> v1-36 waypoint-id) #f) + (set! (-> this nav-mesh-index) (-> v1-36 nav-mesh-index)) + (go-to-waypoint! this (-> v1-36 waypoint-id) #f) ) ) ) @@ -1461,23 +1473,23 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch object vs symbol. -(defmethod bot-method-214 bot ((obj bot)) - (the-as symbol (when (logtest? (-> obj bot-flags) (bot-flags bf00)) - (let ((fproc (handle->process (-> obj focus handle)))) +(defmethod bot-method-214 bot ((this bot)) + (the-as symbol (when (logtest? (-> this bot-flags) (bot-flags bf00)) + (let ((fproc (handle->process (-> this focus handle)))) (and fproc - (= (-> obj focus aware) (enemy-aware enemy-aware-3)) - (attacked-by-player? obj (the-as process-focusable fproc)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (= (-> this focus aware) (enemy-aware enemy-aware-3)) + (attacked-by-player? this (the-as process-focusable fproc)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) ) ) ) ) -(defmethod bot-method-223 bot ((obj bot) (arg0 symbol)) - (let ((focus (-> obj focus-info)) +(defmethod bot-method-223 bot ((this bot) (arg0 symbol)) + (let ((focus (-> this focus-info)) (timer (current-time)) - (focus-proc (handle->process (-> obj focus handle))) + (focus-proc (handle->process (-> this focus handle))) ) (when (or (!= timer (-> focus update-time)) (!= focus-proc (-> focus fproc))) (set! (-> focus update-time) timer) @@ -1486,11 +1498,11 @@ If the player is too far, play a warning speech." (when focus-proc (set! (-> focus pos quad) (-> (get-trans (the-as process-focusable focus-proc) 0) quad)) (set! (-> focus bullseye quad) (-> (get-trans (the-as process-focusable focus-proc) 3) quad)) - (vector-z-quaternion! (-> focus my-facing-xz-dir) (-> obj root quat)) + (vector-z-quaternion! (-> focus my-facing-xz-dir) (-> this root quat)) (set! (-> focus my-facing-xz-dir y) 0.0) (vector-normalize! (-> focus my-facing-xz-dir) 1.0) (set! (-> focus my-facing-ry) (atan (-> focus my-facing-xz-dir x) (-> focus my-facing-xz-dir z))) - (vector-! (-> focus bullseye-xz-dir) (-> focus bullseye) (-> obj root trans)) + (vector-! (-> focus bullseye-xz-dir) (-> focus bullseye) (-> this root trans)) (let ((v1-11 (-> focus bullseye-xz-dir))) (set! (-> focus bullseye-xz-dist) (sqrtf (+ (* (-> v1-11 x) (-> v1-11 x)) (* (-> v1-11 z) (-> v1-11 z))))) ) @@ -1502,7 +1514,7 @@ If the player is too far, play a warning speech." ) (when (and arg0 focus-proc (zero? (-> focus los))) (let ((cquery (new 'stack-no-clear 'collide-query))) - (set! (-> cquery start-pos quad) (-> obj root trans quad)) + (set! (-> cquery start-pos quad) (-> this root trans quad)) (+! (-> cquery start-pos y) 8192.0) (vector-! (-> cquery move-dist) (-> focus bullseye) (-> cquery start-pos)) (let ((f0-19 (fmax 1.0 (+ -1638.4 (vector-length (-> cquery move-dist)))))) @@ -1512,9 +1524,9 @@ If the player is too far, play a warning speech." (let ((v1-23 cquery)) (set! (-> v1-23 radius) 2048.0) (set! (-> v1-23 collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) - (set! (-> v1-23 ignore-process0) obj) + (set! (-> v1-23 ignore-process0) this) (set! (-> v1-23 ignore-process1) #f) - (set! (-> v1-23 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-23 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-23 action-mask) (collide-action solid)) ) (cond @@ -1524,7 +1536,7 @@ If the player is too far, play a warning speech." ) (else (let ((s3-3 1)) - (when (not (logtest? (-> obj bot-flags) (bot-flags attacked))) + (when (not (logtest? (-> this bot-flags) (bot-flags attacked))) (let ((a0-31 *target*)) (when a0-31 (vector+! (-> cquery move-dist) (-> cquery move-dist) (-> cquery start-pos)) @@ -1558,7 +1570,7 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch float vs none. -(defmethod turn-to-target bot ((obj bot) (turn-info bot-turn-info) (proc process-focusable) (arg3 float)) +(defmethod turn-to-target bot ((this bot) (turn-info bot-turn-info) (proc process-focusable) (arg3 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1567,7 +1579,7 @@ If the player is too far, play a warning speech." (vf7 :class vf) ) (init-vf0-vector) - (let ((bot-root (-> obj root))) + (let ((bot-root (-> this root))) (quaternion-copy! (-> turn-info src-quat) (-> bot-root quat)) (vector-z-quaternion! (-> turn-info facing-dir) (-> bot-root quat)) (set! (-> turn-info facing-ry) (atan (-> turn-info facing-dir x) (-> turn-info facing-dir z))) @@ -1602,17 +1614,17 @@ If the player is too far, play a warning speech." ) ) -(defmethod bot-method-208 bot ((obj bot)) +(defmethod bot-method-208 bot ((this bot)) (let ((s5-0 #f)) (when *target* (let ((target-trans (-> *target* control trans)) - (bot-root (-> obj root)) + (bot-root (-> this root)) (f0-0 14336.0) ) (when (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> bot-root trans) target-trans)) (let ((v1-8 (-> *target* control transv))) (when (>= (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) 2048.0) - (if (logtest? (-> obj nav state flags) (nav-state-flag avoiding-sphere)) + (if (logtest? (-> this nav state flags) (nav-state-flag avoiding-sphere)) (set! s5-0 #t) ) ) @@ -1620,29 +1632,29 @@ If the player is too far, play a warning speech." ) ) ) - (let* ((f0-8 (-> obj player-blocking)) + (let* ((f0-8 (-> this player-blocking)) (f0-10 (if s5-0 (seek f0-8 1.0 (seconds-per-frame)) (seek f0-8 0.0 (seconds-per-frame)) ) ) ) - (set! (-> obj player-blocking) f0-10) + (set! (-> this player-blocking) f0-10) (= f0-10 1.0) ) ) ) -(defmethod enemy-method-82 bot ((obj bot) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 bot ((this bot) (arg0 enemy-jump-info)) "@abstract" (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) - (set! (-> v1-0 w) (-> obj nav-radius-backup)) - (add-root-sphere-to-hash! (-> obj nav) v1-0 #x8006a) + (set! (-> v1-0 w) (-> this nav-radius-backup)) + (add-root-sphere-to-hash! (-> this nav) v1-0 #x8006a) ) ) -(defmethod bot-method-222 bot ((obj bot) (arg0 vector)) +(defmethod bot-method-222 bot ((this bot) (arg0 vector)) (let ((s1-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (v1-0 (new 'stack-no-clear 'vector)) @@ -1650,11 +1662,11 @@ If the player is too far, play a warning speech." (s4-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-0 quad) (-> obj root trans quad)) + (set! (-> v1-0 quad) (-> this root trans quad)) (+! (-> v1-0 y) 9216.0) (vector-! s1-0 arg0 v1-0) (vector-normalize! s1-0 1.0) - (vector-z-quaternion! s2-0 (-> obj root quat)) + (vector-z-quaternion! s2-0 (-> this root quat)) (rot-zxy-from-vector! s4-0 s2-0) (rot-zxy-from-vector! s3-0 s1-0) (set! (-> s5-0 x) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 x) (-> s4-0 x))))) @@ -1663,8 +1675,8 @@ If the player is too far, play a warning speech." (let ((s4-1 (new 'stack-no-clear 'quaternion))) (quaternion-zxy! s4-1 s5-0) (quaternion-pseudo-seek - (-> obj swivel-joint-mod quat) - (-> obj swivel-joint-mod quat) + (-> this swivel-joint-mod quat) + (-> this swivel-joint-mod quat) s4-1 (seconds-per-frame) ) @@ -1674,26 +1686,30 @@ If the player is too far, play a warning speech." (none) ) -(defmethod bot-method-221 bot ((obj bot)) +(defmethod bot-method-221 bot ((this bot)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-identity! gp-0) (quaternion-pseudo-seek - (-> obj swivel-joint-mod quat) - (-> obj swivel-joint-mod quat) + (-> this swivel-joint-mod quat) + (-> this swivel-joint-mod quat) gp-0 (seconds-per-frame) ) ) ) -(defmethod play-attacked-speech bot ((obj bot)) - (when (not (channel-active? obj (the-as uint 0))) - (let ((idx - (bot-speech-list-method-9 (-> obj course attack-player-speeches) obj (-> obj course speeches) (speech-flags)) - ) +(defmethod play-attacked-speech bot ((this bot)) + (when (not (channel-active? this (the-as uint 0))) + (let ((idx (bot-speech-list-method-9 + (-> this course attack-player-speeches) + this + (-> this course speeches) + (speech-flags) + ) + ) ) (if (>= idx 0) - (play-speech obj idx) + (play-speech this idx) ) ) ) @@ -1701,21 +1717,21 @@ If the player is too far, play a warning speech." ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod bot-method-196 bot ((obj bot)) - (logior! (-> obj bot-flags) (bot-flags too-far-fail)) +(defmethod bot-method-196 bot ((this bot)) + (logior! (-> this bot-flags) (bot-flags too-far-fail)) (none) ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod fail-mission! bot ((obj bot)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (logior! (-> obj bot-flags) (bot-flags bf09)) +(defmethod fail-mission! bot ((this bot)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (logior! (-> this bot-flags) (bot-flags bf09)) (let ((mission-failed? #t)) - (let ((master-handle (handle->process (-> obj master-handle)))) + (let ((master-handle (handle->process (-> this master-handle)))) (cond (master-handle (if (not (send-event master-handle 'notify 'mission-failed)) @@ -1739,29 +1755,29 @@ If the player is too far, play a warning speech." ) ) (if mission-failed? - (logior! (-> obj bot-flags) (bot-flags failed bf13)) + (logior! (-> this bot-flags) (bot-flags failed bf13)) ) ) (none) ) -(defmethod fail-falling bot ((obj bot)) - (if (logtest? (-> obj bot-flags) (bot-flags failed)) - (cam-move-to-bot obj) +(defmethod fail-falling bot ((this bot)) + (if (logtest? (-> this bot-flags) (bot-flags failed)) + (cam-move-to-bot this) ) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod cam-move-to-bot bot ((obj bot)) +(defmethod cam-move-to-bot bot ((this bot)) (cond - ((logtest? (-> obj bot-flags) (bot-flags bf13)) - (logclear! (-> obj bot-flags) (bot-flags bf13)) - (logior! (-> obj bot-flags) (bot-flags bf14)) - (let ((s4-0 (-> obj move-dest))) - (set-cam-height! obj s4-0) + ((logtest? (-> this bot-flags) (bot-flags bf13)) + (logclear! (-> this bot-flags) (bot-flags bf13)) + (logior! (-> this bot-flags) (bot-flags bf14)) + (let ((s4-0 (-> this move-dest))) + (set-cam-height! this s4-0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 s4-0 (-> obj root trans)) + (vector-! s5-0 s4-0 (-> this root trans)) (set-setting! 'string-max-height 'abs (-> s5-0 y) 0) (set-setting! 'string-min-height 'abs (-> s5-0 y) 0) (let ((f30-0 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))) @@ -1773,57 +1789,57 @@ If the player is too far, play a warning speech." (set-setting! 'immediate-string-min-max #f 0.0 0) (set! (-> *ACTOR-bank* birth-max) 1000) ) - ((logtest? (-> obj bot-flags) (bot-flags bf14)) - (logclear! (-> obj bot-flags) (bot-flags bf14)) - (send-event *camera* 'change-target obj) - (send-event *camera* 'teleport-to-vector-start-string (-> obj move-dest)) + ((logtest? (-> this bot-flags) (bot-flags bf14)) + (logclear! (-> this bot-flags) (bot-flags bf14)) + (send-event *camera* 'change-target this) + (send-event *camera* 'teleport-to-vector-start-string (-> this move-dest)) ) ) (none) ) ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! bot ((obj bot) (arg0 vector)) +(defmethod set-cam-height! bot ((this bot) (arg0 vector)) (set-vector! arg0 0.0 12288.0 28672.0 1.0) - (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) (the-as meters - (if (focus-test? obj under-water) - (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) ) ) ) ;; WARN: Return type mismatch focus-status vs none. -(defmethod bot-method-191 bot ((obj bot)) - (logior! (-> obj bot-flags) (bot-flags bf02)) - (set! (-> obj hit-invuln-starting-time) (current-time)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active)) - (if (nonzero? (-> obj hit-invuln-ignore-me-delay)) - (logior! (-> obj focus-status) (focus-status ignore)) +(defmethod bot-method-191 bot ((this bot)) + (logior! (-> this bot-flags) (bot-flags bf02)) + (set-time! (-> this hit-invuln-starting-time)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active)) + (if (nonzero? (-> this hit-invuln-ignore-me-delay)) + (logior! (-> this focus-status) (focus-status ignore)) ) - (if (nonzero? (-> obj hit-invuln-focus-disable-delay)) - (logior! (-> obj focus-status) (focus-status disable)) + (if (nonzero? (-> this hit-invuln-focus-disable-delay)) + (logior! (-> this focus-status) (focus-status disable)) ) (none) ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod bot-method-192 bot ((obj bot)) +(defmethod bot-method-192 bot ((this bot)) (local-vars (a2-7 enemy-flag)) - (let ((a1-0 (-> obj hit-invuln-starting-time)) + (let ((a1-0 (-> this hit-invuln-starting-time)) (v1-0 #t) ) - (if (not (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active))) + (if (not (logtest? (-> this enemy-flags) (enemy-flag enable-on-active))) (set! v1-0 (cond - ((>= (- (current-time) a1-0) (seconds 0.6)) - (let ((a2-6 (-> obj enemy-flags))) + ((time-elapsed? a1-0 (seconds 0.6)) + (let ((a2-6 (-> this enemy-flags))) (if (logtest? a2-6 (enemy-flag checking-water)) (set! a2-7 (logior a2-6 (enemy-flag enable-on-active))) (set! a2-7 (logclear a2-6 (enemy-flag enable-on-active))) ) ) - (set! (-> obj enemy-flags) a2-7) + (set! (-> this enemy-flags) a2-7) v1-0 ) (else @@ -1832,10 +1848,10 @@ If the player is too far, play a warning speech." ) ) ) - (if (focus-test? obj ignore) + (if (focus-test? this ignore) (set! v1-0 (cond - ((>= (- (current-time) a1-0) (the-as time-frame (-> obj hit-invuln-ignore-me-delay))) - (logclear! (-> obj focus-status) (focus-status ignore)) + ((time-elapsed? a1-0 (the-as time-frame (-> this hit-invuln-ignore-me-delay))) + (logclear! (-> this focus-status) (focus-status ignore)) v1-0 ) (else @@ -1844,10 +1860,10 @@ If the player is too far, play a warning speech." ) ) ) - (if (focus-test? obj disable) + (if (focus-test? this disable) (set! v1-0 (cond - ((>= (- (current-time) a1-0) (the-as time-frame (-> obj hit-invuln-focus-disable-delay))) - (logclear! (-> obj focus-status) (focus-status disable)) + ((time-elapsed? a1-0 (the-as time-frame (-> this hit-invuln-focus-disable-delay))) + (logclear! (-> this focus-status) (focus-status disable)) v1-0 ) (else @@ -1857,23 +1873,23 @@ If the player is too far, play a warning speech." ) ) (if v1-0 - (logclear! (-> obj bot-flags) (bot-flags bf02)) + (logclear! (-> this bot-flags) (bot-flags bf02)) ) ) (none) ) -(defmethod bot-method-216 bot ((obj bot)) +(defmethod bot-method-216 bot ((this bot)) 0 (none) ) -(defmethod coin-flip? bot ((obj bot)) +(defmethod coin-flip? bot ((this bot)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod bot-method-181 bot ((obj bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) +(defmethod bot-method-181 bot ((this bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) diff --git a/goal_src/jak2/levels/common/ai/halt/hal-task.gc b/goal_src/jak2/levels/common/ai/halt/hal-task.gc index 96e18b80a9..89191fdb75 100644 --- a/goal_src/jak2/levels/common/ai/halt/hal-task.gc +++ b/goal_src/jak2/levels/common/ai/halt/hal-task.gc @@ -7,31 +7,31 @@ ;; DECOMP BEGINS -(defmethod reset-task! halt-wait-spot ((obj halt-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) 0) - (set! (-> obj num-spots) (the-as uint 1)) +(defmethod reset-task! halt-wait-spot ((this halt-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) 0) + (set! (-> this num-spots) (the-as uint 1)) (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 halt-wait-spot ((obj halt-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 halt-wait-spot ((this halt-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (set! (-> arg0 root trans quad) (-> arg0 spot center quad)) - ((-> obj check-done) obj (the-as hal arg0)) + ((-> this check-done) this (the-as hal arg0)) (none) ) diff --git a/goal_src/jak2/levels/common/ai/halt/hal.gc b/goal_src/jak2/levels/common/ai/halt/hal.gc index aec136dbed..e9e19e729f 100644 --- a/goal_src/jak2/levels/common/ai/halt/hal.gc +++ b/goal_src/jak2/levels/common/ai/halt/hal.gc @@ -136,14 +136,14 @@ ) ) -(defmethod stop-speech hal ((obj hal) (arg0 uint) (arg1 symbol)) +(defmethod stop-speech hal ((this hal) (arg0 uint) (arg1 symbol)) (cond ((zero? arg0) (let ((t9-0 (method-of-type bot stop-speech))) - (t9-0 obj (-> obj channel) arg1) + (t9-0 this (-> this channel) arg1) ) (countdown (s4-0 3) - (let ((v1-4 (handle->process (-> obj slave-handle s4-0)))) + (let ((v1-4 (handle->process (-> this slave-handle s4-0)))) (when v1-4 (let ((t9-1 (method-of-type bot stop-speech))) (t9-1 (the-as bot v1-4) (-> v1-4 stack 580) arg1) @@ -153,23 +153,23 @@ ) ) (else - ((method-of-type bot stop-speech) obj arg0 arg1) + ((method-of-type bot stop-speech) this arg0 arg1) ) ) (none) ) ;; WARN: Return type mismatch gui-connection vs none. -(defmethod play-speech hal ((obj hal) (arg0 int)) - (let ((v1-2 (-> obj course speeches arg0))) +(defmethod play-speech hal ((this hal) (arg0 int)) + (let ((v1-2 (-> this course speeches arg0))) (logior! (-> v1-2 flags) (speech-flags playing)) (let ((a1-4 (-> v1-2 slave-id)) (t2-0 (-> v1-2 hold-time)) - (gp-0 (-> obj course speech-tunings (-> v1-2 tuning-id))) + (gp-0 (-> this course speech-tunings (-> v1-2 tuning-id))) ) (cond ((>= a1-4 0) - (let* ((a2-2 (handle->process (-> obj slave-handle a1-4))) + (let* ((a2-2 (handle->process (-> this slave-handle a1-4))) (a1-11 (add-process *gui-control* a2-2 @@ -187,8 +187,8 @@ (else (let ((a1-14 (add-process *gui-control* - obj - (the-as gui-channel (-> obj channel)) + this + (the-as gui-channel (-> this channel)) (gui-action play) (-> v1-2 name) -99.0 @@ -205,17 +205,17 @@ (none) ) -(defmethod channel-active? hal ((obj hal) (arg0 uint)) +(defmethod channel-active? hal ((this hal) (arg0 uint)) "Is the given [[gui-channel]] active?" (cond ((zero? arg0) (let ((t9-0 (method-of-type bot channel-active?))) - (if (t9-0 obj (-> obj channel)) + (if (t9-0 this (-> this channel)) (return #t) ) ) (countdown (s5-0 3) - (let ((v1-7 (handle->process (-> obj slave-handle s5-0)))) + (let ((v1-7 (handle->process (-> this slave-handle s5-0)))) (when v1-7 (let ((t9-1 (method-of-type bot channel-active?))) (if (t9-1 (the-as bot v1-7) (-> v1-7 stack 580)) @@ -228,14 +228,14 @@ #f ) (else - ((method-of-type bot channel-active?) obj arg0) + ((method-of-type bot channel-active?) this arg0) ) ) ) -(defmethod hal-method-226 hal ((obj hal)) +(defmethod hal-method-226 hal ((this hal)) (countdown (s5-0 3) - (let ((a0-2 (handle->process (-> obj slave-handle s5-0)))) + (let ((a0-2 (handle->process (-> this slave-handle s5-0)))) (when a0-2 (if (not (send-event a0-2 'request 'slave-id s5-0)) (return #f) @@ -246,9 +246,9 @@ #t ) -(defmethod hal-method-225 hal ((obj hal)) +(defmethod hal-method-225 hal ((this hal)) (countdown (v1-0 3) - (if (handle->process (-> obj slave-handle v1-0)) + (if (handle->process (-> this slave-handle v1-0)) (return #f) ) ) @@ -256,13 +256,13 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-method-196 hal ((obj hal)) - (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail))) +(defmethod bot-method-196 hal ((this hal)) + (when (not (logtest? (-> this bot-flags) (bot-flags too-far-fail))) (let ((t9-0 (method-of-type bot bot-method-196))) - (t9-0 obj) + (t9-0 this) ) (countdown (s5-0 3) - (let ((a0-3 (handle->process (-> obj slave-handle s5-0)))) + (let ((a0-3 (handle->process (-> this slave-handle s5-0)))) (if a0-3 (bot-method-196 (the-as bot a0-3)) ) @@ -272,9 +272,9 @@ (none) ) -(defmethod init-enemy-collision! hal ((obj hal)) +(defmethod init-enemy-collision! hal ((this hal)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -291,90 +291,90 @@ (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init! hal ((obj hal)) +(defmethod init! hal ((this hal)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj handle-failed-slave-id) -1) + (set! (-> this handle-failed-slave-id) -1) (countdown (v1-2 3) - (set! (-> obj slave-handle v1-2) (the-as handle #f)) + (set! (-> this slave-handle v1-2) (the-as handle #f)) (nop!) ) 0 (none) ) -(defmethod init-enemy! hal ((obj hal)) +(defmethod init-enemy! hal ((this hal)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) + (init! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-scenecamera" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *hal-nav-enemy-info*) + (init-enemy-behaviour-and-stats! this *hal-nav-enemy-info*) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (set! (-> obj channel) (the-as uint 28)) - (set! (-> obj spot-color) (the-as uint #x5000ffff)) - (set! (-> obj notice-enemy-dist) 0.0) - (logior! (-> obj focus-status) (focus-status disable)) - (let ((v1-13 (-> obj root root-prim))) + (set! (-> this channel) (the-as uint 28)) + (set! (-> this spot-color) (the-as uint #x5000ffff)) + (set! (-> this notice-enemy-dist) 0.0) + (logior! (-> this focus-status) (focus-status disable)) + (let ((v1-13 (-> this root root-prim))) (set! (-> v1-13 prim-core collide-as) (collide-spec)) (set! (-> v1-13 prim-core collide-with) (collide-spec)) ) - (set! (-> obj root backup-collide-as) (collide-spec)) - (set! (-> obj root backup-collide-with) (collide-spec)) + (set! (-> this root backup-collide-as) (collide-spec)) + (set! (-> this root backup-collide-with) (collide-spec)) 0 - (logior! (-> obj draw status) (draw-control-status no-draw)) - (remove-process-drawable (-> obj nav state mesh) obj) - (set! (-> obj nav) #f) - (set! (-> obj nav-mesh-index) -1) + (logior! (-> this draw status) (draw-control-status no-draw)) + (remove-process-drawable (-> this nav state mesh) this) + (set! (-> this nav) #f) + (set! (-> this nav-mesh-index) -1) 0 (none) ) -(defmethod scene-play hal ((obj hal) (arg0 string) (arg1 symbol)) +(defmethod scene-play hal ((this hal) (arg0 string) (arg1 symbol)) "Spawn a [[scene-player]] process for the given scene." - (when (and (process-grab? obj #t) (or arg1 (process-grab? *target* #t))) + (when (and (process-grab? this #t) (or arg1 (process-grab? *target* #t))) (countdown (s3-0 3) - (let ((a0-4 (handle->process (-> obj slave-handle s3-0)))) + (let ((a0-4 (handle->process (-> this slave-handle s3-0)))) (if (and a0-4 (not (process-grab? a0-4 #t))) (return #f) ) ) ) - (process-grab? obj #f) + (process-grab? this #f) (if (not arg1) (process-grab? *target* #f) ) (countdown (s4-1 3) - (let ((a0-10 (handle->process (-> obj slave-handle s4-1)))) + (let ((a0-10 (handle->process (-> this slave-handle s4-1)))) (if a0-10 (process-grab? a0-10 #f) ) ) ) - (set! (-> obj scene-player-handle) + (set! (-> this scene-player-handle) (ppointer->handle (process-spawn scene-player :init scene-player-init arg0 #t #f)) ) #t ) ) -(defmethod scene-release? hal ((obj hal)) - (when (not (handle->process (-> obj scene-player-handle))) - (process-release? obj) +(defmethod scene-release? hal ((this hal)) + (when (not (handle->process (-> this scene-player-handle))) + (process-release? this) (countdown (s5-0 3) - (let ((a0-7 (handle->process (-> obj slave-handle s5-0)))) + (let ((a0-7 (handle->process (-> this slave-handle s5-0)))) (if a0-7 (process-release? a0-7) ) @@ -384,7 +384,7 @@ ) ) -(defmethod general-event-handler hal ((obj hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler hal ((this hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -399,8 +399,8 @@ ) (when v1-2 (when (= (-> (the-as process (-> arg3 param 1)) type) target) - (logior! (-> obj bot-flags) (ash 1 (+ (-> (the-as bot v1-2) slave-id) 19))) - (stop-speech obj (the-as uint 0) #t) + (logior! (-> this bot-flags) (ash 1 (+ (-> (the-as bot v1-2) slave-id) 19))) + (stop-speech this (the-as uint 0) #t) ) ) ) @@ -413,9 +413,9 @@ ) ) (when s5-1 - (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail))) - (when (not (logtest? (-> obj bot-flags) (bot-flags bf09))) - (logior! (-> obj bot-flags) (bot-flags bf09)) + (when (not (logtest? (-> this bot-flags) (bot-flags too-far-fail))) + (when (not (logtest? (-> this bot-flags) (bot-flags bf09))) + (logior! (-> this bot-flags) (bot-flags bf09)) (let ((a1-7 (new 'stack-no-clear 'fail-mission-params))) (set! (-> a1-7 flags) (fail-mission-flags famflags-5)) (set! (-> a1-7 message) (fail-mission-message fammsg-0)) @@ -425,69 +425,69 @@ (set! (-> a1-7 task) (game-task none)) (set! (-> a1-7 fail-message) (text-id null)) (if (start! *fail-mission-control* a1-7) - (set! (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) + (set! (-> this handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) ) ) - (set! (-> obj delay-too-far-check) -1) - (stop-speech obj (the-as uint 0) #f) + (set! (-> this delay-too-far-check) -1) + (stop-speech this (the-as uint 0) #f) (countdown (s4-2 3) - (send-event (handle->process (-> obj slave-handle s4-2)) 'notify 'mission-failed) + (send-event (handle->process (-> this slave-handle s4-2)) 'notify 'mission-failed) ) ) - (= (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) + (= (-> this handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) ) ) ) ) (('follow-dir) - (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (set! (-> this follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) #t ) ) ) (('set-task) (let ((a1-10 (/ (the-as int (-> arg3 param 0)) 8))) - (logior! (-> obj bot-task-bits) (ash 1 a1-10)) + (logior! (-> this bot-task-bits) (ash 1 a1-10)) ) #t ) (('clear-task) (let ((a1-12 (/ (the-as int (-> arg3 param 0)) 8))) - (logclear! (-> obj bot-task-bits) (ash 1 a1-12)) + (logclear! (-> this bot-task-bits) (ash 1 a1-12)) ) #t ) (('change-mode) (when (= (-> arg3 param 0) 'grab) - (let ((v0-1 (the-as object (alive? obj)))) + (let ((v0-1 (the-as object (alive? this)))) (if (and (the-as symbol v0-1) (-> arg3 param 1)) - (logior! (-> obj focus-status) (focus-status grabbed)) + (logior! (-> this focus-status) (focus-status grabbed)) ) v0-1 ) ) ) (('end-mode) - (when (focus-test? obj grabbed) - (logclear! (-> obj focus-status) (focus-status grabbed)) + (when (focus-test? this grabbed) + (logclear! (-> this focus-status) (focus-status grabbed)) #t ) ) (('skip) - (skip-waypoint obj) + (skip-waypoint this) ) (('move-trans) - (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) + (move-to-point! (-> this root) (the-as vector (-> arg3 param 0))) #t ) (('die-fast) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (('nav-mesh-kill) - (remove-process-drawable (-> obj nav state mesh) obj) - (set! (-> obj nav) #f) - (set! (-> obj nav-mesh-index) -1) + (remove-process-drawable (-> this nav state mesh) this) + (set! (-> this nav) #f) + (set! (-> this nav-mesh-index) -1) #t ) ) diff --git a/goal_src/jak2/levels/common/ai/ruffian/ruf-states.gc b/goal_src/jak2/levels/common/ai/ruffian/ruf-states.gc index 5771691697..228f43e6eb 100644 --- a/goal_src/jak2/levels/common/ai/ruffian/ruf-states.gc +++ b/goal_src/jak2/levels/common/ai/ruffian/ruf-states.gc @@ -11,7 +11,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -55,7 +55,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -93,7 +93,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -134,7 +134,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -174,7 +174,7 @@ :enter (-> (method-of-type ruffian scared-idle) enter) :trans (behavior () (bot-method-223 self #t) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (cond ((not (bot-method-214 self)) (react-to-focus self) @@ -199,7 +199,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -227,7 +227,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -253,10 +253,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (ruffian-method-240 self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -286,7 +286,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -306,7 +306,7 @@ ((bot-method-214 self) (go-hostile self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -331,7 +331,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (bot-method-214 self) (go-hostile self) ) @@ -495,7 +495,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/goal_src/jak2/levels/common/ai/ruffian/ruf-task.gc b/goal_src/jak2/levels/common/ai/ruffian/ruf-task.gc index 7c1803a94c..17f6502733 100644 --- a/goal_src/jak2/levels/common/ai/ruffian/ruf-task.gc +++ b/goal_src/jak2/levels/common/ai/ruffian/ruf-task.gc @@ -7,42 +7,42 @@ ;; DECOMP BEGINS -(defmethod reset-task! ruft-wait-spot ((obj ruft-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! ruft-wait-spot ((this ruft-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) -(defmethod ai-task-method-11 ruft-wait-spot ((obj ruft-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 ruft-wait-spot ((this ruft-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - (when (not ((-> obj check-done) obj (the-as ruffian arg0))) + (when (not ((-> this check-done) this (the-as ruffian arg0))) (let ((a1-10 (handle->process (-> arg0 focus handle)))) (when (and a1-10 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) @@ -57,7 +57,8 @@ (none) ) -(defmethod ai-task-method-11 ruft-fight-focus ((obj ruft-fight-focus) (arg0 bot)) +;; WARN: Return type mismatch object vs none. +(defmethod ai-task-method-11 ruft-fight-focus ((this ruft-fight-focus) (arg0 bot)) (let ((a1-1 (handle->process (-> arg0 focus handle)))) (if (and a1-1 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) @@ -65,30 +66,30 @@ (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (logior! (-> arg0 bot-flags) (bot-flags bf00)) - (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + (ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0) ) ) (none) ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod ai-task-method-10 ruft-fight-focus ((obj ruft-fight-focus) (arg0 bot)) +(defmethod ai-task-method-10 ruft-fight-focus ((this ruft-fight-focus) (arg0 bot)) (logclear! (-> arg0 bot-flags) (bot-flags bf00)) (none) ) -(defmethod ruft-choose-jump-method-13 ruft-choose-jump ((obj ruft-choose-jump) (arg0 ruffian)) +(defmethod ruft-choose-jump-method-13 ruft-choose-jump ((this ruft-choose-jump) (arg0 ruffian)) (let ((gp-0 0)) (let ((f30-0 -1.0) (s3-0 (-> arg0 root trans)) ) - (countdown (s2-0 (-> obj num-spots)) - (let* ((s1-0 (-> arg0 ruf-course spots (-> obj src-spot-indexes s2-0))) + (countdown (s2-0 (-> this num-spots)) + (let* ((s1-0 (-> arg0 ruf-course spots (-> this src-spot-indexes s2-0))) (f28-0 (vector-vector-xz-distance s3-0 (-> s1-0 center))) ) (when (and (or (< f30-0 0.0) (< f28-0 f30-0)) (and (not (player-blocking-spot? arg0 s1-0)) - (not (player-blocking-spot? arg0 (-> arg0 ruf-course spots (-> obj dest-spot-indexes s2-0)))) + (not (player-blocking-spot? arg0 (-> arg0 ruf-course spots (-> this dest-spot-indexes s2-0)))) ) ) (set! f30-0 f28-0) @@ -101,9 +102,9 @@ ) ) -(defmethod ruft-choose-jump-method-12 ruft-choose-jump ((obj ruft-choose-jump) (arg0 ruffian)) - (let ((a1-5 (-> arg0 ruf-course spots (-> obj src-spot-indexes (-> obj which-spot)))) - (s5-0 (-> arg0 ruf-course spots (-> obj dest-spot-indexes (-> obj which-spot)))) +(defmethod ruft-choose-jump-method-12 ruft-choose-jump ((this ruft-choose-jump) (arg0 ruffian)) + (let ((a1-5 (-> arg0 ruf-course spots (-> this src-spot-indexes (-> this which-spot)))) + (s5-0 (-> arg0 ruf-course spots (-> this dest-spot-indexes (-> this which-spot)))) ) (when (and (outside-spot-radius? arg0 a1-5 (the-as vector #f) #f) (not (player-blocking-spot? arg0 s5-0))) (let ((v1-9 (-> arg0 nav))) @@ -119,71 +120,71 @@ ) ) -(defmethod reset-task! ruft-choose-jump ((obj ruft-choose-jump)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! ruft-choose-jump ((this ruft-choose-jump)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 ruft-choose-jump ((obj ruft-choose-jump) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 ruft-choose-jump ((this ruft-choose-jump) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (or (< s4-0 0) - (player-blocking-spot? arg0 (-> arg0 course spots (-> obj src-spot-indexes s4-0))) - (player-blocking-spot? arg0 (-> arg0 course spots (-> obj dest-spot-indexes s4-0))) + (player-blocking-spot? arg0 (-> arg0 course spots (-> this src-spot-indexes s4-0))) + (player-blocking-spot? arg0 (-> arg0 course spots (-> this dest-spot-indexes s4-0))) ) - (set! s4-0 (ruft-choose-jump-method-13 obj (the-as ruffian arg0))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (ruft-choose-jump-method-13 this (the-as ruffian arg0))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj src-spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this src-spot-indexes s4-0))) 20 ) (send-event (ppointer->process (-> arg0 my-simple-focus)) 'move-trans - (-> arg0 course spots (-> obj dest-spot-indexes s4-0)) + (-> arg0 course spots (-> this dest-spot-indexes s4-0)) ) (set! (-> arg0 poi-handle) (ppointer->handle (-> arg0 my-simple-focus))) ) (when (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj src-spot-indexes)) - (the-as int (-> obj src-spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this src-spot-indexes)) + (the-as int (-> this src-spot-indexes s4-0)) ) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj dest-spot-indexes)) - (the-as int (-> obj dest-spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this dest-spot-indexes)) + (the-as int (-> this dest-spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as ruffian arg0)) + ((-> this check-done) this (the-as ruffian arg0)) (none) ) -(defmethod ai-task-method-10 ruft-choose-jump ((obj ruft-choose-jump) (arg0 bot)) +(defmethod ai-task-method-10 ruft-choose-jump ((this ruft-choose-jump) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) -(defmethod reset-task! ruft-plant-bomb ((obj ruft-plant-bomb)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! ruft-plant-bomb ((this ruft-plant-bomb)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) -(defmethod ai-task-method-11 ruft-plant-bomb ((obj ruft-plant-bomb) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 ruft-plant-bomb ((this ruft-plant-bomb) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj stand-spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this stand-spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) @@ -191,23 +192,23 @@ ) (when (< s4-0 0) (set! s4-0 - (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj stand-spot-indexes))) + (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this stand-spot-indexes))) ) - (set! (-> obj which-spot) s4-0) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj stand-spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this stand-spot-indexes s4-0))) 20 ) (send-event (ppointer->process (-> arg0 my-simple-focus)) 'move-trans - (-> arg0 course spots (-> obj face-spot-indexes s4-0)) + (-> arg0 course spots (-> this face-spot-indexes s4-0)) ) ) (set! (-> arg0 poi-handle) (ppointer->handle (-> arg0 my-simple-focus))) (if (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) - (and (enemy-method-95 arg0 (the-as vector (-> arg0 course spots (-> obj face-spot-indexes s4-0))) 10012.445) + (and (enemy-method-95 arg0 (the-as vector (-> arg0 course spots (-> this face-spot-indexes s4-0))) 10012.445) (not (logtest? (bot-flags bf21) (-> arg0 bot-flags))) ) ) @@ -217,19 +218,19 @@ (when (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj stand-spot-indexes)) - (the-as int (-> obj stand-spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this stand-spot-indexes)) + (the-as int (-> this stand-spot-indexes s4-0)) ) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj face-spot-indexes)) - (the-as int (-> obj face-spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this face-spot-indexes)) + (the-as int (-> this face-spot-indexes s4-0)) ) ) ) - (when (not ((-> obj check-done) obj (the-as ruffian arg0))) + (when (not ((-> this check-done) this (the-as ruffian arg0))) (let ((a1-17 (handle->process (-> arg0 focus handle)))) (when (and a1-17 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) @@ -244,7 +245,7 @@ (none) ) -(defmethod ai-task-method-10 ruft-plant-bomb ((obj ruft-plant-bomb) (arg0 bot)) +(defmethod ai-task-method-10 ruft-plant-bomb ((this ruft-plant-bomb) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc b/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc index 2ad36901db..307f85bc05 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-plasma.gc @@ -141,17 +141,18 @@ ) ) -(defmethod sig-plasma-method-14 sig-plasma ((obj sig-plasma) (arg0 process-focusable)) - (let* ((f0-0 (-> obj level)) +;; WARN: Return type mismatch object vs none. +(defmethod sig-plasma-method-14 sig-plasma ((this sig-plasma) (arg0 process-focusable)) + (let* ((f0-0 (-> this level)) (f30-0 (cond - ((logtest? (-> obj flags) (plasma-flags pf01)) - (seek f0-0 1.0 (* (-> obj charge-speed) (seconds-per-frame))) + ((logtest? (-> this flags) (plasma-flags pf01)) + (seek f0-0 1.0 (* (-> this charge-speed) (seconds-per-frame))) ) (else - (let ((f1-1 (-> obj min-level))) + (let ((f1-1 (-> this min-level))) (when (< f0-0 f1-1) (set! f1-1 f0-0) - (set! (-> obj min-level) f1-1) + (set! (-> this min-level) f1-1) ) (seek f0-0 f1-1 (* 0.25 (seconds-per-frame))) ) @@ -159,12 +160,12 @@ ) ) ) - (set! (-> obj level) f30-0) + (set! (-> this level) f30-0) (cond ((= f30-0 0.0) (let ((v1-9 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-9 command) (sound-command set-param)) - (set! (-> v1-9 id) (-> obj powerup-sound-id)) + (set! (-> v1-9 id) (-> this powerup-sound-id)) (set! (-> v1-9 params volume) -4) (set! (-> v1-9 auto-time) 24) (set! (-> v1-9 auto-from) 2) @@ -173,7 +174,7 @@ ) (let ((v1-11 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-11 command) (sound-command set-param)) - (set! (-> v1-11 id) (-> obj plasma-sound-id)) + (set! (-> v1-11 id) (-> this plasma-sound-id)) (set! (-> v1-11 params volume) -4) (set! (-> v1-11 auto-time) 24) (set! (-> v1-11 auto-from) 2) @@ -189,7 +190,7 @@ (let ((f28-0 (+ 0.25 (* 0.75 f30-0)))) (sound-play-by-name (static-sound-name "sig-gun-powerup") - (-> obj powerup-sound-id) + (-> this powerup-sound-id) (the int (* 1024.0 f28-0)) (the int (* 1524.0 (+ 0.5 (* 0.5 f30-0)))) 0 @@ -198,7 +199,7 @@ ) (sound-play-by-name (static-sound-name "sig-gun-plasma") - (-> obj plasma-sound-id) + (-> this plasma-sound-id) (the int (* 1024.0 f28-0)) (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) 0 @@ -226,46 +227,46 @@ ) ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-12 sig-plasma ((obj sig-plasma)) - (let ((f0-0 (-> obj level))) - (-> obj min-level) +(defmethod sig-plasma-method-12 sig-plasma ((this sig-plasma)) + (let ((f0-0 (-> this level))) + (-> this min-level) (when (>= f0-0 1.0) (set! f0-0 0.99) - (set! (-> obj level) f0-0) + (set! (-> this level) f0-0) ) - (set! (-> obj min-level) (fmax 0.0 (+ -0.5 f0-0))) + (set! (-> this min-level) (fmax 0.0 (+ -0.5 f0-0))) ) - (logclear! (-> obj flags) (plasma-flags pf01 pf02 pf04)) + (logclear! (-> this flags) (plasma-flags pf01 pf02 pf04)) (none) ) ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-11 sig-plasma ((obj sig-plasma) (arg0 symbol)) - (set! (-> obj min-level) 0.0) +(defmethod sig-plasma-method-11 sig-plasma ((this sig-plasma) (arg0 symbol)) + (set! (-> this min-level) 0.0) (cond (arg0 - (set! (-> obj level) 0.0) + (set! (-> this level) 0.0) ) (else - (if (>= (-> obj level) 1.0) - (set! (-> obj level) 0.99) + (if (>= (-> this level) 1.0) + (set! (-> this level) 0.99) ) ) ) - (logclear! (-> obj flags) (plasma-flags pf00 pf01 pf02 pf04)) + (logclear! (-> this flags) (plasma-flags pf00 pf01 pf02 pf04)) (none) ) ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-9 sig-plasma ((obj sig-plasma)) - (logior! (-> obj flags) (plasma-flags pf03)) +(defmethod sig-plasma-method-9 sig-plasma ((this sig-plasma)) + (logior! (-> this flags) (plasma-flags pf03)) (none) ) -(defmethod sig-plasma-method-10 sig-plasma ((obj sig-plasma)) - (logtest? (-> obj flags) (plasma-flags pf02)) +(defmethod sig-plasma-method-10 sig-plasma ((this sig-plasma)) + (logtest? (-> this flags) (plasma-flags pf02)) ) -(defmethod sig-plasma-method-13 sig-plasma ((obj sig-plasma)) - (and (logtest? (-> obj flags) (plasma-flags pf03)) (logtest? (-> obj flags) (plasma-flags pf04))) +(defmethod sig-plasma-method-13 sig-plasma ((this sig-plasma)) + (and (logtest? (-> this flags) (plasma-flags pf03)) (logtest? (-> this flags) (plasma-flags pf04))) ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-shot.gc b/goal_src/jak2/levels/common/ai/sig/sig-shot.gc index ca0139cc9b..ad3c9da628 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-shot.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-shot.gc @@ -255,14 +255,14 @@ ) -(defmethod draw-laser-sight sig-shot ((obj sig-shot)) +(defmethod draw-laser-sight sig-shot ((this sig-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 655) (-> obj tail-pos) (-> obj starting-dir) #f #t) + (draw-beam (-> *part-id-table* 655) (-> this tail-pos) (-> this starting-dir) #f #t) 0 (none) ) -(defmethod spawn-impact-particles sig-shot ((obj sig-shot)) +(defmethod spawn-impact-particles sig-shot ((this sig-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -272,8 +272,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((v1-1 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((v1-1 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -317,7 +317,7 @@ ) ) -(defmethod spawn-shell-particles sig-shot ((obj sig-shot)) +(defmethod spawn-shell-particles sig-shot ((this sig-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -339,7 +339,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -358,7 +358,7 @@ (none) ) -(defmethod play-impact-sound sig-shot ((obj sig-shot) (arg0 projectile-options)) +(defmethod play-impact-sound sig-shot ((this sig-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -373,16 +373,16 @@ (none) ) -(defmethod made-impact? sig-shot ((obj sig-shot)) +(defmethod made-impact? sig-shot ((this sig-shot)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a1-0 t1-0)) (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a1-0 ignore-process0) obj) - (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-0 action-mask) (collide-action solid)) ) @@ -417,9 +417,9 @@ (none) ) -(defmethod init-proj-collision! sig-shot ((obj sig-shot)) +(defmethod init-proj-collision! sig-shot ((this sig-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -460,9 +460,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (let ((v1-22 (-> obj parent))) + (let ((v1-22 (-> this parent))) (when (not (logtest? (-> (the-as sig (if v1-22 (the-as sig (-> v1-22 0 self)) ) @@ -472,7 +472,7 @@ (bot-flags attacked) ) ) - (let* ((a0-16 (-> obj root)) + (let* ((a0-16 (-> this root)) (v1-27 (-> a0-16 root-prim)) ) (countdown (a0-17 (-> a0-16 total-prims)) @@ -482,18 +482,18 @@ ) ) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) ) -(defmethod init-proj-settings! sig-shot ((obj sig-shot)) +(defmethod init-proj-settings! sig-shot ((this sig-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj max-speed) 307200.0) - (set! (-> obj move) sig-shot-move) - (set! (-> obj timeout) (seconds 1.335)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this max-speed) 307200.0) + (set! (-> this move) sig-shot-move) + (set! (-> this timeout) (seconds 1.335)) (none) ) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-states.gc b/goal_src/jak2/levels/common/ai/sig/sig-states.gc index 35b129f98e..2918c0d53e 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-states.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-states.gc @@ -11,7 +11,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -64,7 +64,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -158,7 +158,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -200,7 +200,7 @@ ) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (or (not (-> self focus-info fproc)) (>= (-> self focus-info bullseye-xz-dist) 102400.0)) ) (go-virtual waiting-far) @@ -279,7 +279,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -458,7 +458,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -590,7 +590,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -620,7 +620,7 @@ ) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) (zero? (-> self played-unjam-time))) - (set! (-> self played-unjam-time) (current-time)) + (set-time! (-> self played-unjam-time)) (sound-play "sig-gun-unjam") ) ) @@ -640,7 +640,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -653,7 +653,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -665,7 +665,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -677,7 +677,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -689,7 +689,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -701,7 +701,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -714,7 +714,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -727,7 +727,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -742,7 +742,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -834,7 +834,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -867,10 +867,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (go-virtual waiting-close) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -900,7 +900,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -927,7 +927,7 @@ ((sig-method-255 self) (go-virtual repair-gun) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -963,7 +963,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (when (bot-method-214 self) (cond ((sig-method-246 self) @@ -1175,7 +1175,7 @@ (until (ja-done? 0) (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 131072.0 (seconds 0.05)) (bot-method-223 self #t) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.1)) (or (not (bot-method-214 self)) (not (sig-method-245 self))) ) (react-to-focus self) @@ -1216,7 +1216,7 @@ :trans (behavior () (bot-method-223 self #t) (cond - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ((not (bot-method-214 self)) @@ -1283,7 +1283,7 @@ 0.0 #f ) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.167)) + (until (time-elapsed? (-> self state-time) (seconds 0.167)) (sig-method-258 self) (suspend) ) @@ -1313,7 +1313,7 @@ ) ) ) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.8)) + (until (time-elapsed? (-> self state-time) (seconds 0.8)) (sig-method-258 self) (suspend) ) @@ -1444,12 +1444,12 @@ (ja :num! (seek!)) ) (ja-channel-push! 1 (seconds 0.2)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) @@ -1466,7 +1466,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1525,7 +1525,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1554,7 +1554,7 @@ (if (logtest? s5-0 2) (go-virtual sig-path-shoot-jump) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.05)) (not (logtest? s5-0 4))) + (if (and (time-elapsed? (-> self state-time) (seconds 0.05)) (not (logtest? s5-0 4))) (go-virtual sig-path-jump-land) ) ) @@ -1591,7 +1591,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1651,7 +1651,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1681,7 +1681,7 @@ (if (and (logtest? s5-0 1) (logtest? (bot-flags bf25) (-> self bot-flags))) (go-virtual sig-path-jump) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.05)) (not (logtest? s5-0 4))) + (if (and (time-elapsed? (-> self state-time) (seconds 0.05)) (not (logtest? s5-0 4))) (go-virtual sig-path-shoot-jump-land) ) ) @@ -1723,7 +1723,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1783,7 +1783,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/goal_src/jak2/levels/common/ai/sig/sig-task.gc b/goal_src/jak2/levels/common/ai/sig/sig-task.gc index 74bc45a87b..edd13f0f62 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig-task.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig-task.gc @@ -7,42 +7,42 @@ ;; DECOMP BEGINS -(defmethod reset-task! sigt-wait-spot ((obj sigt-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! sigt-wait-spot ((this sigt-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) -(defmethod ai-task-method-11 sigt-wait-spot ((obj sigt-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 sigt-wait-spot ((this sigt-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - (when (not ((-> obj check-done) obj (the-as sig arg0))) + (when (not ((-> this check-done) this (the-as sig arg0))) (let ((a1-10 (handle->process (-> arg0 focus handle)))) (cond ((and a1-10 @@ -62,29 +62,30 @@ (none) ) -(defmethod ai-task-method-11 sigt-fight-focus ((obj sigt-fight-focus) (arg0 bot)) +;; WARN: Return type mismatch object vs none. +(defmethod ai-task-method-11 sigt-fight-focus ((this sigt-fight-focus) (arg0 bot)) (let ((a1-1 (handle->process (-> arg0 focus handle)))) (if (and a1-1 (attacked-by-player? arg0 (the-as process-focusable a1-1)) (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (logior! (-> arg0 bot-flags) (bot-flags bf00)) - (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + (ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0) ) ) (none) ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod ai-task-method-10 sigt-fight-focus ((obj sigt-fight-focus) (arg0 bot)) +(defmethod ai-task-method-10 sigt-fight-focus ((this sigt-fight-focus) (arg0 bot)) (logclear! (-> arg0 bot-flags) (bot-flags bf00)) (none) ) -(defmethod ai-task-method-11 sigt-repair-gun ((obj sigt-repair-gun) (arg0 bot)) +(defmethod ai-task-method-11 sigt-repair-gun ((this sigt-repair-gun) (arg0 bot)) (cond ((not (logtest? (bot-flags bf19) (-> arg0 bot-flags))) - (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + (ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0) ) (else (let ((a1-4 (handle->process (-> arg0 focus handle)))) @@ -101,9 +102,9 @@ (none) ) -(defmethod sigt-choose-piston-method-14 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig) (arg1 int)) - (let* ((v1-2 (-> arg0 course spots (-> obj spot-indexes arg1))) - (a0-6 (-> arg0 actor-group 0 data (-> obj actor-indexes arg1) actor)) +(defmethod sigt-choose-piston-method-14 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig) (arg1 int)) + (let* ((v1-2 (-> arg0 course spots (-> this spot-indexes arg1))) + (a0-6 (-> arg0 actor-group 0 data (-> this actor-indexes arg1) actor)) (gp-0 (if a0-6 (-> a0-6 extra process) ) @@ -117,29 +118,29 @@ ) ) -(defmethod sigt-choose-piston-method-13 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig)) +(defmethod sigt-choose-piston-method-13 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig)) (let ((s4-0 0)) (let ((f30-0 -1.0) (s3-0 (-> arg0 root trans)) ) - (countdown (s2-0 (-> obj num-spots)) - (let* ((v1-3 (-> obj spot-indexes s2-0)) + (countdown (s2-0 (-> this num-spots)) + (let* ((v1-3 (-> this spot-indexes s2-0)) (f28-0 (vector-vector-xz-distance s3-0 (the-as vector (-> arg0 course spots v1-3)))) ) - (when (and (or (< f30-0 0.0) (< f28-0 f30-0)) (not (sigt-choose-piston-method-14 obj arg0 (the-as int s2-0)))) + (when (and (or (< f30-0 0.0) (< f28-0 f30-0)) (not (sigt-choose-piston-method-14 this arg0 (the-as int s2-0)))) (set! f30-0 f28-0) (set! s4-0 (the-as int s2-0)) ) ) ) ) - (set! (-> obj which-spot) s4-0) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) - (let* ((v1-22 (-> arg0 actor-group 0 data (-> obj actor-indexes s4-0) actor)) + (let* ((v1-22 (-> arg0 actor-group 0 data (-> this actor-indexes s4-0) actor)) (a0-6 (if v1-22 (-> v1-22 extra process) ) @@ -153,12 +154,12 @@ (none) ) -(defmethod sigt-choose-piston-method-12 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig)) +(defmethod sigt-choose-piston-method-12 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig)) (with-pp (when (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) - (not (sigt-choose-piston-method-14 obj arg0 (-> obj which-spot))) + (not (sigt-choose-piston-method-14 this arg0 (-> this which-spot))) ) - (let* ((v1-12 (-> arg0 actor-group 0 data (-> obj actor-indexes (-> obj which-spot)) actor)) + (let* ((v1-12 (-> arg0 actor-group 0 data (-> this actor-indexes (-> this which-spot)) actor)) (s5-1 (if v1-12 (-> v1-12 extra process) ) @@ -204,34 +205,34 @@ ) ) -(defmethod reset-task! sigt-choose-piston ((obj sigt-choose-piston)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! sigt-choose-piston ((this sigt-choose-piston)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) -(defmethod ai-task-method-11 sigt-choose-piston ((obj sigt-choose-piston) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 sigt-choose-piston ((this sigt-choose-piston) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (cond ((< s4-0 0) - (sigt-choose-piston-method-13 obj (the-as sig arg0)) + (sigt-choose-piston-method-13 this (the-as sig arg0)) ) - ((sigt-choose-piston-method-14 obj (the-as sig arg0) s4-0) - (sigt-choose-piston-method-13 obj (the-as sig arg0)) + ((sigt-choose-piston-method-14 this (the-as sig arg0) s4-0) + (sigt-choose-piston-method-13 this (the-as sig arg0)) ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - (when (not ((-> obj check-done) obj (the-as sig arg0))) + (when (not ((-> this check-done) this (the-as sig arg0))) (let ((a1-6 (handle->process (-> arg0 focus handle)))) (when (and a1-6 (attacked-by-player? arg0 (the-as process-focusable a1-6)) @@ -245,14 +246,14 @@ (none) ) -(defmethod ai-task-method-10 sigt-choose-piston ((obj sigt-choose-piston) (arg0 bot)) +(defmethod ai-task-method-10 sigt-choose-piston ((this sigt-choose-piston) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) -(defmethod sigt-riding-piston-method-12 sigt-riding-piston ((obj sigt-riding-piston) (arg0 sig)) +(defmethod sigt-riding-piston-method-12 sigt-riding-piston ((this sigt-riding-piston) (arg0 sig)) (with-pp - (when (not (player-blocking-spot? arg0 (-> arg0 course spots (-> obj spot-indexes (-> obj which-spot))))) + (when (not (player-blocking-spot? arg0 (-> arg0 course spots (-> this spot-indexes (-> this which-spot))))) (let* ((v1-9 (-> arg0 actor-group 0 data (-> arg0 platform-index) actor)) (a0-4 (if v1-9 (-> v1-9 extra process) @@ -275,7 +276,7 @@ (set! (-> v1-19 target-speed) 0.0) ) 0 - (let ((s5-1 (-> arg0 course spots (-> obj spot-indexes (-> obj which-spot))))) + (let ((s5-1 (-> arg0 course spots (-> this spot-indexes (-> this which-spot))))) (set! (-> arg0 enemy-flags) (the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag vulnerable)))) (when (send-event arg0 'jump 0 (-> s5-1 center)) (mem-copy! (the-as pointer (-> arg0 spot)) (the-as pointer s5-1) 20) @@ -292,57 +293,57 @@ ) ) -(defmethod reset-task! sigt-riding-piston ((obj sigt-riding-piston)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! sigt-riding-piston ((this sigt-riding-piston)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 sigt-riding-piston ((obj sigt-riding-piston) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) - (when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) +(defmethod ai-task-method-11 sigt-riding-piston ((this sigt-riding-piston) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) + (when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> this spot-indexes s4-0)))) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (send-event (ppointer->process (-> arg0 my-simple-focus)) 'move-trans - (-> arg0 course spots (-> obj spot-indexes s4-0)) + (-> arg0 course spots (-> this spot-indexes s4-0)) ) (set! (-> arg0 poi-handle) (ppointer->handle (-> arg0 my-simple-focus))) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as sig arg0)) + ((-> this check-done) this (the-as sig arg0)) (none) ) -(defmethod ai-task-method-10 sigt-riding-piston ((obj sigt-riding-piston) (arg0 bot)) +(defmethod ai-task-method-10 sigt-riding-piston ((this sigt-riding-piston) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) -(defmethod reset-task! sigt-charge-plasma ((obj sigt-charge-plasma)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! sigt-charge-plasma ((this sigt-charge-plasma)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) -(defmethod ai-task-method-11 sigt-charge-plasma ((obj sigt-charge-plasma) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 sigt-charge-plasma ((this sigt-charge-plasma) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> (the-as sig arg0) course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> (the-as sig arg0) course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? (the-as sig arg0) s3-0 (the-as vector #f) #f)) (player-blocking-spot? (the-as sig arg0) s3-0) ) @@ -352,24 +353,28 @@ ) (when (< s4-0 0) (set! s4-0 - (choose-spot (the-as sig arg0) (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes))) + (choose-spot + (the-as sig arg0) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + ) ) - (set! (-> obj which-spot) s4-0) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> (the-as sig arg0) spot)) - (the-as pointer (-> (the-as sig arg0) course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> (the-as sig arg0) course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere (the-as sig arg0) - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) - (let* ((v1-24 (-> (the-as sig arg0) actor-group 0 data (-> obj actor-index) actor)) + (let* ((v1-24 (-> (the-as sig arg0) actor-group 0 data (-> this actor-index) actor)) (s3-1 (when v1-24 (let ((s2-0 (-> v1-24 extra process))) (if (type? s2-0 process-focusable) @@ -383,7 +388,7 @@ (s3-1 (set! (-> (the-as sig arg0) poi-handle) (process->handle s3-1)) (set! (-> (the-as sig arg0) focus-mode) 1) - (let ((a1-10 (-> (the-as sig arg0) course spots (-> obj spot-indexes s4-0)))) + (let ((a1-10 (-> (the-as sig arg0) course spots (-> this spot-indexes s4-0)))) (if (and (outside-spot-radius? (the-as sig arg0) a1-10 (the-as vector #f) #f) (enemy-method-95 (the-as sig arg0) (get-trans (the-as process-focusable s3-1) 3) 10012.445) ) @@ -401,7 +406,7 @@ ) ) ) - (when (not ((-> obj check-done) obj (the-as sig arg0))) + (when (not ((-> this check-done) this (the-as sig arg0))) (let ((a1-14 (handle->process (-> (the-as sig arg0) focus handle)))) (when (and a1-14 (attacked-by-player? (the-as sig arg0) (the-as process-focusable a1-14)) @@ -415,7 +420,7 @@ (none) ) -(defmethod ai-task-method-10 sigt-charge-plasma ((obj sigt-charge-plasma) (arg0 bot)) +(defmethod ai-task-method-10 sigt-charge-plasma ((this sigt-charge-plasma) (arg0 bot)) (clear-poi-and-focus! (the-as sig arg0)) (logclear! (-> (the-as sig arg0) plasma flags) (plasma-flags pf00)) (set! (-> (the-as sig arg0) focus-mode) 0) diff --git a/goal_src/jak2/levels/common/ai/sig/sig.gc b/goal_src/jak2/levels/common/ai/sig/sig.gc index 603e51c846..07bcc7dee8 100644 --- a/goal_src/jak2/levels/common/ai/sig/sig.gc +++ b/goal_src/jak2/levels/common/ai/sig/sig.gc @@ -234,8 +234,8 @@ ) ) -(defmethod enemy-method-97 sig ((obj sig)) - (let* ((s5-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 sig ((this sig)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) (s4-0 (if (type? s5-0 process-focusable) s5-0 ) @@ -244,46 +244,46 @@ (when s4-0 (cond ((= (-> s4-0 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 1.5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! s4-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 6)) + (when (time-elapsed? (-> this attacker-time) (seconds 6)) (set! s4-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) - (let ((v1-23 (-> obj focus-mode)) + (let ((v1-23 (-> this focus-mode)) (s5-1 (the-as process #f)) ) (cond ((zero? v1-23) (cond (s4-0 - (if (or (not (logtest? (bot-flags bf19) (-> obj bot-flags))) - (>= 16384.0 (vector-vector-xz-distance (-> obj root trans) (get-trans (the-as process-focusable s4-0) 3))) + (if (or (not (logtest? (bot-flags bf19) (-> this bot-flags))) + (>= 16384.0 (vector-vector-xz-distance (-> this root trans) (get-trans (the-as process-focusable s4-0) 3))) ) (set! s5-1 s4-0) ) ) (else - (when (not (logtest? (bot-flags bf19) (-> obj bot-flags))) - (set! s5-1 (select-focus! obj)) + (when (not (logtest? (bot-flags bf19) (-> this bot-flags))) + (set! s5-1 (select-focus! this)) (cond (s5-1 (empty) ) (else - (let ((s4-1 (handle->process (-> obj poi-handle)))) + (let ((s4-1 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-1 process-focusable) s4-1 ) @@ -302,15 +302,15 @@ ((= v1-23 1) (cond (s4-0 - (if (or (not (logtest? (bot-flags bf19) (-> obj bot-flags))) - (>= 16384.0 (vector-vector-xz-distance (-> obj root trans) (get-trans (the-as process-focusable s4-0) 3))) + (if (or (not (logtest? (bot-flags bf19) (-> this bot-flags))) + (>= 16384.0 (vector-vector-xz-distance (-> this root trans) (get-trans (the-as process-focusable s4-0) 3))) ) (set! s5-1 s4-0) ) ) (else - (when (not (logtest? (bot-flags bf19) (-> obj bot-flags))) - (let ((s4-2 (handle->process (-> obj poi-handle)))) + (when (not (logtest? (bot-flags bf19) (-> this bot-flags))) + (let ((s4-2 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-2 process-focusable) s4-2 ) @@ -320,7 +320,7 @@ (s5-1 (empty) ) - ((begin (set! s5-1 (select-focus! obj)) s5-1) + ((begin (set! s5-1 (select-focus! this)) s5-1) (empty) ) (else @@ -334,14 +334,16 @@ ) (cond (s5-1 - (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> (the-as process-focusable s5-1) type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) + (!= (-> (the-as process-focusable s5-1) type) target) + ) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s5-1 @@ -349,43 +351,43 @@ ) ) -(defmethod general-event-handler sig ((obj sig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler sig ((this sig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('untrigger) - (sig-plasma-method-11 (-> obj plasma) #t) + (sig-plasma-method-11 (-> this plasma) #t) ) (('sig-path) - (when (and (not (focus-test? obj dead)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) + (when (and (not (focus-test? this dead)) (nonzero? (-> this hit-points)) (zero? (-> this fated-time))) (let ((a1-2 (-> arg3 param 0))) - (sig-method-249 obj (the-as sig-path a1-2)) + (sig-method-249 this (the-as sig-path a1-2)) ) - (go (method-of-object obj sig-path-run)) + (go (method-of-object this sig-path-run)) ) ) (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod track-target! sig ((obj sig)) +(defmethod track-target! sig ((this sig)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (let ((v1-2 (-> obj skel top-anim frame-group))) + (let ((v1-2 (-> this skel top-anim frame-group))) (cond - ((>= (- (current-time) (-> obj danger-time)) (seconds 2)) + ((time-elapsed? (-> this danger-time) (seconds 2)) (cond ((not v1-2) - (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) + (set! (-> this skel top-anim base-anim) (-> this draw art-group data 42)) ) - ((= v1-2 (-> obj draw art-group data 44)) + ((= v1-2 (-> this draw art-group data 44)) (push-anim-to-targ - (-> obj skel top-anim) - (the-as art-joint-anim (-> obj draw art-group data 46)) + (-> this skel top-anim) + (the-as art-joint-anim (-> this draw art-group data 46)) 0.0 0 0 @@ -393,19 +395,19 @@ 0.0 #f ) - (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) + (set! (-> this skel top-anim base-anim) (-> this draw art-group data 42)) ) ) ) (else (cond ((not v1-2) - (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 44)) + (set! (-> this skel top-anim base-anim) (-> this draw art-group data 44)) ) - ((= v1-2 (-> obj draw art-group data 42)) + ((= v1-2 (-> this draw art-group data 42)) (push-anim-to-targ - (-> obj skel top-anim) - (the-as art-joint-anim (-> obj draw art-group data 43)) + (-> this skel top-anim) + (the-as art-joint-anim (-> this draw art-group data 43)) 0.0 0 0 @@ -413,38 +415,38 @@ 0.0 #f ) - (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 44)) + (set! (-> this skel top-anim base-anim) (-> this draw art-group data 44)) ) ) ) ) ) (let ((t9-2 (method-of-type bot track-target!))) - (t9-2 obj) + (t9-2 this) ) - (when (logtest? (-> obj bot-flags) (bot-flags too-far-fail)) - (let ((f0-0 (vector-vector-distance (-> obj root trans) (target-pos 0)))) - (when (or (>= f0-0 491520.0) (and (>= f0-0 102400.0) (>= (- (current-time) (-> obj last-draw-time)) (seconds 10)))) - (process-entity-status! obj (entity-perm-status no-kill) #f) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (when (logtest? (-> this bot-flags) (bot-flags too-far-fail)) + (let ((f0-0 (vector-vector-distance (-> this root trans) (target-pos 0)))) + (when (or (>= f0-0 491520.0) (and (>= f0-0 102400.0) (time-elapsed? (-> this last-draw-time) (seconds 10)))) + (process-entity-status! this (entity-perm-status no-kill) #f) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) ) ) - (sig-plasma-method-14 (-> obj plasma) obj) + (sig-plasma-method-14 (-> this plasma) this) (none) ) -(defmethod go-to-waypoint! sig ((obj sig) (arg0 int) (arg1 symbol)) +(defmethod go-to-waypoint! sig ((this sig) (arg0 int) (arg1 symbol)) "Start moving to the given [[bot-waypoint]]." - (set! (-> obj plasma charge-speed) 0.125) - ((method-of-type bot go-to-waypoint!) obj arg0 arg1) + (set! (-> this plasma charge-speed) 0.125) + ((method-of-type bot go-to-waypoint!) this arg0 arg1) ) -(defmethod deactivate sig ((obj sig)) +(defmethod deactivate sig ((this sig)) (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) - (set! (-> v1-0 id) (-> obj plasma powerup-sound-id)) + (set! (-> v1-0 id) (-> this plasma powerup-sound-id)) (set! (-> v1-0 params volume) -4) (set! (-> v1-0 auto-time) 24) (set! (-> v1-0 auto-from) 2) @@ -453,24 +455,24 @@ ) (let ((v1-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-2 command) (sound-command set-param)) - (set! (-> v1-2 id) (-> obj plasma plasma-sound-id)) + (set! (-> v1-2 id) (-> this plasma plasma-sound-id)) (set! (-> v1-2 params volume) -4) (set! (-> v1-2 auto-time) 24) (set! (-> v1-2 auto-from) 2) (set! (-> v1-2 params mask) (the-as uint 17)) (-> v1-2 id) ) - ((method-of-type bot deactivate) obj) + ((method-of-type bot deactivate) this) (none) ) ;; WARN: Return type mismatch vector vs none. -(defmethod enemy-method-46 sig ((obj sig) (arg0 int)) +(defmethod enemy-method-46 sig ((this sig) (arg0 int)) "@abstract" (let ((v1-0 arg0)) (cond ((zero? v1-0) - (let ((v1-2 (-> obj root root-prim))) + (let ((v1-2 (-> this root root-prim))) (dotimes (a0-1 4) (let ((a1-3 (-> (the-as collide-shape-prim-group v1-2) child (+ a0-1 3)))) (set! (-> a1-3 prim-core collide-with) (collide-spec)) @@ -481,7 +483,7 @@ ) ) ((= v1-0 3) - (let ((v1-5 (the-as collide-shape-prim-group (-> obj root root-prim)))) + (let ((v1-5 (the-as collide-shape-prim-group (-> this root root-prim)))) (let ((a0-3 (-> v1-5 child 3))) (set! (-> a0-3 prim-core collide-as) (collide-spec bot bot-targetable)) (set! (-> a0-3 prim-core collide-with) @@ -521,9 +523,9 @@ (none) ) -(defmethod init-enemy-collision! sig ((obj sig)) +(defmethod init-enemy-collision! sig ((this sig)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -604,40 +606,40 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 8)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (enemy-method-46 obj 0) + (enemy-method-46 this 0) 0 (none) ) -(defmethod init-enemy! sig ((obj sig)) +(defmethod init-enemy! sig ((this sig)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) - (set! (-> obj channel) (the-as uint 21)) - (set! (-> obj notice-enemy-dist) 122880.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj plasma charge-speed) 0.125) - (set! (-> obj plasma powerup-sound-id) (new-sound-id)) - (set! (-> obj plasma plasma-sound-id) (new-sound-id)) - (set! (-> obj focus-info max-los-dist) 102400.0) - (set! (-> obj sig-path) #f) + (init! this) + (set! (-> this channel) (the-as uint 21)) + (set! (-> this notice-enemy-dist) 122880.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this plasma charge-speed) 0.125) + (set! (-> this plasma powerup-sound-id) (new-sound-id)) + (set! (-> this plasma plasma-sound-id) (new-sound-id)) + (set! (-> this focus-info max-los-dist) 102400.0) + (set! (-> this sig-path) #f) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sig" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *sig-nav-enemy-info*) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 147) obj)) - (add-connection *part-engine* obj 23 obj 671 (new 'static 'sphere :y 327.68 :z 7536.64 :r 163840.0)) - (set! (-> obj skel interp-select 0) (the-as int (the-as uint #x1ffc007ffff0))) - (set! (-> obj skel interp-select 1) 0) - (set! (-> obj skel top-anim) (new 'process 'top-anim-joint-control obj)) - (set! (-> obj skel interp-select 0) 0) - (set! (-> obj skel interp-select 1) 0) - (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) - (set! (-> obj swivel-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4)) - (let ((v1-26 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *sig-nav-enemy-info*) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 147) this)) + (add-connection *part-engine* this 23 this 671 (new 'static 'sphere :y 327.68 :z 7536.64 :r 163840.0)) + (set! (-> this skel interp-select 0) (the-as int (the-as uint #x1ffc007ffff0))) + (set! (-> this skel interp-select 1) 0) + (set! (-> this skel top-anim) (new 'process 'top-anim-joint-control this)) + (set! (-> this skel interp-select 0) 0) + (set! (-> this skel interp-select 1) 0) + (set! (-> this skel top-anim base-anim) (-> this draw art-group data 42)) + (set! (-> this swivel-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) + (let ((v1-26 (-> this neck))) (set! (-> v1-26 up) (the-as uint 1)) (set! (-> v1-26 nose) (the-as uint 2)) (set! (-> v1-26 ear) (the-as uint 0)) @@ -645,116 +647,116 @@ (set! (-> v1-26 ignore-angle) 30947.555) ) (let ((t9-10 (method-of-type bot init-enemy!))) - (t9-10 obj) + (t9-10 this) ) - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) 0 (none) ) ;; WARN: Return type mismatch sound-id vs enemy-flag. -(defmethod enemy-method-105 sig ((obj sig) (arg0 process)) +(defmethod enemy-method-105 sig ((this sig) (arg0 process)) (let ((t9-0 (method-of-type bot enemy-method-105))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (the-as enemy-flag (if (and (-> obj next-state) (= (-> obj next-state name) 'whip)) + (the-as enemy-flag (if (and (-> this next-state) (= (-> this next-state name) 'whip)) (sound-play "sig-gun-strike") ) ) ) -(defmethod sig-method-251 sig ((obj sig)) - (logtest? (-> obj plasma flags) (plasma-flags pf00)) +(defmethod sig-method-251 sig ((this sig)) + (logtest? (-> this plasma flags) (plasma-flags pf00)) ) -(defmethod sig-method-254 sig ((obj sig)) - (logtest? (bot-flags bf22) (-> obj bot-flags)) +(defmethod sig-method-254 sig ((this sig)) + (logtest? (bot-flags bf22) (-> this bot-flags)) ) -(defmethod sig-method-252 sig ((obj sig)) - (logtest? (bot-flags bf20) (-> obj bot-flags)) +(defmethod sig-method-252 sig ((this sig)) + (logtest? (bot-flags bf20) (-> this bot-flags)) ) -(defmethod sig-method-255 sig ((obj sig)) - (logtest? (bot-flags bf19) (-> obj bot-flags)) +(defmethod sig-method-255 sig ((this sig)) + (logtest? (bot-flags bf19) (-> this bot-flags)) ) -(defmethod sig-method-246 sig ((obj sig)) - (>= 16384.0 (-> obj focus-info bullseye-xz-dist)) +(defmethod sig-method-246 sig ((this sig)) + (>= 16384.0 (-> this focus-info bullseye-xz-dist)) ) -(defmethod sig-method-245 sig ((obj sig)) - (and (or (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target)) - (and (>= 40960.0 (-> obj focus-info bullseye-xz-dist)) (= (-> obj focus-info los) 1)) +(defmethod sig-method-245 sig ((this sig)) + (and (or (and (logtest? (-> this bot-flags) (bot-flags attacked)) (= (-> this focus-info fproc type) target)) + (and (>= 40960.0 (-> this focus-info bullseye-xz-dist)) (= (-> this focus-info los) 1)) ) - (not (logtest? (bot-flags bf19) (-> obj bot-flags))) + (not (logtest? (bot-flags bf19) (-> this bot-flags))) ) ) -(defmethod go-hostile sig ((obj sig)) - (bot-method-223 obj #t) +(defmethod go-hostile sig ((this sig)) + (bot-method-223 this #t) (cond - ((not (bot-method-214 obj)) - (react-to-focus obj) + ((not (bot-method-214 this)) + (react-to-focus this) ) - ((sig-method-246 obj) - (go (method-of-object obj whip)) + ((sig-method-246 this) + (go (method-of-object this whip)) ) - ((sig-method-245 obj) - (go (method-of-object obj blast)) + ((sig-method-245 this) + (go (method-of-object this blast)) ) (else - (go (method-of-object obj chase)) + (go (method-of-object this chase)) ) ) ) -(defmethod react-to-focus sig ((obj sig)) +(defmethod react-to-focus sig ((this sig)) "@TODO - flesh out docs" (cond - ((bot-method-214 obj) - (go-hostile obj) + ((bot-method-214 this) + (go-hostile this) ) - ((sig-method-252 obj) - (go (method-of-object obj gun-jam)) + ((sig-method-252 this) + (go (method-of-object this gun-jam)) ) - ((sig-method-255 obj) - (go (method-of-object obj repair-gun)) + ((sig-method-255 this) + (go (method-of-object this repair-gun)) ) - ((not (outside-spot-radius? obj (the-as bot-spot #f) (the-as vector #f) #f)) - (go (method-of-object obj traveling)) + ((not (outside-spot-radius? this (the-as bot-spot #f) (the-as vector #f) #f)) + (go (method-of-object this traveling)) ) - ((and (-> obj focus-info fproc) (>= (fabs (-> obj focus-info ry-diff)) 9102.223)) - (go (method-of-object obj waiting-turn)) + ((and (-> this focus-info fproc) (>= (fabs (-> this focus-info ry-diff)) 9102.223)) + (go (method-of-object this waiting-turn)) ) - ((sig-method-251 obj) - (go (method-of-object obj charge-plasma)) + ((sig-method-251 this) + (go (method-of-object this charge-plasma)) ) - ((sig-method-254 obj) - (go (method-of-object obj clean-gun)) + ((sig-method-254 this) + (go (method-of-object this clean-gun)) ) (else - (go (method-of-object obj waiting-close)) + (go (method-of-object this waiting-close)) ) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig ((obj sig)) - (go (method-of-object obj waiting-far)) +(defmethod go-idle sig ((this sig)) + (go (method-of-object this waiting-far)) (none) ) -(defmethod fire-gun sig ((obj sig) (arg0 vector)) +(defmethod fire-gun sig ((this sig) (arg0 vector)) "Increase gun fired counter and spawn projectile." - (+! (-> obj fired-gun-count) 1) + (+! (-> this fired-gun-count) 1) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options account-for-target-velocity proj-options-8000)) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (let* ((v1-11 *game-info*) (a0-10 (+ (-> v1-11 attack-id) 1)) ) @@ -762,62 +764,62 @@ (set! (-> s5-0 attack-id) a0-10) ) (set! (-> s5-0 timeout) (seconds 4)) - (vector<-cspace! (-> s5-0 pos) (-> obj node-list data 24)) + (vector<-cspace! (-> s5-0 pos) (-> this node-list data 24)) (set! (-> s5-0 vel quad) (-> arg0 quad)) (vector-! (-> s5-0 vel) (-> s5-0 vel) (-> s5-0 pos)) (vector-normalize! (-> s5-0 vel) 307200.0) - (spawn-projectile sig-shot s5-0 obj *default-dead-pool*) + (spawn-projectile sig-shot s5-0 this *default-dead-pool*) ) ) -(defmethod sig-method-258 sig ((obj sig)) +(defmethod sig-method-258 sig ((this sig)) (with-pp - (let ((f30-0 (-> obj nav state speed))) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 16384.0 28672.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-7 (= v1-7 (-> obj draw art-group data 3))) - (let ((v1-12 (-> obj skel root-channel 1))) + ((and v1-7 (= v1-7 (-> this draw art-group data 3))) + (let ((v1-12 (-> this skel root-channel 1))) (set! (-> v1-12 frame-interp 1) f28-0) (set! (-> v1-12 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 28672.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 24.0 (fmax f30-0 f0-8)) (* 30.0 f28-1))) - (a0-10 (-> obj skel root-channel 0)) + (a0-10 (-> this skel root-channel 0)) ) (set! (-> a0-10 param 0) f0-11) (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-11 (-> obj skel root-channel 1))) + (let ((a0-11 (-> this skel root-channel 1))) (set! (-> a0-11 param 0) 0.0) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 dist) 13107.2) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-13 param 0) 1.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-loop!) ) - (let ((a0-14 (-> obj skel root-channel 1))) + (let ((a0-14 (-> this skel root-channel 1))) (set! (-> a0-14 frame-interp 1) f28-0) (set! (-> a0-14 frame-interp 0) f28-0) (set! (-> a0-14 dist) 22937.6) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 8))) (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 8)) num-func-chan) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 8)) num-func-chan) ) ) ) @@ -827,24 +829,24 @@ ) ) -(defmethod enemy-method-77 sig ((obj sig) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 sig ((this sig) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (let* ((v1-3 (enemy-method-120 obj 3 (ash 1 (-> *sig-global-info* prev-blue-hit)))) - (s5-1 (-> obj draw art-group data (-> *sig-global-info* blue-hit-anim v1-3 anim-index))) + (let* ((v1-3 (enemy-method-120 this 3 (ash 1 (-> *sig-global-info* prev-blue-hit)))) + (s5-1 (-> this draw art-group data (-> *sig-global-info* blue-hit-anim v1-3 anim-index))) ) (set! (-> *sig-global-info* prev-blue-hit) v1-3) - (let ((v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-6 (= v1-6 (-> obj draw art-group data 22))) + (if (and v1-6 (= v1-6 (-> this draw art-group data 22))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-15 (-> obj skel root-channel 0))) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-15 param 1) 1.0) @@ -856,14 +858,14 @@ ) (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-18 (-> obj skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-18 (-> this skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-18 param 1) 1.0) (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) #t ) @@ -871,30 +873,30 @@ (let ((s4-0 (new 'stack-no-clear 'vector))) 0.0 0.0 - (vector-z-quaternion! s4-0 (-> obj root quat)) + (vector-z-quaternion! s4-0 (-> this root quat)) (let ((f30-0 (atan (-> s4-0 x) (-> s4-0 z)))) - (enemy-method-50 obj s4-0) + (enemy-method-50 this s4-0) (let* ((f0-14 (atan (-> s4-0 x) (-> s4-0 z))) (f0-15 (deg- f0-14 f30-0)) (f1-0 (fabs f0-15)) (s4-1 (cond ((>= 8192.0 f1-0) - (-> obj draw art-group data 16) + (-> this draw art-group data 16) ) ((>= f1-0 24576.0) - (-> obj draw art-group data 15) + (-> this draw art-group data 15) ) ((< f0-15 0.0) - (-> obj draw art-group data 17) + (-> this draw art-group data 17) ) (else - (-> obj draw art-group data 18) + (-> this draw art-group data 18) ) ) ) ) (ja-channel-push! 1 (seconds 0.03)) - (let ((a0-25 (-> obj skel root-channel 0))) + (let ((a0-25 (-> this skel root-channel 0))) (set! (-> a0-25 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-25 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-25 param 1) (-> arg0 0)) @@ -909,34 +911,34 @@ ) ) -(defmethod enemy-method-78 sig ((obj sig) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 sig ((this sig) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (-> obj draw art-group data 22) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (-> this draw art-group data 22) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) 1.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) ) (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 24))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 24))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 24)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 24)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) 1.0) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 24)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 24)) num-func-seek!) ) #t ) @@ -946,21 +948,21 @@ ) ) -(defmethod enemy-method-84 sig ((obj sig) (arg0 enemy-jump-info)) - (logclear! (-> obj bot-flags) (bot-flags bf23)) +(defmethod enemy-method-84 sig ((this sig) (arg0 enemy-jump-info)) + (logclear! (-> this bot-flags) (bot-flags bf23)) (let ((f1-0 (vector-vector-xz-distance (-> arg0 dest-pos) (-> arg0 start-pos))) (f2-1 (- (-> arg0 dest-pos y) (-> arg0 start-pos y))) ) 2048.0 (let* ((f0-2 -245760.0) - (v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) (f1-4 (cond - ((or (not (and v1-6 (= v1-6 (-> obj draw art-group data 3)))) (or (= (-> obj jump-why) 4) (>= f2-1 8192.0))) - (logior! (-> obj bot-flags) (bot-flags bf23)) + ((or (not (and v1-6 (= v1-6 (-> this draw art-group data 3)))) (or (= (-> this jump-why) 4) (>= f2-1 8192.0))) + (logior! (-> this bot-flags) (bot-flags bf23)) (let ((f2-3 (fmax 12288.0 (* 0.5 f1-0))) (f1-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) ) @@ -979,13 +981,13 @@ (none) ) -(defmethod enemy-method-86 sig ((obj sig)) +(defmethod enemy-method-86 sig ((this sig)) (let* ((t9-0 (method-of-type bot enemy-method-86)) - (v0-0 (t9-0 obj)) + (v0-0 (t9-0 this)) ) - (when (and (= (-> obj jump-why) 4) (not v0-0)) - (when (< (-> obj root transv y) 0.0) - (let* ((v1-11 (-> obj actor-group 0 data (-> obj platform-index) actor)) + (when (and (= (-> this jump-why) 4) (not v0-0)) + (when (< (-> this root transv y) 0.0) + (let* ((v1-11 (-> this actor-group 0 data (-> this platform-index) actor)) (a0-5 (if v1-11 (-> v1-11 extra process) ) @@ -993,10 +995,10 @@ ) (when a0-5 (let ((s4-0 (-> (the-as process-focusable a0-5) root trans)) - (s5-0 (-> obj root trans)) + (s5-0 (-> this root trans)) ) (when (< 2048.0 (- (-> s4-0 y) (-> s5-0 y))) - (vector-reset! (-> obj root transv)) + (vector-reset! (-> this root transv)) (let ((f30-0 9420.8)) (when (< f30-0 (vector-vector-xz-distance s4-0 s5-0)) (vector-! s5-0 s5-0 s4-0) @@ -1006,9 +1008,9 @@ ) ) (let ((a1-4 (new 'stack-no-clear 'collide-query))) - (find-ground (-> obj root) a1-4 (the-as collide-spec (-> obj gnd-collide)) 8192.0 81920.0 1024.0) + (find-ground (-> this root) a1-4 (the-as collide-spec (-> this gnd-collide)) 8192.0 81920.0 1024.0) ) - (set! (-> s5-0 y) (-> obj root gspot-pos y)) + (set! (-> s5-0 y) (-> this root gspot-pos y)) (set! v0-0 #t) ) ) @@ -1021,31 +1023,31 @@ ) ;; WARN: Return type mismatch object vs float. -(defmethod enemy-method-85 sig ((obj sig)) +(defmethod enemy-method-85 sig ((this sig)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((t9-0 (method-of-type bot enemy-method-85))) - (t9-0 obj) + (t9-0 this) ) (let ((s5-0 (static-sound-spec "sig-jland" :mask (reg0)))) - (set! (-> s5-0 reg 0) (the-as uint (-> obj root ground-pat material))) + (set! (-> s5-0 reg 0) (the-as uint (-> this root ground-pat material))) (sound-play-by-spec s5-0 (new-sound-id) (the-as vector #t)) ) (the-as float (cond - ((logtest? (bot-flags bf23) (-> obj bot-flags)) - (let ((v0-3 (the-as object (-> obj root transv)))) + ((logtest? (bot-flags bf23) (-> this bot-flags)) + (let ((v0-3 (the-as object (-> this root transv)))) (.svf (&-> (the-as vector v0-3) quad) vf0) v0-3 ) ) (else - (let ((v1-9 obj)) + (let ((v1-9 this)) (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) ) 0 - (let ((v1-11 obj)) + (let ((v1-11 this)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-11 enemy-flags))) (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-11 enemy-flags)))) ) @@ -1054,14 +1056,14 @@ ) 0 (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> obj root transv quad)) + (set! (-> s5-1 quad) (-> this root transv quad)) (set! (-> s5-1 y) 0.0) - (let ((v1-18 (-> obj nav state))) - (set! (-> v1-18 speed) (fmin (vector-length s5-1) (-> obj nav target-speed))) + (let ((v1-18 (-> this nav state))) + (set! (-> v1-18 speed) (fmin (vector-length s5-1) (-> this nav target-speed))) ) 0 (vector-xz-normalize! s5-1 16384.0) - (let ((v1-21 (-> obj nav state))) + (let ((v1-21 (-> this nav state))) (logior! (-> v1-21 flags) (nav-state-flag directional-mode)) (set! (-> v1-21 travel quad) (-> s5-1 quad)) ) @@ -1074,17 +1076,17 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-89 sig ((obj sig) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 sig ((this sig) (arg0 enemy-jump-info)) (the-as symbol - (when (logtest? (bot-flags bf23) (-> obj bot-flags)) - (let ((a0-2 (-> obj skel root-channel 0))) + (when (logtest? (bot-flags bf23) (-> this bot-flags)) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 param 0) 1.0) (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info jump-wind-up-anim))) - (a0-6 (-> obj skel root-channel 0)) + (let ((a1-3 (-> this draw art-group data (-> this enemy-info jump-wind-up-anim))) + (a0-6 (-> this skel root-channel 0)) ) (set! (-> a0-6 frame-group) (the-as art-joint-anim a1-3)) (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) @@ -1097,17 +1099,17 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-88 sig ((obj sig) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 sig ((this sig) (arg0 enemy-jump-info)) (the-as symbol - (when (logtest? (bot-flags bf23) (-> obj bot-flags)) - (let ((a0-2 (-> obj skel root-channel 0))) + (when (logtest? (bot-flags bf23) (-> this bot-flags)) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 param 0) 1.0) (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info jump-land-anim))) - (a0-6 (-> obj skel root-channel 0)) + (let ((a1-3 (-> this draw art-group data (-> this enemy-info jump-land-anim))) + (a0-6 (-> this skel root-channel 0)) ) (set! (-> a0-6 frame-group) (the-as art-joint-anim a1-3)) (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) @@ -1120,46 +1122,46 @@ ) ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! sig ((obj sig) (arg0 vector)) +(defmethod set-cam-height! sig ((this sig) (arg0 vector)) (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'failed)) + ((and (-> this next-state) (= (-> this next-state name) 'failed)) (set-vector! arg0 0.0 4096.0 28672.0 1.0) ) - ((focus-test? obj under-water) + ((focus-test? this under-water) (set-vector! arg0 0.0 12288.0 28672.0 1.0) ) (else (set-vector! arg0 0.0 20480.0 45056.0 1.0) ) ) - (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) (the-as meters - (if (focus-test? obj under-water) - (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) ) ) ) -(defmethod bot-method-216 sig ((obj sig)) - (set! (-> obj health-handle) (ppointer->handle (process-spawn hud-sig :init hud-init-by-other :to obj))) +(defmethod bot-method-216 sig ((this sig)) + (set! (-> this health-handle) (ppointer->handle (process-spawn hud-sig :init hud-init-by-other :to this))) 0 (none) ) ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod sig-method-249 sig ((obj sig) (arg0 sig-path)) - (set! (-> obj sig-path) arg0) - (set! (-> obj sig-path-clock) (-> *display* user0-clock)) - (set! (-> obj sig-path-start-time) (-> obj sig-path-clock frame-counter)) - (set! (-> obj sig-path-cur-time) (-> obj sig-path-start-time)) - (set! (-> obj sig-path-prev-time) (-> obj sig-path-start-time)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) +(defmethod sig-method-249 sig ((this sig) (arg0 sig-path)) + (set! (-> this sig-path) arg0) + (set! (-> this sig-path-clock) (-> *display* user0-clock)) + (set! (-> this sig-path-start-time) (-> this sig-path-clock frame-counter)) + (set! (-> this sig-path-cur-time) (-> this sig-path-start-time)) + (set! (-> this sig-path-prev-time) (-> this sig-path-start-time)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) (none) ) ;; WARN: Return type mismatch vector vs none. -(defmethod sig-method-248 sig ((obj sig) (arg0 sig-path-sample)) +(defmethod sig-method-248 sig ((this sig) (arg0 sig-path-sample)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -1167,16 +1169,16 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((a0-1 (-> obj sig-path-clock frame-counter))) - (when (!= (-> obj sig-path-cur-time) a0-1) - (set! (-> obj sig-path-prev-time) (-> obj sig-path-cur-time)) - (set! (-> obj sig-path-cur-time) a0-1) - (set! (-> obj event-param-point quad) (-> obj root trans quad)) + (let ((a0-1 (-> this sig-path-clock frame-counter))) + (when (!= (-> this sig-path-cur-time) a0-1) + (set! (-> this sig-path-prev-time) (-> this sig-path-cur-time)) + (set! (-> this sig-path-cur-time) a0-1) + (set! (-> this event-param-point quad) (-> this root trans quad)) ) ) - (let ((s3-0 (+ (-> obj sig-path sample-count) -1)) - (s2-0 (the int (* 0.05 (the float (- (-> obj sig-path-prev-time) (-> obj sig-path-start-time)))))) - (s4-0 (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))))) + (let ((s3-0 (+ (-> this sig-path sample-count) -1)) + (s2-0 (the int (* 0.05 (the float (- (-> this sig-path-prev-time) (-> this sig-path-start-time)))))) + (s4-0 (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time)))))) ) (if (< s3-0 s2-0) (set! s2-0 s3-0) @@ -1186,13 +1188,13 @@ ) (cond ((= s2-0 s4-0) - (mem-copy! (the-as pointer arg0) (the-as pointer (-> obj sig-path samples s2-0)) 64) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> this sig-path samples s2-0)) 64) ) (else - (mem-copy! (the-as pointer arg0) (the-as pointer (-> obj sig-path samples s4-0)) 64) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> this sig-path samples s4-0)) 64) (let ((v1-22 0)) (countdown (a0-9 (- s4-0 s2-0)) - (set! v1-22 (logior v1-22 (logand (-> obj sig-path samples (+ a0-9 s2-0) flags) 3))) + (set! v1-22 (logior v1-22 (logand (-> this sig-path samples (+ a0-9 s2-0) flags) 3))) ) (logior! (-> arg0 flags) v1-22) ) @@ -1200,9 +1202,9 @@ ) (when (< s4-0 s3-0) (let* ((f0-6 0.05) - (f1-5 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))) + (f1-5 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time)))) (f30-0 (* f0-6 (- f1-5 (* (the float (the int (/ f1-5 20.0))) 20.0)))) - (v1-30 (-> obj sig-path samples)) + (v1-30 (-> this sig-path samples)) (s3-1 (-> v1-30 s4-0)) (s4-1 (-> v1-30 (+ s4-0 1))) (s2-1 (-> arg0 flags)) @@ -1211,9 +1213,9 @@ (quaternion-slerp! (-> arg0 quat) (-> s3-1 quat) (-> s4-1 quat) f30-0) (set! (-> arg0 flags) s2-1) ) - (vector-! (-> obj root transv) (-> arg0 pos) (-> obj event-param-point)) - (let ((v0-5 (-> obj root transv))) - (.lvf vf1 (&-> (-> obj root transv) quad)) + (vector-! (-> this root transv) (-> arg0 pos) (-> this event-param-point)) + (let ((v0-5 (-> this root transv))) + (.lvf vf1 (&-> (-> this root transv) quad)) (let ((f0-7 (-> pp clock frames-per-second))) (.mov at-0 f0-7) ) @@ -1229,9 +1231,9 @@ ) ) -(defmethod sig-method-256 sig ((obj sig)) - (let* ((v1-3 (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))))) - (v1-4 (- (+ (-> obj sig-path sample-count) -1) v1-3)) +(defmethod sig-method-256 sig ((this sig)) + (let* ((v1-3 (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time)))))) + (v1-4 (- (+ (-> this sig-path sample-count) -1) v1-3)) ) (if (<= v1-4 0) 0 @@ -1241,22 +1243,22 @@ (none) ) -(defmethod sig-method-257 sig ((obj sig)) - (>= (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time))))) - (+ (-> obj sig-path sample-count) -1) +(defmethod sig-method-257 sig ((this sig)) + (>= (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time))))) + (+ (-> this sig-path sample-count) -1) ) ) -(defmethod sig-method-250 sig ((obj sig)) +(defmethod sig-method-250 sig ((this sig)) (local-vars (a2-7 float) (a2-14 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) (let ((s5-0 (new 'stack-no-clear 'sphere))) - (let ((v1-4 (+ (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time))))) 2)) - (a0-3 (-> obj sig-path sample-count)) - (a1-1 (-> obj sig-path samples)) + (let ((v1-4 (+ (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time))))) 2)) + (a0-3 (-> this sig-path sample-count)) + (a1-1 (-> this sig-path samples)) ) (while (< v1-4 a0-3) (let ((a2-1 (-> a1-1 v1-4))) @@ -1385,7 +1387,7 @@ ) (cond (s4-0 - (fire-gun obj (get-trans (the-as process-focusable s4-0) 3)) + (fire-gun this (get-trans (the-as process-focusable s4-0) 3)) #t ) (else @@ -1397,47 +1399,47 @@ ) ) -(defmethod draw hud-sig ((obj hud-sig)) +(defmethod draw hud-sig ((this hud-sig)) (set-hud-piece-position! - (-> obj sprites 2) - (the int (+ 30.0 (* -130.0 (-> obj offset)))) - (the int (+ 30.0 (* -100.0 (-> obj offset)))) + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 15 2) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 15 2) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-sig ((obj hud-sig)) - (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-sig ((this hud-sig)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-sig ((obj hud-sig)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-sig ((this hud-sig)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 scale-x) 12.0) - (set! (-> obj sprites 0 scale-y) 11.2) - (set! (-> obj sprites 0 pos z) #xfffff2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 3 tex) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tex) (lookup-texture-by-name "hud-sig-head" (the-as string #f) (the-as (pointer texture-page) #f)) ) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.4) - (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.4) + (set! (-> this sprites 3 pos z) #xffffff) 0 (none) ) diff --git a/goal_src/jak2/levels/common/airlock.gc b/goal_src/jak2/levels/common/airlock.gc index e2ed65efa3..cda2f660af 100644 --- a/goal_src/jak2/levels/common/airlock.gc +++ b/goal_src/jak2/levels/common/airlock.gc @@ -64,49 +64,49 @@ ) -(defmethod deactivate com-airlock ((obj com-airlock)) - (process-entity-status! obj (entity-perm-status subtask-complete) #f) - (if (nonzero? (-> obj sound-id)) - (sound-stop (-> obj sound-id)) +(defmethod deactivate com-airlock ((this com-airlock)) + (process-entity-status! this (entity-perm-status subtask-complete) #f) + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) ) - (if (nonzero? (-> obj gear-sound-id)) - (sound-stop (-> obj gear-sound-id)) + (if (nonzero? (-> this gear-sound-id)) + (sound-stop (-> this gear-sound-id)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs com-airlock. -(defmethod relocate com-airlock ((obj com-airlock) (arg0 int)) - (if (nonzero? (-> obj gear)) - (&+! (-> obj gear) arg0) +(defmethod relocate com-airlock ((this com-airlock) (arg0 int)) + (if (nonzero? (-> this gear)) + (&+! (-> this gear) arg0) ) - (the-as com-airlock ((method-of-type process-drawable relocate) obj arg0)) + (the-as com-airlock ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod init-airlock! com-airlock ((obj com-airlock)) - (process-entity-status! obj (entity-perm-status subtask-complete) #f) - (process-drawable-from-entity! obj (-> obj entity)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj were-behind?) #f) - (set! (-> obj inner?) - (logtest? (the-as int (res-lump-value (-> obj entity) 'options uint128 :time -1000000000.0)) 1) +(defmethod init-airlock! com-airlock ((this com-airlock)) + (process-entity-status! this (entity-perm-status subtask-complete) #f) + (process-drawable-from-entity! this (-> this entity)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this were-behind?) #f) + (set! (-> this inner?) + (logtest? (the-as int (res-lump-value (-> this entity) 'options uint128 :time -1000000000.0)) 1) ) - (set! (-> obj sound-behind?) #f) - (set! (-> obj saw-pilot?) (the-as handle #f)) - (set! (-> obj open-frame) 0.0) - (set! (-> obj pre-open-frame) 0.0) - (set! (-> obj lock-frame) 0.0) - (set! (-> obj pre-open-speed) 2.0) - (set! (-> obj open-distance) (res-lump-float (-> obj entity) 'distance :default 143360.0)) - (set! (-> obj active-distance) - (res-lump-float (-> obj entity) 'idle-distance :default (+ 143360.0 (-> obj open-distance))) + (set! (-> this sound-behind?) #f) + (set! (-> this saw-pilot?) (the-as handle #f)) + (set! (-> this open-frame) 0.0) + (set! (-> this pre-open-frame) 0.0) + (set! (-> this lock-frame) 0.0) + (set! (-> this pre-open-speed) 2.0) + (set! (-> this open-distance) (res-lump-float (-> this entity) 'distance :default 143360.0)) + (set! (-> this active-distance) + (res-lump-float (-> this entity) 'idle-distance :default (+ 143360.0 (-> this open-distance))) ) - (set! (-> obj y-height) (res-lump-data (-> obj entity) 'height vector)) - (set! (-> obj level-name) (res-lump-struct (-> obj entity) 'on-notice pair)) - (set! (-> obj open-test) + (set! (-> this y-height) (res-lump-data (-> this entity) 'height vector)) + (set! (-> this level-name) (res-lump-struct (-> this entity) 'on-notice pair)) + (set! (-> this open-test) (the-as pair ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'open-test 'interp -1000000000.0 @@ -116,48 +116,48 @@ ) ) ) - (set! (-> obj sound-gear) #f) - (set! (-> obj sound-pre-open) #f) - (set! (-> obj sound-pre-open-stop) #f) - (set! (-> obj sound-lock-loop) #f) - (set! (-> obj sound-lock-stop) #f) - (set! (-> obj sound-post-close) #f) - (set! (-> obj sound-post-close-stop) #f) - (set! (-> obj sound-open) #f) - (set! (-> obj sound-close) #f) - (set! (-> obj sound-open-loop) #f) - (set! (-> obj sound-close-loop) #f) - (set! (-> obj sound-open-stop) #f) - (set! (-> obj sound-close-stop) #f) - (set! (-> obj door-radius) 20480.0) - obj + (set! (-> this sound-gear) #f) + (set! (-> this sound-pre-open) #f) + (set! (-> this sound-pre-open-stop) #f) + (set! (-> this sound-lock-loop) #f) + (set! (-> this sound-lock-stop) #f) + (set! (-> this sound-post-close) #f) + (set! (-> this sound-post-close-stop) #f) + (set! (-> this sound-open) #f) + (set! (-> this sound-close) #f) + (set! (-> this sound-open-loop) #f) + (set! (-> this sound-close-loop) #f) + (set! (-> this sound-open-stop) #f) + (set! (-> this sound-close-stop) #f) + (set! (-> this door-radius) 20480.0) + this ) -(defmethod check-crossing-distance com-airlock ((obj com-airlock) (arg0 vector) (arg1 symbol)) - (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj root trans))) +(defmethod check-crossing-distance com-airlock ((this com-airlock) (arg0 vector) (arg1 symbol)) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) ) (set! (-> s4-1 y) 0.0) (let ((f30-0 (vector-dot s4-1 s5-0))) (cond ((not arg1) ) - ((or (< (vector-vector-xz-distance (-> obj root trans) arg0) 40960.0) + ((or (< (vector-vector-xz-distance (-> this root trans) arg0) 40960.0) (< 0.7 (fabs (vector-dot s5-0 (vector-normalize! s4-1 1.0)))) ) - (when (and (< f30-0 0.0) (< 0.0 (-> obj last-distance))) - (let ((s5-1 (res-lump-struct (-> obj entity) 'on-cross structure))) + (when (and (< f30-0 0.0) (< 0.0 (-> this last-distance))) + (let ((s5-1 (res-lump-struct (-> this entity) 'on-cross structure))) (if s5-1 (script-eval (the-as pair s5-1)) ) ) ) - (set! (-> obj last-distance) f30-0) + (set! (-> this last-distance) f30-0) ) - ((< 0.0 (-> obj last-distance)) + ((< 0.0 (-> this last-distance)) (set! f30-0 (fmax 4096.0 f30-0)) ) - ((< (-> obj last-distance) 0.0) + ((< (-> this last-distance) 0.0) (set! f30-0 (fmin -4096.0 f30-0)) ) ) @@ -167,45 +167,45 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod want-cross-airlock? com-airlock ((obj com-airlock)) +(defmethod want-cross-airlock? com-airlock ((this com-airlock)) (local-vars (a0-12 entity-actor)) (let* ((tgt (target-pos 0)) - (f30-0 (check-crossing-distance obj tgt #t)) - (s5-0 (>= (-> obj latch-open-time) (current-time))) + (f30-0 (check-crossing-distance this tgt #t)) + (s5-0 (>= (-> this latch-open-time) (current-time))) ) (the-as symbol - (and (or s5-0 (< (vector-vector-xz-distance (-> obj root trans) tgt) (-> obj active-distance))) - (or s5-0 (not (-> obj y-height)) (and (>= (-> tgt y) (- (-> obj root trans y) (-> obj y-height y))) - (< (-> tgt y) (+ (-> obj root trans y) (-> obj y-height x))) + (and (or s5-0 (< (vector-vector-xz-distance (-> this root trans) tgt) (-> this active-distance))) + (or s5-0 (not (-> this y-height)) (and (>= (-> tgt y) (- (-> this root trans y) (-> this y-height y))) + (< (-> tgt y) (+ (-> this root trans y) (-> this y-height x))) ) ) (begin - (if (and (not (-> obj were-behind?)) (and (< f30-0 0.0) (-> obj inner?))) - (set! (-> obj were-behind?) #t) + (if (and (not (-> this were-behind?)) (and (< f30-0 0.0) (-> this inner?))) + (set! (-> this were-behind?) #t) ) - (and (< (-> obj latch-closed-time) (current-time)) + (and (< (-> this latch-closed-time) (current-time)) (or (not (and *target* (focus-test? *target* pilot teleporting))) (< f30-0 -409.6)) - (or (and (< f30-0 (-> obj open-distance)) - (or (not (-> obj were-behind?)) (< f30-0 20480.0)) + (or (and (< f30-0 (-> this open-distance)) + (or (not (-> this were-behind?)) (< f30-0 20480.0)) (and (or (< 409.6 f30-0) (begin - (let ((a0-11 (-> obj entity))) + (let ((a0-11 (-> this entity))) (set! a0-12 (entity-actor-lookup a0-11 'next-actor 0)) ) (not a0-12) ) (logtest? (-> a0-12 extra perm status) (entity-perm-status subtask-complete)) ) - (and (script-eval (-> obj open-test)) (-> *setting-control* user-current airlock)) + (and (script-eval (-> this open-test)) (-> *setting-control* user-current airlock)) ) ) s5-0 - (let ((f0-8 (check-crossing-distance obj (camera-pos) #f))) + (let ((f0-8 (check-crossing-distance this (camera-pos) #f))) (and (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status in-head)))) (or (< (* f30-0 f0-8) 0.0) (and (< (fabs f0-8) 4096.0) - (< (vector-vector-xz-distance (camera-pos) (-> obj root trans)) (-> obj door-radius)) + (< (vector-vector-xz-distance (camera-pos) (-> this root trans)) (-> this door-radius)) ) ) ) @@ -218,8 +218,8 @@ ) ) -(defmethod destination-loaded? com-airlock ((obj com-airlock) (display? symbol)) - (let ((level-list (the-as pair (script-eval (-> obj level-name)))) +(defmethod destination-loaded? com-airlock ((this com-airlock) (display? symbol)) + (let ((level-list (the-as pair (script-eval (-> this level-name)))) (borrow-lev-name #f) ) (cond @@ -292,23 +292,23 @@ ) ) -(defmethod rotate-gear! com-airlock ((obj com-airlock) (arg0 float)) - (when (nonzero? (-> obj gear)) - (if (and (zero? (-> obj gear-sound-id)) - (-> obj sound-gear) - (and (-> obj next-state) (= (-> obj next-state name) 'open)) - (>= (check-crossing-distance obj (target-pos 0) #f) 0.0) +(defmethod rotate-gear! com-airlock ((this com-airlock) (arg0 float)) + (when (nonzero? (-> this gear)) + (if (and (zero? (-> this gear-sound-id)) + (-> this sound-gear) + (and (-> this next-state) (= (-> this next-state name) 'open)) + (>= (check-crossing-distance this (target-pos 0) #f) 0.0) ) - (set! (-> obj gear-sound-id) (sound-play-by-spec (-> obj sound-gear) (new-sound-id) (the-as vector #t))) + (set! (-> this gear-sound-id) (sound-play-by-spec (-> this sound-gear) (new-sound-id) (the-as vector #t))) ) - (seek! (-> obj gear-rotv) arg0 (* 131072.0 (seconds-per-frame))) - (+! (-> obj gear-rot) (* (-> obj gear-rotv) (seconds-per-frame))) - (twist-set! (-> obj gear) (the-as float #f) (the-as float #f) (-> obj gear-rot)) + (seek! (-> this gear-rotv) arg0 (* 131072.0 (seconds-per-frame))) + (+! (-> this gear-rot) (* (-> this gear-rotv) (seconds-per-frame))) + (twist-set! (-> this gear) (the-as float #f) (the-as float #f) (-> this gear-rot)) ) - (-> obj gear-rotv) + (-> this gear-rotv) ) -(defmethod play-city-voice-sound com-airlock ((obj com-airlock) (arg0 symbol)) +(defmethod play-city-voice-sound com-airlock ((this com-airlock) (arg0 symbol)) (let ((gp-0 (the-as (array string) #f))) (case arg0 (('enter) @@ -319,11 +319,11 @@ ) ) (cond - ((and gp-0 (>= (- (current-time) (-> obj spool-sound-time)) (seconds 2))) - (set! (-> obj spool-sound-time) (current-time)) + ((and gp-0 (>= (- (current-time) (-> this spool-sound-time)) (seconds 2))) + (set! (-> this spool-sound-time) (current-time)) (add-process *gui-control* - obj + this (gui-channel alert) (gui-action play) (-> (the-as (array string) (+ (* (rand-vu-int-range 0 (+ (-> gp-0 length) -1)) 4) (the-as int gp-0))) 0) @@ -777,7 +777,7 @@ ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! com-airlock-outer ((obj com-airlock-outer) (arg0 entity-actor)) +(defmethod init-from-entity! com-airlock-outer ((this com-airlock-outer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -785,8 +785,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -815,27 +815,27 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (init-airlock! obj) + (init-airlock! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-com-airlock-outer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj pre-open-frame) 35.0) - (set! (-> obj lock-frame) 45.0) - (set! (-> obj open-frame) 45.0) - (set! (-> obj sound-pre-open) (static-sound-spec "airlock-slider")) - (set! (-> obj sound-pre-open-stop) (static-sound-spec "airlock-slide-e")) - (set! (-> obj sound-open) (static-sound-spec "airlock-seal")) - (set! (-> obj sound-open-loop) (static-sound-spec "airlock-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "airlock-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "airlock-open")) - (set! (-> obj sound-close-stop) (static-sound-spec "airlock-hit")) - (set! (-> obj sound-post-close) (static-sound-spec "airlock-slider")) - (set! (-> obj sound-post-close-stop) (static-sound-spec "airlock-slide-e")) - (go (method-of-object obj close) #t) + (set! (-> this pre-open-frame) 35.0) + (set! (-> this lock-frame) 45.0) + (set! (-> this open-frame) 45.0) + (set! (-> this sound-pre-open) (static-sound-spec "airlock-slider")) + (set! (-> this sound-pre-open-stop) (static-sound-spec "airlock-slide-e")) + (set! (-> this sound-open) (static-sound-spec "airlock-seal")) + (set! (-> this sound-open-loop) (static-sound-spec "airlock-open")) + (set! (-> this sound-open-stop) (static-sound-spec "airlock-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "airlock-open")) + (set! (-> this sound-close-stop) (static-sound-spec "airlock-hit")) + (set! (-> this sound-post-close) (static-sound-spec "airlock-slider")) + (set! (-> this sound-post-close-stop) (static-sound-spec "airlock-slide-e")) + (go (method-of-object this close) #t) (none) ) @@ -849,7 +849,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! com-airlock-inner ((obj com-airlock-inner) (arg0 entity-actor)) +(defmethod init-from-entity! com-airlock-inner ((this com-airlock-inner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -857,8 +857,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -887,35 +887,35 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-com-airlock-inner" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj lock-frame) 37.0) - (set! (-> obj pre-open-frame) 65.0) - (set! (-> obj open-frame) 75.0) - (set! (-> obj gear) (new 'process 'joint-mod (joint-mod-mode rotate) obj 12)) - (set! (-> obj inner?) - (logtest? (the-as int (res-lump-value (-> obj entity) 'options uint128 :default (the-as uint128 1) :time -1000000000.0)) + (init-airlock! this) + (set! (-> this lock-frame) 37.0) + (set! (-> this pre-open-frame) 65.0) + (set! (-> this open-frame) 75.0) + (set! (-> this gear) (new 'process 'joint-mod (joint-mod-mode rotate) this 12)) + (set! (-> this inner?) + (logtest? (the-as int (res-lump-value (-> this entity) 'options uint128 :default (the-as uint128 1) :time -1000000000.0)) 1 ) ) - (set! (-> obj pre-open-speed) 0.9) - (set! (-> obj sound-gear) (static-sound-spec "airlock-gear")) - (set! (-> obj sound-pre-open) (static-sound-spec "airlock-slider")) - (set! (-> obj sound-pre-open-stop) (static-sound-spec "airlock-slide-e")) - (set! (-> obj sound-lock-loop) (static-sound-spec "airlock-turn")) - (set! (-> obj sound-lock-stop) (static-sound-spec "airlock-unlock")) - (set! (-> obj sound-open) (static-sound-spec "airlock-seal")) - (set! (-> obj sound-open-loop) (static-sound-spec "airlock-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "airlock-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "airlock-open")) - (set! (-> obj sound-close-stop) (static-sound-spec "airlock-hit")) - (go (method-of-object obj close) #t) + (set! (-> this pre-open-speed) 0.9) + (set! (-> this sound-gear) (static-sound-spec "airlock-gear")) + (set! (-> this sound-pre-open) (static-sound-spec "airlock-slider")) + (set! (-> this sound-pre-open-stop) (static-sound-spec "airlock-slide-e")) + (set! (-> this sound-lock-loop) (static-sound-spec "airlock-turn")) + (set! (-> this sound-lock-stop) (static-sound-spec "airlock-unlock")) + (set! (-> this sound-open) (static-sound-spec "airlock-seal")) + (set! (-> this sound-open-loop) (static-sound-spec "airlock-open")) + (set! (-> this sound-open-stop) (static-sound-spec "airlock-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "airlock-open")) + (set! (-> this sound-close-stop) (static-sound-spec "airlock-hit")) + (go (method-of-object this close) #t) (none) ) @@ -934,7 +934,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-entry-gate ((obj fort-entry-gate) (arg0 entity-actor)) +(defmethod init-from-entity! fort-entry-gate ((this fort-entry-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -942,8 +942,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -972,19 +972,19 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-entry-gate" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "door-stop-open")) - (set! (-> obj sound-close-loop) (static-sound-spec "door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "door-stop-close")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "door-stop-open")) + (set! (-> this sound-close-loop) (static-sound-spec "door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "door-stop-close")) + (go (method-of-object this close) #t) (none) ) @@ -1003,7 +1003,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-door-a ((obj hip-door-a) (arg0 entity-actor)) +(defmethod init-from-entity! hip-door-a ((this hip-door-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1011,8 +1011,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1041,20 +1041,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-door-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (set! (-> obj door-radius) 8192.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> this door-radius) 8192.0) + (go (method-of-object this close) #t) (none) ) @@ -1074,7 +1074,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-mar-door ((obj tomb-mar-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-mar-door ((this tomb-mar-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1082,8 +1082,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1099,19 +1099,19 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-mar-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wing-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wing-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wing-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wing-close-hit")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wing-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wing-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wing-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wing-close-hit")) + (go (method-of-object this close) #t) (none) ) @@ -1140,7 +1140,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-throne-door ((obj pal-throne-door) (arg0 entity-actor)) +(defmethod init-from-entity! pal-throne-door ((this pal-throne-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1148,8 +1148,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1178,20 +1178,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-throne-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-slide")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-door-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-slide")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-door-hit")) - (set! (-> obj sound-behind?) #t) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-slide")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-door-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-slide")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-door-hit")) + (set! (-> this sound-behind?) #t) + (go (method-of-object this close) #t) (none) ) @@ -1210,7 +1210,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-door-ctyinda ((obj vin-door-ctyinda) (arg0 entity-actor)) +(defmethod init-from-entity! vin-door-ctyinda ((this vin-door-ctyinda) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1218,8 +1218,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1248,20 +1248,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-door-ctyinda" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (set! (-> obj door-radius) 8192.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> this door-radius) 8192.0) + (go (method-of-object this close) #t) (none) ) @@ -1280,7 +1280,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-door ((obj under-door) (arg0 entity-actor)) +(defmethod init-from-entity! under-door ((this under-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1288,8 +1288,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1318,20 +1318,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (set! (-> obj door-radius) 8192.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> this door-radius) 8192.0) + (go (method-of-object this close) #t) (none) ) @@ -1350,7 +1350,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! oracle-door ((obj oracle-door) (arg0 entity-actor)) +(defmethod init-from-entity! oracle-door ((this oracle-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1358,8 +1358,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1388,18 +1388,18 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-oracle-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (go (method-of-object this close) #t) (none) ) diff --git a/goal_src/jak2/levels/common/battle.gc b/goal_src/jak2/levels/common/battle.gc index bfa4284010..1f255f25c8 100644 --- a/goal_src/jak2/levels/common/battle.gc +++ b/goal_src/jak2/levels/common/battle.gc @@ -813,10 +813,10 @@ ) ) -(defmethod draw-battle-marks battle ((obj battle)) +(defmethod draw-battle-marks battle ((this battle)) (local-vars (sv-16 string) (sv-32 string)) - (let ((s4-0 (-> obj root trans)) - (s5-0 (the-as int (-> obj max-count))) + (let ((s4-0 (-> this root trans)) + (s5-0 (the-as int (-> this max-count))) ) (if (= (the-as uint s5-0) #x20000000) (set! s5-0 0) @@ -829,21 +829,21 @@ (format (clear *temp-string*) "~%~S~%count ~d/~d~%child ~d~%ally ~d" - (-> obj name) - (-> obj count) + (-> this name) + (-> this count) s5-0 - (-> obj stat-child-count) - (-> obj allies length) + (-> this stat-child-count) + (-> this allies length) ) (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* s4-0 (font-color orange) (the-as vector2h #f)) ) ) - (dotimes (s5-1 (-> obj spawners length)) - (let ((s4-1 (-> obj spawners data s5-1))) + (dotimes (s5-1 (-> this spawners length)) + (let ((s4-1 (-> this spawners data s5-1))) (#when PC_PORT ;; og:preserve-this added. a battle may have enemies from an unloaded level in its ally list (e.g. atoll battle has atollext enemies). (if (not (valid? (-> s4-1 entity) entity-actor "battle spawners" #f *stdcon*)) - (deactivate obj)) + (deactivate this)) ) (let ((a0-6 (-> s4-1 intro-path))) (if a0-6 @@ -883,18 +883,18 @@ (none) ) -(defmethod spawner-blocked-by-collide? battle ((obj battle) (arg0 battle-spawner)) +(defmethod spawner-blocked-by-collide? battle ((this battle) (arg0 battle-spawner)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) (let ((gp-0 (new 'stack-no-clear 'vector)) - (f0-0 (-> obj info spawner-blocked-by-collide-radius)) + (f0-0 (-> this info spawner-blocked-by-collide-radius)) ) (set! (-> gp-0 quad) (-> arg0 attack-pos quad)) (set! (-> gp-0 w) f0-0) - (let ((s5-0 (-> obj info spawner-collide-with)) + (let ((s5-0 (-> this info spawner-collide-with)) (f30-0 (* f0-0 f0-0)) ) (set! *actor-list-length* 0) @@ -998,15 +998,15 @@ ) ) -(defmethod spawner-blocked? battle ((obj battle) (arg0 battle-spawner)) - (when (not (logtest? (-> obj flags) (battle-flags no-spawner-block))) - (let ((f0-0 (-> obj info spawner-blocked-by-player-xz))) +(defmethod spawner-blocked? battle ((this battle) (arg0 battle-spawner)) + (when (not (logtest? (-> this flags) (battle-flags no-spawner-block))) + (let ((f0-0 (-> this info spawner-blocked-by-player-xz))) (if (and (< 0.0 f0-0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 attack-pos)))) (return #t) ) ) - (let ((f0-3 (-> obj info spawner-blocked-by-collide-radius))) - (if (and (< 0.0 f0-3) (spawner-blocked-by-collide? obj arg0)) + (let ((f0-3 (-> this info spawner-blocked-by-collide-radius))) + (if (and (< 0.0 f0-3) (spawner-blocked-by-collide? this arg0)) (return #t) ) ) @@ -1014,15 +1014,15 @@ #f ) -(defmethod spawner-free? battle ((obj battle) (arg0 battle-spawner)) +(defmethod spawner-free? battle ((this battle) (arg0 battle-spawner)) (and (not (handle->process (-> arg0 creature))) - (or (>= (-> arg0 ready-index) 0) (not (spawner-blocked? obj arg0))) + (or (>= (-> arg0 ready-index) 0) (not (spawner-blocked? this arg0))) ) ) -(defmethod get-best-spawner battle ((obj battle)) - (let ((s5-0 (-> obj spawners length)) - (v1-2 (-> obj info pick-logic)) +(defmethod get-best-spawner battle ((this battle)) + (let ((s5-0 (-> this spawners length)) + (v1-2 (-> this info pick-logic)) ) (if (not *target*) (set! v1-2 0) @@ -1031,8 +1031,8 @@ ((zero? v1-2) (let ((s3-0 (rand-vu-int-count s5-0))) (dotimes (s4-0 s5-0) - (let ((s2-0 (-> obj spawners data s3-0))) - (if (spawner-free? obj s2-0) + (let ((s2-0 (-> this spawners data s3-0))) + (if (spawner-free? this s2-0) (return s2-0) ) ) @@ -1046,10 +1046,10 @@ ) (while (nonzero? s5-0) (+! s5-0 -1) - (let ((s3-1 (-> obj spawners data s5-0))) - (when (spawner-free? obj s3-1) + (let ((s3-1 (-> this spawners data s5-0))) + (when (spawner-free? this s3-1) (let ((f0-0 (vector-vector-distance (target-pos 0) (-> s3-1 entity extra trans)))) - (when (and (>= (-> obj info pick-spawner-max-dist) f0-0) (or (< f30-0 0.0) (< f0-0 f30-0))) + (when (and (>= (-> this info pick-spawner-max-dist) f0-0) (or (< f30-0 0.0) (< f0-0 f30-0))) (set! s4-1 s5-0) (set! f30-0 f0-0) ) @@ -1058,7 +1058,7 @@ ) ) (if (< 0.0 f30-0) - (return (-> obj spawners data s4-1)) + (return (-> this spawners data s4-1)) ) ) ) @@ -1067,7 +1067,7 @@ (the-as battle-spawner #f) ) -(defmethod get-random-breed battle ((obj battle) (arg0 battle-spawner)) +(defmethod get-random-breed battle ((this battle) (arg0 battle-spawner)) (let ((f0-0 (rand-vu)) (v1-0 0) ) @@ -1086,14 +1086,14 @@ ) ;; WARN: Return type mismatch int vs handle. -(defmethod spawn-from-breed battle ((obj battle) (arg0 battle-breed) (arg1 enemy-init-by-other-params)) +(defmethod spawn-from-breed battle ((this battle) (arg0 battle-breed) (arg1 enemy-init-by-other-params)) (let* ((s3-0 (-> arg0 breed-type)) (s4-0 (get-process *default-dead-pool* s3-0 #x4000)) (v1-1 (when s4-0 (let ((t9-1 (method-of-type process activate))) - (t9-1 s4-0 obj (symbol->string (-> s3-0 symbol)) (the-as pointer #x70004000)) + (t9-1 s4-0 this (symbol->string (-> s3-0 symbol)) (the-as pointer #x70004000)) ) - (run-now-in-process s4-0 enemy-init-by-other obj arg1) + (run-now-in-process s4-0 enemy-init-by-other this arg1) (-> s4-0 ppointer) ) ) @@ -1101,13 +1101,13 @@ (if (not v1-1) (return (the-as handle #f)) ) - (+! (-> obj count) 1) + (+! (-> this count) 1) (the-as handle (ppointer->handle v1-1)) ) ) ;; WARN: Return type mismatch handle vs none. -(defmethod spawn-from-spawner battle ((obj battle) (arg0 battle-spawner) (arg1 symbol)) +(defmethod spawn-from-spawner battle ((this battle) (arg0 battle-spawner) (arg1 symbol)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'quaternion)) (s2-0 (-> arg0 intro-path)) @@ -1148,14 +1148,14 @@ ) (let ((s1-1 (new 'stack-no-clear 'enemy-init-by-other-params)) (s2-1 (!= s2-0 #f)) - (s0-1 (get-random-breed obj arg0)) + (s0-1 (get-random-breed this arg0)) ) (set! (-> s1-1 trans quad) (-> s3-0 quad)) (quaternion-copy! (-> s1-1 quat) s4-0) (set! (-> s1-1 entity) (-> arg0 entity)) (set! (-> s1-1 directed?) #t) (set! (-> s1-1 no-initial-move-to-ground?) s2-1) - (let ((v0-7 (spawn-from-breed obj s0-1 s1-1))) + (let ((v0-7 (spawn-from-breed this s0-1 s1-1))) (when (handle->process v0-7) (set! (-> arg0 creature) v0-7) (set! (-> arg0 mode) (the-as uint 1)) @@ -1167,15 +1167,15 @@ (none) ) -(defmethod get-spawner-for-enemy battle ((obj battle) (arg0 process)) +(defmethod get-spawner-for-enemy battle ((this battle) (arg0 process)) (let ((v1-0 (if (type? arg0 nav-enemy) (the-as nav-enemy arg0) ) ) ) (when v1-0 - (dotimes (a0-3 (-> obj spawners length)) - (let* ((a1-5 (-> obj spawners data a0-3)) + (dotimes (a0-3 (-> this spawners length)) + (let* ((a1-5 (-> this spawners data a0-3)) (a2-2 (handle->process (-> a1-5 creature))) ) (when (and a2-2 (= a2-2 v1-0)) @@ -1192,8 +1192,8 @@ (the-as battle-spawner #f) ) -(defmethod spawner-active? battle ((obj battle) (arg0 battle-spawner) (arg1 symbol)) - (when (and (logtest? (-> obj flags) (battle-flags active)) (not (logtest? (-> obj flags) (battle-flags beaten)))) +(defmethod spawner-active? battle ((this battle) (arg0 battle-spawner) (arg1 symbol)) + (when (and (logtest? (-> this flags) (battle-flags active)) (not (logtest? (-> this flags) (battle-flags beaten)))) (let ((v1-5 (-> arg0 noticed-attack-time))) (cond ((zero? v1-5) @@ -1222,13 +1222,13 @@ ((zero? v1-20) (when (or (logtest? (enemy-flag victory) (-> (the-as enemy s4-0) enemy-flags)) (not arg1)) (cond - ((spawner-in-intro? obj arg0) - (if (not (spawner-try-jump obj arg0 (the-as enemy s4-0))) + ((spawner-in-intro? this arg0) + (if (not (spawner-try-jump this arg0 (the-as enemy s4-0))) (return #t) ) ) - ((spawner-hittable? obj arg0) - (spawner-hit obj arg0 (the-as enemy s4-0)) + ((spawner-hittable? this arg0) + (spawner-hit this arg0 (the-as enemy s4-0)) ) ) ) @@ -1240,7 +1240,7 @@ #f ) -(defmethod spawner-in-intro? battle ((obj battle) (arg0 battle-spawner)) +(defmethod spawner-in-intro? battle ((this battle) (arg0 battle-spawner)) (when (-> arg0 intro-path) (let ((v1-1 (-> arg0 creature-index)) (a0-1 (-> arg0 attack-index)) @@ -1250,11 +1250,11 @@ ) ) -(defmethod spawner-try-jump battle ((obj battle) (arg0 battle-spawner) (arg1 enemy)) +(defmethod spawner-try-jump battle ((this battle) (arg0 battle-spawner) (arg1 enemy)) (let ((s3-0 (+ (-> arg0 creature-index) 1)) (s4-0 (new 'stack-no-clear 'vector)) ) - (if (and (= s3-0 (-> arg0 attack-index)) (spawner-blocked? obj arg0)) + (if (and (= s3-0 (-> arg0 attack-index)) (spawner-blocked? this arg0)) (return #f) ) (get-point-in-path! (-> arg0 intro-path) s4-0 (the float s3-0) 'exact) @@ -1274,7 +1274,7 @@ ) ) -(defmethod spawner-hittable? battle ((obj battle) (arg0 battle-spawner)) +(defmethod spawner-hittable? battle ((this battle) (arg0 battle-spawner)) (when (logtest? (-> arg0 flags) (battle-spawner-flags hit)) (if (-> arg0 intro-path) (>= (-> arg0 creature-index) (-> arg0 attack-index)) @@ -1283,7 +1283,7 @@ ) ) -(defmethod spawner-hit battle ((obj battle) (arg0 battle-spawner) (arg1 process)) +(defmethod spawner-hit battle ((this battle) (arg0 battle-spawner) (arg1 process)) (let ((s5-0 (-> arg0 creature))) (set! (-> arg0 creature) (the-as handle #f)) (cond @@ -1298,19 +1298,19 @@ ) ) -(defmethod spawner-do-jump battle ((obj battle) (arg0 battle-spawner)) +(defmethod spawner-do-jump battle ((this battle) (arg0 battle-spawner)) (when (= (-> arg0 mode) 2) (+! (-> arg0 creature-index) 1) (set! (-> arg0 mode) (the-as uint 0)) - (spawner-active? obj arg0 #f) + (spawner-active? this arg0 #f) ) 0 ) -(defmethod spawner-active-count battle ((obj battle)) +(defmethod spawner-active-count battle ((this battle)) (let ((gp-0 0)) - (dotimes (s4-0 (-> obj spawners length)) - (if (spawner-active? obj (-> obj spawners data s4-0) #t) + (dotimes (s4-0 (-> this spawners length)) + (if (spawner-active? this (-> this spawners data s4-0) #t) (+! gp-0 1) ) ) @@ -1318,16 +1318,16 @@ ) ) -(defmethod spawn-initial-creatures battle ((obj battle)) - (set! (-> obj spawn-initial-creatures?) #f) - (let ((s5-0 (-> obj spawners))) +(defmethod spawn-initial-creatures battle ((this battle)) + (set! (-> this spawn-initial-creatures?) #f) + (let ((s5-0 (-> this spawners))) (dotimes (s4-0 (-> s5-0 length)) (let ((s3-0 (-> s5-0 data s4-0))) - (when (spawner-free? obj s3-0) + (when (spawner-free? this s3-0) (let ((enm-options (res-lump-value (-> s3-0 entity) 'enemy-options enemy-option :time -1000000000.0))) (when (logtest? (enemy-option prespawned) enm-options) - (spawn-from-spawner obj s3-0 #t) - (+! (-> obj stat-child-count) 1) + (spawn-from-spawner this s3-0 #t) + (+! (-> this stat-child-count) 1) ) ) ) @@ -1338,8 +1338,8 @@ (none) ) -(defmethod get-spawn-delay battle ((obj battle)) - (let ((v1-0 (-> obj info))) +(defmethod get-spawn-delay battle ((this battle)) + (let ((v1-0 (-> this info))) (rand-vu-int-range (the-as int (-> v1-0 min-battle-spawn-delay)) (the-as int (-> v1-0 max-battle-spawn-delay)) @@ -1412,9 +1412,9 @@ ) ) -(defmethod update-allies-list battle ((obj battle)) - (let ((v1-0 (-> obj allies)) - (gp-0 (-> obj allies length)) +(defmethod update-allies-list battle ((this battle)) + (let ((v1-0 (-> this allies)) + (gp-0 (-> this allies length)) ) (#when PC_PORT ;; og:preserve-this added. a battle may have enemies from an unloaded level in its ally list (e.g. atoll battle has atollext enemies). @@ -1427,7 +1427,7 @@ (a3-0 (-> v1-0 data a1-4)) ) (when (logtest? (-> a3-0 entity extra perm status) (entity-perm-status dead)) - (+! (-> obj die-count) 1) + (+! (-> this die-count) 1) (+! gp-0 -1) (set! (-> v1-0 length) gp-0) (if (and (nonzero? gp-0) (!= a1-4 gp-0)) @@ -1440,10 +1440,10 @@ ) ) -(defmethod beaten? battle ((obj battle)) - (let ((s5-0 (spawner-active-count obj)) - (v1-2 (update-allies-list obj)) - (a1-0 (-> obj child)) +(defmethod beaten? battle ((this battle)) + (let ((s5-0 (spawner-active-count this)) + (v1-2 (update-allies-list this)) + (a1-0 (-> this child)) (a0-3 0) ) (while a1-0 @@ -1452,59 +1452,59 @@ (nop!) (nop!) ) - (set! (-> obj stat-child-count) (the-as uint a0-3)) + (set! (-> this stat-child-count) (the-as uint a0-3)) (let ((a0-4 (+ v1-2 a0-3)) - (v1-4 (-> obj max-count)) + (v1-4 (-> this max-count)) ) (when (zero? a0-4) - (if (or (logtest? (-> obj flags) (battle-flags beaten)) (>= (-> obj die-count) v1-4)) + (if (or (logtest? (-> this flags) (battle-flags beaten)) (>= (-> this die-count) v1-4)) (return #t) ) ) - (logclear! (-> obj flags) (battle-flags no-spawner-block)) + (logclear! (-> this flags) (battle-flags no-spawner-block)) (cond - ((and (> s5-0 0) (>= s5-0 (the-as int (- v1-4 (-> obj die-count))))) - (let ((a1-14 (-> obj jammed-starting-time))) + ((and (> s5-0 0) (>= s5-0 (the-as int (- v1-4 (-> this die-count))))) + (let ((a1-14 (-> this jammed-starting-time))) (cond - ((zero? (-> obj jammed-starting-time)) - (set! (-> obj jammed-starting-time) (current-time)) + ((zero? (-> this jammed-starting-time)) + (set! (-> this jammed-starting-time) (current-time)) ) (else (if (>= (- (current-time) a1-14) (seconds 3.5)) - (logior! (-> obj flags) (battle-flags no-spawner-block)) + (logior! (-> this flags) (battle-flags no-spawner-block)) ) ) ) ) ) (else - (set! (-> obj jammed-starting-time) 0) + (set! (-> this jammed-starting-time) 0) 0 ) ) (cond - ((and (not (logtest? (-> obj flags) (battle-flags beaten))) - (> (-> obj spawners length) 0) - (< a0-4 (the-as int (-> obj info desired-alive-count))) - (< (-> obj count) v1-4) + ((and (not (logtest? (-> this flags) (battle-flags beaten))) + (> (-> this spawners length) 0) + (< a0-4 (the-as int (-> this info desired-alive-count))) + (< (-> this count) v1-4) ) - (when (>= (- (current-time) (-> obj cant-spawn-time)) (the-as time-frame (-> obj next-spawn-delay))) - (let ((a1-29 (get-best-spawner obj))) + (when (>= (- (current-time) (-> 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 obj a1-29 #f) - (set! (-> obj next-spawn-delay) (the-as uint (get-spawn-delay obj))) - (set! (-> obj cant-spawn-time) (current-time)) + (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)) ) (else - (set! (-> obj cant-spawn-time) (current-time)) + (set! (-> this cant-spawn-time) (current-time)) ) ) ) ) ) (else - (set! (-> obj cant-spawn-time) (current-time)) + (set! (-> this cant-spawn-time) (current-time)) ) ) ) @@ -1556,9 +1556,9 @@ ) ;; WARN: Return type mismatch battle-flags vs none. -(defmethod set-battle-music battle ((obj battle)) - (let ((a3-0 (-> obj info play-battle-music))) - (when (and a3-0 (not (logtest? (-> obj flags) (battle-flags battle-music-set)))) +(defmethod set-battle-music battle ((this battle)) + (let ((a3-0 (-> this info play-battle-music))) + (when (and a3-0 (not (logtest? (-> this flags) (battle-flags battle-music-set)))) (case a3-0 (('sound-mode) (set-setting! 'sound-mode #f 0.0 1) @@ -1567,14 +1567,14 @@ (set-setting! 'music a3-0 0.0 0) ) ) - (logior! (-> obj flags) (battle-flags battle-music-set)) + (logior! (-> this flags) (battle-flags battle-music-set)) ) ) (none) ) -(defmethod unset-battle-music battle ((obj battle)) - (when (logtest? (-> obj flags) (battle-flags battle-music-set)) +(defmethod unset-battle-music battle ((this battle)) + (when (logtest? (-> this flags) (battle-flags battle-music-set)) (remove-setting! 'sound-mode) (remove-setting! 'music) ) @@ -1582,29 +1582,29 @@ (none) ) -(defmethod relocate battle-spawner-array ((obj battle-spawner-array) (arg0 int)) - (dotimes (v1-0 (-> obj length)) - (let ((a2-3 (-> obj data v1-0))) +(defmethod relocate battle-spawner-array ((this battle-spawner-array) (arg0 int)) + (dotimes (v1-0 (-> this length)) + (let ((a2-3 (-> this data v1-0))) (&+! (-> a2-3 breeds) arg0) (if (-> a2-3 intro-path) (&+! (-> a2-3 intro-path) arg0) ) ) ) - obj + this ) ;; WARN: Return type mismatch process-drawable vs battle. -(defmethod relocate battle ((obj battle) (arg0 int)) - (&+! (-> obj spawners) arg0) - (&+! (-> obj allies) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method battle 7)) this arg0) ) ) -(defmethod initialize-spawner-breeds battle ((obj battle) (arg0 battle-spawner) (arg1 entity-actor)) +(defmethod initialize-spawner-breeds battle ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s2-0 0) (s5-0 0) @@ -1689,7 +1689,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod initialize-spawner battle ((obj battle) (arg0 battle-spawner) (arg1 entity-actor)) +(defmethod initialize-spawner battle ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) (set! (-> arg0 flags) (battle-spawner-flags)) (set! (-> arg0 entity) arg1) (set! (-> arg0 creature-index) 0) @@ -1698,16 +1698,16 @@ (set! (-> arg0 intro-path) #f) (set! (-> arg0 notice-attack-delay) (the-as uint (rand-vu-int-range - (the-as int (-> obj info min-spawner-notice-attack-delay)) - (the-as int (-> obj info max-spawner-notice-attack-delay)) + (the-as int (-> this info min-spawner-notice-attack-delay)) + (the-as int (-> this info max-spawner-notice-attack-delay)) ) ) ) (set! (-> arg0 creature) (the-as handle #f)) (set! (-> arg0 last-spawn-time) 0) (set! (-> arg0 noticed-attack-time) 0) - (initialize-spawner-breeds obj arg0 arg1) - (let ((a0-4 (new 'process 'path-control obj 'intro 0.0 arg1 #t))) + (initialize-spawner-breeds this arg0 arg1) + (let ((a0-4 (new 'process 'path-control this 'intro 0.0 arg1 #t))) (cond ((nonzero? a0-4) (set! (-> arg0 intro-path) a0-4) @@ -1733,16 +1733,16 @@ (none) ) -(defmethod initialize-ally battle ((obj battle) (arg0 battle-ally) (arg1 entity-actor)) +(defmethod initialize-ally battle ((this battle) (arg0 battle-ally) (arg1 entity-actor)) (set! (-> arg0 entity) arg1) 0 (none) ) -(defmethod initialize-enemy-lists battle ((obj battle)) +(defmethod initialize-enemy-lists battle ((this battle)) (local-vars (v0-4 battle-ally-array) (sv-16 res-tag) (sv-32 entity)) (set! sv-16 (new 'static 'res-tag)) - (let ((v0-0 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v0-0 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (when (and v0-0 (nonzero? (-> sv-16 elt-count))) (let* ((s5-0 (-> (the-as (pointer actor-group) v0-0) 0)) (s4-0 (-> s5-0 length)) @@ -1763,8 +1763,8 @@ 0 ) (else - (let ((a1-2 (-> obj spawners data (+ s1-0 -1)))) - (initialize-spawner obj a1-2 (the-as entity-actor sv-32)) + (let ((a1-2 (-> this spawners data (+ s1-0 -1)))) + (initialize-spawner this a1-2 (the-as entity-actor sv-32)) ) ) ) @@ -1777,8 +1777,8 @@ 0 ) (else - (let ((a1-3 (-> obj allies data (+ s2-0 -1)))) - (initialize-ally obj a1-3 (the-as entity-actor sv-32)) + (let ((a1-3 (-> this allies data (+ s2-0 -1)))) + (initialize-ally this a1-3 (the-as entity-actor sv-32)) ) ) ) @@ -1789,9 +1789,9 @@ ) ) (set! v0-4 (when (zero? s3-0) - (set! (-> obj spawners) (new 'process 'battle-spawner-array s1-0)) + (set! (-> this spawners) (new 'process 'battle-spawner-array s1-0)) (set! v0-4 (new 'process 'battle-ally-array s2-0)) - (set! (-> obj allies) v0-4) + (set! (-> this allies) v0-4) v0-4 ) ) @@ -1804,18 +1804,18 @@ (none) ) -(defmethod initialize-battle battle ((obj battle)) - (set! (-> obj spawn-initial-creatures?) #t) - (set! (-> obj count) (the-as uint 0)) - (set! (-> obj die-count) (the-as uint 0)) - (set! (-> obj stat-child-count) (the-as uint 0)) - (let ((v1-2 (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0)) +(defmethod initialize-battle battle ((this battle)) + (set! (-> this spawn-initial-creatures?) #t) + (set! (-> this count) (the-as uint 0)) + (set! (-> this die-count) (the-as uint 0)) + (set! (-> this stat-child-count) (the-as uint 0)) + (let ((v1-2 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0)) (a0-2 *battles*) ) (dotimes (a1-1 (-> a0-2 length)) (let ((a2-3 (-> a0-2 a1-1))) (when (= (the-as uint v1-2) (-> a2-3 id)) - (set! (-> obj info) a2-3) + (set! (-> this info) a2-3) (goto cfg-7) ) ) @@ -1823,49 +1823,49 @@ ) (go process-drawable-art-error "bad battle id") (label cfg-7) - (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice basic)) - (set! (-> obj on-hostile) (res-lump-struct (-> obj entity) 'on-hostile basic)) - (set! (-> obj on-beaten) (res-lump-struct (-> obj entity) 'on-beaten basic)) - (initialize-enemy-lists obj) - (+! (-> obj count) (-> obj allies length)) - (let ((v1-16 (-> obj info max-count))) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice basic)) + (set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile basic)) + (set! (-> this on-beaten) (res-lump-struct (-> this entity) 'on-beaten basic)) + (initialize-enemy-lists this) + (+! (-> this count) (-> this allies length)) + (let ((v1-16 (-> this info max-count))) (cond - ((and (= v1-16 #x20000000) (zero? (-> obj spawners length))) - (set! v1-16 (-> obj count)) + ((and (= v1-16 #x20000000) (zero? (-> this spawners length))) + (set! v1-16 (-> this count)) ) - ((< v1-16 (-> obj count)) - (set! v1-16 (-> obj count)) + ((< v1-16 (-> this count)) + (set! v1-16 (-> this count)) ) ) - (set! (-> obj max-count) v1-16) + (set! (-> this max-count) v1-16) ) 0 (none) ) -(defmethod init-go battle ((obj battle)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj beaten)) - (go (method-of-object obj idle)) +(defmethod init-go battle ((this battle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this beaten)) + (go (method-of-object this idle)) ) 0 ) -(defmethod init-from-entity! battle ((obj battle) (arg0 entity-actor)) +(defmethod init-from-entity! battle ((this battle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'trsqv))) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) (set! (-> s4-0 trans quad) (-> arg0 extra trans quad)) (quaternion-copy! (-> s4-0 quat) (-> arg0 quat)) (vector-identity! (-> s4-0 scale)) ) - (initialize-battle obj) - (init-go obj) + (initialize-battle this) + (init-go this) (none) ) diff --git a/goal_src/jak2/levels/common/elec-gate.gc b/goal_src/jak2/levels/common/elec-gate.gc index 16571a43ba..cfeedf73f8 100644 --- a/goal_src/jak2/levels/common/elec-gate.gc +++ b/goal_src/jak2/levels/common/elec-gate.gc @@ -710,34 +710,34 @@ ) ) -(defmethod set-elec-scale-if-close! elec-gate ((obj elec-gate) (arg0 float)) +(defmethod set-elec-scale-if-close! elec-gate ((this elec-gate) (arg0 float)) "If [[target]]'s position is within `80` [[meters]], set the scale to the value provided @see [[elec-gate::29]]" ;; og:preserve-this changed for PC port so we can render it at any distance - (if (#if PC_PORT (or (not (-> *pc-settings* ps2-lod-dist?)) (< (vector-vector-distance (-> obj root trans) (target-pos 0)) (meters 80))) - (< (vector-vector-distance (-> obj root trans) (target-pos 0)) (meters 80))) - (set-elec-scale! obj arg0) + (if (#if PC_PORT (or (not (-> *pc-settings* ps2-lod-dist?)) (< (vector-vector-distance (-> this root trans) (target-pos 0)) (meters 80))) + (< (vector-vector-distance (-> this root trans) (target-pos 0)) (meters 80))) + (set-elec-scale! this arg0) ) 0 (none) ) -(defmethod spawn-particles elec-gate ((obj elec-gate) (sparticle-lc sparticle-launch-control)) +(defmethod spawn-particles elec-gate ((this elec-gate) (sparticle-lc sparticle-launch-control)) "TODO - Calls [[sparticle-launch-control::11]] on `part-spawner-left` and `part-spawner-right` if they are defined" - (if (-> obj part-spawner-left) - (spawn sparticle-lc (the-as vector (&-> (-> obj part-spawner-left child) 8))) + (if (-> this part-spawner-left) + (spawn sparticle-lc (the-as vector (&-> (-> this part-spawner-left child) 8))) ) - (if (-> obj part-spawner-right) - (spawn sparticle-lc (the-as vector (&-> (-> obj part-spawner-right child) 8))) + (if (-> this part-spawner-right) + (spawn sparticle-lc (the-as vector (&-> (-> this part-spawner-right child) 8))) ) 0 (none) ) ;; WARN: Return type mismatch process-drawable vs elec-gate. -(defmethod relocate elec-gate ((obj elec-gate) (new-addr int)) +(defmethod relocate elec-gate ((this elec-gate) (new-addr int)) (dotimes (bolt-idx 5) - (let ((left-bolt (-> obj l-bolt bolt-idx))) + (let ((left-bolt (-> this l-bolt bolt-idx))) (if (nonzero? (-> left-bolt bolt)) (&+! (-> left-bolt bolt) new-addr) ) @@ -749,81 +749,81 @@ ) ) ) - (if (nonzero? (-> obj path-r)) - (&+! (-> obj path-r) new-addr) + (if (nonzero? (-> this path-r)) + (&+! (-> this path-r) new-addr) ) - (when (nonzero? (-> obj part-off)) - (if (nonzero? (-> obj part-off)) - (&+! (-> obj part-off) new-addr) + (when (nonzero? (-> this part-off)) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) new-addr) ) ) - (the-as elec-gate ((method-of-type process-drawable relocate) obj new-addr)) + (the-as elec-gate ((method-of-type process-drawable relocate) this new-addr)) ) -(defmethod deactivate elec-gate ((obj elec-gate)) - (set-elec-scale-if-close! obj 0.0) - ((the-as (function process-drawable none) (find-parent-method elec-gate 10)) obj) +(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) (none) ) -(defmethod get-params elec-gate ((obj elec-gate)) +(defmethod get-params elec-gate ((this elec-gate)) "@returns [[*default-elec-gate-params*]] by default" *default-elec-gate-params* ) -(defmethod elec-gate-method-24 elec-gate ((obj elec-gate)) +(defmethod elec-gate-method-24 elec-gate ((this elec-gate)) 0 (none) ) -(defmethod set-palette! elec-gate ((obj elec-gate)) +(defmethod set-palette! elec-gate ((this elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" 0 (none) ) -(defmethod set-state! elec-gate ((obj elec-gate)) +(defmethod set-state! elec-gate ((this elec-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. Otherwise, the gate will be `active`." - (if (or (logtest? (actor-option user17) (-> obj fact options)) - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (if (or (logtest? (actor-option user17) (-> this fact options)) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) ) - (go (method-of-object obj idle)) - (go (method-of-object obj active)) + (go (method-of-object this idle)) + (go (method-of-object this active)) ) 0 (none) ) -(defmethod init-from-entity! elec-gate ((obj elec-gate) (arg0 entity-actor)) +(defmethod init-from-entity! elec-gate ((this elec-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj entity) arg0) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this entity) arg0) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj params) (get-params obj)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'path-control obj 'pathl 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-r) (new 'process 'path-control obj 'pathr 0.0 (the-as entity #f) #f)) - (logior! (-> obj path-r flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj part-spawner-left) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 0))) - (set! (-> obj part-spawner-right) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 1))) - (let ((params (-> obj params))) + (set! (-> this params) (get-params this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'path-control this 'pathl 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-r) (new 'process 'path-control this 'pathr 0.0 (the-as entity #f) #f)) + (logior! (-> this path-r flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this part-spawner-left) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this part-spawner-right) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 1))) + (let ((params (-> this params))) (dotimes (bolt-idx 5) - (let ((left-bolt (-> obj l-bolt bolt-idx))) - (set! (-> left-bolt bolt) (new 'process 'lightning-control (-> params bolt-spec) obj 0.0)) - (set! (-> left-bolt ring 0) (new 'process 'lightning-control (-> params ring-spec) obj 0.0)) - (set! (-> left-bolt ring 1) (new 'process 'lightning-control (-> params ring-spec) obj 0.0)) + (let ((left-bolt (-> this l-bolt bolt-idx))) + (set! (-> left-bolt bolt) (new 'process 'lightning-control (-> params bolt-spec) this 0.0)) + (set! (-> left-bolt ring 0) (new 'process 'lightning-control (-> params ring-spec) this 0.0)) + (set! (-> left-bolt ring 1) (new 'process 'lightning-control (-> params ring-spec) this 0.0)) (set! (-> left-bolt ring-radius) (rand-vu-float-range (-> params ring-radius-min) (-> params ring-radius-max)) ) @@ -831,49 +831,49 @@ This commonly includes things such as: ) ) ) - (let* ((s4-1 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp)) - (v1-26 (get-point-in-path! (-> obj path-r) (new 'stack-no-clear 'vector) 0.0 'interp)) + (let* ((s4-1 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-26 (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp)) (a1-15 (vector-! (new 'stack-no-clear 'vector) v1-26 s4-1)) (s5-3 (vector+float*! (new 'stack-no-clear 'vector) s4-1 a1-15 0.5)) (v1-28 (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-15 1.0)) ) (vector-cross! v1-28 v1-28 *up-vector*) - (set! (-> obj dividing-wall pos quad) (-> s5-3 quad)) - (set! (-> obj dividing-wall dir quad) (-> v1-28 quad)) - (vector+float*! (the-as vector (-> obj plane)) s5-3 v1-28 12288.0) - (set! (-> (the-as vector (-> obj plane 0 dir)) quad) (-> v1-28 quad)) + (set! (-> this dividing-wall pos quad) (-> s5-3 quad)) + (set! (-> this dividing-wall dir quad) (-> v1-28 quad)) + (vector+float*! (the-as vector (-> this plane)) s5-3 v1-28 12288.0) + (set! (-> (the-as vector (-> this plane 0 dir)) quad) (-> v1-28 quad)) (vector-float*! v1-28 v1-28 -1.0) - (vector+float*! (the-as vector (-> obj plane 1)) s5-3 v1-28 12288.0) - (set! (-> (the-as vector (-> obj plane 1 dir)) quad) (-> v1-28 quad)) + (vector+float*! (the-as vector (-> this plane 1)) s5-3 v1-28 12288.0) + (set! (-> (the-as vector (-> this plane 1 dir)) quad) (-> v1-28 quad)) ) - (set! (-> obj wall-xz) + (set! (-> this wall-xz) (vector-vector-distance - (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp) - (get-point-in-path! (-> obj path-r) (new 'stack-no-clear 'vector) 0.0 'interp) + (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp) + (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp) ) ) - (set! (-> obj wall-xz) (* 0.5 (-> obj wall-xz))) - (+! (-> obj wall-xz) 4096.0) - (set! (-> obj wall-y) + (set! (-> this wall-xz) (* 0.5 (-> this wall-xz))) + (+! (-> this wall-xz) 4096.0) + (set! (-> this wall-y) (fabs - (- (-> (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (get-num-segments (-> obj path)) 'interp) + (- (-> (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (get-num-segments (-> this path)) 'interp) y ) - (-> (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp) y) + (-> (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp) y) ) ) ) - (+! (-> obj wall-y) 4096.0) - (set! (-> obj quality-enabled?) #t) - (set! (-> obj lightning-quality) 1.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "electric-gate" :fo-max 70) (-> obj root trans)) + (+! (-> this wall-y) 4096.0) + (set! (-> this quality-enabled?) #t) + (set! (-> this lightning-quality) 1.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "electric-gate" :fo-max 70) (-> this root trans)) ) - (set! (-> obj on-start) (res-lump-struct (-> obj entity) 'on-start pair)) - (set! (-> obj on-stop) (res-lump-struct (-> obj entity) 'on-stop pair)) - (elec-gate-method-24 obj) - (set-palette! obj) - (set-state! obj) + (set! (-> this on-start) (res-lump-struct (-> this entity) 'on-start pair)) + (set! (-> this on-stop) (res-lump-struct (-> this entity) 'on-stop pair)) + (elec-gate-method-24 this) + (set-palette! this) + (set-state! this) (none) ) @@ -887,20 +887,20 @@ This commonly includes things such as: ) -(defmethod set-elec-scale! fort-elec-gate ((obj fort-elec-gate) (scale float)) +(defmethod set-elec-scale! fort-elec-gate ((this fort-elec-gate) (scale float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" (set-fordumpa-electricity-scale! scale) - (set-forresca-electricity-scale! scale (-> obj palette-id)) - (set-forrescb-electricity-scale! scale (-> obj palette-id)) + (set-forresca-electricity-scale! scale (-> this palette-id)) + (set-forrescb-electricity-scale! scale (-> this palette-id)) 0 (none) ) -(defmethod set-palette! fort-elec-gate ((obj fort-elec-gate)) +(defmethod set-palette! fort-elec-gate ((this fort-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" - (set! (-> obj palette-id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) + (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 (none) ) @@ -915,18 +915,18 @@ This commonly includes things such as: ) -(defmethod set-elec-scale! drill-elec-gate ((obj drill-elec-gate) (arg0 float)) +(defmethod set-elec-scale! drill-elec-gate ((this drill-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" - (set-drill-electricity-scale! arg0 (-> obj palette-id)) + (set-drill-electricity-scale! arg0 (-> this palette-id)) 0 (none) ) -(defmethod set-palette! drill-elec-gate ((obj drill-elec-gate)) +(defmethod set-palette! drill-elec-gate ((this drill-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" - (set! (-> obj palette-id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) + (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 (none) ) @@ -949,7 +949,7 @@ This commonly includes things such as: ) -(defmethod set-elec-scale! castle-elec-gate ((obj castle-elec-gate) (arg0 float)) +(defmethod set-elec-scale! castle-elec-gate ((this castle-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" @@ -959,7 +959,7 @@ This commonly includes things such as: ) ;; og:preserve-this -(defmethod set-elec-scale! caspad-elec-gate ((obj caspad-elec-gate) (arg0 float)) +(defmethod set-elec-scale! caspad-elec-gate ((this caspad-elec-gate) (arg0 float)) "Added, original game did not define this and would crash on call." 0 (none) @@ -1009,7 +1009,7 @@ This commonly includes things such as: ) ) -(defmethod get-params caspad-elec-gate ((obj caspad-elec-gate)) +(defmethod get-params caspad-elec-gate ((this caspad-elec-gate)) "@returns [[*default-elec-gate-params*]] by default" *caspad-elec-gate-params* ) @@ -1024,18 +1024,18 @@ This commonly includes things such as: ) -(defmethod set-elec-scale! palroof-elec-gate ((obj palroof-elec-gate) (arg0 float)) +(defmethod set-elec-scale! palroof-elec-gate ((this palroof-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" - (set-palroof-electricity-scale! arg0 (-> obj palette-id)) + (set-palroof-electricity-scale! arg0 (-> this palette-id)) 0 (none) ) -(defmethod set-palette! palroof-elec-gate ((obj palroof-elec-gate)) +(defmethod set-palette! palroof-elec-gate ((this palroof-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" - (set! (-> obj palette-id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) + (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 (none) ) diff --git a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc index a5876523a0..8ec6aa6148 100644 --- a/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc +++ b/goal_src/jak2/levels/common/enemy/amphibian/amphibian.gc @@ -270,52 +270,52 @@ (set! (-> *amphibian-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod relocate amphibian-joint-mod ((obj amphibian-joint-mod) (arg0 int)) - (&+! (-> obj proc) arg0) - obj +(defmethod relocate amphibian-joint-mod ((this amphibian-joint-mod) (arg0 int)) + (&+! (-> this proc) arg0) + this ) -(defmethod general-event-handler amphibian ((obj amphibian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler amphibian ((this amphibian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (when (= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + (when (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) 0 ) - (when (zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + (when (zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) 0 ) ) ) - (go (method-of-object obj knocked)) - (if (and (logtest? (-> obj incoming penetrate-using) 16) - (nonzero? (-> obj hit-points)) - (zero? (-> obj fated-time)) + (go (method-of-object this knocked)) + (if (and (logtest? (-> this incoming penetrate-using) 16) + (nonzero? (-> this hit-points)) + (zero? (-> this fated-time)) ) 'push #t ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -351,10 +351,10 @@ ) ;; WARN: Return type mismatch amphibian-joint-mod vs none. -(defmethod amphibian-joint-mod-method-9 amphibian-joint-mod ((obj amphibian-joint-mod)) - (let ((v1-3 (-> obj proc node-list data (-> obj joint-index)))) +(defmethod amphibian-joint-mod-method-9 amphibian-joint-mod ((this amphibian-joint-mod)) + (let ((v1-3 (-> this proc node-list data (-> this joint-index)))) (set! (-> v1-3 param0) amphibian-joint-mod-callback) - (set! (-> v1-3 param1) obj) + (set! (-> v1-3 param1) this) ) (none) ) @@ -367,26 +367,26 @@ ) ) -(defmethod enemy-method-106 amphibian ((obj amphibian) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 amphibian ((this amphibian) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) - (t9-0 obj arg0 arg1 arg2 arg3) + (t9-0 this arg0 arg1 arg2 arg3) ) - (let ((a0-3 (enemy-method-134 obj arg0 arg3))) + (let ((a0-3 (enemy-method-134 this arg0 arg3))) (if a0-3 - (set! (-> obj attacker-handle) (process->handle a0-3)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (process->handle a0-3)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) 0 (none) ) -(defmethod damage-amount-from-attack amphibian ((obj amphibian) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack amphibian ((this amphibian) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (let ((v1-1 (-> obj hit-points))) + (let ((v1-1 (-> this hit-points))) (if (> (- v1-1 v0-0) 0) (set! v0-0 (+ v1-1 -1)) ) @@ -395,20 +395,20 @@ ) ) -(defmethod enemy-method-51 amphibian ((obj amphibian)) +(defmethod enemy-method-51 amphibian ((this amphibian)) (local-vars (f0-1 float)) 0.0 (set! f0-1 (cond - ((or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) - ((method-of-type nav-enemy enemy-method-51) obj) + ((or (zero? (-> this hit-points)) (nonzero? (-> this fated-time))) + ((method-of-type nav-enemy enemy-method-51) this) ) (else - (set! f0-1 (quaternion-y-angle (-> obj root quat))) - (let ((a0-5 (handle->process (-> obj focus handle)))) + (set! f0-1 (quaternion-y-angle (-> this root quat))) + (let ((a0-5 (handle->process (-> this focus handle)))) (when a0-5 (let ((v1-12 (get-trans (the-as process-focusable a0-5) 0))) - (set! f0-1 (atan (- (-> v1-12 x) (-> obj root trans x)) (- (-> v1-12 z) (-> obj root trans z)))) + (set! f0-1 (atan (- (-> v1-12 x) (-> this root trans x)) (- (-> v1-12 z) (-> this root trans z)))) ) ) ) @@ -420,31 +420,31 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 amphibian ((obj amphibian) (arg0 vector)) +(defmethod enemy-method-52 amphibian ((this amphibian) (arg0 vector)) (cond - ((and (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time)) (!= (-> obj incoming knocked-type) 6)) - (enemy-method-50 obj arg0) - (let ((f30-0 (get-rand-float-range obj 0.0 1.0))) + ((and (nonzero? (-> this hit-points)) (zero? (-> this fated-time)) (!= (-> this incoming knocked-type) 6)) + (enemy-method-50 this arg0) + (let ((f30-0 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp 43417.6 58982.4 f30-0)) (set! (-> arg0 y) (lerp 114688.0 116736.0 f30-0)) ) ) (else - ((method-of-type nav-enemy enemy-method-52) obj arg0) + ((method-of-type nav-enemy enemy-method-52) this arg0) ) ) (none) ) -(defmethod enemy-method-77 amphibian ((obj amphibian) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 amphibian ((this amphibian) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (let* ((v1-3 (enemy-method-120 obj 3 (ash 1 (-> *amphibian-global-info* prev-blue-hit)))) - (s5-1 (-> obj draw art-group data (-> *amphibian-global-info* blue-hit-anim v1-3))) + (let* ((v1-3 (enemy-method-120 this 3 (ash 1 (-> *amphibian-global-info* prev-blue-hit)))) + (s5-1 (-> this draw art-group data (-> *amphibian-global-info* blue-hit-anim v1-3))) ) (set! (-> *amphibian-global-info* prev-blue-hit) v1-3) (ja-channel-push! 1 (seconds 0.02)) - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-10 param 1) 1.0) @@ -455,16 +455,16 @@ ) (else (let ((v1-11 0)) - (when (or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) + (when (or (zero? (-> this hit-points)) (nonzero? (-> this fated-time))) (let ((a2-5 (logior (ash 1 (-> *amphibian-global-info* prev-knocked)) 1))) - (set! v1-11 (enemy-method-120 obj 3 a2-5)) + (set! v1-11 (enemy-method-120 this 3 a2-5)) ) ) (set! (-> *amphibian-global-info* prev-knocked) v1-11) - (set! (-> obj knocked-anim-index) v1-11) - (let ((s4-0 (-> obj draw art-group data (-> *amphibian-global-info* knocked-anim v1-11)))) + (set! (-> this knocked-anim-index) v1-11) + (let ((s4-0 (-> this draw art-group data (-> *amphibian-global-info* knocked-anim v1-11)))) (ja-channel-push! 1 0) - (let ((a0-25 (-> obj skel root-channel 0))) + (let ((a0-25 (-> this skel root-channel 0))) (set! (-> a0-25 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-25 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-25 param 1) (-> arg0 0)) @@ -478,31 +478,33 @@ #t ) -(defmethod enemy-method-78 amphibian ((obj amphibian) (arg0 (pointer float))) +(defmethod enemy-method-78 amphibian ((this amphibian) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) (ja-channel-push! 1 (seconds 0.015)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 25))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 25))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 25)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 25)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 25)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 25)) num-func-seek!) ) #t ) ) (else - (let ((s4-0 (-> obj draw art-group data (-> *amphibian-global-info* knocked-land-anim (-> obj knocked-anim-index)))) + (let ((s4-0 + (-> this draw art-group data (-> *amphibian-global-info* knocked-land-anim (-> this knocked-anim-index))) + ) ) - (if (zero? (-> obj knocked-anim-index)) + (if (zero? (-> this knocked-anim-index)) (ja-channel-push! 1 (seconds 0.07)) (ja-channel-push! 1 (seconds 0.15)) ) - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-10 param 1) (-> arg0 0)) @@ -515,17 +517,17 @@ ) ) -(defmethod enemy-method-89 amphibian ((obj amphibian) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-89 amphibian ((this amphibian) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) - (let* ((v1-5 (get-rand-int obj 2)) - (s4-0 (-> obj draw art-group data (-> *amphibian-global-info* jump-wind-up-anim v1-5))) + (let* ((v1-5 (get-rand-int this 2)) + (s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-wind-up-anim v1-5))) ) - (set! (-> obj jump-anim-index) v1-5) + (set! (-> this jump-anim-index) v1-5) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-9 (-> obj skel root-channel 0))) + (let ((a0-9 (-> this skel root-channel 0))) (set! (-> a0-9 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-9 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-9 param 1) (-> arg0 anim-speed)) @@ -536,10 +538,10 @@ #t ) -(defmethod enemy-method-87 amphibian ((obj amphibian) (arg0 enemy-jump-info)) - (let ((s4-0 (-> obj draw art-group data (-> *amphibian-global-info* jump-in-air-anim (-> obj jump-anim-index))))) +(defmethod enemy-method-87 amphibian ((this amphibian) (arg0 enemy-jump-info)) + (let ((s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-in-air-anim (-> this jump-anim-index))))) (ja-channel-push! 1 (seconds 0.07)) - (let ((a0-6 (-> obj skel root-channel 0))) + (let ((a0-6 (-> this skel root-channel 0))) (set! (-> a0-6 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-6 param 1) (-> arg0 anim-speed)) @@ -550,13 +552,13 @@ #t ) -(defmethod enemy-method-88 amphibian ((obj amphibian) (arg0 enemy-jump-info)) - (let ((s4-0 (-> obj draw art-group data (-> *amphibian-global-info* jump-land-anim (-> obj jump-anim-index))))) - (if (zero? (-> obj jump-anim-index)) +(defmethod enemy-method-88 amphibian ((this amphibian) (arg0 enemy-jump-info)) + (let ((s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-land-anim (-> this jump-anim-index))))) + (if (zero? (-> this jump-anim-index)) (ja-channel-push! 1 (seconds 0.07)) (ja-channel-push! 1 (seconds 0.04)) ) - (let ((a0-7 (-> obj skel root-channel 0))) + (let ((a0-7 (-> this skel root-channel 0))) (set! (-> a0-7 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-7 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-7 param 1) (-> arg0 anim-speed)) @@ -568,26 +570,26 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-90 amphibian ((obj amphibian) (arg0 int) (arg1 enemy-jump-info)) - (when (or (= (-> obj jump-why) 3) (= (-> obj jump-why) 2)) +(defmethod enemy-method-90 amphibian ((this amphibian) (arg0 int) (arg1 enemy-jump-info)) + (when (or (= (-> this jump-why) 3) (= (-> this jump-why) 2)) (cond ((zero? arg0) - (logior! (-> obj focus-status) (focus-status touch-water under-water)) + (logior! (-> this focus-status) (focus-status touch-water under-water)) ) (else - (when (focus-test? obj touch-water) + (when (focus-test? this touch-water) (let ((s3-0 (new 'stack-no-clear 'water-info))) - (water-info-init! (-> obj root) s3-0 (collide-action solid semi-solid)) + (water-info-init! (-> this root) s3-0 (collide-action solid semi-solid)) (let ((v1-12 #f)) (cond ((not (logtest? (water-flags touch-water) (-> s3-0 flags))) - (if (focus-test? obj under-water) + (if (focus-test? this under-water) (set! v1-12 #t) ) - (logclear! (-> obj focus-status) (focus-status touch-water under-water)) + (logclear! (-> this focus-status) (focus-status touch-water under-water)) ) - ((focus-test? obj under-water) - (let* ((a0-18 (-> obj root root-prim prim-core)) + ((focus-test? this under-water) + (let* ((a0-18 (-> this root root-prim prim-core)) (f0-1 (+ (-> a0-18 world-sphere y) (-> a0-18 world-sphere w))) ) (if (< (-> s3-0 trans y) f0-1) @@ -597,9 +599,9 @@ ) ) (when v1-12 - (logclear! (-> obj focus-status) (focus-status under-water)) + (logclear! (-> this focus-status) (focus-status under-water)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> obj root trans quad)) + (set! (-> s2-0 quad) (-> this root trans quad)) (when (logtest? (water-flags touch-water) (-> s3-0 flags)) (set! (-> s2-0 y) (-> s3-0 trans y)) (let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000))) @@ -650,30 +652,30 @@ (the-as symbol (cond - ((and (= arg0 3) (= (-> obj jump-anim-index) 1)) - (let* ((v1-35 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((and (= arg0 3) (= (-> this jump-anim-index) 1)) + (let* ((v1-35 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) - (s4-1 (and v1-35 (= v1-35 (-> obj draw art-group data 36)))) + (s4-1 (and v1-35 (= v1-35 (-> this draw art-group data 36)))) ) (cond - ((and (not s4-1) (< (-> obj root transv y) 0.0)) + ((and (not s4-1) (< (-> this root transv y) 0.0)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-37 (-> obj skel root-channel 0))) - (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> obj draw art-group data 36))) + (let ((a0-37 (-> this skel root-channel 0))) + (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> this draw art-group data 36))) (set! (-> a0-37 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 36)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 36)) frames num-frames) -1)) ) (set! (-> a0-37 param 1) (-> arg1 anim-speed)) (set! (-> a0-37 frame-num) 0.0) - (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> obj draw art-group data 36)) num-func-seek!) + (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> this draw art-group data 36)) num-func-seek!) ) #f ) (else (set! s4-1 (and (ja-done? 0) s4-1)) - (let ((a0-39 (-> obj skel root-channel 0))) + (let ((a0-39 (-> this skel root-channel 0))) (set! (-> a0-39 param 0) (the float (+ (-> a0-39 frame-group frames num-frames) -1))) (set! (-> a0-39 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-39 (the-as art-joint-anim #f) num-func-seek!) @@ -685,27 +687,30 @@ ) ) (else - ((method-of-type nav-enemy enemy-method-90) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-90) this arg0 arg1) ) ) ) ) -(defmethod amphibian-method-184 amphibian ((obj amphibian) (arg0 vector) (arg1 vector)) - (vector<-cspace! arg0 (-> obj node-list data 13)) - (vector-! arg1 (-> obj tongue-mod target) arg0) - (vector-normalize! arg1 (fmin (* (vector-length arg1) (-> obj tongue-scale)) (-> obj tongue-mod max-length))) +(defmethod amphibian-method-184 amphibian ((this amphibian) (arg0 vector) (arg1 vector)) + (vector<-cspace! arg0 (-> this node-list data 13)) + (vector-! arg1 (-> this tongue-mod target) arg0) + (vector-normalize! + arg1 + (fmin (* (vector-length arg1) (-> this tongue-scale)) (-> this tongue-mod max-length)) + ) (vector+! arg1 arg1 arg0) ) ;; WARN: Return type mismatch float vs none. -(defmethod amphibian-method-185 amphibian ((obj amphibian) (arg0 amphibian-tongue-attack-info)) - (let ((a0-1 (-> obj node-list data 11 bone transform))) +(defmethod amphibian-method-185 amphibian ((this amphibian) (arg0 amphibian-tongue-attack-info)) + (let ((a0-1 (-> this node-list data 11 bone transform))) (set! (-> arg0 base-dir quad) (-> a0-1 vector 2 quad)) ) (vector-normalize! (-> arg0 base-dir) 1.0) - (vector<-cspace! (-> arg0 start-pos) (-> obj node-list data 13)) - (let ((a0-7 (handle->process (-> obj focus handle)))) + (vector<-cspace! (-> arg0 start-pos) (-> this node-list data 13)) + (let ((a0-7 (handle->process (-> this focus handle)))) (cond (a0-7 (set! (-> arg0 targ-pos quad) (-> (get-trans (the-as process-focusable a0-7) 3) quad)) @@ -746,7 +751,7 @@ (let ((v1-32 s4-3)) (set! (-> v1-32 radius) 409.6) (set! (-> v1-32 collide-with) (collide-spec backgnd crate obstacle hit-by-others-list pusher)) - (set! (-> v1-32 ignore-process0) obj) + (set! (-> v1-32 ignore-process0) this) (set! (-> v1-32 ignore-process1) #f) (set! (-> v1-32 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-32 action-mask) (collide-action solid)) @@ -761,7 +766,7 @@ (none) ) -(defmethod amphibian-method-186 amphibian ((obj amphibian) (arg0 vector) (arg1 vector)) +(defmethod amphibian-method-186 amphibian ((this amphibian) (arg0 vector) (arg1 vector)) (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -771,7 +776,7 @@ (let ((v1-4 s4-0)) (set! (-> v1-4 radius) 409.6) (set! (-> v1-4 collide-with) (collide-spec jak bot enemy obstacle hit-by-others-list player-list pusher)) - (set! (-> v1-4 ignore-process0) obj) + (set! (-> v1-4 ignore-process0) this) (set! (-> v1-4 ignore-process1) #f) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) @@ -794,7 +799,7 @@ (vector s5-0) (shove-back (meters 4)) (shove-up (meters 3)) - (damage (the float (-> obj enemy-info attack-damage))) + (damage (the float (-> this enemy-info attack-damage))) ) ) ) @@ -806,104 +811,104 @@ ) ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-76 amphibian ((obj amphibian) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 amphibian ((this amphibian) (arg0 process) (arg1 event-message-block)) (let ((t9-0 (method-of-type nav-enemy enemy-method-76))) - (t9-0 obj (the-as process-focusable arg0) arg1) + (t9-0 this (the-as process-focusable arg0) arg1) ) (the-as symbol (when (and (logtest? (-> (the-as process-focusable arg0) root root-prim prim-core collide-as) (collide-spec jak bot)) - (-> obj next-state) - (let ((v1-8 (-> obj next-state name))) + (-> this next-state) + (let ((v1-8 (-> this next-state name))) (or (= v1-8 'stare) (= v1-8 'hostile)) ) ) - (go (method-of-object obj attack-spin)) + (go (method-of-object this attack-spin)) 0 ) ) ) -(defmethod go-stare amphibian ((obj amphibian)) - (let ((s5-0 (-> obj focus aware))) +(defmethod go-stare amphibian ((this amphibian)) + (let ((s5-0 (-> this focus aware))) (cond - ((or (and (-> obj enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> obj enemy-flags))) - (nav-enemy-method-163 obj) + ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) + (nav-enemy-method-163 this) ) - (go-stare2 obj) + (go-stare2 this) ) - ((and (= s5-0 (enemy-aware enemy-aware-3)) (-> obj enemy-info use-circling)) - (go (method-of-object obj circling)) + ((and (= s5-0 (enemy-aware enemy-aware-3)) (-> this enemy-info use-circling)) + (go (method-of-object this circling)) ) - ((and (= s5-0 (enemy-aware enemy-aware-2)) (-> obj enemy-info use-pacing)) - (go (method-of-object obj pacing)) + ((and (= s5-0 (enemy-aware enemy-aware-2)) (-> this enemy-info use-pacing)) + (go (method-of-object this pacing)) ) ((= s5-0 (enemy-aware unaware)) - (go (method-of-object obj flee)) + (go (method-of-object this flee)) ) (else - (go-stare2 obj) + (go-stare2 this) ) ) ) ) -(defmethod go-hostile amphibian ((obj amphibian)) - (let* ((s4-0 (handle->process (-> obj attacker-handle))) +(defmethod go-hostile amphibian ((this amphibian)) + (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) ) (when s5-0 - (set! (-> obj attacker-handle) (the-as handle #f)) - (when (collide-check? (-> obj focus) (the-as process-focusable s5-0)) - (try-update-focus (-> obj focus) (the-as process-focusable s5-0) obj) - (go (method-of-object obj tongue-attack)) + (set! (-> this attacker-handle) (the-as handle #f)) + (when (collide-check? (-> this focus) (the-as process-focusable s5-0)) + (try-update-focus (-> this focus) (the-as process-focusable s5-0) this) + (go (method-of-object this tongue-attack)) ) ) ) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) -(defmethod track-target! amphibian ((obj amphibian)) +(defmethod track-target! amphibian ((this amphibian)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (set! (-> obj prev-ry) (-> obj prev-ry1)) - (set! (-> obj prev-ry1) (quaternion-y-angle (-> obj root quat))) - ((method-of-type nav-enemy track-target!) obj) + (set! (-> this prev-ry) (-> this prev-ry1)) + (set! (-> this prev-ry1) (quaternion-y-angle (-> this root quat))) + ((method-of-type nav-enemy track-target!) this) (none) ) -(defmethod amphibian-method-187 amphibian ((obj amphibian)) +(defmethod amphibian-method-187 amphibian ((this amphibian)) (with-pp - (let* ((f30-0 (-> obj nav state speed)) + (let* ((f30-0 (-> this nav state speed)) (f26-0 0.0) - (f0-1 (quaternion-y-angle (-> obj root quat))) - (f28-0 (deg- f0-1 (-> obj prev-ry))) + (f0-1 (quaternion-y-angle (-> this root quat))) + (f28-0 (deg- f0-1 (-> this prev-ry))) ) (let ((s5-0 #f)) (let ((s4-0 #f)) - (let ((v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (set! f28-0 (cond - ((and v1-6 (or (= v1-6 (-> obj draw art-group data 26)) - (= v1-6 (-> obj draw art-group data 27)) - (= v1-6 (-> obj draw art-group data 16)) + ((and v1-6 (or (= v1-6 (-> this draw art-group data 26)) + (= v1-6 (-> this draw art-group data 27)) + (= v1-6 (-> this draw art-group data 16)) ) ) (set! f26-0 (ja-aframe-num 0)) - (when (= (-> obj skel root-channel 0) (-> obj skel channel)) + (when (= (-> this skel root-channel 0) (-> this skel channel)) (cond ((>= f26-0 13.0) (set! s4-0 #t) ) - ((and (>= 1.0 f26-0) (logtest? (-> obj flags) (amphibian-flags amflags-0))) + ((and (>= 1.0 f26-0) (logtest? (-> this flags) (amphibian-flags amflags-0))) (set! s5-0 #t) ) ) @@ -917,67 +922,67 @@ ) ) (if s4-0 - (logior! (-> obj flags) (amphibian-flags amflags-0)) - (logclear! (-> obj flags) (amphibian-flags amflags-0)) + (logior! (-> this flags) (amphibian-flags amflags-0)) + (logclear! (-> this flags) (amphibian-flags amflags-0)) ) ) (cond ((>= f30-0 18432.0) - (let ((v1-29 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-29 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-29 (= v1-29 (-> obj draw art-group data 26))) - (when (and s5-0 (zero? (get-rand-int obj 5))) + ((and v1-29 (= v1-29 (-> this draw art-group data 26))) + (when (and s5-0 (zero? (get-rand-int this 5))) (ja-channel-push! 1 (seconds 0.15)) - (let ((s5-3 (-> obj skel root-channel 0))) + (let ((s5-3 (-> this skel root-channel 0))) (set! (-> s5-3 dist) 12288.0) (joint-control-channel-group-eval! s5-3 - (the-as art-joint-anim (-> obj draw art-group data 27)) + (the-as art-joint-anim (-> this draw art-group data 27)) num-func-identity ) (set! (-> s5-3 frame-num) (ja-aframe f26-0 0)) ) - (logclear! (-> obj flags) (amphibian-flags amflags-0)) + (logclear! (-> this flags) (amphibian-flags amflags-0)) ) ) (else - (let ((v1-45 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-45 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-45 (= v1-45 (-> obj draw art-group data 27))) + ((and v1-45 (= v1-45 (-> this draw art-group data 27))) (when s5-0 (ja-channel-push! 1 (seconds 0.15)) - (let ((s5-4 (-> obj skel root-channel 0))) + (let ((s5-4 (-> this skel root-channel 0))) (set! (-> s5-4 dist) 12288.0) (joint-control-channel-group-eval! s5-4 - (the-as art-joint-anim (-> obj draw art-group data 26)) + (the-as art-joint-anim (-> this draw art-group data 26)) num-func-identity ) (set! (-> s5-4 frame-num) (ja-aframe f26-0 0)) ) - (logclear! (-> obj flags) (amphibian-flags amflags-0)) + (logclear! (-> this flags) (amphibian-flags amflags-0)) ) ) (else (ja-channel-push! 1 (seconds 0.15)) - (let ((s5-5 (-> obj skel root-channel 0))) + (let ((s5-5 (-> this skel root-channel 0))) (set! (-> s5-5 dist) 12288.0) (joint-control-channel-group-eval! s5-5 - (the-as art-joint-anim (-> obj draw art-group data 26)) + (the-as art-joint-anim (-> this draw art-group data 26)) num-func-identity ) (set! (-> s5-5 frame-num) (ja-aframe f26-0 0)) ) - (logclear! (-> obj flags) (amphibian-flags amflags-0)) + (logclear! (-> this flags) (amphibian-flags amflags-0)) ) ) ) @@ -986,23 +991,23 @@ ) ) (else - (let ((v1-67 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-67 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (when (not (and v1-67 (= v1-67 (-> obj draw art-group data 16)))) + (when (not (and v1-67 (= v1-67 (-> this draw art-group data 16)))) (ja-channel-push! 1 (seconds 0.1)) - (let ((s5-6 (-> obj skel root-channel 0))) + (let ((s5-6 (-> this skel root-channel 0))) (set! (-> s5-6 dist) 12288.0) (joint-control-channel-group-eval! s5-6 - (the-as art-joint-anim (-> obj draw art-group data 16)) + (the-as art-joint-anim (-> this draw art-group data 16)) num-func-identity ) (set! (-> s5-6 frame-num) (ja-aframe f26-0 0)) ) - (logclear! (-> obj flags) (amphibian-flags amflags-0)) + (logclear! (-> this flags) (amphibian-flags amflags-0)) ) ) ) @@ -1010,7 +1015,7 @@ ) (let* ((f0-15 (fmin 24576.0 (* 0.47123888 (-> pp clock frames-per-second) (fabs f28-0)))) (f0-17 (* 0.00008680556 (fmax f30-0 f0-15))) - (a0-49 (-> obj skel root-channel 0)) + (a0-49 (-> this skel root-channel 0)) ) (set! (-> a0-49 param 0) f0-17) (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-loop!) @@ -1025,8 +1030,8 @@ :virtual #t :code (behavior () (until #f - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1.067)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1.067)) (amphibian-method-187 self) (suspend) ) @@ -1062,7 +1067,7 @@ 0 (nav-enemy-method-165 self) (ja-no-eval :num! (loop!)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1.067)) + (until (time-elapsed? (-> self state-time) (seconds 1.067)) (amphibian-method-187 self) (suspend) ) @@ -1590,7 +1595,7 @@ :event enemy-event-handler :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 self)) (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) @@ -1615,7 +1620,7 @@ (let ((v1-0 (-> self tongue-mode))) (cond ((zero? v1-0) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.8)) + (when (time-elapsed? (-> self state-time) (seconds 0.8)) (set! (-> self tongue-mode) (the-as uint 1)) (sound-play "tongue-attack") ) @@ -1673,16 +1678,16 @@ ) ;; WARN: Return type mismatch nav-enemy vs amphibian. -(defmethod relocate amphibian ((obj amphibian) (arg0 int)) - (if (nonzero? (-> obj tongue-mod)) - (&+! (-> obj tongue-mod) arg0) +(defmethod relocate amphibian ((this amphibian) (arg0 int)) + (if (nonzero? (-> this tongue-mod)) + (&+! (-> this tongue-mod) arg0) ) - (the-as amphibian ((method-of-type nav-enemy relocate) obj arg0)) + (the-as amphibian ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod init-enemy-collision! amphibian ((obj amphibian)) +(defmethod init-enemy-collision! amphibian ((this amphibian)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1752,36 +1757,36 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! amphibian ((obj amphibian)) +(defmethod init-enemy! amphibian ((this amphibian)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-amphibian" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *amphibian-nav-enemy-info*) - (set! (-> obj tongue-mod) (new 'process 'amphibian-joint-mod obj 14)) - (let ((v1-6 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *amphibian-nav-enemy-info*) + (set! (-> this tongue-mod) (new 'process 'amphibian-joint-mod this 14)) + (let ((v1-6 (-> this neck))) (set! (-> v1-6 up) (the-as uint 1)) (set! (-> v1-6 nose) (the-as uint 2)) (set! (-> v1-6 ear) (the-as uint 0)) (set-vector! (-> v1-6 twist-max) 10012.444 10012.444 0.0 1.0) (set! (-> v1-6 ignore-angle) 20024.889) ) - (let ((v1-8 (-> obj nav))) + (let ((v1-8 (-> this nav))) (set! (-> v1-8 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (set! (-> obj prev-ry) (quaternion-y-angle (-> obj root quat))) - (set! (-> obj prev-ry1) (-> obj prev-ry)) + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this prev-ry) (quaternion-y-angle (-> this root quat))) + (set! (-> this prev-ry1) (-> this prev-ry)) 0 (none) ) diff --git a/goal_src/jak2/levels/common/enemy/bouncer.gc b/goal_src/jak2/levels/common/enemy/bouncer.gc index 6b1e40ca2a..5465a3e7ee 100644 --- a/goal_src/jak2/levels/common/enemy/bouncer.gc +++ b/goal_src/jak2/levels/common/enemy/bouncer.gc @@ -133,7 +133,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('touch) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) #f ) (else @@ -142,10 +142,10 @@ ) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self smush) 0.0) (until #f - (if (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) (ja :num! (seek! 0.0 0.1)) (ja :num! (seek! (lerp-scale @@ -186,9 +186,9 @@ :post transform-post ) -(defmethod init-skeleton! bouncer ((obj bouncer)) +(defmethod init-skeleton! bouncer ((this bouncer)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bouncer" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -196,9 +196,9 @@ (none) ) -(defmethod bouncer-method-24 bouncer ((obj bouncer)) +(defmethod bouncer-method-24 bouncer ((this bouncer)) "TODO - collision stuff" - (let ((collision-shape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) (set! (-> collision-mesh prim-core collide-as) (collide-spec crate)) (set! (-> collision-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -213,26 +213,26 @@ (set! (-> collision-shape backup-collide-as) (-> prim prim-core collide-as)) (set! (-> collision-shape backup-collide-with) (-> prim prim-core collide-with)) ) - (set! (-> obj root) collision-shape) + (set! (-> this root) collision-shape) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! bouncer ((obj bouncer) (arg0 entity-actor)) +(defmethod init-from-entity! bouncer ((this bouncer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj mods) #f) - (bouncer-method-24 obj) - (process-drawable-from-entity! obj arg0) - (init-skeleton! obj) - (nav-mesh-connect-from-ent obj) - (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) - (go (method-of-object obj idle)) + (set! (-> this mods) #f) + (bouncer-method-24 this) + (process-drawable-from-entity! this arg0) + (init-skeleton! this) + (nav-mesh-connect-from-ent this) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/common/enemy/centurion.gc b/goal_src/jak2/levels/common/enemy/centurion.gc index dc91d429b3..bd787f8e7a 100644 --- a/goal_src/jak2/levels/common/enemy/centurion.gc +++ b/goal_src/jak2/levels/common/enemy/centurion.gc @@ -150,7 +150,7 @@ ) -(defmethod play-impact-sound centurion-shot ((obj centurion-shot) (arg0 projectile-options)) +(defmethod play-impact-sound centurion-shot ((this centurion-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -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)) obj arg0) + ((the-as (function projectile projectile-options sound-id) (find-parent-method centurion-shot 28)) this arg0) ) ) ) @@ -168,11 +168,11 @@ (none) ) -(defmethod init-proj-settings! centurion-shot ((obj centurion-shot)) +(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)) obj) - (set! (-> obj max-speed) 327680.0) - (set! (-> obj timeout) (seconds 1.25)) + ((the-as (function projectile none) (find-parent-method centurion-shot 31)) this) + (set! (-> this max-speed) 327680.0) + (set! (-> this timeout) (seconds 1.25)) (none) ) @@ -417,7 +417,7 @@ (set! (-> *centurion-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler centurion ((obj centurion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler centurion ((this centurion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -426,7 +426,7 @@ ) (('touch) (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'attack)) + ((and (-> this next-state) (= (-> this next-state name) 'attack)) (let ((s4-1 (-> arg3 param 0))) (let ((s3-1 arg0)) (if (type? s3-1 process-focusable) @@ -438,8 +438,8 @@ 'attack-or-shove s4-1 (static-attack-info ((id (new-attack-id)) - (shove-back (* 2.0 (-> obj enemy-info attack-shove-back))) - (shove-up (* 2.0 (-> obj enemy-info attack-shove-up))) + (shove-back (* 2.0 (-> this enemy-info attack-shove-back))) + (shove-up (* 2.0 (-> this enemy-info attack-shove-up))) (mode 'deadly) ) ) @@ -447,36 +447,36 @@ ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('attack) (let ((v1-12 (the-as object (-> arg3 param 1)))) (cond - ((!= (-> (the-as attack-info v1-12) id) (-> obj incoming-attack-id)) - (set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-12) id)) + ((!= (-> (the-as attack-info v1-12) id) (-> this incoming-attack-id)) + (set! (-> this incoming-attack-id) (-> (the-as attack-info v1-12) id)) (cond - ((or (-> obj can-take-damage?) + ((or (-> this can-take-damage?) (logtest? (penetrate dark-skin dark-punch dark-bomb) (-> (the-as attack-info v1-12) penetrate-using)) ) (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'fire)) - (centurion-method-180 obj) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((and (-> this next-state) (= (-> this next-state name) 'fire)) + (centurion-method-180 this) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - (+! (-> obj shield-shot) 1) - (if (= (-> obj shield-shot) 4) + (+! (-> this shield-shot) 1) + (if (= (-> this shield-shot) 4) (talker-spawn-func (-> *talker-speech* 58) *entity-pool* (target-pos 0) (the-as region #f)) ) (set! (-> *part-id-table* 2102 init-specs 13 initial-valuef) 255.0) - (set! (-> obj state-time) (current-time)) + (set-time! (-> this state-time)) 'back ) ) @@ -488,21 +488,21 @@ ) ) (('victory) - (if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) - (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (if (and (not (and (-> this next-state) (= (-> this next-state name) 'victory))) + (and (> (-> this hit-points) 0) + (zero? (-> this fated-time)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) ) - (go (method-of-object obj victory)) + (go (method-of-object this victory)) ) ) (('notify) - (let ((v1-47 (handle->process (-> obj focus handle)))) + (let ((v1-47 (handle->process (-> this focus handle)))) (when (and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) v1-47) - (-> obj next-state) - (let ((v1-52 (-> obj next-state name))) + (-> this next-state) + (let ((v1-52 (-> this next-state name))) (or (= v1-52 'hostile) (= v1-52 'fire)) ) ) @@ -516,25 +516,25 @@ (set! (-> a1-13 param 3) (-> arg3 param 3)) (set! (-> a1-13 param 4) (-> arg3 param 4)) (set! (-> a1-13 param 5) (-> arg3 param 5)) - (send-event-function obj a1-13) + (send-event-function this a1-13) ) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod centurion-method-181 centurion ((obj centurion) (arg0 vector)) +(defmethod centurion-method-181 centurion ((this centurion) (arg0 vector)) (local-vars (sv-224 vector) (sv-240 vector) (sv-256 vector)) - (if (not (-> obj joint-enable)) + (if (not (-> this joint-enable)) (return (the-as int #f)) ) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> arg0 quad)) - (let* ((v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 4))) + (let* ((v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) (s1-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 v0-1) 1.0)) (s3-0 (new 'stack-no-clear 'vector)) ) @@ -542,10 +542,10 @@ (let ((s5-1 (new 'stack-no-clear 'quaternion))) (vector-z-quaternion! (new 'stack-no-clear 'vector) - (quaternion*! (new 'stack-no-clear 'quaternion) (-> obj joint quat) (-> obj root quat)) + (quaternion*! (new 'stack-no-clear 'quaternion) (-> this joint quat) (-> this root quat)) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector-z-quaternion! s3-0 (-> obj root quat)) + (vector-z-quaternion! s3-0 (-> this root quat)) (let ((f30-0 (deg-diff (vector-y-angle s3-0) (vector-y-angle s1-0)))) 0.0 (new 'stack-no-clear 'vector) @@ -573,13 +573,13 @@ ) (quaternion-zxy! s5-1 s4-1) ) - (quaternion-pseudo-seek (-> obj joint quat) (-> obj joint quat) s5-1 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) s5-1 (seconds-per-frame)) ) ) ) (vector-z-quaternion! - (-> obj shoot-dir) - (quaternion*! (new 'stack-no-clear 'quaternion) (-> obj joint quat) (-> obj root quat)) + (-> this shoot-dir) + (quaternion*! (new 'stack-no-clear 'quaternion) (-> this joint quat) (-> this root quat)) ) 0 ) @@ -632,9 +632,9 @@ ) ) -(defmethod go-stare centurion ((obj centurion)) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'hostile))) - (go (method-of-object obj hostile)) +(defmethod go-stare centurion ((this centurion)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (go (method-of-object this hostile)) ) ) @@ -663,7 +663,7 @@ :post nav-enemy-simple-post ) -(defmethod centurion-method-180 centurion ((obj centurion)) +(defmethod centurion-method-180 centurion ((this centurion)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -672,20 +672,20 @@ (vf7 :class vf) ) (init-vf0-vector) - (when (-> obj can-shoot?) + (when (-> this can-shoot?) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) - (let* ((a1-0 (-> obj node-list data 29)) + (let* ((a1-0 (-> this node-list data 29)) (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) a1-0)) (s4-0 (new 'stack-no-clear 'vector)) ) (cond - ((-> obj first-shoot?) - (let ((s0-0 (handle->process (-> obj focus handle))) + ((-> this first-shoot?) + (let ((s0-0 (handle->process (-> this focus handle))) (s2-0 (new 'stack-no-clear 'vector)) ) (when s0-0 (set! (-> s2-0 quad) (-> (get-trans (the-as process-focusable s0-0) 3) quad)) - (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) s2-0))) + (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s2-0))) (let* ((f0-0 (vector-length s1-2)) (f0-1 (* 0.0000030517579 f0-0)) (a0-7 s2-0) @@ -714,19 +714,19 @@ ) ) (else - (vector-! s4-0 (-> obj target-pos) s3-0) + (vector-! s4-0 (-> this target-pos) s3-0) ) ) (vector-normalize! s4-0 327680.0) - (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options)) (set! (-> s5-0 pos quad) (-> s3-0 quad)) (set! (-> s5-0 vel quad) (-> s4-0 quad)) ) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (let* ((v1-32 *game-info*) (a0-26 (+ (-> v1-32 attack-id) 1)) ) @@ -734,9 +734,9 @@ (set! (-> s5-0 attack-id) a0-26) ) (set! (-> s5-0 timeout) (seconds 4)) - (spawn-projectile centurion-shot s5-0 obj *default-dead-pool*) + (spawn-projectile centurion-shot s5-0 this *default-dead-pool*) ) - (set! (-> obj can-shoot?) #f) + (set! (-> this can-shoot?) #f) ) 0 (none) @@ -884,14 +884,14 @@ :post enemy-simple-post ) -(defmethod dispose! centurion ((obj centurion)) +(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)) obj) + ((the-as (function enemy none) (find-parent-method centurion 132)) this) (none) ) -(defmethod track-target! centurion ((obj centurion)) +(defmethod track-target! centurion ((this centurion)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -954,7 +954,7 @@ ) ) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user0)) + ((logtest? (-> this fact enemy-options) (enemy-option user0)) (set! (-> *part-id-table* 2101 init-specs 10 initial-valuef) 0.0) (set! (-> *part-id-table* 2101 init-specs 10 random-rangef) 0.0) (set! (-> *part-id-table* 2102 init-specs 10 initial-valuef) 0.0) @@ -975,19 +975,19 @@ (lerp (-> *part-id-table* 2102 init-specs 13 initial-valuef) 10.0 f30-0) ) ) - (let ((a0-11 (handle->process (-> obj focus handle)))) + (let ((a0-11 (handle->process (-> this focus handle)))) (if a0-11 - (centurion-method-181 obj (get-trans (the-as process-focusable a0-11) 3)) + (centurion-method-181 this (get-trans (the-as process-focusable a0-11) 3)) ) ) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (logior! (-> this skel status) (joint-control-status sync-math)) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) (let ((t9-12 (method-of-type nav-enemy track-target!))) - (t9-12 obj) + (t9-12 this) ) - (when (not (logtest? (-> obj draw status) (draw-control-status no-draw))) + (when (not (logtest? (-> this draw status) (draw-control-status no-draw))) (let ((s5-1 (new 'stack-no-clear 'matrix))) - (let* ((a2-10 (-> obj node-list data 12 bone transform)) + (let* ((a2-10 (-> this node-list data 12 bone transform)) (v1-131 (-> a2-10 quad 0)) (a0-18 (-> a2-10 quad 1)) (a1-13 (-> a2-10 quad 2)) @@ -999,16 +999,16 @@ (set! (-> s5-1 trans quad) a2-11) ) (let ((s4-1 (new 'stack-no-clear 'matrix))) - (if (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) (vector-negate-in-place! (the-as vector (-> s5-1 vector))) ) - (matrix-rotate-y! s4-1 (if (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (matrix-rotate-y! s4-1 (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) 2548.6223 -2548.6223 ) ) (matrix*! s5-1 s4-1 s5-1) - (matrix-rotate-z! s4-1 (if (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (matrix-rotate-z! s4-1 (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) 691.76886 -691.76886 ) @@ -1018,7 +1018,7 @@ (let ((a1-20 (-> s5-1 trans))) (let ((v1-143 (-> s5-1 trans))) (let ((a0-25 (-> s5-1 vector))) - (let ((a2-18 (the-as float (if (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (let ((a2-18 (the-as float (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) -997237719 #x43a3d70a ) @@ -1036,22 +1036,22 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-20 quad) vf6) ) - (spawn-with-matrix (-> obj part) s5-1) + (spawn-with-matrix (-> this part) s5-1) ) ) (none) ) ) -(defmethod nav-enemy-method-142 centurion ((obj centurion) (arg0 nav-control)) +(defmethod nav-enemy-method-142 centurion ((this centurion) (arg0 nav-control)) 0 (none) ) -(defmethod centurion-method-182 centurion ((obj centurion) (arg0 vector)) +(defmethod centurion-method-182 centurion ((this centurion) (arg0 vector)) (local-vars (sv-96 int) (sv-112 int)) - (when (nonzero? (-> obj path)) - (let ((s5-0 (-> obj path)) + (when (nonzero? (-> this path)) + (let ((s5-0 (-> this path)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) @@ -1098,7 +1098,7 @@ (t9-0) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-165 self) (set! (-> self joint-enable) #t) (set! (-> self can-shoot?) (the-as basic #t)) @@ -1152,14 +1152,14 @@ (else (when (-> self can-shoot?) (if (and (get-enemy-target self) - (>= (- (current-time) (-> self state-time)) (the int (+ 60.0 (* 0.0036621094 f30-0)))) + (time-elapsed? (-> self state-time) (the int (+ 60.0 (* 0.0036621094 f30-0)))) (check-los? (-> self los) 0) ) (go-virtual fire) ) ) (if (skip-check-los? (-> self los) 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -1275,31 +1275,31 @@ :post nav-enemy-travel-post ) -(defmethod enemy-method-77 centurion ((obj centurion) (arg0 (pointer float))) +(defmethod enemy-method-77 centurion ((this centurion) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 5))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 5)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 5)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 5)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-seek!) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-1 (ash 1 (-> *centurion-global-info* prev-yellow-hit))) - (v1-18 (enemy-method-120 obj 1 a2-1)) - (a1-8 (-> obj draw art-group data (-> *centurion-global-info* yellow-hit-anim v1-18))) + (v1-18 (enemy-method-120 this 1 a2-1)) + (a1-8 (-> this draw art-group data (-> *centurion-global-info* yellow-hit-anim v1-18))) ) (set! (-> *centurion-global-info* prev-yellow-hit) v1-18) - (let ((a0-15 (-> obj skel root-channel 0))) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-8)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1))) (set! (-> a0-15 param 1) (-> arg0 0)) @@ -1310,11 +1310,11 @@ ) (((knocked-type knocked-type-6)) (let* ((a2-3 (ash 1 (-> *centurion-global-info* prev-blue-hit))) - (v1-27 (enemy-method-120 obj 3 a2-3)) - (a1-13 (-> obj draw art-group data (-> *centurion-global-info* blue-hit-anim v1-27))) + (v1-27 (enemy-method-120 this 3 a2-3)) + (a1-13 (-> this draw art-group data (-> *centurion-global-info* blue-hit-anim v1-27))) ) (set! (-> *centurion-global-info* prev-blue-hit) v1-27) - (let ((a0-27 (-> obj skel root-channel 0))) + (let ((a0-27 (-> this skel root-channel 0))) (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-13)) (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-13) frames num-frames) -1))) (set! (-> a0-27 param 1) 1.0) @@ -1324,14 +1324,14 @@ ) ) (else - (let ((s4-0 (if (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (-> obj draw art-group data 21) - (-> obj draw art-group data 21) + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (-> this draw art-group data 21) + (-> this draw art-group data 21) ) ) ) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-30 (-> obj skel root-channel 0))) + (let ((a0-30 (-> this skel root-channel 0))) (set! (-> a0-30 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-30 param 1) (-> arg0 0)) @@ -1346,28 +1346,28 @@ ) ) -(defmethod enemy-method-78 centurion ((obj centurion) (arg0 (pointer float))) +(defmethod enemy-method-78 centurion ((this centurion) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 33))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 33)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 33)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) ) #t ) (else (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((s4-0 (-> obj draw art-group data 8))) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 8))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) + (let ((a0-5 (-> this skel root-channel 0))) (set! (-> a0-5 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-5 param 1) (-> arg0 0)) @@ -1379,13 +1379,13 @@ ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-7 (-> obj skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-7 param 1) (-> arg0 0)) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) @@ -1395,24 +1395,24 @@ ) ) -(defmethod coin-flip? centurion ((obj centurion)) +(defmethod coin-flip? centurion ((this centurion)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 centurion ((obj centurion) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 centurion ((this centurion) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 obj arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 this arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) ) -(defmethod init-enemy-collision! centurion ((obj centurion)) +(defmethod init-enemy-collision! centurion ((this centurion)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1480,72 +1480,79 @@ (set! (-> s5-0 backup-collide-with) (-> v1-27 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-focusable vs centurion. -(defmethod relocate centurion ((obj centurion) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method centurion 7)) this arg0) ) ) -(defmethod init-enemy! centurion ((obj centurion)) +(defmethod init-enemy! centurion ((this centurion)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-centurion" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *centurion-nav-enemy-info*) - (set! (-> obj shield-shot) (the-as uint 0)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 474) obj)) - (let ((v1-11 (-> obj neck))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *centurion-nav-enemy-info*) + (set! (-> this shield-shot) (the-as uint 0)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 474) this)) + (let ((v1-11 (-> this neck))) (set! (-> v1-11 up) (the-as uint 1)) (set! (-> v1-11 nose) (the-as uint 2)) (set! (-> v1-11 ear) (the-as uint 3)) (set-vector! (-> v1-11 twist-max) 10922.667 12743.111 0.0 1.0) (set! (-> v1-11 ignore-angle) 18204.445) ) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd obstacle)) - (set! (-> obj can-take-damage?) #f) - (let ((v1-15 (-> obj nav))) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle)) + (set! (-> this can-take-damage?) #f) + (let ((v1-15 (-> this nav))) (set! (-> v1-15 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 327680.0) - (set! (-> obj joint-enable) #f) - (set! (-> obj joint) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4)) - (add-connection *part-engine* obj 8 obj 318 (new 'static 'vector :x 942.08 :y -163.84 :z 1392.64 :w 163840.0)) + (set-gravity-length (-> this root dynam) 327680.0) + (set! (-> this joint-enable) #f) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) (add-connection *part-engine* - obj + this 8 - obj + this + 318 + (new 'static 'vector :x 942.08 :y -163.84 :z 1392.64 :w 163840.0) + ) + (add-connection + *part-engine* + this + 8 + this 318 (new 'static 'vector :x -942.08 :y -163.84 :z 1392.64 :w 163840.0) ) - (if (logtest? (-> obj fact enemy-options) (enemy-option user0)) - (set! (-> obj hit-points) 1) + (if (logtest? (-> this fact enemy-options) (enemy-option user0)) + (set! (-> this hit-points) 1) ) - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) - (let ((s5-1 (-> obj nav state)) - (v1-36 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43)))) + (let ((s5-1 (-> this nav state)) + (v1-36 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (set! (-> s5-1 heading quad) (-> v1-36 quad)) ) 0 - (set! (-> obj first-shoot?) #t) + (set! (-> this first-shoot?) #t) 0 (none) ) diff --git a/goal_src/jak2/levels/common/enemy/flitter.gc b/goal_src/jak2/levels/common/enemy/flitter.gc index 66d2dee9be..83d3cdef20 100644 --- a/goal_src/jak2/levels/common/enemy/flitter.gc +++ b/goal_src/jak2/levels/common/enemy/flitter.gc @@ -531,13 +531,13 @@ (set! (-> *flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod flitter-method-182 flitter ((obj flitter) (arg0 process-focusable)) - (and (logtest? (-> obj draw status) (draw-control-status on-screen)) +(defmethod flitter-method-182 flitter ((this flitter) (arg0 process-focusable)) + (and (logtest? (-> this draw status) (draw-control-status on-screen)) (let ((s4-0 (camera-matrix))) (camera-pos) (let* ((s3-0 (get-trans arg0 0)) (s5-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 vector 2) 1.0)) - (v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) s3-0) 1.0)) + (v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s3-0) 1.0)) ) (< 0.0 (vector-dot s5-1 v1-7)) ) @@ -545,77 +545,77 @@ ) ) -(defmethod enemy-method-77 flitter ((obj flitter) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 flitter ((this flitter) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) #t ) (((knocked-type knocked-type-6)) - (let ((v1-17 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-17 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-17 (= v1-17 (-> obj draw art-group data 21))) + (if (and v1-17 (= v1-17 (-> this draw art-group data 21))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) 1.0) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) #t ) (else - ((method-of-type nav-enemy enemy-method-77) obj arg0) + ((method-of-type nav-enemy enemy-method-77) this arg0) ) ) ) -(defmethod enemy-method-78 flitter ((obj flitter) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 flitter ((this flitter) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((v1-4 (-> obj skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> v1-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> v1-4 param 1) 1.0) (set! (-> v1-4 frame-num) 0.0) - (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) ) (else - ((method-of-type nav-enemy enemy-method-78) obj arg0) + ((method-of-type nav-enemy enemy-method-78) this arg0) ) ) ) -(defmethod go-stare2 flitter ((obj flitter)) - (if (and (= (-> obj focus aware) (enemy-aware enemy-aware-2)) - (not (nav-enemy-method-163 obj)) - (not (and (-> obj next-state) (= (-> obj next-state name) 'pacing))) +(defmethod go-stare2 flitter ((this flitter)) + (if (and (= (-> this focus aware) (enemy-aware enemy-aware-2)) + (not (nav-enemy-method-163 this)) + (not (and (-> this next-state) (= (-> this next-state name) 'pacing))) ) - (go (method-of-object obj pacing)) - (go (method-of-object obj stare)) + (go (method-of-object this pacing)) + (go (method-of-object this stare)) ) ) @@ -675,7 +675,7 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.6)) + (until (time-elapsed? gp-1 (seconds 0.6)) (suspend) ) ) @@ -697,7 +697,7 @@ ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) + (until (time-elapsed? gp-3 (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) (suspend) ) ) @@ -723,7 +723,7 @@ ) 0 (look-at-target! self (enemy-flag lock-focus)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self root))) (vector-reset! (-> gp-0 transv)) (set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 34.0 38.0))) @@ -820,12 +820,12 @@ :post nav-enemy-falling-post ) -(defmethod enemy-method-99 flitter ((obj flitter) (arg0 process-focusable)) +(defmethod enemy-method-99 flitter ((this flitter) (arg0 process-focusable)) (focus-test? arg0 mech) ) -(defmethod flitter-method-180 flitter ((obj flitter)) - (let* ((s5-0 (handle->process (-> obj focus handle))) +(defmethod flitter-method-180 flitter ((this flitter)) + (let* ((s5-0 (handle->process (-> this focus handle))) (s3-0 (if (type? s5-0 process-focusable) (the-as process-focusable s5-0) ) @@ -833,55 +833,55 @@ ) (when s3-0 (let* ((s5-1 (get-trans s3-0 0)) - (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> obj root trans))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this root trans))) (f30-0 (vector-length s4-1)) ) (cond - ((enemy-method-99 obj s3-0) - (go-flee obj) + ((enemy-method-99 this s3-0) + (go-flee this) ) - ((and (< f30-0 32768.0) (not (flitter-method-182 obj s3-0))) - (go (method-of-object obj circling)) + ((and (< f30-0 32768.0) (not (flitter-method-182 this s3-0))) + (go (method-of-object this circling)) ) - ((< f30-0 (-> obj enemy-info notice-nav-radius)) - (set! (-> obj target-pos quad) (-> s5-1 quad)) + ((< f30-0 (-> this enemy-info notice-nav-radius)) + (set! (-> this target-pos quad) (-> s5-1 quad)) (let ((s3-1 (new 'stack-no-clear 'vector))) (set! (-> s3-1 quad) (-> s4-1 quad)) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> obj root transv quad)) + (set! (-> s5-2 quad) (-> this root transv quad)) (vector-normalize! s5-2 f30-0) (if (>= (vector-dot s3-1 s5-2) 0.98) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) ) ) ) ((< f30-0 32768.0) - (set! (-> obj target-pos quad) (-> s5-1 quad)) + (set! (-> this target-pos quad) (-> s5-1 quad)) ) - ((or (>= (- (current-time) (the-as int (-> obj last-change-dir))) (-> obj change-dir-time)) - (< (vector-vector-distance-squared (-> obj root trans) (-> obj target-pos)) 0.1) + ((or (time-elapsed? (the-as int (-> this last-change-dir)) (-> this change-dir-time)) + (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1) ) - (set! (-> obj last-change-dir) (the-as uint (current-time))) - (set! (-> obj change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) + (set! (-> this last-change-dir) (the-as uint (current-time))) + (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> obj move-angle)))) + (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) - (if (-> obj heading) + (if (-> this heading) (set-vector! s3-2 (-> s4-1 z) (-> s4-1 y) (- (-> s4-1 x)) 1.0) (set-vector! s3-2 (- (-> s4-1 z)) (-> s4-1 y) (-> s4-1 x) 1.0) ) - (set! (-> obj heading) (the-as basic (not (-> obj heading)))) + (set! (-> this heading) (the-as basic (not (-> this heading)))) (let ((f28-1 (rand-vu-float-range (* 0.75 f0-9) f0-9)) (s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 (* -0.6 f30-0))) ) (vector-normalize! s3-2 f28-1) (vector+! s3-2 s3-2 s4-2) ) - (clamp-vector-to-mesh-cross-gaps (-> obj nav state) s3-2) + (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) (vector+! s2-0 s5-1 s3-2) - (set! (-> obj target-pos quad) (-> s2-0 quad)) + (set! (-> this target-pos quad) (-> s2-0 quad)) ) ) ) @@ -894,12 +894,10 @@ ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod flitter-method-181 flitter ((obj flitter)) - (when (>= (- (current-time) (the-as int (-> obj amb-sound-timer))) - (the int (* 300.0 (rand-vu-float-range 1.5 3.0))) - ) - (sound-play "flitter-amb" :position (-> obj root trans)) - (set! (-> obj amb-sound-timer) (the-as uint (current-time))) +(defmethod flitter-method-181 flitter ((this flitter)) + (when (time-elapsed? (the-as int (-> this amb-sound-timer)) (the int (* 300.0 (rand-vu-float-range 1.5 3.0)))) + (sound-play "flitter-amb" :position (-> this root trans)) + (set! (-> this amb-sound-timer) (the-as uint (current-time))) ) (none) ) @@ -916,7 +914,7 @@ ) (set! (-> self root transv y) 33775.48) (ja :num-func num-func-identity :frame-num 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) (until v1-29 (let ((f0-2 102400.0)) @@ -925,7 +923,7 @@ ) (suspend) (ja :num! (seek! max arg1)) - (set! v1-29 (or (ja-done? 0) (>= (- (current-time) (-> self state-time)) arg2))) + (set! v1-29 (or (ja-done? 0) (time-elapsed? (-> self state-time) arg2))) ) ) ) @@ -1012,7 +1010,7 @@ (if gp-0 (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-11 (-> self focus aware))) (cond ((= v1-11 (enemy-aware enemy-aware-3)) @@ -1029,7 +1027,7 @@ ) ) ) - (if (and (get-enemy-target self) (>= (- (current-time) (the-as int (-> self off-screen-timer))) (seconds 0.3))) + (if (and (get-enemy-target self) (time-elapsed? (the-as int (-> self off-screen-timer)) (seconds 0.3))) (go-hostile self) ) ) @@ -1124,15 +1122,15 @@ ) ) -(defmethod flitter-method-183 flitter ((obj flitter)) - (lerp-scale 0.0 1.0 (- (-> obj attack-pos y) (-> obj root trans y)) 13926.4 25600.0) +(defmethod flitter-method-183 flitter ((this flitter)) + (lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0) ) (defstate attack (flitter) :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1167,7 +1165,7 @@ ) (set! s5-2 (cond ((and gp-0 - (< (- (current-time) (-> self state-time)) (seconds 1.5)) + (not (time-elapsed? (-> self state-time) (seconds 1.5))) gp-0 (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))) ) @@ -1244,19 +1242,19 @@ ) ) -(defmethod dispose! flitter ((obj flitter)) +(defmethod dispose! flitter ((this flitter)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) - ((the-as (function nav-enemy none) (find-parent-method flitter 132)) obj) + ((the-as (function nav-enemy none) (find-parent-method flitter 132)) this) (none) ) -(defmethod init-enemy-collision! flitter ((obj flitter)) +(defmethod init-enemy-collision! flitter ((this flitter)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1300,50 +1298,50 @@ (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch connection-minimap vs none. -(defmethod init-enemy! flitter ((obj flitter)) +(defmethod init-enemy! flitter ((this flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flitter" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *flitter-nav-enemy-info*) - (set! (-> obj move-angle) 10922.667) - (set! (-> obj heading) (the-as basic (if (= (rand-vu-int-range 0 1) 1) - #t - #f - ) - ) + (init-enemy-behaviour-and-stats! this *flitter-nav-enemy-info*) + (set! (-> this move-angle) 10922.667) + (set! (-> this heading) (the-as basic (if (= (rand-vu-int-range 0 1) 1) + #t + #f + ) + ) ) - (set! (-> obj change-dir-time) 0) - (set! (-> obj off-screen-timer) (the-as uint 0)) - (set! (-> obj amb-sound-timer) (the-as uint 0)) + (set! (-> this change-dir-time) 0) + (set! (-> this off-screen-timer) (the-as uint 0)) + (set! (-> this amb-sound-timer) (the-as uint 0)) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x 942.08 :y -860.16 :z 1269.76 :w 163840.0) ) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x -942.08 :y -860.16 :z 1269.76 :w 163840.0) ) - (set-gravity-length (-> obj root dynam) 491520.0) + (set-gravity-length (-> this root dynam) 491520.0) (let* ((s4-1 "pebble1-ruins") - (v1-15 (-> obj level name)) + (v1-15 (-> this level name)) (s5-2 (cond ((= v1-15 'strip) @@ -1381,6 +1379,6 @@ (the-as float s5-2) ) ) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) (none) ) diff --git a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc index 62d9fc4b1c..78b5215f19 100644 --- a/goal_src/jak2/levels/common/enemy/fodder/fodder.gc +++ b/goal_src/jak2/levels/common/enemy/fodder/fodder.gc @@ -209,70 +209,70 @@ (set! (-> *fodder-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod look-at-target! fodder ((obj fodder) (arg0 enemy-flag)) +(defmethod look-at-target! fodder ((this fodder) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" (let ((parent-method (method-of-type nav-enemy look-at-target!))) - (parent-method obj arg0) + (parent-method this arg0) ) - (if (nonzero? (-> obj left-eye)) - (mode-set! (-> obj left-eye) (joint-mod-mode polar-look-at)) + (if (nonzero? (-> this left-eye)) + (mode-set! (-> this left-eye) (joint-mod-mode polar-look-at)) ) - (if (nonzero? (-> obj right-eye)) - (mode-set! (-> obj right-eye) (joint-mod-mode polar-look-at)) + (if (nonzero? (-> this right-eye)) + (mode-set! (-> this right-eye) (joint-mod-mode polar-look-at)) ) 0 (none) ) -(defmethod stop-looking-at-target! fodder ((obj fodder)) +(defmethod stop-looking-at-target! fodder ((this fodder)) "Will unset [[enemy-flag::death-start]] and [[enemy-flag::lock-focus]] and call [[joint-mod::shut-down]] if applicable" (let ((parent-method (method-of-type nav-enemy stop-looking-at-target!))) - (parent-method obj) + (parent-method this) ) - (if (nonzero? (-> obj left-eye)) - (shut-down (-> obj left-eye)) + (if (nonzero? (-> this left-eye)) + (shut-down (-> this left-eye)) ) - (if (nonzero? (-> obj right-eye)) - (shut-down (-> obj right-eye)) + (if (nonzero? (-> this right-eye)) + (shut-down (-> this right-eye)) ) 0 (none) ) -(defmethod look-at-position! fodder ((obj fodder) (position vector)) +(defmethod look-at-position! fodder ((this fodder) (position vector)) "Adjusts the eyes to look at particular position, or the focused target @param position If this is provided, it will be used with [[joint-mod::target-set!]] to adjust the eyes, otherwise the `focus` position is used @return TODO - unsure what the return value is, but it seems to make the eyes more lazy" (when (not position) - (let ((focus-proc (handle->process (-> obj focus handle)))) + (let ((focus-proc (handle->process (-> this focus handle)))) (if focus-proc (set! position (get-trans (the-as process-focusable focus-proc) 2)) (return 0.0) ) ) ) - (when (nonzero? (-> obj left-eye)) - (target-set! (-> obj left-eye) position) - (when (nonzero? (-> obj left-eye)) - (set! (-> obj left-eye polar-external-tilt-max) (-> obj right-eye polar-internal-tilt-max)) - (set! (-> obj left-eye polar-external-radius) (-> obj right-eye polar-internal-radius)) + (when (nonzero? (-> this left-eye)) + (target-set! (-> this left-eye) position) + (when (nonzero? (-> this left-eye)) + (set! (-> this left-eye polar-external-tilt-max) (-> this right-eye polar-internal-tilt-max)) + (set! (-> this left-eye polar-external-radius) (-> this right-eye polar-internal-radius)) ) ) - (when (nonzero? (-> obj right-eye)) - (target-set! (-> obj right-eye) position) - (when (nonzero? (-> obj right-eye)) - (set! (-> obj right-eye polar-external-tilt-max) (-> obj left-eye polar-internal-tilt-max)) - (set! (-> obj right-eye polar-external-radius) (-> obj left-eye polar-internal-radius)) + (when (nonzero? (-> this right-eye)) + (target-set! (-> this right-eye) position) + (when (nonzero? (-> this right-eye)) + (set! (-> this right-eye polar-external-tilt-max) (-> this left-eye polar-internal-tilt-max)) + (set! (-> this right-eye polar-external-radius) (-> this left-eye polar-internal-radius)) ) ) ) -(defmethod fodder-method-180 fodder ((obj fodder)) +(defmethod fodder-method-180 fodder ((this fodder)) "@TODO no idea, never seems to do anything because the actor-group-count is always 0" - (when (>= (- (current-time) (-> obj look-at-other-time)) (seconds 0.25)) - (dotimes (group-idx (-> obj actor-group-count)) - (let ((group (-> obj actor-group group-idx))) + (when (time-elapsed? (-> this look-at-other-time) (seconds 0.25)) + (dotimes (group-idx (-> this actor-group-count)) + (let ((group (-> this actor-group group-idx))) (dotimes (actor-idx (-> group length)) (let* ((actor-proc (-> group data actor-idx actor extra process)) (fodder-proc (if (type? actor-proc fodder) @@ -280,37 +280,36 @@ ) ) ) - (when (and fodder-proc - (!= fodder-proc obj) - (>= (- (current-time) (-> fodder-proc look-at-other-time)) (seconds 0.25)) + (when (and fodder-proc (!= fodder-proc this) (time-elapsed? (-> fodder-proc look-at-other-time) (seconds 0.25))) + (let* ((dir-to-other-fodder + (vector-! (new 'stack-no-clear 'vector) (-> fodder-proc root trans) (-> this root trans)) ) - (let* ((dir-to-other-fodder (vector-! (new 'stack-no-clear 'vector) (-> fodder-proc root trans) (-> obj root trans))) (dir-length (vector-length dir-to-other-fodder)) ) (when (< dir-length 8192.0) (vector-float*! dir-to-other-fodder dir-to-other-fodder (/ 1.0 dir-length)) (let ((f30-0 (vector-dot dir-to-other-fodder - (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat)) vector 2) + (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)) vector 2) ) ) ) (when (< (cos 14563.556) f30-0) - (let ((channel (ja-channel-float! (the-as art-joint-anim (-> obj draw art-group data 15)) 0.0 0.0 0.0))) + (let ((channel (ja-channel-float! (the-as art-joint-anim (-> this draw art-group data 15)) 0.0 0.0 0.0))) (when channel - (set! (-> obj skel interp-select 0) #xe00010) - (set! (-> obj skel interp-select 1) 0) + (set! (-> this skel interp-select 0) #xe00010) + (set! (-> this skel interp-select 1) 0) (set! (-> channel param 0) 1.0) (set! (-> channel param 1) 1.0) (set! (-> channel param 2) 1.0) (set! (-> channel num-func) num-func-interp1-play!) ) ) - (set! (-> obj look-at-other-time) (current-time)) - (set! (-> obj look-at-other) (process->handle fodder-proc)) - (set! (-> obj neck-away-from) #f) - (set! (-> fodder-proc look-at-other-time) (current-time)) - (set! (-> fodder-proc look-at-other) (process->handle obj)) + (set-time! (-> this look-at-other-time)) + (set! (-> this look-at-other) (process->handle fodder-proc)) + (set! (-> this neck-away-from) #f) + (set-time! (-> fodder-proc look-at-other-time)) + (set! (-> fodder-proc look-at-other) (process->handle this)) (set! (-> fodder-proc neck-away-from) #t) ) ) @@ -326,19 +325,19 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod track-target! fodder ((obj fodder)) +(defmethod track-target! fodder ((this fodder)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((parent-method (method-of-type nav-enemy track-target!))) - (parent-method obj) + (parent-method this) ) (let ((proc (the-as process-drawable #f))) (cond - ((and (< (- (current-time) (-> obj look-at-other-time)) (seconds 0.5)) + ((and (not (time-elapsed? (-> this look-at-other-time) (seconds 0.5))) (begin - (let ((other-proc (handle->process (-> obj look-at-other)))) + (let ((other-proc (handle->process (-> this look-at-other)))) (set! proc (if (type? other-proc process-drawable) (the-as process-drawable other-proc) ) @@ -348,27 +347,27 @@ ) ) (let ((s5-1 (vector<-cspace! (new 'static 'vector) (-> proc node-list data 5)))) - (look-at-position! obj s5-1) + (look-at-position! this s5-1) (cond - ((zero? (-> obj neck)) + ((zero? (-> this neck)) ) - ((-> obj neck-away-from) + ((-> this neck-away-from) (let ((s4-0 (new 'static 'vector))) - (let ((v1-11 (vector<-cspace! (new 'static 'vector) (-> obj node-list data 5)))) + (let ((v1-11 (vector<-cspace! (new 'static 'vector) (-> this node-list data 5)))) (vector-! s4-0 v1-11 s5-1) (vector+! s4-0 s4-0 v1-11) ) - (target-set! (-> obj neck) s4-0) + (target-set! (-> this neck) s4-0) ) ) (else - (target-set! (-> obj neck) s5-1) + (target-set! (-> this neck) s5-1) ) ) ) ) - ((logtest? (-> obj enemy-flags) (enemy-flag lock-focus)) - (look-at-position! obj (the-as vector #f)) + ((logtest? (-> this enemy-flags) (enemy-flag lock-focus)) + (look-at-position! this (the-as vector #f)) ) ) ) @@ -414,7 +413,7 @@ (set! (-> _self nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until (not #f) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.25)) @@ -550,17 +549,17 @@ ) ) -(defmethod fodder-method-182 fodder ((obj fodder)) +(defmethod fodder-method-182 fodder ((this fodder)) (ja-channel-push! 2 (seconds 0.2)) - (let ((s5-0 (-> obj skel root-channel 0))) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info hostile-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info hostile-anim))) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) - (let ((s5-1 (-> obj skel root-channel 1))) + (let ((s5-1 (-> this skel root-channel 1))) (let* ((v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-11 (the-as number (logior #x3f800000 v1-10))) (f0-3 (+ -1.0 (the-as float v1-11))) @@ -570,7 +569,7 @@ ) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 8)) + (the-as art-joint-anim (-> this draw art-group data 8)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) @@ -626,7 +625,7 @@ (set! (-> v1-22 turning-acceleration) 0.0) ) 0 - (set! (-> self slow-timer) (current-time)) + (set-time! (-> self slow-timer)) (ja-channel-push! 1 (seconds 0.08)) (ja :group! (-> self draw art-group data (-> self enemy-info idle-anim))) (ja :num-func num-func-identity :frame-num 0.0) @@ -646,9 +645,9 @@ ) (when (and (nonzero? (-> self slow-timer)) (zero? (-> self fast-timer)) - (>= (- (current-time) (-> self slow-timer)) (seconds 0.35)) + (time-elapsed? (-> self slow-timer) (seconds 0.35)) ) - (set! (-> self fast-timer) (current-time)) + (set-time! (-> self fast-timer)) (ja-channel-push! 1 (seconds 0.02)) (let ((v1-55 (-> self attack-type))) (cond @@ -704,7 +703,7 @@ ) ) (cond - ((>= (- (current-time) (-> self fast-timer)) v1-82) + ((time-elapsed? (-> self fast-timer) v1-82) (set! (-> self slow-timer) 0) (set! (-> self fast-timer) 0) (let ((v1-83 (-> self nav))) @@ -748,7 +747,7 @@ ) (when (zero? (-> self attack-type)) (let ((f0-20 20480.0)) - (when (and (< f30-0 (* f0-20 f0-20)) (>= (- (current-time) (-> self look-at-other-time)) (seconds 0.125))) + (when (and (< f30-0 (* f0-20 f0-20)) (time-elapsed? (-> self look-at-other-time) (seconds 0.125))) (let ((v1-117 (ja-channel-float! (the-as art-joint-anim fodder-snap-ja) 0.0 0.0 0.0))) (when v1-117 (set! (-> self skel interp-select 0) #xe00010) @@ -759,7 +758,7 @@ (set! (-> v1-117 num-func) num-func-interp1-play!) ) ) - (set! (-> self look-at-other-time) (current-time)) + (set-time! (-> self look-at-other-time)) ) ) ) @@ -884,25 +883,25 @@ ) ) -(defmethod enemy-method-77 fodder ((obj fodder) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 fodder ((this fodder) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((a2-0 (ash 1 (-> *fodder-global-info* prev-blue-hit))) - (v1-3 (enemy-method-120 obj 3 a2-0)) - (s5-1 (-> obj draw art-group data (-> *fodder-global-info* blue-hit-anim v1-3 anim-index))) + (v1-3 (enemy-method-120 this 3 a2-0)) + (s5-1 (-> this draw art-group data (-> *fodder-global-info* blue-hit-anim v1-3 anim-index))) ) (set! (-> *fodder-global-info* prev-blue-hit) v1-3) - (let ((v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-6 (= v1-6 (-> obj draw art-group data 17))) + (if (and v1-6 (= v1-6 (-> this draw art-group data 17))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-18 (-> obj skel root-channel 0))) + (let ((a0-18 (-> this skel root-channel 0))) (set! (-> a0-18 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-18 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-18 param 1) 1.0) @@ -912,9 +911,9 @@ ) ) (else - (let ((s4-0 (-> obj draw art-group data 16))) + (let ((s4-0 (-> this draw art-group data 16))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-20 (-> obj skel root-channel 0))) + (let ((a0-20 (-> this skel root-channel 0))) (set! (-> a0-20 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-20 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-20 param 1) (-> arg0 0)) @@ -927,14 +926,14 @@ #t ) -(defmethod enemy-method-78 fodder ((obj fodder) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 fodder ((this fodder) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) #f ) (else - (let ((v1-5 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-3 (-> obj skel root-channel 0)) + (let ((v1-5 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-3 (-> this skel root-channel 0)) ) (set! (-> a0-3 frame-group) (the-as art-joint-anim v1-5)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-5) frames num-frames) -1))) @@ -947,8 +946,8 @@ ) ) -(defmethod fodder-method-181 fodder ((obj fodder) (arg0 symbol)) - (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) +(defmethod fodder-method-181 fodder ((this fodder) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 (set! (-> v1-3 prim-core collide-as) (collide-spec enemy)) @@ -964,14 +963,14 @@ (none) ) -(defmethod coin-flip? fodder ((obj fodder)) +(defmethod coin-flip? fodder ((this fodder)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod init-enemy-collision! fodder ((obj fodder)) +(defmethod init-enemy-collision! fodder ((this fodder)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1027,21 +1026,21 @@ (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch nav-enemy vs fodder. -(defmethod relocate fodder ((obj fodder) (arg0 int)) - (if (nonzero? (-> obj left-eye)) - (&+! (-> obj left-eye) arg0) +(defmethod relocate fodder ((this fodder) (arg0 int)) + (if (nonzero? (-> this left-eye)) + (&+! (-> this left-eye) arg0) ) - (if (nonzero? (-> obj right-eye)) - (&+! (-> obj right-eye) arg0) + (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)) obj arg0)) + (the-as fodder ((the-as (function nav-enemy int nav-enemy) (find-parent-method fodder 7)) this arg0)) ) (defun fodder-setup-eye-control ((arg0 joint-mod)) @@ -1057,44 +1056,44 @@ (set! (-> arg0 ignore-angle) 30947.555) ) -(defmethod init-enemy! fodder ((obj fodder)) +(defmethod init-enemy! fodder ((this fodder)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fodder" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *fodder-nav-enemy-info*) - (when (zero? (-> obj left-eye)) - (set! (-> obj left-eye) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 23)) - (fodder-setup-eye-control (-> obj left-eye)) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *fodder-nav-enemy-info*) + (when (zero? (-> this left-eye)) + (set! (-> this left-eye) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 23)) + (fodder-setup-eye-control (-> this left-eye)) ) - (when (zero? (-> obj right-eye)) - (set! (-> obj right-eye) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 24)) - (fodder-setup-eye-control (-> obj right-eye)) + (when (zero? (-> this right-eye)) + (set! (-> this right-eye) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 24)) + (fodder-setup-eye-control (-> this right-eye)) ) - (let ((v1-16 (-> obj neck))) + (let ((v1-16 (-> this neck))) (set! (-> v1-16 up) (the-as uint 1)) (set! (-> v1-16 nose) (the-as uint 2)) (set! (-> v1-16 ear) (the-as uint 0)) (set-vector! (-> v1-16 twist-max) 10922.667 7281.778 0.0 1.0) (set! (-> v1-16 ignore-angle) 18204.445) ) - (set! (-> obj look-at-other) (the-as handle #f)) - (set! (-> obj look-at-other-time) 0) - (set! (-> obj neck-away-from) #f) - (let ((v1-18 (-> obj nav))) + (set! (-> this look-at-other) (the-as handle #f)) + (set! (-> this look-at-other-time) 0) + (set! (-> this neck-away-from) #f) + (let ((v1-18 (-> this nav))) (set! (-> v1-18 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (fodder-method-181 obj #f) + (set-gravity-length (-> this root dynam) 573440.0) + (fodder-method-181 this #f) 0 (none) ) -(defmethod enemy-method-99 fodder ((obj fodder) (arg0 process-focusable)) +(defmethod enemy-method-99 fodder ((this fodder) (arg0 process-focusable)) (focus-test? arg0 mech) ) diff --git a/goal_src/jak2/levels/common/enemy/grenadier.gc b/goal_src/jak2/levels/common/enemy/grenadier.gc index fbe87524b8..dcc17c9271 100644 --- a/goal_src/jak2/levels/common/enemy/grenadier.gc +++ b/goal_src/jak2/levels/common/enemy/grenadier.gc @@ -292,22 +292,22 @@ (set! (-> *grenadier-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler grenadier ((obj grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler grenadier ((this grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit-knocked) - (when (= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (if (and (< (- (current-time) (-> obj suppress-knockaside-timer)) (seconds 0.6)) - (and (-> obj next-state) (= (-> obj next-state name) 'attack)) - (nonzero? (-> obj hit-points)) + (when (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (if (and (not (time-elapsed? (-> this suppress-knockaside-timer) (seconds 0.6))) + (and (-> this next-state) (= (-> this next-state name) 'attack)) + (nonzero? (-> this hit-points)) ) (return #t) ) - (logior! (-> obj status-flags) (grenadier-flags grflags-0)) - (set! (-> obj suppress-knockaside-timer) (current-time)) + (logior! (-> this status-flags) (grenadier-flags grflags-0)) + (set-time! (-> this suppress-knockaside-timer)) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('notify) (cond @@ -322,16 +322,16 @@ (set! (-> v1-23 param 3) (-> arg3 param 3)) (set! (-> v1-23 param 4) (-> arg3 param 4)) (set! (-> v1-23 param 5) (-> arg3 param 5)) - (send-event-function obj v1-23) + (send-event-function this v1-23) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -346,26 +346,26 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod grenadier-method-182 grenadier ((obj grenadier) (arg0 vector)) - (cloest-point-on-mesh (-> obj nav) arg0 arg0 (the-as nav-poly #f)) - (set! (-> obj bank final-pos quad) (-> arg0 quad)) - (set! (-> obj bank tangent-pos quad) (-> arg0 quad)) - (set! (-> obj move-pos quad) (-> obj bank tangent-pos quad)) +(defmethod grenadier-method-182 grenadier ((this grenadier) (arg0 vector)) + (cloest-point-on-mesh (-> this nav) arg0 arg0 (the-as nav-poly #f)) + (set! (-> this bank final-pos quad) (-> arg0 quad)) + (set! (-> this bank tangent-pos quad) (-> arg0 quad)) + (set! (-> this move-pos quad) (-> this bank tangent-pos quad)) (none) ) -(defmethod grenadier-method-181 grenadier ((obj grenadier)) - (let ((s5-0 (handle->process (-> obj focus handle)))) +(defmethod grenadier-method-181 grenadier ((this grenadier)) + (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 (cond - ((-> obj hostile-path) - (let* ((s4-0 (-> obj hostile-path)) + ((-> this hostile-path) + (let* ((s4-0 (-> this hostile-path)) (f30-0 (get-path-percentage-at-furthest-point s4-0 (get-trans (the-as process-focusable s5-0) 0))) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> obj heading) (not (-> obj heading))) + (set! (-> this heading) (not (-> this heading))) (let* ((f0-0 (rand-vu-float-range 0.2 0.45)) - (f0-1 (if (-> obj heading) + (f0-1 (if (-> this heading) (+ f30-0 f0-0) (- f30-0 f0-0) ) @@ -379,11 +379,11 @@ ) (get-point-at-percent-along-path! s4-0 s3-1 f0-1 'interp) ) - (grenadier-method-182 obj s3-1) + (grenadier-method-182 this s3-1) ) ) (else - (let* ((s4-1 (-> obj root)) + (let* ((s4-1 (-> this root)) (a0-10 (get-trans (the-as process-focusable s5-0) 0)) (v1-27 (vector-! (new 'stack-no-clear 'vector) a0-10 (-> s4-1 trans))) ) @@ -391,13 +391,13 @@ (let ((s3-2 (new 'stack-no-clear 'vector)) (s2-1 (new 'stack-no-clear 'vector)) ) - (set! (-> obj heading) (not (-> obj heading))) - (if (-> obj heading) + (set! (-> this heading) (not (-> this heading))) + (if (-> this heading) (set-vector! s3-2 (-> v1-27 z) (-> v1-27 y) (- (-> v1-27 x)) 1.0) (set-vector! s3-2 (- (-> v1-27 z)) (-> v1-27 y) (-> v1-27 x) 1.0) ) (vector-normalize! s3-2 (* 4096.0 (rand-vu-float-range 14.0 18.0))) - (grenadier-method-182 obj (vector+! s2-1 (-> s4-1 trans) s3-2)) + (grenadier-method-182 this (vector+! s2-1 (-> s4-1 trans) s3-2)) ) ) ) @@ -541,7 +541,7 @@ ) ) ) - (when (or (>= (- (current-time) (-> self state-time)) (rand-vu-int-range (seconds 3) (seconds 9))) + (when (or (time-elapsed? (-> self state-time) (rand-vu-int-range (seconds 3) (seconds 9))) (>= 8192.0 (vector-vector-xz-distance (-> self root trans) (-> self bank final-pos))) ) (if (and (handle->process (-> self focus handle)) @@ -601,7 +601,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -613,7 +613,7 @@ ) :trans (behavior () (let ((f0-0 (vector-vector-xz-distance (-> self root trans) (-> self move-pos)))) - (if (or (>= 12288.0 f0-0) (>= (- (current-time) (-> self state-time)) (seconds 6))) + (if (or (>= 12288.0 f0-0) (time-elapsed? (-> self state-time) (seconds 6))) (go-hostile self) ) ) @@ -645,7 +645,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -707,13 +707,13 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. -(defmethod enemy-method-78 grenadier ((obj grenadier) (arg0 (pointer float))) +(defmethod enemy-method-78 grenadier ((this grenadier) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((s4-0 (-> obj draw art-group data 30))) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 30))) (ja-channel-push! 1 (seconds 0.067)) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-3 param 1) (-> arg0 0)) @@ -724,13 +724,13 @@ ) #t ) - ((or (= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) (zero? (-> obj incoming knocked-type))) + ((or (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) (zero? (-> this incoming knocked-type))) #f ) - ((> (-> obj hit-points) 0) + ((> (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.067)) - (let ((a1-4 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-9 (-> obj skel root-channel 0)) + (let ((a1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-9 (-> this skel root-channel 0)) ) (set! (-> a0-9 frame-group) (the-as art-joint-anim a1-4)) (set! (-> a0-9 param 0) (the float (+ (-> (the-as art-joint-anim a1-4) frames num-frames) -1))) @@ -742,14 +742,14 @@ ) (else (ja-channel-push! 1 (seconds 0.067)) - (let ((a0-11 (-> obj skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> obj draw art-group data 33))) + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 33)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) ) (set! (-> a0-11 param 1) (-> arg0 0)) (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> obj draw art-group data 33)) num-func-seek!) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) ) #t ) @@ -1055,19 +1055,19 @@ ) ) -(defmethod go-hostile grenadier ((obj grenadier)) - (if (and (and (-> obj next-state) (= (-> obj next-state name) 'knocked)) - (and (logtest? (-> obj status-flags) (grenadier-flags grflags-0)) - (handle->process (-> obj focus handle)) - (not (logtest? (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) +(defmethod go-hostile grenadier ((this grenadier)) + (if (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) + (and (logtest? (-> this status-flags) (grenadier-flags grflags-0)) + (handle->process (-> this focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) ) ) ) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) - ((method-of-type nav-enemy go-hostile) obj) + ((method-of-type nav-enemy go-hostile) this) ) (defstate victory (grenadier) @@ -1096,9 +1096,9 @@ ) ) -(defmethod nav-enemy-method-142 grenadier ((obj grenadier) (arg0 nav-control)) +(defmethod nav-enemy-method-142 grenadier ((this grenadier) (arg0 nav-control)) (local-vars (a0-4 int) (a0-6 int)) - (b! (logtest? (-> obj status-flags) (grenadier-flags grflags-1)) cfg-6 :delay (empty-form)) + (b! (logtest? (-> this status-flags) (grenadier-flags grflags-1)) cfg-6 :delay (empty-form)) (let ((v1-3 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) @@ -1125,7 +1125,7 @@ (.sync.p) (label cfg-3) 0 - (forward-up-nopitch->quaternion (-> obj root quat) v1-3 a2-0) + (forward-up-nopitch->quaternion (-> this root quat) v1-3 a2-0) ) (let ((v1-5 (-> *perf-stats* data 33))) (b! (zero? (-> v1-5 ctrl)) cfg-5 :delay (nop!)) @@ -1144,23 +1144,23 @@ (none) ) -(defmethod track-target! grenadier ((obj grenadier)) +(defmethod track-target! grenadier ((this grenadier)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 34)))) - (spawn (-> obj part) a1-1) + (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 34)))) + (spawn (-> this part) a1-1) ) (none) ) -(defmethod init-enemy-collision! grenadier ((obj grenadier)) +(defmethod init-enemy-collision! grenadier ((this grenadier)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1239,37 +1239,37 @@ (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-focusable vs grenadier. -(defmethod relocate grenadier ((obj grenadier) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(defmethod relocate grenadier ((this grenadier) (arg0 int)) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) arg0) ) - (when (-> obj hostile-path) - (if (nonzero? (-> obj hostile-path)) - (&+! (-> obj hostile-path) arg0) + (when (-> this hostile-path) + (if (nonzero? (-> this hostile-path)) + (&+! (-> this hostile-path) arg0) ) ) (the-as grenadier - ((the-as (function process-focusable int process-focusable) (find-parent-method grenadier 7)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method grenadier 7)) this arg0) ) ) -(defmethod init-enemy! grenadier ((obj grenadier)) +(defmethod init-enemy! grenadier ((this grenadier)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grenadier" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *grenadier-nav-enemy-info*) - (let ((v1-5 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *grenadier-nav-enemy-info*) + (let ((v1-5 (-> this neck))) (when v1-5 (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -1278,36 +1278,43 @@ (set! (-> v1-5 ignore-angle) 30947.555) ) ) - (let ((v1-6 (-> obj nav))) + (let ((v1-6 (-> this nav))) (set! (-> v1-6 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (set! (-> obj heading) (if (rand-vu-percent? 0.5) - #t - #f - ) + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this heading) (if (rand-vu-percent? 0.5) + #t + #f + ) ) - (set! (-> obj move-angle) 5461.3335) - (set! (-> obj status-flags) (grenadier-flags)) - (set! (-> obj suppress-knockaside-timer) 0) - (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) - (set! (-> obj joint) (new 'process 'joint-mod-blend-world obj 17 #f 0.0)) - (logior! (-> obj joint blend-flags) (joint-mod-blend-flags rotation)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1150) obj)) - (set! (-> obj hostile-path) (new 'process 'path-control obj 'hostile 0.0 (-> obj entity) #t)) - (if (zero? (-> obj hostile-path)) - (set! (-> obj hostile-path) #f) + (set! (-> this move-angle) 5461.3335) + (set! (-> this status-flags) (grenadier-flags)) + (set! (-> this suppress-knockaside-timer) 0) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (set! (-> this joint) (new 'process 'joint-mod-blend-world this 17 #f 0.0)) + (logior! (-> this joint blend-flags) (joint-mod-blend-flags rotation)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1150) this)) + (set! (-> this hostile-path) (new 'process 'path-control this 'hostile 0.0 (-> this entity) #t)) + (if (zero? (-> this hostile-path)) + (set! (-> this hostile-path) #f) ) - (if (-> obj hostile-path) - (logior! (-> obj hostile-path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (-> this hostile-path) + (logior! (-> this hostile-path flags) (path-control-flag display draw-line draw-point draw-text)) ) - (add-connection *part-engine* obj 24 obj 318 (new 'static 'vector :x 532.48 :y -81.92 :z 1515.52 :w 163840.0)) (add-connection *part-engine* - obj + this 24 - obj + this + 318 + (new 'static 'vector :x 532.48 :y -81.92 :z 1515.52 :w 163840.0) + ) + (add-connection + *part-engine* + this + 24 + this 318 (new 'static 'vector :x -532.48 :y -81.92 :z 1515.52 :w 163840.0) ) diff --git a/goal_src/jak2/levels/common/enemy/grunt.gc b/goal_src/jak2/levels/common/enemy/grunt.gc index a5b1a80263..43bb20ad6a 100644 --- a/goal_src/jak2/levels/common/enemy/grunt.gc +++ b/goal_src/jak2/levels/common/enemy/grunt.gc @@ -337,76 +337,76 @@ (set! (-> *grunt-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler grunt ((obj grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler grunt ((this grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (let ((s5-1 (-> obj incoming knocked-type))) + ((zero? (-> this hit-points)) + (let ((s5-1 (-> this incoming knocked-type))) (cond ((and (= s5-1 (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-33 (-> obj next-state name))) - (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) - ) + (not (and (-> this next-state) (let ((v1-33 (-> this next-state name))) + (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ((or (= s5-1 (knocked-type knocked-type-4)) (= s5-1 (knocked-type knocked-type-6))) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - (go (method-of-object obj knocked)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) + (go (method-of-object this knocked)) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod go-ambush grunt ((obj grunt)) +(defmethod go-ambush grunt ((this grunt)) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user10)) - (go (method-of-object obj falling-ambush)) + ((logtest? (-> this fact enemy-options) (enemy-option user10)) + (go (method-of-object this falling-ambush)) ) - ((logtest? (-> obj fact enemy-options) (enemy-option user11)) - (go (method-of-object obj jumping-ambush)) + ((logtest? (-> this fact enemy-options) (enemy-option user11)) + (go (method-of-object this jumping-ambush)) ) (else - (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> obj name)) - (go-hostile obj) + (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> this name)) + (go-hostile this) ) ) ) @@ -459,7 +459,7 @@ ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.2)) + (until (time-elapsed? gp-0 (seconds 0.2)) (suspend) ) ) @@ -486,13 +486,13 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 grunt ((obj grunt)) - (case (-> obj jump-why) +(defmethod enemy-method-93 grunt ((this grunt)) + (case (-> this jump-why) ((2) - (go (method-of-object obj jumping-ambush-cont)) + (go (method-of-object this jumping-ambush-cont)) ) (else - ((method-of-type nav-enemy enemy-method-93) obj) + ((method-of-type nav-enemy enemy-method-93) this) ) ) (none) @@ -675,7 +675,7 @@ ) ) -(defmethod grunt-method-184 grunt ((obj grunt) (arg0 float)) +(defmethod grunt-method-184 grunt ((this grunt) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -683,12 +683,12 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((gp-0 (get-enemy-target obj))) + (let ((gp-0 (get-enemy-target this))) (when gp-0 (let ((v1-3 (get-trans gp-0 0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector-! s4-0 v1-3 (-> obj root trans)) + (vector-! s4-0 v1-3 (-> this root trans)) (.lvf vf1 (&-> s4-0 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -702,18 +702,18 @@ (f0-2 12288.0) ) (when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0)) - (let ((f26-0 (quaternion-y-angle (-> obj root quat))) + (let ((f26-0 (quaternion-y-angle (-> this root quat))) (f0-7 (atan (-> s4-0 x) (-> s4-0 z))) (f1-0 1228.8) ) (cond ((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7)))) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) ((let ((f0-10 12288.0)) (< f30-0 (* f0-10 f0-10)) ) - (go (method-of-object obj spin-attack)) + (go (method-of-object this spin-attack)) ) ) ) @@ -1160,39 +1160,39 @@ ) ) -(defmethod enemy-method-77 grunt ((obj grunt) (arg0 (pointer float))) +(defmethod enemy-method-77 grunt ((this grunt) (arg0 (pointer float))) (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (let ((v1-2 (ash 1 (-> *grunt-global-info* prev-yellow-hit-anim-index))) - (a0-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (a0-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and a0-7 (or (= a0-7 (-> obj draw art-group data 16)) - (= a0-7 (-> obj draw art-group data 38)) - (= a0-7 (-> obj draw art-group data 39)) - (= a0-7 (-> obj draw art-group data 40)) + (if (and a0-7 (or (= a0-7 (-> this draw art-group data 16)) + (= a0-7 (-> this draw art-group data 38)) + (= a0-7 (-> this draw art-group data 39)) + (= a0-7 (-> this draw art-group data 40)) ) ) (set! a2-3 (logior v1-2 4)) (set! a2-3 (logior v1-2 8)) ) ) - (let ((s4-0 (enemy-method-120 obj 4 a2-3))) + (let ((s4-0 (enemy-method-120 this 4 a2-3))) (set! (-> *grunt-global-info* prev-yellow-hit-anim-index) s4-0) - (set! (-> obj yellow-hit-anim) (-> *grunt-global-info* yellow-hit-anim s4-0)) - (let ((v1-11 (get-rand-int obj 3))) + (set! (-> this yellow-hit-anim) (-> *grunt-global-info* yellow-hit-anim s4-0)) + (let ((v1-11 (get-rand-int this 3))) (if (= s4-0 3) (set! v1-11 2) ) - (set! (-> obj unknown-byte-n1k2n3) v1-11) + (set! (-> this unknown-byte-n1k2n3) v1-11) ) ) - (let ((s4-1 (-> obj draw art-group data (-> obj yellow-hit-anim anim-index)))) + (let ((s4-1 (-> this draw art-group data (-> this yellow-hit-anim anim-index)))) (ja-channel-push! 1 0) - (let ((a0-19 (-> obj skel root-channel 0))) + (let ((a0-19 (-> this skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-19 param 1) (-> arg0 0)) @@ -1203,33 +1203,33 @@ #t ) (((knocked-type knocked-type-6)) - (let* ((v1-24 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let* ((v1-24 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) - (s4-2 (and v1-24 (or (= v1-24 (-> obj draw art-group data 16)) - (= v1-24 (-> obj draw art-group data 38)) - (= v1-24 (-> obj draw art-group data 39)) - (= v1-24 (-> obj draw art-group data 40)) + (s4-2 (and v1-24 (or (= v1-24 (-> this draw art-group data 16)) + (= v1-24 (-> this draw art-group data 38)) + (= v1-24 (-> this draw art-group data 39)) + (= v1-24 (-> this draw art-group data 40)) ) ) ) ) - (if (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (set! (-> obj unknown-byte-n123n) (the-as int (logior (-> obj stack 511) 2))) + (if (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (set! (-> this unknown-byte-n123n) (the-as int (logior (-> this stack 511) 2))) ) (cond - ((and (not s4-2) (logtest? (-> obj stack 511) 2)) + ((and (not s4-2) (logtest? (-> this stack 511) 2)) (set! s4-2 #t) (ja-channel-push! 1 (seconds 0.17)) ) (else - (let ((v1-36 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-36 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-36 (= v1-36 (-> obj draw art-group data 44))) + (if (and v1-36 (= v1-36 (-> this draw art-group data 44))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) @@ -1242,22 +1242,22 @@ (set! a2-5 (logior v1-42 7)) ) ) - (let ((v1-46 (enemy-method-120 obj 6 a2-5))) + (let ((v1-46 (enemy-method-120 this 6 a2-5))) (set! (-> *grunt-global-info* prev-blue-hit-anim-index) v1-46) - (set! (-> obj blue-hit-anim) (-> *grunt-global-info* blue-hit-anim v1-46)) + (set! (-> this blue-hit-anim) (-> *grunt-global-info* blue-hit-anim v1-46)) ) (let ((a2-6 0)) - (when (not (logtest? (-> obj stack 511) 2)) + (when (not (logtest? (-> this stack 511) 2)) (if s4-2 (set! a2-6 (logior a2-6 3)) (set! a2-6 (logior a2-6 4)) ) ) - (set! (-> obj unknown-byte-n1k2n3) (enemy-method-120 obj 3 a2-6)) + (set! (-> this unknown-byte-n1k2n3) (enemy-method-120 this 3 a2-6)) ) ) - (let ((a1-26 (-> obj draw art-group data (-> obj blue-hit-anim anim-index))) - (a0-51 (-> obj skel root-channel 0)) + (let ((a1-26 (-> this draw art-group data (-> this blue-hit-anim anim-index))) + (a0-51 (-> this skel root-channel 0)) ) (set! (-> a0-51 frame-group) (the-as art-joint-anim a1-26)) (set! (-> a0-51 param 0) (the float (+ (-> (the-as art-joint-anim a1-26) frames num-frames) -1))) @@ -1270,28 +1270,28 @@ (else 0 (cond - ((or (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (= (-> obj incoming knocked-type) (knocked-type knocked-type-3)) + ((or (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (= (-> this incoming knocked-type) (knocked-type knocked-type-3)) ) (set! v1-72 3) ) (else (let ((s4-3 (ash 1 (-> *grunt-global-info* prev-knocked-anim-index)))) - (let ((s3-0 (-> obj root))) + (let ((s3-0 (-> this root))) (if (>= 16384.0 (fabs (deg- (quaternion-y-angle (-> s3-0 quat)) (atan (-> s3-0 transv x) (-> s3-0 transv z))))) (set! s4-3 (logior s4-3 4)) ) ) - (set! v1-72 (enemy-method-120 obj 3 s4-3)) + (set! v1-72 (enemy-method-120 this 3 s4-3)) ) ) ) (set! (-> *grunt-global-info* prev-knocked-anim-index) v1-72) - (set! (-> obj unknown-byte-m2j342) v1-72) - (set! (-> obj knocked-anim) (-> *grunt-global-info* knocked-anim v1-72)) - (let ((s4-4 (-> obj draw art-group data (-> obj knocked-anim anim-index)))) + (set! (-> this unknown-byte-m2j342) v1-72) + (set! (-> this knocked-anim) (-> *grunt-global-info* knocked-anim v1-72)) + (let ((s4-4 (-> this draw art-group data (-> this knocked-anim anim-index)))) (ja-channel-push! 1 0) - (let ((a0-68 (-> obj skel root-channel 0))) + (let ((a0-68 (-> this skel root-channel 0))) (set! (-> a0-68 frame-group) (the-as art-joint-anim s4-4)) (set! (-> a0-68 param 0) (the float (+ (-> (the-as art-joint-anim s4-4) frames num-frames) -1))) (set! (-> a0-68 param 1) (-> arg0 0)) @@ -1304,26 +1304,26 @@ ) ) -(defmethod enemy-method-78 grunt ((obj grunt) (arg0 (pointer float))) +(defmethod enemy-method-78 grunt ((this grunt) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (or (logtest? (-> obj stack 511) 2) (let ((v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) - ) - ) - (not (and v1-7 (or (= v1-7 (-> obj draw art-group data 16)) - (= v1-7 (-> obj draw art-group data 38)) - (= v1-7 (-> obj draw art-group data 39)) - (= v1-7 (-> obj draw art-group data 40)) - ) - ) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (or (logtest? (-> this stack 511) 2) (let ((v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) ) - ) + (not (and v1-7 (or (= v1-7 (-> this draw art-group data 16)) + (= v1-7 (-> this draw art-group data 38)) + (= v1-7 (-> this draw art-group data 39)) + (= v1-7 (-> this draw art-group data 40)) + ) + ) + ) + ) ) - (let ((s4-0 (-> obj draw art-group data 44))) + (let ((s4-0 (-> this draw art-group data 44))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-16 (-> obj skel root-channel 0))) + (let ((a0-16 (-> this skel root-channel 0))) (set! (-> a0-16 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-16 param 1) (-> arg0 0)) @@ -1331,19 +1331,19 @@ (joint-control-channel-group! a0-16 (the-as art-joint-anim s4-0) num-func-seek!) ) ) - (set! (-> obj unknown-byte-n123n) (the-as int (logand -3 (-> obj stack 511)))) + (set! (-> this unknown-byte-n123n) (the-as int (logand -3 (-> this stack 511)))) #t ) ) - ((!= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (let ((a1-6 (-> obj + ((!= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (let ((a1-6 (-> this draw art-group data - (-> *grunt-global-info* knocked-land-anim (-> obj unknown-byte-m2j342) anim-index) + (-> *grunt-global-info* knocked-land-anim (-> this unknown-byte-m2j342) anim-index) ) ) - (a0-23 (-> obj skel root-channel 0)) + (a0-23 (-> this skel root-channel 0)) ) (set! (-> a0-23 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-23 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) @@ -1403,27 +1403,27 @@ :post (-> (method-of-type nav-enemy idle) post) ) -(defmethod dispose! grunt ((obj grunt)) +(defmethod dispose! grunt ((this grunt)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) - ((the-as (function nav-enemy none) (find-parent-method grunt 132)) obj) + ((the-as (function nav-enemy none) (find-parent-method grunt 132)) this) (none) ) ;; WARN: Return type mismatch nav-enemy vs grunt. -(defmethod relocate grunt ((obj grunt) (arg0 int)) - (if (nonzero? (-> obj intro-path)) - (&+! (-> obj intro-path) arg0) +(defmethod relocate grunt ((this grunt) (arg0 int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) arg0) ) - (the-as grunt ((method-of-type nav-enemy relocate) obj arg0)) + (the-as grunt ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod init-enemy-collision! grunt ((obj grunt)) +(defmethod init-enemy-collision! grunt ((this grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1511,75 +1511,75 @@ (set! (-> s5-0 backup-collide-with) (-> v1-27 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod get-enemy-info grunt ((obj grunt)) +(defmethod get-enemy-info grunt ((this grunt)) "@returns the [[nav-enemy-info]] associated with this type of grunt" *grunt-nav-enemy-info* ) -(defmethod init-enemy! grunt ((obj grunt)) +(defmethod init-enemy! grunt ((this grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj (get-enemy-info obj)) - (let ((v1-6 (-> obj neck))) + (init-enemy-behaviour-and-stats! this (get-enemy-info this)) + (let ((v1-6 (-> this neck))) (set! (-> v1-6 up) (the-as uint 1)) (set! (-> v1-6 nose) (the-as uint 2)) (set! (-> v1-6 ear) (the-as uint 0)) (set-vector! (-> v1-6 twist-max) 11832.889 11832.889 0.0 1.0) (set! (-> v1-6 ignore-angle) 30947.555) ) - (let ((v1-8 (-> obj nav))) + (let ((v1-8 (-> this nav))) (set! (-> v1-8 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) + (set-gravity-length (-> this root dynam) 573440.0) (let ((s5-2 *grunt-global-info*)) - (set! (-> obj patrol-anim) (-> s5-2 patrol-anim (get-rand-int obj 4))) - (set! (-> obj charge-anim) (-> s5-2 charge-anim (get-rand-int obj 3))) - (set! (-> obj attack-anim) (-> s5-2 attack-anim (get-rand-int obj 2))) + (set! (-> this patrol-anim) (-> s5-2 patrol-anim (get-rand-int this 4))) + (set! (-> this charge-anim) (-> s5-2 charge-anim (get-rand-int this 3))) + (set! (-> this attack-anim) (-> s5-2 attack-anim (get-rand-int this 2))) ) - (set! (-> obj unknown-byte-n1k2n3) -1) - (if (zero? (get-rand-int obj 2)) - (set! (-> obj unknown-byte-n123n) (the-as int (logior (-> obj stack 511) 1))) + (set! (-> this unknown-byte-n1k2n3) -1) + (if (zero? (get-rand-int this 2)) + (set! (-> this unknown-byte-n123n) (the-as int (logior (-> this stack 511) 1))) ) - (if (zero? (get-rand-int obj 2)) - (set! (-> obj unknown-byte-n123n) (the-as int (logior (-> obj stack 511) 4))) + (if (zero? (get-rand-int this 2)) + (set! (-> this unknown-byte-n123n) (the-as int (logior (-> this stack 511) 4))) ) - (set! (-> obj intro-path) (new 'process 'path-control obj 'intro 0.0 (the-as entity #f) #t)) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x 1433.6 :y 2785.28 :z -1761.28 :w 163840.0) ) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x -1433.6 :y 2785.28 :z -1761.28 :w 163840.0) ) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) 0 (none) ) -(defmethod go-idle grunt ((obj grunt)) - (if (logtest? (-> obj fact enemy-options) (enemy-option user9)) - (go (method-of-object obj wait-for-focus)) - (go (method-of-object obj idle)) +(defmethod go-idle grunt ((this grunt)) + (if (logtest? (-> this fact enemy-options) (enemy-option user9)) + (go (method-of-object this wait-for-focus)) + (go (method-of-object this idle)) ) 0 (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 78773382fd..dcf8af3b74 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 @@ -1038,27 +1038,27 @@ ) -(defmethod react-to-focus crimson-guard-level ((obj crimson-guard-level)) +(defmethod react-to-focus crimson-guard-level ((this crimson-guard-level)) "@TODO - flesh out docs" - (let ((s5-0 (-> obj focus aware))) + (let ((s5-0 (-> this focus aware))) (cond - ((and (= s5-0 (enemy-aware enemy-aware-3)) (get-enemy-target obj)) - (go-hostile obj) + ((and (= s5-0 (enemy-aware enemy-aware-3)) (get-enemy-target this)) + (go-hostile this) ) - ((and (= s5-0 (enemy-aware enemy-aware-2)) (get-enemy-target obj)) - (go-hostile obj) + ((and (= s5-0 (enemy-aware enemy-aware-2)) (get-enemy-target this)) + (go-hostile this) ) ((<= (the-as int s5-0) 0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((>= 1 (the-as int s5-0)) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ((= s5-0 (enemy-aware unaware)) - (go-flee obj) + (go-flee this) ) (else - (go-stare obj) + (go-stare this) ) ) ) @@ -1090,7 +1090,7 @@ (defstate stare (crimson-guard-level) :virtual #t :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((gp-0 (-> self focus aware))) (cond ((>= 1 (the-as int gp-0)) @@ -1114,38 +1114,38 @@ ) ) -(defmethod general-event-handler crimson-guard-level ((obj crimson-guard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler crimson-guard-level ((this crimson-guard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('event-death) - (when (<= (-> obj hit-points) 0) - (set! (-> obj root penetrated-by) (the-as penetrate -1)) - (do-effect (-> obj skel effect) 'death-default 0.0 -1) + (when (<= (-> this hit-points) 0) + (set! (-> this root penetrated-by) (the-as penetrate -1)) + (do-effect (-> this skel effect) 'death-default 0.0 -1) ) ) (('hit 'hit-flinch 'hit-knocked) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (let* ((s1-0 (handle->process (-> obj incoming attacker-handle))) + (speech-control-method-13 *speech-control* (the-as handle this)) + (let* ((s1-0 (handle->process (-> this incoming attacker-handle))) (a0-13 (if (type? s1-0 process-focusable) s1-0 ) ) ) (if (and a0-13 (logtest? (-> a0-13 mask) (process-mask target))) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-11)) ) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('trigger) (let ((v0-0 (the-as object #t))) - (set! (-> obj trigger) (the-as symbol v0-0)) + (set! (-> this trigger) (the-as symbol v0-0)) v0-0 ) ) (('untrigger) - (set! (-> obj trigger) #f) + (set! (-> this trigger) #f) #f ) (('notify) @@ -1155,32 +1155,32 @@ (when (= a0-21 'attack) (when (logtest? (-> (the-as process-focusable v1-16) mask) (process-mask target)) (if (focus-test? (the-as process-focusable v1-16) dead) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-10)) ) ) ) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod crimson-guard-level-method-191 crimson-guard-level ((obj crimson-guard-level)) - (let* ((s4-0 (-> obj target-pos-predict-miss)) - (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) +(defmethod crimson-guard-level-method-191 crimson-guard-level ((this crimson-guard-level)) + (let* ((s4-0 (-> this target-pos-predict-miss)) + (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (v1-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v1-2) 1.0)) (s4-1 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (set! (-> s4-1 ent) (-> obj entity)) + (set! (-> s4-1 ent) (-> this entity)) (set! (-> s4-1 charge) 1.0) (set! (-> s4-1 options) (projectile-options)) - (set! (-> s4-1 notify-handle) (process->handle obj)) + (set! (-> s4-1 notify-handle) (process->handle this)) (set! (-> s4-1 owner-handle) (the-as handle #f)) - (set! (-> s4-1 ignore-handle) (process->handle obj)) + (set! (-> s4-1 ignore-handle) (process->handle this)) (let* ((a0-13 *game-info*) (a1-12 (+ (-> a0-13 attack-id) 1)) ) @@ -1191,11 +1191,11 @@ (set! (-> s4-1 pos quad) (-> s5-0 quad)) (set! (-> s4-1 vel quad) (-> v1-3 quad)) (vector-normalize! (-> s4-1 vel) 819200.0) - (spawn-projectile guard-shot s4-1 obj *default-dead-pool*) + (spawn-projectile guard-shot s4-1 this *default-dead-pool*) ) ) -(defmethod crimson-guard-level-method-195 crimson-guard-level ((obj crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod crimson-guard-level-method-195 crimson-guard-level ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1213,8 +1213,8 @@ (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) (set! (-> v1-4 collide-with) (collide-spec backgnd)) - (set! (-> v1-4 ignore-process0) obj) - (set! (-> v1-4 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) @@ -1274,8 +1274,8 @@ (let ((v1-17 s5-0)) (set! (-> v1-17 radius) f30-0) (set! (-> v1-17 collide-with) (collide-spec enemy obstacle hit-by-player-list hit-by-others-list)) - (set! (-> v1-17 ignore-process0) obj) - (set! (-> v1-17 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-17 ignore-process0) this) + (set! (-> v1-17 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-17 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-17 action-mask) (collide-action solid)) ) @@ -1306,34 +1306,34 @@ ) ) -(defmethod crimson-guard-level-method-193 crimson-guard-level ((obj crimson-guard-level)) - (let ((s5-0 (get-trans obj 3)) +(defmethod crimson-guard-level-method-193 crimson-guard-level ((this crimson-guard-level)) + (let ((s5-0 (get-trans this 3)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> obj target-pos quad)) + (set! (-> s4-0 quad) (-> this target-pos quad)) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0))) (vector-normalize! s3-1 409600.0) - (zero? (crimson-guard-level-method-195 obj s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s3-1) s4-0)) + (zero? (crimson-guard-level-method-195 this s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s3-1) s4-0)) ) ) ) -(defmethod crimson-guard-level-method-194 crimson-guard-level ((obj crimson-guard-level)) +(defmethod crimson-guard-level-method-194 crimson-guard-level ((this crimson-guard-level)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj target-pos-predict-miss quad)) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) + (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a0-3)) ) (vector-normalize! s3-1 409600.0) - (and (crimson-guard-level-method-193 obj) - (zero? (crimson-guard-level-method-195 obj s4-0 (vector+! (new 'stack-no-clear 'vector) s4-0 s3-1) s5-0)) + (and (crimson-guard-level-method-193 this) + (zero? (crimson-guard-level-method-195 this s4-0 (vector+! (new 'stack-no-clear 'vector) s4-0 s3-1) s5-0)) ) ) ) ) -(defmethod crimson-guard-level-method-196 crimson-guard-level ((obj crimson-guard-level) (arg0 vector)) +(defmethod crimson-guard-level-method-196 crimson-guard-level ((this crimson-guard-level) (arg0 vector)) (local-vars (sv-240 vector) (sv-256 (function vector vector vector)) @@ -1352,7 +1352,7 @@ (init-vf0-vector) (set! sv-240 arg0) (let ((s0-0 (new 'stack-no-clear 'vector))) - (let ((v1-1 (-> obj root trans))) + (let ((v1-1 (-> this root trans))) (let ((a0-1 *y-vector*)) (let ((a1-2 8192.0)) (.mov vf7 a1-2) @@ -1371,14 +1371,14 @@ (s2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (-> obj node-list data 4 bone transform) - (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (-> this node-list data 4 bone transform) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) - (set! (-> s0-0 quad) (-> obj root trans quad)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (set! (-> s0-0 quad) (-> this root trans quad)) (cond - ((logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + ((logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) (let ((a1-6 s0-0)) (let ((v1-14 s0-0)) (let ((a0-9 s4-0)) @@ -1441,7 +1441,7 @@ (vector+! sv-288 sv-288 v0-5) ) (vector-normalize! (vector-! sv-320 sv-288 s0-0) 1.0) - (vector-z-quaternion! sv-304 (-> obj root quat)) + (vector-z-quaternion! sv-304 (-> this root quat)) (rot-zxy-from-vector! s2-0 sv-304) (rot-zxy-from-vector! s1-0 sv-320) (set! (-> s5-0 x) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 x) (-> s2-0 x))))) @@ -1453,7 +1453,7 @@ (quaternion-vector-angle! s1-1 s3-0 (-> s5-0 y)) (quaternion*! s2-1 s1-1 s2-1) ) - (quaternion-pseudo-seek (-> obj joint quat) (-> obj joint quat) s2-1 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) s2-1 (seconds-per-frame)) ) ) ) @@ -1463,34 +1463,34 @@ ) ) -(defmethod crimson-guard-level-method-197 crimson-guard-level ((obj crimson-guard-level)) - (quaternion-pseudo-seek (-> obj joint quat) (-> obj joint quat) *unity-quaternion* (seconds-per-frame)) +(defmethod crimson-guard-level-method-197 crimson-guard-level ((this crimson-guard-level)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) *unity-quaternion* (seconds-per-frame)) ) ;; WARN: Return type mismatch object vs none. -(defmethod track-target! crimson-guard-level ((obj crimson-guard-level)) +(defmethod track-target! crimson-guard-level ((this crimson-guard-level)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (if (-> obj joint-enable) - (crimson-guard-level-method-196 obj (-> obj target-pos-predict-miss)) - (crimson-guard-level-method-197 obj) + (if (-> this joint-enable) + (crimson-guard-level-method-196 this (-> this target-pos-predict-miss)) + (crimson-guard-level-method-197 this) ) - (case (-> obj root cur-pat event) + (case (-> this root cur-pat event) (((pat-event melt)) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'die))) - (go (method-of-object obj die)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'die))) + (go (method-of-object this die)) ) ) ) (none) ) -(defmethod crimson-guard-level-method-200 crimson-guard-level ((obj crimson-guard-level)) +(defmethod crimson-guard-level-method-200 crimson-guard-level ((this crimson-guard-level)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1499,25 +1499,25 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (handle->process (-> obj focus handle)))) + (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 - (set! (-> obj target-pos quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) - (if (= (-> obj focus aware) (enemy-aware enemy-aware-3)) - (cloest-point-on-mesh (-> obj nav) (-> obj reachable-target-pos) (-> obj target-pos) (the-as nav-poly #f)) + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + (if (= (-> this focus aware) (enemy-aware enemy-aware-3)) + (cloest-point-on-mesh (-> this nav) (-> this reachable-target-pos) (-> this target-pos) (the-as nav-poly #f)) ) - (set! (-> obj target-vel-vec quad) (-> (the-as process-focusable s5-0) root transv quad)) - (set! (-> obj target-vel) (vector-length (-> obj target-vel-vec))) - (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> obj target-pos)))) - (let ((f0-2 (/ (vector-length s5-2) (if (= (-> obj weapon) 3) + (set! (-> this target-vel-vec quad) (-> (the-as process-focusable s5-0) root transv quad)) + (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this target-pos)))) + (let ((f0-2 (/ (vector-length s5-2) (if (= (-> this weapon) 3) 90112.0 819200.0 ) ) ) - (a1-3 (-> obj target-pos-predict)) + (a1-3 (-> this target-pos-predict)) ) - (let ((v1-20 (-> obj target-pos))) - (let ((a0-12 (-> obj target-vel-vec))) + (let ((v1-20 (-> this target-pos))) + (let ((a0-12 (-> this target-vel-vec))) (let ((a2-1 f0-2)) (.mov vf7 a2-1) ) @@ -1532,19 +1532,19 @@ ) (set! (-> s5-2 y) 0.0) (vector-rotate90-around-y! s5-2 s5-2) - (if (-> obj other-side) + (if (-> this other-side) (vector-negate! s5-2 s5-2) ) - (vector-normalize! s5-2 (-> obj miss-amount)) - (vector+! (-> obj target-pos-predict-miss) (-> obj target-pos-predict) s5-2) + (vector-normalize! s5-2 (-> this miss-amount)) + (vector+! (-> this target-pos-predict-miss) (-> this target-pos-predict) s5-2) ) - (vector-! (-> obj target-self) (-> obj target-pos) (-> obj root trans)) - (set! (-> obj target-self-xz quad) (-> obj target-self quad)) - (set! (-> obj target-self-xz y) 0.0) - (set! (-> obj target-self-dist) (vector-length (-> obj target-self))) - (set! (-> obj target-self-xz-dist) (vector-length (-> obj target-self-xz))) - (set! (-> obj target-y-angle) - (deg-diff (quaternion-y-angle (-> obj root quat)) (vector-y-angle (-> obj target-self))) + (vector-! (-> this target-self) (-> this target-pos) (-> this root trans)) + (set! (-> this target-self-xz quad) (-> this target-self quad)) + (set! (-> this target-self-xz y) 0.0) + (set! (-> this target-self-dist) (vector-length (-> this target-self))) + (set! (-> this target-self-xz-dist) (vector-length (-> this target-self-xz))) + (set! (-> this target-y-angle) + (deg-diff (quaternion-y-angle (-> this root quat)) (vector-y-angle (-> this target-self))) ) ) ) @@ -1555,7 +1555,7 @@ :virtual #t :enter (behavior () (talker-spawn-func (-> *talker-speech* 10) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 (logior (-> self enemy-flags) (enemy-flag use-notice-distance)))) (set! (-> self enemy-flags) (logclear v1-4 (enemy-flag called-dying))) ) @@ -1629,7 +1629,7 @@ (t9-0) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (if (logtest? (-> self flags) 4) (go-virtual gun-shoot) ) @@ -1640,7 +1640,7 @@ ) :trans (behavior () (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((or (< (the-as int gp-0) 2) (not (get-enemy-target self))) (go-stare self) @@ -1714,7 +1714,7 @@ :event enemy-event-handler :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 0.5 1.5))))) ) :exit (behavior () @@ -1722,7 +1722,7 @@ ) :trans (behavior () (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((or (>= 2 (the-as int gp-0)) (not (get-enemy-target self))) (go-stare self) @@ -1776,7 +1776,7 @@ :event enemy-event-handler :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-156 self) ) :exit (behavior () @@ -1784,7 +1784,7 @@ ) :trans (behavior () (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((or (< (the-as int gp-0) 2) (not (get-enemy-target self))) (go-stare self) @@ -1818,7 +1818,7 @@ ) (if (and (< (-> self target-self-xz-dist) 327680.0) (crimson-guard-level-method-193 self) - (>= (- (current-time) (-> self state-time)) (the int (* 300.0 (rand-vu-float-range 1.0 8.0)))) + (time-elapsed? (-> self state-time) (the int (* 300.0 (rand-vu-float-range 1.0 8.0)))) ) (go-virtual gun-shoot) ) @@ -1850,7 +1850,7 @@ :event enemy-event-handler :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-156 self) ) :exit (behavior () @@ -1858,7 +1858,7 @@ ) :trans (behavior () (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((or (< (the-as int gp-0) 2) (not (get-enemy-target self))) (go-stare self) @@ -1888,9 +1888,9 @@ ) (else (if (or (and (logtest? (-> self nav state flags) (nav-state-flag at-target)) - (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) - (>= (- (current-time) (-> self state-time)) (seconds 1)) + (time-elapsed? (-> self state-time) (seconds 1)) ) (go-virtual grenade-attack) ) @@ -1939,7 +1939,7 @@ (set! (-> a0-9 velocity quad) (-> v1-12 quad)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self last-time-see-target) (the-as int (current-time))) (set! (-> self miss-amount) 0.0) (set! (-> self next-shot) (the-as int (current-time))) @@ -1953,7 +1953,7 @@ :trans (behavior () (crimson-guard-level-method-200 self) (let ((v1-2 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((< (the-as int v1-2) 2) (go-stare self) @@ -1980,7 +1980,7 @@ ) ) (until #f - (if (or (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (if (or (time-elapsed? (-> self state-time) (-> self reaction-time)) (< 10922.667 (fabs (-> self target-y-angle))) ) (goto cfg-13) @@ -2039,7 +2039,7 @@ (set! (-> a0-8 velocity quad) (-> v1-13 quad)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self last-time-see-target) (the-as int (current-time))) (crimson-guard-level-method-200 self) (if (logtest? (-> self flags) 4) @@ -2088,7 +2088,7 @@ (set! (-> self start-target-vel quad) (-> (the-as process-drawable v1-31) root transv quad)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (label cfg-10) (when (crimson-guard-level-method-194 self) (when (or (not (logtest? (-> self flags) 256)) (and (logtest? (-> self flags) 256) (-> self trigger))) @@ -2096,7 +2096,7 @@ (goto cfg-23) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (set! v1-48 #f) (goto cfg-23) ) @@ -2104,7 +2104,7 @@ (b! (not #f) cfg-10 :delay (set! v1-48 #f)) (label cfg-23) (when v1-48 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 3)) (until #f (ja-channel-push! 1 (seconds 0.1)) @@ -2143,7 +2143,7 @@ ) (when (logtest? (-> self flags) 4) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) (seconds 1)) + (until (time-elapsed? s5-1 (seconds 1)) (suspend) ) ) @@ -2182,7 +2182,7 @@ ) ) -(defmethod crimson-guard-level-method-199 crimson-guard-level ((obj crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod crimson-guard-level-method-199 crimson-guard-level ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (sv-672 vector) (sv-688 vector) (sv-704 vector) (sv-720 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2252,8 +2252,8 @@ (+! (-> sv-672 x) (rand-vu-float-range -819.2 819.2)) (+! (-> sv-672 y) (rand-vu-float-range -819.2 819.2)) (+! (-> sv-672 z) (rand-vu-float-range -819.2 819.2)) - (set-point! (-> obj l-control) (-> obj l-control state points-to-draw) sv-672) - (+! (-> obj l-control state points-to-draw) 1) + (set-point! (-> this l-control) (-> this l-control state points-to-draw) sv-672) + (+! (-> this l-control state points-to-draw) 1) (quaternion-from-two-vectors! (the-as quaternion sv-688) s2-0 (-> s1-0 best-other-tri normal)) (vector-orient-by-quat! s3-0 s3-0 (the-as quaternion sv-688)) (set! (-> s2-0 quad) (-> s1-0 best-other-tri normal quad)) @@ -2315,8 +2315,8 @@ (+! (-> sv-704 x) (rand-vu-float-range -819.2 819.2)) (+! (-> sv-704 y) (rand-vu-float-range -819.2 819.2)) (+! (-> sv-704 z) (rand-vu-float-range -819.2 819.2)) - (set-point! (-> obj l-control) (-> obj l-control state points-to-draw) sv-704) - (+! (-> obj l-control state points-to-draw) 1) + (set-point! (-> this l-control) (-> this l-control state points-to-draw) sv-704) + (+! (-> this l-control state points-to-draw) 1) (quaternion-from-two-vectors! (the-as quaternion sv-720) s2-0 (-> s1-0 best-other-tri normal)) (vector-orient-by-quat! s3-0 s3-0 (the-as quaternion sv-720)) (set! (-> s2-0 quad) (-> s1-0 best-other-tri normal quad)) @@ -2325,8 +2325,8 @@ (else (vector+! s4-0 s4-0 s3-0) (when (< s0-0 6) - (set-point! (-> obj l-control) (-> obj l-control state points-to-draw) s4-0) - (+! (-> obj l-control state points-to-draw) 1) + (set-point! (-> this l-control) (-> this l-control state points-to-draw) s4-0) + (+! (-> this l-control state points-to-draw) 1) ) ) ) @@ -2344,7 +2344,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-level-method-198 crimson-guard-level ((obj crimson-guard-level)) +(defmethod crimson-guard-level-method-198 crimson-guard-level ((this crimson-guard-level)) (local-vars (sv-784 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2354,11 +2354,11 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (s2-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v0-1) 16384.0)) (s1-0 - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj target-pos-predict-miss) s4-0) 16384.0) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict-miss) s4-0) 16384.0) ) (s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'collide-query)) @@ -2398,7 +2398,7 @@ (set! (-> s3-0 ignore-process1) #f) (set! (-> s3-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (fill-using-line-sphere *collide-cache* s3-0) - (set! (-> obj l-control state points-to-draw) 0) + (set! (-> this l-control state points-to-draw) 0) (let ((f0-3 (probe-using-line-sphere *collide-cache* s3-0)) (s2-1 (new 'stack-no-clear 'vector)) ) @@ -2421,7 +2421,7 @@ (let ((s1-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s1-2 (let ((t9-15 (method-of-type part-tracker activate))) - (t9-15 (the-as part-tracker s1-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-15 (the-as part-tracker s1-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-16 run-function-in-process) (a0-34 s1-2) @@ -2451,7 +2451,7 @@ (let ((s1-3 (get-process *default-dead-pool* part-tracker #x4000))) (when s1-3 (let ((t9-18 (method-of-type part-tracker activate))) - (t9-18 (the-as part-tracker s1-3) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-18 (the-as part-tracker s1-3) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-19 run-function-in-process) (a0-37 s1-3) @@ -2478,10 +2478,10 @@ (-> s1-3 ppointer) ) ) - (set-point! (-> obj l-control) 0 s4-0) - (set-point! (-> obj l-control) 1 s5-0) - (set! (-> obj l-control spec) (-> *lightning-spec-id-table* 13)) - (+! (-> obj l-control state points-to-draw) 2) + (set-point! (-> this l-control) 0 s4-0) + (set-point! (-> this l-control) 1 s5-0) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 13)) + (+! (-> this l-control state points-to-draw) 2) (let* ((s4-1 (-> s3-0 best-other-tri collide-ptr)) (v1-45 (if (type? s4-1 collide-shape-prim) (the-as collide-shape-prim s4-1) @@ -2495,14 +2495,14 @@ (send-event (-> v1-45 cshape process) 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'shock)))) ) ) - (crimson-guard-level-method-199 obj s5-0 s2-1 (-> s3-0 best-other-tri normal) (the-as float s4-2)) + (crimson-guard-level-method-199 this s5-0 s2-1 (-> s3-0 best-other-tri normal) (the-as float s4-2)) ) ) (else (let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s3-1 (let ((t9-26 (method-of-type part-tracker activate))) - (t9-26 (the-as part-tracker s3-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-26 (the-as part-tracker s3-1) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-27 run-function-in-process) (a0-56 s3-1) @@ -2532,7 +2532,7 @@ (let ((s3-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s3-2 (let ((t9-29 (method-of-type part-tracker activate))) - (t9-29 (the-as part-tracker s3-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-29 (the-as part-tracker s3-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-30 run-function-in-process) (a0-59 s3-2) @@ -2559,12 +2559,12 @@ (-> s3-2 ppointer) ) ) - (set! (-> obj l-control state points-to-draw) 9) - (set! (-> obj l-control spec) (-> *lightning-spec-id-table* 14)) + (set! (-> this l-control state points-to-draw) 9) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 14)) (let ((v1-67 s4-0)) - (set! (-> obj l-control state meet data 0 quad) (-> v1-67 quad)) + (set! (-> this l-control state meet data 0 quad) (-> v1-67 quad)) ) - (let ((a0-65 (-> obj l-control)) + (let ((a0-65 (-> this l-control)) (v1-69 s5-0) ) (set! (-> a0-65 state meet data (+ (-> a0-65 state points-to-draw) -1) quad) (-> v1-69 quad)) @@ -2624,11 +2624,11 @@ ) ) -(defmethod crimson-guard-level-method-192 crimson-guard-level ((obj crimson-guard-level)) - (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14)))) +(defmethod crimson-guard-level-method-192 crimson-guard-level ((this crimson-guard-level)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14)))) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'traj3d-params))) - (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> obj target-pos-predict) s4-0))) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict) s4-0))) (set! (-> s3-1 y) 0.0) (vector-rotate-around-y! s3-1 s3-1 (* 182.04445 (+ (if (zero? (rand-vu-int-count 2)) 90.0 @@ -2638,25 +2638,27 @@ ) ) ) - (if (logtest? (-> obj draw status) (draw-control-status on-screen)) + (if (logtest? (-> this draw status) (draw-control-status on-screen)) (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 1.0 4.0))) (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 4.0 15.0))) ) - (set! (-> s5-0 dest quad) (-> (vector+! (new 'stack-no-clear 'vector) s3-1 (-> obj target-pos-predict)) quad)) + (set! (-> s5-0 dest quad) + (-> (vector+! (new 'stack-no-clear 'vector) s3-1 (-> this target-pos-predict)) quad) + ) ) (set! (-> s5-0 src quad) (-> s4-0 quad)) (set! (-> s5-0 initial-tilt) 8192.0) (set! (-> s5-0 gravity) 184320.0) (when (traj3d-calc-initial-velocity-using-tilt s5-0) (let ((a1-9 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> a1-9 ent) (-> obj entity)) + (set! (-> a1-9 ent) (-> this entity)) (set! (-> a1-9 charge) 1.0) (set! (-> a1-9 options) (projectile-options)) (set! (-> a1-9 pos quad) (-> s5-0 src quad)) (set! (-> a1-9 vel quad) (-> s5-0 initial-velocity quad)) (set! (-> a1-9 notify-handle) (the-as handle #f)) (set! (-> a1-9 owner-handle) (the-as handle #f)) - (set! (-> a1-9 ignore-handle) (process->handle obj)) + (set! (-> a1-9 ignore-handle) (process->handle this)) (let* ((v1-24 *game-info*) (a0-23 (+ (-> v1-24 attack-id) 1)) ) @@ -2664,7 +2666,7 @@ (set! (-> a1-9 attack-id) a0-23) ) (set! (-> a1-9 timeout) (seconds 4)) - (spawn-projectile vehicle-grenade a1-9 obj *default-dead-pool*) + (spawn-projectile vehicle-grenade a1-9 this *default-dead-pool*) ) ) ) @@ -2715,7 +2717,7 @@ (ja :num! (seek! (ja-aframe 12.0 0))) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (the int (* 900.0 (you-suck-scale *game-info* #f)))) + (until (time-elapsed? gp-2 (the int (* 900.0 (you-suck-scale *game-info* #f)))) (ja-no-eval :group! (-> self draw art-group data 37) :num! (seek! (ja-aframe 12.0 0)) :frame-num (ja-aframe 12.0 0) @@ -2778,7 +2780,7 @@ ) 0 (set! (-> self miss-amount) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self lazer-sound) (new 'static 'sound-id)) 0 @@ -2820,7 +2822,7 @@ ) :trans (behavior () (crimson-guard-level-method-200 self) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (< 32768.0 (-> self target-self-xz-dist))) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (< 32768.0 (-> self target-self-xz-dist))) (go-hostile self) ) ) @@ -2925,7 +2927,7 @@ (f30-0 1.0) ) (ja-no-eval :group! (-> self draw art-group data 22) :num! (loop! f30-0) :frame-num 0.0) - (until (>= (- (current-time) gp-4) s5-1) + (until (time-elapsed? gp-4 s5-1) (crimson-guard-level-method-198 self) (suspend) (ja :num! (loop! f30-0)) @@ -2989,7 +2991,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -3039,7 +3041,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -3086,9 +3088,9 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-level-method-204 crimson-guard-level ((obj crimson-guard-level)) - (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s5-0 (-> obj root)) +(defmethod crimson-guard-level-method-204 crimson-guard-level ((this crimson-guard-level)) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (-> this root)) (s3-0 (lambda ((arg0 crimson-guard-level) (arg1 collide-shape-moving) (arg2 vector)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -3130,11 +3132,11 @@ ) ) (cond - ((s3-0 obj s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 24576.0)) - (go (method-of-object obj roll-right)) + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 24576.0)) + (go (method-of-object this roll-right)) ) - ((s3-0 obj s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 -24576.0)) - (go (method-of-object obj roll-left)) + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 -24576.0)) + (go (method-of-object this roll-left)) ) ) ) @@ -3382,23 +3384,23 @@ ) ) -(defmethod enemy-method-77 crimson-guard-level ((obj crimson-guard-level) (arg0 (pointer float))) - (let ((v1-1 (-> obj root transv))) +(defmethod enemy-method-77 crimson-guard-level ((this crimson-guard-level) (arg0 (pointer float))) + (let ((v1-1 (-> this root transv))) (cond ((< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 57344.0) - (set! (-> obj small-hit) 1) + (set! (-> this small-hit) 1) ) (else - (set! (-> obj small-hit) 0) + (set! (-> this small-hit) 0) 0 ) ) ) (cond - ((<= (-> obj hit-points) 0) + ((<= (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.01)) - (let ((a1-2 (-> obj draw art-group data (-> obj info knocked anim-index (-> obj hit-face)))) - (a0-5 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this info knocked anim-index (-> this hit-face)))) + (a0-5 (-> this skel root-channel 0)) ) (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -3408,26 +3410,26 @@ ) ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-5) (knocked-type knocked-type-7)) (ja-channel-push! 1 (seconds 0.01)) (cond - ((= (-> obj small-hit) 1) - (set! (-> obj yellow-anim anim-index-front) (get-rand-int obj 2)) + ((= (-> this small-hit) 1) + (set! (-> this yellow-anim anim-index-front) (get-rand-int this 2)) (let ((a1-8 - (-> obj + (-> this draw art-group data - (-> (the-as (array int32) (+ (+ (* (-> obj hit-face) 4) (* (-> obj yellow-anim unsigned-anim-index-front) 8)) - (the-as uint (-> obj info)) + (-> (the-as (array int32) (+ (+ (* (-> this hit-face) 4) (* (-> this yellow-anim unsigned-anim-index-front) 8)) + (the-as uint (-> this info)) ) ) 2 ) ) ) - (a0-17 (-> obj skel root-channel 0)) + (a0-17 (-> this skel root-channel 0)) ) (set! (-> a0-17 frame-group) (the-as art-joint-anim a1-8)) (set! (-> a0-17 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1))) @@ -3437,8 +3439,8 @@ ) ) (else - (let ((a1-9 (-> obj draw art-group data (-> obj info knocked anim-index (-> obj hit-face)))) - (a0-21 (-> obj skel root-channel 0)) + (let ((a1-9 (-> this draw art-group data (-> this info knocked anim-index (-> this hit-face)))) + (a0-21 (-> this skel root-channel 0)) ) (set! (-> a0-21 frame-group) (the-as art-joint-anim a1-9)) (set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-9) frames num-frames) -1))) @@ -3451,20 +3453,20 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-24 (-> obj skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> obj draw art-group data 10))) + (let ((a0-24 (-> this skel root-channel 0))) + (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> this draw art-group data 10))) (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 10)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1)) ) (set! (-> a0-24 param 1) (-> arg0 0)) (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> obj draw art-group data 10)) num-func-seek!) + (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-13 (-> obj draw art-group data (-> obj info knocked anim-index (-> obj hit-face)))) - (a0-29 (-> obj skel root-channel 0)) + (let ((a1-13 (-> this draw art-group data (-> this info knocked anim-index (-> this hit-face)))) + (a0-29 (-> this skel root-channel 0)) ) (set! (-> a0-29 frame-group) (the-as art-joint-anim a1-13)) (set! (-> a0-29 param 0) (the float (+ (-> (the-as art-joint-anim a1-13) frames num-frames) -1))) @@ -3479,36 +3481,36 @@ #t ) -(defmethod go-hostile crimson-guard-level ((obj crimson-guard-level)) - (let ((v1-0 (-> obj hit-face))) +(defmethod go-hostile crimson-guard-level ((this crimson-guard-level)) + (let ((v1-0 (-> this hit-face))) (cond ((zero? v1-0) - (go (method-of-object obj get-up-front)) + (go (method-of-object this get-up-front)) ) ((= v1-0 1) - (go (method-of-object obj get-up-back)) + (go (method-of-object this get-up-back)) ) - ((logtest? (-> obj flags) 1) - (go (method-of-object obj tazer-hostile)) + ((logtest? (-> this flags) 1) + (go (method-of-object this tazer-hostile)) ) - ((logtest? (-> obj flags) 2) - (go (method-of-object obj blast-hostile)) + ((logtest? (-> this flags) 2) + (go (method-of-object this blast-hostile)) ) - ((logtest? (-> obj flags) 8) - (go (method-of-object obj grenade-hostile)) + ((logtest? (-> this flags) 8) + (go (method-of-object this grenade-hostile)) ) (else - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) ) ) ) -(defmethod enemy-method-78 crimson-guard-level ((obj crimson-guard-level) (arg0 (pointer float))) +(defmethod enemy-method-78 crimson-guard-level ((this crimson-guard-level) (arg0 (pointer float))) (cond - ((<= (-> obj hit-points) 0) - (let ((a1-1 (-> obj draw art-group data (-> obj info knocked-land anim-index (-> obj hit-face)))) - (a0-4 (-> obj skel root-channel 0)) + ((<= (-> this hit-points) 0) + (let ((a1-1 (-> this draw art-group data (-> this info knocked-land anim-index (-> this hit-face)))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-1)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-1) frames num-frames) -1))) @@ -3516,29 +3518,29 @@ (set! (-> a0-4 frame-num) 0.0) (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-1) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-5) (knocked-type knocked-type-7)) (ja-channel-push! 1 (seconds 0.1)) (cond - ((= (-> obj small-hit) 1) + ((= (-> this small-hit) 1) (let ((a1-6 - (-> obj + (-> this draw art-group data - (-> (the-as (array int32) (+ (+ (* (-> obj hit-face) 4) (* (-> obj yellow-anim unsigned-anim-index-front) 8)) - (the-as uint (-> obj info)) + (-> (the-as (array int32) (+ (+ (* (-> this hit-face) 4) (* (-> this yellow-anim unsigned-anim-index-front) 8)) + (the-as uint (-> this info)) ) ) 6 ) ) ) - (a0-15 (-> obj skel root-channel 0)) + (a0-15 (-> this skel root-channel 0)) ) (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) @@ -3546,12 +3548,12 @@ (set! (-> a0-15 frame-num) 0.0) (joint-control-channel-group! a0-15 (the-as art-joint-anim a1-6) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else - (let ((a1-7 (-> obj draw art-group data (-> obj info knocked-land anim-index (-> obj hit-face)))) - (a0-19 (-> obj skel root-channel 0)) + (let ((a1-7 (-> this draw art-group data (-> this info knocked-land anim-index (-> this hit-face)))) + (a0-19 (-> this skel root-channel 0)) ) (set! (-> a0-19 frame-group) (the-as art-joint-anim a1-7)) (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) @@ -3565,22 +3567,22 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-22 (-> obj skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 11))) + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 11)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) ) (set! (-> a0-22 param 1) (-> arg0 0)) (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 11)) num-func-seek!) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-11 (-> obj draw art-group data (-> obj info knocked-land anim-index (-> obj hit-face)))) - (a0-27 (-> obj skel root-channel 0)) + (let ((a1-11 (-> this draw art-group data (-> this info knocked-land anim-index (-> this hit-face)))) + (a0-27 (-> this skel root-channel 0)) ) (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-11)) (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1))) @@ -3705,8 +3707,8 @@ ) ) -(defmethod crimson-guard-level-method-201 crimson-guard-level ((obj crimson-guard-level) (arg0 float)) - (let* ((s3-0 (handle->process (-> obj transport))) +(defmethod crimson-guard-level-method-201 crimson-guard-level ((this crimson-guard-level) (arg0 float)) + (let* ((s3-0 (handle->process (-> this transport))) (s4-0 (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) ) @@ -3716,7 +3718,7 @@ (let ((s2-0 (matrix<-transformq! (new 'stack-no-clear 'matrix) (the-as transformq (-> s4-0 root trans)))) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 x) (if (zero? (-> obj transport-side)) + (set! (-> s3-1 x) (if (zero? (-> this transport-side)) -8192.0 8192.0 ) @@ -3724,13 +3726,13 @@ (set! (-> s3-1 y) 12288.0) (set! (-> s3-1 z) (lerp-scale -16384.0 -49152.0 arg0 0.0 1.0)) (set! (-> s3-1 w) 1.0) - (quaternion-rotate-local-y! (-> obj root quat) (-> s4-0 root quat) 32768.0) - (vector-matrix*! (-> obj root trans) s3-1 s2-0) + (quaternion-rotate-local-y! (-> this root quat) (-> s4-0 root quat) 32768.0) + (vector-matrix*! (-> this root trans) s3-1 s2-0) ) ) ) (let ((f0-5 (fmax 0.0 (fmin 1.0 (* 3.3333333 arg0))))) - (set-vector! (-> obj draw color-mult) f0-5 f0-5 f0-5 1.0) + (set-vector! (-> this draw color-mult) f0-5 f0-5 f0-5 1.0) ) 0 (none) @@ -3739,7 +3741,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod crimson-guard-level-method-202 crimson-guard-level ((obj crimson-guard-level) (arg0 vector)) +(defmethod crimson-guard-level-method-202 crimson-guard-level ((this crimson-guard-level) (arg0 vector)) (local-vars (f0-8 float) (sv-768 vector) @@ -3756,7 +3758,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (f30-0 0.0) ) (dotimes (s3-0 2) @@ -3768,7 +3770,7 @@ ) (vector-rotate-around-y! sv-768 s4-0 (* 182.04445 (the float (+ (* 23 s2-0) -70)))) (let ((v1-10 s1-0)) - (let ((a0-6 (-> obj root trans))) + (let ((a0-6 (-> this root trans))) (let ((a1-5 sv-768)) (let ((a2-2 1.0)) (.mov vf7 a2-2) @@ -3782,10 +3784,10 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-10 quad) vf6) ) - (if (enemy-above-ground? obj s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) ) - (let ((v1-14 (-> obj nav)) + (let ((v1-14 (-> this nav)) (a0-8 s1-0) (a1-7 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -3815,12 +3817,12 @@ (let ((a1-8 (new 'stack-no-clear 'vector))) (set! (-> a1-8 quad) (-> s1-0 quad)) (set! (-> a1-8 w) 8192.0) - (when (not (add-root-sphere-to-hash! (-> obj nav) a1-8 32)) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-8 32)) (when (< f30-0 f28-0) (set! f30-0 f28-0) (set! sv-784 (new 'stack-no-clear 'vector)) (let ((a3-3 (new 'stack-no-clear 'vector))) - (set! sv-800 (-> obj nav)) + (set! sv-800 (-> this nav)) (set! sv-832 sv-784) (let* ((v1-30 s1-0) (a0-18 (-> sv-800 state mesh)) @@ -3842,7 +3844,7 @@ ) 0 (set! (-> s1-0 y) (-> sv-784 y)) - (if (enemy-above-ground? obj s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) ) (set! (-> arg0 quad) (-> s1-0 quad)) @@ -3859,72 +3861,74 @@ ) ) -(defmethod enemy-method-93 crimson-guard-level ((obj crimson-guard-level)) - (let ((s5-0 (-> obj nav state)) - (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) +(defmethod enemy-method-93 crimson-guard-level ((this crimson-guard-level)) + (let ((s5-0 (-> this nav state)) + (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (set! (-> s5-0 heading quad) (-> v1-2 quad)) ) 0 - (let ((s5-1 (-> obj nav state))) - (set! (-> (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) quad) (-> s5-1 travel quad)) + (let ((s5-1 (-> this nav state))) + (set! (-> (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) quad) + (-> s5-1 travel quad) + ) ) - (let ((a0-5 (-> obj nav state)) + (let ((a0-5 (-> this nav state)) (v1-9 *null-vector*) ) (set! (-> a0-5 velocity quad) (-> v1-9 quad)) ) 0 - ((method-of-type nav-enemy enemy-method-93) obj) + ((method-of-type nav-enemy enemy-method-93) this) (none) ) -(defmethod enemy-method-89 crimson-guard-level ((obj crimson-guard-level) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) #f ) -(defmethod enemy-method-87 crimson-guard-level ((obj crimson-guard-level) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-87 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((s4-0 (-> obj skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 38))) + (let ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) (set! (-> s4-0 param 0) (ja-aframe 3.0 0)) (set! (-> s4-0 param 1) (-> arg0 anim-speed)) (set! (-> s4-0 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> obj draw art-group data 38)) num-func-seek!) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) ) #t ) -(defmethod enemy-method-88 crimson-guard-level ((obj crimson-guard-level) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-88 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.01)) - (let ((s4-0 (-> obj skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 38))) + (let ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) (set! (-> s4-0 param 0) (ja-aframe 9.0 0)) (set! (-> s4-0 param 1) (-> arg0 anim-speed)) (set! (-> s4-0 frame-num) (ja-aframe 4.0 0)) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> obj draw art-group data 38)) num-func-seek!) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) ) #t ) -(defmethod enemy-method-90 crimson-guard-level ((obj crimson-guard-level) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 crimson-guard-level ((this crimson-guard-level) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (not (enemy-method-89 obj arg1)) + (not (enemy-method-89 this arg1)) ) ((= v1-0 1) (set! s5-0 (ja-done? 0)) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) (set! (-> s4-1 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) @@ -3933,12 +3937,12 @@ s5-0 ) ((= v1-0 2) - (enemy-method-87 obj arg1) + (enemy-method-87 this arg1) #f ) ((= v1-0 3) (set! s5-0 (ja-done? 0)) - (let ((s4-2 (-> obj skel root-channel 0))) + (let ((s4-2 (-> this skel root-channel 0))) (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) (set! (-> s4-2 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) @@ -3947,11 +3951,11 @@ s5-0 ) ((= v1-0 4) - (not (enemy-method-88 obj arg1)) + (not (enemy-method-88 this arg1)) ) ((= v1-0 5) (set! s5-0 (ja-done? 0)) - (let ((s4-3 (-> obj skel root-channel 0))) + (let ((s4-3 (-> this skel root-channel 0))) (set! (-> s4-3 param 0) (ja-aframe 9.0 0)) (set! (-> s4-3 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim #f) num-func-seek!) @@ -3970,7 +3974,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) (nav-enemy-method-166 self) (let ((v1-7 (-> self nav))) @@ -4044,14 +4048,14 @@ (while (not (-> self already-shot)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (ja-channel-set! 1) (let ((gp-0 (current-time)) (s5-0 150) (f30-0 2.0) ) (ja-no-eval :group! (-> self draw art-group data 6) :num! (loop! f30-0) :frame-num 0.0) - (until (>= (- (current-time) gp-0) s5-0) + (until (time-elapsed? gp-0 s5-0) (crimson-guard-level-method-201 self (* 0.006666667 (the float (- (current-time) (-> self state-time))))) (suspend) (ja :num! (loop! f30-0)) @@ -4069,9 +4073,9 @@ ) ) -(defmethod init-enemy-collision! crimson-guard-level ((obj crimson-guard-level)) +(defmethod init-enemy-collision! crimson-guard-level ((this crimson-guard-level)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -4141,55 +4145,55 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch nav-enemy vs crimson-guard-level. -(defmethod relocate crimson-guard-level ((obj crimson-guard-level) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(defmethod relocate crimson-guard-level ((this crimson-guard-level) (arg0 int)) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) arg0) ) - (if (nonzero? (-> obj l-control)) - (&+! (-> obj l-control) arg0) + (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)) obj arg0) + ((the-as (function nav-enemy int nav-enemy) (find-parent-method crimson-guard-level 7)) this arg0) ) ) ;; WARN: Return type mismatch float vs none. -(defmethod crimson-guard-level-method-203 crimson-guard-level ((obj crimson-guard-level) (arg0 int)) +(defmethod crimson-guard-level-method-203 crimson-guard-level ((this crimson-guard-level) (arg0 int)) "TODO - probably a flag" (cond ((= arg0 1) - (setup-masks (-> obj draw) 16 0) - (set! (-> obj weapon) 1) - (set! (-> obj root nav-radius) 10240.0) + (setup-masks (-> this draw) 16 0) + (set! (-> this weapon) 1) + (set! (-> this root nav-radius) 10240.0) ) ((= arg0 3) - (setup-masks (-> obj draw) 16 0) - (set! (-> obj weapon) 3) - (set! (-> obj root nav-radius) 10240.0) + (setup-masks (-> this draw) 16 0) + (set! (-> this weapon) 3) + (set! (-> this root nav-radius) 10240.0) ) ((zero? arg0) - (setup-masks (-> obj draw) 8 0) - (set! (-> obj weapon) 0) - (set! (-> obj root nav-radius) 6144.0) + (setup-masks (-> this draw) 8 0) + (set! (-> this weapon) 0) + (set! (-> this root nav-radius) 6144.0) ) ) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-enemy-method-156 crimson-guard-level ((obj crimson-guard-level)) +(defmethod nav-enemy-method-156 crimson-guard-level ((this crimson-guard-level)) (cond - ((logtest? (-> obj flags) 36) - (let ((v1-3 (-> obj nav state)) - (a0-2 (-> obj root trans)) + ((logtest? (-> this flags) 36) + (let ((v1-3 (-> this nav state)) + (a0-2 (-> this root trans)) ) (logclear! (-> v1-3 flags) (nav-state-flag directional-mode)) (logior! (-> v1-3 flags) (nav-state-flag target-poly-dirty)) @@ -4198,133 +4202,133 @@ 0 ) (else - ((method-of-type nav-enemy nav-enemy-method-156) obj) + ((method-of-type nav-enemy nav-enemy-method-156) this) ) ) (none) ) -(defmethod init-enemy! crimson-guard-level ((obj crimson-guard-level)) +(defmethod init-enemy! crimson-guard-level ((this crimson-guard-level)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 int)) - (let ((f0-0 (res-lump-float (-> obj entity) 'rotoffset))) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-0 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) ) ) (set! sv-16 0) - (let ((v1-6 (res-lump-data (-> obj entity) 'trans-offset vector :tag-ptr (the-as (pointer res-tag) (& sv-16))))) + (let ((v1-6 (res-lump-data (-> this entity) 'trans-offset vector :tag-ptr (the-as (pointer res-tag) (& sv-16))))) (when v1-6 - (+! (-> obj root trans x) (-> v1-6 x)) - (+! (-> obj root trans y) (-> v1-6 y)) - (+! (-> obj root trans z) (-> v1-6 z)) + (+! (-> this root trans x) (-> v1-6 x)) + (+! (-> this root trans y) (-> v1-6 y)) + (+! (-> this root trans z) (-> v1-6 z)) ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard-level" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (let ((a0-13 (-> obj entity))) - (set! (-> obj flags) (the-as int ((method-of-object a0-13 get-property-value) - a0-13 - 'crimson-guard-level-flags - 'interp - -1000000000.0 - (the-as uint128 1) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (let ((a0-13 (-> this entity))) + (set! (-> this flags) (the-as int ((method-of-object a0-13 get-property-value) + a0-13 + 'crimson-guard-level-flags + 'interp + -1000000000.0 + (the-as uint128 1) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) ) - (set! (-> obj info) *crimson-guard-level-global-info*) - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-info*) + (set! (-> this info) *crimson-guard-level-global-info*) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-info*) (cond - ((logtest? (-> obj flags) 1) - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-tazer-info*) + ((logtest? (-> this flags) 1) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-tazer-info*) ) - ((logtest? (-> obj flags) 4) - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-sniper-info*) + ((logtest? (-> this flags) 4) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-sniper-info*) ) - ((logtest? (-> obj flags) 2) - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-blast-info*) + ((logtest? (-> this flags) 2) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-blast-info*) ) - ((logtest? (-> obj flags) 8) - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-grenade-info*) + ((logtest? (-> this flags) 8) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-grenade-info*) ) (else - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-info*) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-info*) ) ) - (let ((v1-34 (-> obj nav))) + (let ((v1-34 (-> this nav))) (set! (-> v1-34 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 143360.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (set! (-> obj joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) obj 4)) - (set! (-> obj l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 13) obj 0.0)) - (set! (-> obj l-control state points-to-draw) 0) - (let ((v1-45 (get-rand-int obj 2))) - (if (logtest? (-> obj flags) 4) + (set! (-> this draw lod-set lod 0 dist) 143360.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 4)) + (set! (-> this l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 13) this 0.0)) + (set! (-> this l-control state points-to-draw) 0) + (let ((v1-45 (get-rand-int this 2))) + (if (logtest? (-> this flags) 4) (set! v1-45 0) ) (cond ((zero? v1-45) - (set! (-> obj anim-shoot 0 anim-index) 19) - (set! (-> obj anim-shoot 0 start) 1.0) - (set! (-> obj anim-shoot 0 end) 12.0) - (set! (-> obj anim-shoot 1 anim-index) 26) - (set! (-> obj anim-shoot 1 start) 12.0) - (set! (-> obj anim-shoot 1 end) 22.0) - (set! (-> obj anim-shoot 2 anim-index) 24) - (set! (-> obj anim-shoot 2 start) 20.0) - (set! (-> obj anim-shoot 2 end) 30.0) + (set! (-> this anim-shoot 0 anim-index) 19) + (set! (-> this anim-shoot 0 start) 1.0) + (set! (-> this anim-shoot 0 end) 12.0) + (set! (-> this anim-shoot 1 anim-index) 26) + (set! (-> this anim-shoot 1 start) 12.0) + (set! (-> this anim-shoot 1 end) 22.0) + (set! (-> this anim-shoot 2 anim-index) 24) + (set! (-> this anim-shoot 2 start) 20.0) + (set! (-> this anim-shoot 2 end) 30.0) ) ((= v1-45 1) - (set! (-> obj anim-shoot 0 anim-index) 27) - (set! (-> obj anim-shoot 0 start) 2.0) - (set! (-> obj anim-shoot 0 end) 9.0) - (set! (-> obj anim-shoot 1 anim-index) 29) - (set! (-> obj anim-shoot 1 start) 18.0) - (set! (-> obj anim-shoot 1 end) 26.0) - (set! (-> obj anim-shoot 2 anim-index) 30) - (set! (-> obj anim-shoot 2 start) 26.0) - (set! (-> obj anim-shoot 2 end) 35.0) + (set! (-> this anim-shoot 0 anim-index) 27) + (set! (-> this anim-shoot 0 start) 2.0) + (set! (-> this anim-shoot 0 end) 9.0) + (set! (-> this anim-shoot 1 anim-index) 29) + (set! (-> this anim-shoot 1 start) 18.0) + (set! (-> this anim-shoot 1 end) 26.0) + (set! (-> this anim-shoot 2 anim-index) 30) + (set! (-> this anim-shoot 2 start) 26.0) + (set! (-> this anim-shoot 2 end) 35.0) ) ) ) - (setup-masks (-> obj draw) 0 -1) + (setup-masks (-> this draw) 0 -1) (cond - ((logtest? (-> obj flags) 1) - (crimson-guard-level-method-203 obj 1) + ((logtest? (-> this flags) 1) + (crimson-guard-level-method-203 this 1) ) - ((logtest? (-> obj flags) 2) - (set! (-> obj fact trig-dist) 409600.0) - (crimson-guard-level-method-203 obj 0) + ((logtest? (-> this flags) 2) + (set! (-> this fact trig-dist) 409600.0) + (crimson-guard-level-method-203 this 0) ) - ((logtest? (-> obj flags) 4) - (crimson-guard-level-method-203 obj 0) + ((logtest? (-> this flags) 4) + (crimson-guard-level-method-203 this 0) ) - ((logtest? (-> obj flags) 8) - (set! (-> obj fact trig-dist) 819200.0) - (crimson-guard-level-method-203 obj 3) + ((logtest? (-> this flags) 8) + (set! (-> this fact trig-dist) 819200.0) + (crimson-guard-level-method-203 this 3) ) - ((logtest? (-> obj flags) 16) - (crimson-guard-level-method-203 obj 0) + ((logtest? (-> this flags) 16) + (crimson-guard-level-method-203 this 0) ) ) (cond - ((logtest? (-> obj flags) 128) - (setup-masks (-> obj draw) 5 0) - (set-vector! (-> obj root scale) 1.1 1.1 1.1 1.0) - (set! (-> obj hit-points) (* (-> obj hit-points) 2)) - (set-vector! (-> obj joint scale) 1.1 1.0 1.1 1.0) - (let* ((a0-45 (-> obj neck)) + ((logtest? (-> this flags) 128) + (setup-masks (-> this draw) 5 0) + (set-vector! (-> this root scale) 1.1 1.1 1.1 1.0) + (set! (-> this hit-points) (* (-> this hit-points) 2)) + (set-vector! (-> this joint scale) 1.1 1.0 1.1 1.0) + (let* ((a0-45 (-> this neck)) (t9-22 (method-of-object a0-45 trs-set!)) (a1-22 #f) (a2-10 #f) @@ -4336,23 +4340,23 @@ (set! (-> a3-5 w) 1.0) (t9-22 a0-45 (the-as vector a1-22) (the-as quaternion a2-10) a3-5) ) - (mode-set! (-> obj neck) (joint-mod-mode rotate2)) - (set! (-> obj joint parented-scale?) #t) - (set! (-> obj neck parented-scale?) #t) + (mode-set! (-> this neck) (joint-mod-mode rotate2)) + (set! (-> this joint parented-scale?) #t) + (set! (-> this neck parented-scale?) #t) ) (else - (setup-masks (-> obj draw) 3 0) + (setup-masks (-> this draw) 3 0) ) ) - (set! (-> obj hit-face) (the-as uint -1)) - (set! (-> obj anim-get-up-front) 33) - (set! (-> obj anim-get-up-back) 34) - (set! (-> obj joint-enable) #f) - (set! (-> obj fact pickup-type) (pickup-type ammo-random)) - (set! (-> obj fact pickup-amount) 10.0) - (set! (-> obj fact pickup-spawn-amount) 1.0) - (set! (-> obj trigger) #f) - (set! (-> obj root pause-adjust-distance) 409600.0) + (set! (-> this hit-face) (the-as uint -1)) + (set! (-> this anim-get-up-front) 33) + (set! (-> this anim-get-up-back) 34) + (set! (-> this joint-enable) #f) + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + (set! (-> this fact pickup-amount) 10.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this trigger) #f) + (set! (-> this root pause-adjust-distance) 409600.0) (transform-post) 0 (none) diff --git a/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc b/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc index db9107c4ba..42dc358287 100644 --- a/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc +++ b/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc @@ -201,15 +201,15 @@ ) -(defmethod guard-conversation-method-24 guard-conversation ((obj guard-conversation)) - (let ((v1-0 (-> obj remaining))) +(defmethod guard-conversation-method-24 guard-conversation ((this guard-conversation)) + (let ((v1-0 (-> this remaining))) (when (> v1-0 0) - (set! (-> obj remaining) (+ v1-0 -1)) - (let* ((s3-0 (rand-vu-int-count-excluding 32 (the-as int (-> obj skip-mask)))) + (set! (-> this remaining) (+ v1-0 -1)) + (let* ((s3-0 (rand-vu-int-count-excluding 32 (the-as int (-> this skip-mask)))) (s5-0 (-> *gconv-dialogues* dialogues s3-0 speeches)) (s4-1 (zero? (rand-vu-int-count 2))) ) - (logior! (-> obj skip-mask) (ash 1 s3-0)) + (logior! (-> this skip-mask) (ash 1 s3-0)) (dotimes (s3-1 (-> s5-0 length)) (let* ((v1-9 (-> s5-0 s3-1)) (t0-0 (if s4-1 @@ -220,7 +220,7 @@ ) (add-process *gui-control* - obj + this (gui-channel guard) (gui-action play) (the-as string t0-0) @@ -298,9 +298,9 @@ (lookup-gui-connection-id *gui-control* (the-as string #f) (gui-channel guard) (gui-action none)) ) ) - (set! (-> self last-playing-time) (current-time)) + (set-time! (-> self last-playing-time)) ) - (if (and (-> self triggered?) (>= (- (current-time) (-> self last-playing-time)) (seconds 6))) + (if (and (-> self triggered?) (time-elapsed? (-> self last-playing-time) (seconds 6))) (guard-conversation-method-24 self) ) ) @@ -364,7 +364,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! guard-conversation ((obj guard-conversation) (arg0 entity-actor)) +(defmethod init-from-entity! guard-conversation ((this guard-conversation) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -372,10 +372,10 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj triggered?) #f) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (let ((v1-2 (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0))) + (set! (-> this triggered?) #f) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (let ((v1-2 (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0))) (let ((a1-4 (-> *gconv-dialogues* dialogues length)) (a0-6 0) ) @@ -387,21 +387,21 @@ This commonly includes things such as: ) ) ) - (set! (-> obj remaining) a0-6) + (set! (-> this remaining) a0-6) ) - (set! (-> obj skip-mask) (the-as uint (lognot v1-2))) + (set! (-> this skip-mask) (the-as uint (lognot v1-2))) ) - (let ((s5-1 (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))))) + (let ((s5-1 (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))))) (set! sv-16 (new 'static 'res-tag)) - (let ((s4-0 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((s4-0 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (if (or (not s4-0) (zero? (-> sv-16 elt-count))) (go process-drawable-art-error "missing actors") ) (let* ((s4-1 (-> s4-0 0)) (s3-0 (-> s4-1 length)) ) - (set! (-> obj actor-group) s4-1) - (set! (-> obj actor-count) s3-0) + (set! (-> this actor-group) s4-1) + (set! (-> this actor-count) s3-0) (if (!= s3-0 2) (go process-drawable-art-error "bad actor count") ) @@ -431,8 +431,8 @@ This commonly includes things such as: ) ) (if s5-1 - (go (method-of-object obj die)) - (go (method-of-object obj dormant)) + (go (method-of-object this die)) + (go (method-of-object this dormant)) ) ) (none) diff --git a/goal_src/jak2/levels/common/enemy/guards/transport-level.gc b/goal_src/jak2/levels/common/enemy/guards/transport-level.gc index b5b3b00518..2c5c0bbabd 100644 --- a/goal_src/jak2/levels/common/enemy/guards/transport-level.gc +++ b/goal_src/jak2/levels/common/enemy/guards/transport-level.gc @@ -90,14 +90,14 @@ ) ) -(defmethod transport-level-method-34 transport-level ((obj transport-level)) - (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> obj root transv y)) 0.0 122880.0)) - (f0-4 (lerp-scale 0.0 1.0 (- (-> obj root trans y) (-> obj y-dest)) 143360.0 20480.0)) +(defmethod transport-level-method-34 transport-level ((this transport-level)) + (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> this root transv y)) 0.0 122880.0)) + (f0-4 (lerp-scale 0.0 1.0 (- (-> this root trans y) (-> this y-dest)) 143360.0 20480.0)) (a0-3 (static-sound-spec "transport" :volume 0.0 :mask (pitch reg0))) ) (set! (-> a0-3 volume) (the int (* 1024.0 f0-4))) (set! (-> a0-3 pitch-mod) (the int (* 1524.0 f30-0))) - (sound-play-by-spec a0-3 (-> obj ambient-sound-id) (-> obj root trans)) + (sound-play-by-spec a0-3 (-> this ambient-sound-id) (-> this root trans)) ) 0 (none) @@ -107,8 +107,8 @@ :virtual #t :event transport-level-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) - (set! (-> self last-guard-spawn-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-guard-spawn-time)) ) :code (behavior () (ja-channel-push! 1 0) @@ -135,7 +135,7 @@ :virtual #t :event transport-level-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root transv y) 0.0) (set! (-> self last-guard-spawn-time) 0) 0 @@ -203,7 +203,7 @@ :virtual #t :event transport-level-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root transv y) 0.0) ) :code (behavior () @@ -231,41 +231,41 @@ ) ) -(defmethod transport-level-method-33 transport-level ((obj transport-level)) +(defmethod transport-level-method-33 transport-level ((this transport-level)) (let ((v1-0 0)) (dotimes (a0-1 8) - (if (handle->process (-> obj guards a0-1)) + (if (handle->process (-> this guards a0-1)) (+! v1-0 1) ) ) - (when (zero? (-> obj count-guard)) - (set! (-> obj last-guard-spawn-time) 0) + (when (zero? (-> this count-guard)) + (set! (-> this last-guard-spawn-time) 0) 0 ) - (when (and (>= (- (current-time) (-> obj last-guard-spawn-time)) (-> obj spawn-time)) - (< v1-0 (the-as int (-> obj num-wanted-guards))) + (when (and (time-elapsed? (-> this last-guard-spawn-time) (-> this spawn-time)) + (< v1-0 (the-as int (-> this num-wanted-guards))) ) (let ((s5-0 (new 'stack-no-clear 'crimson-guard-level-params))) - (set! (-> s5-0 transport-side) (-> obj spawn-side)) - (set! (-> s5-0 nav-mesh) (-> obj nav-mesh)) - (set! (-> s5-0 pos quad) (-> obj root trans quad)) + (set! (-> s5-0 transport-side) (-> this spawn-side)) + (set! (-> s5-0 nav-mesh) (-> this nav-mesh)) + (set! (-> s5-0 pos quad) (-> this root trans quad)) (+! (-> s5-0 pos y) 8192.0) - (quaternion-rotate-local-y! (-> s5-0 quat) (-> obj root quat) 32768.0) - (set! (-> s5-0 handle) (the-as uint (process->handle obj))) + (quaternion-rotate-local-y! (-> s5-0 quat) (-> this root quat) 32768.0) + (set! (-> s5-0 handle) (the-as uint (process->handle this))) (set! (-> s5-0 weapon) 1) - (dotimes (s4-0 (the-as int (-> obj num-wanted-guards))) - (when (not (handle->process (-> obj guards s4-0))) - (set! (-> obj guards s4-0) (ppointer->handle (process-spawn crimson-guard-level s5-0 :to obj))) + (dotimes (s4-0 (the-as int (-> this num-wanted-guards))) + (when (not (handle->process (-> this guards s4-0))) + (set! (-> this guards s4-0) (ppointer->handle (process-spawn crimson-guard-level s5-0 :to this))) #t (goto cfg-38) ) ) (label cfg-38) (when (-> s5-0 proc) - (set! (-> obj spawn-side) (- 1 (the-as int (-> obj spawn-side)))) - (set! (-> obj last-guard-spawn-time) (current-time)) - (let ((v0-0 (+ (-> obj count-guard) 1))) - (set! (-> obj count-guard) v0-0) + (set! (-> this spawn-side) (- 1 (the-as int (-> this spawn-side)))) + (set-time! (-> this last-guard-spawn-time)) + (let ((v0-0 (+ (-> this count-guard) 1))) + (set! (-> this count-guard) v0-0) v0-0 ) ) @@ -274,8 +274,8 @@ ) ) -(defmethod transport-level-method-31 transport-level ((obj transport-level)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod transport-level-method-31 transport-level ((this transport-level)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -309,46 +309,46 @@ (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod transport-level-method-32 transport-level ((obj transport-level)) - (set! (-> obj spawn-side) (the-as uint 0)) +(defmethod transport-level-method-32 transport-level ((this transport-level)) + (set! (-> this spawn-side) (the-as uint 0)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! transport-level ((obj transport-level) (arg0 entity-actor)) +(defmethod init-from-entity! transport-level ((this transport-level) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (transport-level-method-31 obj) - (process-drawable-from-entity! obj arg0) + (transport-level-method-31 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-transport-level" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (transport-level-method-32 obj) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj spawn?) #t) - (set! (-> obj nav-mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) - (set! (-> obj num-wanted-guards) (the-as uint 4)) + (transport-level-method-32 this) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this spawn?) #t) + (set! (-> this nav-mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) + (set! (-> this num-wanted-guards) (the-as uint 4)) (dotimes (v1-11 8) - (set! (-> obj guards v1-11) (the-as handle #f)) + (set! (-> this guards v1-11) (the-as handle #f)) ) - (set! (-> obj spawn-time) (seconds 4)) - (+! (-> obj root trans y) 40960.0) - (set! (-> obj y-dest) (-> obj root trans y)) - (+! (-> obj root trans y) 163840.0) - (go (method-of-object obj come-down)) + (set! (-> this spawn-time) (seconds 4)) + (+! (-> this root trans y) 40960.0) + (set! (-> this y-dest) (-> this root trans y)) + (+! (-> this root trans y) 163840.0) + (go (method-of-object this come-down)) (none) ) diff --git a/goal_src/jak2/levels/common/enemy/hopper.gc b/goal_src/jak2/levels/common/enemy/hopper.gc index b778f701e5..e4587ca2d4 100644 --- a/goal_src/jak2/levels/common/enemy/hopper.gc +++ b/goal_src/jak2/levels/common/enemy/hopper.gc @@ -82,15 +82,15 @@ ) ) -(defmethod enemy-method-77 hopper ((obj hopper) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 hopper ((this hopper) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((a2-0 (ash 1 (-> *hopper-global-info* prev-blue-hit))) - (v1-3 (enemy-method-120 obj 3 a2-0)) - (a1-5 (-> obj draw art-group data (-> *hopper-global-info* blue-hit-anim v1-3 hit-anim-index))) + (v1-3 (enemy-method-120 this 3 a2-0)) + (a1-5 (-> this draw art-group data (-> *hopper-global-info* blue-hit-anim v1-3 hit-anim-index))) ) (set! (-> *hopper-global-info* prev-blue-hit) v1-3) - (let ((a0-12 (-> obj skel root-channel 0))) + (let ((a0-12 (-> this skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim a1-5)) (set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim a1-5) frames num-frames) -1))) (set! (-> a0-12 param 1) 1.0) @@ -102,12 +102,12 @@ (else (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-2 (ash 1 (-> *hopper-global-info* prev-yellow-hit))) - (v1-13 (enemy-method-120 obj 3 a2-2)) - (a1-11 (-> obj draw art-group data (-> *hopper-global-info* yellow-hit-anim v1-13 hit-anim-index))) + (v1-13 (enemy-method-120 this 3 a2-2)) + (a1-11 (-> this draw art-group data (-> *hopper-global-info* yellow-hit-anim v1-13 hit-anim-index))) ) - (set! (-> obj land-anim-index) (-> *hopper-global-info* yellow-hit-anim v1-13 land-anim-index)) + (set! (-> this land-anim-index) (-> *hopper-global-info* yellow-hit-anim v1-13 land-anim-index)) (set! (-> *hopper-global-info* prev-yellow-hit) v1-13) - (let ((a0-27 (-> obj skel root-channel 0))) + (let ((a0-27 (-> this skel root-channel 0))) (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-11)) (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1))) (set! (-> a0-27 param 1) (-> arg0 0)) @@ -120,13 +120,13 @@ #t ) -(defmethod enemy-method-78 hopper ((obj hopper) (arg0 (pointer float))) +(defmethod enemy-method-78 hopper ((this hopper) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((s4-0 (-> obj draw art-group data 24))) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 24))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-3 param 1) (-> arg0 0)) @@ -140,18 +140,18 @@ ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data (-> obj land-anim-index)))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index)))) (set! (-> a0-5 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj land-anim-index))) frames num-frames) -1) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index))) frames num-frames) -1) ) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) (joint-control-channel-group! a0-5 - (the-as art-joint-anim (-> obj draw art-group data (-> obj land-anim-index))) + (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index))) num-func-seek! ) ) @@ -343,39 +343,39 @@ (set! (-> *hopper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod kill-prefer-falling hopper ((obj hopper)) +(defmethod kill-prefer-falling hopper ((this hopper)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond - ((-> obj can-go-knocked?) - (set! (-> obj can-go-knocked?) #f) - (go (method-of-object obj knocked)) + ((-> this can-go-knocked?) + (set! (-> this can-go-knocked?) #f) + (go (method-of-object this knocked)) ) (else - ((method-of-type nav-enemy kill-prefer-falling) obj) + ((method-of-type nav-enemy kill-prefer-falling) this) ) ) ) -(defmethod enemy-method-90 hopper ((obj hopper) (arg0 int) (arg1 enemy-jump-info)) - (when (= (-> obj jump-why) 2) +(defmethod enemy-method-90 hopper ((this hopper) (arg0 int) (arg1 enemy-jump-info)) + (when (= (-> this jump-why) 2) (cond ((zero? arg0) - (logior! (-> obj focus-status) (focus-status touch-water under-water)) + (logior! (-> this focus-status) (focus-status touch-water under-water)) ) (else - (when (focus-test? obj touch-water) + (when (focus-test? this touch-water) (let ((s3-0 (new 'stack-no-clear 'water-info))) - (water-info-init! (-> obj root) s3-0 (collide-action solid semi-solid)) + (water-info-init! (-> this root) s3-0 (collide-action solid semi-solid)) (let ((v1-9 #f)) (cond ((not (logtest? (water-flags touch-water) (-> s3-0 flags))) - (if (focus-test? obj under-water) + (if (focus-test? this under-water) (set! v1-9 #t) ) - (logclear! (-> obj focus-status) (focus-status touch-water under-water)) + (logclear! (-> this focus-status) (focus-status touch-water under-water)) ) - ((focus-test? obj under-water) - (let ((f0-1 (+ 11264.0 (-> obj root trans y)))) + ((focus-test? this under-water) + (let ((f0-1 (+ 11264.0 (-> this root trans y)))) (if (< (-> s3-0 trans y) f0-1) (set! v1-9 #t) ) @@ -383,9 +383,9 @@ ) ) (when v1-9 - (logclear! (-> obj focus-status) (focus-status under-water)) + (logclear! (-> this focus-status) (focus-status under-water)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> obj root trans quad)) + (set! (-> s2-0 quad) (-> this root trans quad)) (when (logtest? (water-flags touch-water) (-> s3-0 flags)) (set! (-> s2-0 y) (-> s3-0 trans y)) (let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000))) @@ -433,13 +433,13 @@ ) ) ) - ((method-of-type nav-enemy enemy-method-90) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-90) this arg0 arg1) ) -(defmethod enemy-method-89 hopper ((obj hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 hopper ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump-start-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump-start-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -450,10 +450,10 @@ #t ) -(defmethod enemy-method-87 hopper ((obj hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 hopper ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump-air-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump-air-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -464,10 +464,10 @@ #t ) -(defmethod enemy-method-88 hopper ((obj hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 hopper ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.075)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -521,7 +521,7 @@ ) ) -(defmethod hopper-method-178 hopper ((obj hopper)) +(defmethod hopper-method-178 hopper ((this hopper)) (local-vars (sv-752 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -531,17 +531,21 @@ (vf7 :class vf) ) (init-vf0-vector) - (+! (-> obj step-num) -1) + (+! (-> this step-num) -1) (cond - ((>= (-> obj step-num) 0) + ((>= (-> this step-num) 0) (let ((s3-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (vector-rotate-around-y! s3-0 (-> obj direction) (* 182.04445 (the float (+ (* (-> obj step-num) 16) -135)))) + (vector-rotate-around-y! + s3-0 + (-> this direction) + (* 182.04445 (the float (+ (* (-> this step-num) 16) -135))) + ) (let ((a1-1 s5-0)) - (let ((v1-7 (-> obj origin))) + (let ((v1-7 (-> this origin))) (let ((a0-2 s3-0)) - (let ((a2-1 (-> obj jump-dist))) + (let ((a2-1 (-> this jump-dist))) (.mov vf7 a2-1) ) (.lvf vf5 (&-> a0-2 quad)) @@ -553,7 +557,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-1 quad) vf6) ) - (let ((v1-8 (-> obj nav)) + (let ((v1-8 (-> this nav)) (a0-3 s5-0) (a1-2 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -562,18 +566,18 @@ (set! (-> a1-2 ignore) (the-as uint 2)) (let ((s4-0 (find-poly-containing-point-local (-> v1-8 state mesh) a1-2))) (when s4-0 - (let ((f30-0 (vector-dot s3-0 (-> obj direction)))) + (let ((f30-0 (vector-dot s3-0 (-> this direction)))) (new 'stack-no-clear 'vector) (let ((a1-3 (new 'stack-no-clear 'vector))) (set! (-> a1-3 quad) (-> s5-0 quad)) (set! (-> a1-3 w) 6144.0) - (when (not (add-root-sphere-to-hash! (-> obj nav) a1-3 #x8006c)) - (when (< (-> obj best-score) f30-0) - (set! (-> obj best-score) f30-0) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-3 #x8006c)) + (when (< (-> this best-score) f30-0) + (set! (-> this best-score) f30-0) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! sv-752 (new 'stack-no-clear 'vector)) (let ((s3-1 (new 'stack 'collide-query))) - (let ((s0-0 (-> obj nav)) + (let ((s0-0 (-> this nav)) (s1-0 s2-0) ) (let* ((v1-21 s5-0) @@ -588,12 +592,12 @@ ) 0 (set! (-> s5-0 y) (-> s2-0 y)) - (if (enemy-above-ground? obj s3-1 s5-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s3-1 s5-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s5-0 y) (-> s3-1 best-other-tri intersect y)) ) ) ) - (set! (-> obj best-point quad) (-> s5-0 quad)) + (set! (-> this best-point quad) (-> s5-0 quad)) ) ) ) @@ -700,6 +704,8 @@ ) (set! (-> self best-score) -2.0) (set! (-> self origin quad) (-> self root trans quad)) + ;; ;; og:preserve-this + ; (b! #t cfg-17) (until (not (hopper-method-178 self)) (empty) ) @@ -907,30 +913,30 @@ ) ) -(defmethod dispose! hopper ((obj hopper)) +(defmethod dispose! hopper ((this hopper)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) - ((the-as (function enemy none) (find-parent-method hopper 132)) obj) + ((the-as (function enemy none) (find-parent-method hopper 132)) this) (none) ) ;; WARN: Return type mismatch process-focusable vs hopper. -(defmethod relocate hopper ((obj hopper) (arg0 int)) - (if (nonzero? (-> obj path-intro)) - (&+! (-> obj path-intro) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method hopper 7)) this arg0) ) ) -(defmethod init-enemy-collision! hopper ((obj hopper)) +(defmethod init-enemy-collision! hopper ((this hopper)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -986,56 +992,70 @@ (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! hopper ((obj hopper)) +(defmethod init-enemy! hopper ((this hopper)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hopper" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *hopper-nav-enemy-info*) - (set! (-> obj can-go-knocked?) #t) - (let ((v1-9 (-> obj neck))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *hopper-nav-enemy-info*) + (set! (-> this can-go-knocked?) #t) + (let ((v1-9 (-> this neck))) (set! (-> v1-9 up) (the-as uint 1)) (set! (-> v1-9 nose) (the-as uint 2)) (set! (-> v1-9 ear) (the-as uint 0)) (set-vector! (-> v1-9 twist-max) 10922.667 12743.111 0.0 1.0) (set! (-> v1-9 ignore-angle) 18204.445) ) - (set! (-> obj jump-start-anim) (the-as uint 10)) - (set! (-> obj jump-air-anim) (the-as uint 13)) - (set! (-> obj jump-land-anim) (the-as uint 14)) - (set! (-> obj jump-height-min) 12288.0) - (set! (-> obj jump-anim-start-frame) 8.0) - (set! (-> obj land-anim-index) 26) - (set! (-> obj side) (get-rand-float-range obj -1.5 1.5)) - (when (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (set! (-> obj path-intro) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (if (-> obj path-intro) - (logior! (-> obj path-intro flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this jump-start-anim) (the-as uint 10)) + (set! (-> this jump-air-anim) (the-as uint 13)) + (set! (-> this jump-land-anim) (the-as uint 14)) + (set! (-> this jump-height-min) 12288.0) + (set! (-> this jump-anim-start-frame) 8.0) + (set! (-> this land-anim-index) 26) + (set! (-> this side) (get-rand-float-range this -1.5 1.5)) + (when (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (set! (-> this path-intro) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (if (-> this path-intro) + (logior! (-> this path-intro flags) (path-control-flag display draw-line draw-point draw-text)) ) ) - (add-connection *part-engine* obj 5 obj 318 (new 'static 'vector :x 1392.64 :y 491.52 :z 1638.4 :w 163840.0)) - (add-connection *part-engine* obj 5 obj 318 (new 'static 'vector :x -1392.64 :y 491.52 :z 1638.4 :w 163840.0)) - (logior! (-> obj nav flags) (nav-control-flag output-sphere-hash)) - (let ((v1-34 (-> obj nav))) + (add-connection + *part-engine* + this + 5 + this + 318 + (new 'static 'vector :x 1392.64 :y 491.52 :z 1638.4 :w 163840.0) + ) + (add-connection + *part-engine* + this + 5 + this + 318 + (new 'static 'vector :x -1392.64 :y 491.52 :z 1638.4 :w 163840.0) + ) + (logior! (-> this nav flags) (nav-control-flag output-sphere-hash)) + (let ((v1-34 (-> this nav))) (set! (-> v1-34 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 327680.0) - (let ((v1-39 (-> obj nav))) + (set-gravity-length (-> this root dynam) 327680.0) + (let ((v1-39 (-> this nav))) (set! (-> v1-39 nav-cull-radius) 61440.0) ) 0 - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) 0 (none) ) 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 98cd894c2f..9ca1720be9 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 @@ -429,12 +429,12 @@ ) -(defmethod play-impact-sound crimson-guard-hover-shot ((obj crimson-guard-hover-shot) (arg0 projectile-options)) +(defmethod play-impact-sound crimson-guard-hover-shot ((this crimson-guard-hover-shot) (arg0 projectile-options)) (cond ((zero? arg0) ) (else - ((method-of-type guard-shot play-impact-sound) obj arg0) + ((method-of-type guard-shot play-impact-sound) this arg0) ) ) 0 @@ -590,10 +590,10 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod enemy-method-135 crimson-guard-hover ((obj crimson-guard-hover) (arg0 int)) - (if (and (zero? arg0) (logtest? #x4000000 (-> obj incoming penetrate-using))) +(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)) obj arg0) + ((the-as (function enemy int sound-id) (find-parent-method crimson-guard-hover 135)) this arg0) ) (the-as sound-id 0) ) @@ -679,7 +679,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) (let ((f0-1 (vector-vector-distance-squared (-> self root trans) (-> self focus-pos))) (f1-0 122880.0) @@ -692,7 +692,7 @@ 0 ) :exit (behavior () - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (set! (-> self restart-fly-anims) #t) ) :trans (behavior () @@ -775,10 +775,10 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 4)) + (if (time-elapsed? (-> self state-time) (seconds 4)) (go-hostile self) ) ) @@ -853,13 +853,13 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) (set! (-> self shots-fired) 0) 0 ) :exit (behavior () - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (set! (-> self restart-fly-anims) #t) ) :trans (behavior () @@ -974,7 +974,7 @@ (set! (-> self hit-points) 0) (do-effect (-> self skel effect) 'death-default 0.0 -1) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1098,7 +1098,7 @@ ) ) -(defmethod general-event-handler crimson-guard-hover ((obj crimson-guard-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler crimson-guard-hover ((this crimson-guard-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-15 enemy-flag)) @@ -1111,36 +1111,36 @@ ) ) (('hit 'hit-flinch 'hit-knocked) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (when (and (-> obj next-state) (let ((v1-8 (-> obj next-state name))) - (or (= v1-8 'ambush-fly) (= v1-8 'ambush-attack)) - ) + (speech-control-method-13 *speech-control* (the-as handle this)) + (when (and (-> this next-state) (let ((v1-8 (-> this next-state name))) + (or (= v1-8 'ambush-fly) (= v1-8 'ambush-attack)) + ) ) - (hover-nav-control-method-20 (-> obj hover)) - (hover-enemy-method-140 obj #t) - (let ((v1-14 (-> obj enemy-flags))) + (hover-nav-control-method-20 (-> this hover)) + (hover-enemy-method-140 this #t) + (let ((v1-14 (-> this enemy-flags))) (if (logtest? v1-14 (enemy-flag checking-water)) (set! v1-15 (logior v1-14 (enemy-flag enable-on-active))) (set! v1-15 (logclear v1-14 (enemy-flag enable-on-active))) ) ) - (set! (-> obj enemy-flags) v1-15) - (hover-enemy-method-153 obj) + (set! (-> this enemy-flags) v1-15) + (hover-enemy-method-153 this) ) - (when (> (-> obj hit-points) 0) - (let* ((s1-0 (handle->process (-> obj incoming attacker-handle))) + (when (> (-> this hit-points) 0) + (let* ((s1-0 (handle->process (-> this incoming attacker-handle))) (v1-23 (if (type? s1-0 process-focusable) s1-0 ) ) ) - (if (and *target* v1-23 (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (-> obj focus-pos))) + (if (and *target* v1-23 (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> this focus-pos))) (f1-0 122880.0) ) (< f0-0 (* f1-0 f1-0)) ) ) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-11)) ) ) ) @@ -1148,7 +1148,7 @@ (function enemy process int symbol event-message-block object) (find-parent-method crimson-guard-hover 74) ) - obj + this arg0 arg1 arg2 @@ -1162,13 +1162,13 @@ (when (= (the-as symbol a0-27) 'attack) (when (logtest? (-> (the-as process-focusable v1-31) mask) (process-mask target)) (if (and (focus-test? (the-as process-focusable v1-31) dead) - (let ((f0-1 (vector-vector-distance-squared (-> obj root trans) (-> obj focus-pos))) + (let ((f0-1 (vector-vector-distance-squared (-> this root trans) (-> this focus-pos))) (f1-3 122880.0) ) (< f0-1 (* f1-3 f1-3)) ) ) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-10)) ) ) ) @@ -1177,7 +1177,7 @@ (function enemy process int symbol event-message-block object) (find-parent-method crimson-guard-hover 74) ) - obj + this arg0 arg1 arg2 @@ -1189,7 +1189,7 @@ (function enemy process int symbol event-message-block object) (find-parent-method crimson-guard-hover 74) ) - obj + this arg0 arg1 arg2 @@ -1200,13 +1200,13 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod crimson-guard-hover-method-162 crimson-guard-hover ((obj crimson-guard-hover) (arg0 process-focusable)) - (let* ((v1-1 (vector+! (new 'stack-no-clear 'vector) (-> obj root trans) (-> obj root transv))) - (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> obj focus-pos))) +(defmethod crimson-guard-hover-method-162 crimson-guard-hover ((this crimson-guard-hover) (arg0 process-focusable)) + (let* ((v1-1 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (-> this root transv))) + (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this focus-pos))) (f30-0 (vector-length s5-1)) (a0-4 (if arg0 arg0 - (handle->process (-> obj focus handle)) + (handle->process (-> this focus handle)) ) ) ) @@ -1217,14 +1217,15 @@ (s5-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-1 1.0)) ) (and (< 0.0 (vector-dot s4-1 s5-2)) - (and (>= (- (current-time) (-> obj last-fire-time)) - (the int (* 300.0 (rand-vu-float-range (-> obj attack-wait-min) (-> obj attack-wait-max)))) - ) - (get-enemy-target obj) + (and (time-elapsed? + (-> this last-fire-time) + (the int (* 300.0 (rand-vu-float-range (-> this attack-wait-min) (-> this attack-wait-max)))) + ) + (get-enemy-target this) (< f30-0 225280.0) (and (< (fabs (vector-x-angle s5-2)) 3640.889) - (enemy-method-95 obj (-> obj focus-pos) 5461.3335) - (check-los? (-> obj los) (seconds 0.4)) + (enemy-method-95 this (-> this focus-pos) 5461.3335) + (check-los? (-> this los) (seconds 0.4)) ) ) ) @@ -1234,7 +1235,7 @@ ) ) -(defmethod hover-enemy-method-145 crimson-guard-hover ((obj crimson-guard-hover) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod hover-enemy-method-145 crimson-guard-hover ((this crimson-guard-hover) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) @@ -1243,44 +1244,44 @@ ) (let* ((f0-2 (- 1.0 arg1)) (a2-2 (- 1.0 (* f0-2 f0-2 f0-2))) - (a3-7 (-> obj skel root-channel arg0)) + (a3-7 (-> this skel root-channel arg0)) ) (let ((f0-6 (fabs a2-2))) (set! (-> a3-7 frame-interp 1) f0-6) (set! (-> a3-7 frame-interp 0) f0-6) ) - (set! (-> a3-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data v1-1))) + (set! (-> a3-7 frame-group) (the-as art-joint-anim (-> this draw art-group data v1-1))) (set! (-> a3-7 param 0) 0.0) - (set! (-> a3-7 frame-num) (-> obj skel root-channel 0 frame-num)) - (joint-control-channel-group! a3-7 (the-as art-joint-anim (-> obj draw art-group data v1-1)) num-func-chan) + (set! (-> a3-7 frame-num) (-> this skel root-channel 0 frame-num)) + (joint-control-channel-group! a3-7 (the-as art-joint-anim (-> this draw art-group data v1-1)) num-func-chan) ) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 crimson-guard-hover ((obj crimson-guard-hover) (arg0 vector)) - (let ((s4-0 (-> obj root))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-52 crimson-guard-hover ((this crimson-guard-hover) (arg0 vector)) + (let ((s4-0 (-> this root))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-2)) - (let ((gp-1 (-> obj root transv))) - (let ((a1-1 (handle->process (-> obj incoming attacker-handle)))) + (let ((gp-1 (-> this root transv))) + (let ((a1-1 (handle->process (-> this incoming attacker-handle)))) (if a1-1 - (vector-! gp-1 (-> (the-as process-focusable a1-1) root trans) (-> obj root trans)) - (vector-! gp-1 (-> obj incoming attacker-pos) (-> obj root trans)) + (vector-! gp-1 (-> (the-as process-focusable a1-1) root trans) (-> this root trans)) + (vector-! gp-1 (-> this incoming attacker-pos) (-> this root trans)) ) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) (vector-rotate90-around-y! gp-1 gp-1) (if (< 0.0 (vector-dot - (vector-! (new 'stack-no-clear 'vector) (-> obj incoming attacker-pos) (-> s4-0 trans)) + (vector-! (new 'stack-no-clear 'vector) (-> this incoming attacker-pos) (-> s4-0 trans)) (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat)) ) ) (vector-negate! gp-1 gp-1) ) - (let ((f30-1 (get-rand-float-range obj 0.0 1.0)) - (s5-1 (-> obj enemy-info)) + (let ((f30-1 (get-rand-float-range this 0.0 1.0)) + (s5-1 (-> this enemy-info)) ) (vector-float*! gp-1 gp-1 (lerp (-> s5-1 knocked-hard-vxz-lo) (-> s5-1 knocked-hard-vxz-hi) f30-1)) (set! (-> gp-1 y) (lerp (-> s5-1 knocked-hard-vy-lo) (-> s5-1 knocked-hard-vy-hi) f30-1)) @@ -1288,56 +1289,56 @@ ) ) (else - ((the-as (function hover-enemy vector none) (find-parent-method crimson-guard-hover 52)) obj arg0) + ((the-as (function hover-enemy vector none) (find-parent-method crimson-guard-hover 52)) this arg0) ) ) ) (none) ) -(defmethod enemy-method-77 crimson-guard-hover ((obj crimson-guard-hover) (arg0 (pointer float))) +(defmethod enemy-method-77 crimson-guard-hover ((this crimson-guard-hover) (arg0 (pointer float))) (ja-channel-push! 1 0) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) ) - (set! (-> obj knocked-recover-anim) 13) + (set! (-> this knocked-recover-anim) 13) ) (else - (let ((a0-4 (-> obj skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 10))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 10))) (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 10)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1)) ) (set! (-> a0-4 param 1) (-> arg0 0)) (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> obj draw art-group data 10)) num-func-seek!) + (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!) ) - (set! (-> obj knocked-recover-anim) 11) + (set! (-> this knocked-recover-anim) 11) ) ) #t ) -(defmethod enemy-method-78 crimson-guard-hover ((obj crimson-guard-hover) (arg0 (pointer float))) +(defmethod enemy-method-78 crimson-guard-hover ((this crimson-guard-hover) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.4)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) ) #t ) @@ -1347,13 +1348,13 @@ ) ) -(defmethod track-target! crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod track-target! crimson-guard-hover ((this crimson-guard-hover)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (seek! (-> obj gun-x-angle) (-> obj gun-x-angle-final) (* 21845.334 (seconds-per-frame))) - (let* ((s5-0 (hover-nav-control-method-16 (-> obj hover) (new 'stack-no-clear 'vector))) + (seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame))) + (let* ((s5-0 (hover-nav-control-method-16 (-> this hover) (new 'stack-no-clear 'vector))) (s4-0 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) @@ -1372,23 +1373,23 @@ ) (quaternion*! s5-1 a1-4 s4-0) (quaternion-slerp! - (the-as quaternion (-> obj hips-jmod target)) - (the-as quaternion (-> obj hips-jmod target)) + (the-as quaternion (-> this hips-jmod target)) + (the-as quaternion (-> this hips-jmod target)) s5-1 (* 2.0 (seconds-per-frame)) ) ) (let ((t9-6 (method-of-type hover-enemy track-target!))) - (t9-6 obj) + (t9-6 this) ) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) 0 (none) ) -(defmethod hover-enemy-method-142 crimson-guard-hover ((obj crimson-guard-hover)) - (let ((s5-0 (-> obj main-joint-acc)) - (s4-0 (-> obj main-joint-vel)) +(defmethod hover-enemy-method-142 crimson-guard-hover ((this crimson-guard-hover)) + (let ((s5-0 (-> this main-joint-acc)) + (s4-0 (-> this main-joint-vel)) (gp-0 (lambda ((arg0 crimson-guard-hover) (arg1 cspace) (arg2 float) (arg3 float) (arg4 vector) (arg5 vector) (arg6 int)) (local-vars (sv-192 float) (sv-208 quaternion) (sv-224 vector)) @@ -1471,18 +1472,18 @@ ) ) (gp-0 - obj - (-> obj node-list data (-> obj hover-info engine-left)) - (-> obj hover-info thrust-rotate-left) + this + (-> this node-list data (-> this hover-info engine-left)) + (-> this hover-info thrust-rotate-left) -1.0 s5-0 s4-0 0 ) (gp-0 - obj - (-> obj node-list data (-> obj hover-info engine-right)) - (-> obj hover-info thrust-rotate-right) + this + (-> this node-list data (-> this hover-info engine-right)) + (-> this hover-info thrust-rotate-right) 1.0 s5-0 s4-0 @@ -1493,8 +1494,8 @@ (none) ) -(defmethod hover-enemy-method-143 crimson-guard-hover ((obj crimson-guard-hover) (arg0 int) (arg1 float)) - (let* ((s2-0 (-> obj node-list data arg0)) +(defmethod hover-enemy-method-143 crimson-guard-hover ((this crimson-guard-hover) (arg0 int) (arg1 float)) + (let* ((s2-0 (-> this node-list data arg0)) (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) s2-0)) (s5-0 (new 'stack-no-clear 'matrix)) ) @@ -1524,26 +1525,26 @@ (vector+! (-> s5-0 trans) s4-0 v1-29) ) ) - (spawn-with-matrix (-> obj engine-part) s5-0) + (spawn-with-matrix (-> this engine-part) s5-0) ) - (sound-play "hover-jets" :id (-> obj sound-id)) + (sound-play "hover-jets" :id (-> this sound-id)) 0 (none) ) -(defmethod shoot crimson-guard-hover ((obj crimson-guard-hover) +(defmethod shoot crimson-guard-hover ((this crimson-guard-hover) (arg0 vector) (arg1 projectile-init-by-other-params) (arg2 int) (arg3 int) (arg4 float) ) - (vector<-cspace! (-> arg1 pos) (-> obj node-list data arg2)) + (vector<-cspace! (-> arg1 pos) (-> this node-list data arg2)) (let ((s2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> obj node-list data arg2 bone transform vector 1) + (-> this node-list data arg2 bone transform vector 1) 1.0 ) (* 273.06668 arg4) @@ -1551,7 +1552,7 @@ ) (a1-8 (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> obj node-list data arg2 bone transform vector 2) + (-> this node-list data arg2 bone transform vector 2) 1.0 ) ) @@ -1559,39 +1560,39 @@ (vector-orient-by-quat! (-> arg1 vel) a1-8 s2-1) ) (vector-normalize! (-> arg1 vel) (* 819200.0 arg4)) - (spawn-projectile crimson-guard-hover-shot arg1 obj *default-dead-pool*) + (spawn-projectile crimson-guard-hover-shot arg1 this *default-dead-pool*) 0 (none) ) -(defmethod kill-prefer-falling crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod kill-prefer-falling crimson-guard-hover ((this crimson-guard-hover)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'knocked)) - (go (method-of-object obj die-now)) + ((and (-> this next-state) (= (-> this next-state name) 'knocked)) + (go (method-of-object this die-now)) ) - ((-> obj enemy-info use-die-falling) - (go (method-of-object obj die-falling)) + ((-> this enemy-info use-die-falling) + (go (method-of-object this die-falling)) ) (else - (go (method-of-object obj die)) + (go (method-of-object this die)) ) ) ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 crimson-guard-hover ((obj crimson-guard-hover) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 crimson-guard-hover ((this crimson-guard-hover) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 (the-as nav-enemy obj) arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 (the-as nav-enemy this) arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) ) -(defmethod hover-enemy-method-149 crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod hover-enemy-method-149 crimson-guard-hover ((this crimson-guard-hover)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard-hover" (the-as (pointer uint32) #f)) @@ -1602,9 +1603,9 @@ (none) ) -(defmethod init-enemy-collision! crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod init-enemy-collision! crimson-guard-hover ((this crimson-guard-hover)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1694,17 +1695,17 @@ (set! (-> s5-0 backup-collide-with) (-> v1-31 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod hover-enemy-method-150 crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod hover-enemy-method-150 crimson-guard-hover ((this crimson-guard-hover)) *crimson-guard-hover-enemy-info* ) -(defmethod hover-enemy-method-151 crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod hover-enemy-method-151 crimson-guard-hover ((this crimson-guard-hover)) (new 'static 'hover-enemy-info :fly-forward-anim 7 :fly-backward-anim 8 @@ -1720,121 +1721,121 @@ ) ) -(defmethod hover-enemy-method-152 crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod hover-enemy-method-152 crimson-guard-hover ((this crimson-guard-hover)) (new 'static 'hover-nav-params :max-speed 102400.0 :max-acceleration 143360.0 :friction 0.05) ) ;; WARN: Return type mismatch hover-enemy vs crimson-guard-hover. -(defmethod relocate crimson-guard-hover ((obj crimson-guard-hover) (arg0 int)) - (if (nonzero? (-> obj gun-jmod)) - (&+! (-> obj gun-jmod) arg0) +(defmethod relocate crimson-guard-hover ((this crimson-guard-hover) (arg0 int)) + (if (nonzero? (-> this gun-jmod)) + (&+! (-> this gun-jmod) arg0) ) - (if (nonzero? (-> obj hips-jmod)) - (&+! (-> obj hips-jmod) arg0) + (if (nonzero? (-> this hips-jmod)) + (&+! (-> this hips-jmod) arg0) ) - (if (nonzero? (-> obj smoke-part)) - (&+! (-> obj smoke-part) arg0) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) arg0) ) - (if (nonzero? (-> obj engine-part)) - (&+! (-> obj engine-part) arg0) + (if (nonzero? (-> this engine-part)) + (&+! (-> this engine-part) arg0) ) - (the-as crimson-guard-hover ((method-of-type hover-enemy relocate) obj arg0)) + (the-as crimson-guard-hover ((method-of-type hover-enemy relocate) this arg0)) ) -(defmethod deactivate crimson-guard-hover ((obj crimson-guard-hover)) - (if (nonzero? (-> obj smoke-part)) - (kill-and-free-particles (-> obj smoke-part)) +(defmethod deactivate crimson-guard-hover ((this crimson-guard-hover)) + (if (nonzero? (-> this smoke-part)) + (kill-and-free-particles (-> this smoke-part)) ) - (if (nonzero? (-> obj engine-part)) - (kill-and-free-particles (-> obj engine-part)) + (if (nonzero? (-> this engine-part)) + (kill-and-free-particles (-> this engine-part)) ) - (sound-stop (-> obj sound-id)) - ((method-of-type hover-enemy deactivate) obj) + (sound-stop (-> this sound-id)) + ((method-of-type hover-enemy deactivate) this) (none) ) -(defmethod init-enemy! crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod init-enemy! crimson-guard-hover ((this crimson-guard-hover)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) - (hover-enemy-method-149 obj) - (init-enemy-behaviour-and-stats! obj (hover-enemy-method-150 obj)) - (hover-enemy-method-155 obj) - (new-source! (-> obj los) obj (seconds 2) (collide-spec backgnd enemy obstacle)) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj scale) 1.2) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj root dynam gravity y) 327680.0) - (set! (-> obj root dynam gravity-length) 327680.0) - (set! (-> obj root dynam gravity-max) 327680.0) - (set! (-> obj gun-jmod) - (the-as joint-mod (new 'process 'joint-mod-rotate-local obj (-> obj hover-info gun-base) #t)) + (hover-enemy-method-149 this) + (init-enemy-behaviour-and-stats! this (hover-enemy-method-150 this)) + (hover-enemy-method-155 this) + (new-source! (-> this los) this (seconds 2) (collide-spec backgnd enemy obstacle)) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this scale) 1.2) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this root dynam gravity y) 327680.0) + (set! (-> this root dynam gravity-length) 327680.0) + (set! (-> this root dynam gravity-max) 327680.0) + (set! (-> this gun-jmod) + (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this hover-info gun-base) #t)) ) - (set! (-> obj gun-x-angle) 0.0) - (set! (-> obj gun-x-angle-final) 0.0) - (set! (-> obj hips-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local obj 18 #t))) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (set! (-> this gun-x-angle) 0.0) + (set! (-> this gun-x-angle-final) 0.0) + (set! (-> this hips-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local this 18 #t))) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-30 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-30 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (if (and v1-30 (= (-> sv-16 elt-count) 1)) - (set! (-> obj entity-group) (-> v1-30 0)) - (set! (-> obj entity-group) #f) + (set! (-> this entity-group) (-> v1-30 0)) + (set! (-> this entity-group) #f) ) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-34 (res-lump-data (-> obj entity) 'timeout (pointer float) :tag-ptr (& sv-32)))) + (let ((v1-34 (res-lump-data (-> this entity) 'timeout (pointer float) :tag-ptr (& sv-32)))) (cond ((and v1-34 (= (-> sv-32 elt-count) 2)) - (set! (-> obj attack-wait-min) (-> v1-34 0)) - (set! (-> obj attack-wait-max) (-> v1-34 1)) + (set! (-> this attack-wait-min) (-> v1-34 0)) + (set! (-> this attack-wait-max) (-> v1-34 1)) ) (else - (set! (-> obj attack-wait-min) 1.0) - (set! (-> obj attack-wait-max) 3.0) + (set! (-> this attack-wait-min) 1.0) + (set! (-> this attack-wait-max) 3.0) ) ) ) (set! sv-48 (new 'static 'res-tag)) - (let ((v1-40 (res-lump-data (-> obj entity) 'min-max (pointer float) :tag-ptr (& sv-48)))) - (set! (-> obj attack-miss-dist-min) (if (and v1-40 (> (the-as int (-> sv-48 elt-count)) 0)) - (-> v1-40 0) - -40960.0 - ) + (let ((v1-40 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-48)))) + (set! (-> this attack-miss-dist-min) (if (and v1-40 (> (the-as int (-> sv-48 elt-count)) 0)) + (-> v1-40 0) + -40960.0 + ) ) ) (set! sv-64 (new 'static 'res-tag)) - (let ((v1-43 (res-lump-data (-> obj entity) 'min-max (pointer float) :tag-ptr (& sv-64)))) - (set! (-> obj attack-miss-dist-max) (if (and v1-43 (< 1 (the-as int (-> sv-64 elt-count)))) - (-> v1-43 1) - 40960.0 - ) + (let ((v1-43 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-64)))) + (set! (-> this attack-miss-dist-max) (if (and v1-43 (< 1 (the-as int (-> sv-64 elt-count)))) + (-> v1-43 1) + 40960.0 + ) ) ) - (set! (-> obj attack-miss-dist-curr) 0.0) - (set! (-> obj path) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (set! (-> obj path-u) 0.0) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj smoke-part) (create-launch-control (-> *part-group-id-table* 154) obj)) - (set! (-> obj engine-part) (create-launch-control (-> *part-group-id-table* 156) obj)) + (set! (-> this attack-miss-dist-curr) 0.0) + (set! (-> this path) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (set! (-> this path-u) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 154) this)) + (set! (-> this engine-part) (create-launch-control (-> *part-group-id-table* 156) this)) (add-connection *part-engine* - obj + this 26 - obj + this 318 (new 'static 'vector :x 1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) (add-connection *part-engine* - obj + this 26 - obj + this 318 (new 'static 'vector :x -1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) - (add-connection *part-engine* obj 26 obj 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) + (add-connection *part-engine* this 26 this 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) 0 (none) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/flamer.gc b/goal_src/jak2/levels/common/enemy/hover/flamer.gc index 1a998610b5..3a3ce7d9dc 100644 --- a/goal_src/jak2/levels/common/enemy/hover/flamer.gc +++ b/goal_src/jak2/levels/common/enemy/hover/flamer.gc @@ -216,41 +216,41 @@ (set! (-> *flamer-nav-enemy-info* fact-defaults) *flamer-fact-defaults*) -(defmethod general-event-handler flamer ((obj flamer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler flamer ((this flamer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) (('update-formation) - (let ((v0-3 (the-as object (-> obj offset)))) + (let ((v0-3 (the-as object (-> this offset)))) (set! (-> (the-as vector v0-3) quad) (-> (the-as vector (-> arg3 param 0)) quad)) v0-3 ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod flamer-method-189 flamer ((obj flamer)) +(defmethod flamer-method-189 flamer ((this flamer)) (with-pp - (let ((v1-0 (-> obj formation-entity))) + (let ((v1-0 (-> this formation-entity))) (when (if v1-0 (-> v1-0 extra process) ) @@ -259,7 +259,7 @@ (set! (-> a1-1 num-params) 0) (set! (-> a1-1 message) 'join) (let ((t9-0 send-event-function) - (v1-5 (-> obj formation-entity)) + (v1-5 (-> this formation-entity)) ) (t9-0 (if v1-5 @@ -276,9 +276,9 @@ ) ) -(defmethod flamer-method-190 flamer ((obj flamer)) +(defmethod flamer-method-190 flamer ((this flamer)) (with-pp - (let ((v1-0 (-> obj formation-entity))) + (let ((v1-0 (-> this formation-entity))) (when (if v1-0 (-> v1-0 extra process) ) @@ -287,7 +287,7 @@ (set! (-> a1-1 num-params) 0) (set! (-> a1-1 message) 'leave) (let ((t9-0 send-event-function) - (v1-5 (-> obj formation-entity)) + (v1-5 (-> this formation-entity)) ) (t9-0 (if v1-5 @@ -304,29 +304,29 @@ ) ) -(defmethod nav-enemy-method-142 flamer ((obj flamer) (arg0 nav-control)) +(defmethod nav-enemy-method-142 flamer ((this flamer) (arg0 nav-control)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 (target-pos 0) (-> obj root trans)) - (seek-toward-heading-vec! (-> obj root) gp-0 131072.0 (seconds 0.5)) + (vector-! gp-0 (target-pos 0) (-> this root trans)) + (seek-toward-heading-vec! (-> this root) gp-0 131072.0 (seconds 0.5)) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod flamer-method-182 flamer ((obj flamer) (arg0 vector) (arg1 process-focusable)) +(defmethod flamer-method-182 flamer ((this flamer) (arg0 vector) (arg1 process-focusable)) (with-pp (set! arg0 (cond - ((and *target* (-> obj next-state) (let ((v1-4 (-> obj next-state name))) - (or (= v1-4 'hostile) (= v1-4 'attack) (= v1-4 'hit)) - ) + ((and *target* (-> this next-state) (let ((v1-4 (-> this next-state name))) + (or (= v1-4 'hostile) (= v1-4 'attack) (= v1-4 'hit)) + ) ) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) (process->ppointer pp)) (set! (-> a1-3 num-params) 0) (set! (-> a1-3 message) 'get-formation) (let* ((t9-0 send-event-function) - (v1-7 (-> obj formation-entity)) + (v1-7 (-> this formation-entity)) (s2-0 (the-as hover-formation-control (t9-0 (if v1-7 (-> v1-7 extra process) @@ -339,7 +339,7 @@ ) (cond ((and s2-0 (not (is-formation-type-in-range s2-0))) - (hover-formation-control-method-15 s2-0 arg0 (-> obj offset)) + (hover-formation-control-method-15 s2-0 arg0 (-> this offset)) ) (else (cond @@ -351,24 +351,24 @@ (set! (-> s1-0 quad) (-> (get-trans arg1 0) quad)) (let ((s3-1 (new 'stack-no-clear 'vector))) (let ((s2-1 (new 'stack-no-clear 'vector))) - (vector-! s3-1 s1-0 (-> obj root trans)) - (vector-flatten! s2-1 s3-1 (-> obj zone-to-world vector 2)) + (vector-! s3-1 s1-0 (-> this root trans)) + (vector-flatten! s2-1 s3-1 (-> this zone-to-world vector 2)) (vector-float*! s2-1 s2-1 -0.9) (vector+! s3-1 s3-1 s2-1) ) - (vector+! s4-0 (-> obj root trans) s3-1) + (vector+! s4-0 (-> this root trans) s3-1) ) ) ) ) - (vector-matrix*! arg0 s4-0 (-> obj world-to-zone)) - (vector+! arg0 arg0 (-> obj offset)) - (vector-matrix*! arg0 arg0 (-> obj zone-to-world)) + (vector-matrix*! arg0 s4-0 (-> this world-to-zone)) + (vector+! arg0 arg0 (-> this offset)) + (vector-matrix*! arg0 arg0 (-> this zone-to-world)) ) ) ) ) - (let* ((v1-30 (+ (current-time) (the-as time-frame (-> obj sync-off)))) + (let* ((v1-30 (+ (current-time) (the-as time-frame (-> this sync-off)))) (f0-5 (+ (-> arg0 x) (* 614.4 (cos (* 54.613335 (the float (mod v1-30 1200))))))) ) (set! (-> arg0 x) f0-5) @@ -376,7 +376,7 @@ ) ) (else - (set! (-> arg0 quad) (-> obj idle-pos quad)) + (set! (-> arg0 quad) (-> this idle-pos quad)) arg0 ) ) @@ -424,13 +424,13 @@ ) (defbehavior flamer-flit-post flamer () - (when (>= (- (current-time) (-> self flit-timer)) (rand-vu-int-range (seconds 1.2) (seconds 3))) + (when (time-elapsed? (-> self flit-timer) (rand-vu-int-range (seconds 1.2) (seconds 3))) (set! (-> self flit-angle) (the float (sar (shl (the int (+ (-> self flit-angle) (* 182.04445 (rand-vu-float-range 160.0 200.0)))) 48) 48) ) ) - (set! (-> self flit-timer) (current-time)) + (set-time! (-> self flit-timer)) ) (flamer-attack-post) (none) @@ -439,14 +439,14 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. ;; WARN: disable def twice: 45. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod flamer-method-183 flamer ((obj flamer)) +(defmethod flamer-method-183 flamer ((this flamer)) (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'get-formation) (let* ((t9-0 send-event-function) - (v1-2 (-> obj formation-entity)) + (v1-2 (-> this formation-entity)) (a0-3 (the-as hover-formation-control (t9-0 (if v1-2 (-> v1-2 extra process) @@ -460,14 +460,14 @@ symbol (cond (a0-3 - (and (hover-formation-control-method-16 a0-3) (>= (the-as int (-> obj focus aware)) 3)) + (and (hover-formation-control-method-16 a0-3) (>= (the-as int (-> this focus aware)) 3)) ) (*target* (let ((a1-1 (target-pos 0))) - (-> obj root trans) + (-> this root trans) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-matrix*! s5-0 a1-1 (-> obj world-to-zone)) - (and (>= (-> obj enemy-info notice-distance) (-> s5-0 z)) (>= (the-as int (-> obj focus aware)) 3)) + (vector-matrix*! s5-0 a1-1 (-> this world-to-zone)) + (and (>= (-> this enemy-info notice-distance) (-> s5-0 z)) (>= (the-as int (-> this focus aware)) 3)) ) ) ) @@ -481,27 +481,27 @@ ) ) -(defmethod flamer-method-188 flamer ((obj flamer) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod flamer-method-188 flamer ((this flamer) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) (set! v1-1 arg2) (set! v1-1 arg3) ) - (let ((a3-5 (-> obj skel root-channel arg0))) + (let ((a3-5 (-> this skel root-channel arg0))) (let ((f0-2 (fabs arg1))) (set! (-> a3-5 frame-interp 1) f0-2) (set! (-> a3-5 frame-interp 0) f0-2) ) - (set! (-> a3-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data v1-1))) + (set! (-> a3-5 frame-group) (the-as art-joint-anim (-> this draw art-group data v1-1))) (set! (-> a3-5 param 0) 0.0) - (set! (-> a3-5 frame-num) (-> obj skel root-channel 0 frame-num)) - (joint-control-channel-group! a3-5 (the-as art-joint-anim (-> obj draw art-group data v1-1)) num-func-chan) + (set! (-> a3-5 frame-num) (-> this skel root-channel 0 frame-num)) + (joint-control-channel-group! a3-5 (the-as art-joint-anim (-> this draw art-group data v1-1)) num-func-chan) ) (none) ) -(defmethod flamer-method-187 flamer ((obj flamer)) +(defmethod flamer-method-187 flamer ((this flamer)) (local-vars (at-0 int) (at-1 int)) (with-pp (rlet ((vf0 :class vf) @@ -509,12 +509,12 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3))) + (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 3))) (a0-2 (new 'stack-no-clear 'vector)) (v1-1 (new 'stack-no-clear 'vector)) ) (new 'stack-no-clear 'vector) - (vector-! a0-2 a1-1 (-> obj main-joint-pos)) + (vector-! a0-2 a1-1 (-> this main-joint-pos)) (let ((a2-2 a0-2)) (.lvf vf1 (&-> a0-2 quad)) (let ((f0-0 (-> pp clock frames-per-second))) @@ -525,7 +525,7 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> a2-2 quad) vf1) ) - (vector-! v1-1 a0-2 (-> obj main-joint-vel)) + (vector-! v1-1 a0-2 (-> this main-joint-vel)) (let ((a2-4 v1-1)) (.lvf vf1 (&-> v1-1 quad)) (let ((f0-1 (-> pp clock frames-per-second))) @@ -536,16 +536,16 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> a2-4 quad) vf1) ) - (set! (-> obj main-joint-pos quad) (-> a1-1 quad)) + (set! (-> this main-joint-pos quad) (-> a1-1 quad)) (let* ((f0-2 0.4) (f1-1 (- 1.0 f0-2)) - (a1-5 (-> obj main-joint-vel)) + (a1-5 (-> this main-joint-vel)) ) (set! (-> a1-5 x) (+ (* f0-2 (-> a0-2 x)) (* f1-1 (-> a1-5 x)))) (set! (-> a1-5 y) (+ (* f0-2 (-> a0-2 y)) (* f1-1 (-> a1-5 y)))) (set! (-> a1-5 z) (+ (* f0-2 (-> a0-2 z)) (* f1-1 (-> a1-5 z)))) ) - (set! (-> obj main-joint-acc quad) (-> v1-1 quad)) + (set! (-> this main-joint-acc quad) (-> v1-1 quad)) ) 0 0 @@ -554,36 +554,36 @@ ) ) -(defmethod track-target! flamer ((obj flamer)) +(defmethod track-target! flamer ((this flamer)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (update-vol! (-> obj sound) (-> obj sound-volume)) - (flamer-method-191 obj) - ((method-of-type nav-enemy track-target!) obj) + (update-vol! (-> this sound) (-> this sound-volume)) + (flamer-method-191 this) + ((method-of-type nav-enemy track-target!) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod flamer-method-191 flamer ((obj flamer)) +(defmethod flamer-method-191 flamer ((this flamer)) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) ) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'collide-query)) - (gp-0 (-> obj draw shadow-ctrl settings shadow-dir)) + (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 122880.0) ) - (set! (-> s4-0 start-pos quad) (-> obj root trans quad)) + (set! (-> s4-0 start-pos quad) (-> this root trans quad)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-12 s4-0)) (set! (-> v1-12 radius) 3276.8) (set! (-> v1-12 collide-with) (collide-spec backgnd)) - (set! (-> v1-12 ignore-process0) obj) + (set! (-> v1-12 ignore-process0) this) (set! (-> v1-12 ignore-process1) #f) (set! (-> v1-12 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-12 action-mask) (collide-action solid)) @@ -591,16 +591,16 @@ (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) (cond ((>= f0-1 0.0) - (let ((v1-16 (-> obj draw shadow-ctrl))) + (let ((v1-16 (-> this draw shadow-ctrl))) (logclear! (-> v1-16 settings flags) (shadow-flags disable-draw)) ) 0 (-> s4-0 best-other-tri intersect) - (let ((a1-3 (-> obj root trans))) + (let ((a1-3 (-> this root trans))) (-> a1-3 y) (let ((f1-2 (* f0-1 f30-0))) (shadow-control-method-14 - (-> obj draw shadow-ctrl) + (-> this draw shadow-ctrl) a1-3 gp-0 (fmax 32768.0 (* 409600.0 f0-1)) @@ -611,7 +611,7 @@ ) ) (else - (let ((v1-27 (-> obj draw shadow-ctrl))) + (let ((v1-27 (-> this draw shadow-ctrl))) (logior! (-> v1-27 settings flags) (shadow-flags disable-draw)) ) 0 @@ -621,7 +621,7 @@ ) ) (else - (let ((v1-29 (-> obj draw shadow-ctrl))) + (let ((v1-29 (-> this draw shadow-ctrl))) (logior! (-> v1-29 settings flags) (shadow-flags disable-draw)) ) 0 @@ -675,21 +675,21 @@ #f ) -(defmethod flamer-method-184 flamer ((obj flamer)) - (let ((v1-0 (-> obj ground-mode))) +(defmethod flamer-method-184 flamer ((this flamer)) + (let ((v1-0 (-> this ground-mode))) (cond ((= v1-0 1) - (seek! (-> obj base-pos y) (-> obj dest-pos y) (* 40960.0 (seconds-per-frame))) + (seek! (-> this base-pos y) (-> this dest-pos y) (* 40960.0 (seconds-per-frame))) ) ((zero? v1-0) (let ((a1-1 (new 'stack-no-clear 'collide-query))) (cond - ((enemy-method-125 obj a1-1 (collide-spec backgnd) 8192.0 26624.0 1024.0) - (set! (-> obj base-pos y) (+ 22528.0 (-> obj root gspot-pos y))) + ((enemy-method-125 this a1-1 (collide-spec backgnd) 8192.0 26624.0 1024.0) + (set! (-> this base-pos y) (+ 22528.0 (-> this root gspot-pos y))) ) (else - (let ((s4-0 (-> obj nav)) - (s3-0 (-> obj base-pos)) + (let ((s4-0 (-> this nav)) + (s3-0 (-> this base-pos)) (s5-0 (new 'stack 'nav-find-poly-parms)) ) (vector-! (-> s5-0 point) s3-0 (-> s4-0 state mesh bounds)) @@ -698,7 +698,7 @@ (find-nearest-poly-to-point-local (-> s4-0 state mesh) s5-0) (let ((v1-13 (-> s5-0 poly))) (if v1-13 - (set! (-> obj base-pos y) (+ 22528.0 (-> obj nav state mesh bounds y) (-> v1-13 vertex0 y))) + (set! (-> this base-pos y) (+ 22528.0 (-> this nav state mesh bounds y) (-> v1-13 vertex0 y))) ) ) ) @@ -708,27 +708,27 @@ ) ) ) - (let ((v1-16 (+ (current-time) (the-as time-frame (-> obj sync-off))))) + (let ((v1-16 (+ (current-time) (the-as time-frame (-> this sync-off))))) (seek! - (-> obj root trans y) - (+ (-> obj base-pos y) (* 1228.8 (cos (* 100.66974 (the float (mod v1-16 651)))))) + (-> this root trans y) + (+ (-> this base-pos y) (* 1228.8 (cos (* 100.66974 (the float (mod v1-16 651)))))) (* 16384.0 (seconds-per-frame)) ) ) (let ((s5-2 (new 'stack-no-clear 'vector))) (set! (-> s5-2 quad) (-> *up-vector* quad)) (vector-normalize! s5-2 6144.0) - (vector/! s5-2 s5-2 (-> obj root scale)) - (vector-rotate-around-z! s5-2 s5-2 (-> obj flit-angle)) - (vector-seek! (-> obj flit-joint target) s5-2 (* 32768.0 (seconds-per-frame))) + (vector/! s5-2 s5-2 (-> this root scale)) + (vector-rotate-around-z! s5-2 s5-2 (-> this flit-angle)) + (vector-seek! (-> this flit-joint target) s5-2 (* 32768.0 (seconds-per-frame))) ) - (update-trans! (-> obj sound) (-> obj root trans)) - (update! (-> obj sound)) + (update-trans! (-> this sound) (-> this root trans)) + (update! (-> this sound)) (none) ) -(defmethod go-stare flamer ((obj flamer)) - (go-hostile obj) +(defmethod go-stare flamer ((this flamer)) + (go-hostile this) ) (defstate wait-for-formation (flamer) @@ -775,7 +775,7 @@ (set! (-> self root trans quad) (-> self idle-pos quad)) ) :trans (behavior () - (when (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) (flamer-method-183 self)) + (when (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (flamer-method-183 self)) (if (logtest? (enemy-option ambush) (-> self fact enemy-options)) (go-virtual ambush) (go-virtual active) @@ -857,7 +857,7 @@ (vector-reset! (-> self fly-dir)) (sound-play "flamer-ambush") (quaternion-copy! (-> self root quat) (-> self init-quat)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy ambush) exit))) @@ -953,7 +953,7 @@ (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) @@ -984,9 +984,9 @@ :code flamer-fly-code :post (behavior () (flamer-method-187 self) - (when (>= (- (current-time) (-> self flit-timer)) (rand-vu-int-range (seconds 1.2) (seconds 3))) + (when (time-elapsed? (-> self flit-timer) (rand-vu-int-range (seconds 1.2) (seconds 3))) (set! (-> self flit-angle) (* 182.04445 (rand-vu-float-range 0.0 360.0))) - (set! (-> self flit-timer) (current-time)) + (set-time! (-> self flit-timer)) ) (vector-seek! (-> self root trans) (-> self base-pos) (* 16384.0 (seconds-per-frame))) (flamer-method-184 self) @@ -1041,7 +1041,7 @@ ) (let ((gp-1 (get-enemy-target self))) (if (and gp-1 - (>= (- (current-time) (-> self last-fire-time)) (the int (* 300.0 (rand-vu-float-range 3.0 6.0)))) + (time-elapsed? (-> self last-fire-time) (the int (* 300.0 (rand-vu-float-range 3.0 6.0)))) (< (vector-vector-distance (get-trans gp-1 3) (-> self root trans)) 245760.0) ) (go-virtual attack) @@ -1099,7 +1099,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1119,18 +1119,18 @@ ) ) ) - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (go-virtual hostile) ) :post flamer-attack-post ) -(defmethod enemy-method-46 flamer ((obj flamer) (arg0 int)) +(defmethod enemy-method-46 flamer ((this flamer) (arg0 int)) "@abstract" (let ((v1-0 arg0)) (cond ((= v1-0 1) - (let ((v1-2 (-> obj root root-prim))) + (let ((v1-2 (-> this root root-prim))) (let ((a0-1 v1-2)) (set! (-> a0-1 prim-core action) (collide-action solid deadly)) (set! (-> a0-1 prim-core collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list)) @@ -1142,7 +1142,7 @@ ) ) ((or (= v1-0 2) (zero? v1-0)) - (let ((v1-8 (-> obj root root-prim))) + (let ((v1-8 (-> this root root-prim))) (let ((a0-3 v1-8)) (set! (-> a0-3 prim-core action) (collide-action semi-solid deadly)) (set! (-> a0-3 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1161,8 +1161,8 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 flamer ((obj flamer) (arg0 (pointer float))) - (let ((v1-0 (-> obj incoming knocked-type))) +(defmethod enemy-method-77 flamer ((this flamer) (arg0 (pointer float))) + (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol (cond @@ -1172,21 +1172,21 @@ (s4-0 (new 'static 'array uint64 3 #x12 #x13 #x14)) (s3-0 (new 'static 'array int32 4 0 0 0 0)) (a2-0 (ash 1 (-> s3-0 0))) - (v1-6 (enemy-method-120 obj a1-3 a2-0)) - (s4-1 (-> obj draw art-group data (-> (the-as (pointer int32) (+ (* v1-6 8) (the-as int s4-0)))))) + (v1-6 (enemy-method-120 this a1-3 a2-0)) + (s4-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-6 8) (the-as int s4-0)))))) ) (set! (-> s3-0 0) v1-6) - (let ((v1-9 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-9 (= v1-9 (-> obj draw art-group data 16))) + (if (and v1-9 (= v1-9 (-> this draw art-group data 16))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-17 (-> obj skel root-channel 0))) + (let ((a0-17 (-> this skel root-channel 0))) (set! (-> a0-17 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-17 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-17 param 1) (-> arg0 0)) @@ -1197,8 +1197,8 @@ ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-10 (-> obj draw art-group data (-> obj enemy-info knocked-anim))) - (a0-21 (-> obj skel root-channel 0)) + (let ((a1-10 (-> this draw art-group data (-> this enemy-info knocked-anim))) + (a0-21 (-> this skel root-channel 0)) ) (set! (-> a0-21 frame-group) (the-as art-joint-anim a1-10)) (set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-10) frames num-frames) -1))) @@ -1243,7 +1243,7 @@ ) (when (and (nonzero? (-> self hit-points)) (zero? (-> self fated-time)) - (or (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (or (time-elapsed? (-> self state-time) (seconds 0.5)) (and (< (-> self root trans y) (+ 18432.0 (-> self root gspot-pos y))) (< (-> self root transv y) 0.0)) ) ) @@ -1290,22 +1290,22 @@ ) ) -(defmethod dispose! flamer ((obj flamer)) +(defmethod dispose! flamer ((this flamer)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (let ((s5-1 (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags)))) + (let ((s5-1 (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags)))) (let ((t9-0 (method-of-type nav-enemy dispose!))) - (t9-0 obj) + (t9-0 this) ) (if (not s5-1) - (flamer-method-190 obj) + (flamer-method-190 this) ) ) (none) ) -(defmethod flamer-method-186 flamer ((obj flamer) (arg0 float)) - (let ((f0-1 (* (-> obj scale) arg0)) - (v0-0 (-> obj root scale)) +(defmethod flamer-method-186 flamer ((this flamer) (arg0 float)) + (let ((f0-1 (* (-> this scale) arg0)) + (v0-0 (-> this root scale)) ) (set! (-> v0-0 x) f0-1) (set! (-> v0-0 y) f0-1) @@ -1315,14 +1315,14 @@ ) ) -(defmethod coin-flip? flamer ((obj flamer)) +(defmethod coin-flip? flamer ((this flamer)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod init-enemy-collision! flamer ((obj flamer)) +(defmethod init-enemy-collision! flamer ((this flamer)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1389,103 +1389,103 @@ (set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-drawable vs flamer. -(defmethod relocate flamer ((obj flamer) (arg0 int)) - (if (nonzero? (-> obj flit-joint)) - (&+! (-> obj flit-joint) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method flamer 7)) this arg0) ) ) -(defmethod init-enemy! flamer ((obj flamer)) +(defmethod init-enemy! flamer ((this flamer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flamer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *flamer-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj scale) 1.6) - (flamer-method-186 obj 1.0) - (logclear! (-> obj nav flags) (nav-control-flag limit-rotation-rate)) - (set! (-> obj sync-off) (the-as uint (get-rand-int obj 600))) - (set! (-> obj flit-angle) 0.0) - (set! (-> obj flit-timer) 0) - (set! (-> obj root dynam gravity y) 225280.0) - (set! (-> obj root dynam gravity-length) 225280.0) - (set! (-> obj root dynam gravity-max) 225280.0) - (let ((v1-25 (-> obj root trans))) - (set! (-> obj base-pos quad) (-> v1-25 quad)) + (init-enemy-behaviour-and-stats! this *flamer-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this scale) 1.6) + (flamer-method-186 this 1.0) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate)) + (set! (-> this sync-off) (the-as uint (get-rand-int this 600))) + (set! (-> this flit-angle) 0.0) + (set! (-> this flit-timer) 0) + (set! (-> this root dynam gravity y) 225280.0) + (set! (-> this root dynam gravity-length) 225280.0) + (set! (-> this root dynam gravity-max) 225280.0) + (let ((v1-25 (-> this root trans))) + (set! (-> this base-pos quad) (-> v1-25 quad)) (+! (-> v1-25 y) 22528.0) - (set! (-> obj idle-pos quad) (-> v1-25 quad)) + (set! (-> this idle-pos quad) (-> v1-25 quad)) ) - (set! (-> obj flit-joint) (the-as joint-mod (new 'process 'joint-mod-set-local obj 3 #t #f #f))) - (set! (-> obj flit-joint twist-min-y) (the-as float #t)) - (let ((f0-7 (res-lump-float (-> obj entity) 'rotoffset))) + (set! (-> this flit-joint) (the-as joint-mod (new 'process 'joint-mod-set-local this 3 #t #f #f))) + (set! (-> this flit-joint twist-min-y) (the-as float #t)) + (let ((f0-7 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-7 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-7) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-7) ) ) - (let ((f0-8 (quaternion-y-angle (-> obj root quat)))) - (matrix-rotate-y! (-> obj zone-to-world) f0-8) + (let ((f0-8 (quaternion-y-angle (-> this root quat)))) + (matrix-rotate-y! (-> this zone-to-world) f0-8) ) - (set! (-> obj zone-to-world trans quad) (-> obj root trans quad)) - (matrix-inverse-of-rot-trans! (-> obj world-to-zone) (-> obj zone-to-world)) - (set! (-> obj formation-entity) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set-vector! (-> obj offset) 0.0 0.0 94208.0 1.0) - (set! (-> obj path) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (set! (-> obj path-pos) 0.0) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "flamer-loop" :fo-max 80) (-> obj root trans)) + (set! (-> this zone-to-world trans quad) (-> this root trans quad)) + (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) + (set! (-> this formation-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set-vector! (-> this offset) 0.0 0.0 94208.0 1.0) + (set! (-> this path) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (set! (-> this path-pos) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "flamer-loop" :fo-max 80) (-> this root trans)) ) - (logior! (-> obj enemy-flags) (enemy-flag multi-focus)) - (let ((v1-45 (-> obj nav))) + (logior! (-> this enemy-flags) (enemy-flag multi-focus)) + (let ((v1-45 (-> this nav))) (set! (-> v1-45 sphere-mask) (the-as uint 0)) ) 0 - (let ((v1-47 (-> obj nav))) + (let ((v1-47 (-> this nav))) (set! (-> v1-47 nearest-y-threshold) 63488.0) ) 0 - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) + (quaternion-copy! (-> this init-quat) (-> this root quat)) (add-connection *part-engine* - obj + this 19 - obj + this 318 (new 'static 'vector :x 819.2 :y -1187.84 :z 2088.96 :w 163840.0) ) (add-connection *part-engine* - obj + this 19 - obj + this 318 (new 'static 'vector :x -819.2 :y -1187.84 :z 2088.96 :w 163840.0) ) - (add-connection *part-engine* obj 9 obj 768 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 9 this 768 (new 'static 'vector :w 163840.0)) 0 (none) ) -(defmethod go-idle flamer ((obj flamer)) - (if (-> obj formation-entity) - (go (method-of-object obj wait-for-formation)) - (go (method-of-object obj idle)) +(defmethod go-idle flamer ((this flamer)) + (if (-> this formation-entity) + (go (method-of-object this wait-for-formation)) + (go (method-of-object this idle)) ) 0 (none) 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 198f1740bc..5d461f39f1 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 @@ -128,9 +128,9 @@ a0-0 ) ) - (when (and (logtest? (-> gp-0 flags) 2) (>= (- (current-time) (-> self formation-timer)) (seconds 0.2))) + (when (and (logtest? (-> gp-0 flags) 2) (time-elapsed? (-> self formation-timer) (seconds 0.2))) (hover-formation-control-method-11 gp-0) - (set! (-> self formation-timer) (current-time)) + (set-time! (-> self formation-timer)) ) ) ) @@ -186,7 +186,7 @@ ) ) (let ((s4-0 (current-time))) - (until (>= (- (current-time) s4-0) (-> gp-0 s5-0 time)) + (until (time-elapsed? s4-0 (-> gp-0 s5-0 time)) (suspend) ) ) @@ -196,7 +196,7 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 2)) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) @@ -216,10 +216,10 @@ ) ) -(defmethod spawn-enemy hover-enemy-manager ((obj hover-enemy-manager) (arg0 uint)) - (when (< arg0 (the-as uint (-> obj actor-group-count))) - (dotimes (s4-0 (-> obj actor-group arg0 length)) - (let* ((s1-0 (-> obj actor-group arg0 data s4-0 actor)) +(defmethod spawn-enemy hover-enemy-manager ((this hover-enemy-manager) (arg0 uint)) + (when (< arg0 (the-as uint (-> this actor-group-count))) + (dotimes (s4-0 (-> this actor-group arg0 length)) + (let* ((s1-0 (-> this actor-group arg0 data s4-0 actor)) (s2-0 (-> (the-as entity-actor s1-0) etype)) (s3-0 (new 'stack-no-clear 'transformq)) ) @@ -231,13 +231,13 @@ (let ((s1-1 (get-process *default-dead-pool* s2-0 #x4000))) (when (when s1-1 (let ((t9-2 (method-of-type process activate))) - (t9-2 s1-1 obj (symbol->string (-> s2-0 symbol)) (the-as pointer #x70004000)) + (t9-2 s1-1 this (symbol->string (-> s2-0 symbol)) (the-as pointer #x70004000)) ) - (run-now-in-process s1-1 enemy-init-by-other obj s3-0) + (run-now-in-process s1-1 enemy-init-by-other this s3-0) (-> s1-1 ppointer) ) - (+! (-> obj alive-count) 1) - (+! (-> obj num-spawned) 1) + (+! (-> this alive-count) 1) + (+! (-> this num-spawned) 1) ) ) ) @@ -248,55 +248,55 @@ ) ;; WARN: Return type mismatch process vs hover-enemy-manager. -(defmethod relocate hover-enemy-manager ((obj hover-enemy-manager) (arg0 int)) - (when (-> obj formation) - (if (nonzero? (-> obj formation)) - (&+! (-> obj formation) arg0) +(defmethod relocate hover-enemy-manager ((this hover-enemy-manager) (arg0 int)) + (when (-> this formation) + (if (nonzero? (-> this formation)) + (&+! (-> this formation) arg0) ) ) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) + (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)) obj arg0) + ((the-as (function process int process) (find-parent-method hover-enemy-manager 7)) this arg0) ) ) -(defmethod hover-enemy-manager-init! hover-enemy-manager ((obj hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) +(defmethod hover-enemy-manager-init! hover-enemy-manager ((this hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) "Initialize this [[hover-enemy-manager]]." (local-vars (sv-16 res-tag)) - (set! (-> obj command-table) arg0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (-> obj entity) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this command-table) arg0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-5 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-5 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-5 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-5)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-5)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj total-to-spawn) 0) - (set! (-> obj num-spawned) 0) - (when (-> obj command-table) - (let ((v1-13 (-> obj command-table))) + (set! (-> this total-to-spawn) 0) + (set! (-> this num-spawned) 0) + (when (-> this command-table) + (let ((v1-13 (-> this command-table))) (dotimes (a0-6 (-> v1-13 length)) (if (= (-> v1-13 a0-6 command) 'spawn) - (+! (-> obj total-to-spawn) (-> obj actor-group (-> v1-13 a0-6 wave) length)) + (+! (-> this total-to-spawn) (-> this actor-group (-> v1-13 a0-6 wave) length)) ) ) ) ) - (set! (-> obj formation) #f) - (set! (-> obj formation-timer) (current-time)) - (set! (-> obj alive-count) 0) + (set! (-> this formation) #f) + (set-time! (-> this formation-timer)) + (set! (-> this alive-count) 0) 0 (none) ) 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 57390882c3..31e493eeaf 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-enemy.gc @@ -7,7 +7,7 @@ ;; DECOMP BEGINS -(defmethod general-event-handler hover-enemy ((obj hover-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler hover-enemy ((this hover-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-41 float)) @@ -19,28 +19,28 @@ (init-vf0-vector) (case arg2 (('hit 'hit-knocked 'hit-flinch) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (if (rng-hit? obj 0.4) - (go (method-of-object obj flying-death)) - (go (method-of-object obj flying-death-explode)) + ((zero? (-> this hit-points)) + (if (rng-hit? this 0.4) + (go (method-of-object this flying-death)) + (go (method-of-object this flying-death-explode)) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t @@ -50,7 +50,7 @@ (let* ((f0-0 409.6) (f0-2 (* f0-0 f0-0)) ) - (.lvf vf1 (&-> (vector-! (new 'stack-no-clear 'vector) (the-as vector s5-1) (-> obj offset)) quad)) + (.lvf vf1 (&-> (vector-! (new 'stack-no-clear 'vector) (the-as vector s5-1) (-> this offset)) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -58,30 +58,30 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-41 vf1) (if (< f0-2 v1-41) - (hover-nav-control-method-21 (-> obj hover)) + (hover-nav-control-method-21 (-> this hover)) ) ) - (let ((v0-7 (the-as object (-> obj offset)))) + (let ((v0-7 (the-as object (-> this offset)))) (set! (-> (the-as vector v0-7) quad) (-> (the-as vector s5-1) quad)) v0-7 ) ) ) (('get-hover-nav-sphere) - (if (not (and (-> obj next-state) (let ((v1-49 (-> obj next-state name))) - (or (= v1-49 'dormant) (= v1-49 'dormant-aware)) - ) + (if (not (and (-> this next-state) (let ((v1-49 (-> this next-state name))) + (or (= v1-49 'dormant) (= v1-49 'dormant-aware)) + ) ) ) - (-> (the-as collide-shape-prim-group (-> obj root root-prim)) + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child - (-> obj hover params nav-collide-prim-index) + (-> this hover params nav-collide-prim-index) prim-core ) ) ) (else - ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -203,13 +203,13 @@ (none) ) -(defmethod hover-enemy-method-142 hover-enemy ((obj hover-enemy)) +(defmethod hover-enemy-method-142 hover-enemy ((this hover-enemy)) 0 (none) ) -(defmethod hover-enemy-method-153 hover-enemy ((obj hover-enemy)) - (let* ((v1-0 (-> obj formation-entity)) +(defmethod hover-enemy-method-153 hover-enemy ((this hover-enemy)) + (let* ((v1-0 (-> this formation-entity)) (a0-1 (if v1-0 (-> v1-0 extra process) ) @@ -223,8 +223,8 @@ (none) ) -(defmethod hover-enemy-method-154 hover-enemy ((obj hover-enemy)) - (let* ((v1-0 (-> obj formation-entity)) +(defmethod hover-enemy-method-154 hover-enemy ((this hover-enemy)) + (let* ((v1-0 (-> this formation-entity)) (a0-1 (if v1-0 (-> v1-0 extra process) ) @@ -238,50 +238,50 @@ (none) ) -(defmethod coin-flip? hover-enemy ((obj hover-enemy)) +(defmethod coin-flip? hover-enemy ((this hover-enemy)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod hover-enemy-method-144 hover-enemy ((obj hover-enemy)) - (set! (-> obj main-joint-pos quad) (-> obj root trans quad)) - (set! (-> obj main-joint-vel quad) (the-as uint128 0)) - (set! (-> obj main-joint-acc quad) (the-as uint128 0)) - (set! (-> obj thrust 0) 0.0) - (set! (-> obj thrust 1) 0.0) +(defmethod hover-enemy-method-144 hover-enemy ((this hover-enemy)) + (set! (-> this main-joint-pos quad) (-> this root trans quad)) + (set! (-> this main-joint-vel quad) (the-as uint128 0)) + (set! (-> this main-joint-acc quad) (the-as uint128 0)) + (set! (-> this thrust 0) 0.0) + (set! (-> this thrust 1) 0.0) 0 (none) ) -(defmethod hover-enemy-method-145 hover-enemy ((obj hover-enemy) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod hover-enemy-method-145 hover-enemy ((this hover-enemy) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) (set! v1-1 arg2) (set! v1-1 arg3) ) - (let ((a3-5 (-> obj skel root-channel arg0))) + (let ((a3-5 (-> this skel root-channel arg0))) (let ((f0-2 (fabs arg1))) (set! (-> a3-5 frame-interp 1) f0-2) (set! (-> a3-5 frame-interp 0) f0-2) ) - (set! (-> a3-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data v1-1))) + (set! (-> a3-5 frame-group) (the-as art-joint-anim (-> this draw art-group data v1-1))) (set! (-> a3-5 param 0) 0.0) - (set! (-> a3-5 frame-num) (-> obj skel root-channel 0 frame-num)) - (joint-control-channel-group! a3-5 (the-as art-joint-anim (-> obj draw art-group data v1-1)) num-func-chan) + (set! (-> a3-5 frame-num) (-> this skel root-channel 0 frame-num)) + (joint-control-channel-group! a3-5 (the-as art-joint-anim (-> this draw art-group data v1-1)) num-func-chan) ) (none) ) ;; WARN: Return type mismatch vector vs none. -(defmethod enemy-method-129 hover-enemy ((obj hover-enemy)) +(defmethod enemy-method-129 hover-enemy ((this hover-enemy)) (local-vars (s5-0 vector)) (let ((t9-0 (method-of-type enemy enemy-method-129))) - (t9-0 obj) + (t9-0 this) ) - (let ((a0-3 (handle->process (-> obj focus handle)))) + (let ((a0-3 (handle->process (-> this focus handle)))) (set! s5-0 (when a0-3 - (set! s5-0 (-> obj focus-pos)) + (set! s5-0 (-> this focus-pos)) (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-3) 3) quad)) s5-0 ) @@ -290,35 +290,35 @@ (none) ) -(defmethod track-target! hover-enemy ((obj hover-enemy)) +(defmethod track-target! hover-enemy ((this hover-enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (hover-enemy-method-148 obj) - (enemy-method-129 obj) + (hover-enemy-method-148 this) + (enemy-method-129 this) (let ((t9-2 (method-of-type enemy track-target!))) - (t9-2 obj) + (t9-2 this) ) - (hover-nav-control-method-13 (-> obj hover)) + (hover-nav-control-method-13 (-> this hover)) (none) ) -(defmethod hover-enemy-method-148 hover-enemy ((obj hover-enemy)) +(defmethod hover-enemy-method-148 hover-enemy ((this hover-enemy)) (cond - ((and (-> obj draw shadow) (logtest? (-> obj draw status) (draw-control-status on-screen))) + ((and (-> this draw shadow) (logtest? (-> this draw status) (draw-control-status on-screen))) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'collide-query)) - (gp-0 (-> obj draw shadow-ctrl settings shadow-dir)) + (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 122880.0) ) - (set! (-> s4-0 start-pos quad) (-> obj root trans quad)) + (set! (-> s4-0 start-pos quad) (-> this root trans quad)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-10 s4-0)) (set! (-> v1-10 radius) 2048.0) (set! (-> v1-10 collide-with) (collide-spec backgnd)) - (set! (-> v1-10 ignore-process0) obj) + (set! (-> v1-10 ignore-process0) this) (set! (-> v1-10 ignore-process1) #f) (set! (-> v1-10 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-10 action-mask) (collide-action solid)) @@ -326,16 +326,16 @@ (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) (cond ((>= f0-1 0.0) - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logclear! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 (-> s4-0 best-other-tri intersect) - (let ((a1-3 (-> obj root trans))) + (let ((a1-3 (-> this root trans))) (-> a1-3 y) (let ((f0-2 (* f0-1 f30-0))) (shadow-control-method-14 - (-> obj draw shadow-ctrl) + (-> this draw shadow-ctrl) a1-3 gp-0 (- (+ 81920.0 f30-0)) @@ -346,7 +346,7 @@ ) ) (else - (let ((v1-25 (-> obj draw shadow-ctrl))) + (let ((v1-25 (-> this draw shadow-ctrl))) (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 @@ -356,7 +356,7 @@ ) ) (else - (let ((v1-28 (-> obj draw shadow-ctrl))) + (let ((v1-28 (-> this draw shadow-ctrl))) (logior! (-> v1-28 settings flags) (shadow-flags disable-draw)) ) 0 @@ -502,7 +502,7 @@ ) (hover-enemy-method-144 self) (hover-nav-control-method-18 (-> self hover) (-> self path) -1 -1) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (local-vars (v1-5 enemy-flag)) @@ -632,7 +632,7 @@ ) (if (and (nonzero? (-> self hit-points)) (zero? (-> self fated-time)) - (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) (< (-> self root trans y) (- (-> self knocked-start-level) (-> self knocked-fall-dist))) ) (go-virtual knocked-recover) @@ -690,14 +690,14 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('touch 'touched 'attack) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (go-virtual flying-death-explode) ) ) ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (dispose! self) (stop-looking-at-target! self) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -749,13 +749,13 @@ (set! (-> self hover speed) 0.2) (set! (-> self flying-death-spin) 0.0) (enemy-method-103 self) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (or (logtest? (-> self root status) (collide-status touch-surface touch-wall touch-ceiling touch-actor impact-surface touch-background) ) - (>= (- (current-time) (-> self state-time)) (seconds 4)) + (time-elapsed? (-> self state-time) (seconds 4)) ) (go-virtual flying-death-explode) ) @@ -829,27 +829,27 @@ ) ) -(defmethod go-stare hover-enemy ((obj hover-enemy)) - (go-hostile obj) +(defmethod go-stare hover-enemy ((this hover-enemy)) + (go-hostile this) ) -(defmethod go-stare2 hover-enemy ((obj hover-enemy)) - (go-hostile obj) +(defmethod go-stare2 hover-enemy ((this hover-enemy)) + (go-hostile this) ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod hover-enemy-method-146 hover-enemy ((obj hover-enemy)) +(defmethod hover-enemy-method-146 hover-enemy ((this hover-enemy)) (let ((gp-0 (new 'stack-no-clear 'matrix))) - (matrix-rotate-zxy! gp-0 (-> obj rotation-vec)) - (matrix->quaternion (-> obj root quat) gp-0) + (matrix-rotate-zxy! gp-0 (-> this rotation-vec)) + (matrix->quaternion (-> this root quat) gp-0) ) (none) ) ;; WARN: Return type mismatch float vs none. -(defmethod hover-enemy-method-147 hover-enemy ((obj hover-enemy)) - (let ((s5-0 (-> obj root quat)) - (gp-0 (-> obj rotation-vec)) +(defmethod hover-enemy-method-147 hover-enemy ((this hover-enemy)) + (let ((s5-0 (-> this root quat)) + (gp-0 (-> this rotation-vec)) ) (set! (-> gp-0 z) (quaternion-z-angle s5-0)) (set! (-> gp-0 y) (quaternion-y-angle s5-0)) @@ -858,9 +858,9 @@ (none) ) -(defmethod hover-enemy-method-140 hover-enemy ((obj hover-enemy) (arg0 symbol)) +(defmethod hover-enemy-method-140 hover-enemy ((this hover-enemy) (arg0 symbol)) (let ((v1-0 0) - (a0-2 (-> obj root root-prim)) + (a0-2 (-> this root root-prim)) ) (if arg0 (set! v1-0 1) @@ -874,54 +874,54 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod hover-enemy-method-141 hover-enemy ((obj hover-enemy) (arg0 float)) - (let ((f0-1 (* (-> obj scale) arg0))) - (set-vector! (-> obj root scale) (* 1.2 f0-1) (* 0.9 f0-1) f0-1 1.0) +(defmethod hover-enemy-method-141 hover-enemy ((this hover-enemy) (arg0 float)) + (let ((f0-1 (* (-> this scale) arg0))) + (set-vector! (-> this root scale) (* 1.2 f0-1) (* 0.9 f0-1) f0-1 1.0) ) (none) ) -(defmethod dispose! hover-enemy ((obj hover-enemy)) +(defmethod dispose! hover-enemy ((this hover-enemy)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) - (process-entity-status! obj (entity-perm-status subtask-complete) #t) - (send-event (ppointer->process (-> obj parent)) 'hover-die) - (hover-enemy-method-154 obj) - ((method-of-type enemy dispose!) obj) + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) + (process-entity-status! this (entity-perm-status subtask-complete) #t) + (send-event (ppointer->process (-> this parent)) 'hover-die) + (hover-enemy-method-154 this) + ((method-of-type enemy dispose!) this) ) (none) ) -(defmethod deactivate hover-enemy ((obj hover-enemy)) - (hover-nav-control-method-9 (-> obj hover)) - ((method-of-type enemy deactivate) obj) +(defmethod deactivate hover-enemy ((this hover-enemy)) + (hover-nav-control-method-9 (-> this hover)) + ((method-of-type enemy deactivate) this) (none) ) ;; WARN: Return type mismatch enemy vs hover-enemy. -(defmethod relocate hover-enemy ((obj hover-enemy) (arg0 int)) - (if (nonzero? (-> obj hover)) - (&+! (-> obj hover) arg0) +(defmethod relocate hover-enemy ((this hover-enemy) (arg0 int)) + (if (nonzero? (-> this hover)) + (&+! (-> this hover) arg0) ) - (the-as hover-enemy ((method-of-type enemy relocate) obj arg0)) + (the-as hover-enemy ((method-of-type enemy relocate) this arg0)) ) -(defmethod hover-enemy-method-155 hover-enemy ((obj hover-enemy)) - (set! (-> obj hover-info) (hover-enemy-method-151 obj)) - (set! (-> obj fly-anim-speed) (get-rand-float-range obj 0.8 1.2)) - (vector-reset! (-> obj rotation-vec)) - (vector-reset! (-> obj dest-pos)) - (vector-reset! (-> obj local-dir)) - (set! (-> obj scale) 1.0) - (hover-enemy-method-141 obj 1.0) - (set! (-> obj formation-entity) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (let ((t0-0 (hover-enemy-method-152 obj))) - (set! (-> obj hover) (new 'process 'hover-nav-control obj (-> obj root) t0-0)) +(defmethod hover-enemy-method-155 hover-enemy ((this hover-enemy)) + (set! (-> this hover-info) (hover-enemy-method-151 this)) + (set! (-> this fly-anim-speed) (get-rand-float-range this 0.8 1.2)) + (vector-reset! (-> this rotation-vec)) + (vector-reset! (-> this dest-pos)) + (vector-reset! (-> this local-dir)) + (set! (-> this scale) 1.0) + (hover-enemy-method-141 this 1.0) + (set! (-> this formation-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (let ((t0-0 (hover-enemy-method-152 this))) + (set! (-> this hover) (new 'process 'hover-nav-control this (-> this root) t0-0)) ) - (let ((s5-0 (-> obj offset)) + (let ((s5-0 (-> this offset)) (t9-6 (method-of-type res-lump get-property-struct)) - (a0-8 (-> obj entity)) + (a0-8 (-> this entity)) (a1-4 'trans-offset) (a2-3 'interp) (a3-1 -1000000000.0) @@ -935,8 +935,8 @@ (-> (the-as vector (t9-6 a0-8 a1-4 a2-3 a3-1 t0-1 (the-as (pointer res-tag) #f) *res-static-buf*)) quad) ) ) - (set! (-> obj restart-fly-anims) #t) - (set! (-> obj knocked-fall-dist) 8192.0) + (set! (-> this restart-fly-anims) #t) + (set! (-> this knocked-fall-dist) 8192.0) 0 (none) ) 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 7f42b297c9..962ceda416 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-formation.gc @@ -7,8 +7,8 @@ ;; DECOMP BEGINS -(defmethod is-formation-type-in-range hover-formation-control ((obj hover-formation-control)) - (case (-> obj formation-type) +(defmethod is-formation-type-in-range hover-formation-control ((this hover-formation-control)) + (case (-> this formation-type) (((formation-type unknown-2) (formation-type unknown-3) (formation-type unknown-0)) #f ) @@ -18,11 +18,11 @@ ) ) -(defmethod hover-formation-control-method-16 hover-formation-control ((obj hover-formation-control)) - (let ((gp-0 (hover-formation-control-method-13 obj (new 'stack-no-clear 'vector))) +(defmethod hover-formation-control-method-16 hover-formation-control ((this hover-formation-control)) + (let ((gp-0 (hover-formation-control-method-13 this (new 'stack-no-clear 'vector))) (s4-0 (cond - ((-> obj anchor-proc) - (let ((s3-0 (handle->process (-> obj anchor-proc)))) + ((-> this anchor-proc) + (let ((s3-0 (handle->process (-> this anchor-proc)))) (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) ) @@ -35,25 +35,25 @@ ) ) (and s4-0 - (< (vector-vector-distance gp-0 (get-trans s4-0 0)) (-> obj notice-dist)) - (or (not (logtest? (-> obj flags) 1)) (< (- (-> gp-0 y) (-> (get-trans s4-0 0) y)) 16384.0)) + (< (vector-vector-distance gp-0 (get-trans s4-0 0)) (-> this notice-dist)) + (or (not (logtest? (-> this flags) 1)) (< (- (-> gp-0 y) (-> (get-trans s4-0 0) y)) 16384.0)) ) ) ) -(defmethod set-anchor-proc hover-formation-control ((obj hover-formation-control) (arg0 handle)) - (set! (-> obj anchor-proc) arg0) +(defmethod set-anchor-proc hover-formation-control ((this hover-formation-control) (arg0 handle)) + (set! (-> this anchor-proc) arg0) 0 ) -(defmethod hover-formation-control-method-13 hover-formation-control ((obj hover-formation-control) (arg0 vector)) +(defmethod hover-formation-control-method-13 hover-formation-control ((this hover-formation-control) (arg0 vector)) (with-pp (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) (set! (-> a1-1 message) 'path) (let* ((t9-0 send-event-function) - (v1-2 (-> obj entity)) + (v1-2 (-> this entity)) (s5-0 (the-as path-control (t9-0 (if v1-2 (-> v1-2 extra process) @@ -63,8 +63,8 @@ ) ) (s3-0 (cond - ((-> obj anchor-proc) - (let ((s2-0 (handle->process (-> obj anchor-proc)))) + ((-> this anchor-proc) + (let ((s2-0 (handle->process (-> this anchor-proc)))) (if (type? s2-0 process-focusable) (the-as process-focusable s2-0) ) @@ -78,7 +78,7 @@ ) (cond ((not s3-0) - (set! (-> arg0 quad) (-> obj center quad)) + (set! (-> arg0 quad) (-> this center quad)) ) (s5-0 (let ((f0-0 (get-path-percentage-at-furthest-point s5-0 (get-trans s3-0 3)))) @@ -97,15 +97,15 @@ ) ) -(defmethod hover-formation-control-method-14 hover-formation-control ((obj hover-formation-control)) +(defmethod hover-formation-control-method-14 hover-formation-control ((this hover-formation-control)) (with-pp - (when (not (logtest? (-> obj flags) 4)) + (when (not (logtest? (-> this flags) 4)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'path) (let* ((t9-0 send-event-function) - (v1-5 (-> obj entity)) + (v1-5 (-> this entity)) (s5-0 (the-as path-control (t9-0 (if v1-5 (-> v1-5 extra process) @@ -115,8 +115,8 @@ ) ) (a0-7 (cond - ((-> obj anchor-proc) - (let ((s4-0 (handle->process (-> obj anchor-proc)))) + ((-> this anchor-proc) + (let ((s4-0 (handle->process (-> this anchor-proc)))) (if (type? s4-0 process-focusable) (the-as process-focusable s4-0) ) @@ -136,7 +136,7 @@ (+ 0.1 (get-path-percentage-at-furthest-point s5-0 - (hover-formation-control-method-13 obj (new 'stack-no-clear 'vector)) + (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) ) ) ) @@ -144,26 +144,26 @@ ) (let ((s4-2 (new 'stack-no-clear 'vector))) (displacement-between-points-at-percent-normalized! s5-0 s4-2 f30-1) - (forward-up-nopitch->inv-matrix (-> obj zone-to-world) s4-2 *up-vector*) + (forward-up-nopitch->inv-matrix (-> this zone-to-world) s4-2 *up-vector*) ) - (set! (-> obj zone-to-world trans quad) + (set! (-> this zone-to-world trans quad) (-> (get-point-at-percent-along-path! s5-0 (new 'stack-no-clear 'vector) f30-1 'interp) quad) ) ) - (matrix-inverse-of-rot-trans! (-> obj world-to-zone) (-> obj zone-to-world)) + (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) (a0-7 (let* ((a1-11 - (quaternion-slerp! (-> obj focus-quat) (-> obj focus-quat) (get-quat a0-7 2) (* 0.8 (seconds-per-frame))) + (quaternion-slerp! (-> this focus-quat) (-> this focus-quat) (get-quat a0-7 2) (* 0.8 (seconds-per-frame))) ) (a1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) a1-11)) ) - (forward-up-nopitch->inv-matrix (-> obj zone-to-world) a1-12 *up-vector*) + (forward-up-nopitch->inv-matrix (-> this zone-to-world) a1-12 *up-vector*) ) - (set! (-> obj zone-to-world trans quad) - (-> (hover-formation-control-method-13 obj (new 'stack-no-clear 'vector)) quad) + (set! (-> this zone-to-world trans quad) + (-> (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) quad) ) - (matrix-inverse-of-rot-trans! (-> obj world-to-zone) (-> obj zone-to-world)) + (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) ) ) @@ -174,14 +174,14 @@ ) ) -(defmethod hover-formation-control-method-15 hover-formation-control ((obj hover-formation-control) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-control-method-15 hover-formation-control ((this hover-formation-control) (arg0 vector) (arg1 vector)) (vector-matrix*! arg0 - (hover-formation-control-method-13 obj (new 'stack-no-clear 'vector)) - (-> obj world-to-zone) + (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) + (-> this world-to-zone) ) (vector+! arg0 arg0 arg1) - (vector-matrix*! arg0 arg0 (-> obj zone-to-world)) + (vector-matrix*! arg0 arg0 (-> this zone-to-world)) ) (defun odd? ((arg0 int)) @@ -287,13 +287,13 @@ ) ;; WARN: disable def twice: 148. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod hover-formation-control-method-10 hover-formation-control ((obj hover-formation-control) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod hover-formation-control-method-10 hover-formation-control ((this hover-formation-control) (arg0 vector) (arg1 vector) (arg2 float)) (vector-rotate-y! arg0 arg1 arg2) (cond - ((logtest? (-> obj flags) 2) + ((logtest? (-> this flags) 2) (let ((s2-0 (cond - ((-> obj anchor-proc) - (let ((s4-0 (handle->process (-> obj anchor-proc)))) + ((-> this anchor-proc) + (let ((s4-0 (handle->process (-> this anchor-proc)))) (if (type? s4-0 process-focusable) (the-as process-focusable s4-0) ) @@ -304,12 +304,12 @@ ) ) ) - (s4-1 (hover-formation-control-method-15 obj (new 'stack-no-clear 'vector) arg0)) + (s4-1 (hover-formation-control-method-15 this (new 'stack-no-clear 'vector) arg0)) (s3-0 (new 'stack-no-clear 'vector)) ) (set! (-> s3-0 quad) (-> (if s2-0 (get-trans s2-0 3) - (-> obj center) + (-> this center) ) quad ) @@ -367,9 +367,9 @@ ) ) -(defmethod hover-formation-control-method-11 hover-formation-control ((obj hover-formation-control)) - (let ((s5-0 (-> obj search-info))) - (set! (-> s5-0 form) (the-as uint obj)) +(defmethod hover-formation-control-method-11 hover-formation-control ((this hover-formation-control)) + (let ((s5-0 (-> this search-info))) + (set! (-> s5-0 form) (the-as uint this)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 16))) (dotimes (a0-1 16) (set! (-> v1-0 a0-1 quad) (the-as uint128 0)) @@ -379,7 +379,7 @@ (set! (-> s5-0 best-cost) -1.0) (set! (-> s5-0 count) 0) (dotimes (s4-0 16) - (let* ((s3-0 (handle->process (-> obj actor-table s4-0))) + (let* ((s3-0 (handle->process (-> this actor-table s4-0))) (a0-8 (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) ) @@ -399,23 +399,23 @@ (set! (-> s5-0 index-table s4-0) (the-as uint s4-0)) (set! (-> s5-0 best-mapping s4-0) (the-as uint s4-0)) ) - (let* ((f30-0 (-> obj rotation-inc)) + (let* ((f30-0 (-> this rotation-inc)) (f28-0 f30-0) (s3-2 (+ (the int (/ 65536.0 f30-0)) 1)) (s4-1 0) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (when (hover-formation-control-method-10 obj s2-0 (-> obj offset) 0.0) + (when (hover-formation-control-method-10 this s2-0 (-> this offset) 0.0) (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) (+! s4-1 1) ) (let ((s1-0 0)) (while (not (or (>= s1-0 s3-2) (>= s4-1 (-> s5-0 count)))) - (when (hover-formation-control-method-10 obj s2-0 (-> obj offset) f28-0) + (when (hover-formation-control-method-10 this s2-0 (-> this offset) f28-0) (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) (+! s4-1 1) ) - (when (hover-formation-control-method-10 obj s2-0 (-> obj offset) (- f28-0)) + (when (hover-formation-control-method-10 this s2-0 (-> this offset) (- f28-0)) (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) (+! s4-1 1) ) @@ -427,7 +427,7 @@ (when (> (- (-> s5-0 count) s4-1) 0) (let ((f28-1 0.0)) (dotimes (s3-3 (- (-> s5-0 count) s4-1)) - (vector-rotate-y! (-> s5-0 pos-table s3-3) (-> obj offset) f28-1) + (vector-rotate-y! (-> s5-0 pos-table s3-3) (-> this offset) f28-1) (+! f28-1 (* (the float (+ s3-3 1)) f30-0)) (set! f30-0 (* -1.0 f30-0)) ) @@ -435,7 +435,7 @@ ) ) (dotimes (s4-2 (-> s5-0 count)) - (hover-formation-control-method-15 obj (-> s5-0 dest-pos-table s4-2) (-> s5-0 pos-table s4-2)) + (hover-formation-control-method-15 this (-> s5-0 dest-pos-table s4-2) (-> s5-0 pos-table s4-2)) ) (if (< 1 (-> s5-0 count)) (gen-perms @@ -473,7 +473,7 @@ ) (let ((s4-3 0)) (dotimes (s3-4 16) - (let ((v1-71 (-> obj actor-table s3-4))) + (let ((v1-71 (-> this actor-table s3-4))) (when v1-71 (send-event (handle->process v1-71) 'update-formation (-> s5-0 pos-table (-> s5-0 best-mapping s4-3))) (+! s4-3 1) @@ -485,17 +485,17 @@ 0 ) -(defmethod hover-formation-control-method-17 hover-formation-control ((obj hover-formation-control) (arg0 process)) +(defmethod hover-formation-control-method-17 hover-formation-control ((this hover-formation-control) (arg0 process)) (let ((v1-2 (process->handle arg0)) (a2-0 -1) (a1-4 -1) ) (dotimes (a3-0 16) - (when (= v1-2 (-> obj actor-table a3-0)) + (when (= v1-2 (-> this actor-table a3-0)) (set! a2-0 a3-0) (goto cfg-17) ) - (if (and (not (-> obj actor-table a3-0)) (= a1-4 -1)) + (if (and (not (-> this actor-table a3-0)) (= a1-4 -1)) (set! a1-4 a3-0) ) ) @@ -507,8 +507,8 @@ ) (else (when (!= a1-4 -1) - (set! (-> obj actor-table a1-4) (the-as handle v1-2)) - (hover-formation-control-method-11 obj) + (set! (-> this actor-table a1-4) (the-as handle v1-2)) + (hover-formation-control-method-11 this) ) ) ) @@ -517,12 +517,12 @@ 0 ) -(defmethod hover-formation-control-method-18 hover-formation-control ((obj hover-formation-control) (arg0 process)) +(defmethod hover-formation-control-method-18 hover-formation-control ((this hover-formation-control) (arg0 process)) (let ((v1-2 (process->handle arg0))) (dotimes (a1-4 16) - (when (= v1-2 (-> obj actor-table a1-4)) - (set! (-> obj actor-table a1-4) (the-as handle #f)) - (hover-formation-control-method-11 obj) + (when (= v1-2 (-> this actor-table a1-4)) + (set! (-> this actor-table a1-4) (the-as handle #f)) + (hover-formation-control-method-11 this) #t (goto cfg-12) ) @@ -532,10 +532,10 @@ 0 ) -(defmethod try-update-formation-type hover-formation-control ((obj hover-formation-control) (arg0 formation-type)) - (when (!= (-> obj formation-type) arg0) - (set! (-> obj formation-type) arg0) - (hover-formation-control-method-11 obj) +(defmethod try-update-formation-type hover-formation-control ((this hover-formation-control) (arg0 formation-type)) + (when (!= (-> this formation-type) arg0) + (set! (-> this formation-type) arg0) + (hover-formation-control-method-11 this) ) 0 ) @@ -637,7 +637,7 @@ (set-anchor-proc (-> self formation) (process->handle *target*)) (hover-formation-control-method-14 (-> self formation)) (when (and (logtest? (-> self formation flags) 2) - (>= (- (current-time) (the-as int (-> self formation-timer))) (seconds 0.2)) + (time-elapsed? (the-as int (-> self formation-timer)) (seconds 0.2)) ) (hover-formation-control-method-11 (-> self formation)) (set! (-> self formation-timer) (the-as uint (current-time))) @@ -649,22 +649,25 @@ ) ;; WARN: Return type mismatch basic vs hover-formation. -(defmethod relocate hover-formation ((obj hover-formation) (arg0 int)) - (if (nonzero? (-> obj formation)) - (&+! (-> obj formation) arg0) +(defmethod relocate hover-formation ((this hover-formation) (arg0 int)) + (if (nonzero? (-> this formation)) + (&+! (-> this formation) arg0) ) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - (the-as hover-formation ((the-as (function basic int basic) (find-parent-method hover-formation 7)) obj arg0)) + (the-as + hover-formation + ((the-as (function basic int basic) (find-parent-method hover-formation 7)) this arg0) + ) ) -(defmethod hover-formation-method-15 hover-formation ((obj hover-formation) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-method-15 hover-formation ((this hover-formation) (arg0 vector) (arg1 vector)) 0 ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hover-formation ((obj hover-formation) (arg0 entity-actor)) +(defmethod init-from-entity! hover-formation ((this hover-formation) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -672,22 +675,22 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-32 structure)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (-> obj entity) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let* ((s5-0 (method-of-type hover-formation-control new)) (s4-0 'process) (s3-0 hover-formation-control) - (s2-0 obj) - (v0-1 (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (s2-0 this) + (v0-1 (entity-actor-lookup (-> this entity) 'alt-actor 0)) (s1-0 (if v0-1 v0-1 - (-> obj entity) + (-> this entity) ) ) - (s0-0 (res-lump-float (-> obj entity) 'notice-dist :default 225280.0)) + (s0-0 (res-lump-float (-> this entity) 'notice-dist :default 225280.0)) ) (let ((t9-3 (method-of-type res-lump get-property-struct)) - (a0-5 (-> obj entity)) + (a0-5 (-> this entity)) (a1-4 'trans-offset) (a2-3 'interp) (a3-2 -1000000000.0) @@ -699,22 +702,22 @@ This commonly includes things such as: (set! (-> t0-2 w) 1.0) (set! sv-32 (t9-3 a0-5 a1-4 a2-3 a3-2 t0-2 (the-as (pointer res-tag) #f) *res-static-buf*)) ) - (let ((t2-4 (res-lump-float (-> obj entity) 'rotoffset :default 5461.3335)) + (let ((t2-4 (res-lump-float (-> this entity) 'rotoffset :default 5461.3335)) (t3-0 #f) ) - (set! (-> obj formation) (s5-0 s4-0 s3-0 s2-0 s1-0 s0-0 (the-as vector sv-32) t2-4 (the-as handle t3-0))) + (set! (-> this formation) (s5-0 s4-0 s3-0 s2-0 s1-0 s0-0 (the-as vector sv-32) t2-4 (the-as handle t3-0))) ) ) - (set! (-> obj formation-timer) (the-as uint (current-time))) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this formation-timer) (the-as uint (current-time))) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((t9-6 process-entity-status!) - (a0-9 obj) + (a0-9 this) (a1-7 8) (a2-6 #t) ) (t9-6 a0-9 (the-as entity-perm-status a1-7) a2-6) - (hover-formation-method-15 obj (the-as vector a1-7) (the-as vector a2-6)) + (hover-formation-method-15 this (the-as vector a1-7) (the-as vector a2-6)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc index 799a59c563..84bb4f5adc 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control-h.gc @@ -126,8 +126,8 @@ ) -(defmethod hover-nav-path-segment-method-9 hover-nav-path-segment ((obj hover-nav-path-segment) (arg0 float)) - (set! (-> obj du) (/ arg0 (-> obj dist))) +(defmethod hover-nav-path-segment-method-9 hover-nav-path-segment ((this hover-nav-path-segment) (arg0 float)) + (set! (-> this du) (/ arg0 (-> this dist))) 0 (none) ) @@ -204,8 +204,8 @@ ) -(defmethod get-network nav-network ((obj nav-network)) - (-> obj network) +(defmethod get-network nav-network ((this nav-network)) + (-> this network) ) (deftype hover-nav-params (structure) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc index 2bff8eff8a..7c267ba2de 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-control.gc @@ -59,15 +59,15 @@ ) ) -(defmethod nav-network-method-9 nav-network ((obj nav-network)) - (set! (-> obj segment-pool) (the-as (pointer hover-nav-path-segment) (malloc 'loading-level #x6000))) - (set! (-> obj free-segment-list) #f) +(defmethod nav-network-method-9 nav-network ((this nav-network)) + (set! (-> this segment-pool) (the-as (pointer hover-nav-path-segment) (malloc 'loading-level #x6000))) + (set! (-> this free-segment-list) #f) (dotimes (v1-0 256) - (let ((a0-3 (&+ (-> obj segment-pool) (* 96 v1-0)))) + (let ((a0-3 (&+ (-> this segment-pool) (* 96 v1-0)))) (set! (-> a0-3 0) #f) (set! (-> a0-3 1) #f) - (let ((a2-0 (-> obj free-segment-list)) - (a1-3 (&-> obj free-segment-list)) + (let ((a2-0 (-> this free-segment-list)) + (a1-3 (&-> this free-segment-list)) ) (when (zero? a0-3) (break!) @@ -97,14 +97,14 @@ ) ) ) - (set! (-> obj sphere-pool) (the-as (pointer hover-nav-sphere) (malloc 'loading-level 768))) - (set! (-> obj free-sphere-list) #f) + (set! (-> this sphere-pool) (the-as (pointer hover-nav-sphere) (malloc 'loading-level 768))) + (set! (-> this free-sphere-list) #f) (dotimes (v1-3 16) - (let ((a0-6 (&+ (-> obj sphere-pool) (* 48 v1-3)))) + (let ((a0-6 (&+ (-> this sphere-pool) (* 48 v1-3)))) (set! (-> a0-6 0) #f) (set! (-> a0-6 1) #f) - (let ((a2-4 (-> obj free-sphere-list)) - (a1-7 (&-> obj free-sphere-list)) + (let ((a2-4 (-> this free-sphere-list)) + (a1-7 (&-> this free-sphere-list)) ) (when (zero? a0-6) (break!) @@ -138,12 +138,12 @@ (none) ) -(defmethod nav-network-method-10 nav-network ((obj nav-network) (arg0 level) (arg1 (array nav-network-info))) - (set! (-> obj network) arg1) - (while (-> obj sphere-list) - (let ((v1-0 (-> obj sphere-list))) +(defmethod nav-network-method-10 nav-network ((this nav-network) (arg0 level) (arg1 (array nav-network-info))) + (set! (-> this network) arg1) + (while (-> this sphere-list) + (let ((v1-0 (-> this sphere-list))) (let ((a0-1 v1-0)) - (let ((a1-1 (&-> obj sphere-list))) + (let ((a1-1 (&-> this sphere-list))) (if (= (-> a1-1 0) a0-1) (set! (-> a1-1 0) (the-as hover-nav-sphere (-> a0-1 next))) ) @@ -157,8 +157,8 @@ (set! (-> a0-1 prev) #f) (set! (-> a0-1 next) #f) ) - (let ((a1-8 (-> obj free-sphere-list)) - (a0-3 (&-> obj free-sphere-list)) + (let ((a1-8 (-> this free-sphere-list)) + (a0-3 (&-> this free-sphere-list)) ) (when (zero? v1-0) (break!) @@ -188,19 +188,19 @@ ) ) ) - (if (not (handle->process (-> obj control-handle))) - (set! (-> obj control-handle) - (process->handle (ppointer->process (process-spawn nav-network-control obj arg0))) + (if (not (handle->process (-> this control-handle))) + (set! (-> this control-handle) + (process->handle (ppointer->process (process-spawn nav-network-control this arg0))) ) ) 0 (none) ) -(defmethod nav-network-method-12 nav-network ((obj nav-network)) - (set! (-> obj open-list) #f) - (set! (-> obj closed-list) #f) - (let ((v1-0 (-> obj network))) +(defmethod nav-network-method-12 nav-network ((this nav-network)) + (set! (-> this open-list) #f) + (set! (-> this closed-list) #f) + (let ((v1-0 (-> this network))) (when v1-0 (dotimes (a0-2 (-> v1-0 length)) (let ((a1-3 (-> v1-0 a0-2 path-node))) @@ -216,10 +216,10 @@ (none) ) -(defmethod nav-network-method-28 nav-network ((obj nav-network)) +(defmethod nav-network-method-28 nav-network ((this nav-network)) (dotimes (s5-0 2) (format #t "list ~d: ~%" s5-0) - (let ((a0-2 (-> obj list-table s5-0))) + (let ((a0-2 (-> this list-table s5-0))) (while a0-2 (let ((s4-0 (-> a0-2 next))) (inspect a0-2) @@ -232,9 +232,9 @@ (none) ) -(defmethod nav-network-method-29 nav-network ((obj nav-network)) +(defmethod nav-network-method-29 nav-network ((this nav-network)) (when *display-nav-network* - (let ((gp-0 (-> obj network))) + (let ((gp-0 (-> this network))) (when gp-0 (dotimes (s5-0 (-> gp-0 length)) (let ((s4-0 (-> gp-0 s5-0))) @@ -268,7 +268,7 @@ ) ) -(defmethod nav-network-method-15 nav-network ((obj nav-network) (arg0 nav-network-path-node)) +(defmethod nav-network-method-15 nav-network ((this nav-network) (arg0 nav-network-path-node)) (local-vars (a2-4 list-node)) (when (nonzero? (-> arg0 status)) (break!) @@ -279,7 +279,7 @@ (break!) 0 ) - (let ((v1-8 (the-as list-node (-> obj open-list)))) + (let ((v1-8 (the-as list-node (-> this open-list)))) (while v1-8 (let ((a2-1 (-> v1-8 next))) (if (= v1-8 arg0) @@ -294,7 +294,7 @@ 0 ) (logior! (-> arg0 status) (net-path-node-status open)) - (let ((v1-17 (the-as list-node (-> obj open-list)))) + (let ((v1-17 (the-as list-node (-> this open-list)))) (while v1-17 (let ((a2-3 (-> v1-17 next))) (when (< f0-1 (+ (-> (the-as nav-network-path-node v1-17) cost-to-start) @@ -314,7 +314,7 @@ (cond (a2-4 (let ((v1-20 arg0) - (a0-1 (-> obj list-table)) + (a0-1 (-> this list-table)) ) (when (zero? v1-20) (break!) @@ -345,7 +345,7 @@ ) (else (let ((a2-8 (the-as list-node #f))) - (let ((v1-21 (the-as list-node (-> obj open-list)))) + (let ((v1-21 (the-as list-node (-> this open-list)))) (while v1-21 (let ((a3-22 (-> v1-21 next))) (set! a2-8 v1-21) @@ -354,7 +354,7 @@ ) ) (let ((v1-23 arg0) - (a0-2 (-> obj list-table)) + (a0-2 (-> this list-table)) ) (when (or (= v1-23 a2-8) (= v1-23 a0-2)) (break!) @@ -392,14 +392,14 @@ ) ;; WARN: Return type mismatch nav-network-path-node vs none. -(defmethod nav-network-method-13 nav-network ((obj nav-network) (arg0 int) (arg1 nav-network-path-node)) +(defmethod nav-network-method-13 nav-network ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) (when (nonzero? (-> arg1 status)) (break!) 0 ) (let ((v1-3 arg1) - (a3-2 (-> obj list-table arg0)) - (a0-2 (the-as object (&+ (-> obj list-table) (* arg0 4)))) + (a3-2 (-> this list-table arg0)) + (a0-2 (the-as object (&+ (-> this list-table) (* arg0 4)))) ) (when (zero? v1-3) (break!) @@ -430,9 +430,9 @@ (none) ) -(defmethod nav-network-method-14 nav-network ((obj nav-network) (arg0 int) (arg1 nav-network-path-node)) +(defmethod nav-network-method-14 nav-network ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) (let ((v1-0 arg1)) - (let ((a3-1 (the-as list-node (&+ (-> obj list-table) (* arg0 4))))) + (let ((a3-1 (the-as list-node (&+ (-> this list-table) (* arg0 4))))) (if (= (-> a3-1 next) v1-0) (set! (-> a3-1 next) (-> v1-0 next)) ) @@ -446,7 +446,7 @@ (set! (-> v1-0 prev) #f) (set! (-> v1-0 next) #f) ) - (let ((v1-4 (-> obj list-table arg0))) + (let ((v1-4 (-> this list-table arg0))) (while v1-4 (let ((a0-2 (-> v1-4 next))) (if (= v1-4 arg1) @@ -469,15 +469,15 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-network-method-16 nav-network ((obj nav-network) (arg0 nav-network-path-node)) - (nav-network-method-14 obj 0 arg0) +(defmethod nav-network-method-16 nav-network ((this nav-network) (arg0 nav-network-path-node)) + (nav-network-method-14 this 0 arg0) (none) ) -(defmethod nav-network-method-17 nav-network ((obj nav-network)) - (let ((gp-0 (-> obj open-list))) +(defmethod nav-network-method-17 nav-network ((this nav-network)) + (let ((gp-0 (-> this open-list))) (if gp-0 - (nav-network-method-16 obj gp-0) + (nav-network-method-16 this gp-0) (set! gp-0 (the-as nav-network-path-node #f)) ) gp-0 @@ -485,20 +485,20 @@ ) ;; WARN: Return type mismatch net-path-node-status vs none. -(defmethod nav-network-method-18 nav-network ((obj nav-network) (arg0 nav-network-path-node)) - (nav-network-method-13 obj 1 arg0) +(defmethod nav-network-method-18 nav-network ((this nav-network) (arg0 nav-network-path-node)) + (nav-network-method-13 this 1 arg0) (logior! (-> arg0 status) (net-path-node-status closed)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod nav-network-method-19 nav-network ((obj nav-network) (arg0 nav-network-path-node)) - (nav-network-method-14 obj 1 arg0) +(defmethod nav-network-method-19 nav-network ((this nav-network) (arg0 nav-network-path-node)) + (nav-network-method-14 this 1 arg0) (none) ) -(defmethod nav-network-method-20 nav-network ((obj nav-network) (arg0 nav-network-path-node) (arg1 vector)) - (let* ((s3-0 (-> obj network)) +(defmethod nav-network-method-20 nav-network ((this nav-network) (arg0 nav-network-path-node) (arg1 vector)) + (let* ((s3-0 (-> this network)) (s2-0 (-> s3-0 (-> arg0 row-index))) ) (dotimes (s1-0 (-> s2-0 count)) @@ -517,33 +517,33 @@ (set! (-> s0-0 cost-to-end) (vector-vector-distance (-> v1-8 pos) arg1)) (cond ((logtest? (-> s0-0 status) (net-path-node-status open)) - (nav-network-method-16 obj s0-0) - (nav-network-method-15 obj s0-0) + (nav-network-method-16 this s0-0) + (nav-network-method-15 this s0-0) ) ((logtest? (-> s0-0 status) (net-path-node-status closed)) - (nav-network-method-19 obj s0-0) - (nav-network-method-15 obj s0-0) + (nav-network-method-19 this s0-0) + (nav-network-method-15 this s0-0) ) (else - (nav-network-method-15 obj s0-0) + (nav-network-method-15 this s0-0) ) ) ) ) ) ) - (nav-network-method-18 obj arg0) + (nav-network-method-18 this arg0) 0 (none) ) -(defmethod nav-network-method-22 nav-network ((obj nav-network) (arg0 hover-nav-path-info) (arg1 vector) (arg2 vector) (arg3 int) (arg4 int)) - (-> obj network) - (let ((gp-0 (-> obj free-segment-list))) +(defmethod nav-network-method-22 nav-network ((this nav-network) (arg0 hover-nav-path-info) (arg1 vector) (arg2 vector) (arg3 int) (arg4 int)) + (-> this network) + (let ((gp-0 (-> this free-segment-list))) (cond ((and gp-0 (nonzero? gp-0)) (let ((v1-2 gp-0)) - (let ((a0-1 (&-> obj free-segment-list))) + (let ((a0-1 (&-> this free-segment-list))) (if (= (-> a0-1 0) v1-2) (set! (-> a0-1 0) (the-as hover-nav-path-segment (-> v1-2 next))) ) @@ -608,14 +608,14 @@ ) ;; WARN: Return type mismatch hover-nav-path-segment vs none. -(defmethod nav-network-method-21 nav-network ((obj nav-network) (arg0 object) (arg1 int) (arg2 int)) - (let ((t0-0 (-> obj network))) - (nav-network-method-22 obj (the-as hover-nav-path-info arg0) (-> t0-0 arg1 pos) (-> t0-0 arg2 pos) arg1 arg2) +(defmethod nav-network-method-21 nav-network ((this nav-network) (arg0 object) (arg1 int) (arg2 int)) + (let ((t0-0 (-> this network))) + (nav-network-method-22 this (the-as hover-nav-path-info arg0) (-> t0-0 arg1 pos) (-> t0-0 arg2 pos) arg1 arg2) ) (none) ) -(defmethod nav-network-method-23 nav-network ((obj nav-network) (arg0 hover-nav-path-info)) +(defmethod nav-network-method-23 nav-network ((this nav-network) (arg0 hover-nav-path-info)) (while (-> arg0 segment-list) (let ((v1-0 (-> arg0 segment-list))) (let ((a2-0 v1-0)) @@ -633,8 +633,8 @@ (set! (-> a2-0 prev) #f) (set! (-> a2-0 next) #f) ) - (let ((a3-7 (-> obj free-segment-list)) - (a2-2 (&-> obj free-segment-list)) + (let ((a3-7 (-> this free-segment-list)) + (a2-2 (&-> this free-segment-list)) ) (when (zero? v1-0) (break!) @@ -671,20 +671,20 @@ ) ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-network-method-24 nav-network ((obj nav-network) (arg0 hover-nav-path-info) (arg1 int) (arg2 int) (arg3 int)) +(defmethod nav-network-method-24 nav-network ((this nav-network) (arg0 hover-nav-path-info) (arg1 int) (arg2 int) (arg3 int)) (local-vars (s3-1 nav-network-path-node)) - (nav-network-method-12 obj) - (let ((s4-0 (-> obj network))) + (nav-network-method-12 this) + (let ((s4-0 (-> this network))) (let ((s2-0 (-> s4-0 arg1 path-node))) (set! (-> s2-0 row-index) arg1) (set! (-> s2-0 status) (net-path-node-status)) (set! (-> s2-0 parent) #f) (set! (-> s2-0 cost-to-start) 0.0) (set! (-> s2-0 cost-to-end) (vector-vector-distance (-> s4-0 arg1 pos) (-> s4-0 arg2 pos))) - (nav-network-method-15 obj s2-0) + (nav-network-method-15 this s2-0) ) (until #f - (let ((a1-3 (nav-network-method-17 obj))) + (let ((a1-3 (nav-network-method-17 this))) (when (not a1-3) (set! s3-1 (the-as nav-network-path-node #f)) (goto cfg-9) @@ -693,27 +693,27 @@ (set! s3-1 a1-3) (goto cfg-9) ) - (nav-network-method-20 obj a1-3 (-> s4-0 arg2 pos)) + (nav-network-method-20 this a1-3 (-> s4-0 arg2 pos)) ) ) #f - (set! s3-1 (nav-network-method-17 obj)) + (set! s3-1 (nav-network-method-17 this)) (label cfg-9) (while (and s3-1 (-> s3-1 parent)) (if *debug-hover* (add-debug-sphere #t (bucket-id debug-no-zbuf1) (-> s4-0 (-> s3-1 row-index) pos) (meters 0.5) *color-blue*) ) - (nav-network-method-21 obj arg0 (-> s3-1 parent row-index) (-> s3-1 row-index)) + (nav-network-method-21 this arg0 (-> s3-1 parent row-index) (-> s3-1 row-index)) (set! s3-1 (-> s3-1 parent)) ) ) #t ) -(defmethod nav-network-method-25 nav-network ((obj nav-network) (arg0 process) (arg1 collide-prim-core)) +(defmethod nav-network-method-25 nav-network ((this nav-network) (arg0 process) (arg1 collide-prim-core)) (local-vars (a3-2 hover-nav-sphere)) (let ((a1-4 (process->handle arg0))) - (let ((v1-2 (-> obj sphere-list))) + (let ((v1-2 (-> this sphere-list))) (while v1-2 (let ((a3-1 (-> v1-2 next))) (when (= (-> v1-2 handle) a1-4) @@ -727,10 +727,10 @@ (set! a3-2 (the-as hover-nav-sphere #f)) (label cfg-12) (when (not a3-2) - (let ((v1-6 (-> obj free-sphere-list))) + (let ((v1-6 (-> this free-sphere-list))) (when v1-6 (let ((a3-3 v1-6)) - (let ((t0-3 (&-> obj free-sphere-list))) + (let ((t0-3 (&-> this free-sphere-list))) (if (= (-> t0-3 0) a3-3) (set! (-> t0-3 0) (the-as hover-nav-sphere (-> a3-3 next))) ) @@ -746,8 +746,8 @@ ) (set! (-> v1-6 handle) (the-as handle a1-4)) (let ((a1-5 v1-6) - (a3-5 (-> obj sphere-list)) - (a0-1 (&-> obj sphere-list)) + (a3-5 (-> this sphere-list)) + (a0-1 (&-> this sphere-list)) ) (when (zero? a1-5) (break!) @@ -791,13 +791,13 @@ (none) ) -(defmethod nav-network-method-26 nav-network ((obj nav-network) (arg0 vector) (arg1 process) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-network-method-26 nav-network ((this nav-network) (arg0 vector) (arg1 process) (arg2 vector) (arg3 vector) (arg4 float)) (local-vars (sv-48 vector) (sv-64 sphere)) (vector-reset! arg0) (let ((s1-0 (process->handle arg1)) (s2-0 0) ) - (let ((v1-3 (the-as list-node (-> obj sphere-list)))) + (let ((v1-3 (the-as list-node (-> this sphere-list)))) (while v1-3 (let ((s0-0 (-> v1-3 next))) (when (!= (-> (the-as hover-nav-sphere v1-3) handle) s1-0) @@ -822,9 +822,9 @@ ) ) -(defmethod nav-network-method-27 nav-network ((obj nav-network)) +(defmethod nav-network-method-27 nav-network ((this nav-network)) (with-pp - (let ((v1-0 (the-as list-node (-> obj sphere-list)))) + (let ((v1-0 (the-as list-node (-> this sphere-list)))) (while v1-0 (let ((a0-2 (-> v1-0 next))) (set! (-> (the-as hover-nav-sphere v1-0) timer) @@ -832,7 +832,7 @@ ) (when (<= (-> (the-as hover-nav-sphere v1-0) timer) 0) (let ((a1-4 v1-0)) - (let ((a2-3 (&-> obj sphere-list))) + (let ((a2-3 (&-> this sphere-list))) (if (= (-> a2-3 0) a1-4) (set! (-> a2-3 0) (the-as hover-nav-sphere (-> a1-4 next))) ) @@ -846,8 +846,8 @@ (set! (-> a1-4 prev) #f) (set! (-> a1-4 next) #f) ) - (let ((a2-10 (-> obj free-sphere-list)) - (a1-6 (&-> obj free-sphere-list)) + (let ((a2-10 (-> this free-sphere-list)) + (a1-6 (&-> this free-sphere-list)) ) (when (zero? v1-0) (break!) @@ -880,7 +880,7 @@ ) ) ) - (let ((v1-2 (the-as list-node (-> obj sphere-list)))) + (let ((v1-2 (the-as list-node (-> this sphere-list)))) (while v1-2 (let ((s5-0 (-> v1-2 next))) (let* ((s3-0 (handle->process (-> (the-as hover-nav-sphere v1-2) handle))) @@ -896,7 +896,7 @@ (set! (-> a1-9 message) 'get-hover-nav-sphere) (let ((a2-14 (send-event-function s4-0 a1-9))) (if a2-14 - (nav-network-method-25 obj s4-0 (the-as collide-prim-core a2-14)) + (nav-network-method-25 this s4-0 (the-as collide-prim-core a2-14)) ) ) ) @@ -911,28 +911,28 @@ ) ) -(defmethod nav-network-method-31 nav-network ((obj nav-network) (arg0 bounding-box)) - (set-to-point! arg0 (-> obj network 0 pos)) - (let* ((s4-0 (-> obj network length)) +(defmethod nav-network-method-31 nav-network ((this nav-network) (arg0 bounding-box)) + (set-to-point! arg0 (-> this network 0 pos)) + (let* ((s4-0 (-> this network length)) (s3-0 0) - (v1-7 (-> obj network s3-0)) + (v1-7 (-> this network s3-0)) ) (while (< s3-0 s4-0) (add-point! arg0 (-> v1-7 pos)) (+! s3-0 1) - (set! v1-7 (-> obj network s3-0)) + (set! v1-7 (-> this network s3-0)) ) ) 0 (none) ) -(defmethod nav-network-method-32 nav-network ((obj nav-network) (arg0 string)) +(defmethod nav-network-method-32 nav-network ((this nav-network) (arg0 string)) (let ((gp-0 (new 'stack-no-clear 'bounding-box)) (s5-0 (entity-by-name arg0)) ) (when s5-0 - (nav-network-method-31 obj gp-0) + (nav-network-method-31 this gp-0) (vector-! (-> gp-0 min) (-> gp-0 min) (-> s5-0 extra trans)) (vector-! (-> gp-0 max) (-> gp-0 max) (-> s5-0 extra trans)) (format #t "~S ~m " (res-lump-struct s5-0 'name structure) (-> s5-0 extra vis-dist)) @@ -954,7 +954,7 @@ (define *nav-network* (the-as nav-network 0)) -(defmethod hover-nav-control-method-26 hover-nav-control ((obj hover-nav-control) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod hover-nav-control-method-26 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) (set! (-> gp-0 start-pos quad) (-> arg0 quad)) @@ -974,8 +974,8 @@ ) ) -(defmethod hover-nav-control-method-27 hover-nav-control ((obj hover-nav-control) (arg0 vector) (arg1 vector)) - (let ((s2-0 (-> obj nav network)) +(defmethod hover-nav-control-method-27 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector)) + (let ((s2-0 (-> this nav network)) (gp-0 (the-as int #f)) ) (let ((f30-0 0.0)) @@ -987,7 +987,7 @@ (if (< (vector-dot (vector-float*! (new 'stack-no-clear 'vector) v1-5 (/ 1.0 f28-0)) arg1) 0.0) (set! f28-0 (* 1.25 f28-0)) ) - (when (and (< f28-0 204800.0) (hover-nav-control-method-26 obj arg0 (-> s2-0 s1-0 pos) 0.0)) + (when (and (< f28-0 204800.0) (hover-nav-control-method-26 this arg0 (-> s2-0 s1-0 pos) 0.0)) (when (or (not gp-0) (< f28-0 f30-0)) (set! gp-0 s1-0) (set! f30-0 f28-0) @@ -1000,33 +1000,33 @@ ) ) -(defmethod hover-nav-control-method-22 hover-nav-control ((obj hover-nav-control)) - (-> obj path-info curr-segment) +(defmethod hover-nav-control-method-22 hover-nav-control ((this hover-nav-control)) + (-> this path-info curr-segment) ) -(defmethod hover-nav-control-method-23 hover-nav-control ((obj hover-nav-control)) - (and (-> obj path-info curr-segment) (>= (-> obj path-info curr-u) 1.0)) +(defmethod hover-nav-control-method-23 hover-nav-control ((this hover-nav-control)) + (and (-> this path-info curr-segment) (>= (-> this path-info curr-u) 1.0)) ) -(defmethod hover-nav-control-method-21 hover-nav-control ((obj hover-nav-control)) - (nav-network-method-23 (-> obj nav) (-> obj path-info)) - (set! (-> obj curr-dest-pt) -1) +(defmethod hover-nav-control-method-21 hover-nav-control ((this hover-nav-control)) + (nav-network-method-23 (-> this nav) (-> this path-info)) + (set! (-> this curr-dest-pt) -1) 0 (none) ) -(defmethod hover-nav-control-method-28 hover-nav-control ((obj hover-nav-control) (arg0 vector) (arg1 vector)) +(defmethod hover-nav-control-method-28 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector)) (local-vars (v0-15 symbol) (sv-32 int) (sv-48 (function hover-nav-control vector vector int))) - (let ((s4-0 (-> obj nav network)) - (s5-0 (-> obj path-info)) + (let ((s4-0 (-> this nav network)) + (s5-0 (-> this path-info)) (s1-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 arg1) 1.0)) ) - (set! sv-32 (hover-nav-control-method-27 obj arg1 s1-0)) + (set! sv-32 (hover-nav-control-method-27 this arg1 s1-0)) (set! v0-15 (cond (sv-32 - (when (or (!= sv-32 (-> obj curr-dest-pt)) (not (-> obj path-info segment-list))) - (let ((s0-0 obj)) + (when (or (!= sv-32 (-> this curr-dest-pt)) (not (-> this path-info segment-list))) + (let ((s0-0 this)) (set! sv-48 (method-of-object s0-0 hover-nav-control-method-27)) (let* ((a2-2 (vector-negate! s1-0 s1-0)) (s2-1 (sv-48 s0-0 arg0 a2-2)) @@ -1037,11 +1037,11 @@ (if *debug-hover* (add-debug-sphere #t (bucket-id debug-no-zbuf1) (-> s4-0 sv-32 pos) (meters 1) *color-dark-blue*) ) - (nav-network-method-22 (-> obj nav) s5-0 (-> s4-0 sv-32 pos) arg1 -1 -1) + (nav-network-method-22 (-> this nav) s5-0 (-> s4-0 sv-32 pos) arg1 -1 -1) (nav-network-method-22 - (-> obj nav) + (-> this nav) s5-0 - (the-as vector (hover-nav-control-method-17 obj)) + (the-as vector (hover-nav-control-method-17 this)) (-> s4-0 s2-1 pos) -1 -1 @@ -1052,7 +1052,7 @@ (add-debug-sphere #t (bucket-id debug-no-zbuf1) (-> s4-0 s2-1 pos) (meters 1) *color-green*) (add-debug-sphere #t (bucket-id debug-no-zbuf1) (-> s4-0 sv-32 pos) (meters 1) *color-cyan*) ) - (let* ((a0-14 (-> obj nav)) + (let* ((a0-14 (-> this nav)) (t9-10 (method-of-object a0-14 nav-network-method-22)) (a1-11 s5-0) (a2-8 (-> s4-0 sv-32 pos)) @@ -1060,22 +1060,22 @@ (t0-5 -1) ) (t9-10 a0-14 a1-11 a2-8 a3-5 t0-5 -1) - (nav-network-method-24 (-> obj nav) s5-0 s2-1 sv-32 t0-5) + (nav-network-method-24 (-> this nav) s5-0 s2-1 sv-32 t0-5) ) (nav-network-method-22 - (-> obj nav) + (-> this nav) s5-0 - (the-as vector (hover-nav-control-method-17 obj)) + (the-as vector (hover-nav-control-method-17 this)) (-> s4-0 s2-1 pos) -1 -1 ) ) ) - (hover-nav-control-method-29 obj (-> obj root transv)) + (hover-nav-control-method-29 this (-> this root transv)) (set! (-> s5-0 curr-segment) (-> s5-0 segment-list)) (set! (-> s5-0 curr-u) (/ 16384.0 (-> s5-0 curr-segment dist))) - (set! (-> obj curr-dest-pt) sv-32) + (set! (-> this curr-dest-pt) sv-32) ) ) ) @@ -1094,9 +1094,9 @@ (none) ) -(defmethod hover-nav-control-method-29 hover-nav-control ((obj hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-29 hover-nav-control ((this hover-nav-control) (arg0 vector)) (let ((a0-1 (the-as list-node #f)) - (s4-0 (the-as list-node (-> obj path-info segment-list))) + (s4-0 (the-as list-node (-> this path-info segment-list))) ) (while s4-0 (cond @@ -1115,7 +1115,7 @@ (-> (the-as hover-nav-path-segment s4-0) curve-matrix vector 1) (the-as vector (-> (the-as hover-nav-path-segment s4-0) curve-matrix)) ) - (hover-nav-control-method-30 obj) + (hover-nav-control-method-30 this) ) ) ) @@ -1146,23 +1146,23 @@ (none) ) -(defmethod hover-nav-control-method-30 hover-nav-control ((obj hover-nav-control)) - (* (-> obj max-speed-multiplier) (-> obj params max-speed)) +(defmethod hover-nav-control-method-30 hover-nav-control ((this hover-nav-control)) + (* (-> this max-speed-multiplier) (-> this params max-speed)) ) -(defmethod hover-nav-control-method-31 hover-nav-control ((obj hover-nav-control)) - (* (-> obj max-acceleration-multiplier) (-> obj params max-acceleration)) +(defmethod hover-nav-control-method-31 hover-nav-control ((this hover-nav-control)) + (* (-> this max-acceleration-multiplier) (-> this params max-acceleration)) ) -(defmethod hover-nav-control-method-14 hover-nav-control ((obj hover-nav-control) (arg0 float) (arg1 float)) - (set! (-> obj max-speed-multiplier) arg0) - (set! (-> obj max-acceleration-multiplier) arg1) +(defmethod hover-nav-control-method-14 hover-nav-control ((this hover-nav-control) (arg0 float) (arg1 float)) + (set! (-> this max-speed-multiplier) arg0) + (set! (-> this max-acceleration-multiplier) arg1) 0 (none) ) -(defmethod hover-nav-control-method-18 hover-nav-control ((obj hover-nav-control) (arg0 path-control) (arg1 int) (arg2 int)) - (hover-nav-control-method-21 obj) +(defmethod hover-nav-control-method-18 hover-nav-control ((this hover-nav-control) (arg0 path-control) (arg1 int) (arg2 int)) + (hover-nav-control-method-21 this) (set! arg2 (cond ((= arg2 -1) (+ (-> arg0 curve num-cverts) -2) @@ -1182,93 +1182,93 @@ (a3-3 (get-point-in-path! arg0 (new 'stack-no-clear 'vector) (the float (+ arg2 1)) 'interp)) ) (hover-nav-path-segment-method-9 - (nav-network-method-22 (-> obj nav) (-> obj path-info) s2-0 a3-3 -1 -1) - (hover-nav-control-method-30 obj) + (nav-network-method-22 (-> this nav) (-> this path-info) s2-0 a3-3 -1 -1) + (hover-nav-control-method-30 this) ) ) (+! arg2 -1) ) - (hover-nav-control-method-29 obj (the-as vector #f)) - (set! (-> obj path-info curr-segment) (-> obj path-info segment-list)) - (logior! (-> obj flags) (hover-nav-flags honflags-0)) + (hover-nav-control-method-29 this (the-as vector #f)) + (set! (-> this path-info curr-segment) (-> this path-info segment-list)) + (logior! (-> this flags) (hover-nav-flags honflags-0)) 0 (none) ) -(defmethod hover-nav-control-method-19 hover-nav-control ((obj hover-nav-control) (arg0 (inline-array vector)) (arg1 int)) - (hover-nav-control-method-21 obj) +(defmethod hover-nav-control-method-19 hover-nav-control ((this hover-nav-control) (arg0 (inline-array vector)) (arg1 int)) + (hover-nav-control-method-21 this) (let ((s4-1 (+ arg1 -2))) (while (>= s4-1 0) (hover-nav-path-segment-method-9 - (nav-network-method-22 (-> obj nav) (-> obj path-info) (-> arg0 s4-1) (-> arg0 (+ s4-1 1)) -1 -1) - (hover-nav-control-method-30 obj) + (nav-network-method-22 (-> this nav) (-> this path-info) (-> arg0 s4-1) (-> arg0 (+ s4-1 1)) -1 -1) + (hover-nav-control-method-30 this) ) (+! s4-1 -1) ) ) - (hover-nav-control-method-29 obj (the-as vector #f)) - (set! (-> obj path-info curr-segment) (-> obj path-info segment-list)) - (logior! (-> obj flags) (hover-nav-flags honflags-0)) + (hover-nav-control-method-29 this (the-as vector #f)) + (set! (-> this path-info curr-segment) (-> this path-info segment-list)) + (logior! (-> this flags) (hover-nav-flags honflags-0)) 0 (none) ) -(defmethod hover-nav-control-method-20 hover-nav-control ((obj hover-nav-control)) - (hover-nav-control-method-21 obj) - (logclear! (-> obj flags) (hover-nav-flags honflags-0)) +(defmethod hover-nav-control-method-20 hover-nav-control ((this hover-nav-control)) + (hover-nav-control-method-21 this) + (logclear! (-> this flags) (hover-nav-flags honflags-0)) 0 (none) ) -(defmethod hover-nav-control-method-17 hover-nav-control ((obj hover-nav-control)) - (-> (the-as collide-shape-prim-group (-> obj root root-prim)) +(defmethod hover-nav-control-method-17 hover-nav-control ((this hover-nav-control)) + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child - (-> obj params nav-collide-prim-index) + (-> this params nav-collide-prim-index) prim-core ) ) ;; WARN: Return type mismatch vector vs none. -(defmethod hover-nav-control-method-15 hover-nav-control ((obj hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-15 hover-nav-control ((this hover-nav-control) (arg0 vector)) (local-vars (sv-32 vector) (sv-36 collide-shape-moving)) (set! sv-32 (new 'stack-no-clear 'vector)) - (set! sv-36 (-> obj root)) + (set! sv-36 (-> this root)) (vector-inv-orient-by-quat! sv-32 (-> sv-36 transv) (-> sv-36 quat)) - (vector-float*! arg0 sv-32 (/ 1.0 (hover-nav-control-method-30 obj))) + (vector-float*! arg0 sv-32 (/ 1.0 (hover-nav-control-method-30 this))) (none) ) -(defmethod hover-nav-control-method-16 hover-nav-control ((obj hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-16 hover-nav-control ((this hover-nav-control) (arg0 vector)) (local-vars (sv-32 vector)) (set! sv-32 (new 'stack-no-clear 'vector)) - (vector-inv-orient-by-quat! sv-32 (-> obj transvv) (-> obj root quat)) - (vector-float*! arg0 sv-32 (/ 1.0 (hover-nav-control-method-31 obj))) + (vector-inv-orient-by-quat! sv-32 (-> this transvv) (-> this root quat)) + (vector-float*! arg0 sv-32 (/ 1.0 (hover-nav-control-method-31 this))) ) -(defmethod hover-nav-control-method-10 hover-nav-control ((obj hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) - (set! (-> obj dest-pos quad) (-> arg0 quad)) +(defmethod hover-nav-control-method-10 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) + (set! (-> this dest-pos quad) (-> arg0 quad)) (cond ;; og:preserve-this condition has been changed from `arg2` because some places call this method with #t as arg2 ((and (!= arg2 #t) arg2) ;arg2 - (set! (-> obj dest-vel quad) (-> arg2 quad)) - (set! (-> obj root transv quad) (-> arg2 quad)) + (set! (-> this dest-vel quad) (-> arg2 quad)) + (set! (-> this root transv quad) (-> arg2 quad)) ) (else - (set! (-> obj dest-vel quad) (the-as uint128 0)) - (set! (-> obj root transv quad) (the-as uint128 0)) + (set! (-> this dest-vel quad) (the-as uint128 0)) + (set! (-> this root transv quad) (the-as uint128 0)) ) ) - (vector-normalize-copy! (-> obj dest-move-dir) arg1 1.0) + (vector-normalize-copy! (-> this dest-move-dir) arg1 1.0) 0 (none) ) -(defmethod hover-nav-control-method-24 hover-nav-control ((obj hover-nav-control)) - (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) +(defmethod hover-nav-control-method-24 hover-nav-control ((this hover-nav-control)) + (when (not (logtest? (-> this flags) (hover-nav-flags honflags-0))) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (-> obj params) - (let ((v1-5 (hover-nav-control-method-17 obj)) - (s4-0 (-> obj root transv)) + (-> this params) + (let ((v1-5 (hover-nav-control-method-17 this)) + (s4-0 (-> this root transv)) ) (when (< 0.0 (vector-length s4-0)) (set! (-> s5-0 start-pos quad) (-> v1-5 world-sphere quad)) @@ -1280,21 +1280,21 @@ ) (let ((a0-14 s5-0)) (set! (-> a0-14 radius) (-> v1-5 world-sphere w)) - (set! (-> a0-14 collide-with) (-> obj root root-prim prim-core collide-with)) - (set! (-> a0-14 ignore-process0) (-> obj root process)) + (set! (-> a0-14 collide-with) (-> this root root-prim prim-core collide-with)) + (set! (-> a0-14 ignore-process0) (-> this root process)) (set! (-> a0-14 ignore-process1) #f) - (set! (-> a0-14 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> a0-14 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> a0-14 action-mask) (collide-action solid)) ) (let ((f0-4 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) (cond ((>= f0-4 0.0) - (set! (-> obj los-obstruction-distance) (* f0-4 (vector-length s4-0))) - (logior! (-> obj flags) (hover-nav-flags honflags-1)) + (set! (-> this los-obstruction-distance) (* f0-4 (vector-length s4-0))) + (logior! (-> this flags) (hover-nav-flags honflags-1)) ) (else - (set! (-> obj los-last-clear-time) (current-time)) - (logclear! (-> obj flags) (hover-nav-flags honflags-1)) + (set! (-> this los-last-clear-time) (current-time)) + (logclear! (-> this flags) (hover-nav-flags honflags-1)) ) ) ) @@ -1306,44 +1306,44 @@ (none) ) -(defmethod hover-nav-control-method-11 hover-nav-control ((obj hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-11 hover-nav-control ((this hover-nav-control) (arg0 vector)) (local-vars (sv-288 vector) (sv-304 vector) (sv-320 vector) (sv-336 vector) (sv-352 int)) (with-pp (when *debug-hover* (if arg0 (add-debug-sphere #t (bucket-id debug2) arg0 (meters 0.9) *color-yellow*) ) - (if (!= (-> obj curr-dest-pt) -1) + (if (!= (-> this curr-dest-pt) -1) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj nav network (-> obj curr-dest-pt) pos) + (-> this nav network (-> this curr-dest-pt) pos) (meters 0.4) *color-blue* ) ) ) - (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) + (when (not (logtest? (-> this flags) (hover-nav-flags honflags-0))) (cond - ((and arg0 (and (< (vector-vector-distance arg0 (-> obj root trans)) 40960.0) - (>= (-> obj los-last-clear-time) (+ (current-time) (seconds -0.2))) + ((and arg0 (and (< (vector-vector-distance arg0 (-> this root trans)) 40960.0) + (>= (-> this los-last-clear-time) (+ (current-time) (seconds -0.2))) ) ) - (if (not (and (-> obj path-info curr-segment) (< (-> obj path-info curr-u) 1.0))) - (hover-nav-control-method-21 obj) + (if (not (and (-> this path-info curr-segment) (< (-> this path-info curr-u) 1.0))) + (hover-nav-control-method-21 this) ) ) - ((or (>= (- (current-time) (-> obj los-last-clear-time)) (seconds 1)) (not (-> obj path-info curr-segment))) - (hover-nav-control-method-21 obj) + ((or (>= (- (current-time) (-> this los-last-clear-time)) (seconds 1)) (not (-> this path-info curr-segment))) + (hover-nav-control-method-21 this) (when arg0 (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj root transv quad)) - (if (>= (- (current-time) (-> obj los-last-clear-time)) (seconds 1)) - (vector-normalize! s4-0 (fmin (vector-length s4-0) (-> obj los-obstruction-distance))) + (set! (-> s4-0 quad) (-> this root transv quad)) + (if (>= (- (current-time) (-> this los-last-clear-time)) (seconds 1)) + (vector-normalize! s4-0 (fmin (vector-length s4-0) (-> this los-obstruction-distance))) ) (hover-nav-control-method-28 - obj - (vector+! (new 'stack-no-clear 'vector) (the-as vector (hover-nav-control-method-17 obj)) s4-0) + this + (vector+! (new 'stack-no-clear 'vector) (the-as vector (hover-nav-control-method-17 this)) s4-0) arg0 ) ) @@ -1352,7 +1352,7 @@ ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (let* ((s3-1 (-> obj path-info)) + (let* ((s3-1 (-> this path-info)) (s2-1 (-> s3-1 curr-segment)) ) (cond @@ -1412,9 +1412,9 @@ (if *debug-hover* (add-debug-sphere #t (bucket-id debug-no-zbuf1) s4-1 (meters 0.8) *color-magenta*) ) - (let ((f0-19 (+ 2048.0 (vector-length (-> obj root transv))))) - (if (logtest? (-> obj flags) (hover-nav-flags honflags-1)) - (set! f0-19 (fmin f0-19 (fmax 8192.0 (-> obj los-obstruction-distance)))) + (let ((f0-19 (+ 2048.0 (vector-length (-> this root transv))))) + (if (logtest? (-> this flags) (hover-nav-flags honflags-1)) + (set! f0-19 (fmin f0-19 (fmax 8192.0 (-> this los-obstruction-distance)))) ) (hover-nav-path-segment-method-9 s2-1 f0-19) ) @@ -1422,44 +1422,44 @@ (when (and (>= (-> s3-1 curr-u) 1.0) (-> s2-1 next)) (set! (-> s3-1 curr-segment) (the-as hover-nav-path-segment (-> s2-1 next))) (set! (-> s3-1 curr-u) 0.0) - (hover-nav-path-segment-method-9 (-> s3-1 curr-segment) (hover-nav-control-method-30 obj)) + (hover-nav-path-segment-method-9 (-> s3-1 curr-segment) (hover-nav-control-method-30 this)) ) ) (arg0 (set! (-> s4-1 quad) (-> arg0 quad)) ) (else - (set! (-> s4-1 quad) (-> (hover-nav-control-method-17 obj) world-sphere quad)) + (set! (-> s4-1 quad) (-> (hover-nav-control-method-17 this) world-sphere quad)) ) ) ) - (let ((v1-94 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> obj dest-pos)))) - (set! (-> obj dest-pos quad) (-> s4-1 quad)) - (vector-float*! (-> obj dest-vel) v1-94 (-> pp clock frames-per-second)) + (let ((v1-94 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this dest-pos)))) + (set! (-> this dest-pos quad) (-> s4-1 quad)) + (vector-float*! (-> this dest-vel) v1-94 (-> pp clock frames-per-second)) ) ) - (if (< 0.0 (vector-length (-> obj dest-vel))) - (vector-normalize-copy! (-> obj dest-move-dir) (-> obj dest-vel) 1.0) + (if (< 0.0 (vector-length (-> this dest-vel))) + (vector-normalize-copy! (-> this dest-move-dir) (-> this dest-vel) 1.0) ) 0 (none) ) ) -(defmethod hover-nav-control-method-25 hover-nav-control ((obj hover-nav-control)) +(defmethod hover-nav-control-method-25 hover-nav-control ((this hover-nav-control)) (let ((s5-0 (new 'stack-no-clear 'hover-nav-path-segment)) - (f28-0 (hover-nav-control-method-31 obj)) - (f30-0 (hover-nav-control-method-30 obj)) - (s3-0 (-> obj root transv)) + (f28-0 (hover-nav-control-method-31 this)) + (f30-0 (hover-nav-control-method-30 this)) + (s3-0 (-> this root transv)) ) - (-> obj transvv) - (let ((s4-0 (-> obj dest-offset))) + (-> this transvv) + (let ((s4-0 (-> this dest-offset))) (vector-normalize-copy! (-> s5-0 curve-matrix vector 2) s3-0 1.0) (vector-normalize-copy! (-> s5-0 curve-matrix trans) s4-0 1.0) (set! (-> s5-0 pos-index 0) (vector-dot s3-0 (-> s5-0 curve-matrix trans))) (set! (-> s5-0 pos-index 1) (/ (* 0.5 (-> s5-0 pos-index 0) (-> s5-0 pos-index 0)) (* 0.2 f28-0))) - (set! (-> s5-0 dist) (vector-dot (-> obj dest-vel) (-> s5-0 curve-matrix trans))) - (vector-normalize-copy! (-> s5-0 curve-matrix vector 1) s4-0 (-> obj target-speed)) + (set! (-> s5-0 dist) (vector-dot (-> this dest-vel) (-> s5-0 curve-matrix trans))) + (vector-normalize-copy! (-> s5-0 curve-matrix vector 1) s4-0 (-> this target-speed)) (vector-! (the-as vector (-> s5-0 curve-matrix)) (-> s5-0 curve-matrix vector 1) s3-0) (let ((f0-9 (vector-length (the-as vector (-> s5-0 curve-matrix))))) (if (< f28-0 f0-9) @@ -1468,13 +1468,13 @@ ) (vector+float*! (the-as vector (&-> s5-0 next)) - (-> obj root transv) + (-> this root transv) (the-as vector (-> s5-0 curve-matrix)) (seconds-per-frame) ) (let ((f0-12 (vector-length (the-as vector (&-> s5-0 next)))) - (f1-6 (if (logtest? (-> obj flags) (hover-nav-flags honflags-1)) - (fmax 8192.0 (* 0.8 (-> obj los-obstruction-distance))) + (f1-6 (if (logtest? (-> this flags) (hover-nav-flags honflags-1)) + (fmax 8192.0 (* 0.8 (-> this los-obstruction-distance))) f30-0 ) ) @@ -1483,22 +1483,22 @@ (vector-float*! (the-as vector (&-> s5-0 next)) (the-as vector (&-> s5-0 next)) (/ f1-6 f0-12)) ) ) - (set! (-> obj root transv quad) (-> (the-as vector (&-> s5-0 next)) quad)) - (set! (-> obj transvv quad) (-> s5-0 curve-matrix quad 0)) + (set! (-> this root transv quad) (-> (the-as vector (&-> s5-0 next)) quad)) + (set! (-> this transvv quad) (-> s5-0 curve-matrix quad 0)) (when *debug-hover* - (format *stdcon* " speed act: ~m target: ~m~%" (-> s5-0 pos-index 0) (-> obj target-speed)) + (format *stdcon* " speed act: ~m target: ~m~%" (-> s5-0 pos-index 0) (-> this target-speed)) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj root trans) - (-> obj root transv) + (-> this root trans) + (-> this root transv) (meters 0.00024414062) *color-yellow* ) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj root trans) + (-> this root trans) (-> s5-0 curve-matrix vector 1) (meters 0.00024414062) *color-cyan* @@ -1506,15 +1506,15 @@ (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj root trans) - (-> obj transvv) + (-> this root trans) + (-> this transvv) (meters 0.00024414062) *color-blue* ) (add-debug-x #t (bucket-id debug-no-zbuf1) - (vector+! (new 'stack-no-clear 'vector) (-> obj root trans) s4-0) + (vector+! (new 'stack-no-clear 'vector) (-> this root trans) s4-0) *color-green* ) ) @@ -1524,20 +1524,20 @@ (none) ) -(defmethod hover-nav-control-method-12 hover-nav-control ((obj hover-nav-control)) +(defmethod hover-nav-control-method-12 hover-nav-control ((this hover-nav-control)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (hover-nav-control-method-25 obj) - (hover-nav-control-method-24 obj) - (let ((v1-5 (-> obj root transv)) - (a0-4 (-> obj root transv)) + (hover-nav-control-method-25 this) + (hover-nav-control-method-24 this) + (let ((v1-5 (-> this root transv)) + (a0-4 (-> this root transv)) (a1-0 (new 'stack-no-clear 'vector)) ) - (.lvf vf1 (&-> (-> obj nav-collide-impulse) quad)) + (.lvf vf1 (&-> (-> this nav-collide-impulse) quad)) (let ((f0-0 (seconds-per-frame))) (.mov at-0 f0-0) ) @@ -1547,7 +1547,7 @@ (.svf (&-> a1-0 quad) vf1) (vector+! v1-5 a0-4 a1-0) ) - (let ((v1-7 (-> obj root)) + (let ((v1-7 (-> this root)) (a2-2 (new 'stack-no-clear 'collide-query)) ) (set! (-> a2-2 collide-with) (-> v1-7 root-prim prim-core collide-with)) @@ -1558,9 +1558,9 @@ (fill-cache-integrate-and-collide v1-7 (-> v1-7 transv) a2-2 (meters 0)) ) (vector-float*! - (-> obj root transv) - (-> obj root transv) - (- 1.0 (* (-> obj params friction) (seconds-per-frame))) + (-> this root transv) + (-> this root transv) + (- 1.0 (* (-> this params friction) (seconds-per-frame))) ) 0 (none) @@ -1576,29 +1576,29 @@ ;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 144 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 -(defmethod hover-nav-control-method-13 hover-nav-control ((obj hover-nav-control)) +(defmethod hover-nav-control-method-13 hover-nav-control ((this hover-nav-control)) (local-vars (sv-112 float) (sv-128 float) (sv-144 float) (sv-160 float)) - (let* ((s5-0 (-> obj root)) - (s3-0 (hover-nav-control-method-17 obj)) + (let* ((s5-0 (-> this root)) + (s3-0 (hover-nav-control-method-17 this)) (v1-2 (vector-! (new 'stack-no-clear 'vector) (the-as vector s3-0) (-> s5-0 trans))) - (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> obj dest-pos) v1-2)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this dest-pos) v1-2)) ) - (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) - (let* ((s2-0 (-> obj root transv)) + (when (not (logtest? (-> this flags) (hover-nav-flags honflags-0))) + (let* ((s2-0 (-> this root transv)) (f30-0 (vector-length s2-0)) (s1-0 lerp-scale) (s0-0 0.0) ) - (set! sv-112 (hover-nav-control-method-30 obj)) + (set! sv-112 (hover-nav-control-method-30 this)) (set! sv-128 (* 2.0 f30-0)) (set! sv-144 (the-as float 0.0)) - (let* ((t0-0 (hover-nav-control-method-30 obj)) + (let* ((t0-0 (hover-nav-control-method-30 this)) (f0-4 (s1-0 s0-0 sv-112 sv-128 sv-144 t0-0)) (t0-2 (vector+float*! (new 'stack-no-clear 'vector) (the-as vector s3-0) s2-0 (/ f0-4 f30-0))) (s2-1 (nav-network-method-26 - (-> obj nav) + (-> this nav) (new 'stack-no-clear 'vector) - (-> obj root process) + (-> this root process) (the-as vector s3-0) t0-2 (-> s3-0 world-sphere w) @@ -1607,14 +1607,14 @@ ) (let ((f0-7 (vector-length s2-1)) (s1-1 seek) - (s0-1 (-> obj nav-collide-impulse-len)) + (s0-1 (-> this nav-collide-impulse-len)) ) (set! sv-160 f0-7) - (let ((a2-2 (* (hover-nav-control-method-31 obj) (seconds-per-frame)))) - (set! (-> obj nav-collide-impulse-len) (s1-1 s0-1 sv-160 a2-2)) + (let ((a2-2 (* (hover-nav-control-method-31 this) (seconds-per-frame)))) + (set! (-> this nav-collide-impulse-len) (s1-1 s0-1 sv-160 a2-2)) ) ) - (vector-normalize-copy! (-> obj nav-collide-impulse) s2-1 (- (-> obj nav-collide-impulse-len))) + (vector-normalize-copy! (-> this nav-collide-impulse) s2-1 (- (-> this nav-collide-impulse-len))) ) ) (if *debug-hover* @@ -1622,39 +1622,39 @@ #t (bucket-id debug-no-zbuf1) (the-as vector s3-0) - (-> obj nav-collide-impulse) + (-> this nav-collide-impulse) (meters 0.00024414062) *color-red* ) ) ) - (let ((f30-1 (hover-nav-control-method-31 obj)) - (f28-0 (hover-nav-control-method-30 obj)) + (let ((f30-1 (hover-nav-control-method-31 this)) + (f28-0 (hover-nav-control-method-30 this)) ) - (vector-z-quaternion! (-> obj move-dir) (-> s5-0 quat)) - (set! (-> obj speed) (vector-length (-> s5-0 transv))) - (vector-! (-> obj dest-offset) s4-1 (-> s5-0 trans)) - (let ((s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj dest-offset) 1.0)) + (vector-z-quaternion! (-> this move-dir) (-> s5-0 quat)) + (set! (-> this speed) (vector-length (-> s5-0 transv))) + (vector-! (-> this dest-offset) s4-1 (-> s5-0 trans)) + (let ((s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this dest-offset) 1.0)) (v0-13 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 transv) 1.0)) ) - (set! (-> obj speed-dest) (vector-dot (-> s5-0 transv) s4-2)) - (set! (-> obj local-dist) (vector-dot v0-13 (-> obj dest-offset))) + (set! (-> this speed-dest) (vector-dot (-> s5-0 transv) s4-2)) + (set! (-> this local-dist) (vector-dot v0-13 (-> this dest-offset))) ) - (let* ((f0-20 (fmax 0.0 (+ -2048.0 (vector-length (-> obj dest-offset))))) + (let* ((f0-20 (fmax 0.0 (+ -2048.0 (vector-length (-> this dest-offset))))) (f1-5 (sqrtf (* 1.6 f0-20 f30-1))) (f0-23 0.0) ) - (seek! (-> obj target-speed) (fmax (fmin f1-5 f28-0) f0-23) (* 0.9 (seconds-per-frame) f30-1)) + (seek! (-> this target-speed) (fmax (fmin f1-5 f28-0) f0-23) (* 0.9 (seconds-per-frame) f30-1)) ) ) ) (when *debug-hover* - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj dest-pos) *color-white*) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this dest-pos) *color-white*) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj dest-pos) - (-> obj dest-vel) + (-> this dest-pos) + (-> this dest-vel) (meters 0.00024414062) *color-white* ) @@ -1672,17 +1672,17 @@ (-> arg0 status) ) -(defmethod hover-nav-control-method-9 hover-nav-control ((obj hover-nav-control)) - (hover-nav-control-method-21 obj) +(defmethod hover-nav-control-method-9 hover-nav-control ((this hover-nav-control)) + (hover-nav-control-method-21 this) 0 (none) ) -(defmethod relocate hover-nav-control ((obj hover-nav-control) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate hover-nav-control ((this hover-nav-control) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - obj + this ) (defmethod new hover-nav-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 collide-shape-moving) (arg2 hover-nav-params)) diff --git a/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc b/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc index 5e88a94df6..805c75ffcf 100644 --- a/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc +++ b/goal_src/jak2/levels/common/enemy/hover/hover-nav-edit.gc @@ -261,11 +261,11 @@ ) -(defmethod hover-nav-bsp-node-method-9 hover-nav-bsp-node ((obj hover-nav-bsp-node)) - (let ((v1-0 (-> obj split-plane))) +(defmethod hover-nav-bsp-node-method-9 hover-nav-bsp-node ((this hover-nav-bsp-node)) + (let ((v1-0 (-> this split-plane))) (format #t "((~,,1f ~,,1f ~,,1f ~m)~% " (-> v1-0 x) (-> v1-0 y) (-> v1-0 z) (-> v1-0 w)) ) - (let ((v1-2 (the-as list-node (-> obj point-list)))) + (let ((v1-2 (the-as list-node (-> this point-list)))) (while v1-2 (let ((s5-0 (-> v1-2 next))) (format @@ -280,24 +280,24 @@ ) ) ) - (if (-> obj left) - (hover-nav-bsp-node-method-9 (-> obj left)) + (if (-> this left) + (hover-nav-bsp-node-method-9 (-> this left)) ) - (if (-> obj right) - (hover-nav-bsp-node-method-9 (-> obj right)) + (if (-> this right) + (hover-nav-bsp-node-method-9 (-> this right)) ) (format #t ")~%") 0 (none) ) -(defmethod hover-nav-bsp-node-method-10 hover-nav-bsp-node ((obj hover-nav-bsp-node) (arg0 int)) - (when (-> obj point-list) +(defmethod hover-nav-bsp-node-method-10 hover-nav-bsp-node ((this hover-nav-bsp-node) (arg0 int)) + (when (-> this point-list) (format 0 "build-bsp: ") (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 0) ) - (let ((v1-2 (the-as list-node (-> obj point-list)))) + (let ((v1-2 (the-as list-node (-> this point-list)))) (while v1-2 (set! v1-2 (-> v1-2 next)) (+! s3-0 1) @@ -307,7 +307,7 @@ (when (< 1 s3-0) (vector-reset! s4-0) (let ((f0-1 (/ 1.0 (the float s3-0))) - (a2-1 (the-as list-node (-> obj point-list))) + (a2-1 (the-as list-node (-> this point-list))) ) (while a2-1 (let ((v1-9 (-> a2-1 next))) @@ -316,21 +316,21 @@ ) ) ) - (set! (-> obj split-plane quad) (-> *axes-table* arg0 quad)) - (set! (-> obj split-plane w) (- (vector-dot s4-0 (-> obj split-plane)))) - (let ((s3-1 (the-as list-node (-> obj point-list)))) + (set! (-> this split-plane quad) (-> *axes-table* arg0 quad)) + (set! (-> this split-plane w) (- (vector-dot s4-0 (-> this split-plane)))) + (let ((s3-1 (the-as list-node (-> this point-list)))) (while s3-1 (let ((s4-1 (-> s3-1 next))) - (let ((f0-7 (- (vector-dot (the-as vector (+ (the-as uint s3-1) 16)) (-> obj split-plane))))) + (let ((f0-7 (- (vector-dot (the-as vector (+ (the-as uint s3-1) 16)) (-> this split-plane))))) (cond - ((= f0-7 (-> obj split-plane w)) + ((= f0-7 (-> this split-plane w)) ) - ((< f0-7 (-> obj split-plane w)) - (if (not (-> obj left)) - (set! (-> obj left) (new 'global 'hover-nav-bsp-node)) + ((< f0-7 (-> this split-plane w)) + (if (not (-> this left)) + (set! (-> this left) (new 'global 'hover-nav-bsp-node)) ) (let ((v1-21 s3-1)) - (let ((a0-12 (&-> obj point-list))) + (let ((a0-12 (&-> this point-list))) (if (= (-> a0-12 0) v1-21) (set! (-> a0-12 0) (the-as hover-nav-bsp-point (-> v1-21 next))) ) @@ -344,8 +344,8 @@ (set! (-> v1-21 prev) #f) (set! (-> v1-21 next) #f) ) - (let ((a0-19 (-> obj left point-list)) - (v1-25 (&-> (-> obj left) point-list)) + (let ((a0-19 (-> this left point-list)) + (v1-25 (&-> (-> this left) point-list)) ) (when (zero? s3-1) (break!) @@ -375,11 +375,11 @@ ) ) (else - (if (not (-> obj right)) - (set! (-> obj right) (new 'global 'hover-nav-bsp-node)) + (if (not (-> this right)) + (set! (-> this right) (new 'global 'hover-nav-bsp-node)) ) (let ((v1-30 s3-1)) - (let ((a0-22 (&-> obj point-list))) + (let ((a0-22 (&-> this point-list))) (if (= (-> a0-22 0) v1-30) (set! (-> a0-22 0) (the-as hover-nav-bsp-point (-> v1-30 next))) ) @@ -394,8 +394,8 @@ (set! (-> v1-30 next) #f) ) (let ((v1-32 s3-1) - (a1-40 (-> obj right point-list)) - (a0-31 (&-> (-> obj right) point-list)) + (a1-40 (-> this right point-list)) + (a0-31 (&-> (-> this right) point-list)) ) (when (zero? v1-32) (break!) @@ -430,11 +430,11 @@ ) ) ) - (if (-> obj left) - (hover-nav-bsp-node-method-10 (-> obj left) (mod (+ arg0 1) 3)) + (if (-> this left) + (hover-nav-bsp-node-method-10 (-> this left) (mod (+ arg0 1) 3)) ) - (if (-> obj right) - (hover-nav-bsp-node-method-10 (-> obj right) (mod (+ arg0 1) 3)) + (if (-> this right) + (hover-nav-bsp-node-method-10 (-> this right) (mod (+ arg0 1) 3)) ) ) ) diff --git a/goal_src/jak2/levels/common/enemy/hover/wasp.gc b/goal_src/jak2/levels/common/enemy/hover/wasp.gc index ebc9482a92..402c0ad344 100644 --- a/goal_src/jak2/levels/common/enemy/hover/wasp.gc +++ b/goal_src/jak2/levels/common/enemy/hover/wasp.gc @@ -304,7 +304,7 @@ ) -(defmethod play-impact-sound wasp-shot ((obj wasp-shot) (arg0 projectile-options)) +(defmethod play-impact-sound wasp-shot ((this wasp-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -319,13 +319,13 @@ (none) ) -(defmethod init-proj-settings! wasp-shot ((obj wasp-shot)) +(defmethod init-proj-settings! wasp-shot ((this wasp-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'wasp-shot) - (set! (-> obj max-speed) 491520.0) - (set! (-> obj move) metalhead-shot-move) - (set! (-> obj timeout) (seconds 1.375)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'wasp-shot) + (set! (-> this max-speed) 491520.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this timeout) (seconds 1.375)) 0 (none) ) @@ -440,59 +440,59 @@ (set! (-> *wasp-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler wasp ((obj wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler wasp ((this wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (if (zero? (-> obj hit-points)) - (go (method-of-object obj die-explode)) - (go (method-of-object obj knocked)) + (if (zero? (-> this hit-points)) + (go (method-of-object this die-explode)) + (go (method-of-object this knocked)) ) ) (else - ((method-of-type hover-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hover-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 wasp ((obj wasp) (arg0 vector)) - (let ((s4-0 (-> obj root))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-52 wasp ((this wasp) (arg0 vector)) + (let ((s4-0 (-> this root))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-2)) - (let ((gp-1 (-> obj root transv))) - (let ((a1-1 (handle->process (-> obj incoming attacker-handle)))) + (let ((gp-1 (-> this root transv))) + (let ((a1-1 (handle->process (-> this incoming attacker-handle)))) (if a1-1 - (vector-! gp-1 (-> (the-as process-focusable a1-1) root trans) (-> obj root trans)) - (vector-! gp-1 (-> obj incoming attacker-pos) (-> obj root trans)) + (vector-! gp-1 (-> (the-as process-focusable a1-1) root trans) (-> this root trans)) + (vector-! gp-1 (-> this incoming attacker-pos) (-> this root trans)) ) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) (vector-rotate90-around-y! gp-1 gp-1) (if (< 0.0 (vector-dot - (vector-! (new 'stack-no-clear 'vector) (-> obj incoming attacker-pos) (-> s4-0 trans)) + (vector-! (new 'stack-no-clear 'vector) (-> this incoming attacker-pos) (-> s4-0 trans)) (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat)) ) ) (vector-negate! gp-1 gp-1) ) - (let ((f30-1 (get-rand-float-range obj 0.0 1.0)) - (s5-1 (-> obj enemy-info)) + (let ((f30-1 (get-rand-float-range this 0.0 1.0)) + (s5-1 (-> this enemy-info)) ) (vector-float*! gp-1 gp-1 (lerp (-> s5-1 knocked-hard-vxz-lo) (-> s5-1 knocked-hard-vxz-hi) f30-1)) (set! (-> gp-1 y) (lerp (-> s5-1 knocked-hard-vy-lo) (-> s5-1 knocked-hard-vy-hi) f30-1)) @@ -500,7 +500,7 @@ ) ) (else - ((the-as (function enemy vector none) (find-parent-method wasp 52)) obj arg0) + ((the-as (function enemy vector none) (find-parent-method wasp 52)) this arg0) ) ) ) @@ -508,46 +508,46 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle wasp ((obj wasp)) +(defmethod go-idle wasp ((this wasp)) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user0)) - (go (method-of-object obj shoot-bridge-wait)) + ((logtest? (-> this fact enemy-options) (enemy-option user0)) + (go (method-of-object this shoot-bridge-wait)) ) - ((logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go (method-of-object obj ambush)) + ((logtest? (enemy-option ambush) (-> this fact enemy-options)) + (go (method-of-object this ambush)) ) (else - (go (method-of-object obj notice)) + (go (method-of-object this notice)) ) ) (none) ) -(defmethod go-hostile wasp ((obj wasp)) - (go (method-of-object obj hostile)) +(defmethod go-hostile wasp ((this wasp)) + (go (method-of-object this hostile)) ) -(defmethod react-to-focus wasp ((obj wasp)) +(defmethod react-to-focus wasp ((this wasp)) "@TODO - flesh out docs" - (go-hostile obj) + (go-hostile this) ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-129 wasp ((obj wasp)) - (if (logtest? (-> obj fact enemy-options) (enemy-option user0)) - (set! (-> obj focus-pos quad) (-> obj plat-pos quad)) - ((method-of-type hover-enemy enemy-method-129) obj) +(defmethod enemy-method-129 wasp ((this wasp)) + (if (logtest? (-> this fact enemy-options) (enemy-option user0)) + (set! (-> this focus-pos quad) (-> this plat-pos quad)) + ((method-of-type hover-enemy enemy-method-129) this) ) (none) ) -(defmethod track-target! wasp ((obj wasp)) +(defmethod track-target! wasp ((this wasp)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (seek! (-> obj gun-x-angle) (-> obj gun-x-angle-final) (* 21845.334 (seconds-per-frame))) - ((method-of-type hover-enemy track-target!) obj) + (seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame))) + ((method-of-type hover-enemy track-target!) this) (none) ) @@ -618,7 +618,7 @@ ) (hover-enemy-method-146 self) (hover-nav-control-method-18 (-> self hover) (-> self path) -1 6) - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (set! (-> self bridge-index) 0) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water)) (logclear! (-> self mask) (process-mask collectable)) @@ -753,7 +753,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) ) :code (behavior () @@ -767,7 +767,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (set! (-> self restart-fly-anims) #t) (go-virtual shoot-bridge-hostile) ) @@ -820,7 +820,7 @@ (the-as vector #t) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (when (< (vector-vector-distance @@ -859,9 +859,10 @@ ) ) ) - (if (and (>= (- (current-time) (-> self last-fire-time)) - (the int (* 300.0 (rand-vu-float-range (-> self attack-wait-min) (-> self attack-wait-max)))) - ) + (if (and (time-elapsed? + (-> self last-fire-time) + (the int (* 300.0 (rand-vu-float-range (-> self attack-wait-min) (-> self attack-wait-max)))) + ) (get-enemy-target self) ) (go-virtual attack) @@ -901,7 +902,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) ) :code (behavior () @@ -915,7 +916,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (set! (-> self restart-fly-anims) #t) (go-hostile self) ) @@ -1057,7 +1058,7 @@ (set! (-> self hit-points) 0) (do-effect (-> self skel effect) 'death-default 0.0 -1) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1068,15 +1069,15 @@ ) ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target wasp ((obj wasp)) +(defmethod get-enemy-target wasp ((this wasp)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" - (let ((s5-0 (handle->process (-> obj focus handle)))) + (let ((s5-0 (handle->process (-> this focus handle)))) (the-as process-focusable (when s5-0 - (let* ((a0-4 (-> obj root)) + (let* ((a0-4 (-> this root)) (s4-1 (vector+! (new 'stack-no-clear 'vector) (-> a0-4 trans) (-> a0-4 transv))) - (s3-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> obj focus-pos))) + (s3-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this focus-pos))) (s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s5-0) 0))) (s3-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-1 1.0)) ) @@ -1084,8 +1085,8 @@ (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status disable dead ignore grabbed))) ) (< 0.0 (vector-dot s2-1 s3-2)) - (< (vector-vector-distance s4-1 (-> obj focus-pos)) 225280.0) - (and (< (fabs (vector-x-angle s3-2)) 3640.889) (enemy-method-95 obj (-> obj focus-pos) 5461.3335)) + (< (vector-vector-distance s4-1 (-> this focus-pos)) 225280.0) + (and (< (fabs (vector-x-angle s3-2)) 3640.889) (enemy-method-95 this (-> this focus-pos) 5461.3335)) ) s5-0 ) @@ -1095,20 +1096,20 @@ ) ) -(defmethod enemy-method-77 wasp ((obj wasp) (arg0 (pointer float))) +(defmethod enemy-method-77 wasp ((this wasp) (arg0 (pointer float))) (cond - ((rng-hit? obj 0.5) - (set! (-> obj knocked-anim) 10) - (set! (-> obj knocked-recover-anim) 11) + ((rng-hit? this 0.5) + (set! (-> this knocked-anim) 10) + (set! (-> this knocked-recover-anim) 11) ) (else - (set! (-> obj knocked-anim) 12) - (set! (-> obj knocked-recover-anim) 13) + (set! (-> this knocked-anim) 12) + (set! (-> this knocked-recover-anim) 13) ) ) (ja-channel-push! 1 0) - (let ((a1-3 (-> obj draw art-group data (-> obj knocked-anim))) - (a0-5 (-> obj skel root-channel 0)) + (let ((a1-3 (-> this draw art-group data (-> this knocked-anim))) + (a0-5 (-> this skel root-channel 0)) ) (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-3)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) @@ -1119,9 +1120,9 @@ #t ) -(defmethod enemy-method-78 wasp ((obj wasp) (arg0 (pointer float))) - (let ((v1-4 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-3 (-> obj skel root-channel 0)) +(defmethod enemy-method-78 wasp ((this wasp) (arg0 (pointer float))) + (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-3 (-> this skel root-channel 0)) ) (set! (-> a0-3 frame-group) (the-as art-joint-anim v1-4)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-4) frames num-frames) -1))) @@ -1132,37 +1133,37 @@ #t ) -(defmethod enemy-method-80 wasp ((obj wasp) (arg0 enemy-knocked-info)) - (-> obj root) +(defmethod enemy-method-80 wasp ((this wasp) (arg0 enemy-knocked-info)) + (-> this root) (>= (-> arg0 on-surface-count) 1) ) -(defmethod enemy-method-81 wasp ((obj wasp)) +(defmethod enemy-method-81 wasp ((this wasp)) #f ) -(defmethod kill-prefer-falling wasp ((obj wasp)) +(defmethod kill-prefer-falling wasp ((this wasp)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'knocked)) - (go (method-of-object obj die-now)) + ((and (-> this next-state) (= (-> this next-state name) 'knocked)) + (go (method-of-object this die-now)) ) - ((-> obj enemy-info use-die-falling) - (go (method-of-object obj die-falling)) + ((-> this enemy-info use-die-falling) + (go (method-of-object this die-falling)) ) (else - (go (method-of-object obj die)) + (go (method-of-object this die)) ) ) ) -(defmethod spawn-wasp-shot wasp ((obj wasp) (arg0 projectile-init-by-other-params) (arg1 int) (arg2 float) (arg3 float)) - (vector<-cspace! (-> arg0 pos) (-> obj node-list data arg1)) +(defmethod spawn-wasp-shot wasp ((this wasp) (arg0 projectile-init-by-other-params) (arg1 int) (arg2 float) (arg3 float)) + (vector<-cspace! (-> arg0 pos) (-> this node-list data arg1)) (let ((s3-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> obj node-list data arg1 bone transform vector 1) + (-> this node-list data arg1 bone transform vector 1) 1.0 ) (* 273.06668 arg3) @@ -1170,7 +1171,7 @@ ) (a1-8 (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> obj node-list data arg1 bone transform vector 2) + (-> this node-list data arg1 bone transform vector 2) 1.0 ) ) @@ -1178,14 +1179,14 @@ (vector-orient-by-quat! (-> arg0 vel) a1-8 s3-1) ) (vector-normalize! (-> arg0 vel) 491520.0) - (spawn-projectile wasp-shot arg0 obj *default-dead-pool*) + (spawn-projectile wasp-shot arg0 this *default-dead-pool*) 0 (none) ) -(defmethod hover-enemy-method-142 wasp ((obj wasp)) - (let ((s5-0 (-> obj main-joint-acc)) - (s4-0 (-> obj main-joint-vel)) +(defmethod hover-enemy-method-142 wasp ((this wasp)) + (let ((s5-0 (-> this main-joint-acc)) + (s4-0 (-> this main-joint-vel)) (gp-0 (lambda ((arg0 wasp) (arg1 cspace) (arg2 float) (arg3 float) (arg4 vector) (arg5 vector) (arg6 int)) (local-vars (sv-192 float) (sv-208 quaternion) (sv-224 vector)) @@ -1271,18 +1272,18 @@ ) ) (gp-0 - obj - (-> obj node-list data (-> obj hover-info engine-left)) - (-> obj hover-info thrust-rotate-left) + this + (-> this node-list data (-> this hover-info engine-left)) + (-> this hover-info thrust-rotate-left) -1.0 s5-0 s4-0 0 ) (gp-0 - obj - (-> obj node-list data (-> obj hover-info engine-right)) - (-> obj hover-info thrust-rotate-right) + this + (-> this node-list data (-> this hover-info engine-right)) + (-> this hover-info thrust-rotate-right) 1.0 s5-0 s4-0 @@ -1293,9 +1294,9 @@ (none) ) -(defmethod init-enemy-collision! wasp ((obj wasp)) +(defmethod init-enemy-collision! wasp ((this wasp)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1397,41 +1398,41 @@ (set! (-> s5-0 backup-collide-with) (-> v1-35 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod deactivate wasp ((obj wasp)) - (if (nonzero? (-> obj smoke-part)) - (kill-and-free-particles (-> obj smoke-part)) +(defmethod deactivate wasp ((this wasp)) + (if (nonzero? (-> this smoke-part)) + (kill-and-free-particles (-> this smoke-part)) ) - (if (nonzero? (-> obj engine-part)) - (kill-and-free-particles (-> obj engine-part)) + (if (nonzero? (-> this engine-part)) + (kill-and-free-particles (-> this engine-part)) ) - (sound-stop (-> obj sound-id)) - ((method-of-type hover-enemy deactivate) obj) + (sound-stop (-> this sound-id)) + ((method-of-type hover-enemy deactivate) this) (none) ) ;; WARN: Return type mismatch hover-enemy vs wasp. -(defmethod relocate wasp ((obj wasp) (arg0 int)) - (if (nonzero? (-> obj gun-jmod)) - (&+! (-> obj gun-jmod) arg0) +(defmethod relocate wasp ((this wasp) (arg0 int)) + (if (nonzero? (-> this gun-jmod)) + (&+! (-> this gun-jmod) arg0) ) - (if (nonzero? (-> obj smoke-part)) - (&+! (-> obj smoke-part) arg0) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) arg0) ) - (if (nonzero? (-> obj engine-part)) - (&+! (-> obj engine-part) arg0) + (if (nonzero? (-> this engine-part)) + (&+! (-> this engine-part) arg0) ) - (the-as wasp ((method-of-type hover-enemy relocate) obj arg0)) + (the-as wasp ((method-of-type hover-enemy relocate) this arg0)) ) -(defmethod hover-enemy-method-149 wasp ((obj wasp)) +(defmethod hover-enemy-method-149 wasp ((this wasp)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-wasp" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1439,11 +1440,11 @@ (none) ) -(defmethod hover-enemy-method-150 wasp ((obj wasp)) +(defmethod hover-enemy-method-150 wasp ((this wasp)) *wasp-enemy-info* ) -(defmethod hover-enemy-method-151 wasp ((obj wasp)) +(defmethod hover-enemy-method-151 wasp ((this wasp)) (new 'static 'hover-enemy-info :fly-forward-anim 7 :fly-backward-anim 8 @@ -1459,95 +1460,95 @@ ) ) -(defmethod hover-enemy-method-152 wasp ((obj wasp)) +(defmethod hover-enemy-method-152 wasp ((this wasp)) (new 'static 'hover-nav-params :max-speed 73728.0 :max-acceleration 122880.0 :friction 0.05) ) -(defmethod init-enemy! wasp ((obj wasp)) +(defmethod init-enemy! wasp ((this wasp)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) - (hover-enemy-method-149 obj) - (init-enemy-behaviour-and-stats! obj (hover-enemy-method-150 obj)) - (hover-enemy-method-155 obj) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj scale) (get-rand-float-range obj 0.9 1.3)) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj root dynam gravity y) 327680.0) - (set! (-> obj root dynam gravity-length) 327680.0) - (set! (-> obj root dynam gravity-max) 327680.0) - (set! (-> obj gun-jmod) - (the-as joint-mod (new 'process 'joint-mod-rotate-local obj (-> obj hover-info gun-base) #t)) + (hover-enemy-method-149 this) + (init-enemy-behaviour-and-stats! this (hover-enemy-method-150 this)) + (hover-enemy-method-155 this) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this scale) (get-rand-float-range this 0.9 1.3)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this root dynam gravity y) 327680.0) + (set! (-> this root dynam gravity-length) 327680.0) + (set! (-> this root dynam gravity-max) 327680.0) + (set! (-> this gun-jmod) + (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this hover-info gun-base) #t)) ) - (set! (-> obj gun-x-angle) 0.0) - (set! (-> obj gun-x-angle-final) 0.0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (set! (-> this gun-x-angle) 0.0) + (set! (-> this gun-x-angle-final) 0.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-28 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-28 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (if (and v1-28 (= (-> sv-16 elt-count) 1)) - (set! (-> obj entity-group) (-> v1-28 0)) - (set! (-> obj entity-group) #f) + (set! (-> this entity-group) (-> v1-28 0)) + (set! (-> this entity-group) #f) ) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-32 (res-lump-data (-> obj entity) 'timeout (pointer float) :tag-ptr (& sv-32)))) + (let ((v1-32 (res-lump-data (-> this entity) 'timeout (pointer float) :tag-ptr (& sv-32)))) (cond ((and v1-32 (= (-> sv-32 elt-count) 2)) - (set! (-> obj attack-wait-min) (-> v1-32 0)) - (set! (-> obj attack-wait-max) (-> v1-32 1)) + (set! (-> this attack-wait-min) (-> v1-32 0)) + (set! (-> this attack-wait-max) (-> v1-32 1)) ) (else - (set! (-> obj attack-wait-min) 1.0) - (set! (-> obj attack-wait-max) 3.0) + (set! (-> this attack-wait-min) 1.0) + (set! (-> this attack-wait-max) 3.0) ) ) ) (let ((f30-0 4096.0)) (set! sv-48 (new 'static 'res-tag)) - (let ((v1-39 (res-lump-data (-> obj entity) 'min-max (pointer float) :tag-ptr (& sv-48)))) - (set! (-> obj attack-miss-dist-min) (* f30-0 (if (and v1-39 (> (the-as int (-> sv-48 elt-count)) 0)) - (-> v1-39 0) - -1.0 - ) - ) + (let ((v1-39 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-48)))) + (set! (-> this attack-miss-dist-min) (* f30-0 (if (and v1-39 (> (the-as int (-> sv-48 elt-count)) 0)) + (-> v1-39 0) + -1.0 + ) + ) ) ) ) (let ((f30-1 4096.0)) (set! sv-64 (new 'static 'res-tag)) - (let ((v1-43 (res-lump-data (-> obj entity) 'min-max (pointer float) :tag-ptr (& sv-64)))) - (set! (-> obj attack-miss-dist-max) (* f30-1 (if (and v1-43 (< 1 (the-as int (-> sv-64 elt-count)))) - (-> v1-43 1) - 1.0 - ) - ) + (let ((v1-43 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-64)))) + (set! (-> this attack-miss-dist-max) (* f30-1 (if (and v1-43 (< 1 (the-as int (-> sv-64 elt-count)))) + (-> v1-43 1) + 1.0 + ) + ) ) ) ) - (set! (-> obj path) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (set! (-> obj path-u) 0.0) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj smoke-part) (create-launch-control (-> *part-group-id-table* 154) obj)) - (set! (-> obj engine-part) (create-launch-control (-> *part-group-id-table* 156) obj)) + (set! (-> this path) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (set! (-> this path-u) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 154) this)) + (set! (-> this engine-part) (create-launch-control (-> *part-group-id-table* 156) this)) (add-connection *part-engine* - obj + this 7 - obj + this 318 (new 'static 'vector :x 1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) (add-connection *part-engine* - obj + this 7 - obj + this 318 (new 'static 'vector :x -1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) - (add-connection *part-engine* obj 7 obj 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) + (add-connection *part-engine* this 7 this 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) 0 (none) ) diff --git a/goal_src/jak2/levels/common/enemy/metalmonk.gc b/goal_src/jak2/levels/common/enemy/metalmonk.gc index 9174fe1a6a..cdaa15d10f 100644 --- a/goal_src/jak2/levels/common/enemy/metalmonk.gc +++ b/goal_src/jak2/levels/common/enemy/metalmonk.gc @@ -254,55 +254,57 @@ (set! (-> *metalmonk-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; WARN: Return type mismatch vector vs none. -(defmethod metalmonk-method-179 metalmonk ((obj metalmonk) (arg0 vector)) - (set! (-> arg0 quad) (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat)) vector 2 quad)) +(defmethod metalmonk-method-179 metalmonk ((this metalmonk) (arg0 vector)) + (set! (-> arg0 quad) + (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)) vector 2 quad) + ) (none) ) -(defmethod metalmonk-method-181 metalmonk ((obj metalmonk) (arg0 float) (arg1 float)) - (let ((f28-0 (vector-dot (-> obj new-facing) (-> obj old-facing))) +(defmethod metalmonk-method-181 metalmonk ((this metalmonk) (arg0 float) (arg1 float)) + (let ((f28-0 (vector-dot (-> this new-facing) (-> this old-facing))) (f30-1 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) ) - (when (and (< f28-0 (cos (* 182.04445 arg0))) (let ((v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (and (< f28-0 (cos (* 182.04445 arg0))) (let ((v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (not (and v1-7 (= v1-7 (-> obj draw art-group data 13)))) + (not (and v1-7 (= v1-7 (-> this draw art-group data 13)))) ) ) (ja-channel-push! 1 (seconds 0.16)) - (let ((v1-13 (-> obj skel root-channel 0))) - (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 13))) + (let ((v1-13 (-> this skel root-channel 0))) + (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) ) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (set! (-> s4-1 num-func) num-func-identity) (set! (-> s4-1 frame-num) (* f30-1 (the float (ja-num-frames 0)))) ) - (set! (-> obj high-time) (current-time)) + (set-time! (-> this high-time)) ) - (let ((v1-22 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-22 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (when (or (not (and v1-22 (or (= v1-22 (-> obj draw art-group data 12)) (= v1-22 (-> obj draw art-group data 13))))) - (let ((v1-28 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (or (not (and v1-22 (or (= v1-22 (-> this draw art-group data 12)) (= v1-22 (-> this draw art-group data 13))))) + (let ((v1-28 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and (and v1-28 (= v1-28 (-> obj draw art-group data 13))) + (and (and v1-28 (= v1-28 (-> this draw art-group data 13))) (< (ja-frame-num 0) 3.0) - (and (< (cos (* 182.04445 arg1)) f28-0) (>= (- (current-time) (-> obj high-time)) (seconds 1))) + (and (< (cos (* 182.04445 arg1)) f28-0) (time-elapsed? (-> this high-time) (seconds 1))) ) ) ) (ja-channel-push! 1 (seconds 0.16)) - (let ((v1-41 (-> obj skel root-channel 0))) - (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (let ((v1-41 (-> this skel root-channel 0))) + (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) ) - (let ((gp-1 (-> obj skel root-channel 0))) + (let ((gp-1 (-> this skel root-channel 0))) (set! (-> gp-1 num-func) num-func-identity) (set! (-> gp-1 frame-num) (* f30-1 (the float (ja-num-frames 0)))) ) @@ -313,49 +315,49 @@ (none) ) -(defmethod metalmonk-method-182 metalmonk ((obj metalmonk) (arg0 float) (arg1 float)) - (let ((f28-0 (vector-dot (-> obj new-facing) (-> obj old-facing))) +(defmethod metalmonk-method-182 metalmonk ((this metalmonk) (arg0 float) (arg1 float)) + (let ((f28-0 (vector-dot (-> this new-facing) (-> this old-facing))) (f30-1 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) ) - (when (and (< f28-0 (cos (* 182.04445 arg0))) (let ((v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (and (< f28-0 (cos (* 182.04445 arg0))) (let ((v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (not (and v1-7 (= v1-7 (-> obj draw art-group data 9)))) + (not (and v1-7 (= v1-7 (-> this draw art-group data 9)))) ) ) (ja-channel-push! 1 (seconds 0.16)) - (let ((v1-13 (-> obj skel root-channel 0))) - (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 9))) + (let ((v1-13 (-> this skel root-channel 0))) + (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 9))) ) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (set! (-> s4-1 num-func) num-func-identity) (set! (-> s4-1 frame-num) (* f30-1 (the float (ja-num-frames 0)))) ) - (set! (-> obj high-time) (current-time)) + (set-time! (-> this high-time)) ) - (let ((v1-22 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-22 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (when (or (not (and v1-22 (or (= v1-22 (-> obj draw art-group data 8)) (= v1-22 (-> obj draw art-group data 9))))) - (let ((v1-28 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (or (not (and v1-22 (or (= v1-22 (-> this draw art-group data 8)) (= v1-22 (-> this draw art-group data 9))))) + (let ((v1-28 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and (and v1-28 (= v1-28 (-> obj draw art-group data 9))) - (and (< (cos (* 182.04445 arg1)) f28-0) (>= (- (current-time) (-> obj high-time)) (seconds 1))) + (and (and v1-28 (= v1-28 (-> this draw art-group data 9))) + (and (< (cos (* 182.04445 arg1)) f28-0) (time-elapsed? (-> this high-time) (seconds 1))) ) ) ) (ja-channel-push! 1 (seconds 0.5)) - (let ((v1-39 (-> obj skel root-channel 0))) - (set! (-> v1-39 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (let ((v1-39 (-> this skel root-channel 0))) + (set! (-> v1-39 frame-group) (the-as art-joint-anim (-> this draw art-group data 8))) ) - (let ((gp-1 (-> obj skel root-channel 0))) + (let ((gp-1 (-> this skel root-channel 0))) (set! (-> gp-1 num-func) num-func-identity) (set! (-> gp-1 frame-num) (* f30-1 (the float (ja-num-frames 0)))) ) @@ -366,80 +368,80 @@ (none) ) -(defmethod track-target! metalmonk ((obj metalmonk)) +(defmethod track-target! metalmonk ((this metalmonk)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj old-facing quad) (-> obj new-facing quad)) - (metalmonk-method-179 obj (-> obj new-facing)) + (set! (-> this old-facing quad) (-> this new-facing quad)) + (metalmonk-method-179 this (-> this new-facing)) 0 (none) ) -(defmethod general-event-handler metalmonk ((obj metalmonk) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler metalmonk ((this metalmonk) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked 'hit-flinch) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (let ((s5-1 (-> obj incoming knocked-type))) + ((zero? (-> this hit-points)) + (let ((s5-1 (-> this incoming knocked-type))) (cond ((and (= s5-1 (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-33 (-> obj next-state name))) - (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) - ) + (not (and (-> this next-state) (let ((v1-33 (-> this next-state name))) + (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ((or (= s5-1 (knocked-type knocked-type-4)) (= s5-1 (knocked-type knocked-type-6))) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - (go (method-of-object obj knocked)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) + (go (method-of-object this knocked)) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod enemy-method-104 metalmonk ((obj metalmonk) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 metalmonk ((this metalmonk) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (let* ((s3-0 arg0) (a0-2 (if (type? s3-0 process-focusable) s3-0 @@ -448,11 +450,11 @@ (s3-1 (new 'stack-no-clear 'vector)) ) (let ((s1-0 (new 'stack-no-clear 'vector))) - (vector-! s3-1 (get-trans (the-as process-focusable a0-2) 0) (-> obj root trans)) + (vector-! s3-1 (get-trans (the-as process-focusable a0-2) 0) (-> this root trans)) (set! (-> s3-1 y) 0.0) (vector-normalize! s3-1 1.0) (set-vector! s1-0 0.0 1.0 0.0 1.0) - (vector-cross! s1-0 s1-0 (-> obj old-facing)) + (vector-cross! s1-0 s1-0 (-> this old-facing)) (vector-normalize! s1-0 1.0) (let ((f0-6 (vector-dot s1-0 s3-1))) (cond @@ -467,23 +469,23 @@ ) ) ) - (vector-normalize! s3-1 (* 1.5 (-> obj enemy-info attack-shove-back))) - (set! (-> s3-1 y) (-> obj enemy-info attack-shove-up)) + (vector-normalize! s3-1 (* 1.5 (-> this enemy-info attack-shove-back))) + (set! (-> s3-1 y) (-> this enemy-info attack-shove-up)) (when (send-event arg0 'attack arg1 - (static-attack-info ((id arg2) (angle 'front) (vector s3-1) (mode (-> obj enemy-info attack-mode)))) + (static-attack-info ((id arg2) (angle 'front) (vector s3-1) (mode (-> this enemy-info attack-mode)))) ) - (enemy-method-105 obj arg0) + (enemy-method-105 this arg0) #t ) ) ) -(defmethod enemy-method-84 metalmonk ((obj metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) (let* ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))) - (f1-1 (fmax (-> obj enemy-info jump-height-min) (* (-> obj enemy-info jump-height-factor) f0-0))) + (f1-1 (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0))) (f0-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) (f0-4 (- (fmax (+ (fmin (-> arg0 start-pos y) (-> arg0 dest-pos y)) f1-1) (+ 10240.0 f0-3)) f0-3)) ) @@ -492,20 +494,20 @@ (none) ) -(defmethod enemy-method-89 metalmonk ((obj metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) #f ) -(defmethod enemy-method-87 metalmonk ((obj metalmonk) (arg0 enemy-jump-info)) - (let ((s5-0 (-> obj draw art-group data (-> obj enemy-info run-anim))) - (v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) +(defmethod enemy-method-87 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) + (let ((s5-0 (-> this draw art-group data (-> this enemy-info run-anim))) + (v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (when (not (and v1-6 (= v1-6 s5-0))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) + (let ((a0-5 (-> this skel root-channel 0))) (set! (-> a0-5 frame-group) (the-as art-joint-anim s5-0)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) (set! (-> a0-5 param 1) (-> arg0 anim-speed)) @@ -517,21 +519,21 @@ #t ) -(defmethod enemy-method-88 metalmonk ((obj metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) #f ) -(defmethod enemy-method-90 metalmonk ((obj metalmonk) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 metalmonk ((this metalmonk) (arg0 int) (arg1 enemy-jump-info)) (case arg0 ((3) - (let ((a0-1 (-> obj skel root-channel 0))) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) #f ) (else - ((method-of-type nav-enemy enemy-method-90) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-90) this arg0 arg1) ) ) ) @@ -597,7 +599,7 @@ ) ) (let ((gp-0 (handle->process (-> self focus handle)))) - (if (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (and gp-0 (or (and (< (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)) 20480.0) (let ((v1-19 (ja-group))) @@ -779,7 +781,7 @@ (t9-0) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy victory) trans))) @@ -789,7 +791,7 @@ ) (let ((a0-1 (handle->process (-> self focus handle)))) (if (and a0-1 - (and (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (and (time-elapsed? (-> self state-time) (seconds 0.05)) (let ((f0-0 (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-1) 0) (-> self root trans))) (f1-0 14336.0) ) @@ -897,16 +899,16 @@ ) ) -(defmethod enemy-method-77 metalmonk ((obj metalmonk) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 metalmonk ((this metalmonk) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 0) (let* ((a2-0 (ash 1 (-> *metalmonk-global-info* prev-yellow-hit))) - (v1-3 (enemy-method-120 obj 4 a2-0)) - (a1-6 (-> obj draw art-group data (-> *metalmonk-global-info* yellow-hit-anim v1-3))) + (v1-3 (enemy-method-120 this 4 a2-0)) + (a1-6 (-> this draw art-group data (-> *metalmonk-global-info* yellow-hit-anim v1-3))) ) (set! (-> *metalmonk-global-info* prev-yellow-hit) v1-3) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) (set! (-> a0-13 param 1) (-> arg0 0)) @@ -917,21 +919,21 @@ ) (((knocked-type knocked-type-6)) (let* ((a2-2 (ash 1 (-> *metalmonk-global-info* prev-blue-hit))) - (v1-12 (enemy-method-120 obj 3 a2-2)) - (s5-1 (-> obj draw art-group data (-> *metalmonk-global-info* blue-hit-anim v1-12))) + (v1-12 (enemy-method-120 this 3 a2-2)) + (s5-1 (-> this draw art-group data (-> *metalmonk-global-info* blue-hit-anim v1-12))) ) (set! (-> *metalmonk-global-info* prev-blue-hit) v1-12) - (let ((v1-15 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-15 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-15 (= v1-15 (-> obj draw art-group data 27))) + (if (and v1-15 (= v1-15 (-> this draw art-group data 27))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-31 (-> obj skel root-channel 0))) + (let ((a0-31 (-> this skel root-channel 0))) (set! (-> a0-31 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-31 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-31 param 1) 1.0) @@ -942,16 +944,16 @@ ) (else (let ((s4-1 - (if (< (vector-dot (the-as vector (metalmonk-method-179 obj (new 'stack-no-clear 'vector))) (-> obj root transv)) + (if (< (vector-dot (the-as vector (metalmonk-method-179 this (new 'stack-no-clear 'vector))) (-> this root transv)) 0.0 ) - (-> obj draw art-group data (-> *metalmonk-global-info* knocked-anim (get-rand-int obj 2))) - (-> obj draw art-group data 20) + (-> this draw art-group data (-> *metalmonk-global-info* knocked-anim (get-rand-int this 2))) + (-> this draw art-group data 20) ) ) ) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-38 (-> obj skel root-channel 0))) + (let ((a0-38 (-> this skel root-channel 0))) (set! (-> a0-38 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-38 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-38 param 1) (-> arg0 0)) @@ -964,13 +966,13 @@ #t ) -(defmethod enemy-method-78 metalmonk ((obj metalmonk) (arg0 (pointer float))) +(defmethod enemy-method-78 metalmonk ((this metalmonk) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((s4-0 (-> obj draw art-group data 27))) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 27))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-3 param 1) (-> arg0 0)) @@ -981,24 +983,24 @@ #t ) ) - ((!= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (let* ((v1-14 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((!= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (let* ((v1-14 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) (s4-1 (cond - ((and v1-14 (= v1-14 (-> obj draw art-group data 16))) - (-> obj draw art-group data 17) + ((and v1-14 (= v1-14 (-> this draw art-group data 16))) + (-> this draw art-group data 17) ) (else - (let ((v1-21 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-21 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-21 (= v1-21 (-> obj draw art-group data 18))) - (-> obj draw art-group data 19) - (-> obj draw art-group data 21) + (if (and v1-21 (= v1-21 (-> this draw art-group data 18))) + (-> this draw art-group data 19) + (-> this draw art-group data 21) ) ) ) @@ -1006,7 +1008,7 @@ ) ) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-14 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-14 param 1) (-> arg0 0)) @@ -1019,8 +1021,8 @@ ) ) -(defmethod metalmonk-method-180 metalmonk ((obj metalmonk) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod metalmonk-method-180 metalmonk ((this metalmonk) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 1) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) (if arg0 @@ -1034,9 +1036,9 @@ (none) ) -(defmethod init-enemy-collision! metalmonk ((obj metalmonk)) +(defmethod init-enemy-collision! metalmonk ((this metalmonk)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1137,71 +1139,71 @@ (set! (-> s5-0 backup-collide-with) (-> v1-31 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod coin-flip? metalmonk ((obj metalmonk)) +(defmethod coin-flip? metalmonk ((this metalmonk)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch process-focusable vs metalmonk. -(defmethod relocate metalmonk ((obj metalmonk) (arg0 int)) - (if (nonzero? (-> obj intro-path)) - (&+! (-> obj intro-path) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method metalmonk 7)) this arg0) ) ) -(defmethod init-enemy! metalmonk ((obj metalmonk)) +(defmethod init-enemy! metalmonk ((this metalmonk)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-metalmonk" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *metalmonk-nav-enemy-info*) - (let ((v1-8 (-> obj neck))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *metalmonk-nav-enemy-info*) + (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) (set! (-> v1-8 nose) (the-as uint 2)) (set! (-> v1-8 ear) (the-as uint 0)) (set-vector! (-> v1-8 twist-max) 10922.667 12743.111 0.0 1.0) (set! (-> v1-8 ignore-angle) 18204.445) ) - (let ((v1-10 (-> obj nav))) + (let ((v1-10 (-> this nav))) (set! (-> v1-10 speed-scale) 1.0) ) 0 - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (set-gravity-length (-> obj root dynam) 573440.0) - (set! (-> obj intro-path) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (metalmonk-method-180 obj #f) - (set! (-> obj high-time) 0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (metalmonk-method-180 this #f) + (set! (-> this high-time) 0) (add-connection *part-engine* - obj + this 7 - obj + this 4986 (new 'static 'vector :x 1064.96 :y -450.56 :z 1146.88 :w 163840.0) ) (add-connection *part-engine* - obj + this 7 - obj + this 4987 (new 'static 'vector :x -1064.96 :y -450.56 :z 1146.88 :w 163840.0) ) - (add-connection *part-engine* obj 7 obj 4988 (new 'static 'vector :y 1556.48 :z 368.64 :w 163840.0)) + (add-connection *part-engine* this 7 this 4988 (new 'static 'vector :y 1556.48 :z 368.64 :w 163840.0)) 0 (none) ) diff --git a/goal_src/jak2/levels/common/enemy/spyder.gc b/goal_src/jak2/levels/common/enemy/spyder.gc index 2999b70d21..654c33c243 100644 --- a/goal_src/jak2/levels/common/enemy/spyder.gc +++ b/goal_src/jak2/levels/common/enemy/spyder.gc @@ -28,7 +28,7 @@ ) -(defmethod play-impact-sound spyder-shot ((obj spyder-shot) (arg0 projectile-options)) +(defmethod play-impact-sound spyder-shot ((this spyder-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -43,11 +43,11 @@ (none) ) -(defmethod init-proj-settings! spyder-shot ((obj spyder-shot)) +(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)) obj) - (set! (-> obj max-speed) 307200.0) - (set! (-> obj timeout) (seconds 0.267)) + ((the-as (function projectile none) (find-parent-method spyder-shot 31)) this) + (set! (-> this max-speed) 307200.0) + (set! (-> this timeout) (seconds 0.267)) (none) ) @@ -271,45 +271,45 @@ (set! (-> *spyder-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler spyder ((obj spyder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler spyder ((this spyder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (when (zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + (when (zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) 0 ) ) ) - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) (('attack) (if (type? (-> arg0 parent 0) enemy) - (logior! (-> obj status-flags) (spyder-flags spflags-1)) + (logior! (-> this status-flags) (spyder-flags spflags-1)) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('notify) (cond ((= (-> arg3 param 0) 'attack) (cond - ((= (-> arg3 param 1) (handle->process (-> obj focus handle))) + ((= (-> arg3 param 1) (handle->process (-> this focus handle))) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer arg0)) (set! (-> a1-6 num-params) arg1) @@ -320,62 +320,62 @@ (set! (-> a1-6 param 3) (-> arg3 param 3)) (set! (-> a1-6 param 4) (-> arg3 param 4)) (set! (-> a1-6 param 5) (-> arg3 param 5)) - (send-event-function obj a1-6) + (send-event-function this a1-6) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('uncloak) - (when (!= (-> obj dest-fade) 128.0) - (set! (-> obj shock-effect-end) (+ (current-time) (seconds 1))) - (set! (-> obj dest-fade) 128.0) + (when (!= (-> this dest-fade) 128.0) + (set! (-> this shock-effect-end) (+ (current-time) (seconds 1))) + (set! (-> this dest-fade) 128.0) (sound-play "spyder-uncloak") ) - (send-event obj 'cue-chase) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (send-event this 'cue-chase) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod spyder-method-180 spyder ((obj spyder)) - (seek! (-> obj fade) (-> obj dest-fade) (* 500.0 (seconds-per-frame))) - (set! (-> obj draw force-fade) (the-as uint (the int (-> obj fade)))) +(defmethod spyder-method-180 spyder ((this spyder)) + (seek! (-> this fade) (-> this dest-fade) (* 500.0 (seconds-per-frame))) + (set! (-> this draw force-fade) (the-as uint (the int (-> this fade)))) (cond - ((zero? (-> obj draw force-fade)) - (setup-masks (-> obj draw) 16 0) - (setup-masks (-> obj draw) 0 8) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((zero? (-> this draw force-fade)) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 0 8) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) - ((= (-> obj draw force-fade) 128) - (setup-masks (-> obj draw) 0 16) - (setup-masks (-> obj draw) 8 0) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((= (-> this draw force-fade) 128) + (setup-masks (-> this draw) 0 16) + (setup-masks (-> this draw) 8 0) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) (else - (setup-masks (-> obj draw) 16 0) - (setup-masks (-> obj draw) 8 0) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 8 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) ) - (if (< 245760.0 (vector-vector-distance (-> obj root trans) (camera-pos))) - (setup-masks (-> obj draw) 0 16) + (if (< 245760.0 (vector-vector-distance (-> this root trans) (camera-pos))) + (setup-masks (-> this draw) 0 16) ) - (when (< (current-time) (-> obj shock-effect-end)) - (when (>= (- (current-time) (-> obj shock-effect-time)) (seconds 0.04)) - (set! (-> obj shock-effect-time) (current-time)) + (when (< (current-time) (-> this shock-effect-end)) + (when (time-elapsed? (-> this shock-effect-time) (seconds 0.04)) + (set-time! (-> this shock-effect-time)) (process-drawable-shock-skel-effect - obj + this (-> *lightning-spec-id-table* 5) lightning-probe-callback (-> *part-id-table* 166) @@ -389,10 +389,10 @@ (none) ) -(defmethod spyder-method-181 spyder ((obj spyder)) - (let ((a0-2 (handle->process (-> obj focus handle)))) +(defmethod spyder-method-181 spyder ((this spyder)) + (let ((a0-2 (handle->process (-> this focus handle)))) (when a0-2 - (let* ((s5-0 (-> obj root trans)) + (let* ((s5-0 (-> this root trans)) (s2-1 (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) s5-0)) (f0-0 (vector-length s2-1)) (s4-0 (new 'stack-no-clear 'vector)) @@ -400,16 +400,16 @@ (cond ((>= 143360.0 f0-0) (let ((s3-0 (new 'stack-no-clear 'vector))) - (logxor! (-> obj status-flags) (spyder-flags spflags-4)) - (if (logtest? (-> obj status-flags) (spyder-flags spflags-4)) + (logxor! (-> this status-flags) (spyder-flags spflags-4)) + (if (logtest? (-> this status-flags) (spyder-flags spflags-4)) (set-vector! s3-0 (-> s2-1 z) (-> s2-1 y) (- (-> s2-1 x)) 1.0) (set-vector! s3-0 (- (-> s2-1 z)) (-> s2-1 y) (-> s2-1 x) 1.0) ) (vector-normalize! s3-0 (* 4096.0 (rand-vu-float-range 8.0 16.0))) (clamp-vector-to-mesh-cross-gaps - (-> obj nav) + (-> this nav) s5-0 - (-> obj nav state current-poly) + (-> this nav state current-poly) s3-0 204.8 #f @@ -423,8 +423,8 @@ (vector+! s4-0 s5-0 s2-1) ) ) - (set! (-> obj move-dest quad) (-> s5-0 quad)) - (cloest-point-on-mesh (-> obj nav) (-> obj move-dest) s4-0 (the-as nav-poly #f)) + (set! (-> this move-dest quad) (-> s5-0 quad)) + (cloest-point-on-mesh (-> this nav) (-> this move-dest) s4-0 (the-as nav-poly #f)) ) ) ) @@ -433,17 +433,17 @@ ) ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 spyder ((obj spyder) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 spyder ((this spyder) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 15))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 15)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 15)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) ) #t ) @@ -453,21 +453,21 @@ (s5-0 (new 'static 'array uint64 3 #x11 #x12 #x13)) (s4-0 (new 'static 'array int32 4 0 0 0 0)) (a2-1 (ash 1 (-> s4-0 0))) - (v1-20 (enemy-method-120 obj a1-4 a2-1)) - (s5-1 (-> obj draw art-group data (-> (the-as (pointer int32) (+ (* v1-20 8) (the-as int s5-0)))))) + (v1-20 (enemy-method-120 this a1-4 a2-1)) + (s5-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-20 8) (the-as int s5-0)))))) ) (set! (-> s4-0 0) v1-20) - (let ((v1-23 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-23 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-23 (= v1-23 (-> obj draw art-group data 20))) + (if (and v1-23 (= v1-23 (-> this draw art-group data 20))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-19 (-> obj skel root-channel 0))) + (let ((a0-19 (-> this skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-19 param 1) 1.0) @@ -479,42 +479,42 @@ ) (((knocked-type knocked-type-0)) (cond - ((zero? (-> obj hit-points)) - (let ((a0-20 (-> obj skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> obj draw art-group data 13))) + ((zero? (-> this hit-points)) + (let ((a0-20 (-> this skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 13)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) ) (set! (-> a0-20 param 1) (-> arg0 0)) (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> obj draw art-group data 13)) num-func-seek!) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) ) #t ) (else - ((method-of-type nav-enemy enemy-method-77) obj arg0) + ((method-of-type nav-enemy enemy-method-77) this arg0) ) ) ) (else - ((method-of-type nav-enemy enemy-method-77) obj arg0) + ((method-of-type nav-enemy enemy-method-77) this arg0) ) ) ) -(defmethod enemy-method-78 spyder ((obj spyder) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 spyder ((this spyder) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (cond - ((zero? (-> obj hit-points)) - (let ((v1-4 (-> obj skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + ((zero? (-> this hit-points)) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) (set! (-> v1-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) ) (set! (-> v1-4 param 1) 1.0) (set! (-> v1-4 frame-num) 0.0) - (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) ) #t ) @@ -524,30 +524,30 @@ ) ) (((knocked-type knocked-type-0)) - (if (zero? (-> obj hit-points)) + (if (zero? (-> this hit-points)) #t - ((method-of-type nav-enemy enemy-method-78) obj arg0) + ((method-of-type nav-enemy enemy-method-78) this arg0) ) ) (else - ((method-of-type nav-enemy enemy-method-78) obj arg0) + ((method-of-type nav-enemy enemy-method-78) this arg0) ) ) ) -(defmethod enemy-method-87 spyder ((obj spyder) (arg0 enemy-jump-info)) - (let ((s5-0 (-> obj draw art-group data (-> obj enemy-info jump-in-air-anim)))) - (let ((v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) +(defmethod enemy-method-87 spyder ((this spyder) (arg0 enemy-jump-info)) + (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) + (let ((v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-6 (= v1-6 (-> obj draw art-group data (-> obj enemy-info jump-wind-up-anim)))) + ((and v1-6 (= v1-6 (-> this draw art-group data (-> this enemy-info jump-wind-up-anim)))) (ja-channel-push! 1 0) ) (else - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 param 0) 1.0) (joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) @@ -555,7 +555,7 @@ ) ) ) - (let ((a0-12 (-> obj skel root-channel 0))) + (let ((a0-12 (-> this skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim s5-0)) (set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) (set! (-> a0-12 param 1) (-> arg0 anim-speed)) @@ -598,29 +598,29 @@ (none) ) -(defmethod spyder-method-182 spyder ((obj spyder)) +(defmethod spyder-method-182 spyder ((this spyder)) (cond - ((and (logtest? (-> obj status-flags) (spyder-flags spflags-2)) (!= (-> obj joint scale z) 1.0)) - (seek! (-> obj joint scale z) 1.0 (* 0.8 (seconds-per-frame))) + ((and (logtest? (-> this status-flags) (spyder-flags spflags-2)) (!= (-> this joint scale z) 1.0)) + (seek! (-> this joint scale z) 1.0 (* 0.8 (seconds-per-frame))) ) - ((and (not (logtest? (-> obj status-flags) (spyder-flags spflags-2))) (!= (-> obj joint scale z) 0.0)) - (seek! (-> obj joint scale z) 0.0 (* 0.8 (seconds-per-frame))) + ((and (not (logtest? (-> this status-flags) (spyder-flags spflags-2))) (!= (-> this joint scale z) 0.0)) + (seek! (-> this joint scale z) 0.0 (* 0.8 (seconds-per-frame))) ) ) (let ((s5-0 (new 'stack-no-clear 'quaternion))) - (let ((a1-2 (-> obj node-list data 37 bone transform))) + (let ((a1-2 (-> this node-list data 37 bone transform))) (matrix-with-scale->quaternion s5-0 a1-2) ) - (let ((a1-4 (quaternion-from-two-vectors! (new 'stack-no-clear 'quaternion) (-> obj my-up-vector) *up-vector*))) + (let ((a1-4 (quaternion-from-two-vectors! (new 'stack-no-clear 'quaternion) (-> this my-up-vector) *up-vector*))) (quaternion*! s5-0 a1-4 s5-0) ) - (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> obj face-pos) (-> obj root trans))) - (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this face-pos) (-> this root trans))) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (cond - ((logtest? (-> obj status-flags) (spyder-flags spflags-3)) - (vector-! s4-1 (-> obj face-pos) (-> obj root trans)) - (logclear! (-> obj status-flags) (spyder-flags spflags-3)) + ((logtest? (-> this status-flags) (spyder-flags spflags-3)) + (vector-! s4-1 (-> this face-pos) (-> this root trans)) + (logclear! (-> this status-flags) (spyder-flags spflags-3)) ) (else (set! (-> s4-1 quad) (-> s3-0 quad)) @@ -635,8 +635,8 @@ ) ) (quaternion-slerp! - (the-as quaternion (-> obj joint twist)) - (the-as quaternion (-> obj joint twist)) + (the-as quaternion (-> this joint twist)) + (the-as quaternion (-> this joint twist)) s5-0 (* 10.0 (seconds-per-frame)) ) @@ -645,45 +645,45 @@ (none) ) -(defmethod spyder-method-184 spyder ((obj spyder) (arg0 vector)) - (when (not (logtest? (-> obj status-flags) (spyder-flags spflags-0))) +(defmethod spyder-method-184 spyder ((this spyder) (arg0 vector)) + (when (not (logtest? (-> this status-flags) (spyder-flags spflags-0))) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> *up-vector* quad)) (let ((s3-0 (new 'stack-no-clear 'quaternion))) - (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> obj root gspot-normal) 4551.1113) + (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this root gspot-normal) 4551.1113) (vector-orient-by-quat! s4-0 s4-0 s3-0) ) - (let ((s3-1 (-> obj my-up-vector))) + (let ((s3-1 (-> this my-up-vector))) (vector-deg-seek s3-1 s3-1 s4-0 (* 16384.0 (seconds-per-frame))) (vector-normalize! s3-1 1.0) - (forward-up-nopitch->quaternion (-> obj root quat) arg0 s3-1) + (forward-up-nopitch->quaternion (-> this root quat) arg0 s3-1) ) ) - (logior! (-> obj status-flags) (spyder-flags spflags-0)) + (logior! (-> this status-flags) (spyder-flags spflags-0)) ) 0 (none) ) -(defmethod track-target! spyder ((obj spyder)) +(defmethod track-target! spyder ((this spyder)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (spyder-method-185 obj) - (spyder-method-184 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (update-trans! (-> obj sound) (-> obj root trans)) - (update! (-> obj sound)) - (spyder-method-182 obj) + (spyder-method-185 this) + (spyder-method-184 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (update-trans! (-> this sound) (-> this root trans)) + (update! (-> this sound)) + (spyder-method-182 this) (let ((t9-6 (method-of-type nav-enemy track-target!))) - (t9-6 obj) + (t9-6 this) ) - (logclear! (-> obj status-flags) (spyder-flags spflags-0)) - (if (logtest? (-> obj status-flags) (spyder-flags spflags-5)) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (logclear! (-> this status-flags) (spyder-flags spflags-0)) + (if (logtest? (-> this status-flags) (spyder-flags spflags-5)) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) ) - (if (-> obj predator-effect?) - (spyder-method-180 obj) + (if (-> this predator-effect?) + (spyder-method-180 this) ) (none) ) @@ -735,7 +735,7 @@ ) ) -(defmethod spyder-method-185 spyder ((obj spyder)) +(defmethod spyder-method-185 spyder ((this spyder)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -746,7 +746,7 @@ (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 (-> s5-0 bbox)) - (a0-2 (-> obj root trans)) + (a0-2 (-> this root trans)) (a1-0 (new 'stack-no-clear 'vector)) ) (set! (-> a1-0 x) 22528.0) @@ -756,7 +756,7 @@ (vector-! (the-as vector v1-0) a0-2 a1-0) ) (let ((v1-2 (-> s5-0 bbox max)) - (a0-4 (-> obj root trans)) + (a0-4 (-> this root trans)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 x) 22528.0) @@ -771,8 +771,8 @@ (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (fill-using-bounding-box *collide-cache* s5-0) (dotimes (s4-0 4) - (-> obj joint-ik s4-0 shoulder-matrix-no-ik) - (let ((a2-8 (-> obj joint-ik s4-0 elbow-matrix-no-ik)) + (-> this joint-ik s4-0 shoulder-matrix-no-ik) + (let ((a2-8 (-> this joint-ik s4-0 elbow-matrix-no-ik)) (s3-0 (new 'stack-no-clear 'vector)) ) (let ((v1-15 (new 'stack-no-clear 'vector))) @@ -782,7 +782,7 @@ (let ((a1-3 s3-0)) (let ((a0-9 (-> a2-8 trans))) (let ((a2-9 (-> a2-8 vector 1))) - (let ((a3-3 (-> obj joint-ik s4-0 hand-dist))) + (let ((a3-3 (-> this joint-ik s4-0 hand-dist))) (.mov vf7 a3-3) ) (.lvf vf5 (&-> a2-9 quad)) @@ -795,7 +795,7 @@ (.svf (&-> a1-3 quad) vf6) ) (set! (-> s2-0 quad) (-> s3-0 quad)) - (set! (-> s2-0 y) (-> obj root trans y)) + (set! (-> s2-0 y) (-> this root trans y)) (let ((a2-10 (-> s5-0 start-pos))) (let ((a0-12 s2-0)) (let ((a1-6 v1-15)) @@ -840,12 +840,12 @@ ) ) (let ((f0-15 (fmax -8192.0 (fmin 8192.0 (- (-> s2-0 y) (-> s3-0 y)))))) - (+! (-> obj delta-y-ik s4-0) (* 10.0 (seconds-per-frame) (- f0-15 (-> obj delta-y-ik s4-0)))) + (+! (-> this delta-y-ik s4-0) (* 10.0 (seconds-per-frame) (- f0-15 (-> this delta-y-ik s4-0)))) ) ) ) - (+! (-> s3-0 y) (-> obj delta-y-ik s4-0)) - (handle-copy! (-> obj joint-ik s4-0) s3-0) + (+! (-> s3-0 y) (-> this delta-y-ik s4-0)) + (handle-copy! (-> this joint-ik s4-0) s3-0) ) ) ) @@ -927,7 +927,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -939,7 +939,7 @@ ) :trans (behavior () (let ((f0-0 (vector-vector-xz-distance (-> self root trans) (-> self move-dest)))) - (if (or (>= 4096.0 f0-0) (>= (- (current-time) (-> self state-time)) (seconds 6))) + (if (or (>= 4096.0 f0-0) (time-elapsed? (-> self state-time) (seconds 6))) (go-hostile self) ) ) @@ -961,18 +961,18 @@ ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod spyder-method-183 spyder ((obj spyder) (arg0 matrix) (arg1 float)) +(defmethod spyder-method-183 spyder ((this spyder) (arg0 matrix) (arg1 float)) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((v1-0 (-> arg0 vector)) (a1-1 (-> arg0 vector 1)) ) - (set! (-> gp-0 ent) (-> obj entity)) + (set! (-> gp-0 ent) (-> this entity)) (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (set! (-> gp-0 pos quad) (-> v1-0 0 quad)) - (set! (-> gp-0 notify-handle) (process->handle obj)) + (set! (-> gp-0 notify-handle) (process->handle this)) (set! (-> gp-0 owner-handle) (the-as handle #f)) - (set! (-> gp-0 ignore-handle) (process->handle obj)) + (set! (-> gp-0 ignore-handle) (process->handle this)) (let* ((a0-10 *game-info*) (a3-11 (+ (-> a0-10 attack-id) 1)) ) @@ -982,7 +982,7 @@ (set! (-> gp-0 timeout) (seconds 4)) (vector-normalize! (vector-! (-> gp-0 vel) a1-1 (the-as vector v1-0)) arg1) ) - (spawn-projectile spyder-shot gp-0 obj *default-dead-pool*) + (spawn-projectile spyder-shot gp-0 this *default-dead-pool*) ) (none) ) @@ -1076,7 +1076,7 @@ (set! (-> self fire-info 1 quad) (-> s2-1 quad)) ) (let ((s3-1 (current-time))) - (until (>= (- (current-time) s3-1) (seconds 0.2)) + (until (time-elapsed? s3-1 (seconds 0.2)) (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) (ja :num! (loop!)) (let ((a0-27 (-> self skel root-channel 1))) @@ -1127,16 +1127,16 @@ ) ) -(defmethod go-hostile spyder ((obj spyder)) - (if (and (not (logtest? (-> obj status-flags) (spyder-flags spflags-1))) - (-> obj next-state) - (let ((v1-5 (-> obj next-state name))) +(defmethod go-hostile spyder ((this spyder)) + (if (and (not (logtest? (-> this status-flags) (spyder-flags spflags-1))) + (-> this next-state) + (let ((v1-5 (-> this next-state name))) (or (= v1-5 'notice) (= v1-5 'knocked)) ) ) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) (defstate knocked (spyder) @@ -1177,36 +1177,36 @@ ) ) -(defmethod nav-enemy-method-142 spyder ((obj spyder) (arg0 nav-control)) - (let ((t9-0 (method-of-object obj spyder-method-184)) +(defmethod nav-enemy-method-142 spyder ((this spyder) (arg0 nav-control)) + (let ((t9-0 (method-of-object this spyder-method-184)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 quad) (-> a2-0 heading quad)) - (t9-0 obj a1-1) + (t9-0 this a1-1) ) 0 (none) ) -(defmethod coin-flip? spyder ((obj spyder)) +(defmethod coin-flip? spyder ((this spyder)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 spyder ((obj spyder) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 spyder ((this spyder) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 obj arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 this arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) ) -(defmethod init-enemy-collision! spyder ((obj spyder)) +(defmethod init-enemy-collision! spyder ((this spyder)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1298,88 +1298,108 @@ (set! (-> s5-0 backup-collide-with) (-> v1-28 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-focusable vs spyder. -(defmethod relocate spyder ((obj spyder) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(defmethod relocate spyder ((this spyder) (arg0 int)) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) arg0) ) (dotimes (v1-4 4) - (if (nonzero? (-> obj joint-ik v1-4)) - (&+! (-> obj joint-ik v1-4) arg0) + (if (nonzero? (-> this joint-ik v1-4)) + (&+! (-> this joint-ik v1-4) arg0) ) ) (the-as spyder - ((the-as (function process-focusable int process-focusable) (find-parent-method spyder 7)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method spyder 7)) this arg0) ) ) -(defmethod init-enemy! spyder ((obj spyder)) +(defmethod init-enemy! spyder ((this spyder)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-spyder" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *spyder-nav-enemy-info*) - (let ((v1-5 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *spyder-nav-enemy-info*) + (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) (set! (-> v1-5 ear) (the-as uint 0)) (set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0) (set! (-> v1-5 ignore-angle) 30947.555) ) - (let ((v1-7 (-> obj nav))) + (let ((v1-7 (-> this nav))) (set! (-> v1-7 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) - (set! (-> obj my-up-vector quad) (-> *up-vector* quad)) - (set! (-> obj status-flags) (spyder-flags spflags-2)) + (set-gravity-length (-> this root dynam) 573440.0) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (set! (-> this my-up-vector quad) (-> *up-vector* quad)) + (set! (-> this status-flags) (spyder-flags spflags-2)) (if (rand-vu-percent? 0.5) - (logior! (-> obj status-flags) (spyder-flags spflags-4)) + (logior! (-> this status-flags) (spyder-flags spflags-4)) ) - (set! (-> obj start-pos quad) (-> obj root trans quad)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "spyder-talk" :fo-max 70) (-> obj root trans)) + (set! (-> this start-pos quad) (-> this root trans quad)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "spyder-talk" :fo-max 70) (-> this root trans)) ) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd obstacle)) - (set! (-> obj joint) (the-as joint-mod (new 'process 'joint-mod-blend-world obj 4 #t 1.0))) - (set! (-> obj joint scale x) (the-as float (logior (the-as int (-> obj joint scale x)) 4))) - (let ((f30-0 (-> obj root trans y))) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle)) + (set! (-> this joint) (the-as joint-mod (new 'process 'joint-mod-blend-world this 4 #t 1.0))) + (set! (-> this joint scale x) (the-as float (logior (the-as int (-> this joint scale x)) 4))) + (let ((f30-0 (-> this root trans y))) (dotimes (s5-1 4) - (set! (-> obj joint-ik s5-1) - (new 'process 'joint-mod-ik obj (-> *spyder-ik-setup* s5-1 elbow-index) (-> *spyder-ik-setup* s5-1 hand-dist)) + (set! (-> this joint-ik s5-1) + (new + 'process + 'joint-mod-ik + this + (-> *spyder-ik-setup* s5-1 elbow-index) + (-> *spyder-ik-setup* s5-1 hand-dist) + ) ) - (enable-set! (-> obj joint-ik s5-1) #f) - (set! (-> obj delta-y-ik 0) f30-0) + (enable-set! (-> this joint-ik s5-1) #f) + (set! (-> this delta-y-ik 0) f30-0) ) ) (cond - ((>= (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (setup-masks (-> obj draw) 16 0) - (setup-masks (-> obj draw) 8 0) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) - (set! (-> obj draw force-fade) (the-as uint 0)) - (set! (-> obj fade) 0.0) - (set! (-> obj dest-fade) 0.0) - (set! (-> obj predator-effect?) #t) + ((>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 8 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> this draw force-fade) (the-as uint 0)) + (set! (-> this fade) 0.0) + (set! (-> this dest-fade) 0.0) + (set! (-> this predator-effect?) #t) ) (else - (setup-masks (-> obj draw) 0 16) - (setup-masks (-> obj draw) 8 0) - (set! (-> obj predator-effect?) #f) + (setup-masks (-> this draw) 0 16) + (setup-masks (-> this draw) 8 0) + (set! (-> this predator-effect?) #f) ) ) - (add-connection *part-engine* obj 7 obj 318 (new 'static 'vector :x 901.12 :y -983.04 :z 942.08 :w 163840.0)) - (add-connection *part-engine* obj 7 obj 318 (new 'static 'vector :x -901.12 :y -983.04 :z 942.08 :w 163840.0)) + (add-connection + *part-engine* + this + 7 + this + 318 + (new 'static 'vector :x 901.12 :y -983.04 :z 942.08 :w 163840.0) + ) + (add-connection + *part-engine* + this + 7 + this + 318 + (new 'static 'vector :x -901.12 :y -983.04 :z 942.08 :w 163840.0) + ) 0 (none) ) diff --git a/goal_src/jak2/levels/common/entities/com-elevator.gc b/goal_src/jak2/levels/common/entities/com-elevator.gc index 2c91f1c113..2cd9f01aae 100644 --- a/goal_src/jak2/levels/common/entities/com-elevator.gc +++ b/goal_src/jak2/levels/common/entities/com-elevator.gc @@ -27,31 +27,31 @@ :bounds (static-spherem 0 0 5.6 9.2) ) -(defmethod get-art-group com-elevator ((obj com-elevator)) +(defmethod get-art-group com-elevator ((this com-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-com-elevator" (the-as (pointer uint32) #f)) ) -(defmethod move-between-points com-elevator ((obj com-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points com-elevator ((this com-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) ) ) ) ) -(defmethod commited-to-ride? com-elevator ((obj com-elevator)) +(defmethod commited-to-ride? com-elevator ((this com-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) @@ -61,13 +61,13 @@ ) (and (when a0-2 (let* ((v1-2 (get-trans a0-2 0)) - (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-2 (-> obj root trans))) + (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-2 (-> this root trans))) ) - (vector-inv-orient-by-quat! s5-2 s5-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s5-2 s5-2 (-> this root quat)) (and (< (fabs (-> s5-2 x)) 20480.0) (< 0.0 (-> s5-2 z)) (< (-> s5-2 z) 40960.0)) ) ) - (let ((gp-1 (res-lump-struct (-> obj entity) 'on-notice structure))) + (let ((gp-1 (res-lump-struct (-> this entity) 'on-notice structure))) (not (if gp-1 (script-eval (the-as pair gp-1)) ) @@ -77,8 +77,8 @@ ) ) -(defmethod com-elevator-method-49 com-elevator ((obj com-elevator) (arg0 symbol)) - (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) +(defmethod com-elevator-method-49 com-elevator ((this com-elevator) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle pusher)) @@ -132,7 +132,7 @@ ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -162,51 +162,51 @@ ) ) -(defmethod activate-elevator com-elevator ((obj com-elevator)) +(defmethod activate-elevator com-elevator ((this com-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (cond - ((logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) - (go (method-of-object obj dormant)) + ((logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this dormant)) ) - ((logtest? (-> obj params flags) (elevator-flags elevator-flags-6)) - (go (method-of-object obj arrived)) + ((logtest? (-> this params flags) (elevator-flags elevator-flags-6)) + (go (method-of-object this arrived)) ) (else - (go (method-of-object obj waiting)) + (go (method-of-object this waiting)) ) ) ) -(defmethod deactivate com-elevator ((obj com-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method com-elevator 10)) obj) +(defmethod deactivate com-elevator ((this com-elevator)) + (sound-stop (-> this sound-id)) + ((the-as (function elevator none) (find-parent-method com-elevator 10)) this) (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! com-elevator ((obj com-elevator)) +(defmethod init-plat! com-elevator ((this com-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." - (dotimes (s5-0 (-> obj path curve num-cverts)) - (let ((a1-1 (res-lump-struct (-> obj entity) 'string-startup-vector structure :time (the float s5-0)))) + (dotimes (s5-0 (-> this path curve num-cverts)) + (let ((a1-1 (res-lump-struct (-> this entity) 'string-startup-vector structure :time (the float s5-0)))) (cond (a1-1 - (vector-normalize-copy! (-> obj camera-startup s5-0) (the-as vector a1-1) 1.0) - (set! (-> obj use-camera-startup? s5-0) #t) + (vector-normalize-copy! (-> this camera-startup s5-0) (the-as vector a1-1) 1.0) + (set! (-> this use-camera-startup? s5-0) #t) ) (else - (set! (-> obj use-camera-startup? s5-0) #f) + (set! (-> this use-camera-startup? s5-0) #f) ) ) ) ) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this sound-id) (new-sound-id)) (none) ) -(defmethod init-plat-collision! com-elevator ((obj com-elevator)) +(defmethod init-plat-collision! com-elevator ((this com-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -239,9 +239,9 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (com-elevator-method-49 obj #f) + (com-elevator-method-49 this #f) (none) ) @@ -281,7 +281,7 @@ For example for an elevator pre-compute the distance between the first and last ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -310,17 +310,17 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod deactivate tomb-trans-elevator ((obj tomb-trans-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 10)) obj) +(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) (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! tomb-trans-elevator ((obj tomb-trans-elevator)) +(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)) obj) - (set! (-> obj sound-id) (new-sound-id)) + ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 33)) this) + (set! (-> this sound-id) (new-sound-id)) (none) ) diff --git a/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc b/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc index 44a7a29473..4d61977556 100644 --- a/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc +++ b/goal_src/jak2/levels/common/entities/cty-guard-turret-button.gc @@ -24,10 +24,10 @@ ) -(defmethod basebutton-method-33 cty-guard-turret-button ((obj cty-guard-turret-button)) +(defmethod basebutton-method-33 cty-guard-turret-button ((this cty-guard-turret-button)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-guard-turret-button" (the-as (pointer uint32) #f)) @@ -36,23 +36,23 @@ ) (ja-channel-set! 1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) - (let ((s5-1 (-> obj skel root-channel 0))) + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) ) ) (else - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) @@ -64,9 +64,9 @@ ) ;; WARN: Return type mismatch collide-shape vs none. -(defmethod basebutton-method-34 cty-guard-turret-button ((obj cty-guard-turret-button)) +(defmethod basebutton-method-34 cty-guard-turret-button ((this cty-guard-turret-button)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) @@ -95,16 +95,16 @@ (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod prepare-trigger-event! cty-guard-turret-button ((obj cty-guard-turret-button)) +(defmethod prepare-trigger-event! cty-guard-turret-button ((this cty-guard-turret-button)) "Sets `event-going-down` to `'trigger`" - (logior! (-> obj button-status) (button-status button-status-4)) - (set! (-> obj event-going-down) 'trigger) + (logior! (-> this button-status) (button-status button-status-4)) + (set! (-> this event-going-down) 'trigger) (none) ) @@ -124,21 +124,21 @@ ) ) -(defmethod idle-state-transition cty-guard-turret-button ((obj cty-guard-turret-button)) +(defmethod idle-state-transition cty-guard-turret-button ((this cty-guard-turret-button)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" - (setup-masks (-> obj draw) 0 -1) + (setup-masks (-> this draw) 0 -1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) + ((logtest? (-> this button-status) (button-status pressed)) (format #t "off~%") - (setup-masks (-> obj draw) 4 0) - (setup-masks (-> obj draw) 1 0) - (go (method-of-object obj down-idle)) + (setup-masks (-> this draw) 4 0) + (setup-masks (-> this draw) 1 0) + (go (method-of-object this down-idle)) ) (else (format #t "on~%") - (setup-masks (-> obj draw) 4 0) - (setup-masks (-> obj draw) 2 0) - (go (method-of-object obj pop-up)) + (setup-masks (-> this draw) 4 0) + (setup-masks (-> this draw) 2 0) + (go (method-of-object this pop-up)) ) ) ) diff --git a/goal_src/jak2/levels/common/entities/fort-floor-spike.gc b/goal_src/jak2/levels/common/entities/fort-floor-spike.gc index 3ec6525341..42675b664e 100644 --- a/goal_src/jak2/levels/common/entities/fort-floor-spike.gc +++ b/goal_src/jak2/levels/common/entities/fort-floor-spike.gc @@ -65,20 +65,20 @@ (none) ) -(defmethod init-spike-joints! fort-floor-spike ((obj fort-floor-spike)) +(defmethod init-spike-joints! fort-floor-spike ((this fort-floor-spike)) "Initializes the skeleton and joints for the spike" 0 (none) ) ;; WARN: Return type mismatch int vs collide-shape-moving. -(defmethod init-spike-collision! fort-floor-spike ((obj fort-floor-spike)) +(defmethod init-spike-collision! fort-floor-spike ((this fort-floor-spike)) "Initializes the collision for the particular spike" (the-as collide-shape-moving 0) ) ;; WARN: Return type mismatch int vs symbol. -(defmethod init-periodic-animation! fort-floor-spike ((obj fort-floor-spike)) +(defmethod init-periodic-animation! fort-floor-spike ((this fort-floor-spike)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (the-as symbol 0) ) @@ -168,32 +168,32 @@ ) ;; WARN: Return type mismatch process-drawable vs fort-floor-spike. -(defmethod relocate fort-floor-spike ((obj fort-floor-spike) (arg0 int)) - (if (nonzero? (-> obj spike-row)) - (&+! (-> obj spike-row) arg0) +(defmethod relocate fort-floor-spike ((this fort-floor-spike) (arg0 int)) + (if (nonzero? (-> this spike-row)) + (&+! (-> this spike-row) arg0) ) - (the-as fort-floor-spike ((method-of-type process-drawable relocate) obj arg0)) + (the-as fort-floor-spike ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-floor-spike ((obj fort-floor-spike) (arg0 entity-actor)) +(defmethod init-from-entity! fort-floor-spike ((this fort-floor-spike) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-spike-collision! obj) - (process-drawable-from-entity! obj arg0) - (init-spike-joints! obj) - (init-periodic-animation! obj) + (init-spike-collision! this) + (process-drawable-from-entity! this arg0) + (init-spike-joints! this) + (init-periodic-animation! this) (let* ((v1-6 *game-info*) (a0-6 (+ (-> v1-6 attack-id) 1)) ) (set! (-> v1-6 attack-id) a0-6) - (set! (-> obj attack-id) (the-as int a0-6)) + (set! (-> this attack-id) (the-as int a0-6)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -227,19 +227,19 @@ This commonly includes things such as: ) -(defmethod init-spike-joints! fort-floor-spike-a ((obj fort-floor-spike-a)) +(defmethod init-spike-joints! fort-floor-spike-a ((this fort-floor-spike-a)) "Initializes the skeleton and joints for the spike" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-floor-spike-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-3 frame-num) 0.0) (joint-control-channel-group-eval! a0-3 - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) ) @@ -247,10 +247,10 @@ This commonly includes things such as: (none) ) -(defmethod init-spike-collision! fort-floor-spike-a ((obj fort-floor-spike-a)) +(defmethod init-spike-collision! fort-floor-spike-a ((this fort-floor-spike-a)) "Initializes the collision for the particular spike" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -296,37 +296,37 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) -(defmethod init-periodic-animation! fort-floor-spike-a ((obj fort-floor-spike-a)) +(defmethod init-periodic-animation! fort-floor-spike-a ((this fort-floor-spike-a)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 2) (s4-0 4) ) - (set! (-> obj spike-dim 0) s5-0) - (set! (-> obj spike-dim 1) s4-0) - (set! (-> obj spike-row) (new 'process 'spike-row-info-array s5-0)) - (set! (-> obj pos-table) (new 'static 'inline-array vector 8 - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - ) + (set! (-> this spike-dim 0) s5-0) + (set! (-> this spike-dim 1) s4-0) + (set! (-> this spike-row) (new 'process 'spike-row-info-array s5-0)) + (set! (-> this pos-table) (new 'static 'inline-array vector 8 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) ) - (let ((s3-0 (-> obj pos-table)) + (let ((s3-0 (-> this pos-table)) (s2-0 4) (s1-0 11) ) (dotimes (s0-0 (+ (- 1 s2-0) s1-0)) - (set! sv-64 (-> obj node-list data (+ s2-0 s0-0))) + (set! sv-64 (-> this node-list data (+ s2-0 s0-0))) (vector<-cspace! (-> s3-0 s0-0) sv-64) (set! (-> s3-0 s0-0 y) 0.0) (set! (-> sv-64 param0) joint-mod-set-y-callback) @@ -335,7 +335,7 @@ This commonly includes things such as: ) ) (dotimes (s3-1 s5-0) - (let ((s2-1 (-> obj spike-row data s3-1))) + (let ((s2-1 (-> this spike-row data s3-1))) (let ((a1-2 (new 'stack-no-clear 'sync-info-params))) (let ((v1-19 0)) (if #t @@ -353,7 +353,7 @@ This commonly includes things such as: ) (set! (-> s2-1 on-ratio) 0.375) (set! (-> s2-1 state) 0) - (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> obj pos-table (* s3-1 s4-0)))) + (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> this pos-table (* s3-1 s4-0)))) ) ) ) @@ -369,19 +369,19 @@ This commonly includes things such as: ) -(defmethod init-spike-joints! fort-floor-spike-b ((obj fort-floor-spike-b)) +(defmethod init-spike-joints! fort-floor-spike-b ((this fort-floor-spike-b)) "Initializes the skeleton and joints for the spike" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-floor-spike-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-3 frame-num) 0.0) (joint-control-channel-group-eval! a0-3 - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) ) @@ -389,10 +389,10 @@ This commonly includes things such as: (none) ) -(defmethod init-spike-collision! fort-floor-spike-b ((obj fort-floor-spike-b)) +(defmethod init-spike-collision! fort-floor-spike-b ((this fort-floor-spike-b)) "Initializes the collision for the particular spike" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -449,39 +449,39 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) -(defmethod init-periodic-animation! fort-floor-spike-b ((obj fort-floor-spike-b)) +(defmethod init-periodic-animation! fort-floor-spike-b ((this fort-floor-spike-b)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 2) (s4-0 5) ) - (set! (-> obj spike-dim 0) s5-0) - (set! (-> obj spike-dim 1) s4-0) - (set! (-> obj spike-row) (new 'process 'spike-row-info-array s5-0)) - (set! (-> obj pos-table) (new 'static 'inline-array vector 10 - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - ) + (set! (-> this spike-dim 0) s5-0) + (set! (-> this spike-dim 1) s4-0) + (set! (-> this spike-row) (new 'process 'spike-row-info-array s5-0)) + (set! (-> this pos-table) (new 'static 'inline-array vector 10 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) ) - (let ((s3-0 (-> obj pos-table)) + (let ((s3-0 (-> this pos-table)) (s2-0 4) (s1-0 13) ) (dotimes (s0-0 (+ (- 1 s2-0) s1-0)) - (set! sv-64 (-> obj node-list data (+ s2-0 s0-0))) + (set! sv-64 (-> this node-list data (+ s2-0 s0-0))) (vector<-cspace! (-> s3-0 s0-0) sv-64) (set! (-> s3-0 s0-0 y) 0.0) (set! (-> sv-64 param0) joint-mod-set-y-callback) @@ -490,7 +490,7 @@ This commonly includes things such as: ) ) (dotimes (s3-1 s5-0) - (let ((s2-1 (-> obj spike-row data s3-1))) + (let ((s2-1 (-> this spike-row data s3-1))) (let ((a1-2 (new 'stack-no-clear 'sync-info-params))) (let ((v1-19 0)) (if #t @@ -508,7 +508,7 @@ This commonly includes things such as: ) (set! (-> s2-1 on-ratio) 0.375) (set! (-> s2-1 state) 0) - (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> obj pos-table (* s3-1 s4-0)))) + (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> this pos-table (* s3-1 s4-0)))) ) ) ) @@ -524,19 +524,19 @@ This commonly includes things such as: ) -(defmethod init-spike-joints! fort-floor-spike-c ((obj fort-floor-spike-c)) +(defmethod init-spike-joints! fort-floor-spike-c ((this fort-floor-spike-c)) "Initializes the skeleton and joints for the spike" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-floor-spike-c" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((channel (-> obj skel root-channel 0))) - (set! (-> channel frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((channel (-> this skel root-channel 0))) + (set! (-> channel frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> channel frame-num) 0.0) (joint-control-channel-group-eval! channel - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) ) @@ -544,10 +544,10 @@ This commonly includes things such as: (none) ) -(defmethod init-spike-collision! fort-floor-spike-c ((obj fort-floor-spike-c)) +(defmethod init-spike-collision! fort-floor-spike-c ((this fort-floor-spike-c)) "Initializes the collision for the particular spike" (local-vars (prim-mesh collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) - (let ((cshape-moving (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape-moving dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape-moving reaction) cshape-reaction-default) (set! (-> cshape-moving no-reaction) @@ -609,44 +609,44 @@ This commonly includes things such as: (set! (-> cshape-moving backup-collide-with) (-> root-prim prim-core collide-with)) ) (set! (-> cshape-moving event-self) 'touched) - (set! (-> obj root) cshape-moving) + (set! (-> this root) cshape-moving) cshape-moving ) ) -(defmethod init-periodic-animation! fort-floor-spike-c ((obj fort-floor-spike-c)) +(defmethod init-periodic-animation! fort-floor-spike-c ((this fort-floor-spike-c)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 3) (s4-0 5) ) - (set! (-> obj spike-dim 0) s5-0) - (set! (-> obj spike-dim 1) s4-0) - (set! (-> obj spike-row) (new 'process 'spike-row-info-array s5-0)) - (set! (-> obj pos-table) (new 'static 'inline-array vector 15 - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - ) + (set! (-> this spike-dim 0) s5-0) + (set! (-> this spike-dim 1) s4-0) + (set! (-> this spike-row) (new 'process 'spike-row-info-array s5-0)) + (set! (-> this pos-table) (new 'static 'inline-array vector 15 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) ) - (let ((s3-0 (-> obj pos-table)) + (let ((s3-0 (-> this pos-table)) (s2-0 4) (s1-0 18) ) (dotimes (s0-0 (+ (- 1 s2-0) s1-0)) - (set! sv-64 (-> obj node-list data (+ s2-0 s0-0))) + (set! sv-64 (-> this node-list data (+ s2-0 s0-0))) (vector<-cspace! (-> s3-0 s0-0) sv-64) (set! (-> s3-0 s0-0 y) 0.0) (set! (-> sv-64 param0) joint-mod-set-y-callback) @@ -655,7 +655,7 @@ This commonly includes things such as: ) ) (dotimes (s3-1 s5-0) - (let ((s2-1 (-> obj spike-row data s3-1))) + (let ((s2-1 (-> this spike-row data s3-1))) (let ((a1-2 (new 'stack-no-clear 'sync-info-params))) (let ((v1-19 0)) (if #t @@ -673,7 +673,7 @@ This commonly includes things such as: ) (set! (-> s2-1 on-ratio) 0.375) (set! (-> s2-1 state) 0) - (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> obj pos-table (* s3-1 s4-0)))) + (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> this pos-table (* s3-1 s4-0)))) ) ) ) diff --git a/goal_src/jak2/levels/common/entities/gun-buoy.gc b/goal_src/jak2/levels/common/entities/gun-buoy.gc index e231158e3a..90b903245c 100644 --- a/goal_src/jak2/levels/common/entities/gun-buoy.gc +++ b/goal_src/jak2/levels/common/entities/gun-buoy.gc @@ -34,7 +34,7 @@ ) -(defmethod play-impact-sound gun-buoy-shot ((obj gun-buoy-shot) (arg0 projectile-options)) +(defmethod play-impact-sound gun-buoy-shot ((this gun-buoy-shot) (arg0 projectile-options)) (if (zero? arg0) (sound-play "buoy-shot") ) @@ -116,9 +116,9 @@ ) ) -(defmethod init-proj-collision! gun-buoy-shot ((obj gun-buoy-shot)) +(defmethod init-proj-collision! gun-buoy-shot ((this gun-buoy-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -154,26 +154,26 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 (none) ) -(defmethod init-proj-settings! gun-buoy-shot ((obj gun-buoy-shot)) +(defmethod init-proj-settings! gun-buoy-shot ((this gun-buoy-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj hit-actor?) #f) - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'explode) - (set! (-> obj max-speed) 737280.0) - (set! (-> obj move) gun-buoy-shot-move) - (set! (-> obj timeout) (seconds 2.78)) - (set! (-> obj damage) 1024.0) - (logior! (-> obj options) (projectile-options deal-damage ignore-impact)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'explode) + (set! (-> this max-speed) 737280.0) + (set! (-> this move) gun-buoy-shot-move) + (set! (-> this timeout) (seconds 2.78)) + (set! (-> this damage) 1024.0) + (logior! (-> this options) (projectile-options deal-damage ignore-impact)) + (set-gravity-length (-> this root dynam) 573440.0) (none) ) @@ -414,7 +414,7 @@ (logclear! (-> self flags) (gun-buoy-flags gubflags-2)) ) :trans (behavior () - (when (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (when (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (< 2 (the-as int (-> self focus aware))) (-> *setting-control* user-current gun-buoy) ) @@ -633,7 +633,7 @@ (defstate stare-down (gun-buoy) :virtual #t :enter (behavior () - (set! (-> self stare-down-timer) (current-time)) + (set-time! (-> self stare-down-timer)) ) :trans (behavior () (let ((v1-0 (-> self focus aware))) @@ -643,7 +643,7 @@ ) ((or (< (the-as int v1-0) 2) (not (-> *setting-control* user-current gun-buoy)) - (>= (- (current-time) (-> self stare-down-timer)) (seconds 6)) + (time-elapsed? (-> self stare-down-timer) (seconds 6)) ) (go-virtual exit-ambush) ) @@ -702,7 +702,7 @@ ) ) ) - (set! (-> self warning-timer) (current-time)) + (set-time! (-> self warning-timer)) (set! (-> self warning-id) (sound-play "buoy-alarm")) ) :exit (behavior () @@ -713,7 +713,7 @@ ) :trans (behavior () (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self warning-timer)) (-> self warning-interval)) + (when (time-elapsed? (-> self warning-timer) (-> self warning-interval)) (cond ((>= (the-as int gp-0) 3) (logior! (-> self flags) (gun-buoy-flags gubflags-1)) @@ -772,7 +772,7 @@ 0 ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (let ((v1-3 (-> self focus aware))) (cond ((= v1-3 (enemy-aware enemy-aware-2)) @@ -833,7 +833,7 @@ ) ) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) (seconds 0.75)) + (until (time-elapsed? s5-1 (seconds 0.75)) (suspend) ) ) @@ -863,7 +863,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 2)) + (until (time-elapsed? gp-0 (seconds 2)) (suspend) ) ) @@ -879,7 +879,7 @@ ) ) -(defmethod general-event-handler gun-buoy ((obj gun-buoy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler gun-buoy ((this gun-buoy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -887,17 +887,17 @@ #f ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod track-target! gun-buoy ((obj gun-buoy)) +(defmethod track-target! gun-buoy ((this gun-buoy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (-> obj root) + (-> this root) (let* ((s4-0 *target*) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -912,8 +912,8 @@ 1.0 ) ) - (f28-0 (-> obj offset-y-angular)) - (s4-2 (-> obj offset-from-player)) + (f28-0 (-> this offset-y-angular)) + (s4-2 (-> this offset-from-player)) (s3-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-2 1.0)) (f30-0 (vector-y-angle s3-1)) (f0-0 (vector-y-angle s2-1)) @@ -922,26 +922,26 @@ (vector-rotate-y! s3-1 s3-1 f30-1) (vector-normalize! s3-1 (vector-length s4-2)) (set! (-> s4-2 quad) (-> s3-1 quad)) - (set! (-> obj offset-y-angular) f30-1) + (set! (-> this offset-y-angular) f30-1) ) (let* ((f30-2 1.1) (v1-10 (get-transv s5-0)) (f30-3 (* f30-2 (sqrtf (+ (* (-> v1-10 x) (-> v1-10 x)) (* (-> v1-10 z) (-> v1-10 z)))))) - (f0-8 (vector-length (vector-! (new 'stack-no-clear 'vector) (get-trans s5-0 0) (-> obj root trans)))) + (f0-8 (vector-length (vector-! (new 'stack-no-clear 'vector) (get-trans s5-0 0) (-> this root trans)))) (f0-10 (fabs (+ -81920.0 f0-8))) - (f1-7 (-> obj nav target-speed)) + (f1-7 (-> this nav target-speed)) (f0-11 (fmax f30-3 f0-10)) ) - (set! (-> obj nav target-speed) (if (< f1-7 f0-11) - (seek f1-7 f0-11 (* 163840.0 (seconds-per-frame))) - (seek f1-7 f0-11 (* 143360.0 (seconds-per-frame))) - ) + (set! (-> this nav target-speed) (if (< f1-7 f0-11) + (seek f1-7 f0-11 (* 163840.0 (seconds-per-frame))) + (seek f1-7 f0-11 (* 143360.0 (seconds-per-frame))) + ) ) ) 0 ) (else - (let ((v1-26 (-> obj nav))) + (let ((v1-26 (-> this nav))) (set! (-> v1-26 target-speed) 0.0) ) 0 @@ -952,32 +952,32 @@ (let ((v1-30 (current-time)) (f0-18 4.83) ) - (set! (-> obj y-bob) + (set! (-> this y-bob) (* 1228.8 (cos (* 65536.0 (/ (the float (mod v1-30 (the int (* 300.0 f0-18)))) (* 300.0 f0-18))))) ) ) - (water-control-method-10 (-> obj water)) - (update-trans! (-> obj sound) (-> obj root trans)) - (update! (-> obj sound)) - ((method-of-type nav-enemy track-target!) obj) + (water-control-method-10 (-> this water)) + (update-trans! (-> this sound) (-> this root trans)) + (update! (-> this sound)) + ((method-of-type nav-enemy track-target!) this) 0 (none) ) -(defmethod go-hostile gun-buoy ((obj gun-buoy)) - (if (logtest? (-> obj flags) (gun-buoy-flags gubflags-1)) - (go (method-of-object obj hostile)) - (go (method-of-object obj warning)) +(defmethod go-hostile gun-buoy ((this gun-buoy)) + (if (logtest? (-> this flags) (gun-buoy-flags gubflags-1)) + (go (method-of-object this hostile)) + (go (method-of-object this warning)) ) ) -(defmethod enemy-method-61 gun-buoy ((obj gun-buoy) (arg0 int)) +(defmethod enemy-method-61 gun-buoy ((this gun-buoy) (arg0 int)) arg0 ) ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 40. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod in-aggro-range? gun-buoy ((obj gun-buoy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? gun-buoy ((this gun-buoy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -990,13 +990,13 @@ (the-as symbol (when arg1 - (let ((s4-0 (-> obj root)) + (let ((s4-0 (-> this root)) (f30-0 (-> arg1 y)) - (f28-0 (-> obj root trans y)) + (f28-0 (-> this root trans y)) ) - (-> obj fact) + (-> this fact) (let ((v1-10 - (or (not (and (-> obj next-state) (= (-> obj next-state name) 'dormant-aware))) + (or (not (and (-> this next-state) (= (-> this next-state name) 'dormant-aware))) (let ((s2-0 arg0)) (cond ((if (type? s2-0 target) @@ -1020,7 +1020,7 @@ ) (and v1-10 (begin - (set! f30-1 (-> obj enemy-info notice-nav-radius)) + (set! f30-1 (-> this enemy-info notice-nav-radius)) (set! v1-19 (if (type? arg0 target) arg0 ) @@ -1034,7 +1034,7 @@ ) (let ((f0-2 f30-1)) (or (>= (* f0-2 f0-2) (vector-vector-xz-distance-squared (-> s4-0 trans) arg1)) - (is-in-mesh? (-> obj nav) arg1 f30-1) + (is-in-mesh? (-> this nav) arg1 f30-1) ) ) ) @@ -1046,20 +1046,20 @@ ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod gun-buoy-method-183 gun-buoy ((obj gun-buoy) (arg0 process-focusable)) - (let ((s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8))) - (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 10))) +(defmethod gun-buoy-method-183 gun-buoy ((this gun-buoy) (arg0 process-focusable)) + (let ((s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8))) + (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 10))) (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans arg0 0) quad)) (+! (-> s5-0 y) 8192.0) - (set! (-> s4-0 ent) (-> obj entity)) + (set! (-> s4-0 ent) (-> this entity)) (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options)) (set! (-> s4-0 notify-handle) (the-as handle #f)) (set! (-> s4-0 owner-handle) (the-as handle #f)) - (set! (-> s4-0 ignore-handle) (process->handle obj)) + (set! (-> s4-0 ignore-handle) (process->handle this)) (let* ((v1-11 *game-info*) (a0-9 (+ (-> v1-11 attack-id) 1)) ) @@ -1070,17 +1070,17 @@ (set! (-> s4-0 pos quad) (-> s2-0 quad)) (vector-! (-> s4-0 vel) s5-0 (-> s4-0 pos)) (vector-normalize! (-> s4-0 vel) 737280.0) - (spawn-projectile gun-buoy-shot s4-0 obj *default-dead-pool*) + (spawn-projectile gun-buoy-shot s4-0 this *default-dead-pool*) (set! (-> s4-0 pos quad) (-> s3-0 quad)) (vector-! (-> s4-0 vel) s5-0 (-> s4-0 pos)) ) (vector-normalize! (-> s4-0 vel) 737280.0) - (spawn-projectile gun-buoy-shot s4-0 obj *default-dead-pool*) + (spawn-projectile gun-buoy-shot s4-0 this *default-dead-pool*) ) (none) ) -(defmethod nav-enemy-method-142 gun-buoy ((obj gun-buoy) (arg0 nav-control)) +(defmethod nav-enemy-method-142 gun-buoy ((this gun-buoy) (arg0 nav-control)) (local-vars (a0-19 int) (a0-21 int)) (let* ((v1-1 (-> *perf-stats* data 33)) (a0-1 (-> v1-1 ctrl)) @@ -1100,11 +1100,11 @@ (.sync.p) (label cfg-2) 0 - (forward-up-nopitch->quaternion (-> obj root quat) (-> obj aim-dir) *y-vector*) - (seek! (-> obj elev-angle) (- (vector-x-angle (-> obj aim-dir))) (* 10922.667 (seconds-per-frame))) + (forward-up-nopitch->quaternion (-> this root quat) (-> this aim-dir) *y-vector*) + (seek! (-> this elev-angle) (- (vector-x-angle (-> this aim-dir))) (* 10922.667 (seconds-per-frame))) (let* ((s5-1 (new 'stack-no-clear 'quaternion)) - (s4-1 (-> obj root quat)) - (f1-1 (-> obj elev-angle)) + (s4-1 (-> this root quat)) + (f1-1 (-> this elev-angle)) (f0-7 (fmax -728.1778 (fmin 728.1778 f1-1))) (f1-2 (- f1-1 f0-7)) (f2-3 (* 0.2 f1-2)) @@ -1112,16 +1112,16 @@ ) (quaternion-vector-angle! s5-1 *x-vector* f2-3) (quaternion-normalize! (quaternion*! s4-1 s4-1 s5-1)) - (quaternion-vector-angle! (the-as quaternion (-> obj gun-elev-jmod target)) *x-vector* f30-0) + (quaternion-vector-angle! (the-as quaternion (-> this gun-elev-jmod target)) *x-vector* f30-0) ) - (let* ((s2-0 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> obj root transv) (-> obj root quat))) + (let* ((s2-0 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> this root transv) (-> this root quat))) (v1-15 (vector-normalize-copy! (new 'stack-no-clear 'vector) s2-0 1.0)) (s3-1 (new 'stack-no-clear 'vector)) ) 0.0 (let ((s5-2 (new 'stack-no-clear 'quaternion)) - (s4-2 (-> obj root quat)) - (gp-1 (-> obj banking-quat)) + (s4-2 (-> this root quat)) + (gp-1 (-> this banking-quat)) ) (vector-normalize! (vector-cross! s3-1 v1-15 *y-vector*) 1.0) (let ((f0-9 (lerp-scale 0.0 1638.4 (vector-length s2-0) 0.0 81920.0))) @@ -1148,17 +1148,17 @@ ) ;; WARN: Return type mismatch nav-enemy vs gun-buoy. -(defmethod relocate gun-buoy ((obj gun-buoy) (arg0 int)) - (if (nonzero? (-> obj gun-elev-jmod)) - (&+! (-> obj gun-elev-jmod) arg0) +(defmethod relocate gun-buoy ((this gun-buoy) (arg0 int)) + (if (nonzero? (-> this gun-elev-jmod)) + (&+! (-> this gun-elev-jmod) arg0) ) - (the-as gun-buoy ((method-of-type nav-enemy relocate) obj arg0)) + (the-as gun-buoy ((method-of-type nav-enemy relocate) this arg0)) ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! gun-buoy ((obj gun-buoy)) +(defmethod init-enemy-collision! gun-buoy ((this gun-buoy)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1205,27 +1205,27 @@ (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) -(defmethod init-enemy! gun-buoy ((obj gun-buoy)) +(defmethod init-enemy! gun-buoy ((this gun-buoy)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-buoy" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *gun-buoy-nav-enemy-info*) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj start-pos quad) (-> obj root trans quad)) - (set! (-> obj flags) (gun-buoy-flags)) - (set! (-> obj gun-elev-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local obj 6 #f))) - (quaternion-copy! (the-as quaternion (-> obj gun-elev-jmod target)) *unity-quaternion*) - (set! (-> obj water) (new 'process 'water-control obj 3 8192.0 8192.0 2048.0)) - (set! (-> obj water flags) + (init-enemy-behaviour-and-stats! this *gun-buoy-nav-enemy-info*) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this start-pos quad) (-> this root trans quad)) + (set! (-> this flags) (gun-buoy-flags)) + (set! (-> this gun-elev-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local this 6 #f))) + (quaternion-copy! (the-as quaternion (-> this gun-elev-jmod target)) *unity-quaternion*) + (set! (-> this water) (new 'process 'water-control this 3 8192.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags active use-ocean @@ -1238,25 +1238,25 @@ find-water ) ) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 24576.0) - (set! (-> obj water wake-size) 12288.0) - (quaternion-copy! (-> obj banking-quat) *unity-quaternion*) - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 24576.0) + (set! (-> this water wake-size) 12288.0) + (quaternion-copy! (-> this banking-quat) *unity-quaternion*) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (vector-z-quaternion! s5-1 (-> obj root quat)) - (set! (-> obj nav state heading quad) (-> s5-1 quad)) + (vector-z-quaternion! s5-1 (-> this root quat)) + (set! (-> this nav state heading quad) (-> s5-1 quad)) ) 0 - (vector-reset! (-> obj offset-from-player)) - (set! (-> obj offset-y-angular) 0.0) - (set! (-> obj elev-angle) 0.0) - (set-vector! (-> obj aim-dir) 0.0 0.0 1.0 0.0) - (set! (-> obj splash-timer) 0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "gun-buoy-steady" :fo-max 80) (-> obj root trans)) + (vector-reset! (-> this offset-from-player)) + (set! (-> this offset-y-angular) 0.0) + (set! (-> this elev-angle) 0.0) + (set-vector! (-> this aim-dir) 0.0 0.0 1.0 0.0) + (set! (-> this splash-timer) 0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "gun-buoy-steady" :fo-max 80) (-> this root trans)) ) - (update-vol! (-> obj sound) 0.0) - (set! (-> obj warning-id) (the-as sound-id -1)) + (update-vol! (-> this sound) 0.0) + (set! (-> this warning-id) (the-as sound-id -1)) (none) ) diff --git a/goal_src/jak2/levels/common/entities/spydroid.gc b/goal_src/jak2/levels/common/entities/spydroid.gc index 3cbea7f59a..f27ca182db 100644 --- a/goal_src/jak2/levels/common/entities/spydroid.gc +++ b/goal_src/jak2/levels/common/entities/spydroid.gc @@ -624,25 +624,25 @@ (set! (-> *spydroid-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod track-target! spydroid ((obj spydroid)) +(defmethod track-target! spydroid ((this spydroid)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (when (< (-> obj root scale x) 1.0) - (let ((f0-2 (fmin 1.0 (+ 0.025 (-> obj root scale x))))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (when (< (-> this root scale x) 1.0) + (let ((f0-2 (fmin 1.0 (+ 0.025 (-> this root scale x))))) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) ) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s5-0 (-> obj node-list data 12)) + (vector<-cspace! s5-0 (-> this node-list data 12)) (dotimes (s3-0 4) - (let ((a0-4 (-> obj lightning s3-0)) + (let ((a0-4 (-> this lightning s3-0)) (v1-12 s5-0) ) (set! (-> a0-4 state meet data 0 quad) (-> v1-12 quad)) @@ -650,28 +650,28 @@ (let ((v1-14 s3-0)) (cond ((zero? v1-14) - (vector<-cspace! s4-0 (-> obj node-list data 16)) + (vector<-cspace! s4-0 (-> this node-list data 16)) ) ((= v1-14 1) - (vector<-cspace! s4-0 (-> obj node-list data 20)) + (vector<-cspace! s4-0 (-> this node-list data 20)) ) ((= v1-14 2) - (vector<-cspace! s4-0 (-> obj node-list data 28)) + (vector<-cspace! s4-0 (-> this node-list data 28)) ) (else - (vector<-cspace! s4-0 (-> obj node-list data 24)) + (vector<-cspace! s4-0 (-> this node-list data 24)) ) ) ) - (let ((a0-13 (-> obj lightning s3-0)) + (let ((a0-13 (-> this lightning s3-0)) (v1-25 s4-0) ) (set! (-> a0-13 state meet data (+ (-> a0-13 state points-to-draw) -1) quad) (-> v1-25 quad)) ) - (when (not (and (-> obj next-state) (= (-> obj next-state name) 'die-falling))) - (case (-> obj lightning s3-0 state mode) + (when (not (and (-> this next-state) (= (-> this next-state name) 'die-falling))) + (case (-> this lightning s3-0 state mode) (((lightning-mode lm0) (lightning-mode lm3)) - (let ((v1-39 (-> obj lightning s3-0)) + (let ((v1-39 (-> this lightning s3-0)) (a0-19 1) ) (let ((a1-10 (!= a0-19 (-> v1-39 state mode)))) @@ -694,35 +694,35 @@ ) ) ) - (let ((f0-5 (quaternion-y-angle (-> obj root quat)))) - (set! (-> obj diff-angle) (- (-> obj old-y-deg) f0-5)) + (let ((f0-5 (quaternion-y-angle (-> this root quat)))) + (set! (-> this diff-angle) (- (-> this old-y-deg) f0-5)) (cond - ((< 32768.0 (-> obj diff-angle)) - (+! (-> obj diff-angle) -65536.0) + ((< 32768.0 (-> this diff-angle)) + (+! (-> this diff-angle) -65536.0) ) - ((< (-> obj diff-angle) -32768.0) - (+! (-> obj diff-angle) 65536.0) + ((< (-> this diff-angle) -32768.0) + (+! (-> this diff-angle) 65536.0) ) ) - (set! (-> obj old-y-deg) f0-5) + (set! (-> this old-y-deg) f0-5) ) - (set! (-> obj desire-turn) - (< (+ 0.5 (* 0.00024414062 (-> obj nav state speed))) (* 0.005493164 (fabs (-> obj diff-angle)))) + (set! (-> this desire-turn) + (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) ) - (if (and (< (-> obj root trans y) (+ -122880.0 (-> obj floor))) - (-> obj next-state) - (= (-> obj next-state name) 'jump) + (if (and (< (-> this root trans y) (+ -122880.0 (-> this floor))) + (-> this next-state) + (= (-> this next-state name) 'jump) ) - (deactivate obj) + (deactivate this) ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'jump)) - (spawn (-> obj part) (-> obj root trans)) + (if (and (-> this next-state) (= (-> this next-state name) 'jump)) + (spawn (-> this part) (-> this root trans)) ) 0 (none) ) -(defmethod general-event-handler spydroid ((obj spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler spydroid ((this spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-6 vector) (sv-144 vector)) @@ -734,7 +734,7 @@ (init-vf0-vector) (case arg2 (('touch 'bonk 'attack) - (set! sv-144 (the-as vector (send-event (ppointer->process (-> obj parent)) 'widow-get-center))) + (set! sv-144 (the-as vector (send-event (ppointer->process (-> this parent)) 'widow-get-center))) (let* ((s1-0 arg0) (s0-0 (if (type? s1-0 process-drawable) s1-0 @@ -748,7 +748,7 @@ (label cfg-15) (cond (v1-6 - (let ((v1-9 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) sv-144)) + (let ((v1-9 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) sv-144)) (s1-1 (new 'stack-no-clear 'vector)) ) (set! (-> s1-1 x) (- (-> v1-9 z))) @@ -756,7 +756,7 @@ (set! (-> s1-1 z) (-> v1-9 x)) (set! (-> s1-1 w) 1.0) (let ((v1-12 - (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-0) root trans) (-> obj root trans)) + (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-0) root trans) (-> this root trans)) ) ) (set! (-> s1-1 y) 0.0) @@ -800,16 +800,16 @@ (logtest? (penetrate dark-bomb) (-> (the-as attack-info v1-30) penetrate-using)) ) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('jump) - (set! (-> obj floor) (-> (the-as vector (-> arg3 param 1)) y)) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (set! (-> this floor) (-> (the-as vector (-> arg3 param 1)) y)) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -823,7 +823,7 @@ (t9-0) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy die-falling) trans))) @@ -831,7 +831,7 @@ (t9-0) ) ) - (if (< (- (current-time) (-> self state-time)) (seconds 2)) + (if (not (time-elapsed? (-> self state-time) (seconds 2))) (spawn (-> self explode-part) (-> self root trans)) ) ) @@ -873,7 +873,7 @@ (suspend) (ja-channel-set! 0) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1024,7 +1024,7 @@ ) ) (let ((a0-1 (handle->process (-> self focus handle)))) - (if (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (and a0-1 (let ((f0-0 (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-1) 0) (-> self root trans))) (f1-0 16384.0) @@ -1249,9 +1249,9 @@ ) ) -(defmethod init-enemy-collision! spydroid ((obj spydroid)) +(defmethod init-enemy-collision! spydroid ((this spydroid)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1289,50 +1289,50 @@ (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod coin-flip? spydroid ((obj spydroid)) +(defmethod coin-flip? spydroid ((this spydroid)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod deactivate spydroid ((obj spydroid)) - (if (nonzero? (-> obj explode-part)) - (kill-and-free-particles (-> obj explode-part)) +(defmethod deactivate spydroid ((this spydroid)) + (if (nonzero? (-> this explode-part)) + (kill-and-free-particles (-> this explode-part)) ) - ((the-as (function process-focusable none) (find-parent-method spydroid 10)) obj) + ((the-as (function process-focusable none) (find-parent-method spydroid 10)) this) (none) ) ;; WARN: Return type mismatch nav-enemy vs spydroid. -(defmethod relocate spydroid ((obj spydroid) (arg0 int)) +(defmethod relocate spydroid ((this spydroid) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj lightning v1-0)) - (&+! (-> obj lightning v1-0) arg0) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) arg0) ) ) - (when (nonzero? (-> obj explode-part)) - (if (nonzero? (-> obj explode-part)) - (&+! (-> obj explode-part) arg0) + (when (nonzero? (-> this explode-part)) + (if (nonzero? (-> this explode-part)) + (&+! (-> this explode-part) arg0) ) ) - (the-as spydroid ((method-of-type nav-enemy relocate) obj arg0)) + (the-as spydroid ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod init-enemy! spydroid ((obj spydroid)) +(defmethod init-enemy! spydroid ((this spydroid)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-spydroid" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *spydroid-nav-enemy-info*) + (init-enemy-behaviour-and-stats! this *spydroid-nav-enemy-info*) (dotimes (s5-1 4) - (set! (-> obj lightning s5-1) + (set! (-> this lightning s5-1) (new 'process 'lightning-control @@ -1354,11 +1354,11 @@ :duration -1.0 :sound #f ) - obj + this 0.0 ) ) - (let ((v1-10 (-> obj lightning s5-1)) + (let ((v1-10 (-> this lightning s5-1)) (a0-5 0) ) (let ((a1-5 (!= a0-5 (-> v1-10 state mode)))) @@ -1377,36 +1377,50 @@ (set! (-> v1-10 state mode) (the-as lightning-mode a0-5)) ) ) - (let ((v1-13 (-> obj neck))) + (let ((v1-13 (-> this neck))) (set! (-> v1-13 up) (the-as uint 1)) (set! (-> v1-13 nose) (the-as uint 2)) (set! (-> v1-13 ear) (the-as uint 0)) (set-vector! (-> v1-13 twist-max) 3640.889 11832.889 0.0 1.0) (set! (-> v1-13 ignore-angle) 15473.777) ) - (set-vector! (-> obj root scale) 0.5 0.5 0.5 1.0) - (let ((v1-17 (-> obj nav))) + (set-vector! (-> this root scale) 0.5 0.5 0.5 1.0) + (let ((v1-17 (-> this nav))) (set! (-> v1-17 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 709) obj)) - (set! (-> obj explode-part) (create-launch-control (-> *part-group-id-table* 710) obj)) - (add-connection *part-engine* obj 8 obj 3183 (new 'static 'vector :x -204.8 :y 122.88 :z 1720.32 :w 163840.0)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 709) this)) + (set! (-> this explode-part) (create-launch-control (-> *part-group-id-table* 710) this)) (add-connection *part-engine* - obj + this + 8 + this + 3183 + (new 'static 'vector :x -204.8 :y 122.88 :z 1720.32 :w 163840.0) + ) + (add-connection + *part-engine* + this 10 - obj + this 3183 (new 'static 'vector :x -245.76 :y -122.88 :z 901.12 :w 163840.0) ) - (add-connection *part-engine* obj 4 obj 3184 (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 163840.0)) - (add-connection *part-engine* obj 6 obj 3185 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 6 obj 3186 (new 'static 'vector :w 163840.0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (add-connection + *part-engine* + this + 4 + this + 3184 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 163840.0) + ) + (add-connection *part-engine* this 6 this 3185 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 6 this 3186 (new 'static 'vector :w 163840.0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) 0 (none) ) diff --git a/goal_src/jak2/levels/common/guard-projectile.gc b/goal_src/jak2/levels/common/guard-projectile.gc index ea366b8c33..f56dc9733a 100644 --- a/goal_src/jak2/levels/common/guard-projectile.gc +++ b/goal_src/jak2/levels/common/guard-projectile.gc @@ -321,21 +321,21 @@ ) -(defmethod deal-damage! guard-shot ((obj guard-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! guard-shot ((this guard-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) - (when (t9-0 obj arg0 arg1) - (set! (-> obj hit-actor?) #t) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) #t ) ) ) -(defmethod draw-laser-sight guard-shot ((obj guard-shot)) +(defmethod draw-laser-sight guard-shot ((this guard-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 610) (-> obj tail-pos) (-> obj starting-dir) #f #t) - (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 2048.0)) - (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> obj tail-pos) a0-3)) + (draw-beam (-> *part-id-table* 610) (-> this tail-pos) (-> this starting-dir) #f #t) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) (t9-2 sp-launch-particles-var) (a0-4 *sp-particle-system-2d*) (a1-4 (-> *part-id-table* 611)) @@ -348,7 +348,7 @@ (none) ) -(defmethod spawn-impact-particles guard-shot ((obj guard-shot)) +(defmethod spawn-impact-particles guard-shot ((this guard-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -358,8 +358,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((gp-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) (f30-0 (vector-length s5-1)) ) @@ -405,16 +405,16 @@ ) ) -(defmethod spawn-shell-particles guard-shot ((obj guard-shot)) +(defmethod spawn-shell-particles guard-shot ((this guard-shot)) "TODO - confirm" - (let* ((s4-0 (-> obj root)) - (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s4-0 trans)) 2048.0)) + (let* ((s4-0 (-> this root)) + (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> s4-0 trans quad)) (vector+! gp-0 gp-0 v1-1) (cond - ((-> obj hit-actor?) + ((-> this hit-actor?) (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s5-1 (let ((t9-2 (method-of-type part-tracker activate))) @@ -494,7 +494,7 @@ (none) ) -(defmethod play-impact-sound guard-shot ((obj guard-shot) (arg0 projectile-options)) +(defmethod play-impact-sound guard-shot ((this guard-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -557,31 +557,31 @@ (none) ) -(defmethod made-impact? guard-shot ((obj guard-shot)) +(defmethod made-impact? guard-shot ((this guard-shot)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a0-1 t1-0)) (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a0-1 ignore-process0) obj) - (set! (-> a0-1 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) (set! (-> a0-1 action-mask) (collide-action solid)) ) (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) - (if (logtest? (-> obj root status) (collide-status touch-actor)) - (set! (-> obj hit-actor?) #t) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) ) #t ) ) ) -(defmethod init-proj-collision! guard-shot ((obj guard-shot)) +(defmethod init-proj-collision! guard-shot ((this guard-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -623,26 +623,26 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 (none) ) -(defmethod init-proj-settings! guard-shot ((obj guard-shot)) +(defmethod init-proj-settings! guard-shot ((this guard-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj hit-actor?) #f) - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'guard-shot) - (set! (-> obj max-speed) 819200.0) - (set! (-> obj move) guard-shot-move) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj timeout) (seconds 0.5)) - (logior! (-> obj options) (projectile-options account-for-target-velocity)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'guard-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) guard-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (logior! (-> this options) (projectile-options account-for-target-velocity)) + (set-gravity-length (-> this root dynam) 573440.0) (none) ) @@ -662,7 +662,7 @@ :texture-level 6 ) -(defmethod play-impact-sound vehicle-grenade ((obj vehicle-grenade) (arg0 projectile-options)) +(defmethod play-impact-sound vehicle-grenade ((this vehicle-grenade) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -677,9 +677,9 @@ (none) ) -(defmethod init-proj-collision! vehicle-grenade ((obj vehicle-grenade)) +(defmethod init-proj-collision! vehicle-grenade ((this vehicle-grenade)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-bounce-reaction) (set! (-> s5-0 no-reaction) @@ -699,66 +699,66 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (set-collide-with! - (-> obj root) + (-> this root) (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) ) - (set-collide-as! (-> obj root) (collide-spec enemy)) - (set! (-> obj root pat-ignore-mask) + (set-collide-as! (-> this root) (collide-spec enemy)) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) ) -(defmethod init-proj-settings! vehicle-grenade ((obj vehicle-grenade)) +(defmethod init-proj-settings! vehicle-grenade ((this vehicle-grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj attack-mode) 'eco-dark) + (set! (-> this attack-mode) 'eco-dark) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vehicle-grenade" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 138) obj)) - (set! (-> obj blast-radius) 16384.0) - (set! (-> obj max-speed) 90112.0) - (set! (-> obj timeout) (seconds 4)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 138) this)) + (set! (-> this blast-radius) 16384.0) + (set! (-> this max-speed) 90112.0) + (set! (-> this timeout) (seconds 4)) 0 (none) ) -(defmethod spawn-impact-particles vehicle-grenade ((obj vehicle-grenade)) +(defmethod spawn-impact-particles vehicle-grenade ((this vehicle-grenade)) "Spawns associated particles with the projectile if applicable" - (spawn (-> obj part) (-> obj root trans)) + (spawn (-> this part) (-> this root trans)) (ja-post) 0 (none) ) -(defmethod noop vehicle-grenade ((obj vehicle-grenade)) +(defmethod noop vehicle-grenade ((this vehicle-grenade)) "Does nothing" - (spawn (-> obj part) (-> obj root trans)) + (spawn (-> this part) (-> this root trans)) 0 (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound! vehicle-grenade ((obj vehicle-grenade)) +(defmethod play-impact-sound! vehicle-grenade ((this vehicle-grenade)) "Plays impact sound" - (let* ((a2-0 (-> obj root)) + (let* ((a2-0 (-> this root)) (v1-0 (-> a2-0 status)) ) (if (logtest? v1-0 (collide-status touch-surface)) (vector-float*! (-> a2-0 transv) (-> a2-0 transv) 0.2) ) (when (and (logtest? v1-0 (collide-status impact-surface)) - (>= (- (current-time) (-> obj played-bounce-time)) (seconds 0.3)) + (time-elapsed? (-> this played-bounce-time) (seconds 0.3)) ) - (set! (-> obj played-bounce-time) (current-time)) + (set-time! (-> this played-bounce-time)) (sound-play "grenade-bounce") ) ) @@ -900,20 +900,20 @@ ) ) -(defmethod made-impact? guard-lazer-shot ((obj guard-lazer-shot)) +(defmethod made-impact? guard-lazer-shot ((this guard-lazer-shot)) "TODO - queries the collision cache, return true/false" - (let ((gp-0 (-> obj root)) + (let ((gp-0 (-> this root)) (s5-0 (new 'stack-no-clear 'collide-query)) ) (let ((v1-0 s5-0)) (set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w)) (set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) - (set! (-> v1-0 ignore-process0) obj) - (set! (-> v1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> v1-0 ignore-process0) this) + (set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> v1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-0 action-mask) (collide-action solid)) ) - (let ((a0-2 (handle->process (-> obj notify-handle)))) + (let ((a0-2 (handle->process (-> this notify-handle)))) (when a0-2 (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans (the-as process-focusable a0-2) 3))) (f0-2 (- (vector-length s4-1))) @@ -934,9 +934,9 @@ (none) ) -(defmethod init-proj-collision! guard-lazer-shot ((obj guard-lazer-shot)) +(defmethod init-proj-collision! guard-lazer-shot ((this guard-lazer-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -972,24 +972,24 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 (none) ) -(defmethod init-proj-settings! guard-lazer-shot ((obj guard-lazer-shot)) +(defmethod init-proj-settings! guard-lazer-shot ((this guard-lazer-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj attack-mode) 'shock) - (set! (-> obj max-speed) 131072.0) - (set! (-> obj timeout) (seconds 0.125)) - (set! (-> obj move) guard-lazer-shot-move) - (set! (-> obj root dynam gravity y) 0.0) - (set! (-> obj root dynam gravity-length) 0.0) - (set! (-> obj root dynam gravity-max) 0.0) + (set! (-> this attack-mode) 'shock) + (set! (-> this max-speed) 131072.0) + (set! (-> this timeout) (seconds 0.125)) + (set! (-> this move) guard-lazer-shot-move) + (set! (-> this root dynam gravity y) 0.0) + (set! (-> this root dynam gravity-length) 0.0) + (set! (-> this root dynam gravity-max) 0.0) 0 (none) ) diff --git a/goal_src/jak2/levels/common/metalhead-projectile.gc b/goal_src/jak2/levels/common/metalhead-projectile.gc index 7c55385bcc..10ca964c3e 100644 --- a/goal_src/jak2/levels/common/metalhead-projectile.gc +++ b/goal_src/jak2/levels/common/metalhead-projectile.gc @@ -318,11 +318,11 @@ ) -(defmethod draw-laser-sight metalhead-shot ((obj metalhead-shot)) +(defmethod draw-laser-sight metalhead-shot ((this metalhead-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 624) (-> obj tail-pos) (-> obj starting-dir) #f #t) - (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 2048.0)) - (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> obj tail-pos) a0-3)) + (draw-beam (-> *part-id-table* 624) (-> this tail-pos) (-> this starting-dir) #f #t) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) (t9-2 sp-launch-particles-var) (a0-4 *sp-particle-system-2d*) (a1-4 (-> *part-id-table* 625)) @@ -335,7 +335,7 @@ (none) ) -(defmethod spawn-impact-particles metalhead-shot ((obj metalhead-shot)) +(defmethod spawn-impact-particles metalhead-shot ((this metalhead-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -345,8 +345,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((gp-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) (f30-0 (vector-length s5-1)) ) @@ -391,10 +391,10 @@ ) ) -(defmethod spawn-shell-particles metalhead-shot ((obj metalhead-shot)) +(defmethod spawn-shell-particles metalhead-shot ((this metalhead-shot)) "TODO - confirm" - (let* ((s5-0 (-> obj root)) - (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s5-0 trans)) 2048.0)) + (let* ((s5-0 (-> this root)) + (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> s5-0 trans quad)) @@ -440,16 +440,16 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound metalhead-shot ((obj metalhead-shot) (arg0 projectile-options)) +(defmethod play-impact-sound metalhead-shot ((this metalhead-shot) (arg0 projectile-options)) (with-pp (case arg0 (((projectile-options lose-altitude proj-options-2)) - (when (nonzero? (-> obj sound-id)) + (when (nonzero? (-> this sound-id)) (when *sound-player-enable* (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-0 command) (sound-command set-param)) - (set! (-> gp-0 id) (-> obj sound-id)) - (let ((a1-1 (-> obj root trans))) + (set! (-> gp-0 id) (-> this sound-id)) + (let ((a1-1 (-> this root trans))) (let ((s5-1 pp)) (when (= a1-1 #t) (if (and s5-1 (type? s5-1 process-drawable) (nonzero? (-> (the-as process-drawable s5-1) root))) @@ -491,9 +491,9 @@ (none) ) -(defmethod init-proj-collision! metalhead-shot ((obj metalhead-shot)) +(defmethod init-proj-collision! metalhead-shot ((this metalhead-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -535,22 +535,22 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) ) -(defmethod init-proj-settings! metalhead-shot ((obj metalhead-shot)) +(defmethod init-proj-settings! metalhead-shot ((this metalhead-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'metalhead-shot) - (set! (-> obj max-speed) 532480.0) - (set! (-> obj move) metalhead-shot-move) - (set! (-> obj timeout) (seconds 0.767)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'metalhead-shot) + (set! (-> this max-speed) 532480.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this timeout) (seconds 0.767)) + (set-gravity-length (-> this root dynam) 573440.0) (none) ) @@ -671,12 +671,12 @@ ) -(defmethod spawn-shell-particles metalhead-grenade-shot ((obj metalhead-grenade-shot)) +(defmethod spawn-shell-particles metalhead-grenade-shot ((this metalhead-grenade-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-1 (the-as part-tracker gp-0) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-2 run-function-in-process) (a0-3 gp-0) @@ -688,7 +688,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -707,13 +707,13 @@ (none) ) -(defmethod play-impact-sound metalhead-grenade-shot ((obj metalhead-grenade-shot) (arg0 projectile-options)) +(defmethod play-impact-sound metalhead-grenade-shot ((this metalhead-grenade-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "gren-shot-hit") ) (((projectile-options lose-altitude proj-options-2)) - (sound-play "gren-missile" :id (-> obj sound-id) :position (-> obj root trans)) + (sound-play "gren-missile" :id (-> this sound-id) :position (-> this root trans)) ) ) 0 @@ -800,9 +800,9 @@ ) ) -(defmethod spawn-impact-particles metalhead-grenade-shot ((obj metalhead-grenade-shot)) +(defmethod spawn-impact-particles metalhead-grenade-shot ((this metalhead-grenade-shot)) "Spawns associated particles with the projectile if applicable" - (spawn (-> obj part) (-> obj root trans)) + (spawn (-> this part) (-> this root trans)) 0 (none) ) @@ -843,9 +843,9 @@ (none) ) -(defmethod init-proj-collision! metalhead-grenade-shot ((obj metalhead-grenade-shot)) +(defmethod init-proj-collision! metalhead-grenade-shot ((this metalhead-grenade-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) gren-cshape-reaction-canister) @@ -871,31 +871,31 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-proj-settings! metalhead-grenade-shot ((obj metalhead-grenade-shot)) +(defmethod init-proj-settings! metalhead-grenade-shot ((this metalhead-grenade-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj blast-radius) 4096.0) - (set! (-> obj max-speed) 135168.0) - (set! (-> obj timeout) (seconds 4)) - (set! (-> obj update-velocity) projectile-update-velocity-add-gravity) - (set! (-> obj move) gren-canister-move) - (set! (-> obj root dynam gravity y) 102400.0) - (set! (-> obj root dynam gravity-length) 102400.0) - (set! (-> obj root dynam gravity-max) 102400.0) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this blast-radius) 4096.0) + (set! (-> this max-speed) 135168.0) + (set! (-> this timeout) (seconds 4)) + (set! (-> this update-velocity) projectile-update-velocity-add-gravity) + (set! (-> this move) gren-canister-move) + (set! (-> this root dynam gravity y) 102400.0) + (set! (-> this root dynam gravity-length) 102400.0) + (set! (-> this root dynam gravity-max) 102400.0) (let ((f0-5 1092.2667)) - (quaternion-axis-angle! (-> obj tumble-quat) 1.0 0.0 0.0 f0-5) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-5) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 143) obj)) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 143) this)) + (set! (-> this sound-id) (new-sound-id)) (none) ) diff --git a/goal_src/jak2/levels/common/race/race-hud.gc b/goal_src/jak2/levels/common/race/race-hud.gc index 064229a9ea..94d51649d5 100644 --- a/goal_src/jak2/levels/common/race/race-hud.gc +++ b/goal_src/jak2/levels/common/race/race-hud.gc @@ -7,107 +7,121 @@ ;; DECOMP BEGINS -(defmethod draw hud-race-timer ((obj hud-race-timer)) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 0 (the int (+ 20.0 (* -100.0 (-> obj offset))))) - (format (clear (-> obj strings 0 text)) "~2,'0D:" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) 60 5) - (format (clear (-> obj strings 1 text)) "~2,'0D:" (-> obj values 1 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj strings 0 pos)) 30 0) - (format (clear (-> obj strings 2 text)) "~2,'0D" (-> obj values 2 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 2 pos)) (the-as vector4w (-> obj strings 1 pos)) 28 0) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) 128 0) - ((method-of-type hud draw) obj) - 0 - (none) - ) - -(defmethod update-values hud-race-timer ((obj hud-race-timer)) - (set! (-> obj values 0 target) (/ (the-as int (-> *game-info* race-timer)) #x4650)) - (set! (-> obj values 1 target) (/ (mod (the-as int (-> *game-info* race-timer)) #x4650) 300)) - (set! (-> obj values 2 target) (/ (mod (mod (the-as int (-> *game-info* race-timer)) #x4650) 300) 5)) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) - 0 - (none) - ) - -(defmethod init-callback hud-race-timer ((obj hud-race-timer)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) - ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x22 :page #x679))) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.55) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color green)) - (alloc-string-if-needed obj 1) - (set! (-> obj strings 1 scale) 0.55) - (set! (-> obj strings 1 flags) (font-flags kerning middle large)) - (set! (-> obj strings 1 color) (font-color green)) - (alloc-string-if-needed obj 2) - (set! (-> obj strings 2 scale) 0.55) - (set! (-> obj strings 2 flags) (font-flags kerning middle large)) - (set! (-> obj strings 2 color) (font-color green)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x23 :page #x679))) - 0 - (none) - ) - -(defmethod draw hud-race-lap-counter ((obj hud-race-lap-counter)) +(defmethod draw hud-race-timer ((this hud-race-timer)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) + 0 + (the int (+ 20.0 (* -100.0 (-> this offset)))) + ) + (format (clear (-> this strings 0 text)) "~2,'0D:" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 60 5) + (format (clear (-> this strings 1 text)) "~2,'0D:" (-> this values 1 current)) + (set-as-offset-from! + (the-as hud-sprite (-> this strings 1 pos)) + (the-as vector4w (-> this strings 0 pos)) + 30 + 0 + ) + (format (clear (-> this strings 2 text)) "~2,'0D" (-> this values 2 current)) + (set-as-offset-from! + (the-as hud-sprite (-> this strings 2 pos)) + (the-as vector4w (-> this strings 1 pos)) + 28 + 0 + ) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 128 0) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values hud-race-timer ((this hud-race-timer)) + (set! (-> this values 0 target) (/ (the-as int (-> *game-info* race-timer)) #x4650)) + (set! (-> this values 1 target) (/ (mod (the-as int (-> *game-info* race-timer)) #x4650) 300)) + (set! (-> this values 2 target) (/ (mod (mod (the-as int (-> *game-info* race-timer)) #x4650) 300) 5)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) + 0 + (none) + ) + +(defmethod init-callback hud-race-timer ((this hud-race-timer)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x22 :page #x679))) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.55) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color green)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.55) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color green)) + (alloc-string-if-needed this 2) + (set! (-> this strings 2 scale) 0.55) + (set! (-> this strings 2 flags) (font-flags kerning middle large)) + (set! (-> this strings 2 color) (font-color green)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x23 :page #x679))) + 0 + (none) + ) + +(defmethod draw hud-race-lap-counter ((this hud-race-lap-counter)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) 504 - (the int (+ 20.0 (* -100.0 (-> obj offset)))) + (the int (+ 20.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj strings 0 scale) 0.55) - (format (clear (-> obj strings 0 text)) "~D/~D" (-> obj values 0 current) (-> obj values 1 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -40 5) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) -20 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) -50 0) - ((method-of-type hud draw) obj) + (set! (-> this strings 0 scale) 0.55) + (format (clear (-> this strings 0 text)) "~D/~D" (-> this values 0 current) (-> this values 1 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -40 5) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -20 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) -50 0) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-race-lap-counter ((obj hud-race-lap-counter)) - (set! (-> obj values 0 target) (-> *game-info* race-current-lap-count)) - (set! (-> obj values 1 target) (-> *game-info* race-total-lap-count)) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-race-lap-counter ((this hud-race-lap-counter)) + (set! (-> this values 0 target) (-> *game-info* race-current-lap-count)) + (set! (-> this values 1 target) (-> *game-info* race-total-lap-count)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-race-lap-counter ((obj hud-race-lap-counter)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-race-lap-counter ((this hud-race-lap-counter)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xe :page #x679))) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color green)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #x679))) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #x679))) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xe :page #x679))) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color green)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #x679))) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #x679))) 0 (none) ) -(defmethod draw hud-race-turbo-counter ((obj hud-race-turbo-counter)) +(defmethod draw hud-race-turbo-counter ((this hud-race-turbo-counter)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 224 - (the int (+ 25.0 (* -100.0 (-> obj offset)))) + (the int (+ 25.0 (* -100.0 (-> this offset)))) ) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 32 0) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 1)) 32 0) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 2)) 32 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 2)) 32 0) - (let* ((v1-2 (-> obj values 0 current)) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 32 0) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 1)) 32 0) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 2)) 32 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 2)) 32 0) + (let* ((v1-2 (-> this values 0 current)) (f0-3 (if (> v1-2 0) 1.0 0.0 @@ -124,67 +138,67 @@ ) ) ) - (set! (-> obj sprites 1 scale-x) f0-3) - (set! (-> obj sprites 1 scale-y) f0-3) - (set! (-> obj sprites 3 scale-x) f1-2) - (set! (-> obj sprites 3 scale-y) f1-2) - (set! (-> obj sprites 5 scale-x) f2-1) - (set! (-> obj sprites 5 scale-y) f2-1) + (set! (-> this sprites 1 scale-x) f0-3) + (set! (-> this sprites 1 scale-y) f0-3) + (set! (-> this sprites 3 scale-x) f1-2) + (set! (-> this sprites 3 scale-y) f1-2) + (set! (-> this sprites 5 scale-x) f2-1) + (set! (-> this sprites 5 scale-y) f2-1) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-race-turbo-counter ((obj hud-race-turbo-counter)) - (set! (-> obj values 0 target) (-> *game-info* race-number-turbos)) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-race-turbo-counter ((this hud-race-turbo-counter)) + (set! (-> this values 0 target) (-> *game-info* race-number-turbos)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-race-turbo-counter ((obj hud-race-turbo-counter)) - (set! (-> obj level) (level-get *level* 'stadium)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-center) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-race-turbo-counter ((this hud-race-turbo-counter)) + (set! (-> this level) (level-get *level* 'stadium)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) 0 (none) ) -(defmethod draw hud-race-position ((obj hud-race-position)) +(defmethod draw hud-race-position ((this hud-race-position)) (local-vars (s5-0 int)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 24 - (the int (+ 324.0 (* 100.0 (-> obj offset)))) + (the int (+ 324.0 (* 100.0 (-> this offset)))) ) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 7) (the-as vector4w (-> obj sprites)) 0 0) - (let ((v1-2 (-> obj values 0 current))) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 7) (the-as vector4w (-> this sprites)) 0 0) + (let ((v1-2 (-> this values 0 current))) (dotimes (a0-9 16) - (set! (-> obj sprites a0-9 scale-x) (if (= a0-9 v1-2) - 0.8 - 0.0 - ) + (set! (-> this sprites a0-9 scale-x) (if (= a0-9 v1-2) + 0.8 + 0.0 + ) ) - (set! (-> obj sprites a0-9 scale-y) (if (= a0-9 v1-2) - 0.8 - 0.0 - ) + (set! (-> this sprites a0-9 scale-y) (if (= a0-9 v1-2) + 0.8 + 0.0 + ) ) ) (cond @@ -206,8 +220,8 @@ ) ) (set-as-offset-from! - (-> obj sprites s5-0) - (the-as vector4w (-> obj sprites v1-2)) + (-> this sprites s5-0) + (the-as vector4w (-> this sprites v1-2)) (if (zero? v1-2) 28 52 @@ -215,43 +229,43 @@ 0 ) ) - (set! (-> obj sprites s5-0 scale-x) 0.8) - (set! (-> obj sprites s5-0 scale-y) 0.8) - ((method-of-type hud draw) obj) + (set! (-> this sprites s5-0 scale-x) 0.8) + (set! (-> this sprites s5-0 scale-y) 0.8) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-race-position ((obj hud-race-position)) - (set! (-> obj values 0 target) (-> *game-info* race-position)) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-race-position ((this hud-race-position)) + (set! (-> this values 0 target) (-> *game-info* race-position)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-race-position ((obj hud-race-position)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-race-position ((this hud-race-position)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x679))) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x13 :page #x679))) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x679))) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x15 :page #x679))) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x679))) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x17 :page #x679))) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x679))) - (set! (-> obj sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x19 :page #x679))) - (set! (-> obj sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x20 :page #x679))) - (set! (-> obj sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1d :page #x679))) - (set! (-> obj sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1f :page #x679))) - (set! (-> obj sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x21 :page #x679))) - (set! (-> obj sprites 12 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x679))) - (set! (-> obj sprites 13 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1b :page #x679))) - (set! (-> obj sprites 14 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x679))) - (set! (-> obj sprites 15 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1c :page #x679))) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x679))) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x13 :page #x679))) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x679))) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x15 :page #x679))) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x679))) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x17 :page #x679))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x679))) + (set! (-> this sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x19 :page #x679))) + (set! (-> this sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x20 :page #x679))) + (set! (-> this sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1d :page #x679))) + (set! (-> this sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1f :page #x679))) + (set! (-> this sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x21 :page #x679))) + (set! (-> this sprites 12 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x679))) + (set! (-> this sprites 13 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1b :page #x679))) + (set! (-> this sprites 14 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x679))) + (set! (-> this sprites 15 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1c :page #x679))) 0 (none) ) @@ -268,7 +282,7 @@ (/ (mod (mod arg0 #x4650) 300) 5) ) -(defmethod draw hud-race-final-stats ((obj hud-race-final-stats)) +(defmethod draw hud-race-final-stats ((this hud-race-final-stats)) (local-vars (s0-0 int) (sv-112 (function string font-context symbol int bucket-id float)) @@ -292,7 +306,7 @@ (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) ) ) - (set! (-> obj strings 0 scale) 0.0) + (set! (-> this strings 0 scale) 0.0) (set! (-> s1-0 origin x) 45.0) (set! (-> s1-0 origin y) 20.0) (let ((v1-15 s1-0)) @@ -352,14 +366,14 @@ ) ) ) - (set! (-> obj strings 1 scale) 0.5) + (set! (-> this strings 1 scale) 0.5) (set-hud-piece-position! - (the-as hud-sprite (-> obj strings 1 pos)) + (the-as hud-sprite (-> this strings 1 pos)) 128 - (the int (+ (- 188.0 (the float s0-0)) (* -100.0 (-> obj offset)))) + (the int (+ (- 188.0 (the float s0-0)) (* -100.0 (-> this offset)))) ) (let ((s1-1 format)) - (set! sv-144 (clear (-> obj strings 1 text))) + (set! sv-144 (clear (-> this strings 1 text))) (let* ((a0-29 *common-text*) (t9-7 (method-of-object a0-29 lookup-text!)) (a1-7 375) @@ -370,26 +384,26 @@ ) ) (set-hud-piece-position! - (the-as hud-sprite (-> obj strings 2 pos)) + (the-as hud-sprite (-> this strings 2 pos)) 384 - (the int (+ (- 188.0 (the float s0-0)) (* -100.0 (-> obj offset)))) + (the int (+ (- 188.0 (the float s0-0)) (* -100.0 (-> this offset)))) ) - (set! (-> obj strings 2 scale) 0.5) - (set! (-> obj strings 2 flags) (font-flags kerning right large)) - (print-time (clear (-> obj strings 2 text)) (the-as time-frame s2-0)) + (set! (-> this strings 2 scale) 0.5) + (set! (-> this strings 2 flags) (font-flags kerning right large)) + (print-time (clear (-> this strings 2 text)) (the-as time-frame s2-0)) (while (and (< 1 (-> s5-0 lap-count)) (< s3-0 (+ (* (-> s5-0 lap-count) 2) 2))) (let ((s2-1 (-> s5-0 lap-time-array (+ (- -1 s4-0) (-> s5-0 lap-count))))) - (set! (-> obj strings s3-0 scale) 0.5) - (set! (-> obj strings s3-0 flags) (font-flags kerning large)) - (set! (-> obj strings s3-0 color) (font-color white)) + (set! (-> this strings s3-0 scale) 0.5) + (set! (-> this strings s3-0 flags) (font-flags kerning large)) + (set! (-> this strings s3-0 color) (font-color white)) (set-as-offset-from! - (the-as hud-sprite (&+ (-> obj strings 0 pos) (* 48 s3-0))) - (the-as vector4w (-> obj strings 1 pos)) + (the-as hud-sprite (&+ (-> this strings 0 pos) (* 48 s3-0))) + (the-as vector4w (-> this strings 1 pos)) 5 (+ (* 28 s4-0) 40) ) (let ((s1-3 format) - (s0-1 (clear (-> obj strings s3-0 text))) + (s0-1 (clear (-> this strings s3-0 text))) ) (set! sv-160 "~S~D") (let ((a2-10 (lookup-text! *common-text* (text-id race-lap) #f)) @@ -399,16 +413,16 @@ ) ) (let ((s3-1 (+ s3-0 1))) - (set! (-> obj strings s3-1 scale) 0.5) - (set! (-> obj strings s3-1 flags) (font-flags kerning right large)) - (set! (-> obj strings s3-1 color) (font-color white)) + (set! (-> this strings s3-1 scale) 0.5) + (set! (-> this strings s3-1 flags) (font-flags kerning right large)) + (set! (-> this strings s3-1 color) (font-color white)) (set-as-offset-from! - (the-as hud-sprite (&+ (-> obj strings 0 pos) (* 48 s3-1))) - (the-as vector4w (-> obj strings 2 pos)) + (the-as hud-sprite (&+ (-> this strings 0 pos) (* 48 s3-1))) + (the-as vector4w (-> this strings 2 pos)) 0 (+ (* 28 s4-0) 40) ) - (print-time (clear (-> obj strings s3-1 text)) (the-as time-frame s2-1)) + (print-time (clear (-> this strings s3-1 text)) (the-as time-frame s2-1)) (+! s4-0 1) (set! s3-0 (+ s3-1 1)) ) @@ -417,33 +431,33 @@ ) ) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-race-final-stats ((obj hud-race-final-stats)) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-race-final-stats ((this hud-race-final-stats)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-race-final-stats ((obj hud-race-final-stats)) - (set! (-> obj level) (level-get *level* 'stadium)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-race-final-stats ((this hud-race-final-stats)) + (set! (-> this level) (level-get *level* 'stadium)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) + (logior! (-> this flags) (hud-flags show)) (dotimes (s5-0 14) - (alloc-string-if-needed obj s5-0) + (alloc-string-if-needed this s5-0) ) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color red)) - (set! (-> obj strings 1 flags) (font-flags kerning large)) - (set! (-> obj strings 1 color) (font-color white)) - (set! (-> obj strings 2 flags) (font-flags kerning large)) - (set! (-> obj strings 2 color) (font-color white)) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (set! (-> this strings 1 flags) (font-flags kerning large)) + (set! (-> this strings 1 color) (font-color white)) + (set! (-> this strings 2 flags) (font-flags kerning large)) + (set! (-> this strings 2 color) (font-color white)) 0 (none) ) diff --git a/goal_src/jak2/levels/common/race/race-info.gc b/goal_src/jak2/levels/common/race/race-info.gc index 51dcd71e28..bd77163203 100644 --- a/goal_src/jak2/levels/common/race/race-info.gc +++ b/goal_src/jak2/levels/common/race/race-info.gc @@ -61,7 +61,8 @@ ) :level 'stadiumb :borrow-level 'lracebf - :borrow '((stadiumb 0 lracebf special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((stadiumb 0 lracebf special) (stadium 0 lracelit display)) :manager-handle-init-hack #f :hatch-actor-name "stdmb-race-hatch-2" :countdown-scene #f @@ -121,7 +122,8 @@ ) :level 'stadiumc :borrow-level 'lracecf - :borrow '((stadiumc 0 lracecf special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((stadiumc 0 lracecf special) (stadium 0 lracelit display)) :manager-handle-init-hack #f :hatch-actor-name "stdmb-race-hatch-3" :countdown-scene #f @@ -187,7 +189,8 @@ ) :level 'stadiumd :borrow-level 'lracedf - :borrow '((stadiumd 0 lracedf special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((stadiumd 0 lracedf special) (stadium 0 lracelit display)) :manager-handle-init-hack #f :hatch-actor-name "stdmb-race-hatch-1" :countdown-scene "city-class-1-race-intro-b" @@ -277,7 +280,8 @@ ) :level 'stadiumb :borrow-level 'lracebf - :borrow '((stadiumb 0 lracebf special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((stadiumb 0 lracebf special) (stadium 0 lracelit display)) :manager-handle-init-hack #f :hatch-actor-name "stdmb-race-hatch-2" :countdown-scene #f @@ -337,7 +341,8 @@ ) :level 'stadiumc :borrow-level 'lracecf - :borrow '((stadiumc 0 lracecf special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((stadiumc 0 lracecf special) (stadium 0 lracelit display)) :manager-handle-init-hack #f :hatch-actor-name "stdmb-race-hatch-3" :countdown-scene #f @@ -403,7 +408,8 @@ ) :level 'stadiumd :borrow-level 'lracedf - :borrow '((stadiumd 0 lracedf special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((stadiumd 0 lracedf special) (stadium 0 lracelit display)) :manager-handle-init-hack #f :hatch-actor-name "stdmb-race-hatch-1" :countdown-scene #f @@ -521,7 +527,8 @@ ) :level 'stadiumb :borrow-level 'lracebb - :borrow '((stadiumb 0 lracebb special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((stadiumb 0 lracebb special) (stadium 0 lracelit display)) :manager-handle-init-hack #f :hatch-actor-name "stdmb-race-hatch-2" :countdown-scene #f @@ -580,7 +587,8 @@ ) :level 'stadiumc :borrow-level 'lracecb - :borrow '((stadiumc 0 lracecb special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((stadiumc 0 lracecb special) (stadium 0 lracelit display)) :manager-handle-init-hack #f :hatch-actor-name "stdmb-race-hatch-3" :countdown-scene #f @@ -643,7 +651,8 @@ ) :level 'stadiumd :borrow-level 'lracedb - :borrow '((stadiumd 0 lracedb special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((stadiumd 0 lracedb special) (stadium 0 lracelit display)) :manager-handle-init-hack #f :hatch-actor-name "stdmb-race-hatch-1" :countdown-scene #f @@ -653,7 +662,7 @@ ) ) -(defmethod set-speech-tables! race-state ((obj race-state)) +(defmethod set-speech-tables! race-state ((this race-state)) (speech-table-set! *speech-control* (speech-type speech-type-30) diff --git a/goal_src/jak2/levels/common/race/race-manager.gc b/goal_src/jak2/levels/common/race/race-manager.gc index f0905e626a..93855cfaa2 100644 --- a/goal_src/jak2/levels/common/race/race-manager.gc +++ b/goal_src/jak2/levels/common/race/race-manager.gc @@ -60,37 +60,37 @@ ) ) -(defmethod initialize-mesh race-info ((obj race-info)) - (let ((v1-0 (entity-by-name (-> obj race-mesh-name)))) +(defmethod initialize-mesh race-info ((this race-info)) + (let ((v1-0 (entity-by-name (-> this race-mesh-name)))) (cond (v1-0 (let ((gp-0 (-> (the-as entity-race-mesh v1-0) race-mesh))) - (set! (-> obj mesh) gp-0) + (set! (-> this mesh) gp-0) (when gp-0 (let ((s4-0 (-> gp-0 edges 0))) - (vector-average! (-> obj start-sphere) (-> s4-0 left) (-> s4-0 right)) - (+! (-> obj start-sphere y) 40960.0) - (race-find-ground (-> obj start-sphere) (-> obj start-sphere)) - (+! (-> obj start-sphere y) 8192.0) - (set! (-> obj start-sphere r) (* 0.5 (vector-vector-distance (-> s4-0 left) (-> s4-0 right)))) + (vector-average! (-> this start-sphere) (-> s4-0 left) (-> s4-0 right)) + (+! (-> this start-sphere y) 40960.0) + (race-find-ground (-> this start-sphere) (-> this start-sphere)) + (+! (-> this start-sphere y) 8192.0) + (set! (-> this start-sphere r) (* 0.5 (vector-vector-distance (-> s4-0 left) (-> s4-0 right)))) (let ((v1-6 (new 'stack-no-clear 'vector))) (vector-! v1-6 (-> s4-0 right) (-> s4-0 left)) - (set-vector! (-> obj start-dir) (-> v1-6 z) 0.0 (- (-> v1-6 x)) 1.0) + (set-vector! (-> this start-dir) (-> v1-6 z) 0.0 (- (-> v1-6 x)) 1.0) ) ) - (vector-normalize! (-> obj start-dir) 1.0) + (vector-normalize! (-> this start-dir) 1.0) (let* ((a0-8 (+ (-> gp-0 edge-count) -1)) (s4-1 (-> gp-0 edges a0-8)) ) - (vector-average! (-> obj finish-sphere) (-> s4-1 left) (-> s4-1 right)) - (set! (-> obj finish-sphere r) (* 0.75 (vector-vector-distance (-> s4-1 left) (-> s4-1 right)))) + (vector-average! (-> this finish-sphere) (-> s4-1 left) (-> s4-1 right)) + (set! (-> this finish-sphere r) (* 0.75 (vector-vector-distance (-> s4-1 left) (-> s4-1 right)))) (let ((v1-12 (new 'stack-no-clear 'vector))) (vector-! v1-12 (-> s4-1 right) (-> s4-1 left)) - (set-vector! (-> obj finish-dir) (-> v1-12 z) 0.0 (- (-> v1-12 x)) 1.0) + (set-vector! (-> this finish-dir) (-> v1-12 z) 0.0 (- (-> v1-12 x)) 1.0) ) ) - (vector-normalize! (-> obj finish-dir) 1.0) - (let ((f0-18 (vector-vector-distance-squared (-> obj start-sphere) (-> obj finish-sphere))) + (vector-normalize! (-> this finish-dir) 1.0) + (let ((f0-18 (vector-vector-distance-squared (-> this start-sphere) (-> this finish-sphere))) (f1-2 163840.0) ) (if (< f0-18 (* f1-2 f1-2)) @@ -101,7 +101,7 @@ ) ) (else - (set! (-> obj mesh) #f) + (set! (-> this mesh) #f) ) ) ) @@ -109,40 +109,40 @@ (none) ) -(defmethod begin-lap racer-state ((obj racer-state) (arg0 race-state)) - (format #t "begin-lap racer ~d~%" (-> obj rank)) - (set! (-> obj lap-start) (-> arg0 current-time)) - (logior! (-> obj flags) (racer-flags in-race)) +(defmethod begin-lap racer-state ((this racer-state) (arg0 race-state)) + (format #t "begin-lap racer ~d~%" (-> this rank)) + (set! (-> this lap-start) (-> arg0 current-time)) + (logior! (-> this flags) (racer-flags in-race)) 0 (none) ) -(defmethod end-lap racer-state ((obj racer-state) (arg0 race-state)) - (+! (-> obj lap-count) 1) - (format #t "end-lap ~d racer ~d~%" (-> obj lap-count) (-> obj rank)) +(defmethod end-lap racer-state ((this racer-state) (arg0 race-state)) + (+! (-> this lap-count) 1) + (format #t "end-lap ~d racer ~d~%" (-> this lap-count) (-> this rank)) (let ((v1-2 4) (a0-2 3) ) (while (>= a0-2 0) - (set! (-> obj lap-time-array v1-2) (-> obj lap-time-array a0-2)) + (set! (-> this lap-time-array v1-2) (-> this lap-time-array a0-2)) (+! a0-2 -1) (+! v1-2 -1) ) ) - (let ((v1-5 (- (-> arg0 current-time) (-> obj lap-start)))) - (set! (-> obj best-lap-time) (the-as uint (min (the-as int (-> obj best-lap-time)) (the-as int v1-5)))) - (set! (-> obj lap-time-array 0) (the-as float v1-5)) + (let ((v1-5 (- (-> arg0 current-time) (-> this lap-start)))) + (set! (-> this best-lap-time) (the-as uint (min (the-as int (-> this best-lap-time)) (the-as int v1-5)))) + (set! (-> this lap-time-array 0) (the-as float v1-5)) ) - (when (= (-> obj lap-count) (-> arg0 info lap-count)) - (logior! (-> obj flags) (racer-flags finished)) - (set! (-> obj finish-time) (-> arg0 current-time)) - (set! (-> obj finish-count) (-> arg0 finished-count)) + (when (= (-> this lap-count) (-> arg0 info lap-count)) + (logior! (-> this flags) (racer-flags finished)) + (set! (-> this finish-time) (-> arg0 current-time)) + (set! (-> this finish-count) (-> arg0 finished-count)) (+! (-> arg0 finished-count) 1) - (send-event (handle->process (-> obj racer)) 'race-finished (-> arg0 info safe-paths)) - (let ((s4-0 (handle->process (-> obj racer)))) + (send-event (handle->process (-> this racer)) 'race-finished (-> arg0 info safe-paths)) + (let ((s4-0 (handle->process (-> this racer)))) (cond - ((zero? (-> obj finish-count)) - (let ((v1-28 (-> obj rider))) + ((zero? (-> this finish-count)) + (let ((v1-28 (-> this rider))) (cond ((zero? v1-28) (format #t "racer-state::end-lap: play speech race-jak-win~%") @@ -160,7 +160,7 @@ ) ) (else - (case (-> obj rider) + (case (-> this rider) ((2) (format #t "racer-state::end-lap: play speech race-errol-lose~%") (speech-control-method-12 *speech-control* (the-as process-drawable s4-0) (speech-type speech-type-56)) @@ -170,9 +170,9 @@ ) ) ) - (when (and (> (-> obj lap-count) 0) (= (-> obj lap-count) (+ (-> arg0 info lap-count) -1))) - (let ((s5-1 (handle->process (-> obj racer))) - (v1-47 (-> obj rider)) + (when (and (> (-> this lap-count) 0) (= (-> this lap-count) (+ (-> arg0 info lap-count) -1))) + (let ((s5-1 (handle->process (-> this racer))) + (v1-47 (-> this rider)) ) (cond ((zero? v1-47) @@ -194,7 +194,7 @@ (none) ) -(defmethod update-lap-distance racer-state ((obj racer-state) (arg0 race-state)) +(defmethod update-lap-distance racer-state ((this racer-state) (arg0 race-state)) (local-vars (a0-29 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -204,51 +204,51 @@ (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'matrix3))) (-> arg0 info) - (let ((v1-2 (handle->process (-> obj racer)))) + (let ((v1-2 (handle->process (-> this racer)))) (cond (v1-2 (if (focus-test? (the-as process-focusable v1-2) dead inactive) - (logior! (-> obj flags) (racer-flags dead)) + (logior! (-> this flags) (racer-flags dead)) ) (set! (-> s5-0 vector 0 quad) (-> (the-as process-focusable v1-2) root trans quad)) - (when (not (logtest? (-> obj flags) (racer-flags finished dead))) + (when (not (logtest? (-> this flags) (racer-flags finished dead))) (let ((s3-0 (new 'stack-no-clear 'race-mesh-slice-query))) (set! (-> s3-0 search-sphere quad) (-> s5-0 vector 0 quad)) (set! (-> s3-0 search-sphere r) 0.0) (race-mesh-method-13 (-> arg0 info mesh) (the-as race-mesh-slice-query (&-> s3-0 slice-id))) - (set! (-> obj lap-distance-prev) (-> obj lap-distance)) + (set! (-> this lap-distance-prev) (-> this lap-distance)) (cond ((>= (-> s3-0 slice-id) 0) - (set! (-> obj lap-distance) (-> s3-0 lap-dist)) - (if (not (logtest? (-> obj flags) (racer-flags on-track))) - (set! (-> obj lap-distance-prev) (-> obj lap-distance)) + (set! (-> this lap-distance) (-> s3-0 lap-dist)) + (if (not (logtest? (-> this flags) (racer-flags on-track))) + (set! (-> this lap-distance-prev) (-> this lap-distance)) ) - (logior! (-> obj flags) (racer-flags on-track)) + (logior! (-> this flags) (racer-flags on-track)) ) (else - (logclear! (-> obj flags) (racer-flags on-track)) + (logclear! (-> this flags) (racer-flags on-track)) ) ) (cond ((logtest? (-> arg0 info mesh flags) (race-mesh-flags racemeshflag-0)) (when (>= (-> s3-0 slice-id) 0) (let ((v1-29 (min 3 (the int (* 4.0 (-> s3-0 lap-dist)))))) - (when (= v1-29 (logand (+ (-> obj lap-quadrant) 1) 3)) - (set! (-> obj lap-quadrant) v1-29) + (when (= v1-29 (logand (+ (-> this lap-quadrant) 1) 3)) + (set! (-> this lap-quadrant) v1-29) (when (zero? v1-29) - (if (logtest? (-> obj flags) (racer-flags in-race)) - (end-lap obj arg0) + (if (logtest? (-> this flags) (racer-flags in-race)) + (end-lap this arg0) (begin-race arg0) ) - (begin-lap obj arg0) + (begin-lap this arg0) ) ) ) ) ) - ((logtest? (-> obj flags) (racer-flags in-race)) + ((logtest? (-> this flags) (racer-flags in-race)) (let ((v1-39 (new 'stack-no-clear 'vector))) - (vector-! (the-as vector (&-> v1-39 x)) (-> obj position) (the-as vector (-> arg0 info finish-sphere))) + (vector-! (the-as vector (&-> v1-39 x)) (-> this position) (the-as vector (-> arg0 info finish-sphere))) (.lvf vf1 (&-> (the-as vector (&-> v1-39 x)) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -260,71 +260,71 @@ (f1-1 (-> arg0 info finish-sphere r)) ) (if (and (< f0-7 (* f1-1 f1-1)) (< 0.0 (vector-dot (the-as vector (&-> v1-39 x)) (-> arg0 info finish-dir)))) - (end-lap obj arg0) + (end-lap this arg0) ) ) ) ) (else - (when (< 0.0 (-> obj lap-distance)) + (when (< 0.0 (-> this lap-distance)) (begin-race arg0) - (begin-lap obj arg0) + (begin-lap this arg0) ) ) ) ) (let ((f0-10 (-> arg0 info ai-max-speed-factor))) - (if (< (+ (-> arg0 target-pos) (-> obj target-pos-offset)) (-> obj pos)) + (if (< (+ (-> arg0 target-pos) (-> this target-pos-offset)) (-> this pos)) (set! f0-10 (-> arg0 info ai-min-speed-factor)) ) - (seek! (-> obj speed-factor) f0-10 (* 0.2 (seconds-per-frame))) + (seek! (-> this speed-factor) f0-10 (* 0.2 (seconds-per-frame))) ) 0 ) - (if (logtest? (-> obj flags) (racer-flags finished)) - (seek! (-> obj speed-factor) 0.9 (* 0.2 (seconds-per-frame))) + (if (logtest? (-> this flags) (racer-flags finished)) + (seek! (-> this speed-factor) 0.9 (* 0.2 (seconds-per-frame))) ) - (when (logtest? (-> obj flags) (racer-flags in-race)) + (when (logtest? (-> this flags) (racer-flags in-race)) (dotimes (s3-1 (-> arg0 info decision-point-count)) (let ((v1-70 (-> arg0 info decision-point-array s3-1))) - (if (and (< (-> obj lap-distance-prev) (-> v1-70 pos)) (>= (-> obj lap-distance) (-> v1-70 pos))) - (send-event (handle->process (-> obj racer)) 'race-decision-point v1-70) + (if (and (< (-> this lap-distance-prev) (-> v1-70 pos)) (>= (-> this lap-distance) (-> v1-70 pos))) + (send-event (handle->process (-> this racer)) 'race-decision-point v1-70) ) ) ) - (set! (-> obj pos) (+ (-> obj lap-distance) (the float (-> obj lap-count)))) + (set! (-> this pos) (+ (-> this lap-distance) (the float (-> this lap-count)))) ) - (set! (-> obj position quad) (-> s5-0 vector 0 quad)) + (set! (-> this position quad) (-> s5-0 vector 0 quad)) ) (else - (logior! (-> obj flags) (racer-flags dead)) + (logior! (-> this flags) (racer-flags dead)) ) ) ) ) - (when (logtest? (-> obj flags) (racer-flags unknown)) + (when (logtest? (-> this flags) (racer-flags unknown)) ) 0 (none) ) ) -(defmethod print-laps racer-state ((obj racer-state) (arg0 race-state) (arg1 string)) - (let ((s4-0 (- (-> arg0 current-time) (-> obj lap-start)))) - (format arg1 "lap count ~d~%" (-> obj lap-count)) +(defmethod print-laps racer-state ((this racer-state) (arg0 race-state) (arg1 string)) + (let ((s4-0 (- (-> arg0 current-time) (-> this lap-start)))) + (format arg1 "lap count ~d~%" (-> this lap-count)) (format arg1 "best lap ") - (print-time arg1 (the-as time-frame (-> obj best-lap-time))) + (print-time arg1 (the-as time-frame (-> this best-lap-time))) (format arg1 "~%~%") - (when (logtest? (-> obj flags) (racer-flags in-race)) + (when (logtest? (-> this flags) (racer-flags in-race)) (format arg1 "this lap ") (print-time arg1 (the-as time-frame s4-0)) ) ) (format arg1 "~%") - (let ((s4-2 (min 5 (-> obj lap-count)))) + (let ((s4-2 (min 5 (-> this lap-count)))) (dotimes (s3-0 s4-2) (format arg1 "lap ~d " s3-0) - (print-time arg1 (the-as time-frame (-> obj lap-time-array s3-0))) + (print-time arg1 (the-as time-frame (-> this lap-time-array s3-0))) (format arg1 "~%") ) ) @@ -332,70 +332,70 @@ (none) ) -(defmethod init-racer! racer-state ((obj racer-state) (arg0 process-drawable)) - (set! (-> obj racer) (process->handle arg0)) - (set! (-> obj position quad) (-> arg0 root trans quad)) - (set! (-> obj flags) (racer-flags unknown)) - (set! (-> obj lap-count) 0) - (set! (-> obj lap-distance) 0.0) - (set! (-> obj lap-quadrant) 3) - (set! (-> obj finish-time) (the-as uint 0)) - (set! (-> obj pos) 0.0) - (set! (-> obj target-pos-offset) 0.0) - (set! (-> obj speed-factor) 1.0) - (set! (-> obj finish-count) -1) - (set! (-> obj best-lap-time) (the-as uint #x2dc6c0)) +(defmethod init-racer! racer-state ((this racer-state) (arg0 process-drawable)) + (set! (-> this racer) (process->handle arg0)) + (set! (-> this position quad) (-> arg0 root trans quad)) + (set! (-> this flags) (racer-flags unknown)) + (set! (-> this lap-count) 0) + (set! (-> this lap-distance) 0.0) + (set! (-> this lap-quadrant) 3) + (set! (-> this finish-time) (the-as uint 0)) + (set! (-> this pos) 0.0) + (set! (-> this target-pos-offset) 0.0) + (set! (-> this speed-factor) 1.0) + (set! (-> this finish-count) -1) + (set! (-> this best-lap-time) (the-as uint #x2dc6c0)) 0 (none) ) -(defmethod init-racers! race-state ((obj race-state) (arg0 process-drawable)) - (let ((v1-0 (-> obj racer-count))) +(defmethod init-racers! race-state ((this race-state) (arg0 process-drawable)) + (let ((v1-0 (-> this racer-count))) (when (< v1-0 10) - (+! (-> obj racer-count) 1) - (init-racer! (-> obj racer-array v1-0) arg0) + (+! (-> this racer-count) 1) + (init-racer! (-> this racer-array v1-0) arg0) ) ) 0 (none) ) -(defmethod begin-race race-state ((obj race-state)) +(defmethod begin-race race-state ((this race-state)) (format #t "begin-race~%") - (when (not (logtest? (-> obj flags) (race-flags begun))) - (logior! (-> obj flags) (race-flags begun)) - (set-speech-tables! obj) - (send-event (handle->process (-> obj manager)) 'begin-race) + (when (not (logtest? (-> this flags) (race-flags begun))) + (logior! (-> this flags) (race-flags begun)) + (set-speech-tables! this) + (send-event (handle->process (-> this manager)) 'begin-race) (set-setting! 'sound-mode #f 0.0 0) (remove-setting! 'allow-progress) - (set! (-> obj race-start-time) (-> obj current-time)) - (let ((s5-0 (handle->process (-> obj manager)))) - (set! (-> obj hud-timer) (ppointer->handle (process-spawn hud-race-timer :init hud-init-by-other :to s5-0))) - (set! (-> obj hud-position) + (set! (-> this race-start-time) (-> this current-time)) + (let ((s5-0 (handle->process (-> this manager)))) + (set! (-> this hud-timer) (ppointer->handle (process-spawn hud-race-timer :init hud-init-by-other :to s5-0))) + (set! (-> this hud-position) (ppointer->handle (process-spawn hud-race-position :init hud-init-by-other :to s5-0)) ) - (if (< 1 (-> obj info lap-count)) - (set! (-> obj hud-lap-counter) + (if (< 1 (-> this info lap-count)) + (set! (-> this hud-lap-counter) (ppointer->handle (process-spawn hud-race-lap-counter :init hud-init-by-other :to s5-0)) ) ) - (when (logtest? (-> obj info flags) (race-info-flags borrow)) - (set! (-> obj hud-turbo-counter) + (when (logtest? (-> this info flags) (race-info-flags borrow)) + (set! (-> this hud-turbo-counter) (ppointer->handle (process-spawn hud-race-turbo-counter :init hud-init-by-other :to s5-0)) ) - (set-setting! 'race-minimap #f 0.0 (-> obj info map-index)) + (set-setting! 'race-minimap #f 0.0 (-> this info map-index)) ) ) - (dotimes (s5-1 (-> obj racer-count)) - (let ((v1-61 (-> obj racer-array s5-1))) + (dotimes (s5-1 (-> this racer-count)) + (let ((v1-61 (-> this racer-array s5-1))) (send-event (handle->process (-> v1-61 racer)) 'begin-race) ) ) - (send-event (handle->process (-> obj race-signal)) 'count-go) - (when (nonzero? (-> obj info go-speech)) - (format #t "playing speech ~d~%" (-> obj info go-speech)) + (send-event (handle->process (-> this race-signal)) 'count-go) + (when (nonzero? (-> this info go-speech)) + (format #t "playing speech ~d~%" (-> this info go-speech)) (talker-spawn-func - (-> *talker-speech* (-> obj info go-speech)) + (-> *talker-speech* (-> this info go-speech)) *entity-pool* (target-pos 0) (the-as region #f) @@ -406,10 +406,10 @@ (none) ) -(defmethod update-rankings race-state ((obj race-state)) +(defmethod update-rankings race-state ((this race-state)) (let ((v1-0 (new 'stack-no-clear 'array 'float 10))) - (dotimes (a0-1 (-> obj racer-count)) - (let ((a1-3 (-> obj racer-array a0-1))) + (dotimes (a0-1 (-> this racer-count)) + (let ((a1-3 (-> this racer-array a0-1))) (cond ((logtest? (-> a1-3 flags) (racer-flags finished)) (set! (-> v1-0 a0-1) (the float (- 1000 (-> a1-3 finish-count)))) @@ -426,13 +426,13 @@ (let ((a0-4 0) (a1-16 1) ) - (while (< a1-16 (-> obj racer-count)) - (let ((a2-7 (-> obj rankings a0-4)) - (a3-1 (-> obj rankings a1-16)) + (while (< a1-16 (-> this racer-count)) + (let ((a2-7 (-> this rankings a0-4)) + (a3-1 (-> this rankings a1-16)) ) (when (< (-> v1-0 a2-7) (-> v1-0 a3-1)) - (set! (-> obj rankings a0-4) a3-1) - (set! (-> obj rankings a1-16) a2-7) + (set! (-> this rankings a0-4) a3-1) + (set! (-> this rankings a1-16) a2-7) ) ) (+! a0-4 1) @@ -440,9 +440,9 @@ ) ) ) - (dotimes (s5-0 (-> obj racer-count)) - (let* ((v1-3 (-> obj rankings s5-0)) - (s4-0 (-> obj racer-array v1-3)) + (dotimes (s5-0 (-> this racer-count)) + (let* ((v1-3 (-> this rankings s5-0)) + (s4-0 (-> this racer-array v1-3)) ) (if (and (zero? s5-0) (nonzero? (-> s4-0 rank))) (send-event (handle->process (-> s4-0 racer)) 'race-pass) @@ -457,13 +457,13 @@ (none) ) -(defmethod debug-print-rankings race-state ((obj race-state)) - (dotimes (s5-0 (-> obj racer-count)) - (let* ((s4-0 (-> obj rankings s5-0)) - (s3-0 (-> obj racer-array s4-0)) +(defmethod debug-print-rankings race-state ((this race-state)) + (dotimes (s5-0 (-> this racer-count)) + (let* ((s4-0 (-> this rankings s5-0)) + (s3-0 (-> this racer-array s4-0)) ) (when (not (logtest? (-> s3-0 flags) (racer-flags dead))) - (if (= s4-0 (-> obj i-player)) + (if (= s4-0 (-> this i-player)) (format *stdcon* ">>>") (format *stdcon* " ") ) @@ -472,14 +472,14 @@ (format *stdcon* " #~d finished " (+ s4-0 1)) (cond ((zero? s5-0) - (let ((a1-3 (- (-> s3-0 finish-time) (-> obj race-start-time)))) + (let ((a1-3 (- (-> s3-0 finish-time) (-> this race-start-time)))) (print-time *stdcon* (the-as time-frame a1-3)) ) ) (else (format *stdcon* "+") - (let ((a1-7 (- (- (-> s3-0 finish-time) (-> obj race-start-time)) - (- (-> obj racer-array (-> obj rankings 0) finish-time) (-> obj race-start-time)) + (let ((a1-7 (- (- (-> s3-0 finish-time) (-> this race-start-time)) + (- (-> this racer-array (-> this rankings 0) finish-time) (-> this race-start-time)) ) ) ) @@ -500,11 +500,11 @@ (none) ) -(defmethod update-racers race-state ((obj race-state)) +(defmethod update-racers race-state ((this race-state)) (let ((s5-0 0)) - (dotimes (s4-0 (-> obj racer-count)) - (let ((s3-0 (-> obj racer-array s4-0))) - (update-lap-distance s3-0 obj) + (dotimes (s4-0 (-> this racer-count)) + (let ((s3-0 (-> this racer-array s4-0))) + (update-lap-distance s3-0 this) (if (not (logtest? (-> s3-0 flags) (racer-flags finished dead))) (+! s5-0 1) ) @@ -512,25 +512,25 @@ 0 ) (if (zero? s5-0) - (set! (-> obj state) (race-state-enum all-dead)) + (set! (-> this state) (race-state-enum all-dead)) ) ) 0 (none) ) -(defmethod setup-race race-state ((obj race-state)) +(defmethod setup-race race-state ((this race-state)) (set-setting! 'allow-progress #f 0.0 0) - (send-event (handle->process (-> obj arrow)) 'leave) - (when (logtest? (-> obj info flags) (race-info-flags borrow)) + (send-event (handle->process (-> this arrow)) 'leave) + (when (logtest? (-> this info flags) (race-info-flags borrow)) (send-event *traffic-manager* 'set-target-level 0.0) (send-event *traffic-manager* 'set-alert-level 0) ) - (send-event (handle->process (-> obj race-signal)) 'ready) + (send-event (handle->process (-> this race-signal)) 'ready) (let ((v1-27 (new 'stack-no-clear 'matrix))) (vector-reset! (-> v1-27 vector 2)) (vector-reset! (-> v1-27 trans)) - (let ((a0-21 (-> obj racer-array (-> obj i-player)))) + (let ((a0-21 (-> this racer-array (-> this i-player)))) (let ((a3-1 (handle->process (-> a0-21 racer)))) (if a3-1 (set! (-> v1-27 vector 0 quad) (-> (the-as process-drawable a3-1) root trans quad)) @@ -539,45 +539,45 @@ (set! (-> v1-27 vector 1 quad) (-> a0-21 start-position quad)) ) (cubic-curve-method-9 - (-> obj player-intro-curve) + (-> this player-intro-curve) (the-as vector (-> v1-27 vector)) (-> v1-27 vector 2) (-> v1-27 vector 1) (-> v1-27 trans) ) ) - (let ((a0-25 (-> obj info hatch-actor-name))) + (let ((a0-25 (-> this info hatch-actor-name))) (when a0-25 (let ((a0-26 (process-by-name a0-25 *active-pool*))) (send-event a0-26 'open) ) ) ) - (set! (-> obj countdown-start-time) (-> obj current-time)) + (set! (-> this countdown-start-time) (-> this current-time)) 0 (none) ) -(defmethod update race-state ((obj race-state)) - (set! (-> obj current-time) (the-as uint (current-time))) - (case (-> obj state) +(defmethod update race-state ((this race-state)) + (set! (-> this current-time) (the-as uint (current-time))) + (case (-> this state) (((race-state-enum idle)) (let ((v1-3 (the-as object #t))) - (when (not (logtest? (-> obj flags) (race-flags ready))) - (dotimes (s5-0 (-> obj racer-count)) - (let ((a0-7 (-> obj racer-array s5-0))) + (when (not (logtest? (-> this flags) (race-flags ready))) + (dotimes (s5-0 (-> this racer-count)) + (let ((a0-7 (-> this racer-array s5-0))) (set! v1-3 (and v1-3 (send-event (handle->process (-> a0-7 racer)) 'test-ready))) ) ) ) - (when (and v1-3 (not (logtest? (-> obj info flags) (race-info-flags city-race)))) - (spawn-race-signal obj) - (set! v1-3 (handle->process (-> obj race-signal))) + (when (and v1-3 (not (logtest? (-> this info flags) (race-info-flags city-race)))) + (spawn-race-signal this) + (set! v1-3 (handle->process (-> this race-signal))) ) (when v1-3 - (setup-race obj) - (set! (-> obj state) - (if (or (logtest? (-> obj flags) (race-flags pidax)) (logtest? (-> obj info flags) (race-info-flags city-race))) + (setup-race this) + (set! (-> this state) + (if (or (logtest? (-> this flags) (race-flags pidax)) (logtest? (-> this info flags) (race-info-flags city-race))) (race-state-enum countdown-start) (race-state-enum player-get-on) ) @@ -586,8 +586,8 @@ ) ) (((race-state-enum player-get-on)) - (let* ((f30-0 (* 0.0033333334 (the float (- (-> obj current-time) (-> obj countdown-start-time))))) - (s4-0 (handle->process (-> obj racer-array (-> obj i-player) racer))) + (let* ((f30-0 (* 0.0033333334 (the float (- (-> this current-time) (-> this countdown-start-time))))) + (s4-0 (handle->process (-> this racer-array (-> this i-player) racer))) (s5-1 (if (type? s4-0 process-focusable) s4-0 ) @@ -596,12 +596,12 @@ (cond ((< f30-0 1.0) (when s5-1 - (cubic-curve-method-10 (-> obj player-intro-curve) (-> (the-as process-focusable s5-1) root trans) f30-0) - (cubic-curve-method-11 (-> obj player-intro-curve) (-> (the-as process-focusable s5-1) root transv) f30-0) + (cubic-curve-method-10 (-> this player-intro-curve) (-> (the-as process-focusable s5-1) root trans) f30-0) + (cubic-curve-method-11 (-> this player-intro-curve) (-> (the-as process-focusable s5-1) root transv) f30-0) (when (< 0.4 f30-0) - (when (-> obj info start-camera) - (set-setting! 'entity-name (-> obj info start-camera) 0.0 0) - (if (logtest? (-> obj info flags) (race-info-flags show-tutorial)) + (when (-> this info start-camera) + (set-setting! 'entity-name (-> this info start-camera) 0.0 0) + (if (logtest? (-> this info flags) (race-info-flags show-tutorial)) (talker-spawn-func (-> *talker-speech* 377) *entity-pool* (target-pos 0) (the-as region #f)) ) ) @@ -609,51 +609,51 @@ ) ) (else - (set! (-> obj state) (race-state-enum player-set-pos)) + (set! (-> this state) (race-state-enum player-set-pos)) ) ) ) ) (((race-state-enum player-set-pos)) - (let* ((s4-2 (handle->process (-> obj racer-array (-> obj i-player) racer))) + (let* ((s4-2 (handle->process (-> this racer-array (-> this i-player) racer))) (s5-3 (if (type? s4-2 process-focusable) s4-2 ) ) ) (when s5-3 - (cubic-curve-method-10 (-> obj player-intro-curve) (-> (the-as process-focusable s5-3) root trans) 1.0) + (cubic-curve-method-10 (-> this player-intro-curve) (-> (the-as process-focusable s5-3) root trans) 1.0) (vector-reset! (-> (the-as process-focusable s5-3) root transv)) ) ) - (let ((a0-48 (-> obj info hatch-actor-name))) + (let ((a0-48 (-> this info hatch-actor-name))) (when a0-48 (let ((a0-49 (process-by-name a0-48 *active-pool*))) (send-event a0-49 'close) ) ) ) - (set! (-> obj countdown-start-time) (-> obj current-time)) - (set! (-> obj state) (if (-> obj info countdown-scene) - (race-state-enum countdown-scene-start) - (race-state-enum countdown-start) - ) + (set! (-> this countdown-start-time) (-> this current-time)) + (set! (-> this state) (if (-> this info countdown-scene) + (race-state-enum countdown-scene-start) + (race-state-enum countdown-start) + ) ) ) (((race-state-enum countdown-scene-start)) - (when (>= (the-as uint (- (current-time) (the-as int (-> obj countdown-start-time)))) (the-as uint 300)) - (set! (-> obj state) (race-state-enum countdown-scene)) - (set! (-> obj scene-player) - (ppointer->handle (process-spawn scene-player :init scene-player-init (-> obj info countdown-scene) #t #f)) + (when (time-elapsed? (the-as int (-> this countdown-start-time)) (seconds 1)) + (set! (-> this state) (race-state-enum countdown-scene)) + (set! (-> this scene-player) + (ppointer->handle (process-spawn scene-player :init scene-player-init (-> this info countdown-scene) #t #f)) ) ) ) (((race-state-enum countdown-scene)) (cond - ((handle->process (-> obj scene-player)) - (let ((s5-5 (-> obj info))) + ((handle->process (-> this scene-player)) + (let ((s5-5 (-> this info))) (dotimes (s4-3 (-> s5-5 racer-count)) - (let ((v1-95 (-> obj racer-array s4-3))) + (let ((v1-95 (-> this racer-array s4-3))) (if (logtest? (-> s5-5 racer-array s4-3 flags) (racer-info-flags hide-in-scene)) (send-event (handle->process (-> v1-95 racer)) 'hide) ) @@ -662,76 +662,76 @@ ) ) (else - (let ((s5-6 (-> obj info))) + (let ((s5-6 (-> this info))) (dotimes (s4-4 (-> s5-6 racer-count)) - (let ((v1-105 (-> obj racer-array s4-4))) + (let ((v1-105 (-> this racer-array s4-4))) (if (logtest? (-> s5-6 racer-array s4-4 flags) (racer-info-flags hide-in-scene)) (send-event (handle->process (-> v1-105 racer)) 'unhide) ) ) ) ) - (set! (-> obj state) (race-state-enum countdown-start)) + (set! (-> this state) (race-state-enum countdown-start)) ) ) ) (((race-state-enum countdown-start)) - (set! (-> obj i-countdown) 4) - (set! (-> obj state) (race-state-enum countdown)) - (set! (-> obj countdown-start-time) (-> obj current-time)) + (set! (-> this i-countdown) 4) + (set! (-> this state) (race-state-enum countdown)) + (set! (-> this countdown-start-time) (-> this current-time)) (remove-setting! 'entity-name) ) (((race-state-enum countdown)) (let ((f0-3 3.0)) - (if (logtest? (-> obj info flags) (race-info-flags city-race)) + (if (logtest? (-> this info flags) (race-info-flags city-race)) (set! f0-3 0.2) ) - (let ((v1-127 (+ (the int (* 300.0 f0-3)) (- (-> obj countdown-start-time) (-> obj current-time))))) + (let ((v1-127 (+ (the int (* 300.0 f0-3)) (- (-> this countdown-start-time) (-> this current-time))))) (cond ((>= v1-127 (the int (* 225.0 f0-3))) ) ((>= v1-127 (the int (* 150.0 f0-3))) - (when (!= (-> obj i-countdown) 3) - (set! (-> obj i-countdown) 3) - (send-event (handle->process (-> obj race-signal)) 'count-3) + (when (!= (-> this i-countdown) 3) + (set! (-> this i-countdown) 3) + (send-event (handle->process (-> this race-signal)) 'count-3) ) ) ((>= v1-127 (the int (* 75.0 f0-3))) - (when (!= (-> obj i-countdown) 2) - (set! (-> obj i-countdown) 2) - (send-event (handle->process (-> obj race-signal)) 'count-2) + (when (!= (-> this i-countdown) 2) + (set! (-> this i-countdown) 2) + (send-event (handle->process (-> this race-signal)) 'count-2) ) ) ((< (the int (* 0.0 f0-3)) v1-127) - (when (!= (-> obj i-countdown) 1) - (set! (-> obj i-countdown) 1) - (send-event (handle->process (-> obj race-signal)) 'count-1) + (when (!= (-> this i-countdown) 1) + (set! (-> this i-countdown) 1) + (send-event (handle->process (-> this race-signal)) 'count-1) ) ) (else - (set! (-> obj i-countdown) 0) - (set! (-> obj state) (race-state-enum active)) - (begin-race obj) + (set! (-> this i-countdown) 0) + (set! (-> this state) (race-state-enum active)) + (begin-race this) ) ) ) ) - (update-racers obj) + (update-racers this) ) (((race-state-enum active)) - (update-racers obj) - (update-rankings obj) + (update-racers this) + (update-rankings this) ) (((race-state-enum all-dead)) ) (else ) ) - (dotimes (s5-7 (-> obj info turbo-pad-count)) - (let ((s4-5 (-> obj info turbo-pad-array s5-7))) + (dotimes (s5-7 (-> this info turbo-pad-count)) + (let ((s4-5 (-> this info turbo-pad-array s5-7))) (if (not (handle->process (-> s4-5 handle))) (set! (-> s4-5 handle) - (process->handle (turbo-pickup-spawn (handle->process (-> obj manager)) (-> s4-5 position))) + (process->handle (turbo-pickup-spawn (handle->process (-> this manager)) (-> s4-5 position))) ) ) ) @@ -740,7 +740,7 @@ (none) ) -(defmethod spawn-race-signal race-state ((obj race-state)) +(defmethod spawn-race-signal race-state ((this race-state)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -750,8 +750,8 @@ ) (init-vf0-vector) (when (= (level-status *level* 'lracelit) 'active) - (let ((s3-0 (-> obj info)) - (s5-1 (handle->process (-> obj manager))) + (let ((s3-0 (-> this info)) + (s5-1 (handle->process (-> this manager))) (s4-0 (new 'stack-no-clear 'matrix)) ) (vector-float*! (-> s4-0 vector 2) (-> s3-0 start-dir) -1.0) @@ -776,7 +776,7 @@ (.svf (&-> a0-7 0 quad) vf6) ) (+! (-> s4-0 vector 0 y) 22528.0) - (set! (-> obj race-signal) + (set! (-> this race-signal) (process->handle (race-signal-spawn s5-1 (the-as vector (-> s4-0 vector)) (the-as quaternion (-> s4-0 vector 1))) ) @@ -788,7 +788,7 @@ ) ) -(defmethod initialize race-state ((obj race-state) (arg0 process) (arg1 race-info)) +(defmethod initialize race-state ((this race-state) (arg0 process) (arg1 race-info)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -797,21 +797,21 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s3-0 (-> obj flags))) - (mem-set32! (the-as pointer obj) 324 0) - (set! (-> obj flags) s3-0) + (let ((s3-0 (-> this flags))) + (mem-set32! (the-as pointer this) 324 0) + (set! (-> this flags) s3-0) ) - (set! (-> obj info) arg1) - (set! (-> obj manager) (process->handle arg0)) - (set! (-> obj scene-player) (the-as handle #f)) - (set! (-> obj hud-timer) (the-as handle #f)) - (set! (-> obj hud-lap-counter) (the-as handle #f)) - (set! (-> obj hud-turbo-counter) (the-as handle #f)) - (set! (-> obj hud-position) (the-as handle #f)) - (set! (-> obj arrow) (the-as handle #f)) - (set! (-> obj state) (race-state-enum idle)) - (set! (-> obj racer-count) 0) - (set! (-> obj finished-count) 0) + (set! (-> this info) arg1) + (set! (-> this manager) (process->handle arg0)) + (set! (-> this scene-player) (the-as handle #f)) + (set! (-> this hud-timer) (the-as handle #f)) + (set! (-> this hud-lap-counter) (the-as handle #f)) + (set! (-> this hud-turbo-counter) (the-as handle #f)) + (set! (-> this hud-position) (the-as handle #f)) + (set! (-> this arrow) (the-as handle #f)) + (set! (-> this state) (race-state-enum idle)) + (set! (-> this racer-count) 0) + (set! (-> this finished-count) 0) (let ((v1-3 (new 'stack-no-clear 'mystery-race-manager-type))) (set! (-> v1-3 vec1 z) 81920.0) (set! (-> v1-3 word) 4) @@ -829,7 +829,7 @@ ) (set! (-> v1-3 vec0 y) (+ (-> v1-3 vec0 w) (* (-> v1-3 vec1 y) (the float a1-8)))) ) - (let ((a1-13 (-> obj racer-array a0-15))) + (let ((a1-13 (-> this racer-array a0-15))) (-> arg1 racer-array a0-15) (set! (-> v1-3 mat trans quad) (-> v1-3 mat quad 0)) (let ((t0-0 (-> v1-3 mat trans))) @@ -866,22 +866,22 @@ (set! (-> a1-13 rank) a0-15) (set! (-> a1-13 speed-factor) 1.0) ) - (set! (-> obj rankings a0-15) a0-15) + (set! (-> this rankings a0-15) a0-15) ) ) - (dotimes (v1-6 (-> obj info turbo-pad-count)) - (set! (-> obj info turbo-pad-array v1-6 handle) (the-as handle #f)) + (dotimes (v1-6 (-> this info turbo-pad-count)) + (set! (-> this info turbo-pad-array v1-6 handle) (the-as handle #f)) ) (let ((v1-12 (-> *game-info* sub-task-list (-> arg1 task-node)))) - (set! (-> obj suck-factor) 0.0) + (set! (-> this suck-factor) 0.0) (if (not (logtest? (-> arg1 flags) (race-info-flags bbush))) - (set! (-> obj suck-factor) (fmax 0.0 (fmin 1.0 (* 0.2 (+ -4.0 (the float (-> v1-12 death-count))))))) + (set! (-> this suck-factor) (fmax 0.0 (fmin 1.0 (* 0.2 (+ -4.0 (the float (-> v1-12 death-count))))))) ) (format #t "race-state::initialize: death-count ~d, suck-factor ~f~%" (-> v1-12 death-count) - (-> obj suck-factor) + (-> this suck-factor) ) ) 0 @@ -893,7 +893,7 @@ (define *race-rigid-body-queue* (new 'static 'rigid-body-queue)) -(defmethod update race-manager ((obj race-manager)) +(defmethod update race-manager ((this race-manager)) (let ((s5-0 *display-race-marks*)) (when (logtest? s5-0 (race-marks-controls rmc2040)) (let ((a0-3 (entity-by-name (-> *race-info-array* *select-race* race-mesh-name)))) @@ -915,7 +915,7 @@ ) ) (let ((v1-14 (new 'stack-no-clear 'inline-array 'vector 5))) - (let ((a0-6 (-> obj race-state info))) + (let ((a0-6 (-> this race-state info))) (set! (-> v1-14 0 quad) (-> a0-6 start-sphere quad)) (set! (-> v1-14 1 quad) (-> a0-6 start-dir quad)) ) @@ -927,19 +927,19 @@ (vector-! (-> v1-14 5) (-> v1-14 0) (-> v1-14 3)) ) 0 - (update (-> obj race-state)) + (update (-> this race-state)) 0 ) -(defmethod race-manager-method-22 race-manager ((obj race-manager)) +(defmethod race-manager-method-22 race-manager ((this race-manager)) 0 (none) ) -(defmethod initialize-race-state race-manager ((obj race-manager)) - (let ((s5-0 (-> obj race-state info))) +(defmethod initialize-race-state race-manager ((this race-manager)) + (let ((s5-0 (-> this race-state info))) (initialize-mesh s5-0) - (initialize (-> obj race-state) obj s5-0) + (initialize (-> this race-state) this s5-0) ) (let ((v1-5 *game-info*)) (set! (-> v1-5 race-position) 0) @@ -954,7 +954,7 @@ ) ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod initialize-state race-manager ((obj race-manager)) +(defmethod initialize-state race-manager ((this race-manager)) (local-vars (v1-0 int) (sv-352 task-arrow-params) @@ -964,8 +964,8 @@ (sv-416 int) ) (.mfc0 v1-0 Count) - (rigid-body-queue-manager-spawn *race-rigid-body-queue* obj) - (let* ((gp-0 (-> obj race-state)) + (rigid-body-queue-manager-spawn *race-rigid-body-queue* this) + (let* ((gp-0 (-> this race-state)) (s3-0 (-> gp-0 info)) ) (if (or (logtest? (-> s3-0 flags) (race-info-flags pidax)) @@ -1018,7 +1018,7 @@ (+! (-> s4-0 params position y) 12288.0) (set! (-> s4-0 params behavior) (the-as uint 4)) (logclear! (-> s4-0 params flags) (traffic-spawn-flags trsflags-01)) - (let ((s5-1 (vehicle-spawn obj (type-from-race-vehicle-type (-> s2-0 vehicle)) (-> s4-0 params)))) + (let ((s5-1 (vehicle-spawn this (type-from-race-vehicle-type (-> s2-0 vehicle)) (-> s4-0 params)))) (when s5-1 (init-racers! gp-0 s5-1) (send-event *target* 'change-mode 'pilot s5-1 0 #t) @@ -1056,7 +1056,7 @@ (set! (-> sv-352 flags) (task-arrow-flags)) (set! (-> sv-352 map-icon) (the-as uint 15)) (let ((t9-11 task-arrow-spawn) - (a1-17 obj) + (a1-17 this) ) (set! (-> gp-0 arrow) (process->handle (t9-11 sv-352 a1-17))) ) @@ -1082,7 +1082,7 @@ ) ) (set! sv-368 vehicle-spawn) - (set! sv-384 obj) + (set! sv-384 this) (let ((a1-18 (type-from-race-vehicle-type (-> s1-0 vehicle))) (a2-3 (-> s4-0 params)) ) @@ -1127,9 +1127,9 @@ (none) ) -(defmethod save-score race-manager ((obj race-manager) (arg0 float)) +(defmethod save-score race-manager ((this race-manager) (arg0 float)) (local-vars (sv-32 int)) - (let* ((s5-0 (-> obj race-state info score)) + (let* ((s5-0 (-> this race-state info score)) (s3-0 0) (s2-0 (-> *highscore-info-array* s5-0)) ) @@ -1156,7 +1156,7 @@ (s2-2 (max 0 (- v1-24 s3-0))) ) (when (> (the-as uint s2-2) 0) - (set! (-> obj finish-sound-id) (the-as sound-id 1)) + (set! (-> this finish-sound-id) (the-as sound-id 1)) (cond ((= v1-24 3) (talker-spawn-func (-> *talker-speech* 374) *entity-pool* (target-pos 0) (the-as region #f)) @@ -1195,7 +1195,7 @@ (none) ) -(defmethod stop-speech race-manager ((obj race-manager)) +(defmethod stop-speech race-manager ((this race-manager)) (set-action! *gui-control* (gui-action stop) @@ -1220,8 +1220,8 @@ (none) ) -(defmethod draw-message-continue race-manager ((obj race-manager)) - (when (= (get-status *gui-control* (-> obj message-id)) (gui-status active)) +(defmethod draw-message-continue race-manager ((this race-manager)) + (when (= (get-status *gui-control* (-> this message-id)) (gui-status active)) (let ((gp-1 (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) ) @@ -1248,8 +1248,8 @@ (none) ) -(defmethod draw-message-retry race-manager ((obj race-manager)) - (when (= (get-status *gui-control* (-> obj message-id)) (gui-status active)) +(defmethod draw-message-retry race-manager ((this race-manager)) + (when (= (get-status *gui-control* (-> this message-id)) (gui-status active)) (let ((gp-1 (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) ) @@ -1392,10 +1392,10 @@ (when (logtest? (-> gp-0 flags) (racer-flags in-race)) (cond ((logtest? (-> gp-0 flags) (racer-flags on-track)) - (set! (-> self player-on-track-time) (current-time)) + (set-time! (-> self player-on-track-time)) ) (else - (when (>= (- (current-time) (-> self player-on-track-time)) (seconds 1)) + (when (time-elapsed? (-> self player-on-track-time) (seconds 1)) (let ((v1-16 (handle->process (-> gp-0 racer)))) (when v1-16 (when (logtest? (-> (the-as vehicle-racer v1-16) flags) (rigid-body-object-flag on-ground)) @@ -1451,7 +1451,7 @@ (send-event (handle->process (-> self race-state hud-lap-counter)) 'force-hide) (send-event (handle->process (-> self race-state hud-turbo-counter)) 'force-hide) (process-spawn hud-race-final-stats :init hud-init-by-other :to self) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (when (logtest? (-> self race-state info flags) (race-info-flags complete-immediately)) (send-event (ppointer->process (-> self parent)) 'complete) (sleep-code) @@ -1463,7 +1463,7 @@ (cond ((logtest? (-> self race-state info flags) (race-info-flags retryable)) (draw-message-retry self) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (cond ((cpad-pressed? 0 confirm) (stop-speech self) @@ -1480,7 +1480,7 @@ ) (else (draw-message-continue self) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (when (cpad-pressed? 0 confirm) (stop-speech self) (send-event (ppointer->process (-> self parent)) 'complete) @@ -1512,11 +1512,11 @@ (send-event (handle->process (-> self race-state hud-lap-counter)) 'force-hide) (send-event (handle->process (-> self race-state hud-turbo-counter)) 'force-hide) (process-spawn hud-race-final-stats :init hud-init-by-other :to self) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (draw-message-retry self) (-> self race-state info) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (cond ((cpad-pressed? 0 confirm) (stop-speech self) @@ -1546,7 +1546,7 @@ (send-event (handle->process (-> self race-state hud-timer)) 'force-hide) (send-event (handle->process (-> self race-state hud-lap-counter)) 'force-hide) (send-event (handle->process (-> self race-state hud-turbo-counter)) 'force-hide) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (suspend) ) @@ -1563,10 +1563,10 @@ (define *race-manager* (the-as (pointer race-manager) #f)) -(defmethod deactivate race-manager ((obj race-manager)) +(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)) obj) + ((the-as (function process none) (find-parent-method race-manager 10)) this) (none) ) diff --git a/goal_src/jak2/levels/common/race/race-mesh.gc b/goal_src/jak2/levels/common/race/race-mesh.gc index 99b09a431c..d84225f198 100644 --- a/goal_src/jak2/levels/common/race/race-mesh.gc +++ b/goal_src/jak2/levels/common/race/race-mesh.gc @@ -184,12 +184,12 @@ ) -(defmethod race-path-method-10 race-path ((obj race-path) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod race-path-method-10 race-path ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 4)) (a3-1 (the int arg1)) ) - (set! (-> v1-0 0 quad) (-> obj samples a3-1 pos quad)) - (set! (-> v1-0 1 quad) (-> obj samples (+ a3-1 1) pos quad)) + (set! (-> v1-0 0 quad) (-> this samples a3-1 pos quad)) + (set! (-> v1-0 1 quad) (-> this samples (+ a3-1 1) pos quad)) (let ((f0-3 (- arg1 (the float a3-1)))) (vector-lerp! arg0 (-> v1-0 0) (-> v1-0 1) f0-3) ) @@ -198,9 +198,9 @@ (none) ) -(defmethod race-path-method-11 race-path ((obj race-path) (arg0 race-path-sample) (arg1 vector) (arg2 float)) +(defmethod race-path-method-11 race-path ((this race-path) (arg0 race-path-sample) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'race-path-sample 6))) - (let ((f0-1 (the float (-> obj sample-count)))) + (let ((f0-1 (the float (-> this sample-count)))) (if (< f0-1 arg2) (set! arg2 (- arg2 f0-1)) ) @@ -209,13 +209,13 @@ ) ) (let ((s1-0 (the int arg2))) - (mem-copy! (the-as pointer (-> gp-0 0)) (the-as pointer (-> obj samples s1-0)) 32) - (mem-copy! (the-as pointer (-> gp-0 1)) (the-as pointer (-> obj samples (+ s1-0 1))) 32) + (mem-copy! (the-as pointer (-> gp-0 0)) (the-as pointer (-> this samples s1-0)) 32) + (mem-copy! (the-as pointer (-> gp-0 1)) (the-as pointer (-> this samples (+ s1-0 1))) 32) (let ((v1-7 (+ s1-0 2))) - (if (< (the-as int (-> obj sample-count)) v1-7) - (set! v1-7 (- v1-7 (the-as int (-> obj sample-count)))) + (if (< (the-as int (-> this sample-count)) v1-7) + (set! v1-7 (- v1-7 (the-as int (-> this sample-count)))) ) - (mem-copy! (the-as pointer (-> gp-0 2)) (the-as pointer (-> obj samples v1-7)) 32) + (mem-copy! (the-as pointer (-> gp-0 2)) (the-as pointer (-> this samples v1-7)) 32) ) (let ((f30-0 (- arg2 (the float s1-0)))) (vector-lerp! (the-as vector (-> arg0 bytes)) (the-as vector (-> gp-0 0)) (the-as vector (-> gp-0 1)) f30-0) @@ -246,7 +246,7 @@ (none) ) -(defmethod race-path-method-12 race-path ((obj race-path) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod race-path-method-12 race-path ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) (local-vars (v1-15 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -256,7 +256,7 @@ (init-vf0-vector) (let ((gp-0 arg2) (s4-0 (new 'stack-no-clear 'matrix)) - (f30-0 (the float (-> obj sample-count))) + (f30-0 (the float (-> this sample-count))) ) (if (< f30-0 gp-0) (set! gp-0 (- gp-0 f30-0)) @@ -264,8 +264,8 @@ (if (< arg1 0.0) (set! arg1 (+ arg1 f30-0)) ) - (race-path-method-10 obj (the-as vector (-> s4-0 vector)) arg1 arg2) - (race-path-method-10 obj (-> s4-0 vector 1) gp-0 arg2) + (race-path-method-10 this (the-as vector (-> s4-0 vector)) arg1 arg2) + (race-path-method-10 this (-> s4-0 vector 1) gp-0 arg2) (vector-! (-> s4-0 vector 2) (-> s4-0 vector 1) (the-as vector (-> s4-0 vector))) (vector-! (-> s4-0 trans) arg0 (the-as vector (-> s4-0 vector))) (let ((f0-7 0.0) @@ -298,15 +298,15 @@ ) ) -(defmethod draw-path-debug race-path ((obj race-path) (arg0 rgba) (arg1 rgba)) +(defmethod draw-path-debug race-path ((this race-path) (arg0 rgba) (arg1 rgba)) (let ((s1-0 0) (s3-0 1) - (s2-0 (+ (-> obj sample-count) -1)) + (s2-0 (+ (-> this sample-count) -1)) ) (set! (-> (new 'stack-no-clear 'vector) quad) (-> (camera-pos) quad)) (while (< s1-0 (the-as int s2-0)) - (let ((v1-4 (-> obj samples s1-0)) - (a3-0 (-> obj samples s3-0)) + (let ((v1-4 (-> this samples s1-0)) + (a3-0 (-> this samples s3-0)) ) (add-debug-line #t @@ -326,9 +326,9 @@ (none) ) -(defmethod debug-draw-path race-mesh ((obj race-mesh) (arg0 int) (arg1 int) (arg2 rgba) (arg3 rgba)) - (when (< arg1 (the-as int (-> obj path-group-count))) - (let ((v1-2 (-> obj path-groups arg1))) +(defmethod debug-draw-path race-mesh ((this race-mesh) (arg0 int) (arg1 int) (arg2 rgba) (arg3 rgba)) + (when (< arg1 (the-as int (-> this path-group-count))) + (let ((v1-2 (-> this path-groups arg1))) (if (< arg0 (-> v1-2 path-count)) (draw-path-debug (-> v1-2 paths arg0) arg2 arg3) ) @@ -337,9 +337,9 @@ (none) ) -(defmethod debug-draw-path-from-history race-mesh ((obj race-mesh) (arg0 int) (arg1 int)) - (when (< arg1 (the-as int (-> obj path-group-count))) - (let ((v1-2 (-> obj path-groups arg1))) +(defmethod debug-draw-path-from-history race-mesh ((this race-mesh) (arg0 int) (arg1 int)) + (when (< arg1 (the-as int (-> this path-group-count))) + (let ((v1-2 (-> this path-groups arg1))) (countdown (a2-1 (-> v1-2 path-count)) (let ((a0-3 (-> v1-2 paths a2-1))) (when (= (-> a0-3 record-id) arg0) @@ -376,10 +376,10 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw-slice race-mesh ((obj race-mesh) (arg0 int)) - (let* ((v1-1 (-> obj slices arg0)) - (s3-0 (-> obj edges (-> v1-1 start-edge))) - (s4-0 (-> obj edges (-> v1-1 end-edge))) +(defmethod debug-draw-slice race-mesh ((this race-mesh) (arg0 int)) + (let* ((v1-1 (-> this slices arg0)) + (s3-0 (-> this edges (-> v1-1 start-edge))) + (s4-0 (-> this edges (-> v1-1 end-edge))) ) (add-debug-line #t @@ -434,14 +434,14 @@ (none) ) -(defmethod debug-draw-edges race-mesh ((obj race-mesh)) +(defmethod debug-draw-edges race-mesh ((this race-mesh)) (let ((idx 0) - (slice-cnt (+ (-> obj slice-count) -1)) + (slice-cnt (+ (-> this slice-count) -1)) ) (while (>= slice-cnt idx) - (let* ((v1-2 (-> obj slices idx)) - (s3-0 (-> obj edges (-> v1-2 start-edge))) - (s2-0 (-> obj edges (-> v1-2 end-edge))) + (let* ((v1-2 (-> this slices idx)) + (s3-0 (-> this edges (-> v1-2 start-edge))) + (s2-0 (-> this edges (-> v1-2 end-edge))) ) (add-debug-line #t (bucket-id debug-no-zbuf1) (-> s3-0 left) (-> s2-0 left) *color-white* #f (the-as rgba -1)) (add-debug-line @@ -458,7 +458,7 @@ (+! idx 1) ) ) - (let ((v1-8 (-> obj edges 0))) + (let ((v1-8 (-> this edges 0))) (add-debug-line #t (bucket-id debug-no-zbuf1) @@ -469,8 +469,8 @@ (the-as rgba -1) ) ) - (let ((s5-1 (+ (-> obj edge-count) -1))) - (let ((v1-12 (-> obj edges s5-1))) + (let ((s5-1 (+ (-> this edge-count) -1))) + (let ((v1-12 (-> this edges s5-1))) (add-debug-line #t (bucket-id debug-no-zbuf1) @@ -481,17 +481,17 @@ (the-as rgba -1) ) ) - (format *stdcon* "edge-count ~d last-edge ~d~%" (-> obj edge-count) s5-1) + (format *stdcon* "edge-count ~d last-edge ~d~%" (-> this edge-count) s5-1) ) 0 (none) ) -(defmethod race-mesh-method-19 race-mesh ((obj race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) +(defmethod race-mesh-method-19 race-mesh ((this race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) (set! (-> arg1 slice-id) -1) - (let* ((v1-2 (-> obj slices arg0)) - (a1-3 (-> obj edges (-> v1-2 start-edge))) - (v1-5 (-> obj edges (-> v1-2 end-edge))) + (let* ((v1-2 (-> this slices arg0)) + (a1-3 (-> this edges (-> v1-2 start-edge))) + (v1-5 (-> this edges (-> v1-2 end-edge))) ) (set! (-> arg1 slice-corners 0 quad) (-> a1-3 left quad)) (set! (-> arg1 slice-corners 1 quad) (-> a1-3 right quad)) @@ -542,9 +542,9 @@ #t ) -(defmethod race-mesh-method-17 race-mesh ((obj race-mesh) (slice-query race-mesh-slice-query)) +(defmethod race-mesh-method-17 race-mesh ((this race-mesh) (slice-query race-mesh-slice-query)) (set! (-> slice-query slice-id) -1) - (let* ((race-hash (-> obj hash)) + (let* ((race-hash (-> this hash)) (v1-2 (max 0 @@ -575,7 +575,7 @@ (+! s1-0 -1) (let ((a1-7 (-> (&-> (-> race-hash slice-table) 0 edge-index-array (+ (-> (the-as (pointer int16) s3-0)) s1-0)) 0)) ) - (when (race-mesh-method-19 obj (the-as int a1-7) s2-0) + (when (race-mesh-method-19 this (the-as int a1-7) s2-0) (if (or (= (-> slice-query slice-id) -1) (< (vector-vector-distance-squared (-> s2-0 pt-on-slice) (-> slice-query search-sphere)) (vector-vector-distance-squared (-> slice-query pt-on-slice) (-> slice-query search-sphere)) @@ -593,12 +593,12 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod race-mesh-method-15 race-mesh ((obj race-mesh) (id int) (slice-query race-mesh-slice-query)) +(defmethod race-mesh-method-15 race-mesh ((this race-mesh) (id int) (slice-query race-mesh-slice-query)) (local-vars (v1-8 symbol)) (set! (-> slice-query slice-id) id) - (let* ((v1-1 (-> obj slices id)) - (a1-3 (-> obj edges (-> v1-1 start-edge))) - (v1-4 (-> obj edges (-> v1-1 end-edge))) + (let* ((v1-1 (-> this slices id)) + (a1-3 (-> this edges (-> v1-1 start-edge))) + (v1-4 (-> this edges (-> v1-1 end-edge))) ) (set! (-> slice-query slice-corners 0 quad) (-> a1-3 left quad)) (set! (-> slice-query slice-corners 1 quad) (-> a1-3 right quad)) @@ -677,16 +677,16 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod race-mesh-method-18 race-mesh ((obj race-mesh) (arg0 race-mesh-hash-search) (arg1 int) (arg2 int) (arg3 race-mesh-slice-query)) - (let* ((v1-3 (+ (* arg2 (-> obj hash cells-wide)) arg1)) +(defmethod race-mesh-method-18 race-mesh ((this race-mesh) (arg0 race-mesh-hash-search) (arg1 int) (arg2 int) (arg3 race-mesh-slice-query)) + (let* ((v1-3 (+ (* arg2 (-> this hash cells-wide)) arg1)) (a0-1 (/ v1-3 8)) (a1-2 (ash 1 (logand v1-3 7))) (a2-4 (-> (the-as race-mesh-hash-search (+ a0-1 (the-as int arg0))) cell-bits 0 data 0)) ) (when (not (logtest? a2-4 a1-2)) (set! (-> arg0 cell-bits 0 data a0-1) (logior a2-4 a1-2)) - (let* ((v1-5 (the-as object (+ (the-as uint (-> obj hash cells)) (* v1-3 4)))) - (s3-0 (&-> (-> obj hash slice-table) 0 edge-index-array (-> (the-as (pointer int16) v1-5)))) + (let* ((v1-5 (the-as object (+ (the-as uint (-> this hash cells)) (* v1-3 4)))) + (s3-0 (&-> (-> this hash slice-table) 0 edge-index-array (-> (the-as (pointer int16) v1-5)))) (s1-0 (-> (the-as race-mesh-hash-cell v1-5) slice-count)) ) (when (nonzero? s1-0) @@ -701,7 +701,7 @@ ) (when (not (logtest? a2-9 a0-10)) (set! (-> arg0 slice-bits 0 data v1-6) (logior a2-9 a0-10)) - (race-mesh-method-15 obj (the-as int a1-7) s2-0) + (race-mesh-method-15 this (the-as int a1-7) s2-0) (let ((f0-0 (vector-vector-distance-squared (-> s2-0 pt-on-slice) (-> arg3 search-sphere)))) (when (or (= (-> arg3 slice-id) -1) (< f0-0 (-> arg0 best-dist))) (set! (-> arg0 best-dist) f0-0) @@ -720,12 +720,12 @@ (none) ) -(defmethod race-mesh-method-16 race-mesh ((obj race-mesh) (arg0 race-mesh-slice-query)) +(defmethod race-mesh-method-16 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) (set! (-> arg0 slice-id) -1) - (let ((s4-0 (-> obj hash)) + (let ((s4-0 (-> this hash)) (s3-0 (new 'stack-no-clear 'race-mesh-hash-search)) ) - (let ((v1-3 (/ (+ (-> obj slice-count) 127) 128))) + (let ((v1-3 (/ (+ (-> this slice-count) 127) 128))) (when (< 4 v1-3) (break!) 0 @@ -765,7 +765,7 @@ (until (< (-> s3-0 bounds max z) s2-0) (let ((s1-0 (-> s3-0 bounds min x))) (until (< (-> s3-0 bounds max x) s1-0) - (race-mesh-method-18 obj s3-0 s1-0 s2-0 arg0) + (race-mesh-method-18 this s3-0 s1-0 s2-0 arg0) (+! s1-0 1) ) ) @@ -780,15 +780,15 @@ (set! (-> s3-0 bounds max z) (min (+ (-> s3-0 bounds max z) 1) (+ (-> s4-0 cells-tall) -1))) (let ((s2-1 (-> s3-0 bounds min x))) (until (< (-> s3-0 bounds max x) s2-1) - (race-mesh-method-18 obj s3-0 s2-1 (-> s3-0 bounds min z) arg0) - (race-mesh-method-18 obj s3-0 s2-1 (-> s3-0 bounds max z) arg0) + (race-mesh-method-18 this s3-0 s2-1 (-> s3-0 bounds min z) arg0) + (race-mesh-method-18 this s3-0 s2-1 (-> s3-0 bounds max z) arg0) (+! s2-1 1) ) ) (let ((s2-2 (-> s3-0 bounds min z))) (until (< (-> s3-0 bounds max z) s2-2) - (race-mesh-method-18 obj s3-0 (-> s3-0 bounds min x) s2-2 arg0) - (race-mesh-method-18 obj s3-0 (-> s3-0 bounds max x) s2-2 arg0) + (race-mesh-method-18 this s3-0 (-> s3-0 bounds min x) s2-2 arg0) + (race-mesh-method-18 this s3-0 (-> s3-0 bounds max x) s2-2 arg0) (+! s2-2 1) ) ) @@ -800,7 +800,7 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod race-mesh-method-14 race-mesh ((obj race-mesh) (arg0 race-mesh-slice-query)) +(defmethod race-mesh-method-14 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) (let* ((f30-0 (vector-line-distance-point! (-> arg0 pt-on-slice) (the-as vector (-> arg0 slice-corners)) @@ -816,22 +816,22 @@ ) ) (f0-0 (+ f30-0 f1-0)) - (v1-1 (-> obj slices (-> arg0 slice-id))) - (f2-0 (-> obj edges (-> v1-1 start-edge) left w)) - (f3-0 (-> obj edges (-> v1-1 end-edge) left w)) + (v1-1 (-> this slices (-> arg0 slice-id))) + (f2-0 (-> this edges (-> v1-1 start-edge) left w)) + (f3-0 (-> this edges (-> v1-1 end-edge) left w)) ) (set! (-> arg0 lap-dist) (+ (* (/ f1-0 f0-0) f2-0) (* (/ f30-0 f0-0) f3-0))) ) (none) ) -(defmethod race-mesh-method-13 race-mesh ((obj race-mesh) (arg0 race-mesh-slice-query)) - (race-mesh-method-17 obj arg0) +(defmethod race-mesh-method-13 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) + (race-mesh-method-17 this arg0) (if (and (= (-> arg0 slice-id) -1) (< 0.0 (-> arg0 search-sphere r))) - (race-mesh-method-16 obj arg0) + (race-mesh-method-16 this arg0) ) (when (!= (-> arg0 slice-id) -1) - (race-mesh-method-14 obj arg0) + (race-mesh-method-14 this arg0) 0 ) (none) diff --git a/goal_src/jak2/levels/common/race/race-obs.gc b/goal_src/jak2/levels/common/race/race-obs.gc index ba70617e46..a9686596c8 100644 --- a/goal_src/jak2/levels/common/race/race-obs.gc +++ b/goal_src/jak2/levels/common/race/race-obs.gc @@ -102,16 +102,18 @@ ) -(defmethod race-signal-method-29 race-signal ((obj race-signal)) - (+! (-> obj y-offset) (* (- (-> obj dest-y-offset) (-> obj y-offset)) (fmin 1.0 (* 2.0 (seconds-per-frame))))) - (let ((f30-0 (* 0.0033333334 (the float (- (current-time) (-> obj bob-time)))))) - (set! (-> obj root trans y) (+ (-> obj pos y) (-> obj y-offset) (* 1024.0 (sin (* 32768.0 f30-0))))) - (set! (-> obj root trans z) (+ (-> obj pos z) (* 2048.0 (cos (* 32768.0 f30-0))))) +(defmethod race-signal-method-29 race-signal ((this race-signal)) + (+! (-> this y-offset) + (* (- (-> this dest-y-offset) (-> this y-offset)) (fmin 1.0 (* 2.0 (seconds-per-frame)))) + ) + (let ((f30-0 (* 0.0033333334 (the float (- (current-time) (-> this bob-time)))))) + (set! (-> this root trans y) (+ (-> this pos y) (-> this y-offset) (* 1024.0 (sin (* 32768.0 f30-0))))) + (set! (-> this root trans z) (+ (-> this pos z) (* 2048.0 (cos (* 32768.0 f30-0))))) ) - (let ((v1-15 (handle->process (-> obj banner)))) + (let ((v1-15 (handle->process (-> this banner)))) (when v1-15 - (set! (-> (the-as race-signal-banner v1-15) root trans quad) (-> obj root trans quad)) - (quaternion-copy! (-> (the-as race-signal-banner v1-15) root quat) (-> obj root quat)) + (set! (-> (the-as race-signal-banner v1-15) root trans quad) (-> this root trans quad)) + (quaternion-copy! (-> (the-as race-signal-banner v1-15) root quat) (-> this root quat)) ) ) (ja-post) @@ -257,7 +259,7 @@ (-> v1-8 trans) ) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (until #f (suspend) ) @@ -288,7 +290,7 @@ (until #f (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (suspend) ) ) @@ -299,7 +301,7 @@ ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 196) 600 #f #f self 5 :to self) (let ((gp-5 (current-time))) - (until (>= (- (current-time) gp-5) (seconds 0.5)) + (until (time-elapsed? gp-5 (seconds 0.5)) (suspend) ) ) @@ -310,7 +312,7 @@ ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 195) 300 #f #f self 7 :to self) (let ((gp-9 (current-time))) - (until (>= (- (current-time) gp-9) (seconds 0.5)) + (until (time-elapsed? gp-9 (seconds 0.5)) (suspend) ) ) @@ -321,13 +323,13 @@ ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 194) 300 #f #f self 9 :to self) (let ((gp-13 (current-time))) - (until (>= (- (current-time) gp-13) (seconds 0.5)) + (until (time-elapsed? gp-13 (seconds 0.5)) (suspend) ) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 197) 300 #f #f self 10 :to self) (let ((gp-15 (current-time))) - (until (>= (- (current-time) gp-15) (seconds 0.5)) + (until (time-elapsed? gp-15 (seconds 0.5)) (suspend) ) ) @@ -354,7 +356,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-race-signal" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> self bob-time) (current-time)) + (set-time! (-> self bob-time)) (set! (-> self banner) (the-as handle #f)) (set! (-> self draw shadow-mask) (the-as uint 30)) (set! (-> self draw shadow-values) (the-as uint #x22220)) @@ -389,15 +391,15 @@ :bounds (static-spherem 0 2 0 3) ) -(defmethod vehicle-rider-method-33 stadium-racer ((obj stadium-racer)) +(defmethod vehicle-rider-method-33 stadium-racer ((this stadium-racer)) (let ((t9-0 (method-of-type vehicle-rider vehicle-rider-method-33))) - (t9-0 obj) + (t9-0 this) ) - (setup-masks (-> obj draw) 0 -1) + (setup-masks (-> this draw) 0 -1) (let ((s4-0 0) (s5-0 0) ) - (case (-> obj rider-type) + (case (-> this rider-type) ((3) (set! s4-0 0) (set! s5-0 0) @@ -438,109 +440,109 @@ (let ((v1-14 s4-0)) (cond ((zero? v1-14) - (setup-masks (-> obj draw) 32 0) + (setup-masks (-> this draw) 32 0) ) ((= v1-14 1) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ((= v1-14 2) - (setup-masks (-> obj draw) #x40000 0) + (setup-masks (-> this draw) #x40000 0) ) ) ) (let ((v1-22 s4-0)) (cond ((zero? v1-22) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-22 1) - (setup-masks (-> obj draw) #x4000 0) + (setup-masks (-> this draw) #x4000 0) ) ((= v1-22 2) - (setup-masks (-> obj draw) #x80000 0) + (setup-masks (-> this draw) #x80000 0) ) ) ) (let ((v1-30 s4-0)) (cond ((zero? v1-30) - (setup-masks (-> obj draw) 512 0) + (setup-masks (-> this draw) 512 0) ) ((= v1-30 1) - (setup-masks (-> obj draw) #x8000 0) + (setup-masks (-> this draw) #x8000 0) ) ((= v1-30 2) - (setup-masks (-> obj draw) #x100000 0) + (setup-masks (-> this draw) #x100000 0) ) ) ) (cond ((zero? s4-0) - (setup-masks (-> obj draw) 2048 0) + (setup-masks (-> this draw) 2048 0) ) ((= s4-0 1) - (setup-masks (-> obj draw) #x20000 0) + (setup-masks (-> this draw) #x20000 0) ) ((= s4-0 2) - (setup-masks (-> obj draw) #x400000 0) + (setup-masks (-> this draw) #x400000 0) ) ) (let ((v1-49 s5-0)) (cond ((zero? v1-49) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) ((= v1-49 1) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ((= v1-49 2) - (setup-masks (-> obj draw) #x200000 0) + (setup-masks (-> this draw) #x200000 0) ) ) ) (let ((v1-58 (min 1 s5-0))) (cond ((zero? v1-58) - (setup-masks (-> obj draw) 64 0) + (setup-masks (-> this draw) 64 0) ) ((= v1-58 1) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ) ) (if (not (logtest? s5-0 1)) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ) 0 (none) ) -(defmethod initialize-collision stadium-racer ((obj stadium-racer)) - (set! (-> obj level) (level-get *level* 'lracelit)) - (stack-size-set! (-> obj main-thread) 256) - (when (not (-> obj level)) +(defmethod initialize-collision stadium-racer ((this stadium-racer)) + (set! (-> this level) (level-get *level* 'lracelit)) + (stack-size-set! (-> this main-thread) 256) + (when (not (-> this level)) (format 0 "stadium-racer::initialize-collision: ERROR, no lracelit level~%") (go process-drawable-art-error "no lracelit level") ) - (set! (-> obj root) (the-as collide-shape (new 'process 'trsqv))) + (set! (-> this root) (the-as collide-shape (new 'process 'trsqv))) 0 (none) ) -(defmethod vehicle-rider-method-32 stadium-racer ((obj stadium-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 stadium-racer ((this stadium-racer) (arg0 traffic-object-spawn-params)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stadium-racer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj flags) 1) - (set! (-> obj draw lod-set lod 0 dist) 286720.0) - (set! (-> obj rider-type) (-> arg0 user-data)) - (vehicle-rider-method-33 obj) - (if (logtest? (-> obj flags) 4) - (set! (-> obj riding-anim) 5) - (set! (-> obj riding-anim) 4) + (logior! (-> this flags) 1) + (set! (-> this draw lod-set lod 0 dist) 286720.0) + (set! (-> this rider-type) (-> arg0 user-data)) + (vehicle-rider-method-33 this) + (if (logtest? (-> this flags) 4) + (set! (-> this riding-anim) 5) + (set! (-> this riding-anim) 4) ) 0 (none) @@ -599,15 +601,15 @@ ) ) -(defmethod vehicle-rider-method-33 errol-rider ((obj errol-rider)) +(defmethod vehicle-rider-method-33 errol-rider ((this errol-rider)) (let ((t9-0 (method-of-type vehicle-rider vehicle-rider-method-33))) - (t9-0 obj) + (t9-0 this) ) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 2 0) - (setup-masks (-> obj draw) 4 0) - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 16 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 2 0) + (setup-masks (-> this draw) 4 0) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 16 0) 0 (none) ) @@ -628,10 +630,10 @@ ) -(defmethod find-ground turbo-pickup ((obj turbo-pickup)) +(defmethod find-ground turbo-pickup ((this turbo-pickup)) (let ((s4-0 #f)) (let ((gp-0 (new 'stack-no-clear 'do-push-aways-work))) - (set! (-> gp-0 push-vel quad) (-> obj root trans quad)) + (set! (-> gp-0 push-vel quad) (-> this root trans quad)) (set! (-> gp-0 cquery start-pos quad) (-> gp-0 push-vel quad)) (vector-reset! (-> gp-0 vec33)) (set! (-> gp-0 vec33 y) 1.0) @@ -653,8 +655,8 @@ (format #t "turbo-pickup::find-ground: ground y ~M~%" (-> gp-0 push-vel y)) ) ) - (set! (-> obj root trans quad) (-> gp-0 push-vel quad)) - (forward-up-nopitch->quaternion (-> obj root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec33)) + (set! (-> this root trans quad) (-> gp-0 push-vel quad)) + (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec33)) ) s4-0 ) @@ -684,7 +686,7 @@ (defstate die (turbo-pickup) :virtual #t :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 (let ((t9-1 (method-of-type part-tracker activate))) @@ -725,7 +727,7 @@ (set! (-> v1-11 prim-core collide-with) (collide-spec)) ) 0 - (until (>= (- (current-time) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (suspend) ) ) diff --git a/goal_src/jak2/levels/common/race/vehicle-racer.gc b/goal_src/jak2/levels/common/race/vehicle-racer.gc index 15700e8dfb..777d4e9975 100644 --- a/goal_src/jak2/levels/common/race/vehicle-racer.gc +++ b/goal_src/jak2/levels/common/race/vehicle-racer.gc @@ -33,22 +33,22 @@ ) -(defmethod race-control-method-12 race-control ((obj race-control) (arg0 vector)) - (let* ((f0-0 (-> obj path-t)) - (f0-2 (race-path-method-12 (-> obj path) arg0 (+ -1.0 f0-0) (+ 1.0 f0-0))) +(defmethod race-control-method-12 race-control ((this race-control) (arg0 vector)) + (let* ((f0-0 (-> this path-t)) + (f0-2 (race-path-method-12 (-> this path) arg0 (+ -1.0 f0-0) (+ 1.0 f0-0))) ) - (set! (-> obj path-t) f0-2) - (race-path-method-11 (-> obj path) (-> obj path-sample) (-> obj lin-velocity) f0-2) + (set! (-> this path-t) f0-2) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-2) ) 0 (none) ) -(defmethod race-control-method-11 race-control ((obj race-control) (arg0 float)) - (let ((f0-1 (+ (-> obj path-t) (* 15.0 arg0)))) +(defmethod race-control-method-11 race-control ((this race-control) (arg0 float)) + (let ((f0-1 (+ (-> this path-t) (* 15.0 arg0)))) (set! f0-1 (cond - ((logtest? (-> obj mesh flags) (race-mesh-flags racemeshflag-0)) - (let ((f1-3 (the float (-> obj path sample-count)))) + ((logtest? (-> this mesh flags) (race-mesh-flags racemeshflag-0)) + (let ((f1-3 (the float (-> this path sample-count)))) (if (>= f0-1 f1-3) (set! f0-1 (- f0-1 f1-3)) ) @@ -56,34 +56,34 @@ f0-1 ) (else - (fmin f0-1 (the float (+ (-> obj path sample-count) -1))) + (fmin f0-1 (the float (+ (-> this path sample-count) -1))) ) ) ) - (set! (-> obj path-t) f0-1) - (race-path-method-11 (-> obj path) (-> obj path-sample) (-> obj lin-velocity) f0-1) + (set! (-> this path-t) f0-1) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-1) ) - (vector-reset! (-> obj ang-velocity)) + (vector-reset! (-> this ang-velocity)) 0 (none) ) -(defmethod race-control-method-9 race-control ((obj race-control) (arg0 int) (arg1 vector)) - (let ((v1-1 (-> obj path-group path-count))) +(defmethod race-control-method-9 race-control ((this race-control) (arg0 int) (arg1 vector)) + (let ((v1-1 (-> this path-group path-count))) (if (>= arg0 v1-1) (set! arg0 0) ) - (set! (-> obj path-select) arg0) + (set! (-> this path-select) arg0) (cond ((> v1-1 0) - (let ((s4-0 (-> obj path-group paths arg0))) - (set! (-> obj path) s4-0) + (let ((s4-0 (-> this path-group paths arg0))) + (set! (-> this path) s4-0) (let ((s3-0 (new 'stack-no-clear 'race-mesh-slice-query))) (set! (-> s3-0 search-sphere quad) (-> arg1 quad)) (set! (-> s3-0 search-sphere r) 61440.0) - (race-mesh-method-13 (-> obj mesh) (the-as race-mesh-slice-query (&-> s3-0 slice-id))) + (race-mesh-method-13 (-> this mesh) (the-as race-mesh-slice-query (&-> s3-0 slice-id))) (when (!= (-> s3-0 slice-id) -1) - (let* ((v1-12 (-> obj mesh slices (-> s3-0 slice-id))) + (let* ((v1-12 (-> this mesh slices (-> s3-0 slice-id))) (f0-1 (-> (the-as (pointer float) (+ (* (-> v1-12 start-edge) 4) (the-as int (-> s4-0 edge-infos)))))) (f1-0 (-> (the-as race-path-edge-info (+ (* (-> v1-12 end-edge) 4) (the-as int (-> s4-0 edge-infos)))) sample-t) @@ -91,8 +91,8 @@ ) (when (and (>= f0-1 0.0) (>= f1-0 0.0)) (let ((f0-2 (race-path-method-12 s4-0 arg1 f0-1 f1-0))) - (set! (-> obj path-t) f0-2) - (race-path-method-11 (-> obj path) (-> obj path-sample) (-> obj lin-velocity) f0-2) + (set! (-> this path-t) f0-2) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-2) ) ) ) @@ -101,7 +101,7 @@ ) ) (else - (set! (-> obj path) #f) + (set! (-> this path) #f) ) ) ) @@ -109,13 +109,13 @@ (none) ) -(defmethod race-control-method-10 race-control ((obj race-control) (arg0 race-state) (arg1 racer-state)) - (set! (-> obj state) arg0) - (set! (-> obj mesh) (-> arg0 info mesh)) - (if (-> obj mesh) - (set! (-> obj path-group) (-> obj mesh path-groups 0)) +(defmethod race-control-method-10 race-control ((this race-control) (arg0 race-state) (arg1 racer-state)) + (set! (-> this state) arg0) + (set! (-> this mesh) (-> arg0 info mesh)) + (if (-> this mesh) + (set! (-> this path-group) (-> this mesh path-groups 0)) ) - (set! (-> obj racer-state) arg1) + (set! (-> this racer-state) arg1) 0 (none) ) @@ -151,22 +151,22 @@ ) -(defmethod vehicle-method-117 vehicle-racer ((obj vehicle-racer) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 vehicle-racer ((this vehicle-racer) (arg0 vector) (arg1 int) (arg2 int)) (vector-matrix*! arg0 - (-> obj info rider-hand-offset arg2) - (-> obj node-list data (-> obj rider-hand-joint) bone transform) + (-> this info rider-hand-offset arg2) + (-> this node-list data (-> this rider-hand-joint) bone transform) ) 0 (none) ) -(defmethod vehicle-method-137 vehicle-racer ((obj vehicle-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 vehicle-racer ((this vehicle-racer) (arg0 traffic-object-spawn-params)) (let ((t9-0 vehicle-rider-spawn) (v1-0 (-> arg0 user-data)) ) (t9-0 - obj + this (if (= v1-0 2) errol-rider stadium-racer @@ -179,7 +179,7 @@ ) ;; WARN: Return type mismatch number vs none. -(defmethod vehicle-racer-method-148 vehicle-racer ((obj vehicle-racer) (arg0 race-path) (arg1 race-mesh-slice)) +(defmethod vehicle-racer-method-148 vehicle-racer ((this vehicle-racer) (arg0 race-path) (arg1 race-mesh-slice)) (let ((f26-0 (the-as number 0.0)) (gp-0 (new 'stack-no-clear 'vehicle-physics-work)) (f30-0 (-> (the-as (pointer float) (+ (* (-> arg1 start-edge) 4) (the-as int (-> arg0 edge-infos)))))) @@ -187,9 +187,9 @@ ) (when (and (>= f30-0 0.0) (>= f28-0 0.0)) (let ((f26-1 1.0)) - (set! (-> gp-0 mat trans quad) (-> obj root trans quad)) - (set! (-> gp-0 velocity quad) (-> obj root transv quad)) - (quaternion-copy! (the-as quaternion (-> gp-0 force)) (-> obj root quat)) + (set! (-> gp-0 mat trans quad) (-> this root trans quad)) + (set! (-> gp-0 velocity quad) (-> this root transv quad)) + (quaternion-copy! (the-as quaternion (-> gp-0 force)) (-> this root quat)) (let* ((f0-2 (race-path-method-12 arg0 (-> gp-0 mat trans) f30-0 f28-0)) (a0-4 arg0) (t9-2 (method-of-type race-path race-path-method-11)) @@ -240,36 +240,36 @@ (none) ) -(defmethod vehicle-method-120 vehicle-racer ((obj vehicle-racer)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> *game-info* race-number-turbos) (-> obj turbo-pickup-count)) +(defmethod vehicle-method-120 vehicle-racer ((this vehicle-racer)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (set! (-> *game-info* race-number-turbos) (-> this turbo-pickup-count)) 0 ) - (logior! (-> obj skel status) (joint-control-status sync-math)) + (logior! (-> this skel status) (joint-control-status sync-math)) (let ((t9-0 (method-of-type vehicle vehicle-method-120))) - (t9-0 obj) + (t9-0 this) ) - (let ((v1-10 (-> obj root trans-old-old quad))) - (set! (-> obj root trans-old-old-old quad) v1-10) + (let ((v1-10 (-> this root trans-old-old quad))) + (set! (-> this root trans-old-old-old quad) v1-10) ) - (let ((v1-12 (-> obj root trans-old quad))) - (set! (-> obj root trans-old-old quad) v1-12) + (let ((v1-12 (-> this root trans-old quad))) + (set! (-> this root trans-old-old quad) v1-12) ) - (let ((v1-14 (-> obj root trans quad))) - (set! (-> obj root trans-old quad) v1-14) + (let ((v1-14 (-> this root trans quad))) + (set! (-> this root trans-old quad) v1-14) ) 0 (none) ) -(defmethod vehicle-method-66 vehicle-racer ((obj vehicle-racer)) - (when (and (not (logtest? (rigid-body-object-flag turbo-boost) (-> obj flags))) (> (-> obj turbo-pickup-count) 0)) - (+! (-> obj turbo-pickup-count) -1) - (set! (-> obj turbo-boost-time) (current-time)) - (set! (-> obj turbo-boost-factor) 1.0) - (set! (-> obj turbo-boost-duration) (the-as uint 150)) - (logior! (-> obj flags) (rigid-body-object-flag turbo-boost)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) +(defmethod vehicle-method-66 vehicle-racer ((this vehicle-racer)) + (when (and (not (logtest? (rigid-body-object-flag turbo-boost) (-> this flags))) (> (-> this turbo-pickup-count) 0)) + (+! (-> this turbo-pickup-count) -1) + (set-time! (-> this turbo-boost-time)) + (set! (-> this turbo-boost-factor) 1.0) + (set! (-> this turbo-boost-duration) (the-as uint 150)) + (logior! (-> this flags) (rigid-body-object-flag turbo-boost)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (sound-play "turbo-boost") ) ) @@ -277,79 +277,79 @@ (none) ) -(defmethod vehicle-method-136 vehicle-racer ((obj vehicle-racer) (arg0 traffic-object-spawn-params)) - (set! (-> obj draw lod-set lod 1 dist) 819200.0) - (set! (-> obj draw lod-set lod 2 dist) 1228800.0) +(defmethod vehicle-method-136 vehicle-racer ((this vehicle-racer) (arg0 traffic-object-spawn-params)) + (set! (-> this draw lod-set lod 1 dist) 819200.0) + (set! (-> this draw lod-set lod 2 dist) 1228800.0) (let* ((a1-1 *race-state*) (a2-0 (-> a1-1 racer-array (-> arg0 id))) ) - (race-control-method-10 (-> obj race) a1-1 a2-0) + (race-control-method-10 (-> this race) a1-1 a2-0) ) - (set! (-> obj shortcut-speed-factor) 0.0) + (set! (-> this shortcut-speed-factor) 0.0) (case (-> arg0 behavior) ((10) - (when (not (-> obj race mesh)) + (when (not (-> this race mesh)) (format #t "ERROR: vehicle-racer::go-start-state: no race-mesh found~%") - (go (method-of-object obj die)) + (go (method-of-object this die)) ) - (when (-> obj race mesh) - (race-control-method-9 (-> obj race) (-> obj traffic-priority-id) (-> obj root trans)) + (when (-> this race mesh) + (race-control-method-9 (-> this race) (-> this traffic-priority-id) (-> this root trans)) (cond ((logtest? (-> arg0 flags) (traffic-spawn-flags trsflags-01)) - (logior! (-> obj flags) (rigid-body-object-flag riding ai-driving)) + (logior! (-> this flags) (rigid-body-object-flag riding ai-driving)) (cond - ((-> obj race path) - (go (method-of-object obj waiting-for-start)) + ((-> this race path) + (go (method-of-object this waiting-for-start)) ) (else (format 0 "vehicle-racer::go-start-state: ERROR, no race-paths found~%") - (go (method-of-object obj die)) + (go (method-of-object this die)) ) ) ) (else - (logior! (-> obj flags) (rigid-body-object-flag waiting-for-player)) - (logior! (-> obj focus-status) (focus-status grabbed)) - (go (method-of-object obj waiting-race)) + (logior! (-> this flags) (rigid-body-object-flag waiting-for-player)) + (logior! (-> this focus-status) (focus-status grabbed)) + (go (method-of-object this waiting-race)) ) ) ) ) (else - ((method-of-type vehicle vehicle-method-136) obj arg0) + ((method-of-type vehicle vehicle-method-136) this arg0) ) ) 0 (none) ) -(defmethod vehicle-method-138 vehicle-racer ((obj vehicle-racer)) - (if (focus-test? obj grabbed) - (go (method-of-object obj waiting-for-start)) - (go (method-of-object obj player-control)) +(defmethod vehicle-method-138 vehicle-racer ((this vehicle-racer)) + (if (focus-test? this grabbed) + (go (method-of-object this waiting-for-start)) + (go (method-of-object this player-control)) ) 0 (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod rigid-body-object-method-45 vehicle-racer ((obj vehicle-racer) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 vehicle-racer ((this vehicle-racer) (arg0 rigid-body-impact)) (let ((t9-0 (method-of-type vehicle rigid-body-object-method-45))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (when (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (when (and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (< 40960.0 (-> arg0 impulse)) - (< 0.0 (-> obj hit-points)) + (< 0.0 (-> this hit-points)) ) (cond ((-> arg0 rbody) - (dotimes (s4-0 (-> obj info seat-count)) - (send-event (handle->process (-> obj rider-array s4-0)) 'vehicle-got-hit arg0) + (dotimes (s4-0 (-> this info seat-count)) + (send-event (handle->process (-> this rider-array s4-0)) 'vehicle-got-hit arg0) ) ) (else - (dotimes (s4-1 (-> obj info seat-count)) - (send-event (handle->process (-> obj rider-array s4-1)) 'vehicle-hit arg0) + (dotimes (s4-1 (-> this info seat-count)) + (send-event (handle->process (-> this rider-array s4-1)) 'vehicle-hit arg0) ) ) ) @@ -358,42 +358,42 @@ ) ;; WARN: disable def twice: 12. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod rigid-body-object-method-46 vehicle-racer ((obj vehicle-racer) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 vehicle-racer ((this vehicle-racer) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('test-ready) - (and (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) - (logtest? (-> obj flags) (rigid-body-object-flag riding)) + (and (and (-> this next-state) (= (-> this next-state name) 'waiting-for-start)) + (logtest? (-> this flags) (rigid-body-object-flag riding)) ) ) (('begin-race) - (logclear! (-> obj focus-status) (focus-status grabbed)) - (when (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) + (logclear! (-> this focus-status) (focus-status grabbed)) + (when (and (-> this next-state) (= (-> this next-state name) 'waiting-for-start)) (cond - ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag player-grabbed))) + ((logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag player-grabbed))) ) - (go (method-of-object obj player-control)) + (go (method-of-object this player-control)) ) (else - (go (method-of-object obj racing)) + (go (method-of-object this racing)) ) ) ) ) (('turbo-pickup) - (when (< (-> obj turbo-pickup-count) 3) + (when (< (-> this turbo-pickup-count) 3) (sound-play "turbo-pickup") - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (sound-play "turbo-pickup-pl") (send-event *target* 'color-effect 'eco-pill-dark (seconds 0.2)) ) - (+! (-> obj turbo-pickup-count) 1) + (+! (-> this turbo-pickup-count) 1) #t ) ) (('race-decision-point) - (when (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) + (when (logtest? (rigid-body-object-flag ai-driving) (-> this flags)) (let* ((v1-37 (the-as race-decision-point (-> arg3 param 0))) (a0-16 (-> v1-37 decision-type)) ) @@ -401,29 +401,29 @@ ((zero? a0-16) (cond ((and (nonzero? (-> v1-37 shortcuts)) - (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) - (< 0.1 (- (+ (-> obj race state target-pos) (-> obj race racer-state target-pos-offset)) - (-> obj race racer-state pos) + (>= (-> this race racer-state speed-factor) (-> this race state info ai-max-speed-factor)) + (< 0.1 (- (+ (-> this race state target-pos) (-> this race racer-state target-pos-offset)) + (-> this race racer-state pos) ) ) ) - (select-path-randomly-from-mask obj (-> v1-37 shortcuts)) - (set! (-> obj shortcut-time) (current-time)) - (set! (-> obj shortcut-speed-factor) 1.0) + (select-path-randomly-from-mask this (-> v1-37 shortcuts)) + (set-time! (-> this shortcut-time)) + (set! (-> this shortcut-speed-factor) 1.0) ) (else - (select-path-randomly-from-mask obj (-> v1-37 safe-paths)) - (set! (-> obj shortcut-speed-factor) 0.0) + (select-path-randomly-from-mask this (-> v1-37 safe-paths)) + (set! (-> this shortcut-speed-factor) 0.0) ) ) ) ((= a0-16 1) - (when (and (> (-> obj turbo-pickup-count) 0) - (< (-> obj path-deviation) 1.0) - (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) + (when (and (> (-> this turbo-pickup-count) 0) + (< (-> this path-deviation) 1.0) + (>= (-> this race racer-state speed-factor) (-> this race state info ai-max-speed-factor)) ) - (rigid-body-object-method-38 obj) - (vehicle-method-66 obj) + (rigid-body-object-method-38 this) + (vehicle-method-66 this) ) ) ) @@ -431,55 +431,55 @@ ) ) (('hide) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (send-event (ppointer->process (-> obj child)) 'hide) + (logior! (-> this draw status) (draw-control-status no-draw)) + (send-event (ppointer->process (-> this child)) 'hide) ) (('unhide) - (logclear! (-> obj draw status) (draw-control-status no-draw)) - (send-event (ppointer->process (-> obj child)) 'unhide) + (logclear! (-> this draw status) (draw-control-status no-draw)) + (send-event (ppointer->process (-> this child)) 'unhide) ) (('race-pass) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (speech-control-method-12 *speech-control* obj (if (-> *target* pilot as-daxter?) - (speech-type speech-type-45) - (speech-type speech-type-36) - ) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (speech-control-method-12 *speech-control* this (if (-> *target* pilot as-daxter?) + (speech-type speech-type-45) + (speech-type speech-type-36) + ) ) - (send-event (ppointer->process (-> obj child)) 'race-pass) + (send-event (ppointer->process (-> this child)) 'race-pass) ) ) (('race-got-passed) - (if (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) - (send-event (ppointer->process (-> obj child)) 'race-got-passed) + (if (not (logtest? (-> this flags) (rigid-body-object-flag player-driving))) + (send-event (ppointer->process (-> this child)) 'race-got-passed) ) ) (('race-finished) (let ((s5-2 (-> arg3 param 0))) - (select-path-randomly-from-mask obj s5-2) - (set! (-> obj damage-factor) 0.0) + (select-path-randomly-from-mask this s5-2) + (set! (-> this damage-factor) 0.0) (cond - ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag player-grabbed) (-> obj flags))) + ((logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag player-grabbed) (-> this flags))) ) (when (zero? s5-2) - (set! (-> obj race path) #f) + (set! (-> this race path) #f) #f ) ) (else - (go (method-of-object obj race-finished)) + (go (method-of-object this race-finished)) ) ) ) ) (else - ((method-of-type vehicle rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) + ((method-of-type vehicle rigid-body-object-method-46) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod select-path-randomly-from-mask vehicle-racer ((obj vehicle-racer) (arg0 uint)) +(defmethod select-path-randomly-from-mask vehicle-racer ((this vehicle-racer) (arg0 uint)) (let ((a0-1 0) (v1-0 0) (s5-0 (new 'stack-no-clear 'array 'int8 12)) @@ -495,7 +495,7 @@ (when (> a0-1 0) (let ((s5-1 (-> s5-0 (rand-vu-int-count a0-1)))) (format #t "vehicle-racer::select-path-randomly-from-mask: switching to path-~d~%" s5-1) - (race-control-method-9 (-> obj race) s5-1 (-> obj root trans)) + (race-control-method-9 (-> this race) s5-1 (-> this root trans)) ) ) ) @@ -503,7 +503,7 @@ (none) ) -(defmethod vehicle-racer-method-151 vehicle-racer ((obj vehicle-racer)) +(defmethod vehicle-racer-method-151 vehicle-racer ((this vehicle-racer)) (local-vars (v1-18 float) (v1-28 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -515,10 +515,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (-> obj race))) + (let ((s5-0 (-> this race))) (when (nonzero? s5-0) (race-control-method-11 s5-0 0.0) - (let ((s4-0 (-> obj rbody)) + (let ((s4-0 (-> this rbody)) (f30-0 (seconds-per-frame)) ) 1.0 @@ -547,7 +547,7 @@ (f1-5 1.0) (f2-2 40960.0) ) - (set! (-> obj path-deviation) (* f0-6 (/ f1-5 (* f2-2 f2-2)))) + (set! (-> this path-deviation) (* f0-6 (/ f1-5 (* f2-2 f2-2)))) ) (let ((a1-4 (-> s3-0 0 vector 2))) (let ((v1-22 (-> s3-0 0 vector 2))) @@ -616,18 +616,18 @@ (the-as quaternion (-> s3-0 1)) (* 10.0 f30-0) ) - (vector-float*! (-> s4-0 state lin-momentum) (-> s4-0 state lin-velocity) (-> obj info info mass)) + (vector-float*! (-> s4-0 state lin-momentum) (-> s4-0 state lin-velocity) (-> this info info mass)) (vector-reset! (-> s4-0 state ang-momentum)) (rigid-body-method-24 (-> s4-0 state)) (rigid-body-method-13 (-> s4-0 state)) - (set! (-> obj root transv quad) (-> s4-0 state lin-velocity quad)) - (quaternion-copy! (-> obj root quat) (-> s4-0 state rotation)) + (set! (-> this root transv quad) (-> s4-0 state lin-velocity quad)) + (quaternion-copy! (-> this root quat) (-> s4-0 state rotation)) (let ((v1-46 s4-0) - (a1-14 (-> obj root trans)) + (a1-14 (-> this root trans)) ) (rigid-body-method-23 (-> v1-46 state) a1-14) ) - (let* ((v1-51 (-> obj node-list data 0 bone transform)) + (let* ((v1-51 (-> this node-list data 0 bone transform)) (a3-1 (-> s4-0 state matrix)) (a0-20 (-> a3-1 quad 0)) (a1-15 (-> a3-1 quad 1)) @@ -639,27 +639,27 @@ (set! (-> v1-51 quad 2) a2-5) (set! (-> v1-51 trans quad) a3-2) ) - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) (race-control-method-11 s5-0 (* f30-0 f28-0)) ) ) ) ) - (vehicle-method-119 obj) - (vehicle-method-120 obj) - (update-transforms (-> obj root)) + (vehicle-method-119 this) + (vehicle-method-120 this) + (update-transforms (-> this root)) (let ((a1-17 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-17 options) (overlaps-others-options)) (set! (-> a1-17 collide-with-filter) (collide-spec civilian enemy obstacle)) (set! (-> a1-17 tlist) *touching-list*) - (find-overlapping-shapes (-> obj root) a1-17) + (find-overlapping-shapes (-> this root) a1-17) ) 0 (none) ) ) -(defmethod physics-post vehicle-racer ((obj vehicle-racer)) +(defmethod physics-post vehicle-racer ((this vehicle-racer)) (local-vars (v1-35 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -671,26 +671,26 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (-> obj race))) + (let ((s5-0 (-> this race))) (let ((s4-0 (new 'stack-no-clear 'inline-array 'matrix 9))) - (set! (-> s4-0 0 quad 0) (-> obj rbody state position quad)) - (set! (-> s4-0 0 vector 1 quad) (-> obj rbody state lin-velocity quad)) + (set! (-> s4-0 0 quad 0) (-> this rbody state position quad)) + (set! (-> s4-0 0 vector 1 quad) (-> this rbody state lin-velocity quad)) (set! (-> s4-0 3 vector 1 y) 0.0) - (set! (-> s4-0 1 vector 1 quad) (-> obj rbody state matrix quad 0)) + (set! (-> s4-0 1 vector 1 quad) (-> this rbody state matrix quad 0)) (set! (-> s4-0 1 vector 1 y) 0.0) (vector-normalize! (-> s4-0 1 vector 1) 1.0) - (set! (-> s4-0 1 vector 2 quad) (-> obj rbody state matrix vector 2 quad)) + (set! (-> s4-0 1 vector 2 quad) (-> this rbody state matrix vector 2 quad)) (set! (-> s4-0 3 vector 0 x) - (* (-> obj rbody state ang-velocity y) (vector-length (-> obj rbody state lin-velocity))) + (* (-> this rbody state ang-velocity y) (vector-length (-> this rbody state lin-velocity))) ) (set! (-> s4-0 3 vector 1 x) (seconds-per-frame)) (race-control-method-12 s5-0 (the-as vector (-> s4-0 0))) (set! (-> s4-0 3 vector 0 y) (vector-length (-> s4-0 0 vector 1))) (set! (-> s4-0 3 vector 0 z) (vector-length (-> s5-0 lin-velocity))) (set! (-> s4-0 3 vector 0 w) - (* (-> s4-0 3 vector 0 z) (fmax (-> s5-0 racer-state speed-factor) (-> obj shortcut-speed-factor))) + (* (-> s4-0 3 vector 0 z) (fmax (-> s5-0 racer-state speed-factor) (-> this shortcut-speed-factor))) ) - (if (logtest? (rigid-body-object-flag in-air turbo-boost) (-> obj flags)) + (if (logtest? (rigid-body-object-flag in-air turbo-boost) (-> this flags)) (set! (-> s4-0 3 vector 0 w) (* 2.0 (-> s4-0 3 vector 0 w))) ) (let ((v1-21 (-> s5-0 path-sample))) @@ -731,7 +731,7 @@ ) ) ) - (set! (-> obj path-deviation) (-> s4-0 3 vector 1 y)) + (set! (-> this path-deviation) (-> s4-0 3 vector 1 y)) (let ((a1-6 (-> s4-0 0 vector 2))) (let ((v1-39 (-> s4-0 2 trans))) (let ((a0-25 (-> s4-0 0 trans))) @@ -750,13 +750,13 @@ (vector-! (the-as vector (-> s4-0 1)) (-> s4-0 0 vector 2) (-> s4-0 0 vector 1)) (vector-float*! (-> s4-0 1 trans) (the-as vector (-> s4-0 1)) 1.5) (let ((f1-22 (* 0.00036621094 (- (-> s4-0 3 vector 0 w) (-> s4-0 3 vector 0 y)) (-> s4-0 3 vector 1 x)))) - (set! (-> obj ai-controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> obj ai-controls throttle) f1-22)))) + (set! (-> this ai-controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> this ai-controls throttle) f1-22)))) ) - (set! (-> obj ai-controls brake) + (set! (-> this ai-controls brake) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ (- -4096.0 (-> s4-0 3 vector 0 w)) (-> s4-0 3 vector 0 y))))) ) - (+! (-> obj ai-controls brake) (* (- (-> obj ai-controls brake)) (fmin 1.0 (* 8.0 (-> s4-0 3 vector 1 x))))) - (set! (-> obj ai-controls steering) + (+! (-> this ai-controls brake) (* (- (-> this ai-controls brake)) (fmin 1.0 (* 8.0 (-> s4-0 3 vector 1 x))))) + (set! (-> this ai-controls steering) (fmax -1.0 (fmin 1.0 (* 0.000000000048894434 (+ 40960.0 (-> s4-0 3 vector 0 y)) (vector-dot (-> s4-0 1 vector 1) (-> s4-0 1 trans)) @@ -766,65 +766,65 @@ ) (set! (-> s4-0 3 vector 1 y) (fmin 1.0 (-> s4-0 3 vector 1 y))) (set! (-> s4-0 2 vector 0 x) (+ (* (-> s4-0 2 vector 0 x) (- 1.0 (-> s4-0 3 vector 1 y))) - (* (-> obj ai-controls steering) (-> s4-0 3 vector 1 y)) + (* (-> this ai-controls steering) (-> s4-0 3 vector 1 y)) ) ) - (set! (-> s4-0 2 vector 0 y) (-> obj ai-controls throttle)) - (set! (-> s4-0 2 vector 0 z) (-> obj ai-controls brake)) - (vehicle-method-95 obj (the-as vector (-> s4-0 2))) + (set! (-> s4-0 2 vector 0 y) (-> this ai-controls throttle)) + (set! (-> s4-0 2 vector 0 z) (-> this ai-controls brake)) + (vehicle-method-95 this (the-as vector (-> s4-0 2))) ) (when (logtest? (-> s5-0 path-sample flags) 2) - (start-jump obj) + (start-jump this) 0 ) ) - (vehicle-method-121 obj) - (when (< (-> obj rbody state position y) -409600.0) + (vehicle-method-121 this) + (when (< (-> this rbody state position y) -409600.0) (format #t "vehicle-racer::physics-post: pid ~d fell to death from path-id ~d~%" - (-> obj pid) - (-> obj race path record-id) + (-> this pid) + (-> this race path record-id) ) - (go (method-of-object obj explode)) + (go (method-of-object this explode)) ) 0 (none) ) ) -(defmethod vehicle-racer-method-154 vehicle-racer ((obj vehicle-racer)) +(defmethod vehicle-racer-method-154 vehicle-racer ((this vehicle-racer)) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (if (and (logtest? (-> obj flags) (rigid-body-object-flag on-ground)) - (not (logtest? (rigid-body-object-flag turbo-boost) (-> obj flags))) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (if (and (logtest? (-> this flags) (rigid-body-object-flag on-ground)) + (not (logtest? (rigid-body-object-flag turbo-boost) (-> this flags))) (let ((f0-0 368640.0)) - (or (< (* f0-0 f0-0) (-> obj player-dist2)) + (or (< (* f0-0 f0-0) (-> this player-dist2)) (let ((f0-3 102400.0)) - (and (< (* f0-3 f0-3) (-> obj player-dist2)) - (not (logtest? (-> obj draw status) (draw-control-status on-screen))) + (and (< (* f0-3 f0-3) (-> this player-dist2)) + (not (logtest? (-> this draw status) (draw-control-status on-screen))) ) ) ) ) ) - (rigid-body-object-method-39 obj) + (rigid-body-object-method-39 this) ) ) (else - (let ((f0-6 (-> obj player-dist2)) + (let ((f0-6 (-> this player-dist2)) (f1-2 348160.0) ) - (if (and (< f0-6 (* f1-2 f1-2)) (let ((f0-7 (-> obj player-dist2)) + (if (and (< f0-6 (* f1-2 f1-2)) (let ((f0-7 (-> this player-dist2)) (f1-5 81920.0) ) (or (< f0-7 (* f1-5 f1-5)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) - (logtest? (rigid-body-object-flag turbo-boost) (-> obj flags)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (logtest? (rigid-body-object-flag turbo-boost) (-> this flags)) ) ) ) - (rigid-body-object-method-38 obj) + (rigid-body-object-method-38 this) ) ) ) @@ -833,56 +833,56 @@ (none) ) -(defmethod vehicle-racer-method-152 vehicle-racer ((obj vehicle-racer)) +(defmethod vehicle-racer-method-152 vehicle-racer ((this vehicle-racer)) (let ((s5-0 (new 'stack-no-clear 'matrix3))) - (set! (-> s5-0 vector 0 quad) (-> obj rbody state position quad)) - (set! (-> obj camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (target-pos 0))) + (set! (-> s5-0 vector 0 quad) (-> this rbody state position quad)) + (set! (-> this camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (target-pos 0))) ) - (if (>= (- (current-time) (-> obj shortcut-time)) (seconds 5)) - (set! (-> obj shortcut-speed-factor) 0.0) + (if (time-elapsed? (-> this shortcut-time) (seconds 5)) + (set! (-> this shortcut-speed-factor) 0.0) ) - (vehicle-racer-method-154 obj) - (if (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (physics-post obj) - (vehicle-racer-method-151 obj) + (vehicle-racer-method-154 this) + (if (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (physics-post this) + (vehicle-racer-method-151 this) ) 0 (none) ) -(defmethod vehicle-racer-method-155 vehicle-racer ((obj vehicle-racer)) +(defmethod vehicle-racer-method-155 vehicle-racer ((this vehicle-racer)) (let ((s5-0 (new 'stack-no-clear 'matrix3))) - (set! (-> s5-0 vector 0 quad) (-> obj rbody state position quad)) - (set! (-> obj camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (target-pos 0))) + (set! (-> s5-0 vector 0 quad) (-> this rbody state position quad)) + (set! (-> this camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (target-pos 0))) ) - (set! (-> obj shortcut-speed-factor) 0.0) - (vehicle-racer-method-154 obj) - (if (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) + (set! (-> this shortcut-speed-factor) 0.0) + (vehicle-racer-method-154 this) + (if (and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) ) - (rigid-body-object-method-38 obj) + (rigid-body-object-method-38 this) ) - (if (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (physics-post obj) - (vehicle-racer-method-151 obj) + (if (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (physics-post this) + (vehicle-racer-method-151 this) ) 0 (none) ) -(defmethod vehicle-method-124 vehicle-racer ((obj vehicle-racer)) +(defmethod vehicle-method-124 vehicle-racer ((this vehicle-racer)) (cond - ((and (logtest? (rigid-body-object-flag player-grabbed) (-> obj flags)) (-> obj race path)) - (vehicle-racer-method-155 obj) + ((and (logtest? (rigid-body-object-flag player-grabbed) (-> this flags)) (-> this race path)) + (vehicle-racer-method-155 this) ) (else - (vehicle-method-94 obj) - (vehicle-method-121 obj) + (vehicle-method-94 this) + (vehicle-method-121 this) ) ) - (vehicle-method-97 obj) + (vehicle-method-97 this) 0 (none) ) @@ -891,7 +891,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self flags) (rigid-body-object-flag ignition)) (set! (-> self controls throttle) 0.0) (set! (-> self controls brake) 0.0) @@ -949,7 +949,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self damage-factor) (-> self info damage-factor)) (vehicle-method-143 self) (logior! (-> self flags) (rigid-body-object-flag ignition)) @@ -973,7 +973,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self flags) (rigid-body-object-flag riding ignition)) (set! (-> self controls throttle) 0.0) (set! (-> self controls brake) 0.0) @@ -1011,7 +1011,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent riding nav-spheres) (-> self flags)) diff --git a/goal_src/jak2/levels/common/scene-actor.gc b/goal_src/jak2/levels/common/scene-actor.gc index 781bd1fc6a..cde2fd9729 100644 --- a/goal_src/jak2/levels/common/scene-actor.gc +++ b/goal_src/jak2/levels/common/scene-actor.gc @@ -282,27 +282,27 @@ ) -(defmethod get-art-elem kor-npc ((obj kor-npc)) +(defmethod get-art-elem kor-npc ((this kor-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor kor-hideout)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (else - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) -(defmethod init-art! kor-npc ((obj kor-npc)) +(defmethod init-art! kor-npc ((this kor-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-kor-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) @@ -335,30 +335,30 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! metalkor-highres ((obj metalkor-highres) (arg0 entity-actor)) +(defmethod init-from-entity! metalkor-highres ((this metalkor-highres) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-metalkor-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) (let ((s4-1 (process-spawn manipy :init manipy-init - (-> obj root trans) - (-> obj entity) + (-> this root trans) + (-> this entity) (art-group-get-by-name *level* "skel-metalkor-highres-lowtorso" (the-as (pointer uint32) #f)) #f 0 - :to obj + :to this ) ) ) @@ -368,12 +368,12 @@ This commonly includes things such as: (let ((s4-3 (process-spawn manipy :init manipy-init - (-> obj root trans) - (-> obj entity) + (-> this root trans) + (-> this entity) (art-group-get-by-name *level* "skel-metalkor-highres-legs" (the-as (pointer uint32) #f)) #f 0 - :to obj + :to this ) ) ) @@ -383,19 +383,19 @@ This commonly includes things such as: (let ((s4-5 (process-spawn manipy :init manipy-init - (-> obj root trans) - (-> obj entity) + (-> this root trans) + (-> this entity) (art-group-get-by-name *level* "skel-metalkor-highres-wings" (the-as (pointer uint32) #f)) #f 0 - :to obj + :to this ) ) ) (send-event (ppointer->process s4-5) 'anim-mode 'clone-anim) (send-event (ppointer->process s4-5) 'prefix "wings-") ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -408,14 +408,14 @@ This commonly includes things such as: ) -(defmethod get-art-elem tess-npc ((obj tess-npc)) +(defmethod get-art-elem tess-npc ((this tess-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor tess-alley)) (if (task-node-closed? (game-task-node ruins-tower-resolution)) - (-> obj draw art-group data 3) - (-> obj draw art-group data 4) + (-> this draw art-group data 3) + (-> this draw art-group data 4) ) ) (((game-task-actor tess-hiphog)) @@ -427,32 +427,32 @@ This commonly includes things such as: (task-node-open? (game-task-node city-errol-challenge-introduction)) (task-node-open? (game-task-node city-errol-challenge-race)) ) - (-> obj draw art-group data 6) + (-> this draw art-group data 6) ) ((and (task-node-closed? (game-task-node city-whack-pre-intro)) (not (task-node-closed? (game-task-node under-mech-resolution))) ) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod init-art! tess-npc ((obj tess-npc)) +(defmethod init-art! tess-npc ((this tess-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tess-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) @@ -466,27 +466,27 @@ This commonly includes things such as: ) -(defmethod get-art-elem keira-npc ((obj keira-npc)) +(defmethod get-art-elem keira-npc ((this keira-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor keira-stadium)) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod init-art! keira-npc ((obj keira-npc)) +(defmethod init-art! keira-npc ((this keira-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-keira-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) @@ -500,20 +500,20 @@ This commonly includes things such as: ) -(defmethod get-art-elem krew-npc ((obj krew-npc)) +(defmethod get-art-elem krew-npc ((this krew-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) -(defmethod init-art! krew-npc ((obj krew-npc)) +(defmethod init-art! krew-npc ((this krew-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-krew-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) @@ -527,33 +527,33 @@ This commonly includes things such as: ) -(defmethod init-art! kid-npc ((obj kid-npc)) +(defmethod init-art! kid-npc ((this kid-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-kid-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) -(defmethod get-art-elem kid-npc ((obj kid-npc)) +(defmethod get-art-elem kid-npc ((this kid-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor kid-alley)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (((game-task-actor kid-tomb) (game-task-actor kid-vinroom)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (((game-task-actor kid-hideout)) - (-> obj draw art-group data 6) + (-> this draw art-group data 6) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) @@ -567,30 +567,30 @@ This commonly includes things such as: ) -(defmethod get-art-elem crocadog-npc ((obj crocadog-npc)) +(defmethod get-art-elem crocadog-npc ((this crocadog-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor crocadog-vinroom)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (((game-task-actor crocadog-alley)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (else - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) -(defmethod init-art! crocadog-npc ((obj crocadog-npc)) +(defmethod init-art! crocadog-npc ((this crocadog-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crocadog-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) @@ -604,39 +604,39 @@ This commonly includes things such as: ) -(defmethod init-art! torn-npc ((obj torn-npc)) +(defmethod init-art! torn-npc ((this torn-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-torn-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) -(defmethod get-art-elem torn-npc ((obj torn-npc)) +(defmethod get-art-elem torn-npc ((this torn-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (cond ((task-node-open? (game-task-node ruins-tower-introduction)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ((task-node-open? (game-task-node ruins-tower-resolution)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (else - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) -(defmethod get-trans torn-npc ((obj torn-npc) (arg0 int)) +(defmethod get-trans torn-npc ((this torn-npc) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((v1-0 (-> obj root))) + (let ((v1-0 (-> this root))) (if (= arg0 2) - (vector<-cspace! (new 'static 'vector) (-> obj node-list data 6)) + (vector<-cspace! (new 'static 'vector) (-> this node-list data 6)) (-> v1-0 trans) ) ) @@ -651,71 +651,71 @@ This commonly includes things such as: ) -(defmethod init-art! youngsamos-npc ((obj youngsamos-npc)) +(defmethod init-art! youngsamos-npc ((this youngsamos-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-youngsamos-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (if (zero? (-> obj draw light-index)) - (set! (-> obj draw light-index) (the-as uint 30)) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 30)) ) 0 (none) ) -(defmethod process-taskable-method-32 youngsamos-npc ((obj youngsamos-npc)) - (case (-> obj task actor) +(defmethod process-taskable-method-32 youngsamos-npc ((this youngsamos-npc)) + (case (-> this task actor) (((game-task-actor youngsamos-forest)) (when (not (task-node-closed? (game-task-node forest-protect-resolution))) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-identity) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity) ) (ja-post) (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-0 pos quad) (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3)) quad)) + (set! (-> s5-0 pos quad) (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 3)) quad)) (quaternion-copy! (-> s5-0 quat) (eul->quat (new 'stack-no-clear 'quaternion) (new 'static 'euler-angles :x -16384.0 :y 16384.0)) ) (set! (-> s5-0 flags) (task-arrow-flags)) (set! (-> s5-0 map-icon) (the-as uint 15)) - (task-arrow-spawn s5-0 obj) + (task-arrow-spawn s5-0 this) ) ) ) ) - ((the-as (function process-taskable none) (find-parent-method youngsamos-npc 32)) obj) + ((the-as (function process-taskable none) (find-parent-method youngsamos-npc 32)) this) (none) ) -(defmethod get-art-elem youngsamos-npc ((obj youngsamos-npc)) +(defmethod get-art-elem youngsamos-npc ((this youngsamos-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor youngsamos-forest)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (((game-task-actor youngsamos-alley)) - (-> obj draw art-group data 7) + (-> this draw art-group data 7) ) (((game-task-actor youngsamos-hideout)) - (if (= (-> obj level name) 'lysamsam) - (-> obj draw art-group data 5) - (-> obj draw art-group data 6) + (if (= (-> this level name) 'lysamsam) + (-> this draw art-group data 5) + (-> this draw art-group data 6) ) ) (((game-task-actor youngsamos-tomb)) - (-> obj draw art-group data 8) + (-> this draw art-group data 8) ) (((game-task-actor youngsamos-onintent)) - (-> obj draw art-group data 9) + (-> this draw art-group data 9) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) @@ -729,30 +729,30 @@ This commonly includes things such as: ) -(defmethod init-art! samos-npc ((obj samos-npc)) +(defmethod init-art! samos-npc ((this samos-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-samos-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) -(defmethod get-art-elem samos-npc ((obj samos-npc)) +(defmethod get-art-elem samos-npc ((this samos-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor samos-hideout)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (((game-task-actor samos-garage)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) @@ -766,28 +766,28 @@ This commonly includes things such as: ) -(defmethod init-art! onin-npc ((obj onin-npc)) +(defmethod init-art! onin-npc ((this onin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-onin-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) -(defmethod get-art-elem onin-npc ((obj onin-npc)) +(defmethod get-art-elem onin-npc ((this onin-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (let ((v1-1 (get-current-task-event (-> obj task)))) + (let ((v1-1 (get-current-task-event (-> this task)))) (case (-> v1-1 action) (((game-task-action play)) - (set! (-> obj talk-message) (text-id press-triangle-to-play)) + (set! (-> this talk-message) (text-id press-triangle-to-play)) ) (else - (set! (-> obj talk-message) (text-id press-triangle-to-talk)) + (set! (-> this talk-message) (text-id press-triangle-to-talk)) ) ) (if (and (= (-> v1-1 action) (game-task-action play)) @@ -801,8 +801,8 @@ This commonly includes things such as: ) ) ) - (-> obj draw art-group data 6) - (-> obj draw art-group data 4) + (-> this draw art-group data 6) + (-> this draw art-group data 4) ) ) ) @@ -836,60 +836,60 @@ This commonly includes things such as: ) -(defmethod init-art! pecker-npc ((obj pecker-npc)) +(defmethod init-art! pecker-npc ((this pecker-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pecker-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) -(defmethod get-art-elem pecker-npc ((obj pecker-npc)) +(defmethod get-art-elem pecker-npc ((this pecker-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (local-vars (s5-0 art-joint-anim) (f30-0 float)) (cond - ((logtest? (-> (get-current-task-event (-> obj task)) flags) (game-task-flags gatflag-02)) - (-> obj draw art-group data 6) + ((logtest? (-> (get-current-task-event (-> this task)) flags) (game-task-flags gatflag-02)) + (-> this draw art-group data 6) ) ((begin - (set! s5-0 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (set! s5-0 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) (set! f30-0 (ja-aframe-num 0)) - (and (= s5-0 (-> obj draw art-group data 4)) (>= f30-0 0.0) (>= 118.999 f30-0)) + (and (= s5-0 (-> this draw art-group data 4)) (>= f30-0 0.0) (>= 118.999 f30-0)) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) - ((and (= s5-0 (-> obj draw art-group data 4)) + ((and (= s5-0 (-> this draw art-group data 4)) (>= f30-0 119.0) - (>= (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 4)) frames num-frames) -1)) + (>= (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 4)) frames num-frames) -1)) (ja-frame-num 0) ) ) (if (rand-vu-percent? 0.9) - (-> obj draw art-group data 4) - (-> obj draw art-group data 5) + (-> this draw art-group data 4) + (-> this draw art-group data 5) ) ) - ((and (= s5-0 (-> obj draw art-group data 5)) (>= f30-0 0.0) (>= 258.999 f30-0)) - (-> obj draw art-group data 5) + ((and (= s5-0 (-> this draw art-group data 5)) (>= f30-0 0.0) (>= 258.999 f30-0)) + (-> this draw art-group data 5) ) - ((and (= s5-0 (-> obj draw art-group data 5)) + ((and (= s5-0 (-> this draw art-group data 5)) (>= f30-0 259.0) - (>= (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 5)) frames num-frames) -1)) + (>= (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 5)) frames num-frames) -1)) (ja-frame-num 0) ) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (else - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) @@ -903,14 +903,14 @@ This commonly includes things such as: ) -(defmethod init-art! brutter-npc ((obj brutter-npc)) +(defmethod init-art! brutter-npc ((this brutter-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-brutter-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) @@ -924,32 +924,32 @@ This commonly includes things such as: ) -(defmethod init-art! ashelin-npc ((obj ashelin-npc)) +(defmethod init-art! ashelin-npc ((this ashelin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ashelin-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) -(defmethod get-art-elem ashelin-npc ((obj ashelin-npc)) +(defmethod get-art-elem ashelin-npc ((this ashelin-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor ashelin-throne)) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) - (let ((v1-7 (-> obj root root-prim))) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) + (let ((v1-7 (-> this root root-prim))) (set! (-> v1-7 prim-core collide-as) (collide-spec)) (set! (-> v1-7 prim-core collide-with) (collide-spec)) ) 0 ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) (deftype daxter-npc (process-taskable) @@ -961,22 +961,22 @@ This commonly includes things such as: ) -(defmethod init-art! daxter-npc ((obj daxter-npc)) +(defmethod init-art! daxter-npc ((this daxter-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sidekick-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) -(defmethod get-art-elem daxter-npc ((obj daxter-npc)) +(defmethod get-art-elem daxter-npc ((this daxter-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) (defskelgroup skel-prsn-torture prsn-torture prsn-torture-lod0-jg prsn-torture-idle-ja diff --git a/goal_src/jak2/levels/common/warp-gate.gc b/goal_src/jak2/levels/common/warp-gate.gc index c6095d67d8..31e61c8a17 100644 --- a/goal_src/jak2/levels/common/warp-gate.gc +++ b/goal_src/jak2/levels/common/warp-gate.gc @@ -477,26 +477,26 @@ ) -(defmethod handle-notice warp-gate ((obj warp-gate)) - (let ((s5-0 (script-eval (-> obj on-notice)))) +(defmethod handle-notice warp-gate ((this warp-gate)) + (let ((s5-0 (script-eval (-> this on-notice)))) (cond ((= s5-0 'hide) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (set! (-> obj continue) #f) + (logior! (-> this draw status) (draw-control-status no-draw)) + (set! (-> this continue) #f) ) (s5-0 - (logclear! (-> obj draw status) (draw-control-status no-draw)) - (set! (-> obj continue) (get-continue-by-name *game-info* (the-as string (car s5-0)))) - (set! (-> obj on-activate) (the-as pair (car (cdr s5-0)))) - (set! (-> obj wait-for) (the-as pair (car (cdr (cdr s5-0))))) - (set! (-> obj on-close) (the-as pair (car (cdr (cdr (cdr s5-0)))))) + (logclear! (-> this draw status) (draw-control-status no-draw)) + (set! (-> this continue) (get-continue-by-name *game-info* (the-as string (car s5-0)))) + (set! (-> this on-activate) (the-as pair (car (cdr s5-0)))) + (set! (-> this wait-for) (the-as pair (car (cdr (cdr s5-0))))) + (set! (-> this on-close) (the-as pair (car (cdr (cdr (cdr s5-0)))))) ) (else - (set! (-> obj continue) #f) + (set! (-> this continue) #f) ) ) ) - (-> obj continue) + (-> this continue) ) (defstate hidden (warp-gate) @@ -528,7 +528,7 @@ ) :code (behavior () (remove-setting! 'allow-progress) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (update-transforms (-> self root)) (until #f (handle-notice self) @@ -550,14 +550,14 @@ (or (= v1-30 'target-warp-in) (= v1-30 'target-warp-out)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) #f ) (else #t ) ) - (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (if (and (cpad-pressed? 0 triangle) (process-grab? *target* #f)) (go-virtual use (-> self continue)) @@ -637,7 +637,7 @@ (kill-current-talker (the-as symbol '()) '() 'exit) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (when (not arg0) (process-release? *target*) @@ -679,7 +679,7 @@ ) ) (label cfg-21) - (or v1-38 (< (- (current-time) (-> self state-time)) (seconds 2))) + (or v1-38 (not (time-elapsed? (-> self state-time) (seconds 2)))) ) (update! (-> self sound)) (suspend) @@ -691,7 +691,7 @@ ) (start 'play arg0) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -709,8 +709,8 @@ ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide warp-gate ((obj warp-gate)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-skel-and-collide warp-gate ((this warp-gate)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -725,10 +725,10 @@ (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-warp-gate" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -736,20 +736,20 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod setup-fields warp-gate ((obj warp-gate)) - (set! (-> obj level-name) (the-as uint (-> obj level name))) - (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice pair)) - (set! (-> obj on-activate) #f) - (set! (-> obj wait-for) #f) - (set! (-> obj continue) #f) - (set! (-> obj on-close) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 130) obj)) - (set! (-> obj center quad) (-> obj root trans quad)) - (+! (-> obj center y) 13516.8) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "warpgate" :fo-max 30) (-> obj root trans)) +(defmethod setup-fields warp-gate ((this warp-gate)) + (set! (-> this level-name) (the-as uint (-> this level name))) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair)) + (set! (-> this on-activate) #f) + (set! (-> this wait-for) #f) + (set! (-> this continue) #f) + (set! (-> this on-close) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 130) this)) + (set! (-> this center quad) (-> this root trans quad)) + (+! (-> this center y) 13516.8) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "warpgate" :fo-max 30) (-> this root trans)) ) - (set! (-> obj distance) (res-lump-float (-> obj entity) 'distance :default 20480.0)) + (set! (-> this distance) (res-lump-float (-> this entity) 'distance :default 20480.0)) (none) ) @@ -781,7 +781,7 @@ (none) ) -(defmethod init-from-entity! warp-gate ((obj warp-gate) (arg0 entity-actor)) +(defmethod init-from-entity! warp-gate ((this warp-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -840,7 +840,7 @@ This commonly includes things such as: ) ) :enter (behavior ((arg0 vector) (arg1 vector) (arg2 target)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *warp-jump-mods*) (set! (-> self control unknown-vector37 quad) (-> arg0 quad)) @@ -902,7 +902,7 @@ This commonly includes things such as: (set! (-> v1-20 prim-core collide-with) (collide-spec)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self trans-hook) (lambda :behavior target () @@ -928,7 +928,7 @@ This commonly includes things such as: (set! (-> gp-1 y) 0.0) (send-event *target* 'sidekick #f) (when (and (or (< (vector-dot gp-1 (-> self control transv)) 0.0) (-> self control unknown-spool-anim00)) - (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) ) (vector-seek! (-> self draw color-mult) (new 'static 'vector) (* 2.0 (seconds-per-frame))) (set! (-> self control transv x) (* 0.95 (-> self control transv x))) @@ -1019,7 +1019,7 @@ This commonly includes things such as: (vector-reset! (-> self control transv)) (move-to-point! (-> self control) (-> self control unknown-vector37)) (let ((s5-1 (current-time))) - (while (or (< (- (current-time) s5-1) (seconds 1)) + (while (or (not (time-elapsed? s5-1 (seconds 1))) (< 81920.0 (vector-vector-distance (camera-pos) (-> self control trans))) ) (suspend) @@ -1027,7 +1027,7 @@ This commonly includes things such as: ) (set-heading-vec! (-> self control) (-> self control transv)) (rot->dir-targ! (-> self control)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self post-hook) target-no-stick-post) (ja-channel-set! 1) (send-event @@ -1111,37 +1111,37 @@ This commonly includes things such as: ;; WARN: Return type mismatch warp-gate vs air-train. -(defmethod relocate air-train ((obj air-train) (arg0 int)) - (if (nonzero? (-> obj part-exhaust-left)) - (&+! (-> obj part-exhaust-left) arg0) +(defmethod relocate air-train ((this air-train) (arg0 int)) + (if (nonzero? (-> this part-exhaust-left)) + (&+! (-> this part-exhaust-left) arg0) ) - (if (nonzero? (-> obj part-exhaust-right)) - (&+! (-> obj part-exhaust-right) arg0) + (if (nonzero? (-> this part-exhaust-right)) + (&+! (-> this part-exhaust-right) arg0) ) - (if (nonzero? (-> obj part-dust)) - (&+! (-> obj part-dust) arg0) + (if (nonzero? (-> this part-dust)) + (&+! (-> this part-dust) arg0) ) - (the-as air-train ((method-of-type warp-gate relocate) obj arg0)) + (the-as air-train ((method-of-type warp-gate relocate) this arg0)) ) -(defmethod deactivate air-train ((obj air-train)) - (sound-stop (-> obj hover-sound)) - (if (nonzero? (-> obj part-exhaust-left)) - (kill-and-free-particles (-> obj part-exhaust-left)) +(defmethod deactivate air-train ((this air-train)) + (sound-stop (-> this hover-sound)) + (if (nonzero? (-> this part-exhaust-left)) + (kill-and-free-particles (-> this part-exhaust-left)) ) - (if (nonzero? (-> obj part-exhaust-right)) - (kill-and-free-particles (-> obj part-exhaust-right)) + (if (nonzero? (-> this part-exhaust-right)) + (kill-and-free-particles (-> this part-exhaust-right)) ) - (if (nonzero? (-> obj part-dust)) - (kill-and-free-particles (-> obj part-dust)) + (if (nonzero? (-> this part-dust)) + (kill-and-free-particles (-> this part-dust)) ) - ((method-of-type warp-gate deactivate) obj) + ((method-of-type warp-gate deactivate) this) (none) ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide air-train ((obj air-train)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-skel-and-collide air-train ((this air-train)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1176,10 +1176,10 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-air-train" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1187,30 +1187,30 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod setup-fields air-train ((obj air-train)) +(defmethod setup-fields air-train ((this air-train)) (let ((t9-0 (method-of-type warp-gate setup-fields))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj base-pos quad) (-> obj root trans quad)) - (let ((v1-2 (-> obj level-name))) - (set! (-> obj dust-y) (cond - ((= v1-2 'nest) - -1105.92 - ) - ((= v1-2 'caspad) - 114647.04 - ) - (else - (the-as float #x7f800000) + (set! (-> this base-pos quad) (-> this root trans quad)) + (let ((v1-2 (-> this level-name))) + (set! (-> this dust-y) (cond + ((= v1-2 'nest) + -1105.92 ) - ) + ((= v1-2 'caspad) + 114647.04 + ) + (else + (the-as float #x7f800000) + ) + ) ) ) - (set! (-> obj part-exhaust-left) (create-launch-control (-> *part-group-id-table* 134) obj)) - (set! (-> obj part-exhaust-right) (create-launch-control (-> *part-group-id-table* 134) obj)) - (set! (-> obj part-dust) (create-launch-control (-> *part-group-id-table* 132) obj)) - (set! (-> obj root pause-adjust-distance) 368640.0) - (set! (-> obj hover-sound) (sound-play "air-train")) + (set! (-> this part-exhaust-left) (create-launch-control (-> *part-group-id-table* 134) this)) + (set! (-> this part-exhaust-right) (create-launch-control (-> *part-group-id-table* 134) this)) + (set! (-> this part-dust) (create-launch-control (-> *part-group-id-table* 132) this)) + (set! (-> this root pause-adjust-distance) 368640.0) + (set! (-> this hover-sound) (sound-play "air-train")) (none) ) @@ -1246,7 +1246,7 @@ This commonly includes things such as: :virtual #t :code (behavior ((arg0 continue-point)) (kill-current-talker (the-as symbol '()) '() 'exit) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (when (not arg0) (process-release? *target*) diff --git a/goal_src/jak2/levels/consite/consite-obs.gc b/goal_src/jak2/levels/consite/consite-obs.gc index 83f3362816..50dbe19fde 100644 --- a/goal_src/jak2/levels/consite/consite-obs.gc +++ b/goal_src/jak2/levels/consite/consite-obs.gc @@ -32,17 +32,17 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-break-scaffold ((obj consite-break-scaffold) (arg0 entity-actor)) +(defmethod init-from-entity! consite-break-scaffold ((this consite-break-scaffold) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-consite-break-piece-break-d" (the-as (pointer uint32) #f)) @@ -52,12 +52,12 @@ This commonly includes things such as: (ja-post) (cond ((task-node-closed? (game-task-node consite-find-baron-resolution)) - (cleanup-for-death obj) - (logclear! (-> obj mask) (process-mask actor-pause)) + (cleanup-for-death this) + (logclear! (-> this mask) (process-mask actor-pause)) (go empty-state) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -97,24 +97,24 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-bomb-elevator-hinges ((obj consite-bomb-elevator-hinges) (arg0 entity-actor)) +(defmethod init-from-entity! consite-bomb-elevator-hinges ((this consite-bomb-elevator-hinges) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-consite-bomb-elevator-hinges" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -168,14 +168,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-bomb-elevator ((obj consite-bomb-elevator) (arg0 entity-actor)) +(defmethod init-from-entity! consite-bomb-elevator ((this consite-bomb-elevator) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -196,19 +196,19 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-consite-bomb-elevator" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (process-spawn consite-bomb-elevator-hinges obj arg0 :to obj) - (go (method-of-object obj idle)) + (process-spawn consite-bomb-elevator-hinges this arg0 :to this) + (go (method-of-object this idle)) (none) ) @@ -246,14 +246,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-silo-doors ((obj consite-silo-doors) (arg0 entity-actor)) +(defmethod init-from-entity! consite-silo-doors ((this consite-silo-doors) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -281,15 +281,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-consite-silo-doors" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -308,28 +308,28 @@ This commonly includes things such as: ) -(defmethod get-art-elem baron-npc ((obj baron-npc)) +(defmethod get-art-elem baron-npc ((this baron-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor baron-consite)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) -(defmethod init-art! baron-npc ((obj baron-npc)) +(defmethod init-art! baron-npc ((this baron-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-baron-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (set! (-> obj draw shadow) #f) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this draw shadow) #f) 0 (none) ) diff --git a/goal_src/jak2/levels/demo/demo-obs.gc b/goal_src/jak2/levels/demo/demo-obs.gc index 8819c2e5e9..a79245048e 100644 --- a/goal_src/jak2/levels/demo/demo-obs.gc +++ b/goal_src/jak2/levels/demo/demo-obs.gc @@ -34,23 +34,23 @@ ;; WARN: Return type mismatch process vs demo-control. -(defmethod relocate demo-control ((obj demo-control) (arg0 int)) +(defmethod relocate demo-control ((this demo-control) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj buffer v1-0)) - (&+! (-> obj buffer v1-0) arg0) + (if (nonzero? (-> this buffer v1-0)) + (&+! (-> this buffer v1-0) arg0) ) ) - (the-as demo-control ((method-of-type process relocate) obj arg0)) + (the-as demo-control ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate demo-control ((obj demo-control)) +(defmethod deactivate demo-control ((this demo-control)) (dotimes (s5-0 2) - (set-pending-file (-> obj buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) + (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) (dotimes (s5-1 2) - (update (-> obj buffer s5-1)) + (update (-> this buffer s5-1)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -146,6 +146,7 @@ ,(lambda ((arg0 process-drawable)) (logior! (-> arg0 draw global-effect) (draw-control-global-effect title-light)) (case (scf-get-territory) + ;; og:preserve-this constant ((GAME_TERRITORY_SCEE) (case (-> *setting-control* user-current language) (((language-enum spanish)) @@ -432,6 +433,7 @@ (defbehavior demo-screen-change demo-control ((arg0 int) (arg1 int) (arg2 symbol) (arg3 symbol)) (when arg3 (let ((s3-0 (the-as int (-> *setting-control* user-current language)))) + ;; og:preserve-this constant (if (and (= (the-as language-enum s3-0) (language-enum english)) (= (scf-get-territory) GAME_TERRITORY_SCEE)) (set! s3-0 7) ) @@ -471,7 +473,7 @@ (let ((s4-0 (current-time)) (s3-0 #f) ) - (while (not (or (>= (- (current-time) s4-0) arg1) (and (>= (- (current-time) s4-0) arg0) s3-0))) + (while (not (or (time-elapsed? s4-0 arg1) (and (time-elapsed? s4-0 arg0) s3-0))) (if (cpad-pressed? 0 triangle) (set! s3-0 #t) ) @@ -494,6 +496,7 @@ (text-id progress-demo-exit) ) ) + ;; og:preserve-this constant ((= (scf-get-territory) GAME_TERRITORY_SCEE) (new 'static 'boxed-array :type text-id (text-id atoll-unknown) (text-id strip-unknown)) ) @@ -568,6 +571,7 @@ ((or (zero? v1-1) (= v1-1 1)) (when (zero? (-> *game-info* demo-state)) (case (scf-get-territory) + ;; og:preserve-this constant ((GAME_TERRITORY_SCEI) (demo-screen-change 25 26 #t #f) (let ((a1-2 (new 'stack-no-clear 'array 'symbol 6))) @@ -606,6 +610,7 @@ (set! (-> self gui-id) (add-process *gui-control* self (gui-channel jak) (gui-action queue) "demoend" -99.0 0) ) + ;; og:preserve-this constant (if (and (!= (scf-get-territory) GAME_TERRITORY_SCEI) (= (-> *setting-control* user-current language) (language-enum japanese))) (demo-screen-change 2 -1 #t #f) (demo-screen-change 2 -1 #t #t) @@ -624,16 +629,17 @@ (the-as process #f) ) (cond + ;; og:preserve-this constant ((= (scf-get-territory) GAME_TERRITORY_SCEA) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.38)) + (until (time-elapsed? gp-3 (seconds 0.38)) (suspend) ) ) (set! (-> self sprite-draw) (the-as uint 3)) (set-vector! (-> self sprite-pos) -512.0 40.0 0.0 1.0) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.25)) + (until (time-elapsed? gp-4 (seconds 0.25)) (set! (-> self sprite-pos x) (lerp-scale -512.0 0.0 (sin (* 218.45334 (the float (- (current-time) gp-4)))) 0.0 1.0) ) @@ -641,12 +647,12 @@ ) ) (let ((gp-5 (current-time))) - (until (>= (- (current-time) gp-5) (seconds 2)) + (until (time-elapsed? gp-5 (seconds 2)) (suspend) ) ) (let ((gp-6 (current-time))) - (until (>= (- (current-time) gp-6) (seconds 0.25)) + (until (time-elapsed? gp-6 (seconds 0.25)) (set! (-> self sprite-pos x) (lerp-scale 0.0 512.0 (sin (* 218.45334 (the float (- (current-time) gp-6)))) 0.0 1.0) ) @@ -656,7 +662,7 @@ (set! (-> self sprite-draw) (the-as uint 1)) (set-vector! (-> self sprite-pos) 30.0 -240.0 0.0 1.0) (let ((gp-7 (current-time))) - (until (>= (- (current-time) gp-7) (seconds 0.25)) + (until (time-elapsed? gp-7 (seconds 0.25)) (set! (-> self sprite-pos y) (lerp-scale -240.0 270.0 (sin (* 218.45334 (the float (- (current-time) gp-7)))) 0.0 1.0) ) @@ -664,12 +670,12 @@ ) ) (let ((gp-8 (current-time))) - (until (>= (- (current-time) gp-8) (seconds 2)) + (until (time-elapsed? gp-8 (seconds 2)) (suspend) ) ) (let ((gp-9 (current-time))) - (until (>= (- (current-time) gp-9) (seconds 0.25)) + (until (time-elapsed? gp-9 (seconds 0.25)) (set! (-> self sprite-pos y) (lerp-scale 270.0 720.0 (sin (* 218.45334 (the float (- (current-time) gp-9)))) 0.0 1.0) ) @@ -679,7 +685,7 @@ (set! (-> self sprite-draw) (the-as uint 2)) (set-vector! (-> self sprite-pos) 20.0 40.0 0.0 1.0) (let ((gp-10 (current-time))) - (until (>= (- (current-time) gp-10) (seconds 0.25)) + (until (time-elapsed? gp-10 (seconds 0.25)) (set! (-> self sprite-pos y) (lerp-scale 720.0 20.0 (sin (* 218.45334 (the float (- (current-time) gp-10)))) 0.0 1.0) ) @@ -696,12 +702,12 @@ (want-levels *load-state* a1-21) ) (let ((gp-11 (current-time))) - (until (>= (- (current-time) gp-11) (seconds 2)) + (until (time-elapsed? gp-11 (seconds 2)) (suspend) ) ) (let ((gp-12 (current-time))) - (until (>= (- (current-time) gp-12) (seconds 0.25)) + (until (time-elapsed? gp-12 (seconds 0.25)) (set! (-> self sprite-pos y) (lerp-scale 20.0 -720.0 (sin (* 218.45334 (the float (- (current-time) gp-12)))) 0.0 1.0) ) @@ -711,54 +717,54 @@ ) (else (let ((gp-13 (current-time))) - (until (>= (- (current-time) gp-13) (seconds 0.38)) + (until (time-elapsed? gp-13 (seconds 0.38)) (suspend) ) ) (let ((gp-14 (current-time))) - (until (>= (- (current-time) gp-14) (seconds 2)) + (until (time-elapsed? gp-14 (seconds 2)) (suspend) ) ) (let ((gp-15 (current-time))) - (until (>= (- (current-time) gp-15) (seconds 0.25)) + (until (time-elapsed? gp-15 (seconds 0.25)) (suspend) ) ) (let ((gp-16 (current-time))) - (until (>= (- (current-time) gp-16) (seconds 0.25)) + (until (time-elapsed? gp-16 (seconds 0.25)) (suspend) ) ) (let ((gp-17 (current-time))) - (until (>= (- (current-time) gp-17) (seconds 2)) + (until (time-elapsed? gp-17 (seconds 2)) (suspend) ) ) (let ((gp-18 (current-time))) - (until (>= (- (current-time) gp-18) (seconds 0.25)) + (until (time-elapsed? gp-18 (seconds 0.25)) (suspend) ) ) (let ((gp-19 (current-time))) - (until (>= (- (current-time) gp-19) (seconds 0.25)) + (until (time-elapsed? gp-19 (seconds 0.25)) (suspend) ) ) (let ((gp-20 (current-time))) - (until (>= (- (current-time) gp-20) (seconds 2)) + (until (time-elapsed? gp-20 (seconds 2)) (suspend) ) ) (let ((gp-21 (current-time))) - (until (>= (- (current-time) gp-21) (seconds 0.25)) + (until (time-elapsed? gp-21 (seconds 0.25)) (suspend) ) ) ) ) (let ((gp-22 (current-time))) - (until (>= (- (current-time) gp-22) (seconds 3)) + (until (time-elapsed? gp-22 (seconds 3)) (suspend) ) ) @@ -777,7 +783,7 @@ (script-eval '(fadeout (seconds (new 'static 'bfloat :data 0.3)))) (let ((s5-8 (current-time))) (while (or (!= (-> *setting-control* user-current bg-a) (-> *setting-control* user-target bg-a)) - (< (- (current-time) s5-8) (seconds 0.3)) + (not (time-elapsed? s5-8 (seconds 0.3))) ) (suspend) ) @@ -1379,6 +1385,7 @@ ) ) +;; og:preserve-this constant (when (= (scf-get-territory) GAME_TERRITORY_SCEE) (let ((v1-40 (get-field-spec-by-id (-> *part-id-table* 5483) (sp-field-id spt-userdata)))) (if v1-40 @@ -1402,6 +1409,7 @@ ) ) +;; og:preserve-this constant (when (= (scf-get-territory) GAME_TERRITORY_SCEI) (let ((v1-47 (get-field-spec-by-id (-> *part-id-table* 5483) (sp-field-id spt-userdata)))) (if v1-47 @@ -1425,6 +1433,7 @@ ) ) +;; og:preserve-this constant (when (= (scf-get-territory) GAME_TERRITORY_SCEK) (let ((v1-54 (get-field-spec-by-id (-> *part-id-table* 5483) (sp-field-id spt-userdata)))) (if v1-54 diff --git a/goal_src/jak2/levels/dig/dig-digger.gc b/goal_src/jak2/levels/dig/dig-digger.gc index ee544769b4..267bd85214 100644 --- a/goal_src/jak2/levels/dig/dig-digger.gc +++ b/goal_src/jak2/levels/dig/dig-digger.gc @@ -483,39 +483,39 @@ ) ) -(defmethod draw hud-dig-clasp ((obj hud-dig-clasp)) +(defmethod draw hud-dig-clasp ((this hud-dig-clasp)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 210 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -18 29) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -18 29) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-dig-clasp ((obj hud-dig-clasp)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-dig-clasp ((this hud-dig-clasp)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-dig-clasp ((obj hud-dig-clasp)) - (set! (-> obj level) (level-get *level* 'dig1)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-dig-clasp ((this hud-dig-clasp)) + (set! (-> this level) (level-get *level* 'dig1)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1c))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1c))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -565,10 +565,10 @@ ) ) -(defmethod dig-clasp-method-23 dig-clasp ((obj dig-clasp) (arg0 vector)) - (if (-> obj b) - (vector<-cspace! arg0 (-> obj node-list data 3)) - (vector<-cspace! arg0 (-> obj node-list data 6)) +(defmethod dig-clasp-method-23 dig-clasp ((this dig-clasp) (arg0 vector)) + (if (-> this b) + (vector<-cspace! arg0 (-> this node-list data 3)) + (vector<-cspace! arg0 (-> this node-list data 6)) ) ) @@ -676,14 +676,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-clasp ((obj dig-clasp) (arg0 entity-actor)) +(defmethod init-from-entity! dig-clasp ((this dig-clasp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -697,21 +697,21 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-clasp" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 1)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1142) obj)) - (set! (-> obj b) #f) - (set! (-> obj conn) (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector #t) 0)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj broken)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1142) this)) + (set! (-> this b) #f) + (set! (-> this conn) (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector #t) 0)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this broken)) + (go (method-of-object this idle)) ) (none) ) @@ -726,7 +726,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-clasp-b ((obj dig-clasp-b) (arg0 entity-actor)) +(defmethod init-from-entity! dig-clasp-b ((this dig-clasp-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -734,7 +734,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (when (not (task-node-closed? (game-task-node dig-knock-down-resolution))) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -748,21 +748,21 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-clasp-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 1)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1142) obj)) - (set! (-> obj b) (the-as basic #t)) - (set! (-> obj conn) (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector #t) 0)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj broken)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1142) this)) + (set! (-> this b) (the-as basic #t)) + (set! (-> this conn) (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector #t) 0)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this broken)) + (go (method-of-object this idle)) ) ) (none) @@ -818,10 +818,10 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 80) ) -(defmethod dig-tether-method-22 dig-tether ((obj dig-tether)) +(defmethod dig-tether-method-22 dig-tether ((this dig-tether)) (with-pp - (when (-> obj clasp) - (let* ((s4-0 (-> obj clasp extra process)) + (when (-> this clasp) + (let* ((s4-0 (-> this clasp extra process)) (s5-0 (if (type? s4-0 dig-clasp) s4-0 ) @@ -833,13 +833,13 @@ This commonly includes things such as: (set! (-> a1-1 message) 'broken?) (cond ((or (send-event-function s5-0 a1-1) - (logtest? (-> obj clasp extra perm status) (entity-perm-status subtask-complete)) + (logtest? (-> this clasp extra perm status) (entity-perm-status subtask-complete)) ) - (go (method-of-object obj broken)) + (go (method-of-object this broken)) ) (s5-0 - (send-event s5-0 'tether-position (-> obj clasp-pos)) - (set! (-> obj clasp-info-ok) #t) + (send-event s5-0 'tether-position (-> this clasp-pos)) + (set! (-> this clasp-info-ok) #t) ) ) ) @@ -849,59 +849,59 @@ This commonly includes things such as: ) ) -(defmethod dig-tether-method-23 dig-tether ((obj dig-tether)) - (set-params! (-> obj chain-offset-rand) 75 150 2048.0 204.8) - (set-params! (-> obj chain-offset) (the-as vector #f) 4.096 20.48 0.9) - (mode-set! (-> obj joint-one) (joint-mod-mode joint-set-world)) +(defmethod dig-tether-method-23 dig-tether ((this dig-tether)) + (set-params! (-> this chain-offset-rand) 75 150 2048.0 204.8) + (set-params! (-> this chain-offset) (the-as vector #f) 4.096 20.48 0.9) + (mode-set! (-> this joint-one) (joint-mod-mode joint-set-world)) (dotimes (s5-0 7) (cond - ((-> obj clasp-info-ok) - (vector<-cspace! (the-as vector (-> obj chain-joints s5-0)) (-> obj chain-joints s5-0 joint-mod joint)) + ((-> this clasp-info-ok) + (vector<-cspace! (the-as vector (-> this chain-joints s5-0)) (-> this chain-joints s5-0 joint-mod joint)) ) (else - (set! (-> obj chain-joints s5-0 position quad) (-> obj root trans quad)) - (set! (-> obj chain-joints s5-0 position y) - (- (-> obj chain-joints s5-0 position y) (* 4096.0 (the float s5-0))) + (set! (-> this chain-joints s5-0 position quad) (-> this root trans quad)) + (set! (-> this chain-joints s5-0 position y) + (- (-> this chain-joints s5-0 position y) (* 4096.0 (the float s5-0))) ) ) ) ;; og:preserve-this hack ;; original - ;; (vector-reset! (+ (the-as uint (-> obj chain-joints 0 velocity)) (* 48 s5-0))) - (vector-reset! (-> obj chain-joints s5-0 velocity)) ;; hack - (mode-set! (-> obj chain-joints s5-0 joint-mod) (joint-mod-mode joint-set-world)) + ;; (vector-reset! (+ (the-as uint (-> this chain-joints 0 velocity)) (* 48 s5-0))) + (vector-reset! (-> this chain-joints s5-0 velocity)) ;; hack + (mode-set! (-> this chain-joints s5-0 joint-mod) (joint-mod-mode joint-set-world)) ) - (set! (-> obj chain-joints 7 position quad) (-> obj chain-joints 6 position quad)) - (vector-reset! (-> obj chain-joints 7 velocity)) - (lods-assign! (-> obj draw) (-> obj snapped-look)) + (set! (-> this chain-joints 7 position quad) (-> this chain-joints 6 position quad)) + (vector-reset! (-> this chain-joints 7 velocity)) + (lods-assign! (-> this draw) (-> this snapped-look)) (none) ) -(defmethod dig-tether-method-24 dig-tether ((obj dig-tether)) +(defmethod dig-tether-method-24 dig-tether ((this dig-tether)) (local-vars (sv-144 dig-tether-chain) (sv-160 vector)) - (update-with-delay! (-> obj chain-offset-rand)) - (update! (-> obj chain-offset) (-> obj chain-offset-rand value)) + (update-with-delay! (-> this chain-offset-rand)) + (update! (-> this chain-offset) (-> this chain-offset-rand value)) (let ((s5-0 (new 'stack-no-clear 'matrix)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> obj root trans quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) (let ((s3-0 (new 'stack-no-clear 'vector)) (f30-0 0.2) - (s2-0 (-> obj chain-offset)) + (s2-0 (-> this chain-offset)) (f28-0 0.1) (s1-0 (new 'stack-no-clear 'vector)) ) - (vector-! (-> s5-0 vector 2) (the-as vector (-> obj chain-joints)) (-> obj root trans)) + (vector-! (-> s5-0 vector 2) (the-as vector (-> this chain-joints)) (-> this root trans)) (vector-normalize! (-> s5-0 vector 2) 1.0) - (vector-cross! (the-as vector (-> s5-0 vector)) (-> obj digger-vertical) (-> s5-0 vector 2)) + (vector-cross! (the-as vector (-> s5-0 vector)) (-> this digger-vertical) (-> s5-0 vector 2)) (vector-normalize! (the-as vector (-> s5-0 vector)) 1.0) (vector-cross! (-> s5-0 vector 1) (-> s5-0 vector 2) (the-as vector (-> s5-0 vector))) - (matrix->quaternion (-> obj root quat) s5-0) - (set! (-> obj joint-one trans quad) (-> obj root trans quad)) - (quaternion-copy! (-> obj joint-one quat) (-> obj root quat)) + (matrix->quaternion (-> this root quat) s5-0) + (set! (-> this joint-one trans quad) (-> this root trans quad)) + (quaternion-copy! (-> this joint-one quat) (-> this root quat)) (set! (-> s3-0 quad) (-> s5-0 vector 1 quad)) (dotimes (s0-0 8) - (set! sv-144 (-> obj chain-joints s0-0)) + (set! sv-144 (-> this chain-joints s0-0)) (set! sv-160 (new 'stack-no-clear 'vector)) (let ((v1-23 (-> sv-144 position quad))) (set! (-> sv-160 quad) v1-23) @@ -913,7 +913,7 @@ This commonly includes things such as: (vector+float*! sv-160 sv-160 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* 48 (+ s0-0 1)))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* 48 (+ s0-0 1)))) f30-0 ) (set! f30-0 (fmin 0.9 (+ 0.2 f30-0))) @@ -921,8 +921,8 @@ This commonly includes things such as: (vector-! s1-0 sv-160 s4-0) (vector-normalize! s1-0 12288.0) (vector+! sv-160 s1-0 s4-0) - (vector-! s1-0 sv-160 (-> obj digger-pos)) - (vector-flatten! s1-0 s1-0 (-> obj digger-vertical)) + (vector-! s1-0 sv-160 (-> this digger-pos)) + (vector-flatten! s1-0 s1-0 (-> this digger-vertical)) (let ((f0-6 (vector-normalize-ret-len! s1-0 1.0))) (if (< f0-6 73728.0) (vector+float*! sv-160 sv-160 s1-0 (- 73728.0 f0-6)) @@ -941,7 +941,7 @@ This commonly includes things such as: (set! (-> sv-144 joint-mod trans quad) (-> sv-160 quad)) ) (when (< s0-0 7) - (vector-! (-> s5-0 vector 2) (the-as vector (-> obj chain-joints (+ s0-0 1))) sv-160) + (vector-! (-> s5-0 vector 2) (the-as vector (-> this chain-joints (+ s0-0 1))) sv-160) (vector-normalize! (-> s5-0 vector 2) 1.0) (vector-cross! (the-as vector (-> s5-0 vector)) s3-0 (-> s5-0 vector 2)) (vector-normalize! (the-as vector (-> s5-0 vector)) 1.0) @@ -1037,16 +1037,16 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs dig-tether. -(defmethod relocate dig-tether ((obj dig-tether) (arg0 int)) - (if (nonzero? (-> obj joint-one)) - (&+! (-> obj joint-one) arg0) +(defmethod relocate dig-tether ((this dig-tether) (arg0 int)) + (if (nonzero? (-> this joint-one)) + (&+! (-> this joint-one) arg0) ) (dotimes (v1-4 7) - (if (nonzero? (-> obj chain-joints v1-4 joint-mod)) - (&+! (-> obj chain-joints v1-4 joint-mod) arg0) + (if (nonzero? (-> this chain-joints v1-4 joint-mod)) + (&+! (-> this chain-joints v1-4 joint-mod) arg0) ) ) - (the-as dig-tether ((method-of-type process-drawable relocate) obj arg0)) + (the-as dig-tether ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. @@ -1131,20 +1131,20 @@ This commonly includes things such as: :origin-joint-index 3 ) -(defmethod dig-digger-method-22 dig-digger ((obj dig-digger) (arg0 int)) - (if (and (> (-> obj actor-group-count) 0) (< arg0 (-> obj actor-group 0 length))) - (-> obj actor-group 0 data arg0 actor) +(defmethod dig-digger-method-22 dig-digger ((this dig-digger) (arg0 int)) + (if (and (> (-> this actor-group-count) 0) (< arg0 (-> this actor-group 0 length))) + (-> this actor-group 0 data arg0 actor) (the-as entity #f) ) ) -(defmethod dig-digger-method-23 dig-digger ((obj dig-digger)) +(defmethod dig-digger-method-23 dig-digger ((this dig-digger)) (dotimes (s5-0 24) - (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj tethers s5-0 rp)))) - (s3-0 (dig-digger-method-22 obj s5-0)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this tethers s5-0 rp)))) + (s3-0 (dig-digger-method-22 this s5-0)) ) - (if (and s3-0 (not (handle->process (-> obj tethers s5-0 handle)))) - (set! (-> obj tethers s5-0 handle) (ppointer->handle (process-spawn dig-tether s4-0 s3-0 :to obj))) + (if (and s3-0 (not (handle->process (-> this tethers s5-0 handle)))) + (set! (-> this tethers s5-0 handle) (ppointer->handle (process-spawn dig-tether s4-0 s3-0 :to this))) ) ) ) @@ -1152,25 +1152,25 @@ This commonly includes things such as: (none) ) -(defmethod dig-digger-method-24 dig-digger ((obj dig-digger)) - (set! (-> obj vertical target x) 0.0) - (set! (-> obj vertical target z) 0.0) - (let ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> obj vertical)) 1.0)) +(defmethod dig-digger-method-24 dig-digger ((this dig-digger)) + (set! (-> this vertical target x) 0.0) + (set! (-> this vertical target z) 0.0) + (let ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this vertical)) 1.0)) (s5-0 0) ) (dotimes (s3-0 24) - (let* ((s2-0 (-> obj tethers s3-0)) + (let* ((s2-0 (-> this tethers s3-0)) (s1-0 (handle->process (-> s2-0 handle))) ) (cond (s1-0 - (let ((v1-10 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj tethers s3-0 rp))))) - (send-event s1-0 'set-pos v1-10 (-> obj root trans) s4-0) + (let ((v1-10 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this tethers s3-0 rp))))) + (send-event s1-0 'set-pos v1-10 (-> this root trans) s4-0) ) (cond ((send-event s1-0 'broken?) - (+! (-> obj vertical target x) (-> s2-0 broken-x)) - (+! (-> obj vertical target z) (-> s2-0 broken-z)) + (+! (-> this vertical target x) (-> s2-0 broken-x)) + (+! (-> this vertical target z) (-> s2-0 broken-z)) ) (else (+! s5-0 1) @@ -1178,21 +1178,21 @@ This commonly includes things such as: ) ) (else - (+! (-> obj vertical target x) (-> s2-0 broken-x)) - (+! (-> obj vertical target z) (-> s2-0 broken-z)) + (+! (-> this vertical target x) (-> s2-0 broken-x)) + (+! (-> this vertical target z) (-> s2-0 broken-z)) ) ) ) ) (set! (-> *game-info* counter) (the float s5-0)) (when (and (= s5-0 24) - (>= (- (current-time) (-> obj speech-time)) (seconds 20)) + (time-elapsed? (-> this speech-time) (seconds 20)) *target* - (and (>= 409600.0 (vector-vector-distance (-> obj root trans) (-> *target* control trans))) + (and (>= 409600.0 (vector-vector-distance (-> this root trans) (-> *target* control trans))) (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) - (let ((v1-37 (logand (-> obj speech-count) 1))) + (let ((v1-37 (logand (-> this speech-count) 1))) (cond ((zero? v1-37) (talker-spawn-func (-> *talker-speech* 191) *entity-pool* (target-pos 0) (the-as region #f)) @@ -1205,19 +1205,19 @@ This commonly includes things such as: ) ) ) - (set! (-> obj speech-time) (current-time)) - (+! (-> obj speech-count) 1) + (set-time! (-> this speech-time)) + (+! (-> this speech-count) 1) ) (cond ((zero? s5-0) - (send-event (handle->process (-> obj hud-counter)) 'hide-and-die) - (set! (-> obj hud-counter) (the-as handle #f)) - (when (= (-> obj movie-handle) #f) - (set! (-> obj movie-handle) + (send-event (handle->process (-> this hud-counter)) 'hide-and-die) + (set! (-> this hud-counter) (the-as handle #f)) + (when (= (-> this movie-handle) #f) + (set! (-> this movie-handle) (ppointer->handle (process-spawn scene-player :init scene-player-init "dig-digger-explode" #t #f)) ) - (if (handle->process (-> obj movie-handle)) - (cleanup-for-death obj) + (if (handle->process (-> this movie-handle)) + (cleanup-for-death this) ) ) ) @@ -1354,26 +1354,26 @@ This commonly includes things such as: :code sleep-code ) -(defmethod deactivate dig-digger ((obj dig-digger)) - (if (nonzero? (-> obj smoke-part)) - (kill-and-free-particles (-> obj smoke-part)) +(defmethod deactivate dig-digger ((this dig-digger)) + (if (nonzero? (-> this smoke-part)) + (kill-and-free-particles (-> this smoke-part)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs dig-digger. -(defmethod relocate dig-digger ((obj dig-digger) (arg0 int)) - (when (nonzero? (-> obj smoke-part)) - (if (nonzero? (-> obj smoke-part)) - (&+! (-> obj smoke-part) arg0) +(defmethod relocate dig-digger ((this dig-digger) (arg0 int)) + (when (nonzero? (-> this smoke-part)) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) arg0) ) ) - (the-as dig-digger ((method-of-type process-drawable relocate) obj arg0)) + (the-as dig-digger ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-digger ((obj dig-digger) (arg0 entity-actor)) +(defmethod init-from-entity! dig-digger ((this dig-digger) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1381,7 +1381,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1472,171 +1472,171 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-34 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-34 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj root pause-adjust-distance) 819200.0) - (process-drawable-from-entity! obj arg0) + (set! (-> this root pause-adjust-distance) 819200.0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-digger" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 1)) - (logior! (-> obj skel status) (joint-control-status sync-math)) + (set! (-> this draw light-index) (the-as uint 1)) + (logior! (-> this skel status) (joint-control-status sync-math)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-46 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-46 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-46 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-46)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-46)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) (dotimes (v1-52 24) - (set! (-> obj tethers v1-52 handle) (the-as handle #f)) + (set! (-> this tethers v1-52 handle) (the-as handle #f)) (let ((a0-77 v1-52)) (cond ((zero? a0-77) - (set! (-> obj tethers v1-52 rp) 18) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) -1.0) + (set! (-> this tethers v1-52 rp) 18) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) -1.0) ) ((= a0-77 1) - (set! (-> obj tethers v1-52 rp) 16) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) -1.0) + (set! (-> this tethers v1-52 rp) 16) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) -1.0) ) ((= a0-77 2) - (set! (-> obj tethers v1-52 rp) 17) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) -1.0) + (set! (-> this tethers v1-52 rp) 17) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) -1.0) ) ((= a0-77 3) - (set! (-> obj tethers v1-52 rp) 24) - (set! (-> obj tethers v1-52 broken-x) -1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 24) + (set! (-> this tethers v1-52 broken-x) -1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 4) - (set! (-> obj tethers v1-52 rp) 22) - (set! (-> obj tethers v1-52 broken-x) -1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 22) + (set! (-> this tethers v1-52 broken-x) -1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 5) - (set! (-> obj tethers v1-52 rp) 23) - (set! (-> obj tethers v1-52 broken-x) -1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 23) + (set! (-> this tethers v1-52 broken-x) -1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 6) - (set! (-> obj tethers v1-52 rp) 6) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) 1.0) + (set! (-> this tethers v1-52 rp) 6) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) 1.0) ) ((= a0-77 7) - (set! (-> obj tethers v1-52 rp) 4) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) 1.0) + (set! (-> this tethers v1-52 rp) 4) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) 1.0) ) ((= a0-77 8) - (set! (-> obj tethers v1-52 rp) 5) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) 1.0) + (set! (-> this tethers v1-52 rp) 5) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) 1.0) ) ((= a0-77 9) - (set! (-> obj tethers v1-52 rp) 12) - (set! (-> obj tethers v1-52 broken-x) 1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 12) + (set! (-> this tethers v1-52 broken-x) 1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 10) - (set! (-> obj tethers v1-52 rp) 10) - (set! (-> obj tethers v1-52 broken-x) 1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 10) + (set! (-> this tethers v1-52 broken-x) 1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 11) - (set! (-> obj tethers v1-52 rp) 11) - (set! (-> obj tethers v1-52 broken-x) 1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 11) + (set! (-> this tethers v1-52 broken-x) 1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 12) - (set! (-> obj tethers v1-52 rp) 25) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 25) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) ((= a0-77 13) - (set! (-> obj tethers v1-52 rp) 26) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 26) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) ((= a0-77 14) - (set! (-> obj tethers v1-52 rp) 27) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 27) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) ((= a0-77 15) - (set! (-> obj tethers v1-52 rp) 19) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 19) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 16) - (set! (-> obj tethers v1-52 rp) 21) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 21) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 17) - (set! (-> obj tethers v1-52 rp) 20) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 20) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 18) - (set! (-> obj tethers v1-52 rp) 14) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 14) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 19) - (set! (-> obj tethers v1-52 rp) 13) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 13) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 20) - (set! (-> obj tethers v1-52 rp) 15) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 15) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 21) - (set! (-> obj tethers v1-52 rp) 8) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 8) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) ((= a0-77 22) - (set! (-> obj tethers v1-52 rp) 7) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 7) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) ((= a0-77 23) - (set! (-> obj tethers v1-52 rp) 9) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 9) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) (else - (set! (-> obj tethers v1-52 rp) 3) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 3) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ) ) ) - (set! (-> obj start-y) (-> obj root trans y)) - (set! (-> obj smoke-part) (create-launch-control (-> *part-group-id-table* 1143) obj)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1144) obj)) - (set! (-> obj motor-sound) (new 'static 'sound-id)) - (set! (-> obj bit-sound) (new 'static 'sound-id)) - (set! (-> obj movie-handle) (the-as handle #f)) - (set! (-> obj hud-counter) (ppointer->handle (process-spawn hud-dig-clasp :init hud-init-by-other :to obj))) - (go (method-of-object obj idle)) + (set! (-> this start-y) (-> this root trans y)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 1143) this)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1144) this)) + (set! (-> this motor-sound) (new 'static 'sound-id)) + (set! (-> this bit-sound) (new 'static 'sound-id)) + (set! (-> this movie-handle) (the-as handle #f)) + (set! (-> this hud-counter) (ppointer->handle (process-spawn hud-dig-clasp :init hud-init-by-other :to this))) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/dig/dig-obs.gc b/goal_src/jak2/levels/dig/dig-obs.gc index d1c7c5d48e..2da63616a5 100644 --- a/goal_src/jak2/levels/dig/dig-obs.gc +++ b/goal_src/jak2/levels/dig/dig-obs.gc @@ -29,15 +29,15 @@ :bounds (static-spherem 0 -2 0 5.25) ) -(defmethod rigid-body-object-method-29 dig-sinking-plat ((obj dig-sinking-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method dig-sinking-plat 29)) obj arg0) - (rigid-body-platform-method-56 obj (-> obj anchor-point)) +(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) + (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) ) -(defmethod allocate-and-init-cshape dig-sinking-plat ((obj dig-sinking-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape dig-sinking-plat ((this dig-sinking-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -59,7 +59,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -98,64 +98,64 @@ ) ) -(defmethod rigid-body-platform-method-53 dig-sinking-plat ((obj dig-sinking-plat) (arg0 vector)) - (-> obj surface-height) +(defmethod rigid-body-platform-method-53 dig-sinking-plat ((this dig-sinking-plat) (arg0 vector)) + (-> this surface-height) ) -(defmethod rigid-body-object-method-37 dig-sinking-plat ((obj dig-sinking-plat)) - (when (not (logtest? (-> obj path flags) (path-control-flag not-found))) - (set! (-> obj prev-pos) (-> obj path-pos)) - (set! (-> obj path-pos) (get-norm! (-> obj sync) 0)) - (when (< (-> obj path-pos) (-> obj prev-pos)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) +(defmethod rigid-body-object-method-37 dig-sinking-plat ((this dig-sinking-plat)) + (when (not (logtest? (-> this path flags) (path-control-flag not-found))) + (set! (-> this prev-pos) (-> this path-pos)) + (set! (-> this path-pos) (get-norm! (-> this sync) 0)) + (when (< (-> this path-pos) (-> this prev-pos)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) 1.0) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-seek!) ) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group frames num-frames) -1))) (set! (-> a0-3 param 1) 1.0) (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) ) ) - (let ((f30-0 (/ 300.0 (the float (-> obj sync period))))) + (let ((f30-0 (/ 300.0 (the float (-> this sync period))))) (let* ((f0-12 (/ 1.0 (- 1.0 (* 2.0 f30-0)))) - (f0-13 (* (fmax 0.0 (- (-> obj path-pos) f30-0)) f0-12)) + (f0-13 (* (fmax 0.0 (- (-> this path-pos) f30-0)) f0-12)) ) - (get-point-at-percent-along-path! (-> obj path) (-> obj anchor-point) f0-13 'interp) + (get-point-at-percent-along-path! (-> this path) (-> this anchor-point) f0-13 'interp) ) (cond - ((< (-> obj path-pos) f30-0) - (set! (-> obj float-height-offset) (* -8192.0 (/ (- f30-0 (-> obj path-pos)) f30-0))) + ((< (-> this path-pos) f30-0) + (set! (-> this float-height-offset) (* -8192.0 (/ (- f30-0 (-> this path-pos)) f30-0))) ) - ((< (- 1.0 (* 2.0 f30-0)) (-> obj path-pos)) + ((< (- 1.0 (* 2.0 f30-0)) (-> this path-pos)) (cond - ((< (- 1.0 f30-0) (-> obj path-pos)) - (set! (-> obj float-height-offset) (* -8192.0 (/ (- (-> obj path-pos) (- 1.0 f30-0)) f30-0))) - (let ((a0-5 (-> obj skel root-channel 0))) + ((< (- 1.0 f30-0) (-> this path-pos)) + (set! (-> this float-height-offset) (* -8192.0 (/ (- (-> this path-pos) (- 1.0 f30-0)) f30-0))) + (let ((a0-5 (-> this skel root-channel 0))) (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group frames num-frames) -1))) (set! (-> a0-5 param 1) 1.0) (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (when (-> obj once) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (when (-> this once) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) 1.0) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-seek!) ) - (set! (-> obj once) #f) + (set! (-> this once) #f) ) - (let ((a0-7 (-> obj skel root-channel 0))) + (let ((a0-7 (-> this skel root-channel 0))) (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group frames num-frames) -1))) (set! (-> a0-7 param 1) 1.0) (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) @@ -164,50 +164,50 @@ ) ) (else - (set! (-> obj float-height-offset) 0.0) + (set! (-> this float-height-offset) 0.0) ) ) ) ) (cond - ((>= (- (current-time) (-> obj last-ridden-time)) (seconds 0.5)) - (when (nonzero? (-> obj bubbling-sound-id)) + ((time-elapsed? (-> this last-ridden-time) (seconds 0.5)) + (when (nonzero? (-> this bubbling-sound-id)) (let ((v1-84 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-84 command) (sound-command set-param)) - (set! (-> v1-84 id) (-> obj bubbling-sound-id)) + (set! (-> v1-84 id) (-> this bubbling-sound-id)) (set! (-> v1-84 params volume) -4) (set! (-> v1-84 auto-time) 120) (set! (-> v1-84 auto-from) 2) (set! (-> v1-84 params mask) (the-as uint 17)) (-> v1-84 id) ) - (set! (-> obj bubbling-sound-id) (new 'static 'sound-id)) + (set! (-> this bubbling-sound-id) (new 'static 'sound-id)) 0 ) ) (else - (if (zero? (-> obj bubbling-sound-id)) - (set! (-> obj bubbling-sound-id) (sound-play "lava-plat-sink")) + (if (zero? (-> this bubbling-sound-id)) + (set! (-> this bubbling-sound-id) (sound-play "lava-plat-sink")) ) ) ) - ((method-of-type rigid-body-platform rigid-body-object-method-37) obj) + ((method-of-type rigid-body-platform rigid-body-object-method-37) this) (none) ) -(defmethod rigid-body-platform-method-56 dig-sinking-plat ((obj dig-sinking-plat) (arg0 vector)) - (when (not (logtest? (-> obj path flags) (path-control-flag not-found))) +(defmethod rigid-body-platform-method-56 dig-sinking-plat ((this dig-sinking-plat) (arg0 vector)) + (when (not (logtest? (-> this path flags) (path-control-flag not-found))) (let ((v1-4 (new 'stack-no-clear 'vector))) (cond - ((< (-> obj prev-pos) (-> obj path-pos)) - (vector-! v1-4 arg0 (-> obj rbody state position)) + ((< (-> this prev-pos) (-> this path-pos)) + (vector-! v1-4 arg0 (-> this rbody state position)) (set! (-> v1-4 y) 0.0) (let* ((f0-2 (vector-length v1-4)) (f1-2 (* 1000.0 (fmax 0.0 (fmin 4096.0 (+ -4096.0 f0-2))))) ) (when (< 0.0 f1-2) (vector-float*! v1-4 v1-4 (/ f1-2 f0-2)) - (rigid-body-method-20 (-> obj rbody state) v1-4) + (rigid-body-method-20 (-> this rbody state) v1-4) ) ) ) @@ -215,13 +215,13 @@ (let ((v1-5 (new 'stack-no-clear 'vector))) (set! (-> v1-5 quad) (-> arg0 quad)) (+! (-> v1-5 y) -8192.0) - (let ((a0-16 (-> obj rbody)) - (a2-2 (-> obj root quat)) + (let ((a0-16 (-> this rbody)) + (a2-2 (-> this root quat)) ) (rigid-body-method-26 (-> a0-16 state) v1-5 a2-2) ) ) - (set! (-> obj once) (the-as basic #t)) + (set! (-> this once) (the-as basic #t)) ) ) ) @@ -235,7 +235,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('ridden) - (set! (-> self last-ridden-time) (current-time)) + (set-time! (-> self last-ridden-time)) ) ) (rigid-body-object-event-handler proc argc message block) @@ -247,18 +247,18 @@ :event (-> (method-of-type dig-sinking-plat idle) event) ) -(defmethod init-skel-and-rigid-body dig-sinking-plat ((obj dig-sinking-plat)) +(defmethod init-skel-and-rigid-body dig-sinking-plat ((this dig-sinking-plat)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-sinking-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *dig-sinking-platform-constants*) - (set! (-> obj anchor-point quad) (-> obj root trans quad)) - (set! (-> obj surface-height) (+ -4096.0 (-> obj root trans y))) - (let ((s5-1 (-> obj info control-point-count))) + (alloc-and-init-rigid-body-control this *dig-sinking-platform-constants*) + (set! (-> this anchor-point quad) (-> this root trans quad)) + (set! (-> this surface-height) (+ -4096.0 (-> this root trans y))) + (let ((s5-1 (-> this info control-point-count))) (dotimes (s4-1 s5-1) - (let ((s3-0 (-> obj control-point-array data s4-1))) + (let ((s3-0 (-> this control-point-array data s4-1))) (let ((f30-0 (* 65536.0 (/ (the float s4-1) (the float s5-1))))) (set! (-> s3-0 local-pos x) (* 16384.0 (sin f30-0))) (set! (-> s3-0 local-pos y) -8192.0) @@ -268,11 +268,11 @@ ) ) ) - (let ((s5-2 (-> obj entity))) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 s5-2 #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (let ((s5-2 (-> this entity))) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 s5-2 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-5 (new 'stack-no-clear 'sync-info-params))) (let ((v1-25 0)) @@ -285,11 +285,11 @@ (set! (-> a1-5 entity) s5-2) (set! (-> a1-5 period) (the-as uint 3000)) (set! (-> a1-5 percent) 0.0) - (initialize! (-> obj sync) a1-5) + (initialize! (-> this sync) a1-5) ) ) - (set! (-> obj bubbling-sound-id) (new 'static 'sound-id)) - (set! (-> obj once) (the-as basic #t)) + (set! (-> this bubbling-sound-id) (new 'static 'sound-id)) + (set! (-> this once) (the-as basic #t)) 0 (none) ) @@ -510,29 +510,29 @@ ) ) -(defmethod run-logic? dig-log ((obj dig-log)) +(defmethod run-logic? dig-log ((this dig-log)) #t ) ;; WARN: Return type mismatch int vs symbol. ;; WARN: disable def twice: 16. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod dig-log-method-22 dig-log ((obj dig-log) (arg0 symbol)) +(defmethod dig-log-method-22 dig-log ((this dig-log) (arg0 symbol)) (the-as symbol (cond (arg0 - (when (!= (-> obj pressed-count) (-> obj total-buttons)) - (when (not (handle->process (-> obj hud-handle))) - (let ((v0-0 (ppointer->handle (process-spawn hud-dig-button :init hud-init-by-other :to obj)))) - (set! (-> obj hud-handle) (the-as handle v0-0)) + (when (!= (-> this pressed-count) (-> this total-buttons)) + (when (not (handle->process (-> this hud-handle))) + (let ((v0-0 (ppointer->handle (process-spawn hud-dig-button :init hud-init-by-other :to this)))) + (set! (-> this hud-handle) (the-as handle v0-0)) v0-0 ) ) ) ) (else - (send-event (handle->process (-> obj hud-handle)) 'hide-and-die) - (set! (-> obj hud-handle) (the-as handle #f)) + (send-event (handle->process (-> this hud-handle)) 'hide-and-die) + (set! (-> this hud-handle) (the-as handle #f)) (the-as int #f) ) ) @@ -563,8 +563,8 @@ ) (s5-0 (add-process *gui-control* self (gui-channel jak) (gui-action queue) t0-0 -99.0 0)) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.15)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.15)) (suspend) ) (until v1-12 @@ -574,8 +574,8 @@ (while (!= (get-status *gui-control* s5-0) (gui-status ready)) (suspend) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) (set-setting! 'entity-name "camera-249" 0.0 0) @@ -590,8 +590,8 @@ (the-as process #f) ) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) (let ((f30-0 @@ -623,8 +623,8 @@ (suspend) ) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (if (= (-> gp-0 cam-ret-mode) 'instant) @@ -633,22 +633,22 @@ (set-setting! 'string-startup-vector 'abs (-> gp-0 cam-ret-dir) 0) (remove-setting! 'entity-name) (when (!= (-> gp-0 cam-ret-mode) 'instant) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.1)) (suspend) ) (remove-setting! 'string-startup-vector) (until (process-release? *target*) (suspend) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 4)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 4)) (suspend) ) (go-virtual idle) @@ -657,7 +657,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-log ((obj dig-log) (arg0 entity-actor)) +(defmethod init-from-entity! dig-log ((this dig-log) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -665,8 +665,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj hud-handle) (the-as handle #f)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this hud-handle) (the-as handle #f)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -682,28 +682,28 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj base-y) (-> obj root trans y)) + (process-drawable-from-entity! this arg0) + (set! (-> this base-y) (-> this root trans y)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-log" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj pressed-count) 0) - (set! (-> obj total-buttons) 0) + (set! (-> this pressed-count) 0) + (set! (-> this total-buttons) 0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-19 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-19 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (when (and v1-19 (nonzero? (-> sv-16 elt-count))) (let ((s5-2 (-> v1-19 0))) (countdown (s4-2 (-> s5-2 length)) (let ((s3-1 (-> s5-2 data s4-2 actor))) (when s3-1 - (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector s3-1) 0) - (+! (-> obj total-buttons) 1) + (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector s3-1) 0) + (+! (-> this total-buttons) 1) (if (logtest? (-> s3-1 extra perm status) (entity-perm-status subtask-complete)) - (+! (-> obj pressed-count) 1) + (+! (-> this pressed-count) 1) ) ) ) @@ -712,21 +712,21 @@ This commonly includes things such as: ) ) (if (task-node-closed? (game-task-node dig-find-totem-raise-log)) - (set! (-> obj pressed-count) (-> obj total-buttons)) + (set! (-> this pressed-count) (-> this total-buttons)) ) - (set! (-> obj root trans y) - (+ (-> (&-> *dig-log-heights* 0 data (- (-> obj total-buttons) (-> obj pressed-count))) 0) (-> obj base-y)) + (set! (-> this root trans y) + (+ (-> (&-> *dig-log-heights* 0 data (- (-> this total-buttons) (-> this pressed-count))) 0) (-> this base-y)) ) (transform-post) - (when (!= (-> obj pressed-count) (-> obj total-buttons)) - (set! (-> *game-info* counter) (the float (- (-> obj total-buttons) (-> obj pressed-count)))) + (when (!= (-> this pressed-count) (-> this total-buttons)) + (set! (-> *game-info* counter) (the float (- (-> this total-buttons) (-> this pressed-count)))) (if (string= (-> *game-info* last-continue name) "dig3b-back-room") - (dig-log-method-22 obj #t) + (dig-log-method-22 this #t) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1145) obj)) - (set! (-> obj event-hook) dig-log-event-handler) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1145) this)) + (set! (-> this event-hook) dig-log-event-handler) + (go (method-of-object this idle)) (none) ) @@ -750,7 +750,7 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 3) ) -(defmethod run-logic? dig-button ((obj dig-button)) +(defmethod run-logic? dig-button ((this dig-button)) #t ) @@ -807,14 +807,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-button ((obj dig-button) (arg0 entity-actor)) +(defmethod init-from-entity! dig-button ((this dig-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -829,58 +829,58 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj down-y) (+ -2048.0 (-> obj root trans y))) + (set! (-> this down-y) (+ -2048.0 (-> this root trans y))) (if (task-node-closed? (game-task-node dig-find-totem-raise-log)) - (process-entity-status! obj (entity-perm-status subtask-complete) #t) + (process-entity-status! this (entity-perm-status subtask-complete) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj idle-down)) - (go (method-of-object obj idle-up)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this idle-down)) + (go (method-of-object this idle-up)) ) (none) ) -(defmethod draw hud-dig-button ((obj hud-dig-button)) +(defmethod draw hud-dig-button ((this hud-dig-button)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 487.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 487.0 (* 130.0 (-> this offset)))) 210 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -16 20) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 20) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-dig-button ((obj hud-dig-button)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-dig-button ((this hud-dig-button)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-dig-button ((obj hud-dig-button)) - (set! (-> obj level) (level-get *level* 'dig3a)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd21))) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-dig-button ((this hud-dig-button)) + (set! (-> this level) (level-get *level* 'dig3a)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd21))) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) diff --git a/goal_src/jak2/levels/dig/dig1-obs.gc b/goal_src/jak2/levels/dig/dig1-obs.gc index 574e0d92ab..0494fc2cee 100644 --- a/goal_src/jak2/levels/dig/dig1-obs.gc +++ b/goal_src/jak2/levels/dig/dig1-obs.gc @@ -23,16 +23,16 @@ :origin-joint-index 3 ) -(defmethod init! dig-conveyor ((obj dig-conveyor)) +(defmethod init! dig-conveyor ((this dig-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj speed) 30720.0) - (set! (-> obj belt-radius) 15974.4) - (set! (-> obj pull-y-threshold) 10240.0) - (set! (-> obj draw light-index) (the-as uint 2)) + (set! (-> this speed) 30720.0) + (set! (-> this belt-radius) 15974.4) + (set! (-> this pull-y-threshold) 10240.0) + (set! (-> this draw light-index) (the-as uint 2)) (none) ) -(defmethod get-art-group dig-conveyor ((obj dig-conveyor)) +(defmethod get-art-group dig-conveyor ((this dig-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-dig-conveyor" (the-as (pointer uint32) #f)) ) @@ -452,7 +452,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (suspend) ) ) @@ -463,7 +463,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.5)) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -475,7 +475,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.5)) + (until (time-elapsed? gp-3 (seconds 0.5)) (suspend) ) ) @@ -486,7 +486,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.25)) + (until (time-elapsed? gp-4 (seconds 0.25)) (suspend) ) ) @@ -497,7 +497,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((gp-5 (current-time))) - (until (>= (- (current-time) gp-5) (seconds 0.125)) + (until (time-elapsed? gp-5 (seconds 0.125)) (suspend) ) ) @@ -509,7 +509,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 0.05)) + (until (time-elapsed? s5-0 (seconds 0.05)) (suspend) ) ) @@ -549,19 +549,19 @@ ) ) -(defmethod rigid-body-object-method-46 dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('track) #t ) (else - ((method-of-type rigid-body-object rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) + ((method-of-type rigid-body-object rigid-body-object-method-46) this arg0 arg1 arg2 arg3) ) ) ) ;; WARN: Return type mismatch object vs symbol. -(defmethod rigid-body-object-method-47 dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder) +(defmethod rigid-body-object-method-47 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) @@ -573,25 +573,25 @@ ((logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot enemy-yellow-shot enemy-dark-shot) arg3 ) - (go (method-of-object obj die)) + (go (method-of-object this die)) ) (else (if (logtest? (penetrate explode) arg3) (set! arg3 (penetrate spin)) ) - ((method-of-type rigid-body-object rigid-body-object-method-47) obj arg0 arg1 arg2 (the-as penetrate arg3)) + ((method-of-type rigid-body-object rigid-body-object-method-47) this arg0 arg1 arg2 (the-as penetrate arg3)) ) ) ) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod rigid-body-object-method-45 dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) (arg0 rigid-body-impact)) (let* ((f0-0 (-> arg0 impulse)) (f1-0 28672.0) - (f30-0 (* f0-0 (/ 1.0 f1-0) (-> obj info info inv-mass))) + (f30-0 (* f0-0 (/ 1.0 f1-0) (-> this info info inv-mass))) ) - (if (< (* 28672.0 (-> obj info info mass)) (-> arg0 impulse)) + (if (< (* 28672.0 (-> this info info mass)) (-> arg0 impulse)) (sound-play-by-name (static-sound-name "barrel-bomb-hit") (new-sound-id) @@ -599,21 +599,21 @@ 0 0 (sound-group sfx) - (-> obj root trans) + (-> this root trans) ) ) ) (none) ) -(defmethod rigid-body-object-method-37 dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder)) +(defmethod rigid-body-object-method-37 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-0 start-pos quad) (-> obj rbody state position quad)) - (vector-float*! (-> a1-0 move-dist) (-> obj rbody state lin-velocity) (seconds-per-frame)) + (set! (-> a1-0 start-pos quad) (-> this rbody state position quad)) + (vector-float*! (-> a1-0 move-dist) (-> this rbody state lin-velocity) (seconds-per-frame)) (let ((v1-3 a1-0)) - (set! (-> v1-3 radius) (+ 4096.0 (-> obj root root-prim local-sphere w))) - (set! (-> v1-3 collide-with) (-> obj root root-prim prim-core collide-with)) - (set! (-> v1-3 ignore-process0) obj) + (set! (-> v1-3 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) + (set! (-> v1-3 collide-with) (-> this root root-prim prim-core collide-with)) + (set! (-> v1-3 ignore-process0) this) (set! (-> v1-3 ignore-process1) #f) (set! (-> v1-3 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-3 action-mask) (collide-action solid)) @@ -623,23 +623,23 @@ (if *display-collide-cache* (debug-draw *collide-cache*) ) - (rigid-body-object-method-30 obj) - (set! (-> obj root transv quad) (-> obj rbody state lin-velocity quad)) - (quaternion-copy! (-> obj root quat) (-> obj rbody state rotation)) - (rigid-body-method-24 (-> obj rbody state)) - (let ((v1-19 (-> obj rbody)) - (a1-2 (-> obj root trans)) + (rigid-body-object-method-30 this) + (set! (-> this root transv quad) (-> this rbody state lin-velocity quad)) + (quaternion-copy! (-> this root quat) (-> this rbody state rotation)) + (rigid-body-method-24 (-> this rbody state)) + (let ((v1-19 (-> this rbody)) + (a1-2 (-> this root trans)) ) (rigid-body-method-23 (-> v1-19 state) a1-2) ) - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) (transform-post) 0 (none) ) -(defmethod allocate-and-init-cshape dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -681,25 +681,25 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-skel-and-rigid-body dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder)) +(defmethod init-skel-and-rigid-body dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-bomb-crate-cylinder" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *dig-bomb-crate-cylinder-constants*) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-collision)) - (set! (-> obj draw light-index) (the-as uint 10)) + (alloc-and-init-rigid-body-control this *dig-bomb-crate-cylinder-constants*) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this rbody state flags) (rigid-body-flag enable-collision)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) @@ -779,8 +779,8 @@ ) ) -(defmethod dig-bomb-crate-method-29 dig-bomb-crate ((obj dig-bomb-crate) (arg0 vector)) - (let ((s4-0 (-> obj root trans))) +(defmethod dig-bomb-crate-method-29 dig-bomb-crate ((this dig-bomb-crate) (arg0 vector)) + (let ((s4-0 (-> this root trans))) (dotimes (s3-0 8) (let ((a0-2 (-> *dig-bomb-crate-array* s3-0)) (s2-0 (new 'stack-no-clear 'dig-bomb-crate-cylinder-spawn-params)) @@ -796,7 +796,7 @@ (dig-bomb-crate-cylinder-spawn *entity-pool* (the-as dig-bomb-crate-cylinder-spawn-params (-> s2-0 pos)) - (-> obj entity) + (-> this entity) ) ) ) @@ -805,10 +805,10 @@ (none) ) -(defmethod get-trans dig-bomb-crate ((obj dig-bomb-crate) (arg0 int)) +(defmethod get-trans dig-bomb-crate ((this dig-bomb-crate) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (v0-0 vector)) - (let ((v1-0 (-> obj root))) + (let ((v1-0 (-> this root))) (case arg0 ((2 3) (set! v0-0 (new 'static 'vector)) @@ -890,7 +890,7 @@ ) (suspend) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 4)) + (until (time-elapsed? gp-2 (seconds 4)) (suspend) ) ) @@ -899,14 +899,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-bomb-crate ((obj dig-bomb-crate) (arg0 entity-actor)) +(defmethod init-from-entity! dig-bomb-crate ((this dig-bomb-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate generic-attack @@ -940,17 +940,17 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-6 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-6 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-bomb-crate" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask enemy)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -968,9 +968,9 @@ This commonly includes things such as: ) -(defmethod init-skeleton! dig-jump-pad ((obj dig-jump-pad)) +(defmethod init-skeleton! dig-jump-pad ((this dig-jump-pad)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-jump-pad" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -978,9 +978,9 @@ This commonly includes things such as: (none) ) -(defmethod bouncer-method-24 dig-jump-pad ((obj dig-jump-pad)) +(defmethod bouncer-method-24 dig-jump-pad ((this dig-jump-pad)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) @@ -1008,7 +1008,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) diff --git a/goal_src/jak2/levels/dig/dig2-obs.gc b/goal_src/jak2/levels/dig/dig2-obs.gc index e819f5d623..4a92aa76b3 100644 --- a/goal_src/jak2/levels/dig/dig2-obs.gc +++ b/goal_src/jak2/levels/dig/dig2-obs.gc @@ -41,17 +41,17 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-breakable-door ((obj dig-breakable-door) (arg0 entity-actor)) +(defmethod init-from-entity! dig-breakable-door ((this dig-breakable-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (let ((s4-0 (art-group-get-by-name *level* "skel-dig-breakable-door" (the-as (pointer uint32) #f)))) - (let ((s3-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-7 (new 'process 'collide-shape-prim-mesh s3-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list)) @@ -66,11 +66,11 @@ This commonly includes things such as: (set! (-> s3-0 backup-collide-as) (-> v1-10 prim-core collide-as)) (set! (-> s3-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) - (set! (-> obj root) s3-0) + (set! (-> this root) s3-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/dig/dig3-obs.gc b/goal_src/jak2/levels/dig/dig3-obs.gc index e6f62ab525..bec8cf180e 100644 --- a/goal_src/jak2/levels/dig/dig3-obs.gc +++ b/goal_src/jak2/levels/dig/dig3-obs.gc @@ -266,20 +266,20 @@ :trans rider-trans :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (the int (-> self cycle-offset))) + (until (time-elapsed? gp-0 (the int (-> self cycle-offset))) (suspend) ) ) (until #f (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (the int (-> self cycle-time))) + (until (time-elapsed? gp-1 (the int (-> self cycle-time))) (suspend) ) ) (activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock)) (sound-play "spikey-shake" :position (-> self root trans)) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.75)) + (until (time-elapsed? gp-3 (seconds 0.75)) (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) (suspend) ) @@ -287,7 +287,7 @@ (set! (-> self shudder-angle) 0.0) (set-zero! (-> self smush)) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.25)) + (until (time-elapsed? gp-4 (seconds 0.25)) (suspend) ) ) @@ -296,7 +296,7 @@ (f30-1 (* 65536.0 f0-7)) (gp-6 (current-time)) ) - (until (>= (- (current-time) gp-6) (seconds 1)) + (until (time-elapsed? gp-6 (seconds 1)) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) @@ -331,7 +331,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-spikey-step ((obj dig-spikey-step) (arg0 entity-actor)) +(defmethod init-from-entity! dig-spikey-step ((this dig-spikey-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -339,7 +339,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 int)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -355,15 +355,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-spikey-step" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) + (quaternion-copy! (-> this init-quat) (-> this root quat)) (let ((f28-0 4.0) (f30-0 0.0) ) @@ -374,10 +374,10 @@ This commonly includes things such as: (set! f30-0 (-> v1-20 1)) ) ) - (set! (-> obj cycle-time) (the float (max 0 (+ (the int (* 300.0 f28-0)) -525)))) - (set! (-> obj cycle-offset) (the float (the int (* 300.0 f30-0)))) + (set! (-> this cycle-time) (the float (max 0 (+ (the int (* 300.0 f28-0)) -525)))) + (set! (-> this cycle-offset) (the float (the int (* 300.0 f30-0)))) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -447,7 +447,7 @@ This commonly includes things such as: (sound-play "spikey-break") (suspend) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 4)) + (until (time-elapsed? gp-2 (seconds 4)) (suspend) ) ) @@ -477,9 +477,9 @@ This commonly includes things such as: (-> arg0 status) ) -(defmethod init-proj-collision! dig-spikey-sphere ((obj dig-spikey-sphere)) +(defmethod init-proj-collision! dig-spikey-sphere ((this dig-spikey-sphere)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) spikey-sphere-reaction) (set! (-> s5-0 no-reaction) @@ -502,7 +502,7 @@ This commonly includes things such as: ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -515,15 +515,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod play-impact-sound! dig-spikey-sphere ((obj dig-spikey-sphere)) +(defmethod play-impact-sound! dig-spikey-sphere ((this dig-spikey-sphere)) "Plays impact sound" - (let* ((a0-1 (-> obj root)) + (let* ((a0-1 (-> this root)) (s5-0 (-> a0-1 status)) ) (when (logtest? s5-0 (collide-status touch-surface)) (vector-float*! (-> a0-1 transv) (-> a0-1 transv) 0.9) (cond - ((< (-> obj root trans y) (-> obj pad-i1hb23h1b)) + ((< (-> this root trans y) (-> this pad-i1hb23h1b)) (let ((s4-0 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-0 (let ((t9-1 (method-of-type part-tracker activate))) @@ -544,7 +544,7 @@ This commonly includes things such as: (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root grount-touch-point quad)) + (set! (-> t3-0 trans quad) (-> this root grount-touch-point quad)) ((the-as (function object object object object object object object object none) t9-2) a0-5 a1-3 @@ -559,7 +559,7 @@ This commonly includes things such as: (-> s4-0 ppointer) ) ) - (go (method-of-object obj die)) + (go (method-of-object this die)) ) (else (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) @@ -582,7 +582,7 @@ This commonly includes things such as: (t2-1 #f) (t3-1 *launch-matrix*) ) - (set! (-> t3-1 trans quad) (-> obj root grount-touch-point quad)) + (set! (-> t3-1 trans quad) (-> this root grount-touch-point quad)) ((the-as (function object object object object object object object object none) t9-6) a0-8 a1-6 @@ -601,44 +601,44 @@ This commonly includes things such as: ) ) (if (and (logtest? s5-0 (collide-status impact-surface)) - (>= (- (current-time) (-> obj played-bounce-time)) (seconds 0.3)) + (time-elapsed? (-> this played-bounce-time) (seconds 0.3)) ) - (set! (-> obj played-bounce-time) (current-time)) + (set-time! (-> this played-bounce-time)) ) ) (none) ) -(defmethod init-proj-settings! dig-spikey-sphere ((obj dig-spikey-sphere)) +(defmethod init-proj-settings! dig-spikey-sphere ((this dig-spikey-sphere)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj attack-mode) 'eco-dark) + (set! (-> this attack-mode) 'eco-dark) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-spikey-sphere" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj max-speed) 163840.0) - (set! (-> obj timeout) (seconds 8)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj notify-handle) (the-as handle #f)) - (set! (-> obj update-velocity) spikey-sphere-update-velocity) - (set! (-> obj max-hits) #xffff) - (set! (-> obj move) spikey-sphere-move) - (set-vector! (-> obj root quat) 0.0 0.0 0.0 1.0) - (set! (-> obj pad-i1hb23h1b) (+ -204800.0 (-> obj root trans y))) - (let ((v1-16 (-> obj starting-dir))) + (set! (-> this max-speed) 163840.0) + (set! (-> this timeout) (seconds 8)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this notify-handle) (the-as handle #f)) + (set! (-> this update-velocity) spikey-sphere-update-velocity) + (set! (-> this max-hits) #xffff) + (set! (-> this move) spikey-sphere-move) + (set-vector! (-> this root quat) 0.0 0.0 0.0 1.0) + (set! (-> this pad-i1hb23h1b) (+ -204800.0 (-> this root trans y))) + (let ((v1-16 (-> this starting-dir))) (quaternion-axis-angle! - (-> obj tumble-quat) + (-> this tumble-quat) (-> v1-16 z) (-> v1-16 y) (-> v1-16 x) (* -65536.0 (seconds-per-frame)) ) ) - (set! (-> obj draw light-index) (the-as uint 4)) + (set! (-> this draw light-index) (the-as uint 4)) (sound-play "spikey-roll") 0 (none) @@ -685,7 +685,7 @@ This commonly includes things such as: :code (behavior () (sound-play "spikey-door") (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.1)) + (until (time-elapsed? gp-1 (seconds 0.1)) (suspend) ) ) @@ -728,17 +728,17 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-spikey-sphere-door ((obj dig-spikey-sphere-door) (arg0 entity-actor)) +(defmethod init-from-entity! dig-spikey-sphere-door ((this dig-spikey-sphere-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-spikey-sphere-door" (the-as (pointer uint32) #f)) @@ -756,12 +756,12 @@ This commonly includes things such as: (set! (-> a1-5 entity) arg0) (set! (-> a1-5 period) (the-as uint 1200)) (set! (-> a1-5 percent) 0.0) - (initialize! (-> obj sync) a1-5) + (initialize! (-> this sync) a1-5) ) - (set! (-> obj prev-sync) (get-norm! (-> obj sync) 0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj draw light-index) (the-as uint 3)) - (go (method-of-object obj idle)) + (set! (-> this prev-sync) (get-norm! (-> this sync) 0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 3)) + (go (method-of-object this idle)) (none) ) @@ -898,20 +898,20 @@ This commonly includes things such as: :post ja-post ) -(defmethod dig-balloon-lurker-trapeze-method-21 dig-balloon-lurker-trapeze ((obj dig-balloon-lurker-trapeze)) +(defmethod dig-balloon-lurker-trapeze-method-21 dig-balloon-lurker-trapeze ((this dig-balloon-lurker-trapeze)) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) ) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (vector<-cspace! (-> s5-0 start-pos) (-> obj node-list data 11)) - (set! (-> s5-0 start-pos y) (+ -24576.0 (-> obj root trans y))) + (vector<-cspace! (-> s5-0 start-pos) (-> this node-list data 11)) + (set! (-> s5-0 start-pos y) (+ -24576.0 (-> this root trans y))) (set-vector! (-> s5-0 move-dist) 0.0 -34816.0 0.0 1.0) (let ((v1-10 s5-0)) (set! (-> v1-10 radius) 8192.0) (set! (-> v1-10 collide-with) (collide-spec backgnd)) - (set! (-> v1-10 ignore-process0) obj) + (set! (-> v1-10 ignore-process0) this) (set! (-> v1-10 ignore-process1) #f) (set! (-> v1-10 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-10 action-mask) (collide-action solid)) @@ -919,26 +919,26 @@ This commonly includes things such as: (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) (-> s5-0 best-other-tri intersect) - (let ((v1-15 (-> obj draw shadow-ctrl))) + (let ((v1-15 (-> this draw shadow-ctrl))) (logclear! (-> v1-15 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((v1-18 (-> obj draw shadow-ctrl))) + (let ((v1-18 (-> this draw shadow-ctrl))) (set! (-> v1-18 settings bot-plane w) (- (+ -6144.0 (-> s5-0 best-other-tri intersect y)))) ) 0 - (let ((v1-21 (-> obj draw shadow-ctrl))) + (let ((v1-21 (-> this draw shadow-ctrl))) (set! (-> v1-21 settings top-plane w) (- (+ 6144.0 (-> s5-0 best-other-tri intersect y)))) ) 0 - (let* ((f1-4 (vector-vector-distance (-> s5-0 best-other-tri intersect) (-> obj root trans))) + (let* ((f1-4 (vector-vector-distance (-> s5-0 best-other-tri intersect) (-> this root trans))) (f0-15 (* 0.000030517578 (fmin 32768.0 (fmax 0.0 (+ -57344.0 f1-4))))) ) - (set! (-> obj draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-15)) + (set! (-> this draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-15)) ) ) (else - (let ((v1-31 (-> obj draw shadow-ctrl))) + (let ((v1-31 (-> this draw shadow-ctrl))) (logior! (-> v1-31 settings flags) (shadow-flags disable-draw)) ) 0 @@ -947,7 +947,7 @@ This commonly includes things such as: ) ) (else - (let ((v1-34 (-> obj draw shadow-ctrl))) + (let ((v1-34 (-> this draw shadow-ctrl))) (logior! (-> v1-34 settings flags) (shadow-flags disable-draw)) ) 0 @@ -958,14 +958,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-balloon-lurker ((obj dig-balloon-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! dig-balloon-lurker ((this dig-balloon-lurker) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec crate)) @@ -1001,34 +1001,34 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-balloon-lurker" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (process-spawn dig-balloon-lurker-trapeze arg0 :to obj) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj options) (res-lump-value arg0 'options int :time -1000000000.0)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (set! (-> obj bouncing) #f) - (set! (-> obj bounce-scale) 1228.8) - (set! (-> obj bob-counter) (if (= (-> obj options) 1) - 145.0 - 0.0 - ) + (process-spawn dig-balloon-lurker-trapeze arg0 :to this) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this options) (res-lump-value arg0 'options int :time -1000000000.0)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (set! (-> this bouncing) #f) + (set! (-> this bounce-scale) 1228.8) + (set! (-> this bob-counter) (if (= (-> this options) 1) + 145.0 + 0.0 + ) ) - (set! (-> obj forward-backward) #f) - (set! (-> obj grabbed) #f) - (set! (-> obj trapeze-grabbed) #f) - (set! (-> obj pedal-anim-frame) 0.0) - (set! (-> obj pedal-anim-speed) 0.5) - (set-vector! (-> obj pov-cam-offset) 0.0 -20480.0 0.0 1.0) - (set! (-> obj pedal-sound-id) (new-sound-id)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this forward-backward) #f) + (set! (-> this grabbed) #f) + (set! (-> this trapeze-grabbed) #f) + (set! (-> this pedal-anim-frame) 0.0) + (set! (-> this pedal-anim-speed) 0.5) + (set-vector! (-> this pov-cam-offset) 0.0 -20480.0 0.0 1.0) + (set! (-> this pedal-sound-id) (new-sound-id)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((a1-23 (new 'stack-no-clear 'sync-info-params))) (let ((v1-39 0)) (if #t @@ -1044,7 +1044,7 @@ This commonly includes things such as: (set! (-> a1-23 ease-out) 0.15) (set! (-> a1-23 pause-in) 0.0) (set! (-> a1-23 pause-out) 0.0) - (initialize! (-> obj sync) a1-23) + (initialize! (-> this sync) a1-23) ) (let ((a1-24 (new 'stack-no-clear 'sync-info-params))) (let ((v1-46 0)) @@ -1057,15 +1057,15 @@ This commonly includes things such as: (set! (-> a1-24 entity) arg0) (set! (-> a1-24 period) (the-as uint 3600)) (set! (-> a1-24 percent) 0.0) - (initialize! (-> obj swing-sync) a1-24) + (initialize! (-> this swing-sync) a1-24) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) -(defmethod deactivate dig-balloon-lurker ((obj dig-balloon-lurker)) - (sound-stop (-> obj pedal-sound-id)) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate dig-balloon-lurker ((this dig-balloon-lurker)) + (sound-stop (-> this pedal-sound-id)) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -1219,21 +1219,21 @@ This commonly includes things such as: :post rider-post ) -(defmethod deactivate dig-wheel-step ((obj dig-wheel-step)) - (sound-stop (-> obj wheel-sound-id)) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate dig-wheel-step ((this dig-wheel-step)) + (sound-stop (-> this wheel-sound-id)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-wheel-step ((obj dig-wheel-step) (arg0 entity-actor)) +(defmethod init-from-entity! dig-wheel-step ((this dig-wheel-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) @@ -1270,18 +1270,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-18 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-wheel-step" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj wheel-sound-id) (new-sound-id)) - (set! (-> obj draw light-index) (the-as uint 5)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (let* ((a0-30 (-> obj entity)) + (set! (-> this wheel-sound-id) (new-sound-id)) + (set! (-> this draw light-index) (the-as uint 5)) + (logclear! (-> this mask) (process-mask actor-pause)) + (let* ((a0-30 (-> this entity)) (f0-18 ((method-of-object a0-30 get-property-value-float) a0-30 'rotspeed @@ -1293,9 +1293,9 @@ This commonly includes things such as: ) ) ) - (set! (-> obj anim-speed) (* 0.000015258789 f0-18)) + (set! (-> this anim-speed) (* 0.000015258789 f0-18)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1351,29 +1351,29 @@ This commonly includes things such as: :origin-joint-index 3 ) -(defmethod rigid-body-object-method-37 dig-tipping-rock ((obj dig-tipping-rock)) +(defmethod rigid-body-object-method-37 dig-tipping-rock ((this dig-tipping-rock)) (let ((t9-0 (method-of-type rigid-body-platform rigid-body-object-method-37))) - (t9-0 obj) + (t9-0 this) ) (cond - ((>= (- (current-time) (-> obj last-ridden-time)) (seconds 0.5)) - (when (nonzero? (-> obj bubbling-sound-id)) + ((time-elapsed? (-> this last-ridden-time) (seconds 0.5)) + (when (nonzero? (-> this bubbling-sound-id)) (let ((v1-5 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-5 command) (sound-command set-param)) - (set! (-> v1-5 id) (-> obj bubbling-sound-id)) + (set! (-> v1-5 id) (-> this bubbling-sound-id)) (set! (-> v1-5 params volume) -4) (set! (-> v1-5 auto-time) 120) (set! (-> v1-5 auto-from) 2) (set! (-> v1-5 params mask) (the-as uint 17)) (-> v1-5 id) ) - (set! (-> obj bubbling-sound-id) (new 'static 'sound-id)) + (set! (-> this bubbling-sound-id) (new 'static 'sound-id)) 0 ) ) (else - (if (zero? (-> obj bubbling-sound-id)) - (set! (-> obj bubbling-sound-id) (sound-play "lava-plat-tip")) + (if (zero? (-> this bubbling-sound-id)) + (set! (-> this bubbling-sound-id) (sound-play "lava-plat-tip")) ) ) ) @@ -1385,7 +1385,7 @@ This commonly includes things such as: :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('ridden) - (set! (-> self last-ridden-time) (current-time)) + (set-time! (-> self last-ridden-time)) ) ) (rigid-body-object-event-handler proc argc message block) @@ -1402,15 +1402,15 @@ This commonly includes things such as: :event (-> (method-of-type dig-tipping-rock idle) event) ) -(defmethod rigid-body-object-method-29 dig-tipping-rock ((obj dig-tipping-rock) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method dig-tipping-rock 29)) obj arg0) - (rigid-body-platform-method-56 obj (-> obj anchor-point)) +(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) + (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) ) -(defmethod allocate-and-init-cshape dig-tipping-rock ((obj dig-tipping-rock)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod allocate-and-init-cshape dig-tipping-rock ((this dig-tipping-rock)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1431,26 +1431,26 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod rigid-body-platform-method-53 dig-tipping-rock ((obj dig-tipping-rock) (arg0 vector)) - (-> obj surface-height) +(defmethod rigid-body-platform-method-53 dig-tipping-rock ((this dig-tipping-rock) (arg0 vector)) + (-> this surface-height) ) -(defmethod init-skel-and-rigid-body dig-tipping-rock ((obj dig-tipping-rock)) +(defmethod init-skel-and-rigid-body dig-tipping-rock ((this dig-tipping-rock)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-tipping-rock" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-rotate-local-x! (-> obj root quat) (-> obj root quat) -2555.2202) - (alloc-and-init-rigid-body-control obj *dig-tipping-rock-constants*) - (set! (-> obj anchor-point quad) (-> obj rbody state position quad)) - (let ((v1-8 (-> obj control-point-array))) + (quaternion-rotate-local-x! (-> this root quat) (-> this root quat) -2555.2202) + (alloc-and-init-rigid-body-control this *dig-tipping-rock-constants*) + (set! (-> this anchor-point quad) (-> this rbody state position quad)) + (let ((v1-8 (-> this control-point-array))) (let ((a0-8 (-> v1-8 data))) (set! (-> a0-8 0 local-pos x) 0.0) (set! (-> a0-8 0 local-pos y) 0.0) @@ -1476,8 +1476,8 @@ This commonly includes things such as: (set! (-> v1-9 local-pos w) 1.0) ) ) - (set! (-> obj surface-height) (+ 6144.0 (-> obj root trans y))) - (set! (-> obj bubbling-sound-id) (new 'static 'sound-id)) + (set! (-> this surface-height) (+ 6144.0 (-> this root trans y))) + (set! (-> this bubbling-sound-id) (new 'static 'sound-id)) 0 (none) ) @@ -1496,9 +1496,9 @@ This commonly includes things such as: ) -(defmethod init-skeleton! dig-wall-bouncer ((obj dig-wall-bouncer)) +(defmethod init-skeleton! dig-wall-bouncer ((this dig-wall-bouncer)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-wall-bouncer" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1506,9 +1506,9 @@ This commonly includes things such as: (none) ) -(defmethod bouncer-method-24 dig-wall-bouncer ((obj dig-wall-bouncer)) +(defmethod bouncer-method-24 dig-wall-bouncer ((this dig-wall-bouncer)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) (set! (-> s5-0 total-prims) (the-as uint 6)) (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) @@ -1558,7 +1558,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1683,14 +1683,14 @@ This commonly includes things such as: ) ) -(defmethod rigid-body-object-method-37 dig-stomp-block ((obj dig-stomp-block)) +(defmethod rigid-body-object-method-37 dig-stomp-block ((this dig-stomp-block)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-0 start-pos quad) (-> obj rbody state position quad)) - (vector-float*! (-> a1-0 move-dist) (-> obj rbody state lin-velocity) (seconds-per-frame)) + (set! (-> a1-0 start-pos quad) (-> this rbody state position quad)) + (vector-float*! (-> a1-0 move-dist) (-> this rbody state lin-velocity) (seconds-per-frame)) (let ((v1-3 a1-0)) - (set! (-> v1-3 radius) (+ 4096.0 (-> obj root root-prim local-sphere w))) - (set! (-> v1-3 collide-with) (-> obj root root-prim prim-core collide-with)) - (set! (-> v1-3 ignore-process0) obj) + (set! (-> v1-3 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) + (set! (-> v1-3 collide-with) (-> this root root-prim prim-core collide-with)) + (set! (-> v1-3 ignore-process0) this) (set! (-> v1-3 ignore-process1) #f) (set! (-> v1-3 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-3 action-mask) (collide-action solid)) @@ -1712,23 +1712,23 @@ This commonly includes things such as: (if *display-collide-cache* (debug-draw *collide-cache*) ) - (rigid-body-object-method-30 obj) - (set! (-> obj root transv quad) (-> obj rbody state lin-velocity quad)) - (quaternion-copy! (-> obj root quat) (-> obj rbody state rotation)) - (rigid-body-method-24 (-> obj rbody state)) - (let ((v1-22 (-> obj rbody)) - (a1-8 (-> obj root trans)) + (rigid-body-object-method-30 this) + (set! (-> this root transv quad) (-> this rbody state lin-velocity quad)) + (quaternion-copy! (-> this root quat) (-> this rbody state rotation)) + (rigid-body-method-24 (-> this rbody state)) + (let ((v1-22 (-> this rbody)) + (a1-8 (-> this root trans)) ) (rigid-body-method-23 (-> v1-22 state) a1-8) ) - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) (transform-post) 0 (none) ) -(defmethod allocate-and-init-cshape dig-stomp-block ((obj dig-stomp-block)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape dig-stomp-block ((this dig-stomp-block)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1816,23 +1816,23 @@ This commonly includes things such as: ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-skel-and-rigid-body dig-stomp-block ((obj dig-stomp-block)) +(defmethod init-skel-and-rigid-body dig-stomp-block ((this dig-stomp-block)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-stomp-block" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *dig-stomp-block-constants*) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-collision)) - (set! (-> obj draw light-index) (the-as uint 10)) - (set! (-> obj flag) #f) + (alloc-and-init-rigid-body-control this *dig-stomp-block-constants*) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this rbody state flags) (rigid-body-flag enable-collision)) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this flag) #f) 0 (none) ) @@ -1931,17 +1931,17 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-stomp-block-controller ((obj dig-stomp-block-controller) (arg0 entity-actor)) +(defmethod init-from-entity! dig-stomp-block-controller ((this dig-stomp-block-controller) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj played-fall?) #f) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (go (method-of-object obj idle)) + (set! (-> this played-fall?) #f) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (go (method-of-object this idle)) (none) ) @@ -1962,7 +1962,7 @@ This commonly includes things such as: :bounds (static-spherem 0 13 0 14.5) ) -(defmethod run-logic? dig-totem ((obj dig-totem)) +(defmethod run-logic? dig-totem ((this dig-totem)) #t ) @@ -1972,14 +1972,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-totem ((obj dig-totem) (arg0 entity-actor)) +(defmethod init-from-entity! dig-totem ((this dig-totem) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core action) (collide-action solid)) @@ -1993,15 +1993,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-totem-entity" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/drill/drill-baron.gc b/goal_src/jak2/levels/drill/drill-baron.gc index be7b830db1..19904249c5 100644 --- a/goal_src/jak2/levels/drill/drill-baron.gc +++ b/goal_src/jak2/levels/drill/drill-baron.gc @@ -978,40 +978,40 @@ ) ;; WARN: Return type mismatch process-drawable vs drill-barons-ship-turret. -(defmethod relocate drill-barons-ship-turret ((obj drill-barons-ship-turret) (arg0 int)) - (when (-> obj jmod) - (if (nonzero? (-> obj jmod)) - (&+! (-> obj jmod) arg0) +(defmethod relocate drill-barons-ship-turret ((this drill-barons-ship-turret) (arg0 int)) + (when (-> this jmod) + (if (nonzero? (-> this jmod)) + (&+! (-> this jmod) arg0) ) ) - (when (-> obj jmod-left) - (if (nonzero? (-> obj jmod-left)) - (&+! (-> obj jmod-left) arg0) + (when (-> this jmod-left) + (if (nonzero? (-> this jmod-left)) + (&+! (-> this jmod-left) arg0) ) ) - (when (-> obj jmod-right) - (if (nonzero? (-> obj jmod-right)) - (&+! (-> obj jmod-right) arg0) + (when (-> this jmod-right) + (if (nonzero? (-> this jmod-right)) + (&+! (-> 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)) - obj + this arg0 ) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-barons-ship ((obj drill-barons-ship) (arg0 entity-actor)) +(defmethod init-from-entity! drill-barons-ship ((this drill-barons-ship) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1033,41 +1033,41 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-barons-ship" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (quaternion-vector-angle! (-> obj root quat) *y-vector* -16384.0) - (set-vector! (-> obj root trans) 737280.0 -1024000.0 -1433600.0 1.0) - (set! (-> obj next-to-shoot-idx) 0) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (set! (-> obj current-y-position) (-> obj root trans y)) - (set! (-> obj from-y) (-> obj current-y-position)) - (set! (-> obj inc-y) 1228.8) - (set! (-> obj ease-y) 40960.0) - (set! (-> obj pass) 0) - (set! (-> obj end-of-pass) #f) - (set! (-> obj rock-angle) 0.0) - (let ((a0-21 (-> obj skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (quaternion-vector-angle! (-> this root quat) *y-vector* -16384.0) + (set-vector! (-> this root trans) 737280.0 -1024000.0 -1433600.0 1.0) + (set! (-> this next-to-shoot-idx) 0) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (set! (-> this current-y-position) (-> this root trans y)) + (set! (-> this from-y) (-> this current-y-position)) + (set! (-> this inc-y) 1228.8) + (set! (-> this ease-y) 40960.0) + (set! (-> this pass) 0) + (set! (-> this end-of-pass) #f) + (set! (-> this rock-angle) 0.0) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (ja-post) (dotimes (s5-2 (length *barons-ship-turrets*)) - (process-spawn drill-barons-ship-turret (-> *barons-ship-turrets* s5-2) :to obj) + (process-spawn drill-barons-ship-turret (-> *barons-ship-turrets* s5-2) :to this) ) (set! (-> *barons-ship-turrets* (-> *ship-turrets-first-pass* 3) alive) #f) (set! (-> *barons-ship-turrets* (-> *ship-turrets-first-pass* 9) alive) #f) (set! (-> *barons-ship-turrets* (-> *ship-turrets-first-pass* 11) alive) #f) - (set! (-> obj soundid) (the-as uint (sound-play "drl-ship-steady"))) - (go (method-of-object obj hidden)) + (set! (-> this soundid) (the-as uint (sound-play "drl-ship-steady"))) + (go (method-of-object this hidden)) (none) ) @@ -1103,13 +1103,13 @@ This commonly includes things such as: ) -(defmethod deal-damage! drill-ship-shot ((obj drill-ship-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! drill-ship-shot ((this drill-ship-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" - (if (not (and (-> (the-as drill-barons-ship (-> obj parent 0)) next-state) - (= (-> (the-as drill-barons-ship (-> obj parent 0)) next-state name) 'hidden) + (if (not (and (-> (the-as drill-barons-ship (-> this parent 0)) next-state) + (= (-> (the-as drill-barons-ship (-> this parent 0)) next-state name) 'hidden) ) ) - ((method-of-type guard-shot deal-damage!) obj arg0 arg1) + ((method-of-type guard-shot deal-damage!) this arg0 arg1) #f ) ) @@ -1120,17 +1120,17 @@ This commonly includes things such as: (none) ) -(defmethod init-proj-settings! drill-ship-shot ((obj drill-ship-shot)) +(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)) obj) - (set! (-> obj attack-mode) 'drill-ship-shot) - (set! (-> obj move) guard-shot-move) - (set! (-> obj max-speed) 737280.0) - (set! (-> obj timeout) (seconds 4.167)) + ((the-as (function guard-shot none) (find-parent-method drill-ship-shot 31)) this) + (set! (-> this attack-mode) 'drill-ship-shot) + (set! (-> this move) guard-shot-move) + (set! (-> this max-speed) 737280.0) + (set! (-> this timeout) (seconds 4.167)) (none) ) -;; NOTE: decompiled by hand +;; og:preserve-this decompiled by hand ;; TODO make the decompiler work on static data of this type ;; (define *drill-ship-turret-speed-event* (the-as turret-path-event L183)) (define *drill-ship-turret-speed-event* @@ -1369,27 +1369,27 @@ This commonly includes things such as: ) ) -(defmethod drill-barons-ship-method-22 drill-barons-ship ((obj drill-barons-ship)) +(defmethod drill-barons-ship-method-22 drill-barons-ship ((this drill-barons-ship)) (with-pp (quaternion-rotate-local-x! - (-> obj root quat) - (-> obj init-quat) + (-> this root quat) + (-> this init-quat) (* 182.04445 (sin (* 36.40889 (the float (current-time))))) ) (let ((f30-2 (* 182.04445 (* 5.0 (sin (* 45.511112 (the float (current-time)))))))) - (when (!= (-> obj rock-angle) 0.0) + (when (!= (-> this rock-angle) 0.0) (+! f30-2 (* 182.04445 (* 20.0 - (if (= (-> obj pass) 1) + (if (= (-> this pass) 1) 1.0 -1.0 ) - (sin (* 182.04445 (-> obj rock-angle))) + (sin (* 182.04445 (-> this rock-angle))) ) ) ) - (set! (-> obj rock-angle) + (set! (-> this rock-angle) (seek-ease - (-> obj rock-angle) + (-> this rock-angle) 0.0 (* 5.0 (-> pp clock time-adjust-ratio)) 90.0 @@ -1397,22 +1397,22 @@ This commonly includes things such as: ) ) ) - (quaternion-rotate-local-z! (-> obj root quat) (-> obj root quat) f30-2) + (quaternion-rotate-local-z! (-> this root quat) (-> this root quat) f30-2) ) - (set! (-> obj root trans z) - (+ (* 4096.0 (* 30.0 (cos (* 45.511112 (the float (current-time)))))) (if (= (-> obj pass) 1) + (set! (-> this root trans z) + (+ (* 4096.0 (* 30.0 (cos (* 45.511112 (the float (current-time)))))) (if (= (-> this pass) 1) -1433600.0 -1433600.0 ) ) ) (if *target* - (set! (-> obj root trans x) - (+ (-> *target* control trans x) (* 4096.0 (+ (if (= (-> obj pass) 1) + (set! (-> this root trans x) + (+ (-> *target* control trans x) (* 4096.0 (+ (if (= (-> this pass) 1) 15.0 -35.0 ) - (* 40.0 (sin (* 182.04445 (-> obj x-offset-angle)))) + (* 40.0 (sin (* 182.04445 (-> this x-offset-angle)))) ) ) ) @@ -1423,17 +1423,17 @@ This commonly includes things such as: ) ) -(defmethod drill-barons-ship-turret-method-24 drill-barons-ship-turret ((obj drill-barons-ship-turret)) +(defmethod drill-barons-ship-turret-method-24 drill-barons-ship-turret ((this drill-barons-ship-turret)) (vector<-cspace! - (-> obj root trans) - (-> (the-as drill-barons-ship (-> obj parent 0)) node-list data (-> obj info joint-idx)) + (-> this root trans) + (-> (the-as drill-barons-ship (-> this parent 0)) node-list data (-> this info joint-idx)) ) - (let ((a2-1 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (-> obj info init-y-angle)))) - (quaternion*! (-> obj root quat) (-> (the-as drill-barons-ship (-> obj parent 0)) root quat) a2-1) + (let ((a2-1 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (-> this info init-y-angle)))) + (quaternion*! (-> this root quat) (-> (the-as drill-barons-ship (-> this parent 0)) root quat) a2-1) ) - (when (-> obj jmod) - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root trans))) - (s3-0 (quaternion->matrix (new-stack-matrix0) (-> obj root quat))) + (when (-> this jmod) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (s3-0 (quaternion->matrix (new-stack-matrix0) (-> this root quat))) ) (vector-normalize! s5-1 1.0) (let* ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s3-0 vector 1) 1.0)) @@ -1442,26 +1442,26 @@ This commonly includes things such as: (f30-0 (vector-y-angle a0-13)) (f0-1 (vector-y-angle s3-1)) (f0-5 (fmax - (fmin (+ (deg-diff f0-1 f30-0) (* 182.04445 (-> obj error-y-angle))) (-> obj info twist-y-max)) - (- (-> obj info twist-y-max)) + (fmin (+ (deg-diff f0-1 f30-0) (* 182.04445 (-> this error-y-angle))) (-> this info twist-y-max)) + (- (-> this info twist-y-max)) ) ) ) - (quaternion-axis-angle! (the-as quaternion (-> obj jmod twist)) 0.0 1.0 0.0 f0-5) + (quaternion-axis-angle! (the-as quaternion (-> this jmod twist)) 0.0 1.0 0.0 f0-5) ) ) - (if (-> obj jmod-left) + (if (-> this jmod-left) (quaternion-axis-angle! - (the-as quaternion (-> obj jmod-left twist)) + (the-as quaternion (-> this jmod-left twist)) 0.0 0.0 1.0 (* 182.04445 (* -3.0 (the float (current-time)))) ) ) - (if (-> obj jmod-right) + (if (-> this jmod-right) (quaternion-axis-angle! - (the-as quaternion (-> obj jmod-right twist)) + (the-as quaternion (-> this jmod-right twist)) 0.0 0.0 1.0 @@ -1481,7 +1481,7 @@ This commonly includes things such as: (set! (-> v1-1 prim-core collide-with) (collide-spec)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (vector<-cspace! @@ -1737,7 +1737,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self shot-timer) (current-time)) + (set-time! (-> self shot-timer)) (set! (-> self shot-counter) 0) (set! (-> self error-y-angle) (if (< 25.0 (rand-vu-float-range 0.0 50.0)) -15.0 @@ -1859,7 +1859,7 @@ This commonly includes things such as: ) (go-virtual idle) ) - (when (and (= (-> self anim-frame) 1.0) (>= (- (current-time) (-> self shot-timer)) (seconds 0.2))) + (when (and (= (-> self anim-frame) 1.0) (time-elapsed? (-> self shot-timer) (seconds 0.2))) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (cond ((-> self jmod) @@ -1946,7 +1946,7 @@ This commonly includes things such as: ) (sound-play "ship-gun1-fire") (+! (-> self shot-counter) 1) - (set! (-> self shot-timer) (current-time)) + (set-time! (-> self shot-timer)) (seek! (-> self error-y-angle) (-> self error-y-angle-dest) (-> self clock time-adjust-ratio)) (if (= (-> self error-y-angle) (-> self error-y-angle-dest)) (set! (-> self info next-to-shoot) #f) diff --git a/goal_src/jak2/levels/drill/drill-mech-master.gc b/goal_src/jak2/levels/drill/drill-mech-master.gc index 54b529dd76..c0efd1e29d 100644 --- a/goal_src/jak2/levels/drill/drill-mech-master.gc +++ b/goal_src/jak2/levels/drill/drill-mech-master.gc @@ -9,39 +9,39 @@ ;; DECOMP BEGINS -(defmethod draw hud-cpanel ((obj hud-cpanel)) +(defmethod draw hud-cpanel ((this hud-cpanel)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 502.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 502.0 (* 130.0 (-> this offset)))) 200 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -28 55) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -28 55) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-cpanel ((obj hud-cpanel)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-cpanel ((this hud-cpanel)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-cpanel ((obj hud-cpanel)) - (set! (-> obj level) (level-get *level* 'drillmid)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #xb1e))) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-cpanel ((this hud-cpanel)) + (set! (-> this level) (level-get *level* 'drillmid)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #xb1e))) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -78,24 +78,24 @@ (define *drill-mech-master* (the-as (pointer drill-mech-master) #f)) -(defmethod deactivate drill-mech-master ((obj drill-mech-master)) +(defmethod deactivate drill-mech-master ((this drill-mech-master)) (set! *drill-mech-master* (the-as (pointer drill-mech-master) #f)) - (if (nonzero? (-> obj alarm-sound-id)) - (sound-stop (-> obj alarm-sound-id)) + (if (nonzero? (-> this alarm-sound-id)) + (sound-stop (-> this alarm-sound-id)) ) - (if (nonzero? (-> obj part-doom)) - (kill-and-free-particles (-> obj part-doom)) + (if (nonzero? (-> this part-doom)) + (kill-and-free-particles (-> this part-doom)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; WARN: Return type mismatch process vs drill-mech-master. -(defmethod relocate drill-mech-master ((obj drill-mech-master) (arg0 int)) - (if (nonzero? (-> obj part-doom)) - (&+! (-> obj part-doom) arg0) +(defmethod relocate drill-mech-master ((this drill-mech-master) (arg0 int)) + (if (nonzero? (-> this part-doom)) + (&+! (-> this part-doom) arg0) ) - (the-as drill-mech-master ((method-of-type process relocate) obj arg0)) + (the-as drill-mech-master ((method-of-type process relocate) this arg0)) ) (defbehavior drill-mech-master-event-handler drill-mech-master ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -126,17 +126,17 @@ ) ) -(defmethod spawn-hud-panel drill-mech-master ((obj drill-mech-master) (arg0 symbol)) +(defmethod spawn-hud-panel drill-mech-master ((this drill-mech-master) (arg0 symbol)) "Spawn the hud panel for the drill-mech mission." (cond - ((and arg0 (nonzero? (-> obj cpanel-count))) - (if (not (handle->process (-> obj hud-cpanel))) - (set! (-> obj hud-cpanel) (ppointer->handle (process-spawn hud-cpanel :init hud-init-by-other :to obj))) + ((and arg0 (nonzero? (-> this cpanel-count))) + (if (not (handle->process (-> this hud-cpanel))) + (set! (-> this hud-cpanel) (ppointer->handle (process-spawn hud-cpanel :init hud-init-by-other :to this))) ) ) (else - (send-event (handle->process (-> obj hud-cpanel)) 'hide-and-die) - (set! (-> obj hud-cpanel) (the-as handle #f)) + (send-event (handle->process (-> this hud-cpanel)) 'hide-and-die) + (set! (-> this hud-cpanel) (the-as handle #f)) ) ) (none) @@ -158,16 +158,16 @@ :virtual #t :event drill-mech-master-event-handler :code (behavior () - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (suspend) ) (task-node-close! (game-task-node drill-mech-smash-consoles)) (set! (-> self alarm-sound-id) (sound-play "drill-alarm")) (persist-with-delay *setting-control* 'ignore-target (seconds 8) 'ignore-target #t 0.0 0) (set-setting! 'music 'danger10 0.0 0) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (talker-spawn-func (-> *talker-speech* 183) *entity-pool* (target-pos 0) (the-as region #f)) @@ -185,10 +185,10 @@ :virtual #t :event drill-mech-master-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-continue! *game-info* "drill-escape" #f) (set! (-> self next-warn-time) (+ (current-time) (seconds 1))) - (set! (-> self started-timer-time) (current-time)) + (set-time! (-> self started-timer-time)) (set! (-> self exited?) #f) ) :trans (behavior () @@ -234,7 +234,7 @@ :virtual #t :event drill-mech-master-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-setting! 'allow-pause #f 0.0 0) (set-setting! 'allow-progress #f 0.0 0) ) @@ -245,7 +245,7 @@ ) :trans (behavior () (when (and (not (-> self killed-jak?)) - (>= (- (current-time) (-> self state-time)) (seconds 0.225)) + (time-elapsed? (-> self state-time) (seconds 0.225)) (send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'big-explosion)))) ) (set! (-> self killed-jak?) #t) @@ -280,8 +280,8 @@ (set! (-> s4-0 trans w) 1.0) (spawn-with-matrix (-> self part-doom) s4-0) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (when (and (not gp-1) (>= 2 s5-1) (= (get-status *gui-control* (-> self explosion-sound-id)) (gui-status ready))) (set! gp-1 #t) (set-action! diff --git a/goal_src/jak2/levels/drill/drill-obs.gc b/goal_src/jak2/levels/drill/drill-obs.gc index 9f285c44f7..57652064d9 100644 --- a/goal_src/jak2/levels/drill/drill-obs.gc +++ b/goal_src/jak2/levels/drill/drill-obs.gc @@ -7,76 +7,76 @@ ;; DECOMP BEGINS -(defmethod draw hud-gruntegg ((obj hud-gruntegg)) +(defmethod draw hud-gruntegg ((this hud-gruntegg)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 462.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 462.0 (* 130.0 (-> this offset)))) 200 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -25 33) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -25 33) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-gruntegg ((obj hud-gruntegg)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-gruntegg ((this hud-gruntegg)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-gruntegg ((obj hud-gruntegg)) - (set! (-> obj level) (level-get *level* 'drillmid)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-gruntegg ((this hud-gruntegg)) + (set! (-> this level) (level-get *level* 'drillmid)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #xb1e))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.7) - (set! (-> obj sprites 0 scale-y) 0.7) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #xb1e))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.7) + (set! (-> this sprites 0 scale-y) 0.7) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) -(defmethod draw hud-crimsonhover ((obj hud-crimsonhover)) +(defmethod draw hud-crimsonhover ((this hud-crimsonhover)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 462.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 462.0 (* 130.0 (-> this offset)))) 200 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -25 33) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -25 33) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-crimsonhover ((obj hud-crimsonhover)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-crimsonhover ((this hud-crimsonhover)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-crimsonhover ((obj hud-crimsonhover)) - (set! (-> obj level) (level-get *level* 'drillmid)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-crimsonhover ((this hud-crimsonhover)) + (set! (-> this level) (level-get *level* 'drillmid)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x11 :page #xb1e))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.7) - (set! (-> obj sprites 0 scale-y) 0.7) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x11 :page #xb1e))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.7) + (set! (-> this sprites 0 scale-y) 0.7) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -101,15 +101,15 @@ :longest-edge (meters 5.0046) ) -(defmethod start-bouncing! drill-plat-falling ((obj drill-plat-falling)) +(defmethod start-bouncing! drill-plat-falling ((this drill-plat-falling)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (activate! (-> obj smush) -1.0 24 120 1.0 1.0 (-> self clock)) - (set! (-> obj bounce-time) (current-time)) - (set! (-> obj bouncing) #t) - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) + (activate! (-> this smush) -1.0 24 120 1.0 1.0 (-> self clock)) + (set-time! (-> this bounce-time)) + (set! (-> this bouncing) #t) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -153,7 +153,7 @@ and translate the platform via the `smush` (defstate falling (drill-plat-falling) :virtual #t :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 0.4)) + (if (time-elapsed? (-> self state-time) (seconds 0.4)) (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) ) (drill-plat-falling-trans) @@ -170,14 +170,14 @@ and translate the platform via the `smush` ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-plat-falling ((obj drill-plat-falling) (arg0 entity-actor)) +(defmethod init-from-entity! drill-plat-falling ((this drill-plat-falling) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) @@ -193,19 +193,19 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-plat-falling" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (stop-bouncing! obj) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (update-transforms (-> obj root)) + (stop-bouncing! this) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (update-transforms (-> this root)) (ja-channel-push! 1 0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -240,14 +240,14 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 7) ) -(defmethod get-art-group drill-elevator ((obj drill-elevator)) +(defmethod get-art-group drill-elevator ((this drill-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-drill-elevator" (the-as (pointer uint32) #f)) ) -(defmethod init-plat-collision! drill-elevator ((obj drill-elevator)) +(defmethod init-plat-collision! drill-elevator ((this drill-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) @@ -278,7 +278,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -369,8 +369,8 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch vector vs none. -(defmethod set-extent! drill-elevator-shaft ((obj drill-elevator-shaft) (arg0 vector)) - (set! (-> obj extent 1 quad) (-> arg0 quad)) +(defmethod set-extent! drill-elevator-shaft ((this drill-elevator-shaft) (arg0 vector)) + (set! (-> this extent 1 quad) (-> arg0 quad)) (none) ) @@ -439,53 +439,53 @@ This commonly includes things such as: (none) ) -(defmethod move-between-points drill-elevator ((obj drill-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points drill-elevator ((this drill-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 20480.0) (< (fabs (-> s4-2 z)) 20480.0)) ) ) ) ) -(defmethod deactivate drill-elevator ((obj drill-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method drill-elevator 10)) obj) +(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) (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod set-ambient-sound! drill-elevator ((obj drill-elevator)) +(defmethod set-ambient-sound! drill-elevator ((this drill-elevator)) "Sets the elevator's [[ambient-sound]] up" - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this sound-id) (new-sound-id)) (none) ) -(defmethod activate-elevator drill-elevator ((obj drill-elevator)) +(defmethod activate-elevator drill-elevator ((this drill-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (if (or (not (task-node-closed? (game-task-node drill-ship-introduction))) (task-node-closed? (game-task-node nest-boss-resolution)) ) - ((method-of-type elevator activate-elevator) obj) - (go (method-of-object obj dormant)) + ((method-of-type elevator activate-elevator) this) + (go (method-of-object this dormant)) ) ) -(defmethod init-plat! drill-elevator ((obj drill-elevator)) +(defmethod init-plat! drill-elevator ((this drill-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." - (set! (-> obj shaft) - (process-spawn drill-elevator-shaft (-> obj entity extra trans) (-> obj basetrans) :to obj) + (set! (-> this shaft) + (process-spawn drill-elevator-shaft (-> this entity extra trans) (-> this basetrans) :to this) ) 0 (none) @@ -550,9 +550,9 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod commited-to-ride? drill-mech-elevator ((obj drill-mech-elevator)) +(defmethod commited-to-ride? drill-mech-elevator ((this drill-mech-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" - (when (= (-> obj move-pos 1) (-> obj bottom-top 0)) + (when (= (-> this move-pos 1) (-> this bottom-top 0)) (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) s5-0 @@ -561,9 +561,9 @@ For example for an elevator pre-compute the distance between the first and last ) (when (and a0-2 (focus-test? a0-2 mech) (not (logtest? (-> a0-2 focus-status) (focus-status dead ignore)))) (let* ((v1-5 (get-trans a0-2 0)) - (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-5 (-> obj root trans))) + (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-5 (-> this root trans))) ) - (vector-inv-orient-by-quat! s5-2 s5-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s5-2 s5-2 (-> this root quat)) (and (< (fabs (-> s5-2 x)) 16384.0) (< (fabs (-> s5-2 z)) 16384.0)) ) ) @@ -571,7 +571,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod move-to-next-point! drill-mech-elevator ((obj drill-mech-elevator)) +(defmethod move-to-next-point! drill-mech-elevator ((this drill-mech-elevator)) "If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path do so. @see [[elevator::47]]" @@ -584,14 +584,14 @@ do so. ) ) (set! sv-16 (the-as float 0.0)) - (when (and (find-closest-point-in-path! obj (get-trans a0-1 0) (& sv-16) #t #t) - (!= (-> obj move-pos 1) sv-16) - (= sv-16 (-> obj bottom-top 0)) + (when (and (find-closest-point-in-path! this (get-trans a0-1 0) (& sv-16) #t #t) + (!= (-> this move-pos 1) sv-16) + (= sv-16 (-> this bottom-top 0)) ) - (set! (-> obj move-pos 0) (-> obj move-pos 1)) - (set! (-> obj move-pos 1) sv-16) - (logior! (-> obj elevator-status) (elevator-status moving)) - (go (method-of-object obj running)) + (set! (-> this move-pos 0) (-> this move-pos 1)) + (set! (-> this move-pos 1) sv-16) + (logior! (-> this elevator-status) (elevator-status moving)) + (go (method-of-object this running)) ) ) ) @@ -599,25 +599,25 @@ do so. (none) ) -(defmethod deactivate drill-mech-elevator ((obj drill-mech-elevator)) - (if (nonzero? (-> obj running-sound-id)) - (sound-stop (-> obj running-sound-id)) +(defmethod deactivate drill-mech-elevator ((this drill-mech-elevator)) + (if (nonzero? (-> this running-sound-id)) + (sound-stop (-> this running-sound-id)) ) - ((method-of-type drill-elevator deactivate) obj) + ((method-of-type drill-elevator deactivate) this) (none) ) -(defmethod init-plat! drill-mech-elevator ((obj drill-mech-elevator)) +(defmethod init-plat! drill-mech-elevator ((this drill-mech-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." - (set! (-> obj running-sound-id) (new 'static 'sound-id)) - ((method-of-type drill-elevator init-plat!) obj) + (set! (-> this running-sound-id) (new 'static 'sound-id)) + ((method-of-type drill-elevator init-plat!) this) (none) ) -(defmethod activate-elevator drill-mech-elevator ((obj drill-mech-elevator)) +(defmethod activate-elevator drill-mech-elevator ((this drill-mech-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" - (go (method-of-object obj waiting)) + (go (method-of-object this waiting)) ) (deftype fire-floor (process-drawable) @@ -660,9 +660,7 @@ For example for an elevator pre-compute the distance between the first and last ) (when gp-0 (when (or (focus-test? (the-as process-focusable gp-0) mech) - (>= (- (current-time) (-> self no-collision-timer)) - (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) - ) + (time-elapsed? (-> self no-collision-timer) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout))) ) (let ((f0-0 (get-norm! (-> self sync) 0))) (when (and (< (-> self generous) f0-0) (< f0-0 (- (-> self flames-end-tt) (-> self generous)))) @@ -803,43 +801,43 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod set-part fire-floor ((obj fire-floor)) +(defmethod set-part fire-floor ((this fire-floor)) "Set the particle launch controls for the on/off states." - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 399) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 398) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 399) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 398) this)) 0 (none) ) ;; WARN: Return type mismatch process-drawable vs fire-floor. -(defmethod relocate fire-floor ((obj fire-floor) (arg0 int)) - (if (nonzero? (-> obj part-off)) - (&+! (-> obj part-off) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method fire-floor 7)) this arg0) ) ) -(defmethod deactivate fire-floor ((obj fire-floor)) - (sound-stop (-> obj sound-id)) - (if (nonzero? (-> obj part-off)) - (kill-and-free-particles (-> obj part-off)) +(defmethod deactivate fire-floor ((this fire-floor)) + (sound-stop (-> this sound-id)) + (if (nonzero? (-> this part-off)) + (kill-and-free-particles (-> this part-off)) ) - ((the-as (function process-drawable none) (find-parent-method fire-floor 10)) obj) + ((the-as (function process-drawable none) (find-parent-method fire-floor 10)) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fire-floor ((obj fire-floor) (arg0 entity-actor)) +(defmethod init-from-entity! fire-floor ((this fire-floor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -852,10 +850,10 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) - (set-part obj) + (process-drawable-from-entity! this arg0) + (set-part this) (let ((a1-4 (new 'stack-no-clear 'sync-info-params))) (let ((v1-9 0)) (if #t @@ -867,24 +865,24 @@ This commonly includes things such as: (set! (-> a1-4 entity) arg0) (set! (-> a1-4 period) (the-as uint 2100)) (set! (-> a1-4 percent) 0.0) - (initialize! (-> obj sync) a1-4) + (initialize! (-> this sync) a1-4) ) - (set! (-> obj flames-end-tt) (/ (the float (the int (* 300.0 (res-lump-float arg0 'timeout :default 3.0)))) - (the float (-> obj sync period)) - ) + (set! (-> this flames-end-tt) (/ (the float (the int (* 300.0 (res-lump-float arg0 'timeout :default 3.0)))) + (the float (-> this sync period)) + ) ) - (set! (-> obj generous) (/ 90.0 (the float (-> obj sync period)))) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 arg0 #t)) - (if (-> obj path) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this generous) (/ 90.0 (the float (-> this sync period)))) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #t)) + (if (-> this path) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) ) (let ((s4-1 (new 'stack-no-clear 'matrix3)) - (s3-0 (-> obj local-to-world)) - (s5-1 (-> obj size)) + (s3-0 (-> this local-to-world)) + (s5-1 (-> this size)) ) - (get-point-in-path! (-> obj path) (the-as vector (-> s4-1 vector)) 0.0 'interp) - (get-point-in-path! (-> obj path) (-> s4-1 vector 1) 1.0 'interp) - (get-point-in-path! (-> obj path) (-> s4-1 vector 2) 3.0 'interp) + (get-point-in-path! (-> this path) (the-as vector (-> s4-1 vector)) 0.0 'interp) + (get-point-in-path! (-> this path) (-> s4-1 vector 1) 1.0 'interp) + (get-point-in-path! (-> this path) (-> s4-1 vector 2) 3.0 'interp) (matrix-identity! s3-0) (vector-normalize-copy! (the-as vector (-> s3-0 vector)) @@ -900,14 +898,14 @@ This commonly includes things such as: (vector-cross! (-> s3-0 vector 2) (the-as vector (-> s3-0 vector)) (-> s3-0 vector 1)) (vector-normalize! (-> s3-0 vector 2) 1.0) (set! (-> s3-0 trans quad) (-> s4-1 vector 0 quad)) - (matrix-inverse-of-rot-trans! (-> obj world-to-local) (-> obj local-to-world)) - (set! (-> obj deadly-width) (vector-vector-distance (-> s4-1 vector 1) (the-as vector (-> s4-1 vector)))) - (set! (-> obj deadly-length) (vector-vector-distance (-> s4-1 vector 2) (the-as vector (-> s4-1 vector)))) - (let ((v1-39 (-> obj root root-prim))) + (matrix-inverse-of-rot-trans! (-> this world-to-local) (-> this local-to-world)) + (set! (-> this deadly-width) (vector-vector-distance (-> s4-1 vector 1) (the-as vector (-> s4-1 vector)))) + (set! (-> this deadly-length) (vector-vector-distance (-> s4-1 vector 2) (the-as vector (-> s4-1 vector)))) + (let ((v1-39 (-> this root root-prim))) (vector-reset! (-> v1-39 local-sphere)) - (let* ((f0-14 (* 0.5 (-> obj deadly-width))) + (let* ((f0-14 (* 0.5 (-> this deadly-width))) (f0-16 (* f0-14 f0-14)) - (f1-7 (* 0.5 (-> obj deadly-length))) + (f1-7 (* 0.5 (-> this deadly-length))) ) (set! (-> v1-39 local-sphere w) (sqrtf (+ f0-16 (* f1-7 f1-7)))) ) @@ -923,12 +921,12 @@ This commonly includes things such as: (a0-42 (+ (-> v1-46 attack-id) 1)) ) (set! (-> v1-46 attack-id) a0-42) - (set! (-> obj attack-id) a0-42) + (set! (-> this attack-id) a0-42) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj sound-playing) #f) - (update-transforms (-> obj root)) - (go (method-of-object obj idle)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this sound-playing) #f) + (update-transforms (-> this root)) + (go (method-of-object this idle)) (none) ) @@ -941,10 +939,10 @@ This commonly includes things such as: ) -(defmethod set-part fire-floor-a ((obj fire-floor-a)) +(defmethod set-part fire-floor-a ((this fire-floor-a)) "Set the particle launch controls for the on/off states." - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 401) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 400) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 401) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 400) this)) 0 (none) ) @@ -1020,30 +1018,30 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch basebutton vs drill-switch. -(defmethod relocate drill-switch ((obj drill-switch) (arg0 int)) - (if (nonzero? (-> obj green-part)) - (&+! (-> obj green-part) arg0) +(defmethod relocate drill-switch ((this drill-switch) (arg0 int)) + (if (nonzero? (-> this green-part)) + (&+! (-> this green-part) arg0) ) - (the-as drill-switch ((method-of-type basebutton relocate) obj arg0)) + (the-as drill-switch ((method-of-type basebutton relocate) this arg0)) ) -(defmethod deactivate drill-switch ((obj drill-switch)) - (if (nonzero? (-> obj green-part)) - (kill-and-free-particles (-> obj green-part)) +(defmethod deactivate drill-switch ((this drill-switch)) + (if (nonzero? (-> this green-part)) + (kill-and-free-particles (-> this green-part)) ) - ((method-of-type basebutton deactivate) obj) + ((method-of-type basebutton deactivate) this) (none) ) -(defmethod set-switch-color drill-switch ((obj drill-switch) (arg0 symbol)) +(defmethod set-switch-color drill-switch ((this drill-switch) (arg0 symbol)) "Set the switch color based on its state." (when (or arg0 (not (logtest? (current-time) 64))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (vector<-cspace+vector! s4-0 (-> obj node-list data 4) (new 'static 'vector :y 6963.2 :w 1.0)) + (vector<-cspace+vector! s4-0 (-> this node-list data 4) (new 'static 'vector :y 6963.2 :w 1.0)) (spawn (if arg0 - (-> obj green-part) - (-> obj part) + (-> this green-part) + (-> this part) ) s4-0 ) @@ -1052,9 +1050,9 @@ This commonly includes things such as: (none) ) -(defmethod basebutton-method-34 drill-switch ((obj drill-switch)) +(defmethod basebutton-method-34 drill-switch ((this drill-switch)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) @@ -1082,7 +1080,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1195,7 +1193,7 @@ This commonly includes things such as: (sleep-code) ) (else - (until (>= (- (current-time) (-> self state-time)) (the int (* 300.0 (-> self timeout)))) + (until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout)))) (suspend) ) (send-event! self (-> self event-going-up)) @@ -1255,31 +1253,31 @@ This commonly includes things such as: ) ) -(defmethod press! drill-switch ((obj drill-switch) (arg0 symbol)) +(defmethod press! drill-switch ((this drill-switch) (arg0 symbol)) (if arg0 - (logior! (-> obj button-status) (button-status pressed)) - (logclear! (-> obj button-status) (button-status pressed)) + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) ) - (when (not (logtest? (-> obj button-status) (button-status button-status-1))) + (when (not (logtest? (-> this button-status) (button-status button-status-1))) (if arg0 - (process-entity-status! obj (entity-perm-status bit-12) #t) - (process-entity-status! obj (entity-perm-status bit-12) #f) + (process-entity-status! this (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #f) ) ) ) -(defmethod basebutton-method-33 drill-switch ((obj drill-switch)) +(defmethod basebutton-method-33 drill-switch ((this drill-switch)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-switch" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) @@ -1289,26 +1287,26 @@ This commonly includes things such as: (none) ) -(defmethod prepare-trigger-event! drill-switch ((obj drill-switch)) +(defmethod prepare-trigger-event! drill-switch ((this drill-switch)) "Sets `event-going-down` to `'trigger`" - (set! (-> obj down-frame) 2.0) - (logior! (-> obj button-status) (button-status button-status-3)) - (set! (-> obj event-going-down) 'trigger) - (set! (-> obj event-going-up) 'untrigger) - (if (and (= (-> obj entity extra perm task) (game-task drill-mech)) + (set! (-> this down-frame) 2.0) + (logior! (-> this button-status) (button-status button-status-3)) + (set! (-> this event-going-down) 'trigger) + (set! (-> this event-going-up) 'untrigger) + (if (and (= (-> this entity extra perm task) (game-task drill-mech)) (task-node-closed? (game-task-node drill-mech-smash-consoles)) - (= (-> obj timeout) 0.0) + (= (-> this timeout) 0.0) ) - (process-entity-status! obj (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))) - (logior! (-> obj button-status) (button-status pressed)) - (logclear! (-> obj button-status) (button-status pressed)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))) + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) ) - (logior! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj mask) (process-mask no-track)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 451) obj)) - (set! (-> obj green-part) (create-launch-control (-> *part-group-id-table* 452) obj)) + (logior! (-> this mask) (process-mask collectable)) + (logclear! (-> this mask) (process-mask no-track)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 451) this)) + (set! (-> this green-part) (create-launch-control (-> *part-group-id-table* 452) this)) 0 (none) ) @@ -1381,16 +1379,16 @@ This commonly includes things such as: ) -(defmethod deactivate drill-laser ((obj drill-laser)) - (sound-stop (-> obj hit-sound-id)) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate drill-laser ((this drill-laser)) + (sound-stop (-> this hit-sound-id)) + ((method-of-type process-drawable deactivate) this) (none) ) (defstate drill-laser-idle (drill-laser) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let* ((f0-2 (+ (* 0.0033333334 (the float (- (current-time) (-> self state-time)))) @@ -1487,7 +1485,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-laser ((obj drill-laser) (arg0 entity-actor)) +(defmethod init-from-entity! drill-laser ((this drill-laser) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1495,13 +1493,13 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj firing?) #f) - (set! (-> obj hit-sound-id) (new 'static 'sound-id)) - (set! (-> obj root) (new 'process 'trsqv)) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 quat)) - (vector-identity! (-> obj root scale)) - (set! (-> obj entity) arg0) + (set! (-> this firing?) #f) + (set! (-> this hit-sound-id) (new 'static 'sound-id)) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (set! (-> this entity) arg0) (let ((f30-0 1.0) (f28-0 0.0) (f26-0 3.0) @@ -1514,11 +1512,11 @@ This commonly includes things such as: (set! f26-0 (-> v1-8 2)) ) ) - (set! (-> obj speed) f30-0) - (set! (-> obj offset) f28-0) - (set! (-> obj pause) f26-0) + (set! (-> this speed) f30-0) + (set! (-> this offset) f28-0) + (set! (-> this pause) f26-0) ) - (go (method-of-object obj drill-laser-idle)) + (go (method-of-object this drill-laser-idle)) (none) ) diff --git a/goal_src/jak2/levels/drill/drill-obs2.gc b/goal_src/jak2/levels/drill/drill-obs2.gc index 6b35196485..4c05263cc1 100644 --- a/goal_src/jak2/levels/drill/drill-obs2.gc +++ b/goal_src/jak2/levels/drill/drill-obs2.gc @@ -127,9 +127,9 @@ :post plat-post ) -(defmethod init-plat-collision! drill-flip-step ((obj drill-flip-step)) +(defmethod init-plat-collision! drill-flip-step ((this drill-flip-step)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s5-0 total-prims) (the-as uint 4)) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) @@ -167,47 +167,47 @@ (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) (set! (-> s5-0 rider-max-momentum) 0.0) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) -(defmethod get-skel drill-flip-step ((obj drill-flip-step)) +(defmethod get-skel drill-flip-step ((this drill-flip-step)) (art-group-get-by-name *level* "skel-drill-flip-step" (the-as (pointer uint32) #f)) ) -(defmethod set-flipped-state drill-flip-step ((obj drill-flip-step)) +(defmethod set-flipped-state drill-flip-step ((this drill-flip-step)) "Set the state of the platform based on the completion of the drill-mech task." - (if (and (= (-> obj entity extra perm task) (game-task drill-mech)) + (if (and (= (-> this entity extra perm task) (game-task drill-mech)) (task-node-closed? (game-task-node drill-mech-smash-consoles)) ) - (process-entity-status! obj (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))) - (go (method-of-object obj up)) - (go (method-of-object obj down)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))) + (go (method-of-object this up)) + (go (method-of-object this down)) ) 0 (none) ) -(defmethod init-from-entity! drill-flip-step ((obj drill-flip-step) (arg0 entity-actor)) +(defmethod init-from-entity! drill-flip-step ((this drill-flip-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group (get-skel obj)) (the-as pair 0)) - (stop-bouncing! obj) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (stop-bouncing! this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (base-plat-method-32 obj) - (set-flipped-state obj) + (base-plat-method-32 this) + (set-flipped-state this) (none) ) @@ -349,14 +349,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-falling-door ((obj drill-falling-door) (arg0 entity-actor)) +(defmethod init-from-entity! drill-falling-door ((this drill-falling-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -381,29 +381,29 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-falling-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-push! 1 0) - (let ((a0-18 (-> obj skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-18 (-> this skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (set! (-> obj hit-state) 0) - (set! (-> obj next-hit-state) 0) + (set! (-> this hit-state) 0) + (set! (-> this next-hit-state) 0) (if (task-node-closed? (game-task-node drill-mech-smash-consoles)) - (process-entity-status! obj (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))) - (go (method-of-object obj fall) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))) + (go (method-of-object this fall) #t) + (go (method-of-object this idle)) ) (none) ) @@ -457,14 +457,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-sliding-door ((obj drill-sliding-door) (arg0 entity-actor)) +(defmethod init-from-entity! drill-sliding-door ((this drill-sliding-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -491,25 +491,25 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-sliding-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-push! 1 0) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -527,23 +527,23 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 9) ) -(defmethod get-art-group drill-accelerator-floor ((obj drill-accelerator-floor)) +(defmethod get-art-group drill-accelerator-floor ((this drill-accelerator-floor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-drill-accelerator-floor" (the-as (pointer uint32) #f)) ) -(defmethod init! drill-accelerator-floor ((obj drill-accelerator-floor)) +(defmethod init! drill-accelerator-floor ((this drill-accelerator-floor)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj speed) 7372.8) - (set! (-> obj belt-radius) 11878.4) - (set! (-> obj pull-y-threshold) 10240.0) + (set! (-> this speed) 7372.8) + (set! (-> this belt-radius) 11878.4) + (set! (-> this pull-y-threshold) 10240.0) 0 (none) ) -(defmethod reset-root! drill-accelerator-floor ((obj drill-accelerator-floor)) +(defmethod reset-root! drill-accelerator-floor ((this drill-accelerator-floor)) "Re-initializes the `root` [[trsqv]]" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -559,7 +559,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -620,14 +620,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-breakable-barrel ((obj drill-breakable-barrel) (arg0 entity-actor)) +(defmethod init-from-entity! drill-breakable-barrel ((this drill-breakable-barrel) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -642,18 +642,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-breakable-barrel" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -809,7 +809,7 @@ This commonly includes things such as: ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.5)) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -836,7 +836,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-metalhead-eggs ((obj drill-metalhead-eggs) (arg0 entity-actor)) +(defmethod init-from-entity! drill-metalhead-eggs ((this drill-metalhead-eggs) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -844,22 +844,22 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (init-collision! obj) - (process-drawable-from-entity! obj arg0) - (skel-init! obj) - (set! (-> obj entity extra perm task) (game-task drill-eggs)) - (set! (-> obj notify-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (skel-init! this) + (set! (-> this entity extra perm task) (game-task drill-eggs)) + (set! (-> this notify-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-6 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-6 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (if (and v1-6 (= (-> sv-16 elt-count) 1)) - (set! (-> obj actor-group) (the-as actor-group (-> (the-as (pointer uint32) v1-6)))) - (set! (-> obj actor-group) #f) + (set! (-> this actor-group) (the-as actor-group (-> (the-as (pointer uint32) v1-6)))) + (set! (-> this actor-group) #f) ) ) - (if (or (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) + (if (or (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) (or (task-node-closed? (game-task-node drill-eggs-resolution)) (task-closed? (the-as string ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'task-name 'interp -1000000000.0 @@ -871,9 +871,9 @@ This commonly includes things such as: ) ) ) - (go (method-of-object obj die-fast)) + (go (method-of-object this die-fast)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -919,28 +919,28 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0.3 2) ) -(defmethod skel-init! drill-metalhead-eggs-a ((obj drill-metalhead-eggs-a)) +(defmethod skel-init! drill-metalhead-eggs-a ((this drill-metalhead-eggs-a)) "Initialize the skeleton and animations for this object." (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-metalhead-eggs-a" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-3 param 0) 1.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) (none) ) -(defmethod init-collision! drill-metalhead-eggs-a ((obj drill-metalhead-eggs-a)) +(defmethod init-collision! drill-metalhead-eggs-a ((this drill-metalhead-eggs-a)) "Define the collision for this object." - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -955,34 +955,34 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) -(defmethod skel-init! drill-metalhead-eggs-b ((obj drill-metalhead-eggs-b)) +(defmethod skel-init! drill-metalhead-eggs-b ((this drill-metalhead-eggs-b)) "Initialize the skeleton and animations for this object." (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-metalhead-eggs-b" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-3 param 0) 1.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) (none) ) -(defmethod init-collision! drill-metalhead-eggs-b ((obj drill-metalhead-eggs-b)) +(defmethod init-collision! drill-metalhead-eggs-b ((this drill-metalhead-eggs-b)) "Define the collision for this object." - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -997,34 +997,34 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) -(defmethod skel-init! drill-metalhead-eggs-c ((obj drill-metalhead-eggs-c)) +(defmethod skel-init! drill-metalhead-eggs-c ((this drill-metalhead-eggs-c)) "Initialize the skeleton and animations for this object." (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-metalhead-eggs-c" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-3 param 0) 1.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) (none) ) -(defmethod init-collision! drill-metalhead-eggs-c ((obj drill-metalhead-eggs-c)) +(defmethod init-collision! drill-metalhead-eggs-c ((this drill-metalhead-eggs-c)) "Define the collision for this object." - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -1039,7 +1039,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -1179,14 +1179,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-bridge-shot ((obj drill-bridge-shot) (arg0 entity-actor)) +(defmethod init-from-entity! drill-bridge-shot ((this drill-bridge-shot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1217,23 +1217,23 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-bridge-shot" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw force-lod) 1) - (let ((f0-18 (res-lump-float (-> obj entity) 'rotoffset)) - (a1-16 (-> obj root quat)) + (set! (-> this draw force-lod) 1) + (let ((f0-18 (res-lump-float (-> this entity) 'rotoffset)) + (a1-16 (-> this root quat)) ) (quaternion-rotate-y! a1-16 a1-16 f0-18) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj die) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this die) #t) + (go (method-of-object this idle)) ) (none) ) @@ -1271,22 +1271,22 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-drill ((obj drill-drill) (arg0 entity-actor)) +(defmethod init-from-entity! drill-drill ((this drill-drill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-drill" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj idle)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) (none) ) @@ -1329,9 +1329,9 @@ This commonly includes things such as: ) (if (-> self ridden?) (set! (-> self ridden?) #f) - (set! (-> self not-ridden-timer) (current-time)) + (set-time! (-> self not-ridden-timer)) ) - (if (>= (- (current-time) (-> self not-ridden-timer)) (seconds 0.4)) + (if (time-elapsed? (-> self not-ridden-timer) (seconds 0.4)) (go-virtual swing-down) ) ) @@ -1352,27 +1352,27 @@ This commonly includes things such as: (t9-0) ) ) - (if (>= (- (current-time) (-> self not-ridden-timer)) (seconds 2)) + (if (time-elapsed? (-> self not-ridden-timer) (seconds 2)) (send-event self 'trigger) ) ) ) -(defmethod get-skel drill-drop-plat ((obj drill-drop-plat)) +(defmethod get-skel drill-drop-plat ((this drill-drop-plat)) (art-group-get-by-name *level* "skel-drill-drop-plat" (the-as (pointer uint32) #f)) ) -(defmethod set-flipped-state drill-drop-plat ((obj drill-drop-plat)) +(defmethod set-flipped-state drill-drop-plat ((this drill-drop-plat)) "Set the state of the platform." - (set! (-> obj not-ridden-timer) (current-time)) - (go (method-of-object obj up)) + (set-time! (-> this not-ridden-timer)) + (go (method-of-object this up)) 0 (none) ) -(defmethod init-plat-collision! drill-drop-plat ((obj drill-drop-plat)) +(defmethod init-plat-collision! drill-drop-plat ((this drill-drop-plat)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s5-0 total-prims) (the-as uint 4)) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) @@ -1408,7 +1408,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) (set! (-> s5-0 rider-max-momentum) 0.0) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) diff --git a/goal_src/jak2/levels/drill/drill-panel.gc b/goal_src/jak2/levels/drill/drill-panel.gc index 181258b45a..7a52753ab7 100644 --- a/goal_src/jak2/levels/drill/drill-panel.gc +++ b/goal_src/jak2/levels/drill/drill-panel.gc @@ -44,19 +44,19 @@ ;; WARN: Return type mismatch process-drawable vs drill-control-panel. -(defmethod relocate drill-control-panel ((obj drill-control-panel) (arg0 int)) - (if (nonzero? (-> obj debris-part)) - (&+! (-> obj debris-part) arg0) +(defmethod relocate drill-control-panel ((this drill-control-panel) (arg0 int)) + (if (nonzero? (-> this debris-part)) + (&+! (-> this debris-part) arg0) ) - (the-as drill-control-panel ((method-of-type process-drawable relocate) obj arg0)) + (the-as drill-control-panel ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate drill-control-panel ((obj drill-control-panel)) - (sound-stop (-> obj idle-sound-id)) - (if (nonzero? (-> obj debris-part)) - (kill-and-free-particles (-> obj debris-part)) +(defmethod deactivate drill-control-panel ((this drill-control-panel)) + (sound-stop (-> this idle-sound-id)) + (if (nonzero? (-> this debris-part)) + (kill-and-free-particles (-> this debris-part)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -501,33 +501,33 @@ (none) ) -(defmethod spawn-explode-part drill-control-panel ((obj drill-control-panel)) +(defmethod spawn-explode-part drill-control-panel ((this drill-control-panel)) "Spawn explosion particles." - (let ((v1-0 (-> obj id))) + (let ((v1-0 (-> this id))) (if (or (zero? v1-0) (= v1-0 1)) - (spawn-drill-panel-explode obj) - (spawn-drill-panel-ab-explode obj) + (spawn-drill-panel-explode this) + (spawn-drill-panel-ab-explode this) ) ) (none) ) -(defmethod spawn-shock-part drill-control-panel ((obj drill-control-panel)) +(defmethod spawn-shock-part drill-control-panel ((this drill-control-panel)) "Spawn shock particles." - (let ((v1-0 (-> obj id))) + (let ((v1-0 (-> this id))) (cond ((or (zero? v1-0) (= v1-0 1)) (set! (-> *part-id-table* 1852 init-specs 2 initial-valuef) (* 4096.0 (rand-vu-float-range -4.0 4.0))) (set! (-> *part-id-table* 1852 init-specs 3 initial-valuef) (* 4096.0 (rand-vu-float-range -2.0 2.0))) (set! (-> *part-id-table* 1852 init-specs 4 initial-valuef) (* 4096.0 (rand-vu-float-range 1.0 3.0))) - (when (= (-> obj id) 1) + (when (= (-> this id) 1) (set! (-> *part-id-table* 1870 init-specs 3 initial-valuef) 8192.0) (set! (-> *part-id-table* 1869 init-specs 3 initial-valuef) 8192.0) (set! (-> *part-id-table* 1871 init-specs 2 initial-valuef) 8192.0) (set! (-> *part-id-table* 1872 init-specs 2 initial-valuef) 8192.0) (set! (-> *part-id-table* 1873 init-specs 2 initial-valuef) 8192.0) - (when (>= (current-time) (-> obj next-warn-time)) - (set! (-> obj next-warn-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.0 2.0))))) + (when (>= (current-time) (-> this next-warn-time)) + (set! (-> this next-warn-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.0 2.0))))) (set! (-> *part-id-table* 1851 init-specs 4 initial-valuef) -4096.0) (set! (-> *part-id-table* 1851 init-specs 24 initial-valuef) (* 182.04445 (rand-vu-float-range -45.0 45.0))) (set! (-> *part-id-table* 1851 init-specs 25 initial-valuef) (* 182.04445 (rand-vu-float-range 0.0 45.0))) @@ -535,14 +535,14 @@ (set! (-> *part-id-table* 1851 init-specs 3 initial-valuef) (* 4096.0 (rand-vu-float-range -1.0 3.0))) ) ) - (spawn-with-cspace (-> obj debris-part) (-> obj node-list data 18)) + (spawn-with-cspace (-> this debris-part) (-> this node-list data 18)) ) (else - (case (-> obj id) + (case (-> this id) ((3 5 7 8) (if (zero? (rand-vu-int-count 2)) (process-drawable-shock-effect - obj + this (new 'static 'lightning-spec :name #f :flags (lightning-spec-flags lsf0) @@ -580,14 +580,14 @@ (set! (-> *part-id-table* 1871 init-specs 2 initial-valuef) -6144.0) (set! (-> *part-id-table* 1872 init-specs 2 initial-valuef) -6144.0) (set! (-> *part-id-table* 1873 init-specs 2 initial-valuef) -6144.0) - (when (>= (current-time) (-> obj next-warn-time)) - (set! (-> obj next-warn-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.5 3.0))))) + (when (>= (current-time) (-> this next-warn-time)) + (set! (-> this next-warn-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.5 3.0))))) (set! (-> *part-id-table* 1851 init-specs 4 initial-valuef) 4096.0) (set! (-> *part-id-table* 1879 init-specs 23 initial-valuef) (* 182.04445 (rand-vu-float-range -30.0 30.0))) (set! (-> *part-id-table* 1879 init-specs 2 initial-valuef) (* 4096.0 (rand-vu-float-range -1.5 1.5))) (set! (-> *part-id-table* 1879 init-specs 3 initial-valuef) (* 4096.0 (rand-vu-float-range -1.0 3.0))) ) - (spawn-with-cspace (-> obj debris-part) (-> obj node-list data 12)) + (spawn-with-cspace (-> this debris-part) (-> this node-list data 12)) ) ) ) @@ -597,8 +597,8 @@ (defstate hit (drill-control-panel) :virtual #t :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) - (set! (-> self next-warn-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self next-warn-time)) (process-entity-status! self (entity-perm-status bit-12) #t) (set! (-> self draw force-lod) 0) (logior! (-> self focus-status) (focus-status disable dead ignore)) @@ -608,7 +608,7 @@ ) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (spawn-shock-part self) ) ) @@ -677,9 +677,9 @@ ) ) -(defmethod init-collision! drill-control-panel ((obj drill-control-panel)) +(defmethod init-collision! drill-control-panel ((this drill-control-panel)) "Define the collision for the panel." - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -699,52 +699,52 @@ (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-panel drill-control-panel ((obj drill-control-panel)) +(defmethod init-panel drill-control-panel ((this drill-control-panel)) "Init some parameters for the panel." - (set! (-> obj idle-sound-id) (new-sound-id)) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) + (set! (-> this idle-sound-id) (new-sound-id)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-control-panel ((obj drill-control-panel) (arg0 entity-actor)) +(defmethod init-from-entity! drill-control-panel ((this drill-control-panel) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-control-panel" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (init-panel obj) + (init-panel this) (transform-post) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 427) obj)) - (if (zero? (-> obj id)) - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 436) obj)) - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 437) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 427) this)) + (if (zero? (-> this id)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 436) this)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 437) this)) ) (if (task-node-closed? (game-task-node drill-mech-smash-consoles)) - (process-entity-status! obj (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))) - (go (method-of-object obj hit) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))) + (go (method-of-object this hit) #t) + (go (method-of-object this idle)) ) (none) ) @@ -759,48 +759,48 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-control-panel-a ((obj drill-control-panel-a) (arg0 entity-actor)) +(defmethod init-from-entity! drill-control-panel-a ((this drill-control-panel-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-control-panel-a" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj root root-prim transform-index) (the-as int (-> obj draw origin-joint-index))) - (init-panel obj) - (set! (-> obj draw force-lod) 1) + (set! (-> this root root-prim transform-index) (the-as int (-> this draw origin-joint-index))) + (init-panel this) + (set! (-> this draw force-lod) 1) (transform-post) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 428) obj)) - (case (-> obj id) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 428) this)) + (case (-> this id) ((3 6 8) - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 438) obj)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 438) this)) ) ((5 9) - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 440) obj)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 440) this)) ) ((7) - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 441) obj)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 441) this)) ) (else - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 439) obj)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 439) this)) ) ) (if (task-node-closed? (game-task-node drill-mech-smash-consoles)) - (process-entity-status! obj (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))) - (go (method-of-object obj hit) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))) + (go (method-of-object this hit) #t) + (go (method-of-object this idle)) ) (none) ) diff --git a/goal_src/jak2/levels/drill/drill-spool.gc b/goal_src/jak2/levels/drill/drill-spool.gc index 23acc8004e..5fd4166e54 100644 --- a/goal_src/jak2/levels/drill/drill-spool.gc +++ b/goal_src/jak2/levels/drill/drill-spool.gc @@ -843,9 +843,11 @@ ) ) (sound-play "egg-wall-break" :position (-> self root trans)) + ;; og:preserve-this added cast (ja-play-spooled-anim (-> self anim) (ja-group) (the-as art-joint-anim gp-1) (the-as (function process-drawable symbol) false-func)) ) (ja-channel-set! 1) + ;; og:preserve-this added cast (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-1)) ) ) @@ -858,7 +860,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-wall ((obj drill-wall) (arg0 entity-actor)) +(defmethod init-from-entity! drill-wall ((this drill-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -866,10 +868,10 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (let ((s3-0 ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'art-name 'interp -1000000000.0 @@ -880,8 +882,8 @@ This commonly includes things such as: ) (s4-0 (art-group-get-by-name *level* "skel-drill-wall" (the-as (pointer uint32) #f))) ) - (set! (-> obj art-name) (the-as string s3-0)) - (let ((s2-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this art-name) (the-as string s3-0)) + (let ((s2-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s2-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s2-0 reaction) cshape-reaction-default) (set! (-> s2-0 no-reaction) @@ -902,42 +904,42 @@ This commonly includes things such as: (set! (-> s2-0 backup-collide-as) (-> v1-22 prim-core collide-as)) (set! (-> s2-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) - (set! (-> obj root) s2-0) + (set! (-> this root) s2-0) ) - (if (string= (-> obj art-name) "drill-wall-1") - (set! (-> obj anim) + (if (string= (-> this art-name) "drill-wall-1") + (set! (-> this anim) (new 'static 'spool-anim :name "drill-wall-1" :anim-name "1-break" :parts 1 :command-list '()) ) (go process-drawable-art-error (the-as string s3-0)) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0)) ) (ja-channel-set! 1) - (let* ((s5-1 (-> obj skel root-channel 0)) - (s4-1 (-> obj draw art-group)) + (let* ((s5-1 (-> this skel root-channel 0)) + (s4-1 (-> this draw art-group)) (s3-1 (method-of-object s4-1 get-art-by-name-method)) ) - (format (clear *temp-string*) "~S-idle" (-> obj art-name)) + (format (clear *temp-string*) "~S-idle" (-> this art-name)) (set! (-> s5-1 frame-group) (the-as art-joint-anim (s3-1 s4-1 *temp-string* (the-as type #f)))) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-35 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-35 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (cond ((and v1-35 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj egg-group) (-> v1-35 0)) + (set! (-> this egg-group) (-> v1-35 0)) ) (else ) ) ) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj hit) #t) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this hit) #t) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1112,10 +1114,10 @@ This commonly includes things such as: (none) ) ) - (ja-play-spooled-anim (-> self anim) (ja-group) (the-as art-joint-anim s5-0) (the-as (function process-drawable symbol) false-func)) + (ja-play-spooled-anim (-> self anim) (ja-group) s5-0 (the-as (function process-drawable symbol) false-func)) ) (ja-channel-set! 1) - (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim s5-0)) + (set! (-> self skel root-channel 0 frame-group) s5-0) ) (when (not arg0) (while (and *target* (focus-test? *target* ignore)) @@ -1134,7 +1136,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-crane ((obj drill-crane) (arg0 entity-actor)) +(defmethod init-from-entity! drill-crane ((this drill-crane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1142,13 +1144,14 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (stack-size-set! (-> obj main-thread) 2048) ;; increased from 512 - (logior! (-> obj mask) (process-mask collectable)) + ;; og:preserve-this increased from 512 + (stack-size-set! (-> this main-thread) 2048) + (logior! (-> this mask) (process-mask collectable)) (let ((s3-0 "drill-crane-break") (s4-0 (art-group-get-by-name *level* "skel-drill-crane" (the-as (pointer uint32) #f))) ) - (set! (-> obj art-name) s3-0) - (let ((s3-1 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this art-name) s3-0) + (let ((s3-1 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s3-1 dynam) (copy *standard-dynamics* 'process)) (set! (-> s3-1 reaction) cshape-reaction-default) (set! (-> s3-1 no-reaction) @@ -1169,16 +1172,16 @@ This commonly includes things such as: (set! (-> s3-1 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s3-1 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s3-1) + (set! (-> this root) s3-1) ) - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "drill-crane-break" :anim-name "break" :parts 3 :command-list '()) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0)) ) - (set! (-> obj draw force-lod) 1) - (let ((s4-1 (-> obj root))) + (set! (-> this draw force-lod) 1) + (let ((s4-1 (-> this root))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-28 (res-lump-data arg0 'scale-mult (pointer float) :tag-ptr (& sv-16)))) (when v1-28 @@ -1189,24 +1192,24 @@ This commonly includes things such as: ) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-30 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (let ((v1-30 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-32)))) (cond ((and v1-30 (nonzero? (-> sv-32 elt-count))) - (set! (-> obj egg-group) (the-as actor-group (-> (the-as (pointer uint32) v1-30)))) + (set! (-> this egg-group) (the-as actor-group (-> (the-as (pointer uint32) v1-30)))) ) (else ) ) ) (cond - ((or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + ((or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (task-node-closed? (game-task-node drill-eggs-resolution)) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj hit) #t) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this hit) #t) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) diff --git a/goal_src/jak2/levels/drill/drillmid-obs.gc b/goal_src/jak2/levels/drill/drillmid-obs.gc index 1cdb824562..c4bba05e78 100644 --- a/goal_src/jak2/levels/drill/drillmid-obs.gc +++ b/goal_src/jak2/levels/drill/drillmid-obs.gc @@ -22,15 +22,16 @@ ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-elevator-doors ((obj drill-elevator-doors) (arg0 entity-actor)) +(defmethod init-from-entity! drill-elevator-doors ((this drill-elevator-doors) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 1024) ;; added - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + ;; og:preserve-this added + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -59,24 +60,24 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-elevator-doors" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj inner?) #t) - (set! (-> obj sound-behind?) #t) - (set! (-> obj sound-open-loop) (static-sound-spec "drl-elev-door-l")) - (set! (-> obj sound-open-stop) (static-sound-spec "drl-elev-door-e")) - (set! (-> obj sound-close-loop) (static-sound-spec "drl-elev-door-l")) - (set! (-> obj sound-close-stop) (static-sound-spec "drl-elev-door-e")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this inner?) #t) + (set! (-> this sound-behind?) #t) + (set! (-> this sound-open-loop) (static-sound-spec "drl-elev-door-l")) + (set! (-> this sound-open-stop) (static-sound-spec "drl-elev-door-e")) + (set! (-> this sound-close-loop) (static-sound-spec "drl-elev-door-l")) + (set! (-> this sound-close-stop) (static-sound-spec "drl-elev-door-e")) + (go (method-of-object this close) #t) (none) ) @@ -98,31 +99,31 @@ This commonly includes things such as: :bounds (static-spherem 0 0 6 10) ) -(defmethod get-art-group drill-lift ((obj drill-lift)) +(defmethod get-art-group drill-lift ((this drill-lift)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-drill-lift" (the-as (pointer uint32) #f)) ) -(defmethod move-between-points drill-lift ((obj drill-lift) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points drill-lift ((this drill-lift) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) ) ) ) ) -(defmethod commited-to-ride? drill-lift ((obj drill-lift)) +(defmethod commited-to-ride? drill-lift ((this drill-lift)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -132,17 +133,17 @@ This commonly includes things such as: ) (when a0-2 (let* ((v1-1 (get-trans a0-2 0)) - (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> obj root trans))) + (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this root trans))) ) - (vector-inv-orient-by-quat! gp-2 gp-2 (-> obj root quat)) + (vector-inv-orient-by-quat! gp-2 gp-2 (-> this root quat)) (and (< (fabs (-> gp-2 x)) 20480.0) (< 0.0 (-> gp-2 z)) (< (-> gp-2 z) 40960.0)) ) ) ) ) -(defmethod set-collide-spec! drill-lift ((obj drill-lift) (arg0 symbol)) - (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) +(defmethod set-collide-spec! drill-lift ((this drill-lift) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle pusher)) @@ -206,9 +207,9 @@ This commonly includes things such as: ) ) -(defmethod init-plat-collision! drill-lift ((obj drill-lift)) +(defmethod init-plat-collision! drill-lift ((this drill-lift)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -241,9 +242,9 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set-collide-spec! obj #f) + (set-collide-spec! this #f) (none) ) @@ -261,24 +262,24 @@ This commonly includes things such as: :bounds (static-spherem 7 -2 -3.8 11) ) -(defmethod get-art-group drill-moving-staircase ((obj drill-moving-staircase)) +(defmethod get-art-group drill-moving-staircase ((this drill-moving-staircase)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-drill-moving-staircase" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch float vs none. -(defmethod init! drill-moving-staircase ((obj drill-moving-staircase)) +(defmethod init! drill-moving-staircase ((this drill-moving-staircase)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj speed) 38912.0) - (set! (-> obj belt-radius) 11878.4) - (set! (-> obj pull-y-threshold) 409.6) + (set! (-> this speed) 38912.0) + (set! (-> this belt-radius) 11878.4) + (set! (-> this pull-y-threshold) 409.6) (none) ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! drill-moving-staircase ((obj drill-moving-staircase)) +(defmethod reset-root! drill-moving-staircase ((this drill-moving-staircase)) "Re-initializes the `root` [[trsqv]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -299,7 +300,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) diff --git a/goal_src/jak2/levels/drill/ginsu.gc b/goal_src/jak2/levels/drill/ginsu.gc index 1bb4f4f150..3069c6f4b3 100644 --- a/goal_src/jak2/levels/drill/ginsu.gc +++ b/goal_src/jak2/levels/drill/ginsu.gc @@ -307,20 +307,20 @@ (set! (-> *ginsu-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod ginsu-method-180 ginsu ((obj ginsu)) - (let ((v1-2 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) +(defmethod ginsu-method-180 ginsu ((this ginsu)) + (let ((v1-2 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (when (not (and v1-2 (or (= v1-2 (-> obj draw art-group data 11)) (= v1-2 (-> obj draw art-group data 12))))) - (update! (-> obj blade-speed) 0.0) - (let ((f0-1 (+ (-> obj blade-angle) (* 970903.75 (-> obj blade-speed value))))) - (set! (-> obj blade-angle) (- f0-1 (* (the float (the int (/ f0-1 65536.0))) 65536.0))) + (when (not (and v1-2 (or (= v1-2 (-> this draw art-group data 11)) (= v1-2 (-> this draw art-group data 12))))) + (update! (-> this blade-speed) 0.0) + (let ((f0-1 (+ (-> this blade-angle) (* 970903.75 (-> this blade-speed value))))) + (set! (-> this blade-angle) (- f0-1 (* (the float (the int (/ f0-1 65536.0))) 65536.0))) ) - (quaternion-axis-angle! (-> obj blade-jm quat) 0.0 1.0 0.0 (-> obj blade-angle)) + (quaternion-axis-angle! (-> this blade-jm quat) 0.0 1.0 0.0 (-> this blade-angle)) (let ((s5-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-1 (-> obj node-list data 8 bone transform)) + (let* ((a2-1 (-> this node-list data 8 bone transform)) (v1-14 (-> a2-1 quad 0)) (a0-10 (-> a2-1 quad 1)) (a1-3 (-> a2-1 quad 2)) @@ -331,11 +331,11 @@ (set! (-> s5-0 quad 2) a1-3) (set! (-> s5-0 trans quad) a2-2) ) - (when (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (when (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) (vector-negate! (the-as vector (-> s5-0 vector)) (the-as vector (-> s5-0 vector))) (set! (-> s5-0 vector 0 w) 0.0) ) - (spawn-with-matrix (-> obj blade-part) s5-0) + (spawn-with-matrix (-> this blade-part) s5-0) ) ) ) @@ -343,125 +343,125 @@ (none) ) -(defmethod ginsu-method-181 ginsu ((obj ginsu) (arg0 vector)) +(defmethod ginsu-method-181 ginsu ((this ginsu) (arg0 vector)) (vector-reset! arg0) - (let ((a0-2 (handle->process (-> obj focus handle)))) + (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 - (vector-! arg0 (get-trans (the-as process-focusable a0-2) 0) (-> obj root trans)) + (vector-! arg0 (get-trans (the-as process-focusable a0-2) 0) (-> this root trans)) ) ) arg0 ) ;; WARN: Return type mismatch symbol vs none. -(defmethod track-target! ginsu ((obj ginsu)) +(defmethod track-target! ginsu ((this ginsu)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (ginsu-method-180 obj) + (ginsu-method-180 this) (let ((t9-1 (method-of-type nav-enemy track-target!))) - (t9-1 obj) + (t9-1 this) ) (cond - ((not (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) - (or (= v1-6 'idle) - (= v1-6 'active) - (= v1-6 'dormant) - (= v1-6 'ambush) - (= v1-6 'knocked) - (= v1-6 'idle) - (= v1-6 'dormant) - (= v1-6 'die) - (= v1-6 'die-falling) - ) - ) + ((not (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'idle) + (= v1-6 'active) + (= v1-6 'dormant) + (= v1-6 'ambush) + (= v1-6 'knocked) + (= v1-6 'idle) + (= v1-6 'dormant) + (= v1-6 'die) + (= v1-6 'die-falling) + ) + ) ) ) - (sound-play "ginsu-loop" :id (-> obj blade-sound) :position (-> obj root trans)) - (set! (-> obj blade-sound-playing) #t) + (sound-play "ginsu-loop" :id (-> this blade-sound) :position (-> this root trans)) + (set! (-> this blade-sound-playing) #t) ) - ((-> obj blade-sound-playing) - (sound-stop (-> obj blade-sound)) - (set! (-> obj blade-sound-playing) #f) + ((-> this blade-sound-playing) + (sound-stop (-> this blade-sound)) + (set! (-> this blade-sound-playing) #f) ) ) (cond - ((and (not (and (-> obj next-state) (let ((v1-17 (-> obj next-state name))) - (or (= v1-17 'idle) - (= v1-17 'active) - (= v1-17 'dormant) - (= v1-17 'ambush) - (= v1-17 'knocked) - (= v1-17 'idle) - (= v1-17 'dormant) - (= v1-17 'die) - (= v1-17 'die-falling) - ) - ) + ((and (not (and (-> this next-state) (let ((v1-17 (-> this next-state name))) + (or (= v1-17 'idle) + (= v1-17 'active) + (= v1-17 'dormant) + (= v1-17 'ambush) + (= v1-17 'knocked) + (= v1-17 'idle) + (= v1-17 'dormant) + (= v1-17 'die) + (= v1-17 'die-falling) + ) + ) ) ) - (< (- (current-time) (-> obj grind-timer)) 0) + (< (- (current-time) (-> this grind-timer)) 0) ) - (sound-play "ginsu-grind" :id (-> obj grind-sound) :position (-> obj root trans)) - (set! (-> obj grind-sound-playing) #t) + (sound-play "ginsu-grind" :id (-> this grind-sound) :position (-> this root trans)) + (set! (-> this grind-sound-playing) #t) ) - ((-> obj grind-sound-playing) - (sound-stop (-> obj grind-sound)) - (set! (-> obj grind-sound-playing) #f) + ((-> this grind-sound-playing) + (sound-stop (-> this grind-sound)) + (set! (-> this grind-sound-playing) #f) ) ) (none) ) -(defmethod ginsu-method-182 ginsu ((obj ginsu)) +(defmethod ginsu-method-182 ginsu ((this ginsu)) (local-vars (s5-1 art-element)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'matrix)) ) - (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (let* ((v1-8 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let* ((v1-8 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) - (f30-0 (if (and v1-8 (= v1-8 (-> obj draw art-group data 7))) + (f30-0 (if (and v1-8 (= v1-8 (-> this draw art-group data 7))) (cos 9102.223) (cos 7281.778) ) ) ) - (let ((a1-0 (-> obj nav state))) + (let ((a1-0 (-> this nav state))) (set! (-> s5-0 quad) (-> a1-0 velocity quad)) ) - (quaternion->matrix s4-0 (-> obj root quat)) + (quaternion->matrix s4-0 (-> this root quat)) (let ((f0-1 (vector-dot s5-0 (the-as vector (-> s4-0 vector))))) - (if (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) (set! f0-1 (- f0-1)) ) (cond ((< (- f30-0) f0-1) - (set! s5-1 (-> obj draw art-group data 9)) + (set! s5-1 (-> this draw art-group data 9)) ) ((< f0-1 f30-0) - (set! s5-1 (-> obj draw art-group data 8)) + (set! s5-1 (-> this draw art-group data 8)) ) (else - (set! s5-1 (-> obj draw art-group data 7)) + (set! s5-1 (-> this draw art-group data 7)) ) ) ) ) ) - (let ((v1-33 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-33 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond ((and v1-33 (= v1-33 s5-1)) - (let ((a0-11 (-> obj skel root-channel 0))) + (let ((a0-11 (-> this skel root-channel 0))) (set! (-> a0-11 param 0) 1.0) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) ) @@ -469,8 +469,8 @@ (else (let ((f30-2 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) (ja-channel-push! 1 (seconds 0.5)) - (set! (-> obj skel root-channel 0 frame-group) (the-as art-joint-anim s5-1)) - (let ((gp-1 (-> obj skel root-channel 0))) + (set! (-> this skel root-channel 0 frame-group) (the-as art-joint-anim s5-1)) + (let ((gp-1 (-> this skel root-channel 0))) (set! (-> gp-1 num-func) num-func-identity) (set! (-> gp-1 frame-num) (* f30-2 (the float (ja-num-frames 0)))) ) @@ -482,12 +482,12 @@ (none) ) -(defmethod nav-enemy-method-142 ginsu ((obj ginsu) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ginsu ((this ginsu) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (let ((a0-2 (handle->process (-> obj focus handle)))) + (let ((a0-2 (handle->process (-> this focus handle)))) (cond (a0-2 - (vector-! s3-0 (get-trans (the-as process-focusable a0-2) 0) (-> obj root trans)) + (vector-! s3-0 (get-trans (the-as process-focusable a0-2) 0) (-> this root trans)) ) (else (let ((a0-7 (-> arg0 state))) @@ -499,7 +499,7 @@ (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (let ((s5-3 (new 'stack-no-clear 'quaternion)) - (s4-0 (-> obj root quat)) + (s4-0 (-> this root quat)) ) (quaternion-set! s5-3 0.0 (sqrtf (* 0.5 (- 1.0 (-> s3-0 z)))) 0.0 (sqrtf (* 0.5 (+ 1.0 (-> s3-0 z))))) (if (< (-> s3-0 x) 0.0) @@ -509,7 +509,7 @@ s4-0 s4-0 s5-3 - (* (fmax 0.5 (* 0.00024414062 (-> obj nav state speed))) (seconds-per-frame)) + (* (fmax 0.5 (* 0.00024414062 (-> this nav state speed))) (seconds-per-frame)) ) ) ) @@ -518,7 +518,7 @@ ) ;; WARN: disable def twice: 11. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler ginsu ((obj ginsu) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ginsu ((this ginsu) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v0-1 object)) @@ -528,15 +528,15 @@ (when (if (type? s5-0 ginsu) s5-0 ) - (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8)))) - (let ((a0-5 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8)))) + (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8)))) + (let ((a0-5 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8)))) (vector+! s5-1 s5-1 a0-5) ) (vector-float*! s5-1 s5-1 0.5) - (spawn (-> obj part) s5-1) + (spawn (-> this part) s5-1) ) (set! v0-1 (+ (current-time) (seconds 0.125))) - (set! (-> obj grind-timer) (the-as time-frame v0-1)) + (set! (-> this grind-timer) (the-as time-frame v0-1)) v0-1 ) ) @@ -544,7 +544,7 @@ (('touch 'bonk 'attack) (cond ((or (!= arg0 *target*) (focus-test? *target* dark)) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else (send-event arg0 'attack #f (static-attack-info ((id (new-attack-id))))) @@ -554,11 +554,11 @@ ) (('trigger) (set! v0-1 #t) - (set! (-> obj ambush-started) (the-as symbol v0-1)) + (set! (-> this ambush-started) (the-as symbol v0-1)) v0-1 ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -598,8 +598,8 @@ (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) ) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag enemy-flag41)))) - (set! (-> self starting-time) (current-time)) - (set! (-> self spiral-time) (current-time)) + (set-time! (-> self starting-time)) + (set-time! (-> self spiral-time)) (set! (-> self desired-distance) (vector-length (ginsu-method-181 self (new 'stack-no-clear 'vector)))) ) :trans (behavior () @@ -669,7 +669,7 @@ (set! (-> v1-4 target-speed) 8192.0) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! ginsu-idle-ja :num! min) ) @@ -693,7 +693,7 @@ (if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (go-virtual circling) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.75)) + (if (time-elapsed? (-> self state-time) (seconds 0.75)) (go-virtual attack) ) (ja :num! (loop!)) @@ -739,7 +739,7 @@ (set! (-> v1-10 target-speed) 49152.0) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (ja :group! ginsu-attack-ja :num! min) ) :exit (behavior () @@ -880,20 +880,20 @@ ) ) -(defmethod go-hostile ginsu ((obj ginsu)) +(defmethod go-hostile ginsu ((this ginsu)) (cond - ((or (and (-> obj enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> obj enemy-flags))) - (nav-enemy-method-163 obj) + ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) + (nav-enemy-method-163 this) ) - (go-stare2 obj) + (go-stare2 this) ) (else (let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-9 (the-as number (logior (the-as int #x3f800000) v1-8))) ) - (if (and (< (+ -1.0 (the-as float v1-9)) 0.1) (logtest? (-> obj draw status) (draw-control-status on-screen))) - (go (method-of-object obj anticipate-attack)) - (go (method-of-object obj hostile)) + (if (and (< (+ -1.0 (the-as float v1-9)) 0.1) (logtest? (-> this draw status) (draw-control-status on-screen))) + (go (method-of-object this anticipate-attack)) + (go (method-of-object this hostile)) ) ) ) @@ -901,46 +901,46 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ginsu ((obj ginsu)) - (if (not (logtest? (-> obj ambush-path flags) (path-control-flag not-found))) - (go (method-of-object obj ambush)) - (go (method-of-object obj idle)) +(defmethod go-idle ginsu ((this ginsu)) + (if (not (logtest? (-> this ambush-path flags) (path-control-flag not-found))) + (go (method-of-object this ambush)) + (go (method-of-object this idle)) ) (none) ) -(defmethod deactivate ginsu ((obj ginsu)) - (when (nonzero? (-> obj blade-part)) - (let ((a0-1 (-> obj blade-part))) +(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 (-> obj blade-sound-playing) - (sound-stop (-> obj blade-sound)) + (if (-> this blade-sound-playing) + (sound-stop (-> this blade-sound)) ) - (if (-> obj grind-sound-playing) - (sound-stop (-> obj grind-sound)) + (if (-> this grind-sound-playing) + (sound-stop (-> this grind-sound)) ) - ((method-of-type nav-enemy deactivate) obj) + ((method-of-type nav-enemy deactivate) this) (none) ) ;; WARN: Return type mismatch nav-enemy vs ginsu. -(defmethod relocate ginsu ((obj ginsu) (arg0 int)) - (if (nonzero? (-> obj blade-jm)) - (&+! (-> obj blade-jm) arg0) +(defmethod relocate ginsu ((this ginsu) (arg0 int)) + (if (nonzero? (-> this blade-jm)) + (&+! (-> this blade-jm) arg0) ) - (if (nonzero? (-> obj blade-part)) - (&+! (-> obj blade-part) arg0) + (if (nonzero? (-> this blade-part)) + (&+! (-> this blade-part) arg0) ) - (if (nonzero? (-> obj ambush-path)) - (&+! (-> obj ambush-path) arg0) + (if (nonzero? (-> this ambush-path)) + (&+! (-> this ambush-path) arg0) ) - (the-as ginsu ((method-of-type nav-enemy relocate) obj arg0)) + (the-as ginsu ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod ginsu-method-183 ginsu ((obj ginsu) (arg0 symbol)) - (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) +(defmethod ginsu-method-183 ginsu ((this ginsu) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 (set! (-> v1-3 prim-core collide-as) (collide-spec enemy)) @@ -956,11 +956,11 @@ (none) ) -(defmethod enemy-method-46 ginsu ((obj ginsu) (arg0 int)) +(defmethod enemy-method-46 ginsu ((this ginsu) (arg0 int)) "@abstract" (case arg0 ((1) - (let ((v1-2 (-> obj root root-prim))) + (let ((v1-2 (-> this root root-prim))) (logior! (-> v1-2 prim-core action) (collide-action solid)) (let ((v1-4 (-> (the-as collide-shape-prim-group v1-2) child 0))) (logior! (-> v1-4 prim-core action) (collide-action solid)) @@ -972,9 +972,9 @@ (none) ) -(defmethod init-enemy-collision! ginsu ((obj ginsu)) +(defmethod init-enemy-collision! ginsu ((this ginsu)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1032,53 +1032,53 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! ginsu ((obj ginsu)) +(defmethod init-enemy! ginsu ((this ginsu)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ginsu" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *ginsu-nav-enemy-info*) - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) - (logclear! (-> obj nav flags) (nav-control-flag limit-rotation-rate)) - (let ((v1-14 (-> obj neck))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *ginsu-nav-enemy-info*) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43)))) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate)) + (let ((v1-14 (-> this neck))) (set! (-> v1-14 up) (the-as uint 1)) (set! (-> v1-14 nose) (the-as uint 2)) (set! (-> v1-14 ear) (the-as uint 0)) (set-vector! (-> v1-14 twist-max) 10922.667 7281.778 0.0 1.0) (set! (-> v1-14 ignore-angle) 18204.445) ) - (let ((v1-16 (-> obj nav))) + (let ((v1-16 (-> this nav))) (set! (-> v1-16 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (ginsu-method-183 obj #f) - (set! (-> obj blade-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 8)) - (init (-> obj blade-speed) 1.0 0.01 0.1 0.9) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 475) obj)) - (set! (-> obj blade-part) (create-launch-control (-> *part-group-id-table* 476) obj)) - (set! (-> obj ambush-path) (new 'process 'curve-control obj 'intro -1000000000.0)) - (set! (-> obj ambush-started) #f) - (set! (-> obj path-pos) 0.0) - (if (not (logtest? (-> obj ambush-path flags) (path-control-flag not-found))) - (logior! (-> obj ambush-path flags) (path-control-flag display draw-line draw-point draw-text)) + (set-gravity-length (-> this root dynam) 573440.0) + (ginsu-method-183 this #f) + (set! (-> this blade-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 8)) + (init (-> this blade-speed) 1.0 0.01 0.1 0.9) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 475) this)) + (set! (-> this blade-part) (create-launch-control (-> *part-group-id-table* 476) this)) + (set! (-> this ambush-path) (new 'process 'curve-control this 'intro -1000000000.0)) + (set! (-> this ambush-started) #f) + (set! (-> this path-pos) 0.0) + (if (not (logtest? (-> this ambush-path flags) (path-control-flag not-found))) + (logior! (-> this ambush-path flags) (path-control-flag display draw-line draw-point draw-text)) ) - (set! (-> obj blade-sound) (new-sound-id)) - (set! (-> obj blade-sound-playing) #f) - (set! (-> obj grind-sound) (new-sound-id)) - (set! (-> obj grind-sound-playing) #f) - (set! (-> obj grind-timer) 0) + (set! (-> this blade-sound) (new-sound-id)) + (set! (-> this blade-sound-playing) #f) + (set! (-> this grind-sound) (new-sound-id)) + (set! (-> this grind-sound-playing) #f) + (set! (-> this grind-timer) 0) 0 (none) ) diff --git a/goal_src/jak2/levels/forest/fish.gc b/goal_src/jak2/levels/forest/fish.gc index 97b7bd3328..32ef4ea575 100644 --- a/goal_src/jak2/levels/forest/fish.gc +++ b/goal_src/jak2/levels/forest/fish.gc @@ -459,14 +459,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fish-manager ((obj fish-manager) (arg0 entity-actor)) +(defmethod init-from-entity! fish-manager ((this fish-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -482,15 +482,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-8 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-8 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (get-nav-control obj (the-as nav-mesh #f)) + (process-drawable-from-entity! this arg0) + (get-nav-control this (the-as nav-mesh #f)) (let ((s5-1 (rand-vu-int-count 4))) (dotimes (s4-1 12) - (let ((s3-0 (-> obj fishes s4-1))) + (let ((s3-0 (-> this fishes s4-1))) (let ((f30-1 (* 182.04445 (the float (rand-vu-int-count 360))))) - (set! (-> s3-0 pos quad) (-> obj root trans quad)) + (set! (-> s3-0 pos quad) (-> this root trans quad)) (+! (-> s3-0 pos x) (rand-vu-float-range 409.6 4096.0)) (+! (-> s3-0 pos z) (rand-vu-float-range 409.6 4096.0)) (set! (-> s3-0 wander) (rand-vu-float-range 0.0 65536.0)) @@ -499,10 +499,10 @@ This commonly includes things such as: (set! (-> s3-0 border-f quad) (the-as uint128 0)) (set! (-> s3-0 avoid-d quad) (the-as uint128 0)) (set! (-> s3-0 max-speed) 16384.0) - (set! (-> s3-0 handle) (ppointer->handle (process-spawn minnow obj s5-1 :to obj))) + (set! (-> s3-0 handle) (ppointer->handle (process-spawn minnow this s5-1 :to this))) ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/forest/forest-obs.gc b/goal_src/jak2/levels/forest/forest-obs.gc index 79c290ce1f..b2d9b37fd8 100644 --- a/goal_src/jak2/levels/forest/forest-obs.gc +++ b/goal_src/jak2/levels/forest/forest-obs.gc @@ -28,21 +28,21 @@ ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! forest-hover-manager ((obj forest-hover-manager) (arg0 entity-actor)) +(defmethod init-from-entity! forest-hover-manager ((this forest-hover-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj entity) arg0) - (hover-enemy-manager-init! obj *forest-protect-battle*) - (set! (-> obj transport-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj transport-actor 1) (entity-actor-lookup arg0 'alt-actor 1)) + (set! (-> this entity) arg0) + (hover-enemy-manager-init! this *forest-protect-battle*) + (set! (-> this transport-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this transport-actor 1) (entity-actor-lookup arg0 'alt-actor 1)) (let ((t9-3 (method-of-type hover-formation-control new)) (a0-4 'process) (a1-4 hover-formation-control) - (a2-2 obj) + (a2-2 this) (t0-0 122880.0) (t1-0 (new 'stack-no-clear 'vector)) ) @@ -50,10 +50,10 @@ This commonly includes things such as: (set! (-> t1-0 y) 24576.0) (set! (-> t1-0 z) 61440.0) (set! (-> t1-0 w) 1.0) - (set! (-> obj formation) (t9-3 a0-4 a1-4 a2-2 arg0 t0-0 t1-0 5461.3335 (the-as handle #f))) + (set! (-> this formation) (t9-3 a0-4 a1-4 a2-2 arg0 t0-0 t1-0 5461.3335 (the-as handle #f))) ) - (logior! (-> obj formation flags) 4) - (go (method-of-object obj spawning)) + (logior! (-> this formation flags) 4) + (go (method-of-object this spawning)) (none) ) @@ -349,7 +349,7 @@ This commonly includes things such as: ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 2)) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) @@ -390,24 +390,24 @@ This commonly includes things such as: (-> arg0 status) ) -(defmethod deactivate forest-youngsamos ((obj forest-youngsamos)) - (if (valid? (-> obj hud) (the-as type #f) "" #t 0) - (send-event (handle->process (-> obj hud)) 'hide-and-die) +(defmethod deactivate forest-youngsamos ((this forest-youngsamos)) + (if (valid? (-> this hud) (the-as type #f) "" #t 0) + (send-event (handle->process (-> this hud)) 'hide-and-die) ) - (sound-stop (-> obj sound-id)) - ((the-as (function process-focusable none) (find-parent-method forest-youngsamos 10)) obj) + (sound-stop (-> this sound-id)) + ((the-as (function process-focusable none) (find-parent-method forest-youngsamos 10)) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! forest-youngsamos ((obj forest-youngsamos) (arg0 entity-actor)) +(defmethod init-from-entity! forest-youngsamos ((this forest-youngsamos) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) forest-youngsamos-bounce-reaction) (set! (-> s4-0 no-reaction) @@ -446,29 +446,29 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj entity) arg0) - (process-drawable-from-entity! obj (-> obj entity)) + (set! (-> this entity) arg0) + (process-drawable-from-entity! this (-> this entity)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-forest-youngsamos" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj desired-pos quad) (-> obj root trans quad)) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (+! (-> obj desired-pos y) 8192.0) - (vector-reset! (-> obj hit-dir)) - (set! (-> obj hit-points) 9.0) - (set! (-> obj incoming-attack-id) (the-as uint -1)) - (vector-reset! (-> obj root transv)) - (set! (-> obj focus-disable-timer) (the-as uint 0)) - (set! (-> obj hud) (ppointer->handle (process-spawn hud-samos-young :init hud-init-by-other :to obj))) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 494) obj)) - (go (method-of-object obj idle)) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this desired-pos quad) (-> this root trans quad)) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (+! (-> this desired-pos y) 8192.0) + (vector-reset! (-> this hit-dir)) + (set! (-> this hit-points) 9.0) + (set! (-> this incoming-attack-id) (the-as uint -1)) + (vector-reset! (-> this root transv)) + (set! (-> this focus-disable-timer) (the-as uint 0)) + (set! (-> this hud) (ppointer->handle (process-spawn hud-samos-young :init hud-init-by-other :to this))) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 494) this)) + (go (method-of-object this idle)) (none) ) @@ -604,9 +604,9 @@ This commonly includes things such as: TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.5)) + (until (time-elapsed? gp-0 (seconds 0.5)) (suspend) ) ) @@ -679,7 +679,7 @@ This commonly includes things such as: ) ) (let ((s3-0 (current-time))) - (until (>= (- (current-time) s3-0) (seconds 15)) + (until (time-elapsed? s3-0 (seconds 15)) (suspend) ) ) @@ -717,7 +717,7 @@ This commonly includes things such as: ) (dotimes (s3-1 3) (let ((s2-0 (current-time))) - (until (>= (- (current-time) s2-0) (seconds 10)) + (until (time-elapsed? s2-0 (seconds 10)) (suspend) ) ) @@ -754,7 +754,7 @@ This commonly includes things such as: ) ) (let ((s2-1 (current-time))) - (until (>= (- (current-time) s2-1) (seconds 10)) + (until (time-elapsed? s2-1 (seconds 10)) (suspend) ) ) @@ -792,7 +792,7 @@ This commonly includes things such as: ) ) (let ((s3-2 (current-time))) - (until (>= (- (current-time) s3-2) (seconds 10)) + (until (time-elapsed? s3-2 (seconds 10)) (suspend) ) ) @@ -829,7 +829,7 @@ This commonly includes things such as: ) ) (let ((s3-3 (current-time))) - (until (>= (- (current-time) s3-3) (seconds 10)) + (until (time-elapsed? s3-3 (seconds 10)) (suspend) ) ) @@ -843,7 +843,7 @@ This commonly includes things such as: ) ) (let ((s2-2 (current-time))) - (until (>= (- (current-time) s2-2) (seconds 1)) + (until (time-elapsed? s2-2 (seconds 1)) (suspend) ) ) @@ -922,14 +922,14 @@ This commonly includes things such as: ) ) (let ((s3-5 (current-time))) - (until (>= (- (current-time) s3-5) (seconds 1)) + (until (time-elapsed? s3-5 (seconds 1)) (suspend) ) ) ) ) (let ((s4-1 (current-time))) - (until (>= (- (current-time) s4-1) (seconds 0.5)) + (until (time-elapsed? s4-1 (seconds 0.5)) (suspend) ) ) @@ -937,7 +937,7 @@ This commonly includes things such as: (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) (let ((s4-2 (current-time))) - (until (>= (- (current-time) s4-2) (seconds 0.5)) + (until (time-elapsed? s4-2 (seconds 0.5)) (suspend) ) ) @@ -948,7 +948,7 @@ This commonly includes things such as: 'leave ) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) (seconds 0.2)) + (until (time-elapsed? s5-1 (seconds 0.2)) (suspend) ) ) @@ -960,7 +960,7 @@ This commonly includes things such as: ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 3)) + (until (time-elapsed? gp-2 (seconds 3)) (suspend) ) ) @@ -968,7 +968,7 @@ This commonly includes things such as: (remove-setting! 'process-mask) (process-release? *target*) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 3)) + (until (time-elapsed? gp-3 (seconds 3)) (suspend) ) ) diff --git a/goal_src/jak2/levels/forest/pegasus.gc b/goal_src/jak2/levels/forest/pegasus.gc index 05043399a1..305bd99470 100644 --- a/goal_src/jak2/levels/forest/pegasus.gc +++ b/goal_src/jak2/levels/forest/pegasus.gc @@ -153,35 +153,35 @@ (set! (-> *pegasus-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod run-logic? pegasus ((obj pegasus)) +(defmethod run-logic? pegasus ((this pegasus)) "Calls [[process-tree::12]] if we are considered in-range of the [[pegasus]], otherwise returns [[#t]]" (let ((min-distance 491520.0)) - (if (< (* min-distance min-distance) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) - ((method-of-type enemy run-logic?) obj) + (if (< (* min-distance min-distance) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + ((method-of-type enemy run-logic?) this) #t ) ) ) -(defmethod track-how-long-aimed-at! pegasus ((obj pegasus)) +(defmethod track-how-long-aimed-at! pegasus ((this pegasus)) "Updates `targetted-timer` with the `frame-counter` while Jak is aiming at the [[pegasus]]" (let ((target *target*)) (when (and target (-> target gun active?)) (let ((inaccuracy-dir (new 'stack-no-clear 'vector)) (inaccuracy-vec (new 'stack-no-clear 'vector)) ) - (vector-! inaccuracy-dir (-> obj root trans) (-> target gun fire-point)) + (vector-! inaccuracy-dir (-> this root trans) (-> target gun fire-point)) (vector+float*! inaccuracy-vec (-> target gun fire-point) (-> target gun fire-dir-out) (vector-length inaccuracy-dir) ) - (let ((inaccuracy-mag (vector-vector-distance-squared inaccuracy-vec (-> obj root trans))) + (let ((inaccuracy-mag (vector-vector-distance-squared inaccuracy-vec (-> this root trans))) (threshold 20480.0) ) (if (< inaccuracy-mag (* threshold threshold)) - (set! (-> obj targetted-timer) (current-time)) + (set-time! (-> this targetted-timer)) ) ) ) @@ -192,18 +192,18 @@ ) ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! pegasus ((obj pegasus) (proc process-focusable) (focus enemy-best-focus)) +(defmethod update-target-awareness! pegasus ((this pegasus) (proc process-focusable) (focus enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targetted for more than 5 [[seconds]] @returns the value from [[enemy::57]], otherwise [[enemy-aware::4]]" - (the-as enemy-aware (if (>= (- (current-time) (-> obj targetted-timer)) (seconds 5)) - (the-as int ((method-of-type enemy update-target-awareness!) obj proc focus)) + (the-as enemy-aware (if (time-elapsed? (-> this targetted-timer) (seconds 5)) + (the-as int ((method-of-type enemy update-target-awareness!) this proc focus)) 4 ) ) ) -(defmethod general-event-handler pegasus ((obj pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler pegasus ((this pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case event-type @@ -212,37 +212,37 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett ) (('hit 'hit-knocked) (cond - ((zero? (-> obj hit-points)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + ((zero? (-> this hit-points)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action proc) (send-event proc 'get-attack-count 1) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) (else (let ((v0-0 (the-as object (current-time)))) - (set! (-> obj targetted-timer) (the-as time-frame v0-0)) + (set! (-> this targetted-timer) (the-as time-frame v0-0)) v0-0 ) ) ) ) (else - ((method-of-type enemy general-event-handler) obj proc arg2 event-type event) + ((method-of-type enemy general-event-handler) this proc arg2 event-type event) ) ) ) -(defmethod damage-amount-from-attack pegasus ((obj pegasus) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack pegasus ((this pegasus) (arg0 process) (arg1 event-message-block)) "Only attacks from the jetboard will deal max damage (6), but by default it will return `1`. This is why the scouts are technically killable by other means @returns the amount of damage taken from an attack. Also updates the `targetted-timer`. @@ -252,12 +252,12 @@ This is why the scouts are technically killable by other means (case (-> arg1 message) (('attack) (if (and (logtest? (-> attack-info mask) (attack-mask mode)) (= (-> attack-info mode) 'board)) - (set! hitpoints (-> obj hit-points)) + (set! hitpoints (-> this hit-points)) ) ) ) ) - (set! (-> obj targetted-timer) (current-time)) + (set-time! (-> this targetted-timer)) hitpoints ) ) @@ -634,7 +634,7 @@ This function also is what causes the pegasus to flip around (interpolant (- 1.0 (fmax 0.0 (fmin 1.0 dist-from-target)))) (interpolated-speed (lerp min-speed max-speed interpolant)) ) - (if (< (- (current-time) (-> self targetted-timer)) (seconds 5)) + (if (not (time-elapsed? (-> self targetted-timer) (seconds 5))) (set! interpolated-speed (fmax 163840.0 interpolated-speed)) ) (let ((movement-speed (* 0.0033333334 interpolated-speed))) @@ -695,18 +695,18 @@ The faster it's moving the fast it flaps it's wings, etc ) ) -(defmethod track-target! pegasus ((obj pegasus)) +(defmethod track-target! pegasus ((this pegasus)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (track-how-long-aimed-at! obj) + (track-how-long-aimed-at! this) (pegasus-show-runs) - ((method-of-type enemy track-target!) obj) + ((method-of-type enemy track-target!) this) (none) ) -(defmethod enemy-method-99 pegasus ((obj pegasus) (arg0 process-focusable)) +(defmethod enemy-method-99 pegasus ((this pegasus) (arg0 process-focusable)) #t ) @@ -791,7 +791,7 @@ The faster it's moving the fast it flaps it's wings, etc (defstate stare (pegasus) :virtual #t :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((awareness (-> self focus aware))) (cond ((and (>= 1 (the-as int awareness)) @@ -998,8 +998,8 @@ The faster it's moving the fast it flaps it's wings, etc (func) ) ) - (set! (-> self state-time) (current-time)) - (set! (-> self far-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self far-time)) (set-setting! 'sound-mode #f 0.0 1) ) :exit (behavior () @@ -1030,7 +1030,7 @@ The faster it's moving the fast it flaps it's wings, etc ) ) ) - (set! (-> self far-time) (current-time)) + (set-time! (-> self far-time)) ) :code (behavior () (until #f @@ -1052,7 +1052,7 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (set! (-> self near-timer) 3000) - (set! (-> self far-time) (current-time)) + (set-time! (-> self far-time)) (set-setting! 'sound-mode #f 0.0 1) ) :exit (behavior () @@ -1083,9 +1083,9 @@ The faster it's moving the fast it flaps it's wings, etc (if (<= (-> self near-timer) 0) (go pegasus-tired) ) - (set! (-> self far-time) (current-time)) + (set-time! (-> self far-time)) ) - (if (>= (- (current-time) (-> self far-time)) (seconds 3)) + (if (time-elapsed? (-> self far-time) (seconds 3)) (set! (-> self near-timer) (the-as int (-> self timeout))) ) ) @@ -1195,10 +1195,11 @@ The faster it's moving the fast it flaps it's wings, etc ) ) -(defmethod init-enemy-collision! pegasus ((obj pegasus)) +(defmethod init-enemy-collision! pegasus ((this pegasus)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (stack-size-set! (-> obj main-thread) 512) ;; added - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + ;; og:preserve-this added + (stack-size-set! (-> this main-thread) 512) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -1243,112 +1244,112 @@ The faster it's moving the fast it flaps it's wings, etc (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) 0 (none) ) -(defmethod coin-flip? pegasus ((obj pegasus)) +(defmethod coin-flip? pegasus ((this pegasus)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod enemy-method-108 pegasus ((obj pegasus) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 pegasus ((this pegasus) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; WARN: Return type mismatch enemy vs pegasus. -(defmethod relocate pegasus ((obj pegasus) (arg0 int)) +(defmethod relocate pegasus ((this pegasus) (arg0 int)) (countdown (v1-0 20) - (if (-> obj path-info v1-0 path-data) - (&+! (-> obj path-info v1-0 path-data) arg0) + (if (-> this path-info v1-0 path-data) + (&+! (-> this path-info v1-0 path-data) arg0) ) ) - (the-as pegasus ((method-of-type enemy relocate) obj arg0)) + (the-as pegasus ((method-of-type enemy relocate) this arg0)) ) -(defmethod init-enemy! pegasus ((obj pegasus)) +(defmethod init-enemy! pegasus ((this pegasus)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (tag res-tag)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pegasus" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *pegasus-enemy-info*) - (logclear! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf00)) - (set! (-> obj link) (new 'process 'actor-link-info obj #f)) + (init-enemy-behaviour-and-stats! this *pegasus-enemy-info*) + (logclear! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf00)) + (set! (-> this link) (new 'process 'actor-link-info this #f)) (dotimes (v1-8 20) - (set! (-> obj path-info v1-8 path-data) #f) + (set! (-> this path-info v1-8 path-data) #f) ) - (set! (-> obj num-paths) 0) - (set! (-> obj path-info 0 path-data) (new 'process 'curve-control obj 'path -1000000000.0)) - (when (-> obj path-info 0 path-data) - (logior! (-> obj path-info 0 path-data flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj num-paths) 1) + (set! (-> this num-paths) 0) + (set! (-> this path-info 0 path-data) (new 'process 'curve-control this 'path -1000000000.0)) + (when (-> this path-info 0 path-data) + (logior! (-> this path-info 0 path-data flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this num-paths) 1) ) (dotimes (path-info-idx 20) - (let ((curve (new 'process 'curve-control obj 'path (the float path-info-idx)))) + (let ((curve (new 'process 'curve-control this 'path (the float path-info-idx)))) (if (logtest? (-> curve flags) (path-control-flag not-found)) (goto cfg-15) ) - (set! (-> obj num-paths) (+ path-info-idx 1)) - (set! (-> obj path-info path-info-idx path-data) curve) + (set! (-> this num-paths) (+ path-info-idx 1)) + (set! (-> this path-info path-info-idx path-data) curve) (logior! (-> curve flags) (path-control-flag display draw-line draw-point)) ) (set! tag (new 'static 'res-tag)) (let ((data - (res-lump-data (-> obj entity) 'path-connection pointer :tag-ptr (& tag) :time (the float path-info-idx)) + (res-lump-data (-> this entity) 'path-connection pointer :tag-ptr (& tag) :time (the float path-info-idx)) ) ) (cond (data - (set! (-> obj path-info path-info-idx num-data) (the-as int (-> tag elt-count))) - (set! (-> obj path-info path-info-idx control-data) (the-as (pointer float) data)) + (set! (-> this path-info path-info-idx num-data) (the-as int (-> tag elt-count))) + (set! (-> this path-info path-info-idx control-data) (the-as (pointer float) data)) ) (else - (set! (-> obj path-info path-info-idx num-data) 0) + (set! (-> this path-info path-info-idx num-data) 0) 0 ) ) ) ) (label cfg-15) - (set! (-> obj current-path) 0) - (set! (-> obj previous-path) 0) - (set! (-> obj display-path) -1) - (set! (-> obj curve-position) (res-lump-float (-> obj entity) 'initial-spline-pos)) + (set! (-> this current-path) 0) + (set! (-> this previous-path) 0) + (set! (-> this display-path) -1) + (set! (-> this curve-position) (res-lump-float (-> this entity) 'initial-spline-pos)) (get-point-at-percent-along-path! - (-> obj path-info (-> obj current-path) path-data) - (-> obj root trans) - (-> obj curve-position) + (-> this path-info (-> this current-path) path-data) + (-> this root trans) + (-> this curve-position) 'interp ) (displacement-between-points-at-percent-normalized! - (-> obj path-info (-> obj current-path) path-data) - (-> obj tangent) - (-> obj curve-position) + (-> this path-info (-> this current-path) path-data) + (-> this tangent) + (-> this curve-position) ) - (set! (-> obj facing quad) (-> obj tangent quad)) + (set! (-> this facing quad) (-> this tangent quad)) (let ((matrix (new 'stack-no-clear 'matrix))) - (forward-down->inv-matrix matrix (-> obj facing) (new 'static 'vector :y -1.0)) - (matrix->quaternion (-> obj root quat) matrix) + (forward-down->inv-matrix matrix (-> this facing) (new 'static 'vector :y -1.0)) + (matrix->quaternion (-> this root quat) matrix) ) - (set! (-> obj y-vel) 0.0) - (set! (-> obj water-height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj timeout) (the-as uint 3000)) - (when (-> obj entity) - (let ((timeout (res-lump-float (-> obj entity) 'timeout :default 10.0))) - (set! (-> obj timeout) (the-as uint (the int (* 300.0 timeout)))) + (set! (-> this y-vel) 0.0) + (set! (-> this water-height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this timeout) (the-as uint 3000)) + (when (-> this entity) + (let ((timeout (res-lump-float (-> this entity) 'timeout :default 10.0))) + (set! (-> this timeout) (the-as uint (the int (* 300.0 timeout)))) ) ) - (set! (-> obj ambient-possible) (the-as uint 0)) - (set! (-> obj speed) 0.0) - (set! (-> obj y-offset-desired) 0.0) + (set! (-> this ambient-possible) (the-as uint 0)) + (set! (-> this speed) 0.0) + (set! (-> this y-offset-desired) 0.0) (pegasus-move 409600.0 #t) (pegasus-calc-speed 61440.0 122880.0 2048.0 2048.0) - (set! (-> obj can-run) #f) + (set! (-> this can-run) #f) 0 (none) ) @@ -1386,7 +1387,7 @@ The faster it's moving the fast it flaps it's wings, etc (lambda :behavior task-manager () (local-vars (data int)) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-pegasus :init hud-init-by-other :to self))) (while (> (-> self data-int32 0) 0) (set! data (-> self data-int32 1)) diff --git a/goal_src/jak2/levels/forest/predator.gc b/goal_src/jak2/levels/forest/predator.gc index 04ddceab38..4558721448 100644 --- a/goal_src/jak2/levels/forest/predator.gc +++ b/goal_src/jak2/levels/forest/predator.gc @@ -7,78 +7,78 @@ ;; DECOMP BEGINS -(defmethod draw hud-predator ((obj hud-predator)) - (set-hud-piece-position! (-> obj sprites 1) (the int (+ 480.0 (* 130.0 (-> obj offset)))) 205) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -44 0) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites 1)) -45 45) - ((method-of-type hud draw) obj) +(defmethod draw hud-predator ((this hud-predator)) + (set-hud-piece-position! (-> this sprites 1) (the int (+ 480.0 (* 130.0 (-> this offset)))) 205) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -44 0) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites 1)) -45 45) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-predator ((obj hud-predator)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-predator ((this hud-predator)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-predator ((obj hud-predator)) - (set! (-> obj level) (level-get *level* 'forest)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-predator ((this hud-predator)) + (set! (-> this level) (level-get *level* 'forest)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xb1d))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.6) - (set! (-> obj sprites 0 scale-y) 0.6) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1d))) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 1 scale-x) 0.6) - (set! (-> obj sprites 1 scale-y) 0.6) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xb1d))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.6) + (set! (-> this sprites 0 scale-y) 0.6) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1d))) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 1 scale-x) 0.6) + (set! (-> this sprites 1 scale-y) 0.6) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) -(defmethod draw hud-pegasus ((obj hud-pegasus)) +(defmethod draw hud-pegasus ((this hud-pegasus)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 472.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 472.0 (* 130.0 (-> this offset)))) 190 ) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -26 35) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -26 35) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-pegasus ((obj hud-pegasus)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-pegasus ((this hud-pegasus)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-pegasus ((obj hud-pegasus)) - (set! (-> obj level) (level-get *level* 'forest)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-pegasus ((this hud-pegasus)) + (set! (-> this level) (level-get *level* 'forest)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xb1d))) - (set! (-> obj sprites 0 scale-x) 0.8) - (set! (-> obj sprites 0 scale-y) 0.8) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xb1d))) + (set! (-> this sprites 0 scale-x) 0.8) + (set! (-> this sprites 0 scale-y) 0.8) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -109,27 +109,27 @@ ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound predator-shot ((obj predator-shot) (arg0 projectile-options)) +(defmethod play-impact-sound predator-shot ((this predator-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "pred-shot-hit") ) (((projectile-options lose-altitude proj-options-2)) - (let ((f0-0 (doppler-pitch-shift (-> obj root trans) (-> obj root transv))) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) (a0-7 (static-sound-spec "pred-shot-loop" :volume 0.0 :mask (pitch reg0))) ) (set! (-> a0-7 volume) 1024) (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) - (sound-play-by-spec a0-7 (-> obj sound-id) (-> obj root trans)) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) ) ) ) (none) ) -(defmethod init-proj-collision! predator-shot ((obj predator-shot)) +(defmethod init-proj-collision! predator-shot ((this predator-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -171,24 +171,24 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) ) -(defmethod init-proj-settings! predator-shot ((obj predator-shot)) +(defmethod init-proj-settings! predator-shot ((this predator-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'predator-shot) - (set! (-> obj max-speed) 532480.0) - (set! (-> obj move) metalhead-shot-move) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj timeout) (seconds 0.767)) - (set! (-> obj sound-id) (new-sound-id)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'predator-shot) + (set! (-> this max-speed) 532480.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.767)) + (set! (-> this sound-id) (new-sound-id)) + (set-gravity-length (-> this root dynam) 573440.0) (none) ) @@ -409,85 +409,85 @@ (set! (-> *predator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler predator ((obj predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler predator ((this predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) - (set! (-> obj shock-effect-end) (the-as uint (+ (current-time) (seconds 1)))) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (set! (-> this shock-effect-end) (the-as uint (+ (current-time) (seconds 1)))) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('death-end) - (when (nonzero? (-> obj ambient-sound-id)) - (sound-stop (-> obj ambient-sound-id)) - (set! (-> obj ambient-sound-id) (new 'static 'sound-id)) + (when (nonzero? (-> this ambient-sound-id)) + (sound-stop (-> this ambient-sound-id)) + (set! (-> this ambient-sound-id) (new 'static 'sound-id)) 0 ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod enemy-method-77 predator ((obj predator) (arg0 (pointer float))) +(defmethod enemy-method-77 predator ((this predator) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + ((zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 14))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 14)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 14)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!) ) ) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((v1-32 (get-rand-int obj 2))) + (let ((v1-32 (get-rand-int this 2))) (cond ((zero? v1-32) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 21)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) (-> arg0 0)) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) ) ) ((= v1-32 1) - (let ((a0-12 (-> obj skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-12 param 1) (-> arg0 0)) (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) ) ) @@ -495,26 +495,26 @@ ) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-15 (-> obj skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-15 param 1) (-> arg0 0)) (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-17 (-> obj skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (let ((a0-17 (-> this skel root-channel 0))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) ) (set! (-> a0-17 param 1) (-> arg0 0)) (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) ) ) ) @@ -523,73 +523,73 @@ ) ) -(defmethod enemy-method-78 predator ((obj predator) (arg0 (pointer float))) +(defmethod enemy-method-78 predator ((this predator) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + ((zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 15))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 15)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 15)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) ) ) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) (-> arg0 0)) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) ) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-11 (-> obj skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19))) + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) ) (set! (-> a0-11 param 1) (-> arg0 0)) (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-13 (-> obj skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 13))) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 13)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) ) (set! (-> a0-13 param 1) (-> arg0 0)) (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 13)) num-func-seek!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) ) ) ) @@ -599,7 +599,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod predator-method-188 predator ((obj predator) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod predator-method-188 predator ((this predator) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f0-0 1228.8) (f30-0 6144.0) @@ -609,8 +609,8 @@ (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) (set! (-> v1-4 collide-with) (collide-spec backgnd)) - (set! (-> v1-4 ignore-process0) obj) - (set! (-> v1-4 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) ) @@ -639,8 +639,8 @@ (let ((v1-14 s5-0)) (set! (-> v1-14 radius) f30-0) (set! (-> v1-14 collide-with) (collide-spec enemy hit-by-player-list hit-by-others-list)) - (set! (-> v1-14 ignore-process0) obj) - (set! (-> v1-14 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-14 ignore-process0) this) + (set! (-> v1-14 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-14 action-mask) (collide-action solid)) ) @@ -669,7 +669,7 @@ (none) ) -(defmethod predator-method-184 predator ((obj predator) (arg0 int) (arg1 float)) +(defmethod predator-method-184 predator ((this predator) (arg0 int) (arg1 float)) (local-vars (sv-224 vector) (sv-240 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -679,15 +679,15 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((a1-1 (-> obj node-list data arg0)) + (let ((a1-1 (-> this node-list data arg0)) (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options)) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (let* ((v1-10 *game-info*) (a0-11 (+ (-> v1-10 attack-id) 1)) ) @@ -696,11 +696,11 @@ ) (set! (-> s5-0 timeout) (seconds 4)) (vector<-cspace! (-> s5-0 pos) a1-1) - (let ((s2-0 (handle->process (-> obj focus handle))) + (let ((s2-0 (handle->process (-> this focus handle))) (s3-0 (new 'stack-no-clear 'vector)) ) (when s2-0 - (seek! (-> obj miss-amount) (* 0.5 (vector-length (-> (the-as process-focusable s2-0) root transv))) 4096.0) + (seek! (-> this miss-amount) (* 0.5 (vector-length (-> (the-as process-focusable s2-0) root transv))) 4096.0) (set! (-> s3-0 quad) (-> (get-trans (the-as process-focusable s2-0) 3) quad)) (set! sv-224 (new 'stack-no-clear 'vector)) (let ((v1-24 (-> s5-0 pos)) @@ -739,19 +739,19 @@ (vector-normalize! sv-240 1.0) (vector-cross! s0-0 sv-224 sv-240) (vector-normalize! s0-0 1.0) - (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-224 (-> obj shoot-angle)))) + (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-224 (-> this shoot-angle)))) (vector-orient-by-quat! sv-240 sv-240 a2-5) ) (let* ((t9-9 quaternion-vector-angle!) (a0-27 (new 'stack-no-clear 'quaternion)) - (a2-6 (-> obj shoot-angle)) + (a2-6 (-> this shoot-angle)) (a2-7 (t9-9 a0-27 sv-224 a2-6)) ) (vector-orient-by-quat! s0-0 s0-0 a2-7) ) (let ((a0-29 s1-1)) (let ((v1-32 s3-0)) - (let ((a1-17 (-> obj miss-amount))) + (let ((a1-17 (-> this miss-amount))) (.mov vf7 a1-17) ) (.lvf vf5 (&-> sv-240 quad)) @@ -763,7 +763,7 @@ (.svf (&-> a0-29 quad) vf6) ) (let ((v1-33 s3-0)) - (let ((a0-30 (* arg1 (-> obj miss-amount)))) + (let ((a0-30 (* arg1 (-> this miss-amount)))) (.mov vf7 a0-30) ) (.lvf vf5 (&-> s0-0 quad)) @@ -778,7 +778,7 @@ (vector-! (-> s5-0 vel) s3-0 (-> s5-0 pos)) (vector-normalize! (-> s5-0 vel) 409600.0) (vector-normalize! (-> s5-0 vel) 532480.0) - (spawn-projectile predator-shot s5-0 obj *default-dead-pool*) + (spawn-projectile predator-shot s5-0 this *default-dead-pool*) ) ) ) @@ -808,48 +808,48 @@ ) ) -(defmethod predator-method-183 predator ((obj predator)) +(defmethod predator-method-183 predator ((this predator)) (cond - ((< (-> obj hit-points) 2) - (when (!= (-> obj dest-fade) 128.0) + ((< (-> this hit-points) 2) + (when (!= (-> this dest-fade) 128.0) (sound-play "pred-uncloak") - (stop! (-> obj sound)) - (set! (-> obj sound) (the-as ambient-sound 0)) + (stop! (-> this sound)) + (set! (-> this sound) (the-as ambient-sound 0)) 0 ) - (set! (-> obj dest-fade) 128.0) + (set! (-> this dest-fade) 128.0) ) (else - (set! (-> obj dest-fade) 0.0) + (set! (-> this dest-fade) 0.0) ) ) - (seek! (-> obj fade) (-> obj dest-fade) (* 60.0 (seconds-per-frame))) - (set! (-> obj draw force-fade) (the-as uint (the int (-> obj fade)))) + (seek! (-> this fade) (-> this dest-fade) (* 60.0 (seconds-per-frame))) + (set! (-> this draw force-fade) (the-as uint (the int (-> this fade)))) (cond - ((zero? (-> obj draw force-fade)) - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 0 4) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((zero? (-> this draw force-fade)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 0 4) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) - ((= (-> obj draw force-fade) 128) - (setup-masks (-> obj draw) 0 8) - (setup-masks (-> obj draw) 4 0) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((= (-> this draw force-fade) 128) + (setup-masks (-> this draw) 0 8) + (setup-masks (-> this draw) 4 0) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) (else - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 4 0) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 4 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) ) - (if (< 245760.0 (vector-vector-distance (-> obj root trans) (camera-pos))) - (setup-masks (-> obj draw) 0 8) + (if (< 245760.0 (vector-vector-distance (-> this root trans) (camera-pos))) + (setup-masks (-> this draw) 0 8) ) - (when (< (current-time) (the-as time-frame (-> obj shock-effect-end))) - (when (>= (- (current-time) (-> obj shock-effect-time)) (seconds 0.04)) - (set! (-> obj shock-effect-time) (current-time)) + (when (< (current-time) (the-as time-frame (-> this shock-effect-end))) + (when (time-elapsed? (-> this shock-effect-time) (seconds 0.04)) + (set-time! (-> this shock-effect-time)) (process-drawable-shock-skel-effect - obj + this (-> *lightning-spec-id-table* 18) lightning-probe-callback (-> *part-id-table* 166) @@ -1026,7 +1026,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1090,7 +1090,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-4 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-4 enemy-flags))) @@ -1113,7 +1113,7 @@ (if (< (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)) 65536.0) (go-virtual hostile) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) (check-los? (-> self los) 0) (not (logtest? (-> self draw status) (draw-control-status on-screen))) ) @@ -1130,7 +1130,7 @@ (set! (-> a0-12 target-post quad) (-> v1-30 quad)) ) 0 - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) (logtest? (-> self nav state flags) (nav-state-flag at-target)) ) (go-virtual hidden) @@ -1161,7 +1161,7 @@ ) ) (set! (-> self want-stop) #f) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self next-change) (the-as uint (+ (current-time) (the int (* 300.0 (rand-vu-float-range 4.0 8.0))))) ) @@ -1175,7 +1175,7 @@ (t9-0) ) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 5)) + (if (time-elapsed? (-> self state-time) (seconds 5)) (go-virtual hide) ) (let ((gp-0 (handle->process (-> self focus handle)))) @@ -1183,7 +1183,7 @@ (go-virtual active) ) (when (get-enemy-target self) - (when (and gp-0 (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + (when (and gp-0 (time-elapsed? (-> self state-time) (-> self reaction-time))) (let ((f0-0 (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)))) (cond ((< f0-0 16384.0) @@ -1217,7 +1217,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod predator-method-186 predator ((obj predator)) +(defmethod predator-method-186 predator ((this predator)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1228,7 +1228,7 @@ (init-vf0-vector) (let ((f30-0 0.0) (s5-0 -1) - (s4-0 (-> *predator-graph* node (-> obj curr-node))) + (s4-0 (-> *predator-graph* node (-> this curr-node))) ) (dotimes (s3-0 32) (when (logtest? (the-as int (-> s4-0 points)) (ash 1 s3-0)) @@ -1253,7 +1253,7 @@ (when (or (= s5-0 -1) (< f30-0 f0-3)) (set! s5-0 s3-0) (set! f30-0 f0-3) - (set! (-> obj hide-pos quad) (-> s2-0 quad)) + (set! (-> this hide-pos quad) (-> s2-0 quad)) ) ) ) @@ -1264,14 +1264,14 @@ ) ) -(defmethod predator-method-185 predator ((obj predator)) +(defmethod predator-method-185 predator ((this predator)) (let ((f30-0 0.0) (s5-0 -1) ) -1 (dotimes (s4-0 (the-as int (-> *predator-graph* node-count))) (let* ((s3-0 (-> *predator-graph* node s4-0)) - (f0-0 (vector-vector-distance (-> s3-0 position) (-> obj root trans))) + (f0-0 (vector-vector-distance (-> s3-0 position) (-> this root trans))) ) (when (and (not (logtest? (-> s3-0 flags) (predator-node-flag taken))) (or (= s5-0 -1) (< f0-0 f30-0))) (set! f30-0 f0-0) @@ -1279,15 +1279,15 @@ ) ) ) - (set! (-> obj curr-node) s5-0) + (set! (-> this curr-node) s5-0) (logior! (-> *predator-graph* node s5-0 flags) (predator-node-flag taken)) ) - (predator-method-186 obj) + (predator-method-186 this) (none) ) -(defmethod predator-method-187 predator ((obj predator)) - (let* ((s5-0 (-> *predator-graph* node (-> obj curr-node))) +(defmethod predator-method-187 predator ((this predator)) + (let* ((s5-0 (-> *predator-graph* node (-> this curr-node))) (s4-0 (rand-vu-int-count (-> s5-0 edge-count))) ) (dotimes (s3-0 (-> s5-0 edge-count)) @@ -1305,7 +1305,7 @@ ) (logior! (-> s1-0 flags) (predator-node-flag taken)) (logclear! (-> s5-0 flags) (predator-node-flag taken)) - (set! (-> obj curr-node) (the-as int s2-0)) + (set! (-> this curr-node) (the-as int s2-0)) (return #t) ) ) @@ -1314,25 +1314,25 @@ #f ) -(defmethod track-target! predator ((obj predator)) +(defmethod track-target! predator ((this predator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (predator-method-183 obj) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) - (when (nonzero? (-> obj sound)) - (update-trans! (-> obj sound) (-> obj root trans)) - (update! (-> obj sound)) + (predator-method-183 this) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (when (nonzero? (-> this sound)) + (update-trans! (-> this sound) (-> this root trans)) + (update! (-> this sound)) ) (none) ) -(defmethod set-dangerous! predator ((obj predator) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod set-dangerous! predator ((this predator) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) (if arg0 @@ -1345,9 +1345,9 @@ #f ) -(defmethod init-enemy-collision! predator ((obj predator)) +(defmethod init-enemy-collision! predator ((this predator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1416,103 +1416,110 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-focusable vs predator. -(defmethod relocate predator ((obj predator) (arg0 int)) +(defmethod relocate predator ((this predator) (arg0 int)) (the-as predator - ((the-as (function process-focusable int process-focusable) (find-parent-method predator 7)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method predator 7)) this arg0) ) ) -(defmethod nav-enemy-method-167 predator ((obj predator)) - (let ((v1-0 (-> obj nav))) +(defmethod nav-enemy-method-167 predator ((this predator)) + (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) 0.0) ) 0 - (let ((v1-2 (-> obj nav))) - (set! (-> v1-2 acceleration) (-> obj enemy-info walk-acceleration)) + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 acceleration) (-> this enemy-info walk-acceleration)) ) 0 0 (none) ) -(defmethod run-logic? predator ((obj predator)) +(defmethod run-logic? predator ((this predator)) #t ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 predator ((obj predator) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 predator ((this predator) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 obj arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 this arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! predator ((obj predator) (arg0 entity-actor)) +(defmethod init-from-entity! predator ((this predator) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) -(defmethod init-enemy-behaviour-and-stats! predator ((obj predator) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! predator ((this predator) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-behaviour-and-stats!))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) 0 (none) ) -(defmethod init-enemy! predator ((obj predator)) +(defmethod init-enemy! predator ((this predator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-predator" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *predator-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *predator-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 327680.0) - (add-connection *part-engine* obj 8 obj 318 (new 'static 'vector :x 1228.8 :y 450.56 :z 983.04 :w 614400.0)) - (add-connection *part-engine* obj 8 obj 318 (new 'static 'vector :x -1228.8 :y 450.56 :z 983.04 :w 614400.0)) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd enemy obstacle)) - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 4 0) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) - (set! (-> obj draw force-fade) (the-as uint 0)) - (set! (-> obj fade) 0.0) - (set! (-> obj dest-fade) 0.0) - (set! (-> obj curr-node) -1) - (set! (-> obj next-change) (the-as uint 0)) - (set! (-> obj miss-amount) 16384.0) - (set! (-> obj ambient-sound-id) (new 'static 'sound-id)) - (predator-method-185 obj) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "pred-hum" :fo-min 2 :fo-max 30) (-> obj root trans)) + (set-gravity-length (-> this root dynam) 327680.0) + (add-connection *part-engine* this 8 this 318 (new 'static 'vector :x 1228.8 :y 450.56 :z 983.04 :w 614400.0)) + (add-connection + *part-engine* + this + 8 + this + 318 + (new 'static 'vector :x -1228.8 :y 450.56 :z 983.04 :w 614400.0) + ) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd enemy obstacle)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 4 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> this draw force-fade) (the-as uint 0)) + (set! (-> this fade) 0.0) + (set! (-> this dest-fade) 0.0) + (set! (-> this curr-node) -1) + (set! (-> this next-change) (the-as uint 0)) + (set! (-> this miss-amount) 16384.0) + (set! (-> this ambient-sound-id) (new 'static 'sound-id)) + (predator-method-185 this) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "pred-hum" :fo-min 2 :fo-max 30) (-> this root trans)) ) - (logior! (-> obj enemy-flags) (enemy-flag trackable-backup enable-on-hostile)) - (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector #t) 0) + (logior! (-> this enemy-flags) (enemy-flag trackable-backup enable-on-hostile)) + (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector #t) 0) 0 (none) ) @@ -1539,15 +1546,15 @@ This commonly includes things such as: (define *predator-manager* (the-as predator-manager #f)) ;; WARN: Return type mismatch process vs predator-manager. -(defmethod relocate predator-manager ((obj predator-manager) (arg0 int)) - (set! *predator-manager* obj) +(defmethod relocate predator-manager ((this predator-manager) (arg0 int)) + (set! *predator-manager* this) (if *predator-manager* (set! *predator-manager* (&+ *predator-manager* arg0)) ) - (the-as predator-manager ((method-of-type process relocate) obj arg0)) + (the-as predator-manager ((method-of-type process relocate) this arg0)) ) -(defmethod predator-manager-method-16 predator-manager ((obj predator-manager)) +(defmethod predator-manager-method-16 predator-manager ((this predator-manager)) 0 (none) ) @@ -1597,7 +1604,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. ;; WARN: new jak 2 until loop case, check carefully -(defmethod init-from-entity! predator-manager ((obj predator-manager) (arg0 entity-actor)) +(defmethod init-from-entity! predator-manager ((this predator-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1615,7 +1622,7 @@ This commonly includes things such as: (init-vf0-vector) (cond ((task-node-closed? (game-task-node forest-hunt-resolution)) - (go (method-of-object obj closed)) + (go (method-of-object this closed)) ) (else (dotimes (v1-2 (the-as int (-> *predator-graph* node-count))) @@ -1625,23 +1632,23 @@ This commonly includes things such as: ) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-6 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-6 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-6 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-6)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-6)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) (go process-drawable-art-error "actor-group predator-manager") ) ) ) - (dotimes (s5-0 (length (-> obj actor-group 0))) - (let ((t0-1 (-> obj actor-group 0 data s5-0 actor))) + (dotimes (s5-0 (length (-> this actor-group 0))) + (let ((t0-1 (-> this actor-group 0 data s5-0 actor))) (if t0-1 - (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector t0-1) 0) + (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector t0-1) 0) ) ) ) @@ -1696,10 +1703,10 @@ This commonly includes things such as: (set! (-> s2-1 trans quad) (-> s1-0 quad)) ) (quaternion-copy! (-> s2-1 quat) *unity-quaternion*) - (set! (-> s2-1 entity) (-> obj actor-group 1 data s5-2 actor)) + (set! (-> s2-1 entity) (-> this actor-group 1 data s5-2 actor)) (set! (-> s2-1 directed?) #f) (set! (-> s2-1 no-initial-move-to-ground?) #f) - (let* ((s1-2 (ppointer->process (process-spawn predator :init enemy-init-by-other obj s2-1 :to obj))) + (let* ((s1-2 (ppointer->process (process-spawn predator :init enemy-init-by-other this s2-1 :to this))) (s2-2 (if (type? s1-2 process-focusable) s1-2 ) @@ -1710,8 +1717,8 @@ This commonly includes things such as: ) ) ) - (set! (-> obj predator-h (-> obj predator-count)) (process->handle s2-2)) - (+! (-> obj predator-count) 1) + (set! (-> this predator-h (-> this predator-count)) (process->handle s2-2)) + (+! (-> this predator-count) 1) (when v1-66 (change-to (-> v1-66 nav-mesh) (the-as process-drawable s2-2)) (let ((v1-70 (-> (the-as process-drawable s2-2) nav state))) @@ -1726,7 +1733,7 @@ This commonly includes things such as: ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) diff --git a/goal_src/jak2/levels/forest/wren.gc b/goal_src/jak2/levels/forest/wren.gc index 780a120b9b..0a2ab4a981 100644 --- a/goal_src/jak2/levels/forest/wren.gc +++ b/goal_src/jak2/levels/forest/wren.gc @@ -58,11 +58,11 @@ :bounds (static-spherem 0 0 0 4) ) -(defmethod debug-draw-path wren ((obj wren)) +(defmethod debug-draw-path wren ((this wren)) "Draws the associated [[curve-control]]s associated with this wren" (dotimes (s5-0 2) - (if (-> obj fly-curve s5-0) - (debug-draw (-> obj fly-curve s5-0)) + (if (-> this fly-curve s5-0) + (debug-draw (-> this fly-curve s5-0)) ) ) #f @@ -126,7 +126,7 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod spooked? wren ((obj wren)) +(defmethod spooked? wren ((this wren)) "@returns a [[symbol]] indicating if Jak is considered close enough to the wren to spook it. If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (let* ((gp-0 *target*) @@ -135,7 +135,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (the-as symbol (and a0-2 (< (vector-vector-xz-distance (-> obj root trans) (get-trans a0-2 0)) 102400.0))) + (the-as symbol (and a0-2 (< (vector-vector-xz-distance (-> this root trans) (get-trans a0-2 0)) 102400.0))) ) ) @@ -194,12 +194,12 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (defstate peck (wren) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self peck-timer) (the-as uint (the int (* 300.0 (rand-vu-float-range 1.4 4.3))))) (logclear! (-> self flags) (wren-flags wrflags-1 wrflags-2)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self peck-timer))) + (when (time-elapsed? (-> self state-time) (the-as time-frame (-> self peck-timer))) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)))) (if (< (fabs (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle gp-1))) 728.1778) (go-virtual hunt) @@ -242,7 +242,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (f30-1 1.0) ) (ja-no-eval :group! wren-idle-ja :num! (loop! f30-1) :frame-num 0.0) - (until (>= (- (current-time) gp-1) s5-1) + (until (time-elapsed? gp-1 s5-1) (suspend) (ja :num! (loop! f30-1)) ) @@ -253,7 +253,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (f30-3 1.0) ) (ja-no-eval :group! wren-idle-ja :num! (loop! f30-3) :frame-num 0.0) - (until (>= (- (current-time) gp-2) s5-2) + (until (time-elapsed? gp-2 s5-2) (suspend) (ja :num! (loop! f30-3)) ) @@ -294,7 +294,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (f30-0 2.0) ) (ja-no-eval :group! wren-takeoff-ja :num! (loop! f30-0) :frame-num 0.0) - (until (>= (- (current-time) gp-0) s5-0) + (until (time-elapsed? gp-0 s5-0) (suspend) (ja :num! (loop! f30-0)) ) @@ -379,7 +379,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" :trans (behavior () (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)))) (when (< (fabs (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle gp-1))) 728.1778) - (when (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self peck-timer))) + (when (time-elapsed? (-> self state-time) (the-as time-frame (-> self peck-timer))) (set! (-> self fly-index) (logand (+ (-> self fly-index) 1) 1)) (go-virtual fly) ) @@ -394,7 +394,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (f30-1 1.0) ) (ja-no-eval :group! wren-idle-ja :num! (loop! f30-1) :frame-num 0.0) - (until (>= (- (current-time) gp-0) s5-0) + (until (time-elapsed? gp-0 s5-0) (suspend) (ja :num! (loop! f30-1)) ) @@ -405,7 +405,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (f30-2 1.0) ) (ja-no-eval :group! wren-idle-ja :num! (loop! f30-2) :frame-num 0.0) - (until (>= (- (current-time) gp-1) s5-1) + (until (time-elapsed? gp-1 s5-1) (suspend) (ja :num! (loop! f30-2)) ) @@ -430,60 +430,63 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ;; WARN: Return type mismatch process-drawable vs wren. -(defmethod relocate wren ((obj wren) (arg0 int)) +(defmethod relocate wren ((this wren) (arg0 int)) (dotimes (v1-0 2) - (when (-> obj fly-curve v1-0) - (if (nonzero? (-> obj fly-curve v1-0)) - (&+! (-> obj fly-curve v1-0) arg0) + (when (-> this fly-curve v1-0) + (if (nonzero? (-> this fly-curve v1-0)) + (&+! (-> this fly-curve v1-0) arg0) ) ) ) - (the-as wren ((the-as (function process-drawable int process-drawable) (find-parent-method wren 7)) obj arg0)) + (the-as + wren + ((the-as (function process-drawable int process-drawable) (find-parent-method wren 7)) this arg0) + ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! wren ((obj wren) (arg0 entity-actor)) +(defmethod init-from-entity! wren ((this wren) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-wren" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((f0-0 (rand-vu-float-range 1.5 3.5))) - (set-vector! (-> obj root scale) f0-0 f0-0 f0-0 1.0) + (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) ) - (set! (-> obj fly-index) (the-as uint 0)) - (set! (-> obj path-u) 0.0) - (set! (-> obj flags) (wren-flags)) - (set! (-> obj bob-level) 0.0) - (set! (-> obj bank-angle) 0.0) - (set! (-> obj path) (new 'process 'path-control obj 'idle 0.0 arg0 #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fly-index) (the-as uint 0)) + (set! (-> this path-u) 0.0) + (set! (-> this flags) (wren-flags)) + (set! (-> this bob-level) 0.0) + (set! (-> this bank-angle) 0.0) + (set! (-> this path) (new 'process 'path-control this 'idle 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) + ((logtest? (-> this path flags) (path-control-flag not-found)) (dotimes (s5-1 2) - (set! (-> obj fly-curve s5-1) (new 'process 'curve-control obj 'path (the float s5-1))) - (logior! (-> obj fly-curve s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fly-curve s5-1) (new 'process 'curve-control this 'path (the float s5-1))) + (logior! (-> this fly-curve s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) ) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 8 0) - (go (method-of-object obj fly)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 8 0) + (go (method-of-object this fly)) ) (else - (set! (-> obj fly-curve 0) (new 'process 'curve-control obj 'takeoff -1000000000.0)) - (logior! (-> obj fly-curve 0 flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fly-curve 1) #f) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 2 0) - (go (method-of-object obj peck)) + (set! (-> this fly-curve 0) (new 'process 'curve-control this 'takeoff -1000000000.0)) + (logior! (-> this fly-curve 0 flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fly-curve 1) #f) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 2 0) + (go (method-of-object this peck)) ) ) (none) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc index 3be5d9b5da..5e6ec10247 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpa-obs.gc @@ -53,7 +53,7 @@ :event (-> (method-of-type fort-elec-switch idle) event) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 16)) + (until (time-elapsed? gp-0 (seconds 16)) (suspend) ) ) @@ -61,7 +61,7 @@ (suspend) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.4)) + (until (time-elapsed? gp-1 (seconds 0.4)) (suspend) ) ) @@ -142,7 +142,7 @@ ) (sound-play "elec-switch") (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.5)) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -178,7 +178,7 @@ ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.75)) + (until (time-elapsed? gp-3 (seconds 0.75)) (suspend) ) ) @@ -198,7 +198,7 @@ ) ) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 1.5)) + (until (time-elapsed? gp-4 (seconds 1.5)) (suspend) ) ) @@ -227,15 +227,15 @@ ) ;; WARN: Return type mismatch process-drawable vs fort-elec-switch. -(defmethod relocate fort-elec-switch ((obj fort-elec-switch) (arg0 int)) - (if (nonzero? (-> obj l-bolt)) - (&+! (-> obj l-bolt) arg0) +(defmethod relocate fort-elec-switch ((this fort-elec-switch) (arg0 int)) + (if (nonzero? (-> this l-bolt)) + (&+! (-> this l-bolt) arg0) ) - (the-as fort-elec-switch ((method-of-type process-drawable relocate) obj arg0)) + (the-as fort-elec-switch ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-elec-switch ((obj fort-elec-switch) (arg0 entity-actor)) +(defmethod init-from-entity! fort-elec-switch ((this fort-elec-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -243,8 +243,9 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (stack-size-set! (-> obj top-thread) 512) ;; og:preserve-this added - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + ;; og:preserve-this added + (stack-size-set! (-> this top-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -259,34 +260,34 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-elec-switch" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj tank-actor) (entity-actor-lookup arg0 'alt-actor 1)) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this tank-actor) (entity-actor-lookup arg0 'alt-actor 1)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-11 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-11 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-11 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj switch-group) (the-as (pointer actor-group) v1-11)) - (set! (-> obj switch-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this switch-group) (the-as (pointer actor-group) v1-11)) + (set! (-> this switch-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj switch-group) (the-as (pointer actor-group) #f)) - (set! (-> obj switch-group-count) 0) + (set! (-> this switch-group) (the-as (pointer actor-group) #f)) + (set! (-> this switch-group-count) 0) 0 ) ) ) - (let ((a0-18 (-> obj skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-18 (-> this skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) (let ((a2-8 (new 'static 'lightning-spec @@ -309,21 +310,21 @@ This commonly includes things such as: ) ) ) - (set! (-> obj l-bolt) (new 'process 'lightning-control a2-8 obj 0.0)) + (set! (-> this l-bolt) (new 'process 'lightning-control a2-8 this 0.0)) ) (let ((a0-20 (new 'stack-no-clear 'vector)) (v1-26 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-20 quad) (-> obj root trans quad)) - (set! (-> v1-26 quad) (-> obj root trans quad)) + (set! (-> a0-20 quad) (-> this root trans quad)) + (set! (-> v1-26 quad) (-> this root trans quad)) (+! (-> a0-20 y) 4915.2) (+! (-> v1-26 y) 17203.2) - (set! (-> obj l-bolt state meet data 0 quad) (-> a0-20 quad)) - (let ((a0-22 (-> obj l-bolt))) + (set! (-> this l-bolt state meet data 0 quad) (-> a0-20 quad)) + (let ((a0-22 (-> this l-bolt))) (set! (-> a0-22 state meet data (+ (-> a0-22 state points-to-draw) -1) quad) (-> v1-26 quad)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -357,12 +358,12 @@ This commonly includes things such as: :bounds (static-spherem 0 11 0 18) ) -(defmethod fort-fence-method-22 fort-fence ((obj fort-fence)) +(defmethod fort-fence-method-22 fort-fence ((this fort-fence)) 0 (none) ) -(defmethod fort-fence-method-23 fort-fence ((obj fort-fence)) +(defmethod fort-fence-method-23 fort-fence ((this fort-fence)) 0 (none) ) @@ -450,35 +451,35 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-fence ((obj fort-fence) (arg0 entity-actor)) +(defmethod init-from-entity! fort-fence ((this fort-fence) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (fort-fence-method-23 obj) - (process-drawable-from-entity! obj arg0) - (fort-fence-method-22 obj) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj loading?) #f) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (stack-size-set! (-> this main-thread) 512) + (fort-fence-method-23 this) + (process-drawable-from-entity! this arg0) + (fort-fence-method-22 this) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this loading?) #f) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) (set! (-> a0-6 frame-num) 0.0) (joint-control-channel-group! a0-6 - (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) num-func-identity ) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -500,36 +501,36 @@ This commonly includes things such as: ) -(defmethod fort-fence-method-22 fort-fence-a ((obj fort-fence-a)) +(defmethod fort-fence-method-22 fort-fence-a ((this fort-fence-a)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-fence-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "fort-fence-a" :anim-name "a-break" :parts 2 :command-list '()) ) - (set! (-> obj exit-anim) (-> obj draw art-group data 3)) + (set! (-> this exit-anim) (-> this draw art-group data 3)) 0 (none) ) -(defmethod fort-fence-method-22 fort-fence-b ((obj fort-fence-b)) +(defmethod fort-fence-method-22 fort-fence-b ((this fort-fence-b)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-fence-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "fort-fence-b" :anim-name "b-break" :parts 2 :command-list '()) ) - (set! (-> obj exit-anim) (-> obj draw art-group data 8)) + (set! (-> this exit-anim) (-> this draw art-group data 8)) 0 (none) ) -(defmethod fort-fence-method-23 fort-fence-a ((obj fort-fence-a)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod fort-fence-method-23 fort-fence-a ((this fort-fence-a)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) @@ -554,14 +555,14 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod fort-fence-method-23 fort-fence-b ((obj fort-fence-b)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod fort-fence-method-23 fort-fence-b ((this fort-fence-b)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) @@ -586,7 +587,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpa-part.gc b/goal_src/jak2/levels/fortress/dump/fordumpa-part.gc index c38f304a71..551fce25d8 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpa-part.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpa-part.gc @@ -1439,9 +1439,9 @@ ) ) -(defmethod elec-gate-method-24 fort-elec-gate ((obj fort-elec-gate)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 551) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 552) obj)) +(defmethod elec-gate-method-24 fort-elec-gate ((this fort-elec-gate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 551) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 552) this)) 0 (none) ) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc index 2aaf6d30a9..bdcee84da3 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpb-obs.gc @@ -54,14 +54,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-plat-orbit ((obj fort-plat-orbit) (arg0 entity-actor)) +(defmethod init-from-entity! fort-plat-orbit ((this fort-plat-orbit) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -116,17 +116,17 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-25 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-plat-orbit" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-23 (new 'stack-no-clear 'sync-info-params))) (let ((v1-34 0)) @@ -136,21 +136,21 @@ This commonly includes things such as: (set! (-> a1-23 sync-type) 'sync-linear) (set! (-> a1-23 sync-flags) (the-as sync-flags v1-34)) ) - (set! (-> a1-23 entity) (-> obj entity)) + (set! (-> a1-23 entity) (-> this entity)) (set! (-> a1-23 period) (the-as uint 6000)) (set! (-> a1-23 percent) 0.0) - (initialize! (-> obj sync) a1-23) + (initialize! (-> this sync) a1-23) ) - (let ((a0-48 (-> obj skel root-channel 0))) - (set! (-> a0-48 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-48 (-> this skel root-channel 0))) + (set! (-> a0-48 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-48 frame-num) 0.0) - (joint-control-channel-group! a0-48 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-48 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "plat-orbit" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "plat-orbit" :fo-max 70) (-> this root trans)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -293,9 +293,9 @@ This commonly includes things such as: :code sleep-code ) -(defmethod fort-plat-shuttle-method-22 fort-plat-shuttle ((obj fort-plat-shuttle)) - (let* ((f28-0 (total-distance (-> obj path))) - (s5-0 (-> obj sync)) +(defmethod fort-plat-shuttle-method-22 fort-plat-shuttle ((this fort-plat-shuttle)) + (let* ((f28-0 (total-distance (-> this path))) + (s5-0 (-> this sync)) (f26-0 81.92) (a0-3 (- (current-time) (get-timeframe-offset! s5-0 0))) (v1-6 (-> s5-0 period)) @@ -304,7 +304,7 @@ This commonly includes things such as: ) (while (>= 1.0 f30-0) (if (>= f30-0 0.0) - (process-spawn fort-plat-shuttle-plat f30-0 :to obj) + (process-spawn fort-plat-shuttle-plat f30-0 :to this) ) (+! f30-0 f28-1) ) @@ -313,7 +313,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-plat-shuttle ((obj fort-plat-shuttle) (arg0 entity-actor)) +(defmethod init-from-entity! fort-plat-shuttle ((this fort-plat-shuttle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -321,15 +321,15 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-64 int)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-plat-shuttle" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((s4-1 (new 'stack-no-clear 'sync-info-params))) (let ((s3-1 1200)) @@ -352,14 +352,14 @@ This commonly includes things such as: (set! (-> s4-1 period) (the-as uint s3-1)) ) (set! (-> s4-1 percent) 0.0) - (initialize! (-> obj sync) s4-1) + (initialize! (-> this sync) s4-1) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (if (logtest? (actor-option user17) (-> obj fact options)) - (go (method-of-object obj dormant)) - (go (method-of-object obj idle)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logclear! (-> this mask) (process-mask actor-pause)) + (if (logtest? (actor-option user17) (-> this fact options)) + (go (method-of-object this dormant)) + (go (method-of-object this idle)) ) (none) ) @@ -378,15 +378,15 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 36) ) -(defmethod get-art-group fort-conveyor ((obj fort-conveyor)) +(defmethod get-art-group fort-conveyor ((this fort-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! fort-conveyor ((obj fort-conveyor)) +(defmethod reset-root! fort-conveyor ((this fort-conveyor)) "Re-initializes the `root` [[trsqv]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -408,39 +408,39 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) (set! (-> s5-0 rider-max-momentum) 8192.0) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; WARN: Return type mismatch vector vs none. -(defmethod init! fort-conveyor ((obj fort-conveyor)) +(defmethod init! fort-conveyor ((this fort-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj belt-radius) 24576.0) - (set! (-> obj pull-y-threshold) 16384.0) + (set! (-> this belt-radius) 24576.0) + (set! (-> this pull-y-threshold) 16384.0) (cond - ((name= (-> obj name) "fort-conveyor-2") - (set! (-> obj speed) -21299.2) - (set-vector! (-> obj root scale) 1.0 1.0 0.9 1.0) + ((name= (-> this name) "fort-conveyor-2") + (set! (-> this speed) -21299.2) + (set-vector! (-> this root scale) 1.0 1.0 0.9 1.0) ) - ((name= (-> obj name) "fort-conveyor-3") - (set! (-> obj speed) -18432.0) - (set-vector! (-> obj root scale) 1.0 1.0 0.79 1.0) + ((name= (-> this name) "fort-conveyor-3") + (set! (-> this speed) -18432.0) + (set-vector! (-> this root scale) 1.0 1.0 0.79 1.0) ) ) (none) ) -(defmethod set-and-get-ambient-sound! fort-conveyor ((obj fort-conveyor)) +(defmethod set-and-get-ambient-sound! fort-conveyor ((this fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" - (let* ((s5-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp)) - (v1-2 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 1.0 'interp)) + (let* ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-2 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 1.0 'interp)) (a3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 v1-2)) ) (vector-float*! a3-3 a3-3 0.5) (let ((v0-2 (new 'process 'ambient-sound (static-sound-spec "fort-conveyor" :fo-max 50) a3-3))) - (set! (-> obj sound) v0-2) + (set! (-> this sound) v0-2) v0-2 ) ) diff --git a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc index 7c310dcce2..34125059b2 100644 --- a/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc +++ b/goal_src/jak2/levels/fortress/dump/fordumpc-obs.gc @@ -7,39 +7,39 @@ ;; DECOMP BEGINS -(defmethod draw hud-rocketsensor ((obj hud-rocketsensor)) +(defmethod draw hud-rocketsensor ((this hud-rocketsensor)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 210 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -17 25) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -17 25) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-rocketsensor ((obj hud-rocketsensor)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-rocketsensor ((this hud-rocketsensor)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-rocketsensor ((obj hud-rocketsensor)) - (set! (-> obj level) (level-get *level* 'fordumpc)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-rocketsensor ((this hud-rocketsensor)) + (set! (-> this level) (level-get *level* 'fordumpc)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1f))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1f))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -139,7 +139,7 @@ ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.5)) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -148,14 +148,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-dump-bomb-a ((obj fort-dump-bomb-a) (arg0 entity-actor)) +(defmethod init-from-entity! fort-dump-bomb-a ((this fort-dump-bomb-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec bot)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -170,22 +170,22 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-dump-bomb-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 573) obj)) - (let ((a0-13 (-> obj skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 573) this)) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -364,7 +364,7 @@ This commonly includes things such as: ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 1)) + (until (time-elapsed? gp-3 (seconds 1)) (suspend) ) ) @@ -378,9 +378,9 @@ This commonly includes things such as: ) ) -(defmethod deactivate fort-missile-target ((obj fort-missile-target)) - (sound-stop (the-as sound-id (-> obj sound-id))) - ((the-as (function process-drawable none) (find-parent-method fort-missile-target 10)) obj) +(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) (none) ) @@ -534,7 +534,7 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 8)) + (until (time-elapsed? gp-0 (seconds 8)) (suspend) ) ) @@ -543,14 +543,14 @@ This commonly includes things such as: ) (when (= (-> self bomb-count) 4) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.4)) + (until (time-elapsed? gp-1 (seconds 0.4)) (suspend) ) ) (add-process *gui-control* self (gui-channel daxter) (gui-action play) "ds017" -99.0 0) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 20)) + (until (time-elapsed? gp-2 (seconds 20)) (suspend) ) ) @@ -559,13 +559,13 @@ This commonly includes things such as: ) (while (> (-> self bomb-count) 0) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.2)) + (until (time-elapsed? gp-3 (seconds 0.2)) (suspend) ) ) ) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.8)) + (until (time-elapsed? gp-4 (seconds 0.8)) (suspend) ) ) @@ -612,7 +612,7 @@ This commonly includes things such as: ) (set-fordumpc-light-flag! #t) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.2)) + (until (time-elapsed? gp-0 (seconds 0.2)) (suspend) ) ) @@ -623,7 +623,7 @@ This commonly includes things such as: (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (task-node-close! (game-task-node fortress-dump-missile)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.75)) + (until (time-elapsed? gp-1 (seconds 0.75)) (suspend) ) ) @@ -658,7 +658,7 @@ This commonly includes things such as: ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 1.5)) + (until (time-elapsed? gp-2 (seconds 1.5)) (suspend) ) ) @@ -685,7 +685,7 @@ This commonly includes things such as: (set! (-> self hud) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) ) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.4)) + (until (time-elapsed? gp-4 (seconds 0.4)) (suspend) ) ) @@ -695,7 +695,7 @@ This commonly includes things such as: (dotimes (gp-5 10) (set! (-> *game-info* timer) (the-as time-frame (- 3000 (the int (* 300.0 (the float gp-5)))))) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 1)) + (until (time-elapsed? s5-0 (seconds 1)) (suspend) ) ) @@ -735,7 +735,7 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.4)) + (until (time-elapsed? gp-0 (seconds 0.4)) (suspend) ) ) @@ -891,13 +891,13 @@ This commonly includes things such as: (set! (-> s5-3 trans w) 1.0) (spawn-with-matrix (-> self part-doom) s5-3) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) ) (let ((gp-5 (current-time))) - (until (>= (- (current-time) gp-5) (seconds 10)) + (until (time-elapsed? gp-5 (seconds 10)) (suspend) ) ) @@ -910,38 +910,38 @@ This commonly includes things such as: :code sleep-code ) -(defmethod deactivate fort-missile ((obj fort-missile)) +(defmethod deactivate fort-missile ((this fort-missile)) (set-fordumpc-light-flag! #f) - (send-event (handle->process (-> obj hud)) 'hide-and-die) - (if (nonzero? (-> obj part-doom)) - (kill-and-free-particles (-> obj part-doom)) + (send-event (handle->process (-> this hud)) 'hide-and-die) + (if (nonzero? (-> this part-doom)) + (kill-and-free-particles (-> this part-doom)) ) - (sound-stop (-> obj alarm-sound-id)) - ((method-of-type process-drawable deactivate) obj) + (sound-stop (-> this alarm-sound-id)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs fort-missile. -(defmethod relocate fort-missile ((obj fort-missile) (arg0 int)) - (if (nonzero? (-> obj part-doom)) - (&+! (-> obj part-doom) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method fort-missile 7)) this arg0) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-missile ((obj fort-missile) (arg0 entity-actor)) +(defmethod init-from-entity! fort-missile ((this fort-missile) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) @@ -968,17 +968,17 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-missile" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj door-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj door-actor 1) (entity-actor-lookup arg0 'alt-actor 1)) - (set! (-> obj tank-actor) (entity-actor-lookup arg0 'alt-actor 2)) + (set! (-> this door-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this door-actor 1) (entity-actor-lookup arg0 'alt-actor 1)) + (set! (-> this tank-actor) (entity-actor-lookup arg0 'alt-actor 2)) (let ((s5-1 (new 'stack-no-clear 'vector))) (set! (-> s5-1 x) 0.0) (set! (-> s5-1 y) -36864.0) @@ -986,27 +986,27 @@ This commonly includes things such as: (set! (-> s5-1 w) 1.0) (let ((s4-2 (new 'stack-no-clear 'vector))) (dotimes (s3-2 4) - (let ((s2-1 (vector+! (new 'stack-no-clear 'vector) (-> obj root trans) s5-1)) + (let ((s2-1 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) s5-1)) (s1-0 (new 'stack-no-clear 'vector)) ) - (vector-normalize! (vector-! s4-2 s2-1 (-> obj root trans)) 1.0) + (vector-normalize! (vector-! s4-2 s2-1 (-> this root trans)) 1.0) (vector-float*! s1-0 s4-2 -1.0) - (set! (-> obj bomb s3-2) (ppointer->handle (process-spawn fort-missile-target s2-1 s1-0 :to obj))) + (set! (-> this bomb s3-2) (ppointer->handle (process-spawn fort-missile-target s2-1 s1-0 :to this))) ) (vector-rotate-y! s5-1 s5-1 16384.0) ) ) ) - (set! (-> obj bomb-count) (the-as uint 4)) - (set! (-> obj hud) (the-as handle #f)) - (set! (-> obj part-doom) (create-launch-control (-> *part-group-id-table* 583) obj)) - (set! (-> obj alarm-sound-id) (new-sound-id)) - (let ((a0-36 (-> obj skel root-channel 0))) - (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> this bomb-count) (the-as uint 4)) + (set! (-> this hud) (the-as handle #f)) + (set! (-> this part-doom) (create-launch-control (-> *part-group-id-table* 583) this)) + (set! (-> this alarm-sound-id) (new-sound-id)) + (let ((a0-36 (-> this skel root-channel 0))) + (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-36 frame-num) 0.0) - (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (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 67eda141de..a4b0939fcf 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank-turret.gc @@ -124,7 +124,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('trigger) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (go-virtual active) ) (('die) @@ -198,7 +198,7 @@ ) :code (behavior () (until #f - (when (and (not (paused?)) (>= (- (current-time) (-> self state-time)) (seconds 1))) + (when (and (not (paused?)) (time-elapsed? (-> self state-time) (seconds 1))) (seek! (-> self anim-frame) 0.0 (* 0.2 (-> self clock time-adjust-ratio))) (seek! (-> self transition) 1.0 (* 0.01 (-> self clock time-adjust-ratio))) ) @@ -249,7 +249,7 @@ :virtual #t :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (seek! (-> self transition) 0.0 (seconds-per-frame)) (set-roboscreen-alpha! (-> self transition)) (suspend) @@ -258,7 +258,7 @@ ) ) -(defmethod fort-roboscreen-method-24 fort-roboscreen ((obj fort-roboscreen)) +(defmethod fort-roboscreen-method-24 fort-roboscreen ((this fort-roboscreen)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -274,12 +274,12 @@ ) ;; og:preserve-this changed for PC port: stretch effect based on aspect ratio (let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) - (set-vector! (-> obj root scale) (* f0-4 (if (-> *pc-settings* use-vis?) 1.0 (-> *pc-settings* aspect-ratio-scale))) f0-4 f0-4 1.0) + (set-vector! (-> this root scale) (* f0-4 (if (-> *pc-settings* use-vis?) 1.0 (-> *pc-settings* aspect-ratio-scale))) f0-4 f0-4 1.0) ) (set! (-> gp-0 quad) (-> (camera-pos) quad)) (vector-normalize-copy! s5-0 (-> s3-0 vector 2) 1.0) - (matrix->quaternion (-> obj root quat) s3-0) - (let ((v1-10 (-> obj root trans))) + (matrix->quaternion (-> this root quat) s3-0) + (let ((v1-10 (-> this root trans))) (let ((a0-5 f30-0)) (.mov vf7 a0-5) ) @@ -323,10 +323,10 @@ (none) ) -(defmethod deactivate fort-roboscreen ((obj fort-roboscreen)) +(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)) obj) + ((the-as (function process-drawable none) (find-parent-method fort-roboscreen 10)) this) (none) ) @@ -545,19 +545,19 @@ ) ;; WARN: Return type mismatch process-drawable vs fort-robotank-reticle. -(defmethod relocate fort-robotank-reticle ((obj fort-robotank-reticle) (arg0 int)) - (if (nonzero? (-> obj shadow-jmod)) - (&+! (-> obj shadow-jmod) arg0) +(defmethod relocate fort-robotank-reticle ((this fort-robotank-reticle) (arg0 int)) + (if (nonzero? (-> this shadow-jmod)) + (&+! (-> this shadow-jmod) arg0) ) - (if (nonzero? (-> obj sight-jmod)) - (&+! (-> obj sight-jmod) arg0) + (if (nonzero? (-> this sight-jmod)) + (&+! (-> this sight-jmod) arg0) ) (dotimes (v1-8 3) - (if (nonzero? (-> obj ring-jmod v1-8)) - (&+! (-> obj ring-jmod v1-8) arg0) + (if (nonzero? (-> this ring-jmod v1-8)) + (&+! (-> this ring-jmod v1-8) arg0) ) ) - (the-as fort-robotank-reticle ((method-of-type process-drawable relocate) obj arg0)) + (the-as fort-robotank-reticle ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. @@ -612,7 +612,7 @@ ) -(defmethod play-impact-sound fort-robotank-shot ((obj fort-robotank-shot) (arg0 projectile-options)) +(defmethod play-impact-sound fort-robotank-shot ((this fort-robotank-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -627,9 +627,9 @@ (none) ) -(defmethod init-proj-collision! fort-robotank-shot ((obj fort-robotank-shot)) +(defmethod init-proj-collision! fort-robotank-shot ((this fort-robotank-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -669,25 +669,25 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 (none) ) -(defmethod init-proj-settings! fort-robotank-shot ((obj fort-robotank-shot)) +(defmethod init-proj-settings! fort-robotank-shot ((this fort-robotank-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'fort-robotank-shot) - (set! (-> obj max-speed) 819200.0) - (set! (-> obj move) guard-shot-move) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj timeout) (seconds 0.5)) - (logior! (-> obj options) (projectile-options account-for-target-velocity)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'fort-robotank-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) guard-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (logior! (-> this options) (projectile-options account-for-target-velocity)) + (set-gravity-length (-> this root dynam) 573440.0) 0 (none) ) @@ -721,18 +721,18 @@ ;; WARN: Return type mismatch pointer vs symbol. ;; ERROR: Failed load: (set! t0-6 (l.d (+ a0-28 8))) at op 170 -(defmethod fort-robotank-turret-method-32 fort-robotank-turret ((obj fort-robotank-turret) (arg0 (inline-array vector))) +(defmethod fort-robotank-turret-method-32 fort-robotank-turret ((this fort-robotank-turret) (arg0 (inline-array vector))) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((v1-0 (-> arg0 0)) (a0-1 (-> arg0 1)) ) - (set! (-> gp-0 ent) (-> obj entity)) + (set! (-> gp-0 ent) (-> this entity)) (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (set! (-> gp-0 pos quad) (-> v1-0 quad)) - (set! (-> gp-0 notify-handle) (process->handle obj)) + (set! (-> gp-0 notify-handle) (process->handle this)) (set! (-> gp-0 owner-handle) (the-as handle #f)) - (set! (-> gp-0 ignore-handle) (process->handle obj)) + (set! (-> gp-0 ignore-handle) (process->handle this)) (let* ((a1-10 *game-info*) (a2-11 (+ (-> a1-10 attack-id) 1)) ) @@ -743,28 +743,28 @@ (vector-! (-> gp-0 vel) a0-1 v1-0) ) (vector-normalize! (-> gp-0 vel) 512000.0) - (spawn-projectile fort-robotank-shot gp-0 obj *default-dead-pool*) + (spawn-projectile fort-robotank-shot gp-0 this *default-dead-pool*) ) ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fort-robotank-turret-method-33 fort-robotank-turret ((obj fort-robotank-turret)) +(defmethod fort-robotank-turret-method-33 fort-robotank-turret ((this fort-robotank-turret)) (local-vars (sv-144 vector) (sv-160 vector)) (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 2)) (s5-0 (new 'stack-no-clear 'inline-array 'vector 4)) ) - (-> obj node-list data 11) + (-> this node-list data 11) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s1-0 (-> obj sight-pos)) - (s2-0 (-> obj gun-index)) + (s1-0 (-> this sight-pos)) + (s2-0 (-> this gun-index)) ) 0.0 0.0 - (vector<-cspace! (-> s3-0 0) (-> obj node-list data (-> obj gun-joint-l s2-0))) - (vector<-cspace! (-> s3-0 1) (-> obj node-list data (-> obj gun-joint-r s2-0))) + (vector<-cspace! (-> s3-0 0) (-> this node-list data (-> this gun-joint-l s2-0))) + (vector<-cspace! (-> s3-0 1) (-> this node-list data (-> this gun-joint-r s2-0))) (let ((f30-0 (* 0.5 (vector-length (vector-! (new 'stack-no-clear 'vector) (-> s3-0 1) (-> s3-0 0)))))) (let ((f28-0 (fmax 81920.0 (+ 12288.0 (vector-length (vector-! (new 'stack-no-clear 'vector) s1-0 (-> s3-0 0))))))) - (vector-normalize-copy! s4-0 (-> obj node-list data (-> obj gun-joint-l s2-0) bone transform vector 2) 1.0) + (vector-normalize-copy! s4-0 (-> this node-list data (-> this gun-joint-l s2-0) bone transform vector 2) 1.0) (let ((s0-0 vector-rotate-y!)) (set! sv-144 s4-0) (set! sv-160 s4-0) @@ -774,25 +774,25 @@ ) (set! (-> s5-0 0 quad) (-> s3-0 0 quad)) (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) - (set! (-> obj shot-range) (fmin 204800.0 f28-0)) + (set! (-> this shot-range) (fmin 204800.0 f28-0)) ) - (fort-robotank-turret-method-32 obj s5-0) + (fort-robotank-turret-method-32 this s5-0) (let ((f28-1 (fmax 81920.0 (+ 12288.0 (vector-length (vector-! (new 'stack-no-clear 'vector) s1-0 (-> s3-0 1))))))) - (vector-normalize-copy! s4-0 (-> obj node-list data (-> obj gun-joint-r s2-0) bone transform vector 2) 1.0) + (vector-normalize-copy! s4-0 (-> this node-list data (-> this gun-joint-r s2-0) bone transform vector 2) 1.0) (vector-rotate-y! s4-0 s4-0 (- (- 16384.0 (acos (/ f30-0 f28-1))))) (set! (-> s5-0 0 quad) (-> s3-0 1 quad)) (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) - (set! (-> obj shot-range) (fmin 204800.0 f28-1)) + (set! (-> this shot-range) (fmin 204800.0 f28-1)) ) ) ) - (fort-robotank-turret-method-32 obj s5-0) + (fort-robotank-turret-method-32 this s5-0) ) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod fort-robotank-turret-method-31 fort-robotank-turret ((obj fort-robotank-turret) (arg0 vector) (arg1 vector)) +(defmethod fort-robotank-turret-method-31 fort-robotank-turret ((this fort-robotank-turret) (arg0 vector) (arg1 vector)) (let ((s3-0 (new 'stack-no-clear 'collide-query)) (f30-0 307200.0) ) @@ -801,13 +801,13 @@ (let ((v1-4 s3-0)) (set! (-> v1-4 radius) 4096.0) (set! (-> v1-4 collide-with) (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list)) - (set! (-> v1-4 ignore-process0) (ppointer->process (-> obj parent))) - (set! (-> v1-4 ignore-process1) obj) + (set! (-> v1-4 ignore-process0) (ppointer->process (-> this parent))) + (set! (-> v1-4 ignore-process1) this) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-4 action-mask) (collide-action solid semi-solid)) ) (let ((f28-0 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) - (s4-0 (-> obj sight-pos)) + (s4-0 (-> this sight-pos)) ) (cond ((>= f28-0 0.0) @@ -842,17 +842,17 @@ (vector+! s4-0 (-> s3-0 start-pos) (-> s3-0 move-dist)) ) ) - (send-event (handle->process (-> obj reticle)) 'update arg0 s4-0) + (send-event (handle->process (-> this reticle)) 'update arg0 s4-0) ) - (send-event (handle->process (-> obj reticle)) 'collide-dist f30-0) + (send-event (handle->process (-> this reticle)) 'collide-dist f30-0) ) (none) ) ;; WARN: Return type mismatch collide-prim-core vs vector. -(defmethod get-trans fort-robotank-turret ((obj fort-robotank-turret) (arg0 int)) +(defmethod get-trans fort-robotank-turret ((this fort-robotank-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (the-as vector (-> obj root root-prim prim-core)) + (the-as vector (-> this root root-prim prim-core)) ) (defbehavior turret-post fort-robotank-turret () @@ -1099,9 +1099,9 @@ ) ) -(defmethod fort-robotank-turret-method-34 fort-robotank-turret ((obj fort-robotank-turret) (arg0 vector) (arg1 float)) - (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj root trans))) - (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) +(defmethod fort-robotank-turret-method-34 fort-robotank-turret ((this fort-robotank-turret) (arg0 vector) (arg1 float)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> s4-1 quad)) @@ -1124,18 +1124,18 @@ :virtual #t :event robotank-turret-handler :enter (behavior () - (set! (-> self gun-timer) (current-time)) + (set-time! (-> self gun-timer)) ) :trans (behavior () (if (logtest? (-> self flags) (robotank-turret-flags rotflags-4)) - (set! (-> self gun-timer) (current-time)) + (set-time! (-> self gun-timer)) ) (let ((gp-0 *target*)) (if (and (if (type? gp-0 process-focusable) gp-0 ) (or (not (logtest? (-> self flags) (robotank-turret-flags rotflags-9))) (check-los? (-> self los) 0)) - (>= (- (current-time) (-> self gun-timer)) (seconds 1)) + (time-elapsed? (-> self gun-timer) (seconds 1)) ) (go-virtual fire) ) @@ -1198,7 +1198,7 @@ (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) (send-event (handle->process (-> self reticle)) 'lock) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.5)) + (until (time-elapsed? gp-0 (seconds 0.5)) (suspend) ) ) @@ -1230,7 +1230,7 @@ (let ((f30-0 (rand-vu-float-range 0.05 0.43)) (s4-2 (current-time)) ) - (until (>= (- (current-time) s4-2) (the int (* 300.0 f30-0))) + (until (time-elapsed? s4-2 (the int (* 300.0 f30-0))) (suspend) ) ) @@ -1252,7 +1252,7 @@ ) (gp-3 (current-time)) ) - (until (>= (- (current-time) gp-3) (the int (* 300.0 f30-1))) + (until (time-elapsed? gp-3 (the int (* 300.0 f30-1))) (suspend) ) ) @@ -1268,7 +1268,7 @@ (send-event (handle->process (-> self reticle)) 'die) (send-event (handle->process (-> self screen)) 'die) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1278,24 +1278,24 @@ ) ) -(defmethod deactivate fort-robotank-turret ((obj fort-robotank-turret)) - (logclear! (-> obj flags) (robotank-turret-flags rotflags-6)) - (sound-stop (-> obj turn-sound-id)) - (let ((a0-4 (handle->process (-> obj screen)))) +(defmethod deactivate fort-robotank-turret ((this fort-robotank-turret)) + (logclear! (-> this flags) (robotank-turret-flags rotflags-6)) + (sound-stop (-> this turn-sound-id)) + (let ((a0-4 (handle->process (-> this screen)))) (if a0-4 (deactivate a0-4) ) ) - ((method-of-type process-focusable deactivate) obj) + ((method-of-type process-focusable deactivate) this) (none) ) ;; WARN: Return type mismatch process-focusable vs fort-robotank-turret. -(defmethod relocate fort-robotank-turret ((obj fort-robotank-turret) (arg0 int)) - (if (nonzero? (-> obj gun-elev-jmod)) - (&+! (-> obj gun-elev-jmod) arg0) +(defmethod relocate fort-robotank-turret ((this fort-robotank-turret) (arg0 int)) + (if (nonzero? (-> this gun-elev-jmod)) + (&+! (-> this gun-elev-jmod) arg0) ) - (the-as fort-robotank-turret ((method-of-type process-focusable relocate) obj arg0)) + (the-as fort-robotank-turret ((method-of-type process-focusable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. @@ -1374,7 +1374,7 @@ (set! (-> self aim-pos 0 quad) (-> self root trans quad)) (set! (-> self aim-pos-2 quad) (-> self root trans quad)) (set! (-> self aim-pos-1 quad) (-> self root trans quad)) - (set! (-> self gun-timer) (current-time)) + (set-time! (-> self gun-timer)) (set! (-> self flags) (robotank-turret-flags)) (set! (-> self fov-mult) 1.0) (set! (-> self shot-range) 204800.0) diff --git a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc index 45068097e7..18d6304ba3 100644 --- a/goal_src/jak2/levels/fortress/dump/fort-robotank.gc +++ b/goal_src/jak2/levels/fortress/dump/fort-robotank.gc @@ -289,20 +289,20 @@ :origin-joint-index 3 ) -(defmethod fort-robotank-method-25 fort-robotank ((obj fort-robotank)) +(defmethod fort-robotank-method-25 fort-robotank ((this fort-robotank)) (with-pp - (let ((v1-0 (-> obj root))) + (let ((v1-0 (-> this root))) (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) (let ((v0-0 (-> *event-queue* data (-> *event-queue* length)))) (+! (-> *event-queue* length) 1) (set! (-> v0-0 form-handle) (process->handle pp)) - (set! (-> v0-0 to-handle) (process->handle (handle->process (-> obj turret)))) + (set! (-> v0-0 to-handle) (process->handle (handle->process (-> this turret)))) (set! (-> v0-0 num-params) 4) (set! (-> v0-0 message) 'update) (set! (-> v0-0 param 0) (the-as uint (-> v1-0 trans))) (set! (-> v0-0 param 1) (the-as uint (-> v1-0 quat))) - (set! (-> v0-0 param 2) (the-as uint (-> obj node-list data 3))) - (set! (-> v0-0 param 3) (the-as uint (-> obj vibe-jmod twist))) + (set! (-> v0-0 param 2) (the-as uint (-> this node-list data 3))) + (set! (-> v0-0 param 3) (the-as uint (-> this vibe-jmod twist))) v0-0 ) ) @@ -312,9 +312,7 @@ (defbehavior fort-robotank-post fort-robotank () (when (and (nonzero? (-> self no-collision-timer)) - (>= (- (current-time) (-> self no-collision-timer)) - (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) - ) + (time-elapsed? (-> self no-collision-timer) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout))) ) (let ((v1-7 (-> self root root-prim))) (set! (-> v1-7 prim-core collide-as) (-> self root backup-collide-as)) @@ -396,9 +394,7 @@ (f1-16 (- 1.0 f0-44)) (f26-0 0.0) ) - (when (and (or (< f0-44 f24-0) (< f24-0 f1-16)) - (>= (- (current-time) (-> self buzz-timer)) (the int (* 0.5 f30-2))) - ) + (when (and (or (< f0-44 f24-0) (< f24-0 f1-16)) (time-elapsed? (-> self buzz-timer) (the int (* 0.5 f30-2)))) (let* ((gp-2 *target*) (a0-43 (if (type? gp-2 process-focusable) gp-2 @@ -417,7 +413,7 @@ (the int (* 255.0 (* 0.49 f26-0))) (the-as time-frame (max 45 (the int (* 0.25 f30-2)))) ) - (set! (-> self buzz-timer) (current-time)) + (set-time! (-> self buzz-timer)) ) ) (quaternion-axis-angle! @@ -539,7 +535,7 @@ ) ) ) - (set! (-> self no-collision-timer) (current-time)) + (set-time! (-> self no-collision-timer)) (let ((v1-45 (-> self root root-prim))) (set! (-> v1-45 prim-core collide-as) (collide-spec)) (set! (-> v1-45 prim-core collide-with) (collide-spec)) @@ -559,7 +555,7 @@ ) ) -(defmethod fort-robotank-method-26 fort-robotank ((obj fort-robotank) (arg0 int) (arg1 float) (arg2 float)) +(defmethod fort-robotank-method-26 fort-robotank ((this fort-robotank) (arg0 int) (arg1 float) (arg2 float)) (local-vars (sv-96 fort-robotank-segment-event) (sv-112 (function process-tree event-message-block object)) @@ -568,7 +564,7 @@ (with-pp (let* ((s4-0 (* 0.00001 (the float (the int (+ 0.5 (* 100000.0 arg1)))))) (s3-0 (* 0.00001 (the float (the int (+ 0.5 (* 100000.0 arg2)))))) - (s2-0 (-> obj segment-table (-> obj path-index))) + (s2-0 (-> this segment-table (-> this path-index))) (s1-0 (-> s2-0 event-tbl)) ) (dotimes (s0-0 (-> s2-0 event-count)) @@ -589,7 +585,7 @@ (('code) (let ((t9-2 (-> sv-96 param-obj))) (if t9-2 - ((the-as (function fort-robotank none) t9-2) obj) + ((the-as (function fort-robotank none) t9-2) this) ) ) ) @@ -597,13 +593,13 @@ (set-setting! 'mode-name 'cam-pov-track 0.0 0) (set-setting! 'allow-look-around #f 0.0 0) (set-setting! 'target-height 'abs (meters -3) 0) - (let ((v1-27 (process->ppointer obj))) + (let ((v1-27 (process->ppointer this))) (set-setting! 'pov-handle v1-27 3.0 (-> v1-27 0 pid)) ) - (set-setting! 'pov-offset 'asdf (-> obj pov-cam-offset) 0) - (send-event (handle->process (-> obj turret)) 'pov-cam-on) - (logior! (-> obj flags) (robotank-flags roflags-7)) - (let ((v1-41 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 2))) + (set-setting! 'pov-offset 'asdf (-> this pov-cam-offset) 0) + (send-event (handle->process (-> this turret)) 'pov-cam-on) + (logior! (-> this flags) (robotank-flags roflags-7)) + (let ((v1-41 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 2))) (set! (-> v1-41 prim-core collide-as) (collide-spec enemy pusher)) (set! (-> v1-41 prim-core collide-with) (collide-spec jak bot player-list)) ) @@ -614,9 +610,9 @@ (remove-setting! 'allow-look-around) (remove-setting! 'target-height) (remove-setting! 'pov-offset) - (send-event (handle->process (-> obj turret)) 'pov-cam-off) - (logclear! (-> obj flags) (robotank-flags roflags-7)) - (let ((v1-57 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 2))) + (send-event (handle->process (-> this turret)) 'pov-cam-off) + (logclear! (-> this flags) (robotank-flags roflags-7)) + (let ((v1-57 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 2))) (set! (-> v1-57 prim-core collide-as) (collide-spec)) (set! (-> v1-57 prim-core collide-with) (collide-spec)) ) @@ -628,14 +624,14 @@ (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (remove-setting! 'target-height) (process-grab? *target* #f) - (send-event (handle->process (-> obj turret)) 'fire-suppress #t) + (send-event (handle->process (-> this turret)) 'fire-suppress #t) ) (('external-cam-off) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (remove-setting! 'target-height) (process-release? *target*) - (send-event (handle->process (-> obj turret)) 'fire-suppress #f) + (send-event (handle->process (-> this turret)) 'fire-suppress #f) ) ) ) @@ -647,17 +643,17 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod fort-robotank-method-27 fort-robotank ((obj fort-robotank)) - (let ((s5-0 (-> obj segment-table (-> obj path-index) flags))) - (send-event (handle->process (-> obj turret)) 'use-los (if (logtest? s5-0 16) - #t - #f - ) +(defmethod fort-robotank-method-27 fort-robotank ((this fort-robotank)) + (let ((s5-0 (-> this segment-table (-> this path-index) flags))) + (send-event (handle->process (-> this turret)) 'use-los (if (logtest? s5-0 16) + #t + #f + ) ) - (send-event (handle->process (-> obj turret)) 'limit-reticle-elev (if (logtest? s5-0 32) - #t - #f - ) + (send-event (handle->process (-> this turret)) 'limit-reticle-elev (if (logtest? s5-0 32) + #t + #f + ) ) ) (none) @@ -794,7 +790,7 @@ :code (behavior () (logclear! (-> self flags) (robotank-flags roflags-2)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.1)) + (until (time-elapsed? gp-0 (seconds 0.1)) (suspend) ) ) @@ -926,7 +922,7 @@ (remove-setting! 'target-height) (send-event (handle->process (-> self turret)) 'die) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 2)) + (until (time-elapsed? gp-0 (seconds 2)) (suspend) ) ) @@ -937,54 +933,54 @@ :post pusher-post ) -(defmethod deactivate fort-robotank ((obj fort-robotank)) - (stop! (-> obj idle-sound)) - (stop! (-> obj barrel-sound)) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate fort-robotank ((this fort-robotank)) + (stop! (-> this idle-sound)) + (stop! (-> this barrel-sound)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs fort-robotank. -(defmethod relocate fort-robotank ((obj fort-robotank) (arg0 int)) - (if (nonzero? (-> obj barrel-part)) - (&+! (-> obj barrel-part) arg0) +(defmethod relocate fort-robotank ((this fort-robotank) (arg0 int)) + (if (nonzero? (-> this barrel-part)) + (&+! (-> this barrel-part) arg0) ) - (if (nonzero? (-> obj roller-jmod)) - (&+! (-> obj roller-jmod) arg0) + (if (nonzero? (-> this roller-jmod)) + (&+! (-> this roller-jmod) arg0) ) - (if (nonzero? (-> obj vibe-jmod)) - (&+! (-> obj vibe-jmod) arg0) + (if (nonzero? (-> this vibe-jmod)) + (&+! (-> this vibe-jmod) arg0) ) - (if (nonzero? (-> obj idle-sound)) - (&+! (-> obj idle-sound) arg0) + (if (nonzero? (-> this idle-sound)) + (&+! (-> this idle-sound) arg0) ) - (if (nonzero? (-> obj barrel-sound)) - (&+! (-> obj barrel-sound) arg0) + (if (nonzero? (-> this barrel-sound)) + (&+! (-> this barrel-sound) arg0) ) - (let ((v1-20 (-> obj path-info))) + (let ((v1-20 (-> this path-info))) (when (nonzero? v1-20) - (dotimes (a0-2 (-> obj path-count)) + (dotimes (a0-2 (-> this path-count)) (if (nonzero? (-> v1-20 data a0-2 path)) (&+! (-> v1-20 data a0-2 path) arg0) ) ) - (&+! (-> obj path-info) arg0) + (&+! (-> this path-info) arg0) ) ) (dotimes (v1-24 2) (dotimes (a0-4 7) (if (nonzero? (the-as joint-mod - (-> (the-as (pointer uint32) (&+ (&+ (the-as (pointer uint32) obj) (* 144 v1-24)) (* a0-4 16))) 55) + (-> (the-as (pointer uint32) (&+ (&+ (the-as (pointer uint32) this) (* 144 v1-24)) (* a0-4 16))) 55) ) ) - (set! (-> (&+ (&+ (the-as (pointer uint32) obj) (* 144 v1-24)) (* a0-4 16)) 55) + (set! (-> (&+ (&+ (the-as (pointer uint32) this) (* 144 v1-24)) (* a0-4 16)) 55) (the-as uint (&+ (the-as joint-mod - (-> (the-as (pointer uint32) (&+ (&+ (the-as (pointer uint32) obj) (* 144 v1-24)) (* a0-4 16))) 55) + (-> (the-as (pointer uint32) (&+ (&+ (the-as (pointer uint32) this) (* 144 v1-24)) (* a0-4 16))) 55) ) arg0 ) @@ -995,19 +991,19 @@ ) (the-as fort-robotank - ((the-as (function process-drawable int process-drawable) (find-parent-method fort-robotank 7)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method fort-robotank 7)) this arg0) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-robotank ((obj fort-robotank) (arg0 entity-actor)) +(defmethod init-from-entity! fort-robotank ((this fort-robotank) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1046,171 +1042,171 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-robotank" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj flags) (robotank-flags)) - (set! (-> obj no-collision-timer) 0) - (set! (-> obj engine-vibe-rate) 1.0) - (set! (-> obj buzz-timer) 0) + (set! (-> this flags) (robotank-flags)) + (set! (-> this no-collision-timer) 0) + (set! (-> this engine-vibe-rate) 1.0) + (set! (-> this buzz-timer) 0) (let* ((v1-31 *game-info*) (a0-30 (+ (-> v1-31 attack-id) 1)) ) (set! (-> v1-31 attack-id) a0-30) - (set! (-> obj attack-id) a0-30) + (set! (-> this attack-id) a0-30) ) (cond - ((name= (-> obj name) "fort-robotank-2") - (set! (-> obj segment-table) *fort-robotank-1-segment-table*) - (set! (-> obj path-count) 4) + ((name= (-> this name) "fort-robotank-2") + (set! (-> this segment-table) *fort-robotank-1-segment-table*) + (set! (-> this path-count) 4) ) - ((name= (-> obj name) "fort-robotank-6") - (set! (-> obj segment-table) *fort-robotank-2-segment-table*) - (set! (-> obj path-count) 1) + ((name= (-> this name) "fort-robotank-6") + (set! (-> this segment-table) *fort-robotank-2-segment-table*) + (set! (-> this path-count) 1) ) (else (go process-drawable-art-error "unknown actor-node name") ) ) - (set! (-> obj path-info) (new 'process 'fort-robotank-path-info-array (-> obj path-count))) - (dotimes (s5-2 (-> obj path-count)) - (let ((s4-2 (-> obj path-info data s5-2))) - (if (logtest? (-> obj segment-table s5-2 flags) 8) - (set! (-> s4-2 path) (new 'process 'curve-control obj 'path -1000000000.0)) - (set! (-> s4-2 path) (new 'process 'curve-control obj 'path (the float s5-2))) + (set! (-> this path-info) (new 'process 'fort-robotank-path-info-array (-> this path-count))) + (dotimes (s5-2 (-> this path-count)) + (let ((s4-2 (-> this path-info data s5-2))) + (if (logtest? (-> this segment-table s5-2 flags) 8) + (set! (-> s4-2 path) (new 'process 'curve-control this 'path -1000000000.0)) + (set! (-> s4-2 path) (new 'process 'curve-control this 'path (the float s5-2))) ) (logior! (-> s4-2 path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> s4-2 u) 0.0) (set! (-> s4-2 du) (-> s4-2 u)) - (set! (-> s4-2 max-speed) (* 4096.0 (-> obj segment-table s5-2 max-speed))) + (set! (-> s4-2 max-speed) (* 4096.0 (-> this segment-table s5-2 max-speed))) (set! (-> s4-2 dist) (total-distance (-> s4-2 path))) (set! (-> s4-2 start-y-angle) 0.0) (displacement-between-two-points-normalized! (-> s4-2 path) (-> s4-2 dir) 0.0) ) ) - (set! (-> obj path-index) 0) - (set! (-> obj continue-index) -1) + (set! (-> this path-index) 0) + (set! (-> this continue-index) -1) (let ((s5-3 (new 'stack-no-clear 'vector))) - (let ((s4-3 (-> obj path-info data 0 path))) - (get-point-in-path! s4-3 (-> obj root trans) 0.0 'interp) - (+! (-> obj root trans y) 1024.0) + (let ((s4-3 (-> this path-info data 0 path))) + (get-point-in-path! s4-3 (-> this root trans) 0.0 'interp) + (+! (-> this root trans y) 1024.0) (displacement-between-points-at-percent-normalized! s4-3 s5-3 0.0) ) - (set-heading-vec! (-> obj root) s5-3) + (set-heading-vec! (-> this root) s5-3) ) - (let ((a0-46 (-> obj skel root-channel 0))) - (set! (-> a0-46 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-46 (-> this skel root-channel 0))) + (set! (-> a0-46 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-46 frame-num) 0.0) - (joint-control-channel-group! a0-46 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-46 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) (let ((s5-4 (new 'stack-no-clear 'vector))) (set-vector! s5-4 0.0 12541.952 -6778.88 1.0) - (set! (-> obj turret) + (set! (-> this turret) (ppointer->handle - (process-spawn fort-robotank-turret (-> obj root trans) (-> obj root quat) s5-4 #x42000000 :to obj) + (process-spawn fort-robotank-turret (-> this root trans) (-> this root quat) s5-4 #x42000000 :to this) ) ) ) - (set! (-> obj roller-jmod) (the-as joint-mod (new 'process 'joint-mod-spinner obj 5 *x-vector* 0.0))) - (set! (-> obj roller-spin-rate) 0.0) - (set! (-> obj vibe-jmod) (the-as joint-mod (new 'process 'joint-mod-blend-local obj 4 #t))) - (set! (-> obj vibe-jmod scale y) 0.5) - (quaternion-axis-angle! (the-as quaternion (-> obj vibe-jmod twist)) 0.0 0.0 1.0 0.0) - (let ((s5-5 (-> obj tread))) - (set! (-> s5-5 0 wheel 0 jmod) (new 'process 'joint-mod-spinner obj 6 *x-vector* 0.0)) + (set! (-> this roller-jmod) (the-as joint-mod (new 'process 'joint-mod-spinner this 5 *x-vector* 0.0))) + (set! (-> this roller-spin-rate) 0.0) + (set! (-> this vibe-jmod) (the-as joint-mod (new 'process 'joint-mod-blend-local this 4 #t))) + (set! (-> this vibe-jmod scale y) 0.5) + (quaternion-axis-angle! (the-as quaternion (-> this vibe-jmod twist)) 0.0 0.0 1.0 0.0) + (let ((s5-5 (-> this tread))) + (set! (-> s5-5 0 wheel 0 jmod) (new 'process 'joint-mod-spinner this 6 *x-vector* 0.0)) (set! (-> s5-5 0 wheel 0 radius) 2048.0) ) - (let ((s5-6 (-> obj tread 0 wheel 1))) - (set! (-> s5-6 jmod) (new 'process 'joint-mod-spinner obj 7 *x-vector* 0.0)) + (let ((s5-6 (-> this tread 0 wheel 1))) + (set! (-> s5-6 jmod) (new 'process 'joint-mod-spinner this 7 *x-vector* 0.0)) (set! (-> s5-6 radius) 2048.0) ) - (let ((s5-7 (-> obj tread 0 wheel 2))) - (set! (-> s5-7 jmod) (new 'process 'joint-mod-spinner obj 8 *x-vector* 0.0)) + (let ((s5-7 (-> this tread 0 wheel 2))) + (set! (-> s5-7 jmod) (new 'process 'joint-mod-spinner this 8 *x-vector* 0.0)) (set! (-> s5-7 radius) 2048.0) ) - (let ((s5-8 (-> obj tread 0 wheel 3))) - (set! (-> s5-8 jmod) (new 'process 'joint-mod-spinner obj 9 *x-vector* 0.0)) + (let ((s5-8 (-> this tread 0 wheel 3))) + (set! (-> s5-8 jmod) (new 'process 'joint-mod-spinner this 9 *x-vector* 0.0)) (set! (-> s5-8 radius) 2048.0) ) - (let ((s5-9 (-> obj tread 0 wheel 4))) - (set! (-> s5-9 jmod) (new 'process 'joint-mod-spinner obj 10 *x-vector* 0.0)) + (let ((s5-9 (-> this tread 0 wheel 4))) + (set! (-> s5-9 jmod) (new 'process 'joint-mod-spinner this 10 *x-vector* 0.0)) (set! (-> s5-9 radius) 2048.0) ) - (let ((s5-10 (-> obj tread 0 wheel 5))) - (set! (-> s5-10 jmod) (new 'process 'joint-mod-spinner obj 11 *x-vector* 0.0)) + (let ((s5-10 (-> this tread 0 wheel 5))) + (set! (-> s5-10 jmod) (new 'process 'joint-mod-spinner this 11 *x-vector* 0.0)) (set! (-> s5-10 radius) 2048.0) ) - (let ((s5-11 (-> obj tread 0 wheel 6))) - (set! (-> s5-11 jmod) (new 'process 'joint-mod-spinner obj 12 *x-vector* 0.0)) + (let ((s5-11 (-> this tread 0 wheel 6))) + (set! (-> s5-11 jmod) (new 'process 'joint-mod-spinner this 12 *x-vector* 0.0)) (set! (-> s5-11 radius) 2048.0) ) - (let ((s5-12 (-> obj tread 1))) - (set! (-> s5-12 wheel 0 jmod) (new 'process 'joint-mod-spinner obj 13 *x-vector* 0.0)) + (let ((s5-12 (-> this tread 1))) + (set! (-> s5-12 wheel 0 jmod) (new 'process 'joint-mod-spinner this 13 *x-vector* 0.0)) (set! (-> s5-12 wheel 0 radius) 2048.0) ) - (let ((s5-13 (-> obj tread 1 wheel 1))) - (set! (-> s5-13 jmod) (new 'process 'joint-mod-spinner obj 14 *x-vector* 0.0)) + (let ((s5-13 (-> this tread 1 wheel 1))) + (set! (-> s5-13 jmod) (new 'process 'joint-mod-spinner this 14 *x-vector* 0.0)) (set! (-> s5-13 radius) 2048.0) ) - (let ((s5-14 (-> obj tread 1 wheel 2))) - (set! (-> s5-14 jmod) (new 'process 'joint-mod-spinner obj 15 *x-vector* 0.0)) + (let ((s5-14 (-> this tread 1 wheel 2))) + (set! (-> s5-14 jmod) (new 'process 'joint-mod-spinner this 15 *x-vector* 0.0)) (set! (-> s5-14 radius) 2048.0) ) - (let ((s5-15 (-> obj tread 1 wheel 3))) - (set! (-> s5-15 jmod) (new 'process 'joint-mod-spinner obj 16 *x-vector* 0.0)) + (let ((s5-15 (-> this tread 1 wheel 3))) + (set! (-> s5-15 jmod) (new 'process 'joint-mod-spinner this 16 *x-vector* 0.0)) (set! (-> s5-15 radius) 2048.0) ) - (let ((s5-16 (-> obj tread 1 wheel 4))) - (set! (-> s5-16 jmod) (new 'process 'joint-mod-spinner obj 17 *x-vector* 0.0)) + (let ((s5-16 (-> this tread 1 wheel 4))) + (set! (-> s5-16 jmod) (new 'process 'joint-mod-spinner this 17 *x-vector* 0.0)) (set! (-> s5-16 radius) 2048.0) ) - (let ((s5-17 (-> obj tread 1 wheel 5))) - (set! (-> s5-17 jmod) (new 'process 'joint-mod-spinner obj 18 *x-vector* 0.0)) + (let ((s5-17 (-> this tread 1 wheel 5))) + (set! (-> s5-17 jmod) (new 'process 'joint-mod-spinner this 18 *x-vector* 0.0)) (set! (-> s5-17 radius) 2048.0) ) - (let ((s5-18 (-> obj tread 1 wheel 6))) - (set! (-> s5-18 jmod) (new 'process 'joint-mod-spinner obj 19 *x-vector* 0.0)) + (let ((s5-18 (-> this tread 1 wheel 6))) + (set! (-> s5-18 jmod) (new 'process 'joint-mod-spinner this 19 *x-vector* 0.0)) (set! (-> s5-18 radius) 2048.0) ) - (set! (-> obj tread 0 texture) (-> *fortress-pris-texture-anim-array* array-data 0)) - (set! (-> obj tread 0 texture frame-delta) 0.0) + (set! (-> this tread 0 texture) (-> *fortress-pris-texture-anim-array* array-data 0)) + (set! (-> this tread 0 texture frame-delta) 0.0) (let ((v1-128 9)) - (set! (-> obj tread 0 locator-joint) v1-128) - (vector<-cspace! (-> obj tread 0 pos) (-> obj node-list data v1-128)) + (set! (-> this tread 0 locator-joint) v1-128) + (vector<-cspace! (-> this tread 0 pos) (-> this node-list data v1-128)) ) - (set! (-> obj tread 1 texture) (-> *fortress-pris-texture-anim-array* array-data 1)) - (set! (-> obj tread 1 texture frame-delta) 0.0) + (set! (-> this tread 1 texture) (-> *fortress-pris-texture-anim-array* array-data 1)) + (set! (-> this tread 1 texture frame-delta) 0.0) (let ((v1-135 16)) - (set! (-> obj tread 1 locator-joint) v1-135) - (vector<-cspace! (-> obj tread 1 pos) (-> obj node-list data v1-135)) + (set! (-> this tread 1 locator-joint) v1-135) + (vector<-cspace! (-> this tread 1 pos) (-> this node-list data v1-135)) ) - (set-vector! (-> obj pov-cam-offset 0) 0.0 13516.8 -13516.8 1.0) - (set-vector! (-> obj pov-cam-offset 1) 0.0 13516.8 -13516.8 1.0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 561) obj)) - (set! (-> obj barrel-part) (create-launch-control (-> *part-group-id-table* 562) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "robotank-tread" :fo-max 70) (-> obj root trans)) + (set-vector! (-> this pov-cam-offset 0) 0.0 13516.8 -13516.8 1.0) + (set-vector! (-> this pov-cam-offset 1) 0.0 13516.8 -13516.8 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 561) this)) + (set! (-> this barrel-part) (create-launch-control (-> *part-group-id-table* 562) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "robotank-tread" :fo-max 70) (-> this root trans)) ) - (set! (-> obj idle-sound) - (new 'process 'ambient-sound (static-sound-spec "robotank-idle" :fo-max 50) (-> obj root trans)) + (set! (-> this idle-sound) + (new 'process 'ambient-sound (static-sound-spec "robotank-idle" :fo-max 50) (-> this root trans)) ) - (set! (-> obj barrel-sound) - (new 'process 'ambient-sound (static-sound-spec "robotank-barrel" :fo-max 50) (-> obj root trans)) + (set! (-> this barrel-sound) + (new 'process 'ambient-sound (static-sound-spec "robotank-barrel" :fo-max 50) (-> this root trans)) ) - (update-vol! (-> obj sound) 0.0) - (update-vol! (-> obj idle-sound) 1.0) - (update-vol! (-> obj barrel-sound) 0.25) - (go (method-of-object obj idle)) + (update-vol! (-> this sound) 0.0) + (update-vol! (-> this idle-sound) 1.0) + (update-vol! (-> this barrel-sound) 0.25) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/fortress/exit/forexita-obs.gc b/goal_src/jak2/levels/fortress/exit/forexita-obs.gc index 5965a72b44..c0d9a2d3df 100644 --- a/goal_src/jak2/levels/fortress/exit/forexita-obs.gc +++ b/goal_src/jak2/levels/fortress/exit/forexita-obs.gc @@ -26,7 +26,7 @@ :bounds (static-spherem 0 -2 -8 15) ) -(defmethod get-art-group fort-lift-plat ((obj fort-lift-plat)) +(defmethod get-art-group fort-lift-plat ((this fort-lift-plat)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-fort-lift-plat" (the-as (pointer uint32) #f)) ) @@ -110,22 +110,22 @@ ) ) -(defmethod execute-effects fort-lift-plat ((obj fort-lift-plat)) +(defmethod execute-effects fort-lift-plat ((this fort-lift-plat)) "Executes various ancillary tasks with the platform, such as spawning particles or playing the associated sound" - (if (nonzero? (-> obj part)) - (spawn-with-cspace (-> obj part) (-> obj node-list data 6)) + (if (nonzero? (-> this part)) + (spawn-with-cspace (-> this part) (-> this node-list data 6)) ) - (when (nonzero? (-> obj sound)) - (set! (-> obj sound trans quad) (-> obj root trans quad)) - (update! (-> obj sound)) + (when (nonzero? (-> this sound)) + (set! (-> this sound trans quad) (-> this root trans quad)) + (update! (-> this sound)) ) (none) ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! fort-lift-plat ((obj fort-lift-plat)) +(defmethod init-plat-collision! fort-lift-plat ((this fort-lift-plat)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -181,56 +181,56 @@ (set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; WARN: Return type mismatch sparticle-launch-control vs none. -(defmethod base-plat-method-32 fort-lift-plat ((obj fort-lift-plat)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 618) obj)) +(defmethod base-plat-method-32 fort-lift-plat ((this fort-lift-plat)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 618) this)) (none) ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! fort-lift-plat ((obj fort-lift-plat)) +(defmethod init-plat! fort-lift-plat ((this fort-lift-plat)) "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." - (set! (-> obj root pause-adjust-distance) 327680.0) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this root pause-adjust-distance) 327680.0) + (set! (-> this sound-id) (new-sound-id)) (none) ) -(defmethod deactivate fort-lift-plat ((obj fort-lift-plat)) - (sound-stop (-> obj sound-id)) - ((method-of-type plat deactivate) obj) +(defmethod deactivate fort-lift-plat ((this fort-lift-plat)) + (sound-stop (-> this sound-id)) + ((method-of-type plat deactivate) this) (none) ) -(defmethod plat-path-sync fort-lift-plat ((obj fort-lift-plat)) +(defmethod plat-path-sync fort-lift-plat ((this fort-lift-plat)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @see [[sync-eased]]" (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) - (go (method-of-object obj plat-idle)) + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this plat-idle)) ) - ((logtest? (actor-option user18) (-> obj fact options)) - (set! (-> obj path-pos) (res-lump-float (-> obj entity) 'initial-spline-pos)) - (get-point-at-percent-along-path! (-> obj path) (-> obj root trans) (-> obj path-pos) 'interp) - (go (method-of-object obj plat-anim-active)) + ((logtest? (actor-option user18) (-> this fact options)) + (set! (-> this path-pos) (res-lump-float (-> this entity) 'initial-spline-pos)) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + (go (method-of-object this plat-anim-active)) ) - ((> (-> obj sync period) 0) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + ((> (-> this sync period) 0) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-identity) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity) ) - (go (method-of-object obj plat-path-active)) + (go (method-of-object this plat-path-active)) ) (else - (go (method-of-object obj plat-idle)) + (go (method-of-object this plat-idle)) ) ) ) @@ -276,10 +276,10 @@ otherwise, [[plat::34]] (defstate pause (fort-claw) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (go-virtual idle) ) ) @@ -287,32 +287,32 @@ otherwise, [[plat::34]] ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-claw ((obj fort-claw) (arg0 entity-actor)) +(defmethod init-from-entity! fort-claw ((this fort-claw) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-claw" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-u) 0.0) - (set! (-> obj path-dest) 1.0) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-u) 0.0) + (set! (-> this path-dest) 1.0) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -325,7 +325,7 @@ This commonly includes things such as: (until #f (sound-play "fortress-alarm") (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) diff --git a/goal_src/jak2/levels/fortress/fort-turret.gc b/goal_src/jak2/levels/fortress/fort-turret.gc index c2821e98df..6dfe554109 100644 --- a/goal_src/jak2/levels/fortress/fort-turret.gc +++ b/goal_src/jak2/levels/fortress/fort-turret.gc @@ -505,29 +505,29 @@ (set! (-> *fort-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod track-target! fort-turret ((obj fort-turret)) +(defmethod track-target! fort-turret ((this fort-turret)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (let ((s5-0 (-> obj root))) + (let ((s5-0 (-> this root))) (update-transforms s5-0) (pull-riders! s5-0) (do-push-aways s5-0) ) - (when (not (and (-> obj next-state) (= (-> obj next-state name) 'die))) - (let ((a0-7 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 12)))) - (fort-turret-draw-laser a0-7 (-> obj target-bullseye)) + (when (not (and (-> this next-state) (= (-> this next-state name) 'die))) + (let ((a0-7 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 12)))) + (fort-turret-draw-laser a0-7 (-> this target-bullseye)) ) - (case (-> obj beam-intersect) + (case (-> this beam-intersect) (('target) - (fort-turret-draw-laser-spot (-> obj target-bullseye) #f #t) + (fort-turret-draw-laser-spot (-> this target-bullseye) #f #t) ) (('wall) - (fort-turret-draw-laser-spot (-> obj target-bullseye) #f #f) + (fort-turret-draw-laser-spot (-> this target-bullseye) #f #f) ) ) ) @@ -535,72 +535,72 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod fort-turret-method-139 fort-turret ((obj fort-turret)) - (let ((a0-2 (handle->process (-> obj focus handle)))) +(defmethod fort-turret-method-139 fort-turret ((this fort-turret)) + (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 - (set! (-> obj aim-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + (set! (-> this aim-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) ) ) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 4))) + (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> obj aim-pos) (-> obj root trans)) - (vector-flatten! s4-0 s4-0 (-> obj init-mat vector 1)) + (vector-! s4-0 (-> this aim-pos) (-> this root trans)) + (vector-flatten! s4-0 s4-0 (-> this init-mat vector 1)) (vector-normalize! s4-0 1.0) - (set! (-> obj desired-twist) (asin (vector-dot (the-as vector (-> obj init-mat)) s4-0))) - (set! (-> obj desired-twist) (fmin 9102.223 (fmax -9102.223 (-> obj desired-twist)))) + (set! (-> this desired-twist) (asin (vector-dot (the-as vector (-> this init-mat)) s4-0))) + (set! (-> this desired-twist) (fmin 9102.223 (fmax -9102.223 (-> this desired-twist)))) (cond - ((< 0.0 (vector-dot (-> obj init-mat vector 2) s4-0)) + ((< 0.0 (vector-dot (-> this init-mat vector 2) s4-0)) ) - ((< (-> obj desired-twist) 0.0) - (set! (-> obj desired-twist) -9102.223) + ((< (-> this desired-twist) 0.0) + (set! (-> this desired-twist) -9102.223) ) (else - (set! (-> obj desired-twist) 9102.223) + (set! (-> this desired-twist) 9102.223) ) ) - (set! (-> obj desired-tilt) 0.0) - (when (< (fabs (-> obj desired-twist)) 9102.223) - (vector-normalize-copy! s3-0 (-> obj node-list data 3 bone transform vector 1) 1.0) - (vector-! s4-0 (-> obj aim-pos) s5-2) - (set! (-> obj desired-tilt) + (set! (-> this desired-tilt) 0.0) + (when (< (fabs (-> this desired-twist)) 9102.223) + (vector-normalize-copy! s3-0 (-> this node-list data 3 bone transform vector 1) 1.0) + (vector-! s4-0 (-> this aim-pos) s5-2) + (set! (-> this desired-tilt) (- (atan 8192.0 (vector-normalize-ret-len! s4-0 1.0)) (asin (vector-dot s3-0 s4-0))) ) - (set! (-> obj desired-tilt) (fmin 8192.0 (fmax -8192.0 (-> obj desired-tilt)))) + (set! (-> this desired-tilt) (fmin 8192.0 (fmax -8192.0 (-> this desired-tilt)))) ) ) (vector-normalize-copy! - (-> obj aim-pos) - (-> obj node-list data 4 bone transform vector 2) - (vector-vector-distance s5-2 (-> obj aim-pos)) + (-> this aim-pos) + (-> this node-list data 4 bone transform vector 2) + (vector-vector-distance s5-2 (-> this aim-pos)) ) ) (vector+! - (-> obj aim-pos) - (-> obj aim-pos) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7)) + (-> this aim-pos) + (-> this aim-pos) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7)) ) - (fort-turret-method-140 obj 0.3 364.0889) + (fort-turret-method-140 this 0.3 364.0889) (none) ) -(defmethod fort-turret-method-140 fort-turret ((obj fort-turret) (arg0 float) (arg1 float)) +(defmethod fort-turret-method-140 fort-turret ((this fort-turret) (arg0 float) (arg1 float)) (rider-trans) (let ((s3-0 (new 'stack-no-clear 'matrix))) - (+! (-> obj gun-twist) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> obj desired-twist) (-> obj gun-twist)))))) - (matrix-rotate-y! s3-0 (-> obj gun-twist)) - (matrix*! s3-0 s3-0 (-> obj init-mat)) - (matrix->quaternion (-> obj root quat) s3-0) + (+! (-> this gun-twist) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> this desired-twist) (-> this gun-twist)))))) + (matrix-rotate-y! s3-0 (-> this gun-twist)) + (matrix*! s3-0 s3-0 (-> this init-mat)) + (matrix->quaternion (-> this root quat) s3-0) ) - (+! (-> obj gun-tilt) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> obj desired-tilt) (-> obj gun-tilt)))))) - (quaternion-axis-angle! (-> obj gun-tilt-jm quat) 1.0 0.0 0.0 (-> obj gun-tilt)) + (+! (-> this gun-tilt) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> this desired-tilt) (-> this gun-tilt)))))) + (quaternion-axis-angle! (-> this gun-tilt-jm quat) 1.0 0.0 0.0 (-> this gun-tilt)) ) -(defmethod fort-turret-method-141 fort-turret ((obj fort-turret)) - (let* ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 12))) +(defmethod fort-turret-method-141 fort-turret ((this fort-turret)) + (let* ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 12))) (v1-3 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 12 bone transform vector 2) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 12 bone transform vector 2) 1.0) ) (s4-1 (vector-float*! (new 'stack-no-clear 'vector) v1-3 163840.0)) ) @@ -612,7 +612,7 @@ (set! (-> v1-6 collide-with) (collide-spec backgnd jak crate obstacle hit-by-player-list hit-by-others-list player-list pusher) ) - (set! (-> v1-6 ignore-process0) obj) + (set! (-> v1-6 ignore-process0) this) (set! (-> v1-6 ignore-process1) #f) (set! (-> v1-6 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-6 action-mask) (collide-action solid)) @@ -620,7 +620,7 @@ (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* s3-0))) (cond ((>= f30-0 0.0) - (set! (-> obj beam-intersect) (the-as basic 'wall)) + (set! (-> this beam-intersect) (the-as basic 'wall)) (when (-> s3-0 best-other-tri collide-ptr) (let* ((s3-1 (-> s3-0 best-other-tri collide-ptr)) (a0-14 (if (type? s3-1 collide-shape-prim) @@ -630,50 +630,50 @@ ) (when a0-14 (when (= (-> a0-14 cshape process type) target) - (set! (-> obj target-timeout) (the-as uint (current-time))) - (set! (-> obj beam-intersect) (the-as basic 'target)) + (set! (-> this target-timeout) (the-as uint (current-time))) + (set! (-> this beam-intersect) (the-as basic 'target)) ) ) ) ) (vector-float*! s4-1 s4-1 f30-0) (let ((s3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 s4-1)) - (a0-21 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 10))) - (v1-23 (-> obj gun-shadow-jm twist-max)) + (a0-21 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 10))) + (v1-23 (-> this gun-shadow-jm twist-max)) ) (set! (-> v1-23 z) (+ 2.0 (* 0.00024414062 (vector-length (vector-! (new 'stack-no-clear 'vector) s3-3 a0-21)))) ) - (if (= (-> obj beam-intersect) 'wall) + (if (= (-> this beam-intersect) 'wall) (+! (-> v1-23 z) -5.0) ) ) ) (else - (set! (-> obj beam-intersect) (the-as basic 'nothing)) + (set! (-> this beam-intersect) (the-as basic 'nothing)) ) ) ) ) - (vector+! (-> obj target-bullseye) s5-0 s4-1) + (vector+! (-> this target-bullseye) s5-0 s4-1) ) ) -(defmethod fort-turret-method-142 fort-turret ((obj fort-turret) (arg0 symbol) (arg1 int)) - (let ((v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg1))) +(defmethod fort-turret-method-142 fort-turret ((this fort-turret) (arg0 symbol) (arg1 int)) + (let ((v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1))) (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj aim-pos) v1-2)) + (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this aim-pos) v1-2)) (f30-0 (/ 2013265900.0 (vector-length s2-1))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 ent) (-> obj entity)) + (set! (-> s4-0 ent) (-> this entity)) (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options)) (set! (-> s4-0 pos quad) (-> v1-2 quad)) - (set! (-> s4-0 notify-handle) (process->handle obj)) + (set! (-> s4-0 notify-handle) (process->handle this)) (set! (-> s4-0 owner-handle) (the-as handle #f)) - (set! (-> s4-0 ignore-handle) (process->handle obj)) + (set! (-> s4-0 ignore-handle) (process->handle this)) (let* ((v1-10 *game-info*) (a0-18 (+ (-> v1-10 attack-id) 1)) ) @@ -691,14 +691,14 @@ ) (vector+! (-> s4-0 vel) (-> s4-0 vel) s3-0) ) - (spawn-projectile guard-shot s4-0 obj *default-dead-pool*) + (spawn-projectile guard-shot s4-0 this *default-dead-pool*) ) (sound-play "turret-shot") (if arg0 (sound-play "gtur-shot-fire") ) (let ((v0-11 #t)) - (set! (-> obj flash-state) (the-as basic v0-11)) + (set! (-> this flash-state) (the-as basic v0-11)) v0-11 ) ) @@ -713,15 +713,15 @@ (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (>= 2 (the-as int (-> self focus aware))) (go-stare self) ) ) (set! (-> self root penetrated-by) (get-penetrate-info self)) (fort-turret-method-141 self) - (if (or (>= (- (current-time) (the-as int (-> self target-timeout))) (seconds 0.5)) - (< (- (current-time) (-> self last-hit-time)) (seconds 2)) + (if (or (time-elapsed? (the-as int (-> self target-timeout)) (seconds 0.5)) + (not (time-elapsed? (-> self last-hit-time) (seconds 2))) ) (go-virtual hostile) ) @@ -735,7 +735,7 @@ (ja :num! (seek!)) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (suspend) ) ) @@ -756,7 +756,7 @@ (ja :num! (seek!)) ) (let ((s4-1 (current-time))) - (until (>= (- (current-time) s4-1) (seconds 0.33)) + (until (time-elapsed? s4-1 (seconds 0.33)) (suspend) ) ) @@ -768,7 +768,7 @@ ) (set! (-> self flash-state) #f) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 1.5)) + (until (time-elapsed? gp-3 (seconds 1.5)) (suspend) ) ) @@ -788,13 +788,13 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (>= 2 (the-as int (-> self focus aware))) (go-stare self) ) @@ -803,8 +803,8 @@ (set! (-> self desired-twist) (* 8192.0 (cos (get-scaled-val! (-> self sync) 32768.0 0)))) (fort-turret-method-140 self 0.1 91.022224) (fort-turret-method-141 self) - (if (and (< (- (current-time) (the-as int (-> self target-timeout))) (seconds 0.5)) - (>= (- (current-time) (-> self last-hit-time)) (seconds 2)) + (if (and (not (time-elapsed? (the-as int (-> self target-timeout)) (seconds 0.5))) + (time-elapsed? (-> self last-hit-time) (seconds 2)) ) (go-virtual attack) ) @@ -832,15 +832,15 @@ (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (>= 2 (the-as int (-> self focus aware))) (go-stare self) ) ) (set! (-> self root penetrated-by) (get-penetrate-info self)) (fort-turret-method-141 self) - (if (and (< (- (current-time) (the-as int (-> self target-timeout))) (seconds 0.5)) - (>= (- (current-time) (-> self last-hit-time)) (seconds 2)) + (if (and (not (time-elapsed? (the-as int (-> self target-timeout)) (seconds 0.5))) + (time-elapsed? (-> self last-hit-time) (seconds 2)) ) (go-virtual attack) ) @@ -855,21 +855,21 @@ ) ) -(defmethod general-event-handler fort-turret ((obj fort-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler fort-turret ((this fort-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (if (and (= arg2 'notify) (< 1 arg1) (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) - (set! (-> obj last-hit-time) (current-time)) + (set-time! (-> this last-hit-time)) ) (case arg2 (('start) (let ((v0-0 (the-as object #t))) - (set! (-> obj can-shoot) (the-as symbol v0-0)) + (set! (-> this can-shoot) (the-as symbol v0-0)) v0-0 ) ) (('stop) - (set! (-> obj can-shoot) #f) + (set! (-> this can-shoot) #f) #f ) (('attack) @@ -877,16 +877,16 @@ ((= (-> arg0 type) target) #f ) - ((-> obj invincible) + ((-> this invincible) #f ) (else - ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -921,13 +921,13 @@ (let ((gp-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4))) (s5-2 (current-time)) ) - (until (>= (- (current-time) s5-2) (seconds 2)) + (until (time-elapsed? s5-2 (seconds 2)) (spawn (-> self part) gp-2) (suspend) ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 1)) + (until (time-elapsed? gp-3 (seconds 1)) (suspend) ) ) @@ -942,22 +942,22 @@ ) ) -(defmethod coin-flip? fort-turret ((obj fort-turret)) +(defmethod coin-flip? fort-turret ((this fort-turret)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch int vs penetrate. -(defmethod get-penetrate-info fort-turret ((obj fort-turret)) +(defmethod get-penetrate-info fort-turret ((this fort-turret)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (the-as penetrate 0) ) -(defmethod init-enemy-collision! fort-turret ((obj fort-turret)) +(defmethod init-enemy-collision! fort-turret ((this fort-turret)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (stack-size-set! (-> obj main-thread) 512) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1000,50 +1000,50 @@ (set! (-> s5-0 backup-collide-as) (-> v1-24 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch enemy vs fort-turret. -(defmethod relocate fort-turret ((obj fort-turret) (arg0 int)) - (if (nonzero? (-> obj gun-tilt-jm)) - (&+! (-> obj gun-tilt-jm) arg0) +(defmethod relocate fort-turret ((this fort-turret) (arg0 int)) + (if (nonzero? (-> this gun-tilt-jm)) + (&+! (-> this gun-tilt-jm) arg0) ) - (if (nonzero? (-> obj gun-shadow-jm)) - (&+! (-> obj gun-shadow-jm) arg0) + (if (nonzero? (-> this gun-shadow-jm)) + (&+! (-> this gun-shadow-jm) arg0) ) - (the-as fort-turret ((method-of-type enemy relocate) obj arg0)) + (the-as fort-turret ((method-of-type enemy relocate) this arg0)) ) -(defmethod init-enemy! fort-turret ((obj fort-turret)) +(defmethod init-enemy! fort-turret ((this fort-turret)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-turret" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *fort-turret-enemy-info*) - (set! (-> obj invincible) #f) - (if (logtest? (the-as int (res-lump-value (-> obj entity) 'enemy-options uint128 :time -1000000000.0)) 1) - (set! (-> obj invincible) #t) + (init-enemy-behaviour-and-stats! this *fort-turret-enemy-info*) + (set! (-> this invincible) #f) + (if (logtest? (the-as int (res-lump-value (-> this entity) 'enemy-options uint128 :time -1000000000.0)) 1) + (set! (-> this invincible) #t) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 685) obj)) - (set! (-> obj gun-tilt-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4)) - (set! (-> obj gun-shadow-jm) (the-as joint-mod (new 'process 'joint-mod-set-local obj 10 #f #f #t))) - (set! (-> obj gun-shadow-jm twist-min-y) (the-as float #t)) - (set! (-> obj los-clear) #f) - (set! (-> obj gun-twist) 0.0) - (set! (-> obj gun-tilt) 0.0) - (set! (-> obj desired-twist) 0.0) - (set! (-> obj desired-tilt) 0.0) - (set! (-> obj flash-state) #f) - (set! (-> obj can-shoot) #t) - (set! (-> obj last-hit-time) 0) - (set! (-> obj target-timeout) (the-as uint 0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 685) this)) + (set! (-> this gun-tilt-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) + (set! (-> this gun-shadow-jm) (the-as joint-mod (new 'process 'joint-mod-set-local this 10 #f #f #t))) + (set! (-> this gun-shadow-jm twist-min-y) (the-as float #t)) + (set! (-> this los-clear) #f) + (set! (-> this gun-twist) 0.0) + (set! (-> this gun-tilt) 0.0) + (set! (-> this desired-twist) 0.0) + (set! (-> this desired-tilt) 0.0) + (set! (-> this flash-state) #f) + (set! (-> this can-shoot) #t) + (set! (-> this last-hit-time) 0) + (set! (-> this target-timeout) (the-as uint 0)) (let ((a1-7 (new 'stack-no-clear 'sync-info-params))) (let ((v1-21 0)) (if #t @@ -1052,14 +1052,14 @@ (set! (-> a1-7 sync-type) 'sync-linear) (set! (-> a1-7 sync-flags) (the-as sync-flags v1-21)) ) - (set! (-> a1-7 entity) (-> obj entity)) + (set! (-> a1-7 entity) (-> this entity)) (set! (-> a1-7 period) (the-as uint 3000)) (set! (-> a1-7 percent) 0.0) - (initialize! (-> obj sync) a1-7) + (initialize! (-> this sync) a1-7) ) - (set! (-> obj flash-index) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0)) - (quaternion->matrix (-> obj init-mat) (-> obj root quat)) - (set-vector! (-> obj gun-shadow-jm twist-max) 2.0 1.0 10.0 1.0) + (set! (-> this flash-index) (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0)) + (quaternion->matrix (-> this init-mat) (-> this root quat)) + (set-vector! (-> this gun-shadow-jm twist-max) 2.0 1.0 10.0 1.0) (let ((v1-32 (new 'static 'shadow-control :settings (new 'static 'shadow-settings :flags (shadow-flags shdf02 shdf03 shdf04 shdf07) :shadow-dir (new 'static 'vector :y -1.0 :w -983040.0) @@ -1072,7 +1072,7 @@ ) (-> v1-32 settings) (set! (-> v1-32 settings shadow-type) 1) - (set! (-> obj draw shadow-ctrl) v1-32) + (set! (-> this draw shadow-ctrl) v1-32) ) 0 (none) diff --git a/goal_src/jak2/levels/fortress/fortress-obs.gc b/goal_src/jak2/levels/fortress/fortress-obs.gc index e20ba73b51..8c3181ea23 100644 --- a/goal_src/jak2/levels/fortress/fortress-obs.gc +++ b/goal_src/jak2/levels/fortress/fortress-obs.gc @@ -132,7 +132,7 @@ (suspend) (ja-channel-set! 0) (let ((frame-counter (current-time))) - (until (>= (- (current-time) frame-counter) (seconds 1)) + (until (time-elapsed? frame-counter (seconds 1)) (suspend) ) ) @@ -146,14 +146,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-trap-door ((obj fort-trap-door) (entity entity-actor)) +(defmethod init-from-entity! fort-trap-door ((this fort-trap-door) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak bot player-list)) @@ -168,27 +168,27 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving cshape)) + (set! (-> this root) (the-as collide-shape-moving cshape)) ) - (set! (-> (the-as collide-shape-moving (-> obj root)) penetrated-by) (penetrate flop)) - (process-drawable-from-entity! obj entity) + (set! (-> (the-as collide-shape-moving (-> this root)) penetrated-by) (penetrate flop)) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-trap-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj notify-actor) (entity-actor-lookup entity 'alt-actor 0)) - (let ((channel (-> obj skel root-channel 0))) - (set! (-> channel frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> this notify-actor) (entity-actor-lookup entity 'alt-actor 0)) + (let ((channel (-> this skel root-channel 0))) + (set! (-> channel frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> channel frame-num) 0.0) (joint-control-channel-group! channel - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -215,14 +215,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-fortress ((obj water-anim-fortress)) +(defmethod init-water! water-anim-fortress ((this water-anim-fortress)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((parent-method (method-of-type water-anim init-water!))) - (parent-method obj) + (parent-method this) ) (let ((ripple (new 'process 'ripple-control))) - (set! (-> obj draw ripple) ripple) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) ripple) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> ripple global-scale) 3072.0) (set! (-> ripple close-fade-dist) 163840.0) (set! (-> ripple far-fade-dist) 245760.0) diff --git a/goal_src/jak2/levels/fortress/prison/prison-obs.gc b/goal_src/jak2/levels/fortress/prison/prison-obs.gc index f0681b783a..733a72aba3 100644 --- a/goal_src/jak2/levels/fortress/prison/prison-obs.gc +++ b/goal_src/jak2/levels/fortress/prison/prison-obs.gc @@ -228,7 +228,7 @@ (defstate idle (prsn-hang-cell) :virtual #t :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let* ((f0-2 (* (/ 1.0 (-> self path-du)) (-> self path-u))) (f0-3 (- f0-2 (* (the float (the int (/ f0-2 1.0))) 1.0))) ) @@ -244,7 +244,7 @@ (seek! (-> self path-u) 1.0 (* (-> self path-du) (seconds-per-frame))) (when (>= (-> self path-u) 1.0) (set! (-> self path-u) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-u) 'interp) (ja-post) @@ -252,30 +252,30 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-hang-cell ((obj prsn-hang-cell) (arg0 entity-actor)) +(defmethod init-from-entity! prsn-hang-cell ((this prsn-hang-cell) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-hang-cell" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-du) 0.01) - (let ((f0-2 (* 300.0 (/ 1.0 (-> obj path-du)))) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-du) 0.01) + (let ((f0-2 (* 300.0 (/ 1.0 (-> this path-du)))) (f1-3 (the float (current-time))) ) - (set! (-> obj path-u) (/ (- f1-3 (* (the float (the int (/ f1-3 f0-2))) f0-2)) f0-2)) + (set! (-> this path-u) (/ (- f1-3 (* (the float (the int (/ f1-3 f0-2))) f0-2)) f0-2)) ) - (let* ((f30-0 (-> obj path-u)) + (let* ((f30-0 (-> this path-u)) (f28-0 8.0) (f26-0 (/ 1.0 f28-0)) ) @@ -287,11 +287,11 @@ This commonly includes things such as: (+ -1.0 f30-0) f30-0 ) - :to obj + :to this ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -329,8 +329,8 @@ This commonly includes things such as: ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide warp-gate-b ((obj warp-gate-b)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-skel-and-collide warp-gate-b ((this warp-gate-b)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -345,10 +345,10 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-warp-gate-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -409,14 +409,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-cell-door ((obj prsn-cell-door) (arg0 entity-actor)) +(defmethod init-from-entity! prsn-cell-door ((this prsn-cell-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -431,18 +431,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-cell-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj frame) 0.0) - (set! (-> obj desired) 0.0) - (set! (-> obj draw light-index) (the-as uint 10)) - (go (method-of-object obj idle)) + (set! (-> this frame) 0.0) + (set! (-> this desired) 0.0) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) (none) ) @@ -480,22 +480,22 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-vent-fan ((obj prsn-vent-fan) (arg0 entity-actor)) +(defmethod init-from-entity! prsn-vent-fan ((this prsn-vent-fan) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-vent-fan" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) (none) ) @@ -530,14 +530,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-torture ((obj prsn-torture) (arg0 entity-actor)) +(defmethod init-from-entity! prsn-torture ((this prsn-torture) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s4-0 total-prims) (the-as uint 10)) @@ -617,16 +617,16 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-30 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-30 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-torture" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc index 7a35e8b99c..204254c71d 100644 --- a/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forresca-obs.gc @@ -55,29 +55,29 @@ :code sleep-code ) -(defmethod basebutton-method-33 fort-elec-button ((obj fort-elec-button)) +(defmethod basebutton-method-33 fort-elec-button ((this fort-elec-button)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-elec-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) (cond - ((-> obj start-up?) - (let ((a0-4 (-> obj skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + ((-> this start-up?) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-4 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) ) (else - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) ) ) @@ -86,31 +86,31 @@ ) ;; WARN: Return type mismatch process-mask vs none. -(defmethod prepare-trigger-event! fort-elec-button ((obj fort-elec-button)) +(defmethod prepare-trigger-event! fort-elec-button ((this fort-elec-button)) "Sets `event-going-down` to `'trigger`" - (set! (-> obj start-up?) (= 1 (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0))) - (set! (-> obj event-going-down) 'trigger) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this start-up?) (= 1 (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0))) + (set! (-> this event-going-down) 'trigger) + (process-entity-status! this (entity-perm-status no-kill) #t) + (logclear! (-> this mask) (process-mask actor-pause)) (none) ) -(defmethod idle-state-transition fort-elec-button ((obj fort-elec-button)) +(defmethod idle-state-transition fort-elec-button ((this fort-elec-button)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" (cond - ((-> obj start-up?) - (let ((s5-0 (-> obj skel root-channel 0))) + ((-> this start-up?) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) - (go (method-of-object obj up-idle)) + (go (method-of-object this up-idle)) ) (else - (go (method-of-object obj waiting)) + (go (method-of-object this waiting)) ) ) ) @@ -167,26 +167,26 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-led ((obj fort-led) (arg0 entity-actor)) +(defmethod init-from-entity! fort-led ((this fort-led) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-led" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj button-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (if (and (-> obj button-actor) - (logtest? (-> obj button-actor extra perm status) (entity-perm-status subtask-complete)) + (set! (-> this button-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (if (and (-> this button-actor) + (logtest? (-> this button-actor extra perm status) (entity-perm-status subtask-complete)) ) - (go (method-of-object obj green)) - (go (method-of-object obj red)) + (go (method-of-object this green)) + (go (method-of-object this red)) ) (none) ) @@ -231,7 +231,7 @@ This commonly includes things such as: (when (and a0-0 (< 81920.0 (vector-vector-distance (get-trans a0-0 0) (-> self root trans)))) (set! (-> self quality-enabled?) #f) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (suspend) ) ) @@ -240,7 +240,7 @@ This commonly includes things such as: (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 2)) + (until (time-elapsed? gp-2 (seconds 2)) (suspend) ) ) @@ -337,7 +337,7 @@ This commonly includes things such as: :code (behavior () (until (-> self all-gone?) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.5)) + (until (time-elapsed? gp-0 (seconds 0.5)) (suspend) ) ) @@ -354,10 +354,10 @@ This commonly includes things such as: ) ) -(defmethod elec-lock-gate-method-31 elec-lock-gate ((obj elec-lock-gate) (arg0 symbol)) - (dotimes (v1-0 (-> obj actor-group-count)) - (dotimes (a2-0 (-> obj actor-group v1-0 length)) - (when (or (not arg0) (let ((a3-5 (-> obj actor-group v1-0 data a2-0 actor))) +(defmethod elec-lock-gate-method-31 elec-lock-gate ((this elec-lock-gate) (arg0 symbol)) + (dotimes (v1-0 (-> this actor-group-count)) + (dotimes (a2-0 (-> this actor-group v1-0 length)) + (when (or (not arg0) (let ((a3-5 (-> this actor-group v1-0 data a2-0 actor))) (!= (if a3-5 (-> a3-5 extra process) ) @@ -365,7 +365,7 @@ This commonly includes things such as: ) ) ) - (if (not (logtest? (-> obj actor-group v1-0 data a2-0 actor extra perm status) (entity-perm-status subtask-complete)) + (if (not (logtest? (-> this actor-group v1-0 data a2-0 actor extra perm status) (entity-perm-status subtask-complete)) ) (return #f) ) @@ -376,35 +376,35 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod set-state! elec-lock-gate ((obj elec-lock-gate)) +(defmethod set-state! elec-lock-gate ((this elec-lock-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. Otherwise, the gate will be `active`." - (if (elec-lock-gate-method-31 obj #f) - (go (method-of-object obj shutdown)) - ((method-of-type fort-elec-gate set-state!) obj) + (if (elec-lock-gate-method-31 this #f) + (go (method-of-object this shutdown)) + ((method-of-type fort-elec-gate set-state!) this) ) (none) ) -(defmethod set-palette! elec-lock-gate ((obj elec-lock-gate)) +(defmethod set-palette! elec-lock-gate ((this elec-lock-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" (local-vars (sv-16 res-tag)) (let ((t9-0 (method-of-type fort-elec-gate set-palette!))) - (t9-0 obj) + (t9-0 this) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-4 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-4 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-4 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-4)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-4)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) diff --git a/goal_src/jak2/levels/fortress/rescue/forresca-part.gc b/goal_src/jak2/levels/fortress/rescue/forresca-part.gc index a52e1296d3..7409b179e6 100644 --- a/goal_src/jak2/levels/fortress/rescue/forresca-part.gc +++ b/goal_src/jak2/levels/fortress/rescue/forresca-part.gc @@ -1469,9 +1469,9 @@ ) ) -(defmethod elec-gate-method-24 fort-elec-gate ((obj fort-elec-gate)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 653) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 654) obj)) +(defmethod elec-gate-method-24 fort-elec-gate ((this fort-elec-gate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 653) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 654) this)) 0 (none) ) diff --git a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc index 017ba9d3b9..8fc4d09021 100644 --- a/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc +++ b/goal_src/jak2/levels/fortress/rescue/forrescb-obs.gc @@ -39,14 +39,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-twist-rail ((obj fort-twist-rail) (arg0 entity-actor)) +(defmethod init-from-entity! fort-twist-rail ((this fort-twist-rail) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -81,15 +81,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-twist-rail" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) + (quaternion-copy! (-> this init-quat) (-> this root quat)) (let ((a1-14 (new 'stack-no-clear 'sync-info-params))) (let ((v1-26 0)) (if #t @@ -99,21 +99,21 @@ This commonly includes things such as: (set! (-> a1-14 sync-flags) (the-as sync-flags v1-26)) ) (set! (-> a1-14 period) (the-as uint 900)) - (set! (-> a1-14 entity) (-> obj entity)) + (set! (-> a1-14 entity) (-> this entity)) (set! (-> a1-14 percent) 0.0) (set! (-> a1-14 ease-in) 0.15) (set! (-> a1-14 ease-out) 0.15) (set! (-> a1-14 pause-in) 0.0) (set! (-> a1-14 pause-out) 0.0) - (initialize! (-> obj sync) a1-14) + (initialize! (-> this sync) a1-14) ) - (let ((a0-29 (-> obj skel root-channel 0))) - (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-29 (-> this skel root-channel 0))) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-29 frame-num) 0.0) - (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -382,16 +382,16 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs fort-elec-belt-inst. -(defmethod relocate fort-elec-belt-inst ((obj fort-elec-belt-inst) (arg0 int)) - (if (nonzero? (-> obj l-bolt)) - (&+! (-> obj l-bolt) arg0) +(defmethod relocate fort-elec-belt-inst ((this fort-elec-belt-inst) (arg0 int)) + (if (nonzero? (-> this l-bolt)) + (&+! (-> this l-bolt) arg0) ) - (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) obj arg0)) + (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate fort-elec-belt-inst ((obj fort-elec-belt-inst)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method fort-elec-belt-inst 10)) obj) +(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) (none) ) @@ -491,9 +491,9 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch symbol vs none. -(defmethod fort-elec-belt-method-15 fort-elec-belt ((obj fort-elec-belt)) - (let* ((f28-0 (total-distance (-> obj path))) - (s5-0 (-> obj sync)) +(defmethod fort-elec-belt-method-15 fort-elec-belt ((this fort-elec-belt)) + (let* ((f28-0 (total-distance (-> this path))) + (s5-0 (-> this sync)) (f26-0 81.92) (a0-3 (- (current-time) (get-timeframe-offset! s5-0 0))) (v1-6 (-> s5-0 period)) @@ -504,12 +504,12 @@ This commonly includes things such as: (if (>= f30-0 0.0) (process-spawn fort-elec-belt-inst - (-> obj init-quat) + (-> this init-quat) f30-0 - (-> obj path-du) - (-> obj l-spec) - (-> obj attack-id) - :to obj + (-> this path-du) + (-> this l-spec) + (-> this attack-id) + :to this ) ) (+! f30-0 f28-1) @@ -519,15 +519,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process vs fort-elec-belt. -(defmethod relocate fort-elec-belt ((obj fort-elec-belt) (arg0 int)) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) +(defmethod relocate fort-elec-belt ((this fort-elec-belt) (arg0 int)) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - (the-as fort-elec-belt ((method-of-type process relocate) obj arg0)) + (the-as fort-elec-belt ((method-of-type process relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-elec-belt ((obj fort-elec-belt) (arg0 entity-actor)) +(defmethod init-from-entity! fort-elec-belt ((this fort-elec-belt) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -535,7 +535,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-64 int)) - (quaternion-copy! (-> obj init-quat) (-> arg0 quat)) + (quaternion-copy! (-> this init-quat) (-> arg0 quat)) (let ((s5-0 (new 'stack-no-clear 'sync-info-params))) (let ((s3-0 1200)) 0.0 @@ -557,41 +557,41 @@ This commonly includes things such as: (set! (-> s5-0 period) (the-as uint s3-0)) ) (set! (-> s5-0 percent) 0.0) - (initialize! (-> obj sync) s5-0) + (initialize! (-> this sync) s5-0) ) - (set! (-> obj l-spec) (new 'static 'lightning-spec - :name #f - :flags (lightning-spec-flags lsf2) - :rand-func #x2 - :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) - :end-color (new 'static 'rgba :a #x80) - :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) - :fade-start-factor 0.2 - :fade-time 120.0 - :texture (new 'static 'texture-id :index #x83 :page #xc) - :reduction 0.72 - :num-points 17 - :box-size 4997.12 - :merge-factor 0.32 - :merge-count 2 - :radius 7372.8 - :duration -1.0 - :sound #f - ) + (set! (-> this l-spec) (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :rand-func #x2 + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.72 + :num-points 17 + :box-size 4997.12 + :merge-factor 0.32 + :merge-count 2 + :radius 7372.8 + :duration -1.0 + :sound #f + ) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-du) (/ 24576.0 (total-distance (-> obj path)))) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-du) (/ 24576.0 (total-distance (-> this path)))) (let* ((v1-14 *game-info*) (a0-15 (+ (-> v1-14 attack-id) 1)) ) (set! (-> v1-14 attack-id) a0-15) - (set! (-> obj attack-id) a0-15) + (set! (-> this attack-id) a0-15) ) - (fort-elec-belt-method-15 obj) - (set! (-> obj next-spawn-time) (get-timeframe-offset! (-> obj sync) 0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj idle)) + (fort-elec-belt-method-15 this) + (set! (-> this next-spawn-time) (get-timeframe-offset! (-> this sync) 0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) (none) ) @@ -609,15 +609,15 @@ This commonly includes things such as: :bounds (static-spherem 0 0 16 16.5) ) -(defmethod get-art-group fort-conveyor ((obj fort-conveyor)) +(defmethod get-art-group fort-conveyor ((this fort-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! fort-conveyor ((obj fort-conveyor)) +(defmethod reset-root! fort-conveyor ((this fort-conveyor)) "Re-initializes the `root` [[trsqv]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -638,33 +638,33 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; WARN: Return type mismatch vector vs none. -(defmethod init! fort-conveyor ((obj fort-conveyor)) +(defmethod init! fort-conveyor ((this fort-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj speed) -47104.0) - (set! (-> obj belt-radius) 24576.0) - (set! (-> obj pull-y-threshold) 4096.0) - (if (name= (-> obj name) "fort-conveyor-4") - (set-vector! (-> obj root scale) 0.8 0.0 0.657 1.0) + (set! (-> this speed) -47104.0) + (set! (-> this belt-radius) 24576.0) + (set! (-> this pull-y-threshold) 4096.0) + (if (name= (-> this name) "fort-conveyor-4") + (set-vector! (-> this root scale) 0.8 0.0 0.657 1.0) ) (none) ) -(defmethod set-and-get-ambient-sound! fort-conveyor ((obj fort-conveyor)) +(defmethod set-and-get-ambient-sound! fort-conveyor ((this fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" - (let* ((s5-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp)) - (v1-2 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 1.0 'interp)) + (let* ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-2 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 1.0 'interp)) (a3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 v1-2)) ) (vector-float*! a3-3 a3-3 0.5) (let ((v0-2 (new 'process 'ambient-sound (static-sound-spec "fort-conveyor" :fo-max 50) a3-3))) - (set! (-> obj sound) v0-2) + (set! (-> this sound) v0-2) v0-2 ) ) diff --git a/goal_src/jak2/levels/gungame/gun-dummy.gc b/goal_src/jak2/levels/gungame/gun-dummy.gc index 2eb4879de2..2b59594be9 100644 --- a/goal_src/jak2/levels/gungame/gun-dummy.gc +++ b/goal_src/jak2/levels/gungame/gun-dummy.gc @@ -1890,16 +1890,16 @@ ) ) -(defmethod break-dummy gun-dummy ((obj gun-dummy)) +(defmethod break-dummy gun-dummy ((this gun-dummy)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" 0 (none) ) -(defmethod path-time-elapsed gun-dummy ((obj gun-dummy)) +(defmethod path-time-elapsed gun-dummy ((this gun-dummy)) "@returns Calculates the combined total time across all control frames in the path" (let ((total-time 0.0)) - (let ((curr-frame (the-as tpath-control-frame (-> obj current)))) + (let ((curr-frame (the-as tpath-control-frame (-> this current)))) (loop (case (-> curr-frame command) (((tpath-command begin)) @@ -1935,7 +1935,7 @@ ) ) -(defmethod path-playing? gun-dummy ((obj gun-dummy)) +(defmethod path-playing? gun-dummy ((this gun-dummy)) "Core functionality for playing back the dummy's path. Does things like: - calculates the score in case the dummy is hit based on the time elapsed - moves around the dummy @@ -1953,31 +1953,31 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((curr-path-command (-> obj current)) + (let ((curr-path-command (-> this current)) (event-msg-block (new 'stack-no-clear 'event-message-block)) ) (set! (-> event-msg-block from) (process->ppointer pp)) (set! (-> event-msg-block num-params) 1) (set! (-> event-msg-block message) 'path) - (set! (-> event-msg-block param 0) (-> obj path-num)) - (let ((path (the-as path-control (send-event-function (handle->process (-> obj train-man)) event-msg-block))) - (f30-0 (* 0.0033333334 (the float (- (current-time) (-> obj state-time))))) + (set! (-> event-msg-block param 0) (-> this path-num)) + (let ((path (the-as path-control (send-event-function (handle->process (-> this train-man)) event-msg-block))) + (f30-0 (* 0.0033333334 (the float (- (current-time) (-> this state-time))))) ) (if (not path) (return #f) ) (case (-> curr-path-command 0 command) (((tpath-command arise)) - (set! (-> obj path-pos) (* 0.007843138 (the float (-> curr-path-command 0 path-pos)))) - (get-point-in-path! path (-> obj root trans) (-> obj path-pos) 'interp) - (+! (-> obj root trans y) (lerp-scale -16384.0 0.0 f30-0 0.0 (-> curr-path-command 0 time))) - (let* ((s3-0 (get-point-in-path! path (new 'stack-no-clear 'vector) (-> obj path-pos) 'interp)) + (set! (-> this path-pos) (* 0.007843138 (the float (-> curr-path-command 0 path-pos)))) + (get-point-in-path! path (-> this root trans) (-> this path-pos) 'interp) + (+! (-> this root trans y) (lerp-scale -16384.0 0.0 f30-0 0.0 (-> curr-path-command 0 time))) + (let* ((s3-0 (get-point-in-path! path (new 'stack-no-clear 'vector) (-> this path-pos) 'interp)) (v1-26 (get-point-in-path! path (new 'stack-no-clear 'vector) - (if (< (-> obj path-pos) 0.01) - (+ 0.1 (-> obj path-pos)) - (+ -0.1 (-> obj path-pos)) + (if (< (-> this path-pos) 0.01) + (+ 0.1 (-> this path-pos)) + (+ -0.1 (-> this path-pos)) ) 'interp ) @@ -1989,44 +1989,44 @@ (vector-negate-in-place! s4-2) ) (vector-normalize! s4-2 1.0) - (forward-up-nopitch->quaternion (-> obj quat-ground) s4-2 *up-vector*) + (forward-up-nopitch->quaternion (-> this quat-ground) s4-2 *up-vector*) ) - (quaternion-normalize! (-> obj quat-ground)) - (if (-> obj first-time-command) + (quaternion-normalize! (-> this quat-ground)) + (if (-> this first-time-command) (sound-play "target-up-slow") ) - (set! (-> obj first-time-command) #f) + (set! (-> this first-time-command) #f) (when (>= f30-0 (-> curr-path-command 0 time)) - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) - (set! (-> obj first-time-command) #t) - (set! (-> obj state-time) (current-time)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) + (set! (-> this first-time-command) #t) + (set-time! (-> this state-time)) ) (return #t) ret ) (((tpath-command lower)) - (get-point-in-path! path (-> obj root trans) (-> obj path-pos) 'interp) - (+! (-> obj root trans y) (lerp-scale 0.0 -16384.0 f30-0 0.0 (-> curr-path-command 0 time))) - (if (-> obj first-time-command) + (get-point-in-path! path (-> this root trans) (-> this path-pos) 'interp) + (+! (-> this root trans y) (lerp-scale 0.0 -16384.0 f30-0 0.0 (-> curr-path-command 0 time))) + (if (-> this first-time-command) (sound-play "target-dwn-slow") ) - (set! (-> obj first-time-command) #f) + (set! (-> this first-time-command) #f) (when (>= f30-0 (-> curr-path-command 0 time)) - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) - (set! (-> obj first-time-command) #t) - (set! (-> obj state-time) (current-time)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) + (set! (-> this first-time-command) #t) + (set-time! (-> this state-time)) ) (return #t) ret ) (((tpath-command align-with-track)) - (let ((s3-3 (get-point-in-path! path (new 'stack-no-clear 'vector) (-> obj path-pos) 'interp))) + (let ((s3-3 (get-point-in-path! path (new 'stack-no-clear 'vector) (-> this path-pos) 'interp))) (let* ((v1-68 (get-point-in-path! path (new 'stack-no-clear 'vector) - (if (< (-> obj path-pos) 0.01) - (+ 0.1 (-> obj path-pos)) - (+ -0.1 (-> obj path-pos)) + (if (< (-> this path-pos) 0.01) + (+ 0.1 (-> this path-pos)) + (+ -0.1 (-> this path-pos)) ) 'interp ) @@ -2038,25 +2038,25 @@ (vector-negate-in-place! s4-6) ) (vector-normalize! s4-6 1.0) - (forward-up-nopitch->quaternion (-> obj quat-ground) s4-6 *up-vector*) + (forward-up-nopitch->quaternion (-> this quat-ground) s4-6 *up-vector*) ) - (quaternion-normalize! (-> obj quat-ground)) - (set! (-> obj root trans quad) (-> s3-3 quad)) + (quaternion-normalize! (-> this quat-ground)) + (set! (-> this root trans quad) (-> s3-3 quad)) ) - (set! (-> obj inout-percent) (lerp-scale 0.0 1.0 f30-0 0.0 (-> curr-path-command 0 time))) - (set! (-> obj first-time-command) #f) + (set! (-> this inout-percent) (lerp-scale 0.0 1.0 f30-0 0.0 (-> curr-path-command 0 time))) + (set! (-> this first-time-command) #f) (when (>= f30-0 (-> curr-path-command 0 time)) - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) - (set! (-> obj inout-percent) 1.0) - (set! (-> obj first-time-command) #t) - (set! (-> obj state-time) (current-time)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) + (set! (-> this inout-percent) 1.0) + (set! (-> this first-time-command) #t) + (set-time! (-> this state-time)) ) (return #t) ret ) (((tpath-command translate)) - (set! (-> obj score) (- (-> obj score) (* (-> obj score-speed) (seconds-per-frame)))) - (set! (-> obj inout-percent) (fmax 0.0 (- (-> obj inout-percent) (* 4.0 (seconds-per-frame))))) + (set! (-> this score) (- (-> this score) (* (-> this score-speed) (seconds-per-frame)))) + (set! (-> this inout-percent) (fmax 0.0 (- (-> this inout-percent) (* 4.0 (seconds-per-frame))))) (let ((s2-4 (new 'stack-no-clear 'vector)) (s3-4 (new 'stack-no-clear 'vector)) (f28-2 (lerp-scale 0.0 1.0 f30-0 0.0 (-> curr-path-command 0 time))) @@ -2076,13 +2076,13 @@ ) ) ) - (get-point-in-path! path s2-4 (-> obj path-pos) 'interp) + (get-point-in-path! path s2-4 (-> this path-pos) 'interp) (get-point-in-path! path s3-4 (* 0.007843138 (the float (-> curr-path-command 0 path-pos))) 'interp) (let ((v1-102 (new 'stack-no-clear 'vector))) - (set! (-> v1-102 quad) (-> obj root trans quad)) - (vector-float*! (-> obj root trans) s2-4 (- 1.0 f28-2)) - (let ((a0-63 (-> obj root trans))) - (let ((a1-23 (-> obj root trans))) + (set! (-> v1-102 quad) (-> this root trans quad)) + (vector-float*! (-> this root trans) s2-4 (- 1.0 f28-2)) + (let ((a0-63 (-> this root trans))) + (let ((a1-23 (-> this root trans))) (let ((a2-17 f28-2)) (.mov vf7 a2-17) ) @@ -2094,8 +2094,8 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a0-63 quad) vf6) ) - (let ((a0-65 (-> obj root transv))) - (.lvf vf1 (&-> (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) v1-102) quad)) + (let ((a0-65 (-> this root transv))) + (.lvf vf1 (&-> (vector-! (new 'stack-no-clear 'vector) (-> this root trans) v1-102) quad)) (let ((f0-50 (-> pp clock frames-per-second))) (.mov at-0 f0-50) ) @@ -2106,44 +2106,44 @@ ) ) ) - (if (zero? (-> obj move-sound)) - (set! (-> obj move-sound) (new-sound-id)) + (if (zero? (-> this move-sound)) + (set! (-> this move-sound) (new-sound-id)) ) (let ((s4-7 (static-sound-spec "target-mov-slow" :volume 100.0 :fo-max 60 :mask (pitch)))) - (set! (-> s4-7 pitch-mod) (the int (lerp-scale -1.0 1.0 (vector-length (-> obj root transv)) 0.0 81920.0))) - (sound-play-by-spec s4-7 (-> obj move-sound) (-> obj root trans)) + (set! (-> s4-7 pitch-mod) (the int (lerp-scale -1.0 1.0 (vector-length (-> this root transv)) 0.0 81920.0))) + (sound-play-by-spec s4-7 (-> this move-sound) (-> this root trans)) ) - (when (< (-> obj next-spark) (current-time)) - (set! (-> obj next-spark) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.0 0.3)))))) - (spawn (-> obj part) (-> obj root trans)) + (when (< (-> this next-spark) (current-time)) + (set! (-> this next-spark) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.0 0.3)))))) + (spawn (-> this part) (-> this root trans)) ) - (set! (-> obj first-time-command) #f) + (set! (-> this first-time-command) #f) (when (>= f30-0 (-> curr-path-command 0 time)) - (when (nonzero? (-> obj move-sound)) - (sound-stop (-> obj move-sound)) - (set! (-> obj move-sound) (new 'static 'sound-id)) + (when (nonzero? (-> this move-sound)) + (sound-stop (-> this move-sound)) + (set! (-> this move-sound) (new 'static 'sound-id)) 0 ) (sound-play "target-stop") - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) - (set! (-> obj path-pos) (* 0.007843138 (the float (-> curr-path-command 0 path-pos)))) - (set! (-> obj first-time-command) #t) - (set! (-> obj state-time) (current-time)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) + (set! (-> this path-pos) (* 0.007843138 (the float (-> curr-path-command 0 path-pos)))) + (set! (-> this first-time-command) #t) + (set-time! (-> this state-time)) ) (return #t) ret ) (((tpath-command wait)) - (set! (-> obj score) (- (-> obj score) (* (-> obj score-speed) (seconds-per-frame)))) - (set! (-> obj inout-percent) (fmax 0.0 (- (-> obj inout-percent) (* 4.0 (seconds-per-frame))))) - (get-point-in-path! path (-> obj root trans) (-> obj path-pos) 'interp) - (set! (-> obj first-time-command) #f) - (when (or (and (= (-> curr-path-command 0 time) -1.0) (< (-> obj hit-points) 0)) + (set! (-> this score) (- (-> this score) (* (-> this score-speed) (seconds-per-frame)))) + (set! (-> this inout-percent) (fmax 0.0 (- (-> this inout-percent) (* 4.0 (seconds-per-frame))))) + (get-point-in-path! path (-> this root trans) (-> this path-pos) 'interp) + (set! (-> this first-time-command) #f) + (when (or (and (= (-> curr-path-command 0 time) -1.0) (< (-> this hit-points) 0)) (and (!= (-> curr-path-command 0 time) -1.0) (>= f30-0 (-> curr-path-command 0 time))) ) - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) - (set! (-> obj first-time-command) #t) - (set! (-> obj state-time) (current-time)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) + (set! (-> this first-time-command) #t) + (set-time! (-> this state-time)) ) (return #t) ret @@ -2159,9 +2159,9 @@ ) ) -(defmethod get-trans gun-dummy ((obj gun-dummy) (arg0 int)) +(defmethod get-trans gun-dummy ((this gun-dummy) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((root (-> obj root))) + (let ((root (-> this root))) (case arg0 ((3 2) (let ((vec (new 'static 'vector :w 1.0))) @@ -2182,7 +2182,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('combo) - (set! (-> self last-combo-time) (current-time)) + (set-time! (-> self last-combo-time)) #t ) (('track) @@ -2233,7 +2233,7 @@ ) (else (if (and (logtest? (process-mask projectile) (-> proc-draw mask)) - (< (- (current-time) (-> self last-combo-time)) (seconds 1)) + (not (time-elapsed? (-> self last-combo-time) (seconds 1))) ) (send-event (ppointer->process (-> self parent)) 'combo) ) @@ -2252,7 +2252,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self inout-percent) 1.0) (set! (-> self y-offset) 0.0) (set! (-> self rot-y-offset) 0.0) @@ -2313,9 +2313,9 @@ ) ) -(defmethod init-dummy-collison! gun-dummy ((obj gun-dummy)) +(defmethod init-dummy-collison! gun-dummy ((this gun-dummy)) "Initializes the collision related stuff for the dummy" - (let ((cshape-moving (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape-moving dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape-moving reaction) cshape-reaction-default) (set! (-> cshape-moving no-reaction) @@ -2335,73 +2335,73 @@ (set! (-> cshape-moving backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape-moving backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape-moving) + (set! (-> this root) cshape-moving) ) 0 (none) ) ;; WARN: Return type mismatch process-focusable vs gun-dummy. -(defmethod relocate gun-dummy ((obj gun-dummy) (arg0 int)) - (the-as gun-dummy ((method-of-type process-focusable relocate) obj arg0)) +(defmethod relocate gun-dummy ((this gun-dummy) (arg0 int)) + (the-as gun-dummy ((method-of-type process-focusable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gun-dummy ((obj gun-dummy) (arg0 entity-actor)) +(defmethod init-from-entity! gun-dummy ((this gun-dummy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-dummy-collison! obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (init-dummy-collison! this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-dummy" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) -(defmethod init-tpath-info! gun-dummy ((obj gun-dummy) (arg0 tpath-info)) +(defmethod init-tpath-info! gun-dummy ((this gun-dummy) (arg0 tpath-info)) "Given a [[tpath-info]] use it to initialize the dummy with any relevant data or flags" - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask collectable)) - (vector-identity! (-> obj root scale)) - (quaternion-copy! (-> obj quat) (-> obj root quat)) - (+! (-> obj root trans y) -16384.0) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask collectable)) + (vector-identity! (-> this root scale)) + (quaternion-copy! (-> this quat) (-> this root quat)) + (+! (-> this root trans y) -16384.0) (if (not (logtest? (-> arg0 flags) (tpath-flags tpath-rand))) (set! *tpath-rand* (the-as uint (rand-vu-int-count 16))) ) - (set! (-> obj current) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> (the-as (inline-array tpath-control-frame) (-> arg0 anims (mod *tpath-rand* (-> arg0 num-anims)))) 0) ) ) - (let ((path (-> obj current))) + (let ((path (-> this current))) (when (= (-> path 0 command) (tpath-command begin)) - (set! (-> obj path-num) (-> path 0 path-num)) - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) + (set! (-> this path-num) (-> path 0 path-num)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) ) ) - (set! (-> obj score) (the float (-> arg0 score))) + (set! (-> this score) (the float (-> arg0 score))) (if (logtest? (-> arg0 flags) (tpath-flags citizen)) - (set! (-> obj score-speed) 0.0) - (set! (-> obj score-speed) (/ (-> obj score) (path-time-elapsed obj))) + (set! (-> this score-speed) 0.0) + (set! (-> this score-speed) (/ (-> this score) (path-time-elapsed this))) ) - (set! (-> obj hit-points) (if (logtest? (-> arg0 flags) (tpath-flags big)) - 2 - 1 - ) + (set! (-> this hit-points) (if (logtest? (-> arg0 flags) (tpath-flags big)) + 2 + 1 + ) ) - (set! (-> obj info) arg0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 519) obj)) - (set! (-> obj next-spark) 0) + (set! (-> this info) arg0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 519) this)) + (set! (-> this next-spark) 0) 0 (none) ) @@ -2496,18 +2496,18 @@ This commonly includes things such as: ) -(defmethod break-dummy gun-dummy-a ((obj gun-dummy-a)) +(defmethod break-dummy gun-dummy-a ((this gun-dummy-a)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (set! (-> exploder-tuning fountain-rand-transv-hi x) 4096.0) (set! (-> exploder-tuning fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -2518,7 +2518,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2527,25 +2527,25 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-a-exploder-params* - :to obj + :to this ) ) 0 (none) ) -(defmethod break-dummy gun-dummy-b ((obj gun-dummy-b)) +(defmethod break-dummy gun-dummy-b ((this gun-dummy-b)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (process-spawn part-tracker :init part-tracker-init @@ -2554,7 +2554,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2563,25 +2563,25 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-b-exploder-params* - :to obj + :to this ) ) 0 (none) ) -(defmethod break-dummy gun-dummy-c ((obj gun-dummy-c)) +(defmethod break-dummy gun-dummy-c ((this gun-dummy-c)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (process-spawn part-tracker :init part-tracker-init @@ -2590,7 +2590,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2599,25 +2599,25 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-c-exploder-params* - :to obj + :to this ) ) 0 (none) ) -(defmethod break-dummy gun-dummy-big ((obj gun-dummy-big)) +(defmethod break-dummy gun-dummy-big ((this gun-dummy-big)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (process-spawn part-tracker :init part-tracker-init @@ -2626,7 +2626,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2635,25 +2635,25 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-big-exploder-params* - :to obj + :to this ) ) 0 (none) ) -(defmethod break-dummy gun-dummy-gold ((obj gun-dummy-gold)) +(defmethod break-dummy gun-dummy-gold ((this gun-dummy-gold)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-bonus") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (process-spawn part-tracker :init part-tracker-init @@ -2662,7 +2662,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2671,25 +2671,25 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-gold-exploder-params* - :to obj + :to this ) ) 0 (none) ) -(defmethod break-dummy gun-dummy-peace ((obj gun-dummy-peace)) +(defmethod break-dummy gun-dummy-peace ((this gun-dummy-peace)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (process-spawn part-tracker :init part-tracker-init @@ -2698,7 +2698,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2707,25 +2707,25 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-peace-exploder-params* - :to obj + :to this ) ) 0 (none) ) -(defmethod break-dummy gun-cit-a ((obj gun-cit-a)) +(defmethod break-dummy gun-cit-a ((this gun-cit-a)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (set! (-> exploder-tuning fountain-rand-transv-hi x) 4096.0) (set! (-> exploder-tuning fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -2736,7 +2736,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2745,25 +2745,25 @@ This commonly includes things such as: 5 exploder-tuning *gun-cit-a-exploder-params* - :to obj + :to this ) ) 0 (none) ) -(defmethod break-dummy gun-cit-b ((obj gun-cit-b)) +(defmethod break-dummy gun-cit-b ((this gun-cit-b)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (set! (-> exploder-tuning fountain-rand-transv-hi x) 4096.0) (set! (-> exploder-tuning fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -2774,7 +2774,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2783,25 +2783,25 @@ This commonly includes things such as: 5 exploder-tuning *gun-cit-b-exploder-params* - :to obj + :to this ) ) 0 (none) ) -(defmethod break-dummy gun-cit-c ((obj gun-cit-c)) +(defmethod break-dummy gun-cit-c ((this gun-cit-c)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (set! (-> exploder-tuning fountain-rand-transv-hi x) 4096.0) (set! (-> exploder-tuning fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -2812,7 +2812,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2821,25 +2821,25 @@ This commonly includes things such as: 5 exploder-tuning *gun-cit-c-exploder-params* - :to obj + :to this ) ) 0 (none) ) -(defmethod break-dummy gun-cit-d ((obj gun-cit-d)) +(defmethod break-dummy gun-cit-d ((this gun-cit-d)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (set! (-> exploder-tuning fountain-rand-transv-hi x) 4096.0) (set! (-> exploder-tuning fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -2850,7 +2850,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2859,7 +2859,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-cit-d-exploder-params* - :to obj + :to this ) ) 0 diff --git a/goal_src/jak2/levels/gungame/gungame-obs.gc b/goal_src/jak2/levels/gungame/gungame-obs.gc index a6a31a9b3f..5161870cee 100644 --- a/goal_src/jak2/levels/gungame/gungame-obs.gc +++ b/goal_src/jak2/levels/gungame/gungame-obs.gc @@ -85,34 +85,34 @@ ) -(defmethod training-manager-method-32 training-manager ((obj training-manager)) - (when (handle->process (-> obj voicebox)) - (if (= (get-status *gui-control* (-> obj last-sound-id)) (gui-status unknown)) - (send-event (handle->process (-> obj voicebox)) 'speak-effect #f) - (send-event (handle->process (-> obj voicebox)) 'speak-effect #t) +(defmethod training-manager-method-32 training-manager ((this training-manager)) + (when (handle->process (-> this voicebox)) + (if (= (get-status *gui-control* (-> this last-sound-id)) (gui-status unknown)) + (send-event (handle->process (-> this voicebox)) 'speak-effect #f) + (send-event (handle->process (-> this voicebox)) 'speak-effect #t) ) ) (cond ((= (-> (level-get-target-inside *level*) name) 'gungame) - (if (zero? (-> obj gui-id)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel message) (gui-action play) (-> obj name) 81920.0 0) + (if (zero? (-> this gui-id)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel message) (gui-action play) (-> this name) 81920.0 0) ) ) ) (else - (when (nonzero? (-> obj gui-id)) + (when (nonzero? (-> this gui-id)) (set-action! *gui-control* (gui-action stop) - (-> obj gui-id) + (-> this gui-id) (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj gui-id) (new 'static 'sound-id)) + (set! (-> this gui-id) (new 'static 'sound-id)) 0 ) ) @@ -143,18 +143,18 @@ ) ) -(defmethod deactivate training-manager ((obj training-manager)) - (if (handle->process (-> obj voicebox)) - (send-event (handle->process (-> obj voicebox)) 'die) +(defmethod deactivate training-manager ((this training-manager)) + (if (handle->process (-> this voicebox)) + (send-event (handle->process (-> this voicebox)) 'die) ) - (training-manager-method-24 obj) - (training-manager-method-25 obj) - ((the-as (function process none) (find-parent-method training-manager 10)) obj) + (training-manager-method-24 this) + (training-manager-method-25 this) + ((the-as (function process none) (find-parent-method training-manager 10)) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! training-path ((obj training-path) (arg0 entity-actor)) +(defmethod init-from-entity! training-path ((this training-path) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -162,65 +162,65 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (let ((s5-0 (length "training-path-")) - (a0-3 (length (-> obj name))) + (a0-3 (length (-> this name))) (v1-2 0) ) (cond ((= a0-3 (+ s5-0 1)) - (set! v1-2 (the-as int (+ (-> obj name data 14) -48 v1-2))) + (set! v1-2 (the-as int (+ (-> this name data 14) -48 v1-2))) ) ((= a0-3 (+ s5-0 2)) - (let ((v1-3 (+ v1-2 (* (the-as uint 10) (+ (-> obj name data 14) -48))))) - (set! v1-2 (the-as int (+ (-> obj name data 15) -48 v1-3))) + (let ((v1-3 (+ v1-2 (* (the-as uint 10) (+ (-> this name data 14) -48))))) + (set! v1-2 (the-as int (+ (-> this name data 15) -48 v1-3))) ) ) ((= a0-3 (+ s5-0 3)) (let ((v1-5 (+ v1-2 - (* (the-as uint 100) (+ (-> obj name data 14) -48)) - (* (the-as uint 10) (+ (-> obj name data 15) -48)) + (* (the-as uint 100) (+ (-> this name data 14) -48)) + (* (the-as uint 10) (+ (-> this name data 15) -48)) ) ) ) - (set! v1-2 (the-as int (+ (-> obj name data 16) -48 v1-5))) + (set! v1-2 (the-as int (+ (-> this name data 16) -48 v1-5))) ) ) ) - (set! (-> obj num) (the-as uint (+ v1-2 -76))) + (set! (-> this num) (the-as uint (+ v1-2 -76))) ) - (let ((v1-8 (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #t))) + (let ((v1-8 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #t))) (when (nonzero? v1-8) - (set! (-> obj path) v1-8) + (set! (-> this path) v1-8) (logior! (-> v1-8 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) -(defmethod training-manager-method-31 training-manager ((obj training-manager)) +(defmethod training-manager-method-31 training-manager ((this training-manager)) (cond ((= (-> (level-get-target-inside *level*) name) 'gungame) - (when (or (zero? (-> obj in-out)) (= (-> obj in-out) 1)) + (when (or (zero? (-> this in-out)) (= (-> this in-out) 1)) (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) - (set! (-> obj in-out) (the-as uint 2)) + (set! (-> this in-out) (the-as uint 2)) ) ) (else - (when (or (zero? (-> obj in-out)) (= (-> obj in-out) 2)) - (when (handle->process (-> obj voicebox)) - (send-event (handle->process (-> obj voicebox)) 'die) - (set! (-> obj voicebox) (the-as handle #f)) + (when (or (zero? (-> this in-out)) (= (-> this in-out) 2)) + (when (handle->process (-> this voicebox)) + (send-event (handle->process (-> this voicebox)) 'die) + (set! (-> this voicebox) (the-as handle #f)) ) (remove-setting! 'minimap) - (set! (-> obj in-out) (the-as uint 1)) + (set! (-> this in-out) (the-as uint 1)) ) ) ) (none) ) -(defmethod render-text training-manager ((obj training-manager) (arg0 text-id)) - (when (= (get-status *gui-control* (-> obj gui-id)) (gui-status active)) +(defmethod render-text training-manager ((this training-manager) (arg0 text-id)) + (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) (let ((s5-1 (new 'stack 'font-context *font-default-matrix* 32 290 0.0 (font-color default) (font-flags shadow kerning)) ) @@ -1831,7 +1831,7 @@ This commonly includes things such as: ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -1862,14 +1862,14 @@ This commonly includes things such as: ) ) -(defmethod training-manager-method-21 training-manager ((obj training-manager) (arg0 handle)) +(defmethod training-manager-method-21 training-manager ((this training-manager) (arg0 handle)) (let ((s4-0 0) - (v1-3 (+ (length (-> obj actor-group 0)) -1)) + (v1-3 (+ (length (-> this actor-group 0)) -1)) ) 0 (while (>= v1-3 s4-0) (let* ((a0-4 (/ (+ s4-0 v1-3) 2)) - (a2-2 (-> obj actor-group 0 data a0-4 actor)) + (a2-2 (-> this actor-group 0 data a0-4 actor)) (a1-4 (if a2-2 (the-as process-focusable (-> a2-2 extra process)) ) @@ -1877,7 +1877,7 @@ This commonly includes things such as: ) (cond ((= arg0 (-> a1-4 focus-status)) - (return (-> obj actor-group 0 data a0-4 actor)) + (return (-> this actor-group 0 data a0-4 actor)) ) ((< (the-as uint (-> a1-4 focus-status)) (the-as uint arg0)) (set! s4-0 (+ a0-4 1)) @@ -1892,14 +1892,14 @@ This commonly includes things such as: (the-as entity #f) ) -(defmethod training-manager-method-26 training-manager ((obj training-manager)) +(defmethod training-manager-method-26 training-manager ((this training-manager)) (local-vars (s3-0 object)) (let ((gp-0 0)) (dotimes (s4-0 (-> *entrance-gungame-crates-pos* length)) - (if (and (handle->process (-> obj entrance-crates s4-0)) + (if (and (handle->process (-> this entrance-crates s4-0)) (begin (let* ((s3-1 #t) - (s2-0 (-> obj entrance-crates s4-0 process 0)) + (s2-0 (-> this entrance-crates s4-0 process 0)) (v1-11 (the-as focus-status (logand (-> (if (type? s2-0 process-focusable) (the-as process-focusable s2-0) ) @@ -1922,7 +1922,7 @@ This commonly includes things such as: ) ) -(defmethod training-manager-method-29 training-manager ((obj training-manager) (arg0 vector)) +(defmethod training-manager-method-29 training-manager ((this training-manager) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1964,7 +1964,7 @@ This commonly includes things such as: ) ) -(defmethod training-manager-method-22 training-manager ((obj training-manager) (arg0 symbol)) +(defmethod training-manager-method-22 training-manager ((this training-manager) (arg0 symbol)) (local-vars (v1-28 symbol) (a0-18 symbol) (sv-48 process) (sv-64 process) (sv-80 process)) (let ((s4-0 (new 'static 'fact-info :pickup-type (pickup-type ammo-red) :pickup-spawn-amount 20.0)) (s3-0 (new 'stack-no-clear 'vector)) @@ -1979,7 +1979,7 @@ This commonly includes things such as: (+! (-> s3-0 x) 1667072.0) (+! (-> s3-0 y) 40960.0) (+! (-> s3-0 z) 5025792.0) - (training-manager-method-29 obj s3-0) + (training-manager-method-29 this s3-0) (when arg0 (set! (-> s2-0 quad) (-> s3-0 quad)) (set! (-> s2-0 r) 8192.0) @@ -1987,7 +1987,7 @@ This commonly includes things such as: (set! s1-0 #f) ) ) - (when (and s1-0 (not (handle->process (-> obj entrance-crates s0-0)))) + (when (and s1-0 (not (handle->process (-> this entrance-crates s0-0)))) (set! sv-48 (get-process *default-dead-pool* crate #x4000)) (let ((v1-21 (when sv-48 @@ -2017,10 +2017,10 @@ This commonly includes things such as: *up-vector* (+ -4551.1113 (-> *entrance-gungame-crates-pos* s0-0 pos w)) ) - (set! (-> obj entrance-crates s0-0) (ppointer->handle (if sv-80 - (-> sv-80 ppointer) - ) - ) + (set! (-> this entrance-crates s0-0) (ppointer->handle (if sv-80 + (-> sv-80 ppointer) + ) + ) ) ) ) @@ -2028,39 +2028,39 @@ This commonly includes things such as: #f ) -(defmethod training-manager-method-25 training-manager ((obj training-manager)) +(defmethod training-manager-method-25 training-manager ((this training-manager)) (dotimes (s5-0 (-> *entrance-gungame-crates-pos* length)) - (when (handle->process (-> obj entrance-crates s5-0)) - (deactivate (-> obj entrance-crates s5-0 process 0)) - (set! (-> obj entrance-crates s5-0) (the-as handle #f)) + (when (handle->process (-> this entrance-crates s5-0)) + (deactivate (-> this entrance-crates s5-0 process 0)) + (set! (-> this entrance-crates s5-0) (the-as handle #f)) ) ) #f ) -(defmethod training-manager-method-24 training-manager ((obj training-manager)) +(defmethod training-manager-method-24 training-manager ((this training-manager)) (dotimes (s5-0 32) - (when (handle->process (-> obj course-crates s5-0)) - (deactivate (-> obj course-crates s5-0 process 0)) - (set! (-> obj course-crates s5-0) (the-as handle #f)) + (when (handle->process (-> this course-crates s5-0)) + (deactivate (-> this course-crates s5-0 process 0)) + (set! (-> this course-crates s5-0) (the-as handle #f)) ) ) #f ) -(defmethod training-manager-method-23 training-manager ((obj training-manager) (arg0 (array gungame-crate))) +(defmethod training-manager-method-23 training-manager ((this training-manager) (arg0 (array gungame-crate))) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'static 'fact-info)) ) (dotimes (s2-0 (-> arg0 length)) - (when (not (handle->process (-> obj course-crates s2-0))) + (when (not (handle->process (-> this course-crates s2-0))) (set! (-> s4-0 quad) (-> arg0 s2-0 pos quad)) (set! (-> s4-0 w) 1.0) (vector-rotate-around-y! s4-0 s4-0 -4460.999) (+! (-> s4-0 x) 1667072.0) (+! (-> s4-0 y) 40960.0) (+! (-> s4-0 z) 5025792.0) - (training-manager-method-29 obj s4-0) + (training-manager-method-29 this s4-0) (set! (-> s3-0 pickup-type) (-> arg0 s2-0 ammo)) (set! (-> s3-0 pickup-spawn-amount) (the float (-> arg0 s2-0 num))) (let* ((s0-0 (ppointer->process (process-spawn crate #f s4-0 'wood s3-0 :to *entity-pool*))) @@ -2070,7 +2070,7 @@ This commonly includes things such as: ) ) (quaternion-vector-angle! (-> s1-1 root quat) *up-vector* (+ -4551.1113 (-> arg0 s2-0 pos w))) - (set! (-> obj course-crates s2-0) (process->handle s1-1)) + (set! (-> this course-crates s2-0) (process->handle s1-1)) ) ) ) @@ -2078,7 +2078,7 @@ This commonly includes things such as: #f ) -(defmethod training-manager-method-27 training-manager ((obj training-manager) (arg0 (array tpath-info))) +(defmethod training-manager-method-27 training-manager ((this training-manager) (arg0 (array tpath-info))) (dotimes (s5-0 (length arg0)) (let ((v1-2 (-> arg0 s5-0))) 0 @@ -2122,31 +2122,31 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod training-manager-method-28 training-manager ((obj training-manager)) +(defmethod training-manager-method-28 training-manager ((this training-manager)) (cond ((task-node-open? (game-task-node city-red-gun-training-introduction)) - (go (method-of-object obj red-training-intro)) + (go (method-of-object this red-training-intro)) ) ((or (task-node-open? (game-task-node city-red-gun-training-try-once)) (task-node-open? (game-task-node city-red-gun-training-resolution)) ) - (go (method-of-object obj red-training)) + (go (method-of-object this red-training)) ) ((task-node-open? (game-task-node city-yellow-gun-training-introduction)) - (go (method-of-object obj yellow-training-intro)) + (go (method-of-object this yellow-training-intro)) ) ((task-node-open? (game-task-node city-yellow-gun-training-resolution)) (go yellow-training) ) (else - (go (method-of-object obj red-yellow-training)) + (go (method-of-object this red-yellow-training)) ) ) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! training-manager ((obj training-manager) (arg0 entity-actor)) +(defmethod init-from-entity! training-manager ((this training-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2156,38 +2156,38 @@ This commonly includes things such as: (local-vars (sv-16 res-tag)) (set-setting! 'darkjak #f 0.0 0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-3 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-3 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-3 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-3)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-3)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) (go process-drawable-art-error "actor-group training-manager") ) ) ) - (set! (-> obj score) 0) - (set! (-> obj in-out) (the-as uint 0)) - (set! (-> obj egg-count) 0) - (set! (-> obj medal) 0) - (set! (-> obj voicebox) (the-as handle #f)) - (set! (-> obj gui-id) (new 'static 'sound-id)) + (set! (-> this score) 0) + (set! (-> this in-out) (the-as uint 0)) + (set! (-> this egg-count) 0) + (set! (-> this medal) 0) + (set! (-> this voicebox) (the-as handle #f)) + (set! (-> this gui-id) (new 'static 'sound-id)) (dotimes (v1-10 32) - (set! (-> obj entrance-crates v1-10) (the-as handle #f)) + (set! (-> this entrance-crates v1-10) (the-as handle #f)) ) (dotimes (v1-13 32) - (set! (-> obj course-crates v1-13) (the-as handle #f)) + (set! (-> this course-crates v1-13) (the-as handle #f)) ) - (training-manager-method-27 obj *red-training-path-global-info*) - (training-manager-method-27 obj *yellow-training-path-global-info*) - (training-manager-method-27 obj *blue-training-path-global-info*) - (training-manager-method-27 obj *peace-training-path-global-info*) - (training-manager-method-22 obj #f) + (training-manager-method-27 this *red-training-path-global-info*) + (training-manager-method-27 this *yellow-training-path-global-info*) + (training-manager-method-27 this *blue-training-path-global-info*) + (training-manager-method-27 this *peace-training-path-global-info*) + (training-manager-method-22 this #f) (set-setting! 'speech-control #f 0.0 0) - (go (method-of-object obj wait)) + (go (method-of-object this wait)) (none) ) @@ -2274,7 +2274,7 @@ This commonly includes things such as: :code (behavior () (sound-play "gungame-door") (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.2)) + (until (time-elapsed? gp-1 (seconds 0.2)) (suspend) (suspend) ) @@ -2295,72 +2295,72 @@ This commonly includes things such as: :post transform-post ) -(defmethod gungame-door-method-23 gungame-door ((obj gungame-door)) - (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root trans))) - (f26-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) s5-1)) - (f30-0 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) s5-1)) +(defmethod gungame-door-method-23 gungame-door ((this gungame-door)) + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (f26-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) + (f30-0 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) (f28-0 (vector-dot - (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) - (vector-! (new 'stack-no-clear 'vector) (camera-pos) (-> obj root trans)) + (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (-> this root trans)) ) ) (f0-4 (vector-dot - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) - (vector-! (new 'stack-no-clear 'vector) (camera-pos) (-> obj root trans)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (-> this root trans)) ) ) ) (cond - ((-> obj open-side) + ((-> this open-side) (when (< (fabs f26-0) 16384.0) - (if (and (>= (-> obj last-player-dist) 8192.0) (< f30-0 8192.0)) - (+! (-> obj close-state) -1) + (if (and (>= (-> this last-player-dist) 8192.0) (< f30-0 8192.0)) + (+! (-> this close-state) -1) ) - (if (and (< (-> obj last-player-dist) 8192.0) (>= f30-0 8192.0)) - (+! (-> obj close-state) 1) + (if (and (< (-> this last-player-dist) 8192.0) (>= f30-0 8192.0)) + (+! (-> this close-state) 1) ) ) (when (< (fabs f28-0) 16384.0) - (if (and (>= (-> obj last-camera-dist) 8192.0) (< f0-4 8192.0)) - (+! (-> obj close-state) -1) + (if (and (>= (-> this last-camera-dist) 8192.0) (< f0-4 8192.0)) + (+! (-> this close-state) -1) ) - (if (and (< (-> obj last-camera-dist) 8192.0) (>= f0-4 8192.0)) - (+! (-> obj close-state) 1) + (if (and (< (-> this last-camera-dist) 8192.0) (>= f0-4 8192.0)) + (+! (-> this close-state) 1) ) ) ) (else (when (< (fabs f26-0) 16384.0) - (if (and (>= (-> obj last-player-dist) -8192.0) (< f30-0 -8192.0)) - (+! (-> obj close-state) 1) + (if (and (>= (-> this last-player-dist) -8192.0) (< f30-0 -8192.0)) + (+! (-> this close-state) 1) ) - (if (and (< (-> obj last-player-dist) -8192.0) (>= f30-0 -8192.0)) - (+! (-> obj close-state) -1) + (if (and (< (-> this last-player-dist) -8192.0) (>= f30-0 -8192.0)) + (+! (-> this close-state) -1) ) ) (when (< (fabs f28-0) 16384.0) - (if (and (>= (-> obj last-camera-dist) -8192.0) (< f0-4 -8192.0)) - (+! (-> obj close-state) 1) + (if (and (>= (-> this last-camera-dist) -8192.0) (< f0-4 -8192.0)) + (+! (-> this close-state) 1) ) - (if (and (< (-> obj last-camera-dist) -8192.0) (>= f0-4 -8192.0)) - (+! (-> obj close-state) -1) + (if (and (< (-> this last-camera-dist) -8192.0) (>= f0-4 -8192.0)) + (+! (-> this close-state) -1) ) ) ) ) - (set! (-> obj last-player-dist) f30-0) - (set! (-> obj last-camera-dist) f0-4) + (set! (-> this last-player-dist) f30-0) + (set! (-> this last-camera-dist) f0-4) ) - (!= (-> obj close-state) 2) + (!= (-> this close-state) 2) ) ;; WARN: disable def twice: 41. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gungame-door-method-24 gungame-door ((obj gungame-door)) - (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root trans))) - (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) s5-1)) - (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) s5-1)) +(defmethod gungame-door-method-24 gungame-door ((this gungame-door)) + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) + (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) ) - (and (< (fabs f30-0) 16384.0) (if (-> obj open-side) + (and (< (fabs f30-0) 16384.0) (if (-> this open-side) (and (< f0-2 0.0) (< -32768.0 f0-2)) (and (< 0.0 f0-2) (< f0-2 32768.0)) ) @@ -2418,14 +2418,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gungame-door ((obj gungame-door) (arg0 entity-actor)) +(defmethod init-from-entity! gungame-door ((this gungame-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -2459,22 +2459,22 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gungame-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-push! 1 0) - (let ((a0-23 (-> obj skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-23 (-> this skel root-channel 0))) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/hideout/hideout-obs.gc b/goal_src/jak2/levels/hideout/hideout-obs.gc index b692a1056f..cb1c570412 100644 --- a/goal_src/jak2/levels/hideout/hideout-obs.gc +++ b/goal_src/jak2/levels/hideout/hideout-obs.gc @@ -23,15 +23,16 @@ ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-door-b ((obj hide-door-b) (arg0 entity-actor)) +(defmethod init-from-entity! hide-door-b ((this hide-door-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + ;; og:preserve-this added + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -61,20 +62,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hide-door-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "hide-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "hide-door-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "hide-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "hide-door-hit")) - (set! (-> obj door-radius) 12288.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "hide-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "hide-door-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "hide-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "hide-door-hit")) + (set! (-> this door-radius) 12288.0) + (go (method-of-object this close) #t) (none) ) @@ -152,19 +153,19 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-light ((obj hide-light) (arg0 entity-actor)) +(defmethod init-from-entity! hide-light ((this hide-light) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hide-light" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -173,11 +174,11 @@ This commonly includes things such as: (set-vector! (-> v1-9 settings bot-plane) 0.0 -1.0 0.0 58982.4) (set-vector! (-> v1-9 settings top-plane) 0.0 -1.0 0.0 0.0) (set! (-> v1-9 settings shadow-type) 1) - (set! (-> obj draw shadow-ctrl) v1-9) + (set! (-> this draw shadow-ctrl) v1-9) ) - (hide-light-spawn obj *zero-vector* (-> obj node-list data 12)) + (hide-light-spawn this *zero-vector* (-> this node-list data 12)) (set-setting! 'spotlight-color #f 0.0 (the-as uint #x80c0c0c0)) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/hiphog/hiphog-obs.gc b/goal_src/jak2/levels/hiphog/hiphog-obs.gc index bb6225cb82..1fdac3af94 100644 --- a/goal_src/jak2/levels/hiphog/hiphog-obs.gc +++ b/goal_src/jak2/levels/hiphog/hiphog-obs.gc @@ -31,26 +31,26 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-a ((obj hip-trophy-a) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-a ((this hip-trophy-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -78,26 +78,26 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-d ((obj hip-trophy-d) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-d ((this hip-trophy-d) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-d" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -125,26 +125,26 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-f ((obj hip-trophy-f) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-f ((this hip-trophy-f) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-f" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -172,26 +172,26 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-g ((obj hip-trophy-g) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-g ((this hip-trophy-g) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-g" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -219,26 +219,26 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-i ((obj hip-trophy-i) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-i ((this hip-trophy-i) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-i" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -266,26 +266,26 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-j ((obj hip-trophy-j) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-j ((this hip-trophy-j) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-j" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -313,26 +313,26 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-n ((obj hip-trophy-n) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-n ((this hip-trophy-n) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-n" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -360,25 +360,25 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-m ((obj hip-trophy-m) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-m ((this hip-trophy-m) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-m" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/hiphog/hiphog-scenes.gc b/goal_src/jak2/levels/hiphog/hiphog-scenes.gc index 9d34c219ca..bc61207155 100644 --- a/goal_src/jak2/levels/hiphog/hiphog-scenes.gc +++ b/goal_src/jak2/levels/hiphog/hiphog-scenes.gc @@ -25,15 +25,16 @@ ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-door-b ((obj hip-door-b) (entiy entity-actor)) +(defmethod init-from-entity! hip-door-b ((this hip-door-b) (entiy entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 1024) ;; added - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + ;; og:preserve-this added + (stack-size-set! (-> this main-thread) 1024) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape penetrated-by) (penetrate)) (let ((cshape-group (new 'process 'collide-shape-prim-group cshape (the-as uint 2) 0))) (set! (-> cshape total-prims) (the-as uint 3)) @@ -62,20 +63,20 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-door-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (set! (-> obj door-radius) 8192.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> this door-radius) 8192.0) + (go (method-of-object this close) #t) (none) ) @@ -105,28 +106,28 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! hip-whack-a-metal ((obj hip-whack-a-metal)) +(defmethod init-art! hip-whack-a-metal ((this hip-whack-a-metal)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-whack-a-metal" (the-as (pointer uint32) #f))) (the-as pair 0) ) (none) ) -(defmethod get-art-elem hip-whack-a-metal ((obj hip-whack-a-metal)) +(defmethod get-art-elem hip-whack-a-metal ((this hip-whack-a-metal)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> (get-current-task-event (-> obj task)) action) + (case (-> (get-current-task-event (-> this task)) action) (((game-task-action play)) - (set! (-> obj talk-message) (text-id press-triangle-to-play)) + (set! (-> this talk-message) (text-id press-triangle-to-play)) ) (else - (set! (-> obj talk-message) (text-id press-triangle-to-talk)) + (set! (-> this talk-message) (text-id press-triangle-to-talk)) ) ) - (-> obj draw art-group data 2) + (-> this draw art-group data 2) ) (defstate play-game (hip-whack-a-metal) @@ -185,22 +186,22 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-mirror ((obj hip-mirror) (entity entity-actor)) +(defmethod init-from-entity! hip-mirror ((this hip-mirror) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj entity) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-mirror" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj skel status) (joint-control-status blend-shape)) - (go (method-of-object obj idle)) + (logior! (-> this skel status) (joint-control-status blend-shape)) + (go (method-of-object this idle)) (none) ) @@ -363,23 +364,23 @@ This commonly includes things such as: ) -(defmethod get-art-elem sig-npc ((obj sig-npc)) +(defmethod get-art-elem sig-npc ((this sig-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (if (task-node-open? (game-task-node forest-hunt-introduction)) - (-> obj draw art-group data 4) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) + (-> this draw art-group data 4) ) ) -(defmethod init-art! sig-npc ((obj sig-npc)) +(defmethod init-art! sig-npc ((this sig-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sig-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) (none) ) diff --git a/goal_src/jak2/levels/hiphog/whack.gc b/goal_src/jak2/levels/hiphog/whack.gc index c13e5a4ef2..c2fe211b87 100644 --- a/goal_src/jak2/levels/hiphog/whack.gc +++ b/goal_src/jak2/levels/hiphog/whack.gc @@ -1608,7 +1608,7 @@ ) (ja-channel-push! 1 (seconds 0.05)) (let ((s5-0 (current-time))) - (while (and (< (- (current-time) s5-0) arg0) (not (-> self abort?))) + (while (and (not (time-elapsed? s5-0 arg0)) (not (-> self abort?))) (ja :group! (-> self draw art-group data 4) :num! (loop!)) (suspend) ) @@ -1691,39 +1691,39 @@ ) -(defmethod deactivate whack-a-metal ((obj whack-a-metal)) +(defmethod deactivate whack-a-metal ((this whack-a-metal)) (dotimes (s5-0 2) - (if (nonzero? (-> obj score-part s5-0)) - (kill-and-free-particles (-> obj score-part s5-0)) + (if (nonzero? (-> this score-part s5-0)) + (kill-and-free-particles (-> this score-part s5-0)) ) ) - ((the-as (function process none) (find-parent-method whack-a-metal 10)) obj) + ((the-as (function process none) (find-parent-method whack-a-metal 10)) this) (none) ) ;; WARN: Return type mismatch process-drawable vs whack-a-metal. -(defmethod relocate whack-a-metal ((obj whack-a-metal) (arg0 int)) +(defmethod relocate whack-a-metal ((this whack-a-metal) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj score-part v1-0)) - (&+! (-> obj score-part v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method whack-a-metal 7)) this arg0) ) ) -(defmethod whack-a-metal-method-29 whack-a-metal ((obj whack-a-metal) (arg0 int) (arg1 int)) - (let ((v0-1 (mod (+ (-> obj speech-last arg0) (rand-vu-int-range 1 2)) arg1))) - (set! (-> obj speech-last arg0) v0-1) +(defmethod whack-a-metal-method-29 whack-a-metal ((this whack-a-metal) (arg0 int) (arg1 int)) + (let ((v0-1 (mod (+ (-> this speech-last arg0) (rand-vu-int-range 1 2)) arg1))) + (set! (-> this speech-last arg0) v0-1) v0-1 ) ) ;; WARN: Return type mismatch int vs integer. -(defmethod whack-a-metal-method-26 whack-a-metal ((obj whack-a-metal)) - (if (or (-> obj dizzy?) (>= (-> obj miss-count) 20)) +(defmethod whack-a-metal-method-26 whack-a-metal ((this whack-a-metal)) + (if (or (-> this dizzy?) (>= (-> this miss-count) 20)) (return (the-as integer -1)) ) (let ((v0-0 @@ -1793,45 +1793,45 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons up right down left triangle circle x square)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up right down left triangle circle x square)) (dotimes (v1-57 4) - (when (< (-> obj slot-buffer v1-57) 0) - (set! (-> obj slot-buffer v1-57) v0-0) + (when (< (-> this slot-buffer v1-57) 0) + (set! (-> this slot-buffer v1-57) v0-0) (goto cfg-30) ) ) (label cfg-30) - (if (>= (-> obj slot-buffer 0) 0) - (return (the-as integer (-> obj slot-buffer 0))) + (if (>= (-> this slot-buffer 0) 0) + (return (the-as integer (-> this slot-buffer 0))) ) v0-0 ) ) -(defmethod whack-a-metal-method-27 whack-a-metal ((obj whack-a-metal)) - (let ((s4-0 (-> *mole-data* (-> obj wave) (-> obj event))) +(defmethod whack-a-metal-method-27 whack-a-metal ((this whack-a-metal)) + (let ((s4-0 (-> *mole-data* (-> this wave) (-> this event))) (s5-0 #t) ) - (when (zero? (-> obj event-length)) - (set! (-> obj event-length) + (when (zero? (-> this event-length)) + (set! (-> this event-length) (rand-vu-int-range (the-as int (-> s4-0 min-time)) (the-as int (+ (-> s4-0 min-time) (-> s4-0 max-time)))) ) - (set! (-> obj event-time) (current-time)) + (set-time! (-> this event-time)) ) (let ((v1-8 (-> s4-0 mode))) (cond ((= v1-8 8) - (set! s5-0 (>= (- (current-time) (-> obj event-time)) (-> obj event-length))) + (set! s5-0 (time-elapsed? (-> this event-time) (-> this event-length))) ) ((or (= v1-8 9) (= v1-8 10) (= v1-8 11)) (let ((v1-13 (rand-vu-int-range 0 7))) (let ((s3-0 0)) - (while (let ((a0-20 (-> obj mole v1-13))) + (while (let ((a0-20 (-> this mole v1-13))) (and (-> (the-as hip-mole (if a0-20 (the-as hip-mole (-> a0-20 0 self)) ) ) next-state ) - (let ((a0-26 (-> obj mole v1-13))) + (let ((a0-26 (-> this mole v1-13))) (= (-> (the-as hip-mole (if a0-26 (the-as hip-mole (-> a0-26 0 self)) ) @@ -1851,21 +1851,21 @@ ) ) ) - (send-event (ppointer->process (-> obj mole v1-13)) 'active (-> obj event-length) (-> s4-0 mode)) + (send-event (ppointer->process (-> this mole v1-13)) 'active (-> this event-length) (-> s4-0 mode)) ) (label cfg-27) ) ((or (zero? v1-8) (= v1-8 1) (= v1-8 2) (= v1-8 3) (= v1-8 4) (= v1-8 5) (= v1-8 6) (= v1-8 7)) (let ((v1-22 (the-as int (-> s4-0 mode)))) (let ((s3-1 0)) - (while (let ((a0-49 (-> obj mole v1-22))) + (while (let ((a0-49 (-> this mole v1-22))) (and (-> (the-as hip-mole (if a0-49 (the-as hip-mole (-> a0-49 0 self)) ) ) next-state ) - (let ((a0-55 (-> obj mole v1-22))) + (let ((a0-55 (-> this mole v1-22))) (= (-> (the-as hip-mole (if a0-55 (the-as hip-mole (-> a0-55 0 self)) ) @@ -1885,32 +1885,32 @@ ) ) ) - (send-event (ppointer->process (-> obj mole v1-22)) 'active (-> obj event-length) (-> s4-0 mode)) + (send-event (ppointer->process (-> this mole v1-22)) 'active (-> this event-length) (-> s4-0 mode)) ) ) ) ) (label cfg-61) (when s5-0 - (set! (-> obj event-length) 0) - (+! (-> obj event) 1) - (when (>= (-> obj event) (-> *mole-data* (-> obj wave) length)) - (set! (-> obj event) 0) - (+! (-> obj wave) 1) - (if (>= (-> obj wave) (-> *mole-data* length)) - (set! (-> obj wave) (+ (-> *mole-data* length) -1)) + (set! (-> this event-length) 0) + (+! (-> this event) 1) + (when (>= (-> this event) (-> *mole-data* (-> this wave) length)) + (set! (-> this event) 0) + (+! (-> this wave) 1) + (if (>= (-> this wave) (-> *mole-data* length)) + (set! (-> this wave) (+ (-> *mole-data* length) -1)) ) ) ) ) - (when (>= (- (current-time) (-> obj speech-time)) (seconds 15)) + (when (time-elapsed? (-> this speech-time) (seconds 15)) (if (nonzero? (cond - ((= (-> obj speech-count) 1) + ((= (-> this speech-count) 1) 0 ) - ((>= (-> obj score) 1300.0) - (set! (-> obj speech-count) 1) - (let ((v1-50 (whack-a-metal-method-29 obj 0 3))) + ((>= (-> this score) 1300.0) + (set! (-> this speech-count) 1) + (let ((v1-50 (whack-a-metal-method-29 this 0 3))) (cond ((zero? v1-50) (the-as int (talker-spawn-func (-> *talker-speech* 430) *entity-pool* (target-pos 0) (the-as region #f))) @@ -1925,7 +1925,7 @@ ) ) (else - (let ((v1-55 (whack-a-metal-method-29 obj 1 20))) + (let ((v1-55 (whack-a-metal-method-29 this 1 20))) (cond ((zero? v1-55) (the-as int (talker-spawn-func (-> *talker-speech* 395) *entity-pool* (target-pos 0) (the-as region #f))) @@ -1992,30 +1992,36 @@ ) ) ) - (set! (-> obj speech-time) (current-time)) + (set-time! (-> this speech-time)) ) ) - (whack-a-metal-method-28 obj) + (whack-a-metal-method-28 this) 0 (none) ) -(defmethod whack-a-metal-method-28 whack-a-metal ((obj whack-a-metal)) +(defmethod whack-a-metal-method-28 whack-a-metal ((this whack-a-metal)) (cond - ((>= (-> *game-info* score) (-> obj score)) - (set! (-> *game-info* score) (-> obj score)) + ((>= (-> *game-info* score) (-> this score)) + (set! (-> *game-info* score) (-> this score)) ) - ((and (< (-> *game-info* score) (-> obj score)) (>= (- (current-time) (-> obj score-time)) (seconds 0.1))) + ((and (< (-> *game-info* score) (-> this score)) (time-elapsed? (-> this score-time) (seconds 0.1))) (sound-play "whack-score") - (seek! (-> *game-info* score) (-> obj score) 2.0) - (set! (-> obj score-time) (current-time)) + (seek! (-> *game-info* score) (-> this score) 2.0) + (set-time! (-> this score-time)) ) ) - (let ((s5-1 (handle->process (-> obj cabinet)))) + (let ((s5-1 (handle->process (-> this cabinet)))) (when s5-1 - (spawn-with-matrix (-> obj score-part 1) (-> (the-as process-drawable s5-1) node-list data 13 bone transform)) - (spawn-with-matrix (-> obj score-part 0) (-> (the-as process-drawable s5-1) node-list data 12 bone transform)) - (dotimes (s4-1 (- 20 (-> obj miss-count))) + (spawn-with-matrix + (-> this score-part 1) + (-> (the-as process-drawable s5-1) node-list data 13 bone transform) + ) + (spawn-with-matrix + (-> this score-part 0) + (-> (the-as process-drawable s5-1) node-list data 12 bone transform) + ) + (dotimes (s4-1 (- 20 (-> this miss-count))) (set! (-> *part-id-table* 3336 init-specs 2 initial-valuef) (+ -1228.8 (* 614.4 (the float (mod s4-1 5))))) (set! (-> *part-id-table* 3336 init-specs 2 random-rangef) 0.0) (set! (-> *part-id-table* 3336 init-specs 3 initial-valuef) (- 921.6 (* 614.4 (the float (/ s4-1 5))))) @@ -2094,7 +2100,7 @@ (set-setting! 'borrow '((ctywide 1 lwidea #f) (hiphog 0 lwhack special)) 0.0 0) (want-display-level *load-state* 'ctyport #f) (want-display-level *load-state* 'ctywide #f) - (set! (-> self speech-time) (current-time)) + (set-time! (-> self speech-time)) (if (not (task-node-closed? (game-task-node city-whack-resolution))) (set! (-> self hud-goal) (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :to self))) ) @@ -2291,7 +2297,7 @@ :exit (-> (method-of-type whack-a-metal active) exit) :code (behavior ((arg0 int)) (sound-play "whack-swish") - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (dotimes (v1-3 3) (set! (-> self slot-buffer v1-3) (-> self slot-buffer (+ v1-3 1))) ) @@ -2520,7 +2526,7 @@ (+! (-> self score) 50.0) ) (else - (when (>= (- (current-time) (-> self speech-time)) (seconds 12)) + (when (time-elapsed? (-> self speech-time) (seconds 12)) (let ((v1-78 (whack-a-metal-method-29 self 3 3))) (cond ((zero? v1-78) @@ -2534,7 +2540,7 @@ ) ) ) - (set! (-> self speech-time) (current-time)) + (set-time! (-> self speech-time)) ) (process-spawn part-tracker @@ -2625,7 +2631,7 @@ ) (s5-8 (current-time)) ) - (while (or (nonzero? (get-status *gui-control* gp-1)) (< (- (current-time) s5-8) (seconds 2))) + (while (or (nonzero? (get-status *gui-control* gp-1)) (not (time-elapsed? s5-8 (seconds 2)))) (suspend) (ja :num! (loop!)) ) @@ -2696,7 +2702,7 @@ ) (s5-8 (current-time)) ) - (while (or (nonzero? (get-status *gui-control* gp-1)) (< (- (current-time) s5-8) (seconds 2))) + (while (or (nonzero? (get-status *gui-control* gp-1)) (not (time-elapsed? s5-8 (seconds 2)))) (suspend) (ja :num! (loop!)) ) diff --git a/goal_src/jak2/levels/intro/intro-obs.gc b/goal_src/jak2/levels/intro/intro-obs.gc index 1f01e738da..ea14672ab7 100644 --- a/goal_src/jak2/levels/intro/intro-obs.gc +++ b/goal_src/jak2/levels/intro/intro-obs.gc @@ -52,7 +52,7 @@ (if (= (-> self path-u) 1.0) (go-virtual die) ) - (when (>= (- (current-time) (the-as int (-> self flit-timer))) (the-as time-frame (-> self flit-interval))) + (when (time-elapsed? (the-as int (-> self flit-timer)) (the-as time-frame (-> self flit-interval))) (let ((f28-0 (rand-vu-float-range -1.0 1.0)) (f30-0 (rand-vu-float-range -1.0 1.0)) (f0-1 (rand-vu-float-range 0.2 0.6)) @@ -196,26 +196,26 @@ ) ;; WARN: Return type mismatch object vs path-control. -(defmethod intro-flamer-method-22 intro-flamer ((obj intro-flamer)) - (the-as path-control (send-event (ppointer->process (-> obj parent)) 'path (-> obj id))) +(defmethod intro-flamer-method-22 intro-flamer ((this intro-flamer)) + (the-as path-control (send-event (ppointer->process (-> this parent)) 'path (-> this id))) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! intro-flamer ((obj intro-flamer) (arg0 entity-actor)) +(defmethod init-from-entity! intro-flamer ((this intro-flamer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-intro-flamer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -316,7 +316,7 @@ This commonly includes things such as: (let ((s5-1 (the int (* 300.0 (rand-vu-float-range 0.03 0.08)))) (s4-0 (current-time)) ) - (until (>= (- (current-time) s4-0) s5-1) + (until (time-elapsed? s4-0 s5-1) (suspend) ) ) @@ -348,43 +348,43 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process vs metalhead-spawner. -(defmethod relocate metalhead-spawner ((obj metalhead-spawner) (arg0 int)) +(defmethod relocate metalhead-spawner ((this metalhead-spawner) (arg0 int)) (dotimes (v1-0 19) - (if (nonzero? (-> obj path-tbl v1-0)) - (&+! (-> obj path-tbl v1-0) arg0) + (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)) obj arg0) + ((the-as (function process int process) (find-parent-method metalhead-spawner 7)) this arg0) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! metalhead-spawner ((obj metalhead-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! metalhead-spawner ((this metalhead-spawner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj init-pos quad) (-> arg0 extra trans quad)) - (vector-reset! (-> obj average-dir)) + (set! (-> this init-pos quad) (-> arg0 extra trans quad)) + (vector-reset! (-> this average-dir)) (dotimes (s5-0 19) - (let ((s4-0 (new 'process 'curve-control obj 'path (the float (+ s5-0 1))))) - (set! (-> obj path-tbl s5-0) s4-0) + (let ((s4-0 (new 'process 'curve-control this 'path (the float (+ s5-0 1))))) + (set! (-> this path-tbl s5-0) s4-0) (logior! (-> s4-0 flags) (path-control-flag display draw-line draw-point draw-text)) (let* ((s3-0 (get-point-at-percent-along-path! s4-0 (new 'stack-no-clear 'vector) 0.0 'interp)) (v1-10 (get-point-at-percent-along-path! s4-0 (new 'stack-no-clear 'vector) 1.0 'interp)) (s4-2 (vector-! (new 'stack-no-clear 'vector) v1-10 s3-0)) ) (vector-normalize! s4-2 1.0) - (vector+! (-> obj average-dir) (-> obj average-dir) s4-2) + (vector+! (-> this average-dir) (-> this average-dir) s4-2) ) ) ) - (vector-normalize! (-> obj average-dir) 1.0) - (go (method-of-object obj idle)) + (vector-normalize! (-> this average-dir) 1.0) + (go (method-of-object this idle)) (none) ) @@ -421,20 +421,20 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vil-windmill-sail ((obj vil-windmill-sail) (arg0 entity-actor)) +(defmethod init-from-entity! vil-windmill-sail ((this vil-windmill-sail) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vil-windmill-sail" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/intro/intro-scenes.gc b/goal_src/jak2/levels/intro/intro-scenes.gc index 603fd6993a..08b8fd0c1f 100644 --- a/goal_src/jak2/levels/intro/intro-scenes.gc +++ b/goal_src/jak2/levels/intro/intro-scenes.gc @@ -2172,7 +2172,7 @@ () (talker-spawn-func (-> *talker-speech* 123) self (target-pos 0) (the-as region #f)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 5)) + (until (time-elapsed? gp-1 (seconds 5)) (if (cpad-pressed? 0 square) (return #f) ) @@ -2237,7 +2237,7 @@ (set! (-> gp-0 scale-y) 1.0) (when (and s5-0 (-> gp-0 tex)) (let ((s4-0 (current-time))) - (until (>= (- (current-time) s4-0) (seconds 5)) + (until (time-elapsed? s4-0 (seconds 5)) (let ((f0-2 1.0)) (cond ((< f30-0 2.0) @@ -2362,7 +2362,7 @@ ) (when (and s4-0 (-> gp-0 tex)) (let ((s3-0 (current-time))) - (until (>= (- (current-time) s3-0) (seconds 8)) + (until (time-elapsed? s3-0 (seconds 8)) (let ((f0-6 1.0)) (cond ((< f30-0 2.0) diff --git a/goal_src/jak2/levels/intro/vortex-data.gc b/goal_src/jak2/levels/intro/vortex-data.gc index 6352b931ec..2539b7016f 100644 --- a/goal_src/jak2/levels/intro/vortex-data.gc +++ b/goal_src/jak2/levels/intro/vortex-data.gc @@ -1290,6 +1290,7 @@ ) (define *vortex-poly* + "TODO - this is a guess based on similarly named fields, it's a MASSIVE empty array" (new 'static 'inline-array vortex-vertex 1216 (new 'static 'vortex-vertex) (new 'static 'vortex-vertex) @@ -2510,33 +2511,34 @@ ) ) -(define *vortex-tvals* (new 'static 'array float 20 - 0.129616 - 0.232515 - 0.312052 - 0.37201 - 0.416099 - 0.447693 - 0.469699 - 0.484531 - 0.494127 - 0.5 - 0.505873 - 0.515468 - 0.5303 - 0.552306 - 0.583899 - 0.627988 - 0.687946 - 0.767484 - 0.870383 - 0.0 - ) +(define *vortex-tvals* "TODO - also a guess, just a bunch of floats" (new 'static 'array float 20 + 0.129616 + 0.232515 + 0.312052 + 0.37201 + 0.416099 + 0.447693 + 0.469699 + 0.484531 + 0.494127 + 0.5 + 0.505873 + 0.515468 + 0.5303 + 0.552306 + 0.583899 + 0.627988 + 0.687946 + 0.767484 + 0.870383 + 0.0 + ) ) ;; WARN: Return type mismatch symbol vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lq ra, 0(ra)] (defun init-vortex-polys () + ;; og:preserve-this (local-vars (ra-1 uint128)) (let ((v1-0 0) (a0-0 *vortex-vert-array*) @@ -2605,6 +2607,7 @@ ) (let ((t9-3 (-> t8-2 pos))) (let ((ra-0 (-> t6-4 pos))) + ;; og:preserve-this ;(.lq ra-1 0 ra-0) (set! ra-1 (-> ra-0 quad)) ) diff --git a/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc b/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc index 8373b570d4..85334b83fe 100644 --- a/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc +++ b/goal_src/jak2/levels/mountain/canyon/mincan-obs.gc @@ -31,14 +31,14 @@ ) ) -(defmethod init-water! water-anim-mincan ((obj water-anim-mincan)) +(defmethod init-water! water-anim-mincan ((this water-anim-mincan)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((func (method-of-type water-anim init-water!))) - (func obj) + (func this) ) (let ((ripple-control (new 'process 'ripple-control))) - (set! (-> obj draw ripple) ripple-control) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) ripple-control) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> ripple-control global-scale) 3072.0) (set! (-> ripple-control close-fade-dist) 163840.0) (set! (-> ripple-control far-fade-dist) 245760.0) @@ -104,24 +104,24 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lighthouse-lens ((obj mincan-lighthouse-lens) (arg0 entity-actor)) +(defmethod init-from-entity! mincan-lighthouse-lens ((this mincan-lighthouse-lens) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mincan-lighthouse-lens" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -199,22 +199,22 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lighthouse ((obj mincan-lighthouse) (arg0 entity-actor)) +(defmethod init-from-entity! mincan-lighthouse ((this mincan-lighthouse) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mincan-lighthouse" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (process-spawn mincan-lighthouse-lens obj arg0 :to obj) - (go (method-of-object obj idle)) + (process-spawn mincan-lighthouse-lens this arg0 :to this) + (go (method-of-object this idle)) (none) ) @@ -275,14 +275,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lens ((obj mincan-lens) (arg0 entity-actor)) +(defmethod init-from-entity! mincan-lens ((this mincan-lens) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 7) 0))) (set! (-> cshape total-prims) (the-as uint 8)) (set! (-> prim-group prim-core collide-as) (collide-spec obstacle)) @@ -345,15 +345,15 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mincan-lens" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj closed)) + (go (method-of-object this closed)) (none) ) @@ -391,20 +391,20 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-cogs ((obj mincan-cogs) (arg0 entity-actor)) +(defmethod init-from-entity! mincan-cogs ((this mincan-cogs) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mincan-cogs" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/mountain/mountain-obs.gc b/goal_src/jak2/levels/mountain/mountain-obs.gc index 6f2eecd644..0e9369c9fe 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs.gc @@ -66,32 +66,32 @@ ) -(defmethod basebutton-method-33 mtn-dice-button ((obj mtn-dice-button)) +(defmethod basebutton-method-33 mtn-dice-button ((this mtn-dice-button)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-dice-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) - (let ((s5-1 (-> obj skel root-channel 0))) + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) ) ) (else - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) @@ -102,9 +102,9 @@ (none) ) -(defmethod basebutton-method-34 mtn-dice-button ((obj mtn-dice-button)) +(defmethod basebutton-method-34 mtn-dice-button ((this mtn-dice-button)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -120,17 +120,17 @@ (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod prepare-trigger-event! mtn-dice-button ((obj mtn-dice-button)) +(defmethod prepare-trigger-event! mtn-dice-button ((this mtn-dice-button)) "Sets `event-going-down` to `'trigger`" - (logior! (-> obj button-status) (button-status button-status-4)) - (logior! (-> obj button-status) (button-status pressed)) - (set! (-> obj event-going-down) 'trigger) + (logior! (-> this button-status) (button-status button-status-4)) + (logior! (-> this button-status) (button-status pressed)) + (set! (-> this event-going-down) 'trigger) 0 (none) ) @@ -319,15 +319,15 @@ :bounds (static-spherem 0 0 0 100) ) -(defmethod mtn-dice-method-25 mtn-dice ((obj mtn-dice) (arg0 int)) - (let ((s4-0 (-> obj face-matrix arg0))) +(defmethod mtn-dice-method-25 mtn-dice ((this mtn-dice) (arg0 int)) + (let ((s4-0 (-> this face-matrix arg0))) (dotimes (s3-0 6) - (let* ((v1-4 (-> obj face-matrix s3-0)) + (let* ((v1-4 (-> this face-matrix s3-0)) (f0-2 (fabs (vector-dot (the-as vector s4-0) (the-as vector v1-4)))) ) - (when (and (!= s3-0 arg0) (zero? (-> obj face-status s3-0)) (< f0-2 0.001)) - (set! (-> obj face-status s3-0) 1) - (mtn-dice-method-25 obj s3-0) + (when (and (!= s3-0 arg0) (zero? (-> this face-status s3-0)) (< f0-2 0.001)) + (set! (-> this face-status s3-0) 1) + (mtn-dice-method-25 this s3-0) ) ) ) @@ -356,12 +356,12 @@ ) ) (sound-play "dice-sink") - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (set! (-> self draw color-mult quad) (-> self color quad)) (cond - ((>= (- (current-time) (-> self state-time)) (seconds 0.5)) + ((time-elapsed? (-> self state-time) (seconds 0.5)) (+! (-> self speed-anim) (* -0.5 (seconds-per-frame) (-> self time-anim))) (+! (-> self speed-anim) (* -6.0 (seconds-per-frame) (-> self speed-anim))) (+! (-> self time-anim) (-> self speed-anim)) @@ -373,7 +373,7 @@ (set! (-> self active) (the-as uint 3)) ) ) - (when (and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (!= (-> self active) 2)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.5)) (!= (-> self active) 2)) (set! (-> self active) (the-as uint 2)) (dotimes (gp-0 6) (matrix-rotate-xyz! (-> self face-matrix gp-0) (-> *dice-angle-array* gp-0)) @@ -405,7 +405,7 @@ (+ (-> self face-matrix-back v1-51 trans y) (* 4096.0 (-> self time-anim))) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 2)) + (when (time-elapsed? (-> self state-time) (seconds 2)) (set! (-> self active) (-> self first)) (go-virtual idle) ) @@ -414,7 +414,7 @@ :post transform-post ) -(defmethod mtn-dice-method-26 mtn-dice ((obj mtn-dice) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod mtn-dice-method-26 mtn-dice ((this mtn-dice) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (sv-96 vector) (sv-112 vector) (sv-128 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -443,17 +443,17 @@ ) (let ((s1-1 (-> arg1 head))) (while s1-1 - (let ((v1-4 (get-touched-prim s1-1 (-> obj root) arg1))) + (let ((v1-4 (get-touched-prim s1-1 (-> this root) arg1))) (-> v1-4 cshape) (set! sv-128 (new 'stack-no-clear 'vector)) (set! (-> sv-128 quad) (the-as uint128 0)) (set! sv-112 (new 'stack-no-clear 'vector)) (let ((s0-1 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) - (when (>= (-> obj face-status (-> v1-4 prim-id)) 0) - (set! (-> sv-128 quad) (-> obj face-matrix (-> v1-4 prim-id) quad 0)) - (set! (-> sv-128 w) (- (vector-dot (-> obj face-matrix (-> v1-4 prim-id) trans) sv-128))) - (set! (-> sv-112 quad) (-> obj face-matrix (-> v1-4 prim-id) trans quad)) + (when (>= (-> this face-status (-> v1-4 prim-id)) 0) + (set! (-> sv-128 quad) (-> this face-matrix (-> v1-4 prim-id) quad 0)) + (set! (-> sv-128 w) (- (vector-dot (-> this face-matrix (-> v1-4 prim-id) trans) sv-128))) + (set! (-> sv-112 quad) (-> this face-matrix (-> v1-4 prim-id) trans quad)) (let ((f0-4 (vector4-dot sv-128 (-> s4-0 trans))) (f28-0 (vector-dot sv-128 s3-1)) ) @@ -482,7 +482,7 @@ ) ) (let ((a0-40 sv-112)) - (let ((v1-8 (-> obj face-matrix (-> v1-4 prim-id) trans))) + (let ((v1-8 (-> this face-matrix (-> v1-4 prim-id) trans))) (let ((a1-26 sv-128)) (let ((a2-10 16384.0)) (.mov vf7 a2-10) @@ -498,7 +498,7 @@ ) (vector-negate-in-place! sv-128) (set! f28-0 (- f28-0)) - (if (!= (-> obj free-face) 5) + (if (!= (-> this free-face) 5) (set! f28-0 1.0) ) ) @@ -537,7 +537,7 @@ ) ) -(defmethod mtn-dice-method-27 mtn-dice ((obj mtn-dice) (arg0 collide-shape) (arg1 process-focusable) (arg2 touching-shapes-entry)) +(defmethod mtn-dice-method-27 mtn-dice ((this mtn-dice) (arg0 collide-shape) (arg1 process-focusable) (arg2 touching-shapes-entry)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -553,9 +553,12 @@ ) ) (when s0-0 - (let ((s5-1 - ((method-of-type touching-prims-entry get-touched-prim) (the-as touching-prims-entry arg0) (-> obj root) arg2) - ) + (let ((s5-1 ((method-of-type touching-prims-entry get-touched-prim) + (the-as touching-prims-entry arg0) + (-> this root) + arg2 + ) + ) ) (-> s5-1 cshape) (let ((s1-0 (new-stack-vector0)) @@ -563,7 +566,7 @@ (s3-1 (new 'stack-no-clear 'vector)) (s4-1 (new 'stack-no-clear 'vector)) ) - (let ((v1-6 (-> obj face-matrix (-> s5-1 prim-id)))) + (let ((v1-6 (-> this face-matrix (-> s5-1 prim-id)))) (set! (-> s1-0 quad) (-> v1-6 vector 0 quad)) (set! (-> s1-0 w) (- (vector-dot (-> v1-6 trans) s1-0))) (set! (-> s4-1 quad) (-> v1-6 trans quad)) @@ -590,11 +593,11 @@ (set! (-> s2-0 y) 1.0) (vector-cross! s3-1 s2-0 s1-0) (vector-normalize! s3-1 1.0) - (set! (-> obj rot-axis quad) (-> s3-1 quad)) - (set! (-> obj rot-org quad) (-> s4-1 quad)) + (set! (-> this rot-axis quad) (-> s3-1 quad)) + (set! (-> this rot-org quad) (-> s4-1 quad)) ) - (set! (-> obj face-status (-> s5-1 prim-id)) 1) - (mtn-dice-method-25 obj (the-as int (-> s5-1 prim-id))) + (set! (-> this face-status (-> s5-1 prim-id)) 1) + (mtn-dice-method-25 this (the-as int (-> s5-1 prim-id))) ) ) ) @@ -856,9 +859,9 @@ ) :trans (behavior () (if (nonzero? (-> self curtime)) - (set! (-> self first-touch-time) (current-time)) + (set-time! (-> self first-touch-time)) ) - (set! (-> self curtime) (current-time)) + (set-time! (-> self curtime)) (when (and (zero? (-> self active)) (dice-wrong-way?)) ) ) @@ -938,7 +941,7 @@ (set! (-> a0-2 trans quad) t0-1) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self time-anim) 1.0) (set! (-> self speed-anim) -0.5) ) @@ -959,7 +962,7 @@ (set! (-> self time-anim) 0.0) (set! (-> self speed-anim) (- (-> self speed-anim))) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.7)) + (if (time-elapsed? (-> self state-time) (seconds 0.7)) (set! (-> self time-anim) 0.0) ) (let ((s4-0 (new 'stack-no-clear 'matrix)) @@ -981,7 +984,7 @@ ) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.7)) + (when (time-elapsed? (-> self state-time) (seconds 0.7)) (dotimes (v1-34 6) (when (= (-> self face-status v1-34) 1) (set! (-> self face-status v1-34) 0) @@ -1002,7 +1005,7 @@ :enter (behavior () (set! (-> self time-anim) 0.0) (set! (-> self speed-anim) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "dice-sink") ) :trans (behavior () @@ -1013,7 +1016,7 @@ (dotimes (v1-5 6) (+! (-> self face-matrix v1-5 trans y) (* 4096.0 (-> self time-anim))) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (dotimes (v1-11 6) (when (= (-> self face-status v1-11) 1) (set! (-> self face-status v1-11) 0) @@ -1291,14 +1294,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-dice ((obj mtn-dice) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-dice ((this mtn-dice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 6) 0))) (set! (-> s4-0 total-prims) (the-as uint 7)) (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) @@ -1355,24 +1358,24 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-23 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-dice" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel postbind-function) dice-joint-callback) - (set! (-> obj first) (the-as uint 0)) + (set! (-> this skel postbind-function) dice-joint-callback) + (set! (-> this first) (the-as uint 0)) (let ((v1-30 (res-lump-value arg0 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) (if (= (the-as uint v1-30) 2) - (set! (-> obj first) (the-as uint 1)) + (set! (-> this first) (the-as uint 1)) ) ) - (let* ((a0-48 (the int (* 0.00024414062 (-> obj root trans x)))) - (v1-37 (the int (* 0.00024414062 (-> obj root trans y)))) - (a1-21 (the int (* 0.00024414062 (-> obj root trans z)))) + (let* ((a0-48 (the int (* 0.00024414062 (-> this root trans x)))) + (v1-37 (the int (* 0.00024414062 (-> this root trans y)))) + (a1-21 (the int (* 0.00024414062 (-> this root trans z)))) (a0-49 (- a0-48 *dice-offset-x*)) (a2-13 (- a1-21 *dice-offset-z*)) (a1-22 (+ a0-49 1)) @@ -1383,55 +1386,55 @@ This commonly includes things such as: (a1-24 (+ a1-23 *dice-offset-x*)) (a0-52 (+ a0-51 *dice-offset-z*)) ) - (set! (-> obj root trans x) (* 4096.0 (the float a1-24))) - (set! (-> obj root trans y) (* 4096.0 (the float v1-38))) - (set! (-> obj root trans z) (* 4096.0 (the float a0-52))) + (set! (-> this root trans x) (* 4096.0 (the float a1-24))) + (set! (-> this root trans y) (* 4096.0 (the float v1-38))) + (set! (-> this root trans z) (* 4096.0 (the float a0-52))) ) (dotimes (s4-2 6) - (matrix-rotate-xyz! (-> obj face-matrix s4-2) (-> *dice-angle-array* s4-2)) - (set! (-> obj face-matrix s4-2 trans quad) (-> *dice-position-array* s4-2 quad)) - (vector+! (-> obj face-matrix s4-2 trans) (-> obj face-matrix s4-2 trans) (-> obj root trans)) - (+! (-> obj face-matrix s4-2 trans y) 8192.0) + (matrix-rotate-xyz! (-> this face-matrix s4-2) (-> *dice-angle-array* s4-2)) + (set! (-> this face-matrix s4-2 trans quad) (-> *dice-position-array* s4-2 quad)) + (vector+! (-> this face-matrix s4-2 trans) (-> this face-matrix s4-2 trans) (-> this root trans)) + (+! (-> this face-matrix s4-2 trans y) 8192.0) ) (mem-set32! (the-as pointer *dice-blocked-array*) 13 0) (set! (-> *dice-blocked-array* 1) (the-as uint 256)) (set! *dice-back-way-num* 0) (set-vector! *dice-last-safe-position* -2603417.5 384983.03 -107683.84 1.0) - (set-vector! (-> obj color) 0.5 0.5 0.5 1.0) - (set! (-> obj free-face) (the-as uint 6)) - (set! (-> obj watervol) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj hint-count) 0.0) - (set! (-> obj active) (-> obj first)) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (set-vector! (-> this color) 0.5 0.5 0.5 1.0) + (set! (-> this free-face) (the-as uint 6)) + (set! (-> this watervol) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this hint-count) 0.0) + (set! (-> this active) (-> this first)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (cond ((task-node-closed? (game-task-node mountain-shard-dice)) (let ((v1-71 (res-lump-value arg0 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) (dotimes (a0-76 6) (let ((a1-42 (-> *mtn-dice-done-info* (+ a0-76 (* 6 (the-as int (+ v1-71 -1))))))) - (set! (-> obj face-matrix a0-76 vector 0 x) (-> a1-42 mat 0)) - (set! (-> obj face-matrix a0-76 vector 0 y) (-> a1-42 mat 1)) - (set! (-> obj face-matrix a0-76 vector 0 z) (-> a1-42 mat 2)) - (set! (-> obj face-matrix a0-76 vector 0 w) 0.0) - (set! (-> obj face-matrix a0-76 vector 1 x) (-> a1-42 mat 3)) - (set! (-> obj face-matrix a0-76 vector 1 y) (-> a1-42 mat 4)) - (set! (-> obj face-matrix a0-76 vector 1 z) (-> a1-42 mat 5)) - (set! (-> obj face-matrix a0-76 vector 1 w) 0.0) - (set! (-> obj face-matrix a0-76 vector 2 x) (-> a1-42 mat 6)) - (set! (-> obj face-matrix a0-76 vector 2 y) (-> a1-42 mat 7)) - (set! (-> obj face-matrix a0-76 vector 2 z) (-> a1-42 mat 8)) - (set! (-> obj face-matrix a0-76 vector 2 w) 0.0) - (set! (-> obj face-matrix a0-76 trans x) (-> a1-42 mat 9)) - (set! (-> obj face-matrix a0-76 trans y) (-> a1-42 mat 10)) - (set! (-> obj face-matrix a0-76 trans z) (-> a1-42 mat 11)) + (set! (-> this face-matrix a0-76 vector 0 x) (-> a1-42 mat 0)) + (set! (-> this face-matrix a0-76 vector 0 y) (-> a1-42 mat 1)) + (set! (-> this face-matrix a0-76 vector 0 z) (-> a1-42 mat 2)) + (set! (-> this face-matrix a0-76 vector 0 w) 0.0) + (set! (-> this face-matrix a0-76 vector 1 x) (-> a1-42 mat 3)) + (set! (-> this face-matrix a0-76 vector 1 y) (-> a1-42 mat 4)) + (set! (-> this face-matrix a0-76 vector 1 z) (-> a1-42 mat 5)) + (set! (-> this face-matrix a0-76 vector 1 w) 0.0) + (set! (-> this face-matrix a0-76 vector 2 x) (-> a1-42 mat 6)) + (set! (-> this face-matrix a0-76 vector 2 y) (-> a1-42 mat 7)) + (set! (-> this face-matrix a0-76 vector 2 z) (-> a1-42 mat 8)) + (set! (-> this face-matrix a0-76 vector 2 w) 0.0) + (set! (-> this face-matrix a0-76 trans x) (-> a1-42 mat 9)) + (set! (-> this face-matrix a0-76 trans y) (-> a1-42 mat 10)) + (set! (-> this face-matrix a0-76 trans z) (-> a1-42 mat 11)) ) - (set! (-> obj face-matrix a0-76 trans w) 1.0) + (set! (-> this face-matrix a0-76 trans w) 1.0) ) ) - (go (method-of-object obj idle-done)) + (go (method-of-object this idle-done)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1451,39 +1454,39 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 7) ) -(defmethod get-art-group mtn-plat-elevator ((obj mtn-plat-elevator)) +(defmethod get-art-group mtn-plat-elevator ((this mtn-plat-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-elevator" (the-as (pointer uint32) #f)) ) -(defmethod set-ambient-sound! mtn-plat-elevator ((obj mtn-plat-elevator)) +(defmethod set-ambient-sound! mtn-plat-elevator ((this mtn-plat-elevator)) "Sets the elevator's [[ambient-sound]] up" - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "mtn-elevator-lp" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "mtn-elevator-lp" :fo-max 70) (-> this root trans)) ) 0 (none) ) -(defmethod move-between-points mtn-plat-elevator ((obj mtn-plat-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points mtn-plat-elevator ((this mtn-plat-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) ) (and (< (-> a0-3 y) (-> s4-0 y)) - (< (-> arg0 y) (+ -4096.0 (-> obj root trans y))) + (< (-> arg0 y) (+ -4096.0 (-> this root trans y))) (< (vector-vector-xz-distance a0-3 arg0) 24576.0) ) ) ) -(defmethod init-plat-collision! mtn-plat-elevator ((obj mtn-plat-elevator)) +(defmethod init-plat-collision! mtn-plat-elevator ((this mtn-plat-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -1499,7 +1502,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -1552,9 +1555,9 @@ This commonly includes things such as: :post plat-post ) -(defmethod init-plat-collision! mtn-plat-updown ((obj mtn-plat-updown)) +(defmethod init-plat-collision! mtn-plat-updown ((this mtn-plat-updown)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -1570,51 +1573,51 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-updown ((obj mtn-plat-updown) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-plat-updown ((this mtn-plat-updown) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-plat-updown" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) (set! (-> a0-5 param 0) 1.0) (set! (-> a0-5 frame-num) 0.0) (joint-control-channel-group! a0-5 - (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) num-func-loop! ) ) (ja-post) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 arg0 #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-7 (new 'stack-no-clear 'sync-info-params))) (let ((v1-24 0)) - (if (not (logtest? (-> obj fact options) (actor-option loop))) + (if (not (logtest? (-> this fact options) (actor-option loop))) (set! v1-24 (logior v1-24 1)) ) (set! (-> a1-7 sync-type) 'sync-eased) @@ -1627,17 +1630,17 @@ This commonly includes things such as: (set! (-> a1-7 ease-out) 0.15) (set! (-> a1-7 pause-in) 0.2) (set! (-> a1-7 pause-out) 0.0) - (initialize! (-> obj sync) a1-7) + (initialize! (-> this sync) a1-7) ) (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) - (go (method-of-object obj idle)) + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this idle)) ) - ((> (-> obj sync period) 0) - (go (method-of-object obj active)) + ((> (-> this sync period) 0) + (go (method-of-object this active)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1692,8 +1695,8 @@ This commonly includes things such as: ) ) -(defmethod mtn-plat-eject-method-22 mtn-plat-eject ((obj mtn-plat-eject)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod mtn-plat-eject-method-22 mtn-plat-eject ((this mtn-plat-eject)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -1708,39 +1711,39 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-eject ((obj mtn-plat-eject) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-plat-eject ((this mtn-plat-eject) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (mtn-plat-eject-method-22 obj) - (process-drawable-from-entity! obj arg0) + (mtn-plat-eject-method-22 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-plat-eject" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj dest-pos quad) (-> obj root trans quad)) + (set! (-> this dest-pos quad) (-> this root trans quad)) (let ((s5-2 (new 'stack-no-clear 'vector))) (set! (-> s5-2 x) 0.0) (set! (-> s5-2 y) 0.0) (set! (-> s5-2 z) -40960.0) (set! (-> s5-2 w) 1.0) - (vector-orient-by-quat! s5-2 s5-2 (-> obj root quat)) - (vector+! (-> obj root trans) (-> obj root trans) s5-2) + (vector-orient-by-quat! s5-2 s5-2 (-> this root quat)) + (vector+! (-> this root trans) (-> this root trans) s5-2) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj eject)) - (go (method-of-object obj wait)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this eject)) + (go (method-of-object this wait)) ) (none) ) @@ -1786,9 +1789,9 @@ This commonly includes things such as: :post plat-post ) -(defmethod init-plat-collision! mtn-plat-long ((obj mtn-plat-long)) +(defmethod init-plat-collision! mtn-plat-long ((this mtn-plat-long)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -1804,36 +1807,36 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-long ((obj mtn-plat-long) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-plat-long ((this mtn-plat-long) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-plat-long" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (stop-bouncing! obj) - (update-transforms (-> obj root)) - (base-plat-method-32 obj) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (stop-bouncing! this) + (update-transforms (-> this root)) + (base-plat-method-32 this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-5 (new 'stack-no-clear 'sync-info-params))) (let ((v1-13 0)) - (if (not (logtest? (-> obj fact options) (actor-option loop))) + (if (not (logtest? (-> this fact options) (actor-option loop))) (set! v1-13 (logior v1-13 1)) ) (set! (-> a1-5 sync-type) 'sync-linear) @@ -1842,9 +1845,9 @@ This commonly includes things such as: (set! (-> a1-5 entity) arg0) (set! (-> a1-5 period) (the-as uint 1200)) (set! (-> a1-5 percent) 0.0) - (initialize! (-> obj sync) a1-5) + (initialize! (-> this sync) a1-5) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1886,7 +1889,7 @@ This commonly includes things such as: ) (set-setting! 'entity-name "camera-259" 0.0 0) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1896,7 +1899,7 @@ This commonly includes things such as: (ja :num! (seek!)) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -1909,14 +1912,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-gate ((obj mtn-gate) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-gate ((this mtn-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1943,25 +1946,25 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-gate" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-push! 1 0) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1984,11 +1987,11 @@ This commonly includes things such as: ;; WARN: Return type mismatch process-drawable vs mtn-aval-rocks. -(defmethod relocate mtn-aval-rocks ((obj mtn-aval-rocks) (arg0 int)) - (if (nonzero? (-> obj rock-data)) - (&+! (-> obj rock-data) arg0) +(defmethod relocate mtn-aval-rocks ((this mtn-aval-rocks) (arg0 int)) + (if (nonzero? (-> this rock-data)) + (&+! (-> this rock-data) arg0) ) - (the-as mtn-aval-rocks ((method-of-type process-drawable relocate) obj arg0)) + (the-as mtn-aval-rocks ((method-of-type process-drawable relocate) this arg0)) ) (deftype mtn-aval-rocks-shadow (process-drawable) @@ -2368,7 +2371,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-aval-rocks ((obj mtn-aval-rocks) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-aval-rocks ((this mtn-aval-rocks) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2376,8 +2379,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-sphere) (sv-48 collide-shape-prim-sphere) (sv-64 vector)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 49) 0))) (set! (-> s4-0 total-prims) (the-as uint 50)) @@ -2466,41 +2469,43 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-27 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-27 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) 32768.0) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) 32768.0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-aval-rocks-1" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (set! (-> obj art-name) (the-as symbol "mtn-aval-rocks-1")) - (set! (-> obj anim) + (logior! (-> this skel status) (joint-control-status sync-math)) + (set! (-> this art-name) (the-as symbol "mtn-aval-rocks-1")) + (set! (-> this anim) (new 'static 'spool-anim :name "mtn-aval-rocks-1" :anim-name "1-fall" :parts 8 :command-list '()) ) - (set! (-> obj loop-id) (new-sound-id)) - (set! (-> obj rock-data) (new 'process 'vector-array (-> obj node-list length))) - (dotimes (v1-42 (-> obj node-list length)) + (set! (-> this loop-id) (new-sound-id)) + (set! (-> this rock-data) (new 'process 'vector-array (-> this node-list length))) + (dotimes (v1-42 (-> this node-list length)) (let* ((a0-21 *game-info*) (a1-13 (the-as number (+ (-> a0-21 attack-id) 1))) ) (set! (-> a0-21 attack-id) (the-as uint a1-13)) - (set! (-> obj rock-data data v1-42 z) (the-as float a1-13)) + (set! (-> this rock-data data v1-42 z) (the-as float a1-13)) ) - (set! (-> obj rock-data data v1-42 w) 0.0) + (set! (-> this rock-data data v1-42 w) 0.0) ) - (let ((a2-7 (matrix<-transformq! (-> obj node-list data 0 bone transform) (the-as transformq (-> obj root trans)))) + (let ((a2-7 + (matrix<-transformq! (-> this node-list data 0 bone transform) (the-as transformq (-> this root trans))) + ) (a1-17 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-17 quad) (-> obj draw bounds quad)) + (set! (-> a1-17 quad) (-> this draw bounds quad)) (set! (-> a1-17 w) 1.0) - (vector-matrix*! (-> obj draw origin) a1-17 a2-7) + (vector-matrix*! (-> this draw origin) a1-17 a2-7) ) - (set! (-> obj draw origin w) (-> obj draw bounds w)) - (go (method-of-object obj idle)) + (set! (-> this draw origin w) (-> this draw bounds w)) + (go (method-of-object this idle)) (none) ) @@ -2545,16 +2550,16 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) ) :trans (behavior () (logclear! (-> self flags) (mtn-plat-flags mtpflags-0)) (plat-trans) (if (not (logtest? (-> self flags) (mtn-plat-flags mtpflags-0))) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) ) - (let ((v1-10 (and (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) + (let ((v1-10 (and (time-elapsed? (-> self ride-timer) (seconds 0.5)) (logtest? (-> self flags) (mtn-plat-flags mtpflags-0)) (if (logtest? (-> self flags) (mtn-plat-flags mtpflags-1)) (and *target* (process-grab? *target* #f)) @@ -2627,7 +2632,7 @@ This commonly includes things such as: ) :trans (behavior () (plat-trans) - (when (>= (- (current-time) (-> self ride-timer)) (seconds 1)) + (when (time-elapsed? (-> self ride-timer) (seconds 1)) (cond ((= (-> self path-pos) 1.0) (set! (-> self dest-pos) 0.0) @@ -2644,14 +2649,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod mtn-plat-return-method-37 mtn-plat-return ((obj mtn-plat-return)) - (go (method-of-object obj waiting)) +(defmethod mtn-plat-return-method-37 mtn-plat-return ((this mtn-plat-return)) + (go (method-of-object this waiting)) (none) ) -(defmethod init-plat-collision! mtn-plat-return ((obj mtn-plat-return)) +(defmethod init-plat-collision! mtn-plat-return ((this mtn-plat-return)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -2667,43 +2672,43 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) -(defmethod init-from-entity! mtn-plat-return ((obj mtn-plat-return) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-plat-return ((this mtn-plat-return) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-plat-return" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (stop-bouncing! obj) - (set! (-> obj flags) (mtn-plat-flags)) - (set! (-> obj path-pos) 0.0) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (if (logtest? (-> obj path flags) (path-control-flag not-found)) + (stop-bouncing! this) + (set! (-> this flags) (mtn-plat-flags)) + (set! (-> this path-pos) 0.0) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (if (logtest? (-> this path flags) (path-control-flag not-found)) (go process-drawable-art-error "error in path") ) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (let ((f30-0 (total-distance (-> obj path)))) - (set! (-> obj path-speed) (/ (res-lump-float arg0 'speed :default 40960.0) f30-0)) - (set! (-> obj root pause-adjust-distance) (+ 204800.0 f30-0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((f30-0 (total-distance (-> this path)))) + (set! (-> this path-speed) (/ (res-lump-float arg0 'speed :default 40960.0) f30-0)) + (set! (-> this root pause-adjust-distance) (+ 204800.0 f30-0)) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "mtn-plat-lp" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "mtn-plat-lp" :fo-max 70) (-> this root trans)) ) - (init-plat! obj) - (mtn-plat-return-method-37 obj) + (init-plat! this) + (mtn-plat-return-method-37 this) (none) ) @@ -2848,14 +2853,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-button ((obj mtn-button) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-button ((this mtn-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) @@ -2884,25 +2889,25 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj on-activate) (res-lump-struct (-> obj entity) 'on-activate symbol)) - (let ((a0-22 (-> obj skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> this on-activate) (res-lump-struct (-> this entity) 'on-activate symbol)) + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-22 param 0) 1.0) (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) (transform-post) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj pressed) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this pressed) #t) + (go (method-of-object this idle)) ) (none) ) @@ -2955,7 +2960,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-gear-device ((obj mtn-gear-device) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-gear-device ((this mtn-gear-device) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2964,7 +2969,7 @@ This commonly includes things such as: - sounds" (cond ((task-complete? *game-info* (game-task mountain-gear)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s4-0 total-prims) (the-as uint 10)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -3042,21 +3047,21 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-29 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-29 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-gear-device-collapse" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (go (method-of-object obj idle-collapsed)) + (go (method-of-object this idle-collapsed)) ) (else - (let ((s4-2 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-2 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-38 (new 'process 'collide-shape-prim-sphere s4-2 (the-as uint 0)))) (set! (-> v1-38 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-38 prim-core collide-with) (collide-spec jak bot player-list)) @@ -3071,29 +3076,29 @@ This commonly includes things such as: (set! (-> s4-2 backup-collide-as) (-> v1-41 prim-core collide-as)) (set! (-> s4-2 backup-collide-with) (-> v1-41 prim-core collide-with)) ) - (set! (-> obj root) s4-2) + (set! (-> this root) s4-2) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-gear-device" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj root pause-adjust-distance) 450560.0) - (add-connection *part-engine* obj 24 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 25 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 21 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 22 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 14 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 13 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 15 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 16 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 17 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 18 obj 1492 (new 'static 'vector :w 163840.0)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "mtn-gear-device" :fo-max 90) (-> obj root trans)) + (set! (-> this root pause-adjust-distance) 450560.0) + (add-connection *part-engine* this 24 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 25 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 21 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 22 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 14 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 13 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 15 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 16 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 17 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 18 this 1492 (new 'static 'vector :w 163840.0)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "mtn-gear-device" :fo-max 90) (-> this root trans)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -3121,14 +3126,14 @@ This commonly includes things such as: ) ) -(defmethod init-water! water-anim-mountain ((obj water-anim-mountain)) +(defmethod init-water! water-anim-mountain ((this water-anim-mountain)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) @@ -3246,23 +3251,23 @@ This commonly includes things such as: :virtual #t :trans (behavior () (plat-trans) - (if (>= (- (current-time) (-> self ride-timer)) (seconds 1)) + (if (time-elapsed? (-> self ride-timer) (seconds 1)) (go-virtual waiting) ) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod mtn-plat-return-method-37 trans-plat ((obj trans-plat)) - (go (method-of-object obj rising)) +(defmethod mtn-plat-return-method-37 trans-plat ((this trans-plat)) + (go (method-of-object this rising)) (none) ) ;; WARN: Return type mismatch float vs none. -(defmethod init-plat! trans-plat ((obj trans-plat)) +(defmethod init-plat! trans-plat ((this trans-plat)) "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." - (logior! (-> obj flags) (mtn-plat-flags mtpflags-1)) + (logior! (-> this flags) (mtn-plat-flags mtpflags-1)) (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) s5-0 @@ -3271,10 +3276,10 @@ For example for an elevator pre-compute the distance between the first and last ) (when a0-2 (let ((s4-0 (get-trans a0-2 0)) - (s3-0 (-> obj path)) + (s3-0 (-> this path)) (f28-0 0.0) (f30-0 -1.0) - (s5-1 (-> obj path curve num-cverts)) + (s5-1 (-> this path curve num-cverts)) ) (dotimes (s2-0 s5-1) (let ((f0-2 @@ -3288,7 +3293,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (if (!= f30-0 -1.0) - (set! (-> obj path-pos) (/ f30-0 (+ -1.0 (the float s5-1)))) + (set! (-> this path-pos) (/ f30-0 (+ -1.0 (the float s5-1)))) ) ) ) diff --git a/goal_src/jak2/levels/mountain/mountain-obs2.gc b/goal_src/jak2/levels/mountain/mountain-obs2.gc index cdf2f5db19..6c429f330b 100644 --- a/goal_src/jak2/levels/mountain/mountain-obs2.gc +++ b/goal_src/jak2/levels/mountain/mountain-obs2.gc @@ -65,14 +65,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-iris-door ((obj mtn-iris-door) (entity entity-actor)) +(defmethod init-from-entity! mtn-iris-door ((this mtn-iris-door) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -87,15 +87,15 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-iris-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj close)) + (go (method-of-object this close)) (none) ) @@ -124,14 +124,14 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 5.1) ) -(defmethod get-art-group mtn-plat-shoot ((obj mtn-plat-shoot)) +(defmethod get-art-group mtn-plat-shoot ((this mtn-plat-shoot)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-shoot" (the-as (pointer uint32) #f)) ) -(defmethod init-plat-collision! mtn-plat-shoot ((obj mtn-plat-shoot)) +(defmethod init-plat-collision! mtn-plat-shoot ((this mtn-plat-shoot)) "TODO - collision stuff for setting up the platform" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec pusher)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -147,35 +147,37 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving cshape)) + (set! (-> this root) (the-as collide-shape-moving cshape)) ) 0 (none) ) -(defmethod base-plat-method-32 mtn-plat-shoot ((obj mtn-plat-shoot)) +(defmethod base-plat-method-32 mtn-plat-shoot ((this mtn-plat-shoot)) 0 (none) ) -(defmethod init-plat! mtn-plat-shoot ((obj mtn-plat-shoot)) +(defmethod init-plat! mtn-plat-shoot ((this mtn-plat-shoot)) "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." - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask enemy)) - (set-vector! (-> obj axe-flip) 1.0 0.0 0.0 1.0) - (set! (-> obj angle-flip) 180.0) - (set! (-> obj time-flip) (the float (the int (* 300.0 (res-lump-float (-> obj entity) 'delay :default 4.0))))) - (set! (-> obj disable-track-under) #f) - (if (>= (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj disable-track-under) (the-as basic #t)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask enemy)) + (set-vector! (-> this axe-flip) 1.0 0.0 0.0 1.0) + (set! (-> this angle-flip) 180.0) + (set! (-> this time-flip) + (the float (the int (* 300.0 (res-lump-float (-> this entity) 'delay :default 4.0)))) + ) + (set! (-> this disable-track-under) #f) + (if (>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) + (set! (-> this disable-track-under) (the-as basic #t)) ) - (set! (-> obj hint-count) 0.0) + (set! (-> this hint-count) 0.0) (if (> (you-suck-stage *game-info* #f) 0) - (set! (-> obj hint-count) 5.0) + (set! (-> this hint-count) 5.0) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "shoot-plat-lp" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "shoot-plat-lp" :fo-max 70) (-> this root trans)) ) 0 (none) @@ -218,7 +220,7 @@ For example for an elevator pre-compute the distance between the first and last (vector-normalize! (-> self axe-flip) 1.0) (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) (set! (-> self angle-flip-vel) -10.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -267,10 +269,10 @@ For example for an elevator pre-compute the distance between the first and last ) (set! (-> self dest-angle) 180.0) (set! (-> self on-shake) #f) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (the int (-> self time-flip))) + (when (time-elapsed? (-> self state-time) (the int (-> self time-flip))) (set! (-> self state-flip) (the-as uint 0)) 0 ) @@ -292,9 +294,7 @@ For example for an elevator pre-compute the distance between the first and last (+! (-> self angle-flip-vel) (* -6.0 (seconds-per-frame) (-> self angle-flip-vel))) (+! (-> self angle-flip) (-> self angle-flip-vel)) (quaternion-vector-angle! (-> self root quat) (-> self axe-flip) (* 182.04445 (-> self angle-flip))) - (when (and (>= (- (current-time) (-> self state-time)) (the int (+ -300.0 (-> self time-flip)))) - (= 1 (-> self state-flip)) - ) + (when (and (time-elapsed? (-> self state-time) (the int (+ -300.0 (-> self time-flip)))) (= 1 (-> self state-flip))) (when (not (-> self on-shake)) (sound-play "mtn-plat-shake") (set! (-> self on-shake) #t) diff --git a/goal_src/jak2/levels/mountain/mountain-scenes.gc b/goal_src/jak2/levels/mountain/mountain-scenes.gc index 187a130a6f..8fbe792b83 100644 --- a/goal_src/jak2/levels/mountain/mountain-scenes.gc +++ b/goal_src/jak2/levels/mountain/mountain-scenes.gc @@ -1692,14 +1692,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-buried-rocks ((obj mtn-plat-buried-rocks) (entity entity-actor)) +(defmethod init-from-entity! mtn-plat-buried-rocks ((this mtn-plat-buried-rocks) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -1714,25 +1714,25 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-plat-buried-rocks" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj draw force-lod) 1) + (set! (-> this draw force-lod) 1) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj done) #t) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this done) #t) ) (else - (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-plat-buried-rocks-a" -99.0 0) - (go (method-of-object obj idle)) + (add-process *gui-control* this (gui-channel art-load) (gui-action queue) "mtn-plat-buried-rocks-a" -99.0 0) + (go (method-of-object this idle)) ) ) (none) @@ -1755,14 +1755,14 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 4.8) ) -(defmethod get-art-group mtn-plat-buried ((obj mtn-plat-buried)) +(defmethod get-art-group mtn-plat-buried ((this mtn-plat-buried)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-buried" (the-as (pointer uint32) #f)) ) -(defmethod init-plat-collision! mtn-plat-buried ((obj mtn-plat-buried)) +(defmethod init-plat-collision! mtn-plat-buried ((this mtn-plat-buried)) "TODO - collision stuff for setting up the platform" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -1783,34 +1783,35 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "mtn-plat-lp" :fo-max 100) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "mtn-plat-lp" :fo-max 100) (-> this root trans)) ) - (set! (-> obj options) (res-lump-value (-> obj entity) 'options actor-option :time -1000000000.0)) + (set! (-> this options) (res-lump-value (-> this entity) 'options actor-option :time -1000000000.0)) 0 (none) ) -(defmethod plat-path-sync mtn-plat-buried ((obj mtn-plat-buried)) +(defmethod plat-path-sync mtn-plat-buried ((this mtn-plat-buried)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @see [[sync-eased]]" (cond - ((or (logtest? (-> obj path flags) (path-control-flag not-found)) - (and (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)))) - (logtest? (-> obj options) (actor-option blocked)) + ((or (logtest? (-> this path flags) (path-control-flag not-found)) + (and (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) + (logtest? (-> this options) (actor-option blocked)) ) ) - (go (method-of-object obj plat-idle)) + (go (method-of-object this plat-idle)) ) - ((> (-> obj sync period) 0) - (go (method-of-object obj plat-path-active)) + ((> (-> this sync period) 0) + (go (method-of-object this plat-path-active)) ) (else - (go (method-of-object obj plat-idle)) + (go (method-of-object this plat-idle)) ) ) ) @@ -2918,22 +2919,22 @@ otherwise, [[plat::34]] ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens ((obj mtn-lens) (entity entity-actor)) +(defmethod init-from-entity! mtn-lens ((this mtn-lens) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-lens" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2956,24 +2957,24 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens-base ((obj mtn-lens-base) (entity entity-actor)) +(defmethod init-from-entity! mtn-lens-base ((this mtn-lens-base) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-lens-base" (the-as (pointer uint32) #f))) (the-as pair 0) ) (when (task-complete? *game-info* (game-task mountain-lens)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3004,14 +3005,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens-floor ((obj mtn-lens-floor) (entity entity-actor)) +(defmethod init-from-entity! mtn-lens-floor ((this mtn-lens-floor) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak bot player-list)) @@ -3026,20 +3027,20 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-lens-floor" (the-as (pointer uint32) #f))) (the-as pair 0) ) (if (task-complete? *game-info* (game-task mountain-lens)) - (go (method-of-object obj idle-no-beam)) + (go (method-of-object this idle-no-beam)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 353) obj)) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 353) this)) + (go (method-of-object this idle)) (none) ) @@ -3062,22 +3063,22 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-shard ((obj mtn-shard) (entity entity-actor)) +(defmethod init-from-entity! mtn-shard ((this mtn-shard) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-shard" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3091,7 +3092,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-a ((obj mtn-step-plat-rocks-a) (entity entity-actor)) +(defmethod init-from-entity! mtn-step-plat-rocks-a ((this mtn-step-plat-rocks-a) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3099,7 +3100,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape)) - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 3) 0))) (set! (-> cshape total-prims) (the-as uint 4)) (set! (-> prim-group prim-core collide-as) (collide-spec obstacle pusher)) @@ -3140,26 +3141,26 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-step-plat-rocks-a" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set-vector! (-> obj draw bounds) 0.0 12288.0 0.0 20480.0) - (set! (-> obj draw lod-set lod 0 dist) 163840.0) + (set-vector! (-> this draw bounds) 0.0 12288.0 0.0 20480.0) + (set! (-> this draw lod-set lod 0 dist) 163840.0) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj done) #t) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this done) #t) ) (else - (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-a" -99.0 0) - (go (method-of-object obj idle)) + (add-process *gui-control* this (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-a" -99.0 0) + (go (method-of-object this idle)) ) ) (none) @@ -3175,7 +3176,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-b ((obj mtn-step-plat-rocks-b) (entity entity-actor)) +(defmethod init-from-entity! mtn-step-plat-rocks-b ((this mtn-step-plat-rocks-b) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3183,7 +3184,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape)) - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 17) 0))) (set! (-> cshape total-prims) (the-as uint 18)) (set! (-> prim-group prim-core collide-as) (collide-spec obstacle pusher)) @@ -3242,26 +3243,26 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-step-plat-rocks-b" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set-vector! (-> obj draw bounds) 0.0 -12288.0 0.0 40960.0) - (set! (-> obj draw lod-set lod 0 dist) 163840.0) + (set-vector! (-> this draw bounds) 0.0 -12288.0 0.0 40960.0) + (set! (-> this draw lod-set lod 0 dist) 163840.0) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj done) #t) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this done) #t) ) (else - (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-b" -99.0 0) - (go (method-of-object obj idle)) + (add-process *gui-control* this (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-b" -99.0 0) + (go (method-of-object this idle)) ) ) (none) @@ -3277,7 +3278,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-c ((obj mtn-step-plat-rocks-c) (entity entity-actor)) +(defmethod init-from-entity! mtn-step-plat-rocks-c ((this mtn-step-plat-rocks-c) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3285,7 +3286,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape)) - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 24) 0))) (set! (-> cshape total-prims) (the-as uint 25)) (set! (-> prim-group prim-core collide-as) (collide-spec obstacle pusher)) @@ -3351,26 +3352,26 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-step-plat-rocks-c" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set-vector! (-> obj draw bounds) 0.0 0.0 32768.0 57344.0) - (set! (-> obj draw lod-set lod 0 dist) 163840.0) + (set-vector! (-> this draw bounds) 0.0 0.0 32768.0 57344.0) + (set! (-> this draw lod-set lod 0 dist) 163840.0) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj done) #t) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this done) #t) ) (else - (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-c" -99.0 0) - (go (method-of-object obj idle)) + (add-process *gui-control* this (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-c" -99.0 0) + (go (method-of-object this idle)) ) ) (none) diff --git a/goal_src/jak2/levels/mountain/rhino-wall.gc b/goal_src/jak2/levels/mountain/rhino-wall.gc index 7fdbac1ff1..7c90c3d904 100644 --- a/goal_src/jak2/levels/mountain/rhino-wall.gc +++ b/goal_src/jak2/levels/mountain/rhino-wall.gc @@ -36,8 +36,8 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod rhino-wall-method-30 rhino-wall ((obj rhino-wall)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod rhino-wall-method-30 rhino-wall ((this rhino-wall)) + (let ((v1-1 (-> this root root-prim))) (countdown (a1-0 (-> v1-1 specific 0)) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a1-0))) (cond @@ -51,16 +51,16 @@ ) ) ) - (case (-> obj id) + (case (-> this id) ((1) - (set! (-> obj draw origin-joint-index) (the-as uint 2)) - (set-vector! (-> obj draw bounds) 0.0 0.0 81920.0 131072.0) + (set! (-> this draw origin-joint-index) (the-as uint 2)) + (set-vector! (-> this draw bounds) 0.0 0.0 81920.0 131072.0) (set! (-> v1-1 transform-index) 2) (set-vector! (-> v1-1 local-sphere) 0.0 0.0 81920.0 122880.0) ) ((2) - (set! (-> obj draw origin-joint-index) (the-as uint 2)) - (set-vector! (-> obj draw bounds) 0.0 0.0 81920.0 131072.0) + (set! (-> this draw origin-joint-index) (the-as uint 2)) + (set-vector! (-> this draw bounds) 0.0 0.0 81920.0 131072.0) (set! (-> v1-1 transform-index) 2) (set-vector! (-> v1-1 local-sphere) 0.0 0.0 81920.0 122880.0) ) @@ -131,23 +131,23 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! rhino-wall ((obj rhino-wall) (arg0 entity-actor)) +(defmethod init-from-entity! rhino-wall ((this rhino-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) - (let ((s3-0 (res-lump-struct (-> obj entity) 'art-name structure)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) + (let ((s3-0 (res-lump-struct (-> this entity) 'art-name structure)) (s4-0 (art-group-get-by-name *level* "skel-rhino-wall-1" (the-as (pointer uint32) #f))) ) - (set! (-> obj art-name) (the-as string s3-0)) + (set! (-> this art-name) (the-as string s3-0)) (cond ((string= (the-as string s3-0) "rhino-wall-1") - (set! (-> obj id) 1) - (let ((s4-1 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this id) 1) + (let ((s4-1 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-1 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-1 reaction) cshape-reaction-default) (set! (-> s4-1 no-reaction) @@ -213,16 +213,16 @@ This commonly includes things such as: (set! (-> s4-1 backup-collide-as) (-> v1-38 prim-core collide-as)) (set! (-> s4-1 backup-collide-with) (-> v1-38 prim-core collide-with)) ) - (set! (-> obj root) s4-1) + (set! (-> this root) s4-1) ) (set! s4-0 (art-group-get-by-name *level* "skel-rhino-wall-1" (the-as (pointer uint32) #f))) - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "rhino-wall-1" :anim-name "1-break" :parts 2 :command-list '()) ) ) ((string= (the-as string s3-0) "rhino-wall-2") - (set! (-> obj id) 2) - (let ((s4-2 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this id) 2) + (let ((s4-2 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-2 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-2 reaction) cshape-reaction-default) (set! (-> s4-2 no-reaction) @@ -288,10 +288,10 @@ This commonly includes things such as: (set! (-> s4-2 backup-collide-as) (-> v1-74 prim-core collide-as)) (set! (-> s4-2 backup-collide-with) (-> v1-74 prim-core collide-with)) ) - (set! (-> obj root) s4-2) + (set! (-> this root) s4-2) ) (set! s4-0 (art-group-get-by-name *level* "skel-rhino-wall-2" (the-as (pointer uint32) #f))) - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "rhino-wall-2" :anim-name "2-break" :parts 1 :command-list '()) ) ) @@ -299,12 +299,12 @@ This commonly includes things such as: (go process-drawable-art-error (the-as string s3-0)) ) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0)) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj broken)) - (go (method-of-object obj unbroken)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this broken)) + (go (method-of-object this unbroken)) ) (none) ) diff --git a/goal_src/jak2/levels/mountain/rhino.gc b/goal_src/jak2/levels/mountain/rhino.gc index 9a71b718cb..aa9e682728 100644 --- a/goal_src/jak2/levels/mountain/rhino.gc +++ b/goal_src/jak2/levels/mountain/rhino.gc @@ -322,7 +322,7 @@ (set! (-> *rhino-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod rhino-method-182 rhino ((obj rhino) (arg0 process) (arg1 event-message-block)) +(defmethod rhino-method-182 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) (let* ((gp-0 (-> arg1 param 0)) (s5-0 arg0) (s2-0 (if (type? s5-0 process-drawable) @@ -331,19 +331,19 @@ ) ) (cond - ((and (-> obj can-hit?) gp-0 ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry gp-0) - (-> obj root) - (the-as uint 1) - ) + ((and (-> this can-hit?) gp-0 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry gp-0) + (-> this root) + (the-as uint 1) + ) ) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-1 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'vector)) ) - (vector-z-quaternion! s4-0 (-> obj root quat)) - (vector-x-quaternion! gp-1 (-> obj root quat)) - (vector-! s5-1 (-> (the-as process-drawable s2-0) root trans) (-> obj root trans)) + (vector-z-quaternion! s4-0 (-> this root quat)) + (vector-x-quaternion! gp-1 (-> this root quat)) + (vector-! s5-1 (-> (the-as process-drawable s2-0) root trans) (-> this root trans)) (if (and (< 0.0 (vector-dot s5-1 s4-0)) (< (fabs (vector-dot s5-1 gp-1)) 10240.0)) #t #f @@ -357,17 +357,17 @@ ) ) -(defmethod enemy-method-58 rhino ((obj rhino) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) (let ((t9-0 (method-of-type nav-enemy enemy-method-58))) - (t9-0 obj arg0 arg1) + (t9-0 this arg0 arg1) ) - (if (rhino-method-182 obj arg0 arg1) + (if (rhino-method-182 this arg0 arg1) 'hit 'hit-flinch ) ) -(defmethod general-event-handler rhino ((obj rhino) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler rhino ((this rhino) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars @@ -386,28 +386,28 @@ ) (case arg2 (('charge) - (if (-> obj wall) - (go (method-of-object obj charge)) + (if (-> this wall) + (go (method-of-object this charge)) ) ) (('hit) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (set! (-> *rhino-nav-enemy-info* die-anim) 15) - (set! (-> obj frame-die-smush) 11.0) - (kill-prefer-falling obj) + (set! (-> this frame-die-smush) 11.0) + (kill-prefer-falling this) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('hit-flinch) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (set! (-> *rhino-nav-enemy-info* die-anim) 14) - (set! (-> obj frame-die-smush) 16.0) - (kill-prefer-falling obj) + (set! (-> this frame-die-smush) 16.0) + (kill-prefer-falling this) ) (else (let* ((s5-0 arg0) @@ -419,36 +419,36 @@ (s4-0 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'vector)) ) - (vector-z-quaternion! s3-0 (-> obj root quat)) - (vector-x-quaternion! s4-0 (-> obj root quat)) - (vector-! s5-1 (-> (the-as process-focusable s2-0) root trans) (-> obj root trans)) + (vector-z-quaternion! s3-0 (-> this root quat)) + (vector-x-quaternion! s4-0 (-> this root quat)) + (vector-! s5-1 (-> (the-as process-focusable s2-0) root trans) (-> this root trans)) (set! (-> s5-1 y) 0.0) (vector-normalize! s5-1 1.0) (let* ((f30-0 (vector-dot s3-0 s5-1)) (f28-0 (vector-dot s4-0 s5-1)) (a0-16 (cond ((>= f30-0 (cos 8192.0)) - (-> obj draw art-group data 16) + (-> this draw art-group data 16) ) ((>= (cos 24576.0) f30-0) - (-> obj draw art-group data 19) + (-> this draw art-group data 19) ) ((>= f28-0 (cos 8192.0)) - (-> obj draw art-group data 17) + (-> this draw art-group data 17) ) ((>= (cos 24576.0) f28-0) - (-> obj draw art-group data 18) + (-> this draw art-group data 18) ) (else - (-> obj draw art-group data 16) + (-> this draw art-group data 16) ) ) ) (v0-9 (ja-channel-float! (the-as art-joint-anim a0-16) 0.0 0.0 0.0)) ) (when v0-9 - (set! (-> obj skel interp-select 0) (the-as int (the-as uint #x1c9002228))) - (set! (-> obj skel interp-select 1) 0) + (set! (-> this skel interp-select 0) (the-as int (the-as uint #x1c9002228))) + (set! (-> this skel interp-select 1) 0) (set! (-> v0-9 param 0) 1.0) (set! (-> v0-9 param 1) 1.0) (set! (-> v0-9 param 2) 3.0) @@ -456,7 +456,7 @@ ) ) ) - (+! (-> obj num-hit-flinch) 1) + (+! (-> this num-hit-flinch) 1) 'back ) ) @@ -464,11 +464,11 @@ (('event-slide-poof) (let ((s5-2 (-> arg3 param 1))) (cond - ((= (-> obj root ground-pat material) (pat-material grass)) + ((= (-> this root ground-pat material) (pat-material grass)) (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-1 (let ((t9-14 (method-of-type part-tracker activate))) - (t9-14 (the-as part-tracker s4-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-14 (the-as part-tracker s4-1) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((s3-1 run-function-in-process) (s2-1 s4-1) @@ -481,7 +481,7 @@ (set! sv-144 (the-as symbol #f)) (set! sv-176 *launch-matrix*) (set! sv-160 (-> sv-176 trans)) - (let ((v1-52 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) + (let ((v1-52 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data s5-2)) quad))) (set! (-> sv-160 quad) v1-52) ) ((the-as (function object object object object object object object object none) s3-1) @@ -503,7 +503,7 @@ (let ((s4-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-2 (let ((t9-18 (method-of-type part-tracker activate))) - (t9-18 (the-as part-tracker s4-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-18 (the-as part-tracker s4-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((s3-2 run-function-in-process) (s2-2 s4-2) @@ -516,7 +516,7 @@ (set! sv-240 (the-as symbol #f)) (set! sv-272 *launch-matrix*) (set! sv-256 (-> sv-272 trans)) - (let ((v1-64 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) + (let ((v1-64 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data s5-2)) quad))) (set! (-> sv-256 quad) v1-64) ) ((the-as (function object object object object object object object object none) s3-2) @@ -538,28 +538,28 @@ ) ) (('interesting) - (+! (-> obj interest) 1) - (let ((v1-67 (process->ppointer obj))) + (+! (-> this interest) 1) + (let ((v1-67 (process->ppointer this))) (set-setting! 'handle-of-interest v1-67 0.0 (-> v1-67 0 pid)) ) ) (('uninteresting) - (+! (-> obj interest) -1) - (when (<= (-> obj interest) 0) - (set! (-> obj interest) 0) + (+! (-> this interest) -1) + (when (<= (-> this interest) 0) + (set! (-> this interest) 0) (remove-setting! 'handle-of-interest) ) ) (('death-end) - (let ((v1-74 (-> obj root root-prim))) + (let ((v1-74 (-> this root root-prim))) (set! (-> v1-74 prim-core collide-as) (collide-spec)) (set! (-> v1-74 prim-core collide-with) (collide-spec)) ) 0 - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -607,9 +607,7 @@ ) ) (else - (if (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) - (> (the-as int (-> self focus aware)) 0) - ) + (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (> (the-as int (-> self focus aware)) 0)) (go-virtual active) ) ) @@ -709,24 +707,24 @@ ) ) -(defmethod damage-amount-from-attack rhino ((obj rhino) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack rhino ((this rhino) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (-> arg1 param 1) - (let ((f30-0 (the float (penetrate-using->damage (the-as penetrate (-> obj incoming penetrate-using)))))) + (let ((f30-0 (the float (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using)))))) (cond - ((rhino-method-182 obj arg0 arg1) - (set! (-> obj stomach-touched-once?) #t) + ((rhino-method-182 this arg0 arg1) + (set! (-> this stomach-touched-once?) #t) (the int (* 4.0 f30-0)) ) - ((logtest? #xc0000 (-> obj incoming penetrate-using)) - (if (and (logtest? #x40000 (-> obj incoming penetrate-using)) - (logtest? #x80000 (-> obj incoming penetrate-using)) + ((logtest? #xc0000 (-> this incoming penetrate-using)) + (if (and (logtest? #x40000 (-> this incoming penetrate-using)) + (logtest? #x80000 (-> this incoming penetrate-using)) ) #x420c0000 (the int (* 1.8 f30-0)) ) ) - ((logtest? #x20000 (-> obj incoming penetrate-using)) + ((logtest? #x20000 (-> this incoming penetrate-using)) (the int (* 2.0 f30-0)) ) (else @@ -737,7 +735,7 @@ ) ;; WARN: Return type mismatch symbol vs object. -(defmethod enemy-method-75 rhino ((obj rhino) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-75 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) (let* ((touch-entry (the-as touching-shapes-entry (-> arg1 param 0))) (s3-0 arg0) (v1-0 (if (type? s3-0 process-focusable) @@ -747,48 +745,48 @@ ) (when (and (the-as uint touch-entry) v1-0) (cond - ((and (focus-test? obj dangerous) ((method-of-type touching-shapes-entry prims-touching-action?) - touch-entry - (-> obj root) - (collide-action deadly) - (collide-action) - ) + ((and (focus-test? this dangerous) ((method-of-type touching-shapes-entry prims-touching-action?) + touch-entry + (-> this root) + (collide-action deadly) + (collide-action) + ) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) touch-entry - (-> obj root) + (-> this root) (collide-action persistent-attack) (collide-action) ) - (-> obj persistent-attack-id) - (-> obj attack-id) + (-> this persistent-attack-id) + (-> this attack-id) ) ) ) - (enemy-method-104 obj arg0 touch-entry a3-2) + (enemy-method-104 this arg0 touch-entry a3-2) ) ) (((method-of-type touching-shapes-entry prims-touching-action?) touch-entry - (-> obj root) + (-> this root) (collide-action no-standon) (collide-action) ) - (send-shoves (-> obj root) arg0 touch-entry 0.7 6144.0 16384.0) + (send-shoves (-> this root) arg0 touch-entry 0.7 6144.0 16384.0) ) ) ) ) ) -(defmethod enemy-method-104 rhino ((obj rhino) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) - (if (and (-> obj next-state) (= (-> obj next-state name) 'victory)) +(defmethod enemy-method-104 rhino ((this rhino) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + (if (and (-> this next-state) (= (-> this next-state name) 'victory)) 'attack-or-shove 'attack ) - (let* ((s2-0 (if (-> obj smush-target) + (let* ((s2-0 (if (-> this smush-target) 'smush - (-> obj enemy-info attack-mode) + (-> this enemy-info attack-mode) ) ) (s1-0 arg0) @@ -798,13 +796,13 @@ ) (s1-1 (new 'stack-no-clear 'vector)) ) - (vector-! s1-1 (get-trans (the-as process-focusable a0-3) 0) (-> obj root trans)) + (vector-! s1-1 (get-trans (the-as process-focusable a0-3) 0) (-> this root trans)) (set! (-> s1-1 y) 0.0) (vector-normalize! s1-1 1.0) - (vector+float*! s1-1 s1-1 (-> obj root transv) 0.5) + (vector+float*! s1-1 s1-1 (-> this root transv) 0.5) (set! (-> s1-1 y) 20480.0) (when (send-event arg0 'attack arg1 (static-attack-info ((id arg2) (angle 'front) (vector s1-1) (mode s2-0)))) - (enemy-method-105 obj arg0) + (enemy-method-105 this arg0) #t ) ) @@ -975,7 +973,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-4 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-4 enemy-flags))) @@ -1019,7 +1017,7 @@ 0 ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 1.5)) + (if (time-elapsed? (-> self state-time) (seconds 1.5)) (go-virtual active) ) ) @@ -1052,7 +1050,7 @@ ) (set! (-> self charge-straight) #f) (nav-enemy-method-166 self) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) ) :trans (behavior () @@ -1079,7 +1077,7 @@ (vector-! gp-0 s2-0 (-> self root trans)) (vector-normalize! gp-0 (+ 16384.0 (vector-length gp-0))) (vector+! s4-0 (-> self root trans) gp-0) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (and (< (vector-vector-xz-distance (get-trans (the-as process-focusable s3-0) 0) (-> self root trans)) 40960.0) (< 0.9 f30-0) ) @@ -1089,7 +1087,7 @@ (cond ((-> self charge-straight) (cond - ((>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + ((time-elapsed? (-> self state-time) (-> self reaction-time)) (if (< (vector-vector-xz-distance (get-trans (the-as process-focusable s3-0) 0) (-> self root trans)) 20480.0) (go-virtual attack) ) @@ -1103,9 +1101,7 @@ ) ) ) - ((and (< f28-0 8192.0) - (and (>= (- (current-time) (-> self state-time)) (seconds 2)) (>= 9.0 (ja-frame-num 0))) - ) + ((and (< f28-0 8192.0) (and (time-elapsed? (-> self state-time) (seconds 2)) (>= 9.0 (ja-frame-num 0)))) (go-virtual stop-run) ) (else @@ -1225,14 +1221,14 @@ :post nav-enemy-travel-post ) -(defmethod nav-enemy-method-142 rhino ((obj rhino) (arg0 nav-control)) - (if (-> obj in-stop-run) +(defmethod nav-enemy-method-142 rhino ((this rhino) (arg0 nav-control)) + (if (-> this in-stop-run) (quaternion*! - (-> obj root quat) - (-> obj quat) - (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (* 182.04445 (* 180.0 (-> obj angle)))) + (-> this root quat) + (-> this quat) + (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (* 182.04445 (* 180.0 (-> this angle)))) ) - ((method-of-type nav-enemy nav-enemy-method-142) obj arg0) + ((method-of-type nav-enemy nav-enemy-method-142) this arg0) ) 0 (none) @@ -1365,7 +1361,7 @@ :enter (behavior () (set-setting! 'sound-mode #f 0.0 1) (set-setting! 'sound-excitement 'abs 0.0 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-8 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-8 enemy-flags))) @@ -1553,9 +1549,9 @@ ) ) -(defmethod init-enemy-collision! rhino ((obj rhino)) +(defmethod init-enemy-collision! rhino ((this rhino)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1619,92 +1615,92 @@ (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-focusable vs rhino. -(defmethod relocate rhino ((obj rhino) (arg0 int)) - (if (nonzero? (-> obj path-intro)) - (&+! (-> obj path-intro) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method rhino 7)) this arg0) ) ) -(defmethod init-enemy! rhino ((obj rhino)) +(defmethod init-enemy! rhino ((this rhino)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-rhino" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *rhino-nav-enemy-info*) - (let ((v1-8 (-> obj neck))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *rhino-nav-enemy-info*) + (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) (set! (-> v1-8 nose) (the-as uint 2)) (set! (-> v1-8 ear) (the-as uint 0)) (set-vector! (-> v1-8 twist-max) 10922.667 12743.111 0.0 1.0) (set! (-> v1-8 ignore-angle) 18204.445) ) - (set! (-> obj wall) #f) - (set! (-> obj wall) (the-as rhino-wall (entity-actor-lookup (-> obj entity) 'alt-actor 0))) - (when (-> obj wall) - (set! (-> obj path-intro) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (if (-> obj path-intro) - (logior! (-> obj path-intro flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this wall) #f) + (set! (-> this wall) (the-as rhino-wall (entity-actor-lookup (-> this entity) 'alt-actor 0))) + (when (-> this wall) + (set! (-> this path-intro) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (if (-> this path-intro) + (logior! (-> this path-intro flags) (path-control-flag display draw-line draw-point draw-text)) ) - (when (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (format #t "~S : sub task done~%" (-> obj name)) - (get-point-in-path! (-> obj path-intro) (-> obj root trans) 1.0 'exact) - (set! (-> obj wall) #f) + (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (format #t "~S : sub task done~%" (-> this name)) + (get-point-in-path! (-> this path-intro) (-> this root trans) 1.0 'exact) + (set! (-> this wall) #f) ) ) - (set! (-> obj charge-aware) (the-as uint 1)) - (if (>= (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj charge-aware) (the-as uint 2)) + (set! (-> this charge-aware) (the-as uint 1)) + (if (>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) + (set! (-> this charge-aware) (the-as uint 2)) ) - (set! (-> obj charge-straight) #f) - (set! (-> obj in-stop-run) #f) - (set! (-> obj smush-target) #f) - (set! (-> obj num-hit-flinch) 0) - (set! (-> obj can-hit?) #f) - (set! (-> obj anim-skid-left) 21) - (set! (-> obj anim-skid-right) 22) - (set! (-> obj anim-victory-hit) 23) - (set! (-> obj interest) 0) - (set! (-> obj victory-count) (the-as uint 0)) - (set! (-> obj stomach-touched-once?) #f) + (set! (-> this charge-straight) #f) + (set! (-> this in-stop-run) #f) + (set! (-> this smush-target) #f) + (set! (-> this num-hit-flinch) 0) + (set! (-> this can-hit?) #f) + (set! (-> this anim-skid-left) 21) + (set! (-> this anim-skid-right) 22) + (set! (-> this anim-victory-hit) 23) + (set! (-> this interest) 0) + (set! (-> this victory-count) (the-as uint 0)) + (set! (-> this stomach-touched-once?) #f) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x 1433.6 :y -1105.92 :z 1925.12 :w 163840.0) ) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x -1433.6 :y -1105.92 :z 1925.12 :w 163840.0) ) - (let ((v1-38 (-> obj nav))) + (let ((v1-38 (-> this nav))) (set! (-> v1-38 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logior! (-> obj enemy-flags) (enemy-flag check-water)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag check-water)) 0 (none) ) diff --git a/goal_src/jak2/levels/nest/boss/metalkor-extras.gc b/goal_src/jak2/levels/nest/boss/metalkor-extras.gc index 68e8e3d745..ff69ba9950 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-extras.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-extras.gc @@ -110,7 +110,7 @@ :virtual #t :event metalkor-egg-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (local-vars (v1-5 float) (v1-27 float) (v1-34 float)) @@ -136,7 +136,7 @@ ((< f0-0 (* f1-0 f1-0)) (go-virtual idle) ) - ((>= (- (current-time) (-> self state-time)) (seconds 4)) + ((time-elapsed? (-> self state-time) (seconds 4)) (go-virtual hatch) ) (else @@ -219,10 +219,10 @@ :virtual #t :event metalkor-egg-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go-virtual hatch) ) (let ((v1-9 (ja-group))) @@ -275,27 +275,27 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod init-proj-settings! metalkor-shot ((obj metalkor-shot)) +(defmethod init-proj-settings! metalkor-shot ((this metalkor-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'metalhead-shot) - (set! (-> obj max-speed) 532480.0) - (set! (-> obj move) metalkor-shot-move) - (set! (-> obj timeout) (seconds 0.767)) - (set-gravity-length (-> obj root dynam) 573440.0) - (set! (-> obj old-transv quad) (-> obj root transv quad)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'metalhead-shot) + (set! (-> this max-speed) 532480.0) + (set! (-> this move) metalkor-shot-move) + (set! (-> this timeout) (seconds 0.767)) + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this old-transv quad) (-> this root transv quad)) (none) ) -(defmethod spawn-shell-particles metalkor-shot ((obj metalkor-shot)) +(defmethod spawn-shell-particles metalkor-shot ((this metalkor-shot)) "TODO - confirm" (local-vars (sv-224 (function vector entity-actor skeleton-group vector object none :behavior manipy)) (sv-240 vector) (sv-256 entity-actor) ) - (let* ((s4-0 (-> obj root)) - (v0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s4-0 trans)) 2048.0)) + (let* ((s4-0 (-> this root)) + (v0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> s4-0 trans quad)) @@ -337,7 +337,7 @@ ) ) (let ((s4-2 (new 'stack-no-clear 'vector))) - (set! (-> s4-2 quad) (-> obj root trans quad)) + (set! (-> s4-2 quad) (-> this root trans quad)) (let ((gp-1 (new 'stack-no-clear 'quaternion))) (let ((s3-0 (lambda :behavior metalkor-shot () @@ -373,7 +373,7 @@ ) ) (let ((s2-0 (new 'stack-no-clear 'matrix))) - (vector-normalize-copy! (-> s2-0 vector 1) (-> obj old-transv) -1.0) + (vector-normalize-copy! (-> s2-0 vector 1) (-> this old-transv) -1.0) (cond ((and (< (fabs (-> s2-0 vector 1 y)) (fabs (-> s2-0 vector 1 x))) (< (fabs (-> s2-0 vector 1 y)) (fabs (-> s2-0 vector 1 z))) @@ -403,7 +403,7 @@ ) (set! sv-224 manipy-init) (set! sv-240 s4-2) - (set! sv-256 (-> obj entity)) + (set! sv-256 (-> this entity)) (let ((t0-2 (art-group-get-by-name *level* "skel-bomb-blast" (the-as (pointer uint32) #f))) (t1-2 #f) (t2-2 0) @@ -436,7 +436,7 @@ manipy :init manipy-init s4-2 - (-> obj entity) + (-> this entity) (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer uint32) #f)) #f 0 @@ -456,32 +456,32 @@ (none) ) -(defmethod get-trans metalkor-legs ((obj metalkor-legs) (arg0 int)) +(defmethod get-trans metalkor-legs ((this metalkor-legs) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (cond ((or (= arg0 2) (= arg0 3)) (let ((v0-0 (new 'static 'vector :w 1.0))) (set! (-> v0-0 quad) - (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 0 prim-core world-sphere quad) + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0 prim-core world-sphere quad) ) (+! (-> v0-0 y) 32768.0) v0-0 ) ) (else - ((method-of-type process-focusable get-trans) obj arg0) + ((method-of-type process-focusable get-trans) this arg0) ) ) ) ;; WARN: Return type mismatch process-focusable vs metalkor-legs. -(defmethod relocate metalkor-legs ((obj metalkor-legs) (arg0 int)) +(defmethod relocate metalkor-legs ((this metalkor-legs) (arg0 int)) (dotimes (v1-0 6) - (if (nonzero? (-> obj joint-ik v1-0)) - (&+! (-> obj joint-ik v1-0) arg0) + (if (nonzero? (-> this joint-ik v1-0)) + (&+! (-> this joint-ik v1-0) arg0) ) ) - (the-as metalkor-legs ((method-of-type process-focusable relocate) obj arg0)) + (the-as metalkor-legs ((method-of-type process-focusable relocate) this arg0)) ) (defbehavior metalkor-legs-handler metalkor-legs ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) @@ -679,7 +679,7 @@ :virtual #t :event metalkor-legs-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (dotimes (gp-0 6) (enable-set! (-> self joint-ik gp-0) #t) ((method-of-type cam-float-seeker init) (the-as cam-float-seeker (-> self foot-locks gp-0)) 0.0 0.1 0.3 0.9) @@ -781,17 +781,17 @@ ) ) -(defmethod apply-gravity metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (local-vars (f0-16 float) (f0-31 float)) (cond ((zero? arg1) - (set! (-> obj joint-length) 8192.0) + (set! (-> this joint-length) 8192.0) ) ((= arg1 1) - (set! (-> obj joint-length) 12288.0) + (set! (-> this joint-length) 12288.0) ) ((= arg1 2) - (set! (-> obj joint-length) 8192.0) + (set! (-> this joint-length) 8192.0) ) (else (let ((v1-8 (-> arg2 parent))) @@ -813,21 +813,21 @@ ) ) ) - (set! (-> obj joint-length) 5734.4) - (set! (-> obj joint-length) 5324.8) + (set! (-> this joint-length) 5734.4) + (set! (-> this joint-length) 5324.8) ) ) ) ) (vector-float*! arg0 - (-> obj gravity) + (-> this gravity) (* 4096.0 (-> self clock time-adjust-ratio) (lerp-scale 0.2 0.1 (the float arg1) 0.0 20.0)) ) (vector-float*! arg0 arg0 0.75) - (set! (-> obj axial-slop) (* 364.0889 (the float arg1))) - (let ((f26-0 (-> obj prev-rotation)) - (f28-0 (-> obj prev-y-rotation)) + (set! (-> this axial-slop) (* 364.0889 (the float arg1))) + (let ((f26-0 (-> this prev-rotation)) + (f28-0 (-> this prev-y-rotation)) (f30-1 (ja-aframe-num-of-proc (the-as process-drawable (ppointer->process (-> arg2 parent))) 0)) ) (let* ((v1-27 (-> arg2 parent)) @@ -925,8 +925,8 @@ ) ) ) - (set! f26-0 (+ f0-16 (* 182.04445 (-> obj osc-z value)))) - (+ f1-3 (* 182.04445 (-> obj osc-y value))) + (set! f26-0 (+ f0-16 (* 182.04445 (-> this osc-z value)))) + (+ f1-3 (* 182.04445 (-> this osc-y value))) ) ) (else @@ -954,7 +954,7 @@ (set! s2-2 #f) ) (else - (vector-! arg0 (target-pos 0) (the-as vector (-> obj chain-joints arg1))) + (vector-! arg0 (target-pos 0) (the-as vector (-> this chain-joints arg1))) (vector-normalize! arg0 12288.0) ) ) @@ -1013,8 +1013,8 @@ (set! f0-31 (+ 910.2222 f26-0)) ) ) - (set! f26-0 (+ f0-31 (* 182.04445 (-> obj osc-z value)))) - (+! f28-0 (* 182.04445 (-> obj osc-y value))) + (set! f26-0 (+ f0-31 (* 182.04445 (-> this osc-z value)))) + (+! f28-0 (* 182.04445 (-> this osc-y value))) ) ) ) @@ -1025,8 +1025,8 @@ ) ) ) - (set! (-> obj prev-rotation) f26-0) - (set! (-> obj prev-y-rotation) f28-0) + (set! (-> this prev-rotation) f26-0) + (set! (-> this prev-y-rotation) f28-0) (when (not s2-2) (let ((a1-11 (-> arg2 node-list data 3 bone transform)) (s2-3 (new 'stack-no-clear 'matrix)) @@ -1041,7 +1041,7 @@ (vector+float*! arg0 arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* arg1 64))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* arg1 64))) (lerp-scale 0.9 0.5 (the float arg1) 0.0 20.0) ) ) @@ -1095,15 +1095,15 @@ (vector+float*! arg0 arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ arg1 -1) 64))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 -1) 64))) 0.9 ) ) - ((-> obj move-with-parent) + ((-> this move-with-parent) (vector+float*! arg0 arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ arg1 -1) 64))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 -1) 64))) 0.8 ) ) @@ -1114,18 +1114,18 @@ (none) ) -(defmethod chain-physics-method-16 metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 int)) 10922.667 ) -(defmethod chain-physics-method-14 metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) ) -(defmethod clamp-length metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) - ((method-of-type chain-physics clamp-length) obj arg0 arg1 arg2 arg3) +(defmethod clamp-length metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) + ((method-of-type chain-physics clamp-length) this arg0 arg1 arg2 arg3) (when (< 5 (the-as int arg2)) (let ((a0-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg3 node-list data 3))) (s5-1 (new 'stack-no-clear 'vector)) @@ -1140,14 +1140,14 @@ ) ) -(defmethod gravity-update metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 process-drawable)) +(defmethod gravity-update metalkor-chain-physics ((this metalkor-chain-physics) (arg0 process-drawable)) (let ((t9-0 (method-of-type chain-physics gravity-update))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (update! (-> obj rand-y)) - (update! (-> obj rand-z)) - (update! (-> obj osc-y) (-> obj rand-y value)) - (update! (-> obj osc-z) (-> obj rand-z value)) + (update! (-> this rand-y)) + (update! (-> this rand-z)) + (update! (-> this osc-y) (-> this rand-y value)) + (update! (-> this osc-z) (-> this rand-z value)) (let ((s5-1 (new 'stack-no-clear 'collide-query))) (let ((s4-0 (new 'stack-no-clear 'bounding-box))) (let ((s3-0 (new 'stack-no-clear 'sphere))) @@ -1168,7 +1168,7 @@ (none) ) -(defmethod chain-physics-method-17 metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) (local-vars (v1-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1177,7 +1177,7 @@ ) (init-vf0-vector) (let* ((s5-0 (new 'stack-no-clear 'collide-query)) - (v1-2 (-> obj chain-joints arg1)) + (v1-2 (-> this chain-joints arg1)) (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> v1-2 position))) (s3-0 0) ) @@ -1235,20 +1235,20 @@ ) ;; WARN: Return type mismatch process-focusable vs metalkor-lowtorso. -(defmethod relocate metalkor-lowtorso ((obj metalkor-lowtorso) (arg0 int)) - (if (nonzero? (-> obj tail)) - (&+! (-> obj tail) arg0) +(defmethod relocate metalkor-lowtorso ((this metalkor-lowtorso) (arg0 int)) + (if (nonzero? (-> this tail)) + (&+! (-> this tail) arg0) ) - (if (nonzero? (-> obj egg-toss-joint-1)) - (&+! (-> obj egg-toss-joint-1) arg0) + (if (nonzero? (-> this egg-toss-joint-1)) + (&+! (-> this egg-toss-joint-1) arg0) ) - (if (nonzero? (-> obj egg-toss-joint-2)) - (&+! (-> obj egg-toss-joint-2) arg0) + (if (nonzero? (-> this egg-toss-joint-2)) + (&+! (-> this egg-toss-joint-2) arg0) ) - (if (nonzero? (-> obj egg-toss-joint-3)) - (&+! (-> obj egg-toss-joint-3) arg0) + (if (nonzero? (-> this egg-toss-joint-3)) + (&+! (-> this egg-toss-joint-3) arg0) ) - (the-as metalkor-lowtorso ((method-of-type process-focusable relocate) obj arg0)) + (the-as metalkor-lowtorso ((method-of-type process-focusable relocate) this arg0)) ) (defstate idle (metalkor-lowtorso) @@ -1357,7 +1357,7 @@ (-> block param 0) (static-attack-info ((id (new-attack-id)) (mode 'deadly) (vector s4-2) (shove-up (meters 4)))) ) - (set! (-> self no-collision-timer) (current-time)) + (set-time! (-> self no-collision-timer)) (let ((v1-52 (-> self root root-prim))) (set! (-> v1-52 prim-core collide-as) (collide-spec)) (set! (-> v1-52 prim-core collide-with) (collide-spec)) @@ -1372,11 +1372,11 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-params! (-> self egg-toss-joint-angle) 0.0 0.05 0.3 0.9) ) :trans (behavior () - (when (>= (- (current-time) (-> self no-collision-timer)) (seconds 0.1)) + (when (time-elapsed? (-> self no-collision-timer) (seconds 0.1)) (let ((v1-5 (-> self root root-prim))) (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) @@ -1455,137 +1455,137 @@ ) -(defmethod hover-formation-method-15 nestb-formation ((obj nestb-formation) (arg0 vector) (arg1 vector)) - (logior! (-> obj formation flags) 2) +(defmethod hover-formation-method-15 nestb-formation ((this nestb-formation) (arg0 vector) (arg1 vector)) + (logior! (-> this formation flags) 2) 0 ) ;; WARN: Return type mismatch symbol vs none. -(defmethod init-enemy! metalkor-flitter ((obj metalkor-flitter)) +(defmethod init-enemy! metalkor-flitter ((this metalkor-flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flitter" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *metalkor-flitter-nav-enemy-info*) - (set! (-> obj move-angle) 10922.667) - (set! (-> obj heading) (the-as basic (if (= (rand-vu-int-range 0 1) 1) - #t - #f - ) - ) + (init-enemy-behaviour-and-stats! this *metalkor-flitter-nav-enemy-info*) + (set! (-> this move-angle) 10922.667) + (set! (-> this heading) (the-as basic (if (= (rand-vu-int-range 0 1) 1) + #t + #f + ) + ) ) - (set! (-> obj change-dir-time) 0) - (set! (-> obj off-screen-timer) (the-as uint 0)) - (set! (-> obj amb-sound-timer) (the-as uint 0)) + (set! (-> this change-dir-time) 0) + (set! (-> this off-screen-timer) (the-as uint 0)) + (set! (-> this amb-sound-timer) (the-as uint 0)) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x 942.08 :y -860.16 :z 1269.76 :w 163840.0) ) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x -942.08 :y -860.16 :z 1269.76 :w 163840.0) ) - (set-gravity-length (-> obj root dynam) 491520.0) - (set! (-> obj minimap) #f) + (set-gravity-length (-> this root dynam) 491520.0) + (set! (-> this minimap) #f) (none) ) -(defmethod dispose! metalkor-flitter ((obj metalkor-flitter)) +(defmethod dispose! metalkor-flitter ((this metalkor-flitter)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (with-pp - (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) - (when (and (>= (-> obj enemy-info gem-joint) 0) - (not (logtest? (enemy-flag cam-attack-mode) (-> obj enemy-flags))) + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) + (when (and (>= (-> this enemy-info gem-joint) 0) + (not (logtest? (enemy-flag cam-attack-mode) (-> this enemy-flags))) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'have-gem?) - (or (send-event-function (ppointer->process (-> obj parent)) a1-0) + (or (send-event-function (ppointer->process (-> this parent)) a1-0) (task-node-closed? (game-task-node city-win-introduction)) (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) ) ) ) - (logior! (-> obj enemy-flags) (enemy-flag cam-attack-mode)) - (remove-from-process *part-engine* obj) + (logior! (-> this enemy-flags) (enemy-flag cam-attack-mode)) + (remove-from-process *part-engine* this) (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-no-seg)) - (the-as int (-> obj enemy-info gem-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-no-seg)) + (the-as int (-> this enemy-info gem-seg)) ) (let ((v1-30 (ppointer->process (birth-pickup-at-point - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj enemy-info gem-joint))) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this enemy-info gem-joint))) (pickup-type gem) 1.0 #t - (ppointer->process (-> obj parent)) - (-> obj fact) + (ppointer->process (-> this parent)) + (-> this fact) ) ) ) ) - (send-event (ppointer->process (-> obj parent)) 'flitter-change-gem obj v1-30) + (send-event (ppointer->process (-> this parent)) 'flitter-change-gem this v1-30) ) ) ) - ((method-of-type flitter dispose!) obj) + ((method-of-type flitter dispose!) this) (none) ) ) -(defmethod dispose! metalkor-wasp ((obj metalkor-wasp)) +(defmethod dispose! metalkor-wasp ((this metalkor-wasp)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (with-pp - (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) - (when (and (>= (-> obj enemy-info gem-joint) 0) - (not (logtest? (enemy-flag cam-attack-mode) (-> obj enemy-flags))) + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) + (when (and (>= (-> this enemy-info gem-joint) 0) + (not (logtest? (enemy-flag cam-attack-mode) (-> this enemy-flags))) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'have-gem?) - (or (send-event-function (ppointer->process (-> obj parent)) a1-0) + (or (send-event-function (ppointer->process (-> this parent)) a1-0) (task-node-closed? (game-task-node city-win-introduction)) (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) ) ) ) - (logior! (-> obj enemy-flags) (enemy-flag cam-attack-mode)) - (remove-from-process *part-engine* obj) + (logior! (-> this enemy-flags) (enemy-flag cam-attack-mode)) + (remove-from-process *part-engine* this) (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-no-seg)) - (the-as int (-> obj enemy-info gem-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-no-seg)) + (the-as int (-> this enemy-info gem-seg)) ) (let ((v1-28 (ppointer->process (birth-pickup-at-point - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj enemy-info gem-joint))) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this enemy-info gem-joint))) (pickup-type gem) 1.0 #t *entity-pool* - (-> obj fact) + (-> this fact) ) ) ) ) - (send-event (ppointer->process (-> obj parent)) 'wasp-change-gem obj v1-28) + (send-event (ppointer->process (-> this parent)) 'wasp-change-gem this v1-28) ) ) ) - ((method-of-type wasp dispose!) obj) + ((method-of-type wasp dispose!) this) (none) ) ) @@ -1643,62 +1643,62 @@ ) ) -(defmethod deactivate rift-ring-ingame ((obj rift-ring-ingame)) - (if (-> obj spin-sound-playing) - (sound-stop (-> obj spin-sound)) +(defmethod deactivate rift-ring-ingame ((this rift-ring-ingame)) + (if (-> this spin-sound-playing) + (sound-stop (-> this spin-sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! rift-ring-ingame ((obj rift-ring-ingame) (arg0 entity-actor)) +(defmethod init-from-entity! rift-ring-ingame ((this rift-ring-ingame) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-rift-ring-ingame" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1236) obj)) - (set! (-> obj draw light-index) (the-as uint 10)) - (set! (-> obj stutter) #f) - (set! (-> obj spin-sound) (new-sound-id)) - (set! (-> obj spin-sound-playing) #f) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1236) this)) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this stutter) #f) + (set! (-> this spin-sound) (new-sound-id)) + (set! (-> this spin-sound-playing) #f) + (go (method-of-object this idle)) (none) ) ;; WARN: Return type mismatch vector vs none. -(defmethod apply-gravity metalkor-spinner-chain-physics ((obj metalkor-spinner-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) - (vector-float*! arg0 (-> obj gravity) (-> obj gravity-mult)) +(defmethod apply-gravity metalkor-spinner-chain-physics ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) + (vector-float*! arg0 (-> this gravity) (-> this gravity-mult)) (vector+float*! arg0 arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* arg1 64))) - (-> obj velocity-mult) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* arg1 64))) + (-> this velocity-mult) ) (none) ) -(defmethod chain-physics-method-14 metalkor-spinner-chain-physics ((obj metalkor-spinner-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 metalkor-spinner-chain-physics ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) ) ;; WARN: Return type mismatch process-drawable vs metalkor-spinner. -(defmethod relocate metalkor-spinner ((obj metalkor-spinner) (arg0 int)) - (if (nonzero? (-> obj chain)) - (&+! (-> obj chain) arg0) +(defmethod relocate metalkor-spinner ((this metalkor-spinner) (arg0 int)) + (if (nonzero? (-> this chain)) + (&+! (-> this chain) arg0) ) - (the-as metalkor-spinner ((method-of-type process-drawable relocate) obj arg0)) + (the-as metalkor-spinner ((method-of-type process-drawable relocate) this arg0)) ) (defstate break-it (metalkor-spinner) @@ -1707,7 +1707,7 @@ This commonly includes things such as: (set! (-> self chain joint-length) (* 12288.0 (-> self root scale y))) (set! (-> self root scale y) 1.0) (initialize-chain-joints (-> self chain)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let* ((f30-0 0.9) (f28-0 0.2) (v1-12 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -1734,7 +1734,7 @@ This commonly includes things such as: (quaternion-normalize! (-> self root quat)) (update (-> self chain) self) (cond - ((< (- (current-time) (-> self state-time)) (seconds 1)) + ((not (time-elapsed? (-> self state-time) (seconds 1))) ) ((let ((v1-13 (ja-group))) (and v1-13 (= v1-13 (-> self draw art-group data 53))) @@ -1897,92 +1897,92 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-break-precipice ((obj nest-break-precipice) (arg0 entity-actor)) +(defmethod init-from-entity! nest-break-precipice ((this nest-break-precipice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-break-precipice" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 17)) + (set! (-> this draw light-index) (the-as uint 17)) (if (task-node-closed? (game-task-node nest-boss-introduction)) - (go (method-of-object obj die)) - (go (method-of-object obj idle)) + (go (method-of-object this die)) + (go (method-of-object this idle)) ) (none) ) -(defmethod draw hud-metalkor ((obj hud-metalkor)) - (set-hud-piece-position! (-> obj sprites 1) (the int (+ 462.0 (* 130.0 (-> obj offset)))) 350) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -32 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 1)) -62 14) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 1)) -32 14) - (let ((s5-0 (-> obj values 0 current)) - (f30-0 (* 0.01 (the float (-> obj values 1 current)))) +(defmethod draw hud-metalkor ((this hud-metalkor)) + (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites 1)) -32 14) + (let ((s5-0 (-> this values 0 current)) + (f30-0 (* 0.01 (the float (-> this values 1 current)))) ) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 1)) -92 15) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 1)) -92 15) (cond ((= s5-0 1) - (set! (-> obj sprites 4 color x) 0) - (set! (-> obj sprites 4 color y) 255) + (set! (-> this sprites 4 color x) 0) + (set! (-> this sprites 4 color y) 255) (set! f30-0 (+ 2.0 f30-0)) ) ((= s5-0 2) - (set! (-> obj sprites 4 color y) 255) - (set! (-> obj sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 255) + (set! (-> this sprites 4 color x) 255) (set! f30-0 (+ 1.0 f30-0)) ) ((= s5-0 3) - (set! (-> obj sprites 4 color x) 255) - (set! (-> obj sprites 4 color y) 0) + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 0) 0 ) (else (set! f30-0 0.0) ) ) - (set! (-> obj sprites 4 scale-x) (* -7.25 f30-0)) + (set! (-> this sprites 4 scale-x) (* -7.25 f30-0)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod init-callback hud-metalkor ((obj hud-metalkor)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-metalkor ((this hud-metalkor)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj values 0 target) 1) - (set! (-> obj values 1 target) 100) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 5 scale-x) 0.5) - (set! (-> obj sprites 5 flags) (the-as uint 4)) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 6 scale-x) 0.5) - (set! (-> obj sprites 6 flags) (the-as uint 4)) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 4 scale-y) 3.25) - (set! (-> obj sprites 4 color z) 0) - (set! (-> obj sprites 4 flags) (the-as uint 4)) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 3 scale-y) 1.5) - (set! (-> obj sprites 3 color z) 0) - (set! (-> obj sprites 3 flags) (the-as uint 4)) + (set! (-> this values 0 target) 1) + (set! (-> this values 1 target) 100) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 5 scale-x) 0.5) + (set! (-> this sprites 5 flags) (the-as uint 4)) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 6 scale-x) 0.5) + (set! (-> this sprites 6 flags) (the-as uint 4)) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 4 scale-y) 3.25) + (set! (-> this sprites 4 color z) 0) + (set! (-> this sprites 4 flags) (the-as uint 4)) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 3 scale-y) 1.5) + (set! (-> this sprites 3 color z) 0) + (set! (-> this sprites 3 flags) (the-as uint 4)) 0 (none) ) @@ -2272,15 +2272,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs metalkor-bomb. -(defmethod relocate metalkor-bomb ((obj metalkor-bomb) (arg0 int)) +(defmethod relocate metalkor-bomb ((this metalkor-bomb) (arg0 int)) (dotimes (v1-0 (min 49 (-> *metalkor-bomb-probe-joints* length))) - (when (nonzero? (-> obj joint-mods v1-0)) - (if (nonzero? (-> obj joint-mods v1-0)) - (&+! (-> obj joint-mods v1-0) arg0) + (when (nonzero? (-> this joint-mods v1-0)) + (if (nonzero? (-> this joint-mods v1-0)) + (&+! (-> this joint-mods v1-0) arg0) ) ) ) - (the-as metalkor-bomb ((method-of-type process-drawable relocate) obj arg0)) + (the-as metalkor-bomb ((method-of-type process-drawable relocate) this arg0)) ) (define *metalkor-bomb-collide-joints* (new 'static 'boxed-array :type int8 diff --git a/goal_src/jak2/levels/nest/boss/metalkor-setup.gc b/goal_src/jak2/levels/nest/boss/metalkor-setup.gc index 7cc36e8a7b..0059c3d10f 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-setup.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-setup.gc @@ -711,14 +711,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nestb-tail-bound ((obj nestb-tail-bound) (arg0 entity-actor)) +(defmethod init-from-entity! nestb-tail-bound ((this nestb-tail-bound) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec special-obstacle)) (set! (-> v1-2 prim-core action) (collide-action solid)) @@ -732,18 +732,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (+! (-> obj root trans y) -36864.0) + (process-drawable-from-entity! this arg0) + (+! (-> this root trans y) -36864.0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nestb-tail-bound" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) - (go (method-of-object obj idle)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) + (go (method-of-object this idle)) (none) ) @@ -935,7 +935,7 @@ This commonly includes things such as: (cshape-reaction-update-state arg0 arg1 sv-16) (let ((s5-0 (-> arg0 process))) (cond - ((>= (- (current-time) (-> (the-as metalkor-egg s5-0) sticky-time)) (seconds 0.05)) + ((time-elapsed? (-> (the-as metalkor-egg s5-0) sticky-time) (seconds 0.05)) (let ((t9-1 vector--float*!) (a0-3 arg2) (a1-1 sv-16) @@ -950,6 +950,7 @@ This commonly includes things such as: (f5-0 (-> v1-4 y)) (f6-0 (-> v1-4 z)) ) + ;; og:preserve-this inlined vector-dot ; (.mula.s f1-0 f4-0) ; (.madda.s f2-0 f5-0) ; (.madd.s f1-1 f3-0 f6-0) @@ -995,9 +996,7 @@ This commonly includes things such as: 0 ) ((let ((f1-6 4096.0)) - (and (< (* f1-6 f1-6) f0-10) - (>= (- (current-time) (-> (the-as metalkor-egg s5-0) sticky-time)) (seconds 0.2)) - ) + (and (< (* f1-6 f1-6) f0-10) (time-elapsed? (-> (the-as metalkor-egg s5-0) sticky-time) (seconds 0.2))) ) (vector-float*! arg2 arg2 (/ 4096.0 (sqrtf f0-10))) ) @@ -1551,7 +1550,7 @@ This commonly includes things such as: (none) ) -(defmethod init-from-entity! metalkor ((obj metalkor) (arg0 entity-actor)) +(defmethod init-from-entity! metalkor ((this metalkor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1559,7 +1558,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1608,48 +1607,48 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj root pause-adjust-distance) 409600.0) - (process-drawable-from-entity! obj arg0) + (set! (-> this root pause-adjust-distance) 409600.0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-metalkor" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (set! (-> obj draw light-index) (the-as uint 10)) - (set! (-> obj lowtorso) (the-as handle #f)) - (set! (-> obj trackable) #f) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this lowtorso) (the-as handle #f)) + (set! (-> this trackable) #f) (dotimes (v1-33 10) - (set! (-> obj flitters v1-33) (the-as handle #f)) + (set! (-> this flitters v1-33) (the-as handle #f)) ) (dotimes (v1-36 3) - (set! (-> obj wasps v1-36) (the-as handle #f)) + (set! (-> this wasps v1-36) (the-as handle #f)) ) - (set! (-> obj initial-y) (-> obj root trans y)) - (set! (-> obj hud) (the-as handle #f)) - (set! (-> obj legs) (the-as handle #f)) - (set! (-> obj kid) (the-as handle #f)) - (set! (-> obj wings) (the-as handle #f)) - (set! (-> obj explode) (the-as handle #f)) - (set! (-> obj rift-occlude) (the-as handle #f)) - (set! (-> obj last-attack-id) (the-as uint 0)) - (let ((a0-40 (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 1))) + (set! (-> this initial-y) (-> this root trans y)) + (set! (-> this hud) (the-as handle #f)) + (set! (-> this legs) (the-as handle #f)) + (set! (-> this kid) (the-as handle #f)) + (set! (-> this wings) (the-as handle #f)) + (set! (-> this explode) (the-as handle #f)) + (set! (-> this rift-occlude) (the-as handle #f)) + (set! (-> this last-attack-id) (the-as uint 0)) + (let ((a0-40 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 1))) (if a0-40 - (change-to a0-40 obj) + (change-to a0-40 this) ) ) - (set! (-> obj current-nav-poly) #f) - (set! (-> obj shot-anticipate) (create-launch-control (-> *part-group-id-table* 1232) obj)) - (set! (-> obj last-flitter-launched) 0) - (set! (-> obj last-wasp-launched) 0) - (set! (-> obj live-flitters) 0) - (set! (-> obj live-wasps) 0) - (set! (-> obj flitter-gem-tracker) (the-as handle #f)) - (set! (-> obj wasp-gem-tracker) (the-as handle #f)) + (set! (-> this current-nav-poly) #f) + (set! (-> this shot-anticipate) (create-launch-control (-> *part-group-id-table* 1232) this)) + (set! (-> this last-flitter-launched) 0) + (set! (-> this last-wasp-launched) 0) + (set! (-> this live-flitters) 0) + (set! (-> this live-wasps) 0) + (set! (-> this flitter-gem-tracker) (the-as handle #f)) + (set! (-> this wasp-gem-tracker) (the-as handle #f)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-47 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-47 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (when (and v1-47 (> (-> sv-16 elt-count) 0)) (let ((v1-48 (-> v1-47 0))) (when (>= (-> v1-48 length) 1) @@ -1661,8 +1660,8 @@ This commonly includes things such as: ) ) (if a0-52 - (set! (-> obj flitter-gem-tracker) (process->handle a0-52)) - (set! (-> obj flitter-gem-tracker) + (set! (-> this flitter-gem-tracker) (process->handle a0-52)) + (set! (-> this flitter-gem-tracker) (ppointer->handle (process-spawn flitter-gem-tracker :init gem-tracker-init-by-other s5-2 0 :to *entity-pool*) ) @@ -1674,8 +1673,8 @@ This commonly includes things such as: ) ) (if a0-63 - (set! (-> obj wasp-gem-tracker) (process->handle a0-63)) - (set! (-> obj wasp-gem-tracker) + (set! (-> this wasp-gem-tracker) (process->handle a0-63)) + (set! (-> this wasp-gem-tracker) (ppointer->handle (process-spawn wasp-gem-tracker :init gem-tracker-init-by-other s5-2 1 :to *entity-pool*)) ) ) @@ -1688,29 +1687,29 @@ This commonly includes things such as: (copy-nav-enemy-info! *metalkor-flitter-nav-enemy-info* *flitter-nav-enemy-info*) (set! (-> *metalkor-flitter-nav-enemy-info* notice-distance) 1638400.0) (dotimes (v1-71 4) - (set! (-> obj spinners v1-71) (the-as handle #f)) + (set! (-> this spinners v1-71) (the-as handle #f)) ) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 6)) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 409600.0) - (set! (-> obj neck ignore-angle) 16384.0) - (mode-set! (-> obj neck) (joint-mod-mode look-at)) - (set! (-> obj previous-flat-travel-timer) 0) - (set! (-> obj previous-flat-travel-long-timer) 0) - (set! (-> obj countdown-to-roar) 3) - (let ((v1-88 (-> obj root root-prim))) - (set! (-> obj root backup-collide-as) (-> v1-88 prim-core collide-as)) - (set! (-> obj root backup-collide-with) (-> v1-88 prim-core collide-with)) + (set! (-> this neck) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 6)) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 409600.0) + (set! (-> this neck ignore-angle) 16384.0) + (mode-set! (-> this neck) (joint-mod-mode look-at)) + (set! (-> this previous-flat-travel-timer) 0) + (set! (-> this previous-flat-travel-long-timer) 0) + (set! (-> this countdown-to-roar) 3) + (let ((v1-88 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-88 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-88 prim-core collide-with)) ) - (set! (-> obj no-collision-timer) 0) - (set! (-> obj wing-sound) (new-sound-id)) - (set! (-> obj wing-sound-playing) #f) - (set! (-> obj explode-sound) (new-sound-id)) - (set! (-> obj bomb-sound) (new-sound-id)) - (set! (-> obj stage) -1) + (set! (-> this no-collision-timer) 0) + (set! (-> this wing-sound) (new-sound-id)) + (set! (-> this wing-sound-playing) #f) + (set! (-> this explode-sound) (new-sound-id)) + (set! (-> this bomb-sound) (new-sound-id)) + (set! (-> this stage) -1) (metalkor-go-next-stage) (none) ) diff --git a/goal_src/jak2/levels/nest/boss/metalkor-states.gc b/goal_src/jak2/levels/nest/boss/metalkor-states.gc index a6694c2acd..392f2039d7 100644 --- a/goal_src/jak2/levels/nest/boss/metalkor-states.gc +++ b/goal_src/jak2/levels/nest/boss/metalkor-states.gc @@ -241,7 +241,7 @@ (if (and (nonzero? (-> self next-stage-timer)) (>= (- (current-time) (-> self next-stage-timer)) 0)) (metalkor-go-next-stage) ) - (when (>= (- (current-time) (-> self no-collision-timer)) (seconds 0.1)) + (when (time-elapsed? (-> self no-collision-timer) (seconds 0.1)) (let ((v1-25 (-> self root root-prim))) (set! (-> v1-25 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-25 prim-core collide-with) (-> self root backup-collide-with)) @@ -294,33 +294,33 @@ (none) ) -(defmethod deactivate metalkor ((obj metalkor)) - (if (-> obj wing-sound-playing) - (sound-stop (-> obj wing-sound)) +(defmethod deactivate metalkor ((this metalkor)) + (if (-> this wing-sound-playing) + (sound-stop (-> this wing-sound)) ) - ((method-of-type process-focusable deactivate) obj) + ((method-of-type process-focusable deactivate) this) (none) ) ;; WARN: Return type mismatch process-focusable vs metalkor. -(defmethod relocate metalkor ((obj metalkor) (arg0 int)) - (if (nonzero? (-> obj shot-anticipate)) - (&+! (-> obj shot-anticipate) arg0) +(defmethod relocate metalkor ((this metalkor) (arg0 int)) + (if (nonzero? (-> this shot-anticipate)) + (&+! (-> this shot-anticipate) arg0) ) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) + (if (nonzero? (-> this neck)) + (&+! (-> this neck) arg0) ) - (the-as metalkor ((method-of-type process-focusable relocate) obj arg0)) + (the-as metalkor ((method-of-type process-focusable relocate) this arg0)) ) -(defmethod get-trans metalkor ((obj metalkor) (arg0 int)) +(defmethod get-trans metalkor ((this metalkor) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (s5-0 vector)) (cond ((or (= arg0 2) (= arg0 3)) (set! s5-0 (new 'static 'vector)) (set! (-> s5-0 quad) - (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 0 prim-core world-sphere quad) + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0 prim-core world-sphere quad) ) (set! (-> s5-0 w) 61440.0) s5-0 @@ -328,31 +328,31 @@ ((= arg0 4) (set! s5-0 (new 'static 'vector)) (cond - ((zero? (-> obj skel active-channels)) + ((zero? (-> this skel active-channels)) ) - ((or (and (-> obj next-state) (= (-> obj next-state name) 'explode)) - (and (and (-> obj next-state) (= (-> obj next-state name) 'fly-to-ring)) (-> obj been-to-entity)) + ((or (and (-> this next-state) (= (-> this next-state name) 'explode)) + (and (and (-> this next-state) (= (-> this next-state name) 'fly-to-ring)) (-> this been-to-entity)) ) - (vector<-cspace! s5-0 (-> obj node-list data 3)) + (vector<-cspace! s5-0 (-> this node-list data 3)) ) (else - (set! (-> s5-0 quad) (-> obj root trans quad)) + (set! (-> s5-0 quad) (-> this root trans quad)) (+! (-> s5-0 y) 8192.0) ) ) - (when (< 0.0 (-> obj ring-cam-pos value)) - (let ((a0-15 (metalkor-get-ring obj)) + (when (< 0.0 (-> this ring-cam-pos value)) + (let ((a0-15 (metalkor-get-ring this)) (a2-0 (new 'stack-no-clear 'vector)) ) (set! (-> a2-0 quad) (-> a0-15 trans quad)) (+! (-> a2-0 y) -65536.0) - (vector-lerp! s5-0 s5-0 a2-0 (-> obj ring-cam-pos value)) + (vector-lerp! s5-0 s5-0 a2-0 (-> this ring-cam-pos value)) ) ) s5-0 ) (else - ((method-of-type process-focusable get-trans) obj arg0) + ((method-of-type process-focusable get-trans) this arg0) ) ) ) @@ -816,7 +816,7 @@ (-> arg3 param 0) (static-attack-info ((id (new-attack-id)) (vector s4-4) (shove-up (meters 6)))) ) - (set! (-> self no-collision-timer) (current-time)) + (set-time! (-> self no-collision-timer)) (let ((v1-175 (-> self root root-prim))) (set! (-> v1-175 prim-core collide-as) (collide-spec)) (set! (-> v1-175 prim-core collide-with) (collide-spec)) @@ -839,7 +839,7 @@ (when (not (handle->process (-> self flitters v1-3))) (new 'stack-no-clear 'vector) (let ((f0-1 (* 182.04445 (rand-vu-float-range 70.0 290.0)))) - (set! (-> self egg-timer) (current-time)) + (set-time! (-> self egg-timer)) (set! (-> self egg-angle) f0-1) (if (< 32768.0 f0-1) (send-event (handle->process (-> self lowtorso)) 'egg-toss 1.0) @@ -857,7 +857,7 @@ (if (zero? (-> self egg-timer)) (return #f) ) - (if (< (- (current-time) (-> self egg-timer)) (seconds 0.2)) + (if (not (time-elapsed? (-> self egg-timer) (seconds 0.2))) (return #t) ) (dotimes (gp-0 10) @@ -1781,7 +1781,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (ja-channel-push! 1 (seconds 0.1)) (ja :group! (-> self draw art-group data 30) :num! min) ) @@ -1833,7 +1833,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self min-state-hit-points) (+ -0.34 (-> self stage-hit-points))) (if (nonzero? (-> self neck)) (set! (-> self neck flex-blend) 0.0) @@ -1858,7 +1858,7 @@ ) ) :trans (behavior () - (if (or (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (or (time-elapsed? (-> self state-time) (seconds 1)) (>= (-> self min-state-hit-points) (-> self stage-hit-points)) ) (go-virtual overload-recover) @@ -1924,12 +1924,12 @@ (defstate play-drop-movie (metalkor) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status subtask-complete) #t) (process-spawn scene-player :init scene-player-init "nest-kor-boss-fight-mid" #t "nestb-boss") ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (deactivate self) ) ) @@ -2042,9 +2042,9 @@ (vector-! s3-0 s3-0 (-> s2-0 boundary-normal)) (when (or s1-0 (> s0-1 0) (< (+ (current-time) (seconds -0.1)) (-> self previous-flat-travel-timer))) (set! (-> self previous-flat-travel quad) (-> s4-0 quad)) - (set! (-> self previous-flat-travel-timer) (current-time)) + (set-time! (-> self previous-flat-travel-timer)) (if (zero? (-> self previous-flat-travel-long-timer)) - (set! (-> self previous-flat-travel-long-timer) (current-time)) + (set-time! (-> self previous-flat-travel-long-timer)) ) ) ) @@ -2221,11 +2221,11 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (cond - ((>= (- (current-time) (-> self state-time)) (seconds 4)) + ((time-elapsed? (-> self state-time) (seconds 4)) (go-virtual chase-target) ) ((let ((f0-0 57344.0)) @@ -2263,7 +2263,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self shots-fired) 0) (set! (-> self current-nav-poly) (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) @@ -2291,10 +2291,10 @@ (sound-play "nboss-pre-shot") ) ) - (when (or (>= (- (current-time) (-> self state-time)) (seconds 1.25)) - (and (>= (- (current-time) (-> self state-time)) (seconds 0.75)) (nonzero? (-> self shots-fired))) + (when (or (time-elapsed? (-> self state-time) (seconds 1.25)) + (and (time-elapsed? (-> self state-time) (seconds 0.75)) (nonzero? (-> self shots-fired))) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (metalkor-shoot-projectile) (set-nestb-purple! (fmax 1.0 (get-nestb-purple))) (metalkor-ja-float-stop (the-as art-joint-anim (-> self draw art-group data 32))) @@ -2322,7 +2322,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self current-nav-poly) (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) ) @@ -2330,7 +2330,7 @@ :trans (behavior () (let ((v1-2 (ja-group))) (when (and (not (and v1-2 (= v1-2 (-> self draw art-group data 33)))) - (>= (- (current-time) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) ) (cond ((or (< (-> self last-standing-attack) -1) @@ -2428,7 +2428,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self shoot-timer) (current-time)) + (set-time! (-> self shoot-timer)) (set! (-> self shots-fired) 0) (set! (-> self wave-timer) 0) (set! (-> self in-wave) #f) @@ -2449,9 +2449,9 @@ (if (and (-> self in-wave) (= (-> self stage) 1)) (set! v1-0 3000) ) - (when (>= (- (current-time) (-> self wave-timer)) v1-0) + (when (time-elapsed? (-> self wave-timer) v1-0) (set! (-> self in-wave) (not (-> self in-wave))) - (set! (-> self wave-timer) (current-time)) + (set-time! (-> self wave-timer)) ) ) (cond @@ -2462,8 +2462,8 @@ (set! (-> self launching-wasps) #t) ) ) - (when (and (-> self launching-wasps) (>= (- (current-time) (-> self wasp-timer)) (seconds 1.5))) - (set! (-> self wasp-timer) (current-time)) + (when (and (-> self launching-wasps) (time-elapsed? (-> self wasp-timer) (seconds 1.5))) + (set-time! (-> self wasp-timer)) (dotimes (gp-0 3) (when (not (handle->process (-> self wasps gp-0))) (set! sv-16 (new 'static 'res-tag)) @@ -2533,7 +2533,7 @@ ) (rotate-and-update-hang-anim) (if (and (< 10922.667 (-> self target-angle)) - (< (- (current-time) (-> self shoot-timer)) (seconds 3.75)) + (not (time-elapsed? (-> self shoot-timer) (seconds 3.75))) (zero? (mod (-> self shots-fired) (-> self stage))) ) (set! (-> self shoot-timer) @@ -2542,12 +2542,12 @@ ) (cond ((metalkor-check-egg) - (set! (-> self shoot-timer) (current-time)) + (set-time! (-> self shoot-timer)) ) - ((or (>= (- (current-time) (-> self shoot-timer)) (seconds 3.75)) + ((or (time-elapsed? (-> self shoot-timer) (seconds 3.75)) (nonzero? (mod (-> self shots-fired) (-> self stage))) ) - (set! (-> self flitter-timer) (current-time)) + (set-time! (-> self flitter-timer)) (spawn (-> self shot-anticipate) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 7))) (if (zero? (mod (-> self shots-fired) (-> self stage))) (set-nestb-purple! @@ -2571,12 +2571,12 @@ (sound-play "nboss-pre-shot") ) ) - (when (or (>= (- (current-time) (-> self shoot-timer)) (seconds 5)) - (and (>= (- (current-time) (-> self shoot-timer)) (seconds 0.75)) + (when (or (time-elapsed? (-> self shoot-timer) (seconds 5)) + (and (time-elapsed? (-> self shoot-timer) (seconds 0.75)) (nonzero? (mod (-> self shots-fired) (-> self stage))) ) ) - (set! (-> self shoot-timer) (current-time)) + (set-time! (-> self shoot-timer)) (metalkor-shoot-projectile) (set-nestb-purple! (fmax 1.0 (get-nestb-purple))) (metalkor-ja-float-stop (the-as art-joint-anim (-> self draw art-group data 23))) @@ -2586,8 +2586,8 @@ ) ) ((and (-> self launching-flitters) (>= (+ (current-time) (seconds -0.5)) (-> self flitter-timer))) - (set! (-> self flitter-timer) (current-time)) - (set! (-> self shoot-timer) (current-time)) + (set-time! (-> self flitter-timer)) + (set-time! (-> self shoot-timer)) (metalkor-start-egg) ) ) @@ -2625,7 +2625,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self current-nav-poly) (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) ) @@ -2639,7 +2639,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.017)) (cpad-hold? 1 x)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.017)) (cpad-hold? 1 x)) (go-virtual test) ) (let ((s4-0 (new-stack-vector0)) @@ -2698,9 +2698,9 @@ (vector-! s4-1 s4-1 (-> s3-0 boundary-normal)) (when (or (> s2-1 0) (< (+ (current-time) (seconds -0.1)) (-> self previous-flat-travel-timer))) (set! (-> self previous-flat-travel quad) (-> s5-1 quad)) - (set! (-> self previous-flat-travel-timer) (current-time)) + (set-time! (-> self previous-flat-travel-timer)) (if (zero? (-> self previous-flat-travel-long-timer)) - (set! (-> self previous-flat-travel-long-timer) (current-time)) + (set-time! (-> self previous-flat-travel-long-timer)) ) ) ) diff --git a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc index beac049c87..3abe96b884 100644 --- a/goal_src/jak2/levels/nest/boss/nestb-scenes.gc +++ b/goal_src/jak2/levels/nest/boss/nestb-scenes.gc @@ -21,13 +21,13 @@ (set! (-> a1-0 param 0) (the-as uint 7)) (let ((f30-0 (send-event-function *target* a1-0))) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.1)) + (until (time-elapsed? gp-0 (seconds 0.1)) (suspend) ) ) (send-event *target* 'change-mode 'darkjak #f (darkjak-stage no-anim)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.1)) + (until (time-elapsed? gp-1 (seconds 0.1)) (suspend) ) ) @@ -1640,22 +1640,22 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-gun-parts ((obj nest-gun-parts) (arg0 entity-actor)) +(defmethod init-from-entity! nest-gun-parts ((this nest-gun-parts) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-gun-parts" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 11)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 11)) + (go (method-of-object this idle)) (none) ) @@ -1693,27 +1693,27 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-unbroken-rocks ((obj nest-unbroken-rocks) (arg0 entity-actor)) +(defmethod init-from-entity! nest-unbroken-rocks ((this nest-unbroken-rocks) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-unbroken-rocks" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 1)) + (set! (-> this draw light-index) (the-as uint 1)) (if (task-node-closed? (game-task-node nest-get-to-gun-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj idle)) + (cleanup-for-death this) + (go (method-of-object this idle)) ) (none) ) diff --git a/goal_src/jak2/levels/nest/flying-spider.gc b/goal_src/jak2/levels/nest/flying-spider.gc index 5ce9741fb1..dfdcd3dd05 100644 --- a/goal_src/jak2/levels/nest/flying-spider.gc +++ b/goal_src/jak2/levels/nest/flying-spider.gc @@ -19,11 +19,11 @@ ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound flying-spider-shot ((obj flying-spider-shot) (arg0 projectile-options)) +(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)) - obj + this arg0 ) ) @@ -507,7 +507,7 @@ :event enemy-event-handler :enter (behavior () (dispose! self) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self hit-points) 0) (enemy-method-103 self) ) @@ -537,99 +537,99 @@ :post enemy-simple-post ) -(defmethod general-event-handler flying-spider ((obj flying-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler flying-spider ((this flying-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (let ((s5-1 (-> obj incoming knocked-type))) + ((zero? (-> this hit-points)) + (let ((s5-1 (-> this incoming knocked-type))) (cond ((and (= s5-1 (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-32 (-> obj next-state name))) - (or (= v1-32 'knocked) (= v1-32 'jump) (= v1-32 'jump-land)) - ) + (not (and (-> this next-state) (let ((v1-32 (-> this next-state name))) + (or (= v1-32 'knocked) (= v1-32 'jump) (= v1-32 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ((or (= s5-1 (knocked-type knocked-type-4)) (= s5-1 (knocked-type knocked-type-6))) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - (go (method-of-object obj knocked)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) + (go (method-of-object this knocked)) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t ) (('death-start) - (let ((v1-52 (-> obj root root-prim))) + (let ((v1-52 (-> this root root-prim))) (set! (-> v1-52 prim-core collide-as) (collide-spec)) (set! (-> v1-52 prim-core collide-with) (collide-spec)) ) 0 - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod track-target! flying-spider ((obj flying-spider)) +(defmethod track-target! flying-spider ((this flying-spider)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - ((method-of-type nav-enemy track-target!) obj) + ((method-of-type nav-enemy track-target!) this) (none) ) ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 flying-spider ((obj flying-spider) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 flying-spider ((this flying-spider) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface - (when (find-ground (-> obj root) arg0 arg1 arg2 arg3 arg4) - (set! (-> obj root ground-pat) (-> arg0 best-other-tri pat)) - (when (>= (- (current-time) (-> obj gspot-timer)) (seconds 0.2)) + (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) + (set! (-> this root ground-pat) (-> arg0 best-other-tri pat)) + (when (time-elapsed? (-> this gspot-timer) (seconds 0.2)) (let ((a1-2 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-2 start-pos quad) (-> obj root gspot-pos quad)) + (set! (-> a1-2 start-pos quad) (-> this root gspot-pos quad)) (+! (-> a1-2 start-pos y) 2048.0) (set-vector! (-> a1-2 move-dist) 0.0 -6144.0 0.0 0.0) (let ((v1-10 a1-2)) (set! (-> v1-10 radius) 4915.2) (set! (-> v1-10 collide-with) arg1) - (set! (-> v1-10 ignore-process0) obj) + (set! (-> v1-10 ignore-process0) this) (set! (-> v1-10 ignore-process1) #f) - (set! (-> v1-10 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-10 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-10 action-mask) (collide-action solid)) ) (fill-using-line-sphere *collide-cache* a1-2) @@ -650,37 +650,37 @@ ) ) ) - (vector-normalize-copy! (-> obj gspot-normal) s5-1 1.0) + (vector-normalize-copy! (-> this gspot-normal) s5-1 1.0) ) - (set! (-> obj gspot-timer) (current-time)) + (set-time! (-> this gspot-timer)) ) #t ) ) ) -(defmethod flying-spider-method-182 flying-spider ((obj flying-spider) (arg0 vector)) +(defmethod flying-spider-method-182 flying-spider ((this flying-spider) (arg0 vector)) (cond - ((= (-> obj root gspot-pos y) -40959590.0) + ((= (-> this root gspot-pos y) -40959590.0) (set! (-> arg0 y) 0.0) (vector-normalize! arg0 1.0) - (quaternion-set! (-> obj root quat) 0.0 (-> arg0 x) 0.0 (+ 1.0 (-> arg0 z))) - (quaternion-normalize! (-> obj root quat)) + (quaternion-set! (-> this root quat) 0.0 (-> arg0 x) 0.0 (+ 1.0 (-> arg0 z))) + (quaternion-normalize! (-> this root quat)) ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> *up-vector* quad)) (let ((s3-0 (new 'stack-no-clear 'quaternion))) - (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> obj gspot-normal) 4551.1113) + (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this gspot-normal) 4551.1113) (vector-orient-by-quat! s4-0 s4-0 s3-0) ) - (let ((s3-1 (-> obj my-up-vector))) + (let ((s3-1 (-> this my-up-vector))) (new 'stack-no-clear 'vector) (vector-deg-seek s3-1 s3-1 s4-0 (* 910.2222 (seconds-per-frame))) (vector-normalize! s3-1 1.0) (set! (-> arg0 y) 0.0) (vector-normalize! arg0 1.0) - (forward-up->quaternion (-> obj root quat) arg0 s3-1) + (forward-up->quaternion (-> this root quat) arg0 s3-1) ) ) ) @@ -689,19 +689,19 @@ (none) ) -(defmethod nav-enemy-method-142 flying-spider ((obj flying-spider) (arg0 nav-control)) - (let ((t9-0 (method-of-object obj flying-spider-method-182)) +(defmethod nav-enemy-method-142 flying-spider ((this flying-spider) (arg0 nav-control)) + (let ((t9-0 (method-of-object this flying-spider-method-182)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 quad) (-> a2-0 heading quad)) - (t9-0 obj a1-1) + (t9-0 this a1-1) ) 0 (none) ) -(defmethod look-at-target! flying-spider ((obj flying-spider) (arg0 enemy-flag)) +(defmethod look-at-target! flying-spider ((this flying-spider) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" 0 @@ -709,25 +709,25 @@ ) ;; WARN: Return type mismatch int vs penetrate. -(defmethod get-penetrate-info flying-spider ((obj flying-spider)) +(defmethod get-penetrate-info flying-spider ((this flying-spider)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (the-as penetrate 0) ) -(defmethod enemy-method-51 flying-spider ((obj flying-spider)) - (quaternion-y-angle (-> obj root quat)) +(defmethod enemy-method-51 flying-spider ((this flying-spider)) + (quaternion-y-angle (-> this root quat)) ) -(defmethod coin-flip? flying-spider ((obj flying-spider)) +(defmethod coin-flip? flying-spider ((this flying-spider)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! flying-spider ((obj flying-spider)) +(defmethod init-enemy-collision! flying-spider ((this flying-spider)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -783,44 +783,51 @@ (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) -(defmethod init-enemy! flying-spider ((obj flying-spider)) +(defmethod init-enemy! flying-spider ((this flying-spider)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flying-spider" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *flying-spider-nav-enemy-info*) - (let ((v1-5 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *flying-spider-nav-enemy-info*) + (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) (set! (-> v1-5 ear) (the-as uint 0)) (set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0) (set! (-> v1-5 ignore-angle) 30947.555) ) - (set! (-> obj root dynam gravity y) 327680.0) - (set! (-> obj root dynam gravity-length) 327680.0) - (set! (-> obj root dynam gravity-max) 327680.0) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (set! (-> obj path-u) 0.0) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (add-connection *part-engine* obj 27 obj 318 (new 'static 'vector :x 1392.64 :y 204.8 :z 2621.44 :w 163840.0)) + (set! (-> this root dynam gravity y) 327680.0) + (set! (-> this root dynam gravity-length) 327680.0) + (set! (-> this root dynam gravity-max) 327680.0) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (set! (-> this path-u) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (add-connection *part-engine* - obj + this 27 - obj + this + 318 + (new 'static 'vector :x 1392.64 :y 204.8 :z 2621.44 :w 163840.0) + ) + (add-connection + *part-engine* + this + 27 + this 318 (new 'static 'vector :x -1392.64 :y 204.8 :z 2621.44 :w 163840.0) ) - (set! (-> obj my-up-vector quad) (-> *y-vector* quad)) - (set! (-> obj gspot-normal quad) (-> *y-vector* quad)) - (set! (-> obj gspot-timer) 0) + (set! (-> this my-up-vector quad) (-> *y-vector* quad)) + (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + (set! (-> this gspot-timer) 0) 0 (none) ) diff --git a/goal_src/jak2/levels/nest/mammoth.gc b/goal_src/jak2/levels/nest/mammoth.gc index 39379c0934..6c0b62eef2 100644 --- a/goal_src/jak2/levels/nest/mammoth.gc +++ b/goal_src/jak2/levels/nest/mammoth.gc @@ -468,8 +468,8 @@ (ja :num! (seek!)) ) (mammoth-walk-check-end) - (when (>= (- (current-time) (-> self attack-timer)) (seconds 5)) - (set! (-> self attack-timer) (current-time)) + (when (time-elapsed? (-> self attack-timer) (seconds 5)) + (set-time! (-> self attack-timer)) (go-virtual walking-attack) ) ) @@ -510,7 +510,7 @@ (logior! (-> self foot-flags) 6) ) :trans (behavior () - (when (and (< (- (current-time) (-> self lightning-timer)) (seconds 3)) (< (-> self spawn-timer) (current-time))) + (when (and (not (time-elapsed? (-> self lightning-timer) (seconds 3))) (< (-> self spawn-timer) (current-time))) (let ((s5-0 *mammoth-lightning-joint-tbl*)) (mammoth-method-185 self (-> self root trans) (-> s5-0 (get-rand-int self (-> s5-0 length)))) ) @@ -534,8 +534,8 @@ (ja :num! (seek! max 0.8)) ) (mammoth-walk-check-end) - (when (>= (- (current-time) (-> self attack-timer)) (seconds 3)) - (set! (-> self attack-timer) (current-time)) + (when (time-elapsed? (-> self attack-timer) (seconds 3)) + (set-time! (-> self attack-timer)) (go-virtual walking) ) ) @@ -686,32 +686,32 @@ :post mammoth-walk-post ) -(defmethod general-event-handler mammoth ((obj mammoth) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler mammoth ((this mammoth) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod mammoth-method-185 mammoth ((obj mammoth) (arg0 vector) (arg1 int)) +(defmethod mammoth-method-185 mammoth ((this mammoth) (arg0 vector) (arg1 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -720,10 +720,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s1-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg1))) + (let ((s1-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1))) (s2-0 (new 'stack-no-clear 'vector)) ) - (let ((s4-1 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) 16384.0))) + (let ((s4-1 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) 16384.0))) (vector-! s2-0 s1-0 arg0) (set! (-> s2-0 y) 0.0) (vector-xz-normalize! s2-0 49152.0) @@ -733,7 +733,7 @@ (let ((s3-1 (new 'stack-no-clear 'collide-query)) (s4-2 (new 'stack-no-clear 'matrix)) ) - (matrix->trans (-> obj node-list data arg1 bone transform) (-> s3-1 start-pos)) + (matrix->trans (-> this node-list data arg1 bone transform) (-> s3-1 start-pos)) (set! (-> s3-1 move-dist quad) (-> s2-0 quad)) (let ((v1-11 s3-1)) (set! (-> v1-11 radius) 4.096) @@ -767,7 +767,7 @@ (-> *lightning-spec-id-table* 1) 600 #f - obj + this arg1 s4-2 :to *entity-pool* @@ -781,38 +781,38 @@ ) ) -(defmethod go-stare mammoth ((obj mammoth)) - (go (method-of-object obj walking)) +(defmethod go-stare mammoth ((this mammoth)) + (go (method-of-object this walking)) ) -(defmethod go-hostile mammoth ((obj mammoth)) - (go (method-of-object obj walking)) +(defmethod go-hostile mammoth ((this mammoth)) + (go (method-of-object this walking)) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle mammoth ((obj mammoth)) - (go (method-of-object obj waiting)) +(defmethod go-idle mammoth ((this mammoth)) + (go (method-of-object this waiting)) (none) ) ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 mammoth ((obj mammoth) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 mammoth ((this mammoth) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface - (when (find-ground (-> obj root) arg0 arg1 arg2 arg3 arg4) - (set! (-> obj root ground-pat) (-> arg0 best-other-tri pat)) + (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) + (set! (-> this root ground-pat) (-> arg0 best-other-tri pat)) (let ((s3-0 (new 'stack-no-clear 'collide-query))) - (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root gspot-pos) (-> obj root trans)))) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this root gspot-pos) (-> this root trans)))) (vector-normalize! s2-1 1.0) - (vector+float*! (-> s3-0 start-pos) (-> obj root gspot-pos) s2-1 -4096.0) + (vector+float*! (-> s3-0 start-pos) (-> this root gspot-pos) s2-1 -4096.0) (vector-float*! (-> s3-0 move-dist) s2-1 8192.0) ) (let ((v1-9 s3-0)) (set! (-> v1-9 radius) 8192.0) (set! (-> v1-9 collide-with) arg1) - (set! (-> v1-9 ignore-process0) obj) + (set! (-> v1-9 ignore-process0) this) (set! (-> v1-9 ignore-process1) #f) - (set! (-> v1-9 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-9 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-9 action-mask) (collide-action solid)) ) (fill-using-line-sphere *collide-cache* s3-0) @@ -833,37 +833,37 @@ ) ) ) - (vector-normalize-copy! (-> obj gspot-normal) s4-1 1.0) + (vector-normalize-copy! (-> this gspot-normal) s4-1 1.0) ) - (let ((f0-4 (-> obj root gspot-pos y))) - (if (= (-> obj y-level) -40959590.0) - (set! (-> obj y-level) f0-4) - (seek! (-> obj y-level) f0-4 (* 8192.0 (seconds-per-frame))) + (let ((f0-4 (-> this root gspot-pos y))) + (if (= (-> this y-level) -40959590.0) + (set! (-> this y-level) f0-4) + (seek! (-> this y-level) f0-4 (* 8192.0 (seconds-per-frame))) ) ) - (set! (-> obj root gspot-pos y) (-> obj y-level)) - (set! (-> arg0 best-other-tri intersect y) (-> obj y-level)) + (set! (-> this root gspot-pos y) (-> this y-level)) + (set! (-> arg0 best-other-tri intersect y) (-> this y-level)) #t ) ) ) -(defmethod mammoth-method-183 mammoth ((obj mammoth)) +(defmethod mammoth-method-183 mammoth ((this mammoth)) (cond - ((= (-> obj root gspot-pos y) -40959590.0) - (quaternion-copy! (-> obj tilt-quat) *unity-quaternion*) + ((= (-> this root gspot-pos y) -40959590.0) + (quaternion-copy! (-> this tilt-quat) *unity-quaternion*) ) (else - (let ((s1-0 (-> obj root trans)) + (let ((s1-0 (-> this root trans)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> obj gspot-normal quad)) + (set! (-> s5-0 quad) (-> this gspot-normal quad)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj gspot-normal quad)) + (set! (-> s4-0 quad) (-> this gspot-normal quad)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> obj gspot-normal quad)) + (set! (-> s3-0 quad) (-> this gspot-normal quad)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> obj gspot-normal quad)) + (set! (-> s2-0 quad) (-> this gspot-normal quad)) (let ((s0-0 (lambda ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1)) (s4-1 (vector-! (new 'stack-no-clear 'vector) arg3 arg1)) @@ -875,17 +875,17 @@ ) ) ) - (if (and (logtest? (-> obj foot-flags) 1) (logtest? (-> obj foot-flags) 2)) - (s0-0 s5-0 s1-0 (the-as vector (-> obj foot-pos)) (-> obj foot-pos 1)) + (if (and (logtest? (-> this foot-flags) 1) (logtest? (-> this foot-flags) 2)) + (s0-0 s5-0 s1-0 (the-as vector (-> this foot-pos)) (-> this foot-pos 1)) ) - (if (and (logtest? (-> obj foot-flags) 2) (logtest? (-> obj foot-flags) 4)) - (s0-0 s4-0 s1-0 (-> obj foot-pos 1) (-> obj foot-pos 2)) + (if (and (logtest? (-> this foot-flags) 2) (logtest? (-> this foot-flags) 4)) + (s0-0 s4-0 s1-0 (-> this foot-pos 1) (-> this foot-pos 2)) ) - (if (and (logtest? (-> obj foot-flags) 4) (logtest? (-> obj foot-flags) 8)) - (s0-0 s4-0 s1-0 (-> obj foot-pos 2) (-> obj foot-pos 3)) + (if (and (logtest? (-> this foot-flags) 4) (logtest? (-> this foot-flags) 8)) + (s0-0 s4-0 s1-0 (-> this foot-pos 2) (-> this foot-pos 3)) ) - (if (and (logtest? (-> obj foot-flags) 8) (logtest? (-> obj foot-flags) 1)) - (s0-0 s4-0 s1-0 (-> obj foot-pos 3) (the-as vector (-> obj foot-pos))) + (if (and (logtest? (-> this foot-flags) 8) (logtest? (-> this foot-flags) 1)) + (s0-0 s4-0 s1-0 (-> this foot-pos 3) (the-as vector (-> this foot-pos))) ) ) (vector+! s5-0 s5-0 s4-0) @@ -896,13 +896,13 @@ ) (vector-normalize! s5-0 1.0) (let ((s4-1 (new 'stack-no-clear 'quaternion))) - (let ((s0-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s0-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (set! (-> s0-1 y) 0.0) (vector-xz-normalize! s0-1 1.0) (vector-rotate-y! s5-0 s5-0 (- (vector-y-angle s0-1))) ) (quaternion-from-two-vectors-max-angle! s4-1 *up-vector* s5-0 4551.1113) - (quaternion-slerp! (-> obj tilt-quat) (-> obj tilt-quat) s4-1 (* 0.5 (seconds-per-frame))) + (quaternion-slerp! (-> this tilt-quat) (-> this tilt-quat) s4-1 (* 0.5 (seconds-per-frame))) ) ) ) @@ -1215,7 +1215,7 @@ ) ) -(defmethod mammoth-method-184 mammoth ((obj mammoth)) +(defmethod mammoth-method-184 mammoth ((this mammoth)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1225,8 +1225,8 @@ ) (init-vf0-vector) (dotimes (s5-0 4) - (-> obj joint-ik s5-0 shoulder-matrix-no-ik) - (let ((a0-1 (-> obj joint-ik s5-0 elbow-matrix-no-ik)) + (-> this joint-ik s5-0 shoulder-matrix-no-ik) + (let ((a0-1 (-> this joint-ik s5-0 elbow-matrix-no-ik)) (s3-0 (-> *mammoth-ik-setup* s5-0)) (v1-8 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) @@ -1251,7 +1251,7 @@ ) (set! (-> s4-0 quad) (-> v1-8 quad)) (let ((s2-0 (new 'stack-no-clear 'collide-query)) - (f30-0 (- (- (-> s4-0 y) (-> s3-0 ground-dist)) (-> obj root trans y))) + (f30-0 (- (- (-> s4-0 y) (-> s3-0 ground-dist)) (-> this root trans y))) ) (when #t (let ((a1-5 (-> s2-0 bbox)) @@ -1319,15 +1319,15 @@ (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-26 quad) vf6) - (seek! (-> obj ik-handle-y s5-0) (-> v1-26 y) (* 16384.0 (seconds-per-frame))) + (seek! (-> this ik-handle-y s5-0) (-> v1-26 y) (* 16384.0 (seconds-per-frame))) ) ) ) - (set! (-> s4-0 y) (+ (-> obj ik-handle-y s5-0) f30-0)) + (set! (-> s4-0 y) (+ (-> this ik-handle-y s5-0) f30-0)) ) - (set! (-> obj heel-lerp s5-0) (lerp-scale 0.0 1.0 f30-0 0.0 3072.0)) + (set! (-> this heel-lerp s5-0) (lerp-scale 0.0 1.0 f30-0 0.0 3072.0)) ) - (handle-copy! (-> obj joint-ik s5-0) s4-0) + (handle-copy! (-> this joint-ik s5-0) s4-0) ) ) ) @@ -1336,65 +1336,65 @@ ) ) -(defmethod track-target! mammoth ((obj mammoth)) +(defmethod track-target! mammoth ((this mammoth)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (local-vars (sv-752 lightning-spec) (sv-768 int) (sv-784 symbol) (sv-800 mammoth)) (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) (mammoth-update-ik) (dotimes (s5-0 4) - (enable-set! (-> obj joint-ik s5-0) (zero? (-> obj draw cur-lod))) + (enable-set! (-> this joint-ik s5-0) (zero? (-> this draw cur-lod))) ) - (when (!= (-> obj old-foot-flags) (-> obj foot-flags)) + (when (!= (-> this old-foot-flags) (-> this foot-flags)) (let ((s5-1 (new 'static 'array uint32 4 #xa #xd #x1c #x19))) (dotimes (s4-0 4) (let ((s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) - (-> obj node-list data (-> (the-as (pointer int32) (&+ s5-1 (* s4-0 4))))) + (-> this node-list data (-> (the-as (pointer int32) (&+ s5-1 (* s4-0 4))))) ) ) (s2-0 (new 'stack-no-clear 'collide-query)) ) - (when (logtest? (ash 1 s4-0) (-> obj foot-flags)) - (when (not (logtest? (ash 1 s4-0) (-> obj old-foot-flags))) + (when (logtest? (ash 1 s4-0) (-> this foot-flags)) + (when (not (logtest? (ash 1 s4-0) (-> this old-foot-flags))) (set! (-> s2-0 start-pos quad) (-> s3-0 quad)) (vector-reset! (-> s2-0 move-dist)) (+! (-> s2-0 start-pos y) 8192.0) (set! (-> s2-0 move-dist y) -40960.0) (let ((v1-27 s2-0)) (set! (-> v1-27 radius) 2048.0) - (set! (-> v1-27 collide-with) (-> obj enemy-info gnd-collide-with)) - (set! (-> v1-27 ignore-process0) obj) + (set! (-> v1-27 collide-with) (-> this enemy-info gnd-collide-with)) + (set! (-> v1-27 ignore-process0) this) (set! (-> v1-27 ignore-process1) #f) - (set! (-> v1-27 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-27 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-27 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) (set! (-> s3-0 y) (-> s2-0 best-other-tri intersect y)) ) - (set! (-> obj foot-pos s4-0 quad) (-> s3-0 quad)) + (set! (-> this foot-pos s4-0 quad) (-> s3-0 quad)) ) ) ) ) ) - (set! (-> obj old-foot-flags) (-> obj foot-flags)) + (set! (-> this old-foot-flags) (-> this foot-flags)) ) (dotimes (v1-37 4) - (when (logtest? (ash 1 v1-37) (-> obj foot-flags)) + (when (logtest? (ash 1 v1-37) (-> this foot-flags)) ) ) - (when (and (< (- (current-time) (-> obj lightning-timer)) (seconds 3)) - (< (-> obj lightning-attack-timer) (current-time)) + (when (and (not (time-elapsed? (-> this lightning-timer) (seconds 3))) + (< (-> this lightning-attack-timer) (current-time)) ) (let ((s5-2 *target*)) (when s5-2 (let* ((v1-47 (get-trans s5-2 0)) - (s0-1 (vector-! (new 'stack-no-clear 'vector) v1-47 (-> obj root trans))) + (s0-1 (vector-! (new 'stack-no-clear 'vector) v1-47 (-> this root trans))) ) (when (< (vector-length s0-1) 57344.0) (send-event @@ -1403,7 +1403,7 @@ #f (static-attack-info ((id (new-attack-id)) - (vector (vector-normalize! (vector-! (new 'stack-no-clear 'vector) v1-47 (-> obj root trans)) 1.0)) + (vector (vector-normalize! (vector-! (new 'stack-no-clear 'vector) v1-47 (-> this root trans)) 1.0)) (shove-back (meters 6)) (shove-up (meters 3)) (control (if (focus-test? s5-2 board) @@ -1414,15 +1414,15 @@ ) ) ) - (let ((s2-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s2-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s1-0 *mammoth-lightning-joint-tbl*) (s4-2 (new 'stack-no-clear 'array 'uint32 4)) (s3-2 0) ) (let ((f30-0 (vector-dot s0-1 s2-1))) (dotimes (s0-2 (-> s1-0 length)) - (let* ((v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> s1-0 s0-2)))) - (f0-12 (vector-dot (vector-! (new 'stack-no-clear 'vector) v0-9 (-> obj root trans)) s2-1)) + (let* ((v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> s1-0 s0-2)))) + (f0-12 (vector-dot (vector-! (new 'stack-no-clear 'vector) v0-9 (-> this root trans)) s2-1)) ) (when (or (and (< 0.0 f0-12) (< 0.0 f30-0)) (and (< f0-12 0.0) (< f30-0 0.0))) (set! (-> s4-2 s3-2) (the-as uint (-> s1-0 s0-2))) @@ -1452,8 +1452,8 @@ (set! sv-752 (-> *lightning-spec-id-table* 1)) (set! sv-768 600) (set! sv-784 (the-as symbol #f)) - (set! sv-800 obj) - (let ((t2-0 (-> (the-as (pointer int32) (&+ s4-2 (* (get-rand-int obj s3-2) 4))))) + (set! sv-800 this) + (let ((t2-0 (-> (the-as (pointer int32) (&+ s4-2 (* (get-rand-int this s3-2) 4))))) (t3-0 6) ) ((the-as (function object object object object object object object object none) s5-3) @@ -1472,40 +1472,40 @@ ) ) ) - (set! (-> obj lightning-attack-timer) - (+ (current-time) (the int (* 300.0 (get-rand-float-range obj 0.067 0.1)))) + (set! (-> this lightning-attack-timer) + (+ (current-time) (the int (* 300.0 (get-rand-float-range this 0.067 0.1)))) ) ) ) ) ) ) - (mammoth-method-183 obj) + (mammoth-method-183 this) 0 (none) ) -(defmethod coin-flip? mammoth ((obj mammoth)) +(defmethod coin-flip? mammoth ((this mammoth)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch process-focusable vs mammoth. -(defmethod relocate mammoth ((obj mammoth) (arg0 int)) +(defmethod relocate mammoth ((this mammoth) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj joint-ik v1-0)) - (&+! (-> obj joint-ik v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method mammoth 7)) this arg0) ) ) -(defmethod init-enemy-collision! mammoth ((obj mammoth)) +(defmethod init-enemy-collision! mammoth ((this mammoth)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1592,98 +1592,103 @@ (set! (-> s5-0 backup-collide-as) (-> v1-36 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-36 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! mammoth ((obj mammoth)) +(defmethod init-enemy! mammoth ((this mammoth)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mammoth" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *mammoth-nav-enemy-info*) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) - (set! (-> obj y-level) -40959590.0) - (set! (-> obj foot-flags) (the-as uint 0)) - (set! (-> obj old-foot-flags) (the-as uint 0)) - (set! (-> obj attack-timer) (current-time)) - (set! (-> obj spawn-timer) 0) - (set! (-> obj my-up-vector quad) (-> *y-vector* quad)) - (quaternion-copy! (-> obj my-up-quat) *unity-quaternion*) - (set! (-> obj gspot-timer) 0) - (set! (-> obj gspot-normal quad) (-> *y-vector* quad)) - (set! (-> obj align) (new 'process 'align-control obj)) + (init-enemy-behaviour-and-stats! this *mammoth-nav-enemy-info*) + (logclear! (-> this mask) (process-mask actor-pause)) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (set! (-> this y-level) -40959590.0) + (set! (-> this foot-flags) (the-as uint 0)) + (set! (-> this old-foot-flags) (the-as uint 0)) + (set-time! (-> this attack-timer)) + (set! (-> this spawn-timer) 0) + (set! (-> this my-up-vector quad) (-> *y-vector* quad)) + (quaternion-copy! (-> this my-up-quat) *unity-quaternion*) + (set! (-> this gspot-timer) 0) + (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + (set! (-> this align) (new 'process 'align-control this)) (dotimes (s5-1 4) - (set! (-> obj joint-ik s5-1) (new - 'process - 'joint-mod-ik - obj - (-> *mammoth-ik-setup* s5-1 elbow-index) - (-> *mammoth-ik-setup* s5-1 hand-dist) - ) + (set! (-> this joint-ik s5-1) (new + 'process + 'joint-mod-ik + this + (-> *mammoth-ik-setup* s5-1 elbow-index) + (-> *mammoth-ik-setup* s5-1 hand-dist) + ) ) - (set! (-> obj joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) - (set! (-> obj joint-ik 0 callback) mammoth-leg-ik-callback) + (set! (-> this joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this joint-ik 0 callback) mammoth-leg-ik-callback) ) - (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) - (logior! (-> obj joint-ik 2 flags) (joint-mod-ik-flags elbow-trans-neg)) - (logior! (-> obj joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) - (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (-> obj entity) #f)) - (set! (-> obj path-pos) 0.0) - (set! (-> obj path-index) 0) - (set! (-> obj path-index-dir) 1) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (get-point-in-path! (-> obj path) (-> obj root trans) 0.0 'interp) - (set! (-> obj move-pos 0 quad) (-> obj root trans quad)) - (set! (-> obj move-pos 1 quad) (-> obj root trans quad)) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 2 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) + (set! (-> this path-pos) 0.0) + (set! (-> this path-index) 0) + (set! (-> this path-index-dir) 1) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (get-point-in-path! (-> this path) (-> this root trans) 0.0 'interp) + (set! (-> this move-pos 0 quad) (-> this root trans quad)) + (set! (-> this move-pos 1 quad) (-> this root trans quad)) (forward-up-nopitch->quaternion - (-> obj root quat) + (-> this root quat) (vector-! (new 'stack-no-clear 'vector) - (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float (+ (-> obj path-index) 1)) 'interp) - (-> obj root trans) + (get-point-in-path! + (-> this path) + (new 'stack-no-clear 'vector) + (the float (+ (-> this path-index) 1)) + 'interp + ) + (-> this root trans) ) *up-vector* ) - (quaternion-copy! (-> obj tilt-quat) *unity-quaternion*) - (let ((a0-38 (-> obj node-list data 4))) + (quaternion-copy! (-> this tilt-quat) *unity-quaternion*) + (let ((a0-38 (-> this node-list data 4))) (set! (-> a0-38 param0) mammoth-joint-mod-tilt) - (set! (-> a0-38 param1) obj) + (set! (-> a0-38 param1) this) ) - (let ((a0-39 (-> obj node-list data 10))) + (let ((a0-39 (-> this node-list data 10))) (set! (-> a0-39 param0) mammoth-joint-mod-heel) - (set! (-> a0-39 param1) obj) + (set! (-> a0-39 param1) this) (set! (-> a0-39 param2) (the-as basic 0)) ) - (let ((v1-61 (-> obj node-list data 13))) + (let ((v1-61 (-> this node-list data 13))) (set! (-> v1-61 param0) mammoth-joint-mod-heel) - (set! (-> v1-61 param1) obj) + (set! (-> v1-61 param1) this) (set! (-> v1-61 param2) (the-as basic 1)) ) - (let ((v1-63 (-> obj node-list data 25))) + (let ((v1-63 (-> this node-list data 25))) (set! (-> v1-63 param0) mammoth-joint-mod-heel) - (set! (-> v1-63 param1) obj) + (set! (-> v1-63 param1) this) (set! (-> v1-63 param2) (the-as basic 2)) ) - (let ((v1-65 (-> obj node-list data 28))) + (let ((v1-65 (-> this node-list data 28))) (set! (-> v1-65 param0) mammoth-joint-mod-heel) - (set! (-> v1-65 param1) obj) + (set! (-> v1-65 param1) this) (set! (-> v1-65 param2) (the-as basic 3)) ) (dotimes (v1-66 4) - (set! (-> obj heel-lerp v1-66) 0.0) + (set! (-> this heel-lerp v1-66) 0.0) ) - (set! (-> obj lightning-timer) 0) - (set! (-> obj lightning-attack-timer) 0) - (set! (-> obj feet-ik-init-timer) (current-time)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water-backup)) + (set! (-> this lightning-timer) 0) + (set! (-> this lightning-attack-timer) 0) + (set-time! (-> this feet-ik-init-timer)) + (logclear! (-> this enemy-flags) (enemy-flag check-water-backup)) 0 (none) ) diff --git a/goal_src/jak2/levels/nest/mantis.gc b/goal_src/jak2/levels/nest/mantis.gc index 57c34f62b0..82c68ad4bd 100644 --- a/goal_src/jak2/levels/nest/mantis.gc +++ b/goal_src/jak2/levels/nest/mantis.gc @@ -529,13 +529,13 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.6)) + (until (time-elapsed? gp-1 (seconds 0.6)) (suspend) ) ) (logior! (-> self draw status) (draw-control-status no-draw)) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) + (until (time-elapsed? gp-2 (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) (suspend) ) ) @@ -585,7 +585,7 @@ ) 0 (look-at-target! self (enemy-flag lock-focus)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root trans y) (+ -18841.6 (-> self base-height))) (let ((gp-0 (-> self root))) (let ((v1-11 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 quat)))) @@ -643,7 +643,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (if (logtest? (-> self root status) (collide-status on-ground)) (goto cfg-32) ) @@ -698,7 +698,7 @@ (let ((f30-1 (vector-length s5-1))) (when (not (logtest? (-> self flags) (mantis-flag tracked))) (cond - ((< (- (current-time) (-> self attack-timer)) (seconds 5)) + ((not (time-elapsed? (-> self attack-timer) (seconds 5))) (if (and (< 73728.0 f30-1) (mantis-method-194 self)) (go-virtual crawl) ) @@ -711,10 +711,7 @@ (when (and (and gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) - (and (>= (- (current-time) (-> self attack-timer)) (seconds 5)) - (enemy-method-95 self s4-0 8192.0) - (< f30-1 32768.0) - ) + (and (time-elapsed? (-> self attack-timer) (seconds 5)) (enemy-method-95 self s4-0 8192.0) (< f30-1 32768.0)) ) (cond ((< 24576.0 f30-1) @@ -746,7 +743,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 1) self) (nav-enemy-method-166 self) (let ((v1-6 (-> self nav))) @@ -857,7 +854,7 @@ (suspend) (ja :num! (seek!)) ) - (if (and (>= (- (current-time) (-> self attack-timer)) (seconds 5)) (< 1 (the-as int (-> self focus aware)))) + (if (and (time-elapsed? (-> self attack-timer) (seconds 5)) (< 1 (the-as int (-> self focus aware)))) (go-virtual hostile) ) (if (< (vector-vector-xz-distance (-> self root trans) (-> self move-dest)) 13107.2) @@ -875,7 +872,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -884,7 +881,7 @@ (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) ) 0 - (set! (-> self attack-timer) (current-time)) + (set-time! (-> self attack-timer)) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) @@ -935,8 +932,8 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) - (set! (-> self attack-timer) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self attack-timer)) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) @@ -1110,7 +1107,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (look-at-target! self (enemy-flag lock-focus)) (logior! (-> self enemy-flags) (enemy-flag use-notice-distance)) (let ((v1-6 self)) @@ -1127,7 +1124,7 @@ ) 0 (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) :trans (behavior () '() @@ -1170,7 +1167,7 @@ (go-virtual crawl) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (>= (the-as int (-> self focus aware)) 3) (get-enemy-target self) ) @@ -1192,148 +1189,148 @@ :post nav-enemy-face-focus-post ) -(defmethod general-event-handler mantis ((obj mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler mantis ((this mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('track) - (if (and (-> arg3 param 0) (>= (- (current-time) (-> obj track-timer)) (seconds 0.5))) + (if (and (-> arg3 param 0) (time-elapsed? (-> this track-timer) (seconds 0.5))) 'abort #t ) ) (('tracked) - (logior! (-> obj flags) (mantis-flag tracked)) + (logior! (-> this flags) (mantis-flag tracked)) (let ((v0-0 (the-as object (current-time)))) - (set! (-> obj track-timer) (the-as time-frame v0-0)) + (set! (-> this track-timer) (the-as time-frame v0-0)) v0-0 ) ) (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (let ((s5-1 (-> obj incoming knocked-type))) + ((zero? (-> this hit-points)) + (let ((s5-1 (-> this incoming knocked-type))) (cond ((and (= s5-1 (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-41 (-> obj next-state name))) - (or (= v1-41 'knocked) (= v1-41 'jump) (= v1-41 'jump-land)) - ) + (not (and (-> this next-state) (let ((v1-41 (-> this next-state name))) + (or (= v1-41 'knocked) (= v1-41 'jump) (= v1-41 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ((or (= s5-1 (knocked-type knocked-type-4)) (= s5-1 (knocked-type knocked-type-6))) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - (go (method-of-object obj knocked)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) + (go (method-of-object this knocked)) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod enemy-method-77 mantis ((obj mantis) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 mantis ((this mantis) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.02)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 27))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 27))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 27)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 27)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!) ) #t ) (else (ja-channel-push! 1 (seconds 0.2)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 10))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 10))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 10)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 10)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!) ) #t ) ) ) -(defmethod enemy-method-78 mantis ((obj mantis) (arg0 (pointer float))) +(defmethod enemy-method-78 mantis ((this mantis) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 26))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 26))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 26)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 26)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 26)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 26)) num-func-seek!) ) #t ) - ((let ((v1-15 (-> obj incoming knocked-type))) + ((let ((v1-15 (-> this incoming knocked-type))) (= v1-15 (knocked-type knocked-type-6)) ) - (let ((a0-4 (-> obj skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 28))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 28))) (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 28)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 28)) frames num-frames) -1)) ) (set! (-> a0-4 param 1) (-> arg0 0)) (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> obj draw art-group data 28)) num-func-seek!) + (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> this draw art-group data 28)) num-func-seek!) ) #t ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 11))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 11)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) (-> arg0 0)) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 11)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) ) #t ) @@ -1341,22 +1338,22 @@ ) ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 mantis ((obj mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 mantis ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface - (when (find-ground (-> obj root) arg0 arg1 arg2 arg3 arg4) - (set! (-> obj root ground-pat) (-> arg0 best-other-tri pat)) - (when (>= (- (current-time) (-> obj gspot-timer)) (seconds 0.2)) + (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) + (set! (-> this root ground-pat) (-> arg0 best-other-tri pat)) + (when (time-elapsed? (-> this gspot-timer) (seconds 0.2)) (let ((a1-2 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-2 start-pos quad) (-> obj root gspot-pos quad)) + (set! (-> a1-2 start-pos quad) (-> this root gspot-pos quad)) (+! (-> a1-2 start-pos y) 2048.0) (set-vector! (-> a1-2 move-dist) 0.0 -6144.0 0.0 0.0) (let ((v1-10 a1-2)) (set! (-> v1-10 radius) 4915.2) (set! (-> v1-10 collide-with) arg1) - (set! (-> v1-10 ignore-process0) obj) + (set! (-> v1-10 ignore-process0) this) (set! (-> v1-10 ignore-process1) #f) - (set! (-> v1-10 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-10 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-10 action-mask) (collide-action solid)) ) (fill-using-line-sphere *collide-cache* a1-2) @@ -1377,9 +1374,9 @@ ) ) ) - (vector-normalize-copy! (-> obj gspot-normal) s5-1 1.0) + (vector-normalize-copy! (-> this gspot-normal) s5-1 1.0) ) - (set! (-> obj gspot-timer) (current-time)) + (set-time! (-> this gspot-timer)) ) #t ) @@ -1387,39 +1384,39 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod mantis-method-194 mantis ((obj mantis)) - (let ((a0-2 (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 1)) +(defmethod mantis-method-194 mantis ((this mantis)) + (let ((a0-2 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 1)) (gp-0 (new 'stack-no-clear 'vector)) ) (the-as symbol (and a0-2 - (nav-mesh-method-10 a0-2 gp-0 (-> obj root trans) (the-as nav-poly #f)) - (< (vector-vector-xz-distance gp-0 (-> obj root trans)) 2048.0) + (nav-mesh-method-10 a0-2 gp-0 (-> this root trans) (the-as nav-poly #f)) + (< (vector-vector-xz-distance gp-0 (-> this root trans)) 2048.0) ) ) ) ) -(defmethod mantis-method-193 mantis ((obj mantis) (arg0 vector)) +(defmethod mantis-method-193 mantis ((this mantis) (arg0 vector)) (cond - ((= (-> obj root gspot-pos y) -40959590.0) + ((= (-> this root gspot-pos y) -40959590.0) (set! (-> arg0 y) 0.0) (vector-normalize! arg0 1.0) - (quaternion-set! (-> obj root quat) 0.0 (-> arg0 x) 0.0 (+ 1.0 (-> arg0 z))) - (quaternion-normalize! (-> obj root quat)) + (quaternion-set! (-> this root quat) 0.0 (-> arg0 x) 0.0 (+ 1.0 (-> arg0 z))) + (quaternion-normalize! (-> this root quat)) ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> *up-vector* quad)) (let ((s3-0 (new 'stack-no-clear 'quaternion))) - (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> obj gspot-normal) 10922.667) + (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this gspot-normal) 10922.667) (vector-orient-by-quat! s4-0 s4-0 s3-0) ) - (let ((s3-1 (-> obj my-up-vector))) + (let ((s3-1 (-> this my-up-vector))) (vector-deg-seek s3-1 s3-1 s4-0 (* 8192.0 (seconds-per-frame))) (vector-normalize! s3-1 1.0) (set! (-> arg0 y) 0.0) (vector-normalize! arg0 1.0) - (forward-up-nopitch->quaternion (-> obj root quat) arg0 s3-1) + (forward-up-nopitch->quaternion (-> this root quat) arg0 s3-1) ) ) ) @@ -1428,32 +1425,32 @@ (none) ) -(defmethod nav-enemy-method-142 mantis ((obj mantis) (arg0 nav-control)) - (let ((t9-0 (method-of-object obj mantis-method-193)) +(defmethod nav-enemy-method-142 mantis ((this mantis) (arg0 nav-control)) + (let ((t9-0 (method-of-object this mantis-method-193)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 quad) (-> a2-0 heading quad)) - (t9-0 obj a1-1) + (t9-0 this a1-1) ) 0 (none) ) ;; WARN: Return type mismatch vector vs none. -(defmethod track-target! mantis ((obj mantis)) +(defmethod track-target! mantis ((this mantis)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (local-vars (s5-0 vector)) (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (logclear! (-> obj flags) (mantis-flag tracked)) - (let ((a0-4 (handle->process (-> obj focus handle)))) + (logclear! (-> this flags) (mantis-flag tracked)) + (let ((a0-4 (handle->process (-> this focus handle)))) (set! s5-0 (when a0-4 - (set! s5-0 (-> obj focus-pos)) + (set! s5-0 (-> this focus-pos)) (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-4) 0) quad)) s5-0 ) @@ -1463,9 +1460,9 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod mantis-method-187 mantis ((obj mantis)) - (let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s4-0 (-> obj root)) +(defmethod mantis-method-187 mantis ((this mantis)) + (let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s4-0 (-> this root)) (s5-0 (lambda ((arg0 mantis) (arg1 collide-shape-moving) (arg2 vector)) (let ((s3-0 (new 'stack-no-clear 'vector)) (f30-0 (vector-length arg2)) @@ -1515,18 +1512,18 @@ ) ) (cond - ((s5-0 obj s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 -40960.0)) - (go (method-of-object obj roll-right)) + ((s5-0 this s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 -40960.0)) + (go (method-of-object this roll-right)) ) - ((s5-0 obj s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 34160.64)) - (go (method-of-object obj roll-left)) + ((s5-0 this s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 34160.64)) + (go (method-of-object this roll-left)) ) ) ) (none) ) -(defmethod mantis-method-188 mantis ((obj mantis)) +(defmethod mantis-method-188 mantis ((this mantis)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1535,10 +1532,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (handle->process (-> obj focus handle)))) + (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 - (let* ((v1-4 (-> obj focus-pos)) - (s4-1 (vector-! (new 'stack-no-clear 'vector) v1-4 (-> obj root trans))) + (let* ((v1-4 (-> this focus-pos)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) v1-4 (-> this root trans))) ) (let ((s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s5-0) 0))) (s1-0 s4-1) @@ -1555,7 +1552,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s1-0 quad) vf6) ) - (mantis-method-191 obj (the-as vector s5-0) s4-1) + (mantis-method-191 this (the-as vector s5-0) s4-1) ) ) ) @@ -1563,21 +1560,21 @@ ) ) -(defmethod go-stare mantis ((obj mantis)) - (let ((a0-2 (handle->process (-> obj focus handle)))) +(defmethod go-stare mantis ((this mantis)) + (let ((a0-2 (handle->process (-> this focus handle)))) (if (and a0-2 - (and (< 81920.0 (vector-vector-xz-distance (-> obj root trans) (get-trans (the-as process-focusable a0-2) 0))) - (mantis-method-194 obj) + (and (< 81920.0 (vector-vector-xz-distance (-> this root trans) (get-trans (the-as process-focusable a0-2) 0))) + (mantis-method-194 this) ) ) - (go (method-of-object obj crawl)) + (go (method-of-object this crawl)) ) ) - (go (method-of-object obj hop-away)) + (go (method-of-object this hop-away)) ) -(defmethod mantis-method-190 mantis ((obj mantis) (arg0 vector) (arg1 vector)) - (let ((s5-0 (-> obj jump))) +(defmethod mantis-method-190 mantis ((this mantis) (arg0 vector) (arg1 vector)) + (let ((s5-0 (-> this jump))) (let* ((f0-0 (vector-length arg1)) (f0-1 (if (< 102400.0 f0-0) 81920.0 @@ -1587,57 +1584,57 @@ ) (vector-normalize! arg1 f0-1) ) - (when (mantis-method-189 obj (-> s5-0 destination) arg1) + (when (mantis-method-189 this (-> s5-0 destination) arg1) (set! (-> s5-0 direction) (the-as uint 0)) (set! (-> s5-0 start-anim) (the-as uint 12)) (set! (-> s5-0 air-anim) (the-as uint 13)) (set! (-> s5-0 land-anim) (the-as uint 0)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag vulnerable)))) - (send-event obj 'jump 0 (-> s5-0 destination)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag vulnerable)))) + (send-event this 'jump 0 (-> s5-0 destination)) ) ) 0 (none) ) -(defmethod mantis-method-191 mantis ((obj mantis) (arg0 vector) (arg1 vector)) - (let ((s5-0 (-> obj jump))) +(defmethod mantis-method-191 mantis ((this mantis) (arg0 vector) (arg1 vector)) + (let ((s5-0 (-> this jump))) (vector-length arg1) (vector-normalize! arg1 1.0) - (vector-rotate-y! arg1 arg1 (* 182.04445 (get-rand-float-range obj -45.0 45.0))) + (vector-rotate-y! arg1 arg1 (* 182.04445 (get-rand-float-range this -45.0 45.0))) (let ((a2-5 - (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 (* 4096.0 (get-rand-float-range obj -4.0 -6.0))) + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 (* 4096.0 (get-rand-float-range this -4.0 -6.0))) ) ) - (when (mantis-method-189 obj (-> s5-0 destination) a2-5) + (when (mantis-method-189 this (-> s5-0 destination) a2-5) (set! (-> s5-0 direction) (the-as uint 1)) (set! (-> s5-0 start-anim) (the-as uint 14)) (set! (-> s5-0 air-anim) (the-as uint 15)) (set! (-> s5-0 land-anim) (the-as uint 16)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag vulnerable)))) - (send-event obj 'jump 0 (-> s5-0 destination)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag vulnerable)))) + (send-event this 'jump 0 (-> s5-0 destination)) ) ) ) 0 ) -(defmethod mantis-method-192 mantis ((obj mantis) (arg0 vector) (arg1 vector)) - (let ((s5-0 (-> obj jump))) +(defmethod mantis-method-192 mantis ((this mantis) (arg0 vector) (arg1 vector)) + (let ((s5-0 (-> this jump))) (vector-length arg1) (vector-normalize! arg1 1.0) - (vector-rotate-y! arg1 arg1 (* 182.04445 (get-rand-float-range obj -45.0 45.0))) + (vector-rotate-y! arg1 arg1 (* 182.04445 (get-rand-float-range this -45.0 45.0))) (let ((a2-5 - (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 (* 4096.0 (get-rand-float-range obj -15.0 -22.0))) + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 (* 4096.0 (get-rand-float-range this -15.0 -22.0))) ) ) - (when (mantis-method-189 obj (-> s5-0 destination) a2-5) + (when (mantis-method-189 this (-> s5-0 destination) a2-5) (set! (-> s5-0 direction) (the-as uint 1)) (set! (-> s5-0 start-anim) (the-as uint 20)) (set! (-> s5-0 air-anim) (the-as uint 21)) (set! (-> s5-0 land-anim) (the-as uint 22)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag vulnerable)))) - (send-event obj 'jump 0 (-> s5-0 destination)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag vulnerable)))) + (send-event this 'jump 0 (-> s5-0 destination)) ) ) ) @@ -1645,7 +1642,7 @@ (none) ) -(defmethod mantis-method-189 mantis ((obj mantis) (arg0 vector) (arg1 vector)) +(defmethod mantis-method-189 mantis ((this mantis) (arg0 vector) (arg1 vector)) (let* ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) (f30-0 (vector-length arg1)) (f28-0 3640.889) @@ -1698,12 +1695,12 @@ ) ) (cond - ((s3-1 obj s4-0 f30-0 0.0 arg0) + ((s3-1 this s4-0 f30-0 0.0 arg0) #t ) (else (dotimes (s2-0 2) - (if (or (s3-1 obj s4-0 f30-0 f26-0 arg0) (s3-1 obj s4-0 f30-0 (- f26-0) arg0)) + (if (or (s3-1 this s4-0 f30-0 f26-0 arg0) (s3-1 this s4-0 f30-0 (- f26-0) arg0)) (return #t) ) (+! f26-0 f28-0) @@ -1714,10 +1711,10 @@ ) ) -(defmethod enemy-method-89 mantis ((obj mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 mantis ((this mantis) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump start-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump start-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -1728,10 +1725,10 @@ #t ) -(defmethod enemy-method-87 mantis ((obj mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 mantis ((this mantis) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump air-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump air-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -1743,16 +1740,16 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-92 mantis ((obj mantis) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 mantis ((this mantis) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" (let ((v1-0 arg0)) (when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3)) - (let ((a0-4 obj)) + (let ((a0-4 this)) (when (logtest? (enemy-flag enemy-flag37) (-> a0-4 enemy-flags)) - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg1 vertex2) (-> obj root trans)))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg1 vertex2) (-> this root trans)))) (vector-normalize! s5-1 1.0) - (let ((v1-5 (-> obj jump direction))) + (let ((v1-5 (-> this jump direction))) (cond ((zero? v1-5) ) @@ -1767,7 +1764,7 @@ ) ) ) - (seek-toward-heading-vec! (-> obj root) s5-1 (-> obj nav max-rotation-rate) (seconds 0.02)) + (seek-toward-heading-vec! (-> this root) s5-1 (-> this nav max-rotation-rate) (seconds 0.02)) ) ) ) @@ -1776,15 +1773,15 @@ (none) ) -(defmethod enemy-method-88 mantis ((obj mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 mantis ((this mantis) (arg0 enemy-jump-info)) (cond - ((zero? (-> obj jump land-anim)) + ((zero? (-> this jump land-anim)) #f ) (else (ja-channel-push! 1 (seconds 0.075)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -1797,15 +1794,15 @@ ) ) -(defmethod coin-flip? mantis ((obj mantis)) +(defmethod coin-flip? mantis ((this mantis)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! mantis ((obj mantis)) +(defmethod init-enemy-collision! mantis ((this mantis)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1901,25 +1898,25 @@ (set! (-> s5-0 backup-collide-as) (-> v1-29 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-29 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) -(defmethod init-enemy! mantis ((obj mantis)) +(defmethod init-enemy! mantis ((this mantis)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mantis" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *mantis-nav-enemy-info*) - (set! (-> obj flags) (mantis-flag)) - (set! (-> obj my-up-vector quad) (-> *y-vector* quad)) - (set! (-> obj gspot-normal quad) (-> *y-vector* quad)) - (set! (-> obj gspot-timer) 0) - (set! (-> obj attack-timer) (+ (current-time) (seconds -5))) - (set! (-> obj track-timer) 0) - (set! (-> obj draw light-index) (the-as uint 30)) + (init-enemy-behaviour-and-stats! this *mantis-nav-enemy-info*) + (set! (-> this flags) (mantis-flag)) + (set! (-> this my-up-vector quad) (-> *y-vector* quad)) + (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + (set! (-> this gspot-timer) 0) + (set! (-> this attack-timer) (+ (current-time) (seconds -5))) + (set! (-> this track-timer) 0) + (set! (-> this draw light-index) (the-as uint 30)) (none) ) diff --git a/goal_src/jak2/levels/nest/nest-obs.gc b/goal_src/jak2/levels/nest/nest-obs.gc index 975da8a5ba..87cef9c0d5 100644 --- a/goal_src/jak2/levels/nest/nest-obs.gc +++ b/goal_src/jak2/levels/nest/nest-obs.gc @@ -67,11 +67,11 @@ (defstate down (nest-switch) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self set-camera) #f) ) :trans (behavior () - (when (and (not (-> self set-camera)) (>= (- (current-time) (-> self state-time)) (seconds 0.6))) + (when (and (not (-> self set-camera)) (time-elapsed? (-> self state-time) (seconds 0.6))) (process-grab? *target* #f) (hide-hud-quick #f) (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) @@ -95,7 +95,7 @@ (suspend) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (seek! (-> self y-rot-rate) 0.0 (* 4000.0 (seconds-per-frame))) (quaternion-rotate-y! (-> self root quat) @@ -106,7 +106,7 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -120,14 +120,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-switch ((obj nest-switch) (arg0 entity-actor)) +(defmethod init-from-entity! nest-switch ((this nest-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -161,18 +161,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-switch" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj y-start) (+ -12288.0 (-> obj root trans y))) - (set! (-> obj y-delta) 12288.0) - (go (method-of-object obj up)) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this y-start) (+ -12288.0 (-> this root trans y))) + (set! (-> this y-delta) 12288.0) + (go (method-of-object this up)) (none) ) @@ -213,7 +213,7 @@ This commonly includes things such as: :trans rider-trans :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -229,14 +229,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-piston ((obj nest-piston) (arg0 entity-actor)) +(defmethod init-from-entity! nest-piston ((this nest-piston) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -252,19 +252,19 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-piston" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (+! (-> obj root trans y) 8192.0) - (set! (-> obj y-level) (-> obj root trans y)) - (set! (-> obj y-offset) 0.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (+! (-> this root trans y) 8192.0) + (set! (-> this y-level) (-> this root trans y)) + (set! (-> this y-offset) 0.0) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/nest/nest-scenes.gc b/goal_src/jak2/levels/nest/nest-scenes.gc index fda0f91b80..924e84e7e9 100644 --- a/goal_src/jak2/levels/nest/nest-scenes.gc +++ b/goal_src/jak2/levels/nest/nest-scenes.gc @@ -78,7 +78,7 @@ (defstate zap (canyon-lightning-thingy) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (dotimes (v1-0 5) @@ -104,7 +104,7 @@ ) :trans (behavior () (cond - ((>= (- (current-time) (-> self state-time)) (seconds 0.125)) + ((time-elapsed? (-> self state-time) (seconds 0.125)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root trans quad)) (let ((v1-7 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) @@ -169,13 +169,13 @@ ) ;; WARN: Return type mismatch process-drawable vs canyon-lightning-thingy. -(defmethod relocate canyon-lightning-thingy ((obj canyon-lightning-thingy) (arg0 int)) +(defmethod relocate canyon-lightning-thingy ((this canyon-lightning-thingy) (arg0 int)) (dotimes (index 5) - (if (nonzero? (-> obj lightning index)) - (&+! (-> obj lightning index) arg0) + (if (nonzero? (-> this lightning index)) + (&+! (-> this lightning index) arg0) ) ) - (the-as canyon-lightning-thingy ((method-of-type process-drawable relocate) obj arg0)) + (the-as canyon-lightning-thingy ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. diff --git a/goal_src/jak2/levels/palace/boss/squid-extras.gc b/goal_src/jak2/levels/palace/boss/squid-extras.gc index 2e1ec38430..bf350a628c 100644 --- a/goal_src/jak2/levels/palace/boss/squid-extras.gc +++ b/goal_src/jak2/levels/palace/boss/squid-extras.gc @@ -209,16 +209,16 @@ ) ) -(defmethod play-impact-sound! squid-grenade ((obj squid-grenade)) +(defmethod play-impact-sound! squid-grenade ((this squid-grenade)) "Plays impact sound" (ja-post) 0 (none) ) -(defmethod init-proj-collision! squid-grenade ((obj squid-grenade)) +(defmethod init-proj-collision! squid-grenade ((this squid-grenade)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -262,22 +262,22 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-grenade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (when (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) + (set! (-> this draw light-index) (the-as uint 10)) + (when (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -204800.0 4096.0 4096000.0 (shadow-flags) 819200.0) ) - (let ((v1-25 (-> obj draw shadow-ctrl))) + (let ((v1-25 (-> this draw shadow-ctrl))) (logclear! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 @@ -286,26 +286,26 @@ (none) ) -(defmethod init-proj-settings! squid-grenade ((obj squid-grenade)) +(defmethod init-proj-settings! squid-grenade ((this squid-grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1120) obj)) - (set! (-> obj attack-mode) 'squid-grenade) - (set! (-> obj max-speed) 655360.0) - (set! (-> obj move) squid-grenade-move) - (set! (-> obj timeout) (seconds 5)) - (set! (-> obj stop-speed) 4.096) - (set! (-> obj fly-sound) (new-sound-id)) - (set! (-> obj traj-timer) (current-time)) - (vector+! (-> obj traj-dest) (-> obj root trans) (-> obj root transv)) - (set! (-> obj traj-duration) - (fmax 600.0 (* 0.0018310547 (vector-vector-xz-distance (-> obj root trans) (-> obj traj-dest)))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1120) this)) + (set! (-> this attack-mode) 'squid-grenade) + (set! (-> this max-speed) 655360.0) + (set! (-> this move) squid-grenade-move) + (set! (-> this timeout) (seconds 5)) + (set! (-> this stop-speed) 4.096) + (set! (-> this fly-sound) (new-sound-id)) + (set-time! (-> this traj-timer)) + (vector+! (-> this traj-dest) (-> this root trans) (-> this root transv)) + (set! (-> this traj-duration) + (fmax 600.0 (* 0.0018310547 (vector-vector-xz-distance (-> this root trans) (-> this traj-dest)))) ) - (+! (-> obj traj-duration) (* 75.0 (rand-vu))) + (+! (-> this traj-duration) (* 75.0 (rand-vu))) (let ((f0-8 32768.0)) - (if (< (-> obj root trans y) (-> obj traj-dest y)) - (+! f0-8 (- (-> obj traj-dest y) (-> obj root trans y))) + (if (< (-> this root trans y) (-> this traj-dest y)) + (+! f0-8 (- (-> this traj-dest y) (-> this root trans y))) ) - (setup-from-to-duration-and-height! (-> obj traj) (-> obj root trans) (-> obj traj-dest) 1.0 f0-8) + (setup-from-to-duration-and-height! (-> this traj) (-> this root trans) (-> this traj-dest) 1.0 f0-8) ) (none) ) @@ -378,7 +378,7 @@ (defstate idle (squid-whirlwind) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self duration) (the-as time-frame (+ (the int (* 150.0 (rand-vu))) 1050))) ) :trans (behavior () @@ -391,7 +391,7 @@ (+! (-> a1-2 y) 2048.0) (spawn (-> self part) a1-2) ) - (when (or (>= (- (current-time) (-> self state-time)) (-> self duration)) + (when (or (time-elapsed? (-> self state-time) (-> self duration)) (let ((f0-3 (vector-vector-xz-distance-squared (target-pos 0) (-> self root trans))) (f1-1 12288.0) ) @@ -416,11 +416,11 @@ :code sleep-code ) -(defmethod deactivate squid-whirlwind ((obj squid-whirlwind)) - (if (-> obj whirl-sound-playing) - (sound-stop (-> obj whirl-sound)) +(defmethod deactivate squid-whirlwind ((this squid-whirlwind)) + (if (-> this whirl-sound-playing) + (sound-stop (-> this whirl-sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -455,85 +455,85 @@ (none) ) -(defmethod draw hud-squid ((obj hud-squid)) - (set-hud-piece-position! (-> obj sprites 1) (the int (+ 462.0 (* 130.0 (-> obj offset)))) 350) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -32 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) -96 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 1)) -62 14) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 1)) -32 14) - (let ((s5-0 (-> obj values 0 current)) - (f28-0 (* 0.01 (the float (-> obj values 1 current)))) - (f30-0 (* 0.01 (the float (-> obj values 2 current)))) +(defmethod draw hud-squid ((this hud-squid)) + (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) -96 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites 1)) -32 14) + (let ((s5-0 (-> this values 0 current)) + (f28-0 (* 0.01 (the float (-> this values 1 current)))) + (f30-0 (* 0.01 (the float (-> this values 2 current)))) ) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 1)) -92 15) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 1)) -92 15) (cond ((zero? s5-0) - (set! (-> obj sprites 3 color x) 0) - (set! (-> obj sprites 3 color y) 255) + (set! (-> this sprites 3 color x) 0) + (set! (-> this sprites 3 color y) 255) (set! f28-0 (+ 2.0 f28-0)) ) ((= s5-0 1) - (set! (-> obj sprites 3 color y) 255) - (set! (-> obj sprites 3 color x) 255) + (set! (-> this sprites 3 color y) 255) + (set! (-> this sprites 3 color x) 255) (set! f28-0 (+ 1.0 f28-0)) ) (else - (set! (-> obj sprites 3 color x) 255) - (set! (-> obj sprites 3 color y) 0) + (set! (-> this sprites 3 color x) 255) + (set! (-> this sprites 3 color y) 0) 0 ) ) - (set! (-> obj sprites 3 scale-x) (* -7.25 f28-0)) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 1)) -84 4) + (set! (-> this sprites 3 scale-x) (* -7.25 f28-0)) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 1)) -84 4) (cond ((< f30-0 0.5) - (set! (-> obj sprites 4 color x) 255) - (set! (-> obj sprites 4 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-0)))) + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-0)))) ) (else - (set! (-> obj sprites 4 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-0))))) - (set! (-> obj sprites 4 color y) 255) + (set! (-> this sprites 4 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-0))))) + (set! (-> this sprites 4 color y) 255) ) ) - (set! (-> obj sprites 4 scale-x) (* -18.25 f30-0)) + (set! (-> this sprites 4 scale-x) (* -18.25 f30-0)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod init-callback hud-squid ((obj hud-squid)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-squid ((this hud-squid)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj values 0 target) 0) - (set! (-> obj values 1 target) 100) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 2 tex) + (set! (-> this values 0 target) 0) + (set! (-> this values 1 target) 100) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 2 tex) (lookup-texture-by-name "hud-baronsymbol-01" (the-as string #f) (the-as (pointer texture-page) #f)) ) - (set! (-> obj sprites 2 flags) (the-as uint 4)) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 5 scale-x) 0.5) - (set! (-> obj sprites 5 flags) (the-as uint 4)) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 6 scale-x) 0.5) - (set! (-> obj sprites 6 flags) (the-as uint 4)) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 3 scale-y) 3.25) - (set! (-> obj sprites 3 color z) 0) - (set! (-> obj sprites 3 flags) (the-as uint 4)) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 4 scale-y) 1.5) - (set! (-> obj sprites 4 color z) 0) - (set! (-> obj sprites 4 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning large)) - (set! (-> obj strings 0 scale) 0.5) + (set! (-> this sprites 2 flags) (the-as uint 4)) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 5 scale-x) 0.5) + (set! (-> this sprites 5 flags) (the-as uint 4)) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 6 scale-x) 0.5) + (set! (-> this sprites 6 flags) (the-as uint 4)) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 3 scale-y) 3.25) + (set! (-> this sprites 3 color z) 0) + (set! (-> this sprites 3 flags) (the-as uint 4)) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 4 scale-y) 1.5) + (set! (-> this sprites 4 color z) 0) + (set! (-> this sprites 4 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning large)) + (set! (-> this strings 0 scale) 0.5) 0 (none) ) diff --git a/goal_src/jak2/levels/palace/boss/squid-setup.gc b/goal_src/jak2/levels/palace/boss/squid-setup.gc index e5d49ae2fe..d0a930b636 100644 --- a/goal_src/jak2/levels/palace/boss/squid-setup.gc +++ b/goal_src/jak2/levels/palace/boss/squid-setup.gc @@ -632,9 +632,9 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod joint-setup squid-tentacle ((obj squid-tentacle)) +(defmethod joint-setup squid-tentacle ((this squid-tentacle)) (dotimes (s5-0 11) - (let ((s4-0 (-> obj chain-joints s5-0))) + (let ((s4-0 (-> this chain-joints s5-0))) (vector<-cspace! (-> s4-0 position) (-> s4-0 joint-mod joint)) (set! (-> s4-0 position quad) (-> s4-0 joint-mod joint bone transform quad 0)) (vector-reset! (-> s4-0 velocity)) @@ -644,7 +644,7 @@ (none) ) -(defmethod squid-tentacle-method-23 squid-tentacle ((obj squid-tentacle)) +(defmethod squid-tentacle-method-23 squid-tentacle ((this squid-tentacle)) (local-vars (v1-134 float) (v1-162 float) @@ -690,11 +690,11 @@ (vf6 :class vf) ) (init-vf0-vector) - (vector-seek-3d-smooth! (-> obj gravity) (-> obj gravity-target) 0.05 0.1) + (vector-seek-3d-smooth! (-> this gravity) (-> this gravity-target) 0.05 0.1) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((s4-0 (new 'stack-no-clear 'bounding-box))) (let ((s3-0 (new 'stack-no-clear 'sphere))) - (vector<-cspace! s3-0 (-> obj node-list data 7)) + (vector<-cspace! s3-0 (-> this node-list data 7)) (set! (-> s3-0 r) 61440.0) (set-from-sphere! s4-0 s3-0) ) @@ -708,29 +708,29 @@ (fill-using-bounding-box *collide-cache* s5-0) ) (let ((s5-1 (new 'stack-no-clear 'matrix)) - (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3))) + (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 3))) (s3-1 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 3 bone transform vector 2) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 3 bone transform vector 2) 1.0) ) (s2-0 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 3 bone transform vector 1) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 3 bone transform vector 1) 1.0) ) (s1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> obj num-bg-collisions) 0) - (set! (-> obj max-movement) 0.0) + (set! (-> this num-bg-collisions) 0) + (set! (-> this max-movement) 0.0) (dotimes (s0-0 11) - (set! sv-1456 (-> obj chain-joints s0-0)) + (set! sv-1456 (-> this chain-joints s0-0)) (set! sv-1904 (new 'stack-no-clear 'vector)) (let ((v1-19 (-> sv-1456 position quad))) (set! (-> sv-1904 quad) v1-19) ) (cond - ((-> obj wrap) + ((-> this wrap) (+! (-> sv-1904 y) -409.6) (set! sv-1472 (new 'stack-no-clear 'vector)) (let ((v1-25 sv-1904) - (a0-10 (-> obj center)) + (a0-10 (-> this center)) ) (.lvf vf4 (&-> v1-25 quad)) (.lvf vf5 (&-> a0-10 quad)) @@ -746,7 +746,7 @@ (else (set! sv-1520 sv-1904) (set! sv-1488 sv-1904) - (set! sv-1504 (-> obj gravity)) + (set! sv-1504 (-> this gravity)) (let ((f0-14 (* 4096.0 (-> pp clock time-adjust-ratio) (fmax 0.2 (lerp-scale 0.38 0.18 (the float s0-0) 0.0 5.0)))) ) (.lvf vf2 (&-> sv-1504 quad)) @@ -759,8 +759,8 @@ (.mul.x.vf acc vf2 vf3) (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) (.svf (&-> sv-1520 quad) vf4) - (when (-> obj avoid-center) - (vector-! s1-0 (-> sv-1456 position) (-> obj center)) + (when (-> this avoid-center) + (vector-! s1-0 (-> sv-1456 position) (-> this center)) (set! sv-1536 vector-normalize!) (set! sv-1552 s1-0) (let ((a1-13 (* 4096.0 (-> pp clock time-adjust-ratio) (fmax 0.0 (lerp-scale 0.4 0.6 (the float s0-0) 0.0 8.0))))) @@ -773,7 +773,7 @@ (when (< s0-0 10) (set! sv-1600 sv-1904) (set! sv-1568 sv-1904) - (set! sv-1584 (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ s0-0 1) 64)))) + (set! sv-1584 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ s0-0 1) 64)))) (let ((f0-24 (fmin 0.9 (lerp-scale 0.2 1.0 (the float s0-0) 0.0 4.0)))) (.lvf vf2 (&-> sv-1584 quad)) (.lvf vf1 (&-> sv-1568 quad)) @@ -792,7 +792,7 @@ (vector-normalize! s1-0 4096.0) ) (vector+! sv-1904 s1-0 s4-1) - (let ((v0-15 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3)))) + (let ((v0-15 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 3)))) (set! sv-1616 (new 'stack-no-clear 'vector)) (+! (-> v0-15 y) 31744.0) (vector-! sv-1616 sv-1904 v0-15) @@ -802,7 +802,7 @@ (vector+float*! sv-1904 sv-1904 sv-1616 (- 32768.0 f0-27)) (vector-normalize-copy! sv-1616 - (-> obj node-list data 3 bone transform vector 2) + (-> this node-list data 3 bone transform vector 2) (* 2048.0 (-> pp clock time-adjust-ratio)) ) (let ((v1-77 sv-1904)) @@ -818,7 +818,7 @@ ) (set! sv-1632 (new 'stack-no-clear 'vector)) (let ((v1-79 sv-1904) - (a0-33 (-> obj center)) + (a0-33 (-> this center)) ) (.lvf vf4 (&-> v1-79 quad)) (.lvf vf5 (&-> a0-33 quad)) @@ -910,7 +910,7 @@ (let ((v1-114 sv-1744)) (set! (-> v1-114 radius) 4096.0) (set! (-> v1-114 collide-with) (collide-spec player-list special-obstacle)) - (set! (-> v1-114 ignore-process0) obj) + (set! (-> v1-114 ignore-process0) this) (set! (-> v1-114 ignore-process1) #f) (set! (-> v1-114 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) @@ -946,7 +946,7 @@ ) (label cfg-27) (if (< 1 sv-1760) - (+! (-> obj num-bg-collisions) 1) + (+! (-> this num-bg-collisions) 1) ) (set! sv-1808 (new 'stack-no-clear 'vector)) (let ((v1-143 s4-1) @@ -978,7 +978,7 @@ ) (else (set! f0-51 (* 0.8 f30-4)) - (vector-float*! sv-1792 sv-1792 (-> obj stretch-vel)) + (vector-float*! sv-1792 sv-1792 (-> this stretch-vel)) ) ) ) @@ -1015,8 +1015,8 @@ ) ) ) - (set! (-> obj max-movement) - (fmax (vector-vector-distance (-> sv-1456 position) sv-1904) (-> obj max-movement)) + (set! (-> this max-movement) + (fmax (vector-vector-distance (-> sv-1456 position) sv-1904) (-> this max-movement)) ) (set! (-> sv-1456 position quad) (-> sv-1904 quad)) (if (-> sv-1456 joint-mod) @@ -1085,8 +1085,8 @@ 0 ) ) - (set! (-> obj avoid-center) #f) - (set! (-> obj wrap) #f) + (set! (-> this avoid-center) #f) + (set! (-> this wrap) #f) 0 (none) ) @@ -1094,13 +1094,13 @@ ) ;; WARN: Return type mismatch process-drawable vs squid-tentacle. -(defmethod relocate squid-tentacle ((obj squid-tentacle) (arg0 int)) +(defmethod relocate squid-tentacle ((this squid-tentacle) (arg0 int)) (dotimes (v1-0 11) - (if (nonzero? (-> obj chain-joints v1-0 joint-mod)) - (&+! (-> obj chain-joints v1-0 joint-mod) arg0) + (if (nonzero? (-> this chain-joints v1-0 joint-mod)) + (&+! (-> this chain-joints v1-0 joint-mod) arg0) ) ) - (the-as squid-tentacle ((method-of-type process-drawable relocate) obj arg0)) + (the-as squid-tentacle ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. @@ -1480,7 +1480,7 @@ (squid-take-hit (the-as touching-shapes-entry (-> arg3 param 0)) (the-as attack-info (-> arg3 param 1)) #f) ) ) - ((>= (- (current-time) (-> self invincible-timer)) (seconds 3)) + ((time-elapsed? (-> self invincible-timer) (seconds 3)) (cond ((and (= (-> self shield-hit-points) 0.0) (not (and (-> self next-state) (= (-> self next-state name) 'recharge))) @@ -1494,7 +1494,7 @@ ) ) (squid-take-hit (the-as touching-shapes-entry (-> arg3 param 0)) (the-as attack-info (-> arg3 param 1)) #t) - (set! (-> self invincible-timer) (current-time)) + (set-time! (-> self invincible-timer)) (squid-check-hit-points) ) ((or (!= (-> self shield-hit-points) 0.0) (and (-> self next-state) (= (-> self next-state name) 'recharge))) @@ -1528,61 +1528,61 @@ ) ) -(defmethod deactivate squid ((obj squid)) - (if (nonzero? (-> obj thruster-part)) - (kill-and-free-particles (-> obj thruster-part)) +(defmethod deactivate squid ((this squid)) + (if (nonzero? (-> this thruster-part)) + (kill-and-free-particles (-> this thruster-part)) ) - (if (-> obj rush-sound-playing) - (sound-stop (-> obj rush-sound)) + (if (-> this rush-sound-playing) + (sound-stop (-> this rush-sound)) ) - (if (-> obj jet-sound-playing) - (sound-stop (-> obj jet-sound)) + (if (-> this jet-sound-playing) + (sound-stop (-> this jet-sound)) ) - (if (-> obj spin-sound-playing) - (sound-stop (-> obj spin-sound)) + (if (-> this spin-sound-playing) + (sound-stop (-> this spin-sound)) ) - (if (-> obj tentacle-sound-playing) - (sound-stop (-> obj tentacle-sound)) + (if (-> this tentacle-sound-playing) + (sound-stop (-> this tentacle-sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs squid. -(defmethod relocate squid ((obj squid) (arg0 int)) - (if (nonzero? (-> obj thruster-part)) - (&+! (-> obj thruster-part) arg0) +(defmethod relocate squid ((this squid) (arg0 int)) + (if (nonzero? (-> this thruster-part)) + (&+! (-> this thruster-part) arg0) ) - (if (nonzero? (-> obj first-path)) - (&+! (-> obj first-path) arg0) + (if (nonzero? (-> this first-path)) + (&+! (-> this first-path) arg0) ) - (if (nonzero? (-> obj second-path)) - (&+! (-> obj second-path) arg0) + (if (nonzero? (-> this second-path)) + (&+! (-> this second-path) arg0) ) - (if (nonzero? (-> obj third-path)) - (&+! (-> obj third-path) arg0) + (if (nonzero? (-> this third-path)) + (&+! (-> this third-path) arg0) ) - (if (nonzero? (-> obj gun-tilt-left-jm)) - (&+! (-> obj gun-tilt-left-jm) arg0) + (if (nonzero? (-> this gun-tilt-left-jm)) + (&+! (-> this gun-tilt-left-jm) arg0) ) - (if (nonzero? (-> obj gun-tilt-right-jm)) - (&+! (-> obj gun-tilt-right-jm) arg0) + (if (nonzero? (-> this gun-tilt-right-jm)) + (&+! (-> this gun-tilt-right-jm) arg0) ) - (if (nonzero? (-> obj tentacle-base-jm)) - (&+! (-> obj tentacle-base-jm) arg0) + (if (nonzero? (-> this tentacle-base-jm)) + (&+! (-> this tentacle-base-jm) arg0) ) - (the-as squid ((method-of-type process-drawable relocate) obj arg0)) + (the-as squid ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! squid ((obj squid) (arg0 entity-actor)) +(defmethod init-from-entity! squid ((this squid) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate generic-attack @@ -1778,116 +1778,116 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-56 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-squid" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (logior! (-> obj mask) (process-mask enemy)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj trans quad) (-> obj root trans quad)) - (set! (-> obj force-onto-mesh) #t) - (set! (-> obj mesh-forced) #f) - (quaternion-copy! (-> obj quat) (-> obj root quat)) + (set! (-> this draw light-index) (the-as uint 10)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (logior! (-> this mask) (process-mask enemy)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this trans quad) (-> this root trans quad)) + (set! (-> this force-onto-mesh) #t) + (set! (-> this mesh-forced) #f) + (quaternion-copy! (-> this quat) (-> this root quat)) (dotimes (s5-2 6) - (set! (-> obj tentacles s5-2) - (ppointer->handle (process-spawn squid-tentacle (-> obj root trans) s5-2 :to obj)) + (set! (-> this tentacles s5-2) + (ppointer->handle (process-spawn squid-tentacle (-> this root trans) s5-2 :to this)) ) ) - (set! (-> obj baron) (the-as squid-baron (process-spawn squid-baron (-> obj root trans) :to obj))) - (set! (-> obj driver) (process-spawn squid-driver "driver-" :to obj)) - (init (-> obj driver-blend) 0.0 0.0025 0.025 0.5) - (set-params! (-> obj hit-reaction) (the-as vector #f) 0.2 1.0 0.5) + (set! (-> this baron) (the-as squid-baron (process-spawn squid-baron (-> this root trans) :to this))) + (set! (-> this driver) (process-spawn squid-driver "driver-" :to this)) + (init (-> this driver-blend) 0.0 0.0025 0.025 0.5) + (set-params! (-> this hit-reaction) (the-as vector #f) 0.2 1.0 0.5) (let ((s5-6 (vector+! (new 'stack-no-clear 'vector) - (-> obj root trans) + (-> this root trans) (new 'static 'vector :x -20480.0 :y 23388.16 :z 143360.0) ) ) ) - (set! (-> obj collision-actor) (process-spawn squid-collision s5-6 0 :to obj)) + (set! (-> this collision-actor) (process-spawn squid-collision s5-6 0 :to this)) ) - (set! (-> obj blink-time) 0) - (setup-part-engine obj #t) - (set! (-> obj thruster-part) (create-launch-control (-> *part-group-id-table* 1118) obj)) + (set! (-> this blink-time) 0) + (setup-part-engine this #t) + (set! (-> this thruster-part) (create-launch-control (-> *part-group-id-table* 1118) this)) (dotimes (v1-110 10) - (set! (-> obj grenade v1-110 grenade) (the-as handle #f)) - (set! (-> obj grenade v1-110 marker) (the-as handle #f)) - (set! (-> obj grenade v1-110 show-it) #f) + (set! (-> this grenade v1-110 grenade) (the-as handle #f)) + (set! (-> this grenade v1-110 marker) (the-as handle #f)) + (set! (-> this grenade v1-110 show-it) #f) ) - (set! (-> obj gun-tilt-left-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 36)) - (set! (-> obj gun-tilt-right-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 43)) - (set! (-> obj gun-tilt) 0.0) - (set! (-> obj tentacle-base-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 6)) - (init (-> obj tentacle-base-rotation-speed) 0.0 0.01 0.1 0.9) - (set! (-> obj tentacle-base-rotation) 0.0) - (set! (-> obj first-path) (new 'process 'curve-control obj 'first -1000000000.0)) - (logior! (-> obj first-path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj second-path) (new 'process 'curve-control obj 'second -1000000000.0)) - (logior! (-> obj second-path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj third-path) (new 'process 'curve-control obj 'third -1000000000.0)) - (logior! (-> obj third-path flags) (path-control-flag display draw-line draw-point draw-text)) - (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 0) obj) - (set! (-> obj current-nav-poly) #f) - (set! (-> obj shield-timer) 0) - (set! (-> obj shield-hit-points) 1.0) - (set! (-> obj shield-shattered) #f) - (set! (-> obj hit-points) 10) - (set! (-> obj invincible-timer) 0) - (set! (-> obj stage) 0) - (set! (-> obj stage-2-go-status) 0) - (set! (-> obj debug-on) #f) - (when (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) + (set! (-> this gun-tilt-left-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 36)) + (set! (-> this gun-tilt-right-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 43)) + (set! (-> this gun-tilt) 0.0) + (set! (-> this tentacle-base-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 6)) + (init (-> this tentacle-base-rotation-speed) 0.0 0.01 0.1 0.9) + (set! (-> this tentacle-base-rotation) 0.0) + (set! (-> this first-path) (new 'process 'curve-control this 'first -1000000000.0)) + (logior! (-> this first-path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this second-path) (new 'process 'curve-control this 'second -1000000000.0)) + (logior! (-> this second-path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this third-path) (new 'process 'curve-control this 'third -1000000000.0)) + (logior! (-> this third-path flags) (path-control-flag display draw-line draw-point draw-text)) + (change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0) this) + (set! (-> this current-nav-poly) #f) + (set! (-> this shield-timer) 0) + (set! (-> this shield-hit-points) 1.0) + (set! (-> this shield-shattered) #f) + (set! (-> this hit-points) 10) + (set! (-> this invincible-timer) 0) + (set! (-> this stage) 0) + (set! (-> this stage-2-go-status) 0) + (set! (-> this debug-on) #f) + (when (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -122880.0 4096.0 4096000.0 (shadow-flags) 819200.0) ) - (let ((v1-141 (-> obj draw shadow-ctrl))) + (let ((v1-141 (-> this draw shadow-ctrl))) (logclear! (-> v1-141 settings flags) (shadow-flags disable-draw)) ) 0 ) - (set! (-> obj hud) (the-as handle #f)) - (setup-masks (-> obj draw) 0 5440) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1124) obj)) - (set! (-> obj desired-rotate-to-vector-angle) 0.0) - (set! (-> obj allowed-rotate-to-vector-angle) 0.0) - (set! (-> obj rush-sound) (new-sound-id)) - (set! (-> obj rush-sound-playing) #f) - (set! (-> obj rush-end-time) 0) - (set! (-> obj jet-sound) (new-sound-id)) - (set! (-> obj jet-sound-playing) #f) - (set! (-> obj jet-pitch) 0) - (set! (-> obj jet-volume) 0) - (set! (-> obj tentacle-sound) (new-sound-id)) - (set! (-> obj tentacle-sound-playing) #f) - (set! (-> obj spin-sound) (new-sound-id)) - (set! (-> obj spin-sound-playing) #f) - (set! (-> obj max-plane) -1) - (set! (-> obj last-damaged-talker) 0) - (set! (-> obj last-shield-hit-talker) 0) - (set! (-> obj last-no-energy-talker) 0) - (set! (-> obj last-shooting-talker) 0) - (set! (-> obj last-headbutting-talker) 0) - (set! (-> obj last-general-talker) 0) - (set! (-> obj last-start-recharging-talker) -1) - (set! (-> obj last-done-recharging-talker) -1) - (set! (-> obj suck) (you-suck-scale *game-info* #f)) + (set! (-> this hud) (the-as handle #f)) + (setup-masks (-> this draw) 0 5440) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1124) this)) + (set! (-> this desired-rotate-to-vector-angle) 0.0) + (set! (-> this allowed-rotate-to-vector-angle) 0.0) + (set! (-> this rush-sound) (new-sound-id)) + (set! (-> this rush-sound-playing) #f) + (set! (-> this rush-end-time) 0) + (set! (-> this jet-sound) (new-sound-id)) + (set! (-> this jet-sound-playing) #f) + (set! (-> this jet-pitch) 0) + (set! (-> this jet-volume) 0) + (set! (-> this tentacle-sound) (new-sound-id)) + (set! (-> this tentacle-sound-playing) #f) + (set! (-> this spin-sound) (new-sound-id)) + (set! (-> this spin-sound-playing) #f) + (set! (-> this max-plane) -1) + (set! (-> this last-damaged-talker) 0) + (set! (-> this last-shield-hit-talker) 0) + (set! (-> this last-no-energy-talker) 0) + (set! (-> this last-shooting-talker) 0) + (set! (-> this last-headbutting-talker) 0) + (set! (-> this last-general-talker) 0) + (set! (-> this last-start-recharging-talker) -1) + (set! (-> this last-done-recharging-talker) -1) + (set! (-> this suck) (you-suck-scale *game-info* #f)) (if (task-node-closed? (game-task-node palace-boss-resolution)) - (go (method-of-object obj beaten)) - (go (method-of-object obj hidden)) + (go (method-of-object this beaten)) + (go (method-of-object this hidden)) ) (none) ) -(defmethod squid-method-42 squid ((obj squid) (arg0 vector)) +(defmethod squid-method-42 squid ((this squid) (arg0 vector)) (set! (-> arg0 quad) (-> (if *target* (get-trans *target* 3) - (-> obj nav state mesh bounds) + (-> this nav state mesh bounds) ) quad ) @@ -1895,19 +1895,19 @@ This commonly includes things such as: arg0 ) -(defmethod squid-method-43 squid ((obj squid) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod squid-method-43 squid ((this squid) (arg0 vector) (arg1 float) (arg2 float)) (let ((s4-0 (new 'stack-no-clear 'matrix)) - (s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj quat))) + (s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this quat))) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s3-0 arg0 (-> obj trans)) + (vector-! s3-0 arg0 (-> this trans)) (vector-flatten! s3-0 s3-0 (-> s5-0 vector 1)) (vector-normalize! s3-0 1.0) (matrix-from-two-vectors-max-angle-partial! s4-0 (-> s5-0 vector 2) s3-0 - (fmin (-> obj allowed-rotate-to-vector-angle) arg1) + (fmin (-> this allowed-rotate-to-vector-angle) arg1) arg2 ) (let* ((v1-2 (vector-cross! (new 'stack-no-clear 'vector) s3-0 (-> s5-0 vector 2))) @@ -1916,26 +1916,26 @@ This commonly includes things such as: (if (< (vector-dot v1-2 (-> s5-0 vector 1)) 0.0) (set! f0-2 (- f0-2)) ) - (set! (-> obj desired-rotate-to-vector-angle) (asin f0-2)) + (set! (-> this desired-rotate-to-vector-angle) (asin f0-2)) ) ) (matrix*! s5-0 s5-0 s4-0) (matrix-remove-z-rot s5-0 (new 'static 'vector :y -1.0)) - (matrix->quaternion (-> obj quat) s5-0) + (matrix->quaternion (-> this quat) s5-0) ) - (quaternion-normalize! (-> obj quat)) + (quaternion-normalize! (-> this quat)) 0 (none) ) -(defmethod squid-method-44 squid ((obj squid) (arg0 vector) (arg1 vector)) +(defmethod squid-method-44 squid ((this squid) (arg0 vector) (arg1 vector)) (let ((v1-0 (new 'stack-no-clear 'collide-query))) (set! (-> v1-0 start-pos quad) (-> arg0 quad)) (vector-! (-> v1-0 move-dist) arg1 arg0) (let ((a1-1 v1-0)) (set! (-> a1-1 radius) 409.6) (set! (-> a1-1 collide-with) (collide-spec player-list special-obstacle)) - (set! (-> a1-1 ignore-process0) obj) + (set! (-> a1-1 ignore-process0) this) (set! (-> a1-1 ignore-process1) #f) (set! (-> a1-1 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-1 action-mask) (collide-action solid)) @@ -1944,7 +1944,7 @@ This commonly includes things such as: ) ) -(defmethod move-to-spot squid ((obj squid) (arg0 vector) (arg1 symbol)) +(defmethod move-to-spot squid ((this squid) (arg0 vector) (arg1 symbol)) (local-vars (sv-656 vector) (sv-672 vector) @@ -1973,14 +1973,14 @@ This commonly includes things such as: (let ((s3-0 (new 'stack-no-clear 'vector)) (s0-0 0) ) - (set! sv-672 (squid-method-42 obj (new 'stack-no-clear 'vector))) + (set! sv-672 (squid-method-42 this (new 'stack-no-clear 'vector))) (+! (-> sv-672 y) 8192.0) (set! (-> s3-0 quad) (-> arg0 quad)) - (set! (-> s3-0 y) (-> obj nav state mesh bounds y)) - (set! (-> obj current-nav-poly) (cloest-point-on-mesh (-> obj nav) s3-0 s3-0 (-> obj current-nav-poly))) + (set! (-> s3-0 y) (-> this nav state mesh bounds y)) + (set! (-> this current-nav-poly) (cloest-point-on-mesh (-> this nav) s3-0 s3-0 (-> this current-nav-poly))) (cond - ((-> obj current-nav-poly) - (vector-! sv-656 (-> obj nav state mesh bounds) s3-0) + ((-> this current-nav-poly) + (vector-! sv-656 (-> this nav state mesh bounds) s3-0) (set! (-> sv-656 y) 0.0) (vector-normalize! sv-656 614400.0) (let ((a2-2 (matrix-rotate-y! (new 'stack-no-clear 'matrix) -19114.668))) @@ -1994,16 +1994,16 @@ This commonly includes things such as: (set! (-> s5-0 s0-0 quad) (-> sv-656 quad)) (set! (-> sv-704 poly) #f) (clamp-vector-to-mesh-cross-gaps - (-> obj nav) + (-> this nav) s3-0 - (-> obj current-nav-poly) + (-> this current-nav-poly) (-> s5-0 s0-0) 614400.0 #f sv-704 ) (set! (-> s5-0 s0-0 quad) (-> sv-704 intersection quad)) - (set! (-> s5-0 s0-0 y) (+ 20480.0 (-> obj nav state mesh bounds y))) + (set! (-> s5-0 s0-0 y) (+ 20480.0 (-> this nav state mesh bounds y))) (cond ((not (-> sv-704 found-boundary)) ) @@ -2013,7 +2013,7 @@ This commonly includes things such as: (< f0-6 (* f1-2 f1-2)) ) ) - ((not (squid-method-44 obj (-> s5-0 s0-0) sv-672)) + ((not (squid-method-44 this (-> s5-0 s0-0) sv-672)) ) ((let ((f0-7 (vector-vector-distance-squared s3-0 (-> s5-0 s0-0))) (f1-5 81920.0) @@ -2026,7 +2026,7 @@ This commonly includes things such as: (set! (-> s1-0 quad) (-> s5-0 s0-0 quad)) (when (-> sv-704 poly) (let ((a3-2 (new 'stack-no-clear 'vector))) - (set! sv-736 (-> obj nav)) + (set! sv-736 (-> this nav)) (let ((a1-15 (-> sv-704 poly))) (set! sv-752 s1-0) (let ((v1-53 (-> s5-0 s0-0))) @@ -2059,7 +2059,7 @@ This commonly includes things such as: (else (when (-> sv-704 poly) (let ((a3-3 (new 'stack-no-clear 'vector))) - (set! sv-768 (-> obj nav)) + (set! sv-768 (-> this nav)) (let ((a1-17 (-> sv-704 poly))) (set! sv-784 (-> s5-0 s0-0)) (let ((v1-67 (-> s5-0 s0-0))) @@ -2102,11 +2102,11 @@ This commonly includes things such as: ) ) (set! (-> s3-0 y) (-> arg0 y)) - (set-traj-towards-vec obj arg0 s3-0 (-> s5-0 0)) + (set-traj-towards-vec this arg0 s3-0 (-> s5-0 0)) ) ) (else - (format 0 "~A bad current poly~%" (-> obj name)) + (format 0 "~A bad current poly~%" (-> this name)) ) ) ) @@ -2117,79 +2117,79 @@ This commonly includes things such as: ) ) -(defmethod set-traj-towards-vec squid ((obj squid) (src vector) (arg2 vector) (dest vector)) +(defmethod set-traj-towards-vec squid ((this squid) (src vector) (arg2 vector) (dest vector)) "Set up the [[trajectory]] towards `dest`." - (set! (-> obj traj-timer) (current-time)) - (set! (-> obj traj-src quad) (-> src quad)) - (set! (-> obj traj-dest quad) (-> dest quad)) - (set! (-> obj traj-duration) (* 0.00091552734 (vector-vector-xz-distance arg2 dest))) - (set! (-> obj traj-duration) (fmax 480.0 (-> obj traj-duration))) + (set-time! (-> this traj-timer)) + (set! (-> this traj-src quad) (-> src quad)) + (set! (-> this traj-dest quad) (-> dest quad)) + (set! (-> this traj-duration) (* 0.00091552734 (vector-vector-xz-distance arg2 dest))) + (set! (-> this traj-duration) (fmax 480.0 (-> this traj-duration))) (let ((f0-4 49152.0)) (if (< (-> arg2 y) (-> dest y)) (+! f0-4 (- (-> dest y) (-> arg2 y))) ) - (setup-from-to-duration-and-height! (-> obj traj) arg2 dest 1.0 f0-4) + (setup-from-to-duration-and-height! (-> this traj) arg2 dest 1.0 f0-4) ) - (set! (-> obj residual-accumulator-1) 1.0) - (set! (-> obj residual-accumulator-2) 0.0) + (set! (-> this residual-accumulator-1) 1.0) + (set! (-> this residual-accumulator-2) 0.0) 0 (none) ) -(defmethod float-sin-clamp squid ((obj squid) (arg0 float)) +(defmethod float-sin-clamp squid ((this squid) (arg0 float)) (parameter-ease-sin-clamp (* 0.6366198 arg0)) ) -(defmethod squid-method-48 squid ((obj squid)) - (when (< 0.00001 (-> obj residual-accumulator-1)) - (set! (-> obj residual-accumulator-1) (* 0.95 (-> obj residual-accumulator-1))) - (+! (-> obj residual-accumulator-2) (-> obj residual-accumulator-1)) +(defmethod squid-method-48 squid ((this squid)) + (when (< 0.00001 (-> this residual-accumulator-1)) + (set! (-> this residual-accumulator-1) (* 0.95 (-> this residual-accumulator-1))) + (+! (-> this residual-accumulator-2) (-> this residual-accumulator-1)) ) (let* ((f28-0 ((method-of-type trajectory compute-time-until-apex) - (the-as trajectory (&-> (the-as squid-grenade (-> obj self)) ignore-handle)) + (the-as trajectory (&-> (the-as squid-grenade (-> this self)) ignore-handle)) ) ) - (s3-0 (compute-trans-at-time (-> obj traj) f28-0 (new 'stack-no-clear 'vector))) + (s3-0 (compute-trans-at-time (-> this traj) f28-0 (new 'stack-no-clear 'vector))) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) - (f30-0 (/ (the float (- (current-time) (-> obj traj-timer))) (-> obj traj-duration))) + (f30-0 (/ (the float (- (current-time) (-> this traj-timer))) (-> this traj-duration))) ) - (let ((f26-0 (float-sin-clamp obj f30-0))) - (when (and (-> obj can-play-squid-boost) (< 0.125 f30-0)) - (set! (-> obj can-play-squid-boost) #f) + (let ((f26-0 (float-sin-clamp this f30-0))) + (when (and (-> this can-play-squid-boost) (< 0.125 f30-0)) + (set! (-> this can-play-squid-boost) #f) (sound-play "squid-boost") ) (cond ((< f26-0 1.0) - (compute-trans-at-time (-> obj traj) f26-0 s5-0) - (set! (-> s4-0 quad) (-> obj traj-src quad)) - (+! (-> s4-0 y) (* 204.8 (the float (- (current-time) (-> obj traj-timer))) (/ f26-0 f30-0))) - (vector+float*! s4-0 s4-0 (-> obj residual-velocity) (-> obj residual-accumulator-2)) + (compute-trans-at-time (-> this traj) f26-0 s5-0) + (set! (-> s4-0 quad) (-> this traj-src quad)) + (+! (-> s4-0 y) (* 204.8 (the float (- (current-time) (-> this traj-timer))) (/ f26-0 f30-0))) + (vector+float*! s4-0 s4-0 (-> this residual-velocity) (-> this residual-accumulator-2)) (vector-lerp! s5-0 s4-0 s5-0 f26-0) (cond ((< f28-0 f26-0) (let ((f28-1 (/ (- f26-0 f28-0) (- 1.0 f28-0)))) - (vector-lerp! s4-0 s3-0 (-> obj traj-dest) f28-1) + (vector-lerp! s4-0 s3-0 (-> this traj-dest) f28-1) (vector-lerp! s5-0 s5-0 s4-0 f28-1) ) - (squid-method-43 obj (squid-method-42 obj (new 'stack-no-clear 'vector)) 1092.2667 0.05) - (vector-! s4-0 (-> obj traj-dest) (-> obj trans)) + (squid-method-43 this (squid-method-42 this (new 'stack-no-clear 'vector)) 1092.2667 0.05) + (vector-! s4-0 (-> this traj-dest) (-> this trans)) (vector-normalize! s4-0 1.75) (dotimes (s3-2 6) - (send-event (handle->process (-> obj tentacles s3-2)) 'set-gravity s4-0) + (send-event (handle->process (-> this tentacles s3-2)) 'set-gravity s4-0) ) ) (else - (squid-method-43 obj (-> obj traj-dest) 546.13336 0.005) + (squid-method-43 this (-> this traj-dest) 546.13336 0.005) ) ) - (set! (-> obj trans quad) (-> s5-0 quad)) + (set! (-> this trans quad) (-> s5-0 quad)) ) (else (dotimes (s5-1 6) - (send-event (handle->process (-> obj tentacles s5-1)) 'set-gravity-slow (new 'static 'vector :y -1.0)) + (send-event (handle->process (-> this tentacles s5-1)) 'set-gravity-slow (new 'static 'vector :y -1.0)) ) - (set! (-> obj trans quad) (-> obj traj-dest quad)) + (set! (-> this trans quad) (-> this traj-dest quad)) ) ) ) @@ -2197,65 +2197,65 @@ This commonly includes things such as: ) ) -(defmethod setup-part-engine squid ((obj squid) (arg0 symbol)) - (when (>= (- (current-time) (-> obj blink-time)) 0) - (set! (-> obj blink-mask) 0) +(defmethod setup-part-engine squid ((this squid) (arg0 symbol)) + (when (>= (- (current-time) (-> this blink-time)) 0) + (set! (-> this blink-mask) 0) (dotimes (s5-0 10) (let* ((f30-0 0.5) (v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-7 (the-as number (logior #x3f800000 v1-6))) ) (if (< f30-0 (+ -1.0 (the-as float v1-7))) - (logior! (-> obj blink-mask) (ash 1 s5-0)) + (logior! (-> this blink-mask) (ash 1 s5-0)) ) ) ) - (set! (-> obj blink-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.75))))) + (set! (-> this blink-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.75))))) (set! arg0 #t) ) (when arg0 - (remove-from-process *part-engine* obj) + (remove-from-process *part-engine* this) (add-connection *part-engine* - obj + this 5 - obj + this 4790 (new 'static 'vector :x -5906.432 :y 3317.76 :z -409.6 :w 819200.0) ) (add-connection *part-engine* - obj + this 5 - obj + this 4790 (new 'static 'vector :x 5906.432 :y 3317.76 :z -409.6 :w 819200.0) ) - (add-connection *part-engine* obj 6 obj 4791 (new 'static 'vector :y 3366.912 :w 819200.0)) - (add-connection *part-engine* obj 13 obj 4791 (new 'static 'vector :y 11993.088 :z 5255.168 :w 819200.0)) + (add-connection *part-engine* this 6 this 4791 (new 'static 'vector :y 3366.912 :w 819200.0)) + (add-connection *part-engine* this 13 this 4791 (new 'static 'vector :y 11993.088 :z 5255.168 :w 819200.0)) (add-connection *part-engine* - obj + this 5 - obj + this 4792 (new 'static 'vector :x 5439.488 :y -1794.048 :z 11444.224 :w 819200.0) ) (add-connection *part-engine* - obj + this 5 - obj + this 4792 (new 'static 'vector :x -5439.488 :y -1794.048 :z 11444.224 :w 819200.0) ) - (let ((s5-2 (-> obj blink-mask))) + (let ((s5-2 (-> this blink-mask))) (if (logtest? s5-2 1) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x -4128.768 :y 2355.2 :z 3653.632 :w 819200.0) ) @@ -2263,9 +2263,9 @@ This commonly includes things such as: (if (logtest? s5-2 2) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x -4554.752 :y 2449.408 :z 2359.296 :w 819200.0) ) @@ -2273,9 +2273,9 @@ This commonly includes things such as: (if (logtest? s5-2 4) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x -4386.816 :y 2191.36 :z 528.384 :w 819200.0) ) @@ -2283,9 +2283,9 @@ This commonly includes things such as: (if (logtest? s5-2 8) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x -5832.704 :y 2945.024 :z 1691.648 :w 819200.0) ) @@ -2293,9 +2293,9 @@ This commonly includes things such as: (if (logtest? s5-2 16) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x -5861.376 :y 2920.448 :z 1118.208 :w 819200.0) ) @@ -2303,9 +2303,9 @@ This commonly includes things such as: (if (logtest? s5-2 32) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x 4128.768 :y 2355.2 :z 3653.632 :w 819200.0) ) @@ -2313,9 +2313,9 @@ This commonly includes things such as: (if (logtest? s5-2 64) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x 4554.752 :y 2449.408 :z 2359.296 :w 819200.0) ) @@ -2323,9 +2323,9 @@ This commonly includes things such as: (if (logtest? s5-2 128) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x 4386.816 :y 2191.36 :z -528.384 :w 819200.0) ) @@ -2333,9 +2333,9 @@ This commonly includes things such as: (if (logtest? s5-2 256) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x 5832.704 :y 2945.024 :z 1691.648 :w 819200.0) ) @@ -2343,9 +2343,9 @@ This commonly includes things such as: (if (logtest? s5-2 512) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x 5861.376 :y 2920.448 :z 1118.208 :w 819200.0) ) @@ -2357,7 +2357,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch float vs none. -(defmethod squid-post squid ((obj squid)) +(defmethod squid-post squid ((this squid)) (local-vars (v0-33 object) (s5-9 int) @@ -2366,31 +2366,31 @@ This commonly includes things such as: ) ) (with-pp - (if (= (-> obj stage) 2) + (if (= (-> this stage) 2) (script-eval '(want-anim "palace-boss-res")) ) - (when (-> obj force-onto-mesh) + (when (-> this force-onto-mesh) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj trans quad)) - (set! (-> obj trans y) (-> obj nav state mesh bounds y)) - (set! (-> obj current-nav-poly) - (cloest-point-on-mesh (-> obj nav) (-> obj trans) (-> obj trans) (-> obj current-nav-poly)) + (set! (-> s5-0 quad) (-> this trans quad)) + (set! (-> this trans y) (-> this nav state mesh bounds y)) + (set! (-> this current-nav-poly) + (cloest-point-on-mesh (-> this nav) (-> this trans) (-> this trans) (-> this current-nav-poly)) ) - (set! (-> obj trans y) (-> s5-0 y)) + (set! (-> this trans y) (-> s5-0 y)) (let ((f0-2 409.6)) - (set! (-> obj mesh-forced) (< (* f0-2 f0-2) (vector-vector-distance-squared (-> obj trans) s5-0))) + (set! (-> this mesh-forced) (< (* f0-2 f0-2) (vector-vector-distance-squared (-> this trans) s5-0))) ) ) ) - (setup-part-engine obj #f) - (update! (-> obj driver-blend) 0.0) + (setup-part-engine this #f) + (update! (-> this driver-blend) 0.0) (let ((s4-0 (new 'stack-no-clear 'matrix)) (s5-1 (new 'stack-no-clear 'vector)) - (f30-1 (parameter-ease-sin-clamp (-> obj driver-blend value))) + (f30-1 (parameter-ease-sin-clamp (-> this driver-blend value))) ) (matrix-identity! s4-0) - (send-event (ppointer->process (-> obj driver)) 'matrix s4-0) - (vector+float*! (-> obj root trans) (-> obj trans) (-> s4-0 trans) f30-1) + (send-event (ppointer->process (-> this driver)) 'matrix s4-0) + (vector+float*! (-> this root trans) (-> this trans) (-> s4-0 trans) f30-1) (matrix->quaternion (the-as quaternion s5-1) s4-0) (cond ((< (-> s5-1 w) (cos 1.8204443)) @@ -2400,54 +2400,54 @@ This commonly includes things such as: (vector-float*! s5-1 s5-1 (/ (sin f30-2) (sin f28-1))) (set! (-> s5-1 w) (cos f30-2)) ) - (quaternion-normalize! (quaternion*! (-> obj root quat) (the-as quaternion s5-1) (-> obj quat))) + (quaternion-normalize! (quaternion*! (-> this root quat) (the-as quaternion s5-1) (-> this quat))) ) (else - (quaternion-copy! (-> obj root quat) (-> obj quat)) + (quaternion-copy! (-> this root quat) (-> this quat)) ) ) ) - (update! (-> obj hit-reaction) (the-as vector #f)) - (vector+float*! (-> obj root trans) (-> obj root trans) (the-as vector (-> obj hit-reaction)) 4096.0) - (update! (-> obj tentacle-base-rotation-speed) 0.0) - (let ((f0-14 (+ (-> obj tentacle-base-rotation) (* 910.2222 (-> obj tentacle-base-rotation-speed value))))) - (set! (-> obj tentacle-base-rotation) (- f0-14 (* (the float (the int (/ f0-14 65536.0))) 65536.0))) + (update! (-> this hit-reaction) (the-as vector #f)) + (vector+float*! (-> this root trans) (-> this root trans) (the-as vector (-> this hit-reaction)) 4096.0) + (update! (-> this tentacle-base-rotation-speed) 0.0) + (let ((f0-14 (+ (-> this tentacle-base-rotation) (* 910.2222 (-> this tentacle-base-rotation-speed value))))) + (set! (-> this tentacle-base-rotation) (- f0-14 (* (the float (the int (/ f0-14 65536.0))) 65536.0))) ) (quaternion-set! - (-> obj tentacle-base-jm quat) + (-> this tentacle-base-jm quat) 0.0 - (sin (-> obj tentacle-base-rotation)) + (sin (-> this tentacle-base-rotation)) 0.0 - (cos (-> obj tentacle-base-rotation)) + (cos (-> this tentacle-base-rotation)) ) - (when (< 0.5 (-> obj tentacle-base-rotation-speed value)) + (when (< 0.5 (-> this tentacle-base-rotation-speed value)) (let ((s5-3 (new 'stack-no-clear 'vector))) (let ((s4-5 (new 'stack-no-clear 'vector))) - (vector<-cspace! s5-3 (-> obj node-list data 6)) - (vector-normalize-copy! s4-5 (-> obj node-list data 6 bone transform vector 1) 16384.0) + (vector<-cspace! s5-3 (-> this node-list data 6)) + (vector-normalize-copy! s4-5 (-> this node-list data 6 bone transform vector 1) 16384.0) (vector+! s5-3 s5-3 s4-5) ) (dotimes (s4-6 6) - (send-event (handle->process (-> obj tentacles s4-6)) 'avoid-center s5-3) + (send-event (handle->process (-> this tentacles s4-6)) 'avoid-center s5-3) ) ) ) - (if (or (zero? (-> obj stage)) (or (and (= (-> obj stage) 1) (>= (-> obj max-plane) 8)) - (and (= (-> obj stage) 2) - (>= (-> obj max-plane) 24) - (not (and (-> obj next-state) (= (-> obj next-state name) 'flee))) - ) - ) + (if (or (zero? (-> this stage)) (or (and (= (-> this stage) 1) (>= (-> this max-plane) 8)) + (and (= (-> this stage) 2) + (>= (-> this max-plane) 24) + (not (and (-> this next-state) (= (-> this next-state name) 'flee))) + ) + ) ) - (set-setting! 'point-of-interest 'abs (-> obj trans) 0) + (set-setting! 'point-of-interest 'abs (-> this trans) 0) (remove-setting! 'point-of-interest) ) (transform-post) - (do-push-aways (-> obj root)) + (do-push-aways (-> this root)) (dotimes (s5-4 10) - (let ((a0-46 (handle->process (-> obj grenade s5-4 marker)))) + (let ((a0-46 (handle->process (-> this grenade s5-4 marker)))) (when a0-46 - (if (and (not (-> obj grenade s5-4 show-it)) (not (handle->process (-> obj grenade s5-4 grenade)))) + (if (and (not (-> this grenade s5-4 show-it)) (not (handle->process (-> this grenade s5-4 grenade)))) (deactivate a0-46) ) ) @@ -2463,146 +2463,148 @@ This commonly includes things such as: (set! (-> a1-25 from) (process->ppointer pp)) (set! (-> a1-25 num-params) 0) (set! (-> a1-25 message) 'get-num-bg-collisions) - (set! s5-5 (max s5-6 (the-as int (send-event-function (handle->process (-> obj tentacles s4-7)) a1-25)))) + (set! s5-5 (max s5-6 (the-as int (send-event-function (handle->process (-> this tentacles s4-7)) a1-25)))) ) (let ((a1-26 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-26 from) (process->ppointer pp)) (set! (-> a1-26 num-params) 0) (set! (-> a1-26 message) 'get-max-movement) - (set! f30-3 (fmax f30-3 (the-as float (send-event-function (handle->process (-> obj tentacles s4-7)) a1-26)))) + (set! f30-3 + (fmax f30-3 (the-as float (send-event-function (handle->process (-> this tentacles s4-7)) a1-26))) + ) ) ) (set! v0-33 (cond - ((or (and (not (-> obj tentacle-sound-playing)) (>= s5-5 5) (>= f30-3 1638.4)) - (or (and (-> obj next-state) (= (-> obj next-state name) 'recharge)) - (let ((v1-123 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((or (and (not (-> this tentacle-sound-playing)) (>= s5-5 5) (>= f30-3 1638.4)) + (or (and (-> this next-state) (= (-> this next-state name) 'recharge)) + (let ((v1-123 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-123 (= v1-123 (-> obj draw art-group data 5))) + (and v1-123 (= v1-123 (-> this draw art-group data 5))) ) ) ) - (sound-play "tentacles1" :id (-> obj tentacle-sound) :position (-> obj root trans)) + (sound-play "tentacles1" :id (-> this tentacle-sound) :position (-> this root trans)) (set! v0-33 #t) - (set! (-> obj tentacle-sound-playing) (the-as symbol v0-33)) + (set! (-> this tentacle-sound-playing) (the-as symbol v0-33)) v0-33 ) - ((and (-> obj tentacle-sound-playing) (< s5-5 3)) - (sound-stop (-> obj tentacle-sound)) - (set! (-> obj tentacle-sound-playing) #f) + ((and (-> this tentacle-sound-playing) (< s5-5 3)) + (sound-stop (-> this tentacle-sound)) + (set! (-> this tentacle-sound-playing) #f) (sound-play "tentacles-up") ) - ((-> obj tentacle-sound-playing) - (sound-play "tentacles1" :id (-> obj tentacle-sound) :position (-> obj root trans)) + ((-> this tentacle-sound-playing) + (sound-play "tentacles1" :id (-> this tentacle-sound) :position (-> this root trans)) ) ) ) ) - (when (-> obj rush-sound-playing) + (when (-> this rush-sound-playing) (cond - ((or (zero? (-> obj rush-end-time)) (< (- (current-time) (-> obj rush-end-time)) (seconds 0.1))) - (the-as int (sound-play "squid-rush" :id (-> obj rush-sound) :position (-> obj root trans))) + ((or (zero? (-> this rush-end-time)) (not (time-elapsed? (-> this rush-end-time) (seconds 0.1)))) + (the-as int (sound-play "squid-rush" :id (-> this rush-sound) :position (-> this root trans))) ) (else - (sound-stop (-> obj rush-sound)) - (set! (-> obj rush-sound-playing) #f) - (set! (-> obj rush-end-time) 0) + (sound-stop (-> this rush-sound)) + (set! (-> this rush-sound-playing) #f) + (set! (-> this rush-end-time) 0) 0 ) ) ) - (let ((v1-149 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-149 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((or (and v1-149 (= v1-149 (-> obj draw art-group data 33))) - (let ((v1-155 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((or (and v1-149 (= v1-149 (-> this draw art-group data 33))) + (let ((v1-155 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (or (and (and v1-155 (= v1-155 (-> obj draw art-group data 35))) (< -11.0 (ja-aframe-num 0))) - (and (-> obj next-state) (= (-> obj next-state name) 'pre-flee)) + (or (and (and v1-155 (= v1-155 (-> this draw art-group data 35))) (< -11.0 (ja-aframe-num 0))) + (and (-> this next-state) (= (-> this next-state name) 'pre-flee)) ) ) ) - (when (-> obj jet-sound-playing) - (sound-stop (-> obj jet-sound)) - (set! (-> obj jet-sound-playing) #f) + (when (-> this jet-sound-playing) + (sound-stop (-> this jet-sound)) + (set! (-> this jet-sound-playing) #f) ) ) (else - (let* ((f0-23 (fmin 1.0 (* 0.0011111111 (the float (- (current-time) (the-as time-frame (-> obj jet-pitch))))))) - (f28-2 (fmin 1.0 (* 0.006666667 (the float (- (current-time) (the-as time-frame (-> obj jet-volume))))))) + (let* ((f0-23 (fmin 1.0 (* 0.0011111111 (the float (- (current-time) (the-as time-frame (-> this jet-pitch))))))) + (f28-2 (fmin 1.0 (* 0.006666667 (the float (- (current-time) (the-as time-frame (-> this jet-volume))))))) (f30-6 (* 0.2 (- 1.0 f0-23) (sin (* 32768.0 f0-23)))) (f0-31 (+ 1.0 (* 5.0 (- 1.0 f28-2) (sin (* 32768.0 f30-6))))) ) - (if (-> obj negate-jet-pitch) + (if (-> this negate-jet-pitch) (set! f30-6 (- f30-6)) ) (sound-play-by-name (static-sound-name "squid-jets") - (-> obj jet-sound) + (-> this jet-sound) (the int (* 1024.0 f0-31)) (the int (* 1524.0 f30-6)) 0 (sound-group sfx) - (-> obj root trans) + (-> this root trans) ) ) - (set! (-> obj jet-sound-playing) #t) + (set! (-> this jet-sound-playing) #t) ) ) ) - (let ((v1-193 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-193 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (when (and (not (and v1-193 (= v1-193 (-> obj draw art-group data 33)))) - (let ((v1-199 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (and (not (and v1-193 (= v1-193 (-> this draw art-group data 33)))) + (let ((v1-199 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (not (and (and v1-199 (= v1-199 (-> obj draw art-group data 35))) (< -11.0 (ja-aframe-num 0)))) + (not (and (and v1-199 (= v1-199 (-> this draw art-group data 35))) (< -11.0 (ja-aframe-num 0)))) ) ) (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 0.0) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 24)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 25)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 32)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 33)) (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 10922.667) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 24)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 25)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 32)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 33)) (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 21845.334) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 24)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 25)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 32)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 33)) ) ) - (when (not (and (-> obj next-state) (= (-> obj next-state name) 'recharge))) - (let ((v1-249 (the int (lerp-scale 0.0 128.0 (the float (- (current-time) (-> obj shield-timer))) 0.0 600.0)))) + (when (not (and (-> this next-state) (= (-> this next-state name) 'recharge))) + (let ((v1-249 (the int (lerp-scale 0.0 128.0 (the float (- (current-time) (-> this shield-timer))) 0.0 600.0)))) (cond - ((< 0.0 (-> obj shield-hit-points)) + ((< 0.0 (-> this shield-hit-points)) (set! s5-9 (min 100 v1-249)) - (set! (-> obj shield-shattered) #f) + (set! (-> this shield-shattered) #f) ) ((< 16 v1-249) (set! s5-9 128) - (when (not (-> obj shield-shattered)) - (set! (-> obj shield-shattered) #t) + (when (not (-> this shield-shattered)) + (set! (-> this shield-shattered) #t) (sound-play "sqd-shield-brk") (let ((s4-10 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> s4-10 fountain-rand-transv-lo quad) (-> obj root trans quad)) + (set! (-> s4-10 fountain-rand-transv-lo quad) (-> this root trans quad)) (+! (-> s4-10 fountain-rand-transv-lo y) -12288.0) (set! (-> s4-10 fountain-rand-transv-hi x) 16424.96) (set! (-> s4-10 fountain-rand-transv-hi y) 32808.96) @@ -2616,11 +2618,11 @@ This commonly includes things such as: 70 s4-10 *squid-shield-exploder-params* - :to obj + :to this :stack-size #x8000 ) (dotimes (s3-4 6) - (let ((s1-2 (handle->process (-> obj tentacles s3-4)))) + (let ((s1-2 (handle->process (-> this tentacles s3-4)))) (when s1-2 (let ((s2-2 (get-process *default-dead-pool* joint-exploder #x4000))) (when s2-2 @@ -2658,16 +2660,16 @@ This commonly includes things such as: ) ) ) - (set! (-> obj draw force-fade) (the-as uint s5-9)) + (set! (-> this draw force-fade) (the-as uint s5-9)) (dotimes (s4-11 6) - (send-event (handle->process (-> obj tentacles s4-11)) 'set-fade s5-9) + (send-event (handle->process (-> this tentacles s4-11)) 'set-fade s5-9) ) - (let* ((f0-56 (lerp-scale 0.5 0.0 (the float (- (current-time) (-> obj shield-timer))) 0.0 75.0)) + (let* ((f0-56 (lerp-scale 0.5 0.0 (the float (- (current-time) (-> this shield-timer))) 0.0 75.0)) (a0-147 - (vector-float*! (new 'stack-no-clear 'vector) (-> obj shield-color) (if (< 0.0 (-> obj shield-hit-points)) - f0-56 - (- 1.0 f0-56) - ) + (vector-float*! (new 'stack-no-clear 'vector) (-> this shield-color) (if (< 0.0 (-> this shield-hit-points)) + f0-56 + (- 1.0 f0-56) + ) ) ) ) @@ -2675,51 +2677,51 @@ This commonly includes things such as: (set-shield-flash! a0-147) ) (cond - ((>= (-> obj draw force-fade) (the-as uint 128)) - (setup-masks (-> obj draw) 0 8192) - (logclear! (-> obj draw status) (draw-control-status warp-cross-fade)) + ((>= (-> this draw force-fade) (the-as uint 128)) + (setup-masks (-> this draw) 0 8192) + (logclear! (-> this draw status) (draw-control-status warp-cross-fade)) ) (else - (setup-masks (-> obj draw) 8192 0) - (logior! (-> obj draw status) (draw-control-status warp-cross-fade)) + (setup-masks (-> this draw) 8192 0) + (logior! (-> this draw status) (draw-control-status warp-cross-fade)) ) ) ) - (let ((v1-316 (handle->process (-> obj hud)))) + (let ((v1-316 (handle->process (-> this hud)))) (when v1-316 - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'recharge))) - (set! (-> (the-as hud-squid v1-316) values 2 target) (the int (* 100.0 (-> obj shield-hit-points)))) + (if (not (and (-> this next-state) (= (-> this next-state name) 'recharge))) + (set! (-> (the-as hud-squid v1-316) values 2 target) (the int (* 100.0 (-> this shield-hit-points)))) ) (cond - ((and (zero? (-> obj hit-points)) (< (-> obj stage) 2)) - (set! (-> (the-as hud-squid v1-316) values 0 target) (+ (-> obj stage) 1)) + ((and (zero? (-> this hit-points)) (< (-> this stage) 2)) + (set! (-> (the-as hud-squid v1-316) values 0 target) (+ (-> this stage) 1)) (set! (-> (the-as hud-squid v1-316) values 1 target) 100) ) (else - (set! (-> (the-as hud-squid v1-316) values 0 target) (-> obj stage)) - (set! (-> (the-as hud-squid v1-316) values 1 target) (/ (* 100 (-> obj hit-points)) 10)) + (set! (-> (the-as hud-squid v1-316) values 0 target) (-> this stage)) + (set! (-> (the-as hud-squid v1-316) values 1 target) (/ (* 100 (-> this hit-points)) 10)) ) ) ) ) - (set! (-> obj allowed-rotate-to-vector-angle) (fabs (-> obj desired-rotate-to-vector-angle))) + (set! (-> this allowed-rotate-to-vector-angle) (fabs (-> this desired-rotate-to-vector-angle))) (none) ) ) ;; WARN: Return type mismatch (pointer process) vs (pointer squid-whirlwind). -(defmethod spawn-whirlwind squid ((obj squid)) +(defmethod spawn-whirlwind squid ((this squid)) (let ((gp-0 (new 'stack-no-clear 'vector)) - (s4-0 (squid-method-42 obj (new 'stack-no-clear 'vector))) + (s4-0 (squid-method-42 this (new 'stack-no-clear 'vector))) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (send-event (handle->process (-> obj tentacles 0)) 'get-joint-pos 13 gp-0) - (vector-! s4-0 s4-0 (-> obj root trans)) + (send-event (handle->process (-> this tentacles 0)) 'get-joint-pos 13 gp-0) + (vector-! s4-0 s4-0 (-> this root trans)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (vector+float*! s3-0 (-> obj root trans) s4-0 16384.0) + (vector+float*! s3-0 (-> this root trans) s4-0 16384.0) ) - (process-spawn squid-whirlwind gp-0 (-> obj root trans) (-> obj nav state mesh) s4-0 :to obj) + (process-spawn squid-whirlwind gp-0 (-> this root trans) (-> this nav state mesh) s4-0 :to this) ) ) @@ -2738,19 +2740,19 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-grenade squid ((obj squid) (arg0 int) (arg1 squid-grenade-holder) (arg2 float)) +(defmethod spawn-grenade squid ((this squid) (arg0 int) (arg1 squid-grenade-holder) (arg2 float)) (squid-increment-shield (+ -0.001 (/ -1.0 (* 2.0 (the float (* (squid-num-grenades-to-shoot) 2)))))) (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) - (let ((a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg0))) + (let ((a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0))) (v1-6 (-> arg1 target-position)) ) - (set! (-> s4-1 ent) (-> obj entity)) + (set! (-> s4-1 ent) (-> this entity)) (set! (-> s4-1 charge) arg2) (set! (-> s4-1 options) (projectile-options)) (set! (-> s4-1 pos quad) (-> a0-3 quad)) - (set! (-> s4-1 notify-handle) (process->handle obj)) + (set! (-> s4-1 notify-handle) (process->handle this)) (set! (-> s4-1 owner-handle) (the-as handle #f)) - (set! (-> s4-1 ignore-handle) (process->handle obj)) + (set! (-> s4-1 ignore-handle) (process->handle this)) (let* ((a1-11 *game-info*) (a2-12 (+ (-> a1-11 attack-id) 1)) ) @@ -2760,7 +2762,7 @@ This commonly includes things such as: (set! (-> s4-1 timeout) (seconds 4)) (vector-! (-> s4-1 vel) v1-6 a0-3) ) - (set! (-> arg1 grenade) (ppointer->handle (spawn-projectile squid-grenade s4-1 obj *default-dead-pool*))) + (set! (-> arg1 grenade) (ppointer->handle (spawn-projectile squid-grenade s4-1 this *default-dead-pool*))) ) (set! (-> arg1 show-it) #f) (none) @@ -2775,7 +2777,7 @@ This commonly includes things such as: ) -(defmethod play-impact-sound squid-shot ((obj squid-shot) (arg0 projectile-options)) +(defmethod play-impact-sound squid-shot ((this squid-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -2813,27 +2815,27 @@ This commonly includes things such as: (none) ) -(defmethod init-proj-settings! squid-shot ((obj squid-shot)) +(defmethod init-proj-settings! squid-shot ((this squid-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj hit-actor?) #f) - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'squid-shot) - (set! (-> obj max-speed) 983040.0) - (set! (-> obj move) squid-shot-move) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj timeout) (seconds 0.417)) - (logior! (-> obj options) (projectile-options account-for-target-velocity)) - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj options) (projectile-options respect-invinc-time)) - (set! (-> obj invinc-time) (seconds 3.5)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'squid-shot) + (set! (-> this max-speed) 983040.0) + (set! (-> this move) squid-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.417)) + (logior! (-> this options) (projectile-options account-for-target-velocity)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this options) (projectile-options respect-invinc-time)) + (set! (-> this invinc-time) (seconds 3.5)) (none) ) -(defmethod draw-laser-sight squid-shot ((obj squid-shot)) +(defmethod draw-laser-sight squid-shot ((this squid-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 4861) (-> obj tail-pos) (-> obj starting-dir) #f #t) - (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 2048.0)) - (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> obj tail-pos) a0-3)) + (draw-beam (-> *part-id-table* 4861) (-> this tail-pos) (-> this starting-dir) #f #t) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) (t9-2 sp-launch-particles-var) (a0-4 *sp-particle-system-2d*) (a1-4 (-> *part-id-table* 4862)) @@ -2846,10 +2848,10 @@ This commonly includes things such as: (none) ) -(defmethod spawn-impact-particles squid-shot ((obj squid-shot)) +(defmethod spawn-impact-particles squid-shot ((this squid-shot)) "Spawns associated particles with the projectile if applicable" - (let* ((gp-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) (f30-0 (vector-length s5-1)) ) @@ -2880,18 +2882,18 @@ This commonly includes things such as: (none) ) -(defmethod spawn-shell-particles squid-shot ((obj squid-shot)) +(defmethod spawn-shell-particles squid-shot ((this squid-shot)) "TODO - confirm" - (let* ((s3-0 (-> obj root)) - (s4-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s3-0 trans)) 2048.0)) + (let* ((s3-0 (-> this root)) + (s4-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s3-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> s3-0 trans quad)) - (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 trans) (-> obj tail-pos)))) + (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 trans) (-> this tail-pos)))) (set! (-> *part-id-table* 4857 init-specs 4 initial-valuef) (vector-length a2-1)) (set! (-> *part-id-table* 4857 init-specs 11 initial-valuef) (the-as float #x28)) (set! (-> *part-id-table* 4857 init-specs 10 initial-valuef) -3.2) - (draw-beam (-> *part-id-table* 4857) (-> obj tail-pos) a2-1 #f #t) + (draw-beam (-> *part-id-table* 4857) (-> this tail-pos) a2-1 #f #t) ) (vector+! gp-0 gp-0 s4-0) (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) diff --git a/goal_src/jak2/levels/palace/boss/squid-states.gc b/goal_src/jak2/levels/palace/boss/squid-states.gc index 36b5b2be0a..8241c32502 100644 --- a/goal_src/jak2/levels/palace/boss/squid-states.gc +++ b/goal_src/jak2/levels/palace/boss/squid-states.gc @@ -226,13 +226,13 @@ (defstate test (squid) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (ja :num! (loop!)) - (when (>= (- (current-time) (-> self state-time)) (seconds 2)) + (when (time-elapsed? (-> self state-time) (seconds 2)) (set! (-> self driver-blend target) (- 1.0 (-> self driver-blend target))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (debug-draw (-> self first-path)) (debug-draw (-> self second-path)) @@ -495,7 +495,7 @@ :virtual #t :event squid-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self traj-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.5))))) (set! (-> self traj initial-position quad) (-> self trans quad)) (let ((v1-7 (-> self stage))) @@ -548,7 +548,7 @@ (-> self traj-dest) (parameter-ease-sqr-clamp (* 0.0011111111 (the float (- (current-time) (-> self state-time))))) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go-virtual flee) ) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 55))) @@ -679,7 +679,7 @@ :event squid-handler :enter (behavior () (squid-talker 'start-recharging) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self invincible-timer) 0) (setup-masks (-> self draw) 8192 0) (logior! (-> self draw status) (draw-control-status warp-cross-fade)) @@ -711,7 +711,7 @@ (go-virtual fly-to-shoot-spot) ) ) - ((>= (- (current-time) (-> self state-time)) (seconds 2)) + ((time-elapsed? (-> self state-time) (seconds 2)) (set! (-> self driver-blend target) 1.0) (ja-channel-push! 1 (seconds 0.1)) (ja :group! (-> self draw art-group data 34) :num! min) @@ -768,7 +768,7 @@ ) (dotimes (gp-4 6) (send-event (handle->process (-> self tentacles gp-4)) 'set-fade (-> self draw force-fade)) - (when (< (- (current-time) (-> self state-time)) (seconds 2)) + (when (not (time-elapsed? (-> self state-time) (seconds 2))) (case (-> self stage) ((1) (send-event (handle->process (-> self tentacles gp-4)) 'wrap *squid-second-pole*) @@ -911,14 +911,14 @@ :event squid-handler :enter (behavior () (squid-talker 'headbutting) - (set! (-> self state-time) (current-time)) - (set! (-> self traj-timer) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self traj-timer)) (vector-reset! (-> self residual-velocity)) (set! (-> self can-play-squid-boost) #t) ) :exit (behavior () (sound-play "squid-rush-end") - (set! (-> self rush-end-time) (current-time)) + (set-time! (-> self rush-end-time)) (let ((v1-5 (ja-group))) (when (and v1-5 (= v1-5 (-> self draw art-group data 5))) (ja-channel-push! 1 (seconds 0.05)) @@ -936,7 +936,7 @@ ) (go-virtual pre-flee) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go-virtual fly-to-shoot-spot) ) (let ((v1-17 (ja-group))) @@ -959,7 +959,7 @@ (if (< (ja-aframe-num 0) 20.0) (squid-method-42 self (-> self traj-dest)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (else (let ((v1-53 (ja-group))) @@ -983,7 +983,7 @@ (s5-1 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.017)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.017)) (let ((f0-8 (vector-vector-xz-distance-squared (-> self traj-dest) (-> self trans))) (f1-1 8192.0) ) @@ -992,7 +992,7 @@ ) (go-virtual fly-to-shoot-spot) ) - (when (and (>= (- (current-time) (-> self state-time)) (seconds 0.017)) (-> self mesh-forced)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.017)) (-> self mesh-forced)) (vector-reset! (-> self residual-velocity)) (go-virtual fly-to-shoot-spot) ) @@ -1061,7 +1061,7 @@ :event squid-handler :enter (behavior () (squid-talker 'shooting) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self stop-shooting) #f) (set! (-> self traj-timer) 0) (set! (-> self tentacle-base-rotation-speed target) 1.0) @@ -1093,13 +1093,13 @@ ) ) (squid-method-43 self (squid-method-42 self (new 'stack-no-clear 'vector)) 9.102222 0.75) - (when (or (>= (- (current-time) (-> self state-time)) (squid-whirlwind-time)) (-> self stop-shooting)) + (when (or (time-elapsed? (-> self state-time) (squid-whirlwind-time)) (-> self stop-shooting)) (vector-reset! (-> self residual-velocity)) (go-virtual fly-to-shoot-spot) ) - (when (>= (- (current-time) (-> self traj-timer)) (seconds 0.7)) + (when (time-elapsed? (-> self traj-timer) (seconds 0.7)) (spawn-whirlwind self) - (set! (-> self traj-timer) (current-time)) + (set-time! (-> self traj-timer)) ) ) :code sleep-code @@ -1359,7 +1359,7 @@ (else (ja-channel-push! 1 (seconds 0.15)) (ja :group! (-> self draw art-group data 7) :num! min) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -1466,7 +1466,7 @@ ((let ((v1-77 (ja-group))) (and v1-77 (= v1-77 (-> self draw art-group data 17))) ) - (if (or (>= (- (current-time) (-> self state-time)) (seconds 3)) + (if (or (time-elapsed? (-> self state-time) (seconds 3)) (or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) ) (ja :num! (seek!)) @@ -1485,7 +1485,7 @@ 0 ) ) - (if (and (or (>= (- (current-time) (-> self state-time)) (seconds 3)) + (if (and (or (time-elapsed? (-> self state-time) (seconds 3)) (or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) ) (ja-done? 0) @@ -1528,7 +1528,7 @@ (else (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data 16) :num! min) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self next-gun) 1) ) ) @@ -1618,7 +1618,7 @@ :enter (behavior () (set-setting! 'music 'danger4 0.0 0) (set! (-> self driver-blend target) 1.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self hud) (ppointer->handle (process-spawn hud-squid :init hud-init-by-other :to self))) (vector+! (-> self trans) (-> self trans) (new 'static 'vector :x 101171.2 :y 45056.0 :z 31047.68)) (let ((v1-14 (squid-method-42 self (new 'stack-no-clear 'vector)))) @@ -1635,7 +1635,7 @@ ) :trans (behavior () (ja :num! (loop!)) - (when (>= (- (current-time) (-> self state-time)) (seconds 3)) + (when (time-elapsed? (-> self state-time) (seconds 3)) ) ) :code sleep-code diff --git a/goal_src/jak2/levels/palace/cable/palcab-obs.gc b/goal_src/jak2/levels/palace/cable/palcab-obs.gc index 3a91b14f3d..7b012731b4 100644 --- a/goal_src/jak2/levels/palace/cable/palcab-obs.gc +++ b/goal_src/jak2/levels/palace/cable/palcab-obs.gc @@ -94,7 +94,7 @@ ) ) ) - (set! (-> self no-collision-timer) (current-time)) + (set-time! (-> self no-collision-timer)) (let ((v1-19 (-> self root root-prim))) (set! (-> v1-19 prim-core collide-as) (collide-spec)) (set! (-> v1-19 prim-core collide-with) (collide-spec)) @@ -108,13 +108,11 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (when (and (nonzero? (-> self no-collision-timer)) - (>= (- (current-time) (-> self no-collision-timer)) - (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) - ) + (time-elapsed? (-> self no-collision-timer) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout))) ) (let ((v1-7 (-> self root root-prim))) (set! (-> v1-7 prim-core collide-as) (-> self root backup-collide-as)) @@ -185,14 +183,14 @@ ) ) ) - (when (>= (- (current-time) (-> self state-time)) (-> self sound-timer)) + (when (time-elapsed? (-> self state-time) (-> self sound-timer)) (sound-play "cab-fan-blade") (sound-stop (-> self sound-id)) (sound-play "pal-fan-buzz" :id (-> self sound-id)) (set! (-> self sound-timer) (the-as time-frame (the int (* 300.0 (/ 21845.334 (fabs (-> self rotate-speed)))))) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (update! (-> self sound)) (rider-post) @@ -201,26 +199,26 @@ ) ;; WARN: Return type mismatch process-drawable vs pal-electric-fan. -(defmethod relocate pal-electric-fan ((obj pal-electric-fan) (arg0 int)) +(defmethod relocate pal-electric-fan ((this pal-electric-fan) (arg0 int)) (dotimes (v1-0 3) (dotimes (a2-0 6) - (if (nonzero? (-> (the-as pal-electric-fan (&+ obj (* 112 v1-0))) poles 0 rings a2-0 lightning)) - (&+! (-> (the-as pal-electric-fan (&+ obj (* 112 v1-0))) poles 0 rings a2-0 lightning) arg0) + (if (nonzero? (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning)) + (&+! (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning) arg0) ) ) ) - (the-as pal-electric-fan ((method-of-type process-drawable relocate) obj arg0)) + (the-as pal-electric-fan ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-electric-fan ((obj pal-electric-fan) (arg0 entity-actor)) +(defmethod init-from-entity! pal-electric-fan ((this pal-electric-fan) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -277,17 +275,17 @@ This commonly includes things such as: ) ) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-electric-fan" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (let ((a0-32 (-> obj entity))) - (set! (-> obj rotate-speed) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((a0-32 (-> this entity))) + (set! (-> this rotate-speed) ((method-of-object a0-32 get-property-value-float) a0-32 'rotspeed @@ -303,12 +301,12 @@ This commonly includes things such as: (a0-34 (+ (-> v1-52 attack-id) 1)) ) (set! (-> v1-52 attack-id) a0-34) - (set! (-> obj attack-id) a0-34) + (set! (-> this attack-id) a0-34) ) - (set! (-> obj no-collision-timer) 0) - (let ((f1-7 (lerp-scale 55.0 35.0 (fabs (-> obj rotate-speed)) 10922.667 18204.445))) - (set! (-> obj sound-timer) - (the-as time-frame (the int (* 300.0 (/ (* 182.04445 f1-7) (fabs (-> obj rotate-speed)))))) + (set! (-> this no-collision-timer) 0) + (let ((f1-7 (lerp-scale 55.0 35.0 (fabs (-> this rotate-speed)) 10922.667 18204.445))) + (set! (-> this sound-timer) + (the-as time-frame (the int (* 300.0 (/ (* 182.04445 f1-7) (fabs (-> this rotate-speed)))))) ) ) (let ((s5-2 @@ -336,15 +334,15 @@ This commonly includes things such as: (f28-0 216.0) ) (dotimes (s4-2 3) - (let ((s3-2 (-> obj poles s4-2))) - (if (< 0.0 (-> obj rotate-speed)) + (let ((s3-2 (-> this poles s4-2))) + (if (< 0.0 (-> this rotate-speed)) (set! (-> s3-2 z-rotate) (* 21954.56 (the float s4-2))) (set! (-> s3-2 z-rotate) (* 21736.107 (the float s4-2))) ) (dotimes (s2-1 6) (let ((s1-1 (-> s3-2 rings s2-1))) (let ((s0-0 (+ s2-1 1))) - (set! (-> s1-1 lightning) (new 'process 'lightning-control s5-2 obj 0.0)) + (set! (-> s1-1 lightning) (new 'process 'lightning-control s5-2 this 0.0)) (set! (-> s1-1 dist) (+ 40960.0 (* f30-0 (the float s0-0)))) (set! (-> s1-1 radius) (+ 3276.8 (* 4505.6 (/ (the float (* (* s0-0 s0-0) s0-0)) f28-0)))) ) @@ -357,17 +355,17 @@ This commonly includes things such as: ) ) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "fan-blade-motor" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "fan-blade-motor" :fo-max 70) (-> this root trans)) ) - (set! (-> obj sound-id) (new-sound-id)) - (let ((a0-40 (-> obj skel root-channel 0))) - (set! (-> a0-40 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> this sound-id) (new-sound-id)) + (let ((a0-40 (-> this skel root-channel 0))) + (set! (-> a0-40 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-40 frame-num) 0.0) - (joint-control-channel-group! a0-40 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-40 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -445,14 +443,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-cable-nut ((obj pal-cable-nut) (arg0 entity-actor)) +(defmethod init-from-entity! pal-cable-nut ((this pal-cable-nut) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -480,16 +478,16 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-18 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj root rider-max-momentum) 8192.0) - (process-drawable-from-entity! obj arg0) + (set! (-> this root rider-max-momentum) 8192.0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-cable-nut" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((a1-9 (new 'stack-no-clear 'sync-info-params))) (let ((v1-27 0)) (if #t @@ -498,36 +496,36 @@ This commonly includes things such as: (set! (-> a1-9 sync-type) 'sync-linear) (set! (-> a1-9 sync-flags) (the-as sync-flags v1-27)) ) - (set! (-> a1-9 entity) (-> obj entity)) + (set! (-> a1-9 entity) (-> this entity)) (set! (-> a1-9 period) (the-as uint 3600)) (set! (-> a1-9 percent) 0.0) - (initialize! (-> obj sync) a1-9) + (initialize! (-> this sync) a1-9) ) - (set! (-> obj hold-percentage) 0.3) - (set! (-> obj wiggle-percentage) 0.8) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (let* ((f0-15 (* 6.0 (get-current-phase-no-mod (-> obj sync)))) + (set! (-> this hold-percentage) 0.3) + (set! (-> this wiggle-percentage) 0.8) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (let* ((f0-15 (* 6.0 (get-current-phase-no-mod (-> this sync)))) (f1-4 (the float (the int f0-15))) (f0-16 (- f0-15 f1-4)) - (f2-4 (the float (sar (shl (the int (* 10922.667 (+ f1-4 (/ f0-16 (-> obj hold-percentage))))) 48) 48))) + (f2-4 (the float (sar (shl (the int (* 10922.667 (+ f1-4 (/ f0-16 (-> this hold-percentage))))) 48) 48))) (f1-8 (the float (sar (shl (the int (* 10922.667 f1-4)) 48) 48))) ) - (if (< (-> obj hold-percentage) f0-16) + (if (< (-> this hold-percentage) f0-16) (quaternion-rotate-local-z! - (-> obj root quat) - (-> obj init-quat) + (-> this root quat) + (-> this init-quat) (the float (sar (shl (the int (+ 10922.667 f1-8)) 48) 48)) ) - (quaternion-rotate-local-z! (-> obj root quat) (-> obj init-quat) f2-4) + (quaternion-rotate-local-z! (-> this root quat) (-> this init-quat) f2-4) ) ) - (let ((a0-26 (-> obj skel root-channel 0))) - (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-26 (-> this skel root-channel 0))) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-26 frame-num) 0.0) - (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -540,10 +538,10 @@ This commonly includes things such as: ) -(defmethod spawn-impact-particles pal-rot-gun-shot ((obj pal-rot-gun-shot)) +(defmethod spawn-impact-particles pal-rot-gun-shot ((this pal-rot-gun-shot)) "Spawns associated particles with the projectile if applicable" - (let* ((gp-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) (f30-0 (vector-length s5-1)) ) @@ -588,14 +586,14 @@ This commonly includes things such as: (none) ) -(defmethod spawn-shell-particles pal-rot-gun-shot ((obj pal-rot-gun-shot)) +(defmethod spawn-shell-particles pal-rot-gun-shot ((this pal-rot-gun-shot)) "TODO - confirm" - (let* ((s3-0 (-> obj root)) - (s5-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s3-0 trans)) 2048.0)) + (let* ((s3-0 (-> this root)) + (s5-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s3-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> s3-0 trans quad)) - (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 trans) (-> obj tail-pos))) + (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 trans) (-> this tail-pos))) (f30-0 (-> *part-id-table* 606 init-specs 4 initial-valuef)) (s3-1 (-> *part-id-table* 606 init-specs 11 initial-valuef)) (f28-0 (-> *part-id-table* 606 init-specs 10 initial-valuef)) @@ -603,7 +601,7 @@ This commonly includes things such as: (set! (-> *part-id-table* 606 init-specs 4 initial-valuef) (vector-length a2-1)) (set! (-> *part-id-table* 606 init-specs 11 initial-valuef) (the-as float #x28)) (set! (-> *part-id-table* 606 init-specs 10 initial-valuef) -3.2) - (draw-beam (-> *part-id-table* 606) (-> obj tail-pos) a2-1 #f #t) + (draw-beam (-> *part-id-table* 606) (-> this tail-pos) a2-1 #f #t) (set! (-> *part-id-table* 606 init-specs 4 initial-valuef) f30-0) (set! (-> *part-id-table* 606 init-specs 11 initial-valuef) s3-1) (set! (-> *part-id-table* 606 init-specs 10 initial-valuef) f28-0) @@ -649,14 +647,14 @@ This commonly includes things such as: (none) ) -(defmethod play-impact-sound pal-rot-gun-shot ((obj pal-rot-gun-shot) (arg0 projectile-options)) +(defmethod play-impact-sound pal-rot-gun-shot ((this pal-rot-gun-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (sound-play "rot-gun-fire" :position (-> obj root trans)) + (sound-play "rot-gun-fire" :position (-> this root trans)) ) ((= v1-0 (projectile-options lose-altitude)) - (sound-play "pal-rot-gun-sho" :position (-> obj root trans)) + (sound-play "pal-rot-gun-sho" :position (-> this root trans)) ) ) ) @@ -691,9 +689,9 @@ This commonly includes things such as: (none) ) -(defmethod init-proj-collision! pal-rot-gun-shot ((obj pal-rot-gun-shot)) +(defmethod init-proj-collision! pal-rot-gun-shot ((this pal-rot-gun-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -716,22 +714,22 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 (none) ) -(defmethod init-proj-settings! pal-rot-gun-shot ((obj pal-rot-gun-shot)) +(defmethod init-proj-settings! pal-rot-gun-shot ((this pal-rot-gun-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'pal-rot-gun-shot) - (set! (-> obj move) pal-rot-gun-shot-move) - (set! (-> obj max-speed) 630784.0) - (set! (-> obj timeout) (seconds 1.427)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'pal-rot-gun-shot) + (set! (-> this move) pal-rot-gun-shot-move) + (set! (-> this max-speed) 630784.0) + (set! (-> this timeout) (seconds 1.427)) 0 (none) ) @@ -788,7 +786,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self fire-timer) (current-time)) + (set-time! (-> self fire-timer)) (set! (-> self gun-index) 0) 0 ) @@ -797,7 +795,7 @@ This commonly includes things such as: (seek! (-> self spin-rate) (-> self spin-rate-final) (* 3640.889 (seconds-per-frame))) (quaternion-rotate-z! (-> self root quat) (-> self root quat) (* (-> self spin-rate) (seconds-per-frame))) (let ((f30-0 1.0)) - (when (>= (- (current-time) (-> self fire-timer)) (seconds 0.05)) + (when (time-elapsed? (-> self fire-timer) (seconds 0.05)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (let ((s5-0 (-> self node-list data (+ (* (-> self gun-index) 2) 4)))) (vector<-cspace! (the-as vector (-> gp-0 vector)) s5-0) @@ -808,7 +806,7 @@ This commonly includes things such as: (pal-rot-gun-method-23 self gp-0) ) (set! (-> self gun-index) (- 1 (-> self gun-index))) - (set! (-> self fire-timer) (current-time)) + (set-time! (-> self fire-timer)) (set! f30-0 1.2) ) (let* ((f0-10 (the float (sar (shl (the int (quaternion-z-angle (-> self root quat))) 48) 48))) @@ -886,20 +884,20 @@ This commonly includes things such as: ) ) -(defmethod pal-rot-gun-method-23 pal-rot-gun ((obj pal-rot-gun) (arg0 matrix)) +(defmethod pal-rot-gun-method-23 pal-rot-gun ((this pal-rot-gun) (arg0 matrix)) (let ((v1-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((a2-0 (-> arg0 vector)) (a1-1 (-> arg0 vector 1)) ) - (set! (-> v1-0 ent) (-> obj entity)) + (set! (-> v1-0 ent) (-> this entity)) (set! (-> v1-0 charge) 1.0) (set! (-> v1-0 options) (projectile-options)) (set! (-> v1-0 pos quad) (-> a2-0 0 quad)) (set! (-> v1-0 vel quad) (-> a1-1 quad)) ) - (set! (-> v1-0 notify-handle) (process->handle obj)) + (set! (-> v1-0 notify-handle) (process->handle this)) (set! (-> v1-0 owner-handle) (the-as handle #f)) - (set! (-> v1-0 ignore-handle) (process->handle obj)) + (set! (-> v1-0 ignore-handle) (process->handle this)) (let* ((a1-9 *game-info*) (a2-12 (+ (-> a1-9 attack-id) 1)) ) @@ -907,51 +905,51 @@ This commonly includes things such as: (set! (-> v1-0 attack-id) a2-12) ) (set! (-> v1-0 timeout) (seconds 4)) - (ppointer->handle (spawn-projectile pal-rot-gun-shot v1-0 obj *default-dead-pool*)) + (ppointer->handle (spawn-projectile pal-rot-gun-shot v1-0 this *default-dead-pool*)) ) (none) ) -(defmethod deactivate pal-rot-gun ((obj pal-rot-gun)) - (sound-stop (-> obj sound-id)) - (sound-stop (-> obj shot-sound-id)) - ((the-as (function process-drawable none) (find-parent-method pal-rot-gun 10)) obj) +(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) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-rot-gun ((obj pal-rot-gun) (arg0 entity-actor)) +(defmethod init-from-entity! pal-rot-gun ((this pal-rot-gun) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-rot-gun" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (let ((s5-2 (-> obj root quat))) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((s5-2 (-> this root quat))) (quaternion-rotate-local-x! s5-2 s5-2 364.0889) (quaternion-rotate-local-z! s5-2 s5-2 16384.0) - (quaternion-copy! (-> obj init-quat) s5-2) + (quaternion-copy! (-> this init-quat) s5-2) ) - (set! (-> obj spin-rate) 0.0) - (set! (-> obj spin-rate-final) 16384.0) - (set! (-> obj prev-z-rot) 65353.957) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj shot-sound-id) (new-sound-id)) - (let ((a0-9 (-> obj skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> this spin-rate) 0.0) + (set! (-> this spin-rate-final) 16384.0) + (set! (-> this prev-z-rot) 65353.957) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this shot-sound-id) (new-sound-id)) + (let ((a0-9 (-> this skel root-channel 0))) + (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -989,23 +987,23 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-windmill ((obj pal-windmill) (arg0 entity-actor)) +(defmethod init-from-entity! pal-windmill ((this pal-windmill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-windmill" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1068,14 +1066,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-flip-step ((obj pal-flip-step) (arg0 entity-actor)) +(defmethod init-from-entity! pal-flip-step ((this pal-flip-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1095,49 +1093,49 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-flip-step" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj task-node) (task-node-by-name (the-as string ((method-of-type res-lump get-property-struct) - arg0 - 'task-name - 'interp - -1000000000.0 - "palace-cable-resolution" - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - ) + (set! (-> this task-node) (task-node-by-name (the-as string ((method-of-type res-lump get-property-struct) + arg0 + 'task-name + 'interp + -1000000000.0 + "palace-cable-resolution" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) ) (cond - ((and (-> obj task-node) - (logtest? (-> obj task-node flags) (game-task-node-flag closed)) + ((and (-> this task-node) + (logtest? (-> this task-node flags) (game-task-node-flag closed)) (not (task-node-closed? (game-task-node nest-boss-resolution))) ) - (let ((a0-17 (-> obj skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-17 (-> this skel root-channel 0))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-17 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (go (method-of-object obj fallen)) + (go (method-of-object this fallen)) ) (else - (let ((a0-18 (-> obj skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-18 (-> this skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) diff --git a/goal_src/jak2/levels/palace/pal-obs.gc b/goal_src/jak2/levels/palace/pal-obs.gc index 0cf9e58641..bf897a418f 100644 --- a/goal_src/jak2/levels/palace/pal-obs.gc +++ b/goal_src/jak2/levels/palace/pal-obs.gc @@ -89,14 +89,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-falling-plat ((obj pal-falling-plat) (arg0 entity-actor)) +(defmethod init-from-entity! pal-falling-plat ((this pal-falling-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -144,15 +144,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-24 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-falling-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -172,7 +172,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-ent-door ((obj pal-ent-door) (arg0 entity-actor)) +(defmethod init-from-entity! pal-ent-door ((this pal-ent-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -180,8 +180,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -197,20 +197,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-ent-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj open-frame) 20.0) - (set! (-> obj sound-open-loop) (static-sound-spec "door-slide-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "door-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "door-slide-cls")) - (set! (-> obj sound-close-stop) (static-sound-spec "door-close-hit")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this open-frame) 20.0) + (set! (-> this sound-open-loop) (static-sound-spec "door-slide-open")) + (set! (-> this sound-open-stop) (static-sound-spec "door-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "door-slide-cls")) + (set! (-> this sound-close-stop) (static-sound-spec "door-close-hit")) + (go (method-of-object this close) #t) (none) ) @@ -325,8 +325,8 @@ This commonly includes things such as: :post #f ) -(defmethod pal-grind-ring-center-method-29 pal-grind-ring-center ((obj pal-grind-ring-center)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod pal-grind-ring-center-method-29 pal-grind-ring-center ((this pal-grind-ring-center)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -345,33 +345,33 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-grind-ring-center ((obj pal-grind-ring-center) (arg0 entity-actor)) +(defmethod init-from-entity! pal-grind-ring-center ((this pal-grind-ring-center) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (pal-grind-ring-center-method-29 obj) - (process-drawable-from-entity! obj arg0) + (pal-grind-ring-center-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-grind-ring-center" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask collectable)) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask collectable)) + (go (method-of-object this idle)) (none) ) @@ -496,8 +496,8 @@ This commonly includes things such as: :post transform-post ) -(defmethod pal-grind-ring-method-29 pal-grind-ring ((obj pal-grind-ring)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod pal-grind-ring-method-29 pal-grind-ring ((this pal-grind-ring)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -517,32 +517,32 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-grind-ring ((obj pal-grind-ring) (arg0 entity-actor)) +(defmethod init-from-entity! pal-grind-ring ((this pal-grind-ring) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (pal-grind-ring-method-29 obj) - (process-drawable-from-entity! obj arg0) + (pal-grind-ring-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-grind-ring" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask collectable)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1131) obj)) - (process-spawn pal-grind-ring-center arg0 :to obj) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask collectable)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1131) this)) + (process-spawn pal-grind-ring-center arg0 :to this) + (go (method-of-object this idle)) (none) ) @@ -655,8 +655,8 @@ This commonly includes things such as: ) ) -(defmethod pal-ent-glass-method-29 pal-ent-glass ((obj pal-ent-glass)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod pal-ent-glass-method-29 pal-ent-glass ((this pal-ent-glass)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -676,36 +676,36 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod pal-ent-glass-method-30 pal-ent-glass ((obj pal-ent-glass)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod pal-ent-glass-method-30 pal-ent-glass ((this pal-ent-glass)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-ent-glass ((obj pal-ent-glass) (arg0 entity-actor)) +(defmethod init-from-entity! pal-ent-glass ((this pal-ent-glass) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (pal-ent-glass-method-29 obj) - (process-drawable-from-entity! obj arg0) + (pal-ent-glass-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-ent-glass" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (pal-ent-glass-method-30 obj) + (pal-ent-glass-method-30 this) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -718,7 +718,7 @@ This commonly includes things such as: ) -(defmethod play-impact-sound palent-turret-shot ((obj palent-turret-shot) (arg0 projectile-options)) +(defmethod play-impact-sound palent-turret-shot ((this palent-turret-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -819,8 +819,8 @@ This commonly includes things such as: ) ) -(defmethod palent-turret-method-28 palent-turret ((obj palent-turret)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod palent-turret-method-28 palent-turret ((this palent-turret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -860,33 +860,33 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! palent-turret ((obj palent-turret) (arg0 entity-actor)) +(defmethod init-from-entity! palent-turret ((this palent-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (palent-turret-method-28 obj) - (process-drawable-from-entity! obj arg0) + (palent-turret-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-palent-turret" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-5 (-> obj node-list data 4))) + (let ((a0-5 (-> this node-list data 4))) (set! (-> a0-5 param0) palent-turret-callback) - (set! (-> a0-5 param1) obj) + (set! (-> a0-5 param1) this) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1008,8 +1008,8 @@ This commonly includes things such as: ) ) -(defmethod pal-breakable-window-method-29 pal-breakable-window ((obj pal-breakable-window)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod pal-breakable-window-method-29 pal-breakable-window ((this pal-breakable-window)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1029,38 +1029,38 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod pal-breakable-window-method-30 pal-breakable-window ((obj pal-breakable-window)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod pal-breakable-window-method-30 pal-breakable-window ((this pal-breakable-window)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-breakable-window ((obj pal-breakable-window) (arg0 entity-actor)) +(defmethod init-from-entity! pal-breakable-window ((this pal-breakable-window) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (pal-breakable-window-method-29 obj) - (process-drawable-from-entity! obj arg0) + (pal-breakable-window-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-breakable-window" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (pal-breakable-window-method-30 obj) + (pal-breakable-window-method-30 this) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/palace/roof/palroof-obs.gc b/goal_src/jak2/levels/palace/roof/palroof-obs.gc index 5c8d8b4496..fc8e10b14e 100644 --- a/goal_src/jak2/levels/palace/roof/palroof-obs.gc +++ b/goal_src/jak2/levels/palace/roof/palroof-obs.gc @@ -121,14 +121,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-prong ((obj pal-prong) (arg0 entity-actor)) +(defmethod init-from-entity! pal-prong ((this pal-prong) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -154,18 +154,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-prong" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1111) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1111) this)) (if (task-node-closed? (game-task-node palace-boss-resolution)) - (go (method-of-object obj broken)) - (go (method-of-object obj idle)) + (go (method-of-object this broken)) + (go (method-of-object this idle)) ) (none) ) diff --git a/goal_src/jak2/levels/palace/throne/palace-scenes.gc b/goal_src/jak2/levels/palace/throne/palace-scenes.gc index 71f595fd14..c1808f2072 100644 --- a/goal_src/jak2/levels/palace/throne/palace-scenes.gc +++ b/goal_src/jak2/levels/palace/throne/palace-scenes.gc @@ -40,14 +40,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! throne-throne ((obj throne-throne) (entity entity-actor)) +(defmethod init-from-entity! throne-throne ((this throne-throne) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 1) 0))) (set! (-> cshape total-prims) (the-as uint 2)) (set! (-> prim-group prim-core collide-as) (collide-spec obstacle)) @@ -68,15 +68,15 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-throne-throne" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/ruins/breakable-wall.gc b/goal_src/jak2/levels/ruins/breakable-wall.gc index d74471808b..5609d22bde 100644 --- a/goal_src/jak2/levels/ruins/breakable-wall.gc +++ b/goal_src/jak2/levels/ruins/breakable-wall.gc @@ -221,29 +221,29 @@ ;; WARN: Return type mismatch float vs none. -(defmethod ruins-breakable-wall-method-30 ruins-breakable-wall ((obj ruins-breakable-wall) (arg0 symbol)) +(defmethod ruins-breakable-wall-method-30 ruins-breakable-wall ((this ruins-breakable-wall) (arg0 symbol)) (case arg0 (('hit) - (-> obj draw bounds w) - (set! (-> obj draw lod-set max-lod) 2) - (set! (-> obj draw force-lod) 2) - (set! (-> obj draw bounds w) 573440.0) + (-> this draw bounds w) + (set! (-> this draw lod-set max-lod) 2) + (set! (-> this draw force-lod) 2) + (set! (-> this draw bounds w) 573440.0) ) (('broken) - (-> obj draw bounds w) - (set! (-> obj draw lod-set max-lod) 2) - (set! (-> obj draw force-lod) 2) - (set! (-> obj draw bounds quad) (-> obj side break-bounds-sphere quad)) - (let ((v1-12 (-> obj side break-bounds-joint))) + (-> this draw bounds w) + (set! (-> this draw lod-set max-lod) 2) + (set! (-> this draw force-lod) 2) + (set! (-> this draw bounds quad) (-> this side break-bounds-sphere quad)) + (let ((v1-12 (-> this side break-bounds-joint))) (if (>= v1-12 0) - (set! (-> obj draw origin-joint-index) (the-as uint v1-12)) + (set! (-> this draw origin-joint-index) (the-as uint v1-12)) ) ) - (let ((v1-14 (-> obj root root-prim)) - (a1-15 (-> obj side break-prim-mask)) + (let ((v1-14 (-> this root root-prim)) + (a1-15 (-> this side break-prim-mask)) ) - (set! (-> v1-14 local-sphere quad) (-> obj side break-root-prim-sphere quad)) - (let ((a0-2 (-> obj side break-root-prim-joint))) + (set! (-> v1-14 local-sphere quad) (-> this side break-root-prim-sphere quad)) + (let ((a0-2 (-> this side break-root-prim-joint))) (if (>= a0-2 0) (set! (-> v1-14 transform-index) a0-2) ) @@ -415,22 +415,22 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-breakable-wall ((obj ruins-breakable-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ruins-breakable-wall ((this ruins-breakable-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) - (set! (-> obj side) #f) - (set! (-> obj nav-mesh) #f) - (let ((v1-5 (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0))) - (set! (-> obj info) (-> *rbw-infos* v1-5)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) + (set! (-> this side) #f) + (set! (-> this nav-mesh) #f) + (let ((v1-5 (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0))) + (set! (-> this info) (-> *rbw-infos* v1-5)) (cond ((zero? v1-5) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) (set! (-> s4-0 total-prims) (the-as uint 5)) @@ -466,11 +466,11 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-22 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) ) ((= (the-as uint v1-5) 1) - (let ((s4-1 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-1 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-1 penetrated-by) (penetrate)) (let ((s3-1 (new 'process 'collide-shape-prim-group s4-1 (the-as uint 3) 0))) (set! (-> s4-1 total-prims) (the-as uint 4)) @@ -501,11 +501,11 @@ This commonly includes things such as: (set! (-> s4-1 backup-collide-as) (-> v1-38 prim-core collide-as)) (set! (-> s4-1 backup-collide-with) (-> v1-38 prim-core collide-with)) ) - (set! (-> obj root) s4-1) + (set! (-> this root) s4-1) ) ) ((= (the-as uint v1-5) 2) - (let ((s4-2 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-2 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-2 penetrated-by) (penetrate)) (let ((s3-2 (new 'process 'collide-shape-prim-group s4-2 (the-as uint 3) 0))) (set! (-> s4-2 total-prims) (the-as uint 4)) @@ -536,11 +536,11 @@ This commonly includes things such as: (set! (-> s4-2 backup-collide-as) (-> v1-54 prim-core collide-as)) (set! (-> s4-2 backup-collide-with) (-> v1-54 prim-core collide-with)) ) - (set! (-> obj root) s4-2) + (set! (-> this root) s4-2) ) ) ((= (the-as uint v1-5) 3) - (let ((s4-3 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-3 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-3 penetrated-by) (penetrate)) (let ((s3-3 (new 'process 'collide-shape-prim-group s4-3 (the-as uint 2) 0))) (set! (-> s4-3 total-prims) (the-as uint 3)) @@ -566,11 +566,11 @@ This commonly includes things such as: (set! (-> s4-3 backup-collide-as) (-> v1-68 prim-core collide-as)) (set! (-> s4-3 backup-collide-with) (-> v1-68 prim-core collide-with)) ) - (set! (-> obj root) s4-3) + (set! (-> this root) s4-3) ) ) ((= (the-as uint v1-5) 4) - (let ((s4-4 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-4 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-4 penetrated-by) (penetrate)) (let ((s3-4 (new 'process 'collide-shape-prim-group s4-4 (the-as uint 3) 0))) (set! (-> s4-4 total-prims) (the-as uint 4)) @@ -601,11 +601,11 @@ This commonly includes things such as: (set! (-> s4-4 backup-collide-as) (-> v1-84 prim-core collide-as)) (set! (-> s4-4 backup-collide-with) (-> v1-84 prim-core collide-with)) ) - (set! (-> obj root) s4-4) + (set! (-> this root) s4-4) ) ) (else - (let ((s4-5 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-5 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-5 penetrated-by) (penetrate)) (let ((s3-5 (new 'process 'collide-shape-prim-group s4-5 (the-as uint 2) 0))) (set! (-> s4-5 total-prims) (the-as uint 3)) @@ -631,24 +631,24 @@ This commonly includes things such as: (set! (-> s4-5 backup-collide-as) (-> v1-98 prim-core collide-as)) (set! (-> s4-5 backup-collide-with) (-> v1-98 prim-core collide-with)) ) - (set! (-> obj root) s4-5) + (set! (-> this root) s4-5) ) ) ) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton-by-name obj (-> obj info skel-group)) - (case (-> obj entity extra perm user-uint8 0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton-by-name this (-> this info skel-group)) + (case (-> this entity extra perm user-uint8 0) ((1) - (set! (-> obj side) (-> obj info sides 0)) - (go (method-of-object obj broken)) + (set! (-> this side) (-> this info sides 0)) + (go (method-of-object this broken)) ) ((2) - (set! (-> obj side) (-> obj info sides 1)) - (go (method-of-object obj broken)) + (set! (-> this side) (-> this info sides 1)) + (go (method-of-object this broken)) ) (else - (go (method-of-object obj unbroken)) + (go (method-of-object this unbroken)) ) ) (none) diff --git a/goal_src/jak2/levels/ruins/mechtest-obs.gc b/goal_src/jak2/levels/ruins/mechtest-obs.gc index 1cc5ba4ba5..287741ab43 100644 --- a/goal_src/jak2/levels/ruins/mechtest-obs.gc +++ b/goal_src/jak2/levels/ruins/mechtest-obs.gc @@ -284,7 +284,7 @@ ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (if (handle->process (-> self carry other)) (drop-impl! (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) @@ -296,14 +296,14 @@ ) :trans (behavior () (when (or (and (logtest? (-> self root status) (collide-status on-surface)) (< 0.8 (-> self root surface-angle))) - (>= (- (current-time) (-> self state-time)) (seconds 5)) + (time-elapsed? (-> self state-time) (seconds 5)) ) (vector-reset! (-> self root transv)) (set! (-> self root root-prim local-sphere w) (-> self carry backup-radius)) (cond ((and (-> self reset-on-land?) (and (or (< 12288.0 (vector-vector-distance (-> self drop-point) (-> self root trans))) - (>= (- (current-time) (-> self state-time)) (seconds 5)) + (time-elapsed? (-> self state-time) (seconds 5)) ) (and (-> self next-entity) (not (logtest? (-> self next-entity extra perm status) (entity-perm-status subtask-complete))) @@ -344,7 +344,7 @@ (go-virtual wait) ) ((or (< 12288.0 (vector-vector-distance (-> self drop-point) (-> self root trans))) - (>= (- (current-time) (-> self state-time)) (seconds 5)) + (time-elapsed? (-> self state-time) (seconds 5)) ) (sound-play "block-break") (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000))) @@ -440,14 +440,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! throwblock ((obj throwblock) (arg0 entity-actor)) +(defmethod init-from-entity! throwblock ((this throwblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -472,35 +472,35 @@ This commonly includes things such as: ) (set! (-> s4-0 max-iteration-count) (the-as uint 4)) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-throwblock" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (mem-copy! (the-as pointer (-> obj origin)) (the-as pointer (-> obj root trans)) 48) - (set! (-> obj allow-drag?) #f) - (set! (-> obj reset-on-land?) #t) + (mem-copy! (the-as pointer (-> this origin)) (the-as pointer (-> this root trans)) 48) + (set! (-> this allow-drag?) #f) + (set! (-> this reset-on-land?) #t) (let* ((v1-18 *game-info*) (a0-16 (+ (-> v1-18 attack-id) 1)) ) (set! (-> v1-18 attack-id) a0-16) - (set! (-> obj attack-id) a0-16) + (set! (-> this attack-id) a0-16) ) - (set! (-> obj hit-something?) #f) - (set! (-> obj next-entity) (entity-actor-lookup (-> obj entity) 'next-actor 0)) - (let ((v1-20 (new 'process 'carry-info obj 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0)) + (set! (-> this hit-something?) #f) + (set! (-> this next-entity) (entity-actor-lookup (-> this entity) 'next-actor 0)) + (let ((v1-20 (new 'process 'carry-info this 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0)) ) (set! (-> v1-20 max-distance) 16384.0) (set! (-> v1-20 min-pull) 2048.0) (set! (-> v1-20 max-pull) 6963.2) (set! (-> v1-20 carry-radius) 6144.0) (set! (-> v1-20 mode) (carry-mode mech-carry)) - (set! (-> obj carry) v1-20) + (set! (-> this carry) v1-20) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -519,14 +519,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pushblock ((obj pushblock) (arg0 entity-actor)) +(defmethod init-from-entity! pushblock ((this pushblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -550,36 +550,43 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) (set! (-> s4-0 max-iteration-count) (the-as uint 4)) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pushblock" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (mem-copy! (the-as pointer (-> obj origin)) (the-as pointer (-> obj root trans)) 48) - (set! (-> obj reset-on-land?) #f) - (set! (-> obj allow-drag?) #t) + (mem-copy! (the-as pointer (-> this origin)) (the-as pointer (-> this root trans)) 48) + (set! (-> this reset-on-land?) #f) + (set! (-> this allow-drag?) #t) (let* ((v1-17 *game-info*) (a0-15 (+ (-> v1-17 attack-id) 1)) ) (set! (-> v1-17 attack-id) a0-15) - (set! (-> obj attack-id) a0-15) + (set! (-> this attack-id) a0-15) ) - (set! (-> obj next-entity) #f) - (get-nav-control obj (the-as nav-mesh #f)) - (let ((v1-19 - (new 'process 'carry-info obj 3 (new 'static 'vector :y 819.2 :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0) - ) + (set! (-> this next-entity) #f) + (get-nav-control this (the-as nav-mesh #f)) + (let ((v1-19 (new + 'process + 'carry-info + this + 3 + (new 'static 'vector :y 819.2 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + 0.0 + ) + ) ) (set! (-> v1-19 max-distance) 22528.0) (set! (-> v1-19 min-pull) 10240.0) (set! (-> v1-19 max-pull) 14336.0) (set! (-> v1-19 carry-radius) 11264.0) (set! (-> v1-19 mode) (carry-mode mech-drag)) - (set! (-> obj carry) v1-19) + (set! (-> this carry) v1-19) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/ruins/pillar-collapse.gc b/goal_src/jak2/levels/ruins/pillar-collapse.gc index 0dbcf20212..bbdd062863 100644 --- a/goal_src/jak2/levels/ruins/pillar-collapse.gc +++ b/goal_src/jak2/levels/ruins/pillar-collapse.gc @@ -214,10 +214,12 @@ (let ((s5-1 (s4-0 s5-0 *temp-string* art-joint-anim))) (when (not arg0) (talker-spawn-func (-> *talker-speech* 456) *entity-pool* (target-pos 0) (the-as region #f)) + ;; og:preserve-this added cast (ja-play-spooled-anim (-> self anim) (ja-group) (the-as art-joint-anim s5-1) (the-as (function process-drawable symbol) false-func)) ) (set! (-> self event-hook) #f) (ja-channel-set! 1) + ;; og:preserve-this added cast (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim s5-1)) ) ) @@ -230,7 +232,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-pillar-collapse ((obj ruins-pillar-collapse) (arg0 entity-actor)) +(defmethod init-from-entity! ruins-pillar-collapse ((this ruins-pillar-collapse) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -238,12 +240,12 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape-moving)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (dotimes (v1-3 3) - (set! (-> obj mesh-trans v1-3) (the-as uint v1-3)) + (set! (-> this mesh-trans v1-3) (the-as uint v1-3)) ) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -329,57 +331,57 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-30 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-30 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj mesh-trans 0) (the-as uint 1)) - (set! (-> obj mesh-trans 1) (the-as uint 2)) - (set! (-> obj mesh-trans 2) (the-as uint 0)) - (let ((s5-1 (res-lump-struct (-> obj entity) 'art-name structure))) - (set! (-> obj art-name) (the-as string s5-1)) + (process-drawable-from-entity! this arg0) + (set! (-> this mesh-trans 0) (the-as uint 1)) + (set! (-> this mesh-trans 1) (the-as uint 2)) + (set! (-> this mesh-trans 2) (the-as uint 0)) + (let ((s5-1 (res-lump-struct (-> this entity) 'art-name structure))) + (set! (-> this art-name) (the-as string s5-1)) (cond ((string= (the-as string s5-1) "ruins-pillar-collapse-1") - (let ((v1-38 (-> obj root root-prim local-sphere))) + (let ((v1-38 (-> this root root-prim local-sphere))) (set! (-> v1-38 y) 49152.0) (set! (-> v1-38 z) 65536.0) (set! (-> v1-38 w) 122880.0) ) - (set! (-> obj anim) (new 'static 'spool-anim - :name "ruins-pillar-collapse-1" - :anim-name "1-break-center" - :parts 2 - :command-list '() - ) + (set! (-> this anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-1" + :anim-name "1-break-center" + :parts 2 + :command-list '() + ) ) ) ((string= (the-as string s5-1) "ruins-pillar-collapse-2") - (set! (-> obj anim) (new 'static 'spool-anim - :name "ruins-pillar-collapse-2" - :anim-name "2-break-center" - :parts 2 - :command-list '() - ) + (set! (-> this anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-2" + :anim-name "2-break-center" + :parts 2 + :command-list '() + ) ) - (set-yaw-angle-clear-roll-pitch! (-> obj root) (+ 32768.0 (y-angle (-> obj root)))) + (set-yaw-angle-clear-roll-pitch! (-> this root) (+ 32768.0 (y-angle (-> this root)))) ) ((string= (the-as string s5-1) "ruins-pillar-collapse-3") - (set! (-> obj anim) (new 'static 'spool-anim - :name "ruins-pillar-collapse-3" - :anim-name "3-break-center" - :parts 2 - :command-list '() - ) + (set! (-> this anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-3" + :anim-name "3-break-center" + :parts 2 + :command-list '() + ) ) - (set-yaw-angle-clear-roll-pitch! (-> obj root) (+ 32768.0 (y-angle (-> obj root)))) + (set-yaw-angle-clear-roll-pitch! (-> this root) (+ 32768.0 (y-angle (-> this root)))) ) ) - (initialize-skeleton-by-name obj (the-as string s5-1)) + (initialize-skeleton-by-name this (the-as string s5-1)) ) - (set! (-> obj hit-points) 1) - (set! (-> obj deadly?) #f) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj fall) #t) - (go (method-of-object obj idle)) + (set! (-> this hit-points) 1) + (set! (-> this deadly?) #f) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this fall) #t) + (go (method-of-object this idle)) ) (none) ) diff --git a/goal_src/jak2/levels/ruins/rapid-gunner.gc b/goal_src/jak2/levels/ruins/rapid-gunner.gc index 68657bce1f..dda704ab07 100644 --- a/goal_src/jak2/levels/ruins/rapid-gunner.gc +++ b/goal_src/jak2/levels/ruins/rapid-gunner.gc @@ -240,25 +240,25 @@ (set! (-> *rapid-gunner-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler rapid-gunner ((obj rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler rapid-gunner ((this rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) (('notify) (if (= (-> arg3 param 0) 'attack) @@ -266,7 +266,7 @@ ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -274,21 +274,21 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: Using new Jak 2 rtype-of ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 rapid-gunner ((obj rapid-gunner) (arg0 (pointer float))) - (let ((v1-0 (-> obj incoming knocked-type))) +(defmethod enemy-method-77 rapid-gunner ((this rapid-gunner) (arg0 (pointer float))) + (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol (cond ((or (= v1-0 (knocked-type knocked-type-4)) (= v1-0 (knocked-type knocked-type-0))) (cond - ((zero? (-> obj hit-points)) - (let ((a0-3 (-> obj skel root-channel 0))) + ((zero? (-> this hit-points)) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) ) (set! (-> a0-3 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) frames num-frames) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) frames num-frames) -1 ) ) @@ -297,7 +297,7 @@ (set! (-> a0-3 frame-num) 0.0) (joint-control-channel-group! a0-3 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) num-func-seek! ) ) @@ -308,21 +308,21 @@ (s4-0 (new 'static 'array int64 3 20 21 22)) (s3-0 (new 'static 'array int32 4 0 0 0 0)) (a2-1 (ash 1 (-> s3-0 0))) - (v1-27 (enemy-method-120 obj a1-11 a2-1)) - (s4-1 (-> obj draw art-group data (-> (the-as (pointer int32) (+ (* v1-27 8) (the-as int s4-0)))))) + (v1-27 (enemy-method-120 this a1-11 a2-1)) + (s4-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-27 8) (the-as int s4-0)))))) ) (set! (-> s3-0 0) v1-27) - (let ((v1-30 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-30 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-30 (= v1-30 (-> obj draw art-group data 27))) + (if (and v1-30 (= v1-30 (-> this draw art-group data 27))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-19 (-> obj skel root-channel 0))) + (let ((a0-19 (-> this skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-19 param 1) (-> arg0 0)) @@ -336,14 +336,14 @@ ) ((= v1-0 (knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.067)) - (let ((a0-22 (-> obj skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-22 param 1) (-> arg0 0)) (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) ) ((= v1-0 (knocked-type knocked-type-6)) @@ -352,21 +352,21 @@ (s5-1 (new 'static 'array int64 3 24 25 26)) (s4-2 (new 'static 'array int32 4 0 0 0 0)) (a2-4 (ash 1 (-> s4-2 0))) - (v1-59 (enemy-method-120 obj a1-21 a2-4)) - (s5-2 (-> obj draw art-group data (-> (the-as (pointer int32) (+ (* v1-59 8) (the-as int s5-1)))))) + (v1-59 (enemy-method-120 this a1-21 a2-4)) + (s5-2 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-59 8) (the-as int s5-1)))))) ) (set! (-> s4-2 0) v1-59) - (let ((v1-62 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-62 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-62 (= v1-62 (-> obj draw art-group data 27))) + (if (and v1-62 (= v1-62 (-> this draw art-group data 27))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-39 (-> obj skel root-channel 0))) + (let ((a0-39 (-> this skel root-channel 0))) (set! (-> a0-39 frame-group) (the-as art-joint-anim s5-2)) (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) (set! (-> a0-39 param 1) 1.0) @@ -378,8 +378,8 @@ ) (else (ja-channel-push! 1 (seconds 0.067)) - (let ((a1-28 (-> obj draw art-group data (-> obj enemy-info knocked-anim))) - (a0-43 (-> obj skel root-channel 0)) + (let ((a1-28 (-> this draw art-group data (-> this enemy-info knocked-anim))) + (a0-43 (-> this skel root-channel 0)) ) (set! (-> a0-43 frame-group) (the-as art-joint-anim a1-28)) (set! (-> a0-43 param 0) (the float (+ (-> (the-as art-joint-anim a1-28) frames num-frames) -1))) @@ -395,39 +395,39 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 rapid-gunner ((obj rapid-gunner) (arg0 vector)) +(defmethod enemy-method-52 rapid-gunner ((this rapid-gunner) (arg0 vector)) (cond - ((> (-> obj hit-points) 0) - (-> obj enemy-info) - (case (-> obj incoming knocked-type) + ((> (-> this hit-points) 0) + (-> this enemy-info) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (vector-reset! arg0) ) (else - ((method-of-type nav-enemy enemy-method-52) obj arg0) + ((method-of-type nav-enemy enemy-method-52) this arg0) ) ) ) (else - ((method-of-type nav-enemy enemy-method-52) obj arg0) + ((method-of-type nav-enemy enemy-method-52) this arg0) ) ) (none) ) -(defmethod enemy-method-78 rapid-gunner ((obj rapid-gunner) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 rapid-gunner ((this rapid-gunner) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 27))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 27))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 27)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 27)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!) ) #t ) @@ -436,10 +436,10 @@ #t ) (((knocked-type knocked-type-5)) - (when (zero? (-> obj hit-points)) + (when (zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.067)) - (let ((a1-5 (-> obj draw art-group data (-> obj enemy-info die-anim))) - (a0-10 (-> obj skel root-channel 0)) + (let ((a1-5 (-> this draw art-group data (-> this enemy-info die-anim))) + (a0-10 (-> this skel root-channel 0)) ) (set! (-> a0-10 frame-group) (the-as art-joint-anim a1-5)) (set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim a1-5) frames num-frames) -1))) @@ -451,8 +451,8 @@ ) ) (else - (let ((a1-6 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-13 (-> obj skel root-channel 0)) + (let ((a1-6 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-13 (-> this skel root-channel 0)) ) (set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) @@ -465,30 +465,30 @@ ) ) -(defmethod in-aggro-range? rapid-gunner ((obj rapid-gunner) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? rapid-gunner ((this rapid-gunner) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @param proc The process used to distance check @returns true/false" (let ((t9-0 (method-of-type nav-enemy in-aggro-range?))) - (and (t9-0 obj arg0 arg1) - (or (not (logtest? (-> obj fact enemy-options) (enemy-option user8))) - (and (not (focus-test? arg0 in-air)) (>= 4096.0 (fabs (- (-> (get-trans arg0 0) y) (-> obj root trans y))))) + (and (t9-0 this arg0 arg1) + (or (not (logtest? (-> this fact enemy-options) (enemy-option user8))) + (and (not (focus-test? arg0 in-air)) (>= 4096.0 (fabs (- (-> (get-trans arg0 0) y) (-> this root trans y))))) ) ) ) ) ;; WARN: Function (method 185 rapid-gunner) has a return type of none, but the expression builder found a return statement. -(defmethod rapid-gunner-method-185 rapid-gunner ((obj rapid-gunner) (arg0 vector) (arg1 float)) - (if (not (-> obj joint-enable)) +(defmethod rapid-gunner-method-185 rapid-gunner ((this rapid-gunner) (arg0 vector) (arg1 float)) + (if (not (-> this joint-enable)) (return #f) ) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> arg0 quad)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj root root-prim prim-core world-sphere quad)) + (set! (-> s4-0 quad) (-> this root root-prim prim-core world-sphere quad)) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 s4-0))) (set! (-> s4-0 w) 1.0) (when (< (vector-vector-distance s5-0 s4-0) 29491.2) @@ -497,10 +497,10 @@ ) ) ) - (let* ((v1-16 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 18))) + (let* ((v1-16 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 18))) (s4-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 v1-16) 1.0)) (s3-2 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 4 bone transform vector 2) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 4 bone transform vector 2) 1.0) ) (s5-1 (new 'stack-no-clear 'quaternion)) ) @@ -517,8 +517,8 @@ (vector-orient-by-quat! s4-1 s2-0 s1-0) ) ) - (quaternion-from-two-vectors-max-angle-partial! s5-1 s3-2 s4-1 16384.0 (-> obj joint-blend)) - (quaternion-slerp! (-> obj joint quat) (-> obj joint quat) s5-1 0.1) + (quaternion-from-two-vectors-max-angle-partial! s5-1 s3-2 s4-1 16384.0 (-> this joint-blend)) + (quaternion-slerp! (-> this joint quat) (-> this joint quat) s5-1 0.1) ) ) 0 @@ -567,27 +567,27 @@ (none) ) -(defmethod track-target! rapid-gunner ((obj rapid-gunner)) +(defmethod track-target! rapid-gunner ((this rapid-gunner)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) 0 (none) ) -(defmethod enemy-method-96 rapid-gunner ((obj rapid-gunner) (arg0 float) (arg1 symbol)) - (enemy-method-95 obj (-> obj target-next-pos) arg0) +(defmethod enemy-method-96 rapid-gunner ((this rapid-gunner) (arg0 float) (arg1 symbol)) + (enemy-method-95 this (-> this target-next-pos) arg0) ) -(defmethod rapid-gunner-method-184 rapid-gunner ((obj rapid-gunner) (arg0 float)) - (let* ((s4-0 (-> obj node-list data 18)) +(defmethod rapid-gunner-method-184 rapid-gunner ((this rapid-gunner) (arg0 float)) + (let* ((s4-0 (-> this node-list data 18)) (v1-1 (vector<-cspace! (new 'stack-no-clear 'vector) s4-0)) - (s5-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj target-next-pos) v1-1) 1.0)) + (s5-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-next-pos) v1-1) 1.0)) (s4-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 bone transform vector 2) 1.0)) ) (set! (-> s4-1 y) 0.0) @@ -598,8 +598,8 @@ ) ) -(defmethod go-stare rapid-gunner ((obj rapid-gunner)) - (go (method-of-object obj hostile)) +(defmethod go-stare rapid-gunner ((this rapid-gunner)) + (go (method-of-object this hostile)) ) (defstate notice (rapid-gunner) @@ -684,7 +684,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self predict-timer) (the-as uint (+ (current-time) 1))) (set! (-> self shot-timer) (the-as uint (current-time))) (let ((v1-7 self)) @@ -754,7 +754,7 @@ ) (go-virtual reload) ) - ((>= (- (current-time) (the-as int (-> self shot-timer))) (seconds 0.25)) + ((time-elapsed? (the-as int (-> self shot-timer)) (seconds 0.25)) (when (rapid-gunner-method-184 self 2184.5334) (let* ((a1-11 (-> self node-list data 18)) (f30-0 (fmax 0.0 (the float (- (-> self spin-up-timer) (current-time))))) @@ -836,19 +836,19 @@ ) ;; WARN: Return type mismatch art-element vs none. -(defmethod rapid-gunner-method-186 rapid-gunner ((obj rapid-gunner) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod rapid-gunner-method-186 rapid-gunner ((this rapid-gunner) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) (set! v1-1 arg2) (set! v1-1 arg3) ) - (let ((a1-2 (-> obj skel root-channel arg0))) + (let ((a1-2 (-> this skel root-channel arg0))) (let ((f0-2 (fabs arg1))) (set! (-> a1-2 frame-interp 1) f0-2) (set! (-> a1-2 frame-interp 0) f0-2) ) - (set! (-> a1-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data v1-1))) + (set! (-> a1-2 frame-group) (the-as art-joint-anim (-> this draw art-group data v1-1))) ) (none) ) @@ -1050,12 +1050,12 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self shots-fired) (the-as uint 0)) 0 ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (go-hostile self) ) ) @@ -1171,7 +1171,7 @@ ) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (>= 1 (the-as int (-> self focus aware))) (go-virtual active) ) @@ -1228,7 +1228,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1319,24 +1319,24 @@ :post nav-enemy-simple-post ) -(defmethod nav-enemy-method-142 rapid-gunner ((obj rapid-gunner) (arg0 nav-control)) +(defmethod nav-enemy-method-142 rapid-gunner ((this rapid-gunner) (arg0 nav-control)) 0 (none) ) ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 rapid-gunner ((obj rapid-gunner) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 rapid-gunner ((this rapid-gunner) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 obj arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 this arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) ) -(defmethod init-enemy-collision! rapid-gunner ((obj rapid-gunner)) +(defmethod init-enemy-collision! rapid-gunner ((this rapid-gunner)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1407,24 +1407,24 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch process-focusable vs rapid-gunner. -(defmethod relocate rapid-gunner ((obj rapid-gunner) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method rapid-gunner 7)) this arg0) ) ) -(defmethod init-enemy! rapid-gunner ((obj rapid-gunner)) +(defmethod init-enemy! rapid-gunner ((this rapid-gunner)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-48 int)) (rlet ((acc :class vf) @@ -1436,21 +1436,21 @@ ) (init-vf0-vector) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-rapid-gunner" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *rapid-gunner-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd obstacle)) - (set! (-> obj joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) obj 5)) - (set-vector! (-> obj root scale) 1.2 1.2 1.2 1.0) - (let ((a0-13 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (init-enemy-behaviour-and-stats! this *rapid-gunner-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle)) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 5)) + (set-vector! (-> this root scale) 1.2 1.2 1.2 1.0) + (let ((a0-13 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (v1-14 (new 'stack-no-clear 'vector)) ) - (let ((a1-7 (-> obj root trans))) + (let ((a1-7 (-> this root trans))) (let ((a2-5 409600.0)) (.mov vf7 a2-5) ) @@ -1461,42 +1461,49 @@ (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-14 quad) vf6) - (set! (-> obj target-next-pos quad) (-> v1-14 quad)) - (set! (-> obj target-prev-pos quad) (-> v1-14 quad)) + (set! (-> this target-next-pos quad) (-> v1-14 quad)) + (set! (-> this target-prev-pos quad) (-> v1-14 quad)) ) - (set! (-> obj shots-fired) (the-as uint 0)) - (set! (-> obj spin-up-timer) 0) - (logclear! (-> obj status-flags) (rapid-gunner-flags ragflags-0)) - (logior! (-> obj status-flags) (rapid-gunner-flags ragflags-1)) + (set! (-> this shots-fired) (the-as uint 0)) + (set! (-> this spin-up-timer) 0) + (logclear! (-> this status-flags) (rapid-gunner-flags ragflags-0)) + (logior! (-> this status-flags) (rapid-gunner-flags ragflags-1)) (let ((f30-0 3640.889)) (set! sv-48 0) - (let ((v1-22 (res-lump-data (-> obj entity) 'spinup-angle pointer :tag-ptr (the-as (pointer res-tag) (& sv-48))))) + (let ((v1-22 (res-lump-data (-> this entity) 'spinup-angle pointer :tag-ptr (the-as (pointer res-tag) (& sv-48))))) (if v1-22 (set! f30-0 (-> (the-as (pointer float) v1-22))) ) ) - (set! (-> obj spin-up-angle) f30-0) + (set! (-> this spin-up-angle) f30-0) ) - (vector-reset! (-> obj focus-dir)) - (set! (-> obj shoot-anim-index) -1) - (let ((v1-26 (-> obj nav))) + (vector-reset! (-> this focus-dir)) + (set! (-> this shoot-anim-index) -1) + (let ((v1-26 (-> this nav))) (set! (-> v1-26 speed-scale) 1.0) ) 0 - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) - (set! (-> obj start-pos quad) (-> obj root trans quad)) - (set! (-> obj roam-radius) 16384.0) - (add-connection *part-engine* obj 8 obj 1310 (new 'static 'vector :x 1146.88 :y 450.56 :z 901.12 :w 163840.0)) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43)))) + (set! (-> this start-pos quad) (-> this root trans quad)) + (set! (-> this roam-radius) 16384.0) (add-connection *part-engine* - obj + this 8 - obj + this + 1310 + (new 'static 'vector :x 1146.88 :y 450.56 :z 901.12 :w 163840.0) + ) + (add-connection + *part-engine* + this + 8 + this 1311 (new 'static 'vector :x -1146.88 :y 450.56 :z 901.12 :w 163840.0) ) - (add-connection *part-engine* obj 18 obj 1312 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 18 this 1312 (new 'static 'vector :w 163840.0)) 0 (none) ) diff --git a/goal_src/jak2/levels/ruins/ruins-obs.gc b/goal_src/jak2/levels/ruins/ruins-obs.gc index b508833da9..3e48a691a6 100644 --- a/goal_src/jak2/levels/ruins/ruins-obs.gc +++ b/goal_src/jak2/levels/ruins/ruins-obs.gc @@ -22,15 +22,15 @@ :bounds (static-spherem 0 1 0 4) ) -(defmethod rigid-body-object-method-29 sinking-plat ((obj sinking-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method sinking-plat 29)) obj arg0) - (rigid-body-platform-method-56 obj (-> obj anchor-point)) +(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) + (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) ) -(defmethod allocate-and-init-cshape sinking-plat ((obj sinking-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod allocate-and-init-cshape sinking-plat ((this sinking-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -51,7 +51,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -90,18 +90,18 @@ ) ) -(defmethod init-skel-and-rigid-body sinking-plat ((obj sinking-plat)) +(defmethod init-skel-and-rigid-body sinking-plat ((this sinking-plat)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sinking-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj float-height-offset) 4096.0) - (alloc-and-init-rigid-body-control obj *ruins-sinking-platform-constants*) - (set! (-> obj anchor-point quad) (-> obj root trans quad)) - (let ((s5-1 (-> obj info control-point-count))) + (set! (-> this float-height-offset) 4096.0) + (alloc-and-init-rigid-body-control this *ruins-sinking-platform-constants*) + (set! (-> this anchor-point quad) (-> this root trans quad)) + (let ((s5-1 (-> this info control-point-count))) (dotimes (s4-1 s5-1) - (let ((s3-0 (-> obj control-point-array data s4-1))) + (let ((s3-0 (-> this control-point-array data s4-1))) (let ((f30-0 (* 65536.0 (/ (the float s4-1) (the float s5-1))))) (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) (set! (-> s3-0 local-pos y) 4096.0) @@ -184,31 +184,31 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! beam ((obj beam) (arg0 entity-actor)) +(defmethod init-from-entity! beam ((this beam) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-beam" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-push! 1 0) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -226,12 +226,12 @@ This commonly includes things such as: :bounds (static-spherem 0 0 0 7) ) -(defmethod start-bouncing! ruins-bridge ((obj ruins-bridge)) +(defmethod start-bouncing! ruins-bridge ((this ruins-bridge)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -287,15 +287,15 @@ and translate the platform via the `smush` ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-bridge ((obj ruins-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ruins-bridge ((this ruins-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -343,22 +343,22 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-25 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-bridge-1" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-bridge-1") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-bridge-1") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-bridge-1" :anim-name "1-crumble" :parts 2 :command-list '()) ) - (set! (-> obj basetrans quad) (-> obj root trans quad)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj fall) #t) - (go (method-of-object obj idle)) + (set! (-> this basetrans quad) (-> this root trans quad)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this fall) #t) + (go (method-of-object this idle)) ) (none) ) @@ -420,15 +420,15 @@ This commonly includes things such as: :origin-joint-index 3 ) -(defmethod start-bouncing! ruins-drop-plat ((obj ruins-drop-plat)) +(defmethod start-bouncing! ruins-drop-plat ((this ruins-drop-plat)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (activate! (-> obj smush) -1.0 60 150 1.0 1.0 (-> self clock)) - (set! (-> obj bounce-time) (current-time)) - (set! (-> obj bouncing) #t) - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) + (activate! (-> this smush) -1.0 60 150 1.0 1.0 (-> self clock)) + (set-time! (-> this bounce-time)) + (set! (-> this bouncing) #t) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -495,7 +495,7 @@ and translate the platform via the `smush` ) :post (behavior () (when (and (nonzero? (-> self root root-prim prim-core collide-as)) - (>= (- (current-time) (-> self state-time)) (seconds 0.25)) + (time-elapsed? (-> self state-time) (seconds 0.25)) ) (let ((v1-9 (-> self root root-prim))) (set! (-> v1-9 prim-core collide-as) (collide-spec)) @@ -512,15 +512,15 @@ and translate the platform via the `smush` ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-drop-plat ((obj ruins-drop-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ruins-drop-plat ((this ruins-drop-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -554,11 +554,11 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (let ((s5-1 ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'art-name 'interp -1000000000.0 @@ -568,117 +568,117 @@ This commonly includes things such as: ) ) ) - (set! (-> obj art-name) (the-as string s5-1)) + (set! (-> this art-name) (the-as string s5-1)) (cond ((string= (the-as string s5-1) "ruins-drop-plat-a-1") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-a-1" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-a-1") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-a-1") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-1-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-a-2") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-a-2" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-a-2") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-a-2") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-2-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-a-3") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-a-3" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-a-3") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-a-3") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-3-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-b-1") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-b-1" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-b-1") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-b-1") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-b-1" :anim-name "b-1-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-b-2") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-b-2" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-b-2") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-b-2") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-b-1" :anim-name "b-2-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-c-1") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-c-1" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-c-1") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-c-1") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-1-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-c-2") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-c-2" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-c-2") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-c-2") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-2-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-c-3") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-c-3" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-c-3") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-c-3") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-3-break-center" :parts 1 :command-list '()) ) ) @@ -687,13 +687,13 @@ This commonly includes things such as: ) ) ) - (set! (-> obj draw force-lod) 1) - (set! (-> obj break-anim-name) (new 'process 'string 128 (the-as string #f))) - (set! (-> obj basetrans quad) (-> obj root trans quad)) - (set! (-> obj bounce-scale) 0.0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj fall) #t) - (go (method-of-object obj idle)) + (set! (-> this draw force-lod) 1) + (set! (-> this break-anim-name) (new 'process 'string 128 (the-as string #f))) + (set! (-> this basetrans quad) (-> this root trans quad)) + (set! (-> this bounce-scale) 0.0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this fall) #t) + (go (method-of-object this idle)) ) (none) ) @@ -715,7 +715,7 @@ This commonly includes things such as: (set! (-> self data-int32 0) 0) (set! (-> self beep-time) (+ (current-time) (seconds -30))) (until #f - (when (>= (- (current-time) (-> self beep-time)) (seconds 40)) + (when (time-elapsed? (-> self beep-time) (seconds 40)) (let ((v1-8 (mod (-> self data-int32 0) (if (= (-> self node-info task) (game-task ruins-tower)) 4 2 @@ -738,7 +738,7 @@ This commonly includes things such as: ) ) ) - (set! (-> self beep-time) (current-time)) + (set-time! (-> self beep-time)) (+! (-> self data-int32 0) 1) ) (b! @@ -791,12 +791,12 @@ This commonly includes things such as: ) (b! #t cfg-17 :delay (nop!)) (label cfg-8) - (when (and (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (when (and (time-elapsed? (-> self time-limit) (seconds 10)) gp-0 (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 40960.0) ) (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) (suspend) (label cfg-17) @@ -815,22 +815,22 @@ This commonly includes things such as: (until (not (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status))))) (b! #t cfg-47 :delay (nop!)) (label cfg-38) - (when (and (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (when (and (time-elapsed? (-> self time-limit) (seconds 10)) gp-0 (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 40960.0) ) (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) (suspend) (label cfg-47) (b! (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status)))) cfg-38 :delay (nop!)) (talker-spawn-func (-> *talker-speech* 457) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) (b! #t cfg-66 :delay (nop!)) (label cfg-52) ) - (when (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (when (time-elapsed? (-> self time-limit) (seconds 10)) (b! (not (and gp-0 (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 61440.0))) cfg-63 @@ -841,7 +841,7 @@ This commonly includes things such as: (label cfg-63) (talker-spawn-func (-> *talker-speech* 454) *entity-pool* (target-pos 0) (the-as region #f)) (label cfg-64) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) (suspend) (label cfg-66) @@ -869,7 +869,7 @@ This commonly includes things such as: (label cfg-1) (b! #t cfg-14 :delay (nop!)) (label cfg-2) - (let ((a0-2 (>= (- (current-time) (-> self time-limit)) (seconds 10)))) + (let ((a0-2 (time-elapsed? (-> self time-limit) (seconds 10)))) (b! (not a0-2) cfg-11 :likely-delay (set! v1-3 a0-2)) ) (b! (not gp-0) cfg-11 :likely-delay (set! v1-3 gp-0)) @@ -886,7 +886,7 @@ This commonly includes things such as: (label cfg-11) (when v1-3 (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) (suspend) (label cfg-14) @@ -899,7 +899,7 @@ This commonly includes things such as: (set! v1-18 (not (logtest? (focus-status mech) (-> *target* focus-status)))) (label cfg-22) (b! v1-18 cfg-1 :delay (nop!)) - (when (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (when (time-elapsed? (-> self time-limit) (seconds 10)) (b! (not gp-0) cfg-38 :likely-delay (set! v1-25 gp-0)) (let ((v1-27 (-> gp-0 extra process))) (b! (not v1-27) cfg-28 :delay (nop!)) @@ -924,7 +924,7 @@ This commonly includes things such as: (label cfg-38) (when v1-25 (talker-spawn-func (-> *talker-speech* 458) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) ) (suspend) @@ -958,7 +958,7 @@ This commonly includes things such as: (b! #t cfg-20 :delay (nop!)) (label cfg-8) (set! v1-6 - (and (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (and (time-elapsed? (-> self time-limit) (seconds 10)) (and gp-0 (begin (let ((v1-8 (-> gp-0 extra process))) (b! (not v1-8) cfg-14 :delay (nop!)) @@ -978,7 +978,7 @@ This commonly includes things such as: (label cfg-17) (b! (not v1-6) cfg-19 :delay (empty-form)) (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) (label cfg-19) (suspend) (label cfg-20) @@ -986,7 +986,7 @@ This commonly includes things such as: (b! #t cfg-53 :delay (nop!)) (label cfg-25) ) - (when (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (when (time-elapsed? (-> self time-limit) (seconds 10)) (b! (not (and *target* (focus-test? *target* carry))) cfg-43 :delay (empty-form)) (when (< (vector-vector-xz-distance (target-pos 0) @@ -1014,7 +1014,7 @@ This commonly includes things such as: ) ) (talker-spawn-func (-> *talker-speech* 459) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) (b! #t cfg-52 :delay (nop!)) (label cfg-43) @@ -1030,7 +1030,7 @@ This commonly includes things such as: ) ) (talker-spawn-func (-> *talker-speech* 458) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) ) (label cfg-52) diff --git a/goal_src/jak2/levels/ruins/ruins-scenes.gc b/goal_src/jak2/levels/ruins/ruins-scenes.gc index ee6d4e284c..734868a35d 100644 --- a/goal_src/jak2/levels/ruins/ruins-scenes.gc +++ b/goal_src/jak2/levels/ruins/ruins-scenes.gc @@ -1343,24 +1343,24 @@ The scale will be linearly-interpolated based on the distance from the camera" ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! flag ((obj flag) (arg0 entity-actor)) +(defmethod init-from-entity! flag ((this flag) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flag" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 78) obj)) - (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector #t) 0) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 78) this)) + (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector #t) 0) + (go (method-of-object this idle)) (none) ) @@ -1435,14 +1435,14 @@ Touching it flips the `play?` field which will trigger the cutscene" ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-precipice ((obj ruins-precipice) (arg0 entity-actor)) +(defmethod init-from-entity! ruins-precipice ((this ruins-precipice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((cshape-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> cshape-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> cshape-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -1457,18 +1457,18 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (vector+! (-> obj root trans) (-> obj root trans) (new 'static 'vector :z 28672.0 :w 1.0)) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) -7198.0376) + (process-drawable-from-entity! this arg0) + (vector+! (-> this root trans) (-> this root trans) (new 'static 'vector :z 28672.0 :w 1.0)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) -7198.0376) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-precipice" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj play?) #f) - (go (method-of-object obj idle)) + (set! (-> this play?) #f) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/sewer/escort/grim.gc b/goal_src/jak2/levels/sewer/escort/grim.gc index bcb7cc9a54..ef63a0f0c6 100644 --- a/goal_src/jak2/levels/sewer/escort/grim.gc +++ b/goal_src/jak2/levels/sewer/escort/grim.gc @@ -7,9 +7,9 @@ ;; DECOMP BEGINS -(defmethod init-enemy-collision! grim ((obj grim)) +(defmethod init-enemy-collision! grim ((this grim)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -74,76 +74,76 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 6)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! grim ((obj grim)) +(defmethod init-enemy! grim ((this grim)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type jinx init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj channel) (the-as uint 25)) - (set! (-> obj min-speed) 20480.0) - (set! (-> obj max-speed) 40960.0) - (set! (-> obj follow-offset) 12288.0) - (set! (-> obj bot-health-index) 1) - (set! (-> obj spot-color) (the-as uint #x50008f00)) - (setup-masks (-> obj draw) 654 #x3fd70) + (set! (-> this channel) (the-as uint 25)) + (set! (-> this min-speed) 20480.0) + (set! (-> this max-speed) 40960.0) + (set! (-> this follow-offset) 12288.0) + (set! (-> this bot-health-index) 1) + (set! (-> this spot-color) (the-as uint #x50008f00)) + (setup-masks (-> this draw) 654 #x3fd70) (none) ) -(defmethod ruffian-method-244 grim ((obj grim)) +(defmethod ruffian-method-244 grim ((this grim)) (with-pp - (ruffian-method-245 obj) - (let ((f30-0 (-> obj nav state speed))) + (ruffian-method-245 this) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 12288.0 40960.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-9 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-9 (= v1-9 (-> obj draw art-group data 34))) - (let ((v1-14 (-> obj skel root-channel 1))) + ((and v1-9 (= v1-9 (-> this draw art-group data 34))) + (let ((v1-14 (-> this skel root-channel 1))) (set! (-> v1-14 frame-interp 1) f28-0) (set! (-> v1-14 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 16.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) - (a0-11 (-> obj skel root-channel 0)) + (a0-11 (-> this skel root-channel 0)) ) (set! (-> a0-11 param 0) f0-11) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-12 (-> obj skel root-channel 1))) + (let ((a0-12 (-> this skel root-channel 1))) (set! (-> a0-12 param 0) 0.0) (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 dist) 13107.2) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 34))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 34))) (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 34)) num-func-loop!) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 34)) num-func-loop!) ) - (let ((a0-15 (-> obj skel root-channel 1))) + (let ((a0-15 (-> this skel root-channel 1))) (set! (-> a0-15 frame-interp 1) f28-0) (set! (-> a0-15 frame-interp 0) f28-0) (set! (-> a0-15 dist) 21843.969) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 35))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 35))) (set! (-> a0-15 param 0) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 35)) num-func-chan) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 35)) num-func-chan) ) ) ) diff --git a/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc b/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc index 13667a76f0..164555bb9d 100644 --- a/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc +++ b/goal_src/jak2/levels/sewer/escort/jinx-bomb.gc @@ -44,11 +44,11 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (and (nonzero? (-> self fuse-delay)) - (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self fuse-delay))) + (time-elapsed? (-> self state-time) (the-as time-frame (-> self fuse-delay))) ) (go-virtual explode) ) @@ -66,7 +66,7 @@ (defstate explode (jinx-bomb) :virtual #t :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self draw status) (draw-control-status no-draw)) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (collide-spec)) diff --git a/goal_src/jak2/levels/sewer/escort/jinx-states.gc b/goal_src/jak2/levels/sewer/escort/jinx-states.gc index f95ad8130f..faf7b88158 100644 --- a/goal_src/jak2/levels/sewer/escort/jinx-states.gc +++ b/goal_src/jak2/levels/sewer/escort/jinx-states.gc @@ -475,7 +475,7 @@ (until (ja-done? 0) (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 131072.0 (seconds 0.05)) (bot-method-223 self #t) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.1)) (or (not (bot-method-214 self)) (not (ruffian-method-237 self))) ) (react-to-focus self) @@ -560,12 +560,12 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) diff --git a/goal_src/jak2/levels/sewer/escort/jinx.gc b/goal_src/jak2/levels/sewer/escort/jinx.gc index 68fecdf273..fb5998bb76 100644 --- a/goal_src/jak2/levels/sewer/escort/jinx.gc +++ b/goal_src/jak2/levels/sewer/escort/jinx.gc @@ -215,36 +215,36 @@ (set! (-> *jinx-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler jinx ((obj jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler jinx ((this jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('request) (case (-> arg3 param 0) (('explode) - (send-event (handle->process (-> obj bomb-handle)) 'trigger) + (send-event (handle->process (-> this bomb-handle)) 'trigger) ) (('no-bomb) - (send-event (handle->process (-> obj bomb-handle)) 'die-fast) + (send-event (handle->process (-> this bomb-handle)) 'die-fast) ) (('replace-bomb) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) #t ) (else - ((method-of-type ruffian general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type ruffian general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type ruffian general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type ruffian general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod init-enemy-collision! jinx ((obj jinx)) +(defmethod init-enemy-collision! jinx ((this jinx)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -309,34 +309,34 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 6)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! jinx ((obj jinx)) +(defmethod init-enemy! jinx ((this jinx)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) - (set! (-> obj min-speed) 24576.0) - (set! (-> obj max-speed) 49152.0) - (set! (-> obj follow-offset) 24576.0) - (set! (-> obj channel) (the-as uint 24)) - (set! (-> obj notice-enemy-dist) 204800.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 61440.0) - (set! (-> obj bomb-handle) (the-as handle #f)) - (set! (-> obj bomb-func) #f) + (init! this) + (set! (-> this min-speed) 24576.0) + (set! (-> this max-speed) 49152.0) + (set! (-> this follow-offset) 24576.0) + (set! (-> this channel) (the-as uint 24)) + (set! (-> this notice-enemy-dist) 204800.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 61440.0) + (set! (-> this bomb-handle) (the-as handle #f)) + (set! (-> this bomb-func) #f) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-jinx" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *jinx-nav-enemy-info*) - (set! (-> obj draw light-index) (the-as uint 10)) - (setup-masks (-> obj draw) 6882 #x3e51c) - (set! (-> obj swivel-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4)) - (let ((v1-17 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *jinx-nav-enemy-info*) + (set! (-> this draw light-index) (the-as uint 10)) + (setup-masks (-> this draw) 6882 #x3e51c) + (set! (-> this swivel-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) + (let ((v1-17 (-> this neck))) (set! (-> v1-17 up) (the-as uint 1)) (set! (-> v1-17 nose) (the-as uint 2)) (set! (-> v1-17 ear) (the-as uint 0)) @@ -344,24 +344,24 @@ (set! (-> v1-17 ignore-angle) 30947.555) ) (let ((t9-6 (method-of-type ruffian init-enemy!))) - (t9-6 obj) + (t9-6 this) ) - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) 0 (none) ) ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fire-gun jinx ((obj jinx) (arg0 vector)) - (set! (-> obj next-fire-time) (+ (current-time) (get-rand-int-range obj 150 600))) - (+! (-> obj fired-gun-count) 1) +(defmethod fire-gun jinx ((this jinx) (arg0 vector)) + (set! (-> this next-fire-time) (+ (current-time) (get-rand-int-range this 150 600))) + (+! (-> this fired-gun-count) 1) (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> s4-1 ent) (-> obj entity)) + (set! (-> s4-1 ent) (-> this entity)) (set! (-> s4-1 charge) 1.0) (set! (-> s4-1 options) (projectile-options account-for-target-velocity proj-options-8000)) (set! (-> s4-1 notify-handle) (the-as handle #f)) (set! (-> s4-1 owner-handle) (the-as handle #f)) - (set! (-> s4-1 ignore-handle) (process->handle obj)) + (set! (-> s4-1 ignore-handle) (process->handle this)) (let* ((v1-12 *game-info*) (a0-7 (+ (-> v1-12 attack-id) 1)) ) @@ -369,64 +369,64 @@ (set! (-> s4-1 attack-id) a0-7) ) (set! (-> s4-1 timeout) (seconds 4)) - (vector<-cspace! (-> s4-1 pos) (-> obj node-list data 24)) + (vector<-cspace! (-> s4-1 pos) (-> this node-list data 24)) (set! (-> s4-1 vel quad) (-> arg0 quad)) (vector-! (-> s4-1 vel) (-> s4-1 vel) (-> s4-1 pos)) (vector-normalize! (-> s4-1 vel) 307200.0) - (spawn-projectile jinx-shot s4-1 obj *default-dead-pool*) + (spawn-projectile jinx-shot s4-1 this *default-dead-pool*) ) (none) ) -(defmethod ruffian-method-244 jinx ((obj jinx)) +(defmethod ruffian-method-244 jinx ((this jinx)) (with-pp - (ruffian-method-245 obj) - (let ((f30-0 (-> obj nav state speed))) + (ruffian-method-245 this) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 12288.0 40960.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-9 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-9 (= v1-9 (-> obj draw art-group data 32))) - (let ((v1-14 (-> obj skel root-channel 1))) + ((and v1-9 (= v1-9 (-> this draw art-group data 32))) + (let ((v1-14 (-> this skel root-channel 1))) (set! (-> v1-14 frame-interp 1) f28-0) (set! (-> v1-14 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 16.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) - (a0-11 (-> obj skel root-channel 0)) + (a0-11 (-> this skel root-channel 0)) ) (set! (-> a0-11 param 0) f0-11) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-12 (-> obj skel root-channel 1))) + (let ((a0-12 (-> this skel root-channel 1))) (set! (-> a0-12 param 0) 0.0) (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 dist) 13107.2) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 32))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 32))) (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 32)) num-func-loop!) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 32)) num-func-loop!) ) - (let ((a0-15 (-> obj skel root-channel 1))) + (let ((a0-15 (-> this skel root-channel 1))) (set! (-> a0-15 frame-interp 1) f28-0) (set! (-> a0-15 frame-interp 0) f28-0) (set! (-> a0-15 dist) 21843.969) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 33))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) (set! (-> a0-15 param 0) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 33)) num-func-chan) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-chan) ) ) ) @@ -436,32 +436,32 @@ ) ) -(defmethod enemy-method-77 jinx ((obj jinx) (arg0 (pointer float))) - (let ((v1-0 (-> obj incoming knocked-type))) +(defmethod enemy-method-77 jinx ((this jinx) (arg0 (pointer float))) + (let ((v1-0 (-> this incoming knocked-type))) (cond ((= v1-0 (knocked-type knocked-type-6)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'vector)) ) - (enemy-method-50 obj s4-0) - (vector-z-quaternion! s5-1 (-> obj root quat)) + (enemy-method-50 this s4-0) + (vector-z-quaternion! s5-1 (-> this root quat)) (cond ((>= (vector-dot s4-0 s5-1) 0.0) - (let* ((v1-7 (enemy-method-120 obj 3 (ash 1 (-> *jinx-global-info* prev-blue-hit-back)))) - (s5-2 (-> obj draw art-group data (-> *jinx-global-info* blue-hit-back-anim v1-7))) + (let* ((v1-7 (enemy-method-120 this 3 (ash 1 (-> *jinx-global-info* prev-blue-hit-back)))) + (s5-2 (-> this draw art-group data (-> *jinx-global-info* blue-hit-back-anim v1-7))) ) (set! (-> *jinx-global-info* prev-blue-hit-back) v1-7) - (let ((v1-10 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-10 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-10 (= v1-10 (-> obj draw art-group data 16))) + (if (and v1-10 (= v1-10 (-> this draw art-group data 16))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-17 (-> obj skel root-channel 0))) + (let ((a0-17 (-> this skel root-channel 0))) (set! (-> a0-17 frame-group) (the-as art-joint-anim s5-2)) (set! (-> a0-17 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) (set! (-> a0-17 param 1) 1.0) @@ -471,21 +471,21 @@ ) ) (else - (let* ((v1-24 (enemy-method-120 obj 3 (ash 1 (-> *jinx-global-info* prev-blue-hit-front)))) - (s5-3 (-> obj draw art-group data (-> *jinx-global-info* blue-hit-front-anim v1-24))) + (let* ((v1-24 (enemy-method-120 this 3 (ash 1 (-> *jinx-global-info* prev-blue-hit-front)))) + (s5-3 (-> this draw art-group data (-> *jinx-global-info* blue-hit-front-anim v1-24))) ) (set! (-> *jinx-global-info* prev-blue-hit-front) v1-24) - (let ((v1-27 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-27 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-27 (= v1-27 (-> obj draw art-group data 16))) + (if (and v1-27 (= v1-27 (-> this draw art-group data 16))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-31 (-> obj skel root-channel 0))) + (let ((a0-31 (-> this skel root-channel 0))) (set! (-> a0-31 frame-group) (the-as art-joint-anim s5-3)) (set! (-> a0-31 param 0) (the float (+ (-> (the-as art-joint-anim s5-3) frames num-frames) -1))) (set! (-> a0-31 param 1) 1.0) @@ -499,44 +499,44 @@ ) ((= v1-0 (knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-34 (-> obj skel root-channel 0))) - (set! (-> a0-34 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-34 (-> this skel root-channel 0))) + (set! (-> a0-34 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-34 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-34 param 1) 1.0) (set! (-> a0-34 frame-num) 0.0) - (joint-control-channel-group! a0-34 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-34 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) ) - ((zero? (get-rand-int obj 3)) + ((zero? (get-rand-int this 3)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-37 (-> obj skel root-channel 0))) - (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (let ((a0-37 (-> this skel root-channel 0))) + (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) (set! (-> a0-37 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 21)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1)) ) (set! (-> a0-37 param 1) 1.0) (set! (-> a0-37 frame-num) 0.0) - (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) ) ) (else (let ((s4-1 (new 'stack-no-clear 'vector))) 0.0 0.0 - (vector-z-quaternion! s4-1 (-> obj root quat)) + (vector-z-quaternion! s4-1 (-> this root quat)) (let ((f30-0 (atan (-> s4-1 x) (-> s4-1 z)))) - (enemy-method-50 obj s4-1) + (enemy-method-50 this s4-1) (let* ((f0-24 (atan (-> s4-1 x) (-> s4-1 z))) (s4-2 (if (< (deg- f0-24 f30-0) 0.0) - (-> obj draw art-group data 17) - (-> obj draw art-group data 19) + (-> this draw art-group data 17) + (-> this draw art-group data 19) ) ) ) (ja-channel-push! 1 (seconds 0.03)) - (let ((a0-44 (-> obj skel root-channel 0))) + (let ((a0-44 (-> this skel root-channel 0))) (set! (-> a0-44 frame-group) (the-as art-joint-anim s4-2)) (set! (-> a0-44 param 0) (the float (+ (-> (the-as art-joint-anim s4-2) frames num-frames) -1))) (set! (-> a0-44 param 1) (-> arg0 0)) @@ -552,85 +552,85 @@ #t ) -(defmethod enemy-method-78 jinx ((obj jinx) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 jinx ((this jinx) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (-> obj draw art-group data 16) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (-> this draw art-group data 16) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 16))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 16)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) 1.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 16)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) ) #t ) ) (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 24))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 24))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 24)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 24)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) 1.0) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 24)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 24)) num-func-seek!) ) #t ) (else - (let ((v1-37 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-37 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-37 (= v1-37 (-> obj draw art-group data 21))) + ((and v1-37 (= v1-37 (-> this draw art-group data 21))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-12 (-> obj skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-12 param 1) 1.0) (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) ) (else - (let ((v1-57 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-57 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-57 (= v1-57 (-> obj draw art-group data 17))) + ((and v1-57 (= v1-57 (-> this draw art-group data 17))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-18 (-> obj skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-18 (-> this skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-18 param 1) 1.0) (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-20 (-> obj skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-20 (-> this skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-20 param 1) 1.0) (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) ) ) @@ -643,42 +643,42 @@ ) ) -(defmethod enemy-method-79 jinx ((obj jinx) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 jinx ((this jinx) (arg0 int) (arg1 enemy-knocked-info)) (let ((f30-0 -1.0)) - (when (and (= arg0 3) (logtest? (-> obj bot-flags) (bot-flags attacked))) - (let ((v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (and (= arg0 3) (logtest? (-> this bot-flags) (bot-flags attacked))) + (let ((v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-7 (= v1-7 (-> obj draw art-group data 22))) + ((and v1-7 (= v1-7 (-> this draw art-group data 22))) (set! f30-0 17.0) ) - ((let ((v1-15 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((let ((v1-15 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-15 (= v1-15 (-> obj draw art-group data 20))) + (and v1-15 (= v1-15 (-> this draw art-group data 20))) ) (set! f30-0 23.0) ) - ((let ((v1-23 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((let ((v1-23 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-23 (= v1-23 (-> obj draw art-group data 18))) + (and v1-23 (= v1-23 (-> this draw art-group data 18))) ) (set! f30-0 11.0) ) - ((let ((v1-31 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((let ((v1-31 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-31 (= v1-31 (-> obj draw art-group data 16))) + (and v1-31 (= v1-31 (-> this draw art-group data 16))) ) (set! f30-0 12.0) ) @@ -687,7 +687,7 @@ ) (cond ((>= f30-0 0.0) - (let ((a0-1 (-> obj skel root-channel 0))) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group frames num-frames) -1))) (set! (-> a0-1 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) @@ -695,15 +695,15 @@ (>= (ja-aframe-num 0) f30-0) ) (else - ((method-of-type ruffian enemy-method-79) obj arg0 arg1) + ((method-of-type ruffian enemy-method-79) this arg0 arg1) ) ) ) ) -(defmethod enemy-method-84 jinx ((obj jinx) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 jinx ((this jinx) (arg0 enemy-jump-info)) (let ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)))) - (fmax (-> obj enemy-info jump-height-min) (* (-> obj enemy-info jump-height-factor) f0-0)) + (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0)) ) (let ((f0-3 3072.0)) (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f0-3 -4.551111) @@ -711,95 +711,97 @@ (none) ) -(defmethod bot-method-216 jinx ((obj jinx)) - (set! (-> obj health-handle) (ppointer->handle (process-spawn hud-ruffians :init hud-init-by-other :to obj))) - 0 - (none) - ) - -(defmethod draw hud-ruffians ((obj hud-ruffians)) - (set-hud-piece-position! - (-> obj sprites 2) - (the int (+ 20.0 (* -130.0 (-> obj offset)))) - (the int (+ 15.0 (* -100.0 (-> obj offset)))) - ) - (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 15 2) - (set-hud-piece-position! - (-> obj sprites 6) - (the int (+ 100.0 (* -130.0 (-> obj offset)))) - (the int (+ 15.0 (* -100.0 (-> obj offset)))) - ) - (set! (-> obj sprites 4 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 1 current)) 100))))) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 6)) 40 16) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 6)) 1 16) - (set-as-offset-from! (-> obj sprites 7) (the-as vector4w (-> obj sprites 6)) 15 2) - (set-hud-piece-position! - (-> obj sprites 10) - (the int (+ 20.0 (* -130.0 (-> obj offset)))) - (the int (+ 85.0 (* -100.0 (-> obj offset)))) - ) - (set! (-> obj sprites 8 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 2 current)) 100))))) - (set-as-offset-from! (-> obj sprites 8) (the-as vector4w (-> obj sprites 10)) 40 16) - (set-as-offset-from! (-> obj sprites 9) (the-as vector4w (-> obj sprites 10)) 1 16) - (set-as-offset-from! (-> obj sprites 11) (the-as vector4w (-> obj sprites 10)) 15 2) - ((method-of-type hud draw) obj) - 0 - (none) - ) - -(defmethod update-values hud-ruffians ((obj hud-ruffians)) - (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) - (set! (-> obj values 1 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) - (set! (-> obj values 2 target) (the int (* 100.0 (-> *game-info* bot-health 2)))) - ((method-of-type hud update-values) obj) - 0 - (none) - ) - -(defmethod init-callback hud-ruffians ((obj hud-ruffians)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod bot-method-216 jinx ((this jinx)) + (set! (-> this health-handle) + (ppointer->handle (process-spawn hud-ruffians :init hud-init-by-other :to this)) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 scale-x) 12.0) - (set! (-> obj sprites 0 scale-y) 11.2) - (set! (-> obj sprites 0 pos z) #xfffff2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd57))) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.4) - (set! (-> obj sprites 3 pos z) #xffffff) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 4 scale-x) 12.0) - (set! (-> obj sprites 4 scale-y) 11.2) - (set! (-> obj sprites 4 pos z) #xfffff2) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 5 pos z) #xfffff0) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 6 pos z) #xffffff) - (set! (-> obj sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd57))) - (set! (-> obj sprites 7 scale-x) 1.0) - (set! (-> obj sprites 7 scale-y) 1.4) - (set! (-> obj sprites 7 pos z) #xffffff) - (set! (-> obj sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 8 scale-x) 12.0) - (set! (-> obj sprites 8 scale-y) 11.2) - (set! (-> obj sprites 8 pos z) #xfffff2) - (set! (-> obj sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 9 pos z) #xfffff0) - (set! (-> obj sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 10 pos z) #xffffff) - (set! (-> obj sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xd57))) - (set! (-> obj sprites 11 scale-x) 1.0) - (set! (-> obj sprites 11 scale-y) 1.4) - (set! (-> obj sprites 11 pos z) #xffffff) + 0 + (none) + ) + +(defmethod draw hud-ruffians ((this hud-ruffians)) + (set-hud-piece-position! + (-> this sprites 2) + (the int (+ 20.0 (* -130.0 (-> this offset)))) + (the int (+ 15.0 (* -100.0 (-> this offset)))) + ) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 15 2) + (set-hud-piece-position! + (-> this sprites 6) + (the int (+ 100.0 (* -130.0 (-> this offset)))) + (the int (+ 15.0 (* -100.0 (-> this offset)))) + ) + (set! (-> this sprites 4 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 1 current)) 100))))) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 6)) 40 16) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 6)) 1 16) + (set-as-offset-from! (-> this sprites 7) (the-as vector4w (-> this sprites 6)) 15 2) + (set-hud-piece-position! + (-> this sprites 10) + (the int (+ 20.0 (* -130.0 (-> this offset)))) + (the int (+ 85.0 (* -100.0 (-> this offset)))) + ) + (set! (-> this sprites 8 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 2 current)) 100))))) + (set-as-offset-from! (-> this sprites 8) (the-as vector4w (-> this sprites 10)) 40 16) + (set-as-offset-from! (-> this sprites 9) (the-as vector4w (-> this sprites 10)) 1 16) + (set-as-offset-from! (-> this sprites 11) (the-as vector4w (-> this sprites 10)) 15 2) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values hud-ruffians ((this hud-ruffians)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + (set! (-> this values 1 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) + (set! (-> this values 2 target) (the int (* 100.0 (-> *game-info* bot-health 2)))) + ((method-of-type hud update-values) this) + 0 + (none) + ) + +(defmethod init-callback hud-ruffians ((this hud-ruffians)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd57))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.4) + (set! (-> this sprites 3 pos z) #xffffff) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 4 scale-x) 12.0) + (set! (-> this sprites 4 scale-y) 11.2) + (set! (-> this sprites 4 pos z) #xfffff2) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 5 pos z) #xfffff0) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 6 pos z) #xffffff) + (set! (-> this sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd57))) + (set! (-> this sprites 7 scale-x) 1.0) + (set! (-> this sprites 7 scale-y) 1.4) + (set! (-> this sprites 7 pos z) #xffffff) + (set! (-> this sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 8 scale-x) 12.0) + (set! (-> this sprites 8 scale-y) 11.2) + (set! (-> this sprites 8 pos z) #xfffff2) + (set! (-> this sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 9 pos z) #xfffff0) + (set! (-> this sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 10 pos z) #xffffff) + (set! (-> this sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xd57))) + (set! (-> this sprites 11 scale-x) 1.0) + (set! (-> this sprites 11 scale-y) 1.4) + (set! (-> this sprites 11 pos z) #xffffff) 0 (none) ) diff --git a/goal_src/jak2/levels/sewer/escort/mog.gc b/goal_src/jak2/levels/sewer/escort/mog.gc index 28ff4192a5..44e876892f 100644 --- a/goal_src/jak2/levels/sewer/escort/mog.gc +++ b/goal_src/jak2/levels/sewer/escort/mog.gc @@ -197,9 +197,9 @@ 0 ) -(defmethod init-enemy-collision! mog ((obj mog)) +(defmethod init-enemy-collision! mog ((this mog)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -264,79 +264,79 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 6)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! mog ((obj mog)) +(defmethod init-enemy! mog ((this mog)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type jinx init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set-enemy-info! obj *mog-nav-enemy-info*) - (set! (-> obj channel) (the-as uint 23)) - (set! (-> obj spot-color) (the-as uint #x50ff0000)) - (set-vector! (-> obj root scale) 1.15 1.15 1.15 1.0) - (set! (-> obj skel prebind-function) mog-prebind-function) - (set! (-> obj min-speed) 14336.0) - (set! (-> obj max-speed) 32768.0) - (set! (-> obj follow-offset) -20480.0) - (set! (-> obj bot-health-index) 2) - (setup-masks (-> obj draw) #x26002 #x19ffc) + (set-enemy-info! this *mog-nav-enemy-info*) + (set! (-> this channel) (the-as uint 23)) + (set! (-> this spot-color) (the-as uint #x50ff0000)) + (set-vector! (-> this root scale) 1.15 1.15 1.15 1.0) + (set! (-> this skel prebind-function) mog-prebind-function) + (set! (-> this min-speed) 14336.0) + (set! (-> this max-speed) 32768.0) + (set! (-> this follow-offset) -20480.0) + (set! (-> this bot-health-index) 2) + (setup-masks (-> this draw) #x26002 #x19ffc) (none) ) -(defmethod ruffian-method-244 mog ((obj mog)) +(defmethod ruffian-method-244 mog ((this mog)) (with-pp - (ruffian-method-245 obj) - (let ((f30-0 (-> obj nav state speed))) + (ruffian-method-245 this) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 12288.0 40960.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-9 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-9 (= v1-9 (-> obj draw art-group data 36))) - (let ((v1-14 (-> obj skel root-channel 1))) + ((and v1-9 (= v1-9 (-> this draw art-group data 36))) + (let ((v1-14 (-> this skel root-channel 1))) (set! (-> v1-14 frame-interp 1) f28-0) (set! (-> v1-14 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 20.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) - (a0-11 (-> obj skel root-channel 0)) + (a0-11 (-> this skel root-channel 0)) ) (set! (-> a0-11 param 0) f0-11) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-12 (-> obj skel root-channel 1))) + (let ((a0-12 (-> this skel root-channel 1))) (set! (-> a0-12 param 0) 0.0) (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 dist) 13107.2) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 36))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 36))) (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 36)) num-func-loop!) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 36)) num-func-loop!) ) - (let ((a0-15 (-> obj skel root-channel 1))) + (let ((a0-15 (-> this skel root-channel 1))) (set! (-> a0-15 frame-interp 1) f28-0) (set! (-> a0-15 frame-interp 0) f28-0) (set! (-> a0-15 dist) 21843.969) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 37))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 37))) (set! (-> a0-15 param 0) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 37)) num-func-chan) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 37)) num-func-chan) ) ) ) diff --git a/goal_src/jak2/levels/sewer/gator.gc b/goal_src/jak2/levels/sewer/gator.gc index 1a77f731a4..28f7eadc12 100644 --- a/goal_src/jak2/levels/sewer/gator.gc +++ b/goal_src/jak2/levels/sewer/gator.gc @@ -144,49 +144,49 @@ (set! (-> *gator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler gator ((obj gator) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler gator ((this gator) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case event-type (('hit-knocked) - (when (= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + (when (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) 0 ) - ((method-of-type nav-enemy general-event-handler) obj proc arg2 event-type event) + ((method-of-type nav-enemy general-event-handler) this proc arg2 event-type event) ) (('track) #f ) (else - ((method-of-type nav-enemy general-event-handler) obj proc arg2 event-type event) + ((method-of-type nav-enemy general-event-handler) this proc arg2 event-type event) ) ) ) -(defmethod adjust-depth! gator ((obj gator)) +(defmethod adjust-depth! gator ((this gator)) "Changes the height based on the ocean depth @see [[get-height]]" - (set! (-> obj ocean-y) (get-height *ocean* (-> obj root trans) #t)) - (set! (-> obj root trans y) (+ -10240.0 (-> obj ocean-y))) + (set! (-> this ocean-y) (get-height *ocean* (-> this root trans) #t)) + (set! (-> this root trans y) (+ -10240.0 (-> this ocean-y))) ) -(defmethod update-facing! gator ((obj gator) (arg0 vector)) +(defmethod update-facing! gator ((this gator) (arg0 vector)) "Updates the `new-facing` vector" - (let ((matrix (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat)))) + (let ((matrix (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)))) (set! (-> arg0 quad) (-> matrix vector 2 quad)) ) arg0 ) -(defmethod encircle-target! gator ((obj gator) (arg0 float) (arg1 float) (arg2 symbol)) +(defmethod encircle-target! gator ((this gator) (arg0 float) (arg1 float) (arg2 symbol)) "Core movement for the [[gator]], circles the target, charges at the target, etc @params TODO - not sure, they all dont seem to do very much and this method is a mess" (local-vars (v1-17 object) (a0-5 object)) - (let ((f30-0 (vector-dot (-> obj new-facing) (-> obj old-facing))) + (let ((f30-0 (vector-dot (-> this new-facing) (-> this old-facing))) (s5-0 75) - (s4-0 (the-as art-joint-anim (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (s4-0 (the-as art-joint-anim (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) @@ -194,80 +194,80 @@ (b! (not arg2) cfg-26 :delay (nop!)) (set! s5-0 18) (b! (>= f30-0 (cos (* 182.04445 arg0))) cfg-8 :delay #f) - (if (< (-> (vector-cross! (new 'stack-no-clear 'vector) (-> obj new-facing) (-> obj old-facing)) y) 0.0) - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 40))) - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 39))) + (if (< (-> (vector-cross! (new 'stack-no-clear 'vector) (-> this new-facing) (-> this old-facing)) y) 0.0) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 40))) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 39))) ) (b! #t cfg-25 :delay (nop!)) (label cfg-8) (let ((v1-16 (< (cos (* 182.04445 arg1)) f30-0))) (b! v1-16 cfg-23 :likely-delay (set! v1-17 v1-16)) ) - (let ((v1-20 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-20 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (b! (not v1-20) cfg-21 :likely-delay (set! a0-5 v1-20)) - (let ((a1-3 (= v1-20 (-> obj draw art-group data 14)))) + (let ((a1-3 (= v1-20 (-> this draw art-group data 14)))) (b! a1-3 cfg-21 :likely-delay (set! a0-5 a1-3)) ) - (let ((a1-4 (= v1-20 (-> obj draw art-group data 40)))) + (let ((a1-4 (= v1-20 (-> this draw art-group data 40)))) (b! a1-4 cfg-21 :likely-delay (set! a0-5 a1-4)) ) - (set! a0-5 (= v1-20 (-> obj draw art-group data 39))) + (set! a0-5 (= v1-20 (-> this draw art-group data 39))) ) (label cfg-21) (b! (not a0-5) cfg-23 :delay (set! v1-17 #t)) (set! v1-17 #f) (label cfg-23) (if v1-17 - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 14))) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 14))) ) (label cfg-25) (b! #t cfg-48 :delay (nop!)) (label cfg-26) (b! (>= f30-0 (cos (* 182.04445 arg0))) cfg-31 :delay #f) - (if (< (-> (vector-cross! (new 'stack-no-clear 'vector) (-> obj new-facing) (-> obj old-facing)) y) 0.0) - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 38))) - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 37))) + (if (< (-> (vector-cross! (new 'stack-no-clear 'vector) (-> this new-facing) (-> this old-facing)) y) 0.0) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 38))) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 37))) ) (b! #t cfg-48 :delay (nop!)) (label cfg-31) - (if (or (< (cos (* 182.04445 arg1)) f30-0) (let ((v1-41 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (if (or (< (cos (* 182.04445 arg1)) f30-0) (let ((v1-41 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (not (and v1-41 (or (= v1-41 (-> obj draw art-group data 13)) - (= v1-41 (-> obj draw art-group data 38)) - (= v1-41 (-> obj draw art-group data 37)) + (not (and v1-41 (or (= v1-41 (-> this draw art-group data 13)) + (= v1-41 (-> this draw art-group data 38)) + (= v1-41 (-> this draw art-group data 37)) ) ) ) ) ) - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 13))) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 13))) ) (label cfg-48) - (let ((v1-50 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-50 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (when (and (not (and v1-50 (= v1-50 (the-as art-element s4-0)))) - (>= (- (current-time) (the-as time-frame s5-0)) (-> obj turn-time)) + (time-elapsed? (the-as time-frame s5-0) (-> this turn-time)) ) (let ((f30-2 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) (ja-channel-push! 1 (the-as time-frame s5-0)) - (set! (-> obj skel root-channel 0 frame-group) s4-0) - (let ((s5-1 (-> obj skel root-channel 0))) + (set! (-> this skel root-channel 0 frame-group) s4-0) + (let ((s5-1 (-> this skel root-channel 0))) (set! (-> s5-1 num-func) num-func-identity) (set! (-> s5-1 frame-num) (* f30-2 (the float (ja-num-frames 0)))) ) ) (let ((v0-4 (current-time))) - (set! (-> obj turn-time) v0-4) + (set! (-> this turn-time) v0-4) v0-4 ) ) @@ -276,32 +276,32 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod track-target! gator ((obj gator)) +(defmethod track-target! gator ((this gator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((func (method-of-type nav-enemy track-target!))) - (func obj) + (func this) ) - (adjust-depth! obj) - (set! (-> obj old-facing quad) (-> obj new-facing quad)) - (update-facing! obj (-> obj new-facing)) + (adjust-depth! this) + (set! (-> this old-facing quad) (-> this new-facing quad)) + (update-facing! this (-> this new-facing)) (none) ) -(defmethod damage-amount-from-attack gator ((obj gator) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack gator ((this gator) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) -(defmethod go-hostile gator ((obj gator)) - (go (method-of-object obj hostile)) +(defmethod go-hostile gator ((this gator)) + (go (method-of-object this hostile)) ) -(defmethod get-enemy-target gator ((obj gator)) +(defmethod get-enemy-target gator ((this gator)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" - (let ((enemy-target ((method-of-type nav-enemy get-enemy-target) obj))) + (let ((enemy-target ((method-of-type nav-enemy get-enemy-target) this))) (if (and enemy-target (< (+ 1024.0 (get-height *ocean* (get-trans enemy-target 0) #t)) (-> (get-trans enemy-target 1) y)) ) @@ -311,7 +311,7 @@ ) ) -(defmethod in-aggro-range? gator ((obj gator) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? gator ((this gator) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -324,7 +324,7 @@ (set! arg1 target-pos) ) ) - ((method-of-type nav-enemy in-aggro-range?) obj arg0 arg1) + ((method-of-type nav-enemy in-aggro-range?) this arg0 arg1) ) (defstate hostile (gator) @@ -487,7 +487,7 @@ (defstate stare (gator) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let ((func (-> (method-of-type nav-enemy stare) trans))) @@ -495,7 +495,7 @@ (func) ) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.017)) + (if (time-elapsed? (-> self state-time) (seconds 0.017)) (go-virtual pacing) ) ) @@ -511,14 +511,14 @@ ) ) -(defmethod coin-flip? gator ((obj gator)) +(defmethod coin-flip? gator ((this gator)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod init-enemy-collision! gator ((obj gator)) +(defmethod init-enemy-collision! gator ((this gator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -583,28 +583,28 @@ (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) (set! (-> cshape max-iteration-count) (the-as uint 3)) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) 0 (none) ) -(defmethod init-enemy! gator ((obj gator)) +(defmethod init-enemy! gator ((this gator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gator" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *gator-nav-enemy-info*) - (let ((nav (-> obj nav))) + (init-enemy-behaviour-and-stats! this *gator-nav-enemy-info*) + (let ((nav (-> this nav))) (set! (-> nav speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (adjust-depth! obj) - (set! (-> obj turn-time) 0) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (adjust-depth! this) + (set! (-> this turn-time) 0) 0 (none) ) diff --git a/goal_src/jak2/levels/sewer/grim2-course.gc b/goal_src/jak2/levels/sewer/grim2-course.gc index c2f6c58974..6fd9cc8b19 100644 --- a/goal_src/jak2/levels/sewer/grim2-course.gc +++ b/goal_src/jak2/levels/sewer/grim2-course.gc @@ -16,14 +16,15 @@ ) -(defmethod go-idle grim-sewer ((obj grim-sewer)) +;; WARN: Return type mismatch object vs none. +(defmethod go-idle grim-sewer ((this grim-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (ruffian-method-240 obj) + (ruffian-method-240 this) ) ) (none) @@ -420,7 +421,7 @@ :nav-mesh-index 2 :skip-to -1 :on-set (lambda ((arg0 grim-sewer)) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) (logior! (-> arg0 bot-flags) (bot-flags bf19)) (clear-poi-and-focus! arg0) (logclear! (-> arg0 focus-status) (focus-status disable)) @@ -434,7 +435,7 @@ (set! (-> (the-as ruft-wait-spot v1-12) check-done) (the-as (function ruft-wait-spot ruffian symbol) - (lambda ((arg0 object) (arg1 grim-sewer)) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) + (lambda ((arg0 object) (arg1 grim-sewer)) (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 16 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) diff --git a/goal_src/jak2/levels/sewer/hal2-course.gc b/goal_src/jak2/levels/sewer/hal2-course.gc index 3deab746e5..35ad420549 100644 --- a/goal_src/jak2/levels/sewer/hal2-course.gc +++ b/goal_src/jak2/levels/sewer/hal2-course.gc @@ -39,47 +39,47 @@ ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hal-sewer ((obj hal-sewer)) +(defmethod go-idle hal-sewer ((this hal-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) ) ;; WARN: Return type mismatch float vs none. -(defmethod init! hal-sewer ((obj hal-sewer)) +(defmethod init! hal-sewer ((this hal-sewer)) "Set defaults for various fields." (let ((t9-0 (method-of-type hal init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj too-far-warn-dist-default) 409600.0) - (set! (-> obj too-far-fail-dist-delta-default) 163840.0) + (set! (-> this too-far-warn-dist-default) 409600.0) + (set! (-> this too-far-fail-dist-delta-default) 163840.0) (none) ) -(defmethod general-event-handler hal-sewer ((obj hal-sewer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler hal-sewer ((this hal-sewer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('notify) (case (-> arg3 param 0) (('jinx-bomb) - (logior! (-> obj bot-task-bits) (bot-task-bits botbits-0)) + (logior! (-> this bot-task-bits) (bot-task-bits botbits-0)) #t ) (else - ((method-of-type hal general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hal general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type hal general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hal general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -173,7 +173,7 @@ ) ) -(defmethod hal-sewer-method-229 hal-sewer ((obj hal-sewer)) +(defmethod hal-sewer-method-229 hal-sewer ((this hal-sewer)) (let ((a0-1 *target*)) (when a0-1 (let ((v1-1 (get-trans a0-1 0))) @@ -187,9 +187,9 @@ ) ) -(defmethod hal-sewer-method-231 hal-sewer ((obj hal-sewer) (arg0 int)) +(defmethod hal-sewer-method-231 hal-sewer ((this hal-sewer) (arg0 int)) (countdown (v1-0 3) - (let* ((a2-4 (-> obj actor-group 0 data (+ arg0 v1-0) actor)) + (let* ((a2-4 (-> this actor-group 0 data (+ arg0 v1-0) actor)) (a3-2 (if a2-4 (-> a2-4 extra process) ) @@ -203,7 +203,7 @@ #t ) -(defmethod hal-sewer-method-230 hal-sewer ((obj hal-sewer) (arg0 process-focusable) (arg1 process-focusable)) +(defmethod hal-sewer-method-230 hal-sewer ((this hal-sewer) (arg0 process-focusable) (arg1 process-focusable)) (when (and arg0 arg1) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 start-pos quad) (-> arg0 root trans quad)) @@ -222,8 +222,8 @@ ) ) -(defmethod hal-sewer-method-227 hal-sewer ((obj hal-sewer)) - (let* ((a0-1 (-> obj actor-group 0 data 1 actor)) +(defmethod hal-sewer-method-227 hal-sewer ((this hal-sewer)) + (let* ((a0-1 (-> this actor-group 0 data 1 actor)) (v1-3 (if a0-1 (-> a0-1 extra process) ) @@ -235,7 +235,7 @@ (s4-0 (-> (the-as process-drawable v1-3) root trans)) ) (countdown (s3-0 3) - (let* ((v1-10 (-> obj actor-group 0 data (+ s3-0 7) actor)) + (let* ((v1-10 (-> this actor-group 0 data (+ s3-0 7) actor)) (s2-0 (if v1-10 (-> v1-10 extra process) ) @@ -253,9 +253,9 @@ ) ) (when s5-0 - (let* ((a0-5 obj) + (let* ((a0-5 this) (t9-1 (method-of-object a0-5 hal-sewer-method-230)) - (v1-23 (-> obj actor-group 0 data 1 actor)) + (v1-23 (-> this actor-group 0 data 1 actor)) ) (t9-1 a0-5 @@ -273,11 +273,11 @@ ) ;; WARN: Return type mismatch bot-flags vs none. -(defmethod hal-sewer-method-228 hal-sewer ((obj hal-sewer)) +(defmethod hal-sewer-method-228 hal-sewer ((this hal-sewer)) (with-pp - (let ((s5-0 (-> obj actor-group 0 data 18))) + (let ((s5-0 (-> this actor-group 0 data 18))) (cond - ((logtest? (bot-flags bf22) (-> obj bot-flags)) + ((logtest? (bot-flags bf22) (-> this bot-flags)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 1) @@ -324,8 +324,8 @@ ) ) ) - (logclear! (-> obj bot-flags) (bot-flags bf22)) - (logior! (-> obj bot-flags) (bot-flags bf23)) + (logclear! (-> this bot-flags) (bot-flags bf22)) + (logior! (-> this bot-flags) (bot-flags bf23)) ) ) ) @@ -333,7 +333,7 @@ ) ) ) - ((logtest? (bot-flags bf23) (-> obj bot-flags)) + ((logtest? (bot-flags bf23) (-> this bot-flags)) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) (process->ppointer pp)) (set! (-> a1-3 num-params) 1) @@ -350,7 +350,7 @@ ) 0.0 ) - (logclear! (-> obj bot-flags) (bot-flags bf23)) + (logclear! (-> this bot-flags) (bot-flags bf23)) ) ) ) @@ -374,7 +374,7 @@ ) ) ) - (logior! (-> obj bot-flags) (bot-flags bf22)) + (logior! (-> this bot-flags) (bot-flags bf22)) ) ) ) @@ -505,7 +505,7 @@ (< -176128.0 (-> (target-pos 0) y)) ) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) ) (cond @@ -515,7 +515,7 @@ (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) #t ) - ((>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) + ((time-elapsed? (-> arg1 waypoint-time0) (seconds 0.5)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 3 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -563,20 +563,20 @@ ) ) ) - (if (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (if (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) (let ((a0-3 s3-0)) (and a0-3 (< (the-as int (send-event a0-3 'query 'waypoint)) 3)) ) ) (send-event s3-0 'request 'waypoint 3) ) - (if (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.75)) + (if (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.75)) (begin (set! a0-8 s4-0) a0-8) (< (the-as int (send-event a0-8 'query 'waypoint)) 3) ) (send-event s4-0 'request 'waypoint 3) ) - (if (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.9)) + (if (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.9)) (begin (set! a0-13 s5-0) a0-13) (< (the-as int (send-event a0-13 'query 'waypoint)) 3) ) @@ -680,7 +680,7 @@ ) (let ((a0-1 s3-0)) (if (and (and a0-1 (= (send-event a0-1 'query 'waypoint) 3)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.5)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.5)) ) (send-event s3-0 'request 'waypoint 9) ) @@ -695,19 +695,19 @@ ) (let ((a0-11 s5-0)) (if (and (and a0-11 (= (send-event a0-11 'query 'waypoint) 3)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.6)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.6)) ) (send-event s5-0 'request 'waypoint 9) ) ) (let ((a0-16 s4-0)) (if (and (and a0-16 (= (send-event a0-16 'query 'waypoint) 3)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.8)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.8)) ) (send-event s4-0 'request 'waypoint 9) ) ) - (when (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) + (when (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 4)) (not (speech-playing? arg1 2)) (not (channel-active? arg1 (the-as uint 0))) ) @@ -801,27 +801,27 @@ ) 1.0 ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) ) ) (let ((a0-3 s3-0)) (if (and (and a0-3 (= (send-event a0-3 'query 'waypoint) 9)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) ) (send-event s3-0 'request 'waypoint 11) ) ) (let ((a0-8 s4-0)) (if (and (and a0-8 (= (send-event a0-8 'query 'waypoint) 9)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.9)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.9)) ) (send-event s4-0 'request 'waypoint 11) ) ) (let ((a0-13 s5-0)) (if (and (and a0-13 (= (send-event a0-13 'query 'waypoint) 9)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.7)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.7)) ) (send-event s5-0 'request 'waypoint 11) ) @@ -1617,7 +1617,7 @@ #t ) (else - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) #f ) ) @@ -1689,7 +1689,7 @@ (-> v1-13 extra process) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.4)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.4)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 2) @@ -1708,7 +1708,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.75)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.75)) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer pp)) (set! (-> a1-2 num-params) 2) @@ -1728,7 +1728,7 @@ ) ) (if (and (not (speech-playing? arg1 28)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (not (channel-active? arg1 (the-as uint 0))) ) (play-speech arg1 28) @@ -1824,7 +1824,7 @@ (lambda ((arg0 object) (arg1 hal-sewer)) (with-pp (cond - ((>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.5)) + ((time-elapsed? (-> arg1 waypoint-time0) (seconds 1.5)) (cond ((logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (when (and (not (speech-playing? arg1 29)) (not (speech-playing? arg1 30))) @@ -1866,7 +1866,7 @@ (-> v1-44 extra process) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer pp)) (set! (-> a1-10 num-params) 2) @@ -1885,7 +1885,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.5)) (let ((a1-11 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-11 from) (process->ppointer pp)) (set! (-> a1-11 num-params) 2) @@ -1904,7 +1904,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3.5)) (let ((a1-12 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-12 from) (process->ppointer pp)) (set! (-> a1-12 num-params) 2) @@ -2128,7 +2128,7 @@ #t ) ) - ((and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) + ((and (time-elapsed? (-> arg1 waypoint-time0) (seconds 4)) (>= (vector4-dot (math-camera-pos) (the-as vector (-> arg1 test-plane))) 0.0) ) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -2223,7 +2223,7 @@ ) ) (hal-sewer-method-228 arg1) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.75)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.75)) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer pp)) (set! (-> a1-8 num-params) 2) @@ -2242,7 +2242,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2.75)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.75)) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-9 from) (process->ppointer pp)) (set! (-> a1-9 num-params) 2) @@ -2261,7 +2261,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3.5)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer pp)) (set! (-> a1-10 num-params) 2) @@ -2352,10 +2352,10 @@ ) ) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.75)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.75)) (send-event s4-0 'request 'waypoint 34) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2.25)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.25)) (send-event s3-0 'request 'waypoint 34) ) (when (and (not (channel-active? arg1 (the-as uint 0))) @@ -2551,7 +2551,7 @@ ) 1.0 ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (else (if (and (not (speech-playing? arg1 46)) (not (channel-active? arg1 (the-as uint 0)))) @@ -2563,21 +2563,21 @@ ) (let ((a0-6 s3-0)) (if (and (and a0-6 (= (send-event a0-6 'query 'waypoint) 35)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) ) (send-event s3-0 'request 'waypoint 37) ) ) (let ((a0-11 s4-0)) (if (and (and a0-11 (= (send-event a0-11 'query 'waypoint) 35)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.9)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.9)) ) (send-event s4-0 'request 'waypoint 37) ) ) (let ((a0-16 s5-0)) (if (and (and a0-16 (= (send-event a0-16 'query 'waypoint) 35)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.7)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.7)) ) (send-event s5-0 'request 'waypoint 37) ) @@ -2728,7 +2728,7 @@ ) (cond ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.5)) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) (process->ppointer pp)) @@ -2753,7 +2753,7 @@ #f ) ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 4)) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer pp)) @@ -2774,7 +2774,7 @@ #f ) ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 5)) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) (let ((a1-11 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-11 from) (process->ppointer pp)) @@ -2881,10 +2881,10 @@ ) ) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.4)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.4)) (send-event s4-0 'request 'waypoint 42) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.7)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.7)) (send-event s5-0 'request 'waypoint 42) ) (cond @@ -2972,7 +2972,7 @@ ((logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-2 botbits-4)) (logclear! (-> arg1 bot-flags) (bot-flags bf24)) (reset-warn-time! arg1) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (when (not (channel-active? arg1 (the-as uint 0))) (let ((v1-22 *target*)) (when (and v1-22 (focus-test? v1-22 in-air) (not (logtest? (-> v1-22 focus-status) (focus-status hit)))) @@ -2994,11 +2994,11 @@ ) ((channel-active? arg1 (the-as uint 0)) (reset-warn-time! arg1) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 11)) - (set! (-> arg1 waypoint-time0) (current-time)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 11)) + (set-time! (-> arg1 waypoint-time0)) (let ((v1-55 (-> arg1 sentries1-reminder-index)) (a1-14 (-> arg1 hal2-course sentries1-reminders)) ) @@ -3105,10 +3105,10 @@ ) ) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.2)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.2)) (send-event s4-0 'request 'waypoint 44) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.4)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.4)) (send-event s5-0 'request 'waypoint 44) ) (cond @@ -3196,7 +3196,7 @@ ((logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-3 botbits-5)) (logclear! (-> arg1 bot-flags) (bot-flags bf24)) (reset-warn-time! arg1) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (when (not (channel-active? arg1 (the-as uint 0))) (let ((v1-22 *target*)) (when (and v1-22 (focus-test? v1-22 in-air) (not (logtest? (-> v1-22 focus-status) (focus-status hit)))) @@ -3214,10 +3214,10 @@ ) ((channel-active? arg1 (the-as uint 0)) (reset-warn-time! arg1) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 9)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 9)) (let ((v1-46 (-> arg1 sentries2-reminder-index)) (a1-11 (-> arg1 hal2-course sentries2-reminders)) ) @@ -3225,10 +3225,10 @@ ((< v1-46 (-> a1-11 length)) (set! (-> arg1 sentries2-reminder-index) (+ v1-46 1)) (play-speech arg1 (-> a1-11 v1-46)) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (else - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 20)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 20)) (logior! (-> arg1 bot-flags) (bot-flags bf24)) ) ) @@ -3301,7 +3301,7 @@ ) ) (when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.25)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.25)) ) (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -3470,10 +3470,10 @@ ) ) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.2)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.2)) (send-event s3-0 'request 'waypoint 48) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.4)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.4)) (send-event s4-0 'request 'waypoint 48) ) ) @@ -3921,18 +3921,18 @@ ) ) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (send-event s5-0 'request 'waypoint 59) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (send-event s3-0 'request 'waypoint 59) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 4)) (send-event s4-0 'request 'waypoint 59) ) (when (not (channel-active? arg1 (the-as uint 0))) (cond - ((and (not (speech-playing? arg1 75)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 6))) + ((and (not (speech-playing? arg1 75)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 6))) (play-speech arg1 75) (play-speech arg1 76) ) diff --git a/goal_src/jak2/levels/sewer/hosehead-fake.gc b/goal_src/jak2/levels/sewer/hosehead-fake.gc index 0aa2a0ae1c..9b52650fc2 100644 --- a/goal_src/jak2/levels/sewer/hosehead-fake.gc +++ b/goal_src/jak2/levels/sewer/hosehead-fake.gc @@ -50,11 +50,11 @@ ) -(defmethod print-def hosehead-fake ((obj hosehead-fake)) - (let ((s5-0 (-> obj root))) +(defmethod print-def hosehead-fake ((this hosehead-fake)) + (let ((s5-0 (-> this root))) (format #t "~%") (format #t "(def-hosehead-fake~%") - (format #t " :id ~d~%" (-> obj id)) + (format #t " :id ~d~%" (-> this id)) (format #t " :trans-x ~M~%" (-> s5-0 trans x)) (format #t " :trans-y ~M~%" (-> s5-0 trans y)) (format #t " :trans-z ~M~%" (-> s5-0 trans z)) @@ -63,7 +63,7 @@ (format #t " :quat-z ~f~%" (-> s5-0 quat z)) (format #t " :quat-w ~f~%" (-> s5-0 quat w)) ) - (let ((a0-11 (-> obj info))) + (let ((a0-11 (-> this info))) (when a0-11 (let ((f0-7 (-> a0-11 walk-dist))) (if (!= f0-7 0.0) @@ -78,15 +78,15 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw hosehead-fake ((obj hosehead-fake)) - (let ((a2-0 (-> obj info))) +(defmethod debug-draw hosehead-fake ((this hosehead-fake)) + (let ((a2-0 (-> this info))) (when a2-0 (if (!= (-> a2-0 walk-dist) 0.0) (add-debug-line #t (bucket-id debug-no-zbuf1) (-> a2-0 trans) - (-> obj walk-dest) + (-> this walk-dest) (new 'static 'rgba :r #xff :g #xff :a #x80) #f (the-as rgba -1) diff --git a/goal_src/jak2/levels/sewer/hosehead.gc b/goal_src/jak2/levels/sewer/hosehead.gc index b8b9d43a58..99d5245a35 100644 --- a/goal_src/jak2/levels/sewer/hosehead.gc +++ b/goal_src/jak2/levels/sewer/hosehead.gc @@ -309,9 +309,9 @@ (set! (-> *hosehead-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod init-enemy-collision! hosehead ((obj hosehead)) +(defmethod init-enemy-collision! hosehead ((this hosehead)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -374,7 +374,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -440,31 +440,31 @@ ) ) -(defmethod enemy-method-77 hosehead ((obj hosehead) (arg0 (pointer float))) +(defmethod enemy-method-77 hosehead ((this hosehead) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-1 (ash 1 (-> *hosehead-global-info* prev-yellow-hit))) - (v1-18 (enemy-method-120 obj 2 a2-1)) - (a1-8 (-> obj draw art-group data (-> *hosehead-global-info* yellow-hit-anim v1-18 hit-index))) + (v1-18 (enemy-method-120 this 2 a2-1)) + (a1-8 (-> this draw art-group data (-> *hosehead-global-info* yellow-hit-anim v1-18 hit-index))) ) (set! (-> *hosehead-global-info* prev-yellow-hit) v1-18) - (let ((a0-15 (-> obj skel root-channel 0))) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-8)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1))) (set! (-> a0-15 param 1) (-> arg0 0)) @@ -475,11 +475,11 @@ ) (((knocked-type knocked-type-6)) (let* ((a2-3 (ash 1 (-> *hosehead-global-info* prev-blue-hit))) - (v1-27 (enemy-method-120 obj 3 a2-3)) - (a1-13 (-> obj draw art-group data (-> *hosehead-global-info* blue-hit-anim v1-27 hit-index))) + (v1-27 (enemy-method-120 this 3 a2-3)) + (a1-13 (-> this draw art-group data (-> *hosehead-global-info* blue-hit-anim v1-27 hit-index))) ) (set! (-> *hosehead-global-info* prev-blue-hit) v1-27) - (let ((a0-27 (-> obj skel root-channel 0))) + (let ((a0-27 (-> this skel root-channel 0))) (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-13)) (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-13) frames num-frames) -1))) (set! (-> a0-27 param 1) 1.0) @@ -491,11 +491,11 @@ (else (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-5 (ash 1 (-> *hosehead-global-info* prev-knocked))) - (v1-37 (enemy-method-120 obj 2 a2-5)) - (a1-19 (-> obj draw art-group data (-> *hosehead-global-info* knocked-anim v1-37 hit-index))) + (v1-37 (enemy-method-120 this 2 a2-5)) + (a1-19 (-> this draw art-group data (-> *hosehead-global-info* knocked-anim v1-37 hit-index))) ) (set! (-> *hosehead-global-info* prev-knocked) v1-37) - (let ((a0-39 (-> obj skel root-channel 0))) + (let ((a0-39 (-> this skel root-channel 0))) (set! (-> a0-39 frame-group) (the-as art-joint-anim a1-19)) (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim a1-19) frames num-frames) -1))) (set! (-> a0-39 param 1) (-> arg0 0)) @@ -510,28 +510,28 @@ ) ) -(defmethod enemy-method-78 hosehead ((obj hosehead) (arg0 (pointer float))) +(defmethod enemy-method-78 hosehead ((this hosehead) (arg0 (pointer float))) (local-vars (v1-15 knocked-type)) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) ) #t ) - ((begin (set! v1-15 (-> obj incoming knocked-type)) (= v1-15 (knocked-type knocked-type-6))) + ((begin (set! v1-15 (-> this incoming knocked-type)) (= v1-15 (knocked-type knocked-type-6))) (let* ((a0-4 (-> *hosehead-global-info* prev-blue-hit)) - (s4-0 (-> obj draw art-group data (-> *hosehead-global-info* blue-hit-anim a0-4 land-index))) + (s4-0 (-> this draw art-group data (-> *hosehead-global-info* blue-hit-anim a0-4 land-index))) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-9 (-> obj skel root-channel 0))) + (let ((a0-9 (-> this skel root-channel 0))) (set! (-> a0-9 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-9 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-9 param 1) (-> arg0 0)) @@ -545,10 +545,10 @@ ) (else (let* ((a0-11 (-> *hosehead-global-info* prev-knocked)) - (s4-1 (-> obj draw art-group data (-> *hosehead-global-info* knocked-anim a0-11 land-index))) + (s4-1 (-> this draw art-group data (-> *hosehead-global-info* knocked-anim a0-11 land-index))) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-16 (-> obj skel root-channel 0))) + (let ((a0-16 (-> this skel root-channel 0))) (set! (-> a0-16 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-16 param 1) (-> arg0 0)) @@ -560,13 +560,13 @@ ) ) -(defmethod hosehead-method-189 hosehead ((obj hosehead)) - (let ((a0-2 (handle->process (-> obj focus handle)))) +(defmethod hosehead-method-189 hosehead ((this hosehead)) + (let ((a0-2 (handle->process (-> this focus handle)))) (when a0-2 (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-2) 1) quad)) (+! (-> s5-0 y) 8192.0) - (set! (-> obj target-pos quad) (-> s5-0 quad)) + (set! (-> this target-pos quad) (-> s5-0 quad)) ) ) ) @@ -574,7 +574,7 @@ (none) ) -(defmethod hosehead-method-190 hosehead ((obj hosehead)) +(defmethod hosehead-method-190 hosehead ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -583,11 +583,11 @@ (vf7 :class vf) ) (init-vf0-vector) - (hosehead-method-189 obj) + (hosehead-method-189 this) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((s4-0 (-> gp-0 start-pos))) - (let ((s3-0 (-> obj root trans))) - (let ((v1-4 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s3-0 (-> this root trans))) + (let ((v1-4 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-4 6144.0)) (.mov vf7 a0-4) ) @@ -600,7 +600,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s4-0 quad) vf6) ) - (vector-! (-> gp-0 move-dist) (-> obj target-pos) (-> gp-0 start-pos)) + (vector-! (-> gp-0 move-dist) (-> this target-pos) (-> gp-0 start-pos)) (let ((v1-7 gp-0)) (set! (-> v1-7 radius) 1024.0) (set! (-> v1-7 collide-with) (collide-spec backgnd enemy obstacle)) @@ -664,9 +664,9 @@ ) ) -(defmethod hosehead-method-197 hosehead ((obj hosehead)) +(defmethod hosehead-method-197 hosehead ((this hosehead)) (let ((s2-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> obj node-list data 12 bone transform)) + (let* ((a2-0 (-> this node-list data 12 bone transform)) (v1-2 (-> a2-0 quad 0)) (a0-1 (-> a2-0 quad 1)) (a1-0 (-> a2-0 quad 2)) @@ -682,13 +682,18 @@ (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (seek! (-> obj lazer-length) 327680.0 (* 327680.0 (seconds-per-frame))) - (vector-normalize-copy! s5-0 (-> s2-0 vector 1) (-> obj lazer-length)) + (seek! (-> this lazer-length) 327680.0 (* 327680.0 (seconds-per-frame))) + (vector-normalize-copy! s5-0 (-> s2-0 vector 1) (-> this lazer-length)) (matrix->trans s2-0 s4-0) - (set! (-> obj lazer-dist) - (lerp-scale 1.0 0.0 (point-line-distance (-> obj lazer-pos-sound) (-> obj target-pos) s4-0 s5-0) 0.0 40960.0) + (set! (-> this lazer-dist) (lerp-scale + 1.0 + 0.0 + (point-line-distance (-> this lazer-pos-sound) (-> this target-pos) s4-0 s5-0) + 0.0 + 40960.0 + ) ) - (vector-! (-> obj lazer-pos-sound) (-> obj target-pos) (-> obj lazer-pos-sound)) + (vector-! (-> this lazer-pos-sound) (-> this target-pos) (-> this lazer-pos-sound)) (set! (-> s3-0 start-pos quad) (-> s4-0 quad)) (set! (-> s3-0 move-dist quad) (-> s5-0 quad)) (let ((v1-9 s3-0)) @@ -712,7 +717,7 @@ ) (when s3-1 (if (logtest? (-> (the-as collide-shape-prim s3-1) prim-core collide-as) (collide-spec enemy)) - (go-hostile obj) + (go-hostile this) ) (if (logtest? (-> (the-as collide-shape-prim s3-1) prim-core collide-as) (collide-spec jak bot)) (send-event @@ -735,25 +740,25 @@ (let ((s5-1 sound-play-by-spec) (s4-1 (static-sound-spec "hosehead-lazer" :volume 0.0 :mask (pitch))) ) - (set! (-> s4-1 volume) (the int (* 1024.0 (lerp-scale 1.0 0.4 (-> obj lazer-dist) 1.0 0.0)))) + (set! (-> s4-1 volume) (the int (* 1024.0 (lerp-scale 1.0 0.4 (-> this lazer-dist) 1.0 0.0)))) (set! (-> s4-1 pitch-mod) 0) - (s5-1 s4-1 (-> obj lazer-sound) (-> obj lazer-pos-sound)) + (s5-1 s4-1 (-> this lazer-sound) (-> this lazer-pos-sound)) ) (let ((s5-2 sound-play-by-spec) (s4-2 (static-sound-spec "lazer-sub" :volume 0.0 :mask (pitch))) ) - (set! (-> s4-2 volume) (the int (* 1024.0 (lerp-scale 1.0 0.0 (-> obj lazer-dist) 1.0 0.5)))) + (set! (-> s4-2 volume) (the int (* 1024.0 (lerp-scale 1.0 0.0 (-> this lazer-dist) 1.0 0.5)))) (set! (-> s4-2 pitch-mod) 0) - (s5-2 s4-2 (-> obj lazer-sound2) (-> obj lazer-pos-sound)) + (s5-2 s4-2 (-> this lazer-sound2) (-> this lazer-pos-sound)) ) 0 (none) ) -(defmethod enemy-method-88 hosehead ((obj hosehead) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 hosehead ((this hosehead) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.075)) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info jump-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info jump-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -764,43 +769,43 @@ #t ) -(defmethod general-event-handler hosehead ((obj hosehead) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler hosehead ((this hosehead) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('cue-chase) (cond - ((-> obj on-wall?) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj notice-wall)) + ((-> this on-wall?) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this notice-wall)) ) - ((-> obj sentry?) - (when (and (-> obj next-state) (= (-> obj next-state name) 'idle-sentry)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj hostile-sentry)) + ((-> this sentry?) + (when (and (-> this next-state) (= (-> this next-state name) 'idle-sentry)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this hostile-sentry)) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('stop-sentry) - (set! (-> obj sentry?) #f) + (set! (-> this sentry?) #f) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; WARN: Return type mismatch vector vs none. -(defmethod hosehead-method-186 hosehead ((obj hosehead)) +(defmethod hosehead-method-186 hosehead ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -814,8 +819,8 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (let ((s2-0 gp-0)) - (let ((s1-0 (-> obj root trans))) - (let ((v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s1-0 (-> this root trans))) + (let ((v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-3 8192.0)) (.mov vf7 a0-3) ) @@ -834,7 +839,7 @@ (set! (-> s3-0 start-pos quad) (-> gp-0 quad)) (vector-float*! (-> s3-0 move-dist) - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) -16384.0 ) (let ((v1-9 s3-0)) @@ -867,7 +872,7 @@ (set! (-> s3-0 start-pos quad) (-> s5-0 quad)) (vector-float*! (-> s3-0 move-dist) - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) -16384.0 ) (let ((v1-16 s3-0)) @@ -898,7 +903,7 @@ ) ) (let ((s2-6 (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0)) - (s1-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (s1-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s3-1 (new 'stack-no-clear 'quaternion)) ) (let ((s0-0 (new 'stack-no-clear 'matrix))) @@ -908,17 +913,17 @@ (vector-rotate*! s2-6 s2-6 s0-0) ) (quaternion-look-at! s3-1 s2-6 *up-vector*) - (quaternion-pseudo-seek (-> obj root quat) (-> obj root quat) s3-1 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this root quat) (-> this root quat) s3-1 (seconds-per-frame)) ) - (vector-average! (-> obj root trans) gp-0 s5-0) + (vector-average! (-> this root trans) gp-0 s5-0) ) (none) ) ) -(defmethod hosehead-method-185 hosehead ((obj hosehead)) - (countdown (s5-0 (length (-> obj actor-group 1))) - (let* ((v1-5 (-> obj actor-group 1 data s5-0 actor)) +(defmethod hosehead-method-185 hosehead ((this hosehead)) + (countdown (s5-0 (length (-> this actor-group 1))) + (let* ((v1-5 (-> this actor-group 1 data s5-0 actor)) (a0-4 (if v1-5 (-> v1-5 extra process) ) @@ -937,7 +942,7 @@ :enter (-> (method-of-type nav-enemy idle) enter) :exit (-> (method-of-type nav-enemy idle) exit) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (let ((a0-3 (handle->process (-> self focus handle)))) (when a0-3 (let ((f0-0 (vector-vector-xz-distance (get-trans (the-as process-focusable a0-3) 0) (-> self root trans)))) @@ -979,7 +984,7 @@ (set! (-> self fire-beam?) #f) (set! (-> self allow-head) #t) (set! (-> self lazer-length) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (sound-stop (-> self lazer-sound)) @@ -1023,7 +1028,7 @@ ) (set! (-> self head-angle) f0-5) ) - (when (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (let ((a0-8 (handle->process (-> self focus handle)))) (when a0-8 (let ((f0-6 (vector-vector-xz-distance (get-trans (the-as process-focusable a0-8) 0) (-> self root trans)))) @@ -1084,14 +1089,14 @@ ) ) -(defmethod hosehead-method-192 hosehead ((obj hosehead) (arg0 vector)) +(defmethod hosehead-method-192 hosehead ((this hosehead) (arg0 vector)) (local-vars (a2-7 float) (a2-14 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) - (set! (-> arg0 x) (get-rand-float-range obj 5607424.0 5812224.0)) - (set! (-> arg0 z) (get-rand-float-range obj 2027520.0 1961984.0)) + (set! (-> arg0 x) (get-rand-float-range this 5607424.0 5812224.0)) + (set! (-> arg0 z) (get-rand-float-range this 2027520.0 1961984.0)) (set! (-> arg0 y) -368680.97) (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> arg0 quad)) @@ -1206,11 +1211,11 @@ ) ;; WARN: Return type mismatch float vs none. -(defmethod hosehead-method-191 hosehead ((obj hosehead) (arg0 vector) (arg1 vector)) +(defmethod hosehead-method-191 hosehead ((this hosehead) (arg0 vector) (arg1 vector)) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user10)) + ((logtest? (-> this fact enemy-options) (enemy-option user10)) (countdown (s3-0 8) - (if (hosehead-method-192 obj arg1) + (if (hosehead-method-192 this arg1) (goto cfg-7) ) ) @@ -1221,7 +1226,7 @@ ) ) (else - (set! (-> arg1 quad) (-> obj root trans quad)) + (set! (-> arg1 quad) (-> this root trans quad)) (set! (-> arg0 quad) (-> arg1 quad)) (+! (-> arg0 y) 81920.0) ) @@ -1364,7 +1369,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1398,7 +1403,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod hosehead-method-196 hosehead ((obj hosehead)) +(defmethod hosehead-method-196 hosehead ((this hosehead)) (local-vars (sv-768 nav-control) (sv-784 vector) (sv-800 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1408,7 +1413,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (f30-0 0.0) ) (vector-float*! s5-0 s5-0 20480.0) @@ -1418,7 +1423,7 @@ ) (vector-rotate-around-y! s1-0 s5-0 (* 182.04445 (the float (+ (* 11 s4-0) -90)))) (let ((v1-7 s3-0)) - (let ((a0-5 (-> obj root trans))) + (let ((a0-5 (-> this root trans))) (let ((a1-3 s1-0)) (let ((a2-2 1.0)) (.mov vf7 a2-2) @@ -1432,7 +1437,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-7 quad) vf6) ) - (let ((v1-8 (-> obj nav)) + (let ((v1-8 (-> this nav)) (a0-6 s3-0) (a1-4 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -1446,13 +1451,13 @@ (let ((a1-5 (new 'stack-no-clear 'vector))) (set! (-> a1-5 quad) (-> s3-0 quad)) (set! (-> a1-5 w) 8192.0) - (when (not (add-root-sphere-to-hash! (-> obj nav) a1-5 32)) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-5 32)) (when (< f30-0 f28-0) (set! f30-0 f28-0) (let ((s0-0 (new 'stack-no-clear 'vector))) (set! sv-784 (new 'stack-no-clear 'vector)) (let ((s1-1 (new 'stack 'collide-query))) - (set! sv-768 (-> obj nav)) + (set! sv-768 (-> this nav)) (set! sv-800 s0-0) (let* ((v1-22 s3-0) (a0-14 (-> sv-768 state mesh)) @@ -1473,12 +1478,12 @@ ) 0 (set! (-> s3-0 y) (-> s0-0 y)) - (if (enemy-above-ground? obj s1-1 s3-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s1-1 s3-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s3-0 y) (-> s1-1 best-other-tri intersect y)) ) ) ) - (set! (-> obj jump-point quad) (-> s3-0 quad)) + (set! (-> this jump-point quad) (-> s3-0 quad)) ) ) ) @@ -1656,8 +1661,8 @@ ) ) -(defmethod hosehead-method-195 hosehead ((obj hosehead)) - (= *target* (handle->process (-> obj focus handle))) +(defmethod hosehead-method-195 hosehead ((this hosehead)) + (= *target* (handle->process (-> this focus handle))) ) (defstate fire (hosehead) @@ -1847,9 +1852,9 @@ ) ) (nav-enemy-method-166 self) - (set! (-> self last-time-dist-changed) (current-time)) + (set-time! (-> self last-time-dist-changed)) (set! (-> self next-lazer-time) 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -1953,7 +1958,7 @@ ) ) -(defmethod hosehead-method-187 hosehead ((obj hosehead) (arg0 vector)) +(defmethod hosehead-method-187 hosehead ((this hosehead) (arg0 vector)) (local-vars (sv-128 vector)) (set! sv-128 (new 'stack-no-clear 'vector)) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -1962,10 +1967,10 @@ (s4-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (let ((a0-1 (-> obj node-list data 9 bone transform))) + (let ((a0-1 (-> this node-list data 9 bone transform))) (matrix->trans a0-1 s1-0) ) - (vector-z-quaternion! s0-0 (-> obj root quat)) + (vector-z-quaternion! s0-0 (-> this root quat)) (vector-! sv-128 arg0 s1-0) (vector-normalize! sv-128 1.0) (rot-zxy-from-vector! s4-0 s0-0) @@ -1973,13 +1978,13 @@ (set! (-> s5-0 x) (fmax -1820.4445 (fmin 1820.4445 (deg- (-> s3-0 x) (-> s4-0 x))))) (set! (-> s5-0 y) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 y) (-> s4-0 y))))) (set! (-> s5-0 z) 0.0) - (if (not (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags))) + (if (not (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))) (set! (-> s5-0 y) (- (-> s5-0 y))) ) - (+! (-> s5-0 y) (-> obj head-angle)) + (+! (-> s5-0 y) (-> this head-angle)) (let ((s4-1 (new 'stack-no-clear 'quaternion))) (quaternion-zxy! s4-1 s5-0) - (quaternion-pseudo-seek (-> obj head-joint-mod quat) (-> obj head-joint-mod quat) s4-1 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this head-joint-mod quat) (-> this head-joint-mod quat) s4-1 (seconds-per-frame)) ) ) 0 @@ -1987,36 +1992,36 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod hosehead-method-188 hosehead ((obj hosehead)) +(defmethod hosehead-method-188 hosehead ((this hosehead)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-identity! gp-0) - (quaternion-pseudo-seek (-> obj head-joint-mod quat) (-> obj head-joint-mod quat) gp-0 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this head-joint-mod quat) (-> this head-joint-mod quat) gp-0 (seconds-per-frame)) ) (none) ) -(defmethod track-target! hosehead ((obj hosehead)) +(defmethod track-target! hosehead ((this hosehead)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (hosehead-method-194 obj) + (hosehead-method-194 this) (dotimes (s5-0 4) - (enable-set! (-> obj joint-ik s5-0) #t) + (enable-set! (-> this joint-ik s5-0) #t) ) - (let ((v1-11 (handle->process (-> obj focus handle)))) - (if (and (-> obj allow-head) v1-11) - (hosehead-method-187 obj (-> obj target-pos)) - (hosehead-method-188 obj) + (let ((v1-11 (handle->process (-> this focus handle)))) + (if (and (-> this allow-head) v1-11) + (hosehead-method-187 this (-> this target-pos)) + (hosehead-method-188 this) ) ) (none) ) -(defmethod hosehead-method-194 hosehead ((obj hosehead)) +(defmethod hosehead-method-194 hosehead ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -2027,7 +2032,7 @@ (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 (-> s5-0 bbox)) - (a0-2 (-> obj root trans)) + (a0-2 (-> this root trans)) (a1-0 (new 'stack-no-clear 'vector)) ) (set! (-> a1-0 x) 14336.0) @@ -2037,7 +2042,7 @@ (vector-! (the-as vector v1-0) a0-2 a1-0) ) (let ((v1-2 (-> s5-0 bbox max)) - (a0-4 (-> obj root trans)) + (a0-4 (-> this root trans)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 x) 14336.0) @@ -2052,12 +2057,12 @@ (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (fill-using-bounding-box *collide-cache* s5-0) (dotimes (s4-0 4) - (-> obj joint-ik s4-0 shoulder-matrix-no-ik) - (let ((a2-8 (-> obj joint-ik s4-0 elbow-matrix-no-ik)) + (-> this joint-ik s4-0 shoulder-matrix-no-ik) + (let ((a2-8 (-> this joint-ik s4-0 elbow-matrix-no-ik)) (v1-15 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> obj node-list data 3 bone transform vector 1 quad)) + (set! (-> s3-0 quad) (-> this node-list data 3 bone transform vector 1 quad)) (new 'stack-no-clear 'vector) (let ((s2-0 (new 'stack-no-clear 'vector))) (let ((a1-3 v1-15)) @@ -2119,8 +2124,8 @@ (let* ((f0-14 (- (-> s2-0 y) (-> s1-0 y))) (f0-15 (lerp-scale 1.0 0.0 f0-14 0.0 8192.0)) ) - (- (-> s1-0 y) (-> obj root trans y)) - (let ((f1-5 (vector-dot s3-0 (vector-! (new 'stack-no-clear 'vector) s1-0 (-> obj root trans)))) + (- (-> s1-0 y) (-> this root trans y)) + (let ((f1-5 (vector-dot s3-0 (vector-! (new 'stack-no-clear 'vector) s1-0 (-> this root trans)))) (v1-29 s2-0) ) (let ((a0-23 s2-0)) @@ -2139,7 +2144,7 @@ ) ) ) - (handle-copy! (-> obj joint-ik s4-0) s2-0) + (handle-copy! (-> this joint-ik s4-0) s2-0) ) ) ) @@ -2150,36 +2155,36 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod enemy-method-106 hosehead ((obj hosehead) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 hosehead ((this hosehead) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) - (t9-0 obj arg0 arg1 arg2 arg3) + (t9-0 this arg0 arg1 arg2 arg3) ) - (let ((a1-3 (enemy-method-134 obj arg0 arg3))) + (let ((a1-3 (enemy-method-134 this arg0 arg3))) (if (and a1-3 (logtest? (process-mask bot) (-> a1-3 mask))) - (set! (-> obj shot-by-ruffian?) #t) - (set! (-> obj shot-by-ruffian?) #f) + (set! (-> this shot-by-ruffian?) #t) + (set! (-> this shot-by-ruffian?) #f) ) ) (none) ) -(defmethod damage-amount-from-attack hosehead ((obj hosehead) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack hosehead ((this hosehead) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (if (-> obj shot-by-ruffian?) + (if (-> this shot-by-ruffian?) (set! v0-0 0) ) v0-0 ) ) -(defmethod enemy-method-58 hosehead ((obj hosehead) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 hosehead ((this hosehead) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (if (and (-> obj sentry?) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) + (if (and (-> this sentry?) (nonzero? (-> this hit-points)) (zero? (-> this fated-time))) (set! v0-0 'hit) ) v0-0 @@ -2187,100 +2192,114 @@ ) ;; WARN: Return type mismatch none vs hosehead. -(defmethod relocate hosehead ((obj hosehead) (arg0 int)) - (if (nonzero? (-> obj head-joint-mod)) - (&+! (-> obj head-joint-mod) arg0) +(defmethod relocate hosehead ((this hosehead) (arg0 int)) + (if (nonzero? (-> this head-joint-mod)) + (&+! (-> this head-joint-mod) arg0) ) (dotimes (v1-4 4) - (if (nonzero? (-> obj joint-ik v1-4)) - (&+! (-> obj joint-ik v1-4) arg0) + (if (nonzero? (-> this joint-ik v1-4)) + (&+! (-> this joint-ik v1-4) arg0) ) ) - (the-as hosehead ((the-as (function process-drawable int none) (find-parent-method hosehead 7)) obj arg0)) + (the-as hosehead ((the-as (function process-drawable int none) (find-parent-method hosehead 7)) this arg0)) ) -(defmethod init-enemy! hosehead ((obj hosehead)) +(defmethod init-enemy! hosehead ((this hosehead)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (stack-size-set! (-> obj main-thread) 256) - (set! (-> obj on-stop-sentry) #f) + (stack-size-set! (-> this main-thread) 256) + (set! (-> this on-stop-sentry) #f) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hosehead" (the-as (pointer uint32) #f))) (the-as pair 0) ) (set! sv-16 (new 'static 'res-tag)) - (let ((a0-5 (res-lump-data (-> obj entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) + (let ((a0-5 (res-lump-data (-> this entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when a0-5 - (let ((v1-7 (-> obj root))) + (let ((v1-7 (-> this root))) (+! (-> v1-7 trans x) (-> a0-5 0)) (+! (-> v1-7 trans y) (-> a0-5 1)) (+! (-> v1-7 trans z) (-> a0-5 2)) ) ) ) - (let ((f0-6 (res-lump-float (-> obj entity) 'rotoffset))) + (let ((f0-6 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-6 0.0) - (quaternion-rotate-local-y! (-> obj root quat) (-> obj root quat) f0-6) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-6) ) ) - (let ((f0-7 (res-lump-float (-> obj entity) 'extra-float-param :default 30.0))) - (set! (-> obj angle-sentry) (* 182.04445 f0-7)) + (let ((f0-7 (res-lump-float (-> this entity) 'extra-float-param :default 30.0))) + (set! (-> this angle-sentry) (* 182.04445 f0-7)) ) - (set! (-> obj on-wall?) #f) - (when (>= (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj on-wall?) #t) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> obj enemy-flags)))) + (set! (-> this on-wall?) #f) + (when (>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) + (set! (-> this on-wall?) #t) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> this enemy-flags)))) ) - (init-enemy-behaviour-and-stats! obj *hosehead-nav-enemy-info*) - (set! (-> obj sentry?) (logtest? (-> obj fact enemy-options) (enemy-option user9))) - (when (-> obj sentry?) - (set! (-> obj root pause-adjust-distance) 409600.0) - (set! (-> obj on-stop-sentry) (res-lump-struct (-> obj entity) 'on-stop-sentry function)) + (init-enemy-behaviour-and-stats! this *hosehead-nav-enemy-info*) + (set! (-> this sentry?) (logtest? (-> this fact enemy-options) (enemy-option user9))) + (when (-> this sentry?) + (set! (-> this root pause-adjust-distance) 409600.0) + (set! (-> this on-stop-sentry) (res-lump-struct (-> this entity) 'on-stop-sentry function)) ) - (let ((v1-34 (-> obj nav))) + (let ((v1-34 (-> this nav))) (set! (-> v1-34 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 327680.0) - (add-connection *part-engine* obj 9 obj 318 (new 'static 'vector :x 2048.0 :y -40.96 :z 1392.64 :w 163840.0)) - (add-connection *part-engine* obj 9 obj 318 (new 'static 'vector :x -2048.0 :y -40.96 :z 1392.64 :w 163840.0)) - (if (-> obj on-wall?) - (idle-control-method-9 (-> obj idle-anim-player) *hosehead-idle-wall*) - (idle-control-method-9 (-> obj idle-anim-player) *hosehead-idle-ground*) + (set-gravity-length (-> this root dynam) 327680.0) + (add-connection + *part-engine* + this + 9 + this + 318 + (new 'static 'vector :x 2048.0 :y -40.96 :z 1392.64 :w 163840.0) + ) + (add-connection + *part-engine* + this + 9 + this + 318 + (new 'static 'vector :x -2048.0 :y -40.96 :z 1392.64 :w 163840.0) + ) + (if (-> this on-wall?) + (idle-control-method-9 (-> this idle-anim-player) *hosehead-idle-wall*) + (idle-control-method-9 (-> this idle-anim-player) *hosehead-idle-ground*) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-49 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (let ((v1-49 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-32)))) (cond ((and v1-49 (nonzero? (-> sv-32 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-49)) - (set! (-> obj actor-group-count) (the-as int (-> sv-32 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-49)) + (set! (-> this actor-group-count) (the-as int (-> sv-32 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) (go process-drawable-art-error "actor-group sewesc") ) ) ) - (set! (-> obj head-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 9)) + (set! (-> this head-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 9)) (dotimes (s5-1 4) - (set! (-> obj joint-ik s5-1) (new - 'process - 'joint-mod-ik - obj - (-> *hosehead-ik-setup* s5-1 elbow-index) - (-> *hosehead-ik-setup* s5-1 hand-dist) - ) + (set! (-> this joint-ik s5-1) (new + 'process + 'joint-mod-ik + this + (-> *hosehead-ik-setup* s5-1 elbow-index) + (-> *hosehead-ik-setup* s5-1 hand-dist) + ) ) - (set! (-> obj joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) ) - (logior! (-> obj joint-ik 0 flags) (joint-mod-ik-flags elbow-trans-neg)) - (logior! (-> obj joint-ik 2 flags) (joint-mod-ik-flags elbow-trans-neg)) - (set! (-> obj come-from-notice) #t) - (set! (-> obj lazer-sound) (new-sound-id)) - (set! (-> obj lazer-sound2) (new-sound-id)) + (logior! (-> this joint-ik 0 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 2 flags) (joint-mod-ik-flags elbow-trans-neg)) + (set! (-> this come-from-notice) #t) + (set! (-> this lazer-sound) (new-sound-id)) + (set! (-> this lazer-sound2) (new-sound-id)) (let ((a1-22 (new 'stack-no-clear 'sync-info-params))) (let ((v1-77 0)) (if #t @@ -2290,34 +2309,34 @@ (set! (-> a1-22 sync-flags) (the-as sync-flags v1-77)) ) (set! (-> a1-22 period) (the-as uint 1200)) - (set! (-> a1-22 entity) (-> obj entity)) + (set! (-> a1-22 entity) (-> this entity)) (set! (-> a1-22 percent) 0.0) (set! (-> a1-22 ease-in) 0.15) (set! (-> a1-22 ease-out) 0.15) (set! (-> a1-22 pause-in) 0.0) (set! (-> a1-22 pause-out) 0.0) - (initialize! (-> obj sync) a1-22) + (initialize! (-> this sync) a1-22) ) 0 (none) ) -(defmethod go-ambush hosehead ((obj hosehead)) - (go (method-of-object obj ambush)) +(defmethod go-ambush hosehead ((this hosehead)) + (go (method-of-object this ambush)) ) -(defmethod go-hostile hosehead ((obj hosehead)) - (if (-> obj sentry?) - (go (method-of-object obj hostile-sentry)) - (go (method-of-object obj hostile)) +(defmethod go-hostile hosehead ((this hosehead)) + (if (-> this sentry?) + (go (method-of-object this hostile-sentry)) + (go (method-of-object this hostile)) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hosehead ((obj hosehead)) - (if (-> obj sentry?) - (go (method-of-object obj idle-sentry)) - (go (method-of-object obj idle)) +(defmethod go-idle hosehead ((this hosehead)) + (if (-> this sentry?) + (go (method-of-object this idle-sentry)) + (go (method-of-object this idle)) ) (none) ) diff --git a/goal_src/jak2/levels/sewer/jinx2-course.gc b/goal_src/jak2/levels/sewer/jinx2-course.gc index 9e564db78e..6cfe8df56b 100644 --- a/goal_src/jak2/levels/sewer/jinx2-course.gc +++ b/goal_src/jak2/levels/sewer/jinx2-course.gc @@ -16,14 +16,15 @@ ) -(defmethod go-idle jinx-sewer ((obj jinx-sewer)) +;; WARN: Return type mismatch object vs none. +(defmethod go-idle jinx-sewer ((this jinx-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (ruffian-method-240 obj) + (ruffian-method-240 this) ) ) (none) diff --git a/goal_src/jak2/levels/sewer/mog2-course.gc b/goal_src/jak2/levels/sewer/mog2-course.gc index 8bae83ebe2..eb934c036f 100644 --- a/goal_src/jak2/levels/sewer/mog2-course.gc +++ b/goal_src/jak2/levels/sewer/mog2-course.gc @@ -16,14 +16,15 @@ ) -(defmethod go-idle mog-sewer ((obj mog-sewer)) +;; WARN: Return type mismatch object vs none. +(defmethod go-idle mog-sewer ((this mog-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (ruffian-method-240 obj) + (ruffian-method-240 this) ) ) (none) @@ -428,7 +429,7 @@ :nav-mesh-index 2 :skip-to -1 :on-set (lambda ((arg0 mog-sewer)) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) (logior! (-> arg0 bot-flags) (bot-flags bf19)) (clear-poi-and-focus! arg0) (logclear! (-> arg0 focus-status) (focus-status disable)) @@ -442,7 +443,7 @@ (set! (-> (the-as ruft-wait-spot v1-12) check-done) (the-as (function ruft-wait-spot ruffian symbol) - (lambda ((arg0 object) (arg1 mog-sewer)) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (lambda ((arg0 object) (arg1 mog-sewer)) (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 16 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) diff --git a/goal_src/jak2/levels/sewer/sew-gunturret.gc b/goal_src/jak2/levels/sewer/sew-gunturret.gc index c8c0afa8bd..12bd91ff6b 100644 --- a/goal_src/jak2/levels/sewer/sew-gunturret.gc +++ b/goal_src/jak2/levels/sewer/sew-gunturret.gc @@ -525,87 +525,93 @@ (set! (-> *sew-gunturret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod aim-turret! sew-gunturret ((obj sew-gunturret) (aim-at-target? symbol)) +(defmethod aim-turret! sew-gunturret ((this sew-gunturret) (aim-at-target? symbol)) "Calculates the angle and tilt for the turret to either aim at the target, or it's default direction @param aim-at-target? Whether or not the turret should aim at the target, will ignore the target if #f" (cond - ((and aim-at-target? (-> obj los-clear)) - (let ((target-proc (handle->process (-> obj focus handle)))) + ((and aim-at-target? (-> this los-clear)) + (let ((target-proc (handle->process (-> this focus handle)))) (if target-proc - (set! (-> obj aim-pos quad) (-> (get-trans (the-as process-focusable target-proc) 3) quad)) + (set! (-> this aim-pos quad) (-> (get-trans (the-as process-focusable target-proc) 3) quad)) ) ) ) (else - (set-aim-at-default! obj) + (set-aim-at-default! this) ) ) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj params track-joint)))) + (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params track-joint)))) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> obj aim-pos) (-> obj root trans)) - (vector-flatten! s4-0 s4-0 (-> obj init-mat vector 1)) + (vector-! s4-0 (-> this aim-pos) (-> this root trans)) + (vector-flatten! s4-0 s4-0 (-> this init-mat vector 1)) (vector-normalize! s4-0 1.0) - (set! (-> obj desired-twist) (asin (vector-dot (the-as vector (-> obj init-mat)) s4-0))) - (set! (-> obj desired-twist) (fmin 5461.3335 (fmax -5461.3335 (-> obj desired-twist)))) + (set! (-> this desired-twist) (asin (vector-dot (the-as vector (-> this init-mat)) s4-0))) + (set! (-> this desired-twist) (fmin 5461.3335 (fmax -5461.3335 (-> this desired-twist)))) (cond - ((< 0.0 (vector-dot (-> obj init-mat vector 2) s4-0)) + ((< 0.0 (vector-dot (-> this init-mat vector 2) s4-0)) ) - ((< (-> obj desired-twist) 0.0) - (set! (-> obj desired-twist) -5461.3335) + ((< (-> this desired-twist) 0.0) + (set! (-> this desired-twist) -5461.3335) ) (else - (set! (-> obj desired-twist) 5461.3335) + (set! (-> this desired-twist) 5461.3335) ) ) (cond - ((and (!= (-> obj activate-distance) 0.0) (< (fabs (-> obj desired-twist)) 5461.3335)) - (vector-normalize-copy! s3-0 (-> obj node-list data (-> obj params track-joint) bone transform vector 1) 1.0) - (vector-! s4-0 (-> obj aim-pos) s5-2) + ((and (!= (-> this activate-distance) 0.0) (< (fabs (-> this desired-twist)) 5461.3335)) + (vector-normalize-copy! + s3-0 + (-> this node-list data (-> this params track-joint) bone transform vector 1) + 1.0 + ) + (vector-! s4-0 (-> this aim-pos) s5-2) (vector-normalize! s4-0 1.0) - (set! (-> obj desired-tilt) (- (asin (vector-dot s3-0 s4-0)))) - (set! (-> obj desired-tilt) (fmin 5461.3335 (fmax 0.0 (-> obj desired-tilt)))) + (set! (-> this desired-tilt) (- (asin (vector-dot s3-0 s4-0)))) + (set! (-> this desired-tilt) (fmin 5461.3335 (fmax 0.0 (-> this desired-tilt)))) ) (else - (set! (-> obj desired-tilt) 0.0) + (set! (-> this desired-tilt) 0.0) ) ) ) (vector-normalize-copy! - (-> obj aim-pos) - (-> obj node-list data (-> obj params barrel-joint) bone transform vector 2) - (vector-vector-distance s5-2 (-> obj aim-pos)) + (-> this aim-pos) + (-> this node-list data (-> this params barrel-joint) bone transform vector 2) + (vector-vector-distance s5-2 (-> this aim-pos)) ) ) (vector+! - (-> obj aim-pos) - (-> obj aim-pos) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj params gun-joint))) + (-> this aim-pos) + (-> this aim-pos) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params gun-joint))) ) (let ((matrix (new 'stack-no-clear 'matrix))) - (+! (-> obj gun-twist) (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> obj desired-twist) (-> obj gun-twist)))))) - (matrix-rotate-y! matrix (-> obj gun-twist)) - (matrix*! matrix matrix (-> obj init-mat)) - (matrix->quaternion (-> obj root quat) matrix) + (+! (-> this gun-twist) + (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> this desired-twist) (-> this gun-twist))))) + ) + (matrix-rotate-y! matrix (-> this gun-twist)) + (matrix*! matrix matrix (-> this init-mat)) + (matrix->quaternion (-> this root quat) matrix) ) - (+! (-> obj gun-tilt) (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> obj desired-tilt) (-> obj gun-tilt)))))) - (quaternion-axis-angle! (-> obj gun-tilt-jm quat) 1.0 0.0 0.0 (-> obj gun-tilt)) + (+! (-> this gun-tilt) (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> this desired-tilt) (-> this gun-tilt)))))) + (quaternion-axis-angle! (-> this gun-tilt-jm quat) 1.0 0.0 0.0 (-> this gun-tilt)) 0 (none) ) -(defmethod update-collision! sew-gunturret ((obj sew-gunturret)) +(defmethod update-collision! sew-gunturret ((this sew-gunturret)) "Updates the collision for the turret based on it's aiming direction" - (let ((target-proc (handle->process (-> obj focus handle)))) + (let ((target-proc (handle->process (-> this focus handle)))) (if target-proc - (set! (-> obj aim-pos quad) (-> (get-trans (the-as process-focusable target-proc) 3) quad)) + (set! (-> this aim-pos quad) (-> (get-trans (the-as process-focusable target-proc) 3) quad)) ) ) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj params gun-joint)))) - (s5-3 (vector-! (new 'stack-no-clear 'vector) (-> obj aim-pos) s4-0)) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params gun-joint)))) + (s5-3 (vector-! (new 'stack-no-clear 'vector) (-> this aim-pos) s4-0)) ) - (when (< (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-3 1.0) (-> obj init-mat vector 2)) + (when (< (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-3 1.0) (-> this init-mat vector 2)) (cos 364.0889) ) (let ((cquery (new 'stack-no-clear 'collide-query))) @@ -616,7 +622,7 @@ (set! (-> _cquery collide-with) (collide-spec backgnd crate obstacle hit-by-player-list hit-by-others-list pusher) ) - (set! (-> _cquery ignore-process0) obj) + (set! (-> _cquery ignore-process0) this) (set! (-> _cquery ignore-process1) #f) (set! (-> _cquery ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) @@ -624,8 +630,8 @@ (set! (-> _cquery action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* cquery) 0.0) - (set! (-> obj los-clear) #f) - (set! (-> obj los-clear) #t) + (set! (-> this los-clear) #f) + (set! (-> this los-clear) #t) ) ) ) @@ -634,30 +640,30 @@ (none) ) -(defmethod set-aim-at-default! sew-gunturret ((obj sew-gunturret)) +(defmethod set-aim-at-default! sew-gunturret ((this sew-gunturret)) "Aims the turret at it's default direction. Sets `aim-pos` accordingly" - (vector+float*! (-> obj aim-pos) (-> obj root trans) (-> obj init-mat vector 2) 163840.0) + (vector+float*! (-> this aim-pos) (-> this root trans) (-> this init-mat vector 2) 163840.0) 0 (none) ) -(defmethod fire-turret! sew-gunturret ((obj sew-gunturret) (fire-sound? symbol)) +(defmethod fire-turret! sew-gunturret ((this sew-gunturret) (fire-sound? symbol)) "Actually fires the turret, sets `flash-state` to [[#t]] @param fire-sound? Whether to play the fire sound effect or not" - (let ((v1-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj params gun-joint)))) + (let ((v1-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params gun-joint)))) (proj-params (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj aim-pos) v1-4)) + (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this aim-pos) v1-4)) (f30-0 (/ 2013265900.0 (vector-length s2-1))) (temp-vec (new 'stack-no-clear 'vector)) ) - (set! (-> proj-params ent) (-> obj entity)) + (set! (-> proj-params ent) (-> this entity)) (set! (-> proj-params charge) 1.0) (set! (-> proj-params options) (projectile-options)) (set! (-> proj-params pos quad) (-> v1-4 quad)) - (set! (-> proj-params notify-handle) (process->handle obj)) + (set! (-> proj-params notify-handle) (process->handle this)) (set! (-> proj-params owner-handle) (the-as handle #f)) - (set! (-> proj-params ignore-handle) (process->handle obj)) + (set! (-> proj-params ignore-handle) (process->handle this)) (let* ((v1-12 *game-info*) (a0-18 (+ (-> v1-12 attack-id) 1)) ) @@ -675,20 +681,20 @@ ) (vector+! (-> proj-params vel) (-> proj-params vel) temp-vec) ) - (spawn-projectile guard-shot proj-params obj *default-dead-pool*) + (spawn-projectile guard-shot proj-params this *default-dead-pool*) ) (if fire-sound? (sound-play "gtur-shot-fire") ) - (set! (-> obj flash-state) #t) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 0))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 1))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 2))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 3))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 4))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 5))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 6))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 7))) + (set! (-> this flash-state) #t) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 0))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 1))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 2))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 3))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 4))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 5))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 6))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 7))) (none) ) @@ -707,7 +713,7 @@ (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (>= 2 (the-as int (-> self focus aware))) (go-stare self) ) @@ -718,13 +724,13 @@ (set-aim-at-default! self) (until #f (current-time) - (until (>= (- (current-time) (-> self last-hit-time)) (seconds 2)) + (until (time-elapsed? (-> self last-hit-time) (seconds 2)) (suspend) ) (update-collision! self) (sound-play "sew-gun-lock") (let ((frame-counter (current-time))) - (until (>= (- (current-time) frame-counter) (seconds 0.75)) + (until (time-elapsed? frame-counter (seconds 0.75)) (aim-turret! self #t) (suspend) ) @@ -735,11 +741,11 @@ ) (sound-play "gturret") (let ((s4-1 (current-time))) - (until (>= (- (current-time) s4-1) (seconds 0.125)) + (until (time-elapsed? s4-1 (seconds 0.125)) (cond ((not (-> self can-shoot)) ) - ((>= (- (current-time) (the-as time-frame frames)) (seconds 0.05)) + ((time-elapsed? (the-as time-frame frames) (seconds 0.05)) (fire-turret! self fire-sound?) (set! frames (the-as int (current-time))) (set! fire-sound? (not fire-sound?)) @@ -757,7 +763,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data (-> self params idle-anim))) (let ((_frame-counter (current-time))) - (until (>= (- (current-time) _frame-counter) (seconds 0.5)) + (until (time-elapsed? _frame-counter (seconds 0.5)) (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 0))) (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 1))) (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 2))) @@ -788,21 +794,21 @@ ) ) -(defmethod general-event-handler sew-gunturret ((obj sew-gunturret) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler sew-gunturret ((this sew-gunturret) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (if (and (= event-type 'notify) (< 1 arg2) (= (-> event param 0) 'attack) (= (-> event param 1) *target*)) - (set! (-> obj last-hit-time) (current-time)) + (set-time! (-> this last-hit-time)) ) (case event-type (('start) (let ((v0-0 (the-as object #t))) - (set! (-> obj can-shoot) (the-as symbol v0-0)) + (set! (-> this can-shoot) (the-as symbol v0-0)) v0-0 ) ) (('stop) - (set! (-> obj can-shoot) #f) + (set! (-> this can-shoot) #f) #f ) (('bonk) @@ -816,10 +822,10 @@ #f ) (('flash-state) - (-> obj flash-state) + (-> this flash-state) ) (else - ((method-of-type enemy general-event-handler) obj proc arg2 event-type event) + ((method-of-type enemy general-event-handler) this proc arg2 event-type event) ) ) ) @@ -856,14 +862,14 @@ (set! (-> vec quad) (-> self root trans quad)) (+! (-> vec y) 10240.0) (let ((frame-counter (current-time))) - (until (>= (- (current-time) frame-counter) (seconds 2)) + (until (time-elapsed? frame-counter (seconds 2)) (spawn (-> self part) vec) (suspend) ) ) ) (let ((_frame-counter (current-time))) - (until (>= (- (current-time) _frame-counter) (seconds 1)) + (until (time-elapsed? _frame-counter (seconds 1)) (suspend) ) ) @@ -877,9 +883,9 @@ ) ) -(defmethod init-enemy-collision! sew-gunturret ((obj sew-gunturret)) +(defmethod init-enemy-collision! sew-gunturret ((this sew-gunturret)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -931,67 +937,67 @@ (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) 0 (none) ) -(defmethod in-aggro-range? sew-gunturret ((obj sew-gunturret) (proc process-focusable) (arg1 vector)) +(defmethod in-aggro-range? sew-gunturret ((this sew-gunturret) (proc process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @param proc The process used to distance check @returns true/false" (cond - ((= (-> obj activate-distance) 0.0) + ((= (-> this activate-distance) 0.0) (return #t) ) (else (let ((dist (vector-dot - (vector-! (new 'stack-no-clear 'vector) (get-trans proc 3) (-> obj root trans)) - (-> obj init-mat vector 2) + (vector-! (new 'stack-no-clear 'vector) (get-trans proc 3) (-> this root trans)) + (-> this init-mat vector 2) ) ) ) - (return (and (< 0.0 dist) (< dist (-> obj activate-distance)))) + (return (and (< 0.0 dist) (< dist (-> this activate-distance)))) ) ) ) (the-as symbol 0) ) -(defmethod deactivate sew-gunturret ((obj sew-gunturret)) - (if (nonzero? (-> obj smoke-part)) - (kill-and-free-particles (-> obj smoke-part)) +(defmethod deactivate sew-gunturret ((this sew-gunturret)) + (if (nonzero? (-> this smoke-part)) + (kill-and-free-particles (-> this smoke-part)) ) - (if (nonzero? (-> obj casing-part)) - (kill-and-free-particles (-> obj casing-part)) + (if (nonzero? (-> this casing-part)) + (kill-and-free-particles (-> this casing-part)) ) - ((method-of-type enemy deactivate) obj) + ((method-of-type enemy deactivate) this) (none) ) -(defmethod coin-flip? sew-gunturret ((obj sew-gunturret)) +(defmethod coin-flip? sew-gunturret ((this sew-gunturret)) "@returns The result of a 50/50 RNG roll" #f ) ;; WARN: Return type mismatch enemy vs sew-gunturret. -(defmethod relocate sew-gunturret ((obj sew-gunturret) (arg0 int)) - (if (nonzero? (-> obj gun-tilt-jm)) - (&+! (-> obj gun-tilt-jm) arg0) +(defmethod relocate sew-gunturret ((this sew-gunturret) (arg0 int)) + (if (nonzero? (-> this gun-tilt-jm)) + (&+! (-> this gun-tilt-jm) arg0) ) - (if (nonzero? (-> obj smoke-part)) - (&+! (-> obj smoke-part) arg0) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) arg0) ) - (if (nonzero? (-> obj casing-part)) - (&+! (-> obj casing-part) arg0) + (if (nonzero? (-> this casing-part)) + (&+! (-> this casing-part) arg0) ) - (the-as sew-gunturret ((method-of-type enemy relocate) obj arg0)) + (the-as sew-gunturret ((method-of-type enemy relocate) this arg0)) ) -(defmethod init-turret-params! sew-gunturret ((obj sew-gunturret)) +(defmethod init-turret-params! sew-gunturret ((this sew-gunturret)) (let ((turret-params (new 'static 'gun-turret-params :idle-anim 2 @@ -1013,48 +1019,48 @@ ) ) (set! (-> turret-params enemy-info) *sew-gunturret-enemy-info*) - (set! (-> obj params) turret-params) + (set! (-> this params) turret-params) ) 0 (none) ) -(defmethod init-enemy! sew-gunturret ((obj sew-gunturret)) +(defmethod init-enemy! sew-gunturret ((this sew-gunturret)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init-turret-params! obj) - (initialize-skeleton obj (-> obj params normal-sg) (the-as pair 0)) - (init-enemy-behaviour-and-stats! obj (-> obj params enemy-info)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1126) obj)) - (set! (-> obj smoke-part) (create-launch-control (-> *part-group-id-table* 1127) obj)) - (set! (-> obj casing-part) (create-launch-control (-> *part-group-id-table* 1128) obj)) - (set! (-> obj gun-tilt-jm) - (new 'process 'joint-mod (joint-mod-mode joint-set*) obj (-> obj params barrel-joint)) + (init-turret-params! this) + (initialize-skeleton this (-> this params normal-sg) (the-as pair 0)) + (init-enemy-behaviour-and-stats! this (-> this params enemy-info)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1126) this)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 1127) this)) + (set! (-> this casing-part) (create-launch-control (-> *part-group-id-table* 1128) this)) + (set! (-> this gun-tilt-jm) + (new 'process 'joint-mod (joint-mod-mode joint-set*) this (-> this params barrel-joint)) ) - (set! (-> obj los-clear) #f) - (set! (-> obj gun-twist) 0.0) - (set! (-> obj gun-tilt) 0.0) - (set! (-> obj desired-twist) 0.0) - (set! (-> obj desired-tilt) 0.0) - (set! (-> obj flash-state) #f) - (set! (-> obj can-shoot) #t) - (set! (-> obj last-hit-time) 0) - (quaternion->matrix (-> obj init-mat) (-> obj root quat)) - (set! (-> obj activate-distance) (res-lump-float (-> obj entity) 'distance)) + (set! (-> this los-clear) #f) + (set! (-> this gun-twist) 0.0) + (set! (-> this gun-tilt) 0.0) + (set! (-> this desired-twist) 0.0) + (set! (-> this desired-tilt) 0.0) + (set! (-> this flash-state) #f) + (set! (-> this can-shoot) #t) + (set! (-> this last-hit-time) 0) + (quaternion->matrix (-> this init-mat) (-> this root quat)) + (set! (-> this activate-distance) (res-lump-float (-> this entity) 'distance)) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sew-gunturret ((obj sew-gunturret)) +(defmethod go-idle sew-gunturret ((this sew-gunturret)) (cond ((task-node-closed? (game-task-node sewer-enemy-blow-up-turrets)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1164,19 +1170,19 @@ ) -(defmethod fire-turret! pal-gun-turret ((obj pal-gun-turret) (arg0 symbol)) +(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)) obj arg0) + ((the-as (function sew-gunturret symbol none) (find-parent-method pal-gun-turret 140)) this arg0) (set-palcab-turret-flash! 1.0) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle pal-gun-turret ((obj pal-gun-turret)) - (go (method-of-object obj idle)) +(defmethod go-idle pal-gun-turret ((this pal-gun-turret)) + (go (method-of-object this idle)) (none) ) -(defmethod init-turret-params! pal-gun-turret ((obj pal-gun-turret)) +(defmethod init-turret-params! pal-gun-turret ((this pal-gun-turret)) (let ((turret-params (new 'static 'gun-turret-params :idle-anim 2 @@ -1198,7 +1204,7 @@ ) ) (set! (-> turret-params enemy-info) *pal-gun-turret-enemy-info*) - (set! (-> obj params) turret-params) + (set! (-> this params) turret-params) ) 0 (none) diff --git a/goal_src/jak2/levels/sewer/sewer-obs.gc b/goal_src/jak2/levels/sewer/sewer-obs.gc index 1fb064e666..d3ae278d66 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs.gc @@ -25,30 +25,30 @@ ) -(defmethod update-sound! sew-blade ((obj sew-blade)) +(defmethod update-sound! sew-blade ((this sew-blade)) "Updates the sound of the [[sew-blade]] based on if it's under or above the water" - (when (nonzero? (-> obj sound)) - (let ((f30-0 (+ (-> obj root trans y) (-> obj y-max))) - (f28-0 (+ (-> obj root trans y) (-> obj y-min))) + (when (nonzero? (-> this sound)) + (let ((f30-0 (+ (-> this root trans y) (-> this y-max))) + (f28-0 (+ (-> this root trans y) (-> this y-min))) (ocean-base-height (get-base-height *ocean-map-sewer*)) ) (cond ((< f30-0 ocean-base-height) - (stop! (-> obj sound)) + (stop! (-> this sound)) ) ((< ocean-base-height f28-0) - (when (!= (-> obj last-sound) 1) - (change-sound! (-> obj sound) (-> obj snd-no-water)) - (set! (-> obj last-sound) 1) + (when (!= (-> this last-sound) 1) + (change-sound! (-> this sound) (-> this snd-no-water)) + (set! (-> this last-sound) 1) ) - (update! (-> obj sound)) + (update! (-> this sound)) ) (else - (when (!= (-> obj last-sound) 2) - (change-sound! (-> obj sound) (-> obj snd-water)) - (set! (-> obj last-sound) 2) + (when (!= (-> this last-sound) 2) + (change-sound! (-> this sound) (-> this snd-water)) + (set! (-> this last-sound) 2) ) - (update! (-> obj sound)) + (update! (-> this sound)) ) ) ) @@ -122,15 +122,15 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-single-blade ((obj sew-single-blade) (arg0 entity-actor)) +(defmethod init-from-entity! sew-single-blade ((this sew-single-blade) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask ambient)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -151,30 +151,30 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-single-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-copy! (-> obj quat) (-> obj root quat)) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj root trans))) - (set-falloff-far! (-> obj sound) 286720.0) - (set! (-> obj y-min) -16384.0) - (set! (-> obj y-max) 16384.0) - (set! (-> obj snd-water) (static-sound-name "single-blade-w")) - (set! (-> obj snd-no-water) (static-sound-name "single-blade")) + (quaternion-copy! (-> this quat) (-> this root quat)) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this root trans))) + (set-falloff-far! (-> this sound) 286720.0) + (set! (-> this y-min) -16384.0) + (set! (-> this y-max) 16384.0) + (set! (-> this snd-water) (static-sound-name "single-blade-w")) + (set! (-> this snd-no-water) (static-sound-name "single-blade")) (let* ((game-info *game-info*) (id (+ (-> game-info attack-id) 1)) ) (set! (-> game-info attack-id) id) - (set! (-> obj attack-id) id) + (set! (-> this attack-id) id) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -309,15 +309,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-tri-blade ((obj sew-tri-blade) (entity entity-actor)) +(defmethod init-from-entity! sew-tri-blade ((this sew-tri-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask ambient)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -358,36 +358,36 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> v1-23 prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> v1-23 prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-tri-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj state-time) (current-time)) - (set! (-> obj anim-time) 0.0) - (set! (-> obj anim-offset) 0.0) - (set! (-> obj skel postbind-function) sew-tri-blade-joint-callback) + (set-time! (-> this state-time)) + (set! (-> this anim-time) 0.0) + (set! (-> this anim-offset) 0.0) + (set! (-> this skel postbind-function) sew-tri-blade-joint-callback) (let* ((v1-33 *game-info*) (a0-33 (+ (-> v1-33 attack-id) 1)) ) (set! (-> v1-33 attack-id) a0-33) - (set! (-> obj attack-id) a0-33) + (set! (-> this attack-id) a0-33) ) (if (>= (res-lump-value entity 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj anim-offset) 3.0) + (set! (-> this anim-offset) 3.0) ) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj root trans))) - (set-falloff-far! (-> obj sound) 286720.0) - (set! (-> obj y-min) 0.0) - (set! (-> obj y-max) 48332.8) - (set! (-> obj snd-water) (static-sound-name "tri-blade-w")) - (set! (-> obj snd-no-water) (static-sound-name "tri-blade")) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this root trans))) + (set-falloff-far! (-> this sound) 286720.0) + (set! (-> this y-min) 0.0) + (set! (-> this y-max) 48332.8) + (set! (-> this snd-water) (static-sound-name "tri-blade-w")) + (set! (-> this snd-no-water) (static-sound-name "tri-blade")) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -448,15 +448,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-arm-blade ((obj sew-arm-blade) (entity entity-actor)) +(defmethod init-from-entity! sew-arm-blade ((this sew-arm-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask ambient)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -477,29 +477,29 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-arm-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj root trans))) - (set-falloff-far! (-> obj sound) 286720.0) - (set! (-> obj y-min) -43008.0) - (set! (-> obj y-max) -4096.0) - (set! (-> obj snd-water) (static-sound-name "arm-blade-w")) - (set! (-> obj snd-no-water) (static-sound-name "arm-blade")) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this root trans))) + (set-falloff-far! (-> this sound) 286720.0) + (set! (-> this y-min) -43008.0) + (set! (-> this y-max) -4096.0) + (set! (-> this snd-water) (static-sound-name "arm-blade-w")) + (set! (-> this snd-no-water) (static-sound-name "arm-blade")) (let* ((game-info *game-info*) (id (+ (-> game-info attack-id) 1)) ) (set! (-> game-info attack-id) id) - (set! (-> obj attack-id) id) + (set! (-> this attack-id) id) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -567,15 +567,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-multi-blade ((obj sew-multi-blade) (entity entity-actor)) +(defmethod init-from-entity! sew-multi-blade ((this sew-multi-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask ambient)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -596,29 +596,29 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-multi-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj root trans))) - (set-falloff-far! (-> obj sound) 368640.0) - (set! (-> obj y-min) -16384.0) - (set! (-> obj y-max) 16384.0) - (set! (-> obj snd-water) (static-sound-name "multi-blade-w")) - (set! (-> obj snd-no-water) (static-sound-name "multi-blade")) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this root trans))) + (set-falloff-far! (-> this sound) 368640.0) + (set! (-> this y-min) -16384.0) + (set! (-> this y-max) 16384.0) + (set! (-> this snd-water) (static-sound-name "multi-blade-w")) + (set! (-> this snd-no-water) (static-sound-name "multi-blade")) (let* ((game-info *game-info*) (id (+ (-> game-info attack-id) 1)) ) (set! (-> game-info attack-id) id) - (set! (-> obj attack-id) id) + (set! (-> this attack-id) id) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -679,9 +679,10 @@ This commonly includes things such as: ) :trans (behavior () (when (and (nonzero? (-> self no-collision-timer)) - (>= (- (current-time) (the-as int (-> self no-collision-timer))) - (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) - ) + (time-elapsed? + (the-as int (-> self no-collision-timer)) + (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) + ) ) (let ((root-prim (-> self root-overide root-prim))) (set! (-> root-prim prim-core collide-as) (-> self root-overide backup-collide-as)) @@ -714,15 +715,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-twist-blade ((obj sew-twist-blade) (entity entity-actor)) +(defmethod init-from-entity! sew-twist-blade ((this sew-twist-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask ambient)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -743,29 +744,29 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root-overide) cshape) + (set! (-> this root-overide) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-twist-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj root-overide trans))) - (set-falloff-far! (-> obj sound) 245760.0) - (set! (-> obj y-min) -4096.0) - (set! (-> obj y-max) 4096.0) - (set! (-> obj snd-water) (static-sound-name "twist-blade-w")) - (set! (-> obj snd-no-water) (static-sound-name "twist-blade")) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this root-overide trans))) + (set-falloff-far! (-> this sound) 245760.0) + (set! (-> this y-min) -4096.0) + (set! (-> this y-max) 4096.0) + (set! (-> this snd-water) (static-sound-name "twist-blade-w")) + (set! (-> this snd-no-water) (static-sound-name "twist-blade")) (let* ((game-info *game-info*) (id (+ (-> game-info attack-id) 1)) ) (set! (-> game-info attack-id) id) - (set! (-> obj attack-id) id) + (set! (-> this attack-id) id) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -874,9 +875,9 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-switch-collision! sew-light-switch ((obj sew-light-switch)) +(defmethod init-switch-collision! sew-light-switch ((this sew-light-switch)) "Initializes the collision on the switch" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -896,18 +897,18 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod broadcast-to-actors sew-light-switch ((obj sew-light-switch) (event-type symbol)) +(defmethod broadcast-to-actors sew-light-switch ((this sew-light-switch) (event-type symbol)) "Broadcast event to all associated [[entity]]s via the `actor-group`s @param `event-type` the symbol to broadcast" (with-pp - (dotimes (group-idx (-> obj actor-group-count)) - (let ((group (-> obj actor-group group-idx))) + (dotimes (group-idx (-> this actor-group-count)) + (let ((group (-> this actor-group group-idx))) (dotimes (actor-idx (-> group length)) (let ((evt (new 'stack-no-clear 'event-message-block))) (set! (-> evt from) (process->ppointer pp)) @@ -935,7 +936,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-light-switch ((obj sew-light-switch) (entity entity-actor)) +(defmethod init-from-entity! sew-light-switch ((this sew-light-switch) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -943,30 +944,30 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (tag res-tag)) - (init-switch-collision! obj) - (process-drawable-from-entity! obj entity) + (init-switch-collision! this) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-light-switch" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (process-entity-status! obj (entity-perm-status no-kill) #t) + (process-entity-status! this (entity-perm-status no-kill) #t) (set! tag (new 'static 'res-tag)) - (let ((data (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& tag)))) + (let ((data (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& tag)))) (cond ((and data (nonzero? (-> tag elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) data)) - (set! (-> obj actor-group-count) (the-as int (-> tag elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) data)) + (set! (-> this actor-group-count) (the-as int (-> tag elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj light-state) #f) - (go (method-of-object obj idle)) + (set! (-> this light-state) #f) + (go (method-of-object this idle)) (none) ) @@ -1044,7 +1045,7 @@ This commonly includes things such as: ) ) -(defmethod press! sew-light-control ((obj sew-light-control) (switched-on? symbol) (should-turret-flash? symbol)) +(defmethod press! sew-light-control ((this sew-light-control) (switched-on? symbol) (should-turret-flash? symbol)) "Turns the lights on (or off) @param switched-on? Should the sewer lights be turned on or off? @param should-turret-flash? Should the turret have it's `flash` set as well" diff --git a/goal_src/jak2/levels/sewer/sewer-obs2.gc b/goal_src/jak2/levels/sewer/sewer-obs2.gc index 31aa4bcc3c..08b6d678f3 100644 --- a/goal_src/jak2/levels/sewer/sewer-obs2.gc +++ b/goal_src/jak2/levels/sewer/sewer-obs2.gc @@ -25,31 +25,31 @@ :bounds (static-spherem 0 0 5.6 9.2) ) -(defmethod get-art-group sew-elevator ((obj sew-elevator)) +(defmethod get-art-group sew-elevator ((this sew-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-sew-elevator" (the-as (pointer uint32) #f)) ) -(defmethod move-between-points sew-elevator ((obj sew-elevator) (arg1 vector) (point-a float) (point-b float)) +(defmethod move-between-points sew-elevator ((this sew-elevator) (arg1 vector) (point-a float) (point-b float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((path-point-a (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) point-a 'interp)) - (path-point-b (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) point-b 'interp)) - (elevator-pos (-> obj root trans)) + (let ((path-point-a (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-a 'interp)) + (path-point-b (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-b 'interp)) + (elevator-pos (-> this root trans)) ) (when (and (< (-> path-point-b y) (-> path-point-a y)) (< (-> arg1 y) (+ -8192.0 (-> elevator-pos y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg1 elevator-pos))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) ) ) ) ) -(defmethod commited-to-ride? sew-elevator ((obj sew-elevator)) +(defmethod commited-to-ride? sew-elevator ((this sew-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((target *target*) (target-proc (if (type? target process-focusable) @@ -59,9 +59,9 @@ ) (when target-proc (let* ((target-pos (get-trans target-proc 0)) - (dist-from-center (vector-! (new 'stack-no-clear 'vector) target-pos (-> obj root trans))) + (dist-from-center (vector-! (new 'stack-no-clear 'vector) target-pos (-> this root trans))) ) - (vector-inv-orient-by-quat! dist-from-center dist-from-center (-> obj root quat)) + (vector-inv-orient-by-quat! dist-from-center dist-from-center (-> this root quat)) (and (< (fabs (-> dist-from-center x)) 20480.0) (< 0.0 (-> dist-from-center z)) (< (-> dist-from-center z) 40960.0) @@ -71,10 +71,10 @@ ) ) -(defmethod configure-collision sew-elevator ((obj sew-elevator) (collide-with-jak? symbol)) +(defmethod configure-collision sew-elevator ((this sew-elevator) (collide-with-jak? symbol)) "Appropriately sets the collision on the elevator @param collide-with-jak? If set, the elevator will collide with Jak" - (let ((prim-group (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) + (let ((prim-group (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (collide-with-jak? (set! (-> prim-group prim-core collide-as) (collide-spec obstacle pusher)) @@ -134,21 +134,21 @@ ) ) -(defmethod deactivate sew-elevator ((obj sew-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method sew-elevator 10)) obj) +(defmethod deactivate sew-elevator ((this sew-elevator)) + (sound-stop (-> this sound-id)) + ((the-as (function elevator none) (find-parent-method sew-elevator 10)) this) (none) ) -(defmethod init-plat! sew-elevator ((obj sew-elevator)) +(defmethod init-plat! sew-elevator ((this sew-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." - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this sound-id) (new-sound-id)) 0 (none) ) -(defmethod init-defaults! sew-elevator ((obj sew-elevator)) +(defmethod init-defaults! sew-elevator ((this sew-elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` @@ -156,27 +156,27 @@ For example for an elevator pre-compute the distance between the first and last - `elevator-move-rate` - `elevator-flags`" (let ((func (method-of-type elevator init-defaults!))) - (func obj) + (func this) ) - (if (name= (-> obj name) "sew-elevator-15") - (set! (-> obj params xz-threshold) 348160.0) - (set! (-> obj params xz-threshold) 184320.0) + (if (name= (-> this name) "sew-elevator-15") + (set! (-> this params xz-threshold) 348160.0) + (set! (-> this params xz-threshold) 184320.0) ) - (when (and (logtest? (elevator-flags elevator-flags-17) (-> obj params flags)) + (when (and (logtest? (elevator-flags elevator-flags-17) (-> this params flags)) (and (task-node-closed? (game-task-node sewer-escort-introduction)) (not (task-node-closed? (game-task-node sewer-escort-resolution))) ) ) - (set! (-> obj params start-pos) 0.0) - (logior! (-> obj params flags) (elevator-flags elevator-flags-3)) + (set! (-> this params start-pos) 0.0) + (logior! (-> this params flags) (elevator-flags elevator-flags-3)) ) 0 (none) ) -(defmethod init-plat-collision! sew-elevator ((obj sew-elevator)) +(defmethod init-plat-collision! sew-elevator ((this sew-elevator)) "TODO - collision stuff for setting up the platform" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -209,9 +209,9 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (configure-collision obj #f) + (configure-collision this #f) (none) ) @@ -314,18 +314,18 @@ 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 ((obj sew-valve) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method sew-valve 7)) this arg0) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-valve ((obj sew-valve) (entity entity-actor)) +(defmethod init-from-entity! sew-valve ((this sew-valve) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -333,7 +333,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (tag-1 res-tag) (tag-2 res-tag)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -353,32 +353,32 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-valve" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj spin) 0.0) - (set! (-> obj spin-rate) 0.0) - (set! (-> obj joint) (new 'process 'joint-mod-rotate-local obj 4 #f)) + (set! (-> this spin) 0.0) + (set! (-> this spin-rate) 0.0) + (set! (-> this joint) (new 'process 'joint-mod-rotate-local this 4 #f)) (set! tag-1 (new 'static 'res-tag)) - (set! (-> obj actor-group) - (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& tag-1)) + (set! (-> this actor-group) + (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& tag-1)) ) - (set! (-> obj actor-group-count) (the-as int (-> tag-1 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> tag-1 elt-count))) (set! tag-2 (new 'static 'res-tag)) - (let ((data (res-lump-data (-> obj entity) 'extra-float-param pointer :tag-ptr (& tag-2)))) + (let ((data (res-lump-data (-> this entity) 'extra-float-param pointer :tag-ptr (& tag-2)))) (if (and data (nonzero? (-> tag-2 elt-count))) - (set! (-> obj water-height) (-> (the-as (pointer float) data))) - (set! (-> obj water-height) 0.0) + (set! (-> this water-height) (-> (the-as (pointer float) data))) + (set! (-> this water-height) 0.0) ) ) - (format #t "~S water-height: ~m~%" (-> obj name) (-> obj water-height)) - (+! (-> obj water-height) -216498.17) - (go (method-of-object obj idle)) + (format #t "~S water-height: ~m~%" (-> this name) (-> this water-height)) + (+! (-> this water-height) -216498.17) + (go (method-of-object this idle)) (none) ) @@ -549,7 +549,7 @@ This commonly includes things such as: ) ) -(defmethod run-logic? sew-mar-statue ((obj sew-mar-statue)) +(defmethod run-logic? sew-mar-statue ((this sew-mar-statue)) #t ) @@ -580,15 +580,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mar-statue ((obj sew-mar-statue) (entity entity-actor)) +(defmethod init-from-entity! sew-mar-statue ((this sew-mar-statue) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj spawned-debris?) #f) - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (set! (-> this spawned-debris?) #f) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -603,25 +603,25 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-mar-statue" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (set! (-> obj event-hook) sew-mar-statue-event-handler) + (set! (-> this event-hook) sew-mar-statue-event-handler) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) - (process-spawn sew-mar-statue-debris :to obj) - (process-spawn sew-mar-statue-debris-b :to obj) - (set! (-> obj spawned-debris?) #t) - (go (method-of-object obj hidden)) + (process-spawn sew-mar-statue-debris :to this) + (process-spawn sew-mar-statue-debris-b :to this) + (set! (-> this spawned-debris?) #t) + (go (method-of-object this hidden)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -642,12 +642,12 @@ This commonly includes things such as: :origin-joint-index 3 ) -(defmethod start-bouncing! sew-catwalk ((obj sew-catwalk)) +(defmethod start-bouncing! sew-catwalk ((this sew-catwalk)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -686,7 +686,7 @@ and translate the platform via the `smush` ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-catwalk ((obj sew-catwalk) (entity entity-actor)) +(defmethod init-from-entity! sew-catwalk ((this sew-catwalk) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -694,8 +694,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape-moving)) - (stack-size-set! (-> obj main-thread) 512) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -757,22 +757,22 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-catwalk-1" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj art-name) "sew-catwalk-1") - (set! (-> obj anim) + (set! (-> this art-name) "sew-catwalk-1") + (set! (-> this anim) (new 'static 'spool-anim :name "sew-catwalk-1" :anim-name "1-break" :parts 3 :command-list '()) ) - (set! (-> obj basetrans quad) (-> obj root trans quad)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj fall) #t) - (go (method-of-object obj idle)) + (set! (-> this basetrans quad) (-> this root trans quad)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this fall) #t) + (go (method-of-object this idle)) ) (none) ) @@ -890,17 +890,17 @@ This commonly includes things such as: ) (cleanup-for-death self) (let ((frame-counter (current-time))) - (until (>= (- (current-time) frame-counter) (seconds 2)) + (until (time-elapsed? frame-counter (seconds 2)) (suspend) ) ) ) ) -(defmethod init-mine! sew-mine ((obj sew-mine)) +(defmethod init-mine! sew-mine ((this sew-mine)) "Initializes the mine's particles and sets `last-time` to `0`" - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 345) obj)) - (set! (-> obj last-time) 0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 345) this)) + (set! (-> this last-time) 0) 0 (none) ) @@ -920,14 +920,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mine-a ((obj sew-mine-a) (entity entity-actor)) +(defmethod init-from-entity! sew-mine-a ((this sew-mine-a) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec pusher)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -943,16 +943,16 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving cshape)) + (set! (-> this root) (the-as collide-shape-moving cshape)) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-mine-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-mine! obj) - (go (method-of-object obj idle)) + (init-mine! this) + (go (method-of-object this idle)) (none) ) @@ -1004,14 +1004,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mine-b ((obj sew-mine-b) (entity entity-actor)) +(defmethod init-from-entity! sew-mine-b ((this sew-mine-b) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec pusher)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -1027,33 +1027,33 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving cshape)) + (set! (-> this root) (the-as collide-shape-moving cshape)) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-mine-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-mine! obj) - (let ((_entity (-> obj entity))) - (set! (-> obj base-height) ((method-of-object _entity get-property-value-float) - _entity - 'base-height - 'interp - -1000000000.0 - -16384000.0 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) + (init-mine! this) + (let ((_entity (-> this entity))) + (set! (-> this base-height) ((method-of-object _entity get-property-value-float) + _entity + 'base-height + 'interp + -1000000000.0 + -16384000.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) ) ) - (set! (-> obj time-skew) (the-as uint (the int (* 300.0 (rand-vu-float-range 0.1 1.4))))) - (set! (-> obj period) (* 300.0 (rand-vu-float-range 1.2 1.8))) - (set! (-> obj center quad) (-> obj root trans quad)) - (+! (-> obj base-height) -216498.17) - (set! (-> obj root pause-adjust-distance) 532480.0) - (go (method-of-object obj idle)) + (set! (-> this time-skew) (the-as uint (the int (* 300.0 (rand-vu-float-range 0.1 1.4))))) + (set! (-> this period) (* 300.0 (rand-vu-float-range 1.2 1.8))) + (set! (-> this center quad) (-> this root trans quad)) + (+! (-> this base-height) -216498.17) + (set! (-> this root pause-adjust-distance) 532480.0) + (go (method-of-object this idle)) (none) ) @@ -1084,24 +1084,24 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch float vs none. -(defmethod attack-target! sew-wall ((obj sew-wall)) +(defmethod attack-target! sew-wall ((this sew-wall)) "If the target is close enough to the wall, hit it!" (let ((target *target*)) (when target - (let ((dist-from-wall (vector-vector-xz-distance (get-trans target 0) (-> obj root trans))) - (deadly-radius (-> obj deadly-radius)) - (prev-deadly-radius (-> obj prev-deadly-radius)) + (let ((dist-from-wall (vector-vector-xz-distance (get-trans target 0) (-> this root trans))) + (deadly-radius (-> this deadly-radius)) + (prev-deadly-radius (-> this prev-deadly-radius)) ) - (set! (-> obj prev-deadly-radius) deadly-radius) + (set! (-> this prev-deadly-radius) deadly-radius) (when (and (>= deadly-radius dist-from-wall) (>= dist-from-wall (+ -4096.0 prev-deadly-radius))) (let ((cquery (new 'stack-no-clear 'collide-query))) - (set! (-> cquery start-pos quad) (-> obj root trans quad)) + (set! (-> cquery start-pos quad) (-> this root trans quad)) (+! (-> cquery start-pos y) 12288.0) (vector-! (-> cquery move-dist) (get-trans target 3) (-> cquery start-pos)) (let ((v1-9 cquery)) (set! (-> v1-9 radius) 819.2) (set! (-> v1-9 collide-with) (collide-spec backgnd)) - (set! (-> v1-9 ignore-process0) obj) + (set! (-> v1-9 ignore-process0) this) (set! (-> v1-9 ignore-process1) #f) (set! (-> v1-9 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-9 action-mask) (collide-action solid)) @@ -1111,9 +1111,9 @@ This commonly includes things such as: *target* 'attack #f - (static-attack-info ((id (-> obj attack-id)) (mode 'explode) (attacker-velocity (-> cquery move-dist)))) + (static-attack-info ((id (-> this attack-id)) (mode 'explode) (attacker-velocity (-> cquery move-dist)))) ) - (set! (-> obj deadly-radius) -1.0) + (set! (-> this deadly-radius) -1.0) ) ) ) @@ -1230,17 +1230,17 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-wall ((obj sew-wall) (entity entity-actor)) +(defmethod init-from-entity! sew-wall ((this sew-wall) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (let ((data ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'art-name 'interp -1000000000.0 @@ -1251,8 +1251,8 @@ This commonly includes things such as: ) (art-group (art-group-get-by-name *level* "skel-sew-wall" (the-as (pointer uint32) #f))) ) - (set! (-> obj art-name) (the-as string data)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this art-name) (the-as string data)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -1299,48 +1299,48 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (cond - ((string= (-> obj art-name) "sew-wall-1") - (set! (-> obj anim) + ((string= (-> this art-name) "sew-wall-1") + (set! (-> this anim) (new 'static 'spool-anim :name "sew-wall-1" :anim-name "1-break" :parts 1 :command-list '()) ) - (set! (-> obj first-wall?) #t) + (set! (-> this first-wall?) #t) ) - ((string= (-> obj art-name) "sew-wall-2") - (set! (-> obj anim) + ((string= (-> this art-name) "sew-wall-2") + (set! (-> this anim) (new 'static 'spool-anim :name "sew-wall-2" :anim-name "2-break" :parts 1 :command-list '()) ) - (+! (-> obj root trans z) 26624.0) - (set! (-> obj first-wall?) #f) + (+! (-> this root trans z) 26624.0) + (set! (-> this first-wall?) #f) ) (else (go process-drawable-art-error (the-as string data)) ) ) - (initialize-skeleton obj (the-as skeleton-group art-group) (the-as pair 0)) + (initialize-skeleton this (the-as skeleton-group art-group) (the-as pair 0)) ) - (set! (-> obj draw force-lod) 0) + (set! (-> this draw force-lod) 0) (ja-channel-set! 1) - (let* ((channel (-> obj skel root-channel 0)) - (_art-group (-> obj draw art-group)) + (let* ((channel (-> this skel root-channel 0)) + (_art-group (-> this draw art-group)) (s3-1 (method-of-object _art-group get-art-by-name-method)) ) - (format (clear *temp-string*) "~S-idle" (-> obj art-name)) + (format (clear *temp-string*) "~S-idle" (-> this art-name)) (set! (-> channel frame-group) (the-as art-joint-anim (s3-1 _art-group *temp-string* (the-as type #f)))) ) (let* ((game-info *game-info*) (id (+ (-> game-info attack-id) 1)) ) (set! (-> game-info attack-id) id) - (set! (-> obj attack-id) id) + (set! (-> this attack-id) id) ) - (if (script-eval (res-lump-struct (-> obj entity) 'on-activate pair)) - (go (method-of-object obj hit) #t) - (go (method-of-object obj idle)) + (if (script-eval (res-lump-struct (-> this entity) 'on-activate pair)) + (go (method-of-object this hit) #t) + (go (method-of-object this idle)) ) (none) ) @@ -1378,21 +1378,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-grill ((obj sew-grill) (entity entity-actor)) +(defmethod init-from-entity! sew-grill ((this sew-grill) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj entity) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-grill" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1534,7 +1534,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self draw status) (draw-control-status no-draw)) ) :trans (behavior () @@ -1684,15 +1684,15 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sew-scare-grunt ((obj sew-scare-grunt)) - (go (method-of-object obj waiting)) +(defmethod go-idle sew-scare-grunt ((this sew-scare-grunt)) + (go (method-of-object this waiting)) (none) ) -(defmethod init-enemy-collision! sew-scare-grunt ((obj sew-scare-grunt)) +(defmethod init-enemy-collision! sew-scare-grunt ((this sew-scare-grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (stack-size-set! (-> obj main-thread) 512) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -1771,27 +1771,27 @@ This commonly includes things such as: (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) (set! (-> cshape max-iteration-count) (the-as uint 3)) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) 0 (none) ) -(defmethod get-enemy-info sew-scare-grunt ((obj sew-scare-grunt)) +(defmethod get-enemy-info sew-scare-grunt ((this sew-scare-grunt)) "@returns the [[nav-enemy-info]] associated with this type of grunt" *sew-scare-grunt-nav-enemy-info* ) ;; WARN: Return type mismatch float vs none. -(defmethod init-enemy! sew-scare-grunt ((obj sew-scare-grunt)) +(defmethod init-enemy! sew-scare-grunt ((this sew-scare-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "sew-scare-grunt" :anim-name "sew-scare-grunt" :parts 2 :command-list '()) ) - (set! (-> obj grill-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (set! (-> this grill-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (let ((func (method-of-type grunt init-enemy!))) - (func obj) + (func this) ) - (+! (-> obj root trans y) -3276.8) + (+! (-> this root trans y) -3276.8) (none) ) diff --git a/goal_src/jak2/levels/sewer/sewer-scenes.gc b/goal_src/jak2/levels/sewer/sewer-scenes.gc index 35086d916d..29cbb60735 100644 --- a/goal_src/jak2/levels/sewer/sewer-scenes.gc +++ b/goal_src/jak2/levels/sewer/sewer-scenes.gc @@ -1208,39 +1208,39 @@ ) ) -(defmethod draw hud-gunturret ((obj hud-gunturret)) +(defmethod draw hud-gunturret ((this hud-gunturret)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 205 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -20 24) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -20 24) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-gunturret ((obj hud-gunturret)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-gunturret ((this hud-gunturret)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-gunturret ((obj hud-gunturret)) - (set! (-> obj level) (level-get *level* 'sewerb)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-gunturret ((this hud-gunturret)) + (set! (-> this level) (level-get *level* 'sewerb)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd37))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.7) - (set! (-> obj sprites 0 scale-y) 0.7) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd37))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.7) + (set! (-> this sprites 0 scale-y) 0.7) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -1282,7 +1282,7 @@ (lambda :behavior task-manager () (local-vars (sv-96 int) (sv-100 float) (sv-104 vector)) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-gunturret :init hud-init-by-other :to self))) (while (> (-> self data-int32 0) 0) (when (!= (level-status *level* 'sewer) 'active) @@ -1327,10 +1327,10 @@ (set! (-> *game-info* counter) (the float v1-51)) ) (when (and (= (-> self data-int32 1) sv-96) - (and (< sv-100 122880.0) (>= (- (current-time) (-> self beep-time)) (seconds 40))) + (and (< sv-100 122880.0) (time-elapsed? (-> self beep-time) (seconds 40))) ) (talker-spawn-func (-> *talker-speech* 53) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self beep-time) (current-time)) + (set-time! (-> self beep-time)) ) (suspend) ) diff --git a/goal_src/jak2/levels/stadium/racebike.gc b/goal_src/jak2/levels/stadium/racebike.gc index 408f2feafd..c168e64688 100644 --- a/goal_src/jak2/levels/stadium/racebike.gc +++ b/goal_src/jak2/levels/stadium/racebike.gc @@ -768,21 +768,21 @@ ;; WARN: Return type mismatch process-drawable vs vehicle-race-bike. -(defmethod relocate vehicle-race-bike ((obj vehicle-race-bike) (arg0 int)) - (if (nonzero? (-> obj steering-wheel)) - (&+! (-> obj steering-wheel) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method vehicle-race-bike 7)) this arg0) ) ) -(defmethod update-joint-mods vehicle-race-bike ((obj vehicle-race-bike)) - (let ((f0-1 (* -5461.3335 (-> obj controls steering))) +(defmethod update-joint-mods vehicle-race-bike ((this vehicle-race-bike)) + (let ((f0-1 (* -5461.3335 (-> this controls steering))) (a1-0 (new 'static 'vector :z 1.0 :w 1.0)) ) - (quaternion-vector-angle! (the-as quaternion (-> obj steering-wheel target)) a1-0 f0-1) + (quaternion-vector-angle! (the-as quaternion (-> this steering-wheel target)) a1-0 f0-1) ) 0 (none) @@ -797,8 +797,8 @@ ) -(defmethod allocate-and-init-cshape race-bike-d ((obj race-bike-d)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape race-bike-d ((this race-bike-d)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -836,25 +836,25 @@ (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-skel-and-rigid-body race-bike-d ((obj race-bike-d)) +(defmethod init-skel-and-rigid-body race-bike-d ((this race-bike-d)) (race-vehicle-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-race-bike-d" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj rider-hand-joint) 4) - (set! (-> obj steering-wheel) - (the-as joint-mod (new 'process 'joint-mod-rotate-local obj (-> obj rider-hand-joint) #t)) + (set! (-> this rider-hand-joint) 4) + (set! (-> this steering-wheel) + (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this rider-hand-joint) #t)) ) - (alloc-and-init-rigid-body-control obj *race-bike-d-constants*) - (set! (-> obj draw light-index) (the-as uint 30)) + (alloc-and-init-rigid-body-control this *race-bike-d-constants*) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) @@ -868,8 +868,8 @@ ) -(defmethod allocate-and-init-cshape race-bike-e ((obj race-bike-e)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape race-bike-e ((this race-bike-e)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -907,25 +907,25 @@ (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-skel-and-rigid-body race-bike-e ((obj race-bike-e)) +(defmethod init-skel-and-rigid-body race-bike-e ((this race-bike-e)) (race-vehicle-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-race-bike-e" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj rider-hand-joint) 4) - (set! (-> obj steering-wheel) - (the-as joint-mod (new 'process 'joint-mod-rotate-local obj (-> obj rider-hand-joint) #t)) + (set! (-> this rider-hand-joint) 4) + (set! (-> this steering-wheel) + (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this rider-hand-joint) #t)) ) - (alloc-and-init-rigid-body-control obj *race-bike-e-constants*) - (set! (-> obj draw light-index) (the-as uint 30)) + (alloc-and-init-rigid-body-control this *race-bike-e-constants*) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) diff --git a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc index 6f3902ddd4..3b0973a388 100644 --- a/goal_src/jak2/levels/stadium/skate/skatea-obs.gc +++ b/goal_src/jak2/levels/stadium/skate/skatea-obs.gc @@ -61,8 +61,8 @@ ) -(defmethod render-text hoverboard-training-manager ((obj hoverboard-training-manager) (arg0 text-id)) - (when (= (get-status *gui-control* (-> obj gui-id)) (gui-status active)) +(defmethod render-text hoverboard-training-manager ((this hoverboard-training-manager) (arg0 text-id)) + (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) (let ((s5-1 (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) ) @@ -661,12 +661,12 @@ ) ) -(defmethod hoverboard-training-manager-method-29 hoverboard-training-manager ((obj hoverboard-training-manager)) - (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> obj game-score)))) - (gp-0 (handle->process (-> obj hud-goal))) +(defmethod hoverboard-training-manager-method-29 hoverboard-training-manager ((this hoverboard-training-manager)) + (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> this game-score)))) + (gp-0 (handle->process (-> this hud-goal))) ) (cond - ((-> obj training?) + ((-> this training?) (cond ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) @@ -698,7 +698,7 @@ (s5-3 gp-3 s4-3 *temp-string*) ) ) - ((>= (-> *game-info* score) (-> obj training-goal)) + ((>= (-> *game-info* score) (-> this training-goal)) (set! (-> *game-info* goal) (-> s5-0 2)) (let ((s5-4 format) (gp-4 (the-as hud-goal (clear (-> (the-as hud-goal gp-0) strings 1 text)))) @@ -709,7 +709,7 @@ ) ) (else - (set! (-> *game-info* goal) (-> obj training-goal)) + (set! (-> *game-info* goal) (-> this training-goal)) (let ((s5-5 format) (gp-5 (the-as hud-goal (clear (-> (the-as hud-goal gp-0) strings 1 text)))) (s4-5 "~S") @@ -720,7 +720,7 @@ ) ) ) - ((task-node-open? (the-as game-task-node (-> obj task-bronze))) + ((task-node-open? (the-as game-task-node (-> this task-bronze))) (cond ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) @@ -764,7 +764,7 @@ ) ) ) - ((task-node-open? (the-as game-task-node (-> obj task-silver))) + ((task-node-open? (the-as game-task-node (-> this task-silver))) (cond ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) @@ -798,8 +798,8 @@ ) ) ) - ((or (task-node-open? (the-as game-task-node (-> obj task-gold))) - (task-node-closed? (the-as game-task-node (-> obj task-gold))) + ((or (task-node-open? (the-as game-task-node (-> this task-gold))) + (task-node-closed? (the-as game-task-node (-> this task-gold))) ) (cond ((>= (-> *game-info* score) (-> s5-0 0)) @@ -830,40 +830,40 @@ (none) ) -(defmethod hoverboard-training-manager-method-30 hoverboard-training-manager ((obj hoverboard-training-manager)) - (set! (-> obj egg-count) 0) - (set! (-> obj medal) 0) - (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> obj game-score))))) - (when (or (-> obj training?) (task-node-open? (the-as game-task-node (-> obj task-bronze)))) +(defmethod hoverboard-training-manager-method-30 hoverboard-training-manager ((this hoverboard-training-manager)) + (set! (-> this egg-count) 0) + (set! (-> this medal) 0) + (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> this game-score))))) + (when (or (-> this training?) (task-node-open? (the-as game-task-node (-> this task-bronze)))) (when (>= (-> *game-info* score) (-> s5-0 2)) - (task-node-close! (the-as game-task-node (-> obj task-bronze))) + (task-node-close! (the-as game-task-node (-> this task-bronze))) (logior! (-> *game-info* features) (game-feature board)) - (+! (-> obj egg-count) 1) - (set! (-> obj medal) 2) + (+! (-> this egg-count) 1) + (set! (-> this medal) 2) ) ) - (when (task-node-open? (the-as game-task-node (-> obj task-silver))) + (when (task-node-open? (the-as game-task-node (-> this task-silver))) (when (>= (-> *game-info* score) (-> s5-0 1)) - (task-node-close! (the-as game-task-node (-> obj task-silver))) + (task-node-close! (the-as game-task-node (-> this task-silver))) (logior! (-> *game-info* features) (game-feature board)) - (+! (-> obj egg-count) 1) - (set! (-> obj medal) 1) + (+! (-> this egg-count) 1) + (set! (-> this medal) 1) ) ) - (when (task-node-open? (the-as game-task-node (-> obj task-gold))) + (when (task-node-open? (the-as game-task-node (-> this task-gold))) (when (>= (-> *game-info* score) (-> s5-0 0)) - (task-node-close! (the-as game-task-node (-> obj task-gold))) + (task-node-close! (the-as game-task-node (-> this task-gold))) (logior! (-> *game-info* features) (game-feature board)) - (+! (-> obj egg-count) 1) - (set! (-> obj medal) 0) + (+! (-> this egg-count) 1) + (set! (-> this medal) 0) 0 ) ) ) - (game-info-method-28 *game-info* (the-as game-score (-> obj game-score)) (-> obj score)) + (game-info-method-28 *game-info* (the-as game-score (-> this game-score)) (-> this score)) ;; og:preserve-this give skill directly (#when PC_PORT - (send-event *target* 'get-pickup (pickup-type skill) (* (the float (-> obj egg-count)) (-> *FACT-bank* super-skill-inc)))) + (send-event *target* 'get-pickup (pickup-type skill) (* (the float (-> this egg-count)) (-> *FACT-bank* super-skill-inc)))) 0 (none) ) @@ -1311,47 +1311,47 @@ ) ) -(defmethod deactivate hoverboard-training-manager ((obj 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)) obj) + ((the-as (function process none) (find-parent-method hoverboard-training-manager 10)) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hoverboard-training-manager ((obj hoverboard-training-manager) (arg0 entity-actor)) +(defmethod init-from-entity! hoverboard-training-manager ((this hoverboard-training-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 1024) ;; added + (stack-size-set! (-> this main-thread) 1024) ;; added (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-1 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-1 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-1)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-1)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) (go process-drawable-art-error "actor-group training-manager") ) ) ) - (set! (-> obj boost) #f) - (set! (-> obj grind) #f) - (set! (-> obj text) #t) - (set! (-> obj combo-done?) #f) - (set! (-> obj hud-score) (the-as handle #f)) - (set! (-> obj hud-goal) (the-as handle #f)) - (set! (-> obj voicebox) (the-as handle #f)) - (set! (-> obj arrow) (the-as handle #f)) - (set! (-> obj gui-id) (new 'static 'sound-id)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel message) (gui-action play) (-> obj name) 81920.0 0) + (set! (-> this boost) #f) + (set! (-> this grind) #f) + (set! (-> this text) #t) + (set! (-> this combo-done?) #f) + (set! (-> this hud-score) (the-as handle #f)) + (set! (-> this hud-goal) (the-as handle #f)) + (set! (-> this voicebox) (the-as handle #f)) + (set! (-> this arrow) (the-as handle #f)) + (set! (-> this gui-id) (new 'static 'sound-id)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel message) (gui-action play) (-> this name) 81920.0 0) ) (let ((s5-0 *traffic-manager*)) (send-event s5-0 'set-object-target-count (traffic-type bikea) 0) @@ -1375,22 +1375,22 @@ This commonly includes things such as: (set-setting! 'allow-continue #f 0.0 0) (cond ((task-node-closed? (game-task-node forest-scouts-get-board)) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((task-node-closed? (game-task-node stadium-board1-resolution)) - (go (method-of-object obj wait-for-pickup-training)) + (go (method-of-object this wait-for-pickup-training)) ) ((task-node-open? (game-task-node stadium-board1-training)) - (go (method-of-object obj jump)) + (go (method-of-object this jump)) ) ((task-node-open? (game-task-node stadium-board1-training-judge)) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((task-node-closed? (game-task-node stadium-board1-training-judge)) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) (else - (go (method-of-object obj wait-for-board)) + (go (method-of-object this wait-for-board)) ) ) (none) @@ -1449,8 +1449,8 @@ This commonly includes things such as: ) ) -(defmethod skate-training-ramp-method-28 skate-training-ramp ((obj skate-training-ramp)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod skate-training-ramp-method-28 skate-training-ramp ((this skate-training-ramp)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1485,39 +1485,39 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skate-training-ramp ((obj skate-training-ramp) (arg0 entity-actor)) +(defmethod init-from-entity! skate-training-ramp ((this skate-training-ramp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (skate-training-ramp-method-28 obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (skate-training-ramp-method-28 this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-skate-training-ramp" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj onoff) #f) + (set! (-> this onoff) #f) (ja-channel-push! 1 0) - (let ((a0-7 (-> obj skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1586,8 +1586,8 @@ This commonly includes things such as: :code sleep-code ) -(defmethod skate-gate-method-29 skate-gate ((obj skate-gate)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod skate-gate-method-29 skate-gate ((this skate-gate)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1608,28 +1608,28 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skate-gate ((obj skate-gate) (arg0 entity-actor)) +(defmethod init-from-entity! skate-gate ((this skate-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (skate-gate-method-29 obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (skate-gate-method-29 this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-skate-gate" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj onoff) #f) + (set! (-> this onoff) #f) (send-event *target* 'reset-pickup 'trick-judge) (send-event *target* 'reset-pickup 'trick-point) (ja-channel-push! 1 0) @@ -1637,22 +1637,22 @@ This commonly includes things such as: ((and (not (task-node-open? (game-task-node stadium-board1-training-judge))) (logtest? (-> *game-info* features) (game-feature board)) ) - (let ((a0-15 (-> obj skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-15 frame-num) 1.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj open)) + (go (method-of-object this open)) ) (else - (let ((a0-16 (-> obj skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-16 (-> this skel root-channel 0))) + (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1672,9 +1672,9 @@ This commonly includes things such as: ) -(defmethod init-skeleton! skatea-jump-pad ((obj skatea-jump-pad)) +(defmethod init-skeleton! skatea-jump-pad ((this skatea-jump-pad)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-skatea-jump-pad" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1682,9 +1682,9 @@ This commonly includes things such as: (none) ) -(defmethod bouncer-method-24 skatea-jump-pad ((obj skatea-jump-pad)) +(defmethod bouncer-method-24 skatea-jump-pad ((this skatea-jump-pad)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) @@ -1712,7 +1712,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1834,8 +1834,8 @@ This commonly includes things such as: ) ) -(defmethod skatea-floating-ring-method-28 skatea-floating-ring ((obj skatea-floating-ring)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod skatea-floating-ring-method-28 skatea-floating-ring ((this skatea-floating-ring)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1855,37 +1855,37 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skatea-floating-ring ((obj skatea-floating-ring) (arg0 entity-actor)) +(defmethod init-from-entity! skatea-floating-ring ((this skatea-floating-ring) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (skatea-floating-ring-method-28 obj) - (process-drawable-from-entity! obj arg0) + (skatea-floating-ring-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-skatea-floating-ring" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj pos-y) (-> obj root trans y)) - (set! (-> obj offset) (rand-vu)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 539) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "fire-ring" :fo-min 10 :fo-max 30) (-> obj root trans)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this pos-y) (-> this root trans y)) + (set! (-> this offset) (rand-vu)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 539) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "fire-ring" :fo-min 10 :fo-max 30) (-> this root trans)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/stadium/stadium-obs.gc b/goal_src/jak2/levels/stadium/stadium-obs.gc index 002814009e..dd7723c328 100644 --- a/goal_src/jak2/levels/stadium/stadium-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-obs.gc @@ -32,14 +32,14 @@ ) ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-stadium ((obj water-anim-stadium)) +(defmethod init-water! water-anim-stadium ((this water-anim-stadium)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) @@ -72,14 +72,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dummy-vehicle ((obj dummy-vehicle) (arg0 entity-actor)) +(defmethod init-from-entity! dummy-vehicle ((this dummy-vehicle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -100,22 +100,22 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (let ((s5-1 (res-lump-struct (-> obj entity) 'art-name structure))) + (process-drawable-from-entity! this arg0) + (let ((s5-1 (res-lump-struct (-> this entity) 'art-name structure))) (when (not s5-1) - (format 0 "ERROR: dummy-vehicle::initialize: no art-name set for ~s~%" obj) + (format 0 "ERROR: dummy-vehicle::initialize: no art-name set for ~s~%" this) (go process-drawable-art-error "no art-name set") ) - (when (not (art-group-get-by-name *level* (the-as string s5-1) (the-as (pointer uint32) (&-> obj level)))) + (when (not (art-group-get-by-name *level* (the-as string s5-1) (the-as (pointer uint32) (&-> this level)))) (format 0 "ERROR: dummy-vehicle::initialize: no art named ~s found in any currently loaded level~%" s5-1) (go process-drawable-art-error "no named art found in any currently loaded level") ) - (format #t "dummy-vehicle::initialize: setup art ~s from level ~s~%" s5-1 (-> obj level name)) - (initialize-skeleton-by-name obj (the-as string s5-1)) + (format #t "dummy-vehicle::initialize: setup art ~s from level ~s~%" s5-1 (-> this level name)) + (initialize-skeleton-by-name this (the-as string s5-1)) ) - (when (name= (-> obj name) "dummy-vehicle-6") + (when (name= (-> this name) "dummy-vehicle-6") (let ((v1-25 (new 'process 'shadow-control @@ -130,11 +130,11 @@ This commonly includes things such as: (set-vector! (-> v1-25 settings shadow-dir) 0.9128 -0.1825 -0.3651 -98304.0) (set-vector! (-> v1-25 settings top-plane) -0.9128 0.1825 0.3651 958464.0) (set-vector! (-> v1-25 settings bot-plane) -0.9128 0.1825 0.3651 970752.0) - (set! (-> obj draw shadow-ctrl) v1-25) + (set! (-> this draw shadow-ctrl) v1-25) ) ) - (set! (-> obj draw light-index) (the-as uint 17)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 17)) + (go (method-of-object this idle)) (none) ) @@ -184,7 +184,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gar-curtain ((obj gar-curtain) (arg0 entity-actor)) +(defmethod init-from-entity! gar-curtain ((this gar-curtain) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -192,7 +192,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 8) 0))) (set! (-> s4-0 total-prims) (the-as uint 9)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) @@ -238,16 +238,16 @@ This commonly includes things such as: (+! (-> (the-as collide-shape-prim-group v1-24) child a0-10 local-sphere y) -14336.0) ) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gar-curtain" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-vector-angle! (-> obj root quat) *y-vector* 5461.3335) - (go (method-of-object obj idle)) + (quaternion-vector-angle! (-> this root quat) *y-vector* 5461.3335) + (go (method-of-object this idle)) (none) ) @@ -568,18 +568,18 @@ This commonly includes things such as: (-> arg0 status) ) -(defmethod rigid-body-object-method-29 rift-rider ((obj rift-rider) (arg0 float)) +(defmethod rigid-body-object-method-29 rift-rider ((this rift-rider) (arg0 float)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (let ((f30-0 (* (-> obj rbody state info mass) (-> obj info extra gravity)))) - (let ((a1-2 (quaternion-conjugate! (new 'stack-no-clear 'quaternion) (-> obj root quat)))) + (let ((f30-0 (* (-> this rbody state info mass) (-> this info extra gravity)))) + (let ((a1-2 (quaternion-conjugate! (new 'stack-no-clear 'quaternion) (-> this root quat)))) (vector-z-quaternion! (new 'stack-no-clear 'vector) a1-2) ) - (let ((f28-0 (fmax 0.0 (fmin 1.0 (* 0.000020345053 (- (-> obj dest-pos y) (-> obj root trans y))))))) + (let ((f28-0 (fmax 0.0 (fmin 1.0 (* 0.000020345053 (- (-> this dest-pos y) (-> this root trans y))))))) (vector-reset! s5-0) (set! (-> s5-0 y) (* -1.0 f30-0)) - (let ((v1-10 (-> obj rbody)) + (let ((v1-10 (-> this rbody)) (a1-3 s5-0) ) (rigid-body-method-20 (-> v1-10 state) a1-3) @@ -587,58 +587,58 @@ This commonly includes things such as: (vector-normalize-copy! s5-0 *y-vector* - (fmin 20480.0 (* 1.5 f30-0 f28-0 (fmax 0.2 (* (-> obj escort-force 0 y) (-> obj escort-force 1 y))))) + (fmin 20480.0 (* 1.5 f30-0 f28-0 (fmax 0.2 (* (-> this escort-force 0 y) (-> this escort-force 1 y))))) ) - (set! (-> gp-0 quad) (-> obj root trans quad)) - (let ((v1-17 (-> obj rbody)) + (set! (-> gp-0 quad) (-> this root trans quad)) + (let ((v1-17 (-> this rbody)) (a1-5 gp-0) (a2-1 s5-0) ) (rigid-body-method-18 (-> v1-17 state) a1-5 a2-1) ) (vector-reset! s5-0) - (vector-! s5-0 (-> obj dest-pos) (-> obj root trans)) + (vector-! s5-0 (-> this dest-pos) (-> this root trans)) (vector-float*! s5-0 s5-0 8.0) (set! (-> s5-0 y) 0.0) - (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 0) (-> obj root quat)) - (vector+! gp-0 gp-0 (-> obj root trans)) - (let ((v1-27 (-> obj rbody)) + (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 0) (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (let ((v1-27 (-> this rbody)) (a1-12 gp-0) (a2-3 s5-0) ) (rigid-body-method-18 (-> v1-27 state) a1-12 a2-3) ) - (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> obj escort-force 0 y))) - (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 1) (-> obj root quat)) - (vector+! gp-0 gp-0 (-> obj root trans)) - (let ((v1-34 (-> obj rbody)) + (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> this escort-force 0 y))) + (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 1) (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (let ((v1-34 (-> this rbody)) (a1-17 gp-0) (a2-6 s5-0) ) (rigid-body-method-18 (-> v1-34 state) a1-17 a2-6) ) - (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 2) (-> obj root quat)) - (vector+! gp-0 gp-0 (-> obj root trans)) - (let ((v1-40 (-> obj rbody)) + (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 2) (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (let ((v1-40 (-> this rbody)) (a1-21 gp-0) (a2-8 s5-0) ) (rigid-body-method-18 (-> v1-40 state) a1-21 a2-8) ) - (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> obj escort-force 1 y))) + (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> this escort-force 1 y))) ) ) - (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 3) (-> obj root quat)) - (vector+! gp-0 gp-0 (-> obj root trans)) - (let ((v1-47 (-> obj rbody)) + (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 3) (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (let ((v1-47 (-> this rbody)) (a1-26 gp-0) (a2-11 s5-0) ) (rigid-body-method-18 (-> v1-47 state) a1-26 a2-11) ) - (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 4) (-> obj root quat)) - (vector+! gp-0 gp-0 (-> obj root trans)) - (rigid-body-method-18 (-> obj rbody state) gp-0 s5-0) + (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 4) (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (rigid-body-method-18 (-> this rbody state) gp-0 s5-0) ) 0 (none) @@ -868,7 +868,7 @@ This commonly includes things such as: :virtual #t :event defend-stadium-rift-rider-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (< (-> self height) (-> self init-height)) @@ -877,7 +877,7 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1.2)) + (until (time-elapsed? gp-0 (seconds 1.2)) (suspend) ) ) @@ -941,31 +941,31 @@ This commonly includes things such as: ) ) -(defmethod rigid-body-object-method-45 rift-rider ((obj rift-rider) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 rift-rider ((this rift-rider) (arg0 rigid-body-impact)) (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)) obj arg0) + ((the-as (function rigid-body-object rigid-body-impact none) (find-parent-method rift-rider 45)) this arg0) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod rigid-body-object-method-34 rift-rider ((obj rift-rider)) +(defmethod rigid-body-object-method-34 rift-rider ((this rift-rider)) (cond - ((nonzero? (-> obj path)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 902) obj)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + ((nonzero? (-> this path)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 902) this)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (go defend-stadium-wait) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) ) -(defmethod allocate-and-init-cshape rift-rider ((obj rift-rider)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod allocate-and-init-cshape rift-rider ((this rift-rider)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1004,51 +1004,51 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod deactivate rift-rider ((obj rift-rider)) - (sound-stop (-> obj sound-id)) - ((the-as (function rigid-body-object none) (find-parent-method rift-rider 10)) obj) +(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) (none) ) -(defmethod init-skel-and-rigid-body rift-rider ((obj rift-rider)) +(defmethod init-skel-and-rigid-body rift-rider ((this rift-rider)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-rift-rider-no-lift" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *rift-rider-physics-constants*) - (rigid-body-object-method-38 obj) - (rigid-body-object-method-40 obj) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-collision)) - (logior! (-> obj rbody state flags) (rigid-body-flag display-marks)) - (set! (-> obj draw shadow-ctrl) + (alloc-and-init-rigid-body-control this *rift-rider-physics-constants*) + (rigid-body-object-method-38 this) + (rigid-body-object-method-40 this) + (logior! (-> this rbody state flags) (rigid-body-flag enable-collision)) + (logior! (-> this rbody state flags) (rigid-body-flag display-marks)) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (shadow-flags shdf02 shdf03 shdf04 disable-draw) 245760.0) ) - (quad-copy! (the-as pointer (-> obj draw shadow-ctrl settings)) (the-as pointer *default-shadow-settings*) 5) - (set! (-> obj root dynam gravity y) 81920.0) - (set! (-> obj root dynam gravity-length) 81920.0) - (set! (-> obj root dynam gravity-max) 81920.0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #t)) - (set! (-> obj height) 0.0) - (set! (-> obj init-height) (-> obj root trans y)) - (set! (-> obj escort-actor 0) #f) - (set! (-> obj escort-actor 1) #f) - (set! (-> obj brutter-balloon-actor) #f) - (set! (-> obj battle-entity-triggered) 0) - (set! (-> obj battle-info-index) 0) - (set! (-> obj sound-id) (new-sound-id)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (let ((a0-13 (-> obj skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (quad-copy! (the-as pointer (-> this draw shadow-ctrl settings)) (the-as pointer *default-shadow-settings*) 5) + (set! (-> this root dynam gravity y) 81920.0) + (set! (-> this root dynam gravity-length) 81920.0) + (set! (-> this root dynam gravity-max) 81920.0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #t)) + (set! (-> this height) 0.0) + (set! (-> this init-height) (-> this root trans y)) + (set! (-> this escort-actor 0) #f) + (set! (-> this escort-actor 1) #f) + (set! (-> this brutter-balloon-actor) #f) + (set! (-> this battle-entity-triggered) 0) + (set! (-> this battle-info-index) 0) + (set! (-> this sound-id) (new-sound-id)) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-identity) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity) ) (transform-post) (none) @@ -1082,21 +1082,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! spotlight ((obj spotlight) (arg0 entity-actor)) +(defmethod init-from-entity! spotlight ((this spotlight) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-spotlight" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1116,7 +1116,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gar-door ((obj gar-door) (arg0 entity-actor)) +(defmethod init-from-entity! gar-door ((this gar-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1124,8 +1124,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 560) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 560) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1154,16 +1154,16 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gar-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj door-radius) 40960.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this door-radius) 40960.0) + (go (method-of-object this close) #t) (none) ) @@ -1335,9 +1335,9 @@ This commonly includes things such as: (defbehavior stad-samos-post stad-samos () - (when (>= (- (current-time) (-> self cquery-timer)) (seconds 0.32)) + (when (time-elapsed? (-> self cquery-timer) (seconds 0.32)) (move-to-ground (-> self root) 40960.0 40960.0 #t (collide-spec backgnd)) - (set! (-> self cquery-timer) (current-time)) + (set-time! (-> self cquery-timer)) ) (when (and (nonzero? (-> self focus-disable-timer)) (< (-> self focus-disable-timer) (current-time))) (logclear! (-> self focus-status) (focus-status ignore)) @@ -1483,7 +1483,7 @@ This commonly includes things such as: ) (set! (-> self rift-rider-actor) (entity-actor-lookup (-> self entity) 'alt-actor 0)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.31)) + (until (time-elapsed? gp-0 (seconds 0.31)) (suspend) ) ) @@ -1539,10 +1539,10 @@ This commonly includes things such as: (set! (-> self enable-move?) #t) (set! (-> self speed) 12288.0) (set! (-> self observed-speed) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (and (nonzero? (-> self state-time)) (>= (- (current-time) (-> self state-time)) (seconds 1))) + (when (and (nonzero? (-> self state-time)) (time-elapsed? (-> self state-time) (seconds 1))) (set! (-> self state-time) 0) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) @@ -1561,7 +1561,7 @@ This commonly includes things such as: ) (spawn-lightning self) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (go-virtual move-rift-rider) ) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -1907,7 +1907,7 @@ This commonly includes things such as: ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 2)) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) @@ -1917,13 +1917,13 @@ This commonly includes things such as: :post stad-samos-post ) -(defmethod get-position stad-samos ((obj stad-samos)) +(defmethod get-position stad-samos ((this stad-samos)) 'right ) ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-lightning stad-samos ((obj stad-samos)) - (let* ((v1-0 (-> obj rift-rider-actor)) +(defmethod spawn-lightning stad-samos ((this stad-samos)) + (let* ((v1-0 (-> this rift-rider-actor)) (s5-0 (if v1-0 (-> v1-0 extra process) ) @@ -1931,7 +1931,7 @@ This commonly includes things such as: ) (when s5-0 (dotimes (s4-0 4) - (set! (-> obj lightning s4-0) + (set! (-> this lightning s4-0) (process->handle (ppointer->process (process-spawn lightning-tracker @@ -1940,40 +1940,40 @@ This commonly includes things such as: 0 #f s5-0 - (-> *stad-samos-lightning-joint-tbl* (+ s4-0 (-> obj rift-rider-joint-offset))) - (-> obj hand-joint) - :to obj + (-> *stad-samos-lightning-joint-tbl* (+ s4-0 (-> this rift-rider-joint-offset))) + (-> this hand-joint) + :to this ) ) ) ) ) - (set! (-> obj lightning-on?) #t) + (set! (-> this lightning-on?) #t) ) ) (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod kill-lightning stad-samos ((obj stad-samos)) +(defmethod kill-lightning stad-samos ((this stad-samos)) (dotimes (s5-0 4) - (send-event (handle->process (-> obj lightning s5-0)) 'die) + (send-event (handle->process (-> this lightning s5-0)) 'die) ) - (set! (-> obj lightning-on?) #f) + (set! (-> this lightning-on?) #f) (none) ) -(defmethod deactivate stad-samos ((obj stad-samos)) - (if (valid? (-> obj hud) (the-as type #f) "" #t 0) - (send-event (handle->process (-> obj hud)) 'hide-and-die) +(defmethod deactivate stad-samos ((this stad-samos)) + (if (valid? (-> this hud) (the-as type #f) "" #t 0) + (send-event (handle->process (-> this hud)) 'hide-and-die) ) - (kill-lightning obj) - ((the-as (function process-focusable none) (find-parent-method stad-samos 10)) obj) + (kill-lightning this) + ((the-as (function process-focusable none) (find-parent-method stad-samos 10)) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-samos ((obj stad-samos) (arg0 entity-actor)) +(defmethod init-from-entity! stad-samos ((this stad-samos) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1981,8 +1981,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) #x180) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (stack-size-set! (-> this main-thread) #x180) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -2029,35 +2029,35 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj hud) (the-as handle #f)) - (set! (-> obj hud-bot-index) 0) - (set! (-> obj rift-rider-joint-offset) 0) - (process-drawable-from-entity! obj arg0) - (init! obj) - (get-nav-control obj (the-as nav-mesh #f)) - (let ((v1-24 (-> obj nav))) + (set! (-> this hud) (the-as handle #f)) + (set! (-> this hud-bot-index) 0) + (set! (-> this rift-rider-joint-offset) 0) + (process-drawable-from-entity! this arg0) + (init! this) + (get-nav-control this (the-as nav-mesh #f)) + (let ((v1-24 (-> this nav))) (set! (-> v1-24 sphere-mask) (the-as uint 1102)) ) 0 - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj rift-rider-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj entity) arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this rift-rider-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this entity) arg0) (dotimes (v1-28 4) - (set! (-> obj lightning v1-28) (the-as handle #f)) + (set! (-> this lightning v1-28) (the-as handle #f)) ) - (set! (-> obj lightning-on?) #f) - (set! (-> obj rift-rider-actor) #f) - (set! (-> obj cquery-timer) (current-time)) - (vector-reset! (-> obj hit-dir)) - (set! (-> obj max-hit-points) (+ 5.0 (* 5.0 (you-suck-scale *game-info* #f)))) - (set! (-> obj hit-points) (-> obj max-hit-points)) - (set! (-> obj incoming-attack-id) (the-as uint -1)) - (set! (-> obj focus-disable-timer) 0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 903) obj)) - (go (method-of-object obj idle)) + (set! (-> this lightning-on?) #f) + (set! (-> this rift-rider-actor) #f) + (set-time! (-> this cquery-timer)) + (vector-reset! (-> this hit-dir)) + (set! (-> this max-hit-points) (+ 5.0 (* 5.0 (you-suck-scale *game-info* #f)))) + (set! (-> this hit-points) (-> this max-hit-points)) + (set! (-> this incoming-attack-id) (the-as uint -1)) + (set! (-> this focus-disable-timer) 0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 903) this)) + (go (method-of-object this idle)) (none) ) @@ -2067,25 +2067,25 @@ This commonly includes things such as: :shadow samos-shadow-mg ) -(defmethod init! stad-samos ((obj stad-samos)) +(defmethod init! stad-samos ((this stad-samos)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-samos" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj stand-anim) 6) - (set! (-> obj walk-anim) 8) - (set! (-> obj raise-ship-anim) 7) - (set! (-> obj knocked-back-anim) 11) - (set! (-> obj knocked-back-land-anim) 12) - (set! (-> obj knocked-forward-anim) 9) - (set! (-> obj knocked-forward-land-anim) 10) - (set! (-> obj death-anim) 13) - (set! (-> obj death-end-anim) 14) - (set! (-> obj hud) (ppointer->handle (process-spawn hud-samos-old :init hud-init-by-other :to obj))) - (set! (-> obj hud-bot-index) 1) - (set! (-> obj rift-rider-joint-offset) 4) - (set! (-> obj hand-joint) 22) + (set! (-> this stand-anim) 6) + (set! (-> this walk-anim) 8) + (set! (-> this raise-ship-anim) 7) + (set! (-> this knocked-back-anim) 11) + (set! (-> this knocked-back-land-anim) 12) + (set! (-> this knocked-forward-anim) 9) + (set! (-> this knocked-forward-land-anim) 10) + (set! (-> this death-anim) 13) + (set! (-> this death-end-anim) 14) + (set! (-> this hud) (ppointer->handle (process-spawn hud-samos-old :init hud-init-by-other :to this))) + (set! (-> this hud-bot-index) 1) + (set! (-> this rift-rider-joint-offset) 4) + (set! (-> this hand-joint) 22) 0 (none) ) @@ -2168,29 +2168,29 @@ This commonly includes things such as: ) ) -(defmethod init! stad-youngsamos ((obj stad-youngsamos)) +(defmethod init! stad-youngsamos ((this stad-youngsamos)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-youngsamos" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj stand-anim) 17) - (set! (-> obj walk-anim) 25) - (set! (-> obj raise-ship-anim) 18) - (set! (-> obj knocked-back-anim) 19) - (set! (-> obj knocked-back-land-anim) 20) - (set! (-> obj knocked-forward-anim) 21) - (set! (-> obj knocked-forward-land-anim) 22) - (set! (-> obj death-anim) 23) - (set! (-> obj death-end-anim) 24) - (set! (-> obj hud) (ppointer->handle (process-spawn hud-samos-young :init hud-init-by-other :to obj))) - (set! (-> obj hud-bot-index) 0) - (set! (-> obj hand-joint) 25) + (set! (-> this stand-anim) 17) + (set! (-> this walk-anim) 25) + (set! (-> this raise-ship-anim) 18) + (set! (-> this knocked-back-anim) 19) + (set! (-> this knocked-back-land-anim) 20) + (set! (-> this knocked-forward-anim) 21) + (set! (-> this knocked-forward-land-anim) 22) + (set! (-> this death-anim) 23) + (set! (-> this death-end-anim) 24) + (set! (-> this hud) (ppointer->handle (process-spawn hud-samos-young :init hud-init-by-other :to this))) + (set! (-> this hud-bot-index) 0) + (set! (-> this hand-joint) 25) 0 (none) ) -(defmethod get-position stad-youngsamos ((obj stad-youngsamos)) +(defmethod get-position stad-youngsamos ((this stad-youngsamos)) 'left ) @@ -2218,19 +2218,19 @@ This commonly includes things such as: ) -(defmethod stadium-barrier-method-22 stadium-barrier ((obj stadium-barrier)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod stadium-barrier-method-22 stadium-barrier ((this stadium-barrier)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) -(defmethod stadium-barrier-method-23 stadium-barrier ((obj stadium-barrier)) +(defmethod stadium-barrier-method-23 stadium-barrier ((this stadium-barrier)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stadium-barrier" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw lod-set lod 0 dist) 409600.0) + (set! (-> this draw lod-set lod 0 dist) 409600.0) 0 (none) ) @@ -2268,14 +2268,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! stadium-barrier ((obj stadium-barrier) (arg0 entity-actor)) +(defmethod init-from-entity! stadium-barrier ((this stadium-barrier) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -2331,7 +2331,7 @@ This commonly includes things such as: ) -(defmethod stad-force-field-method-29 stad-force-field ((obj stad-force-field) (arg0 touching-shapes-entry)) +(defmethod stad-force-field-method-29 stad-force-field ((this stad-force-field) (arg0 touching-shapes-entry)) (local-vars (sv-256 entity-actor) (sv-272 collide-tri-result) @@ -2349,23 +2349,23 @@ This commonly includes things such as: (if (not arg0) (return (the-as int #f)) ) - (if (handle->process (-> obj field)) - (deactivate (-> obj field process 0)) + (if (handle->process (-> this field)) + (deactivate (-> this field process 0)) ) - (if (handle->process (-> obj ripple)) - (deactivate (-> obj ripple process 0)) + (if (handle->process (-> this ripple)) + (deactivate (-> this ripple process 0)) ) (let* ((s3-0 (get-process *default-dead-pool* manipy #x4000)) (s4-0 (when s3-0 (let ((t9-3 (method-of-type manipy activate))) - (t9-3 (the-as manipy s3-0) obj (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) + (t9-3 (the-as manipy s3-0) this (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) ) (let ((s4-1 run-function-in-process) (s2-0 s3-0) (s1-0 manipy-init) - (s0-0 (-> obj root trans)) + (s0-0 (-> this root trans)) ) - (set! sv-256 (-> obj entity)) + (set! sv-256 (-> this entity)) (let ((t0-0 (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f))) (t1-0 #f) (t2-0 0) @@ -2390,19 +2390,19 @@ This commonly includes things such as: 0.0 (let ((s3-1 (new 'stack-no-clear 'vector))) (when s4-0 - (set! (-> obj ripple) (ppointer->handle s4-0)) + (set! (-> this ripple) (ppointer->handle s4-0)) (send-event (ppointer->process s4-0) 'anim-mode 'play1) (send-event (ppointer->process s4-0) 'speed 1.5) (send-event (ppointer->process s4-0) 'art-joint-anim "generic-ripples-idle" 0) (set-vector! (-> (the-as process-drawable (-> s4-0 0)) root scale) 1.0 1.0 1.0 1.0) (let ((s2-1 (-> arg0 head))) (while s2-1 - (get-touched-prim s2-1 (-> obj root) arg0) - (set! sv-272 (get-touched-tri s2-1 (-> obj root) arg0)) + (get-touched-prim s2-1 (-> this root) arg0) + (set! sv-272 (get-touched-tri s2-1 (-> this root) arg0)) (when sv-272 (quaternion-look-at! (-> (the-as process-drawable (-> s4-0 0)) root quat) (-> sv-272 normal) *up-vector*) - (set! (-> obj plane quad) (-> sv-272 normal quad)) - (set! (-> obj plane w) (- (vector-dot (-> sv-272 normal) (the-as vector (-> sv-272 vertex))))) + (set! (-> this plane quad) (-> sv-272 normal quad)) + (set! (-> this plane w) (- (vector-dot (-> sv-272 normal) (the-as vector (-> sv-272 vertex))))) (let ((f30-0 (the-as float #x7f800000)) (f28-0 (the-as float #xff800000)) (s0-1 (new 'stack-no-clear 'vector)) @@ -2491,17 +2491,17 @@ This commonly includes things such as: ) ) (send-event (ppointer->process s4-0) 'trans-hook (lambda () (none))) - (set! (-> obj field) (ppointer->handle (stadium-barrier-spawn - obj - (-> (the-as process-drawable (-> s4-0 0)) root trans) - (quaternion-rotate-local-x! - (new 'stack-no-clear 'quaternion) - (-> (the-as process-drawable (-> s4-0 0)) root quat) - 16384.0 - ) - s3-1 - ) - ) + (set! (-> this field) (ppointer->handle (stadium-barrier-spawn + this + (-> (the-as process-drawable (-> s4-0 0)) root trans) + (quaternion-rotate-local-x! + (new 'stack-no-clear 'quaternion) + (-> (the-as process-drawable (-> s4-0 0)) root quat) + 16384.0 + ) + s3-1 + ) + ) ) ) ) @@ -2558,12 +2558,12 @@ This commonly includes things such as: :code sleep-code ) -(defmethod run-logic? stad-force-field ((obj stad-force-field)) +(defmethod run-logic? stad-force-field ((this stad-force-field)) #t ) -(defmethod stad-force-field-method-28 stad-force-field ((obj stad-force-field)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod stad-force-field-method-28 stad-force-field ((this stad-force-field)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2598,32 +2598,32 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-force-field ((obj stad-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! stad-force-field ((this stad-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stad-force-field-method-28 obj) - (process-drawable-from-entity! obj arg0) + (stad-force-field-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-force-field" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj field) (the-as handle #f)) - (set! (-> obj ripple) (the-as handle #f)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this field) (the-as handle #f)) + (set! (-> this ripple) (the-as handle #f)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2642,25 +2642,25 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-c-force-field ((obj stad-c-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! stad-c-force-field ((this stad-c-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stad-force-field-method-28 obj) - (process-drawable-from-entity! obj arg0) + (stad-force-field-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-c-force-field" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj field) (the-as handle #f)) - (set! (-> obj ripple) (the-as handle #f)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this field) (the-as handle #f)) + (set! (-> this ripple) (the-as handle #f)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2679,25 +2679,25 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-d-force-field ((obj stad-d-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! stad-d-force-field ((this stad-d-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stad-force-field-method-28 obj) - (process-drawable-from-entity! obj arg0) + (stad-force-field-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-d-force-field" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj field) (the-as handle #f)) - (set! (-> obj ripple) (the-as handle #f)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this field) (the-as handle #f)) + (set! (-> this ripple) (the-as handle #f)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2915,14 +2915,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! brutter-balloon ((obj brutter-balloon) (arg0 entity-actor)) +(defmethod init-from-entity! brutter-balloon ((this brutter-balloon) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) @@ -2958,23 +2958,23 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-brutter-balloon" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-27 (-> obj skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-27 (-> this skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) - (setup-masks (-> obj draw) -1 0) - (setup-masks (-> obj draw) 0 2) + (setup-masks (-> this draw) -1 0) + (setup-masks (-> this draw) 0 2) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3138,45 +3138,45 @@ This commonly includes things such as: ) ) -(defmethod draw hud-samos-old ((obj hud-samos-old)) +(defmethod draw hud-samos-old ((this hud-samos-old)) (set-hud-piece-position! - (-> obj sprites 2) - (the int (+ 30.0 (* -130.0 (-> obj offset)))) - (the int (+ 130.0 (* -100.0 (-> obj offset)))) + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 130.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 5 2) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 5 2) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-samos-old ((obj hud-samos-old)) - (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-samos-old ((this hud-samos-old)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-samos-old ((obj hud-samos-old)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-center-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-samos-old ((this hud-samos-old)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 scale-x) 12.0) - (set! (-> obj sprites 0 scale-y) 11.2) - (set! (-> obj sprites 0 pos z) #xfffff2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd5a))) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.0) - (set! (-> obj sprites 3 pos z) #xffffff) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd5a))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set! (-> this sprites 3 pos z) #xffffff) 0 (none) ) diff --git a/goal_src/jak2/levels/stadium/stadium-race-obs.gc b/goal_src/jak2/levels/stadium/stadium-race-obs.gc index a6bfe770e6..efce1d1712 100644 --- a/goal_src/jak2/levels/stadium/stadium-race-obs.gc +++ b/goal_src/jak2/levels/stadium/stadium-race-obs.gc @@ -55,8 +55,8 @@ ) ) -(defmethod stdmb-race-hatch-method-21 stdmb-race-hatch ((obj stdmb-race-hatch)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod stdmb-race-hatch-method-21 stdmb-race-hatch ((this stdmb-race-hatch)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -90,42 +90,42 @@ (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod stdmb-race-hatch-method-22 stdmb-race-hatch ((obj stdmb-race-hatch)) +(defmethod stdmb-race-hatch-method-22 stdmb-race-hatch ((this stdmb-race-hatch)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stdmb-race-hatch" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw shadow-mask) (the-as uint 30)) - (set! (-> obj draw shadow-values) (the-as uint #x22220)) - (set! (-> obj tt) 0.0) - (set! (-> obj tt-target) 0.0) + (set! (-> this draw shadow-mask) (the-as uint 30)) + (set! (-> this draw shadow-values) (the-as uint #x22220)) + (set! (-> this tt) 0.0) + (set! (-> this tt-target) 0.0) (ja-channel-push! 1 0) - (let ((v1-7 (-> obj skel root-channel 0))) - (set! (-> v1-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((v1-7 (-> this skel root-channel 0))) + (set! (-> v1-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) 0 (none) ) -(defmethod init-from-entity! stdmb-race-hatch ((obj stdmb-race-hatch) (arg0 entity-actor)) +(defmethod init-from-entity! stdmb-race-hatch ((this stdmb-race-hatch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stdmb-race-hatch-method-21 obj) - (process-drawable-from-entity! obj arg0) - (stdmb-race-hatch-method-22 obj) + (stdmb-race-hatch-method-21 this) + (process-drawable-from-entity! this arg0) + (stdmb-race-hatch-method-22 this) (none) ) diff --git a/goal_src/jak2/levels/stadium/stadium-scenes.gc b/goal_src/jak2/levels/stadium/stadium-scenes.gc index 3c52db4d16..ca4f0efdaf 100644 --- a/goal_src/jak2/levels/stadium/stadium-scenes.gc +++ b/goal_src/jak2/levels/stadium/stadium-scenes.gc @@ -2206,7 +2206,8 @@ ) :load-point-obj "stadiumd-start" :end-point-obj #f - :borrow '((ctywide 1 lwidesta special) (stadiumd 0 lracedf special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((ctywide 1 lwidesta special) (stadiumd 0 lracedf special) (stadium 0 lracelit display)) :sfx-volume -1.0 :ambient-volume -1.0 :music-volume -1.0 @@ -2663,7 +2664,8 @@ ) :load-point-obj "stadiumd-start" :end-point-obj "stadium-class1-res-end-movie" - :borrow '((ctywide 1 lwidesta special) (stadiumd 0 lracedf special) (stadium 0 lracelit display)) ;; changed from ctywide + ;; og:preserve-this changed from ctywide + :borrow '((ctywide 1 lwidesta special) (stadiumd 0 lracedf special) (stadium 0 lracelit display)) :sfx-volume -1.0 :ambient-volume -1.0 :music-volume -1.0 @@ -3163,25 +3165,25 @@ ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! keira-npc ((obj keira-npc)) +(defmethod init-art! keira-npc ((this keira-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-keira-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) (none) ) -(defmethod get-art-elem keira-npc ((obj keira-npc)) +(defmethod get-art-elem keira-npc ((this keira-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor keira-stadium)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) diff --git a/goal_src/jak2/levels/strip/chaincrate.gc b/goal_src/jak2/levels/strip/chaincrate.gc index 4b38dc85da..cf54c6aa39 100644 --- a/goal_src/jak2/levels/strip/chaincrate.gc +++ b/goal_src/jak2/levels/strip/chaincrate.gc @@ -113,17 +113,17 @@ ) ;; WARN: Return type mismatch rgbaf vs none. -(defmethod strip-chain-crate-slave-method-22 strip-chain-crate-slave ((obj strip-chain-crate-slave)) - (let ((f0-0 (-> obj path-u))) +(defmethod strip-chain-crate-slave-method-22 strip-chain-crate-slave ((this strip-chain-crate-slave)) + (let ((f0-0 (-> this path-u))) (cond ((>= 0.09 f0-0) (let ((f0-1 (* 11.111111 f0-0))) - (set-vector! (-> obj draw color-mult) f0-1 f0-1 f0-1 1.0) + (set-vector! (-> this draw color-mult) f0-1 f0-1 f0-1 1.0) ) ) ((>= f0-0 0.87) (let ((f0-5 (- 1.0 (* 7.692308 (+ -0.87 f0-0))))) - (set-vector! (-> obj draw color-mult) f0-5 f0-5 f0-5 1.0) + (set-vector! (-> this draw color-mult) f0-5 f0-5 f0-5 1.0) ) ) ) @@ -245,20 +245,20 @@ (none) ) -(defmethod deactivate strip-chain-crate-slave ((obj strip-chain-crate-slave)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate strip-chain-crate-slave ((this strip-chain-crate-slave)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs strip-chain-crate-slave. -(defmethod relocate strip-chain-crate-slave ((obj strip-chain-crate-slave) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate strip-chain-crate-slave ((this strip-chain-crate-slave) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as strip-chain-crate-slave ((method-of-type process-drawable relocate) obj arg0)) + (the-as strip-chain-crate-slave ((method-of-type process-drawable relocate) this arg0)) ) (deftype strip-chain-crate (process-drawable) @@ -281,23 +281,23 @@ ;; WARN: Return type mismatch symbol vs none. -(defmethod strip-chain-crate-method-21 strip-chain-crate ((obj strip-chain-crate)) - (let ((f30-0 (total-distance (-> obj path))) +(defmethod strip-chain-crate-method-21 strip-chain-crate ((this strip-chain-crate)) + (let ((f30-0 (total-distance (-> this path))) (f28-0 (* (/ (the float - (mod (the-as uint (+ (current-time) (the-as time-frame (-> obj spawn-offset)))) (-> obj spawn-delay)) + (mod (the-as uint (+ (current-time) (the-as time-frame (-> this spawn-offset)))) (-> this spawn-delay)) ) - (the float (-> obj spawn-delay)) + (the float (-> this spawn-delay)) ) - (-> obj dist-apart) + (-> this dist-apart) ) ) ) (while (>= f30-0 f28-0) (let ((f26-0 (/ f28-0 f30-0))) - (process-spawn strip-chain-crate-slave f26-0 (-> obj crate-speed) :to obj) + (process-spawn strip-chain-crate-slave f26-0 (-> this crate-speed) :to this) ) - (+! f28-0 (-> obj dist-apart)) + (+! f28-0 (-> this dist-apart)) ) ) (none) @@ -318,7 +318,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! strip-chain-crate ((obj strip-chain-crate) (arg0 entity-actor)) +(defmethod init-from-entity! strip-chain-crate ((this strip-chain-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -326,9 +326,9 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 int)) - (set! (-> obj root) (new 'process 'trsqv)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((f28-0 53248.0) (f26-0 131072.0) (f30-0 0.0) @@ -341,23 +341,23 @@ This commonly includes things such as: (set! f30-0 (-> v1-8 2)) ) ) - (set! (-> obj crate-speed) f28-0) - (set! (-> obj dist-apart) f26-0) - (set! (-> obj spawn-delay) (the-as uint (the int (* 300.0 (/ f26-0 f28-0))))) - (set! (-> obj spawn-offset) (the-as uint (the int (* f30-0 (the float (-> obj spawn-delay)))))) + (set! (-> this crate-speed) f28-0) + (set! (-> this dist-apart) f26-0) + (set! (-> this spawn-delay) (the-as uint (the int (* 300.0 (/ f26-0 f28-0))))) + (set! (-> this spawn-offset) (the-as uint (the int (* f30-0 (the float (-> this spawn-delay)))))) ) - (set! (-> obj next-spawn-time) + (set! (-> this next-spawn-time) (+ (current-time) (the-as time-frame - (- (-> obj spawn-delay) - (mod (the-as uint (+ (current-time) (the-as time-frame (-> obj spawn-offset)))) (-> obj spawn-delay)) + (- (-> this spawn-delay) + (mod (the-as uint (+ (current-time) (the-as time-frame (-> this spawn-offset)))) (-> this spawn-delay)) ) ) ) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (strip-chain-crate-method-21 obj) - (go (method-of-object obj idle)) + (logclear! (-> this mask) (process-mask actor-pause)) + (strip-chain-crate-method-21 this) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/strip/strip-drop.gc b/goal_src/jak2/levels/strip/strip-drop.gc index 473198280d..1002f65cb6 100644 --- a/goal_src/jak2/levels/strip/strip-drop.gc +++ b/goal_src/jak2/levels/strip/strip-drop.gc @@ -253,12 +253,12 @@ ) ;; WARN: Return type mismatch vector vs none. -(defmethod strip-game-crate-method-22 strip-game-crate ((obj strip-game-crate) (arg0 vector) (arg1 quaternion)) - (set! (-> obj root trans quad) (-> arg0 quad)) +(defmethod strip-game-crate-method-22 strip-game-crate ((this strip-game-crate) (arg0 vector) (arg1 quaternion)) + (set! (-> this root trans quad) (-> arg0 quad)) (let ((s4-0 (new 'stack-no-clear 'quaternion))) - (quaternion-rotate-z! s4-0 arg1 (-> obj swing-angle z)) - (quaternion-rotate-x! s4-0 s4-0 (-> obj swing-angle x)) - (quaternion-copy! (-> obj root quat) s4-0) + (quaternion-rotate-z! s4-0 arg1 (-> this swing-angle z)) + (quaternion-rotate-x! s4-0 s4-0 (-> this swing-angle x)) + (quaternion-copy! (-> this root quat) s4-0) ) (none) ) @@ -323,11 +323,11 @@ ) -(defmethod deactivate crane ((obj crane)) - (if (-> obj crate) - (deactivate (-> obj crate 0)) +(defmethod deactivate crane ((this crane)) + (if (-> this crate) + (deactivate (-> this crate 0)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -414,31 +414,31 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! crane ((obj crane) (arg0 entity-actor)) +(defmethod init-from-entity! crane ((this crane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crane" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) 910.2222) - (quaternion-copy! (-> obj final-quat) (-> obj root quat)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj draw light-index) (the-as uint 10)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) 910.2222) + (quaternion-copy! (-> this final-quat) (-> this root quat)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 10)) (ja-post) - (let ((s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 4)))) - (set! (-> obj crate) (process-spawn strip-game-crate s5-2 (-> obj root quat) :to obj)) + (let ((s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4)))) + (set! (-> this crate) (process-spawn strip-game-crate s5-2 (-> this root quat) :to this)) ) (if (or (task-complete? *game-info* (game-task strip-rescue)) (demo?)) - (go (method-of-object obj final-position)) - (go (method-of-object obj idle)) + (go (method-of-object this final-position)) + (go (method-of-object this idle)) ) (none) ) @@ -491,14 +491,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cranecrate ((obj cranecrate) (arg0 entity-actor)) +(defmethod init-from-entity! cranecrate ((this cranecrate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -513,15 +513,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cranecrate" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (+! (-> obj root trans y) -163348.48) + (+! (-> this root trans y) -163348.48) (when (or (demo?) (and (= *kernel-boot-message* 'kiosk) (task-node-open? (game-task-node strip-drop-resolution)))) (let ((s5-2 (new 'stack-no-clear 'task-arrow-params))) (set! (-> s5-2 pos quad) (-> (new 'static 'vector :x 9920120.0 :y 288036.03 :z -179639.1 :w 1.0) quad)) @@ -531,12 +531,12 @@ This commonly includes things such as: ) (set! (-> s5-2 flags) (task-arrow-flags task-arrow-flag-02)) (set! (-> s5-2 map-icon) (the-as uint 15)) - (task-arrow-spawn s5-2 obj) + (task-arrow-spawn s5-2 this) ) ) (if (task-node-closed? (game-task-node strip-drop-resolution)) - (go (method-of-object obj idle)) - (go (method-of-object obj hidden)) + (go (method-of-object this idle)) + (go (method-of-object this hidden)) ) (none) ) @@ -661,7 +661,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! grunt-egg ((obj grunt-egg) (arg0 entity-actor)) +(defmethod init-from-entity! grunt-egg ((this grunt-egg) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -670,7 +670,7 @@ This commonly includes things such as: - sounds" (cond ((>= (res-lump-value arg0 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list)) @@ -685,34 +685,34 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-7 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-7 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) ) (else - (set! (-> obj root) (new 'process 'trsqv)) + (set! (-> this root) (new 'process 'trsqv)) ) ) - (grunt-egg-method-22 obj) - (process-drawable-from-entity! obj arg0) + (grunt-egg-method-22 this) + (process-drawable-from-entity! this arg0) (let* ((v1-12 *game-info*) (a0-14 (+ (-> v1-12 attack-id) 1)) ) (set! (-> v1-12 attack-id) a0-14) - (set! (-> obj attack-id) a0-14) + (set! (-> this attack-id) a0-14) ) - (let ((a1-8 (grunt-egg-method-23 obj))) + (let ((a1-8 (grunt-egg-method-23 this))) (if a1-8 - (idle-control-method-9 (-> obj idle-anim-player) (the-as (pointer idle-control-frame) a1-8)) + (idle-control-method-9 (-> this idle-anim-player) (the-as (pointer idle-control-frame) a1-8)) ) ) (if (>= (res-lump-value arg0 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "grunt-eggs" :fo-min 5 :fo-max 45) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "grunt-eggs" :fo-min 5 :fo-max 45) (-> this root trans)) ) ) (if (task-complete? *game-info* (game-task strip-drop)) - (go (method-of-object obj die)) - (go (method-of-object obj idle)) + (go (method-of-object this die)) + (go (method-of-object this idle)) ) (none) ) @@ -754,61 +754,61 @@ This commonly includes things such as: ;; WARN: Return type mismatch draw-control vs none. -(defmethod grunt-egg-method-22 grunt-egg-a ((obj grunt-egg-a)) +(defmethod grunt-egg-method-22 grunt-egg-a ((this grunt-egg-a)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) (none) ) -(defmethod grunt-egg-method-23 grunt-egg-a ((obj grunt-egg-a)) +(defmethod grunt-egg-method-23 grunt-egg-a ((this grunt-egg-a)) *grunt-egg-a-script* ) ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-b ((obj grunt-egg-b)) +(defmethod grunt-egg-method-22 grunt-egg-b ((this grunt-egg-b)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (add-connection *part-engine* obj 9 obj 1035 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 14 obj 1035 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 9 this 1035 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 14 this 1035 (new 'static 'vector :w 163840.0)) (none) ) -(defmethod grunt-egg-method-23 grunt-egg-b ((obj grunt-egg-b)) +(defmethod grunt-egg-method-23 grunt-egg-b ((this grunt-egg-b)) *grunt-egg-b-script* ) ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-c ((obj grunt-egg-c)) +(defmethod grunt-egg-method-22 grunt-egg-c ((this grunt-egg-c)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-c" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (add-connection *part-engine* obj 7 obj 1036 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 7 this 1036 (new 'static 'vector :w 163840.0)) (none) ) -(defmethod grunt-egg-method-23 grunt-egg-c ((obj grunt-egg-c)) +(defmethod grunt-egg-method-23 grunt-egg-c ((this grunt-egg-c)) *grunt-egg-c-script* ) ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-d ((obj grunt-egg-d)) +(defmethod grunt-egg-method-22 grunt-egg-d ((this grunt-egg-d)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-d" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (add-connection *part-engine* obj 10 obj 1037 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 10 this 1037 (new 'static 'vector :w 163840.0)) (none) ) -(defmethod grunt-egg-method-23 grunt-egg-d ((obj grunt-egg-d)) +(defmethod grunt-egg-method-23 grunt-egg-d ((this grunt-egg-d)) *grunt-egg-d-script* ) diff --git a/goal_src/jak2/levels/strip/strip-obs.gc b/goal_src/jak2/levels/strip/strip-obs.gc index d54e05dd72..df3cf48529 100644 --- a/goal_src/jak2/levels/strip/strip-obs.gc +++ b/goal_src/jak2/levels/strip/strip-obs.gc @@ -7,39 +7,39 @@ ;; DECOMP BEGINS -(defmethod draw hud-plasmite ((obj hud-plasmite)) +(defmethod draw hud-plasmite ((this hud-plasmite)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 210 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -16 20) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 20) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-plasmite ((obj hud-plasmite)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-plasmite ((this hud-plasmite)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-plasmite ((obj hud-plasmite)) - (set! (-> obj level) (level-get *level* 'strip)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-plasmite ((this hud-plasmite)) + (set! (-> this level) (level-get *level* 'strip)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb26))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb26))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -109,7 +109,7 @@ ;; WARN: Return type mismatch symbol vs none. (defbehavior strip-trans strip-hazard () (when (and (nonzero? (-> self no-collision-timer)) - (>= (- (current-time) (the-as int (-> self no-collision-timer))) (seconds 0.3)) + (time-elapsed? (the-as int (-> self no-collision-timer)) (seconds 0.3)) ) (let ((v1-7 (-> self root root-prim))) (set! (-> v1-7 prim-core collide-as) (-> self root backup-collide-as)) @@ -150,7 +150,7 @@ :post transform-post ) -(defmethod init-from-entity! strip-hazard ((obj strip-hazard) (arg0 entity-actor)) +(defmethod init-from-entity! strip-hazard ((this strip-hazard) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -158,13 +158,13 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-64 res-tag)) - (set-vector! (-> obj shove-vec) 0.0 12288.0 24576.0 1.0) - (set! (-> obj no-collision-timer) (the-as uint 0)) + (set-vector! (-> this shove-vec) 0.0 12288.0 24576.0 1.0) + (set! (-> this no-collision-timer) (the-as uint 0)) (let* ((v1-1 *game-info*) (a0-5 (+ (-> v1-1 attack-id) 1)) ) (set! (-> v1-1 attack-id) a0-5) - (set! (-> obj attack-id) a0-5) + (set! (-> this attack-id) a0-5) ) (let ((s4-0 (new 'stack-no-clear 'sync-info-params)) (s3-0 1200) @@ -187,8 +187,8 @@ This commonly includes things such as: (set! (-> s4-0 entity) arg0) (set! (-> s4-0 period) (the-as uint s3-0)) (set! (-> s4-0 percent) 0.0) - (initialize! (-> obj sync) s4-0) - (sync-now! (-> obj sync) f30-0) + (initialize! (-> this sync) s4-0) + (sync-now! (-> this sync) f30-0) ) (none) ) @@ -235,7 +235,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fencespikes ((obj fencespikes) (arg0 entity-actor)) +(defmethod init-from-entity! fencespikes ((this fencespikes) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -243,7 +243,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 string)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -275,30 +275,30 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-19 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fencespikes" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-9 (method-of-type strip-hazard init-from-entity!))) - (t9-9 obj arg0) + (t9-9 this arg0) ) - (quaternion-copy! (-> obj start-quat) (-> obj root quat)) + (quaternion-copy! (-> this start-quat) (-> this root quat)) (set! sv-16 "#f") (let ((a0-24 (entity-lookup-part-group arg0 (& sv-16) 'art-name))) (when a0-24 (let ((a0-25 (-> a0-24 0))) (if (and (nonzero? a0-25) (= (-> a0-25 type) sparticle-launch-group)) - (set! (-> obj part) (create-launch-control a0-25 obj)) + (set! (-> this part) (create-launch-control a0-25 this)) ) ) ) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj idle)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) (none) ) @@ -366,25 +366,25 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch strip-hazard vs pitspikes. -(defmethod relocate pitspikes ((obj pitspikes) (arg0 int)) - (if (nonzero? (-> obj spinner)) - (&+! (-> obj spinner) arg0) +(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)) obj arg0) + ((the-as (function strip-hazard int strip-hazard) (find-parent-method pitspikes 7)) this arg0) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pitspikes ((obj pitspikes) (arg0 entity-actor)) +(defmethod init-from-entity! pitspikes ((this pitspikes) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -403,28 +403,28 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pitspikes" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-6 (method-of-type strip-hazard init-from-entity!))) - (t9-6 obj arg0) + (t9-6 this arg0) ) - (set! (-> obj spinner) (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :x 1.0 :w 1.0) 262144.0)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (static-sound-spec "pit-spikes" :fo-max 55) - (vector<-cspace! (new 'static 'vector) (-> obj node-list data 4)) - ) + (set! (-> this spinner) (new 'process 'joint-mod-spinner this 4 (new 'static 'vector :x 1.0 :w 1.0) 262144.0)) + (set! (-> this sound) (new + 'process + 'ambient-sound + (static-sound-spec "pit-spikes" :fo-max 55) + (vector<-cspace! (new 'static 'vector) (-> this node-list data 4)) + ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 214) obj)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 214) this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) (none) ) @@ -475,14 +475,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! curtainsaw ((obj curtainsaw) (arg0 entity-actor)) +(defmethod init-from-entity! curtainsaw ((this curtainsaw) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -501,27 +501,27 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-curtainsaw" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-6 (method-of-type strip-hazard init-from-entity!))) - (t9-6 obj arg0) + (t9-6 this arg0) ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (static-sound-spec "curtainsaw" :fo-max 55) - (vector<-cspace! (new 'static 'vector) (-> obj node-list data 3)) - ) + (set! (-> this sound) (new + 'process + 'ambient-sound + (static-sound-spec "curtainsaw" :fo-max 55) + (vector<-cspace! (new 'static 'vector) (-> this node-list data 3)) + ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 213) obj)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 213) this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) (none) ) @@ -551,30 +551,30 @@ This commonly includes things such as: ;; WARN: Return type mismatch process-drawable vs grenade-point. -(defmethod relocate grenade-point ((obj grenade-point) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate grenade-point ((this grenade-point) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj part3)) - (&+! (-> obj part3) arg0) + (if (nonzero? (-> this part3)) + (&+! (-> this part3) arg0) ) - (if (nonzero? (-> obj part-lightning-hit)) - (&+! (-> obj part-lightning-hit) arg0) + (if (nonzero? (-> this part-lightning-hit)) + (&+! (-> this part-lightning-hit) arg0) ) - (the-as grenade-point ((method-of-type process-drawable relocate) obj arg0)) + (the-as grenade-point ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate grenade-point ((obj grenade-point)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate grenade-point ((this grenade-point)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj part3)) - (kill-and-free-particles (-> obj part3)) + (if (nonzero? (-> this part3)) + (kill-and-free-particles (-> this part3)) ) - (if (nonzero? (-> obj part-lightning-hit)) - (kill-and-free-particles (-> obj part-lightning-hit)) + (if (nonzero? (-> this part-lightning-hit)) + (kill-and-free-particles (-> this part-lightning-hit)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -750,11 +750,11 @@ This commonly includes things such as: (set-setting! 'entity-name (-> self camera-name) 0.0 -1) ) ) - ((>= (- (current-time) (-> self enter-time)) (seconds 3)) + ((time-elapsed? (-> self enter-time) (seconds 3)) (talker-speech-class-method-12 (-> *talker-speech* 194) 1) ) ) - (set! (-> self enter-time) (current-time)) + (set-time! (-> self enter-time)) ) #f ) @@ -859,23 +859,23 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! grenade-point ((obj grenade-point) (arg0 entity-actor)) +(defmethod init-from-entity! grenade-point ((this grenade-point) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj parented?) #f) - (when (not (-> obj parented?)) + (set! (-> this parented?) #f) + (when (not (-> this parented?)) (let ((a1-1 (handle->process (-> *game-info* controller 0)))) (when a1-1 - (change-parent obj a1-1) - (set! (-> obj parented?) #t) + (change-parent this a1-1) + (set! (-> this parented?) #t) ) ) ) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-10 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-10 prim-core collide-as) (collide-spec backgnd obstacle)) (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 81920.0) @@ -887,32 +887,32 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj camera-name) (res-lump-struct (-> obj entity) 'camera-name string)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 215) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 216) obj)) - (set! (-> obj part3) (create-launch-control (-> *part-group-id-table* 217) obj)) - (set! (-> obj part-lightning-hit) (create-launch-control (-> *part-group-id-table* 218) obj)) - (set! (-> obj lightning-time) 0) - (set! (-> obj strike-table) + (process-drawable-from-entity! this arg0) + (set! (-> this camera-name) (res-lump-struct (-> this entity) 'camera-name string)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 215) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 216) this)) + (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 217) this)) + (set! (-> this part-lightning-hit) (create-launch-control (-> *part-group-id-table* 218) this)) + (set! (-> this lightning-time) 0) + (set! (-> this strike-table) (-> *grenade-point-strike-table* - (+ (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 1) :time -1000000000.0) -1) + (+ (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 1) :time -1000000000.0) -1) ) ) - (set! (-> obj last-strike-index) (rand-vu-int-range 0 19)) - (set! (-> obj speed) (res-lump-float (-> obj entity) 'speed :default 118784.0)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "eco-plume1" :fo-min 5 :fo-max 90) (-> obj root trans)) + (set! (-> this last-strike-index) (rand-vu-int-range 0 19)) + (set! (-> this speed) (res-lump-float (-> this entity) 'speed :default 118784.0)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "eco-plume1" :fo-min 5 :fo-max 90) (-> this root trans)) ) - (update-transforms (-> obj root)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (if (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (update-transforms (-> this root)) + (logclear! (-> this mask) (process-mask actor-pause)) + (if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (task-complete? *game-info* (game-task strip-grenade)) ) - (go (method-of-object obj die) #f) - (go (method-of-object obj idle)) + (go (method-of-object this die) #f) + (go (method-of-object this idle)) ) (none) ) @@ -1104,7 +1104,7 @@ This commonly includes things such as: ) ) -(defmethod draw-laser-sight grenade ((obj grenade)) +(defmethod draw-laser-sight grenade ((this grenade)) "TODO - confirm If applicable, draw the laser sight particles" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -1126,7 +1126,7 @@ This commonly includes things such as: (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -1145,15 +1145,15 @@ This commonly includes things such as: (none) ) -(defmethod spawn-impact-particles grenade ((obj grenade)) +(defmethod spawn-impact-particles grenade ((this grenade)) "Spawns associated particles with the projectile if applicable" - ((method-of-type projectile spawn-impact-particles) obj) + ((method-of-type projectile spawn-impact-particles) this) (ja-post) 0 (none) ) -(defmethod spawn-shell-particles grenade ((obj grenade)) +(defmethod spawn-shell-particles grenade ((this grenade)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -1175,7 +1175,7 @@ This commonly includes things such as: (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -1194,7 +1194,7 @@ This commonly includes things such as: (none) ) -(defmethod play-impact-sound grenade ((obj grenade) (arg0 projectile-options)) +(defmethod play-impact-sound grenade ((this grenade) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -1254,7 +1254,7 @@ This commonly includes things such as: (t9-0) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (send-event (handle->process (-> self end-target)) 'die) (remove-setting! 'point-of-interest) ) @@ -1292,40 +1292,40 @@ This commonly includes things such as: ) ) -(defmethod grenade-method-40 grenade ((obj grenade)) - (let ((s5-0 (the-as process-drawable (-> obj end-target process 0)))) +(defmethod grenade-method-40 grenade ((this grenade)) + (let ((s5-0 (the-as process-drawable (-> this end-target process 0)))) (when s5-0 - (set! (-> obj root transv x) (* 4.0 (- (-> s5-0 root trans x) (-> obj root trans x)))) - (set! (-> obj root transv z) (* 4.0 (- (-> s5-0 root trans z) (-> obj root trans z)))) - (let ((v1-12 (-> obj root transv))) + (set! (-> this root transv x) (* 4.0 (- (-> s5-0 root trans x) (-> this root trans x)))) + (set! (-> this root transv z) (* 4.0 (- (-> s5-0 root trans z) (-> this root trans z)))) + (let ((v1-12 (-> this root transv))) (if (< (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) 16384.0) - (vector-xz-normalize! (-> obj root transv) 16384.0) + (vector-xz-normalize! (-> this root transv) 16384.0) ) ) - (if (or (logtest? (-> obj root status) (collide-status on-surface on-ground)) - (< (vector-vector-distance (-> s5-0 root trans) (-> obj root trans)) 4096.0) + (if (or (logtest? (-> this root status) (collide-status on-surface on-ground)) + (< (vector-vector-distance (-> s5-0 root trans) (-> this root trans)) 4096.0) ) - (go (method-of-object obj impact)) + (go (method-of-object this impact)) ) ) ) - (vector-v++! (-> obj root transv) (compute-acc-due-to-gravity (-> obj root) (new-stack-vector0) 1.0)) + (vector-v++! (-> this root transv) (compute-acc-due-to-gravity (-> this root) (new-stack-vector0) 1.0)) 0 (none) ) -(defmethod grenade-method-41 grenade ((obj grenade)) - (quaternion*! (-> obj root quat) (-> obj root quat) (-> obj tumble-quat)) - (projectile-move-fill-all-dirs obj) - (set-setting! 'point-of-interest 'abs (-> obj root trans) 0) +(defmethod grenade-method-41 grenade ((this grenade)) + (quaternion*! (-> this root quat) (-> this root quat) (-> this tumble-quat)) + (projectile-move-fill-all-dirs this) + (set-setting! 'point-of-interest 'abs (-> this root trans) 0) 0 (none) ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-proj-collision! grenade ((obj grenade)) +(defmethod init-proj-collision! grenade ((this grenade)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-projectile) (set! (-> s5-0 no-reaction) @@ -1349,48 +1349,48 @@ This commonly includes things such as: ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) -(defmethod init-proj-settings! grenade ((obj grenade)) +(defmethod init-proj-settings! grenade ((this grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (with-pp (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grenade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj options) (projectile-options proj-options-4)) - (vector-normalize! (-> obj root transv) 1.0) - (+! (-> obj root transv y) 1.0) - (vector-normalize! (-> obj root transv) 184320.0) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj blast-radius) 20480.0) - (set! (-> obj max-speed) 184320.0) - (set! (-> obj timeout) (seconds 3.6)) - (set! (-> obj update-velocity) (method-of-object obj grenade-method-40)) - (set! (-> obj move) (method-of-object obj grenade-method-41)) - (set! (-> obj root dynam gravity y) 327680.0) - (set! (-> obj root dynam gravity-length) 327680.0) - (set! (-> obj root dynam gravity-max) 327680.0) + (logclear! (-> this options) (projectile-options proj-options-4)) + (vector-normalize! (-> this root transv) 1.0) + (+! (-> this root transv y) 1.0) + (vector-normalize! (-> this root transv) 184320.0) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this blast-radius) 20480.0) + (set! (-> this max-speed) 184320.0) + (set! (-> this timeout) (seconds 3.6)) + (set! (-> this update-velocity) (method-of-object this grenade-method-40)) + (set! (-> this move) (method-of-object this grenade-method-41)) + (set! (-> this root dynam gravity y) 327680.0) + (set! (-> this root dynam gravity-length) 327680.0) + (set! (-> this root dynam gravity-max) 327680.0) (let ((f0-7 1092.2667)) - (quaternion-axis-angle! (-> obj tumble-quat) 1.0 0.0 0.0 f0-7) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-7) ) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) (process->ppointer pp)) (set! (-> a1-5 num-params) 0) (set! (-> a1-5 message) 'target) - (let ((s5-1 (send-event-function (ppointer->process (-> obj parent)) a1-5))) - (set! (-> obj end-target) (process->handle (if (type? s5-1 process-drawable) - (the-as process-drawable s5-1) - ) - ) + (let ((s5-1 (send-event-function (ppointer->process (-> this parent)) a1-5))) + (set! (-> this end-target) (process->handle (if (type? s5-1 process-drawable) + (the-as process-drawable s5-1) + ) + ) ) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 235) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 235) this)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (none) ) @@ -1451,11 +1451,11 @@ This commonly includes things such as: (lambda :behavior task-manager () (local-vars (sv-16 object)) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self total-time) (seconds 120)) (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-plasmite :init hud-init-by-other :to self))) - (while (or (< (- (current-time) (-> self start-time)) (-> self total-time)) + (while (or (not (time-elapsed? (-> self start-time) (-> self total-time))) (and *target* (focus-test? *target* in-air)) ) (let ((v1-18 (the-as int (- (-> self total-time) (- (current-time) (-> self start-time)))))) @@ -1511,7 +1511,7 @@ This commonly includes things such as: (talker-spawn-func (-> *talker-speech* 195) *entity-pool* (target-pos 0) (the-as region #f)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> *game-info* counter) (the float (the-as int sv-16))) (if (>= 1 (the-as int sv-16)) (gui-control-method-12 @@ -1559,18 +1559,18 @@ This commonly includes things such as: ;; WARN: Return type mismatch process-drawable vs drill-plat. -(defmethod relocate drill-plat ((obj drill-plat) (arg0 int)) - (if (nonzero? (-> obj plat-sound)) - (&+! (-> obj plat-sound) arg0) +(defmethod relocate drill-plat ((this drill-plat) (arg0 int)) + (if (nonzero? (-> this plat-sound)) + (&+! (-> this plat-sound) arg0) ) - (the-as drill-plat ((method-of-type process-drawable relocate) obj arg0)) + (the-as drill-plat ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate drill-plat ((obj drill-plat)) - (if (nonzero? (-> obj plat-sound)) - (stop! (-> obj plat-sound)) +(defmethod deactivate drill-plat ((this drill-plat)) + (if (nonzero? (-> this plat-sound)) + (stop! (-> this plat-sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -1635,14 +1635,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-plat ((obj drill-plat) (arg0 entity-actor)) +(defmethod init-from-entity! drill-plat ((this drill-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1684,32 +1684,32 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-10 (method-of-type strip-hazard init-from-entity!))) - (t9-10 obj arg0) + (t9-10 this arg0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((a3-5 (new 'stack-no-clear 'vector))) - (set! (-> a3-5 quad) (-> obj root trans quad)) + (set! (-> a3-5 quad) (-> this root trans quad)) (+! (-> a3-5 x) 57344.0) - (set! (-> obj sound) (new 'process 'ambient-sound (static-sound-spec "drill-plat-a" :fo-max 90) a3-5)) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "drill-plat-a" :fo-max 90) a3-5)) ) (ja-post) - (set! (-> obj plat-sound) (new - 'process - 'ambient-sound - (static-sound-spec "drill-plat-b" :fo-max 50) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7)) - ) + (set! (-> this plat-sound) (new + 'process + 'ambient-sound + (static-sound-spec "drill-plat-b" :fo-max 50) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7)) + ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/strip/strip-rescue.gc b/goal_src/jak2/levels/strip/strip-rescue.gc index c888bc43f2..ff7e31a3aa 100644 --- a/goal_src/jak2/levels/strip/strip-rescue.gc +++ b/goal_src/jak2/levels/strip/strip-rescue.gc @@ -51,14 +51,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cntrlrm-door ((obj cntrlrm-door) (arg0 entity-actor)) +(defmethod init-from-entity! cntrlrm-door ((this cntrlrm-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -94,17 +94,17 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cntrlrm-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (if (task-node-closed? (game-task-node strip-rescue-resolution)) - (go (method-of-object obj opened)) - (go (method-of-object obj idle)) + (go (method-of-object this opened)) + (go (method-of-object this idle)) ) (none) ) @@ -140,14 +140,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cntrlrm-button ((obj cntrlrm-button) (arg0 entity-actor)) +(defmethod init-from-entity! cntrlrm-button ((this cntrlrm-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -176,14 +176,14 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cntrlrm-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/title/title-obs.gc b/goal_src/jak2/levels/title/title-obs.gc index 9813b3c83a..3c109110bc 100644 --- a/goal_src/jak2/levels/title/title-obs.gc +++ b/goal_src/jak2/levels/title/title-obs.gc @@ -39,23 +39,23 @@ ;; WARN: Return type mismatch process vs title-control. -(defmethod relocate title-control ((obj title-control) (arg0 int)) +(defmethod relocate title-control ((this title-control) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj buffer v1-0)) - (&+! (-> obj buffer v1-0) arg0) + (if (nonzero? (-> this buffer v1-0)) + (&+! (-> this buffer v1-0) arg0) ) ) - (the-as title-control ((method-of-type process relocate) obj arg0)) + (the-as title-control ((method-of-type process relocate) this arg0)) ) -(defmethod deactivate title-control ((obj title-control)) +(defmethod deactivate title-control ((this title-control)) (dotimes (s5-0 2) - (set-pending-file (-> obj buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) + (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) (dotimes (s5-1 2) - (update (-> obj buffer s5-1)) + (update (-> this buffer s5-1)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -481,7 +481,7 @@ (let ((s3-0 (current-time)) (s4-0 #f) ) - (while (not (or (>= (- (current-time) s3-0) arg1) (and (>= (- (current-time) s3-0) arg0) s4-0))) + (while (not (or (time-elapsed? s3-0 arg1) (and (time-elapsed? s3-0 arg0) s4-0))) (if (cpad-pressed? 0 confirm) (set! s4-0 #t) ) @@ -560,7 +560,7 @@ (defun title-fade-out ((arg0 float)) (setup *screen-filter* (new 'static 'vector) (new 'static 'vector :w 128.0) arg0 (bucket-id screen-filter)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.4)) + (until (time-elapsed? gp-0 (seconds 0.4)) (suspend) ) ) diff --git a/goal_src/jak2/levels/tomb/monster-frog.gc b/goal_src/jak2/levels/tomb/monster-frog.gc index f50946b87b..675f66a8a9 100644 --- a/goal_src/jak2/levels/tomb/monster-frog.gc +++ b/goal_src/jak2/levels/tomb/monster-frog.gc @@ -467,7 +467,7 @@ (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (nav-enemy-method-163 self) (go-stare2 self) ) @@ -637,7 +637,7 @@ :virtual #t :event enemy-event-handler :enter (behavior ((arg0 vector)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -748,58 +748,58 @@ :post nav-enemy-simple-post ) -(defmethod enemy-method-77 monster-frog ((obj monster-frog) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 monster-frog ((this monster-frog) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 0) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 26))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 26))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 26)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 26)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 26)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 26)) num-func-seek!) ) #t ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 0) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) (-> arg0 0)) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) (else (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-0)) (ja-channel-push! 1 0) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 30))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 30)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 30)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) (-> arg0 0)) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 30)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 30)) num-func-seek!) ) ) (else (ja-channel-push! 1 0) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 32))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 32))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 32)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 32)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) (-> arg0 0)) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 32)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 32)) num-func-seek!) ) ) ) @@ -808,58 +808,58 @@ ) ) -(defmethod enemy-method-78 monster-frog ((obj monster-frog) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 monster-frog ((this monster-frog) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 27))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 27))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 27)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 27)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!) ) #t ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) (-> arg0 0)) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) #t ) (else (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-0)) (ja-channel-push! 1 0) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 31))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 31))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 31)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 31)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) (-> arg0 0)) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 31)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 31)) num-func-seek!) ) ) (else (ja-channel-push! 1 0) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 33))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 33)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) (-> arg0 0)) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 33)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) ) ) ) @@ -868,19 +868,19 @@ ) ) -(defmethod track-target! monster-frog ((obj monster-frog)) +(defmethod track-target! monster-frog ((this monster-frog)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (water-control-method-10 (-> obj water)) - ((method-of-type nav-enemy track-target!) obj) + (water-control-method-10 (-> this water)) + ((method-of-type nav-enemy track-target!) this) (none) ) -(defmethod init-enemy-collision! monster-frog ((obj monster-frog)) +(defmethod init-enemy-collision! monster-frog ((this monster-frog)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -935,27 +935,27 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! monster-frog ((obj monster-frog)) +(defmethod init-enemy! monster-frog ((this monster-frog)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-monster-frog" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *monster-frog-nav-enemy-info*) - (set! (-> obj water) (new 'process 'water-control obj 5 0.0 8192.0 2048.0)) - (set! (-> obj water flags) + (init-enemy-behaviour-and-stats! this *monster-frog-nav-enemy-info*) + (set! (-> this water) (new 'process 'water-control this 5 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags active use-water-anim touch-water part-splash part-drip part-rings part-water find-water) ) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 12288.0) - (set! (-> obj water wake-size) 6144.0) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 12288.0) + (set! (-> this water wake-size) 6144.0) 0 (none) ) diff --git a/goal_src/jak2/levels/tomb/target-indax.gc b/goal_src/jak2/levels/tomb/target-indax.gc index e53436ea62..44ac76535a 100644 --- a/goal_src/jak2/levels/tomb/target-indax.gc +++ b/goal_src/jak2/levels/tomb/target-indax.gc @@ -277,7 +277,7 @@ (set! (-> self control bend-target) 0.0) (target-collide-set! 'indax 0.0) (set! (-> self fact health) (-> self fact health-max)) - (set! (-> self indax indax-start-time) (current-time)) + (set-time! (-> self indax indax-start-time)) (set! (-> self indax art-group-backup) (-> self draw art-group)) (set! (-> self draw art-group) (-> self sidekick 0 draw art-group)) (logior! (-> self draw status) (draw-control-status no-draw-bounds2)) @@ -564,7 +564,7 @@ (defstate target-indax-walk (target) :event target-indax-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *indax-walk-mods*) ) :exit (behavior () @@ -669,12 +669,12 @@ (suspend) (let ((f26-1 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 16384.0 32768.0))) (cond - ((>= (- (current-time) gp-0) (seconds 5)) + ((time-elapsed? gp-0 (seconds 5)) (set! gp-0 (current-time)) ) - ((>= (- (current-time) gp-0) (seconds 2.5)) + ((time-elapsed? gp-0 (seconds 2.5)) ) - ((>= (- (current-time) gp-0) (seconds 1)) + ((time-elapsed? gp-0 (seconds 1)) (set! f28-0 (seek f28-0 1.0 (* 2.0 (seconds-per-frame)))) ) (else @@ -863,7 +863,7 @@ (defstate target-indax-double-jump (target) :event target-indax-jump-event-handler :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (if (!= (-> self control mod-surface) *slide-jump-mods*) @@ -983,7 +983,7 @@ (defstate target-indax-trip (target) :event target-indax-jump-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 70) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) ) @@ -1130,13 +1130,11 @@ (cond ((and (>= (ja-aframe-num 0) 20.0) (and (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) - (>= (- (current-time) (-> self control sliding-start-time)) (seconds 0.04)) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) ) ) (go target-indax-falling #f) @@ -1146,12 +1144,12 @@ (set-forward-vel (the-as float f26-0)) ) ((and (nonzero? (-> self control unknown-time-frame18)) - (>= (- (current-time) (-> self control unknown-time-frame18)) (seconds 0.04)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) ) (set-forward-vel 0.0) ) ((and (not (cpad-hold? (-> self control cpad number) square)) - (>= (- (current-time) (-> self control unknown-combo-tracker00 move-start-time)) (seconds 0.05)) + (time-elapsed? (-> self control unknown-combo-tracker00 move-start-time) (seconds 0.05)) ) (if (= (-> self control ground-pat material) (pat-material ice)) (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) @@ -1181,7 +1179,7 @@ ) (suspend) (ja :num! (seek! max (* (-> self control current-surface align-speed) f28-0))) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (if (< 2 gp-2) @@ -1191,9 +1189,7 @@ ) ) (if (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) @@ -1243,7 +1239,7 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self neck flex-blend) 0.0) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1291,7 +1287,7 @@ (cond ((= arg0 'attack) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('endlessfall) (cond @@ -1300,7 +1296,7 @@ (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) (let ((s3-1 (current-time))) - (until (>= (- (current-time) s3-1) (seconds 1)) + (until (time-elapsed? s3-1 (seconds 1)) (suspend) ) ) @@ -1457,7 +1453,7 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'life (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sleep-code) ) :post target-no-stick-post diff --git a/goal_src/jak2/levels/tomb/tomb-baby-spider.gc b/goal_src/jak2/levels/tomb/tomb-baby-spider.gc index 7cff319517..ea915ed4e9 100644 --- a/goal_src/jak2/levels/tomb/tomb-baby-spider.gc +++ b/goal_src/jak2/levels/tomb/tomb-baby-spider.gc @@ -396,7 +396,7 @@ :num! (loop! f30-2) :frame-num 0.0 ) - (until (>= (- (current-time) gp-3) s5-1) + (until (time-elapsed? gp-3 s5-1) (suspend) (ja :num! (loop! f30-2)) ) @@ -431,8 +431,8 @@ ) ) -(defmethod enemy-method-77 tomb-baby-spider ((obj tomb-baby-spider) (arg0 (pointer float))) - (let* ((a2-0 (the-as collide-shape-prim-group (-> obj root root-prim))) +(defmethod enemy-method-77 tomb-baby-spider ((this tomb-baby-spider) (arg0 (pointer float))) + (let* ((a2-0 (the-as collide-shape-prim-group (-> this root root-prim))) (v1-2 (-> a2-0 child 3)) ) (dotimes (a3-0 3) @@ -444,119 +444,119 @@ (collide-spec backgnd jak bot crate obstacle player-list blocking-plane pusher) ) ) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (let ((v1-6 (-> obj skel root-channel 0))) - (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((v1-6 (-> this skel root-channel 0))) + (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> v1-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> v1-6 param 1) (-> arg0 0)) (set! (-> v1-6 frame-num) 0.0) - (joint-control-channel-group! v1-6 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! v1-6 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) #t ) (((knocked-type knocked-type-2) (knocked-type knocked-type-5)) - (let ((v1-11 (-> obj skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> obj draw art-group data 17))) + (let ((v1-11 (-> this skel root-channel 0))) + (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 17))) (set! (-> v1-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 17)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 17)) frames num-frames) -1)) ) (set! (-> v1-11 param 1) (-> arg0 0)) (set! (-> v1-11 frame-num) 0.0) - (joint-control-channel-group! v1-11 (the-as art-joint-anim (-> obj draw art-group data 17)) num-func-seek!) + (joint-control-channel-group! v1-11 (the-as art-joint-anim (-> this draw art-group data 17)) num-func-seek!) ) #t ) (else - ((method-of-type nav-enemy enemy-method-77) obj arg0) + ((method-of-type nav-enemy enemy-method-77) this arg0) ) ) ) -(defmethod enemy-method-78 tomb-baby-spider ((obj tomb-baby-spider) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 tomb-baby-spider ((this tomb-baby-spider) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (let ((v1-3 (-> obj skel root-channel 0))) - (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((v1-3 (-> this skel root-channel 0))) + (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> v1-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> v1-3 param 1) (-> arg0 0)) (set! (-> v1-3 frame-num) 0.0) - (joint-control-channel-group! v1-3 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! v1-3 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) (((knocked-type knocked-type-2) (knocked-type knocked-type-5)) - (let ((v1-8 (-> obj skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((v1-8 (-> this skel root-channel 0))) + (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> v1-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> v1-8 param 1) (-> arg0 0)) (set! (-> v1-8 frame-num) 0.0) - (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) #t ) (else - ((method-of-type nav-enemy enemy-method-78) obj arg0) + ((method-of-type nav-enemy enemy-method-78) this arg0) ) ) ) -(defmethod enemy-method-79 tomb-baby-spider ((obj tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 tomb-baby-spider ((this tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((3) (let ((s4-0 (ja-done? 0))) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group frames num-frames) -1))) (set! (-> a0-3 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) ) (when s4-0 - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) ) (((knocked-type knocked-type-2) (knocked-type knocked-type-5)) - (let ((a0-7 (-> obj skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19))) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) ) (set! (-> a0-7 param 1) (-> arg1 anim-speed)) (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!) + (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) ) ) (else - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 16))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 16)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) (-> arg1 anim-speed)) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 16)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) ) ) ) - (vector-reset! (-> obj root transv)) + (vector-reset! (-> this root transv)) #t ) ) ) ((4) (let ((s4-1 (ja-done? 0))) - (let ((a0-11 (-> obj skel root-channel 0))) + (let ((a0-11 (-> this skel root-channel 0))) (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group frames num-frames) -1))) (set! (-> a0-11 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) ) (when s4-1 - (let ((v1-50 (-> obj root root-prim))) + (let ((v1-50 (-> this root root-prim))) (set! (-> (the-as collide-shape-prim-group v1-50) child 0 local-sphere w) 1638.4) (set! (-> (the-as collide-shape-prim-group v1-50) child 1 local-sphere w) 1638.4) (set! (-> (the-as collide-shape-prim-group v1-50) child 2 local-sphere w) 3276.8) @@ -569,12 +569,12 @@ ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) -(defmethod enemy-method-104 tomb-baby-spider ((obj tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 tomb-baby-spider ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (let* ((s1-0 arg0) (s2-0 (if (type? s1-0 process-focusable) s1-0 @@ -595,23 +595,23 @@ 'attack arg1 (static-attack-info ((id arg2) - (shove-back (* f0-0 (-> obj enemy-info attack-shove-back))) - (shove-up (* f0-0 (-> obj enemy-info attack-shove-up))) - (mode (-> obj enemy-info attack-mode)) - (damage (the float (-> obj enemy-info attack-damage))) + (shove-back (* f0-0 (-> this enemy-info attack-shove-back))) + (shove-up (* f0-0 (-> this enemy-info attack-shove-up))) + (mode (-> this enemy-info attack-mode)) + (damage (the float (-> this enemy-info attack-damage))) (knock (the-as uint 8)) ) ) ) - (enemy-method-105 obj arg0) + (enemy-method-105 this arg0) #t ) ) ) -(defmethod init-enemy-collision! tomb-baby-spider ((obj tomb-baby-spider)) +(defmethod init-enemy-collision! tomb-baby-spider ((this tomb-baby-spider)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -677,20 +677,20 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! tomb-baby-spider ((obj tomb-baby-spider)) +(defmethod init-enemy! tomb-baby-spider ((this tomb-baby-spider)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-baby-spider" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *tomb-baby-spider-nav-enemy-info*) + (init-enemy-behaviour-and-stats! this *tomb-baby-spider-nav-enemy-info*) (none) ) diff --git a/goal_src/jak2/levels/tomb/tomb-beetle.gc b/goal_src/jak2/levels/tomb/tomb-beetle.gc index 766899bd66..6d2703f66e 100644 --- a/goal_src/jak2/levels/tomb/tomb-beetle.gc +++ b/goal_src/jak2/levels/tomb/tomb-beetle.gc @@ -190,64 +190,64 @@ (set! (-> *tomb-beetle-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler tomb-beetle ((obj tomb-beetle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler tomb-beetle ((this tomb-beetle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (let ((v1-0 (new 'static 'array int64 2 -1 0))) (case arg2 (('cue-chase) - (set! (-> obj round) (-> arg3 param 0)) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (set! (-> this round) (-> arg3 param 0)) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('attack) - (when (and (-> obj next-state) (let ((a1-4 (-> obj next-state name))) - (or (= a1-4 'active) (= a1-4 'stand)) - ) + (when (and (-> this next-state) (let ((a1-4 (-> this next-state name))) + (or (= a1-4 'active) (= a1-4 'stand)) + ) ) (-> arg3 param 1) (cond - ((logtest? (-> obj fact enemy-options) (ash 1 (+ (-> obj round) 8))) + ((logtest? (-> this fact enemy-options) (ash 1 (+ (-> this round) 8))) (set! (-> v1-0 0) (the-as int (current-time))) - (go (method-of-object obj go-to-door)) + (go (method-of-object this go-to-door)) ) - ((>= (- (current-time) (the-as time-frame (-> v1-0 0))) (seconds 0.5)) - (logior! (-> obj flags) 1) - (go (method-of-object obj die)) + ((time-elapsed? (the-as time-frame (-> v1-0 0)) (seconds 0.5)) + (logior! (-> this flags) 1) + (go (method-of-object this die)) ) ) ) ) (('die) (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'key)) - (go (method-of-object obj explode)) + ((and (-> this next-state) (= (-> this next-state name) 'key)) + (go (method-of-object this explode)) ) - ((not (and (-> obj next-state) (= (-> obj next-state name) 'dormant))) - (go (method-of-object obj fly-away)) + ((not (and (-> this next-state) (= (-> this next-state name) 'dormant))) + (go (method-of-object this fly-away)) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod tomb-beetle-method-185 tomb-beetle ((obj tomb-beetle)) +(defmethod tomb-beetle-method-185 tomb-beetle ((this tomb-beetle)) (cond - ((-> obj draw shadow) + ((-> this draw shadow) (new 'stack-no-clear 'vector) (let ((f30-0 81920.0) (s5-0 (new 'stack-no-clear 'collide-query)) ) - (set! (-> s5-0 start-pos quad) (-> obj root trans quad)) + (set! (-> s5-0 start-pos quad) (-> this root trans quad)) (set-vector! (-> s5-0 move-dist) 0.0 (- f30-0) 0.0 1.0) (let ((v1-6 s5-0)) (set! (-> v1-6 radius) 8192.0) (set! (-> v1-6 collide-with) (collide-spec backgnd)) - (set! (-> v1-6 ignore-process0) obj) + (set! (-> v1-6 ignore-process0) this) (set! (-> v1-6 ignore-process1) #f) (set! (-> v1-6 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-6 action-mask) (collide-action solid)) @@ -255,18 +255,18 @@ (let ((f0-5 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) (cond ((>= f0-5 0.0) - (let ((v1-10 (-> obj draw shadow-ctrl))) + (let ((v1-10 (-> this draw shadow-ctrl))) (logclear! (-> v1-10 settings flags) (shadow-flags disable-draw)) ) 0 (-> s5-0 best-other-tri intersect) - (let ((a1-2 (-> obj root trans))) + (let ((a1-2 (-> this root trans))) (-> a1-2 y) (let ((f0-6 (* f0-5 f30-0))) (shadow-control-method-14 - (-> obj draw shadow-ctrl) + (-> this draw shadow-ctrl) a1-2 - (-> obj draw shadow-ctrl settings shadow-dir) + (-> this draw shadow-ctrl settings shadow-dir) (- -8192.0 f30-0) (+ -8192.0 f0-6) (+ 8192.0 f0-6) @@ -275,7 +275,7 @@ ) ) (else - (let ((v1-22 (-> obj draw shadow-ctrl))) + (let ((v1-22 (-> this draw shadow-ctrl))) (logior! (-> v1-22 settings flags) (shadow-flags disable-draw)) ) 0 @@ -285,12 +285,12 @@ ) ) (else - (let ((v1-24 (-> obj draw shadow-ctrl))) + (let ((v1-24 (-> this draw shadow-ctrl))) (logior! (-> v1-24 settings flags) (shadow-flags disable-draw)) ) 0 - (set! (-> obj draw bounds y) 2457.6) - (set! (-> obj draw bounds w) 8192.0) + (set! (-> this draw bounds y) 2457.6) + (set! (-> this draw bounds w) 8192.0) ) ) (none) @@ -385,7 +385,7 @@ (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (ja-no-eval :group! tomb-beetle-land-ja :num! (seek!) :frame-num 0.0) @@ -398,7 +398,7 @@ (f30-1 (rand-vu-float-range 0.8 1.4)) ) (ja-no-eval :group! tomb-beetle-wiggle-ja :num! (loop! f30-1) :frame-num 0.0) - (until (>= (- (current-time) gp-0) s5-0) + (until (time-elapsed? gp-0 s5-0) (suspend) (ja :num! (loop! f30-1)) ) @@ -489,7 +489,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -502,7 +502,7 @@ (set! (-> self state-timeout) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.2 0.8))))) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) (go-virtual active) ) ) @@ -736,7 +736,7 @@ ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 2)) + (until (time-elapsed? gp-2 (seconds 2)) (suspend) ) ) @@ -936,9 +936,9 @@ ) ) -(defmethod init-enemy-collision! tomb-beetle ((obj tomb-beetle)) +(defmethod init-enemy-collision! tomb-beetle ((this tomb-beetle)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -978,27 +978,27 @@ (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod init-enemy! tomb-beetle ((obj tomb-beetle)) +(defmethod init-enemy! tomb-beetle ((this tomb-beetle)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-beetle" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *tomb-beetle-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *tomb-beetle-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 sphere-mask) (the-as uint #x800fa)) ) 0 - (logclear! (-> obj enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) - (set! (-> obj flags) (the-as uint 0)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) + (set! (-> this flags) (the-as uint 0)) + (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) ) diff --git a/goal_src/jak2/levels/tomb/tomb-obs.gc b/goal_src/jak2/levels/tomb/tomb-obs.gc index 0b4b2c1701..7beac462b6 100644 --- a/goal_src/jak2/levels/tomb/tomb-obs.gc +++ b/goal_src/jak2/levels/tomb/tomb-obs.gc @@ -33,7 +33,7 @@ :origin-joint-index 3 ) -(defmethod get-art-group tomb-plat-wall ((obj tomb-plat-wall)) +(defmethod get-art-group tomb-plat-wall ((this tomb-plat-wall)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-plat-wall" (the-as (pointer uint32) #f)) ) @@ -108,14 +108,14 @@ :post plat-post ) -(defmethod base-plat-method-32 tomb-plat-wall ((obj tomb-plat-wall)) +(defmethod base-plat-method-32 tomb-plat-wall ((this tomb-plat-wall)) 0 (none) ) -(defmethod init-plat-collision! tomb-plat-wall ((obj tomb-plat-wall)) +(defmethod init-plat-collision! tomb-plat-wall ((this tomb-plat-wall)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -131,34 +131,34 @@ (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-wall ((obj tomb-plat-wall) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-plat-wall ((this tomb-plat-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask platform)) - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group (get-art-group obj)) (the-as pair 0)) - (set! (-> obj draw light-index) (the-as uint 1)) - (update-transforms (-> obj root)) - (stop-bouncing! obj) - (base-plat-method-32 obj) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logior! (-> this mask) (process-mask platform)) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-art-group this)) (the-as pair 0)) + (set! (-> this draw light-index) (the-as uint 1)) + (update-transforms (-> this root)) + (stop-bouncing! this) + (base-plat-method-32 this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-4 (new 'stack-no-clear 'sync-info-params))) (let ((v1-16 0)) - (if (not (logtest? (-> obj fact options) (actor-option loop))) + (if (not (logtest? (-> this fact options) (actor-option loop))) (set! v1-16 (logior v1-16 1)) ) (set! (-> a1-4 sync-type) 'sync-eased) @@ -171,12 +171,12 @@ This commonly includes things such as: (set! (-> a1-4 ease-out) 0.15) (set! (-> a1-4 pause-in) 0.0) (set! (-> a1-4 pause-out) 0.0) - (initialize! (-> obj sync) a1-4) + (initialize! (-> this sync) a1-4) ) - (set! (-> obj sound-id) (new 'static 'sound-id)) - (set! (-> obj position quad) (-> obj root trans quad)) - (set! (-> obj last-pos) 0.0) - (go (method-of-object obj plat-idle)) + (set! (-> this sound-id) (new 'static 'sound-id)) + (set! (-> this position quad) (-> this root trans quad)) + (set! (-> this last-pos) 0.0) + (go (method-of-object this plat-idle)) (none) ) @@ -477,7 +477,7 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self camera-state) 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (task-node-close! (game-task-node tomb-poles-block)) ) :exit (behavior () @@ -496,7 +496,7 @@ This commonly includes things such as: (remove-setting! 'string-startup-vector) (set! (-> self camera-state) 3) ) - ((and (= (-> self camera-state) 1) (>= (- (current-time) (-> self state-time)) (seconds 8))) + ((and (= (-> self camera-state) 1) (time-elapsed? (-> self state-time) (seconds 8))) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) @@ -518,8 +518,8 @@ This commonly includes things such as: (set! (-> self camera-state) 1) (ja-channel-push! 1 (seconds 2)) (ja :group! (-> self draw art-group data 3) :num! min) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (lift-pool 0) (drop-pool 1) (suspend) @@ -600,7 +600,7 @@ This commonly includes things such as: (set! (-> self camera-state) 3) ) ) - ((and (= (-> self camera-state) 1) (>= (- (current-time) (-> self state-time)) (seconds 4))) + ((and (= (-> self camera-state) 1) (time-elapsed? (-> self state-time) (seconds 4))) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) @@ -630,7 +630,7 @@ This commonly includes things such as: (set! v1-1 (or (not *target*) (process-grab? *target* #f))) ) (set-setting! 'entity-name "camera-170" 0.0 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self camera-state) 1) (ja-channel-push! 1 (seconds 2)) (until #f @@ -753,14 +753,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-stair-block ((obj tomb-stair-block) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-stair-block ((this tomb-stair-block) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 8) 0))) (set! (-> s4-0 total-prims) (the-as uint 9)) @@ -832,43 +832,45 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-27 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-27 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-stair-block" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 1)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj initial-y) (-> obj root trans y)) + (set! (-> this draw light-index) (the-as uint 1)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this initial-y) (-> this root trans y)) (ja-post) - (set! (-> obj spike-info 0 joint) 4) - (set! (-> obj spike-info 1 joint) 6) - (set! (-> obj spike-info 2 joint) 8) - (set! (-> obj spike-info 3 joint) 10) + (set! (-> this spike-info 0 joint) 4) + (set! (-> this spike-info 1 joint) 6) + (set! (-> this spike-info 2 joint) 8) + (set! (-> this spike-info 3 joint) 10) (let ((s5-2 (new 'stack-no-clear 'vector))) (dotimes (s4-2 4) - (set! (-> obj spike-info s4-2 y-offset) 0.0) - (vector<-cspace! s5-2 (-> obj node-list data (-> obj spike-info s4-2 joint))) - (set! (-> obj spike-info s4-2 spike) (ppointer->handle (process-spawn tomb-stair-block-spikes s5-2 :to obj))) - (set! (-> obj spike-info s4-2 up) #f) - (set! (-> obj spike-info s4-2 sounded) #f) + (set! (-> this spike-info s4-2 y-offset) 0.0) + (vector<-cspace! s5-2 (-> this node-list data (-> this spike-info s4-2 joint))) + (set! (-> this spike-info s4-2 spike) + (ppointer->handle (process-spawn tomb-stair-block-spikes s5-2 :to this)) + ) + (set! (-> this spike-info s4-2 up) #f) + (set! (-> this spike-info s4-2 sounded) #f) ) ) - (set! (-> obj root trans y) (+ -104448.0 (-> obj initial-y))) - (let ((s5-3 (-> obj skel root-channel 0))) + (set! (-> this root trans y) (+ -104448.0 (-> this initial-y))) + (let ((s5-3 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-3 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-3 frame-num) 0.0) ) - (set! (-> obj rise-sound) (new-sound-id)) - (set! (-> obj sink-sound) (new-sound-id)) - (go (method-of-object obj wait-for-pools)) + (set! (-> this rise-sound) (new-sound-id)) + (set! (-> this sink-sound) (new-sound-id)) + (go (method-of-object this wait-for-pools)) (none) ) @@ -886,20 +888,20 @@ This commonly includes things such as: ) -(defmethod init-skeleton! tomb-bounce-web ((obj tomb-bounce-web)) +(defmethod init-skeleton! tomb-bounce-web ((this tomb-bounce-web)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-bounce-web" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj mods) *indax-bounce-mods*) + (set! (-> this mods) *indax-bounce-mods*) 0 (none) ) -(defmethod bouncer-method-24 tomb-bounce-web ((obj tomb-bounce-web)) +(defmethod bouncer-method-24 tomb-bounce-web ((this tomb-bounce-web)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) (set! (-> s5-0 total-prims) (the-as uint 5)) (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) @@ -942,7 +944,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -962,20 +964,20 @@ This commonly includes things such as: :bounds (static-spherem 0 -7 0 8) ) -(defmethod get-art-group tomb-plat-pillar ((obj tomb-plat-pillar)) +(defmethod get-art-group tomb-plat-pillar ((this tomb-plat-pillar)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-plat-pillar" (the-as (pointer uint32) #f)) ) -(defmethod base-plat-method-32 tomb-plat-pillar ((obj tomb-plat-pillar)) +(defmethod base-plat-method-32 tomb-plat-pillar ((this tomb-plat-pillar)) 0 (none) ) ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-plat-pillar ((obj tomb-plat-pillar)) +(defmethod init-plat-collision! tomb-plat-pillar ((this tomb-plat-pillar)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -991,7 +993,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) (none) ) @@ -1046,7 +1048,7 @@ This commonly includes things such as: ) ) -(defmethod init-defaults! tomb-elevator ((obj tomb-elevator)) +(defmethod init-defaults! tomb-elevator ((this tomb-elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` @@ -1054,22 +1056,22 @@ This commonly includes things such as: - `elevator-move-rate` - `elevator-flags`" (let ((t9-0 (method-of-type elevator init-defaults!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj params flags) (elevator-flags elevator-flags-2)) - (set! (-> obj draw light-index) (the-as uint 1)) + (set! (-> this params flags) (elevator-flags elevator-flags-2)) + (set! (-> this draw light-index) (the-as uint 1)) (none) ) -(defmethod get-art-group tomb-elevator ((obj tomb-elevator)) +(defmethod get-art-group tomb-elevator ((this tomb-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-elevator" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-elevator ((obj tomb-elevator)) +(defmethod init-plat-collision! tomb-elevator ((this tomb-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1085,15 +1087,15 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) (none) ) -(defmethod set-ambient-sound! tomb-elevator ((obj tomb-elevator)) +(defmethod set-ambient-sound! tomb-elevator ((this tomb-elevator)) "Sets the elevator's [[ambient-sound]] up" - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "tomb-elevator" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "tomb-elevator" :fo-max 70) (-> this root trans)) ) 0 (none) @@ -1115,7 +1117,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-door ((obj tomb-boss-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boss-door ((this tomb-boss-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1123,8 +1125,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1153,16 +1155,16 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj door-radius) 61440.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this door-radius) 61440.0) + (go (method-of-object this close) #t) (none) ) @@ -1189,14 +1191,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-tomb ((obj water-anim-tomb)) +(defmethod init-water! water-anim-tomb ((this water-anim-tomb)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) @@ -1220,7 +1222,7 @@ This commonly includes things such as: ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-wing-door ((obj tomb-wing-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-wing-door ((this tomb-wing-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1228,8 +1230,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" ;; og:preserve-this added - (stack-size-set! (-> obj main-thread) 1024) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 1024) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s5-0 total-prims) (the-as uint 4)) @@ -1265,19 +1267,19 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-wing-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wing-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wing-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wing-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wing-close-hit")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wing-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wing-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wing-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wing-close-hit")) + (go (method-of-object this close) #t) (none) ) @@ -1337,14 +1339,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boulder-door ((obj tomb-boulder-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boulder-door ((this tomb-boulder-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle camera-blocker)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1359,17 +1361,17 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boulder-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (if (task-node-closed? (game-task-node tomb-poles-boulder)) - (go (method-of-object obj close)) - (go (method-of-object obj open)) + (go (method-of-object this close)) + (go (method-of-object this open)) ) (none) ) @@ -1471,16 +1473,16 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) ) :trans (behavior () (logclear! (-> self flags) (tomb-plat-flags topflags-0)) (plat-trans) (if (not (logtest? (-> self flags) (tomb-plat-flags topflags-0))) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) ) - (when (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) + (when (time-elapsed? (-> self ride-timer) (seconds 0.5)) (if (= (-> self path-pos) 0.0) (set! (-> self dest-pos) 1.0) (set! (-> self dest-pos) 0.0) @@ -1547,7 +1549,7 @@ This commonly includes things such as: ) :trans (behavior () (plat-trans) - (when (>= (- (current-time) (-> self ride-timer)) (seconds 1)) + (when (time-elapsed? (-> self ride-timer) (seconds 1)) (cond ((= (-> self path-pos) 1.0) (set! (-> self dest-pos) 0.0) @@ -1564,22 +1566,22 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs tomb-plat-return. -(defmethod relocate tomb-plat-return ((obj tomb-plat-return) (arg0 int)) - (if (nonzero? (-> obj intro-path)) - (&+! (-> obj intro-path) arg0) +(defmethod relocate tomb-plat-return ((this tomb-plat-return) (arg0 int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) arg0) ) - (the-as tomb-plat-return ((method-of-type process-drawable relocate) obj arg0)) + (the-as tomb-plat-return ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate tomb-plat-return ((obj tomb-plat-return)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method tomb-plat-return 10)) obj) +(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) (none) ) -(defmethod init-plat-collision! tomb-plat-return ((obj tomb-plat-return)) +(defmethod init-plat-collision! tomb-plat-return ((this tomb-plat-return)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -1595,52 +1597,52 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-return ((obj tomb-plat-return) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-plat-return ((this tomb-plat-return) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-plat-return" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (stop-bouncing! obj) - (set! (-> obj flags) (tomb-plat-flags)) - (set! (-> obj path-pos) 0.0) - (let ((s4-1 (new 'process 'curve-control obj 'path -1000000000.0))) + (stop-bouncing! this) + (set! (-> this flags) (tomb-plat-flags)) + (set! (-> this path-pos) 0.0) + (let ((s4-1 (new 'process 'curve-control this 'path -1000000000.0))) (if (logtest? (-> s4-1 flags) (path-control-flag not-found)) (go process-drawable-art-error "error in path") ) (logior! (-> s4-1 flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path) s4-1) + (set! (-> this path) s4-1) ) - (let ((s4-2 (new 'process 'curve-control obj 'intro -1000000000.0))) + (let ((s4-2 (new 'process 'curve-control this 'intro -1000000000.0))) (if (logtest? (-> s4-2 flags) (path-control-flag not-found)) (go process-drawable-art-error "error in intro-path") ) (logior! (-> s4-2 flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj intro-path) s4-2) + (set! (-> this intro-path) s4-2) ) - (let ((f30-0 (total-distance (-> obj path)))) - (set! (-> obj path-speed) (/ (res-lump-float arg0 'speed :default 40960.0) f30-0)) - (set! (-> obj root pause-adjust-distance) (+ 204800.0 f30-0)) + (let ((f30-0 (total-distance (-> this path)))) + (set! (-> this path-speed) (/ (res-lump-float arg0 'speed :default 40960.0) f30-0)) + (set! (-> this root pause-adjust-distance) (+ 204800.0 f30-0)) ) - (set! (-> obj sound-id) (new-sound-id)) - (init-plat! obj) + (set! (-> this sound-id) (new-sound-id)) + (init-plat! this) (if (or (task-closed? (the-as string ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'task-name 'interp -1000000000.0 @@ -1650,10 +1652,10 @@ This commonly includes things such as: ) ) ) - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) ) - (go (method-of-object obj run-intro)) - (go (method-of-object obj hidden)) + (go (method-of-object this run-intro)) + (go (method-of-object this hidden)) ) (none) ) @@ -1766,7 +1768,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (local-vars (sv-96 vector)) @@ -1828,7 +1830,7 @@ This commonly includes things such as: (defstate doors-open (tomb-sphinx) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (local-vars (sv-96 vector) (sv-112 vector)) @@ -1908,34 +1910,34 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs tomb-sphinx. -(defmethod relocate tomb-sphinx ((obj tomb-sphinx) (arg0 int)) - (the-as tomb-sphinx ((method-of-type process-drawable relocate) obj arg0)) +(defmethod relocate tomb-sphinx ((this tomb-sphinx) (arg0 int)) + (the-as tomb-sphinx ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate tomb-sphinx ((obj tomb-sphinx)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method tomb-sphinx 10)) obj) +(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) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-sphinx ((obj tomb-sphinx) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-sphinx ((this tomb-sphinx) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (the-as collide-shape-moving (new 'process 'trsqv))) - (process-drawable-from-entity! obj arg0) - (set! (-> obj target-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj move-dir) 0.0) - (if (and (task-complete? *game-info* (-> obj entity task)) + (set! (-> this root) (the-as collide-shape-moving (new 'process 'trsqv))) + (process-drawable-from-entity! this arg0) + (set! (-> this target-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this move-dir) 0.0) + (if (and (task-complete? *game-info* (-> this entity task)) (not (task-node-closed? (game-task-node tomb-boss-door))) ) - (go (method-of-object obj active)) - (go (method-of-object obj idle)) + (go (method-of-object this active)) + (go (method-of-object this idle)) ) (none) ) diff --git a/goal_src/jak2/levels/tomb/tomb-water.gc b/goal_src/jak2/levels/tomb/tomb-water.gc index 89424a5928..03b7a090d1 100644 --- a/goal_src/jak2/levels/tomb/tomb-water.gc +++ b/goal_src/jak2/levels/tomb/tomb-water.gc @@ -138,7 +138,7 @@ ) :code (behavior ((arg0 time-frame)) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) arg0) + (until (time-elapsed? s5-0 arg0) (suspend) ) ) @@ -154,14 +154,14 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-door ((obj tomb-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-door ((this tomb-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec camera-blocker pusher)) @@ -191,27 +191,27 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj round) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0)) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this round) (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0)) (ja-channel-push! 1 0) - (let ((a0-27 (-> obj skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-27 (-> this skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -327,7 +327,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-beetle-door ((obj tomb-beetle-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-beetle-door ((this tomb-beetle-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -335,7 +335,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec camera-blocker pusher)) @@ -365,43 +365,43 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-beetle-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (countdown (s5-2 3) - (vector-orient-by-quat! (-> obj offset s5-2) (-> tomb-beetle-door-offsets s5-2) (-> obj root quat)) - (set! (-> obj offset s5-2 w) (quaternion-y-angle (-> obj root quat))) - (set! (-> obj beetle s5-2) (the-as handle #f)) + (vector-orient-by-quat! (-> this offset s5-2) (-> tomb-beetle-door-offsets s5-2) (-> this root quat)) + (set! (-> this offset s5-2 w) (quaternion-y-angle (-> this root quat))) + (set! (-> this beetle s5-2) (the-as handle #f)) ) - (set! (-> obj offset-index) 0) - (set! (-> obj key-index) 0) + (set! (-> this offset-index) 0) + (set! (-> this key-index) 0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-33 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-33 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-33 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-33)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-33)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) (ja-channel-push! 1 0) - (let ((a0-30 (-> obj skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-30 (-> this skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -419,32 +419,32 @@ This commonly includes things such as: ) -(defmethod basebutton-method-33 tomb-button ((obj tomb-button)) +(defmethod basebutton-method-33 tomb-button ((this tomb-button)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) - (let ((s5-1 (-> obj skel root-channel 0))) + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) ) ) (else - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) @@ -456,9 +456,9 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch collide-shape vs none. -(defmethod basebutton-method-34 tomb-button ((obj tomb-button)) +(defmethod basebutton-method-34 tomb-button ((this tomb-button)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -474,17 +474,17 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; WARN: Return type mismatch float vs none. -(defmethod prepare-trigger-event! tomb-button ((obj tomb-button)) +(defmethod prepare-trigger-event! tomb-button ((this tomb-button)) "Sets `event-going-down` to `'trigger`" - (logior! (-> obj button-status) (button-status button-status-4)) - (set! (-> obj event-going-down) 'cue-chase) - (+! (-> obj root trans y) 204.8) + (logior! (-> this button-status) (button-status button-status-4)) + (set! (-> this event-going-down) 'cue-chase) + (+! (-> this root trans y) 204.8) (none) ) @@ -503,9 +503,9 @@ This commonly includes things such as: ) -(defmethod tomb-beetle-button-method-39 tomb-beetle-button ((obj tomb-beetle-button)) - (when (>= (- (current-time) (-> obj speech-timer)) (seconds 6)) - (let ((s5-0 (rand-vu-int-count-excluding 4 (the-as int (-> obj speech-mask))))) +(defmethod tomb-beetle-button-method-39 tomb-beetle-button ((this tomb-beetle-button)) + (when (time-elapsed? (-> this speech-timer) (seconds 6)) + (let ((s5-0 (rand-vu-int-count-excluding 4 (the-as int (-> this speech-mask))))) (let* ((v1-4 s5-0) (t0-0 (cond ((zero? v1-4) @@ -523,11 +523,11 @@ This commonly includes things such as: ) ) ) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) t0-0 -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) t0-0 -99.0 0) ) - (set! (-> obj speech-mask) (the-as uint (ash 1 s5-0))) + (set! (-> this speech-mask) (the-as uint (ash 1 s5-0))) ) - (set! (-> obj speech-timer) (current-time)) + (set-time! (-> this speech-timer)) ) 0 (none) @@ -666,7 +666,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch symbol vs none. -(defmethod send-event! tomb-beetle-button ((obj tomb-beetle-button) (arg0 symbol)) +(defmethod send-event! tomb-beetle-button ((this tomb-beetle-button) (arg0 symbol)) "Prepares an [[event-message-block]] using the provided type to send an event to: - the `notify-actor` - every [[entity-actor]] in the `actor-group` array @@ -677,7 +677,7 @@ This commonly includes things such as: (set! (-> a1-1 num-params) 0) (set! (-> a1-1 message) arg0) (let ((t9-0 send-event-function) - (v1-1 (-> obj notify-actor)) + (v1-1 (-> this notify-actor)) ) (t9-0 (if v1-1 @@ -687,13 +687,13 @@ This commonly includes things such as: ) ) ) - (let ((s4-0 (-> obj actor-group (-> obj round)))) + (let ((s4-0 (-> this actor-group (-> this round)))) (dotimes (s3-0 (-> s4-0 length)) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer self)) (set! (-> a1-2 num-params) 1) (set! (-> a1-2 message) arg0) - (set! (-> a1-2 param 0) (-> obj round)) + (set! (-> a1-2 param 0) (-> this round)) (let ((t9-1 send-event-function) (v1-11 (-> s4-0 data s3-0 actor)) ) @@ -711,14 +711,14 @@ This commonly includes things such as: (none) ) -(defmethod prepare-trigger-event! tomb-beetle-button ((obj tomb-beetle-button)) +(defmethod prepare-trigger-event! tomb-beetle-button ((this tomb-beetle-button)) "Sets `event-going-down` to `'trigger`" (let ((t9-0 (method-of-type tomb-button prepare-trigger-event!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj round) (-> obj entity extra perm user-uint8 0)) - (set! (-> obj speech-mask) (the-as uint 0)) - (set! (-> obj speech-timer) 0) + (set! (-> this round) (-> this entity extra perm user-uint8 0)) + (set! (-> this speech-mask) (the-as uint 0)) + (set! (-> this speech-timer) 0) 0 (none) ) @@ -900,7 +900,7 @@ This commonly includes things such as: (sv-160 int) (sv-176 (function vector vector float)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self plat-idx) 0) (dotimes (gp-0 (-> self plat-count)) (if (nonzero? (-> self plat gp-0)) @@ -973,7 +973,7 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 2)) + (until (time-elapsed? gp-0 (seconds 2)) (suspend) ) ) @@ -990,8 +990,8 @@ This commonly includes things such as: 0 ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 2)) - (set! (-> self state-time) (current-time)) + (when (time-elapsed? (-> self state-time) (seconds 2)) + (set-time! (-> self state-time)) (if (< (-> self plat-idx) (-> self plat-seq-count)) (send-event (handle->process (-> self plat (-> self plat-seq (-> self plat-idx)))) 'blink) ) @@ -1034,23 +1034,23 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod tomb-plat-simon-method-24 tomb-plat-simon ((obj tomb-plat-simon) (arg0 int)) - (let ((a0-3 (handle->process (-> obj plat arg0)))) +(defmethod tomb-plat-simon-method-24 tomb-plat-simon ((this tomb-plat-simon) (arg0 int)) + (let ((a0-3 (handle->process (-> this plat arg0)))) (send-event a0-3 'ready) ) (none) ) ;; WARN: Return type mismatch process-drawable vs tomb-plat-simon. -(defmethod relocate tomb-plat-simon ((obj tomb-plat-simon) (arg0 int)) - (if (nonzero? (-> obj plat)) - (&+! (-> obj plat) arg0) +(defmethod relocate tomb-plat-simon ((this tomb-plat-simon) (arg0 int)) + (if (nonzero? (-> this plat)) + (&+! (-> this plat) arg0) ) - (the-as tomb-plat-simon ((method-of-type process-drawable relocate) obj arg0)) + (the-as tomb-plat-simon ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-simon ((obj tomb-plat-simon) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-plat-simon ((this tomb-plat-simon) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1058,20 +1058,20 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (change-parent obj *pusher-pool*) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (change-parent this *pusher-pool*) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-2 (res-lump-data (-> obj entity) 'plat-seq pointer :tag-ptr (& sv-16)))) + (let ((v1-2 (res-lump-data (-> this entity) 'plat-seq pointer :tag-ptr (& sv-16)))) (cond ((and v1-2 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj plat-seq-count) (the-as int (-> sv-16 elt-count))) - (set! (-> obj plat-seq) (the-as (pointer uint32) v1-2)) + (set! (-> this plat-seq-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this plat-seq) (the-as (pointer uint32) v1-2)) ) (else - (set! (-> obj plat-seq-count) 0) - (set! (-> obj plat-seq) (the-as (pointer uint32) #f)) + (set! (-> this plat-seq-count) 0) + (set! (-> this plat-seq) (the-as (pointer uint32) #f)) ) ) ) @@ -1081,14 +1081,14 @@ This commonly includes things such as: (set! s4-0 v1-4) ) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 s4-0 #f)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 s4-0 #f)) ) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj plat-count) (-> obj path curve num-cverts)) - (set! (-> obj plat) (new 'process 'boxed-array handle (-> obj plat-count))) - (set! (-> obj flags) (the-as uint 0)) - (set! (-> obj button-handle) (the-as handle #f)) - (go (method-of-object obj dormant)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this plat-count) (-> this path curve num-cverts)) + (set! (-> this plat) (new 'process 'boxed-array handle (-> this plat-count))) + (set! (-> this flags) (the-as uint 0)) + (set! (-> this button-handle) (the-as handle #f)) + (go (method-of-object this dormant)) (none) ) @@ -1132,7 +1132,7 @@ This commonly includes things such as: (logxor! (-> self flags) (simon-block-flags sbf1)) (set! (-> self blink-timer 1) (+ (current-time) (seconds 0.2))) ) - (when (>= (- (current-time) (-> self blink-timer 0)) (seconds 1.2)) + (when (time-elapsed? (-> self blink-timer 0) (seconds 1.2)) (logclear! (-> self flags) (simon-block-flags sbf0)) (set! (-> self draw color-mult quad) (-> self color quad)) ) @@ -1181,16 +1181,17 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self flags) (simon-block-flags sbf0 sbf1 sbf2 sbf5)) (set! (-> self move-rate) 122880.0) ) :trans tomb-simon-block-trans :code sleep-code :post (behavior () - (if (>= (- (current-time) (-> self state-time)) - (the int (* 300.0 (+ (* 0.1 (the float (-> self order))) (* 0.015 (the float (-> self my-idx)))))) - ) + (if (time-elapsed? + (-> self state-time) + (the int (* 300.0 (+ (* 0.1 (the float (-> self order))) (* 0.015 (the float (-> self my-idx)))))) + ) (tomb-simon-block-post) (plat-post) ) @@ -1208,7 +1209,7 @@ This commonly includes things such as: (go-virtual idle) ) (('touch 'ridden 'bonk 'edge-grabbed) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (when (logtest? (-> self flags) (simon-block-flags sbf4)) (let* ((gp-0 *target*) (a0-10 (if (type? gp-0 process-focusable) @@ -1243,13 +1244,13 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self flags) (simon-block-flags sbf4)) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (send-event (ppointer->process (-> self parent)) 'die-but (-> self my-idx)) ) :trans (behavior () - (when (>= (- (current-time) (-> self ride-timer)) (seconds 1)) + (when (time-elapsed? (-> self ride-timer) (seconds 1)) (sound-play "tomb-simon-last") (go-virtual die) ) @@ -1314,7 +1315,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) ) :trans (behavior () (let* ((gp-0 *target*) @@ -1328,7 +1329,7 @@ This commonly includes things such as: (a0-3 (-> self root trans)) ) (when (and (or (< 16384.0 (fabs (- (-> a0-3 x) (-> v1-2 x)))) (< 16384.0 (fabs (- (-> a0-3 z) (-> v1-2 z))))) - (>= (- (current-time) (-> self ride-timer)) (seconds 0.25)) + (time-elapsed? (-> self ride-timer) (seconds 0.25)) ) (when (= (-> self next-idx) -1) (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) @@ -1382,9 +1383,7 @@ This commonly includes things such as: (set! (-> self draw color-mult quad) (-> self color quad)) ) :trans (behavior () - (if (and (logtest? (-> self flags) (simon-block-flags sbf2)) - (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) - ) + (if (and (logtest? (-> self flags) (simon-block-flags sbf2)) (time-elapsed? (-> self ride-timer) (seconds 0.5))) (go-virtual wobble-die) ) (plat-trans) @@ -1423,13 +1422,13 @@ This commonly includes things such as: :code (behavior () (set! (-> self move-rate) (* 4096.0 (rand-vu-float-range 0.5 1.5))) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.25)) + (until (time-elapsed? gp-0 (seconds 0.25)) (suspend) ) ) (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -1443,22 +1442,22 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod set-blink-timers! tomb-simon-block ((obj tomb-simon-block)) - (logior! (-> obj flags) (simon-block-flags sbf0 sbf1)) - (set! (-> obj blink-timer 0) (current-time)) - (set! (-> obj blink-timer 1) (current-time)) +(defmethod set-blink-timers! tomb-simon-block ((this tomb-simon-block)) + (logior! (-> this flags) (simon-block-flags sbf0 sbf1)) + (set-time! (-> this blink-timer 0)) + (set-time! (-> this blink-timer 1)) (none) ) -(defmethod get-art-group tomb-simon-block ((obj tomb-simon-block)) +(defmethod get-art-group tomb-simon-block ((this tomb-simon-block)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-simon-block" (the-as (pointer uint32) #f)) ) ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-simon-block ((obj tomb-simon-block)) +(defmethod init-plat-collision! tomb-simon-block ((this tomb-simon-block)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1474,7 +1473,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) (none) ) @@ -1665,14 +1664,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-simon-button ((obj tomb-simon-button) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-simon-button ((this tomb-simon-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) (set! (-> s4-0 total-prims) (the-as uint 6)) (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) @@ -1722,41 +1721,41 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-simon-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice (function none))) - (set! (-> obj on-activate) (res-lump-struct (-> obj entity) 'on-activate (function none))) - (let ((a0-42 (-> obj skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice (function none))) + (set! (-> this on-activate) (res-lump-struct (-> this entity) 'on-activate (function none))) + (let ((a0-42 (-> this skel root-channel 0))) + (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-42 param 0) 1.0) (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-loop!) ) (transform-post) - (let ((s5-1 (-> obj on-notice))) + (let ((s5-1 (-> this on-notice))) (when s5-1 (if (script-eval (the-as pair s5-1)) - (go (method-of-object obj open) #t) + (go (method-of-object this open) #t) ) ) ) - (let ((v1-49 (-> obj entity extra perm user-uint8 0))) + (let ((v1-49 (-> this entity extra perm user-uint8 0))) (cond ((zero? v1-49) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-49 1) - (go (method-of-object obj open) #t) + (go (method-of-object this open) #t) ) ((= v1-49 2) - (go (method-of-object obj pressed) #t) + (go (method-of-object this pressed) #t) ) ) ) @@ -1833,7 +1832,7 @@ This commonly includes things such as: ) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.45)) + (until (time-elapsed? gp-0 (seconds 0.45)) (suspend) ) ) @@ -1934,7 +1933,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self pat-entry-index) 0) (set-vector! (-> self draw color-mult) 0.9 0.9 0.9 1.0) (let ((gp-0 (-> self actor-group 0))) @@ -1975,7 +1974,7 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.2)) + (until (time-elapsed? gp-0 (seconds 0.2)) (suspend) ) ) @@ -1989,7 +1988,7 @@ This commonly includes things such as: (+ (-> self pat-tbl (-> self pat-index)) 18) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.2)) + (until (time-elapsed? gp-1 (seconds 0.2)) (suspend) ) ) @@ -1999,7 +1998,7 @@ This commonly includes things such as: (f30-0 1.0) ) (ja-no-eval :group! (-> self draw art-group data 4) :num! (loop! f30-0) :frame-num 0.0) - (until (>= (- (current-time) gp-2) s5-0) + (until (time-elapsed? gp-2 s5-0) (suspend) (ja :num! (loop! f30-0)) ) @@ -2077,7 +2076,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-vibe ((obj tomb-vibe) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-vibe ((this tomb-vibe) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2086,7 +2085,7 @@ This commonly includes things such as: - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) (with-pp - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec camera-blocker pusher)) @@ -2116,59 +2115,59 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-vibe" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj entity) arg0) - (set! (-> obj spawn-pos quad) (-> obj root trans quad)) - (+! (-> obj spawn-pos y) 81.92) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this entity) arg0) + (set! (-> this spawn-pos quad) (-> this root trans quad)) + (+! (-> this spawn-pos y) 81.92) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-26 (res-lump-data (-> obj entity) 'vibe-pattern pointer :tag-ptr (& sv-16)))) + (let ((v1-26 (res-lump-data (-> this entity) 'vibe-pattern pointer :tag-ptr (& sv-16)))) (cond ((and v1-26 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj pat-tbl) (the-as (pointer int32) v1-26)) - (set! (-> obj pat-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this pat-tbl) (the-as (pointer int32) v1-26)) + (set! (-> this pat-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj pat-tbl) (the-as (pointer int32) #f)) - (set! (-> obj pat-count) 0) + (set! (-> this pat-tbl) (the-as (pointer int32) #f)) + (set! (-> this pat-count) 0) 0 ) ) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-33 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (let ((v1-33 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-32)))) (cond ((and v1-33 (nonzero? (-> sv-32 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-33)) - (set! (-> obj actor-group-count) (the-as int (-> sv-32 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-33)) + (set! (-> this actor-group-count) (the-as int (-> sv-32 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (when (logtest? (actor-option user17) (-> obj fact options)) - (let ((s5-1 (-> obj entity extra perm))) + (when (logtest? (actor-option user17) (-> this fact options)) + (let ((s5-1 (-> this entity extra perm))) (when (not (logtest? (-> s5-1 status) (entity-perm-status bit-5))) - (set! (-> s5-1 user-object 0) (rand-vu-int-range 0 (+ (-> obj pat-count) -1))) + (set! (-> s5-1 user-object 0) (rand-vu-int-range 0 (+ (-> this pat-count) -1))) (logior! (-> s5-1 status) (entity-perm-status bit-5)) ) (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) (let ((v1-56 (-> *event-queue* data (-> *event-queue* length)))) (+! (-> *event-queue* length) 1) (set! (-> v1-56 form-handle) (process->handle pp)) - (set! (-> v1-56 to-handle) (process->handle obj)) + (set! (-> v1-56 to-handle) (process->handle this)) (set! (-> v1-56 num-params) 1) (set! (-> v1-56 message) 'set-pattern) (set! (-> v1-56 param 0) (the-as uint (-> s5-1 user-object 0))) @@ -2176,25 +2175,25 @@ This commonly includes things such as: ) ) ) - (set! (-> obj pat-index) -1) + (set! (-> this pat-index) -1) (ja-channel-push! 1 0) - (let ((a0-53 (-> obj skel root-channel 0))) - (set! (-> a0-53 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-53 (-> this skel root-channel 0))) + (set! (-> a0-53 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-53 frame-num) 0.0) - (joint-control-channel-group! a0-53 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-53 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (set! (-> obj flags) (tomb-vibe-flags)) - (set! (-> obj event-hook) (-> (method-of-type tomb-vibe idle) event)) + (set! (-> this flags) (tomb-vibe-flags)) + (set! (-> this event-hook) (-> (method-of-type tomb-vibe idle) event)) (cond - ((logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) - (go (method-of-object obj die) #t) + ((logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this die) #t) ) - ((logtest? (actor-option user17) (-> obj fact options)) - (go (method-of-object obj idle)) + ((logtest? (actor-option user17) (-> this fact options)) + (go (method-of-object this idle)) ) (else - (go (method-of-object obj get-pattern)) + (go (method-of-object this get-pattern)) ) ) (none) @@ -2286,7 +2285,7 @@ This commonly includes things such as: (let ((gp-0 0) (s5-0 (current-time)) ) - (until (>= (- (current-time) s5-0) (-> self on-duration)) + (until (time-elapsed? s5-0 (-> self on-duration)) (when (< (-> self harmless-time) (current-time)) (tomb-water-trap-method-22 self) (dotimes (s4-0 (+ (-> self path curve num-cverts) -1)) @@ -2330,17 +2329,18 @@ This commonly includes things such as: (set! (-> self can-exit-running?) #t) (let ((gp-1 90)) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) gp-1) + (until (time-elapsed? s5-1 gp-1) (suspend) ) ) (let ((s5-2 #f) (s4-2 (current-time)) ) - (until (>= (- (current-time) s4-2) - (the-as time-frame (- (- (-> self sync period) (the-as uint (-> self on-duration))) (the-as uint gp-1))) - ) - (when (and (not s5-2) (>= (- (current-time) s4-2) (seconds 0.3))) + (until (time-elapsed? + s4-2 + (the-as time-frame (- (- (-> self sync period) (the-as uint (-> self on-duration))) (the-as uint gp-1))) + ) + (when (and (not s5-2) (time-elapsed? s4-2 (seconds 0.3))) (set! s5-2 #t) (set-tombc-electricity-scale! 0.0) ) @@ -2358,21 +2358,21 @@ This commonly includes things such as: ) ) -(defmethod tomb-water-trap-method-22 tomb-water-trap ((obj tomb-water-trap)) +(defmethod tomb-water-trap-method-22 tomb-water-trap ((this tomb-water-trap)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 collide-with) (collide-spec jak bot player-list)) - (set! (-> gp-0 ignore-process0) obj) + (set! (-> gp-0 ignore-process0) this) (set! (-> gp-0 ignore-process1) #f) (set! (-> gp-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> gp-0 action-mask) (collide-action solid)) - (mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer (-> obj bbox)) 32) + (mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer (-> this bbox)) 32) (fill-using-bounding-box *collide-cache* gp-0) ) (none) ) ;; WARN: Return type mismatch time-frame vs none. -(defmethod tomb-water-trap-method-23 tomb-water-trap ((obj tomb-water-trap) (arg0 vector) (arg1 vector)) +(defmethod tomb-water-trap-method-23 tomb-water-trap ((this tomb-water-trap) (arg0 vector) (arg1 vector)) (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) ) @@ -2381,7 +2381,7 @@ This commonly includes things such as: (let ((v1-3 s4-0)) (set! (-> v1-3 radius) 2048.0) (set! (-> v1-3 collide-with) (collide-spec jak bot player-list)) - (set! (-> v1-3 ignore-process0) obj) + (set! (-> v1-3 ignore-process0) this) (set! (-> v1-3 ignore-process1) #f) (set! (-> v1-3 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-3 action-mask) (collide-action solid semi-solid)) @@ -2396,7 +2396,7 @@ This commonly includes things such as: ) (when s4-1 (let ((s2-2 (vector+float*! (new 'stack-no-clear 'vector) arg0 s3-1 f30-0))) - (tomb-water-trap-method-24 obj arg0 s2-2 (the int (* 3.0 (rand-vu-float-range 5.0 11.0)))) + (tomb-water-trap-method-24 this arg0 s2-2 (the int (* 3.0 (rand-vu-float-range 5.0 11.0)))) ) (let ((v1-10 (vector-reset! (new 'stack-no-clear 'vector)))) (if (send-event @@ -2404,10 +2404,10 @@ This commonly includes things such as: 'attack #f (static-attack-info - ((id (-> obj attack-id)) (invinc-time (seconds 3)) (mode 'shock) (vector v1-10) (shove-up (meters 3))) + ((id (-> this attack-id)) (invinc-time (seconds 3)) (mode 'shock) (vector v1-10) (shove-up (meters 3))) ) ) - (set! (-> obj harmless-time) (+ (current-time) (seconds 3))) + (set! (-> this harmless-time) (+ (current-time) (seconds 3))) ) ) ) @@ -2418,11 +2418,11 @@ This commonly includes things such as: (none) ) -(defmethod tomb-water-trap-method-24 tomb-water-trap ((obj tomb-water-trap) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod tomb-water-trap-method-24 tomb-water-trap ((this tomb-water-trap) (arg0 vector) (arg1 vector) (arg2 int)) (let ((v1-1 (process-spawn lightning-tracker :init lightning-tracker-init - (-> obj l-spec) + (-> this l-spec) (+ arg2 120) #f #f @@ -2445,30 +2445,30 @@ This commonly includes things such as: ) (set! (-> s2-2 trans quad) (-> arg0 quad)) (set! (-> s3-3 trans quad) (-> arg1 quad)) - (spawn-with-matrix (-> obj part) s2-2) - (spawn-with-matrix (-> obj part) s3-3) + (spawn-with-matrix (-> this part) s2-2) + (spawn-with-matrix (-> this part) s3-3) ) (none) ) ;; WARN: Return type mismatch process-drawable vs tomb-water-trap. -(defmethod relocate tomb-water-trap ((obj tomb-water-trap) (arg0 int)) - (if (nonzero? (-> obj l-index)) - (&+! (-> obj l-index) arg0) +(defmethod relocate tomb-water-trap ((this tomb-water-trap) (arg0 int)) + (if (nonzero? (-> this l-index)) + (&+! (-> this l-index) arg0) ) - (the-as tomb-water-trap ((method-of-type process-drawable relocate) obj arg0)) + (the-as tomb-water-trap ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-water-trap ((obj tomb-water-trap) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-water-trap ((this tomb-water-trap) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) (let ((v1-1 0)) (if #t @@ -2480,74 +2480,74 @@ This commonly includes things such as: (set! (-> a1-3 entity) arg0) (set! (-> a1-3 period) (the-as uint 2400)) (set! (-> a1-3 percent) 0.75) - (initialize! (-> obj sync) a1-3) + (initialize! (-> this sync) a1-3) ) - (set! (-> obj on-duration) (the-as time-frame (the int (-> obj sync offset)))) - (set! (-> obj harmless-time) 0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 arg0 #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this on-duration) (the-as time-frame (the int (-> this sync offset)))) + (set! (-> this harmless-time) 0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s5-1 (new 'stack-no-clear 'sphere))) - (get-point-in-path! (-> obj path) s5-1 0.0 'interp) + (get-point-in-path! (-> this path) s5-1 0.0 'interp) (set! (-> s5-1 r) 4096.0) - (set-from-sphere! (-> obj bbox) s5-1) - (countdown (s4-0 (+ (-> obj path curve num-cverts) -1)) + (set-from-sphere! (-> this bbox) s5-1) + (countdown (s4-0 (+ (-> this path curve num-cverts) -1)) (add-point! - (-> obj bbox) - (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float s4-0) 'interp) + (-> this bbox) + (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float s4-0) 'interp) ) ) - (get-bounding-sphere (-> obj bbox) s5-1) + (get-bounding-sphere (-> this bbox) s5-1) (+! (-> s5-1 r) 81920.0) - (set-from-sphere! (-> obj run-bbox) s5-1) + (set-from-sphere! (-> this run-bbox) s5-1) ) (let* ((v1-29 *game-info*) (a0-17 (+ (-> v1-29 attack-id) 1)) ) (set! (-> v1-29 attack-id) a0-17) - (set! (-> obj attack-id) a0-17) + (set! (-> this attack-id) a0-17) ) - (set! (-> obj l-spec) (new 'static 'lightning-spec - :name #f - :flags (lightning-spec-flags lsf2) - :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) - :end-color (new 'static 'rgba :a #x80) - :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) - :fade-start-factor 0.2 - :fade-time 120.0 - :texture (new 'static 'texture-id :index #x83 :page #xc) - :reduction 0.42 - :num-points 12 - :box-size 14336.0 - :merge-factor 0.5 - :merge-count 4 - :radius 3276.8 - :duration -1.0 - :sound #f - ) + (set! (-> this l-spec) (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 12 + :box-size 14336.0 + :merge-factor 0.5 + :merge-count 4 + :radius 3276.8 + :duration -1.0 + :sound #f + ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 696) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 696) this)) (let ((a3-3 (new 'stack-no-clear 'vector))) - (set! (-> a3-3 x) (* 0.5 (+ (-> obj bbox min x) (-> obj bbox max x)))) - (set! (-> a3-3 y) (* 0.5 (+ (-> obj bbox min y) (-> obj bbox max y)))) - (set! (-> a3-3 z) (* 0.5 (+ (-> obj bbox min z) (-> obj bbox max z)))) - (set! (-> obj sound) (new 'process 'ambient-sound (static-sound-spec "water-trap-zap" :fo-max 55) a3-3)) + (set! (-> a3-3 x) (* 0.5 (+ (-> this bbox min x) (-> this bbox max x)))) + (set! (-> a3-3 y) (* 0.5 (+ (-> this bbox min y) (-> this bbox max y)))) + (set! (-> a3-3 z) (* 0.5 (+ (-> this bbox min z) (-> this bbox max z)))) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "water-trap-zap" :fo-max 55) a3-3)) ) - (set! (-> obj volume) 0.0) - (let ((a0-20 (-> obj entity))) - (set! (-> obj l-count) (the-as uint ((method-of-object a0-20 get-property-value) - a0-20 - 'bolt-count - 'interp - -1000000000.0 - (the-as uint128 8) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (set! (-> this volume) 0.0) + (let ((a0-20 (-> this entity))) + (set! (-> this l-count) (the-as uint ((method-of-object a0-20 get-property-value) + a0-20 + 'bolt-count + 'interp + -1000000000.0 + (the-as uint128 8) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) ) - (set! (-> obj l-index) (new 'process 'boxed-array uint32 (the-as int (-> obj l-count)))) - (go (method-of-object obj idle)) + (set! (-> this l-index) (new 'process 'boxed-array uint32 (the-as int (-> this l-count)))) + (go (method-of-object this idle)) (none) ) @@ -2588,10 +2588,10 @@ This commonly includes things such as: (defstate open (tomb-smash-door) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (-> self timeout)) + (when (time-elapsed? (-> self state-time) (-> self timeout)) (let* ((s5-0 *target*) (gp-0 (if (type? s5-0 process-focusable) s5-0 @@ -2647,14 +2647,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-smash-door ((obj tomb-smash-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-smash-door ((this tomb-smash-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec camera-blocker pusher)) @@ -2683,18 +2683,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-smash-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((f30-0 300.0) - (a0-22 (-> obj entity)) + (a0-22 (-> this entity)) ) - (set! (-> obj timeout) + (set! (-> this timeout) (the-as time-frame (the int (* f30-0 ((method-of-object a0-22 get-property-value-float) a0-22 'timeout @@ -2710,12 +2710,12 @@ This commonly includes things such as: ) ) (ja-channel-push! 1 0) - (let ((a0-24 (-> obj skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-24 (-> this skel root-channel 0))) + (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/tomb/widow-baron.gc b/goal_src/jak2/levels/tomb/widow-baron.gc index 3c03969710..7a2c69d95f 100644 --- a/goal_src/jak2/levels/tomb/widow-baron.gc +++ b/goal_src/jak2/levels/tomb/widow-baron.gc @@ -32,67 +32,67 @@ ) -(defmethod widow-float-seeker-method-9 widow-float-seeker ((obj widow-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) - (set! (-> obj target) arg0) - (set! (-> obj value) arg0) - (set! (-> obj vel) 0.0) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj max-partial) arg3) - (set! (-> obj bounce-high) arg4) +(defmethod widow-float-seeker-method-9 widow-float-seeker ((this widow-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (set! (-> this target) arg0) + (set! (-> this value) arg0) + (set! (-> this vel) 0.0) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this max-partial) arg3) + (set! (-> this bounce-high) arg4) 0 (none) ) -(defmethod widow-float-seeker-method-10 widow-float-seeker ((obj widow-float-seeker) (arg0 (pointer float))) - (set! (-> obj target) (-> arg0 0)) - (set! (-> obj value) (-> arg0 1)) - (set! (-> obj vel) (-> arg0 2)) - (set! (-> obj accel) (-> arg0 3)) - (set! (-> obj max-vel) (-> arg0 4)) - (set! (-> obj max-partial) (-> arg0 5)) - (set! (-> obj bounce-high) (-> arg0 6)) +(defmethod widow-float-seeker-method-10 widow-float-seeker ((this widow-float-seeker) (arg0 (pointer float))) + (set! (-> this target) (-> arg0 0)) + (set! (-> this value) (-> arg0 1)) + (set! (-> this vel) (-> arg0 2)) + (set! (-> this accel) (-> arg0 3)) + (set! (-> this max-vel) (-> arg0 4)) + (set! (-> this max-partial) (-> arg0 5)) + (set! (-> this bounce-high) (-> arg0 6)) 0 (none) ) -(defmethod widow-float-seeker-method-11 widow-float-seeker ((obj widow-float-seeker) (arg0 float)) +(defmethod widow-float-seeker-method-11 widow-float-seeker ((this widow-float-seeker) (arg0 float)) (with-pp 0.0 0.0 - (let* ((f1-2 (- (+ (-> obj target) arg0) (-> obj value))) - (f0-6 (if (= (-> obj target) 0.0) - (* (-> obj max-partial) (fabs f1-2)) - (-> obj max-vel) + (let* ((f1-2 (- (+ (-> this target) arg0) (-> this value))) + (f0-6 (if (= (-> this target) 0.0) + (* (-> this max-partial) (fabs f1-2)) + (-> this max-vel) ) ) ) - (let ((f1-3 (* f1-2 (* (-> obj accel) (-> pp clock time-adjust-ratio))))) - (+! (-> obj vel) f1-3) + (let ((f1-3 (* f1-2 (* (-> this accel) (-> pp clock time-adjust-ratio))))) + (+! (-> this vel) f1-3) ) - (let ((f1-6 (fabs (-> obj vel))) - (f0-7 (fmin f0-6 (-> obj max-vel))) + (let ((f1-6 (fabs (-> this vel))) + (f0-7 (fmin f0-6 (-> this max-vel))) ) (if (< f0-7 f1-6) - (set! (-> obj vel) (* (-> obj vel) (/ f0-7 f1-6))) + (set! (-> this vel) (* (-> this vel) (/ f0-7 f1-6))) ) ) ) - (let ((f0-11 (* (-> obj vel) (-> pp clock time-adjust-ratio)))) - (+! (-> obj value) f0-11) + (let ((f0-11 (* (-> this vel) (-> pp clock time-adjust-ratio)))) + (+! (-> this value) f0-11) ) - (when (and (!= (-> obj target) 0.0) (>= (-> obj value) (-> obj target)) (< 0.0 (-> obj vel))) - (set! (-> obj value) (-> obj target)) - (set! (-> obj vel) (* (-> obj vel) (- (-> obj bounce-high)))) + (when (and (!= (-> this target) 0.0) (>= (-> this value) (-> this target)) (< 0.0 (-> this vel))) + (set! (-> this value) (-> this target)) + (set! (-> this vel) (* (-> this vel) (- (-> this bounce-high)))) ) 0 (none) ) ) -(defmethod widow-float-seeker-method-12 widow-float-seeker ((obj widow-float-seeker) (arg0 float)) - (set! (-> obj value) (+ (-> obj target) arg0)) - (set! (-> obj vel) 0.0) +(defmethod widow-float-seeker-method-12 widow-float-seeker ((this widow-float-seeker) (arg0 float)) + (set! (-> this value) (+ (-> this target) arg0)) + (set! (-> this vel) 0.0) 0 (none) ) @@ -115,27 +115,27 @@ ) -(defmethod init widow-rand-vector ((obj widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) - (set! (-> obj min-time) arg0) - (set! (-> obj max-time) arg1) - (set! (-> obj xz-max) (* 0.5 arg2)) - (set! (-> obj y-max) (* 0.5 arg3)) - (set! (-> obj timer) 0) - (vector-reset! (-> obj value)) +(defmethod init widow-rand-vector ((this widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) + (set! (-> this min-time) arg0) + (set! (-> this max-time) arg1) + (set! (-> this xz-max) (* 0.5 arg2)) + (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this timer) 0) + (vector-reset! (-> this value)) 0 (none) ) -(defmethod widow-rand-vector-method-10 widow-rand-vector ((obj widow-rand-vector)) +(defmethod widow-rand-vector-method-10 widow-rand-vector ((this widow-rand-vector)) (with-pp - (set! (-> obj timer) - (- (the-as time-frame (-> obj timer)) (- (current-time) (-> pp clock old-frame-counter))) + (set! (-> this timer) + (- (the-as time-frame (-> this timer)) (- (current-time) (-> pp clock old-frame-counter))) ) - (when (<= (-> obj timer) 0) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value x) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (set! (-> obj value y) (rand-vu-float-range (- (-> obj y-max)) (-> obj y-max))) - (set! (-> obj value z) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) + (when (<= (-> this timer) 0) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (set! (-> this value y) (rand-vu-float-range (- (-> this y-max)) (-> this y-max))) + (set! (-> this value z) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) ) 0 (none) @@ -160,49 +160,49 @@ ) -(defmethod widow-oscillator-method-9 widow-oscillator ((obj widow-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod widow-oscillator-method-9 widow-oscillator ((this widow-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj value quad) (-> arg0 quad)) + (set! (-> this target quad) (-> arg0 quad)) + (set! (-> this value quad) (-> arg0 quad)) ) (else - (vector-reset! (-> obj target)) - (vector-reset! (-> obj value)) + (vector-reset! (-> this target)) + (vector-reset! (-> this value)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj damping) arg3) + (vector-reset! (-> this vel)) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this damping) arg3) 0 (none) ) -(defmethod widow-oscillator-method-10 widow-oscillator ((obj widow-oscillator) (arg0 vector)) +(defmethod widow-oscillator-method-10 widow-oscillator ((this widow-oscillator) (arg0 vector)) (with-pp (let ((gp-0 (new 'stack-no-clear 'vector))) - (let ((f30-0 (fmax (-> obj max-vel) (vector-length (-> obj vel))))) + (let ((f30-0 (fmax (-> this max-vel) (vector-length (-> this vel))))) (cond (arg0 - (vector+! gp-0 (-> obj target) arg0) - (vector-! gp-0 gp-0 (-> obj value)) + (vector+! gp-0 (-> this target) arg0) + (vector-! gp-0 gp-0 (-> this value)) ) (else - (vector-! gp-0 (-> obj target) (-> obj value)) + (vector-! gp-0 (-> this target) (-> this value)) ) ) - (vector-normalize! gp-0 (* (-> obj accel) (-> pp clock time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) gp-0) - (let ((f0-3 (vector-length (-> obj vel)))) + (vector-normalize! gp-0 (* (-> this accel) (-> pp clock time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) gp-0) + (let ((f0-3 (vector-length (-> this vel)))) (if (< f30-0 f0-3) - (vector-float*! (-> obj vel) (-> obj vel) (/ f30-0 f0-3)) + (vector-float*! (-> this vel) (-> this vel) (/ f30-0 f0-3)) ) ) ) - (vector-float*! (-> obj vel) (-> obj vel) (-> obj damping)) - (vector-float*! gp-0 (-> obj vel) (-> pp clock time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) gp-0) + (vector-float*! (-> this vel) (-> this vel) (-> this damping)) + (vector-float*! gp-0 (-> this vel) (-> pp clock time-adjust-ratio)) + (vector+! (-> this value) (-> this value) gp-0) ) 0 (none) @@ -359,80 +359,80 @@ :origin-joint-index 3 ) -(defmethod baron-pod-method-21 baron-pod ((obj baron-pod) (arg0 symbol)) - (when (>= (- (current-time) (-> obj red-tip-change-time)) 0) - (set! (-> obj alt-red-tip-on) (not (-> obj alt-red-tip-on))) - (set! (-> obj red-tip-change-time) (+ (current-time) (seconds 0.5))) +(defmethod baron-pod-method-21 baron-pod ((this baron-pod) (arg0 symbol)) + (when (>= (- (current-time) (-> this red-tip-change-time)) 0) + (set! (-> this alt-red-tip-on) (not (-> this alt-red-tip-on))) + (set! (-> this red-tip-change-time) (+ (current-time) (seconds 0.5))) (set! arg0 #t) ) - (when (>= (- (current-time) (-> obj blink-time)) 0) - (set! (-> obj blink-mask) 0) + (when (>= (- (current-time) (-> this blink-time)) 0) + (set! (-> this blink-mask) 0) (dotimes (s5-0 10) (let* ((f30-0 0.5) (v1-17 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-18 (the-as number (logior #x3f800000 v1-17))) ) (if (< f30-0 (+ -1.0 (the-as float v1-18))) - (logior! (-> obj blink-mask) (ash 1 s5-0)) + (logior! (-> this blink-mask) (ash 1 s5-0)) ) ) ) - (set! (-> obj blink-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.75))))) + (set! (-> this blink-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.75))))) (set! arg0 #t) ) (when arg0 - (remove-from-process *part-engine* obj) - (add-connection *part-engine* obj 13 obj 3264 (new 'static 'vector :w 819200.0)) - (add-connection *part-engine* obj 14 obj 3264 (new 'static 'vector :w 819200.0)) - (if (-> obj alt-red-tip-on) - (add-connection *part-engine* obj 5 obj 3251 (new 'static 'vector :w 819200.0)) - (add-connection *part-engine* obj 6 obj 3251 (new 'static 'vector :w 819200.0)) + (remove-from-process *part-engine* this) + (add-connection *part-engine* this 13 this 3264 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 14 this 3264 (new 'static 'vector :w 819200.0)) + (if (-> this alt-red-tip-on) + (add-connection *part-engine* this 5 this 3251 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 6 this 3251 (new 'static 'vector :w 819200.0)) ) - (let ((s5-2 (-> obj blink-mask))) + (let ((s5-2 (-> this blink-mask))) (if (logtest? s5-2 1) - (add-connection *part-engine* obj 8 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 8 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 2) - (add-connection *part-engine* obj 9 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 9 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 4) - (add-connection *part-engine* obj 10 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 10 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 8) - (add-connection *part-engine* obj 11 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 11 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 16) - (add-connection *part-engine* obj 12 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 12 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 32) - (add-connection *part-engine* obj 15 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 15 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 64) - (add-connection *part-engine* obj 16 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 16 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 128) - (add-connection *part-engine* obj 17 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 17 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 256) - (add-connection *part-engine* obj 18 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 18 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 512) - (add-connection *part-engine* obj 19 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 19 this 3252 (new 'static 'vector :w 819200.0)) ) ) (cond - ((-> obj has-stone) - (add-connection *part-engine* obj 4 obj 3258 (new 'static 'vector :y 4096.0 :w 819200.0)) - (add-connection *part-engine* obj 4 obj 3259 (new 'static 'vector :y 4096.0 :w 819200.0)) + ((-> this has-stone) + (add-connection *part-engine* this 4 this 3258 (new 'static 'vector :y 4096.0 :w 819200.0)) + (add-connection *part-engine* this 4 this 3259 (new 'static 'vector :y 4096.0 :w 819200.0)) ) (else - (add-connection *part-engine* obj 4 obj 3256 (new 'static 'vector :y 4096.0 :w 819200.0)) - (add-connection *part-engine* obj 4 obj 3257 (new 'static 'vector :y 4096.0 :w 819200.0)) + (add-connection *part-engine* this 4 this 3256 (new 'static 'vector :y 4096.0 :w 819200.0)) + (add-connection *part-engine* this 4 this 3257 (new 'static 'vector :y 4096.0 :w 819200.0)) ) ) ) - (if (-> obj has-stone) - (spawn (-> obj part) (-> obj root trans)) + (if (-> this has-stone) + (spawn (-> this part) (-> this root trans)) ) 0 (none) @@ -535,7 +535,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-bridge ((obj tomb-boss-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boss-bridge ((this tomb-boss-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -543,7 +543,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (case ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'tomb-boss-bridge-type 'interp -1000000000.0 @@ -552,27 +552,27 @@ This commonly includes things such as: *res-static-buf* ) (('b) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-bridge-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) (else - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-bridge-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) ) - (set! (-> obj draw light-index) (the-as uint 2)) + (set! (-> this draw light-index) (the-as uint 2)) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/goal_src/jak2/levels/tomb/widow-extras.gc b/goal_src/jak2/levels/tomb/widow-extras.gc index 405242c206..254b45175c 100644 --- a/goal_src/jak2/levels/tomb/widow-extras.gc +++ b/goal_src/jak2/levels/tomb/widow-extras.gc @@ -201,10 +201,10 @@ :code sleep-code ) -(defmethod tomb-boss-catwalk-method-22 tomb-boss-catwalk ((obj tomb-boss-catwalk) (arg0 vector) (arg1 int)) +(defmethod tomb-boss-catwalk-method-22 tomb-boss-catwalk ((this tomb-boss-catwalk) (arg0 vector) (arg1 int)) (case arg1 ((1) - (let ((s3-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-3 (new 'process 'collide-shape-prim-mesh s3-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-3 prim-core collide-with) (collide-spec jak bot player-list)) @@ -219,11 +219,11 @@ (set! (-> s3-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s3-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-0)) + (set! (-> this root) (the-as collide-shape-moving s3-0)) ) ) ((2) - (let ((s3-1 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-1 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-9 (new 'process 'collide-shape-prim-mesh s3-1 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot player-list)) @@ -238,11 +238,11 @@ (set! (-> s3-1 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s3-1 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-1)) + (set! (-> this root) (the-as collide-shape-moving s3-1)) ) ) ((3) - (let ((s3-2 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-2 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-15 (new 'process 'collide-shape-prim-mesh s3-2 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) @@ -257,11 +257,11 @@ (set! (-> s3-2 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s3-2 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-2)) + (set! (-> this root) (the-as collide-shape-moving s3-2)) ) ) ((4) - (let ((s3-3 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-3 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-21 (new 'process 'collide-shape-prim-mesh s3-3 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-21 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list)) @@ -276,11 +276,11 @@ (set! (-> s3-3 backup-collide-as) (-> v1-23 prim-core collide-as)) (set! (-> s3-3 backup-collide-with) (-> v1-23 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-3)) + (set! (-> this root) (the-as collide-shape-moving s3-3)) ) ) ((5) - (let ((s3-4 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-4 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-27 (new 'process 'collide-shape-prim-mesh s3-4 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-27 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-27 prim-core collide-with) (collide-spec jak bot player-list)) @@ -295,11 +295,11 @@ (set! (-> s3-4 backup-collide-as) (-> v1-29 prim-core collide-as)) (set! (-> s3-4 backup-collide-with) (-> v1-29 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-4)) + (set! (-> this root) (the-as collide-shape-moving s3-4)) ) ) ((6) - (let ((s3-5 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-5 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-33 (new 'process 'collide-shape-prim-mesh s3-5 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-33 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-33 prim-core collide-with) (collide-spec jak bot player-list)) @@ -314,11 +314,11 @@ (set! (-> s3-5 backup-collide-as) (-> v1-35 prim-core collide-as)) (set! (-> s3-5 backup-collide-with) (-> v1-35 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-5)) + (set! (-> this root) (the-as collide-shape-moving s3-5)) ) ) ((7) - (let ((s3-6 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-6 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-39 (new 'process 'collide-shape-prim-mesh s3-6 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-39 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-39 prim-core collide-with) (collide-spec jak bot player-list)) @@ -333,11 +333,11 @@ (set! (-> s3-6 backup-collide-as) (-> v1-41 prim-core collide-as)) (set! (-> s3-6 backup-collide-with) (-> v1-41 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-6)) + (set! (-> this root) (the-as collide-shape-moving s3-6)) ) ) (else - (let ((s3-7 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-7 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s2-0 (new 'process 'collide-shape-prim-group s3-7 (the-as uint 8) 0))) (set! (-> s3-7 total-prims) (the-as uint 9)) (set! (-> s2-0 prim-core collide-as) (collide-spec obstacle)) @@ -408,92 +408,92 @@ (set! (-> s3-7 backup-collide-as) (-> v1-68 prim-core collide-as)) (set! (-> s3-7 backup-collide-with) (-> v1-68 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-7)) + (set! (-> this root) (the-as collide-shape-moving s3-7)) ) ) ) - (set! (-> obj root trans quad) (-> arg0 quad)) + (set! (-> this root trans quad) (-> arg0 quad)) (case arg1 ((1) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-a" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((2) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-b" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((3) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-c" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((4) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-d" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((5) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-e" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((6) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-f" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((7) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-g" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) (else (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-main" (the-as (pointer uint32) #f)) @@ -502,16 +502,16 @@ ) ) ) - (set! (-> obj root pause-adjust-distance) 245760.0) - (set! (-> obj which-look) arg1) - (quaternion-set! (-> obj root quat) 0.0 1.0 0.0 0.0) + (set! (-> this root pause-adjust-distance) 245760.0) + (set! (-> this which-look) arg1) + (quaternion-set! (-> this root quat) 0.0 1.0 0.0 0.0) (transform-post) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-catwalk ((obj tomb-boss-catwalk) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boss-catwalk ((this tomb-boss-catwalk) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -519,11 +519,11 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (let ((a2-1 (res-lump-value arg0 'mode uint128 :time -1000000000.0))) - (tomb-boss-catwalk-method-22 obj (-> arg0 extra trans) (the-as int a2-1)) + (tomb-boss-catwalk-method-22 this (-> arg0 extra trans) (the-as int a2-1)) ) - (cleanup-for-death obj) - (deactivate obj) - (go (method-of-object obj idle)) + (cleanup-for-death this) + (deactivate this) + (go (method-of-object this idle)) (none) ) @@ -592,32 +592,32 @@ This commonly includes things such as: ;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 -(defmethod widow-bomb-method-34 widow-bomb ((obj widow-bomb)) +(defmethod widow-bomb-method-34 widow-bomb ((this widow-bomb)) (local-vars (sv-48 float) (sv-64 float)) (let ((s5-0 (new 'stack-no-clear 'quaternion)) (gp-0 (new 'stack-no-clear 'quaternion)) ) (let ((s3-0 quaternion-set!) (s2-0 s5-0) - (s1-0 (sin (* 0.5 (-> obj x-rotate)))) + (s1-0 (sin (* 0.5 (-> this x-rotate)))) (s0-0 0.0) ) (set! sv-48 (the-as float 0.0)) - (let ((t0-0 (cos (* 0.5 (-> obj x-rotate))))) + (let ((t0-0 (cos (* 0.5 (-> this x-rotate))))) (s3-0 s2-0 s1-0 s0-0 sv-48 t0-0) ) ) (let ((s3-1 quaternion-set!) (s2-1 gp-0) (s1-1 0.0) - (s0-1 (sin (* 0.5 (-> obj y-rotate)))) + (s0-1 (sin (* 0.5 (-> this y-rotate)))) ) (set! sv-64 (the-as float 0.0)) - (let ((t0-1 (cos (* 0.5 (-> obj y-rotate))))) + (let ((t0-1 (cos (* 0.5 (-> this y-rotate))))) (s3-1 s2-1 s1-1 s0-1 sv-64 t0-1) ) ) - (quaternion-normalize! (quaternion*! (-> obj spin-jm quat) gp-0 s5-0)) + (quaternion-normalize! (quaternion*! (-> this spin-jm quat) gp-0 s5-0)) ) 0 (none) @@ -758,10 +758,10 @@ This commonly includes things such as: :virtual #t :event widow-bomb-back-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (and (nonzero? (-> self fizzle-timer)) (>= (- (current-time) (-> self fizzle-timer)) (seconds 3))) + (if (and (nonzero? (-> self fizzle-timer)) (time-elapsed? (-> self fizzle-timer) (seconds 3))) (go-virtual explode) ) (+! (-> self x-rotate) 1092.2667) @@ -769,7 +769,7 @@ This commonly includes things such as: (widow-bomb-method-34 self) (spawn-with-cspace (-> self part) (-> self node-list data 3)) (cond - ((>= (- (current-time) (-> self state-time)) (seconds 4)) + ((time-elapsed? (-> self state-time) (seconds 4)) (go-virtual explode) ) (else @@ -797,7 +797,7 @@ This commonly includes things such as: :virtual #t :event widow-bomb-back-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (initialize (-> self impact) self @@ -811,14 +811,14 @@ This commonly includes things such as: ) ) :trans (behavior () - (if (and (nonzero? (-> self fizzle-timer)) (>= (- (current-time) (-> self fizzle-timer)) (seconds 3))) + (if (and (nonzero? (-> self fizzle-timer)) (time-elapsed? (-> self fizzle-timer) (seconds 3))) (go-virtual explode) ) (+! (-> self x-rotate) 4369.067) (+! (-> self y-rotate) 3458.8445) (widow-bomb-method-34 self) (cond - ((>= (- (current-time) (-> self state-time)) (the int (-> self traj time))) + ((time-elapsed? (-> self state-time) (the int (-> self traj time))) (compute-transv-at-time (-> self traj) (-> self traj time) (-> self root transv)) (vector-float*! (-> self root transv) (-> self root transv) 300.0) (go-virtual freefall) @@ -830,7 +830,7 @@ This commonly includes things such as: (-> self root trans) ) (update-from-cspace (-> self impact)) - (when (>= (- (current-time) (-> self state-time)) 1) + (when (time-elapsed? (-> self state-time) 1) (let* ((a1-4 (new 'stack-no-clear 'collide-query)) (f0-10 (impact-control-method-11 (-> self impact) @@ -885,11 +885,11 @@ This commonly includes things such as: ) 0 (sound-play "w-bomb-explode") - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (cond - ((< (- (current-time) (-> self state-time)) (seconds 2)) + ((not (time-elapsed? (-> self state-time) (seconds 2))) (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> self root trans quad)) (+! (-> a1-0 y) 2048.0) @@ -905,22 +905,22 @@ This commonly includes things such as: :post ja-post ) -(defmethod widow-bomb-method-32 widow-bomb ((obj widow-bomb)) - (spawn-with-cspace (-> obj part) (-> obj node-list data 3)) - (sound-play "w-bomb-steam" :id (-> obj steam-sound) :position (-> obj root trans)) - (let ((s5-0 (the-as int (- (current-time) (-> obj state-time))))) - (if (nonzero? (-> obj fizzle-timer)) +(defmethod widow-bomb-method-32 widow-bomb ((this widow-bomb)) + (spawn-with-cspace (-> this part) (-> this node-list data 3)) + (sound-play "w-bomb-steam" :id (-> this steam-sound) :position (-> this root trans)) + (let ((s5-0 (the-as int (- (current-time) (-> this state-time))))) + (if (nonzero? (-> this fizzle-timer)) (set! s5-0 - (max (the-as time-frame s5-0) (- (seconds 12) (- (seconds 3) (- (current-time) (-> obj fizzle-timer))))) + (max (the-as time-frame s5-0) (- (seconds 12) (- (seconds 3) (- (current-time) (-> this fizzle-timer))))) ) ) (if (< 3600 s5-0) - (go (method-of-object obj explode)) + (go (method-of-object this explode)) ) (when (< 3000 s5-0) - (spawn-with-cspace (-> obj warning-spark-part) (-> obj node-list data 3)) - (when (not (-> obj firework-sound-played)) - (set! (-> obj firework-sound-played) #t) + (spawn-with-cspace (-> this warning-spark-part) (-> this node-list data 3)) + (when (not (-> this firework-sound-played)) + (set! (-> this firework-sound-played) #t) (sound-play "w-bomb-firewrks") ) ) @@ -928,19 +928,19 @@ This commonly includes things such as: (a0-10 3600) (v1-28 (- (* a0-10 a0-10) v1-27)) ) - (when (< v1-28 (-> obj next-countdown-tick)) + (when (< v1-28 (-> this next-countdown-tick)) (let ((a0-14 540)) - (set! (-> obj next-countdown-tick) (the-as time-frame (- v1-28 (mod v1-28 (* a0-14 a0-14))))) + (set! (-> this next-countdown-tick) (the-as time-frame (- v1-28 (mod v1-28 (* a0-14 a0-14))))) ) (let ((s5-2 (new 'stack-no-clear 'vector))) - (vector<-cspace! s5-2 (-> obj node-list data 7)) - (spawn (-> obj warning-glow-part) s5-2) - (vector<-cspace! s5-2 (-> obj node-list data 6)) - (spawn (-> obj warning-glow-part) s5-2) - (vector<-cspace! s5-2 (-> obj node-list data 5)) - (spawn (-> obj warning-glow-part) s5-2) - (vector<-cspace! s5-2 (-> obj node-list data 4)) - (spawn (-> obj warning-glow-part) s5-2) + (vector<-cspace! s5-2 (-> this node-list data 7)) + (spawn (-> this warning-glow-part) s5-2) + (vector<-cspace! s5-2 (-> this node-list data 6)) + (spawn (-> this warning-glow-part) s5-2) + (vector<-cspace! s5-2 (-> this node-list data 5)) + (spawn (-> this warning-glow-part) s5-2) + (vector<-cspace! s5-2 (-> this node-list data 4)) + (spawn (-> this warning-glow-part) s5-2) ) (sound-play "w-bomb-timer") ) @@ -954,7 +954,7 @@ This commonly includes things such as: :virtual #t :event widow-bomb-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let* ((v1-2 3600) (v1-3 (* v1-2 v1-2)) (a0-0 540) @@ -974,19 +974,19 @@ This commonly includes things such as: :post ja-post ) -(defmethod widow-bomb-method-33 widow-bomb ((obj widow-bomb)) +(defmethod widow-bomb-method-33 widow-bomb ((this widow-bomb)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set-vector! (-> gp-0 vector 1) 0.0 1.0 0.0 1.0) - (vector-! (-> gp-0 vector 2) (the-as vector (-> obj impact trans)) (-> obj impact trans 1)) + (vector-! (-> gp-0 vector 2) (the-as vector (-> this impact trans)) (-> this impact trans 1)) (vector-cross! (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1) (-> gp-0 vector 2)) (vector-normalize! (the-as vector (-> gp-0 vector)) 1.0) (vector-cross! (-> gp-0 vector 2) (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1)) - (vector<-cspace! (-> gp-0 trans) (-> obj node-list data 3)) + (vector<-cspace! (-> gp-0 trans) (-> this node-list data 3)) (set! (-> gp-0 vector 0 w) 0.0) (set! (-> gp-0 vector 1 w) 0.0) (set! (-> gp-0 vector 2 w) 0.0) (set! (-> gp-0 trans w) 1.0) - (spawn-with-matrix (-> obj skid-part) gp-0) + (spawn-with-matrix (-> this skid-part) gp-0) ) (none) ) @@ -1027,7 +1027,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (initialize (-> self impact) self 3 4096.0 (collide-spec backgnd obstacle hit-by-others-list player-list)) ) :exit (behavior () @@ -1070,7 +1070,7 @@ This commonly includes things such as: ) ) (cond - ((>= (- (current-time) (-> self state-time)) (the int (-> self traj time))) + ((time-elapsed? (-> self state-time) (the int (-> self traj time))) (let ((v1-29 (-> self which-trajectory))) (cond ((zero? v1-29) @@ -1080,7 +1080,7 @@ This commonly includes things such as: (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) (-> self root trans) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self traj))))) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 12288.0) @@ -1097,7 +1097,7 @@ This commonly includes things such as: (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) (-> self root trans) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-4 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self traj))))) (set! (-> gp-4 y) 0.0) (vector-normalize! gp-4 4096.0) @@ -1136,7 +1136,7 @@ This commonly includes things such as: (-> self root trans) ) (when (and (zero? (-> self which-trajectory)) - (< (- (current-time) (-> self state-time)) (the int (* 0.75 (-> self traj time)))) + (not (time-elapsed? (-> self state-time) (the int (* 0.75 (-> self traj time))))) ) (vector+float*! (-> self launch-pos) (-> self launch-pos) (-> self launch) (-> self clock time-adjust-ratio)) (vector-lerp! @@ -1151,7 +1151,7 @@ This commonly includes things such as: (spawn-with-cspace (-> self trail-part) (-> self node-list data 3)) (when (zero? (-> self which-trajectory)) (update-from-cspace (-> self impact)) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (when (time-elapsed? (-> self state-time) (seconds 0.05)) (let ((f0-42 (impact-control-method-11 (-> self impact) (new 'stack-no-clear 'collide-query) @@ -1177,49 +1177,49 @@ This commonly includes things such as: ) ) -(defmethod deactivate widow-bomb ((obj widow-bomb)) - (if (nonzero? (-> obj explode-part)) - (kill-and-free-particles (-> obj explode-part)) +(defmethod deactivate widow-bomb ((this widow-bomb)) + (if (nonzero? (-> this explode-part)) + (kill-and-free-particles (-> this explode-part)) ) - (if (nonzero? (-> obj trail-part)) - (kill-and-free-particles (-> obj trail-part)) + (if (nonzero? (-> this trail-part)) + (kill-and-free-particles (-> this trail-part)) ) - (if (nonzero? (-> obj warning-glow-part)) - (kill-and-free-particles (-> obj warning-glow-part)) + (if (nonzero? (-> this warning-glow-part)) + (kill-and-free-particles (-> this warning-glow-part)) ) - (if (nonzero? (-> obj warning-spark-part)) - (kill-and-free-particles (-> obj warning-spark-part)) + (if (nonzero? (-> this warning-spark-part)) + (kill-and-free-particles (-> this warning-spark-part)) ) - (if (nonzero? (-> obj skid-part)) - (kill-and-free-particles (-> obj warning-spark-part)) + (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)) obj) + ((the-as (function process-drawable none) (find-parent-method widow-bomb 10)) this) (none) ) ;; WARN: Return type mismatch process-drawable vs widow-bomb. -(defmethod relocate widow-bomb ((obj widow-bomb) (arg0 int)) - (if (nonzero? (-> obj explode-part)) - (&+! (-> obj explode-part) arg0) +(defmethod relocate widow-bomb ((this widow-bomb) (arg0 int)) + (if (nonzero? (-> this explode-part)) + (&+! (-> this explode-part) arg0) ) - (if (nonzero? (-> obj trail-part)) - (&+! (-> obj trail-part) arg0) + (if (nonzero? (-> this trail-part)) + (&+! (-> this trail-part) arg0) ) - (if (nonzero? (-> obj warning-glow-part)) - (&+! (-> obj warning-glow-part) arg0) + (if (nonzero? (-> this warning-glow-part)) + (&+! (-> this warning-glow-part) arg0) ) - (if (nonzero? (-> obj warning-spark-part)) - (&+! (-> obj warning-spark-part) arg0) + (if (nonzero? (-> this warning-spark-part)) + (&+! (-> this warning-spark-part) arg0) ) - (if (nonzero? (-> obj skid-part)) - (&+! (-> obj skid-part) arg0) + (if (nonzero? (-> this skid-part)) + (&+! (-> this skid-part) arg0) ) - (if (nonzero? (-> obj spin-jm)) - (&+! (-> obj spin-jm) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method widow-bomb 7)) this arg0) ) ) @@ -1486,10 +1486,10 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self draw bounds w) 245760.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (< (- (current-time) (-> self state-time)) (seconds 1)) + (if (not (time-elapsed? (-> self state-time) (seconds 1))) (spawn-with-cspace (-> self explode-part) (-> self node-list data 6)) ) (let ((v1-9 (ja-group))) @@ -1526,7 +1526,7 @@ This commonly includes things such as: ((>= (-> self segs-shot) 16) (go-virtual break-it) ) - ((>= (- (current-time) (-> self last-pillar-hit)) (seconds 2)) + ((time-elapsed? (-> self last-pillar-hit) (seconds 2)) (process-spawn part-tracker :init part-tracker-init @@ -1538,7 +1538,7 @@ This commonly includes things such as: 0 :to *entity-pool* ) - (set! (-> self last-pillar-hit) (current-time)) + (set-time! (-> self last-pillar-hit)) (sound-play "pillar-hit" :position (-> self root trans)) ) ) @@ -1553,7 +1553,7 @@ This commonly includes things such as: (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (let ((v1-2 (-> self entity extra perm))) @@ -1564,34 +1564,34 @@ This commonly includes things such as: :code sleep-code ) -(defmethod deactivate tomb-boss-pillar ((obj tomb-boss-pillar)) - (if (nonzero? (-> obj explode-part)) - (kill-and-free-particles (-> obj explode-part)) +(defmethod deactivate tomb-boss-pillar ((this tomb-boss-pillar)) + (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)) obj) + ((the-as (function process-drawable none) (find-parent-method tomb-boss-pillar 10)) this) (none) ) ;; WARN: Return type mismatch process-drawable vs tomb-boss-pillar. -(defmethod relocate tomb-boss-pillar ((obj tomb-boss-pillar) (arg0 int)) - (if (nonzero? (-> obj explode-part)) - (&+! (-> obj explode-part) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method tomb-boss-pillar 7)) this arg0) ) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-pillar ((obj tomb-boss-pillar) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boss-pillar ((this tomb-boss-pillar) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1620,25 +1620,25 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-pillar" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (set! (-> obj explode-part) (create-launch-control (-> *part-group-id-table* 719) obj)) - (set! (-> obj last-pillar-hit) 0) - (let ((v1-23 (-> obj entity extra perm))) + (set! (-> this explode-part) (create-launch-control (-> *part-group-id-table* 719) this)) + (set! (-> this last-pillar-hit) 0) + (let ((v1-23 (-> this entity extra perm))) (logior! (-> v1-23 status) (entity-perm-status bit-5)) - (set! (-> obj segs-shot) (the-as int (-> v1-23 user-object 1))) + (set! (-> this segs-shot) (the-as int (-> v1-23 user-object 1))) ) (damage-pillar) - (if (>= (-> obj segs-shot) 16) - (go (method-of-object obj broken)) - (go (method-of-object obj idle)) + (if (>= (-> this segs-shot) 16) + (go (method-of-object this broken)) + (go (method-of-object this idle)) ) (none) ) @@ -1793,14 +1793,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-firepot ((obj tomb-boss-firepot) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boss-firepot ((this tomb-boss-firepot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1829,98 +1829,98 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-firepot" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj root pause-adjust-distance) 245760.0) + (set! (-> this root pause-adjust-distance) 245760.0) (transform-post) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj broken)) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this broken)) + (go (method-of-object this idle)) ) (none) ) -(defmethod draw hud-widow ((obj hud-widow)) - (set-hud-piece-position! (-> obj sprites 1) (the int (+ 462.0 (* 130.0 (-> obj offset)))) 350) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -32 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 1)) -62 14) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 1)) -32 14) - (let ((s5-0 (-> obj values 0 current)) - (f30-0 (* 0.01 (the float (-> obj values 1 current)))) +(defmethod draw hud-widow ((this hud-widow)) + (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites 1)) -32 14) + (let ((s5-0 (-> this values 0 current)) + (f30-0 (* 0.01 (the float (-> this values 1 current)))) ) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 1)) -92 15) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 1)) -92 15) (cond ((= s5-0 1) - (set! (-> obj sprites 4 color x) 0) - (set! (-> obj sprites 4 color y) 255) + (set! (-> this sprites 4 color x) 0) + (set! (-> this sprites 4 color y) 255) (set! f30-0 (+ 2.0 f30-0)) ) ((= s5-0 2) - (set! (-> obj sprites 4 color y) 255) - (set! (-> obj sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 255) + (set! (-> this sprites 4 color x) 255) (set! f30-0 (+ 1.0 f30-0)) ) ((= s5-0 3) - (set! (-> obj sprites 4 color x) 255) - (set! (-> obj sprites 4 color y) 0) + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 0) 0 ) (else (set! f30-0 0.0) ) ) - (set! (-> obj sprites 4 scale-x) (* -7.25 f30-0)) + (set! (-> this sprites 4 scale-x) (* -7.25 f30-0)) ) - (let ((f30-1 (* 0.01 (the float (-> obj values 2 current))))) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 1)) -84 4) + (let ((f30-1 (* 0.01 (the float (-> this values 2 current))))) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 1)) -84 4) (cond ((< f30-1 0.5) - (set! (-> obj sprites 3 color x) 255) - (set! (-> obj sprites 3 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-1)))) + (set! (-> this sprites 3 color x) 255) + (set! (-> this sprites 3 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-1)))) ) (else - (set! (-> obj sprites 3 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-1))))) - (set! (-> obj sprites 3 color y) 255) + (set! (-> this sprites 3 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-1))))) + (set! (-> this sprites 3 color y) 255) ) ) - (set! (-> obj sprites 3 scale-x) (* -18.25 f30-1)) + (set! (-> this sprites 3 scale-x) (* -18.25 f30-1)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod init-callback hud-widow ((obj hud-widow)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-widow ((this hud-widow)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj values 0 target) 1) - (set! (-> obj values 1 target) 100) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 5 scale-x) 0.5) - (set! (-> obj sprites 5 flags) (the-as uint 4)) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 6 scale-x) 0.5) - (set! (-> obj sprites 6 flags) (the-as uint 4)) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 4 scale-y) 3.25) - (set! (-> obj sprites 4 color z) 0) - (set! (-> obj sprites 4 flags) (the-as uint 4)) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 3 scale-y) 1.5) - (set! (-> obj sprites 3 color z) 0) - (set! (-> obj sprites 3 flags) (the-as uint 4)) + (set! (-> this values 0 target) 1) + (set! (-> this values 1 target) 100) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 5 scale-x) 0.5) + (set! (-> this sprites 5 flags) (the-as uint 4)) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 6 scale-x) 0.5) + (set! (-> this sprites 6 flags) (the-as uint 4)) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 4 scale-y) 3.25) + (set! (-> this sprites 4 color z) 0) + (set! (-> this sprites 4 flags) (the-as uint 4)) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 3 scale-y) 1.5) + (set! (-> this sprites 3 color z) 0) + (set! (-> this sprites 3 flags) (the-as uint 4)) 0 (none) ) diff --git a/goal_src/jak2/levels/tomb/widow-more-extras.gc b/goal_src/jak2/levels/tomb/widow-more-extras.gc index f943c22a81..229b63ee49 100644 --- a/goal_src/jak2/levels/tomb/widow-more-extras.gc +++ b/goal_src/jak2/levels/tomb/widow-more-extras.gc @@ -453,7 +453,7 @@ (defstate idle (cave-in-master) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (spawn (-> self part) (-> self root trans)) @@ -482,25 +482,25 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cave-in-master ((obj cave-in-master) (arg0 entity-actor)) +(defmethod init-from-entity! cave-in-master ((this cave-in-master) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (if (-> obj path) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (if (-> this path) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) ) - (+! (-> obj root trans y) 327680.0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (+! (-> this root trans y) 327680.0) + (logclear! (-> this mask) (process-mask actor-pause)) (dotimes (v1-12 100) - (set! (-> obj prev-points v1-12) 0) + (set! (-> this prev-points v1-12) 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 737) obj)) - (go (method-of-object obj wait)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 737) this)) + (go (method-of-object this wait)) (none) ) diff --git a/goal_src/jak2/levels/tomb/widow2.gc b/goal_src/jak2/levels/tomb/widow2.gc index 96ac93c98b..820944ae6c 100644 --- a/goal_src/jak2/levels/tomb/widow2.gc +++ b/goal_src/jak2/levels/tomb/widow2.gc @@ -7,27 +7,27 @@ ;; DECOMP BEGINS -(defmethod deal-damage! widow-shot ((obj widow-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! widow-shot ((this widow-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) - (when (t9-0 obj arg0 arg1) - (set! (-> obj hit-actor?) #t) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) (if (= arg0 *target*) - (send-event (ppointer->process (-> obj parent)) 'shot-hit-target) + (send-event (ppointer->process (-> this parent)) 'shot-hit-target) ) #t ) ) ) -(defmethod widow-method-44 widow ((obj widow) (arg0 vector) (arg1 vector)) +(defmethod widow-method-44 widow ((this widow) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 start-pos quad) (-> arg0 quad)) (vector-normalize-copy! (-> gp-0 move-dist) arg1 81920.0) (let ((v1-1 gp-0)) (set! (-> v1-1 radius) 4096.0) (set! (-> v1-1 collide-with) (collide-spec enemy hit-by-others-list)) - (set! (-> v1-1 ignore-process0) obj) + (set! (-> v1-1 ignore-process0) this) (set! (-> v1-1 ignore-process1) #f) (set! (-> v1-1 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-1 action-mask) (collide-action solid deadly)) @@ -40,18 +40,18 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod widow-method-45 widow ((obj widow) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod widow-method-45 widow ((this widow) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((f30-0 (/ 2013265900.0 (vector-length arg2))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options account-for-target-velocity)) (set! (-> s5-0 pos quad) (-> arg1 quad)) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (let* ((v1-13 *game-info*) (a0-12 (+ (-> v1-13 attack-id) 1)) ) @@ -69,7 +69,7 @@ ) (vector+! (-> s5-0 vel) (-> s5-0 vel) s3-0) ) - (spawn-projectile widow-shot s5-0 obj *default-dead-pool*) + (spawn-projectile widow-shot s5-0 this *default-dead-pool*) ) (if arg0 (sound-play "widow-fire") @@ -77,109 +77,109 @@ (none) ) -(defmethod widow-method-46 widow ((obj widow) (arg0 vector) (arg1 int)) - (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg1))) +(defmethod widow-method-46 widow ((this widow) (arg0 vector) (arg1 int)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> obj node-list data arg1 bone transform vector 1 quad)) - (if (widow-method-44 obj s4-0 s3-0) - (widow-method-45 obj arg0 s4-0 s3-0) + (set! (-> s3-0 quad) (-> this node-list data arg1 bone transform vector 1 quad)) + (if (widow-method-44 this s4-0 s3-0) + (widow-method-45 this arg0 s4-0 s3-0) ) ) 0 (none) ) -(defmethod deactivate widow ((obj widow)) - (if (nonzero? (-> obj drill-spark-part)) - (kill-and-free-particles (-> obj drill-spark-part)) +(defmethod deactivate widow ((this widow)) + (if (nonzero? (-> this drill-spark-part)) + (kill-and-free-particles (-> this drill-spark-part)) ) - (if (nonzero? (-> obj drill-spark-part-alt)) - (kill-and-free-particles (-> obj drill-spark-part-alt)) + (if (nonzero? (-> this drill-spark-part-alt)) + (kill-and-free-particles (-> this drill-spark-part-alt)) ) - (if (nonzero? (-> obj extract-stone-part)) - (kill-and-free-particles (-> obj extract-stone-part)) + (if (nonzero? (-> this extract-stone-part)) + (kill-and-free-particles (-> this extract-stone-part)) ) - (if (nonzero? (-> obj insert-stone-part)) - (kill-and-free-particles (-> obj insert-stone-part)) + (if (nonzero? (-> this insert-stone-part)) + (kill-and-free-particles (-> this insert-stone-part)) ) - (if (nonzero? (-> obj land-part)) - (kill-and-free-particles (-> obj land-part)) + (if (nonzero? (-> this land-part)) + (kill-and-free-particles (-> this land-part)) ) - (if (nonzero? (-> obj green-charge-part)) - (kill-and-free-particles (-> obj green-charge-part)) + (if (nonzero? (-> this green-charge-part)) + (kill-and-free-particles (-> this green-charge-part)) ) - (if (nonzero? (-> obj green-fire-part)) - (kill-and-free-particles (-> obj green-fire-part)) + (if (nonzero? (-> this green-fire-part)) + (kill-and-free-particles (-> this green-fire-part)) ) - (if (-> obj drill-sound-playing) - (sound-stop (-> obj drill-sound)) + (if (-> this drill-sound-playing) + (sound-stop (-> this drill-sound)) ) - (if (-> obj drill-sweeten-sound-playing) - (sound-stop (-> obj drill-sweeten-sound)) + (if (-> this drill-sweeten-sound-playing) + (sound-stop (-> this drill-sweeten-sound)) ) - (if (-> obj hover-sound-playing) - (sound-stop (-> obj hover-sound)) + (if (-> this hover-sound-playing) + (sound-stop (-> this hover-sound)) ) - (if (-> obj shake-sound-playing) - (sound-stop (-> obj shake-sound)) + (if (-> this shake-sound-playing) + (sound-stop (-> this shake-sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch process-drawable vs widow. -(defmethod relocate widow ((obj widow) (arg0 int)) - (if (nonzero? (-> obj left-cover-jm)) - (&+! (-> obj left-cover-jm) arg0) +(defmethod relocate widow ((this widow) (arg0 int)) + (if (nonzero? (-> this left-cover-jm)) + (&+! (-> this left-cover-jm) arg0) ) - (if (nonzero? (-> obj right-cover-jm)) - (&+! (-> obj right-cover-jm) arg0) + (if (nonzero? (-> this right-cover-jm)) + (&+! (-> this right-cover-jm) arg0) ) - (if (nonzero? (-> obj left-drill-jm)) - (&+! (-> obj left-drill-jm) arg0) + (if (nonzero? (-> this left-drill-jm)) + (&+! (-> this left-drill-jm) arg0) ) - (if (nonzero? (-> obj right-drill-jm)) - (&+! (-> obj right-drill-jm) arg0) + (if (nonzero? (-> this right-drill-jm)) + (&+! (-> this right-drill-jm) arg0) ) - (if (nonzero? (-> obj drill-spark-part)) - (&+! (-> obj drill-spark-part) arg0) + (if (nonzero? (-> this drill-spark-part)) + (&+! (-> this drill-spark-part) arg0) ) - (if (nonzero? (-> obj drill-spark-part-alt)) - (&+! (-> obj drill-spark-part-alt) arg0) + (if (nonzero? (-> this drill-spark-part-alt)) + (&+! (-> this drill-spark-part-alt) arg0) ) - (if (nonzero? (-> obj extract-stone-part)) - (&+! (-> obj extract-stone-part) arg0) + (if (nonzero? (-> this extract-stone-part)) + (&+! (-> this extract-stone-part) arg0) ) - (if (nonzero? (-> obj insert-stone-part)) - (&+! (-> obj insert-stone-part) arg0) + (if (nonzero? (-> this insert-stone-part)) + (&+! (-> this insert-stone-part) arg0) ) - (if (nonzero? (-> obj land-part)) - (&+! (-> obj land-part) arg0) + (if (nonzero? (-> this land-part)) + (&+! (-> this land-part) arg0) ) - (if (nonzero? (-> obj green-charge-part)) - (&+! (-> obj green-charge-part) arg0) + (if (nonzero? (-> this green-charge-part)) + (&+! (-> this green-charge-part) arg0) ) - (if (nonzero? (-> obj green-fire-part)) - (&+! (-> obj green-fire-part) arg0) + (if (nonzero? (-> this green-fire-part)) + (&+! (-> this green-fire-part) arg0) ) (dotimes (v1-44 5) - (if (nonzero? (-> obj lightning v1-44)) - (&+! (-> obj lightning v1-44) arg0) + (if (nonzero? (-> this lightning v1-44)) + (&+! (-> this lightning v1-44) arg0) ) ) - (the-as widow ((method-of-type process-drawable relocate) obj arg0)) + (the-as widow ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! widow ((obj widow) (arg0 entity-actor)) +(defmethod init-from-entity! widow ((this widow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -225,21 +225,21 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-widow" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (setup-masks (-> obj draw) 0 126) - (set! (-> obj root pause-adjust-distance) 245760.0) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (setup-masks (-> this draw) 0 126) + (set! (-> this root pause-adjust-distance) 245760.0) (dotimes (v1-26 8) - (set! (-> obj catwalk v1-26) (the-as handle #f)) + (set! (-> this catwalk v1-26) (the-as handle #f)) ) - (let ((s4-2 (-> obj entity extra perm))) + (let ((s4-2 (-> this entity extra perm))) (logior! (-> s4-2 status) (entity-perm-status bit-5)) 0 (let ((s3-2 (new 'stack-no-clear 'vector))) @@ -249,105 +249,105 @@ This commonly includes things such as: (dotimes (s5-1 8) (cond ((not (logtest? (the-as int (-> s4-2 user-object 1)) (ash 1 s5-1))) - (set! (-> obj catwalk s5-1) (ppointer->handle (process-spawn tomb-boss-catwalk s3-2 s5-1 :to obj))) - (if (not (handle->process (-> obj catwalk s5-1))) + (set! (-> this catwalk s5-1) (ppointer->handle (process-spawn tomb-boss-catwalk s3-2 s5-1 :to this))) + (if (not (handle->process (-> this catwalk s5-1))) (format 0 "catwalk ~D failed to spawn~%" s5-1) ) ) (else - (send-event (handle->process (-> obj catwalk 0)) 'catwalk-hit s5-1) + (send-event (handle->process (-> this catwalk 0)) 'catwalk-hit s5-1) ) ) ) ) ) (dotimes (v1-62 8) - (set! (-> obj bomb v1-62) (the-as handle #f)) + (set! (-> this bomb v1-62) (the-as handle #f)) ) (dotimes (v1-65 2) - (set! (-> obj ammos v1-65) (the-as handle #f)) - (set! (-> obj ammo-timers v1-65) 0) + (set! (-> this ammos v1-65) (the-as handle #f)) + (set! (-> this ammo-timers v1-65) 0) ) - (set! (-> obj attack-from-high-deg) #f) - (set! (-> obj which-gun) 0) - (set! (-> obj which-pod) 0) - (set! (-> obj bomb-hits) 0) - (set! (-> obj flying) #f) - (set! (-> obj previous-anim) 0) - (set! (-> obj circle-center quad) (-> obj root trans quad)) - (+! (-> obj circle-center z) 40960.0) - (init (-> obj theta) 0.0 0.01 91.022224 0.9) - (init (-> obj tilt) 0.0 0.01 91.022224 0.9) - (set! (-> obj left-cover-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 90)) - (set! (-> obj right-cover-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 91)) - (widow-float-seeker-method-9 (-> obj left-cover-angle) 0.0 0.01 0.1 0.9 0.25) - (widow-float-seeker-method-9 (-> obj right-cover-angle) 0.0 0.01 0.1 0.9 0.25) - (set! (-> obj left-drill-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 11)) - (set! (-> obj right-drill-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 44)) - (init (-> obj drill-speed) 0.0 0.01 0.1 0.9) + (set! (-> this attack-from-high-deg) #f) + (set! (-> this which-gun) 0) + (set! (-> this which-pod) 0) + (set! (-> this bomb-hits) 0) + (set! (-> this flying) #f) + (set! (-> this previous-anim) 0) + (set! (-> this circle-center quad) (-> this root trans quad)) + (+! (-> this circle-center z) 40960.0) + (init (-> this theta) 0.0 0.01 91.022224 0.9) + (init (-> this tilt) 0.0 0.01 91.022224 0.9) + (set! (-> this left-cover-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 90)) + (set! (-> this right-cover-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 91)) + (widow-float-seeker-method-9 (-> this left-cover-angle) 0.0 0.01 0.1 0.9 0.25) + (widow-float-seeker-method-9 (-> this right-cover-angle) 0.0 0.01 0.1 0.9 0.25) + (set! (-> this left-drill-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 11)) + (set! (-> this right-drill-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 44)) + (init (-> this drill-speed) 0.0 0.01 0.1 0.9) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> obj root trans quad)) - (set! (-> obj baron) (process-spawn - manipy - :init manipy-init - s5-2 - (-> obj entity) - (art-group-get-by-name *level* "skel-baron" (the-as (pointer uint32) #f)) - #f - 0 - :to obj - ) + (set! (-> s5-2 quad) (-> this root trans quad)) + (set! (-> this baron) (process-spawn + manipy + :init manipy-init + s5-2 + (-> this entity) + (art-group-get-by-name *level* "skel-baron" (the-as (pointer uint32) #f)) + #f + 0 + :to this + ) ) ) - (logior! (-> obj baron 0 draw global-effect) (draw-control-global-effect disable-envmap)) - (send-event (ppointer->process (-> obj baron)) 'anim-mode 'clone-anim) - (set! (-> obj baron 0 draw light-index) (mod (-> obj draw light-index) (the-as uint 10))) - (let ((v1-106 (-> obj baron))) + (logior! (-> this baron 0 draw global-effect) (draw-control-global-effect disable-envmap)) + (send-event (ppointer->process (-> this baron)) 'anim-mode 'clone-anim) + (set! (-> this baron 0 draw light-index) (mod (-> this draw light-index) (the-as uint 10))) + (let ((v1-106 (-> this baron))) (if v1-106 (logclear! (-> v1-106 0 mask) (process-mask actor-pause)) ) ) - (set! (-> obj pod) (ppointer->handle (process-spawn baron-pod (-> obj root trans) :to obj))) - (set! (-> obj heart) (the-as handle #f)) - (set! (-> obj drill-spark-part) (create-launch-control (-> *part-group-id-table* 713) obj)) - (set! (-> obj drill-spark-part-alt) (create-launch-control (-> *part-group-id-table* 714) obj)) - (set! (-> obj extract-stone-time) 0) - (set! (-> obj extract-stone-part) (create-launch-control (-> *part-group-id-table* 715) obj)) - (set! (-> obj insert-stone-time) 0) - (set! (-> obj insert-stone-part) (create-launch-control (-> *part-group-id-table* 716) obj)) - (set! (-> obj land-part) (create-launch-control (-> *part-group-id-table* 730) obj)) - (set! (-> obj green-charge-part) (create-launch-control (-> *part-group-id-table* 731) obj)) - (set! (-> obj green-fire-part) (create-launch-control (-> *part-group-id-table* 732) obj)) - (add-connection *part-engine* obj 73 obj 3251 (new 'static 'vector :w 819200.0)) - (add-connection *part-engine* obj 77 obj 3251 (new 'static 'vector :w 819200.0)) - (add-connection *part-engine* obj 78 obj 3251 (new 'static 'vector :w 819200.0)) + (set! (-> this pod) (ppointer->handle (process-spawn baron-pod (-> this root trans) :to this))) + (set! (-> this heart) (the-as handle #f)) + (set! (-> this drill-spark-part) (create-launch-control (-> *part-group-id-table* 713) this)) + (set! (-> this drill-spark-part-alt) (create-launch-control (-> *part-group-id-table* 714) this)) + (set! (-> this extract-stone-time) 0) + (set! (-> this extract-stone-part) (create-launch-control (-> *part-group-id-table* 715) this)) + (set! (-> this insert-stone-time) 0) + (set! (-> this insert-stone-part) (create-launch-control (-> *part-group-id-table* 716) this)) + (set! (-> this land-part) (create-launch-control (-> *part-group-id-table* 730) this)) + (set! (-> this green-charge-part) (create-launch-control (-> *part-group-id-table* 731) this)) + (set! (-> this green-fire-part) (create-launch-control (-> *part-group-id-table* 732) this)) + (add-connection *part-engine* this 73 this 3251 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 77 this 3251 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 78 this 3251 (new 'static 'vector :w 819200.0)) (dotimes (s5-4 5) - (set! (-> obj lightning s5-4) (new - 'process - 'lightning-control - (new 'static 'lightning-spec - :name #f - :flags (lightning-spec-flags lsf0) - :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) - :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) - :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) - :fade-start-factor 0.2 - :fade-time 120.0 - :texture (new 'static 'texture-id :index #x7 :page #x8c7) - :reduction 0.4 - :num-points 48 - :box-size 57344.0 - :merge-factor 0.5 - :merge-count 2 - :radius 9216.0 - :duration -1.0 - :sound #f - ) - obj - 0.0 - ) + (set! (-> this lightning s5-4) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x7 :page #x8c7) + :reduction 0.4 + :num-points 48 + :box-size 57344.0 + :merge-factor 0.5 + :merge-count 2 + :radius 9216.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) ) - (let ((v1-148 (-> obj lightning s5-4)) + (let ((v1-148 (-> this lightning s5-4)) (a0-97 0) ) (let ((a1-48 (!= a0-97 (-> v1-148 state mode)))) @@ -366,34 +366,34 @@ This commonly includes things such as: (set! (-> v1-148 state mode) (the-as lightning-mode a0-97)) ) ) - (set! (-> obj catwalk-sound) (new-sound-id)) - (set! (-> obj drill-sound) (new-sound-id)) - (set! (-> obj drill-sound-playing) #f) - (set! (-> obj drill-sweeten-sound) (new-sound-id)) - (set! (-> obj drill-sweeten-sound-playing) #f) - (set! (-> obj hover-sound) (new-sound-id)) - (set! (-> obj hover-sound-playing) #f) - (set! (-> obj shake-sound) (new-sound-id)) - (set! (-> obj shake-sound-playing) #f) - (set! (-> obj hud) (the-as handle #f)) - (set! (-> obj last-want-stone-talker) 0) - (set! (-> obj last-general-flying-talker) 0) - (set! (-> obj last-launch-droids-talker) 0) - (set! (-> obj last-launch-bombs-talker) 0) - (set! (-> obj last-shoot-gun-talker) 0) - (set! (-> obj last-stone-charge-up-talker) 0) - (set! (-> obj last-after-stone-shot-talker) 0) - (set! (-> obj last-leave-perch-talker) 0) - (set! (-> obj last-damaged-talker) 0) - (set! (-> obj kicked-bombs) 0) - (set! (-> obj launch-stages-completed) 0) - (set! (-> obj current-shoot-stage) 0) - (set! (-> obj last-gun-hit-stage) 0) - (set! (-> obj gun-hits) 0) - (set! (-> obj last-attack-id) (the-as uint 0)) + (set! (-> this catwalk-sound) (new-sound-id)) + (set! (-> this drill-sound) (new-sound-id)) + (set! (-> this drill-sound-playing) #f) + (set! (-> this drill-sweeten-sound) (new-sound-id)) + (set! (-> this drill-sweeten-sound-playing) #f) + (set! (-> this hover-sound) (new-sound-id)) + (set! (-> this hover-sound-playing) #f) + (set! (-> this shake-sound) (new-sound-id)) + (set! (-> this shake-sound-playing) #f) + (set! (-> this hud) (the-as handle #f)) + (set! (-> this last-want-stone-talker) 0) + (set! (-> this last-general-flying-talker) 0) + (set! (-> this last-launch-droids-talker) 0) + (set! (-> this last-launch-bombs-talker) 0) + (set! (-> this last-shoot-gun-talker) 0) + (set! (-> this last-stone-charge-up-talker) 0) + (set! (-> this last-after-stone-shot-talker) 0) + (set! (-> this last-leave-perch-talker) 0) + (set! (-> this last-damaged-talker) 0) + (set! (-> this kicked-bombs) 0) + (set! (-> this launch-stages-completed) 0) + (set! (-> this current-shoot-stage) 0) + (set! (-> this last-gun-hit-stage) 0) + (set! (-> this gun-hits) 0) + (set! (-> this last-attack-id) (the-as uint 0)) (if (task-node-closed? (game-task-node tomb-boss-resolution)) - (go (method-of-object obj beaten)) - (go (method-of-object obj hidden)) + (go (method-of-object this beaten)) + (go (method-of-object this hidden)) ) (none) ) diff --git a/goal_src/jak2/levels/under/centipede.gc b/goal_src/jak2/levels/under/centipede.gc index b3d9a24f09..4966e54f3f 100644 --- a/goal_src/jak2/levels/under/centipede.gc +++ b/goal_src/jak2/levels/under/centipede.gc @@ -176,76 +176,76 @@ (set! (-> *centipede-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod general-event-handler centipede ((obj centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler centipede ((this centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('under-break-floor) - (go (method-of-object obj thru-grating)) + (go (method-of-object this thru-grating)) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; WARN: Return type mismatch nav-enemy vs centipede. -(defmethod relocate centipede ((obj centipede) (arg0 int)) - (if (nonzero? (-> obj bobbing)) - (&+! (-> obj bobbing) arg0) +(defmethod relocate centipede ((this centipede) (arg0 int)) + (if (nonzero? (-> this bobbing)) + (&+! (-> this bobbing) arg0) ) - (if (nonzero? (-> obj legs-sound)) - (&+! (-> obj legs-sound) arg0) + (if (nonzero? (-> this legs-sound)) + (&+! (-> this legs-sound) arg0) ) - (the-as centipede ((method-of-type nav-enemy relocate) obj arg0)) + (the-as centipede ((method-of-type nav-enemy relocate) this arg0)) ) -(defmethod deactivate centipede ((obj centipede)) - (when (-> obj set-camera-mode?) - (set! (-> obj set-camera-mode?) #f) +(defmethod deactivate centipede ((this centipede)) + (when (-> this set-camera-mode?) + (set! (-> this set-camera-mode?) #f) (remove-setting-by-arg0 *setting-control* 'mode-name) ) - (if (nonzero? (-> obj legs-sound)) - (stop! (-> obj legs-sound)) + (if (nonzero? (-> this legs-sound)) + (stop! (-> this legs-sound)) ) - ((method-of-type nav-enemy deactivate) obj) + ((method-of-type nav-enemy deactivate) this) (none) ) ;; WARN: Return type mismatch float vs none. -(defmethod centipede-method-187 centipede ((obj centipede)) - (let ((centipede-cam (-> obj cam))) +(defmethod centipede-method-187 centipede ((this centipede)) + (let ((centipede-cam (-> this cam))) (let ((cam-dir (new 'stack-no-clear 'vector))) (set! (-> cam-dir quad) (-> centipede-cam dir quad)) - (vector-z-quaternion! (-> centipede-cam dir) (-> obj root quat)) + (vector-z-quaternion! (-> centipede-cam dir) (-> this root quat)) (set! (-> centipede-cam dir y) 0.0) (vector-normalize! (-> centipede-cam dir) 1.0) - (set! (-> centipede-cam trans quad) (-> obj root trans quad)) + (set! (-> centipede-cam trans quad) (-> this root trans quad)) (set! (-> centipede-cam trans y) (+ 32768.0 (* (+ (* 2048.0 (cos (* 218.45334 (the float (mod (current-time) 300))))) (* 614.4 (cos (* 68.91272 (the float (mod (current-time) 951))))) ) - (-> obj bobbing-intensity) + (-> this bobbing-intensity) ) (-> centipede-cam trans y) ) ) - (if (= (-> obj id) 1) + (if (= (-> this id) 1) (set! (-> centipede-cam dir y) -0.574) (set! (-> centipede-cam dir y) -0.474) ) (vector-normalize! (-> centipede-cam dir) 1.0) - (let ((proc (handle->process (-> obj focus handle))) + (let ((proc (handle->process (-> this focus handle))) (s3-0 #f) ) - (when (and proc (not (and (-> obj next-state) (let ((v1-27 (-> obj next-state name))) - (or (= v1-27 'attack) (= v1-27 'attack-failed)) - ) + (when (and proc (not (and (-> this next-state) (let ((v1-27 (-> this next-state name))) + (or (= v1-27 'attack) (= v1-27 'attack-failed)) + ) ) ) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (vector-! s2-0 (get-trans (the-as process-focusable proc) 0) (-> obj root trans)) + (vector-! s2-0 (get-trans (the-as process-focusable proc) 0) (-> this root trans)) (vector-normalize! s2-0 1.0) (when (>= (vector-dot s2-0 (-> centipede-cam dir)) 0.342) (let ((f0-23 (fmax @@ -313,75 +313,75 @@ (none) ) -(defmethod centipede-method-188 centipede ((obj centipede)) +(defmethod centipede-method-188 centipede ((this centipede)) (local-vars (s5-0 art-element)) - (let ((janim (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((janim (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and janim (= janim (-> obj draw art-group data 4))) + ((and janim (= janim (-> this draw art-group data 4))) (when (ja-done? 1) - (-> obj draw art-group data 7) - (let ((v1-10 (get-rand-int obj 100)) - (a0-9 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 1 frame-group) + (-> this draw art-group data 7) + (let ((v1-10 (get-rand-int this 100)) + (a0-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 1 frame-group) ) ) ) (cond - ((and (= a0-9 (-> obj draw art-group data 7)) (> (-> obj anim-ctr) 0)) - (+! (-> obj anim-ctr) -1) - (set! s5-0 (-> obj draw art-group data 7)) + ((and (= a0-9 (-> this draw art-group data 7)) (> (-> this anim-ctr) 0)) + (+! (-> this anim-ctr) -1) + (set! s5-0 (-> this draw art-group data 7)) ) - ((= a0-9 (-> obj draw art-group data 11)) - (set! s5-0 (-> obj draw art-group data 12)) - (set! (-> obj anim-ctr) (get-rand-int-range obj 0 3)) + ((= a0-9 (-> this draw art-group data 11)) + (set! s5-0 (-> this draw art-group data 12)) + (set! (-> this anim-ctr) (get-rand-int-range this 0 3)) ) - ((= a0-9 (-> obj draw art-group data 12)) - (let ((v1-20 (-> obj anim-ctr))) + ((= a0-9 (-> this draw art-group data 12)) + (let ((v1-20 (-> this anim-ctr))) (cond ((> v1-20 0) - (set! (-> obj anim-ctr) (+ v1-20 -1)) - (set! s5-0 (-> obj draw art-group data 12)) + (set! (-> this anim-ctr) (+ v1-20 -1)) + (set! s5-0 (-> this draw art-group data 12)) ) (else - (set! s5-0 (-> obj draw art-group data 13)) + (set! s5-0 (-> this draw art-group data 13)) ) ) ) ) - ((= a0-9 (-> obj draw art-group data 13)) - (set! s5-0 (-> obj draw art-group data 14)) - (set! (-> obj anim-ctr) (get-rand-int-range obj 0 3)) + ((= a0-9 (-> this draw art-group data 13)) + (set! s5-0 (-> this draw art-group data 14)) + (set! (-> this anim-ctr) (get-rand-int-range this 0 3)) ) - ((and (= a0-9 (-> obj draw art-group data 14)) (> (-> obj anim-ctr) 0)) - (+! (-> obj anim-ctr) -1) - (set! s5-0 (-> obj draw art-group data 14)) + ((and (= a0-9 (-> this draw art-group data 14)) (> (-> this anim-ctr) 0)) + (+! (-> this anim-ctr) -1) + (set! s5-0 (-> this draw art-group data 14)) ) ((< v1-10 10) - (set! s5-0 (-> obj draw art-group data 11)) + (set! s5-0 (-> this draw art-group data 11)) ) ((< v1-10 30) - (set! s5-0 (-> obj draw art-group data 8)) + (set! s5-0 (-> this draw art-group data 8)) ) ((< v1-10 50) - (set! s5-0 (-> obj draw art-group data 9)) + (set! s5-0 (-> this draw art-group data 9)) ) ((< v1-10 65) - (set! s5-0 (-> obj draw art-group data 10)) + (set! s5-0 (-> this draw art-group data 10)) ) (else - (set! s5-0 (-> obj draw art-group data 7)) - (set! (-> obj anim-ctr) (get-rand-int-range obj 2 6)) + (set! s5-0 (-> this draw art-group data 7)) + (set! (-> this anim-ctr) (get-rand-int-range this 2 6)) ) ) ) - (let ((a0-17 (-> obj skel root-channel 1))) + (let ((a0-17 (-> this skel root-channel 1))) (set! (-> a0-17 frame-interp 1) 1.0) - (set! (-> obj skel interp-select 0) 192) - (set! (-> obj skel interp-select 1) 0) + (set! (-> this skel interp-select 0) 192) + (set! (-> this skel interp-select 1) 0) (set! (-> a0-17 frame-group) (the-as art-joint-anim s5-0)) (set! (-> a0-17 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) (set! (-> a0-17 param 1) 1.0) @@ -389,11 +389,11 @@ (joint-control-channel-group! a0-17 (the-as art-joint-anim s5-0) num-func-seek!) ) ) - (let ((a0-18 (-> obj skel root-channel 0))) + (let ((a0-18 (-> this skel root-channel 0))) (set! (-> a0-18 param 0) 0.7) (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-19 (-> obj skel root-channel 1))) + (let ((a0-19 (-> this skel root-channel 1))) (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group frames num-frames) -1))) (set! (-> a0-19 param 1) 1.0) (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) @@ -401,26 +401,26 @@ ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-21 (-> obj skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-21 param 0) 0.7) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-loop!) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-loop!) ) - (let ((a0-22 (-> obj skel root-channel 1))) + (let ((a0-22 (-> this skel root-channel 1))) (set! (-> a0-22 frame-interp 1) 1.0) - (set! (-> obj skel interp-select 0) 192) - (set! (-> obj skel interp-select 1) 0) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 7))) + (set! (-> this skel interp-select 0) 192) + (set! (-> this skel interp-select 1) 0) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 7))) (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 7)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 7)) frames num-frames) -1)) ) (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 7)) num-func-seek!) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 7)) num-func-seek!) ) - (set! (-> obj anim-ctr) (get-rand-int-range obj 2 6)) - (when (not (-> obj using-chan1-effects?)) - (set! (-> obj using-chan1-effects?) #t) - (let ((v1-106 (-> obj skel effect))) + (set! (-> this anim-ctr) (get-rand-int-range this 2 6)) + (when (not (-> this using-chan1-effects?)) + (set! (-> this using-chan1-effects?) #t) + (let ((v1-106 (-> this skel effect))) (set! (-> v1-106 channel-offset) 1) ) 0 @@ -431,10 +431,10 @@ (none) ) -(defmethod set-chan1-effects centipede ((obj centipede)) - (when (-> obj using-chan1-effects?) - (set! (-> obj using-chan1-effects?) #f) - (let ((v1-2 (-> obj skel effect))) +(defmethod set-chan1-effects centipede ((this centipede)) + (when (-> this using-chan1-effects?) + (set! (-> this using-chan1-effects?) #f) + (let ((v1-2 (-> this skel effect))) (set! (-> v1-2 channel-offset) 0) ) 0 @@ -443,36 +443,36 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod nav-enemy-method-142 centipede ((obj centipede) (arg0 nav-control)) +(defmethod nav-enemy-method-142 centipede ((this centipede) (arg0 nav-control)) (let ((t9-0 (method-of-type nav-enemy nav-enemy-method-142))) - (t9-0 obj arg0) + (t9-0 this arg0) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-z-quaternion! s5-0 (-> obj root quat)) + (vector-z-quaternion! s5-0 (-> this root quat)) (vector-normalize! s5-0 1.0) - (let ((s3-0 (handle->process (-> obj focus handle))) + (let ((s3-0 (handle->process (-> this focus handle))) (s4-0 #f) ) (cond (s3-0 - (let ((s2-0 (-> obj focus-pos-hist-count))) + (let ((s2-0 (-> this focus-pos-hist-count))) (countdown (v1-7 (min 14 s2-0)) - (set! (-> obj focus-pos-hist (+ v1-7 1) quad) (-> obj focus-pos-hist v1-7 quad)) + (set! (-> this focus-pos-hist (+ v1-7 1) quad) (-> this focus-pos-hist v1-7 quad)) ) - (set! (-> obj focus-pos-hist 0 quad) (-> (get-trans (the-as process-focusable s3-0) 0) quad)) + (set! (-> this focus-pos-hist 0 quad) (-> (get-trans (the-as process-focusable s3-0) 0) quad)) (if (< s2-0 15) - (set! (-> obj focus-pos-hist-count) (+ s2-0 1)) + (set! (-> this focus-pos-hist-count) (+ s2-0 1)) ) ) ) (else - (set! (-> obj focus-pos-hist-count) 0) + (set! (-> this focus-pos-hist-count) 0) 0 ) ) (when s3-0 (let ((s3-1 (new 'stack-no-clear 'vector))) - (vector-! s3-1 (-> obj focus-pos-hist (+ (-> obj focus-pos-hist-count) -1)) (-> obj root trans)) + (vector-! s3-1 (-> this focus-pos-hist (+ (-> this focus-pos-hist-count) -1)) (-> this root trans)) (vector-normalize! s3-1 1.0) (when (>= (vector-dot s3-1 s5-0) 0.342) (let ((f0-9 @@ -482,8 +482,8 @@ ) ) ) - (set! (-> obj track-focus-tilt) - (seek-with-smooth (-> obj track-focus-tilt) f0-9 (* 5461.3335 (seconds-per-frame)) 0.25 1.0) + (set! (-> this track-focus-tilt) + (seek-with-smooth (-> this track-focus-tilt) f0-9 (* 5461.3335 (seconds-per-frame)) 0.25 1.0) ) ) (set! s4-0 #t) @@ -491,8 +491,8 @@ ) ) (if (not s4-0) - (set! (-> obj track-focus-tilt) - (seek-with-smooth (-> obj track-focus-tilt) 0.0 (* 5461.3335 (seconds-per-frame)) 0.25 1.0) + (set! (-> this track-focus-tilt) + (seek-with-smooth (-> this track-focus-tilt) 0.0 (* 5461.3335 (seconds-per-frame)) 0.25 1.0) ) ) ) @@ -500,19 +500,19 @@ (s4-1 (new 'stack-no-clear 'quaternion)) ) (vector-rotate90-around-y! s3-2 s5-0) - (quaternion-vector-angle! s4-1 s3-2 (+ 4551.1113 (-> obj track-focus-tilt))) - (quaternion*! (-> obj root quat) s4-1 (-> obj root quat)) + (quaternion-vector-angle! s4-1 s3-2 (+ 4551.1113 (-> this track-focus-tilt))) + (quaternion*! (-> this root quat) s4-1 (-> this root quat)) ) ) (none) ) -(defmethod coin-flip? centipede ((obj centipede)) +(defmethod coin-flip? centipede ((this centipede)) "@returns The result of a 50/50 RNG roll" #f ) -(defmethod in-aggro-range? centipede ((obj centipede) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? centipede ((this centipede) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -523,17 +523,17 @@ (set! arg1 (get-trans arg0 0)) ) (when arg1 - (let* ((f0-0 (-> obj root trans y)) - (v1-4 (-> obj root)) + (let* ((f0-0 (-> this root trans y)) + (v1-4 (-> this root)) (f1-0 (-> v1-4 trans y)) - (a0-2 (-> obj fact)) + (a0-2 (-> this fact)) ) (when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0)) - (let* ((f30-0 (-> obj enemy-info notice-nav-radius)) + (let* ((f30-0 (-> this enemy-info notice-nav-radius)) (f0-1 f30-0) ) (or (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1)) - (is-in-mesh? (-> obj nav) arg1 f30-0) + (is-in-mesh? (-> this nav) arg1 f30-0) ) ) ) @@ -543,9 +543,9 @@ ) ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target centipede ((obj centipede)) +(defmethod get-enemy-target centipede ((this centipede)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" - (let ((v0-0 (handle->process (-> obj focus handle)))) + (let ((v0-0 (handle->process (-> this focus handle)))) (if (and v0-0 (focus-test? (the-as process-focusable v0-0) disable dead grabbed)) (set! v0-0 (the-as process #f)) ) @@ -553,15 +553,15 @@ ) ) -(defmethod target-close? centipede ((obj centipede)) +(defmethod target-close? centipede ((this centipede)) "Is the target close enough to attack?" - (let ((targ (get-enemy-target obj))) + (let ((targ (get-enemy-target this))) (when targ (let* ((targ-pos (get-trans targ 0)) - (y-off (- (-> targ-pos y) (-> obj root trans y))) + (y-off (- (-> targ-pos y) (-> this root trans y))) (dist 28672.0) ) - (and (>= (* dist dist) (vector-vector-xz-distance-squared (-> obj root trans) targ-pos)) + (and (>= (* dist dist) (vector-vector-xz-distance-squared (-> this root trans) targ-pos)) (or (>= y-off -12288.0) (or (>= 24576.0 y-off) (focus-test? targ edge-grab))) ) ) @@ -569,71 +569,71 @@ ) ) -(defmethod centipede-method-183 centipede ((obj centipede)) - (when (not (and (-> obj next-state) (= (-> obj next-state name) 'thru-grating))) - (centipede-method-187 obj) - (when (= (-> obj id) 2) +(defmethod centipede-method-183 centipede ((this centipede)) + (when (not (and (-> this next-state) (= (-> this next-state name) 'thru-grating))) + (centipede-method-187 this) + (when (= (-> this id) 2) (let ((overlap-parms (new 'stack-no-clear 'overlaps-others-params))) (set! (-> overlap-parms options) (overlaps-others-options)) (set! (-> overlap-parms collide-with-filter) (the-as collide-spec -1)) (set! (-> overlap-parms tlist) *touching-list*) - (find-overlapping-shapes (-> obj root) overlap-parms) + (find-overlapping-shapes (-> this root) overlap-parms) ) ) (let* ((travel-speed (-> *centipede-nav-enemy-info* run-travel-speed)) - (f0-2 (fmin 1.0 (/ (vector-length (-> obj root transv)) travel-speed))) + (f0-2 (fmin 1.0 (/ (vector-length (-> this root transv)) travel-speed))) ) - (seek! (-> obj bobbing-intensity) f0-2 (* 4.0 (seconds-per-frame))) + (seek! (-> this bobbing-intensity) f0-2 (* 4.0 (seconds-per-frame))) ) - (quaternion-copy! (-> obj bobbing quat) (-> obj root quat)) - (set! (-> obj bobbing trans quad) (-> obj root trans quad)) + (quaternion-copy! (-> this bobbing quat) (-> this root quat)) + (set! (-> this bobbing trans quad) (-> this root trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector)) (f30-1 (* 2662.4 (cos (* 283.70563 (the float (mod (current-time) 231)))))) - (bob-trans (-> obj bobbing trans)) + (bob-trans (-> this bobbing trans)) ) - (vector-z-quaternion! s5-0 (-> obj root quat)) + (vector-z-quaternion! s5-0 (-> this root quat)) (set! (-> s5-0 y) 0.0) - (vector-normalize! s5-0 (* f30-1 (-> obj bobbing-intensity))) + (vector-normalize! s5-0 (* f30-1 (-> this bobbing-intensity))) (vector+! (the-as vector (&-> bob-trans x)) (the-as vector (&-> bob-trans x)) s5-0) ) ) - (update-trans! (-> obj sound) (-> obj root trans)) - (when (!= (-> obj talking-volume) (-> obj desired-talking-volume)) - (seek! (-> obj talking-volume) (-> obj desired-talking-volume) (* 4.0 (seconds-per-frame))) - (update-vol! (-> obj sound) (-> obj talking-volume)) + (update-trans! (-> this sound) (-> this root trans)) + (when (!= (-> this talking-volume) (-> this desired-talking-volume)) + (seek! (-> this talking-volume) (-> this desired-talking-volume) (* 4.0 (seconds-per-frame))) + (update-vol! (-> this sound) (-> this talking-volume)) ) - (update! (-> obj sound)) - (update-trans! (-> obj legs-sound) (-> obj root trans)) - (let ((f0-20 (fmin 1.0 (* 0.00012207031 (vector-length (-> obj root transv)))))) - (when (!= (-> obj legs-volume) f0-20) - (seek! (-> obj legs-volume) f0-20 (* 4.0 (seconds-per-frame))) - (update-vol! (-> obj legs-sound) (-> obj legs-volume)) + (update! (-> this sound)) + (update-trans! (-> this legs-sound) (-> this root trans)) + (let ((f0-20 (fmin 1.0 (* 0.00012207031 (vector-length (-> this root transv)))))) + (when (!= (-> this legs-volume) f0-20) + (seek! (-> this legs-volume) f0-20 (* 4.0 (seconds-per-frame))) + (update-vol! (-> this legs-sound) (-> this legs-volume)) ) ) - (update! (-> obj legs-sound)) + (update! (-> this legs-sound)) (none) ) -(defmethod track-target! centipede ((obj centipede)) +(defmethod track-target! centipede ((this centipede)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (let ((a0-3 (handle->process (-> obj focus handle)))) + (let ((a0-3 (handle->process (-> this focus handle)))) (when a0-3 (let ((f0-0 (-> (get-trans (the-as process-focusable a0-3) 1) y))) (if (!= f0-0 -40959590.0) - (set! (-> obj focus-gnd-height) f0-0) + (set! (-> this focus-gnd-height) f0-0) ) ) ) ) - (let ((s5-0 (-> obj root))) + (let ((s5-0 (-> this root))) (set! (-> s5-0 gspot-pos quad) (-> s5-0 trans quad)) - (let ((v1-12 (-> obj nav)) + (let ((v1-12 (-> this nav)) (a0-8 (-> s5-0 trans)) (a1-2 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -644,7 +644,7 @@ (s4-0 (new 'stack-no-clear 'collide-query)) ) (when a1-3 - (let ((s2-0 (-> obj nav)) + (let ((s2-0 (-> this nav)) (s3-0 (-> s4-0 best-other-tri intersect)) ) (let ((a3-2 (-> s4-0 best-other-tri normal)) @@ -669,16 +669,16 @@ ) ) ) - (let ((f0-6 (-> obj root trans y))) + (let ((f0-6 (-> this root trans y))) (cond ((>= (-> s5-0 gspot-pos y) f0-6) (set! (-> s5-0 trans y) (-> s5-0 gspot-pos y)) ) - ((and (!= (-> obj focus-gnd-height) -40959590.0) - (>= (- (-> obj focus-gnd-height) (-> s5-0 gspot-pos y)) 4096.0) + ((and (!= (-> this focus-gnd-height) -40959590.0) + (>= (- (-> this focus-gnd-height) (-> s5-0 gspot-pos y)) 4096.0) ) (set! (-> s5-0 trans y) - (seek-with-smooth (-> s5-0 trans y) (-> obj focus-gnd-height) (* 24576.0 (seconds-per-frame)) 0.25 1.0) + (seek-with-smooth (-> s5-0 trans y) (-> this focus-gnd-height) (* 24576.0 (seconds-per-frame)) 0.25 1.0) ) ) (else @@ -689,30 +689,30 @@ ) ) ) - (centipede-method-183 obj) + (centipede-method-183 this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle centipede ((obj centipede)) - (case (-> obj id) +(defmethod go-idle centipede ((this centipede)) + (case (-> this id) ((1) (cond ((or (not *target*) (task-node-closed? (game-task-node under-sig-centipede1-end)) (and *debug-segment* (cpad-hold? 0 l2)) ) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) ((task-node-closed? (game-task-node under-sig-centipede1-start)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (go (method-of-object obj grab-cam)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (go (method-of-object this grab-cam)) ) (else - (go (method-of-object obj hidden)) + (go (method-of-object this hidden)) ) ) ) @@ -722,17 +722,17 @@ (task-node-closed? (game-task-node under-sig-resolution)) (and *debug-segment* (cpad-hold? 0 l2)) ) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) ((task-node-closed? (game-task-node under-sig-centipede2-start)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (go (method-of-object obj grab-cam)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (go (method-of-object this grab-cam)) ) (else - (go (method-of-object obj hidden)) + (go (method-of-object this hidden)) ) ) ) @@ -825,10 +825,10 @@ (until #f (cond (*target* - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (else - (when (>= (- (current-time) (-> self state-time)) (seconds 2)) + (when (time-elapsed? (-> self state-time) (seconds 2)) (cleanup-for-death self) (go-virtual die-fast) ) @@ -913,7 +913,7 @@ ) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (let ((v1-6 (handle->process (-> self focus handle)))) (if (or (not v1-6) (focus-test? (the-as process-focusable v1-6) dead)) (go-virtual stop-chase) @@ -970,7 +970,7 @@ ) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (react-to-focus self) ) ) @@ -982,25 +982,25 @@ ) ;; WARN: Return type mismatch quaternion vs none. -(defmethod centipede-method-186 centipede ((obj centipede)) - (let ((proc (handle->process (-> obj focus handle)))) +(defmethod centipede-method-186 centipede ((this centipede)) + (let ((proc (handle->process (-> this focus handle)))) (when proc - (set! (-> obj focus-pos quad) (-> (get-trans (the-as process-focusable proc) 0) quad)) - (when (and (not (-> obj grabbed-focus?)) (= (-> proc type) target) (>= (ja-frame-num 0) 5.0)) + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable proc) 0) quad)) + (when (and (not (-> this grabbed-focus?)) (= (-> proc type) target) (>= (ja-frame-num 0) 5.0)) (if (send-event proc 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'centipede)))) - (set! (-> obj grabbed-focus?) #t) + (set! (-> this grabbed-focus?) #t) ) ) - (when (not (-> obj grabbed-focus?)) + (when (not (-> this grabbed-focus?)) (let ((s5-1 (new 'stack-no-clear 'vector))) (let ((cam-dir (new 'stack-no-clear 'vector)) (trans-off (new 'stack-no-clear 'vector)) ) (let ((s2-0 (new 'stack-no-clear 'matrix))) - (set! (-> cam-dir quad) (-> obj cam dir quad)) + (set! (-> cam-dir quad) (-> this cam dir quad)) (set! (-> cam-dir y) 0.0) (vector-normalize! cam-dir 1.0) - (vector-! trans-off (-> obj focus-pos) (-> obj root trans)) + (vector-! trans-off (-> this focus-pos) (-> this root trans)) (set! (-> s5-1 quad) (-> trans-off quad)) (set! (-> s5-1 y) 0.0) (vector-normalize! s5-1 1.0) @@ -1016,13 +1016,13 @@ (set! (-> s5-1 y) (+ 49152.0 (-> trans-off y))) ) (vector-normalize! s5-1 1.0) - (quaternion-look-at! (-> obj dest-quat) s5-1 *up-vector*) + (quaternion-look-at! (-> this dest-quat) s5-1 *up-vector*) ) ) ) ) (let ((f0-12 (fmin 1.0 (* 0.16666667 (ja-frame-num 0))))) - (quaternion-slerp! (-> obj root quat) (-> obj src-quat) (-> obj dest-quat) f0-12) + (quaternion-slerp! (-> this root quat) (-> this src-quat) (-> this dest-quat) f0-12) ) (none) ) @@ -1108,9 +1108,9 @@ (set-chan1-effects self) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self desired-talking-volume) 1.0) - (while (< (- (current-time) (-> self state-time)) (seconds 0.35)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.35))) (let* ((v1-5 (- (current-time) (-> self state-time))) (f1-2 (* 0.00952381 (the float v1-5))) ) @@ -1119,7 +1119,7 @@ (centipede-method-188 self) (suspend) ) - (while (< (- (current-time) (-> self state-time)) (seconds 1)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (centipede-method-188 self) (suspend) ) @@ -1171,9 +1171,9 @@ ) ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! centipede ((obj centipede)) +(defmethod init-enemy-collision! centipede ((this centipede)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1257,24 +1257,24 @@ (set! (-> s5-0 backup-collide-with) (-> v1-32 prim-core collide-with)) ) (set! (-> s5-0 event-other) 'centipede) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) -(defmethod init-enemy! centipede ((obj centipede)) +(defmethod init-enemy! centipede ((this centipede)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (set! (-> obj id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) - (set! (-> obj cam init?) #t) - (set! (-> obj using-chan1-effects?) #f) - (set! (-> obj set-camera-mode?) #f) - (set! (-> obj focus-gnd-height) -40959590.0) - (set! (-> obj bobbing-intensity) 1.0) - (set-vector! (-> obj root scale) 0.75 0.75 0.75 1.0) - (+! (-> obj root trans y) 4096.0) - (case (-> obj id) + (set! (-> this id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) + (set! (-> this cam init?) #t) + (set! (-> this using-chan1-effects?) #f) + (set! (-> this set-camera-mode?) #f) + (set! (-> this focus-gnd-height) -40959590.0) + (set! (-> this bobbing-intensity) 1.0) + (set-vector! (-> this root scale) 0.75 0.75 0.75 1.0) + (+! (-> this root trans y) 4096.0) + (case (-> this id) ((1) - (let ((v1-10 (-> obj root))) + (let ((v1-10 (-> this root))) (set-vector! (-> v1-10 quat) -0.2103 -0.2293 -0.0508 0.949) (set! (-> v1-10 trans x) -248325.33) (set! (-> v1-10 trans z) 8201697.0) @@ -1282,7 +1282,7 @@ (set! (-> *centipede-nav-enemy-info* run-travel-speed) 32768.0) ) ((2) - (let ((v1-16 (-> obj root))) + (let ((v1-16 (-> this root))) (set-vector! (-> v1-16 quat) -0.1832 0.519 0.115 0.827) (set! (-> v1-16 trans x) -1001253.25) (set! (-> v1-16 trans z) 7913366.5) @@ -1291,37 +1291,37 @@ ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-centipede" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *centipede-nav-enemy-info*) - (logclear! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask bot)) - (let ((v1-31 (-> obj nav))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *centipede-nav-enemy-info*) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask bot)) + (let ((v1-31 (-> this nav))) (set! (-> v1-31 sphere-mask) (the-as uint 64)) ) 0 - (logclear! (-> obj root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) - (let ((v1-35 (-> obj nav))) + (logclear! (-> this root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) + (let ((v1-35 (-> this nav))) (set! (-> v1-35 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (set! (-> obj bobbing) (the-as trsqv (new 'process 'joint-mod-set-world obj 3 #t))) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "cent-talk" :fo-max 90) (-> obj root trans)) + (set-gravity-length (-> this root dynam) 573440.0) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (set! (-> this bobbing) (the-as trsqv (new 'process 'joint-mod-set-world this 3 #t))) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "cent-talk" :fo-max 90) (-> this root trans)) ) - (update-vol! (-> obj sound) 0.0) - (set! (-> obj talking-volume) 0.0) - (set! (-> obj desired-talking-volume) 0.0) - (set! (-> obj legs-sound) - (new 'process 'ambient-sound (static-sound-spec "cent-legs-loop" :fo-max 90) (-> obj root trans)) + (update-vol! (-> this sound) 0.0) + (set! (-> this talking-volume) 0.0) + (set! (-> this desired-talking-volume) 0.0) + (set! (-> this legs-sound) + (new 'process 'ambient-sound (static-sound-spec "cent-legs-loop" :fo-max 90) (-> this root trans)) ) - (update-vol! (-> obj sound) 0.0) - (set! (-> obj legs-volume) 0.0) + (update-vol! (-> this sound) 0.0) + (set! (-> this legs-volume) 0.0) 0 (none) ) diff --git a/goal_src/jak2/levels/under/jellyfish.gc b/goal_src/jak2/levels/under/jellyfish.gc index e8fe35bb27..0d3b8d8516 100644 --- a/goal_src/jak2/levels/under/jellyfish.gc +++ b/goal_src/jak2/levels/under/jellyfish.gc @@ -16,8 +16,8 @@ ) -(defmethod hover-formation-method-15 jellyfish-formation ((obj jellyfish-formation) (arg0 vector) (arg1 vector)) - (logior! (-> obj formation flags) 2) +(defmethod hover-formation-method-15 jellyfish-formation ((this jellyfish-formation) (arg0 vector) (arg1 vector)) + (logior! (-> this formation flags) 2) 0 ) @@ -29,36 +29,36 @@ ) -(defmethod apply-gravity jellyfish-chain-physics ((obj jellyfish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (vector-float*! arg0 - (-> obj gravity) + (-> this gravity) (* 4096.0 (-> self clock time-adjust-ratio) (lerp-scale 0.01 0.1 (the float arg1) 0.0 5.0)) ) - (vector+float*! arg0 arg0 (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* arg1 64))) 0.2) + (vector+float*! arg0 arg0 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* arg1 64))) 0.2) 0 (none) ) -(defmethod chain-physics-method-14 jellyfish-chain-physics ((obj jellyfish-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) (vector-float*! arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ arg1 1) 64))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64))) (lerp-scale 0.1 0.9 (the float arg1) 0.0 5.0) ) 0 (none) ) -(defmethod chain-physics-method-16 jellyfish-chain-physics ((obj jellyfish-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 int)) (if (zero? arg0) 0.0 5461.3335 ) ) -(defmethod gravity-update jellyfish-chain-physics ((obj jellyfish-chain-physics) (arg0 process-drawable)) - ((method-of-type chain-physics gravity-update) obj arg0) +(defmethod gravity-update jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 process-drawable)) + ((method-of-type chain-physics gravity-update) this arg0) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) (let ((s4-0 (new 'stack-no-clear 'sphere))) @@ -85,7 +85,7 @@ (none) ) -(defmethod chain-physics-method-17 jellyfish-chain-physics ((obj jellyfish-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) (local-vars (v1-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -94,7 +94,7 @@ ) (init-vf0-vector) (let* ((s5-0 (new 'stack-no-clear 'collide-query)) - (v1-2 (-> obj chain-joints arg1)) + (v1-2 (-> this chain-joints arg1)) (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> v1-2 position))) (s3-0 0) ) @@ -335,7 +335,7 @@ (set! (-> *jellyfish-enemy-info* fact-defaults) *fact-info-enemy-defaults*) -(defmethod hover-enemy-method-151 jellyfish ((obj jellyfish)) +(defmethod hover-enemy-method-151 jellyfish ((this jellyfish)) (new 'static 'hover-enemy-info :fly-forward-anim 2 :fly-backward-anim 2 @@ -349,7 +349,7 @@ ) ) -(defmethod hover-enemy-method-152 jellyfish ((obj jellyfish)) +(defmethod hover-enemy-method-152 jellyfish ((this jellyfish)) (new 'static 'hover-nav-params :max-speed 32768.0 :max-acceleration 24576.0 :friction 0.8) ) @@ -430,7 +430,7 @@ :trans (behavior () (local-vars (gp-0 vector)) (seek! (-> self tentacle-blend) 1.0 (seconds-per-frame)) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-4 (-> self focus aware))) (cond ((>= 1 (the-as int v1-4)) @@ -441,13 +441,13 @@ ) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (and (time-elapsed? (-> self state-time) (seconds 2)) (not (jellyfish-method-164 self (the-as process-focusable #f))) ) (go-virtual active) ) (if (and (not *jellyfish-mech-reserved*) - (>= (- (current-time) (-> self state-time)) (seconds 1)) + (time-elapsed? (-> self state-time) (seconds 1)) (jellyfish-method-163 self (the-as process-focusable #f)) (begin (set! gp-0 (jellyfish-method-161 self (new 'stack-no-clear 'vector) (-> self path-stare-u))) @@ -524,7 +524,7 @@ (the-as vector #t) ) (logior! (-> self focus-status) (focus-status dangerous)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (hover-nav-control-method-14 (-> self hover) 1.0 1.0) @@ -624,7 +624,7 @@ (let ((gp-0 *target*)) (cond ((not (jellyfish-method-163 self gp-0)) - (set! (-> self last-attack-time) (current-time)) + (set-time! (-> self last-attack-time)) (go-virtual active) ) (else @@ -706,7 +706,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self last-attack-time) (current-time)) + (set-time! (-> self last-attack-time)) (go-virtual active) ) :post (behavior () @@ -740,7 +740,7 @@ (f0-4 (ja-aframe-num 0)) ) (when (and (= s5-0 jellyfish-die-ja) (>= f0-4 0.0) (>= 0.5 f0-4)) - (when (>= (- (current-time) gp-0) (seconds 0.05)) + (when (time-elapsed? gp-0 (seconds 0.05)) (process-drawable-shock-skel-effect self (-> *lightning-spec-id-table* 5) @@ -797,57 +797,57 @@ ) ) -(defmethod general-event-handler jellyfish ((obj jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler jellyfish ((this jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (go (method-of-object obj die)) + (go (method-of-object this die)) #t ) (else - ((method-of-type hover-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hover-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) -(defmethod jellyfish-method-161 jellyfish ((obj jellyfish) (arg0 vector) (arg1 float)) - (get-point-in-path! (-> obj path) arg0 arg1 'interp) - (+! (-> arg0 y) (-> obj path-y-offset)) +(defmethod jellyfish-method-161 jellyfish ((this jellyfish) (arg0 vector) (arg1 float)) + (get-point-in-path! (-> this path) arg0 arg1 'interp) + (+! (-> arg0 y) (-> this path-y-offset)) arg0 ) ;; WARN: Return type mismatch object vs symbol. -(defmethod jellyfish-method-164 jellyfish ((obj jellyfish) (arg0 process-focusable)) +(defmethod jellyfish-method-164 jellyfish ((this jellyfish) (arg0 process-focusable)) (local-vars (v1-10 object)) - (jellyfish-method-161 obj (new 'stack-no-clear 'vector) (get-norm! (-> obj sync) 0)) - (let ((s5-1 (jellyfish-method-161 obj (new 'stack-no-clear 'vector) (-> obj path-player-u))) - (gp-1 (-> obj focus-pos)) + (jellyfish-method-161 this (new 'stack-no-clear 'vector) (get-norm! (-> this sync) 0)) + (let ((s5-1 (jellyfish-method-161 this (new 'stack-no-clear 'vector) (-> this path-player-u))) + (gp-1 (-> this focus-pos)) ) - (-> obj root trans) + (-> this root trans) (the-as symbol (and (and (if arg0 arg0 - (handle->process (-> obj focus handle)) + (handle->process (-> this focus handle)) ) (focus-test? (the-as process-focusable (if arg0 arg0 - (handle->process (-> obj focus handle)) + (handle->process (-> this focus handle)) ) ) mech @@ -860,7 +860,7 @@ arg0 ) (else - (the-as process-focusable (handle->process (-> obj focus handle))) + (the-as process-focusable (handle->process (-> this focus handle))) ) ) ) @@ -879,21 +879,21 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod jellyfish-method-163 jellyfish ((obj jellyfish) (arg0 process-focusable)) +(defmethod jellyfish-method-163 jellyfish ((this jellyfish) (arg0 process-focusable)) (local-vars (v1-8 object)) - (jellyfish-method-161 obj (new 'stack-no-clear 'vector) (-> obj path-stare-u)) - (let ((s5-0 (-> obj focus-pos))) - (-> obj root trans) + (jellyfish-method-161 this (new 'stack-no-clear 'vector) (-> this path-stare-u)) + (let ((s5-0 (-> this focus-pos))) + (-> this root trans) (the-as symbol (and (and (if arg0 arg0 - (handle->process (-> obj focus handle)) + (handle->process (-> this focus handle)) ) (focus-test? (the-as process-focusable (if arg0 arg0 - (handle->process (-> obj focus handle)) + (handle->process (-> this focus handle)) ) ) mech @@ -906,7 +906,7 @@ arg0 ) (else - (the-as process-focusable (handle->process (-> obj focus handle))) + (the-as process-focusable (handle->process (-> this focus handle))) ) ) ) @@ -917,14 +917,14 @@ v1-8 ) ) - (< (vector-vector-xz-distance s5-0 (-> obj stare-pos)) 81920.0) - (< (fabs (- (-> s5-0 y) (-> obj stare-pos y))) 32768.0) + (< (vector-vector-xz-distance s5-0 (-> this stare-pos)) 81920.0) + (< (fabs (- (-> s5-0 y) (-> this stare-pos y))) 32768.0) ) ) ) ) -(defmethod jellyfish-method-162 jellyfish ((obj jellyfish)) +(defmethod jellyfish-method-162 jellyfish ((this jellyfish)) (local-vars (sv-624 int)) (rlet ((acc :class vf) (vf0 :class vf) @@ -934,14 +934,14 @@ (vf4 :class vf) ) (init-vf0-vector) - (let* ((s5-0 (-> obj root trans)) - (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> obj focus-pos) s5-0)) + (let* ((s5-0 (-> this root trans)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) s5-0)) (s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-1 1.0)) (f0-0 (vector-length s3-1)) (f28-0 (+ 16384.0 f0-0)) ) (vector-normalize! s3-1 f28-0) - (vector+! (-> obj charge-pos) s5-0 s3-1) + (vector+! (-> this charge-pos) s5-0 s3-1) (let ((f30-0 f28-0) (f28-1 (* 0.000024414063 f28-0)) (s3-2 0) @@ -970,11 +970,13 @@ (set! (-> s0-0 start-pos quad) (-> s1-0 quad)) (vector-! (-> s0-0 move-dist) s2-0 s1-0) (let ((v1-14 s0-0)) - (set! (-> v1-14 radius) (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 0 local-sphere w)) + (set! (-> v1-14 radius) + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0 local-sphere w) + ) (set! (-> v1-14 collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) - (set! (-> v1-14 ignore-process0) obj) + (set! (-> v1-14 ignore-process0) this) (set! (-> v1-14 ignore-process1) #f) - (set! (-> v1-14 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-14 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-14 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s0-0) 0.0) @@ -1023,55 +1025,56 @@ (none) ) -(defmethod track-target! jellyfish ((obj jellyfish)) +(defmethod track-target! jellyfish ((this jellyfish)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (let ((v1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> obj main-joint-acc) (-> obj root quat)))) - (+! (-> obj tentacle-clock) + (let ((v1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> this main-joint-acc) (-> this root quat))) + ) + (+! (-> this tentacle-clock) (* (lerp-scale 1.0 10.0 (fmax (fmax (fmax 0.0 (fabs (-> v1-1 x))) (-> v1-1 y)) (fabs (-> v1-1 z))) 0.0 24576.0) (seconds-per-frame) ) ) ) - (when (not (-> obj tentacles-initialized)) - (set! (-> obj tentacles-initialized) #t) + (when (not (-> this tentacles-initialized)) + (set! (-> this tentacles-initialized) #t) (dotimes (s5-0 5) - (initialize-chain-joints (-> obj tentacles s5-0)) + (initialize-chain-joints (-> this tentacles s5-0)) ) ) (dotimes (s5-1 5) - (update (-> obj tentacles s5-1) obj) + (update (-> this tentacles s5-1) this) ) - (let ((a1-3 (handle->process (-> obj focus handle)))) + (let ((a1-3 (handle->process (-> this focus handle)))) (if a1-3 - (los-control-method-9 (-> obj los) (the-as process-focusable a1-3) (the-as vector #f) 4096.0) + (los-control-method-9 (-> this los) (the-as process-focusable a1-3) (the-as vector #f) 4096.0) ) ) - (let ((a0-10 (handle->process (-> obj focus handle)))) + (let ((a0-10 (handle->process (-> this focus handle)))) (when (and a0-10 (focus-test? (the-as process-focusable a0-10) mech) (not (logtest? (-> (the-as process-focusable a0-10) focus-status) (focus-status dead ignore))) ) - (set! (-> obj focus-pos quad) (-> (get-trans (the-as process-focusable a0-10) 0) quad)) - (set! (-> obj path-player-u) (get-furthest-point-on-path (-> obj path) (-> obj focus-pos))) + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-10) 0) quad)) + (set! (-> this path-player-u) (get-furthest-point-on-path (-> this path) (-> this focus-pos))) ) ) - (set! (-> obj path-my-u) (get-furthest-point-on-path (-> obj path) (-> obj root trans))) - ((method-of-type hover-enemy track-target!) obj) + (set! (-> this path-my-u) (get-furthest-point-on-path (-> this path) (-> this root trans))) + ((method-of-type hover-enemy track-target!) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle jellyfish ((obj jellyfish)) - (go (method-of-object obj active)) +(defmethod go-idle jellyfish ((this jellyfish)) + (go (method-of-object this active)) (none) ) -(defmethod hover-enemy-method-149 jellyfish ((obj jellyfish)) +(defmethod hover-enemy-method-149 jellyfish ((this jellyfish)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-jellyfish" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1079,13 +1082,13 @@ (none) ) -(defmethod hover-enemy-method-150 jellyfish ((obj jellyfish)) +(defmethod hover-enemy-method-150 jellyfish ((this jellyfish)) *jellyfish-enemy-info* ) -(defmethod init-enemy-collision! jellyfish ((obj jellyfish)) +(defmethod init-enemy-collision! jellyfish ((this jellyfish)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1148,36 +1151,36 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; WARN: Return type mismatch hover-enemy vs jellyfish. -(defmethod relocate jellyfish ((obj jellyfish) (arg0 int)) +(defmethod relocate jellyfish ((this jellyfish) (arg0 int)) (dotimes (v1-0 5) - (if (nonzero? (-> obj tentacles v1-0)) - (&+! (-> obj tentacles v1-0) arg0) + (if (nonzero? (-> this tentacles v1-0)) + (&+! (-> this tentacles v1-0) arg0) ) ) - (the-as jellyfish ((method-of-type hover-enemy relocate) obj arg0)) + (the-as jellyfish ((method-of-type hover-enemy relocate) this arg0)) ) -(defmethod deactivate jellyfish ((obj jellyfish)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method jellyfish 10)) obj) +(defmethod deactivate jellyfish ((this jellyfish)) + (sound-stop (-> this sound-id)) + ((the-as (function process-drawable none) (find-parent-method jellyfish 10)) this) (none) ) -(defmethod init-enemy! jellyfish ((obj jellyfish)) +(defmethod init-enemy! jellyfish ((this jellyfish)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (hover-enemy-method-149 obj) - (init-enemy-behaviour-and-stats! obj (hover-enemy-method-150 obj)) - (hover-enemy-method-155 obj) - (set-vector! (-> obj offset) 0.0 6144.0 61440.0 1.0) - (set! (-> obj knocked-fall-dist) 0.0) - (let ((v1-8 (-> obj neck))) + (hover-enemy-method-149 this) + (init-enemy-behaviour-and-stats! this (hover-enemy-method-150 this)) + (hover-enemy-method-155 this) + (set-vector! (-> this offset) 0.0 6144.0 61440.0 1.0) + (set! (-> this knocked-fall-dist) 0.0) + (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) (set! (-> v1-8 nose) (the-as uint 2)) (set! (-> v1-8 ear) (the-as uint 0)) @@ -1185,20 +1188,20 @@ (set! (-> v1-8 twist-speed-y) 0.06) (set! (-> v1-8 max-dist) 122880.0) ) - (set! (-> obj root dynam gravity y) 40960.0) - (set! (-> obj root dynam gravity-length) 40960.0) - (set! (-> obj root dynam gravity-max) 40960.0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (new-source! (-> obj los) obj (seconds 1) (collide-spec backgnd enemy obstacle hit-by-others-list)) - (set! (-> obj last-fire-time) (current-time)) - (set! (-> obj last-attack-time) 0) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (-> obj entity) #f)) - (set! (-> obj path-player-u) 0.0) - (set! (-> obj path-my-u) 0.0) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-y-offset) (res-lump-float (-> obj entity) 'y-offset)) + (set! (-> this root dynam gravity y) 40960.0) + (set! (-> this root dynam gravity-length) 40960.0) + (set! (-> this root dynam gravity-max) 40960.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (new-source! (-> this los) this (seconds 1) (collide-spec backgnd enemy obstacle hit-by-others-list)) + (set-time! (-> this last-fire-time)) + (set! (-> this last-attack-time) 0) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) + (set! (-> this path-player-u) 0.0) + (set! (-> this path-my-u) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-y-offset) (res-lump-float (-> this entity) 'y-offset)) (let ((a1-4 (new 'stack-no-clear 'sync-info-params))) (let ((v1-32 0)) (if #t @@ -1208,51 +1211,51 @@ (set! (-> a1-4 sync-flags) (the-as sync-flags v1-32)) ) (set! (-> a1-4 period) (the-as uint 6000)) - (set! (-> a1-4 entity) (-> obj entity)) + (set! (-> a1-4 entity) (-> this entity)) (set! (-> a1-4 percent) 0.0) (set! (-> a1-4 ease-in) 0.15) (set! (-> a1-4 ease-out) 0.15) (set! (-> a1-4 pause-in) 0.0) (set! (-> a1-4 pause-out) 0.0) - (initialize! (-> obj sync) a1-4) + (initialize! (-> this sync) a1-4) ) (add-connection *part-engine* - obj + this 36 - obj + this 318 (new 'static 'vector :x 1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) (add-connection *part-engine* - obj + this 36 - obj + this 318 (new 'static 'vector :x -1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) - (add-connection *part-engine* obj 36 obj 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) + (add-connection *part-engine* this 36 this 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) (dotimes (s5-1 5) - (set! (-> obj tentacles s5-1) (new 'process 'jellyfish-chain-physics)) + (set! (-> this tentacles s5-1) (new 'process 'jellyfish-chain-physics)) ) - (chain-physics-initialize obj (-> obj tentacles 0) 10 4096.0 *jellyfish-mainvein-chain-setup*) - (chain-physics-initialize obj (-> obj tentacles 1) 16 4096.0 *jellyfish-lfront-chain-setup*) - (chain-physics-initialize obj (-> obj tentacles 2) 21 4096.0 *jellyfish-rfront-chain-setup*) - (chain-physics-initialize obj (-> obj tentacles 3) 26 4096.0 *jellyfish-lrear-chain-setup*) - (chain-physics-initialize obj (-> obj tentacles 4) 31 4096.0 *jellyfish-rrear-chain-setup*) - (set! (-> obj tentacles 2 negate-y) #t) - (set! (-> obj tentacles 4 negate-y) #t) - (let ((a0-35 (-> obj skel root-channel 0))) - (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (chain-physics-initialize this (-> this tentacles 0) 10 4096.0 *jellyfish-mainvein-chain-setup*) + (chain-physics-initialize this (-> this tentacles 1) 16 4096.0 *jellyfish-lfront-chain-setup*) + (chain-physics-initialize this (-> this tentacles 2) 21 4096.0 *jellyfish-rfront-chain-setup*) + (chain-physics-initialize this (-> this tentacles 3) 26 4096.0 *jellyfish-lrear-chain-setup*) + (chain-physics-initialize this (-> this tentacles 4) 31 4096.0 *jellyfish-rrear-chain-setup*) + (set! (-> this tentacles 2 negate-y) #t) + (set! (-> this tentacles 4 negate-y) #t) + (let ((a0-35 (-> this skel root-channel 0))) + (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (ja-post) (dotimes (s5-2 5) - (initialize-chain-joints (-> obj tentacles s5-2)) + (initialize-chain-joints (-> this tentacles s5-2)) ) - (let ((a1-15 (-> obj node-list data 16)) + (let ((a1-15 (-> this node-list data 16)) (v1-68 (new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :z 1.0 :w 1.0) @@ -1262,10 +1265,10 @@ ) ) (set! (-> a1-15 param0) jellyfish-joint-mod-tentacle) - (set! (-> a1-15 param1) obj) + (set! (-> a1-15 param1) this) (set! (-> a1-15 param2) (the-as basic v1-68)) ) - (let ((a1-16 (-> obj node-list data 21)) + (let ((a1-16 (-> this node-list data 21)) (v1-70 (new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :z 1.0 :w 1.0) @@ -1275,10 +1278,10 @@ ) ) (set! (-> a1-16 param0) jellyfish-joint-mod-tentacle) - (set! (-> a1-16 param1) obj) + (set! (-> a1-16 param1) this) (set! (-> a1-16 param2) (the-as basic v1-70)) ) - (let ((a1-17 (-> obj node-list data 26)) + (let ((a1-17 (-> this node-list data 26)) (v1-72 (new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :z 1.0 :w 1.0) @@ -1288,10 +1291,10 @@ ) ) (set! (-> a1-17 param0) jellyfish-joint-mod-tentacle) - (set! (-> a1-17 param1) obj) + (set! (-> a1-17 param1) this) (set! (-> a1-17 param2) (the-as basic v1-72)) ) - (let ((a1-18 (-> obj node-list data 31)) + (let ((a1-18 (-> this node-list data 31)) (v1-74 (new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :z 1.0 :w 1.0) @@ -1301,34 +1304,34 @@ ) ) (set! (-> a1-18 param0) jellyfish-joint-mod-tentacle) - (set! (-> a1-18 param1) obj) + (set! (-> a1-18 param1) this) (set! (-> a1-18 param2) (the-as basic v1-74)) ) - (let ((a1-19 (-> obj node-list data 10)) + (let ((a1-19 (-> this node-list data 10)) (v1-76 (new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :x 1.0 :w 1.0) :angle 2730.6667) ) ) (set! (-> a1-19 param0) jellyfish-joint-mod-tentacle) - (set! (-> a1-19 param1) obj) + (set! (-> a1-19 param1) this) (set! (-> a1-19 param2) (the-as basic v1-76)) ) - (set! (-> obj tentacles-initialized) #f) - (set! (-> obj tentacle-clock) 0.0) - (set! (-> obj tentacle-blend) 1.0) + (set! (-> this tentacles-initialized) #f) + (set! (-> this tentacle-clock) 0.0) + (set! (-> this tentacle-blend) 1.0) (add-connection *part-engine* - obj + this 36 - obj + this 318 (new 'static 'vector :x 1966.08 :y -1843.2 :z 2129.92 :w 163840.0) ) (add-connection *part-engine* - obj + this 36 - obj + this 318 (new 'static 'vector :x -1966.08 :y -1843.2 :z 2129.92 :w 163840.0) ) diff --git a/goal_src/jak2/levels/under/pipe-grunt.gc b/goal_src/jak2/levels/under/pipe-grunt.gc index 5a8cba87cc..ac327719ee 100644 --- a/goal_src/jak2/levels/under/pipe-grunt.gc +++ b/goal_src/jak2/levels/under/pipe-grunt.gc @@ -21,11 +21,11 @@ ) -(defmethod go-ambush pipe-grunt ((obj pipe-grunt)) - (go (method-of-object obj ambush)) +(defmethod go-ambush pipe-grunt ((this pipe-grunt)) + (go (method-of-object this ambush)) ) -(defmethod pipe-grunt-method-186 pipe-grunt ((obj pipe-grunt)) +(defmethod pipe-grunt-method-186 pipe-grunt ((this pipe-grunt)) (let ((gp-0 (new 'static 'vector :x -1187061.8 :y -278487.03 :z 8090870.0 :w 1.0))) (let ((v1-0 (new 'static 'vector :x -1148026.9 :y -278487.03 :z 8112414.5 :w 1.0)) (s3-0 (new 'stack-no-clear 'vector)) @@ -35,12 +35,12 @@ (let ((f30-0 (vector-length s3-0))) (vector-normalize! s3-0 1.0) (vector-rotate90-around-y! s4-0 s3-0) - (vector-normalize-copy! (-> obj event-param-point) s3-0 (get-rand-float-range obj 0.0 f30-0)) + (vector-normalize-copy! (-> this event-param-point) s3-0 (get-rand-float-range this 0.0 f30-0)) ) - (vector-normalize! s4-0 (get-rand-float-range obj -16384.0 16384.0)) - (vector+! (-> obj event-param-point) (-> obj event-param-point) s4-0) + (vector-normalize! s4-0 (get-rand-float-range this -16384.0 16384.0)) + (vector+! (-> this event-param-point) (-> this event-param-point) s4-0) ) - (vector+! (-> obj event-param-point) (-> obj event-param-point) gp-0) + (vector+! (-> this event-param-point) (-> this event-param-point) gp-0) ) ) @@ -48,7 +48,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self enemy-flags) (enemy-flag chase-startup)) (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice alert victory)) (let ((v1-7 (-> self root root-prim))) diff --git a/goal_src/jak2/levels/under/sig5-course.gc b/goal_src/jak2/levels/under/sig5-course.gc index 9ab332d106..8adf69cca4 100644 --- a/goal_src/jak2/levels/under/sig5-course.gc +++ b/goal_src/jak2/levels/under/sig5-course.gc @@ -40,23 +40,23 @@ ;; WARN: Return type mismatch time-frame vs none. -(defmethod sig-under-method-263 sig-under ((obj sig-under)) +(defmethod sig-under-method-263 sig-under ((this sig-under)) (let ((s5-0 (current-time))) - (when (and (>= s5-0 (-> obj next-chase-play-time)) - (not (channel-active? obj (the-as uint 0))) - (>= (the-as int (sig-method-256 obj)) 750) + (when (and (>= s5-0 (-> this next-chase-play-time)) + (not (channel-active? this (the-as uint 0))) + (>= (the-as int (sig-method-256 this)) 750) ) (let ((a1-2 (bot-speech-list-method-9 - (-> obj sig5-course chase-speeches) - obj - (-> obj sig5-course speeches) + (-> this sig5-course chase-speeches) + this + (-> this sig5-course speeches) (speech-flags) ) ) ) (when (>= a1-2 0) - (play-speech obj a1-2) - (set! (-> obj next-chase-play-time) (+ s5-0 (get-rand-int-range obj 1500 2700))) + (play-speech this a1-2) + (set! (-> this next-chase-play-time) (+ s5-0 (get-rand-int-range this 1500 2700))) ) ) ) @@ -65,23 +65,23 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod attacked-by-player? sig-under ((obj sig-under) (arg0 process-focusable)) +(defmethod attacked-by-player? sig-under ((this sig-under) (arg0 process-focusable)) "Were we attacked by the player?" (the-as symbol (and (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed)))) - (or (and (logtest? (process-mask enemy) (-> arg0 mask)) (not (logtest? (bot-flags bf26) (-> obj bot-flags)))) - (and (logtest? (-> arg0 mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked))) + (or (and (logtest? (process-mask enemy) (-> arg0 mask)) (not (logtest? (bot-flags bf26) (-> this bot-flags)))) + (and (logtest? (-> arg0 mask) (process-mask target)) (logtest? (-> this bot-flags) (bot-flags attacked))) ) ) ) ) -(defmethod enemy-method-86 sig-under ((obj sig-under)) - (let ((gp-0 (-> obj root))) +(defmethod enemy-method-86 sig-under ((this sig-under)) + (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (find-ground (-> obj root) a1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (find-ground (-> this root) a1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) ) (>= (-> gp-0 gspot-pos y) (-> gp-0 trans y)) ) @@ -89,39 +89,39 @@ ) ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 sig-under ((obj sig-under) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 sig-under ((this sig-under) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond - ((and (and (-> obj next-state) (= (-> obj next-state name) 'jump)) (type? arg0 under-break-floor)) + ((and (and (-> this next-state) (= (-> this next-state name) 'jump)) (type? arg0 under-break-floor)) (let ((v1-5 (-> arg1 param 0))) (send-event arg0 'attack v1-5 (static-attack-info ((id (new-attack-id)) (penetrate-using (penetrate flop))))) ) ) (else - ((method-of-type sig enemy-method-76) obj arg0 arg1) + ((method-of-type sig enemy-method-76) this arg0 arg1) ) ) ) ) -(defmethod general-event-handler sig-under ((obj sig-under) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler sig-under ((this sig-under) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (with-pp (case arg2 (('set-task) - (let* ((s1-1 (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-4))) + (let* ((s1-1 (logtest? (-> this bot-task-bits) (bot-task-bits botbits-4))) (t9-0 (method-of-type sig general-event-handler)) - (s5-1 (t9-0 obj arg0 arg1 arg2 arg3)) + (s5-1 (t9-0 this arg0 arg1 arg2 arg3)) ) - (when (and (not s1-1) (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-4))) + (when (and (not s1-1) (logtest? (-> this bot-task-bits) (bot-task-bits botbits-4))) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer pp)) (set! (-> a1-2 num-params) 0) (set! (-> a1-2 message) 'under-break-floor) (let ((t9-1 send-event-function) - (v1-11 (-> obj actor-group 0 data 8 actor)) + (v1-11 (-> this actor-group 0 data 8 actor)) ) (t9-1 (if v1-11 @@ -140,62 +140,62 @@ (if (= (-> arg3 param 0) 2) (set! v1-14 *sig5-cent2-path0*) ) - (send-event obj 'sig-path v1-14) + (send-event this 'sig-path v1-14) ) ) (('notify) (if (and (type? arg0 sig-shot) (= (-> arg3 param 0) 'die) - (-> obj next-state) - (= (-> obj next-state name) 'intro-shooting) + (-> this next-state) + (= (-> this next-state name) 'intro-shooting) ) - (send-event (handle->process (-> obj growls (-> obj shot-at-growls-index))) 'sig-shot) - ((method-of-type sig general-event-handler) obj arg0 arg1 arg2 arg3) + (send-event (handle->process (-> this growls (-> this shot-at-growls-index))) 'sig-shot) + ((method-of-type sig general-event-handler) this arg0 arg1 arg2 arg3) ) ) (else - ((method-of-type sig general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type sig general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ) ;; WARN: disable def twice: 39. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod sig-under-method-262 sig-under ((obj sig-under) (arg0 symbol)) - (when (or (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-1)) +(defmethod sig-under-method-262 sig-under ((this sig-under) (arg0 symbol)) + (when (or (logtest? (-> this bot-task-bits) (bot-task-bits botbits-1)) (and arg0 (let ((f0-0 81920.0)) - (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> obj root trans))) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) ) ) ) (cond - ((speech-playing? obj 7) - (and (not (channel-active? obj (the-as uint 0))) (scene-play obj "under-centipede-one" #f)) + ((speech-playing? this 7) + (and (not (channel-active? this (the-as uint 0))) (scene-play this "under-centipede-one" #f)) ) (else - (play-speech obj 7) - (reset-warn-time! obj) + (play-speech this 7) + (reset-warn-time! this) #f ) ) ) ) -(defmethod sig-under-method-264 sig-under ((obj sig-under)) - (and (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-3)) - (not (channel-active? obj (the-as uint 0))) - (scene-play obj "under-get-sig-out-res" #f) +(defmethod sig-under-method-264 sig-under ((this sig-under)) + (and (logtest? (-> this bot-task-bits) (bot-task-bits botbits-3)) + (not (channel-active? this (the-as uint 0))) + (scene-play this "under-get-sig-out-res" #f) ) ) -(defmethod sig-under-method-260 sig-under ((obj sig-under)) +(defmethod sig-under-method-260 sig-under ((this sig-under)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) (let ((gp-0 (new 'stack-no-clear 'sphere))) - (set! (-> gp-0 quad) (-> obj root trans quad)) + (set! (-> gp-0 quad) (-> this root trans quad)) (set! (-> gp-0 r) 327680.0) (set! *actor-list-length* 0) (if #t @@ -299,12 +299,12 @@ ) ) -(defmethod sig-under-method-261 sig-under ((obj sig-under) (arg0 vector) (arg1 vector) (arg2 symbol)) - (set! (-> arg0 w) (- (+ (* (-> arg0 x) (-> obj root trans x)) (* (-> arg0 z) (-> obj root trans z))))) +(defmethod sig-under-method-261 sig-under ((this sig-under) (arg0 vector) (arg1 vector) (arg2 symbol)) + (set! (-> arg0 w) (- (+ (* (-> arg0 x) (-> this root trans x)) (* (-> arg0 z) (-> this root trans z))))) (let ((v1-2 (new 'stack-no-clear 'vector))) (set! (-> v1-2 quad) (-> arg1 quad)) (set! (-> v1-2 y) 0.0) - (let ((f0-6 (vector4-dot (the-as vector (-> obj test-plane)) v1-2)) + (let ((f0-6 (vector4-dot (the-as vector (-> this test-plane)) v1-2)) (f1-3 14336.0) (f2-1 16384.0) ) @@ -313,7 +313,7 @@ (set! f2-1 (+ 2048.0 f2-1)) ) (if (and (>= f0-6 -2048.0) (>= f1-3 f0-6)) - (>= (* f2-1 f2-1) (vector-vector-xz-distance-squared arg1 (-> obj root trans))) + (>= (* f2-1 f2-1) (vector-vector-xz-distance-squared arg1 (-> this root trans))) ) ) ) @@ -398,7 +398,7 @@ (ja-eval) ) (when #t - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self bot-flags) (bot-flags bf18)) (let ((gp-3 (+ (current-time) (get-rand-int-range self 30 600)))) (ja-channel-push! 1 (seconds 0.5)) @@ -420,33 +420,33 @@ :post nav-enemy-simple-post ) -(defmethod alive? sig-under ((obj sig-under)) - ((method-of-type bot alive?) obj) +(defmethod alive? sig-under ((this sig-under)) + ((method-of-type bot alive?) this) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod init! sig-under ((obj sig-under)) +(defmethod init! sig-under ((this sig-under)) "Set defaults for various fields." (let ((t9-0 (method-of-type sig init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj too-far-warn-dist-default) 245760.0) - (set! (-> obj too-far-fail-dist-delta-default) 163840.0) + (set! (-> this too-far-warn-dist-default) 245760.0) + (set! (-> this too-far-fail-dist-delta-default) 163840.0) (countdown (v1-3 2) - (set! (-> obj growls v1-3) (the-as handle #f)) + (set! (-> this growls v1-3) (the-as handle #f)) ) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig-under ((obj sig-under)) +(defmethod go-idle sig-under ((this sig-under)) (cond ((task-node-closed? (game-task-node under-sig-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj intro-shooting)) + (go (method-of-object this intro-shooting)) ) ) (none) @@ -516,9 +516,9 @@ (not (logtest? (-> *target* focus-status) (focus-status dead in-air edge-grab))) ) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) - (when (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (when (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) (task-node-open? (game-task-node under-sig-introduction)) (scene-play arg1 "under-find-sig-res" #f) ) @@ -914,7 +914,7 @@ (set! (-> (the-as sigt-wait-spot v1-15) check-done) (the-as (function sigt-wait-spot sig symbol) - (lambda ((arg0 object) (arg1 sig-under)) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.8)) + (lambda ((arg0 object) (arg1 sig-under)) (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.8)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 13 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1050,9 +1050,9 @@ (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) (if (sig-under-method-261 arg1 (-> arg1 test-plane) (target-pos 0) #t) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 16 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1171,7 +1171,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.7)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.7)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 20 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1301,7 +1301,7 @@ (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) (if (and (not (speech-playing? arg1 12)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.5)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.5)) (not (channel-active? arg1 (the-as uint 0))) ) (play-speech arg1 12) @@ -1315,7 +1315,7 @@ #f ) ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (add-process *gui-control* arg1 (gui-channel art-load) (gui-action queue) "under-centipede-three" -99.0 0) @@ -1323,7 +1323,7 @@ #f ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.5)) (process-release? *target*) (reset-warn-time! arg1) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -1392,7 +1392,7 @@ ) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! v1-14 - (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.25)) + (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.25)) (begin (set! (-> s5-0 quad) (-> (target-pos 0) quad)) (set! (-> s5-0 y) 0.0) @@ -1520,7 +1520,7 @@ (return #t) ) (sig-under-method-263 arg1) - (when (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) + (when (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 4)) (sig-method-257 arg1) (let ((f0-0 61440.0)) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg1 root trans))) @@ -1585,16 +1585,16 @@ (return #t) ) (if (not (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-4))) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.5)) (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (logior! (-> arg1 enemy-flags) (enemy-flag enable-on-active checking-water)) ) - (if (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) + (if (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 1)) (not (speech-playing? arg1 21)) (not (channel-active? arg1 (the-as uint 0))) ) @@ -1603,7 +1603,7 @@ (when (zero? (-> arg1 next-chase-play-time)) (let ((a0-14 (-> arg1 actor-group 0 data 7 actor))) (if (and a0-14 (logtest? (-> a0-14 extra perm status) (entity-perm-status subtask-complete))) - (set! (-> arg1 next-chase-play-time) (current-time)) + (set-time! (-> arg1 next-chase-play-time)) ) ) ) @@ -1612,7 +1612,7 @@ (or (= v1-54 'waiting-far) (= v1-54 'waiting-close) (= v1-54 'waiting-turn)) ) ) - (or (nonzero? (-> arg1 next-chase-play-time)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 6))) + (or (nonzero? (-> arg1 next-chase-play-time)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 6))) ) (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) @@ -1633,8 +1633,8 @@ ) (when (or (zero? (-> arg1 next-chase-play-time)) (and (nonzero? (-> arg1 next-chase-play-time)) - (>= (- (current-time) (-> arg1 next-chase-play-time)) (seconds 2)) - (or (>= (- (current-time) (-> arg1 next-chase-play-time)) (seconds 9)) + (time-elapsed? (-> arg1 next-chase-play-time) (seconds 2)) + (or (time-elapsed? (-> arg1 next-chase-play-time) (seconds 9)) (>= (vector-vector-xz-distance s4-1 (-> s5-1 center)) (+ 8192.0 (-> s5-1 center w))) (< 20480.0 (- (-> s4-1 y) (-> s5-1 center y))) ) @@ -1683,7 +1683,7 @@ (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.5)) (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) @@ -1698,7 +1698,7 @@ ) (else (if (and (not (speech-playing? arg1 23)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3.5)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 3.5)) (not (channel-active? arg1 (the-as uint 0))) ) (play-speech arg1 23) diff --git a/goal_src/jak2/levels/under/under-laser.gc b/goal_src/jak2/levels/under/under-laser.gc index 61cbffd56b..27ea68b1f1 100644 --- a/goal_src/jak2/levels/under/under-laser.gc +++ b/goal_src/jak2/levels/under/under-laser.gc @@ -238,14 +238,14 @@ ) ;; WARN: Return type mismatch sound-id vs none. -(defmethod under-laser-method-22 under-laser ((obj under-laser)) +(defmethod under-laser-method-22 under-laser ((this under-laser)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> obj root trans quad)) - (set! (-> s5-0 move-dist quad) (-> obj slave-trans-offset quad)) + (set! (-> s5-0 start-pos quad) (-> this root trans quad)) + (set! (-> s5-0 move-dist quad) (-> this slave-trans-offset quad)) (let ((v1-2 s5-0)) (set! (-> v1-2 radius) 409.6) (set! (-> v1-2 collide-with) (collide-spec jak bot player-list)) - (set! (-> v1-2 ignore-process0) obj) + (set! (-> v1-2 ignore-process0) this) (set! (-> v1-2 ignore-process1) #f) (set! (-> v1-2 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-2 action-mask) (collide-action solid)) @@ -259,10 +259,10 @@ ) (when s5-1 (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector-rotate-around-y! s4-1 (-> obj slave-trans-offset) (if (logtest? (-> obj info options) 1) - 16384.0 - -16384.0 - ) + (vector-rotate-around-y! s4-1 (-> this slave-trans-offset) (if (logtest? (-> this info options) 1) + 16384.0 + -16384.0 + ) ) (vector-normalize! s4-1 1.0) (if (send-event @@ -363,15 +363,15 @@ ) ;; WARN: Return type mismatch process-drawable vs under-laser. -(defmethod relocate under-laser ((obj under-laser) (arg0 int)) - (if (nonzero? (-> obj lightning)) - (&+! (-> obj lightning) arg0) +(defmethod relocate under-laser ((this under-laser) (arg0 int)) + (if (nonzero? (-> this lightning)) + (&+! (-> this lightning) arg0) ) - (the-as under-laser ((method-of-type process-drawable relocate) obj arg0)) + (the-as under-laser ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-laser ((obj under-laser) (arg0 entity-actor)) +(defmethod init-from-entity! under-laser ((this under-laser) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -379,17 +379,17 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-64 res-tag)) - (set! (-> obj root) (the-as collide-shape-moving (new 'process 'trsqv))) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (the-as collide-shape-moving (new 'process 'trsqv))) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-laser" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-7 (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0))) - (set! (-> obj id) (the-as int v1-7)) - (set! (-> obj info) (-> *under-laser-infos* v1-7)) + (let ((v1-7 (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0))) + (set! (-> this id) (the-as int v1-7)) + (set! (-> this info) (-> *under-laser-infos* v1-7)) ) (let ((a1-6 (new 'stack-no-clear 'sync-info-params))) (let ((v1-11 0)) @@ -406,10 +406,10 @@ This commonly includes things such as: (set! (-> a1-6 ease-out) 0.15) (set! (-> a1-6 pause-in) 0.0) (set! (-> a1-6 pause-out) 0.0) - (initialize! (-> obj sync) a1-6) + (initialize! (-> this sync) a1-6) ) - (set! (-> obj clock) (-> *display* user0-clock)) - (let ((s5-1 (-> obj root))) + (set! (-> this clock) (-> *display* user0-clock)) + (let ((s5-1 (-> this root))) (set-vector! (-> s5-1 scale) 1.25 1.25 1.25 1.0) (set! sv-64 (new 'static 'res-tag)) (let ((v1-22 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-64)))) @@ -424,39 +424,39 @@ This commonly includes things such as: (quaternion-rotate-y! (-> s5-1 quat) (-> s5-1 quat) f0-15) ) ) - (vector-z-quaternion! (-> obj laser-dir) (-> s5-1 quat)) - (vector-normalize! (-> obj laser-dir) 1.0) + (vector-z-quaternion! (-> this laser-dir) (-> s5-1 quat)) + (vector-normalize! (-> this laser-dir) 1.0) (quaternion-rotate-y! (-> s5-1 quat) (-> s5-1 quat) -16384.0) - (when (logtest? (-> obj info options) 1) + (when (logtest? (-> this info options) 1) (let ((s4-1 (new 'stack-no-clear 'quaternion))) - (quaternion-vector-angle! s4-1 (-> obj laser-dir) 16384.0) + (quaternion-vector-angle! s4-1 (-> this laser-dir) 16384.0) (quaternion*! (-> s5-1 quat) s4-1 (-> s5-1 quat)) ) ) - (let ((f30-0 (-> obj info laser-radius))) + (let ((f30-0 (-> this info laser-radius))) (let ((s4-2 (new 'stack-no-clear 'vector))) - (vector-normalize-copy! s4-2 (-> obj laser-dir) (- f30-0)) + (vector-normalize-copy! s4-2 (-> this laser-dir) (- f30-0)) (vector+! (-> s5-1 trans) (-> s5-1 trans) s4-2) ) - (vector-normalize-copy! (-> obj slave-trans-offset) (-> obj laser-dir) (* 2.0 f30-0)) + (vector-normalize-copy! (-> this slave-trans-offset) (-> this laser-dir) (* 2.0 f30-0)) ) - (set! (-> obj zero-pos quad) (-> s5-1 trans quad)) - (let ((f30-1 (-> obj info laser-move-dist))) + (set! (-> this zero-pos quad) (-> s5-1 trans quad)) + (let ((f30-1 (-> this info laser-move-dist))) (cond - ((logtest? (-> obj info options) 1) - (set! (-> obj one-pos quad) (-> obj zero-pos quad)) - (+! (-> obj one-pos y) f30-1) + ((logtest? (-> this info options) 1) + (set! (-> this one-pos quad) (-> this zero-pos quad)) + (+! (-> this one-pos y) f30-1) ) (else (let ((s4-3 (new 'stack-no-clear 'vector))) - (vector-rotate-around-y! s4-3 (-> obj laser-dir) 16384.0) + (vector-rotate-around-y! s4-3 (-> this laser-dir) 16384.0) (vector-normalize! s4-3 f30-1) - (vector+! (-> obj one-pos) (-> obj zero-pos) s4-3) + (vector+! (-> this one-pos) (-> this zero-pos) s4-3) ) ) ) ) - (vector-lerp! (-> s5-1 trans) (-> obj zero-pos) (-> obj one-pos) (get-norm! (-> obj sync) 0)) + (vector-lerp! (-> s5-1 trans) (-> this zero-pos) (-> this one-pos) (get-norm! (-> this sync) 0)) ) (let ((a2-13 (new 'static 'lightning-spec :name #f @@ -478,24 +478,24 @@ This commonly includes things such as: ) ) ) - (set! (-> obj lightning) (new 'process 'lightning-control a2-13 obj 0.0)) + (set! (-> this lightning) (new 'process 'lightning-control a2-13 this 0.0)) ) (let ((a3-5 (new 'stack-no-clear 'vector))) - (vector-float*! a3-5 (-> obj slave-trans-offset) 0.5) - (vector+! a3-5 a3-5 (-> obj root trans)) - (if (zero? (-> obj id)) - (set! (-> obj sound) (new 'process 'ambient-sound (static-sound-spec "und-laser-near" :fo-max 40) a3-5)) - (set! (-> obj sound) (new 'process 'ambient-sound (static-sound-spec "und-laser-beam" :fo-max 40) a3-5)) + (vector-float*! a3-5 (-> this slave-trans-offset) 0.5) + (vector+! a3-5 a3-5 (-> this root trans)) + (if (zero? (-> this id)) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "und-laser-near" :fo-max 40) a3-5)) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "und-laser-beam" :fo-max 40) a3-5)) ) ) - (set! (-> obj draw-test-script) (res-lump-struct (-> obj entity) 'on-activate script-context)) + (set! (-> this draw-test-script) (res-lump-struct (-> this entity) 'on-activate script-context)) (cond - ((and (script-eval (the-as pair (-> obj draw-test-script))) (= *bot-record-path* -1)) - (update-vol! (-> obj sound) 0.0) - (go (method-of-object obj dormant)) + ((and (script-eval (the-as pair (-> this draw-test-script))) (= *bot-record-path* -1)) + (update-vol! (-> this sound) 0.0) + (go (method-of-object this dormant)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) diff --git a/goal_src/jak2/levels/under/under-obs.gc b/goal_src/jak2/levels/under/under-obs.gc index d1bf58811c..fc1ba1040b 100644 --- a/goal_src/jak2/levels/under/under-obs.gc +++ b/goal_src/jak2/levels/under/under-obs.gc @@ -345,10 +345,10 @@ (>= (* f0-18 f0-18) (vector-vector-xz-distance-squared a0-5 (-> self root trans))) ) ) - (if (>= (- (current-time) (-> self last-recharge-time)) (seconds 1)) + (if (time-elapsed? (-> self last-recharge-time) (seconds 1)) (sound-play "oxygen-recharge") ) - (set! (-> self last-recharge-time) (current-time)) + (set-time! (-> self last-recharge-time)) (send-event (ppointer->process *underb-master*) 'bubbler) ) ) @@ -358,26 +358,26 @@ :code sleep-code ) -(defmethod deactivate bubbler ((obj bubbler)) - (sound-stop (-> obj ambient-id)) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate bubbler ((this bubbler)) + (sound-stop (-> this ambient-id)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! bubbler ((obj bubbler) (arg0 entity-actor)) +(defmethod init-from-entity! bubbler ((this bubbler) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 500) obj)) - (set! (-> obj rod-of-god-scale) 1.0) - (set! (-> obj ambient-id) (sound-play "bubbler" :position (-> obj root trans))) - (go (method-of-object obj idle)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 500) this)) + (set! (-> this rod-of-god-scale) 1.0) + (set! (-> this ambient-id) (sound-play "bubbler" :position (-> this root trans))) + (go (method-of-object this idle)) (none) ) @@ -567,7 +567,7 @@ This commonly includes things such as: :trans (behavior () (rider-trans) (when (-> self rider-started) - (when (and (not (-> self ridden)) (>= (- (current-time) (-> self last-ridden)) (seconds 2))) + (when (and (not (-> self ridden)) (time-elapsed? (-> self last-ridden) (seconds 2))) (if (= (-> self extra-id) 1) (send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'player #f) ) @@ -590,7 +590,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-rise-plat ((obj under-rise-plat) (arg0 entity-actor)) +(defmethod init-from-entity! under-rise-plat ((this under-rise-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -598,7 +598,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -614,37 +614,37 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (-> obj root) + (process-drawable-from-entity! this arg0) + (-> this root) (set! sv-16 (new 'static 'res-tag)) (let ((v1-16 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-16 - (+! (-> obj root trans x) (-> v1-16 0)) - (+! (-> obj root trans y) (-> v1-16 1)) - (+! (-> obj root trans z) (-> v1-16 2)) + (+! (-> this root trans x) (-> v1-16 0)) + (+! (-> this root trans y) (-> v1-16 1)) + (+! (-> this root trans z) (-> v1-16 2)) ) ) - (set! (-> obj extra-id) (res-lump-value arg0 'extra-id int :time -1000000000.0)) - (set! (-> obj delta-y) (res-lump-float arg0 'height :default 92160.0)) + (set! (-> this extra-id) (res-lump-value arg0 'extra-id int :time -1000000000.0)) + (set! (-> this delta-y) (res-lump-float arg0 'height :default 92160.0)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-rise-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-23 (-> obj root))) - (set! (-> obj down-y) (-> v1-23 trans y)) - (+! (-> v1-23 trans y) (-> obj delta-y)) - (set! (-> obj up-y) (-> v1-23 trans y)) - (set! (-> obj down-threshold) (* 0.6666667 (-> obj delta-y))) - (set! (-> obj up-threshold) (- (-> obj down-threshold))) + (let ((v1-23 (-> this root))) + (set! (-> this down-y) (-> v1-23 trans y)) + (+! (-> v1-23 trans y) (-> this delta-y)) + (set! (-> this up-y) (-> v1-23 trans y)) + (set! (-> this down-threshold) (* 0.6666667 (-> this delta-y))) + (set! (-> this up-threshold) (- (-> this down-threshold))) (vector-reset! (-> v1-23 transv)) ) - (set! (-> obj ridden) #f) - (set! (-> obj rider-started) #f) - (set! (-> obj draw light-index) (the-as uint 2)) - (go (method-of-object obj idle-up)) + (set! (-> this ridden) #f) + (set! (-> this rider-started) #f) + (set! (-> this draw light-index) (the-as uint 2)) + (go (method-of-object this idle-up)) (none) ) @@ -865,15 +865,15 @@ This commonly includes things such as: :bounds (static-spherem 0 2 0 5) ) -(defmethod rigid-body-object-method-29 under-buoy-plat ((obj under-buoy-plat) (arg0 float)) - ((the-as (function rigid-body-object float none) (find-parent-method under-buoy-plat 29)) obj arg0) - (rigid-body-platform-method-56 obj (-> obj orig-trans)) +(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) + (rigid-body-platform-method-56 this (-> this orig-trans)) 0 (none) ) -(defmethod allocate-and-init-cshape under-buoy-plat ((obj under-buoy-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape under-buoy-plat ((this under-buoy-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -895,7 +895,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -935,20 +935,20 @@ This commonly includes things such as: ) ) -(defmethod rigid-body-platform-method-53 under-buoy-plat ((obj under-buoy-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-53 under-buoy-plat ((this under-buoy-plat) (arg0 vector)) -220341.05 ) -(defmethod rigid-body-platform-method-56 under-buoy-plat ((obj under-buoy-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-56 under-buoy-plat ((this under-buoy-plat) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj rbody state position)) + (vector-! v1-0 arg0 (-> this rbody state position)) (set! (-> v1-0 y) 0.0) (let* ((f0-1 (vector-length v1-0)) (f1-1 (* 4.0 (fmax 0.0 (fmin 4096.0 (+ -819.2 f0-1))))) ) (when (< 0.0 f1-1) (vector-float*! v1-0 v1-0 (/ f1-1 f0-1)) - (rigid-body-method-20 (-> obj rbody state) v1-0) + (rigid-body-method-20 (-> this rbody state) v1-0) ) ) ) @@ -956,20 +956,20 @@ This commonly includes things such as: (none) ) -(defmethod init-skel-and-rigid-body under-buoy-plat ((obj under-buoy-plat)) +(defmethod init-skel-and-rigid-body under-buoy-plat ((this under-buoy-plat)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-buoy-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *under-buoy-plat-platform-constants*) - (set! (-> obj orig-trans quad) (-> obj root trans quad)) - (set! (-> obj anchor-point quad) (-> obj root trans quad)) - (set! (-> obj surface-height) (-> obj root trans y)) - (set! (-> obj info info cm-offset-joint y) 6144.0) - (let ((s5-1 (-> obj info control-point-count))) + (alloc-and-init-rigid-body-control this *under-buoy-plat-platform-constants*) + (set! (-> this orig-trans quad) (-> this root trans quad)) + (set! (-> this anchor-point quad) (-> this root trans quad)) + (set! (-> this surface-height) (-> this root trans y)) + (set! (-> this info info cm-offset-joint y) 6144.0) + (let ((s5-1 (-> this info control-point-count))) (dotimes (s4-1 s5-1) - (let ((s3-0 (-> obj control-point-array data s4-1))) + (let ((s3-0 (-> this control-point-array data s4-1))) (let ((f30-0 (* 65536.0 (/ (the float s4-1) (the float s5-1))))) (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) (set! (-> s3-0 local-pos y) 8192.0) @@ -979,18 +979,18 @@ This commonly includes things such as: ) ) ) - (process-spawn under-buoy-chain (target-pos 0) (-> obj entity) :to obj) - (set! (-> obj base) (process-spawn under-buoy-base (target-pos 0) (-> obj entity) :to obj)) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj draw light-index) (the-as uint 2)) + (process-spawn under-buoy-chain (target-pos 0) (-> this entity) :to this) + (set! (-> this base) (process-spawn under-buoy-base (target-pos 0) (-> this entity) :to this)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 2)) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod rigid-body-object-method-34 under-buoy-plat ((obj under-buoy-plat)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj running)) - (go (method-of-object obj waiting)) +(defmethod rigid-body-object-method-34 under-buoy-plat ((this under-buoy-plat)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this running)) + (go (method-of-object this waiting)) ) (none) ) @@ -1062,7 +1062,7 @@ This commonly includes things such as: ) -(defmethod apply-gravity under-mine-chain-physics ((obj under-mine-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (local-vars (v1-7 vector) (v1-11 vector) (a0-17 float) (a0-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1070,28 +1070,28 @@ This commonly includes things such as: (vf2 :class vf) ) (init-vf0-vector) - (vector-float*! arg0 (-> obj gravity) (* 81.92 (-> self clock time-adjust-ratio))) + (vector-float*! arg0 (-> this gravity) (* 81.92 (-> self clock time-adjust-ratio))) (cond - ((= arg1 (+ (-> obj num-joints) -1)) + ((= arg1 (+ (-> this num-joints) -1)) (let ((v1-4 (new 'stack-no-clear 'vector))) (set! (-> v1-4 quad) (-> arg2 entity trans quad)) - (vector-! v1-4 v1-4 (the-as vector (-> obj chain-joints arg1))) + (vector-! v1-4 v1-4 (the-as vector (-> this chain-joints arg1))) (vector+float*! arg0 arg0 v1-4 1.0) ) ) (else (cond - ((>= arg1 (the-as int (+ (-> obj num-joints) -1))) + ((>= arg1 (the-as int (+ (-> this num-joints) -1))) (set! v1-7 (new 'stack-no-clear 'vector)) (set! (-> v1-7 quad) (-> arg2 entity trans quad)) (+! (-> v1-7 y) 8192.0) ) (else (set! v1-7 (new 'stack-no-clear 'vector)) - (set! (-> v1-7 quad) (-> obj chain-joints (+ arg1 1) position quad)) + (set! (-> v1-7 quad) (-> this chain-joints (+ arg1 1) position quad)) ) ) - (vector-! v1-7 v1-7 (the-as vector (-> obj chain-joints arg1))) + (vector-! v1-7 v1-7 (the-as vector (-> this chain-joints arg1))) (.lvf vf1 (&-> v1-7 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -1100,21 +1100,21 @@ This commonly includes things such as: (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov a0-17 vf1) (let ((f0-6 (sqrtf a0-17))) - (vector+float*! arg0 arg0 v1-7 (/ (* 1.1 (- f0-6 (-> obj joint-length))) f0-6)) + (vector+float*! arg0 arg0 v1-7 (/ (* 1.1 (- f0-6 (-> this joint-length))) f0-6)) ) (set! v1-11 (cond ((zero? arg1) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg2 node-list data (-> obj root-joint-index))) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg2 node-list data (-> this root-joint-index))) ) (else (set! v1-11 (new 'stack-no-clear 'vector)) - (set! (-> v1-11 quad) (-> obj chain-joints (+ arg1 -1) position quad)) + (set! (-> v1-11 quad) (-> this chain-joints (+ arg1 -1) position quad)) v1-11 ) ) ) - (vector-! v1-11 v1-11 (the-as vector (-> obj chain-joints arg1))) + (vector-! v1-11 v1-11 (the-as vector (-> this chain-joints arg1))) (.lvf vf1 (&-> v1-11 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -1123,7 +1123,7 @@ This commonly includes things such as: (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov a0-26 vf1) (let ((f0-9 (sqrtf a0-26))) - (vector+float*! arg0 arg0 v1-11 (/ (* 1.1 (- f0-9 (-> obj joint-length))) f0-9)) + (vector+float*! arg0 arg0 v1-11 (/ (* 1.1 (- f0-9 (-> this joint-length))) f0-9)) ) ) ) @@ -1132,14 +1132,14 @@ This commonly includes things such as: ) ) -(defmethod chain-physics-method-14 under-mine-chain-physics ((obj under-mine-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) ) ;; WARN: Return type mismatch int vs vector. -(defmethod clamp-length under-mine-chain-physics ((obj under-mine-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) +(defmethod clamp-length under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg3 entity trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1155,7 +1155,7 @@ This commonly includes things such as: (the-as vector 0) ) -(defmethod chain-physics-method-16 under-mine-chain-physics ((obj under-mine-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 under-mine-chain-physics ((this under-mine-chain-physics) (arg0 int)) 21845.334 ) @@ -1220,7 +1220,7 @@ This commonly includes things such as: (defstate explode (under-mine) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-3 (-> self root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) (set! (-> v1-3 prim-core collide-with) (collide-spec)) @@ -1371,28 +1371,28 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch process-drawable vs under-mine. -(defmethod relocate under-mine ((obj under-mine) (arg0 int)) - (if (nonzero? (-> obj main-mod)) - (&+! (-> obj main-mod) arg0) +(defmethod relocate under-mine ((this under-mine) (arg0 int)) + (if (nonzero? (-> this main-mod)) + (&+! (-> this main-mod) arg0) ) - (if (nonzero? (-> obj head-mod)) - (&+! (-> obj head-mod) arg0) + (if (nonzero? (-> this head-mod)) + (&+! (-> this head-mod) arg0) ) - (if (nonzero? (-> obj chain)) - (&+! (-> obj chain) arg0) + (if (nonzero? (-> this chain)) + (&+! (-> this chain) arg0) ) - (the-as under-mine ((method-of-type process-drawable relocate) obj arg0)) + (the-as under-mine ((method-of-type process-drawable relocate) this arg0)) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-mine ((obj under-mine) (arg0 entity-actor)) +(defmethod init-from-entity! under-mine ((this under-mine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec enemy camera-blocker)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) @@ -1408,34 +1408,34 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-mine" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj chain-initialized) #f) - (set! (-> obj chain) (new 'process 'under-mine-chain-physics)) - (chain-physics-initialize obj (-> obj chain) 15 1843.2 *under-mine-chain-setup*) - (set! (-> obj chain negate-y) #t) - (set! (-> obj chain axial-slop) 1820.4445) - (set! (-> obj chain maximum-stretch) 100.0) - (set! (-> obj chain stretch-vel) 0.7) - (set! (-> obj chain stretch-vel-parallel) 0.9) - (set! (-> obj chain compress-vel) 0.85) - (set! (-> obj chain compress-vel-parallel) 0.9) - (set! (-> obj main-mod) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 3)) - (set! (-> obj main-mod track-mode) (track-mode no-rotate no-scale)) - (mode-set! (-> obj main-mod) (joint-mod-mode joint-set-world)) - (set! (-> obj main-mod trans quad) (-> obj entity trans quad)) - (set! (-> obj head-mod) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 15)) - (set! (-> obj head-mod track-mode) (track-mode no-trans no-scale)) - (mode-set! (-> obj head-mod) (joint-mod-mode joint-set*)) - (quaternion-identity! (-> obj head-mod quat)) - (set! (-> obj draw light-index) (the-as uint 10)) - (go (method-of-object obj idle)) + (set! (-> this chain-initialized) #f) + (set! (-> this chain) (new 'process 'under-mine-chain-physics)) + (chain-physics-initialize this (-> this chain) 15 1843.2 *under-mine-chain-setup*) + (set! (-> this chain negate-y) #t) + (set! (-> this chain axial-slop) 1820.4445) + (set! (-> this chain maximum-stretch) 100.0) + (set! (-> this chain stretch-vel) 0.7) + (set! (-> this chain stretch-vel-parallel) 0.9) + (set! (-> this chain compress-vel) 0.85) + (set! (-> this chain compress-vel-parallel) 0.9) + (set! (-> this main-mod) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 3)) + (set! (-> this main-mod track-mode) (track-mode no-rotate no-scale)) + (mode-set! (-> this main-mod) (joint-mod-mode joint-set-world)) + (set! (-> this main-mod trans quad) (-> this entity trans quad)) + (set! (-> this head-mod) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 15)) + (set! (-> this head-mod track-mode) (track-mode no-trans no-scale)) + (mode-set! (-> this head-mod) (joint-mod-mode joint-set*)) + (quaternion-identity! (-> this head-mod quat)) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) (none) ) @@ -1457,31 +1457,31 @@ This commonly includes things such as: :bounds (static-spherem 0 0 5.6 9.2) ) -(defmethod get-art-group under-lift ((obj under-lift)) +(defmethod get-art-group under-lift ((this under-lift)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-under-lift" (the-as (pointer uint32) #f)) ) -(defmethod move-between-points under-lift ((obj under-lift) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points under-lift ((this under-lift) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) ) ) ) ) -(defmethod commited-to-ride? under-lift ((obj under-lift)) +(defmethod commited-to-ride? under-lift ((this under-lift)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -1491,17 +1491,17 @@ This commonly includes things such as: ) (when a0-2 (let* ((v1-1 (get-trans a0-2 0)) - (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> obj root trans))) + (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this root trans))) ) - (vector-inv-orient-by-quat! gp-2 gp-2 (-> obj root quat)) + (vector-inv-orient-by-quat! gp-2 gp-2 (-> this root quat)) (and (< (fabs (-> gp-2 x)) 20480.0) (< 0.0 (-> gp-2 z)) (< (-> gp-2 z) 40960.0)) ) ) ) ) -(defmethod under-lift-method-49 under-lift ((obj under-lift) (arg0 symbol)) - (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) +(defmethod under-lift-method-49 under-lift ((this under-lift) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle pusher)) @@ -1561,24 +1561,24 @@ This commonly includes things such as: ) ) -(defmethod deactivate under-lift ((obj under-lift)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method under-lift 10)) obj) +(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) (none) ) -(defmethod init-plat! under-lift ((obj under-lift)) +(defmethod init-plat! under-lift ((this under-lift)) "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." - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj draw light-index) (the-as uint 4)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this draw light-index) (the-as uint 4)) 0 (none) ) -(defmethod init-plat-collision! under-lift ((obj under-lift)) +(defmethod init-plat-collision! under-lift ((this under-lift)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1611,9 +1611,9 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (under-lift-method-49 obj #f) + (under-lift-method-49 this #f) (none) ) @@ -1701,11 +1701,13 @@ For example for an elevator pre-compute the distance between the first and last (ja-play-spooled-anim (the-as spool-anim (-> self anim)) (ja-group) + ;; og:preserve-this added cast (the-as art-joint-anim s5-1) (the-as (function process-drawable symbol) false-func) ) ) (ja-channel-set! 1) + ;; og:preserve-this added cast (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim s5-1)) ) ) @@ -1718,17 +1720,17 @@ For example for an elevator pre-compute the distance between the first and last ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-door ((obj under-break-door) (arg0 entity-actor)) +(defmethod init-from-entity! under-break-door ((this under-break-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (let ((s3-0 ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'art-name 'interp -1000000000.0 @@ -1739,8 +1741,8 @@ This commonly includes things such as: ) (s4-0 (art-group-get-by-name *level* "skel-under-break-door" (the-as (pointer uint32) #f))) ) - (set! (-> obj art-name) (the-as string s3-0)) - (let ((s2-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this art-name) (the-as string s3-0)) + (let ((s2-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-8 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list)) @@ -1755,35 +1757,35 @@ This commonly includes things such as: (set! (-> s2-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s2-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s2-0) + (set! (-> this root) s2-0) ) (cond - ((string= (-> obj art-name) "under-break-door-1") - (set! (-> obj anim) + ((string= (-> this art-name) "under-break-door-1") + (set! (-> this anim) (the-as art-joint-anim (new 'static 'spool-anim :name "under-break-door-1" :anim-name "1-break" :parts 1 :command-list '()) ) ) ) - ((string= (-> obj art-name) "under-break-door-2") - (set! (-> obj anim) + ((string= (-> this art-name) "under-break-door-2") + (set! (-> this anim) (the-as art-joint-anim (new 'static 'spool-anim :name "under-break-door-2" :anim-name "2-break" :parts 1 :command-list '()) ) ) ) - ((string= (-> obj art-name) "under-break-door-3") - (set! (-> obj anim) + ((string= (-> this art-name) "under-break-door-3") + (set! (-> this anim) (the-as art-joint-anim (new 'static 'spool-anim :name "under-break-door-3" :anim-name "3-break" :parts 2 :command-list '()) ) ) ) - ((string= (-> obj art-name) "under-break-door-4") - (set! (-> obj anim) + ((string= (-> this art-name) "under-break-door-4") + (set! (-> this anim) (the-as art-joint-anim (new 'static 'spool-anim :name "under-break-door-4" :anim-name "4-break" :parts 1 :command-list '()) @@ -1794,21 +1796,21 @@ This commonly includes things such as: (go process-drawable-art-error (the-as string s3-0)) ) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0)) ) (ja-channel-set! 1) - (let* ((s5-1 (-> obj skel root-channel 0)) - (s4-1 (-> obj draw art-group)) + (let* ((s5-1 (-> this skel root-channel 0)) + (s4-1 (-> this draw art-group)) (s3-1 (method-of-object s4-1 get-art-by-name-method)) ) - (format (clear *temp-string*) "~S-idle" (-> obj art-name)) + (format (clear *temp-string*) "~S-idle" (-> this art-name)) (set! (-> s5-1 frame-group) (the-as art-joint-anim (s3-1 s4-1 *temp-string* (the-as type #f)))) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj hit) #t) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 10)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this hit) #t) + (go (method-of-object this idle)) ) (none) ) @@ -1849,14 +1851,14 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-a ((obj under-seaweed-a) (arg0 entity-actor)) +(defmethod init-from-entity! under-seaweed-a ((this under-seaweed-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1901,15 +1903,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-24 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1949,21 +1951,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-b ((obj under-seaweed-b) (arg0 entity-actor)) +(defmethod init-from-entity! under-seaweed-b ((this under-seaweed-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2003,21 +2005,21 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-c ((obj under-seaweed-c) (arg0 entity-actor)) +(defmethod init-from-entity! under-seaweed-c ((this under-seaweed-c) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-c" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2057,63 +2059,63 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-d ((obj under-seaweed-d) (arg0 entity-actor)) +(defmethod init-from-entity! under-seaweed-d ((this under-seaweed-d) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-d" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) -(defmethod draw hud-mech-air-tank ((obj hud-mech-air-tank)) +(defmethod draw hud-mech-air-tank ((this hud-mech-air-tank)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 472.0 (* 100.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 472.0 (* 100.0 (-> this offset)))) 208 ) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) 0 51) - (set! (-> obj sprites 0 scale-x) 0.8) - (set! (-> obj sprites 0 scale-y) 0.8) - (set! (-> obj sprites 1 scale-x) 0.8) - (set! (-> obj sprites 1 scale-y) 0.8) - (set! (-> obj sprites 3 scale-x) 0.8) - (set! (-> obj sprites 3 scale-y) 0.8) - (set! (-> obj sprites 2 scale-x) 3.2) - (set! (-> obj sprites 2 scale-y) (* 4.56 (- 1.0 (-> *game-info* air-supply)))) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites)) 0 2) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites)) -30 -20) - ((method-of-type hud draw) obj) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 0 51) + (set! (-> this sprites 0 scale-x) 0.8) + (set! (-> this sprites 0 scale-y) 0.8) + (set! (-> this sprites 1 scale-x) 0.8) + (set! (-> this sprites 1 scale-y) 0.8) + (set! (-> this sprites 3 scale-x) 0.8) + (set! (-> this sprites 3 scale-y) 0.8) + (set! (-> this sprites 2 scale-x) 3.2) + (set! (-> this sprites 2 scale-y) (* 4.56 (- 1.0 (-> *game-info* air-supply)))) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) 0 2) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) -30 -20) + ((method-of-type hud draw) this) 0 (none) ) -(defmethod update-values hud-mech-air-tank ((obj hud-mech-air-tank)) - (set! (-> obj values 0 target) (the int (-> *game-info* air-supply))) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-mech-air-tank ((this hud-mech-air-tank)) + (set! (-> this values 0 target) (the int (-> *game-info* air-supply))) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) -(defmethod init-callback hud-mech-air-tank ((obj hud-mech-air-tank)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-mech-air-tank ((this hud-mech-air-tank)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xd55))) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xd55))) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xd55))) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd55))) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xd55))) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xd55))) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xd55))) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd55))) 0 (none) ) diff --git a/goal_src/jak2/levels/under/under-shoot-block.gc b/goal_src/jak2/levels/under/under-shoot-block.gc index 2351fd03e1..0fb34fedbb 100644 --- a/goal_src/jak2/levels/under/under-shoot-block.gc +++ b/goal_src/jak2/levels/under/under-shoot-block.gc @@ -795,12 +795,12 @@ ) ) -(defmethod under-block-method-48 under-block ((obj under-block) (arg0 int) (arg1 int)) - (let ((v1-0 (-> obj puzzle))) +(defmethod under-block-method-48 under-block ((this under-block) (arg0 int) (arg1 int)) + (let ((v1-0 (-> this puzzle))) (when (and (>= arg0 0) (< arg0 (-> v1-0 cells-wide)) (>= arg1 0) (< arg1 (-> v1-0 cells-tall))) (let* ((a1-1 (+ (* arg1 (-> v1-0 cells-wide)) arg0)) (a2-4 (-> (the-as (pointer int8) (&+ (-> v1-0 cells) a1-1)))) - (a0-1 (-> obj my-id)) + (a0-1 (-> this my-id)) ) (when (or (zero? a2-4) (= a2-4 a0-1)) (set! (-> (the-as (pointer int8) (&+ (-> v1-0 cells) a1-1))) a0-1) @@ -811,11 +811,11 @@ ) ) -(defmethod under-block-method-46 under-block ((obj under-block) (arg0 int) (arg1 int)) - (let ((v1-0 (-> obj puzzle))) +(defmethod under-block-method-46 under-block ((this under-block) (arg0 int) (arg1 int)) + (let ((v1-0 (-> this puzzle))) (when (and (>= arg0 0) (< arg0 (-> v1-0 cells-wide)) (>= arg1 0) (< arg1 (-> v1-0 cells-tall))) (let ((a1-1 (+ (* arg1 (-> v1-0 cells-wide)) arg0))) - (when (= (-> (the-as (pointer int8) (&+ (-> v1-0 cells) a1-1))) (-> obj my-id)) + (when (= (-> (the-as (pointer int8) (&+ (-> v1-0 cells) a1-1))) (-> this my-id)) (set! (-> (the-as (pointer int8) (&+ (-> v1-0 cells) a1-1))) 0) 0 ) @@ -825,8 +825,8 @@ (none) ) -(defmethod under-block-method-47 under-block ((obj under-block) (arg0 int) (arg1 int)) - (let ((v1-0 (-> obj puzzle)) +(defmethod under-block-method-47 under-block ((this under-block) (arg0 int) (arg1 int)) + (let ((v1-0 (-> this puzzle)) (v0-0 -1) ) (when (and (>= arg0 0) (< arg0 (-> v1-0 cells-wide)) (>= arg1 0) (< arg1 (-> v1-0 cells-tall))) @@ -838,23 +838,23 @@ ) ) -(defmethod under-block-method-43 under-block ((obj under-block) (arg0 int) (arg1 int)) - (let ((v1-3 (under-block-method-47 obj (+ (-> obj col) arg0) (+ (-> obj row) arg1)))) - (or (zero? v1-3) (= v1-3 -2) (= v1-3 (-> obj my-id))) +(defmethod under-block-method-43 under-block ((this under-block) (arg0 int) (arg1 int)) + (let ((v1-3 (under-block-method-47 this (+ (-> this col) arg0) (+ (-> this row) arg1)))) + (or (zero? v1-3) (= v1-3 -2) (= v1-3 (-> this my-id))) ) ) -(defmethod under-block-method-49 under-block ((obj under-block) (arg0 int) (arg1 int)) - (= (under-block-method-47 obj (+ (-> obj col) arg0) (+ (-> obj row) arg1)) -1) +(defmethod under-block-method-49 under-block ((this under-block) (arg0 int) (arg1 int)) + (= (under-block-method-47 this (+ (-> this col) arg0) (+ (-> this row) arg1)) -1) ) -(defmethod under-block-method-44 under-block ((obj under-block)) - (let ((v1-0 (-> obj puzzle)) - (a2-0 (-> obj puzzle slots)) +(defmethod under-block-method-44 under-block ((this under-block)) + (let ((v1-0 (-> this puzzle)) + (a2-0 (-> this puzzle slots)) ) (countdown (a1-1 (-> a2-0 length)) (let ((a3-2 (-> a2-0 a1-1))) - (when (and (= (-> a3-2 col) (-> obj col)) (= (-> a3-2 row) (-> obj row))) + (when (and (= (-> a3-2 col) (-> this col)) (= (-> a3-2 row) (-> this row))) (logior! (-> v1-0 slot-mask) (ash 1 a1-1)) (return #t) ) @@ -864,59 +864,61 @@ #f ) -(defmethod under-block-method-42 under-block ((obj under-block)) - (set! (-> obj activated-time) (current-time)) - (logior! (-> obj flags) (under-block-flags unbflags-1)) - (set! (-> obj pulse-pc) 0) - (set! (-> obj pulse-op) 0) +(defmethod under-block-method-42 under-block ((this under-block)) + (set-time! (-> this activated-time)) + (logior! (-> this flags) (under-block-flags unbflags-1)) + (set! (-> this pulse-pc) 0) + (set! (-> this pulse-op) 0) 0 (none) ) ;; WARN: Return type mismatch object vs none. ;; WARN: Function (method 45 under-block) has a return type of none, but the expression builder found a return statement. -(defmethod under-block-method-45 under-block ((obj under-block)) - (let ((v1-0 (-> obj puzzle))) - (when (logtest? (-> obj flags) (under-block-flags unbflags-1)) +(defmethod under-block-method-45 under-block ((this under-block)) + (let ((v1-0 (-> this puzzle))) + (when (logtest? (-> this flags) (under-block-flags unbflags-1)) (cond ((!= (-> v1-0 slot-mask) (-> v1-0 slot-mask-full)) - (when (zero? (-> obj pulse-op)) - (if (< (- (current-time) (-> obj activated-time)) - (the-as time-frame (-> (the-as (pointer uint32) (&+ (-> obj puzzle pulse-ops) (* (-> obj pulse-pc) 4))))) - ) + (when (zero? (-> this pulse-op)) + (if (not (time-elapsed? + (-> this activated-time) + (the-as time-frame (-> (the-as (pointer uint32) (&+ (-> this puzzle pulse-ops) (* (-> this pulse-pc) 4))))) + ) + ) (return #f) ) - (set! (-> obj pulse-op) - (the-as int (-> (the-as (pointer uint32) (&+ (-> obj puzzle pulse-ops) (* (+ (-> obj pulse-pc) 1) 4))))) + (set! (-> this pulse-op) + (the-as int (-> (the-as (pointer uint32) (&+ (-> this puzzle pulse-ops) (* (+ (-> this pulse-pc) 1) 4))))) ) - (+! (-> obj pulse-pc) 2) - (case (-> obj pulse-op) + (+! (-> this pulse-pc) 2) + (case (-> this pulse-op) ((1) - (set! (-> obj pulse-ctr) 3) + (set! (-> this pulse-ctr) 3) (sound-play "und-block-flash") ) ((2) - (go (method-of-object obj explode)) + (go (method-of-object this explode)) ) ) ) - (case (-> obj pulse-op) + (case (-> this pulse-op) ((1) - (let ((v1-24 (-> obj pulse-ctr))) + (let ((v1-24 (-> this pulse-ctr))) (cond ((= v1-24 3) - (set-vector! (-> obj draw color-mult) 1.1 0.25 0.25 1.0) - (+! (-> obj pulse-ctr) -1) + (set-vector! (-> this draw color-mult) 1.1 0.25 0.25 1.0) + (+! (-> this pulse-ctr) -1) ) ((or (= v1-24 2) (= v1-24 1)) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj draw color-emissive) 1.0 1.0 1.0 1.0) - (+! (-> obj pulse-ctr) -1) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this draw color-emissive) 1.0 1.0 1.0 1.0) + (+! (-> this pulse-ctr) -1) ) ((zero? v1-24) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj draw color-emissive) 0.0 0.0 0.0 1.0) - (set! (-> obj pulse-op) 0) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 0.0 0.0 1.0) + (set! (-> this pulse-op) 0) 0 ) ) @@ -925,9 +927,9 @@ ) ) (else - (logclear! (-> obj flags) (under-block-flags unbflags-1)) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj draw color-emissive) 0.0 0.0 0.0 1.0) + (logclear! (-> this flags) (under-block-flags unbflags-1)) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 0.0 0.0 1.0) ) ) ) @@ -935,8 +937,8 @@ (none) ) -(defmethod under-block-method-41 under-block ((obj under-block) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod under-block-method-41 under-block ((this under-block) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (case arg0 (('active) (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec obstacle pusher)) @@ -1189,19 +1191,22 @@ :init-specs ((:scalevel-x (meters 0)) (:scalevel-y :copy scalevel-x) (:fade-a -0.128)) ) -(defmethod under-block-method-50 under-block ((obj under-block)) +(defmethod under-block-method-50 under-block ((this under-block)) (with-pp (let ((s5-0 - (new 'stack 'joint-exploder-tuning (the-as uint (if (logtest? (-> obj flags) (under-block-flags unbflags-2)) - 1 - 0 - ) - ) - ) + (new + 'stack + 'joint-exploder-tuning + (the-as uint (if (logtest? (-> this flags) (under-block-flags unbflags-2)) + 1 + 0 + ) + ) + ) ) ) - (when (logtest? (-> obj flags) (under-block-flags unbflags-2)) - (set! (-> s5-0 fountain-rand-transv-lo quad) (-> obj away-from-focal-pt quad)) + (when (logtest? (-> this flags) (under-block-flags unbflags-2)) + (set! (-> s5-0 fountain-rand-transv-lo quad) (-> this away-from-focal-pt quad)) (set! (-> s5-0 fountain-rand-transv-hi x) 24576.0) (set! (-> s5-0 fountain-rand-transv-hi y) 49152.0) (set! (-> s5-0 fountain-rand-transv-hi z) 10240.0) @@ -1213,20 +1218,20 @@ 5 s5-0 *under-shoot-block-exploder-params* - :to obj + :to this ) ) - (if (>= 204800.0 (vector-vector-distance (target-pos 0) (-> obj root trans))) + (if (>= 204800.0 (vector-vector-distance (target-pos 0) (-> this root trans))) (activate! *camera-smush-control* 409.6 37 210 1.0 0.995 (-> pp clock)) ) (let ((s5-2 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-2 spawn-point quad) (-> obj root trans quad)) - (quaternion-copy! (-> s5-2 spawn-quat) (-> obj root quat)) + (set! (-> s5-2 spawn-point quad) (-> this root trans quad)) + (quaternion-copy! (-> s5-2 spawn-quat) (-> this root quat)) (set! (-> s5-2 radius) 16384.0) (set! (-> s5-2 group) (-> *part-group-id-table* 497)) (set! (-> s5-2 collide-with) (collide-spec jak bot player-list)) (set! (-> s5-2 penetrate-using) (penetrate explode)) - (explosion-spawn obj explosion s5-2) + (explosion-spawn this explosion s5-2) ) (none) ) @@ -1251,7 +1256,7 @@ (suspend) ) (under-block-method-41 self 'active) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "und-block-rise") (let ((gp-1 (new 'stack-no-clear 'matrix))) (set! (-> gp-1 vector 0 quad) (-> self root trans quad)) @@ -1275,7 +1280,7 @@ :trans rider-trans :code (behavior () (logclear! (-> self flags) (under-block-flags unbflags-0)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set! (-> gp-0 vector 0 quad) (-> self root trans quad)) (set! (-> gp-0 vector 1 quad) (-> gp-0 vector 0 quad)) @@ -1368,7 +1373,7 @@ (the-as quaternion (-> gp-1 vector 2)) (the-as quaternion (-> gp-1 trans)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (let ((f30-0 (fmin 1.0 (* 0.022222223 (the float (- (current-time) (-> self state-time))))))) (let ((s5-1 (-> self root))) @@ -1453,7 +1458,7 @@ (the-as quaternion (-> gp-1 vector 2)) (the-as quaternion (-> gp-1 trans)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (let ((f30-0 (fmin 1.0 (* 0.0074074073 (the float (- (current-time) (-> self state-time))))))) (let ((s5-1 (-> self root))) @@ -1476,7 +1481,7 @@ ) #f (label cfg-5) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (let* ((f1-9 (fmin 1.0 (* 0.0074074073 (the float (- (current-time) (-> self state-time)))))) (s5-2 (-> self root)) @@ -1513,7 +1518,7 @@ (under-block-method-45 self) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "und-block-lock") (let ((gp-1 (new 'stack-no-clear 'matrix))) (set! (-> gp-1 vector 0 quad) (-> self root trans quad)) @@ -1545,7 +1550,7 @@ (under-block-method-45 self) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "und-block-sink") (let ((gp-1 (new 'stack-no-clear 'matrix))) (set! (-> gp-1 vector 0 quad) (-> self root trans quad)) @@ -1584,13 +1589,13 @@ (under-block-method-45 self) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'quaternion)) (s5-0 (new 'stack-no-clear 'quaternion)) (f30-0 0.0) ) (quaternion-copy! gp-0 (-> self root quat)) - (while (< (- (current-time) (-> self state-time)) (seconds 1.25)) + (while (not (time-elapsed? (-> self state-time) (seconds 1.25))) (+! f30-0 (* 65536.0 (seconds-per-frame))) (quaternion-vector-angle! s5-0 (-> self rot-axis) (- f30-0)) (quaternion*! (-> self root quat) s5-0 gp-0) @@ -1611,7 +1616,7 @@ (fill-cache-integrate-and-collide gp-0 (-> gp-0 transv) a2-0 (meters 0)) ) (when (and (logtest? (-> (the-as collide-shape-moving gp-0) status) (collide-status touch-surface)) - (>= (- (current-time) (-> self state-time)) (seconds 0.01)) + (time-elapsed? (-> self state-time) (seconds 0.01)) ) (logior! (-> self flags) (under-block-flags unbflags-2)) (go-virtual explode) @@ -1790,7 +1795,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-25 under-shoot-block ((obj under-shoot-block) (arg0 int) (arg1 int) (arg2 float) (arg3 int)) +(defmethod under-shoot-block-method-25 under-shoot-block ((this under-shoot-block) (arg0 int) (arg1 int) (arg2 float) (arg3 int)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set-vector! (-> gp-0 vector 0) -8192.0 0.0 -8192.0 1.0) (set-vector! (-> gp-0 vector 1) -8192.0 0.0 8192.0 1.0) @@ -1810,7 +1815,7 @@ (vector+! (-> gp-0 vector 1) (-> gp-0 vector 1) (the-as vector (&+ gp-0 64))) (vector+! (-> gp-0 vector 2) (-> gp-0 vector 2) (the-as vector (&+ gp-0 64))) (vector+! (-> gp-0 trans) (-> gp-0 trans) (the-as vector (&+ gp-0 64))) - (let ((s4-0 (-> obj puzzle local-to-world))) + (let ((s4-0 (-> this puzzle local-to-world))) (vector-matrix*! (the-as vector (-> gp-0 vector)) (the-as vector (-> gp-0 vector)) s4-0) (vector-matrix*! (-> gp-0 vector 1) (-> gp-0 vector 1) s4-0) (vector-matrix*! (-> gp-0 vector 2) (-> gp-0 vector 2) s4-0) @@ -1856,15 +1861,15 @@ (none) ) -(defmethod under-shoot-block-method-24 under-shoot-block ((obj under-shoot-block) (arg0 int) (arg1 int)) +(defmethod under-shoot-block-method-24 under-shoot-block ((this under-shoot-block) (arg0 int) (arg1 int)) (local-vars (v1-11 symbol) (v1-20 symbol)) - (let ((a0-1 (-> obj puzzle))) + (let ((a0-1 (-> this puzzle))) (if (>= (-> (the-as (pointer int8) (&+ (-> a0-1 cells) (+ (* arg1 (-> a0-1 cells-wide)) arg0)))) 0) - (under-shoot-block-method-25 obj arg0 arg1 1.0 (the-as int (the-as uint #x80ffffff))) - (under-shoot-block-method-25 obj arg0 arg1 0.95 (shl #x8000 16)) + (under-shoot-block-method-25 this arg0 arg1 1.0 (the-as int (the-as uint #x80ffffff))) + (under-shoot-block-method-25 this arg0 arg1 0.95 (shl #x8000 16)) ) ) - (let ((v1-9 (-> obj puzzle spawners))) + (let ((v1-9 (-> this puzzle spawners))) (countdown (a0-7 (-> v1-9 length)) (let ((a1-5 (-> v1-9 a0-7))) (when (and (= (-> a1-5 col) arg0) (= (-> a1-5 row) arg1)) @@ -1877,9 +1882,9 @@ (set! v1-11 #f) (label cfg-12) (if v1-11 - (under-shoot-block-method-25 obj arg0 arg1 0.6 (the-as int (the-as uint #x8000ffff))) + (under-shoot-block-method-25 this arg0 arg1 0.6 (the-as int (the-as uint #x8000ffff))) ) - (let ((v1-18 (-> obj puzzle slots))) + (let ((v1-18 (-> this puzzle slots))) (countdown (a0-9 (-> v1-18 length)) (let ((a1-12 (-> v1-18 a0-9))) (when (and (= (-> a1-12 col) arg0) (= (-> a1-12 row) arg1)) @@ -1892,23 +1897,23 @@ (set! v1-20 #f) (label cfg-23) (if v1-20 - (under-shoot-block-method-25 obj arg0 arg1 0.6 (the-as int (the-as uint #x80ffff00))) + (under-shoot-block-method-25 this arg0 arg1 0.6 (the-as int (the-as uint #x80ffff00))) ) (none) ) ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-26 under-shoot-block ((obj under-shoot-block)) - (countdown (s5-0 (-> obj puzzle cells-tall)) - (countdown (s4-0 (-> obj puzzle cells-wide)) - (under-shoot-block-method-24 obj s4-0 s5-0) +(defmethod under-shoot-block-method-26 under-shoot-block ((this under-shoot-block)) + (countdown (s5-0 (-> this puzzle cells-tall)) + (countdown (s4-0 (-> this puzzle cells-wide)) + (under-shoot-block-method-24 this s4-0 s5-0) ) ) (none) ) -(defmethod under-shoot-block-method-28 under-shoot-block ((obj under-shoot-block)) - (let* ((v1-0 (-> obj puzzle)) +(defmethod under-shoot-block-method-28 under-shoot-block ((this under-shoot-block)) + (let* ((v1-0 (-> this puzzle)) (v0-0 (+ (-> v1-0 last-block-id) 1)) ) (if (or (< 127 v0-0) (<= v0-0 0)) @@ -1920,7 +1925,7 @@ ) ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-27 under-shoot-block ((obj under-shoot-block) (arg0 symbol)) +(defmethod under-shoot-block-method-27 under-shoot-block ((this under-shoot-block) (arg0 symbol)) (local-vars (sv-16 process) (sv-32 (function int int symbol (pointer process) none :behavior under-block)) @@ -1932,7 +1937,7 @@ (sv-128 (function int int symbol (pointer process) none :behavior under-block)) (sv-144 int) ) - (let ((s4-0 (-> obj puzzle))) + (let ((s4-0 (-> this puzzle))) (set! (-> s4-0 prev-special-attack-id) (the-as uint 0)) (set! (-> s4-0 slot-mask) (the-as uint 0)) (let ((v1-0 0)) @@ -1965,15 +1970,15 @@ (ppointer->handle (when s1-0 (let ((t9-2 (method-of-type under-block activate))) - (t9-2 (the-as under-block s1-0) obj (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) + (t9-2 (the-as under-block s1-0) this (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) ) (let ((s0-0 run-function-in-process)) (set! sv-16 s1-0) (set! sv-32 under-block-init-by-other) (set! sv-48 s3-0) - (let ((a3-1 (under-shoot-block-method-28 obj)) + (let ((a3-1 (under-shoot-block-method-28 this)) (t0-0 'beaten) - (t1-0 (process->ppointer obj)) + (t1-0 (process->ppointer this)) ) ((the-as (function object object object object object object none) s0-0) sv-16 sv-32 sv-48 a3-1 t0-0 t1-0) ) @@ -1991,15 +1996,15 @@ (ppointer->handle (when s1-1 (let ((t9-6 (method-of-type under-block activate))) - (t9-6 (the-as under-block s1-1) obj (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) + (t9-6 (the-as under-block s1-1) this (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) ) (let ((s0-1 run-function-in-process)) (set! sv-64 s1-1) (set! sv-80 under-block-init-by-other) (set! sv-96 s3-0) - (let ((a3-3 (under-shoot-block-method-28 obj)) + (let ((a3-3 (under-shoot-block-method-28 this)) (t0-1 'idle) - (t1-1 (process->ppointer obj)) + (t1-1 (process->ppointer this)) ) ((the-as (function object object object object object object none) s0-1) sv-64 sv-80 sv-96 a3-3 t0-1 t1-1) ) @@ -2014,15 +2019,15 @@ (ppointer->handle (when s1-2 (let ((t9-10 (method-of-type under-block activate))) - (t9-10 (the-as under-block s1-2) obj (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) + (t9-10 (the-as under-block s1-2) this (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) ) (let ((s0-2 run-function-in-process)) (set! sv-112 s1-2) (set! sv-128 under-block-init-by-other) (set! sv-144 s3-0) - (let ((a3-5 (under-shoot-block-method-28 obj)) + (let ((a3-5 (under-shoot-block-method-28 this)) (t0-2 'waiting) - (t1-2 (process->ppointer obj)) + (t1-2 (process->ppointer this)) ) ((the-as (function object object object object object object none) s0-2) sv-112 sv-128 sv-144 a3-5 t0-2 t1-2) ) @@ -2081,9 +2086,7 @@ (let ((gp-1 (-> gp-0 spawners))) (countdown (s5-0 (-> gp-1 length)) (let ((s4-0 (-> gp-1 s5-0))) - (when (and (not (handle->process (-> s4-0 active-handle))) - (>= (- (current-time) (-> s4-0 exploded-time)) (seconds 1)) - ) + (when (and (not (handle->process (-> s4-0 active-handle))) (time-elapsed? (-> s4-0 exploded-time) (seconds 1))) (set! (-> s4-0 active-handle) (-> s4-0 waiting-handle)) (let ((s3-0 (get-process *default-dead-pool* under-block #x4000))) (set! (-> s4-0 waiting-handle) @@ -2152,8 +2155,8 @@ :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) (sound-play "und-block-chime") - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) (let ((gp-1 (-> self puzzle spawners))) @@ -2192,8 +2195,8 @@ :code sleep-code ) -(defmethod deactivate under-shoot-block ((obj under-shoot-block)) - (let ((s5-0 (-> obj puzzle spawners))) +(defmethod deactivate under-shoot-block ((this under-shoot-block)) + (let ((s5-0 (-> this puzzle spawners))) (countdown (s4-0 (-> s5-0 length)) (let ((s3-0 (-> s5-0 s4-0))) (send-event (handle->process (-> s3-0 active-handle)) 'die-fast) @@ -2201,12 +2204,12 @@ ) ) ) - ((the-as (function process-drawable none) (find-parent-method under-shoot-block 10)) obj) + ((the-as (function process-drawable none) (find-parent-method under-shoot-block 10)) this) (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-shoot-block ((obj under-shoot-block) (arg0 entity-actor)) +(defmethod init-from-entity! under-shoot-block ((this under-shoot-block) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2214,32 +2217,32 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (let ((s5-1 (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (let ((s5-1 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) (if (or (< (the-as int s5-1) 0) (>= (the-as int s5-1) (-> *under-block-puzzles* length))) (go process-drawable-art-error "bad puzzle id") ) (set! sv-16 (new 'static 'res-tag)) - (let ((a0-7 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((a0-7 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (if (and a0-7 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) a0-7)) - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group) (the-as (pointer actor-group) a0-7)) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) ) ) (let ((v1-13 (-> *under-block-puzzles* s5-1))) - (set! (-> obj puzzle) v1-13) - (set! (-> obj allow-unlock?) (-> v1-13 auto-unlock?)) + (set! (-> this puzzle) v1-13) + (set! (-> this allow-unlock?) (-> v1-13 auto-unlock?)) ) ) (let ((s5-2 - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) ) ) - (under-shoot-block-method-27 obj (the-as symbol s5-2)) + (under-shoot-block-method-27 this (the-as symbol s5-2)) (if s5-2 - (go (method-of-object obj beaten)) - (go (method-of-object obj idle)) + (go (method-of-object this beaten)) + (go (method-of-object this idle)) ) ) (none) diff --git a/goal_src/jak2/levels/under/under-sig-obs.gc b/goal_src/jak2/levels/under/under-sig-obs.gc index 58e7fb307d..04e6e7da91 100644 --- a/goal_src/jak2/levels/under/under-sig-obs.gc +++ b/goal_src/jak2/levels/under/under-sig-obs.gc @@ -38,7 +38,7 @@ :bounds (static-spherem 0 0 0 5.1) ) -(defmethod get-art-group under-plat-shoot ((obj under-plat-shoot)) +(defmethod get-art-group under-plat-shoot ((this under-plat-shoot)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-under-plat-shoot" (the-as (pointer uint32) #f)) ) @@ -47,9 +47,9 @@ (let ((gp-0 (cshape-reaction-default arg0 arg1 arg2 arg3))) (when (logtest? gp-0 (collide-status touch-surface)) (let ((s5-0 self)) - (when (>= (- (current-time) (-> s5-0 hit-time)) (seconds 0.25)) + (when (time-elapsed? (-> s5-0 hit-time) (seconds 0.25)) (sound-play "shoot-plat-fall") - (set! (-> s5-0 hit-time) (current-time)) + (set-time! (-> s5-0 hit-time)) ) ) ) @@ -57,10 +57,10 @@ ) ) -(defmethod init-plat-collision! under-plat-shoot ((obj under-plat-shoot)) +(defmethod init-plat-collision! under-plat-shoot ((this under-plat-shoot)) "TODO - collision stuff for setting up the platform" - (set! (-> obj clock) (-> *display* user0-clock)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this clock) (-> *display* user0-clock)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-under-plat-shoot) (set! (-> s5-0 no-reaction) @@ -98,33 +98,33 @@ ) (set! (-> s5-0 rider-max-momentum) 0.0) (set! (-> s5-0 max-iteration-count) (the-as uint 5)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) -(defmethod base-plat-method-32 under-plat-shoot ((obj under-plat-shoot)) +(defmethod base-plat-method-32 under-plat-shoot ((this under-plat-shoot)) 0 (none) ) -(defmethod init-plat! under-plat-shoot ((obj under-plat-shoot)) +(defmethod init-plat! under-plat-shoot ((this under-plat-shoot)) "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." - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask enemy)) - (set-vector! (-> obj axe-flip) 1.0 0.0 0.0 1.0) - (set! (-> obj angle-flip) 180.0) - (set! (-> obj time-flip) (the-as uint 570)) - (set! (-> obj draw-test-script) (res-lump-struct (-> obj entity) 'on-activate script-context)) - (set! (-> obj disable-track-under) #f) - (if (>= (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj disable-track-under) (the-as basic #t)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask enemy)) + (set-vector! (-> this axe-flip) 1.0 0.0 0.0 1.0) + (set! (-> this angle-flip) 180.0) + (set! (-> this time-flip) (the-as uint 570)) + (set! (-> this draw-test-script) (res-lump-struct (-> this entity) 'on-activate script-context)) + (set! (-> this disable-track-under) #f) + (if (>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) + (set! (-> this disable-track-under) (the-as basic #t)) ) - (set! (-> obj hint-count) 0.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "shoot-plat-lp" :fo-max 70) (-> obj root trans)) + (set! (-> this hint-count) 0.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "shoot-plat-lp" :fo-max 70) (-> this root trans)) ) 0 (none) @@ -198,7 +198,7 @@ For example for an elevator pre-compute the distance between the first and last (vector-normalize! (-> self axe-flip) 1.0) (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) (set! (-> self angle-flip-vel) -10.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -269,10 +269,10 @@ For example for an elevator pre-compute the distance between the first and last ) (set! (-> self dest-angle) 180.0) (set! (-> self on-shake) #f) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self time-flip))) + (when (time-elapsed? (-> self state-time) (the-as time-frame (-> self time-flip))) (set! (-> self state-flip) (the-as uint 0)) 0 ) @@ -297,7 +297,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> self angle-flip) 0.0) ) (quaternion-vector-angle! (-> self root quat) (-> self axe-flip) (* 182.04445 (-> self angle-flip))) - (when (and (>= (- (current-time) (-> self state-time)) (the-as time-frame (+ (-> self time-flip) -300))) + (when (and (time-elapsed? (-> self state-time) (the-as time-frame (+ (-> self time-flip) -300))) (= 1 (-> self state-flip)) ) (when (not (-> self on-shake)) @@ -338,7 +338,7 @@ For example for an elevator pre-compute the distance between the first and last (defstate die-falling (under-plat-shoot) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause enemy platform)) (let ((v1-7 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 0))) (set! (-> v1-7 prim-core collide-as) (collide-spec)) @@ -347,7 +347,7 @@ For example for an elevator pre-compute the distance between the first and last 0 ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (let ((f30-0 (* 0.0016666667 (the float (+ (- (seconds -1) (-> self state-time)) (current-time)))))) (when (>= f30-0 1.0) (cleanup-for-death self) @@ -371,7 +371,7 @@ For example for an elevator pre-compute the distance between the first and last #t ) ) - (set! (-> self hit-time) (current-time)) + (set-time! (-> self hit-time)) (let ((gp-1 (new 'stack-no-clear 'quaternion)) (s5-1 (new 'stack-no-clear 'quaternion)) (s4-0 (new 'stack-no-clear 'vector)) @@ -405,19 +405,19 @@ For example for an elevator pre-compute the distance between the first and last ) ) -(defmethod plat-path-sync under-plat-shoot ((obj under-plat-shoot)) +(defmethod plat-path-sync under-plat-shoot ((this under-plat-shoot)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @see [[sync-eased]]" (cond - ((and (script-eval (the-as pair (-> obj draw-test-script))) (= *bot-record-path* -1)) - (go (method-of-object obj dormant)) + ((and (script-eval (the-as pair (-> this draw-test-script))) (= *bot-record-path* -1)) + (go (method-of-object this dormant)) ) (else enter-state #t - (go (method-of-object obj plat-path-active)) + (go (method-of-object this plat-path-active)) ) ) ) @@ -514,7 +514,7 @@ otherwise, [[plat::34]] (suspend) (ja-channel-set! 0) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -535,14 +535,14 @@ otherwise, [[plat::34]] ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-floor ((obj under-break-floor) (arg0 entity-actor)) +(defmethod init-from-entity! under-break-floor ((this under-break-floor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -571,25 +571,25 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (set! (-> obj root penetrated-by) (penetrate flop)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root penetrated-by) (penetrate flop)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-break-floor" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 3)) - (let ((a0-20 (-> obj skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> this draw light-index) (the-as uint 3)) + (let ((a0-20 (-> this skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj die-fast)) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this die-fast)) + (go (method-of-object this idle)) ) (none) ) @@ -630,7 +630,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-wall ((obj under-break-wall) (arg0 entity-actor)) +(defmethod init-from-entity! under-break-wall ((this under-break-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -638,7 +638,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core action) (collide-action solid)) @@ -652,28 +652,28 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (if (= (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0) 2) + (process-drawable-from-entity! this arg0) + (if (= (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0) 2) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-break-wall2" (the-as (pointer uint32) #f))) (the-as pair 0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-break-wall1" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) - (let ((s4-4 (-> obj root))) + (let ((s4-4 (-> this root))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-15 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-15 - (+! (-> obj root trans x) (-> v1-15 0)) - (+! (-> obj root trans y) (-> v1-15 1)) - (+! (-> obj root trans z) (-> v1-15 2)) + (+! (-> this root trans x) (-> v1-15 0)) + (+! (-> this root trans y) (-> v1-15 1)) + (+! (-> this root trans z) (-> v1-15 2)) ) ) (let ((f0-12 (res-lump-float arg0 'rotoffset))) @@ -683,9 +683,9 @@ This commonly includes things such as: ) ) (transform-post) - (if (script-eval (res-lump-struct (-> obj entity) 'on-activate pair)) - (go (method-of-object obj die)) - (go (method-of-object obj idle)) + (if (script-eval (res-lump-struct (-> this entity) 'on-activate pair)) + (go (method-of-object this die)) + (go (method-of-object this idle)) ) (none) ) @@ -752,7 +752,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-bridge ((obj under-break-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! under-break-bridge ((this under-break-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -760,8 +760,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj bridge-id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this bridge-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -786,28 +786,28 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) - (if (= (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0) 1) + (process-drawable-from-entity! this arg0) + (if (= (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0) 1) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-bridge2" (the-as (pointer uint32) #f))) (the-as pair 0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-bridge1" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) - (let ((s4-4 (-> obj root))) + (let ((s4-4 (-> this root))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-24 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-24 - (+! (-> obj root trans x) (-> v1-24 0)) - (+! (-> obj root trans y) (-> v1-24 1)) - (+! (-> obj root trans z) (-> v1-24 2)) + (+! (-> this root trans x) (-> v1-24 0)) + (+! (-> this root trans y) (-> v1-24 1)) + (+! (-> this root trans z) (-> v1-24 2)) ) ) (let ((f0-20 (res-lump-float arg0 'rotoffset))) @@ -818,14 +818,14 @@ This commonly includes things such as: ) (transform-post) (cond - ((script-eval (res-lump-struct (-> obj entity) 'on-activate pair)) - (if (= (-> obj bridge-id) 1) - (go (method-of-object obj broken)) - (go (method-of-object obj die)) + ((script-eval (res-lump-struct (-> this entity) 'on-activate pair)) + (if (= (-> this bridge-id) 1) + (go (method-of-object this broken)) + (go (method-of-object this die)) ) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -885,7 +885,7 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-int-door ((obj under-int-door) (arg0 entity-actor)) +(defmethod init-from-entity! under-int-door ((this under-int-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -893,7 +893,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -920,20 +920,20 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-int-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-18 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-18 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (when (and v1-18 (nonzero? (-> sv-16 elt-count))) (let ((a0-25 (-> v1-18 0 data 0 actor))) (if (and a0-25 (logtest? (-> a0-25 extra perm status) (entity-perm-status subtask-complete))) - (process-entity-status! obj (entity-perm-status subtask-complete) #t) + (process-entity-status! this (entity-perm-status subtask-complete) #t) ) ) ) @@ -941,37 +941,38 @@ This commonly includes things such as: (ja-channel-push! 1 0) (let ((s5-2 #t)) (cond - ((script-eval (res-lump-struct (-> obj entity) 'on-activate pair)) + ((script-eval (res-lump-struct (-> this entity) 'on-activate pair)) (set! s5-2 #f) ) - ((not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)))) + ((not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) (set! s5-2 #f) ) ) (cond (s5-2 - (let ((a0-40 (-> obj skel root-channel 0))) - (set! (-> a0-40 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-40 (-> this skel root-channel 0))) + (set! (-> a0-40 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-40 param 0) 1.0) (set! (-> a0-40 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) - (joint-control-channel-group! a0-40 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-40 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) ) (else - (let ((a0-41 (-> obj skel root-channel 0))) - (set! (-> a0-41 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-41 (-> this skel root-channel 0))) + (set! (-> a0-41 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-41 param 0) 1.0) (set! (-> a0-41 frame-num) 0.0) - (joint-control-channel-group! a0-41 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-41 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) ) ) (transform-post) (if s5-2 - (go (method-of-object obj idle-open)) - (go (method-of-object obj idle-closed)) + (go (method-of-object this idle-open)) + (go (method-of-object this idle-closed)) ) ) (none) @@ -1009,10 +1010,10 @@ This commonly includes things such as: :post plat-post ) -(defmethod init-plat-collision! under-plat-long ((obj under-plat-long)) +(defmethod init-plat-collision! under-plat-long ((this under-plat-long)) "TODO - collision stuff for setting up the platform" - (set! (-> obj clock) (-> *display* user0-clock)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this clock) (-> *display* user0-clock)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -1028,14 +1029,14 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-plat-long ((obj under-plat-long) (arg0 entity-actor)) +(defmethod init-from-entity! under-plat-long ((this under-plat-long) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1043,15 +1044,15 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-plat-long" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (stop-bouncing! obj) - (let ((s5-1 (-> obj root))) + (stop-bouncing! this) + (let ((s5-1 (-> this root))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-8 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-8 @@ -1065,12 +1066,12 @@ This commonly includes things such as: (quaternion-rotate-y! (-> s5-1 quat) (-> s5-1 quat) f0-6) ) ) - (set! (-> obj move-start quad) (-> s5-1 trans quad)) + (set! (-> this move-start quad) (-> s5-1 trans quad)) (let ((s3-1 (new 'stack-no-clear 'vector))) (vector-z-quaternion! s3-1 (-> s5-1 quat)) (vector-rotate90-around-y! s3-1 s3-1) (let ((f0-7 (res-lump-float arg0 'distance :default 65536.0))) - (vector+float*! (-> obj move-end) (-> obj move-start) s3-1 f0-7) + (vector+float*! (-> this move-end) (-> this move-start) s3-1 f0-7) ) ) (let ((a1-10 (new 'stack-no-clear 'sync-info-params))) @@ -1088,19 +1089,19 @@ This commonly includes things such as: (set! (-> a1-10 ease-out) 0.15) (set! (-> a1-10 pause-in) 0.0) (set! (-> a1-10 pause-out) 0.0) - (initialize! (-> obj sync) a1-10) + (initialize! (-> this sync) a1-10) ) - (vector-lerp! (-> s5-1 trans) (-> obj move-start) (-> obj move-end) (get-norm! (-> obj sync) 0)) + (vector-lerp! (-> s5-1 trans) (-> this move-start) (-> this move-end) (get-norm! (-> this sync) 0)) ) (transform-post) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "und-float-plat" :fo-max 50) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "und-float-plat" :fo-max 50) (-> this root trans)) ) - (base-plat-method-32 obj) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (base-plat-method-32 this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1175,17 +1176,17 @@ This commonly includes things such as: ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-plat-wall ((obj under-plat-wall) (arg0 entity-actor)) +(defmethod init-from-entity! under-plat-wall ((this under-plat-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj extended-amount) 0.0) - (logior! (-> obj mask) (process-mask platform)) - (set! (-> obj clock) (-> *display* user0-clock)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (set! (-> this extended-amount) 0.0) + (logior! (-> this mask) (process-mask platform)) + (set! (-> this clock) (-> *display* user0-clock)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1202,15 +1203,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) (set! (-> s4-0 rider-max-momentum) 0.0) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-plat-wall" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj skel status) (joint-control-status sync-math)) + (logior! (-> this skel status) (joint-control-status sync-math)) (let ((a1-6 (new 'stack-no-clear 'sync-info-params))) (let ((v1-24 0)) (if #t @@ -1219,35 +1220,35 @@ This commonly includes things such as: (set! (-> a1-6 sync-type) 'sync-paused) (set! (-> a1-6 sync-flags) (the-as sync-flags v1-24)) ) - (set! (-> a1-6 entity) (-> obj entity)) + (set! (-> a1-6 entity) (-> this entity)) (set! (-> a1-6 period) (the-as uint 1500)) (set! (-> a1-6 percent) 0.0) (set! (-> a1-6 pause-in) 0.2) (set! (-> a1-6 pause-out) 0.2) - (initialize! (-> obj sync) a1-6) + (initialize! (-> this sync) a1-6) ) - (let ((f30-0 (quaternion-y-angle (-> obj root quat))) + (let ((f30-0 (quaternion-y-angle (-> this root quat))) (s4-2 (new 'stack-no-clear 'vector)) ) (set-vector! s4-2 0.0 0.0 (res-lump-float arg0 'tunemeters) 1.0) (vector-rotate-around-y! s4-2 s4-2 f30-0) - (vector+! (-> obj out-trans) (-> obj root trans) s4-2) + (vector+! (-> this out-trans) (-> this root trans) s4-2) (set-vector! s4-2 0.0 0.0 -32768.0 1.0) (vector-rotate-around-y! s4-2 s4-2 f30-0) - (vector+! (-> obj in-trans) (-> obj out-trans) s4-2) + (vector+! (-> this in-trans) (-> this out-trans) s4-2) ) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj active)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this active)) (none) ) @@ -1374,28 +1375,28 @@ This commonly includes things such as: ) :code (behavior () (sound-play "grunt-notice" :vol 40 :position (target-pos 0)) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) (sound-play "grunt-warn" :vol 50 :position (target-pos 0)) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) (sound-play "grunt-hit" :vol 60 :position (target-pos 0)) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) (sound-play "grunt-notice" :vol 70 :position (target-pos 0)) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (sound-play "grunt-notice" :position (target-pos 0)) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (sound-play "grunt-notice" :vol 200 :position (target-pos 0)) diff --git a/goal_src/jak2/levels/under/underb-master.gc b/goal_src/jak2/levels/under/underb-master.gc index 5f5d0b9ad4..3893bfae5a 100644 --- a/goal_src/jak2/levels/under/underb-master.gc +++ b/goal_src/jak2/levels/under/underb-master.gc @@ -76,7 +76,7 @@ :code nothing ) -(defmethod under-warp-method-22 under-warp ((obj under-warp)) +(defmethod under-warp-method-22 under-warp ((this under-warp)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -92,12 +92,12 @@ ) ;; og:preserve-this changed for PC port: resize warp effect based on aspect ratio (let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) - (set-vector! (-> obj root scale) (* f0-4 (if (-> *pc-settings* use-vis?) 1.0 (-> *pc-settings* aspect-ratio-scale))) f0-4 f0-4 1.0) + (set-vector! (-> this root scale) (* f0-4 (if (-> *pc-settings* use-vis?) 1.0 (-> *pc-settings* aspect-ratio-scale))) f0-4 f0-4 1.0) ) (set! (-> gp-0 quad) (-> (camera-pos) quad)) (vector-normalize-copy! s5-0 (-> s3-0 vector 2) 1.0) - (matrix->quaternion (-> obj root quat) s3-0) - (let ((v1-10 (-> obj root trans))) + (matrix->quaternion (-> this root quat) s3-0) + (let ((v1-10 (-> this root trans))) (let ((a0-5 f30-0)) (.mov vf7 a0-5) ) @@ -176,11 +176,11 @@ (define *underb-master* (the-as (pointer underb-master) #f)) -(defmethod deactivate underb-master ((obj underb-master)) - (sound-stop (-> obj ambient-sound-id)) - (send-event (handle->process (-> obj warp-handle)) 'die-fast) +(defmethod deactivate underb-master ((this underb-master)) + (sound-stop (-> this ambient-sound-id)) + (send-event (handle->process (-> this warp-handle)) 'die-fast) (set! *underb-master* (the-as (pointer underb-master) #f)) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -323,7 +323,7 @@ ) ) -(defmethod under-warp-check underb-master ((obj underb-master)) +(defmethod under-warp-check underb-master ((this underb-master)) "Used to check whether the underwater warp effect should be drawn." (let ((target-pos (target-pos 0)) (tpos-offset (new 'stack-no-clear 'vector)) @@ -341,19 +341,19 @@ ) ) -(defmethod spawn-air-tank-hud underb-master ((obj underb-master) (arg0 symbol)) +(defmethod spawn-air-tank-hud underb-master ((this underb-master) (arg0 symbol)) "Spawns or hides the air tank HUD bar." (cond (arg0 - (if (not (handle->process (-> obj tank-handle))) - (set! (-> obj tank-handle) - (ppointer->handle (process-spawn hud-mech-air-tank :init hud-init-by-other :to obj)) + (if (not (handle->process (-> this tank-handle))) + (set! (-> this tank-handle) + (ppointer->handle (process-spawn hud-mech-air-tank :init hud-init-by-other :to this)) ) ) ) (else - (send-event (handle->process (-> obj tank-handle)) 'hide-and-die) - (set! (-> obj tank-handle) (the-as handle #f)) + (send-event (handle->process (-> this tank-handle)) 'hide-and-die) + (set! (-> this tank-handle) (the-as handle #f)) ) ) (none) @@ -383,7 +383,7 @@ ) (if (or (not gp-0) (not (logtest? (-> gp-0 water flags) (water-flags under-water)))) (set! (-> self air-charge-up?) #t) - (set! (-> self underwater-time) (current-time)) + (set-time! (-> self underwater-time)) ) ) (cond @@ -405,8 +405,8 @@ (else (when (>= 0.4 (-> self air-supply)) (let ((v1-39 (the int (lerp-scale 90.0 300.0 (-> self air-supply) 0.0 0.4)))) - (when (>= (- (current-time) (-> self last-air-beep-time)) v1-39) - (set! (-> self last-air-beep-time) (current-time)) + (when (time-elapsed? (-> self last-air-beep-time) v1-39) + (set-time! (-> self last-air-beep-time)) (sound-play "oxygen-warning") ) ) @@ -417,7 +417,7 @@ ) (set! (-> *game-info* air-supply) (fmin 1.0 (-> self air-supply))) (if (or (and *target* (not (logtest? (focus-status mech) (-> *target* focus-status)))) - (and (>= (-> self air-supply) 1.0) (>= (- (current-time) (-> self underwater-time)) (seconds 3))) + (and (>= (-> self air-supply) 1.0) (time-elapsed? (-> self underwater-time) (seconds 3))) ) (spawn-air-tank-hud self #f) (spawn-air-tank-hud self #t) @@ -536,7 +536,7 @@ :enter (behavior () (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-244" 0.0 0) - (set! (-> self big-room-timer) (current-time)) + (set-time! (-> self big-room-timer)) (send-event (ppointer->process *underb-master*) 'request 'under-warp #t) ) :exit (behavior () @@ -544,7 +544,7 @@ (remove-setting! 'entity-name) ) :trans (behavior () - (if (>= (- (current-time) (-> self big-room-timer)) (seconds 1)) + (if (time-elapsed? (-> self big-room-timer) (seconds 1)) (go-virtual idle) ) ) @@ -628,18 +628,18 @@ ;; WARN: Return type mismatch process-drawable vs under-locking. -(defmethod relocate under-locking ((obj under-locking) (arg0 int)) - (if (nonzero? (-> obj draining-part)) - (&+! (-> obj draining-part) arg0) +(defmethod relocate under-locking ((this under-locking) (arg0 int)) + (if (nonzero? (-> this draining-part)) + (&+! (-> this draining-part) arg0) ) - (the-as under-locking ((method-of-type process-drawable relocate) obj arg0)) + (the-as under-locking ((method-of-type process-drawable relocate) this arg0)) ) -(defmethod deactivate under-locking ((obj under-locking)) - (if (nonzero? (-> obj draining-part)) - (kill-and-free-particles (-> obj draining-part)) +(defmethod deactivate under-locking ((this under-locking)) + (if (nonzero? (-> this draining-part)) + (kill-and-free-particles (-> this draining-part)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -653,7 +653,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let ((v1-0 (-> self actor-group))) @@ -675,7 +675,7 @@ ) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((a0-13 (-> v1-0 0 data 0 actor))) (if a0-13 (-> a0-13 extra process) @@ -732,7 +732,7 @@ ) ) (else - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -818,8 +818,8 @@ 0 ) ) - (when (>= (- (current-time) (-> self last-reminder-time)) (seconds 9)) - (set! (-> self last-reminder-time) (current-time)) + (when (time-elapsed? (-> self last-reminder-time) (seconds 9)) + (set-time! (-> self last-reminder-time)) (add-process *gui-control* self @@ -858,13 +858,11 @@ (when (and (zero? (-> self state-time)) (= (get-status *gui-control* (-> self spooled-sound-id)) (gui-status ready)) ) - (set! (-> self state-time) (current-time)) - (set! (-> self last-reminder-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-reminder-time)) ) (when (nonzero? (-> self state-time)) - (when (and (>= (-> self spooled-sound-delay) 0) - (>= (- (current-time) (-> self state-time)) (-> self spooled-sound-delay)) - ) + (when (and (>= (-> self spooled-sound-delay) 0) (time-elapsed? (-> self state-time) (-> self spooled-sound-delay))) (set-action! *gui-control* (gui-action play) @@ -891,7 +889,7 @@ ) ) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (spawn (-> self part) (-> self root trans)) ) ) @@ -961,8 +959,8 @@ (when (and (zero? (-> self state-time)) (= (get-status *gui-control* (-> self spooled-sound-id)) (gui-status ready)) ) - (set! (-> self state-time) (current-time)) - (set! (-> self last-reminder-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-reminder-time)) (set-action! *gui-control* (gui-action play) @@ -989,7 +987,7 @@ ) ) ) - (if (< (- (current-time) (-> self state-time)) (seconds 1)) + (if (not (time-elapsed? (-> self state-time) (seconds 1))) (spawn (-> self draining-part) (-> self root trans)) ) ) @@ -1047,7 +1045,7 @@ ) ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-locking ((obj under-locking) (arg0 entity-actor)) +(defmethod init-from-entity! under-locking ((this under-locking) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1055,30 +1053,30 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj which-reminder?) #f) - (set! (-> obj spooled-sound-id) (new 'static 'sound-id)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj id) (res-lump-value arg0 'extra-id int :time -1000000000.0)) - (let ((f0-0 (-> obj root trans y))) - (set! (-> obj up-y) (+ 49152.0 f0-0)) - (set! (-> obj down-y) (+ f0-0 (if (= (-> obj id) 2) - -16384.0 - -20480.0 - ) - ) + (set! (-> this which-reminder?) #f) + (set! (-> this spooled-sound-id) (new 'static 'sound-id)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this id) (res-lump-value arg0 'extra-id int :time -1000000000.0)) + (let ((f0-0 (-> this root trans y))) + (set! (-> this up-y) (+ 49152.0 f0-0)) + (set! (-> this down-y) (+ f0-0 (if (= (-> this id) 2) + -16384.0 + -20480.0 + ) + ) ) ) (set! sv-16 (new 'static 'res-tag)) - (let ((a0-6 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((a0-6 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (if (and a0-6 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) a0-6)) - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group) (the-as (pointer actor-group) a0-6)) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 498) obj)) - (set! (-> obj draining-part) (create-launch-control (-> *part-group-id-table* 499) obj)) - (go (method-of-object obj startup)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 498) this)) + (set! (-> this draining-part) (create-launch-control (-> *part-group-id-table* 499) this)) + (go (method-of-object this startup)) (none) ) @@ -1104,14 +1102,14 @@ This commonly includes things such as: ) ) -(defmethod init-water! water-anim-under ((obj water-anim-under)) +(defmethod init-water! water-anim-under ((this water-anim-under)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) diff --git a/test/decompiler/reference/jak1/decompiler-macros.gc b/test/decompiler/reference/jak1/decompiler-macros.gc index ff5b17c618..17cd3a2fe3 100644 --- a/test/decompiler/reference/jak1/decompiler-macros.gc +++ b/test/decompiler/reference/jak1/decompiler-macros.gc @@ -1616,6 +1616,14 @@ `(-> *display* frames (-> *display* on-screen)) ) +(defmacro current-time () + `(-> *display* base-frame-counter) + ) + +(defmacro seconds-per-frame () + `(-> *display* seconds-per-frame) + ) + (defmacro def-mips2c (name type) "Define a mips2c object (typically a function)." `(begin @@ -1635,3 +1643,11 @@ &key (rate DISPLAY_FPS_RATIO)) `(sp-launch-particles-var ,system ,particle ,origin ,launch-state ,launch-control ,rate) ) + +(defmacro set-time! (time) + `(set! ,time (current-time)) + ) + +(defmacro time-elapsed? (time duration) + `(>= (- (current-time) ,time) ,duration) + ) \ No newline at end of file diff --git a/test/decompiler/reference/jak1/engine/anim/aligner-h_REF.gc b/test/decompiler/reference/jak1/engine/anim/aligner-h_REF.gc index 1af902de45..4e58102e2e 100644 --- a/test/decompiler/reference/jak1/engine/anim/aligner-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/aligner-h_REF.gc @@ -27,29 +27,29 @@ ) ;; definition for method 3 of type align-control -(defmethod inspect align-control ((obj align-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tflags: #x~X~%" (-> obj flags)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tframe-group: ~A~%" (-> obj frame-group)) - (format #t "~Tframe-num: ~f~%" (-> obj frame-num)) - (format #t "~Tmatrix[2] @ #x~X~%" (-> obj matrix)) - (format #t "~Ttransform[2] @ #x~X~%" (-> obj transform)) - (format #t "~Tdelta: #~%" (-> obj delta)) - (format #t "~Tlast-speed: (meters ~m)~%" (-> obj last-speed)) - (format #t "~Talign: #~%" (-> obj transform)) - obj +(defmethod inspect align-control ((this align-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tflags: #x~X~%" (-> this flags)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tframe-group: ~A~%" (-> this frame-group)) + (format #t "~Tframe-num: ~f~%" (-> this frame-num)) + (format #t "~Tmatrix[2] @ #x~X~%" (-> this matrix)) + (format #t "~Ttransform[2] @ #x~X~%" (-> this transform)) + (format #t "~Tdelta: #~%" (-> this delta)) + (format #t "~Tlast-speed: (meters ~m)~%" (-> this last-speed)) + (format #t "~Talign: #~%" (-> this transform)) + this ) ;; definition for method 0 of type align-control ;; INFO: Return type mismatch object vs align-control. (defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (when (zero? obj) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? this) (go process-drawable-art-error "memory") (return (the-as align-control 0)) ) - (set! (-> obj process) (the-as process-drawable arg0)) - obj + (set! (-> this process) (the-as process-drawable arg0)) + this ) ) diff --git a/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc b/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc index 0f911e2813..2c63364b6c 100644 --- a/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/aligner_REF.gc @@ -5,12 +5,12 @@ ;; INFO: Used lq/sq ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod compute-alignment! align-control ((obj align-control)) +(defmethod compute-alignment! align-control ((this align-control)) (local-vars (a0-9 symbol) (s7-0 none) (ra-0 int)) (with-pp - (let ((s5-0 (-> obj process skel active-channels))) + (let ((s5-0 (-> this process skel active-channels))) (dotimes (s4-0 s5-0) - (let* ((a0-3 (-> obj process skel channel s4-0)) + (let* ((a0-3 (-> this process skel channel s4-0)) (v1-5 (-> a0-3 frame-group)) (a0-4 (-> a0-3 command)) (a1-0 'stack) @@ -37,34 +37,34 @@ ) ) ) - (let* ((a0-8 (-> obj process skel root-channel 0)) + (let* ((a0-8 (-> this process skel root-channel 0)) (v1-16 (-> a0-8 frame-group)) (f0-0 (-> a0-8 frame-num)) ) (= (-> a0-8 num-func) num-func-loop!) (cond - ((or (not v1-16) (!= (-> obj frame-group) v1-16)) + ((or (not v1-16) (!= (-> this frame-group) v1-16)) (set! a0-9 #t) ) ((= (-> a0-8 num-func) num-func-loop!) - (set! a0-9 (< (* (-> a0-8 param 0) (- f0-0 (-> obj frame-num))) 0.0)) + (set! a0-9 (< (* (-> a0-8 param 0) (- f0-0 (-> this frame-num))) 0.0)) ) (else (set! a0-9 (= f0-0 0.0)) ) ) (if a0-9 - (logior! (-> obj flags) (align-flags disabled)) - (logclear! (-> obj flags) (align-flags disabled)) + (logior! (-> this flags) (align-flags disabled)) + (logclear! (-> this flags) (align-flags disabled)) ) - (set! (-> obj frame-group) v1-16) - (set! (-> obj frame-num) f0-0) + (set! (-> this frame-group) v1-16) + (set! (-> this frame-num) f0-0) ) - (mem-copy! (the-as pointer (-> obj transform 1)) (the-as pointer (-> obj transform)) 48) - (quaternion-copy! (the-as quaternion (-> obj transform 1 rot)) (-> obj align quat)) - (set! (-> obj transform 1 scale quad) (-> obj align scale quad)) - (let* ((a2-5 (-> obj matrix 1 vector)) - (a3-0 (-> obj matrix)) + (mem-copy! (the-as pointer (-> this transform 1)) (the-as pointer (-> this transform)) 48) + (quaternion-copy! (the-as quaternion (-> this transform 1 rot)) (-> this align quat)) + (set! (-> this transform 1 scale quad) (-> this align scale quad)) + (let* ((a2-5 (-> this matrix 1 vector)) + (a3-0 (-> this matrix)) (v1-19 (-> a3-0 0 vector 0 quad)) (a0-18 (-> a3-0 0 vector 1 quad)) (a1-12 (-> a3-0 0 vector 2 quad)) @@ -75,9 +75,9 @@ (set! (-> a2-5 2 quad) a1-12) (set! (-> a2-5 3 quad) a3-1) ) - (let ((s5-1 (-> obj process node-list data 1))) - (cspace<-matrix-no-push-joint! s5-1 (-> obj process skel)) - (let* ((v1-23 (-> obj matrix)) + (let ((s5-1 (-> this process node-list data 1))) + (cspace<-matrix-no-push-joint! s5-1 (-> this process skel)) + (let* ((v1-23 (-> this matrix)) (a3-2 (-> s5-1 bone transform)) (a0-21 (-> a3-2 vector 0 quad)) (a1-14 (-> a3-2 vector 1 quad)) @@ -89,50 +89,51 @@ (set! (-> v1-23 0 vector 2 quad) a2-6) (set! (-> v1-23 0 vector 3 quad) a3-3) ) - (vector*! (the-as vector (-> obj transform)) (-> s5-1 bone transform vector 3) (-> obj process root scale)) + (vector*! (the-as vector (-> this transform)) (-> s5-1 bone transform vector 3) (-> this process root scale)) ) (vector-! - (the-as vector (-> obj delta)) - (the-as vector (-> obj transform)) - (the-as vector (-> obj transform 1)) + (the-as vector (-> this delta)) + (the-as vector (-> this transform)) + (the-as vector (-> this transform 1)) ) (set-vector! - (-> obj align scale) - (vector-length (the-as vector (-> obj matrix))) - (vector-length (-> obj matrix 0 vector 1)) - (vector-length (-> obj matrix 0 vector 2)) + (-> this align scale) + (vector-length (the-as vector (-> this matrix))) + (vector-length (-> this matrix 0 vector 1)) + (vector-length (-> this matrix 0 vector 2)) 1.0 ) - (vector-! (-> obj delta scale) (-> obj align scale) (-> obj transform 1 scale)) - (let ((a2-8 (matrix-inv-scale! (new 'stack-no-clear 'matrix) (-> obj align scale)))) + (vector-! (-> this delta scale) (-> this align scale) (-> this transform 1 scale)) + (let ((a2-8 (matrix-inv-scale! (new 'stack-no-clear 'matrix) (-> this align scale)))) (quaternion-normalize! - (matrix->quaternion (-> obj align quat) (matrix*! a2-8 (the-as matrix (-> obj matrix)) a2-8)) + (matrix->quaternion (-> this align quat) (matrix*! a2-8 (the-as matrix (-> this matrix)) a2-8)) ) ) - (let ((a1-24 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (the-as quaternion (-> obj transform 1 rot))))) - (quaternion-normalize! (quaternion*! (-> obj delta quat) a1-24 (-> obj align quat))) + (let ((a1-24 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (the-as quaternion (-> this transform 1 rot)))) + ) + (quaternion-normalize! (quaternion*! (-> this delta quat) a1-24 (-> this align quat))) ) - (-> obj delta) + (-> this delta) ) ) ;; definition for method 12 of type align-control ;; INFO: Return type mismatch (inline-array transform) vs transform. -(defmethod first-transform align-control ((obj align-control)) - (the-as transform (-> obj transform)) +(defmethod first-transform align-control ((this align-control)) + (the-as transform (-> this transform)) ) ;; definition for method 13 of type align-control -(defmethod snd-transform align-control ((obj align-control)) - (-> obj transform 1) +(defmethod snd-transform align-control ((this align-control)) + (-> this transform 1) ) ;; definition for method 10 of type align-control -(defmethod align! align-control ((obj align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) - (when (not (logtest? (-> obj flags) (align-flags disabled))) - (let* ((a0-1 (-> obj process)) +(defmethod align! align-control ((this align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float)) + (when (not (logtest? (-> this flags) (align-flags disabled))) + (let* ((a0-1 (-> this process)) (t9-0 (method-of-object a0-1 apply-alignment)) - (v1-4 (-> obj delta)) + (v1-4 (-> this delta)) (t1-0 (new 'stack-no-clear 'vector)) ) (set! (-> t1-0 x) arg1) @@ -142,12 +143,12 @@ (t9-0 a0-1 arg0 v1-4 t1-0) ) ) - (-> obj process root) + (-> this process root) ) ;; definition for method 26 of type trsqv -(defmethod set-and-limit-velocity trsqv ((obj trsqv) (arg0 int) (arg1 vector) (arg2 float)) - (let ((gp-0 (-> obj transv))) +(defmethod set-and-limit-velocity trsqv ((this trsqv) (arg0 int) (arg1 vector) (arg2 float)) + (let ((gp-0 (-> this transv))) (when (logtest? arg0 4) (set! (-> gp-0 x) (-> arg1 x)) (set! (-> gp-0 z) (-> arg1 z)) @@ -156,14 +157,14 @@ ) ) ) - obj + this ) ;; definition for method 11 of type align-control -(defmethod align-vel-and-quat-only! align-control ((obj align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) - (when (not (logtest? (-> obj flags) (align-flags disabled))) - (let ((s5-0 (-> obj delta))) - (let ((s3-0 (-> obj process root transv))) +(defmethod align-vel-and-quat-only! align-control ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) + (when (not (logtest? (-> this flags) (align-flags disabled))) + (let ((s5-0 (-> this delta))) + (let ((s3-0 (-> this process root transv))) (if (logtest? arg0 (align-opts adjust-y-vel)) (set! (-> s3-0 y) (* (-> s5-0 trans y) arg3 (-> *display* frames-per-second))) ) @@ -176,15 +177,15 @@ ) (t9-2 vector-xz-normalize!) ) - (set! (-> obj last-speed) f0-8) + (set! (-> this last-speed) f0-8) (t9-2 s3-0 f0-8) ) ) ) (if (logtest? arg0 (align-opts adjust-quat)) - (quaternion-normalize! (quaternion*! (-> obj process root quat) (-> obj process root quat) (-> s5-0 quat))) + (quaternion-normalize! (quaternion*! (-> this process root quat) (-> this process root quat) (-> s5-0 quat))) ) ) ) - (-> obj process root) + (-> this process root) ) diff --git a/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc index b1819a69af..57bf67736a 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint-exploder_REF.gc @@ -24,20 +24,20 @@ ) ;; definition for method 3 of type joint-exploder-tuning -(defmethod inspect joint-exploder-tuning ((obj joint-exploder-tuning)) - (format #t "[~8x] ~A~%" obj 'joint-exploder-tuning) - (format #t "~Texplosion: ~D~%" (-> obj explosion)) - (format #t "~Tduration: ~D~%" (-> obj duration)) - (format #t "~Tgravity: ~f~%" (-> obj gravity)) - (format #t "~Trot-speed: ~f~%" (-> obj rot-speed)) - (format #t "~Tfountain-rand-transv-lo: #~%" (-> obj fountain-rand-transv-lo)) - (format #t "~Tfountain-rand-transv-hi: #~%" (-> obj fountain-rand-transv-hi)) - (format #t "~Taway-from-focal-pt: #~%" (-> obj fountain-rand-transv-lo)) - (format #t "~Taway-from-rand-transv-xz-lo: ~f~%" (-> obj fountain-rand-transv-hi x)) - (format #t "~Taway-from-rand-transv-xz-hi: ~f~%" (-> obj fountain-rand-transv-hi y)) - (format #t "~Taway-from-rand-transv-y-lo: ~f~%" (-> obj fountain-rand-transv-hi z)) - (format #t "~Taway-from-rand-transv-y-hi: ~f~%" (-> obj fountain-rand-transv-hi w)) - obj +(defmethod inspect joint-exploder-tuning ((this joint-exploder-tuning)) + (format #t "[~8x] ~A~%" this 'joint-exploder-tuning) + (format #t "~Texplosion: ~D~%" (-> this explosion)) + (format #t "~Tduration: ~D~%" (-> this duration)) + (format #t "~Tgravity: ~f~%" (-> this gravity)) + (format #t "~Trot-speed: ~f~%" (-> this rot-speed)) + (format #t "~Tfountain-rand-transv-lo: #~%" (-> this fountain-rand-transv-lo)) + (format #t "~Tfountain-rand-transv-hi: #~%" (-> this fountain-rand-transv-hi)) + (format #t "~Taway-from-focal-pt: #~%" (-> this fountain-rand-transv-lo)) + (format #t "~Taway-from-rand-transv-xz-lo: ~f~%" (-> this fountain-rand-transv-hi x)) + (format #t "~Taway-from-rand-transv-xz-hi: ~f~%" (-> this fountain-rand-transv-hi y)) + (format #t "~Taway-from-rand-transv-y-lo: ~f~%" (-> this fountain-rand-transv-hi z)) + (format #t "~Taway-from-rand-transv-y-hi: ~f~%" (-> this fountain-rand-transv-hi w)) + this ) ;; definition of type joint-exploder-static-joint-params @@ -51,11 +51,11 @@ ) ;; definition for method 3 of type joint-exploder-static-joint-params -(defmethod inspect joint-exploder-static-joint-params ((obj joint-exploder-static-joint-params)) - (format #t "[~8x] ~A~%" obj 'joint-exploder-static-joint-params) - (format #t "~Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~Tparent-joint-index: ~D~%" (-> obj parent-joint-index)) - obj +(defmethod inspect joint-exploder-static-joint-params ((this joint-exploder-static-joint-params)) + (format #t "[~8x] ~A~%" this 'joint-exploder-static-joint-params) + (format #t "~Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~Tparent-joint-index: ~D~%" (-> this parent-joint-index)) + this ) ;; definition of type joint-exploder-static-params @@ -68,10 +68,10 @@ ) ;; definition for method 3 of type joint-exploder-static-params -(defmethod inspect joint-exploder-static-params ((obj joint-exploder-static-params)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tjoints: ~A~%" (-> obj joints)) - obj +(defmethod inspect joint-exploder-static-params ((this joint-exploder-static-params)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tjoints: ~A~%" (-> this joints)) + this ) ;; definition of type joint-exploder-joint @@ -91,17 +91,17 @@ ) ;; definition for method 3 of type joint-exploder-joint -(defmethod inspect joint-exploder-joint ((obj joint-exploder-joint)) - (format #t "[~8x] ~A~%" obj 'joint-exploder-joint) - (format #t "~Tnext: ~D~%" (-> obj next)) - (format #t "~Tprev: ~D~%" (-> obj prev)) - (format #t "~Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~Trspeed: ~f~%" (-> obj rspeed)) - (format #t "~Tmat: #~%" (-> obj mat)) - (format #t "~Trmat: #~%" (-> obj rmat)) - (format #t "~Ttransv: #~%" (-> obj transv)) - (format #t "~Tprev-pos: #~%" (-> obj prev-pos)) - obj +(defmethod inspect joint-exploder-joint ((this joint-exploder-joint)) + (format #t "[~8x] ~A~%" this 'joint-exploder-joint) + (format #t "~Tnext: ~D~%" (-> this next)) + (format #t "~Tprev: ~D~%" (-> this prev)) + (format #t "~Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~Trspeed: ~f~%" (-> this rspeed)) + (format #t "~Tmat: #~%" (-> this mat)) + (format #t "~Trmat: #~%" (-> this rmat)) + (format #t "~Ttransv: #~%" (-> this transv)) + (format #t "~Tprev-pos: #~%" (-> this prev-pos)) + this ) ;; definition of type joint-exploder-joints @@ -118,11 +118,11 @@ ) ;; definition for method 3 of type joint-exploder-joints -(defmethod inspect joint-exploder-joints ((obj joint-exploder-joints)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~Tjoint[0] @ #x~X~%" (-> obj joint)) - obj +(defmethod inspect joint-exploder-joints ((this joint-exploder-joints)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~Tjoint[0] @ #x~X~%" (-> this joint)) + this ) ;; definition of type joint-exploder-list @@ -138,13 +138,13 @@ ) ;; definition for method 3 of type joint-exploder-list -(defmethod inspect joint-exploder-list ((obj joint-exploder-list)) - (format #t "[~8x] ~A~%" obj 'joint-exploder-list) - (format #t "~Thead: ~D~%" (-> obj head)) - (format #t "~Tpre-moved?: ~A~%" (-> obj pre-moved?)) - (format #t "~Tbbox-valid?: ~A~%" (-> obj bbox-valid?)) - (format #t "~Tbbox: #~%" (-> obj bbox)) - obj +(defmethod inspect joint-exploder-list ((this joint-exploder-list)) + (format #t "[~8x] ~A~%" this 'joint-exploder-list) + (format #t "~Thead: ~D~%" (-> this head)) + (format #t "~Tpre-moved?: ~A~%" (-> this pre-moved?)) + (format #t "~Tbbox-valid?: ~A~%" (-> this bbox-valid?)) + (format #t "~Tbbox: #~%" (-> this bbox)) + this ) ;; definition of type joint-exploder @@ -180,25 +180,25 @@ ) ;; definition for method 3 of type joint-exploder -(defmethod inspect joint-exploder ((obj joint-exploder)) +(defmethod inspect joint-exploder ((this joint-exploder)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdie-if-below-y: ~f~%" (-> obj die-if-below-y)) - (format #t "~T~Tdie-if-beyond-xz-dist-sqrd: ~f~%" (-> obj die-if-beyond-xz-dist-sqrd)) - (format #t "~T~Tjoints: ~A~%" (-> obj joints)) - (format #t "~T~Tstatic-params: ~A~%" (-> obj static-params)) - (format #t "~T~Tanim: ~A~%" (-> obj anim)) - (format #t "~T~Tscale-vector: #~%" (-> obj scale-vector)) - (format #t "~T~Ttuning: #~%" (-> obj tuning)) - (format #t "~T~Tlists[5] @ #x~X~%" (-> obj lists)) - obj + (format #t "~T~Tdie-if-below-y: ~f~%" (-> this die-if-below-y)) + (format #t "~T~Tdie-if-beyond-xz-dist-sqrd: ~f~%" (-> this die-if-beyond-xz-dist-sqrd)) + (format #t "~T~Tjoints: ~A~%" (-> this joints)) + (format #t "~T~Tstatic-params: ~A~%" (-> this static-params)) + (format #t "~T~Tanim: ~A~%" (-> this anim)) + (format #t "~T~Tscale-vector: #~%" (-> this scale-vector)) + (format #t "~T~Ttuning: #~%" (-> this tuning)) + (format #t "~T~Tlists[5] @ #x~X~%" (-> this lists)) + this ) ;; definition for method 5 of type joint-exploder-joints ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of joint-exploder-joints ((obj joint-exploder-joints)) - (the-as int (+ (-> obj type size) (* 176 (-> obj num-joints)))) +(defmethod asize-of joint-exploder-joints ((this joint-exploder-joints)) + (the-as int (+ (-> this type size) (* 176 (-> this num-joints)))) ) ;; definition for method 0 of type joint-exploder-joints @@ -238,23 +238,23 @@ ;; definition for method 24 of type joint-exploder ;; INFO: Used lq/sq -(defmethod joint-exploder-method-24 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let ((v0-0 (joint-exploder-method-26 obj arg0 arg1))) - (let* ((v1-1 (-> obj joints)) +(defmethod joint-exploder-method-24 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let ((v0-0 (joint-exploder-method-26 this arg0 arg1))) + (let* ((v1-1 (-> this joints)) (v1-2 (-> v1-1 joint arg1)) ) (set! (-> v1-2 mat vector 0 quad) (the-as uint128 0)) (set! (-> v1-2 mat vector 1 quad) (the-as uint128 0)) (set! (-> v1-2 mat vector 2 quad) (the-as uint128 0)) - (set! (-> v1-2 mat vector 3 quad) (-> obj root trans quad)) + (set! (-> v1-2 mat vector 3 quad) (-> this root trans quad)) ) v0-0 ) ) ;; definition for method 26 of type joint-exploder -(defmethod joint-exploder-method-26 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let* ((v1-0 (-> obj joints)) +(defmethod joint-exploder-method-26 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let* ((v1-0 (-> this joints)) (a2-1 (-> v1-0 joint arg1)) (a0-4 (-> a2-1 prev)) (v0-0 (-> a2-1 next)) @@ -285,8 +285,8 @@ ) ;; definition for method 20 of type joint-exploder -(defmethod joint-exploder-method-20 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let* ((v1-0 (-> obj joints)) +(defmethod joint-exploder-method-20 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let* ((v1-0 (-> this joints)) (a3-0 (-> v1-0 joint arg1)) (a0-4 (-> arg0 head)) ) @@ -303,7 +303,7 @@ ;; definition for method 21 of type joint-exploder ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod joint-exploder-method-21 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) +(defmethod joint-exploder-method-21 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) (let ((a1-1 (-> arg1 mat vector 3))) (cond ((-> arg0 bbox-valid?) @@ -322,12 +322,12 @@ ;; definition for method 27 of type joint-exploder ;; INFO: Used lq/sq -(defmethod joint-exploder-method-27 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod joint-exploder-method-27 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int)) (let ((s4-0 (the-as joint-exploder-list #f))) (let ((v1-0 1)) (until (= v1-0 5) - (let ((a0-4 (-> obj lists v1-0))) + (let ((a0-4 (-> this lists v1-0))) (when (< (-> a0-4 head) 0) (set! s4-0 a0-4) (goto cfg-6) @@ -344,11 +344,11 @@ (set! (-> (the-as joint-exploder-list s3-0) bbox-valid?) #f) ) (else - (set! s3-0 (-> obj lists)) + (set! s3-0 (-> this lists)) ) ) (set! (-> arg0 bbox-valid?) #f) - (let ((s2-0 (-> obj joints)) + (let ((s2-0 (-> this joints)) (s1-0 (-> arg0 head)) ) (cond @@ -358,13 +358,13 @@ (let ((s0-0 (-> s2-0 joint s1-0))) (cond ((>= (-> s0-0 mat vector 3 x) f30-0) - (set! sv-16 (joint-exploder-method-26 obj arg0 s1-0)) - (joint-exploder-method-20 obj (the-as joint-exploder-list s3-0) s1-0) + (set! sv-16 (joint-exploder-method-26 this arg0 s1-0)) + (joint-exploder-method-20 this (the-as joint-exploder-list s3-0) s1-0) (set! s1-0 sv-16) - (joint-exploder-method-21 obj (the-as joint-exploder-list s3-0) s0-0) + (joint-exploder-method-21 this (the-as joint-exploder-list s3-0) s0-0) ) (else - (joint-exploder-method-21 obj arg0 s0-0) + (joint-exploder-method-21 this arg0 s0-0) (set! s1-0 (-> s0-0 next)) ) ) @@ -378,13 +378,13 @@ (let ((s0-1 (-> s2-0 joint s1-0))) (cond ((>= (-> s0-1 mat vector 3 y) f30-1) - (set! sv-32 (joint-exploder-method-26 obj arg0 s1-0)) - (joint-exploder-method-20 obj (the-as joint-exploder-list s3-0) s1-0) + (set! sv-32 (joint-exploder-method-26 this arg0 s1-0)) + (joint-exploder-method-20 this (the-as joint-exploder-list s3-0) s1-0) (set! s1-0 sv-32) - (joint-exploder-method-21 obj (the-as joint-exploder-list s3-0) s0-1) + (joint-exploder-method-21 this (the-as joint-exploder-list s3-0) s0-1) ) (else - (joint-exploder-method-21 obj arg0 s0-1) + (joint-exploder-method-21 this arg0 s0-1) (set! s1-0 (-> s0-1 next)) ) ) @@ -398,13 +398,13 @@ (let ((s0-2 (-> s2-0 joint s1-0))) (cond ((>= (-> s0-2 mat vector 3 z) f30-2) - (set! sv-48 (joint-exploder-method-26 obj arg0 s1-0)) - (joint-exploder-method-20 obj (the-as joint-exploder-list s3-0) s1-0) + (set! sv-48 (joint-exploder-method-26 this arg0 s1-0)) + (joint-exploder-method-20 this (the-as joint-exploder-list s3-0) s1-0) (set! s1-0 sv-48) - (joint-exploder-method-21 obj (the-as joint-exploder-list s3-0) s0-2) + (joint-exploder-method-21 this (the-as joint-exploder-list s3-0) s0-2) ) (else - (joint-exploder-method-21 obj arg0 s0-2) + (joint-exploder-method-21 this arg0 s0-2) (set! s1-0 (-> s0-2 next)) ) ) @@ -420,32 +420,32 @@ ) ;; definition for method 28 of type joint-exploder -(defmethod joint-exploder-method-28 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-28 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0)) (cond ((< 20480.0 (- (-> arg0 bbox max x) (-> arg0 bbox min x))) - (let ((a1-2 (joint-exploder-method-27 obj arg0 0))) + (let ((a1-2 (joint-exploder-method-27 this arg0 0))) (if a1-2 - (joint-exploder-method-28 obj a1-2) + (joint-exploder-method-28 this a1-2) ) ) - (joint-exploder-method-28 obj arg0) + (joint-exploder-method-28 this arg0) ) ((< 20480.0 (- (-> arg0 bbox max y) (-> arg0 bbox min y))) - (let ((a1-5 (joint-exploder-method-27 obj arg0 1))) + (let ((a1-5 (joint-exploder-method-27 this arg0 1))) (if a1-5 - (joint-exploder-method-28 obj a1-5) + (joint-exploder-method-28 this a1-5) ) ) - (joint-exploder-method-28 obj arg0) + (joint-exploder-method-28 this arg0) ) ((< 20480.0 (- (-> arg0 bbox max z) (-> arg0 bbox min z))) - (let ((a1-8 (joint-exploder-method-27 obj arg0 2))) + (let ((a1-8 (joint-exploder-method-27 this arg0 2))) (if a1-8 - (joint-exploder-method-28 obj a1-8) + (joint-exploder-method-28 this a1-8) ) ) - (joint-exploder-method-28 obj arg0) + (joint-exploder-method-28 this arg0) ) ) ) @@ -454,11 +454,11 @@ ;; definition for method 25 of type joint-exploder ;; INFO: Used lq/sq -(defmethod joint-exploder-method-25 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-25 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (set! (-> arg0 bbox-valid?) #f) (set! (-> arg0 pre-moved?) #t) - (let ((s4-0 (-> obj joints)) - (f30-0 (* (-> obj tuning gravity) (-> *display* seconds-per-frame))) + (let ((s4-0 (-> this joints)) + (f30-0 (* (-> this tuning gravity) (seconds-per-frame))) (s3-0 (-> arg0 head)) ) (while (>= s3-0 0) @@ -469,7 +469,7 @@ (+! (-> s2-0 transv y) f30-0) (vector-v+! s1-0 s1-0 (-> s2-0 transv)) (let ((f0-3 0.99) - (f2-1 (* (-> s2-0 rspeed) (-> *display* seconds-per-frame))) + (f2-1 (* (-> s2-0 rspeed) (seconds-per-frame))) (f5-0 (-> s2-0 rmat vector 0 x)) (f4-0 (-> s2-0 rmat vector 0 y)) (f3-0 (-> s2-0 rmat vector 1 x)) @@ -481,13 +481,13 @@ (set! (-> s2-0 rmat vector 1 y) (+ (* f3-0 f2-1) (* f1-2 f0-3))) ) (cond - ((or (< (-> s1-0 y) (-> obj die-if-below-y)) - (< (-> obj die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> obj root trans))) + ((or (< (-> s1-0 y) (-> this die-if-below-y)) + (< (-> this die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> this root trans))) ) - (set! s3-0 (joint-exploder-method-24 obj arg0 s3-0)) + (set! s3-0 (joint-exploder-method-24 this arg0 s3-0)) ) (else - (joint-exploder-method-21 obj arg0 s2-0) + (joint-exploder-method-21 this arg0 s2-0) (set! s3-0 (-> s2-0 next)) ) ) @@ -499,15 +499,15 @@ ;; definition for method 22 of type joint-exploder ;; INFO: Used lq/sq -(defmethod joint-exploder-method-22 joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod joint-exploder-method-22 joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (fill-using-bounding-box *collide-cache* (-> arg0 bbox) (collide-kind background) - obj + this (new 'static 'pat-surface :noentity #x1) ) - (let ((gp-1 (-> obj joints)) + (let ((gp-1 (-> this joints)) (v1-2 (-> arg0 head)) ) (while (>= v1-2 0) @@ -552,10 +552,10 @@ ;; failed to figure out what this is: (defstate joint-exploder-shatter (joint-exploder) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (let* ((f1-0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) + (let* ((f1-0 (the float (- (current-time) (-> self state-time)))) (f0-2 (- 1.0 (/ f1-0 (the float (-> self tuning duration))))) (f1-2 (- 1.0 (/ f1-0 (* 0.75 (the float (-> self tuning duration)))))) ) @@ -611,8 +611,8 @@ 0 ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self tuning duration)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (-> self tuning duration)) (suspend) (ja :num! (loop!)) ) @@ -622,23 +622,23 @@ ;; definition for method 23 of type joint-exploder ;; INFO: Used lq/sq -(defmethod joint-exploder-method-23 joint-exploder ((obj joint-exploder)) - (let ((gp-0 (-> obj joints))) +(defmethod joint-exploder-method-23 joint-exploder ((this joint-exploder)) + (let ((gp-0 (-> this joints))) (dotimes (s4-0 (-> gp-0 num-joints)) - (let ((v1-2 (-> obj static-params joints s4-0)) + (let ((v1-2 (-> this static-params joints s4-0)) (s3-0 (-> gp-0 joint s4-0)) ) (let ((a0-6 (-> v1-2 parent-joint-index))) (set! (-> s3-0 prev) (+ s4-0 -1)) (set! (-> s3-0 next) (+ s4-0 1)) (set! (-> s3-0 joint-index) (-> v1-2 joint-index)) - (set! (-> s3-0 rspeed) (-> obj tuning rot-speed)) + (set! (-> s3-0 rspeed) (-> this tuning rot-speed)) (cond ((>= a0-6 0) (if (zero? a0-6) (set! a0-6 (-> v1-2 joint-index)) ) - (let* ((a3-0 (-> obj parent-override 0 node-list data a0-6 bone transform)) + (let* ((a3-0 (-> this parent-override 0 node-list data a0-6 bone transform)) (a2-0 (-> s3-0 mat)) (v1-9 (-> a3-0 vector 0 quad)) (a0-8 (-> a3-0 vector 1 quad)) @@ -653,7 +653,7 @@ (matrix-identity! (-> s3-0 rmat)) ) (else - (let* ((a3-2 (-> obj node-list data (-> v1-2 joint-index) bone transform)) + (let* ((a3-2 (-> this node-list data (-> v1-2 joint-index) bone transform)) (a2-1 (-> s3-0 mat)) (v1-15 (-> a3-2 vector 0 quad)) (a0-11 (-> a3-2 vector 1 quad)) @@ -669,21 +669,21 @@ ) ) ) - (case (-> obj tuning explosion) + (case (-> this tuning explosion) ((1) - (vector-! (-> s3-0 transv) (-> s3-0 mat vector 3) (-> obj tuning fountain-rand-transv-lo)) + (vector-! (-> s3-0 transv) (-> s3-0 mat vector 3) (-> this tuning fountain-rand-transv-lo)) (vector-normalize! (-> s3-0 transv) - (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi x) (-> obj tuning fountain-rand-transv-hi y)) + (rand-vu-float-range (-> this tuning fountain-rand-transv-hi x) (-> this tuning fountain-rand-transv-hi y)) ) (+! (-> s3-0 transv y) - (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi z) (-> obj tuning fountain-rand-transv-hi w)) + (rand-vu-float-range (-> this tuning fountain-rand-transv-hi z) (-> this tuning fountain-rand-transv-hi w)) ) (set! (-> s3-0 transv w) 1.0) ) (else - (let ((s1-1 (-> obj tuning fountain-rand-transv-lo)) - (s2-1 (-> obj tuning fountain-rand-transv-hi)) + (let ((s1-1 (-> this tuning fountain-rand-transv-lo)) + (s2-1 (-> this tuning fountain-rand-transv-hi)) ) (set-vector! (-> s3-0 transv) @@ -701,7 +701,7 @@ (let ((v1-26 (-> gp-0 joint (+ (-> gp-0 num-joints) -1)))) (set! (-> v1-26 next) -1) ) - (let ((v1-27 (the-as joint-exploder-list (&-> obj stack 224)))) + (let ((v1-27 (the-as joint-exploder-list (&-> this stack 224)))) (set! (-> v1-27 head) 0) (let ((s5-1 (-> v1-27 bbox))) (let ((v1-28 (the-as structure (-> gp-0 joint 0 mat vector 3)))) @@ -720,11 +720,11 @@ ;; definition for method 7 of type joint-exploder ;; INFO: Return type mismatch process-drawable vs joint-exploder. -(defmethod relocate joint-exploder ((obj joint-exploder) (arg0 int)) - (if (nonzero? (-> obj joints)) - (&+! (-> obj joints) arg0) +(defmethod relocate joint-exploder ((this joint-exploder) (arg0 int)) + (if (nonzero? (-> this joints)) + (&+! (-> this joints) arg0) ) - (the-as joint-exploder ((method-of-type process-drawable relocate) obj arg0)) + (the-as joint-exploder ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for function joint-exploder-init-by-other diff --git a/test/decompiler/reference/jak1/engine/anim/joint-h_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint-h_REF.gc index 071f9904ca..becc5fdfa1 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint-h_REF.gc @@ -25,21 +25,21 @@ ) ;; definition for method 3 of type joint-control-channel -(defmethod inspect joint-control-channel ((obj joint-control-channel)) - (format #t "[~8x] ~A~%" obj 'joint-control-channel) - (format #t "~Tparent: ~A~%" (-> obj parent)) - (format #t "~Tcommand: ~A~%" (-> obj command)) - (format #t "~Tframe-interp: ~f~%" (-> obj frame-interp)) - (format #t "~Tframe-group: ~A~%" (-> obj frame-group)) - (format #t "~Tframe-num: ~f~%" (-> obj frame-num)) - (format #t "~Tnum-func: ~A~%" (-> obj num-func)) - (format #t "~Tparam[2] @ #x~X~%" (-> obj param)) - (format #t "~Tgroup-sub-index: ~D~%" (-> obj group-sub-index)) - (format #t "~Tgroup-size: ~D~%" (-> obj group-size)) - (format #t "~Tdist: (meters ~m)~%" (-> obj dist)) - (format #t "~Teval-time: ~D~%" (-> obj eval-time)) - (format #t "~Tinspector-amount: ~f~%" (-> obj inspector-amount)) - obj +(defmethod inspect joint-control-channel ((this joint-control-channel)) + (format #t "[~8x] ~A~%" this 'joint-control-channel) + (format #t "~Tparent: ~A~%" (-> this parent)) + (format #t "~Tcommand: ~A~%" (-> this command)) + (format #t "~Tframe-interp: ~f~%" (-> this frame-interp)) + (format #t "~Tframe-group: ~A~%" (-> this frame-group)) + (format #t "~Tframe-num: ~f~%" (-> this frame-num)) + (format #t "~Tnum-func: ~A~%" (-> this num-func)) + (format #t "~Tparam[2] @ #x~X~%" (-> this param)) + (format #t "~Tgroup-sub-index: ~D~%" (-> this group-sub-index)) + (format #t "~Tgroup-size: ~D~%" (-> this group-size)) + (format #t "~Tdist: (meters ~m)~%" (-> this dist)) + (format #t "~Teval-time: ~D~%" (-> this eval-time)) + (format #t "~Tinspector-amount: ~f~%" (-> this inspector-amount)) + this ) ;; definition of type joint-control @@ -75,28 +75,28 @@ ) ;; definition for method 3 of type joint-control -(defmethod inspect joint-control ((obj joint-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tstatus: ~D~%" (-> obj status)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Troot-channel: #x~X~%" (-> obj root-channel)) - (format #t "~Tblend-index: ~D~%" (-> obj blend-index)) - (format #t "~Tactive-channels: ~D~%" (-> obj active-channels)) - (format #t "~Tgenerate-frame-function: ~A~%" (-> obj generate-frame-function)) - (format #t "~Tprebind-function: ~A~%" (-> obj prebind-function)) - (format #t "~Tpostbind-function: ~A~%" (-> obj postbind-function)) - (format #t "~Teffect: ~A~%" (-> obj effect)) - (format #t "~Tchannel[0] @ #x~X~%" (-> obj channel)) - (format #t "~Tframe-group0: ~A~%" (-> obj frame-group0)) - (format #t "~Tframe-num0: ~f~%" (-> obj frame-num0)) - (format #t "~Tframe-interp0: ~f~%" (-> obj frame-interp0)) - (format #t "~Tframe-group1: ~A~%" (-> obj frame-group1)) - (format #t "~Tframe-num1: ~f~%" (-> obj frame-num1)) - (format #t "~Tframe-interp1: ~f~%" (-> obj frame-interp1)) - (format #t "~Tframe-group2: ~A~%" (-> obj frame-group2)) - (format #t "~Tframe-num2: ~f~%" (-> obj frame-num2)) - (format #t "~Tframe-interp2: ~f~%" (-> obj frame-interp2)) - obj +(defmethod inspect joint-control ((this joint-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tstatus: ~D~%" (-> this status)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Troot-channel: #x~X~%" (-> this root-channel)) + (format #t "~Tblend-index: ~D~%" (-> this blend-index)) + (format #t "~Tactive-channels: ~D~%" (-> this active-channels)) + (format #t "~Tgenerate-frame-function: ~A~%" (-> this generate-frame-function)) + (format #t "~Tprebind-function: ~A~%" (-> this prebind-function)) + (format #t "~Tpostbind-function: ~A~%" (-> this postbind-function)) + (format #t "~Teffect: ~A~%" (-> this effect)) + (format #t "~Tchannel[0] @ #x~X~%" (-> this channel)) + (format #t "~Tframe-group0: ~A~%" (-> this frame-group0)) + (format #t "~Tframe-num0: ~f~%" (-> this frame-num0)) + (format #t "~Tframe-interp0: ~f~%" (-> this frame-interp0)) + (format #t "~Tframe-group1: ~A~%" (-> this frame-group1)) + (format #t "~Tframe-num1: ~f~%" (-> this frame-num1)) + (format #t "~Tframe-interp1: ~f~%" (-> this frame-interp1)) + (format #t "~Tframe-group2: ~A~%" (-> this frame-group2)) + (format #t "~Tframe-num2: ~f~%" (-> this frame-num2)) + (format #t "~Tframe-interp2: ~f~%" (-> this frame-interp2)) + this ) ;; definition of type matrix-stack @@ -110,11 +110,11 @@ ) ;; definition for method 3 of type matrix-stack -(defmethod inspect matrix-stack ((obj matrix-stack)) - (format #t "[~8x] ~A~%" obj 'matrix-stack) - (format #t "~Ttop: #~%" (-> obj top)) - (format #t "~Tdata[24] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect matrix-stack ((this matrix-stack)) + (format #t "[~8x] ~A~%" this 'matrix-stack) + (format #t "~Ttop: #~%" (-> this top)) + (format #t "~Tdata[24] @ #x~X~%" (-> this data)) + this ) ;; definition of type channel-upload-info @@ -133,15 +133,15 @@ ) ;; definition for method 3 of type channel-upload-info -(defmethod inspect channel-upload-info ((obj channel-upload-info)) - (format #t "[~8x] ~A~%" obj 'channel-upload-info) - (format #t "~Tfixed: #~%" (-> obj fixed)) - (format #t "~Tfixed-qwc: ~D~%" (-> obj fixed-qwc)) - (format #t "~Tframe: #~%" (-> obj frame)) - (format #t "~Tframe-qwc: ~D~%" (-> obj frame-qwc)) - (format #t "~Tamount: ~f~%" (-> obj amount)) - (format #t "~Tinterp: ~f~%" (-> obj interp)) - obj +(defmethod inspect channel-upload-info ((this channel-upload-info)) + (format #t "[~8x] ~A~%" this 'channel-upload-info) + (format #t "~Tfixed: #~%" (-> this fixed)) + (format #t "~Tfixed-qwc: ~D~%" (-> this fixed-qwc)) + (format #t "~Tframe: #~%" (-> this frame)) + (format #t "~Tframe-qwc: ~D~%" (-> this frame-qwc)) + (format #t "~Tamount: ~f~%" (-> this amount)) + (format #t "~Tinterp: ~f~%" (-> this interp)) + this ) ;; definition of type joint-work @@ -167,23 +167,23 @@ ) ;; definition for method 3 of type joint-work -(defmethod inspect joint-work ((obj joint-work)) - (format #t "[~8x] ~A~%" obj 'joint-work) - (format #t "~Ttemp-mtx: #~%" (-> obj temp-mtx)) - (format #t "~Tjoint-stack: #~%" (-> obj joint-stack)) - (format #t "~Tfix-jmp-table[16] @ #x~X~%" (-> obj fix-jmp-table)) - (format #t "~Tfrm-jmp-table[16] @ #x~X~%" (-> obj frm-jmp-table)) - (format #t "~Tpair-jmp-table[16] @ #x~X~%" (-> obj pair-jmp-table)) - (format #t "~Tuploads[24] @ #x~X~%" (-> obj uploads)) - (format #t "~Tnum-uploads: ~D~%" (-> obj num-uploads)) - (format #t "~Tmtx-acc[2] @ #x~X~%" (-> obj mtx-acc)) - (format #t "~Ttq-acc[100] @ #x~X~%" (-> obj tq-acc)) - (format #t "~Tjacp-hdr: #~%" (-> obj jacp-hdr)) - (format #t "~Tfixed-data: #~%" (-> obj fixed-data)) - (format #t "~Tframe-data[2] @ #x~X~%" (-> obj frame-data)) - (format #t "~Tflatten-array[576] @ #x~X~%" (-> obj mtx-acc)) - (format #t "~Tflattened[24] @ #x~X~%" (-> obj mtx-acc)) - obj +(defmethod inspect joint-work ((this joint-work)) + (format #t "[~8x] ~A~%" this 'joint-work) + (format #t "~Ttemp-mtx: #~%" (-> this temp-mtx)) + (format #t "~Tjoint-stack: #~%" (-> this joint-stack)) + (format #t "~Tfix-jmp-table[16] @ #x~X~%" (-> this fix-jmp-table)) + (format #t "~Tfrm-jmp-table[16] @ #x~X~%" (-> this frm-jmp-table)) + (format #t "~Tpair-jmp-table[16] @ #x~X~%" (-> this pair-jmp-table)) + (format #t "~Tuploads[24] @ #x~X~%" (-> this uploads)) + (format #t "~Tnum-uploads: ~D~%" (-> this num-uploads)) + (format #t "~Tmtx-acc[2] @ #x~X~%" (-> this mtx-acc)) + (format #t "~Ttq-acc[100] @ #x~X~%" (-> this tq-acc)) + (format #t "~Tjacp-hdr: #~%" (-> this jacp-hdr)) + (format #t "~Tfixed-data: #~%" (-> this fixed-data)) + (format #t "~Tframe-data[2] @ #x~X~%" (-> this frame-data)) + (format #t "~Tflatten-array[576] @ #x~X~%" (-> this mtx-acc)) + (format #t "~Tflattened[24] @ #x~X~%" (-> this mtx-acc)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/anim/joint-mod-h_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint-mod-h_REF.gc index e119050121..30437bc16f 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint-mod-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint-mod-h_REF.gc @@ -39,28 +39,28 @@ ) ;; definition for method 3 of type joint-mod -(defmethod inspect joint-mod ((obj joint-mod)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tmode: ~D~%" (-> obj mode)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tjoint: #~%" (-> obj joint)) - (format #t "~Ttarget: ~`vector`P~%" (-> obj target)) - (format #t "~Ttwist: ~`vector`P~%" (-> obj twist)) - (format #t "~Ttwist-max: ~`vector`P~%" (-> obj twist-max)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Tquat: ~`quaternion`P~%" (-> obj quat)) - (format #t "~Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~Tnotice-time: ~D~%" (-> obj notice-time)) - (format #t "~Tflex-blend: ~f~%" (-> obj flex-blend)) - (format #t "~Tblend: ~f~%" (-> obj blend)) - (format #t "~Tmax-dist: (meters ~m)~%" (-> obj max-dist)) - (format #t "~Tignore-angle: (deg ~r)~%" (-> obj ignore-angle)) - (format #t "~Tup: ~D~%" (-> obj up)) - (format #t "~Tnose: ~D~%" (-> obj nose)) - (format #t "~Tear: ~D~%" (-> obj ear)) - (format #t "~Tshutting-down?: ~A~%" (-> obj shutting-down?)) - (format #t "~Tparented-scale?: ~A~%" (-> obj max-dist)) - obj +(defmethod inspect joint-mod ((this joint-mod)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tmode: ~D~%" (-> this mode)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tjoint: #~%" (-> this joint)) + (format #t "~Ttarget: ~`vector`P~%" (-> this target)) + (format #t "~Ttwist: ~`vector`P~%" (-> this twist)) + (format #t "~Ttwist-max: ~`vector`P~%" (-> this twist-max)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Tquat: ~`quaternion`P~%" (-> this quat)) + (format #t "~Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~Tnotice-time: ~D~%" (-> this notice-time)) + (format #t "~Tflex-blend: ~f~%" (-> this flex-blend)) + (format #t "~Tblend: ~f~%" (-> this blend)) + (format #t "~Tmax-dist: (meters ~m)~%" (-> this max-dist)) + (format #t "~Tignore-angle: (deg ~r)~%" (-> this ignore-angle)) + (format #t "~Tup: ~D~%" (-> this up)) + (format #t "~Tnose: ~D~%" (-> this nose)) + (format #t "~Tear: ~D~%" (-> this ear)) + (format #t "~Tshutting-down?: ~A~%" (-> this shutting-down?)) + (format #t "~Tparented-scale?: ~A~%" (-> this max-dist)) + this ) ;; definition (debug) for function joint-mod-debug-draw @@ -78,120 +78,120 @@ (proc process-drawable) (joint-idx int) ) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj process) proc) - (set! (-> obj joint) (-> proc node-list data joint-idx)) - (set-mode! obj mode) - (set-vector! (-> obj twist-max) 8192.0 11832.889 0.0 1.0) - (set! (-> obj up) (the-as uint 1)) - (set! (-> obj nose) (the-as uint 2)) - (set! (-> obj ear) (the-as uint 0)) - (set! (-> obj max-dist) 122880.0) - (set! (-> obj ignore-angle) 65536.0) - (set! (-> obj flex-blend) 1.0) - (set! (-> obj shutting-down?) #f) - obj + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this process) proc) + (set! (-> this joint) (-> proc node-list data joint-idx)) + (set-mode! this mode) + (set-vector! (-> this twist-max) 8192.0 11832.889 0.0 1.0) + (set! (-> this up) (the-as uint 1)) + (set! (-> this nose) (the-as uint 2)) + (set! (-> this ear) (the-as uint 0)) + (set! (-> this max-dist) 122880.0) + (set! (-> this ignore-angle) 65536.0) + (set! (-> this flex-blend) 1.0) + (set! (-> this shutting-down?) #f) + this ) ) ;; definition for method 9 of type joint-mod -(defmethod set-mode! joint-mod ((obj joint-mod) (handler-mode joint-mod-handler-mode)) - (set! (-> obj mode) handler-mode) - (let ((joint (-> obj joint))) +(defmethod set-mode! joint-mod ((this joint-mod) (handler-mode joint-mod-handler-mode)) + (set! (-> this mode) handler-mode) + (let ((joint (-> this joint))) (case handler-mode (((joint-mod-handler-mode flex-blend)) (set! (-> joint param0) #f) (set! (-> joint param1) #f) (set! (-> joint param2) #f) - (set! (-> obj blend) 0.0) - (set! (-> obj flex-blend) 1.0) + (set! (-> this blend) 0.0) + (set! (-> this flex-blend) 1.0) ) (((joint-mod-handler-mode reset)) (set! (-> joint param0) #f) (set! (-> joint param1) #f) (set! (-> joint param2) #f) - (set! (-> obj blend) 0.0) - (set! (-> obj shutting-down?) #f) + (set! (-> this blend) 0.0) + (set! (-> this shutting-down?) #f) ) (((joint-mod-handler-mode look-at)) (set! (-> joint param0) joint-mod-look-at-handler) - (set! (-> joint param1) obj) + (set! (-> joint param1) this) (set! (-> joint param2) #f) ) (((joint-mod-handler-mode world-look-at)) (set! (-> joint param0) joint-mod-world-look-at-handler) - (set! (-> joint param1) obj) + (set! (-> joint param1) this) (set! (-> joint param2) #f) ) (((joint-mod-handler-mode rotate)) (set! (-> joint param0) joint-mod-rotate-handler) - (set! (-> joint param1) obj) + (set! (-> joint param1) this) (set! (-> joint param2) #f) - (set! (-> obj blend) 1.0) + (set! (-> this blend) 1.0) ) (((joint-mod-handler-mode joint-set)) (set! (-> joint param0) joint-mod-joint-set-handler) - (set! (-> joint param1) obj) + (set! (-> joint param1) this) (set! (-> joint param2) #f) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) - (set! (-> obj max-dist) (the-as meters #f)) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) + (set! (-> this max-dist) (the-as meters #f)) ) (((joint-mod-handler-mode joint-set*)) (set! (-> joint param0) joint-mod-joint-set*-handler) - (set! (-> joint param1) obj) + (set! (-> joint param1) this) (set! (-> joint param2) #f) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) - (set! (-> obj max-dist) (the-as meters #f)) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) + (set! (-> this max-dist) (the-as meters #f)) ) ) ) - obj + this ) ;; definition for method 12 of type joint-mod -(defmethod reset-blend! joint-mod ((obj joint-mod)) - (set! (-> obj blend) 0.0) - obj +(defmethod reset-blend! joint-mod ((this joint-mod)) + (set! (-> this blend) 0.0) + this ) ;; definition for method 15 of type joint-mod ;; INFO: Return type mismatch float vs none. -(defmethod shut-down! joint-mod ((obj joint-mod)) - (set! (-> obj shutting-down?) #t) - (set! (-> obj blend) 0.0) +(defmethod shut-down! joint-mod ((this joint-mod)) + (set! (-> this shutting-down?) #t) + (set! (-> this blend) 0.0) (none) ) ;; definition for method 13 of type joint-mod -(defmethod set-twist! joint-mod ((obj joint-mod) (x float) (y float) (z float)) +(defmethod set-twist! joint-mod ((this joint-mod) (x float) (y float) (z float)) (if x - (set! (-> obj twist x) x) + (set! (-> this twist x) x) ) (if y - (set! (-> obj twist y) y) + (set! (-> this twist y) y) ) (if z - (set! (-> obj twist z) z) + (set! (-> this twist z) z) ) - (-> obj twist) + (-> this twist) ) ;; definition for method 14 of type joint-mod ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod set-trs! joint-mod ((obj joint-mod) (trans vector) (rot quaternion) (scale vector)) +(defmethod set-trs! joint-mod ((this joint-mod) (trans vector) (rot quaternion) (scale vector)) (if trans - (set! (-> obj trans quad) (-> trans quad)) + (set! (-> this trans quad) (-> trans quad)) ) (if rot - (quaternion-copy! (-> obj quat) rot) + (quaternion-copy! (-> this quat) rot) ) (if scale - (set! (-> obj scale quad) (-> scale quad)) + (set! (-> this scale quad) (-> scale quad)) ) 0 (none) @@ -200,16 +200,16 @@ ;; definition for method 10 of type joint-mod ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod set-target! joint-mod ((obj joint-mod) (target-trans vector)) - (if (= (-> obj mode) (joint-mod-handler-mode reset)) - (set-mode! obj (joint-mod-handler-mode look-at)) +(defmethod set-target! joint-mod ((this joint-mod) (target-trans vector)) + (if (= (-> this mode) (joint-mod-handler-mode reset)) + (set-mode! this (joint-mod-handler-mode look-at)) ) - (let ((distance (vector-vector-distance (-> obj process root trans) target-trans))) - (set! (-> obj shutting-down?) #f) - (set! (-> obj target quad) (-> target-trans quad)) - (if (< distance (-> obj max-dist)) - (set! (-> obj blend) 1.0) - (set! (-> obj blend) 0.0) + (let ((distance (vector-vector-distance (-> this process root trans) target-trans))) + (set! (-> this shutting-down?) #f) + (set! (-> this target quad) (-> target-trans quad)) + (if (< distance (-> this max-dist)) + (set! (-> this blend) 1.0) + (set! (-> this blend) 0.0) ) ) 0 @@ -228,12 +228,12 @@ ) ;; definition for method 3 of type try-to-look-at-info -(defmethod inspect try-to-look-at-info ((obj try-to-look-at-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Twho: ~D~%" (-> obj who)) - (format #t "~Thorz: ~f~%" (-> obj horz)) - (format #t "~Tvert: ~f~%" (-> obj vert)) - obj +(defmethod inspect try-to-look-at-info ((this try-to-look-at-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Twho: ~D~%" (-> this who)) + (format #t "~Thorz: ~f~%" (-> this horz)) + (format #t "~Tvert: ~f~%" (-> this vert)) + this ) ;; definition for symbol last-try-to-look-at-data, type try-to-look-at-info @@ -242,7 +242,7 @@ ;; definition for method 11 of type joint-mod ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod look-at-enemy! joint-mod ((obj joint-mod) (target-trans vector) (option symbol) (proc process)) +(defmethod look-at-enemy! joint-mod ((this joint-mod) (target-trans vector) (option symbol) (proc process)) (when (= option 'attacking) (let* ((s3-0 proc) (proc-drawable (if (and (nonzero? s3-0) (type-type? (-> s3-0 type) process-drawable)) @@ -258,11 +258,11 @@ ) ) ) - (when (and enemy-facts (< (vector-vector-distance (-> obj process root trans) (-> proc-drawable root trans)) + (when (and enemy-facts (< (vector-vector-distance (-> this process root trans) (-> proc-drawable root trans)) (-> enemy-facts cam-notice-dist) ) ) - (set! (-> obj notice-time) (-> *display* base-frame-counter)) + (set-time! (-> this notice-time)) (set! (-> last-try-to-look-at-data who) (process->handle proc)) (if (< (-> last-try-to-look-at-data vert) (-> enemy-facts cam-vert)) (set! (-> last-try-to-look-at-data vert) (-> enemy-facts cam-vert)) @@ -275,18 +275,18 @@ ) ) ) - (let ((dist (vector-vector-distance (-> obj process root trans) target-trans))) - (when (and (or (= (-> obj blend) 0.0) - (or (< dist (vector-vector-distance (-> obj process root trans) (-> obj target))) (= option 'force)) + (let ((dist (vector-vector-distance (-> this process root trans) target-trans))) + (when (and (or (= (-> this blend) 0.0) + (or (< dist (vector-vector-distance (-> this process root trans) (-> this target))) (= option 'force)) ) - (< dist (-> obj max-dist)) + (< dist (-> this max-dist)) ) - (if (= (-> obj mode) (joint-mod-handler-mode reset)) - (set-mode! obj (joint-mod-handler-mode look-at)) + (if (= (-> this mode) (joint-mod-handler-mode reset)) + (set-mode! this (joint-mod-handler-mode look-at)) ) - (set! (-> obj target quad) (-> target-trans quad)) - (set! (-> obj blend) 1.0) - (set! (-> obj shutting-down?) #f) + (set! (-> this target quad) (-> target-trans quad)) + (set! (-> this blend) 1.0) + (set! (-> this shutting-down?) #f) ) ) 0 @@ -608,14 +608,14 @@ ) ;; definition for method 3 of type joint-mod-wheel -(defmethod inspect joint-mod-wheel ((obj joint-mod-wheel)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlast-position: #~%" (-> obj last-position)) - (format #t "~Tangle: ~f~%" (-> obj angle)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Twheel-radius: ~f~%" (-> obj wheel-radius)) - (format #t "~Twheel-axis: ~D~%" (-> obj wheel-axis)) - obj +(defmethod inspect joint-mod-wheel ((this joint-mod-wheel)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlast-position: #~%" (-> this last-position)) + (format #t "~Tangle: ~f~%" (-> this angle)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Twheel-radius: ~f~%" (-> this wheel-radius)) + (format #t "~Twheel-axis: ~D~%" (-> this wheel-axis)) + this ) ;; definition for function joint-mod-wheel-callback @@ -680,14 +680,14 @@ ) ;; definition for method 3 of type joint-mod-set-local -(defmethod inspect joint-mod-set-local ((obj joint-mod-set-local)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttransform: #~%" (-> obj transform)) - (format #t "~Tset-rotation: ~A~%" (-> obj set-rotation)) - (format #t "~Tset-scale: ~A~%" (-> obj set-scale)) - (format #t "~Tset-translation: ~A~%" (-> obj set-translation)) - (format #t "~Tenable: ~A~%" (-> obj enable)) - obj +(defmethod inspect joint-mod-set-local ((this joint-mod-set-local)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttransform: #~%" (-> this transform)) + (format #t "~Tset-rotation: ~A~%" (-> this set-rotation)) + (format #t "~Tset-scale: ~A~%" (-> this set-scale)) + (format #t "~Tset-translation: ~A~%" (-> this set-translation)) + (format #t "~Tenable: ~A~%" (-> this enable)) + this ) ;; definition for function joint-mod-set-local-callback @@ -756,15 +756,16 @@ ) ;; definition for method 3 of type joint-mod-set-world -(defmethod inspect joint-mod-set-world ((obj joint-mod-set-world)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttransform: #~%" (-> obj transform)) - (format #t "~Tnode-index: ~D~%" (-> obj node-index)) - (format #t "~Tenable: ~A~%" (-> obj enable)) - obj +(defmethod inspect joint-mod-set-world ((this joint-mod-set-world)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttransform: #~%" (-> this transform)) + (format #t "~Tnode-index: ~D~%" (-> this node-index)) + (format #t "~Tenable: ~A~%" (-> this enable)) + this ) ;; definition for function joint-mod-set-world-callback +;; INFO: Return type mismatch object vs none. (defun joint-mod-set-world-callback ((arg0 cspace) (arg1 transformq)) (let ((v1-0 (the-as joint-mod-set-world (-> arg0 param1)))) (if (-> v1-0 enable) @@ -809,14 +810,14 @@ ) ;; definition for method 3 of type joint-mod-blend-local -(defmethod inspect joint-mod-blend-local ((obj joint-mod-blend-local)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttransform: #~%" (-> obj transform)) - (format #t "~Tblend-transform: #~%" (-> obj blend-transform)) - (format #t "~Tnode-index: ~D~%" (-> obj node-index)) - (format #t "~Tblend: ~f~%" (-> obj blend)) - (format #t "~Tenable: ~A~%" (-> obj enable)) - obj +(defmethod inspect joint-mod-blend-local ((this joint-mod-blend-local)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttransform: #~%" (-> this transform)) + (format #t "~Tblend-transform: #~%" (-> this blend-transform)) + (format #t "~Tnode-index: ~D~%" (-> this node-index)) + (format #t "~Tblend: ~f~%" (-> this blend)) + (format #t "~Tenable: ~A~%" (-> this enable)) + this ) ;; definition for function joint-mod-blend-local-callback @@ -876,20 +877,20 @@ ) ;; definition for method 3 of type joint-mod-spinner -(defmethod inspect joint-mod-spinner ((obj joint-mod-spinner)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tspin-axis: #~%" (-> obj spin-axis)) - (format #t "~Tangle: ~f~%" (-> obj angle)) - (format #t "~Tspin-rate: ~f~%" (-> obj spin-rate)) - (format #t "~Tenable: ~A~%" (-> obj enable)) - obj +(defmethod inspect joint-mod-spinner ((this joint-mod-spinner)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tspin-axis: #~%" (-> this spin-axis)) + (format #t "~Tangle: ~f~%" (-> this angle)) + (format #t "~Tspin-rate: ~f~%" (-> this spin-rate)) + (format #t "~Tenable: ~A~%" (-> this enable)) + this ) ;; definition for function joint-mod-spinner-callback (defun joint-mod-spinner-callback ((arg0 cspace) (arg1 transformq)) (let ((gp-0 (the-as joint-mod-spinner (-> arg0 param1)))) (when (-> gp-0 enable) - (let ((f30-0 (+ (-> gp-0 angle) (* (-> gp-0 spin-rate) (-> *display* seconds-per-frame))))) + (let ((f30-0 (+ (-> gp-0 angle) (* (-> gp-0 spin-rate) (seconds-per-frame))))) (if (< 32768.0 f30-0) (set! f30-0 (+ -65536.0 f30-0)) ) diff --git a/test/decompiler/reference/jak1/engine/anim/joint_REF.gc b/test/decompiler/reference/jak1/engine/anim/joint_REF.gc index 97ec0e8a89..55d476a906 100644 --- a/test/decompiler/reference/jak1/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/joint_REF.gc @@ -2,71 +2,71 @@ (in-package goal) ;; definition for method 2 of type joint -(defmethod print joint ((obj joint)) - (format #t "#<~A ~S ~D @ #x~X>" (-> obj type) (-> obj name) (-> obj number) obj) - obj +(defmethod print joint ((this joint)) + (format #t "#<~A ~S ~D @ #x~X>" (-> this type) (-> this name) (-> this number) this) + this ) ;; definition for method 8 of type joint -(defmethod mem-usage joint ((obj joint) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage joint ((this joint) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 66 (-> arg0 length))) (set! (-> arg0 data 65 name) "joint") (+! (-> arg0 data 65 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 65 used) v1-6) (+! (-> arg0 data 65 total) (logand -16 (+ v1-6 15))) ) - obj + this ) ;; definition for method 2 of type joint-anim -(defmethod print joint-anim ((obj joint-anim)) - (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> obj type) (-> obj name) (-> obj number) (-> obj length) obj) - obj +(defmethod print joint-anim ((this joint-anim)) + (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> this type) (-> this name) (-> this number) (-> this length) this) + this ) ;; definition for method 4 of type joint-anim -(defmethod length joint-anim ((obj joint-anim)) - (-> obj length) +(defmethod length joint-anim ((this joint-anim)) + (-> this length) ) ;; definition for method 3 of type joint-anim-matrix -(defmethod inspect joint-anim-matrix ((obj joint-anim-matrix)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnumber: ~D~%" (-> obj number)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - obj +(defmethod inspect joint-anim-matrix ((this joint-anim-matrix)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnumber: ~D~%" (-> this number)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + this ) ;; definition for method 5 of type joint-anim-matrix ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-matrix ((obj joint-anim-matrix)) - (the-as int (+ (-> joint-anim-matrix size) (* (-> obj length) 64))) +(defmethod asize-of joint-anim-matrix ((this joint-anim-matrix)) + (the-as int (+ (-> joint-anim-matrix size) (* (-> this length) 64))) ) ;; definition for method 3 of type joint-anim-transformq -(defmethod inspect joint-anim-transformq ((obj joint-anim-transformq)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnumber: ~D~%" (-> obj number)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~`transformq`P~%" s5-0 (-> obj data s5-0)) +(defmethod inspect joint-anim-transformq ((this joint-anim-transformq)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnumber: ~D~%" (-> this number)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~`transformq`P~%" s5-0 (-> this data s5-0)) ) - obj + this ) ;; definition for method 5 of type joint-anim-transformq ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-transformq ((obj joint-anim-transformq)) - (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> obj length)))) +(defmethod asize-of joint-anim-transformq ((this joint-anim-transformq)) + (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> this length)))) ) ;; definition for method 5 of type joint-anim-drawable ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-drawable ((obj joint-anim-drawable)) - (the-as int (+ (-> joint-anim-drawable size) (* (-> obj length) 4))) +(defmethod asize-of joint-anim-drawable ((this joint-anim-drawable)) + (the-as int (+ (-> joint-anim-drawable size) (* (-> this length) 4))) ) ;; definition for function joint-anim-login @@ -95,18 +95,18 @@ ) ;; definition for method 8 of type joint-anim-drawable -(defmethod mem-usage joint-anim-drawable ((obj joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage joint-anim-drawable ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 77 (-> arg0 length))) (set! (-> arg0 data 76 name) "joint-anim-drawable") (+! (-> arg0 data 76 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 76 used) v1-6) (+! (-> arg0 data 76 total) (logand -16 (+ v1-6 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for function jacc-mem-usage @@ -138,22 +138,22 @@ ) ;; definition for method 2 of type joint-control-channel -(defmethod print joint-control-channel ((obj joint-control-channel)) +(defmethod print joint-control-channel ((this joint-control-channel)) (format #t "#" - (-> obj command) - (-> obj frame-group) - (-> obj frame-num) - obj + (-> this command) + (-> this frame-group) + (-> this frame-num) + this ) - obj + this ) ;; definition for method 5 of type joint-control ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of joint-control ((obj joint-control)) - (the-as int (+ (-> obj type size) (* 48 (-> obj allocated-length)))) +(defmethod asize-of joint-control ((this joint-control)) + (the-as int (+ (-> this type size) (* 48 (-> this allocated-length)))) ) ;; definition for method 0 of type joint-control @@ -175,30 +175,30 @@ ) ;; definition for method 9 of type joint-control-channel -(defmethod debug-print-frames joint-control-channel ((obj joint-control-channel)) - (let ((s5-0 (-> obj frame-group)) - (f30-0 (-> obj frame-num)) +(defmethod debug-print-frames joint-control-channel ((this joint-control-channel)) + (let ((s5-0 (-> this frame-group)) + (f30-0 (-> this frame-num)) ) (dotimes (s4-0 (length s5-0)) (format #t "joint ~A ~D " (-> s5-0 data s4-0 name) s4-0) (joint-anim-inspect-elt (-> s5-0 data s4-0) f30-0) ) ) - obj + this ) ;; definition for method 10 of type joint-control -(defmethod debug-print-channels joint-control ((obj joint-control) (arg0 symbol)) - (dotimes (s4-0 (-> obj active-channels)) - (let* ((v1-6 (if (and (-> obj channel s4-0 frame-group) (nonzero? (-> obj channel s4-0 frame-group))) - (-> obj channel s4-0 frame-group) +(defmethod debug-print-channels joint-control ((this joint-control) (arg0 symbol)) + (dotimes (s4-0 (-> this active-channels)) + (let* ((v1-6 (if (and (-> this channel s4-0 frame-group) (nonzero? (-> this channel s4-0 frame-group))) + (-> this channel s4-0 frame-group) ) ) (t9-0 format) (a0-5 arg0) (a1-1 "ch:~2d ~C ~-35S f: ~6,,2f ~4,,2f ~4,,2f%~%") (a2-0 s4-0) - (a3-3 (-> obj channel s4-0 command)) + (a3-3 (-> this channel s4-0 command)) (a3-4 (cond ((= a3-3 'push) 80 @@ -227,18 +227,18 @@ (-> v1-6 name) "(none)" ) - (+ (* (-> obj channel s4-0 frame-num) (if v1-6 - (-> v1-6 artist-step) - 1.0 - ) + (+ (* (-> this channel s4-0 frame-num) (if v1-6 + (-> v1-6 artist-step) + 1.0 + ) ) (if v1-6 (-> v1-6 artist-base) 0.0 ) ) - (-> obj channel s4-0 frame-interp) - (-> obj channel s4-0 inspector-amount) + (-> this channel s4-0 frame-interp) + (-> this channel s4-0 inspector-amount) ) ) ) @@ -246,176 +246,176 @@ ) ;; definition for method 12 of type art -(defmethod needs-link? art ((obj art)) +(defmethod needs-link? art ((this art)) #f ) ;; definition for method 10 of type art ;; INFO: Return type mismatch symbol vs joint. -(defmethod lookup-art art ((obj art) (arg0 string) (arg1 type)) +(defmethod lookup-art art ((this art) (arg0 string) (arg1 type)) (the-as joint #f) ) ;; definition for method 11 of type art ;; INFO: Return type mismatch symbol vs int. -(defmethod lookup-idx-of-art art ((obj art) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art art ((this art) (arg0 string) (arg1 type)) (the-as int #f) ) ;; definition for method 2 of type art -(defmethod print art ((obj art)) - (format #t "#<~A ~S :length ~D @ #x~X>" (-> obj type) (-> obj name) (-> obj length) obj) - obj +(defmethod print art ((this art)) + (format #t "#<~A ~S :length ~D @ #x~X>" (-> this type) (-> this name) (-> this length) this) + this ) ;; definition for method 4 of type art -(defmethod length art ((obj art)) - (-> obj length) +(defmethod length art ((this art)) + (-> this length) ) ;; definition for method 9 of type art -(defmethod login art ((obj art)) - (if (and (-> obj extra) (zero? (-> obj extra tag))) - (set! (-> obj extra tag) (&+ (the-as (pointer res-tag) (-> obj extra)) 28)) +(defmethod login art ((this art)) + (if (and (-> this extra) (zero? (-> this extra tag))) + (set! (-> this extra tag) (&+ (the-as (pointer res-tag) (-> this extra)) 28)) ) - obj + this ) ;; definition for method 8 of type art-mesh-anim -(defmethod mem-usage art-mesh-anim ((obj art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-mesh-anim ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 72 (-> arg0 length))) (set! (-> arg0 data 71 name) "art-mesh-anim") (+! (-> arg0 data 71 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 71 used) v1-6) (+! (-> arg0 data 71 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 5 of type art-joint-anim ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of art-joint-anim ((obj art-joint-anim)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-joint-anim ((this art-joint-anim)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 3 of type art-joint-anim -(defmethod inspect art-joint-anim ((obj art-joint-anim)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tspeed: ~F~%" (-> obj speed)) - (format #t "~Tartist-base: ~F~%" (-> obj artist-base)) - (format #t "~Tartist-step: ~F~%" (-> obj artist-step)) - (format #t "~Tmaster-art-group-name: ~A~%" (-> obj master-art-group-name)) - (format #t "~Tmaster-art-group-index: ~D~%" (-> obj master-art-group-index)) - (format #t "~Tframes: @ #x~X~%" (-> obj frames)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect art-joint-anim ((this art-joint-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tspeed: ~F~%" (-> this speed)) + (format #t "~Tartist-base: ~F~%" (-> this artist-base)) + (format #t "~Tartist-step: ~F~%" (-> this artist-step)) + (format #t "~Tmaster-art-group-name: ~A~%" (-> this master-art-group-name)) + (format #t "~Tmaster-art-group-index: ~D~%" (-> this master-art-group-index)) + (format #t "~Tframes: @ #x~X~%" (-> this frames)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) ;; definition for method 8 of type art-joint-anim -(defmethod mem-usage art-joint-anim ((obj art-joint-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-joint-anim ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 75 (-> arg0 length))) (set! (-> arg0 data 74 name) "art-joint-anim") (+! (-> arg0 data 74 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 74 used) v1-6) (+! (-> arg0 data 74 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (jacc-mem-usage (-> obj frames) arg0 arg1) - (dotimes (s4-1 (-> obj length)) + (jacc-mem-usage (-> this frames) arg0 arg1) + (dotimes (s4-1 (-> this length)) (set! (-> arg0 length) (max 67 (-> arg0 length))) (set! (-> arg0 data 66 name) "joint-anim-compressed") (+! (-> arg0 data 66 count) 1) - (let ((v1-22 (asize-of (-> obj data s4-1)))) + (let ((v1-22 (asize-of (-> this data s4-1)))) (+! (-> arg0 data 66 used) v1-22) (+! (-> arg0 data 66 total) (logand -16 (+ v1-22 15))) ) ) - (when (and (nonzero? (-> obj eye-anim-data)) (-> obj eye-anim-data)) + (when (and (nonzero? (-> this eye-anim-data)) (-> this eye-anim-data)) (set! (-> arg0 length) (max 109 (-> arg0 length))) (set! (-> arg0 data 108 name) "eye-anim") (+! (-> arg0 data 108 count) 1) - (let ((v1-41 (* (* (+ (-> obj eye-anim-data max-frame) 1) 2) 8))) + (let ((v1-41 (* (* (+ (-> this eye-anim-data max-frame) 1) 2) 8))) (+! (-> arg0 data 108 used) v1-41) (+! (-> arg0 data 108 total) (logand -16 (+ v1-41 15))) ) ) - obj + this ) ;; definition for method 5 of type art-joint-anim ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of art-joint-anim ((obj art-joint-anim)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-joint-anim ((this art-joint-anim)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 3 of type art-group -(defmethod inspect art-group ((obj art-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tinfo: ~A~%" (-> obj info)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (if (-> obj data s5-0) - (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> obj data s5-0) (mem-size (-> obj data s5-0) #f 0)) - (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> obj data s5-0) 0) +(defmethod inspect art-group ((this art-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tinfo: ~A~%" (-> this info)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (if (-> this data s5-0) + (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> this data s5-0) (mem-size (-> this data s5-0) #f 0)) + (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> this data s5-0) 0) ) ) - obj + this ) ;; definition for method 12 of type art-group ;; INFO: Return type mismatch object vs symbol. -(defmethod needs-link? art-group ((obj art-group)) - (the-as symbol (and (-> obj length) - (type-type? (-> obj data 0 type) art-joint-anim) - (!= (-> obj name) (-> (the-as art-joint-anim (-> obj data 0)) master-art-group-name)) +(defmethod needs-link? art-group ((this art-group)) + (the-as symbol (and (-> this length) + (type-type? (-> this data 0 type) art-joint-anim) + (!= (-> this name) (-> (the-as art-joint-anim (-> this data 0)) master-art-group-name)) ) ) ) ;; definition for method 10 of type art-group ;; INFO: Return type mismatch art-element vs joint. -(defmethod lookup-art art-group ((obj art-group) (arg0 string) (arg1 type)) +(defmethod lookup-art art-group ((this art-group) (arg0 string) (arg1 type)) (the-as joint (cond (arg1 - (let ((s3-0 (+ (length (-> obj name)) 1))) - (dotimes (s2-0 (-> obj length)) - (if (and (-> obj data s2-0) - (= (-> obj data s2-0 type) arg1) - (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) + (let ((s3-0 (+ (length (-> this name)) 1))) + (dotimes (s2-0 (-> this length)) + (if (and (-> this data s2-0) + (= (-> this data s2-0 type) arg1) + (or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) ) - (return (the-as joint (-> obj data s2-0))) + (return (the-as joint (-> this data s2-0))) ) ) ) (the-as art-element #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (and (-> obj data s4-1) (name= arg0 (-> obj data s4-1 name))) - (return (the-as joint (-> obj data s4-1))) + (dotimes (s4-1 (-> this length)) + (if (and (-> this data s4-1) (name= arg0 (-> this data s4-1 name))) + (return (the-as joint (-> this data s4-1))) ) ) (the-as art-element #f) @@ -425,14 +425,14 @@ ) ;; definition for method 11 of type art-group -(defmethod lookup-idx-of-art art-group ((obj art-group) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art art-group ((this art-group) (arg0 string) (arg1 type)) (cond (arg1 - (let ((s3-0 (+ (length (-> obj name)) 1))) - (dotimes (s2-0 (-> obj length)) - (if (and (-> obj data s2-0) - (= (-> obj data s2-0 type) arg1) - (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) + (let ((s3-0 (+ (length (-> this name)) 1))) + (dotimes (s2-0 (-> this length)) + (if (and (-> this data s2-0) + (= (-> this data s2-0 type) arg1) + (or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) ) (return s2-0) ) @@ -441,8 +441,8 @@ (the-as int #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (and (-> obj data s4-1) (name= arg0 (-> obj data s4-1 name))) + (dotimes (s4-1 (-> this length)) + (if (and (-> this data s4-1) (name= arg0 (-> this data s4-1 name))) (return s4-1) ) ) @@ -452,64 +452,64 @@ ) ;; definition for method 9 of type art-group -(defmethod login art-group ((obj art-group)) - (dotimes (s5-0 (-> obj length)) - (if (-> obj data s5-0) - (set! (-> obj data s5-0) (login (-> obj data s5-0))) +(defmethod login art-group ((this art-group)) + (dotimes (s5-0 (-> this length)) + (if (-> this data s5-0) + (set! (-> this data s5-0) (login (-> this data s5-0))) ) ) - obj + this ) ;; definition for method 8 of type art-group -(defmethod mem-usage art-group ((obj art-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-group ((this art-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 71 (-> arg0 length))) (set! (-> arg0 data 70 name) "art-group") (+! (-> arg0 data 70 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 70 used) v1-6) (+! (-> arg0 data 70 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (if (-> obj data s3-0) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (if (-> this data s3-0) + (mem-usage (-> this data s3-0) arg0 arg1) ) ) - obj + this ) ;; definition for method 7 of type art-group ;; INFO: Return type mismatch art-group vs none. -(defmethod relocate art-group ((obj art-group) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate art-group ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) (let ((s4-0 (clear *temp-string*))) (string<-charp s4-0 arg1) - (set! obj (cond - ((not obj) - (format 0 "ERROR: art-group ~A is not a valid file.~%" s4-0) - (the-as art-group #f) - ) - ((not (type-type? (-> obj type) art-group)) - (format 0 "ERROR: art-group ~A is not a art-group.~%" s4-0) - (the-as art-group #f) - ) - ((not (file-info-correct-version? (-> obj info) (file-kind art-group) 0)) - (the-as art-group #f) - ) - (else - (let ((s5-1 (-> *level* loading-level))) - (if (or (not s5-1) (= (-> s5-1 name) 'default)) - (login obj) - ) - (if s5-1 - (set-loaded-art (-> s5-1 art-group) obj) - ) - ) - obj + (set! this (cond + ((not this) + (format 0 "ERROR: art-group ~A is not a valid file.~%" s4-0) + (the-as art-group #f) ) - ) + ((not (type-type? (-> this type) art-group)) + (format 0 "ERROR: art-group ~A is not a art-group.~%" s4-0) + (the-as art-group #f) + ) + ((not (file-info-correct-version? (-> this info) (file-kind art-group) 0)) + (the-as art-group #f) + ) + (else + (let ((s5-1 (-> *level* loading-level))) + (if (or (not s5-1) (= (-> s5-1 name) 'default)) + (login this) + ) + (if s5-1 + (set-loaded-art (-> s5-1 art-group) this) + ) + ) + this + ) + ) ) ) (none) @@ -517,26 +517,26 @@ ;; definition for method 5 of type art-mesh-geo ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of art-mesh-geo ((obj art-mesh-geo)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-mesh-geo ((this art-mesh-geo)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 8 of type art-mesh-geo -(defmethod mem-usage art-mesh-geo ((obj art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-mesh-geo ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 73 (-> arg0 length))) (set! (-> arg0 data 72 name) "art-mesh-geo") (+! (-> arg0 data 72 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 72 used) v1-6) (+! (-> arg0 data 72 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 9 of type art-mesh-geo @@ -592,34 +592,34 @@ ) ;; definition for method 9 of type art-joint-anim -(defmethod login art-joint-anim ((obj art-joint-anim)) - (if (and (-> obj extra) (zero? (-> obj extra tag))) - (set! (-> obj extra tag) (&+ (the-as (pointer res-tag) (-> obj extra)) 28)) +(defmethod login art-joint-anim ((this art-joint-anim)) + (if (and (-> this extra) (zero? (-> this extra tag))) + (set! (-> this extra tag) (&+ (the-as (pointer res-tag) (-> this extra)) 28)) ) - obj + this ) ;; definition for method 5 of type art-joint-geo ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of art-joint-geo ((obj art-joint-geo)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-joint-geo ((this art-joint-geo)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 10 of type art-joint-geo -(defmethod lookup-art art-joint-geo ((obj art-joint-geo) (arg0 string) (arg1 type)) +(defmethod lookup-art art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 - (dotimes (s3-0 (-> obj length)) - (if (and (= (-> obj data s3-0 type) arg1) (name= arg0 (-> obj data s3-0 name))) - (return (-> obj data s3-0)) + (dotimes (s3-0 (-> this length)) + (if (and (= (-> this data s3-0 type) arg1) (name= arg0 (-> this data s3-0 name))) + (return (-> this data s3-0)) ) ) (the-as joint #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (name= arg0 (-> obj data s4-1 name)) - (return (-> obj data s4-1)) + (dotimes (s4-1 (-> this length)) + (if (name= arg0 (-> this data s4-1 name)) + (return (-> this data s4-1)) ) ) (the-as joint #f) @@ -628,19 +628,19 @@ ) ;; definition for method 11 of type art-joint-geo -(defmethod lookup-idx-of-art art-joint-geo ((obj art-joint-geo) (arg0 string) (arg1 type)) +(defmethod lookup-idx-of-art art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 - (dotimes (s3-0 (-> obj length)) - (if (and (= (-> obj data s3-0 type) arg1) (name= arg0 (-> obj data s3-0 name))) + (dotimes (s3-0 (-> this length)) + (if (and (= (-> this data s3-0 type) arg1) (name= arg0 (-> this data s3-0 name))) (return s3-0) ) ) (the-as int #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (name= arg0 (-> obj data s4-1 name)) + (dotimes (s4-1 (-> this length)) + (if (name= arg0 (-> this data s4-1 name)) (return s4-1) ) ) @@ -650,28 +650,28 @@ ) ;; definition for method 8 of type art-joint-geo -(defmethod mem-usage art-joint-geo ((obj art-joint-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-joint-geo ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 74 (-> arg0 length))) (set! (-> arg0 data 73 name) "art-joint-geo") (+! (-> arg0 data 73 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 73 used) v1-6) (+! (-> arg0 data 73 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for function joint-control-channel-eval ;; INFO: Return type mismatch float vs none. (defun joint-control-channel-eval ((arg0 joint-control-channel)) ((-> arg0 num-func) arg0 (-> arg0 param 0) (-> arg0 param 1)) - (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) + (set! (-> arg0 eval-time) (the-as uint (current-time))) (none) ) @@ -680,7 +680,7 @@ (defun joint-control-channel-eval! ((arg0 joint-control-channel) (arg1 (function joint-control-channel float float float))) (set! (-> arg0 num-func) arg1) (arg1 arg0 (-> arg0 param 0) (-> arg0 param 1)) - (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) + (set! (-> arg0 eval-time) (the-as uint (current-time))) (none) ) @@ -695,7 +695,7 @@ (set! (-> arg0 frame-group) arg1) ) (arg2 arg0 (-> arg0 param 0) (-> arg0 param 1)) - (set! (-> arg0 eval-time) (the-as uint (-> *display* base-frame-counter))) + (set! (-> arg0 eval-time) (the-as uint (current-time))) ) ) 0 @@ -740,7 +740,6 @@ ;; definition for function joint-control-remap! ;; INFO: Used lq/sq -;; INFO: Return type mismatch symbol vs object. ;; ERROR: Failed load: (set! v1-29 (l.wu (+ a0-9 -4))) at op 75 (defun joint-control-remap! ((arg0 joint-control) (arg1 art-group) (arg2 art-group) (arg3 pair) (arg4 int) (arg5 string)) (local-vars @@ -1129,14 +1128,14 @@ ) ;; definition for method 9 of type cspace -(defmethod reset-and-assign-geo! cspace ((obj cspace) (arg0 basic)) - (set! (-> obj parent) #f) - (set! (-> obj joint) #f) - (set! (-> obj geo) arg0) - (set! (-> obj param0) #f) - (set! (-> obj param1) #f) - (set! (-> obj param2) #f) - obj +(defmethod reset-and-assign-geo! cspace ((this cspace) (arg0 basic)) + (set! (-> this parent) #f) + (set! (-> this joint) #f) + (set! (-> this geo) arg0) + (set! (-> this param0) #f) + (set! (-> this param1) #f) + (set! (-> this param2) #f) + this ) ;; definition for method 0 of type cspace diff --git a/test/decompiler/reference/jak1/engine/anim/mspace-h_REF.gc b/test/decompiler/reference/jak1/engine/anim/mspace-h_REF.gc index 32ac8f68d0..5a3529cb55 100644 --- a/test/decompiler/reference/jak1/engine/anim/mspace-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/anim/mspace-h_REF.gc @@ -14,13 +14,13 @@ ) ;; definition for method 3 of type joint -(defmethod inspect joint ((obj joint)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnumber: ~D~%" (-> obj number)) - (format #t "~Tparent: ~A~%" (-> obj parent)) - (format #t "~Tbind-pose: #~%" (-> obj bind-pose)) - obj +(defmethod inspect joint ((this joint)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnumber: ~D~%" (-> this number)) + (format #t "~Tparent: ~A~%" (-> this parent)) + (format #t "~Tbind-pose: #~%" (-> this bind-pose)) + this ) ;; definition of type bone-cache @@ -36,13 +36,13 @@ ) ;; definition for method 3 of type bone-cache -(defmethod inspect bone-cache ((obj bone-cache)) - (format #t "[~8x] ~A~%" obj 'bone-cache) - (format #t "~Tbone-matrix: ~D~%" (-> obj bone-matrix)) - (format #t "~Tparent-matrix: ~D~%" (-> obj parent-matrix)) - (format #t "~Tdummy: ~D~%" (-> obj dummy)) - (format #t "~Tframe: ~D~%" (-> obj frame)) - obj +(defmethod inspect bone-cache ((this bone-cache)) + (format #t "[~8x] ~A~%" this 'bone-cache) + (format #t "~Tbone-matrix: ~D~%" (-> this bone-matrix)) + (format #t "~Tparent-matrix: ~D~%" (-> this parent-matrix)) + (format #t "~Tdummy: ~D~%" (-> this dummy)) + (format #t "~Tframe: ~D~%" (-> this frame)) + this ) ;; definition of type bone @@ -58,13 +58,13 @@ ) ;; definition for method 3 of type bone -(defmethod inspect bone ((obj bone)) - (format #t "[~8x] ~A~%" obj 'bone) - (format #t "~Ttransform: #~%" (-> obj transform)) - (format #t "~Tposition: #~%" (-> obj transform vector 3)) - (format #t "~Tscale: #~%" (-> obj scale)) - (format #t "~Tcache: #~%" (-> obj cache)) - obj +(defmethod inspect bone ((this bone)) + (format #t "[~8x] ~A~%" this 'bone) + (format #t "~Ttransform: #~%" (-> this transform)) + (format #t "~Tposition: #~%" (-> this transform vector 3)) + (format #t "~Tscale: #~%" (-> this scale)) + (format #t "~Tcache: #~%" (-> this cache)) + this ) ;; definition of type skeleton @@ -77,12 +77,12 @@ ) ;; definition for method 3 of type skeleton -(defmethod inspect skeleton ((obj skeleton)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj bones)) - obj +(defmethod inspect skeleton ((this skeleton)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this bones)) + this ) ;; failed to figure out what this is: @@ -109,17 +109,17 @@ ) ;; definition for method 3 of type cspace -(defmethod inspect cspace ((obj cspace)) - (format #t "[~8x] ~A~%" obj 'cspace) - (format #t "~Tparent: #~%" (-> obj parent)) - (format #t "~Tjoint: ~A~%" (-> obj joint)) - (format #t "~Tjoint-num: ~D~%" (-> obj joint-num)) - (format #t "~Tgeo: ~A~%" (-> obj geo)) - (format #t "~Tbone: #~%" (-> obj bone)) - (format #t "~Tparam0: ~A~%" (-> obj param0)) - (format #t "~Tparam1: ~A~%" (-> obj param1)) - (format #t "~Tparam2: ~A~%" (-> obj param2)) - obj +(defmethod inspect cspace ((this cspace)) + (format #t "[~8x] ~A~%" this 'cspace) + (format #t "~Tparent: #~%" (-> this parent)) + (format #t "~Tjoint: ~A~%" (-> this joint)) + (format #t "~Tjoint-num: ~D~%" (-> this joint-num)) + (format #t "~Tgeo: ~A~%" (-> this geo)) + (format #t "~Tbone: #~%" (-> this bone)) + (format #t "~Tparam0: ~A~%" (-> this param0)) + (format #t "~Tparam1: ~A~%" (-> this param1)) + (format #t "~Tparam2: ~A~%" (-> this param2)) + this ) ;; definition of type cspace-array @@ -132,29 +132,29 @@ ) ;; definition for method 3 of type cspace-array -(defmethod inspect cspace-array ((obj cspace-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect cspace-array ((this cspace-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: (set! (-> cspace-array heap-base) (the-as uint 32)) ;; definition for method 2 of type cspace -(defmethod print cspace ((obj cspace)) +(defmethod print cspace ((this cspace)) (format #t "#" - (if (-> obj joint) - (-> obj joint name) + (if (-> this joint) + (-> this joint name) "nojoint" ) - obj + this ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc index 60c90b21f8..669a8b0000 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-layout_REF.gc @@ -22,15 +22,15 @@ ) ;; definition for method 3 of type cam-layout-bank -(defmethod inspect cam-layout-bank ((obj cam-layout-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tspline-t: ~f~%" (-> obj spline-t)) - (format #t "~Tspline-step: ~f~%" (-> obj spline-step)) - (format #t "~Tintro-t: ~f~%" (-> obj intro-t)) - (format #t "~Tintro-step: ~f~%" (-> obj intro-step)) - (format #t "~Tdebug-t: ~f~%" (-> obj debug-t)) - (format #t "~Tdebug-step: ~f~%" (-> obj debug-step)) - obj +(defmethod inspect cam-layout-bank ((this cam-layout-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tspline-t: ~f~%" (-> this spline-t)) + (format #t "~Tspline-step: ~f~%" (-> this spline-step)) + (format #t "~Tintro-t: ~f~%" (-> this intro-t)) + (format #t "~Tintro-step: ~f~%" (-> this intro-step)) + (format #t "~Tdebug-t: ~f~%" (-> this debug-t)) + (format #t "~Tdebug-step: ~f~%" (-> this debug-step)) + this ) ;; definition for symbol *CAM_LAYOUT-bank*, type cam-layout-bank @@ -56,9 +56,9 @@ ) ;; definition for method 3 of type clm-basic -(defmethod inspect clm-basic ((obj clm-basic)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - obj +(defmethod inspect clm-basic ((this clm-basic)) + (format #t "[~8x] ~A~%" this (-> this type)) + this ) ;; definition of type clm-item-action @@ -77,14 +77,14 @@ ) ;; definition for method 3 of type clm-item-action -(defmethod inspect clm-item-action ((obj clm-item-action)) - (format #t "[~8x] ~A~%" obj 'clm-item-action) - (format #t "~Tbutton: ~D~%" (-> obj button)) - (format #t "~Toptions: ~D~%" (-> obj options)) - (format #t "~Tfunc: ~A~%" (-> obj func)) - (format #t "~Tparm0: ~A~%" (-> obj parm0)) - (format #t "~Tparm1: ~A~%" (-> obj parm1-basic)) - obj +(defmethod inspect clm-item-action ((this clm-item-action)) + (format #t "[~8x] ~A~%" this 'clm-item-action) + (format #t "~Tbutton: ~D~%" (-> this button)) + (format #t "~Toptions: ~D~%" (-> this options)) + (format #t "~Tfunc: ~A~%" (-> this func)) + (format #t "~Tparm0: ~A~%" (-> this parm0)) + (format #t "~Tparm1: ~A~%" (-> this parm1-basic)) + this ) ;; definition of type clm-item @@ -99,12 +99,12 @@ ) ;; definition for method 3 of type clm-item -(defmethod inspect clm-item ((obj clm-item)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdescription: ~A~%" (-> obj description)) - (format #t "~Tbutton-symbol: ~A~%" (-> obj button-symbol)) - (format #t "~Taction: #~%" (-> obj action)) - obj +(defmethod inspect clm-item ((this clm-item)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdescription: ~A~%" (-> this description)) + (format #t "~Tbutton-symbol: ~A~%" (-> this button-symbol)) + (format #t "~Taction: #~%" (-> this action)) + this ) ;; definition of type clm-list-item @@ -124,15 +124,15 @@ ) ;; definition for method 3 of type clm-list-item -(defmethod inspect clm-list-item ((obj clm-list-item)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdescription: ~A~%" (-> obj description)) - (format #t "~Ttrack-val: ~A~%" (-> obj track-val)) - (format #t "~Tval-func: ~A~%" (-> obj val-func)) - (format #t "~Tval-parm0: ~A~%" (-> obj val-parm0)) - (format #t "~Tval-parm1: ~A~%" (-> obj val-parm1-basic)) - (format #t "~Tactions: ~A~%" (-> obj actions)) - obj +(defmethod inspect clm-list-item ((this clm-list-item)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdescription: ~A~%" (-> this description)) + (format #t "~Ttrack-val: ~A~%" (-> this track-val)) + (format #t "~Tval-func: ~A~%" (-> this val-func)) + (format #t "~Tval-parm0: ~A~%" (-> this val-parm0)) + (format #t "~Tval-parm1: ~A~%" (-> this val-parm1-basic)) + (format #t "~Tactions: ~A~%" (-> this actions)) + this ) ;; definition of type clm-list @@ -147,12 +147,12 @@ ) ;; definition for method 3 of type clm-list -(defmethod inspect clm-list ((obj clm-list)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttracker: ~A~%" (-> obj tracker)) - (format #t "~Tcur-list-item: ~D~%" (-> obj cur-list-item)) - (format #t "~Titems: ~A~%" (-> obj items)) - obj +(defmethod inspect clm-list ((this clm-list)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttracker: ~A~%" (-> this tracker)) + (format #t "~Tcur-list-item: ~D~%" (-> this cur-list-item)) + (format #t "~Titems: ~A~%" (-> this items)) + this ) ;; definition of type clm @@ -166,11 +166,11 @@ ) ;; definition for method 3 of type clm -(defmethod inspect clm ((obj clm)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttitle: ~A~%" (-> obj title)) - (format #t "~Titems: ~A~%" (-> obj items)) - obj +(defmethod inspect clm ((this clm)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttitle: ~A~%" (-> this title)) + (format #t "~Titems: ~A~%" (-> this items)) + this ) ;; definition for symbol *volume-point-current*, type int @@ -195,12 +195,12 @@ ) ;; definition for method 3 of type volume-descriptor-array -(defmethod inspect volume-descriptor-array ((obj volume-descriptor-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect volume-descriptor-array ((this volume-descriptor-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -233,19 +233,19 @@ ) ;; definition for method 3 of type cam-layout -(defmethod inspect cam-layout ((obj cam-layout)) +(defmethod inspect cam-layout ((this cam-layout)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcam-entity: ~A~%" (-> obj cam-entity)) - (format #t "~T~Tnum-entities: ~D~%" (-> obj num-entities)) - (format #t "~T~Tcur-entity: ~D~%" (-> obj cur-entity)) - (format #t "~T~Tnum-volumes: ~D~%" (-> obj num-volumes)) - (format #t "~T~Tcur-volume: ~D~%" (-> obj cur-volume)) - (format #t "~T~Tfirst-pvol: ~D~%" (-> obj first-pvol)) - (format #t "~T~Tfirst-cutoutvol: ~D~%" (-> obj first-cutoutvol)) - (format #t "~T~Tres-key: ~f~%" (-> obj res-key)) - obj + (format #t "~T~Tcam-entity: ~A~%" (-> this cam-entity)) + (format #t "~T~Tnum-entities: ~D~%" (-> this num-entities)) + (format #t "~T~Tcur-entity: ~D~%" (-> this cur-entity)) + (format #t "~T~Tnum-volumes: ~D~%" (-> this num-volumes)) + (format #t "~T~Tcur-volume: ~D~%" (-> this cur-volume)) + (format #t "~T~Tfirst-pvol: ~D~%" (-> this first-pvol)) + (format #t "~T~Tfirst-cutoutvol: ~D~%" (-> this first-cutoutvol)) + (format #t "~T~Tres-key: ~f~%" (-> this res-key)) + this ) ;; definition for function cam-layout-print @@ -566,15 +566,15 @@ ) ;; definition for method 3 of type interp-test-info -(defmethod inspect interp-test-info ((obj interp-test-info)) - (format #t "[~8x] ~A~%" obj 'interp-test-info) - (format #t "~Tfrom: #~%" (-> obj from)) - (format #t "~Tto: #~%" (-> obj to)) - (format #t "~Torigin: #~%" (-> obj origin)) - (format #t "~Tcolor: #~%" (-> obj color)) - (format #t "~Taxis: #~%" (-> obj axis)) - (format #t "~Tdisp: ~A~%" (-> obj disp)) - obj +(defmethod inspect interp-test-info ((this interp-test-info)) + (format #t "[~8x] ~A~%" this 'interp-test-info) + (format #t "~Tfrom: #~%" (-> this from)) + (format #t "~Tto: #~%" (-> this to)) + (format #t "~Torigin: #~%" (-> this origin)) + (format #t "~Tcolor: #~%" (-> this color)) + (format #t "~Taxis: #~%" (-> this axis)) + (format #t "~Tdisp: ~A~%" (-> this disp)) + this ) ;; definition for function interp-test @@ -2426,12 +2426,12 @@ ) ;; definition for method 3 of type clmf-cam-flag-toggle-info -(defmethod inspect clmf-cam-flag-toggle-info ((obj clmf-cam-flag-toggle-info)) - (format #t "[~8x] ~A~%" obj 'clmf-cam-flag-toggle-info) - (format #t "~Tkey: ~f~%" (-> obj key)) - (format #t "~Tforce-on: ~D~%" (-> obj force-on)) - (format #t "~Tforce-off: ~D~%" (-> obj force-off)) - obj +(defmethod inspect clmf-cam-flag-toggle-info ((this clmf-cam-flag-toggle-info)) + (format #t "[~8x] ~A~%" this 'clmf-cam-flag-toggle-info) + (format #t "~Tkey: ~f~%" (-> this key)) + (format #t "~Tforce-on: ~D~%" (-> this force-on)) + (format #t "~Tforce-off: ~D~%" (-> this force-off)) + this ) ;; definition for function clmf-cam-flag-toggle diff --git a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc index dbbe5453e7..37a980793b 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-master_REF.gc @@ -18,17 +18,17 @@ ) ;; definition for method 3 of type camera-master-bank -(defmethod inspect camera-master-bank ((obj camera-master-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tonscreen-head-height: (meters ~m)~%" (-> obj onscreen-head-height)) - (format #t "~Tonscreen-foot-height: (meters ~m)~%" (-> obj onscreen-foot-height)) - (format #t "~Ttarget-height: (meters ~m)~%" (-> obj target-height)) - (format #t "~Tup-move-to-pitch-ratio-in-air: ~f~%" (-> obj up-move-to-pitch-ratio-in-air)) - (format #t "~Tdown-move-to-pitch-ratio-in-air: ~f~%" (-> obj down-move-to-pitch-ratio-in-air)) - (format #t "~Tup-move-to-pitch-on-ground: ~f~%" (-> obj up-move-to-pitch-on-ground)) - (format #t "~Tdown-move-to-pitch-on-ground: ~f~%" (-> obj down-move-to-pitch-on-ground)) - (format #t "~Tpitch-off-blend: ~f~%" (-> obj pitch-off-blend)) - obj +(defmethod inspect camera-master-bank ((this camera-master-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tonscreen-head-height: (meters ~m)~%" (-> this onscreen-head-height)) + (format #t "~Tonscreen-foot-height: (meters ~m)~%" (-> this onscreen-foot-height)) + (format #t "~Ttarget-height: (meters ~m)~%" (-> this target-height)) + (format #t "~Tup-move-to-pitch-ratio-in-air: ~f~%" (-> this up-move-to-pitch-ratio-in-air)) + (format #t "~Tdown-move-to-pitch-ratio-in-air: ~f~%" (-> this down-move-to-pitch-ratio-in-air)) + (format #t "~Tup-move-to-pitch-on-ground: ~f~%" (-> this up-move-to-pitch-on-ground)) + (format #t "~Tdown-move-to-pitch-on-ground: ~f~%" (-> this down-move-to-pitch-on-ground)) + (format #t "~Tpitch-off-blend: ~f~%" (-> this pitch-off-blend)) + this ) ;; definition for symbol *CAMERA_MASTER-bank*, type camera-master-bank @@ -83,18 +83,18 @@ (set! (-> self string-max target z) (-> self stringMaxLength)) (set! (-> self string-push-z) (fmax (-> self string-min value z) (-> *CAMERA-bank* default-string-push-z))) (cond - ((>= (- (-> *display* base-frame-counter) (the-as time-frame (if *target* - (the-as int (-> *target* neck notice-time)) - 0 - ) - ) - ) - (-> *CAMERA-bank* attack-timeout) - ) + ((time-elapsed? + (the-as time-frame (if *target* + (the-as int (-> *target* neck notice-time)) + 0 + ) + ) + (-> *CAMERA-bank* attack-timeout) + ) (set! (-> self being-attacked) #f) ) (else - (set! (-> self attack-start) (-> *display* base-frame-counter)) + (set-time! (-> self attack-start)) (set! (-> self being-attacked) #t) (when (and (not (logtest? (-> self master-options) 64)) (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) @@ -311,19 +311,19 @@ (return (the-as symbol #f)) ) (cond - ((>= (- (-> *display* base-frame-counter) (the-as time-frame (if *target* - (the-as int (-> *target* neck notice-time)) - 0 - ) - ) - ) - (-> *CAMERA-bank* attack-timeout) - ) + ((time-elapsed? + (the-as time-frame (if *target* + (the-as int (-> *target* neck notice-time)) + 0 + ) + ) + (-> *CAMERA-bank* attack-timeout) + ) (set! (-> self being-attacked) #f) ) (else (if (not (-> self being-attacked)) - (set! (-> self attack-start) (-> *display* base-frame-counter)) + (set-time! (-> self attack-start)) ) (set! (-> self being-attacked) #t) (when (and (not (logtest? (-> self master-options) 64)) @@ -924,12 +924,12 @@ ) ;; definition for method 3 of type list-keeper -(defmethod inspect list-keeper ((obj list-keeper)) +(defmethod inspect list-keeper ((this list-keeper)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdummy: ~f~%" (-> obj dummy)) - obj + (format #t "~T~Tdummy: ~f~%" (-> this dummy)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc index 15692c8e02..7178ab15c5 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states-dbg_REF.gc @@ -12,11 +12,11 @@ ) ;; definition for method 3 of type cam-point-watch-bank -(defmethod inspect cam-point-watch-bank ((obj cam-point-watch-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tspeed: ~f~%" (-> obj speed)) - (format #t "~Trot-speed: (deg ~r)~%" (-> obj rot-speed)) - obj +(defmethod inspect cam-point-watch-bank ((this cam-point-watch-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tspeed: ~f~%" (-> this speed)) + (format #t "~Trot-speed: (deg ~r)~%" (-> this rot-speed)) + this ) ;; definition for symbol *CAM_POINT_WATCH-bank*, type cam-point-watch-bank @@ -101,11 +101,11 @@ ) ;; definition for method 3 of type cam-free-bank -(defmethod inspect cam-free-bank ((obj cam-free-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tspeed: ~f~%" (-> obj speed)) - (format #t "~Trot-speed: (deg ~r)~%" (-> obj rot-speed)) - obj +(defmethod inspect cam-free-bank ((this cam-free-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tspeed: ~f~%" (-> this speed)) + (format #t "~Trot-speed: (deg ~r)~%" (-> this rot-speed)) + this ) ;; definition for symbol *CAM_FREE-bank*, type cam-free-bank @@ -365,13 +365,13 @@ ) ;; definition for method 3 of type camera-free-floating-move-info -(defmethod inspect camera-free-floating-move-info ((obj camera-free-floating-move-info)) - (format #t "[~8x] ~A~%" obj 'camera-free-floating-move-info) - (format #t "~Trv: #~%" (-> obj rv)) - (format #t "~Ttv: #~%" (-> obj tv)) - (format #t "~Tup: #~%" (-> obj up)) - (format #t "~Ttm: #~%" (-> obj tm)) - obj +(defmethod inspect camera-free-floating-move-info ((this camera-free-floating-move-info)) + (format #t "[~8x] ~A~%" this 'camera-free-floating-move-info) + (format #t "~Trv: #~%" (-> this rv)) + (format #t "~Ttv: #~%" (-> this tv)) + (format #t "~Tup: #~%" (-> this up)) + (format #t "~Ttm: #~%" (-> this tm)) + this ) ;; definition for function cam-free-floating-move @@ -463,14 +463,14 @@ ) ;; definition for method 3 of type camera-orbit-info -(defmethod inspect camera-orbit-info ((obj camera-orbit-info)) - (format #t "[~8x] ~A~%" obj 'camera-orbit-info) - (format #t "~Tradius: ~f~%" (-> obj radius)) - (format #t "~Trot: ~f~%" (-> obj rot)) - (format #t "~Ttarget-off: #~%" (-> obj target-off)) - (format #t "~Torbit-off: #~%" (-> obj orbit-off)) - (format #t "~Tradius-lerp: ~f~%" (-> obj radius-lerp)) - obj +(defmethod inspect camera-orbit-info ((this camera-orbit-info)) + (format #t "[~8x] ~A~%" this 'camera-orbit-info) + (format #t "~Tradius: ~f~%" (-> this radius)) + (format #t "~Trot: ~f~%" (-> this rot)) + (format #t "~Ttarget-off: #~%" (-> this target-off)) + (format #t "~Torbit-off: #~%" (-> this orbit-off)) + (format #t "~Tradius-lerp: ~f~%" (-> this radius-lerp)) + this ) ;; definition of type CAM_ORBIT-bank @@ -486,13 +486,13 @@ ) ;; definition for method 3 of type CAM_ORBIT-bank -(defmethod inspect CAM_ORBIT-bank ((obj CAM_ORBIT-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~TRADIUS_MAX: ~f~%" (-> obj RADIUS_MAX)) - (format #t "~TRADIUS_MIN: ~f~%" (-> obj RADIUS_MIN)) - (format #t "~TTARGET_OFF_ADJUST: ~f~%" (-> obj TARGET_OFF_ADJUST)) - (format #t "~TORBIT_OFF_ADJUST: ~f~%" (-> obj ORBIT_OFF_ADJUST)) - obj +(defmethod inspect CAM_ORBIT-bank ((this CAM_ORBIT-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~TRADIUS_MAX: ~f~%" (-> this RADIUS_MAX)) + (format #t "~TRADIUS_MIN: ~f~%" (-> this RADIUS_MIN)) + (format #t "~TTARGET_OFF_ADJUST: ~f~%" (-> this TARGET_OFF_ADJUST)) + (format #t "~TORBIT_OFF_ADJUST: ~f~%" (-> this ORBIT_OFF_ADJUST)) + this ) ;; definition for symbol *CAM_ORBIT-bank*, type CAM_ORBIT-bank @@ -591,13 +591,7 @@ ) (when *camera-read-analog* (let ((f0-20 - (analog-input - (the-as int (-> *cpad-list* cpads 0 rightx)) - 128.0 - 32.0 - 110.0 - (* 21845.334 (-> *display* seconds-per-frame)) - ) + (analog-input (the-as int (-> *cpad-list* cpads 0 rightx)) 128.0 32.0 110.0 (* 21845.334 (seconds-per-frame))) ) ) (set! (-> *camera-orbit-info* rot) diff --git a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc index c6d7e2949e..bc53bdeedc 100644 --- a/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/cam-states_REF.gc @@ -388,13 +388,13 @@ ) ;; definition for method 3 of type cam-eye-bank -(defmethod inspect cam-eye-bank ((obj cam-eye-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Trot-speed: ~f~%" (-> obj rot-speed)) - (format #t "~Tmax-degrees: ~f~%" (-> obj max-degrees)) - (format #t "~Tmax-fov: ~f~%" (-> obj max-fov)) - (format #t "~Tmin-fov: ~f~%" (-> obj min-fov)) - obj +(defmethod inspect cam-eye-bank ((this cam-eye-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Trot-speed: ~f~%" (-> this rot-speed)) + (format #t "~Tmax-degrees: ~f~%" (-> this max-degrees)) + (format #t "~Tmax-fov: ~f~%" (-> this max-fov)) + (format #t "~Tmin-fov: ~f~%" (-> this min-fov)) + this ) ;; definition for symbol *CAM_EYE-bank*, type cam-eye-bank @@ -439,7 +439,7 @@ ) ) :code (behavior () - (let ((gp-0 (-> *display* base-frame-counter))) + (let ((gp-0 (current-time))) (loop (when (not (paused?)) (let ((s4-0 (vector-reset! (new-stack-vector0))) @@ -485,10 +485,10 @@ ) (cond ((and (= (-> s4-0 x) 0.0) (= (-> s4-0 y) 0.0)) - (set! gp-0 (-> *display* base-frame-counter)) + (set! gp-0 (current-time)) ) (else - (let ((v1-44 (min 10 (max 1 (- (-> *display* base-frame-counter) gp-0))))) + (let ((v1-44 (min 10 (max 1 (- (current-time) gp-0))))) (vector-float*! s4-0 s4-0 (* 0.1 (the float v1-44))) ) ) @@ -567,11 +567,11 @@ ) ;; definition for method 3 of type cam-billy-bank -(defmethod inspect cam-billy-bank ((obj cam-billy-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Trot-speed: ~f~%" (-> obj rot-speed)) - (format #t "~Ttilt-degrees: ~f~%" (-> obj tilt-degrees)) - obj +(defmethod inspect cam-billy-bank ((this cam-billy-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Trot-speed: ~f~%" (-> this rot-speed)) + (format #t "~Ttilt-degrees: ~f~%" (-> this tilt-degrees)) + this ) ;; definition for symbol *CAM_BILLY-bank*, type cam-billy-bank @@ -909,7 +909,7 @@ (the-as float 128.0) (the-as float 32.0) (the-as float 110.0) - (* 8192.0 (-> *display* seconds-per-frame)) + (* 8192.0 (seconds-per-frame)) ) ) (f1-2 (analog-input @@ -917,7 +917,7 @@ (the-as float 128.0) (the-as float 32.0) (the-as float 110.0) - (* 8192.0 (-> *display* seconds-per-frame)) + (* 8192.0 (seconds-per-frame)) ) ) (s2-0 (new-stack-matrix0)) @@ -936,9 +936,7 @@ (set! f1-2 (- f1-2)) ) (let* ((f1-3 (+ f24-0 f1-2)) - (f1-5 - (fmin (* 8192.0 (-> *display* seconds-per-frame)) (fmax (* -8192.0 (-> *display* seconds-per-frame)) f1-3)) - ) + (f1-5 (fmin (* 8192.0 (seconds-per-frame)) (fmax (* -8192.0 (seconds-per-frame)) f1-3))) ) (cond ((and (< 0.0 f1-5) (< 0.0 f0-9) (< (-> self max-angle-curr) f28-0)) @@ -1210,11 +1208,11 @@ ) ;; definition for method 3 of type cam-string-bank -(defmethod inspect cam-string-bank ((obj cam-string-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlos-coll-rad: (meters ~m)~%" (-> obj los-coll-rad)) - (format #t "~Tlos-coll-rad2: (meters ~m)~%" (-> obj los-coll-rad2)) - obj +(defmethod inspect cam-string-bank ((this cam-string-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlos-coll-rad: (meters ~m)~%" (-> this los-coll-rad)) + (format #t "~Tlos-coll-rad2: (meters ~m)~%" (-> this los-coll-rad2)) + this ) ;; definition for symbol *CAM_STRING-bank*, type cam-string-bank @@ -1329,12 +1327,12 @@ ) ;; definition for method 3 of type los-dist -(defmethod inspect los-dist ((obj los-dist)) - (format #t "[~8x] ~A~%" obj 'los-dist) - (format #t "~Tpar-dist: ~f~%" (-> obj par-dist)) - (format #t "~Tlat-dist: ~f~%" (-> obj lat-dist)) - (format #t "~Tvert-dist: ~f~%" (-> obj vert-dist)) - obj +(defmethod inspect los-dist ((this los-dist)) + (format #t "[~8x] ~A~%" this 'los-dist) + (format #t "~Tpar-dist: ~f~%" (-> this par-dist)) + (format #t "~Tlat-dist: ~f~%" (-> this lat-dist)) + (format #t "~Tvert-dist: ~f~%" (-> this vert-dist)) + this ) ;; definition of type collide-los-dist-info @@ -1355,18 +1353,18 @@ ) ;; definition for method 3 of type collide-los-dist-info -(defmethod inspect collide-los-dist-info ((obj collide-los-dist-info)) - (format #t "[~8x] ~A~%" obj 'collide-los-dist-info) - (format #t "~Tmin-par: ~f~%" (-> obj min-par)) - (format #t "~Tmax-par: ~f~%" (-> obj max-par)) - (format #t "~Tmin-lat: ~f~%" (-> obj min-lat)) - (format #t "~Tmax-lat: ~f~%" (-> obj max-lat)) - (format #t "~Tmin-vp: ~f~%" (-> obj min-vp)) - (format #t "~Tmax-vp: ~f~%" (-> obj max-vp)) - (format #t "~Tmin-vn: ~f~%" (-> obj min-vn)) - (format #t "~Tmax-vn: ~f~%" (-> obj max-vn)) - (format #t "~Tcount: ~D~%" (-> obj count)) - obj +(defmethod inspect collide-los-dist-info ((this collide-los-dist-info)) + (format #t "[~8x] ~A~%" this 'collide-los-dist-info) + (format #t "~Tmin-par: ~f~%" (-> this min-par)) + (format #t "~Tmax-par: ~f~%" (-> this max-par)) + (format #t "~Tmin-lat: ~f~%" (-> this min-lat)) + (format #t "~Tmax-lat: ~f~%" (-> this max-lat)) + (format #t "~Tmin-vp: ~f~%" (-> this min-vp)) + (format #t "~Tmax-vp: ~f~%" (-> this max-vp)) + (format #t "~Tmin-vn: ~f~%" (-> this min-vn)) + (format #t "~Tmax-vn: ~f~%" (-> this max-vn)) + (format #t "~Tcount: ~D~%" (-> this count)) + this ) ;; definition for function dist-info-init @@ -1488,14 +1486,14 @@ ) ;; definition for method 3 of type collide-los-result -(defmethod inspect collide-los-result ((obj collide-los-result)) - (format #t "[~8x] ~A~%" obj 'collide-los-result) - (format #t "~Tlateral: ~`vector`P~%" (-> obj lateral)) - (format #t "~Tcw: #~%" (-> obj cw)) - (format #t "~Tccw: #~%" (-> obj ccw)) - (format #t "~Tstraddle: #~%" (-> obj straddle)) - (format #t "~Tlateral-valid: ~A~%" (-> obj lateral-valid)) - obj +(defmethod inspect collide-los-result ((this collide-los-result)) + (format #t "[~8x] ~A~%" this 'collide-los-result) + (format #t "~Tlateral: ~`vector`P~%" (-> this lateral)) + (format #t "~Tcw: #~%" (-> this cw)) + (format #t "~Tccw: #~%" (-> this ccw)) + (format #t "~Tstraddle: #~%" (-> this straddle)) + (format #t "~Tlateral-valid: ~A~%" (-> this lateral-valid)) + this ) ;; definition for function los-cw-ccw @@ -2130,8 +2128,8 @@ ) (set! (-> self los-last-pos quad) (-> self good-point quad)) (when *display-cam-los-debug* - (format 0 "going because u(~f) > 0 frame ~D~%" f30-2 (-> *display* base-frame-counter)) - (format *stdcon* " going because u(~f) > 0 frame ~D~%" f30-2 (-> *display* base-frame-counter)) + (format 0 "going because u(~f) > 0 frame ~D~%" f30-2 (current-time)) + (format *stdcon* " going because u(~f) > 0 frame ~D~%" f30-2 (current-time)) ) (logior! (-> self options) 4096) ) @@ -2353,9 +2351,7 @@ (if (-> self have-phony-joystick) (set! f28-0 (* 0.05 (-> self phony-joystick-y))) ) - (if (and (-> *camera* being-attacked) - (< (- (-> *display* base-frame-counter) (-> *camera* attack-start)) (seconds 0.25)) - ) + (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05) ) (if (!= f28-0 0.0) @@ -2436,7 +2432,7 @@ (the-as float 128.0) (the-as float 32.0) (the-as float 110.0) - (* 21845.334 (-> *display* seconds-per-frame)) + (* 21845.334 (seconds-per-frame)) ) ) (s4-0 (new-stack-matrix0)) @@ -2444,7 +2440,7 @@ (s5-2 (new-stack-vector0)) ) (if (-> self have-phony-joystick) - (set! f0-29 (* 21845.334 (-> self phony-joystick-x) (-> *display* seconds-per-frame))) + (set! f0-29 (* 21845.334 (-> self phony-joystick-x) (seconds-per-frame))) ) (cond ((and (= (-> self los-state) (slave-los-state ccw)) (< 0.0 f0-29)) @@ -2452,7 +2448,7 @@ (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) ) ) - (set! f0-29 (* 21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-34)) (-> *display* seconds-per-frame))) + (set! f0-29 (* 21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-34)) (seconds-per-frame))) ) ) ((and (= (-> self los-state) (slave-los-state cw)) (< f0-29 0.0)) @@ -2460,7 +2456,7 @@ (fmax (-> self string-min-val z) (fmin (-> self string-max-val z) (vector-length (-> self view-flat)))) ) ) - (set! f0-29 (* -21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-40)) (-> *display* seconds-per-frame))) + (set! f0-29 (* -21845.334 (+ 0.1 (/ (-> self string-min-val z) f0-40)) (seconds-per-frame))) ) ) ) @@ -2478,7 +2474,7 @@ s4-0 gp-2 s5-2 - (* 10922.667 (-> *display* seconds-per-frame)) + (* 10922.667 (seconds-per-frame)) (the-as float 0.05) ) (vector-matrix*! (-> self view-flat) (-> self view-flat) s4-0) @@ -3028,13 +3024,13 @@ ) ;; definition for method 3 of type cam-stick-bank -(defmethod inspect cam-stick-bank ((obj cam-stick-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tmax-z: (meters ~m)~%" (-> obj max-z)) - (format #t "~Tmin-z: (meters ~m)~%" (-> obj min-z)) - (format #t "~Tmax-y: (meters ~m)~%" (-> obj max-y)) - (format #t "~Tmin-y: (meters ~m)~%" (-> obj min-y)) - obj +(defmethod inspect cam-stick-bank ((this cam-stick-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tmax-z: (meters ~m)~%" (-> this max-z)) + (format #t "~Tmin-z: (meters ~m)~%" (-> this min-z)) + (format #t "~Tmax-y: (meters ~m)~%" (-> this max-y)) + (format #t "~Tmin-y: (meters ~m)~%" (-> this min-y)) + this ) ;; definition for symbol *CAM_STICK-bank*, type cam-stick-bank @@ -3209,7 +3205,7 @@ (the-as float 128.0) (the-as float 32.0) (the-as float 110.0) - (* 21845.334 (-> *display* seconds-per-frame)) + (* 21845.334 (seconds-per-frame)) ) ) (gp-0 (new-stack-matrix0)) @@ -3234,7 +3230,7 @@ gp-0 s5-0 s4-0 - (* 10922.667 (-> *display* seconds-per-frame)) + (* 10922.667 (seconds-per-frame)) (the-as float 0.05) ) (vector-matrix*! (-> self view-flat) (-> self view-flat) gp-0) @@ -3267,13 +3263,13 @@ ) ;; definition for method 3 of type cam-bike-bank -(defmethod inspect cam-bike-bank ((obj cam-bike-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tmin-z: (meters ~m)~%" (-> obj max-z)) - (format #t "~Tmax-z: (meters ~m)~%" (-> obj min-z)) - (format #t "~Tmin-y: (meters ~m)~%" (-> obj max-y)) - (format #t "~Tmax-y: (meters ~m)~%" (-> obj min-y)) - obj +(defmethod inspect cam-bike-bank ((this cam-bike-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tmin-z: (meters ~m)~%" (-> this max-z)) + (format #t "~Tmax-z: (meters ~m)~%" (-> this min-z)) + (format #t "~Tmin-y: (meters ~m)~%" (-> this max-y)) + (format #t "~Tmax-y: (meters ~m)~%" (-> this min-y)) + this ) ;; definition for symbol *CAM_BIKE-bank*, type cam-bike-bank diff --git a/test/decompiler/reference/jak1/engine/camera/camera-h_REF.gc b/test/decompiler/reference/jak1/engine/camera/camera-h_REF.gc index ecf0926b97..33eb8a33c1 100644 --- a/test/decompiler/reference/jak1/engine/camera/camera-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/camera-h_REF.gc @@ -20,19 +20,19 @@ ) ;; definition for method 3 of type camera-bank -(defmethod inspect camera-bank ((obj camera-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tcollide-move-rad: ~f~%" (-> obj collide-move-rad)) - (format #t "~Tjoypad: ~D~%" (-> obj joypad)) - (format #t "~Tmin-detectable-velocity: ~f~%" (-> obj min-detectable-velocity)) - (format #t "~Tattack-timeout: ~D~%" (-> obj attack-timeout)) - (format #t "~Tdefault-string-max-y: (meters ~m)~%" (-> obj default-string-max-y)) - (format #t "~Tdefault-string-min-y: (meters ~m)~%" (-> obj default-string-min-y)) - (format #t "~Tdefault-string-max-z: (meters ~m)~%" (-> obj default-string-max-z)) - (format #t "~Tdefault-string-min-z: (meters ~m)~%" (-> obj default-string-min-z)) - (format #t "~Tdefault-string-push-z: (meters ~m)~%" (-> obj default-string-push-z)) - (format #t "~Tdefault-tilt-adjust: (deg ~r)~%" (-> obj default-tilt-adjust)) - obj +(defmethod inspect camera-bank ((this camera-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tcollide-move-rad: ~f~%" (-> this collide-move-rad)) + (format #t "~Tjoypad: ~D~%" (-> this joypad)) + (format #t "~Tmin-detectable-velocity: ~f~%" (-> this min-detectable-velocity)) + (format #t "~Tattack-timeout: ~D~%" (-> this attack-timeout)) + (format #t "~Tdefault-string-max-y: (meters ~m)~%" (-> this default-string-max-y)) + (format #t "~Tdefault-string-min-y: (meters ~m)~%" (-> this default-string-min-y)) + (format #t "~Tdefault-string-max-z: (meters ~m)~%" (-> this default-string-max-z)) + (format #t "~Tdefault-string-min-z: (meters ~m)~%" (-> this default-string-min-z)) + (format #t "~Tdefault-string-push-z: (meters ~m)~%" (-> this default-string-push-z)) + (format #t "~Tdefault-tilt-adjust: (deg ~r)~%" (-> this default-tilt-adjust)) + this ) ;; definition for symbol *CAMERA-bank*, type camera-bank @@ -64,11 +64,11 @@ ) ;; definition for method 3 of type cam-index -(defmethod inspect cam-index ((obj cam-index)) - (format #t "[~8x] ~A~%" obj 'cam-index) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tvec[2] @ #x~X~%" (-> obj vec)) - obj +(defmethod inspect cam-index ((this cam-index)) + (format #t "[~8x] ~A~%" this 'cam-index) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tvec[2] @ #x~X~%" (-> this vec)) + this ) ;; definition of type tracking-point @@ -85,14 +85,14 @@ ) ;; definition for method 3 of type tracking-point -(defmethod inspect tracking-point ((obj tracking-point)) - (format #t "[~8x] ~A~%" obj 'tracking-point) - (format #t "~Tposition: #~%" (-> obj position)) - (format #t "~Tdirection: #~%" (-> obj direction)) - (format #t "~Ttp-length: ~f~%" (-> obj tp-length)) - (format #t "~Tnext: ~D~%" (-> obj next)) - (format #t "~Tincarnation: ~D~%" (-> obj incarnation)) - obj +(defmethod inspect tracking-point ((this tracking-point)) + (format #t "[~8x] ~A~%" this 'tracking-point) + (format #t "~Tposition: #~%" (-> this position)) + (format #t "~Tdirection: #~%" (-> this direction)) + (format #t "~Ttp-length: ~f~%" (-> this tp-length)) + (format #t "~Tnext: ~D~%" (-> this next)) + (format #t "~Tincarnation: ~D~%" (-> this incarnation)) + this ) ;; definition of type tracking-spline-sampler @@ -106,11 +106,11 @@ ) ;; definition for method 3 of type tracking-spline-sampler -(defmethod inspect tracking-spline-sampler ((obj tracking-spline-sampler)) - (format #t "[~8x] ~A~%" obj 'tracking-spline-sampler) - (format #t "~Tcur-pt: ~D~%" (-> obj cur-pt)) - (format #t "~Tpartial-pt: ~f~%" (-> obj partial-pt)) - obj +(defmethod inspect tracking-spline-sampler ((this tracking-spline-sampler)) + (format #t "[~8x] ~A~%" this 'tracking-spline-sampler) + (format #t "~Tcur-pt: ~D~%" (-> this cur-pt)) + (format #t "~Tpartial-pt: ~f~%" (-> this partial-pt)) + this ) ;; definition of type tracking-spline @@ -153,23 +153,23 @@ ) ;; definition for method 3 of type tracking-spline -(defmethod inspect tracking-spline ((obj tracking-spline)) - (format #t "[~8x] ~A~%" obj 'tracking-spline) - (format #t "~Tpoint[32] @ #x~X~%" (-> obj point)) - (format #t "~Tsummed-len: ~f~%" (-> obj summed-len)) - (format #t "~Tfree-point: ~D~%" (-> obj free-point)) - (format #t "~Tused-point: ~D~%" (-> obj used-point)) - (format #t "~Tpartial-point: ~f~%" (-> obj partial-point)) - (format #t "~Tend-point: ~D~%" (-> obj end-point)) - (format #t "~Tnext-to-last-point: ~D~%" (-> obj next-to-last-point)) - (format #t "~Tmax-move: ~f~%" (-> obj max-move)) - (format #t "~Tsample-len: ~f~%" (-> obj sample-len)) - (format #t "~Tused-count: ~D~%" (-> obj used-count)) - (format #t "~Told-position: #~%" (-> obj old-position)) - (format #t "~Tdebug-old-position: #~%" (-> obj debug-old-position)) - (format #t "~Tdebug-out-position: #~%" (-> obj debug-out-position)) - (format #t "~Tdebug-last-point: ~D~%" (-> obj debug-last-point)) - obj +(defmethod inspect tracking-spline ((this tracking-spline)) + (format #t "[~8x] ~A~%" this 'tracking-spline) + (format #t "~Tpoint[32] @ #x~X~%" (-> this point)) + (format #t "~Tsummed-len: ~f~%" (-> this summed-len)) + (format #t "~Tfree-point: ~D~%" (-> this free-point)) + (format #t "~Tused-point: ~D~%" (-> this used-point)) + (format #t "~Tpartial-point: ~f~%" (-> this partial-point)) + (format #t "~Tend-point: ~D~%" (-> this end-point)) + (format #t "~Tnext-to-last-point: ~D~%" (-> this next-to-last-point)) + (format #t "~Tmax-move: ~f~%" (-> this max-move)) + (format #t "~Tsample-len: ~f~%" (-> this sample-len)) + (format #t "~Tused-count: ~D~%" (-> this used-count)) + (format #t "~Told-position: #~%" (-> this old-position)) + (format #t "~Tdebug-old-position: #~%" (-> this debug-old-position)) + (format #t "~Tdebug-out-position: #~%" (-> this debug-out-position)) + (format #t "~Tdebug-last-point: ~D~%" (-> this debug-last-point)) + this ) ;; definition of type cam-float-seeker @@ -194,73 +194,73 @@ ) ;; definition for method 3 of type cam-float-seeker -(defmethod inspect cam-float-seeker ((obj cam-float-seeker)) - (format #t "[~8x] ~A~%" obj 'cam-float-seeker) - (format #t "~Ttarget: ~f~%" (-> obj target)) - (format #t "~Tvalue: ~f~%" (-> obj value)) - (format #t "~Tvel: ~f~%" (-> obj vel)) - (format #t "~Taccel: ~f~%" (-> obj accel)) - (format #t "~Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~Tmax-partial: ~f~%" (-> obj max-partial)) - obj +(defmethod inspect cam-float-seeker ((this cam-float-seeker)) + (format #t "[~8x] ~A~%" this 'cam-float-seeker) + (format #t "~Ttarget: ~f~%" (-> this target)) + (format #t "~Tvalue: ~f~%" (-> this value)) + (format #t "~Tvel: ~f~%" (-> this vel)) + (format #t "~Taccel: ~f~%" (-> this accel)) + (format #t "~Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~Tmax-partial: ~f~%" (-> this max-partial)) + this ) ;; definition for method 9 of type cam-float-seeker ;; INFO: Return type mismatch int vs none. -(defmethod init-cam-float-seeker cam-float-seeker ((obj cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (set! (-> obj target) arg0) - (set! (-> obj value) arg0) - (set! (-> obj vel) 0.0) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj max-partial) arg3) +(defmethod init-cam-float-seeker cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> this target) arg0) + (set! (-> this value) arg0) + (set! (-> this vel) 0.0) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this max-partial) arg3) 0 (none) ) ;; definition for method 10 of type cam-float-seeker ;; INFO: Return type mismatch int vs none. -(defmethod copy-cam-float-seeker cam-float-seeker ((obj cam-float-seeker) (arg0 cam-float-seeker)) - (set! (-> obj target) (-> arg0 target)) - (set! (-> obj value) (-> arg0 value)) - (set! (-> obj vel) (-> arg0 vel)) - (set! (-> obj accel) (-> arg0 accel)) - (set! (-> obj max-vel) (-> arg0 max-vel)) - (set! (-> obj max-partial) (-> arg0 max-partial)) +(defmethod copy-cam-float-seeker cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker)) + (set! (-> this target) (-> arg0 target)) + (set! (-> this value) (-> arg0 value)) + (set! (-> this vel) (-> arg0 vel)) + (set! (-> this accel) (-> arg0 accel)) + (set! (-> this max-vel) (-> arg0 max-vel)) + (set! (-> this max-partial) (-> arg0 max-partial)) 0 (none) ) ;; definition for method 11 of type cam-float-seeker ;; INFO: Return type mismatch int vs none. -(defmethod update! cam-float-seeker ((obj cam-float-seeker) (offset float)) +(defmethod update! cam-float-seeker ((this cam-float-seeker) (offset float)) 0.0 0.0 - (let* ((pos-error (- (+ (-> obj target) offset) (-> obj value))) - (partial-velocity-limit (* (-> obj max-partial) (fabs pos-error))) + (let* ((pos-error (- (+ (-> this target) offset) (-> this value))) + (partial-velocity-limit (* (-> this max-partial) (fabs pos-error))) ) - (let ((daccel (* pos-error (* (-> obj accel) (-> *display* time-adjust-ratio))))) - (+! (-> obj vel) daccel) + (let ((daccel (* pos-error (* (-> this accel) (-> *display* time-adjust-ratio))))) + (+! (-> this vel) daccel) ) - (let ((abs-vel (fabs (-> obj vel))) - (abs-vel-limit (fmin partial-velocity-limit (-> obj max-vel))) + (let ((abs-vel (fabs (-> this vel))) + (abs-vel-limit (fmin partial-velocity-limit (-> this max-vel))) ) (if (< abs-vel-limit abs-vel) - (set! (-> obj vel) (* (-> obj vel) (/ abs-vel-limit abs-vel))) + (set! (-> this vel) (* (-> this vel) (/ abs-vel-limit abs-vel))) ) ) ) - (let ((dpos (* (-> obj vel) (-> *display* time-adjust-ratio)))) - (+! (-> obj value) dpos) + (let ((dpos (* (-> this vel) (-> *display* time-adjust-ratio)))) + (+! (-> this value) dpos) ) 0 (none) ) ;; definition for method 12 of type cam-float-seeker -(defmethod jump-to-target! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) - (set! (-> obj value) (+ (-> obj target) arg0)) - (set! (-> obj vel) 0.0) +(defmethod jump-to-target! cam-float-seeker ((this cam-float-seeker) (arg0 float)) + (set! (-> this value) (+ (-> this target) arg0)) + (set! (-> this vel) 0.0) ) ;; definition of type cam-vector-seeker @@ -282,66 +282,66 @@ ) ;; definition for method 3 of type cam-vector-seeker -(defmethod inspect cam-vector-seeker ((obj cam-vector-seeker)) - (format #t "[~8x] ~A~%" obj 'cam-vector-seeker) - (format #t "~Ttarget: #~%" (-> obj target)) - (format #t "~Tvalue: #~%" (-> obj value)) - (format #t "~Tvel: #~%" (-> obj vel)) - (format #t "~Taccel: ~f~%" (-> obj accel)) - (format #t "~Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~Tmax-partial: ~f~%" (-> obj max-partial)) - obj +(defmethod inspect cam-vector-seeker ((this cam-vector-seeker)) + (format #t "[~8x] ~A~%" this 'cam-vector-seeker) + (format #t "~Ttarget: #~%" (-> this target)) + (format #t "~Tvalue: #~%" (-> this value)) + (format #t "~Tvel: #~%" (-> this vel)) + (format #t "~Taccel: ~f~%" (-> this accel)) + (format #t "~Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~Tmax-partial: ~f~%" (-> this max-partial)) + this ) ;; definition for method 9 of type cam-vector-seeker ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod init! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj value quad) (-> arg0 quad)) + (set! (-> this target quad) (-> arg0 quad)) + (set! (-> this value quad) (-> arg0 quad)) ) (else - (vector-reset! (-> obj target)) - (vector-reset! (-> obj value)) + (vector-reset! (-> this target)) + (vector-reset! (-> this value)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj max-partial) arg3) + (vector-reset! (-> this vel)) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this max-partial) arg3) 0 (none) ) ;; definition for method 10 of type cam-vector-seeker ;; INFO: Return type mismatch int vs none. -(defmethod update! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector)) +(defmethod update! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) 0.0 (cond (arg0 - (vector+! gp-0 (-> obj target) arg0) - (vector-! gp-0 gp-0 (-> obj value)) + (vector+! gp-0 (-> this target) arg0) + (vector-! gp-0 gp-0 (-> this value)) ) (else - (vector-! gp-0 (-> obj target) (-> obj value)) + (vector-! gp-0 (-> this target) (-> this value)) ) ) - (let ((f30-1 (* (-> obj max-partial) (vector-length gp-0)))) - (vector-float*! gp-0 gp-0 (* (-> obj accel) (-> *display* time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) gp-0) - (let ((f0-4 (vector-length (-> obj vel))) - (f1-2 (fmin f30-1 (-> obj max-vel))) + (let ((f30-1 (* (-> this max-partial) (vector-length gp-0)))) + (vector-float*! gp-0 gp-0 (* (-> this accel) (-> *display* time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) gp-0) + (let ((f0-4 (vector-length (-> this vel))) + (f1-2 (fmin f30-1 (-> this max-vel))) ) (if (< f1-2 f0-4) - (vector-float*! (-> obj vel) (-> obj vel) (/ f1-2 f0-4)) + (vector-float*! (-> this vel) (-> this vel) (/ f1-2 f0-4)) ) ) ) - (vector-float*! gp-0 (-> obj vel) (-> *display* time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) gp-0) + (vector-float*! gp-0 (-> this vel) (-> *display* time-adjust-ratio)) + (vector+! (-> this value) (-> this value) gp-0) ) 0 (none) @@ -366,19 +366,19 @@ ) ;; definition for method 3 of type cam-rotation-tracker -(defmethod inspect cam-rotation-tracker ((obj cam-rotation-tracker)) - (format #t "[~8x] ~A~%" obj 'cam-rotation-tracker) - (format #t "~Tinv-mat: ~`matrix`P~%" (-> obj inv-mat)) - (format #t "~Tno-follow: ~A~%" (-> obj no-follow)) - (format #t "~Tfollow-pt: ~`vector`P~%" (-> obj follow-pt)) - (format #t "~Tfollow-off: ~`vector`P~%" (-> obj follow-off)) - (format #t "~Tfollow-blend: ~f~%" (-> obj follow-blend)) - (format #t "~Ttilt-adjust: #~%" (-> obj tilt-adjust)) - (format #t "~Tuse-point-of-interest: ~A~%" (-> obj use-point-of-interest)) - (format #t "~Tpoint-of-interest: ~`vector`P~%" (-> obj point-of-interest)) - (format #t "~Tpoint-of-interest-blend: #~%" (-> obj point-of-interest-blend)) - (format #t "~Tunderwater-blend: #~%" (-> obj underwater-blend)) - obj +(defmethod inspect cam-rotation-tracker ((this cam-rotation-tracker)) + (format #t "[~8x] ~A~%" this 'cam-rotation-tracker) + (format #t "~Tinv-mat: ~`matrix`P~%" (-> this inv-mat)) + (format #t "~Tno-follow: ~A~%" (-> this no-follow)) + (format #t "~Tfollow-pt: ~`vector`P~%" (-> this follow-pt)) + (format #t "~Tfollow-off: ~`vector`P~%" (-> this follow-off)) + (format #t "~Tfollow-blend: ~f~%" (-> this follow-blend)) + (format #t "~Ttilt-adjust: #~%" (-> this tilt-adjust)) + (format #t "~Tuse-point-of-interest: ~A~%" (-> this use-point-of-interest)) + (format #t "~Tpoint-of-interest: ~`vector`P~%" (-> this point-of-interest)) + (format #t "~Tpoint-of-interest-blend: #~%" (-> this point-of-interest-blend)) + (format #t "~Tunderwater-blend: #~%" (-> this underwater-blend)) + this ) ;; definition of type camera-combiner @@ -406,23 +406,23 @@ ) ;; definition for method 3 of type camera-combiner -(defmethod inspect camera-combiner ((obj camera-combiner)) +(defmethod inspect camera-combiner ((this camera-combiner)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~T~Tinv-camera-rot: ~`matrix`P~%" (-> obj inv-camera-rot)) - (format #t "~T~Tfov: ~f~%" (-> obj fov)) - (format #t "~T~Tinterp-val: ~f~%" (-> obj interp-val)) - (format #t "~T~Tinterp-step: ~f~%" (-> obj interp-step)) - (format #t "~T~Tdist-from-src: ~f~%" (-> obj dist-from-src)) - (format #t "~T~Tdist-from-dest: ~f~%" (-> obj dist-from-dest)) - (format #t "~T~Tflip-control-axis: #~%" (-> obj flip-control-axis)) - (format #t "~T~Tvelocity: #~%" (-> obj velocity)) - (format #t "~T~Ttracking-status: ~D~%" (-> obj tracking-status)) - (format #t "~T~Ttracking-options: ~D~%" (-> obj tracking-options)) - (format #t "~T~Ttracking: #~%" (-> obj tracking)) - obj + (format #t "~T~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~T~Tinv-camera-rot: ~`matrix`P~%" (-> this inv-camera-rot)) + (format #t "~T~Tfov: ~f~%" (-> this fov)) + (format #t "~T~Tinterp-val: ~f~%" (-> this interp-val)) + (format #t "~T~Tinterp-step: ~f~%" (-> this interp-step)) + (format #t "~T~Tdist-from-src: ~f~%" (-> this dist-from-src)) + (format #t "~T~Tdist-from-dest: ~f~%" (-> this dist-from-dest)) + (format #t "~T~Tflip-control-axis: #~%" (-> this flip-control-axis)) + (format #t "~T~Tvelocity: #~%" (-> this velocity)) + (format #t "~T~Ttracking-status: ~D~%" (-> this tracking-status)) + (format #t "~T~Ttracking-options: ~D~%" (-> this tracking-options)) + (format #t "~T~Ttracking: #~%" (-> this tracking)) + this ) ;; definition of type camera-slave @@ -514,61 +514,61 @@ ) ;; definition for method 3 of type camera-slave -(defmethod inspect camera-slave ((obj camera-slave)) +(defmethod inspect camera-slave ((this camera-slave)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~T~Tfov: ~f~%" (-> obj fov)) - (format #t "~T~Tfov0: ~f~%" (-> obj fov0)) - (format #t "~T~Tfov1: ~f~%" (-> obj fov1)) - (format #t "~T~Tfov-index: #~%" (-> obj fov-index)) - (format #t "~T~Ttracking: #~%" (-> obj tracking)) - (format #t "~T~Tview-off-param: ~f~%" (-> obj view-off-param)) - (format #t "~T~Tview-off: ~`vector`P~%" (-> obj view-off)) - (format #t "~T~Tmin-z-override: ~f~%" (-> obj min-z-override)) - (format #t "~T~Tview-flat: ~`vector`P~%" (-> obj view-flat)) - (format #t "~T~Tstring-vel-dir: ~D~%" (-> obj string-vel-dir)) - (format #t "~T~Tstring-trans: ~`vector`P~%" (-> obj string-trans)) - (format #t "~T~Tposition-spline: #~%" (-> obj position-spline)) - (format #t "~T~Tpivot-pt: ~`vector`P~%" (-> obj pivot-pt)) - (format #t "~T~Tpivot-rad: ~f~%" (-> obj pivot-rad)) - (format #t "~T~Tcircular-follow: #~%" (-> obj circular-follow)) - (format #t "~T~Tmax-angle-offset: ~f~%" (-> obj max-angle-offset)) - (format #t "~T~Tmax-angle-curr: ~f~%" (-> obj max-angle-curr)) - (format #t "~T~Toptions: ~D~%" (-> obj options)) - (format #t "~T~Tcam-entity: ~A~%" (-> obj cam-entity)) - (format #t "~T~Tvelocity: ~`vector`P~%" (-> obj velocity)) - (format #t "~T~Tdesired-pos: ~`vector`P~%" (-> obj desired-pos)) - (format #t "~T~Ttime-dist-too-far: ~D~%" (-> obj time-dist-too-far)) - (format #t "~T~Tlos-state: ~D~%" (-> obj los-state)) - (format #t "~T~Tgood-point: ~`vector`P~%" (-> obj good-point)) - (format #t "~T~Tlos-tgt-spline-pt: ~D~%" (-> obj los-tgt-spline-pt)) - (format #t "~T~Tlos-tgt-spline-pt-incarnation: ~D~%" (-> obj los-tgt-spline-pt-incarnation)) - (format #t "~T~Tlos-last-pos: ~`vector`P~%" (-> obj los-last-pos)) - (format #t "~T~Tintro-curve: #~%" (-> obj intro-curve)) - (format #t "~T~Tintro-offset: #~%" (-> obj intro-offset)) - (format #t "~T~Tintro-t: ~f~%" (-> obj intro-t)) - (format #t "~T~Tintro-t-step: ~f~%" (-> obj intro-t-step)) - (format #t "~T~Toutro-exit-value: ~f~%" (-> obj outro-exit-value)) - (format #t "~T~Tspline-exists: ~A~%" (-> obj spline-exists)) - (format #t "~T~Tspline-curve: #~%" (-> obj spline-curve)) - (format #t "~T~Tspline-offset: #~%" (-> obj spline-offset)) - (format #t "~T~Tindex: #~%" (-> obj index)) - (format #t "~T~Tsaved-pt: #~%" (-> obj saved-pt)) - (format #t "~T~Tspline-tt: ~f~%" (-> obj spline-tt)) - (format #t "~T~Tspline-follow-dist: ~f~%" (-> obj spline-follow-dist)) - (format #t "~T~Tchange-event-from: #x~X~%" (-> obj change-event-from)) - (format #t "~T~Tenter-has-run: ~A~%" (-> obj enter-has-run)) - (format #t "~T~Tblend-from-type: ~D~%" (-> obj blend-from-type)) - (format #t "~T~Tblend-to-type: ~D~%" (-> obj blend-to-type)) - (format #t "~T~Thave-phony-joystick: ~A~%" (-> obj have-phony-joystick)) - (format #t "~T~Tphony-joystick-x: ~f~%" (-> obj phony-joystick-x)) - (format #t "~T~Tphony-joystick-y: ~f~%" (-> obj phony-joystick-y)) - (format #t "~T~Tstring-min-val: #~%" (-> obj string-min-val)) - (format #t "~T~Tstring-max-val: #~%" (-> obj string-max-val)) - (format #t "~T~Tstring-val-locked: ~A~%" (-> obj string-val-locked)) - obj + (format #t "~T~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~T~Tfov: ~f~%" (-> this fov)) + (format #t "~T~Tfov0: ~f~%" (-> this fov0)) + (format #t "~T~Tfov1: ~f~%" (-> this fov1)) + (format #t "~T~Tfov-index: #~%" (-> this fov-index)) + (format #t "~T~Ttracking: #~%" (-> this tracking)) + (format #t "~T~Tview-off-param: ~f~%" (-> this view-off-param)) + (format #t "~T~Tview-off: ~`vector`P~%" (-> this view-off)) + (format #t "~T~Tmin-z-override: ~f~%" (-> this min-z-override)) + (format #t "~T~Tview-flat: ~`vector`P~%" (-> this view-flat)) + (format #t "~T~Tstring-vel-dir: ~D~%" (-> this string-vel-dir)) + (format #t "~T~Tstring-trans: ~`vector`P~%" (-> this string-trans)) + (format #t "~T~Tposition-spline: #~%" (-> this position-spline)) + (format #t "~T~Tpivot-pt: ~`vector`P~%" (-> this pivot-pt)) + (format #t "~T~Tpivot-rad: ~f~%" (-> this pivot-rad)) + (format #t "~T~Tcircular-follow: #~%" (-> this circular-follow)) + (format #t "~T~Tmax-angle-offset: ~f~%" (-> this max-angle-offset)) + (format #t "~T~Tmax-angle-curr: ~f~%" (-> this max-angle-curr)) + (format #t "~T~Toptions: ~D~%" (-> this options)) + (format #t "~T~Tcam-entity: ~A~%" (-> this cam-entity)) + (format #t "~T~Tvelocity: ~`vector`P~%" (-> this velocity)) + (format #t "~T~Tdesired-pos: ~`vector`P~%" (-> this desired-pos)) + (format #t "~T~Ttime-dist-too-far: ~D~%" (-> this time-dist-too-far)) + (format #t "~T~Tlos-state: ~D~%" (-> this los-state)) + (format #t "~T~Tgood-point: ~`vector`P~%" (-> this good-point)) + (format #t "~T~Tlos-tgt-spline-pt: ~D~%" (-> this los-tgt-spline-pt)) + (format #t "~T~Tlos-tgt-spline-pt-incarnation: ~D~%" (-> this los-tgt-spline-pt-incarnation)) + (format #t "~T~Tlos-last-pos: ~`vector`P~%" (-> this los-last-pos)) + (format #t "~T~Tintro-curve: #~%" (-> this intro-curve)) + (format #t "~T~Tintro-offset: #~%" (-> this intro-offset)) + (format #t "~T~Tintro-t: ~f~%" (-> this intro-t)) + (format #t "~T~Tintro-t-step: ~f~%" (-> this intro-t-step)) + (format #t "~T~Toutro-exit-value: ~f~%" (-> this outro-exit-value)) + (format #t "~T~Tspline-exists: ~A~%" (-> this spline-exists)) + (format #t "~T~Tspline-curve: #~%" (-> this spline-curve)) + (format #t "~T~Tspline-offset: #~%" (-> this spline-offset)) + (format #t "~T~Tindex: #~%" (-> this index)) + (format #t "~T~Tsaved-pt: #~%" (-> this saved-pt)) + (format #t "~T~Tspline-tt: ~f~%" (-> this spline-tt)) + (format #t "~T~Tspline-follow-dist: ~f~%" (-> this spline-follow-dist)) + (format #t "~T~Tchange-event-from: #x~X~%" (-> this change-event-from)) + (format #t "~T~Tenter-has-run: ~A~%" (-> this enter-has-run)) + (format #t "~T~Tblend-from-type: ~D~%" (-> this blend-from-type)) + (format #t "~T~Tblend-to-type: ~D~%" (-> this blend-to-type)) + (format #t "~T~Thave-phony-joystick: ~A~%" (-> this have-phony-joystick)) + (format #t "~T~Tphony-joystick-x: ~f~%" (-> this phony-joystick-x)) + (format #t "~T~Tphony-joystick-y: ~f~%" (-> this phony-joystick-y)) + (format #t "~T~Tstring-min-val: #~%" (-> this string-min-val)) + (format #t "~T~Tstring-max-val: #~%" (-> this string-max-val)) + (format #t "~T~Tstring-val-locked: ~A~%" (-> this string-val-locked)) + this ) ;; definition of type camera-master @@ -638,64 +638,64 @@ ) ;; definition for method 3 of type camera-master -(defmethod inspect camera-master ((obj camera-master)) +(defmethod inspect camera-master ((this camera-master)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmaster-options: ~D~%" (-> obj master-options)) - (format #t "~T~Tnum-slaves: ~D~%" (-> obj num-slaves)) - (format #t "~T~Tslave[2] @ #x~X~%" (-> obj slave)) - (format #t "~T~Tslave-options: ~D~%" (-> obj slave-options)) - (format #t "~T~Tview-off-param-save: ~f~%" (-> obj view-off-param-save)) - (format #t "~T~Tchanger: #x~X~%" (-> obj changer)) - (format #t "~T~Tcam-entity: ~A~%" (-> obj cam-entity)) - (format #t "~T~TstringMinLength: ~f~%" (-> obj stringMinLength)) - (format #t "~T~TstringMaxLength: ~f~%" (-> obj stringMaxLength)) - (format #t "~T~TstringMinHeight: ~f~%" (-> obj stringMinHeight)) - (format #t "~T~TstringMaxHeight: ~f~%" (-> obj stringMaxHeight)) - (format #t "~T~Tstring-min: #~%" (-> obj string-min)) - (format #t "~T~Tstring-max: #~%" (-> obj string-max)) - (format #t "~T~Tstring-push-z: ~f~%" (-> obj string-push-z)) - (format #t "~T~TstringCliffHeight: ~f~%" (-> obj stringCliffHeight)) - (format #t "~T~Tno-intro: ~D~%" (-> obj no-intro)) - (format #t "~T~Tforce-blend: ~D~%" (-> obj force-blend)) - (format #t "~T~Tforce-blend-time: ~D~%" (-> obj force-blend-time)) - (format #t "~T~Tlocal-down: ~`vector`P~%" (-> obj local-down)) - (format #t "~T~Tdrawable-target: ~D~%" (-> obj drawable-target)) - (format #t "~T~Twhich-bone: ~D~%" (-> obj which-bone)) - (format #t "~T~Tpov-handle: ~D~%" (-> obj pov-handle)) - (format #t "~T~Tpov-bone: ~D~%" (-> obj pov-bone)) - (format #t "~T~Tbeing-attacked: ~A~%" (-> obj being-attacked)) - (format #t "~T~Tattack-start: ~D~%" (-> obj attack-start)) - (format #t "~T~Ton-ground: ~A~%" (-> obj on-ground)) - (format #t "~T~Tunder-water: ~D~%" (-> obj under-water)) - (format #t "~T~Ton-pole: ~A~%" (-> obj on-pole)) - (format #t "~T~Ttgt-rot-mat: ~`matrix`P~%" (-> obj tgt-rot-mat)) - (format #t "~T~Ttgt-face-mat: ~`matrix`P~%" (-> obj tgt-face-mat)) - (format #t "~T~Ttpos-old: ~`vector`P~%" (-> obj tpos-old)) - (format #t "~T~Ttpos-curr: ~`vector`P~%" (-> obj tpos-curr)) - (format #t "~T~Ttarget-height: ~f~%" (-> obj target-height)) - (format #t "~T~Ttpos-old-adj: ~`vector`P~%" (-> obj tpos-old-adj)) - (format #t "~T~Ttpos-curr-adj: ~`vector`P~%" (-> obj tpos-curr-adj)) - (format #t "~T~Ttpos-tgt: ~`vector`P~%" (-> obj tpos-tgt)) - (format #t "~T~Tupspeed: ~f~%" (-> obj upspeed)) - (format #t "~T~Tpitch-off: ~`vector`P~%" (-> obj pitch-off)) - (format #t "~T~Tfoot-offset: ~f~%" (-> obj foot-offset)) - (format #t "~T~Thead-offset: ~f~%" (-> obj head-offset)) - (format #t "~T~Ttarget-spline: #~%" (-> obj target-spline)) - (format #t "~T~Tease-from: #~%" (-> obj ease-from)) - (format #t "~T~Tease-t: ~f~%" (-> obj ease-t)) - (format #t "~T~Tease-step: ~f~%" (-> obj ease-step)) - (format #t "~T~Tease-to: #~%" (-> obj ease-to)) - (format #t "~T~Toutro-curve: #~%" (-> obj outro-curve)) - (format #t "~T~Toutro-t: ~f~%" (-> obj outro-t)) - (format #t "~T~Toutro-t-step: ~f~%" (-> obj outro-t-step)) - (format #t "~T~Toutro-exit-value: ~f~%" (-> obj outro-exit-value)) - (format #t "~T~Twater-drip-time: ~D~%" (-> obj water-drip-time)) - (format #t "~T~Twater-drip: ~A~%" (-> obj water-drip)) - (format #t "~T~Twater-drip-mult: ~f~%" (-> obj water-drip-mult)) - (format #t "~T~Twater-drip-speed: ~f~%" (-> obj water-drip-speed)) - obj + (format #t "~T~Tmaster-options: ~D~%" (-> this master-options)) + (format #t "~T~Tnum-slaves: ~D~%" (-> this num-slaves)) + (format #t "~T~Tslave[2] @ #x~X~%" (-> this slave)) + (format #t "~T~Tslave-options: ~D~%" (-> this slave-options)) + (format #t "~T~Tview-off-param-save: ~f~%" (-> this view-off-param-save)) + (format #t "~T~Tchanger: #x~X~%" (-> this changer)) + (format #t "~T~Tcam-entity: ~A~%" (-> this cam-entity)) + (format #t "~T~TstringMinLength: ~f~%" (-> this stringMinLength)) + (format #t "~T~TstringMaxLength: ~f~%" (-> this stringMaxLength)) + (format #t "~T~TstringMinHeight: ~f~%" (-> this stringMinHeight)) + (format #t "~T~TstringMaxHeight: ~f~%" (-> this stringMaxHeight)) + (format #t "~T~Tstring-min: #~%" (-> this string-min)) + (format #t "~T~Tstring-max: #~%" (-> this string-max)) + (format #t "~T~Tstring-push-z: ~f~%" (-> this string-push-z)) + (format #t "~T~TstringCliffHeight: ~f~%" (-> this stringCliffHeight)) + (format #t "~T~Tno-intro: ~D~%" (-> this no-intro)) + (format #t "~T~Tforce-blend: ~D~%" (-> this force-blend)) + (format #t "~T~Tforce-blend-time: ~D~%" (-> this force-blend-time)) + (format #t "~T~Tlocal-down: ~`vector`P~%" (-> this local-down)) + (format #t "~T~Tdrawable-target: ~D~%" (-> this drawable-target)) + (format #t "~T~Twhich-bone: ~D~%" (-> this which-bone)) + (format #t "~T~Tpov-handle: ~D~%" (-> this pov-handle)) + (format #t "~T~Tpov-bone: ~D~%" (-> this pov-bone)) + (format #t "~T~Tbeing-attacked: ~A~%" (-> this being-attacked)) + (format #t "~T~Tattack-start: ~D~%" (-> this attack-start)) + (format #t "~T~Ton-ground: ~A~%" (-> this on-ground)) + (format #t "~T~Tunder-water: ~D~%" (-> this under-water)) + (format #t "~T~Ton-pole: ~A~%" (-> this on-pole)) + (format #t "~T~Ttgt-rot-mat: ~`matrix`P~%" (-> this tgt-rot-mat)) + (format #t "~T~Ttgt-face-mat: ~`matrix`P~%" (-> this tgt-face-mat)) + (format #t "~T~Ttpos-old: ~`vector`P~%" (-> this tpos-old)) + (format #t "~T~Ttpos-curr: ~`vector`P~%" (-> this tpos-curr)) + (format #t "~T~Ttarget-height: ~f~%" (-> this target-height)) + (format #t "~T~Ttpos-old-adj: ~`vector`P~%" (-> this tpos-old-adj)) + (format #t "~T~Ttpos-curr-adj: ~`vector`P~%" (-> this tpos-curr-adj)) + (format #t "~T~Ttpos-tgt: ~`vector`P~%" (-> this tpos-tgt)) + (format #t "~T~Tupspeed: ~f~%" (-> this upspeed)) + (format #t "~T~Tpitch-off: ~`vector`P~%" (-> this pitch-off)) + (format #t "~T~Tfoot-offset: ~f~%" (-> this foot-offset)) + (format #t "~T~Thead-offset: ~f~%" (-> this head-offset)) + (format #t "~T~Ttarget-spline: #~%" (-> this target-spline)) + (format #t "~T~Tease-from: #~%" (-> this ease-from)) + (format #t "~T~Tease-t: ~f~%" (-> this ease-t)) + (format #t "~T~Tease-step: ~f~%" (-> this ease-step)) + (format #t "~T~Tease-to: #~%" (-> this ease-to)) + (format #t "~T~Toutro-curve: #~%" (-> this outro-curve)) + (format #t "~T~Toutro-t: ~f~%" (-> this outro-t)) + (format #t "~T~Toutro-t-step: ~f~%" (-> this outro-t-step)) + (format #t "~T~Toutro-exit-value: ~f~%" (-> this outro-exit-value)) + (format #t "~T~Twater-drip-time: ~D~%" (-> this water-drip-time)) + (format #t "~T~Twater-drip: ~A~%" (-> this water-drip)) + (format #t "~T~Twater-drip-mult: ~f~%" (-> this water-drip-mult)) + (format #t "~T~Twater-drip-speed: ~f~%" (-> this water-drip-speed)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc index 145f758fd7..1a75187641 100644 --- a/test/decompiler/reference/jak1/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/camera_REF.gc @@ -357,10 +357,10 @@ ;; definition for method 9 of type cam-index ;; INFO: Used lq/sq -(defmethod cam-index-method-9 cam-index ((obj cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) +(defmethod cam-index-method-9 cam-index ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) (local-vars (sv-32 (function _varargs_ object))) (format (clear *cam-res-string*) "~S-flags" arg0) - (set! (-> obj flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *res-key-string*)))) + (set! (-> this flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *res-key-string*)))) (let ((s3-2 (res-lump-data arg1 arg0 pointer)) (s0-1 (method-of-type res-lump get-property-struct)) ) @@ -386,18 +386,18 @@ (s3-2 (cond (v0-8 - (vector+! (the-as vector (-> obj vec)) (the-as vector (&+ s3-2 0)) (the-as vector v0-8)) - (vector+! (-> obj vec 1) (the-as vector (&+ s3-2 16)) (the-as vector v0-8)) + (vector+! (the-as vector (-> this vec)) (the-as vector (&+ s3-2 0)) (the-as vector v0-8)) + (vector+! (-> this vec 1) (the-as vector (&+ s3-2 16)) (the-as vector v0-8)) ) (else - (set! (-> obj vec 0 quad) (-> (the-as (pointer uint128) (&+ s3-2 0)))) - (set! (-> obj vec 1 quad) (-> (the-as (pointer uint128) (&+ s3-2 16)))) + (set! (-> this vec 0 quad) (-> (the-as (pointer uint128) (&+ s3-2 0)))) + (set! (-> this vec 1 quad) (-> (the-as (pointer uint128) (&+ s3-2 16)))) ) ) ) (arg3 - (set! (-> obj vec 0 quad) (-> arg3 cverts 0 quad)) - (set! (-> obj vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) + (set! (-> this vec 0 quad) (-> arg3 cverts 0 quad)) + (set! (-> this vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) ) (else (return #f) @@ -408,25 +408,25 @@ (let ((s4-1 (new-stack-vector0))) 0.0 (cond - ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) - (vector-! s4-1 (-> obj vec 1) arg2) - (set! (-> obj vec 1 w) (vector-length s4-1)) - (vector-! s4-1 (the-as vector (-> obj vec)) arg2) - (set! (-> obj vec 1 x) (vector-length s4-1)) - (set! (-> obj vec 1 w) (- (-> obj vec 1 w) (-> obj vec 1 x))) - (set! (-> obj vec 0 quad) (-> arg2 quad)) + ((logtest? (-> this flags) (cam-index-options SPHERICAL)) + (vector-! s4-1 (-> this vec 1) arg2) + (set! (-> this vec 1 w) (vector-length s4-1)) + (vector-! s4-1 (the-as vector (-> this vec)) arg2) + (set! (-> this vec 1 x) (vector-length s4-1)) + (set! (-> this vec 1 w) (- (-> this vec 1 w) (-> this vec 1 x))) + (set! (-> this vec 0 quad) (-> arg2 quad)) ) - ((logtest? (-> obj flags) (cam-index-options RADIAL)) - (vector-! s4-1 (-> obj vec 1) arg2) - (set! (-> obj vec 1 w) (vector-length s4-1)) - (vector-! s4-1 (the-as vector (-> obj vec)) arg2) - (set! (-> obj vec 1 x) (vector-length s4-1)) - (set! (-> obj vec 1 w) (- (-> obj vec 1 w) (-> obj vec 1 x))) - (set! (-> obj vec 0 quad) (-> arg2 quad)) + ((logtest? (-> this flags) (cam-index-options RADIAL)) + (vector-! s4-1 (-> this vec 1) arg2) + (set! (-> this vec 1 w) (vector-length s4-1)) + (vector-! s4-1 (the-as vector (-> this vec)) arg2) + (set! (-> this vec 1 x) (vector-length s4-1)) + (set! (-> this vec 1 w) (- (-> this vec 1 w) (-> this vec 1 x))) + (set! (-> this vec 0 quad) (-> arg2 quad)) ) (else - (vector-! (-> obj vec 1) (-> obj vec 1) (the-as vector (-> obj vec))) - (set! (-> obj vec 1 w) (vector-normalize-ret-len! (-> obj vec 1) 1.0)) + (vector-! (-> this vec 1) (-> this vec 1) (the-as vector (-> this vec))) + (set! (-> this vec 1 w) (vector-normalize-ret-len! (-> this vec 1) 1.0)) ) ) ) @@ -435,20 +435,20 @@ ;; definition for method 10 of type cam-index ;; INFO: Used lq/sq -(defmethod cam-index-method-10 cam-index ((obj cam-index) (arg0 vector)) +(defmethod cam-index-method-10 cam-index ((this cam-index) (arg0 vector)) (let ((s5-0 (new-stack-vector0))) 0.0 - (vector-! s5-0 arg0 (the-as vector (-> obj vec))) + (vector-! s5-0 arg0 (the-as vector (-> this vec))) (cond - ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) + ((logtest? (-> this flags) (cam-index-options SPHERICAL)) (vector-flatten! s5-0 s5-0 (-> *camera* local-down)) - (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) + (/ (- (vector-length s5-0) (-> this vec 1 x)) (-> this vec 1 w)) ) - ((logtest? (-> obj flags) (cam-index-options RADIAL)) - (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) + ((logtest? (-> this flags) (cam-index-options RADIAL)) + (/ (- (vector-length s5-0) (-> this vec 1 x)) (-> this vec 1 w)) ) (else - (/ (vector-dot s5-0 (-> obj vec 1)) (-> obj vec 1 w)) + (/ (vector-dot s5-0 (-> this vec 1)) (-> this vec 1 w)) ) ) ) @@ -457,25 +457,25 @@ ;; definition for method 10 of type tracking-spline ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-10 tracking-spline ((obj tracking-spline) (arg0 vector)) - (set! (-> obj point 0 position quad) (-> arg0 quad)) - (set! (-> obj point 0 next) -134250495) - (set! (-> obj summed-len) 0.0) - (set! (-> obj free-point) 1) - (set! (-> obj used-point) 0) - (set! (-> obj partial-point) 0.0) - (set! (-> obj end-point) 0) - (set! (-> obj next-to-last-point) -134250495) - (set! (-> obj max-move) 0.0) - (set! (-> obj sample-len) 0.0) - (set! (-> obj used-count) 1) - (set! (-> obj old-position quad) (-> arg0 quad)) +(defmethod tracking-spline-method-10 tracking-spline ((this tracking-spline) (arg0 vector)) + (set! (-> this point 0 position quad) (-> arg0 quad)) + (set! (-> this point 0 next) -134250495) + (set! (-> this summed-len) 0.0) + (set! (-> this free-point) 1) + (set! (-> this used-point) 0) + (set! (-> this partial-point) 0.0) + (set! (-> this end-point) 0) + (set! (-> this next-to-last-point) -134250495) + (set! (-> this max-move) 0.0) + (set! (-> this sample-len) 0.0) + (set! (-> this used-count) 1) + (set! (-> this old-position quad) (-> arg0 quad)) (let ((v1-6 1)) (while (!= v1-6 31) - (set! (-> obj point v1-6 next) (+ v1-6 1)) + (set! (-> this point v1-6 next) (+ v1-6 1)) (+! v1-6 1) ) - (set! (-> obj point v1-6 next) -134250495) + (set! (-> this point v1-6 next) -134250495) ) 0 (none) @@ -483,32 +483,32 @@ ;; definition for method 13 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-13 tracking-spline ((obj tracking-spline) (arg0 int)) - (let ((v1-3 (-> obj point arg0 next))) +(defmethod tracking-spline-method-13 tracking-spline ((this tracking-spline) (arg0 int)) + (let ((v1-3 (-> this point arg0 next))) (cond ((= v1-3 -134250495) ) - ((= (-> obj point v1-3 next) -134250495) + ((= (-> this point v1-3 next) -134250495) ) (else - (set! (-> obj point arg0 next) (-> obj point v1-3 next)) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-3 tp-length))) - (set! (-> obj point v1-3 next) (-> obj free-point)) - (set! (-> obj free-point) v1-3) - (+! (-> obj point v1-3 incarnation) 1) - (let ((v1-11 (-> obj point arg0 next))) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point arg0 tp-length))) + (set! (-> this point arg0 next) (-> this point v1-3 next)) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-3 tp-length))) + (set! (-> this point v1-3 next) (-> this free-point)) + (set! (-> this free-point) v1-3) + (+! (-> this point v1-3 incarnation) 1) + (let ((v1-11 (-> this point arg0 next))) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point arg0 tp-length))) (vector-! - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 arg0))) - (the-as vector (-> obj point v1-11)) - (the-as vector (-> obj point arg0)) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 arg0))) + (the-as vector (-> this point v1-11)) + (the-as vector (-> this point arg0)) ) ) - (set! (-> obj point arg0 tp-length) - (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 arg0))) 1.0) + (set! (-> this point arg0 tp-length) + (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 arg0))) 1.0) ) - (+! (-> obj summed-len) (-> obj point arg0 tp-length)) - (+! (-> obj used-count) -1) + (+! (-> this summed-len) (-> this point arg0 tp-length)) + (+! (-> this used-count) -1) ) ) ) @@ -518,35 +518,37 @@ ;; definition for method 14 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-14 tracking-spline ((obj tracking-spline) (arg0 tracking-spline-sampler)) - (let ((v1-0 (-> obj used-point))) - (set! (-> obj partial-point) (-> arg0 partial-pt)) - (when (= (-> obj next-to-last-point) v1-0) - (set! (-> obj summed-len) (-> obj point v1-0 tp-length)) - (if (= (-> arg0 cur-pt) (-> obj end-point)) - (set! (-> obj partial-point) 0.99999) +(defmethod tracking-spline-method-14 tracking-spline ((this tracking-spline) (arg0 tracking-spline-sampler)) + (let ((v1-0 (-> this used-point))) + (set! (-> this partial-point) (-> arg0 partial-pt)) + (when (= (-> this next-to-last-point) v1-0) + (set! (-> this summed-len) (-> this point v1-0 tp-length)) + (if (= (-> arg0 cur-pt) (-> this end-point)) + (set! (-> this partial-point) 0.99999) ) ) (when (!= (-> arg0 cur-pt) v1-0) - (while (and (!= (-> obj point v1-0 next) (-> arg0 cur-pt)) (!= (-> obj point v1-0 next) (-> obj next-to-last-point))) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-0 tp-length))) - (+! (-> obj point v1-0 incarnation) 1) - (+! (-> obj used-count) -1) - (set! v1-0 (-> obj point v1-0 next)) + (while (and (!= (-> this point v1-0 next) (-> arg0 cur-pt)) + (!= (-> this point v1-0 next) (-> this next-to-last-point)) + ) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-0 tp-length))) + (+! (-> this point v1-0 incarnation) 1) + (+! (-> this used-count) -1) + (set! v1-0 (-> this point v1-0 next)) ) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-0 tp-length))) - (+! (-> obj point v1-0 incarnation) 1) - (+! (-> obj used-count) -1) - (set! (-> obj point v1-0 next) (-> obj free-point)) - (set! (-> obj free-point) (-> obj used-point)) - (set! (-> obj used-point) (-> arg0 cur-pt)) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-0 tp-length))) + (+! (-> this point v1-0 incarnation) 1) + (+! (-> this used-count) -1) + (set! (-> this point v1-0 next) (-> this free-point)) + (set! (-> this free-point) (-> this used-point)) + (set! (-> this used-point) (-> arg0 cur-pt)) (cond - ((= (-> arg0 cur-pt) (-> obj end-point)) - (set! (-> obj partial-point) 0.0) - (set! (-> obj summed-len) 0.0) + ((= (-> arg0 cur-pt) (-> this end-point)) + (set! (-> this partial-point) 0.0) + (set! (-> this summed-len) 0.0) ) - ((= (-> arg0 cur-pt) (-> obj next-to-last-point)) - (set! (-> obj summed-len) (-> obj point (-> obj next-to-last-point) tp-length)) + ((= (-> arg0 cur-pt) (-> this next-to-last-point)) + (set! (-> this summed-len) (-> this point (-> this next-to-last-point) tp-length)) ) ) ) @@ -557,30 +559,30 @@ ;; definition for method 15 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-15 tracking-spline ((obj tracking-spline)) +(defmethod tracking-spline-method-15 tracking-spline ((this tracking-spline)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'tracking-point))) - (set! (-> s5-0 cur-pt) (-> obj used-point)) - (set! (-> s5-0 partial-pt) (-> obj partial-point)) - (tracking-spline-method-19 obj (-> obj sample-len) (the-as vector a2-0) s5-0) + (set! (-> s5-0 cur-pt) (-> this used-point)) + (set! (-> s5-0 partial-pt) (-> this partial-point)) + (tracking-spline-method-19 this (-> this sample-len) (the-as vector a2-0) s5-0) ) - (if (or (= (-> s5-0 cur-pt) (-> obj end-point)) - (= (-> s5-0 cur-pt) (-> obj next-to-last-point)) - (= (-> obj point (-> s5-0 cur-pt) next) (-> obj next-to-last-point)) + (if (or (= (-> s5-0 cur-pt) (-> this end-point)) + (= (-> s5-0 cur-pt) (-> this next-to-last-point)) + (= (-> this point (-> s5-0 cur-pt) next) (-> this next-to-last-point)) ) - (set! (-> s5-0 cur-pt) (-> obj used-point)) + (set! (-> s5-0 cur-pt) (-> this used-point)) ) - (let ((v1-15 (-> obj point (-> s5-0 cur-pt) next))) + (let ((v1-15 (-> this point (-> s5-0 cur-pt) next))) (when (!= v1-15 -134250495) - (let ((a0-14 (-> obj point v1-15 next)) + (let ((a0-14 (-> this point v1-15 next)) (a1-1 v1-15) (f0-2 -2.0) ) 0.0 - (while (not (or (= a0-14 -134250495) (= a0-14 (-> obj end-point)))) + (while (not (or (= a0-14 -134250495) (= a0-14 (-> this end-point)))) (let ((f1-2 (vector-dot - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 v1-15))) - (the-as vector (+ (the-as uint (the-as vector (-> obj point 0 direction))) (* 48 a0-14))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-15))) + (the-as vector (+ (the-as uint (the-as vector (-> this point 0 direction))) (* 48 a0-14))) ) ) ) @@ -590,10 +592,10 @@ ) ) (set! v1-15 a0-14) - (set! a0-14 (-> obj point v1-15 next)) + (set! a0-14 (-> this point v1-15 next)) ) (if (< -2.0 f0-2) - (tracking-spline-method-13 obj a1-1) + (tracking-spline-method-13 this a1-1) ) ) ) @@ -605,35 +607,35 @@ ;; definition for method 16 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-16 tracking-spline ((obj tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-16 tracking-spline ((this tracking-spline) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 cur-pt) (-> obj used-point)) - (set! (-> s4-0 partial-pt) (-> obj partial-point)) - (tracking-spline-method-19 obj (-> obj sample-len) a2-0 s4-0) + (set! (-> s4-0 cur-pt) (-> this used-point)) + (set! (-> s4-0 partial-pt) (-> this partial-point)) + (tracking-spline-method-19 this (-> this sample-len) a2-0 s4-0) ) - (let ((s4-1 (-> obj point (-> s4-0 cur-pt) next))) + (let ((s4-1 (-> this point (-> s4-0 cur-pt) next))) (when (!= s4-1 -134250495) - (let ((v1-11 (-> obj point s4-1 next))) + (let ((v1-11 (-> this point s4-1 next))) (while (not (or (= v1-11 -134250495) - (= (-> obj point v1-11 next) -134250495) - (= (-> obj point v1-11 next) (-> obj end-point)) - (= (-> obj point v1-11 next) (-> obj next-to-last-point)) + (= (-> this point v1-11 next) -134250495) + (= (-> this point v1-11 next) (-> this end-point)) + (= (-> this point v1-11 next) (-> this next-to-last-point)) ) ) - (if (< (* (-> obj point s4-1 tp-length) + (if (< (* (-> this point s4-1 tp-length) (+ 1.0 (vector-dot - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s4-1))) - (the-as vector (+ (the-as uint (the-as vector (-> obj point 0 direction))) (* 48 v1-11))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s4-1))) + (the-as vector (+ (the-as uint (the-as vector (-> this point 0 direction))) (* 48 v1-11))) ) ) ) arg0 ) - (tracking-spline-method-13 obj s4-1) + (tracking-spline-method-13 this s4-1) (set! s4-1 v1-11) ) - (set! v1-11 (-> obj point s4-1 next)) + (set! v1-11 (-> this point s4-1 next)) ) ) ) @@ -645,40 +647,40 @@ ;; definition for method 17 of type tracking-spline ;; INFO: Used lq/sq -(defmethod tracking-spline-method-17 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) - (let ((s3-0 (-> obj free-point)) - (s2-0 (-> obj end-point)) +(defmethod tracking-spline-method-17 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) + (let ((s3-0 (-> this free-point)) + (s2-0 (-> this end-point)) ) (vector-! - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s2-0))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s2-0))) arg0 - (the-as vector (-> obj point s2-0)) + (the-as vector (-> this point s2-0)) ) - (set! (-> obj point s2-0 tp-length) - (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s2-0))) 1.0) + (set! (-> this point s2-0 tp-length) + (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s2-0))) 1.0) ) - (if (< (-> obj point s2-0 tp-length) arg1) + (if (< (-> this point s2-0 tp-length) arg1) (return 0) ) (when (and arg3 (= s3-0 -134250495)) - (tracking-spline-method-15 obj) - (set! s3-0 (-> obj free-point)) + (tracking-spline-method-15 this) + (set! s3-0 (-> this free-point)) ) (cond ((= s3-0 -134250495) (format 0 "ERROR : pos spline overflow~%") ) (else - (+! (-> obj summed-len) (-> obj point s2-0 tp-length)) - (set! (-> obj free-point) (-> obj point s3-0 next)) - (set! (-> obj point s2-0 next) s3-0) - (set! (-> obj end-point) s3-0) - (set! (-> obj next-to-last-point) s2-0) - (set! (-> obj point s3-0 next) -134250495) - (set! (-> obj point s3-0 position quad) (-> arg0 quad)) - (+! (-> obj used-count) 1) + (+! (-> this summed-len) (-> this point s2-0 tp-length)) + (set! (-> this free-point) (-> this point s3-0 next)) + (set! (-> this point s2-0 next) s3-0) + (set! (-> this end-point) s3-0) + (set! (-> this next-to-last-point) s2-0) + (set! (-> this point s3-0 next) -134250495) + (set! (-> this point s3-0 position quad) (-> arg0 quad)) + (+! (-> this used-count) 1) (if (< 0.0 arg2) - (tracking-spline-method-16 obj arg2) + (tracking-spline-method-16 this arg2) ) ) ) @@ -687,29 +689,29 @@ ) ;; definition for method 18 of type tracking-spline -(defmethod tracking-spline-method-18 tracking-spline ((obj tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-18 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (local-vars (f0-4 float)) (when (not arg2) (set! arg2 (new 'stack-no-clear 'tracking-spline-sampler)) - (set! (-> arg2 cur-pt) (-> obj used-point)) - (set! (-> arg2 partial-pt) (-> obj partial-point)) + (set! (-> arg2 cur-pt) (-> this used-point)) + (set! (-> arg2 partial-pt) (-> this partial-point)) ) 0.0 (loop (cond - ((= (-> arg2 cur-pt) (-> obj end-point)) + ((= (-> arg2 cur-pt) (-> this end-point)) (set! (-> arg2 partial-pt) 0.0) - (vector+! arg1 arg1 (the-as vector (-> obj point (-> arg2 cur-pt)))) + (vector+! arg1 arg1 (the-as vector (-> this point (-> arg2 cur-pt)))) (return arg1) ) - ((begin (set! f0-4 (+ (-> arg2 partial-pt) (/ arg0 (-> obj point (-> arg2 cur-pt) tp-length)))) (< f0-4 1.0)) + ((begin (set! f0-4 (+ (-> arg2 partial-pt) (/ arg0 (-> this point (-> arg2 cur-pt) tp-length)))) (< f0-4 1.0)) (set! (-> arg2 partial-pt) f0-4) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) - (let ((a2-5 (-> obj point (-> arg2 cur-pt) next))) + (let ((a2-5 (-> this point (-> arg2 cur-pt) next))) (vector-lerp! (the-as vector s5-0) - (the-as vector (-> obj point (-> arg2 cur-pt))) - (the-as vector (-> obj point a2-5)) + (the-as vector (-> this point (-> arg2 cur-pt))) + (the-as vector (-> this point a2-5)) f0-4 ) ) @@ -718,11 +720,11 @@ (return arg1) ) (else - (let ((f0-7 (* (- 1.0 (-> arg2 partial-pt)) (-> obj point (-> arg2 cur-pt) tp-length)))) + (let ((f0-7 (* (- 1.0 (-> arg2 partial-pt)) (-> this point (-> arg2 cur-pt) tp-length)))) (set! arg0 (- arg0 f0-7)) ) (set! (-> arg2 partial-pt) 0.0) - (set! (-> arg2 cur-pt) (-> obj point (-> arg2 cur-pt) next)) + (set! (-> arg2 cur-pt) (-> this point (-> arg2 cur-pt) next)) ) ) ) @@ -730,20 +732,20 @@ ) ;; definition for method 19 of type tracking-spline -(defmethod tracking-spline-method-19 tracking-spline ((obj tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-19 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (vector-reset! arg1) - (tracking-spline-method-18 obj arg0 arg1 arg2) + (tracking-spline-method-18 this arg0 arg1 arg2) arg1 ) ;; definition for method 20 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-20 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 int)) +(defmethod tracking-spline-method-20 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! s3-0 - (the-as vector (-> obj point (-> obj used-point))) - (the-as vector (-> obj point (-> obj end-point))) + (the-as vector (-> this point (-> this used-point))) + (the-as vector (-> this point (-> this end-point))) ) (let* ((f0-0 (vector-length s3-0)) (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0)))) @@ -752,9 +754,9 @@ (let* ((f1-2 (fmax 0.0 f1-1)) (f30-0 (+ 0.3 f1-2)) (f0-1 (cond - ((< (-> *CAMERA-bank* min-detectable-velocity) (-> obj summed-len)) + ((< (-> *CAMERA-bank* min-detectable-velocity) (-> this summed-len)) (vector-float*! s3-0 s3-0 (/ 1.0 f0-0)) - (/ f0-0 (-> obj summed-len)) + (/ f0-0 (-> this summed-len)) ) (else (vector-reset! s3-0) @@ -765,15 +767,15 @@ (f0-2 (+ -0.2 f0-1)) (f1-9 (* 2.0 f0-2)) (f28-0 (fmin 1.0 (fmax 0.05 f1-9))) - (v1-8 (-> obj used-point)) + (v1-8 (-> this used-point)) (s2-0 (new 'stack-no-clear 'vector)) ) - (while (and (!= v1-8 (-> obj end-point)) (!= v1-8 (-> obj next-to-last-point)) (!= v1-8 arg1)) - (let ((s1-0 (-> obj point v1-8 next))) + (while (and (!= v1-8 (-> this end-point)) (!= v1-8 (-> this next-to-last-point)) (!= v1-8 arg1)) + (let ((s1-0 (-> this point v1-8 next))) (vector-! s2-0 - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s1-0))) - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 v1-8))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s1-0))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-8))) ) (let* ((f0-4 (vector-normalize-ret-len! s2-0 1.0)) (f0-5 (* 0.5 f0-4)) @@ -792,7 +794,7 @@ ((< f26-0 0.0) (if (and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (the-as vector (-> obj point s1-0)) + (the-as vector (-> this point s1-0)) s2-0 (* -40.96 f26-0) (the-as vector4w (new 'static 'inline-array qword 1 @@ -805,7 +807,7 @@ ) ((and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (the-as vector (-> obj point s1-0)) + (the-as vector (-> this point s1-0)) s2-0 (* 40.96 f26-0) (the-as vector4w (new 'static 'inline-array qword 1 @@ -828,65 +830,65 @@ ;; definition for method 21 of type tracking-spline ;; INFO: Used lq/sq -(defmethod tracking-spline-method-21 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 float) (arg2 float)) - (let ((v1-0 (-> obj used-point)) - (f0-0 (-> obj partial-point)) +(defmethod tracking-spline-method-21 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float)) + (let ((v1-0 (-> this used-point)) + (f0-0 (-> this partial-point)) ) - (let ((f1-0 (-> obj summed-len))) + (let ((f1-0 (-> this summed-len))) 0.0 0.0 - (let* ((f1-1 (- f1-0 (* f0-0 (-> obj point v1-0 tp-length)))) + (let* ((f1-1 (- f1-0 (* f0-0 (-> this point v1-0 tp-length)))) (f2-5 (* 0.1 f1-1)) - (f2-8 (* (fmin arg1 (- f2-5 (-> obj max-move))) (-> *display* time-adjust-ratio))) + (f2-8 (* (fmin arg1 (- f2-5 (-> this max-move))) (-> *display* time-adjust-ratio))) ) - (set! (-> obj max-move) (fmin arg2 (+ (-> obj max-move) f2-8))) + (set! (-> this max-move) (fmin arg2 (+ (-> this max-move) f2-8))) ) ) - (set! (-> obj max-move) (fmax 0.4096 (-> obj max-move))) - (let ((f1-8 (-> obj summed-len))) + (set! (-> this max-move) (fmax 0.4096 (-> this max-move))) + (let ((f1-8 (-> this summed-len))) 0.0 - (let* ((f2-14 (- f1-8 (* f0-0 (-> obj point v1-0 tp-length)))) - (f2-16 (fmin 204.8 (- f2-14 (-> obj sample-len)))) + (let* ((f2-14 (- f1-8 (* f0-0 (-> this point v1-0 tp-length)))) + (f2-16 (fmin 204.8 (- f2-14 (-> this sample-len)))) ) - (set! (-> obj sample-len) (fmin 16384.0 (+ (-> obj sample-len) f2-16))) + (set! (-> this sample-len) (fmin 16384.0 (+ (-> this sample-len) f2-16))) ) ) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (set! (-> s4-0 cur-pt) v1-0) (set! (-> s4-0 partial-pt) f0-0) - (tracking-spline-method-19 obj (* (-> obj max-move) (-> *display* time-adjust-ratio)) arg0 s4-0) - (tracking-spline-method-14 obj s4-0) + (tracking-spline-method-19 this (* (-> this max-move) (-> *display* time-adjust-ratio)) arg0 s4-0) + (tracking-spline-method-14 this s4-0) (dotimes (s3-0 63) - (tracking-spline-method-18 obj (* 0.015625 (-> obj sample-len)) arg0 s4-0) + (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 s4-0) ) (vector-float*! arg0 arg0 0.015625) (let ((a2-3 (-> s4-0 cur-pt))) - (set! (-> obj debug-last-point) a2-3) + (set! (-> this debug-last-point) a2-3) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> obj debug-old-position quad) (-> obj old-position quad)) - (set! (-> obj debug-out-position quad) (-> arg0 quad)) - (vector-! s4-1 arg0 (-> obj old-position)) - (tracking-spline-method-20 obj s4-1 a2-3) - (vector+! arg0 (-> obj old-position) s4-1) + (set! (-> this debug-old-position quad) (-> this old-position quad)) + (set! (-> this debug-out-position quad) (-> arg0 quad)) + (vector-! s4-1 arg0 (-> this old-position)) + (tracking-spline-method-20 this s4-1 a2-3) + (vector+! arg0 (-> this old-position) s4-1) ) ) ) ) - (set! (-> obj old-position quad) (-> arg0 quad)) + (set! (-> this old-position quad) (-> arg0 quad)) arg0 ) ;; definition for method 22 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-22 tracking-spline ((obj tracking-spline) (arg0 float)) - (when (< arg0 (-> obj summed-len)) +(defmethod tracking-spline-method-22 tracking-spline ((this tracking-spline) (arg0 float)) + (when (< arg0 (-> this summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 cur-pt) (-> obj used-point)) + (set! (-> s5-0 cur-pt) (-> this used-point)) (set! (-> s5-0 partial-pt) 0.0) - (tracking-spline-method-19 obj (- (-> obj summed-len) arg0) a2-0 s5-0) + (tracking-spline-method-19 this (- (-> this summed-len) arg0) a2-0 s5-0) ) - (tracking-spline-method-14 obj s5-0) + (tracking-spline-method-14 this s5-0) ) ) 0 @@ -895,38 +897,38 @@ ;; definition for method 9 of type tracking-spline ;; INFO: Return type mismatch int vs none. -(defmethod tracking-spline-method-9 tracking-spline ((obj tracking-spline)) - (let ((v1-0 (-> obj used-point)) +(defmethod tracking-spline-method-9 tracking-spline ((this tracking-spline)) + (let ((v1-0 (-> this used-point)) (s4-0 0) (s5-0 0) ) (while (!= v1-0 -134250495) (set! s5-0 (logior s5-0 (ash 1 v1-0))) (+! s4-0 1) - (set! v1-0 (-> obj point v1-0 next)) + (set! v1-0 (-> this point v1-0 next)) ) - (when (!= s4-0 (-> obj used-count)) + (when (!= s4-0 (-> this used-count)) (if *debug-segment* - (format 0 "ERROR: tracking spline used count ~D actual ~D~%" (-> obj used-count) s4-0) + (format 0 "ERROR: tracking spline used count ~D actual ~D~%" (-> this used-count) s4-0) ) - (set! (-> obj used-count) s4-0) + (set! (-> this used-count) s4-0) ) - (let ((v1-9 (-> obj free-point)) + (let ((v1-9 (-> this free-point)) (a3-1 0) ) (while (!= v1-9 -134250495) (+! a3-1 1) - (set! v1-9 (-> obj point v1-9 next)) + (set! v1-9 (-> this point v1-9 next)) ) - (when (!= a3-1 (- 32 (-> obj used-count))) + (when (!= a3-1 (- 32 (-> this used-count))) (if *debug-segment* - (format 0 "ERROR: tracking spline free count ~D actual ~D~%" (- 32 (-> obj used-count)) a3-1) + (format 0 "ERROR: tracking spline free count ~D actual ~D~%" (- 32 (-> this used-count)) a3-1) ) - (set! (-> obj free-point) -134250495) + (set! (-> this free-point) -134250495) (dotimes (v1-21 32) (when (not (logtest? s5-0 1)) - (set! (-> obj point v1-21 next) (-> obj free-point)) - (set! (-> obj free-point) v1-21) + (set! (-> this point v1-21 next) (-> this free-point)) + (set! (-> this free-point) v1-21) ) (set! s5-0 (shr s5-0 1)) ) @@ -1334,7 +1336,7 @@ ) ) (if arg2 - (vector-seek-3d-smooth! (-> arg0 follow-off) s3-2 (* 20480.0 (-> *display* seconds-per-frame)) 0.05) + (vector-seek-3d-smooth! (-> arg0 follow-off) s3-2 (* 20480.0 (seconds-per-frame)) 0.05) (set! (-> arg0 follow-off quad) (-> s3-2 quad)) ) ) diff --git a/test/decompiler/reference/jak1/engine/camera/pov-camera-h_REF.gc b/test/decompiler/reference/jak1/engine/camera/pov-camera-h_REF.gc index 2650d5558c..f21e249290 100644 --- a/test/decompiler/reference/jak1/engine/camera/pov-camera-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/pov-camera-h_REF.gc @@ -32,19 +32,19 @@ ) ;; definition for method 3 of type pov-camera -(defmethod inspect pov-camera ((obj pov-camera)) +(defmethod inspect pov-camera ((this pov-camera)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tflags: ~D~%" (-> obj flags)) - (format #t "~T~Tdebounce-start-time: ~D~%" (-> obj debounce-start-time)) - (format #t "~T~Tnotify-handle: ~D~%" (-> obj notify-handle)) - (format #t "~T~Tanim-name: ~A~%" (-> obj anim-name)) - (format #t "~T~Tcommand-list: ~A~%" (-> obj command-list)) - (format #t "~T~Tmask-to-clear: ~D~%" (-> obj mask-to-clear)) - (format #t "~T~Tmusic-volume-movie: ~f~%" (-> obj music-volume-movie)) - (format #t "~T~Tsfx-volume-movie: ~f~%" (-> obj sfx-volume-movie)) - obj + (format #t "~T~Tflags: ~D~%" (-> this flags)) + (format #t "~T~Tdebounce-start-time: ~D~%" (-> this debounce-start-time)) + (format #t "~T~Tnotify-handle: ~D~%" (-> this notify-handle)) + (format #t "~T~Tanim-name: ~A~%" (-> this anim-name)) + (format #t "~T~Tcommand-list: ~A~%" (-> this command-list)) + (format #t "~T~Tmask-to-clear: ~D~%" (-> this mask-to-clear)) + (format #t "~T~Tmusic-volume-movie: ~f~%" (-> this music-volume-movie)) + (format #t "~T~Tsfx-volume-movie: ~f~%" (-> this sfx-volume-movie)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc b/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc index 9855f478ee..5f2ce1bfd2 100644 --- a/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/camera/pov-camera_REF.gc @@ -2,23 +2,21 @@ (in-package goal) ;; definition for method 25 of type pov-camera -(defmethod check-for-abort pov-camera ((obj pov-camera)) - (when (or (and (>= (- (-> *display* base-frame-counter) (-> obj debounce-start-time)) (seconds 0.2)) - (cpad-pressed? 0 triangle) - ) - (logtest? (-> obj flags) (pov-camera-flag allow-abort)) +(defmethod check-for-abort pov-camera ((this pov-camera)) + (when (or (and (time-elapsed? (-> this debounce-start-time) (seconds 0.2)) (cpad-pressed? 0 triangle)) + (logtest? (-> this flags) (pov-camera-flag allow-abort)) ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (when (logtest? (-> obj flags) (pov-camera-flag notify-of-abort)) - (send-event (handle->process (-> obj notify-handle)) 'notify 'abort-request) + (when (logtest? (-> this flags) (pov-camera-flag notify-of-abort)) + (send-event (handle->process (-> this notify-handle)) 'notify 'abort-request) #t ) ) ) ;; definition for method 26 of type pov-camera -(defmethod target-grabbed? pov-camera ((obj pov-camera)) +(defmethod target-grabbed? pov-camera ((this pov-camera)) (or (not *target*) (process-grab? *target*)) ) @@ -93,7 +91,7 @@ ) ) :enter (behavior () - (set! (-> self debounce-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self debounce-start-time)) (if (= (-> self anim-name type) string) (backup-load-state-and-set-cmds *load-state* (-> self command-list)) ) @@ -167,14 +165,14 @@ ;; definition for method 27 of type pov-camera ;; INFO: Return type mismatch int vs none. -(defmethod pre-startup-callback pov-camera ((obj pov-camera)) +(defmethod pre-startup-callback pov-camera ((this pov-camera)) 0 (none) ) ;; definition for method 29 of type pov-camera ;; INFO: Return type mismatch symbol vs none. -(defmethod set-stack-size! pov-camera ((obj pov-camera)) +(defmethod set-stack-size! pov-camera ((this pov-camera)) (none) ) @@ -192,7 +190,7 @@ (set! (-> self notify-handle) (process->handle arg4)) (set! (-> self notify-handle) (the-as handle #f)) ) - (set! (-> self debounce-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self debounce-start-time)) (logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile)) (set! (-> self root) (new 'process 'trsqv)) (set! (-> self root trans quad) (-> arg0 quad)) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-cache-h_REF.gc index f51222278e..fd733d9b28 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-cache-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-cache-h_REF.gc @@ -16,15 +16,15 @@ ) ;; definition for method 3 of type collide-using-spheres-params -(defmethod inspect collide-using-spheres-params ((obj collide-using-spheres-params)) - (format #t "[~8x] ~A~%" obj 'collide-using-spheres-params) - (format #t "~Tspheres: #x~X~%" (-> obj spheres)) - (format #t "~Tnum-spheres: ~D~%" (-> obj num-spheres)) - (format #t "~Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~Tproc: ~A~%" (-> obj proc)) - (format #t "~Tignore-pat: ~D~%" (-> obj ignore-pat)) - (format #t "~Tsolid-only: ~A~%" (-> obj solid-only)) - obj +(defmethod inspect collide-using-spheres-params ((this collide-using-spheres-params)) + (format #t "[~8x] ~A~%" this 'collide-using-spheres-params) + (format #t "~Tspheres: #x~X~%" (-> this spheres)) + (format #t "~Tnum-spheres: ~D~%" (-> this num-spheres)) + (format #t "~Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~Tproc: ~A~%" (-> this proc)) + (format #t "~Tignore-pat: ~D~%" (-> this ignore-pat)) + (format #t "~Tsolid-only: ~A~%" (-> this solid-only)) + this ) ;; definition of type collide-puss-sphere @@ -38,11 +38,11 @@ ) ;; definition for method 3 of type collide-puss-sphere -(defmethod inspect collide-puss-sphere ((obj collide-puss-sphere)) - (format #t "[~8x] ~A~%" obj 'collide-puss-sphere) - (format #t "~Tbsphere: #~%" (-> obj bsphere)) - (format #t "~Tbbox4w: #~%" (-> obj bbox4w)) - obj +(defmethod inspect collide-puss-sphere ((this collide-puss-sphere)) + (format #t "[~8x] ~A~%" this 'collide-puss-sphere) + (format #t "~Tbsphere: #~%" (-> this bsphere)) + (format #t "~Tbbox4w: #~%" (-> this bbox4w)) + this ) ;; definition of type collide-puss-work @@ -63,14 +63,14 @@ ) ;; definition for method 3 of type collide-puss-work -(defmethod inspect collide-puss-work ((obj collide-puss-work)) - (format #t "[~8x] ~A~%" obj 'collide-puss-work) - (format #t "~Tclosest-pt: #~%" (-> obj closest-pt)) - (format #t "~Ttri-normal: #~%" (-> obj tri-normal)) - (format #t "~Ttri-bbox4w: #~%" (-> obj tri-bbox4w)) - (format #t "~Tspheres-bbox4w: #~%" (-> obj spheres-bbox4w)) - (format #t "~Tspheres[64] @ #x~X~%" (-> obj spheres)) - obj +(defmethod inspect collide-puss-work ((this collide-puss-work)) + (format #t "[~8x] ~A~%" this 'collide-puss-work) + (format #t "~Tclosest-pt: #~%" (-> this closest-pt)) + (format #t "~Ttri-normal: #~%" (-> this tri-normal)) + (format #t "~Ttri-bbox4w: #~%" (-> this tri-bbox4w)) + (format #t "~Tspheres-bbox4w: #~%" (-> this spheres-bbox4w)) + (format #t "~Tspheres[64] @ #x~X~%" (-> this spheres)) + this ) ;; definition of type collide-puyp-work @@ -87,14 +87,14 @@ ) ;; definition for method 3 of type collide-puyp-work -(defmethod inspect collide-puyp-work ((obj collide-puyp-work)) - (format #t "[~8x] ~A~%" obj 'collide-puyp-work) - (format #t "~Tbest-u: ~f~%" (-> obj best-u)) - (format #t "~Tignore-pat: ~D~%" (-> obj ignore-pat)) - (format #t "~Ttri-out: #~%" (-> obj tri-out)) - (format #t "~Tstart-pos: #~%" (-> obj start-pos)) - (format #t "~Tmove-dist: #~%" (-> obj move-dist)) - obj +(defmethod inspect collide-puyp-work ((this collide-puyp-work)) + (format #t "[~8x] ~A~%" this 'collide-puyp-work) + (format #t "~Tbest-u: ~f~%" (-> this best-u)) + (format #t "~Tignore-pat: ~D~%" (-> this ignore-pat)) + (format #t "~Ttri-out: #~%" (-> this tri-out)) + (format #t "~Tstart-pos: #~%" (-> this start-pos)) + (format #t "~Tmove-dist: #~%" (-> this move-dist)) + this ) ;; definition of type collide-cache-tri @@ -112,15 +112,15 @@ ) ;; definition for method 3 of type collide-cache-tri -(defmethod inspect collide-cache-tri ((obj collide-cache-tri)) - (format #t "[~8x] ~A~%" obj 'collide-cache-tri) - (format #t "~Tvertex[3] @ #x~X~%" (-> obj vertex)) - (format #t "~Textra-quad[16] @ #x~X~%" (&-> obj extra-quad)) - (format #t "~Tpat: ~D~%" (-> obj pat)) - (format #t "~Tprim-index: ~D~%" (-> obj prim-index)) - (format #t "~Tuser16: ~D~%" (-> obj user16)) - (format #t "~Tuser32[2] @ #x~X~%" (-> obj user32)) - obj +(defmethod inspect collide-cache-tri ((this collide-cache-tri)) + (format #t "[~8x] ~A~%" this 'collide-cache-tri) + (format #t "~Tvertex[3] @ #x~X~%" (-> this vertex)) + (format #t "~Textra-quad[16] @ #x~X~%" (&-> this extra-quad)) + (format #t "~Tpat: ~D~%" (-> this pat)) + (format #t "~Tprim-index: ~D~%" (-> this prim-index)) + (format #t "~Tuser16: ~D~%" (-> this user16)) + (format #t "~Tuser32[2] @ #x~X~%" (-> this user32)) + this ) ;; definition of type collide-cache-prim @@ -148,21 +148,21 @@ ) ;; definition for method 3 of type collide-cache-prim -(defmethod inspect collide-cache-prim ((obj collide-cache-prim)) - (format #t "[~8x] ~A~%" obj 'collide-cache-prim) - (format #t "~Tprim-core: #~%" (-> obj prim-core)) - (format #t "~Textra-quad[16] @ #x~X~%" (&-> obj extra-quad)) - (format #t "~Tccache: ~A~%" (-> obj ccache)) - (format #t "~Tprim: ~A~%" (-> obj prim)) - (format #t "~Tfirst-tri: ~D~%" (-> obj first-tri)) - (format #t "~Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~Tunused[4] @ #x~X~%" (-> obj unused)) - (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) - (format #t "~Tcollide-as: ~D~%" (-> obj prim-core collide-as)) - (format #t "~Taction: ~D~%" (-> obj prim-core action)) - (format #t "~Toffense: ~D~%" (-> obj prim-core offense)) - (format #t "~Tprim-type: ~D~%" (-> obj prim-core prim-type)) - obj +(defmethod inspect collide-cache-prim ((this collide-cache-prim)) + (format #t "[~8x] ~A~%" this 'collide-cache-prim) + (format #t "~Tprim-core: #~%" (-> this prim-core)) + (format #t "~Textra-quad[16] @ #x~X~%" (&-> this extra-quad)) + (format #t "~Tccache: ~A~%" (-> this ccache)) + (format #t "~Tprim: ~A~%" (-> this prim)) + (format #t "~Tfirst-tri: ~D~%" (-> this first-tri)) + (format #t "~Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~Tunused[4] @ #x~X~%" (-> this unused)) + (format #t "~Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~Tcollide-as: ~D~%" (-> this prim-core collide-as)) + (format #t "~Taction: ~D~%" (-> this prim-core action)) + (format #t "~Toffense: ~D~%" (-> this prim-core offense)) + (format #t "~Tprim-type: ~D~%" (-> this prim-core prim-type)) + this ) ;; definition of type collide-cache @@ -210,18 +210,18 @@ ) ;; definition for method 3 of type collide-cache -(defmethod inspect collide-cache ((obj collide-cache)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~Tnum-prims: ~D~%" (-> obj num-prims)) - (format #t "~Tignore-mask: ~D~%" (-> obj ignore-mask)) - (format #t "~Tproc: ~A~%" (-> obj proc)) - (format #t "~Tcollide-box: #~%" (-> obj collide-box)) - (format #t "~Tcollide-box4w: #~%" (-> obj collide-box4w)) - (format #t "~Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~Tprims[100] @ #x~X~%" (-> obj prims)) - (format #t "~Ttris[461] @ #x~X~%" (-> obj tris)) - obj +(defmethod inspect collide-cache ((this collide-cache)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~Tnum-prims: ~D~%" (-> this num-prims)) + (format #t "~Tignore-mask: ~D~%" (-> this ignore-mask)) + (format #t "~Tproc: ~A~%" (-> this proc)) + (format #t "~Tcollide-box: #~%" (-> this collide-box)) + (format #t "~Tcollide-box4w: #~%" (-> this collide-box4w)) + (format #t "~Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~Tprims[100] @ #x~X~%" (-> this prims)) + (format #t "~Ttris[461] @ #x~X~%" (-> this tris)) + this ) ;; definition of type collide-list-item @@ -235,11 +235,11 @@ ) ;; definition for method 3 of type collide-list-item -(defmethod inspect collide-list-item ((obj collide-list-item)) - (format #t "[~8x] ~A~%" obj 'collide-list-item) - (format #t "~Tmesh: ~A~%" (-> obj mesh)) - (format #t "~Tinst: ~A~%" (-> obj inst)) - obj +(defmethod inspect collide-list-item ((this collide-list-item)) + (format #t "[~8x] ~A~%" this 'collide-list-item) + (format #t "~Tmesh: ~A~%" (-> this mesh)) + (format #t "~Tinst: ~A~%" (-> this inst)) + this ) ;; definition of type collide-list @@ -253,11 +253,11 @@ ) ;; definition for method 3 of type collide-list -(defmethod inspect collide-list ((obj collide-list)) - (format #t "[~8x] ~A~%" obj 'collide-list) - (format #t "~Tnum-items: ~D~%" (-> obj num-items)) - (format #t "~Titems[256] @ #x~X~%" (-> obj items)) - obj +(defmethod inspect collide-list ((this collide-list)) + (format #t "[~8x] ~A~%" this 'collide-list) + (format #t "~Tnum-items: ~D~%" (-> this num-items)) + (format #t "~Titems[256] @ #x~X~%" (-> this items)) + this ) ;; definition of type collide-work @@ -272,12 +272,12 @@ ) ;; definition for method 3 of type collide-work -(defmethod inspect collide-work ((obj collide-work)) - (format #t "[~8x] ~A~%" obj 'collide-work) - (format #t "~Tcollide-sphere-neg-r: #~%" (-> obj collide-sphere-neg-r)) - (format #t "~Tcollide-box4w: #~%" (-> obj collide-box4w)) - (format #t "~Tinv-mat: #~%" (-> obj inv-mat)) - obj +(defmethod inspect collide-work ((this collide-work)) + (format #t "[~8x] ~A~%" this 'collide-work) + (format #t "~Tcollide-sphere-neg-r: #~%" (-> this collide-sphere-neg-r)) + (format #t "~Tcollide-box4w: #~%" (-> this collide-box4w)) + (format #t "~Tinv-mat: #~%" (-> this inv-mat)) + this ) ;; definition (perm) for symbol *collide-work*, type collide-work diff --git a/test/decompiler/reference/jak1/engine/collide/collide-edge-grab-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-edge-grab-h_REF.gc index 7960cc704a..ce42f52d35 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-edge-grab-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-edge-grab-h_REF.gc @@ -26,21 +26,21 @@ ) ;; definition for method 3 of type edge-grab-info -(defmethod inspect edge-grab-info ((obj edge-grab-info)) - (format #t "[~8x] ~A~%" obj 'edge-grab-info) - (format #t "~Tworld-vertex[6] @ #x~X~%" (-> obj world-vertex)) - (format #t "~Tlocal-vertex[6] @ #x~X~%" (-> obj local-vertex)) - (format #t "~Tactor-cshape-prim-offset: ~D~%" (-> obj actor-cshape-prim-offset)) - (format #t "~Tactor-handle: ~D~%" (-> obj actor-handle)) - (format #t "~Thanging-matrix: #~%" (-> obj hanging-matrix)) - (format #t "~Tedge-vertex[2] @ #x~X~%" (-> obj world-vertex)) - (format #t "~Tcenter-hold: ~`vector`P~%" (-> obj center-hold)) - (format #t "~Ttri-vertex[3] @ #x~X~%" (-> obj tri-vertex)) - (format #t "~Tleft-hand-hold: #~%" (-> obj left-hand-hold)) - (format #t "~Tright-hand-hold: #~%" (-> obj right-hand-hold)) - (format #t "~Tcenter-hold-old: ~`vector`P~%" (-> obj center-hold-old)) - (format #t "~Tedge-tri-pat: ~D~%" (-> obj edge-tri-pat)) - obj +(defmethod inspect edge-grab-info ((this edge-grab-info)) + (format #t "[~8x] ~A~%" this 'edge-grab-info) + (format #t "~Tworld-vertex[6] @ #x~X~%" (-> this world-vertex)) + (format #t "~Tlocal-vertex[6] @ #x~X~%" (-> this local-vertex)) + (format #t "~Tactor-cshape-prim-offset: ~D~%" (-> this actor-cshape-prim-offset)) + (format #t "~Tactor-handle: ~D~%" (-> this actor-handle)) + (format #t "~Thanging-matrix: #~%" (-> this hanging-matrix)) + (format #t "~Tedge-vertex[2] @ #x~X~%" (-> this world-vertex)) + (format #t "~Tcenter-hold: ~`vector`P~%" (-> this center-hold)) + (format #t "~Ttri-vertex[3] @ #x~X~%" (-> this tri-vertex)) + (format #t "~Tleft-hand-hold: #~%" (-> this left-hand-hold)) + (format #t "~Tright-hand-hold: #~%" (-> this right-hand-hold)) + (format #t "~Tcenter-hold-old: ~`vector`P~%" (-> this center-hold-old)) + (format #t "~Tedge-tri-pat: ~D~%" (-> this edge-tri-pat)) + this ) ;; definition of type collide-edge-tri @@ -54,11 +54,11 @@ ) ;; definition for method 3 of type collide-edge-tri -(defmethod inspect collide-edge-tri ((obj collide-edge-tri)) - (format #t "[~8x] ~A~%" obj 'collide-edge-tri) - (format #t "~Tctri: #~%" (-> obj ctri)) - (format #t "~Tnormal: #~%" (-> obj normal)) - obj +(defmethod inspect collide-edge-tri ((this collide-edge-tri)) + (format #t "[~8x] ~A~%" this 'collide-edge-tri) + (format #t "~Tctri: #~%" (-> this ctri)) + (format #t "~Tnormal: #~%" (-> this normal)) + this ) ;; definition of type collide-edge-edge @@ -75,14 +75,14 @@ ) ;; definition for method 3 of type collide-edge-edge -(defmethod inspect collide-edge-edge ((obj collide-edge-edge)) - (format #t "[~8x] ~A~%" obj 'collide-edge-edge) - (format #t "~Tignore: ~A~%" (-> obj ignore)) - (format #t "~Tetri: #~%" (-> obj etri)) - (format #t "~Tvertex-ptr[2] @ #x~X~%" (-> obj vertex-ptr)) - (format #t "~Toutward: #~%" (-> obj outward)) - (format #t "~Tedge-vec-norm: #~%" (-> obj edge-vec-norm)) - obj +(defmethod inspect collide-edge-edge ((this collide-edge-edge)) + (format #t "[~8x] ~A~%" this 'collide-edge-edge) + (format #t "~Tignore: ~A~%" (-> this ignore)) + (format #t "~Tetri: #~%" (-> this etri)) + (format #t "~Tvertex-ptr[2] @ #x~X~%" (-> this vertex-ptr)) + (format #t "~Toutward: #~%" (-> this outward)) + (format #t "~Tedge-vec-norm: #~%" (-> this edge-vec-norm)) + this ) ;; definition of type collide-edge-hold-item @@ -100,15 +100,15 @@ ) ;; definition for method 3 of type collide-edge-hold-item -(defmethod inspect collide-edge-hold-item ((obj collide-edge-hold-item)) - (format #t "[~8x] ~A~%" obj 'collide-edge-hold-item) - (format #t "~Tnext: #~%" (-> obj next)) - (format #t "~Trating: ~f~%" (-> obj rating)) - (format #t "~Tsplit: ~D~%" (-> obj split)) - (format #t "~Tedge: #~%" (-> obj edge)) - (format #t "~Tcenter-pt: #~%" (-> obj center-pt)) - (format #t "~Toutward-pt: #~%" (-> obj outward-pt)) - obj +(defmethod inspect collide-edge-hold-item ((this collide-edge-hold-item)) + (format #t "[~8x] ~A~%" this 'collide-edge-hold-item) + (format #t "~Tnext: #~%" (-> this next)) + (format #t "~Trating: ~f~%" (-> this rating)) + (format #t "~Tsplit: ~D~%" (-> this split)) + (format #t "~Tedge: #~%" (-> this edge)) + (format #t "~Tcenter-pt: #~%" (-> this center-pt)) + (format #t "~Toutward-pt: #~%" (-> this outward-pt)) + this ) ;; definition of type collide-edge-hold-list @@ -129,14 +129,14 @@ ) ;; definition for method 3 of type collide-edge-hold-list -(defmethod inspect collide-edge-hold-list ((obj collide-edge-hold-list)) - (format #t "[~8x] ~A~%" obj 'collide-edge-hold-list) - (format #t "~Tnum-allocs: ~D~%" (-> obj num-allocs)) - (format #t "~Tnum-attempts: ~D~%" (-> obj num-attempts)) - (format #t "~Thead: #~%" (-> obj head)) - (format #t "~Titems[32] @ #x~X~%" (-> obj items)) - (format #t "~Tattempts[32] @ #x~X~%" (-> obj attempts)) - obj +(defmethod inspect collide-edge-hold-list ((this collide-edge-hold-list)) + (format #t "[~8x] ~A~%" this 'collide-edge-hold-list) + (format #t "~Tnum-allocs: ~D~%" (-> this num-allocs)) + (format #t "~Tnum-attempts: ~D~%" (-> this num-attempts)) + (format #t "~Thead: #~%" (-> this head)) + (format #t "~Titems[32] @ #x~X~%" (-> this items)) + (format #t "~Tattempts[32] @ #x~X~%" (-> this attempts)) + this ) ;; definition of type collide-edge-work @@ -187,35 +187,35 @@ ) ;; definition for method 3 of type collide-edge-work -(defmethod inspect collide-edge-work ((obj collide-edge-work)) - (format #t "[~8x] ~A~%" obj 'collide-edge-work) - (format #t "~Tccache: ~A~%" (-> obj ccache)) - (format #t "~Tcshape: ~A~%" (-> obj cshape)) - (format #t "~Tnum-verts: ~D~%" (-> obj num-verts)) - (format #t "~Tnum-edges: ~D~%" (-> obj num-edges)) - (format #t "~Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~Tcache-fill-box: #~%" (-> obj cache-fill-box)) - (format #t "~Twithin-reach-box: #~%" (-> obj within-reach-box)) - (format #t "~Twithin-reach-box4w: #~%" (-> obj within-reach-box4w)) - (format #t "~Tsearch-pt: #~%" (-> obj search-pt)) - (format #t "~Tsearch-dir-vec: #~%" (-> obj search-dir-vec)) - (format #t "~Tmax-dist-sqrd-to-outward-pt: ~f~%" (-> obj max-dist-sqrd-to-outward-pt)) - (format #t "~Tmax-dir-cosa-delta: ~f~%" (-> obj max-dir-cosa-delta)) - (format #t "~Tsplit-dists[2] @ #x~X~%" (-> obj split-dists)) - (format #t "~Toutward-offset: #~%" (-> obj outward-offset)) - (format #t "~Tlocal-cache-fill-box: #~%" (-> obj local-cache-fill-box)) - (format #t "~Tlocal-within-reach-box: #~%" (-> obj local-within-reach-box)) - (format #t "~Tlocal-player-spheres[12] @ #x~X~%" (-> obj local-player-spheres)) - (format #t "~Tworld-player-spheres[12] @ #x~X~%" (-> obj world-player-spheres)) - (format #t "~Tlocal-player-hanging-spheres[6] @ #x~X~%" (-> obj local-player-spheres)) - (format #t "~Tworld-player-hanging-spheres[6] @ #x~X~%" (-> obj world-player-spheres)) - (format #t "~Tlocal-player-leap-up-spheres[6] @ #x~X~%" (-> obj local-player-leap-up-spheres)) - (format #t "~Tworld-player-leap-up-spheres[6] @ #x~X~%" (-> obj world-player-leap-up-spheres)) - (format #t "~Tverts[64] @ #x~X~%" (-> obj verts)) - (format #t "~Tedges[96] @ #x~X~%" (-> obj edges)) - (format #t "~Ttris[48] @ #x~X~%" (-> obj tris)) - (format #t "~Thold-list: #~%" (-> obj hold-list)) - obj +(defmethod inspect collide-edge-work ((this collide-edge-work)) + (format #t "[~8x] ~A~%" this 'collide-edge-work) + (format #t "~Tccache: ~A~%" (-> this ccache)) + (format #t "~Tcshape: ~A~%" (-> this cshape)) + (format #t "~Tnum-verts: ~D~%" (-> this num-verts)) + (format #t "~Tnum-edges: ~D~%" (-> this num-edges)) + (format #t "~Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~Tcache-fill-box: #~%" (-> this cache-fill-box)) + (format #t "~Twithin-reach-box: #~%" (-> this within-reach-box)) + (format #t "~Twithin-reach-box4w: #~%" (-> this within-reach-box4w)) + (format #t "~Tsearch-pt: #~%" (-> this search-pt)) + (format #t "~Tsearch-dir-vec: #~%" (-> this search-dir-vec)) + (format #t "~Tmax-dist-sqrd-to-outward-pt: ~f~%" (-> this max-dist-sqrd-to-outward-pt)) + (format #t "~Tmax-dir-cosa-delta: ~f~%" (-> this max-dir-cosa-delta)) + (format #t "~Tsplit-dists[2] @ #x~X~%" (-> this split-dists)) + (format #t "~Toutward-offset: #~%" (-> this outward-offset)) + (format #t "~Tlocal-cache-fill-box: #~%" (-> this local-cache-fill-box)) + (format #t "~Tlocal-within-reach-box: #~%" (-> this local-within-reach-box)) + (format #t "~Tlocal-player-spheres[12] @ #x~X~%" (-> this local-player-spheres)) + (format #t "~Tworld-player-spheres[12] @ #x~X~%" (-> this world-player-spheres)) + (format #t "~Tlocal-player-hanging-spheres[6] @ #x~X~%" (-> this local-player-spheres)) + (format #t "~Tworld-player-hanging-spheres[6] @ #x~X~%" (-> this world-player-spheres)) + (format #t "~Tlocal-player-leap-up-spheres[6] @ #x~X~%" (-> this local-player-leap-up-spheres)) + (format #t "~Tworld-player-leap-up-spheres[6] @ #x~X~%" (-> this world-player-leap-up-spheres)) + (format #t "~Tverts[64] @ #x~X~%" (-> this verts)) + (format #t "~Tedges[96] @ #x~X~%" (-> this edges)) + (format #t "~Ttris[48] @ #x~X~%" (-> this tris)) + (format #t "~Thold-list: #~%" (-> this hold-list)) + this ) ;; definition for symbol *collide-edge-work*, type collide-edge-work diff --git a/test/decompiler/reference/jak1/engine/collide/collide-edge-grab_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-edge-grab_REF.gc index 3f4ab400fc..43e5cce67c 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-edge-grab_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-edge-grab_REF.gc @@ -4,7 +4,7 @@ ;; definition for method 20 of type target ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs object. -(defmethod find-edge-grabs! target ((obj target) (arg0 collide-cache)) +(defmethod find-edge-grabs! target ((this target) (arg0 collide-cache)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -17,7 +17,7 @@ (set! (-> gp-0 num-verts) (the-as uint 0)) (set! (-> gp-0 num-edges) (the-as uint 0)) (set! (-> gp-0 num-tris) (the-as uint 0)) - (let ((v1-0 (-> obj control))) + (let ((v1-0 (-> this control))) (set! (-> gp-0 ccache) arg0) (.lvf vf1 (&-> gp-0 local-cache-fill-box min quad)) (.lvf vf2 (&-> gp-0 local-cache-fill-box max quad)) @@ -41,8 +41,8 @@ (fill-using-bounding-box arg0 (-> gp-0 cache-fill-box) - (-> obj control root-prim collide-with) - obj + (-> this control root-prim collide-with) + this (new 'static 'pat-surface :noentity #x1) ) (find-grabbable-tris! gp-0) @@ -72,17 +72,17 @@ ) ;; definition for method 9 of type collide-edge-work -(defmethod search-for-edges collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-list)) +(defmethod search-for-edges collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-list)) (set! (-> arg0 num-allocs) (the-as uint 0)) (set! (-> arg0 num-attempts) (the-as uint 0)) (set! (-> arg0 head) #f) (let ((s4-0 (the-as collide-edge-hold-item (-> arg0 items))) - (s3-0 (the-as collide-edge-edge (-> obj edges))) + (s3-0 (the-as collide-edge-edge (-> this edges))) ) - (countdown (s2-0 (-> obj num-edges)) + (countdown (s2-0 (-> this num-edges)) (when (not (-> s3-0 ignore)) - (compute-center-point! obj s3-0 (-> s4-0 center-pt)) - (when (should-add-to-list? obj s4-0 s3-0) + (compute-center-point! this s3-0 (-> s4-0 center-pt)) + (when (should-add-to-list? this s4-0 s3-0) (add-to-list! arg0 s4-0) (+! (-> arg0 num-allocs) 1) (when (= (-> arg0 num-allocs) 32) @@ -115,13 +115,13 @@ ) ;; definition for method 3 of type pbhp-stack-vars -(defmethod inspect pbhp-stack-vars ((obj pbhp-stack-vars)) - (format #t "[~8x] ~A~%" obj 'pbhp-stack-vars) - (format #t "~Tedge: #~%" (-> obj edge)) - (format #t "~Tallocated: ~A~%" (-> obj allocated)) - (format #t "~Tneg-hold-pt: #~%" (-> obj neg-hold-pt)) - (format #t "~Tsplit-vec: #~%" (-> obj split-vec)) - obj +(defmethod inspect pbhp-stack-vars ((this pbhp-stack-vars)) + (format #t "[~8x] ~A~%" this 'pbhp-stack-vars) + (format #t "~Tedge: #~%" (-> this edge)) + (format #t "~Tallocated: ~A~%" (-> this allocated)) + (format #t "~Tneg-hold-pt: #~%" (-> this neg-hold-pt)) + (format #t "~Tsplit-vec: #~%" (-> this split-vec)) + this ) ;; definition for method 18 of type collide-edge-work @@ -130,7 +130,7 @@ ;; definition for method 19 of type collide-edge-work ;; INFO: Used lq/sq -(defmethod check-grab-for-collisions collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod check-grab-for-collisions collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (local-vars (sv-144 (function vector vector vector float vector)) (sv-160 vector) (sv-176 vector)) (let* ((s3-0 (-> arg0 edge)) (s1-0 (-> s3-0 etri ctri)) @@ -138,7 +138,7 @@ ) (let ((s0-0 (new 'stack-no-clear 'vector))) (vector+*! s0-0 (-> arg0 center-pt) (-> s3-0 edge-vec-norm) 1105.92) - (let ((f0-0 (collide-edge-work-method-14 obj (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) + (let ((f0-0 (collide-edge-work-method-14 this (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) (if (< 491.52 f0-0) (return #f) ) @@ -151,7 +151,7 @@ ) (sv-144 sv-160 sv-176 a2-3 a3-2) ) - (let ((f0-1 (collide-edge-work-method-14 obj (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) + (let ((f0-1 (collide-edge-work-method-14 this (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) (if (< 491.52 f0-1) (return #f) ) @@ -183,19 +183,19 @@ (-> arg1 hanging-matrix vector 1) ) (set! (-> arg1 hanging-matrix vector 3 quad) (-> arg1 center-hold quad)) - (transform-vectors! (-> arg1 hanging-matrix) (-> obj world-player-spheres) (-> obj local-player-spheres) 12) + (transform-vectors! (-> arg1 hanging-matrix) (-> this world-player-spheres) (-> this local-player-spheres) 12) (let ((a1-13 (new 'stack-no-clear 'collide-using-spheres-params))) - (set! (-> a1-13 spheres) (-> obj world-player-spheres)) + (set! (-> a1-13 spheres) (-> this world-player-spheres)) (set! (-> a1-13 num-spheres) (the-as uint 12)) - (set! (-> a1-13 collide-with) (-> obj cshape root-prim collide-with)) + (set! (-> a1-13 collide-with) (-> this cshape root-prim collide-with)) (set! (-> a1-13 proc) #f) (set! (-> a1-13 ignore-pat) (new 'static 'pat-surface :noentity #x1)) (set! (-> a1-13 solid-only) #t) - (if (probe-using-spheres (-> obj ccache) a1-13) + (if (probe-using-spheres (-> this ccache) a1-13) (return #f) ) ) - (let* ((v1-36 (the-as object (-> obj ccache prims s4-0 prim))) + (let* ((v1-36 (the-as object (-> this ccache prims s4-0 prim))) (a0-35 (-> (the-as collide-shape-prim v1-36) cshape)) ) (cond @@ -225,7 +225,7 @@ ;; definition for method 9 of type edge-grab-info ;; INFO: Used lq/sq -(defmethod edge-grab-info-method-9 edge-grab-info ((obj edge-grab-info)) +(defmethod edge-grab-info-method-9 edge-grab-info ((this edge-grab-info)) (local-vars (v0-0 symbol) (v1-14 float)) (rlet ((acc :class vf) (Q :class vf) @@ -240,10 +240,10 @@ ) (init-vf0-vector) (let ((s5-0 (the-as object #f))) - (set! (-> obj center-hold-old quad) (-> obj center-hold quad)) - (let ((v1-1 (-> obj actor-cshape-prim-offset))) + (set! (-> this center-hold-old quad) (-> this center-hold quad)) + (let ((v1-1 (-> this actor-cshape-prim-offset))) (when (nonzero? v1-1) - (let ((a0-5 (handle->process (-> obj actor-handle)))) + (let ((a0-5 (handle->process (-> this actor-handle)))) (if (not (the-as process a0-5)) (return #f) ) @@ -262,13 +262,13 @@ ) ) (dotimes (s3-0 6) - (vector-matrix*! (-> obj world-vertex s3-0) (-> obj local-vertex s3-0) s4-0) + (vector-matrix*! (-> this world-vertex s3-0) (-> this local-vertex s3-0) s4-0) ) ) ) - (.lvf vf1 (&-> obj world-vertex 3 quad)) - (.lvf vf2 (&-> obj world-vertex 4 quad)) - (.lvf vf3 (&-> obj world-vertex 5 quad)) + (.lvf vf1 (&-> this world-vertex 3 quad)) + (.lvf vf2 (&-> this world-vertex 4 quad)) + (.lvf vf3 (&-> this world-vertex 5 quad)) (.sub.vf vf4 vf2 vf1) (.sub.vf vf5 vf3 vf1) (.outer.product.a.vf acc vf4 vf5) @@ -288,28 +288,28 @@ (set! v0-0 #f) (b! #t cfg-27 :delay (nop!)) (label cfg-17) - (set! (-> obj hanging-matrix vector 1 quad) (-> *target* control dynam gravity-normal quad)) + (set! (-> this hanging-matrix vector 1 quad) (-> *target* control dynam gravity-normal quad)) (vector-normalize! - (vector-! (-> obj hanging-matrix vector 2) (-> obj world-vertex 1) (the-as vector (-> obj world-vertex))) + (vector-! (-> this hanging-matrix vector 2) (-> this world-vertex 1) (the-as vector (-> this world-vertex))) 1.0 ) (vector-normalize! (vector-cross! - (the-as vector (-> obj hanging-matrix)) - (-> obj hanging-matrix vector 2) - (-> obj hanging-matrix vector 1) + (the-as vector (-> this hanging-matrix)) + (-> this hanging-matrix vector 2) + (-> this hanging-matrix vector 1) ) 1.0 ) (vector-cross! - (-> obj hanging-matrix vector 2) - (the-as vector (-> obj hanging-matrix)) - (-> obj hanging-matrix vector 1) + (-> this hanging-matrix vector 2) + (the-as vector (-> this hanging-matrix)) + (-> this hanging-matrix vector 1) ) - (set! (-> obj hanging-matrix vector 3 quad) (-> obj center-hold quad)) + (set! (-> this hanging-matrix vector 3 quad) (-> this center-hold quad)) (let ((v1-21 *collide-edge-work*)) (transform-vectors! - (-> obj hanging-matrix) + (-> this hanging-matrix) (-> v1-21 world-player-spheres) (-> v1-21 local-player-spheres) 12 @@ -346,7 +346,7 @@ (label cfg-24) (b! (not (the-as int s5-0)) cfg-26 :delay (empty-form)) (let ((v1-40 (-> (the-as collide-shape-prim s5-0) cshape))) - (send-event (-> v1-40 process) 'edge-grabbed obj) + (send-event (-> v1-40 process) 'edge-grabbed this) ) ) (label cfg-26) @@ -366,11 +366,11 @@ ;; definition for method 14 of type collide-edge-work ;; INFO: Used lq/sq -(defmethod collide-edge-work-method-14 collide-edge-work ((obj collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod collide-edge-work-method-14 collide-edge-work ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) (let ((f30-0 -1.0)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (dotimes (s1-0 (the-as int (-> obj num-edges))) - (let ((v1-3 (-> obj edges s1-0))) + (dotimes (s1-0 (the-as int (-> this num-edges))) + (let ((v1-3 (-> this edges s1-0))) (when (not (-> v1-3 ignore)) (when (= (-> v1-3 etri ctri prim-index) arg2) (let ((f0-0 (vector-segment-distance-point! arg1 (-> v1-3 vertex-ptr 0 0) (-> v1-3 vertex-ptr 1 0) s2-0))) @@ -390,7 +390,7 @@ ;; definition for method 17 of type collide-edge-work ;; INFO: Used lq/sq -(defmethod should-add-to-list? collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 collide-edge-edge)) +(defmethod should-add-to-list? collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 collide-edge-edge)) (local-vars (v1-1 uint128) (v1-2 uint128) @@ -420,27 +420,27 @@ (nop!) (.lvf vf1 (&-> arg0 center-pt quad)) (nop!) - (let ((a3-0 (-> obj within-reach-box4w min quad))) + (let ((a3-0 (-> this within-reach-box4w min quad))) (nop!) - (let ((t1-0 (-> obj within-reach-box4w max quad))) + (let ((t1-0 (-> this within-reach-box4w max quad))) (.ftoi.vf vf2 vf1) - (let ((v1-0 (-> obj cshape))) + (let ((v1-0 (-> this cshape))) (.mov t0-0 vf2) (.lvf vf3 (&-> arg1 outward quad)) (.pcgtw t1-1 t0-0 t1-0) - (.lvf vf4 (&-> obj outward-offset quad)) + (.lvf vf4 (&-> this outward-offset quad)) (.pcgtw a3-1 a3-0 t0-0) (.lvf vf5 (&-> v1-0 trans quad)) ) ) ) (.por v1-1 t1-1 a3-1) - (let ((f0-0 (-> obj max-dist-sqrd-to-outward-pt))) + (let ((f0-0 (-> this max-dist-sqrd-to-outward-pt))) (.ppach v1-2 (the-as uint128 0) v1-1) - (let ((f1-0 (-> obj max-dir-cosa-delta))) - (b! (nonzero? (shl (the-as int v1-2) 16)) cfg-4 :delay (.lvf vf6 (&-> obj search-dir-vec quad))) + (let ((f1-0 (-> this max-dir-cosa-delta))) + (b! (nonzero? (shl (the-as int v1-2) 16)) cfg-4 :delay (.lvf vf6 (&-> this search-dir-vec quad))) (.mul.x.vf vf10 vf3 vf4) - (.lvf vf11 (&-> obj search-pt quad)) + (.lvf vf11 (&-> this search-pt quad)) (.add.vf vf10 vf10 vf1) (.sub.vf vf7 vf5 vf10) (.mul.vf vf7 vf7 vf7) @@ -483,7 +483,7 @@ ) ;; definition for method 13 of type collide-edge-work -(defmethod compute-center-point! collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) +(defmethod compute-center-point! collide-edge-work ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) (local-vars (v0-0 float) (v1-1 float) (v1-2 float) (v1-3 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -501,7 +501,7 @@ ) (init-vf0-vector) (.mov.vf vf7 vf0) - (.lvf vf1 (&-> obj search-pt quad)) + (.lvf vf1 (&-> this search-pt quad)) (let ((f0-0 0.0)) (let ((v1-0 (-> arg0 vertex-ptr 0)) (a0-1 (-> arg0 vertex-ptr 1)) @@ -552,12 +552,12 @@ ;; definition for method 10 of type edge-grab-info ;; INFO: Return type mismatch object vs symbol. -(defmethod debug-draw edge-grab-info ((obj edge-grab-info)) +(defmethod debug-draw edge-grab-info ((this edge-grab-info)) (add-debug-line #t (bucket-id debug-no-zbuf) - (the-as vector (-> obj world-vertex)) - (-> obj world-vertex 1) + (the-as vector (-> this world-vertex)) + (-> this world-vertex 1) (new 'static 'rgba :r #xff :a #x60) #f (the-as rgba -1) @@ -565,36 +565,36 @@ (add-debug-sphere #t (bucket-id debug-no-zbuf) - (-> obj center-hold) + (-> this center-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere #t (bucket-id debug-no-zbuf) - (-> obj left-hand-hold) + (-> this left-hand-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x60) ) (add-debug-sphere #t (bucket-id debug-no-zbuf) - (-> obj right-hand-hold) + (-> this right-hand-hold) 204.8 (new 'static 'rgba :r #xff :g #xff :a #x60) ) (add-debug-outline-triangle #t (bucket-id debug-no-zbuf) - (the-as vector (-> obj tri-vertex)) - (-> obj world-vertex 4) - (-> obj world-vertex 5) + (the-as vector (-> this tri-vertex)) + (-> this world-vertex 4) + (-> this world-vertex 5) (new 'static 'rgba :r #xff :a #x30) ) (the-as symbol (cond - ((nonzero? (-> obj actor-cshape-prim-offset)) - (if (handle->process (-> obj actor-handle)) - (format *stdcon* "grab: ~A~%" (-> obj actor-handle process 0 name)) + ((nonzero? (-> this actor-cshape-prim-offset)) + (if (handle->process (-> this actor-handle)) + (format *stdcon* "grab: ~A~%" (-> this actor-handle process 0 name)) (format *stdcon* "grab: invalid handle~%") ) ) @@ -606,10 +606,10 @@ ) ;; definition for method 10 of type collide-edge-work -(defmethod debug-draw-edges collide-edge-work ((obj collide-edge-work)) +(defmethod debug-draw-edges collide-edge-work ((this collide-edge-work)) (let ((gp-0 0)) - (dotimes (s4-0 (the-as int (-> obj num-edges))) - (let* ((s3-0 (-> obj edges s4-0)) + (dotimes (s4-0 (the-as int (-> this num-edges))) + (let* ((s3-0 (-> this edges s4-0)) (a2-0 (-> s3-0 vertex-ptr 0 0)) (a3-0 (-> s3-0 vertex-ptr 1 0)) (s2-0 (new 'stack-no-clear 'vector)) @@ -651,14 +651,14 @@ ) ) ) - (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> obj num-edges) (the-as uint gp-0)) gp-0) + (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> this num-edges) (the-as uint gp-0)) gp-0) ) ) ;; definition for method 12 of type collide-edge-work -(defmethod debug-draw-sphere collide-edge-work ((obj collide-edge-work)) - (dotimes (s5-0 (the-as int (-> obj num-verts))) - (let ((a2-0 (-> obj verts s5-0))) +(defmethod debug-draw-sphere collide-edge-work ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-verts))) + (let ((a2-0 (-> this verts s5-0))) (add-debug-sphere #t (bucket-id debug-no-zbuf) a2-0 819.2 (new 'static 'rgba :r #xff :g #xff :a #x80)) ) ) @@ -667,8 +667,8 @@ ;; definition for method 9 of type collide-edge-hold-list ;; INFO: Used lq/sq -(defmethod debug-draw collide-edge-hold-list ((obj collide-edge-hold-list)) - (let ((s4-0 (-> obj head)) +(defmethod debug-draw collide-edge-hold-list ((this collide-edge-hold-list)) + (let ((s4-0 (-> this head)) (s5-0 0) ) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -707,23 +707,23 @@ ) (format *stdcon* "hold list has ~D item(s)~%" s5-0) ) - (dotimes (s5-1 (the-as int (-> obj num-attempts))) + (dotimes (s5-1 (the-as int (-> this num-attempts))) (add-debug-sphere #t (bucket-id debug-no-zbuf) - (the-as vector (-> obj attempts s5-1)) + (the-as vector (-> this attempts s5-1)) 409.6 (new 'static 'rgba :a #x40) ) ) - (format *stdcon* "hold list has ~D attempt(s)~%" (-> obj num-attempts)) + (format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts)) ) ;; definition for method 11 of type collide-edge-work ;; INFO: Return type mismatch symbol vs none. -(defmethod debug-draw-tris collide-edge-work ((obj collide-edge-work)) - (dotimes (s5-0 (the-as int (-> obj num-tris))) - (let* ((v1-3 (-> obj tris s5-0 ctri)) +(defmethod debug-draw-tris collide-edge-work ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-tris))) + (let* ((v1-3 (-> this tris s5-0 ctri)) (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) ) (add-debug-outline-triangle diff --git a/test/decompiler/reference/jak1/engine/collide/collide-frag-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-frag-h_REF.gc index 7948d32e3a..4f32f940dd 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-frag-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-frag-h_REF.gc @@ -11,15 +11,15 @@ ;; definition for method 3 of type collide-frag-vertex ;; INFO: Used lq/sq -(defmethod inspect collide-frag-vertex ((obj collide-frag-vertex)) - (format #t "[~8x] ~A~%" obj 'collide-frag-vertex) - (format #t "~Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tw: ~f~%" (-> obj w)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect collide-frag-vertex ((this collide-frag-vertex)) + (format #t "[~8x] ~A~%" this 'collide-frag-vertex) + (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tw: ~f~%" (-> this w)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; definition of type collide-frag-mesh @@ -40,18 +40,18 @@ ) ;; definition for method 3 of type collide-frag-mesh -(defmethod inspect collide-frag-mesh ((obj collide-frag-mesh)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tpacked-data: #x~X~%" (-> obj packed-data)) - (format #t "~Tpat-array: #x~X~%" (-> obj pat-array)) - (format #t "~Tstrip-data-len: ~D~%" (-> obj strip-data-len)) - (format #t "~Tpoly-count: ~D~%" (-> obj poly-count)) - (format #t "~Tbase-trans: #~%" (-> obj base-trans)) - (format #t "~Tvertex-count: ~D~%" (-> obj vertex-count)) - (format #t "~Tvertex-data-qwc: ~D~%" (-> obj vertex-data-qwc)) - (format #t "~Ttotal-qwc: ~D~%" (-> obj total-qwc)) - (format #t "~Tunused: ~D~%" (-> obj unused)) - obj +(defmethod inspect collide-frag-mesh ((this collide-frag-mesh)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tpacked-data: #x~X~%" (-> this packed-data)) + (format #t "~Tpat-array: #x~X~%" (-> this pat-array)) + (format #t "~Tstrip-data-len: ~D~%" (-> this strip-data-len)) + (format #t "~Tpoly-count: ~D~%" (-> this poly-count)) + (format #t "~Tbase-trans: #~%" (-> this base-trans)) + (format #t "~Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~Tvertex-data-qwc: ~D~%" (-> this vertex-data-qwc)) + (format #t "~Ttotal-qwc: ~D~%" (-> this total-qwc)) + (format #t "~Tunused: ~D~%" (-> this unused)) + this ) ;; definition of type collide-fragment @@ -64,12 +64,12 @@ ) ;; definition for method 3 of type collide-fragment -(defmethod inspect collide-fragment ((obj collide-fragment)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tmesh: ~A~%" (-> obj mesh)) - obj +(defmethod inspect collide-fragment ((this collide-fragment)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tmesh: ~A~%" (-> this mesh)) + this ) ;; definition of type drawable-inline-array-collide-fragment @@ -83,13 +83,13 @@ ) ;; definition for method 3 of type drawable-inline-array-collide-fragment -(defmethod inspect drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[1] @ #x~X~%" (-> this data)) + this ) ;; definition of type drawable-tree-collide-fragment diff --git a/test/decompiler/reference/jak1/engine/collide/collide-frag_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-frag_REF.gc index 5243d9f783..bc7d252f3e 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-frag_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-frag_REF.gc @@ -2,16 +2,16 @@ (in-package goal) ;; definition for method 9 of type drawable-tree-collide-fragment -(defmethod login drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment)) - obj +(defmethod login drawable-tree-collide-fragment ((this drawable-tree-collide-fragment)) + this ) ;; definition for method 10 of type drawable-tree-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) +(defmethod draw drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) (when *display-render-collision* - (dotimes (s4-0 (-> obj length)) - (draw (-> obj data s4-0) (-> obj data s4-0) arg1) + (dotimes (s4-0 (-> this length)) + (draw (-> this data s4-0) (-> this data s4-0) arg1) ) ) 0 @@ -19,47 +19,47 @@ ) ;; definition for method 16 of type drawable-tree-collide-fragment -(defmethod unpack-vis drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) ;; definition for method 11 of type drawable-tree-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-with-box (-> obj data-override) (-> obj length) arg1) +(defmethod collide-with-box drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-with-box (-> this data-override) (-> this length) arg1) 0 (none) ) ;; definition for method 12 of type drawable-tree-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-y-probe (-> obj data-override) (-> obj length) arg1) +(defmethod collide-y-probe drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-y-probe (-> this data-override) (-> this length) arg1) 0 (none) ) ;; definition for method 13 of type drawable-tree-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-ray (-> obj data-override) (-> obj length) arg1) +(defmethod collide-ray drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-ray (-> this data-override) (-> this length) arg1) 0 (none) ) ;; definition for method 8 of type collide-fragment ;; INFO: Return type mismatch int vs collide-fragment. -(defmethod mem-usage collide-fragment ((obj collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-fragment ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) (let ((s5-0 (if (logtest? arg1 1) 53 50 ) ) - (s4-0 (-> obj mesh)) + (s4-0 (-> this mesh)) ) (set! (-> arg0 data s5-0 name) (symbol->string 'collide-fragment)) (+! (-> arg0 data s5-0 count) 1) - (let ((v1-11 (+ (asize-of obj) (asize-of s4-0)))) + (let ((v1-11 (+ (asize-of this) (asize-of s4-0)))) (+! (-> arg0 data s5-0 used) v1-11) (+! (-> arg0 data s5-0 total) (logand -16 (+ v1-11 15))) ) @@ -82,25 +82,25 @@ ) ;; definition for method 9 of type drawable-inline-array-collide-fragment -(defmethod login drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment)) - obj +(defmethod login drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) + this ) ;; definition for method 10 of type collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod draw collide-fragment ((obj collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) +(defmethod draw collide-fragment ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) 0 (none) ) ;; definition for method 10 of type drawable-inline-array-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) +(defmethod draw drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 drawable-inline-array-collide-fragment) (arg1 display-frame) ) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj data s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this data s4-0))) (if (sphere-cull (-> s3-0 bsphere)) (draw s3-0 s3-0 arg1) ) @@ -112,30 +112,30 @@ ;; definition for method 11 of type drawable-inline-array-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-with-box (the-as collide-fragment (-> obj data)) (-> obj length) arg1) +(defmethod collide-with-box drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-with-box (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 (none) ) ;; definition for method 12 of type drawable-inline-array-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-y-probe (the-as collide-fragment (-> obj data)) (-> obj length) arg1) +(defmethod collide-y-probe drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-y-probe (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 (none) ) ;; definition for method 13 of type drawable-inline-array-collide-fragment ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) - (collide-ray (the-as collide-fragment (-> obj data)) (-> obj length) arg1) +(defmethod collide-ray drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 int) (arg1 collide-list)) + (collide-ray (the-as collide-fragment (-> this data)) (-> this length) arg1) 0 (none) ) ;; definition for method 8 of type drawable-inline-array-collide-fragment -(defmethod mem-usage drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -143,8 +143,8 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-mesh-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-mesh-h_REF.gc index 89b017002a..bbe7561f00 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-mesh-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-mesh-h_REF.gc @@ -14,13 +14,13 @@ ) ;; definition for method 3 of type collide-tri-result -(defmethod inspect collide-tri-result ((obj collide-tri-result)) - (format #t "[~8x] ~A~%" obj 'collide-tri-result) - (format #t "~Tvertex[3] @ #x~X~%" (-> obj vertex)) - (format #t "~Tintersect: ~`vector`P~%" (-> obj intersect)) - (format #t "~Tnormal: ~`vector`P~%" (-> obj normal)) - (format #t "~Tpat: ~D~%" (-> obj pat)) - obj +(defmethod inspect collide-tri-result ((this collide-tri-result)) + (format #t "[~8x] ~A~%" this 'collide-tri-result) + (format #t "~Tvertex[3] @ #x~X~%" (-> this vertex)) + (format #t "~Tintersect: ~`vector`P~%" (-> this intersect)) + (format #t "~Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~Tpat: ~D~%" (-> this pat)) + this ) ;; definition of type collide-mesh-tri @@ -36,12 +36,12 @@ ) ;; definition for method 3 of type collide-mesh-tri -(defmethod inspect collide-mesh-tri ((obj collide-mesh-tri)) - (format #t "[~8x] ~A~%" obj 'collide-mesh-tri) - (format #t "~Tvertex-index[3] @ #x~X~%" (-> obj vertex-index)) - (format #t "~Tunused: ~D~%" (-> obj unused)) - (format #t "~Tpat: ~D~%" (-> obj pat)) - obj +(defmethod inspect collide-mesh-tri ((this collide-mesh-tri)) + (format #t "[~8x] ~A~%" this 'collide-mesh-tri) + (format #t "~Tvertex-index[3] @ #x~X~%" (-> this vertex-index)) + (format #t "~Tunused: ~D~%" (-> this unused)) + (format #t "~Tpat: ~D~%" (-> this pat)) + this ) ;; definition of type collide-mesh @@ -67,14 +67,14 @@ ) ;; definition for method 3 of type collide-mesh -(defmethod inspect collide-mesh ((obj collide-mesh)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tjoint-id: ~D~%" (-> obj joint-id)) - (format #t "~Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~Tnum-verts: ~D~%" (-> obj num-verts)) - (format #t "~Tvertex-data: #x~X~%" (-> obj vertex-data)) - (format #t "~Ttris[1] @ #x~X~%" (-> obj tris)) - obj +(defmethod inspect collide-mesh ((this collide-mesh)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tjoint-id: ~D~%" (-> this joint-id)) + (format #t "~Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~Tnum-verts: ~D~%" (-> this num-verts)) + (format #t "~Tvertex-data: #x~X~%" (-> this vertex-data)) + (format #t "~Ttris[1] @ #x~X~%" (-> this tris)) + this ) ;; definition of type collide-mesh-cache @@ -95,21 +95,21 @@ ) ;; definition for method 3 of type collide-mesh-cache -(defmethod inspect collide-mesh-cache ((obj collide-mesh-cache)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tused-size: ~D~%" (-> obj used-size)) - (format #t "~Tmax-size: ~D~%" (-> obj max-size)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tdata[40960] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect collide-mesh-cache ((this collide-mesh-cache)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tused-size: ~D~%" (-> this used-size)) + (format #t "~Tmax-size: ~D~%" (-> this max-size)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tdata[40960] @ #x~X~%" (-> this data)) + this ) ;; definition for method 11 of type collide-mesh-cache ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for method 10 of type collide-mesh-cache -(defmethod is-id? collide-mesh-cache ((obj collide-mesh-cache) (arg0 int)) - (= (-> obj id) arg0) +(defmethod is-id? collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) + (= (-> this id) arg0) ) ;; definition of type collide-mesh-cache-tri @@ -125,13 +125,13 @@ ) ;; definition for method 3 of type collide-mesh-cache-tri -(defmethod inspect collide-mesh-cache-tri ((obj collide-mesh-cache-tri)) - (format #t "[~8x] ~A~%" obj 'collide-mesh-cache-tri) - (format #t "~Tvertex[3] @ #x~X~%" (-> obj vertex)) - (format #t "~Tnormal: ~`vector`P~%" (-> obj normal)) - (format #t "~Tbbox4w: #~%" (-> obj bbox4w)) - (format #t "~Tpat: ~D~%" (-> obj normal w)) - obj +(defmethod inspect collide-mesh-cache-tri ((this collide-mesh-cache-tri)) + (format #t "[~8x] ~A~%" this 'collide-mesh-cache-tri) + (format #t "~Tvertex[3] @ #x~X~%" (-> this vertex)) + (format #t "~Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~Tbbox4w: #~%" (-> this bbox4w)) + (format #t "~Tpat: ~D~%" (-> this normal w)) + this ) ;; definition (perm) for symbol *collide-mesh-cache*, type collide-mesh-cache diff --git a/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc index a479ac4a09..05fcd634d4 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-mesh_REF.gc @@ -3,24 +3,24 @@ ;; definition for method 5 of type collide-mesh ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of collide-mesh ((obj collide-mesh)) - (the-as int (+ (-> collide-mesh size) (* (+ (-> obj num-tris) -1) 8))) +(defmethod asize-of collide-mesh ((this collide-mesh)) + (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) ) ;; definition for method 8 of type collide-mesh ;; INFO: Return type mismatch int vs collide-mesh. -(defmethod mem-usage collide-mesh ((obj collide-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-mesh ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 79 (-> arg0 length))) (set! (-> arg0 data 78 name) "collide-mesh") (+! (-> arg0 data 78 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 78 used) v1-6) (+! (-> arg0 data 78 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 79 (-> arg0 length))) (set! (-> arg0 data 78 name) "collide-mesh") (+! (-> arg0 data 78 count) 1) - (let ((v1-16 (* (-> obj num-verts) 16))) + (let ((v1-16 (* (-> this num-verts) 16))) (+! (-> arg0 data 78 used) v1-16) (+! (-> arg0 data 78 total) (logand -16 (+ v1-16 15))) ) @@ -29,7 +29,7 @@ ;; definition for method 9 of type collide-mesh ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw-tris collide-mesh ((obj collide-mesh) (arg0 process-drawable) (arg1 int)) +(defmethod debug-draw-tris collide-mesh ((this collide-mesh) (arg0 process-drawable) (arg1 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -41,10 +41,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (the-as object (-> obj tris))) + (let ((s5-0 (the-as object (-> this tris))) (s4-0 (-> arg0 node-list data arg1 bone transform)) ) - (countdown (s3-0 (-> obj num-tris)) + (countdown (s3-0 (-> this num-tris)) (let ((a2-1 (new 'stack-no-clear 'vector)) (a3-0 (new 'stack-no-clear 'vector)) (t0-0 (new 'stack-no-clear 'vector)) @@ -53,9 +53,9 @@ (.lvf vf5 (&-> s4-0 vector 1 quad)) (.lvf vf6 (&-> s4-0 vector 2 quad)) (.lvf vf7 (&-> s4-0 vector 3 quad)) - (.lvf vf1 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) - (.lvf vf2 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) - (.lvf vf3 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 2)) quad)) + (.lvf vf1 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) + (.lvf vf2 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) + (.lvf vf3 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 2)) quad)) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-mesh-tri s5-0) pat mode) color) a 16))) (.mul.w.vf acc vf7 vf0) (.add.mul.x.vf acc vf4 vf1 acc) @@ -94,11 +94,11 @@ ) ;; definition for method 3 of type sopt-work -(defmethod inspect sopt-work ((obj sopt-work)) - (format #t "[~8x] ~A~%" obj 'sopt-work) - (format #t "~Tintersect: #~%" (-> obj intersect)) - (format #t "~Tsphere-bbox4w: #~%" (-> obj sphere-bbox4w)) - obj +(defmethod inspect sopt-work ((this sopt-work)) + (format #t "[~8x] ~A~%" this 'sopt-work) + (format #t "~Tintersect: #~%" (-> this intersect)) + (format #t "~Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) + this ) ;; definition for method 12 of type collide-mesh @@ -116,11 +116,11 @@ ) ;; definition for method 3 of type spat-work -(defmethod inspect spat-work ((obj spat-work)) - (format #t "[~8x] ~A~%" obj 'spat-work) - (format #t "~Tintersect: #~%" (-> obj intersect)) - (format #t "~Tsphere-bbox4w: #~%" (-> obj sphere-bbox4w)) - obj +(defmethod inspect spat-work ((this spat-work)) + (format #t "[~8x] ~A~%" this 'spat-work) + (format #t "~Tintersect: #~%" (-> this intersect)) + (format #t "~Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) + this ) ;; definition for method 11 of type collide-mesh @@ -137,18 +137,18 @@ ;; definition for method 9 of type collide-mesh-cache ;; INFO: Return type mismatch (pointer uint8) vs int. -(defmethod allocate! collide-mesh-cache ((obj collide-mesh-cache) (arg0 int)) +(defmethod allocate! collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) (local-vars (a1-2 int) (a2-2 int)) (let* ((v1-0 (+ arg0 15)) - (a1-1 (-> obj used-size)) + (a1-1 (-> this used-size)) (v1-1 (/ v1-0 16)) - (a3-0 (-> obj data)) - (a2-0 (-> obj max-size)) + (a3-0 (-> this data)) + (a2-0 (-> this max-size)) (v1-2 (* v1-1 16)) (a3-1 (&+ a3-0 a1-1)) ) (let ((t1-0 (- a2-0 (the-as uint v1-2))) - (t0-0 (-> obj id)) + (t0-0 (-> this id)) ) (b! (< (the-as int t1-0) 0) cfg-6 :delay (set! a1-2 (the-as int (+ a1-1 v1-2)))) (b! (>= (the-as int (- a2-0 (the-as uint a1-2))) 0) cfg-5 :delay (set! a2-2 (the-as int (+ t0-0 1)))) @@ -156,10 +156,10 @@ (b! (zero? (the-as uint a2-2)) cfg-4 :likely-delay (set! a2-2 1)) (label cfg-4) (set! a1-2 v1-2) - (set! a3-1 (-> obj data)) - (set! (-> obj id) (the-as uint a2-2)) + (set! a3-1 (-> this data)) + (set! (-> this id) (the-as uint a2-2)) (label cfg-5) - (set! (-> obj used-size) (the-as uint a1-2)) + (set! (-> this used-size) (the-as uint a1-2)) (let ((v0-0 a3-1)) (b! #t cfg-7 :delay (nop!)) (label cfg-6) @@ -173,10 +173,8 @@ ;; definition for method 13 of type collide-mesh ;; INFO: Return type mismatch int vs none. -;; WARN: Failed load: (set! vf1 (l.vf t0-4)) at op 77 -;; WARN: Failed load: (set! vf2 (l.vf t1-1)) at op 79 -;; WARN: Failed load: (set! vf3 (l.vf t2-2)) at op 81 -(defmethod populate-cache! collide-mesh ((obj collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix)) +;; ERROR: Failed load: (set! vf1 (l.vf t0-4)) at op 77 +(defmethod populate-cache! collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 matrix)) (local-vars (t0-2 uint)) (rlet ((acc :class vf) (Q :class vf) @@ -197,10 +195,10 @@ (init-vf0-vector) (nop!) (let ((t0-0 #x70000000) - (v1-0 (-> obj num-verts)) + (v1-0 (-> this num-verts)) ) (nop!) - (let ((a3-0 (-> obj vertex-data))) + (let ((a3-0 (-> this vertex-data))) (b! (zero? v1-0) cfg-3 :delay (.lvf vf1 (&-> arg1 vector 0 quad))) (nop!) (.lvf vf2 (&-> arg1 vector 1 quad)) @@ -262,10 +260,10 @@ ) ) (label cfg-3) - (let ((v1-1 (the-as collide-mesh-tri (-> obj tris)))) + (let ((v1-1 (the-as collide-mesh-tri (-> this tris)))) (nop!) (let ((a2-1 #x70000000) - (a0-1 (-> obj num-tris)) + (a0-1 (-> this num-tris)) ) (b! (zero? a0-1) cfg-6 :delay (set! t0-2 (-> v1-1 vertex-index 0))) (let* ((a1-1 (+ (the-as uint arg0) -96)) @@ -355,16 +353,16 @@ ) ;; definition for method 3 of type oot-work -(defmethod inspect oot-work ((obj oot-work)) - (format #t "[~8x] ~A~%" obj 'oot-work) - (format #t "~Tintersect: #~%" (-> obj intersect)) - (format #t "~Tsphere-bbox4w: #~%" (-> obj sphere-bbox4w)) - obj +(defmethod inspect oot-work ((this oot-work)) + (format #t "[~8x] ~A~%" this 'oot-work) + (format #t "~Tintersect: #~%" (-> this intersect)) + (format #t "~Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) + this ) ;; definition for method 10 of type collide-mesh ;; INFO: Used lq/sq -(defmethod overlap-test collide-mesh ((obj collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) +(defmethod overlap-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) (local-vars (v1-0 uint128) (a0-1 uint128) @@ -389,7 +387,7 @@ (s4-0 arg0) ) (.lvf vf2 (&-> arg1 quad)) - (let ((s3-0 (-> obj num-tris))) + (let ((s3-0 (-> this num-tris))) (.sub.w.vf vf5 vf2 vf2) (.add.w.vf vf6 vf2 vf2) (.ftoi.vf vf5 vf5) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc index 0a21a02faf..6d620e269d 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-probe_REF.gc @@ -123,11 +123,11 @@ ) ;; definition for method 3 of type collide-probe-stack-elem -(defmethod inspect collide-probe-stack-elem ((obj collide-probe-stack-elem)) - (format #t "[~8x] ~A~%" obj 'collide-probe-stack-elem) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tcount: ~D~%" (-> obj count)) - obj +(defmethod inspect collide-probe-stack-elem ((this collide-probe-stack-elem)) + (format #t "[~8x] ~A~%" this 'collide-probe-stack-elem) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tcount: ~D~%" (-> this count)) + this ) ;; definition of type collide-probe-stack @@ -140,10 +140,10 @@ ) ;; definition for method 3 of type collide-probe-stack -(defmethod inspect collide-probe-stack ((obj collide-probe-stack)) - (format #t "[~8x] ~A~%" obj 'collide-probe-stack) - (format #t "~Tdata[1024] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect collide-probe-stack ((this collide-probe-stack)) + (format #t "[~8x] ~A~%" this 'collide-probe-stack) + (format #t "~Tdata[1024] @ #x~X~%" (-> this data)) + this ) ;; definition for symbol *collide-probe-stack*, type collide-probe-stack diff --git a/test/decompiler/reference/jak1/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-shape-h_REF.gc index ca0682d25b..9eca2c8246 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-shape-h_REF.gc @@ -17,19 +17,19 @@ ) ;; definition for method 3 of type collide-sticky-rider -(defmethod inspect collide-sticky-rider ((obj collide-sticky-rider)) - (format #t "[~8x] ~A~%" obj 'collide-sticky-rider) - (format #t "~Trider-handle: ~D~%" (-> obj rider-handle)) - (format #t "~Tsticky-prim: ~A~%" (-> obj sticky-prim)) - (format #t "~Tprim-ry: ~f~%" (-> obj prim-ry)) - (format #t "~Trider-local-pos: #~%" (-> obj rider-local-pos)) - obj +(defmethod inspect collide-sticky-rider ((this collide-sticky-rider)) + (format #t "[~8x] ~A~%" this 'collide-sticky-rider) + (format #t "~Trider-handle: ~D~%" (-> this rider-handle)) + (format #t "~Tsticky-prim: ~A~%" (-> this sticky-prim)) + (format #t "~Tprim-ry: ~f~%" (-> this prim-ry)) + (format #t "~Trider-local-pos: #~%" (-> this rider-local-pos)) + this ) ;; definition for method 9 of type collide-sticky-rider -(defmethod set-rider! collide-sticky-rider ((obj collide-sticky-rider) (arg0 handle)) - (set! (-> obj rider-handle) arg0) - (set! (-> obj sticky-prim) #f) +(defmethod set-rider! collide-sticky-rider ((this collide-sticky-rider) (arg0 handle)) + (set! (-> this rider-handle) arg0) + (set! (-> this sticky-prim) #f) #f ) @@ -50,17 +50,17 @@ ) ;; definition for method 3 of type collide-sticky-rider-group -(defmethod inspect collide-sticky-rider-group ((obj collide-sticky-rider-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-riders: ~D~%" (-> obj num-riders)) - (format #t "~Tallocated-riders: ~D~%" (-> obj allocated-riders)) - (format #t "~Trider[1] @ #x~X~%" (-> obj rider)) - obj +(defmethod inspect collide-sticky-rider-group ((this collide-sticky-rider-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-riders: ~D~%" (-> this num-riders)) + (format #t "~Tallocated-riders: ~D~%" (-> this allocated-riders)) + (format #t "~Trider[1] @ #x~X~%" (-> this rider)) + this ) ;; definition for method 10 of type collide-sticky-rider-group -(defmethod reset! collide-sticky-rider-group ((obj collide-sticky-rider-group)) - (set! (-> obj num-riders) 0) +(defmethod reset! collide-sticky-rider-group ((this collide-sticky-rider-group)) + (set! (-> this num-riders) 0) 0 ) @@ -77,13 +77,13 @@ ) ;; definition for method 3 of type pull-rider-info -(defmethod inspect pull-rider-info ((obj pull-rider-info)) - (format #t "[~8x] ~A~%" obj 'pull-rider-info) - (format #t "~Trider: #~%" (-> obj rider)) - (format #t "~Trider-cshape: ~A~%" (-> obj rider-cshape)) - (format #t "~Trider-delta-ry: ~f~%" (-> obj rider-delta-ry)) - (format #t "~Trider-dest: #~%" (-> obj rider-dest)) - obj +(defmethod inspect pull-rider-info ((this pull-rider-info)) + (format #t "[~8x] ~A~%" this 'pull-rider-info) + (format #t "~Trider: #~%" (-> this rider)) + (format #t "~Trider-cshape: ~A~%" (-> this rider-cshape)) + (format #t "~Trider-delta-ry: ~f~%" (-> this rider-delta-ry)) + (format #t "~Trider-dest: #~%" (-> this rider-dest)) + this ) ;; definition of type collide-shape-intersect @@ -103,14 +103,14 @@ ) ;; definition for method 3 of type collide-shape-intersect -(defmethod inspect collide-shape-intersect ((obj collide-shape-intersect)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tmove-vec: ~`vector`P~%" (-> obj move-vec)) - (format #t "~Tbest-u: ~f~%" (-> obj best-u)) - (format #t "~Tbest-tri: #~%" (-> obj best-tri)) - (format #t "~Tbest-from-prim: ~A~%" (-> obj best-from-prim)) - (format #t "~Tbest-to-prim: ~A~%" (-> obj best-to-prim)) - obj +(defmethod inspect collide-shape-intersect ((this collide-shape-intersect)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tmove-vec: ~`vector`P~%" (-> this move-vec)) + (format #t "~Tbest-u: ~f~%" (-> this best-u)) + (format #t "~Tbest-tri: #~%" (-> this best-tri)) + (format #t "~Tbest-from-prim: ~A~%" (-> this best-from-prim)) + (format #t "~Tbest-to-prim: ~A~%" (-> this best-to-prim)) + this ) ;; definition of type collide-overlap-result @@ -129,21 +129,21 @@ ) ;; definition for method 3 of type collide-overlap-result -(defmethod inspect collide-overlap-result ((obj collide-overlap-result)) - (format #t "[~8x] ~A~%" obj 'collide-overlap-result) - (format #t "~Tbest-dist: ~f~%" (-> obj best-dist)) - (format #t "~Tbest-from-prim: ~A~%" (-> obj best-from-prim)) - (format #t "~Tbest-to-prim: ~A~%" (-> obj best-to-prim)) - (format #t "~Tbest-from-tri: #~%" (-> obj best-from-tri)) - obj +(defmethod inspect collide-overlap-result ((this collide-overlap-result)) + (format #t "[~8x] ~A~%" this 'collide-overlap-result) + (format #t "~Tbest-dist: ~f~%" (-> this best-dist)) + (format #t "~Tbest-from-prim: ~A~%" (-> this best-from-prim)) + (format #t "~Tbest-to-prim: ~A~%" (-> this best-to-prim)) + (format #t "~Tbest-from-tri: #~%" (-> this best-from-tri)) + this ) ;; definition for method 9 of type collide-overlap-result ;; INFO: Return type mismatch symbol vs none. -(defmethod reset! collide-overlap-result ((obj collide-overlap-result)) - (set! (-> obj best-dist) 0.0) - (set! (-> obj best-from-prim) #f) - (set! (-> obj best-to-prim) #f) +(defmethod reset! collide-overlap-result ((this collide-overlap-result)) + (set! (-> this best-dist) 0.0) + (set! (-> this best-from-prim) #f) + (set! (-> this best-to-prim) #f) (none) ) @@ -158,11 +158,11 @@ ) ;; definition for method 3 of type overlaps-others-params -(defmethod inspect overlaps-others-params ((obj overlaps-others-params)) - (format #t "[~8x] ~A~%" obj 'overlaps-others-params) - (format #t "~Toptions: ~D~%" (-> obj options)) - (format #t "~Ttlist: ~A~%" (-> obj tlist)) - obj +(defmethod inspect overlaps-others-params ((this overlaps-others-params)) + (format #t "[~8x] ~A~%" this 'overlaps-others-params) + (format #t "~Toptions: ~D~%" (-> this options)) + (format #t "~Ttlist: ~A~%" (-> this tlist)) + this ) ;; definition for symbol *collide-hit-by-player-list*, type engine @@ -193,16 +193,16 @@ ) ;; definition for method 3 of type collide-prim-core -(defmethod inspect collide-prim-core ((obj collide-prim-core)) - (format #t "[~8x] ~A~%" obj 'collide-prim-core) - (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj world-sphere)) - (format #t "~Tcollide-as: ~D~%" (-> obj collide-as)) - (format #t "~Taction: ~D~%" (-> obj action)) - (format #t "~Toffense: ~D~%" (-> obj offense)) - (format #t "~Tprim-type: ~D~%" (-> obj prim-type)) - (format #t "~Textra[2] @ #x~X~%" (-> obj extra)) - (format #t "~Tquad[2] @ #x~X~%" (-> obj world-sphere)) - obj +(defmethod inspect collide-prim-core ((this collide-prim-core)) + (format #t "[~8x] ~A~%" this 'collide-prim-core) + (format #t "~Tworld-sphere: ~`vector`P~%" (-> this world-sphere)) + (format #t "~Tcollide-as: ~D~%" (-> this collide-as)) + (format #t "~Taction: ~D~%" (-> this action)) + (format #t "~Toffense: ~D~%" (-> this offense)) + (format #t "~Tprim-type: ~D~%" (-> this prim-type)) + (format #t "~Textra[2] @ #x~X~%" (-> this extra)) + (format #t "~Tquad[2] @ #x~X~%" (-> this world-sphere)) + this ) ;; definition of type collide-shape-prim @@ -248,21 +248,21 @@ ) ;; definition for method 3 of type collide-shape-prim -(defmethod inspect collide-shape-prim ((obj collide-shape-prim)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tcshape: ~A~%" (-> obj cshape)) - (format #t "~Tprim-id: #x~X~%" (-> obj prim-id)) - (format #t "~Ttransform-index: ~D~%" (-> obj transform-index)) - (format #t "~Tprim-core: #~%" (-> obj prim-core)) - (format #t "~Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) - (format #t "~Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) - (format #t "~Tcollide-as: ~D~%" (-> obj prim-core collide-as)) - (format #t "~Taction: ~D~%" (-> obj prim-core action)) - (format #t "~Toffense: ~D~%" (-> obj prim-core offense)) - (format #t "~Tprim-type: ~D~%" (-> obj prim-core prim-type)) - (format #t "~Tradius: (meters ~m)~%" (-> obj local-sphere w)) - obj +(defmethod inspect collide-shape-prim ((this collide-shape-prim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tcshape: ~A~%" (-> this cshape)) + (format #t "~Tprim-id: #x~X~%" (-> this prim-id)) + (format #t "~Ttransform-index: ~D~%" (-> this transform-index)) + (format #t "~Tprim-core: #~%" (-> this prim-core)) + (format #t "~Tlocal-sphere: ~`vector`P~%" (-> this local-sphere)) + (format #t "~Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~Tcollide-as: ~D~%" (-> this prim-core collide-as)) + (format #t "~Taction: ~D~%" (-> this prim-core action)) + (format #t "~Toffense: ~D~%" (-> this prim-core offense)) + (format #t "~Tprim-type: ~D~%" (-> this prim-core prim-type)) + (format #t "~Tradius: (meters ~m)~%" (-> this local-sphere w)) + this ) ;; definition of type collide-shape-prim-sphere @@ -278,22 +278,22 @@ ) ;; definition for method 3 of type collide-shape-prim-sphere -(defmethod inspect collide-shape-prim-sphere ((obj collide-shape-prim-sphere)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tcshape: ~A~%" (-> obj cshape)) - (format #t "~Tprim-id: #x~X~%" (-> obj prim-id)) - (format #t "~Ttransform-index: ~D~%" (-> obj transform-index)) - (format #t "~Tprim-core: #~%" (-> obj prim-core)) - (format #t "~Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) - (format #t "~Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) - (format #t "~Tcollide-as: ~D~%" (-> obj prim-core collide-as)) - (format #t "~Taction: ~D~%" (-> obj prim-core action)) - (format #t "~Toffense: ~D~%" (-> obj prim-core offense)) - (format #t "~Tprim-type: ~D~%" (-> obj prim-core prim-type)) - (format #t "~Tradius: (meters ~m)~%" (-> obj local-sphere w)) - (format #t "~Tpat: ~D~%" (-> obj pat)) - obj +(defmethod inspect collide-shape-prim-sphere ((this collide-shape-prim-sphere)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tcshape: ~A~%" (-> this cshape)) + (format #t "~Tprim-id: #x~X~%" (-> this prim-id)) + (format #t "~Ttransform-index: ~D~%" (-> this transform-index)) + (format #t "~Tprim-core: #~%" (-> this prim-core)) + (format #t "~Tlocal-sphere: ~`vector`P~%" (-> this local-sphere)) + (format #t "~Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~Tcollide-as: ~D~%" (-> this prim-core collide-as)) + (format #t "~Taction: ~D~%" (-> this prim-core action)) + (format #t "~Toffense: ~D~%" (-> this prim-core offense)) + (format #t "~Tprim-type: ~D~%" (-> this prim-core prim-type)) + (format #t "~Tradius: (meters ~m)~%" (-> this local-sphere w)) + (format #t "~Tpat: ~D~%" (-> this pat)) + this ) ;; definition of type collide-shape-prim-mesh @@ -313,25 +313,25 @@ ) ;; definition for method 3 of type collide-shape-prim-mesh -(defmethod inspect collide-shape-prim-mesh ((obj collide-shape-prim-mesh)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tcshape: ~A~%" (-> obj cshape)) - (format #t "~Tprim-id: #x~X~%" (-> obj prim-id)) - (format #t "~Ttransform-index: ~D~%" (-> obj transform-index)) - (format #t "~Tprim-core: #~%" (-> obj prim-core)) - (format #t "~Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) - (format #t "~Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) - (format #t "~Tcollide-as: ~D~%" (-> obj prim-core collide-as)) - (format #t "~Taction: ~D~%" (-> obj prim-core action)) - (format #t "~Toffense: ~D~%" (-> obj prim-core offense)) - (format #t "~Tprim-type: ~D~%" (-> obj prim-core prim-type)) - (format #t "~Tradius: (meters ~m)~%" (-> obj local-sphere w)) - (format #t "~Tmesh: ~A~%" (-> obj mesh)) - (format #t "~Tmesh-id: ~D~%" (-> obj mesh-id)) - (format #t "~Tmesh-cache-id: ~D~%" (-> obj mesh-cache-id)) - (format #t "~Tmesh-cache-tris: #x~X~%" (-> obj mesh-cache-tris)) - obj +(defmethod inspect collide-shape-prim-mesh ((this collide-shape-prim-mesh)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tcshape: ~A~%" (-> this cshape)) + (format #t "~Tprim-id: #x~X~%" (-> this prim-id)) + (format #t "~Ttransform-index: ~D~%" (-> this transform-index)) + (format #t "~Tprim-core: #~%" (-> this prim-core)) + (format #t "~Tlocal-sphere: ~`vector`P~%" (-> this local-sphere)) + (format #t "~Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~Tcollide-as: ~D~%" (-> this prim-core collide-as)) + (format #t "~Taction: ~D~%" (-> this prim-core action)) + (format #t "~Toffense: ~D~%" (-> this prim-core offense)) + (format #t "~Tprim-type: ~D~%" (-> this prim-core prim-type)) + (format #t "~Tradius: (meters ~m)~%" (-> this local-sphere w)) + (format #t "~Tmesh: ~A~%" (-> this mesh)) + (format #t "~Tmesh-id: ~D~%" (-> this mesh-id)) + (format #t "~Tmesh-cache-id: ~D~%" (-> this mesh-cache-id)) + (format #t "~Tmesh-cache-tris: #x~X~%" (-> this mesh-cache-tris)) + this ) ;; definition of type collide-shape-prim-group @@ -353,24 +353,24 @@ ) ;; definition for method 3 of type collide-shape-prim-group -(defmethod inspect collide-shape-prim-group ((obj collide-shape-prim-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tcshape: ~A~%" (-> obj cshape)) - (format #t "~Tprim-id: #x~X~%" (-> obj prim-id)) - (format #t "~Ttransform-index: ~D~%" (-> obj transform-index)) - (format #t "~Tprim-core: #~%" (-> obj prim-core)) - (format #t "~Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) - (format #t "~Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) - (format #t "~Tcollide-as: ~D~%" (-> obj prim-core collide-as)) - (format #t "~Taction: ~D~%" (-> obj prim-core action)) - (format #t "~Toffense: ~D~%" (-> obj prim-core offense)) - (format #t "~Tprim-type: ~D~%" (-> obj prim-core prim-type)) - (format #t "~Tradius: (meters ~m)~%" (-> obj local-sphere w)) - (format #t "~Tnum-prims: ~D~%" (-> obj num-prims)) - (format #t "~Tallocated-prims: ~D~%" (-> obj allocated-prims)) - (format #t "~Tprim[1] @ #x~X~%" (-> obj prims)) - obj +(defmethod inspect collide-shape-prim-group ((this collide-shape-prim-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tcshape: ~A~%" (-> this cshape)) + (format #t "~Tprim-id: #x~X~%" (-> this prim-id)) + (format #t "~Ttransform-index: ~D~%" (-> this transform-index)) + (format #t "~Tprim-core: #~%" (-> this prim-core)) + (format #t "~Tlocal-sphere: ~`vector`P~%" (-> this local-sphere)) + (format #t "~Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~Tcollide-as: ~D~%" (-> this prim-core collide-as)) + (format #t "~Taction: ~D~%" (-> this prim-core action)) + (format #t "~Toffense: ~D~%" (-> this prim-core offense)) + (format #t "~Tprim-type: ~D~%" (-> this prim-core prim-type)) + (format #t "~Tradius: (meters ~m)~%" (-> this local-sphere w)) + (format #t "~Tnum-prims: ~D~%" (-> this num-prims)) + (format #t "~Tallocated-prims: ~D~%" (-> this allocated-prims)) + (format #t "~Tprim[1] @ #x~X~%" (-> this prims)) + this ) ;; definition of type collide-shape @@ -424,32 +424,32 @@ ) ;; definition for method 3 of type collide-shape -(defmethod inspect collide-shape ((obj collide-shape)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Trot: ~`vector`P~%" (-> obj quat)) - (format #t "~Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~Tquat: #~%" (-> obj quat)) - (format #t "~Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance)) - (format #t "~Tnav-radius: (meters ~m)~%" (-> obj nav-radius)) - (format #t "~Ttransv: ~`vector`P~%" (-> obj transv)) - (format #t "~Trotv: ~`vector`P~%" (-> obj rotv)) - (format #t "~Tscalev: ~`vector`P~%" (-> obj scalev)) - (format #t "~Tdir-targ: #~%" (-> obj dir-targ)) - (format #t "~Tangle-change-time: ~D~%" (-> obj angle-change-time)) - (format #t "~Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tmax-iteration-count: ~D~%" (-> obj max-iteration-count)) - (format #t "~Tnav-flags: ~D~%" (-> obj nav-flags)) - (format #t "~Tpad-byte[2] @ #x~X~%" (-> obj pad-byte)) - (format #t "~Tpat-ignore-mask: ~D~%" (-> obj pat-ignore-mask)) - (format #t "~Tevent-self: ~A~%" (-> obj event-self)) - (format #t "~Tevent-other: ~A~%" (-> obj event-other)) - (format #t "~Troot-prim: ~A~%" (-> obj root-prim)) - (format #t "~Triders: ~A~%" (-> obj riders)) - (format #t "~Tbackup-collide-as: ~D~%" (-> obj backup-collide-as)) - (format #t "~Tbackup-collide-with: ~D~%" (-> obj backup-collide-with)) - obj +(defmethod inspect collide-shape ((this collide-shape)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Trot: ~`vector`P~%" (-> this quat)) + (format #t "~Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~Tquat: #~%" (-> this quat)) + (format #t "~Tpause-adjust-distance: (meters ~m)~%" (-> this pause-adjust-distance)) + (format #t "~Tnav-radius: (meters ~m)~%" (-> this nav-radius)) + (format #t "~Ttransv: ~`vector`P~%" (-> this transv)) + (format #t "~Trotv: ~`vector`P~%" (-> this rotv)) + (format #t "~Tscalev: ~`vector`P~%" (-> this scalev)) + (format #t "~Tdir-targ: #~%" (-> this dir-targ)) + (format #t "~Tangle-change-time: ~D~%" (-> this angle-change-time)) + (format #t "~Told-y-angle-diff: ~f~%" (-> this old-y-angle-diff)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tmax-iteration-count: ~D~%" (-> this max-iteration-count)) + (format #t "~Tnav-flags: ~D~%" (-> this nav-flags)) + (format #t "~Tpad-byte[2] @ #x~X~%" (-> this pad-byte)) + (format #t "~Tpat-ignore-mask: ~D~%" (-> this pat-ignore-mask)) + (format #t "~Tevent-self: ~A~%" (-> this event-self)) + (format #t "~Tevent-other: ~A~%" (-> this event-other)) + (format #t "~Troot-prim: ~A~%" (-> this root-prim)) + (format #t "~Triders: ~A~%" (-> this riders)) + (format #t "~Tbackup-collide-as: ~D~%" (-> this backup-collide-as)) + (format #t "~Tbackup-collide-with: ~D~%" (-> this backup-collide-with)) + this ) ;; definition of type collide-shape-moving @@ -497,57 +497,57 @@ ) ;; definition for method 3 of type collide-shape-moving -(defmethod inspect collide-shape-moving ((obj collide-shape-moving)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Trot: ~`vector`P~%" (-> obj quat)) - (format #t "~Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~Tquat: #~%" (-> obj quat)) - (format #t "~Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance)) - (format #t "~Tnav-radius: (meters ~m)~%" (-> obj nav-radius)) - (format #t "~Ttransv: ~`vector`P~%" (-> obj transv)) - (format #t "~Trotv: ~`vector`P~%" (-> obj rotv)) - (format #t "~Tscalev: ~`vector`P~%" (-> obj scalev)) - (format #t "~Tdir-targ: #~%" (-> obj dir-targ)) - (format #t "~Tangle-change-time: ~D~%" (-> obj angle-change-time)) - (format #t "~Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tmax-iteration-count: ~D~%" (-> obj max-iteration-count)) - (format #t "~Tnav-flags: ~D~%" (-> obj nav-flags)) - (format #t "~Tpad-byte[2] @ #x~X~%" (-> obj pad-byte)) - (format #t "~Tpat-ignore-mask: ~D~%" (-> obj pat-ignore-mask)) - (format #t "~Tevent-self: ~A~%" (-> obj event-self)) - (format #t "~Tevent-other: ~A~%" (-> obj event-other)) - (format #t "~Troot-prim: ~A~%" (-> obj root-prim)) - (format #t "~Triders: ~A~%" (-> obj riders)) - (format #t "~Tbackup-collide-as: ~D~%" (-> obj backup-collide-as)) - (format #t "~Tbackup-collide-with: ~D~%" (-> obj backup-collide-with)) - (format #t "~Trider-time: ~D~%" (-> obj rider-time)) - (format #t "~Trider-last-move: ~`vector`P~%" (-> obj rider-last-move)) - (format #t "~Ttrans-old[3] @ #x~X~%" (-> obj trans-old)) - (format #t "~Tpoly-pat: #x~X~%" (-> obj poly-pat)) - (format #t "~Tcur-pat: #x~X~%" (-> obj cur-pat)) - (format #t "~Tground-pat: #x~X~%" (-> obj ground-pat)) - (format #t "~Tstatus: ~D~%" (-> obj status)) - (format #t "~Told-status: ~D~%" (-> obj old-status)) - (format #t "~Tprev-status: ~D~%" (-> obj prev-status)) - (format #t "~Treaction-flag: ~D~%" (-> obj reaction-flag)) - (format #t "~Treaction: ~A~%" (-> obj reaction)) - (format #t "~Tno-reaction: ~A~%" (-> obj no-reaction)) - (format #t "~Tlocal-normal: ~`vector`P~%" (-> obj local-normal)) - (format #t "~Tsurface-normal: ~`vector`P~%" (-> obj surface-normal)) - (format #t "~Tpoly-normal: ~`vector`P~%" (-> obj poly-normal)) - (format #t "~Tground-poly-normal: ~`vector`P~%" (-> obj ground-poly-normal)) - (format #t "~Tground-touch-point: ~`vector`P~%" (-> obj ground-touch-point)) - (format #t "~Tshadow-pos: ~`vector`P~%" (-> obj shadow-pos)) - (format #t "~Tground-impact-vel: (meters ~m)~%" (-> obj ground-impact-vel)) - (format #t "~Tsurface-angle: ~f~%" (-> obj surface-angle)) - (format #t "~Tpoly-angle: ~f~%" (-> obj poly-angle)) - (format #t "~Ttouch-angle: ~f~%" (-> obj touch-angle)) - (format #t "~Tcoverage: ~f~%" (-> obj coverage)) - (format #t "~Tdynam: ~A~%" (-> obj dynam)) - (format #t "~Tsurf: ~A~%" (-> obj surf)) - obj +(defmethod inspect collide-shape-moving ((this collide-shape-moving)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Trot: ~`vector`P~%" (-> this quat)) + (format #t "~Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~Tquat: #~%" (-> this quat)) + (format #t "~Tpause-adjust-distance: (meters ~m)~%" (-> this pause-adjust-distance)) + (format #t "~Tnav-radius: (meters ~m)~%" (-> this nav-radius)) + (format #t "~Ttransv: ~`vector`P~%" (-> this transv)) + (format #t "~Trotv: ~`vector`P~%" (-> this rotv)) + (format #t "~Tscalev: ~`vector`P~%" (-> this scalev)) + (format #t "~Tdir-targ: #~%" (-> this dir-targ)) + (format #t "~Tangle-change-time: ~D~%" (-> this angle-change-time)) + (format #t "~Told-y-angle-diff: ~f~%" (-> this old-y-angle-diff)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tmax-iteration-count: ~D~%" (-> this max-iteration-count)) + (format #t "~Tnav-flags: ~D~%" (-> this nav-flags)) + (format #t "~Tpad-byte[2] @ #x~X~%" (-> this pad-byte)) + (format #t "~Tpat-ignore-mask: ~D~%" (-> this pat-ignore-mask)) + (format #t "~Tevent-self: ~A~%" (-> this event-self)) + (format #t "~Tevent-other: ~A~%" (-> this event-other)) + (format #t "~Troot-prim: ~A~%" (-> this root-prim)) + (format #t "~Triders: ~A~%" (-> this riders)) + (format #t "~Tbackup-collide-as: ~D~%" (-> this backup-collide-as)) + (format #t "~Tbackup-collide-with: ~D~%" (-> this backup-collide-with)) + (format #t "~Trider-time: ~D~%" (-> this rider-time)) + (format #t "~Trider-last-move: ~`vector`P~%" (-> this rider-last-move)) + (format #t "~Ttrans-old[3] @ #x~X~%" (-> this trans-old)) + (format #t "~Tpoly-pat: #x~X~%" (-> this poly-pat)) + (format #t "~Tcur-pat: #x~X~%" (-> this cur-pat)) + (format #t "~Tground-pat: #x~X~%" (-> this ground-pat)) + (format #t "~Tstatus: ~D~%" (-> this status)) + (format #t "~Told-status: ~D~%" (-> this old-status)) + (format #t "~Tprev-status: ~D~%" (-> this prev-status)) + (format #t "~Treaction-flag: ~D~%" (-> this reaction-flag)) + (format #t "~Treaction: ~A~%" (-> this reaction)) + (format #t "~Tno-reaction: ~A~%" (-> this no-reaction)) + (format #t "~Tlocal-normal: ~`vector`P~%" (-> this local-normal)) + (format #t "~Tsurface-normal: ~`vector`P~%" (-> this surface-normal)) + (format #t "~Tpoly-normal: ~`vector`P~%" (-> this poly-normal)) + (format #t "~Tground-poly-normal: ~`vector`P~%" (-> this ground-poly-normal)) + (format #t "~Tground-touch-point: ~`vector`P~%" (-> this ground-touch-point)) + (format #t "~Tshadow-pos: ~`vector`P~%" (-> this shadow-pos)) + (format #t "~Tground-impact-vel: (meters ~m)~%" (-> this ground-impact-vel)) + (format #t "~Tsurface-angle: ~f~%" (-> this surface-angle)) + (format #t "~Tpoly-angle: ~f~%" (-> this poly-angle)) + (format #t "~Ttouch-angle: ~f~%" (-> this touch-angle)) + (format #t "~Tcoverage: ~f~%" (-> this coverage)) + (format #t "~Tdynam: ~A~%" (-> this dynam)) + (format #t "~Tsurf: ~A~%" (-> this surf)) + this ) ;; definition for method 0 of type collide-shape-prim @@ -568,131 +568,131 @@ ;; definition for method 0 of type collide-shape-prim-sphere ;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-sphere. (defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (cshape collide-shape) (prim-id uint)) - (let ((obj (the-as - collide-shape-prim-sphere - ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id 76) - ) - ) + (let ((this (the-as + collide-shape-prim-sphere + ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id 76) + ) + ) ) - (set! (-> obj pat) (new 'static 'pat-surface :mode (pat-mode obstacle))) - (set! (-> obj prim-core prim-type) -1) - (the-as collide-shape-prim-sphere obj) + (set! (-> this pat) (new 'static 'pat-surface :mode (pat-mode obstacle))) + (set! (-> this prim-core prim-type) -1) + (the-as collide-shape-prim-sphere this) ) ) ;; definition for method 0 of type collide-shape-prim-mesh ;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-mesh. (defmethod new collide-shape-prim-mesh ((allocation symbol) (type-to-make type) (cshape collide-shape) (mesh-id uint) (prim-id uint)) - (let ((obj (the-as - collide-shape-prim-mesh - ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id 92) - ) - ) + (let ((this (the-as + collide-shape-prim-mesh + ((method-of-type collide-shape-prim new) allocation type-to-make cshape prim-id 92) + ) + ) ) - (set! (-> obj mesh) #f) - (set! (-> obj mesh-id) (the-as int mesh-id)) - (set! (-> obj mesh-cache-id) (the-as uint 0)) - (set! (-> obj prim-core prim-type) 1) - (the-as collide-shape-prim-mesh obj) + (set! (-> this mesh) #f) + (set! (-> this mesh-id) (the-as int mesh-id)) + (set! (-> this mesh-cache-id) (the-as uint 0)) + (set! (-> this prim-core prim-type) 1) + (the-as collide-shape-prim-mesh this) ) ) ;; definition for method 0 of type collide-shape-prim-group ;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-group. (defmethod new collide-shape-prim-group ((allocation symbol) (type-to-make type) (cshape collide-shape) (elt-count uint) (prim-id int)) - (let ((obj (the-as collide-shape-prim-group ((method-of-type collide-shape-prim new) - allocation - type-to-make - cshape - (the-as uint prim-id) - (the-as int (+ (-> type-to-make size) (* (+ elt-count -1) 4))) - ) - ) - ) + (let ((this (the-as collide-shape-prim-group ((method-of-type collide-shape-prim new) + allocation + type-to-make + cshape + (the-as uint prim-id) + (the-as int (+ (-> type-to-make size) (* (+ elt-count -1) 4))) + ) + ) + ) ) - (set! (-> obj allocated-prims) (the-as int elt-count)) - (set! (-> obj num-prims) 0) - (set! (-> obj prim-core prim-type) 0) + (set! (-> this allocated-prims) (the-as int elt-count)) + (set! (-> this num-prims) 0) + (set! (-> this prim-core prim-type) 0) (while (nonzero? elt-count) (+! elt-count -1) - (set! (-> obj prims elt-count) #f) + (set! (-> this prims elt-count) #f) (nop!) ) - (the-as collide-shape-prim-group obj) + (the-as collide-shape-prim-group this) ) ) ;; definition for method 4 of type collide-shape-prim-group -(defmethod length collide-shape-prim-group ((obj collide-shape-prim-group)) - (-> obj num-prims) +(defmethod length collide-shape-prim-group ((this collide-shape-prim-group)) + (-> this num-prims) ) ;; definition for method 5 of type collide-shape-prim-group ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of collide-shape-prim-group ((obj collide-shape-prim-group)) - (the-as int (+ (-> obj type size) (* (+ (-> obj allocated-prims) -1) 4))) +(defmethod asize-of collide-shape-prim-group ((this collide-shape-prim-group)) + (the-as int (+ (-> this type size) (* (+ (-> this allocated-prims) -1) 4))) ) ;; definition for method 0 of type collide-shape (defmethod new collide-shape ((allocation symbol) (type-to-make type) (proc process-drawable) (collide-list-kind collide-list-enum)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj process) proc) - (set! (-> obj max-iteration-count) (the-as uint 1)) - (set! (-> obj nav-flags) (nav-flags navf0)) - (set! (-> obj event-self) #f) - (set! (-> obj event-other) #f) - (set! (-> obj riders) #f) - (set! (-> obj root-prim) #f) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this process) proc) + (set! (-> this max-iteration-count) (the-as uint 1)) + (set! (-> this nav-flags) (nav-flags navf0)) + (set! (-> this event-self) #f) + (set! (-> this event-other) #f) + (set! (-> this riders) #f) + (set! (-> this root-prim) #f) (case (-> proc type symbol) (('camera) - (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1)) + (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1)) ) (else - (set! (-> obj pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) + (set! (-> this pat-ignore-mask) (new 'static 'pat-surface :noentity #x1)) ) ) - (set! (-> obj trans w) 1.0) - (quaternion-identity! (-> obj quat)) - (vector-identity! (-> obj scale)) + (set! (-> this trans w) 1.0) + (quaternion-identity! (-> this quat)) + (vector-identity! (-> this scale)) (cond ((= collide-list-kind (collide-list-enum hit-by-player)) - (add-connection *collide-hit-by-player-list* proc #f obj #f #f) + (add-connection *collide-hit-by-player-list* proc #f this #f #f) ) ((= collide-list-kind (collide-list-enum usually-hit-by-player)) - (add-connection *collide-usually-hit-by-player-list* proc #f obj #f #f) + (add-connection *collide-usually-hit-by-player-list* proc #f this #f #f) ) ((= collide-list-kind (collide-list-enum hit-by-others)) - (add-connection *collide-hit-by-others-list* proc #f obj #f #f) + (add-connection *collide-hit-by-others-list* proc #f this #f #f) ) ((= collide-list-kind (collide-list-enum player)) - (add-connection *collide-player-list* proc #f obj #f #f) + (add-connection *collide-player-list* proc #f this #f #f) ) (else (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%") ) ) - obj + this ) ) ;; definition for method 0 of type collide-sticky-rider-group (defmethod new collide-sticky-rider-group ((allocation symbol) (type-to-make type) (arg0 int)) - (let ((obj (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 32)))))) - (set! (-> obj allocated-riders) arg0) - (set! (-> obj num-riders) 0) - obj + (let ((this (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 32)))))) + (set! (-> this allocated-riders) arg0) + (set! (-> this num-riders) 0) + this ) ) ;; definition for method 4 of type collide-sticky-rider-group -(defmethod length collide-sticky-rider-group ((obj collide-sticky-rider-group)) - (-> obj num-riders) +(defmethod length collide-sticky-rider-group ((this collide-sticky-rider-group)) + (-> this num-riders) ) ;; definition for method 5 of type collide-sticky-rider-group ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of collide-sticky-rider-group ((obj collide-sticky-rider-group)) - (the-as int (+ (-> obj type size) (* (+ (-> obj allocated-riders) -1) 32))) +(defmethod asize-of collide-sticky-rider-group ((this collide-sticky-rider-group)) + (the-as int (+ (-> this type size) (* (+ (-> this allocated-riders) -1) 32))) ) ;; definition for symbol *collide-shape-prim-backgnd*, type collide-shape-prim-mesh diff --git a/test/decompiler/reference/jak1/engine/collide/collide-shape-rider_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-shape-rider_REF.gc index 5b01e8810a..f7ead6a8f3 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-shape-rider_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-shape-rider_REF.gc @@ -2,14 +2,14 @@ (in-package goal) ;; definition for method 39 of type collide-shape -(defmethod on-platform collide-shape ((obj collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) +(defmethod on-platform collide-shape ((this collide-shape) (arg0 collide-shape) (arg1 collide-overlap-result)) (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) (set! (-> v1-0 best-from-prim) #f) (set! (-> v1-0 best-to-prim) #f) ) (set! (-> arg1 best-dist) 122.88) - (let ((s5-0 (-> obj root-prim)) + (let ((s5-0 (-> this root-prim)) (s4-0 (-> arg0 root-prim)) ) (when (and (logtest? (-> s5-0 collide-with) (-> s4-0 prim-core collide-as)) @@ -34,17 +34,17 @@ ;; definition for method 22 of type collide-shape-prim ;; INFO: Return type mismatch object vs none. -(defmethod on-platform-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") (none) ) ;; definition for method 22 of type collide-shape-prim-group ;; INFO: Return type mismatch symbol vs none. -(defmethod on-platform-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) (let ((s3-0 (-> arg0 prim-core collide-as))) - (dotimes (s2-0 (-> obj num-prims)) - (let ((s1-0 (-> obj prims s2-0))) + (dotimes (s2-0 (-> this num-prims)) + (let ((s1-0 (-> this prims s2-0))) (when (and (logtest? (-> s1-0 collide-with) s3-0) (logtest? (-> s1-0 prim-core action) (collide-action rider-plat-sticky)) ) @@ -70,24 +70,24 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch pat-surface vs none. ;; WARN: Function (method 22 collide-shape-prim-mesh) has a return type of none, but the expression builder found a return statement. -(defmethod on-platform-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) +(defmethod on-platform-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-overlap-result) (arg2 float)) (case (-> arg0 type) ((collide-shape-prim-group) - (let ((s3-0 (-> obj collide-with))) + (let ((s3-0 (-> this collide-with))) (dotimes (s2-0 (-> (the-as collide-shape-prim-group arg0) num-prims)) (let ((s1-0 (-> (the-as collide-shape-prim-group arg0) prims s2-0))) (when (and (logtest? s3-0 (-> s1-0 prim-core collide-as)) (logtest? (-> s1-0 prim-core action) (collide-action rider-target)) ) - (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> obj prim-core)) (the-as vector (-> s1-0 prim-core))) - (-> obj prim-core world-sphere w) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> this prim-core)) (the-as vector (-> s1-0 prim-core))) + (-> this prim-core world-sphere w) ) (-> s1-0 prim-core world-sphere w) ) ) ) (if (< f0-2 122.88) - (on-platform-test obj s1-0 arg1 f0-2) + (on-platform-test this s1-0 arg1 f0-2) ) ) ) @@ -96,19 +96,19 @@ ) ) ((collide-shape-prim-sphere) - (let ((s3-1 (-> obj mesh))) + (let ((s3-1 (-> this mesh))) (when s3-1 (let ((s2-1 *collide-mesh-cache*)) - (when (!= (-> obj mesh-cache-id) (-> s2-1 id)) + (when (!= (-> this mesh-cache-id) (-> s2-1 id)) (let ((v1-17 (allocate! s2-1 (* (the-as uint 96) (-> s3-1 num-tris))))) (cond (v1-17 - (set! (-> obj mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-17)) - (set! (-> obj mesh-cache-id) (-> s2-1 id)) + (set! (-> this mesh-cache-tris) (the-as (inline-array collide-mesh-cache-tri) v1-17)) + (set! (-> this mesh-cache-id) (-> s2-1 id)) (populate-cache! s3-1 - (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) - (-> obj cshape process node-list data (-> obj transform-index) bone transform) + (the-as collide-mesh-cache-tri (-> this mesh-cache-tris)) + (-> this cshape process node-list data (-> this transform-index) bone transform) ) ) (else @@ -121,7 +121,7 @@ (let* ((s2-2 (new 'stack-no-clear 'collide-tri-result)) (f0-4 (sphere-on-platform-test s3-1 - (the-as collide-mesh-cache-tri (-> obj mesh-cache-tris)) + (the-as collide-mesh-cache-tri (-> this mesh-cache-tris)) s2-2 (the-as vector (-> arg0 prim-core)) (-> arg1 best-dist) @@ -130,7 +130,7 @@ ) (when (< f0-4 (-> arg1 best-dist)) (set! (-> arg1 best-dist) f0-4) - (set! (-> arg1 best-from-prim) obj) + (set! (-> arg1 best-from-prim) this) (set! (-> arg1 best-to-prim) arg0) (set! (-> arg1 best-from-tri vertex 0 quad) (-> s2-2 vertex 0 quad)) (set! (-> arg1 best-from-tri vertex 1 quad) (-> s2-2 vertex 1 quad)) @@ -148,12 +148,12 @@ ) ;; definition for method 9 of type collide-sticky-rider-group -(defmethod add-rider! collide-sticky-rider-group ((obj collide-sticky-rider-group) (arg0 process-drawable)) +(defmethod add-rider! collide-sticky-rider-group ((this collide-sticky-rider-group) (arg0 process-drawable)) (let ((gp-0 (the-as collide-sticky-rider #f))) (cond - ((< (-> obj num-riders) (-> obj allocated-riders)) - (set! gp-0 (-> obj rider (-> obj num-riders))) - (+! (-> obj num-riders) 1) + ((< (-> this num-riders) (-> this allocated-riders)) + (set! gp-0 (-> this rider (-> this num-riders))) + (+! (-> this num-riders) 1) (let ((v1-6 gp-0)) (set! (-> v1-6 rider-handle) (the-as handle arg0)) (set! (-> v1-6 sticky-prim) #f) @@ -168,8 +168,8 @@ ) ;; definition for method 35 of type collide-shape -(defmethod detect-riders! collide-shape ((obj collide-shape)) - (let ((s5-0 (-> obj riders))) +(defmethod detect-riders! collide-shape ((this collide-shape)) + (let ((s5-0 (-> this riders))) (when s5-0 (let* ((v1-0 *collide-mesh-cache*) (a0-1 (-> v1-0 id)) @@ -183,7 +183,7 @@ ) (set! (-> s5-0 num-riders) 0) 0 - (let ((s4-0 (-> obj root-prim collide-with))) + (let ((s4-0 (-> this root-prim collide-with))) (when (logtest? s4-0 (collide-kind target)) (let ((v1-7 (-> *collide-player-list* alive-list next0))) *collide-player-list* @@ -194,17 +194,17 @@ ) (when (logtest? s4-0 (-> v1-8 prim-core collide-as)) (when (and (logtest? (-> v1-8 prim-core action) (collide-action rider-target)) - (!= (-> obj process) (-> (the-as collide-shape s2-0) process)) + (!= (-> this process) (-> (the-as collide-shape s2-0) process)) ) (let ((s1-0 (new 'stack-no-clear 'collide-overlap-result))) - (when (on-platform obj (the-as collide-shape s2-0) s1-0) + (when (on-platform this (the-as collide-shape s2-0) s1-0) (let ((s4-1 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-0) process))))) ) (when s4-1 (let ((a0-11 (-> s1-0 best-from-prim))) (set! (-> s4-1 sticky-prim) a0-11) (let ((s1-1 - (-> (the-as process-drawable (-> obj process)) node-list data (-> a0-11 transform-index) bone transform) + (-> (the-as process-drawable (-> this process)) node-list data (-> a0-11 transform-index) bone transform) ) ) (set! (-> s4-1 prim-ry) (matrix-y-angle s1-1)) @@ -214,10 +214,10 @@ ) ) ) - (send-event (-> obj process) 'ridden s4-1) + (send-event (-> this process) 'ridden s4-1) ) ) - (set! s4-0 (-> obj root-prim collide-with)) + (set! s4-0 (-> this root-prim collide-with)) ) ) ) @@ -241,16 +241,16 @@ ) (when (logtest? s4-0 (-> v1-38 prim-core collide-as)) (when (and (logtest? (-> v1-38 prim-core action) (collide-action rider-target)) - (!= (-> obj process) (-> (the-as collide-shape s2-1) process)) + (!= (-> this process) (-> (the-as collide-shape s2-1) process)) ) (let ((s1-2 (new 'stack-no-clear 'collide-overlap-result))) - (when (on-platform obj (the-as collide-shape s2-1) s1-2) + (when (on-platform this (the-as collide-shape s2-1) s1-2) (let ((s4-2 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-1) process))))) ) (when s4-2 (let ((a0-30 (-> s1-2 best-from-prim))) (set! (-> s4-2 sticky-prim) a0-30) - (let ((s1-3 (-> obj process node-list data (-> a0-30 transform-index) bone transform))) + (let ((s1-3 (-> this process node-list data (-> a0-30 transform-index) bone transform))) (set! (-> s4-2 prim-ry) (matrix-y-angle s1-3)) (let ((s0-1 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s0-1 s1-3) @@ -258,10 +258,10 @@ ) ) ) - (send-event (-> obj process) 'ridden s4-2) + (send-event (-> this process) 'ridden s4-2) ) ) - (set! s4-0 (-> obj root-prim collide-with)) + (set! s4-0 (-> this root-prim collide-with)) ) ) ) @@ -284,16 +284,16 @@ ) (when (logtest? s4-0 (-> v1-67 prim-core collide-as)) (when (and (logtest? (-> v1-67 prim-core action) (collide-action rider-target)) - (!= (-> obj process) (-> (the-as collide-shape s2-2) process)) + (!= (-> this process) (-> (the-as collide-shape s2-2) process)) ) (let ((s1-4 (new 'stack-no-clear 'collide-overlap-result))) - (when (on-platform obj (the-as collide-shape s2-2) s1-4) + (when (on-platform this (the-as collide-shape s2-2) s1-4) (let ((s4-3 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-2) process))))) ) (when s4-3 (let ((a0-49 (-> s1-4 best-from-prim))) (set! (-> s4-3 sticky-prim) a0-49) - (let ((s1-5 (-> obj process node-list data (-> a0-49 transform-index) bone transform))) + (let ((s1-5 (-> this process node-list data (-> a0-49 transform-index) bone transform))) (set! (-> s4-3 prim-ry) (matrix-y-angle s1-5)) (let ((s0-2 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s0-2 s1-5) @@ -301,10 +301,10 @@ ) ) ) - (send-event (-> obj process) 'ridden s4-3) + (send-event (-> this process) 'ridden s4-3) ) ) - (set! s4-0 (-> obj root-prim collide-with)) + (set! s4-0 (-> this root-prim collide-with)) ) ) ) @@ -327,16 +327,16 @@ ) (when (logtest? s4-0 (-> v1-95 prim-core collide-as)) (when (and (logtest? (-> v1-95 prim-core action) (collide-action rider-target)) - (!= (-> obj process) (-> (the-as collide-shape s2-3) process)) + (!= (-> this process) (-> (the-as collide-shape s2-3) process)) ) (let ((s1-6 (new 'stack-no-clear 'collide-overlap-result))) - (when (on-platform obj (the-as collide-shape s2-3) s1-6) + (when (on-platform this (the-as collide-shape s2-3) s1-6) (let ((s4-4 (add-rider! s5-0 (the-as process-drawable (process->handle (-> (the-as collide-shape s2-3) process))))) ) (when s4-4 (let ((a0-68 (-> s1-6 best-from-prim))) (set! (-> s4-4 sticky-prim) a0-68) - (let ((s1-7 (-> obj process node-list data (-> a0-68 transform-index) bone transform))) + (let ((s1-7 (-> this process node-list data (-> a0-68 transform-index) bone transform))) (set! (-> s4-4 prim-ry) (matrix-y-angle s1-7)) (let ((s0-3 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s0-3 s1-7) @@ -344,10 +344,10 @@ ) ) ) - (send-event (-> obj process) 'ridden s4-4) + (send-event (-> this process) 'ridden s4-4) ) ) - (set! s4-0 (-> obj root-prim collide-with)) + (set! s4-0 (-> this root-prim collide-with)) ) ) ) @@ -368,8 +368,8 @@ ) ;; definition for method 44 of type collide-shape -(defmethod pull-riders! collide-shape ((obj collide-shape)) - (let ((s5-0 (-> obj riders))) +(defmethod pull-riders! collide-shape ((this collide-shape)) + (let ((s5-0 (-> this riders))) (when s5-0 (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) (countdown (s3-0 (-> s5-0 num-riders)) @@ -383,14 +383,14 @@ ) (let ((a0-5 (-> v1-2 sticky-prim))) (when a0-5 - (let ((s2-0 (-> obj process node-list data (-> a0-5 transform-index) bone transform))) + (let ((s2-0 (-> this process node-list data (-> a0-5 transform-index) bone transform))) (let ((s1-0 (-> s4-0 rider-dest))) (vector-matrix*! s1-0 (-> v1-2 rider-local-pos) s2-0) (vector-float*! s1-0 s1-0 (/ 1.0 (-> s1-0 w))) ) (set! (-> s4-0 rider-delta-ry) (deg- (matrix-y-angle s2-0) (-> s4-0 rider prim-ry))) ) - (pull-rider! obj s4-0) + (pull-rider! this s4-0) ) ) ) @@ -405,7 +405,7 @@ ;; definition for method 43 of type collide-shape ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod pull-rider! collide-shape ((obj collide-shape) (arg0 pull-rider-info)) +(defmethod pull-rider! collide-shape ((this collide-shape) (arg0 pull-rider-info)) (local-vars (at-0 int) (sv-160 (function collide-shape-moving float collide-kind none))) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -419,9 +419,9 @@ (set! (-> s4-0 quad) (-> gp-0 trans quad)) (vector-! s3-0 (-> arg0 rider-dest) s4-0) (cond - ((logtest? (-> obj root-prim prim-core action) (collide-action rider-plat)) - (let ((s1-0 (-> obj root-prim prim-core collide-as))) - (set! (-> obj root-prim prim-core collide-as) (collide-kind)) + ((logtest? (-> this root-prim prim-core action) (collide-action rider-plat)) + (let ((s1-0 (-> this root-prim prim-core collide-as))) + (set! (-> this root-prim prim-core collide-as) (collide-kind)) (let ((s0-0 gp-0)) (set! sv-160 (method-of-object s0-0 fill-cache-for-shape!)) (let ((a1-3 (+ 8192.0 (vector-length s3-0))) @@ -430,7 +430,7 @@ (sv-160 s0-0 a1-3 a2-0) ) ) - (set! (-> obj root-prim prim-core collide-as) s1-0) + (set! (-> this root-prim prim-core collide-as) s1-0) ) (let ((s2-1 (new 'stack-no-clear 'vector))) (set! (-> s2-1 quad) (-> s3-0 quad)) @@ -466,7 +466,7 @@ (vector-! v1-18 (-> gp-0 trans) s4-0) (vector-float*! (-> gp-0 rider-last-move) v1-18 (-> *display* frames-per-second)) ) - (set! (-> gp-0 rider-time) (-> *display* base-frame-counter)) + (set-time! (-> gp-0 rider-time)) ) ) (let ((f0-4 (-> arg0 rider-delta-ry))) @@ -481,10 +481,10 @@ ;; definition for method 29 of type collide-shape ;; INFO: Return type mismatch object vs none. -(defmethod alloc-riders collide-shape ((obj collide-shape) (arg0 int)) - (if (-> obj riders) +(defmethod alloc-riders collide-shape ((this collide-shape) (arg0 int)) + (if (-> this riders) (format 0 "ERROR: colide-shape::alloc-riders is being called multiple times!~%") - (set! (-> obj riders) (new 'process 'collide-sticky-rider-group arg0)) + (set! (-> this riders) (new 'process 'collide-sticky-rider-group arg0)) ) (none) ) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-target-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-target-h_REF.gc index 8658446bd6..30801379fa 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-target-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-target-h_REF.gc @@ -23,19 +23,19 @@ ) ;; definition for method 3 of type collide-history -(defmethod inspect collide-history ((obj collide-history)) - (format #t "[~8x] ~A~%" obj 'collide-history) - (format #t "~Tintersect: ~`vector`P~%" (-> obj intersect)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Ttransv: ~`vector`P~%" (-> obj transv)) - (format #t "~Ttransv-out: ~`vector`P~%" (-> obj transv-out)) - (format #t "~Tlocal-normal: ~`vector`P~%" (-> obj local-normal)) - (format #t "~Tsurface-normal: ~`vector`P~%" (-> obj surface-normal)) - (format #t "~Ttime: ~D~%" (-> obj time)) - (format #t "~Tstatus: ~D~%" (-> obj status)) - (format #t "~Tpat: ~D~%" (-> obj pat)) - (format #t "~Treaction-flag: ~D~%" (-> obj reaction-flag)) - obj +(defmethod inspect collide-history ((this collide-history)) + (format #t "[~8x] ~A~%" this 'collide-history) + (format #t "~Tintersect: ~`vector`P~%" (-> this intersect)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Ttransv: ~`vector`P~%" (-> this transv)) + (format #t "~Ttransv-out: ~`vector`P~%" (-> this transv-out)) + (format #t "~Tlocal-normal: ~`vector`P~%" (-> this local-normal)) + (format #t "~Tsurface-normal: ~`vector`P~%" (-> this surface-normal)) + (format #t "~Ttime: ~D~%" (-> this time)) + (format #t "~Tstatus: ~D~%" (-> this status)) + (format #t "~Tpat: ~D~%" (-> this pat)) + (format #t "~Treaction-flag: ~D~%" (-> this reaction-flag)) + this ) ;; definition of type control-info @@ -208,16 +208,16 @@ ;; definition for method 9 of type collide-history ;; INFO: Used lq/sq -(defmethod update! collide-history ((obj collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector)) - (set! (-> obj intersect quad) (-> xs quad)) - (set! (-> obj transv quad) (-> transv quad)) - (set! (-> obj transv-out quad) (-> transv-out quad)) - (set! (-> obj trans quad) (-> cshape trans quad)) - (set! (-> obj local-normal quad) (-> cshape local-normal quad)) - (set! (-> obj surface-normal quad) (-> cshape surface-normal quad)) - (set! (-> obj time) (-> *display* base-frame-counter)) - (set! (-> obj status) (-> cshape status)) - (set! (-> obj reaction-flag) (-> cshape reaction-flag)) - (set! (-> obj pat) (-> cshape cur-pat)) - obj +(defmethod update! collide-history ((this collide-history) (cshape collide-shape-moving) (xs vector) (transv vector) (transv-out vector)) + (set! (-> this intersect quad) (-> xs quad)) + (set! (-> this transv quad) (-> transv quad)) + (set! (-> this transv-out quad) (-> transv-out quad)) + (set! (-> this trans quad) (-> cshape trans quad)) + (set! (-> this local-normal quad) (-> cshape local-normal quad)) + (set! (-> this surface-normal quad) (-> cshape surface-normal quad)) + (set-time! (-> this time)) + (set! (-> this status) (-> cshape status)) + (set! (-> this reaction-flag) (-> cshape reaction-flag)) + (set! (-> this pat) (-> cshape cur-pat)) + this ) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-touch-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-touch-h_REF.gc index e816e560c7..fd90455500 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-touch-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-touch-h_REF.gc @@ -13,12 +13,12 @@ ) ;; definition for method 3 of type touching-prim -(defmethod inspect touching-prim ((obj touching-prim)) - (format #t "[~8x] ~A~%" obj 'touching-prim) - (format #t "~Tcprim: ~A~%" (-> obj cprim)) - (format #t "~Thas-tri?: ~A~%" (-> obj has-tri?)) - (format #t "~Ttri: #~%" (-> obj tri)) - obj +(defmethod inspect touching-prim ((this touching-prim)) + (format #t "[~8x] ~A~%" this 'touching-prim) + (format #t "~Tcprim: ~A~%" (-> this cprim)) + (format #t "~Thas-tri?: ~A~%" (-> this has-tri?)) + (format #t "~Ttri: #~%" (-> this tri)) + this ) ;; definition of type touching-prims-entry @@ -42,15 +42,15 @@ ) ;; definition for method 3 of type touching-prims-entry -(defmethod inspect touching-prims-entry ((obj touching-prims-entry)) - (format #t "[~8x] ~A~%" obj 'touching-prims-entry) - (format #t "~Tnext: #~%" (-> obj next)) - (format #t "~Tprev: #~%" (-> obj prev)) - (format #t "~Tallocated?: ~A~%" (-> obj allocated?)) - (format #t "~Tu: ~f~%" (-> obj u)) - (format #t "~Tprim1: #~%" (-> obj prim1)) - (format #t "~Tprim2: #~%" (-> obj prim2)) - obj +(defmethod inspect touching-prims-entry ((this touching-prims-entry)) + (format #t "[~8x] ~A~%" this 'touching-prims-entry) + (format #t "~Tnext: #~%" (-> this next)) + (format #t "~Tprev: #~%" (-> this prev)) + (format #t "~Tallocated?: ~A~%" (-> this allocated?)) + (format #t "~Tu: ~f~%" (-> this u)) + (format #t "~Tprim1: #~%" (-> this prim1)) + (format #t "~Tprim2: #~%" (-> this prim2)) + this ) ;; definition of type touching-prims-entry-pool @@ -71,19 +71,19 @@ ) ;; definition for method 3 of type touching-prims-entry-pool -(defmethod inspect touching-prims-entry-pool ((obj touching-prims-entry-pool)) - (format #t "[~8x] ~A~%" obj 'touching-prims-entry-pool) - (format #t "~Thead: #~%" (-> obj head)) - (format #t "~Tnodes[64] @ #x~X~%" (-> obj nodes)) - obj +(defmethod inspect touching-prims-entry-pool ((this touching-prims-entry-pool)) + (format #t "[~8x] ~A~%" this 'touching-prims-entry-pool) + (format #t "~Thead: #~%" (-> this head)) + (format #t "~Tnodes[64] @ #x~X~%" (-> this nodes)) + this ) ;; definition for method 11 of type touching-prims-entry-pool ;; INFO: Return type mismatch symbol vs none. -(defmethod init-list! touching-prims-entry-pool ((obj touching-prims-entry-pool)) +(defmethod init-list! touching-prims-entry-pool ((this touching-prims-entry-pool)) (let ((prev (the-as touching-prims-entry #f))) - (let ((current (the-as touching-prims-entry (-> obj nodes)))) - (set! (-> obj head) current) + (let ((current (the-as touching-prims-entry (-> this nodes)))) + (set! (-> this head) current) (countdown (a0-1 64) (set! (-> current prev) prev) (let ((next (&+ current 240))) @@ -138,13 +138,13 @@ ) ;; definition for method 3 of type touching-shapes-entry -(defmethod inspect touching-shapes-entry ((obj touching-shapes-entry)) - (format #t "[~8x] ~A~%" obj 'touching-shapes-entry) - (format #t "~Tcshape1: ~A~%" (-> obj cshape1)) - (format #t "~Tcshape2: ~A~%" (-> obj cshape2)) - (format #t "~Tresolve-u: ~D~%" (-> obj resolve-u)) - (format #t "~Thead: #~%" (-> obj head)) - obj +(defmethod inspect touching-shapes-entry ((this touching-shapes-entry)) + (format #t "[~8x] ~A~%" this 'touching-shapes-entry) + (format #t "~Tcshape1: ~A~%" (-> this cshape1)) + (format #t "~Tcshape2: ~A~%" (-> this cshape2)) + (format #t "~Tresolve-u: ~D~%" (-> this resolve-u)) + (format #t "~Thead: #~%" (-> this head)) + this ) ;; definition of type touching-list @@ -168,12 +168,12 @@ ) ;; definition for method 3 of type touching-list -(defmethod inspect touching-list ((obj touching-list)) - (format #t "[~8x] ~A~%" obj 'touching-list) - (format #t "~Tnum-touching-shapes: ~D~%" (-> obj num-touching-shapes)) - (format #t "~Tresolve-u: ~D~%" (-> obj resolve-u)) - (format #t "~Ttouching-shapes[32] @ #x~X~%" (-> obj touching-shapes)) - obj +(defmethod inspect touching-list ((this touching-list)) + (format #t "[~8x] ~A~%" this 'touching-list) + (format #t "~Tnum-touching-shapes: ~D~%" (-> this num-touching-shapes)) + (format #t "~Tresolve-u: ~D~%" (-> this resolve-u)) + (format #t "~Ttouching-shapes[32] @ #x~X~%" (-> this touching-shapes)) + this ) ;; definition for method 0 of type touching-list @@ -183,21 +183,21 @@ (v1-1 type-to-make) ) (-> type-to-make size) - (let ((obj (the-as touching-list (t9-0 allocation v1-1)))) - (set! (-> obj num-touching-shapes) 0) - (set! (-> obj resolve-u) 0) - obj + (let ((this (the-as touching-list (t9-0 allocation v1-1)))) + (set! (-> this num-touching-shapes) 0) + (set! (-> this resolve-u) 0) + this ) ) ) ;; definition for method 16 of type touching-shapes-entry -(defmethod get-head touching-shapes-entry ((obj touching-shapes-entry)) - (-> obj head) +(defmethod get-head touching-shapes-entry ((this touching-shapes-entry)) + (-> this head) ) ;; definition for method 17 of type touching-shapes-entry -(defmethod get-next touching-shapes-entry ((obj touching-shapes-entry) (arg0 touching-prims-entry)) +(defmethod get-next touching-shapes-entry ((this touching-shapes-entry) (arg0 touching-prims-entry)) (-> arg0 next) ) diff --git a/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc index 7ffd9eb4d2..c86284463a 100644 --- a/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/collide-touch_REF.gc @@ -2,9 +2,9 @@ (in-package goal) ;; definition for method 10 of type touching-prims-entry-pool -(defmethod get-free-node-count touching-prims-entry-pool ((obj touching-prims-entry-pool)) +(defmethod get-free-node-count touching-prims-entry-pool ((this touching-prims-entry-pool)) (let ((v0-0 0)) - (let ((v1-0 (-> obj head))) + (let ((v1-0 (-> this head))) (while v1-0 (+! v0-0 1) (set! v1-0 (-> v1-0 next)) @@ -18,12 +18,12 @@ ) ;; definition for method 9 of type touching-prims-entry-pool -(defmethod alloc-node touching-prims-entry-pool ((obj touching-prims-entry-pool)) - (let ((gp-0 (-> obj head))) +(defmethod alloc-node touching-prims-entry-pool ((this touching-prims-entry-pool)) + (let ((gp-0 (-> this head))) (cond (gp-0 (let ((v1-0 (-> gp-0 next))) - (set! (-> obj head) v1-0) + (set! (-> this head) v1-0) (if v1-0 (set! (-> v1-0 prev) #f) ) @@ -41,13 +41,13 @@ ) ;; definition for method 12 of type touching-prims-entry-pool -(defmethod free-node touching-prims-entry-pool ((obj touching-prims-entry-pool) (arg0 touching-prims-entry)) +(defmethod free-node touching-prims-entry-pool ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) (when (-> arg0 allocated?) (set! (-> arg0 allocated?) #f) - (let ((v1-1 (-> obj head))) + (let ((v1-1 (-> this head))) (set! (-> arg0 next) v1-1) (set! (-> arg0 prev) #f) - (set! (-> obj head) arg0) + (set! (-> this head) arg0) (when v1-1 (set! (-> v1-1 prev) arg0) arg0 @@ -57,12 +57,12 @@ ) ;; definition for method 15 of type touching-shapes-entry -(defmethod free-touching-prims-list touching-shapes-entry ((obj touching-shapes-entry)) - (when (-> obj cshape1) - (set! (-> obj cshape1) #f) - (let ((gp-0 (-> obj head))) +(defmethod free-touching-prims-list touching-shapes-entry ((this touching-shapes-entry)) + (when (-> this cshape1) + (set! (-> this cshape1) #f) + (let ((gp-0 (-> this head))) (when gp-0 - (set! (-> obj head) #f) + (set! (-> this head) #f) (let ((s5-0 *touching-prims-entry-pool*)) (while gp-0 (let ((a1-0 gp-0)) @@ -79,25 +79,25 @@ ;; definition for method 14 of type touching-list ;; INFO: Return type mismatch int vs none. -(defmethod free-all-prim-nodes touching-list ((obj touching-list)) - (let ((s5-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (s4-0 (-> obj num-touching-shapes)) +(defmethod free-all-prim-nodes touching-list ((this touching-list)) + (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) (free-touching-prims-list s5-0) (&+! s5-0 16) ) ) - (set! (-> obj num-touching-shapes) 0) - (set! (-> obj resolve-u) 0) + (set! (-> this num-touching-shapes) 0) + (set! (-> this resolve-u) 0) 0 (none) ) ;; definition for method 13 of type touching-list ;; INFO: Return type mismatch object vs touching-shapes-entry. -(defmethod get-shapes-entry touching-list ((obj touching-list) (arg0 collide-shape) (arg1 collide-shape)) - (let ((v0-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) +(defmethod get-shapes-entry touching-list ((this touching-list) (arg0 collide-shape) (arg1 collide-shape)) + (let ((v0-0 (the-as touching-shapes-entry (-> this touching-shapes)))) (let ((v1-0 (the-as touching-shapes-entry #f))) - (countdown (a3-0 (-> obj num-touching-shapes)) + (countdown (a3-0 (-> this num-touching-shapes)) (let ((t0-0 (-> v0-0 cshape1))) (set! v1-0 (cond @@ -120,11 +120,11 @@ (set! v0-0 v1-0) ) (else - (when (>= (-> obj num-touching-shapes) 32) + (when (>= (-> this num-touching-shapes) 32) (format 0 "ERROR: touching-list::get-shapes-entry() failed!~%") (return (the-as touching-shapes-entry #f)) ) - (+! (-> obj num-touching-shapes) 1) + (+! (-> this num-touching-shapes) 1) ) ) ) @@ -132,7 +132,7 @@ (set! (-> v0-0 cshape2) arg1) (set! (-> v0-0 head) #f) (set! (-> v0-0 resolve-u) 1) - (set! (-> obj resolve-u) 1) + (set! (-> this resolve-u) 1) (the-as touching-shapes-entry v0-0) ) ) @@ -148,17 +148,17 @@ ) ;; definition for method 3 of type add-prims-touching-work -(defmethod inspect add-prims-touching-work ((obj add-prims-touching-work)) - (format #t "[~8x] ~A~%" obj 'add-prims-touching-work) - (format #t "~Ttri1: #~%" (-> obj tri1)) - (format #t "~Ttri2: #~%" (-> obj tri2)) - obj +(defmethod inspect add-prims-touching-work ((this add-prims-touching-work)) + (format #t "[~8x] ~A~%" this 'add-prims-touching-work) + (format #t "~Ttri1: #~%" (-> this tri1)) + (format #t "~Ttri2: #~%" (-> this tri2)) + this ) ;; definition for method 9 of type touching-list ;; INFO: Return type mismatch int vs none. ;; WARN: Function (method 9 touching-list) has a return type of none, but the expression builder found a return statement. -(defmethod add-touching-prims touching-list ((obj touching-list) +(defmethod add-touching-prims touching-list ((this touching-list) (arg0 collide-shape-prim) (arg1 collide-shape-prim) (arg2 float) @@ -168,7 +168,7 @@ (let ((gp-0 (new 'stack-no-clear 'add-prims-touching-work))) (set! (-> gp-0 tri1) arg3) (set! (-> gp-0 tri2) arg4) - (let ((s2-0 (get-shapes-entry obj (-> arg0 cshape) (-> arg1 cshape)))) + (let ((s2-0 (get-shapes-entry this (-> arg0 cshape) (-> arg1 cshape)))) (when s2-0 (when (= (-> s2-0 cshape1) (-> arg1 cshape)) (let ((v1-4 arg0)) @@ -226,7 +226,7 @@ (set! (-> s0-1 u) arg2) (when (>= arg2 0.0) (set! (-> s2-0 resolve-u) 1) - (set! (-> obj resolve-u) 1) + (set! (-> this resolve-u) 1) ) (let ((v1-26 (-> s0-1 prim1)) (a1-4 (-> gp-0 tri1)) @@ -267,11 +267,11 @@ ;; definition for method 11 of type touching-list ;; INFO: Return type mismatch int vs none. -(defmethod update-from-step-size touching-list ((obj touching-list) (arg0 float)) - (when (nonzero? (-> obj resolve-u)) - (set! (-> obj resolve-u) 0) - (let ((s5-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (s4-0 (-> obj num-touching-shapes)) +(defmethod update-from-step-size touching-list ((this touching-list) (arg0 float)) + (when (nonzero? (-> this resolve-u)) + (set! (-> this resolve-u) 0) + (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) (when (nonzero? (-> s5-0 resolve-u)) (set! (-> s5-0 resolve-u) 0) (when (-> s5-0 cshape1) @@ -328,9 +328,9 @@ ;; definition for method 12 of type touching-list ;; INFO: Return type mismatch int vs none. -(defmethod send-events-for-touching-shapes touching-list ((obj touching-list)) - (let ((entry (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (i (-> obj num-touching-shapes)) +(defmethod send-events-for-touching-shapes touching-list ((this touching-list)) + (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (i (-> this num-touching-shapes)) (let ((c1 (-> entry cshape1))) (when c1 (let ((c2 (-> entry cshape2))) @@ -371,10 +371,10 @@ ) ;; definition for method 12 of type touching-shapes-entry -(defmethod prims-touching? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape-moving) (arg1 uint)) +(defmethod prims-touching? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape-moving) (arg1 uint)) (cond - ((= (-> obj cshape1) arg0) - (let ((v1-1 (-> obj head))) + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) (while v1-1 (if (logtest? (-> v1-1 prim1 cprim prim-id) arg1) (return v1-1) @@ -383,8 +383,8 @@ ) ) ) - ((= (-> obj cshape2) arg0) - (let ((v1-4 (-> obj head))) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) (while v1-4 (if (logtest? (-> v1-4 prim2 cprim prim-id) arg1) (return v1-4) @@ -401,10 +401,10 @@ ) ;; definition for method 13 of type touching-shapes-entry -(defmethod prims-touching-action? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) +(defmethod prims-touching-action? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) (cond - ((= (-> obj cshape1) arg0) - (let ((v1-1 (-> obj head))) + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) (while v1-1 (let ((a0-1 (-> v1-1 prim1 cprim))) (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) @@ -415,8 +415,8 @@ ) ) ) - ((= (-> obj cshape2) arg0) - (let ((v1-4 (-> obj head))) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) (while v1-4 (let ((a0-5 (-> v1-4 prim2 cprim))) (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) @@ -435,44 +435,44 @@ ) ;; definition for method 10 of type touching-shapes-entry -(defmethod get-touched-shape touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape)) +(defmethod get-touched-shape touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape)) (cond - ((= (-> obj cshape1) arg0) - (return (-> obj cshape2)) + ((= (-> this cshape1) arg0) + (return (-> this cshape2)) ) - ((= (-> obj cshape2) arg0) - (return (-> obj cshape1)) + ((= (-> this cshape2) arg0) + (return (-> this cshape1)) ) ) (the-as collide-shape #f) ) ;; definition for method 9 of type touching-prims-entry -(defmethod get-touched-prim touching-prims-entry ((obj touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry)) +(defmethod get-touched-prim touching-prims-entry ((this touching-prims-entry) (arg0 trsqv) (arg1 touching-shapes-entry)) (cond ((= (-> arg1 cshape1) arg0) - (return (-> obj prim1 cprim)) + (return (-> this prim1 cprim)) ) ((= (-> arg1 cshape2) arg0) - (return (-> obj prim2 cprim)) + (return (-> this prim2 cprim)) ) ) (the-as collide-shape-prim #f) ) ;; definition for method 12 of type touching-prims-entry -(defmethod get-touched-tri touching-prims-entry ((obj touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-tri touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) (let ((v0-0 (the-as collide-tri-result #f))) (cond ((= (-> arg1 cshape1) arg0) - (let ((v1-2 (-> obj prim1))) + (let ((v1-2 (-> this prim1))) (if (-> v1-2 has-tri?) (set! v0-0 (-> v1-2 tri)) ) ) ) ((= (-> arg1 cshape2) arg0) - (let ((v1-5 (-> obj prim2))) + (let ((v1-5 (-> this prim2))) (if (-> v1-5 has-tri?) (set! v0-0 (-> v1-5 tri)) ) @@ -484,9 +484,9 @@ ) ;; definition for method 11 of type touching-prims-entry -(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((obj touching-prims-entry) (arg0 vector)) - (let* ((s4-0 (-> obj prim1 cprim)) - (s3-0 (-> obj prim2 cprim)) +(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((this touching-prims-entry) (arg0 vector)) + (let* ((s4-0 (-> this prim1 cprim)) + (s3-0 (-> this prim2 cprim)) (gp-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> s3-0 prim-core)) diff --git a/test/decompiler/reference/jak1/engine/collide/pat-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/pat-h_REF.gc index 0e3e62fad2..ab8fc3dbf6 100644 --- a/test/decompiler/reference/jak1/engine/collide/pat-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/pat-h_REF.gc @@ -20,18 +20,18 @@ ) ;; definition for method 3 of type pat-surface -(defmethod inspect pat-surface ((obj pat-surface)) - (format #t "[~8x] ~A~%" obj 'pat-surface) - (format #t "~Tskip: ~D~%" (-> obj skip)) - (format #t "~Tmode: ~D~%" (-> obj mode)) - (format #t "~Tmaterial: ~D~%" (-> obj material)) - (format #t "~Tcamera: ~D~%" (-> obj camera)) - (format #t "~Tevent: ~D~%" (-> obj event)) - (format #t "~Tnoentity: ~D~%" (-> obj noentity)) - (format #t "~Tnocamera: ~D~%" (-> obj nocamera)) - (format #t "~Tnoedge: ~D~%" (-> obj noedge)) - (format #t "~Tnolineofsight: ~D~%" (-> obj nolineofsight)) - obj +(defmethod inspect pat-surface ((this pat-surface)) + (format #t "[~8x] ~A~%" this 'pat-surface) + (format #t "~Tskip: ~D~%" (-> this skip)) + (format #t "~Tmode: ~D~%" (-> this mode)) + (format #t "~Tmaterial: ~D~%" (-> this material)) + (format #t "~Tcamera: ~D~%" (-> this camera)) + (format #t "~Tevent: ~D~%" (-> this event)) + (format #t "~Tnoentity: ~D~%" (-> this noentity)) + (format #t "~Tnocamera: ~D~%" (-> this nocamera)) + (format #t "~Tnoedge: ~D~%" (-> this noedge)) + (format #t "~Tnolineofsight: ~D~%" (-> this nolineofsight)) + this ) ;; definition (debug) for function pat-material->string @@ -173,13 +173,13 @@ ) ;; definition for method 3 of type pat-mode-info -(defmethod inspect pat-mode-info ((obj pat-mode-info)) - (format #t "[~8x] ~A~%" obj 'pat-mode-info) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Twall-angle: ~f~%" (-> obj wall-angle)) - (format #t "~Tcolor: ~D~%" (-> obj color)) - (format #t "~Thilite-color: ~D~%" (-> obj hilite-color)) - obj +(defmethod inspect pat-mode-info ((this pat-mode-info)) + (format #t "[~8x] ~A~%" this 'pat-mode-info) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Twall-angle: ~f~%" (-> this wall-angle)) + (format #t "~Tcolor: ~D~%" (-> this color)) + (format #t "~Thilite-color: ~D~%" (-> this hilite-color)) + this ) ;; definition for symbol *pat-mode-info*, type (inline-array pat-mode-info) diff --git a/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc b/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc index 85765ddc03..dc4faa2b7e 100644 --- a/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/collide/surface-h_REF.gc @@ -42,41 +42,41 @@ ) ;; definition for method 3 of type surface -(defmethod inspect surface ((obj surface)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tdata[30] @ #x~X~%" (&-> obj turnv)) - (format #t "~Tturnv: ~f~%" (-> obj turnv)) - (format #t "~Tturnvv: ~f~%" (-> obj turnvv)) - (format #t "~Ttiltv: ~f~%" (-> obj tiltv)) - (format #t "~Ttiltvv: ~f~%" (-> obj tiltvv)) - (format #t "~Ttransv-max: ~f~%" (-> obj transv-max)) - (format #t "~Ttarget-speed: ~f~%" (-> obj target-speed)) - (format #t "~Tseek0: ~f~%" (-> obj seek0)) - (format #t "~Tseek90: ~f~%" (-> obj seek90)) - (format #t "~Tseek180: ~f~%" (-> obj seek180)) - (format #t "~Tfric: ~f~%" (-> obj fric)) - (format #t "~Tnonlin-fric-dist: ~f~%" (-> obj nonlin-fric-dist)) - (format #t "~Tslip-factor: ~f~%" (-> obj slip-factor)) - (format #t "~Tslide-factor: ~f~%" (-> obj slide-factor)) - (format #t "~Tslope-up-factor: ~f~%" (-> obj slope-up-factor)) - (format #t "~Tslope-down-factor: ~f~%" (-> obj slope-down-factor)) - (format #t "~Tslope-slip-angle: ~f~%" (-> obj slope-slip-angle)) - (format #t "~Timpact-fric: ~f~%" (-> obj impact-fric)) - (format #t "~Tbend-factor: ~f~%" (-> obj bend-factor)) - (format #t "~Tbend-speed: ~f~%" (-> obj bend-speed)) - (format #t "~Talignv: ~f~%" (-> obj alignv)) - (format #t "~Tslope-up-traction: ~f~%" (-> obj slope-up-traction)) - (format #t "~Talign-speed: ~f~%" (-> obj align-speed)) - (format #t "~Thook[4] @ #x~X~%" (&-> obj active-hook)) - (format #t "~Tactive-hook: ~A~%" (-> obj active-hook)) - (format #t "~Ttouch-hook: ~A~%" (-> obj touch-hook)) - (format #t "~Timpact-hook: ~A~%" (-> obj impact-hook)) - (format #t "~Tmult-hook: ~A~%" (-> obj mult-hook)) - (format #t "~Tdataw[2] @ #x~X~%" (&-> obj mode)) - (format #t "~Tmode: ~A~%" (-> obj mode)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - obj +(defmethod inspect surface ((this surface)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tdata[30] @ #x~X~%" (&-> this turnv)) + (format #t "~Tturnv: ~f~%" (-> this turnv)) + (format #t "~Tturnvv: ~f~%" (-> this turnvv)) + (format #t "~Ttiltv: ~f~%" (-> this tiltv)) + (format #t "~Ttiltvv: ~f~%" (-> this tiltvv)) + (format #t "~Ttransv-max: ~f~%" (-> this transv-max)) + (format #t "~Ttarget-speed: ~f~%" (-> this target-speed)) + (format #t "~Tseek0: ~f~%" (-> this seek0)) + (format #t "~Tseek90: ~f~%" (-> this seek90)) + (format #t "~Tseek180: ~f~%" (-> this seek180)) + (format #t "~Tfric: ~f~%" (-> this fric)) + (format #t "~Tnonlin-fric-dist: ~f~%" (-> this nonlin-fric-dist)) + (format #t "~Tslip-factor: ~f~%" (-> this slip-factor)) + (format #t "~Tslide-factor: ~f~%" (-> this slide-factor)) + (format #t "~Tslope-up-factor: ~f~%" (-> this slope-up-factor)) + (format #t "~Tslope-down-factor: ~f~%" (-> this slope-down-factor)) + (format #t "~Tslope-slip-angle: ~f~%" (-> this slope-slip-angle)) + (format #t "~Timpact-fric: ~f~%" (-> this impact-fric)) + (format #t "~Tbend-factor: ~f~%" (-> this bend-factor)) + (format #t "~Tbend-speed: ~f~%" (-> this bend-speed)) + (format #t "~Talignv: ~f~%" (-> this alignv)) + (format #t "~Tslope-up-traction: ~f~%" (-> this slope-up-traction)) + (format #t "~Talign-speed: ~f~%" (-> this align-speed)) + (format #t "~Thook[4] @ #x~X~%" (&-> this active-hook)) + (format #t "~Tactive-hook: ~A~%" (-> this active-hook)) + (format #t "~Ttouch-hook: ~A~%" (-> this touch-hook)) + (format #t "~Timpact-hook: ~A~%" (-> this impact-hook)) + (format #t "~Tmult-hook: ~A~%" (-> this mult-hook)) + (format #t "~Tdataw[2] @ #x~X~%" (&-> this mode)) + (format #t "~Tmode: ~A~%" (-> this mode)) + (format #t "~Tflags: ~D~%" (-> this flags)) + this ) ;; definition for function calc-terminal-vel @@ -99,18 +99,18 @@ ) ;; definition for method 2 of type surface -(defmethod print surface ((obj surface)) +(defmethod print surface ((this surface)) (format #t "# obj turnv) - (-> obj turnvv) - (-> obj tiltv) - (-> obj tiltvv) - (-> obj transv-max) + (-> this turnv) + (-> this turnvv) + (-> this tiltv) + (-> this tiltvv) + (-> this transv-max) ) - (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> obj target-speed) (-> obj seek0) (-> obj seek90) obj) - obj + (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> this target-speed) (-> this seek0) (-> this seek90) this) + this ) ;; definition for function surface-interp! diff --git a/test/decompiler/reference/jak1/engine/common-obs/babak_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/babak_REF.gc index 51a9e032f7..bccb0e0ee3 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/babak_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/babak_REF.gc @@ -14,11 +14,11 @@ ) ;; definition for method 3 of type babak -(defmethod inspect babak ((obj babak)) +(defmethod inspect babak ((this babak)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -250,8 +250,8 @@ ;; definition for method 47 of type babak ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision babak ((obj babak)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision babak ((this babak)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -291,7 +291,7 @@ (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -299,30 +299,30 @@ ;; definition for method 48 of type babak ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 babak ((obj babak)) - (initialize-skeleton obj *babak-sg* '()) - (init-defaults! obj *babak-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 babak ((this babak)) + (initialize-skeleton this *babak-sg* '()) + (init-defaults! this *babak-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) ;; definition for method 59 of type babak ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-59 babak ((obj babak)) +(defmethod nav-enemy-method-59 babak ((this babak)) (cond - ((and (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (logtest? (-> obj enemy-info options) (fact-options has-power-cell)) + ((and (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (logtest? (-> this enemy-info options) (fact-options has-power-cell)) ) - (go (method-of-object obj nav-enemy-fuel-cell)) + (go (method-of-object this nav-enemy-fuel-cell)) ) - ((logtest? (-> obj enemy-info options) (fact-options fop5)) - (go (method-of-object obj nav-enemy-wait-for-cue)) + ((logtest? (-> this enemy-info options) (fact-options fop5)) + (go (method-of-object this nav-enemy-wait-for-cue)) ) (else - (go (method-of-object obj nav-enemy-idle)) + (go (method-of-object this nav-enemy-idle)) ) ) 0 diff --git a/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc index a8cdf86278..690469502f 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/basebutton_REF.gc @@ -39,24 +39,24 @@ ) ;; definition for method 3 of type basebutton -(defmethod inspect basebutton ((obj basebutton)) +(defmethod inspect basebutton ((this basebutton)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdown?: ~A~%" (-> obj down?)) - (format #t "~T~Tspawned-by-other?: ~A~%" (-> obj spawned-by-other?)) - (format #t "~T~Tmove-to?: ~A~%" (-> obj move-to?)) - (format #t "~T~Tnotify-actor: ~A~%" (-> obj notify-actor)) - (format #t "~T~Ttimeout: ~f~%" (-> obj timeout)) - (format #t "~T~Tbutton-id: ~D~%" (-> obj button-id)) - (format #t "~T~Tevent-going-down: ~A~%" (-> obj event-going-down)) - (format #t "~T~Tevent-down: ~A~%" (-> obj event-down)) - (format #t "~T~Tevent-going-up: ~A~%" (-> obj event-going-up)) - (format #t "~T~Tevent-up: ~A~%" (-> obj event-up)) - (format #t "~T~Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~T~Tmove-to-pos: #~%" (-> obj move-to-pos)) - (format #t "~T~Tmove-to-quat: #~%" (-> obj move-to-quat)) - obj + (format #t "~T~Tdown?: ~A~%" (-> this down?)) + (format #t "~T~Tspawned-by-other?: ~A~%" (-> this spawned-by-other?)) + (format #t "~T~Tmove-to?: ~A~%" (-> this move-to?)) + (format #t "~T~Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~T~Ttimeout: ~f~%" (-> this timeout)) + (format #t "~T~Tbutton-id: ~D~%" (-> this button-id)) + (format #t "~T~Tevent-going-down: ~A~%" (-> this event-going-down)) + (format #t "~T~Tevent-down: ~A~%" (-> this event-down)) + (format #t "~T~Tevent-going-up: ~A~%" (-> this event-going-up)) + (format #t "~T~Tevent-up: ~A~%" (-> this event-up)) + (format #t "~T~Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~T~Tmove-to-pos: #~%" (-> this move-to-pos)) + (format #t "~T~Tmove-to-quat: #~%" (-> this move-to-quat)) + this ) ;; failed to figure out what this is: @@ -67,15 +67,15 @@ ;; definition for method 30 of type basebutton ;; INFO: Used lq/sq -(defmethod move-to-vec-or-quat! basebutton ((obj basebutton) (arg0 vector) (arg1 quaternion)) - (set! (-> obj move-to?) #t) +(defmethod move-to-vec-or-quat! basebutton ((this basebutton) (arg0 vector) (arg1 quaternion)) + (set! (-> this move-to?) #t) (if arg0 - (set! (-> obj move-to-pos quad) (-> arg0 quad)) - (set! (-> obj move-to-pos quad) (-> obj root-override trans quad)) + (set! (-> this move-to-pos quad) (-> arg0 quad)) + (set! (-> this move-to-pos quad) (-> this root-override trans quad)) ) (if arg1 - (quaternion-copy! (-> obj move-to-quat) arg1) - (quaternion-copy! (-> obj move-to-quat) (-> obj root-override quat)) + (quaternion-copy! (-> this move-to-quat) arg1) + (quaternion-copy! (-> this move-to-quat) (-> this root-override quat)) ) ) @@ -192,13 +192,13 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (cond ((= (-> self timeout) 0.0) (anim-loop) ) (else - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self timeout)))) + (until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout)))) (suspend) ) (basebutton-method-29 self (-> self event-going-up) (-> self notify-actor)) @@ -255,17 +255,17 @@ ) ;; definition for method 31 of type basebutton -(defmethod press! basebutton ((obj basebutton) (arg0 symbol)) - (set! (-> obj down?) arg0) +(defmethod press! basebutton ((this basebutton) (arg0 symbol)) + (set! (-> this down?) arg0) (cond (arg0 - (if (not (-> obj spawned-by-other?)) - (process-entity-status! obj (entity-perm-status complete) #t) + (if (not (-> this spawned-by-other?)) + (process-entity-status! this (entity-perm-status complete) #t) ) ) (else - (if (not (-> obj spawned-by-other?)) - (process-entity-status! obj (entity-perm-status complete) #f) + (if (not (-> this spawned-by-other?)) + (process-entity-status! this (entity-perm-status complete) #f) ) ) ) @@ -273,7 +273,7 @@ ;; definition for method 29 of type basebutton ;; INFO: Return type mismatch object vs none. -(defmethod basebutton-method-29 basebutton ((obj basebutton) (arg0 symbol) (arg1 entity)) +(defmethod basebutton-method-29 basebutton ((this basebutton) (arg0 symbol) (arg1 entity)) (with-pp (when arg0 (cond @@ -293,8 +293,8 @@ ) ) (else - (if (nonzero? (-> obj link)) - (send-to-all (-> obj link) arg0) + (if (nonzero? (-> this link)) + (send-to-all (-> this link) arg0) ) ) ) @@ -304,65 +304,65 @@ ) ;; definition for method 25 of type basebutton -(defmethod reset! basebutton ((obj basebutton)) - (set! (-> obj down?) #f) - (set! (-> obj spawned-by-other?) #t) - (set! (-> obj move-to?) #f) - (set! (-> obj notify-actor) #f) - (set! (-> obj timeout) 0.0) - (set! (-> obj event-going-down) #f) - (set! (-> obj event-down) #f) - (set! (-> obj event-going-up) #f) - (set! (-> obj event-up) #f) - (set! (-> obj anim-speed) 1.0) +(defmethod reset! basebutton ((this basebutton)) + (set! (-> this down?) #f) + (set! (-> this spawned-by-other?) #t) + (set! (-> this move-to?) #f) + (set! (-> this notify-actor) #f) + (set! (-> this timeout) 0.0) + (set! (-> this event-going-down) #f) + (set! (-> this event-down) #f) + (set! (-> this event-going-up) #f) + (set! (-> this event-up) #f) + (set! (-> this anim-speed) 1.0) ) ;; definition for method 28 of type basebutton -(defmethod arm-trigger-event! basebutton ((obj basebutton)) +(defmethod arm-trigger-event! basebutton ((this basebutton)) (let ((v0-0 'trigger)) - (set! (-> obj event-going-down) v0-0) + (set! (-> this event-going-down) v0-0) v0-0 ) ) ;; definition for method 26 of type basebutton -(defmethod basebutton-method-26 basebutton ((obj basebutton)) - (initialize-skeleton obj *generic-button-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) +(defmethod basebutton-method-26 basebutton ((this basebutton)) + (initialize-skeleton this *generic-button-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) (cond - ((-> obj down?) - (let ((s5-0 (-> obj skel root-channel 0))) + ((-> this down?) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) ) (else - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) ) ) - (set! (-> obj anim-speed) 2.0) - (update-transforms! (-> obj root-override)) + (set! (-> this anim-speed) 2.0) + (update-transforms! (-> this root-override)) (ja-post) (none) ) ;; definition for method 27 of type basebutton -(defmethod basebutton-method-27 basebutton ((obj basebutton)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod basebutton-method-27 basebutton ((this basebutton)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -396,44 +396,44 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) s5-0 ) ) ;; definition for method 11 of type basebutton ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! basebutton ((obj basebutton) (arg0 entity-actor)) - (reset! obj) - (set! (-> obj spawned-by-other?) #f) - (set! (-> obj button-id) -1) - (let ((v1-4 (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 -1)))) +(defmethod init-from-entity! basebutton ((this basebutton) (arg0 entity-actor)) + (reset! this) + (set! (-> this spawned-by-other?) #f) + (set! (-> this button-id) -1) + (let ((v1-4 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1)))) (if (>= (the-as int v1-4) 0) - (set! (-> obj button-id) (the-as int v1-4)) + (set! (-> this button-id) (the-as int v1-4)) ) ) (when (or (res-lump-struct arg0 'next-actor structure) (res-lump-struct arg0 'prev-actor structure)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (if (< (-> obj button-id) 0) - (set! (-> obj button-id) (actor-count-before (-> obj link))) + (set! (-> this link) (new 'process 'actor-link-info this)) + (if (< (-> this button-id) 0) + (set! (-> this button-id) (actor-count-before (-> this link))) ) ) - (basebutton-method-27 obj) - (process-drawable-from-entity! obj arg0) + (basebutton-method-27 this) + (process-drawable-from-entity! this arg0) (let ((v1-16 #f)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (set! v1-16 #t) ) - (set! (-> obj down?) v1-16) + (set! (-> this down?) v1-16) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj timeout) (res-lump-float arg0 'timeout)) - (if (not (-> obj spawned-by-other?)) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this timeout) (res-lump-float arg0 'timeout)) + (if (not (-> this spawned-by-other?)) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) ) - (arm-trigger-event! obj) - (basebutton-method-26 obj) - (go (method-of-object obj basebutton-startup)) + (arm-trigger-event! this) + (basebutton-method-26 this) + (go (method-of-object this basebutton-startup)) (none) ) @@ -490,15 +490,15 @@ ) ;; definition for method 3 of type warp-gate -(defmethod inspect warp-gate ((obj warp-gate)) +(defmethod inspect warp-gate ((this warp-gate)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tlevel: ~A~%" (-> obj level)) - (format #t "~T~Tlevel-slot: ~D~%" (-> obj level-slot)) - (format #t "~T~Tmin-slot: ~D~%" (-> obj min-slot)) - (format #t "~T~Tmax-slot: ~D~%" (-> obj max-slot)) - obj + (format #t "~T~Tlevel: ~A~%" (-> this level)) + (format #t "~T~Tlevel-slot: ~D~%" (-> this level-slot)) + (format #t "~T~Tmin-slot: ~D~%" (-> this min-slot)) + (format #t "~T~Tmax-slot: ~D~%" (-> this max-slot)) + this ) ;; failed to figure out what this is: @@ -508,7 +508,7 @@ (send-event *camera* 'joystick 0.0 0.0) ) :code (behavior ((arg0 int) (arg1 level)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (when (not arg1) (process-release? *target*) (go-virtual idle) @@ -534,7 +534,7 @@ (else (load-state-want-levels (-> self level) (-> arg1 load-name)) (while (or (not (member (level-status *level* (-> arg1 load-name)) '(loaded active))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (not (time-elapsed? (-> self state-time) (seconds 2))) ) (suspend) ) @@ -589,7 +589,7 @@ ) ) :enter (behavior ((arg0 vector) (arg1 vector)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *warp-jump-mods*) (set! (-> self control unknown-vector102 quad) (-> arg0 quad)) @@ -642,7 +642,7 @@ ) ) (clear-collide-with-as (-> self control)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self trans-hook) (lambda :behavior target () @@ -668,9 +668,9 @@ (set! (-> gp-2 y) 0.0) (send-event *target* 'sidekick #f) (when (and (or (< (vector-dot gp-2 (-> self control transv)) 0.0) (-> self control unknown-spoolanim00)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) ) - (vector-seek! (-> self draw color-mult) (new 'static 'vector) (* 2.0 (-> *display* seconds-per-frame))) + (vector-seek! (-> self draw color-mult) (new 'static 'vector) (* 2.0 (seconds-per-frame))) (set! (-> self control transv x) (* 0.95 (-> self control transv x))) (set! (-> self control transv z) (* 0.95 (-> self control transv z))) (when (not (-> self control unknown-spoolanim00)) diff --git a/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc index fae82f4ad6..11e63f4867 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/baseplat_REF.gc @@ -24,34 +24,34 @@ ) ;; definition for method 3 of type baseplat -(defmethod inspect baseplat ((obj baseplat)) +(defmethod inspect baseplat ((this baseplat)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsmush: #~%" (-> obj smush)) - (format #t "~T~Tbasetrans: #~%" (-> obj basetrans)) - (format #t "~T~Tbouncing: ~A~%" (-> obj bouncing)) - obj + (format #t "~T~Tsmush: #~%" (-> this smush)) + (format #t "~T~Tbasetrans: #~%" (-> this basetrans)) + (format #t "~T~Tbouncing: ~A~%" (-> this bouncing)) + this ) ;; definition for method 21 of type baseplat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-21 baseplat ((obj baseplat)) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj basetrans quad) (-> obj root-override trans quad)) - (set! (-> obj bouncing) #f) +(defmethod baseplat-method-21 baseplat ((this baseplat)) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this basetrans quad) (-> this root-override trans quad)) + (set! (-> this bouncing) #f) 0 (none) ) ;; definition for method 22 of type baseplat ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-22 baseplat ((obj baseplat)) - (activate! (-> obj smush) -1.0 60 150 1.0 1.0) - (set! (-> obj bouncing) #t) - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) +(defmethod baseplat-method-22 baseplat ((this baseplat)) + (activate! (-> this smush) -1.0 60 150 1.0 1.0) + (set! (-> this bouncing) #t) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -107,15 +107,15 @@ ;; definition for method 25 of type baseplat ;; INFO: Return type mismatch int vs sparticle-launch-group. -(defmethod baseplat-method-25 baseplat ((obj baseplat)) +(defmethod baseplat-method-25 baseplat ((this baseplat)) (the-as sparticle-launch-group 0) ) ;; definition for method 20 of type baseplat ;; INFO: Return type mismatch object vs none. -(defmethod baseplat-method-20 baseplat ((obj baseplat)) - (if (nonzero? (-> obj part)) - (spawn (-> obj part) (-> obj root-override trans)) +(defmethod baseplat-method-20 baseplat ((this baseplat)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root-override trans)) ) (none) ) @@ -162,22 +162,22 @@ ;; definition for method 3 of type eco-door ;; INFO: Used lq/sq -(defmethod inspect eco-door ((obj eco-door)) +(defmethod inspect eco-door ((this eco-door)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Topen-distance: ~f~%" (-> obj open-distance)) - (format #t "~T~Tclose-distance: ~f~%" (-> obj close-distance)) - (format #t "~T~Tout-dir: #~%" (-> obj out-dir)) - (format #t "~T~Topen-sound: ~D~%" (-> obj open-sound)) - (format #t "~T~Tclose-sound: ~D~%" (-> obj close-sound)) - (format #t "~T~Tstate-actor: ~A~%" (-> obj state-actor)) - (format #t "~T~Tflags: ~D~%" (-> obj flags)) - (format #t "~T~Tlocked: ~A~%" (-> obj locked)) - (format #t "~T~Tauto-close: ~A~%" (-> obj auto-close)) - (format #t "~T~Tone-way: ~A~%" (-> obj one-way)) - obj + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Topen-distance: ~f~%" (-> this open-distance)) + (format #t "~T~Tclose-distance: ~f~%" (-> this close-distance)) + (format #t "~T~Tout-dir: #~%" (-> this out-dir)) + (format #t "~T~Topen-sound: ~D~%" (-> this open-sound)) + (format #t "~T~Tclose-sound: ~D~%" (-> this close-sound)) + (format #t "~T~Tstate-actor: ~A~%" (-> this state-actor)) + (format #t "~T~Tflags: ~D~%" (-> this flags)) + (format #t "~T~Tlocked: ~A~%" (-> this locked)) + (format #t "~T~Tauto-close: ~A~%" (-> this auto-close)) + (format #t "~T~Tone-way: ~A~%" (-> this one-way)) + this ) ;; definition for function eco-door-event-handler @@ -268,7 +268,7 @@ eco-door-event-handler :virtual #t :event eco-door-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status complete) #t) (clear-collide-with-as (-> self root-override)) (ja :num-func num-func-identity :frame-num max) @@ -325,11 +325,11 @@ eco-door-event-handler ;; definition for method 26 of type eco-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-26 eco-door ((obj eco-door)) - (when (-> obj state-actor) - (if (logtest? (-> obj state-actor extra perm status) (entity-perm-status complete)) - (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf01))) - (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf00))) +(defmethod eco-door-method-26 eco-door ((this eco-door)) + (when (-> this state-actor) + (if (logtest? (-> this state-actor extra perm status) (entity-perm-status complete)) + (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf01))) + (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf00))) ) ) 0 @@ -338,8 +338,8 @@ eco-door-event-handler ;; definition for method 24 of type eco-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 eco-door ((obj eco-door)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod eco-door-method-24 eco-door ((this eco-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -351,7 +351,7 @@ eco-door-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -359,43 +359,43 @@ eco-door-event-handler ;; definition for method 25 of type eco-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 eco-door ((obj eco-door)) +(defmethod eco-door-method-25 eco-door ((this eco-door)) 0 (none) ) ;; definition for method 11 of type eco-door ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eco-door ((obj eco-door) (arg0 entity-actor)) - (eco-door-method-24 obj) - (process-drawable-from-entity! obj arg0) - (let ((f0-0 (res-lump-float (-> obj entity) 'scale :default 1.0))) - (set-vector! (-> obj root-override scale) f0-0 f0-0 f0-0 1.0) +(defmethod init-from-entity! eco-door ((this eco-door) (arg0 entity-actor)) + (eco-door-method-24 this) + (process-drawable-from-entity! this arg0) + (let ((f0-0 (res-lump-float (-> this entity) 'scale :default 1.0))) + (set-vector! (-> this root-override scale) f0-0 f0-0 f0-0 1.0) ) - (set! (-> obj open-distance) 32768.0) - (set! (-> obj close-distance) 49152.0) - (set! (-> obj speed) 1.0) - (set! (-> obj state-actor) #f) + (set! (-> this open-distance) 32768.0) + (set! (-> this close-distance) 49152.0) + (set! (-> this speed) 1.0) + (set! (-> this state-actor) #f) (let ((v1-5 (entity-actor-lookup arg0 'state-actor 0))) (if v1-5 - (set! (-> obj state-actor) v1-5) + (set! (-> this state-actor) v1-5) ) ) - (set! (-> obj locked) #f) - (set! (-> obj flags) (res-lump-value arg0 'flags eco-door-flags)) - (eco-door-method-26 obj) - (set! (-> obj auto-close) (logtest? (-> obj flags) (eco-door-flags auto-close))) - (set! (-> obj one-way) (logtest? (-> obj flags) (eco-door-flags one-way))) - (vector-z-quaternion! (-> obj out-dir) (-> obj root-override quat)) - (set! (-> obj out-dir w) (- (vector-dot (-> obj out-dir) (-> obj root-override trans)))) - (update-transforms! (-> obj root-override)) - (eco-door-method-25 obj) - (if (and (not (-> obj auto-close)) - (-> obj entity) - (logtest? (-> obj entity extra perm status) (entity-perm-status complete)) + (set! (-> this locked) #f) + (set! (-> this flags) (res-lump-value arg0 'flags eco-door-flags)) + (eco-door-method-26 this) + (set! (-> this auto-close) (logtest? (-> this flags) (eco-door-flags auto-close))) + (set! (-> this one-way) (logtest? (-> this flags) (eco-door-flags one-way))) + (vector-z-quaternion! (-> this out-dir) (-> this root-override quat)) + (set! (-> this out-dir w) (- (vector-dot (-> this out-dir) (-> this root-override trans)))) + (update-transforms! (-> this root-override)) + (eco-door-method-25 this) + (if (and (not (-> this auto-close)) + (-> this entity) + (logtest? (-> this entity extra perm status) (entity-perm-status complete)) ) - (go (method-of-object obj door-open)) - (go (method-of-object obj door-closed)) + (go (method-of-object this door-open)) + (go (method-of-object this door-closed)) ) (none) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/collectables-part_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/collectables-part_REF.gc index d74f0cb168..c9cbdfca3a 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/collectables-part_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/collectables-part_REF.gc @@ -54,7 +54,7 @@ (-> arg0 root trans) (-> arg0 offset) a2-0 - (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> arg0 start-time)))) + (* 0.006666667 (the float (- (current-time) (-> arg0 start-time)))) ) ) ) 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 d556af4cfb..fbca31d839 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/collectables_REF.gc @@ -34,70 +34,72 @@ ) ;; definition for method 3 of type collectable -(defmethod inspect collectable ((obj collectable)) +(defmethod inspect collectable ((this collectable)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpickup-type: ~D~%" (-> obj pickup-type)) - (format #t "~T~Tpickup-amount: ~f~%" (-> obj pickup-amount)) - (format #t "~T~Tnotify-parent: ~A~%" (-> obj notify-parent)) - (format #t "~T~Told-base: ~`vector`P~%" (-> obj old-base)) - (format #t "~T~Tbase: ~`vector`P~%" (-> obj base)) - (format #t "~T~Textra-trans: ~`vector`P~%" (-> obj extra-trans)) - (format #t "~T~Tjump-pos: ~`vector`P~%" (-> obj jump-pos)) - (format #t "~T~Tflags: ~D~%" (-> obj flags)) - (format #t "~T~Tbirth-time: ~D~%" (-> obj birth-time)) - (format #t "~T~Tcollect-timeout: ~D~%" (-> obj collect-timeout)) - (format #t "~T~Tfadeout-timeout: ~D~%" (-> obj fadeout-timeout)) - (format #t "~T~Tbob-offset: ~D~%" (-> obj bob-offset)) - (format #t "~T~Tbob-amount: ~f~%" (-> obj bob-amount)) - (format #t "~T~Tpickup-handle: ~D~%" (-> obj pickup-handle)) - (format #t "~T~Tactor-pause: ~A~%" (-> obj actor-pause)) - obj + (format #t "~T~Tpickup-type: ~D~%" (-> this pickup-type)) + (format #t "~T~Tpickup-amount: ~f~%" (-> this pickup-amount)) + (format #t "~T~Tnotify-parent: ~A~%" (-> this notify-parent)) + (format #t "~T~Told-base: ~`vector`P~%" (-> this old-base)) + (format #t "~T~Tbase: ~`vector`P~%" (-> this base)) + (format #t "~T~Textra-trans: ~`vector`P~%" (-> this extra-trans)) + (format #t "~T~Tjump-pos: ~`vector`P~%" (-> this jump-pos)) + (format #t "~T~Tflags: ~D~%" (-> this flags)) + (format #t "~T~Tbirth-time: ~D~%" (-> this birth-time)) + (format #t "~T~Tcollect-timeout: ~D~%" (-> this collect-timeout)) + (format #t "~T~Tfadeout-timeout: ~D~%" (-> this fadeout-timeout)) + (format #t "~T~Tbob-offset: ~D~%" (-> this bob-offset)) + (format #t "~T~Tbob-amount: ~f~%" (-> this bob-amount)) + (format #t "~T~Tpickup-handle: ~D~%" (-> this pickup-handle)) + (format #t "~T~Tactor-pause: ~A~%" (-> this actor-pause)) + this ) ;; definition for method 21 of type collectable ;; INFO: Used lq/sq ;; INFO: Return type mismatch collectable vs none. -(defmethod initialize-params collectable ((obj collectable) (arg0 time-frame) (arg1 float)) - (logclear! (-> obj mask) (process-mask crate enemy platform ambient)) - (logior! (-> obj mask) (process-mask collectable)) - (set! (-> obj flags) (collectable-flags can-collect ignore-blue)) - (set! (-> obj bob-amount) arg1) - (set! (-> obj bob-offset) (+ (the-as int (-> obj root-override trans x)) - (the-as int (-> obj root-override trans y)) - (the-as int (-> obj root-override trans z)) - ) +(defmethod initialize-params collectable ((this collectable) (arg0 time-frame) (arg1 float)) + (logclear! (-> this mask) (process-mask crate enemy platform ambient)) + (logior! (-> this mask) (process-mask collectable)) + (set! (-> this flags) (collectable-flags can-collect ignore-blue)) + (set! (-> this bob-amount) arg1) + (set! (-> this bob-offset) (+ (the-as int (-> this root-override trans x)) + (the-as int (-> this root-override trans y)) + (the-as int (-> this root-override trans z)) + ) ) (cond - ((or (= (vector-length (-> obj root-override transv)) 0.0) - (logtest? (-> obj fact options) (fact-options instant-collect)) + ((or (= (vector-length (-> this root-override transv)) 0.0) + (logtest? (-> this fact options) (fact-options instant-collect)) ) - (vector-reset! (-> obj root-override transv)) + (vector-reset! (-> this root-override transv)) ) (else - (logior! (-> obj flags) (collectable-flags trans)) - (logclear! (-> obj flags) (collectable-flags can-collect)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj bob-amount) 0.0) + (logior! (-> this flags) (collectable-flags trans)) + (logclear! (-> this flags) (collectable-flags can-collect)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this bob-amount) 0.0) ) ) (when (and (> arg0 0) #t) - (logior! (-> obj flags) (collectable-flags fade)) - (set! (-> obj fadeout-timeout) arg0) + (logior! (-> this flags) (collectable-flags fade)) + (set! (-> this fadeout-timeout) arg0) ) - (set! (-> obj collect-timeout) (seconds 0.33)) - (set! (-> obj birth-time) (-> *display* base-frame-counter)) - (set! (-> obj base quad) (-> obj root-override trans quad)) - (set! (-> obj old-base quad) (-> obj root-override trans quad)) - (set! (-> obj pickup-handle) (the-as handle #f)) - (case (-> obj fact pickup-type) + (set! (-> this collect-timeout) (seconds 0.33)) + (set-time! (-> this birth-time)) + (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this old-base quad) (-> this root-override trans quad)) + (set! (-> this pickup-handle) (the-as handle #f)) + (case (-> this fact pickup-type) (((pickup-type eco-pill) (pickup-type eco-green) (pickup-type money) (pickup-type eco-blue)) - (logclear! (-> obj flags) (collectable-flags ignore-blue)) + (logclear! (-> this flags) (collectable-flags ignore-blue)) ) ) - (if (logtest? (-> obj fact options) (fact-options large)) - (set! (-> obj root-override root-prim local-sphere w) (* 2.5 (-> obj root-override root-prim local-sphere w))) + (if (logtest? (-> this fact options) (fact-options large)) + (set! (-> this root-override root-prim local-sphere w) + (* 2.5 (-> this root-override root-prim local-sphere w)) + ) ) (none) ) @@ -134,31 +136,31 @@ ) ;; definition for method 3 of type eco-collectable -(defmethod inspect eco-collectable ((obj eco-collectable)) +(defmethod inspect eco-collectable ((this eco-collectable)) (let ((t9-0 (method-of-type collectable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Teco-effect: ~A~%" (-> obj eco-effect)) - (format #t "~T~Tcollect-effect: ~A~%" (-> obj collect-effect)) - (format #t "~T~Tcollect-effect2: ~A~%" (-> obj collect-effect2)) - (format #t "~T~Tcollect-effect-time: ~D~%" (-> obj collect-effect-time)) - (format #t "~T~Trespawn-delay: ~D~%" (-> obj respawn-delay)) - (format #t "~T~Tsound-name: ~A~%" (-> obj sound-name)) - (format #t "~T~Ttarget: ~D~%" (-> obj target)) - (format #t "~T~Tsuck-time: ~D~%" (-> obj suck-time)) - (format #t "~T~Tsuck-y-offset: ~f~%" (-> obj suck-y-offset)) - (format #t "~T~Tspeed: ~`vector`P~%" (-> obj speed)) - (format #t "~T~Tmovie-pos-index: ~D~%" (-> obj movie-pos-index)) - obj + (format #t "~T~Teco-effect: ~A~%" (-> this eco-effect)) + (format #t "~T~Tcollect-effect: ~A~%" (-> this collect-effect)) + (format #t "~T~Tcollect-effect2: ~A~%" (-> this collect-effect2)) + (format #t "~T~Tcollect-effect-time: ~D~%" (-> this collect-effect-time)) + (format #t "~T~Trespawn-delay: ~D~%" (-> this respawn-delay)) + (format #t "~T~Tsound-name: ~A~%" (-> this sound-name)) + (format #t "~T~Ttarget: ~D~%" (-> this target)) + (format #t "~T~Tsuck-time: ~D~%" (-> this suck-time)) + (format #t "~T~Tsuck-y-offset: ~f~%" (-> this suck-y-offset)) + (format #t "~T~Tspeed: ~`vector`P~%" (-> this speed)) + (format #t "~T~Tmovie-pos-index: ~D~%" (-> this movie-pos-index)) + this ) ;; definition for method 20 of type eco-collectable -(defmethod initialize eco-collectable ((obj eco-collectable)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify-parent) #f) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize eco-collectable ((this eco-collectable)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify-parent) #f) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -172,63 +174,63 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) - (if (logtest? (fact-options respawn) (-> obj fact options)) - (set! (-> obj respawn-delay) (-> obj fact fade-time)) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + (if (logtest? (fact-options respawn) (-> this fact options)) + (set! (-> this respawn-delay) (-> this fact fade-time)) ) - obj + this ) ;; definition for method 27 of type eco-collectable ;; INFO: Return type mismatch ambient-sound vs none. -(defmethod initialize-effect eco-collectable ((obj eco-collectable) (arg0 pickup-type)) - (set! (-> obj fact pickup-type) arg0) - (case (-> obj fact pickup-type) +(defmethod initialize-effect eco-collectable ((this eco-collectable) (arg0 pickup-type)) + (set! (-> this fact pickup-type) arg0) + (case (-> this fact pickup-type) (((pickup-type eco-blue) (pickup-type eco-red) (pickup-type eco-green) (pickup-type eco-yellow)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) ) ) - (set! (-> obj sound-name) #f) + (set! (-> this sound-name) #f) (case arg0 (((pickup-type eco-yellow)) - (set! (-> obj eco-effect) (-> *part-group-id-table* 56)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 68)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 57)) - (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (static-sound-spec "yel-eco-idle" :fo-max 15)) + (set! (-> this eco-effect) (-> *part-group-id-table* 56)) + (set! (-> this collect-effect) (-> *part-group-id-table* 68)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 57)) + (set! (-> this collect-effect-time) (seconds 0.5)) + (set! (-> this sound-name) (static-sound-spec "yel-eco-idle" :fo-max 15)) ) (((pickup-type eco-red)) - (set! (-> obj eco-effect) (-> *part-group-id-table* 48)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 69)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 49)) - (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (static-sound-spec "red-eco-idle" :fo-max 15)) + (set! (-> this eco-effect) (-> *part-group-id-table* 48)) + (set! (-> this collect-effect) (-> *part-group-id-table* 69)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 49)) + (set! (-> this collect-effect-time) (seconds 0.5)) + (set! (-> this sound-name) (static-sound-spec "red-eco-idle" :fo-max 15)) ) (((pickup-type eco-blue)) - (set! (-> obj eco-effect) (-> *part-group-id-table* 42)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 67)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 43)) - (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (static-sound-spec "blue-eco-idle" :fo-max 15)) + (set! (-> this eco-effect) (-> *part-group-id-table* 42)) + (set! (-> this collect-effect) (-> *part-group-id-table* 67)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 43)) + (set! (-> this collect-effect-time) (seconds 0.5)) + (set! (-> this sound-name) (static-sound-spec "blue-eco-idle" :fo-max 15)) ) (((pickup-type eco-green)) - (set! (-> obj eco-effect) (-> *part-group-id-table* 58)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 66)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 61)) - (set! (-> obj collect-effect-time) (seconds 0.5)) - (set! (-> obj sound-name) (static-sound-spec "green-eco-idle" :fo-max 15)) + (set! (-> this eco-effect) (-> *part-group-id-table* 58)) + (set! (-> this collect-effect) (-> *part-group-id-table* 66)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 61)) + (set! (-> this collect-effect-time) (seconds 0.5)) + (set! (-> this sound-name) (static-sound-spec "green-eco-idle" :fo-max 15)) ) (((pickup-type eco-pill)) - (set! (-> obj eco-effect) (-> *part-group-id-table* 59)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 60)) - (set! (-> obj collect-effect-time) (seconds 0.5)) + (set! (-> this eco-effect) (-> *part-group-id-table* 59)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 60)) + (set! (-> this collect-effect-time) (seconds 0.5)) ) ) - (set! (-> obj part) (create-launch-control (-> obj eco-effect) obj)) - (if (-> obj sound-name) - (set! (-> obj sound) (new 'process 'ambient-sound (-> obj sound-name) (-> obj root-override trans))) + (set! (-> this part) (create-launch-control (-> this eco-effect) this)) + (if (-> this sound-name) + (set! (-> this sound) (new 'process 'ambient-sound (-> this sound-name) (-> this root-override trans))) ) (none) ) @@ -278,23 +280,23 @@ ;; definition for method 28 of type eco-collectable ;; INFO: Used lq/sq -(defmethod initialize-eco eco-collectable ((obj eco-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) - (set! (-> obj pickup-amount) arg2) - (set! (-> obj pickup-type) arg1) - (initialize obj) - (set! (-> obj root-override trans quad) (-> arg0 extra trans quad)) - (initialize-effect obj (-> obj fact pickup-type)) - (initialize-params obj 0 (the-as float 1024.0)) - (update-transforms! (-> obj root-override)) - (if (logtest? (fact-options eco-blocked) (-> obj fact options)) - (go (method-of-object obj blocked)) +(defmethod initialize-eco eco-collectable ((this eco-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> this pickup-amount) arg2) + (set! (-> this pickup-type) arg1) + (initialize this) + (set! (-> this root-override trans quad) (-> arg0 extra trans quad)) + (initialize-effect this (-> this fact pickup-type)) + (initialize-params this 0 (the-as float 1024.0)) + (update-transforms! (-> this root-override)) + (if (logtest? (fact-options eco-blocked) (-> this fact options)) + (go (method-of-object this blocked)) ) - (go (method-of-object obj wait)) + (go (method-of-object this wait)) ) ;; definition for method 29 of type eco-collectable ;; INFO: Return type mismatch int vs none. -(defmethod animate eco-collectable ((obj eco-collectable)) +(defmethod animate eco-collectable ((this eco-collectable)) 0 (none) ) @@ -387,19 +389,16 @@ ) (logior! (-> self flags) (collectable-flags suck)) (if (= (-> self speed w) 0.0) - (set! (-> self suck-time) (-> *display* base-frame-counter)) + (set-time! (-> self suck-time)) ) - (+! (-> self speed w) (* 163840.0 (-> *display* seconds-per-frame))) - (+! (-> self speed y) (* 291271.12 (-> *display* seconds-per-frame))) + (+! (-> self speed w) (* 163840.0 (seconds-per-frame))) + (+! (-> self speed y) (* 291271.12 (seconds-per-frame))) (set! (-> self speed y) (fmin (fmin 291271.12 (-> self speed y)) (-> self speed y))) (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> self base) (the-as vector gp-2)))) - (vector-normalize! - s5-2 - (fmax 0.0 (- (vector-length s5-2) (* (-> self speed w) (-> *display* seconds-per-frame)))) - ) - (vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (-> *display* seconds-per-frame))) + (vector-normalize! s5-2 (fmax 0.0 (- (vector-length s5-2) (* (-> self speed w) (seconds-per-frame))))) + (vector-rotate-y! s5-2 s5-2 (* (-> self speed y) (-> self speed z) (seconds-per-frame))) (set! (-> self suck-y-offset) - (* 2048.0 (sin (* 873.81335 (the float (mod (- (-> *display* base-frame-counter) (-> self suck-time)) 75))))) + (* 2048.0 (sin (* 873.81335 (the float (mod (- (current-time) (-> self suck-time)) 75))))) ) (vector+! (-> self base) (the-as vector gp-2) s5-2) ) @@ -451,9 +450,9 @@ (the-as float 300.0) (the-as float -2.2755556) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (let ((f0-2 (the float (- (-> *display* base-frame-counter) (-> self state-time))))) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) + (let ((f0-2 (the float (- (current-time) (-> self state-time))))) (eval-position! gp-1 f0-2 (-> self root-override trans)) ) (transform-post) @@ -484,7 +483,7 @@ (local-vars (v0-3 object)) (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) (!= (-> self next-state name) 'pickup) (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) ) @@ -498,7 +497,7 @@ (!= (-> self next-state name) 'pickup) (begin (check-blue-suck (the-as process-drawable proc)) #t) (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual notice-blue (process->handle proc)) @@ -550,7 +549,7 @@ ((= message 'fade) (logior! (-> self flags) (collectable-flags fade)) (set! (-> self fadeout-timeout) (seconds 0.1)) - (set! v0-3 (-> *display* base-frame-counter)) + (set! v0-3 (current-time)) (set! (-> self birth-time) (the-as time-frame v0-3)) v0-3 ) @@ -614,12 +613,9 @@ (s5-0 (-> self root-override root-prim prim-core)) ) (when (and (logtest? (-> self flags) (collectable-flags fade)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self fadeout-timeout)) + (time-elapsed? (-> self birth-time) (-> self fadeout-timeout)) ) - (let ((v1-10 - (- (seconds 1) (- (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self fadeout-timeout))) - ) - ) + (let ((v1-10 (- (seconds 1) (- (- (current-time) (-> self birth-time)) (-> self fadeout-timeout))))) (cond ((< v1-10 0) (process-entity-status! self (entity-perm-status dead) #t) @@ -651,7 +647,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) (!= (-> self next-state name) 'pickup) (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) ) @@ -858,7 +854,7 @@ (-> arg0 root trans) (-> arg0 offset) a2-0 - (/ (the float (- (-> *display* base-frame-counter) (-> arg0 start-time))) + (/ (the float (- (current-time) (-> arg0 start-time))) (the float (-> (the-as eco-collectable s5-0) collect-effect-time)) ) ) @@ -897,23 +893,23 @@ ) ;; definition for method 3 of type eco -(defmethod inspect eco ((obj eco)) +(defmethod inspect eco ((this eco)) (let ((t9-0 (method-of-type eco-collectable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 29 of type eco ;; INFO: Return type mismatch int vs none. -(defmethod animate eco ((obj eco)) - (let ((a0-1 (-> obj part)) - (a1-0 (-> obj root-override root-prim prim-core)) +(defmethod animate eco ((this eco)) + (let ((a0-1 (-> this part)) + (a1-0 (-> this root-override root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) - (if (nonzero? (-> obj sound)) - (update! (-> obj sound)) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) ) 0 (none) @@ -948,8 +944,8 @@ ) (cond ((nonzero? (-> self respawn-delay)) - (let ((gp-0 (-> *display* base-frame-counter))) - (while (< (- (-> *display* base-frame-counter) gp-0) (-> self respawn-delay)) + (let ((gp-0 (current-time))) + (while (not (time-elapsed? gp-0 (-> self respawn-delay))) (suspend) ) ) @@ -979,17 +975,17 @@ ) ;; definition for method 3 of type eco-yellow -(defmethod inspect eco-yellow ((obj eco-yellow)) +(defmethod inspect eco-yellow ((this eco-yellow)) (let ((t9-0 (method-of-type eco inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 11 of type eco-yellow ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eco-yellow ((obj eco-yellow) (arg0 entity-actor)) - (initialize-eco obj arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) +(defmethod init-from-entity! eco-yellow ((this eco-yellow) (arg0 entity-actor)) + (initialize-eco this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1003,17 +999,17 @@ ) ;; definition for method 3 of type eco-red -(defmethod inspect eco-red ((obj eco-red)) +(defmethod inspect eco-red ((this eco-red)) (let ((t9-0 (method-of-type eco inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 11 of type eco-red ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eco-red ((obj eco-red) (arg0 entity-actor)) - (initialize-eco obj arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) +(defmethod init-from-entity! eco-red ((this eco-red) (arg0 entity-actor)) + (initialize-eco this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1027,17 +1023,17 @@ ) ;; definition for method 3 of type eco-blue -(defmethod inspect eco-blue ((obj eco-blue)) +(defmethod inspect eco-blue ((this eco-blue)) (let ((t9-0 (method-of-type eco inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 11 of type eco-blue ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eco-blue ((obj eco-blue) (arg0 entity-actor)) - (initialize-eco obj arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) +(defmethod init-from-entity! eco-blue ((this eco-blue) (arg0 entity-actor)) + (initialize-eco this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1051,23 +1047,23 @@ ) ;; definition for method 3 of type health -(defmethod inspect health ((obj health)) +(defmethod inspect health ((this health)) (let ((t9-0 (method-of-type eco-collectable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 29 of type health ;; INFO: Return type mismatch int vs none. -(defmethod animate health ((obj health)) - (let ((a0-1 (-> obj part)) - (a1-0 (-> obj root-override root-prim prim-core)) +(defmethod animate health ((this health)) + (let ((a0-1 (-> this part)) + (a1-0 (-> this root-override root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) - (if (nonzero? (-> obj sound)) - (update! (-> obj sound)) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) ) 0 (none) @@ -1075,8 +1071,8 @@ ;; definition for method 11 of type health ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! health ((obj health) (arg0 entity-actor)) - (initialize-eco obj arg0 (pickup-type eco-green) (-> *FACT-bank* health-single-inc)) +(defmethod init-from-entity! health ((this health) (arg0 entity-actor)) + (initialize-eco this arg0 (pickup-type eco-green) (-> *FACT-bank* health-single-inc)) (none) ) @@ -1090,23 +1086,23 @@ ) ;; definition for method 3 of type eco-pill -(defmethod inspect eco-pill ((obj eco-pill)) +(defmethod inspect eco-pill ((this eco-pill)) (let ((t9-0 (method-of-type eco-collectable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 29 of type eco-pill ;; INFO: Return type mismatch int vs none. -(defmethod animate eco-pill ((obj eco-pill)) - (let ((a0-1 (-> obj part)) - (a1-0 (-> obj root-override root-prim prim-core)) +(defmethod animate eco-pill ((this eco-pill)) + (let ((a0-1 (-> this part)) + (a1-0 (-> this root-override root-prim prim-core)) ) (spawn a0-1 (the-as vector a1-0)) ) - (if (nonzero? (-> obj sound)) - (update! (-> obj sound)) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) ) 0 (none) @@ -1114,26 +1110,26 @@ ;; definition for method 11 of type eco-pill ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eco-pill ((obj eco-pill) (arg0 entity-actor)) - (initialize-eco obj arg0 (pickup-type eco-pill) (-> *FACT-bank* health-small-inc)) +(defmethod init-from-entity! eco-pill ((this eco-pill) (arg0 entity-actor)) + (initialize-eco this arg0 (pickup-type eco-pill) (-> *FACT-bank* health-small-inc)) (none) ) ;; definition for method 10 of type eco-pill -(defmethod deactivate eco-pill ((obj eco-pill)) +(defmethod deactivate eco-pill ((this eco-pill)) (set! *eco-pill-count* (+ *eco-pill-count* -1)) - ((method-of-type eco-collectable deactivate) obj) + ((method-of-type eco-collectable deactivate) this) (none) ) ;; definition for method 20 of type eco-pill -(defmethod initialize eco-pill ((obj eco-pill)) +(defmethod initialize eco-pill ((this eco-pill)) (set! *eco-pill-count* (+ *eco-pill-count* 1)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify-parent) #f) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify-parent) #f) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1147,10 +1143,10 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) - obj + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + this ) ;; failed to figure out what this is: @@ -1177,37 +1173,37 @@ ) ;; definition for method 3 of type money -(defmethod inspect money ((obj money)) +(defmethod inspect money ((this money)) (let ((t9-0 (method-of-type eco-collectable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 12 of type money -(defmethod run-logic? money ((obj money)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-status was-drawn)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override pause-adjust-distance)) - (vector-vector-distance (-> obj root-override trans) (math-camera-pos)) +(defmethod run-logic? money ((this money)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-status was-drawn)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root-override pause-adjust-distance)) + (vector-vector-distance (-> this root-override trans) (math-camera-pos)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) ;; definition for method 10 of type money -(defmethod deactivate money ((obj money)) - (when (= (-> obj next-state name) 'pickup) - (if (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status dead)))) +(defmethod deactivate money ((this money)) + (when (= (-> this next-state name) 'pickup) + (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status dead)))) (format #t "money ~A was killed in pickup~%") ) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) ) - ((method-of-type eco-collectable deactivate) obj) + ((method-of-type eco-collectable deactivate) this) (none) ) @@ -1219,7 +1215,7 @@ (quaternion-rotate-y! (-> self root-override quat) (-> self root-override quat) - (* 40049.777 (-> *display* seconds-per-frame)) + (* 40049.777 (seconds-per-frame)) ) (let ((f30-0 (-> self bob-amount))) (when (< 0.0 f30-0) @@ -1227,11 +1223,7 @@ (+ (-> self base y) (-> self suck-y-offset) (* f30-0 - (sin - (* 109.22667 - (the float (mod (+ (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self bob-offset)) 600)) - ) - ) + (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) 600)))) ) ) ) @@ -1252,7 +1244,7 @@ (quaternion-rotate-y! (-> self root-override quat) (-> self root-override quat) - (* 91022.22 (-> *display* seconds-per-frame)) + (* 91022.22 (seconds-per-frame)) ) (set! (-> self root-override trans quad) (-> self base quad)) (add-blue-motion #t #t #t #f) @@ -1262,11 +1254,7 @@ (+ (-> self base y) (-> self suck-y-offset) (* f30-0 - (sin - (* 109.22667 - (the float (mod (+ (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self bob-offset)) 600)) - ) - ) + (sin (* 109.22667 (the float (mod (+ (- (current-time) (-> self birth-time)) (-> self bob-offset)) 600)))) ) ) ) @@ -1290,9 +1278,9 @@ ) ;; definition for method 20 of type money -(defmethod initialize money ((obj money)) - (stack-size-set! (-> obj main-thread) 128) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize money ((this money)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1306,13 +1294,13 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify-parent) #f) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type money) (the-as float 1.0))) - (let ((a0-10 (-> obj entity))) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify-parent) #f) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type money) (the-as float 1.0))) + (let ((a0-10 (-> this entity))) (if (when a0-10 (let ((a0-11 (-> a0-10 extra perm task))) (if a0-11 @@ -1320,26 +1308,26 @@ ) ) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) - (initialize-skeleton obj *money-sg* '()) - (if (-> obj entity) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (initialize-skeleton this *money-sg* '()) + (if (-> this entity) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) ) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) - obj + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + this ) ;; definition for method 11 of type money ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! money ((obj money) (arg0 entity-actor)) - (initialize obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-params obj 0 (the-as float 1024.0)) - (update-transforms! (-> obj root-override)) - (go (method-of-object obj wait)) +(defmethod init-from-entity! money ((this money) (arg0 entity-actor)) + (initialize this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-params this 0 (the-as float 1024.0)) + (update-transforms! (-> this root-override)) + (go (method-of-object this wait)) (none) ) @@ -1412,13 +1400,13 @@ ) ;; definition for method 3 of type fuel-cell -(defmethod inspect fuel-cell ((obj fuel-cell)) +(defmethod inspect fuel-cell ((this fuel-cell)) (let ((t9-0 (method-of-type eco-collectable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tvictory-anim: ~A~%" (-> obj victory-anim)) - (format #t "~T~Tstate-object: ~A~%" (-> obj state-object)) - obj + (format #t "~T~Tvictory-anim: ~A~%" (-> this victory-anim)) + (format #t "~T~Tstate-object: ~A~%" (-> this state-object)) + this ) ;; definition for function fuel-cell-pick-anim @@ -1546,7 +1534,7 @@ (local-vars (v0-3 object)) (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (time-elapsed? (-> self birth-time) (-> self collect-timeout)) (and (not (handle->process (-> *game-info* other-camera-handle))) (not *progress-process*) (!= (-> self next-state name) 'pickup) @@ -1609,8 +1597,8 @@ (let ((f30-0 (vector-vector-distance (-> self base) (target-pos 0)))) (set! f28-0 (if (and (< f30-0 (-> *FACT-bank* suck-suck-dist)) (not (logtest? (-> self flags) (collectable-flags anim)))) - (seek f28-0 (the-as float 16384.0) (* 3072.0 (-> *display* seconds-per-frame))) - (seek f28-0 (the-as float 0.0) (* 3072.0 (-> *display* seconds-per-frame))) + (seek f28-0 (the-as float 16384.0) (* 3072.0 (seconds-per-frame))) + (seek f28-0 (the-as float 0.0) (* 3072.0 (seconds-per-frame))) ) ) (set! (-> self root-override trans y) (+ (-> self base y) (* 2867.2 (sin f28-0)))) @@ -1633,7 +1621,7 @@ (defstate pickup (fuel-cell) :virtual #t :enter (behavior ((arg0 object) (arg1 handle)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (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))) (if t9-1 @@ -1709,7 +1697,7 @@ (format #t "WARNING: fuel-cell stall ~D ~A ~A~%" - (-> *display* base-frame-counter) + (current-time) (handle->process (-> *game-info* other-camera-handle)) (-> *level* loading-level) ) @@ -2058,9 +2046,9 @@ ;; definition for method 20 of type fuel-cell ;; INFO: Used lq/sq -(defmethod initialize fuel-cell ((obj fuel-cell)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize fuel-cell ((this fuel-cell)) + (stack-size-set! (-> this main-thread) 512) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -2075,32 +2063,32 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify-parent) #f) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type fuel-cell) (the-as float 0.0))) - (initialize-skeleton obj *fuel-cell-sg* '()) - (set! (-> obj base quad) (-> obj root-override trans quad)) - (set! (-> obj old-base quad) (-> obj root-override trans quad)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 63) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> obj root-override trans)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify-parent) #f) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type fuel-cell) (the-as float 0.0))) + (initialize-skeleton this *fuel-cell-sg* '()) + (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this old-base quad) (-> this root-override trans quad)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 63) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "powercell-idle" :fo-max 40) (-> this root-override trans)) ) - (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) - obj + (set! (-> this victory-anim) (fuel-cell-pick-anim this)) + this ) ;; definition for method 11 of type fuel-cell ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! fuel-cell ((obj fuel-cell) (arg0 entity-actor)) - (initialize obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-params obj 0 (the-as float 1024.0)) - (logclear! (-> obj fact options) (fact-options can-collect)) - (update-transforms! (-> obj root-override)) - (go (method-of-object obj wait)) +(defmethod init-from-entity! fuel-cell ((this fuel-cell) (arg0 entity-actor)) + (initialize this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-params this 0 (the-as float 1024.0)) + (logclear! (-> this fact options) (fact-options can-collect)) + (update-transforms! (-> this root-override)) + (go (method-of-object this wait)) (none) ) @@ -2231,36 +2219,36 @@ ) ;; definition for method 3 of type buzzer -(defmethod inspect buzzer ((obj buzzer)) +(defmethod inspect buzzer ((this buzzer)) (let ((t9-0 (method-of-type eco-collectable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tvictory-anim: ~A~%" (-> obj victory-anim)) - obj + (format #t "~T~Tvictory-anim: ~A~%" (-> this victory-anim)) + this ) ;; definition for method 29 of type buzzer ;; INFO: Return type mismatch int vs none. -(defmethod animate buzzer ((obj buzzer)) +(defmethod animate buzzer ((this buzzer)) (quaternion-rotate-y! - (-> obj root-override quat) - (-> obj root-override quat) - (* 40049.777 (-> *display* seconds-per-frame)) + (-> this root-override quat) + (-> this root-override quat) + (* 40049.777 (seconds-per-frame)) ) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 param 0) 1.0) (joint-control-channel-group-eval! a0-2 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((f0-3 (y-angle (-> obj root-override)))) + (let ((f0-3 (y-angle (-> this root-override)))) (set! (-> *part-id-table* 239 init-specs 4 initial-valuef) (+ 16384.0 f0-3)) (set! (-> *part-id-table* 240 init-specs 4 initial-valuef) (+ 16384.0 f0-3)) ) - (spawn (-> obj part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) - (if (nonzero? (-> obj sound)) - (update! (-> obj sound)) + (spawn (-> this part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) ) (if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0)) - (spool-push *art-control* (-> obj victory-anim name) 0 obj (the-as float -99.0)) + (spool-push *art-control* (-> this victory-anim name) 0 this (the-as float -99.0)) ) 0 (none) @@ -2394,8 +2382,8 @@ ) ;; definition for method 20 of type buzzer -(defmethod initialize buzzer ((obj buzzer)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize buzzer ((this buzzer)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -2409,33 +2397,33 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify-parent) #f) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type buzzer) (the-as float 0.0))) - (initialize-skeleton obj *buzzer-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 65) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> obj root-override trans)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify-parent) #f) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type buzzer) (the-as float 0.0))) + (initialize-skeleton this *buzzer-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 65) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "buzzer" :fo-max 40) (-> this root-override trans)) ) - (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) - obj + (set! (-> this victory-anim) (fuel-cell-pick-anim this)) + this ) ;; definition for method 11 of type buzzer ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! buzzer ((obj buzzer) (arg0 entity-actor)) - (initialize obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-params obj 0 (the-as float 1024.0)) - (set! (-> obj collect-timeout) (seconds 2)) - (update-transforms! (-> obj root-override)) - (update-trans! (-> obj sound) (-> obj root-override trans)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (go (method-of-object obj wait)) - (go (method-of-object obj pickup) #t (the-as handle #f)) +(defmethod init-from-entity! buzzer ((this buzzer) (arg0 entity-actor)) + (initialize this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-params this 0 (the-as float 1024.0)) + (set! (-> this collect-timeout) (seconds 2)) + (update-transforms! (-> this root-override)) + (update-trans! (-> this sound) (-> this root-override trans)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (go (method-of-object this wait)) + (go (method-of-object this pickup) #t (the-as handle #f)) ) (none) ) @@ -2469,37 +2457,37 @@ ) ;; definition for method 11 of type eco -(defmethod init-from-entity! eco ((obj eco) (arg0 entity-actor)) - (let ((v1-2 (res-lump-value (-> obj entity) 'eco-info pickup-type :time (the-as float -1000000000.0)))) - (set! (-> obj type) (cond - ((= v1-2 (pickup-type eco-blue)) - eco-blue - ) - ((= v1-2 (pickup-type eco-red)) - eco-red - ) - ((= v1-2 (pickup-type eco-yellow)) - eco-yellow - ) - ((= v1-2 (pickup-type eco-green)) - health - ) - ((= v1-2 (pickup-type money)) - money - ) - ((= v1-2 (pickup-type fuel-cell)) - fuel-cell - ) - ((= v1-2 (pickup-type buzzer)) - buzzer - ) - (else - eco-pill +(defmethod init-from-entity! eco ((this eco) (arg0 entity-actor)) + (let ((v1-2 (res-lump-value (-> this entity) 'eco-info pickup-type :time (the-as float -1000000000.0)))) + (set! (-> this type) (cond + ((= v1-2 (pickup-type eco-blue)) + eco-blue ) - ) + ((= v1-2 (pickup-type eco-red)) + eco-red + ) + ((= v1-2 (pickup-type eco-yellow)) + eco-yellow + ) + ((= v1-2 (pickup-type eco-green)) + health + ) + ((= v1-2 (pickup-type money)) + money + ) + ((= v1-2 (pickup-type fuel-cell)) + fuel-cell + ) + ((= v1-2 (pickup-type buzzer)) + buzzer + ) + (else + eco-pill + ) + ) ) ) - (init-from-entity! obj arg0) + (init-from-entity! this arg0) (none) ) @@ -2709,9 +2697,9 @@ ;; definition for method 9 of type fact-info ;; INFO: Used lq/sq -(defmethod drop-pickup fact-info ((obj fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) - (let ((s3-0 (-> obj pickup-type)) - (f30-0 (-> obj pickup-amount)) +(defmethod drop-pickup fact-info ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) + (let ((s3-0 (-> this pickup-type)) + (f30-0 (-> this pickup-amount)) ) (when (= s3-0 (pickup-type eco-pill-random)) f30-0 @@ -2740,7 +2728,7 @@ ((< 10 *eco-pill-count*) 1.0 ) - ((type-type? (-> obj type) fact-info-enemy) + ((type-type? (-> this type) fact-info-enemy) (+ (rand-vu-float-range (the-as float 3.0) (+ 5.0 f30-0)) (the float arg3)) ) (else @@ -2751,7 +2739,7 @@ ) ) (let ((s2-1 (new 'stack-no-clear 'vector))) - (set! (-> s2-1 quad) (-> obj process root trans quad)) + (set! (-> s2-1 quad) (-> this process root trans quad)) (+! (-> s2-1 y) 12288.0) (let ((s1-1 (new 'stack-no-clear 'collide-tri-result))) (if (>= (fill-and-probe-using-y-probe @@ -2766,13 +2754,13 @@ 0.0 ) (set! (-> s2-1 quad) (-> s1-1 intersect quad)) - (set! (-> s2-1 quad) (-> obj process root trans quad)) + (set! (-> s2-1 quad) (-> this process root trans quad)) ) ) (if (= (the-as int s3-0) 6) (+! (-> s2-1 y) 6144.0) ) - (birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 arg1 obj) + (birth-pickup-at-point s2-1 (the-as pickup-type s3-0) f30-0 arg0 arg1 this) ) ) ) @@ -2794,14 +2782,14 @@ ) ;; definition for method 3 of type ecovalve -(defmethod inspect ecovalve ((obj ecovalve)) +(defmethod inspect ecovalve ((this ecovalve)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Toffset: ~`vector`P~%" (-> obj offset)) - (format #t "~T~Toffset-target: ~`vector`P~%" (-> obj offset-target)) - (format #t "~T~Tblock-func: ~A~%" (-> obj block-func)) - obj + (format #t "~T~Toffset: ~`vector`P~%" (-> this offset)) + (format #t "~T~Toffset-target: ~`vector`P~%" (-> this offset-target)) + (format #t "~T~Tblock-func: ~A~%" (-> this block-func)) + this ) ;; failed to figure out what this is: @@ -2822,7 +2810,7 @@ (set-vector! (-> self offset-target) 0.0 0.0 0.0 1.0) ) (when (!= (-> self offset-target y) (-> self offset y)) - (vector-seek! (-> self offset) (-> self offset-target) (* 4096.0 (-> *display* seconds-per-frame))) + (vector-seek! (-> self offset) (-> self offset-target) (* 4096.0 (seconds-per-frame))) (move-to-point! (-> self root-override) (vector+! (new 'stack-no-clear 'vector) (-> (the-as process-drawable (-> self parent 0)) root trans) @@ -2907,27 +2895,27 @@ ) ;; definition for method 3 of type vent -(defmethod inspect vent ((obj vent)) +(defmethod inspect vent ((this vent)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tshow-particles: ~A~%" (-> obj show-particles)) - (format #t "~T~Tcollect-effect: ~A~%" (-> obj collect-effect)) - (format #t "~T~Tcollect-effect2: ~A~%" (-> obj collect-effect2)) - (format #t "~T~Tcollect-effect-time: ~D~%" (-> obj collect-effect-time)) - (format #t "~T~Tblocker: ~A~%" (-> obj blocker)) - (format #t "~T~Tblock-func: ~A~%" (-> obj block-func)) - (format #t "~T~Tpickup-handle: ~D~%" (-> obj pickup-handle)) - obj + (format #t "~T~Tshow-particles: ~A~%" (-> this show-particles)) + (format #t "~T~Tcollect-effect: ~A~%" (-> this collect-effect)) + (format #t "~T~Tcollect-effect2: ~A~%" (-> this collect-effect2)) + (format #t "~T~Tcollect-effect-time: ~D~%" (-> this collect-effect-time)) + (format #t "~T~Tblocker: ~A~%" (-> this blocker)) + (format #t "~T~Tblock-func: ~A~%" (-> this block-func)) + (format #t "~T~Tpickup-handle: ~D~%" (-> this pickup-handle)) + this ) ;; definition for method 20 of type vent ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod initialize vent ((obj vent) (arg0 entity-actor) (arg1 pickup-type)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask actor-pause)) - (let ((s3-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize vent ((this vent) (arg0 entity-actor) (arg1 pickup-type)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s2-0 (new 'process 'collide-shape-prim-sphere s3-0 (the-as uint 0)))) (set! (-> s2-0 prim-core collide-as) (collide-kind powerup)) (set! (-> s2-0 collide-with) (collide-kind target)) @@ -2936,69 +2924,69 @@ ) (set! (-> s3-0 nav-radius) (* 0.75 (-> s3-0 root-prim local-sphere w))) (backup-collide-with-as s3-0) - (set! (-> obj root-override) s3-0) + (set! (-> this root-override) s3-0) ) - (set! (-> obj root-override trans quad) (-> arg0 extra trans quad)) - (update-transforms! (-> obj root-override)) - (set! (-> obj root-override pause-adjust-distance) 409600.0) - (set! (-> obj fact) (new 'process 'fact-info obj arg1 (-> *FACT-bank* eco-full-inc))) - (set! (-> obj block-func) (the-as (function vent symbol) true-func)) - (case (-> obj fact pickup-type) + (set! (-> this root-override trans quad) (-> arg0 extra trans quad)) + (update-transforms! (-> this root-override)) + (set! (-> this root-override pause-adjust-distance) 409600.0) + (set! (-> this fact) (new 'process 'fact-info this arg1 (-> *FACT-bank* eco-full-inc))) + (set! (-> this block-func) (the-as (function vent symbol) true-func)) + (case (-> this fact pickup-type) (((pickup-type eco-blue)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 44) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 67)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 43)) - (set! (-> obj sound) (new 'process 'ambient-sound 'eco-bg-blue (-> obj root-override trans))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 44) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 67)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 43)) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-blue (-> this root-override trans))) ) (((pickup-type eco-red)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 50) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 69)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 49)) - (set! (-> obj sound) (new 'process 'ambient-sound 'eco-bg-red (-> obj root-override trans))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 50) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 69)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 49)) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-red (-> this root-override trans))) ) (((pickup-type eco-green)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 62) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 66)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 61)) - (set! (-> obj sound) (new 'process 'ambient-sound 'eco-bg-green (-> obj root-override trans))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 62) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 66)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 61)) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-green (-> this root-override trans))) ) (((pickup-type eco-yellow)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 52) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 68)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 57)) - (set! (-> obj sound) (new 'process 'ambient-sound 'eco-bg-yellow (-> obj root-override trans))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 52) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 68)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 57)) + (set! (-> this sound) (new 'process 'ambient-sound 'eco-bg-yellow (-> this root-override trans))) ) ) - (set! (-> obj blocker) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (when (-> obj blocker) - (logior! (-> obj fact options) (fact-options vent-blocked)) - (set! (-> obj block-func) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (when (-> this blocker) + (logior! (-> this fact options) (fact-options vent-blocked)) + (set! (-> this block-func) (lambda ((arg0 vent)) (not (logtest? (-> arg0 blocker extra perm status) (entity-perm-status complete)))) ) ) - (set! (-> obj show-particles) #t) - (when (logtest? (-> obj fact options) (fact-options vent-blocked)) - (when (logtest? (-> obj fact options) (fact-options vent-valve)) - (case (-> obj fact pickup-type) + (set! (-> this show-particles) #t) + (when (logtest? (-> this fact options) (fact-options vent-blocked)) + (when (logtest? (-> this fact options) (fact-options vent-valve)) + (case (-> this fact pickup-type) (((pickup-type eco-blue)) - (set! (-> obj block-func) + (set! (-> this block-func) (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task jungle-eggtop))))) ) ) (((pickup-type eco-red)) - (set! (-> obj block-func) + (set! (-> this block-func) (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task red-eggtop))))) ) ) (((pickup-type eco-yellow)) - (set! (-> obj block-func) + (set! (-> this block-func) (the-as (function vent symbol) (lambda () (not (task-complete? *game-info* (game-task snow-eggtop))))) ) ) ) - (process-spawn ecovalve (-> obj block-func) :from *pickup-dead-pool* :to obj) + (process-spawn ecovalve (-> this block-func) :from *pickup-dead-pool* :to this) ) - (if ((-> obj block-func) obj) + (if ((-> this block-func) this) (go vent-blocked) ) ) @@ -3140,16 +3128,16 @@ ) ;; definition for method 3 of type ventyellow -(defmethod inspect ventyellow ((obj ventyellow)) +(defmethod inspect ventyellow ((this ventyellow)) (let ((t9-0 (method-of-type vent inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 11 of type ventyellow -(defmethod init-from-entity! ventyellow ((obj ventyellow) (arg0 entity-actor)) - (initialize obj arg0 (pickup-type eco-yellow)) +(defmethod init-from-entity! ventyellow ((this ventyellow) (arg0 entity-actor)) + (initialize this arg0 (pickup-type eco-yellow)) (none) ) @@ -3163,16 +3151,16 @@ ) ;; definition for method 3 of type ventred -(defmethod inspect ventred ((obj ventred)) +(defmethod inspect ventred ((this ventred)) (let ((t9-0 (method-of-type vent inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 11 of type ventred -(defmethod init-from-entity! ventred ((obj ventred) (arg0 entity-actor)) - (initialize obj arg0 (pickup-type eco-red)) +(defmethod init-from-entity! ventred ((this ventred) (arg0 entity-actor)) + (initialize this arg0 (pickup-type eco-red)) (none) ) @@ -3186,16 +3174,16 @@ ) ;; definition for method 3 of type ventblue -(defmethod inspect ventblue ((obj ventblue)) +(defmethod inspect ventblue ((this ventblue)) (let ((t9-0 (method-of-type vent inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 11 of type ventblue -(defmethod init-from-entity! ventblue ((obj ventblue) (arg0 entity-actor)) - (initialize obj arg0 (pickup-type eco-blue)) +(defmethod init-from-entity! ventblue ((this ventblue) (arg0 entity-actor)) + (initialize this arg0 (pickup-type eco-blue)) (none) ) @@ -3209,15 +3197,15 @@ ) ;; definition for method 3 of type ecovent -(defmethod inspect ecovent ((obj ecovent)) +(defmethod inspect ecovent ((this ecovent)) (let ((t9-0 (method-of-type vent inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 11 of type ecovent -(defmethod init-from-entity! ecovent ((obj ecovent) (arg0 entity-actor)) - (initialize obj arg0 (pickup-type eco-blue)) +(defmethod init-from-entity! ecovent ((this ecovent) (arg0 entity-actor)) + (initialize this arg0 (pickup-type eco-blue)) (none) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc index 71492251fb..01469dd6a8 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/crates_REF.gc @@ -58,12 +58,12 @@ ) ;; definition for method 3 of type crate-bank -(defmethod inspect crate-bank ((obj crate-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~TCOLLIDE_YOFF: ~f~%" (-> obj COLLIDE_YOFF)) - (format #t "~TCOLLIDE_RADIUS: ~f~%" (-> obj COLLIDE_RADIUS)) - (format #t "~TDARKECO_EXPLODE_RADIUS: ~f~%" (-> obj DARKECO_EXPLODE_RADIUS)) - obj +(defmethod inspect crate-bank ((this crate-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~TCOLLIDE_YOFF: ~f~%" (-> this COLLIDE_YOFF)) + (format #t "~TCOLLIDE_RADIUS: ~f~%" (-> this COLLIDE_RADIUS)) + (format #t "~TDARKECO_EXPLODE_RADIUS: ~f~%" (-> this DARKECO_EXPLODE_RADIUS)) + this ) ;; definition for symbol *CRATE-bank*, type crate-bank @@ -102,19 +102,19 @@ ) ;; definition for method 3 of type crate -(defmethod inspect crate ((obj crate)) +(defmethod inspect crate ((this crate)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsmush: #~%" (-> obj smush)) - (format #t "~T~Tbase: ~`vector`P~%" (-> obj base)) - (format #t "~T~Tlook: ~A~%" (-> obj look)) - (format #t "~T~Tdefense: ~A~%" (-> obj defense)) - (format #t "~T~Tincomming-attack-id: ~D~%" (-> obj incomming-attack-id)) - (format #t "~T~Ttarget: ~D~%" (-> obj target)) - (format #t "~T~Tchild-count: ~D~%" (-> obj child-count)) - (format #t "~T~Tvictory-anim: ~A~%" (-> obj victory-anim)) - obj + (format #t "~T~Tsmush: #~%" (-> this smush)) + (format #t "~T~Tbase: ~`vector`P~%" (-> this base)) + (format #t "~T~Tlook: ~A~%" (-> this look)) + (format #t "~T~Tdefense: ~A~%" (-> this defense)) + (format #t "~T~Tincomming-attack-id: ~D~%" (-> this incomming-attack-id)) + (format #t "~T~Ttarget: ~D~%" (-> this target)) + (format #t "~T~Tchild-count: ~D~%" (-> this child-count)) + (format #t "~T~Tvictory-anim: ~A~%" (-> this victory-anim)) + this ) ;; failed to figure out what this is: @@ -860,8 +860,8 @@ (logior! (-> self fact options) (fact-options instant-collect)) ) (when (not arg0) - (let ((s5-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.04)) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 0.04)) (suspend) ) ) @@ -954,8 +954,8 @@ (drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1) (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status complete) #t) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 5)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 5)) (suspend) ) ) @@ -1042,19 +1042,19 @@ ) ;; definition for method 11 of type crate -(defmethod init-from-entity! crate ((obj crate) (arg0 entity-actor)) - (params-init obj arg0) - (art-init obj) - (check-dead obj) +(defmethod init-from-entity! crate ((this crate) (arg0 entity-actor)) + (params-init this arg0) + (art-init this) + (check-dead this) (none) ) ;; definition for method 25 of type crate ;; INFO: Return type mismatch crate vs none. -(defmethod params-init crate ((obj crate) (arg0 entity)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask crate)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod params-init crate ((this crate) (arg0 entity)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask crate)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1072,26 +1072,26 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (let ((v1-27 (-> obj entity extra perm))) - (set! (-> obj fact pickup-amount) - (fmax 0.0 (- (-> obj fact pickup-amount) (the float (-> v1-27 user-int8 1)))) + (let ((v1-27 (-> this entity extra perm))) + (set! (-> this fact pickup-amount) + (fmax 0.0 (- (-> this fact pickup-amount) (the float (-> v1-27 user-int8 1)))) ) ) - (when (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> obj fact pickup-amount) 0.0) + (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-amount) 0.0) ) (when arg0 - (process-drawable-from-entity! obj (the-as entity-actor arg0)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this (the-as entity-actor arg0)) + (logclear! (-> this mask) (process-mask actor-pause)) ) (let ((a0-18 ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'crate-type 'interp -1000000000.0 @@ -1101,21 +1101,21 @@ ) ) ) - (set! (-> obj look) (the-as symbol a0-18)) - (set! (-> obj defense) (the-as symbol a0-18)) + (set! (-> this look) (the-as symbol a0-18)) + (set! (-> this defense) (the-as symbol a0-18)) ) - (case (-> obj fact pickup-type) + (case (-> this fact pickup-type) (((pickup-type buzzer)) - (set! (-> obj type) crate-buzzer) - (when (= (-> obj look) 'wood) - (set! (-> obj look) 'iron) - (set! (-> obj defense) 'iron) + (set! (-> this type) crate-buzzer) + (when (= (-> this look) 'wood) + (set! (-> this look) 'iron) + (set! (-> this defense) 'iron) ) ) (else - (when (= (-> obj look) 'iron) - (set! (-> obj look) 'wood) - (set! (-> obj defense) 'wood) + (when (= (-> this look) 'iron) + (set! (-> this look) 'wood) + (set! (-> this defense) 'wood) ) ) ) @@ -1124,94 +1124,94 @@ ;; definition for method 26 of type crate ;; INFO: Used lq/sq -(defmethod art-init crate ((obj crate)) - (case (-> obj look) +(defmethod art-init crate ((this crate)) + (case (-> this look) (('iron) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense normal-attack)) - (initialize-skeleton obj *crate-iron-sg* '()) + (set! (-> this root-override root-prim prim-core offense) (collide-offense normal-attack)) + (initialize-skeleton this *crate-iron-sg* '()) ) (('steel) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense indestructible)) - (initialize-skeleton obj *crate-steel-sg* '()) + (set! (-> this root-override root-prim prim-core offense) (collide-offense indestructible)) + (initialize-skeleton this *crate-steel-sg* '()) ) (('darkeco) - (when (= (-> obj fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> obj fact pickup-type) (pickup-type none)) - (set! (-> obj fact pickup-amount) 0.0) + (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) ) - (initialize-skeleton obj *crate-darkeco-sg* '()) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (initialize-skeleton this *crate-darkeco-sg* '()) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) ) (('barrel) - (initialize-skeleton obj *crate-barrel-sg* '()) + (initialize-skeleton this *crate-barrel-sg* '()) ) (('bucket) - (when (= (-> obj fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> obj fact pickup-type) (pickup-type none)) - (set! (-> obj fact pickup-amount) 0.0) + (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) ) - (initialize-skeleton obj *crate-bucket-sg* '()) + (initialize-skeleton this *crate-bucket-sg* '()) ) (('none) - (initialize-skeleton obj *crate-wood-sg* '()) - (logior! (-> obj draw status) (draw-status hidden)) + (initialize-skeleton this *crate-wood-sg* '()) + (logior! (-> this draw status) (draw-status hidden)) ) (else - (initialize-skeleton obj *crate-wood-sg* '()) + (initialize-skeleton this *crate-wood-sg* '()) ) ) (cond - ((logtest? (fact-options indestructible) (-> obj fact options)) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense indestructible)) + ((logtest? (fact-options indestructible) (-> this fact options)) + (set! (-> this root-override root-prim prim-core offense) (collide-offense indestructible)) ) - ((logtest? (-> obj fact options) (fact-options strong-attack)) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense strong-attack)) + ((logtest? (-> this fact options) (fact-options strong-attack)) + (set! (-> this root-override root-prim prim-core offense) (collide-offense strong-attack)) ) - ((logtest? (-> obj fact options) (fact-options normal-attack)) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense normal-attack)) + ((logtest? (-> this fact options) (fact-options normal-attack)) + (set! (-> this root-override root-prim prim-core offense) (collide-offense normal-attack)) ) - ((logtest? (-> obj fact options) (fact-options touch)) - (set! (-> obj root-override root-prim prim-core offense) (collide-offense touch)) + ((logtest? (-> this fact options) (fact-options touch)) + (set! (-> this root-override root-prim prim-core offense) (collide-offense touch)) ) ) - (set! (-> obj base quad) (-> obj root-override trans quad)) + (set! (-> this base quad) (-> this root-override trans quad)) (crate-post) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - obj + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + this ) ;; definition for method 27 of type crate ;; INFO: Return type mismatch crate vs none. -(defmethod params-set! crate ((obj crate) (arg0 symbol) (arg1 symbol)) +(defmethod params-set! crate ((this crate) (arg0 symbol) (arg1 symbol)) (if arg0 - (set! (-> obj look) arg0) + (set! (-> this look) arg0) ) (if arg1 - (set! (-> obj defense) arg1) + (set! (-> this defense) arg1) ) (none) ) ;; definition for method 28 of type crate ;; INFO: Return type mismatch int vs none. -(defmethod check-dead crate ((obj crate)) - (if (>= (-> obj entity extra perm user-int8 0) 1) - (go (method-of-object obj die) #t 0) +(defmethod check-dead crate ((this crate)) + (if (>= (-> this entity extra perm user-int8 0) 1) + (go (method-of-object this die) #t 0) ) 0 - (go (method-of-object obj wait)) + (go (method-of-object this wait)) 0 (none) ) ;; definition for method 29 of type crate ;; INFO: Return type mismatch int vs none. -(defmethod smush-update! crate ((obj crate)) - (let ((f0-0 (update! (-> obj smush)))) - (set! (-> obj root-override scale x) (+ 1.0 (* -0.5 f0-0))) - (set! (-> obj root-override scale y) (+ 1.0 f0-0)) - (set! (-> obj root-override scale z) (+ 1.0 (* -0.5 f0-0))) +(defmethod smush-update! crate ((this crate)) + (let ((f0-0 (update! (-> this smush)))) + (set! (-> this root-override scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root-override scale y) (+ 1.0 f0-0)) + (set! (-> this root-override scale z) (+ 1.0 (* -0.5 f0-0))) ) 0 (none) @@ -1227,20 +1227,20 @@ ) ;; definition for method 3 of type barrel -(defmethod inspect barrel ((obj barrel)) +(defmethod inspect barrel ((this barrel)) (let ((t9-0 (method-of-type crate inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 25 of type barrel ;; INFO: Return type mismatch barrel vs none. -(defmethod params-init barrel ((obj barrel) (arg0 entity)) +(defmethod params-init barrel ((this barrel) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj look) 'barrel) + (set! (-> this look) 'barrel) (none) ) @@ -1254,20 +1254,20 @@ ) ;; definition for method 3 of type bucket -(defmethod inspect bucket ((obj bucket)) +(defmethod inspect bucket ((this bucket)) (let ((t9-0 (method-of-type crate inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 25 of type bucket ;; INFO: Return type mismatch bucket vs none. -(defmethod params-init bucket ((obj bucket) (arg0 entity)) +(defmethod params-init bucket ((this bucket) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj look) 'bucket) + (set! (-> this look) 'bucket) (none) ) @@ -1315,29 +1315,29 @@ ) ;; definition for method 3 of type crate-buzzer -(defmethod inspect crate-buzzer ((obj crate-buzzer)) +(defmethod inspect crate-buzzer ((this crate-buzzer)) (let ((t9-0 (method-of-type crate inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 26 of type crate-buzzer ;; INFO: Return type mismatch crate-buzzer vs crate. -(defmethod art-init crate-buzzer ((obj crate-buzzer)) +(defmethod art-init crate-buzzer ((this crate-buzzer)) (let ((t9-0 (method-of-type crate art-init))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 74) obj)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) - (-> obj root-override trans) - ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 74) this)) + (set! (-> this sound) (new + 'process + 'ambient-sound + (static-sound-spec "buzzer" :pitch-mod -762 :fo-max 40) + (-> this root-override trans) + ) ) - (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) - (the-as crate obj) + (set! (-> this victory-anim) (fuel-cell-pick-anim this)) + (the-as crate this) ) ;; failed to figure out what this is: @@ -1347,7 +1347,7 @@ (when (and (and *target* (>= 327680.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.5)) + (time-elapsed? (-> self state-time) (seconds 1.5)) (rand-vu-percent? 0.03) ) (spawn (-> self part) (-> self root-override trans)) @@ -1362,19 +1362,19 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (suspend) (update-transforms! (-> self root-override)) (loop - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-post) (logior! (-> self mask) (process-mask sleep-code)) (suspend) (let ((f30-0 57001.605)) (sound-play "crate-jump") (while (or (!= (-> self smush amp) 0.0) (!= f30-0 0.0)) - (+! f30-0 (* -245760.0 (-> *display* seconds-per-frame))) - (+! (-> self root-override trans y) (* f30-0 (-> *display* seconds-per-frame))) + (+! f30-0 (* -245760.0 (seconds-per-frame))) + (+! (-> self root-override trans y) (* f30-0 (seconds-per-frame))) (when (< (-> self root-override trans y) (-> self base y)) (set! (-> self root-override trans y) (-> self base y)) (set! f30-0 (* -0.5 f30-0)) @@ -1416,32 +1416,32 @@ ) ;; definition for method 3 of type pickup-spawner -(defmethod inspect pickup-spawner ((obj pickup-spawner)) +(defmethod inspect pickup-spawner ((this pickup-spawner)) (let ((t9-0 (method-of-type crate inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tblocker: ~A~%" (-> obj blocker)) - obj + (format #t "~T~Tblocker: ~A~%" (-> this blocker)) + this ) ;; definition for method 25 of type pickup-spawner ;; INFO: Return type mismatch pickup-spawner vs none. -(defmethod params-init pickup-spawner ((obj pickup-spawner) (arg0 entity)) +(defmethod params-init pickup-spawner ((this pickup-spawner) (arg0 entity)) (let ((t9-0 (method-of-type crate params-init))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj look) 'none) - (set! (-> obj blocker) #f) - (if (logtest? (-> obj fact options) (fact-options vent-blocked)) - (set! (-> obj blocker) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (set! (-> this look) 'none) + (set! (-> this blocker) #f) + (if (logtest? (-> this fact options) (fact-options vent-blocked)) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) ) (none) ) ;; definition for method 28 of type pickup-spawner ;; INFO: Return type mismatch int vs none. -(defmethod check-dead pickup-spawner ((obj pickup-spawner)) - (go (method-of-object obj wait)) +(defmethod check-dead pickup-spawner ((this pickup-spawner)) + (go (method-of-object this wait)) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc index d07e16df7d..3bbf67b38d 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/dark-eco-pool_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type dark-eco-pool -(defmethod inspect dark-eco-pool ((obj dark-eco-pool)) +(defmethod inspect dark-eco-pool ((this dark-eco-pool)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for symbol ripple-for-misty-dark-eco-pool, type ripple-wave-set @@ -93,18 +93,18 @@ ;; definition for method 25 of type dark-eco-pool ;; INFO: Return type mismatch object vs none. -(defmethod water-vol-method-25 dark-eco-pool ((obj dark-eco-pool)) +(defmethod water-vol-method-25 dark-eco-pool ((this dark-eco-pool)) (let ((t9-0 (method-of-type water-anim water-vol-method-25))) - (t9-0 obj) + (t9-0 this) ) - (logclear! (-> obj flags) (water-flags wt23)) - (logior! (-> obj flags) (water-flags wt24)) - (set! (-> obj attack-event) + (logclear! (-> this flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt24)) + (set! (-> this attack-event) (the-as symbol ((the-as (function res-lump symbol symbol float structure (pointer res-tag) pointer object) (method-of-type res-lump get-property-struct) ) - (-> obj entity) + (-> this entity) 'attack-event 'interp -1000000000.0 @@ -119,18 +119,18 @@ ;; definition for method 22 of type dark-eco-pool ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 dark-eco-pool ((obj dark-eco-pool)) +(defmethod water-vol-method-22 dark-eco-pool ((this dark-eco-pool)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((gp-0 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) gp-0) + (set! (-> this draw ripple) gp-0) (set! (-> gp-0 global-scale) 3072.0) (set! (-> gp-0 close-fade-dist) 163840.0) (set! (-> gp-0 far-fade-dist) 245760.0) (set! (-> gp-0 waveform) ripple-for-dark-eco-pool) (set! (-> gp-0 query) (new 'process 'ripple-merc-query 100)) - (case (-> obj look) + (case (-> this look) ((32) (set! (-> gp-0 waveform) ripple-for-misty-dark-eco-pool) ) @@ -366,7 +366,7 @@ ) ) (let* ((gp-0 (-> self draw ripple)) - (f0-1 (the float (logand (-> *display* base-frame-counter) #xffff))) + (f0-1 (the float (logand (current-time) #xffff))) (f0-3 (cos (* 5.0 f0-1))) (f30-0 (* f0-3 f0-3)) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/generic-obs-h_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/generic-obs-h_REF.gc index 96662b5ffa..a9da3b09bb 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/generic-obs-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/generic-obs-h_REF.gc @@ -29,26 +29,26 @@ ) ;; definition for method 3 of type manipy -(defmethod inspect manipy ((obj manipy)) +(defmethod inspect manipy ((this manipy)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tnew-trans-hook: ~A~%" (-> obj new-trans-hook)) - (format #t "~T~Tcur-trans-hook: ~A~%" (-> obj cur-trans-hook)) - (format #t "~T~Tcur-event-hook: ~A~%" (-> obj cur-event-hook)) - (format #t "~T~Tnew-joint-anim: ~A~%" (-> obj new-joint-anim)) - (format #t "~T~Tnew-joint-anim-blend: ~D~%" (-> obj new-joint-anim-blend)) - (format #t "~T~Tanim-mode: ~A~%" (-> obj anim-mode)) - (format #t "~T~Tcur-grab-handle: ~D~%" (-> obj cur-grab-handle)) - (format #t "~T~Tcur-target-handle: ~D~%" (-> obj cur-target-handle)) - (format #t "~T~Told-grab-pos: ~`vector`P~%" (-> obj old-grab-pos)) - (format #t "~T~Tjoint[4] @ #x~X~%" (-> obj joint)) - (format #t "~T~Tnew-post-hook: ~A~%" (-> obj new-post-hook)) - (format #t "~T~Tcur-post-hook: ~A~%" (-> obj cur-post-hook)) - (format #t "~T~Tclone-copy-trans: ~A~%" (-> obj clone-copy-trans)) - (format #t "~T~Tshadow-backup: ~A~%" (-> obj shadow-backup)) - (format #t "~T~Tdraw?: ~A~%" (-> obj draw?)) - obj + (format #t "~T~Tnew-trans-hook: ~A~%" (-> this new-trans-hook)) + (format #t "~T~Tcur-trans-hook: ~A~%" (-> this cur-trans-hook)) + (format #t "~T~Tcur-event-hook: ~A~%" (-> this cur-event-hook)) + (format #t "~T~Tnew-joint-anim: ~A~%" (-> this new-joint-anim)) + (format #t "~T~Tnew-joint-anim-blend: ~D~%" (-> this new-joint-anim-blend)) + (format #t "~T~Tanim-mode: ~A~%" (-> this anim-mode)) + (format #t "~T~Tcur-grab-handle: ~D~%" (-> this cur-grab-handle)) + (format #t "~T~Tcur-target-handle: ~D~%" (-> this cur-target-handle)) + (format #t "~T~Told-grab-pos: ~`vector`P~%" (-> this old-grab-pos)) + (format #t "~T~Tjoint[4] @ #x~X~%" (-> this joint)) + (format #t "~T~Tnew-post-hook: ~A~%" (-> this new-post-hook)) + (format #t "~T~Tcur-post-hook: ~A~%" (-> this cur-post-hook)) + (format #t "~T~Tclone-copy-trans: ~A~%" (-> this clone-copy-trans)) + (format #t "~T~Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~T~Tdraw?: ~A~%" (-> this draw?)) + this ) ;; definition of type part-spawner @@ -71,15 +71,15 @@ ) ;; definition for method 3 of type part-spawner -(defmethod inspect part-spawner ((obj part-spawner)) +(defmethod inspect part-spawner ((this part-spawner)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmode: #x~X~%" (-> obj mode)) - (format #t "~T~Tenable: ~A~%" (-> obj enable)) - (format #t "~T~Tradius: (meters ~m)~%" (-> obj radius)) - (format #t "~T~Tworld-sphere: #~%" (-> obj world-sphere)) - obj + (format #t "~T~Tmode: #x~X~%" (-> this mode)) + (format #t "~T~Tenable: ~A~%" (-> this enable)) + (format #t "~T~Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~T~Tworld-sphere: #~%" (-> this world-sphere)) + this ) ;; definition of type part-tracker @@ -108,24 +108,24 @@ ) ;; definition for method 3 of type part-tracker -(defmethod inspect part-tracker ((obj part-tracker)) +(defmethod inspect part-tracker ((this part-tracker)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Troot: ~A~%" (-> obj root)) - (format #t "~T~Tpart: ~A~%" (-> obj part)) - (format #t "~T~Ttarget: ~D~%" (-> obj target)) - (format #t "~T~Tcallback: ~A~%" (-> obj callback)) - (format #t "~T~Tlinger-callback: ~A~%" (-> obj linger-callback)) - (format #t "~T~Tduration: ~D~%" (-> obj duration)) - (format #t "~T~Tlinger-duration: ~D~%" (-> obj linger-duration)) - (format #t "~T~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~T~Toffset: ~`vector`P~%" (-> obj offset)) - (format #t "~T~Tuserdata: ~A~%" (-> obj userdata)) - (format #t "~T~Tuser-time[2] @ #x~X~%" (-> obj user-time)) - (format #t "~T~Tuser-vector[2] @ #x~X~%" (-> obj user-vector)) - (format #t "~T~Tuser-handle[2] @ #x~X~%" (-> obj user-handle)) - obj + (format #t "~T~Troot: ~A~%" (-> this root)) + (format #t "~T~Tpart: ~A~%" (-> this part)) + (format #t "~T~Ttarget: ~D~%" (-> this target)) + (format #t "~T~Tcallback: ~A~%" (-> this callback)) + (format #t "~T~Tlinger-callback: ~A~%" (-> this linger-callback)) + (format #t "~T~Tduration: ~D~%" (-> this duration)) + (format #t "~T~Tlinger-duration: ~D~%" (-> this linger-duration)) + (format #t "~T~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~T~Toffset: ~`vector`P~%" (-> this offset)) + (format #t "~T~Tuserdata: ~A~%" (-> this userdata)) + (format #t "~T~Tuser-time[2] @ #x~X~%" (-> this user-time)) + (format #t "~T~Tuser-vector[2] @ #x~X~%" (-> this user-vector)) + (format #t "~T~Tuser-handle[2] @ #x~X~%" (-> this user-handle)) + this ) ;; definition of type camera-tracker @@ -163,31 +163,31 @@ ) ;; definition for method 3 of type camera-tracker -(defmethod inspect camera-tracker ((obj camera-tracker)) +(defmethod inspect camera-tracker ((this camera-tracker)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tname: ~A~%" (-> obj name)) - (format #t "~T~Tgrab-target: ~D~%" (-> obj grab-target)) - (format #t "~T~Tgrab-event: ~A~%" (-> obj grab-event)) - (format #t "~T~Trelease-event: ~A~%" (-> obj release-event)) - (format #t "~T~Told-global-mask: ~D~%" (-> obj old-global-mask)) - (format #t "~T~Told-self-mask: ~D~%" (-> obj old-self-mask)) - (format #t "~T~Told-parent-mask: ~D~%" (-> obj old-parent-mask)) - (format #t "~T~Tlook-at-target: ~D~%" (-> obj look-at-target)) - (format #t "~T~Tpov-target: ~D~%" (-> obj pov-target)) - (format #t "~T~Twork-process: ~D~%" (-> obj work-process)) - (format #t "~T~Tanim-process: ~D~%" (-> obj anim-process)) - (format #t "~T~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~T~Tcallback: ~A~%" (-> obj callback)) - (format #t "~T~Tuserdata: ~A~%" (-> obj userdata)) - (format #t "~T~Tmessage: ~A~%" (-> obj message)) - (format #t "~T~Tborder-value: ~A~%" (-> obj border-value)) - (format #t "~T~Tmask-to-clear: ~D~%" (-> obj mask-to-clear)) - (format #t "~T~Tscript: ~A~%" (-> obj script)) - (format #t "~T~Tscript-line: ~A~%" (-> obj script-line)) - (format #t "~T~Tscript-func: ~A~%" (-> obj script-func)) - obj + (format #t "~T~Tname: ~A~%" (-> this name)) + (format #t "~T~Tgrab-target: ~D~%" (-> this grab-target)) + (format #t "~T~Tgrab-event: ~A~%" (-> this grab-event)) + (format #t "~T~Trelease-event: ~A~%" (-> this release-event)) + (format #t "~T~Told-global-mask: ~D~%" (-> this old-global-mask)) + (format #t "~T~Told-self-mask: ~D~%" (-> this old-self-mask)) + (format #t "~T~Told-parent-mask: ~D~%" (-> this old-parent-mask)) + (format #t "~T~Tlook-at-target: ~D~%" (-> this look-at-target)) + (format #t "~T~Tpov-target: ~D~%" (-> this pov-target)) + (format #t "~T~Twork-process: ~D~%" (-> this work-process)) + (format #t "~T~Tanim-process: ~D~%" (-> this anim-process)) + (format #t "~T~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~T~Tcallback: ~A~%" (-> this callback)) + (format #t "~T~Tuserdata: ~A~%" (-> this userdata)) + (format #t "~T~Tmessage: ~A~%" (-> this message)) + (format #t "~T~Tborder-value: ~A~%" (-> this border-value)) + (format #t "~T~Tmask-to-clear: ~D~%" (-> this mask-to-clear)) + (format #t "~T~Tscript: ~A~%" (-> this script)) + (format #t "~T~Tscript-line: ~A~%" (-> this script-line)) + (format #t "~T~Tscript-func: ~A~%" (-> this script-func)) + this ) ;; definition of type touch-tracker @@ -210,17 +210,17 @@ ) ;; definition for method 3 of type touch-tracker -(defmethod inspect touch-tracker ((obj touch-tracker)) +(defmethod inspect touch-tracker ((this touch-tracker)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tduration: ~D~%" (-> obj duration)) - (format #t "~T~Ttarget: ~D~%" (-> obj target)) - (format #t "~T~Tevent: ~A~%" (-> obj event)) - (format #t "~T~Trun-function: ~A~%" (-> obj run-function)) - (format #t "~T~Tcallback: ~A~%" (-> obj callback)) - (format #t "~T~Tevent-mode: ~A~%" (-> obj event-mode)) - obj + (format #t "~T~Tduration: ~D~%" (-> this duration)) + (format #t "~T~Ttarget: ~D~%" (-> this target)) + (format #t "~T~Tevent: ~A~%" (-> this event)) + (format #t "~T~Trun-function: ~A~%" (-> this run-function)) + (format #t "~T~Tcallback: ~A~%" (-> this callback)) + (format #t "~T~Tevent-mode: ~A~%" (-> this event-mode)) + this ) ;; definition of type swingpole @@ -241,15 +241,15 @@ ) ;; definition for method 3 of type swingpole -(defmethod inspect swingpole ((obj swingpole)) +(defmethod inspect swingpole ((this swingpole)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Troot: ~A~%" (-> obj root)) - (format #t "~T~Tdir: ~`vector`P~%" (-> obj dir)) - (format #t "~T~Trange: (meters ~m)~%" (-> obj range)) - (format #t "~T~Tedge-length: (meters ~m)~%" (-> obj edge-length)) - obj + (format #t "~T~Troot: ~A~%" (-> this root)) + (format #t "~T~Tdir: ~`vector`P~%" (-> this dir)) + (format #t "~T~Trange: (meters ~m)~%" (-> this range)) + (format #t "~T~Tedge-length: (meters ~m)~%" (-> this edge-length)) + this ) ;; definition of type gui-query @@ -273,16 +273,16 @@ ) ;; definition for method 3 of type gui-query -(defmethod inspect gui-query ((obj gui-query)) - (format #t "[~8x] ~A~%" obj 'gui-query) - (format #t "~Tx-position: ~D~%" (-> obj x-position)) - (format #t "~Ty-position: ~D~%" (-> obj y-position)) - (format #t "~Tmessage: ~A~%" (-> obj message)) - (format #t "~Tdecision: ~A~%" (-> obj decision)) - (format #t "~Tonly-allow-cancel: ~A~%" (-> obj only-allow-cancel)) - (format #t "~Tno-msg: ~A~%" (-> obj no-msg)) - (format #t "~Tmessage-space: ~D~%" (-> obj message-space)) - obj +(defmethod inspect gui-query ((this gui-query)) + (format #t "[~8x] ~A~%" this 'gui-query) + (format #t "~Tx-position: ~D~%" (-> this x-position)) + (format #t "~Ty-position: ~D~%" (-> this y-position)) + (format #t "~Tmessage: ~A~%" (-> this message)) + (format #t "~Tdecision: ~A~%" (-> this decision)) + (format #t "~Tonly-allow-cancel: ~A~%" (-> this only-allow-cancel)) + (format #t "~Tno-msg: ~A~%" (-> this no-msg)) + (format #t "~Tmessage-space: ~D~%" (-> this message-space)) + this ) ;; definition of type othercam @@ -309,22 +309,22 @@ ) ;; definition for method 3 of type othercam -(defmethod inspect othercam ((obj othercam)) +(defmethod inspect othercam ((this othercam)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Thand: ~D~%" (-> obj hand)) - (format #t "~T~Told-global-mask: ~D~%" (-> obj old-global-mask)) - (format #t "~T~Tmask-to-clear: ~D~%" (-> obj mask-to-clear)) - (format #t "~T~Tcam-joint-index: ~D~%" (-> obj cam-joint-index)) - (format #t "~T~Told-pos: #~%" (-> obj old-pos)) - (format #t "~T~Told-mat-z: #~%" (-> obj old-mat-z)) - (format #t "~T~Thad-valid-frame: ~A~%" (-> obj had-valid-frame)) - (format #t "~T~Tborder-value: ~A~%" (-> obj border-value)) - (format #t "~T~Tdie?: ~A~%" (-> obj die?)) - (format #t "~T~Tsurvive-anim-end?: ~A~%" (-> obj survive-anim-end?)) - (format #t "~T~Tspooling?: ~A~%" (-> obj spooling?)) - obj + (format #t "~T~Thand: ~D~%" (-> this hand)) + (format #t "~T~Told-global-mask: ~D~%" (-> this old-global-mask)) + (format #t "~T~Tmask-to-clear: ~D~%" (-> this mask-to-clear)) + (format #t "~T~Tcam-joint-index: ~D~%" (-> this cam-joint-index)) + (format #t "~T~Told-pos: #~%" (-> this old-pos)) + (format #t "~T~Told-mat-z: #~%" (-> this old-mat-z)) + (format #t "~T~Thad-valid-frame: ~A~%" (-> this had-valid-frame)) + (format #t "~T~Tborder-value: ~A~%" (-> this border-value)) + (format #t "~T~Tdie?: ~A~%" (-> this die?)) + (format #t "~T~Tsurvive-anim-end?: ~A~%" (-> this survive-anim-end?)) + (format #t "~T~Tspooling?: ~A~%" (-> this spooling?)) + this ) ;; definition of type process-hidden @@ -339,35 +339,35 @@ ) ;; definition for method 3 of type process-hidden -(defmethod inspect process-hidden ((obj process-hidden)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect process-hidden ((this process-hidden)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc index a28e2d06b6..b7eb5806f0 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/generic-obs_REF.gc @@ -115,8 +115,8 @@ (while (and *target* (= (handle->process (-> *target* control unknown-handle10)) self)) (suspend) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.5)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) (suspend) ) ) @@ -127,19 +127,19 @@ ;; definition for method 11 of type swingpole ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swingpole ((obj swingpole) (arg0 entity-actor)) +(defmethod init-from-entity! swingpole ((this swingpole) (arg0 entity-actor)) "Copy defaults from the entity." - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj root) (new 'process 'trsq)) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 quat)) - (vector-identity! (-> obj root scale)) - (vector-y-quaternion! (-> obj dir) (-> obj root quat)) - (set! (-> obj dir y) 0.0) - (vector-normalize! (-> obj dir) 1.0) - (set! (-> obj range) 12288.0) - (set! (-> obj edge-length) 8192.0) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsq)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (vector-y-quaternion! (-> this dir) (-> this root quat)) + (set! (-> this dir y) 0.0) + (vector-normalize! (-> this dir) 1.0) + (set! (-> this range) 12288.0) + (set! (-> this edge-length) 8192.0) (go swingpole-stance) (none) ) @@ -152,10 +152,10 @@ ;; definition for method 11 of type process-hidden ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! process-hidden ((obj process-hidden) (arg0 entity-actor)) +(defmethod init-from-entity! process-hidden ((this process-hidden) (arg0 entity-actor)) "Copy defaults from the entity." - (process-entity-status! obj (entity-perm-status dead) #t) - (go (method-of-object obj die)) + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die)) (none) ) @@ -168,35 +168,35 @@ ) ;; definition for method 3 of type target-start -(defmethod inspect target-start ((obj target-start)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect target-start ((this target-start)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; definition of type camera-start @@ -208,35 +208,35 @@ ) ;; definition for method 3 of type camera-start -(defmethod inspect camera-start ((obj camera-start)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect camera-start ((this camera-start)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; failed to figure out what this is: @@ -599,11 +599,11 @@ ) ;; definition for method 10 of type part-tracker -(defmethod deactivate part-tracker ((obj part-tracker)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate part-tracker ((this part-tracker)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -630,8 +630,8 @@ ;; failed to figure out what this is: (defstate part-tracker-process (part-tracker) :code (behavior () - (set! (-> self start-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self start-time)) (-> self duration)) + (set-time! (-> self start-time)) + (while (not (time-elapsed? (-> self start-time) (-> self duration))) (let ((gp-0 (handle->process (-> self target)))) (when gp-0 (if (and gp-0 (type-type? (-> gp-0 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-0) root))) @@ -647,8 +647,8 @@ ) (suspend) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (-> self linger-duration)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (-> self linger-duration)) (if (-> self linger-callback) ((-> self linger-callback) self) ) @@ -970,7 +970,7 @@ ;; definition for method 14 of type camera-tracker ;; INFO: Return type mismatch object vs process. ;; ERROR: Failed load: (set! v1-42 (l.wu (+ a0-22 -4))) at op 159 -(defmethod eval camera-tracker ((obj camera-tracker) (arg0 pair)) +(defmethod eval camera-tracker ((this camera-tracker) (arg0 pair)) (with-pp (let ((gp-0 (the-as object #f))) (cond @@ -984,18 +984,18 @@ (('print) (set! gp-0 (car s4-0)) (if (pair? gp-0) - (set! gp-0 (eval obj (the-as pair gp-0))) + (set! gp-0 (eval this (the-as pair gp-0))) ) - (format #t "~A MESSAGE (~D): ~A~%" obj (-> *display* base-frame-counter) gp-0) + (format #t "~A MESSAGE (~D): ~A~%" this (current-time) gp-0) ) (('while) (let ((s3-0 (car s4-0))) - (while (eval obj (the-as pair s3-0)) + (while (eval this (the-as pair s3-0)) (let* ((s2-0 (cdr s4-0)) (a1-3 (car s2-0)) ) (while (not (null? s2-0)) - (set! gp-0 (eval obj (the-as pair a1-3))) + (set! gp-0 (eval this (the-as pair a1-3))) (set! s2-0 (cdr s2-0)) (set! a1-3 (car s2-0)) ) @@ -1005,12 +1005,12 @@ ) (('until) (let ((s3-1 (car s4-0))) - (while (not (eval obj (the-as pair s3-1))) + (while (not (eval this (the-as pair s3-1))) (let* ((s2-1 (cdr s4-0)) (a1-5 (car s2-1)) ) (while (not (null? s2-1)) - (set! gp-0 (eval obj (the-as pair a1-5))) + (set! gp-0 (eval this (the-as pair a1-5))) (set! s2-1 (cdr s2-1)) (set! a1-5 (car s2-1)) ) @@ -1019,21 +1019,21 @@ ) ) (('not) - (set! gp-0 (not (eval obj (the-as pair (car s4-0))))) + (set! gp-0 (not (eval this (the-as pair (car s4-0))))) ) (('wait-for 'wait 'suspend) (let ((s5-1 (command-get-time (car s4-0) 1)) - (s4-1 (-> *display* base-frame-counter)) + (s4-1 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) s4-1) s5-1) + (until (time-elapsed? s4-1 s5-1) (suspend) ) ) ) (('message?) - (when (= (-> obj message) (car s4-0)) - (set! gp-0 (-> obj message)) - (set! (-> obj message) #f) + (when (= (-> this message) (car s4-0)) + (set! gp-0 (-> this message)) + (set! (-> this message) #f) ) ) (('send-event) @@ -1059,13 +1059,13 @@ (('eval) (let ((s4-3 (car s4-0))) (if (and s4-3 (type-type? (-> (the-as basic s4-3) type) function)) - (set! gp-0 ((the-as (function camera-tracker symbol) s4-3) obj)) + (set! gp-0 ((the-as (function camera-tracker symbol) s4-3) this)) ) ) ) (('work-set!) - (set! gp-0 (process->handle (eval obj (the-as pair (car s4-0))))) - (set! (-> obj work-process) (the-as handle gp-0)) + (set! gp-0 (process->handle (eval this (the-as pair (car s4-0))))) + (set! (-> this work-process) (the-as handle gp-0)) ) (('grab) (let ((a0-38 (command-get-process (car s4-0) *target*))) @@ -1073,7 +1073,7 @@ ) ) (('release) - (set! gp-0 (process-release? (handle->process (-> obj grab-target)))) + (set! gp-0 (process-release? (handle->process (-> this grab-target)))) ) (('alive?) (set! gp-0 (command-get-process (car s4-0) *target*)) @@ -1113,11 +1113,11 @@ (format (clear *temp-string*) "*~S-sg*" s2-2) (let ((s2-3 (-> (s1-0 *temp-string*) value))) (when (type-type? (rtype-of s2-3) skeleton-group) - (set! (-> obj anim-process) (the-as handle #f)) + (set! (-> this anim-process) (the-as handle #f)) (let ((s1-1 (get-process *default-dead-pool* manipy #x4000))) (set! gp-0 (when s1-1 (let ((t9-35 (method-of-type manipy activate))) - (t9-35 (the-as manipy s1-1) obj 'manipy (the-as pointer #x70004000)) + (t9-35 (the-as manipy s1-1) this 'manipy (the-as pointer #x70004000)) ) (run-now-in-process s1-1 manipy-init s4-4 #f s2-3 #f) (-> s1-1 ppointer) @@ -1126,7 +1126,7 @@ ) (send-event (-> (the-as (pointer process) gp-0) 0 self) 'anim-mode 'play1) (send-event (-> (the-as (pointer process) gp-0) 0 self) 'art-joint-anim s3-3) - (set! (-> obj anim-process) (ppointer->handle (the-as (pointer process) gp-0))) + (set! (-> this anim-process) (ppointer->handle (the-as (pointer process) gp-0))) ) ) ) @@ -1219,7 +1219,7 @@ (set! (-> self pov-target) (the-as handle #f)) (set! (-> self callback) #f) (set! (-> self userdata) #f) - (set! (-> self start-time) (-> *display* base-frame-counter)) + (set-time! (-> self start-time)) (set! (-> self script) '()) (set! (-> self script-line) '()) (set! (-> self script-func) #f) @@ -1267,14 +1267,14 @@ ) ;; definition for method 3 of type med-res-level -(defmethod inspect med-res-level ((obj med-res-level)) +(defmethod inspect med-res-level ((this med-res-level)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tlevel: ~A~%" (-> obj level)) - (format #t "~T~Tpart-mode: ~A~%" (-> obj part-mode)) - (format #t "~T~Tindex: ~D~%" (-> obj index)) - obj + (format #t "~T~Tlevel: ~A~%" (-> this level)) + (format #t "~T~Tpart-mode: ~A~%" (-> this part-mode)) + (format #t "~T~Tindex: ~D~%" (-> this index)) + this ) ;; failed to figure out what this is: @@ -1339,9 +1339,9 @@ ;; definition for method 11 of type med-res-level ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! med-res-level ((obj med-res-level) (arg0 entity-actor)) +(defmethod init-from-entity! med-res-level ((this med-res-level) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (stack-size-set! (-> obj main-thread) 128) + (stack-size-set! (-> this main-thread) 128) "#f" (let ((s4-0 (the-as (pointer sparticle-launch-group) #f))) (set! sv-16 (new 'static 'res-tag)) @@ -1373,29 +1373,29 @@ (when (the-as object s4-0) (let ((a0-8 (-> s4-0 0))) (if (and (nonzero? a0-8) (= (-> a0-8 type) sparticle-launch-group)) - (set! (-> obj part) (create-launch-control a0-8 obj)) + (set! (-> this part) (create-launch-control a0-8 this)) ) ) ) ) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (let ((s4-1 (res-lump-struct (-> obj entity) 'level structure)) - (s3-1 (res-lump-value (-> obj entity) 'index uint128)) + (process-entity-status! this (entity-perm-status bit-7) #t) + (let ((s4-1 (res-lump-struct (-> this entity) 'level structure)) + (s3-1 (res-lump-value (-> this entity) 'index uint128)) ) (when s4-1 - (set! (-> obj level) (the-as symbol s4-1)) - (set! (-> obj index) (the-as int s3-1)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this level) (the-as symbol s4-1)) + (set! (-> this index) (the-as int s3-1)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (format (clear *lev-string*) "med-res-~S~S" s4-1 (if (zero? s3-1) "" (* s3-1 8) ) ) - (initialize-skeleton-by-name obj *lev-string* '()) - (logior! (-> obj draw status) (draw-status do-not-check-distance)) - (if (nonzero? (-> obj draw)) + (initialize-skeleton-by-name this *lev-string* '()) + (logior! (-> this draw status) (draw-status do-not-check-distance)) + (if (nonzero? (-> this draw)) (go med-res-level-idle) ) ) @@ -1404,9 +1404,9 @@ ) ;; definition for method 20 of type part-spawner -(defmethod is-visible? part-spawner ((obj part-spawner)) - (sphere<-vector+r! (-> obj world-sphere) (-> obj root trans) (-> obj radius)) - (sphere-in-view-frustum? (-> obj world-sphere)) +(defmethod is-visible? part-spawner ((this part-spawner)) + (sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius)) + (sphere-in-view-frustum? (-> this world-sphere)) ) ;; failed to figure out what this is: @@ -1447,18 +1447,18 @@ ;; definition for method 11 of type part-spawner ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! part-spawner ((obj part-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! part-spawner ((this part-spawner) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj radius) 12288.0) - (set! (-> obj enable) - (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this radius) 12288.0) + (set! (-> this enable) + (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete)))) ) - (set! (-> obj sound) (new 'process 'ambient-sound (-> obj entity) (-> obj root trans))) + (set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans))) (let ((s4-0 (the-as object "#f"))) (let ((s3-0 (the-as (pointer sparticle-launch-group) #f))) (set! sv-16 (new 'static 'res-tag)) @@ -1471,7 +1471,7 @@ ) ((= (-> s2-0 -1) string) (when (string= (the-as string s2-0) "group-beach-grotto-1") - (set! (-> obj radius) 61440.0) + (set! (-> this radius) 61440.0) (go beach-part-grotto-1) ) (set! s4-0 s2-0) @@ -1492,11 +1492,11 @@ ) ) ) - (set! (-> obj mode) s3-0) + (set! (-> this mode) s3-0) (when s3-0 (let ((a0-19 (-> s3-0 0))) (when (and (nonzero? a0-19) (= (-> a0-19 type) sparticle-launch-group)) - (set! (-> obj part) (create-launch-control a0-19 obj)) + (set! (-> this part) (create-launch-control a0-19 this)) (go part-spawner-active) ) ) @@ -1529,17 +1529,17 @@ ) ;; definition for method 3 of type launcher -(defmethod inspect launcher ((obj launcher)) +(defmethod inspect launcher ((this launcher)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspring-height: (meters ~m)~%" (-> obj spring-height)) - (format #t "~T~Tcamera: ~A~%" (-> obj camera)) - (format #t "~T~Tactive-distance: ~f~%" (-> obj active-distance)) - (format #t "~T~Tseek-time: ~D~%" (-> obj seek-time)) - (format #t "~T~Tdest: ~`vector`P~%" (-> obj dest)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - obj + (format #t "~T~Tspring-height: (meters ~m)~%" (-> this spring-height)) + (format #t "~T~Tcamera: ~A~%" (-> this camera)) + (format #t "~T~Tactive-distance: ~f~%" (-> this active-distance)) + (format #t "~T~Tseek-time: ~D~%" (-> this seek-time)) + (format #t "~T~Tdest: ~`vector`P~%" (-> this dest)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + this ) ;; failed to figure out what this is: @@ -1852,12 +1852,12 @@ ) ) :code (behavior () - (let ((gp-0 (-> *display* base-frame-counter))) + (let ((gp-0 (current-time))) (loop (when (not (paused?)) (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) (send-event *camera* 'teleport) - (if (and (-> *camera* on-ground) (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1))) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)) ) ) @@ -1916,7 +1916,7 @@ (cam-launcher-long-joystick) ) :code (behavior () - (let ((gp-0 (-> *display* base-frame-counter))) + (let ((gp-0 (current-time))) (loop (when (not (paused?)) (let ((s4-0 (new 'stack-no-clear 'vector)) @@ -1958,7 +1958,7 @@ (set! (-> self trans x) (-> *camera* tpos-curr x)) (set! (-> self trans z) (-> *camera* tpos-curr z)) (vector+! (-> self trans) (-> self trans) (-> self view-flat)) - (if (and (-> *camera* on-ground) (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1))) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) (send-event *camera* 'change-state *camera-base-mode* (seconds 0.5)) ) ) @@ -2027,7 +2027,7 @@ (defstate launcher-active (launcher) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (or (= message 'touch) (= message 'attack)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) (cond @@ -2066,7 +2066,7 @@ (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) ) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) ) (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) @@ -2084,9 +2084,9 @@ ;; definition for method 11 of type launcher ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! launcher ((obj launcher) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 128) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! launcher ((this launcher) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -2095,52 +2095,52 @@ ) (set! (-> s4-0 nav-radius) 13926.4) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (update-transforms! (-> obj root-override)) - (set! (-> obj active-distance) 409600.0) - (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) + (process-drawable-from-entity! this arg0) + (update-transforms! (-> this root-override)) + (set! (-> this active-distance) 409600.0) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) (let ((s4-1 (res-lump-value arg0 'mode uint128))) - (let ((v1-18 (-> obj entity extra level name))) - (set! (-> obj part) (create-launch-control - (cond - ((= v1-18 'beach) - (-> *part-group-id-table* 37) - ) - ((= v1-18 'swamp) - (-> *part-group-id-table* 39) - ) - (else - (-> *part-group-id-table* 38) + (let ((v1-18 (-> this entity extra level name))) + (set! (-> this part) (create-launch-control + (cond + ((= v1-18 'beach) + (-> *part-group-id-table* 37) ) - ) - obj - ) + ((= v1-18 'swamp) + (-> *part-group-id-table* 39) + ) + (else + (-> *part-group-id-table* 38) + ) + ) + this + ) ) ) (let ((v1-24 (logand (the-as int s4-1) 255))) (cond ((= (the-as uint v1-24) 1) - (set! (-> obj camera) cam-launcher-longfall) + (set! (-> this camera) cam-launcher-longfall) ) ((= (the-as uint v1-24) 2) - (set! (-> obj camera) #f) + (set! (-> this camera) #f) ) (else - (set! (-> obj camera) cam-launcher-shortfall) + (set! (-> this camera) cam-launcher-shortfall) ) ) ) ) (let ((v1-29 (res-lump-struct arg0 'alt-vector vector))) (when v1-29 - (set-vector! (-> obj dest) (-> v1-29 x) (-> v1-29 y) (-> v1-29 z) 1.0) - (set! (-> obj seek-time) (the-as time-frame (the int (* 300.0 (-> v1-29 w))))) + (set-vector! (-> this dest) (-> v1-29 x) (-> v1-29 y) (-> v1-29 z) 1.0) + (set! (-> this seek-time) (the-as time-frame (the int (* 300.0 (-> v1-29 w))))) ) ) - (set! (-> obj sound-id) (new-sound-id)) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (set! (-> this sound-id) (new-sound-id)) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) (go launcher-idle) (none) ) @@ -2303,7 +2303,7 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (while ((-> self run-function)) (let* ((gp-0 (handle->process (-> self target))) (a0-4 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable)) @@ -2371,10 +2371,7 @@ (set! (-> self event) #f) (set! (-> self callback) #f) (set! (-> self run-function) - (lambda :behavior touch-tracker - () - (< (- (-> *display* base-frame-counter) (-> self state-time)) (-> self duration)) - ) + (lambda :behavior touch-tracker () (not (time-elapsed? (-> self state-time) (-> self duration)))) ) (set! (-> self event-hook) (-> touch-tracker-idle event)) (go touch-tracker-idle) diff --git a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy-h_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy-h_REF.gc index 7d739495cb..5f5ae0538a 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/nav-enemy-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/nav-enemy-h_REF.gc @@ -61,60 +61,60 @@ ) ;; definition for method 3 of type nav-enemy-info -(defmethod inspect nav-enemy-info ((obj nav-enemy-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tidle-anim: ~D~%" (-> obj idle-anim)) - (format #t "~Twalk-anim: ~D~%" (-> obj walk-anim)) - (format #t "~Tturn-anim: ~D~%" (-> obj turn-anim)) - (format #t "~Tnotice-anim: ~D~%" (-> obj notice-anim)) - (format #t "~Trun-anim: ~D~%" (-> obj run-anim)) - (format #t "~Tjump-anim: ~D~%" (-> obj jump-anim)) - (format #t "~Tjump-land-anim: ~D~%" (-> obj jump-land-anim)) - (format #t "~Tvictory-anim: ~D~%" (-> obj victory-anim)) - (format #t "~Ttaunt-anim: ~D~%" (-> obj taunt-anim)) - (format #t "~Tdie-anim: ~D~%" (-> obj die-anim)) - (format #t "~Tneck-joint: ~D~%" (-> obj neck-joint)) - (format #t "~Tplayer-look-at-joint: ~D~%" (-> obj player-look-at-joint)) - (format #t "~Trun-travel-speed: (meters ~m)~%" (-> obj run-travel-speed)) - (format #t "~Trun-rotate-speed: (deg ~r)~%" (-> obj run-rotate-speed)) - (format #t "~Trun-acceleration: (meters ~m)~%" (-> obj run-acceleration)) - (format #t "~Trun-turn-time: (seconds ~e)~%" (-> obj run-turn-time)) - (format #t "~Twalk-travel-speed: (meters ~m)~%" (-> obj walk-travel-speed)) - (format #t "~Twalk-rotate-speed: (deg ~r)~%" (-> obj walk-rotate-speed)) - (format #t "~Twalk-acceleration: (meters ~m)~%" (-> obj walk-acceleration)) - (format #t "~Twalk-turn-time: (seconds ~e)~%" (-> obj walk-turn-time)) - (format #t "~Tattack-shove-back: (meters ~m)~%" (-> obj attack-shove-back)) - (format #t "~Tattack-shove-up: (meters ~m)~%" (-> obj attack-shove-up)) - (format #t "~Tshadow-size: (meters ~m)~%" (-> obj shadow-size)) - (format #t "~Tnotice-nav-radius: (meters ~m)~%" (-> obj notice-nav-radius)) - (format #t "~Tnav-nearest-y-threshold: (meters ~m)~%" (-> obj nav-nearest-y-threshold)) - (format #t "~Tnotice-distance: (meters ~m)~%" (-> obj notice-distance)) - (format #t "~Tproximity-notice-distance: (meters ~m)~%" (-> obj proximity-notice-distance)) - (format #t "~Tstop-chase-distance: (meters ~m)~%" (-> obj stop-chase-distance)) - (format #t "~Tfrustration-distance: (meters ~m)~%" (-> obj frustration-distance)) - (format #t "~Tfrustration-time: ~D~%" (-> obj frustration-time)) - (format #t "~Tdie-anim-hold-frame: ~f~%" (-> obj die-anim-hold-frame)) - (format #t "~Tjump-anim-start-frame: ~f~%" (-> obj jump-anim-start-frame)) - (format #t "~Tjump-land-anim-end-frame: ~f~%" (-> obj jump-land-anim-end-frame)) - (format #t "~Tjump-height-min: (meters ~m)~%" (-> obj jump-height-min)) - (format #t "~Tjump-height-factor: ~f~%" (-> obj jump-height-factor)) - (format #t "~Tjump-start-anim-speed: ~f~%" (-> obj jump-start-anim-speed)) - (format #t "~Tshadow-max-y: (meters ~m)~%" (-> obj shadow-max-y)) - (format #t "~Tshadow-min-y: (meters ~m)~%" (-> obj shadow-min-y)) - (format #t "~Tshadow-locus-dist: (meters ~m)~%" (-> obj shadow-locus-dist)) - (format #t "~Tuse-align: ~A~%" (-> obj use-align)) - (format #t "~Tdraw-shadow: ~A~%" (-> obj draw-shadow)) - (format #t "~Tmove-to-ground: ~A~%" (-> obj move-to-ground)) - (format #t "~Thover-if-no-ground: ~A~%" (-> obj hover-if-no-ground)) - (format #t "~Tuse-momentum: ~A~%" (-> obj use-momentum)) - (format #t "~Tuse-flee: ~A~%" (-> obj use-flee)) - (format #t "~Tuse-proximity-notice: ~A~%" (-> obj use-proximity-notice)) - (format #t "~Tuse-jump-blocked: ~A~%" (-> obj use-jump-blocked)) - (format #t "~Tuse-jump-patrol: ~A~%" (-> obj use-jump-patrol)) - (format #t "~Tgnd-collide-with: ~D~%" (-> obj gnd-collide-with)) - (format #t "~Tdebug-draw-neck: ~A~%" (-> obj debug-draw-neck)) - (format #t "~Tdebug-draw-jump: ~A~%" (-> obj debug-draw-jump)) - obj +(defmethod inspect nav-enemy-info ((this nav-enemy-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tidle-anim: ~D~%" (-> this idle-anim)) + (format #t "~Twalk-anim: ~D~%" (-> this walk-anim)) + (format #t "~Tturn-anim: ~D~%" (-> this turn-anim)) + (format #t "~Tnotice-anim: ~D~%" (-> this notice-anim)) + (format #t "~Trun-anim: ~D~%" (-> this run-anim)) + (format #t "~Tjump-anim: ~D~%" (-> this jump-anim)) + (format #t "~Tjump-land-anim: ~D~%" (-> this jump-land-anim)) + (format #t "~Tvictory-anim: ~D~%" (-> this victory-anim)) + (format #t "~Ttaunt-anim: ~D~%" (-> this taunt-anim)) + (format #t "~Tdie-anim: ~D~%" (-> this die-anim)) + (format #t "~Tneck-joint: ~D~%" (-> this neck-joint)) + (format #t "~Tplayer-look-at-joint: ~D~%" (-> this player-look-at-joint)) + (format #t "~Trun-travel-speed: (meters ~m)~%" (-> this run-travel-speed)) + (format #t "~Trun-rotate-speed: (deg ~r)~%" (-> this run-rotate-speed)) + (format #t "~Trun-acceleration: (meters ~m)~%" (-> this run-acceleration)) + (format #t "~Trun-turn-time: (seconds ~e)~%" (-> this run-turn-time)) + (format #t "~Twalk-travel-speed: (meters ~m)~%" (-> this walk-travel-speed)) + (format #t "~Twalk-rotate-speed: (deg ~r)~%" (-> this walk-rotate-speed)) + (format #t "~Twalk-acceleration: (meters ~m)~%" (-> this walk-acceleration)) + (format #t "~Twalk-turn-time: (seconds ~e)~%" (-> this walk-turn-time)) + (format #t "~Tattack-shove-back: (meters ~m)~%" (-> this attack-shove-back)) + (format #t "~Tattack-shove-up: (meters ~m)~%" (-> this attack-shove-up)) + (format #t "~Tshadow-size: (meters ~m)~%" (-> this shadow-size)) + (format #t "~Tnotice-nav-radius: (meters ~m)~%" (-> this notice-nav-radius)) + (format #t "~Tnav-nearest-y-threshold: (meters ~m)~%" (-> this nav-nearest-y-threshold)) + (format #t "~Tnotice-distance: (meters ~m)~%" (-> this notice-distance)) + (format #t "~Tproximity-notice-distance: (meters ~m)~%" (-> this proximity-notice-distance)) + (format #t "~Tstop-chase-distance: (meters ~m)~%" (-> this stop-chase-distance)) + (format #t "~Tfrustration-distance: (meters ~m)~%" (-> this frustration-distance)) + (format #t "~Tfrustration-time: ~D~%" (-> this frustration-time)) + (format #t "~Tdie-anim-hold-frame: ~f~%" (-> this die-anim-hold-frame)) + (format #t "~Tjump-anim-start-frame: ~f~%" (-> this jump-anim-start-frame)) + (format #t "~Tjump-land-anim-end-frame: ~f~%" (-> this jump-land-anim-end-frame)) + (format #t "~Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) + (format #t "~Tjump-height-factor: ~f~%" (-> this jump-height-factor)) + (format #t "~Tjump-start-anim-speed: ~f~%" (-> this jump-start-anim-speed)) + (format #t "~Tshadow-max-y: (meters ~m)~%" (-> this shadow-max-y)) + (format #t "~Tshadow-min-y: (meters ~m)~%" (-> this shadow-min-y)) + (format #t "~Tshadow-locus-dist: (meters ~m)~%" (-> this shadow-locus-dist)) + (format #t "~Tuse-align: ~A~%" (-> this use-align)) + (format #t "~Tdraw-shadow: ~A~%" (-> this draw-shadow)) + (format #t "~Tmove-to-ground: ~A~%" (-> this move-to-ground)) + (format #t "~Thover-if-no-ground: ~A~%" (-> this hover-if-no-ground)) + (format #t "~Tuse-momentum: ~A~%" (-> this use-momentum)) + (format #t "~Tuse-flee: ~A~%" (-> this use-flee)) + (format #t "~Tuse-proximity-notice: ~A~%" (-> this use-proximity-notice)) + (format #t "~Tuse-jump-blocked: ~A~%" (-> this use-jump-blocked)) + (format #t "~Tuse-jump-patrol: ~A~%" (-> this use-jump-patrol)) + (format #t "~Tgnd-collide-with: ~D~%" (-> this gnd-collide-with)) + (format #t "~Tdebug-draw-neck: ~A~%" (-> this debug-draw-neck)) + (format #t "~Tdebug-draw-jump: ~A~%" (-> this debug-draw-jump)) + this ) ;; definition of type nav-enemy @@ -211,35 +211,35 @@ ) ;; definition for method 3 of type nav-enemy -(defmethod inspect nav-enemy ((obj nav-enemy)) +(defmethod inspect nav-enemy ((this nav-enemy)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Thit-from-dir: ~`vector`P~%" (-> obj hit-from-dir)) - (format #t "~T~Tevent-param-point: ~`vector`P~%" (-> obj event-param-point)) - (format #t "~T~Tfrustration-point: ~`vector`P~%" (-> obj frustration-point)) - (format #t "~T~Tjump-dest: ~`vector`P~%" (-> obj jump-dest)) - (format #t "~T~Tjump-trajectory: #~%" (-> obj jump-trajectory)) - (format #t "~T~Tjump-time: ~D~%" (-> obj jump-time)) - (format #t "~T~Tnav-info: ~A~%" (-> obj nav-info)) - (format #t "~T~Ttarget-speed: ~f~%" (-> obj target-speed)) - (format #t "~T~Tmomentum-speed: ~f~%" (-> obj momentum-speed)) - (format #t "~T~Tacceleration: ~f~%" (-> obj acceleration)) - (format #t "~T~Trotate-speed: ~f~%" (-> obj rotate-speed)) - (format #t "~T~Tturn-time: ~D~%" (-> obj turn-time)) - (format #t "~T~Tfrustration-time: ~D~%" (-> obj frustration-time)) - (format #t "~T~Tspeed-scale: ~f~%" (-> obj speed-scale)) - (format #t "~T~Tneck: ~A~%" (-> obj neck)) - (format #t "~T~Treaction-time: ~D~%" (-> obj reaction-time)) - (format #t "~T~Tnotice-time: ~D~%" (-> obj notice-time)) - (format #t "~T~Tstate-timeout: ~D~%" (-> obj state-timeout)) - (format #t "~T~Tfree-time: ~D~%" (-> obj free-time)) - (format #t "~T~Ttouch-time: ~D~%" (-> obj touch-time)) - (format #t "~T~Tnav-enemy-flags: ~D~%" (-> obj nav-enemy-flags)) - (format #t "~T~Tincomming-attack-id: ~D~%" (-> obj incomming-attack-id)) - (format #t "~T~Tjump-return-state: ~A~%" (-> obj jump-return-state)) - (format #t "~T~Trand-gen: ~A~%" (-> obj rand-gen)) - obj + (format #t "~T~Thit-from-dir: ~`vector`P~%" (-> this hit-from-dir)) + (format #t "~T~Tevent-param-point: ~`vector`P~%" (-> this event-param-point)) + (format #t "~T~Tfrustration-point: ~`vector`P~%" (-> this frustration-point)) + (format #t "~T~Tjump-dest: ~`vector`P~%" (-> this jump-dest)) + (format #t "~T~Tjump-trajectory: #~%" (-> this jump-trajectory)) + (format #t "~T~Tjump-time: ~D~%" (-> this jump-time)) + (format #t "~T~Tnav-info: ~A~%" (-> this nav-info)) + (format #t "~T~Ttarget-speed: ~f~%" (-> this target-speed)) + (format #t "~T~Tmomentum-speed: ~f~%" (-> this momentum-speed)) + (format #t "~T~Tacceleration: ~f~%" (-> this acceleration)) + (format #t "~T~Trotate-speed: ~f~%" (-> this rotate-speed)) + (format #t "~T~Tturn-time: ~D~%" (-> this turn-time)) + (format #t "~T~Tfrustration-time: ~D~%" (-> this frustration-time)) + (format #t "~T~Tspeed-scale: ~f~%" (-> this speed-scale)) + (format #t "~T~Tneck: ~A~%" (-> this neck)) + (format #t "~T~Treaction-time: ~D~%" (-> this reaction-time)) + (format #t "~T~Tnotice-time: ~D~%" (-> this notice-time)) + (format #t "~T~Tstate-timeout: ~D~%" (-> this state-timeout)) + (format #t "~T~Tfree-time: ~D~%" (-> this free-time)) + (format #t "~T~Ttouch-time: ~D~%" (-> this touch-time)) + (format #t "~T~Tnav-enemy-flags: ~D~%" (-> this nav-enemy-flags)) + (format #t "~T~Tincomming-attack-id: ~D~%" (-> this incomming-attack-id)) + (format #t "~T~Tjump-return-state: ~A~%" (-> this jump-return-state)) + (format #t "~T~Trand-gen: ~A~%" (-> this rand-gen)) + this ) ;; failed to figure out what this is: 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 1276f7cbd6..3aa7ff2024 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 @@ -36,40 +36,39 @@ ) ;; definition for method 9 of type trajectory -;; INFO: this function exists in multiple non-identical object files -(defmethod eval-position! trajectory ((obj trajectory) (time float) (result vector)) - (vector+float*! result (-> obj initial-position) (-> obj initial-velocity) time) - (+! (-> result y) (* 0.5 time time (-> obj gravity))) +(defmethod eval-position! trajectory ((this trajectory) (time float) (result vector)) + (vector+float*! result (-> this initial-position) (-> this initial-velocity) time) + (+! (-> result y) (* 0.5 time time (-> this gravity))) result ) ;; definition for method 7 of type nav-enemy ;; INFO: Return type mismatch none vs nav-enemy. -(defmethod relocate nav-enemy ((obj nav-enemy) (arg0 int)) - (if (nonzero? (-> obj neck)) - (set! (-> obj neck) (the-as joint-mod (+ (the-as int (-> obj neck)) arg0))) +(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))) ) - (if (nonzero? (-> obj rand-gen)) - (set! (-> obj rand-gen) (the-as random-generator (+ (the-as int (-> obj rand-gen)) arg0))) + (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)) obj arg0)) + (the-as nav-enemy ((the-as (function process-drawable int none) (find-parent-method nav-enemy 7)) this arg0)) ) ;; definition for method 42 of type nav-enemy -(defmethod new-patrol-point! nav-enemy ((obj nav-enemy)) +(defmethod new-patrol-point! nav-enemy ((this nav-enemy)) (local-vars (v1-11 symbol)) - (if (<= (-> obj path curve num-cverts) 0) + (if (<= (-> this path curve num-cverts) 0) (go process-drawable-art-error "no path") ) (let ((s5-0 3)) 0 - (let ((s4-0 (-> obj nav destination-pos))) + (let ((s4-0 (-> this nav destination-pos))) (until (or v1-11 (<= s5-0 0)) - (let ((v1-8 (nav-enemy-rnd-int-count (-> obj path curve num-cverts)))) - (eval-path-curve-div! (-> obj path) s4-0 (the float v1-8) 'interp) + (let ((v1-8 (nav-enemy-rnd-int-count (-> this path curve num-cverts)))) + (eval-path-curve-div! (-> this path) s4-0 (the float v1-8) 'interp) ) (+! s5-0 -1) - (set! v1-11 (< 4096.0 (vector-vector-xz-distance s4-0 (-> obj collide-info trans)))) + (set! v1-11 (< 4096.0 (vector-vector-xz-distance s4-0 (-> this collide-info trans)))) ) ) ) @@ -78,39 +77,39 @@ ;; definition for method 39 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod common-post nav-enemy ((obj nav-enemy)) - (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) +(defmethod common-post nav-enemy ((this nav-enemy)) + (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf8)) (or (not *target*) (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) (seconds 0.05)) + (time-elapsed? (-> this touch-time) (seconds 0.05)) ) ) ) - (set-collide-offense (-> obj collide-info) 2 (collide-offense touch)) - (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)) + (set-collide-offense (-> this collide-info) 2 (collide-offense touch)) + (logclear! (-> this nav-enemy-flags) (nav-enemy-flags navenmf8)) ) - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) (when *target* (if *target* (look-at-enemy! (-> *target* neck) - (the-as vector (-> obj collide-info root-prim prim-core)) - (if (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf2)) + (the-as vector (-> this collide-info root-prim prim-core)) + (if (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf2)) 'attacking ) - obj + this ) ) - (if (and (nonzero? (-> obj neck)) (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf14))) - (set-target! (-> obj neck) (target-pos (-> obj nav-info player-look-at-joint))) + (if (and (nonzero? (-> this neck)) (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf14))) + (set-target! (-> this neck) (target-pos (-> this nav-info player-look-at-joint))) ) ) - (when (-> obj nav-info debug-draw-neck) - (if (nonzero? (-> obj neck)) - (joint-mod-debug-draw (-> obj neck)) + (when (-> this nav-info debug-draw-neck) + (if (nonzero? (-> this neck)) + (joint-mod-debug-draw (-> this neck)) ) ) (ja-post) @@ -119,11 +118,11 @@ ) ;; definition for method 44 of type nav-enemy -(defmethod touch-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod touch-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) + (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) @@ -132,11 +131,11 @@ ) ;; definition for method 72 of type nav-enemy -(defmethod nav-enemy-touch-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod nav-enemy-touch-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) + (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) @@ -146,23 +145,23 @@ ;; definition for method 73 of type nav-enemy ;; INFO: Return type mismatch symbol vs object. -(defmethod nav-enemy-attack-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-attack-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (send-event arg0 'get-attack-count 1) - (logclear! (-> obj mask) (process-mask actor-pause attackable)) - (go (method-of-object obj nav-enemy-die)) + (logclear! (-> this mask) (process-mask actor-pause attackable)) + (go (method-of-object this nav-enemy-die)) 'die ) ;; definition for method 43 of type nav-enemy -(defmethod attack-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 event-message-block)) (cond - ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) + ((logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) (send-event arg0 'get-attack-count 1) - (logclear! (-> obj mask) (process-mask actor-pause attackable)) - (go (method-of-object obj nav-enemy-die)) + (logclear! (-> this mask) (process-mask actor-pause attackable)) + (go (method-of-object this nav-enemy-die)) ) (else - (touch-handler obj arg0 arg1) + (touch-handler this arg0 arg1) ) ) ) @@ -189,7 +188,7 @@ (defbehavior nav-enemy-default-event-handler nav-enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) (touch-handler self arg0 arg3) ) (('attack) @@ -238,7 +237,7 @@ (defbehavior nav-enemy-jump-event-handler nav-enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) (nav-enemy-touch-handler self arg0 arg3) ) (('attack) @@ -284,8 +283,8 @@ nav-enemy-default-event-handler ;; definition for method 40 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-40 nav-enemy ((obj nav-enemy)) - (nav-control-method-11 (-> obj nav) (-> obj nav target-pos)) +(defmethod nav-enemy-method-40 nav-enemy ((this nav-enemy)) + (nav-control-method-11 (-> this nav) (-> this nav target-pos)) 0 (none) ) @@ -293,50 +292,50 @@ nav-enemy-default-event-handler ;; definition for method 41 of type nav-enemy ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-41 nav-enemy ((obj nav-enemy)) +(defmethod nav-enemy-method-41 nav-enemy ((this nav-enemy)) (cond - ((-> obj nav-info use-align) + ((-> this nav-info use-align) (align-vel-and-quat-only! - (-> obj align) + (-> this align) (align-opts adjust-xz-vel) - (-> obj nav travel) + (-> this nav travel) (the-as int 1.0) 1.0 - (* (-> obj enemy-info speed) (-> obj speed-scale)) + (* (-> this enemy-info speed) (-> this speed-scale)) ) ) (else (cond - ((-> obj nav-info use-momentum) - (let* ((f0-3 (- (-> obj target-speed) (-> obj momentum-speed))) - (f1-4 (fmin (* (-> obj acceleration) (-> *display* seconds-per-frame)) (fabs f0-3))) + ((-> this nav-info use-momentum) + (let* ((f0-3 (- (-> this target-speed) (-> this momentum-speed))) + (f1-4 (fmin (* (-> this acceleration) (seconds-per-frame)) (fabs f0-3))) ) (if (< f0-3 0.0) - (set! (-> obj momentum-speed) (- (-> obj momentum-speed) f1-4)) - (+! (-> obj momentum-speed) f1-4) + (set! (-> this momentum-speed) (- (-> this momentum-speed) f1-4)) + (+! (-> this momentum-speed) f1-4) ) ) ) (else - (set! (-> obj momentum-speed) (-> obj target-speed)) + (set! (-> this momentum-speed) (-> this target-speed)) ) ) (let* ((f0-12 (fmin - (* (-> obj speed-scale) (-> obj momentum-speed)) - (* (vector-length (-> obj nav travel)) (-> *display* frames-per-second)) + (* (-> this speed-scale) (-> this momentum-speed)) + (* (vector-length (-> this nav travel)) (-> *display* frames-per-second)) ) ) - (v1-15 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj nav travel) f0-12)) + (v1-15 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this nav travel) f0-12)) ) - (set! (-> obj collide-info transv x) (-> v1-15 x)) - (set! (-> obj collide-info transv z) (-> v1-15 z)) + (set! (-> this collide-info transv x) (-> v1-15 x)) + (set! (-> this collide-info transv z) (-> v1-15 z)) ) ) ) - (if (-> obj nav-info move-to-ground) + (if (-> this nav-info move-to-ground) (vector-v++! - (-> obj collide-info transv) - (compute-acc-due-to-gravity (-> obj collide-info) (new-stack-vector0) 0.0) + (-> this collide-info transv) + (compute-acc-due-to-gravity (-> this collide-info) (new-stack-vector0) 0.0) ) ) 0 @@ -345,18 +344,23 @@ nav-enemy-default-event-handler ;; definition for method 37 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-37 nav-enemy ((obj nav-enemy)) - (when (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags enable-travel)) - (if (or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf7)) - (logtest? (nav-control-flags navcf19) (-> obj nav flags)) +(defmethod nav-enemy-method-37 nav-enemy ((this nav-enemy)) + (when (logtest? (-> this nav-enemy-flags) (nav-enemy-flags enable-travel)) + (if (or (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf7)) + (logtest? (nav-control-flags navcf19) (-> this nav flags)) ) (seek-to-point-toward-point! - (-> obj collide-info) - (-> obj nav target-pos) - (-> obj rotate-speed) - (-> obj turn-time) + (-> this collide-info) + (-> this nav target-pos) + (-> this rotate-speed) + (-> this turn-time) + ) + (seek-toward-heading-vec! + (-> this collide-info) + (-> this nav travel) + (-> this rotate-speed) + (-> this turn-time) ) - (seek-toward-heading-vec! (-> obj collide-info) (-> obj nav travel) (-> obj rotate-speed) (-> obj turn-time)) ) ) 0 @@ -365,18 +369,18 @@ nav-enemy-default-event-handler ;; definition for method 38 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-38 nav-enemy ((obj nav-enemy)) - (if (-> obj nav-info move-to-ground) +(defmethod nav-enemy-method-38 nav-enemy ((this nav-enemy)) + (if (-> this nav-info move-to-ground) (integrate-for-enemy-with-move-to-ground! - (-> obj collide-info) - (-> obj collide-info transv) - (-> obj nav-info gnd-collide-with) + (-> this collide-info) + (-> this collide-info transv) + (-> this nav-info gnd-collide-with) 8192.0 #f - (-> obj nav-info hover-if-no-ground) - (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf15)) + (-> this nav-info hover-if-no-ground) + (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf15)) ) - (collide-shape-moving-method-58 (-> obj collide-info) (-> obj collide-info transv)) + (collide-shape-moving-method-58 (-> this collide-info) (-> this collide-info transv)) ) 0 (none) @@ -548,14 +552,14 @@ nav-enemy-default-event-handler ) ;; definition for method 46 of type nav-enemy -(defmethod target-in-range? nav-enemy ((obj nav-enemy) (arg0 float)) +(defmethod target-in-range? nav-enemy ((this nav-enemy) (arg0 float)) (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (and (or (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf12))) - (< (vector-vector-distance (target-pos 0) (-> obj collide-info trans)) arg0) + (and (or (not (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf12))) + (< (vector-vector-distance (target-pos 0) (-> this collide-info trans)) arg0) ) (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) ) @@ -567,7 +571,7 @@ nav-enemy-default-event-handler (let ((gp-0 #f)) (cond ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) - (when (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self notice-time) (-> self reaction-time)) (set! gp-0 #t) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) @@ -582,7 +586,7 @@ nav-enemy-default-event-handler ) ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) - (set! (-> self notice-time) (-> *display* base-frame-counter)) + (set-time! (-> self notice-time)) ) ) ) @@ -732,7 +736,7 @@ nav-enemy-default-event-handler ) (set! (-> self collide-info transv y) 65502.96) (ja :num-func num-func-identity :frame-num 0.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self collide-info status) (cshape-moving-flags onsurf onground tsurf)) (until (ja-done? 0) (cond @@ -768,16 +772,14 @@ nav-enemy-default-event-handler ;; INFO: Return type mismatch int vs none. (defbehavior nav-enemy-turn-to-face-dir nav-enemy ((arg0 vector) (arg1 float)) (local-vars (v1-16 symbol)) - (let ((s4-0 (-> *display* base-frame-counter))) + (let ((s4-0 (current-time))) (ja :group! (-> self draw art-group data (-> self nav-info turn-anim))) (ja :num-func num-func-identity :frame-num 0.0) (until v1-16 (seek-toward-heading-vec! (-> self collide-info) arg0 (-> self rotate-speed) (-> self turn-time)) (suspend) (ja :num! (loop! 0.75)) - (set! v1-16 - (or (>= (- (-> *display* base-frame-counter) s4-0) (seconds 10)) (nav-enemy-facing-direction? arg0 arg1)) - ) + (set! v1-16 (or (time-elapsed? s4-0 (seconds 10)) (nav-enemy-facing-direction? arg0 arg1))) ) ) (forward-up->quaternion (-> self collide-info quat) arg0 *y-vector*) @@ -800,17 +802,17 @@ nav-enemy-default-event-handler ) ;; definition for method 12 of type nav-enemy -(defmethod run-logic? nav-enemy ((obj nav-enemy)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (and (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance)) - (vector-vector-distance (-> obj collide-info trans) (camera-pos)) +(defmethod run-logic? nav-enemy ((this nav-enemy)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (and (>= (+ (-> *ACTOR-bank* pause-dist) (-> this collide-info pause-adjust-distance)) + (vector-vector-distance (-> this collide-info trans) (camera-pos)) ) - (or (logtest? (-> obj draw status) (draw-status was-drawn)) (!= (-> obj next-state name) 'nav-enemy-idle)) + (or (logtest? (-> this draw status) (draw-status was-drawn)) (!= (-> this next-state name) 'nav-enemy-idle)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) @@ -821,7 +823,7 @@ nav-enemy-default-event-handler :event nav-enemy-default-event-handler :enter (behavior () (nav-enemy-neck-control-inactive) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (-> self nav-info move-to-ground) (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (-> self nav-info gnd-collide-with)) ) @@ -833,7 +835,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn)) ) @@ -859,7 +861,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self nav flags) (the-as nav-control-flags (the-as int (logior (nav-control-flags navcf19) (-> self nav flags)))) ) @@ -875,16 +877,16 @@ nav-enemy-default-event-handler (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn))) - (set! (-> self free-time) (-> *display* base-frame-counter)) + (set-time! (-> self free-time)) ) (if (or (or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 2)) + (time-elapsed? (-> self free-time) (seconds 2)) ) (go-virtual nav-enemy-idle) ) @@ -1012,10 +1014,10 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (or (or (not *target*) (< (-> self nav-info stop-chase-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -1063,7 +1065,7 @@ nav-enemy-default-event-handler (if *target* (set! (-> self frustration-point quad) (-> *target* control shadow-pos quad)) ) - (set! (-> self frustration-time) (-> *display* base-frame-counter)) + (set-time! (-> self frustration-time)) 0 (none) ) @@ -1088,8 +1090,8 @@ nav-enemy-default-event-handler :event nav-enemy-default-event-handler :enter (behavior () (nav-enemy-neck-control-look-at) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self free-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) + (set-time! (-> self free-time)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (set! (-> self target-speed) (-> self nav-info run-travel-speed)) (set! (-> self acceleration) (-> self nav-info run-acceleration)) @@ -1111,10 +1113,8 @@ nav-enemy-default-event-handler ) (nav-enemy-reset-frustration) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) - (if (>= (- (-> *display* base-frame-counter) (-> self frustration-time)) - (+ (-> self reaction-time) (-> self nav-info frustration-time)) - ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (time-elapsed? (-> self frustration-time) (+ (-> self reaction-time) (-> self nav-info frustration-time))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf13)) ) (if (or (not (target-in-range? self (-> self nav-info stop-chase-distance))) @@ -1124,12 +1124,12 @@ nav-enemy-default-event-handler ) (cond ((logtest? (nav-control-flags navcf17) (-> self nav flags)) - (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) + (if (time-elapsed? (-> self free-time) (seconds 1)) (go-virtual nav-enemy-patrol) ) ) (else - (set! (-> self free-time) (-> *display* base-frame-counter)) + (set-time! (-> self free-time)) ) ) ) @@ -1153,7 +1153,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let* ((f30-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0))) (gp-1 (the int (+ (lerp-scale 600.0 1800.0 f30-0 32768.0 122880.0) (nav-enemy-rnd-float-range 0.0 30.0)))) ) @@ -1168,7 +1168,7 @@ nav-enemy-default-event-handler (set! (-> self turn-time) (-> self nav-info walk-turn-time)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (go-virtual nav-enemy-patrol) ) @@ -1180,7 +1180,7 @@ nav-enemy-default-event-handler ) ) (logtest? (nav-control-flags navcf17) (-> self nav flags)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) ) (go-virtual nav-enemy-stare) ) @@ -1205,7 +1205,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((f0-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0)))) (set! (-> self state-timeout) @@ -1223,20 +1223,18 @@ nav-enemy-default-event-handler (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (go-virtual nav-enemy-patrol) ) (cond ((target-in-range? self (-> self nav-info notice-distance)) - (if (and (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) - (not (nav-enemy-frustrated?)) - ) + (if (and (time-elapsed? (-> self notice-time) (-> self reaction-time)) (not (nav-enemy-frustrated?))) (go-virtual nav-enemy-chase) ) ) (else - (set! (-> self notice-time) (-> *display* base-frame-counter)) + (set-time! (-> self notice-time)) ) ) (when (not (or (and *target* (>= 40960.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) @@ -1249,7 +1247,7 @@ nav-enemy-default-event-handler ) ) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) (go-virtual nav-enemy-give-up) ) ) @@ -1274,12 +1272,12 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (nav-enemy-neck-control-inactive) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (target-in-range? self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) ) @@ -1398,7 +1396,7 @@ nav-enemy-default-event-handler ) ) (when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) - (let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self jump-time))))) + (let ((f30-0 (the float (- (current-time) (-> self jump-time))))) (let ((v1-12 (eval-position! (-> self jump-trajectory) f30-0 (new 'stack-no-clear 'vector)))) (set! (-> self collide-info trans quad) (-> v1-12 quad)) ) @@ -1480,7 +1478,7 @@ nav-enemy-default-event-handler ) ) (logclear! (-> self collide-info status) (cshape-moving-flags onsurf onground tsurf)) - (set! (-> self jump-time) (-> *display* base-frame-counter)) + (set-time! (-> self jump-time)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate)) (cond ((logtest? (-> self nav-enemy-flags) (nav-enemy-flags drop-jump)) @@ -1502,7 +1500,7 @@ nav-enemy-default-event-handler (ja :num-func num-func-identity :frame-num (ja-aframe arg1 0)) ) ) - (while (< (the float (- (-> *display* base-frame-counter) (-> self jump-time))) (-> self jump-trajectory time)) + (while (< (the float (- (current-time) (-> self jump-time))) (-> self jump-trajectory time)) (suspend) (ja :num! (seek!)) (ja-blend-eval) @@ -1549,7 +1547,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-jump-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (and (-> self nav-info use-jump-blocked) (nav-enemy-method-50 self (-> self event-param-point))) (go-virtual nav-enemy-jump-blocked) ) @@ -1629,7 +1627,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self nav flags) (nav-control-flags navcf19)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self collide-info transv quad)) @@ -1641,7 +1639,7 @@ nav-enemy-default-event-handler ) ) :trans (behavior () - (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (if (or (time-elapsed? (-> self state-time) (seconds 0.5)) (logtest? (nav-control-flags navcf19) (-> self nav flags)) ) (go-virtual nav-enemy-chase) @@ -1659,10 +1657,10 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (go (-> self jump-return-state)) ) ) @@ -1688,7 +1686,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)) (ja-channel-push! 1 (seconds 0.1)) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) @@ -1701,9 +1699,9 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.1)) (nav-enemy-turn-to-face-point (-> self event-param-point) 910.2222) (let ((gp-0 (nav-enemy-rnd-int-range 0 150)) - (s5-0 (-> *display* base-frame-counter)) + (s5-0 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) + (until (time-elapsed? s5-0 gp-0) (ja :num! (loop! f30-0)) (suspend) ) @@ -1725,7 +1723,7 @@ nav-enemy-default-event-handler 0 ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (nav-enemy-initialize-jump (-> self event-param-point)) (nav-enemy-neck-control-look-at) (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) @@ -1756,57 +1754,57 @@ nav-enemy-default-event-handler ;; definition for method 45 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod init-defaults! nav-enemy ((obj nav-enemy) (arg0 nav-enemy-info)) - (set! (-> obj rand-gen) (new 'process 'random-generator)) - (set! (-> obj rand-gen seed) (the-as uint #x666edd1e)) - (set! (-> obj mask) (the-as process-mask (logior (process-mask enemy) (-> obj mask)))) - (init-jm! obj arg0) - (if (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) +(defmethod init-defaults! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) + (set! (-> this rand-gen) (new 'process 'random-generator)) + (set! (-> this rand-gen seed) (the-as uint #x666edd1e)) + (set! (-> this mask) (the-as process-mask (logior (process-mask enemy) (-> this mask)))) + (init-jm! this arg0) + (if (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control - (-> obj nav-info shadow-min-y) - (-> obj nav-info shadow-max-y) - (-> obj nav-info shadow-locus-dist) + (-> this nav-info shadow-min-y) + (-> this nav-info shadow-max-y) + (-> this nav-info shadow-locus-dist) (the-as float 17) 245760.0 ) ) - (set! (-> obj draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) + (set! (-> this draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) ) - (set! (-> obj align) (new 'process 'align-control obj)) - (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 16 (-> arg0 nav-nearest-y-threshold))) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj nav gap-event) 'jump) - (nav-control-method-26 (-> obj nav)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj enemy-info) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this nav) (new 'process 'nav-control (-> this collide-info) 16 (-> arg0 nav-nearest-y-threshold))) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this nav gap-event) 'jump) + (nav-control-method-26 (-> this nav)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this enemy-info) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj reaction-time) (nav-enemy-rnd-int-range (seconds 0.1) (seconds 0.8))) - (set! (-> obj speed-scale) 1.0) - (logior! (-> obj nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel navenmf5 navenmf6 navenmf12)) + (set! (-> this reaction-time) (nav-enemy-rnd-int-range (seconds 0.1) (seconds 0.8))) + (set! (-> this speed-scale) 1.0) + (logior! (-> this nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel navenmf5 navenmf6 navenmf12)) 0 (none) ) ;; definition for method 49 of type nav-enemy -(defmethod init-jm! nav-enemy ((obj nav-enemy) (arg0 nav-enemy-info)) - (set! (-> obj nav-info) arg0) - (set! (-> obj rotate-speed) (-> obj nav-info walk-rotate-speed)) - (set! (-> obj turn-time) (-> obj nav-info walk-turn-time)) - (when (and (!= (-> obj nav-info neck-joint) -1) (zero? (-> obj neck))) - (set! (-> obj neck) - (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj (-> obj nav-info neck-joint)) +(defmethod init-jm! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) + (set! (-> this nav-info) arg0) + (set! (-> this rotate-speed) (-> this nav-info walk-rotate-speed)) + (set! (-> this turn-time) (-> this nav-info walk-turn-time)) + (when (and (!= (-> this nav-info neck-joint) -1) (zero? (-> this neck))) + (set! (-> this neck) + (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) this (-> this nav-info neck-joint)) ) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 102400.0) - (set! (-> obj neck ignore-angle) 16384.0) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) ) ) @@ -1834,46 +1832,46 @@ nav-enemy-default-event-handler ;; definition for method 47 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision nav-enemy ((obj nav-enemy)) +(defmethod initialize-collision nav-enemy ((this nav-enemy)) 0 (none) ) ;; definition for method 48 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 nav-enemy ((obj nav-enemy)) +(defmethod nav-enemy-method-48 nav-enemy ((this nav-enemy)) 0 (none) ) ;; definition for method 59 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-59 nav-enemy ((obj nav-enemy)) - (go (method-of-object obj nav-enemy-idle)) +(defmethod nav-enemy-method-59 nav-enemy ((this nav-enemy)) + (go (method-of-object this nav-enemy-idle)) 0 (none) ) ;; definition for method 11 of type nav-enemy ;; INFO: Return type mismatch int vs none. -(defmethod init-from-entity! nav-enemy ((obj nav-enemy) (arg0 entity-actor)) - (initialize-collision obj) - (process-drawable-from-entity! obj arg0) - (nav-enemy-method-48 obj) - (nav-enemy-method-59 obj) +(defmethod init-from-entity! nav-enemy ((this nav-enemy) (arg0 entity-actor)) + (initialize-collision this) + (process-drawable-from-entity! this arg0) + (nav-enemy-method-48 this) + (nav-enemy-method-59 this) 0 (none) ) ;; definition for method 50 of type nav-enemy ;; INFO: Used lq/sq -(defmethod nav-enemy-method-50 nav-enemy ((obj nav-enemy) (arg0 vector)) +(defmethod nav-enemy-method-50 nav-enemy ((this nav-enemy) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj collide-info trans quad)) - (set! (-> obj collide-info trans quad) (-> arg0 quad)) - (let ((gp-0 (-> obj nav))) + (set! (-> s4-0 quad) (-> this collide-info trans quad)) + (set! (-> this collide-info trans quad) (-> arg0 quad)) + (let ((gp-0 (-> this nav))) (nav-control-method-28 gp-0 (the-as collide-kind -1)) - (set! (-> obj collide-info trans quad) (-> s4-0 quad)) + (set! (-> this collide-info trans quad) (-> s4-0 quad)) (let* ((v1-8 (-> gp-0 mesh origin)) (f0-1 (- (-> arg0 x) (-> v1-8 x))) (f1-2 (- (-> arg0 z) (-> v1-8 z))) diff --git a/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc index 5d864e575e..4cad7ac777 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/orb-cache_REF.gc @@ -29,20 +29,20 @@ ) ;; definition for method 3 of type orb-cache-top -(defmethod inspect orb-cache-top ((obj orb-cache-top)) +(defmethod inspect orb-cache-top ((this orb-cache-top)) (let ((t9-0 (method-of-type baseplat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tactive-distance: ~f~%" (-> obj active-distance)) - (format #t "~T~Tinactive-distance: ~f~%" (-> obj inactive-distance)) - (format #t "~T~Tmoney-list[60] @ #x~X~%" (-> obj money-list)) - (format #t "~T~Tmoney-pos-list[60] @ #x~X~%" (-> obj money-pos-list)) - (format #t "~T~Tmoney-pos-actual[60] @ #x~X~%" (-> obj money-pos-actual)) - (format #t "~T~Tplatform-pos: ~f~%" (-> obj platform-pos)) - (format #t "~T~Troot-pos: ~f~%" (-> obj root-pos)) - (format #t "~T~Tmoney: ~D~%" (-> obj money)) - (format #t "~T~Tactivated: ~A~%" (-> obj activated)) - obj + (format #t "~T~Tactive-distance: ~f~%" (-> this active-distance)) + (format #t "~T~Tinactive-distance: ~f~%" (-> this inactive-distance)) + (format #t "~T~Tmoney-list[60] @ #x~X~%" (-> this money-list)) + (format #t "~T~Tmoney-pos-list[60] @ #x~X~%" (-> this money-pos-list)) + (format #t "~T~Tmoney-pos-actual[60] @ #x~X~%" (-> this money-pos-actual)) + (format #t "~T~Tplatform-pos: ~f~%" (-> this platform-pos)) + (format #t "~T~Troot-pos: ~f~%" (-> this root-pos)) + (format #t "~T~Tmoney: ~D~%" (-> this money)) + (format #t "~T~Tactivated: ~A~%" (-> this activated)) + this ) ;; failed to figure out what this is: @@ -101,31 +101,31 @@ ;; definition for method 22 of type orb-cache-top ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-22 orb-cache-top ((obj orb-cache-top)) - (if (< 4096.0 (- (-> obj basetrans y) (-> obj root-pos))) - (activate! (-> obj smush) -1.0 60 150 1.0 1.0) - (activate! (-> obj smush) -0.5 60 150 1.0 1.0) +(defmethod baseplat-method-22 orb-cache-top ((this orb-cache-top)) + (if (< 4096.0 (- (-> this basetrans y) (-> this root-pos))) + (activate! (-> this smush) -1.0 60 150 1.0 1.0) + (activate! (-> this smush) -0.5 60 150 1.0 1.0) ) - (set! (-> obj bouncing) #t) - (logclear! (-> obj mask) (process-mask sleep)) + (set! (-> this bouncing) #t) + (logclear! (-> this mask) (process-mask sleep)) 0 (none) ) ;; definition for method 28 of type orb-cache-top ;; INFO: Return type mismatch int vs none. -(defmethod calculate-pos orb-cache-top ((obj orb-cache-top) (arg0 symbol)) +(defmethod calculate-pos orb-cache-top ((this orb-cache-top) (arg0 symbol)) (let ((f0-0 0.0)) (when arg0 - (set! f0-0 (+ 10240.0 (* 6144.0 (the float (+ (-> obj money) -1))))) + (set! f0-0 (+ 10240.0 (* 6144.0 (the float (+ (-> this money) -1))))) (if (< f0-0 2048.0) (set! f0-0 2048.0) ) ) - (set! (-> obj platform-pos) (+ (-> obj root-pos) f0-0)) + (set! (-> this platform-pos) (+ (-> this root-pos) f0-0)) (let ((f0-2 (+ -6144.0 f0-0))) - (dotimes (v1-5 (-> obj money)) - (set! (-> obj money-pos-list v1-5) (+ (-> obj root-pos) f0-2)) + (dotimes (v1-5 (-> this money)) + (set! (-> this money-pos-list v1-5) (+ (-> this root-pos) f0-2)) (set! f0-2 (+ -6144.0 f0-2)) ) ) @@ -136,19 +136,19 @@ ;; definition for method 27 of type orb-cache-top ;; INFO: Used lq/sq -(defmethod pos-logic orb-cache-top ((obj orb-cache-top) (arg0 symbol)) - (dotimes (s4-0 (-> obj money)) - (when (not (handle->process (-> obj money-list s4-0))) - (dotimes (v1-6 (-> obj money)) +(defmethod pos-logic orb-cache-top ((this orb-cache-top) (arg0 symbol)) + (dotimes (s4-0 (-> this money)) + (when (not (handle->process (-> this money-list s4-0))) + (dotimes (v1-6 (-> this money)) (when (< s4-0 v1-6) - (set! (-> obj money-list (+ v1-6 -1)) (-> obj money-list v1-6)) - (set! (-> obj money-pos-actual (+ v1-6 -1)) (-> obj money-pos-actual v1-6)) + (set! (-> this money-list (+ v1-6 -1)) (-> this money-list v1-6)) + (set! (-> this money-pos-actual (+ v1-6 -1)) (-> this money-pos-actual v1-6)) ) ) - (+! (-> obj money) -1) - (calculate-pos obj arg0) + (+! (-> this money) -1) + (calculate-pos this arg0) (+! s4-0 -1) - (let ((v1-15 (-> obj entity extra perm))) + (let ((v1-15 (-> this entity extra perm))) (logior! (-> v1-15 status) (entity-perm-status user-set-from-cstage)) (+! (-> v1-15 user-int16 0) 1) ) @@ -158,16 +158,16 @@ (s5-1 #t) ) (let ((s3-0 #f)) - (let ((f28-0 (- (-> obj basetrans y) (-> obj root-pos))) - (f30-0 (- (-> obj platform-pos) (-> obj root-pos))) + (let ((f28-0 (- (-> this basetrans y) (-> this root-pos))) + (f30-0 (- (-> this platform-pos) (-> this root-pos))) ) - (when (zero? (-> obj money)) + (when (zero? (-> this money)) (set! f30-0 2048.0) (set! s3-0 #t) ) (when (and (< f30-0 15155.2) - (and *target* (>= 16384.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))) - (< (-> (target-pos 0) y) (-> obj basetrans y)) + (and *target* (>= 16384.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans)))) + (< (-> (target-pos 0) y) (-> this basetrans y)) ) (set! f30-0 (if (< 14131.2 f28-0) 15155.2 @@ -176,28 +176,24 @@ ) (set! s3-0 #f) ) - (seek! (-> obj basetrans y) (+ (-> obj root-pos) f30-0) (* 40960.0 (-> *display* seconds-per-frame))) - (if (not (= (-> obj basetrans y) (+ (-> obj root-pos) f30-0))) + (seek! (-> this basetrans y) (+ (-> this root-pos) f30-0) (* 40960.0 (seconds-per-frame))) + (if (not (= (-> this basetrans y) (+ (-> this root-pos) f30-0))) (set! s5-1 #f) ) ) - (dotimes (s2-0 (-> obj money)) + (dotimes (s2-0 (-> this money)) (set! (-> s4-1 quad) - (-> (the-as process-drawable (handle->process (-> obj money-list s2-0))) root trans quad) + (-> (the-as process-drawable (handle->process (-> this money-list s2-0))) root trans quad) ) - (seek! - (-> obj money-pos-actual s2-0) - (-> obj money-pos-list s2-0) - (* 40960.0 (-> *display* seconds-per-frame)) - ) - (if (not (= (-> obj money-pos-actual s2-0) (-> obj money-pos-list s2-0))) + (seek! (-> this money-pos-actual s2-0) (-> this money-pos-list s2-0) (* 40960.0 (seconds-per-frame))) + (if (not (= (-> this money-pos-actual s2-0) (-> this money-pos-list s2-0))) (set! s5-1 #f) ) - (if (>= (-> obj money-pos-actual s2-0) (+ -8192.0 (-> obj root-pos))) - (set! (-> s4-1 y) (-> obj money-pos-actual s2-0)) - (set! (-> s4-1 y) (+ -8192.0 (-> obj root-pos))) + (if (>= (-> this money-pos-actual s2-0) (+ -8192.0 (-> this root-pos))) + (set! (-> s4-1 y) (-> this money-pos-actual s2-0)) + (set! (-> s4-1 y) (+ -8192.0 (-> this root-pos))) ) - (send-event (handle->process (-> obj money-list s2-0)) 'trans s4-1) + (send-event (handle->process (-> this money-list s2-0)) 'trans s4-1) ) (set! s3-0 (and s5-1 s3-0)) (if s3-0 @@ -302,8 +298,8 @@ ;; definition for method 11 of type orb-cache-top ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! orb-cache-top ((obj orb-cache-top) (arg0 entity-actor)) - (let ((a0-1 (-> obj entity))) +(defmethod init-from-entity! orb-cache-top ((this orb-cache-top) (arg0 entity-actor)) + (let ((a0-1 (-> this entity))) (if (when a0-1 (let ((a0-2 (-> a0-1 extra perm task))) (if a0-2 @@ -311,10 +307,10 @@ ) ) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -332,37 +328,37 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *orb-cache-top-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (set! (-> obj money) (res-lump-value (-> obj entity) 'orb-cache-count int :default (the-as uint128 20))) - (set! (-> obj active-distance) 61440.0) - (set! (-> obj inactive-distance) 245760.0) - (set! (-> obj root-pos) (-> obj basetrans y)) - (set! (-> obj platform-pos) (-> obj root-pos)) - (set! (-> obj activated) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *orb-cache-top-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (set! (-> this money) (res-lump-value (-> this entity) 'orb-cache-count int :default (the-as uint128 20))) + (set! (-> this active-distance) 61440.0) + (set! (-> this inactive-distance) 245760.0) + (set! (-> this root-pos) (-> this basetrans y)) + (set! (-> this platform-pos) (-> this root-pos)) + (set! (-> this activated) (the-as symbol - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) ) ) - (let ((v1-39 (-> obj entity extra perm))) + (let ((v1-39 (-> this entity extra perm))) (logior! (-> v1-39 status) (entity-perm-status user-set-from-cstage)) - (set! (-> obj money) (- (-> obj money) (-> v1-39 user-int16 0))) + (set! (-> this money) (- (-> this money) (-> v1-39 user-int16 0))) ) - (dotimes (v1-42 (-> obj money)) - (set! (-> obj money-list v1-42) (the-as handle #f)) + (dotimes (v1-42 (-> this money)) + (set! (-> this money-list v1-42) (the-as handle #f)) ) (cond - ((zero? (-> obj money)) + ((zero? (-> this money)) (go orb-cache-top-complete #t) ) - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go orb-cache-top-activate #t) ) (else diff --git a/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc index 6fbc85c549..2c582a1f79 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/plat-button_REF.gc @@ -36,20 +36,20 @@ ) ;; definition for method 3 of type plat-button -(defmethod inspect plat-button ((obj plat-button)) +(defmethod inspect plat-button ((this plat-button)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tgo-back-if-lost-player?: ~A~%" (-> obj go-back-if-lost-player?)) - (format #t "~T~Tgrab-player?: ~A~%" (-> obj grab-player?)) - (format #t "~T~Tshould-grab-player?: ~A~%" (-> obj should-grab-player?)) - (format #t "~T~Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~T~Tbidirectional?: ~A~%" (-> obj bidirectional?)) - (format #t "~T~Tallow-auto-kill: ~A~%" (-> obj allow-auto-kill)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~T~Ttrans-off: #~%" (-> obj trans-off)) - (format #t "~T~Tspawn-pos: #~%" (-> obj spawn-pos)) - obj + (format #t "~T~Tgo-back-if-lost-player?: ~A~%" (-> this go-back-if-lost-player?)) + (format #t "~T~Tgrab-player?: ~A~%" (-> this grab-player?)) + (format #t "~T~Tshould-grab-player?: ~A~%" (-> this should-grab-player?)) + (format #t "~T~Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~T~Tbidirectional?: ~A~%" (-> this bidirectional?)) + (format #t "~T~Tallow-auto-kill: ~A~%" (-> this allow-auto-kill)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~T~Ttrans-off: #~%" (-> this trans-off)) + (format #t "~T~Tspawn-pos: #~%" (-> this spawn-pos)) + this ) ;; failed to figure out what this is: @@ -59,13 +59,13 @@ ) ;; definition for method 30 of type plat-button -(defmethod should-teleport? plat-button ((obj plat-button)) +(defmethod should-teleport? plat-button ((this plat-button)) #f ) ;; definition for method 26 of type plat-button -(defmethod can-activate? plat-button ((obj plat-button)) - (or (= (-> obj path-pos) 0.0) (and (-> obj bidirectional?) (= (-> obj path-pos) 1.0))) +(defmethod can-activate? plat-button ((this plat-button)) + (or (= (-> this path-pos) 0.0) (and (-> this bidirectional?) (= (-> this path-pos) 1.0))) ) ;; failed to figure out what this is: @@ -186,12 +186,12 @@ :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (or (= message 'touch) (= message 'attack)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) (set-setting! 'allow-look-around #f 0.0 0) @@ -207,7 +207,7 @@ (rider-trans) (when (-> self go-back-if-lost-player?) (when (or (not *target*) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (and (time-elapsed? (-> self state-time) (seconds 4)) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) @@ -218,7 +218,7 @@ (go-virtual plat-button-move-upward) ) ) - (let ((f0-4 (seek-with-smooth (-> self path-pos) 1.0 (* 0.1 (-> *display* seconds-per-frame)) 0.25 0.001))) + (let ((f0-4 (seek-with-smooth (-> self path-pos) 1.0 (* 0.1 (seconds-per-frame)) 0.25 0.001))) (set! (-> self path-pos) f0-4) (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> self path) gp-0 f0-4 'interp) @@ -257,12 +257,12 @@ :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (or (= message 'touch) (= message 'attack)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status bit-3) #t) (plat-button-camera-on) (set-setting! 'allow-look-around #f 0.0 0) @@ -278,7 +278,7 @@ (rider-trans) (when (-> self go-back-if-lost-player?) (when (or (not *target*) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (and (time-elapsed? (-> self state-time) (seconds 4)) (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) @@ -289,7 +289,7 @@ (go-virtual plat-button-move-downward) ) ) - (let ((f0-4 (seek-with-smooth (-> self path-pos) 0.0 (* 0.1 (-> *display* seconds-per-frame)) 0.25 0.001))) + (let ((f0-4 (seek-with-smooth (-> self path-pos) 0.0 (* 0.1 (seconds-per-frame)) 0.25 0.001))) (set! (-> self path-pos) f0-4) (let ((gp-0 (new 'stack-no-clear 'vector))) (eval-path-curve! (-> self path) gp-0 f0-4 'interp) @@ -344,8 +344,8 @@ ) ;; definition for method 28 of type plat-button -(defmethod plat-button-method-28 plat-button ((obj plat-button)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod plat-button-method-28 plat-button ((this plat-button)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -380,104 +380,104 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) s5-0 ) ) ;; definition for method 29 of type plat-button ;; INFO: Return type mismatch int vs none. -(defmethod can-target-move? plat-button ((obj plat-button)) +(defmethod can-target-move? plat-button ((this plat-button)) 0 (none) ) ;; definition for method 27 of type plat-button ;; INFO: Return type mismatch symbol vs none. -(defmethod plat-button-method-27 plat-button ((obj plat-button)) +(defmethod plat-button-method-27 plat-button ((this plat-button)) (ja-channel-set! 1) (cond - ((can-activate? obj) - (let ((s5-0 (-> obj skel root-channel 0))) + ((can-activate? this) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) ) (else - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) ) ) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (none) ) ;; definition for method 31 of type plat-button ;; INFO: Return type mismatch int vs none. -(defmethod plat-button-method-31 plat-button ((obj plat-button)) - (initialize-skeleton obj *plat-button-sg* '()) +(defmethod plat-button-method-31 plat-button ((this plat-button)) + (initialize-skeleton this *plat-button-sg* '()) 0 (none) ) ;; definition for method 32 of type plat-button ;; INFO: Return type mismatch int vs none. -(defmethod plat-button-method-32 plat-button ((obj plat-button)) - (go (method-of-object obj plat-button-idle)) +(defmethod plat-button-method-32 plat-button ((this plat-button)) + (go (method-of-object this plat-button-idle)) 0 (none) ) ;; definition for method 11 of type plat-button ;; INFO: Used lq/sq -(defmethod init-from-entity! plat-button ((obj plat-button) (arg0 entity-actor)) - (set! (-> obj go-back-if-lost-player?) #f) - (set! (-> obj grab-player?) #f) - (set! (-> obj should-grab-player?) #f) - (set! (-> obj trans-off quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) - arg0 - 'trans-offset - 'interp - -1000000000.0 - *null-vector* - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - quad - ) +(defmethod init-from-entity! plat-button ((this plat-button) (arg0 entity-actor)) + (set! (-> this go-back-if-lost-player?) #f) + (set! (-> this grab-player?) #f) + (set! (-> this should-grab-player?) #f) + (set! (-> this trans-off quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) + arg0 + 'trans-offset + 'interp + -1000000000.0 + *null-vector* + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + quad + ) ) - (set! (-> obj bidirectional?) (nonzero? (res-lump-value arg0 'bidirectional uint128))) - (plat-button-method-28 obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (plat-button-method-31 obj) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj spawn-pos quad) (-> obj root-override trans quad)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-pos) 0.0) - (let ((s5-1 (-> obj root-override trans))) - (eval-path-curve! (-> obj path) s5-1 (-> obj path-pos) 'interp) - (vector+! s5-1 s5-1 (-> obj trans-off)) + (set! (-> this bidirectional?) (nonzero? (res-lump-value arg0 'bidirectional uint128))) + (plat-button-method-28 this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (plat-button-method-31 this) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this spawn-pos quad) (-> this root-override trans quad)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-pos) 0.0) + (let ((s5-1 (-> this root-override trans))) + (eval-path-curve! (-> this path) s5-1 (-> this path-pos) 'interp) + (vector+! s5-1 s5-1 (-> this trans-off)) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj allow-auto-kill) #t) - (can-target-move? obj) - (plat-button-method-27 obj) - (plat-button-method-32 obj) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this allow-auto-kill) #t) + (can-target-move? this) + (plat-button-method-27 this) + (plat-button-method-32 this) (none) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc index 6019a65680..7032a84ec2 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/plat-eco_REF.gc @@ -21,18 +21,18 @@ ) ;; definition for method 3 of type plat-eco -(defmethod inspect plat-eco ((obj plat-eco)) +(defmethod inspect plat-eco ((this plat-eco)) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tnotice-dist: ~f~%" (-> obj notice-dist)) - (format #t "~T~Tsync-offset-dest: ~f~%" (-> obj sync-offset-dest)) - (format #t "~T~Tsync-offset-faux: ~f~%" (-> obj sync-offset-faux)) - (format #t "~T~Tsync-linear-val: ~f~%" (-> obj sync-linear-val)) - (format #t "~T~Ttarget: ~D~%" (-> obj target)) - (format #t "~T~Tunlit-look: #~%" (-> obj unlit-look)) - (format #t "~T~Tlit-look: #~%" (-> obj lit-look)) - obj + (format #t "~T~Tnotice-dist: ~f~%" (-> this notice-dist)) + (format #t "~T~Tsync-offset-dest: ~f~%" (-> this sync-offset-dest)) + (format #t "~T~Tsync-offset-faux: ~f~%" (-> this sync-offset-faux)) + (format #t "~T~Tsync-linear-val: ~f~%" (-> this sync-linear-val)) + (format #t "~T~Ttarget: ~D~%" (-> this target)) + (format #t "~T~Tunlit-look: #~%" (-> this unlit-look)) + (format #t "~T~Tlit-look: #~%" (-> this lit-look)) + this ) ;; failed to figure out what this is: @@ -217,7 +217,7 @@ ) :trans (behavior () (when (!= (-> self sync-offset-faux) (-> self sync-offset-dest)) - (seek! (-> self sync-offset-faux) (-> self sync-offset-dest) (* 12.0 (-> *display* seconds-per-frame))) + (seek! (-> self sync-offset-faux) (-> self sync-offset-dest) (* 12.0 (seconds-per-frame))) (let* ((f0-7 (the float (-> self sync period))) (f1-3 (+ (-> self sync-offset-faux) f0-7)) ) @@ -230,8 +230,8 @@ ;; definition for method 24 of type plat-eco ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 plat-eco ((obj plat-eco)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 plat-eco ((this plat-eco)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -249,60 +249,60 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) ;; definition for method 23 of type plat-eco -(defmethod get-unlit-skel plat-eco ((obj plat-eco)) +(defmethod get-unlit-skel plat-eco ((this plat-eco)) *plat-eco-unlit-sg* ) ;; definition for method 27 of type plat-eco -(defmethod get-lit-skel plat-eco ((obj plat-eco)) +(defmethod get-lit-skel plat-eco ((this plat-eco)) *plat-eco-lit-sg* ) ;; definition for method 11 of type plat-eco ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! plat-eco ((obj plat-eco) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default -1.0)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (baseplat-method-24 obj) - (process-drawable-from-entity! obj arg0) - (let ((s4-0 (get-unlit-skel obj)) - (s5-1 (get-lit-skel obj)) +(defmethod init-from-entity! plat-eco ((this plat-eco) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (set! (-> this notice-dist) (res-lump-float arg0 'notice-dist :default -1.0)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (baseplat-method-24 this) + (process-drawable-from-entity! this arg0) + (let ((s4-0 (get-unlit-skel this)) + (s5-1 (get-lit-skel this)) ) - (initialize-skeleton obj s4-0 '()) - (setup-lods! (-> obj unlit-look) s4-0 (-> obj draw art-group) (-> obj entity)) - (setup-lods! (-> obj lit-look) s5-1 (-> obj draw art-group) (-> obj entity)) + (initialize-skeleton this s4-0 '()) + (setup-lods! (-> this unlit-look) s4-0 (-> this draw art-group) (-> this entity)) + (setup-lods! (-> this lit-look) s5-1 (-> this draw art-group) (-> this entity)) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (update-transforms! (-> obj root-override)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 107) obj)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (logclear! (-> this mask) (process-mask actor-pause)) + (update-transforms! (-> this root-override)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 107) this)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) - (set! (-> obj sync-offset-dest) (-> obj sync offset)) - (set! (-> obj sync-linear-val) (get-phase-offset (-> obj sync))) - (sync-now! (-> obj sync) (-> obj sync-linear-val)) - (set! (-> obj sync-offset-faux) (-> obj sync offset)) - (set! (-> obj path-pos) (get-current-phase-with-mirror (-> obj sync))) - (eval-path-curve! (-> obj path) (-> obj root-override trans) (-> obj path-pos) 'interp) - (set! (-> obj sound-id) (new-sound-id)) - (baseplat-method-26 obj) - (baseplat-method-21 obj) - (if (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (< (-> obj notice-dist) 0.0) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) + (set! (-> this sync-offset-dest) (-> this sync offset)) + (set! (-> this sync-linear-val) (get-phase-offset (-> this sync))) + (sync-now! (-> this sync) (-> this sync-linear-val)) + (set! (-> this sync-offset-faux) (-> this sync offset)) + (set! (-> this path-pos) (get-current-phase-with-mirror (-> this sync))) + (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (set! (-> this sound-id) (new-sound-id)) + (baseplat-method-26 this) + (baseplat-method-21 this) + (if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (< (-> this notice-dist) 0.0) ) - (go (method-of-object obj plat-path-active) (the-as plat #t)) - (go (method-of-object obj plat-idle)) + (go (method-of-object this plat-path-active) (the-as plat #t)) + (go (method-of-object this plat-idle)) ) (none) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc index ec03bc35cc..204cb19bde 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/plat_REF.gc @@ -72,14 +72,14 @@ ) ;; definition for method 3 of type plat -(defmethod inspect plat ((obj plat)) +(defmethod inspect plat ((this plat)) (let ((t9-0 (method-of-type baseplat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - obj + (format #t "~T~Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + this ) ;; failed to figure out what this is: @@ -101,10 +101,10 @@ ) ;; definition for method 23 of type plat -(defmethod get-unlit-skel plat ((obj plat)) +(defmethod get-unlit-skel plat ((this plat)) (cond - ((= (-> (if (-> obj entity) - (-> obj entity extra level) + ((= (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name @@ -113,16 +113,16 @@ ) *plat-jungleb-sg* ) - ((or (= (-> (if (-> obj entity) - (-> obj entity extra level) + ((or (= (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name ) 'sunken ) - (= (-> (if (-> obj entity) - (-> obj entity extra level) + (= (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name @@ -140,8 +140,8 @@ ;; definition for method 24 of type plat ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 plat ((obj plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 plat ((this plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -159,7 +159,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -167,24 +167,24 @@ ;; definition for method 26 of type plat ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 plat ((obj plat)) +(defmethod baseplat-method-26 plat ((this plat)) 0 (none) ) ;; definition for method 25 of type plat ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. -(defmethod baseplat-method-25 plat ((obj plat)) - (the-as sparticle-launch-group (when (!= (-> (if (-> obj entity) - (-> obj entity extra level) +(defmethod baseplat-method-25 plat ((this plat)) + (the-as sparticle-launch-group (when (!= (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name ) 'maincave ) - (let ((v0-0 (create-launch-control (-> *part-group-id-table* 107) obj))) - (set! (-> obj part) v0-0) + (let ((v0-0 (create-launch-control (-> *part-group-id-table* 107) this))) + (set! (-> this part) v0-0) v0-0 ) ) @@ -262,48 +262,48 @@ ;; definition for method 11 of type plat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! plat ((obj plat) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (baseplat-method-24 obj) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (get-unlit-skel obj) '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (baseplat-method-25 obj) - (load-params! (-> obj sync) obj (the-as uint 0) 0.0 0.15 0.15) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) +(defmethod init-from-entity! plat ((this plat) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (baseplat-method-24 this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (get-unlit-skel this) '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (baseplat-method-25 this) + (load-params! (-> this sync) this (the-as uint 0) 0.0 0.15 0.15) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this sound-id) (new-sound-id)) (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) - (set! (-> obj path-pos) 0.0) - (let ((a0-14 obj)) + ((logtest? (-> this path flags) (path-control-flag not-found)) + (set! (-> this path-pos) 0.0) + (let ((a0-14 this)) (baseplat-method-26 a0-14) - (go (method-of-object obj plat-startup) a0-14) + (go (method-of-object this plat-startup) a0-14) ) ) - ((> (-> obj sync period) 0) - (set! (-> obj path-pos) (if (logtest? (-> obj fact options) (fact-options wrap-phase)) - (get-current-phase (-> obj sync)) - (get-current-phase-with-mirror (-> obj sync)) - ) + ((> (-> this sync period) 0) + (set! (-> this path-pos) (if (logtest? (-> this fact options) (fact-options wrap-phase)) + (get-current-phase (-> this sync)) + (get-current-phase-with-mirror (-> this sync)) + ) ) - (eval-path-curve! (-> obj path) (-> obj root-override trans) (-> obj path-pos) 'interp) - (let ((a0-18 obj)) + (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (let ((a0-18 this)) (baseplat-method-26 a0-18) - (go (method-of-object obj plat-startup) a0-18) + (go (method-of-object this plat-startup) a0-18) ) ) (else - (set! (-> obj path-pos) 0.0) - (eval-path-curve! (-> obj path) (-> obj root-override trans) (-> obj path-pos) 'interp) - (let ((a0-20 obj)) + (set! (-> this path-pos) 0.0) + (eval-path-curve! (-> this path) (-> this root-override trans) (-> this path-pos) 'interp) + (let ((a0-20 this)) (baseplat-method-26 a0-20) - (go (method-of-object obj plat-startup) a0-20) + (go (method-of-object this plat-startup) a0-20) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc index 9b51de4767..72a4574cf7 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/process-taskable_REF.gc @@ -3,8 +3,8 @@ ;; definition for method 52 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-52 process-taskable ((obj process-taskable)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 process-taskable ((this process-taskable)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) (set! (-> a0-1 settings bot-plane w) (- -12288.0)) @@ -19,31 +19,31 @@ ;; definition for method 9 of type gui-query ;; INFO: Return type mismatch int vs none. -(defmethod init! gui-query ((obj gui-query) (arg0 string) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol) (arg5 string)) - (set! (-> obj x-position) arg1) - (set! (-> obj y-position) arg2) - (set! (-> obj message-space) arg3) - (set! (-> obj only-allow-cancel) arg4) - (set! (-> obj message) arg0) - (set! (-> obj decision) 'undecided) - (set! (-> obj no-msg) arg5) +(defmethod init! gui-query ((this gui-query) (arg0 string) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol) (arg5 string)) + (set! (-> this x-position) arg1) + (set! (-> this y-position) arg2) + (set! (-> this message-space) arg3) + (set! (-> this only-allow-cancel) arg4) + (set! (-> this message) arg0) + (set! (-> this decision) 'undecided) + (set! (-> this no-msg) arg5) 0 (none) ) ;; definition for method 10 of type gui-query -(defmethod get-response gui-query ((obj gui-query)) +(defmethod get-response gui-query ((this gui-query)) (kill-current-level-hint '() '(sidekick voicebox stinger) 'exit) (level-hint-surpress!) (hide-hud) (when (hud-hidden?) - (when (-> obj message) + (when (-> this message) (let ((a1-2 (new 'stack 'font-context *font-default-matrix* - (-> obj x-position) - (-> obj y-position) + (-> this x-position) + (-> this y-position) 0.0 (font-color default) (font-flags shadow kerning) @@ -51,7 +51,7 @@ ) ) (let ((v1-4 a1-2)) - (set! (-> v1-4 width) (the float (- 512 (-> obj x-position)))) + (set! (-> v1-4 width) (the float (- 512 (-> this x-position)))) ) (let ((v1-5 a1-2)) (set! (-> v1-5 height) (the float 40)) @@ -60,22 +60,22 @@ (set! (-> v1-6 scale) 0.9) ) (set! (-> a1-2 flags) (font-flags shadow kerning middle-vert large)) - (print-game-text (-> obj message) a1-2 #f 128 22) + (print-game-text (-> this message) a1-2 #f 128 22) ) ) (cond - ((-> obj only-allow-cancel) - (when (-> obj no-msg) + ((-> this only-allow-cancel) + (when (-> this no-msg) (clear *temp-string*) - (format *temp-string* "; = ~S" (-> obj no-msg)) + (format *temp-string* "; = ~S" (-> this no-msg)) (let* ((s4-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (s5-0 (-> s4-0 base)) ) (draw-string-xy *temp-string* s4-0 - (-> obj x-position) - (+ (-> obj y-position) 5 (-> obj message-space)) + (-> this x-position) + (+ (-> this y-position) 5 (-> this message-space)) (font-color default) (font-flags shadow kerning large) ) @@ -103,8 +103,8 @@ (draw-string-xy (lookup-text! *common-text* (text-id confirm) #f) s4-1 - (-> obj x-position) - (+ (-> obj y-position) 5 (-> obj message-space)) + (-> this x-position) + (+ (-> this y-position) 5 (-> this message-space)) (font-color default) (font-flags shadow kerning large) ) @@ -126,74 +126,74 @@ ) ) (cond - ((!= (-> obj decision) 'undecided) + ((!= (-> this decision) 'undecided) ) - ((and (cpad-pressed? 0 x) (not (-> obj only-allow-cancel))) + ((and (cpad-pressed? 0 x) (not (-> this only-allow-cancel))) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) - (set! (-> obj decision) 'yes) + (set! (-> this decision) 'yes) ) ((cpad-pressed? 0 triangle) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (set! (-> obj decision) 'no) + (set! (-> this decision) 'no) ) ) ) - (-> obj decision) + (-> this decision) ) ;; definition for method 7 of type process-taskable ;; INFO: Return type mismatch process-drawable vs process-taskable. -(defmethod relocate process-taskable ((obj process-taskable) (arg0 int)) - (the-as process-taskable ((method-of-type process-drawable relocate) obj arg0)) +(defmethod relocate process-taskable ((this process-taskable) (arg0 int)) + (the-as process-taskable ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 46 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-46 process-taskable ((obj process-taskable)) - (when (nonzero? (-> obj sound-flava)) +(defmethod process-taskable-method-46 process-taskable ((this process-taskable)) + (when (nonzero? (-> this sound-flava)) (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) - (the-as vector (-> obj root-override root-prim prim-core)) + (the-as vector (-> this root-override root-prim prim-core)) ) ) ) (set! (-> s5-1 y) (* 4.0 (-> s5-1 y))) (cond ((< (vector-length s5-1) 102400.0) - (when (not (-> obj have-flava)) - (set! (-> obj have-flava) #t) - (set-setting! 'sound-flava #f 20.0 (-> obj sound-flava)) + (when (not (-> this have-flava)) + (set! (-> this have-flava) #t) + (set-setting! 'sound-flava #f 20.0 (-> this sound-flava)) ) ) - ((-> obj have-flava) + ((-> this have-flava) (remove-setting! 'sound-flava) - (set! (-> obj have-flava) #f) + (set! (-> this have-flava) #f) ) ) ) ) - (when (-> obj music) + (when (-> this music) (let ((s5-3 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) - (the-as vector (-> obj root-override root-prim prim-core)) + (the-as vector (-> this root-override root-prim prim-core)) ) ) ) (set! (-> s5-3 y) (* 4.0 (-> s5-3 y))) (cond ((< (vector-length s5-3) 102400.0) - (when (not (-> obj have-music)) - (set! (-> obj have-music) #t) - (set-setting! 'music (-> obj music) 0.0 0) + (when (not (-> this have-music)) + (set! (-> this have-music) #t) + (set-setting! 'music (-> this music) 0.0 0) ) ) - ((-> obj have-music) + ((-> this have-music) (remove-setting! 'music) - (set! (-> obj have-music) #f) + (set! (-> this have-music) #f) ) ) ) @@ -204,25 +204,25 @@ ;; definition for method 31 of type process-taskable ;; INFO: Return type mismatch art-joint-anim vs art-element. -(defmethod get-art-elem process-taskable ((obj process-taskable)) - (the-as art-element (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) +(defmethod get-art-elem process-taskable ((this process-taskable)) + (the-as art-element (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) ;; definition for method 32 of type process-taskable ;; INFO: Return type mismatch symbol vs basic. -(defmethod play-anim! process-taskable ((obj process-taskable) (arg0 symbol)) +(defmethod play-anim! process-taskable ((this process-taskable) (arg0 symbol)) (the-as basic #f) ) ;; definition for method 33 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-33 process-taskable ((obj process-taskable)) - (let ((s5-0 (play-anim! obj #f))) +(defmethod process-taskable-method-33 process-taskable ((this process-taskable)) + (let ((s5-0 (play-anim! this #f))) (if (type-type? (-> s5-0 type) spool-anim) - (spool-push *art-control* (-> (the-as spool-anim s5-0) name) 0 obj -99.0) + (spool-push *art-control* (-> (the-as spool-anim s5-0) name) 0 this -99.0) ) ) 0 @@ -230,8 +230,8 @@ ) ;; definition for method 51 of type process-taskable -(defmethod close-anim-file! process-taskable ((obj process-taskable)) - (let* ((gp-0 (play-anim! obj #f)) +(defmethod close-anim-file! process-taskable ((this process-taskable)) + (let* ((gp-0 (play-anim! this #f)) (v1-2 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) spool-anim)) gp-0 ) @@ -245,16 +245,16 @@ ;; definition for method 34 of type process-taskable ;; INFO: Return type mismatch symbol vs spool-anim. -(defmethod get-accept-anim process-taskable ((obj process-taskable) (arg0 symbol)) +(defmethod get-accept-anim process-taskable ((this process-taskable) (arg0 symbol)) (the-as spool-anim #f) ) ;; definition for method 35 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod push-accept-anim process-taskable ((obj process-taskable)) - (let ((s5-0 (get-accept-anim obj #f))) +(defmethod push-accept-anim process-taskable ((this process-taskable)) + (let ((s5-0 (get-accept-anim this #f))) (if (type-type? (-> s5-0 type) spool-anim) - (spool-push *art-control* (-> s5-0 name) 0 obj -99.0) + (spool-push *art-control* (-> s5-0 name) 0 this -99.0) ) ) 0 @@ -263,16 +263,16 @@ ;; definition for method 36 of type process-taskable ;; INFO: Return type mismatch symbol vs spool-anim. -(defmethod get-reject-anim process-taskable ((obj process-taskable) (arg0 symbol)) +(defmethod get-reject-anim process-taskable ((this process-taskable) (arg0 symbol)) (the-as spool-anim #f) ) ;; definition for method 37 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod push-reject-anim process-taskable ((obj process-taskable)) - (let ((s5-0 (get-reject-anim obj #f))) +(defmethod push-reject-anim process-taskable ((this process-taskable)) + (let ((s5-0 (get-reject-anim this #f))) (if (type-type? (-> s5-0 type) spool-anim) - (spool-push *art-control* (-> s5-0 name) 0 obj -99.0) + (spool-push *art-control* (-> s5-0 name) 0 this -99.0) ) ) 0 @@ -281,11 +281,11 @@ ;; definition for method 38 of type process-taskable ;; INFO: Return type mismatch object vs none. -(defmethod process-taskable-method-38 process-taskable ((obj process-taskable)) - (if (nonzero? (-> obj cell-for-task)) - (go (method-of-object obj give-cell)) +(defmethod process-taskable-method-38 process-taskable ((this process-taskable)) + (if (nonzero? (-> this cell-for-task)) + (go (method-of-object this give-cell)) ) - (go (method-of-object obj release)) + (go (method-of-object this release)) (none) ) @@ -361,10 +361,10 @@ (defstate lose (process-taskable) :virtual #t :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) + (if (and (time-elapsed? (-> self state-time) (seconds 5)) (or (not *target*) (< 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -651,7 +651,7 @@ ) ;; definition for method 39 of type process-taskable -(defmethod should-display? process-taskable ((obj process-taskable)) +(defmethod should-display? process-taskable ((this process-taskable)) #t ) @@ -675,7 +675,7 @@ ;; definition for function process-taskable-hide-enter ;; INFO: Return type mismatch none vs int. (defbehavior process-taskable-hide-enter process-taskable () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((v1-3 (-> self draw shadow-ctrl))) (logior! (-> v1-3 settings flags) (shadow-flags disable-draw)) ) @@ -716,7 +716,7 @@ (process-taskable-hide-exit (= (-> self next-state name) 'hidden)) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (process-entity-status! self (entity-perm-status bit-3) #f) ) (if (or (-> self been-kicked) (should-display? self)) @@ -728,13 +728,13 @@ ;; definition for method 50 of type process-taskable ;; WARN: disable def twice: 4. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod process-taskable-method-50 process-taskable ((obj process-taskable)) +(defmethod process-taskable-method-50 process-taskable ((this process-taskable)) (if *target* (or (not *target*) - (< 245760.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans))) + (< 245760.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans))) ) (< 60397978000.0 - (vector-vector-distance-squared (the-as vector (-> obj root-override root-prim prim-core)) (camera-pos)) + (vector-vector-distance-squared (the-as vector (-> this root-override root-prim prim-core)) (camera-pos)) ) ) ) @@ -748,7 +748,7 @@ (process-taskable-hide-exit (= (-> self next-state name) 'hidden-other)) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (process-entity-status! self (entity-perm-status bit-3) #f) ) (cond @@ -833,7 +833,7 @@ ) ;; definition for method 47 of type process-taskable -(defmethod target-above-threshold? process-taskable ((obj process-taskable)) +(defmethod target-above-threshold? process-taskable ((this process-taskable)) #t ) @@ -883,7 +883,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-taskable-clean-up-after-talking) ) :exit (behavior () @@ -903,7 +903,7 @@ ) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (when (time-elapsed? (-> self state-time) (seconds 0.2)) (logior! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #f) ) @@ -1007,8 +1007,8 @@ ;; definition for method 41 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision process-taskable ((obj process-taskable) (arg0 int) (arg1 vector)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision process-taskable ((this process-taskable) (arg0 int) (arg1 vector)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1020,7 +1020,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -1028,53 +1028,53 @@ ;; definition for method 40 of type process-taskable ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-40 process-taskable ((obj process-taskable) (arg0 object) (arg1 skeleton-group) (arg2 int) (arg3 int) (arg4 vector) (arg5 int)) - (stack-size-set! (-> obj main-thread) 512) - (initialize-collision obj arg2 arg4) - (process-drawable-from-entity! obj (the-as entity-actor arg0)) - (initialize-skeleton obj arg1 '()) - (set! (-> obj shadow-backup) (-> obj draw shadow)) - (logior! (-> obj skel status) (janim-status eye)) - (set! (-> obj root-override pause-adjust-distance) -122880.0) - (set! (-> obj fuel-cell-anim) (fuel-cell-pick-anim obj)) - (set! (-> obj draw origin-joint-index) (the-as uint arg2)) - (set! (-> obj draw shadow-joint-index) (the-as uint arg2)) - (set! (-> obj center-joint-index) arg2) - (set! (-> obj draw-bounds-y-offset) (-> obj draw bounds y)) - (set! (-> obj have-flava) #f) - (set! (-> obj music) #f) - (set! (-> obj have-music) #f) - (set! (-> obj cam-joint-index) arg3) - (set! (-> obj cell-x) (the-as handle #f)) - (set! (-> obj cell-for-task) (game-task none)) - (set! (-> obj camera) (the-as handle #f)) - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (text-id press-to-talk)) - (set! (-> obj last-talk) 0) - (set! (-> obj bounce-away) #t) - (set! (-> obj been-kicked) #f) - (set! (-> obj neck-joint-index) arg5) - (set! (-> obj cur-trans-hook) nothing) - (ambient-control-method-9 (-> obj ambient)) - (set! (-> obj event-hook) (-> (method-of-object obj idle) event)) - (set! (-> obj draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) - (process-taskable-method-52 obj) +(defmethod process-taskable-method-40 process-taskable ((this process-taskable) (arg0 object) (arg1 skeleton-group) (arg2 int) (arg3 int) (arg4 vector) (arg5 int)) + (stack-size-set! (-> this main-thread) 512) + (initialize-collision this arg2 arg4) + (process-drawable-from-entity! this (the-as entity-actor arg0)) + (initialize-skeleton this arg1 '()) + (set! (-> this shadow-backup) (-> this draw shadow)) + (logior! (-> this skel status) (janim-status eye)) + (set! (-> this root-override pause-adjust-distance) -122880.0) + (set! (-> this fuel-cell-anim) (fuel-cell-pick-anim this)) + (set! (-> this draw origin-joint-index) (the-as uint arg2)) + (set! (-> this draw shadow-joint-index) (the-as uint arg2)) + (set! (-> this center-joint-index) arg2) + (set! (-> this draw-bounds-y-offset) (-> this draw bounds y)) + (set! (-> this have-flava) #f) + (set! (-> this music) #f) + (set! (-> this have-music) #f) + (set! (-> this cam-joint-index) arg3) + (set! (-> this cell-x) (the-as handle #f)) + (set! (-> this cell-for-task) (game-task none)) + (set! (-> this camera) (the-as handle #f)) + (set! (-> this will-talk) #t) + (set! (-> this talk-message) (text-id press-to-talk)) + (set! (-> this last-talk) 0) + (set! (-> this bounce-away) #t) + (set! (-> this been-kicked) #f) + (set! (-> this neck-joint-index) arg5) + (set! (-> this cur-trans-hook) nothing) + (ambient-control-method-9 (-> this ambient)) + (set! (-> this event-hook) (-> (method-of-object this idle) event)) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) + (process-taskable-method-52 this) 0 (none) ) ;; definition for method 42 of type process-taskable ;; INFO: Return type mismatch object vs none. -(defmethod process-taskable-method-42 process-taskable ((obj process-taskable)) +(defmethod process-taskable-method-42 process-taskable ((this process-taskable)) (cond - ((not (should-display? obj)) - (go (method-of-object obj hidden)) + ((not (should-display? this)) + (go (method-of-object this hidden)) ) - ((= (current-status (-> obj tasks)) (task-status need-resolution)) - (go (method-of-object obj give-cell)) + ((= (current-status (-> this tasks)) (task-status need-resolution)) + (go (method-of-object this give-cell)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1082,21 +1082,21 @@ ;; definition for method 43 of type process-taskable ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-43 process-taskable ((obj process-taskable)) +(defmethod process-taskable-method-43 process-taskable ((this process-taskable)) (the-as symbol 0) ) ;; definition for method 9 of type ambient-control ;; INFO: Return type mismatch int vs none. -(defmethod ambient-control-method-9 ambient-control ((obj ambient-control)) - (set! (-> obj last-ambient-time) (-> *display* game-frame-counter)) +(defmethod ambient-control-method-9 ambient-control ((this ambient-control)) + (set! (-> this last-ambient-time) (-> *display* game-frame-counter)) 0 (none) ) ;; definition for method 10 of type ambient-control -(defmethod ambient-control-method-10 ambient-control ((obj ambient-control) (arg0 vector) (arg1 time-frame) (arg2 float) (arg3 process-drawable)) - (when (< (- (-> *display* game-frame-counter) (-> obj last-ambient-time)) arg1) +(defmethod ambient-control-method-10 ambient-control ((this ambient-control) (arg0 vector) (arg1 time-frame) (arg2 float) (arg3 process-drawable)) + (when (< (- (-> *display* game-frame-counter) (-> this last-ambient-time)) arg1) (set! arg0 (the-as vector #f)) (goto cfg-6) ) @@ -1110,14 +1110,14 @@ ) ;; definition for method 11 of type ambient-control -(defmethod play-ambient ambient-control ((obj ambient-control) (arg0 string) (arg1 symbol) (arg2 vector)) - (when (and (not (string= arg0 (-> obj last-ambient))) +(defmethod play-ambient ambient-control ((this ambient-control) (arg0 string) (arg1 symbol) (arg2 vector)) + (when (and (not (string= arg0 (-> this last-ambient))) (or arg1 (can-hint-be-played? (text-id one) (the-as entity #f) (the-as string #f))) (= (-> *level* loading-level) (-> *level* level-default)) (ambient-hint-spawn arg0 arg2 *entity-pool* 'ambient) ) - (set! (-> obj last-ambient-time) (-> *display* game-frame-counter)) - (set! (-> obj last-ambient) arg0) + (set! (-> this last-ambient-time) (-> *display* game-frame-counter)) + (set! (-> this last-ambient) arg0) (return #t) ) #f @@ -1262,8 +1262,8 @@ (suspend) (let ((a0-25 (-> self hand process 0))) (when (or (-> self die?) (and (not (-> self survive-anim-end?)) (ja-anim-done? a0-25))) - (let ((gp-1 (-> *display* base-frame-counter))) - (while (and (< (- (-> *display* base-frame-counter) gp-1) (seconds 60)) + (let ((gp-1 (current-time))) + (while (and (not (time-elapsed? gp-1 (seconds 60))) (or (and (-> self entity) (not (is-object-visible? (-> self entity extra level) (-> self entity extra vis-id)))) (< 81920.0 (vector-vector-distance (camera-pos) (-> *math-camera* trans))) ) @@ -1304,14 +1304,14 @@ ;; definition for method 48 of type process-taskable ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow process-taskable ((obj process-taskable)) - (let ((gp-0 (-> obj draw shadow-ctrl))) +(defmethod draw-npc-shadow process-taskable ((this process-taskable)) + (let ((gp-0 (-> this draw shadow-ctrl))) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (collide-to-find-planes gp-0 (-> obj draw origin) -4096.0 4096.0 32768.0) + (collide-to-find-planes gp-0 (-> this draw origin) -4096.0 4096.0 32768.0) (update-direction-from-time-of-day gp-0) ) (else diff --git a/test/decompiler/reference/jak1/engine/common-obs/rigid-body-h_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/rigid-body-h_REF.gc index 34ba645179..e42595c741 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/rigid-body-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/rigid-body-h_REF.gc @@ -45,28 +45,28 @@ ) ;; definition for method 3 of type rigid-body -(defmethod inspect rigid-body ((obj rigid-body)) - (format #t "[~8x] ~A~%" obj 'rigid-body) - (format #t "~Tmass: ~f~%" (-> obj mass)) - (format #t "~Tinv-mass: ~f~%" (-> obj inv-mass)) - (format #t "~Tlin-momentum-damping-factor: ~f~%" (-> obj lin-momentum-damping-factor)) - (format #t "~Tang-momentum-damping-factor: ~f~%" (-> obj ang-momentum-damping-factor)) - (format #t "~Tinertial-tensor: #~%" (-> obj inertial-tensor)) - (format #t "~Tinv-inertial-tensor: #~%" (-> obj inv-inertial-tensor)) - (format #t "~Tcm-offset-joint: #~%" (-> obj cm-offset-joint)) - (format #t "~Tposition: #~%" (-> obj position)) - (format #t "~Trotation: #~%" (-> obj rotation)) - (format #t "~Tlin-momentum: #~%" (-> obj lin-momentum)) - (format #t "~Tang-momentum: #~%" (-> obj ang-momentum)) - (format #t "~Tlin-velocity: #~%" (-> obj lin-velocity)) - (format #t "~Tang-velocity: #~%" (-> obj ang-velocity)) - (format #t "~Tinv-i-world: #~%" (-> obj inv-i-world)) - (format #t "~Tmatrix: #~%" (-> obj matrix)) - (format #t "~Tforce: #~%" (-> obj force)) - (format #t "~Ttorque: #~%" (-> obj torque)) - (format #t "~Tmax-ang-momentum: ~f~%" (-> obj max-ang-momentum)) - (format #t "~Tmax-ang-velocity: ~f~%" (-> obj max-ang-velocity)) - obj +(defmethod inspect rigid-body ((this rigid-body)) + (format #t "[~8x] ~A~%" this 'rigid-body) + (format #t "~Tmass: ~f~%" (-> this mass)) + (format #t "~Tinv-mass: ~f~%" (-> this inv-mass)) + (format #t "~Tlin-momentum-damping-factor: ~f~%" (-> this lin-momentum-damping-factor)) + (format #t "~Tang-momentum-damping-factor: ~f~%" (-> this ang-momentum-damping-factor)) + (format #t "~Tinertial-tensor: #~%" (-> this inertial-tensor)) + (format #t "~Tinv-inertial-tensor: #~%" (-> this inv-inertial-tensor)) + (format #t "~Tcm-offset-joint: #~%" (-> this cm-offset-joint)) + (format #t "~Tposition: #~%" (-> this position)) + (format #t "~Trotation: #~%" (-> this rotation)) + (format #t "~Tlin-momentum: #~%" (-> this lin-momentum)) + (format #t "~Tang-momentum: #~%" (-> this ang-momentum)) + (format #t "~Tlin-velocity: #~%" (-> this lin-velocity)) + (format #t "~Tang-velocity: #~%" (-> this ang-velocity)) + (format #t "~Tinv-i-world: #~%" (-> this inv-i-world)) + (format #t "~Tmatrix: #~%" (-> this matrix)) + (format #t "~Tforce: #~%" (-> this force)) + (format #t "~Ttorque: #~%" (-> this torque)) + (format #t "~Tmax-ang-momentum: ~f~%" (-> this max-ang-momentum)) + (format #t "~Tmax-ang-velocity: ~f~%" (-> this max-ang-velocity)) + this ) ;; definition of type rigid-body-control-point @@ -81,12 +81,12 @@ ) ;; definition for method 3 of type rigid-body-control-point -(defmethod inspect rigid-body-control-point ((obj rigid-body-control-point)) - (format #t "[~8x] ~A~%" obj 'rigid-body-control-point) - (format #t "~Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~Tworld-pos: #~%" (-> obj world-pos)) - (format #t "~Tvelocity: #~%" (-> obj velocity)) - obj +(defmethod inspect rigid-body-control-point ((this rigid-body-control-point)) + (format #t "[~8x] ~A~%" this 'rigid-body-control-point) + (format #t "~Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~Tworld-pos: #~%" (-> this world-pos)) + (format #t "~Tvelocity: #~%" (-> this velocity)) + this ) ;; failed to figure out what this is: 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 d78c459a3f..852682d6e6 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 @@ -4,9 +4,9 @@ ;; definition for method 11 of type rigid-body ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod clear-force-torque! rigid-body ((obj rigid-body)) - (set! (-> obj force quad) (-> *null-vector* quad)) - (set! (-> obj torque quad) (-> *null-vector* quad)) +(defmethod clear-force-torque! rigid-body ((this rigid-body)) + (set! (-> this force quad) (-> *null-vector* quad)) + (set! (-> this torque quad) (-> *null-vector* quad)) 0 (none) ) @@ -14,18 +14,18 @@ ;; definition for method 12 of type rigid-body ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod clear-momentum! rigid-body ((obj rigid-body)) - (set! (-> obj lin-momentum quad) (-> *null-vector* quad)) - (set! (-> obj ang-momentum quad) (-> *null-vector* quad)) +(defmethod clear-momentum! rigid-body ((this rigid-body)) + (set! (-> this lin-momentum quad) (-> *null-vector* quad)) + (set! (-> this ang-momentum quad) (-> *null-vector* quad)) 0 (none) ) ;; definition for method 21 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-21 rigid-body ((obj rigid-body)) - (quaternion->matrix (-> obj matrix) (-> obj rotation)) - (rigid-body-method-18 obj (-> obj matrix vector 3)) +(defmethod rigid-body-method-21 rigid-body ((this rigid-body)) + (quaternion->matrix (-> this matrix) (-> this rotation)) + (rigid-body-method-18 this (-> this matrix vector 3)) 0 (none) ) @@ -33,36 +33,36 @@ ;; definition for method 22 of type rigid-body ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-22 rigid-body ((obj rigid-body) (arg0 vector) (arg1 quaternion) (arg2 float) (arg3 float)) - (clear-force-torque! obj) - (clear-momentum! obj) - (vector+! (-> obj position) arg0 (-> obj cm-offset-joint)) - (quaternion-copy! (-> obj rotation) arg1) - (quaternion-normalize! (-> obj rotation)) - (set! (-> obj lin-momentum-damping-factor) arg2) - (set! (-> obj ang-momentum-damping-factor) arg3) - (rigid-body-method-21 obj) - (set! (-> obj lin-velocity quad) (-> *null-vector* quad)) - (set! (-> obj ang-velocity quad) (-> *null-vector* quad)) - (set! (-> obj inv-i-world vector 0 quad) (the-as uint128 0)) - (set! (-> obj inv-i-world vector 1 quad) (the-as uint128 0)) - (set! (-> obj inv-i-world vector 2 quad) (the-as uint128 0)) - (set! (-> obj inv-i-world vector 3 quad) (the-as uint128 0)) - (set! (-> obj max-ang-velocity) 0.0) - (set! (-> obj max-ang-momentum) 0.0) +(defmethod rigid-body-method-22 rigid-body ((this rigid-body) (arg0 vector) (arg1 quaternion) (arg2 float) (arg3 float)) + (clear-force-torque! this) + (clear-momentum! this) + (vector+! (-> this position) arg0 (-> this cm-offset-joint)) + (quaternion-copy! (-> this rotation) arg1) + (quaternion-normalize! (-> this rotation)) + (set! (-> this lin-momentum-damping-factor) arg2) + (set! (-> this ang-momentum-damping-factor) arg3) + (rigid-body-method-21 this) + (set! (-> this lin-velocity quad) (-> *null-vector* quad)) + (set! (-> this ang-velocity quad) (-> *null-vector* quad)) + (set! (-> this inv-i-world vector 0 quad) (the-as uint128 0)) + (set! (-> this inv-i-world vector 1 quad) (the-as uint128 0)) + (set! (-> this inv-i-world vector 2 quad) (the-as uint128 0)) + (set! (-> this inv-i-world vector 3 quad) (the-as uint128 0)) + (set! (-> this max-ang-velocity) 0.0) + (set! (-> this max-ang-momentum) 0.0) 0 (none) ) ;; definition for method 9 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-9 rigid-body ((obj rigid-body) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (set! (-> obj mass) arg0) +(defmethod rigid-body-method-9 rigid-body ((this rigid-body) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> this mass) arg0) (let ((f0-1 arg0)) - (set! (-> obj inv-mass) (/ 1.0 f0-1)) + (set! (-> this inv-mass) (/ 1.0 f0-1)) ) - (matrix-identity! (-> obj inertial-tensor)) - (matrix-identity! (-> obj inv-inertial-tensor)) + (matrix-identity! (-> this inertial-tensor)) + (matrix-identity! (-> this inv-inertial-tensor)) (let* ((f0-4 arg0) (f1-1 12.0) (f0-5 (* f0-4 (/ 1.0 f1-1))) @@ -71,40 +71,40 @@ (f1-6 (* f1-4 f1-4)) (f2-1 arg3) ) - (set! (-> obj inertial-tensor vector 0 x) (* f0-5 (+ f1-6 (* f2-1 f2-1)))) + (set! (-> this inertial-tensor vector 0 x) (* f0-5 (+ f1-6 (* f2-1 f2-1)))) ) (let* ((f1-9 arg1) (f1-11 (* f1-9 f1-9)) (f2-4 arg3) ) - (set! (-> obj inertial-tensor vector 1 y) (* f0-5 (+ f1-11 (* f2-4 f2-4)))) + (set! (-> this inertial-tensor vector 1 y) (* f0-5 (+ f1-11 (* f2-4 f2-4)))) ) (let* ((f1-14 arg1) (f1-16 (* f1-14 f1-14)) (f2-7 arg2) ) - (set! (-> obj inertial-tensor vector 2 z) (* f0-5 (+ f1-16 (* f2-7 f2-7)))) + (set! (-> this inertial-tensor vector 2 z) (* f0-5 (+ f1-16 (* f2-7 f2-7)))) ) ) - (let ((f0-7 (-> obj inertial-tensor vector 0 x))) - (set! (-> obj inv-inertial-tensor vector 0 x) (/ 1.0 f0-7)) + (let ((f0-7 (-> this inertial-tensor vector 0 x))) + (set! (-> this inv-inertial-tensor vector 0 x) (/ 1.0 f0-7)) ) - (let ((f0-10 (-> obj inertial-tensor vector 1 y))) - (set! (-> obj inv-inertial-tensor vector 1 y) (/ 1.0 f0-10)) + (let ((f0-10 (-> this inertial-tensor vector 1 y))) + (set! (-> this inv-inertial-tensor vector 1 y) (/ 1.0 f0-10)) ) - (let ((f0-13 (-> obj inertial-tensor vector 2 z))) - (set! (-> obj inv-inertial-tensor vector 2 z) (/ 1.0 f0-13)) + (let ((f0-13 (-> this inertial-tensor vector 2 z))) + (set! (-> this inv-inertial-tensor vector 2 z) (/ 1.0 f0-13)) ) 0 (none) ) ;; definition for method 17 of type rigid-body -(defmethod rigid-body-method-17 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) - (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj position)))) - (vector-cross! arg1 (-> obj ang-velocity) v1-1) +(defmethod rigid-body-method-17 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position)))) + (vector-cross! arg1 (-> this ang-velocity) v1-1) ) - (vector+! arg1 arg1 (-> obj lin-velocity)) + (vector+! arg1 arg1 (-> this lin-velocity)) arg1 ) @@ -131,41 +131,41 @@ ;; definition for method 10 of type rigid-body ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-10 rigid-body ((obj rigid-body) (arg0 float)) - (vector+*! (-> obj lin-momentum) (-> obj lin-momentum) (-> obj force) arg0) - (vector+*! (-> obj ang-momentum) (-> obj ang-momentum) (-> obj torque) arg0) - (vector-float*! (-> obj lin-momentum) (-> obj lin-momentum) (-> obj lin-momentum-damping-factor)) - (vector-float*! (-> obj ang-momentum) (-> obj ang-momentum) (-> obj ang-momentum-damping-factor)) - (vector-float*! (-> obj lin-velocity) (-> obj lin-momentum) (-> obj inv-mass)) - (set! (-> obj matrix vector 3 quad) (-> *null-vector* quad)) - (matrix-3x3-triple-transpose-product (-> obj inv-i-world) (-> obj matrix) (-> obj inv-inertial-tensor)) - (vector-rotate*! (-> obj ang-velocity) (-> obj ang-momentum) (-> obj inv-i-world)) - (vector+*! (-> obj position) (-> obj position) (-> obj lin-velocity) arg0) +(defmethod rigid-body-method-10 rigid-body ((this rigid-body) (arg0 float)) + (vector+*! (-> this lin-momentum) (-> this lin-momentum) (-> this force) arg0) + (vector+*! (-> this ang-momentum) (-> this ang-momentum) (-> this torque) arg0) + (vector-float*! (-> this lin-momentum) (-> this lin-momentum) (-> this lin-momentum-damping-factor)) + (vector-float*! (-> this ang-momentum) (-> this ang-momentum) (-> this ang-momentum-damping-factor)) + (vector-float*! (-> this lin-velocity) (-> this lin-momentum) (-> this inv-mass)) + (set! (-> this matrix vector 3 quad) (-> *null-vector* quad)) + (matrix-3x3-triple-transpose-product (-> this inv-i-world) (-> this matrix) (-> this inv-inertial-tensor)) + (vector-rotate*! (-> this ang-velocity) (-> this ang-momentum) (-> this inv-i-world)) + (vector+*! (-> this position) (-> this position) (-> this lin-velocity) arg0) (let ((s4-0 (new 'stack-no-clear 'quaternion))) - (set! (-> (the-as vector (&-> s4-0 x)) quad) (-> obj ang-velocity quad)) + (set! (-> (the-as vector (&-> s4-0 x)) quad) (-> this ang-velocity quad)) (set! (-> s4-0 w) 0.0) - (quaternion*! s4-0 s4-0 (-> obj rotation)) + (quaternion*! s4-0 s4-0 (-> this rotation)) (quaternion-float*! s4-0 s4-0 0.5) - (+! (-> obj rotation x) (* (-> s4-0 x) arg0)) - (+! (-> obj rotation y) (* (-> s4-0 y) arg0)) - (+! (-> obj rotation z) (* (-> s4-0 z) arg0)) - (+! (-> obj rotation w) (* (-> s4-0 w) arg0)) + (+! (-> this rotation x) (* (-> s4-0 x) arg0)) + (+! (-> this rotation y) (* (-> s4-0 y) arg0)) + (+! (-> this rotation z) (* (-> s4-0 z) arg0)) + (+! (-> this rotation w) (* (-> s4-0 w) arg0)) ) - (quaternion-normalize! (-> obj rotation)) - (quaternion->matrix (-> obj matrix) (-> obj rotation)) - (rigid-body-method-18 obj (-> obj matrix vector 3)) + (quaternion-normalize! (-> this rotation)) + (quaternion->matrix (-> this matrix) (-> this rotation)) + (rigid-body-method-18 this (-> this matrix vector 3)) 0 (none) ) ;; definition for method 13 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-13 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) - (vector+! (-> obj force) (-> obj force) arg1) - (let* ((v1-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj position))) +(defmethod rigid-body-method-13 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) + (vector+! (-> this force) (-> this force) arg1) + (let* ((v1-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (a1-2 (vector-cross! (new 'stack-no-clear 'vector) v1-2 arg1)) ) - (vector+! (-> obj torque) (-> obj torque) a1-2) + (vector+! (-> this torque) (-> this torque) a1-2) ) 0 (none) @@ -173,9 +173,9 @@ ;; definition for method 16 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-16 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) - (vector+! (-> obj force) (-> obj force) arg1) - (let* ((a0-3 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj position))) +(defmethod rigid-body-method-16 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) + (vector+! (-> this force) (-> this force) arg1) + (let* ((a0-3 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (s4-1 (vector-cross! (new 'stack-no-clear 'vector) a0-3 arg1)) ) (let ((f0-0 (vector-length a0-3))) @@ -183,7 +183,7 @@ (vector-float*! s4-1 s4-1 (/ arg2 f0-0)) ) ) - (vector+! (-> obj torque) (-> obj torque) s4-1) + (vector+! (-> this torque) (-> this torque) s4-1) ) 0 (none) @@ -191,14 +191,14 @@ ;; definition for method 14 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-14 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-14 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector-rotate*! s4-0 arg1 (-> obj matrix)) - (vector-rotate*! s5-0 arg0 (-> obj matrix)) - (vector+! s5-0 s5-0 (-> obj position)) - (rigid-body-method-13 obj s5-0 s4-0) + (vector-rotate*! s4-0 arg1 (-> this matrix)) + (vector-rotate*! s5-0 arg0 (-> this matrix)) + (vector+! s5-0 s5-0 (-> this position)) + (rigid-body-method-13 this s5-0 s4-0) ) 0 (none) @@ -206,48 +206,48 @@ ;; definition for method 15 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-15 rigid-body ((obj rigid-body) (arg0 vector)) - (vector+! (-> obj force) (-> obj force) arg0) +(defmethod rigid-body-method-15 rigid-body ((this rigid-body) (arg0 vector)) + (vector+! (-> this force) (-> this force) arg0) 0 (none) ) ;; definition for method 18 of type rigid-body -(defmethod rigid-body-method-18 rigid-body ((obj rigid-body) (arg0 vector)) +(defmethod rigid-body-method-18 rigid-body ((this rigid-body) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-rotate*! gp-0 (-> obj cm-offset-joint) (-> obj matrix)) - (vector-! arg0 (-> obj position) gp-0) + (vector-rotate*! gp-0 (-> this cm-offset-joint) (-> this matrix)) + (vector-! arg0 (-> this position) gp-0) ) arg0 ) ;; definition for method 19 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod print-stats rigid-body ((obj rigid-body)) - (format #t " force ~M ~M ~M" (-> obj force x) (-> obj force y) (-> obj force z)) - (format #t " torque ~f ~f ~f~%" (-> obj torque x) (-> obj torque y) (-> obj torque z)) - (format #t " position ~M ~M ~M" (-> obj position x) (-> obj position y) (-> obj position z)) +(defmethod print-stats rigid-body ((this rigid-body)) + (format #t " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) + (format #t " torque ~f ~f ~f~%" (-> this torque x) (-> this torque y) (-> this torque z)) + (format #t " position ~M ~M ~M" (-> this position x) (-> this position y) (-> this position z)) (format #t " rotation ~f ~f ~f ~f~%" - (-> obj rotation x) - (-> obj rotation y) - (-> obj rotation z) - (-> obj rotation w) + (-> this rotation x) + (-> this rotation y) + (-> this rotation z) + (-> this rotation w) ) - (format #t " lin-mom ~M ~M ~M" (-> obj lin-momentum x) (-> obj lin-momentum y) (-> obj lin-momentum z)) - (format #t " ang-mom ~f ~f ~f~%" (-> obj ang-momentum x) (-> obj ang-momentum y) (-> obj ang-momentum z)) - (format #t " lin-vel ~M ~M ~M" (-> obj lin-velocity x) (-> obj lin-velocity y) (-> obj lin-velocity z)) - (format #t " ang-vel ~f ~f ~f~%" (-> obj ang-velocity x) (-> obj ang-velocity y) (-> obj ang-velocity z)) + (format #t " lin-mom ~M ~M ~M" (-> this lin-momentum x) (-> this lin-momentum y) (-> this lin-momentum z)) + (format #t " ang-mom ~f ~f ~f~%" (-> this ang-momentum x) (-> this ang-momentum y) (-> this ang-momentum z)) + (format #t " lin-vel ~M ~M ~M" (-> this lin-velocity x) (-> this lin-velocity y) (-> this lin-velocity z)) + (format #t " ang-vel ~f ~f ~f~%" (-> this ang-velocity x) (-> this ang-velocity y) (-> this ang-velocity z)) 0 (none) ) ;; definition for method 20 of type rigid-body ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-method-20 rigid-body ((obj rigid-body)) - (format #t " force ~M ~M ~M" (-> obj force x) (-> obj force y) (-> obj force z)) - (format #t " torque ~f ~f ~f~%" (-> obj torque x) (-> obj torque y) (-> obj torque z)) +(defmethod rigid-body-method-20 rigid-body ((this rigid-body)) + (format #t " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) + (format #t " torque ~f ~f ~f~%" (-> this torque x) (-> this torque y) (-> this torque z)) 0 (none) ) @@ -286,34 +286,34 @@ ) ;; definition for method 3 of type rigid-body-platform-constants -(defmethod inspect rigid-body-platform-constants ((obj rigid-body-platform-constants)) - (format #t "[~8x] ~A~%" obj 'rigid-body-platform-constants) - (format #t "~Tdrag-factor: ~f~%" (-> obj drag-factor)) - (format #t "~Tbuoyancy-factor: ~f~%" (-> obj buoyancy-factor)) - (format #t "~Tmax-buoyancy-depth: (meters ~m)~%" (-> obj max-buoyancy-depth)) - (format #t "~Tgravity-factor: ~f~%" (-> obj gravity-factor)) - (format #t "~Tgravity: (meters ~m)~%" (-> obj gravity)) - (format #t "~Tplayer-weight: (meters ~m)~%" (-> obj player-weight)) - (format #t "~Tplayer-bonk-factor: ~f~%" (-> obj player-bonk-factor)) - (format #t "~Tplayer-dive-factor: ~f~%" (-> obj player-dive-factor)) - (format #t "~Tplayer-force-distance: (meters ~m)~%" (-> obj player-force-distance)) - (format #t "~Tplayer-force-clamp: (meters ~m)~%" (-> obj player-force-clamp)) - (format #t "~Tplayer-force-timeout: ~D~%" (-> obj player-force-timeout)) - (format #t "~Texplosion-force: (meters ~m)~%" (-> obj explosion-force)) - (format #t "~Tlinear-damping: ~f~%" (-> obj linear-damping)) - (format #t "~Tangular-damping: ~f~%" (-> obj angular-damping)) - (format #t "~Tcontrol-point-count: ~D~%" (-> obj control-point-count)) - (format #t "~Tmass: ~f~%" (-> obj mass)) - (format #t "~Tinertial-tensor-x: (meters ~m)~%" (-> obj inertial-tensor-x)) - (format #t "~Tinertial-tensor-y: (meters ~m)~%" (-> obj inertial-tensor-y)) - (format #t "~Tinertial-tensor-z: (meters ~m)~%" (-> obj inertial-tensor-z)) - (format #t "~Tcm-joint-x: (meters ~m)~%" (-> obj cm-joint-x)) - (format #t "~Tcm-joint-y: (meters ~m)~%" (-> obj cm-joint-y)) - (format #t "~Tcm-joint-z: (meters ~m)~%" (-> obj cm-joint-z)) - (format #t "~Tidle-distance: (meters ~m)~%" (-> obj idle-distance)) - (format #t "~Tplatform: ~A~%" (-> obj platform)) - (format #t "~Tsound-name: ~A~%" (-> obj sound-name)) - obj +(defmethod inspect rigid-body-platform-constants ((this rigid-body-platform-constants)) + (format #t "[~8x] ~A~%" this 'rigid-body-platform-constants) + (format #t "~Tdrag-factor: ~f~%" (-> this drag-factor)) + (format #t "~Tbuoyancy-factor: ~f~%" (-> this buoyancy-factor)) + (format #t "~Tmax-buoyancy-depth: (meters ~m)~%" (-> this max-buoyancy-depth)) + (format #t "~Tgravity-factor: ~f~%" (-> this gravity-factor)) + (format #t "~Tgravity: (meters ~m)~%" (-> this gravity)) + (format #t "~Tplayer-weight: (meters ~m)~%" (-> this player-weight)) + (format #t "~Tplayer-bonk-factor: ~f~%" (-> this player-bonk-factor)) + (format #t "~Tplayer-dive-factor: ~f~%" (-> this player-dive-factor)) + (format #t "~Tplayer-force-distance: (meters ~m)~%" (-> this player-force-distance)) + (format #t "~Tplayer-force-clamp: (meters ~m)~%" (-> this player-force-clamp)) + (format #t "~Tplayer-force-timeout: ~D~%" (-> this player-force-timeout)) + (format #t "~Texplosion-force: (meters ~m)~%" (-> this explosion-force)) + (format #t "~Tlinear-damping: ~f~%" (-> this linear-damping)) + (format #t "~Tangular-damping: ~f~%" (-> this angular-damping)) + (format #t "~Tcontrol-point-count: ~D~%" (-> this control-point-count)) + (format #t "~Tmass: ~f~%" (-> this mass)) + (format #t "~Tinertial-tensor-x: (meters ~m)~%" (-> this inertial-tensor-x)) + (format #t "~Tinertial-tensor-y: (meters ~m)~%" (-> this inertial-tensor-y)) + (format #t "~Tinertial-tensor-z: (meters ~m)~%" (-> this inertial-tensor-z)) + (format #t "~Tcm-joint-x: (meters ~m)~%" (-> this cm-joint-x)) + (format #t "~Tcm-joint-y: (meters ~m)~%" (-> this cm-joint-y)) + (format #t "~Tcm-joint-z: (meters ~m)~%" (-> this cm-joint-z)) + (format #t "~Tidle-distance: (meters ~m)~%" (-> this idle-distance)) + (format #t "~Tplatform: ~A~%" (-> this platform)) + (format #t "~Tsound-name: ~A~%" (-> this sound-name)) + this ) ;; definition of type rigid-body-control-point-inline-array @@ -326,12 +326,12 @@ ) ;; definition for method 3 of type rigid-body-control-point-inline-array -(defmethod inspect rigid-body-control-point-inline-array ((obj rigid-body-control-point-inline-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect rigid-body-control-point-inline-array ((this rigid-body-control-point-inline-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -379,47 +379,47 @@ ) ;; definition for method 3 of type rigid-body-platform -(defmethod inspect rigid-body-platform ((obj rigid-body-platform)) +(defmethod inspect rigid-body-platform ((this rigid-body-platform)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tinfo: #~%" (-> obj info)) - (format #t "~T~Trbody: #~%" (-> obj rbody)) - (format #t "~T~Tcontrol-point-array: ~A~%" (-> obj control-point-array)) - (format #t "~T~Tplayer-velocity: #~%" (-> obj player-velocity)) - (format #t "~T~Tplayer-velocity-prev: #~%" (-> obj player-velocity-prev)) - (format #t "~T~Tplayer-force-position: #~%" (-> obj player-force-position)) - (format #t "~T~Tplayer-force: #~%" (-> obj player-force)) - (format #t "~T~Tsim-time-remaining: ~f~%" (-> obj sim-time-remaining)) - (format #t "~T~Tfloat-height-offset: ~f~%" (-> obj float-height-offset)) - (format #t "~T~Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - (format #t "~T~Tplayer-bonk-timeout: ~D~%" (-> obj player-bonk-timeout)) - (format #t "~T~Twater-anim: ~A~%" (-> obj water-anim)) - (format #t "~T~Tplayer-contact: ~A~%" (-> obj player-contact)) - (format #t "~T~Tplayer-impulse: ~A~%" (-> obj player-impulse)) - obj + (format #t "~T~Tinfo: #~%" (-> this info)) + (format #t "~T~Trbody: #~%" (-> this rbody)) + (format #t "~T~Tcontrol-point-array: ~A~%" (-> this control-point-array)) + (format #t "~T~Tplayer-velocity: #~%" (-> this player-velocity)) + (format #t "~T~Tplayer-velocity-prev: #~%" (-> this player-velocity-prev)) + (format #t "~T~Tplayer-force-position: #~%" (-> this player-force-position)) + (format #t "~T~Tplayer-force: #~%" (-> this player-force)) + (format #t "~T~Tsim-time-remaining: ~f~%" (-> this sim-time-remaining)) + (format #t "~T~Tfloat-height-offset: ~f~%" (-> this float-height-offset)) + (format #t "~T~Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + (format #t "~T~Tplayer-bonk-timeout: ~D~%" (-> this player-bonk-timeout)) + (format #t "~T~Twater-anim: ~A~%" (-> this water-anim)) + (format #t "~T~Tplayer-contact: ~A~%" (-> this player-contact)) + (format #t "~T~Tplayer-impulse: ~A~%" (-> this player-impulse)) + this ) ;; definition for method 7 of type rigid-body-platform ;; INFO: Return type mismatch process-drawable vs rigid-body-platform. -(defmethod relocate rigid-body-platform ((obj rigid-body-platform) (arg0 int)) - (if (nonzero? (-> obj control-point-array)) - (set! (-> obj control-point-array) - (the-as rigid-body-control-point-inline-array (+ (the-as int (-> obj control-point-array)) arg0)) +(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)) - obj + this arg0 ) ) ) ;; definition for method 22 of type rigid-body-platform -(defmethod rigid-body-platform-method-22 rigid-body-platform ((obj rigid-body-platform) (arg0 vector) (arg1 float)) - (let ((v1-0 (-> obj water-anim))) +(defmethod rigid-body-platform-method-22 rigid-body-platform ((this rigid-body-platform) (arg0 vector) (arg1 float)) + (let ((v1-0 (-> this water-anim))) 0.0 (+ (the-as float (cond (v1-0 @@ -440,30 +440,30 @@ ) ) ) - (-> obj float-height-offset) + (-> this float-height-offset) ) ) ) ;; definition for method 24 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-24 rigid-body-platform ((obj rigid-body-platform) (arg0 rigid-body-control-point) (arg1 float)) - (set! (-> arg0 world-pos w) (rigid-body-platform-method-22 obj (-> arg0 world-pos) arg1)) +(defmethod rigid-body-platform-method-24 rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-control-point) (arg1 float)) + (set! (-> arg0 world-pos w) (rigid-body-platform-method-22 this (-> arg0 world-pos) arg1)) (let* ((s4-0 (new 'stack-no-clear 'vector)) (f0-2 (- (-> arg0 world-pos w) (-> arg0 world-pos y))) - (f30-0 (/ f0-2 (-> obj info max-buoyancy-depth))) + (f30-0 (/ f0-2 (-> this info max-buoyancy-depth))) ) (when (< 0.0 f0-2) - (vector-float*! s4-0 *y-vector* (* (-> obj rbody mass) + (vector-float*! s4-0 *y-vector* (* (-> this rbody mass) (fmin 1.0 f30-0) - (/ (-> obj info gravity) (the float (-> obj info control-point-count))) - (-> obj info gravity-factor) - (-> obj info buoyancy-factor) + (/ (-> this info gravity) (the float (-> this info control-point-count))) + (-> this info gravity-factor) + (-> this info buoyancy-factor) ) ) - (rigid-body-method-13 (-> obj rbody) (-> arg0 world-pos) s4-0) - (vector-float*! s4-0 (-> arg0 velocity) (* -1.0 (-> obj info drag-factor) (fmin 1.0 f30-0))) - (rigid-body-method-13 (-> obj rbody) (-> arg0 world-pos) s4-0) + (rigid-body-method-13 (-> this rbody) (-> arg0 world-pos) s4-0) + (vector-float*! s4-0 (-> arg0 velocity) (* -1.0 (-> this info drag-factor) (fmin 1.0 f30-0))) + (rigid-body-method-13 (-> this rbody) (-> arg0 world-pos) s4-0) ) ) 0 @@ -473,14 +473,14 @@ ;; definition for method 25 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-25 rigid-body-platform ((obj rigid-body-platform)) - (when (or (-> obj player-impulse) (-> obj player-contact)) - (set! (-> obj player-impulse) #f) +(defmethod rigid-body-platform-method-25 rigid-body-platform ((this rigid-body-platform)) + (when (or (-> this player-impulse) (-> this player-contact)) + (set! (-> this player-impulse) #f) (rigid-body-method-16 - (-> obj rbody) - (-> obj player-force-position) - (-> obj player-force) - (-> obj info player-force-distance) + (-> this rbody) + (-> this player-force-position) + (-> this player-force) + (-> this info player-force-distance) ) ) 0 @@ -489,14 +489,14 @@ ;; definition for method 26 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-26 rigid-body-platform ((obj rigid-body-platform)) +(defmethod rigid-body-platform-method-26 rigid-body-platform ((this rigid-body-platform)) (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-float*! a1-0 *y-vector* - (* -1.0 (-> obj info gravity-factor) (-> obj info gravity) (-> obj rbody mass)) + (* -1.0 (-> this info gravity-factor) (-> this info gravity) (-> this rbody mass)) ) - (rigid-body-method-15 (-> obj rbody) a1-0) + (rigid-body-method-15 (-> this rbody) a1-0) ) 0 (none) @@ -504,16 +504,16 @@ ;; definition for method 27 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-27 rigid-body-platform ((obj rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-27 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 arg0 (-> obj rbody position)) + (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) (let* ((f0-1 (vector-length gp-0)) (f1-1 (* 10.0 (fmax 0.0 (fmin 4096.0 (+ -4096.0 f0-1))))) ) (when (< 0.0 f1-1) (vector-float*! gp-0 gp-0 (/ f1-1 f0-1)) - (rigid-body-method-15 (-> obj rbody) gp-0) + (rigid-body-method-15 (-> this rbody) gp-0) ) ) ) @@ -523,18 +523,18 @@ ;; definition for method 23 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 rigid-body-platform ((obj rigid-body-platform) (arg0 float)) - (let ((s4-0 (-> obj rbody matrix))) - (dotimes (s3-0 (-> obj info control-point-count)) - (let ((s2-0 (-> obj control-point-array data s3-0))) +(defmethod rigid-body-platform-method-23 rigid-body-platform ((this rigid-body-platform) (arg0 float)) + (let ((s4-0 (-> this rbody matrix))) + (dotimes (s3-0 (-> this info control-point-count)) + (let ((s2-0 (-> this control-point-array data s3-0))) (vector-matrix*! (-> s2-0 world-pos) (-> s2-0 local-pos) s4-0) - (rigid-body-method-17 (-> obj rbody) (-> s2-0 world-pos) (-> s2-0 velocity)) - (rigid-body-platform-method-24 obj s2-0 arg0) + (rigid-body-method-17 (-> this rbody) (-> s2-0 world-pos) (-> s2-0 velocity)) + (rigid-body-platform-method-24 this s2-0 arg0) ) ) ) - (rigid-body-platform-method-26 obj) - (rigid-body-platform-method-25 obj) + (rigid-body-platform-method-26 this) + (rigid-body-platform-method-25 this) 0 (none) ) @@ -542,29 +542,29 @@ ;; definition for method 28 of type rigid-body-platform ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-28 rigid-body-platform ((obj rigid-body-platform)) - (if (-> obj info platform) - (detect-riders! (-> obj root-overlay)) +(defmethod rigid-body-platform-method-28 rigid-body-platform ((this rigid-body-platform)) + (if (-> this info platform) + (detect-riders! (-> this root-overlay)) ) - (set! (-> obj player-velocity-prev quad) (-> obj player-velocity quad)) + (set! (-> this player-velocity-prev quad) (-> this player-velocity quad)) (if *target* - (set! (-> obj player-velocity quad) (-> *target* control transv quad)) - (set! (-> obj player-velocity quad) (-> *null-vector* quad)) + (set! (-> this player-velocity quad) (-> *target* control transv quad)) + (set! (-> this player-velocity quad) (-> *null-vector* quad)) ) - (+! (-> obj sim-time-remaining) - (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) + (+! (-> this sim-time-remaining) + (* 0.0033333334 (the float (- (current-time) (-> *display* old-base-frame-counter)))) ) (let ((f30-0 0.016666668) - (f28-0 (* 0.0033333334 (the float (logand #xffffff (-> *display* base-frame-counter))))) + (f28-0 (* 0.0033333334 (the float (logand #xffffff (current-time))))) ) - (while (>= (-> obj sim-time-remaining) (* 0.5 f30-0)) - (clear-force-torque! (-> obj rbody)) - (rigid-body-platform-method-23 obj f28-0) - (rigid-body-method-10 (-> obj rbody) f30-0) - (set! (-> obj sim-time-remaining) (- (-> obj sim-time-remaining) f30-0)) + (while (>= (-> this sim-time-remaining) (* 0.5 f30-0)) + (clear-force-torque! (-> this rbody)) + (rigid-body-platform-method-23 this f28-0) + (rigid-body-method-10 (-> this rbody) f30-0) + (set! (-> this sim-time-remaining) (- (-> this sim-time-remaining) f30-0)) ) ) - (set! (-> obj player-contact) #f) + (set! (-> this player-contact) #f) 0 (none) ) @@ -575,8 +575,8 @@ (defbehavior rigid-body-platform-event-handler rigid-body-platform ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('bonk) - (when (>= (- (-> *display* base-frame-counter) (-> self player-bonk-timeout)) (-> self info player-force-timeout)) - (set! (-> self player-bonk-timeout) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self player-bonk-timeout) (-> self info player-force-timeout)) + (set-time! (-> self player-bonk-timeout)) (let* ((s5-0 arg0) (v1-7 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) s5-0 @@ -608,8 +608,8 @@ (set! (-> self player-attack-id) (the-as int v1-16)) (cond ((= (-> arg3 param 1) 'flop) - (when (>= (- (-> *display* base-frame-counter) (-> self player-bonk-timeout)) (-> self info player-force-timeout)) - (set! (-> self player-bonk-timeout) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self player-bonk-timeout) (-> self info player-force-timeout)) + (set-time! (-> self player-bonk-timeout)) (let* ((gp-1 arg0) (v1-24 (if (and (nonzero? gp-1) (type-type? (-> gp-1 type) process-drawable)) gp-1 @@ -761,49 +761,49 @@ ;; definition for method 29 of type rigid-body-platform ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-29 rigid-body-platform ((obj rigid-body-platform) (arg0 rigid-body-platform-constants)) - (set! (-> obj info) arg0) - (set! (-> obj control-point-array) - (new 'process 'rigid-body-control-point-inline-array (-> obj info control-point-count)) +(defmethod rigid-body-platform-method-29 rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-platform-constants)) + (set! (-> this info) arg0) + (set! (-> this control-point-array) + (new 'process 'rigid-body-control-point-inline-array (-> this info control-point-count)) ) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-overlay)) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-overlay)) (set-vector! - (-> obj rbody cm-offset-joint) - (-> obj info cm-joint-x) - (-> obj info cm-joint-y) - (-> obj info cm-joint-z) + (-> this rbody cm-offset-joint) + (-> this info cm-joint-x) + (-> this info cm-joint-y) + (-> this info cm-joint-z) 1.0 ) (rigid-body-method-22 - (-> obj rbody) - (-> obj root-overlay trans) - (-> obj root-overlay quat) - (-> obj info linear-damping) - (-> obj info angular-damping) + (-> this rbody) + (-> this root-overlay trans) + (-> this root-overlay quat) + (-> this info linear-damping) + (-> this info angular-damping) ) (rigid-body-method-9 - (-> obj rbody) - (-> obj info mass) - (-> obj info inertial-tensor-x) - (-> obj info inertial-tensor-y) - (-> obj info inertial-tensor-z) + (-> this rbody) + (-> this info mass) + (-> this info inertial-tensor-x) + (-> this info inertial-tensor-y) + (-> this info inertial-tensor-z) ) - (set! (-> obj player-impulse) #f) - (set! (-> obj player-contact) #f) - (set! (-> obj player-bonk-timeout) (-> *display* base-frame-counter)) - (set! (-> obj player-force quad) (-> *null-vector* quad)) - (set! (-> obj player-velocity quad) (-> *null-vector* quad)) - (set! (-> obj player-velocity-prev quad) (-> *null-vector* quad)) - (set! (-> obj water-anim) (the-as water-anim (entity-actor-lookup (-> obj entity) 'water-actor 0))) + (set! (-> this player-impulse) #f) + (set! (-> this player-contact) #f) + (set-time! (-> this player-bonk-timeout)) + (set! (-> this player-force quad) (-> *null-vector* quad)) + (set! (-> this player-velocity quad) (-> *null-vector* quad)) + (set! (-> this player-velocity-prev quad) (-> *null-vector* quad)) + (set! (-> this water-anim) (the-as water-anim (entity-actor-lookup (-> this entity) 'water-actor 0))) 0 (none) ) ;; definition for method 30 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 rigid-body-platform ((obj rigid-body-platform)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 rigid-body-platform ((this rigid-body-platform)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -821,7 +821,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -856,20 +856,20 @@ ;; definition for method 34 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-34 rigid-body-platform ((obj rigid-body-platform)) - (go (method-of-object obj rigid-body-platform-idle)) +(defmethod rigid-body-platform-method-34 rigid-body-platform ((this rigid-body-platform)) + (go (method-of-object this rigid-body-platform-idle)) 0 (none) ) ;; definition for method 31 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 rigid-body-platform ((obj rigid-body-platform)) - (set! (-> obj float-height-offset) 0.0) - (rigid-body-platform-method-29 obj *rigid-body-platform-constants*) - (let ((s5-0 (-> obj info control-point-count))) +(defmethod rigid-body-platform-method-31 rigid-body-platform ((this rigid-body-platform)) + (set! (-> this float-height-offset) 0.0) + (rigid-body-platform-method-29 this *rigid-body-platform-constants*) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0))))) (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) (set! (-> s3-0 local-pos y) -10240.0) @@ -885,12 +885,12 @@ ;; definition for method 11 of type rigid-body-platform ;; INFO: Return type mismatch int vs none. -(defmethod init-from-entity! rigid-body-platform ((obj rigid-body-platform) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) - (rigid-body-platform-method-34 obj) +(defmethod init-from-entity! rigid-body-platform ((this rigid-body-platform) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) + (rigid-body-platform-method-34 this) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc index 62ef3033aa..c0c72a543f 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/ropebridge_REF.gc @@ -29,28 +29,28 @@ ) ;; definition for method 3 of type ropebridge-tuning -(defmethod inspect ropebridge-tuning ((obj ropebridge-tuning)) - (format #t "[~8x] ~A~%" obj 'ropebridge-tuning) - (format #t "~Tnum-springs: ~D~%" (-> obj num-springs)) - (format #t "~Tnum-spring-points: ~D~%" (-> obj num-spring-points)) - (format #t "~Tcol-mesh-indexes: #x~X~%" (-> obj col-mesh-indexes)) - (format #t "~Tview-frustum-radius: ~f~%" (-> obj view-frustum-radius)) - (format #t "~Troot-prim-radius: ~f~%" (-> obj root-prim-radius)) - (format #t "~Tdesired-spring-len: ~f~%" (-> obj desired-spring-len)) - (format #t "~Tgravity: ~f~%" (-> obj gravity)) - (format #t "~Tspring-coefficient: ~f~%" (-> obj spring-coefficient)) - (format #t "~Tspring-mass: ~f~%" (-> obj spring-mass)) - (format #t "~Tfriction: ~f~%" (-> obj friction)) - (format #t "~Tmax-influence-dist: ~f~%" (-> obj max-influence-dist)) - (format #t "~Trider-max-gravity: ~f~%" (-> obj rider-max-gravity)) - (format #t "~Tmax-bonk-influence-dist: ~f~%" (-> obj max-bonk-influence-dist)) - (format #t "~Trider-bonk-force: ~f~%" (-> obj rider-bonk-force)) - (format #t "~Trider-bonk-min: ~f~%" (-> obj rider-bonk-min)) - (format #t "~Trider-bonk-max: ~f~%" (-> obj rider-bonk-max)) - (format #t "~Tnormal-board-len: ~f~%" (-> obj normal-board-len)) - (format #t "~Tbridge-end-to-end-len: ~f~%" (-> obj bridge-end-to-end-len)) - (format #t "~Trest-state: ~A~%" (-> obj rest-state)) - obj +(defmethod inspect ropebridge-tuning ((this ropebridge-tuning)) + (format #t "[~8x] ~A~%" this 'ropebridge-tuning) + (format #t "~Tnum-springs: ~D~%" (-> this num-springs)) + (format #t "~Tnum-spring-points: ~D~%" (-> this num-spring-points)) + (format #t "~Tcol-mesh-indexes: #x~X~%" (-> this col-mesh-indexes)) + (format #t "~Tview-frustum-radius: ~f~%" (-> this view-frustum-radius)) + (format #t "~Troot-prim-radius: ~f~%" (-> this root-prim-radius)) + (format #t "~Tdesired-spring-len: ~f~%" (-> this desired-spring-len)) + (format #t "~Tgravity: ~f~%" (-> this gravity)) + (format #t "~Tspring-coefficient: ~f~%" (-> this spring-coefficient)) + (format #t "~Tspring-mass: ~f~%" (-> this spring-mass)) + (format #t "~Tfriction: ~f~%" (-> this friction)) + (format #t "~Tmax-influence-dist: ~f~%" (-> this max-influence-dist)) + (format #t "~Trider-max-gravity: ~f~%" (-> this rider-max-gravity)) + (format #t "~Tmax-bonk-influence-dist: ~f~%" (-> this max-bonk-influence-dist)) + (format #t "~Trider-bonk-force: ~f~%" (-> this rider-bonk-force)) + (format #t "~Trider-bonk-min: ~f~%" (-> this rider-bonk-min)) + (format #t "~Trider-bonk-max: ~f~%" (-> this rider-bonk-max)) + (format #t "~Tnormal-board-len: ~f~%" (-> this normal-board-len)) + (format #t "~Tbridge-end-to-end-len: ~f~%" (-> this bridge-end-to-end-len)) + (format #t "~Trest-state: ~A~%" (-> this rest-state)) + this ) ;; definition for symbol *ropebridge-70-rest-state*, type (inline-array vector) @@ -494,12 +494,12 @@ ) ;; definition for method 3 of type ropebridge-spring-point -(defmethod inspect ropebridge-spring-point ((obj ropebridge-spring-point)) - (format #t "[~8x] ~A~%" obj 'ropebridge-spring-point) - (format #t "~Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~Tvel: #~%" (-> obj vel)) - (format #t "~Textra-force: #~%" (-> obj extra-force)) - obj +(defmethod inspect ropebridge-spring-point ((this ropebridge-spring-point)) + (format #t "[~8x] ~A~%" this 'ropebridge-spring-point) + (format #t "~Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~Tvel: #~%" (-> this vel)) + (format #t "~Textra-force: #~%" (-> this extra-force)) + this ) ;; definition of type ropebridge @@ -540,24 +540,24 @@ ) ;; definition for method 3 of type ropebridge -(defmethod inspect ropebridge ((obj ropebridge)) +(defmethod inspect ropebridge ((this ropebridge)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsubtype: ~D~%" (-> obj subtype)) - (format #t "~T~Tsubtype-name: ~A~%" (-> obj subtype-name)) - (format #t "~T~Tagitated-time-stamp: ~D~%" (-> obj agitated-time-stamp)) - (format #t "~T~Tbonk-time-stamp: ~D~%" (-> obj bonk-time-stamp)) - (format #t "~T~Tattack-flop-time-stamp: ~D~%" (-> obj attack-flop-time-stamp)) - (format #t "~T~Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - (format #t "~T~Tsleep-dist: ~f~%" (-> obj sleep-dist)) - (format #t "~T~Tdo-physics?: ~A~%" (-> obj do-physics?)) - (format #t "~T~Ttuning: #~%" (-> obj tuning)) - (format #t "~T~Tworld-matrix: #~%" (-> obj world-matrix)) - (format #t "~T~Tinv-world-matrix: #~%" (-> obj inv-world-matrix)) - (format #t "~T~Textra-trans: ~`vector`P~%" (-> obj extra-trans)) - (format #t "~T~Tspring-point[36] @ #x~X~%" (-> obj spring-point)) - obj + (format #t "~T~Tsubtype: ~D~%" (-> this subtype)) + (format #t "~T~Tsubtype-name: ~A~%" (-> this subtype-name)) + (format #t "~T~Tagitated-time-stamp: ~D~%" (-> this agitated-time-stamp)) + (format #t "~T~Tbonk-time-stamp: ~D~%" (-> this bonk-time-stamp)) + (format #t "~T~Tattack-flop-time-stamp: ~D~%" (-> this attack-flop-time-stamp)) + (format #t "~T~Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + (format #t "~T~Tsleep-dist: ~f~%" (-> this sleep-dist)) + (format #t "~T~Tdo-physics?: ~A~%" (-> this do-physics?)) + (format #t "~T~Ttuning: #~%" (-> this tuning)) + (format #t "~T~Tworld-matrix: #~%" (-> this world-matrix)) + (format #t "~T~Tinv-world-matrix: #~%" (-> this inv-world-matrix)) + (format #t "~T~Textra-trans: ~`vector`P~%" (-> this extra-trans)) + (format #t "~T~Tspring-point[36] @ #x~X~%" (-> this spring-point)) + this ) ;; failed to figure out what this is: @@ -608,8 +608,8 @@ (let ((f0-0 -1.0)) (cond ((= message 'bonk) - (when (>= (- (-> *display* base-frame-counter) (-> self bonk-time-stamp)) (seconds 0.2)) - (set! (-> self bonk-time-stamp) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self bonk-time-stamp) (seconds 0.2)) + (set-time! (-> self bonk-time-stamp)) (set! f0-0 (the-as float (-> block param 1))) (if (>= f0-0 (-> self tuning rider-bonk-max)) (set! f0-0 (-> self tuning rider-bonk-max)) @@ -620,14 +620,14 @@ (let ((v1-17 (-> block param 2))) (when (!= v1-17 (-> self player-attack-id)) (set! (-> self player-attack-id) v1-17) - (set! (-> self attack-flop-time-stamp) (-> *display* base-frame-counter)) + (set-time! (-> self attack-flop-time-stamp)) (set! f0-0 (* 1.1 (-> self tuning rider-bonk-max))) ) ) ) ) (when (and (>= f0-0 (-> self tuning rider-bonk-min)) (-> block param 0)) - (set! (-> self agitated-time-stamp) (-> *display* base-frame-counter)) + (set-time! (-> self agitated-time-stamp)) (let* ((f30-0 (/ (* (- f0-0 (-> self tuning rider-bonk-min)) (-> self tuning rider-bonk-force)) (- (-> self tuning rider-bonk-max) (-> self tuning rider-bonk-min)) ) @@ -679,23 +679,23 @@ ;; definition for method 20 of type ropebridge ;; INFO: Return type mismatch symbol vs none. ;; WARN: Function (method 20 ropebridge) has a return type of none, but the expression builder found a return statement. -(defmethod set-vel-from-impact ropebridge ((obj ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) +(defmethod set-vel-from-impact ropebridge ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int) (arg3 float)) (loop - (let ((f0-2 (fabs (- (-> arg1 z) (-> obj spring-point (the-as int arg0) local-pos z))))) - (if (< (-> obj tuning max-bonk-influence-dist) f0-2) + (let ((f0-2 (fabs (- (-> arg1 z) (-> this spring-point (the-as int arg0) local-pos z))))) + (if (< (-> this tuning max-bonk-influence-dist) f0-2) (return #f) ) - (let* ((f0-4 (/ (* 8.0 f0-2) (-> obj tuning max-bonk-influence-dist))) + (let* ((f0-4 (/ (* 8.0 f0-2) (-> this tuning max-bonk-influence-dist))) (f0-5 (+ 1.0 f0-4)) (f0-6 (/ 1.0 f0-5)) ) - (set! (-> obj spring-point (the-as int arg0) vel y) - (- (-> obj spring-point (the-as int arg0) vel y) (* f0-6 arg3)) + (set! (-> this spring-point (the-as int arg0) vel y) + (- (-> this spring-point (the-as int arg0) vel y) (* f0-6 arg3)) ) ) ) (set! arg0 (+ arg0 arg2)) - (if (or (< (the-as int arg0) 0) (>= (the-as int arg0) (-> obj tuning num-spring-points))) + (if (or (< (the-as int arg0) 0) (>= (the-as int arg0) (-> this tuning num-spring-points))) (return #f) ) ) @@ -705,9 +705,9 @@ ;; definition for method 23 of type ropebridge ;; INFO: Used lq/sq ;; INFO: Return type mismatch symbol vs none. -(defmethod clear-spring-forces ropebridge ((obj ropebridge)) - (let ((v1-0 (the-as ropebridge-spring-point (-> obj spring-point)))) - (countdown (a0-2 (-> obj tuning num-spring-points)) +(defmethod clear-spring-forces ropebridge ((this ropebridge)) + (let ((v1-0 (the-as ropebridge-spring-point (-> this spring-point)))) + (countdown (a0-2 (-> this tuning num-spring-points)) (set! (-> v1-0 extra-force quad) (the-as uint128 0)) (nop!) (nop!) @@ -719,8 +719,8 @@ ;; definition for method 21 of type ropebridge ;; INFO: Return type mismatch symbol vs none. -(defmethod set-vel-from-riders ropebridge ((obj ropebridge)) - (let ((v1-1 (-> obj root-override riders))) +(defmethod set-vel-from-riders ropebridge ((this ropebridge)) + (let ((v1-1 (-> this root-override riders))) (when v1-1 (let ((s5-0 (the-as collide-sticky-rider (-> v1-1 rider)))) (countdown (s4-0 (-> v1-1 num-riders)) @@ -731,13 +731,13 @@ ) (when s2-0 (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-matrix*! s3-0 (-> v1-5 trans) (-> obj inv-world-matrix)) + (vector-matrix*! s3-0 (-> v1-5 trans) (-> this inv-world-matrix)) (let ((s2-1 (-> s2-0 prim-id))) - (set-vel-from-rider obj s2-1 s3-0 -1) - (set-vel-from-rider obj (+ s2-1 1) s3-0 1) + (set-vel-from-rider this s2-1 s3-0 -1) + (set-vel-from-rider this (+ s2-1 1) s3-0 1) ) ) - (set! (-> obj agitated-time-stamp) (-> *display* base-frame-counter)) + (set-time! (-> this agitated-time-stamp)) ) ) ) @@ -753,21 +753,21 @@ ;; definition for method 22 of type ropebridge ;; INFO: Return type mismatch symbol vs none. ;; WARN: Function (method 22 ropebridge) has a return type of none, but the expression builder found a return statement. -(defmethod set-vel-from-rider ropebridge ((obj ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) +(defmethod set-vel-from-rider ropebridge ((this ropebridge) (arg0 uint) (arg1 vector) (arg2 int)) (loop - (let ((f0-0 (vector-vector-distance arg1 (the-as vector (-> obj spring-point (the-as int arg0)))))) - (if (< (-> obj tuning max-influence-dist) f0-0) + (let ((f0-0 (vector-vector-distance arg1 (the-as vector (-> this spring-point (the-as int arg0)))))) + (if (< (-> this tuning max-influence-dist) f0-0) (return #f) ) - (let* ((f0-2 (/ (* 8.0 f0-0) (-> obj tuning max-influence-dist))) + (let* ((f0-2 (/ (* 8.0 f0-0) (-> this tuning max-influence-dist))) (f0-3 (+ 1.0 f0-2)) (f0-4 (/ 1.0 f0-3)) ) - (+! (-> obj spring-point (the-as int arg0) extra-force y) (* f0-4 (-> obj tuning rider-max-gravity))) + (+! (-> this spring-point (the-as int arg0) extra-force y) (* f0-4 (-> this tuning rider-max-gravity))) ) ) (+! arg0 arg2) - (if (or (< (the-as int arg0) 0) (>= (the-as int arg0) (-> obj tuning num-spring-points))) + (if (or (< (the-as int arg0) 0) (>= (the-as int arg0) (-> this tuning num-spring-points))) (return #f) ) ) @@ -776,7 +776,7 @@ ;; definition for method 27 of type ropebridge ;; INFO: Return type mismatch int vs none. -(defmethod do-integration ropebridge ((obj ropebridge)) +(defmethod do-integration ropebridge ((this ropebridge)) (local-vars (a2-1 float) (a3-0 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -797,26 +797,26 @@ (vf9 :class vf) ) (init-vf0-vector) - (let ((v1-1 (-> obj tuning gravity))) + (let ((v1-1 (-> this tuning gravity))) (.mov vf9 v1-1) ) (.add.x.vf vf9 vf0 vf9 :mask #b10) (.mov.vf vf9 vf0 :mask #b1101) 0 - (let ((v1-4 (-> obj tuning friction))) + (let ((v1-4 (-> this tuning friction))) (.mov vf12 v1-4) ) (.add.x.vf vf12 vf0 vf12 :mask #b10) (.add.x.vf vf12 vf0 vf12 :mask #b100) 0 - (let ((v1-7 (/ 1.0 (-> obj tuning spring-mass)))) + (let ((v1-7 (/ 1.0 (-> this tuning spring-mass)))) (.mov vf14 v1-7) ) (.add.x.vf vf14 vf0 vf14 :mask #b10) (.add.x.vf vf14 vf0 vf14 :mask #b100) 0 - (let ((v1-11 (+ (-> obj tuning num-spring-points) -2))) - (let* ((a2-0 (-> obj spring-point)) + (let ((v1-11 (+ (-> this tuning num-spring-points) -2))) + (let* ((a2-0 (-> this spring-point)) (a1-1 (-> a2-0 1)) ) (.lvf vf2 (&-> a2-0 0 local-pos quad)) @@ -829,12 +829,12 @@ (.add.y.vf vf7 vf7 vf7 :mask #b1) (.add.z.vf vf7 vf7 vf7 :mask #b1) (.mov a2-1 vf7) - (let ((f0-5 (- a2-1 (-> obj tuning desired-spring-len)))) + (let ((f0-5 (- a2-1 (-> this tuning desired-spring-len)))) (when (< 0.0 f0-5) (.div.vf Q vf0 vf7 :fsf #b11 :ftf #b0) (.wait.vf) (.mul.vf vf5 vf5 Q) - (let ((a2-5 (* f0-5 (-> obj tuning spring-coefficient)))) + (let ((a2-5 (* f0-5 (-> this tuning spring-coefficient)))) (.mov vf10 a2-5) ) (.mul.x.vf vf10 vf5 vf10 :mask #b111) @@ -849,12 +849,12 @@ (.add.y.vf vf8 vf8 vf8 :mask #b1) (.add.z.vf vf8 vf8 vf8 :mask #b1) (.mov a3-0 vf8) - (let ((f0-8 (- a3-0 (-> obj tuning desired-spring-len)))) + (let ((f0-8 (- a3-0 (-> this tuning desired-spring-len)))) (when (< 0.0 f0-8) (.div.vf Q vf0 vf8 :fsf #b11 :ftf #b0) (.wait.vf) (.mul.vf vf6 vf6 Q) - (let ((a3-4 (* f0-8 (-> obj tuning spring-coefficient)))) + (let ((a3-4 (* f0-8 (-> this tuning spring-coefficient)))) (.mov vf10 a3-4) ) (.mul.x.vf vf10 vf6 vf10 :mask #b111) @@ -875,14 +875,14 @@ (+! v1-11 -1) (b! (> v1-11 0) cfg-1 :delay (nop!)) ) - (let ((v1-13 (-> *display* seconds-per-frame))) + (let ((v1-13 (seconds-per-frame))) (.mov vf13 v1-13) ) (.add.x.vf vf13 vf0 vf13 :mask #b10) (.add.x.vf vf13 vf0 vf13 :mask #b100) 0 - (let ((v1-17 (+ (-> obj tuning num-spring-points) -2))) - (let ((a0-1 (the-as object (&-> obj stack 320)))) + (let ((v1-17 (+ (-> this tuning num-spring-points) -2))) + (let ((a0-1 (the-as object (&-> this stack 320)))) (label cfg-7) (.lvf vf11 (&-> (the-as (inline-array vector) a0-1) 1 quad)) (.lvf vf3 (&-> (the-as (inline-array vector) a0-1) 0 quad)) @@ -901,12 +901,12 @@ ;; definition for method 24 of type ropebridge ;; INFO: Return type mismatch symbol vs none. -(defmethod debug-draw ropebridge ((obj ropebridge)) - (let ((gp-0 (-> obj node-list data 0 bone transform)) - (s5-0 (the-as ropebridge-spring-point (-> obj spring-point))) +(defmethod debug-draw ropebridge ((this ropebridge)) + (let ((gp-0 (-> this node-list data 0 bone transform)) + (s5-0 (the-as ropebridge-spring-point (-> this spring-point))) (s4-0 (new 'stack-no-clear 'vector)) ) - (countdown (s3-0 (-> obj tuning num-spring-points)) + (countdown (s3-0 (-> this tuning num-spring-points)) (vector-matrix*! s4-0 (-> s5-0 local-pos) gp-0) (add-debug-sphere #t (bucket-id debug) s4-0 2048.0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40)) (&+! s5-0 48) @@ -917,21 +917,21 @@ ;; definition for method 25 of type ropebridge ;; INFO: Return type mismatch symbol vs none. -(defmethod set-to-rest-state ropebridge ((obj ropebridge)) +(defmethod set-to-rest-state ropebridge ((this ropebridge)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (let ((a1-0 (the-as structure (-> obj tuning rest-state)))) + (let ((a1-0 (the-as structure (-> this tuning rest-state)))) (cond ((the-as symbol a1-0) - (let ((v1-1 (the-as ropebridge-spring-point (-> obj spring-point))) + (let ((v1-1 (the-as ropebridge-spring-point (-> this spring-point))) (a1-1 (the-as vector (-> (the-as vector a1-0) x))) ) (.svf (&-> v1-1 local-pos quad) vf0) (.svf (&-> v1-1 vel quad) vf0) - (countdown (a0-3 (+ (-> obj tuning num-spring-points) -1)) + (countdown (a0-3 (+ (-> this tuning num-spring-points) -1)) (&+! v1-1 48) (.svf (&-> v1-1 local-pos quad) vf0) (.svf (&-> v1-1 vel quad) vf0) @@ -946,11 +946,11 @@ (else (let ((a1-2 8192.0)) (.mov.vf vf1 vf0) - (let ((v1-3 (the-as ropebridge-spring-point (-> obj spring-point)))) + (let ((v1-3 (the-as ropebridge-spring-point (-> this spring-point)))) (.mov vf2 a1-2) (.add.x.vf vf2 vf0 vf2) (.mov.vf vf2 vf0 :mask #b1011) - (countdown (a0-5 (-> obj tuning num-spring-points)) + (countdown (a0-5 (-> this tuning num-spring-points)) (.svf (&-> v1-3 local-pos quad) vf1) (.svf (&-> v1-3 vel quad) vf0) (.add.vf vf1 vf1 vf2 :mask #b111) @@ -1007,9 +1007,9 @@ ;; definition for method 26 of type ropebridge ;; INFO: Return type mismatch symbol vs none. -(defmethod add-collision-meshes ropebridge ((obj ropebridge)) - (let* ((s5-0 (-> obj root-override)) - (s3-0 (-> obj tuning)) +(defmethod add-collision-meshes ropebridge ((this ropebridge)) + (let* ((s5-0 (-> this root-override)) + (s3-0 (-> this tuning)) (s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint (-> s3-0 num-springs)) 0)) ) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) @@ -1018,8 +1018,8 @@ (set! (-> s4-0 transform-index) (+ (/ (-> s3-0 num-springs) 2) 4)) (set! (-> s4-0 prim-core action) (collide-action solid rider-plat-sticky)) (set-root-prim! s5-0 s4-0) - (let ((s3-1 (-> obj tuning col-mesh-indexes))) - (dotimes (s2-0 (-> obj tuning num-springs)) + (let ((s3-1 (-> this tuning col-mesh-indexes))) + (dotimes (s2-0 (-> this tuning num-springs)) (let* ((a3-1 (-> s3-1 s2-0)) (a1-3 (new 'process 'collide-shape-prim-mesh s5-0 a3-1 (the-as uint s2-0))) ) @@ -1038,89 +1038,89 @@ ) ;; definition for method 12 of type ropebridge -(defmethod run-logic? ropebridge ((obj ropebridge)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (< (- (-> *display* base-frame-counter) (-> obj agitated-time-stamp)) (seconds 5)) - (or (>= (-> obj sleep-dist) (vector-vector-distance (-> obj root-override trans) (math-camera-pos))) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) +(defmethod run-logic? ropebridge ((this ropebridge)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (not (time-elapsed? (-> this agitated-time-stamp) (seconds 5))) + (or (>= (-> this sleep-dist) (vector-vector-distance (-> this root-override trans) (math-camera-pos))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) ;; definition for method 28 of type ropebridge ;; INFO: Return type mismatch int vs none. -(defmethod ropebridge-method-28 ropebridge ((obj ropebridge)) +(defmethod ropebridge-method-28 ropebridge ((this ropebridge)) 0 (none) ) ;; definition for method 11 of type ropebridge ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ropebridge ((obj ropebridge) (arg0 entity-actor)) - (let ((s4-0 (res-lump-struct (-> obj entity) 'art-name structure))) +(defmethod init-from-entity! ropebridge ((this ropebridge) (arg0 entity-actor)) + (let ((s4-0 (res-lump-struct (-> this entity) 'art-name structure))) (if (not s4-0) (set! s4-0 "ropebridge-32") ) (if (= (-> (the-as symbol s4-0) type) symbol) (set! s4-0 (symbol->string (the-as symbol s4-0))) ) - (set! (-> obj subtype-name) (the-as string s4-0)) - (set! (-> obj subtype) (the-as uint (cond - ((string= (the-as string s4-0) "ropebridge-32") - 0 - ) - ((string= (the-as string s4-0) "ropebridge-36") - 1 - ) - ((string= (the-as string s4-0) "ropebridge-52") - 2 - ) - ((string= (the-as string s4-0) "ropebridge-70") - 3 - ) - ((string= (the-as string s4-0) "snow-bridge-36") - 4 - ) - ((string= (the-as string s4-0) "vil3-bridge-36") - 5 - ) - (else + (set! (-> this subtype-name) (the-as string s4-0)) + (set! (-> this subtype) (the-as uint (cond + ((string= (the-as string s4-0) "ropebridge-32") 0 ) - ) - ) + ((string= (the-as string s4-0) "ropebridge-36") + 1 + ) + ((string= (the-as string s4-0) "ropebridge-52") + 2 + ) + ((string= (the-as string s4-0) "ropebridge-70") + 3 + ) + ((string= (the-as string s4-0) "snow-bridge-36") + 4 + ) + ((string= (the-as string s4-0) "vil3-bridge-36") + 5 + ) + (else + 0 + ) + ) + ) ) ) - (set! (-> obj tuning) (-> *ropebridge-tunings* (the-as int (-> obj subtype)))) - (set! (-> obj agitated-time-stamp) (-> *display* base-frame-counter)) - (set! (-> obj bonk-time-stamp) (-> *display* base-frame-counter)) - (set! (-> obj attack-flop-time-stamp) (-> *display* base-frame-counter)) - (set-vector! (-> obj extra-trans) 0.0 0.0 (- (* 0.5 (-> obj tuning bridge-end-to-end-len))) 1.0) - (set! (-> obj do-physics?) #t) - (let ((a0-13 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) - (set! (-> obj root-override) a0-13) + (set! (-> this tuning) (-> *ropebridge-tunings* (the-as int (-> this subtype)))) + (set-time! (-> this agitated-time-stamp)) + (set-time! (-> this bonk-time-stamp)) + (set-time! (-> this attack-flop-time-stamp)) + (set-vector! (-> this extra-trans) 0.0 0.0 (- (* 0.5 (-> this tuning bridge-end-to-end-len))) 1.0) + (set! (-> this do-physics?) #t) + (let ((a0-13 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (set! (-> this root-override) a0-13) (alloc-riders a0-13 3) ) - (add-collision-meshes obj) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton-by-name obj (-> obj subtype-name) '()) - (logior! (-> obj skel status) (janim-status inited)) - (let ((v1-29 (-> obj tuning))) - (set! (-> obj draw bounds w) (-> v1-29 view-frustum-radius)) - (set! (-> obj sleep-dist) (+ 40960.0 (* 0.5 (-> v1-29 bridge-end-to-end-len)))) + (add-collision-meshes this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton-by-name this (-> this subtype-name) '()) + (logior! (-> this skel status) (janim-status inited)) + (let ((v1-29 (-> this tuning))) + (set! (-> this draw bounds w) (-> v1-29 view-frustum-radius)) + (set! (-> this sleep-dist) (+ 40960.0 (* 0.5 (-> v1-29 bridge-end-to-end-len)))) (if (or (< 35 (-> v1-29 num-springs)) (< 36 (-> v1-29 num-spring-points))) (format 0 "ERROR: ##########~%Exceeded max # of springs in ropebridge! Stomping memory!~%##########~%") ) ) - (set! (-> obj skel postbind-function) ropebridge-joint-callback) + (set! (-> this skel postbind-function) ropebridge-joint-callback) (matrix<-transformq+trans! - (-> obj world-matrix) - (the-as transformq (-> obj root-override trans)) - (-> obj extra-trans) + (-> this world-matrix) + (the-as transformq (-> this root-override trans)) + (-> this extra-trans) ) - (matrix-4x4-inverse! (-> obj inv-world-matrix) (-> obj world-matrix)) - (set-to-rest-state obj) + (matrix-4x4-inverse! (-> this inv-world-matrix) (-> this world-matrix)) + (set-to-rest-state this) (go ropebridge-idle) (none) ) 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 24b4b37653..f94aca3919 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/sharkey_REF.gc @@ -52,26 +52,26 @@ ) ;; definition for method 3 of type sharkey -(defmethod inspect sharkey ((obj sharkey)) +(defmethod inspect sharkey ((this sharkey)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdir: #~%" (-> obj dir)) - (format #t "~T~Tspawn-point: #~%" (-> obj spawn-point)) - (format #t "~T~Tscale: ~f~%" (-> obj scale)) - (format #t "~T~Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~T~Ty-max: (meters ~m)~%" (-> obj y-max)) - (format #t "~T~Ty-min: (meters ~m)~%" (-> obj y-min)) - (format #t "~T~Tattack-time: ~f~%" (-> obj attack-time)) - (format #t "~T~Tplayer-water-time: ~D~%" (-> obj player-water-time)) - (format #t "~T~Tplayer-in-water: ~A~%" (-> obj player-in-water)) - (format #t "~T~Tlast-y: ~f~%" (-> obj last-y)) - (format #t "~T~Tspawn-distance: (meters ~m)~%" (-> obj spawn-distance)) - (format #t "~T~Tchase-speed: (meters ~m)~%" (-> obj chase-speed)) - (format #t "~T~Ty-speed: (meters ~m)~%" (-> obj y-speed)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~T~Tenable-patrol: ~A~%" (-> obj enable-patrol)) - obj + (format #t "~T~Tdir: #~%" (-> this dir)) + (format #t "~T~Tspawn-point: #~%" (-> this spawn-point)) + (format #t "~T~Tscale: ~f~%" (-> this scale)) + (format #t "~T~Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~T~Ty-max: (meters ~m)~%" (-> this y-max)) + (format #t "~T~Ty-min: (meters ~m)~%" (-> this y-min)) + (format #t "~T~Tattack-time: ~f~%" (-> this attack-time)) + (format #t "~T~Tplayer-water-time: ~D~%" (-> this player-water-time)) + (format #t "~T~Tplayer-in-water: ~A~%" (-> this player-in-water)) + (format #t "~T~Tlast-y: ~f~%" (-> this last-y)) + (format #t "~T~Tspawn-distance: (meters ~m)~%" (-> this spawn-distance)) + (format #t "~T~Tchase-speed: (meters ~m)~%" (-> this chase-speed)) + (format #t "~T~Ty-speed: (meters ~m)~%" (-> this y-speed)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~T~Tenable-patrol: ~A~%" (-> this enable-patrol)) + this ) ;; failed to figure out what this is: @@ -82,13 +82,13 @@ ;; definition for method 44 of type sharkey ;; INFO: Return type mismatch symbol vs object. -(defmethod touch-handler sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler sharkey ((this sharkey) (arg0 process) (arg1 event-message-block)) #t ) ;; definition for method 43 of type sharkey ;; INFO: Return type mismatch symbol vs object. -(defmethod attack-handler sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler sharkey ((this sharkey) (arg0 process) (arg1 event-message-block)) #t ) @@ -96,25 +96,25 @@ nav-enemy-default-event-handler ;; definition for method 12 of type sharkey -(defmethod run-logic? sharkey ((obj sharkey)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance)) - (vector-vector-distance (-> obj collide-info trans) (math-camera-pos)) +(defmethod run-logic? sharkey ((this sharkey)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this collide-info pause-adjust-distance)) + (vector-vector-distance (-> this collide-info trans) (math-camera-pos)) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) ;; definition for method 40 of type sharkey ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-40 sharkey ((obj sharkey)) - (nav-control-method-11 (-> obj nav) (-> obj nav target-pos)) - (let* ((f0-0 (vector-vector-xz-distance (-> obj collide-info trans) (-> obj nav target-pos))) - (f30-0 (/ (- (fmin (-> obj y-max) (-> obj nav target-pos y)) (-> obj collide-info trans y)) f0-0)) +(defmethod nav-enemy-method-40 sharkey ((this sharkey)) + (nav-control-method-11 (-> this nav) (-> this nav target-pos)) + (let* ((f0-0 (vector-vector-xz-distance (-> this collide-info trans) (-> this nav target-pos))) + (f30-0 (/ (- (fmin (-> this y-max) (-> this nav target-pos y)) (-> this collide-info trans y)) f0-0)) ) - (set! (-> obj nav travel y) (* 4.0 (vector-length (-> obj nav travel)) f30-0)) + (set! (-> this nav travel y) (* 4.0 (vector-length (-> this nav travel)) f30-0)) ) 0 (none) @@ -122,13 +122,13 @@ nav-enemy-default-event-handler ;; definition for method 37 of type sharkey ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-37 sharkey ((obj sharkey)) +(defmethod nav-enemy-method-37 sharkey ((this sharkey)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (< 8192.0 (vector-length (-> obj nav travel))) - (vector-normalize-copy! s5-0 (-> obj nav travel) 1.0) - (vector-deg-seek (-> obj dir) (-> obj dir) s5-0 (* 65536.0 (-> *display* seconds-per-frame))) - (vector-normalize! (-> obj dir) 1.0) - (forward-up->quaternion (-> obj collide-info quat) (-> obj dir) *up-vector*) + (when (< 8192.0 (vector-length (-> this nav travel))) + (vector-normalize-copy! s5-0 (-> this nav travel) 1.0) + (vector-deg-seek (-> this dir) (-> this dir) s5-0 (* 65536.0 (seconds-per-frame))) + (vector-normalize! (-> this dir) 1.0) + (forward-up->quaternion (-> this collide-info quat) (-> this dir) *up-vector*) ) ) 0 @@ -137,22 +137,22 @@ nav-enemy-default-event-handler ;; definition for method 41 of type sharkey ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-41 sharkey ((obj sharkey)) - (let* ((f0-1 (- (-> obj target-speed) (-> obj momentum-speed))) - (f1-3 (fmin (* (-> obj acceleration) (-> *display* seconds-per-frame)) (fabs f0-1))) +(defmethod nav-enemy-method-41 sharkey ((this sharkey)) + (let* ((f0-1 (- (-> this target-speed) (-> this momentum-speed))) + (f1-3 (fmin (* (-> this acceleration) (seconds-per-frame)) (fabs f0-1))) ) (if (< f0-1 0.0) - (set! (-> obj momentum-speed) (- (-> obj momentum-speed) f1-3)) - (+! (-> obj momentum-speed) f1-3) + (set! (-> this momentum-speed) (- (-> this momentum-speed) f1-3)) + (+! (-> this momentum-speed) f1-3) ) ) (let ((f0-9 (fmin - (* (-> obj speed-scale) (-> obj momentum-speed)) - (* (vector-length (-> obj nav travel)) (-> *display* frames-per-second)) + (* (-> this speed-scale) (-> this momentum-speed)) + (* (vector-length (-> this nav travel)) (-> *display* frames-per-second)) ) ) ) - (vector-normalize-copy! (-> obj collide-info transv) (-> obj nav travel) f0-9) + (vector-normalize-copy! (-> this collide-info transv) (-> this nav travel) f0-9) ) 0 (none) @@ -161,26 +161,26 @@ nav-enemy-default-event-handler ;; definition for method 39 of type sharkey ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod common-post sharkey ((obj sharkey)) - (let ((f30-0 (-> obj water height)) +(defmethod common-post sharkey ((this sharkey)) + (let ((f30-0 (-> this water height)) (s5-0 (new 'stack-no-clear 'vector)) ) - (let* ((f3-0 (- -36864.0 (-> obj collide-info trans y))) + (let* ((f3-0 (- -36864.0 (-> this collide-info trans y))) (f0-2 (fmax 0.0 (fmin 1.0 (- 1.0 (* 0.00008138021 f3-0))))) ) - (set-vector! (-> obj draw color-mult) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this draw color-mult) f0-2 f0-2 f0-2 1.0) ) - (water-control-method-10 (-> obj water)) - (let ((f28-0 (-> obj collide-info trans y))) - (when (or (and (< f30-0 f28-0) (>= f30-0 (-> obj last-y))) (and (>= f30-0 f28-0) (< f30-0 (-> obj last-y)))) - (set! (-> s5-0 quad) (-> obj collide-info trans quad)) + (water-control-method-10 (-> this water)) + (let ((f28-0 (-> this collide-info trans y))) + (when (or (and (< f30-0 f28-0) (>= f30-0 (-> this last-y))) (and (>= f30-0 f28-0) (< f30-0 (-> this last-y)))) + (set! (-> s5-0 quad) (-> this collide-info trans quad)) (set! (-> s5-0 y) f30-0) - (create-splash (-> obj water) 1.0 s5-0 1 (-> obj collide-info transv)) + (create-splash (-> this water) 1.0 s5-0 1 (-> this collide-info transv)) ) - (set! (-> obj last-y) f28-0) + (set! (-> this last-y) f28-0) ) ) - ((the-as (function nav-enemy none) (find-parent-method sharkey 39)) obj) + ((the-as (function nav-enemy none) (find-parent-method sharkey 39)) this) 0 (none) ) @@ -254,7 +254,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) :exit (behavior () @@ -267,7 +267,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) ) (go-virtual nav-enemy-patrol) ) @@ -275,13 +275,12 @@ nav-enemy-default-event-handler ((sharkey-notice-player?) (when (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf0))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) - (set! (-> self notice-time) (-> *display* base-frame-counter)) + (set-time! (-> self notice-time)) ) (let ((a0-4 (nav-control-method-16 (-> self nav) (-> *target* control trans)))) - (when (or (and a0-4 (logtest? (-> a0-4 pat) 2)) - (and (logtest? (-> self draw status) (draw-status hidden)) - (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) - ) + (when (or (and a0-4 (logtest? (-> a0-4 pat) 2)) (and (logtest? (-> self draw status) (draw-status hidden)) + (time-elapsed? (-> self notice-time) (-> self reaction-time)) + ) ) (sharkey-move-to-attack-position) (set! (-> self player-in-water) #t) @@ -290,7 +289,7 @@ nav-enemy-default-event-handler ) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (seconds 10)) + (if (time-elapsed? (-> self notice-time) (seconds 10)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0)) ) ) @@ -303,7 +302,7 @@ nav-enemy-default-event-handler (until (= (-> self collide-info trans y) (-> self y-min)) (ja :num! (loop! (-> self anim-speed))) (seek! (-> self anim-speed) 1.0 0.05) - (seek! (-> self collide-info trans y) (-> self y-min) (* (-> self y-speed) (-> *display* seconds-per-frame))) + (seek! (-> self collide-info trans y) (-> self y-min) (* (-> self y-speed) (seconds-per-frame))) (water-control-method-10 (-> self water)) (ja-post) (suspend) @@ -335,7 +334,7 @@ nav-enemy-default-event-handler (seek! (-> self anim-speed) 1.0 0.05) (cond ((-> self enable-patrol) - (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (seconds-per-frame))) ) (else (if (< (- (-> self collide-info trans y) (-> self y-min)) 409.6) @@ -383,9 +382,9 @@ nav-enemy-default-event-handler (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (-> *display* base-frame-counter) + (current-time) (sound-play "bigshark-bite") - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> gp-0 quad) (-> self collide-info trans quad)) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! sharkey-chomp-ja :num! (seek! (ja-aframe 3.0 0) 2.0) :frame-num 0.0) @@ -401,16 +400,16 @@ nav-enemy-default-event-handler (when (send-event *target* 'attack-invinc #f (static-attack-info ((mode 'sharkey)))) (logclear! (-> self mask) (process-mask enemy)) (vector-float*! (-> self collide-info transv) (-> self collide-info transv) 8.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((f30-0 -409600.0) (f28-0 (-> self collide-info transv y)) (f26-0 (-> self collide-info trans y)) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (ja-no-eval :group! sharkey-chomp-ja :num! (seek!) :frame-num (ja-aframe 3.0 0)) (until (ja-done? 0) - (+! f28-0 (* f30-0 (-> *display* seconds-per-frame))) - (+! f26-0 (* f28-0 (-> *display* seconds-per-frame))) + (+! f28-0 (* f30-0 (seconds-per-frame))) + (+! f26-0 (* f28-0 (seconds-per-frame))) (set! (-> self collide-info transv y) f28-0) (when (< (-> self collide-info trans y) (-> self water height)) (set! f28-0 (* 0.9 f28-0)) @@ -472,7 +471,7 @@ nav-enemy-default-event-handler (when (logtest? (-> *target* control status) (cshape-moving-flags onground)) (set! (-> self player-in-water) (logtest? (-> *target* control status) (cshape-moving-flags on-water))) (if (-> self player-in-water) - (set! (-> self player-water-time) (-> *display* base-frame-counter)) + (set-time! (-> self player-water-time)) ) ) (if (and *target* (>= 8192.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) @@ -480,7 +479,7 @@ nav-enemy-default-event-handler ) (cond ((-> self player-in-water) - (set! (-> self free-time) (-> *display* base-frame-counter)) + (set-time! (-> self free-time)) (if (and (< (fabs (- (-> gp-0 y) (-> self collide-info trans y))) 40960.0) (< (vector-vector-xz-distance gp-0 (-> self collide-info trans)) 24576.0) ) @@ -488,7 +487,7 @@ nav-enemy-default-event-handler ) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 3)) + (if (time-elapsed? (-> self free-time) (seconds 3)) (go-virtual nav-enemy-patrol) ) ) @@ -502,7 +501,7 @@ nav-enemy-default-event-handler ) ) :code (behavior () - (set! (-> self player-water-time) (-> *display* base-frame-counter)) + (set-time! (-> self player-water-time)) (ja-channel-push! 1 (seconds 0.17)) (sound-play "bigshark-idle") (loop @@ -511,7 +510,7 @@ nav-enemy-default-event-handler :frame-num 0.0 ) (until (ja-done? 0) - (seek! (-> self anim-speed) 1.0 (* 3.0 (-> *display* seconds-per-frame))) + (seek! (-> self anim-speed) 1.0 (* 3.0 (seconds-per-frame))) (suspend) (ja :num! (seek! max (-> self anim-speed))) ) @@ -547,7 +546,7 @@ nav-enemy-default-event-handler ) (until (ja-done? 0) (seek! (-> self anim-speed) 1.0 0.05) - (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (seconds-per-frame))) (suspend) (ja :num! (seek! max (-> self anim-speed))) ) @@ -563,7 +562,7 @@ nav-enemy-default-event-handler (if (target-in-range? self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) (go-virtual nav-enemy-patrol) ) ) @@ -574,7 +573,7 @@ nav-enemy-default-event-handler (loop (ja :num! (loop! (-> self anim-speed))) (seek! (-> self anim-speed) 1.0 0.05) - (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame))) + (seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (seconds-per-frame))) (suspend) ) ) @@ -657,9 +656,9 @@ nav-enemy-default-event-handler ;; definition for method 11 of type sharkey ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sharkey ((obj sharkey) (arg0 entity-actor)) - (set! (-> obj scale) (res-lump-float arg0 'scale :default 1.0)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! sharkey ((this sharkey) (arg0 entity-actor)) + (set! (-> this scale) (res-lump-float arg0 'scale :default 1.0)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -669,38 +668,38 @@ nav-enemy-default-event-handler (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) (set! (-> s3-0 prim-core offense) (collide-offense normal-attack)) - (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 (* 6144.0 (-> obj scale))) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 (* 6144.0 (-> this scale))) (set-root-prim! s4-0 s3-0) ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *sharkey-sg* '()) - (init-defaults! obj *sharkey-nav-enemy-info*) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj water) (new 'process 'water-control obj 3 12288.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01 wt22 wt23)) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 20480.0) - (set! (-> obj spawn-point quad) (-> obj collide-info trans quad)) - (set! (-> obj collide-info nav-radius) 8192.0) - (set! (-> obj nav nearest-y-threshold) 4096000.0) - (set! (-> obj y-max) (- (-> obj water height) (* 2048.0 (-> obj scale)))) - (set! (-> obj y-min) (+ -49152.0 (-> obj y-max))) - (set! (-> obj collide-info trans y) (-> obj y-min)) - (set! (-> obj anim-speed) 1.0) - (set-vector! (-> obj collide-info scale) (-> obj scale) (-> obj scale) (-> obj scale) 1.0) - (set! (-> obj reaction-time) - (the-as time-frame (the int (* 300.0 (res-lump-float (-> obj entity) 'delay :default 1.0)))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *sharkey-sg* '()) + (init-defaults! this *sharkey-nav-enemy-info*) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this water) (new 'process 'water-control this 3 12288.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01 wt22 wt23)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 20480.0) + (set! (-> this spawn-point quad) (-> this collide-info trans quad)) + (set! (-> this collide-info nav-radius) 8192.0) + (set! (-> this nav nearest-y-threshold) 4096000.0) + (set! (-> this y-max) (- (-> this water height) (* 2048.0 (-> this scale)))) + (set! (-> this y-min) (+ -49152.0 (-> this y-max))) + (set! (-> this collide-info trans y) (-> this y-min)) + (set! (-> this anim-speed) 1.0) + (set-vector! (-> this collide-info scale) (-> this scale) (-> this scale) (-> this scale) 1.0) + (set! (-> this reaction-time) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'delay :default 1.0)))) ) - (set! (-> obj spawn-distance) (res-lump-float (-> obj entity) 'distance :default 122880.0)) - (set! (-> obj chase-speed) (res-lump-float (-> obj entity) 'speed :default 49152.0)) - (set! (-> obj y-speed) (-> obj chase-speed)) - (set! (-> obj enable-patrol) #f) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj enemy-info cam-vert) 49152.0) - (go (method-of-object obj nav-enemy-idle)) + (set! (-> this spawn-distance) (res-lump-float (-> this entity) 'distance :default 122880.0)) + (set! (-> this chase-speed) (res-lump-float (-> this entity) 'speed :default 49152.0)) + (set! (-> this y-speed) (-> this chase-speed)) + (set! (-> this enable-patrol) #f) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this enemy-info cam-vert) 49152.0) + (go (method-of-object this nav-enemy-idle)) (none) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/ticky_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/ticky_REF.gc index 3255c7dd83..2e3f8accff 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/ticky_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/ticky_REF.gc @@ -19,44 +19,44 @@ ) ;; definition for method 3 of type ticky -(defmethod inspect ticky ((obj ticky)) - (format #t "[~8x] ~A~%" obj 'ticky) - (format #t "~Tdelay-til-ramp: ~D~%" (-> obj delay-til-ramp)) - (format #t "~Tdelay-til-timeout: ~D~%" (-> obj delay-til-timeout)) - (format #t "~Tstarting-time: ~D~%" (-> obj starting-time)) - (format #t "~Tlast-tick-time: ~D~%" (-> obj last-tick-time)) - obj +(defmethod inspect ticky ((this ticky)) + (format #t "[~8x] ~A~%" this 'ticky) + (format #t "~Tdelay-til-ramp: ~D~%" (-> this delay-til-ramp)) + (format #t "~Tdelay-til-timeout: ~D~%" (-> this delay-til-timeout)) + (format #t "~Tstarting-time: ~D~%" (-> this starting-time)) + (format #t "~Tlast-tick-time: ~D~%" (-> this last-tick-time)) + this ) ;; definition for method 9 of type ticky ;; INFO: Return type mismatch int vs none. -(defmethod sleep ticky ((obj ticky) (arg0 time-frame)) - (set! (-> obj starting-time) (-> *display* base-frame-counter)) - (set! (-> obj delay-til-timeout) arg0) - (set! (-> obj delay-til-ramp) (max 0 (+ arg0 (seconds -4)))) - (set! (-> obj last-tick-time) 0) +(defmethod sleep ticky ((this ticky) (arg0 time-frame)) + (set-time! (-> this starting-time)) + (set! (-> this delay-til-timeout) arg0) + (set! (-> this delay-til-ramp) (max 0 (+ arg0 (seconds -4)))) + (set! (-> this last-tick-time) 0) 0 (none) ) ;; definition for method 11 of type ticky -(defmethod completed? ticky ((obj ticky)) +(defmethod completed? ticky ((this ticky)) (let ((gp-0 #f)) - (let ((v1-2 (- (-> *display* base-frame-counter) (-> obj starting-time)))) + (let ((v1-2 (- (current-time) (-> this starting-time)))) (cond - ((>= v1-2 (-> obj delay-til-timeout)) + ((>= v1-2 (-> this delay-til-timeout)) (set! gp-0 #t) ) (else - (let* ((f0-1 (fmin 1.0 (/ (the float (max 0 (- v1-2 (-> obj delay-til-ramp)))) - (the float (- (-> obj delay-til-timeout) (-> obj delay-til-ramp))) + (let* ((f0-1 (fmin 1.0 (/ (the float (max 0 (- v1-2 (-> this delay-til-ramp)))) + (the float (- (-> this delay-til-timeout) (-> this delay-til-ramp))) ) ) ) (v1-7 (the int (lerp 105.0 41.0 f0-1))) ) - (when (>= (- (-> *display* base-frame-counter) (-> obj last-tick-time)) v1-7) - (set! (-> obj last-tick-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> this last-tick-time) v1-7) + (set-time! (-> this last-tick-time)) (sound-play "stopwatch") ) ) @@ -68,6 +68,6 @@ ) ;; definition for method 10 of type ticky -(defmethod reached-delay? ticky ((obj ticky) (arg0 time-frame)) - (>= (- (-> *display* base-frame-counter) (-> obj starting-time)) arg0) +(defmethod reached-delay? ticky ((this ticky) (arg0 time-frame)) + (time-elapsed? (-> this starting-time) arg0) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/tippy_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/tippy_REF.gc index d126091217..ac2ff7e6f5 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/tippy_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/tippy_REF.gc @@ -20,32 +20,32 @@ ) ;; definition for method 3 of type tippy -(defmethod inspect tippy ((obj tippy)) - (format #t "[~8x] ~A~%" obj 'tippy) - (format #t "~Taxis: #~%" (-> obj axis)) - (format #t "~Tangle: ~f~%" (-> obj angle)) - (format #t "~Torig: #~%" (-> obj orig)) - (format #t "~Tdist-ratio: ~f~%" (-> obj dist-ratio)) - (format #t "~Tdamping: ~f~%" (-> obj damping)) - (format #t "~T1-damping: ~f~%" (-> obj 1-damping)) - obj +(defmethod inspect tippy ((this tippy)) + (format #t "[~8x] ~A~%" this 'tippy) + (format #t "~Taxis: #~%" (-> this axis)) + (format #t "~Tangle: ~f~%" (-> this angle)) + (format #t "~Torig: #~%" (-> this orig)) + (format #t "~Tdist-ratio: ~f~%" (-> this dist-ratio)) + (format #t "~Tdamping: ~f~%" (-> this damping)) + (format #t "~T1-damping: ~f~%" (-> this 1-damping)) + this ) ;; definition for method 9 of type tippy ;; INFO: Return type mismatch int vs none. -(defmethod reset! tippy ((obj tippy) (arg0 process-drawable) (arg1 float) (arg2 float)) - (set-vector! (-> obj axis) 0.0 0.0 0.0 1.0) - (set! (-> obj angle) 0.0) - (quaternion-copy! (-> obj orig) (-> arg0 root quat)) - (set! (-> obj dist-ratio) arg1) - (set! (-> obj damping) arg2) - (set! (-> obj 1-damping) (- 1.0 arg2)) +(defmethod reset! tippy ((this tippy) (arg0 process-drawable) (arg1 float) (arg2 float)) + (set-vector! (-> this axis) 0.0 0.0 0.0 1.0) + (set! (-> this angle) 0.0) + (quaternion-copy! (-> this orig) (-> arg0 root quat)) + (set! (-> this dist-ratio) arg1) + (set! (-> this damping) arg2) + (set! (-> this 1-damping) (- 1.0 arg2)) 0 (none) ) ;; definition for method 10 of type tippy -(defmethod tippy-method-10 tippy ((obj tippy) (arg0 process-drawable) (arg1 vector)) +(defmethod tippy-method-10 tippy ((this tippy) (arg0 process-drawable) (arg1 vector)) (let ((s4-0 #t)) (cond (arg1 @@ -56,26 +56,26 @@ (set! (-> s3-0 z) (- (-> arg0 root trans x) (-> arg1 x))) (let ((f0-6 (vector-length s3-0))) (vector-float*! s3-0 s3-0 (/ 1.0 f0-6)) - (let ((f30-0 (* f0-6 (-> obj dist-ratio)))) - (set! (-> obj axis x) (+ (* (-> obj 1-damping) (-> obj axis x)) (* (-> obj damping) (-> s3-0 x)))) - (set! (-> obj axis y) 0.0) - (set! (-> obj axis z) (+ (* (-> obj 1-damping) (-> obj axis z)) (* (-> obj damping) (-> s3-0 z)))) - (vector-normalize! (-> obj axis) 1.0) - (set! (-> obj angle) (+ (* (-> obj 1-damping) (-> obj angle)) (* (-> obj damping) f30-0))) + (let ((f30-0 (* f0-6 (-> this dist-ratio)))) + (set! (-> this axis x) (+ (* (-> this 1-damping) (-> this axis x)) (* (-> this damping) (-> s3-0 x)))) + (set! (-> this axis y) 0.0) + (set! (-> this axis z) (+ (* (-> this 1-damping) (-> this axis z)) (* (-> this damping) (-> s3-0 z)))) + (vector-normalize! (-> this axis) 1.0) + (set! (-> this angle) (+ (* (-> this 1-damping) (-> this angle)) (* (-> this damping) f30-0))) ) ) ) ) (else - (set! (-> obj angle) (* (-> obj 1-damping) (-> obj angle))) - (when (< (-> obj angle) 182.04445) - (set! (-> obj angle) 0.0) + (set! (-> this angle) (* (-> this 1-damping) (-> this angle))) + (when (< (-> this angle) 182.04445) + (set! (-> this angle) 0.0) (set! s4-0 #f) ) ) ) - (quaternion-vector-angle! (-> arg0 root quat) (-> obj axis) (-> obj angle)) - (quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> obj orig)) + (quaternion-vector-angle! (-> arg0 root quat) (-> this axis) (-> this angle)) + (quaternion*! (-> arg0 root quat) (-> arg0 root quat) (-> this orig)) s4-0 ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc index 6b2f9cffaf..34a8fc249f 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/voicebox_REF.gc @@ -14,11 +14,11 @@ ) ;; definition for method 3 of type camera-voicebox -(defmethod inspect camera-voicebox ((obj camera-voicebox)) +(defmethod inspect camera-voicebox ((this camera-voicebox)) (let ((t9-0 (method-of-type camera-slave inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type voicebox @@ -42,16 +42,16 @@ ) ;; definition for method 3 of type voicebox -(defmethod inspect voicebox ((obj voicebox)) +(defmethod inspect voicebox ((this voicebox)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbase-trans: ~`vector`P~%" (-> obj base-trans)) - (format #t "~T~Tseeker: #~%" (-> obj seeker)) - (format #t "~T~Tblend: ~f~%" (-> obj blend)) - (format #t "~T~Ttwist: ~f~%" (-> obj twist)) - (format #t "~T~Thint: ~D~%" (-> obj hint)) - obj + (format #t "~T~Tbase-trans: ~`vector`P~%" (-> this base-trans)) + (format #t "~T~Tseeker: #~%" (-> this seeker)) + (format #t "~T~Tblend: ~f~%" (-> this blend)) + (format #t "~T~Ttwist: ~f~%" (-> this twist)) + (format #t "~T~Thint: ~D~%" (-> this hint)) + this ) ;; failed to figure out what this is: @@ -81,9 +81,7 @@ ) (vector-lerp! (-> self root trans) gp-0 s5-0 (-> self blend)) ) - (+! (-> self root trans y) - (* 1638.4 (sin (* 54.613335 (the float (mod (-> *display* base-frame-counter) 1200))))) - ) + (+! (-> self root trans y) (* 1638.4 (sin (* 54.613335 (the float (mod (current-time) 1200)))))) (let ((gp-1 (new 'stack-no-clear 'quaternion))) (forward-up->quaternion gp-1 @@ -100,8 +98,8 @@ ) ) (if (< 0.0 f0-8) - (seek! (-> self twist) -0.4 (* 0.3 (-> *display* seconds-per-frame))) - (seek! (-> self twist) 0.4 (* 0.3 (-> *display* seconds-per-frame))) + (seek! (-> self twist) -0.4 (* 0.3 (seconds-per-frame))) + (seek! (-> self twist) 0.4 (* 0.3 (seconds-per-frame))) ) ) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) @@ -194,14 +192,13 @@ :trans voicebox-track :code (behavior () (remove-setting! 'sound-flava) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self seeker target) 1.0) - (while (and (< (-> self blend) 0.9999) - (not (and (not (handle->process (-> self hint))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) - (-> *setting-control* current hint) - ) - ) + (while (and (< (-> self blend) 0.9999) (not (and (not (handle->process (-> self hint))) + (time-elapsed? (-> self state-time) (seconds 0.05)) + (-> *setting-control* current hint) + ) + ) ) (update! (-> self seeker) 0.0) (set! (-> self blend) (-> self seeker value)) diff --git a/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc index 458612a35c..9ac6137d37 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/water-anim_REF.gc @@ -14,13 +14,13 @@ ) ;; definition for method 3 of type water-anim -(defmethod inspect water-anim ((obj water-anim)) +(defmethod inspect water-anim ((this water-anim)) (let ((t9-0 (method-of-type water-vol inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tlook: ~D~%" (-> obj look)) - (format #t "~T~Tplay-ambient-sound?: ~A~%" (-> obj play-ambient-sound?)) - obj + (format #t "~T~Tlook: ~D~%" (-> this look)) + (format #t "~T~Tplay-ambient-sound?: ~A~%" (-> this play-ambient-sound?)) + this ) ;; failed to figure out what this is: @@ -323,12 +323,12 @@ ) ;; definition for method 3 of type water-anim-look -(defmethod inspect water-anim-look ((obj water-anim-look)) - (format #t "[~8x] ~A~%" obj 'water-anim-look) - (format #t "~Tskel-group: ~A~%" (-> obj skel-group)) - (format #t "~Tanim: ~D~%" (-> obj anim)) - (format #t "~Tambient-sound-spec: ~A~%" (-> obj ambient-sound-spec)) - obj +(defmethod inspect water-anim-look ((this water-anim-look)) + (format #t "[~8x] ~A~%" this 'water-anim-look) + (format #t "~Tskel-group: ~A~%" (-> this skel-group)) + (format #t "~Tanim: ~D~%" (-> this anim)) + (format #t "~Tambient-sound-spec: ~A~%" (-> this ambient-sound-spec)) + this ) ;; definition for symbol *water-anim-look*, type (array water-anim-look) @@ -575,42 +575,42 @@ ) ;; definition for method 28 of type water-anim -(defmethod get-ripple-height water-anim ((obj water-anim) (arg0 vector)) - (ripple-find-height obj 0 arg0) +(defmethod get-ripple-height water-anim ((this water-anim) (arg0 vector)) + (ripple-find-height this 0 arg0) ) ;; definition for method 24 of type water-anim ;; INFO: Return type mismatch symbol vs none. -(defmethod set-stack-size! water-anim ((obj water-anim)) +(defmethod set-stack-size! water-anim ((this water-anim)) (none) ) ;; definition for method 25 of type water-anim ;; INFO: Used lq/sq ;; INFO: Return type mismatch quaternion vs none. -(defmethod water-vol-method-25 water-anim ((obj water-anim)) +(defmethod water-vol-method-25 water-anim ((this water-anim)) (local-vars (sv-16 res-tag)) - (set! (-> obj play-ambient-sound?) #t) - (set! (-> obj look) (res-lump-value (-> obj entity) 'look int :default (the-as uint128 -1))) + (set! (-> this play-ambient-sound?) #t) + (set! (-> this look) (res-lump-value (-> this entity) 'look int :default (the-as uint128 -1))) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-3 (res-lump-data (-> obj entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) + (let ((v1-3 (res-lump-data (-> this entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-3 - (+! (-> obj root trans x) (-> v1-3 0)) - (+! (-> obj root trans y) (-> v1-3 1)) - (+! (-> obj root trans z) (-> v1-3 2)) + (+! (-> this root trans x) (-> v1-3 0)) + (+! (-> this root trans y) (-> v1-3 1)) + (+! (-> this root trans z) (-> v1-3 2)) ) ) - (let ((f0-6 (res-lump-float (-> obj entity) 'rotoffset))) + (let ((f0-6 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-6 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-6) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-6) ) ) (none) ) ;; definition for method 22 of type water-anim -(defmethod water-vol-method-22 water-anim ((obj water-anim)) - (let ((s5-0 (-> obj look))) +(defmethod water-vol-method-22 water-anim ((this water-anim)) + (let ((s5-0 (-> this look))) (if (or (< s5-0 0) (>= s5-0 (-> *water-anim-look* length))) (go process-drawable-art-error "skel group") ) @@ -624,13 +624,13 @@ (go process-drawable-art-error "skel group") ) ) - (initialize-skeleton obj (the-as skeleton-group s4-0) '()) + (initialize-skeleton this (the-as skeleton-group s4-0) '()) ) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data (-> s5-1 anim))) + (the-as art-joint-anim (-> this draw art-group data (-> s5-1 anim))) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) @@ -638,8 +638,8 @@ (let ((a2-2 (-> s5-1 ambient-sound-spec))) (when a2-2 (let ((a3-0 (new 'stack-no-clear 'vector))) - (vector+! a3-0 (-> obj root trans) (-> obj draw bounds)) - (set! (-> obj sound) (new 'process 'ambient-sound a2-2 a3-0)) + (vector+! a3-0 (-> this root trans) (-> this draw bounds)) + (set! (-> this sound) (new 'process 'ambient-sound a2-2 a3-0)) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/common-obs/water-h_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/water-h_REF.gc index 74c7cdfc89..99e211133e 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/water-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/water-h_REF.gc @@ -55,48 +55,48 @@ ) ;; definition for method 3 of type water-control -(defmethod inspect water-control ((obj water-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tflags: #x~X~%" (-> obj flags)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~Ttop-y-offset: ~f~%" (-> obj top-y-offset)) - (format #t "~Tripple-size: (meters ~m)~%" (-> obj ripple-size)) - (format #t "~Tenter-water-time: ~D~%" (-> obj enter-water-time)) - (format #t "~Twade-time: ~D~%" (-> obj wade-time)) - (format #t "~Ton-water-time: ~D~%" (-> obj on-water-time)) - (format #t "~Tenter-swim-time: ~D~%" (-> obj enter-swim-time)) - (format #t "~Tswim-time: ~D~%" (-> obj swim-time)) - (format #t "~Tbase-height: (meters ~m)~%" (-> obj base-height)) - (format #t "~Twade-height: (meters ~m)~%" (-> obj wade-height)) - (format #t "~Tswim-height: (meters ~m)~%" (-> obj swim-height)) - (format #t "~Tsurface-height: (meters ~m)~%" (-> obj surface-height)) - (format #t "~Tbottom-height: (meters ~m)~%" (-> obj bottom-height)) - (format #t "~Theight: (meters ~m)~%" (-> obj height)) - (format #t "~Theight-offset[4] @ #x~X~%" (-> obj height-offset)) - (format #t "~Treal-ocean-offset: (meters ~m)~%" (-> obj real-ocean-offset)) - (format #t "~Tocean-offset: (meters ~m)~%" (-> obj ocean-offset)) - (format #t "~Tbob-offset: (meters ~m)~%" (-> obj bob-offset)) - (format #t "~Talign-offset: (meters ~m)~%" (-> obj align-offset)) - (format #t "~Tswim-depth: (meters ~m)~%" (-> obj swim-depth)) - (format #t "~Tbob: #~%" (-> obj bob)) - (format #t "~Tvolume: ~D~%" (-> obj volume)) - (format #t "~Tbottom[2] @ #x~X~%" (-> obj bottom)) - (format #t "~Ttop[2] @ #x~X~%" (-> obj top)) - (format #t "~Tenter-water-pos: ~`vector`P~%" (-> obj enter-water-pos)) - (format #t "~Tdrip-old-pos: ~`vector`P~%" (-> obj drip-old-pos)) - (format #t "~Tdrip-joint-index: ~D~%" (-> obj drip-joint-index)) - (format #t "~Tdrip-wetness: ~f~%" (-> obj drip-wetness)) - (format #t "~Tdrip-time: ~D~%" (-> obj drip-time)) - (format #t "~Tdrip-speed: ~f~%" (-> obj drip-speed)) - (format #t "~Tdrip-height: (meters ~m)~%" (-> obj drip-height)) - (format #t "~Tdrip-mult: ~f~%" (-> obj drip-mult)) - obj +(defmethod inspect water-control ((this water-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tflags: #x~X~%" (-> this flags)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~Ttop-y-offset: ~f~%" (-> this top-y-offset)) + (format #t "~Tripple-size: (meters ~m)~%" (-> this ripple-size)) + (format #t "~Tenter-water-time: ~D~%" (-> this enter-water-time)) + (format #t "~Twade-time: ~D~%" (-> this wade-time)) + (format #t "~Ton-water-time: ~D~%" (-> this on-water-time)) + (format #t "~Tenter-swim-time: ~D~%" (-> this enter-swim-time)) + (format #t "~Tswim-time: ~D~%" (-> this swim-time)) + (format #t "~Tbase-height: (meters ~m)~%" (-> this base-height)) + (format #t "~Twade-height: (meters ~m)~%" (-> this wade-height)) + (format #t "~Tswim-height: (meters ~m)~%" (-> this swim-height)) + (format #t "~Tsurface-height: (meters ~m)~%" (-> this surface-height)) + (format #t "~Tbottom-height: (meters ~m)~%" (-> this bottom-height)) + (format #t "~Theight: (meters ~m)~%" (-> this height)) + (format #t "~Theight-offset[4] @ #x~X~%" (-> this height-offset)) + (format #t "~Treal-ocean-offset: (meters ~m)~%" (-> this real-ocean-offset)) + (format #t "~Tocean-offset: (meters ~m)~%" (-> this ocean-offset)) + (format #t "~Tbob-offset: (meters ~m)~%" (-> this bob-offset)) + (format #t "~Talign-offset: (meters ~m)~%" (-> this align-offset)) + (format #t "~Tswim-depth: (meters ~m)~%" (-> this swim-depth)) + (format #t "~Tbob: #~%" (-> this bob)) + (format #t "~Tvolume: ~D~%" (-> this volume)) + (format #t "~Tbottom[2] @ #x~X~%" (-> this bottom)) + (format #t "~Ttop[2] @ #x~X~%" (-> this top)) + (format #t "~Tenter-water-pos: ~`vector`P~%" (-> this enter-water-pos)) + (format #t "~Tdrip-old-pos: ~`vector`P~%" (-> this drip-old-pos)) + (format #t "~Tdrip-joint-index: ~D~%" (-> this drip-joint-index)) + (format #t "~Tdrip-wetness: ~f~%" (-> this drip-wetness)) + (format #t "~Tdrip-time: ~D~%" (-> this drip-time)) + (format #t "~Tdrip-speed: ~f~%" (-> this drip-speed)) + (format #t "~Tdrip-height: (meters ~m)~%" (-> this drip-height)) + (format #t "~Tdrip-mult: ~f~%" (-> this drip-mult)) + this ) ;; definition for method 14 of type water-control -(defmethod display-water-marks? water-control ((obj water-control)) - (and *display-water-marks* (logtest? (-> obj flags) (water-flags wt00))) +(defmethod display-water-marks? water-control ((this water-control)) + (and *display-water-marks* (logtest? (-> this flags) (water-flags wt00))) ) ;; definition for method 0 of type water-control @@ -116,8 +116,8 @@ ) ;; definition for method 12 of type water-control -(defmethod distance-from-surface water-control ((obj water-control)) - (- (-> obj top 0 y) (-> obj height)) +(defmethod distance-from-surface water-control ((this water-control)) + (- (-> this top 0 y) (-> this height)) ) ;; definition of type water-vol @@ -149,23 +149,19 @@ ) ;; definition for method 3 of type water-vol -(defmethod inspect water-vol ((obj water-vol)) +(defmethod inspect water-vol ((this water-vol)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Twater-height: (meters ~m)~%" (-> obj water-height)) - (format #t "~T~Twade-height: (meters ~m)~%" (-> obj wade-height)) - (format #t "~T~Tswim-height: (meters ~m)~%" (-> obj swim-height)) - (format #t "~T~Tbottom-height: (meters ~m)~%" (-> obj bottom-height)) - (format #t "~T~Tattack-event: ~A~%" (-> obj attack-event)) - (format #t "~T~Ttarget: ~D~%" (-> obj target)) - (format #t "~T~Tflags: #x~X~%" (-> obj flags)) - obj + (format #t "~T~Twater-height: (meters ~m)~%" (-> this water-height)) + (format #t "~T~Twade-height: (meters ~m)~%" (-> this wade-height)) + (format #t "~T~Tswim-height: (meters ~m)~%" (-> this swim-height)) + (format #t "~T~Tbottom-height: (meters ~m)~%" (-> this bottom-height)) + (format #t "~T~Tattack-event: ~A~%" (-> this attack-event)) + (format #t "~T~Ttarget: ~D~%" (-> this target)) + (format #t "~T~Tflags: #x~X~%" (-> this flags)) + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc b/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc index c94c19deb1..51bb91b56a 100644 --- a/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc +++ b/test/decompiler/reference/jak1/engine/common-obs/water_REF.gc @@ -660,7 +660,7 @@ ;; definition for method 9 of type water-control ;; INFO: Return type mismatch int vs none. -(defmethod water-control-method-9 water-control ((obj water-control)) +(defmethod water-control-method-9 water-control ((this water-control)) 0 (none) ) @@ -668,93 +668,97 @@ ;; definition for method 10 of type water-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod water-control-method-10 water-control ((obj water-control)) +(defmethod water-control-method-10 water-control ((this water-control)) (with-pp - (let ((s5-0 (-> obj flags))) + (let ((s5-0 (-> this flags))) (cond - ((not (logtest? (-> obj flags) (water-flags wt01))) - (logclear! (-> obj flags) (water-flags wt09 wt10 wt11 wt12 wt13 wt14 wt16)) + ((not (logtest? (-> this flags) (water-flags wt01))) + (logclear! (-> this flags) (water-flags wt09 wt10 wt11 wt12 wt13 wt14 wt16)) ) - ((and (logtest? (water-flags wt21) (-> obj flags)) - (logtest? (-> obj process state-flags) (state-flags grabbed)) + ((and (logtest? (water-flags wt21) (-> this flags)) + (logtest? (-> this process state-flags) (state-flags grabbed)) ) - (logior! (-> obj flags) (water-flags wt16)) + (logior! (-> this flags) (water-flags wt16)) ) ((begin - (set! (-> obj top 1 quad) (-> obj top 0 quad)) - (vector<-cspace! (the-as vector (-> obj top)) (-> obj process node-list data (-> obj joint-index))) - (+! (-> obj top 0 y) (-> obj top-y-offset)) - (set! (-> obj bottom 1 quad) (-> obj bottom 0 quad)) - (set! (-> obj bottom 0 quad) (-> obj process root trans quad)) - (logclear! (-> obj flags) (water-flags wt10 wt11 wt12 wt13 wt14)) - (set! (-> obj bob-offset) (update! (-> obj bob))) + (set! (-> this top 1 quad) (-> this top 0 quad)) + (vector<-cspace! (the-as vector (-> this top)) (-> this process node-list data (-> this joint-index))) + (+! (-> this top 0 y) (-> this top-y-offset)) + (set! (-> this bottom 1 quad) (-> this bottom 0 quad)) + (set! (-> this bottom 0 quad) (-> this process root trans quad)) + (logclear! (-> this flags) (water-flags wt10 wt11 wt12 wt13 wt14)) + (set! (-> this bob-offset) (update! (-> this bob))) (cond - ((and (logtest? (-> obj flags) (water-flags wt08)) - (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + ((and (logtest? (-> this flags) (water-flags wt08)) + (not (logtest? (-> (the-as collide-shape-moving (-> this process root)) root-prim prim-core action) (collide-action racer) ) ) ) - (set! (-> obj real-ocean-offset) (- (ocean-get-height (the-as vector (-> obj bottom))) (-> obj base-height))) - (if (not (logtest? (-> obj flags) (water-flags wt09))) - (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) - (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj real-ocean-offset) 0.2)) + (set! (-> this real-ocean-offset) + (- (ocean-get-height (the-as vector (-> this bottom))) (-> this base-height)) + ) + (if (not (logtest? (-> this flags) (water-flags wt09))) + (set! (-> this ocean-offset) (-> this real-ocean-offset)) + (set! (-> this ocean-offset) (lerp (-> this ocean-offset) (-> this real-ocean-offset) 0.2)) ) ) - ((logtest? (water-flags wt20) (-> obj flags)) - (let* ((a0-26 (-> obj volume process 0)) - (f30-0 (ripple-find-height (the-as process-drawable a0-26) 0 (the-as vector (-> obj bottom)))) + ((logtest? (water-flags wt20) (-> this flags)) + (let* ((a0-26 (-> this volume process 0)) + (f30-0 (ripple-find-height (the-as process-drawable a0-26) 0 (the-as vector (-> this bottom)))) ) - (set! (-> obj real-ocean-offset) (- f30-0 (-> obj base-height))) - (if (not (logtest? (-> obj flags) (water-flags wt09))) - (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) - (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj real-ocean-offset) 0.2)) + (set! (-> this real-ocean-offset) (- f30-0 (-> this base-height))) + (if (not (logtest? (-> this flags) (water-flags wt09))) + (set! (-> this ocean-offset) (-> this real-ocean-offset)) + (set! (-> this ocean-offset) (lerp (-> this ocean-offset) (-> this real-ocean-offset) 0.2)) ) (let ((v1-36 (new 'stack-no-clear 'vector))) - (set! (-> v1-36 quad) (-> obj bottom 0 quad)) + (set! (-> v1-36 quad) (-> this bottom 0 quad)) (set! (-> v1-36 y) f30-0) ) ) ) (else - (set! (-> obj real-ocean-offset) 0.0) - (set! (-> obj ocean-offset) 0.0) + (set! (-> this real-ocean-offset) 0.0) + (set! (-> this ocean-offset) 0.0) ) ) - (if (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (if (logtest? (-> (the-as collide-shape-moving (-> this process root)) root-prim prim-core action) (collide-action racer) ) - (set! (-> obj bob-offset) 0.0) + (set! (-> this bob-offset) 0.0) ) - (set! (-> obj height) - (+ (-> obj base-height) (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)) + (set! (-> this height) + (+ (-> this base-height) (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)) ) - (set! (-> obj surface-height) (+ (-> obj base-height) (-> obj real-ocean-offset))) - (set! (-> obj swim-depth) (fmax 0.0 (- (- (-> obj surface-height) (-> obj swim-height)) (-> obj bottom 0 y)))) - (>= (-> obj height) (-> obj bottom 0 y)) + (set! (-> this surface-height) (+ (-> this base-height) (-> this real-ocean-offset))) + (set! (-> this swim-depth) + (fmax 0.0 (- (- (-> this surface-height) (-> this swim-height)) (-> this bottom 0 y))) + ) + (>= (-> this height) (-> this bottom 0 y)) ) - (if (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) - (set! (-> obj on-water-time) (-> *display* base-frame-counter)) + (if (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags on-water)) + (set-time! (-> this on-water-time)) ) - (set! (-> obj drip-wetness) 1.0) - (set! (-> obj drip-height) (fmax (- (-> obj surface-height) (-> obj bottom 0 y)) (-> obj drip-height))) - (set! (-> obj drip-speed) 15.0) - (if (not (logtest? (-> obj flags) (water-flags wt09))) - (water-control-method-15 obj) + (set! (-> this drip-wetness) 1.0) + (set! (-> this drip-height) (fmax (- (-> this surface-height) (-> this bottom 0 y)) (-> this drip-height))) + (set! (-> this drip-speed) 15.0) + (if (not (logtest? (-> this flags) (water-flags wt09))) + (water-control-method-15 this) ) (cond - ((>= (-> obj top 0 y) (-> obj height)) + ((>= (-> this top 0 y) (-> this height)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj bottom 0 quad)) - (vector-xz-length (-> obj process root transv)) - (set! (-> s4-0 y) (-> obj surface-height)) - (when (and (logtest? (-> obj process draw status) (draw-status was-drawn)) - (zero? (-> obj process draw cur-lod)) - (logtest? (water-flags wt22) (-> obj flags)) - (logtest? (water-flags wt23) (-> obj flags)) + (set! (-> s4-0 quad) (-> this bottom 0 quad)) + (vector-xz-length (-> this process root transv)) + (set! (-> s4-0 y) (-> this surface-height)) + (when (and (logtest? (-> this process draw status) (draw-status was-drawn)) + (zero? (-> this process draw cur-lod)) + (logtest? (water-flags wt22) (-> this flags)) + (logtest? (water-flags wt23) (-> this flags)) ) - (let ((f30-1 (y-angle (-> obj process root))) - (f28-0 (vector-xz-length (-> obj process root transv))) + (let ((f30-1 (y-angle (-> this process root))) + (f28-0 (vector-xz-length (-> this process root transv))) ) (set! (-> *part-id-table* 118 init-specs 4 initial-valuef) (+ 24576.0 f30-1)) (set! (-> *part-id-table* 118 init-specs 19 initial-valuef) (+ 49152.0 f30-1)) @@ -766,95 +770,91 @@ (set! (-> *part-id-table* 121 init-specs 18 initial-valuef) f30-1) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 121) s4-0) (when (< f28-0 4096.0) - (set! (-> *part-id-table* 112 init-specs 4 random-rangef) (-> obj ripple-size)) + (set! (-> *part-id-table* 112 init-specs 4 random-rangef) (-> this ripple-size)) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 112) s4-0) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 115) s4-0) ) ) ) - (if (< (-> obj top 1 y) (-> obj height)) - (create-splash obj 0.2 s4-0 1 (-> obj process root transv)) + (if (< (-> this top 1 y) (-> this height)) + (create-splash this 0.2 s4-0 1 (-> this process root transv)) ) ) ) (else - (logior! (-> obj flags) (water-flags wt13)) + (logior! (-> this flags) (water-flags wt13)) ) ) - (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) - (let* ((v1-124 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) - (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data v1-124))) + (when (and (logtest? (-> this flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> this flags))) + (let* ((v1-124 (rand-vu-int-range 3 (+ (-> this process node-list length) -1))) + (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data v1-124))) ) - (set! (-> *part-id-table* 110 init-specs 16 initial-valuef) (-> obj surface-height)) + (set! (-> *part-id-table* 110 init-specs 16 initial-valuef) (-> this surface-height)) (set! (-> *part-id-table* 110 init-specs 1 initial-valuef) - (+ (lerp-scale 12.0 0.4 (the float (- (-> *display* base-frame-counter) (-> obj enter-water-time))) 0.0 600.0) - (* 0.00012207031 (vector-xz-length (-> obj process root transv))) + (+ (lerp-scale 12.0 0.4 (the float (- (current-time) (-> this enter-water-time))) 0.0 600.0) + (* 0.00012207031 (vector-xz-length (-> this process root transv))) ) ) (launch-particles (-> *part-id-table* 110) s4-1) - (set! (-> *part-id-table* 111 init-specs 16 initial-valuef) (-> obj surface-height)) + (set! (-> *part-id-table* 111 init-specs 16 initial-valuef) (-> this surface-height)) (launch-particles (-> *part-id-table* 111) s4-1) ) ) - (let ((f30-3 (- (+ (-> obj base-height) (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)) - (-> obj swim-height) + (let ((f30-3 (- (+ (-> this base-height) (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)) + (-> this swim-height) ) ) ) - (let* ((s4-2 (-> obj process root)) + (let* ((s4-2 (-> this process root)) (v1-146 (if (and (nonzero? s4-2) (type-type? (-> s4-2 type) control-info)) s4-2 ) ) - (s4-3 - (and v1-146 - (< (- (-> *display* base-frame-counter) (-> (the-as control-info v1-146) unknown-dword11)) (seconds 0.5)) - ) - ) + (s4-3 (and v1-146 (not (time-elapsed? (-> (the-as control-info v1-146) unknown-dword11) (seconds 0.5))))) ) - (if (and (logtest? (-> obj flags) (water-flags wt04)) + (if (and (logtest? (-> this flags) (water-flags wt04)) (and s4-3 - (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) + (not (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags on-water)) ) ) ) - (set! (-> obj bob amp) (* 0.8 (-> obj bob amp))) + (set! (-> this bob amp) (* 0.8 (-> this bob amp))) ) (cond - ((and (logtest? (-> obj flags) (water-flags wt03)) - (or (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags on-water)) - (>= f30-3 (-> obj bottom 0 y)) + ((and (logtest? (-> this flags) (water-flags wt03)) + (or (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags on-water)) + (>= f30-3 (-> this bottom 0 y)) (and (logtest? s5-0 (water-flags wt11)) - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags tsurf)) - (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags onsurf))) - (>= (+ 204.8 f30-3) (-> obj bottom 0 y)) + (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags tsurf)) + (not (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags onsurf))) + (>= (+ 204.8 f30-3) (-> this bottom 0 y)) ) ) (or (logtest? s5-0 (water-flags wt11)) - (< 12288.0 (vector-xz-length (-> obj process root transv))) - (< (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> obj enter-water-time)) - (>= (+ (- 204.8 (fmin 6144.0 (+ (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)))) f30-3) - (-> obj bottom 0 y) + (< 12288.0 (vector-xz-length (-> this process root transv))) + (< (+ (current-time) (seconds -0.2)) (-> this enter-water-time)) + (>= (+ (- 204.8 (fmin 6144.0 (+ (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)))) f30-3) + (-> this bottom 0 y) ) ) ) - (set! (-> obj swim-time) (-> *display* base-frame-counter)) - (send-event (-> obj process) 'swim) - (logior! (-> obj flags) (water-flags wt11)) + (set-time! (-> this swim-time)) + (send-event (-> this process) 'swim) + (logior! (-> this flags) (water-flags wt11)) (if (not (logtest? s5-0 (water-flags wt11))) - (set! (-> obj enter-swim-time) (-> *display* base-frame-counter)) + (set-time! (-> this enter-swim-time)) ) (cond - ((and (logtest? (-> obj flags) (water-flags wt04)) - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) (cshape-moving-flags tsurf)) - (not (logtest? (water-flags wt16) (-> obj flags))) + ((and (logtest? (-> this flags) (water-flags wt04)) + (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags tsurf)) + (not (logtest? (water-flags wt16) (-> this flags))) ) (let ((v1-200 (new 'stack-no-clear 'vector))) - (set! (-> v1-200 quad) (-> obj bottom 0 quad)) - (set! (-> v1-200 y) (- (-> obj height) (-> obj swim-height))) - (let ((s4-4 (-> obj process root))) + (set! (-> v1-200 quad) (-> this bottom 0 quad)) + (set! (-> v1-200 y) (- (-> this height) (-> this swim-height))) + (let ((s4-4 (-> this process root))) (when (and (not (logtest? (-> (the-as collide-shape-moving s4-4) status) (cshape-moving-flags csmf12))) - (logtest? (-> obj flags) (water-flags wt11)) + (logtest? (-> this flags) (water-flags wt11)) (not (logtest? (-> (the-as collide-shape-moving s4-4) root-prim prim-core action) (collide-action racer))) ) (let ((a1-27 (vector-! (new 'stack-no-clear 'vector) v1-200 (-> s4-4 trans)))) @@ -866,35 +866,33 @@ ) ) ) - ((and (< (-> obj bottom 0 y) f30-3) (not (logtest? (water-flags wt16) (-> obj flags)))) - (logior! (-> obj flags) (water-flags wt12)) + ((and (< (-> this bottom 0 y) f30-3) (not (logtest? (water-flags wt16) (-> this flags)))) + (logior! (-> this flags) (water-flags wt12)) ) ) ) ((begin - (set! s4-3 (and (logtest? (-> obj flags) (water-flags wt02)) - (or (not (!= (-> obj bob amp) 0.0)) - (>= (- (-> *display* base-frame-counter) (-> obj swim-time)) (seconds 0.05)) - ) - (and (>= (- (-> obj height) (-> obj wade-height)) (-> obj bottom 0 y)) s4-3) + (set! s4-3 (and (logtest? (-> this flags) (water-flags wt02)) + (or (not (!= (-> this bob amp) 0.0)) (time-elapsed? (-> this swim-time) (seconds 0.05))) + (and (>= (- (-> this height) (-> this wade-height)) (-> this bottom 0 y)) s4-3) ) ) s4-3 ) - (set! (-> obj wade-time) (-> *display* base-frame-counter)) - (send-event (-> obj process) 'wade) - (logior! (-> obj flags) (water-flags wt10)) + (set-time! (-> this wade-time)) + (send-event (-> this process) 'wade) + (logior! (-> this flags) (water-flags wt10)) ) ) ) - (when (and (logtest? (-> obj flags) (water-flags wt03)) - (< (-> obj bottom 1 y) f30-3) - (and (< f30-3 (-> obj bottom 0 y)) (logtest? s5-0 (water-flags wt12))) + (when (and (logtest? (-> this flags) (water-flags wt03)) + (< (-> this bottom 1 y) f30-3) + (and (< f30-3 (-> this bottom 0 y)) (logtest? s5-0 (water-flags wt12))) ) - (logior! (-> obj flags) (water-flags wt11)) + (logior! (-> this flags) (water-flags wt11)) (let ((a1-30 (new 'stack-no-clear 'vector))) - (set! (-> a1-30 quad) (-> obj bottom 0 quad)) - (let ((s5-1 (-> obj process root))) + (set! (-> a1-30 quad) (-> this bottom 0 quad)) + (let ((s5-1 (-> this process root))) (set! (-> a1-30 y) f30-3) (when (not (logtest? (-> (the-as collide-shape-moving s5-1) root-prim prim-core action) (collide-action racer))) (let ((f30-4 (-> (the-as collide-shape-moving s5-1) ground-impact-vel))) @@ -907,25 +905,25 @@ ) ) ) - (when (and (logtest? (water-flags wt17) (-> obj flags)) (= (-> obj process type) target)) - (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) + (when (and (logtest? (water-flags wt17) (-> this flags)) (= (-> this process type) target)) + (when (and (logtest? (-> (the-as collide-shape-moving (-> this process root)) status) (cshape-moving-flags onsurf on-water) ) - (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (not (logtest? (-> (the-as collide-shape-moving (-> this process root)) root-prim prim-core action) (collide-action racer) ) ) ) - (when (< (-> obj process root trans y) -409.6) - (send-event (-> obj process) 'no-look-around (seconds 1.5)) - (when (not (logtest? (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) + (when (< (-> this process root trans y) -409.6) + (send-event (-> this process) 'no-look-around (seconds 1.5)) + (when (not (logtest? (-> (the-as collide-shape-moving (-> this process root)) root-prim prim-core action) (collide-action flut) ) ) (cond - ((= (-> obj process type) target) + ((= (-> this process type) target) (send-event - (-> obj process) + (-> this process) 'attack #f (static-attack-info ((shove-up (meters 0.5)) (shove-back (meters 0)) (mode 'tar))) @@ -943,68 +941,69 @@ (set! (-> a1-33 param 2) (the-as uint v1-281)) ) (set! (-> a1-33 param 3) (the-as uint 0)) - (send-event-function (-> obj process) a1-33) + (send-event-function (-> this process) a1-33) ) ) ) ) - (let ((v1-283 (-> obj process))) + (let ((v1-283 (-> this process))) (set! (-> (the-as collide-shape-moving (-> v1-283 root)) surf) *tar-surface*) (set! (-> (the-as collide-shape-moving (-> v1-283 root)) ground-pat material) 4) ) ) - (set! (-> obj swim-height) (lerp (-> obj swim-height) 7372.8 0.05)) + (set! (-> this swim-height) (lerp (-> this swim-height) 7372.8 0.05)) ) ) ) (else - (if (logtest? (-> obj flags) (water-flags wt09)) - (water-control-method-16 obj) + (if (logtest? (-> this flags) (water-flags wt09)) + (water-control-method-16 this) ) ) ) ) - (when (not (or (not (logtest? (-> obj flags) (water-flags wt06))) - (not (logtest? (water-flags wt23) (-> obj flags))) - (= (-> obj drip-wetness) 0.0) + (when (not (or (not (logtest? (-> this flags) (water-flags wt06))) + (not (logtest? (water-flags wt23) (-> this flags))) + (= (-> this drip-wetness) 0.0) ) ) (cond - ((logtest? (-> obj flags) (water-flags wt15)) + ((logtest? (-> this flags) (water-flags wt15)) (let ((a2-15 - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data (-> obj drip-joint-index))) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data (-> this drip-joint-index))) ) ) (set! (-> *part-id-table* 145 init-specs 16 initial-valuef) - (fmax (-> obj surface-height) (-> obj bottom 0 y)) + (fmax (-> this surface-height) (-> this bottom 0 y)) + ) + (set! (-> *part-id-table* 145 init-specs 8 initial-valuef) (* 0.05 (- (-> a2-15 x) (-> this drip-old-pos x)))) + (set! (-> *part-id-table* 145 init-specs 9 initial-valuef) (* 0.05 (- (-> a2-15 y) (-> this drip-old-pos y)))) + (set! (-> *part-id-table* 145 init-specs 10 initial-valuef) + (* 0.05 (- (-> a2-15 z) (-> this drip-old-pos z))) ) - (set! (-> *part-id-table* 145 init-specs 8 initial-valuef) (* 0.05 (- (-> a2-15 x) (-> obj drip-old-pos x)))) - (set! (-> *part-id-table* 145 init-specs 9 initial-valuef) (* 0.05 (- (-> a2-15 y) (-> obj drip-old-pos y)))) - (set! (-> *part-id-table* 145 init-specs 10 initial-valuef) (* 0.05 (- (-> a2-15 z) (-> obj drip-old-pos z)))) (launch-particles (-> *part-id-table* 145) a2-15) ) - (set! (-> obj drip-time) (-> *display* base-frame-counter)) - (logclear! (-> obj flags) (water-flags wt15)) - (seek! (-> obj drip-wetness) 0.0 (* 0.001 (-> obj drip-speed))) - (set! (-> obj drip-speed) (* 1.05 (-> obj drip-speed))) - (if (= (-> obj drip-wetness) 0.0) - (set! (-> obj drip-height) 0.0) + (set-time! (-> this drip-time)) + (logclear! (-> this flags) (water-flags wt15)) + (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) + (if (= (-> this drip-wetness) 0.0) + (set! (-> this drip-height) 0.0) ) ) - ((>= (- (-> *display* base-frame-counter) - (the-as time-frame (the int (/ (the float (-> obj drip-time)) (-> obj drip-mult)))) + ((time-elapsed? + (the-as time-frame (the int (/ (the float (-> this drip-time)) (-> this drip-mult)))) + (the int (-> this drip-speed)) + ) + (let* ((s5-2 (rand-vu-int-range 3 (+ (-> this process node-list length) -1))) + (v1-328 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-2))) ) - (the int (-> obj drip-speed)) - ) - (let* ((s5-2 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) - (v1-328 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-2))) - ) - (when (and (< (- (-> v1-328 y) (-> obj process root trans y)) (-> obj drip-height)) - (< (-> obj height) (-> v1-328 y)) + (when (and (< (- (-> v1-328 y) (-> this process root trans y)) (-> this drip-height)) + (< (-> this height) (-> v1-328 y)) ) - (set! (-> obj drip-joint-index) s5-2) - (set! (-> obj drip-old-pos quad) (-> v1-328 quad)) - (logior! (-> obj flags) (water-flags wt15)) + (set! (-> this drip-joint-index) s5-2) + (set! (-> this drip-old-pos quad) (-> v1-328 quad)) + (logior! (-> this flags) (water-flags wt15)) ) ) ) @@ -1017,8 +1016,8 @@ ;; definition for method 11 of type water-control ;; INFO: Return type mismatch int vs none. -(defmethod start-bobbing! water-control ((obj water-control) (arg0 float) (arg1 int) (arg2 int)) - (activate! (-> obj bob) (- arg0) arg1 arg2 0.9 1.0) +(defmethod start-bobbing! water-control ((this water-control) (arg0 float) (arg1 int) (arg2 int)) + (activate! (-> this bob) (- arg0) arg1 arg2 0.9 1.0) 0 (none) ) @@ -1118,30 +1117,30 @@ ;; definition for method 15 of type water-control ;; INFO: Return type mismatch int vs none. -(defmethod water-control-method-15 water-control ((obj water-control)) +(defmethod water-control-method-15 water-control ((this water-control)) (with-pp - (logior! (-> obj flags) (water-flags wt09)) - (logclear! (-> obj flags) (water-flags wt16)) - (set! (-> obj enter-water-time) (-> *display* base-frame-counter)) - (set-vector! (-> obj enter-water-pos) (-> obj bottom 0 x) (-> obj surface-height) (-> obj bottom 0 z) 1.0) - (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) + (logior! (-> this flags) (water-flags wt09)) + (logclear! (-> this flags) (water-flags wt16)) + (set-time! (-> this enter-water-time)) + (set-vector! (-> this enter-water-pos) (-> this bottom 0 x) (-> this surface-height) (-> this bottom 0 z) 1.0) + (when (and (logtest? (-> this flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> this flags))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) pp) (set! (-> a1-1 num-params) 1) (set! (-> a1-1 message) 'query) (set! (-> a1-1 param 0) (the-as uint 'ground-height)) - (let* ((f0-4 (the-as float (send-event-function (-> obj process) a1-1))) + (let* ((f0-4 (the-as float (send-event-function (-> this process) a1-1))) (f30-0 (lerp-scale 0.3 1.0 f0-4 2048.0 24576.0)) ) - (if (nonzero? (-> obj process skel effect)) - (effect-control-method-10 (-> obj process skel effect) 'swim-stroke 0.0 -1) + (if (nonzero? (-> this process skel effect)) + (effect-control-method-10 (-> this process skel effect) 'swim-stroke 0.0 -1) ) - (create-splash obj f30-0 (-> obj enter-water-pos) 1 (-> obj process root transv)) + (create-splash this f30-0 (-> this enter-water-pos) 1 (-> this process root transv)) ) ) ) - (if (logtest? (water-flags wt17) (-> obj flags)) - (set! (-> obj swim-height) 2867.2) + (if (logtest? (water-flags wt17) (-> this flags)) + (set! (-> this swim-height) 2867.2) ) 0 (none) @@ -1150,11 +1149,11 @@ ;; definition for method 16 of type water-control ;; INFO: Return type mismatch int vs none. -(defmethod water-control-method-16 water-control ((obj water-control)) - (logclear! (-> obj flags) (water-flags wt09)) - (set-zero! (-> obj bob)) - (if (logtest? (water-flags wt17) (-> obj flags)) - (set! (-> obj swim-height) 2867.2) +(defmethod water-control-method-16 water-control ((this water-control)) + (logclear! (-> this flags) (water-flags wt09)) + (set-zero! (-> this bob)) + (if (logtest? (water-flags wt17) (-> this flags)) + (set! (-> this swim-height) 2867.2) ) 0 (none) @@ -1183,10 +1182,10 @@ ;; definition for method 13 of type water-control ;; INFO: Return type mismatch int vs none. -(defmethod create-splash water-control ((obj water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector)) - (when (and (logtest? (-> obj flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> obj flags))) +(defmethod create-splash water-control ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector)) + (when (and (logtest? (-> this flags) (water-flags wt05)) (logtest? (water-flags wt23) (-> this flags))) (let ((a1-3 (vector+float*! (new 'stack-no-clear 'vector) arg1 arg3 0.05))) - (set! (-> a1-3 y) (-> obj surface-height)) + (set! (-> a1-3 y) (-> this surface-height)) (splash-spawn (the-as basic arg0) (the-as basic a1-3) arg2) ) ) @@ -1196,13 +1195,13 @@ ;; definition for method 27 of type water-vol ;; INFO: Return type mismatch int vs none. -(defmethod on-exit-water water-vol ((obj water-vol)) - (when (handle->process (-> obj target)) - (let ((v1-7 (-> (the-as target (-> obj target process 0)) water))) +(defmethod on-exit-water water-vol ((this water-vol)) + (when (handle->process (-> this target)) + (let ((v1-7 (-> (the-as target (-> this target process 0)) water))) (logclear! (-> v1-7 flags) (water-flags wt01 wt02 wt03 wt08 wt17 wt18 wt19 wt20 wt21 wt23 wt24 wt25 wt26)) (set! (-> v1-7 volume) (the-as handle #f)) ) - (set! (-> obj target) (the-as handle #f)) + (set! (-> this target) (the-as handle #f)) (iterate-process-tree *entity-pool* (lambda ((arg0 water-vol)) (with-pp @@ -1213,7 +1212,7 @@ ) *null-kernel-context* ) - (process-entity-status! obj (entity-perm-status bit-3) #f) + (process-entity-status! this (entity-perm-status bit-3) #f) ) 0 (none) @@ -1221,34 +1220,34 @@ ;; definition for method 26 of type water-vol ;; INFO: Return type mismatch int vs none. -(defmethod update! water-vol ((obj water-vol)) +(defmethod update! water-vol ((this water-vol)) (cond - ((handle->process (-> obj target)) + ((handle->process (-> this target)) (cond - ((not (point-in-vol? (-> obj vol) (-> (the-as target (-> obj target process 0)) control trans))) - (on-exit-water obj) + ((not (point-in-vol? (-> this vol) (-> (the-as target (-> this target process 0)) control trans))) + (on-exit-water this) ) (else - (let ((v1-15 (-> (the-as target (-> obj target process 0)) water))) - (when (and (logtest? (water-flags wt19) (-> obj flags)) + (let ((v1-15 (-> (the-as target (-> this target process 0)) water))) + (when (and (logtest? (water-flags wt19) (-> this flags)) (logtest? (-> v1-15 flags) (water-flags wt09)) (>= (-> v1-15 surface-height) (-> v1-15 bottom 0 y)) ) - (let ((v1-18 (-> obj attack-event))) + (let ((v1-18 (-> this attack-event))) (case v1-18 ((#f) ) (('heat) - (send-event (handle->process (-> obj target)) 'heat (* 10.0 (-> *display* seconds-per-frame))) + (send-event (handle->process (-> this target)) 'heat (* 10.0 (seconds-per-frame))) ) (('drown-death 'lava 'dark-eco-pool) - (if (send-event (handle->process (-> obj target)) 'attack-invinc #f (static-attack-info ((mode v1-18)))) - (send-event obj 'notify 'attack) + (if (send-event (handle->process (-> this target)) 'attack-invinc #f (static-attack-info ((mode v1-18)))) + (send-event this 'notify 'attack) ) ) (else - (if (send-event (handle->process (-> obj target)) 'attack #f (static-attack-info ((mode v1-18)))) - (send-event obj 'notify 'attack) + (if (send-event (handle->process (-> this target)) 'attack #f (static-attack-info ((mode v1-18)))) + (send-event this 'notify 'attack) ) ) ) @@ -1259,25 +1258,25 @@ ) ) ((and *target* (and (not (handle->process (-> *target* water volume))) - (point-in-vol? (-> obj vol) (-> *target* control trans)) + (point-in-vol? (-> this vol) (-> *target* control trans)) ) ) (let ((s5-0 (-> *target* water))) - (process-entity-status! obj (entity-perm-status bit-3) #t) - (set! (-> s5-0 volume) (process->handle obj)) - (set! (-> obj target) (process->handle *target*)) + (process-entity-status! this (entity-perm-status bit-3) #t) + (set! (-> s5-0 volume) (process->handle this)) + (set! (-> this target) (process->handle *target*)) (logior! (-> s5-0 flags) (water-flags wt01)) - (set! (-> s5-0 base-height) (-> obj water-height)) + (set! (-> s5-0 base-height) (-> this water-height)) (set! (-> s5-0 ocean-offset) 0.0) - (logior! (-> s5-0 flags) (-> obj flags)) - (if (< 0.0 (-> obj wade-height)) - (set! (-> s5-0 wade-height) (-> obj wade-height)) + (logior! (-> s5-0 flags) (-> this flags)) + (if (< 0.0 (-> this wade-height)) + (set! (-> s5-0 wade-height) (-> this wade-height)) ) - (if (< 0.0 (-> obj swim-height)) - (set! (-> s5-0 swim-height) (-> obj swim-height)) + (if (< 0.0 (-> this swim-height)) + (set! (-> s5-0 swim-height) (-> this swim-height)) ) - (if (< 0.0 (-> obj bottom-height)) - (set! (-> s5-0 bottom-height) (-> obj bottom-height)) + (if (< 0.0 (-> this bottom-height)) + (set! (-> s5-0 bottom-height) (-> this bottom-height)) ) (set-zero! (-> s5-0 bob)) ) @@ -1315,21 +1314,21 @@ ) ;; definition for method 24 of type water-vol -(defmethod set-stack-size! water-vol ((obj water-vol)) - (stack-size-set! (-> obj main-thread) 128) +(defmethod set-stack-size! water-vol ((this water-vol)) + (stack-size-set! (-> this main-thread) 128) (none) ) ;; definition for method 23 of type water-vol ;; INFO: Return type mismatch trsqv vs none. -(defmethod reset-root! water-vol ((obj water-vol)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod reset-root! water-vol ((this water-vol)) + (set! (-> this root) (new 'process 'trsqv)) (none) ) ;; definition for method 25 of type water-vol ;; INFO: Return type mismatch int vs none. -(defmethod water-vol-method-25 water-vol ((obj water-vol)) +(defmethod water-vol-method-25 water-vol ((this water-vol)) 0 (none) ) @@ -1337,28 +1336,28 @@ ;; definition for method 29 of type water-vol ;; INFO: Used lq/sq ;; INFO: Return type mismatch water-flags vs none. -(defmethod init! water-vol ((obj water-vol)) +(defmethod init! water-vol ((this water-vol)) (local-vars (sv-16 res-tag)) - (set! (-> obj attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) - (-> obj entity) - 'attack-event - 'interp - -1000000000.0 - 'drown - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) + (-> this entity) + 'attack-event + 'interp + -1000000000.0 + 'drown + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) - (process-drawable-from-entity! obj (-> obj entity)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj vol) (new 'process 'vol-control obj)) - (logior! (-> obj vol flags) 3) - (set! (-> obj bottom-height) 32768.0) - (set! (-> obj target) (the-as handle #f)) + (process-drawable-from-entity! this (-> this entity)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this vol) (new 'process 'vol-control this)) + (logior! (-> this vol flags) 3) + (set! (-> this bottom-height) 32768.0) + (set! (-> this target) (the-as handle #f)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-8 (the-as (pointer float) ((method-of-type res-lump get-property-data) - (-> obj entity) + (-> this entity) 'water-height 'exact -1000000000.0 @@ -1370,25 +1369,25 @@ ) ) (when v1-8 - (set! (-> obj water-height) (-> v1-8 0)) - (set! (-> obj wade-height) (-> v1-8 1)) - (set! (-> obj swim-height) (-> v1-8 2)) + (set! (-> this water-height) (-> v1-8 0)) + (set! (-> this wade-height) (-> v1-8 1)) + (set! (-> this swim-height) (-> v1-8 2)) (if (>= (-> sv-16 elt-count) (the-as uint 4)) - (set! (-> obj flags) (the-as water-flags (the int (-> v1-8 3)))) + (set! (-> this flags) (the-as water-flags (the int (-> v1-8 3)))) ) (if (>= (-> sv-16 elt-count) (the-as uint 5)) - (set! (-> obj bottom-height) (-> v1-8 4)) + (set! (-> this bottom-height) (-> v1-8 4)) ) ) ) - (logior! (-> obj flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt23)) (cond - ((zero? (-> obj flags)) - (if (< 0.0 (-> obj wade-height)) - (logior! (-> obj flags) (water-flags wt02)) + ((zero? (-> this flags)) + (if (< 0.0 (-> this wade-height)) + (logior! (-> this flags) (water-flags wt02)) ) - (if (< 0.0 (-> obj swim-height)) - (logior! (-> obj flags) (water-flags wt03)) + (if (< 0.0 (-> this swim-height)) + (logior! (-> this flags) (water-flags wt03)) ) ) (else @@ -1399,7 +1398,7 @@ ;; definition for method 22 of type water-vol ;; INFO: Return type mismatch int vs none. -(defmethod water-vol-method-22 water-vol ((obj water-vol)) +(defmethod water-vol-method-22 water-vol ((this water-vol)) 0 (none) ) @@ -1419,12 +1418,12 @@ ;; definition for method 11 of type water-vol ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! water-vol ((obj water-vol) (arg0 entity-actor)) - (set-stack-size! obj) - (reset-root! obj) - (init! obj) - (water-vol-method-25 obj) - (water-vol-method-22 obj) - (go (method-of-object obj water-vol-startup)) +(defmethod init-from-entity! water-vol ((this water-vol) (arg0 entity-actor)) + (set-stack-size! this) + (reset-root! this) + (init! this) + (water-vol-method-25 this) + (water-vol-method-22 this) + (go (method-of-object this water-vol-startup)) (none) ) diff --git a/test/decompiler/reference/jak1/engine/data/art-h_REF.gc b/test/decompiler/reference/jak1/engine/data/art-h_REF.gc index b9847c72df..81c71330ac 100644 --- a/test/decompiler/reference/jak1/engine/data/art-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/data/art-h_REF.gc @@ -13,12 +13,12 @@ ) ;; definition for method 3 of type joint-anim -(defmethod inspect joint-anim ((obj joint-anim)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnumber: ~D~%" (-> obj number)) - (format #t "~Tlength: ~D~%" (-> obj length)) - obj +(defmethod inspect joint-anim ((this joint-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnumber: ~D~%" (-> this number)) + (format #t "~Tlength: ~D~%" (-> this length)) + this ) ;; definition of type joint-anim-matrix @@ -49,13 +49,13 @@ ) ;; definition for method 3 of type joint-anim-drawable -(defmethod inspect joint-anim-drawable ((obj joint-anim-drawable)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnumber: ~D~%" (-> obj number)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect joint-anim-drawable ((this joint-anim-drawable)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnumber: ~D~%" (-> this number)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; definition of type joint-anim-compressed @@ -68,12 +68,12 @@ ) ;; definition for method 3 of type joint-anim-compressed -(defmethod inspect joint-anim-compressed ((obj joint-anim-compressed)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnumber: ~D~%" (-> obj number)) - (format #t "~Tlength: ~D~%" (-> obj length)) - obj +(defmethod inspect joint-anim-compressed ((this joint-anim-compressed)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnumber: ~D~%" (-> this number)) + (format #t "~Tlength: ~D~%" (-> this length)) + this ) ;; definition of type joint-anim-frame @@ -90,11 +90,11 @@ ) ;; definition for method 3 of type joint-anim-frame -(defmethod inspect joint-anim-frame ((obj joint-anim-frame)) - (format #t "[~8x] ~A~%" obj 'joint-anim-frame) - (format #t "~Tmatrices[2] @ #x~X~%" (-> obj matrices)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect joint-anim-frame ((this joint-anim-frame)) + (format #t "[~8x] ~A~%" this 'joint-anim-frame) + (format #t "~Tmatrices[2] @ #x~X~%" (-> this matrices)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; definition for method 0 of type joint-anim-frame @@ -120,12 +120,12 @@ ) ;; definition for method 3 of type joint-anim-compressed-hdr -(defmethod inspect joint-anim-compressed-hdr ((obj joint-anim-compressed-hdr)) - (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-hdr) - (format #t "~Tcontrol-bits[14] @ #x~X~%" (-> obj control-bits)) - (format #t "~Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~Tmatrix-bits: ~D~%" (-> obj matrix-bits)) - obj +(defmethod inspect joint-anim-compressed-hdr ((this joint-anim-compressed-hdr)) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-hdr) + (format #t "~Tcontrol-bits[14] @ #x~X~%" (-> this control-bits)) + (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~Tmatrix-bits: ~D~%" (-> this matrix-bits)) + this ) ;; definition of type joint-anim-compressed-fixed @@ -143,15 +143,15 @@ ) ;; definition for method 3 of type joint-anim-compressed-fixed -(defmethod inspect joint-anim-compressed-fixed ((obj joint-anim-compressed-fixed)) - (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-fixed) - (format #t "~Thdr: #~%" (-> obj hdr)) - (format #t "~Toffset-64: ~D~%" (-> obj offset-64)) - (format #t "~Toffset-32: ~D~%" (-> obj offset-32)) - (format #t "~Toffset-16: ~D~%" (-> obj offset-16)) - (format #t "~Treserved: ~D~%" (-> obj reserved)) - (format #t "~Tdata[133] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect joint-anim-compressed-fixed ((this joint-anim-compressed-fixed)) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-fixed) + (format #t "~Thdr: #~%" (-> this hdr)) + (format #t "~Toffset-64: ~D~%" (-> this offset-64)) + (format #t "~Toffset-32: ~D~%" (-> this offset-32)) + (format #t "~Toffset-16: ~D~%" (-> this offset-16)) + (format #t "~Treserved: ~D~%" (-> this reserved)) + (format #t "~Tdata[133] @ #x~X~%" (-> this data)) + this ) ;; definition of type joint-anim-compressed-frame @@ -168,14 +168,14 @@ ) ;; definition for method 3 of type joint-anim-compressed-frame -(defmethod inspect joint-anim-compressed-frame ((obj joint-anim-compressed-frame)) - (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-frame) - (format #t "~Toffset-64: ~D~%" (-> obj offset-64)) - (format #t "~Toffset-32: ~D~%" (-> obj offset-32)) - (format #t "~Toffset-16: ~D~%" (-> obj offset-16)) - (format #t "~Treserved: ~D~%" (-> obj reserved)) - (format #t "~Tdata[133] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect joint-anim-compressed-frame ((this joint-anim-compressed-frame)) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-frame) + (format #t "~Toffset-64: ~D~%" (-> this offset-64)) + (format #t "~Toffset-32: ~D~%" (-> this offset-32)) + (format #t "~Toffset-16: ~D~%" (-> this offset-16)) + (format #t "~Treserved: ~D~%" (-> this reserved)) + (format #t "~Tdata[133] @ #x~X~%" (-> this data)) + this ) ;; definition of type joint-anim-compressed-control @@ -192,14 +192,14 @@ ) ;; definition for method 3 of type joint-anim-compressed-control -(defmethod inspect joint-anim-compressed-control ((obj joint-anim-compressed-control)) - (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-control) - (format #t "~Tnum-frames: ~D~%" (-> obj num-frames)) - (format #t "~Tfixed-qwc: ~D~%" (-> obj fixed-qwc)) - (format #t "~Tframe-qwc: ~D~%" (-> obj frame-qwc)) - (format #t "~Tfixed: #~%" (-> obj fixed)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect joint-anim-compressed-control ((this joint-anim-compressed-control)) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-control) + (format #t "~Tnum-frames: ~D~%" (-> this num-frames)) + (format #t "~Tfixed-qwc: ~D~%" (-> this fixed-qwc)) + (format #t "~Tframe-qwc: ~D~%" (-> this frame-qwc)) + (format #t "~Tfixed: #~%" (-> this fixed)) + (format #t "~Tdata[1] @ #x~X~%" (-> this data)) + this ) ;; definition of type art @@ -220,12 +220,12 @@ ) ;; definition for method 3 of type art -(defmethod inspect art ((obj art)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Textra: ~A~%" (-> obj extra)) - obj +(defmethod inspect art ((this art)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Textra: ~A~%" (-> this extra)) + this ) ;; definition of type art-element @@ -238,12 +238,12 @@ ) ;; definition for method 3 of type art-element -(defmethod inspect art-element ((obj art-element)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Textra: ~A~%" (-> obj extra)) - obj +(defmethod inspect art-element ((this art-element)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Textra: ~A~%" (-> this extra)) + this ) ;; definition of type art-mesh-anim @@ -328,22 +328,22 @@ ) ;; definition for method 3 of type skeleton-group -(defmethod inspect skeleton-group ((obj skeleton-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tart-group-name: ~A~%" (-> obj art-group-name)) - (format #t "~Tjgeo: ~D~%" (-> obj jgeo)) - (format #t "~Tjanim: ~D~%" (-> obj janim)) - (format #t "~Tbounds: ~`vector`P~%" (-> obj bounds)) - (format #t "~Tradius: (meters ~m)~%" (-> obj bounds w)) - (format #t "~Tmgeo[4] @ #x~X~%" (-> obj mgeo)) - (format #t "~Tmax-lod: ~D~%" (-> obj max-lod)) - (format #t "~Tlod-dist[4] @ #x~X~%" (-> obj lod-dist)) - (format #t "~Tlongest-edge: (meters ~m)~%" (-> obj longest-edge)) - (format #t "~Ttexture-level: ~D~%" (-> obj texture-level)) - (format #t "~Tversion: ~D~%" (-> obj version)) - (format #t "~Tshadow: ~D~%" (-> obj shadow)) - (format #t "~Tsort: ~D~%" (-> obj sort)) - obj +(defmethod inspect skeleton-group ((this skeleton-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tart-group-name: ~A~%" (-> this art-group-name)) + (format #t "~Tjgeo: ~D~%" (-> this jgeo)) + (format #t "~Tjanim: ~D~%" (-> this janim)) + (format #t "~Tbounds: ~`vector`P~%" (-> this bounds)) + (format #t "~Tradius: (meters ~m)~%" (-> this bounds w)) + (format #t "~Tmgeo[4] @ #x~X~%" (-> this mgeo)) + (format #t "~Tmax-lod: ~D~%" (-> this max-lod)) + (format #t "~Tlod-dist[4] @ #x~X~%" (-> this lod-dist)) + (format #t "~Tlongest-edge: (meters ~m)~%" (-> this longest-edge)) + (format #t "~Ttexture-level: ~D~%" (-> this texture-level)) + (format #t "~Tversion: ~D~%" (-> this version)) + (format #t "~Tshadow: ~D~%" (-> this shadow)) + (format #t "~Tsort: ~D~%" (-> this sort)) + this ) ;; definition of type lod-group @@ -358,11 +358,11 @@ ) ;; definition for method 3 of type lod-group -(defmethod inspect lod-group ((obj lod-group)) - (format #t "[~8x] ~A~%" obj 'lod-group) - (format #t "~Tgeo: ~A~%" (-> obj geo)) - (format #t "~Tdist: (meters ~m)~%" (-> obj dist)) - obj +(defmethod inspect lod-group ((this lod-group)) + (format #t "[~8x] ~A~%" this 'lod-group) + (format #t "~Tgeo: ~A~%" (-> this geo)) + (format #t "~Tdist: (meters ~m)~%" (-> this dist)) + this ) ;; definition of type lod-set @@ -380,11 +380,11 @@ ) ;; definition for method 3 of type lod-set -(defmethod inspect lod-set ((obj lod-set)) - (format #t "[~8x] ~A~%" obj 'lod-set) - (format #t "~Tlod[4] @ #x~X~%" (-> obj lod)) - (format #t "~Tmax-lod: ~D~%" (-> obj max-lod)) - obj +(defmethod inspect lod-set ((this lod-set)) + (format #t "[~8x] ~A~%" this 'lod-set) + (format #t "~Tlod[4] @ #x~X~%" (-> this lod)) + (format #t "~Tmax-lod: ~D~%" (-> this max-lod)) + this ) ;; definition of type draw-control @@ -442,54 +442,54 @@ ) ;; definition for method 3 of type draw-control -(defmethod inspect draw-control ((obj draw-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tstatus: ~D~%" (-> obj status)) - (format #t "~Tmatrix-type: ~D~%" (-> obj matrix-type)) - (format #t "~Tdata-format: ~D~%" (-> obj data-format)) - (format #t "~Tglobal-effect: ~D~%" (-> obj global-effect)) - (format #t "~Tart-group: ~A~%" (-> obj art-group)) - (format #t "~Tjgeo: ~A~%" (-> obj jgeo)) - (format #t "~Tmgeo: ~A~%" (-> obj mgeo)) - (format #t "~Tdma-add-func: ~A~%" (-> obj dma-add-func)) - (format #t "~Tskeleton: ~A~%" (-> obj skeleton)) - (format #t "~Tlod-set: #~%" (-> obj lod-set)) - (format #t "~Tlod[4] @ #x~X~%" (-> obj lod-set)) - (format #t "~Tmax-lod: ~D~%" (-> obj lod-set max-lod)) - (format #t "~Tforce-lod: ~D~%" (-> obj force-lod)) - (format #t "~Tcur-lod: ~D~%" (-> obj cur-lod)) - (format #t "~Tdesired-lod: ~D~%" (-> obj desired-lod)) - (format #t "~Tripple: ~A~%" (-> obj ripple)) - (format #t "~Tlongest-edge: (meters ~m)~%" (-> obj longest-edge)) - (format #t "~Tlongest-edge?: ~D~%" (-> obj longest-edge)) - (format #t "~Tlight-index: ~D~%" (-> obj light-index)) - (format #t "~Tdummy[2] @ #x~X~%" (-> obj dummy)) - (format #t "~Tdeath-draw-overlap: ~D~%" (-> obj death-draw-overlap)) - (format #t "~Tdeath-timer: ~D~%" (-> obj death-timer)) - (format #t "~Tdeath-timer-org: ~D~%" (-> obj death-timer-org)) - (format #t "~Tdeath-vertex-skip: ~D~%" (-> obj death-vertex-skip)) - (format #t "~Tdeath-effect: ~D~%" (-> obj death-effect)) - (format #t "~Tsink-group: ~A~%" (-> obj sink-group)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tshadow: ~A~%" (-> obj shadow)) - (format #t "~Tshadow-ctrl: ~A~%" (-> obj shadow-ctrl)) - (format #t "~Torigin: ~`vector`P~%" (-> obj origin)) - (format #t "~Tbounds: ~`vector`P~%" (-> obj bounds)) - (format #t "~Tradius: (meters ~m)~%" (-> obj bounds w)) - (format #t "~Tcolor-mult: #~%" (-> obj color-mult)) - (format #t "~Tcolor-emissive: #~%" (-> obj color-emissive)) - (format #t "~Tsecondary-interp: ~f~%" (-> obj secondary-interp)) - (format #t "~Tcurrent-secondary-interp: ~f~%" (-> obj current-secondary-interp)) - (format #t "~Tshadow-mask: ~D~%" (-> obj shadow-mask)) - (format #t "~Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~Torigin-joint-index: ~D~%" (-> obj origin-joint-index)) - (format #t "~Tshadow-joint-index: ~D~%" (-> obj shadow-joint-index)) - obj +(defmethod inspect draw-control ((this draw-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tstatus: ~D~%" (-> this status)) + (format #t "~Tmatrix-type: ~D~%" (-> this matrix-type)) + (format #t "~Tdata-format: ~D~%" (-> this data-format)) + (format #t "~Tglobal-effect: ~D~%" (-> this global-effect)) + (format #t "~Tart-group: ~A~%" (-> this art-group)) + (format #t "~Tjgeo: ~A~%" (-> this jgeo)) + (format #t "~Tmgeo: ~A~%" (-> this mgeo)) + (format #t "~Tdma-add-func: ~A~%" (-> this dma-add-func)) + (format #t "~Tskeleton: ~A~%" (-> this skeleton)) + (format #t "~Tlod-set: #~%" (-> this lod-set)) + (format #t "~Tlod[4] @ #x~X~%" (-> this lod-set)) + (format #t "~Tmax-lod: ~D~%" (-> this lod-set max-lod)) + (format #t "~Tforce-lod: ~D~%" (-> this force-lod)) + (format #t "~Tcur-lod: ~D~%" (-> this cur-lod)) + (format #t "~Tdesired-lod: ~D~%" (-> this desired-lod)) + (format #t "~Tripple: ~A~%" (-> this ripple)) + (format #t "~Tlongest-edge: (meters ~m)~%" (-> this longest-edge)) + (format #t "~Tlongest-edge?: ~D~%" (-> this longest-edge)) + (format #t "~Tlight-index: ~D~%" (-> this light-index)) + (format #t "~Tdummy[2] @ #x~X~%" (-> this dummy)) + (format #t "~Tdeath-draw-overlap: ~D~%" (-> this death-draw-overlap)) + (format #t "~Tdeath-timer: ~D~%" (-> this death-timer)) + (format #t "~Tdeath-timer-org: ~D~%" (-> this death-timer-org)) + (format #t "~Tdeath-vertex-skip: ~D~%" (-> this death-vertex-skip)) + (format #t "~Tdeath-effect: ~D~%" (-> this death-effect)) + (format #t "~Tsink-group: ~A~%" (-> this sink-group)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tshadow: ~A~%" (-> this shadow)) + (format #t "~Tshadow-ctrl: ~A~%" (-> this shadow-ctrl)) + (format #t "~Torigin: ~`vector`P~%" (-> this origin)) + (format #t "~Tbounds: ~`vector`P~%" (-> this bounds)) + (format #t "~Tradius: (meters ~m)~%" (-> this bounds w)) + (format #t "~Tcolor-mult: #~%" (-> this color-mult)) + (format #t "~Tcolor-emissive: #~%" (-> this color-emissive)) + (format #t "~Tsecondary-interp: ~f~%" (-> this secondary-interp)) + (format #t "~Tcurrent-secondary-interp: ~f~%" (-> this current-secondary-interp)) + (format #t "~Tshadow-mask: ~D~%" (-> this shadow-mask)) + (format #t "~Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~Torigin-joint-index: ~D~%" (-> this origin-joint-index)) + (format #t "~Tshadow-joint-index: ~D~%" (-> this shadow-joint-index)) + this ) ;; definition for method 9 of type draw-control -(defmethod get-skeleton-origin draw-control ((obj draw-control)) - (-> obj skeleton bones 0 transform vector 3) +(defmethod get-skeleton-origin draw-control ((this draw-control)) + (-> this skeleton bones 0 transform vector 3) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc index 4a0f4c3914..95931c5053 100644 --- a/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/anim-tester_REF.gc @@ -35,29 +35,29 @@ ) ;; definition for method 3 of type list-control -(defmethod inspect list-control ((obj list-control)) - (format #t "[~8x] ~A~%" obj 'list-control) - (format #t "~Tlistfunc: ~A~%" (-> obj listfunc)) - (format #t "~Tlist-owner: #x~X~%" (-> obj list-owner)) - (format #t "~Ttop: ~D~%" (-> obj top)) - (format #t "~Tleft: ~D~%" (-> obj left)) - (format #t "~Tlist: #~%" (-> obj list)) - (format #t "~Tthe-node: #~%" (-> obj the-node)) - (format #t "~Ttop-index: ~D~%" (-> obj top-index)) - (format #t "~Tthe-index: ~D~%" (-> obj the-index)) - (format #t "~Tthe-disp-line: ~D~%" (-> obj the-disp-line)) - (format #t "~Thighlight-index: ~D~%" (-> obj highlight-index)) - (format #t "~Tcurrent-index: ~D~%" (-> obj current-index)) - (format #t "~Tnumlines: ~D~%" (-> obj numlines)) - (format #t "~Tlines-to-disp: ~D~%" (-> obj lines-to-disp)) - (format #t "~Tcharswide: ~D~%" (-> obj charswide)) - (format #t "~Thighlight-disp-line: ~D~%" (-> obj highlight-disp-line)) - (format #t "~Tfield-id: ~D~%" (-> obj field-id)) - (format #t "~Txpos: ~D~%" (-> obj xpos)) - (format #t "~Typos: ~D~%" (-> obj ypos)) - (format #t "~Tuser-info: ~D~%" (-> obj user-info)) - (format #t "~Treturn-int: ~D~%" (-> obj return-int)) - obj +(defmethod inspect list-control ((this list-control)) + (format #t "[~8x] ~A~%" this 'list-control) + (format #t "~Tlistfunc: ~A~%" (-> this listfunc)) + (format #t "~Tlist-owner: #x~X~%" (-> this list-owner)) + (format #t "~Ttop: ~D~%" (-> this top)) + (format #t "~Tleft: ~D~%" (-> this left)) + (format #t "~Tlist: #~%" (-> this list)) + (format #t "~Tthe-node: #~%" (-> this the-node)) + (format #t "~Ttop-index: ~D~%" (-> this top-index)) + (format #t "~Tthe-index: ~D~%" (-> this the-index)) + (format #t "~Tthe-disp-line: ~D~%" (-> this the-disp-line)) + (format #t "~Thighlight-index: ~D~%" (-> this highlight-index)) + (format #t "~Tcurrent-index: ~D~%" (-> this current-index)) + (format #t "~Tnumlines: ~D~%" (-> this numlines)) + (format #t "~Tlines-to-disp: ~D~%" (-> this lines-to-disp)) + (format #t "~Tcharswide: ~D~%" (-> this charswide)) + (format #t "~Thighlight-disp-line: ~D~%" (-> this highlight-disp-line)) + (format #t "~Tfield-id: ~D~%" (-> this field-id)) + (format #t "~Txpos: ~D~%" (-> this xpos)) + (format #t "~Typos: ~D~%" (-> this ypos)) + (format #t "~Tuser-info: ~D~%" (-> this user-info)) + (format #t "~Treturn-int: ~D~%" (-> this return-int)) + this ) ;; definition of type list-field @@ -71,11 +71,11 @@ ) ;; definition for method 3 of type list-field -(defmethod inspect list-field ((obj list-field)) - (format #t "[~8x] ~A~%" obj 'list-field) - (format #t "~Tleft: ~D~%" (-> obj left)) - (format #t "~Twidth: ~D~%" (-> obj width)) - obj +(defmethod inspect list-field ((this list-field)) + (format #t "[~8x] ~A~%" this 'list-field) + (format #t "~Tleft: ~D~%" (-> this left)) + (format #t "~Twidth: ~D~%" (-> this width)) + this ) ;; definition of type DISP_LIST-bank @@ -98,20 +98,20 @@ ) ;; definition for method 3 of type DISP_LIST-bank -(defmethod inspect DISP_LIST-bank ((obj DISP_LIST-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~TV_SPACING: ~D~%" (-> obj TV_SPACING)) - (format #t "~TBORDER_WIDTH: ~D~%" (-> obj BORDER_WIDTH)) - (format #t "~TBORDER_HEIGHT: ~D~%" (-> obj BORDER_HEIGHT)) - (format #t "~TMAX_LINES: ~D~%" (-> obj MAX_LINES)) - (format #t "~TCHAR_WIDTH: ~D~%" (-> obj CHAR_WIDTH)) - (format #t "~TINC_DELAY: ~D~%" (-> obj INC_DELAY)) - (format #t "~TBORDER_LINES: ~D~%" (-> obj BORDER_LINES)) - (format #t "~TCXOFF: ~D~%" (-> obj CXOFF)) - (format #t "~TCYOFF: ~D~%" (-> obj CYOFF)) - (format #t "~TBXOFF: ~D~%" (-> obj BXOFF)) - (format #t "~TBYOFF: ~D~%" (-> obj BYOFF)) - obj +(defmethod inspect DISP_LIST-bank ((this DISP_LIST-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~TV_SPACING: ~D~%" (-> this TV_SPACING)) + (format #t "~TBORDER_WIDTH: ~D~%" (-> this BORDER_WIDTH)) + (format #t "~TBORDER_HEIGHT: ~D~%" (-> this BORDER_HEIGHT)) + (format #t "~TMAX_LINES: ~D~%" (-> this MAX_LINES)) + (format #t "~TCHAR_WIDTH: ~D~%" (-> this CHAR_WIDTH)) + (format #t "~TINC_DELAY: ~D~%" (-> this INC_DELAY)) + (format #t "~TBORDER_LINES: ~D~%" (-> this BORDER_LINES)) + (format #t "~TCXOFF: ~D~%" (-> this CXOFF)) + (format #t "~TCYOFF: ~D~%" (-> this CYOFF)) + (format #t "~TBXOFF: ~D~%" (-> this BXOFF)) + (format #t "~TBYOFF: ~D~%" (-> this BYOFF)) + this ) ;; definition for symbol *DISP_LIST-bank*, type DISP_LIST-bank @@ -407,25 +407,25 @@ ) ;; definition for method 3 of type anim-tester-bank -(defmethod inspect anim-tester-bank ((obj anim-tester-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~TANIM_SPEED: ~f~%" (-> obj ANIM_SPEED)) - (format #t "~TBLEND: ~f~%" (-> obj BLEND)) - (format #t "~TOBJECT_LIST_X: ~D~%" (-> obj OBJECT_LIST_X)) - (format #t "~TOBJECT_LIST_Y: ~D~%" (-> obj OBJECT_LIST_Y)) - (format #t "~TOBJECT_LIST_MIN_WIDTH: ~D~%" (-> obj OBJECT_LIST_MIN_WIDTH)) - (format #t "~TANIM_LIST_X: ~D~%" (-> obj ANIM_LIST_X)) - (format #t "~TANIM_LIST_Y: ~D~%" (-> obj ANIM_LIST_Y)) - (format #t "~TANIM_LIST_MIN_WIDTH: ~D~%" (-> obj ANIM_LIST_MIN_WIDTH)) - (format #t "~TPICK_LIST_X: ~D~%" (-> obj PICK_LIST_X)) - (format #t "~TPICK_LIST_Y: ~D~%" (-> obj PICK_LIST_Y)) - (format #t "~TPICK_LIST_MIN_WIDTH: ~D~%" (-> obj PICK_LIST_MIN_WIDTH)) - (format #t "~TEDIT_LIST_X: ~D~%" (-> obj EDIT_LIST_X)) - (format #t "~TEDIT_LIST_Y: ~D~%" (-> obj EDIT_LIST_Y)) - (format #t "~TEDIT_STATS_X: ~D~%" (-> obj EDIT_STATS_X)) - (format #t "~TEDIT_LIST_MIN_WIDTH: ~D~%" (-> obj EDIT_LIST_MIN_WIDTH)) - (format #t "~TEDIT_PICK_X: ~D~%" (-> obj EDIT_PICK_X)) - obj +(defmethod inspect anim-tester-bank ((this anim-tester-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~TANIM_SPEED: ~f~%" (-> this ANIM_SPEED)) + (format #t "~TBLEND: ~f~%" (-> this BLEND)) + (format #t "~TOBJECT_LIST_X: ~D~%" (-> this OBJECT_LIST_X)) + (format #t "~TOBJECT_LIST_Y: ~D~%" (-> this OBJECT_LIST_Y)) + (format #t "~TOBJECT_LIST_MIN_WIDTH: ~D~%" (-> this OBJECT_LIST_MIN_WIDTH)) + (format #t "~TANIM_LIST_X: ~D~%" (-> this ANIM_LIST_X)) + (format #t "~TANIM_LIST_Y: ~D~%" (-> this ANIM_LIST_Y)) + (format #t "~TANIM_LIST_MIN_WIDTH: ~D~%" (-> this ANIM_LIST_MIN_WIDTH)) + (format #t "~TPICK_LIST_X: ~D~%" (-> this PICK_LIST_X)) + (format #t "~TPICK_LIST_Y: ~D~%" (-> this PICK_LIST_Y)) + (format #t "~TPICK_LIST_MIN_WIDTH: ~D~%" (-> this PICK_LIST_MIN_WIDTH)) + (format #t "~TEDIT_LIST_X: ~D~%" (-> this EDIT_LIST_X)) + (format #t "~TEDIT_LIST_Y: ~D~%" (-> this EDIT_LIST_Y)) + (format #t "~TEDIT_STATS_X: ~D~%" (-> this EDIT_STATS_X)) + (format #t "~TEDIT_LIST_MIN_WIDTH: ~D~%" (-> this EDIT_LIST_MIN_WIDTH)) + (format #t "~TEDIT_PICK_X: ~D~%" (-> this EDIT_PICK_X)) + this ) ;; definition for symbol *ANIM_TESTER-bank*, type anim-tester-bank @@ -478,26 +478,26 @@ ;; definition for method 3 of type anim-tester ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect anim-tester ((obj anim-tester)) +(defmethod inspect anim-tester ((this anim-tester)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tflags: ~D~%" (-> obj flags)) - (format #t "~T~Tobj-list: #~%" (-> obj obj-list)) - (format #t "~T~Tcurrent-obj: ~A~%" (-> obj current-obj)) - (format #t "~T~Tspeed: ~D~%" (-> obj speed)) - (format #t "~T~Tlist-con: #~%" (-> obj list-con)) - (format #t "~T~Tpick-con: #~%" (-> obj pick-con)) - (format #t "~T~Titem-field: ~D~%" (-> obj item-field)) - (format #t "~T~Tinc-delay: ~D~%" (-> obj inc-delay)) - (format #t "~T~Tinc-timer: ~D~%" (-> obj inc-timer)) - (format #t "~T~Tedit-mode: ~D~%" (-> obj edit-mode)) - (format #t "~T~Told-mode: ~D~%" (-> obj old-mode)) - (format #t "~T~Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~T~Tanim-gspeed: ~f~%" (-> obj anim-gspeed)) - (format #t "~T~Tanim-first: ~f~%" (-> obj anim-first)) - (format #t "~T~Tanim-last: ~f~%" (-> obj anim-last)) - obj + (format #t "~T~Tflags: ~D~%" (-> this flags)) + (format #t "~T~Tobj-list: #~%" (-> this obj-list)) + (format #t "~T~Tcurrent-obj: ~A~%" (-> this current-obj)) + (format #t "~T~Tspeed: ~D~%" (-> this speed)) + (format #t "~T~Tlist-con: #~%" (-> this list-con)) + (format #t "~T~Tpick-con: #~%" (-> this pick-con)) + (format #t "~T~Titem-field: ~D~%" (-> this item-field)) + (format #t "~T~Tinc-delay: ~D~%" (-> this inc-delay)) + (format #t "~T~Tinc-timer: ~D~%" (-> this inc-timer)) + (format #t "~T~Tedit-mode: ~D~%" (-> this edit-mode)) + (format #t "~T~Told-mode: ~D~%" (-> this old-mode)) + (format #t "~T~Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~T~Tanim-gspeed: ~f~%" (-> this anim-gspeed)) + (format #t "~T~Tanim-first: ~f~%" (-> this anim-first)) + (format #t "~T~Tanim-last: ~f~%" (-> this anim-last)) + this ) ;; definition for function anim-tester-num-print @@ -543,23 +543,23 @@ ) ;; definition for method 3 of type anim-test-obj -(defmethod inspect anim-test-obj ((obj anim-test-obj)) - (format #t "[~8x] ~A~%" obj 'anim-test-obj) - (format #t "~Tnext: #~%" (-> obj next)) - (format #t "~Tprev: #~%" (-> obj prev)) - (format #t "~Tprivname: ~A~%" (-> obj privname)) - (format #t "~Tobj-art-group: ~A~%" (-> obj obj-art-group)) - (format #t "~Tseq-list: #~%" (-> obj seq-list)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tmesh-geo: ~A~%" (-> obj mesh-geo)) - (format #t "~Tjoint-geo: ~A~%" (-> obj joint-geo)) - (format #t "~Tlist-con: #~%" (-> obj list-con)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tanim-index: ~D~%" (-> obj anim-index)) - (format #t "~Tanim-hindex: ~D~%" (-> obj anim-hindex)) - (format #t "~Tseq-index: ~D~%" (-> obj seq-index)) - (format #t "~Tseq-hindex: ~D~%" (-> obj seq-hindex)) - obj +(defmethod inspect anim-test-obj ((this anim-test-obj)) + (format #t "[~8x] ~A~%" this 'anim-test-obj) + (format #t "~Tnext: #~%" (-> this next)) + (format #t "~Tprev: #~%" (-> this prev)) + (format #t "~Tprivname: ~A~%" (-> this privname)) + (format #t "~Tobj-art-group: ~A~%" (-> this obj-art-group)) + (format #t "~Tseq-list: #~%" (-> this seq-list)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tmesh-geo: ~A~%" (-> this mesh-geo)) + (format #t "~Tjoint-geo: ~A~%" (-> this joint-geo)) + (format #t "~Tlist-con: #~%" (-> this list-con)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~Tanim-hindex: ~D~%" (-> this anim-hindex)) + (format #t "~Tseq-index: ~D~%" (-> this seq-index)) + (format #t "~Tseq-hindex: ~D~%" (-> this seq-hindex)) + this ) ;; definition for function anim-test-obj-init @@ -614,17 +614,17 @@ ) ;; definition for method 3 of type anim-test-sequence -(defmethod inspect anim-test-sequence ((obj anim-test-sequence)) - (format #t "[~8x] ~A~%" obj 'anim-test-sequence) - (format #t "~Tnext: #~%" (-> obj next)) - (format #t "~Tprev: #~%" (-> obj prev)) - (format #t "~Tprivname: ~A~%" (-> obj privname)) - (format #t "~Titem-list: #~%" (-> obj item-list)) - (format #t "~Tplaying-item: ~D~%" (-> obj playing-item)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tlist-con: #~%" (-> obj list-con)) - (format #t "~Tparent: #~%" (-> obj parent)) - obj +(defmethod inspect anim-test-sequence ((this anim-test-sequence)) + (format #t "[~8x] ~A~%" this 'anim-test-sequence) + (format #t "~Tnext: #~%" (-> this next)) + (format #t "~Tprev: #~%" (-> this prev)) + (format #t "~Tprivname: ~A~%" (-> this privname)) + (format #t "~Titem-list: #~%" (-> this item-list)) + (format #t "~Tplaying-item: ~D~%" (-> this playing-item)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tlist-con: #~%" (-> this list-con)) + (format #t "~Tparent: #~%" (-> this parent)) + this ) ;; definition for function anim-test-sequence-init @@ -673,20 +673,20 @@ ) ;; definition for method 3 of type anim-test-seq-item -(defmethod inspect anim-test-seq-item ((obj anim-test-seq-item)) - (format #t "[~8x] ~A~%" obj 'anim-test-seq-item) - (format #t "~Tnext: #~%" (-> obj next)) - (format #t "~Tprev: #~%" (-> obj prev)) - (format #t "~Tprivname: ~A~%" (-> obj privname)) - (format #t "~Tspeed: ~D~%" (-> obj speed)) - (format #t "~Tblend: ~D~%" (-> obj blend)) - (format #t "~Tfirst-frame: ~f~%" (-> obj first-frame)) - (format #t "~Tlast-frame: ~f~%" (-> obj last-frame)) - (format #t "~Tnum-frames: ~f~%" (-> obj num-frames)) - (format #t "~Tartist-base: ~f~%" (-> obj artist-base)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tparent: #~%" (-> obj parent)) - obj +(defmethod inspect anim-test-seq-item ((this anim-test-seq-item)) + (format #t "[~8x] ~A~%" this 'anim-test-seq-item) + (format #t "~Tnext: #~%" (-> this next)) + (format #t "~Tprev: #~%" (-> this prev)) + (format #t "~Tprivname: ~A~%" (-> this privname)) + (format #t "~Tspeed: ~D~%" (-> this speed)) + (format #t "~Tblend: ~D~%" (-> this blend)) + (format #t "~Tfirst-frame: ~f~%" (-> this first-frame)) + (format #t "~Tlast-frame: ~f~%" (-> this last-frame)) + (format #t "~Tnum-frames: ~f~%" (-> this num-frames)) + (format #t "~Tartist-base: ~f~%" (-> this artist-base)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tparent: #~%" (-> this parent)) + this ) ;; definition for method 0 of type anim-test-seq-item @@ -728,9 +728,9 @@ ;; definition for method 3 of type anim-tester ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch object vs anim-tester. -(defmethod inspect anim-tester ((obj anim-tester)) +(defmethod inspect anim-tester ((this anim-tester)) (format #t "--anim-tester--~%") - (let ((v1-0 (-> obj obj-list))) + (let ((v1-0 (-> this obj-list))) "return the start of the list" (let ((s5-0 (the-as anim-test-obj (-> v1-0 head)))) (while (let ((v1-36 s5-0)) @@ -811,15 +811,17 @@ ) ) (format #t "-------------~%") - (format #t "current-obj=~A~%" (-> obj current-obj)) - (format #t "speed=~f~%" (* 0.01 (the float (-> obj speed)))) + (format #t "current-obj=~A~%" (-> this current-obj)) + (format #t "speed=~f~%" (* 0.01 (the float (-> this speed)))) (format #t "--flags:--~%") - (the-as anim-tester (format #t " CONNECTED: ~A~%" (if (logtest? (-> obj flags) (anim-tester-flags fanimt0)) - "TRUE" - "f" - ) - ) - ) + (the-as + anim-tester + (format #t " CONNECTED: ~A~%" (if (logtest? (-> this flags) (anim-tester-flags fanimt0)) + "TRUE" + "f" + ) + ) + ) ) ;; definition for function anim-test-obj-item-valid? diff --git a/test/decompiler/reference/jak1/engine/debug/assert-h_REF.gc b/test/decompiler/reference/jak1/engine/debug/assert-h_REF.gc index d63c719695..2386f305b5 100644 --- a/test/decompiler/reference/jak1/engine/debug/assert-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/assert-h_REF.gc @@ -17,25 +17,25 @@ ) ;; definition for method 3 of type __assert-info-private-struct -(defmethod inspect __assert-info-private-struct ((obj __assert-info-private-struct)) - (format #t "[~8x] ~A~%" obj '__assert-info-private-struct) - (format #t "~Tfilename: ~A~%" (-> obj filename)) - (format #t "~Tline-num: ~D~%" (-> obj line-num)) - (format #t "~Tcolumn-num: ~D~%" (-> obj column-num)) - obj +(defmethod inspect __assert-info-private-struct ((this __assert-info-private-struct)) + (format #t "[~8x] ~A~%" this '__assert-info-private-struct) + (format #t "~Tfilename: ~A~%" (-> this filename)) + (format #t "~Tline-num: ~D~%" (-> this line-num)) + (format #t "~Tcolumn-num: ~D~%" (-> this column-num)) + this ) ;; definition for method 9 of type __assert-info-private-struct -(defmethod set-pos __assert-info-private-struct ((obj __assert-info-private-struct) (filename string) (line-num uint) (column-num uint)) - (set! (-> obj filename) filename) - (set! (-> obj line-num) line-num) - (set! (-> obj column-num) column-num) +(defmethod set-pos __assert-info-private-struct ((this __assert-info-private-struct) (filename string) (line-num uint) (column-num uint)) + (set! (-> this filename) filename) + (set! (-> this line-num) line-num) + (set! (-> this column-num) column-num) 0 ) ;; definition for method 10 of type __assert-info-private-struct -(defmethod print-pos __assert-info-private-struct ((obj __assert-info-private-struct)) - (format #t "file ~S.gc, line ~D, col ~D.~%" (-> obj filename) (-> obj line-num) (-> obj column-num)) +(defmethod print-pos __assert-info-private-struct ((this __assert-info-private-struct)) + (format #t "file ~S.gc, line ~D, col ~D.~%" (-> this filename) (-> this line-num) (-> this column-num)) 0 ) diff --git a/test/decompiler/reference/jak1/engine/debug/debug-h_REF.gc b/test/decompiler/reference/jak1/engine/debug/debug-h_REF.gc index 2f72be3c8e..74beb53191 100644 --- a/test/decompiler/reference/jak1/engine/debug/debug-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/debug-h_REF.gc @@ -14,13 +14,13 @@ ) ;; definition for method 3 of type pos-history -(defmethod inspect pos-history ((obj pos-history)) - (format #t "[~8x] ~A~%" obj 'pos-history) - (format #t "~Tpoints: #x~X~%" (-> obj points)) - (format #t "~Tnum-points: ~D~%" (-> obj num-points)) - (format #t "~Th-first: ~D~%" (-> obj h-first)) - (format #t "~Th-last: ~D~%" (-> obj h-last)) - obj +(defmethod inspect pos-history ((this pos-history)) + (format #t "[~8x] ~A~%" this 'pos-history) + (format #t "~Tpoints: #x~X~%" (-> this points)) + (format #t "~Tnum-points: ~D~%" (-> this num-points)) + (format #t "~Th-first: ~D~%" (-> this h-first)) + (format #t "~Th-last: ~D~%" (-> this h-last)) + this ) ;; definition of type debug-vertex @@ -36,13 +36,13 @@ ) ;; definition for method 3 of type debug-vertex -(defmethod inspect debug-vertex ((obj debug-vertex)) - (format #t "[~8x] ~A~%" obj 'debug-vertex) - (format #t "~Ttrans: ~`vector4w`P~%" (-> obj trans)) - (format #t "~Tnormal: ~`vector3h`P~%" (-> obj normal)) - (format #t "~Tst: ~`vector2h`P~%" (-> obj st)) - (format #t "~Tcolor: #x~X~%" (-> obj color)) - obj +(defmethod inspect debug-vertex ((this debug-vertex)) + (format #t "[~8x] ~A~%" this 'debug-vertex) + (format #t "~Ttrans: ~`vector4w`P~%" (-> this trans)) + (format #t "~Tnormal: ~`vector3h`P~%" (-> this normal)) + (format #t "~Tst: ~`vector2h`P~%" (-> this st)) + (format #t "~Tcolor: #x~X~%" (-> this color)) + this ) ;; definition of type debug-vertex-stats @@ -57,13 +57,12 @@ ) ;; definition for method 3 of type debug-vertex-stats -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect debug-vertex-stats ((obj debug-vertex-stats)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tpos-count: ~D~%" (-> obj pos-count)) - (format #t "~Tvertex[600] @ #x~X~%" (-> obj vertex)) - obj +(defmethod inspect debug-vertex-stats ((this debug-vertex-stats)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tpos-count: ~D~%" (-> this pos-count)) + (format #t "~Tvertex[600] @ #x~X~%" (-> this vertex)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/debug/debug-sphere_REF.gc b/test/decompiler/reference/jak1/engine/debug/debug-sphere_REF.gc index f3aea6a1f5..ee25e0ce36 100644 --- a/test/decompiler/reference/jak1/engine/debug/debug-sphere_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/debug-sphere_REF.gc @@ -11,10 +11,10 @@ ) ;; definition for method 3 of type debug-sphere-table -(defmethod inspect debug-sphere-table ((obj debug-sphere-table)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tpoint[300] @ #x~X~%" (-> obj point)) - obj +(defmethod inspect debug-sphere-table ((this debug-sphere-table)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tpoint[300] @ #x~X~%" (-> this point)) + this ) ;; definition for function make-debug-sphere-table diff --git a/test/decompiler/reference/jak1/engine/debug/debug_REF.gc b/test/decompiler/reference/jak1/engine/debug/debug_REF.gc index 9028d29d82..f809c08bf5 100644 --- a/test/decompiler/reference/jak1/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/debug_REF.gc @@ -497,16 +497,16 @@ ) ;; definition for method 3 of type debug-line -(defmethod inspect debug-line ((obj debug-line)) - (format #t "[~8x] ~A~%" obj 'debug-line) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tbucket: ~D~%" (-> obj bucket)) - (format #t "~Tv1: #~%" (-> obj v1)) - (format #t "~Tv2: #~%" (-> obj v2)) - (format #t "~Tcolor: ~D~%" (-> obj color)) - (format #t "~Tmode: ~A~%" (-> obj mode)) - (format #t "~Tcolor2: ~D~%" (-> obj color2)) - obj +(defmethod inspect debug-line ((this debug-line)) + (format #t "[~8x] ~A~%" this 'debug-line) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tbucket: ~D~%" (-> this bucket)) + (format #t "~Tv1: #~%" (-> this v1)) + (format #t "~Tv2: #~%" (-> this v2)) + (format #t "~Tcolor: ~D~%" (-> this color)) + (format #t "~Tmode: ~A~%" (-> this mode)) + (format #t "~Tcolor2: ~D~%" (-> this color2)) + this ) ;; definition of type debug-text-3d @@ -524,15 +524,15 @@ ) ;; definition for method 3 of type debug-text-3d -(defmethod inspect debug-text-3d ((obj debug-text-3d)) - (format #t "[~8x] ~A~%" obj 'debug-text-3d) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tbucket: ~D~%" (-> obj bucket)) - (format #t "~Tpos: #~%" (-> obj pos)) - (format #t "~Tcolor: ~D~%" (-> obj color)) - (format #t "~Toffset: #~%" (-> obj offset)) - (format #t "~Tstr: ~A~%" (-> obj str)) - obj +(defmethod inspect debug-text-3d ((this debug-text-3d)) + (format #t "[~8x] ~A~%" this 'debug-text-3d) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tbucket: ~D~%" (-> this bucket)) + (format #t "~Tpos: #~%" (-> this pos)) + (format #t "~Tcolor: ~D~%" (-> this color)) + (format #t "~Toffset: #~%" (-> this offset)) + (format #t "~Tstr: ~A~%" (-> this str)) + this ) ;; definition of type debug-tracking-thang @@ -546,11 +546,11 @@ ) ;; definition for method 3 of type debug-tracking-thang -(defmethod inspect debug-tracking-thang ((obj debug-tracking-thang)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - obj +(defmethod inspect debug-tracking-thang ((this debug-tracking-thang)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + this ) ;; definition for symbol *debug-lines*, type (inline-array debug-line) @@ -1345,14 +1345,13 @@ ) ;; definition for method 3 of type debug-vertex-stats -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect debug-vertex-stats ((obj debug-vertex-stats)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tpos-count: ~D~%" (-> obj pos-count)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj vertex)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj vertex s5-0))) +(defmethod inspect debug-vertex-stats ((this debug-vertex-stats)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tpos-count: ~D~%" (-> this pos-count)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this vertex)) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this vertex s5-0))) (format #t " ~D : trans: ~D ~D ~D ~D" @@ -1373,7 +1372,7 @@ ) ) ) - obj + this ) ;; definition (debug) for function history-init diff --git a/test/decompiler/reference/jak1/engine/debug/memory-usage-h_REF.gc b/test/decompiler/reference/jak1/engine/debug/memory-usage-h_REF.gc index 04384a58c0..2a6d6c6870 100644 --- a/test/decompiler/reference/jak1/engine/debug/memory-usage-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/memory-usage-h_REF.gc @@ -17,13 +17,13 @@ ) ;; definition for method 3 of type memory-usage-info -(defmethod inspect memory-usage-info ((obj memory-usage-info)) - (format #t "[~8x] ~A~%" obj 'memory-usage-info) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tcount: ~D~%" (-> obj count)) - (format #t "~Tused: ~D~%" (-> obj used)) - (format #t "~Ttotal: ~D~%" (-> obj total)) - obj +(defmethod inspect memory-usage-info ((this memory-usage-info)) + (format #t "[~8x] ~A~%" this 'memory-usage-info) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tcount: ~D~%" (-> this count)) + (format #t "~Tused: ~D~%" (-> this used)) + (format #t "~Ttotal: ~D~%" (-> this total)) + this ) ;; definition of type memory-usage-block @@ -43,13 +43,12 @@ ) ;; definition for method 3 of type memory-usage-block -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect memory-usage-block ((obj memory-usage-block)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Twork-bsp: ~A~%" (-> obj work-bsp)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[109] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect memory-usage-block ((this memory-usage-block)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Twork-bsp: ~A~%" (-> this work-bsp)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[109] @ #x~X~%" (-> this data)) + this ) ;; definition for symbol *mem-usage*, type memory-usage-block diff --git a/test/decompiler/reference/jak1/engine/debug/memory-usage_REF.gc b/test/decompiler/reference/jak1/engine/debug/memory-usage_REF.gc index be1d2893cc..13efb33290 100644 --- a/test/decompiler/reference/jak1/engine/debug/memory-usage_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/memory-usage_REF.gc @@ -5,16 +5,15 @@ (declare-file (debug)) ;; definition for method 3 of type memory-usage-block -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect memory-usage-block ((obj memory-usage-block)) +(defmethod inspect memory-usage-block ((this memory-usage-block)) (format #t "-------------------------------------------------------------~%") (format #t " # name count bytes used aligned bytes~%") (format #t "-------------------------------------------------------------~%") (let ((s5-0 0) (s4-0 0) ) - (dotimes (s3-0 (-> obj length)) - (let ((v1-2 (-> obj data s3-0))) + (dotimes (s3-0 (-> this length)) + (let ((v1-2 (-> this data s3-0))) (+! s5-0 (-> v1-2 used)) (+! s4-0 (-> v1-2 total)) (format @@ -31,36 +30,36 @@ (format #t "total: ~8D ~8D~%" s5-0 s4-0) ) (format #t "-------------------------------------------------------------~%") - obj + this ) ;; definition for method 8 of type object -(defmethod mem-usage object ((obj object) (arg0 memory-usage-block) (arg1 int)) - (if obj - (format #t "WARNING: mem-usage called on object, probably not what was wanted for ~A~%" obj) +(defmethod mem-usage object ((this object) (arg0 memory-usage-block) (arg1 int)) + (if this + (format #t "WARNING: mem-usage called on object, probably not what was wanted for ~A~%" this) ) - obj + this ) ;; definition for method 10 of type memory-usage-block -(defmethod calculate-total memory-usage-block ((obj memory-usage-block)) +(defmethod calculate-total memory-usage-block ((this memory-usage-block)) (let ((v0-0 0)) - (dotimes (v1-0 (-> obj length)) - (+! v0-0 (-> obj data v1-0 total)) + (dotimes (v1-0 (-> this length)) + (+! v0-0 (-> this data v1-0 total)) ) v0-0 ) ) ;; definition for method 9 of type memory-usage-block -(defmethod reset! memory-usage-block ((obj memory-usage-block)) - (set! (-> obj length) 0) +(defmethod reset! memory-usage-block ((this memory-usage-block)) + (set! (-> this length) 0) (dotimes (v1-0 109) - (set! (-> obj data v1-0 used) 0) - (set! (-> obj data v1-0 total) 0) - (set! (-> obj data v1-0 count) 0) + (set! (-> this data v1-0 used) 0) + (set! (-> this data v1-0 total) 0) + (set! (-> this data v1-0 count) 0) ) - obj + this ) ;; definition for function mem-size @@ -75,20 +74,20 @@ ) ;; definition for method 14 of type level -(defmethod compute-memory-usage level ((obj level) (arg0 object)) - (if (zero? (-> obj mem-usage-block)) - (set! (-> obj mem-usage-block) (new 'debug 'memory-usage-block)) +(defmethod compute-memory-usage level ((this level) (arg0 object)) + (if (zero? (-> this mem-usage-block)) + (set! (-> this mem-usage-block) (new 'debug 'memory-usage-block)) ) - (set! arg0 (or (zero? (-> obj mem-usage-block length)) arg0)) + (set! arg0 (or (zero? (-> this mem-usage-block length)) arg0)) (when arg0 - (mem-usage obj (reset! (-> obj mem-usage-block)) 0) - (set! (-> obj mem-usage) (calculate-total (-> obj mem-usage-block))) + (mem-usage this (reset! (-> this mem-usage-block)) 0) + (set! (-> this mem-usage) (calculate-total (-> this mem-usage-block))) ) - (-> obj mem-usage-block) + (-> this mem-usage-block) ) ;; definition for method 8 of type process-tree -(defmethod mem-usage process-tree ((obj process-tree) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage process-tree ((this process-tree) (arg0 memory-usage-block) (arg1 int)) (let ((v1-0 87)) (let* ((a0-1 *dead-pool-list*) (a3-0 (car a0-1)) @@ -133,7 +132,7 @@ ) ) (iterate-process-tree - obj + this (lambda ((arg0 process)) (let ((gp-0 *temp-mem-usage*)) (let ((s4-0 (cond @@ -296,7 +295,7 @@ ) *null-kernel-context* ) - obj + this ) ;; definition for symbol *max-dma*, type int @@ -305,10 +304,10 @@ ;; definition for method 11 of type memory-usage-block ;; INFO: Used lq/sq ;; INFO: Return type mismatch memory-usage-block vs none. -(defmethod print-mem-usage memory-usage-block ((obj memory-usage-block) (arg0 level) (arg1 object)) +(defmethod print-mem-usage memory-usage-block ((this memory-usage-block) (arg0 level) (arg1 object)) (local-vars (sv-16 object) (sv-32 string) (sv-48 symbol) (sv-64 int) (sv-80 int)) (let ((s3-0 (&- (-> arg0 heap current) (the-as uint (-> arg0 heap base))))) - (let ((v1-2 (+ (-> obj data 59 total) (-> obj data 60 total)))) + (let ((v1-2 (+ (-> this data 59 total) (-> this data 60 total)))) (< #x10000 v1-2) ) (let ((s2-0 #xa1a333) @@ -360,7 +359,7 @@ (format arg1 " bsp ~192H~5DK ~280Hdebug~456H~5DK~%" - (sar (+ (-> obj data 56 total) (-> obj data 57 total) (-> obj data 58 total)) 10) + (sar (+ (-> this data 56 total) (-> this data 57 total) (-> this data 58 total)) 10) (sar (-> *dma-mem-usage* data 84 total) 10) ) (format @@ -374,20 +373,20 @@ 10 ) ) - (format arg1 " bsp-leaf-vis-adj ~192H~5DK~%" (sar (+ (-> obj data 59 total) (-> obj data 60 total)) 10)) - (format arg1 " level-code ~192H~5DK~%" (sar (-> obj data 63 total) 10)) + (format arg1 " bsp-leaf-vis-adj ~192H~5DK~%" (sar (+ (-> this data 59 total) (-> this data 60 total)) 10)) + (format arg1 " level-code ~192H~5DK~%" (sar (-> this data 63 total) 10)) (format arg1 " tfrag ~192H~5DK ~280Htfragment~456H~5DK~%" (sar - (+ (-> obj data 1 total) - (-> obj data 2 total) - (-> obj data 3 total) - (-> obj data 4 total) - (-> obj data 5 total) - (-> obj data 6 total) - (-> obj data 7 total) - (-> obj data 8 total) + (+ (-> this data 1 total) + (-> this data 2 total) + (-> this data 3 total) + (-> this data 4 total) + (-> this data 5 total) + (-> this data 6 total) + (-> this data 7 total) + (-> this data 8 total) ) 10 ) @@ -397,14 +396,14 @@ arg1 " tie-proto ~192H~5DK ~280Hsky~456H~5DK~%" (sar - (+ (-> obj data 9 total) - (-> obj data 10 total) - (-> obj data 11 total) - (-> obj data 12 total) - (-> obj data 13 total) - (-> obj data 14 total) - (-> obj data 16 total) - (-> obj data 17 total) + (+ (-> this data 9 total) + (-> this data 10 total) + (-> this data 11 total) + (-> this data 12 total) + (-> this data 13 total) + (-> this data 14 total) + (-> this data 16 total) + (-> this data 17 total) ) 10 ) @@ -413,22 +412,22 @@ (format arg1 " tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%" - (sar (+ (-> obj data 18 total) (-> obj data 20 total) (-> obj data 21 total) (-> obj data 22 total)) 10) + (sar (+ (-> this data 18 total) (-> this data 20 total) (-> this data 21 total) (-> this data 22 total)) 10) (sar (-> *dma-mem-usage* data 9 total) 10) ) (format arg1 " shrub-proto ~192H~5DK ~280Htie-near~456H~5DK~%" (sar - (+ (-> obj data 25 total) - (-> obj data 26 total) - (-> obj data 27 total) - (-> obj data 28 total) - (-> obj data 29 total) - (-> obj data 30 total) - (-> obj data 31 total) - (-> obj data 32 total) - (-> obj data 33 total) + (+ (-> this data 25 total) + (-> this data 26 total) + (-> this data 27 total) + (-> this data 28 total) + (-> this data 29 total) + (-> this data 30 total) + (-> this data 31 total) + (-> this data 32 total) + (-> this data 33 total) ) 10 ) @@ -437,19 +436,19 @@ (format arg1 " shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%" - (sar (-> obj data 34 total) 10) + (sar (-> this data 34 total) 10) (sar (-> *dma-mem-usage* data 27 total) 10) ) (format arg1 " collision ~192H~5DK ~280Htie-generic~456H~5DK~%" (sar - (+ (-> obj data 50 total) - (-> obj data 51 total) - (-> obj data 52 total) - (-> obj data 53 total) - (-> obj data 54 total) - (-> obj data 55 total) + (+ (-> this data 50 total) + (-> this data 51 total) + (-> this data 52 total) + (-> this data 53 total) + (-> this data 54 total) + (-> this data 55 total) ) 10 ) @@ -459,22 +458,22 @@ arg1 " pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%" (sar - (+ (-> obj data 35 total) - (-> obj data 36 total) - (-> obj data 37 total) - (-> obj data 38 total) - (-> obj data 39 total) - (-> obj data 40 total) - (-> obj data 41 total) - (-> obj data 42 total) - (-> obj data 70 total) - (-> obj data 71 total) - (-> obj data 72 total) - (-> obj data 73 total) - (-> obj data 75 total) - (-> obj data 78 total) - (-> obj data 77 total) - (-> obj data 108 total) + (+ (-> this data 35 total) + (-> this data 36 total) + (-> this data 37 total) + (-> this data 38 total) + (-> this data 39 total) + (-> this data 40 total) + (-> this data 41 total) + (-> this data 42 total) + (-> this data 70 total) + (-> this data 71 total) + (-> this data 72 total) + (-> this data 73 total) + (-> this data 75 total) + (-> this data 78 total) + (-> this data 77 total) + (-> this data 108 total) ) 10 ) @@ -484,13 +483,13 @@ arg1 " pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%" (sar - (+ (-> obj data 65 total) - (-> obj data 66 total) - (-> obj data 67 total) - (-> obj data 68 total) - (-> obj data 69 total) - (-> obj data 74 total) - (-> obj data 76 total) + (+ (-> this data 65 total) + (-> this data 66 total) + (-> this data 67 total) + (-> this data 68 total) + (-> this data 69 total) + (-> this data 74 total) + (-> this data 76 total) ) 10 ) @@ -499,18 +498,18 @@ (format arg1 " textures ~192H~5DK ~280Htextures~456H~5DK~%" - (sar (-> obj data 79 total) 10) + (sar (-> this data 79 total) 10) (sar (-> *dma-mem-usage* data 79 total) 10) ) (format arg1 " entity ~192H~5DK~%" (sar - (+ (-> obj data 64 total) - (-> obj data 43 total) - (-> obj data 44 total) - (-> obj data 45 total) - (-> obj data 49 total) - (-> obj data 48 total) - (-> obj data 46 total) - (-> obj data 47 total) + (+ (-> this data 64 total) + (-> this data 43 total) + (-> this data 44 total) + (-> this data 45 total) + (-> this data 49 total) + (-> this data 48 total) + (-> this data 46 total) + (-> this data 47 total) ) 10 ) @@ -519,11 +518,11 @@ arg1 " misc ~192H~5DK ~280Hsprite~456H~5DK~%" (sar - (+ (-> obj data 0 total) - (-> obj data 61 total) - (-> obj data 62 total) - (-> obj data 80 total) - (-> obj data 81 total) + (+ (-> this data 0 total) + (-> this data 61 total) + (-> this data 62 total) + (-> this data 80 total) + (-> this data 81 total) ) 10 ) diff --git a/test/decompiler/reference/jak1/engine/debug/menu_REF.gc b/test/decompiler/reference/jak1/engine/debug/menu_REF.gc index d1bb19d057..b493cf1b64 100644 --- a/test/decompiler/reference/jak1/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/menu_REF.gc @@ -24,17 +24,17 @@ ) ;; definition for method 3 of type debug-menu-context -(defmethod inspect debug-menu-context ((obj debug-menu-context)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tis-active: ~A~%" (-> obj is-active)) - (format #t "~Tsel-length: ~D~%" (-> obj sel-length)) - (format #t "~Tsel-menu[8] @ #x~X~%" (-> obj sel-menu)) - (format #t "~Troot-menu: ~A~%" (-> obj root-menu)) - (format #t "~Tjoypad-func: ~A~%" (-> obj joypad-func)) - (format #t "~Tjoypad-item: ~A~%" (-> obj joypad-item)) - (format #t "~Tfont: ~A~%" (-> obj font)) - (format #t "~Tis-hidden: ~A~%" (-> obj is-hidden)) - obj +(defmethod inspect debug-menu-context ((this debug-menu-context)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tis-active: ~A~%" (-> this is-active)) + (format #t "~Tsel-length: ~D~%" (-> this sel-length)) + (format #t "~Tsel-menu[8] @ #x~X~%" (-> this sel-menu)) + (format #t "~Troot-menu: ~A~%" (-> this root-menu)) + (format #t "~Tjoypad-func: ~A~%" (-> this joypad-func)) + (format #t "~Tjoypad-item: ~A~%" (-> this joypad-item)) + (format #t "~Tfont: ~A~%" (-> this font)) + (format #t "~Tis-hidden: ~A~%" (-> this is-hidden)) + this ) ;; definition for method 0 of type debug-menu-context @@ -66,19 +66,19 @@ ) ;; definition for method 3 of type debug-menu-node -(defmethod inspect debug-menu-node ((obj debug-menu-node)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tparent: ~A~%" (-> obj parent)) - (format #t "~Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - obj +(defmethod inspect debug-menu-node ((this debug-menu-node)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tparent: ~A~%" (-> this parent)) + (format #t "~Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + this ) ;; definition for method 2 of type debug-menu-node -(defmethod print debug-menu-node ((obj debug-menu-node)) - (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print debug-menu-node ((this debug-menu-node)) + (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) + this ) ;; definition of type debug-menu @@ -98,18 +98,18 @@ ) ;; definition for method 3 of type debug-menu -(defmethod inspect debug-menu ((obj debug-menu)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tparent: ~A~%" (-> obj parent)) - (format #t "~Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~Tcontext: ~A~%" (-> obj context)) - (format #t "~Tselected-item: ~A~%" (-> obj selected-item)) - (format #t "~Tpix-width: ~D~%" (-> obj pix-width)) - (format #t "~Tpix-height: ~D~%" (-> obj pix-height)) - (format #t "~Titems: ~A~%" (-> obj items)) - obj +(defmethod inspect debug-menu ((this debug-menu)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tparent: ~A~%" (-> this parent)) + (format #t "~Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~Tcontext: ~A~%" (-> this context)) + (format #t "~Tselected-item: ~A~%" (-> this selected-item)) + (format #t "~Tpix-width: ~D~%" (-> this pix-width)) + (format #t "~Tpix-height: ~D~%" (-> this pix-height)) + (format #t "~Titems: ~A~%" (-> this items)) + this ) ;; definition for method 0 of type debug-menu @@ -134,14 +134,14 @@ ) ;; definition for method 3 of type debug-menu-item -(defmethod inspect debug-menu-item ((obj debug-menu-item)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tparent: ~A~%" (-> obj parent)) - (format #t "~Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~Tid: #x~X~%" (-> obj id)) - obj +(defmethod inspect debug-menu-item ((this debug-menu-item)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tparent: ~A~%" (-> this parent)) + (format #t "~Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~Tid: #x~X~%" (-> this id)) + this ) ;; definition of type debug-menu-item-submenu @@ -157,15 +157,15 @@ ) ;; definition for method 3 of type debug-menu-item-submenu -(defmethod inspect debug-menu-item-submenu ((obj debug-menu-item-submenu)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tparent: ~A~%" (-> obj parent)) - (format #t "~Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~Tid: #x~X~%" (-> obj id)) - (format #t "~Tsubmenu: ~A~%" (-> obj submenu)) - obj +(defmethod inspect debug-menu-item-submenu ((this debug-menu-item-submenu)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tparent: ~A~%" (-> this parent)) + (format #t "~Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~Tid: #x~X~%" (-> this id)) + (format #t "~Tsubmenu: ~A~%" (-> this submenu)) + this ) ;; definition for method 0 of type debug-menu-item-submenu @@ -195,16 +195,16 @@ ) ;; definition for method 3 of type debug-menu-item-function -(defmethod inspect debug-menu-item-function ((obj debug-menu-item-function)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tparent: ~A~%" (-> obj parent)) - (format #t "~Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~Tid: #x~X~%" (-> obj id)) - (format #t "~Tactivate-func: ~A~%" (-> obj activate-func)) - (format #t "~Thilite-timer: ~D~%" (-> obj hilite-timer)) - obj +(defmethod inspect debug-menu-item-function ((this debug-menu-item-function)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tparent: ~A~%" (-> this parent)) + (format #t "~Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~Tid: #x~X~%" (-> this id)) + (format #t "~Tactivate-func: ~A~%" (-> this activate-func)) + (format #t "~Thilite-timer: ~D~%" (-> this hilite-timer)) + this ) ;; definition for method 0 of type debug-menu-item-function @@ -235,16 +235,16 @@ ) ;; definition for method 3 of type debug-menu-item-flag -(defmethod inspect debug-menu-item-flag ((obj debug-menu-item-flag)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tparent: ~A~%" (-> obj parent)) - (format #t "~Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~Tid: #x~X~%" (-> obj id)) - (format #t "~Tactivate-func: ~A~%" (-> obj activate-func)) - (format #t "~Tis-on: ~A~%" (-> obj is-on)) - obj +(defmethod inspect debug-menu-item-flag ((this debug-menu-item-flag)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tparent: ~A~%" (-> this parent)) + (format #t "~Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~Tid: #x~X~%" (-> this id)) + (format #t "~Tactivate-func: ~A~%" (-> this activate-func)) + (format #t "~Tis-on: ~A~%" (-> this is-on)) + this ) ;; definition for method 0 of type debug-menu-item-flag @@ -304,40 +304,40 @@ ) ;; definition for method 3 of type debug-menu-item-var -(defmethod inspect debug-menu-item-var ((obj debug-menu-item-var)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tparent: ~A~%" (-> obj parent)) - (format #t "~Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~Tid: #x~X~%" (-> obj id)) - (format #t "~Tdisplay-str: ~A~%" (-> obj display-str)) - (format #t "~Tgrabbed-joypad-p: ~A~%" (-> obj grabbed-joypad-p)) - (format #t "~Tfloat-p: ~A~%" (-> obj float-p)) - (format #t "~Trange-p: ~A~%" (-> obj range-p)) - (format #t "~Tshow-len: ~D~%" (-> obj show-len)) - (format #t "~Tinc-delay: ~D~%" (-> obj inc-delay)) - (format #t "~Tinc-delay-ctr: ~D~%" (-> obj inc-delay-ctr)) - (format #t "~Tstep-delay-ctr: ~D~%" (-> obj step-delay-ctr)) - (format #t "~Tinc-dir: ~D~%" (-> obj inc-dir)) - (format #t "~Tfval: ~f~%" (-> obj fval)) - (format #t "~Tfundo-val: ~f~%" (-> obj fundo-val)) - (format #t "~Tfrange-min: ~f~%" (-> obj frange-min)) - (format #t "~Tfrange-max: ~f~%" (-> obj frange-max)) - (format #t "~Tfstart-inc: ~f~%" (-> obj fstart-inc)) - (format #t "~Tfstep: ~f~%" (-> obj fstep)) - (format #t "~Tfprecision: ~D~%" (-> obj fprecision)) - (format #t "~Tfactivate-func: ~A~%" (-> obj factivate-func)) - (format #t "~Tival: ~D~%" (-> obj fval)) - (format #t "~Tiundo-val: ~D~%" (-> obj fundo-val)) - (format #t "~Tirange-min: ~D~%" (-> obj frange-min)) - (format #t "~Tirange-max: ~D~%" (-> obj frange-max)) - (format #t "~Tistart-inc: ~D~%" (-> obj fstart-inc)) - (format #t "~Tistep: ~D~%" (-> obj fstep)) - (format #t "~Tihex-p: ~A~%" (-> obj ihex-p)) - (format #t "~Tiactivate-func: ~A~%" (-> obj factivate-func)) - (format #t "~Tifloat-p: ~A~%" (-> obj ifloat-p)) - obj +(defmethod inspect debug-menu-item-var ((this debug-menu-item-var)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tparent: ~A~%" (-> this parent)) + (format #t "~Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~Tid: #x~X~%" (-> this id)) + (format #t "~Tdisplay-str: ~A~%" (-> this display-str)) + (format #t "~Tgrabbed-joypad-p: ~A~%" (-> this grabbed-joypad-p)) + (format #t "~Tfloat-p: ~A~%" (-> this float-p)) + (format #t "~Trange-p: ~A~%" (-> this range-p)) + (format #t "~Tshow-len: ~D~%" (-> this show-len)) + (format #t "~Tinc-delay: ~D~%" (-> this inc-delay)) + (format #t "~Tinc-delay-ctr: ~D~%" (-> this inc-delay-ctr)) + (format #t "~Tstep-delay-ctr: ~D~%" (-> this step-delay-ctr)) + (format #t "~Tinc-dir: ~D~%" (-> this inc-dir)) + (format #t "~Tfval: ~f~%" (-> this fval)) + (format #t "~Tfundo-val: ~f~%" (-> this fundo-val)) + (format #t "~Tfrange-min: ~f~%" (-> this frange-min)) + (format #t "~Tfrange-max: ~f~%" (-> this frange-max)) + (format #t "~Tfstart-inc: ~f~%" (-> this fstart-inc)) + (format #t "~Tfstep: ~f~%" (-> this fstep)) + (format #t "~Tfprecision: ~D~%" (-> this fprecision)) + (format #t "~Tfactivate-func: ~A~%" (-> this factivate-func)) + (format #t "~Tival: ~D~%" (-> this fval)) + (format #t "~Tiundo-val: ~D~%" (-> this fundo-val)) + (format #t "~Tirange-min: ~D~%" (-> this frange-min)) + (format #t "~Tirange-max: ~D~%" (-> this frange-max)) + (format #t "~Tistart-inc: ~D~%" (-> this fstart-inc)) + (format #t "~Tistep: ~D~%" (-> this fstep)) + (format #t "~Tihex-p: ~A~%" (-> this ihex-p)) + (format #t "~Tiactivate-func: ~A~%" (-> this factivate-func)) + (format #t "~Tifloat-p: ~A~%" (-> this ifloat-p)) + this ) ;; definition for function debug-menu-item-var-update-display-str diff --git a/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc b/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc index c30205dd6e..fb5bd5d531 100644 --- a/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/part-tester_REF.gc @@ -20,25 +20,25 @@ ) ;; definition for method 3 of type part-tester -(defmethod inspect part-tester ((obj part-tester)) +(defmethod inspect part-tester ((this part-tester)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Troot: ~A~%" (-> obj root)) - (format #t "~T~Tpart: ~A~%" (-> obj part)) - (format #t "~T~Told-group: ~A~%" (-> obj old-group)) - obj + (format #t "~T~Troot: ~A~%" (-> this root)) + (format #t "~T~Tpart: ~A~%" (-> this part)) + (format #t "~T~Told-group: ~A~%" (-> this old-group)) + this ) ;; definition for symbol *part-tester-name*, type string (define *part-tester-name* (the-as string #f)) ;; definition for method 10 of type part-tester -(defmethod deactivate part-tester ((obj part-tester)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate part-tester ((this part-tester)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) diff --git a/test/decompiler/reference/jak1/engine/debug/stats-h_REF.gc b/test/decompiler/reference/jak1/engine/debug/stats-h_REF.gc index 4f75d7d45c..410ff00a33 100644 --- a/test/decompiler/reference/jak1/engine/debug/stats-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/stats-h_REF.gc @@ -16,15 +16,15 @@ ) ;; definition for method 3 of type tr-stat -(defmethod inspect tr-stat ((obj tr-stat)) - (format #t "[~8x] ~A~%" obj 'tr-stat) - (format #t "~Tgroups: ~D~%" (-> obj groups)) - (format #t "~Tfragments: ~D~%" (-> obj fragments)) - (format #t "~Ttris: ~D~%" (-> obj tris)) - (format #t "~Tdverts: ~D~%" (-> obj dverts)) - (format #t "~Tinstances: ~D~%" (-> obj instances)) - (format #t "~Tpad: ~D~%" (-> obj pad)) - obj +(defmethod inspect tr-stat ((this tr-stat)) + (format #t "[~8x] ~A~%" this 'tr-stat) + (format #t "~Tgroups: ~D~%" (-> this groups)) + (format #t "~Tfragments: ~D~%" (-> this fragments)) + (format #t "~Ttris: ~D~%" (-> this tris)) + (format #t "~Tdverts: ~D~%" (-> this dverts)) + (format #t "~Tinstances: ~D~%" (-> this instances)) + (format #t "~Tpad: ~D~%" (-> this pad)) + this ) ;; definition of type merc-global-stats @@ -38,11 +38,11 @@ ) ;; definition for method 3 of type merc-global-stats -(defmethod inspect merc-global-stats ((obj merc-global-stats)) - (format #t "[~8x] ~A~%" obj 'merc-global-stats) - (format #t "~Tmerc: #~%" (-> obj merc)) - (format #t "~Tmercneric: #~%" (-> obj mercneric)) - obj +(defmethod inspect merc-global-stats ((this merc-global-stats)) + (format #t "[~8x] ~A~%" this 'merc-global-stats) + (format #t "~Tmerc: #~%" (-> this merc)) + (format #t "~Tmercneric: #~%" (-> this mercneric)) + this ) ;; definition of type perf-stat @@ -75,22 +75,22 @@ ) ;; definition for method 3 of type perf-stat -(defmethod inspect perf-stat ((obj perf-stat)) - (format #t "[~8x] ~A~%" obj 'perf-stat) - (format #t "~Tframe-number: ~D~%" (-> obj frame-number)) - (format #t "~Tcount: ~D~%" (-> obj count)) - (format #t "~Tcycles: ~D~%" (-> obj cycles)) - (format #t "~Tinstructions: ~D~%" (-> obj instructions)) - (format #t "~Ticache: ~D~%" (-> obj icache)) - (format #t "~Tdcache: ~D~%" (-> obj dcache)) - (format #t "~Tselect: ~D~%" (-> obj select)) - (format #t "~Tctrl: ~D~%" (-> obj ctrl)) - (format #t "~Taccum0: ~D~%" (-> obj accum0)) - (format #t "~Taccum1: ~D~%" (-> obj accum1)) - (format #t "~Tto-vu0-waits: ~D~%" (-> obj to-vu0-waits)) - (format #t "~Tto-spr-waits: ~D~%" (-> obj to-spr-waits)) - (format #t "~Tfrom-spr-waits: ~D~%" (-> obj from-spr-waits)) - obj +(defmethod inspect perf-stat ((this perf-stat)) + (format #t "[~8x] ~A~%" this 'perf-stat) + (format #t "~Tframe-number: ~D~%" (-> this frame-number)) + (format #t "~Tcount: ~D~%" (-> this count)) + (format #t "~Tcycles: ~D~%" (-> this cycles)) + (format #t "~Tinstructions: ~D~%" (-> this instructions)) + (format #t "~Ticache: ~D~%" (-> this icache)) + (format #t "~Tdcache: ~D~%" (-> this dcache)) + (format #t "~Tselect: ~D~%" (-> this select)) + (format #t "~Tctrl: ~D~%" (-> this ctrl)) + (format #t "~Taccum0: ~D~%" (-> this accum0)) + (format #t "~Taccum1: ~D~%" (-> this accum1)) + (format #t "~Tto-vu0-waits: ~D~%" (-> this to-vu0-waits)) + (format #t "~Tto-spr-waits: ~D~%" (-> this to-spr-waits)) + (format #t "~Tfrom-spr-waits: ~D~%" (-> this from-spr-waits)) + this ) ;; definition of type perf-stat-array @@ -103,12 +103,12 @@ ) ;; definition for method 3 of type perf-stat-array -(defmethod inspect perf-stat-array ((obj perf-stat-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect perf-stat-array ((this perf-stat-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -116,9 +116,9 @@ ;; definition for method 11 of type perf-stat ;; INFO: Return type mismatch int vs none. -(defmethod reset! perf-stat ((obj perf-stat)) - (let ((v1-0 (-> obj ctrl))) - (+! (-> obj count) 1) +(defmethod reset! perf-stat ((this perf-stat)) + (let ((v1-0 (-> this ctrl))) + (+! (-> this count) 1) (b! (zero? v1-0) cfg-2 :delay (nop!)) (.mtc0 Perf 0) (.sync.l) @@ -138,16 +138,16 @@ ;; definition for method 12 of type perf-stat ;; INFO: Return type mismatch int vs none. -(defmethod read! perf-stat ((obj perf-stat)) +(defmethod read! perf-stat ((this perf-stat)) (local-vars (v1-1 int) (v1-3 int)) - (b! (zero? (-> obj ctrl)) cfg-2 :delay (nop!)) + (b! (zero? (-> this ctrl)) cfg-2 :delay (nop!)) (.mtc0 Perf 0) (.sync.l) (.sync.p) (.mfpc v1-1 pcr0) - (+! (-> obj accum0) v1-1) + (+! (-> this accum0) v1-1) (.mfpc v1-3 pcr1) - (+! (-> obj accum1) v1-3) + (+! (-> this accum1) v1-3) (label cfg-2) 0 (none) @@ -155,11 +155,11 @@ ;; definition for method 13 of type perf-stat ;; INFO: Return type mismatch int vs none. -(defmethod update-wait-stats perf-stat ((obj perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) - (when (nonzero? (-> obj ctrl)) - (+! (-> obj to-vu0-waits) arg0) - (+! (-> obj to-spr-waits) arg1) - (+! (-> obj from-spr-waits) arg2) +(defmethod update-wait-stats perf-stat ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) + (when (nonzero? (-> this ctrl)) + (+! (-> this to-vu0-waits) arg0) + (+! (-> this to-spr-waits) arg1) + (+! (-> this from-spr-waits) arg2) ) 0 (none) diff --git a/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc b/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc index 1909cc12f7..475f4ac9b2 100644 --- a/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc +++ b/test/decompiler/reference/jak1/engine/debug/viewer_REF.gc @@ -22,12 +22,12 @@ ) ;; definition for method 3 of type viewer -(defmethod inspect viewer ((obj viewer)) +(defmethod inspect viewer ((this viewer)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tjanim: ~A~%" (-> obj janim)) - obj + (format #t "~T~Tjanim: ~A~%" (-> this janim)) + this ) ;; failed to figure out what this is: @@ -184,10 +184,10 @@ ;; definition for method 11 of type viewer ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! viewer ((obj viewer) (arg0 entity-actor)) - (set! *viewer* obj) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! viewer ((this viewer) (arg0 entity-actor)) + (set! *viewer* this) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (actor-get-arg! viewer-ja-name "ja" (res-lump-struct arg0 'name string)) (actor-get-arg! viewer-geo-name "geo" (res-lump-struct arg0 'name string)) (let ((gp-1 (-> arg0 etype))) diff --git a/test/decompiler/reference/jak1/engine/dma/dma-buffer_REF.gc b/test/decompiler/reference/jak1/engine/dma/dma-buffer_REF.gc index 9e1066d96b..e1d5519281 100644 --- a/test/decompiler/reference/jak1/engine/dma/dma-buffer_REF.gc +++ b/test/decompiler/reference/jak1/engine/dma/dma-buffer_REF.gc @@ -15,13 +15,13 @@ ;; definition for method 3 of type dma-packet ;; INFO: Used lq/sq -(defmethod inspect dma-packet ((obj dma-packet)) - (format #t "[~8x] ~A~%" obj 'dma-packet) - (format #t "~Tdma: #x~X~%" (-> obj dma)) - (format #t "~Tvif0: #x~X~%" (-> obj vif0)) - (format #t "~Tvif1: #x~X~%" (-> obj vif1)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect dma-packet ((this dma-packet)) + (format #t "[~8x] ~A~%" this 'dma-packet) + (format #t "~Tdma: #x~X~%" (-> this dma)) + (format #t "~Tvif0: #x~X~%" (-> this vif0)) + (format #t "~Tvif1: #x~X~%" (-> this vif1)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; definition of type dma-packet-array @@ -33,12 +33,12 @@ ) ;; definition for method 3 of type dma-packet-array -(defmethod inspect dma-packet-array ((obj dma-packet-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj _data)) - obj +(defmethod inspect dma-packet-array ((this dma-packet-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this _data)) + this ) ;; failed to figure out what this is: @@ -58,12 +58,12 @@ ) ;; definition for method 3 of type dma-gif-packet -(defmethod inspect dma-gif-packet ((obj dma-gif-packet)) - (format #t "[~8x] ~A~%" obj 'dma-gif-packet) - (format #t "~Tdma-vif: #~%" (-> obj dma-vif)) - (format #t "~Tgif[2] @ #x~X~%" (&-> obj gif0)) - (format #t "~Tquad[2] @ #x~X~%" (-> obj dma-vif)) - obj +(defmethod inspect dma-gif-packet ((this dma-gif-packet)) + (format #t "[~8x] ~A~%" this 'dma-gif-packet) + (format #t "~Tdma-vif: #~%" (-> this dma-vif)) + (format #t "~Tgif[2] @ #x~X~%" (&-> this gif0)) + (format #t "~Tquad[2] @ #x~X~%" (-> this dma-vif)) + this ) ;; definition of type dma-buffer @@ -83,13 +83,13 @@ ) ;; definition for method 3 of type dma-buffer -(defmethod inspect dma-buffer ((obj dma-buffer)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tbase: #x~X~%" (-> obj base)) - (format #t "~Tend: #x~X~%" (-> obj end)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect dma-buffer ((this dma-buffer)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tbase: #x~X~%" (-> this base)) + (format #t "~Tend: #x~X~%" (-> this end)) + (format #t "~Tdata[1] @ #x~X~%" (-> this data)) + this ) ;; definition for method 0 of type dma-buffer @@ -109,13 +109,13 @@ ) ;; definition for method 4 of type dma-buffer -(defmethod length dma-buffer ((obj dma-buffer)) - (-> obj allocated-length) +(defmethod length dma-buffer ((this dma-buffer)) + (-> this allocated-length) ) ;; definition for method 5 of type dma-buffer -(defmethod asize-of dma-buffer ((obj dma-buffer)) - (+ (-> obj allocated-length) -4 (-> dma-buffer size)) +(defmethod asize-of dma-buffer ((this dma-buffer)) + (+ (-> this allocated-length) -4 (-> dma-buffer size)) ) ;; definition for function dma-buffer-length diff --git a/test/decompiler/reference/jak1/engine/dma/dma-disasm_REF.gc b/test/decompiler/reference/jak1/engine/dma/dma-disasm_REF.gc index 4f91198a87..139b6f45a0 100644 --- a/test/decompiler/reference/jak1/engine/dma/dma-disasm_REF.gc +++ b/test/decompiler/reference/jak1/engine/dma/dma-disasm_REF.gc @@ -19,15 +19,15 @@ ) ;; definition for method 3 of type vif-disasm-element -(defmethod inspect vif-disasm-element ((obj vif-disasm-element)) - (format #t "[~8x] ~A~%" obj 'vif-disasm-element) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Ttag: ~D~%" (-> obj tag)) - (format #t "~Tval: ~D~%" (-> obj val)) - (format #t "~Tprint: ~D~%" (-> obj print)) - (format #t "~Tstring1: ~A~%" (-> obj string1)) - (format #t "~Tstring2: ~A~%" (-> obj string2)) - obj +(defmethod inspect vif-disasm-element ((this vif-disasm-element)) + (format #t "[~8x] ~A~%" this 'vif-disasm-element) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Ttag: ~D~%" (-> this tag)) + (format #t "~Tval: ~D~%" (-> this val)) + (format #t "~Tprint: ~D~%" (-> this print)) + (format #t "~Tstring1: ~A~%" (-> this string1)) + (format #t "~Tstring2: ~A~%" (-> this string2)) + this ) ;; definition for symbol *vif-disasm-table*, type (array vif-disasm-element) diff --git a/test/decompiler/reference/jak1/engine/dma/dma-h_REF.gc b/test/decompiler/reference/jak1/engine/dma/dma-h_REF.gc index 5274501eb9..4e320744cd 100644 --- a/test/decompiler/reference/jak1/engine/dma/dma-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/dma/dma-h_REF.gc @@ -17,16 +17,16 @@ ) ;; definition for method 3 of type dma-chcr -(defmethod inspect dma-chcr ((obj dma-chcr)) - (format #t "[~8x] ~A~%" obj 'dma-chcr) - (format #t "~Tdir: ~D~%" (-> obj dir)) - (format #t "~Tmod: ~D~%" (-> obj mod)) - (format #t "~Tasp: ~D~%" (-> obj asp)) - (format #t "~Ttte: ~D~%" (-> obj tte)) - (format #t "~Ttie: ~D~%" (-> obj tie)) - (format #t "~Tstr: ~D~%" (-> obj str)) - (format #t "~Ttag: #x~X~%" (-> obj tag)) - obj +(defmethod inspect dma-chcr ((this dma-chcr)) + (format #t "[~8x] ~A~%" this 'dma-chcr) + (format #t "~Tdir: ~D~%" (-> this dir)) + (format #t "~Tmod: ~D~%" (-> this mod)) + (format #t "~Tasp: ~D~%" (-> this asp)) + (format #t "~Ttte: ~D~%" (-> this tte)) + (format #t "~Ttie: ~D~%" (-> this tie)) + (format #t "~Tstr: ~D~%" (-> this str)) + (format #t "~Ttag: #x~X~%" (-> this tag)) + this ) ;; definition of type dma-bank @@ -41,12 +41,12 @@ ) ;; definition for method 3 of type dma-bank -(defmethod inspect dma-bank ((obj dma-bank)) - (format #t "[~8x] ~A~%" obj 'dma-bank) - (format #t "~Tchcr: #x~X~%" (-> obj chcr)) - (format #t "~Tmadr: #x~X~%" (-> obj madr)) - (format #t "~Tqwc: #x~X~%" (-> obj qwc)) - obj +(defmethod inspect dma-bank ((this dma-bank)) + (format #t "[~8x] ~A~%" this 'dma-bank) + (format #t "~Tchcr: #x~X~%" (-> this chcr)) + (format #t "~Tmadr: #x~X~%" (-> this madr)) + (format #t "~Tqwc: #x~X~%" (-> this qwc)) + this ) ;; definition of type dma-bank-source @@ -59,13 +59,13 @@ ) ;; definition for method 3 of type dma-bank-source -(defmethod inspect dma-bank-source ((obj dma-bank-source)) - (format #t "[~8x] ~A~%" obj 'dma-bank-source) - (format #t "~Tchcr: #x~X~%" (-> obj chcr)) - (format #t "~Tmadr: #x~X~%" (-> obj madr)) - (format #t "~Tqwc: #x~X~%" (-> obj qwc)) - (format #t "~Ttadr: #x~X~%" (-> obj tadr)) - obj +(defmethod inspect dma-bank-source ((this dma-bank-source)) + (format #t "[~8x] ~A~%" this 'dma-bank-source) + (format #t "~Tchcr: #x~X~%" (-> this chcr)) + (format #t "~Tmadr: #x~X~%" (-> this madr)) + (format #t "~Tqwc: #x~X~%" (-> this qwc)) + (format #t "~Ttadr: #x~X~%" (-> this tadr)) + this ) ;; definition of type dma-bank-vif @@ -79,15 +79,15 @@ ) ;; definition for method 3 of type dma-bank-vif -(defmethod inspect dma-bank-vif ((obj dma-bank-vif)) - (format #t "[~8x] ~A~%" obj 'dma-bank-vif) - (format #t "~Tchcr: #x~X~%" (-> obj chcr)) - (format #t "~Tmadr: #x~X~%" (-> obj madr)) - (format #t "~Tqwc: #x~X~%" (-> obj qwc)) - (format #t "~Ttadr: #x~X~%" (-> obj tadr)) - (format #t "~Tas0: #x~X~%" (-> obj as0)) - (format #t "~Tas1: #x~X~%" (-> obj as1)) - obj +(defmethod inspect dma-bank-vif ((this dma-bank-vif)) + (format #t "[~8x] ~A~%" this 'dma-bank-vif) + (format #t "~Tchcr: #x~X~%" (-> this chcr)) + (format #t "~Tmadr: #x~X~%" (-> this madr)) + (format #t "~Tqwc: #x~X~%" (-> this qwc)) + (format #t "~Ttadr: #x~X~%" (-> this tadr)) + (format #t "~Tas0: #x~X~%" (-> this as0)) + (format #t "~Tas1: #x~X~%" (-> this as1)) + this ) ;; definition of type dma-bank-spr @@ -100,14 +100,14 @@ ) ;; definition for method 3 of type dma-bank-spr -(defmethod inspect dma-bank-spr ((obj dma-bank-spr)) - (format #t "[~8x] ~A~%" obj 'dma-bank-spr) - (format #t "~Tchcr: #x~X~%" (-> obj chcr)) - (format #t "~Tmadr: #x~X~%" (-> obj madr)) - (format #t "~Tqwc: #x~X~%" (-> obj qwc)) - (format #t "~Ttadr: #x~X~%" (-> obj tadr)) - (format #t "~Tsadr: #x~X~%" (-> obj sadr)) - obj +(defmethod inspect dma-bank-spr ((this dma-bank-spr)) + (format #t "[~8x] ~A~%" this 'dma-bank-spr) + (format #t "~Tchcr: #x~X~%" (-> this chcr)) + (format #t "~Tmadr: #x~X~%" (-> this madr)) + (format #t "~Tqwc: #x~X~%" (-> this qwc)) + (format #t "~Ttadr: #x~X~%" (-> this tadr)) + (format #t "~Tsadr: #x~X~%" (-> this sadr)) + this ) ;; definition of type dma-ctrl @@ -161,18 +161,18 @@ ) ;; definition for method 3 of type dma-bank-control -(defmethod inspect dma-bank-control ((obj dma-bank-control)) - (format #t "[~8x] ~A~%" obj 'dma-bank-control) - (format #t "~Tctrl: #x~X~%" (-> obj ctrl)) - (format #t "~Tstat: #x~X~%" (-> obj stat)) - (format #t "~Tpcr: #x~X~%" (-> obj pcr)) - (format #t "~Tsqwc: #x~X~%" (-> obj sqwc)) - (format #t "~Trbsr: #x~X~%" (-> obj rbsr)) - (format #t "~Trbor: #x~X~%" (-> obj rbor)) - (format #t "~Tstadr: #x~X~%" (-> obj stadr)) - (format #t "~Tenabler: ~D~%" (-> obj enabler)) - (format #t "~Tenablew: ~D~%" (-> obj enablew)) - obj +(defmethod inspect dma-bank-control ((this dma-bank-control)) + (format #t "[~8x] ~A~%" this 'dma-bank-control) + (format #t "~Tctrl: #x~X~%" (-> this ctrl)) + (format #t "~Tstat: #x~X~%" (-> this stat)) + (format #t "~Tpcr: #x~X~%" (-> this pcr)) + (format #t "~Tsqwc: #x~X~%" (-> this sqwc)) + (format #t "~Trbsr: #x~X~%" (-> this rbsr)) + (format #t "~Trbor: #x~X~%" (-> this rbor)) + (format #t "~Tstadr: #x~X~%" (-> this stadr)) + (format #t "~Tenabler: ~D~%" (-> this enabler)) + (format #t "~Tenablew: ~D~%" (-> this enablew)) + this ) ;; definition of type vu-code-block @@ -188,13 +188,13 @@ ) ;; definition for method 3 of type vu-code-block -(defmethod inspect vu-code-block ((obj vu-code-block)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tcode: #x~X~%" (-> obj code)) - (format #t "~Tsize: ~D~%" (-> obj size)) - (format #t "~Tdest-address: ~D~%" (-> obj dest-address)) - obj +(defmethod inspect vu-code-block ((this vu-code-block)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tcode: #x~X~%" (-> this code)) + (format #t "~Tsize: ~D~%" (-> this size)) + (format #t "~Tdest-address: ~D~%" (-> this dest-address)) + this ) ;; definition of type vu-stat @@ -220,15 +220,15 @@ ) ;; definition for method 3 of type dma-tag -(defmethod inspect dma-tag ((obj dma-tag)) - (format #t "[~8x] ~A~%" obj 'dma-tag) - (format #t "~Tqwc: ~D~%" (-> obj qwc)) - (format #t "~Tpce: ~D~%" (-> obj pce)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tirq: ~D~%" (-> obj irq)) - (format #t "~Taddr: #x~X~%" (-> obj addr)) - (format #t "~Tspr: ~D~%" (-> obj spr)) - obj +(defmethod inspect dma-tag ((this dma-tag)) + (format #t "[~8x] ~A~%" this 'dma-tag) + (format #t "~Tqwc: ~D~%" (-> this qwc)) + (format #t "~Tpce: ~D~%" (-> this pce)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tirq: ~D~%" (-> this irq)) + (format #t "~Taddr: #x~X~%" (-> this addr)) + (format #t "~Tspr: ~D~%" (-> this spr)) + this ) ;; definition of type dma-bucket @@ -244,13 +244,13 @@ ) ;; definition for method 3 of type dma-bucket -(defmethod inspect dma-bucket ((obj dma-bucket)) - (format #t "[~8x] ~A~%" obj 'dma-bucket) - (format #t "~Ttag: ~D~%" (-> obj tag)) - (format #t "~Tlast: #x~X~%" (-> obj last)) - (format #t "~Tdummy: ~D~%" (-> obj dummy)) - (format #t "~Tnext: #x~X~%" (-> obj next)) - obj +(defmethod inspect dma-bucket ((this dma-bucket)) + (format #t "[~8x] ~A~%" this 'dma-bucket) + (format #t "~Ttag: ~D~%" (-> this tag)) + (format #t "~Tlast: #x~X~%" (-> this last)) + (format #t "~Tdummy: ~D~%" (-> this dummy)) + (format #t "~Tnext: #x~X~%" (-> this next)) + this ) ;; definition of type vif-mask @@ -312,14 +312,14 @@ ) ;; definition for method 3 of type vif-tag -(defmethod inspect vif-tag ((obj vif-tag)) - (format #t "[~8x] ~A~%" obj 'vif-tag) - (format #t "~Timm: #x~X~%" (-> obj imm)) - (format #t "~Tnum: ~D~%" (-> obj num)) - (format #t "~Tcmd: #x~X~%" (-> obj cmd)) - (format #t "~Tmsk: ~D~%" (-> obj msk)) - (format #t "~Tirq: ~D~%" (-> obj irq)) - obj +(defmethod inspect vif-tag ((this vif-tag)) + (format #t "[~8x] ~A~%" this 'vif-tag) + (format #t "~Timm: #x~X~%" (-> this imm)) + (format #t "~Tnum: ~D~%" (-> this num)) + (format #t "~Tcmd: #x~X~%" (-> this cmd)) + (format #t "~Tmsk: ~D~%" (-> this msk)) + (format #t "~Tirq: ~D~%" (-> this irq)) + this ) ;; definition for function dma-sync-fast diff --git a/test/decompiler/reference/jak1/engine/draw/draw-node-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/draw-node-h_REF.gc index 158f9a86d0..d0a51198be 100644 --- a/test/decompiler/reference/jak1/engine/draw/draw-node-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/draw-node-h_REF.gc @@ -14,15 +14,15 @@ ) ;; definition for method 3 of type draw-node -(defmethod inspect draw-node ((obj draw-node)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tchild-count: ~D~%" (-> obj child-count)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tdistance: #x~X~%" (-> obj distance)) - obj +(defmethod inspect draw-node ((this draw-node)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tchild-count: ~D~%" (-> this child-count)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tdistance: #x~X~%" (-> this distance)) + this ) ;; definition of type drawable-inline-array-node @@ -46,11 +46,11 @@ ) ;; definition for method 3 of type draw-node-dma -(defmethod inspect draw-node-dma ((obj draw-node-dma)) - (format #t "[~8x] ~A~%" obj 'draw-node-dma) - (format #t "~Tbanka[32] @ #x~X~%" (-> obj banka)) - (format #t "~Tbankb[32] @ #x~X~%" (-> obj bankb)) - obj +(defmethod inspect draw-node-dma ((this draw-node-dma)) + (format #t "[~8x] ~A~%" this 'draw-node-dma) + (format #t "~Tbanka[32] @ #x~X~%" (-> this banka)) + (format #t "~Tbankb[32] @ #x~X~%" (-> this bankb)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/draw/draw-node_REF.gc b/test/decompiler/reference/jak1/engine/draw/draw-node_REF.gc index c571797a48..620fea0cbb 100644 --- a/test/decompiler/reference/jak1/engine/draw/draw-node_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/draw-node_REF.gc @@ -3,12 +3,12 @@ ;; definition for method 11 of type draw-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box draw-node ((obj draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) - (if (collide-cache-using-box-test (-> obj bsphere)) - (collide-with-box (-> obj child) (the-as int (-> obj child-count)) arg1) + (if (collide-cache-using-box-test (-> this bsphere)) + (collide-with-box (-> this child) (the-as int (-> this child-count)) arg1) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) @@ -16,12 +16,12 @@ ;; definition for method 12 of type draw-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe draw-node ((obj draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) - (if (collide-cache-using-y-probe-test (-> obj bsphere)) - (collide-y-probe (-> obj child) (the-as int (-> obj child-count)) arg1) + (if (collide-cache-using-y-probe-test (-> this bsphere)) + (collide-y-probe (-> this child) (the-as int (-> this child-count)) arg1) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) @@ -29,12 +29,12 @@ ;; definition for method 13 of type draw-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray draw-node ((obj draw-node) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray draw-node ((this draw-node) (arg0 int) (arg1 collide-list)) (dotimes (s3-0 arg0) - (if (collide-cache-using-line-sphere-test (-> obj bsphere)) - (collide-ray (-> obj child) (the-as int (-> obj child-count)) arg1) + (if (collide-cache-using-line-sphere-test (-> this bsphere)) + (collide-ray (-> this child) (the-as int (-> this child-count)) arg1) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) @@ -42,74 +42,74 @@ ;; definition for method 17 of type draw-node ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients draw-node ((obj draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients draw-node ((this draw-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (dotimes (s2-0 arg1) - (if (spheres-overlap? arg0 (the-as sphere (-> obj bsphere))) - (collect-ambients (-> obj child) arg0 (the-as int (-> obj child-count)) arg2) + (if (spheres-overlap? arg0 (the-as sphere (-> this bsphere))) + (collect-ambients (-> this child) arg0 (the-as int (-> this child-count)) arg2) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) ) ;; definition for method 3 of type drawable-inline-array-node -(defmethod inspect drawable-inline-array-node ((obj drawable-inline-array-node)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect drawable-inline-array-node ((this drawable-inline-array-node)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) ;; definition for method 8 of type drawable-inline-array-node -(defmethod mem-usage drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-node ((this drawable-inline-array-node) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 62 (-> arg0 length))) (set! (-> arg0 data 61 name) "draw-node") - (+! (-> arg0 data 61 count) (-> obj length)) - (let ((v1-6 (asize-of obj))) + (+! (-> arg0 data 61 count) (-> this length)) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 61 used) v1-6) (+! (-> arg0 data 61 total) (logand -16 (+ v1-6 15))) ) - obj + this ) ;; definition for method 5 of type drawable-inline-array-node ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of drawable-inline-array-node ((obj drawable-inline-array-node)) - (the-as int (+ (-> drawable-inline-array-node size) (* (+ (-> obj length) -1) 32))) +(defmethod asize-of drawable-inline-array-node ((this drawable-inline-array-node)) + (the-as int (+ (-> drawable-inline-array-node size) (* (+ (-> this length) -1) 32))) ) ;; definition for method 11 of type drawable-inline-array-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 int) (arg1 collide-list)) - (collide-with-box (the-as drawable (-> obj data)) (-> obj length) arg1) +(defmethod collide-with-box drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) + (collide-with-box (the-as drawable (-> this data)) (-> this length) arg1) 0 (none) ) ;; definition for method 12 of type drawable-inline-array-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 int) (arg1 collide-list)) - (collide-y-probe (the-as drawable (-> obj data)) (-> obj length) arg1) +(defmethod collide-y-probe drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) + (collide-y-probe (the-as drawable (-> this data)) (-> this length) arg1) 0 (none) ) ;; definition for method 13 of type drawable-inline-array-node ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 int) (arg1 collide-list)) - (collide-ray (the-as drawable (-> obj data)) (-> obj length) arg1) +(defmethod collide-ray drawable-inline-array-node ((this drawable-inline-array-node) (arg0 int) (arg1 collide-list)) + (collide-ray (the-as drawable (-> this data)) (-> this length) arg1) 0 (none) ) ;; definition for method 17 of type drawable-inline-array-node ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients drawable-inline-array-node ((obj drawable-inline-array-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) - (collect-ambients (the-as drawable (-> obj data)) arg0 (-> obj length) arg2) +(defmethod collect-ambients drawable-inline-array-node ((this drawable-inline-array-node) (arg0 sphere) (arg1 int) (arg2 ambient-list)) + (collect-ambients (the-as drawable (-> this data)) arg0 (-> this length) arg2) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-actor-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-actor-h_REF.gc index b406bcc7c9..d74bdb44ad 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-actor-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-actor-h_REF.gc @@ -11,12 +11,12 @@ ) ;; definition for method 3 of type drawable-actor -(defmethod inspect drawable-actor ((obj drawable-actor)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tactor: ~A~%" (-> obj actor)) - obj +(defmethod inspect drawable-actor ((this drawable-actor)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tactor: ~A~%" (-> this actor)) + this ) ;; definition of type drawable-tree-actor @@ -39,7 +39,7 @@ ;; definition for method 10 of type drawable-tree-actor ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-tree-actor ((obj drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) +(defmethod draw drawable-tree-actor ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-ambient-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-ambient-h_REF.gc index cff54469a8..62672b2d8b 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-ambient-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-ambient-h_REF.gc @@ -14,12 +14,12 @@ ) ;; definition for method 3 of type drawable-ambient -(defmethod inspect drawable-ambient ((obj drawable-ambient)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tambient: ~A~%" (-> obj ambient)) - obj +(defmethod inspect drawable-ambient ((this drawable-ambient)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tambient: ~A~%" (-> this ambient)) + this ) ;; definition of type drawable-tree-ambient @@ -42,13 +42,13 @@ ;; definition for method 10 of type drawable-tree-ambient ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-tree-ambient ((obj drawable-tree-ambient) (arg0 drawable-tree-ambient) (arg1 display-frame)) +(defmethod draw drawable-tree-ambient ((this drawable-tree-ambient) (arg0 drawable-tree-ambient) (arg1 display-frame)) 0 (none) ) ;; definition for method 16 of type drawable-tree-ambient -(defmethod unpack-vis drawable-tree-ambient ((obj drawable-tree-ambient) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree-ambient ((this drawable-tree-ambient) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) @@ -82,20 +82,20 @@ ) ;; definition for method 3 of type level-hint -(defmethod inspect level-hint ((obj level-hint)) +(defmethod inspect level-hint ((this level-hint)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttext-id-to-display: ~D~%" (-> obj text-id-to-display)) - (format #t "~T~Tsound-to-play: ~A~%" (-> obj sound-to-play)) - (format #t "~T~Ttrans: #~%" (-> obj trans)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~T~Tmode: ~A~%" (-> obj mode)) - (format #t "~T~Ttotal-time: ~D~%" (-> obj total-time)) - (format #t "~T~Ttotal-off-time: ~D~%" (-> obj total-off-time)) - (format #t "~T~Tlast-time: ~D~%" (-> obj last-time)) - (format #t "~T~Tvoicebox: ~D~%" (-> obj voicebox)) - obj + (format #t "~T~Ttext-id-to-display: ~D~%" (-> this text-id-to-display)) + (format #t "~T~Tsound-to-play: ~A~%" (-> this sound-to-play)) + (format #t "~T~Ttrans: #~%" (-> this trans)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~T~Tmode: ~A~%" (-> this mode)) + (format #t "~T~Ttotal-time: ~D~%" (-> this total-time)) + (format #t "~T~Ttotal-off-time: ~D~%" (-> this total-off-time)) + (format #t "~T~Tlast-time: ~D~%" (-> this last-time)) + (format #t "~T~Tvoicebox: ~D~%" (-> this voicebox)) + this ) ;; definition of type ambient-list @@ -109,11 +109,11 @@ ) ;; definition for method 3 of type ambient-list -(defmethod inspect ambient-list ((obj ambient-list)) - (format #t "[~8x] ~A~%" obj 'ambient-list) - (format #t "~Tnum-items: ~D~%" (-> obj num-items)) - (format #t "~Titems[2048] @ #x~X~%" (-> obj items)) - obj +(defmethod inspect ambient-list ((this ambient-list)) + (format #t "[~8x] ~A~%" this 'ambient-list) + (format #t "~Tnum-items: ~D~%" (-> this num-items)) + (format #t "~Titems[2048] @ #x~X~%" (-> this items)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-group_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-group_REF.gc index 7e64f45028..10ebe29d1d 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-group_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-group_REF.gc @@ -10,68 +10,68 @@ ) ;; definition for method 3 of type drawable-group -(defmethod inspect drawable-group ((obj drawable-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect drawable-group ((this drawable-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) ;; definition for method 2 of type drawable-group -(defmethod print drawable-group ((obj drawable-group)) - (format #t "#<~A @ #x~X [~D]" (-> obj type) obj (-> obj length)) - (dotimes (s5-0 (-> obj length)) - (format #t " ~A" (-> obj data s5-0)) +(defmethod print drawable-group ((this drawable-group)) + (format #t "#<~A @ #x~X [~D]" (-> this type) this (-> this length)) + (dotimes (s5-0 (-> this length)) + (format #t " ~A" (-> this data s5-0)) ) (format #t ">") - obj + this ) ;; definition for method 4 of type drawable-group -(defmethod length drawable-group ((obj drawable-group)) - (-> obj length) +(defmethod length drawable-group ((this drawable-group)) + (-> this length) ) ;; definition for method 5 of type drawable-group ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of drawable-group ((obj drawable-group)) - (the-as int (+ (-> drawable-group size) (* (+ (-> obj length) -1) 4))) +(defmethod asize-of drawable-group ((this drawable-group)) + (the-as int (+ (-> drawable-group size) (* (+ (-> this length) -1) 4))) ) ;; definition for method 8 of type drawable-group -(defmethod mem-usage drawable-group ((obj drawable-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-group ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 0 used) v1-6) (+! (-> arg0 data 0 total) (logand -16 (+ v1-6 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 9 of type drawable-group -(defmethod login drawable-group ((obj drawable-group)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login drawable-group ((this drawable-group)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) ;; definition for method 10 of type drawable-group ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-group ((obj drawable-group) (arg0 drawable-group) (arg1 display-frame)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (s3-0 (-> obj length)) - (draw (-> obj data s3-0) (-> arg0 data s3-0) arg1) +(defmethod draw drawable-group ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (s3-0 (-> this length)) + (draw (-> this data s3-0) (-> arg0 data s3-0) arg1) ) ) ) @@ -81,11 +81,11 @@ ;; definition for method 14 of type drawable-group ;; INFO: Return type mismatch int vs none. -(defmethod collect-stats drawable-group ((obj drawable-group)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj data s5-0)) +(defmethod collect-stats drawable-group ((this drawable-group)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this data s5-0)) ) ) ) @@ -95,11 +95,11 @@ ;; definition for method 15 of type drawable-group ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw drawable-group ((obj drawable-group) (arg0 drawable) (arg1 display-frame)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (s3-0 (-> obj length)) - (debug-draw (-> obj data s3-0) (-> (the-as drawable-group arg0) data s3-0) arg1) +(defmethod debug-draw drawable-group ((this drawable-group) (arg0 drawable) (arg1 display-frame)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (s3-0 (-> this length)) + (debug-draw (-> this data s3-0) (-> (the-as drawable-group arg0) data s3-0) arg1) ) ) ) @@ -108,9 +108,9 @@ ) ;; definition for method 16 of type drawable-group -(defmethod unpack-vis drawable-group ((obj drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) - (dotimes (s4-0 (-> obj length)) - (set! arg1 (unpack-vis (-> obj data s4-0) arg0 arg1)) +(defmethod unpack-vis drawable-group ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) + (dotimes (s4-0 (-> this length)) + (set! arg1 (unpack-vis (-> this data s4-0) arg0 arg1)) ) arg1 ) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-h_REF.gc index 1ddfb9effb..7813314b51 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-h_REF.gc @@ -23,11 +23,11 @@ ) ;; definition for method 3 of type drawable -(defmethod inspect drawable ((obj drawable)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - obj +(defmethod inspect drawable ((this drawable)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + this ) ;; definition of type drawable-error @@ -40,12 +40,12 @@ ) ;; definition for method 3 of type drawable-error -(defmethod inspect drawable-error ((obj drawable-error)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tname: ~A~%" (-> obj name)) - obj +(defmethod inspect drawable-error ((this drawable-error)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tname: ~A~%" (-> this name)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-inline-array-h_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-inline-array-h_REF.gc index 7c9091db3a..3c7d5d1959 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-inline-array-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-inline-array-h_REF.gc @@ -11,12 +11,12 @@ ) ;; definition for method 3 of type drawable-inline-array -(defmethod inspect drawable-inline-array ((obj drawable-inline-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tlength: ~D~%" (-> obj length)) - obj +(defmethod inspect drawable-inline-array ((this drawable-inline-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tlength: ~D~%" (-> this length)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-inline-array_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-inline-array_REF.gc index e538b96f7a..8f43719f0f 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-inline-array_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-inline-array_REF.gc @@ -2,32 +2,32 @@ (in-package goal) ;; definition for method 4 of type drawable-inline-array -(defmethod length drawable-inline-array ((obj drawable-inline-array)) - (-> obj length) +(defmethod length drawable-inline-array ((this drawable-inline-array)) + (-> this length) ) ;; definition for method 9 of type drawable-inline-array -(defmethod login drawable-inline-array ((obj drawable-inline-array)) - obj +(defmethod login drawable-inline-array ((this drawable-inline-array)) + this ) ;; definition for method 10 of type drawable-inline-array ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-inline-array ((obj drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) +(defmethod draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) 0 (none) ) ;; definition for method 14 of type drawable-inline-array ;; INFO: Return type mismatch int vs none. -(defmethod collect-stats drawable-inline-array ((obj drawable-inline-array)) +(defmethod collect-stats drawable-inline-array ((this drawable-inline-array)) 0 (none) ) ;; definition for method 15 of type drawable-inline-array ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw drawable-inline-array ((obj drawable-inline-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc index e41efe0608..cea567be58 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable-tree_REF.gc @@ -3,14 +3,14 @@ ;; definition for method 10 of type drawable-tree-array ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable-tree-array ((obj drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) +(defmethod draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) (let ((v1-1 (-> (the-as terrain-context #x70000000) bsp lev-index))) (case (-> *level* level v1-1 display?) (('special 'special-vis #f) ) (else - (dotimes (s3-0 (-> obj length)) - (draw (-> obj trees s3-0) (-> arg0 trees s3-0) arg1) + (dotimes (s3-0 (-> this length)) + (draw (-> this trees s3-0) (-> arg0 trees s3-0) arg1) ) ) ) @@ -21,9 +21,9 @@ ;; definition for method 14 of type drawable-tree-array ;; INFO: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-array ((obj drawable-tree-array)) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj trees s5-0)) +(defmethod collect-stats drawable-tree-array ((this drawable-tree-array)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this trees s5-0)) ) 0 (none) @@ -31,18 +31,18 @@ ;; definition for method 15 of type drawable-tree-array ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw drawable-tree-array ((obj drawable-tree-array) (arg0 drawable) (arg1 display-frame)) - (dotimes (s3-0 (-> obj length)) - (debug-draw (-> obj trees s3-0) (-> (the-as drawable-tree-array arg0) trees s3-0) arg1) +(defmethod debug-draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) + (dotimes (s3-0 (-> this length)) + (debug-draw (-> this trees s3-0) (-> (the-as drawable-tree-array arg0) trees s3-0) arg1) ) 0 (none) ) ;; definition for method 16 of type drawable-tree -(defmethod unpack-vis drawable-tree ((obj drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) (local-vars (t5-1 int)) - (let* ((v1-0 (the-as drawable-inline-array-node (-> obj data 0))) + (let* ((v1-0 (the-as drawable-inline-array-node (-> this data 0))) (a3-1 (/ (-> v1-0 data 0 id) 8)) (t0-0 (-> v1-0 length)) (v1-1 (&+ arg0 a3-1)) @@ -56,11 +56,11 @@ (set! v1-1 (&-> v1-1 1)) ) ) - (let ((v1-5 (+ (-> obj length) -1))) + (let ((v1-5 (+ (-> this length) -1))) (when (nonzero? v1-5) (dotimes (a3-5 v1-5) - (let* ((t0-4 (-> obj data a3-5)) - (t2-0 (-> obj data (+ a3-5 1))) + (let* ((t0-4 (-> this data a3-5)) + (t2-0 (-> this data (+ a3-5 1))) (t1-5 (/ (-> (the-as drawable-inline-array-node t0-4) data 0 id) 8)) (t2-2 (/ (-> (the-as drawable-inline-array-node t2-0) data 0 id) 8)) (t0-5 (-> (the-as drawable-inline-array-node t0-4) length)) diff --git a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc index 9e503cba31..0993b1dbdc 100644 --- a/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/drawable_REF.gc @@ -178,68 +178,68 @@ ) ;; definition for method 9 of type drawable -(defmethod login drawable ((obj drawable)) - obj +(defmethod login drawable ((this drawable)) + this ) ;; definition for method 10 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod draw drawable ((obj drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) ;; definition for method 11 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable ((obj drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box drawable ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) ;; definition for method 12 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable ((obj drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe drawable ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) ;; definition for method 13 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable ((obj drawable) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray drawable ((this drawable) (arg0 int) (arg1 collide-list)) 0 (none) ) ;; definition for method 17 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients drawable ((obj drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients drawable ((this drawable) (arg0 sphere) (arg1 int) (arg2 ambient-list)) 0 (none) ) ;; definition for method 14 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod collect-stats drawable ((obj drawable)) +(defmethod collect-stats drawable ((this drawable)) 0 (none) ) ;; definition for method 15 of type drawable ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw drawable ((obj drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) ;; definition for method 10 of type drawable-error ;; INFO: Return type mismatch drawable-error vs none. -(defmethod draw drawable-error ((obj drawable-error) (arg0 drawable-error) (arg1 display-frame)) +(defmethod draw drawable-error ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) (error-sphere arg0 (-> arg0 name)) (none) ) ;; definition for method 16 of type drawable -(defmethod unpack-vis drawable ((obj drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) @@ -1564,7 +1564,7 @@ (if (or (cpad-pressed? 0 select r3 start) (and (logtest? (-> *cpad-list* cpads 0 valid) 128) (= *master-mode* 'game) - (>= (-> *display* base-frame-counter) (-> *game-info* blackout-time)) + (>= (current-time) (-> *game-info* blackout-time)) (< (seconds 1003) (-> *display* real-frame-counter)) ) (and (cpad-pressed? 0 r2) (paused?)) diff --git a/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc b/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc index 6c512ae4eb..18590e1de9 100644 --- a/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc +++ b/test/decompiler/reference/jak1/engine/draw/process-drawable_REF.gc @@ -87,12 +87,12 @@ ;; definition for method 10 of type draw-control ;; INFO: Return type mismatch int vs none. -(defmethod lod-set! draw-control ((obj draw-control) (arg0 int)) - (let ((v1-1 (max 0 (min arg0 (-> obj lod-set max-lod))))) - (set! (-> obj desired-lod) v1-1) - (when (!= (-> obj cur-lod) v1-1) - (set! (-> obj mgeo) (-> obj lod-set lod v1-1 geo)) - (set! (-> obj cur-lod) v1-1) +(defmethod lod-set! draw-control ((this draw-control) (arg0 int)) + (let ((v1-1 (max 0 (min arg0 (-> this lod-set max-lod))))) + (set! (-> this desired-lod) v1-1) + (when (!= (-> this cur-lod) v1-1) + (set! (-> this mgeo) (-> this lod-set lod v1-1 geo)) + (set! (-> this cur-lod) v1-1) ) ) 0 @@ -101,11 +101,11 @@ ;; definition for method 11 of type draw-control ;; INFO: Return type mismatch int vs none. -(defmethod lods-assign! draw-control ((obj draw-control) (arg0 lod-set)) - (mem-copy! (the-as pointer (-> obj lod-set)) (the-as pointer arg0) 33) - (let ((a1-2 (min (-> obj cur-lod) (-> obj lod-set max-lod)))) - (set! (-> obj cur-lod) -1) - (lod-set! obj a1-2) +(defmethod lods-assign! draw-control ((this draw-control) (arg0 lod-set)) + (mem-copy! (the-as pointer (-> this lod-set)) (the-as pointer arg0) 33) + (let ((a1-2 (min (-> this cur-lod) (-> this lod-set max-lod)))) + (set! (-> this cur-lod) -1) + (lod-set! this a1-2) ) 0 (none) @@ -113,7 +113,7 @@ ;; definition for method 9 of type lod-set ;; INFO: Used lq/sq -(defmethod setup-lods! lod-set ((obj lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) +(defmethod setup-lods! lod-set ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) (local-vars (sv-16 res-tag)) (let ((s4-0 arg0) (s5-0 arg1) @@ -121,21 +121,21 @@ (let ((v1-0 (-> s5-0 length)) (s3-0 (-> s4-0 max-lod)) ) - (set! (-> obj max-lod) s3-0) + (set! (-> this max-lod) s3-0) (dotimes (a0-1 (+ s3-0 1)) (when (or (>= (-> s4-0 mgeo a0-1) v1-0) (begin (set! arg0 (the-as skeleton-group (-> s5-0 data (-> s4-0 mgeo a0-1)))) (!= (-> (the-as art-element arg0) type) merc-ctrl) ) ) - (set! obj (the-as lod-set #f)) + (set! this (the-as lod-set #f)) (goto cfg-16) ) - (set! (-> obj lod a0-1 geo) (the-as merc-ctrl arg0)) - (set! (-> obj lod a0-1 dist) (-> s4-0 lod-dist a0-1)) + (set! (-> this lod a0-1 geo) (the-as merc-ctrl arg0)) + (set! (-> this lod a0-1 dist) (-> s4-0 lod-dist a0-1)) ) - (if (= (-> obj lod s3-0 dist) 4095996000.0) - (set! (-> obj lod s3-0 dist) (res-lump-float arg2 'vis-dist :default 4095996000.0)) + (if (= (-> this lod s3-0 dist) 4095996000.0) + (set! (-> this lod s3-0 dist) (res-lump-float arg2 'vis-dist :default 4095996000.0)) ) ) (let ((v1-13 (-> s5-0 data (-> s4-0 jgeo)))) @@ -143,14 +143,14 @@ (let ((v1-14 (res-lump-data (-> v1-13 extra) 'lod-dist pointer :tag-ptr (& sv-16)))) (when v1-14 (dotimes (a0-6 (the-as int (-> sv-16 elt-count))) - (set! (-> obj lod a0-6 dist) (-> (the-as (pointer float) (&+ v1-14 (* a0-6 4))))) + (set! (-> this lod a0-6 dist) (-> (the-as (pointer float) (&+ v1-14 (* a0-6 4))))) ) ) ) ) ) (label cfg-16) - obj + this ) ;; definition for symbol *default-skel-template*, type pair @@ -282,33 +282,33 @@ ;; definition for method 17 of type process-drawable ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod do-joint-math! process-drawable ((obj process-drawable)) +(defmethod do-joint-math! process-drawable ((this process-drawable)) (cond - ((logtest? (-> obj draw status) (draw-status hidden no-anim)) + ((logtest? (-> this draw status) (draw-status hidden no-anim)) ) - ((zero? (-> obj skel)) + ((zero? (-> this skel)) (matrix<-transformq+trans! - (the-as matrix (-> obj draw skeleton bones 3)) - (the-as transformq (-> obj root trans)) - (-> obj draw skeleton bones 0 transform vector 3) + (the-as matrix (-> this draw skeleton bones 3)) + (the-as transformq (-> this root trans)) + (-> this draw skeleton bones 0 transform vector 3) ) - (set! (-> obj draw origin quad) (-> obj draw skeleton bones 3 transform vector 3 quad)) + (set! (-> this draw origin quad) (-> this draw skeleton bones 3 transform vector 3 quad)) ) (else - (let ((s5-0 (-> obj draw mgeo num-joints))) + (let ((s5-0 (-> this draw mgeo num-joints))) (let ((s4-0 (+ s5-0 2))) (+ s4-0 1) - ((-> obj skel generate-frame-function) + ((-> this skel generate-frame-function) (the-as (inline-array vector) (-> (the-as terrain-context #x70000000) work foreground joint-work mtx-acc)) s4-0 - obj + this ) - (if (-> obj skel prebind-function) - ((-> obj skel prebind-function) (the-as pointer (+ 2416 #x70000000)) s4-0 obj) + (if (-> this skel prebind-function) + ((-> this skel prebind-function) (the-as pointer (+ 2416 #x70000000)) s4-0 this) ) ) (dotimes (s4-1 1) - (let* ((v1-25 (-> obj node-list data s4-1)) + (let* ((v1-25 (-> this node-list data s4-1)) (t9-3 (-> v1-25 param0)) ) (if t9-3 @@ -317,7 +317,7 @@ ) ) (dotimes (s4-2 2) - (let* ((a0-15 (-> obj node-list data (+ s4-2 1))) + (let* ((a0-15 (-> this node-list data (+ s4-2 1))) (a1-5 (+ (* s4-2 64) 2416 #x70000000)) (t9-4 (-> a0-15 param0)) ) @@ -328,7 +328,7 @@ ) (let ((s4-3 3)) (dotimes (s3-0 s5-0) - (let ((a0-17 (-> obj node-list data (+ s3-0 s4-3))) + (let ((a0-17 (-> this node-list data (+ s3-0 s4-3))) (a1-7 (+ (* 48 s3-0) 2544 #x70000000)) ) (if (-> a0-17 param0) @@ -339,19 +339,19 @@ ) ) ) - (if (-> obj skel postbind-function) - ((-> obj skel postbind-function) obj) + (if (-> this skel postbind-function) + ((-> this skel postbind-function) this) ) - (let ((v1-54 (-> obj draw origin-joint-index))) + (let ((v1-54 (-> this draw origin-joint-index))) (if (zero? v1-54) - (set! (-> obj draw origin quad) + (set! (-> this draw origin quad) (-> (the-as (pointer uint128) - (+ (the-as uint (-> obj draw skeleton bones 0 transform vector 3)) (* (the-as uint 96) v1-54)) + (+ (the-as uint (-> this draw skeleton bones 0 transform vector 3)) (* (the-as uint 96) v1-54)) ) ) ) - (vector<-cspace! (-> obj draw origin) (-> obj node-list data v1-54)) + (vector<-cspace! (-> this draw origin) (-> this node-list data v1-54)) ) ) ) @@ -362,14 +362,14 @@ ;; definition for method 18 of type process-drawable ;; INFO: Return type mismatch int vs none. -(defmethod cleanup-for-death process-drawable ((obj process-drawable)) - (if (type-type? (-> obj root type) collide-shape) - (clear-collide-with-as (the-as collide-shape (-> obj root))) +(defmethod cleanup-for-death process-drawable ((this process-drawable)) + (if (type-type? (-> this root type) collide-shape) + (clear-collide-with-as (the-as collide-shape (-> this root))) ) - (if (nonzero? (-> obj skel)) + (if (nonzero? (-> this skel)) (ja-channel-set! 0) ) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -385,14 +385,14 @@ ) ;; definition for method 10 of type process-drawable -(defmethod deactivate process-drawable ((obj process-drawable)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate process-drawable ((this process-drawable)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -427,14 +427,14 @@ ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Stack slot offset 20 signed mismatch ;; INFO: Return type mismatch draw-control vs none. -(defmethod initialize-skeleton process-drawable ((obj process-drawable) (arg0 skeleton-group) (arg1 pair)) +(defmethod initialize-skeleton process-drawable ((this process-drawable) (arg0 skeleton-group) (arg1 pair)) (local-vars (s3-0 draw-control) (sv-16 art-element) (sv-20 int)) (let ((s1-0 (cond ((= (-> arg0 texture-level) 2) (-> *level* level-default) ) - ((-> obj entity) - (-> obj entity extra level) + ((-> this entity) + (-> this entity extra level) ) (else (-> *level* level-default) @@ -455,8 +455,8 @@ (set! s3-0 (the-as draw-control #f)) (goto cfg-59) ) - (let ((v0-3 (new 'process 'draw-control obj (the-as art-joint-geo sv-16)))) - (set! (-> obj draw) v0-3) + (let ((v0-3 (new 'process 'draw-control this (the-as art-joint-geo sv-16)))) + (set! (-> this draw) v0-3) (set! s3-0 v0-3) ) (let ((v1-26 s3-0)) @@ -470,8 +470,8 @@ (set! (-> v1-26 data-format) (the-as uint 1)) (set! (-> v1-26 color-mult quad) (-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad)) (set! (-> v1-26 color-emissive quad) (-> (new 'static 'vector) quad)) - (set! (-> v1-26 level-index) (the-as uint (-> (if (-> obj entity) - (-> obj entity extra level) + (set! (-> v1-26 level-index) (the-as uint (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) index @@ -485,7 +485,7 @@ (let ((v1-28 (-> arg0 shadow))) (when (and (> v1-28 0) (< v1-28 sv-20)) (let ((s0-0 (-> s4-0 data v1-28)) - (v1-32 (res-lump-value (-> obj entity) 'options uint128)) + (v1-32 (res-lump-value (-> this entity) 'options uint128)) ) (if (and (not (logtest? #x20000 v1-32)) (= (-> s0-0 type) shadow-geo)) (set! (-> s3-0 shadow) (the-as shadow-geo s0-0)) @@ -493,7 +493,7 @@ ) ) ) - (if (not (setup-lods! (-> s3-0 lod-set) arg0 s4-0 (-> obj entity))) + (if (not (setup-lods! (-> s3-0 lod-set) arg0 s4-0 (-> this entity))) (go process-drawable-art-error "mesh") ) (let ((v1-43 (res-lump-value (-> sv-16 extra) 'texture-bucket int :default (the-as uint128 1)))) @@ -513,17 +513,17 @@ (set! (-> s3-0 sink-group) (-> s1-0 foreground-sink-group v1-43)) ) (set! (-> s3-0 dma-add-func) (the-as (function process-drawable draw-control symbol object none) nothing)) - (set! (-> obj node-list) (make-nodes-from-jg (the-as art-joint-geo sv-16) arg1 'process)) + (set! (-> this node-list) (make-nodes-from-jg (the-as art-joint-geo sv-16) arg1 'process)) (set! (-> s3-0 dma-add-func) dma-add-process-drawable) - (set! (-> s3-0 shadow-mask) (res-lump-value (-> obj entity) 'shadow-mask uint)) - (set! (-> s3-0 light-index) (res-lump-value (-> obj entity) 'light-index uint)) + (set! (-> s3-0 shadow-mask) (res-lump-value (-> this entity) 'shadow-mask uint)) + (set! (-> s3-0 light-index) (res-lump-value (-> this entity) 'light-index uint)) (lod-set! s3-0 0) (let ((a2-10 (res-lump-value (-> sv-16 extra) 'joint-channel int :default (the-as uint128 6)))) (cond ((> a2-10 0) (logior! (-> s3-0 status) (draw-status has-joint-channels)) (let ((v0-13 (new 'process 'joint-control a2-10))) - (set! (-> obj skel) v0-13) + (set! (-> this skel) v0-13) (let ((s2-1 v0-13)) (cond ((>= (-> arg0 janim) 0) @@ -533,7 +533,7 @@ (goto cfg-59) ) (ja-channel-set! 1) - (let ((s1-1 (-> obj skel root-channel 0))) + (let ((s1-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s1-1 (the-as art-joint-anim (-> s4-0 data (-> arg0 janim))) @@ -546,7 +546,7 @@ (ja-channel-set! 0) ) ) - (set! (-> s2-1 effect) (new 'process 'effect-control obj)) + (set! (-> s2-1 effect) (new 'process 'effect-control this)) ) ) ) @@ -569,7 +569,7 @@ ) ) ) - (let ((gp-1 (the-as collide-shape (-> (the-as collide-shape obj) dir-targ x)))) + (let ((gp-1 (the-as collide-shape (-> (the-as collide-shape this) dir-targ x)))) (if (and gp-1 (nonzero? gp-1) (type-type? (-> gp-1 type) collide-shape)) (find-collision-meshes gp-1) ) @@ -579,34 +579,34 @@ ) ;; definition for method 15 of type process-drawable -(defmethod initialize-skeleton-by-name process-drawable ((obj process-drawable) (arg0 string) (arg1 object)) +(defmethod initialize-skeleton-by-name process-drawable ((this process-drawable) (arg0 string) (arg1 object)) (let ((s3-0 string->symbol)) (format (clear *temp-string*) "*~S-sg*" arg0) (let ((s3-1 (-> (s3-0 *temp-string*) value))) (if (and (nonzero? s3-1) (valid? s3-1 skeleton-group #f #f 0)) - (initialize-skeleton obj (the-as skeleton-group s3-1) (the-as pair arg1)) + (initialize-skeleton this (the-as skeleton-group s3-1) (the-as pair arg1)) (go process-drawable-art-error arg0) ) ) ) - obj + this ) ;; definition for method 16 of type process-drawable ;; INFO: Return type mismatch trsqv vs collide-shape. -(defmethod apply-alignment process-drawable ((obj process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment process-drawable ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) - (let* ((body-T-world (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat))) + (let* ((body-T-world (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (world-T-body (matrix-transpose! (new 'stack-no-clear 'matrix) body-T-world)) (grav-rt-body (vector-matrix*! (new 'stack-no-clear 'vector) (-> *standard-dynamics* gravity) world-T-body)) - (vel-rt-body (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj root transv) world-T-body)) + (vel-rt-body (vector-matrix*! (new 'stack-no-clear 'vector) (-> this root transv) world-T-body)) ) (if (logtest? arg0 (align-opts no-gravity)) (set-vector! grav-rt-body 0.0 0.0 0.0 1.0) ) (when (logtest? arg0 (align-opts adjust-x-vel)) (set! (-> vel-rt-body x) (+ (* (-> arg1 trans x) (-> arg2 x) (-> *display* frames-per-second)) - (* (-> grav-rt-body x) (-> *display* seconds-per-frame)) + (* (-> grav-rt-body x) (seconds-per-frame)) ) ) (if (not (logtest? arg0 (align-opts adjust-xz-vel keep-other-velocities))) @@ -617,26 +617,26 @@ (not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0))) ) (set! (-> vel-rt-body y) (+ (* (-> arg1 trans y) (-> arg2 y) (-> *display* frames-per-second)) - (* (-> grav-rt-body y) (-> *display* seconds-per-frame)) + (* (-> grav-rt-body y) (seconds-per-frame)) ) ) ) (when (logtest? arg0 (align-opts adjust-xz-vel)) (set! (-> vel-rt-body z) (+ (* (-> arg1 trans z) (-> arg2 z) (-> *display* frames-per-second)) - (* (-> grav-rt-body z) (-> *display* seconds-per-frame)) + (* (-> grav-rt-body z) (seconds-per-frame)) ) ) (if (not (logtest? arg0 (align-opts adjust-x-vel keep-other-velocities))) (set! (-> vel-rt-body x) 0.0) ) ) - (vector-matrix*! (-> obj root transv) vel-rt-body body-T-world) + (vector-matrix*! (-> this root transv) vel-rt-body body-T-world) ) ) (if (logtest? arg0 (align-opts adjust-quat)) - (quaternion-normalize! (quaternion*! (-> obj root quat) (-> obj root quat) (-> arg1 quat))) + (quaternion-normalize! (quaternion*! (-> this root quat) (-> this root quat) (-> arg1 quat))) ) - (the-as collide-shape (-> obj root)) + (the-as collide-shape (-> this root)) ) ;; definition for function ja-done? @@ -724,7 +724,7 @@ (set! (-> self skel blend-index) -1) (set! (-> self skel root-channel 0 frame-group) #f) (dotimes (v1-6 arg0) - (set! (-> self skel root-channel v1-6 eval-time) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self skel root-channel v1-6 eval-time) (the-as uint (current-time))) (set! (-> self skel root-channel v1-6 group-sub-index) v1-6) (set! (-> self skel root-channel v1-6 command) (if (zero? v1-6) 'push @@ -773,7 +773,7 @@ ) (set! (-> self skel active-channels) (+ arg0 1 (-> self skel active-channels))) (dotimes (v1-26 arg0) - (set! (-> self skel root-channel v1-26 eval-time) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self skel root-channel v1-26 eval-time) (the-as uint (current-time))) (set! (-> self skel root-channel v1-26 group-sub-index) v1-26) (set! (-> self skel root-channel v1-26 command) (if (zero? v1-26) 'push @@ -787,7 +787,7 @@ (set! (-> self skel root-channel v1-26 group-size) arg0) ) (let ((v1-31 (-> self skel root-channel arg0))) - (set! (-> v1-31 eval-time) (the-as uint (-> *display* base-frame-counter))) + (set! (-> v1-31 eval-time) (the-as uint (current-time))) (set! (-> v1-31 group-sub-index) arg0) (set! (-> self skel blend-index) (+ (-> self skel active-channels) -1)) (set! (-> v1-31 frame-interp) 0.0) @@ -858,7 +858,7 @@ (defbehavior ja-eval process-drawable () (let ((gp-0 (-> self skel root-channel 0)) (s5-0 (-> self skel channel (-> self skel active-channels))) - (s4-0 (-> *display* base-frame-counter)) + (s4-0 (current-time)) ) (while (< (the-as int gp-0) (the-as int s5-0)) (case (-> gp-0 command) @@ -880,7 +880,7 @@ (defbehavior ja-blend-eval process-drawable () (let ((gp-0 (-> self skel root-channel)) (s5-0 (the-as joint-control-channel (-> self skel channel))) - (s4-0 (-> *display* base-frame-counter)) + (s4-0 (current-time)) ) (when (and (nonzero? (-> self skel active-channels)) (!= gp-0 s5-0)) (while (< (the-as int s5-0) (the-as int gp-0)) @@ -904,12 +904,12 @@ ;; INFO: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod evaluate-joint-control process-drawable ((obj process-drawable)) +(defmethod evaluate-joint-control process-drawable ((this process-drawable)) (local-vars (s7-0 none) (ra-0 int)) - (let ((gp-0 (-> obj skel))) + (let ((gp-0 (-> this skel))) (label cfg-1) (let ((s4-0 (-> gp-0 active-channels))) - (b! (logtest? (-> obj draw status) (draw-status hidden)) cfg-27 :delay (empty-form)) + (b! (logtest? (-> this draw status) (draw-status hidden)) cfg-27 :delay (empty-form)) (let ((s3-0 0)) (b! #t cfg-13 :delay (nop!)) (label cfg-3) @@ -949,14 +949,14 @@ (set! (-> gp-0 channel v1-26 frame-interp) (fmax 0.0 (fmin 1.0 (-> gp-0 channel v1-26 frame-interp)))) ) (if (or (zero? s4-0) (not (-> gp-0 root-channel 0 frame-group))) - (logior! (-> obj draw status) (draw-status no-anim)) + (logior! (-> this draw status) (draw-status no-anim)) ) ) - (if (logtest? (-> obj skel status) (janim-status blerc blerc-done)) - (merc-blend-shape obj) + (if (logtest? (-> this skel status) (janim-status blerc blerc-done)) + (merc-blend-shape this) ) - (if (logtest? (-> obj skel status) (janim-status eye-done eye)) - (merc-eye-anim obj) + (if (logtest? (-> this skel status) (janim-status eye-done eye)) + (merc-eye-anim this) ) (label cfg-27) (let ((a0-17 (-> gp-0 effect))) @@ -997,11 +997,11 @@ ) ;; definition for method 9 of type joint-control -(defmethod current-cycle-distance joint-control ((obj joint-control)) +(defmethod current-cycle-distance joint-control ((this joint-control)) (cond - ((< (the-as int (-> obj root-channel)) (the-as int (-> obj channel (-> obj active-channels)))) - (let ((s5-0 (-> obj root-channel (-> obj root-channel 0 group-size))) - (s4-0 (the-as joint-control-channel (-> obj root-channel))) + ((< (the-as int (-> this root-channel)) (the-as int (-> this channel (-> this active-channels)))) + (let ((s5-0 (-> this root-channel (-> this root-channel 0 group-size))) + (s4-0 (the-as joint-control-channel (-> this root-channel))) (gp-0 (the-as (pointer float) (new 'stack-no-clear 'vector))) ) (while (< (the-as int s4-0) (the-as int s5-0)) @@ -1081,7 +1081,7 @@ ) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-grab? *target*) (while (or (-> *setting-control* current talking) (-> *setting-control* current spooling) @@ -1090,7 +1090,7 @@ ) (suspend) ) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) arg0) + (while (not (time-elapsed? (-> self state-time) arg0)) (suspend) ) (process-release? *target*) diff --git a/test/decompiler/reference/jak1/engine/engine/connect_REF.gc b/test/decompiler/reference/jak1/engine/engine/connect_REF.gc index 5cae71d49d..c0d38ed5a5 100644 --- a/test/decompiler/reference/jak1/engine/engine/connect_REF.gc +++ b/test/decompiler/reference/jak1/engine/engine/connect_REF.gc @@ -14,13 +14,13 @@ ) ;; definition for method 3 of type connectable -(defmethod inspect connectable ((obj connectable)) - (format #t "[~8x] ~A~%" obj 'connectable) - (format #t "~Tnext0: ~`connectable`P~%" (-> obj next0)) - (format #t "~Tprev0: ~`connectable`P~%" (-> obj prev0)) - (format #t "~Tnext1: ~`connectable`P~%" (-> obj next1)) - (format #t "~Tprev1: ~`connectable`P~%" (-> obj prev1)) - obj +(defmethod inspect connectable ((this connectable)) + (format #t "[~8x] ~A~%" this 'connectable) + (format #t "~Tnext0: ~`connectable`P~%" (-> this next0)) + (format #t "~Tprev0: ~`connectable`P~%" (-> this prev0)) + (format #t "~Tnext1: ~`connectable`P~%" (-> this next1)) + (format #t "~Tprev1: ~`connectable`P~%" (-> this prev1)) + this ) ;; definition of type connection @@ -44,18 +44,18 @@ ) ;; definition for method 3 of type connection -(defmethod inspect connection ((obj connection)) - (format #t "[~8x] ~A~%" obj 'connection) - (format #t "~Tnext0: ~`connectable`P~%" (-> obj next0)) - (format #t "~Tprev0: ~`connectable`P~%" (-> obj prev0)) - (format #t "~Tnext1: ~`connectable`P~%" (-> obj next1)) - (format #t "~Tprev1: ~`connectable`P~%" (-> obj prev1)) - (format #t "~Tparam0: ~A~%" (-> obj param0)) - (format #t "~Tparam1: ~A~%" (-> obj param1)) - (format #t "~Tparam2: ~A~%" (-> obj param2)) - (format #t "~Tparam3: ~A~%" (-> obj param3)) - (format #t "~Tquad[2] @ #x~X~%" (&-> obj next0)) - obj +(defmethod inspect connection ((this connection)) + (format #t "[~8x] ~A~%" this 'connection) + (format #t "~Tnext0: ~`connectable`P~%" (-> this next0)) + (format #t "~Tprev0: ~`connectable`P~%" (-> this prev0)) + (format #t "~Tnext1: ~`connectable`P~%" (-> this next1)) + (format #t "~Tprev1: ~`connectable`P~%" (-> this prev1)) + (format #t "~Tparam0: ~A~%" (-> this param0)) + (format #t "~Tparam1: ~A~%" (-> this param1)) + (format #t "~Tparam2: ~A~%" (-> this param2)) + (format #t "~Tparam3: ~A~%" (-> this param3)) + (format #t "~Tquad[2] @ #x~X~%" (&-> this next0)) + this ) ;; definition of type engine @@ -94,170 +94,170 @@ ) ;; definition for method 12 of type connection -(defmethod belongs-to-process? connection ((obj connection) (arg0 process)) - (= arg0 (get-process obj)) +(defmethod belongs-to-process? connection ((this connection) (arg0 process)) + (= arg0 (get-process this)) ) ;; definition for method 2 of type connection -(defmethod print connection ((obj connection)) +(defmethod print connection ((this connection)) (format #t "#" - (-> obj param0) - (-> obj param1) - (-> obj param2) - (-> obj param3) - obj + (-> this param0) + (-> this param1) + (-> this param2) + (-> this param3) + this ) - obj + this ) ;; definition for method 9 of type connection ;; INFO: Return type mismatch pointer vs engine. -(defmethod get-engine connection ((obj connection)) - (while (-> (the-as connectable obj) prev0) +(defmethod get-engine connection ((this connection)) + (while (-> (the-as connectable this) prev0) (nop!) (nop!) - (set! obj (the-as connection (-> (the-as connectable obj) prev0))) + (set! this (the-as connection (-> (the-as connectable this) prev0))) ) - (the-as engine (&+ (the-as pointer obj) -28)) + (the-as engine (&+ (the-as pointer this) -28)) ) ;; definition for method 10 of type connection ;; INFO: Return type mismatch pointer vs process. -(defmethod get-process connection ((obj connection)) - (while (-> (the-as connectable obj) prev1) +(defmethod get-process connection ((this connection)) + (while (-> (the-as connectable this) prev1) (nop!) (nop!) - (set! obj (the-as connection (-> (the-as connectable obj) prev1))) + (set! this (the-as connection (-> (the-as connectable this) prev1))) ) - (the-as process (&+ (the-as pointer obj) -92)) + (the-as process (&+ (the-as pointer this) -92)) ) ;; definition for method 11 of type connection -(defmethod belongs-to-engine? connection ((obj connection) (arg0 engine)) - (and (< (the-as int arg0) (the-as int obj)) - (< (the-as int obj) (the-as int (-> arg0 data (-> arg0 allocated-length)))) +(defmethod belongs-to-engine? connection ((this connection) (arg0 engine)) + (and (< (the-as int arg0) (the-as int this)) + (< (the-as int this) (the-as int (-> arg0 data (-> arg0 allocated-length)))) ) ) ;; definition for method 21 of type engine -(defmethod get-first-connectable engine ((obj engine)) - (-> obj alive-list next0) +(defmethod get-first-connectable engine ((this engine)) + (-> this alive-list next0) ) ;; definition for method 22 of type engine -(defmethod get-last-connectable engine ((obj engine)) - (-> obj alive-list-end) +(defmethod get-last-connectable engine ((this engine)) + (-> this alive-list-end) ) ;; definition for method 23 of type engine -(defmethod unknown-1 engine ((obj engine) (arg0 (pointer uint32))) +(defmethod unknown-1 engine ((this engine) (arg0 (pointer uint32))) (-> arg0 0) ) ;; definition for method 0 of type engine (defmethod new engine ((allocation symbol) (type-to-make type) (name basic) (length int)) - (let ((obj (the-as - object - (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ length -1) 32)))) - ) - ) + (let ((this (the-as + object + (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ length -1) 32)))) + ) + ) ) - (set! (-> (the-as engine obj) allocated-length) length) - (set! (-> (the-as engine obj) length) 0) - (set! (-> (the-as engine obj) name) name) - (set! (-> (the-as engine obj) alive-list next0) (-> (the-as engine obj) alive-list-end)) - (set! (-> (the-as engine obj) alive-list prev0) #f) - (set! (-> (the-as engine obj) alive-list next1) #f) - (set! (-> (the-as engine obj) alive-list prev1) #f) - (set! (-> (the-as engine obj) alive-list-end next0) #f) - (set! (-> (the-as engine obj) alive-list-end prev0) (-> (the-as engine obj) alive-list)) - (set! (-> (the-as engine obj) alive-list-end next1) #f) - (set! (-> (the-as engine obj) alive-list-end prev1) #f) - (set! (-> (the-as engine obj) dead-list next0) (the-as connectable (-> (the-as engine obj) data))) - (set! (-> (the-as engine obj) dead-list prev0) #f) - (set! (-> (the-as engine obj) dead-list next1) #f) - (set! (-> (the-as engine obj) dead-list prev1) #f) - (set! (-> (the-as engine obj) dead-list-end next0) #f) - (set! (-> (the-as engine obj) dead-list-end prev0) (-> (the-as engine obj) data (+ length -1))) - (set! (-> (the-as engine obj) dead-list-end next1) #f) - (set! (-> (the-as engine obj) dead-list-end prev1) #f) - (set! (-> (the-as engine obj) data 0 prev0) (-> (the-as engine obj) dead-list)) - (set! (-> (the-as engine obj) data 0 next0) (the-as connectable (&+ (the-as pointer obj) 124))) + (set! (-> (the-as engine this) allocated-length) length) + (set! (-> (the-as engine this) length) 0) + (set! (-> (the-as engine this) name) name) + (set! (-> (the-as engine this) alive-list next0) (-> (the-as engine this) alive-list-end)) + (set! (-> (the-as engine this) alive-list prev0) #f) + (set! (-> (the-as engine this) alive-list next1) #f) + (set! (-> (the-as engine this) alive-list prev1) #f) + (set! (-> (the-as engine this) alive-list-end next0) #f) + (set! (-> (the-as engine this) alive-list-end prev0) (-> (the-as engine this) alive-list)) + (set! (-> (the-as engine this) alive-list-end next1) #f) + (set! (-> (the-as engine this) alive-list-end prev1) #f) + (set! (-> (the-as engine this) dead-list next0) (the-as connectable (-> (the-as engine this) data))) + (set! (-> (the-as engine this) dead-list prev0) #f) + (set! (-> (the-as engine this) dead-list next1) #f) + (set! (-> (the-as engine this) dead-list prev1) #f) + (set! (-> (the-as engine this) dead-list-end next0) #f) + (set! (-> (the-as engine this) dead-list-end prev0) (-> (the-as engine this) data (+ length -1))) + (set! (-> (the-as engine this) dead-list-end next1) #f) + (set! (-> (the-as engine this) dead-list-end prev1) #f) + (set! (-> (the-as engine this) data 0 prev0) (-> (the-as engine this) dead-list)) + (set! (-> (the-as engine this) data 0 next0) (the-as connectable (&+ (the-as pointer this) 124))) (let ((idx-to-link 1) (end-idx (+ length -2)) ) (while (>= end-idx idx-to-link) - (set! (-> (the-as engine obj) data idx-to-link prev0) (-> (the-as engine obj) data (+ idx-to-link -1))) - (set! (-> (the-as engine obj) data idx-to-link next0) (-> (the-as engine obj) data (+ idx-to-link 1))) + (set! (-> (the-as engine this) data idx-to-link prev0) (-> (the-as engine this) data (+ idx-to-link -1))) + (set! (-> (the-as engine this) data idx-to-link next0) (-> (the-as engine this) data (+ idx-to-link 1))) (+! idx-to-link 1) ) ) - (set! (-> (the-as engine obj) data (+ length -1) prev0) (-> (the-as engine obj) data (+ length -2))) - (set! (-> (the-as engine obj) data (+ length -1) next0) (-> (the-as engine obj) dead-list-end)) - (the-as engine obj) + (set! (-> (the-as engine this) data (+ length -1) prev0) (-> (the-as engine this) data (+ length -2))) + (set! (-> (the-as engine this) data (+ length -1) next0) (-> (the-as engine this) dead-list-end)) + (the-as engine this) ) ) ;; definition for method 2 of type engine -(defmethod print engine ((obj engine)) - (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print engine ((this engine)) + (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) + this ) ;; definition for method 3 of type engine -(defmethod inspect engine ((obj engine)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tengine-time: ~D~%" (-> obj engine-time)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) +(defmethod inspect engine ((this engine)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tengine-time: ~D~%" (-> this engine-time)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) (format #t "~Talive-list:~%") (let ((s5-0 *print-column*)) (set! *print-column* (+ *print-column* 64)) - (inspect (-> obj alive-list)) + (inspect (-> this alive-list)) (set! *print-column* s5-0) ) (format #t "~Talive-list-end:~%") (let ((s5-1 *print-column*)) (set! *print-column* (+ *print-column* 64)) - (inspect (-> obj alive-list-end)) + (inspect (-> this alive-list-end)) (set! *print-column* s5-1) ) (format #t "~Tdead-list:~%") (let ((s5-2 *print-column*)) (set! *print-column* (+ *print-column* 64)) - (inspect (-> obj dead-list)) + (inspect (-> this dead-list)) (set! *print-column* s5-2) ) (format #t "~Tdead-list-end:~%") (let ((s5-3 *print-column*)) (set! *print-column* (+ *print-column* 64)) - (inspect (-> obj dead-list-end)) + (inspect (-> this dead-list-end)) (set! *print-column* s5-3) ) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj data)) - obj + (format #t "~Tdata[~D]: @ #x~X~%" (-> this allocated-length) (-> this data)) + this ) ;; definition for method 4 of type engine -(defmethod length engine ((obj engine)) - (-> obj length) +(defmethod length engine ((this engine)) + (-> this length) ) ;; definition for method 5 of type engine ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of engine ((obj engine)) - (the-as int (+ (-> engine size) (* (+ (-> obj allocated-length) -1) 32))) +(defmethod asize-of engine ((this engine)) + (the-as int (+ (-> engine size) (* (+ (-> this allocated-length) -1) 32))) ) ;; definition for method 10 of type engine -(defmethod apply-to-connections engine ((obj engine) (f (function connectable none))) - (let* ((current (-> obj alive-list next0)) +(defmethod apply-to-connections engine ((this engine) (f (function connectable none))) + (let* ((current (-> this alive-list next0)) (next (-> current next0)) ) - (while (!= current (-> obj alive-list-end)) + (while (!= current (-> this alive-list-end)) (f current) (set! current next) (set! next (-> next next0)) @@ -267,9 +267,9 @@ ) ;; definition for method 11 of type engine -(defmethod apply-to-connections-reverse engine ((obj engine) (f (function connectable none))) - (let ((iter (-> obj alive-list-end prev0))) - (while (!= iter (-> obj alive-list)) +(defmethod apply-to-connections-reverse engine ((this engine) (f (function connectable none))) + (let ((iter (-> this alive-list-end prev0))) + (while (!= iter (-> this alive-list)) (f iter) (set! iter (-> iter prev0)) ) @@ -278,10 +278,10 @@ ) ;; definition for method 12 of type engine -(defmethod execute-connections engine ((obj engine) (arg0 object)) - (set! (-> obj engine-time) (-> *display* real-frame-counter)) - (let ((ct (the-as connection (-> obj alive-list-end prev0)))) - (while (!= ct (-> obj alive-list)) +(defmethod execute-connections engine ((this engine) (arg0 object)) + (set! (-> this engine-time) (-> *display* real-frame-counter)) + (let ((ct (the-as connection (-> this alive-list-end prev0)))) + (while (!= ct (-> this alive-list)) ((the-as (function basic basic basic object object) (-> ct param0)) (the-as basic (-> ct param1)) (the-as basic (-> ct param2)) @@ -295,10 +295,10 @@ ) ;; definition for method 13 of type engine -(defmethod execute-connections-and-move-to-dead engine ((obj engine) (arg0 object)) - (set! (-> obj engine-time) (-> *display* real-frame-counter)) - (let ((ct (the-as connection (-> obj alive-list-end prev0)))) - (while (!= ct (-> obj alive-list)) +(defmethod execute-connections-and-move-to-dead engine ((this engine) (arg0 object)) + (set! (-> this engine-time) (-> *display* real-frame-counter)) + (let ((ct (the-as connection (-> this alive-list-end prev0)))) + (while (!= ct (-> this alive-list)) (let ((result ((the-as (function basic basic basic object object) (-> ct param0)) (the-as basic (-> ct param1)) (the-as basic (-> ct param2)) @@ -318,9 +318,9 @@ ) ;; definition for method 14 of type engine -(defmethod execute-connections-if-needed engine ((obj engine) (arg0 object)) - (if (!= (-> *display* real-frame-counter) (-> obj engine-time)) - (execute-connections obj arg0) +(defmethod execute-connections-if-needed engine ((this engine) (arg0 object)) + (if (!= (-> *display* real-frame-counter) (-> this engine-time)) + (execute-connections this arg0) ) 0 ) @@ -339,53 +339,53 @@ ) ;; definition for method 9 of type engine -(defmethod inspect-all-connections engine ((obj engine)) - (apply-to-connections obj (the-as (function connectable none) (method-of-type connection inspect))) - obj +(defmethod inspect-all-connections engine ((this engine)) + (apply-to-connections this (the-as (function connectable none) (method-of-type connection inspect))) + this ) ;; definition for method 15 of type engine -(defmethod add-connection engine ((obj engine) (proc process) (func object) (p1 object) (p2 object) (p3 object)) - (let ((con (the-as connection (-> obj dead-list next0)))) - (when (not (or (not proc) (= con (-> obj dead-list-end)))) +(defmethod add-connection engine ((this engine) (proc process) (func object) (p1 object) (p2 object) (p3 object)) + (let ((con (the-as connection (-> this dead-list next0)))) + (when (not (or (not proc) (= con (-> this dead-list-end)))) (set! (-> con param0) (the-as basic func)) (set! (-> con param1) (the-as int p1)) (set! (-> con param2) (the-as int p2)) (set! (-> con param3) (the-as int p3)) - (set! (-> obj dead-list next0) (-> con next0)) - (set! (-> con next0 prev0) (-> obj dead-list)) - (set! (-> con next0) (-> obj alive-list next0)) + (set! (-> this dead-list next0) (-> con next0)) + (set! (-> con next0 prev0) (-> this dead-list)) + (set! (-> con next0) (-> this alive-list next0)) (set! (-> con next0 prev0) con) - (set! (-> con prev0) (-> obj alive-list)) - (set! (-> obj alive-list next0) con) + (set! (-> con prev0) (-> this alive-list)) + (set! (-> this alive-list next0) con) (set! (-> con next1) (-> proc connection-list next1)) (if (-> con next1) (set! (-> con next1 prev1) con) ) (set! (-> con prev1) (-> proc connection-list)) (set! (-> proc connection-list next1) con) - (+! (-> obj length) 1) + (+! (-> this length) 1) con ) ) ) ;; definition for method 13 of type connection -(defmethod move-to-dead connection ((obj connection)) - (let ((v1-1 (get-engine obj))) - (set! (-> obj prev0 next0) (-> obj next0)) - (set! (-> obj next0 prev0) (-> obj prev0)) - (set! (-> obj prev1 next1) (-> obj next1)) - (if (-> obj next1) - (set! (-> obj next1 prev1) (-> obj prev1)) +(defmethod move-to-dead connection ((this connection)) + (let ((v1-1 (get-engine this))) + (set! (-> this prev0 next0) (-> this next0)) + (set! (-> this next0 prev0) (-> this prev0)) + (set! (-> this prev1 next1) (-> this next1)) + (if (-> this next1) + (set! (-> this next1 prev1) (-> this prev1)) ) - (set! (-> obj next0) (-> v1-1 dead-list next0)) - (set! (-> obj next0 prev0) obj) - (set! (-> obj prev0) (-> v1-1 dead-list)) - (set! (-> v1-1 dead-list next0) obj) + (set! (-> this next0) (-> v1-1 dead-list next0)) + (set! (-> this next0 prev0) this) + (set! (-> this prev0) (-> v1-1 dead-list)) + (set! (-> v1-1 dead-list next0) this) (+! (-> v1-1 length) -1) ) - obj + this ) ;; definition for function process-disconnect @@ -402,11 +402,11 @@ ) ;; definition for method 16 of type engine -(defmethod remove-from-process engine ((obj engine) (arg0 process)) +(defmethod remove-from-process engine ((this engine) (arg0 process)) (when arg0 (let ((s5-0 (-> arg0 connection-list next1))) (while s5-0 - (if ((method-of-type connection belongs-to-engine?) (the-as connection s5-0) obj) + (if ((method-of-type connection belongs-to-engine?) (the-as connection s5-0) this) ((method-of-type connection move-to-dead) (the-as connection s5-0)) ) (set! s5-0 (-> s5-0 next1)) @@ -417,12 +417,12 @@ ) ;; definition for method 17 of type engine -(defmethod remove-matching engine ((obj engine) (arg0 (function connection engine symbol))) - (let* ((s4-0 (-> obj alive-list next0)) +(defmethod remove-matching engine ((this engine) (arg0 (function connection engine symbol))) + (let* ((s4-0 (-> this alive-list next0)) (s3-0 (-> s4-0 next0)) ) - (while (!= s4-0 (-> obj alive-list-end)) - (if (arg0 (the-as connection s4-0) obj) + (while (!= s4-0 (-> this alive-list-end)) + (if (arg0 (the-as connection s4-0) this) ((method-of-type connection move-to-dead) (the-as connection s4-0)) ) (set! s4-0 s3-0) @@ -433,11 +433,11 @@ ) ;; definition for method 18 of type engine -(defmethod remove-all engine ((obj engine)) - (let* ((a0-1 (-> obj alive-list next0)) +(defmethod remove-all engine ((this engine)) + (let* ((a0-1 (-> this alive-list next0)) (s5-0 (-> a0-1 next0)) ) - (while (!= a0-1 (-> obj alive-list-end)) + (while (!= a0-1 (-> this alive-list-end)) ((method-of-type connection move-to-dead) (the-as connection a0-1)) (set! a0-1 s5-0) (set! s5-0 (-> s5-0 next0)) @@ -447,11 +447,11 @@ ) ;; definition for method 19 of type engine -(defmethod remove-by-param1 engine ((obj engine) (p1-value object)) - (let* ((current (-> obj alive-list next0)) +(defmethod remove-by-param1 engine ((this engine) (p1-value object)) + (let* ((current (-> this alive-list next0)) (next (-> current next0)) ) - (while (!= current (-> obj alive-list-end)) + (while (!= current (-> this alive-list-end)) (if (= (-> (the-as connection current) param1) p1-value) ((method-of-type connection move-to-dead) (the-as connection current)) ) @@ -463,11 +463,11 @@ ) ;; definition for method 20 of type engine -(defmethod remove-by-param2 engine ((obj engine) (p2-value int)) - (let* ((current (-> obj alive-list next0)) +(defmethod remove-by-param2 engine ((this engine) (p2-value int)) + (let* ((current (-> this alive-list next0)) (next (-> current next0)) ) - (while (!= current (-> obj alive-list-end)) + (while (!= current (-> this alive-list-end)) (if (= (-> (the-as connection current) param2) p2-value) ((method-of-type connection move-to-dead) (the-as connection current)) ) diff --git a/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc b/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc index a2502e036b..75575433e8 100644 --- a/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/actor-link-h_REF.gc @@ -64,74 +64,74 @@ ) ;; definition for method 3 of type actor-link-info -(defmethod inspect actor-link-info ((obj actor-link-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tnext: ~A~%" (-> obj next)) - (format #t "~Tprev: ~A~%" (-> obj prev)) - obj +(defmethod inspect actor-link-info ((this actor-link-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tnext: ~A~%" (-> this next)) + (format #t "~Tprev: ~A~%" (-> this prev)) + this ) ;; definition for method 27 of type entity-actor -(defmethod next-actor entity-actor ((obj entity-actor)) - (entity-actor-lookup obj 'next-actor 0) +(defmethod next-actor entity-actor ((this entity-actor)) + (entity-actor-lookup this 'next-actor 0) ) ;; definition for method 28 of type entity-actor -(defmethod prev-actor entity-actor ((obj entity-actor)) - (entity-actor-lookup obj 'prev-actor 0) +(defmethod prev-actor entity-actor ((this entity-actor)) + (entity-actor-lookup this 'prev-actor 0) ) ;; definition for method 0 of type actor-link-info (defmethod new actor-link-info ((allocation symbol) (type-to-make type) (proc process)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj process) proc) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this process) proc) (let ((ent (-> proc entity))) - (set! (-> obj next) (entity-actor-lookup ent 'next-actor 0)) + (set! (-> this next) (entity-actor-lookup ent 'next-actor 0)) ) (let ((a0-2 (-> proc entity))) - (set! (-> obj prev) (entity-actor-lookup a0-2 'prev-actor 0)) + (set! (-> this prev) (entity-actor-lookup a0-2 'prev-actor 0)) ) - obj + this ) ) ;; definition for method 12 of type actor-link-info -(defmethod get-next actor-link-info ((obj actor-link-info)) - (-> obj next) +(defmethod get-next actor-link-info ((this actor-link-info)) + (-> this next) ) ;; definition for method 13 of type actor-link-info -(defmethod get-prev actor-link-info ((obj actor-link-info)) - (-> obj prev) +(defmethod get-prev actor-link-info ((this actor-link-info)) + (-> this prev) ) ;; definition for method 14 of type actor-link-info ;; INFO: Return type mismatch basic vs process. -(defmethod get-next-process actor-link-info ((obj actor-link-info)) - (the-as process (and (-> obj next) (-> (the-as entity-links (-> obj next extra)) process))) +(defmethod get-next-process actor-link-info ((this actor-link-info)) + (the-as process (and (-> this next) (-> (the-as entity-links (-> this next extra)) process))) ) ;; definition for method 15 of type actor-link-info ;; INFO: Return type mismatch basic vs process. -(defmethod get-prev-process actor-link-info ((obj actor-link-info)) - (the-as process (and (-> obj prev) (-> (the-as entity-links (-> obj prev extra)) process))) +(defmethod get-prev-process actor-link-info ((this actor-link-info)) + (the-as process (and (-> this prev) (-> (the-as entity-links (-> this prev extra)) process))) ) ;; definition for method 11 of type actor-link-info -(defmethod link-to-next-and-prev-actor actor-link-info ((obj actor-link-info)) - (let ((a0-1 (-> obj process entity))) - (set! (-> obj next) (entity-actor-lookup a0-1 'next-actor 0)) +(defmethod link-to-next-and-prev-actor actor-link-info ((this actor-link-info)) + (let ((a0-1 (-> this process entity))) + (set! (-> this next) (entity-actor-lookup a0-1 'next-actor 0)) ) - (let ((a0-2 (-> obj process entity))) - (set! (-> obj prev) (entity-actor-lookup a0-2 'prev-actor 0)) + (let ((a0-2 (-> this process entity))) + (set! (-> this prev) (entity-actor-lookup a0-2 'prev-actor 0)) ) - (-> obj next) + (-> this next) ) ;; definition for method 16 of type actor-link-info -(defmethod apply-function-forward actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) - (let ((s3-0 (-> obj next))) +(defmethod apply-function-forward actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s3-0 (-> this next))) (while s3-0 (if (arg0 s3-0 arg1) (return (the-as int #f)) @@ -143,8 +143,8 @@ ) ;; definition for method 17 of type actor-link-info -(defmethod apply-function-reverse actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) - (let ((s3-0 (-> obj prev))) +(defmethod apply-function-reverse actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s3-0 (-> this prev))) (while s3-0 (if (arg0 s3-0 arg1) (return (the-as int #f)) @@ -156,8 +156,8 @@ ) ;; definition for method 18 of type actor-link-info -(defmethod apply-all actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) - (let ((s4-0 (-> obj process entity))) +(defmethod apply-all actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s4-0 (-> this process entity))) (while (let ((a0-2 s4-0)) (entity-actor-lookup a0-2 'prev-actor 0) ) @@ -176,9 +176,9 @@ ) ;; definition for method 20 of type actor-link-info -(defmethod send-to-all-after actor-link-info ((obj actor-link-info) (message symbol)) +(defmethod send-to-all-after actor-link-info ((this actor-link-info) (message symbol)) (with-pp - (let ((iter (-> obj next)) + (let ((iter (-> this next)) (result (the-as object #f)) ) (while iter @@ -200,9 +200,9 @@ ) ;; definition for method 21 of type actor-link-info -(defmethod send-to-all-before actor-link-info ((obj actor-link-info) (arg0 symbol)) +(defmethod send-to-all-before actor-link-info ((this actor-link-info) (arg0 symbol)) (with-pp - (let ((s4-0 (-> obj prev)) + (let ((s4-0 (-> this prev)) (s5-0 (the-as object #f)) ) (while s4-0 @@ -225,8 +225,8 @@ ;; definition for method 23 of type actor-link-info ;; INFO: Return type mismatch int vs none. -(defmethod send-to-next actor-link-info ((obj actor-link-info) (arg0 symbol)) - (let ((a0-1 (-> obj next))) +(defmethod send-to-next actor-link-info ((this actor-link-info) (arg0 symbol)) + (let ((a0-1 (-> this next))) (when a0-1 (let ((a0-2 (-> (the-as entity-links (-> a0-1 extra)) process))) (if a0-2 @@ -241,8 +241,8 @@ ;; definition for method 24 of type actor-link-info ;; INFO: Return type mismatch int vs none. -(defmethod send-to-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) - (let ((a0-1 (-> obj prev))) +(defmethod send-to-prev actor-link-info ((this actor-link-info) (arg0 symbol)) + (let ((a0-1 (-> this prev))) (when a0-1 (let ((a0-2 (-> (the-as entity-links (-> a0-1 extra)) process))) (if a0-2 @@ -256,23 +256,23 @@ ) ;; definition for method 22 of type actor-link-info -(defmethod send-to-next-and-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) - (send-to-next obj arg0) - (send-to-prev obj arg0) +(defmethod send-to-next-and-prev actor-link-info ((this actor-link-info) (arg0 symbol)) + (send-to-next this arg0) + (send-to-prev this arg0) (none) ) ;; definition for method 19 of type actor-link-info ;; INFO: Return type mismatch object vs none. -(defmethod send-to-all actor-link-info ((obj actor-link-info) (arg0 symbol)) - (send-to-all-after obj arg0) - (send-to-all-before obj arg0) +(defmethod send-to-all actor-link-info ((this actor-link-info) (arg0 symbol)) + (send-to-all-after this arg0) + (send-to-all-before this arg0) (none) ) ;; definition for method 25 of type actor-link-info -(defmethod actor-count actor-link-info ((obj actor-link-info)) - (let ((actor (-> obj process entity)) +(defmethod actor-count actor-link-info ((this actor-link-info)) + (let ((actor (-> this process entity)) (count 0) ) (while (let ((a0-2 actor)) @@ -291,8 +291,8 @@ ) ;; definition for method 9 of type actor-link-info -(defmethod get-matching-actor-type-mask actor-link-info ((obj actor-link-info) (matching-type type)) - (let ((actor (-> obj process entity)) +(defmethod get-matching-actor-type-mask actor-link-info ((this actor-link-info) (matching-type type)) + (let ((actor (-> this process entity)) (mask 0) ) (let ((current-bit 1)) @@ -316,8 +316,8 @@ ) ;; definition for method 10 of type actor-link-info -(defmethod actor-count-before actor-link-info ((obj actor-link-info)) - (let* ((this-actor (-> obj process entity)) +(defmethod actor-count-before actor-link-info ((this actor-link-info)) + (let* ((this-actor (-> this process entity)) (actor this-actor) (count 0) ) diff --git a/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc b/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc index 5468348785..4ab3ca8f04 100644 --- a/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/ambient_REF.gc @@ -3,21 +3,21 @@ ;; definition for method 8 of type drawable-ambient ;; INFO: Return type mismatch int vs drawable-ambient. -(defmethod mem-usage drawable-ambient ((obj drawable-ambient) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-ambient ((this drawable-ambient) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 50 (-> arg0 length))) (set! (-> arg0 data 49 name) "ambient") (+! (-> arg0 data 49 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 49 used) v1-6) (+! (-> arg0 data 49 total) (logand -16 (+ v1-6 15))) ) - (mem-usage (-> obj ambient) arg0 (logior arg1 128)) + (mem-usage (-> this ambient) arg0 (logior arg1 128)) (the-as drawable-ambient 0) ) ;; definition for method 8 of type drawable-inline-array-ambient ;; INFO: Return type mismatch int vs drawable-inline-array-ambient. -(defmethod mem-usage drawable-inline-array-ambient ((obj drawable-inline-array-ambient) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-ambient ((this drawable-inline-array-ambient) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -25,8 +25,8 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) (the-as drawable-inline-array-ambient 0) ) @@ -217,7 +217,7 @@ ;; definition for function level-hint-surpress! ;; INFO: Return type mismatch int vs none. (defun level-hint-surpress! () - (set! (-> *game-info* hint-play-time) (-> *display* base-frame-counter)) + (set-time! (-> *game-info* hint-play-time)) 0 (none) ) @@ -225,10 +225,7 @@ ;; definition for function can-grab-display? (defun can-grab-display? ((arg0 process)) (let ((v1-2 (handle->process (-> *game-info* display-text-handle)))) - (when (and (or (not v1-2) - (= v1-2 arg0) - (>= (- (-> *display* base-frame-counter) (-> *game-info* display-text-time)) (seconds 0.1)) - ) + (when (and (or (not v1-2) (= v1-2 arg0) (time-elapsed? (-> *game-info* display-text-time) (seconds 0.1))) (and *target* (!= (-> *target* next-state name) 'target-look-around) (not (logtest? (-> *target* state-flags) (state-flags being-attacked dying))) @@ -236,7 +233,7 @@ ) ) (set! (-> *game-info* display-text-handle) (process->handle arg0)) - (set! (-> *game-info* display-text-time) (-> *display* base-frame-counter)) + (set-time! (-> *game-info* display-text-time)) #t ) ) @@ -309,7 +306,7 @@ (set! (-> self sound-to-play) arg1) (set! (-> self total-time) 0) (set! (-> self total-off-time) 0) - (set! (-> self last-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-time)) (set! *hint-semaphore* (the-as (pointer level-hint) (process->ppointer self))) (add-setting! 'hint (process->ppointer self) 0.0 0) (set! (-> self voicebox) (the-as handle #f)) @@ -351,7 +348,7 @@ (set! (-> self sound-to-play) arg0) (set! (-> self total-time) 0) (set! (-> self total-off-time) 0) - (set! (-> self last-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-time)) (set! (-> self trans) arg1) (set! *hint-semaphore* (the-as (pointer level-hint) (process->ppointer self))) (add-setting! 'hint (process->ppointer self) 0.0 0) @@ -379,7 +376,7 @@ ;; definition for method 14 of type level-hint ;; INFO: Return type mismatch int vs none. -(defmethod print-text level-hint ((obj level-hint)) +(defmethod print-text level-hint ((this level-hint)) (when (!= *common-text* #f) (let ((s5-0 (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)) @@ -392,7 +389,7 @@ (set! (-> v1-4 height) (the float 96)) ) (set! (-> s5-0 flags) (font-flags shadow kerning middle large)) - (print-game-text (lookup-text! *common-text* (-> obj text-id-to-display) #f) s5-0 #f 128 22) + (print-game-text (lookup-text! *common-text* (-> this text-id-to-display) #f) s5-0 #f 128 22) ) ) 0 @@ -400,8 +397,8 @@ ) ;; definition for method 15 of type level-hint -(defmethod appeared-for-long-enough? level-hint ((obj level-hint)) - (and (!= (-> obj next-state name) 'level-hint-sidekick) (< (seconds 5) (-> obj total-time))) +(defmethod appeared-for-long-enough? level-hint ((this level-hint)) + (and (!= (-> this next-state name) 'level-hint-sidekick) (< (seconds 5) (-> this total-time))) ) ;; failed to figure out what this is: @@ -441,17 +438,17 @@ (not (-> *hud-parts* money-all)) ) (print-text self) - (+! (-> self total-time) (- (-> *display* base-frame-counter) (-> self last-time))) - (set! (-> self last-time) (-> *display* base-frame-counter)) + (+! (-> self total-time) (- (current-time) (-> self last-time))) + (set-time! (-> self last-time)) ) (else - (+! (-> self total-off-time) (- (-> *display* base-frame-counter) (-> self last-time))) + (+! (-> self total-off-time) (- (current-time) (-> self last-time))) (if (or (< (seconds 6) (-> self total-time)) (< (seconds 10) (-> self total-off-time))) (go level-hint-exit) ) ) ) - (set! (-> self last-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-time)) ) ) ) @@ -509,8 +506,8 @@ (format (clear *temp-string*) "spool-~S" arg0) (let ((s5-2 (s5-1 (s4-1 *temp-string*) (new-sound-id) 1024 0 0 (sound-group sfx) #t))) (set! (-> self sound-id) s5-2) - (let ((s4-3 (-> *display* base-frame-counter))) - (while (and (!= (current-str-id) s5-2) (< (- (-> *display* base-frame-counter) s4-3) (seconds 5))) + (let ((s4-3 (current-time))) + (while (and (!= (current-str-id) s5-2) (not (time-elapsed? s4-3 (seconds 5)))) (suspend) ) ) @@ -571,8 +568,8 @@ ) ) ) - (let ((s5-2 (-> *display* base-frame-counter))) - (while (and (!= (current-str-id) (-> self sound-id)) (< (- (-> *display* base-frame-counter) s5-2) (seconds 5))) + (let ((s5-2 (current-time))) + (while (and (!= (current-str-id) (-> self sound-id)) (not (time-elapsed? s5-2 (seconds 5)))) (suspend) ) ) @@ -599,8 +596,8 @@ :event (-> level-hint-normal event) :code (behavior ((arg0 string) (arg1 string)) (remove-setting! 'hint) - (let ((s4-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s4-0) (seconds 1)) + (let ((s4-0 (current-time))) + (until (time-elapsed? s4-0 (seconds 1)) (when (and *debug-segment* (not (paused?)) (not (str-is-playing?)) (bottom-hud-hidden?)) (let ((s3-0 (new 'stack 'font-context *font-default-matrix* 56 160 0.0 (font-color default) (font-flags shadow kerning)) @@ -711,17 +708,17 @@ (let* ((s5-0 (-> arg0 ambient)) (s4-0 (-> s5-0 ambient-data user-uint64 0)) ) - (when (>= (-> *display* base-frame-counter) (the-as time-frame s4-0)) + (when (>= (current-time) (the-as time-frame s4-0)) (let ((v1-5 (res-lump-data s5-0 'cycle-speed pointer))) (set! (-> s5-0 ambient-data user-uint64 0) - (the-as uint (+ (-> *display* base-frame-counter) + (the-as uint (+ (current-time) (the int (* 300.0 (-> (the-as (pointer float) v1-5) 0))) (rand-vu-int-count (the int (* 300.0 (-> (the-as (pointer float) v1-5) 1)))) ) ) ) ) - (when (< (the-as uint (- (-> *display* base-frame-counter) (the-as int s4-0))) (the-as uint 300)) + (when (not (time-elapsed? (the-as int s4-0) (seconds 1))) (let ((f30-0 (the float (rand-vu-int-count (the-as int (-> s5-0 ambient-data user-float 2)))))) (set! sv-16 (symbol->string (res-lump-struct s5-0 'effect-name symbol :time f30-0))) (let ((s4-2 (new 'stack 'sound-spec))) @@ -747,13 +744,7 @@ ) ) (when *debug-effect-control* - (format - #t - "(~5D) effect sound ~A ~S " - (-> *display* base-frame-counter) - (res-lump-struct s5-0 'name structure) - sv-16 - ) + (format #t "(~5D) effect sound ~A ~S " (current-time) (res-lump-struct s5-0 'name structure) sv-16) (format #t "volume: ~f pitch-mod: ~f~%" @@ -980,13 +971,13 @@ ;; definition for method 17 of type drawable-ambient ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients drawable-ambient ((obj drawable-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) +(defmethod collect-ambients drawable-ambient ((this drawable-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) (dotimes (s2-0 arg1) - (when (spheres-overlap? arg0 (the-as sphere (-> obj bsphere))) - (set! (-> arg2 items (-> arg2 num-items)) obj) + (when (spheres-overlap? arg0 (the-as sphere (-> this bsphere))) + (set! (-> arg2 items (-> arg2 num-items)) this) (+! (-> arg2 num-items) 1) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) @@ -994,16 +985,16 @@ ;; definition for method 17 of type drawable-inline-array-ambient ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients drawable-inline-array-ambient ((obj drawable-inline-array-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) - (collect-ambients (the-as drawable-ambient (-> obj data)) arg0 (-> obj length) arg2) +(defmethod collect-ambients drawable-inline-array-ambient ((this drawable-inline-array-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) + (collect-ambients (the-as drawable-ambient (-> this data)) arg0 (-> this length) arg2) 0 (none) ) ;; definition for method 17 of type drawable-tree-ambient ;; INFO: Return type mismatch int vs none. -(defmethod collect-ambients drawable-tree-ambient ((obj drawable-tree-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) - (collect-ambients (-> obj data 0) arg0 (-> obj length) arg2) +(defmethod collect-ambients drawable-tree-ambient ((this drawable-tree-ambient) (arg0 sphere) (arg1 int) (arg2 ambient-list)) + (collect-ambients (-> this data 0) arg0 (-> this length) arg2) 0 (none) ) @@ -1011,93 +1002,95 @@ ;; definition for method 28 of type entity-ambient ;; INFO: Used lq/sq ;; INFO: Return type mismatch entity-ambient vs none. -(defmethod birth-ambient! entity-ambient ((obj entity-ambient)) - (set! (-> obj ambient-data quad) (the-as uint128 0)) - (set! (-> obj ambient-data function) ambient-type-error) - (case (res-lump-struct obj 'type structure) +(defmethod birth-ambient! entity-ambient ((this entity-ambient)) + (set! (-> this ambient-data quad) (the-as uint128 0)) + (set! (-> this ambient-data function) ambient-type-error) + (case (res-lump-struct this 'type structure) (('sound) - (let ((s5-0 (res-lump-struct obj 'effect-name structure :time 0.0)) - (a0-7 (res-lump-data obj 'cycle-speed pointer)) + (let ((s5-0 (res-lump-struct this 'effect-name structure :time 0.0)) + (a0-7 (res-lump-data this 'cycle-speed pointer)) ) (when (and s5-0 a0-7) (cond ((>= (-> (the-as (pointer float) a0-7)) 0.0) - (set! (-> obj ambient-data function) ambient-type-sound) - (set! (-> obj ambient-data user-float 2) (the-as float 0)) - (let ((s5-1 (-> ((method-of-type res-lump lookup-tag-idx) obj 'effect-name 'exact 0.0) lo))) + (set! (-> this ambient-data function) ambient-type-sound) + (set! (-> this ambient-data user-float 2) (the-as float 0)) + (let ((s5-1 (-> ((method-of-type res-lump lookup-tag-idx) this 'effect-name 'exact 0.0) lo))) (when (>= (the-as int s5-1) 0) (let ((s4-0 (the-as int s5-1)) - (v1-14 (-> obj tag s5-1)) + (v1-14 (-> this tag s5-1)) ) 0 - (while (= (-> v1-14 name) (-> obj tag s5-1 name)) - (make-property-data obj 0.0 (the-as res-tag-pair s4-0) (the-as pointer #f)) - (set! (-> obj ambient-data user-float 2) (the-as float (+ (the-as int (-> obj ambient-data user-float 2)) 1))) + (while (= (-> v1-14 name) (-> this tag s5-1 name)) + (make-property-data this 0.0 (the-as res-tag-pair s4-0) (the-as pointer #f)) + (set! (-> this ambient-data user-float 2) + (the-as float (+ (the-as int (-> this ambient-data user-float 2)) 1)) + ) (+! s4-0 1) - (set! v1-14 (-> obj tag s4-0)) + (set! v1-14 (-> this tag s4-0)) ) ) ) ) ) (else - (set! (-> obj ambient-data user-float 0) (the-as float (new-sound-id))) - (let ((v1-28 ((method-of-type res-lump lookup-tag-idx) obj 'effect-param 'exact 0.0))) - (set! (-> obj ambient-data user-float 1) (the-as float (if (< (the-as int v1-28) 0) - (the-as (pointer res-tag) #f) - (&-> (-> obj tag) (-> v1-28 lo)) - ) - ) + (set! (-> this ambient-data user-float 0) (the-as float (new-sound-id))) + (let ((v1-28 ((method-of-type res-lump lookup-tag-idx) this 'effect-param 'exact 0.0))) + (set! (-> this ambient-data user-float 1) (the-as float (if (< (the-as int v1-28) 0) + (the-as (pointer res-tag) #f) + (&-> (-> this tag) (-> v1-28 lo)) + ) + ) ) ) - (set! (-> obj ambient-data user-float 2) (the-as float s5-0)) - (set! (-> obj ambient-data function) ambient-type-sound-loop) + (set! (-> this ambient-data user-float 2) (the-as float s5-0)) + (set! (-> this ambient-data function) ambient-type-sound-loop) ) ) ) ) ) (('poi) - (let ((s5-2 (res-lump-struct obj 'effect-name structure :time 0.0))) - (when (res-lump-value obj 'loc-name-id uint128) - (set! (-> obj ambient-data user-float 2) (the-as float s5-2)) - (set! (-> obj ambient-data function) ambient-type-poi) + (let ((s5-2 (res-lump-struct this 'effect-name structure :time 0.0))) + (when (res-lump-value this 'loc-name-id uint128) + (set! (-> this ambient-data user-float 2) (the-as float s5-2)) + (set! (-> this ambient-data function) ambient-type-poi) ) ) ) (('hint) - (let ((s5-3 (res-lump-struct obj 'effect-name structure :time 0.0))) - (when (res-lump-value obj 'text-id uint128) - (set! (-> obj ambient-data user-float 2) (the-as float s5-3)) - (set! (-> obj ambient-data function) ambient-type-hint) + (let ((s5-3 (res-lump-struct this 'effect-name structure :time 0.0))) + (when (res-lump-value this 'text-id uint128) + (set! (-> this ambient-data user-float 2) (the-as float s5-3)) + (set! (-> this ambient-data function) ambient-type-hint) ) ) ) (('light) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data function) ambient-type-light) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data function) ambient-type-light) ) (('dark) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data function) ambient-type-dark) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data function) ambient-type-dark) ) (('weather-off) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data function) ambient-type-weather-off) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data function) ambient-type-weather-off) ) (('ocean-off) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data function) ambient-type-ocean-off) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data function) ambient-type-ocean-off) ) (('ocean-near-off) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data function) ambient-type-ocean-near-off) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data function) ambient-type-ocean-near-off) ) (('music) - (set! (-> obj ambient-data user-float 2) (res-lump-struct obj 'effect-name float :time 0.0)) - (set! (-> obj ambient-data user-float 0) (res-lump-struct obj 'music float)) - (set! (-> obj ambient-data user-float 1) (res-lump-value obj 'flava float)) - (set! (-> obj ambient-data function) ambient-type-music) + (set! (-> this ambient-data user-float 2) (res-lump-struct this 'effect-name float :time 0.0)) + (set! (-> this ambient-data user-float 0) (res-lump-struct this 'music float)) + (set! (-> this ambient-data user-float 1) (res-lump-value this 'flava float)) + (set! (-> this ambient-data function) ambient-type-music) ) ) (none) @@ -1108,8 +1101,8 @@ ;; definition for method 18 of type drawable-ambient ;; INFO: Return type mismatch int vs none. -(defmethod execute-ambient drawable-ambient ((obj drawable-ambient) (arg0 vector)) - ((-> obj ambient ambient-data function) obj arg0) +(defmethod execute-ambient drawable-ambient ((this drawable-ambient) (arg0 vector)) + ((-> this ambient ambient-data function) this arg0) 0 (none) ) @@ -1120,10 +1113,10 @@ ;; definition for method 27 of type entity-ambient ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod draw-debug entity-ambient ((obj entity-ambient)) +(defmethod draw-debug entity-ambient ((this entity-ambient)) (local-vars (sv-16 uint128)) - (let ((gp-0 (-> obj trans)) - (s5-0 (res-lump-struct obj 'type symbol)) + (let ((gp-0 (-> this trans)) + (s5-0 (res-lump-struct this 'type symbol)) (s3-0 #f) ) (cond @@ -1132,7 +1125,7 @@ (add-debug-text-3d #t (bucket-id debug-no-zbuf) - (symbol->string (res-lump-struct obj 'effect-name symbol :time 0.0)) + (symbol->string (res-lump-struct this 'effect-name symbol :time 0.0)) gp-0 (font-color white) (new 'static 'vector2h :y 24) @@ -1142,7 +1135,7 @@ ) ((= s5-0 'hint) (when *display-ambient-hint-marks* - (set! sv-16 (res-lump-value obj 'text-id uint128)) + (set! sv-16 (res-lump-value this 'text-id uint128)) (let ((s3-2 add-debug-text-3d) (s2-1 #t) (s1-1 68) @@ -1155,7 +1148,7 @@ ) ((= s5-0 'poi) (when *display-ambient-poi-marks* - (let ((a1-7 (res-lump-value obj 'loc-name-id uint128))) + (let ((a1-7 (res-lump-value this 'loc-name-id uint128))) (when (and (nonzero? a1-7) *common-text*) (add-debug-text-3d #t @@ -1225,7 +1218,7 @@ (add-debug-text-3d #t (bucket-id debug-no-zbuf) - (res-lump-struct obj 'name string) + (res-lump-struct this 'name string) gp-0 (font-color white) (new 'static 'vector2h :y 8) diff --git a/test/decompiler/reference/jak1/engine/entity/entity-h_REF.gc b/test/decompiler/reference/jak1/engine/entity/entity-h_REF.gc index 76cf9d37fe..d60490f073 100644 --- a/test/decompiler/reference/jak1/engine/entity/entity-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/entity-h_REF.gc @@ -38,23 +38,23 @@ ;; definition for method 3 of type entity-perm ;; INFO: Used lq/sq -(defmethod inspect entity-perm ((obj entity-perm)) - (format #t "[~8x] ~A~%" obj 'entity-perm) - (format #t "~Tuser-object[2] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-uint64: ~D~%" (-> obj user-uint64)) - (format #t "~Tuser-float[2] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-int32[2] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-uint32[2] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-int16[4] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-uint16[4] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-int8[8] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-uint8[8] @ #x~X~%" (-> obj user-object)) - (format #t "~Tstatus: ~D~%" (-> obj status)) - (format #t "~Tdummy[1] @ #x~X~%" (-> obj dummy)) - (format #t "~Ttask: ~D~%" (-> obj task)) - (format #t "~Taid: ~D~%" (-> obj aid)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect entity-perm ((this entity-perm)) + (format #t "[~8x] ~A~%" this 'entity-perm) + (format #t "~Tuser-object[2] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-uint64: ~D~%" (-> this user-uint64)) + (format #t "~Tuser-float[2] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-int32[2] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-uint32[2] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-int16[4] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-uint16[4] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-int8[8] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-uint8[8] @ #x~X~%" (-> this user-object)) + (format #t "~Tstatus: ~D~%" (-> this status)) + (format #t "~Tdummy[1] @ #x~X~%" (-> this dummy)) + (format #t "~Ttask: ~D~%" (-> this task)) + (format #t "~Taid: ~D~%" (-> this aid)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; definition of type entity-links @@ -80,20 +80,20 @@ ) ;; definition for method 3 of type entity-links -(defmethod inspect entity-links ((obj entity-links)) - (format #t "[~8x] ~A~%" obj 'entity-links) - (format #t "~Tprev-link: #~%" (-> obj prev-link)) - (format #t "~Tnext-link: #~%" (-> obj next-link)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tlevel: ~A~%" (-> obj level)) - (format #t "~Tvis-id: ~D~%" (-> obj vis-id)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Tperm: ~`entity-perm`P~%" (-> obj perm)) - (format #t "~Tstatus: ~D~%" (-> obj perm status)) - (format #t "~Taid: ~D~%" (-> obj perm aid)) - (format #t "~Ttask: ~D~%" (-> obj perm task)) - obj +(defmethod inspect entity-links ((this entity-links)) + (format #t "[~8x] ~A~%" this 'entity-links) + (format #t "~Tprev-link: #~%" (-> this prev-link)) + (format #t "~Tnext-link: #~%" (-> this next-link)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tlevel: ~A~%" (-> this level)) + (format #t "~Tvis-id: ~D~%" (-> this vis-id)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Tperm: ~`entity-perm`P~%" (-> this perm)) + (format #t "~Tstatus: ~D~%" (-> this perm status)) + (format #t "~Taid: ~D~%" (-> this perm aid)) + (format #t "~Ttask: ~D~%" (-> this perm task)) + this ) ;; definition of type entity-perm-array @@ -106,12 +106,12 @@ ) ;; definition for method 3 of type entity-perm-array -(defmethod inspect entity-perm-array ((obj entity-perm-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect entity-perm-array ((this entity-perm-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -127,12 +127,12 @@ ) ;; definition for method 3 of type entity-links-array -(defmethod inspect entity-links-array ((obj entity-links-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect entity-links-array ((this entity-links-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -185,20 +185,20 @@ ;; definition for method 3 of type entity-ambient-data ;; INFO: Used lq/sq -(defmethod inspect entity-ambient-data ((obj entity-ambient-data)) - (format #t "[~8x] ~A~%" obj 'entity-ambient-data) - (format #t "~Tuser-object[3] @ #x~X~%" (&-> obj quad)) - (format #t "~Tfunction: ~A~%" (-> obj function)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - (format #t "~Tuser-uint64[1] @ #x~X~%" (&-> obj quad)) - (format #t "~Tuser-float[3] @ #x~X~%" (&-> obj quad)) - (format #t "~Tuser-int32[3] @ #x~X~%" (&-> obj quad)) - (format #t "~Tuser-uint32[3] @ #x~X~%" (&-> obj quad)) - (format #t "~Tuser-int16[6] @ #x~X~%" (&-> obj quad)) - (format #t "~Tuser-uint16[6] @ #x~X~%" (&-> obj quad)) - (format #t "~Tuser-int8[12] @ #x~X~%" (&-> obj quad)) - (format #t "~Tuser-uint8[12] @ #x~X~%" (&-> obj quad)) - obj +(defmethod inspect entity-ambient-data ((this entity-ambient-data)) + (format #t "[~8x] ~A~%" this 'entity-ambient-data) + (format #t "~Tuser-object[3] @ #x~X~%" (&-> this quad)) + (format #t "~Tfunction: ~A~%" (-> this function)) + (format #t "~Tquad: ~D~%" (-> this quad)) + (format #t "~Tuser-uint64[1] @ #x~X~%" (&-> this quad)) + (format #t "~Tuser-float[3] @ #x~X~%" (&-> this quad)) + (format #t "~Tuser-int32[3] @ #x~X~%" (&-> this quad)) + (format #t "~Tuser-uint32[3] @ #x~X~%" (&-> this quad)) + (format #t "~Tuser-int16[6] @ #x~X~%" (&-> this quad)) + (format #t "~Tuser-uint16[6] @ #x~X~%" (&-> this quad)) + (format #t "~Tuser-int8[12] @ #x~X~%" (&-> this quad)) + (format #t "~Tuser-uint8[12] @ #x~X~%" (&-> this quad)) + this ) ;; definition of type entity-ambient-data-array @@ -211,12 +211,12 @@ ) ;; definition for method 3 of type entity-ambient-data-array -(defmethod inspect entity-ambient-data-array ((obj entity-ambient-data-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect entity-ambient-data-array ((this entity-ambient-data-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -269,14 +269,14 @@ ) ;; definition for method 3 of type entity-info -(defmethod inspect entity-info ((obj entity-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tptype: ~A~%" (-> obj ptype)) - (format #t "~Tpackage: ~A~%" (-> obj package)) - (format #t "~Tart-group: ~A~%" (-> obj art-group)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Theap-size: ~D~%" (-> obj heap-size)) - obj +(defmethod inspect entity-info ((this entity-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tptype: ~A~%" (-> this ptype)) + (format #t "~Tpackage: ~A~%" (-> this package)) + (format #t "~Tart-group: ~A~%" (-> this art-group)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Theap-size: ~D~%" (-> this heap-size)) + this ) ;; failed to figure out what this is: @@ -296,12 +296,12 @@ ) ;; definition for method 3 of type actor-bank -(defmethod inspect actor-bank ((obj actor-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tpause-dist: ~f~%" (-> obj pause-dist)) - (format #t "~Tbirth-dist: ~f~%" (-> obj birth-dist)) - (format #t "~Tbirth-max: ~D~%" (-> obj birth-max)) - obj +(defmethod inspect actor-bank ((this actor-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tpause-dist: ~f~%" (-> this pause-dist)) + (format #t "~Tbirth-dist: ~f~%" (-> this birth-dist)) + (format #t "~Tbirth-max: ~D~%" (-> this birth-max)) + this ) ;; definition for symbol *ACTOR-bank*, type actor-bank diff --git a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc index ce6ade2b70..714d8f6122 100644 --- a/test/decompiler/reference/jak1/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/entity_REF.gc @@ -12,21 +12,21 @@ ;; definition for method 8 of type drawable-actor ;; INFO: Return type mismatch int vs drawable-actor. -(defmethod mem-usage drawable-actor ((obj drawable-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-actor ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 44 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") (+! (-> arg0 data 43 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 43 used) v1-6) (+! (-> arg0 data 43 total) (logand -16 (+ v1-6 15))) ) - (mem-usage (-> obj actor) arg0 (logior arg1 64)) + (mem-usage (-> this actor) arg0 (logior arg1 64)) (the-as drawable-actor 0) ) ;; definition for method 8 of type drawable-inline-array-actor ;; INFO: Return type mismatch int vs drawable-inline-array-actor. -(defmethod mem-usage drawable-inline-array-actor ((obj drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-actor ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -34,57 +34,57 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) (the-as drawable-inline-array-actor 0) ) ;; definition for method 2 of type entity-links -(defmethod print entity-links ((obj entity-links)) - (format #t "#" (-> obj process) obj) - obj +(defmethod print entity-links ((this entity-links)) + (format #t "#" (-> this process) this) + this ) ;; definition for method 2 of type entity-perm -(defmethod print entity-perm ((obj entity-perm)) +(defmethod print entity-perm ((this entity-perm)) (format #t "#" - (-> obj aid) - (-> obj task) - (-> obj status) - (-> obj user-uint64) - obj + (-> this aid) + (-> this task) + (-> this status) + (-> this user-uint64) + this ) - obj + this ) ;; definition for method 22 of type entity -(defmethod birth! entity ((obj entity)) - (format #t "birth ~A~%" obj) - obj +(defmethod birth! entity ((this entity)) + (format #t "birth ~A~%" this) + this ) ;; definition for method 23 of type entity -(defmethod kill! entity ((obj entity)) - (format #t "kill ~A~%" obj) - obj +(defmethod kill! entity ((this entity)) + (format #t "kill ~A~%" this) + this ) ;; definition for method 2 of type entity -(defmethod print entity ((obj entity)) - (format #t "#<~A :name ~S @ #x~X>" (-> obj type) (res-lump-struct obj 'name structure) obj) - obj +(defmethod print entity ((this entity)) + (format #t "#<~A :name ~S @ #x~X>" (-> this type) (res-lump-struct this 'name structure) this) + this ) ;; definition for method 26 of type entity -(defmethod get-level entity ((obj entity)) +(defmethod get-level entity ((this entity)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) (when (= (-> a1-3 status) 'active) - (if (and (>= (the-as int obj) (the-as int (-> a1-3 heap base))) - (< (the-as int obj) (the-as int (-> a1-3 heap top-base))) + (if (and (>= (the-as int this) (the-as int (-> a1-3 heap base))) + (< (the-as int this) (the-as int (-> a1-3 heap top-base))) ) (return a1-3) ) @@ -373,56 +373,61 @@ ) ;; definition for method 2 of type process -;; INFO: this function exists in multiple non-identical object files -(defmethod print process ((obj process)) - (format #t "#<~A ~S ~A :state ~S :flags " (-> obj type) (-> obj name) (-> obj status) (if (-> obj state) - (-> obj state name) - ) - ) - (process-status-bits obj #t) +(defmethod print process ((this process)) + (format + #t + "#<~A ~S ~A :state ~S :flags " + (-> this type) + (-> this name) + (-> this status) + (if (-> this state) + (-> this state name) + ) + ) + (process-status-bits this #t) (format #t " :stack ~D/~D :heap ~D/~D @ #x~X>" - (&- (-> obj top-thread stack-top) (the-as uint (-> obj top-thread sp))) - (-> obj main-thread stack-size) - (- (-> obj allocated-length) (&- (-> obj heap-top) (the-as uint (-> obj heap-cur)))) - (-> obj allocated-length) - obj + (&- (-> this top-thread stack-top) (the-as uint (-> this top-thread sp))) + (-> this main-thread stack-size) + (- (-> this allocated-length) (&- (-> this heap-top) (the-as uint (-> this heap-cur)))) + (-> this allocated-length) + this ) - obj + this ) ;; definition for method 3 of type entity -(defmethod inspect entity ((obj entity)) - ((the-as (function entity entity) (find-parent-method entity 3)) obj) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Taid: ~A~%" (-> obj aid)) - obj +(defmethod inspect entity ((this entity)) + ((the-as (function entity entity) (find-parent-method entity 3)) this) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Taid: ~A~%" (-> this aid)) + this ) ;; definition for method 3 of type entity-actor -(defmethod inspect entity-actor ((obj entity-actor)) - ((the-as (function entity-actor entity-actor) (find-parent-method entity-actor 3)) obj) - (format #t "~Tnav-mesh: ~A~%" (-> obj nav-mesh)) - (format #t "~Tetype: ~A~%" (-> obj etype)) - (format #t "~Ttask: ~d~%" (-> obj task)) - (format #t "~Tvis-id: ~d~%" (-> obj vis-id-signed)) - (format #t "~Tquat: ~`vector`P~%" (-> obj quat)) - obj +(defmethod inspect entity-actor ((this entity-actor)) + ((the-as (function entity-actor entity-actor) (find-parent-method entity-actor 3)) this) + (format #t "~Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~Tetype: ~A~%" (-> this etype)) + (format #t "~Ttask: ~d~%" (-> this task)) + (format #t "~Tvis-id: ~d~%" (-> this vis-id-signed)) + (format #t "~Tquat: ~`vector`P~%" (-> this quat)) + this ) ;; definition for method 29 of type entity-actor ;; INFO: Return type mismatch entity-actor vs none. -(defmethod debug-print entity-actor ((obj entity-actor) (mode symbol) (expected-type type)) - (let ((s4-0 (-> obj etype))) +(defmethod debug-print entity-actor ((this entity-actor) (mode symbol) (expected-type type)) + (let ((s4-0 (-> this etype))) (when (or (not expected-type) (and s4-0 (valid? s4-0 type #f #f 0) (type-type? s4-0 expected-type))) - (format #t "~5D #x~8X ~-21S" (-> obj extra vis-id) obj (res-lump-struct obj 'name structure)) + (format #t "~5D #x~8X ~-21S" (-> this extra vis-id) this (res-lump-struct this 'name structure)) (let ((t9-4 format) (a0-5 #t) (a1-5 "~8D ~3D ~-4S #x~4X") - (a2-4 (-> obj extra perm aid)) - (a3-3 (-> obj extra perm task)) - (t0-3 (-> obj extra level nickname)) + (a2-4 (-> this extra perm aid)) + (a3-3 (-> this extra perm task)) + (t0-3 (-> this extra level nickname)) ) (set! t0-3 (cond (t0-3 @@ -430,17 +435,17 @@ t0-3 ) (else - (-> obj extra level name) + (-> this extra level name) ) ) ) - (t9-4 a0-5 a1-5 a2-4 a3-3 t0-3 (-> obj extra perm status)) + (t9-4 a0-5 a1-5 a2-4 a3-3 t0-3 (-> this extra perm status)) ) (if (= mode 'entity-meters) - (format #t " :trans ~14m ~14m ~14m " (-> obj extra trans x) (-> obj extra trans y) (-> obj extra trans z)) - (format #t " :trans ~14f ~14f ~14f " (-> obj extra trans x) (-> obj extra trans y) (-> obj extra trans z)) + (format #t " :trans ~14m ~14m ~14m " (-> this extra trans x) (-> this extra trans y) (-> this extra trans z)) + (format #t " :trans ~14f ~14f ~14f " (-> this extra trans x) (-> this extra trans y) (-> this extra trans z)) ) - (let* ((s3-2 (-> obj extra process)) + (let* ((s3-2 (-> this extra process)) (s4-2 (if (and (nonzero? s3-2) (type-type? (-> s3-2 type) process-drawable)) s3-2 ) @@ -449,28 +454,28 @@ (format #t ":pr #x~8X ~-12S ~-21S ~-5S/~-5S " - (if (-> obj extra process) - (-> obj extra process) + (if (-> this extra process) + (-> this extra process) 0 ) - (if (-> obj extra process) - (-> obj extra process name) + (if (-> this extra process) + (-> this extra process name) "" ) - (if (and (-> obj extra process) (-> obj extra process state)) - (-> obj extra process state name) + (if (and (-> this extra process) (-> this extra process state)) + (-> this extra process state name) "" ) - (if (-> obj extra process) - (* (- (-> obj extra process allocated-length) - (&- (-> obj extra process heap-top) (the-as uint (-> obj extra process heap-cur))) + (if (-> this extra process) + (* (- (-> this extra process allocated-length) + (&- (-> this extra process heap-top) (the-as uint (-> this extra process heap-cur))) ) 8 ) "" ) - (if (-> obj extra process) - (* (-> obj extra process allocated-length) 8) + (if (-> this extra process) + (* (-> this extra process allocated-length) 8) "" ) ) @@ -478,7 +483,7 @@ ) (format #t "~%") (if (= mode 'entity-perm) - (format #t " ~`entity-perm`P~%" (-> obj extra perm)) + (format #t " ~`entity-perm`P~%" (-> this extra perm)) ) ) ) @@ -487,7 +492,7 @@ ;; definition for method 13 of type level-group ;; INFO: Return type mismatch int vs none. -(defmethod debug-print-entities level-group ((obj level-group) (mode symbol) (expected-type type)) +(defmethod debug-print-entities level-group ((this level-group) (mode symbol) (expected-type type)) (format #t " id address name aid tsk lev status x y z address name state heap flags~%" @@ -495,8 +500,8 @@ 0 0 ) - (dotimes (s3-0 (-> obj length)) - (let ((s2-0 (-> obj level s3-0))) + (dotimes (s3-0 (-> this length)) + (let ((s2-0 (-> this level s3-0))) (when (= (-> s2-0 status) 'active) (case mode (('art-group) @@ -523,12 +528,12 @@ ;; definition for method 24 of type entity ;; INFO: Used lq/sq ;; INFO: Return type mismatch entity vs none. -(defmethod add-to-level! entity ((obj entity) (lev-group level-group) (lev level) (aid actor-id)) +(defmethod add-to-level! entity ((this entity) (lev-group level-group) (lev level) (aid actor-id)) (let ((level-link (-> lev entity data (-> lev entity length)))) (+! (-> lev entity length) 1) (set! (-> level-link process) #f) - (set! (-> level-link entity) obj) - (set! (-> obj extra) level-link) + (set! (-> level-link entity) this) + (set! (-> this extra) level-link) (cond ((-> lev-group entity-link) (let* ((other-prev (-> lev-group entity-link)) @@ -546,18 +551,18 @@ ) ) (set! (-> lev-group entity-link) level-link) - (set! (-> level-link trans quad) (-> obj trans quad)) + (set! (-> level-link trans quad) (-> this trans quad)) ) - (set! (-> obj extra perm aid) aid) - (set! (-> obj extra level) lev) + (set! (-> this extra perm aid) aid) + (set! (-> this extra level) lev) (cond - ((= (-> obj type) entity-actor) - (set! (-> (the-as entity-actor obj) extra perm task) (-> (the-as entity-actor obj) task)) - (set! (-> (the-as entity-actor obj) extra vis-id) (-> (the-as entity-actor obj) vis-id-signed)) + ((= (-> this type) entity-actor) + (set! (-> (the-as entity-actor this) extra perm task) (-> (the-as entity-actor this) task)) + (set! (-> (the-as entity-actor this) extra vis-id) (-> (the-as entity-actor this) vis-id-signed)) ) (else - (set! (-> obj extra perm task) (game-task none)) - (set! (-> obj extra vis-id) 0) + (set! (-> this extra perm task) (game-task none)) + (set! (-> this extra vis-id) 0) 0 ) ) @@ -565,8 +570,8 @@ ) ;; definition for method 25 of type entity -(defmethod remove-from-level! entity ((obj entity) (arg0 level-group)) - (let ((v1-0 (-> obj extra))) +(defmethod remove-from-level! entity ((this entity) (arg0 level-group)) + (let ((v1-0 (-> this extra))) (cond ((= (-> v1-0 next-link) v1-0) (set! (-> arg0 entity-link) #f) @@ -580,7 +585,7 @@ ) ) ) - obj + this ) ;; definition for function update-actor-vis-box @@ -605,15 +610,15 @@ ;; definition for method 22 of type level-group ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod update-vis-volumes level-group ((obj level-group)) +(defmethod update-vis-volumes level-group ((this level-group)) (local-vars (v1-10 symbol) (sv-16 process) (sv-32 (function process-drawable vector vector none)) (sv-48 process-tree) ) - (dotimes (s5-0 (-> obj length)) - (let ((v1-3 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-3 (-> this level s5-0))) (when (= (-> v1-3 status) 'active) (let ((s4-0 (-> v1-3 bsp level entity))) (dotimes (s3-0 (-> s4-0 length)) @@ -662,10 +667,10 @@ ;; definition for method 23 of type level-group ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod update-vis-volumes-from-nav-mesh level-group ((obj level-group)) +(defmethod update-vis-volumes-from-nav-mesh level-group ((this level-group)) (local-vars (sv-16 entity) (sv-32 entity)) - (dotimes (s5-0 (-> obj length)) - (let ((v1-3 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-3 (-> this level s5-0))) (when (= (-> v1-3 status) 'active) (let ((s4-0 (-> v1-3 bsp level entity))) (dotimes (s3-0 (-> s4-0 length)) @@ -719,10 +724,10 @@ ;; definition for method 24 of type level-group ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod print-volume-sizes level-group ((obj level-group)) +(defmethod print-volume-sizes level-group ((this level-group)) (local-vars (sv-16 type) (sv-32 (function _varargs_ object)) (sv-48 symbol) (sv-64 string) (sv-80 entity)) - (dotimes (s5-0 (-> obj length)) - (let ((v1-3 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-3 (-> this level s5-0))) (when (= (-> v1-3 status) 'active) (let ((s4-0 (-> v1-3 bsp level entity))) (dotimes (s3-0 (-> s4-0 length)) @@ -807,7 +812,7 @@ ;; definition for method 14 of type level-group ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw-actors level-group ((obj level-group) (arg0 symbol)) +(defmethod debug-draw-actors level-group ((this level-group) (arg0 symbol)) (local-vars (sv-48 (function symbol bucket-id string vector font-color vector2h symbol)) (sv-64 symbol) @@ -828,8 +833,8 @@ (sv-304 pointer) ) (when (and arg0 (not (or (= *master-mode* 'menu) (= *master-mode* 'progress)))) - (dotimes (s4-0 (-> obj length)) - (let ((v1-8 (-> obj level s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((v1-8 (-> this level s4-0))) (when (= (-> v1-8 status) 'active) (let ((s3-0 (-> v1-8 bsp level entity))) (dotimes (s2-0 (-> s3-0 length)) @@ -929,8 +934,8 @@ ) (when (and *display-actor-vis* (not (or *display-actor-anim* *display-process-anim*))) (let ((s5-1 *display-actor-vis*)) - (dotimes (s4-1 (-> obj length)) - (let ((s3-1 (-> obj level s4-1))) + (dotimes (s4-1 (-> this length)) + (let ((s3-1 (-> this level s4-1))) (when (= (-> s3-1 status) 'active) (let ((s2-1 (-> s3-1 bsp level entity))) (dotimes (s1-2 (-> s2-1 length)) @@ -988,7 +993,7 @@ ) ) (if *generate-actor-vis* - (update-vis-volumes obj) + (update-vis-volumes this) ) (when (or *display-actor-anim* *display-process-anim*) (let ((s5-2 (ppointer->process *display-process-anim*))) @@ -1104,7 +1109,7 @@ ) (when (and *display-actor-graph* (not (or (= *master-mode* 'menu) (= *master-mode* 'progress)))) (if (not (paused?)) - (float-save-timeplot (if (< (the int (the float (mod (-> *display* base-frame-counter) 600))) 300) + (float-save-timeplot (if (< (the int (the float (mod (current-time) 600))) 300) 1.0 0.0 ) @@ -1152,8 +1157,8 @@ ) ) (when *display-split-boxes* - (dotimes (s5-4 (-> obj length)) - (let ((s4-4 (-> obj level s5-4))) + (dotimes (s5-4 (-> this length)) + (let ((s4-4 (-> this level s5-4))) (when (= (-> s4-4 status) 'active) (when (nonzero? (-> s4-4 bsp boxes)) (let ((s3-4 (-> s4-4 bsp boxes))) @@ -1185,8 +1190,8 @@ *display-ambient-ocean-near-off-marks* *display-ambient-music-marks* ) - (dotimes (s5-5 (-> obj length)) - (let ((v1-214 (-> obj level s5-5))) + (dotimes (s5-5 (-> this length)) + (let ((v1-214 (-> this level s5-5))) (when (= (-> v1-214 status) 'active) (let ((s4-5 (-> v1-214 bsp ambients))) (when (nonzero? s4-5) @@ -1204,15 +1209,15 @@ ) ;; definition for method 22 of type entity-camera -(defmethod birth! entity-camera ((obj entity-camera)) - (add-connection *camera-engine* *camera* nothing obj #f #f) - obj +(defmethod birth! entity-camera ((this entity-camera)) + (add-connection *camera-engine* *camera* nothing this #f #f) + this ) ;; definition for method 23 of type entity-camera -(defmethod kill! entity-camera ((obj entity-camera)) - (remove-by-param1 *camera-engine* obj) - obj +(defmethod kill! entity-camera ((this entity-camera)) + (remove-by-param1 *camera-engine* this) + this ) ;; definition for function init-entity @@ -1231,8 +1236,8 @@ ) ;; definition for method 22 of type entity-actor -(defmethod birth! entity-actor ((obj entity-actor)) - (let* ((entity-type (-> obj etype)) +(defmethod birth! entity-actor ((this entity-actor)) + (let* ((entity-type (-> this etype)) (info (entity-info-lookup entity-type)) (entity-process (get-process *default-dead-pool* entity-type (if info (-> info heap-size) @@ -1251,17 +1256,17 @@ (valid? (method-of-object entity-process init-from-entity!) function #f #f 0) ) ) - (init-entity entity-process obj) + (init-entity entity-process this) ) (else - (when (not (birth-viewer entity-process obj)) - (format 0 "ERROR: no proper process type named ~A exists in the code, could not start ~A~%" entity-type obj) - (logior! (-> obj extra perm status) (entity-perm-status bit-0)) + (when (not (birth-viewer entity-process this)) + (format 0 "ERROR: no proper process type named ~A exists in the code, could not start ~A~%" entity-type this) + (logior! (-> this extra perm status) (entity-perm-status bit-0)) ) ) ) ) - obj + this ) ;; definition for function entity-deactivate-handler @@ -1275,80 +1280,80 @@ ) ;; definition for method 23 of type entity-actor -(defmethod kill! entity-actor ((obj entity-actor)) - (let ((a0-1 (-> obj extra process))) +(defmethod kill! entity-actor ((this entity-actor)) + (let ((a0-1 (-> this extra process))) (if a0-1 (deactivate a0-1) - (entity-deactivate-handler a0-1 obj) + (entity-deactivate-handler a0-1 this) ) ) - obj + this ) ;; definition for method 18 of type bsp-header ;; INFO: Return type mismatch bsp-header vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s5, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod birth bsp-header ((obj bsp-header)) +(defmethod birth bsp-header ((this bsp-header)) (local-vars (v1-71 int) (s5-0 int)) (.mfc0 s5-0 Count) - (let ((actor-count (if (nonzero? (-> obj actors)) - (-> obj actors length) + (let ((actor-count (if (nonzero? (-> this actors)) + (-> this actors length) 0 ) ) ) (cond - ((not (-> obj level entity)) - (set! (-> obj level entity) (new 'loading-level 'entity-links-array actor-count)) + ((not (-> this level entity)) + (set! (-> this level entity) (new 'loading-level 'entity-links-array actor-count)) ) - ((< (-> obj level entity allocated-length) actor-count) + ((< (-> this level entity allocated-length) actor-count) (format 0 "ERROR: Attempting to rebirth level ~A with incorrect entity table size ~D/~D~%" - (-> obj level) + (-> this level) actor-count - (-> obj level entity allocated-length) + (-> this level entity allocated-length) ) ) ) ) - (set! (-> obj level entity length) 0) + (set! (-> this level entity length) 0) 0 - (when (nonzero? (-> obj actors)) - (dotimes (birth-idx (-> obj actors length)) - (let* ((idx-to-birth (-> obj actor-birth-order birth-idx)) - (actor-to-birth (-> obj actors data (logand idx-to-birth #xffff) actor)) + (when (nonzero? (-> this actors)) + (dotimes (birth-idx (-> this actors length)) + (let* ((idx-to-birth (-> this actor-birth-order birth-idx)) + (actor-to-birth (-> this actors data (logand idx-to-birth #xffff) actor)) ) - (add-to-level! actor-to-birth *level* (-> obj level) (the-as actor-id (-> actor-to-birth aid))) + (add-to-level! actor-to-birth *level* (-> this level) (the-as actor-id (-> actor-to-birth aid))) ) ) ) - (let ((existing-amb-count (if (nonzero? (-> obj ambients)) - (-> obj ambients length) + (let ((existing-amb-count (if (nonzero? (-> this ambients)) + (-> this ambients length) 0 ) ) ) (cond - ((not (-> obj level ambient)) - (set! (-> obj level ambient) (new 'loading-level 'entity-ambient-data-array existing-amb-count)) + ((not (-> this level ambient)) + (set! (-> this level ambient) (new 'loading-level 'entity-ambient-data-array existing-amb-count)) ) - ((< (-> obj level ambient allocated-length) existing-amb-count) + ((< (-> this level ambient allocated-length) existing-amb-count) (format 0 "ERROR: Attempting to rebirth level ~A with incorrect ambient table size ~D/~D~%" - (-> obj level) + (-> this level) existing-amb-count - (-> obj level ambient allocated-length) + (-> this level ambient allocated-length) ) ) ) ) - (set! (-> obj level ambient length) 0) + (set! (-> this level ambient length) 0) 0 - (let ((amb-array (-> obj level ambient)) - (bsp-ambs (-> obj ambients)) + (let ((amb-array (-> this level ambient)) + (bsp-ambs (-> this ambients)) ) (when (nonzero? bsp-ambs) (dotimes (s2-0 (-> bsp-ambs length)) @@ -1360,7 +1365,7 @@ ) ) ) - (let ((cams (-> obj cameras))) + (let ((cams (-> this cameras))) (when (nonzero? cams) (dotimes (s3-1 (-> cams length)) (birth! (-> cams s3-1)) @@ -1376,8 +1381,8 @@ ;; definition for method 19 of type bsp-header ;; INFO: Return type mismatch bsp-header vs none. -(defmethod deactivate-entities bsp-header ((obj bsp-header)) - (let ((s5-0 (-> obj actors))) +(defmethod deactivate-entities bsp-header ((this bsp-header)) + (let ((s5-0 (-> this actors))) (when (nonzero? s5-0) (dotimes (s4-0 (-> s5-0 length)) (let ((s3-0 (-> s5-0 data s4-0 actor))) @@ -1387,7 +1392,7 @@ ) ) ) - (let ((s5-1 (-> obj cameras))) + (let ((s5-1 (-> this cameras))) (when (nonzero? s5-1) (dotimes (s4-1 (-> s5-1 length)) (kill! (-> s5-1 s4-1)) @@ -1395,15 +1400,15 @@ ) ) (let ((s5-2 (-> *entity-pool* child)) - (s4-2 (-> obj level heap base)) - (s3-1 (-> obj level heap top-base)) + (s4-2 (-> this level heap base)) + (s3-1 (-> this level heap top-base)) ) (while s5-2 (let ((s2-0 (ppointer->process s5-2))) (set! s5-2 (-> s5-2 0 brother)) (cond ((-> (the-as process s2-0) entity) - (when (= (-> (the-as process s2-0) entity extra level) (-> obj level)) + (when (= (-> (the-as process s2-0) entity extra level) (-> this level)) (format #t "NOTICE: rogue level entity ~A~% still alive~%" s2-0) (deactivate s2-0) ) @@ -1474,34 +1479,34 @@ ) ;; definition for method 9 of type entity-perm -(defmethod update-perm! entity-perm ((obj entity-perm) (arg0 symbol) (arg1 entity-perm-status)) +(defmethod update-perm! entity-perm ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) (cond ((= arg0 'game) - (logclear! (-> obj status) arg1) + (logclear! (-> this status) arg1) ) - ((nonzero? (-> obj task)) - (logclear! (-> obj status) (logior (if (logtest? (-> obj status) (entity-perm-status bit-4)) - 524 - 0 - ) - 515 - ) + ((nonzero? (-> this task)) + (logclear! (-> this status) (logior (if (logtest? (-> this status) (entity-perm-status bit-4)) + 524 + 0 + ) + 515 + ) ) ) (else - (logclear! (-> obj status) (logior arg1 (if (logtest? (-> obj status) (entity-perm-status bit-4)) - 524 - 0 - ) - ) + (logclear! (-> this status) (logior arg1 (if (logtest? (-> this status) (entity-perm-status bit-4)) + 524 + 0 + ) + ) ) ) ) - (when (not (logtest? (-> obj status) (entity-perm-status user-set-from-cstage))) - (set! (-> obj user-uint64) (the-as uint 0)) + (when (not (logtest? (-> this status) (entity-perm-status user-set-from-cstage))) + (set! (-> this user-uint64) (the-as uint 0)) 0 ) - obj + this ) ;; definition for function reset-actors @@ -1587,28 +1592,28 @@ ) ;; definition for method 12 of type process-drawable -(defmethod run-logic? process-drawable ((obj process-drawable)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) +(defmethod run-logic? process-drawable ((this process-drawable)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) ;; definition for method 9 of type entity-links -(defmethod birth? entity-links ((obj entity-links) (arg0 vector)) - (and (not (logtest? (-> obj perm status) (entity-perm-status bit-0 dead))) - (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) +(defmethod birth? entity-links ((this entity-links) (arg0 vector)) + (and (not (logtest? (-> this perm status) (entity-perm-status bit-0 dead))) + (< (vector-vector-distance (-> this trans) arg0) (-> *ACTOR-bank* birth-dist)) ) ) ;; definition for method 15 of type level-group ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs object. -(defmethod actors-update level-group ((obj level-group)) +(defmethod actors-update level-group ((this level-group)) (local-vars (sv-16 vector) (sv-24 int) (sv-32 entity-links) (sv-48 int) (sv-64 string) (sv-80 int)) (when *compact-actors* (if (and (= *compact-actors* 'debug) (= (-> *nk-dead-pool* alive-list prev) (-> *nk-dead-pool* first-gap))) @@ -1627,7 +1632,7 @@ (when (not (paused?)) (let ((s5-1 (-> *display* frames (-> *display* last-screen) frame run-time))) (let ((f0-5 (fmax 327680.0 (fmin (+ 327680.0 (* 204.8 (the float (- 7000 s5-1)))) (-> *ACTOR-bank* birth-dist))))) - (seek! (-> *ACTOR-bank* pause-dist) f0-5 (* 81920.0 (-> *display* seconds-per-frame))) + (seek! (-> *ACTOR-bank* pause-dist) f0-5 (* 81920.0 (seconds-per-frame))) ) (seekl! (-> *ACTOR-bank* birth-max) (the int (lerp-scale 25.0 1.0 (the float s5-1) 2000.0 7000.0)) 10) ) @@ -1638,8 +1643,8 @@ (when *spawn-actors* (set! sv-16 (camera-pos)) (set! sv-24 0) - (dotimes (s5-2 (-> obj length)) - (let ((s4-2 (-> obj level s5-2))) + (dotimes (s5-2 (-> this length)) + (let ((s4-2 (-> this level s5-2))) (when (= (-> s4-2 status) 'active) (cond ((= (-> s4-2 display?) 'special) @@ -1838,8 +1843,8 @@ ;; definition for method 30 of type entity-actor ;; INFO: Return type mismatch entity-perm-status vs none. -(defmethod set-or-clear-status! entity-actor ((obj entity-actor) (arg0 entity-perm-status) (arg1 symbol)) - (let ((v1-0 (-> obj extra))) +(defmethod set-or-clear-status! entity-actor ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) + (let ((v1-0 (-> this extra))) (if arg1 (logior! (-> v1-0 perm status) arg0) (logclear! (-> v1-0 perm status) arg0) diff --git a/test/decompiler/reference/jak1/engine/entity/relocate_REF.gc b/test/decompiler/reference/jak1/engine/entity/relocate_REF.gc index 708aeb9455..7195dd86d4 100644 --- a/test/decompiler/reference/jak1/engine/entity/relocate_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/relocate_REF.gc @@ -2,22 +2,22 @@ (in-package goal) ;; definition for method 7 of type process -(defmethod relocate process ((obj process) (arg0 int)) +(defmethod relocate process ((this process) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (&+! (-> obj ppointer 0) arg0) - (let ((v1-5 (-> obj entity))) - (if (and v1-5 (= (-> v1-5 extra process) obj)) + (&+! (-> this ppointer 0) arg0) + (let ((v1-5 (-> this entity))) + (if (and v1-5 (= (-> v1-5 extra process) this)) (&+! (-> v1-5 extra process) arg0) ) ) - (let ((v1-7 (-> obj connection-list next1))) + (let ((v1-7 (-> this connection-list next1))) (while (the-as connection v1-7) (let ((a0-14 (-> v1-7 prev1))) (if (and (>= (the-as int a0-14) (-> *kernel-context* relocating-min)) @@ -44,33 +44,33 @@ (set! v1-7 (-> (the-as connection v1-7) next1)) ) ) - (let ((v1-10 (-> obj self))) + (let ((v1-10 (-> this self))) (if (and (>= (the-as int v1-10) (-> *kernel-context* relocating-min)) (< (the-as int v1-10) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj self) arg0) + (&+! (-> this self) arg0) ) ) - (let ((v1-15 (-> obj ppointer))) + (let ((v1-15 (-> this ppointer))) (if (and (>= (the-as int v1-15) (-> *kernel-context* relocating-min)) (< (the-as int v1-15) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj ppointer) arg0) + (&+! (-> this ppointer) arg0) ) ) - (let ((s4-0 (&+ (-> obj heap-base) 4))) - (while (< (the-as int s4-0) (the-as int (-> obj heap-cur))) + (let ((s4-0 (&+ (-> this heap-base) 4))) + (while (< (the-as int s4-0) (the-as int (-> this heap-cur))) (relocate s4-0 arg0) (&+! s4-0 (logand -16 (+ (asize-of s4-0) 15))) ) ) - (&+! (-> obj main-thread) arg0) - (&+! (-> obj top-thread) arg0) - (&+! (-> obj heap-base) arg0) - (&+! (-> obj heap-cur) arg0) - (&+! (-> obj heap-top) arg0) - (let ((a2-4 (asize-of obj)) - (a1-22 (&-> obj type)) + (&+! (-> this main-thread) arg0) + (&+! (-> this top-thread) arg0) + (&+! (-> this heap-base) arg0) + (&+! (-> this heap-cur) arg0) + (&+! (-> this heap-top) arg0) + (let ((a2-4 (asize-of this)) + (a1-22 (&-> this type)) ) (cond ((>= arg0 0) @@ -85,156 +85,156 @@ ) ) (set! (-> *kernel-context* relocating-process) #f) - (&+ obj arg0) + (&+ this arg0) ) ;; definition for method 7 of type cpu-thread -(defmethod relocate cpu-thread ((obj cpu-thread) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate cpu-thread ((this cpu-thread) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type process-drawable ;; INFO: Return type mismatch process vs process-drawable. -(defmethod relocate process-drawable ((obj process-drawable) (arg0 int)) +(defmethod relocate process-drawable ((this process-drawable) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj node-list)) - (&+! (-> obj node-list) arg0) + (if (nonzero? (-> this node-list)) + (&+! (-> this node-list) arg0) ) - (if (nonzero? (-> obj draw)) - (&+! (-> obj draw) arg0) + (if (nonzero? (-> this draw)) + (&+! (-> this draw) arg0) ) - (if (nonzero? (-> obj skel)) - (&+! (-> obj skel) arg0) + (if (nonzero? (-> this skel)) + (&+! (-> this skel) arg0) ) - (if (nonzero? (-> obj nav)) - (&+! (-> obj nav) arg0) + (if (nonzero? (-> this nav)) + (&+! (-> this nav) arg0) ) - (if (nonzero? (-> obj align)) - (&+! (-> obj align) arg0) + (if (nonzero? (-> this align)) + (&+! (-> this align) arg0) ) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - (if (nonzero? (-> obj vol)) - (&+! (-> obj vol) arg0) + (if (nonzero? (-> this vol)) + (&+! (-> this vol) arg0) ) - (if (nonzero? (-> obj fact)) - (&+! (-> obj fact) arg0) + (if (nonzero? (-> this fact)) + (&+! (-> this fact) arg0) ) - (if (nonzero? (-> obj link)) - (&+! (-> obj link) arg0) + (if (nonzero? (-> this link)) + (&+! (-> this link) arg0) ) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (if (nonzero? (-> obj water)) - (&+! (-> obj water) arg0) + (if (nonzero? (-> this water)) + (&+! (-> this water) arg0) ) - (if (nonzero? (-> obj sound)) - (&+! (-> obj sound) arg0) + (if (nonzero? (-> this sound)) + (&+! (-> this sound) arg0) ) - (the-as process-drawable ((method-of-type process relocate) obj arg0)) + (the-as process-drawable ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type collide-shape -(defmethod relocate collide-shape ((obj collide-shape) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj root-prim) arg0) - (if (-> obj riders) - (&+! (-> obj riders) arg0) +(defmethod relocate collide-shape ((this collide-shape) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this root-prim) arg0) + (if (-> this riders) + (&+! (-> this riders) arg0) ) - obj + this ) ;; definition for method 7 of type collide-shape-moving ;; INFO: Return type mismatch collide-shape vs collide-shape-moving. -(defmethod relocate collide-shape-moving ((obj collide-shape-moving) (arg0 int)) - (if (-> obj dynam) - (&+! (-> obj dynam) arg0) +(defmethod relocate collide-shape-moving ((this collide-shape-moving) (arg0 int)) + (if (-> this dynam) + (&+! (-> this dynam) arg0) ) - (the-as collide-shape-moving ((method-of-type collide-shape relocate) obj arg0)) + (the-as collide-shape-moving ((method-of-type collide-shape relocate) this arg0)) ) ;; definition for method 7 of type collide-sticky-rider-group -(defmethod relocate collide-sticky-rider-group ((obj collide-sticky-rider-group) (arg0 int)) - (countdown (v1-0 (-> obj num-riders)) - (let ((a2-2 (-> obj rider v1-0))) +(defmethod relocate collide-sticky-rider-group ((this collide-sticky-rider-group) (arg0 int)) + (countdown (v1-0 (-> this num-riders)) + (let ((a2-2 (-> this rider v1-0))) (if (-> a2-2 sticky-prim) (&+! (-> a2-2 sticky-prim) arg0) ) ) ) - obj + this ) ;; definition for method 7 of type collide-shape-prim -(defmethod relocate collide-shape-prim ((obj collide-shape-prim) (arg0 int)) - (&+! (-> obj cshape) arg0) - obj +(defmethod relocate collide-shape-prim ((this collide-shape-prim) (arg0 int)) + (&+! (-> this cshape) arg0) + this ) ;; definition for method 7 of type collide-shape-prim-group -(defmethod relocate collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 int)) - (&+! (-> obj cshape) arg0) - (countdown (v1-2 (-> obj num-prims)) - (&+! (-> obj prims v1-2) arg0) +(defmethod relocate collide-shape-prim-group ((this collide-shape-prim-group) (arg0 int)) + (&+! (-> this cshape) arg0) + (countdown (v1-2 (-> this num-prims)) + (&+! (-> this prims v1-2) arg0) ) - obj + this ) ;; definition for method 7 of type fact-info -(defmethod relocate fact-info ((obj fact-info) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate fact-info ((this fact-info) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type draw-control -(defmethod relocate draw-control ((obj draw-control) (arg0 int)) - (&+! (-> obj skeleton) arg0) - (&+! (-> obj process) arg0) - (when (-> obj ripple) - (if (-> obj ripple query) - (&+! (-> obj ripple query) arg0) +(defmethod relocate draw-control ((this draw-control) (arg0 int)) + (&+! (-> this skeleton) arg0) + (&+! (-> this process) arg0) + (when (-> this ripple) + (if (-> this ripple query) + (&+! (-> this ripple query) arg0) ) - (&+! (-> obj ripple) arg0) + (&+! (-> this ripple) arg0) ) - (let ((v1-14 (-> obj shadow-ctrl))) + (let ((v1-14 (-> this shadow-ctrl))) (if (and (>= (the-as int v1-14) (-> *kernel-context* relocating-min)) (< (the-as int v1-14) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj shadow-ctrl) arg0) + (&+! (-> this shadow-ctrl) arg0) ) ) - obj + this ) ;; definition for method 7 of type joint-control -(defmethod relocate joint-control ((obj joint-control) (arg0 int)) - (if (-> obj effect) - (&+! (-> obj effect) arg0) +(defmethod relocate joint-control ((this joint-control) (arg0 int)) + (if (-> this effect) + (&+! (-> this effect) arg0) ) - (set! (-> obj root-channel) (the-as (inline-array joint-control-channel) (&+ (-> obj root-channel) arg0))) - (countdown (v1-6 (-> obj allocated-length)) - (&+! (-> obj channel v1-6 parent) arg0) + (set! (-> this root-channel) (the-as (inline-array joint-control-channel) (&+ (-> this root-channel) arg0))) + (countdown (v1-6 (-> this allocated-length)) + (&+! (-> this channel v1-6 parent) arg0) ) - obj + this ) ;; definition for method 7 of type cspace-array -(defmethod relocate cspace-array ((obj cspace-array) (arg0 int)) - (countdown (v1-0 (-> obj length)) - (let ((a2-2 (-> obj data v1-0))) +(defmethod relocate cspace-array ((this cspace-array) (arg0 int)) + (countdown (v1-0 (-> this length)) + (let ((a2-2 (-> this data v1-0))) (if (-> a2-2 parent) (&+! (-> a2-2 parent) arg0) ) @@ -255,70 +255,70 @@ ) ) ) - obj + this ) ;; definition for method 7 of type nav-control -(defmethod relocate nav-control ((obj nav-control) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj shape) arg0) - obj +(defmethod relocate nav-control ((this nav-control) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this shape) arg0) + this ) ;; definition for method 7 of type path-control -(defmethod relocate path-control ((obj path-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate path-control ((this path-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type vol-control -(defmethod relocate vol-control ((obj vol-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate vol-control ((this vol-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type water-control -(defmethod relocate water-control ((obj water-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate water-control ((this water-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type actor-link-info -(defmethod relocate actor-link-info ((obj actor-link-info) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate actor-link-info ((this actor-link-info) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type align-control -(defmethod relocate align-control ((obj align-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate align-control ((this align-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type joint-mod -(defmethod relocate joint-mod ((obj joint-mod) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj joint) arg0) - obj +(defmethod relocate joint-mod ((this joint-mod) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this joint) arg0) + this ) ;; definition for method 7 of type joint-mod-wheel -(defmethod relocate joint-mod-wheel ((obj joint-mod-wheel) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate joint-mod-wheel ((this joint-mod-wheel) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type effect-control -(defmethod relocate effect-control ((obj effect-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate effect-control ((this effect-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type sparticle-launch-control -(defmethod relocate sparticle-launch-control ((obj sparticle-launch-control) (arg0 int)) - (&+! (-> obj proc) arg0) - (countdown (v1-2 (-> obj length)) - (let* ((a0-3 (-> obj data v1-2)) +(defmethod relocate sparticle-launch-control ((this sparticle-launch-control) (arg0 int)) + (&+! (-> this proc) arg0) + (countdown (v1-2 (-> this length)) + (let* ((a0-3 (-> this data v1-2)) (a2-0 (-> a0-3 origin)) ) (if (and (>= (the-as int a2-0) (-> *kernel-context* relocating-min)) @@ -329,7 +329,7 @@ ) ) (forall-particles-with-key - obj + this (lambda ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (let ((v1-1 (-> *kernel-context* relocating-offset))) (set! (-> arg1 key) (the-as sparticle-launch-control (+ (the-as int (-> arg1 key)) v1-1))) @@ -343,71 +343,71 @@ #t #t ) - obj + this ) ;; definition for method 7 of type camera-master ;; INFO: Return type mismatch process vs camera-master. -(defmethod relocate camera-master ((obj camera-master) (arg0 int)) - (if (nonzero? (-> obj water-drip)) - (&+! (-> obj water-drip) arg0) +(defmethod relocate camera-master ((this camera-master) (arg0 int)) + (if (nonzero? (-> this water-drip)) + (&+! (-> this water-drip) arg0) ) - (the-as camera-master ((method-of-type process relocate) obj arg0)) + (the-as camera-master ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type time-of-day-proc ;; INFO: Return type mismatch process vs time-of-day-proc. -(defmethod relocate time-of-day-proc ((obj time-of-day-proc) (arg0 int)) - (if (nonzero? (-> obj stars)) - (&+! (-> obj stars) arg0) +(defmethod relocate time-of-day-proc ((this time-of-day-proc) (arg0 int)) + (if (nonzero? (-> this stars)) + (&+! (-> this stars) arg0) ) - (if (nonzero? (-> obj sun)) - (&+! (-> obj sun) arg0) + (if (nonzero? (-> this sun)) + (&+! (-> this sun) arg0) ) - (if (nonzero? (-> obj green-sun)) - (&+! (-> obj green-sun) arg0) + (if (nonzero? (-> this green-sun)) + (&+! (-> this green-sun) arg0) ) - (if (nonzero? (-> obj moon)) - (&+! (-> obj moon) arg0) + (if (nonzero? (-> this moon)) + (&+! (-> this moon) arg0) ) - (the-as time-of-day-proc ((method-of-type process relocate) obj arg0)) + (the-as time-of-day-proc ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type swingpole ;; INFO: Return type mismatch process vs swingpole. -(defmethod relocate swingpole ((obj swingpole) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate swingpole ((this swingpole) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (the-as swingpole ((method-of-type process relocate) obj arg0)) + (the-as swingpole ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type part-tracker ;; INFO: Return type mismatch process vs part-tracker. -(defmethod relocate part-tracker ((obj part-tracker) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate part-tracker ((this part-tracker) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (the-as part-tracker ((method-of-type process relocate) obj arg0)) + (the-as part-tracker ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type manipy ;; INFO: Return type mismatch process-drawable vs manipy. -(defmethod relocate manipy ((obj manipy) (arg0 int)) - (if (nonzero? (-> obj joint 0)) - (&+! (-> obj joint 0) arg0) +(defmethod relocate manipy ((this manipy) (arg0 int)) + (if (nonzero? (-> this joint 0)) + (&+! (-> this joint 0) arg0) ) - (if (nonzero? (-> obj joint 1)) - (&+! (-> obj joint 1) arg0) + (if (nonzero? (-> this joint 1)) + (&+! (-> this joint 1) arg0) ) - (if (nonzero? (-> obj joint 2)) - (&+! (-> obj joint 2) arg0) + (if (nonzero? (-> this joint 2)) + (&+! (-> this joint 2) arg0) ) - (if (nonzero? (-> obj joint 3)) - (&+! (-> obj joint 3) arg0) + (if (nonzero? (-> this joint 3)) + (&+! (-> this joint 3) arg0) ) - (the-as manipy ((method-of-type process-drawable relocate) obj arg0)) + (the-as manipy ((method-of-type process-drawable relocate) this arg0)) ) diff --git a/test/decompiler/reference/jak1/engine/entity/res-h_REF.gc b/test/decompiler/reference/jak1/engine/entity/res-h_REF.gc index 2a595e5a7b..a77a06e270 100644 --- a/test/decompiler/reference/jak1/engine/entity/res-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/res-h_REF.gc @@ -48,16 +48,16 @@ ;; definition for method 3 of type res-lump ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect res-lump ((obj res-lump)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata-base: #x~X~%" (-> obj data-base)) - (format #t "~Tdata-top: #x~X~%" (-> obj data-top)) - (format #t "~Tdata-size: ~D~%" (-> obj data-size)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Ttag: #x~X~%" (-> obj tag)) - obj +(defmethod inspect res-lump ((this res-lump)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata-base: #x~X~%" (-> this data-base)) + (format #t "~Tdata-top: #x~X~%" (-> this data-top)) + (format #t "~Tdata-size: ~D~%" (-> this data-size)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Ttag: #x~X~%" (-> this tag)) + this ) ;; definition for symbol *res-key-string*, type string diff --git a/test/decompiler/reference/jak1/engine/entity/res_REF.gc b/test/decompiler/reference/jak1/engine/entity/res_REF.gc index 4a03f977d6..f7ae03befa 100644 --- a/test/decompiler/reference/jak1/engine/entity/res_REF.gc +++ b/test/decompiler/reference/jak1/engine/entity/res_REF.gc @@ -2,107 +2,107 @@ (in-package goal) ;; definition for method 2 of type res-tag -(defmethod print res-tag ((obj res-tag)) - (if (zero? (-> obj inlined?)) +(defmethod print res-tag ((this res-tag)) + (if (zero? (-> this inlined?)) (format #t "#" - (-> obj name) - (-> obj key-frame) - (-> obj elt-type) - (-> obj elt-count) + (-> this name) + (-> this key-frame) + (-> this elt-type) + (-> this elt-count) ) (format #t "#" - (-> obj name) - (-> obj key-frame) - (-> obj elt-type) - (-> obj elt-count) + (-> this name) + (-> this key-frame) + (-> this elt-type) + (-> this elt-count) ) ) - obj + this ) ;; definition for method 4 of type res-tag ;; INFO: Return type mismatch uint vs int. -(defmethod length res-tag ((obj res-tag)) - (the-as int (if (zero? (-> obj inlined?)) - (* (-> obj elt-count) 4) - (* (-> obj elt-count) (-> obj elt-type size)) +(defmethod length res-tag ((this res-tag)) + (the-as int (if (zero? (-> this inlined?)) + (* (-> this elt-count) 4) + (* (-> this elt-count) (-> this elt-type size)) ) ) ) ;; definition for method 13 of type res-lump ;; INFO: Used lq/sq -(defmethod get-tag-index-data res-lump ((obj res-lump) (arg0 int)) - (&+ (-> obj data-base) (-> obj tag arg0 data-offset)) +(defmethod get-tag-index-data res-lump ((this res-lump) (arg0 int)) + (&+ (-> this data-base) (-> this tag arg0 data-offset)) ) ;; definition for method 14 of type res-lump -(defmethod get-tag-data res-lump ((obj res-lump) (arg0 res-tag)) - (&+ (-> obj data-base) (-> arg0 data-offset)) +(defmethod get-tag-data res-lump ((this res-lump) (arg0 res-tag)) + (&+ (-> this data-base) (-> arg0 data-offset)) ) ;; definition for method 0 of type res-lump (defmethod new res-lump ((allocation symbol) (type-to-make type) (data-count int) (data-size int)) - (let ((obj (object-new - allocation - type-to-make - (the-as int (+ (-> type-to-make size) (* (+ data-count -1) 16) data-size)) - ) - ) + (let ((this (object-new + allocation + type-to-make + (the-as int (+ (-> type-to-make size) (* (+ data-count -1) 16) data-size)) + ) + ) ) - (set! (-> obj allocated-length) data-count) - (set! (-> obj data-size) data-size) - (set! (-> obj length) 0) - (set! (-> obj data-base) (&-> (-> obj tag) data-count)) - (set! (-> obj data-top) (&-> (-> obj tag) data-count)) - obj + (set! (-> this allocated-length) data-count) + (set! (-> this data-size) data-size) + (set! (-> this length) 0) + (set! (-> this data-base) (&-> (-> this tag) data-count)) + (set! (-> this data-top) (&-> (-> this tag) data-count)) + this ) ) ;; definition for method 4 of type res-lump -(defmethod length res-lump ((obj res-lump)) - (-> obj length) +(defmethod length res-lump ((this res-lump)) + (-> this length) ) ;; definition for method 5 of type res-lump ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of res-lump ((obj res-lump)) - (the-as int (+ (-> obj type psize) (* (-> obj allocated-length) 16) (-> obj data-size))) +(defmethod asize-of res-lump ((this res-lump)) + (the-as int (+ (-> this type psize) (* (-> this allocated-length) 16) (-> this data-size))) ) ;; definition for method 3 of type res-lump ;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect res-lump ((obj res-lump)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata-base: #x~X~%" (-> obj data-base)) - (format #t "~Tdata-top: #x~X~%" (-> obj data-top)) - (format #t "~Tdata-size: #x~X~%" (-> obj data-size)) - (format #t "~Ttag[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj tag)) - (dotimes (i (-> obj length)) +(defmethod inspect res-lump ((this res-lump)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata-base: #x~X~%" (-> this data-base)) + (format #t "~Tdata-top: #x~X~%" (-> this data-top)) + (format #t "~Tdata-size: #x~X~%" (-> this data-size)) + (format #t "~Ttag[~D]: @ #x~X~%" (-> this allocated-length) (-> this tag)) + (dotimes (i (-> this length)) (format #t "~T [~D] " i) - (print (-> obj tag i)) + (print (-> this tag i)) (let ((t9-10 format) (a0-12 #t) (a1-9 " @ #x~X") - (a3-2 obj) + (a3-2 this) (a2-9 i) ) (t9-10 a0-12 a1-9 (&+ (-> a3-2 data-base) (-> a3-2 tag a2-9 data-offset))) ) (cond - ((zero? (-> obj tag i inlined?)) + ((zero? (-> this tag i inlined?)) (let ((t9-11 format) (a0-14 #t) (a1-10 " = ~A~%") - (a3-4 obj) + (a3-4 this) (a2-17 i) ) (t9-11 a0-14 a1-10 (-> (the-as (pointer uint32) (&+ (-> a3-4 data-base) (-> a3-4 tag a2-17 data-offset))))) @@ -113,13 +113,13 @@ ) ) ) - obj + this ) ;; definition for method 19 of type res-lump ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs res-tag-pair. -(defmethod lookup-tag-idx res-lump ((obj res-lump) (name-sym symbol) (mode symbol) (time float)) +(defmethod lookup-tag-idx res-lump ((this res-lump) (name-sym symbol) (mode symbol) (time float)) (local-vars (tag-idx int)) (when (or (= name-sym 'id) (= name-sym 'aid) @@ -132,7 +132,7 @@ (crash!) 0 ) - (if (or (not obj) (zero? obj) (<= (-> obj length) 0)) + (if (or (not this) (zero? this) (<= (-> this length) 0)) (return (new 'static 'res-tag-pair :lo #xffffffff :hi #xffffffff)) ) (let ((hi-tag-idx-out -1) @@ -141,12 +141,12 @@ (let ((most-recent-invalid-time-idx -1) (type-chars (-> (the-as (pointer uint64) (-> (symbol->string name-sym) data)) 0)) ) - (let ((max-search (+ (-> obj length) -1)) + (let ((max-search (+ (-> this length) -1)) (min-search 0) ) (while (>= max-search min-search) (let* ((check-idx (+ min-search (/ (- max-search min-search) 2))) - (diff (- type-chars (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag check-idx name)) data)) 0))) + (diff (- type-chars (-> (the-as (pointer uint64) (-> (symbol->string (-> this tag check-idx name)) data)) 0))) ) (cond ((zero? diff) @@ -169,7 +169,7 @@ (return (the-as res-tag-pair tag-idx)) ) (while (and (> tag-idx 0) - (= type-chars (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag (+ tag-idx -1) name)) data)) 0)) + (= type-chars (-> (the-as (pointer uint64) (-> (symbol->string (-> this tag (+ tag-idx -1) name)) data)) 0)) ) (+! tag-idx -1) ) @@ -179,9 +179,9 @@ (goto cfg-73) ) (let ((interp-tag-idx tag-idx) - (tag-ptr (&-> (-> obj tag) tag-idx)) + (tag-ptr (&-> (-> this tag) tag-idx)) ) - (while (not (or (>= interp-tag-idx (-> obj length)) + (while (not (or (>= interp-tag-idx (-> this length)) (< type-chars (-> (the-as (pointer uint64) (-> (symbol->string (-> tag-ptr 0 name)) data)) 0)) ) ) @@ -219,19 +219,19 @@ ;; definition for method 20 of type res-lump ;; INFO: Used lq/sq -(defmethod make-property-data res-lump ((obj res-lump) (time float) (result res-tag-pair) (buf pointer)) +(defmethod make-property-data res-lump ((this res-lump) (time float) (result res-tag-pair) (buf pointer)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) ) - (let* ((tag-lo (-> obj tag (-> result lo))) - (tag-hi (-> obj tag (-> result hi))) + (let* ((tag-lo (-> this tag (-> result lo))) + (tag-hi (-> this tag (-> result hi))) (elt-count (-> tag-lo elt-count)) ) (cond ((zero? (-> tag-lo inlined?)) - (&+ (-> obj data-base) (-> tag-lo data-offset)) + (&+ (-> this data-base) (-> tag-lo data-offset)) ) ((or (not buf) (= (-> result lo) (-> result hi)) @@ -239,15 +239,15 @@ (!= (-> tag-lo elt-type) (-> tag-hi elt-type)) ) (let ((a0-4 tag-lo)) - (&+ (-> obj data-base) (-> a0-4 data-offset)) + (&+ (-> this data-base) (-> a0-4 data-offset)) ) ) (else (let* ((interp (/ (- time (-> tag-lo key-frame)) (- (-> tag-hi key-frame) (-> tag-lo key-frame)))) - (a1-4 obj) + (a1-4 this) (a2-7 tag-lo) (src-lo (&+ (-> a1-4 data-base) (-> a2-7 data-offset))) - (src-hi (&+ (-> obj data-base) (-> tag-hi data-offset))) + (src-hi (&+ (-> this data-base) (-> tag-hi data-offset))) ) (case (-> tag-lo elt-type symbol) (('float) @@ -388,7 +388,7 @@ ) (else (let ((a0-19 tag-lo)) - (&+ (-> obj data-base) (-> a0-19 data-offset)) + (&+ (-> this data-base) (-> a0-19 data-offset)) ) ) ) @@ -401,7 +401,7 @@ ;; definition for method 9 of type res-lump ;; INFO: Used lq/sq -(defmethod get-property-data res-lump ((obj res-lump) +(defmethod get-property-data res-lump ((this res-lump) (name symbol) (mode symbol) (time float) @@ -409,15 +409,15 @@ (tag-addr (pointer res-tag)) (buf-addr pointer) ) - (let ((tag-pair (lookup-tag-idx obj name mode time))) + (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) (empty) ) (else - (set! default (make-property-data obj time tag-pair buf-addr)) + (set! default (make-property-data this time tag-pair buf-addr)) (if tag-addr - (set! (-> tag-addr 0) (-> obj tag (-> tag-pair lo))) + (set! (-> tag-addr 0) (-> this tag (-> tag-pair lo))) ) ) ) @@ -428,7 +428,7 @@ ;; definition for method 10 of type res-lump ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs structure. -(defmethod get-property-struct res-lump ((obj res-lump) +(defmethod get-property-struct res-lump ((this res-lump) (name symbol) (mode symbol) (time float) @@ -436,14 +436,14 @@ (tag-addr (pointer res-tag)) (buf-addr pointer) ) - (let ((tag-pair (lookup-tag-idx obj name mode time))) + (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) (empty) ) (else - (set! default (the-as structure (make-property-data obj time tag-pair buf-addr))) - (let ((tag (-> obj tag (-> tag-pair lo)))) + (set! default (the-as structure (make-property-data this time tag-pair buf-addr))) + (let ((tag (-> this tag (-> tag-pair lo)))) (if tag-addr (set! (-> tag-addr 0) tag) ) @@ -461,7 +461,7 @@ ;; definition for method 11 of type res-lump ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs uint128. -(defmethod get-property-value res-lump ((obj res-lump) +(defmethod get-property-value res-lump ((this res-lump) (name symbol) (mode symbol) (time float) @@ -469,16 +469,16 @@ (tag-addr (pointer res-tag)) (buf-addr pointer) ) - (let ((tag-pair (lookup-tag-idx obj name mode time))) + (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) (empty) ) (else (let* ((a0-2 (-> tag-pair lo)) - (tag (-> obj tag a0-2)) + (tag (-> this tag a0-2)) (tag-type (-> tag elt-type)) - (data (make-property-data obj time tag-pair buf-addr)) + (data (make-property-data this time tag-pair buf-addr)) ) (if tag-addr (set! (-> tag-addr 0) tag) @@ -538,7 +538,7 @@ ;; definition for method 12 of type res-lump ;; INFO: Used lq/sq -(defmethod get-property-value-float res-lump ((obj res-lump) +(defmethod get-property-value-float res-lump ((this res-lump) (name symbol) (mode symbol) (time float) @@ -547,16 +547,16 @@ (buf-addr pointer) ) (local-vars (v1-8 uint) (v1-11 int)) - (let ((tag-pair (lookup-tag-idx obj name mode time))) + (let ((tag-pair (lookup-tag-idx this name mode time))) (cond ((< (the-as int tag-pair) 0) (empty) ) (else (let* ((a0-2 (-> tag-pair lo)) - (tag (-> obj tag a0-2)) + (tag (-> this tag a0-2)) (tag-type (-> tag elt-type)) - (data (make-property-data obj time tag-pair buf-addr)) + (data (make-property-data this time tag-pair buf-addr)) ) (if tag-addr (set! (-> tag-addr 0) tag) @@ -618,23 +618,23 @@ ;; definition for method 16 of type res-lump ;; INFO: Used lq/sq -(defmethod sort! res-lump ((obj res-lump)) +(defmethod sort! res-lump ((this res-lump)) (let ((tags-sorted -1)) (while (nonzero? tags-sorted) (set! tags-sorted 0) (let ((i 0) - (tag-stop (+ (-> obj length) -2)) + (tag-stop (+ (-> this length) -2)) ) (while (>= tag-stop i) - (let* ((tag1 (-> obj tag i)) - (tag2 (-> obj tag (+ i 1))) + (let* ((tag1 (-> this tag i)) + (tag2 (-> this tag (+ i 1))) (tag-name1 (-> (the-as (pointer uint64) (-> (symbol->string (-> tag1 name)) data)) 0)) (tag-name2 (-> (the-as (pointer uint64) (-> (symbol->string (-> tag2 name)) data)) 0)) ) (when (or (< tag-name2 tag-name1) (and (= tag-name1 tag-name2) (< (-> tag2 key-frame) (-> tag1 key-frame)))) (+! tags-sorted 1) - (set! (-> obj tag i) tag2) - (set! (-> obj tag (+ i 1)) tag1) + (set! (-> this tag i) tag2) + (set! (-> this tag (+ i 1)) tag1) ) ) (+! i 1) @@ -642,15 +642,15 @@ ) ) ) - obj + this ) ;; definition for method 15 of type res-lump ;; INFO: Used lq/sq -(defmethod allocate-data-memory-for-tag! res-lump ((obj res-lump) (arg0 res-tag)) +(defmethod allocate-data-memory-for-tag! res-lump ((this res-lump) (arg0 res-tag)) (local-vars (resource-mem pointer)) - (let* ((tag-pair (lookup-tag-idx obj (-> arg0 name) 'exact (-> arg0 key-frame))) - (existing-tag (-> obj tag (-> tag-pair lo))) + (let* ((tag-pair (lookup-tag-idx this (-> arg0 name) 'exact (-> arg0 key-frame))) + (existing-tag (-> this tag (-> tag-pair lo))) ) 0 (if (and (>= (the-as int tag-pair) 0) (!= (-> arg0 key-frame) (-> arg0 key-frame))) @@ -662,46 +662,46 @@ (let ((data-size (length arg0))) (cond ((and (>= (the-as int tag-pair) 0) (>= (the-as uint (length existing-tag)) (the-as uint data-size))) - (set! resource-mem (&+ (-> obj data-base) (-> existing-tag data-offset))) + (set! resource-mem (&+ (-> this data-base) (-> existing-tag data-offset))) (when (logtest? (the-as int resource-mem) 7) - (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) - (set! (-> obj data-top) (&+ resource-mem data-size)) + (set! resource-mem (logand -16 (&+ (-> this data-top) 15))) + (set! (-> this data-top) (&+ resource-mem data-size)) ) ) (else - (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) - (set! (-> obj data-top) (&+ resource-mem data-size)) + (set! resource-mem (logand -16 (&+ (-> this data-top) 15))) + (set! (-> this data-top) (&+ resource-mem data-size)) ) ) (let* ((a0-22 arg0) - (s4-1 (copy-and-set-field a0-22 data-offset (&- resource-mem (the-as uint (-> obj data-base))))) + (s4-1 (copy-and-set-field a0-22 data-offset (&- resource-mem (the-as uint (-> this data-base))))) ) - (when (>= (the-as int (&+ resource-mem data-size)) (the-as int (&+ (-> obj data-base) (-> obj data-size)))) + (when (>= (the-as int (&+ resource-mem data-size)) (the-as int (&+ (-> this data-base) (-> this data-size)))) (format 0 "ERROR: attempting to a new tag ~`res-tag`P data of #x~X bytes to ~A, but data memory is full.~%" s4-1 data-size - obj + this ) (return (the-as res-tag #f)) ) (cond ((< (the-as int tag-pair) 0) (cond - ((>= (-> obj length) (-> obj allocated-length)) - (format 0 "ERROR: attempting to a new tag ~`res-tag`P to ~A, but tag memory is full.~%" s4-1 obj) + ((>= (-> this length) (-> this allocated-length)) + (format 0 "ERROR: attempting to a new tag ~`res-tag`P to ~A, but tag memory is full.~%" s4-1 this) (return (the-as res-tag #f)) ) (else - (set! (-> obj tag (-> obj length)) s4-1) - (+! (-> obj length) 1) - (sort! obj) + (set! (-> this tag (-> this length)) s4-1) + (+! (-> this length) 1) + (sort! this) ) ) ) (else - (set! (-> obj tag (-> tag-pair lo)) s4-1) + (set! (-> this tag (-> tag-pair lo)) s4-1) ) ) s4-1 @@ -711,10 +711,10 @@ ) ;; definition for method 17 of type res-lump -(defmethod add-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 pointer)) - (let ((new-tag (allocate-data-memory-for-tag! obj arg0))) +(defmethod add-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 pointer)) + (let ((new-tag (allocate-data-memory-for-tag! this arg0))) (when new-tag - (let* ((v1-2 obj) + (let* ((v1-2 this) (a1-1 new-tag) (tag-mem (&+ (-> v1-2 data-base) (-> a1-1 data-offset))) ) @@ -732,29 +732,36 @@ ) ) ) - obj + this ) ;; definition for method 18 of type res-lump -(defmethod add-32bit-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 object)) +(defmethod add-32bit-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 object)) (local-vars (sv-16 object)) (set! sv-16 arg1) (let* ((v1-0 arg0) (a1-4 (copy-and-set-field v1-0 inlined? 1)) ) - (add-data! obj a1-4 (& sv-16)) + (add-data! this a1-4 (& sv-16)) ) ) ;; definition for method 21 of type res-lump ;; INFO: Used lq/sq -(defmethod get-curve-data! res-lump ((obj res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) +(defmethod get-curve-data! res-lump ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s5-0 #f)) (set! sv-16 (new 'static 'res-tag)) - (let ((a0-2 - ((method-of-object obj get-property-data) obj arg1 'exact arg3 (the-as pointer #f) (& sv-16) *res-static-buf*) - ) + (let ((a0-2 ((method-of-object this get-property-data) + this + arg1 + 'exact + arg3 + (the-as pointer #f) + (& sv-16) + *res-static-buf* + ) + ) ) (when a0-2 (set! (-> arg0 cverts) (the-as (inline-array vector) a0-2)) @@ -769,9 +776,16 @@ (set! (-> arg0 num-cverts) 256) ) (set! sv-32 (new 'static 'res-tag)) - (let ((a0-6 - ((method-of-object obj get-property-data) obj arg2 'exact arg3 (the-as pointer #f) (& sv-32) *res-static-buf*) - ) + (let ((a0-6 ((method-of-object this get-property-data) + this + arg2 + 'exact + arg3 + (the-as pointer #f) + (& sv-32) + *res-static-buf* + ) + ) ) (when a0-6 (set! (-> arg0 knots) (the-as (pointer float) a0-6)) @@ -788,8 +802,8 @@ ;; definition for method 8 of type res-lump ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs res-lump. -;; WARN: Failed load: (set! v1-72 (l.wu (+ a0-58 -4))) at op 206 -(defmethod mem-usage res-lump ((obj res-lump) (block memory-usage-block) (flags int)) +;; ERROR: Failed load: (set! v1-72 (l.wu (+ a0-58 -4))) at op 206 +(defmethod mem-usage res-lump ((this res-lump) (block memory-usage-block) (flags int)) (local-vars (sv-16 int)) (let ((mem-use-id 48) (mem-use-name "res") @@ -815,13 +829,13 @@ (set! (-> block length) (max (-> block length) (+ mem-use-id 1))) (set! (-> block data mem-use-id name) mem-use-name) (+! (-> block data mem-use-id count) 1) - (let ((obj-size (asize-of obj))) + (let ((obj-size (asize-of this))) (+! (-> block data mem-use-id used) obj-size) (+! (-> block data mem-use-id total) (logand -16 (+ obj-size 15))) ) - (dotimes (tag-idx (-> obj length)) - (when (zero? (-> obj tag tag-idx inlined?)) - (let* ((a1-4 obj) + (dotimes (tag-idx (-> this length)) + (when (zero? (-> this tag tag-idx inlined?)) + (let* ((a1-4 this) (a0-15 tag-idx) (tag-data (the-as basic (-> (the-as (pointer uint32) (&+ (-> a1-4 data-base) (-> a1-4 tag a0-15 data-offset))))) diff --git a/test/decompiler/reference/jak1/engine/game/effect-control-h_REF.gc b/test/decompiler/reference/jak1/engine/game/effect-control-h_REF.gc index 4f44d5d473..6d8be20d6f 100644 --- a/test/decompiler/reference/jak1/engine/game/effect-control-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/effect-control-h_REF.gc @@ -27,17 +27,17 @@ ) ;; definition for method 3 of type effect-control -(defmethod inspect effect-control ((obj effect-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tflags: #x~X~%" (-> obj flags)) - (format #t "~Tlast-frame-group: ~A~%" (-> obj last-frame-group)) - (format #t "~Tlast-frame-num: ~f~%" (-> obj last-frame-num)) - (format #t "~Tchannel-offset: ~D~%" (-> obj channel-offset)) - (format #t "~Tres: ~A~%" (-> obj res)) - (format #t "~Tname: #x~X~%" (-> obj name)) - (format #t "~Tparam: #x~X~%" (-> obj param)) - obj +(defmethod inspect effect-control ((this effect-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tflags: #x~X~%" (-> this flags)) + (format #t "~Tlast-frame-group: ~A~%" (-> this last-frame-group)) + (format #t "~Tlast-frame-num: ~f~%" (-> this last-frame-num)) + (format #t "~Tchannel-offset: ~D~%" (-> this channel-offset)) + (format #t "~Tres: ~A~%" (-> this res)) + (format #t "~Tname: #x~X~%" (-> this name)) + (format #t "~Tparam: #x~X~%" (-> this param)) + this ) ;; definition for method 0 of type effect-control @@ -58,8 +58,8 @@ ;; definition for method 13 of type effect-control ;; INFO: Return type mismatch int vs none. -(defmethod set-channel-offset! effect-control ((obj effect-control) (arg0 int)) - (set! (-> obj channel-offset) arg0) +(defmethod set-channel-offset! effect-control ((this effect-control) (arg0 int)) + (set! (-> this channel-offset) arg0) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc index b953a283bb..2446a8bca3 100644 --- a/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/effect-control_REF.gc @@ -130,10 +130,10 @@ ;; definition for method 9 of type effect-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod effect-control-method-9 effect-control ((obj effect-control)) - (let* ((a0-1 (-> obj process skel)) - (v1-3 (if (< (-> obj channel-offset) (-> a0-1 active-channels)) - (-> a0-1 root-channel (-> obj channel-offset)) +(defmethod effect-control-method-9 effect-control ((this effect-control)) + (let* ((a0-1 (-> this process skel)) + (v1-3 (if (< (-> this channel-offset) (-> a0-1 active-channels)) + (-> a0-1 root-channel (-> this channel-offset)) (the-as joint-control-channel #f) ) ) @@ -145,24 +145,24 @@ ) (let ((a0-3 (-> a0-1 root-channel 0 num-func))) (cond - ((!= s5-0 (-> obj last-frame-group)) - (set! (-> obj res) (-> s5-0 extra)) + ((!= s5-0 (-> this last-frame-group)) + (set! (-> this res) (-> s5-0 extra)) (let ((v1-6 (-> (lookup-tag-idx (-> s5-0 extra) 'effect-name 'base -1000000000.0) lo))) - (set! (-> obj name) (if (>= (the-as int v1-6) 0) - (&-> (-> s5-0 extra tag) v1-6) - (the-as (pointer res-tag) #f) - ) + (set! (-> this name) (if (>= (the-as int v1-6) 0) + (&-> (-> s5-0 extra tag) v1-6) + (the-as (pointer res-tag) #f) + ) ) ) - (if (and (-> obj name) (= (-> obj name 0 key-frame) -1000000000.0)) - (set! (-> obj name) (&-> (-> obj name) 1)) + (if (and (-> this name) (= (-> this name 0 key-frame) -1000000000.0)) + (set! (-> this name) (&-> (-> this name) 1)) ) - (effect-control-method-14 obj f30-0 f30-0 f30-0) + (effect-control-method-14 this f30-0 f30-0 f30-0) ) - ((or (not (-> obj name)) (= f30-0 (-> obj last-frame-num))) + ((or (not (-> this name)) (= f30-0 (-> this last-frame-num))) ) (else - (let ((f28-0 (-> obj last-frame-num)) + (let ((f28-0 (-> this last-frame-num)) (f26-0 f30-0) ) (cond @@ -171,12 +171,12 @@ (cond ((< f26-0 f28-0) (if (>= f28-0 f0-6) - (effect-control-method-14 obj f26-0 f28-0 f30-0) + (effect-control-method-14 this f26-0 f28-0 f30-0) ) ) (else (if (>= f0-6 f28-0) - (effect-control-method-14 obj f28-0 f26-0 f30-0) + (effect-control-method-14 this f28-0 f26-0 f30-0) ) ) ) @@ -187,43 +187,43 @@ ((>= (-> v1-3 param 0) 0.0) (cond ((< f26-0 f28-0) - (effect-control-method-14 obj f28-0 9999999.0 f30-0) - (effect-control-method-14 obj -100000000.0 f26-0 9999999.0) + (effect-control-method-14 this f28-0 9999999.0 f30-0) + (effect-control-method-14 this -100000000.0 f26-0 9999999.0) ) (else - (effect-control-method-14 obj f28-0 f26-0 f30-0) + (effect-control-method-14 this f28-0 f26-0 f30-0) ) ) ) ((< f28-0 f26-0) - (effect-control-method-14 obj f26-0 9999999.0 f30-0) - (effect-control-method-14 obj -100000000.0 f28-0 9999999.0) + (effect-control-method-14 this f26-0 9999999.0 f30-0) + (effect-control-method-14 this -100000000.0 f28-0 9999999.0) ) (else - (effect-control-method-14 obj f26-0 f28-0 f30-0) + (effect-control-method-14 this f26-0 f28-0 f30-0) ) ) ) ((= a0-3 num-func-+!) (if (>= (-> v1-3 param 0) 0.0) - (effect-control-method-14 obj f28-0 f26-0 f30-0) - (effect-control-method-14 obj f26-0 f28-0 f30-0) + (effect-control-method-14 this f28-0 f26-0 f30-0) + (effect-control-method-14 this f26-0 f28-0 f30-0) ) ) ((= a0-3 num-func-identity) - (effect-control-method-14 obj f30-0 f30-0 f30-0) + (effect-control-method-14 this f30-0 f30-0 f30-0) ) ) ) ) ) ) - (set! (-> obj last-frame-group) s5-0) - (set! (-> obj last-frame-num) f30-0) + (set! (-> this last-frame-group) s5-0) + (set! (-> this last-frame-num) f30-0) ) ) (else - (set! (-> obj last-frame-group) #f) + (set! (-> this last-frame-group) #f) ) ) ) @@ -234,14 +234,14 @@ ;; definition for method 14 of type effect-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod effect-control-method-14 effect-control ((obj effect-control) (arg0 float) (arg1 float) (arg2 float)) - (let ((s2-0 (-> obj name))) +(defmethod effect-control-method-14 effect-control ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) + (let ((s2-0 (-> this name))) (while (= (-> s2-0 0 name) 'effect-name) (let ((f0-0 (-> s2-0 0 key-frame))) (when (or (and (< f0-0 arg1) (< arg0 f0-0)) (= f0-0 arg2)) - (let* ((a0-1 obj) + (let* ((a0-1 this) (t9-0 (method-of-object a0-1 effect-control-method-10)) - (v1-7 (-> obj res)) + (v1-7 (-> this res)) (a1-1 (-> s2-0 0)) ) (t9-0 @@ -263,14 +263,7 @@ ;; definition for method 10 of type effect-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 205] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 217] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 237] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 343] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 364] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 450] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 469] -(defmethod effect-control-method-10 effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int)) +(defmethod effect-control-method-10 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) (local-vars (sv-160 int) (sv-176 symbol) @@ -286,7 +279,7 @@ (s5-0 (cond ((< arg2 0) (let ((v0-0 (get-property-value - (-> obj res) + (-> this res) 'effect-joint 'exact arg1 @@ -309,8 +302,8 @@ ) ) ) - (when (logtest? (-> obj flags) 1) - (if (send-event (-> obj process) 'effect arg0 arg1 s5-0) + (when (logtest? (-> this flags) 1) + (if (send-event (-> this process) 'effect arg0 arg1 s5-0) (return (the-as object 0)) ) ) @@ -324,7 +317,7 @@ (= (-> v1-10 data 5) 116) (= (-> v1-10 data 6) 45) ) - (let* ((s3-1 (-> obj process root)) + (let* ((s3-1 (-> this process root)) (v1-14 (if (and (nonzero? s3-1) (type-type? (-> s3-1 type) collide-shape-moving)) s3-1 ) @@ -335,7 +328,7 @@ ) ) ) - (effect-control-method-11 obj arg0 arg1 s5-0 (-> obj res) (the-as pat-surface t1-1)) + (effect-control-method-11 this arg0 arg1 s5-0 (-> this res) (the-as pat-surface t1-1)) ) ) ((let ((v1-18 (symbol->string arg0))) @@ -367,8 +360,8 @@ (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) + (current-time) + (-> this process name) arg0 arg1 s5-0 @@ -377,7 +370,7 @@ (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-1 (let ((t9-7 (method-of-type part-tracker activate))) - (t9-7 (the-as part-tracker s4-1) (-> obj process) 'part-tracker (the-as pointer #x70004000)) + (t9-7 (the-as part-tracker s4-1) (-> this process) 'part-tracker (the-as pointer #x70004000)) ) (let ((s2-1 run-function-in-process) (s1-0 s4-1) @@ -387,7 +380,7 @@ (set! sv-176 (the-as symbol #f)) (set! sv-192 (the-as symbol #f)) (set! sv-208 (the-as symbol #f)) - (let ((t3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) + (let ((t3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)))) ((the-as (function object object object object object object object object none) s2-1) s1-0 s0-0 @@ -409,15 +402,15 @@ (activate! *camera-smush-control* 819.2 37 600 1.0 0.995) ) ((zero? s3-0) - (effect-control-method-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) + (effect-control-method-12 this arg0 arg1 s5-0 (-> this res) (string->sound-name (symbol->string arg0))) ) ((= (-> (the-as basic s3-0) type) sparticle-launcher) (if *debug-effect-control* (format #t "(~5D) effect part ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) + (current-time) + (-> this process name) arg0 arg1 s5-0 @@ -426,15 +419,15 @@ (format #t "-----> (~5D) effect part ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) + (current-time) + (-> this process name) arg0 arg1 s5-0 ) (launch-particles (the-as sparticle-launcher s3-0) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) ) ) ((= (-> (the-as basic s3-0) type) sparticle-launch-group) @@ -442,8 +435,8 @@ (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" - (-> *display* base-frame-counter) - (-> obj process name) + (current-time) + (-> this process name) arg0 arg1 s5-0 @@ -452,7 +445,7 @@ (let ((s4-3 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-3 (let ((t9-19 (method-of-type part-tracker activate))) - (t9-19 (the-as part-tracker s4-3) (-> obj process) 'part-tracker (the-as pointer #x70004000)) + (t9-19 (the-as part-tracker s4-3) (-> this process) 'part-tracker (the-as pointer #x70004000)) ) (let ((s2-3 run-function-in-process) (s1-2 s4-3) @@ -462,7 +455,7 @@ (set! sv-240 (the-as symbol #f)) (set! sv-256 (the-as symbol #f)) (set! sv-272 (the-as symbol #f)) - (let ((t3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)))) + (let ((t3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)))) ((the-as (function object object object object object object object object none) s2-3) s1-2 s0-2 @@ -483,11 +476,11 @@ (sound-play-by-spec (the-as sound-spec s3-0) (new-sound-id) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) ) ) ((= (-> (the-as basic s3-0) type) death-info) - (let ((v1-67 (-> obj process draw))) + (let ((v1-67 (-> this process draw))) (let ((a1-42 (-> (the-as death-info s3-0) vertex-skip)) (a0-55 (max @@ -519,20 +512,20 @@ (set! (-> v1-67 death-draw-overlap) (-> (the-as death-info s3-0) overlap)) ) (when (-> (the-as death-info s3-0) sound) - (let* ((s2-5 obj) + (let* ((s2-5 this) (s1-3 (method-of-object s2-5 effect-control-method-12)) (s0-3 (-> (the-as death-info s3-0) sound)) ) - (set! sv-288 (-> obj res)) + (set! sv-288 (-> this res)) (let ((t1-11 (string->sound-name (symbol->string (-> (the-as death-info s3-0) sound))))) (s1-3 s2-5 s0-3 arg1 s5-0 sv-288 t1-11) ) ) ) - (send-event (-> obj process) 'death-start (the-as death-info s3-0)) + (send-event (-> this process) 'death-start (the-as death-info s3-0)) ) (else - (effect-control-method-12 obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) + (effect-control-method-12 this arg0 arg1 s5-0 (-> this res) (string->sound-name (symbol->string arg0))) ) ) ) @@ -543,7 +536,7 @@ ;; definition for method 11 of type effect-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod effect-control-method-11 effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) +(defmethod effect-control-method-11 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) (local-vars (sv-48 (function sparticle-system sparticle-launcher vector sparticle-launch-state sparticle-launch-control float none) @@ -583,7 +576,7 @@ ) (('effect-land-poof) (when (< a0-4 9000) - (let* ((a0-13 obj) + (let* ((a0-13 this) (t9-8 (method-of-object a0-13 effect-control-method-10)) (v1-15 (-> arg4 material)) ) @@ -650,7 +643,7 @@ ) (('effect-run-poof) (when (< a0-4 9000) - (let* ((a0-14 obj) + (let* ((a0-14 this) (t9-9 (method-of-object a0-14 effect-control-method-10)) (v1-20 (-> arg4 material)) ) @@ -716,7 +709,7 @@ ) ) (('effect-just-footprint) - (let* ((a0-15 obj) + (let* ((a0-15 this) (t9-10 (method-of-object a0-15 effect-control-method-10)) (v1-24 (-> arg4 material)) ) @@ -782,7 +775,7 @@ ) (('effect-just-poof) (when (< a0-4 9000) - (let* ((a0-16 obj) + (let* ((a0-16 this) (t9-11 (method-of-object a0-16 effect-control-method-10)) (v1-29 (-> arg4 material)) ) @@ -848,7 +841,7 @@ ) ) (('effect-slide-poof) - (let* ((a0-19 obj) + (let* ((a0-19 this) (t9-12 (method-of-object a0-19 effect-control-method-10)) (v1-33 (-> arg4 material)) ) @@ -972,7 +965,7 @@ (when (nonzero? s0-0) (set! sv-48 sp-launch-particles-var) (set! sv-64 *sp-particle-system-2d*) - (let ((a2-36 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2))) + (let ((a2-36 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2))) (a3-6 #f) (t0-1 #f) (t1-1 1.0) @@ -1042,7 +1035,7 @@ (when (nonzero? s0-1) (set! sv-80 sp-launch-particles-var) (set! sv-96 *sp-particle-system-2d*) - (let ((a2-37 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2))) + (let ((a2-37 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2))) (a3-7 #f) (t0-2 #f) (t1-2 1.0) @@ -1055,7 +1048,7 @@ ) ) (if s1-0 - (effect-control-method-12 obj arg0 arg1 arg2 arg3 s1-0) + (effect-control-method-12 this arg0 arg1 arg2 arg3 s1-0) ) ) 0 @@ -1064,14 +1057,14 @@ ;; definition for method 12 of type effect-control ;; INFO: Used lq/sq -(defmethod effect-control-method-12 effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) +(defmethod effect-control-method-12 effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) (local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float))) (set! sv-144 arg3) (let ((s0-0 arg4) (gp-0 (new 'stack 'sound-spec)) (s5-0 (if (< arg2 0) (the-as vector #f) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) ) ) ) @@ -1111,8 +1104,8 @@ (format #t "(~5D) effect sound ~A ~A (~S) frame ~F joint ~D " - (-> *display* base-frame-counter) - (-> obj process name) + (current-time) + (-> this process name) arg0 *temp-string* arg1 diff --git a/test/decompiler/reference/jak1/engine/game/fact-h_REF.gc b/test/decompiler/reference/jak1/engine/game/fact-h_REF.gc index 3b37e8a114..17c16c3330 100644 --- a/test/decompiler/reference/jak1/engine/game/fact-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/fact-h_REF.gc @@ -25,24 +25,24 @@ ) ;; definition for method 3 of type fact-bank -(defmethod inspect fact-bank ((obj fact-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Teco-level-max: ~f~%" (-> obj eco-level-max)) - (format #t "~Teco-single-inc: ~f~%" (-> obj eco-single-inc)) - (format #t "~Teco-full-inc: ~f~%" (-> obj eco-full-inc)) - (format #t "~Teco-single-timeout: (seconds ~e)~%" (-> obj eco-single-timeout)) - (format #t "~Teco-full-timeout: (seconds ~e)~%" (-> obj eco-full-timeout)) - (format #t "~Tdummy: (seconds ~e)~%" (-> obj dummy)) - (format #t "~Thealth-max-default: ~f~%" (-> obj health-max-default)) - (format #t "~Thealth-single-inc: ~f~%" (-> obj health-single-inc)) - (format #t "~Teco-pill-max-default: ~f~%" (-> obj eco-pill-max-default)) - (format #t "~Thealth-small-inc: ~f~%" (-> obj health-small-inc)) - (format #t "~Tbuzzer-max-default: ~f~%" (-> obj buzzer-max-default)) - (format #t "~Tbuzzer-single-inc: ~f~%" (-> obj buzzer-single-inc)) - (format #t "~Tsuck-bounce-dist: (meters ~m)~%" (-> obj suck-bounce-dist)) - (format #t "~Tsuck-suck-dist: (meters ~m)~%" (-> obj suck-suck-dist)) - (format #t "~Tdefault-pill-inc: ~f~%" (-> obj default-pill-inc)) - obj +(defmethod inspect fact-bank ((this fact-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Teco-level-max: ~f~%" (-> this eco-level-max)) + (format #t "~Teco-single-inc: ~f~%" (-> this eco-single-inc)) + (format #t "~Teco-full-inc: ~f~%" (-> this eco-full-inc)) + (format #t "~Teco-single-timeout: (seconds ~e)~%" (-> this eco-single-timeout)) + (format #t "~Teco-full-timeout: (seconds ~e)~%" (-> this eco-full-timeout)) + (format #t "~Tdummy: (seconds ~e)~%" (-> this dummy)) + (format #t "~Thealth-max-default: ~f~%" (-> this health-max-default)) + (format #t "~Thealth-single-inc: ~f~%" (-> this health-single-inc)) + (format #t "~Teco-pill-max-default: ~f~%" (-> this eco-pill-max-default)) + (format #t "~Thealth-small-inc: ~f~%" (-> this health-small-inc)) + (format #t "~Tbuzzer-max-default: ~f~%" (-> this buzzer-max-default)) + (format #t "~Tbuzzer-single-inc: ~f~%" (-> this buzzer-single-inc)) + (format #t "~Tsuck-bounce-dist: (meters ~m)~%" (-> this suck-bounce-dist)) + (format #t "~Tsuck-suck-dist: (meters ~m)~%" (-> this suck-suck-dist)) + (format #t "~Tdefault-pill-inc: ~f~%" (-> this default-pill-inc)) + this ) ;; definition for symbol *FACT-bank*, type fact-bank @@ -124,15 +124,15 @@ ) ;; definition for method 3 of type fact-info -(defmethod inspect fact-info ((obj fact-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tpickup-type: ~D~%" (-> obj pickup-type)) - (format #t "~Tpickup-amount: ~f~%" (-> obj pickup-amount)) - (format #t "~Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) - (format #t "~Toptions: ~D~%" (-> obj options)) - (format #t "~Tfade-time: ~D~%" (-> obj fade-time)) - obj +(defmethod inspect fact-info ((this fact-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tpickup-type: ~D~%" (-> this pickup-type)) + (format #t "~Tpickup-amount: ~f~%" (-> this pickup-amount)) + (format #t "~Tpickup-spawn-amount: ~f~%" (-> this pickup-spawn-amount)) + (format #t "~Toptions: ~D~%" (-> this options)) + (format #t "~Tfade-time: ~D~%" (-> this fade-time)) + this ) ;; definition of type fact-info-target @@ -164,32 +164,32 @@ ) ;; definition for method 3 of type fact-info-target -(defmethod inspect fact-info-target ((obj fact-info-target)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tpickup-type: ~D~%" (-> obj pickup-type)) - (format #t "~Tpickup-amount: ~f~%" (-> obj pickup-amount)) - (format #t "~Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) - (format #t "~Toptions: ~D~%" (-> obj options)) - (format #t "~Tfade-time: ~D~%" (-> obj fade-time)) - (format #t "~Teco-type: ~D~%" (-> obj eco-type)) - (format #t "~Teco-level: ~f~%" (-> obj eco-level)) - (format #t "~Teco-pickup-time: ~D~%" (-> obj eco-pickup-time)) - (format #t "~Teco-timeout: (seconds ~e)~%" (-> obj eco-timeout)) - (format #t "~Thealth: ~f~%" (-> obj health)) - (format #t "~Thealth-max: ~f~%" (-> obj health-max)) - (format #t "~Tbuzzer: ~f~%" (-> obj buzzer)) - (format #t "~Tbuzzer-max: ~f~%" (-> obj buzzer-max)) - (format #t "~Teco-pill: ~f~%" (-> obj eco-pill)) - (format #t "~Teco-pill-max: ~f~%" (-> obj eco-pill-max)) - (format #t "~Thealth-pickup-time: ~D~%" (-> obj health-pickup-time)) - (format #t "~Teco-source: ~D~%" (-> obj eco-source)) - (format #t "~Teco-source-time: ~D~%" (-> obj eco-source-time)) - (format #t "~Tmoney-pickup-time: ~D~%" (-> obj money-pickup-time)) - (format #t "~Tbuzzer-pickup-time: ~D~%" (-> obj buzzer-pickup-time)) - (format #t "~Tfuel-cell-pickup-time: ~D~%" (-> obj fuel-cell-pickup-time)) - (format #t "~Teco-pill-pickup-time: ~D~%" (-> obj eco-pill-pickup-time)) - obj +(defmethod inspect fact-info-target ((this fact-info-target)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tpickup-type: ~D~%" (-> this pickup-type)) + (format #t "~Tpickup-amount: ~f~%" (-> this pickup-amount)) + (format #t "~Tpickup-spawn-amount: ~f~%" (-> this pickup-spawn-amount)) + (format #t "~Toptions: ~D~%" (-> this options)) + (format #t "~Tfade-time: ~D~%" (-> this fade-time)) + (format #t "~Teco-type: ~D~%" (-> this eco-type)) + (format #t "~Teco-level: ~f~%" (-> this eco-level)) + (format #t "~Teco-pickup-time: ~D~%" (-> this eco-pickup-time)) + (format #t "~Teco-timeout: (seconds ~e)~%" (-> this eco-timeout)) + (format #t "~Thealth: ~f~%" (-> this health)) + (format #t "~Thealth-max: ~f~%" (-> this health-max)) + (format #t "~Tbuzzer: ~f~%" (-> this buzzer)) + (format #t "~Tbuzzer-max: ~f~%" (-> this buzzer-max)) + (format #t "~Teco-pill: ~f~%" (-> this eco-pill)) + (format #t "~Teco-pill-max: ~f~%" (-> this eco-pill-max)) + (format #t "~Thealth-pickup-time: ~D~%" (-> this health-pickup-time)) + (format #t "~Teco-source: ~D~%" (-> this eco-source)) + (format #t "~Teco-source-time: ~D~%" (-> this eco-source-time)) + (format #t "~Tmoney-pickup-time: ~D~%" (-> this money-pickup-time)) + (format #t "~Tbuzzer-pickup-time: ~D~%" (-> this buzzer-pickup-time)) + (format #t "~Tfuel-cell-pickup-time: ~D~%" (-> this fuel-cell-pickup-time)) + (format #t "~Teco-pill-pickup-time: ~D~%" (-> this eco-pill-pickup-time)) + this ) ;; definition of type fact-info-enemy @@ -211,42 +211,42 @@ ) ;; definition for method 3 of type fact-info-enemy -(defmethod inspect fact-info-enemy ((obj fact-info-enemy)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tpickup-type: ~D~%" (-> obj pickup-type)) - (format #t "~Tpickup-amount: ~f~%" (-> obj pickup-amount)) - (format #t "~Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) - (format #t "~Toptions: ~D~%" (-> obj options)) - (format #t "~Tfade-time: ~D~%" (-> obj fade-time)) - (format #t "~Tspeed: ~f~%" (-> obj speed)) - (format #t "~Tidle-distance: (meters ~m)~%" (-> obj idle-distance)) - (format #t "~Tnotice-top: (meters ~m)~%" (-> obj notice-top)) - (format #t "~Tnotice-bottom: (meters ~m)~%" (-> obj notice-bottom)) - (format #t "~Tcam-horz: (meters ~m)~%" (-> obj cam-horz)) - (format #t "~Tcam-vert: (meters ~m)~%" (-> obj cam-vert)) - (format #t "~Tcam-notice-dist: (meters ~m)~%" (-> obj cam-notice-dist)) - obj +(defmethod inspect fact-info-enemy ((this fact-info-enemy)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tpickup-type: ~D~%" (-> this pickup-type)) + (format #t "~Tpickup-amount: ~f~%" (-> this pickup-amount)) + (format #t "~Tpickup-spawn-amount: ~f~%" (-> this pickup-spawn-amount)) + (format #t "~Toptions: ~D~%" (-> this options)) + (format #t "~Tfade-time: ~D~%" (-> this fade-time)) + (format #t "~Tspeed: ~f~%" (-> this speed)) + (format #t "~Tidle-distance: (meters ~m)~%" (-> this idle-distance)) + (format #t "~Tnotice-top: (meters ~m)~%" (-> this notice-top)) + (format #t "~Tnotice-bottom: (meters ~m)~%" (-> this notice-bottom)) + (format #t "~Tcam-horz: (meters ~m)~%" (-> this cam-horz)) + (format #t "~Tcam-vert: (meters ~m)~%" (-> this cam-vert)) + (format #t "~Tcam-notice-dist: (meters ~m)~%" (-> this cam-notice-dist)) + this ) ;; definition for method 0 of type fact-info ;; INFO: Used lq/sq (defmethod new fact-info ((allocation symbol) (type-to-make type) (proc process-drawable) (pkup-type pickup-type) (pkup-amount float)) (local-vars (tag res-tag)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (let ((ent (-> proc entity))) - (when (zero? obj) + (when (zero? this) (go process-drawable-art-error "memory") - (set! obj (the-as fact-info 0)) + (set! this (the-as fact-info 0)) (goto cfg-10) ) - (set! (-> obj process) proc) + (set! (-> this process) proc) (set! tag (new 'static 'res-tag)) (let ((v1-6 (res-lump-data ent 'eco-info (pointer int32) :tag-ptr (& tag) :time 0.0))) (cond (v1-6 (let ((a0-6 (-> tag elt-count))) - (set! (-> obj pickup-type) (the-as pickup-type (-> v1-6 0))) + (set! (-> this pickup-type) (the-as pickup-type (-> v1-6 0))) (set! pkup-amount (cond ((< (the-as uint 1) a0-6) (the float (-> v1-6 1)) @@ -258,50 +258,50 @@ ) ) ) - (set! (-> obj pickup-amount) pkup-amount) + (set! (-> this pickup-amount) pkup-amount) ) (else - (set! (-> obj pickup-type) pkup-type) - (set! (-> obj pickup-amount) pkup-amount) + (set! (-> this pickup-type) pkup-type) + (set! (-> this pickup-amount) pkup-amount) ) ) ) - (set! (-> obj options) (res-lump-value ent 'options fact-options)) - (if (logtest? (fact-options fade respawn) (-> obj options)) - (set! (-> obj fade-time) (the-as time-frame (the int (* 300.0 (res-lump-float ent 'timeout))))) + (set! (-> this options) (res-lump-value ent 'options fact-options)) + (if (logtest? (fact-options fade respawn) (-> this options)) + (set! (-> this fade-time) (the-as time-frame (the int (* 300.0 (res-lump-float ent 'timeout))))) ) ) (label cfg-10) - obj + this ) ) ;; definition for method 11 of type fact-info -(defmethod pickup-collectable! fact-info ((obj fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! fact-info ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) 0.0 ) ;; definition for method 0 of type fact-info-enemy (defmethod new fact-info-enemy ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 pickup-type) (arg2 float)) - (let ((obj (the-as fact-info-enemy ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2)))) - (let ((entity (-> obj process entity))) - (set! (-> obj speed) (res-lump-float entity 'speed :default 1.0)) - (set! (-> obj idle-distance) (res-lump-float entity 'idle-distance :default 327680.0)) - (set! (-> obj notice-top) (res-lump-float entity 'notice-top :default 4096000.0)) - (set! (-> obj notice-bottom) (res-lump-float entity 'notice-bottom :default 4096000.0)) - (set! (-> obj cam-horz) (res-lump-float entity 'cam-horz)) - (set! (-> obj cam-vert) (res-lump-float entity 'cam-vert)) - (set! (-> obj cam-notice-dist) (res-lump-float entity 'cam-notice-dist :default -4096.0)) + (let ((this (the-as fact-info-enemy ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2)))) + (let ((entity (-> this process entity))) + (set! (-> this speed) (res-lump-float entity 'speed :default 1.0)) + (set! (-> this idle-distance) (res-lump-float entity 'idle-distance :default 327680.0)) + (set! (-> this notice-top) (res-lump-float entity 'notice-top :default 4096000.0)) + (set! (-> this notice-bottom) (res-lump-float entity 'notice-bottom :default 4096000.0)) + (set! (-> this cam-horz) (res-lump-float entity 'cam-horz)) + (set! (-> this cam-vert) (res-lump-float entity 'cam-vert)) + (set! (-> this cam-notice-dist) (res-lump-float entity 'cam-notice-dist :default -4096.0)) ) - obj + this ) ) ;; definition for method 0 of type fact-info-target (defmethod new fact-info-target ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 pickup-type) (arg2 float)) - (let ((obj (the-as fact-info-target ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2)))) - (set! (-> obj eco-source) (the-as handle #f)) - (reset! obj #f) - obj + (let ((this (the-as fact-info-target ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2)))) + (set! (-> this eco-source) (the-as handle #f)) + (reset! this #f) + this ) ) diff --git a/test/decompiler/reference/jak1/engine/game/game-h_REF.gc b/test/decompiler/reference/jak1/engine/game/game-h_REF.gc index b81280dc0c..1d4ad66504 100644 --- a/test/decompiler/reference/jak1/engine/game/game-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-h_REF.gc @@ -38,26 +38,26 @@ ) ;; definition for method 3 of type process-drawable -(defmethod inspect process-drawable ((obj process-drawable)) +(defmethod inspect process-drawable ((this process-drawable)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Troot: ~A~%" (-> obj root)) - (format #t "~T~Tnode-list: ~A~%" (-> obj node-list)) - (format #t "~T~Tdraw: ~A~%" (-> obj draw)) - (format #t "~T~Tskel: ~A~%" (-> obj skel)) - (format #t "~T~Tnav: ~A~%" (-> obj nav)) - (format #t "~T~Talign: ~A~%" (-> obj align)) - (format #t "~T~Tpath: ~A~%" (-> obj path)) - (format #t "~T~Tvol: ~A~%" (-> obj vol)) - (format #t "~T~Tfact: ~A~%" (-> obj fact)) - (format #t "~T~Tlink: ~A~%" (-> obj link)) - (format #t "~T~Tpart: ~A~%" (-> obj part)) - (format #t "~T~Twater: ~A~%" (-> obj water)) - (format #t "~T~Tsound: ~A~%" (-> obj sound)) - (format #t "~T~Tstate-flags: ~D~%" (-> obj state-flags)) - (format #t "~T~Tstate-time: ~D~%" (-> obj state-time)) - obj + (format #t "~T~Troot: ~A~%" (-> this root)) + (format #t "~T~Tnode-list: ~A~%" (-> this node-list)) + (format #t "~T~Tdraw: ~A~%" (-> this draw)) + (format #t "~T~Tskel: ~A~%" (-> this skel)) + (format #t "~T~Tnav: ~A~%" (-> this nav)) + (format #t "~T~Talign: ~A~%" (-> this align)) + (format #t "~T~Tpath: ~A~%" (-> this path)) + (format #t "~T~Tvol: ~A~%" (-> this vol)) + (format #t "~T~Tfact: ~A~%" (-> this fact)) + (format #t "~T~Tlink: ~A~%" (-> this link)) + (format #t "~T~Tpart: ~A~%" (-> this part)) + (format #t "~T~Twater: ~A~%" (-> this water)) + (format #t "~T~Tsound: ~A~%" (-> this sound)) + (format #t "~T~Tstate-flags: ~D~%" (-> this state-flags)) + (format #t "~T~Tstate-time: ~D~%" (-> this state-time)) + this ) ;; definition of type process-drawable-reserved @@ -115,11 +115,11 @@ ) ;; definition for method 3 of type process-drawable-reserved -(defmethod inspect process-drawable-reserved ((obj process-drawable-reserved)) +(defmethod inspect process-drawable-reserved ((this process-drawable-reserved)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type attack-info @@ -149,24 +149,24 @@ ) ;; definition for method 3 of type attack-info -(defmethod inspect attack-info ((obj attack-info)) - (format #t "[~8x] ~A~%" obj 'attack-info) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Tvector: ~`vector`P~%" (-> obj vector)) - (format #t "~Tintersection: ~`vector`P~%" (-> obj intersection)) - (format #t "~Tattacker: ~`handle`P~%" (-> obj attacker)) - (format #t "~Tinvinc-time: ~D~%" (-> obj invinc-time)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tmode: ~A~%" (-> obj mode)) - (format #t "~Tshove-back: (meters ~m)~%" (-> obj shove-back)) - (format #t "~Tshove-up: (meters ~m)~%" (-> obj shove-up)) - (format #t "~Tspeed: (meters ~m)~%" (-> obj speed)) - (format #t "~Tdist: (meters ~m)~%" (-> obj dist)) - (format #t "~Tcontrol: ~f~%" (-> obj control)) - (format #t "~Tangle: ~A~%" (-> obj angle)) - (format #t "~Trotate-to: (deg ~r)~%" (-> obj rotate-to)) - (format #t "~Tprev-state: ~A~%" (-> obj prev-state)) - obj +(defmethod inspect attack-info ((this attack-info)) + (format #t "[~8x] ~A~%" this 'attack-info) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Tvector: ~`vector`P~%" (-> this vector)) + (format #t "~Tintersection: ~`vector`P~%" (-> this intersection)) + (format #t "~Tattacker: ~`handle`P~%" (-> this attacker)) + (format #t "~Tinvinc-time: ~D~%" (-> this invinc-time)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tmode: ~A~%" (-> this mode)) + (format #t "~Tshove-back: (meters ~m)~%" (-> this shove-back)) + (format #t "~Tshove-up: (meters ~m)~%" (-> this shove-up)) + (format #t "~Tspeed: (meters ~m)~%" (-> this speed)) + (format #t "~Tdist: (meters ~m)~%" (-> this dist)) + (format #t "~Tcontrol: ~f~%" (-> this control)) + (format #t "~Tangle: ~A~%" (-> this angle)) + (format #t "~Trotate-to: (deg ~r)~%" (-> this rotate-to)) + (format #t "~Tprev-state: ~A~%" (-> this prev-state)) + this ) ;; definition for symbol *global-attack-id*, type int @@ -184,12 +184,12 @@ ) ;; definition for method 3 of type ground-tween-info -(defmethod inspect ground-tween-info ((obj ground-tween-info)) - (format #t "[~8x] ~A~%" obj 'ground-tween-info) - (format #t "~Tchan[3] @ #x~X~%" (-> obj chan)) - (format #t "~Tblend[3] @ #x~X~%" (-> obj blend)) - (format #t "~Tgroup[5] @ #x~X~%" (-> obj group)) - obj +(defmethod inspect ground-tween-info ((this ground-tween-info)) + (format #t "[~8x] ~A~%" this 'ground-tween-info) + (format #t "~Tchan[3] @ #x~X~%" (-> this chan)) + (format #t "~Tblend[3] @ #x~X~%" (-> this blend)) + (format #t "~Tgroup[5] @ #x~X~%" (-> this group)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/game/game-info-h_REF.gc b/test/decompiler/reference/jak1/engine/game/game-info-h_REF.gc index f0ab683f11..a111d1f78e 100644 --- a/test/decompiler/reference/jak1/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-info-h_REF.gc @@ -17,14 +17,14 @@ ) ;; definition for method 3 of type game-bank -(defmethod inspect game-bank ((obj game-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlife-max-default: ~f~%" (-> obj life-max-default)) - (format #t "~Tlife-start-default: ~f~%" (-> obj life-start-default)) - (format #t "~Tlife-single-inc: ~f~%" (-> obj life-single-inc)) - (format #t "~Tmoney-task-inc: ~f~%" (-> obj money-task-inc)) - (format #t "~Tmoney-oracle-inc: ~f~%" (-> obj money-oracle-inc)) - obj +(defmethod inspect game-bank ((this game-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlife-max-default: ~f~%" (-> this life-max-default)) + (format #t "~Tlife-start-default: ~f~%" (-> this life-start-default)) + (format #t "~Tlife-single-inc: ~f~%" (-> this life-single-inc)) + (format #t "~Tmoney-task-inc: ~f~%" (-> this money-task-inc)) + (format #t "~Tmoney-oracle-inc: ~f~%" (-> this money-oracle-inc)) + this ) ;; definition for symbol *GAME-bank*, type game-bank @@ -59,13 +59,13 @@ ) ;; definition for method 3 of type level-buffer-state -(defmethod inspect level-buffer-state ((obj level-buffer-state)) - (format #t "[~8x] ~A~%" obj 'level-buffer-state) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tdisplay?: ~A~%" (-> obj display?)) - (format #t "~Tforce-vis?: ~A~%" (-> obj force-vis?)) - (format #t "~Tforce-inside?: ~A~%" (-> obj force-inside?)) - obj +(defmethod inspect level-buffer-state ((this level-buffer-state)) + (format #t "[~8x] ~A~%" this 'level-buffer-state) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tdisplay?: ~A~%" (-> this display?)) + (format #t "~Tforce-vis?: ~A~%" (-> this force-vis?)) + (format #t "~Tforce-inside?: ~A~%" (-> this force-inside?)) + this ) ;; definition of type load-state @@ -97,14 +97,14 @@ ) ;; definition for method 3 of type load-state -(defmethod inspect load-state ((obj load-state)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Twant[2] @ #x~X~%" (-> obj want)) - (format #t "~Tvis-nick: ~A~%" (-> obj vis-nick)) - (format #t "~Tcommand-list: ~A~%" (-> obj command-list)) - (format #t "~Tobject-name[256] @ #x~X~%" (-> obj object-name)) - (format #t "~Tobject-status[256] @ #x~X~%" (-> obj object-status)) - obj +(defmethod inspect load-state ((this load-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Twant[2] @ #x~X~%" (-> this want)) + (format #t "~Tvis-nick: ~A~%" (-> this vis-nick)) + (format #t "~Tcommand-list: ~A~%" (-> this command-list)) + (format #t "~Tobject-name[256] @ #x~X~%" (-> this object-name)) + (format #t "~Tobject-status[256] @ #x~X~%" (-> this object-status)) + this ) ;; definition for method 0 of type load-state @@ -137,22 +137,22 @@ ) ;; definition for method 3 of type continue-point -(defmethod inspect continue-point ((obj continue-point)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tlevel: ~A~%" (-> obj level)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Tquat: ~`vector`P~%" (-> obj quat)) - (format #t "~Tcamera-trans: ~`vector`P~%" (-> obj camera-trans)) - (format #t "~Tcamera-rot[9] @ #x~X~%" (-> obj camera-rot)) - (format #t "~Tload-commands: ~A~%" (-> obj load-commands)) - (format #t "~Tvis-nick: ~A~%" (-> obj vis-nick)) - (format #t "~Tlev0: ~A~%" (-> obj lev0)) - (format #t "~Tdisp0: ~A~%" (-> obj disp0)) - (format #t "~Tlev1: ~A~%" (-> obj lev1)) - (format #t "~Tdisp1: ~A~%" (-> obj disp1)) - obj +(defmethod inspect continue-point ((this continue-point)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tlevel: ~A~%" (-> this level)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Tquat: ~`vector`P~%" (-> this quat)) + (format #t "~Tcamera-trans: ~`vector`P~%" (-> this camera-trans)) + (format #t "~Tcamera-rot[9] @ #x~X~%" (-> this camera-rot)) + (format #t "~Tload-commands: ~A~%" (-> this load-commands)) + (format #t "~Tvis-nick: ~A~%" (-> this vis-nick)) + (format #t "~Tlev0: ~A~%" (-> this lev0)) + (format #t "~Tdisp0: ~A~%" (-> this disp0)) + (format #t "~Tlev1: ~A~%" (-> this lev1)) + (format #t "~Tdisp1: ~A~%" (-> this disp1)) + this ) ;; definition of type game-info @@ -230,53 +230,53 @@ ) ;; definition for method 3 of type game-info -(defmethod inspect game-info ((obj game-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tmode: ~A~%" (-> obj mode)) - (format #t "~Tsave-name: ~A~%" (-> obj save-name)) - (format #t "~Tlife: ~f~%" (-> obj life)) - (format #t "~Tlife-max: ~f~%" (-> obj life-max)) - (format #t "~Tmoney: ~f~%" (-> obj money)) - (format #t "~Tmoney-total: ~f~%" (-> obj money-total)) - (format #t "~Tmoney-per-level[32] @ #x~X~%" (-> obj money-per-level)) - (format #t "~Tdeaths-per-level[32] @ #x~X~%" (-> obj deaths-per-level)) - (format #t "~Tbuzzer-total: ~f~%" (-> obj buzzer-total)) - (format #t "~Tfuel: ~f~%" (-> obj fuel)) - (format #t "~Tperm-list: ~A~%" (-> obj perm-list)) - (format #t "~Ttask-perm-list: ~A~%" (-> obj task-perm-list)) - (format #t "~Tcurrent-continue: ~A~%" (-> obj current-continue)) - (format #t "~Ttext-ids-seen: ~A~%" (-> obj text-ids-seen)) - (format #t "~Tlevel-opened[32] @ #x~X~%" (-> obj level-opened)) - (format #t "~Thint-control: ~A~%" (-> obj hint-control)) - (format #t "~Ttask-hint-control: ~A~%" (-> obj task-hint-control)) - (format #t "~Ttotal-deaths: ~D~%" (-> obj total-deaths)) - (format #t "~Tcontinue-deaths: ~D~%" (-> obj continue-deaths)) - (format #t "~Tfuel-cell-deaths: ~D~%" (-> obj fuel-cell-deaths)) - (format #t "~Tgame-start-time: ~D~%" (-> obj game-start-time)) - (format #t "~Tcontinue-time: ~D~%" (-> obj continue-time)) - (format #t "~Tdeath-time: ~D~%" (-> obj death-time)) - (format #t "~Thit-time: ~D~%" (-> obj hit-time)) - (format #t "~Tfuel-cell-pickup-time: ~D~%" (-> obj fuel-cell-pickup-time)) - (format #t "~Tfuel-cell-time: ~A~%" (-> obj fuel-cell-time)) - (format #t "~Tenter-level-time: ~A~%" (-> obj enter-level-time)) - (format #t "~Tin-level-time: ~A~%" (-> obj in-level-time)) - (format #t "~Tblackout-time: ~D~%" (-> obj blackout-time)) - (format #t "~Tletterbox-time: ~D~%" (-> obj letterbox-time)) - (format #t "~Thint-play-time: ~D~%" (-> obj hint-play-time)) - (format #t "~Tdisplay-text-time: ~D~%" (-> obj display-text-time)) - (format #t "~Tdisplay-text-handle: ~D~%" (-> obj display-text-handle)) - (format #t "~Tdeath-movie-tick: ~D~%" (-> obj death-movie-tick)) - (format #t "~Twant-auto-save: ~A~%" (-> obj want-auto-save)) - (format #t "~Tauto-save-proc: ~D~%" (-> obj auto-save-proc)) - (format #t "~Tauto-save-status: ~D~%" (-> obj auto-save-status)) - (format #t "~Tauto-save-card: ~D~%" (-> obj auto-save-card)) - (format #t "~Tauto-save-which: ~D~%" (-> obj auto-save-which)) - (format #t "~Tpov-camera-handle: ~D~%" (-> obj pov-camera-handle)) - (format #t "~Tother-camera-handle: ~D~%" (-> obj other-camera-handle)) - (format #t "~Tdeath-pos: ~A~%" (-> obj death-pos)) - (format #t "~Tdummy: ~A~%" (-> obj dummy)) - (format #t "~Tauto-save-count: ~D~%" (-> obj auto-save-count)) - obj +(defmethod inspect game-info ((this game-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tmode: ~A~%" (-> this mode)) + (format #t "~Tsave-name: ~A~%" (-> this save-name)) + (format #t "~Tlife: ~f~%" (-> this life)) + (format #t "~Tlife-max: ~f~%" (-> this life-max)) + (format #t "~Tmoney: ~f~%" (-> this money)) + (format #t "~Tmoney-total: ~f~%" (-> this money-total)) + (format #t "~Tmoney-per-level[32] @ #x~X~%" (-> this money-per-level)) + (format #t "~Tdeaths-per-level[32] @ #x~X~%" (-> this deaths-per-level)) + (format #t "~Tbuzzer-total: ~f~%" (-> this buzzer-total)) + (format #t "~Tfuel: ~f~%" (-> this fuel)) + (format #t "~Tperm-list: ~A~%" (-> this perm-list)) + (format #t "~Ttask-perm-list: ~A~%" (-> this task-perm-list)) + (format #t "~Tcurrent-continue: ~A~%" (-> this current-continue)) + (format #t "~Ttext-ids-seen: ~A~%" (-> this text-ids-seen)) + (format #t "~Tlevel-opened[32] @ #x~X~%" (-> this level-opened)) + (format #t "~Thint-control: ~A~%" (-> this hint-control)) + (format #t "~Ttask-hint-control: ~A~%" (-> this task-hint-control)) + (format #t "~Ttotal-deaths: ~D~%" (-> this total-deaths)) + (format #t "~Tcontinue-deaths: ~D~%" (-> this continue-deaths)) + (format #t "~Tfuel-cell-deaths: ~D~%" (-> this fuel-cell-deaths)) + (format #t "~Tgame-start-time: ~D~%" (-> this game-start-time)) + (format #t "~Tcontinue-time: ~D~%" (-> this continue-time)) + (format #t "~Tdeath-time: ~D~%" (-> this death-time)) + (format #t "~Thit-time: ~D~%" (-> this hit-time)) + (format #t "~Tfuel-cell-pickup-time: ~D~%" (-> this fuel-cell-pickup-time)) + (format #t "~Tfuel-cell-time: ~A~%" (-> this fuel-cell-time)) + (format #t "~Tenter-level-time: ~A~%" (-> this enter-level-time)) + (format #t "~Tin-level-time: ~A~%" (-> this in-level-time)) + (format #t "~Tblackout-time: ~D~%" (-> this blackout-time)) + (format #t "~Tletterbox-time: ~D~%" (-> this letterbox-time)) + (format #t "~Thint-play-time: ~D~%" (-> this hint-play-time)) + (format #t "~Tdisplay-text-time: ~D~%" (-> this display-text-time)) + (format #t "~Tdisplay-text-handle: ~D~%" (-> this display-text-handle)) + (format #t "~Tdeath-movie-tick: ~D~%" (-> this death-movie-tick)) + (format #t "~Twant-auto-save: ~A~%" (-> this want-auto-save)) + (format #t "~Tauto-save-proc: ~D~%" (-> this auto-save-proc)) + (format #t "~Tauto-save-status: ~D~%" (-> this auto-save-status)) + (format #t "~Tauto-save-card: ~D~%" (-> this auto-save-card)) + (format #t "~Tauto-save-which: ~D~%" (-> this auto-save-which)) + (format #t "~Tpov-camera-handle: ~D~%" (-> this pov-camera-handle)) + (format #t "~Tother-camera-handle: ~D~%" (-> this other-camera-handle)) + (format #t "~Tdeath-pos: ~A~%" (-> this death-pos)) + (format #t "~Tdummy: ~A~%" (-> this dummy)) + (format #t "~Tauto-save-count: ~D~%" (-> this auto-save-count)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/game/game-info_REF.gc b/test/decompiler/reference/jak1/engine/game/game-info_REF.gc index eab437f156..579830dfb9 100644 --- a/test/decompiler/reference/jak1/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-info_REF.gc @@ -3,29 +3,36 @@ ;; definition for method 9 of type border-plane ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw! border-plane ((obj border-plane)) - (let* ((v1-0 (-> obj action)) +(defmethod debug-draw! border-plane ((this border-plane)) + (let* ((v1-0 (-> this action)) (s5-0 (if (= v1-0 'load) (new 'static 'rgba :g #xff :a #x80) (new 'static 'rgba :r #xff :a #x80) ) ) ) - (add-debug-text-sphere #t (bucket-id debug-no-zbuf) (-> obj trans) 819.2 (symbol->string (-> obj name)) s5-0) - (add-debug-vector #t (bucket-id debug-no-zbuf) (-> obj trans) (-> obj normal) (meters 2) s5-0) + (add-debug-text-sphere + #t + (bucket-id debug-no-zbuf) + (-> this trans) + 819.2 + (symbol->string (-> this name)) + s5-0 + ) + (add-debug-vector #t (bucket-id debug-no-zbuf) (-> this trans) (-> this normal) (meters 2) s5-0) ) 0 (none) ) ;; definition for method 10 of type border-plane -(defmethod point-past-plane? border-plane ((obj border-plane) (arg0 vector)) - (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) (-> obj normal)) 0.0) +(defmethod point-past-plane? border-plane ((this border-plane) (arg0 vector)) + (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) (-> this normal)) 0.0) ) ;; definition for method 11 of type game-info -(defmethod task-complete? game-info ((obj game-info) (arg0 game-task)) - (logtest? (-> obj task-perm-list data arg0 status) (entity-perm-status real-complete)) +(defmethod task-complete? game-info ((this game-info) (arg0 game-task)) + (logtest? (-> this task-perm-list data arg0 status) (entity-perm-status real-complete)) ) ;; definition for symbol *default-continue*, type continue-point @@ -45,10 +52,10 @@ ) ;; definition for method 17 of type game-info -(defmethod get-or-create-continue! game-info ((obj game-info)) +(defmethod get-or-create-continue! game-info ((this game-info)) (cond - ((and (= (-> obj mode) 'play) (-> obj current-continue)) - (-> obj current-continue) + ((and (= (-> this mode) 'play) (-> this current-continue)) + (-> this current-continue) ) (else (let ((gp-0 *default-continue*)) @@ -67,7 +74,7 @@ ;; definition for method 18 of type game-info ;; INFO: Return type mismatch object vs continue-point. -(defmethod get-continue-by-name game-info ((obj game-info) (arg0 string)) +(defmethod get-continue-by-name game-info ((this game-info) (arg0 string)) (let ((s5-0 *level-load-list*)) (while (not (null? s5-0)) (let ((s4-0 (-> (the-as level-load-info (-> (the-as symbol (car s5-0)) value)) continues))) @@ -87,21 +94,21 @@ ) ;; definition for method 19 of type game-info -(defmethod set-continue! game-info ((obj game-info) (arg0 basic)) - (let ((s5-0 (-> obj current-continue))) +(defmethod set-continue! game-info ((this game-info) (arg0 basic)) + (let ((s5-0 (-> this current-continue))) (if (null? arg0) (set! arg0 #f) ) (case (-> arg0 type) ((string) - (let ((v1-5 (get-continue-by-name obj (the-as string arg0)))) + (let ((v1-5 (get-continue-by-name this (the-as string arg0)))) (if v1-5 - (set! (-> obj current-continue) v1-5) + (set! (-> this current-continue) v1-5) ) ) ) ((continue-point) - (set! (-> obj current-continue) (the-as continue-point arg0)) + (set! (-> this current-continue) (the-as continue-point arg0)) ) (else (let ((s4-3 *default-continue*)) @@ -112,55 +119,54 @@ (set! (-> s4-3 disp0) (-> *load-state* want 0 display?)) (set! (-> s4-3 lev1) (-> *load-state* want 1 name)) (set! (-> s4-3 disp1) (-> *load-state* want 1 display?)) - (set! (-> obj current-continue) s4-3) + (set! (-> this current-continue) s4-3) ) ) ) - (when (!= s5-0 (-> obj current-continue)) - (set! (-> obj continue-deaths) 0) - (set! (-> obj continue-time) (-> *display* base-frame-counter)) + (when (!= s5-0 (-> this current-continue)) + (set! (-> this continue-deaths) 0) + (set-time! (-> this continue-time)) ) ) - (-> obj current-continue) + (-> this current-continue) ) ;; definition for method 13 of type game-info -(defmethod get-entity-task-perm game-info ((obj game-info) (arg0 game-task)) - (-> obj task-perm-list data arg0) +(defmethod get-entity-task-perm game-info ((this game-info) (arg0 game-task)) + (-> this task-perm-list data arg0) ) ;; definition for method 9 of type game-info ;; INFO: Used lq/sq -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 191] -(defmethod initialize! game-info ((obj game-info) (cause symbol) (save-to-load game-save) (continue-point-override string)) +(defmethod initialize! game-info ((this game-info) (cause symbol) (save-to-load game-save) (continue-point-override string)) (local-vars (v0-0 int) (sv-96 symbol)) (case cause (('dead) - (+! (-> obj total-deaths) 1) - (+! (-> obj continue-deaths) 1) - (+! (-> obj fuel-cell-deaths) 1) + (+! (-> this total-deaths) 1) + (+! (-> this continue-deaths) 1) + (+! (-> this fuel-cell-deaths) 1) (when *target* (let ((lev-info (-> *target* current-level info))) (set! v0-0 (when (>= (-> *level-task-data-remap* length) (-> lev-info index)) (set! v0-0 - (seekl (the-as int (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1)))) 255 1) + (seekl (the-as int (-> this deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1)))) 255 1) ) - (set! (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1))) (the-as uint v0-0)) + (set! (-> this deaths-per-level (-> *level-task-data-remap* (+ (-> lev-info index) -1))) (the-as uint v0-0)) v0-0 ) ) ) ) - (case (-> obj mode) + (case (-> this mode) (('play) - (if (< 0.0 (-> obj life)) + (if (< 0.0 (-> this life)) (set! cause 'life) (set! cause 'try) ) ) (else - (set! obj obj) + (set! this this) (goto cfg-50) ) ) @@ -170,72 +176,72 @@ (case cause (('game) (reset-all-hint-controls) - (set-continue! obj (cond - (continue-point-override - (empty) - continue-point-override + (set-continue! this (cond + (continue-point-override + (empty) + continue-point-override + ) + ((!= *kernel-boot-message* 'play) + "demo-start" ) - ((!= *kernel-boot-message* 'play) - "demo-start" + (*debug-segment* + "village1-hut" + ) + (else + "title-start" + ) ) - (*debug-segment* - "village1-hut" - ) - (else - "title-start" - ) - ) ) - (set! (-> obj auto-save-count) 0) + (set! (-> this auto-save-count) 0) (set! (-> *setting-control* default auto-save) #f) - (set! (-> obj money) 0.0) - (set! (-> obj fuel) 0.0) - (set! (-> obj money-total) 0.0) - (set! (-> obj buzzer-total) 0.0) - (set! (-> obj perm-list length) 0) - (clear-all! (-> obj text-ids-seen)) - (set! (-> obj death-movie-tick) (rand-vu-int-count 10)) - (set! (-> obj total-deaths) 0) - (set! (-> obj continue-deaths) 0) - (set! (-> obj fuel-cell-deaths) 0) - (set! (-> obj death-pos length) 0) - (set! (-> obj game-start-time) (-> *display* base-frame-counter)) - (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) - (set! (-> obj continue-time) (-> *display* base-frame-counter)) - (set! (-> obj death-time) (-> *display* base-frame-counter)) - (set! (-> obj hit-time) (-> *display* base-frame-counter)) + (set! (-> this money) 0.0) + (set! (-> this fuel) 0.0) + (set! (-> this money-total) 0.0) + (set! (-> this buzzer-total) 0.0) + (set! (-> this perm-list length) 0) + (clear-all! (-> this text-ids-seen)) + (set! (-> this death-movie-tick) (rand-vu-int-count 10)) + (set! (-> this total-deaths) 0) + (set! (-> this continue-deaths) 0) + (set! (-> this fuel-cell-deaths) 0) + (set! (-> this death-pos length) 0) + (set-time! (-> this game-start-time)) + (set-time! (-> this fuel-cell-pickup-time)) + (set-time! (-> this continue-time)) + (set-time! (-> this death-time)) + (set-time! (-> this hit-time)) (dotimes (v1-50 116) - (set! (-> obj fuel-cell-time 0) 0) + (set! (-> this fuel-cell-time 0) 0) (nop!) ) (dotimes (v1-53 32) - (set! (-> obj money-per-level v1-53) (the-as uint 0)) - (set! (-> obj deaths-per-level v1-53) (the-as uint 0)) - (set! (-> obj enter-level-time v1-53) 0) - (set! (-> obj in-level-time v1-53) 0) - (set! (-> obj level-opened v1-53) (the-as uint 0)) + (set! (-> this money-per-level v1-53) (the-as uint 0)) + (set! (-> this deaths-per-level v1-53) (the-as uint 0)) + (set! (-> this enter-level-time v1-53) 0) + (set! (-> this in-level-time v1-53) 0) + (set! (-> this level-opened v1-53) (the-as uint 0)) (nop!) ) ) ) (case cause (('game 'try) - (case (-> obj mode) + (case (-> this mode) (('play) (set! *display-profile* #f) (set! *display-entity-errors* #f) ) ) - (set! (-> obj life-max) (-> *GAME-bank* life-max-default)) - (set! (-> obj life) (-> *GAME-bank* life-start-default)) + (set! (-> this life-max) (-> *GAME-bank* life-max-default)) + (set! (-> this life) (-> *GAME-bank* life-start-default)) ) ) - (let ((v1-65 (-> obj mode))) + (let ((v1-65 (-> this mode))) (cond ((= v1-65 'debug) (reset-actors cause) (if save-to-load - (load-game! obj save-to-load) + (load-game! this save-to-load) ) ) ((= v1-65 'play) @@ -271,8 +277,8 @@ ) ) ) - (set! sv-96 (-> obj mode)) - (let ((t0-2 (get-or-create-continue! obj)) + (set! sv-96 (-> this mode)) + (let ((t0-2 (get-or-create-continue! this)) (t1-2 save-to-load) ) (s2-0 s1-0 s0-0 sv-96 cause t0-2 t1-2) @@ -286,21 +292,21 @@ ) ) (label cfg-50) - obj + this ) ;; definition for method 10 of type game-info -(defmethod adjust game-info ((obj game-info) (item symbol) (amount float) (source handle)) +(defmethod adjust game-info ((this game-info) (item symbol) (amount float) (source handle)) (case item (('life) (if (>= amount 0.0) - (seek! (-> obj life) (-> obj life-max) amount) - (seek! (-> obj life) 0.0 (- amount)) + (seek! (-> this life) (-> this life-max) amount) + (seek! (-> this life) 0.0 (- amount)) ) - (-> obj life) + (-> this life) ) (('money) - (if (and (< 0.0 amount) (= (+ (-> obj money) amount) (-> *GAME-bank* money-task-inc))) + (if (and (< 0.0 amount) (= (+ (-> this money) amount) (-> *GAME-bank* money-task-inc))) (level-hint-spawn (text-id sidekick-reminder-money) "sksp0014" @@ -314,9 +320,9 @@ (when (and proc (-> proc entity)) (when (>= (-> *level-task-data-remap* length) (-> proc entity extra level info index)) (let ((level-idx (-> *level-task-data-remap* (+ (-> proc entity extra level info index) -1)))) - (+! (-> obj money-per-level level-idx) (the int amount)) - (+! (-> obj money-total) amount) - (if (= (-> obj money-per-level level-idx) (-> (get-game-count level-idx) money-count)) + (+! (-> this money-per-level level-idx) (the int amount)) + (+! (-> this money-total) amount) + (if (= (-> this money-per-level level-idx) (-> (get-game-count level-idx) money-count)) (activate-orb-all level-idx) ) ) @@ -324,21 +330,21 @@ ) ) ) - (set! (-> obj money) (+ (-> obj money) amount)) + (set! (-> this money) (+ (-> this money) amount)) ) (('fuel-cell) (let ((s5-1 (the int amount))) - (when (not (or (task-complete? obj (the-as game-task s5-1)) (>= (the-as uint 1) (the-as uint s5-1)))) - (set! (-> obj fuel-cell-deaths) 0) - (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) - (set! (-> obj fuel-cell-time s5-1) (-> *display* base-frame-counter)) - (+! (-> obj fuel) 1.0) - (logior! (-> obj task-perm-list data s5-1 status) (entity-perm-status real-complete)) + (when (not (or (task-complete? this (the-as game-task s5-1)) (>= (the-as uint 1) (the-as uint s5-1)))) + (set! (-> this fuel-cell-deaths) 0) + (set-time! (-> this fuel-cell-pickup-time)) + (set-time! (-> this fuel-cell-time s5-1)) + (+! (-> this fuel) 1.0) + (logior! (-> this task-perm-list data s5-1 status) (entity-perm-status real-complete)) (get-task-control (the-as game-task s5-1)) (close-specific-task! (the-as game-task s5-1) (task-status need-resolution)) ) ) - (-> obj fuel) + (-> this fuel) ) (('buzzer) (let ((buzz-task (logand (the int amount) #xffff)) @@ -351,7 +357,7 @@ ) (when (and (>= buzz-index 0) (< buzz-index (the int (-> *FACT-bank* buzzer-max-default)))) (if (not (logtest? buzz-bits (ash 1 buzz-index))) - (+! (-> obj buzzer-total) 1.0) + (+! (-> this buzzer-total) 1.0) ) (let ((t9-10 (method-of-object ctrl save-reminder))) (set! buzz-bits (logior buzz-bits (ash 1 buzz-index))) @@ -372,12 +378,12 @@ ) ;; definition for method 23 of type game-info -(defmethod got-buzzer? game-info ((obj game-info) (arg0 game-task) (arg1 int)) +(defmethod got-buzzer? game-info ((this game-info) (arg0 game-task) (arg1 int)) (logtest? (get-reminder (get-task-control arg0) 0) (ash 1 arg1)) ) ;; definition for method 20 of type game-info -(defmethod buzzer-count game-info ((obj game-info) (arg0 game-task)) +(defmethod buzzer-count game-info ((this game-info) (arg0 game-task)) (let ((v1-1 (get-reminder (get-task-control arg0) 0)) (v0-2 0) ) @@ -391,15 +397,15 @@ ) ;; definition for method 21 of type game-info -(defmethod seen-text? game-info ((obj game-info) (arg0 text-id)) - (get-bit (-> obj text-ids-seen) (the-as int arg0)) +(defmethod seen-text? game-info ((this game-info) (arg0 text-id)) + (get-bit (-> this text-ids-seen) (the-as int arg0)) ) ;; definition for method 22 of type game-info ;; INFO: Return type mismatch int vs none. -(defmethod mark-text-as-seen game-info ((obj game-info) (arg0 text-id)) +(defmethod mark-text-as-seen game-info ((this game-info) (arg0 text-id)) (if (and (< (the-as uint arg0) (the-as uint 4095)) (> (the-as uint arg0) 0)) - (set-bit (-> obj text-ids-seen) (the-as int arg0)) + (set-bit (-> this text-ids-seen) (the-as int arg0)) ) 0 (none) @@ -407,171 +413,173 @@ ;; definition for method 26 of type game-info ;; INFO: Return type mismatch int vs none. -(defmethod clear-text-seen! game-info ((obj game-info) (arg0 text-id)) - (clear-bit (-> obj text-ids-seen) (the-as int arg0)) +(defmethod clear-text-seen! game-info ((this game-info) (arg0 text-id)) + (clear-bit (-> this text-ids-seen) (the-as int arg0)) 0 (none) ) ;; definition for method 10 of type fact-info-target ;; INFO: Return type mismatch float vs none. -(defmethod reset! fact-info-target ((obj fact-info-target) (arg0 symbol)) +(defmethod reset! fact-info-target ((this fact-info-target) (arg0 symbol)) (when (or (not arg0) (= arg0 'eco)) - (set! (-> obj eco-timeout) 0) - (set! (-> obj eco-level) 0.0) - (set! (-> obj eco-pickup-time) (-> *display* game-frame-counter)) + (set! (-> this eco-timeout) 0) + (set! (-> this eco-level) 0.0) + (set! (-> this eco-pickup-time) (-> *display* game-frame-counter)) ) (when (or (not arg0) (= arg0 'health)) - (set! (-> obj health-max) (-> *FACT-bank* health-max-default)) - (set! (-> obj health) (-> obj health-max)) - (set! (-> obj health-pickup-time) (seconds -100)) + (set! (-> this health-max) (-> *FACT-bank* health-max-default)) + (set! (-> this health) (-> this health-max)) + (set! (-> this health-pickup-time) (seconds -100)) ) (when (or (not arg0) (= arg0 'buzzer)) - (set! (-> obj buzzer-max) (-> *FACT-bank* buzzer-max-default)) - (set! (-> obj buzzer) 0.0) + (set! (-> this buzzer-max) (-> *FACT-bank* buzzer-max-default)) + (set! (-> this buzzer) 0.0) ) (when (or (not arg0) (= arg0 'eco-pill)) - (set! (-> obj eco-pill-max) (-> *FACT-bank* eco-pill-max-default)) - (set! (-> obj eco-pill) 0.0) + (set! (-> this eco-pill-max) (-> *FACT-bank* eco-pill-max-default)) + (set! (-> this eco-pill) 0.0) ) (none) ) ;; definition for method 11 of type fact-info-target -(defmethod pickup-collectable! fact-info-target ((obj fact-info-target) (kind pickup-type) (amount float) (source-handle handle)) +(defmethod pickup-collectable! fact-info-target ((this fact-info-target) (kind pickup-type) (amount float) (source-handle handle)) (case kind (((pickup-type eco-green)) (cond ((>= amount 0.0) (when (< 0.0 amount) - (if (or (!= (handle->process source-handle) (handle->process (-> obj eco-source))) - (>= (- (-> *display* base-frame-counter) (-> obj eco-source-time)) (seconds 0.5)) + (if (or (!= (handle->process source-handle) (handle->process (-> this eco-source))) + (time-elapsed? (-> this eco-source-time) (seconds 0.5)) ) (sound-play "get-green-eco") ) (when (handle->process source-handle) - (set! (-> obj eco-source) source-handle) - (set! (-> obj eco-source-time) (-> *display* base-frame-counter)) + (set! (-> this eco-source) source-handle) + (set-time! (-> this eco-source-time)) ) ) - (if (= (-> obj health) (-> obj health-max)) + (if (= (-> this health) (-> this health-max)) (pickup-collectable! - obj + this (pickup-type eco-pill) (-> *FACT-bank* eco-pill-max-default) - (process->handle (-> obj process)) + (process->handle (-> this process)) ) ) - (set! (-> obj health-pickup-time) (-> *display* base-frame-counter)) - (seek! (-> obj health) (-> obj health-max) amount) + (set-time! (-> this health-pickup-time)) + (seek! (-> this health) (-> this health-max) amount) ) (else - (seek! (-> obj health) 0.0 (- amount)) + (seek! (-> this health) 0.0 (- amount)) (if (>= amount -10.0) - (pickup-collectable! obj (pickup-type eco-pill) 0.0 source-handle) + (pickup-collectable! this (pickup-type eco-pill) 0.0 source-handle) ) - (if (= (-> obj health) 0.0) - (adjust (-> (the-as target (-> obj process)) game) 'life (- (-> *GAME-bank* life-single-inc)) source-handle) + (if (= (-> this health) 0.0) + (adjust (-> (the-as target (-> this process)) game) 'life (- (-> *GAME-bank* life-single-inc)) source-handle) ) ) ) (b! - (and (logtest? (-> (the-as collide-shape (-> obj process root)) root-prim prim-core action) (collide-action racer)) + (and (logtest? (-> (the-as collide-shape (-> this process root)) root-prim prim-core action) + (collide-action racer) + ) (type-type? (-> (handle->process source-handle) type) vent) ) cfg-80 :delay (nop!) ) - (-> obj health) + (-> this health) ) (((pickup-type eco-pill)) (when (>= amount 0.0) - (set! (-> obj eco-pill-pickup-time) (-> *display* base-frame-counter)) - (seek! (-> obj eco-pill) (-> obj eco-pill-max) amount) - (when (and (>= (-> obj eco-pill) (-> *FACT-bank* eco-pill-max-default)) (< (-> obj health) (-> obj health-max))) - (set! (-> obj eco-pill) (- (-> obj eco-pill) (-> *FACT-bank* eco-pill-max-default))) + (set-time! (-> this eco-pill-pickup-time)) + (seek! (-> this eco-pill) (-> this eco-pill-max) amount) + (when (and (>= (-> this eco-pill) (-> *FACT-bank* eco-pill-max-default)) (< (-> this health) (-> this health-max))) + (set! (-> this eco-pill) (- (-> this eco-pill) (-> *FACT-bank* eco-pill-max-default))) (pickup-collectable! - obj + this (pickup-type eco-green) (-> *FACT-bank* health-small-inc) - (process->handle (-> obj process)) + (process->handle (-> this process)) ) ) ) - (-> obj eco-pill) + (-> this eco-pill) ) (((pickup-type money)) (when (< 0.0 amount) - (if (>= (- (-> *display* base-frame-counter) (-> obj money-pickup-time)) (seconds 0.05)) + (if (time-elapsed? (-> this money-pickup-time) (seconds 0.05)) (sound-play "money-pickup") ) - (set! (-> obj money-pickup-time) (-> *display* base-frame-counter)) + (set-time! (-> this money-pickup-time)) ) - (adjust (-> (the-as target (-> obj process)) game) 'money amount source-handle) + (adjust (-> (the-as target (-> this process)) game) 'money amount source-handle) ) (((pickup-type fuel-cell)) (let ((s4-2 (the int amount))) - (if (not (or (task-complete? (-> (the-as target (-> obj process)) game) (the-as game-task s4-2)) + (if (not (or (task-complete? (-> (the-as target (-> this process)) game) (the-as game-task s4-2)) (>= (the-as uint 1) (the-as uint s4-2)) ) ) - (set! (-> obj fuel-cell-pickup-time) (-> *display* base-frame-counter)) + (set-time! (-> this fuel-cell-pickup-time)) ) ) - (adjust (-> (the-as target (-> obj process)) game) 'fuel-cell amount source-handle) + (adjust (-> (the-as target (-> this process)) game) 'fuel-cell amount source-handle) ) (((pickup-type buzzer)) - (let ((buzz-count (adjust (-> (the-as target (-> obj process)) game) 'buzzer amount source-handle))) - (if (!= buzz-count (-> obj buzzer)) - (set! (-> obj buzzer-pickup-time) (-> *display* base-frame-counter)) + (let ((buzz-count (adjust (-> (the-as target (-> this process)) game) 'buzzer amount source-handle))) + (if (!= buzz-count (-> this buzzer)) + (set-time! (-> this buzzer-pickup-time)) ) - (set! (-> obj buzzer) buzz-count) + (set! (-> this buzzer) buzz-count) ) - (-> obj buzzer) + (-> this buzzer) ) (((pickup-type eco-red) (pickup-type eco-blue) (pickup-type eco-yellow)) (label cfg-80) (if (= amount 0.0) - (return (if (= (-> obj eco-type) kind) - (-> obj eco-level) + (return (if (= (-> this eco-type) kind) + (-> this eco-level) 0.0 ) ) ) - (when (!= (-> obj eco-type) kind) - (set! (-> obj eco-level) 0.0) - (set! (-> obj eco-timeout) 0) + (when (!= (-> this eco-type) kind) + (set! (-> this eco-level) 0.0) + (set! (-> this eco-timeout) 0) 0 ) - (set! (-> obj eco-type) kind) - (let ((eco-lev (-> obj eco-level))) - (set! (-> obj eco-level) 1.0) - (when (and (= eco-lev 0.0) (< 0.0 (-> obj eco-level))) - (set! (-> obj eco-pickup-time) (-> *display* game-frame-counter)) - (send-event (-> obj process) 'reset-collide) + (set! (-> this eco-type) kind) + (let ((eco-lev (-> this eco-level))) + (set! (-> this eco-level) 1.0) + (when (and (= eco-lev 0.0) (< 0.0 (-> this eco-level))) + (set! (-> this eco-pickup-time) (-> *display* game-frame-counter)) + (send-event (-> this process) 'reset-collide) ) - (set! (-> obj eco-timeout) + (set! (-> this eco-timeout) (the-as seconds (min - (the-as int (+ (-> obj eco-timeout) (* (the-as int (-> *FACT-bank* eco-single-timeout)) (the int amount)))) + (the-as int (+ (-> this eco-timeout) (* (the-as int (-> *FACT-bank* eco-single-timeout)) (the int amount)))) (the-as int - (+ (-> *FACT-bank* eco-full-timeout) (- (-> *display* game-frame-counter) (-> obj eco-pickup-time))) + (+ (-> *FACT-bank* eco-full-timeout) (- (-> *display* game-frame-counter) (-> this eco-pickup-time))) ) ) ) ) (if (>= (the-as int - (- (-> obj eco-timeout) (the-as uint (- (-> *display* game-frame-counter) (-> obj eco-pickup-time)))) + (- (-> this eco-timeout) (the-as uint (- (-> *display* game-frame-counter) (-> this eco-pickup-time)))) ) (the-as int (-> *FACT-bank* eco-full-timeout)) ) - (set! (-> obj eco-level) 2.0) + (set! (-> this eco-level) 2.0) ) - (when (not (and (= (handle->process source-handle) (handle->process (-> obj eco-source))) - (< (- (-> *display* base-frame-counter) (-> obj eco-source-time)) (seconds 0.5)) + (when (not (and (= (handle->process source-handle) (handle->process (-> this eco-source))) + (not (time-elapsed? (-> this eco-source-time) (seconds 0.5))) ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.2)) @@ -591,11 +599,11 @@ ) ) ) - (set! (-> obj eco-source) source-handle) - (set! (-> obj eco-source-time) (-> *display* base-frame-counter)) + (set! (-> this eco-source) source-handle) + (set-time! (-> this eco-source-time)) (when (= kind (pickup-type eco-blue)) (when (= eco-lev 0.0) - (let ((s5-1 (-> obj process))) + (let ((s5-1 (-> this process))) (let ((s4-3 (process-spawn touch-tracker @@ -629,8 +637,8 @@ (process-spawn-function process (lambda ((arg0 process-drawable)) - (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 0.6)) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 0.6)) (send-event arg0 'effect 'eco-blue) (suspend) ) @@ -645,17 +653,17 @@ ) ) ) - (-> obj eco-level) + (-> this eco-level) ) (else - ((method-of-type fact-info pickup-collectable!) obj kind amount source-handle) + ((method-of-type fact-info pickup-collectable!) this kind amount source-handle) ) ) ) ;; definition for method 12 of type game-info -(defmethod lookup-entity-perm-by-aid game-info ((obj game-info) (arg0 actor-id)) - (let ((v1-0 (-> obj perm-list))) +(defmethod lookup-entity-perm-by-aid game-info ((this game-info) (arg0 actor-id)) + (let ((v1-0 (-> this perm-list))) (countdown (a0-1 (-> v1-0 length)) (if (= arg0 (-> v1-0 data a0-1 aid)) (return (-> v1-0 data a0-1)) @@ -668,14 +676,14 @@ ;; definition for method 14 of type game-info ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod copy-perms-from-level! game-info ((obj game-info) (lev level)) - (let ((perms (-> obj perm-list)) +(defmethod copy-perms-from-level! game-info ((this game-info) (lev level)) + (let ((perms (-> this perm-list)) (lev-entities (-> lev bsp level entity)) ) (dotimes (lev-entity-idx (-> lev-entities length)) (let ((lev-entity-perm (-> lev-entities data lev-entity-idx entity extra perm))) (when (nonzero? (-> lev-entity-perm task)) - (let ((info-entity-perm (lookup-entity-perm-by-aid obj (-> lev-entity-perm aid)))) + (let ((info-entity-perm (lookup-entity-perm-by-aid this (-> lev-entity-perm aid)))) (cond (info-entity-perm (set! (-> info-entity-perm quad) (-> lev-entity-perm quad)) @@ -697,11 +705,11 @@ ;; definition for method 15 of type game-info ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod copy-perms-to-level! game-info ((obj game-info) (lev level)) +(defmethod copy-perms-to-level! game-info ((this game-info) (lev level)) (let ((lev-entities (-> lev bsp level entity))) (dotimes (lev-entity-idx (-> lev-entities length)) (let* ((lev-entity-perm (-> lev-entities data lev-entity-idx entity extra perm)) - (info-entity-perm (lookup-entity-perm-by-aid obj (-> lev-entity-perm aid))) + (info-entity-perm (lookup-entity-perm-by-aid this (-> lev-entity-perm aid))) ) (when info-entity-perm (set! (-> lev-entity-perm quad) (-> info-entity-perm quad)) @@ -719,29 +727,29 @@ ) ;; definition for method 2 of type continue-point -(defmethod print continue-point ((obj continue-point)) - (format #t "#<~A ~S @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print continue-point ((this continue-point)) + (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) + this ) ;; definition for method 9 of type continue-point ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw! continue-point ((obj continue-point)) - (add-debug-x #t (bucket-id debug-no-zbuf) (-> obj trans) (new 'static 'rgba :r #xff :a #x80)) +(defmethod debug-draw! continue-point ((this continue-point)) + (add-debug-x #t (bucket-id debug-no-zbuf) (-> this trans) (new 'static 'rgba :r #xff :a #x80)) (add-debug-text-3d #t (bucket-id debug-no-zbuf) - (-> obj name) - (-> obj trans) + (-> this name) + (-> this trans) (font-color white) (new 'static 'vector2h :y 8) ) - (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (-> obj quat)))) + (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (-> this quat)))) (add-debug-vector #t (bucket-id debug-no-zbuf) - (-> obj trans) + (-> this trans) a3-2 (meters 2) (new 'static 'rgba :r #xff :g #x80 :a #x80) @@ -1156,25 +1164,25 @@ ) ;; definition for method 16 of type game-info -(defmethod debug-print game-info ((obj game-info) (arg0 symbol)) - (inspect obj) +(defmethod debug-print game-info ((this game-info) (arg0 symbol)) + (inspect this) (when (or (not arg0) (= arg0 'game-task)) (format #t "~Tgame-task:~%") (dotimes (s4-0 116) - (if (task-complete? obj (the-as game-task s4-0)) + (if (task-complete? this (the-as game-task s4-0)) (format #t "~T~T~S~%" (game-task->string (the-as game-task s4-0))) ) ) ) (when (or (not arg0) (= arg0 'entity-perm)) (format #t "~Tentity-perm:~%") - (let ((s5-1 (-> obj perm-list))) + (let ((s5-1 (-> this perm-list))) (dotimes (s4-1 (-> s5-1 length)) (format #t "~T~T~`entity-perm`P~%" (-> s5-1 data s4-1)) ) ) ) - obj + this ) ;; failed to figure out what this is: @@ -1217,14 +1225,14 @@ ) ;; definition for method 27 of type game-info -(defmethod get-death-count game-info ((obj game-info) (arg0 symbol)) +(defmethod get-death-count game-info ((this game-info) (arg0 symbol)) (let ((v1-13 (if (and arg0 *target* (>= (-> *level-task-data-remap* length) (-> *target* current-level info index))) (the-as int - (-> obj deaths-per-level (-> *level-task-data-remap* (+ (-> *target* current-level info index) -1))) + (-> this deaths-per-level (-> *level-task-data-remap* (+ (-> *target* current-level info index) -1))) ) - (-> obj fuel-cell-deaths) + (-> this fuel-cell-deaths) ) ) ) @@ -1234,6 +1242,6 @@ ) ;; definition for method 28 of type game-info -(defmethod get-health-percent-lost game-info ((obj game-info) (arg0 symbol)) - (* 0.25 (the float (get-death-count obj #f))) +(defmethod get-health-percent-lost game-info ((this game-info) (arg0 symbol)) + (* 0.25 (the float (get-death-count this #f))) ) diff --git a/test/decompiler/reference/jak1/engine/game/game-save_REF.gc b/test/decompiler/reference/jak1/engine/game/game-save_REF.gc index 248dd7caa9..4dc9efde68 100644 --- a/test/decompiler/reference/jak1/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/game-save_REF.gc @@ -25,24 +25,24 @@ ) ;; definition for method 3 of type game-save-tag -(defmethod inspect game-save-tag ((obj game-save-tag)) - (format #t "[~8x] ~A~%" obj 'game-save-tag) - (format #t "~Tuser-object[2] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-uint64: ~D~%" (-> obj user-uint64)) - (format #t "~Tuser-float0: ~f~%" (-> obj user-float0)) - (format #t "~Tuser-float[2] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-int32[2] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-uint32[2] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-int16[4] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-uint16[4] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-int8[8] @ #x~X~%" (-> obj user-object)) - (format #t "~Tuser-int80: ~D~%" (-> obj user-int80)) - (format #t "~Tuser-int81: ~D~%" (-> obj user-int81)) - (format #t "~Tuser-uint8[8] @ #x~X~%" (-> obj user-object)) - (format #t "~Telt-count: ~D~%" (-> obj elt-count)) - (format #t "~Telt-size: ~D~%" (-> obj elt-size)) - (format #t "~Telt-type: ~D~%" (-> obj elt-type)) - obj +(defmethod inspect game-save-tag ((this game-save-tag)) + (format #t "[~8x] ~A~%" this 'game-save-tag) + (format #t "~Tuser-object[2] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-uint64: ~D~%" (-> this user-uint64)) + (format #t "~Tuser-float0: ~f~%" (-> this user-float0)) + (format #t "~Tuser-float[2] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-int32[2] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-uint32[2] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-int16[4] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-uint16[4] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-int8[8] @ #x~X~%" (-> this user-object)) + (format #t "~Tuser-int80: ~D~%" (-> this user-int80)) + (format #t "~Tuser-int81: ~D~%" (-> this user-int81)) + (format #t "~Tuser-uint8[8] @ #x~X~%" (-> this user-object)) + (format #t "~Telt-count: ~D~%" (-> this elt-count)) + (format #t "~Telt-size: ~D~%" (-> this elt-size)) + (format #t "~Telt-type: ~D~%" (-> this elt-type)) + this ) ;; definition of type game-save @@ -79,33 +79,33 @@ ;; definition for method 3 of type game-save ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-save ((obj game-save)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tversion: ~D~%" (-> obj version)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tinfo-int32[16] @ #x~X~%" (-> obj info-int32)) - (format #t "~Tinfo-int8[64] @ #x~X~%" (-> obj info-int32)) - (format #t "~Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~Tfuel-cell-count: ~f~%" (-> obj fuel-cell-count)) - (format #t "~Tmoney-count: ~f~%" (-> obj money-count)) - (format #t "~Tbuzzer-count: ~f~%" (-> obj buzzer-count)) - (format #t "~Tcompletion-percentage: ~f~%" (-> obj completion-percentage)) - (format #t "~Tminute: #x~X~%" (-> obj minute)) - (format #t "~Thour: #x~X~%" (-> obj hour)) - (format #t "~Tweek: #x~X~%" (-> obj week)) - (format #t "~Tday: #x~X~%" (-> obj day)) - (format #t "~Tmonth: #x~X~%" (-> obj month)) - (format #t "~Tyear: #x~X~%" (-> obj year)) - (format #t "~Tnew-game: ~D~%" (-> obj new-game)) - (format #t "~Ttag[0] @ #x~X~%" (-> obj tag)) - obj +(defmethod inspect game-save ((this game-save)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tversion: ~D~%" (-> this version)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tinfo-int32[16] @ #x~X~%" (-> this info-int32)) + (format #t "~Tinfo-int8[64] @ #x~X~%" (-> this info-int32)) + (format #t "~Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~Tfuel-cell-count: ~f~%" (-> this fuel-cell-count)) + (format #t "~Tmoney-count: ~f~%" (-> this money-count)) + (format #t "~Tbuzzer-count: ~f~%" (-> this buzzer-count)) + (format #t "~Tcompletion-percentage: ~f~%" (-> this completion-percentage)) + (format #t "~Tminute: #x~X~%" (-> this minute)) + (format #t "~Thour: #x~X~%" (-> this hour)) + (format #t "~Tweek: #x~X~%" (-> this week)) + (format #t "~Tday: #x~X~%" (-> this day)) + (format #t "~Tmonth: #x~X~%" (-> this month)) + (format #t "~Tyear: #x~X~%" (-> this year)) + (format #t "~Tnew-game: ~D~%" (-> this new-game)) + (format #t "~Ttag[0] @ #x~X~%" (-> this tag)) + this ) ;; definition for method 5 of type game-save ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of game-save ((obj game-save)) - (the-as int (+ (-> game-save size) (-> obj allocated-length))) +(defmethod asize-of game-save ((this game-save)) + (the-as int (+ (-> game-save size) (-> this allocated-length))) ) ;; definition for method 0 of type game-save @@ -265,31 +265,31 @@ ;; definition for method 11 of type game-save ;; INFO: Used lq/sq -(defmethod debug-print game-save ((obj game-save) (detail symbol)) +(defmethod debug-print game-save ((this game-save) (detail symbol)) (local-vars (sv-16 int)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tversion: ~D~%" (-> obj version)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~Tfuel-cell-count: ~f~%" (-> obj fuel-cell-count)) - (format #t "~Tmoney-count: ~f~%" (-> obj money-count)) - (format #t "~Tbuzzer-count: ~f~%" (-> obj buzzer-count)) - (format #t "~Tcompletion-percentage: ~f~%" (-> obj completion-percentage)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tversion: ~D~%" (-> this version)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~Tfuel-cell-count: ~f~%" (-> this fuel-cell-count)) + (format #t "~Tmoney-count: ~f~%" (-> this money-count)) + (format #t "~Tbuzzer-count: ~f~%" (-> this buzzer-count)) + (format #t "~Tcompletion-percentage: ~f~%" (-> this completion-percentage)) (format #t "~Tsave-time: ~x:~x ~x/~x/~x~%" - (-> obj hour) - (-> obj minute) - (-> obj day) - (-> obj month) - (-> obj year) + (-> this hour) + (-> this minute) + (-> this day) + (-> this month) + (-> this year) ) - (format #t "~Ttag[]: @ #x~X~%" (-> obj tag)) - (let ((tag (the-as game-save-tag (-> obj tag))) + (format #t "~Ttag[]: @ #x~X~%" (-> this tag)) + (let ((tag (the-as game-save-tag (-> this tag))) (tag-idx 0) ) - (while (< (the-as int tag) (the-as int (&-> obj tag 0 user-int8 (-> obj length)))) + (while (< (the-as int tag) (the-as int (&-> this tag 0 user-int8 (-> this length)))) (let ((s2-0 format) (s1-0 #t) (s0-0 "~T [~3D] ~-32S [~3D/~3D] ~12D ~8f ") @@ -379,33 +379,33 @@ (+! tag-idx 1) ) ) - obj + this ) ;; definition for method 3 of type game-save ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-save ((obj game-save)) - (debug-print obj #f) +(defmethod inspect game-save ((this game-save)) + (debug-print this #f) ) ;; definition for method 24 of type game-info ;; INFO: Return type mismatch game-save vs none. -(defmethod save-game! game-info ((obj game-info) (arg0 game-save) (arg1 string)) +(defmethod save-game! game-info ((this game-info) (arg0 game-save) (arg1 string)) (dotimes (s3-0 (-> *level* length)) (let ((a1-1 (-> *level* level s3-0))) (if (= (-> a1-1 status) 'active) - (copy-perms-from-level! obj a1-1) + (copy-perms-from-level! this a1-1) ) ) ) (set! (-> arg0 length) 0) (set! (-> arg0 version) 1) - (set! (-> arg0 level-index) (-> (lookup-level-info (-> obj current-continue level)) index)) - (set! (-> arg0 fuel-cell-count) (-> obj fuel)) - (set! (-> arg0 money-count) (-> obj money-total)) - (set! (-> arg0 buzzer-count) (-> obj buzzer-total)) + (set! (-> arg0 level-index) (-> (lookup-level-info (-> this current-continue level)) index)) + (set! (-> arg0 fuel-cell-count) (-> this fuel)) + (set! (-> arg0 money-count) (-> this money-total)) + (set! (-> arg0 buzzer-count) (-> this buzzer-total)) (set! (-> arg0 completion-percentage) (calculate-completion (the-as progress #f))) - (when (string= (-> obj current-continue name) "title-start") + (when (string= (-> this current-continue name) "title-start") (set! (-> arg0 new-game) 1) (set! (-> arg0 level-index) (-> (lookup-level-info 'training) index)) (set! (-> arg0 fuel-cell-count) 0.0) @@ -440,7 +440,7 @@ (let ((a0-15 (the-as game-save-tag (&+ v1-37 0)))) (set! (-> a0-15 elt-type) (game-save-elt base-time)) (set! (-> a0-15 elt-count) 0) - (set! (-> a0-15 user-uint64) (the-as uint (-> *display* base-frame-counter))) + (set! (-> a0-15 user-uint64) (the-as uint (current-time))) ) (let ((v1-38 (&+ v1-37 16))) (let ((a0-16 (the-as game-save-tag (&+ v1-38 0)))) @@ -461,7 +461,7 @@ (set! (-> a0-18 user-uint64) (the-as uint (-> *display* integral-frame-counter))) ) (let ((s4-1 (the-as object (&+ v1-40 16)))) - (let ((s3-3 (-> obj current-continue name))) + (let ((s3-3 (-> this current-continue name))) (let ((s2-1 (the-as game-save-tag (-> (the-as game-save-tag s4-1) user-object)))) (set! (-> s2-1 elt-type) (game-save-elt continue)) (set! (-> s2-1 elt-count) (+ ((method-of-type string length) s3-3) 1)) @@ -476,37 +476,37 @@ (let ((a0-24 (the-as game-save-tag (&+ v1-50 0)))) (set! (-> a0-24 elt-type) (game-save-elt life)) (set! (-> a0-24 elt-count) 0) - (set! (-> a0-24 user-float0) (-> obj life)) + (set! (-> a0-24 user-float0) (-> this life)) ) (let ((v1-51 (&+ v1-50 16))) (let ((a0-25 (the-as game-save-tag (&+ v1-51 0)))) (set! (-> a0-25 elt-type) (game-save-elt buzzer-total)) (set! (-> a0-25 elt-count) 0) - (set! (-> a0-25 user-float0) (-> obj buzzer-total)) + (set! (-> a0-25 user-float0) (-> this buzzer-total)) ) (let ((v1-52 (&+ v1-51 16))) (let ((a0-26 (the-as game-save-tag (&+ v1-52 0)))) (set! (-> a0-26 elt-type) (game-save-elt fuel-cell)) (set! (-> a0-26 elt-count) 0) - (set! (-> a0-26 user-float0) (-> obj fuel)) + (set! (-> a0-26 user-float0) (-> this fuel)) ) (let ((v1-53 (&+ v1-52 16))) (let ((a0-27 (the-as game-save-tag (&+ v1-53 0)))) (set! (-> a0-27 elt-type) (game-save-elt death-movie-tick)) (set! (-> a0-27 elt-count) 0) - (set! (-> a0-27 user-uint64) (the-as uint (-> obj death-movie-tick))) + (set! (-> a0-27 user-uint64) (the-as uint (-> this death-movie-tick))) ) (let ((v1-54 (&+ v1-53 16))) (let ((a0-28 (the-as game-save-tag (&+ v1-54 0)))) (set! (-> a0-28 elt-type) (game-save-elt money)) (set! (-> a0-28 elt-count) 0) - (set! (-> a0-28 user-float0) (-> obj money)) + (set! (-> a0-28 user-float0) (-> this money)) ) (let ((v1-55 (&+ v1-54 16))) (let ((a0-29 (the-as game-save-tag (&+ v1-55 0)))) (set! (-> a0-29 elt-type) (game-save-elt money-total)) (set! (-> a0-29 elt-count) 0) - (set! (-> a0-29 user-float0) (-> obj money-total)) + (set! (-> a0-29 user-float0) (-> this money-total)) ) (let ((v1-56 (&+ v1-55 16))) (let ((a0-30 (the-as game-save-tag (&+ v1-56 0)))) @@ -516,7 +516,7 @@ ) (let ((v1-57 (&+ v1-56 16))) (dotimes (a0-31 32) - (set! (-> (the-as (pointer uint8) (&+ v1-57 a0-31))) (-> obj money-per-level a0-31)) + (set! (-> (the-as (pointer uint8) (&+ v1-57 a0-31))) (-> this money-per-level a0-31)) ) (let ((v1-58 (&+ v1-57 32))) (let ((a0-34 (the-as object (&+ v1-58 0)))) @@ -526,10 +526,10 @@ ) (let ((v1-59 (&+ v1-58 16))) (dotimes (a0-35 32) - (set! (-> (the-as (pointer uint8) (&+ v1-59 a0-35))) (-> obj level-opened a0-35)) + (set! (-> (the-as (pointer uint8) (&+ v1-59 a0-35))) (-> this level-opened a0-35)) ) (let ((v1-60 (&+ v1-59 32)) - (s4-2 (-> (the-as (pointer int32) (-> obj perm-list)) 0)) + (s4-2 (-> (the-as (pointer int32) (-> this perm-list)) 0)) ) (let ((a0-39 (the-as game-save-tag (&+ v1-60 0)))) (set! (-> a0-39 elt-type) (game-save-elt perm-list)) @@ -540,12 +540,12 @@ (dotimes (s2-2 s4-2) (mem-copy! (the-as pointer (the-as game-save-tag (&+ s3-4 (* s2-2 16)))) - (the-as pointer (-> obj perm-list data s2-2)) + (the-as pointer (-> this perm-list data s2-2)) 16 ) ) (let ((v1-68 (&+ s3-4 (logand -16 (+ (* s4-2 16) 15)))) - (s4-3 (-> obj task-perm-list length)) + (s4-3 (-> this task-perm-list length)) ) (let ((a0-45 (the-as game-save-tag (&+ v1-68 0)))) (set! (-> a0-45 elt-type) (game-save-elt task-list)) @@ -556,12 +556,12 @@ (dotimes (s2-3 s4-3) (mem-copy! (the-as pointer (the-as game-save-tag (&+ s3-5 (* s2-3 16)))) - (the-as pointer (-> obj task-perm-list data s2-3)) + (the-as pointer (-> this task-perm-list data s2-3)) 16 ) ) (let ((a0-49 (&+ s3-5 (logand -16 (+ (* s4-3 16) 15)))) - (v1-79 (/ (logand -8 (+ (-> obj text-ids-seen allocated-length) 7)) 8)) + (v1-79 (/ (logand -8 (+ (-> this text-ids-seen allocated-length) 7)) 8)) ) (let ((a1-46 (the-as object (&+ a0-49 0)))) (set! (-> (the-as game-save-tag a1-46) elt-type) (game-save-elt text-list)) @@ -570,10 +570,10 @@ ) (let ((a0-50 (&+ a0-49 16))) (dotimes (a1-47 v1-79) - (set! (-> (the-as (pointer uint8) (&+ a0-50 a1-47))) (-> obj text-ids-seen bytes a1-47)) + (set! (-> (the-as (pointer uint8) (&+ a0-50 a1-47))) (-> this text-ids-seen bytes a1-47)) ) (let ((a0-51 (&+ a0-50 (logand -16 (+ v1-79 15)))) - (v1-84 (-> obj hint-control length)) + (v1-84 (-> this hint-control length)) ) (let ((a1-51 (the-as game-save-tag (&+ a0-51 0)))) (set! (-> a1-51 elt-type) (game-save-elt hint-list)) @@ -582,66 +582,66 @@ ) (let ((a0-52 (&+ a0-51 16))) (dotimes (a1-52 v1-84) - (set! (-> (the-as (pointer int64) (&+ a0-52 (* (* a1-52 4) 8)))) (-> obj hint-control a1-52 start-time)) + (set! (-> (the-as (pointer int64) (&+ a0-52 (* (* a1-52 4) 8)))) (-> this hint-control a1-52 start-time)) (set! (-> (the-as (pointer int64) (&+ a0-52 (* (+ (* a1-52 4) 1) 8)))) - (-> obj hint-control a1-52 last-time-called) + (-> this hint-control a1-52 last-time-called) ) - (set! (-> (the-as (pointer int8) (&+ a0-52 (+ (* a1-52 32) 16)))) (-> obj hint-control a1-52 num-attempts)) - (set! (-> (the-as (pointer int8) (&+ a0-52 (+ (* a1-52 32) 17)))) (-> obj hint-control a1-52 num-success)) + (set! (-> (the-as (pointer int8) (&+ a0-52 (+ (* a1-52 32) 16)))) (-> this hint-control a1-52 num-attempts)) + (set! (-> (the-as (pointer int8) (&+ a0-52 (+ (* a1-52 32) 17)))) (-> this hint-control a1-52 num-success)) ) (let ((v1-86 (&+ a0-52 (* v1-84 32)))) (let ((a0-54 (the-as game-save-tag (&+ v1-86 0)))) (set! (-> a0-54 elt-type) (game-save-elt auto-save-count)) (set! (-> a0-54 elt-count) 0) - (set! (-> a0-54 user-uint64) (the-as uint (-> obj auto-save-count))) + (set! (-> a0-54 user-uint64) (the-as uint (-> this auto-save-count))) ) (let ((v1-87 (&+ v1-86 16))) (let ((a0-55 (the-as game-save-tag (&+ v1-87 0)))) (set! (-> a0-55 elt-type) (game-save-elt total-deaths)) (set! (-> a0-55 elt-count) 0) - (set! (-> a0-55 user-uint64) (the-as uint (-> obj total-deaths))) + (set! (-> a0-55 user-uint64) (the-as uint (-> this total-deaths))) ) (let ((v1-88 (&+ v1-87 16))) (let ((a0-56 (the-as game-save-tag (&+ v1-88 0)))) (set! (-> a0-56 elt-type) (game-save-elt continue-deaths)) (set! (-> a0-56 elt-count) 0) - (set! (-> a0-56 user-uint64) (the-as uint (-> obj continue-deaths))) + (set! (-> a0-56 user-uint64) (the-as uint (-> this continue-deaths))) ) (let ((v1-89 (&+ v1-88 16))) (let ((a0-57 (the-as game-save-tag (&+ v1-89 0)))) (set! (-> a0-57 elt-type) (game-save-elt fuel-cell-deaths)) (set! (-> a0-57 elt-count) 0) - (set! (-> a0-57 user-uint64) (the-as uint (-> obj fuel-cell-deaths))) + (set! (-> a0-57 user-uint64) (the-as uint (-> this fuel-cell-deaths))) ) (let ((v1-90 (&+ v1-89 16))) (let ((a0-58 (the-as game-save-tag (&+ v1-90 0)))) (set! (-> a0-58 elt-type) (game-save-elt game-start-time)) (set! (-> a0-58 elt-count) 0) - (set! (-> a0-58 user-uint64) (the-as uint (-> obj game-start-time))) + (set! (-> a0-58 user-uint64) (the-as uint (-> this game-start-time))) ) (let ((v1-91 (&+ v1-90 16))) (let ((a0-59 (the-as game-save-tag (&+ v1-91 0)))) (set! (-> a0-59 elt-type) (game-save-elt continue-time)) (set! (-> a0-59 elt-count) 0) - (set! (-> a0-59 user-uint64) (the-as uint (-> obj continue-time))) + (set! (-> a0-59 user-uint64) (the-as uint (-> this continue-time))) ) (let ((v1-92 (&+ v1-91 16))) (let ((a0-60 (the-as game-save-tag (&+ v1-92 0)))) (set! (-> a0-60 elt-type) (game-save-elt death-time)) (set! (-> a0-60 elt-count) 0) - (set! (-> a0-60 user-uint64) (the-as uint (-> obj death-time))) + (set! (-> a0-60 user-uint64) (the-as uint (-> this death-time))) ) (let ((v1-93 (&+ v1-92 16))) (let ((a0-61 (the-as game-save-tag (&+ v1-93 0)))) (set! (-> a0-61 elt-type) (game-save-elt hit-time)) (set! (-> a0-61 elt-count) 0) - (set! (-> a0-61 user-uint64) (the-as uint (-> obj hit-time))) + (set! (-> a0-61 user-uint64) (the-as uint (-> this hit-time))) ) (let ((v1-94 (&+ v1-93 16))) (let ((a0-62 (the-as game-save-tag (&+ v1-94 0)))) (set! (-> a0-62 elt-type) (game-save-elt fuel-cell-pickup-time)) (set! (-> a0-62 elt-count) 0) - (set! (-> a0-62 user-uint64) (the-as uint (-> obj fuel-cell-pickup-time))) + (set! (-> a0-62 user-uint64) (the-as uint (-> this fuel-cell-pickup-time))) ) (let ((v1-95 (&+ v1-94 16))) (let ((a0-63 (the-as game-save-tag (&+ v1-95 0)))) @@ -653,7 +653,7 @@ (let ((a0-64 (the-as object 0))) (while (< (the-as int a0-64) 116) (set! (-> (the-as (pointer int64) (&+ v1-96 (* (the-as int a0-64) 8)))) - (-> obj fuel-cell-time (the-as int a0-64)) + (-> this fuel-cell-time (the-as int a0-64)) ) (set! a0-64 (+ (the-as int a0-64) 1)) ) @@ -666,7 +666,7 @@ ) (let ((v1-98 (&+ v1-97 16))) (dotimes (a0-68 32) - (set! (-> (the-as (pointer uint8) (&+ v1-98 a0-68))) (-> obj deaths-per-level a0-68)) + (set! (-> (the-as (pointer uint8) (&+ v1-98 a0-68))) (-> this deaths-per-level a0-68)) ) (let ((v1-99 (&+ v1-98 32))) (let ((a0-71 (the-as game-save-tag (&+ v1-99 0)))) @@ -676,7 +676,7 @@ ) (let ((v1-100 (&+ v1-99 16))) (dotimes (a0-72 32) - (set! (-> (the-as (pointer int64) (&+ v1-100 (* a0-72 8)))) (-> obj enter-level-time a0-72)) + (set! (-> (the-as (pointer int64) (&+ v1-100 (* a0-72 8)))) (-> this enter-level-time a0-72)) ) (let ((v1-101 (&+ v1-100 256))) (let ((a0-75 (the-as game-save-tag (&+ v1-101 0)))) @@ -686,7 +686,7 @@ ) (let ((v1-102 (&+ v1-101 16))) (dotimes (a0-76 32) - (set! (-> (the-as (pointer int64) (&+ v1-102 (* a0-76 8)))) (-> obj in-level-time a0-76)) + (set! (-> (the-as (pointer int64) (&+ v1-102 (* a0-76 8)))) (-> this in-level-time a0-76)) ) (let ((v1-103 (&+ v1-102 256))) (let ((a0-79 (the-as game-save-tag (&+ v1-103 0)))) @@ -849,7 +849,7 @@ ) ;; definition for method 25 of type game-info -(defmethod load-game! game-info ((obj game-info) (save game-save)) +(defmethod load-game! game-info ((this game-info) (save game-save)) (let ((save-data (the-as game-save-tag (-> save tag)))) (while (< (the-as int save-data) (the-as int (&-> save tag 0 user-int8 (-> save length)))) (case (-> save-data elt-type) @@ -882,7 +882,7 @@ ) ) (when (nonzero? (-> save new-game)) - (set-continue! obj "game-start") + (set-continue! this "game-start") (set! save save) (goto cfg-134) ) @@ -890,21 +890,21 @@ (while (< (the-as int data) (the-as int (&-> save tag 0 user-int8 (-> save length)))) (case (-> data elt-type) (((game-save-elt base-time)) - (let ((old-base-frame (-> *display* base-frame-counter))) + (let ((old-base-frame (current-time))) (set! (-> *display* base-frame-counter) (the-as time-frame (-> data user-uint64))) - (set! (-> *display* old-base-frame-counter) (+ (-> *display* base-frame-counter) -1)) - (let ((frame-counter-diff (- (-> *display* base-frame-counter) old-base-frame))) - (if (nonzero? (-> obj blackout-time)) - (+! (-> obj blackout-time) frame-counter-diff) + (set! (-> *display* old-base-frame-counter) (+ (current-time) -1)) + (let ((frame-counter-diff (- (current-time) old-base-frame))) + (if (nonzero? (-> this blackout-time)) + (+! (-> this blackout-time) frame-counter-diff) ) - (if (nonzero? (-> obj letterbox-time)) - (+! (-> obj letterbox-time) frame-counter-diff) + (if (nonzero? (-> this letterbox-time)) + (+! (-> this letterbox-time) frame-counter-diff) ) - (if (nonzero? (-> obj hint-play-time)) - (+! (-> obj hint-play-time) frame-counter-diff) + (if (nonzero? (-> this hint-play-time)) + (+! (-> this hint-play-time) frame-counter-diff) ) - (if (nonzero? (-> obj display-text-time)) - (+! (-> obj display-text-time) frame-counter-diff) + (if (nonzero? (-> this display-text-time)) + (+! (-> this display-text-time) frame-counter-diff) ) ) ) @@ -924,54 +924,54 @@ ) (((game-save-elt continue)) (format (clear *temp-string*) "~G" (&+ (the-as pointer data) 16)) - (set-continue! obj *temp-string*) + (set-continue! this *temp-string*) ) (((game-save-elt life)) - (set! (-> obj life) (-> data user-float0)) + (set! (-> this life) (-> data user-float0)) ) (((game-save-elt buzzer-total)) - (set! (-> obj buzzer-total) (-> data user-float0)) + (set! (-> this buzzer-total) (-> data user-float0)) ) (((game-save-elt fuel-cell)) - (set! (-> obj fuel) (-> data user-float0)) + (set! (-> this fuel) (-> data user-float0)) ) (((game-save-elt death-movie-tick)) - (set! (-> obj death-movie-tick) (the-as int (-> data user-uint64))) + (set! (-> this death-movie-tick) (the-as int (-> data user-uint64))) ) (((game-save-elt money)) - (set! (-> obj money) (-> data user-float0)) + (set! (-> this money) (-> data user-float0)) ) (((game-save-elt money-total)) - (set! (-> obj money-total) (-> data user-float0)) + (set! (-> this money-total) (-> data user-float0)) ) (((game-save-elt money-per-level)) (let ((v1-34 (min 32 (-> data elt-count)))) (dotimes (a0-76 v1-34) - (set! (-> obj money-per-level a0-76) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-76)) + (set! (-> this money-per-level a0-76) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-76)) ) ) ) (((game-save-elt level-open-list)) (let ((v1-38 (min 32 (-> data elt-count)))) (dotimes (a0-80 v1-38) - (set! (-> obj level-opened a0-80) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-80)) + (set! (-> this level-opened a0-80) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-80)) ) ) ) (((game-save-elt perm-list)) - (let ((s3-2 (min (-> data elt-count) (-> obj perm-list allocated-length)))) - (set! (-> obj perm-list length) s3-2) + (let ((s3-2 (min (-> data elt-count) (-> this perm-list allocated-length)))) + (set! (-> this perm-list length) s3-2) (dotimes (s2-0 s3-2) - (mem-copy! (the-as pointer (-> obj perm-list data s2-0)) (&+ (&+ (the-as pointer data) 16) (* s2-0 16)) 16) + (mem-copy! (the-as pointer (-> this perm-list data s2-0)) (&+ (&+ (the-as pointer data) 16) (* s2-0 16)) 16) ) ) ) (((game-save-elt task-list)) - (let ((s3-4 (min (-> data elt-count) (-> obj task-perm-list allocated-length)))) - (set! (-> obj task-perm-list length) s3-4) + (let ((s3-4 (min (-> data elt-count) (-> this task-perm-list allocated-length)))) + (set! (-> this task-perm-list length) s3-4) (dotimes (s2-1 s3-4) (mem-copy! - (the-as pointer (-> obj task-perm-list data s2-1)) + (the-as pointer (-> this task-perm-list data s2-1)) (&+ (&+ (the-as pointer data) 16) (* s2-1 16)) 16 ) @@ -979,17 +979,17 @@ ) ) (((game-save-elt text-list)) - (let ((v1-61 (/ (logand -8 (+ (-> obj text-ids-seen allocated-length) 7)) 8)) + (let ((v1-61 (/ (logand -8 (+ (-> this text-ids-seen allocated-length) 7)) 8)) (a0-94 (-> data elt-count)) ) (dotimes (a1-35 v1-61) (cond ((>= a1-35 a0-94) - (set! (-> obj text-ids-seen bytes a1-35) (the-as uint 0)) + (set! (-> this text-ids-seen bytes a1-35) (the-as uint 0)) 0 ) (else - (set! (-> obj text-ids-seen bytes a1-35) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a1-35)) + (set! (-> this text-ids-seen bytes a1-35) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a1-35)) ) ) ) @@ -997,19 +997,19 @@ ) (((game-save-elt hint-list)) (cond - ((= (-> obj hint-control length) (-> data elt-count)) + ((= (-> this hint-control length) (-> data elt-count)) (let ((v1-65 (&+ (the-as pointer data) 16))) (dotimes (a0-99 (-> data elt-count)) - (set! (-> obj hint-control a0-99 start-time) + (set! (-> this hint-control a0-99 start-time) (the-as time-frame (-> (the-as (pointer uint64) (&+ v1-65 (* (* a0-99 4) 8))))) ) - (set! (-> obj hint-control a0-99 last-time-called) + (set! (-> this hint-control a0-99 last-time-called) (the-as time-frame (-> (the-as (pointer uint64) (&+ v1-65 (* (+ (* a0-99 4) 1) 8))))) ) - (set! (-> obj hint-control a0-99 num-attempts) + (set! (-> this hint-control a0-99 num-attempts) (-> (the-as (pointer int8) (&+ (the-as (pointer uint8) v1-65) (+ (* a0-99 32) 16)))) ) - (set! (-> obj hint-control a0-99 num-success) + (set! (-> this hint-control a0-99 num-success) (-> (the-as (pointer int8) (&+ (the-as (pointer uint8) v1-65) (+ (* a0-99 32) 17)))) ) ) @@ -1021,43 +1021,43 @@ ) ) (((game-save-elt auto-save-count)) - (set! (-> obj auto-save-count) (the-as int (-> data user-uint64))) + (set! (-> this auto-save-count) (the-as int (-> data user-uint64))) ) (((game-save-elt total-deaths)) - (set! (-> obj total-deaths) (the-as int (-> data user-uint64))) + (set! (-> this total-deaths) (the-as int (-> data user-uint64))) ) (((game-save-elt continue-deaths)) - (set! (-> obj continue-deaths) (the-as int (-> data user-uint64))) + (set! (-> this continue-deaths) (the-as int (-> data user-uint64))) ) (((game-save-elt fuel-cell-deaths)) - (set! (-> obj fuel-cell-deaths) (the-as int (-> data user-uint64))) + (set! (-> this fuel-cell-deaths) (the-as int (-> data user-uint64))) ) (((game-save-elt game-start-time)) - (set! (-> obj game-start-time) (the-as time-frame (-> data user-uint64))) + (set! (-> this game-start-time) (the-as time-frame (-> data user-uint64))) ) (((game-save-elt continue-time)) - (set! (-> obj continue-time) (the-as time-frame (-> data user-uint64))) + (set! (-> this continue-time) (the-as time-frame (-> data user-uint64))) ) (((game-save-elt death-time)) - (set! (-> obj death-time) (the-as time-frame (-> data user-uint64))) + (set! (-> this death-time) (the-as time-frame (-> data user-uint64))) ) (((game-save-elt hit-time)) - (set! (-> obj hit-time) (the-as time-frame (-> data user-uint64))) + (set! (-> this hit-time) (the-as time-frame (-> data user-uint64))) ) (((game-save-elt fuel-cell-pickup-time)) - (set! (-> obj fuel-cell-pickup-time) (the-as time-frame (-> data user-uint64))) + (set! (-> this fuel-cell-pickup-time) (the-as time-frame (-> data user-uint64))) ) (((game-save-elt deaths-per-level)) (let ((v1-79 (min 32 (-> data elt-count)))) (dotimes (a0-122 v1-79) - (set! (-> obj deaths-per-level a0-122) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-122)) + (set! (-> this deaths-per-level a0-122) (-> (the-as (pointer uint8) (&+ (the-as pointer data) 16)) a0-122)) ) ) ) (((game-save-elt enter-level-time)) (let ((v1-83 (min 32 (-> data elt-count)))) (dotimes (a0-126 v1-83) - (set! (-> obj enter-level-time a0-126) + (set! (-> this enter-level-time a0-126) (the-as time-frame (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-126 8))))) ) ) @@ -1066,7 +1066,7 @@ (((game-save-elt in-level-time)) (let ((v1-87 (min 32 (-> data elt-count)))) (dotimes (a0-130 v1-87) - (set! (-> obj in-level-time a0-130) + (set! (-> this in-level-time a0-130) (the-as time-frame (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-130 8))))) ) ) @@ -1075,7 +1075,7 @@ (((game-save-elt fuel-cell-time)) (let ((v1-92 (min 32 (-> data elt-count)))) (dotimes (a0-133 v1-92) - (set! (-> obj fuel-cell-time a0-133) + (set! (-> this fuel-cell-time a0-133) (the-as time-frame (-> (the-as (pointer uint64) (&+ (&+ (the-as pointer data) 16) (* a0-133 8))))) ) ) @@ -1093,7 +1093,7 @@ (dotimes (s4-1 (-> *level* length)) (let ((a1-68 (-> *level* level s4-1))) (if (= (-> a1-68 status) 'active) - (copy-perms-to-level! obj a1-68) + (copy-perms-to-level! this a1-68) ) ) ) @@ -1110,29 +1110,29 @@ ) ;; definition for method 9 of type game-save -(defmethod save-to-file game-save ((obj game-save) (arg0 string)) +(defmethod save-to-file game-save ((this game-save) (arg0 string)) (let ((s5-0 (new 'stack 'file-stream arg0 'write))) - (file-stream-write s5-0 (&-> obj type) (+ (-> obj type size) (-> obj length))) + (file-stream-write s5-0 (&-> this type) (+ (-> this type size) (-> this length))) (file-stream-close s5-0) ) - obj + this ) ;; definition for method 10 of type game-save -(defmethod load-from-file! game-save ((obj game-save) (filename string)) +(defmethod load-from-file! game-save ((this game-save) (filename string)) (let ((stream (new 'stack 'file-stream filename 'read))) (let ((in-size (file-stream-length stream)) - (my-size (-> obj allocated-length)) + (my-size (-> this allocated-length)) ) (cond - ((>= (asize-of obj) in-size) + ((>= (asize-of this) in-size) (cond - ((= (file-stream-read stream (&-> obj type) in-size) in-size) - (set! (-> obj type) game-save) + ((= (file-stream-read stream (&-> this type) in-size) in-size) + (set! (-> this type) game-save) ) (else (format 0 "ERROR: SAVEGAME: save file ~A did not read correctly.~%" stream) - (set! (-> obj length) 0) + (set! (-> this length) 0) 0 ) ) @@ -1141,22 +1141,22 @@ (format 0 "ERROR: SAVEGAME: save file ~A is too big~%" stream) ) ) - (set! (-> obj allocated-length) my-size) + (set! (-> this allocated-length) my-size) ) - (when (!= (-> obj version) 1) + (when (!= (-> this version) 1) (format 0 "ERROR: SAVEGAME: save file ~A was version ~d, but only ~d is supported.~%" stream - (-> obj version) + (-> this version) 1 ) - (set! (-> obj length) 0) + (set! (-> this length) 0) 0 ) (file-stream-close stream) ) - obj + this ) ;; failed to figure out what this is: @@ -1217,40 +1217,40 @@ ) ;; definition for method 3 of type auto-save -(defmethod inspect auto-save ((obj auto-save)) +(defmethod inspect auto-save ((this auto-save)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcard: ~D~%" (-> obj card)) - (format #t "~T~Tslot: ~D~%" (-> obj slot)) - (format #t "~T~Twhich: ~D~%" (-> obj which)) - (format #t "~T~Tbuffer: #~%" (-> obj buffer)) - (format #t "~T~Tmode: ~A~%" (-> obj mode)) - (format #t "~T~Tresult: ~D~%" (-> obj result)) - (format #t "~T~Tsave: ~A~%" (-> obj save)) - (format #t "~T~Tinfo: #~%" (-> obj info)) - (format #t "~T~Tnotify: ~D~%" (-> obj notify)) - (format #t "~T~Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~T~Tpart: ~A~%" (-> obj part)) - obj + (format #t "~T~Tcard: ~D~%" (-> this card)) + (format #t "~T~Tslot: ~D~%" (-> this slot)) + (format #t "~T~Twhich: ~D~%" (-> this which)) + (format #t "~T~Tbuffer: #~%" (-> this buffer)) + (format #t "~T~Tmode: ~A~%" (-> this mode)) + (format #t "~T~Tresult: ~D~%" (-> this result)) + (format #t "~T~Tsave: ~A~%" (-> this save)) + (format #t "~T~Tinfo: #~%" (-> this info)) + (format #t "~T~Tnotify: ~D~%" (-> this notify)) + (format #t "~T~Tstate-time: ~D~%" (-> this state-time)) + (format #t "~T~Tpart: ~A~%" (-> this part)) + this ) ;; definition for method 10 of type auto-save -(defmethod deactivate auto-save ((obj auto-save)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate auto-save ((this auto-save)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; definition for method 7 of type auto-save ;; INFO: Return type mismatch process vs auto-save. -(defmethod relocate auto-save ((obj auto-save) (arg0 int)) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) +(defmethod relocate auto-save ((this auto-save) (arg0 int)) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (the-as auto-save ((method-of-type process relocate) obj arg0)) + (the-as auto-save ((method-of-type process relocate) this arg0)) ) ;; definition for function auto-save-post diff --git a/test/decompiler/reference/jak1/engine/game/main-h_REF.gc b/test/decompiler/reference/jak1/engine/game/main-h_REF.gc index 0731bc02e7..f60b4a3aed 100644 --- a/test/decompiler/reference/jak1/engine/game/main-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/main-h_REF.gc @@ -294,11 +294,11 @@ ) ;; definition for method 3 of type frame-stats -(defmethod inspect frame-stats ((obj frame-stats)) - (format #t "[~8x] ~A~%" obj 'frame-stats) - (format #t "~Tfield-time[2] @ #x~X~%" (-> obj field-time)) - (format #t "~Tfield: ~D~%" (-> obj field)) - obj +(defmethod inspect frame-stats ((this frame-stats)) + (format #t "[~8x] ~A~%" this 'frame-stats) + (format #t "~Tfield-time[2] @ #x~X~%" (-> this field-time)) + (format #t "~Tfield: ~D~%" (-> this field)) + this ) ;; definition for symbol *frame-stats*, type frame-stats @@ -318,11 +318,11 @@ ) ;; definition for method 3 of type screen-filter -(defmethod inspect screen-filter ((obj screen-filter)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdraw?: ~A~%" (-> obj draw?)) - (format #t "~Tcolor: ~D~%" (-> obj color)) - obj +(defmethod inspect screen-filter ((this screen-filter)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdraw?: ~A~%" (-> this draw?)) + (format #t "~Tcolor: ~D~%" (-> this color)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/game/main_REF.gc b/test/decompiler/reference/jak1/engine/game/main_REF.gc index 972b52232d..a447a4f042 100644 --- a/test/decompiler/reference/jak1/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/main_REF.gc @@ -4,7 +4,7 @@ ;; definition for function set-letterbox-frames ;; INFO: Return type mismatch time-frame vs none. (defun set-letterbox-frames ((arg0 time-frame)) - (set! (-> *game-info* letterbox-time) (+ (-> *display* base-frame-counter) arg0)) + (set! (-> *game-info* letterbox-time) (+ (current-time) arg0)) (none) ) @@ -38,10 +38,8 @@ ;; INFO: Return type mismatch time-frame vs none. (defun set-blackout-frames ((arg0 time-frame)) (if (zero? arg0) - (set! (-> *game-info* blackout-time) (-> *display* base-frame-counter)) - (set! (-> *game-info* blackout-time) - (max (-> *game-info* blackout-time) (+ (-> *display* base-frame-counter) arg0)) - ) + (set-time! (-> *game-info* blackout-time)) + (set! (-> *game-info* blackout-time) (max (-> *game-info* blackout-time) (+ (current-time) arg0))) ) (none) ) @@ -251,11 +249,11 @@ ;; definition for method 9 of type screen-filter ;; INFO: Return type mismatch pointer vs none. -(defmethod draw screen-filter ((obj screen-filter)) +(defmethod draw screen-filter ((this screen-filter)) (let* ((buf (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> buf base)) ) - (draw-sprite2d-xy buf -256 (- (-> *video-parms* screen-hy)) 512 (-> *video-parms* screen-sy) (-> obj color)) + (draw-sprite2d-xy buf -256 (- (-> *video-parms* screen-hy)) 512 (-> *video-parms* screen-sy) (-> this color)) (let ((a3-1 (-> buf base))) (let ((v1-4 (the-as dma-packet (-> buf base)))) (set! (-> v1-4 dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -897,9 +895,7 @@ (>= (+ -300000 (-> *display* real-frame-counter)) (the int (* 300.0 (the float timeout)))) ) (and (nonzero? inactive-timeout) - (>= (- (-> *display* base-frame-counter) (-> *cpad-list* cpads 0 change-time)) - (the int (* 300.0 (the float inactive-timeout))) - ) + (time-elapsed? (-> *cpad-list* cpads 0 change-time) (the int (* 300.0 (the float inactive-timeout)))) ) (= *master-exit* 'force) ) @@ -916,8 +912,8 @@ (set! (-> *setting-control* default music-volume) 0.0) (set! (-> *setting-control* default dialog-volume) 0.0) (set! (-> *setting-control* default ambient-volume) 0.0) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.1)) (suspend) ) ) @@ -1111,15 +1107,15 @@ (if (-> *screen-filter* draw?) (draw *screen-filter*) ) - (when (or (movie?) (< (-> *display* base-frame-counter) (-> *game-info* letterbox-time))) - (if (< (-> *game-info* letterbox-time) (-> *display* base-frame-counter)) - (set! (-> *game-info* letterbox-time) (-> *display* base-frame-counter)) + (when (or (movie?) (< (current-time) (-> *game-info* letterbox-time))) + (if (< (-> *game-info* letterbox-time) (current-time)) + (set-time! (-> *game-info* letterbox-time)) ) (if (= (-> *setting-control* current aspect-ratio) 'aspect4x3) (letterbox) ) ) - (if (< (-> *display* base-frame-counter) (-> *game-info* blackout-time)) + (if (< (current-time) (-> *game-info* blackout-time)) (set! (-> *setting-control* default bg-a-force) 1.0) (set! (-> *setting-control* default bg-a-force) 0.0) ) diff --git a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc index bd3e8a4539..9c1e0d520a 100644 --- a/test/decompiler/reference/jak1/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/powerups_REF.gc @@ -15,19 +15,14 @@ (let ((s1-1 (process->handle arg0)) (s2-1 (process->handle arg1)) ) - (let ((s0-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s0-0) (+ arg3 arg4)) + (let ((s0-0 (current-time))) + (until (time-elapsed? s0-0 (+ arg3 arg4)) (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) (if v1-8 (deactivate self) ) ) - (let* ((f0-1 - (fmax - 0.0 - (fmin 1.0 (/ (- (the float (- (-> *display* base-frame-counter) s0-0)) (the float arg3)) (the float arg4))) - ) - ) + (let* ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- (the float (- (current-time) s0-0)) (the float arg3)) (the float arg4))))) (a0-18 (process-drawable-pair-random-point! (the-as process-drawable (-> s1-1 process 0)) (the-as process-drawable (-> s2-1 process 0)) @@ -48,8 +43,8 @@ ) ) (else - (let ((s4-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s4-1) arg5) + (let ((s4-1 (current-time))) + (until (time-elapsed? s4-1 arg5) (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) (arg2 a0-21) ) @@ -550,7 +545,7 @@ (cond ((and (= (-> self control ground-pat material) (pat-material ice)) (and (>= (-> self control unknown-float01) 204.8) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.05)) + (not (time-elapsed? (-> self control unknown-dword11) (seconds 0.05))) ) ) (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 74)))) @@ -583,7 +578,7 @@ (if (not (ja-group? eichar-ice-stance-ja)) (set! f0-8 (* 0.75 f0-8)) ) - (seek! (-> self control unknown-float141) f0-8 (* 100.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-float141) f0-8 (* 100.0 (seconds-per-frame))) ) (let ((f30-0 (-> self control unknown-float141)) (f0-13 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 81920.0)) diff --git a/test/decompiler/reference/jak1/engine/game/projectiles-h_REF.gc b/test/decompiler/reference/jak1/engine/game/projectiles-h_REF.gc index e7f7188aff..50cfd84298 100644 --- a/test/decompiler/reference/jak1/engine/game/projectiles-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/projectiles-h_REF.gc @@ -45,33 +45,33 @@ ) ;; definition for method 3 of type projectile -(defmethod inspect projectile ((obj projectile)) +(defmethod inspect projectile ((this projectile)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbase-trans: ~`vector`P~%" (-> obj base-trans)) - (format #t "~T~Ttarget: ~`vector`P~%" (-> obj target)) - (format #t "~T~Ttarget-base: ~`vector`P~%" (-> obj target-base)) - (format #t "~T~Tparent-base: ~`vector`P~%" (-> obj parent-base)) - (format #t "~T~Tparent-quat: ~`vector`P~%" (-> obj parent-quat)) - (format #t "~T~Tbase-vector: ~`vector`P~%" (-> obj base-vector)) - (format #t "~T~Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~T~Toptions: ~D~%" (-> obj options)) - (format #t "~T~Tlast-target: ~D~%" (-> obj last-target)) - (format #t "~T~Tnotify-handle: ~D~%" (-> obj notify-handle)) - (format #t "~T~Tmax-speed: ~f~%" (-> obj max-speed)) - (format #t "~T~Tmax-turn: ~f~%" (-> obj max-turn)) - (format #t "~T~Told-dist[16] @ #x~X~%" (-> obj old-dist)) - (format #t "~T~Told-dist-count: ~D~%" (-> obj old-dist-count)) - (format #t "~T~Thits: ~D~%" (-> obj hits)) - (format #t "~T~Tmax-hits: ~D~%" (-> obj max-hits)) - (format #t "~T~Ttween: ~f~%" (-> obj tween)) - (format #t "~T~Tattack-mode: ~A~%" (-> obj attack-mode)) - (format #t "~T~Tupdate-velocity: ~A~%" (-> obj update-velocity)) - (format #t "~T~Tcounter: ~D~%" (-> obj counter)) - (format #t "~T~Ttarget-count: ~D~%" (-> obj target-count)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - obj + (format #t "~T~Tbase-trans: ~`vector`P~%" (-> this base-trans)) + (format #t "~T~Ttarget: ~`vector`P~%" (-> this target)) + (format #t "~T~Ttarget-base: ~`vector`P~%" (-> this target-base)) + (format #t "~T~Tparent-base: ~`vector`P~%" (-> this parent-base)) + (format #t "~T~Tparent-quat: ~`vector`P~%" (-> this parent-quat)) + (format #t "~T~Tbase-vector: ~`vector`P~%" (-> this base-vector)) + (format #t "~T~Ttimeout: ~D~%" (-> this timeout)) + (format #t "~T~Toptions: ~D~%" (-> this options)) + (format #t "~T~Tlast-target: ~D~%" (-> this last-target)) + (format #t "~T~Tnotify-handle: ~D~%" (-> this notify-handle)) + (format #t "~T~Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~T~Tmax-turn: ~f~%" (-> this max-turn)) + (format #t "~T~Told-dist[16] @ #x~X~%" (-> this old-dist)) + (format #t "~T~Told-dist-count: ~D~%" (-> this old-dist-count)) + (format #t "~T~Thits: ~D~%" (-> this hits)) + (format #t "~T~Tmax-hits: ~D~%" (-> this max-hits)) + (format #t "~T~Ttween: ~f~%" (-> this tween)) + (format #t "~T~Tattack-mode: ~A~%" (-> this attack-mode)) + (format #t "~T~Tupdate-velocity: ~A~%" (-> this update-velocity)) + (format #t "~T~Tcounter: ~D~%" (-> this counter)) + (format #t "~T~Ttarget-count: ~D~%" (-> this target-count)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + this ) ;; definition of type projectile-yellow @@ -86,13 +86,13 @@ ) ;; definition for method 3 of type projectile-yellow -(defmethod inspect projectile-yellow ((obj projectile-yellow)) +(defmethod inspect projectile-yellow ((this projectile-yellow)) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmode: ~D~%" (-> obj mode)) - (format #t "~T~Tangle: ~f~%" (-> obj angle)) - obj + (format #t "~T~Tmode: ~D~%" (-> this mode)) + (format #t "~T~Tangle: ~f~%" (-> this angle)) + this ) ;; definition of type projectile-blue @@ -107,13 +107,13 @@ ) ;; definition for method 3 of type projectile-blue -(defmethod inspect projectile-blue ((obj projectile-blue)) +(defmethod inspect projectile-blue ((this projectile-blue)) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmode: ~D~%" (-> obj mode)) - (format #t "~T~Tjoint-num: ~D~%" (-> obj joint-num)) - obj + (format #t "~T~Tmode: ~D~%" (-> this mode)) + (format #t "~T~Tjoint-num: ~D~%" (-> this joint-num)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc b/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc index b1dbf4d853..036097521c 100644 --- a/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/projectiles_REF.gc @@ -21,20 +21,20 @@ ) ;; definition for method 3 of type search-info -(defmethod inspect search-info ((obj search-info)) - (format #t "[~8x] ~A~%" obj 'search-info) - (format #t "~Tpoint: ~`vector`P~%" (-> obj point)) - (format #t "~Tbest-point: ~`vector`P~%" (-> obj best-point)) - (format #t "~Tmatch-handle: ~D~%" (-> obj match-handle)) - (format #t "~Tmatch: ~A~%" (-> obj match)) - (format #t "~Tbest: ~f~%" (-> obj best)) - (format #t "~Tradius: ~f~%" (-> obj radius)) - (format #t "~Trating: ~D~%" (-> obj rating)) - (format #t "~Trequire: ~D~%" (-> obj require)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Trot-base: ~`vector`P~%" (-> obj rot-base)) - (format #t "~Trot-range: ~f~%" (-> obj rot-range)) - obj +(defmethod inspect search-info ((this search-info)) + (format #t "[~8x] ~A~%" this 'search-info) + (format #t "~Tpoint: ~`vector`P~%" (-> this point)) + (format #t "~Tbest-point: ~`vector`P~%" (-> this best-point)) + (format #t "~Tmatch-handle: ~D~%" (-> this match-handle)) + (format #t "~Tmatch: ~A~%" (-> this match)) + (format #t "~Tbest: ~f~%" (-> this best)) + (format #t "~Tradius: ~f~%" (-> this radius)) + (format #t "~Trating: ~D~%" (-> this rating)) + (format #t "~Trequire: ~D~%" (-> this require)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Trot-base: ~`vector`P~%" (-> this rot-base)) + (format #t "~Trot-range: ~f~%" (-> this rot-range)) + this ) ;; definition for symbol *search-info*, type search-info @@ -627,15 +627,15 @@ ;; definition for method 24 of type projectile ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-24 projectile ((obj projectile)) - (spawn (-> obj part) (the-as vector (-> obj root-override root-prim prim-core))) +(defmethod projectile-method-24 projectile ((this projectile)) + (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) 0 (none) ) ;; definition for method 28 of type projectile ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-28 projectile ((obj projectile)) +(defmethod projectile-method-28 projectile ((this projectile)) 0 (none) ) @@ -685,11 +685,11 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (let ((gp-0 #f)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (-> self timeout)) + (while (not (time-elapsed? (-> self state-time) (-> self timeout))) (let ((s5-0 (the int (-> *display* time-ratio)))) (set-time-ratios *display* 1.0) (countdown (s4-0 s5-0) @@ -699,14 +699,14 @@ (projectile-method-28 self) ((-> self update-velocity) self) (when (logtest? (-> self options) 2) - (seek! (-> self tween) 1.0 (* 0.5 (-> *display* seconds-per-frame))) + (seek! (-> self tween) 1.0 (* 0.5 (seconds-per-frame))) (let ((f0-6 (vector-vector-distance (-> self root-override trans) (-> self target)))) (cond ((< f0-6 20480.0) - (seek! (-> self tween) 1.0 (* 3.0 (-> *display* seconds-per-frame))) + (seek! (-> self tween) 1.0 (* 3.0 (seconds-per-frame))) ) ((< f0-6 40960.0) - (seek! (-> self tween) 1.0 (-> *display* seconds-per-frame)) + (seek! (-> self tween) 1.0 (seconds-per-frame)) ) ) ) @@ -833,15 +833,15 @@ ;; definition for method 27 of type projectile ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-27 projectile ((obj projectile)) +(defmethod projectile-method-27 projectile ((this projectile)) 0 (none) ) ;; definition for method 26 of type projectile ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-26 projectile ((obj projectile)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod projectile-method-26 projectile ((this projectile)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) (set! (-> s5-0 no-reaction) @@ -859,7 +859,7 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -867,8 +867,8 @@ ;; definition for method 25 of type projectile ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-25 projectile ((obj projectile)) - (go (method-of-object obj projectile-moving)) +(defmethod projectile-method-25 projectile ((this projectile)) + (go (method-of-object this projectile-moving)) 0 (none) ) @@ -887,11 +887,11 @@ ) ;; definition for method 10 of type projectile -(defmethod deactivate projectile ((obj projectile)) - (if (nonzero? (-> obj sound-id)) - (sound-stop (-> obj sound-id)) +(defmethod deactivate projectile ((this projectile)) + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -946,24 +946,24 @@ ;; definition for method 27 of type projectile-yellow ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-27 projectile-yellow ((obj projectile-yellow)) +(defmethod projectile-method-27 projectile-yellow ((this projectile-yellow)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj mode) 1) - (set! (-> obj max-speed) (vector-length (-> obj root-override transv))) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj angle) (vector-y-angle (-> obj root-override transv))) - (set! (-> obj tween) 0.05) - (logior! (-> obj options) 2) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this mode) 1) + (set! (-> this max-speed) (vector-length (-> this root-override transv))) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this angle) (vector-y-angle (-> this root-override transv))) + (set! (-> this tween) 0.05) + (logior! (-> this options) 2) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root-override trans quad)) - (+! (-> obj root-override trans y) -5324.8) - (vector+float*! (-> obj target) (-> obj root-override trans) (-> obj root-override transv) 2.0) - (set! (-> obj target-base quad) (-> obj target quad)) - (let ((f30-0 (the float (sar (shl (the int (y-angle (-> obj root-override))) 48) 48)))) - (set! (-> obj mask) (the-as process-mask (logior (process-mask projectile) (-> obj mask)))) - (if (logtest? (-> obj options) 16) - (set! (-> obj max-hits) 1) + (set! (-> s5-0 quad) (-> this root-override trans quad)) + (+! (-> this root-override trans y) -5324.8) + (vector+float*! (-> this target) (-> this root-override trans) (-> this root-override transv) 2.0) + (set! (-> this target-base quad) (-> this target quad)) + (let ((f30-0 (the float (sar (shl (the int (y-angle (-> this root-override))) 48) 48)))) + (set! (-> this mask) (the-as process-mask (logior (process-mask projectile) (-> this mask)))) + (if (logtest? (-> this options) 16) + (set! (-> this max-hits) 1) ) (set! (-> *part-id-table* 356 init-specs 18 initial-valuef) (the float (sar (shl (the int (+ -16384.0 f30-0)) 48) 48)) @@ -972,40 +972,40 @@ (the float (sar (shl (the int (+ -16384.0 f30-0)) 48) 48)) ) (sound-play "yellow-fire") - (set! (-> obj sound-id) (sound-play "yellow-buzz")) - (if (not (logtest? (-> obj options) 416)) - (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0 :to obj) + (set! (-> this sound-id) (sound-play "yellow-buzz")) + (if (not (logtest? (-> this options) 416)) + (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 103) -1 #f #f #f s5-0 :to this) ) (set! (-> *part-id-table* 350 init-specs 2 initial-valuef) f30-0) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 102) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 102) this)) (when *target* (case (-> *target* current-level name) (('swamp) - (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) - (set! (-> obj water height) (if (logtest? (-> obj options) 64) - 8192.0 - 10240.0 - ) + (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01 wt04 wt07)) + (set! (-> this water height) (if (logtest? (-> this options) 64) + 8192.0 + 10240.0 + ) ) - (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) + (logior! (-> this root-override root-prim collide-with) (collide-kind water)) ) (('ogre) - (when (not (logtest? (-> obj options) 128)) - (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) - (set! (-> obj water height) 129024.0) - (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) + (when (not (logtest? (-> this options) 128)) + (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01 wt04 wt07)) + (set! (-> this water height) 129024.0) + (logior! (-> this root-override root-prim collide-with) (collide-kind water)) ) ) (('finalboss) - (+! (-> obj root-override trans y) 4096.0) - (set! (-> obj water) (new 'process 'water-control obj 0 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01 wt04 wt07)) - (set! (-> obj water height) 1977958.4) - (logior! (-> obj root-override root-prim collide-with) (collide-kind water)) + (+! (-> this root-override trans y) 4096.0) + (set! (-> this water) (new 'process 'water-control this 0 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01 wt04 wt07)) + (set! (-> this water height) 1977958.4) + (logior! (-> this root-override root-prim collide-with) (collide-kind water)) ) ) ) @@ -1015,52 +1015,52 @@ ;; definition for method 26 of type projectile-yellow ;; INFO: Return type mismatch collide-kind vs none. -(defmethod projectile-method-26 projectile-yellow ((obj projectile-yellow)) +(defmethod projectile-method-26 projectile-yellow ((this projectile-yellow)) (let ((t9-0 (method-of-type projectile projectile-method-26))) - (t9-0 obj) + (t9-0 this) ) - (logior! (-> obj root-override root-prim collide-with) (collide-kind mother-spider)) + (logior! (-> this root-override root-prim collide-with) (collide-kind mother-spider)) (none) ) ;; definition for method 24 of type projectile-yellow ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-24 projectile-yellow ((obj projectile-yellow)) +(defmethod projectile-method-24 projectile-yellow ((this projectile-yellow)) (with-pp (find-ground-and-draw-shadow - (-> obj root-override trans) - (-> obj root-override shadow-pos) + (-> this root-override trans) + (-> this root-override shadow-pos) 8192.0 (collide-kind background) (the-as process-drawable #f) 12288.0 81920.0 ) - (if (< (-> obj root-override trans y) (-> obj root-override shadow-pos y)) - (set! (-> obj root-override trans y) (+ 1228.8 (-> obj root-override shadow-pos y))) + (if (< (-> this root-override trans y) (-> this root-override shadow-pos y)) + (set! (-> this root-override trans y) (+ 1228.8 (-> this root-override shadow-pos y))) ) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (set! (-> *part-id-table* 353 init-specs 16 initial-valuef) (the-as float 30)) (set! (-> *part-id-table* 353 init-specs 16 random-rangef) (the-as float 300)) (cond - ((logtest? (-> obj options) 32) - (when (>= (- (-> *display* base-frame-counter) (-> obj state-time)) (seconds 0.05)) - (when (< (- (-> *display* base-frame-counter) (-> obj state-time)) (seconds 0.5)) + ((logtest? (-> this options) 32) + (when (time-elapsed? (-> this state-time) (seconds 0.05)) + (when (not (time-elapsed? (-> this state-time) (seconds 0.5))) (set! (-> *part-id-table* 353 init-specs 16 initial-valuef) (the-as float 0)) (set! (-> *part-id-table* 353 init-specs 16 random-rangef) (the-as float 0)) 0 ) - (spawn (-> obj part) (the-as vector (-> obj root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) ) ) (else - (spawn (-> obj part) (the-as vector (-> obj root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) ) ) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) - (set! (-> s5-0 id) (-> obj sound-id)) - (let ((a1-3 (-> obj root-override trans))) + (set! (-> s5-0 id) (-> this sound-id)) + (let ((a1-3 (-> this root-override trans))) (let ((gp-1 pp)) (when (= a1-3 #t) (if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) @@ -1082,20 +1082,20 @@ ;; definition for method 28 of type projectile-yellow ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-28 projectile-yellow ((obj projectile-yellow)) +(defmethod projectile-method-28 projectile-yellow ((this projectile-yellow)) (cond - ((or (not (handle->process (-> obj last-target))) - (zero? (-> (the-as target (handle->process (-> obj last-target))) control root-prim prim-core collide-as)) + ((or (not (handle->process (-> this last-target))) + (zero? (-> (the-as target (handle->process (-> this last-target))) control root-prim prim-core collide-as)) ) (cond - ((zero? (-> obj target-count)) + ((zero? (-> this target-count)) (let ((s5-0 (find-nearest-attackable - (-> obj parent-base) + (-> this parent-base) 409600.0 (the-as uint 0) (the-as uint 0) - (-> obj base-vector) - (if (logtest? (-> obj options) 160) + (-> this base-vector) + (if (logtest? (-> this options) 160) 546.13336 8192.0 ) @@ -1103,23 +1103,23 @@ ) ) (let ((s4-0 (find-nearest-attackable - (-> obj parent-base) + (-> this parent-base) 163840.0 (the-as uint 1) (the-as uint 0) - (-> obj base-vector) - (if (logtest? (-> obj options) 160) + (-> this base-vector) + (if (logtest? (-> this options) 160) 910.2222 8192.0 ) ) ) (v1-10 (find-nearest-attackable - (-> obj parent-base) + (-> this parent-base) 28672.0 (the-as uint 1) (the-as uint 0) - (-> obj base-vector) + (-> this base-vector) 16384.0 ) ) @@ -1131,32 +1131,32 @@ (set! s5-0 v1-10) ) ) - (set! (-> obj last-target) (process->handle s5-0)) + (set! (-> this last-target) (process->handle s5-0)) (when s5-0 - (set! (-> obj target quad) (-> s5-0 root-override root-prim prim-core world-sphere quad)) + (set! (-> this target quad) (-> s5-0 root-override root-prim prim-core world-sphere quad)) (if (= (-> s5-0 type symbol) 'mother-spider) - (logand! (-> obj options) -2) + (logand! (-> this options) -2) ) ) ) ) (else - (set! (-> obj target quad) (-> obj target-base quad)) + (set! (-> this target quad) (-> this target-base quad)) ) ) ) (else - (let ((a1-8 (handle->process (-> obj last-target)))) - (set! (-> obj target quad) (-> (the-as target a1-8) control root-prim prim-core world-sphere quad)) + (let ((a1-8 (handle->process (-> this last-target)))) + (set! (-> this target quad) (-> (the-as target a1-8) control root-prim prim-core world-sphere quad)) ) - (if (and (< (vector-vector-xz-distance (-> obj root-override trans) (-> obj target)) 20480.0) - (< 24576.0 (fabs (- (-> obj target y) (-> obj root-override trans y)))) + (if (and (< (vector-vector-xz-distance (-> this root-override trans) (-> this target)) 20480.0) + (< 24576.0 (fabs (- (-> this target y) (-> this root-override trans y)))) ) - (set! (-> obj last-target) (the-as handle #f)) + (set! (-> this last-target) (the-as handle #f)) ) ) ) - (+! (-> obj target-count) 1) + (+! (-> this target-count) 1) 0 (none) ) @@ -1164,26 +1164,26 @@ ;; definition for method 27 of type projectile-blue ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-27 projectile-blue ((obj projectile-blue)) +(defmethod projectile-method-27 projectile-blue ((this projectile-blue)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (sound-play "blue-eco-on") - (set! (-> obj mode) 2) - (set! (-> obj max-speed) (-> *TARGET-bank* yellow-projectile-speed)) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (+! (-> obj root-override trans y) -5324.8) - (vector+float*! (-> obj target) (-> obj root-override trans) (-> obj root-override transv) 2.0) - (set! (-> obj target-base quad) (-> obj target quad)) - (set! (-> obj mask) (the-as process-mask (logior (process-mask ambient) (-> obj mask)))) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 42) obj)) - (set! (-> obj root-override root-prim collide-with) (collide-kind background)) - (let* ((s5-1 (handle->process (-> obj last-target))) + (set! (-> this mode) 2) + (set! (-> this max-speed) (-> *TARGET-bank* yellow-projectile-speed)) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (+! (-> this root-override trans y) -5324.8) + (vector+float*! (-> this target) (-> this root-override trans) (-> this root-override transv) 2.0) + (set! (-> this target-base quad) (-> this target quad)) + (set! (-> this mask) (the-as process-mask (logior (process-mask ambient) (-> this mask)))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 42) this)) + (set! (-> this root-override root-prim collide-with) (collide-kind background)) + (let* ((s5-1 (handle->process (-> this last-target))) (v1-20 (if (and (nonzero? s5-1) (type-type? (-> s5-1 type) process-drawable)) s5-1 ) ) ) (if v1-20 - (set! (-> obj joint-num) (rand-vu-int-range 3 (+ (-> (the-as process-drawable v1-20) node-list length) -1))) + (set! (-> this joint-num) (rand-vu-int-range 3 (+ (-> (the-as process-drawable v1-20) node-list length) -1))) ) ) 0 @@ -1192,8 +1192,8 @@ ;; definition for method 26 of type projectile-blue ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-26 projectile-blue ((obj projectile-blue)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod projectile-method-26 projectile-blue ((this projectile-blue)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1211,7 +1211,7 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -1271,19 +1271,19 @@ ;; definition for method 28 of type projectile-blue ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-28 projectile-blue ((obj projectile-blue)) - (let* ((s5-0 (handle->process (-> obj last-target))) +(defmethod projectile-method-28 projectile-blue ((this projectile-blue)) + (let* ((s5-0 (handle->process (-> this last-target))) (v1-4 (if (and (nonzero? s5-0) (type-type? (-> s5-0 type) process-drawable)) s5-0 ) ) ) (if v1-4 - (vector<-cspace! (-> obj target) (-> (the-as process-drawable v1-4) node-list data (-> obj joint-num))) + (vector<-cspace! (-> this target) (-> (the-as process-drawable v1-4) node-list data (-> this joint-num))) ) ) - (if (< (vector-vector-distance (-> obj target) (-> obj root-override trans)) 4096.0) - (go (method-of-object obj projectile-impact)) + (if (< (vector-vector-distance (-> this target) (-> this root-override trans)) 4096.0) + (go (method-of-object this projectile-impact)) ) 0 (none) @@ -1291,9 +1291,9 @@ ;; definition for method 24 of type projectile-blue ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-24 projectile-blue ((obj projectile-blue)) +(defmethod projectile-method-24 projectile-blue ((this projectile-blue)) (if (rand-vu-percent? 0.75) - (eco-blue-glow (the-as vector (-> obj root-override root-prim prim-core))) + (eco-blue-glow (the-as vector (-> this root-override root-prim prim-core))) ) 0 (none) diff --git a/test/decompiler/reference/jak1/engine/game/settings-h_REF.gc b/test/decompiler/reference/jak1/engine/game/settings-h_REF.gc index b96e193214..7e2010005a 100644 --- a/test/decompiler/reference/jak1/engine/game/settings-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/settings-h_REF.gc @@ -51,47 +51,47 @@ ) ;; definition for method 3 of type setting-data -(defmethod inspect setting-data ((obj setting-data)) - (format #t "[~8x] ~A~%" obj 'setting-data) - (format #t "~Tborder-mode: ~A~%" (-> obj border-mode)) - (format #t "~Tsfx-volume: ~f~%" (-> obj sfx-volume)) - (format #t "~Tmusic-volume: ~f~%" (-> obj music-volume)) - (format #t "~Tdialog-volume: ~f~%" (-> obj dialog-volume)) - (format #t "~Tprocess-mask: ~D~%" (-> obj process-mask)) - (format #t "~Tcommon-page: ~D~%" (-> obj common-page)) - (format #t "~Tlanguage: ~D~%" (-> obj language)) - (format #t "~Tscreenx: ~D~%" (-> obj screenx)) - (format #t "~Tscreeny: ~D~%" (-> obj screeny)) - (format #t "~Tvibration: ~A~%" (-> obj vibration)) - (format #t "~Tplay-hints: ~A~%" (-> obj play-hints)) - (format #t "~Tmovie: ~A~%" (ppointer->process (-> obj movie))) - (format #t "~Ttalking: ~A~%" (ppointer->process (-> obj talking))) - (format #t "~Tspooling: ~A~%" (ppointer->process (-> obj spooling))) - (format #t "~Thint: ~A~%" (ppointer->process (-> obj hint))) - (format #t "~Tambient: ~A~%" (ppointer->process (-> obj ambient))) - (format #t "~Tvideo-mode: ~A~%" (-> obj video-mode)) - (format #t "~Taspect-ratio: ~A~%" (-> obj aspect-ratio)) - (format #t "~Tsound-flava: ~D~%" (-> obj sound-flava)) - (format #t "~Tauto-save: ~A~%" (-> obj auto-save)) - (format #t "~Tmusic-volume-movie: ~f~%" (-> obj music-volume-movie)) - (format #t "~Tsfx-volume-movie: ~f~%" (-> obj sfx-volume-movie)) - (format #t "~Tmusic: ~A~%" (-> obj music)) - (format #t "~Tbg-r: ~f~%" (-> obj bg-r)) - (format #t "~Tbg-g: ~f~%" (-> obj bg-g)) - (format #t "~Tbg-b: ~f~%" (-> obj bg-b)) - (format #t "~Tbg-a: ~f~%" (-> obj bg-a)) - (format #t "~Tbg-a-speed: ~f~%" (-> obj bg-a-speed)) - (format #t "~Tbg-a-force: ~f~%" (-> obj bg-a-force)) - (format #t "~Tallow-progress: ~A~%" (-> obj allow-progress)) - (format #t "~Tallow-pause: ~A~%" (-> obj allow-pause)) - (format #t "~Tsound-flava-priority: ~f~%" (-> obj sound-flava-priority)) - (format #t "~Tocean-off: ~A~%" (-> obj ocean-off)) - (format #t "~Tallow-look-around: ~A~%" (-> obj allow-look-around)) - (format #t "~Tambient-volume: ~f~%" (-> obj ambient-volume)) - (format #t "~Tambient-volume-movie: ~f~%" (-> obj ambient-volume-movie)) - (format #t "~Tdialog-volume-hint: ~f~%" (-> obj dialog-volume-hint)) - (format #t "~Tdummy[11] @ #x~X~%" (-> obj dummy)) - obj +(defmethod inspect setting-data ((this setting-data)) + (format #t "[~8x] ~A~%" this 'setting-data) + (format #t "~Tborder-mode: ~A~%" (-> this border-mode)) + (format #t "~Tsfx-volume: ~f~%" (-> this sfx-volume)) + (format #t "~Tmusic-volume: ~f~%" (-> this music-volume)) + (format #t "~Tdialog-volume: ~f~%" (-> this dialog-volume)) + (format #t "~Tprocess-mask: ~D~%" (-> this process-mask)) + (format #t "~Tcommon-page: ~D~%" (-> this common-page)) + (format #t "~Tlanguage: ~D~%" (-> this language)) + (format #t "~Tscreenx: ~D~%" (-> this screenx)) + (format #t "~Tscreeny: ~D~%" (-> this screeny)) + (format #t "~Tvibration: ~A~%" (-> this vibration)) + (format #t "~Tplay-hints: ~A~%" (-> this play-hints)) + (format #t "~Tmovie: ~A~%" (ppointer->process (-> this movie))) + (format #t "~Ttalking: ~A~%" (ppointer->process (-> this talking))) + (format #t "~Tspooling: ~A~%" (ppointer->process (-> this spooling))) + (format #t "~Thint: ~A~%" (ppointer->process (-> this hint))) + (format #t "~Tambient: ~A~%" (ppointer->process (-> this ambient))) + (format #t "~Tvideo-mode: ~A~%" (-> this video-mode)) + (format #t "~Taspect-ratio: ~A~%" (-> this aspect-ratio)) + (format #t "~Tsound-flava: ~D~%" (-> this sound-flava)) + (format #t "~Tauto-save: ~A~%" (-> this auto-save)) + (format #t "~Tmusic-volume-movie: ~f~%" (-> this music-volume-movie)) + (format #t "~Tsfx-volume-movie: ~f~%" (-> this sfx-volume-movie)) + (format #t "~Tmusic: ~A~%" (-> this music)) + (format #t "~Tbg-r: ~f~%" (-> this bg-r)) + (format #t "~Tbg-g: ~f~%" (-> this bg-g)) + (format #t "~Tbg-b: ~f~%" (-> this bg-b)) + (format #t "~Tbg-a: ~f~%" (-> this bg-a)) + (format #t "~Tbg-a-speed: ~f~%" (-> this bg-a-speed)) + (format #t "~Tbg-a-force: ~f~%" (-> this bg-a-force)) + (format #t "~Tallow-progress: ~A~%" (-> this allow-progress)) + (format #t "~Tallow-pause: ~A~%" (-> this allow-pause)) + (format #t "~Tsound-flava-priority: ~f~%" (-> this sound-flava-priority)) + (format #t "~Tocean-off: ~A~%" (-> this ocean-off)) + (format #t "~Tallow-look-around: ~A~%" (-> this allow-look-around)) + (format #t "~Tambient-volume: ~f~%" (-> this ambient-volume)) + (format #t "~Tambient-volume-movie: ~f~%" (-> this ambient-volume-movie)) + (format #t "~Tdialog-volume-hint: ~f~%" (-> this dialog-volume-hint)) + (format #t "~Tdummy[11] @ #x~X~%" (-> this dummy)) + this ) ;; definition of type setting-control @@ -115,13 +115,13 @@ ) ;; definition for method 3 of type setting-control -(defmethod inspect setting-control ((obj setting-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tcurrent: #~%" (-> obj current)) - (format #t "~Ttarget: #~%" (-> obj target)) - (format #t "~Tdefault: #~%" (-> obj default)) - (format #t "~Tengine: ~A~%" (-> obj engine)) - obj +(defmethod inspect setting-control ((this setting-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tcurrent: #~%" (-> this current)) + (format #t "~Ttarget: #~%" (-> this target)) + (format #t "~Tdefault: #~%" (-> this default)) + (format #t "~Tengine: ~A~%" (-> this engine)) + this ) ;; definition for method 0 of type setting-control @@ -149,17 +149,17 @@ ) ;; definition for method 3 of type scf-time -(defmethod inspect scf-time ((obj scf-time)) - (format #t "[~8x] ~A~%" obj 'scf-time) - (format #t "~Tstat: ~D~%" (-> obj stat)) - (format #t "~Tsecond: #x~X~%" (-> obj second)) - (format #t "~Tminute: #x~X~%" (-> obj minute)) - (format #t "~Thour: #x~X~%" (-> obj hour)) - (format #t "~Tweek: #x~X~%" (-> obj week)) - (format #t "~Tday: #x~X~%" (-> obj day)) - (format #t "~Tmonth: #x~X~%" (-> obj month)) - (format #t "~Tyear: #x~X~%" (-> obj year)) - obj +(defmethod inspect scf-time ((this scf-time)) + (format #t "[~8x] ~A~%" this 'scf-time) + (format #t "~Tstat: ~D~%" (-> this stat)) + (format #t "~Tsecond: #x~X~%" (-> this second)) + (format #t "~Tminute: #x~X~%" (-> this minute)) + (format #t "~Thour: #x~X~%" (-> this hour)) + (format #t "~Tweek: #x~X~%" (-> this week)) + (format #t "~Tday: #x~X~%" (-> this day)) + (format #t "~Tmonth: #x~X~%" (-> this month)) + (format #t "~Tyear: #x~X~%" (-> this year)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/game/settings_REF.gc b/test/decompiler/reference/jak1/engine/game/settings_REF.gc index e38d57ddd3..5952363737 100644 --- a/test/decompiler/reference/jak1/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/settings_REF.gc @@ -2,34 +2,34 @@ (in-package goal) ;; definition for method 9 of type setting-data -(defmethod update-from-engine setting-data ((obj setting-data) (arg0 engine)) +(defmethod update-from-engine setting-data ((this setting-data) (arg0 engine)) (let ((conn (the-as connection (-> arg0 alive-list-end))) (s4-0 (-> arg0 alive-list-end prev0)) ) (while (!= (the-as connectable conn) (-> arg0 alive-list)) (case (-> conn param0) (('border-mode) - (set! (-> obj border-mode) (the-as symbol (-> conn param1))) + (set! (-> this border-mode) (the-as symbol (-> conn param1))) ) (('allow-look-around) - (set! (-> obj allow-look-around) (the-as symbol (-> conn param1))) + (set! (-> this allow-look-around) (the-as symbol (-> conn param1))) ) (('ocean-off) - (set! (-> obj ocean-off) (the-as symbol (-> conn param1))) + (set! (-> this ocean-off) (the-as symbol (-> conn param1))) ) (('music) - (set! (-> obj music) (the-as symbol (-> conn param1))) + (set! (-> this music) (the-as symbol (-> conn param1))) ) (('process-mask) (case (the-as object (-> conn param1)) (('set) - (logior! (-> obj process-mask) (the-as int (-> conn param3))) + (logior! (-> this process-mask) (the-as int (-> conn param3))) ) (('clear) - (logclear! (-> obj process-mask) (the-as uint (-> conn param3))) + (logclear! (-> this process-mask) (the-as uint (-> conn param3))) ) (('abs) - (set! (-> obj process-mask) (the-as process-mask (the-as int (-> conn param3)))) + (set! (-> this process-mask) (the-as process-mask (the-as int (-> conn param3)))) ) ) ) @@ -39,10 +39,10 @@ ) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj sfx-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj sfx-volume))) + (set! (-> this sfx-volume) (* 0.01 (the-as float (-> conn param2)) (-> this sfx-volume))) ) (else - (set! (-> obj sfx-volume) (the-as float (-> conn param2))) + (set! (-> this sfx-volume) (the-as float (-> conn param2))) ) ) ) @@ -50,137 +50,137 @@ (('music-volume) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj music-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj music-volume))) + (set! (-> this music-volume) (* 0.01 (the-as float (-> conn param2)) (-> this music-volume))) ) (else - (set! (-> obj music-volume) (the-as float (-> conn param2))) + (set! (-> this music-volume) (the-as float (-> conn param2))) ) ) ) (('ambient-volume) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj ambient-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj ambient-volume))) + (set! (-> this ambient-volume) (* 0.01 (the-as float (-> conn param2)) (-> this ambient-volume))) ) (else - (set! (-> obj ambient-volume) (the-as float (-> conn param2))) + (set! (-> this ambient-volume) (the-as float (-> conn param2))) ) ) ) (('dialog-volume) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj dialog-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj dialog-volume))) + (set! (-> this dialog-volume) (* 0.01 (the-as float (-> conn param2)) (-> this dialog-volume))) ) (else - (set! (-> obj dialog-volume) (the-as float (-> conn param2))) + (set! (-> this dialog-volume) (the-as float (-> conn param2))) ) ) ) (('sfx-volume-movie) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj sfx-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> obj sfx-volume-movie))) + (set! (-> this sfx-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> this sfx-volume-movie))) ) (else - (set! (-> obj sfx-volume-movie) (the-as float (-> conn param2))) + (set! (-> this sfx-volume-movie) (the-as float (-> conn param2))) ) ) ) (('music-volume-movie) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj music-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> obj music-volume-movie))) + (set! (-> this music-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> this music-volume-movie))) ) (else - (set! (-> obj music-volume-movie) (the-as float (-> conn param2))) + (set! (-> this music-volume-movie) (the-as float (-> conn param2))) ) ) ) (('ambient-volume-movie) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj ambient-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> obj ambient-volume-movie))) + (set! (-> this ambient-volume-movie) (* 0.01 (the-as float (-> conn param2)) (-> this ambient-volume-movie))) ) (else - (set! (-> obj ambient-volume-movie) (the-as float (-> conn param2))) + (set! (-> this ambient-volume-movie) (the-as float (-> conn param2))) ) ) ) (('dialog-volume-hint) (case (the-as symbol (-> conn param1)) (('rel) - (set! (-> obj dialog-volume-hint) (* 0.01 (the-as float (-> conn param2)) (-> obj dialog-volume-hint))) + (set! (-> this dialog-volume-hint) (* 0.01 (the-as float (-> conn param2)) (-> this dialog-volume-hint))) ) (else - (set! (-> obj dialog-volume-hint) (the-as float (-> conn param2))) + (set! (-> this dialog-volume-hint) (the-as float (-> conn param2))) ) ) ) (('sound-flava) - (when (>= (the-as float (-> conn param2)) (-> obj sound-flava-priority)) - (set! (-> obj sound-flava) (the-as uint (the-as int (-> conn param3)))) - (set! (-> obj sound-flava-priority) (the-as float (-> conn param2))) + (when (>= (the-as float (-> conn param2)) (-> this sound-flava-priority)) + (set! (-> this sound-flava) (the-as uint (the-as int (-> conn param3)))) + (set! (-> this sound-flava-priority) (the-as float (-> conn param2))) ) ) (('bg-r) - (set! (-> obj bg-r) (the-as float (-> conn param2))) + (set! (-> this bg-r) (the-as float (-> conn param2))) ) (('bg-g) - (set! (-> obj bg-g) (the-as float (-> conn param2))) + (set! (-> this bg-g) (the-as float (-> conn param2))) ) (('bg-b) - (set! (-> obj bg-b) (the-as float (-> conn param2))) + (set! (-> this bg-b) (the-as float (-> conn param2))) ) (('bg-a) - (set! (-> obj bg-a) (the-as float (-> conn param2))) + (set! (-> this bg-a) (the-as float (-> conn param2))) ) (('bg-a-speed) - (set! (-> obj bg-a-speed) (the-as float (-> conn param2))) + (set! (-> this bg-a-speed) (the-as float (-> conn param2))) ) (('bg-a-force) - (set! (-> obj bg-a-force) (the-as float (-> conn param2))) + (set! (-> this bg-a-force) (the-as float (-> conn param2))) ) (('language) - (set! (-> obj language) (the-as language-enum (the-as int (-> conn param3)))) + (set! (-> this language) (the-as language-enum (the-as int (-> conn param3)))) ) (('vibration) - (set! (-> obj vibration) (the-as symbol (-> conn param1))) + (set! (-> this vibration) (the-as symbol (-> conn param1))) ) (('auto-save) - (set! (-> obj auto-save) (the-as symbol (-> conn param1))) + (set! (-> this auto-save) (the-as symbol (-> conn param1))) ) (('allow-pause) - (set! (-> obj allow-pause) (the-as symbol (-> conn param1))) + (set! (-> this allow-pause) (the-as symbol (-> conn param1))) ) (('allow-progress) - (set! (-> obj allow-progress) (the-as symbol (-> conn param1))) + (set! (-> this allow-progress) (the-as symbol (-> conn param1))) ) (('play-hints) - (set! (-> obj play-hints) (the-as symbol (-> conn param1))) + (set! (-> this play-hints) (the-as symbol (-> conn param1))) ) (('movie) - (set! (-> obj movie) (the-as (pointer progress) (-> conn param1))) + (set! (-> this movie) (the-as (pointer progress) (-> conn param1))) ) (('talking) - (set! (-> obj talking) (the-as (pointer progress) (-> conn param1))) + (set! (-> this talking) (the-as (pointer progress) (-> conn param1))) ) (('spooling) - (set! (-> obj spooling) (the-as (pointer progress) (-> conn param1))) + (set! (-> this spooling) (the-as (pointer progress) (-> conn param1))) ) (('hint) - (set! (-> obj hint) (the-as (pointer process) (-> conn param1))) + (set! (-> this hint) (the-as (pointer process) (-> conn param1))) ) (('ambient) - (set! (-> obj ambient) (the-as (pointer progress) (-> conn param1))) + (set! (-> this ambient) (the-as (pointer progress) (-> conn param1))) ) (('common-page) (case (the-as object (-> conn param1)) (('set) - (logior! (-> obj common-page) (the-as int (-> conn param3))) + (logior! (-> this common-page) (the-as int (-> conn param3))) ) (('clear) - (logclear! (-> obj common-page) (the-as uint (-> conn param3))) + (logclear! (-> this common-page) (the-as uint (-> conn param3))) ) ) ) @@ -189,31 +189,31 @@ (set! s4-0 (-> (the-as connectable conn) prev0)) ) ) - obj + this ) ;; definition for method 9 of type setting-control ;; INFO: Return type mismatch int vs none. -(defmethod add-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) - (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) +(defmethod add-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) + (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) ;; definition for method 10 of type setting-control ;; INFO: Return type mismatch int vs none. -(defmethod set-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) - (remove-setting obj arg0 arg1) - (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) +(defmethod set-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) + (remove-setting this arg0 arg1) + (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) ;; definition for method 11 of type setting-control ;; INFO: Return type mismatch int vs none. -(defmethod remove-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol)) +(defmethod remove-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol)) (when arg0 - (let ((s5-0 (-> obj engine)) + (let ((s5-0 (-> this engine)) (s4-0 (-> arg0 connection-list next1)) ) (while s4-0 @@ -231,12 +231,12 @@ ) ;; definition for method 12 of type setting-control -(defmethod apply-settings setting-control ((obj setting-control)) - (let ((gp-0 (-> obj current))) - (let ((s5-0 (-> obj target))) - (mem-copy! (the-as pointer s5-0) (the-as pointer (-> obj default)) 196) - (set! (-> s5-0 ambient-volume) (* 0.01 (-> obj default ambient-volume) (-> obj default sfx-volume))) - (update-from-engine s5-0 (-> obj engine)) +(defmethod apply-settings setting-control ((this setting-control)) + (let ((gp-0 (-> this current))) + (let ((s5-0 (-> this target))) + (mem-copy! (the-as pointer s5-0) (the-as pointer (-> this default)) 196) + (set! (-> s5-0 ambient-volume) (* 0.01 (-> this default ambient-volume) (-> this default sfx-volume))) + (update-from-engine s5-0 (-> this engine)) (set! (-> gp-0 border-mode) (-> s5-0 border-mode)) (set! (-> gp-0 common-page) (-> s5-0 common-page)) (set! (-> gp-0 vibration) (-> s5-0 vibration)) @@ -263,25 +263,25 @@ ) ;; definition for method 13 of type setting-control -(defmethod update setting-control ((obj setting-control)) - (apply-settings obj) - (let ((gp-0 (-> obj current))) - (let ((s5-1 (-> obj target))) +(defmethod update setting-control ((this setting-control)) + (apply-settings this) + (let ((gp-0 (-> this current))) + (let ((s5-1 (-> this target))) (when *sound-player-enable* (when (!= (-> gp-0 sfx-volume) (-> s5-1 sfx-volume)) - (seek! (-> gp-0 sfx-volume) (-> s5-1 sfx-volume) (* 100.0 (-> *display* seconds-per-frame))) + (seek! (-> gp-0 sfx-volume) (-> s5-1 sfx-volume) (* 100.0 (seconds-per-frame))) (sound-set-volume (sound-group sfx) (-> gp-0 sfx-volume)) ) (when (!= (-> gp-0 music-volume) (-> s5-1 music-volume)) - (seek! (-> gp-0 music-volume) (-> s5-1 music-volume) (* 100.0 (-> *display* seconds-per-frame))) + (seek! (-> gp-0 music-volume) (-> s5-1 music-volume) (* 100.0 (seconds-per-frame))) (sound-set-volume (sound-group music) (-> gp-0 music-volume)) ) (when (!= (-> gp-0 dialog-volume) (-> s5-1 dialog-volume)) - (seek! (-> gp-0 dialog-volume) (-> s5-1 dialog-volume) (* 100.0 (-> *display* seconds-per-frame))) + (seek! (-> gp-0 dialog-volume) (-> s5-1 dialog-volume) (* 100.0 (seconds-per-frame))) (sound-set-volume (sound-group dialog) (-> gp-0 dialog-volume)) ) (when (!= (-> gp-0 ambient-volume) (-> s5-1 ambient-volume)) - (seek! (-> gp-0 ambient-volume) (-> s5-1 ambient-volume) (* 100.0 (-> *display* seconds-per-frame))) + (seek! (-> gp-0 ambient-volume) (-> s5-1 ambient-volume) (* 100.0 (seconds-per-frame))) (sound-set-volume (sound-group ambient) (-> gp-0 ambient-volume)) ) ) @@ -334,7 +334,7 @@ (set! (-> gp-0 bg-r) (-> s5-1 bg-r)) (set! (-> gp-0 bg-g) (-> s5-1 bg-g)) (set! (-> gp-0 bg-b) (-> s5-1 bg-b)) - (seek! (-> gp-0 bg-a) (-> s5-1 bg-a) (* (-> s5-1 bg-a-speed) (-> *display* seconds-per-frame))) + (seek! (-> gp-0 bg-a) (-> s5-1 bg-a) (* (-> s5-1 bg-a-speed) (seconds-per-frame))) ) (let ((v1-60 (-> *display* frames (-> *display* on-screen) display)) (f0-39 (-> gp-0 bg-a)) diff --git a/test/decompiler/reference/jak1/engine/game/task/hint-control-h_REF.gc b/test/decompiler/reference/jak1/engine/game/task/hint-control-h_REF.gc index 8abfd0cef3..7c1a7000bd 100644 --- a/test/decompiler/reference/jak1/engine/game/task/hint-control-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/task/hint-control-h_REF.gc @@ -18,17 +18,17 @@ ) ;; definition for method 3 of type level-hint-control -(defmethod inspect level-hint-control ((obj level-hint-control)) - (format #t "[~8x] ~A~%" obj 'level-hint-control) - (format #t "~Tdelay-before-playing: ~D~%" (-> obj delay-before-playing)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tnum-attempts-before-playing: ~D~%" (-> obj num-attempts-before-playing)) - (format #t "~Tnum-success-before-killing: ~D~%" (-> obj num-success-before-killing)) - (format #t "~Tnum-attempts: ~D~%" (-> obj num-attempts)) - (format #t "~Tnum-success: ~D~%" (-> obj num-success)) - (format #t "~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~Tlast-time-called: ~D~%" (-> obj last-time-called)) - obj +(defmethod inspect level-hint-control ((this level-hint-control)) + (format #t "[~8x] ~A~%" this 'level-hint-control) + (format #t "~Tdelay-before-playing: ~D~%" (-> this delay-before-playing)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tnum-attempts-before-playing: ~D~%" (-> this num-attempts-before-playing)) + (format #t "~Tnum-success-before-killing: ~D~%" (-> this num-success-before-killing)) + (format #t "~Tnum-attempts: ~D~%" (-> this num-attempts)) + (format #t "~Tnum-success: ~D~%" (-> this num-success)) + (format #t "~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~Tlast-time-called: ~D~%" (-> this last-time-called)) + this ) ;; definition of type task-hint-control @@ -42,11 +42,11 @@ ) ;; definition for method 3 of type task-hint-control -(defmethod inspect task-hint-control ((obj task-hint-control)) - (format #t "[~8x] ~A~%" obj 'task-hint-control) - (format #t "~Ttask: ~D~%" (-> obj task)) - (format #t "~Tdelay: ~D~%" (-> obj delay)) - obj +(defmethod inspect task-hint-control ((this task-hint-control)) + (format #t "[~8x] ~A~%" this 'task-hint-control) + (format #t "~Ttask: ~D~%" (-> this task)) + (format #t "~Tdelay: ~D~%" (-> this delay)) + this ) ;; definition of type task-hint-control-group @@ -59,10 +59,10 @@ ) ;; definition for method 3 of type task-hint-control-group -(defmethod inspect task-hint-control-group ((obj task-hint-control-group)) - (format #t "[~8x] ~A~%" obj 'task-hint-control-group) - (format #t "~Ttasks: ~A~%" (-> obj tasks)) - obj +(defmethod inspect task-hint-control-group ((this task-hint-control-group)) + (format #t "[~8x] ~A~%" this 'task-hint-control-group) + (format #t "~Ttasks: ~A~%" (-> this tasks)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/game/task/hint-control_REF.gc b/test/decompiler/reference/jak1/engine/game/task/hint-control_REF.gc index 812126dae2..b62d56af89 100644 --- a/test/decompiler/reference/jak1/engine/game/task/hint-control_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/task/hint-control_REF.gc @@ -247,7 +247,7 @@ (zero? (-> *game-info* hint-control v1-0 start-time)) (!= (-> *game-info* hint-control v1-0 num-attempts-before-playing) 1) ) - (set! (-> *game-info* hint-control v1-0 start-time) (-> *display* base-frame-counter)) + (set-time! (-> *game-info* hint-control v1-0 start-time)) 0 ) ) @@ -280,7 +280,7 @@ (set! v1-0 (appeared-for-long-enough? (the-as level-hint (ppointer->process *hint-semaphore*)))) 0 ) - (when (and v1-0 (< (- (-> *display* base-frame-counter) (-> *game-info* hint-play-time)) (seconds 0.1))) + (when (and v1-0 (not (time-elapsed? (-> *game-info* hint-play-time) (seconds 0.1)))) (set! v1-0 #f) 0 ) @@ -289,7 +289,7 @@ (not (-> *setting-control* current spooling)) (not (-> *setting-control* current hint)) (not (-> *setting-control* current ambient)) - (>= (-> *display* base-frame-counter) (-> *game-info* blackout-time)) + (>= (current-time) (-> *game-info* blackout-time)) ) ) 0 @@ -303,7 +303,7 @@ ) (else (let ((gp-1 (-> *game-info* hint-control v1-16)) - (a0-24 (- (-> *display* base-frame-counter) (-> *game-info* hint-control v1-16 last-time-called))) + (a0-24 (- (current-time) (-> *game-info* hint-control v1-16 last-time-called))) (v1-21 #t) ) (if (and (= (-> gp-1 num-attempts-before-playing) 1) (< a0-24 (seconds 0.1))) @@ -312,13 +312,13 @@ (cond ((and (!= (-> gp-1 num-attempts-before-playing) 1) (nonzero? (-> gp-1 last-time-called)) - (< (- (-> *display* base-frame-counter) (-> gp-1 last-time-called)) (seconds 0.5)) + (not (time-elapsed? (-> gp-1 last-time-called) (seconds 0.5))) ) - (set! (-> gp-1 last-time-called) (-> *display* base-frame-counter)) + (set-time! (-> gp-1 last-time-called)) #f ) (else - (set! (-> gp-1 last-time-called) (-> *display* base-frame-counter)) + (set-time! (-> gp-1 last-time-called)) (when (nonzero? (-> gp-1 delay-before-playing)) (if (< (-> gp-1 start-time) (-> gp-1 delay-before-playing)) (set! v1-21 #f) diff --git a/test/decompiler/reference/jak1/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/jak1/engine/game/task/task-control-h_REF.gc index b2ea1e0840..d7b08e1746 100644 --- a/test/decompiler/reference/jak1/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/task/task-control-h_REF.gc @@ -23,13 +23,13 @@ ) ;; definition for method 3 of type task-cstage -(defmethod inspect task-cstage ((obj task-cstage)) - (format #t "[~8x] ~A~%" obj 'task-cstage) - (format #t "~Tgame-task: ~D~%" (-> obj game-task)) - (format #t "~Tstatus: ~D~%" (-> obj status)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tcondition: ~A~%" (-> obj condition)) - obj +(defmethod inspect task-cstage ((this task-cstage)) + (format #t "[~8x] ~A~%" this 'task-cstage) + (format #t "~Tgame-task: ~D~%" (-> this game-task)) + (format #t "~Tstatus: ~D~%" (-> this status)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tcondition: ~A~%" (-> this condition)) + this ) ;; definition of type task-control @@ -55,11 +55,11 @@ ) ;; definition for method 3 of type task-control -(defmethod inspect task-control ((obj task-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tcurrent-stage: ~D~%" (-> obj current-stage)) - (format #t "~Tstage: ~A~%" (-> obj stage)) - obj +(defmethod inspect task-control ((this task-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tcurrent-stage: ~D~%" (-> this current-stage)) + (format #t "~Tstage: ~A~%" (-> this stage)) + this ) ;; definition of type ambient-control @@ -80,12 +80,12 @@ ) ;; definition for method 3 of type ambient-control -(defmethod inspect ambient-control ((obj ambient-control)) - (format #t "[~8x] ~A~%" obj 'ambient-control) - (format #t "~Tlast-ambient-time: ~D~%" (-> obj last-ambient-time)) - (format #t "~Tlast-ambient: ~A~%" (-> obj last-ambient)) - (format #t "~Tlast-ambient-id: ~D~%" (-> obj last-ambient-id)) - obj +(defmethod inspect ambient-control ((this ambient-control)) + (format #t "[~8x] ~A~%" this 'ambient-control) + (format #t "~Tlast-ambient-time: ~D~%" (-> this last-ambient-time)) + (format #t "~Tlast-ambient: ~A~%" (-> this last-ambient)) + (format #t "~Tlast-ambient-id: ~D~%" (-> this last-ambient-id)) + this ) ;; definition of type process-taskable @@ -159,36 +159,36 @@ ) ;; definition for method 3 of type process-taskable -(defmethod inspect process-taskable ((obj process-taskable)) +(defmethod inspect process-taskable ((this process-taskable)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttasks: ~A~%" (-> obj tasks)) - (format #t "~T~Tquery: #~%" (-> obj query)) - (format #t "~T~Told-target-pos: #~%" (-> obj old-target-pos)) - (format #t "~T~Tcell-for-task: ~D~%" (-> obj cell-for-task)) - (format #t "~T~Tcell-x: ~D~%" (-> obj cell-x)) - (format #t "~T~Tcam-joint-index: ~D~%" (-> obj cam-joint-index)) - (format #t "~T~Tskippable: ~A~%" (-> obj skippable)) - (format #t "~T~Tblend-on-exit: ~A~%" (-> obj blend-on-exit)) - (format #t "~T~Tcamera: ~D~%" (-> obj camera)) - (format #t "~T~Twill-talk: ~A~%" (-> obj will-talk)) - (format #t "~T~Ttalk-message: ~D~%" (-> obj talk-message)) - (format #t "~T~Tlast-talk: ~D~%" (-> obj last-talk)) - (format #t "~T~Tbounce-away: ~A~%" (-> obj bounce-away)) - (format #t "~T~Tambient: #~%" (-> obj ambient)) - (format #t "~T~Tcenter-joint-index: ~D~%" (-> obj center-joint-index)) - (format #t "~T~Tdraw-bounds-y-offset: ~f~%" (-> obj draw-bounds-y-offset)) - (format #t "~T~Tneck-joint-index: ~D~%" (-> obj neck-joint-index)) - (format #t "~T~Tfuel-cell-anim: ~A~%" (-> obj fuel-cell-anim)) - (format #t "~T~Tsound-flava: ~D~%" (-> obj sound-flava)) - (format #t "~T~Thave-flava: ~A~%" (-> obj have-flava)) - (format #t "~T~Tmusic: ~A~%" (-> obj music)) - (format #t "~T~Thave-music: ~A~%" (-> obj have-music)) - (format #t "~T~Tbeen-kicked: ~A~%" (-> obj been-kicked)) - (format #t "~T~Tcur-trans-hook: ~A~%" (-> obj cur-trans-hook)) - (format #t "~T~Tshadow-backup: ~A~%" (-> obj shadow-backup)) - obj + (format #t "~T~Ttasks: ~A~%" (-> this tasks)) + (format #t "~T~Tquery: #~%" (-> this query)) + (format #t "~T~Told-target-pos: #~%" (-> this old-target-pos)) + (format #t "~T~Tcell-for-task: ~D~%" (-> this cell-for-task)) + (format #t "~T~Tcell-x: ~D~%" (-> this cell-x)) + (format #t "~T~Tcam-joint-index: ~D~%" (-> this cam-joint-index)) + (format #t "~T~Tskippable: ~A~%" (-> this skippable)) + (format #t "~T~Tblend-on-exit: ~A~%" (-> this blend-on-exit)) + (format #t "~T~Tcamera: ~D~%" (-> this camera)) + (format #t "~T~Twill-talk: ~A~%" (-> this will-talk)) + (format #t "~T~Ttalk-message: ~D~%" (-> this talk-message)) + (format #t "~T~Tlast-talk: ~D~%" (-> this last-talk)) + (format #t "~T~Tbounce-away: ~A~%" (-> this bounce-away)) + (format #t "~T~Tambient: #~%" (-> this ambient)) + (format #t "~T~Tcenter-joint-index: ~D~%" (-> this center-joint-index)) + (format #t "~T~Tdraw-bounds-y-offset: ~f~%" (-> this draw-bounds-y-offset)) + (format #t "~T~Tneck-joint-index: ~D~%" (-> this neck-joint-index)) + (format #t "~T~Tfuel-cell-anim: ~A~%" (-> this fuel-cell-anim)) + (format #t "~T~Tsound-flava: ~D~%" (-> this sound-flava)) + (format #t "~T~Thave-flava: ~A~%" (-> this have-flava)) + (format #t "~T~Tmusic: ~A~%" (-> this music)) + (format #t "~T~Thave-music: ~A~%" (-> this have-music)) + (format #t "~T~Tbeen-kicked: ~A~%" (-> this been-kicked)) + (format #t "~T~Tcur-trans-hook: ~A~%" (-> this cur-trans-hook)) + (format #t "~T~Tshadow-backup: ~A~%" (-> this shadow-backup)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak1/engine/game/task/task-control_REF.gc index 8a72bd9001..2500354c43 100644 --- a/test/decompiler/reference/jak1/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak1/engine/game/task/task-control_REF.gc @@ -35,60 +35,60 @@ ) ;; definition for method 9 of type task-cstage -(defmethod get-task task-cstage ((obj task-cstage)) - (-> obj game-task) +(defmethod get-task task-cstage ((this task-cstage)) + (-> this game-task) ) ;; definition for method 10 of type task-cstage -(defmethod get-status task-cstage ((obj task-cstage)) - (-> obj status) +(defmethod get-status task-cstage ((this task-cstage)) + (-> this status) ) ;; definition for method 12 of type task-cstage -(defmethod closed? task-cstage ((obj task-cstage)) - (logtest? (-> obj flags) (task-flags closed)) +(defmethod closed? task-cstage ((this task-cstage)) + (logtest? (-> this flags) (task-flags closed)) ) ;; definition for method 13 of type task-cstage -(defmethod closed-by-default? task-cstage ((obj task-cstage)) - (logtest? (-> obj flags) (task-flags closed-by-default)) +(defmethod closed-by-default? task-cstage ((this task-cstage)) + (logtest? (-> this flags) (task-flags closed-by-default)) ) ;; definition for method 11 of type task-cstage -(defmethod task-available? task-cstage ((obj task-cstage) (arg0 task-control)) - (let ((a0-1 obj)) +(defmethod task-available? task-cstage ((this task-cstage) (arg0 task-control)) + (let ((a0-1 this)) (cond ((logtest? (-> a0-1 flags) (task-flags closed)) #f ) - ((>= (the-as int (-> (get-entity-task-perm *game-info* (-> obj game-task)) user-uint8 0)) - (the-as int (-> obj status)) + ((>= (the-as int (-> (get-entity-task-perm *game-info* (-> this game-task)) user-uint8 0)) + (the-as int (-> this status)) ) - (logior! (-> obj flags) (task-flags closed)) + (logior! (-> this flags) (task-flags closed)) #f ) - ((task-complete? *game-info* (-> obj game-task)) - (logior! (-> obj flags) (task-flags closed)) + ((task-complete? *game-info* (-> this game-task)) + (logior! (-> this flags) (task-flags closed)) #f ) (else - ((-> obj condition) arg0) + ((-> this condition) arg0) ) ) ) ) ;; definition for method 14 of type task-cstage -(defmethod close-task! task-cstage ((obj task-cstage)) - (if (= (-> obj game-task) (game-task none)) +(defmethod close-task! task-cstage ((this task-cstage)) + (if (= (-> this game-task) (game-task none)) (return (the-as int #f)) ) - (logior! (-> obj flags) (task-flags closed)) - (when (logtest? (-> obj flags) (task-flags has-entity)) - (let ((v1-9 (get-entity-task-perm *game-info* (-> obj game-task)))) + (logior! (-> this flags) (task-flags closed)) + (when (logtest? (-> this flags) (task-flags has-entity)) + (let ((v1-9 (get-entity-task-perm *game-info* (-> this game-task)))) (logior! (-> v1-9 status) (entity-perm-status user-set-from-cstage)) - (if (< (-> v1-9 user-uint8 0) (the-as uint (-> obj status))) - (set! (-> v1-9 user-int8 0) (the-as int (-> obj status))) + (if (< (-> v1-9 user-uint8 0) (the-as uint (-> this status))) + (set! (-> v1-9 user-int8 0) (the-as int (-> this status))) ) ) ) @@ -96,8 +96,8 @@ ) ;; definition for method 15 of type task-cstage -(defmethod open-task! task-cstage ((obj task-cstage)) - (logclear! (-> obj flags) (task-flags closed)) +(defmethod open-task! task-cstage ((this task-cstage)) + (logclear! (-> this flags) (task-flags closed)) 0 ) @@ -108,17 +108,17 @@ ;; definition for method 9 of type task-control ;; INFO: Return type mismatch int vs game-task. -(defmethod current-task task-control ((obj task-control)) +(defmethod current-task task-control ((this task-control)) (the-as game-task (cond - ((= obj *null-task-control*) + ((= this *null-task-control*) (format 0 "ERROR: current-task received *null-task-control*~%") 0 ) - ((= (-> obj current-stage) -1) + ((= (-> this current-stage) -1) 0 ) (else - (the-as int (-> obj stage (-> obj current-stage) game-task)) + (the-as int (-> this stage (-> this current-stage) game-task)) ) ) ) @@ -126,45 +126,45 @@ ;; definition for method 10 of type task-control ;; INFO: Return type mismatch int vs task-status. -(defmethod current-status task-control ((obj task-control)) +(defmethod current-status task-control ((this task-control)) (the-as task-status (cond - ((= obj *null-task-control*) + ((= this *null-task-control*) (format 0 "ERROR: current-status received self of *null-task-control*~%~%") 0 ) - ((= (-> obj current-stage) -1) + ((= (-> this current-stage) -1) 0 ) (else - (the-as int (-> obj stage (-> obj current-stage) status)) + (the-as int (-> this stage (-> this current-stage) status)) ) ) ) ) ;; definition for method 11 of type task-control -(defmethod close-current! task-control ((obj task-control)) +(defmethod close-current! task-control ((this task-control)) (cond - ((= obj *null-task-control*) + ((= this *null-task-control*) (format 0 "ERROR: close-current! received self of *null-task-control*~%~%") ) - ((= (-> obj current-stage) -1) + ((= (-> this current-stage) -1) ) (else - (close-task! (-> obj stage (-> obj current-stage))) + (close-task! (-> this stage (-> this current-stage))) ) ) - (first-any obj #t) + (first-any this #t) ) ;; definition for method 12 of type task-control ;; INFO: Return type mismatch int vs game-task. -(defmethod close-status! task-control ((obj task-control) (arg0 task-status)) - (let ((a0-2 (current-task obj))) - (dotimes (v1-1 (-> obj stage length)) - (when (and (= a0-2 (-> obj stage v1-1 game-task)) (= arg0 (-> obj stage v1-1 status))) - (close-task! (-> obj stage v1-1)) - (return (the-as game-task (first-any obj #t))) +(defmethod close-status! task-control ((this task-control) (arg0 task-status)) + (let ((a0-2 (current-task this))) + (dotimes (v1-1 (-> this stage length)) + (when (and (= a0-2 (-> this stage v1-1 game-task)) (= arg0 (-> this stage v1-1 status))) + (close-task! (-> this stage v1-1)) + (return (the-as game-task (first-any this #t))) ) ) (format @@ -179,41 +179,41 @@ ;; definition for method 13 of type task-control ;; INFO: Return type mismatch int vs game-task. -(defmethod first-any task-control ((obj task-control) (arg0 symbol)) - (when (= obj *null-task-control*) +(defmethod first-any task-control ((this task-control) (arg0 symbol)) + (when (= this *null-task-control*) (if arg0 (format 0 "ERROR: first-any received self of *null-task-control*~%~%") ) (return (game-task none)) ) - (dotimes (s5-0 (-> obj stage length)) - (when (task-available? (-> obj stage s5-0) obj) - (set! (-> obj current-stage) s5-0) - (return (the-as game-task (-> obj stage s5-0 game-task))) + (dotimes (s5-0 (-> this stage length)) + (when (task-available? (-> this stage s5-0) this) + (set! (-> this current-stage) s5-0) + (return (the-as game-task (-> this stage s5-0 game-task))) ) ) - (set! (-> obj current-stage) -1) + (set! (-> this current-stage) -1) (the-as game-task 0) ) ;; definition for method 14 of type task-control -(defmethod reset! task-control ((obj task-control) (arg0 symbol) (arg1 symbol)) - (when (= obj *null-task-control*) +(defmethod reset! task-control ((this task-control) (arg0 symbol) (arg1 symbol)) + (when (= this *null-task-control*) (if arg1 (format 0 "ERROR: reset! received self of *null-task-control*~%~%") ) (return 0) ) - (dotimes (s4-0 (-> obj stage length)) - (if (or (= arg0 'game) (let ((a0-4 (-> obj stage s4-0))) + (dotimes (s4-0 (-> this stage length)) + (if (or (= arg0 'game) (let ((a0-4 (-> this stage s4-0))) (not (logtest? (-> a0-4 flags) (task-flags closed-by-default))) ) ) - (open-task! (-> obj stage s4-0)) + (open-task! (-> this stage s4-0)) ) - (let ((a0-10 (-> obj stage s4-0))) + (let ((a0-10 (-> this stage s4-0))) (if (logtest? (-> a0-10 flags) (task-flags closed)) - (close-task! (-> obj stage s4-0)) + (close-task! (-> this stage s4-0)) ) ) ) @@ -221,14 +221,14 @@ ) ;; definition for method 15 of type task-control -(defmethod closed? task-control ((obj task-control) (arg0 game-task) (arg1 task-status)) - (when (= obj *null-task-control*) +(defmethod closed? task-control ((this task-control) (arg0 game-task) (arg1 task-status)) + (when (= this *null-task-control*) (format 0 "ERROR: closed? received self of *null-task-control*~%~%") (return #f) ) - (dotimes (v1-3 (-> obj stage length)) - (when (and (= arg0 (-> obj stage v1-3 game-task)) (= arg1 (-> obj stage v1-3 status))) - (let ((a0-3 (-> obj stage v1-3))) + (dotimes (v1-3 (-> this stage length)) + (when (and (= arg0 (-> this stage v1-3 game-task)) (= arg1 (-> this stage v1-3 status))) + (let ((a0-3 (-> this stage v1-3))) (return (logtest? (-> a0-3 flags) (task-flags closed))) ) ) @@ -243,13 +243,13 @@ ) ;; definition for method 18 of type task-control -(defmethod exists? task-control ((obj task-control) (arg0 game-task) (arg1 task-status)) - (when (= obj *null-task-control*) +(defmethod exists? task-control ((this task-control) (arg0 game-task) (arg1 task-status)) + (when (= this *null-task-control*) (format 0 "ERROR: exists? received self of *null-task-control*~%~%") (return #f) ) - (dotimes (v1-3 (-> obj stage length)) - (if (and (= arg0 (-> obj stage v1-3 game-task)) (= arg1 (-> obj stage v1-3 status))) + (dotimes (v1-3 (-> this stage length)) + (if (and (= arg0 (-> this stage v1-3 game-task)) (= arg1 (-> this stage v1-3 status))) (return #t) ) ) @@ -257,23 +257,23 @@ ) ;; definition for method 16 of type task-control -(defmethod get-reminder task-control ((obj task-control) (arg0 int)) - (when (= obj *null-task-control*) +(defmethod get-reminder task-control ((this task-control) (arg0 int)) + (when (= this *null-task-control*) (format 0 "ERROR: get-reminder received self of *null-task-control*~%~%") (return 0) ) - (let ((v1-4 (get-entity-task-perm *game-info* (-> obj stage 0 game-task)))) + (let ((v1-4 (get-entity-task-perm *game-info* (-> this stage 0 game-task)))) (the-as int (-> v1-4 user-uint8 (+ arg0 1))) ) ) ;; definition for method 17 of type task-control -(defmethod save-reminder task-control ((obj task-control) (arg0 int) (arg1 int)) - (when (= obj *null-task-control*) +(defmethod save-reminder task-control ((this task-control) (arg0 int) (arg1 int)) + (when (= this *null-task-control*) (format 0 "ERROR: save-reminder received self of *null-task-control*~%~%") (return 0) ) - (let ((v1-4 (get-entity-task-perm *game-info* (-> obj stage 0 game-task)))) + (let ((v1-4 (get-entity-task-perm *game-info* (-> this stage 0 game-task)))) (logior! (-> v1-4 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-4 user-int8 (+ arg1 1)) arg0) ) diff --git a/test/decompiler/reference/jak1/engine/geometry/bounding-box-h_REF.gc b/test/decompiler/reference/jak1/engine/geometry/bounding-box-h_REF.gc index d0a146ec54..529c939224 100644 --- a/test/decompiler/reference/jak1/engine/geometry/bounding-box-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/bounding-box-h_REF.gc @@ -21,11 +21,11 @@ ) ;; definition for method 3 of type bounding-box -(defmethod inspect bounding-box ((obj bounding-box)) - (format #t "[~8x] ~A~%" obj 'bounding-box) - (format #t "~Tmin: ~`vector`P~%" (-> obj min)) - (format #t "~Tmax: ~`vector`P~%" (-> obj max)) - obj +(defmethod inspect bounding-box ((this bounding-box)) + (format #t "[~8x] ~A~%" this 'bounding-box) + (format #t "~Tmin: ~`vector`P~%" (-> this min)) + (format #t "~Tmax: ~`vector`P~%" (-> this max)) + this ) ;; definition of type bounding-box4w @@ -39,11 +39,11 @@ ) ;; definition for method 3 of type bounding-box4w -(defmethod inspect bounding-box4w ((obj bounding-box4w)) - (format #t "[~8x] ~A~%" obj 'bounding-box4w) - (format #t "~Tmin: ~`vector4w`P~%" (-> obj min)) - (format #t "~Tmax: ~`vector4w`P~%" (-> obj max)) - obj +(defmethod inspect bounding-box4w ((this bounding-box4w)) + (format #t "[~8x] ~A~%" this 'bounding-box4w) + (format #t "~Tmin: ~`vector4w`P~%" (-> this min)) + (format #t "~Tmax: ~`vector4w`P~%" (-> this max)) + this ) ;; definition of type bounding-box-both @@ -57,11 +57,11 @@ ) ;; definition for method 3 of type bounding-box-both -(defmethod inspect bounding-box-both ((obj bounding-box-both)) - (format #t "[~8x] ~A~%" obj 'bounding-box-both) - (format #t "~Tbox: #~%" (-> obj box)) - (format #t "~Tbox4w: #~%" (-> obj box4w)) - obj +(defmethod inspect bounding-box-both ((this bounding-box-both)) + (format #t "[~8x] ~A~%" this 'bounding-box-both) + (format #t "~Tbox: #~%" (-> this box)) + (format #t "~Tbox4w: #~%" (-> this box4w)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/geometry/bounding-box_REF.gc b/test/decompiler/reference/jak1/engine/geometry/bounding-box_REF.gc index b3a76cb9df..2775681f50 100644 --- a/test/decompiler/reference/jak1/engine/geometry/bounding-box_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/bounding-box_REF.gc @@ -24,9 +24,8 @@ ) ;; definition for method 11 of type bounding-box -;; WARN: Failed load: (set! vf3 (l.vf a2-0)) at op 0 -;; WARN: Failed load: (set! vf4 (l.vf a1-0)) at op 1 -(defmethod set-from-point-offset! bounding-box ((obj bounding-box) (arg0 vector3s) (arg1 vector3s)) +;; ERROR: Failed load: (set! vf3 (l.vf a2-0)) at op 0 +(defmethod set-from-point-offset! bounding-box ((this bounding-box) (arg0 vector3s) (arg1 vector3s)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -42,53 +41,52 @@ (.max.vf vf2 vf4 vf5) (.mov.vf vf1 vf0 :mask #b1000) (.mov.vf vf2 vf0 :mask #b1000) - (.svf (&-> obj min quad) vf1) - (.svf (&-> obj max quad) vf2) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) 0 ) ) ;; definition for method 10 of type bounding-box -;; WARN: Failed load: (set! vf3 (l.vf a1-0)) at op 2 -(defmethod add-point! bounding-box ((obj bounding-box) (arg0 vector3s)) +;; ERROR: Failed load: (set! vf3 (l.vf a1-0)) at op 2 +(defmethod add-point! bounding-box ((this bounding-box) (arg0 vector3s)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) - (.lvf vf1 (&-> obj min quad)) - (.lvf vf2 (&-> obj max quad)) + (.lvf vf1 (&-> this min quad)) + (.lvf vf2 (&-> this max quad)) (.lvf vf3 arg0) (.min.vf vf1 vf1 vf3) (.max.vf vf2 vf2 vf3) - (.svf (&-> obj min quad) vf1) - (.svf (&-> obj max quad) vf2) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) 0 ) ) ;; definition for method 15 of type bounding-box -(defmethod add-box! bounding-box ((obj bounding-box) (arg0 bounding-box)) +(defmethod add-box! bounding-box ((this bounding-box) (arg0 bounding-box)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) ) - (.lvf vf1 (&-> obj min quad)) - (.lvf vf2 (&-> obj max quad)) + (.lvf vf1 (&-> this min quad)) + (.lvf vf2 (&-> this max quad)) (.lvf vf3 (&-> arg0 min quad)) (.lvf vf4 (&-> arg0 max quad)) (.min.vf vf1 vf1 vf3) (.max.vf vf2 vf2 vf4) - (.svf (&-> obj min quad) vf1) - (.svf (&-> obj max quad) vf2) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) 0 ) ) ;; definition for method 12 of type bounding-box -;; WARN: Failed load: (set! vf4 (l.vf a2-0)) at op 0 -;; WARN: Failed load: (set! vf5 (l.vf a1-0)) at op 1 -(defmethod set-from-point-offset-pad! bounding-box ((obj bounding-box) (arg0 vector3s) (arg1 vector3s) (arg2 float)) +;; ERROR: Failed load: (set! vf4 (l.vf a2-0)) at op 0 +(defmethod set-from-point-offset-pad! bounding-box ((this bounding-box) (arg0 vector3s) (arg1 vector3s) (arg2 float)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -108,14 +106,14 @@ (.sub.x.vf vf2 vf2 vf1 :mask #b111) (.mov.vf vf2 vf0 :mask #b1000) (.mov.vf vf3 vf0 :mask #b1000) - (.svf (&-> obj min quad) vf2) - (.svf (&-> obj max quad) vf3) + (.svf (&-> this min quad) vf2) + (.svf (&-> this max quad) vf3) 0 ) ) ;; definition for method 13 of type bounding-box -(defmethod set-from-sphere! bounding-box ((obj bounding-box) (arg0 sphere)) +(defmethod set-from-sphere! bounding-box ((this bounding-box) (arg0 sphere)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -127,8 +125,8 @@ (.add.w.vf vf3 vf1 vf1 :mask #b111) (.mov.vf vf2 vf0 :mask #b1000) (.mov.vf vf3 vf0 :mask #b1000) - (.svf (&-> obj min quad) vf2) - (.svf (&-> obj max quad) vf3) + (.svf (&-> this min quad) vf2) + (.svf (&-> this max quad) vf3) 0 ) ) diff --git a/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc b/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc index a5b9942dbf..4e65f7d95e 100644 --- a/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/cylinder_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 10 of type cylinder -(defmethod ray-capsule-intersect cylinder ((obj cylinder) (probe-origin vector) (probe-dir vector)) +(defmethod ray-capsule-intersect cylinder ((this cylinder) (probe-origin vector) (probe-dir vector)) (let ((t2-0 (new 'stack-no-clear 'vector)) (end-pt (new 'stack-no-clear 'vector)) ) @@ -11,21 +11,21 @@ (let ((result (ray-cylinder-intersect probe-origin probe-dir - (-> obj origin) - (-> obj axis) - (-> obj radius) - (-> obj length) + (-> this origin) + (-> this axis) + (-> this radius) + (-> this length) t2-0 ) ) ) - (let ((u-origin-sph (ray-sphere-intersect probe-origin probe-dir (-> obj origin) (-> obj radius)))) + (let ((u-origin-sph (ray-sphere-intersect probe-origin probe-dir (-> this origin) (-> this radius)))) (if (and (>= u-origin-sph 0.0) (or (< result 0.0) (< u-origin-sph result))) (set! result u-origin-sph) ) ) - (vector+float*! end-pt (-> obj origin) (-> obj axis) (-> obj length)) - (let ((u-end-sphere (ray-sphere-intersect probe-origin probe-dir end-pt (-> obj radius)))) + (vector+float*! end-pt (-> this origin) (-> this axis) (-> this length)) + (let ((u-end-sphere (ray-sphere-intersect probe-origin probe-dir end-pt (-> this radius)))) (if (and (>= u-end-sphere 0.0) (or (< result 0.0) (< u-end-sphere result))) (set! result u-end-sphere) ) @@ -45,16 +45,16 @@ ) ;; definition for method 3 of type cylinder-verts -(defmethod inspect cylinder-verts ((obj cylinder-verts)) - (format #t "[~8x] ~A~%" obj 'cylinder-verts) - (format #t "~Tvert[24] @ #x~X~%" (-> obj vert)) - obj +(defmethod inspect cylinder-verts ((this cylinder-verts)) + (format #t "[~8x] ~A~%" this 'cylinder-verts) + (format #t "~Tvert[24] @ #x~X~%" (-> this vert)) + this ) ;; definition for method 9 of type cylinder ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw cylinder ((obj cylinder) (arg0 vector4w)) +(defmethod debug-draw cylinder ((this cylinder) (arg0 vector4w)) (local-vars (sv-896 matrix) (sv-912 int) @@ -84,21 +84,21 @@ (let ((s1-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'vector)) ) - (if (< 0.999 (fabs (-> obj axis y))) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :z 1.0)) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :y 1.0)) + (if (< 0.999 (fabs (-> this axis y))) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) - (vector-normalize! s1-0 (-> obj radius)) - (vector-float*! s0-0 (-> obj axis) (* 0.125 (-> obj length))) + (vector-normalize! s1-0 (-> this radius)) + (vector-float*! s0-0 (-> this axis) (* 0.125 (-> this length))) (let ((s5-0 (new 'stack-no-clear 'cylinder-verts)) (s4-0 (new 'stack-no-clear 'cylinder-verts)) (s3-0 (new 'stack-no-clear 'matrix)) ) - (matrix-axis-angle! s3-0 (-> obj axis) 4096.0) + (matrix-axis-angle! s3-0 (-> this axis) 4096.0) (set! sv-896 (new 'stack-no-clear 'matrix)) - (vector-matrix*! (the-as vector sv-896) (-> obj origin) s3-0) + (vector-matrix*! (the-as vector sv-896) (-> this origin) s3-0) (let ((v1-5 (-> s3-0 vector 3))) - (.lvf vf4 (&-> (-> obj origin) quad)) + (.lvf vf4 (&-> (-> this origin) quad)) (.lvf vf5 (&-> sv-896 vector 0 quad)) (.mov.vf vf6 vf0 :mask #b1000) (.sub.vf vf6 vf4 vf5 :mask #b111) @@ -106,14 +106,14 @@ ) (set! sv-912 0) (while (< sv-912 8) - (vector+! (-> s5-0 vert (+ sv-912 8)) (-> obj origin) s1-0) + (vector+! (-> s5-0 vert (+ sv-912 8)) (-> this origin) s1-0) (vector+float*! (-> s5-0 vert (+ sv-912 8)) (-> s5-0 vert (+ sv-912 8)) s0-0 (the float sv-912)) (set! sv-912 (+ sv-912 1)) ) (dotimes (s0-1 8) (set! sv-928 vector+float*!) (set! sv-944 (-> s5-0 vert s0-1)) - (set! sv-960 (-> obj origin)) + (set! sv-960 (-> this origin)) (set! sv-976 s1-0) (let ((a3-1 (cos (* 2048.0 (the float (- 7 s0-1)))))) (sv-928 sv-944 sv-960 sv-976 a3-1) @@ -121,13 +121,13 @@ (set! sv-992 vector+float*!) (set! sv-1008 (-> s5-0 vert s0-1)) (set! sv-1024 (-> s5-0 vert s0-1)) - (set! sv-1040 (-> obj axis)) - (let ((a3-2 (* (- (-> obj radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))) + (set! sv-1040 (-> this axis)) + (let ((a3-2 (* (- (-> this radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))) (sv-992 sv-1008 sv-1024 sv-1040 a3-2) ) (set! sv-1056 vector+float*!) (set! sv-1072 (-> s5-0 vert (+ s0-1 16))) - (set! sv-1088 (-> obj origin)) + (set! sv-1088 (-> this origin)) (set! sv-1104 s1-0) (let ((a3-3 (cos (* 2048.0 (the float s0-1))))) (sv-1056 sv-1072 sv-1088 sv-1104 a3-3) @@ -135,8 +135,8 @@ (set! sv-1120 vector+float*!) (set! sv-1136 (-> s5-0 vert (+ s0-1 16))) (set! sv-1152 (-> s5-0 vert (+ s0-1 16))) - (set! sv-1168 (-> obj axis)) - (let ((a3-4 (+ (-> obj length) (* (-> obj radius) (sin (* 2048.0 (the float s0-1))))))) + (set! sv-1168 (-> this axis)) + (let ((a3-4 (+ (-> this length) (* (-> this radius) (sin (* 2048.0 (the float s0-1))))))) (sv-1120 sv-1136 sv-1152 sv-1168 a3-4) ) ) @@ -185,7 +185,7 @@ ;; definition for method 10 of type cylinder-flat ;; INFO: Used lq/sq -(defmethod ray-flat-cyl-intersect cylinder-flat ((obj cylinder-flat) (probe-origin vector) (probe-dir vector)) +(defmethod ray-flat-cyl-intersect cylinder-flat ((this cylinder-flat) (probe-origin vector) (probe-dir vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (end-pt (new 'stack-no-clear 'vector)) ) @@ -194,25 +194,26 @@ (let ((result (ray-cylinder-intersect probe-origin probe-dir - (-> obj origin) - (-> obj axis) - (-> obj radius) - (-> obj length) + (-> this origin) + (-> this axis) + (-> this radius) + (-> this length) gp-0 ) ) ) (let ((u-origin-circle - (ray-arbitrary-circle-intersect probe-origin probe-dir (-> obj origin) (-> obj axis) (-> obj radius)) + (ray-arbitrary-circle-intersect probe-origin probe-dir (-> this origin) (-> this axis) (-> this radius)) ) ) (when (and (>= u-origin-circle 0.0) (or (< result 0.0) (< u-origin-circle result))) (set! result u-origin-circle) - (set! (-> gp-0 quad) (-> obj origin quad)) + (set! (-> gp-0 quad) (-> this origin quad)) ) ) - (vector+float*! end-pt (-> obj origin) (-> obj axis) (-> obj length)) - (let ((u-end-circle (ray-arbitrary-circle-intersect probe-origin probe-dir end-pt (-> obj axis) (-> obj radius)))) + (vector+float*! end-pt (-> this origin) (-> this axis) (-> this length)) + (let ((u-end-circle (ray-arbitrary-circle-intersect probe-origin probe-dir end-pt (-> this axis) (-> this radius))) + ) (when (and (>= u-end-circle 0.0) (or (< result 0.0) (< u-end-circle result))) (set! result u-end-circle) (set! (-> gp-0 quad) (-> end-pt quad)) @@ -233,16 +234,16 @@ ) ;; definition for method 3 of type cylinder-flat-verts -(defmethod inspect cylinder-flat-verts ((obj cylinder-flat-verts)) - (format #t "[~8x] ~A~%" obj 'cylinder-flat-verts) - (format #t "~Tvert[10] @ #x~X~%" (-> obj vert)) - obj +(defmethod inspect cylinder-flat-verts ((this cylinder-flat-verts)) + (format #t "[~8x] ~A~%" this 'cylinder-flat-verts) + (format #t "~Tvert[10] @ #x~X~%" (-> this vert)) + this ) ;; definition for method 9 of type cylinder-flat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw cylinder-flat ((obj cylinder-flat) (arg0 vector4w)) +(defmethod debug-draw cylinder-flat ((this cylinder-flat) (arg0 vector4w)) (local-vars (sv-448 vector) (sv-464 int)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -253,21 +254,21 @@ (let ((s1-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'vector)) ) - (if (< 0.999 (fabs (-> obj axis y))) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :z 1.0)) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :y 1.0)) + (if (< 0.999 (fabs (-> this axis y))) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) - (vector-normalize! s1-0 (-> obj radius)) - (vector-float*! s0-0 (-> obj axis) (* 0.14285715 (-> obj length))) + (vector-normalize! s1-0 (-> this radius)) + (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s3-0 (new 'stack-no-clear 'matrix)) ) - (matrix-axis-angle! s3-0 (-> obj axis) 4096.0) + (matrix-axis-angle! s3-0 (-> this axis) 4096.0) (set! sv-448 (new 'stack-no-clear 'vector)) - (vector-matrix*! sv-448 (-> obj origin) s3-0) + (vector-matrix*! sv-448 (-> this origin) s3-0) (let ((v1-5 (-> s3-0 vector 3))) - (.lvf vf4 (&-> (-> obj origin) quad)) + (.lvf vf4 (&-> (-> this origin) quad)) (.lvf vf5 (&-> sv-448 quad)) (.mov.vf vf6 vf0 :mask #b1000) (.sub.vf vf6 vf4 vf5 :mask #b111) @@ -275,12 +276,12 @@ ) (set! sv-464 0) (while (< sv-464 8) - (vector+! (-> s5-0 vert (+ sv-464 1)) (-> obj origin) s1-0) + (vector+! (-> s5-0 vert (+ sv-464 1)) (-> this origin) s1-0) (vector+float*! (-> s5-0 vert (+ sv-464 1)) (-> s5-0 vert (+ sv-464 1)) s0-0 (the float sv-464)) (set! sv-464 (+ sv-464 1)) ) - (set! (-> s5-0 vert 0 quad) (-> obj origin quad)) - (vector+float*! (-> s5-0 vert 9) (-> obj origin) (-> obj axis) (-> obj length)) + (set! (-> s5-0 vert 0 quad) (-> this origin quad)) + (vector+float*! (-> s5-0 vert 9) (-> this origin) (-> this axis) (-> this length)) (dotimes (s2-1 16) (dotimes (s1-1 10) (vector-matrix*! (-> s4-0 vert s1-1) (-> s5-0 vert s1-1) s3-0) diff --git a/test/decompiler/reference/jak1/engine/geometry/geometry-h_REF.gc b/test/decompiler/reference/jak1/engine/geometry/geometry-h_REF.gc index 12a583302c..6694687ed6 100644 --- a/test/decompiler/reference/jak1/engine/geometry/geometry-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/geometry-h_REF.gc @@ -15,14 +15,14 @@ ) ;; definition for method 3 of type curve -(defmethod inspect curve ((obj curve)) - (format #t "[~8x] ~A~%" obj 'curve) - (format #t "~Tcverts: #x~X~%" (-> obj cverts)) - (format #t "~Tnum-cverts: ~D~%" (-> obj num-cverts)) - (format #t "~Tknots: #x~X~%" (-> obj knots)) - (format #t "~Tnum-knots: ~D~%" (-> obj num-knots)) - (format #t "~Tlength: ~f~%" (-> obj length)) - obj +(defmethod inspect curve ((this curve)) + (format #t "[~8x] ~A~%" this 'curve) + (format #t "~Tcverts: #x~X~%" (-> this cverts)) + (format #t "~Tnum-cverts: ~D~%" (-> this num-cverts)) + (format #t "~Tknots: #x~X~%" (-> this knots)) + (format #t "~Tnum-knots: ~D~%" (-> this num-knots)) + (format #t "~Tlength: ~f~%" (-> this length)) + this ) ;; definition of type border-plane @@ -43,14 +43,14 @@ ) ;; definition for method 3 of type border-plane -(defmethod inspect border-plane ((obj border-plane)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Taction: ~A~%" (-> obj action)) - (format #t "~Tslot: ~D~%" (-> obj slot)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Tnormal: ~`vector`P~%" (-> obj normal)) - obj +(defmethod inspect border-plane ((this border-plane)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Taction: ~A~%" (-> this action)) + (format #t "~Tslot: ~D~%" (-> this slot)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Tnormal: ~`vector`P~%" (-> this normal)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/geometry/path-h_REF.gc b/test/decompiler/reference/jak1/engine/geometry/path-h_REF.gc new file mode 100644 index 0000000000..1e3e94b69f --- /dev/null +++ b/test/decompiler/reference/jak1/engine/geometry/path-h_REF.gc @@ -0,0 +1,169 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type path-control +(deftype path-control (basic) + ((flags path-control-flag :offset-assert 4) + (name symbol :offset-assert 8) + (process process-drawable :offset-assert 12) + (curve curve :inline :offset-assert 16) + (num-cverts int32 :offset 20) + (cverts (inline-array vector) :offset 16) + ) + :method-count-assert 21 + :size-assert #x24 + :flag-assert #x1500000024 + (:methods + (new (symbol type process symbol float) _type_ 0) + (debug-draw (_type_) none 9) + (eval-path-curve-div! (_type_ vector float symbol) vector 10) + (get-random-point (_type_ vector) vector 11) + (path-control-method-12 (_type_ vector float) vector 12) + (eval-path-curve! (_type_ vector float symbol) vector 13) + (path-control-method-14 (_type_ vector float) vector 14) + (length-as-float (_type_) float 15) + (path-distance (_type_) float 16) + (get-num-verts (_type_) int 17) + (should-display? (_type_) symbol 18) + (path-control-method-19 (_type_) float 19) + (path-control-method-20 (_type_) float 20) + ) + ) + +;; definition for method 3 of type path-control +(defmethod inspect path-control ((this path-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tflags: #x~X~%" (-> this flags)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tcurve: #~%" (&-> this cverts)) + (format #t "~Tnum-cverts: ~D~%" (-> this curve num-cverts)) + (format #t "~Tcverts: #x~X~%" (-> this cverts)) + this + ) + +;; definition of type curve-control +(deftype curve-control (path-control) + () + :method-count-assert 21 + :size-assert #x24 + :flag-assert #x1500000024 + (:methods + (new (symbol type process symbol float) _type_ 0) + ) + ) + +;; definition for method 3 of type curve-control +(defmethod inspect curve-control ((this curve-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tflags: #x~X~%" (-> this flags)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tcurve: #~%" (&-> this cverts)) + (format #t "~Tnum-cverts: ~D~%" (-> this curve num-cverts)) + (format #t "~Tcverts: #x~X~%" (-> this cverts)) + this + ) + +;; definition for method 0 of type path-control +;; INFO: Used lq/sq +;; INFO: Return type mismatch object vs path-control. +(defmethod new path-control ((allocation symbol) (type-to-make type) (proc process) (name symbol) (time float)) + (local-vars (tag res-tag)) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? this) + (go process-drawable-art-error "memory") + (set! this (the-as path-control 0)) + (goto cfg-9) + ) + (set! (-> this process) (the-as process-drawable proc)) + (set! (-> this name) name) + (let ((ent (-> proc entity))) + (when (= name 'path) + (let ((lookup-entity (entity-actor-lookup ent 'path-actor 0))) + (if lookup-entity + (set! ent lookup-entity) + ) + ) + ) + (set! tag (new 'static 'res-tag)) + (let ((data (res-lump-data ent name pointer :tag-ptr (& tag) :time time))) + (cond + (data + (set! (-> this cverts) (the-as (inline-array vector) data)) + (set! (-> this curve num-cverts) (the-as int (-> tag elt-count))) + ) + (else + (logior! (-> this flags) (path-control-flag not-found)) + (set! (-> this cverts) (the-as (inline-array vector) #f)) + (set! (-> this curve num-cverts) 0) + 0 + ) + ) + ) + ) + (label cfg-9) + (the-as path-control this) + ) + ) + +;; definition for method 18 of type path-control +(defmethod should-display? path-control ((this path-control)) + (and *display-path-marks* (logtest? (-> this flags) (path-control-flag display))) + ) + +;; definition for method 15 of type path-control +(defmethod length-as-float path-control ((this path-control)) + (the float (+ (-> this curve num-cverts) -1)) + ) + +;; definition for method 17 of type path-control +(defmethod get-num-verts path-control ((this path-control)) + (-> this curve num-cverts) + ) + +;; definition for method 0 of type curve-control +(defmethod new curve-control ((allocation symbol) (type-to-make type) (proc process) (name symbol) (time float)) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this process) (the-as process-drawable proc)) + (set! (-> this name) name) + (let* ((ent (-> proc entity)) + (v1-2 name) + (s2-0 (cond + ((= v1-2 'path) + 'path-k + ) + (else + (let ((s2-1 string->symbol)) + (format (clear *temp-string*) "~A-k" name) + (s2-1 *temp-string*) + ) + ) + ) + ) + ) + (let ((lookup-entity (entity-actor-lookup ent 'path-actor 0))) + (if lookup-entity + (set! ent lookup-entity) + ) + ) + (when (not (get-curve-data! ent (the-as curve (&-> this cverts)) name s2-0 time)) + (cond + ((> (-> this curve num-cverts) 0) + (set! (-> this type) path-control) + ) + (else + (logior! (-> this flags) (path-control-flag not-found)) + (set! (-> this cverts) (the-as (inline-array vector) #f)) + (set! (-> this curve num-cverts) 0) + 0 + ) + ) + ) + ) + this + ) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak1/engine/geometry/path_REF.gc b/test/decompiler/reference/jak1/engine/geometry/path_REF.gc new file mode 100644 index 0000000000..d7685ea302 --- /dev/null +++ b/test/decompiler/reference/jak1/engine/geometry/path_REF.gc @@ -0,0 +1,337 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type path-control +;; INFO: Return type mismatch int vs none. +(defmethod debug-draw path-control ((this path-control)) + (cond + ((logtest? (-> this flags) (path-control-flag not-found)) + (when (and (type-type? (-> this process type) process-drawable) *display-entity-errors*) + (let ((s5-0 add-debug-text-3d) + (s4-0 #t) + (s3-0 68) + ) + (format (clear *temp-string*) "path data error in ~S" (-> this process name)) + (s5-0 + s4-0 + (the-as bucket-id s3-0) + *temp-string* + (-> this process root trans) + (font-color red) + (the-as vector2h #f) + ) + ) + ) + ) + ((let ((a0-5 this)) + (and *display-path-marks* (logtest? (-> a0-5 flags) (path-control-flag display))) + ) + (dotimes (s5-1 (-> this curve num-cverts)) + (let ((s4-1 (-> this cverts s5-1))) + (if (and (logtest? (-> this flags) (path-control-flag draw-line)) (< s5-1 (+ (-> this curve num-cverts) -1))) + (add-debug-line + #t + (bucket-id debug-no-zbuf) + s4-1 + (-> this cverts (+ s5-1 1)) + (new 'static 'rgba :r #xff :g #x80 :a #x80) + #f + (the-as rgba -1) + ) + ) + (if (logtest? (-> this flags) (path-control-flag draw-point)) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) + ) + (when (logtest? (-> this flags) (path-control-flag draw-text)) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-0 68) + ) + (format (clear *temp-string*) "~D" s5-1) + (s3-1 s2-1 (the-as bucket-id s1-0) *temp-string* s4-1 (font-color orange) (the-as vector2h #f)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 16 of type path-control +(defmethod path-distance path-control ((this path-control)) + (let ((f30-0 0.0)) + (dotimes (s5-0 (+ (-> this curve num-cverts) -1)) + (+! f30-0 (vector-vector-distance (-> this cverts s5-0) (-> this cverts (+ s5-0 1)))) + ) + f30-0 + ) + ) + +;; definition for method 16 of type curve-control +(defmethod path-distance curve-control ((this curve-control)) + (let ((f0-0 (-> this curve length))) + (when (= f0-0 0.0) + (set! f0-0 (curve-length (the-as curve (&-> this cverts)))) + (set! (-> this curve length) f0-0) + ) + f0-0 + ) + ) + +;; definition for method 10 of type path-control +;; INFO: Used lq/sq +(defmethod eval-path-curve-div! path-control ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (let ((a1-1 (-> this curve num-cverts)) + (f0-3 (the float (the int arg1))) + ) + (cond + ((< arg1 0.0) + (set! (-> arg0 quad) (-> this cverts 0 quad)) + ) + ((>= f0-3 (the float (+ a1-1 -1))) + (set! (-> arg0 quad) (-> this cverts (+ a1-1 -1) quad)) + ) + ((or (= arg2 'exact) (= f0-3 arg1)) + (set! (-> arg0 quad) (-> this cverts (the int f0-3) quad)) + ) + (else + (vector-lerp! arg0 (-> this cverts (the int f0-3)) (-> this cverts (the int (+ 1.0 f0-3))) (- arg1 f0-3)) + ) + ) + ) + arg0 + ) + +;; definition for method 11 of type path-control +;; INFO: Used lq/sq +(defmethod get-random-point path-control ((this path-control) (arg0 vector)) + (with-pp + (cond + ((> (-> this curve num-cverts) 0) + (let ((s4-0 (rand-vu-int-count (-> this curve num-cverts)))) + (when *run-time-assert-enable* + (set-pos *__private-assert-info* "path" (the-as uint 83) (the-as uint 6)) + (__assert-zero-lim-range-int s4-0 (-> this curve num-cverts) "rand-index" "(-> obj num-cverts)") + ) + (set! (-> arg0 quad) (-> this cverts s4-0 quad)) + ) + ) + (else + (format #t "WARNING: method get-random-point called on a path-control object with no vertices.~%") + (if pp + (format #t "current process is ~A~%" (-> pp name)) + ) + (set! (-> arg0 quad) (-> *null-vector* quad)) + ) + ) + arg0 + ) + ) + +;; definition for method 13 of type path-control +(defmethod eval-path-curve! path-control ((this path-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (eval-path-curve-div! this arg0 (* arg1 (the float (+ (-> this curve num-cverts) -1))) arg2) + ) + +;; definition for method 13 of type curve-control +;; INFO: Return type mismatch object vs vector. +(defmethod eval-path-curve! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (the-as vector (if (logtest? (-> this flags) (path-control-flag not-found)) + 0.0 + (curve-evaluate! + arg0 + arg1 + (-> this cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) + ) + ) + ) + ) + +;; definition for method 10 of type curve-control +;; INFO: Return type mismatch object vs vector. +(defmethod eval-path-curve-div! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) + (the-as vector (if (logtest? (-> this flags) (path-control-flag not-found)) + 0.0 + (curve-evaluate! + arg0 + (/ arg1 (the float (+ (-> this curve num-cverts) -1))) + (-> this cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) + ) + ) + ) + ) + +;; definition for method 12 of type path-control +(defmethod path-control-method-12 path-control ((this path-control) (arg0 vector) (arg1 float)) + (when (not (logtest? (-> this flags) (path-control-flag not-found))) + (let ((v1-3 (-> this curve num-cverts)) + (f0-3 (the float (the int arg1))) + ) + (cond + ((< v1-3 2) + ) + ((< arg1 0.0) + (vector-! arg0 (-> this cverts 1) (-> this cverts 0)) + ) + (else + (let ((f0-4 (fmin f0-3 (the float (+ v1-3 -2))))) + (vector-! arg0 (-> this cverts (the int (+ 1.0 f0-4))) (-> this cverts (the int f0-4))) + ) + ) + ) + ) + ) + (vector-normalize! arg0 1.0) + ) + +;; definition for method 14 of type path-control +(defmethod path-control-method-14 path-control ((this path-control) (arg0 vector) (arg1 float)) + (path-control-method-12 this arg0 (* arg1 (the float (+ (-> this curve num-cverts) -1)))) + ) + +;; definition for method 14 of type curve-control +(defmethod path-control-method-14 curve-control ((this curve-control) (arg0 vector) (arg1 float)) + (when (not (logtest? (-> this flags) (path-control-flag not-found))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (curve-evaluate! + arg0 + arg1 + (-> this cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) + ) + (cond + ((< arg1 0.99) + (curve-evaluate! + s4-0 + (+ 0.01 arg1) + (-> this cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) + ) + (vector-! arg0 s4-0 arg0) + ) + (else + (curve-evaluate! + s4-0 + (+ -0.01 arg1) + (-> this cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) + ) + (vector-! arg0 arg0 s4-0) + ) + ) + ) + ) + (vector-normalize! arg0 1.0) + ) + +;; definition for method 12 of type curve-control +(defmethod path-control-method-12 curve-control ((this curve-control) (arg0 vector) (arg1 float)) + (path-control-method-14 this arg0 (/ arg1 (the float (+ (-> this curve num-cverts) -1)))) + ) + +;; definition for method 19 of type path-control +;; INFO: Used lq/sq +(defmethod path-control-method-19 path-control ((this path-control)) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (f30-0 4096000000.0) + (f28-0 0.0) + ) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> (target-pos 0) quad)) + (set! (-> s3-0 y) 0.0) + (eval-path-curve-div! this s4-0 0.0 'interp) + (set! (-> s4-0 y) 0.0) + (dotimes (s1-1 (+ (-> this curve num-cverts) -1)) + (set! (-> s5-0 quad) (-> s4-0 quad)) + (eval-path-curve-div! this s4-0 (the float (+ s1-1 1)) 'interp) + (set! (-> s4-0 y) 0.0) + (let ((f0-5 (vector-segment-distance-point! s3-0 s5-0 s4-0 s2-0))) + (when (< f0-5 f30-0) + (set! f30-0 f0-5) + (set! f28-0 + (+ (/ (vector-vector-xz-distance s2-0 s5-0) (vector-vector-xz-distance s4-0 s5-0)) (the float s1-1)) + ) + ) + ) + ) + ) + f28-0 + ) + ) + +;; definition for method 20 of type path-control +(defmethod path-control-method-20 path-control ((this path-control)) + (/ (path-control-method-19 this) (the float (+ (-> this curve num-cverts) -1))) + ) + +;; definition for method 9 of type curve-control +;; INFO: Return type mismatch int vs none. +(defmethod debug-draw curve-control ((this curve-control)) + (cond + ((logtest? (-> this flags) (path-control-flag not-found)) + (when (and (type-type? (-> this process type) process-drawable) *display-entity-errors*) + (let ((s5-0 add-debug-text-3d) + (s4-0 #t) + (s3-0 68) + ) + (format (clear *temp-string*) "curve data error in ~S" (-> this process name)) + (s5-0 + s4-0 + (the-as bucket-id s3-0) + *temp-string* + (-> this process root trans) + (font-color red) + (the-as vector2h #f) + ) + ) + ) + ) + ((let ((a0-5 this)) + (and *display-path-marks* (logtest? (-> a0-5 flags) (path-control-flag display))) + ) + (if (and (logtest? (-> this flags) (path-control-flag draw-line)) (> (-> this curve num-cverts) 0)) + (add-debug-curve2 + #t + (bucket-id debug-no-zbuf) + (the-as curve (&-> this cverts)) + (new 'static 'rgba :r #xff :g #x80 :a #x80) + #f + ) + ) + (dotimes (s5-1 (-> this curve num-cverts)) + (let ((s4-1 (-> this cverts s5-1))) + (if (logtest? (-> this flags) (path-control-flag draw-point)) + (add-debug-x #t (bucket-id debug-no-zbuf) s4-1 (new 'static 'rgba :r #xff :a #x80)) + ) + (when (logtest? (-> this flags) (path-control-flag draw-text)) + (let ((s3-1 add-debug-text-3d) + (s2-1 #t) + (s1-0 68) + ) + (format (clear *temp-string*) "~D" s5-1) + (s3-1 s2-1 (the-as bucket-id s1-0) *temp-string* s4-1 (font-color orange) (the-as vector2h #f)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak1/engine/geometry/vol-h_REF.gc b/test/decompiler/reference/jak1/engine/geometry/vol-h_REF.gc index 63c059d487..7e7ff6321d 100644 --- a/test/decompiler/reference/jak1/engine/geometry/vol-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/vol-h_REF.gc @@ -23,16 +23,16 @@ ) ;; definition for method 3 of type plane-volume -(defmethod inspect plane-volume ((obj plane-volume)) - (format #t "[~8x] ~A~%" obj 'plane-volume) - (format #t "~Tvolume-type: ~A~%" (-> obj volume-type)) - (format #t "~Tpoint-count: ~D~%" (-> obj point-count)) - (format #t "~Tnormal-count: ~D~%" (-> obj normal-count)) - (format #t "~Tfirst-point: #~%" (-> obj first-point)) - (format #t "~Tfirst-normal: #~%" (-> obj first-normal)) - (format #t "~Tnum-planes: ~D~%" (-> obj num-planes)) - (format #t "~Tplane: #x~X~%" (-> obj plane)) - obj +(defmethod inspect plane-volume ((this plane-volume)) + (format #t "[~8x] ~A~%" this 'plane-volume) + (format #t "~Tvolume-type: ~A~%" (-> this volume-type)) + (format #t "~Tpoint-count: ~D~%" (-> this point-count)) + (format #t "~Tnormal-count: ~D~%" (-> this normal-count)) + (format #t "~Tfirst-point: #~%" (-> this first-point)) + (format #t "~Tfirst-normal: #~%" (-> this first-normal)) + (format #t "~Tnum-planes: ~D~%" (-> this num-planes)) + (format #t "~Tplane: #x~X~%" (-> this plane)) + this ) ;; definition of type vol-control @@ -58,17 +58,17 @@ ) ;; definition for method 3 of type vol-control -(defmethod inspect vol-control ((obj vol-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tflags: #x~X~%" (-> obj flags)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tpos-vol-count: ~D~%" (-> obj pos-vol-count)) - (format #t "~Tpos-vol[32] @ #x~X~%" (-> obj pos-vol)) - (format #t "~Tneg-vol-count: ~D~%" (-> obj neg-vol-count)) - (format #t "~Tneg-vol[32] @ #x~X~%" (-> obj neg-vol)) - (format #t "~Tdebug-point: ~A~%" (-> obj debug-point)) - (format #t "~Tdebug-normal: ~A~%" (-> obj debug-normal)) - obj +(defmethod inspect vol-control ((this vol-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tflags: #x~X~%" (-> this flags)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tpos-vol-count: ~D~%" (-> this pos-vol-count)) + (format #t "~Tpos-vol[32] @ #x~X~%" (-> this pos-vol)) + (format #t "~Tneg-vol-count: ~D~%" (-> this neg-vol-count)) + (format #t "~Tneg-vol[32] @ #x~X~%" (-> this neg-vol)) + (format #t "~Tdebug-point: ~A~%" (-> this debug-point)) + (format #t "~Tdebug-normal: ~A~%" (-> this debug-normal)) + this ) ;; definition for method 0 of type vol-control @@ -132,6 +132,6 @@ ) ;; definition for method 11 of type vol-control -(defmethod vol-control-method-11 vol-control ((obj vol-control)) - (and *display-vol-marks* (logtest? (-> obj flags) 1)) +(defmethod vol-control-method-11 vol-control ((this vol-control)) + (and *display-vol-marks* (logtest? (-> this flags) 1)) ) diff --git a/test/decompiler/reference/jak1/engine/geometry/vol_REF.gc b/test/decompiler/reference/jak1/engine/geometry/vol_REF.gc index afb41015d4..950738b1b7 100644 --- a/test/decompiler/reference/jak1/engine/geometry/vol_REF.gc +++ b/test/decompiler/reference/jak1/engine/geometry/vol_REF.gc @@ -26,7 +26,7 @@ ;; WARN: Stack slot offset 148 signed mismatch ;; WARN: Stack slot offset 148 signed mismatch ;; WARN: Stack slot offset 148 signed mismatch -(defmethod init-vol! plane-volume ((obj plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) +(defmethod init-vol! plane-volume ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) (local-vars (sv-144 vector) (sv-148 float) @@ -39,12 +39,12 @@ (sv-240 int) (sv-256 int) ) - (set! (-> obj volume-type) arg0) - (set! (-> obj point-count) 0) - (set! (-> obj first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) - (set! (-> obj normal-count) 0) - (set! (-> obj first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) - (dotimes (s3-0 (-> obj num-planes)) + (set! (-> this volume-type) arg0) + (set! (-> this point-count) 0) + (set! (-> this first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) + (set! (-> this normal-count) 0) + (set! (-> this first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) + (dotimes (s3-0 (-> this num-planes)) (set! sv-176 (new 'stack-no-clear 'vector)) (set! (-> sv-176 quad) (the-as uint128 0)) (set! sv-192 (new 'stack-no-clear 'vector)) @@ -59,10 +59,10 @@ (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (let ((s1-0 (new-stack-vector0)) (s0-0 0) - (s2-0 (-> obj plane)) + (s2-0 (-> this plane)) ) (set! sv-240 0) - (while (< sv-240 (-> obj num-planes)) + (while (< sv-240 (-> this num-planes)) (when (!= s3-0 sv-240) (vector-float*! sv-176 (the-as vector (-> s2-0 sv-240)) (-> s2-0 sv-240 w)) (vector-cross! sv-192 (the-as vector (-> s2-0 sv-240)) (the-as vector (-> s2-0 s3-0))) @@ -78,7 +78,7 @@ (set! sv-160 (new-stack-vector0)) (set! (-> sv-144 quad) (-> sv-224 quad)) (set! sv-256 0) - (while (< sv-256 (-> obj num-planes)) + (while (< sv-256 (-> this num-planes)) (when (and (!= sv-256 s3-0) (!= sv-256 sv-240)) (let ((f30-0 (plane-volume-intersect-dist (-> s2-0 sv-256) sv-144 sv-192))) (cond @@ -118,7 +118,7 @@ ((= sv-148 0.0) ) (else - (dotimes (v1-70 (-> obj num-planes)) + (dotimes (v1-70 (-> this num-planes)) (when (and (!= v1-70 s3-0) (!= v1-70 sv-240)) (if (< 4096.0 (- (vector-dot sv-144 (the-as vector (-> s2-0 v1-70))) (the-as float (-> s2-0 v1-70 w)))) (goto cfg-42) @@ -128,13 +128,13 @@ (vector+float*! sv-224 sv-144 sv-192 sv-148) (cond ((< (-> arg1 allocated-length) (+ (-> arg1 length) 2)) - (format 0 "ERROR : vol-control #x~X out of volume points~%" obj) + (format 0 "ERROR : vol-control #x~X out of volume points~%" this) ) (else (set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad)) (set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad)) (+! (-> arg1 length) 2) - (+! (-> obj point-count) 2) + (+! (-> this point-count) 2) ) ) (vector+! s1-0 s1-0 sv-144) @@ -152,13 +152,13 @@ (vector-float*! s1-0 s1-0 (/ 1.0 (the float s0-0))) (cond ((< (-> arg2 allocated-length) (+ (-> arg2 length) 2)) - (format 0 "ERROR : vol-control #x~X out of volume normals~%" obj) + (format 0 "ERROR : vol-control #x~X out of volume normals~%" this) ) (else (set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad)) (set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad)) (+! (-> arg2 length) 2) - (set! (-> obj normal-count) (+ (-> obj normal-count) 2)) + (set! (-> this normal-count) (+ (-> this normal-count) 2)) ) ) ) @@ -169,8 +169,8 @@ ;; definition for method 10 of type plane-volume ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw plane-volume ((obj plane-volume)) - (let* ((v1-0 (-> obj volume-type)) +(defmethod debug-draw plane-volume ((this plane-volume)) + (let* ((v1-0 (-> this volume-type)) (s5-0 (cond ((= v1-0 'vol) (the-as uint #x8000c000) @@ -183,9 +183,9 @@ ) ) ) - (s4-0 (-> obj first-point)) + (s4-0 (-> this first-point)) ) - (dotimes (s3-0 (/ (-> obj point-count) 2)) + (dotimes (s3-0 (/ (-> this point-count) 2)) (add-debug-line #t (bucket-id debug-no-zbuf) @@ -203,9 +203,9 @@ ) ;; definition for method 11 of type plane-volume -(defmethod point-in-vol? plane-volume ((obj plane-volume) (arg0 vector) (arg1 float)) - (dotimes (v1-0 (-> obj num-planes)) - (if (< arg1 (- (vector-dot arg0 (the-as vector (-> obj plane v1-0))) (the-as float (-> obj plane v1-0 w)))) +(defmethod point-in-vol? plane-volume ((this plane-volume) (arg0 vector) (arg1 float)) + (dotimes (v1-0 (-> this num-planes)) + (if (< arg1 (- (vector-dot arg0 (the-as vector (-> this plane v1-0))) (the-as float (-> this plane v1-0 w)))) (return #f) ) ) @@ -214,39 +214,39 @@ ;; definition for method 9 of type vol-control ;; INFO: Return type mismatch int vs symbol. -(defmethod init! vol-control ((obj vol-control)) +(defmethod init! vol-control ((this vol-control)) (with-pp - (let ((a0-1 obj)) - (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) 1)) (logtest? (-> obj flags) 2)) - (when (zero? (-> obj debug-point)) + (let ((a0-1 this)) + (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) 1)) (logtest? (-> this flags) 2)) + (when (zero? (-> this debug-point)) (let ((s5-0 pp)) - (set! pp (-> obj process)) + (set! pp (-> this process)) (let ((s4-0 0)) - (dotimes (v1-8 (-> obj pos-vol-count)) - (+! s4-0 (-> obj pos-vol v1-8 num-planes)) + (dotimes (v1-8 (-> this pos-vol-count)) + (+! s4-0 (-> this pos-vol v1-8 num-planes)) ) - (dotimes (v1-11 (-> obj neg-vol-count)) - (+! s4-0 (-> obj neg-vol v1-11 num-planes)) + (dotimes (v1-11 (-> this neg-vol-count)) + (+! s4-0 (-> this neg-vol v1-11 num-planes)) ) - (set! (-> obj debug-point) (new 'debug 'vector-array (* 10 s4-0))) - (set! (-> obj debug-normal) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> this debug-point) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> this debug-normal) (new 'debug 'vector-array (* 10 s4-0))) ) (set! pp s5-0) ) - (set! (-> obj debug-point length) 0) - (set! (-> obj debug-normal length) 0) - (dotimes (s5-1 (-> obj pos-vol-count)) - (init-vol! (-> obj pos-vol s5-1) 'vol (-> obj debug-point) (-> obj debug-normal)) + (set! (-> this debug-point length) 0) + (set! (-> this debug-normal length) 0) + (dotimes (s5-1 (-> this pos-vol-count)) + (init-vol! (-> this pos-vol s5-1) 'vol (-> this debug-point) (-> this debug-normal)) ) - (dotimes (s5-2 (-> obj neg-vol-count)) - (init-vol! (-> obj neg-vol s5-2) 'vol (-> obj debug-point) (-> obj debug-normal)) + (dotimes (s5-2 (-> this neg-vol-count)) + (init-vol! (-> this neg-vol s5-2) 'vol (-> this debug-point) (-> this debug-normal)) ) ) - (dotimes (s5-3 (-> obj pos-vol-count)) - (debug-draw (-> obj pos-vol s5-3)) + (dotimes (s5-3 (-> this pos-vol-count)) + (debug-draw (-> this pos-vol s5-3)) ) - (dotimes (s5-4 (-> obj neg-vol-count)) - (debug-draw (-> obj neg-vol s5-4)) + (dotimes (s5-4 (-> this neg-vol-count)) + (debug-draw (-> this neg-vol s5-4)) ) ) ) @@ -255,14 +255,14 @@ ) ;; definition for method 10 of type vol-control -(defmethod point-in-vol? vol-control ((obj vol-control) (arg0 vector)) - (dotimes (s4-0 (-> obj neg-vol-count)) - (if (point-in-vol? (-> obj neg-vol s4-0) arg0 0.0) +(defmethod point-in-vol? vol-control ((this vol-control) (arg0 vector)) + (dotimes (s4-0 (-> this neg-vol-count)) + (if (point-in-vol? (-> this neg-vol s4-0) arg0 0.0) (return #f) ) ) - (dotimes (s4-1 (-> obj pos-vol-count)) - (if (point-in-vol? (-> obj pos-vol s4-1) arg0 0.0) + (dotimes (s4-1 (-> this pos-vol-count)) + (if (point-in-vol? (-> this pos-vol s4-1) arg0 0.0) (return #t) ) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/background/background-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/background-h_REF.gc index a16c199e9a..0c4915f38a 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/background-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/background-h_REF.gc @@ -36,35 +36,35 @@ ) ;; definition for method 3 of type background-work -(defmethod inspect background-work ((obj background-work)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttfrag-tree-count: ~D~%" (-> obj tfrag-tree-count)) - (format #t "~Ttfrag-trees[8] @ #x~X~%" (-> obj tfrag-trees)) - (format #t "~Ttfrag-levels[8] @ #x~X~%" (-> obj tfrag-levels)) - (format #t "~Ttrans-tfrag-tree-count: ~D~%" (-> obj trans-tfrag-tree-count)) - (format #t "~Ttrans-tfrag-trees[8] @ #x~X~%" (-> obj trans-tfrag-trees)) - (format #t "~Ttrans-tfrag-levels[8] @ #x~X~%" (-> obj trans-tfrag-levels)) - (format #t "~Tdirt-tfrag-tree-count: ~D~%" (-> obj dirt-tfrag-tree-count)) - (format #t "~Tdirt-tfrag-trees[8] @ #x~X~%" (-> obj dirt-tfrag-trees)) - (format #t "~Tdirt-tfrag-levels[8] @ #x~X~%" (-> obj dirt-tfrag-levels)) - (format #t "~Tice-tfrag-tree-count: ~D~%" (-> obj ice-tfrag-tree-count)) - (format #t "~Tice-tfrag-trees[8] @ #x~X~%" (-> obj ice-tfrag-trees)) - (format #t "~Tice-tfrag-levels[8] @ #x~X~%" (-> obj ice-tfrag-levels)) - (format #t "~Tlowres-tfrag-tree-count: ~D~%" (-> obj lowres-tfrag-tree-count)) - (format #t "~Tlowres-tfrag-trees[8] @ #x~X~%" (-> obj lowres-tfrag-trees)) - (format #t "~Tlowres-tfrag-levels[8] @ #x~X~%" (-> obj lowres-tfrag-levels)) - (format #t "~Tlowres-trans-tfrag-tree-count: ~D~%" (-> obj lowres-trans-tfrag-tree-count)) - (format #t "~Tlowres-trans-tfrag-trees[8] @ #x~X~%" (-> obj lowres-trans-tfrag-trees)) - (format #t "~Tlowres-trans-tfrag-levels[8] @ #x~X~%" (-> obj lowres-trans-tfrag-levels)) - (format #t "~Tshrub-tree-count: ~D~%" (-> obj shrub-tree-count)) - (format #t "~Tshrub-trees[8] @ #x~X~%" (-> obj shrub-trees)) - (format #t "~Tshrub-levels[8] @ #x~X~%" (-> obj shrub-levels)) - (format #t "~Ttie-tree-count: ~D~%" (-> obj tie-tree-count)) - (format #t "~Ttie-trees[8] @ #x~X~%" (-> obj tie-trees)) - (format #t "~Ttie-levels[8] @ #x~X~%" (-> obj tie-levels)) - (format #t "~Ttie-generic[8] @ #x~X~%" (-> obj tie-generic)) - (format #t "~Twait-to-vu0: ~D~%" (-> obj wait-to-vu0)) - obj +(defmethod inspect background-work ((this background-work)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttfrag-tree-count: ~D~%" (-> this tfrag-tree-count)) + (format #t "~Ttfrag-trees[8] @ #x~X~%" (-> this tfrag-trees)) + (format #t "~Ttfrag-levels[8] @ #x~X~%" (-> this tfrag-levels)) + (format #t "~Ttrans-tfrag-tree-count: ~D~%" (-> this trans-tfrag-tree-count)) + (format #t "~Ttrans-tfrag-trees[8] @ #x~X~%" (-> this trans-tfrag-trees)) + (format #t "~Ttrans-tfrag-levels[8] @ #x~X~%" (-> this trans-tfrag-levels)) + (format #t "~Tdirt-tfrag-tree-count: ~D~%" (-> this dirt-tfrag-tree-count)) + (format #t "~Tdirt-tfrag-trees[8] @ #x~X~%" (-> this dirt-tfrag-trees)) + (format #t "~Tdirt-tfrag-levels[8] @ #x~X~%" (-> this dirt-tfrag-levels)) + (format #t "~Tice-tfrag-tree-count: ~D~%" (-> this ice-tfrag-tree-count)) + (format #t "~Tice-tfrag-trees[8] @ #x~X~%" (-> this ice-tfrag-trees)) + (format #t "~Tice-tfrag-levels[8] @ #x~X~%" (-> this ice-tfrag-levels)) + (format #t "~Tlowres-tfrag-tree-count: ~D~%" (-> this lowres-tfrag-tree-count)) + (format #t "~Tlowres-tfrag-trees[8] @ #x~X~%" (-> this lowres-tfrag-trees)) + (format #t "~Tlowres-tfrag-levels[8] @ #x~X~%" (-> this lowres-tfrag-levels)) + (format #t "~Tlowres-trans-tfrag-tree-count: ~D~%" (-> this lowres-trans-tfrag-tree-count)) + (format #t "~Tlowres-trans-tfrag-trees[8] @ #x~X~%" (-> this lowres-trans-tfrag-trees)) + (format #t "~Tlowres-trans-tfrag-levels[8] @ #x~X~%" (-> this lowres-trans-tfrag-levels)) + (format #t "~Tshrub-tree-count: ~D~%" (-> this shrub-tree-count)) + (format #t "~Tshrub-trees[8] @ #x~X~%" (-> this shrub-trees)) + (format #t "~Tshrub-levels[8] @ #x~X~%" (-> this shrub-levels)) + (format #t "~Ttie-tree-count: ~D~%" (-> this tie-tree-count)) + (format #t "~Ttie-trees[8] @ #x~X~%" (-> this tie-trees)) + (format #t "~Ttie-levels[8] @ #x~X~%" (-> this tie-levels)) + (format #t "~Ttie-generic[8] @ #x~X~%" (-> this tie-generic)) + (format #t "~Twait-to-vu0: ~D~%" (-> this wait-to-vu0)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/background/prototype-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/prototype-h_REF.gc index b5654816a5..c895eafe13 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/prototype-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/prototype-h_REF.gc @@ -34,28 +34,28 @@ ;; definition for method 3 of type prototype-bucket ;; INFO: Used lq/sq -(defmethod inspect prototype-bucket ((obj prototype-bucket)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tin-level: ~D~%" (-> obj in-level)) - (format #t "~Tutextures: ~D~%" (-> obj utextures)) - (format #t "~Tgeometry[4] @ #x~X~%" (-> obj geometry)) - (format #t "~Tdists: #~%" (-> obj dists)) - (format #t "~Trdists: #~%" (-> obj rdists)) - (format #t "~Tnext[4] @ #x~X~%" (-> obj next)) - (format #t "~Tcount[4] @ #x~X~%" (-> obj count)) - (format #t "~Tnear-plane: (meters ~m)~%" (-> obj dists x)) - (format #t "~Tnear-stiff: (meters ~m)~%" (-> obj dists y)) - (format #t "~Tmid-plane: (meters ~m)~%" (-> obj dists z)) - (format #t "~Tfar-plane: (meters ~m)~%" (-> obj dists w)) - (format #t "~Trlength-near: ~f~%" (-> obj rdists x)) - (format #t "~Trlength-stiff: ~f~%" (-> obj rdists y)) - (format #t "~Trlength-mid: ~f~%" (-> obj rdists z)) - (format #t "~Tstiffness: ~f~%" (-> obj rdists w)) - (format #t "~Tnext-clear: ~D~%" (-> obj next-clear)) - (format #t "~Tcount-clear: ~D~%" (-> obj count-clear)) - obj +(defmethod inspect prototype-bucket ((this prototype-bucket)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tin-level: ~D~%" (-> this in-level)) + (format #t "~Tutextures: ~D~%" (-> this utextures)) + (format #t "~Tgeometry[4] @ #x~X~%" (-> this geometry)) + (format #t "~Tdists: #~%" (-> this dists)) + (format #t "~Trdists: #~%" (-> this rdists)) + (format #t "~Tnext[4] @ #x~X~%" (-> this next)) + (format #t "~Tcount[4] @ #x~X~%" (-> this count)) + (format #t "~Tnear-plane: (meters ~m)~%" (-> this dists x)) + (format #t "~Tnear-stiff: (meters ~m)~%" (-> this dists y)) + (format #t "~Tmid-plane: (meters ~m)~%" (-> this dists z)) + (format #t "~Tfar-plane: (meters ~m)~%" (-> this dists w)) + (format #t "~Trlength-near: ~f~%" (-> this rdists x)) + (format #t "~Trlength-stiff: ~f~%" (-> this rdists y)) + (format #t "~Trlength-mid: ~f~%" (-> this rdists z)) + (format #t "~Tstiffness: ~f~%" (-> this rdists w)) + (format #t "~Tnext-clear: ~D~%" (-> this next-clear)) + (format #t "~Tcount-clear: ~D~%" (-> this count-clear)) + this ) ;; definition of type prototype-bucket-shrub @@ -72,31 +72,31 @@ ;; definition for method 3 of type prototype-bucket-shrub ;; INFO: Used lq/sq -(defmethod inspect prototype-bucket-shrub ((obj prototype-bucket-shrub)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tin-level: ~D~%" (-> obj in-level)) - (format #t "~Tutextures: ~D~%" (-> obj utextures)) - (format #t "~Tgeometry[4] @ #x~X~%" (-> obj geometry)) - (format #t "~Tdists: #~%" (-> obj dists)) - (format #t "~Trdists: #~%" (-> obj rdists)) - (format #t "~Tnext[4] @ #x~X~%" (-> obj next)) - (format #t "~Tcount[4] @ #x~X~%" (-> obj count)) - (format #t "~Tnear-plane: (meters ~m)~%" (-> obj dists x)) - (format #t "~Tnear-stiff: (meters ~m)~%" (-> obj dists y)) - (format #t "~Tmid-plane: (meters ~m)~%" (-> obj dists z)) - (format #t "~Tfar-plane: (meters ~m)~%" (-> obj dists w)) - (format #t "~Trlength-near: ~f~%" (-> obj rdists x)) - (format #t "~Trlength-stiff: ~f~%" (-> obj rdists y)) - (format #t "~Trlength-mid: ~f~%" (-> obj rdists z)) - (format #t "~Tstiffness: ~f~%" (-> obj rdists w)) - (format #t "~Tnext-clear: ~D~%" (-> obj next-clear)) - (format #t "~Tcount-clear: ~D~%" (-> obj count-clear)) - (format #t "~Tmod-count[4] @ #x~X~%" (-> obj mod-count)) - (format #t "~Tlast[4] @ #x~X~%" (-> obj last)) - (format #t "~Tlast-clear: ~D~%" (-> obj last-clear)) - obj +(defmethod inspect prototype-bucket-shrub ((this prototype-bucket-shrub)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tin-level: ~D~%" (-> this in-level)) + (format #t "~Tutextures: ~D~%" (-> this utextures)) + (format #t "~Tgeometry[4] @ #x~X~%" (-> this geometry)) + (format #t "~Tdists: #~%" (-> this dists)) + (format #t "~Trdists: #~%" (-> this rdists)) + (format #t "~Tnext[4] @ #x~X~%" (-> this next)) + (format #t "~Tcount[4] @ #x~X~%" (-> this count)) + (format #t "~Tnear-plane: (meters ~m)~%" (-> this dists x)) + (format #t "~Tnear-stiff: (meters ~m)~%" (-> this dists y)) + (format #t "~Tmid-plane: (meters ~m)~%" (-> this dists z)) + (format #t "~Tfar-plane: (meters ~m)~%" (-> this dists w)) + (format #t "~Trlength-near: ~f~%" (-> this rdists x)) + (format #t "~Trlength-stiff: ~f~%" (-> this rdists y)) + (format #t "~Trlength-mid: ~f~%" (-> this rdists z)) + (format #t "~Tstiffness: ~f~%" (-> this rdists w)) + (format #t "~Tnext-clear: ~D~%" (-> this next-clear)) + (format #t "~Tcount-clear: ~D~%" (-> this count-clear)) + (format #t "~Tmod-count[4] @ #x~X~%" (-> this mod-count)) + (format #t "~Tlast[4] @ #x~X~%" (-> this last)) + (format #t "~Tlast-clear: ~D~%" (-> this last-clear)) + this ) ;; definition of type prototype-inline-array-shrub @@ -111,13 +111,13 @@ ) ;; definition for method 3 of type prototype-inline-array-shrub -(defmethod inspect prototype-inline-array-shrub ((obj prototype-inline-array-shrub)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect prototype-inline-array-shrub ((this prototype-inline-array-shrub)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[1] @ #x~X~%" (-> this data)) + this ) ;; definition of type prototype-array-shrub-info @@ -131,11 +131,11 @@ ) ;; definition for method 3 of type prototype-array-shrub-info -(defmethod inspect prototype-array-shrub-info ((obj prototype-array-shrub-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tprototype-inline-array-shrub: ~A~%" (-> obj prototype-inline-array-shrub)) - (format #t "~Twind-vectors: #x~X~%" (-> obj wind-vectors)) - obj +(defmethod inspect prototype-array-shrub-info ((this prototype-array-shrub-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tprototype-inline-array-shrub: ~A~%" (-> this prototype-inline-array-shrub)) + (format #t "~Twind-vectors: #x~X~%" (-> this wind-vectors)) + this ) ;; definition of type prototype-bucket-tie @@ -163,42 +163,42 @@ ;; definition for method 3 of type prototype-bucket-tie ;; INFO: Used lq/sq -(defmethod inspect prototype-bucket-tie ((obj prototype-bucket-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tin-level: ~D~%" (-> obj in-level)) - (format #t "~Tutextures: ~D~%" (-> obj utextures)) - (format #t "~Tgeometry[4] @ #x~X~%" (-> obj geometry-override)) - (format #t "~Tdists: #~%" (-> obj dists)) - (format #t "~Trdists: #~%" (-> obj rdists)) - (format #t "~Tnext[4] @ #x~X~%" (-> obj next)) - (format #t "~Tcount[4] @ #x~X~%" (-> obj count)) - (format #t "~Tnear-plane: (meters ~m)~%" (-> obj dists x)) - (format #t "~Tnear-stiff: (meters ~m)~%" (-> obj dists y)) - (format #t "~Tmid-plane: (meters ~m)~%" (-> obj dists z)) - (format #t "~Tfar-plane: (meters ~m)~%" (-> obj dists w)) - (format #t "~Trlength-near: ~f~%" (-> obj rdists x)) - (format #t "~Trlength-stiff: ~f~%" (-> obj rdists y)) - (format #t "~Trlength-mid: ~f~%" (-> obj rdists z)) - (format #t "~Tstiffness: ~f~%" (-> obj rdists w)) - (format #t "~Tnext-clear: ~D~%" (-> obj next-clear)) - (format #t "~Tcount-clear: ~D~%" (-> obj count-clear)) - (format #t "~Tgeneric-count[4] @ #x~X~%" (-> obj generic-count)) - (format #t "~Tgeneric-next[4] @ #x~X~%" (-> obj generic-next)) - (format #t "~Tfrag-count[4] @ #x~X~%" (-> obj frag-count)) - (format #t "~Tindex-start[4] @ #x~X~%" (-> obj index-start)) - (format #t "~Tbase-qw[4] @ #x~X~%" (-> obj base-qw)) - (format #t "~Tenvmap-rfade: ~f~%" (-> obj envmap-rfade)) - (format #t "~Tenvmap-fade-far: ~f~%" (-> obj envmap-fade-far)) - (format #t "~Tenvmap-shader: #~%" (-> obj envmap-shader)) - (format #t "~Tcollide-frag: ~A~%" (-> obj collide-frag)) - (format #t "~Ttie-colors: ~A~%" (-> obj tie-colors)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - (format #t "~Tcolor-index-qwc[0] @ #x~X~%" (-> obj data)) - (format #t "~Tgeneric-next-clear: ~D~%" (-> obj generic-next-clear)) - (format #t "~Tgeneric-count-clear: ~D~%" (-> obj generic-count-clear)) - obj +(defmethod inspect prototype-bucket-tie ((this prototype-bucket-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tin-level: ~D~%" (-> this in-level)) + (format #t "~Tutextures: ~D~%" (-> this utextures)) + (format #t "~Tgeometry[4] @ #x~X~%" (-> this geometry-override)) + (format #t "~Tdists: #~%" (-> this dists)) + (format #t "~Trdists: #~%" (-> this rdists)) + (format #t "~Tnext[4] @ #x~X~%" (-> this next)) + (format #t "~Tcount[4] @ #x~X~%" (-> this count)) + (format #t "~Tnear-plane: (meters ~m)~%" (-> this dists x)) + (format #t "~Tnear-stiff: (meters ~m)~%" (-> this dists y)) + (format #t "~Tmid-plane: (meters ~m)~%" (-> this dists z)) + (format #t "~Tfar-plane: (meters ~m)~%" (-> this dists w)) + (format #t "~Trlength-near: ~f~%" (-> this rdists x)) + (format #t "~Trlength-stiff: ~f~%" (-> this rdists y)) + (format #t "~Trlength-mid: ~f~%" (-> this rdists z)) + (format #t "~Tstiffness: ~f~%" (-> this rdists w)) + (format #t "~Tnext-clear: ~D~%" (-> this next-clear)) + (format #t "~Tcount-clear: ~D~%" (-> this count-clear)) + (format #t "~Tgeneric-count[4] @ #x~X~%" (-> this generic-count)) + (format #t "~Tgeneric-next[4] @ #x~X~%" (-> this generic-next)) + (format #t "~Tfrag-count[4] @ #x~X~%" (-> this frag-count)) + (format #t "~Tindex-start[4] @ #x~X~%" (-> this index-start)) + (format #t "~Tbase-qw[4] @ #x~X~%" (-> this base-qw)) + (format #t "~Tenvmap-rfade: ~f~%" (-> this envmap-rfade)) + (format #t "~Tenvmap-fade-far: ~f~%" (-> this envmap-fade-far)) + (format #t "~Tenvmap-shader: #~%" (-> this envmap-shader)) + (format #t "~Tcollide-frag: ~A~%" (-> this collide-frag)) + (format #t "~Ttie-colors: ~A~%" (-> this tie-colors)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + (format #t "~Tcolor-index-qwc[0] @ #x~X~%" (-> this data)) + (format #t "~Tgeneric-next-clear: ~D~%" (-> this generic-next-clear)) + (format #t "~Tgeneric-count-clear: ~D~%" (-> this generic-count-clear)) + this ) ;; definition of type prototype-array-tie @@ -214,13 +214,13 @@ ) ;; definition for method 3 of type prototype-array-tie -(defmethod inspect prototype-array-tie ((obj prototype-array-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttype: ~A~%" (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tcontent-type: ~A~%" (-> obj content-type)) - obj +(defmethod inspect prototype-array-tie ((this prototype-array-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttype: ~A~%" (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tcontent-type: ~A~%" (-> this content-type)) + this ) ;; definition of type proxy-prototype-array-tie @@ -234,11 +234,11 @@ ) ;; definition for method 3 of type proxy-prototype-array-tie -(defmethod inspect proxy-prototype-array-tie ((obj proxy-prototype-array-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tprototype-array-tie: ~A~%" (-> obj prototype-array-tie)) - (format #t "~Twind-vectors: #x~X~%" (-> obj wind-vectors)) - obj +(defmethod inspect proxy-prototype-array-tie ((this proxy-prototype-array-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tprototype-array-tie: ~A~%" (-> this prototype-array-tie)) + (format #t "~Twind-vectors: #x~X~%" (-> this wind-vectors)) + this ) ;; definition of type instance @@ -255,14 +255,14 @@ ) ;; definition for method 3 of type instance -(defmethod inspect instance ((obj instance)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tbucket-index: ~D~%" (-> obj bucket-index)) - (format #t "~Torigin: #~%" (-> obj origin)) - (format #t "~Twind-index: ~D~%" (-> obj wind-index)) - obj +(defmethod inspect instance ((this instance)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tbucket-index: ~D~%" (-> this bucket-index)) + (format #t "~Torigin: #~%" (-> this origin)) + (format #t "~Twind-index: ~D~%" (-> this wind-index)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/background/prototype_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/prototype_REF.gc index 4d9e9addfb..8027205ad9 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/prototype_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/prototype_REF.gc @@ -3,9 +3,9 @@ ;; definition for method 9 of type prototype-array-tie ;; INFO: Return type mismatch prototype-array-tie vs none. -(defmethod login prototype-array-tie ((obj prototype-array-tie)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj array-data s5-0))) +(defmethod login prototype-array-tie ((this prototype-array-tie)) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this array-data s5-0))) (dotimes (s3-0 4) (let ((a0-1 (-> s4-0 geometry-override s3-0))) (if (nonzero? a0-1) @@ -32,9 +32,9 @@ ) ;; definition for method 9 of type prototype-inline-array-shrub -(defmethod login prototype-inline-array-shrub ((obj prototype-inline-array-shrub)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) +(defmethod login prototype-inline-array-shrub ((this prototype-inline-array-shrub)) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (dotimes (s3-0 4) (let ((a0-1 (-> s4-0 geometry s3-0))) (if (nonzero? a0-1) @@ -44,28 +44,28 @@ ) ) ) - obj + this ) ;; definition for method 8 of type prototype-array-tie -(defmethod mem-usage prototype-array-tie ((obj prototype-array-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-array-tie ((this prototype-array-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) - (let ((v1-8 (asize-of obj))) + (let ((v1-8 (asize-of this))) (+! (-> arg0 data 0 used) v1-8) (+! (-> arg0 data 0 total) (logand -16 (+ v1-8 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj array-data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this array-data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 8 of type prototype-bucket-tie -(defmethod mem-usage prototype-bucket-tie ((obj prototype-bucket-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-bucket-tie ((this prototype-bucket-tie) (arg0 memory-usage-block) (arg1 int)) (dotimes (s3-0 4) - (let ((a0-1 (-> obj geometry-override s3-0))) + (let ((a0-1 (-> this geometry-override s3-0))) (if (nonzero? a0-1) (mem-usage a0-1 arg0 (logior arg1 1)) ) @@ -74,42 +74,42 @@ (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (+! (-> arg0 data 80 count) 1) - (let ((v1-13 (asize-of (-> obj name)))) + (let ((v1-13 (asize-of (-> this name)))) (+! (-> arg0 data 80 used) v1-13) (+! (-> arg0 data 80 total) (logand -16 (+ v1-13 15))) ) - (when (nonzero? (-> obj tie-colors)) + (when (nonzero? (-> this tie-colors)) (set! (-> arg0 length) (max 17 (-> arg0 length))) (set! (-> arg0 data 16 name) "tie-pal") (+! (-> arg0 data 16 count) 1) - (let ((v1-25 (asize-of (-> obj tie-colors)))) + (let ((v1-25 (asize-of (-> this tie-colors)))) (+! (-> arg0 data 16 used) v1-25) (+! (-> arg0 data 16 total) (logand -16 (+ v1-25 15))) ) ) - (if (nonzero? (-> obj collide-frag)) - (mem-usage (-> obj collide-frag) arg0 (logior arg1 1)) + (if (nonzero? (-> this collide-frag)) + (mem-usage (-> this collide-frag) arg0 (logior arg1 1)) ) - obj + this ) ;; definition for method 8 of type prototype-inline-array-shrub -(defmethod mem-usage prototype-inline-array-shrub ((obj prototype-inline-array-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-inline-array-shrub ((this prototype-inline-array-shrub) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) - (let ((v1-8 (asize-of obj))) + (let ((v1-8 (asize-of this))) (+! (-> arg0 data 0 used) v1-8) (+! (-> arg0 data 0 total) (logand -16 (+ v1-8 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 8 of type prototype-bucket-shrub -(defmethod mem-usage prototype-bucket-shrub ((obj prototype-bucket-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-bucket-shrub ((this prototype-bucket-shrub) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 25 (-> arg0 length))) (set! (-> arg0 data 24 name) "prototype-bucket-shrub") (+! (-> arg0 data 24 count) 1) @@ -118,7 +118,7 @@ (+! (-> arg0 data 24 total) (logand -16 (+ v1-5 15))) ) (dotimes (s3-0 4) - (let ((a0-5 (-> obj geometry s3-0))) + (let ((a0-5 (-> this geometry s3-0))) (if (nonzero? a0-5) (mem-usage a0-5 arg0 (logior arg1 1)) ) @@ -127,9 +127,9 @@ (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (+! (-> arg0 data 80 count) 1) - (let ((v1-22 (asize-of (-> obj name)))) + (let ((v1-22 (asize-of (-> this name)))) (+! (-> arg0 data 80 used) v1-22) (+! (-> arg0 data 80 total) (logand -16 (+ v1-22 15))) ) - obj + this ) diff --git a/test/decompiler/reference/jak1/engine/gfx/background/subdivide-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/subdivide-h_REF.gc index c0be364adb..51d7e05b0d 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/subdivide-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/subdivide-h_REF.gc @@ -17,13 +17,13 @@ ) ;; definition for method 3 of type subdivide-settings -(defmethod inspect subdivide-settings ((obj subdivide-settings)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdist[5] @ #x~X~%" (-> obj dist)) - (format #t "~Tmeters[5] @ #x~X~%" (-> obj meters)) - (format #t "~Tclose[4] @ #x~X~%" (-> obj close)) - (format #t "~Tfar[4] @ #x~X~%" (-> obj far)) - obj +(defmethod inspect subdivide-settings ((this subdivide-settings)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdist[5] @ #x~X~%" (-> this dist)) + (format #t "~Tmeters[5] @ #x~X~%" (-> this meters)) + (format #t "~Tclose[4] @ #x~X~%" (-> this close)) + (format #t "~Tfar[4] @ #x~X~%" (-> this far)) + this ) ;; definition for method 0 of type subdivide-settings @@ -50,13 +50,13 @@ ) ;; definition for method 3 of type subdivide-dists -(defmethod inspect subdivide-dists ((obj subdivide-dists)) - (format #t "[~8x] ~A~%" obj 'subdivide-dists) - (format #t "~Tdata[32] @ #x~X~%" (-> obj data)) - (format #t "~Tvector[8] @ #x~X~%" (-> obj data)) - (format #t "~Tk0s[4] @ #x~X~%" (-> obj data)) - (format #t "~Tk1s[4] @ #x~X~%" (-> obj k1s)) - obj +(defmethod inspect subdivide-dists ((this subdivide-dists)) + (format #t "[~8x] ~A~%" this 'subdivide-dists) + (format #t "~Tdata[32] @ #x~X~%" (-> this data)) + (format #t "~Tvector[8] @ #x~X~%" (-> this data)) + (format #t "~Tk0s[4] @ #x~X~%" (-> this data)) + (format #t "~Tk1s[4] @ #x~X~%" (-> this k1s)) + this ) ;; definition of type gs-packed-rgba @@ -73,14 +73,14 @@ ) ;; definition for method 3 of type gs-packed-rgba -(defmethod inspect gs-packed-rgba ((obj gs-packed-rgba)) - (format #t "[~8x] ~A~%" obj 'gs-packed-rgba) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~Tred: ~D~%" (-> obj red)) - (format #t "~Tgreen: ~D~%" (-> obj green)) - (format #t "~Tblue: ~D~%" (-> obj blue)) - (format #t "~Talpha: ~D~%" (-> obj alpha)) - obj +(defmethod inspect gs-packed-rgba ((this gs-packed-rgba)) + (format #t "[~8x] ~A~%" this 'gs-packed-rgba) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~Tred: ~D~%" (-> this red)) + (format #t "~Tgreen: ~D~%" (-> this green)) + (format #t "~Tblue: ~D~%" (-> this blue)) + (format #t "~Talpha: ~D~%" (-> this alpha)) + this ) ;; definition of type gs-packed-xyzw @@ -99,15 +99,15 @@ ;; definition for method 3 of type gs-packed-xyzw ;; INFO: Used lq/sq -(defmethod inspect gs-packed-xyzw ((obj gs-packed-xyzw)) - (format #t "[~8x] ~A~%" obj 'gs-packed-xyzw) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - (format #t "~Tw: ~D~%" (-> obj w)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect gs-packed-xyzw ((this gs-packed-xyzw)) + (format #t "[~8x] ~A~%" this 'gs-packed-xyzw) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + (format #t "~Tw: ~D~%" (-> this w)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; definition of type gs-packed-stq @@ -125,14 +125,14 @@ ;; definition for method 3 of type gs-packed-stq ;; INFO: Used lq/sq -(defmethod inspect gs-packed-stq ((obj gs-packed-stq)) - (format #t "[~8x] ~A~%" obj 'gs-packed-stq) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~Ttex-s: ~f~%" (-> obj tex-s)) - (format #t "~Ttex-t: ~f~%" (-> obj tex-t)) - (format #t "~Ttex-q: ~f~%" (-> obj tex-q)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect gs-packed-stq ((this gs-packed-stq)) + (format #t "[~8x] ~A~%" this 'gs-packed-stq) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~Ttex-s: ~f~%" (-> this tex-s)) + (format #t "~Ttex-t: ~f~%" (-> this tex-t)) + (format #t "~Ttex-q: ~f~%" (-> this tex-q)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; definition of type gs-packed-gt @@ -147,12 +147,12 @@ ) ;; definition for method 3 of type gs-packed-gt -(defmethod inspect gs-packed-gt ((obj gs-packed-gt)) - (format #t "[~8x] ~A~%" obj 'gs-packed-gt) - (format #t "~Tstq: #~%" (-> obj stq)) - (format #t "~Trgba: #~%" (-> obj rgba)) - (format #t "~Txyzw: #~%" (-> obj xyzw)) - obj +(defmethod inspect gs-packed-gt ((this gs-packed-gt)) + (format #t "[~8x] ~A~%" this 'gs-packed-gt) + (format #t "~Tstq: #~%" (-> this stq)) + (format #t "~Trgba: #~%" (-> this rgba)) + (format #t "~Txyzw: #~%" (-> this xyzw)) + this ) ;; definition of type gs-packed-gt4 @@ -165,10 +165,10 @@ ) ;; definition for method 3 of type gs-packed-gt4 -(defmethod inspect gs-packed-gt4 ((obj gs-packed-gt4)) - (format #t "[~8x] ~A~%" obj 'gs-packed-gt4) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect gs-packed-gt4 ((this gs-packed-gt4)) + (format #t "[~8x] ~A~%" this 'gs-packed-gt4) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + this ) ;; definition of type terrain-bsp @@ -182,11 +182,11 @@ ) ;; definition for method 3 of type terrain-bsp -(defmethod inspect terrain-bsp ((obj terrain-bsp)) - (format #t "[~8x] ~A~%" obj 'terrain-bsp) - (format #t "~Tlev-index: ~D~%" (-> obj lev-index)) - (format #t "~Tmood: ~A~%" (-> obj mood)) - obj +(defmethod inspect terrain-bsp ((this terrain-bsp)) + (format #t "[~8x] ~A~%" this 'terrain-bsp) + (format #t "~Tlev-index: ~D~%" (-> this lev-index)) + (format #t "~Tmood: ~A~%" (-> this mood)) + this ) ;; definition of type terrain-stats @@ -214,25 +214,25 @@ ) ;; definition for method 3 of type terrain-stats -(defmethod inspect terrain-stats ((obj terrain-stats)) - (format #t "[~8x] ~A~%" obj 'terrain-stats) - (format #t "~Tpris: #~%" (-> obj pris)) - (format #t "~Ttie-generic: #~%" (-> obj tie-generic)) - (format #t "~Ttie: #~%" (-> obj tie)) - (format #t "~Ttie-near: #~%" (-> obj tie-near)) - (format #t "~Tshrub-near: #~%" (-> obj shrub-near)) - (format #t "~Tshrub: #~%" (-> obj shrub)) - (format #t "~Ttfrag-near: #~%" (-> obj tfrag-near)) - (format #t "~Ttfrag: #~%" (-> obj tfrag)) - (format #t "~Tbillboard: #~%" (-> obj billboard)) - (format #t "~Ttrans-tfrag: #~%" (-> obj trans-tfrag)) - (format #t "~Ttrans-tfrag-near: #~%" (-> obj trans-tfrag-near)) - (format #t "~Ttrans-pris: #~%" (-> obj trans-pris)) - (format #t "~Ttrans-shrub: #~%" (-> obj trans-shrub)) - (format #t "~Tocean-mid: #~%" (-> obj ocean-mid)) - (format #t "~Tocean-near: #~%" (-> obj ocean-near)) - (format #t "~Ttotal: #~%" (-> obj total)) - obj +(defmethod inspect terrain-stats ((this terrain-stats)) + (format #t "[~8x] ~A~%" this 'terrain-stats) + (format #t "~Tpris: #~%" (-> this pris)) + (format #t "~Ttie-generic: #~%" (-> this tie-generic)) + (format #t "~Ttie: #~%" (-> this tie)) + (format #t "~Ttie-near: #~%" (-> this tie-near)) + (format #t "~Tshrub-near: #~%" (-> this shrub-near)) + (format #t "~Tshrub: #~%" (-> this shrub)) + (format #t "~Ttfrag-near: #~%" (-> this tfrag-near)) + (format #t "~Ttfrag: #~%" (-> this tfrag)) + (format #t "~Tbillboard: #~%" (-> this billboard)) + (format #t "~Ttrans-tfrag: #~%" (-> this trans-tfrag)) + (format #t "~Ttrans-tfrag-near: #~%" (-> this trans-tfrag-near)) + (format #t "~Ttrans-pris: #~%" (-> this trans-pris)) + (format #t "~Ttrans-shrub: #~%" (-> this trans-shrub)) + (format #t "~Tocean-mid: #~%" (-> this ocean-mid)) + (format #t "~Tocean-near: #~%" (-> this ocean-near)) + (format #t "~Ttotal: #~%" (-> this total)) + this ) ;; definition of type dma-area @@ -252,17 +252,17 @@ ) ;; definition for method 3 of type dma-area -(defmethod inspect dma-area ((obj dma-area)) - (format #t "[~8x] ~A~%" obj 'dma-area) - (format #t "~Tdraw-node-dma: #~%" (-> obj draw-node-dma)) - (format #t "~Ttfrag-dma: #~%" (-> obj draw-node-dma)) - (format #t "~Tinstance-shrub-dma: #~%" (-> obj draw-node-dma)) - (format #t "~Tinstance-tie-dma: #~%" (-> obj draw-node-dma)) - (format #t "~Tprototype-tie-dma: #~%" (-> obj draw-node-dma)) - (format #t "~Ttime-of-day-dma: #~%" (-> obj draw-node-dma)) - (format #t "~Tdecomp-work: #~%" (-> obj draw-node-dma)) - (format #t "~Tocean-vertex[4] @ #x~X~%" (-> obj draw-node-dma)) - obj +(defmethod inspect dma-area ((this dma-area)) + (format #t "[~8x] ~A~%" this 'dma-area) + (format #t "~Tdraw-node-dma: #~%" (-> this draw-node-dma)) + (format #t "~Ttfrag-dma: #~%" (-> this draw-node-dma)) + (format #t "~Tinstance-shrub-dma: #~%" (-> this draw-node-dma)) + (format #t "~Tinstance-tie-dma: #~%" (-> this draw-node-dma)) + (format #t "~Tprototype-tie-dma: #~%" (-> this draw-node-dma)) + (format #t "~Ttime-of-day-dma: #~%" (-> this draw-node-dma)) + (format #t "~Tdecomp-work: #~%" (-> this draw-node-dma)) + (format #t "~Tocean-vertex[4] @ #x~X~%" (-> this draw-node-dma)) + this ) ;; definition of type background-area @@ -276,11 +276,11 @@ ) ;; definition for method 3 of type background-area -(defmethod inspect background-area ((obj background-area)) - (format #t "[~8x] ~A~%" obj 'background-area) - (format #t "~Tdma-area: #~%" (-> obj dma-area)) - (format #t "~Tvis-list[2048] @ #x~X~%" (-> obj vis-list)) - obj +(defmethod inspect background-area ((this background-area)) + (format #t "[~8x] ~A~%" this 'background-area) + (format #t "~Tdma-area: #~%" (-> this dma-area)) + (format #t "~Tvis-list[2048] @ #x~X~%" (-> this vis-list)) + this ) ;; definition of type foreground-area @@ -296,13 +296,13 @@ ) ;; definition for method 3 of type foreground-area -(defmethod inspect foreground-area ((obj foreground-area)) - (format #t "[~8x] ~A~%" obj 'foreground-area) - (format #t "~Tjoint-work: #~%" (-> obj joint-work)) - (format #t "~Tgeneric-work: #~%" (-> obj joint-work)) - (format #t "~Tbone-mem: #~%" (-> obj joint-work)) - (format #t "~Tshadow-work: #~%" (-> obj joint-work)) - obj +(defmethod inspect foreground-area ((this foreground-area)) + (format #t "[~8x] ~A~%" this 'foreground-area) + (format #t "~Tjoint-work: #~%" (-> this joint-work)) + (format #t "~Tgeneric-work: #~%" (-> this joint-work)) + (format #t "~Tbone-mem: #~%" (-> this joint-work)) + (format #t "~Tshadow-work: #~%" (-> this joint-work)) + this ) ;; definition of type ambient-area @@ -315,10 +315,10 @@ ) ;; definition for method 3 of type ambient-area -(defmethod inspect ambient-area ((obj ambient-area)) - (format #t "[~8x] ~A~%" obj 'ambient-area) - (format #t "~Tambient-list: #~%" (-> obj ambient-list)) - obj +(defmethod inspect ambient-area ((this ambient-area)) + (format #t "[~8x] ~A~%" this 'ambient-area) + (format #t "~Tambient-list: #~%" (-> this ambient-list)) + this ) ;; definition of type work-area @@ -333,12 +333,12 @@ ) ;; definition for method 3 of type work-area -(defmethod inspect work-area ((obj work-area)) - (format #t "[~8x] ~A~%" obj 'work-area) - (format #t "~Tbackground: #~%" (-> obj background)) - (format #t "~Tforeground: #~%" (-> obj background)) - (format #t "~Tambient: #~%" (-> obj background)) - obj +(defmethod inspect work-area ((this work-area)) + (format #t "[~8x] ~A~%" this 'work-area) + (format #t "~Tbackground: #~%" (-> this background)) + (format #t "~Tforeground: #~%" (-> this background)) + (format #t "~Tambient: #~%" (-> this background)) + this ) ;; definition of type terrain-context @@ -352,11 +352,11 @@ ) ;; definition for method 3 of type terrain-context -(defmethod inspect terrain-context ((obj terrain-context)) - (format #t "[~8x] ~A~%" obj 'terrain-context) - (format #t "~Tbsp: #~%" (-> obj bsp)) - (format #t "~Twork: #~%" (-> obj work)) - obj +(defmethod inspect terrain-context ((this terrain-context)) + (format #t "[~8x] ~A~%" this 'terrain-context) + (format #t "~Tbsp: #~%" (-> this bsp)) + (format #t "~Twork: #~%" (-> this work)) + this ) ;; definition for symbol *terrain-stats*, type terrain-stats diff --git a/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc index 88572c0d63..56e7d912ba 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/subdivide_REF.gc @@ -184,17 +184,17 @@ ;; definition for method 10 of type perf-stat ;; INFO: Return type mismatch perf-stat vs none. -(defmethod print-to-stream perf-stat ((obj perf-stat) (arg0 string) (arg1 basic)) +(defmethod print-to-stream perf-stat ((this perf-stat) (arg0 string) (arg1 basic)) (format *stdcon* "~3d ~8d ~8d ~6d ~6d" - (-> obj count) - (-> obj cycles) - (-> obj instructions) - (-> obj icache) - (-> obj dcache) + (-> this count) + (-> this cycles) + (-> this instructions) + (-> this icache) + (-> this dcache) ) - (format *stdcon* " ~2d ~2d ~2d" (-> obj to-vu0-waits) (-> obj to-spr-waits) (-> obj from-spr-waits)) + (format *stdcon* " ~2d ~2d ~2d" (-> this to-vu0-waits) (-> this to-spr-waits) (-> this from-spr-waits)) (format *stdcon* " ~s~%" arg0) (none) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/background/wind-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/background/wind-h_REF.gc index ea957feb81..a4176bf0e4 100644 --- a/test/decompiler/reference/jak1/engine/gfx/background/wind-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/background/wind-h_REF.gc @@ -12,11 +12,11 @@ ) ;; definition for method 3 of type wind-vector -(defmethod inspect wind-vector ((obj wind-vector)) - (format #t "[~8x] ~A~%" obj 'wind-vector) - (format #t "~Twind-pos: #~%" (-> obj wind-pos)) - (format #t "~Twind-vel: #~%" (-> obj wind-vel)) - obj +(defmethod inspect wind-vector ((this wind-vector)) + (format #t "[~8x] ~A~%" this 'wind-vector) + (format #t "~Twind-pos: #~%" (-> this wind-pos)) + (format #t "~Twind-vel: #~%" (-> this wind-vel)) + this ) ;; definition for symbol *wind-scales*, type (array uint8) @@ -70,14 +70,14 @@ ) ;; definition for method 3 of type wind-work -(defmethod inspect wind-work ((obj wind-work)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Twind-array[64] @ #x~X~%" (-> obj wind-array)) - (format #t "~Twind-normal: ~`vector`P~%" (-> obj wind-normal)) - (format #t "~Twind-temp: ~`vector`P~%" (-> obj wind-temp)) - (format #t "~Twind-force[64] @ #x~X~%" (-> obj wind-force)) - (format #t "~Twind-time: ~D~%" (-> obj wind-time)) - obj +(defmethod inspect wind-work ((this wind-work)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Twind-array[64] @ #x~X~%" (-> this wind-array)) + (format #t "~Twind-normal: ~`vector`P~%" (-> this wind-normal)) + (format #t "~Twind-temp: ~`vector`P~%" (-> this wind-temp)) + (format #t "~Twind-force[64] @ #x~X~%" (-> this wind-force)) + (format #t "~Twind-time: ~D~%" (-> this wind-time)) + this ) ;; definition for function wind-get-hashed-index diff --git a/test/decompiler/reference/jak1/engine/gfx/depth-cue-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/depth-cue-h_REF.gc index 4f3e0e746a..ad4ef4f7cd 100644 --- a/test/decompiler/reference/jak1/engine/gfx/depth-cue-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/depth-cue-h_REF.gc @@ -15,14 +15,14 @@ ) ;; definition for method 3 of type depth-cue-data -(defmethod inspect depth-cue-data ((obj depth-cue-data)) - (format #t "[~8x] ~A~%" obj 'depth-cue-data) - (format #t "~Tdata: #~%" (-> obj data)) - (format #t "~Tsharpness: ~f~%" (-> obj data x)) - (format #t "~Talpha: ~f~%" (-> obj data y)) - (format #t "~Tdistance: ~f~%" (-> obj data z)) - (format #t "~Tw: ~f~%" (-> obj data w)) - obj +(defmethod inspect depth-cue-data ((this depth-cue-data)) + (format #t "[~8x] ~A~%" this 'depth-cue-data) + (format #t "~Tdata: #~%" (-> this data)) + (format #t "~Tsharpness: ~f~%" (-> this data x)) + (format #t "~Talpha: ~f~%" (-> this data y)) + (format #t "~Tdistance: ~f~%" (-> this data z)) + (format #t "~Tw: ~f~%" (-> this data w)) + this ) ;; definition of type depth-cue-work @@ -42,17 +42,17 @@ ) ;; definition for method 3 of type depth-cue-work -(defmethod inspect depth-cue-work ((obj depth-cue-work)) - (format #t "[~8x] ~A~%" obj 'depth-cue-work) - (format #t "~Ttexture-strip-tmpl: #~%" (-> obj texture-strip-tmpl)) - (format #t "~Ttemp-strip-tmpl: #~%" (-> obj temp-strip-tmpl)) - (format #t "~Tstencil-tmpl: #~%" (-> obj stencil-tmpl)) - (format #t "~Tclear-color: #~%" (-> obj clear-color)) - (format #t "~Tset-color: #~%" (-> obj set-color)) - (format #t "~Tdraw-color: #~%" (-> obj draw-color)) - (format #t "~Tdepth: #~%" (-> obj depth)) - (format #t "~Tfront: #~%" (-> obj front)) - obj +(defmethod inspect depth-cue-work ((this depth-cue-work)) + (format #t "[~8x] ~A~%" this 'depth-cue-work) + (format #t "~Ttexture-strip-tmpl: #~%" (-> this texture-strip-tmpl)) + (format #t "~Ttemp-strip-tmpl: #~%" (-> this temp-strip-tmpl)) + (format #t "~Tstencil-tmpl: #~%" (-> this stencil-tmpl)) + (format #t "~Tclear-color: #~%" (-> this clear-color)) + (format #t "~Tset-color: #~%" (-> this set-color)) + (format #t "~Tdraw-color: #~%" (-> this draw-color)) + (format #t "~Tdepth: #~%" (-> this depth)) + (format #t "~Tfront: #~%" (-> this front)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/font-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/font-h_REF.gc index 622f782123..ac7842af7c 100644 --- a/test/decompiler/reference/jak1/engine/gfx/font-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/font-h_REF.gc @@ -13,12 +13,12 @@ ) ;; definition for method 3 of type char-verts -(defmethod inspect char-verts ((obj char-verts)) - (format #t "[~8x] ~A~%" obj 'char-verts) - (format #t "~Tpos[4] @ #x~X~%" (-> obj pos)) - (format #t "~Tcolor[4] @ #x~X~%" (-> obj color)) - (format #t "~Ttex-st[4] @ #x~X~%" (-> obj tex-st)) - obj +(defmethod inspect char-verts ((this char-verts)) + (format #t "[~8x] ~A~%" this 'char-verts) + (format #t "~Tpos[4] @ #x~X~%" (-> this pos)) + (format #t "~Tcolor[4] @ #x~X~%" (-> this color)) + (format #t "~Ttex-st[4] @ #x~X~%" (-> this tex-st)) + this ) ;; definition of type char-color @@ -31,10 +31,10 @@ ) ;; definition for method 3 of type char-color -(defmethod inspect char-color ((obj char-color)) - (format #t "[~8x] ~A~%" obj 'char-color) - (format #t "~Tcolor[4] @ #x~X~%" (-> obj color)) - obj +(defmethod inspect char-color ((this char-color)) + (format #t "[~8x] ~A~%" this 'char-color) + (format #t "~Tcolor[4] @ #x~X~%" (-> this color)) + this ) ;; definition for symbol *font-default-matrix*, type matrix @@ -83,86 +83,86 @@ ) ;; definition for method 3 of type font-context -(defmethod inspect font-context ((obj font-context)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Torigin: #~%" (-> obj origin)) - (format #t "~Tstrip-gif: #~%" (-> obj strip-gif)) - (format #t "~Twidth: ~f~%" (-> obj width)) - (format #t "~Theight: ~f~%" (-> obj height)) - (format #t "~Tprojection: ~f~%" (-> obj projection)) - (format #t "~Tcolor: ~D~%" (-> obj color)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tmat: #~%" (-> obj mat)) - (format #t "~Tstart-line: ~D~%" (-> obj start-line)) - (format #t "~Tscale: ~f~%" (-> obj scale)) - obj +(defmethod inspect font-context ((this font-context)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Torigin: #~%" (-> this origin)) + (format #t "~Tstrip-gif: #~%" (-> this strip-gif)) + (format #t "~Twidth: ~f~%" (-> this width)) + (format #t "~Theight: ~f~%" (-> this height)) + (format #t "~Tprojection: ~f~%" (-> this projection)) + (format #t "~Tcolor: ~D~%" (-> this color)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tmat: #~%" (-> this mat)) + (format #t "~Tstart-line: ~D~%" (-> this start-line)) + (format #t "~Tscale: ~f~%" (-> this scale)) + this ) ;; definition for method 9 of type font-context -(defmethod set-mat! font-context ((obj font-context) (mat matrix)) - (set! (-> obj mat) mat) - obj +(defmethod set-mat! font-context ((this font-context) (mat matrix)) + (set! (-> this mat) mat) + this ) ;; definition for method 10 of type font-context -(defmethod set-origin! font-context ((obj font-context) (x int) (y int)) - (set! (-> obj origin x) (the float x)) - (set! (-> obj origin y) (the float y)) - obj +(defmethod set-origin! font-context ((this font-context) (x int) (y int)) + (set! (-> this origin x) (the float x)) + (set! (-> this origin y) (the float y)) + this ) ;; definition for method 11 of type font-context -(defmethod set-depth! font-context ((obj font-context) (z int)) - (set! (-> obj origin z) (the float z)) - obj +(defmethod set-depth! font-context ((this font-context) (z int)) + (set! (-> this origin z) (the float z)) + this ) ;; definition for method 12 of type font-context -(defmethod set-w! font-context ((obj font-context) (w float)) - (set! (-> obj origin w) w) - obj +(defmethod set-w! font-context ((this font-context) (w float)) + (set! (-> this origin w) w) + this ) ;; definition for method 13 of type font-context -(defmethod set-width! font-context ((obj font-context) (width int)) - (set! (-> obj width) (the float width)) - obj +(defmethod set-width! font-context ((this font-context) (width int)) + (set! (-> this width) (the float width)) + this ) ;; definition for method 14 of type font-context -(defmethod set-height! font-context ((obj font-context) (height int)) - (set! (-> obj height) (the float height)) - obj +(defmethod set-height! font-context ((this font-context) (height int)) + (set! (-> this height) (the float height)) + this ) ;; definition for method 15 of type font-context -(defmethod set-projection! font-context ((obj font-context) (proj float)) - (set! (-> obj projection) proj) - obj +(defmethod set-projection! font-context ((this font-context) (proj float)) + (set! (-> this projection) proj) + this ) ;; definition for method 16 of type font-context -(defmethod set-color! font-context ((obj font-context) (color font-color)) - (set! (-> obj color) color) - obj +(defmethod set-color! font-context ((this font-context) (color font-color)) + (set! (-> this color) color) + this ) ;; definition for method 17 of type font-context -(defmethod set-flags! font-context ((obj font-context) (flags font-flags)) - (set! (-> obj flags) flags) - obj +(defmethod set-flags! font-context ((this font-context) (flags font-flags)) + (set! (-> this flags) flags) + this ) ;; definition for method 18 of type font-context -(defmethod set-start-line! font-context ((obj font-context) (start-line uint)) - (set! (-> obj start-line) start-line) - obj +(defmethod set-start-line! font-context ((this font-context) (start-line uint)) + (set! (-> this start-line) start-line) + this ) ;; definition for method 19 of type font-context -(defmethod set-scale! font-context ((obj font-context) (scale float)) - (set! (-> obj scale) scale) - obj +(defmethod set-scale! font-context ((this font-context) (scale float)) + (set! (-> this scale) scale) + this ) ;; definition for method 0 of type font-context @@ -175,45 +175,45 @@ (color font-color) (flags font-flags) ) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj mat) mat) - (let ((v1-3 obj)) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this mat) mat) + (let ((v1-3 this)) (set! (-> v1-3 origin x) (the float x)) (set! (-> v1-3 origin y) (the float y)) ) (cond ((= z 0.0) - (let ((v1-4 obj)) + (let ((v1-4 this)) (set! (-> v1-4 origin z) (-> *math-camera* isometric vector 3 z)) ) ) (else - (let ((v1-5 obj)) + (let ((v1-5 this)) (set! (-> v1-5 origin z) z) ) ) ) - (let ((v1-6 obj)) + (let ((v1-6 this)) (set! (-> v1-6 origin w) 1.0) ) - (let ((v1-7 obj)) + (let ((v1-7 this)) (set! (-> v1-7 width) (the float 512)) ) - (let ((v1-8 obj)) + (let ((v1-8 this)) (set! (-> v1-8 height) (the float 256)) ) - (let ((v1-9 obj)) + (let ((v1-9 this)) (set! (-> v1-9 projection) 1.0) ) - (set! (-> obj color) color) - (set! (-> obj flags) flags) - (let ((a0-4 obj)) + (set! (-> this color) color) + (set! (-> this flags) flags) + (let ((a0-4 this)) (set! (-> a0-4 start-line) (the-as uint 0)) ) - (let ((v1-13 obj)) + (let ((v1-13 this)) (set! (-> v1-13 scale) 1.0) ) - obj + this ) ) @@ -264,39 +264,39 @@ ) ;; definition for method 3 of type font-work -(defmethod inspect font-work ((obj font-work)) - (format #t "[~8x] ~A~%" obj 'font-work) - (format #t "~Tfont-tmpl: #~%" (-> obj font-tmpl)) - (format #t "~Tchar-tmpl: #~%" (-> obj char-tmpl)) - (format #t "~Ttex1-tmpl[2] @ #x~X~%" (-> obj tex1-tmpl)) - (format #t "~Tsmall-font-lo-tmpl[2] @ #x~X~%" (-> obj small-font-lo-tmpl)) - (format #t "~Tsmall-font-hi-tmpl[2] @ #x~X~%" (-> obj small-font-hi-tmpl)) - (format #t "~Tlarge-font-lo-tmpl[2] @ #x~X~%" (-> obj large-font-lo-tmpl)) - (format #t "~Tlarge-font-hi-tmpl[2] @ #x~X~%" (-> obj large-font-hi-tmpl)) - (format #t "~Tsize1-small: #~%" (-> obj size1-small)) - (format #t "~Tsize2-small: #~%" (-> obj size2-small)) - (format #t "~Tsize3-small: #~%" (-> obj size3-small)) - (format #t "~Tsize1-large: #~%" (-> obj size1-large)) - (format #t "~Tsize2-large: #~%" (-> obj size2-large)) - (format #t "~Tsize3-large: #~%" (-> obj size3-large)) - (format #t "~Tsize-st1: #~%" (-> obj size-st1)) - (format #t "~Tsize-st2: #~%" (-> obj size-st2)) - (format #t "~Tsize-st3: #~%" (-> obj size-st3)) - (format #t "~Tsave: #~%" (-> obj save)) - (format #t "~Tsave-color[4] @ #x~X~%" (-> obj save-color)) - (format #t "~Tcurrent-verts: #~%" (-> obj current-verts)) - (format #t "~Tsrc-verts: #~%" (-> obj src-verts)) - (format #t "~Tdest-verts: #~%" (-> obj dest-verts)) - (format #t "~Tjustify[64] @ #x~X~%" (-> obj justify)) - (format #t "~Tcolor-shadow: #~%" (-> obj color-shadow)) - (format #t "~Tcolor-table[64] @ #x~X~%" (-> obj color-table)) - (format #t "~Tlast-color: ~D~%" (-> obj last-color)) - (format #t "~Tsave-last-color: ~D~%" (-> obj save-last-color)) - (format #t "~Tbuf: ~A~%" (-> obj buf)) - (format #t "~Tstr-ptr: ~D~%" (-> obj str-ptr)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Treg-save[5] @ #x~X~%" (-> obj reg-save)) - obj +(defmethod inspect font-work ((this font-work)) + (format #t "[~8x] ~A~%" this 'font-work) + (format #t "~Tfont-tmpl: #~%" (-> this font-tmpl)) + (format #t "~Tchar-tmpl: #~%" (-> this char-tmpl)) + (format #t "~Ttex1-tmpl[2] @ #x~X~%" (-> this tex1-tmpl)) + (format #t "~Tsmall-font-lo-tmpl[2] @ #x~X~%" (-> this small-font-lo-tmpl)) + (format #t "~Tsmall-font-hi-tmpl[2] @ #x~X~%" (-> this small-font-hi-tmpl)) + (format #t "~Tlarge-font-lo-tmpl[2] @ #x~X~%" (-> this large-font-lo-tmpl)) + (format #t "~Tlarge-font-hi-tmpl[2] @ #x~X~%" (-> this large-font-hi-tmpl)) + (format #t "~Tsize1-small: #~%" (-> this size1-small)) + (format #t "~Tsize2-small: #~%" (-> this size2-small)) + (format #t "~Tsize3-small: #~%" (-> this size3-small)) + (format #t "~Tsize1-large: #~%" (-> this size1-large)) + (format #t "~Tsize2-large: #~%" (-> this size2-large)) + (format #t "~Tsize3-large: #~%" (-> this size3-large)) + (format #t "~Tsize-st1: #~%" (-> this size-st1)) + (format #t "~Tsize-st2: #~%" (-> this size-st2)) + (format #t "~Tsize-st3: #~%" (-> this size-st3)) + (format #t "~Tsave: #~%" (-> this save)) + (format #t "~Tsave-color[4] @ #x~X~%" (-> this save-color)) + (format #t "~Tcurrent-verts: #~%" (-> this current-verts)) + (format #t "~Tsrc-verts: #~%" (-> this src-verts)) + (format #t "~Tdest-verts: #~%" (-> this dest-verts)) + (format #t "~Tjustify[64] @ #x~X~%" (-> this justify)) + (format #t "~Tcolor-shadow: #~%" (-> this color-shadow)) + (format #t "~Tcolor-table[64] @ #x~X~%" (-> this color-table)) + (format #t "~Tlast-color: ~D~%" (-> this last-color)) + (format #t "~Tsave-last-color: ~D~%" (-> this save-last-color)) + (format #t "~Tbuf: ~A~%" (-> this buf)) + (format #t "~Tstr-ptr: ~D~%" (-> this str-ptr)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Treg-save[5] @ #x~X~%" (-> this reg-save)) + this ) ;; definition for symbol *font-work*, type font-work diff --git a/test/decompiler/reference/jak1/engine/gfx/foreground/bones-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/foreground/bones-h_REF.gc index 45e2128964..6e802a8750 100644 --- a/test/decompiler/reference/jak1/engine/gfx/foreground/bones-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/foreground/bones-h_REF.gc @@ -13,12 +13,12 @@ ) ;; definition for method 3 of type bone-buffer -(defmethod inspect bone-buffer ((obj bone-buffer)) - (format #t "[~8x] ~A~%" obj 'bone-buffer) - (format #t "~Tjoint[16] @ #x~X~%" (-> obj joint)) - (format #t "~Tbone[16] @ #x~X~%" (-> obj bone)) - (format #t "~Toutput[16] @ #x~X~%" (-> obj _pad)) - obj +(defmethod inspect bone-buffer ((this bone-buffer)) + (format #t "[~8x] ~A~%" this 'bone-buffer) + (format #t "~Tjoint[16] @ #x~X~%" (-> this joint)) + (format #t "~Tbone[16] @ #x~X~%" (-> this bone)) + (format #t "~Toutput[16] @ #x~X~%" (-> this _pad)) + this ) ;; definition of type bone-layout @@ -35,14 +35,14 @@ ) ;; definition for method 3 of type bone-layout -(defmethod inspect bone-layout ((obj bone-layout)) - (format #t "[~8x] ~A~%" obj 'bone-layout) - (format #t "~Tdata[8] @ #x~X~%" (-> obj joint)) - (format #t "~Tjoint[2] @ #x~X~%" (-> obj joint)) - (format #t "~Tbone[2] @ #x~X~%" (-> obj bone)) - (format #t "~Toutput[2] @ #x~X~%" (-> obj output)) - (format #t "~Tcache[2] @ #x~X~%" (-> obj cache)) - obj +(defmethod inspect bone-layout ((this bone-layout)) + (format #t "[~8x] ~A~%" this 'bone-layout) + (format #t "~Tdata[8] @ #x~X~%" (-> this joint)) + (format #t "~Tjoint[2] @ #x~X~%" (-> this joint)) + (format #t "~Tbone[2] @ #x~X~%" (-> this bone)) + (format #t "~Toutput[2] @ #x~X~%" (-> this output)) + (format #t "~Tcache[2] @ #x~X~%" (-> this cache)) + this ) ;; definition of type bone-regs @@ -57,12 +57,12 @@ ) ;; definition for method 3 of type bone-regs -(defmethod inspect bone-regs ((obj bone-regs)) - (format #t "[~8x] ~A~%" obj 'bone-regs) - (format #t "~Tjoint-ptr: #x~X~%" (-> obj joint-ptr)) - (format #t "~Tbone-ptr: #x~X~%" (-> obj bone-ptr)) - (format #t "~Tnum-bones: ~D~%" (-> obj num-bones)) - obj +(defmethod inspect bone-regs ((this bone-regs)) + (format #t "[~8x] ~A~%" this 'bone-regs) + (format #t "~Tjoint-ptr: #x~X~%" (-> this joint-ptr)) + (format #t "~Tbone-ptr: #x~X~%" (-> this bone-ptr)) + (format #t "~Tnum-bones: ~D~%" (-> this num-bones)) + this ) ;; definition of type bone-work @@ -88,23 +88,23 @@ ) ;; definition for method 3 of type bone-work -(defmethod inspect bone-work ((obj bone-work)) - (format #t "[~8x] ~A~%" obj 'bone-work) - (format #t "~Tlayout: #~%" (-> obj layout)) - (format #t "~Tbounds: #~%" (-> obj bounds)) - (format #t "~Tlights: #~%" (-> obj lights)) - (format #t "~Tdistance: #~%" (-> obj distance)) - (format #t "~Tnext-tag: #~%" (-> obj next-tag)) - (format #t "~Tdma-buf: ~A~%" (-> obj dma-buf)) - (format #t "~Tsink-group: ~A~%" (-> obj sink-group)) - (format #t "~Tnext-pris: #~%" (-> obj next-pris)) - (format #t "~Tnext-merc: #~%" (-> obj next-merc)) - (format #t "~Twait-count: ~D~%" (-> obj wait-count)) - (format #t "~Tin-count: ~D~%" (-> obj in-count)) - (format #t "~Tsp-size: ~D~%" (-> obj sp-size)) - (format #t "~Tsp-bufnum: ~D~%" (-> obj sp-bufnum)) - (format #t "~Tregs: #~%" (-> obj regs)) - obj +(defmethod inspect bone-work ((this bone-work)) + (format #t "[~8x] ~A~%" this 'bone-work) + (format #t "~Tlayout: #~%" (-> this layout)) + (format #t "~Tbounds: #~%" (-> this bounds)) + (format #t "~Tlights: #~%" (-> this lights)) + (format #t "~Tdistance: #~%" (-> this distance)) + (format #t "~Tnext-tag: #~%" (-> this next-tag)) + (format #t "~Tdma-buf: ~A~%" (-> this dma-buf)) + (format #t "~Tsink-group: ~A~%" (-> this sink-group)) + (format #t "~Tnext-pris: #~%" (-> this next-pris)) + (format #t "~Tnext-merc: #~%" (-> this next-merc)) + (format #t "~Twait-count: ~D~%" (-> this wait-count)) + (format #t "~Tin-count: ~D~%" (-> this in-count)) + (format #t "~Tsp-size: ~D~%" (-> this sp-size)) + (format #t "~Tsp-bufnum: ~D~%" (-> this sp-bufnum)) + (format #t "~Tregs: #~%" (-> this regs)) + this ) ;; definition of type bone-debug @@ -118,11 +118,11 @@ ) ;; definition for method 3 of type bone-debug -(defmethod inspect bone-debug ((obj bone-debug)) - (format #t "[~8x] ~A~%" obj 'bone-debug) - (format #t "~Ttime-ctr: ~D~%" (-> obj time-ctr)) - (format #t "~Ttiming[360] @ #x~X~%" (-> obj timing)) - obj +(defmethod inspect bone-debug ((this bone-debug)) + (format #t "[~8x] ~A~%" this 'bone-debug) + (format #t "~Ttime-ctr: ~D~%" (-> this time-ctr)) + (format #t "~Ttiming[360] @ #x~X~%" (-> this timing)) + this ) ;; definition of type bone-memory @@ -137,12 +137,12 @@ ) ;; definition for method 3 of type bone-memory -(defmethod inspect bone-memory ((obj bone-memory)) - (format #t "[~8x] ~A~%" obj 'bone-memory) - (format #t "~Twork: #~%" (-> obj work)) - (format #t "~Tbuffer[2] @ #x~X~%" (-> obj buffer)) - (format #t "~Tdma-list: #~%" (-> obj buffer)) - obj +(defmethod inspect bone-memory ((this bone-memory)) + (format #t "[~8x] ~A~%" this 'bone-memory) + (format #t "~Twork: #~%" (-> this work)) + (format #t "~Tbuffer[2] @ #x~X~%" (-> this buffer)) + (format #t "~Tdma-list: #~%" (-> this buffer)) + this ) ;; definition for function invalidate-cache-line @@ -170,12 +170,12 @@ ) ;; definition for method 3 of type merc-globals -(defmethod inspect merc-globals ((obj merc-globals)) - (format #t "[~8x] ~A~%" obj 'merc-globals) - (format #t "~Tfirst: #x~X~%" (-> obj first)) - (format #t "~Tnext: #x~X~%" (-> obj next)) - (format #t "~Tsink: ~A~%" (-> obj sink)) - obj +(defmethod inspect merc-globals ((this merc-globals)) + (format #t "[~8x] ~A~%" this 'merc-globals) + (format #t "~Tfirst: #x~X~%" (-> this first)) + (format #t "~Tnext: #x~X~%" (-> this next)) + (format #t "~Tsink: ~A~%" (-> this sink)) + this ) ;; definition of type merc-global-array @@ -189,11 +189,11 @@ ) ;; definition for method 3 of type merc-global-array -(defmethod inspect merc-global-array ((obj merc-global-array)) - (format #t "[~8x] ~A~%" obj 'merc-global-array) - (format #t "~Tcount: ~D~%" (-> obj count)) - (format #t "~Tglobals[8] @ #x~X~%" (-> obj globals)) - obj +(defmethod inspect merc-global-array ((this merc-global-array)) + (format #t "[~8x] ~A~%" this 'merc-global-array) + (format #t "~Tcount: ~D~%" (-> this count)) + (format #t "~Tglobals[8] @ #x~X~%" (-> this globals)) + this ) ;; definition for symbol *merc-globals*, type merc-globals @@ -213,14 +213,14 @@ ) ;; definition for method 3 of type shadow-dma-packet -(defmethod inspect shadow-dma-packet ((obj shadow-dma-packet)) - (format #t "[~8x] ~A~%" obj 'shadow-dma-packet) - (format #t "~Ttag: #~%" (-> obj tag)) - (format #t "~Tsettings: #~%" (-> obj settings)) - (format #t "~Tgeo-ref: #~%" (-> obj geo-ref)) - (format #t "~Tmtx-ref: #~%" (-> obj mtx-ref)) - (format #t "~Tend-tag: #~%" (-> obj end-tag)) - obj +(defmethod inspect shadow-dma-packet ((this shadow-dma-packet)) + (format #t "[~8x] ~A~%" this 'shadow-dma-packet) + (format #t "~Ttag: #~%" (-> this tag)) + (format #t "~Tsettings: #~%" (-> this settings)) + (format #t "~Tgeo-ref: #~%" (-> this geo-ref)) + (format #t "~Tmtx-ref: #~%" (-> this mtx-ref)) + (format #t "~Tend-tag: #~%" (-> this end-tag)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/foreground/eye-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/foreground/eye-h_REF.gc index 85349c702e..f30f111241 100644 --- a/test/decompiler/reference/jak1/engine/gfx/foreground/eye-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/foreground/eye-h_REF.gc @@ -17,16 +17,16 @@ ) ;; definition for method 3 of type eye -(defmethod inspect eye ((obj eye)) - (format #t "[~8x] ~A~%" obj 'eye) - (format #t "~Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~Tx: ~f~%" (-> obj data 0 x)) - (format #t "~Ty: ~f~%" (-> obj data 0 y)) - (format #t "~Tlid: ~f~%" (-> obj data 0 z)) - (format #t "~Tiris-scale: ~f~%" (-> obj data 1 x)) - (format #t "~Tpupil-scale: ~f~%" (-> obj data 1 y)) - (format #t "~Tlid-scale: ~f~%" (-> obj data 1 z)) - obj +(defmethod inspect eye ((this eye)) + (format #t "[~8x] ~A~%" this 'eye) + (format #t "~Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~Tx: ~f~%" (-> this data 0 x)) + (format #t "~Ty: ~f~%" (-> this data 0 y)) + (format #t "~Tlid: ~f~%" (-> this data 0 z)) + (format #t "~Tiris-scale: ~f~%" (-> this data 1 x)) + (format #t "~Tpupil-scale: ~f~%" (-> this data 1 y)) + (format #t "~Tlid-scale: ~f~%" (-> this data 1 z)) + this ) ;; definition of type eye-control @@ -45,16 +45,16 @@ ) ;; definition for method 3 of type eye-control -(defmethod inspect eye-control ((obj eye-control)) - (format #t "[~8x] ~A~%" obj 'eye-control) - (format #t "~Tprocess: ~D~%" (-> obj process)) - (format #t "~Trandom-time: ~D~%" (-> obj random-time)) - (format #t "~Tlevel: ~D~%" (-> obj level)) - (format #t "~Tblink: ~f~%" (-> obj blink)) - (format #t "~Tshaders: #x~X~%" (-> obj shaders)) - (format #t "~Tleft: #~%" (-> obj left)) - (format #t "~Tright: #~%" (-> obj right)) - obj +(defmethod inspect eye-control ((this eye-control)) + (format #t "[~8x] ~A~%" this 'eye-control) + (format #t "~Tprocess: ~D~%" (-> this process)) + (format #t "~Trandom-time: ~D~%" (-> this random-time)) + (format #t "~Tlevel: ~D~%" (-> this level)) + (format #t "~Tblink: ~f~%" (-> this blink)) + (format #t "~Tshaders: #x~X~%" (-> this shaders)) + (format #t "~Tleft: #~%" (-> this left)) + (format #t "~Tright: #~%" (-> this right)) + this ) ;; definition of type eye-control-array @@ -67,10 +67,10 @@ ) ;; definition for method 3 of type eye-control-array -(defmethod inspect eye-control-array ((obj eye-control-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdata[11] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect eye-control-array ((this eye-control-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdata[11] @ #x~X~%" (-> this data)) + this ) ;; definition of type eye-work @@ -86,13 +86,13 @@ ) ;; definition for method 3 of type eye-work -(defmethod inspect eye-work ((obj eye-work)) - (format #t "[~8x] ~A~%" obj 'eye-work) - (format #t "~Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) - (format #t "~Tsprite-tmpl2: #~%" (-> obj sprite-tmpl2)) - (format #t "~Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~Tblink-table[10] @ #x~X~%" (-> obj blink-table)) - obj +(defmethod inspect eye-work ((this eye-work)) + (format #t "[~8x] ~A~%" this 'eye-work) + (format #t "~Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~Tsprite-tmpl2: #~%" (-> this sprite-tmpl2)) + (format #t "~Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~Tblink-table[10] @ #x~X~%" (-> this blink-table)) + this ) ;; definition for symbol *eye-control-array*, type eye-control-array diff --git a/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc b/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc index 21dc60ab1a..f5f1a4d058 100644 --- a/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/foreground/ripple_REF.gc @@ -13,11 +13,11 @@ ) ;; definition for method 3 of type ripple-request -(defmethod inspect ripple-request ((obj ripple-request)) - (format #t "[~8x] ~A~%" obj 'ripple-request) - (format #t "~Twaveform: ~A~%" (-> obj waveform)) - (format #t "~Teffect: #~%" (-> obj effect)) - obj +(defmethod inspect ripple-request ((this ripple-request)) + (format #t "[~8x] ~A~%" this 'ripple-request) + (format #t "~Twaveform: ~A~%" (-> this waveform)) + (format #t "~Teffect: #~%" (-> this effect)) + this ) ;; definition of type ripple-globals @@ -31,11 +31,11 @@ ) ;; definition for method 3 of type ripple-globals -(defmethod inspect ripple-globals ((obj ripple-globals)) - (format #t "[~8x] ~A~%" obj 'ripple-globals) - (format #t "~Tcount: ~D~%" (-> obj count)) - (format #t "~Trequests[16] @ #x~X~%" (-> obj requests)) - obj +(defmethod inspect ripple-globals ((this ripple-globals)) + (format #t "[~8x] ~A~%" this 'ripple-globals) + (format #t "~Tcount: ~D~%" (-> this count)) + (format #t "~Trequests[16] @ #x~X~%" (-> this requests)) + this ) ;; definition for symbol *ripple-globals*, type ripple-globals diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/generic/generic-h_REF.gc index 71e7adb611..5dabde5697 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/generic/generic-h_REF.gc @@ -22,20 +22,20 @@ ) ;; definition for method 3 of type gsf-vertex -(defmethod inspect gsf-vertex ((obj gsf-vertex)) - (format #t "[~8x] ~A~%" obj 'gsf-vertex) - (format #t "~Tdata[8] @ #x~X~%" (-> obj data)) - (format #t "~Tbyte[32] @ #x~X~%" (-> obj data)) - (format #t "~Tquad[2] @ #x~X~%" (-> obj data)) - (format #t "~Tvt: #~%" (-> obj data)) - (format #t "~Tpos: #~%" (-> obj data)) - (format #t "~Ttex: #~%" (&-> obj vt vector4w w)) - (format #t "~Tnrm: #~%" (-> obj nrm)) - (format #t "~Tnc: #~%" (-> obj nrm)) - (format #t "~Tclr: #~%" (&-> obj nc vector4w w)) - (format #t "~Tdtex: #~%" (-> obj nrm)) - (format #t "~Tdclr: #~%" (&-> obj nrm y)) - obj +(defmethod inspect gsf-vertex ((this gsf-vertex)) + (format #t "[~8x] ~A~%" this 'gsf-vertex) + (format #t "~Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~Tbyte[32] @ #x~X~%" (-> this data)) + (format #t "~Tquad[2] @ #x~X~%" (-> this data)) + (format #t "~Tvt: #~%" (-> this data)) + (format #t "~Tpos: #~%" (-> this data)) + (format #t "~Ttex: #~%" (&-> this vt vector4w w)) + (format #t "~Tnrm: #~%" (-> this nrm)) + (format #t "~Tnc: #~%" (-> this nrm)) + (format #t "~Tclr: #~%" (&-> this nc vector4w w)) + (format #t "~Tdtex: #~%" (-> this nrm)) + (format #t "~Tdclr: #~%" (&-> this nrm y)) + this ) ;; definition of type gsf-vertex-array @@ -48,10 +48,10 @@ ) ;; definition for method 3 of type gsf-vertex-array -(defmethod inspect gsf-vertex-array ((obj gsf-vertex-array)) - (format #t "[~8x] ~A~%" obj 'gsf-vertex-array) - (format #t "~Tvtx[0] @ #x~X~%" (-> obj vtx)) - obj +(defmethod inspect gsf-vertex-array ((this gsf-vertex-array)) + (format #t "[~8x] ~A~%" this 'gsf-vertex-array) + (format #t "~Tvtx[0] @ #x~X~%" (-> this vtx)) + this ) ;; definition of type gsf-fx-vertex @@ -65,11 +65,11 @@ ) ;; definition for method 3 of type gsf-fx-vertex -(defmethod inspect gsf-fx-vertex ((obj gsf-fx-vertex)) - (format #t "[~8x] ~A~%" obj 'gsf-fx-vertex) - (format #t "~Tclr: #~%" (-> obj clr)) - (format #t "~Ttex: #~%" (-> obj tex)) - obj +(defmethod inspect gsf-fx-vertex ((this gsf-fx-vertex)) + (format #t "[~8x] ~A~%" this 'gsf-fx-vertex) + (format #t "~Tclr: #~%" (-> this clr)) + (format #t "~Ttex: #~%" (-> this tex)) + this ) ;; definition of type gsf-fx-vertex-array @@ -82,10 +82,10 @@ ) ;; definition for method 3 of type gsf-fx-vertex-array -(defmethod inspect gsf-fx-vertex-array ((obj gsf-fx-vertex-array)) - (format #t "[~8x] ~A~%" obj 'gsf-fx-vertex-array) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect gsf-fx-vertex-array ((this gsf-fx-vertex-array)) + (format #t "[~8x] ~A~%" this 'gsf-fx-vertex-array) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; definition of type gsf-header @@ -102,14 +102,14 @@ ) ;; definition for method 3 of type gsf-header -(defmethod inspect gsf-header ((obj gsf-header)) - (format #t "[~8x] ~A~%" obj 'gsf-header) - (format #t "~Tnum-strips: ~D~%" (-> obj num-strips)) - (format #t "~Texpanded: ~D~%" (-> obj expanded)) - (format #t "~Tnum-dps: ~D~%" (-> obj num-dps)) - (format #t "~Tnum-vtxs: ~D~%" (-> obj num-vtxs)) - (format #t "~Tstrip-table[10] @ #x~X~%" (-> obj strip-table)) - obj +(defmethod inspect gsf-header ((this gsf-header)) + (format #t "[~8x] ~A~%" this 'gsf-header) + (format #t "~Tnum-strips: ~D~%" (-> this num-strips)) + (format #t "~Texpanded: ~D~%" (-> this expanded)) + (format #t "~Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~Tnum-vtxs: ~D~%" (-> this num-vtxs)) + (format #t "~Tstrip-table[10] @ #x~X~%" (-> this strip-table)) + this ) ;; definition of type gsf-ik @@ -123,11 +123,11 @@ ) ;; definition for method 3 of type gsf-ik -(defmethod inspect gsf-ik ((obj gsf-ik)) - (format #t "[~8x] ~A~%" obj 'gsf-ik) - (format #t "~Tindex: ~D~%" (-> obj index)) - (format #t "~Tno-kick: ~D~%" (-> obj no-kick)) - obj +(defmethod inspect gsf-ik ((this gsf-ik)) + (format #t "[~8x] ~A~%" this 'gsf-ik) + (format #t "~Tindex: ~D~%" (-> this index)) + (format #t "~Tno-kick: ~D~%" (-> this no-kick)) + this ) ;; definition of type gsf-info @@ -143,13 +143,13 @@ ) ;; definition for method 3 of type gsf-info -(defmethod inspect gsf-info ((obj gsf-info)) - (format #t "[~8x] ~A~%" obj 'gsf-info) - (format #t "~Tptr-iks: #x~X~%" (-> obj ptr-iks)) - (format #t "~Tptr-verts: #x~X~%" (-> obj ptr-verts)) - (format #t "~Tptr-fx: #x~X~%" (-> obj ptr-fx)) - (format #t "~Tdummy2: ~D~%" (-> obj dummy2)) - obj +(defmethod inspect gsf-info ((this gsf-info)) + (format #t "[~8x] ~A~%" this 'gsf-info) + (format #t "~Tptr-iks: #x~X~%" (-> this ptr-iks)) + (format #t "~Tptr-verts: #x~X~%" (-> this ptr-verts)) + (format #t "~Tptr-fx: #x~X~%" (-> this ptr-fx)) + (format #t "~Tdummy2: ~D~%" (-> this dummy2)) + this ) ;; definition of type gsf-buffer @@ -165,13 +165,13 @@ ) ;; definition for method 3 of type gsf-buffer -(defmethod inspect gsf-buffer ((obj gsf-buffer)) - (format #t "[~8x] ~A~%" obj 'gsf-buffer) - (format #t "~Tdata[8192] @ #x~X~%" (-> obj data)) - (format #t "~Tinfo: #~%" (-> obj data)) - (format #t "~Theader: #~%" (-> obj header)) - (format #t "~Twork-area[0] @ #x~X~%" (-> obj work-area)) - obj +(defmethod inspect gsf-buffer ((this gsf-buffer)) + (format #t "[~8x] ~A~%" this 'gsf-buffer) + (format #t "~Tdata[8192] @ #x~X~%" (-> this data)) + (format #t "~Tinfo: #~%" (-> this data)) + (format #t "~Theader: #~%" (-> this header)) + (format #t "~Twork-area[0] @ #x~X~%" (-> this work-area)) + this ) ;; definition of type generic-frag @@ -185,11 +185,11 @@ ) ;; definition for method 3 of type generic-frag -(defmethod inspect generic-frag ((obj generic-frag)) - (format #t "[~8x] ~A~%" obj 'generic-frag) - (format #t "~Tstart-pos: ~D~%" (-> obj start-pos)) - (format #t "~Tend-pos: ~D~%" (-> obj end-pos)) - obj +(defmethod inspect generic-frag ((this generic-frag)) + (format #t "[~8x] ~A~%" this 'generic-frag) + (format #t "~Tstart-pos: ~D~%" (-> this start-pos)) + (format #t "~Tend-pos: ~D~%" (-> this end-pos)) + this ) ;; definition of type generic-strip @@ -203,11 +203,11 @@ ) ;; definition for method 3 of type generic-strip -(defmethod inspect generic-strip ((obj generic-strip)) - (format #t "[~8x] ~A~%" obj 'generic-strip) - (format #t "~Tpos: ~D~%" (-> obj pos)) - (format #t "~Tlen: ~D~%" (-> obj len)) - obj +(defmethod inspect generic-strip ((this generic-strip)) + (format #t "[~8x] ~A~%" this 'generic-strip) + (format #t "~Tpos: ~D~%" (-> this pos)) + (format #t "~Tlen: ~D~%" (-> this len)) + this ) ;; definition of type generic-envmap-saves @@ -222,12 +222,12 @@ ) ;; definition for method 3 of type generic-envmap-saves -(defmethod inspect generic-envmap-saves ((obj generic-envmap-saves)) - (format #t "[~8x] ~A~%" obj 'generic-envmap-saves) - (format #t "~Tindex-mask: #~%" (-> obj index-mask)) - (format #t "~Tverts[12] @ #x~X~%" (-> obj verts)) - (format #t "~Tkicks[4] @ #x~X~%" (-> obj kicks)) - obj +(defmethod inspect generic-envmap-saves ((this generic-envmap-saves)) + (format #t "[~8x] ~A~%" this 'generic-envmap-saves) + (format #t "~Tindex-mask: #~%" (-> this index-mask)) + (format #t "~Tverts[12] @ #x~X~%" (-> this verts)) + (format #t "~Tkicks[4] @ #x~X~%" (-> this kicks)) + this ) ;; definition of type generic-interp-job @@ -247,16 +247,16 @@ ) ;; definition for method 3 of type generic-interp-job -(defmethod inspect generic-interp-job ((obj generic-interp-job)) - (format #t "[~8x] ~A~%" obj 'generic-interp-job) - (format #t "~Tjob-type: ~D~%" (-> obj job-type)) - (format #t "~Tnum: ~D~%" (-> obj num)) - (format #t "~Tfirst: ~D~%" (-> obj first)) - (format #t "~Tpad: ~D~%" (-> obj pad)) - (format #t "~Tptr-data: #x~X~%" (-> obj ptr-data)) - (format #t "~Tmorph-z: ~D~%" (-> obj morph-z)) - (format #t "~Tmorph-w: ~D~%" (-> obj morph-w)) - obj +(defmethod inspect generic-interp-job ((this generic-interp-job)) + (format #t "[~8x] ~A~%" this 'generic-interp-job) + (format #t "~Tjob-type: ~D~%" (-> this job-type)) + (format #t "~Tnum: ~D~%" (-> this num)) + (format #t "~Tfirst: ~D~%" (-> this first)) + (format #t "~Tpad: ~D~%" (-> this pad)) + (format #t "~Tptr-data: #x~X~%" (-> this ptr-data)) + (format #t "~Tmorph-z: ~D~%" (-> this morph-z)) + (format #t "~Tmorph-w: ~D~%" (-> this morph-w)) + this ) ;; definition of type generic-saves @@ -293,34 +293,34 @@ ) ;; definition for method 3 of type generic-saves -(defmethod inspect generic-saves ((obj generic-saves)) - (format #t "[~8x] ~A~%" obj 'generic-saves) - (format #t "~Tptr-dma: #x~X~%" (-> obj ptr-dma)) - (format #t "~Tptr-vtxs: #x~X~%" (-> obj ptr-vtxs)) - (format #t "~Tptr-clrs: #x~X~%" (-> obj ptr-clrs)) - (format #t "~Tptr-texs: #x~X~%" (-> obj ptr-texs)) - (format #t "~Tptr-env-clrs: #x~X~%" (-> obj ptr-env-clrs)) - (format #t "~Tptr-env-texs: #x~X~%" (-> obj ptr-env-texs)) - (format #t "~Tcur-outbuf: #x~X~%" (-> obj cur-outbuf)) - (format #t "~Tptr-fx-buf: ~D~%" (-> obj ptr-fx-buf)) - (format #t "~Txor-outbufs: ~D~%" (-> obj xor-outbufs)) - (format #t "~Tnum-dps: ~D~%" (-> obj num-dps)) - (format #t "~Tqwc: ~D~%" (-> obj qwc)) - (format #t "~Tgsf-buf: #~%" (-> obj gsf-buf)) - (format #t "~Tptr-shaders: #x~X~%" (-> obj ptr-shaders)) - (format #t "~Tptr-env-shader: ~D~%" (-> obj ptr-env-shader)) - (format #t "~Tis-envmap: ~D~%" (-> obj is-envmap)) - (format #t "~Tbasep: #x~X~%" (-> obj basep)) - (format #t "~Tptr-interp-job: #~%" (-> obj ptr-interp-job)) - (format #t "~Tgifbuf-adr: ~D~%" (-> obj gifbuf-adr)) - (format #t "~Tinbuf-adr: ~D~%" (-> obj inbuf-adr)) - (format #t "~Tfade-val: ~D~%" (-> obj fade-val)) - (format #t "~Ttime-of-day-color: ~D~%" (-> obj time-of-day-color)) - (format #t "~Tto-vu0-waits: ~D~%" (-> obj to-vu0-waits)) - (format #t "~Tto-spr-waits: ~D~%" (-> obj to-spr-waits)) - (format #t "~Tfrom-spr-waits: ~D~%" (-> obj from-spr-waits)) - (format #t "~Tenvmap: #~%" (-> obj envmap)) - obj +(defmethod inspect generic-saves ((this generic-saves)) + (format #t "[~8x] ~A~%" this 'generic-saves) + (format #t "~Tptr-dma: #x~X~%" (-> this ptr-dma)) + (format #t "~Tptr-vtxs: #x~X~%" (-> this ptr-vtxs)) + (format #t "~Tptr-clrs: #x~X~%" (-> this ptr-clrs)) + (format #t "~Tptr-texs: #x~X~%" (-> this ptr-texs)) + (format #t "~Tptr-env-clrs: #x~X~%" (-> this ptr-env-clrs)) + (format #t "~Tptr-env-texs: #x~X~%" (-> this ptr-env-texs)) + (format #t "~Tcur-outbuf: #x~X~%" (-> this cur-outbuf)) + (format #t "~Tptr-fx-buf: ~D~%" (-> this ptr-fx-buf)) + (format #t "~Txor-outbufs: ~D~%" (-> this xor-outbufs)) + (format #t "~Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~Tqwc: ~D~%" (-> this qwc)) + (format #t "~Tgsf-buf: #~%" (-> this gsf-buf)) + (format #t "~Tptr-shaders: #x~X~%" (-> this ptr-shaders)) + (format #t "~Tptr-env-shader: ~D~%" (-> this ptr-env-shader)) + (format #t "~Tis-envmap: ~D~%" (-> this is-envmap)) + (format #t "~Tbasep: #x~X~%" (-> this basep)) + (format #t "~Tptr-interp-job: #~%" (-> this ptr-interp-job)) + (format #t "~Tgifbuf-adr: ~D~%" (-> this gifbuf-adr)) + (format #t "~Tinbuf-adr: ~D~%" (-> this inbuf-adr)) + (format #t "~Tfade-val: ~D~%" (-> this fade-val)) + (format #t "~Ttime-of-day-color: ~D~%" (-> this time-of-day-color)) + (format #t "~Tto-vu0-waits: ~D~%" (-> this to-vu0-waits)) + (format #t "~Tto-spr-waits: ~D~%" (-> this to-spr-waits)) + (format #t "~Tfrom-spr-waits: ~D~%" (-> this from-spr-waits)) + (format #t "~Tenvmap: #~%" (-> this envmap)) + this ) ;; definition of type generic-gif-tag @@ -338,15 +338,15 @@ ) ;; definition for method 3 of type generic-gif-tag -(defmethod inspect generic-gif-tag ((obj generic-gif-tag)) - (format #t "[~8x] ~A~%" obj 'generic-gif-tag) - (format #t "~Tdata[4] @ #x~X~%" (&-> obj fan-prim)) - (format #t "~Tqword: #~%" (&-> obj fan-prim)) - (format #t "~Tfan-prim: ~D~%" (-> obj fan-prim)) - (format #t "~Tstr-prim: ~D~%" (-> obj str-prim)) - (format #t "~Tregs: ~D~%" (-> obj regs)) - (format #t "~Tnum-strips: ~D~%" (-> obj num-strips)) - obj +(defmethod inspect generic-gif-tag ((this generic-gif-tag)) + (format #t "[~8x] ~A~%" this 'generic-gif-tag) + (format #t "~Tdata[4] @ #x~X~%" (&-> this fan-prim)) + (format #t "~Tqword: #~%" (&-> this fan-prim)) + (format #t "~Tfan-prim: ~D~%" (-> this fan-prim)) + (format #t "~Tstr-prim: ~D~%" (-> this str-prim)) + (format #t "~Tregs: ~D~%" (-> this regs)) + (format #t "~Tnum-strips: ~D~%" (-> this num-strips)) + this ) ;; definition of type ad-cmd @@ -368,18 +368,18 @@ ;; definition for method 3 of type ad-cmd ;; INFO: Used lq/sq -(defmethod inspect ad-cmd ((obj ad-cmd)) - (format #t "[~8x] ~A~%" obj 'ad-cmd) - (format #t "~Tword[4] @ #x~X~%" (&-> obj data)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - (format #t "~Tdata: ~D~%" (-> obj data)) - (format #t "~Tcmds: ~D~%" (-> obj cmds)) - (format #t "~Tcmd: ~D~%" (-> obj cmd)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - (format #t "~Tw: ~D~%" (-> obj w)) - obj +(defmethod inspect ad-cmd ((this ad-cmd)) + (format #t "[~8x] ~A~%" this 'ad-cmd) + (format #t "~Tword[4] @ #x~X~%" (&-> this data)) + (format #t "~Tquad: ~D~%" (-> this quad)) + (format #t "~Tdata: ~D~%" (-> this data)) + (format #t "~Tcmds: ~D~%" (-> this cmds)) + (format #t "~Tcmd: ~D~%" (-> this cmd)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + (format #t "~Tw: ~D~%" (-> this w)) + this ) ;; definition of type generic-envmap-consts @@ -395,13 +395,13 @@ ) ;; definition for method 3 of type generic-envmap-consts -(defmethod inspect generic-envmap-consts ((obj generic-envmap-consts)) - (format #t "[~8x] ~A~%" obj 'generic-envmap-consts) - (format #t "~Tconsts: #~%" (-> obj consts)) - (format #t "~Tstrgif: #~%" (-> obj strgif)) - (format #t "~Tcolors: #~%" (-> obj colors)) - (format #t "~Tshader: #~%" (-> obj shader)) - obj +(defmethod inspect generic-envmap-consts ((this generic-envmap-consts)) + (format #t "[~8x] ~A~%" this 'generic-envmap-consts) + (format #t "~Tconsts: #~%" (-> this consts)) + (format #t "~Tstrgif: #~%" (-> this strgif)) + (format #t "~Tcolors: #~%" (-> this colors)) + (format #t "~Tshader: #~%" (-> this shader)) + this ) ;; definition of type generic-consts @@ -437,33 +437,33 @@ ) ;; definition for method 3 of type generic-consts -(defmethod inspect generic-consts ((obj generic-consts)) - (format #t "[~8x] ~A~%" obj 'generic-consts) - (format #t "~Tdma-header: #~%" (-> obj dma-header)) - (format #t "~Tvif-header[4] @ #x~X~%" (-> obj vif-header)) - (format #t "~Tdma-ref-vtxs: #~%" (-> obj dma-ref-vtxs)) - (format #t "~Tdma-cnt-call: #~%" (-> obj dma-cnt-call)) - (format #t "~Tmatrix: #~%" (-> obj matrix)) - (format #t "~Tbase-strgif: #~%" (-> obj base-strgif)) - (format #t "~Talpha-opaque: #~%" (-> obj alpha-opaque)) - (format #t "~Talpha-translucent: #~%" (-> obj alpha-translucent)) - (format #t "~Tztest-normal: #~%" (-> obj ztest-normal)) - (format #t "~Tztest-opaque: #~%" (-> obj ztest-opaque)) - (format #t "~Tadcmd-offsets[16] @ #x~X~%" (-> obj adcmd-offsets)) - (format #t "~Tadcmds[4] @ #x~X~%" (-> obj alpha-opaque)) - (format #t "~Tstcycle-tag: ~D~%" (-> obj stcycle-tag)) - (format #t "~Tunpack-vtx-tag: ~D~%" (-> obj unpack-vtx-tag)) - (format #t "~Tunpack-clr-tag: ~D~%" (-> obj unpack-clr-tag)) - (format #t "~Tunpack-tex-tag: ~D~%" (-> obj unpack-tex-tag)) - (format #t "~Tmscal-tag: ~D~%" (-> obj mscal-tag)) - (format #t "~Tflush-tag: ~D~%" (-> obj flush-tag)) - (format #t "~Treset-cycle-tag: ~D~%" (-> obj reset-cycle-tag)) - (format #t "~Tdummy0: ~D~%" (-> obj dummy0)) - (format #t "~Tdma-tag-cnt: ~D~%" (-> obj dma-tag-cnt)) - (format #t "~Tenvmap: #~%" (-> obj envmap)) - (format #t "~Tlight-consts: #~%" (-> obj light-consts)) - (format #t "~Ttexture-offset[8] @ #x~X~%" (-> obj texture-offset)) - obj +(defmethod inspect generic-consts ((this generic-consts)) + (format #t "[~8x] ~A~%" this 'generic-consts) + (format #t "~Tdma-header: #~%" (-> this dma-header)) + (format #t "~Tvif-header[4] @ #x~X~%" (-> this vif-header)) + (format #t "~Tdma-ref-vtxs: #~%" (-> this dma-ref-vtxs)) + (format #t "~Tdma-cnt-call: #~%" (-> this dma-cnt-call)) + (format #t "~Tmatrix: #~%" (-> this matrix)) + (format #t "~Tbase-strgif: #~%" (-> this base-strgif)) + (format #t "~Talpha-opaque: #~%" (-> this alpha-opaque)) + (format #t "~Talpha-translucent: #~%" (-> this alpha-translucent)) + (format #t "~Tztest-normal: #~%" (-> this ztest-normal)) + (format #t "~Tztest-opaque: #~%" (-> this ztest-opaque)) + (format #t "~Tadcmd-offsets[16] @ #x~X~%" (-> this adcmd-offsets)) + (format #t "~Tadcmds[4] @ #x~X~%" (-> this alpha-opaque)) + (format #t "~Tstcycle-tag: ~D~%" (-> this stcycle-tag)) + (format #t "~Tunpack-vtx-tag: ~D~%" (-> this unpack-vtx-tag)) + (format #t "~Tunpack-clr-tag: ~D~%" (-> this unpack-clr-tag)) + (format #t "~Tunpack-tex-tag: ~D~%" (-> this unpack-tex-tag)) + (format #t "~Tmscal-tag: ~D~%" (-> this mscal-tag)) + (format #t "~Tflush-tag: ~D~%" (-> this flush-tag)) + (format #t "~Treset-cycle-tag: ~D~%" (-> this reset-cycle-tag)) + (format #t "~Tdummy0: ~D~%" (-> this dummy0)) + (format #t "~Tdma-tag-cnt: ~D~%" (-> this dma-tag-cnt)) + (format #t "~Tenvmap: #~%" (-> this envmap)) + (format #t "~Tlight-consts: #~%" (-> this light-consts)) + (format #t "~Ttexture-offset[8] @ #x~X~%" (-> this texture-offset)) + this ) ;; definition of type generic-storage @@ -476,10 +476,10 @@ ) ;; definition for method 3 of type generic-storage -(defmethod inspect generic-storage ((obj generic-storage)) - (format #t "[~8x] ~A~%" obj 'generic-storage) - (format #t "~Tdata[16] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect generic-storage ((this generic-storage)) + (format #t "[~8x] ~A~%" this 'generic-storage) + (format #t "~Tdata[16] @ #x~X~%" (-> this data)) + this ) ;; definition for symbol *gsf-buffer*, type gsf-buffer diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc b/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc index 38bf11b0d1..d698b4045f 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/generic/generic-merc_REF.gc @@ -17,12 +17,12 @@ ) ;; definition for method 3 of type invinitdata -(defmethod inspect invinitdata ((obj invinitdata)) - (format #t "[~8x] ~A~%" obj 'invinitdata) - (format #t "~Tcount: ~D~%" (-> obj count)) - (format #t "~Tinit-data: ~D~%" (-> obj init-data)) - (format #t "~Tinit-addr: ~D~%" (-> obj init-addr)) - obj +(defmethod inspect invinitdata ((this invinitdata)) + (format #t "[~8x] ~A~%" this 'invinitdata) + (format #t "~Tcount: ~D~%" (-> this count)) + (format #t "~Tinit-data: ~D~%" (-> this init-data)) + (format #t "~Tinit-addr: ~D~%" (-> this init-addr)) + this ) ;; definition for symbol *inv-init-table*, type (inline-array invinitdata) @@ -77,7 +77,6 @@ ;; definition for function generic-merc-execute-all ;; INFO: Return type mismatch profile-frame vs none. -;; WARN: Failed store: (s.w! (the-as int a0-19) a1-7) at op 109 ;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin v1, 0] ;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin v1, 1] (defun generic-merc-execute-all ((arg0 dma-buffer)) diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1-h_REF.gc index 7ddc504a74..d6a093b1ae 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/generic/generic-vu1-h_REF.gc @@ -15,14 +15,14 @@ ) ;; definition for method 3 of type pris-mtx -(defmethod inspect pris-mtx ((obj pris-mtx)) - (format #t "[~8x] ~A~%" obj 'pris-mtx) - (format #t "~Tdata[32] @ #x~X~%" (-> obj t-mtx)) - (format #t "~Tvector[8] @ #x~X~%" (-> obj t-mtx)) - (format #t "~Tt-mtx: #~%" (-> obj t-mtx)) - (format #t "~Tn-mtx: #~%" (-> obj n-mtx)) - (format #t "~Tscale: #~%" (-> obj scale)) - obj +(defmethod inspect pris-mtx ((this pris-mtx)) + (format #t "[~8x] ~A~%" this 'pris-mtx) + (format #t "~Tdata[32] @ #x~X~%" (-> this t-mtx)) + (format #t "~Tvector[8] @ #x~X~%" (-> this t-mtx)) + (format #t "~Tt-mtx: #~%" (-> this t-mtx)) + (format #t "~Tn-mtx: #~%" (-> this n-mtx)) + (format #t "~Tscale: #~%" (-> this scale)) + this ) ;; definition of type generic-pris-mtx-save @@ -37,12 +37,12 @@ ) ;; definition for method 3 of type generic-pris-mtx-save -(defmethod inspect generic-pris-mtx-save ((obj generic-pris-mtx-save)) - (format #t "[~8x] ~A~%" obj 'generic-pris-mtx-save) - (format #t "~Tloc-mtx: #~%" (-> obj loc-mtx)) - (format #t "~Tpar-mtx: #~%" (-> obj par-mtx)) - (format #t "~Tdif-mtx: #~%" (-> obj dif-mtx)) - obj +(defmethod inspect generic-pris-mtx-save ((this generic-pris-mtx-save)) + (format #t "[~8x] ~A~%" this 'generic-pris-mtx-save) + (format #t "~Tloc-mtx: #~%" (-> this loc-mtx)) + (format #t "~Tpar-mtx: #~%" (-> this par-mtx)) + (format #t "~Tdif-mtx: #~%" (-> this dif-mtx)) + this ) ;; definition of type generic-constants @@ -64,19 +64,19 @@ ) ;; definition for method 3 of type generic-constants -(defmethod inspect generic-constants ((obj generic-constants)) - (format #t "[~8x] ~A~%" obj 'generic-constants) - (format #t "~Tfog: #~%" (-> obj fog)) - (format #t "~Tadgif: #~%" (-> obj adgif)) - (format #t "~Tgiftag: #~%" (-> obj giftag)) - (format #t "~Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~Tinvh-scale: #~%" (-> obj invh-scale)) - (format #t "~Tguard: #~%" (-> obj guard)) - (format #t "~Tadnop: #~%" (-> obj adnop)) - (format #t "~Tflush: #~%" (-> obj flush)) - (format #t "~Tstores: #~%" (-> obj stores)) - obj +(defmethod inspect generic-constants ((this generic-constants)) + (format #t "[~8x] ~A~%" this 'generic-constants) + (format #t "~Tfog: #~%" (-> this fog)) + (format #t "~Tadgif: #~%" (-> this adgif)) + (format #t "~Tgiftag: #~%" (-> this giftag)) + (format #t "~Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~Tinvh-scale: #~%" (-> this invh-scale)) + (format #t "~Tguard: #~%" (-> this guard)) + (format #t "~Tadnop: #~%" (-> this adnop)) + (format #t "~Tflush: #~%" (-> this flush)) + (format #t "~Tstores: #~%" (-> this stores)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-work-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/generic/generic-work-h_REF.gc index 50d8937685..4f90407f06 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-work-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/generic/generic-work-h_REF.gc @@ -13,12 +13,12 @@ ) ;; definition for method 3 of type generic-input-buffer -(defmethod inspect generic-input-buffer ((obj generic-input-buffer)) - (format #t "[~8x] ~A~%" obj 'generic-input-buffer) - (format #t "~Tdata[472] @ #x~X~%" (-> obj merc)) - (format #t "~Tmerc: #~%" (-> obj merc)) - (format #t "~Ttie: #~%" (-> obj merc)) - obj +(defmethod inspect generic-input-buffer ((this generic-input-buffer)) + (format #t "[~8x] ~A~%" this 'generic-input-buffer) + (format #t "~Tdata[472] @ #x~X~%" (-> this merc)) + (format #t "~Tmerc: #~%" (-> this merc)) + (format #t "~Ttie: #~%" (-> this merc)) + this ) ;; definition of type generic-debug @@ -37,16 +37,16 @@ ) ;; definition for method 3 of type generic-debug -(defmethod inspect generic-debug ((obj generic-debug)) - (format #t "[~8x] ~A~%" obj 'generic-debug) - (format #t "~Tlocks[4] @ #x~X~%" (-> obj locks)) - (format #t "~Ttimer[32] @ #x~X~%" (-> obj timer)) - (format #t "~Tcount[32] @ #x~X~%" (-> obj count)) - (format #t "~Tvps[32] @ #x~X~%" (-> obj vps)) - (format #t "~Tbuffer: ~D~%" (-> obj buffer)) - (format #t "~Tstart-addr: ~D~%" (-> obj start-addr)) - (format #t "~Tlock: ~D~%" (-> obj lock)) - obj +(defmethod inspect generic-debug ((this generic-debug)) + (format #t "[~8x] ~A~%" this 'generic-debug) + (format #t "~Tlocks[4] @ #x~X~%" (-> this locks)) + (format #t "~Ttimer[32] @ #x~X~%" (-> this timer)) + (format #t "~Tcount[32] @ #x~X~%" (-> this count)) + (format #t "~Tvps[32] @ #x~X~%" (-> this vps)) + (format #t "~Tbuffer: ~D~%" (-> this buffer)) + (format #t "~Tstart-addr: ~D~%" (-> this start-addr)) + (format #t "~Tlock: ~D~%" (-> this lock)) + this ) ;; definition of type generic-vu1-header @@ -66,17 +66,17 @@ ) ;; definition for method 3 of type generic-vu1-header -(defmethod inspect generic-vu1-header ((obj generic-vu1-header)) - (format #t "[~8x] ~A~%" obj 'generic-vu1-header) - (format #t "~Tmatrix: #~%" (-> obj matrix)) - (format #t "~Tstrgif: #~%" (-> obj strgif)) - (format #t "~Tadcmds[2] @ #x~X~%" (-> obj adnop1)) - (format #t "~Tadnop1: #~%" (-> obj adnop1)) - (format #t "~Tadnop2: #~%" (-> obj adnop2)) - (format #t "~Tdps: ~D~%" (-> obj dps)) - (format #t "~Tkickoff: ~D~%" (-> obj kickoff)) - (format #t "~Tstrips: ~D~%" (-> obj strips)) - obj +(defmethod inspect generic-vu1-header ((this generic-vu1-header)) + (format #t "[~8x] ~A~%" this 'generic-vu1-header) + (format #t "~Tmatrix: #~%" (-> this matrix)) + (format #t "~Tstrgif: #~%" (-> this strgif)) + (format #t "~Tadcmds[2] @ #x~X~%" (-> this adnop1)) + (format #t "~Tadnop1: #~%" (-> this adnop1)) + (format #t "~Tadnop2: #~%" (-> this adnop2)) + (format #t "~Tdps: ~D~%" (-> this dps)) + (format #t "~Tkickoff: ~D~%" (-> this kickoff)) + (format #t "~Tstrips: ~D~%" (-> this strips)) + this ) ;; definition of type generic-vu1-texbuf @@ -90,11 +90,11 @@ ) ;; definition for method 3 of type generic-vu1-texbuf -(defmethod inspect generic-vu1-texbuf ((obj generic-vu1-texbuf)) - (format #t "[~8x] ~A~%" obj 'generic-vu1-texbuf) - (format #t "~Theader: #~%" (-> obj header)) - (format #t "~Tshader[0] @ #x~X~%" (-> obj shader)) - obj +(defmethod inspect generic-vu1-texbuf ((this generic-vu1-texbuf)) + (format #t "[~8x] ~A~%" this 'generic-vu1-texbuf) + (format #t "~Theader: #~%" (-> this header)) + (format #t "~Tshader[0] @ #x~X~%" (-> this shader)) + this ) ;; definition of type generic-texbuf @@ -109,12 +109,12 @@ ) ;; definition for method 3 of type generic-texbuf -(defmethod inspect generic-texbuf ((obj generic-texbuf)) - (format #t "[~8x] ~A~%" obj 'generic-texbuf) - (format #t "~Ttag: #~%" (-> obj tag)) - (format #t "~Theader: #~%" (-> obj header)) - (format #t "~Tshader[0] @ #x~X~%" (-> obj shader)) - obj +(defmethod inspect generic-texbuf ((this generic-texbuf)) + (format #t "[~8x] ~A~%" this 'generic-texbuf) + (format #t "~Ttag: #~%" (-> this tag)) + (format #t "~Theader: #~%" (-> this header)) + (format #t "~Tshader[0] @ #x~X~%" (-> this shader)) + this ) ;; definition of type generic-effect-work @@ -130,13 +130,13 @@ ) ;; definition for method 3 of type generic-effect-work -(defmethod inspect generic-effect-work ((obj generic-effect-work)) - (format #t "[~8x] ~A~%" obj 'generic-effect-work) - (format #t "~Tconsts: #~%" (-> obj consts)) - (format #t "~Tstorage: #~%" (-> obj storage)) - (format #t "~Tstorage2: #~%" (-> obj storage2)) - (format #t "~Tlights: #~%" (-> obj lights)) - obj +(defmethod inspect generic-effect-work ((this generic-effect-work)) + (format #t "[~8x] ~A~%" this 'generic-effect-work) + (format #t "~Tconsts: #~%" (-> this consts)) + (format #t "~Tstorage: #~%" (-> this storage)) + (format #t "~Tstorage2: #~%" (-> this storage2)) + (format #t "~Tlights: #~%" (-> this lights)) + this ) ;; definition of type generic-effect-buffer @@ -151,12 +151,12 @@ ) ;; definition for method 3 of type generic-effect-buffer -(defmethod inspect generic-effect-buffer ((obj generic-effect-buffer)) - (format #t "[~8x] ~A~%" obj 'generic-effect-buffer) - (format #t "~Toutbuf-0[3552] @ #x~X~%" (-> obj outbuf-0)) - (format #t "~Twork: #~%" (-> obj work)) - (format #t "~Toutbuf-1[3552] @ #x~X~%" (-> obj outbuf-1)) - obj +(defmethod inspect generic-effect-buffer ((this generic-effect-buffer)) + (format #t "[~8x] ~A~%" this 'generic-effect-buffer) + (format #t "~Toutbuf-0[3552] @ #x~X~%" (-> this outbuf-0)) + (format #t "~Twork: #~%" (-> this work)) + (format #t "~Toutbuf-1[3552] @ #x~X~%" (-> this outbuf-1)) + this ) ;; definition of type generic-work @@ -172,13 +172,13 @@ ) ;; definition for method 3 of type generic-work -(defmethod inspect generic-work ((obj generic-work)) - (format #t "[~8x] ~A~%" obj 'generic-work) - (format #t "~Tsaves: #~%" (-> obj saves)) - (format #t "~Tstorage: #~%" (-> obj storage)) - (format #t "~Tin-buf: #~%" (-> obj in-buf)) - (format #t "~Tfx-buf: #~%" (-> obj fx-buf)) - obj +(defmethod inspect generic-work ((this generic-work)) + (format #t "[~8x] ~A~%" this 'generic-work) + (format #t "~Tsaves: #~%" (-> this saves)) + (format #t "~Tstorage: #~%" (-> this storage)) + (format #t "~Tin-buf: #~%" (-> this in-buf)) + (format #t "~Tfx-buf: #~%" (-> this fx-buf)) + this ) ;; definition for symbol *generic-debug*, type generic-debug diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/display-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/display-h_REF.gc index 894e0f5cc0..bd88bf5d80 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/display-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/display-h_REF.gc @@ -16,14 +16,14 @@ ) ;; definition for method 3 of type display-env -(defmethod inspect display-env ((obj display-env)) - (format #t "[~8x] ~A~%" obj 'display-env) - (format #t "~Tpmode: #x~X~%" (-> obj pmode)) - (format #t "~Tsmode2: #x~X~%" (-> obj smode2)) - (format #t "~Tdspfb: #x~X~%" (-> obj dspfb)) - (format #t "~Tdisplay: #x~X~%" (-> obj display)) - (format #t "~Tbgcolor: #x~X~%" (-> obj bgcolor)) - obj +(defmethod inspect display-env ((this display-env)) + (format #t "[~8x] ~A~%" this 'display-env) + (format #t "~Tpmode: #x~X~%" (-> this pmode)) + (format #t "~Tsmode2: #x~X~%" (-> this smode2)) + (format #t "~Tdspfb: #x~X~%" (-> this dspfb)) + (format #t "~Tdisplay: #x~X~%" (-> this display)) + (format #t "~Tbgcolor: #x~X~%" (-> this bgcolor)) + this ) ;; definition of type draw-env @@ -51,25 +51,25 @@ ) ;; definition for method 3 of type draw-env -(defmethod inspect draw-env ((obj draw-env)) - (format #t "[~8x] ~A~%" obj 'draw-env) - (format #t "~Tframe1: #x~X~%" (-> obj frame1)) - (format #t "~Tframe1addr: #x~X~%" (-> obj frame1addr)) - (format #t "~Tzbuf1: #x~X~%" (-> obj zbuf1)) - (format #t "~Tzbuf1addr: #x~X~%" (-> obj zbuf1addr)) - (format #t "~Txyoffset1: #x~X~%" (-> obj xyoffset1)) - (format #t "~Txyoffset1addr: #x~X~%" (-> obj xyoffset1addr)) - (format #t "~Tscissor1: #x~X~%" (-> obj scissor1)) - (format #t "~Tscissor1addr: #x~X~%" (-> obj scissor1addr)) - (format #t "~Tprmodecont: #x~X~%" (-> obj prmodecont)) - (format #t "~Tprmodecontaddr: #x~X~%" (-> obj prmodecontaddr)) - (format #t "~Tcolclamp: #x~X~%" (-> obj colclamp)) - (format #t "~Tcolclampaddr: #x~X~%" (-> obj colclampaddr)) - (format #t "~Tdthe: #x~X~%" (-> obj dthe)) - (format #t "~Tdtheaddr: #x~X~%" (-> obj dtheaddr)) - (format #t "~Ttest1: #x~X~%" (-> obj test1)) - (format #t "~Ttest1addr: #x~X~%" (-> obj test1addr)) - obj +(defmethod inspect draw-env ((this draw-env)) + (format #t "[~8x] ~A~%" this 'draw-env) + (format #t "~Tframe1: #x~X~%" (-> this frame1)) + (format #t "~Tframe1addr: #x~X~%" (-> this frame1addr)) + (format #t "~Tzbuf1: #x~X~%" (-> this zbuf1)) + (format #t "~Tzbuf1addr: #x~X~%" (-> this zbuf1addr)) + (format #t "~Txyoffset1: #x~X~%" (-> this xyoffset1)) + (format #t "~Txyoffset1addr: #x~X~%" (-> this xyoffset1addr)) + (format #t "~Tscissor1: #x~X~%" (-> this scissor1)) + (format #t "~Tscissor1addr: #x~X~%" (-> this scissor1addr)) + (format #t "~Tprmodecont: #x~X~%" (-> this prmodecont)) + (format #t "~Tprmodecontaddr: #x~X~%" (-> this prmodecontaddr)) + (format #t "~Tcolclamp: #x~X~%" (-> this colclamp)) + (format #t "~Tcolclampaddr: #x~X~%" (-> this colclampaddr)) + (format #t "~Tdthe: #x~X~%" (-> this dthe)) + (format #t "~Tdtheaddr: #x~X~%" (-> this dtheaddr)) + (format #t "~Ttest1: #x~X~%" (-> this test1)) + (format #t "~Ttest1addr: #x~X~%" (-> this test1addr)) + this ) ;; definition for function put-draw-env @@ -99,30 +99,30 @@ ) ;; definition for method 3 of type display-frame -(defmethod inspect display-frame ((obj display-frame)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tbuffer[11] @ #x~X~%" (-> obj buffer)) - (format #t "~Tcalc-buf: ~A~%" (-> obj calc-buf)) - (format #t "~Tvu1-buf: ~A~%" (-> obj calc-buf)) - (format #t "~Tdebug-buf: ~A~%" (-> obj debug-buf)) - (format #t "~Tglobal-buf: ~A~%" (-> obj global-buf)) - (format #t "~Tbucket-group: #~%" (-> obj bucket-group)) - (format #t "~Tprofile-bar[2] @ #x~X~%" (-> obj profile-bar)) - (format #t "~Trun-time: ~D~%" (-> obj run-time)) - obj +(defmethod inspect display-frame ((this display-frame)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tbuffer[11] @ #x~X~%" (-> this buffer)) + (format #t "~Tcalc-buf: ~A~%" (-> this calc-buf)) + (format #t "~Tvu1-buf: ~A~%" (-> this calc-buf)) + (format #t "~Tdebug-buf: ~A~%" (-> this debug-buf)) + (format #t "~Tglobal-buf: ~A~%" (-> this global-buf)) + (format #t "~Tbucket-group: #~%" (-> this bucket-group)) + (format #t "~Tprofile-bar[2] @ #x~X~%" (-> this profile-bar)) + (format #t "~Trun-time: ~D~%" (-> this run-time)) + this ) ;; definition for method 0 of type display-frame (defmethod new display-frame ((allocation symbol) (type-to-make type)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj calc-buf) (the-as dma-buffer 0)) - (set! (-> obj global-buf) (the-as dma-buffer 0)) - (set! (-> obj debug-buf) (the-as dma-buffer 0)) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this calc-buf) (the-as dma-buffer 0)) + (set! (-> this global-buf) (the-as dma-buffer 0)) + (set! (-> this debug-buf) (the-as dma-buffer 0)) (when *debug-segment* - (set! (-> obj profile-bar 0) (new 'debug 'profile-bar)) - (set! (-> obj profile-bar 1) (new 'debug 'profile-bar)) + (set! (-> this profile-bar 0) (new 'debug 'profile-bar)) + (set! (-> this profile-bar 1) (new 'debug 'profile-bar)) ) - obj + this ) ) @@ -141,14 +141,14 @@ ) ;; definition for method 3 of type virtual-frame -(defmethod inspect virtual-frame ((obj virtual-frame)) - (format #t "[~8x] ~A~%" obj 'virtual-frame) - (format #t "~Tdisplay: #~%" (-> obj display)) - (format #t "~Tdisplay-last: #~%" (-> obj display-last)) - (format #t "~Tgif: #x~X~%" (-> obj gif)) - (format #t "~Tdraw: #~%" (-> obj draw)) - (format #t "~Tframe: ~A~%" (-> obj frame)) - obj +(defmethod inspect virtual-frame ((this virtual-frame)) + (format #t "[~8x] ~A~%" this 'virtual-frame) + (format #t "~Tdisplay: #~%" (-> this display)) + (format #t "~Tdisplay-last: #~%" (-> this display-last)) + (format #t "~Tgif: #x~X~%" (-> this gif)) + (format #t "~Tdraw: #~%" (-> this draw)) + (format #t "~Tframe: ~A~%" (-> this frame)) + this ) ;; definition of type display @@ -199,85 +199,85 @@ ;; definition for method 3 of type display ;; INFO: Used lq/sq -(defmethod inspect display ((obj display)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdisplay-env0: #~%" (-> obj display-env0)) - (format #t "~Tdisplay-env1: #~%" (-> obj display-env1)) - (format #t "~Tdisplay-env2: #~%" (-> obj display-env2)) - (format #t "~Tgif-tag0: #x~X~%" (-> obj gif-tag0 qword)) - (format #t "~Tdraw0: #~%" (-> obj draw0)) - (format #t "~Tgif-tag1: #x~X~%" (-> obj gif-tag1 qword)) - (format #t "~Tdraw1: #~%" (-> obj draw1)) - (format #t "~Tgif-tag2: #x~X~%" (-> obj gif-tag2 qword)) - (format #t "~Tdraw2: #~%" (-> obj draw2)) - (format #t "~Ton-screen: ~D~%" (-> obj on-screen)) - (format #t "~Tlast-screen: ~D~%" (-> obj last-screen)) - (format #t "~Tframes[6] @ #x~X~%" (-> obj frames)) - (format #t "~Tbg-clear-color[4] @ #x~X~%" (-> obj bg-clear-color)) - (format #t "~Treal-frame-counter: ~D~%" (-> obj real-frame-counter)) - (format #t "~Tbase-frame-counter: ~D~%" (-> obj base-frame-counter)) - (format #t "~Tgame-frame-counter: ~D~%" (-> obj game-frame-counter)) - (format #t "~Tintegral-frame-counter: ~D~%" (-> obj integral-frame-counter)) - (format #t "~Treal-integral-frame-counter: ~D~%" (-> obj real-integral-frame-counter)) - (format #t "~Tactual-frame-counter: ~D~%" (-> obj actual-frame-counter)) - (format #t "~Treal-actual-frame-counter: ~D~%" (-> obj real-actual-frame-counter)) - (format #t "~Tpart-frame-counter: ~D~%" (-> obj part-frame-counter)) - (format #t "~Told-real-frame-counter: ~D~%" (-> obj old-real-frame-counter)) - (format #t "~Told-base-frame-counter: ~D~%" (-> obj old-base-frame-counter)) - (format #t "~Told-game-frame-counter: ~D~%" (-> obj old-game-frame-counter)) - (format #t "~Told-integral-frame-counter: ~D~%" (-> obj old-integral-frame-counter)) - (format #t "~Told-real-integral-frame-counter: ~D~%" (-> obj old-real-integral-frame-counter)) - (format #t "~Told-actual-frame-counter: ~D~%" (-> obj old-actual-frame-counter)) - (format #t "~Told-real-actual-frame-counter: ~D~%" (-> obj old-real-actual-frame-counter)) - (format #t "~Told-part-frame-counter: ~D~%" (-> obj old-part-frame-counter)) - (format #t "~Ttime-ratio: ~f~%" (-> obj time-ratio)) - (format #t "~Tseconds-per-frame: ~f~%" (-> obj seconds-per-frame)) - (format #t "~Tframes-per-second: ~f~%" (-> obj frames-per-second)) - (format #t "~Ttime-factor: ~f~%" (-> obj time-factor)) - (format #t "~Ttime-adjust-ratio: ~f~%" (-> obj time-adjust-ratio)) - obj +(defmethod inspect display ((this display)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdisplay-env0: #~%" (-> this display-env0)) + (format #t "~Tdisplay-env1: #~%" (-> this display-env1)) + (format #t "~Tdisplay-env2: #~%" (-> this display-env2)) + (format #t "~Tgif-tag0: #x~X~%" (-> this gif-tag0 qword)) + (format #t "~Tdraw0: #~%" (-> this draw0)) + (format #t "~Tgif-tag1: #x~X~%" (-> this gif-tag1 qword)) + (format #t "~Tdraw1: #~%" (-> this draw1)) + (format #t "~Tgif-tag2: #x~X~%" (-> this gif-tag2 qword)) + (format #t "~Tdraw2: #~%" (-> this draw2)) + (format #t "~Ton-screen: ~D~%" (-> this on-screen)) + (format #t "~Tlast-screen: ~D~%" (-> this last-screen)) + (format #t "~Tframes[6] @ #x~X~%" (-> this frames)) + (format #t "~Tbg-clear-color[4] @ #x~X~%" (-> this bg-clear-color)) + (format #t "~Treal-frame-counter: ~D~%" (-> this real-frame-counter)) + (format #t "~Tbase-frame-counter: ~D~%" (-> this base-frame-counter)) + (format #t "~Tgame-frame-counter: ~D~%" (-> this game-frame-counter)) + (format #t "~Tintegral-frame-counter: ~D~%" (-> this integral-frame-counter)) + (format #t "~Treal-integral-frame-counter: ~D~%" (-> this real-integral-frame-counter)) + (format #t "~Tactual-frame-counter: ~D~%" (-> this actual-frame-counter)) + (format #t "~Treal-actual-frame-counter: ~D~%" (-> this real-actual-frame-counter)) + (format #t "~Tpart-frame-counter: ~D~%" (-> this part-frame-counter)) + (format #t "~Told-real-frame-counter: ~D~%" (-> this old-real-frame-counter)) + (format #t "~Told-base-frame-counter: ~D~%" (-> this old-base-frame-counter)) + (format #t "~Told-game-frame-counter: ~D~%" (-> this old-game-frame-counter)) + (format #t "~Told-integral-frame-counter: ~D~%" (-> this old-integral-frame-counter)) + (format #t "~Told-real-integral-frame-counter: ~D~%" (-> this old-real-integral-frame-counter)) + (format #t "~Told-actual-frame-counter: ~D~%" (-> this old-actual-frame-counter)) + (format #t "~Told-real-actual-frame-counter: ~D~%" (-> this old-real-actual-frame-counter)) + (format #t "~Told-part-frame-counter: ~D~%" (-> this old-part-frame-counter)) + (format #t "~Ttime-ratio: ~f~%" (-> this time-ratio)) + (format #t "~Tseconds-per-frame: ~f~%" (-> this seconds-per-frame)) + (format #t "~Tframes-per-second: ~f~%" (-> this frames-per-second)) + (format #t "~Ttime-factor: ~f~%" (-> this time-factor)) + (format #t "~Ttime-adjust-ratio: ~f~%" (-> this time-adjust-ratio)) + this ) ;; definition for method 0 of type display (defmethod new display ((allocation symbol) (type-to-make type) (psm int) (w int) (h int) (ztest int) (zpsm int)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set-display obj psm w h ztest zpsm) - (set! (-> obj frames 0 display) (-> obj display-env0)) - (set! (-> obj frames 1 display) (-> obj display-env1)) - (set! (-> obj frames 2 display) (-> obj display-env2)) - (set! (-> obj frames 3 display) (-> obj display-env0)) - (set! (-> obj frames 4 display) (-> obj display-env1)) - (set! (-> obj frames 5 display) (-> obj display-env2)) - (set! (-> obj frames 0 display-last) (-> obj display-env2)) - (set! (-> obj frames 1 display-last) (-> obj display-env0)) - (set! (-> obj frames 2 display-last) (-> obj display-env1)) - (set! (-> obj frames 3 display-last) (-> obj display-env2)) - (set! (-> obj frames 4 display-last) (-> obj display-env0)) - (set! (-> obj frames 5 display-last) (-> obj display-env1)) - (set! (-> obj frames 0 gif) (the-as pointer (-> obj gif-tag0))) - (set! (-> obj frames 1 gif) (the-as pointer (-> obj gif-tag1))) - (set! (-> obj frames 2 gif) (the-as pointer (-> obj gif-tag2))) - (set! (-> obj frames 3 gif) (the-as pointer (-> obj gif-tag0))) - (set! (-> obj frames 4 gif) (the-as pointer (-> obj gif-tag1))) - (set! (-> obj frames 5 gif) (the-as pointer (-> obj gif-tag2))) - (set! (-> obj frames 0 draw) (-> obj draw0)) - (set! (-> obj frames 1 draw) (-> obj draw1)) - (set! (-> obj frames 2 draw) (-> obj draw2)) - (set! (-> obj frames 3 draw) (-> obj draw0)) - (set! (-> obj frames 4 draw) (-> obj draw1)) - (set! (-> obj frames 5 draw) (-> obj draw2)) - (set! (-> obj frames 0 frame) (new 'global 'display-frame)) - (set! (-> obj frames 1 frame) (new 'global 'display-frame)) - (set! (-> obj frames 2 frame) (-> obj frames 0 frame)) - (set! (-> obj frames 3 frame) (-> obj frames 1 frame)) - (set! (-> obj frames 4 frame) (-> obj frames 0 frame)) - (set! (-> obj frames 5 frame) (-> obj frames 1 frame)) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set-display this psm w h ztest zpsm) + (set! (-> this frames 0 display) (-> this display-env0)) + (set! (-> this frames 1 display) (-> this display-env1)) + (set! (-> this frames 2 display) (-> this display-env2)) + (set! (-> this frames 3 display) (-> this display-env0)) + (set! (-> this frames 4 display) (-> this display-env1)) + (set! (-> this frames 5 display) (-> this display-env2)) + (set! (-> this frames 0 display-last) (-> this display-env2)) + (set! (-> this frames 1 display-last) (-> this display-env0)) + (set! (-> this frames 2 display-last) (-> this display-env1)) + (set! (-> this frames 3 display-last) (-> this display-env2)) + (set! (-> this frames 4 display-last) (-> this display-env0)) + (set! (-> this frames 5 display-last) (-> this display-env1)) + (set! (-> this frames 0 gif) (the-as pointer (-> this gif-tag0))) + (set! (-> this frames 1 gif) (the-as pointer (-> this gif-tag1))) + (set! (-> this frames 2 gif) (the-as pointer (-> this gif-tag2))) + (set! (-> this frames 3 gif) (the-as pointer (-> this gif-tag0))) + (set! (-> this frames 4 gif) (the-as pointer (-> this gif-tag1))) + (set! (-> this frames 5 gif) (the-as pointer (-> this gif-tag2))) + (set! (-> this frames 0 draw) (-> this draw0)) + (set! (-> this frames 1 draw) (-> this draw1)) + (set! (-> this frames 2 draw) (-> this draw2)) + (set! (-> this frames 3 draw) (-> this draw0)) + (set! (-> this frames 4 draw) (-> this draw1)) + (set! (-> this frames 5 draw) (-> this draw2)) + (set! (-> this frames 0 frame) (new 'global 'display-frame)) + (set! (-> this frames 1 frame) (new 'global 'display-frame)) + (set! (-> this frames 2 frame) (-> this frames 0 frame)) + (set! (-> this frames 3 frame) (-> this frames 1 frame)) + (set! (-> this frames 4 frame) (-> this frames 0 frame)) + (set! (-> this frames 5 frame) (-> this frames 1 frame)) (default-buffer-init *default-regs-buffer*) - (set! (-> obj bg-clear-color 0) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) - (set! (-> obj bg-clear-color 1) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) - (set! (-> obj bg-clear-color 2) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) - (set! (-> obj bg-clear-color 3) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) - obj + (set! (-> this bg-clear-color 0) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (set! (-> this bg-clear-color 1) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (set! (-> this bg-clear-color 2) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + (set! (-> this bg-clear-color 3) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + this ) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc index 1b6c9c8b70..811d0a4dc4 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/display_REF.gc @@ -3,7 +3,7 @@ ;; definition for function get-current-time (defun get-current-time () - (-> *display* base-frame-counter) + (current-time) ) ;; definition for function get-integral-current-time @@ -12,25 +12,25 @@ ) ;; definition for method 9 of type display -(defmethod set-time-ratios display ((obj display) (slowdown float)) +(defmethod set-time-ratios display ((this display) (slowdown float)) (let ((ratio (fmin 4.0 slowdown))) - (set! (-> obj time-ratio) ratio) + (set! (-> this time-ratio) ratio) (case (get-video-mode) (('pal) - (set! (-> obj time-adjust-ratio) (* 1.2 ratio)) - (set! (-> obj seconds-per-frame) (* 0.02 ratio)) - (set! (-> obj frames-per-second) (* 50.0 (/ 1.0 ratio))) - (set! (-> obj time-factor) 6.0) + (set! (-> this time-adjust-ratio) (* 1.2 ratio)) + (set! (-> this seconds-per-frame) (* 0.02 ratio)) + (set! (-> this frames-per-second) (* 50.0 (/ 1.0 ratio))) + (set! (-> this time-factor) 6.0) ) (else - (set! (-> obj time-adjust-ratio) ratio) - (set! (-> obj seconds-per-frame) (* 0.016666668 ratio)) - (set! (-> obj frames-per-second) (* 60.0 (/ 1.0 ratio))) - (set! (-> obj time-factor) 5.0) + (set! (-> this time-adjust-ratio) ratio) + (set! (-> this seconds-per-frame) (* 0.016666668 ratio)) + (set! (-> this frames-per-second) (* 60.0 (/ 1.0 ratio))) + (set! (-> this time-factor) 5.0) ) ) ) - (-> obj time-ratio) + (-> this time-ratio) ) ;; definition for function set-display-env @@ -205,10 +205,10 @@ ) ;; definition for method 11 of type profile-bar -(defmethod add-frame profile-bar ((obj profile-bar) (name symbol) (color rgba)) +(defmethod add-frame profile-bar ((this profile-bar) (name symbol) (color rgba)) (when *debug-segment* - (let ((new-frame (-> obj data (-> obj profile-frame-count)))) - (+! (-> obj profile-frame-count) 1) + (let ((new-frame (-> this data (-> this profile-frame-count)))) + (+! (-> this profile-frame-count) 1) (set! (-> new-frame name) name) (set! (-> new-frame time-stamp) (timer-count (the-as timer-bank #x10000800))) (set! (-> new-frame color) color) @@ -218,16 +218,16 @@ ) ;; definition for method 10 of type profile-bar -(defmethod reset profile-bar ((obj profile-bar)) - (set! (-> obj profile-frame-count) 0) - (add-frame obj 'start (new 'static 'rgba :r #x40 :b #x40 :a #x80)) - obj +(defmethod reset profile-bar ((this profile-bar)) + (set! (-> this profile-frame-count) 0) + (add-frame this 'start (new 'static 'rgba :r #x40 :b #x40 :a #x80)) + this ) ;; definition for method 12 of type profile-bar -(defmethod add-end-frame profile-bar ((obj profile-bar) (name symbol) (color rgba)) - (let ((new-frame (-> obj data (-> obj profile-frame-count)))) - (+! (-> obj profile-frame-count) 1) +(defmethod add-end-frame profile-bar ((this profile-bar) (name symbol) (color rgba)) + (let ((new-frame (-> this data (-> this profile-frame-count)))) + (+! (-> this profile-frame-count) 1) (set! (-> new-frame name) name) (set! (-> new-frame time-stamp) (the-as uint *ticks-per-frame*)) (set! (-> new-frame color) color) @@ -251,13 +251,13 @@ (define *profile-ticks* #f) ;; definition for method 13 of type profile-bar -(defmethod draw profile-bar ((obj profile-bar) (buf dma-buffer) (bar-pos int)) +(defmethod draw profile-bar ((this profile-bar) (buf dma-buffer) (bar-pos int)) (let ((height (the int (* 8.0 (-> *video-parms* relative-y-scale))))) (set! *profile-y* (+ (-> *video-parms* screen-miny) height)) (set! *profile-h* height) ) (let ((block-idx 1) - (block-count (-> obj profile-frame-count)) + (block-count (-> this profile-frame-count)) (left (* *profile-x* 16)) (end-time 0) (worst-time-cache (new 'static 'array uint32 2 #x0 #x0)) @@ -285,7 +285,7 @@ (set! (-> t1-1 base) (&+ (the-as pointer start-gif-tag) 16)) ) (while (< block-idx block-count) - (let ((block (-> obj data block-idx))) + (let ((block (-> this data block-idx))) (let* ((t2-4 buf) (t3-8 (-> t2-4 base)) ) @@ -314,11 +314,11 @@ (+! block-idx 1) ) ) - (when (or (< (seconds 0.25) (- (-> *display* real-frame-counter) (-> obj cache-time))) + (when (or (< (seconds 0.25) (- (-> *display* real-frame-counter) (-> this cache-time))) (>= end-time (the-as int (-> worst-time-cache (/ bar-pos 10)))) ) (set! (-> worst-time-cache (/ bar-pos 10)) (the-as uint end-time)) - (set! (-> obj cache-time) (-> *display* real-frame-counter)) + (set! (-> this cache-time) (-> *display* real-frame-counter)) ) (cond (*profile-ticks* diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc index d161b73a04..5c5fd09d22 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/gs_REF.gc @@ -191,22 +191,22 @@ ) ;; definition for method 3 of type gs-bank -(defmethod inspect gs-bank ((obj gs-bank)) - (format #t "[~8x] ~A~%" obj 'gs-bank) - (format #t "~Tpmode: #x~X~%" (-> obj pmode)) - (format #t "~Tsmode2: #x~X~%" (-> obj smode2)) - (format #t "~Tdspfb1: #x~X~%" (-> obj dspfb1)) - (format #t "~Tdisplay1: #x~X~%" (-> obj display1)) - (format #t "~Tdspfb2: #x~X~%" (-> obj dspfb2)) - (format #t "~Tdisplay2: #x~X~%" (-> obj display2)) - (format #t "~Textbuf: #x~X~%" (-> obj extbuf)) - (format #t "~Textdata: #x~X~%" (-> obj extdata)) - (format #t "~Textwrite: #x~X~%" (-> obj extwrite)) - (format #t "~Tbgcolor: #x~X~%" (-> obj bgcolor)) - (format #t "~Tcsr: #x~X~%" (-> obj csr)) - (format #t "~Timr: #x~X~%" (-> obj imr)) - (format #t "~Tbusdir: #x~X~%" (-> obj busdir)) - obj +(defmethod inspect gs-bank ((this gs-bank)) + (format #t "[~8x] ~A~%" this 'gs-bank) + (format #t "~Tpmode: #x~X~%" (-> this pmode)) + (format #t "~Tsmode2: #x~X~%" (-> this smode2)) + (format #t "~Tdspfb1: #x~X~%" (-> this dspfb1)) + (format #t "~Tdisplay1: #x~X~%" (-> this display1)) + (format #t "~Tdspfb2: #x~X~%" (-> this dspfb2)) + (format #t "~Tdisplay2: #x~X~%" (-> this display2)) + (format #t "~Textbuf: #x~X~%" (-> this extbuf)) + (format #t "~Textdata: #x~X~%" (-> this extdata)) + (format #t "~Textwrite: #x~X~%" (-> this extwrite)) + (format #t "~Tbgcolor: #x~X~%" (-> this bgcolor)) + (format #t "~Tcsr: #x~X~%" (-> this csr)) + (format #t "~Timr: #x~X~%" (-> this imr)) + (format #t "~Tbusdir: #x~X~%" (-> this busdir)) + this ) ;; definition of type gs-frame @@ -501,14 +501,14 @@ ) ;; definition for method 3 of type gs-alpha -(defmethod inspect gs-alpha ((obj gs-alpha)) - (format #t "[~8x] ~A~%" obj 'gs-alpha) - (format #t "~Ta: ~D~%" (-> obj a)) - (format #t "~Tb: ~D~%" (-> obj b)) - (format #t "~Tc: ~D~%" (-> obj c)) - (format #t "~Td: ~D~%" (-> obj d)) - (format #t "~Tfix: ~D~%" (-> obj fix)) - obj +(defmethod inspect gs-alpha ((this gs-alpha)) + (format #t "[~8x] ~A~%" this 'gs-alpha) + (format #t "~Ta: ~D~%" (-> this a)) + (format #t "~Tb: ~D~%" (-> this b)) + (format #t "~Tc: ~D~%" (-> this c)) + (format #t "~Td: ~D~%" (-> this d)) + (format #t "~Tfix: ~D~%" (-> this fix)) + this ) ;; definition of type gs-clamp @@ -535,10 +535,10 @@ ) ;; definition for method 3 of type gs-fog -(defmethod inspect gs-fog ((obj gs-fog)) - (format #t "[~8x] ~A~%" obj 'gs-fog) - (format #t "~Tf: ~D~%" (-> obj f)) - obj +(defmethod inspect gs-fog ((this gs-fog)) + (format #t "[~8x] ~A~%" this 'gs-fog) + (format #t "~Tf: ~D~%" (-> this f)) + this ) ;; definition of type gs-fogcol @@ -553,12 +553,12 @@ ) ;; definition for method 3 of type gs-fogcol -(defmethod inspect gs-fogcol ((obj gs-fogcol)) - (format #t "[~8x] ~A~%" obj 'gs-fogcol) - (format #t "~Tr: ~D~%" (-> obj fcr)) - (format #t "~Tg: ~D~%" (-> obj fcg)) - (format #t "~Tb: ~D~%" (-> obj fcb)) - obj +(defmethod inspect gs-fogcol ((this gs-fogcol)) + (format #t "[~8x] ~A~%" this 'gs-fogcol) + (format #t "~Tr: ~D~%" (-> this fcr)) + (format #t "~Tg: ~D~%" (-> this fcg)) + (format #t "~Tb: ~D~%" (-> this fcb)) + this ) ;; definition of type gif-ctrl @@ -650,19 +650,19 @@ ) ;; definition for method 3 of type gif-bank -(defmethod inspect gif-bank ((obj gif-bank)) - (format #t "[~8x] ~A~%" obj 'gif-bank) - (format #t "~Tctrl: #x~X~%" (-> obj ctrl)) - (format #t "~Tmode: #x~X~%" (-> obj mode)) - (format #t "~Tstat: #x~X~%" (-> obj stat)) - (format #t "~Ttag0: #x~X~%" (-> obj tag0)) - (format #t "~Ttag1: #x~X~%" (-> obj tag1)) - (format #t "~Ttag2: #x~X~%" (-> obj tag2)) - (format #t "~Ttag3: #x~X~%" (-> obj tag3)) - (format #t "~Tcnt: #x~X~%" (-> obj cnt)) - (format #t "~Tp3cnt: #x~X~%" (-> obj p3cnt)) - (format #t "~Tp3tag: #x~X~%" (-> obj p3tag)) - obj +(defmethod inspect gif-bank ((this gif-bank)) + (format #t "[~8x] ~A~%" this 'gif-bank) + (format #t "~Tctrl: #x~X~%" (-> this ctrl)) + (format #t "~Tmode: #x~X~%" (-> this mode)) + (format #t "~Tstat: #x~X~%" (-> this stat)) + (format #t "~Ttag0: #x~X~%" (-> this tag0)) + (format #t "~Ttag1: #x~X~%" (-> this tag1)) + (format #t "~Ttag2: #x~X~%" (-> this tag2)) + (format #t "~Ttag3: #x~X~%" (-> this tag3)) + (format #t "~Tcnt: #x~X~%" (-> this cnt)) + (format #t "~Tp3cnt: #x~X~%" (-> this p3cnt)) + (format #t "~Tp3tag: #x~X~%" (-> this p3tag)) + this ) ;; definition of type gif-tag-prim @@ -741,43 +741,43 @@ ) ;; definition for method 3 of type gs-gif-tag -(defmethod inspect gs-gif-tag ((obj gs-gif-tag)) - (format #t "[~8x] ~A~%" obj 'gs-gif-tag) - (format #t "~Tqword: #~%" (&-> obj tag)) - (format #t "~Tdword[2] @ #x~X~%" (&-> obj tag)) - (format #t "~Tword[4] @ #x~X~%" (&-> obj tag)) - (format #t "~Ttag: ~D~%" (-> obj tag)) - (format #t "~Tregs: ~D~%" (-> obj regs)) - obj +(defmethod inspect gs-gif-tag ((this gs-gif-tag)) + (format #t "[~8x] ~A~%" this 'gs-gif-tag) + (format #t "~Tqword: #~%" (&-> this tag)) + (format #t "~Tdword[2] @ #x~X~%" (&-> this tag)) + (format #t "~Tword[4] @ #x~X~%" (&-> this tag)) + (format #t "~Ttag: ~D~%" (-> this tag)) + (format #t "~Tregs: ~D~%" (-> this regs)) + this ) ;; definition for method 3 of type gif-tag ;; INFO: Return type mismatch object vs gif-tag. -(defmethod inspect gif-tag ((obj gif-tag)) - (format #t "[~8x] gif-tag~%" obj) - (format #t "~Tnloop: ~4d~%" (-> obj nloop)) - (format #t "~Teop : ~4d~%" (-> obj eop)) - (format #t "~Tid : ~4d~%" (-> obj id)) - (format #t "~Tpre : ~4d~%" (-> obj pre)) - (format #t "~Tprim : ~4d~%" (-> obj prim)) - (format #t "~Tflg : ~4d~%" (-> obj flg)) - (format #t "~Tnreg : ~4d~%" (-> obj nreg)) - (format #t "~Tregs0 : ~4d~%" (-> obj regs0)) - (format #t "~Tregs1 : ~4d~%" (-> obj regs1)) - (format #t "~Tregs2 : ~4d~%" (-> obj regs2)) - (format #t "~Tregs3 : ~4d~%" (-> obj regs3)) - (format #t "~Tregs4 : ~4d~%" (-> obj regs4)) - (format #t "~Tregs5 : ~4d~%" (-> obj regs5)) - (format #t "~Tregs6 : ~4d~%" (-> obj regs6)) - (format #t "~Tregs7 : ~4d~%" (-> obj regs7)) - (format #t "~Tregs8 : ~4d~%" (-> obj regs8)) - (format #t "~Tregs9 : ~4d~%" (-> obj regs9)) - (format #t "~Tregs10: ~4d~%" (-> obj regs10)) - (format #t "~Tregs11: ~4d~%" (-> obj regs11)) - (format #t "~Tregs12: ~4d~%" (-> obj regs12)) - (format #t "~Tregs13: ~4d~%" (-> obj regs13)) - (format #t "~Tregs14: ~4d~%" (-> obj regs14)) - (the-as gif-tag (format #t "~Tregs15: ~4d~%" (-> obj regs15))) +(defmethod inspect gif-tag ((this gif-tag)) + (format #t "[~8x] gif-tag~%" this) + (format #t "~Tnloop: ~4d~%" (-> this nloop)) + (format #t "~Teop : ~4d~%" (-> this eop)) + (format #t "~Tid : ~4d~%" (-> this id)) + (format #t "~Tpre : ~4d~%" (-> this pre)) + (format #t "~Tprim : ~4d~%" (-> this prim)) + (format #t "~Tflg : ~4d~%" (-> this flg)) + (format #t "~Tnreg : ~4d~%" (-> this nreg)) + (format #t "~Tregs0 : ~4d~%" (-> this regs0)) + (format #t "~Tregs1 : ~4d~%" (-> this regs1)) + (format #t "~Tregs2 : ~4d~%" (-> this regs2)) + (format #t "~Tregs3 : ~4d~%" (-> this regs3)) + (format #t "~Tregs4 : ~4d~%" (-> this regs4)) + (format #t "~Tregs5 : ~4d~%" (-> this regs5)) + (format #t "~Tregs6 : ~4d~%" (-> this regs6)) + (format #t "~Tregs7 : ~4d~%" (-> this regs7)) + (format #t "~Tregs8 : ~4d~%" (-> this regs8)) + (format #t "~Tregs9 : ~4d~%" (-> this regs9)) + (format #t "~Tregs10: ~4d~%" (-> this regs10)) + (format #t "~Tregs11: ~4d~%" (-> this regs11)) + (format #t "~Tregs12: ~4d~%" (-> this regs12)) + (format #t "~Tregs13: ~4d~%" (-> this regs13)) + (format #t "~Tregs14: ~4d~%" (-> this regs14)) + (the-as gif-tag (format #t "~Tregs15: ~4d~%" (-> this regs15))) ) ;; definition for symbol *fog-color*, type rgba @@ -866,12 +866,12 @@ ;; definition for method 3 of type gif-packet ;; INFO: Used lq/sq -(defmethod inspect gif-packet ((obj gif-packet)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Treg-count: ~D~%" (-> obj reg-count)) - (format #t "~Tgif-tag0: #x~X~%" (-> obj gif-tag0)) - (format #t "~Targs[1] @ #x~X~%" (-> obj args)) - obj +(defmethod inspect gif-packet ((this gif-packet)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Treg-count: ~D~%" (-> this reg-count)) + (format #t "~Tgif-tag0: #x~X~%" (-> this gif-tag0)) + (format #t "~Targs[1] @ #x~X~%" (-> this args)) + this ) ;; definition for method 0 of type gif-packet @@ -923,31 +923,31 @@ ) ;; definition for method 3 of type draw-context -(defmethod inspect draw-context ((obj draw-context)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Torgx: ~D~%" (-> obj orgx)) - (format #t "~Torgy: ~D~%" (-> obj orgy)) - (format #t "~Torgz: ~D~%" (-> obj orgz)) - (format #t "~Twidth: ~D~%" (-> obj width)) - (format #t "~Theight: ~D~%" (-> obj height)) - (format #t "~Tcolor[4] @ #x~X~%" (-> obj color)) - obj +(defmethod inspect draw-context ((this draw-context)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Torgx: ~D~%" (-> this orgx)) + (format #t "~Torgy: ~D~%" (-> this orgy)) + (format #t "~Torgz: ~D~%" (-> this orgz)) + (format #t "~Twidth: ~D~%" (-> this width)) + (format #t "~Theight: ~D~%" (-> this height)) + (format #t "~Tcolor[4] @ #x~X~%" (-> this color)) + this ) ;; definition for method 0 of type draw-context (defmethod new draw-context ((allocation symbol) (type-to-make type) (org-x int) (org-y int) (width int) (height int) (color-0 rgba)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (let ((v1-3 (the int (* (the float org-y) (-> *video-parms* relative-y-scale)))) (a0-2 (the int (* (the float height) (-> *video-parms* relative-y-scale)))) ) - (set! (-> obj orgx) org-x) - (set! (-> obj orgy) v1-3) - (set! (-> obj orgz) #xffffff) - (set! (-> obj width) width) - (set! (-> obj height) a0-2) + (set! (-> this orgx) org-x) + (set! (-> this orgy) v1-3) + (set! (-> this orgz) #xffffff) + (set! (-> this width) width) + (set! (-> this height) a0-2) ) - (set! (-> obj color 0) color-0) - obj + (set! (-> this color 0) color-0) + this ) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/hw/video-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/hw/video-h_REF.gc index bdb9c49523..52c10375f3 100644 --- a/test/decompiler/reference/jak1/engine/gfx/hw/video-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/hw/video-h_REF.gc @@ -26,23 +26,23 @@ ) ;; definition for method 3 of type video-parms -(defmethod inspect video-parms ((obj video-parms)) - (format #t "[~8x] ~A~%" obj 'video-parms) - (format #t "~Tset-video-mode: ~A~%" (-> obj set-video-mode)) - (format #t "~Treset-video-mode: ~A~%" (-> obj reset-video-mode)) - (format #t "~Tscreen-sy: ~D~%" (-> obj screen-sy)) - (format #t "~Tscreen-hy: ~D~%" (-> obj screen-hy)) - (format #t "~Tscreen-miny: ~D~%" (-> obj screen-miny)) - (format #t "~Tscreen-maxy: ~D~%" (-> obj screen-maxy)) - (format #t "~Tscreen-masky: ~D~%" (-> obj screen-masky)) - (format #t "~Tdisplay-dx: ~D~%" (-> obj display-dx)) - (format #t "~Tdisplay-dy: ~D~%" (-> obj display-dy)) - (format #t "~Tscreen-pages-high: ~D~%" (-> obj screen-pages-high)) - (format #t "~Trelative-x-scale: ~f~%" (-> obj relative-x-scale)) - (format #t "~Trelative-y-scale: ~f~%" (-> obj relative-y-scale)) - (format #t "~Trelative-x-scale-reciprical: ~f~%" (-> obj relative-x-scale-reciprical)) - (format #t "~Trelative-y-scale-reciprical: ~f~%" (-> obj relative-y-scale-reciprical)) - obj +(defmethod inspect video-parms ((this video-parms)) + (format #t "[~8x] ~A~%" this 'video-parms) + (format #t "~Tset-video-mode: ~A~%" (-> this set-video-mode)) + (format #t "~Treset-video-mode: ~A~%" (-> this reset-video-mode)) + (format #t "~Tscreen-sy: ~D~%" (-> this screen-sy)) + (format #t "~Tscreen-hy: ~D~%" (-> this screen-hy)) + (format #t "~Tscreen-miny: ~D~%" (-> this screen-miny)) + (format #t "~Tscreen-maxy: ~D~%" (-> this screen-maxy)) + (format #t "~Tscreen-masky: ~D~%" (-> this screen-masky)) + (format #t "~Tdisplay-dx: ~D~%" (-> this display-dx)) + (format #t "~Tdisplay-dy: ~D~%" (-> this display-dy)) + (format #t "~Tscreen-pages-high: ~D~%" (-> this screen-pages-high)) + (format #t "~Trelative-x-scale: ~f~%" (-> this relative-x-scale)) + (format #t "~Trelative-y-scale: ~f~%" (-> this relative-y-scale)) + (format #t "~Trelative-x-scale-reciprical: ~f~%" (-> this relative-x-scale-reciprical)) + (format #t "~Trelative-y-scale-reciprical: ~f~%" (-> this relative-y-scale-reciprical)) + this ) ;; definition for symbol *video-parms*, type video-parms diff --git a/test/decompiler/reference/jak1/engine/gfx/lights-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/lights-h_REF.gc index fce6ff29f9..24eebd03b4 100644 --- a/test/decompiler/reference/jak1/engine/gfx/lights-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/lights-h_REF.gc @@ -13,12 +13,12 @@ ) ;; definition for method 3 of type vu-lights -(defmethod inspect vu-lights ((obj vu-lights)) - (format #t "[~8x] ~A~%" obj 'vu-lights) - (format #t "~Tdirection[3] @ #x~X~%" (-> obj direction)) - (format #t "~Tcolor[3] @ #x~X~%" (-> obj color)) - (format #t "~Tambient: ~`vector`P~%" (-> obj ambient)) - obj +(defmethod inspect vu-lights ((this vu-lights)) + (format #t "[~8x] ~A~%" this 'vu-lights) + (format #t "~Tdirection[3] @ #x~X~%" (-> this direction)) + (format #t "~Tcolor[3] @ #x~X~%" (-> this color)) + (format #t "~Tambient: ~`vector`P~%" (-> this ambient)) + this ) ;; definition of type light @@ -35,14 +35,14 @@ ) ;; definition for method 3 of type light -(defmethod inspect light ((obj light)) - (format #t "[~8x] ~A~%" obj 'light) - (format #t "~Tdirection: #~%" (-> obj direction)) - (format #t "~Tcolor: #~%" (-> obj color)) - (format #t "~Tlevels: #~%" (-> obj levels)) - (format #t "~Tlevel: ~f~%" (-> obj levels x)) - (format #t "~Tsort-level: ~f~%" (-> obj levels y)) - obj +(defmethod inspect light ((this light)) + (format #t "[~8x] ~A~%" this 'light) + (format #t "~Tdirection: #~%" (-> this direction)) + (format #t "~Tcolor: #~%" (-> this color)) + (format #t "~Tlevels: #~%" (-> this levels)) + (format #t "~Tlevel: ~f~%" (-> this levels x)) + (format #t "~Tsort-level: ~f~%" (-> this levels y)) + this ) ;; definition of type light-ellipse @@ -62,17 +62,17 @@ ) ;; definition for method 3 of type light-ellipse -(defmethod inspect light-ellipse ((obj light-ellipse)) - (format #t "[~8x] ~A~%" obj 'light-ellipse) - (format #t "~Tmatrix: #~%" (-> obj matrix)) - (format #t "~Tcolor: #~%" (-> obj color)) - (format #t "~Tname: ~A~%" (-> obj matrix vector 0 w)) - (format #t "~Tdecay-start: ~f~%" (-> obj matrix vector 1 w)) - (format #t "~Tambient-point-ratio: ~f~%" (-> obj matrix vector 2 w)) - (format #t "~Tlevel: ~f~%" (-> obj matrix vector 3 w)) - (format #t "~Tfunc-symbol: ~A~%" (-> obj color w)) - (format #t "~Tfunc: ~A~%" (-> obj color w)) - obj +(defmethod inspect light-ellipse ((this light-ellipse)) + (format #t "[~8x] ~A~%" this 'light-ellipse) + (format #t "~Tmatrix: #~%" (-> this matrix)) + (format #t "~Tcolor: #~%" (-> this color)) + (format #t "~Tname: ~A~%" (-> this matrix vector 0 w)) + (format #t "~Tdecay-start: ~f~%" (-> this matrix vector 1 w)) + (format #t "~Tambient-point-ratio: ~f~%" (-> this matrix vector 2 w)) + (format #t "~Tlevel: ~f~%" (-> this matrix vector 3 w)) + (format #t "~Tfunc-symbol: ~A~%" (-> this color w)) + (format #t "~Tfunc: ~A~%" (-> this color w)) + this ) ;; definition of type light-array @@ -84,13 +84,13 @@ ) ;; definition for method 3 of type light-array -(defmethod inspect light-array ((obj light-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttype: ~A~%" (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tcontent-type: ~A~%" (-> obj content-type)) - obj +(defmethod inspect light-array ((this light-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttype: ~A~%" (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tcontent-type: ~A~%" (-> this content-type)) + this ) ;; definition of type light-volume @@ -103,10 +103,10 @@ ) ;; definition for method 3 of type light-volume -(defmethod inspect light-volume ((obj light-volume)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlight-array: ~A~%" (-> obj light-array)) - obj +(defmethod inspect light-volume ((this light-volume)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlight-array: ~A~%" (-> this light-array)) + this ) ;; definition of type light-volume-sphere @@ -119,11 +119,11 @@ ) ;; definition for method 3 of type light-volume-sphere -(defmethod inspect light-volume-sphere ((obj light-volume-sphere)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlight-array: ~A~%" (-> obj light-array)) - (format #t "~Tbsphere: #~%" (-> obj bsphere)) - obj +(defmethod inspect light-volume-sphere ((this light-volume-sphere)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlight-array: ~A~%" (-> this light-array)) + (format #t "~Tbsphere: #~%" (-> this bsphere)) + this ) ;; definition of type light-volume-planes @@ -136,11 +136,11 @@ ) ;; definition for method 3 of type light-volume-planes -(defmethod inspect light-volume-planes ((obj light-volume-planes)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlight-array: ~A~%" (-> obj light-array)) - (format #t "~Tplanes: #~%" (-> obj planes)) - obj +(defmethod inspect light-volume-planes ((this light-volume-planes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlight-array: ~A~%" (-> this light-array)) + (format #t "~Tplanes: #~%" (-> this planes)) + this ) ;; definition of type light-volume-array @@ -152,27 +152,27 @@ ) ;; definition for method 3 of type light-volume-array -(defmethod inspect light-volume-array ((obj light-volume-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttype: ~A~%" (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tcontent-type: ~A~%" (-> obj content-type)) - obj +(defmethod inspect light-volume-array ((this light-volume-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttype: ~A~%" (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tcontent-type: ~A~%" (-> this content-type)) + this ) ;; definition for method 2 of type light -(defmethod print light ((obj light)) +(defmethod print light ((this light)) (format #t "# obj levels x) - (-> obj direction x) - (-> obj direction y) - (-> obj direction z) + (-> this levels x) + (-> this direction x) + (-> this direction y) + (-> this direction z) ) - (format #t "~F ~F ~F @ #x~X>" (-> obj color x) (-> obj color y) (-> obj color z) obj) - obj + (format #t "~F ~F ~F @ #x~X>" (-> this color x) (-> this color y) (-> this color z) this) + this ) ;; definition of type light-group @@ -189,13 +189,13 @@ ) ;; definition for method 3 of type light-group -(defmethod inspect light-group ((obj light-group)) - (format #t "[~8x] ~A~%" obj 'light-group) - (format #t "~Tdir0: ~`light`P~%" (-> obj dir0)) - (format #t "~Tdir1: ~`light`P~%" (-> obj dir1)) - (format #t "~Tdir2: ~`light`P~%" (-> obj dir2)) - (format #t "~Tambi: ~`light`P~%" (-> obj ambi)) - obj +(defmethod inspect light-group ((this light-group)) + (format #t "[~8x] ~A~%" this 'light-group) + (format #t "~Tdir0: ~`light`P~%" (-> this dir0)) + (format #t "~Tdir1: ~`light`P~%" (-> this dir1)) + (format #t "~Tdir2: ~`light`P~%" (-> this dir2)) + (format #t "~Tambi: ~`light`P~%" (-> this ambi)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/math-camera-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/math-camera-h_REF.gc index db4c571fe9..6d520a74af 100644 --- a/test/decompiler/reference/jak1/engine/gfx/math-camera-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/math-camera-h_REF.gc @@ -14,13 +14,13 @@ ) ;; definition for method 3 of type vis-gif-tag -(defmethod inspect vis-gif-tag ((obj vis-gif-tag)) - (format #t "[~8x] ~A~%" obj 'vis-gif-tag) - (format #t "~Tfog0: ~D~%" (-> obj fog0)) - (format #t "~Tstrip: ~D~%" (-> obj strip)) - (format #t "~Tregs: ~D~%" (-> obj regs)) - (format #t "~Tfan: ~D~%" (-> obj fan)) - obj +(defmethod inspect vis-gif-tag ((this vis-gif-tag)) + (format #t "[~8x] ~A~%" this 'vis-gif-tag) + (format #t "~Tfog0: ~D~%" (-> this fog0)) + (format #t "~Tstrip: ~D~%" (-> this strip)) + (format #t "~Tregs: ~D~%" (-> this regs)) + (format #t "~Tfan: ~D~%" (-> this fan)) + this ) ;; definition of type cull-info @@ -49,25 +49,25 @@ ) ;; definition for method 3 of type cull-info -(defmethod inspect cull-info ((obj cull-info)) - (format #t "[~8x] ~A~%" obj 'cull-info) - (format #t "~Tx-fact: ~f~%" (-> obj x-fact)) - (format #t "~Ty-fact: ~f~%" (-> obj y-fact)) - (format #t "~Tz-fact: ~f~%" (-> obj z-fact)) - (format #t "~Tcam-radius: ~f~%" (-> obj cam-radius)) - (format #t "~Tcam-x: ~f~%" (-> obj cam-x)) - (format #t "~Tcam-y: ~f~%" (-> obj cam-y)) - (format #t "~Txz-dir-ax: ~f~%" (-> obj xz-dir-ax)) - (format #t "~Txz-dir-az: ~f~%" (-> obj xz-dir-az)) - (format #t "~Txz-dir-bx: ~f~%" (-> obj xz-dir-bx)) - (format #t "~Txz-dir-bz: ~f~%" (-> obj xz-dir-bz)) - (format #t "~Txz-cross-ab: ~f~%" (-> obj xz-cross-ab)) - (format #t "~Tyz-dir-ay: ~f~%" (-> obj yz-dir-ay)) - (format #t "~Tyz-dir-az: ~f~%" (-> obj yz-dir-az)) - (format #t "~Tyz-dir-by: ~f~%" (-> obj yz-dir-by)) - (format #t "~Tyz-dir-bz: ~f~%" (-> obj yz-dir-bz)) - (format #t "~Tyz-cross-ab: ~f~%" (-> obj yz-cross-ab)) - obj +(defmethod inspect cull-info ((this cull-info)) + (format #t "[~8x] ~A~%" this 'cull-info) + (format #t "~Tx-fact: ~f~%" (-> this x-fact)) + (format #t "~Ty-fact: ~f~%" (-> this y-fact)) + (format #t "~Tz-fact: ~f~%" (-> this z-fact)) + (format #t "~Tcam-radius: ~f~%" (-> this cam-radius)) + (format #t "~Tcam-x: ~f~%" (-> this cam-x)) + (format #t "~Tcam-y: ~f~%" (-> this cam-y)) + (format #t "~Txz-dir-ax: ~f~%" (-> this xz-dir-ax)) + (format #t "~Txz-dir-az: ~f~%" (-> this xz-dir-az)) + (format #t "~Txz-dir-bx: ~f~%" (-> this xz-dir-bx)) + (format #t "~Txz-dir-bz: ~f~%" (-> this xz-dir-bz)) + (format #t "~Txz-cross-ab: ~f~%" (-> this xz-cross-ab)) + (format #t "~Tyz-dir-ay: ~f~%" (-> this yz-dir-ay)) + (format #t "~Tyz-dir-az: ~f~%" (-> this yz-dir-az)) + (format #t "~Tyz-dir-by: ~f~%" (-> this yz-dir-by)) + (format #t "~Tyz-dir-bz: ~f~%" (-> this yz-dir-bz)) + (format #t "~Tyz-cross-ab: ~f~%" (-> this yz-cross-ab)) + this ) ;; definition of type math-camera @@ -131,56 +131,56 @@ ;; definition for method 3 of type math-camera ;; INFO: Used lq/sq -(defmethod inspect math-camera ((obj math-camera)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Td: (meters ~m)~%" (-> obj d)) - (format #t "~Tf: (meters ~m)~%" (-> obj f)) - (format #t "~Tfov: (deg ~r)~%" (-> obj fov)) - (format #t "~Tx-ratio: ~f~%" (-> obj x-ratio)) - (format #t "~Ty-ratio: ~f~%" (-> obj y-ratio)) - (format #t "~Tx-pix: ~f~%" (-> obj x-pix)) - (format #t "~Tx-clip: ~f~%" (-> obj x-clip)) - (format #t "~Tx-clip-ratio-in: ~f~%" (-> obj x-clip-ratio-in)) - (format #t "~Tx-clip-ratio-over: ~f~%" (-> obj x-clip-ratio-over)) - (format #t "~Ty-pix: ~f~%" (-> obj y-pix)) - (format #t "~Ty-clip: ~f~%" (-> obj y-clip)) - (format #t "~Ty-clip-ratio-in: ~f~%" (-> obj y-clip-ratio-in)) - (format #t "~Ty-clip-ratio-over: ~f~%" (-> obj y-clip-ratio-over)) - (format #t "~Tcull-info: #~%" (-> obj cull-info)) - (format #t "~Tfog-start: (meters ~m)~%" (-> obj fog-start)) - (format #t "~Tfog-end: (meters ~m)~%" (-> obj fog-end)) - (format #t "~Tfog-max: ~f~%" (-> obj fog-max)) - (format #t "~Tfog-min: ~f~%" (-> obj fog-min)) - (format #t "~Treset: ~D~%" (-> obj reset)) - (format #t "~Tsmooth-step: ~f~%" (-> obj smooth-step)) - (format #t "~Tsmooth-t: ~f~%" (-> obj smooth-t)) - (format #t "~Tperspective: #~%" (-> obj perspective)) - (format #t "~Tisometric: #~%" (-> obj isometric)) - (format #t "~Tsprite-2d: #~%" (-> obj sprite-2d)) - (format #t "~Tsprite-2d-hvdf: #~%" (-> obj sprite-2d-hvdf)) - (format #t "~Tcamera-rot: #~%" (-> obj camera-rot)) - (format #t "~Tinv-camera-rot: #~%" (-> obj inv-camera-rot)) - (format #t "~Tinv-camera-rot-smooth: #~%" (-> obj inv-camera-rot-smooth)) - (format #t "~Tinv-camera-rot-smooth-from: #~%" (-> obj inv-camera-rot-smooth-from)) - (format #t "~Tcamera-temp: #~%" (-> obj camera-temp)) - (format #t "~Tprev-camera-temp: #~%" (-> obj prev-camera-temp)) - (format #t "~Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) - (format #t "~Thvdf-off: #~%" (-> obj hvdf-off)) - (format #t "~Tguard: #~%" (-> obj guard)) - (format #t "~Tvis-gifs[4] @ #x~X~%" (-> obj vis-gifs)) - (format #t "~Tgiftex: ~D~%" (-> obj vis-gifs-quads 0)) - (format #t "~Tgifgr: ~D~%" (-> obj vis-gifs-quads 1)) - (format #t "~Tgiftex-trans: ~D~%" (-> obj vis-gifs-quads 2)) - (format #t "~Tgifgr-trans: ~D~%" (-> obj vis-gifs-quads 3)) - (format #t "~Tpfog0: ~f~%" (-> obj pfog0)) - (format #t "~Tpfog1: ~f~%" (-> obj pfog1)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Tplane[4] @ #x~X~%" (-> obj plane)) - (format #t "~Tguard-plane[4] @ #x~X~%" (-> obj guard-plane)) - (format #t "~Tshrub-mat: #~%" (-> obj shrub-mat)) - (format #t "~Tfov-correction-factor: ~f~%" (-> obj fov-correction-factor)) - obj +(defmethod inspect math-camera ((this math-camera)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Td: (meters ~m)~%" (-> this d)) + (format #t "~Tf: (meters ~m)~%" (-> this f)) + (format #t "~Tfov: (deg ~r)~%" (-> this fov)) + (format #t "~Tx-ratio: ~f~%" (-> this x-ratio)) + (format #t "~Ty-ratio: ~f~%" (-> this y-ratio)) + (format #t "~Tx-pix: ~f~%" (-> this x-pix)) + (format #t "~Tx-clip: ~f~%" (-> this x-clip)) + (format #t "~Tx-clip-ratio-in: ~f~%" (-> this x-clip-ratio-in)) + (format #t "~Tx-clip-ratio-over: ~f~%" (-> this x-clip-ratio-over)) + (format #t "~Ty-pix: ~f~%" (-> this y-pix)) + (format #t "~Ty-clip: ~f~%" (-> this y-clip)) + (format #t "~Ty-clip-ratio-in: ~f~%" (-> this y-clip-ratio-in)) + (format #t "~Ty-clip-ratio-over: ~f~%" (-> this y-clip-ratio-over)) + (format #t "~Tcull-info: #~%" (-> this cull-info)) + (format #t "~Tfog-start: (meters ~m)~%" (-> this fog-start)) + (format #t "~Tfog-end: (meters ~m)~%" (-> this fog-end)) + (format #t "~Tfog-max: ~f~%" (-> this fog-max)) + (format #t "~Tfog-min: ~f~%" (-> this fog-min)) + (format #t "~Treset: ~D~%" (-> this reset)) + (format #t "~Tsmooth-step: ~f~%" (-> this smooth-step)) + (format #t "~Tsmooth-t: ~f~%" (-> this smooth-t)) + (format #t "~Tperspective: #~%" (-> this perspective)) + (format #t "~Tisometric: #~%" (-> this isometric)) + (format #t "~Tsprite-2d: #~%" (-> this sprite-2d)) + (format #t "~Tsprite-2d-hvdf: #~%" (-> this sprite-2d-hvdf)) + (format #t "~Tcamera-rot: #~%" (-> this camera-rot)) + (format #t "~Tinv-camera-rot: #~%" (-> this inv-camera-rot)) + (format #t "~Tinv-camera-rot-smooth: #~%" (-> this inv-camera-rot-smooth)) + (format #t "~Tinv-camera-rot-smooth-from: #~%" (-> this inv-camera-rot-smooth-from)) + (format #t "~Tcamera-temp: #~%" (-> this camera-temp)) + (format #t "~Tprev-camera-temp: #~%" (-> this prev-camera-temp)) + (format #t "~Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~Tinv-hmge-scale: #~%" (-> this inv-hmge-scale)) + (format #t "~Thvdf-off: #~%" (-> this hvdf-off)) + (format #t "~Tguard: #~%" (-> this guard)) + (format #t "~Tvis-gifs[4] @ #x~X~%" (-> this vis-gifs)) + (format #t "~Tgiftex: ~D~%" (-> this vis-gifs-quads 0)) + (format #t "~Tgifgr: ~D~%" (-> this vis-gifs-quads 1)) + (format #t "~Tgiftex-trans: ~D~%" (-> this vis-gifs-quads 2)) + (format #t "~Tgifgr-trans: ~D~%" (-> this vis-gifs-quads 3)) + (format #t "~Tpfog0: ~f~%" (-> this pfog0)) + (format #t "~Tpfog1: ~f~%" (-> this pfog1)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Tplane[4] @ #x~X~%" (-> this plane)) + (format #t "~Tguard-plane[4] @ #x~X~%" (-> this guard-plane)) + (format #t "~Tshrub-mat: #~%" (-> this shrub-mat)) + (format #t "~Tfov-correction-factor: ~f~%" (-> this fov-correction-factor)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc index 38697e719d..1cf45f5f91 100644 --- a/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/math-camera_REF.gc @@ -12,11 +12,11 @@ ) ;; definition for method 3 of type fog-corrector -(defmethod inspect fog-corrector ((obj fog-corrector)) - (format #t "[~8x] ~A~%" obj 'fog-corrector) - (format #t "~Tfog-end: ~f~%" (-> obj fog-end)) - (format #t "~Tfog-start: ~f~%" (-> obj fog-start)) - obj +(defmethod inspect fog-corrector ((this fog-corrector)) + (format #t "[~8x] ~A~%" this 'fog-corrector) + (format #t "~Tfog-end: ~f~%" (-> this fog-end)) + (format #t "~Tfog-start: ~f~%" (-> this fog-start)) + this ) ;; definition for function fog-corrector-setup diff --git a/test/decompiler/reference/jak1/engine/gfx/merc/generic-merc-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/merc/generic-merc-h_REF.gc index 90527b0291..8bce94b05f 100644 --- a/test/decompiler/reference/jak1/engine/gfx/merc/generic-merc-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/merc/generic-merc-h_REF.gc @@ -13,12 +13,12 @@ ) ;; definition for method 3 of type merc-matrix -(defmethod inspect merc-matrix ((obj merc-matrix)) - (format #t "[~8x] ~A~%" obj 'merc-matrix) - (format #t "~Tquad[8] @ #x~X~%" (-> obj quad)) - (format #t "~Tvector[8] @ #x~X~%" (-> obj quad)) - (format #t "~Ttag: ~D~%" (-> obj tag)) - obj +(defmethod inspect merc-matrix ((this merc-matrix)) + (format #t "[~8x] ~A~%" this 'merc-matrix) + (format #t "~Tquad[8] @ #x~X~%" (-> this quad)) + (format #t "~Tvector[8] @ #x~X~%" (-> this quad)) + (format #t "~Ttag: ~D~%" (-> this tag)) + this ) ;; definition of type generic-merc-tag @@ -33,15 +33,15 @@ ;; definition for method 3 of type generic-merc-tag ;; INFO: Used lq/sq -(defmethod inspect generic-merc-tag ((obj generic-merc-tag)) - (format #t "[~8x] ~A~%" obj 'generic-merc-tag) - (format #t "~Tdma: #x~X~%" (-> obj dma)) - (format #t "~Tvif0: #x~X~%" (-> obj vif0)) - (format #t "~Tvif1: #x~X~%" (-> obj vif1)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - (format #t "~Tnext-ptr: ~D~%" (-> obj vif1)) - (format #t "~Tsize: ~D~%" (-> obj vif0)) - obj +(defmethod inspect generic-merc-tag ((this generic-merc-tag)) + (format #t "[~8x] ~A~%" this 'generic-merc-tag) + (format #t "~Tdma: #x~X~%" (-> this dma)) + (format #t "~Tvif0: #x~X~%" (-> this vif0)) + (format #t "~Tvif1: #x~X~%" (-> this vif1)) + (format #t "~Tquad: ~D~%" (-> this quad)) + (format #t "~Tnext-ptr: ~D~%" (-> this vif1)) + (format #t "~Tsize: ~D~%" (-> this vif0)) + this ) ;; definition of type generic-merc-ctrl @@ -57,13 +57,13 @@ ) ;; definition for method 3 of type generic-merc-ctrl -(defmethod inspect generic-merc-ctrl ((obj generic-merc-ctrl)) - (format #t "[~8x] ~A~%" obj 'generic-merc-ctrl) - (format #t "~Ttag: #~%" (-> obj tag)) - (format #t "~Tlights: #~%" (-> obj lights)) - (format #t "~Theader: #~%" (-> obj header)) - (format #t "~Teffect: #~%" (-> obj effect)) - obj +(defmethod inspect generic-merc-ctrl ((this generic-merc-ctrl)) + (format #t "[~8x] ~A~%" this 'generic-merc-ctrl) + (format #t "~Ttag: #~%" (-> this tag)) + (format #t "~Tlights: #~%" (-> this lights)) + (format #t "~Theader: #~%" (-> this header)) + (format #t "~Teffect: #~%" (-> this effect)) + this ) ;; definition of type generic-merc-ctrl-with-sfx @@ -76,14 +76,14 @@ ) ;; definition for method 3 of type generic-merc-ctrl-with-sfx -(defmethod inspect generic-merc-ctrl-with-sfx ((obj generic-merc-ctrl-with-sfx)) - (format #t "[~8x] ~A~%" obj 'generic-merc-ctrl-with-sfx) - (format #t "~Ttag: #~%" (-> obj tag)) - (format #t "~Tlights: #~%" (-> obj lights)) - (format #t "~Theader: #~%" (-> obj header)) - (format #t "~Teffect: #~%" (-> obj effect)) - (format #t "~Tsfx-data[11] @ #x~X~%" (-> obj sfx-data)) - obj +(defmethod inspect generic-merc-ctrl-with-sfx ((this generic-merc-ctrl-with-sfx)) + (format #t "[~8x] ~A~%" this 'generic-merc-ctrl-with-sfx) + (format #t "~Ttag: #~%" (-> this tag)) + (format #t "~Tlights: #~%" (-> this lights)) + (format #t "~Theader: #~%" (-> this header)) + (format #t "~Teffect: #~%" (-> this effect)) + (format #t "~Tsfx-data[11] @ #x~X~%" (-> this sfx-data)) + this ) ;; definition of type generic-merc-input @@ -102,16 +102,16 @@ ) ;; definition for method 3 of type generic-merc-input -(defmethod inspect generic-merc-input ((obj generic-merc-input)) - (format #t "[~8x] ~A~%" obj 'generic-merc-input) - (format #t "~Tgeo-tag: #~%" (-> obj geo-tag)) - (format #t "~Tgeo-block[1296] @ #x~X~%" (-> obj geo-block)) - (format #t "~Tbyte-header: #~%" (-> obj geo-block)) - (format #t "~Tmatrix[9] @ #x~X~%" (-> obj matrix)) - (format #t "~Tcontrol: #~%" (-> obj control)) - (format #t "~Tend-tag: #~%" (-> obj end-tag)) - (format #t "~Tshader: #~%" (-> obj shader)) - obj +(defmethod inspect generic-merc-input ((this generic-merc-input)) + (format #t "[~8x] ~A~%" this 'generic-merc-input) + (format #t "~Tgeo-tag: #~%" (-> this geo-tag)) + (format #t "~Tgeo-block[1296] @ #x~X~%" (-> this geo-block)) + (format #t "~Tbyte-header: #~%" (-> this geo-block)) + (format #t "~Tmatrix[9] @ #x~X~%" (-> this matrix)) + (format #t "~Tcontrol: #~%" (-> this control)) + (format #t "~Tend-tag: #~%" (-> this end-tag)) + (format #t "~Tshader: #~%" (-> this shader)) + this ) ;; definition of type generic-merc-output @@ -129,15 +129,15 @@ ) ;; definition for method 3 of type generic-merc-output -(defmethod inspect generic-merc-output ((obj generic-merc-output)) - (format #t "[~8x] ~A~%" obj 'generic-merc-output) - (format #t "~Tinfo: #~%" (-> obj info)) - (format #t "~Theader: #~%" (-> obj header)) - (format #t "~Tindex-kick-table[80] @ #x~X~%" (-> obj index-kick-table)) - (format #t "~Tindex-table[160] @ #x~X~%" (-> obj index-kick-table)) - (format #t "~Tinverse-table[256] @ #x~X~%" (-> obj inverse-table)) - (format #t "~Tvertex-table[72] @ #x~X~%" (-> obj vertex-table)) - obj +(defmethod inspect generic-merc-output ((this generic-merc-output)) + (format #t "[~8x] ~A~%" this 'generic-merc-output) + (format #t "~Tinfo: #~%" (-> this info)) + (format #t "~Theader: #~%" (-> this header)) + (format #t "~Tindex-kick-table[80] @ #x~X~%" (-> this index-kick-table)) + (format #t "~Tindex-table[160] @ #x~X~%" (-> this index-kick-table)) + (format #t "~Tinverse-table[256] @ #x~X~%" (-> this inverse-table)) + (format #t "~Tvertex-table[72] @ #x~X~%" (-> this vertex-table)) + this ) ;; definition of type generic-merc-dcache @@ -155,15 +155,15 @@ ) ;; definition for method 3 of type generic-merc-dcache -(defmethod inspect generic-merc-dcache ((obj generic-merc-dcache)) - (format #t "[~8x] ~A~%" obj 'generic-merc-dcache) - (format #t "~Toutput-a: #~%" (-> obj output-a)) - (format #t "~Toutput-b: #~%" (-> obj output-b)) - (format #t "~Tinv-table-1[544] @ #x~X~%" (-> obj inv-table-1)) - (format #t "~Tinv-table-7[544] @ #x~X~%" (-> obj inv-table-7)) - (format #t "~Tinv-safety[16] @ #x~X~%" (-> obj inv-safety)) - (format #t "~Teffect-data[1584] @ #x~X~%" (-> obj effect-data)) - obj +(defmethod inspect generic-merc-dcache ((this generic-merc-dcache)) + (format #t "[~8x] ~A~%" this 'generic-merc-dcache) + (format #t "~Toutput-a: #~%" (-> this output-a)) + (format #t "~Toutput-b: #~%" (-> this output-b)) + (format #t "~Tinv-table-1[544] @ #x~X~%" (-> this inv-table-1)) + (format #t "~Tinv-table-7[544] @ #x~X~%" (-> this inv-table-7)) + (format #t "~Tinv-safety[16] @ #x~X~%" (-> this inv-safety)) + (format #t "~Teffect-data[1584] @ #x~X~%" (-> this effect-data)) + this ) ;; definition of type gm-shadow @@ -199,33 +199,33 @@ ) ;; definition for method 3 of type gm-shadow -(defmethod inspect gm-shadow ((obj gm-shadow)) - (format #t "[~8x] ~A~%" obj 'gm-shadow) - (format #t "~Tperspective: #~%" (-> obj perspective)) - (format #t "~Tisometric: #~%" (-> obj isometric)) - (format #t "~Tinv-camera-rot: #~%" (-> obj inv-camera-rot)) - (format #t "~Tenvmap-shader: #~%" (-> obj envmap-shader)) - (format #t "~Tcurrent-chain: ~D~%" (-> obj current-chain)) - (format #t "~Tnext-chain: ~D~%" (-> obj next-chain)) - (format #t "~Tbuf-index: ~D~%" (-> obj buf-index)) - (format #t "~Tfragment-count: ~D~%" (-> obj fragment-count)) - (format #t "~Twrite-limit: ~D~%" (-> obj write-limit)) - (format #t "~Tindexed-input-base: #~%" (-> obj indexed-input-base)) - (format #t "~Tother-input-base: #~%" (-> obj other-input-base)) - (format #t "~Tindexed-output-base: #~%" (-> obj indexed-output-base)) - (format #t "~Tother-output-base: #~%" (-> obj other-output-base)) - (format #t "~Tp-input: #x~X~%" (-> obj p-input)) - (format #t "~Tgsf-buf: #~%" (-> obj gsf-buf)) - (format #t "~Tp-fheader: #~%" (-> obj p-fheader)) - (format #t "~Tmercneric-convert: ~A~%" (-> obj mercneric-convert)) - (format #t "~Tgeneric-prepare-dma-single: ~A~%" (-> obj generic-prepare-dma-single)) - (format #t "~Tgeneric-prepare-dma-double: ~A~%" (-> obj generic-prepare-dma-double)) - (format #t "~Tgeneric-light-proc: ~A~%" (-> obj generic-light-proc)) - (format #t "~Tgeneric-envmap-proc: ~A~%" (-> obj generic-envmap-proc)) - (format #t "~Thigh-speed-reject: ~A~%" (-> obj high-speed-reject)) - (format #t "~Thsr-xmult: #~%" (-> obj hsr-xmult)) - (format #t "~Thsr-ymult: #~%" (-> obj hsr-ymult)) - obj +(defmethod inspect gm-shadow ((this gm-shadow)) + (format #t "[~8x] ~A~%" this 'gm-shadow) + (format #t "~Tperspective: #~%" (-> this perspective)) + (format #t "~Tisometric: #~%" (-> this isometric)) + (format #t "~Tinv-camera-rot: #~%" (-> this inv-camera-rot)) + (format #t "~Tenvmap-shader: #~%" (-> this envmap-shader)) + (format #t "~Tcurrent-chain: ~D~%" (-> this current-chain)) + (format #t "~Tnext-chain: ~D~%" (-> this next-chain)) + (format #t "~Tbuf-index: ~D~%" (-> this buf-index)) + (format #t "~Tfragment-count: ~D~%" (-> this fragment-count)) + (format #t "~Twrite-limit: ~D~%" (-> this write-limit)) + (format #t "~Tindexed-input-base: #~%" (-> this indexed-input-base)) + (format #t "~Tother-input-base: #~%" (-> this other-input-base)) + (format #t "~Tindexed-output-base: #~%" (-> this indexed-output-base)) + (format #t "~Tother-output-base: #~%" (-> this other-output-base)) + (format #t "~Tp-input: #x~X~%" (-> this p-input)) + (format #t "~Tgsf-buf: #~%" (-> this gsf-buf)) + (format #t "~Tp-fheader: #~%" (-> this p-fheader)) + (format #t "~Tmercneric-convert: ~A~%" (-> this mercneric-convert)) + (format #t "~Tgeneric-prepare-dma-single: ~A~%" (-> this generic-prepare-dma-single)) + (format #t "~Tgeneric-prepare-dma-double: ~A~%" (-> this generic-prepare-dma-double)) + (format #t "~Tgeneric-light-proc: ~A~%" (-> this generic-light-proc)) + (format #t "~Tgeneric-envmap-proc: ~A~%" (-> this generic-envmap-proc)) + (format #t "~Thigh-speed-reject: ~A~%" (-> this high-speed-reject)) + (format #t "~Thsr-xmult: #~%" (-> this hsr-xmult)) + (format #t "~Thsr-ymult: #~%" (-> this hsr-ymult)) + this ) ;; definition of type generic-merc-work @@ -242,14 +242,14 @@ ) ;; definition for method 3 of type generic-merc-work -(defmethod inspect generic-merc-work ((obj generic-merc-work)) - (format #t "[~8x] ~A~%" obj 'generic-merc-work) - (format #t "~Tinput-a: #~%" (-> obj input-a)) - (format #t "~Tinput-b: #~%" (-> obj input-b)) - (format #t "~Tctrl: #~%" (-> obj ctrl)) - (format #t "~Tshadow: #~%" (-> obj shadow)) - (format #t "~Tstack[16] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect generic-merc-work ((this generic-merc-work)) + (format #t "[~8x] ~A~%" this 'generic-merc-work) + (format #t "~Tinput-a: #~%" (-> this input-a)) + (format #t "~Tinput-b: #~%" (-> this input-b)) + (format #t "~Tctrl: #~%" (-> this ctrl)) + (format #t "~Tshadow: #~%" (-> this shadow)) + (format #t "~Tstack[16] @ #x~X~%" (-> this stack)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/merc/merc-death_REF.gc b/test/decompiler/reference/jak1/engine/gfx/merc/merc-death_REF.gc index b535357316..5c852d6b5b 100644 --- a/test/decompiler/reference/jak1/engine/gfx/merc/merc-death_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/merc/merc-death_REF.gc @@ -18,14 +18,14 @@ ) ;; definition for method 3 of type death-info -(defmethod inspect death-info ((obj death-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tvertex-skip: ~D~%" (-> obj vertex-skip)) - (format #t "~Ttimer: ~D~%" (-> obj timer)) - (format #t "~Toverlap: ~D~%" (-> obj overlap)) - (format #t "~Teffect: ~D~%" (-> obj effect)) - (format #t "~Tsound: ~A~%" (-> obj sound)) - obj +(defmethod inspect death-info ((this death-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tvertex-skip: ~D~%" (-> this vertex-skip)) + (format #t "~Ttimer: ~D~%" (-> this timer)) + (format #t "~Toverlap: ~D~%" (-> this overlap)) + (format #t "~Teffect: ~D~%" (-> this effect)) + (format #t "~Tsound: ~A~%" (-> this sound)) + this ) ;; definition for function birth-func-death-sparks diff --git a/test/decompiler/reference/jak1/engine/gfx/merc/merc-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/merc/merc-h_REF.gc index bab630e364..b14bd86475 100644 --- a/test/decompiler/reference/jak1/engine/gfx/merc/merc-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/merc/merc-h_REF.gc @@ -15,16 +15,16 @@ ) ;; definition for method 3 of type ripple-merc-query -(defmethod inspect ripple-merc-query ((obj ripple-merc-query)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tstart-vertex: ~D~%" (-> obj start-vertex)) - (format #t "~Tvertex-skip: ~D~%" (-> obj vertex-skip)) - (format #t "~Tvertex-count: ~D~%" (-> obj vertex-count)) - (format #t "~Tcurrent-loc: ~D~%" (-> obj current-loc)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect ripple-merc-query ((this ripple-merc-query)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tstart-vertex: ~D~%" (-> this start-vertex)) + (format #t "~Tvertex-skip: ~D~%" (-> this vertex-skip)) + (format #t "~Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~Tcurrent-loc: ~D~%" (-> this current-loc)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -53,23 +53,23 @@ ) ;; definition for method 3 of type merc-byte-header -(defmethod inspect merc-byte-header ((obj merc-byte-header)) - (format #t "[~8x] ~A~%" obj 'merc-byte-header) - (format #t "~Tsrcdest-off: ~D~%" (-> obj srcdest-off)) - (format #t "~Trgba-off: ~D~%" (-> obj rgba-off)) - (format #t "~Tlump-off: ~D~%" (-> obj lump-off)) - (format #t "~Tfp-off: ~D~%" (-> obj fp-off)) - (format #t "~Tmat1-cnt: ~D~%" (-> obj mat1-cnt)) - (format #t "~Tmat2-cnt: ~D~%" (-> obj mat2-cnt)) - (format #t "~Tmat3-cnt: ~D~%" (-> obj mat3-cnt)) - (format #t "~Tsamecopy-cnt: ~D~%" (-> obj samecopy-cnt)) - (format #t "~Tcrosscopy-cnt: ~D~%" (-> obj crosscopy-cnt)) - (format #t "~Tstrip-len: ~D~%" (-> obj strip-len)) - (format #t "~Tmm-quadword-fp-off: ~D~%" (-> obj mm-quadword-fp-off)) - (format #t "~Tmm-quadword-size: ~D~%" (-> obj mm-quadword-size)) - (format #t "~Tperc-off: ~D~%" (-> obj perc-off)) - (format #t "~Tmat-slot[10] @ #x~X~%" (-> obj mat-slot)) - obj +(defmethod inspect merc-byte-header ((this merc-byte-header)) + (format #t "[~8x] ~A~%" this 'merc-byte-header) + (format #t "~Tsrcdest-off: ~D~%" (-> this srcdest-off)) + (format #t "~Trgba-off: ~D~%" (-> this rgba-off)) + (format #t "~Tlump-off: ~D~%" (-> this lump-off)) + (format #t "~Tfp-off: ~D~%" (-> this fp-off)) + (format #t "~Tmat1-cnt: ~D~%" (-> this mat1-cnt)) + (format #t "~Tmat2-cnt: ~D~%" (-> this mat2-cnt)) + (format #t "~Tmat3-cnt: ~D~%" (-> this mat3-cnt)) + (format #t "~Tsamecopy-cnt: ~D~%" (-> this samecopy-cnt)) + (format #t "~Tcrosscopy-cnt: ~D~%" (-> this crosscopy-cnt)) + (format #t "~Tstrip-len: ~D~%" (-> this strip-len)) + (format #t "~Tmm-quadword-fp-off: ~D~%" (-> this mm-quadword-fp-off)) + (format #t "~Tmm-quadword-size: ~D~%" (-> this mm-quadword-size)) + (format #t "~Tperc-off: ~D~%" (-> this perc-off)) + (format #t "~Tmat-slot[10] @ #x~X~%" (-> this mat-slot)) + this ) ;; definition of type merc-fragment @@ -86,11 +86,11 @@ ) ;; definition for method 3 of type merc-fragment -(defmethod inspect merc-fragment ((obj merc-fragment)) - (format #t "[~8x] ~A~%" obj 'merc-fragment) - (format #t "~Theader: #~%" (-> obj header)) - (format #t "~Trest[1] @ #x~X~%" (-> obj rest)) - obj +(defmethod inspect merc-fragment ((this merc-fragment)) + (format #t "[~8x] ~A~%" this 'merc-fragment) + (format #t "~Theader: #~%" (-> this header)) + (format #t "~Trest[1] @ #x~X~%" (-> this rest)) + this ) ;; definition of type merc-vtx @@ -114,21 +114,21 @@ ) ;; definition for method 3 of type merc-vtx -(defmethod inspect merc-vtx ((obj merc-vtx)) - (format #t "[~8x] ~A~%" obj 'merc-vtx) - (format #t "~Tmat-0: ~D~%" (-> obj mat-0)) - (format #t "~Tmat-1: ~D~%" (-> obj mat-1)) - (format #t "~Tnrm-x: ~D~%" (-> obj nrm-x)) - (format #t "~Tpos-x: ~D~%" (-> obj pos-x)) - (format #t "~Tdst-0: ~D~%" (-> obj dst-0)) - (format #t "~Tdst-1: ~D~%" (-> obj dst-1)) - (format #t "~Tnrm-y: ~D~%" (-> obj nrm-y)) - (format #t "~Tpos-y: ~D~%" (-> obj pos-y)) - (format #t "~Ttex-s: ~D~%" (-> obj tex-s)) - (format #t "~Ttex-t: ~D~%" (-> obj tex-t)) - (format #t "~Tnrm-z: ~D~%" (-> obj nrm-z)) - (format #t "~Tpos-z: ~D~%" (-> obj pos-z)) - obj +(defmethod inspect merc-vtx ((this merc-vtx)) + (format #t "[~8x] ~A~%" this 'merc-vtx) + (format #t "~Tmat-0: ~D~%" (-> this mat-0)) + (format #t "~Tmat-1: ~D~%" (-> this mat-1)) + (format #t "~Tnrm-x: ~D~%" (-> this nrm-x)) + (format #t "~Tpos-x: ~D~%" (-> this pos-x)) + (format #t "~Tdst-0: ~D~%" (-> this dst-0)) + (format #t "~Tdst-1: ~D~%" (-> this dst-1)) + (format #t "~Tnrm-y: ~D~%" (-> this nrm-y)) + (format #t "~Tpos-y: ~D~%" (-> this pos-y)) + (format #t "~Ttex-s: ~D~%" (-> this tex-s)) + (format #t "~Ttex-t: ~D~%" (-> this tex-t)) + (format #t "~Tnrm-z: ~D~%" (-> this nrm-z)) + (format #t "~Tpos-z: ~D~%" (-> this pos-z)) + this ) ;; definition of type merc-fp-header @@ -147,16 +147,16 @@ ) ;; definition for method 3 of type merc-fp-header -(defmethod inspect merc-fp-header ((obj merc-fp-header)) - (format #t "[~8x] ~A~%" obj 'merc-fp-header) - (format #t "~Tx-add: ~f~%" (-> obj x-add)) - (format #t "~Ty-add: ~f~%" (-> obj y-add)) - (format #t "~Tz-add: ~f~%" (-> obj z-add)) - (format #t "~Tshader-cnt: ~D~%" (-> obj shader-cnt)) - (format #t "~Tkick-info-offset: ~D~%" (-> obj kick-info-offset)) - (format #t "~Tkick-info-step: ~D~%" (-> obj kick-info-step)) - (format #t "~Thword-cnt: ~D~%" (-> obj hword-cnt)) - obj +(defmethod inspect merc-fp-header ((this merc-fp-header)) + (format #t "[~8x] ~A~%" this 'merc-fp-header) + (format #t "~Tx-add: ~f~%" (-> this x-add)) + (format #t "~Ty-add: ~f~%" (-> this y-add)) + (format #t "~Tz-add: ~f~%" (-> this z-add)) + (format #t "~Tshader-cnt: ~D~%" (-> this shader-cnt)) + (format #t "~Tkick-info-offset: ~D~%" (-> this kick-info-offset)) + (format #t "~Tkick-info-step: ~D~%" (-> this kick-info-step)) + (format #t "~Thword-cnt: ~D~%" (-> this hword-cnt)) + this ) ;; definition for function merc-fragment-fp-data @@ -177,11 +177,11 @@ ) ;; definition for method 3 of type merc-mat-dest -(defmethod inspect merc-mat-dest ((obj merc-mat-dest)) - (format #t "[~8x] ~A~%" obj 'merc-mat-dest) - (format #t "~Tmatrix-number: ~D~%" (-> obj matrix-number)) - (format #t "~Tmatrix-dest: ~D~%" (-> obj matrix-dest)) - obj +(defmethod inspect merc-mat-dest ((this merc-mat-dest)) + (format #t "[~8x] ~A~%" this 'merc-mat-dest) + (format #t "~Tmatrix-number: ~D~%" (-> this matrix-number)) + (format #t "~Tmatrix-dest: ~D~%" (-> this matrix-dest)) + this ) ;; definition of type merc-fragment-control @@ -198,15 +198,14 @@ ) ;; definition for method 3 of type merc-fragment-control -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect merc-fragment-control ((obj merc-fragment-control)) - (format #t "[~8x] ~A~%" obj 'merc-fragment-control) - (format #t "~Tunsigned-four-count: ~D~%" (-> obj unsigned-four-count)) - (format #t "~Tlump-four-count: ~D~%" (-> obj lump-four-count)) - (format #t "~Tfp-qwc: ~D~%" (-> obj fp-qwc)) - (format #t "~Tmat-xfer-count: ~D~%" (-> obj mat-xfer-count)) - (format #t "~Tmat-dest-data[0] @ #x~X~%" (-> obj mat-dest-data)) - obj +(defmethod inspect merc-fragment-control ((this merc-fragment-control)) + (format #t "[~8x] ~A~%" this 'merc-fragment-control) + (format #t "~Tunsigned-four-count: ~D~%" (-> this unsigned-four-count)) + (format #t "~Tlump-four-count: ~D~%" (-> this lump-four-count)) + (format #t "~Tfp-qwc: ~D~%" (-> this fp-qwc)) + (format #t "~Tmat-xfer-count: ~D~%" (-> this mat-xfer-count)) + (format #t "~Tmat-dest-data[0] @ #x~X~%" (-> this mat-dest-data)) + this ) ;; definition of type merc-blend-data @@ -219,10 +218,10 @@ ) ;; definition for method 3 of type merc-blend-data -(defmethod inspect merc-blend-data ((obj merc-blend-data)) - (format #t "[~8x] ~A~%" obj 'merc-blend-data) - (format #t "~Tint8-data[0] @ #x~X~%" (-> obj int8-data)) - obj +(defmethod inspect merc-blend-data ((this merc-blend-data)) + (format #t "[~8x] ~A~%" this 'merc-blend-data) + (format #t "~Tint8-data[0] @ #x~X~%" (-> this int8-data)) + this ) ;; definition of type merc-blend-ctrl @@ -237,12 +236,12 @@ ) ;; definition for method 3 of type merc-blend-ctrl -(defmethod inspect merc-blend-ctrl ((obj merc-blend-ctrl)) - (format #t "[~8x] ~A~%" obj 'merc-blend-ctrl) - (format #t "~Tblend-vtx-count: ~D~%" (-> obj blend-vtx-count)) - (format #t "~Tnonzero-index-count: ~D~%" (-> obj nonzero-index-count)) - (format #t "~Tbt-index[0] @ #x~X~%" (-> obj bt-index)) - obj +(defmethod inspect merc-blend-ctrl ((this merc-blend-ctrl)) + (format #t "[~8x] ~A~%" this 'merc-blend-ctrl) + (format #t "~Tblend-vtx-count: ~D~%" (-> this blend-vtx-count)) + (format #t "~Tnonzero-index-count: ~D~%" (-> this nonzero-index-count)) + (format #t "~Tbt-index[0] @ #x~X~%" (-> this bt-index)) + this ) ;; definition of type mei-envmap-tint @@ -258,13 +257,13 @@ ) ;; definition for method 3 of type mei-envmap-tint -(defmethod inspect mei-envmap-tint ((obj mei-envmap-tint)) - (format #t "[~8x] ~A~%" obj 'mei-envmap-tint) - (format #t "~Tfade0: ~f~%" (-> obj fade0)) - (format #t "~Tfade1: ~f~%" (-> obj fade1)) - (format #t "~Ttint: ~D~%" (-> obj tint)) - (format #t "~Tdummy: ~D~%" (-> obj dummy)) - obj +(defmethod inspect mei-envmap-tint ((this mei-envmap-tint)) + (format #t "[~8x] ~A~%" this 'mei-envmap-tint) + (format #t "~Tfade0: ~f~%" (-> this fade0)) + (format #t "~Tfade1: ~f~%" (-> this fade1)) + (format #t "~Ttint: ~D~%" (-> this tint)) + (format #t "~Tdummy: ~D~%" (-> this dummy)) + this ) ;; definition of type mei-texture-scroll @@ -283,16 +282,16 @@ ) ;; definition for method 3 of type mei-texture-scroll -(defmethod inspect mei-texture-scroll ((obj mei-texture-scroll)) - (format #t "[~8x] ~A~%" obj 'mei-texture-scroll) - (format #t "~Tmax-dist: ~f~%" (-> obj max-dist)) - (format #t "~Tst-int-scale: ~D~%" (-> obj st-int-scale)) - (format #t "~Ttime-factor: ~D~%" (-> obj time-factor)) - (format #t "~Tscroll-dir: ~D~%" (-> obj scroll-dir)) - (format #t "~Tcached-time: ~D~%" (-> obj cached-time)) - (format #t "~Ttime-delta: ~D~%" (-> obj time-delta)) - (format #t "~Tdummy[7] @ #x~X~%" (-> obj dummy)) - obj +(defmethod inspect mei-texture-scroll ((this mei-texture-scroll)) + (format #t "[~8x] ~A~%" this 'mei-texture-scroll) + (format #t "~Tmax-dist: ~f~%" (-> this max-dist)) + (format #t "~Tst-int-scale: ~D~%" (-> this st-int-scale)) + (format #t "~Ttime-factor: ~D~%" (-> this time-factor)) + (format #t "~Tscroll-dir: ~D~%" (-> this scroll-dir)) + (format #t "~Tcached-time: ~D~%" (-> this cached-time)) + (format #t "~Ttime-delta: ~D~%" (-> this time-delta)) + (format #t "~Tdummy[7] @ #x~X~%" (-> this dummy)) + this ) ;; definition of type mei-ripple @@ -308,13 +307,13 @@ ) ;; definition for method 3 of type mei-ripple -(defmethod inspect mei-ripple ((obj mei-ripple)) - (format #t "[~8x] ~A~%" obj 'mei-ripple) - (format #t "~Tx-base: ~f~%" (-> obj x-base)) - (format #t "~Tz-base: ~f~%" (-> obj z-base)) - (format #t "~Tgrid-size: ~f~%" (-> obj grid-size)) - (format #t "~Tangle: ~f~%" (-> obj angle)) - obj +(defmethod inspect mei-ripple ((this mei-ripple)) + (format #t "[~8x] ~A~%" this 'mei-ripple) + (format #t "~Tx-base: ~f~%" (-> this x-base)) + (format #t "~Tz-base: ~f~%" (-> this z-base)) + (format #t "~Tgrid-size: ~f~%" (-> this grid-size)) + (format #t "~Tangle: ~f~%" (-> this angle)) + this ) ;; definition of type merc-extra-info @@ -331,14 +330,14 @@ ) ;; definition for method 3 of type merc-extra-info -(defmethod inspect merc-extra-info ((obj merc-extra-info)) - (format #t "[~8x] ~A~%" obj 'merc-extra-info) - (format #t "~Tenvmap-tint-offset: ~D~%" (-> obj envmap-tint-offset)) - (format #t "~Tshader-offset: ~D~%" (-> obj shader-offset)) - (format #t "~Ttexture-scroll-offset: ~D~%" (-> obj texture-scroll-offset)) - (format #t "~Tripple-offset: ~D~%" (-> obj ripple-offset)) - (format #t "~Tdummy[12] @ #x~X~%" (-> obj dummy)) - obj +(defmethod inspect merc-extra-info ((this merc-extra-info)) + (format #t "[~8x] ~A~%" this 'merc-extra-info) + (format #t "~Tenvmap-tint-offset: ~D~%" (-> this envmap-tint-offset)) + (format #t "~Tshader-offset: ~D~%" (-> this shader-offset)) + (format #t "~Ttexture-scroll-offset: ~D~%" (-> this texture-scroll-offset)) + (format #t "~Tripple-offset: ~D~%" (-> this ripple-offset)) + (format #t "~Tdummy[12] @ #x~X~%" (-> this dummy)) + this ) ;; definition of type merc-effect @@ -367,22 +366,22 @@ ) ;; definition for method 3 of type merc-effect -(defmethod inspect merc-effect ((obj merc-effect)) - (format #t "[~8x] ~A~%" obj 'merc-effect) - (format #t "~Tfrag-geo: #~%" (-> obj frag-geo)) - (format #t "~Tfrag-ctrl: #~%" (-> obj frag-ctrl)) - (format #t "~Tblend-data: #~%" (-> obj blend-data)) - (format #t "~Tblend-ctrl: #~%" (-> obj blend-ctrl)) - (format #t "~Tdummy0: ~D~%" (-> obj dummy0)) - (format #t "~Teffect-bits: ~D~%" (-> obj effect-bits)) - (format #t "~Tfrag-count: ~D~%" (-> obj frag-count)) - (format #t "~Tblend-frag-count: ~D~%" (-> obj blend-frag-count)) - (format #t "~Ttri-count: ~D~%" (-> obj tri-count)) - (format #t "~Tdvert-count: ~D~%" (-> obj dvert-count)) - (format #t "~Tdummy1: ~D~%" (-> obj dummy1)) - (format #t "~Tenvmap-usage: ~D~%" (-> obj envmap-usage)) - (format #t "~Textra-info: #~%" (-> obj extra-info)) - obj +(defmethod inspect merc-effect ((this merc-effect)) + (format #t "[~8x] ~A~%" this 'merc-effect) + (format #t "~Tfrag-geo: #~%" (-> this frag-geo)) + (format #t "~Tfrag-ctrl: #~%" (-> this frag-ctrl)) + (format #t "~Tblend-data: #~%" (-> this blend-data)) + (format #t "~Tblend-ctrl: #~%" (-> this blend-ctrl)) + (format #t "~Tdummy0: ~D~%" (-> this dummy0)) + (format #t "~Teffect-bits: ~D~%" (-> this effect-bits)) + (format #t "~Tfrag-count: ~D~%" (-> this frag-count)) + (format #t "~Tblend-frag-count: ~D~%" (-> this blend-frag-count)) + (format #t "~Ttri-count: ~D~%" (-> this tri-count)) + (format #t "~Tdvert-count: ~D~%" (-> this dvert-count)) + (format #t "~Tdummy1: ~D~%" (-> this dummy1)) + (format #t "~Tenvmap-usage: ~D~%" (-> this envmap-usage)) + (format #t "~Textra-info: #~%" (-> this extra-info)) + this ) ;; definition of type merc-eye-ctrl @@ -401,16 +400,16 @@ ) ;; definition for method 3 of type merc-eye-ctrl -(defmethod inspect merc-eye-ctrl ((obj merc-eye-ctrl)) - (format #t "[~8x] ~A~%" obj 'merc-eye-ctrl) - (format #t "~Teye-slot: ~D~%" (-> obj eye-slot)) - (format #t "~Tshader-offset: ~D~%" (-> obj shader-offset)) - (format #t "~Tshader-count: ~D~%" (-> obj shader-count)) - (format #t "~Tshader[3] @ #x~X~%" (-> obj iris-shader)) - (format #t "~Tiris-shader: #~%" (-> obj iris-shader)) - (format #t "~Tpupil-shader: #~%" (-> obj pupil-shader)) - (format #t "~Tlid-shader: #~%" (-> obj lid-shader)) - obj +(defmethod inspect merc-eye-ctrl ((this merc-eye-ctrl)) + (format #t "[~8x] ~A~%" this 'merc-eye-ctrl) + (format #t "~Teye-slot: ~D~%" (-> this eye-slot)) + (format #t "~Tshader-offset: ~D~%" (-> this shader-offset)) + (format #t "~Tshader-count: ~D~%" (-> this shader-count)) + (format #t "~Tshader[3] @ #x~X~%" (-> this iris-shader)) + (format #t "~Tiris-shader: #~%" (-> this iris-shader)) + (format #t "~Tpupil-shader: #~%" (-> this pupil-shader)) + (format #t "~Tlid-shader: #~%" (-> this lid-shader)) + this ) ;; definition of type merc-eye-anim-frame @@ -430,16 +429,16 @@ ) ;; definition for method 3 of type merc-eye-anim-frame -(defmethod inspect merc-eye-anim-frame ((obj merc-eye-anim-frame)) - (format #t "[~8x] ~A~%" obj 'merc-eye-anim-frame) - (format #t "~Tpupil-trans-x: ~D~%" (-> obj pupil-trans-x)) - (format #t "~Tpupil-trans-y: ~D~%" (-> obj pupil-trans-y)) - (format #t "~Tblink: ~D~%" (-> obj blink)) - (format #t "~Tiris-scale: ~D~%" (-> obj iris-scale)) - (format #t "~Tpupil-scale: ~D~%" (-> obj pupil-scale)) - (format #t "~Tlid-scale: ~D~%" (-> obj lid-scale)) - (format #t "~Tdword: ~D~%" (-> obj dword)) - obj +(defmethod inspect merc-eye-anim-frame ((this merc-eye-anim-frame)) + (format #t "[~8x] ~A~%" this 'merc-eye-anim-frame) + (format #t "~Tpupil-trans-x: ~D~%" (-> this pupil-trans-x)) + (format #t "~Tpupil-trans-y: ~D~%" (-> this pupil-trans-y)) + (format #t "~Tblink: ~D~%" (-> this blink)) + (format #t "~Tiris-scale: ~D~%" (-> this iris-scale)) + (format #t "~Tpupil-scale: ~D~%" (-> this pupil-scale)) + (format #t "~Tlid-scale: ~D~%" (-> this lid-scale)) + (format #t "~Tdword: ~D~%" (-> this dword)) + this ) ;; definition of type merc-eye-anim-block @@ -453,11 +452,11 @@ ) ;; definition for method 3 of type merc-eye-anim-block -(defmethod inspect merc-eye-anim-block ((obj merc-eye-anim-block)) - (format #t "[~8x] ~A~%" obj 'merc-eye-anim-block) - (format #t "~Tmax-frame: ~D~%" (-> obj max-frame)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect merc-eye-anim-block ((this merc-eye-anim-block)) + (format #t "[~8x] ~A~%" this 'merc-eye-anim-block) + (format #t "~Tmax-frame: ~D~%" (-> this max-frame)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; definition of type merc-ctrl-header @@ -509,49 +508,49 @@ ) ;; definition for method 3 of type merc-ctrl-header -(defmethod inspect merc-ctrl-header ((obj merc-ctrl-header)) - (format #t "[~8x] ~A~%" obj 'merc-ctrl-header) - (format #t "~Txyz-scale: #x~X~%" (-> obj xyz-scale)) - (format #t "~Tst-magic: #x~X~%" (-> obj st-magic)) - (format #t "~Tst-out-a: #x~X~%" (-> obj st-out-a)) - (format #t "~Tst-out-b: #x~X~%" (-> obj st-out-b)) - (format #t "~Tst-vif-add: #x~X~%" (-> obj st-vif-add)) - (format #t "~Tst-int-off: ~D~%" (-> obj st-int-off)) - (format #t "~Tst-int-scale: ~D~%" (-> obj st-int-scale)) - (format #t "~Teffect-count: ~D~%" (-> obj effect-count)) - (format #t "~Tblend-target-count: ~D~%" (-> obj blend-target-count)) - (format #t "~Tfragment-count: ~D~%" (-> obj fragment-count)) - (format #t "~Ttri-count: ~D~%" (-> obj tri-count)) - (format #t "~Tmatrix-count: ~D~%" (-> obj matrix-count)) - (format #t "~Tshader-count: ~D~%" (-> obj shader-count)) - (format #t "~Ttransform-vertex-count: ~D~%" (-> obj transform-vertex-count)) - (format #t "~Tdvert-count: ~D~%" (-> obj dvert-count)) - (format #t "~Tone-mat-count: ~D~%" (-> obj one-mat-count)) - (format #t "~Ttwo-mat-count: ~D~%" (-> obj two-mat-count)) - (format #t "~Ttwo-mat-reuse-count: ~D~%" (-> obj two-mat-reuse-count)) - (format #t "~Tthree-mat-count: ~D~%" (-> obj three-mat-count)) - (format #t "~Tthree-mat-reuse-count: ~D~%" (-> obj three-mat-reuse-count)) - (format #t "~Tshader-upload-count: ~D~%" (-> obj shader-upload-count)) - (format #t "~Tmatrix-upload-count: ~D~%" (-> obj matrix-upload-count)) - (format #t "~Tsame-copy-count: ~D~%" (-> obj same-copy-count)) - (format #t "~Tcross-copy-count: ~D~%" (-> obj cross-copy-count)) - (format #t "~Tnum-verts: ~D~%" (-> obj num-verts)) - (format #t "~Tlongest-edge: ~f~%" (-> obj longest-edge)) - (format #t "~Teye-ctrl: #~%" (-> obj eye-ctrl)) - (format #t "~Tmasks[3] @ #x~X~%" (-> obj masks)) - (format #t "~Tdummy-bytes[48] @ #x~X~%" (&-> obj fragment-count)) - (format #t "~Tenvmap-tint: ~D~%" (-> obj envmap-tint)) - (format #t "~Tquery: ~A~%" (-> obj query)) - (format #t "~Tneeds-clip: ~D~%" (-> obj needs-clip)) - (format #t "~Tuse-isometric: ~D~%" (-> obj use-isometric)) - (format #t "~Tuse-attached-shader: ~D~%" (-> obj use-attached-shader)) - (format #t "~Tdisplay-triangles: ~D~%" (-> obj display-triangles)) - (format #t "~Tdeath-vertex-skip: ~D~%" (-> obj two-mat-count)) - (format #t "~Tdeath-start-vertex: ~D~%" (-> obj two-mat-reuse-count)) - (format #t "~Tdeath-effect: ~D~%" (-> obj death-effect)) - (format #t "~Tuse-translucent: ~D~%" (-> obj shader-upload-count)) - (format #t "~Tdisplay-this-fragment: ~D~%" (-> obj matrix-upload-count)) - obj +(defmethod inspect merc-ctrl-header ((this merc-ctrl-header)) + (format #t "[~8x] ~A~%" this 'merc-ctrl-header) + (format #t "~Txyz-scale: #x~X~%" (-> this xyz-scale)) + (format #t "~Tst-magic: #x~X~%" (-> this st-magic)) + (format #t "~Tst-out-a: #x~X~%" (-> this st-out-a)) + (format #t "~Tst-out-b: #x~X~%" (-> this st-out-b)) + (format #t "~Tst-vif-add: #x~X~%" (-> this st-vif-add)) + (format #t "~Tst-int-off: ~D~%" (-> this st-int-off)) + (format #t "~Tst-int-scale: ~D~%" (-> this st-int-scale)) + (format #t "~Teffect-count: ~D~%" (-> this effect-count)) + (format #t "~Tblend-target-count: ~D~%" (-> this blend-target-count)) + (format #t "~Tfragment-count: ~D~%" (-> this fragment-count)) + (format #t "~Ttri-count: ~D~%" (-> this tri-count)) + (format #t "~Tmatrix-count: ~D~%" (-> this matrix-count)) + (format #t "~Tshader-count: ~D~%" (-> this shader-count)) + (format #t "~Ttransform-vertex-count: ~D~%" (-> this transform-vertex-count)) + (format #t "~Tdvert-count: ~D~%" (-> this dvert-count)) + (format #t "~Tone-mat-count: ~D~%" (-> this one-mat-count)) + (format #t "~Ttwo-mat-count: ~D~%" (-> this two-mat-count)) + (format #t "~Ttwo-mat-reuse-count: ~D~%" (-> this two-mat-reuse-count)) + (format #t "~Tthree-mat-count: ~D~%" (-> this three-mat-count)) + (format #t "~Tthree-mat-reuse-count: ~D~%" (-> this three-mat-reuse-count)) + (format #t "~Tshader-upload-count: ~D~%" (-> this shader-upload-count)) + (format #t "~Tmatrix-upload-count: ~D~%" (-> this matrix-upload-count)) + (format #t "~Tsame-copy-count: ~D~%" (-> this same-copy-count)) + (format #t "~Tcross-copy-count: ~D~%" (-> this cross-copy-count)) + (format #t "~Tnum-verts: ~D~%" (-> this num-verts)) + (format #t "~Tlongest-edge: ~f~%" (-> this longest-edge)) + (format #t "~Teye-ctrl: #~%" (-> this eye-ctrl)) + (format #t "~Tmasks[3] @ #x~X~%" (-> this masks)) + (format #t "~Tdummy-bytes[48] @ #x~X~%" (&-> this fragment-count)) + (format #t "~Tenvmap-tint: ~D~%" (-> this envmap-tint)) + (format #t "~Tquery: ~A~%" (-> this query)) + (format #t "~Tneeds-clip: ~D~%" (-> this needs-clip)) + (format #t "~Tuse-isometric: ~D~%" (-> this use-isometric)) + (format #t "~Tuse-attached-shader: ~D~%" (-> this use-attached-shader)) + (format #t "~Tdisplay-triangles: ~D~%" (-> this display-triangles)) + (format #t "~Tdeath-vertex-skip: ~D~%" (-> this two-mat-count)) + (format #t "~Tdeath-start-vertex: ~D~%" (-> this two-mat-reuse-count)) + (format #t "~Tdeath-effect: ~D~%" (-> this death-effect)) + (format #t "~Tuse-translucent: ~D~%" (-> this shader-upload-count)) + (format #t "~Tdisplay-this-fragment: ~D~%" (-> this matrix-upload-count)) + this ) ;; definition of type merc-ctrl @@ -566,16 +565,15 @@ ) ;; definition for method 3 of type merc-ctrl -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect merc-ctrl ((obj merc-ctrl)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~Theader: #~%" (-> obj header)) - (format #t "~Teffect[0] @ #x~X~%" (-> obj effect)) - obj +(defmethod inspect merc-ctrl ((this merc-ctrl)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~Theader: #~%" (-> this header)) + (format #t "~Teffect[0] @ #x~X~%" (-> this effect)) + this ) ;; definition of type merc-vu1-low-mem @@ -592,14 +590,14 @@ ) ;; definition for method 3 of type merc-vu1-low-mem -(defmethod inspect merc-vu1-low-mem ((obj merc-vu1-low-mem)) - (format #t "[~8x] ~A~%" obj 'merc-vu1-low-mem) - (format #t "~Ttri-strip-gif: #~%" (-> obj tri-strip-gif)) - (format #t "~Tad-gif: #~%" (-> obj ad-gif)) - (format #t "~Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~Tperspective[4] @ #x~X~%" (-> obj perspective)) - (format #t "~Tfog: #~%" (-> obj fog)) - obj +(defmethod inspect merc-vu1-low-mem ((this merc-vu1-low-mem)) + (format #t "[~8x] ~A~%" this 'merc-vu1-low-mem) + (format #t "~Ttri-strip-gif: #~%" (-> this tri-strip-gif)) + (format #t "~Tad-gif: #~%" (-> this ad-gif)) + (format #t "~Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~Tperspective[4] @ #x~X~%" (-> this perspective)) + (format #t "~Tfog: #~%" (-> this fog)) + this ) ;; definition of type ripple-wave @@ -620,17 +618,17 @@ ) ;; definition for method 3 of type ripple-wave -(defmethod inspect ripple-wave ((obj ripple-wave)) - (format #t "[~8x] ~A~%" obj 'ripple-wave) - (format #t "~Tscale: ~f~%" (-> obj scale)) - (format #t "~Toffs: ~f~%" (-> obj offs)) - (format #t "~Txdiv: ~D~%" (-> obj xdiv)) - (format #t "~Tzdiv: ~D~%" (-> obj zdiv)) - (format #t "~Tspeed: ~f~%" (-> obj speed)) - (format #t "~Txmul: ~f~%" (-> obj xmul)) - (format #t "~Tzmul: ~f~%" (-> obj zmul)) - (format #t "~Tdelta: ~f~%" (-> obj delta)) - obj +(defmethod inspect ripple-wave ((this ripple-wave)) + (format #t "[~8x] ~A~%" this 'ripple-wave) + (format #t "~Tscale: ~f~%" (-> this scale)) + (format #t "~Toffs: ~f~%" (-> this offs)) + (format #t "~Txdiv: ~D~%" (-> this xdiv)) + (format #t "~Tzdiv: ~D~%" (-> this zdiv)) + (format #t "~Tspeed: ~f~%" (-> this speed)) + (format #t "~Txmul: ~f~%" (-> this xmul)) + (format #t "~Tzmul: ~f~%" (-> this zmul)) + (format #t "~Tdelta: ~f~%" (-> this delta)) + this ) ;; definition of type ripple-wave-set @@ -647,14 +645,14 @@ ) ;; definition for method 3 of type ripple-wave-set -(defmethod inspect ripple-wave-set ((obj ripple-wave-set)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tcount: ~D~%" (-> obj count)) - (format #t "~Tconverted: ~A~%" (-> obj converted)) - (format #t "~Tframe-save: ~D~%" (-> obj frame-save)) - (format #t "~Tnormal-scale: ~f~%" (-> obj normal-scale)) - (format #t "~Twave[4] @ #x~X~%" (-> obj wave)) - obj +(defmethod inspect ripple-wave-set ((this ripple-wave-set)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tcount: ~D~%" (-> this count)) + (format #t "~Tconverted: ~A~%" (-> this converted)) + (format #t "~Tframe-save: ~D~%" (-> this frame-save)) + (format #t "~Tnormal-scale: ~f~%" (-> this normal-scale)) + (format #t "~Twave[4] @ #x~X~%" (-> this wave)) + this ) ;; definition of type ripple-control @@ -678,33 +676,33 @@ ) ;; definition for method 3 of type ripple-control -(defmethod inspect ripple-control ((obj ripple-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tglobal-scale: ~f~%" (-> obj global-scale)) - (format #t "~Tlast-frame-scale: ~f~%" (-> obj last-frame-scale)) - (format #t "~Tclose-fade-dist: ~f~%" (-> obj close-fade-dist)) - (format #t "~Tfar-fade-dist: ~f~%" (-> obj far-fade-dist)) - (format #t "~Tfaded-scale: ~f~%" (-> obj faded-scale)) - (format #t "~Tindividual-normal-scale: ~f~%" (-> obj individual-normal-scale)) - (format #t "~Twaveform: ~A~%" (-> obj waveform)) - (format #t "~Tsend-query: ~A~%" (-> obj send-query)) - (format #t "~Tquery: ~A~%" (-> obj query)) - obj +(defmethod inspect ripple-control ((this ripple-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tglobal-scale: ~f~%" (-> this global-scale)) + (format #t "~Tlast-frame-scale: ~f~%" (-> this last-frame-scale)) + (format #t "~Tclose-fade-dist: ~f~%" (-> this close-fade-dist)) + (format #t "~Tfar-fade-dist: ~f~%" (-> this far-fade-dist)) + (format #t "~Tfaded-scale: ~f~%" (-> this faded-scale)) + (format #t "~Tindividual-normal-scale: ~f~%" (-> this individual-normal-scale)) + (format #t "~Twaveform: ~A~%" (-> this waveform)) + (format #t "~Tsend-query: ~A~%" (-> this send-query)) + (format #t "~Tquery: ~A~%" (-> this query)) + this ) ;; definition for method 0 of type ripple-control (defmethod new ripple-control ((allocation symbol) (type-to-make type)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj global-scale) 0.0) - (set! (-> obj last-frame-scale) -0.001) - (set! (-> obj close-fade-dist) 4096000000.0) - (set! (-> obj far-fade-dist) 8192000000.0) - (set! (-> obj faded-scale) -0.001) - (set! (-> obj waveform) #f) - (set! (-> obj individual-normal-scale) 1.0) - (set! (-> obj send-query) #f) - (set! (-> obj query) #f) - obj + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this global-scale) 0.0) + (set! (-> this last-frame-scale) -0.001) + (set! (-> this close-fade-dist) 4096000000.0) + (set! (-> this far-fade-dist) 8192000000.0) + (set! (-> this faded-scale) -0.001) + (set! (-> this waveform) #f) + (set! (-> this individual-normal-scale) 1.0) + (set! (-> this send-query) #f) + (set! (-> this query) #f) + this ) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc b/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc index a2d6e4eaa1..0511eef060 100644 --- a/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/merc/merc_REF.gc @@ -6,14 +6,14 @@ ;; definition for method 5 of type merc-fragment ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of merc-fragment ((obj merc-fragment)) - (the-as int (* (-> obj header mm-quadword-size) 16)) +(defmethod asize-of merc-fragment ((this merc-fragment)) + (the-as int (* (-> this header mm-quadword-size) 16)) ) ;; definition for method 9 of type merc-fragment ;; INFO: Return type mismatch merc-fragment vs none. -(defmethod login-adgifs merc-fragment ((obj merc-fragment)) - (let* ((fp-data (merc-fragment-fp-data obj)) +(defmethod login-adgifs merc-fragment ((this merc-fragment)) + (let* ((fp-data (merc-fragment-fp-data this)) (eye-ctrl (if (nonzero? (-> *merc-ctrl-header* eye-ctrl)) (-> *merc-ctrl-header* eye-ctrl) (the-as merc-eye-ctrl #f) @@ -71,30 +71,29 @@ ;; definition for method 5 of type merc-fragment-control ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of merc-fragment-control ((obj merc-fragment-control)) - (the-as int (+ (* (-> obj mat-xfer-count) 2) 4)) +(defmethod asize-of merc-fragment-control ((this merc-fragment-control)) + (the-as int (+ (* (-> this mat-xfer-count) 2) 4)) ) ;; definition for method 3 of type merc-fragment-control -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect merc-fragment-control ((obj merc-fragment-control)) - (format #t "[~8x] ~A~%" obj 'merc-fragment-control) - (format #t "~Tunsigned-four-count: ~D~%" (-> obj unsigned-four-count)) - (format #t "~Tlump-four-count: ~D~%" (-> obj lump-four-count)) - (format #t "~Tfp-qwc: ~D~%" (-> obj fp-qwc)) - (format #t "~Tmat-xfer-count: ~D~%" (-> obj mat-xfer-count)) - (dotimes (s5-0 (the-as int (-> obj mat-xfer-count))) +(defmethod inspect merc-fragment-control ((this merc-fragment-control)) + (format #t "[~8x] ~A~%" this 'merc-fragment-control) + (format #t "~Tunsigned-four-count: ~D~%" (-> this unsigned-four-count)) + (format #t "~Tlump-four-count: ~D~%" (-> this lump-four-count)) + (format #t "~Tfp-qwc: ~D~%" (-> this fp-qwc)) + (format #t "~Tmat-xfer-count: ~D~%" (-> this mat-xfer-count)) + (dotimes (s5-0 (the-as int (-> this mat-xfer-count))) (format #t "~Tmat-dest-data[~d]:~%" s5-0) - (format #t "~T~Tmatrix-number: ~D~%" (-> obj mat-dest-data s5-0 matrix-number)) - (format #t "~T~Tmatrix-dest: ~D~%" (-> obj mat-dest-data s5-0 matrix-dest)) + (format #t "~T~Tmatrix-number: ~D~%" (-> this mat-dest-data s5-0 matrix-number)) + (format #t "~T~Tmatrix-dest: ~D~%" (-> this mat-dest-data s5-0 matrix-dest)) ) - obj + this ) ;; definition for method 9 of type merc-effect ;; INFO: Return type mismatch merc-effect vs none. -(defmethod login-adgifs merc-effect ((obj merc-effect)) - (let ((data (-> obj extra-info))) +(defmethod login-adgifs merc-effect ((this merc-effect)) + (let ((data (-> this extra-info))) (when (nonzero? data) (when (nonzero? (-> data shader-offset)) (let ((tex (adgif-shader-login (the-as adgif-shader (+ (the-as uint data) (* (-> data shader-offset) 16)))))) @@ -107,10 +106,10 @@ ) ) ) - (let ((ctrl (-> obj frag-ctrl)) - (geo (-> obj frag-geo)) + (let ((ctrl (-> this frag-ctrl)) + (geo (-> this frag-geo)) ) - (dotimes (frag-idx (the-as int (-> obj frag-count))) + (dotimes (frag-idx (the-as int (-> this frag-count))) (let ((ctrl-size (asize-of ctrl))) (let ((geo-size (asize-of geo))) (login-adgifs geo) @@ -124,29 +123,28 @@ ) ;; definition for method 3 of type merc-ctrl -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect merc-ctrl ((obj merc-ctrl)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (inspect (-> obj header)) - (dotimes (s5-0 (the-as int (-> obj header effect-count))) - (inspect (-> obj effect s5-0)) +(defmethod inspect merc-ctrl ((this merc-ctrl)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~Textra: ~A~%" (-> this extra)) + (inspect (-> this header)) + (dotimes (s5-0 (the-as int (-> this header effect-count))) + (inspect (-> this effect s5-0)) ) - obj + this ) ;; definition for method 8 of type merc-ctrl -(defmethod mem-usage merc-ctrl ((obj merc-ctrl) (arg0 memory-usage-block) (arg1 int)) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 arg1) +(defmethod mem-usage merc-ctrl ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 arg1) ) - (let ((ctrl-mem (+ 32 80 (* (-> obj header effect-count) 32)))) - (dotimes (effect-idx (the-as int (-> obj header effect-count))) - (let ((fctrl (-> obj effect effect-idx frag-ctrl))) - (dotimes (frag-idx (the-as int (-> obj effect effect-idx frag-count))) + (let ((ctrl-mem (+ 32 80 (* (-> this header effect-count) 32)))) + (dotimes (effect-idx (the-as int (-> this header effect-count))) + (let ((fctrl (-> this effect effect-idx frag-ctrl))) + (dotimes (frag-idx (the-as int (-> this effect effect-idx frag-count))) (set! ctrl-mem (+ ctrl-mem (* (shr (+ (-> fctrl unsigned-four-count) 3) 2) 16) (* (shr (+ (-> fctrl lump-four-count) 3) 2) 16) @@ -165,19 +163,19 @@ (+! (-> arg0 data 75 total) (logand -16 (+ ctrl-mem 15))) ) (let ((effect-mem 0)) - (dotimes (effect-idx2 (the-as int (-> obj header effect-count))) - (when (nonzero? (-> obj effect effect-idx2 blend-frag-count)) - (let ((bctrl (-> obj effect effect-idx2 blend-ctrl))) - (dotimes (blend-frag-idx (the-as int (-> obj effect effect-idx2 blend-frag-count))) + (dotimes (effect-idx2 (the-as int (-> this header effect-count))) + (when (nonzero? (-> this effect effect-idx2 blend-frag-count)) + (let ((bctrl (-> this effect effect-idx2 blend-ctrl))) + (dotimes (blend-frag-idx (the-as int (-> this effect effect-idx2 blend-frag-count))) (let ((v1-36 (+ effect-mem (* (+ (-> bctrl nonzero-index-count) 1) (the-as uint (logand (+ (* (the-as uint 6) (-> bctrl blend-vtx-count)) 15) #xfff0)) ) ) ) ) - (set! effect-mem (the-as int (+ (-> obj header blend-target-count) 2 v1-36))) + (set! effect-mem (the-as int (+ (-> this header blend-target-count) 2 v1-36))) ) - (set! bctrl (the-as merc-blend-ctrl (&+ (the-as pointer bctrl) (+ (-> obj header blend-target-count) 2)))) + (set! bctrl (the-as merc-blend-ctrl (&+ (the-as pointer bctrl) (+ (-> this header blend-target-count) 2)))) ) ) ) @@ -190,8 +188,8 @@ (+! (-> arg0 data 77 total) (logand -16 (+ effect-mem 15))) ) ) - (when (nonzero? (-> obj header eye-ctrl)) - (let ((a0-28 (-> obj header eye-ctrl))) + (when (nonzero? (-> this header eye-ctrl)) + (let ((a0-28 (-> this header eye-ctrl))) (set! (-> arg0 length) (max 109 (-> arg0 length))) (set! (-> arg0 data 108 name) "eye-anim") (+! (-> arg0 data 108 count) 1) @@ -201,30 +199,30 @@ ) ) ) - obj + this ) ;; definition for method 9 of type merc-ctrl -(defmethod login merc-ctrl ((obj merc-ctrl)) - (set! *merc-ctrl-header* (-> obj header)) +(defmethod login merc-ctrl ((this merc-ctrl)) + (set! *merc-ctrl-header* (-> this header)) (dotimes (v1-1 3) (set! (-> *merc-ctrl-header* masks v1-1) (the-as uint 0)) ) - (dotimes (effect-idx (the-as int (-> obj header effect-count))) - (login-adgifs (-> obj effect effect-idx)) + (dotimes (effect-idx (the-as int (-> this header effect-count))) + (login-adgifs (-> this effect effect-idx)) ) (let ((idx-with-bit1 -1) - (a1-1 (-> obj header effect-count)) + (a1-1 (-> this header effect-count)) ) (dotimes (v1-11 (the-as int a1-1)) - (if (logtest? (-> obj effect v1-11 effect-bits) 2) + (if (logtest? (-> this effect v1-11 effect-bits) 2) (set! idx-with-bit1 v1-11) ) ) (when (!= idx-with-bit1 -1) (let ((v1-16 4) - (this-effect (-> obj effect idx-with-bit1)) - (last-effect (-> obj effect (+ a1-1 -1))) + (this-effect (-> this effect idx-with-bit1)) + (last-effect (-> this effect (+ a1-1 -1))) ) (dotimes (copy-idx v1-16) (let ((a3-2 (-> this-effect data copy-idx))) @@ -236,12 +234,12 @@ ) ) (cond - ((not (logtest? -65536 (the-as int (-> obj header eye-ctrl)))) - (set! (-> obj header eye-ctrl) (the-as merc-eye-ctrl 0)) + ((not (logtest? -65536 (the-as int (-> this header eye-ctrl)))) + (set! (-> this header eye-ctrl) (the-as merc-eye-ctrl 0)) 0 ) (else - (let ((s5-1 (-> obj header eye-ctrl))) + (let ((s5-1 (-> this header eye-ctrl))) (dotimes (s4-0 3) (let ((v1-25 (adgif-shader-login (-> s5-1 shader s4-0)))) (when v1-25 @@ -254,7 +252,7 @@ ) ) ) - obj + this ) ;; definition (debug) for function merc-stats-display diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/mood-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/mood-h_REF.gc index 41a954d2d5..fc78402521 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/mood-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/mood-h_REF.gc @@ -17,16 +17,16 @@ ) ;; definition for method 3 of type mood-fog -(defmethod inspect mood-fog ((obj mood-fog)) - (format #t "[~8x] ~A~%" obj 'mood-fog) - (format #t "~Tfog-color: #~%" (-> obj fog-color)) - (format #t "~Tfog-dists: #~%" (-> obj fog-dists)) - (format #t "~Tfog-start: (meters ~m)~%" (-> obj fog-dists x)) - (format #t "~Tfog-end: (meters ~m)~%" (-> obj fog-dists y)) - (format #t "~Tfog-max: ~f~%" (-> obj fog-dists z)) - (format #t "~Tfog-min: ~f~%" (-> obj fog-dists w)) - (format #t "~Terase-color: #~%" (-> obj erase-color)) - obj +(defmethod inspect mood-fog ((this mood-fog)) + (format #t "[~8x] ~A~%" this 'mood-fog) + (format #t "~Tfog-color: #~%" (-> this fog-color)) + (format #t "~Tfog-dists: #~%" (-> this fog-dists)) + (format #t "~Tfog-start: (meters ~m)~%" (-> this fog-dists x)) + (format #t "~Tfog-end: (meters ~m)~%" (-> this fog-dists y)) + (format #t "~Tfog-max: ~f~%" (-> this fog-dists z)) + (format #t "~Tfog-min: ~f~%" (-> this fog-dists w)) + (format #t "~Terase-color: #~%" (-> this erase-color)) + this ) ;; definition of type mood-fog-table @@ -39,10 +39,10 @@ ) ;; definition for method 3 of type mood-fog-table -(defmethod inspect mood-fog-table ((obj mood-fog-table)) - (format #t "[~8x] ~A~%" obj 'mood-fog-table) - (format #t "~Tdata[8] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect mood-fog-table ((this mood-fog-table)) + (format #t "[~8x] ~A~%" this 'mood-fog-table) + (format #t "~Tdata[8] @ #x~X~%" (-> this data)) + this ) ;; definition of type mood-lights @@ -59,14 +59,14 @@ ) ;; definition for method 3 of type mood-lights -(defmethod inspect mood-lights ((obj mood-lights)) - (format #t "[~8x] ~A~%" obj 'mood-lights) - (format #t "~Tdirection: #~%" (-> obj direction)) - (format #t "~Tlgt-color: #~%" (-> obj lgt-color)) - (format #t "~Tprt-color: #~%" (-> obj prt-color)) - (format #t "~Tamb-color: #~%" (-> obj amb-color)) - (format #t "~Tshadow: #~%" (-> obj shadow)) - obj +(defmethod inspect mood-lights ((this mood-lights)) + (format #t "[~8x] ~A~%" this 'mood-lights) + (format #t "~Tdirection: #~%" (-> this direction)) + (format #t "~Tlgt-color: #~%" (-> this lgt-color)) + (format #t "~Tprt-color: #~%" (-> this prt-color)) + (format #t "~Tamb-color: #~%" (-> this amb-color)) + (format #t "~Tshadow: #~%" (-> this shadow)) + this ) ;; definition of type mood-lights-table @@ -79,10 +79,10 @@ ) ;; definition for method 3 of type mood-lights-table -(defmethod inspect mood-lights-table ((obj mood-lights-table)) - (format #t "[~8x] ~A~%" obj 'mood-lights-table) - (format #t "~Tdata[8] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect mood-lights-table ((this mood-lights-table)) + (format #t "[~8x] ~A~%" this 'mood-lights-table) + (format #t "~Tdata[8] @ #x~X~%" (-> this data)) + this ) ;; definition of type mood-sun @@ -96,11 +96,11 @@ ) ;; definition for method 3 of type mood-sun -(defmethod inspect mood-sun ((obj mood-sun)) - (format #t "[~8x] ~A~%" obj 'mood-sun) - (format #t "~Tsun-color: #~%" (-> obj sun-color)) - (format #t "~Tenv-color: #~%" (-> obj env-color)) - obj +(defmethod inspect mood-sun ((this mood-sun)) + (format #t "[~8x] ~A~%" this 'mood-sun) + (format #t "~Tsun-color: #~%" (-> this sun-color)) + (format #t "~Tenv-color: #~%" (-> this env-color)) + this ) ;; definition of type mood-sun-table @@ -113,10 +113,10 @@ ) ;; definition for method 3 of type mood-sun-table -(defmethod inspect mood-sun-table ((obj mood-sun-table)) - (format #t "[~8x] ~A~%" obj 'mood-sun-table) - (format #t "~Tdata[8] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect mood-sun-table ((this mood-sun-table)) + (format #t "[~8x] ~A~%" this 'mood-sun-table) + (format #t "~Tdata[8] @ #x~X~%" (-> this data)) + this ) ;; definition of type mood-context @@ -149,26 +149,26 @@ ) ;; definition for method 3 of type mood-context -(defmethod inspect mood-context ((obj mood-context)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tmood-fog-table: #~%" (-> obj mood-fog-table)) - (format #t "~Tmood-lights-table: #~%" (-> obj mood-lights-table)) - (format #t "~Tmood-sun-table: #~%" (-> obj mood-sun-table)) - (format #t "~Tfog-interp: #~%" (-> obj fog-interp)) - (format #t "~Tpalette-interp: #~%" (-> obj palette-interp)) - (format #t "~Tsky-texture-interp: #~%" (-> obj sky-texture-interp)) - (format #t "~Tcurrent-fog: #~%" (-> obj current-fog)) - (format #t "~Tcurrent-sun: #~%" (-> obj current-sun)) - (format #t "~Tcurrent-prt-color: #~%" (-> obj current-prt-color)) - (format #t "~Tcurrent-shadow: #~%" (-> obj current-shadow)) - (format #t "~Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) - (format #t "~Tlight-group[8] @ #x~X~%" (-> obj light-group)) - (format #t "~Ttimes[8] @ #x~X~%" (-> obj times)) - (format #t "~Tsky-times[8] @ #x~X~%" (-> obj sky-times)) - (format #t "~Titimes[4] @ #x~X~%" (-> obj itimes)) - (format #t "~Tstate[16] @ #x~X~%" (-> obj state)) - (format #t "~Tnum-stars: ~f~%" (-> obj num-stars)) - obj +(defmethod inspect mood-context ((this mood-context)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tmood-fog-table: #~%" (-> this mood-fog-table)) + (format #t "~Tmood-lights-table: #~%" (-> this mood-lights-table)) + (format #t "~Tmood-sun-table: #~%" (-> this mood-sun-table)) + (format #t "~Tfog-interp: #~%" (-> this fog-interp)) + (format #t "~Tpalette-interp: #~%" (-> this palette-interp)) + (format #t "~Tsky-texture-interp: #~%" (-> this sky-texture-interp)) + (format #t "~Tcurrent-fog: #~%" (-> this current-fog)) + (format #t "~Tcurrent-sun: #~%" (-> this current-sun)) + (format #t "~Tcurrent-prt-color: #~%" (-> this current-prt-color)) + (format #t "~Tcurrent-shadow: #~%" (-> this current-shadow)) + (format #t "~Tcurrent-shadow-color: #~%" (-> this current-shadow-color)) + (format #t "~Tlight-group[8] @ #x~X~%" (-> this light-group)) + (format #t "~Ttimes[8] @ #x~X~%" (-> this times)) + (format #t "~Tsky-times[8] @ #x~X~%" (-> this sky-times)) + (format #t "~Titimes[4] @ #x~X~%" (-> this itimes)) + (format #t "~Tstate[16] @ #x~X~%" (-> this state)) + (format #t "~Tnum-stars: ~f~%" (-> this num-stars)) + this ) ;; definition for method 0 of type mood-context diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc index e2898c41f1..aea73b143f 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/mood_REF.gc @@ -356,6 +356,7 @@ ;; definition for function update-mood-interp ;; INFO: Used lq/sq +;; INFO: Return type mismatch object vs none. (defun update-mood-interp ((arg0 mood-context) (arg1 mood-context) (arg2 mood-context) (arg3 float)) (local-vars (sv-16 light)) (cond @@ -461,13 +462,13 @@ ) ;; definition for method 3 of type flames-state -(defmethod inspect flames-state ((obj flames-state)) - (format #t "[~8x] ~A~%" obj 'flames-state) - (format #t "~Tindex: ~D~%" (-> obj index)) - (format #t "~Ttime: ~D~%" (-> obj time)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Theight: ~D~%" (-> obj height)) - obj +(defmethod inspect flames-state ((this flames-state)) + (format #t "[~8x] ~A~%" this 'flames-state) + (format #t "~Tindex: ~D~%" (-> this index)) + (format #t "~Ttime: ~D~%" (-> this time)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Theight: ~D~%" (-> this height)) + this ) ;; definition for function update-mood-flames @@ -609,10 +610,10 @@ ) ;; definition for method 3 of type lightning-state -(defmethod inspect lightning-state ((obj lightning-state)) - (format #t "[~8x] ~A~%" obj 'lightning-state) - (format #t "~Tval: ~D~%" (-> obj val)) - obj +(defmethod inspect lightning-state ((this lightning-state)) + (format #t "[~8x] ~A~%" this 'lightning-state) + (format #t "~Tval: ~D~%" (-> this val)) + this ) ;; definition for function update-mood-lightning @@ -802,10 +803,10 @@ ) ;; definition for method 3 of type light-time-state -(defmethod inspect light-time-state ((obj light-time-state)) - (format #t "[~8x] ~A~%" obj 'light-time-state) - (format #t "~Ttime: ~D~%" (-> obj time)) - obj +(defmethod inspect light-time-state ((this light-time-state)) + (format #t "[~8x] ~A~%" this 'light-time-state) + (format #t "~Ttime: ~D~%" (-> this time)) + this ) ;; definition of type light-state @@ -819,10 +820,10 @@ ) ;; definition for method 3 of type light-state -(defmethod inspect light-state ((obj light-state)) - (format #t "[~8x] ~A~%" obj 'light-state) - (format #t "~Tfade: ~D~%" (-> obj fade)) - obj +(defmethod inspect light-state ((this light-state)) + (format #t "[~8x] ~A~%" this 'light-state) + (format #t "~Tfade: ~D~%" (-> this fade)) + this ) ;; definition for function update-mood-light @@ -887,12 +888,12 @@ ) ;; definition for method 3 of type lava-state -(defmethod inspect lava-state ((obj lava-state)) - (format #t "[~8x] ~A~%" obj 'lava-state) - (format #t "~Tscale[4] @ #x~X~%" (-> obj scale)) - (format #t "~Ttime: ~D~%" (-> obj time)) - (format #t "~Tlast-index: ~D~%" (-> obj last-index)) - obj +(defmethod inspect lava-state ((this lava-state)) + (format #t "[~8x] ~A~%" this 'lava-state) + (format #t "~Tscale[4] @ #x~X~%" (-> this scale)) + (format #t "~Ttime: ~D~%" (-> this time)) + (format #t "~Tlast-index: ~D~%" (-> this last-index)) + this ) ;; definition for symbol *lava-time*, type float @@ -978,14 +979,14 @@ ) ;; definition for method 3 of type misty-states -(defmethod inspect misty-states ((obj misty-states)) - (format #t "[~8x] ~A~%" obj 'misty-states) - (format #t "~Tflames: #~%" (-> obj flames)) - (format #t "~Tlight0: #~%" (-> obj light0)) - (format #t "~Tlight1: #~%" (-> obj light1)) - (format #t "~Ttime0: #~%" (-> obj time0)) - (format #t "~Ttime1: #~%" (-> obj time1)) - obj +(defmethod inspect misty-states ((this misty-states)) + (format #t "[~8x] ~A~%" this 'misty-states) + (format #t "~Tflames: #~%" (-> this flames)) + (format #t "~Tlight0: #~%" (-> this light0)) + (format #t "~Tlight1: #~%" (-> this light1)) + (format #t "~Ttime0: #~%" (-> this time0)) + (format #t "~Ttime1: #~%" (-> this time1)) + this ) ;; definition for function update-mood-misty @@ -1048,11 +1049,11 @@ ) ;; definition for method 3 of type swamp-village2-states -(defmethod inspect swamp-village2-states ((obj swamp-village2-states)) - (format #t "[~8x] ~A~%" obj 'swamp-village2-states) - (format #t "~Tflames: #~%" (-> obj flames)) - (format #t "~Tlightning: #~%" (-> obj lightning)) - obj +(defmethod inspect swamp-village2-states ((this swamp-village2-states)) + (format #t "[~8x] ~A~%" this 'swamp-village2-states) + (format #t "~Tflames: #~%" (-> this flames)) + (format #t "~Tlightning: #~%" (-> this lightning)) + this ) ;; definition for function update-mood-village2 @@ -1206,10 +1207,10 @@ ) ;; definition for method 3 of type village1-states -(defmethod inspect village1-states ((obj village1-states)) - (format #t "[~8x] ~A~%" obj 'village1-states) - (format #t "~Tflames: #~%" (-> obj flames)) - obj +(defmethod inspect village1-states ((this village1-states)) + (format #t "[~8x] ~A~%" this 'village1-states) + (format #t "~Tflames: #~%" (-> this flames)) + this ) ;; definition for function update-mood-village1 @@ -1354,12 +1355,12 @@ ) ;; definition for method 3 of type jungle-states -(defmethod inspect jungle-states ((obj jungle-states)) - (format #t "[~8x] ~A~%" obj 'jungle-states) - (format #t "~Tlight: #~%" (-> obj light)) - (format #t "~Ttime: #~%" (-> obj time)) - (format #t "~Tone-shot: ~D~%" (-> obj one-shot)) - obj +(defmethod inspect jungle-states ((this jungle-states)) + (format #t "[~8x] ~A~%" this 'jungle-states) + (format #t "~Tlight: #~%" (-> this light)) + (format #t "~Ttime: #~%" (-> this time)) + (format #t "~Tone-shot: ~D~%" (-> this one-shot)) + this ) ;; definition for function update-mood-jungle @@ -1601,11 +1602,11 @@ ) ;; definition for method 3 of type sunken-states -(defmethod inspect sunken-states ((obj sunken-states)) - (format #t "[~8x] ~A~%" obj 'sunken-states) - (format #t "~Tlight: #~%" (-> obj light)) - (format #t "~Ttime: #~%" (-> obj time)) - obj +(defmethod inspect sunken-states ((this sunken-states)) + (format #t "[~8x] ~A~%" this 'sunken-states) + (format #t "~Tlight: #~%" (-> this light)) + (format #t "~Ttime: #~%" (-> this time)) + this ) ;; failed to figure out what this is: @@ -1715,15 +1716,15 @@ ) ;; definition for method 3 of type rolling-states -(defmethod inspect rolling-states ((obj rolling-states)) - (format #t "[~8x] ~A~%" obj 'rolling-states) - (format #t "~Tlight0: #~%" (-> obj light0)) - (format #t "~Tlight1: #~%" (-> obj light1)) - (format #t "~Tlight2: #~%" (-> obj light2)) - (format #t "~Tlight3: #~%" (-> obj light3)) - (format #t "~Ttime: #~%" (-> obj time)) - (format #t "~Tlightning: #~%" (-> obj lightning)) - obj +(defmethod inspect rolling-states ((this rolling-states)) + (format #t "[~8x] ~A~%" this 'rolling-states) + (format #t "~Tlight0: #~%" (-> this light0)) + (format #t "~Tlight1: #~%" (-> this light1)) + (format #t "~Tlight2: #~%" (-> this light2)) + (format #t "~Tlight3: #~%" (-> this light3)) + (format #t "~Ttime: #~%" (-> this time)) + (format #t "~Tlightning: #~%" (-> this lightning)) + this ) ;; definition for symbol *rolling-spheres-on*, type (inline-array vector) @@ -1898,10 +1899,10 @@ ) ;; definition for method 3 of type firecanyon-states -(defmethod inspect firecanyon-states ((obj firecanyon-states)) - (format #t "[~8x] ~A~%" obj 'firecanyon-states) - (format #t "~Tlava: #~%" (-> obj lava)) - obj +(defmethod inspect firecanyon-states ((this firecanyon-states)) + (format #t "[~8x] ~A~%" this 'firecanyon-states) + (format #t "~Tlava: #~%" (-> this lava)) + this ) ;; definition for function update-mood-firecanyon @@ -1930,11 +1931,11 @@ ) ;; definition for method 3 of type training-states -(defmethod inspect training-states ((obj training-states)) - (format #t "[~8x] ~A~%" obj 'training-states) - (format #t "~Tlight: #~%" (-> obj light)) - (format #t "~Ttime: #~%" (-> obj time)) - obj +(defmethod inspect training-states ((this training-states)) + (format #t "[~8x] ~A~%" this 'training-states) + (format #t "~Tlight: #~%" (-> this light)) + (format #t "~Ttime: #~%" (-> this time)) + this ) ;; definition for function update-mood-training @@ -1965,10 +1966,10 @@ ) ;; definition for method 3 of type maincave-states -(defmethod inspect maincave-states ((obj maincave-states)) - (format #t "[~8x] ~A~%" obj 'maincave-states) - (format #t "~Tflames: #~%" (-> obj flames)) - obj +(defmethod inspect maincave-states ((this maincave-states)) + (format #t "[~8x] ~A~%" this 'maincave-states) + (format #t "~Tflames: #~%" (-> this flames)) + this ) ;; definition for function update-mood-maincave @@ -2085,10 +2086,10 @@ ) ;; definition for method 3 of type robocave-states -(defmethod inspect robocave-states ((obj robocave-states)) - (format #t "[~8x] ~A~%" obj 'robocave-states) - (format #t "~Tflames: #~%" (-> obj flames)) - obj +(defmethod inspect robocave-states ((this robocave-states)) + (format #t "[~8x] ~A~%" this 'robocave-states) + (format #t "~Tflames: #~%" (-> this flames)) + this ) ;; definition for function update-mood-robocave @@ -2119,14 +2120,14 @@ ) ;; definition for method 3 of type snow-states -(defmethod inspect snow-states ((obj snow-states)) - (format #t "[~8x] ~A~%" obj 'snow-states) - (format #t "~Tflames: #~%" (-> obj flames)) - (format #t "~Tlight: #~%" (-> obj light)) - (format #t "~Ttime: #~%" (-> obj time)) - (format #t "~Tone-shot: ~D~%" (-> obj one-shot)) - (format #t "~Tinterp: ~f~%" (-> obj interp)) - obj +(defmethod inspect snow-states ((this snow-states)) + (format #t "[~8x] ~A~%" this 'snow-states) + (format #t "~Tflames: #~%" (-> this flames)) + (format #t "~Tlight: #~%" (-> this light)) + (format #t "~Ttime: #~%" (-> this time)) + (format #t "~Tone-shot: ~D~%" (-> this one-shot)) + (format #t "~Tinterp: ~f~%" (-> this interp)) + this ) ;; definition for function update-mood-snow @@ -2206,14 +2207,14 @@ ) ;; definition for method 3 of type village3-states -(defmethod inspect village3-states ((obj village3-states)) - (format #t "[~8x] ~A~%" obj 'village3-states) - (format #t "~Tflames: #~%" (-> obj flames)) - (format #t "~Tscale: ~f~%" (-> obj scale)) - (format #t "~Tlava: #~%" (-> obj lava)) - (format #t "~Tlava-time: ~f~%" (-> obj lava-time)) - (format #t "~Ttime: ~D~%" (-> obj time)) - obj +(defmethod inspect village3-states ((this village3-states)) + (format #t "[~8x] ~A~%" this 'village3-states) + (format #t "~Tflames: #~%" (-> this flames)) + (format #t "~Tscale: ~f~%" (-> this scale)) + (format #t "~Tlava: #~%" (-> this lava)) + (format #t "~Tlava-time: ~f~%" (-> this lava-time)) + (format #t "~Ttime: ~D~%" (-> this time)) + this ) ;; definition for function update-mood-village3 @@ -2429,12 +2430,12 @@ ) ;; definition for method 3 of type lavatube-states -(defmethod inspect lavatube-states ((obj lavatube-states)) - (format #t "[~8x] ~A~%" obj 'lavatube-states) - (format #t "~Tlava: #~%" (-> obj lava)) - (format #t "~Tlight: #~%" (-> obj light)) - (format #t "~Ttime: #~%" (-> obj time)) - obj +(defmethod inspect lavatube-states ((this lavatube-states)) + (format #t "[~8x] ~A~%" this 'lavatube-states) + (format #t "~Tlava: #~%" (-> this lava)) + (format #t "~Tlight: #~%" (-> this light)) + (format #t "~Ttime: #~%" (-> this time)) + this ) ;; failed to figure out what this is: @@ -2472,13 +2473,13 @@ ) ;; definition for method 3 of type ogre-states -(defmethod inspect ogre-states ((obj ogre-states)) - (format #t "[~8x] ~A~%" obj 'ogre-states) - (format #t "~Tlava: #~%" (-> obj lava)) - (format #t "~Tlightning: #~%" (-> obj lightning)) - (format #t "~Tlava-time: ~f~%" (-> obj lava-time)) - (format #t "~Tlava-fade: ~f~%" (-> obj lava-fade)) - obj +(defmethod inspect ogre-states ((this ogre-states)) + (format #t "[~8x] ~A~%" this 'ogre-states) + (format #t "~Tlava: #~%" (-> this lava)) + (format #t "~Tlightning: #~%" (-> this lightning)) + (format #t "~Tlava-time: ~f~%" (-> this lava-time)) + (format #t "~Tlava-fade: ~f~%" (-> this lava-fade)) + this ) ;; definition for function update-mood-ogre @@ -2676,11 +2677,11 @@ ) ;; definition for method 3 of type finalboss-states -(defmethod inspect finalboss-states ((obj finalboss-states)) - (format #t "[~8x] ~A~%" obj 'finalboss-states) - (format #t "~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~Tsecret-time: ~D~%" (-> obj secret-time)) - obj +(defmethod inspect finalboss-states ((this finalboss-states)) + (format #t "[~8x] ~A~%" this 'finalboss-states) + (format #t "~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~Tsecret-time: ~D~%" (-> this secret-time)) + this ) ;; definition for function update-mood-finalboss @@ -2692,8 +2693,8 @@ (cond ((or (logtest? (get-reminder (get-task-control (game-task finalboss-movies)) 0) 1) (not *time-of-day-effects*)) (when (and *target* (= (-> *target* next-state name) 'target-continue)) - (set! (-> s4-0 start-time) (+ (-> *display* base-frame-counter) (seconds -33.335))) - (set! (-> s4-0 secret-time) (+ (-> *display* base-frame-counter) (seconds -33.335))) + (set! (-> s4-0 start-time) (+ (current-time) (seconds -33.335))) + (set! (-> s4-0 secret-time) (+ (current-time) (seconds -33.335))) ) (update-mood-fog arg0 arg1) (update-mood-sky-texture arg0 arg1) @@ -2739,7 +2740,7 @@ ) (cond ((logtest? (get-reminder (get-task-control (game-task finalboss-movies)) 0) 2) - (let* ((f1-14 (* 0.00055555557 (the float (- (-> *display* base-frame-counter) (-> s4-0 secret-time))))) + (let* ((f1-14 (* 0.00055555557 (the float (- (current-time) (-> s4-0 secret-time))))) (f0-15 (fmax 0.0 (fmin 1.0 f1-14))) (a0-21 (-> arg0 light-group)) ) @@ -2776,10 +2777,10 @@ ) ) (else - (set! (-> s4-0 secret-time) (-> *display* base-frame-counter)) + (set-time! (-> s4-0 secret-time)) ) ) - (let* ((f1-36 (* 0.00019607843 (the float (- (-> *display* base-frame-counter) (-> s4-0 start-time))))) + (let* ((f1-36 (* 0.00019607843 (the float (- (current-time) (-> s4-0 start-time))))) (f1-38 (fmax 0.0 (fmin 1.0 f1-36))) (f0-32 (fmax 0.0 (fmin 1.0 f1-38))) ) @@ -2807,7 +2808,7 @@ (set! (-> *time-of-day-proc* 0 minute) 0) (set! (-> *time-of-day-proc* 0 second) 0) (set! (-> *time-of-day-proc* 0 frame) 0) - (set! (-> s4-0 start-time) (-> *display* base-frame-counter)) + (set-time! (-> s4-0 start-time)) (dotimes (v1-72 8) (set! (-> arg0 sky-times v1-72) 0.0) ) @@ -2868,15 +2869,15 @@ ) ;; definition for method 3 of type citadel-states -(defmethod inspect citadel-states ((obj citadel-states)) - (format #t "[~8x] ~A~%" obj 'citadel-states) - (format #t "~Tflames: #~%" (-> obj flames)) - (format #t "~Tlight: #~%" (-> obj light)) - (format #t "~Ttime: #~%" (-> obj time)) - (format #t "~Tflicker-off: ~D~%" (-> obj flicker-off)) - (format #t "~Tflicker-on: ~D~%" (-> obj flicker-on)) - (format #t "~Tshield-fade: ~f~%" (-> obj shield-fade)) - obj +(defmethod inspect citadel-states ((this citadel-states)) + (format #t "[~8x] ~A~%" this 'citadel-states) + (format #t "~Tflames: #~%" (-> this flames)) + (format #t "~Tlight: #~%" (-> this light)) + (format #t "~Ttime: #~%" (-> this time)) + (format #t "~Tflicker-off: ~D~%" (-> this flicker-off)) + (format #t "~Tflicker-on: ~D~%" (-> this flicker-on)) + (format #t "~Tshield-fade: ~f~%" (-> this shield-fade)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day-h_REF.gc index 0ab827ba99..9da9dda010 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day-h_REF.gc @@ -13,12 +13,12 @@ ) ;; definition for method 3 of type palette-fade-control -(defmethod inspect palette-fade-control ((obj palette-fade-control)) - (format #t "[~8x] ~A~%" obj 'palette-fade-control) - (format #t "~Ttrans: #~%" (-> obj trans)) - (format #t "~Tfade: ~f~%" (-> obj fade)) - (format #t "~Tactor-dist: ~f~%" (-> obj actor-dist)) - obj +(defmethod inspect palette-fade-control ((this palette-fade-control)) + (format #t "[~8x] ~A~%" this 'palette-fade-control) + (format #t "~Ttrans: #~%" (-> this trans)) + (format #t "~Tfade: ~f~%" (-> this fade)) + (format #t "~Tactor-dist: ~f~%" (-> this actor-dist)) + this ) ;; definition of type palette-fade-controls @@ -35,10 +35,10 @@ ) ;; definition for method 3 of type palette-fade-controls -(defmethod inspect palette-fade-controls ((obj palette-fade-controls)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tcontrol[8] @ #x~X~%" (-> obj control)) - obj +(defmethod inspect palette-fade-controls ((this palette-fade-controls)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tcontrol[8] @ #x~X~%" (-> this control)) + this ) ;; definition (perm) for symbol *palette-fade-controls*, type palette-fade-controls @@ -75,29 +75,29 @@ ) ;; definition for method 3 of type time-of-day-proc -(defmethod inspect time-of-day-proc ((obj time-of-day-proc)) +(defmethod inspect time-of-day-proc ((this time-of-day-proc)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tyear: ~D~%" (-> obj year)) - (format #t "~T~Tmonth: ~D~%" (-> obj month)) - (format #t "~T~Tweek: ~D~%" (-> obj week)) - (format #t "~T~Tday: ~D~%" (-> obj day)) - (format #t "~T~Thour: ~D~%" (-> obj hour)) - (format #t "~T~Tminute: ~D~%" (-> obj minute)) - (format #t "~T~Tsecond: ~D~%" (-> obj second)) - (format #t "~T~Tframe: ~D~%" (-> obj frame)) - (format #t "~T~Ttime-of-day: ~f~%" (-> obj time-of-day)) - (format #t "~T~Ttime-ratio: ~f~%" (-> obj time-ratio)) - (format #t "~T~Tstar-count: ~D~%" (-> obj star-count)) - (format #t "~T~Tstars: ~A~%" (-> obj stars)) - (format #t "~T~Tsun-count: ~D~%" (-> obj sun-count)) - (format #t "~T~Tsun: ~A~%" (-> obj sun)) - (format #t "~T~Tgreen-sun-count: ~D~%" (-> obj green-sun-count)) - (format #t "~T~Tgreen-sun: ~A~%" (-> obj green-sun)) - (format #t "~T~Tmoon-count: ~D~%" (-> obj moon-count)) - (format #t "~T~Tmoon: ~A~%" (-> obj moon)) - obj + (format #t "~T~Tyear: ~D~%" (-> this year)) + (format #t "~T~Tmonth: ~D~%" (-> this month)) + (format #t "~T~Tweek: ~D~%" (-> this week)) + (format #t "~T~Tday: ~D~%" (-> this day)) + (format #t "~T~Thour: ~D~%" (-> this hour)) + (format #t "~T~Tminute: ~D~%" (-> this minute)) + (format #t "~T~Tsecond: ~D~%" (-> this second)) + (format #t "~T~Tframe: ~D~%" (-> this frame)) + (format #t "~T~Ttime-of-day: ~f~%" (-> this time-of-day)) + (format #t "~T~Ttime-ratio: ~f~%" (-> this time-ratio)) + (format #t "~T~Tstar-count: ~D~%" (-> this star-count)) + (format #t "~T~Tstars: ~A~%" (-> this stars)) + (format #t "~T~Tsun-count: ~D~%" (-> this sun-count)) + (format #t "~T~Tsun: ~A~%" (-> this sun)) + (format #t "~T~Tgreen-sun-count: ~D~%" (-> this green-sun-count)) + (format #t "~T~Tgreen-sun: ~A~%" (-> this green-sun)) + (format #t "~T~Tmoon-count: ~D~%" (-> this moon-count)) + (format #t "~T~Tmoon: ~A~%" (-> this moon)) + this ) ;; definition of type time-of-day-palette @@ -113,13 +113,13 @@ ) ;; definition for method 3 of type time-of-day-palette -(defmethod inspect time-of-day-palette ((obj time-of-day-palette)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Twidth: ~D~%" (-> obj width)) - (format #t "~Theight: ~D~%" (-> obj height)) - (format #t "~Tpad: ~D~%" (-> obj pad)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect time-of-day-palette ((this time-of-day-palette)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Twidth: ~D~%" (-> this width)) + (format #t "~Theight: ~D~%" (-> this height)) + (format #t "~Tpad: ~D~%" (-> this pad)) + (format #t "~Tdata[1] @ #x~X~%" (-> this data)) + this ) ;; definition of type time-of-day-context @@ -152,30 +152,30 @@ ) ;; definition for method 3 of type time-of-day-context -(defmethod inspect time-of-day-context ((obj time-of-day-context)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tactive-count: ~D~%" (-> obj active-count)) - (format #t "~Tinterp: ~f~%" (-> obj interp)) - (format #t "~Tcurrent-interp: ~f~%" (-> obj current-interp)) - (format #t "~Tmoods[2] @ #x~X~%" (-> obj moods)) - (format #t "~Tcurrent-fog: #~%" (-> obj current-fog)) - (format #t "~Tcurrent-sun: #~%" (-> obj current-sun)) - (format #t "~Tcurrent-prt-color: #~%" (-> obj current-prt-color)) - (format #t "~Tcurrent-shadow: #~%" (-> obj current-shadow)) - (format #t "~Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) - (format #t "~Tlight-group[9] @ #x~X~%" (-> obj light-group)) - (format #t "~Ttitle-light-group: #~%" (-> obj title-light-group)) - (format #t "~Ttime: ~f~%" (-> obj time)) - (format #t "~Ttarget-interp: ~f~%" (-> obj target-interp)) - (format #t "~Terase-color: ~D~%" (-> obj erase-color)) - (format #t "~Tnum-stars: ~f~%" (-> obj num-stars)) - (format #t "~Tlight-masks-0[2] @ #x~X~%" (-> obj light-masks-0)) - (format #t "~Tlight-masks-1[2] @ #x~X~%" (-> obj light-masks-1)) - (format #t "~Tlight-interp[2] @ #x~X~%" (-> obj light-interp)) - (format #t "~Tsky: ~A~%" (-> obj sky)) - (format #t "~Tsun-fade: ~f~%" (-> obj sun-fade)) - (format #t "~Ttitle-updated: ~A~%" (-> obj title-updated)) - obj +(defmethod inspect time-of-day-context ((this time-of-day-context)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tactive-count: ~D~%" (-> this active-count)) + (format #t "~Tinterp: ~f~%" (-> this interp)) + (format #t "~Tcurrent-interp: ~f~%" (-> this current-interp)) + (format #t "~Tmoods[2] @ #x~X~%" (-> this moods)) + (format #t "~Tcurrent-fog: #~%" (-> this current-fog)) + (format #t "~Tcurrent-sun: #~%" (-> this current-sun)) + (format #t "~Tcurrent-prt-color: #~%" (-> this current-prt-color)) + (format #t "~Tcurrent-shadow: #~%" (-> this current-shadow)) + (format #t "~Tcurrent-shadow-color: #~%" (-> this current-shadow-color)) + (format #t "~Tlight-group[9] @ #x~X~%" (-> this light-group)) + (format #t "~Ttitle-light-group: #~%" (-> this title-light-group)) + (format #t "~Ttime: ~f~%" (-> this time)) + (format #t "~Ttarget-interp: ~f~%" (-> this target-interp)) + (format #t "~Terase-color: ~D~%" (-> this erase-color)) + (format #t "~Tnum-stars: ~f~%" (-> this num-stars)) + (format #t "~Tlight-masks-0[2] @ #x~X~%" (-> this light-masks-0)) + (format #t "~Tlight-masks-1[2] @ #x~X~%" (-> this light-masks-1)) + (format #t "~Tlight-interp[2] @ #x~X~%" (-> this light-interp)) + (format #t "~Tsky: ~A~%" (-> this sky)) + (format #t "~Tsun-fade: ~f~%" (-> this sun-fade)) + (format #t "~Ttitle-updated: ~A~%" (-> this title-updated)) + this ) ;; definition of type time-of-day-dma @@ -191,13 +191,13 @@ ) ;; definition for method 3 of type time-of-day-dma -(defmethod inspect time-of-day-dma ((obj time-of-day-dma)) - (format #t "[~8x] ~A~%" obj 'time-of-day-dma) - (format #t "~Touta[256] @ #x~X~%" (-> obj outa)) - (format #t "~Toutb[256] @ #x~X~%" (-> obj outb)) - (format #t "~Tbanka[256] @ #x~X~%" (-> obj banka)) - (format #t "~Tbankb[256] @ #x~X~%" (-> obj bankb)) - obj +(defmethod inspect time-of-day-dma ((this time-of-day-dma)) + (format #t "[~8x] ~A~%" this 'time-of-day-dma) + (format #t "~Touta[256] @ #x~X~%" (-> this outa)) + (format #t "~Toutb[256] @ #x~X~%" (-> this outb)) + (format #t "~Tbanka[256] @ #x~X~%" (-> this banka)) + (format #t "~Tbankb[256] @ #x~X~%" (-> this bankb)) + this ) ;; definition for symbol *time-of-day-mode*, type int diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc index 706e7bbaf1..dc3fe61b95 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/time-of-day_REF.gc @@ -3,8 +3,8 @@ ;; definition for method 5 of type time-of-day-palette ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of time-of-day-palette ((obj time-of-day-palette)) - (the-as int (+ (-> obj type size) (* (* (-> obj height) (-> obj width)) 4))) +(defmethod asize-of time-of-day-palette ((this time-of-day-palette)) + (the-as int (+ (-> this type size) (* (* (-> this height) (-> this width)) 4))) ) ;; failed to figure out what this is: @@ -562,10 +562,10 @@ ;; definition for method 10 of type palette-fade-controls ;; INFO: Used lq/sq -(defmethod set-fade! palette-fade-controls ((obj palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) +(defmethod set-fade! palette-fade-controls ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) (cond ((and (>= arg0 0) (< arg0 8)) - (let ((v1-3 (-> obj control arg0))) + (let ((v1-3 (-> this control arg0))) (when (< arg2 (-> v1-3 actor-dist)) (if arg3 (set! (-> v1-3 trans quad) (-> arg3 quad)) @@ -582,9 +582,9 @@ ) ;; definition for method 9 of type palette-fade-controls -(defmethod reset! palette-fade-controls ((obj palette-fade-controls)) +(defmethod reset! palette-fade-controls ((this palette-fade-controls)) (countdown (v1-0 8) - (let ((a1-2 (-> obj control v1-0))) + (let ((a1-2 (-> this control v1-0))) (set! (-> a1-2 fade) 0.0) (set! (-> a1-2 actor-dist) 4096000000.0) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/mood/weather-part_REF.gc b/test/decompiler/reference/jak1/engine/gfx/mood/weather-part_REF.gc index 8ff679205a..f5e614a256 100644 --- a/test/decompiler/reference/jak1/engine/gfx/mood/weather-part_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/mood/weather-part_REF.gc @@ -514,7 +514,7 @@ ;; definition for function cam-master-effect ;; INFO: Return type mismatch int vs none. (defbehavior cam-master-effect camera-master () - (when (< (+ (-> *display* base-frame-counter) (seconds -10)) (-> self water-drip-time)) + (when (< (+ (current-time) (seconds -10)) (-> self water-drip-time)) (set! (-> *part-id-table* 21 init-specs 1 initial-valuef) (-> self water-drip-mult)) (set! (-> *part-id-table* 18 init-specs 1 initial-valuef) (* 0.9 (-> self water-drip-mult))) (set! (-> *part-id-table* 22 init-specs 11 initial-valuef) (* -2.7306666 (-> self water-drip-speed))) diff --git a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-h_REF.gc index 661f55b220..ae397fe94b 100644 --- a/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/ocean/ocean-h_REF.gc @@ -15,14 +15,14 @@ ) ;; definition for method 3 of type ocean-corner -(defmethod inspect ocean-corner ((obj ocean-corner)) - (format #t "[~8x] ~A~%" obj 'ocean-corner) - (format #t "~Tbsphere: #~%" (-> obj bsphere)) - (format #t "~Tstart-corner: #~%" (-> obj start-corner)) - (format #t "~Ty-scales: #~%" (-> obj y-scales)) - (format #t "~Talphas: #~%" (-> obj alphas)) - (format #t "~Tcolors[4] @ #x~X~%" (-> obj colors)) - obj +(defmethod inspect ocean-corner ((this ocean-corner)) + (format #t "[~8x] ~A~%" this 'ocean-corner) + (format #t "~Tbsphere: #~%" (-> this bsphere)) + (format #t "~Tstart-corner: #~%" (-> this start-corner)) + (format #t "~Ty-scales: #~%" (-> this y-scales)) + (format #t "~Talphas: #~%" (-> this alphas)) + (format #t "~Tcolors[4] @ #x~X~%" (-> this colors)) + this ) ;; definition of type ocean-wave-info @@ -42,17 +42,17 @@ ) ;; definition for method 3 of type ocean-wave-info -(defmethod inspect ocean-wave-info ((obj ocean-wave-info)) - (format #t "[~8x] ~A~%" obj 'ocean-wave-info) - (format #t "~Tfrequency: ~f~%" (-> obj frequency)) - (format #t "~Tamplitude: ~f~%" (-> obj amplitude)) - (format #t "~Twave-speed: ~f~%" (-> obj wave-speed)) - (format #t "~Tangle: ~f~%" (-> obj angle)) - (format #t "~Tkx: ~f~%" (-> obj kx)) - (format #t "~Tky: ~f~%" (-> obj ky)) - (format #t "~Tw: ~f~%" (-> obj w)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - obj +(defmethod inspect ocean-wave-info ((this ocean-wave-info)) + (format #t "[~8x] ~A~%" this 'ocean-wave-info) + (format #t "~Tfrequency: ~f~%" (-> this frequency)) + (format #t "~Tamplitude: ~f~%" (-> this amplitude)) + (format #t "~Twave-speed: ~f~%" (-> this wave-speed)) + (format #t "~Tangle: ~f~%" (-> this angle)) + (format #t "~Tkx: ~f~%" (-> this kx)) + (format #t "~Tky: ~f~%" (-> this ky)) + (format #t "~Tw: ~f~%" (-> this w)) + (format #t "~Tflags: ~D~%" (-> this flags)) + this ) ;; definition of type ocean-vertex @@ -67,12 +67,12 @@ ) ;; definition for method 3 of type ocean-vertex -(defmethod inspect ocean-vertex ((obj ocean-vertex)) - (format #t "[~8x] ~A~%" obj 'ocean-vertex) - (format #t "~Tpos: #~%" (-> obj pos)) - (format #t "~Tstq: #~%" (-> obj stq)) - (format #t "~Tcol: #~%" (-> obj col)) - obj +(defmethod inspect ocean-vertex ((this ocean-vertex)) + (format #t "[~8x] ~A~%" this 'ocean-vertex) + (format #t "~Tpos: #~%" (-> this pos)) + (format #t "~Tstq: #~%" (-> this stq)) + (format #t "~Tcol: #~%" (-> this col)) + this ) ;; definition of type ocean-spheres @@ -85,10 +85,10 @@ ) ;; definition for method 3 of type ocean-spheres -(defmethod inspect ocean-spheres ((obj ocean-spheres)) - (format #t "[~8x] ~A~%" obj 'ocean-spheres) - (format #t "~Tspheres[36] @ #x~X~%" (-> obj spheres)) - obj +(defmethod inspect ocean-spheres ((this ocean-spheres)) + (format #t "[~8x] ~A~%" this 'ocean-spheres) + (format #t "~Tspheres[36] @ #x~X~%" (-> this spheres)) + this ) ;; definition of type ocean-colors @@ -101,10 +101,10 @@ ) ;; definition for method 3 of type ocean-colors -(defmethod inspect ocean-colors ((obj ocean-colors)) - (format #t "[~8x] ~A~%" obj 'ocean-colors) - (format #t "~Tcolors[2548] @ #x~X~%" (-> obj colors)) - obj +(defmethod inspect ocean-colors ((this ocean-colors)) + (format #t "[~8x] ~A~%" this 'ocean-colors) + (format #t "~Tcolors[2548] @ #x~X~%" (-> this colors)) + this ) ;; definition of type ocean-mid-mask @@ -119,11 +119,11 @@ ) ;; definition for method 3 of type ocean-mid-mask -(defmethod inspect ocean-mid-mask ((obj ocean-mid-mask)) - (format #t "[~8x] ~A~%" obj 'ocean-mid-mask) - (format #t "~Tmask[8] @ #x~X~%" (-> obj mask)) - (format #t "~Tdword: #x~X~%" (-> obj dword)) - obj +(defmethod inspect ocean-mid-mask ((this ocean-mid-mask)) + (format #t "[~8x] ~A~%" this 'ocean-mid-mask) + (format #t "~Tmask[8] @ #x~X~%" (-> this mask)) + (format #t "~Tdword: #x~X~%" (-> this dword)) + this ) ;; definition of type ocean-mid-indices @@ -136,10 +136,10 @@ ) ;; definition for method 3 of type ocean-mid-indices -(defmethod inspect ocean-mid-indices ((obj ocean-mid-indices)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdata[36] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect ocean-mid-indices ((this ocean-mid-indices)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdata[36] @ #x~X~%" (-> this data)) + this ) ;; definition of type ocean-mid-masks @@ -153,10 +153,10 @@ ) ;; definition for method 3 of type ocean-mid-masks -(defmethod inspect ocean-mid-masks ((obj ocean-mid-masks)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdata: #x~X~%" (-> obj data)) - obj +(defmethod inspect ocean-mid-masks ((this ocean-mid-masks)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdata: #x~X~%" (-> this data)) + this ) ;; definition of type ocean-trans-mask @@ -171,11 +171,11 @@ ) ;; definition for method 3 of type ocean-trans-mask -(defmethod inspect ocean-trans-mask ((obj ocean-trans-mask)) - (format #t "[~8x] ~A~%" obj 'ocean-trans-mask) - (format #t "~Tmask[4] @ #x~X~%" (-> obj mask)) - (format #t "~Tword: #x~X~%" (-> obj word)) - obj +(defmethod inspect ocean-trans-mask ((this ocean-trans-mask)) + (format #t "[~8x] ~A~%" this 'ocean-trans-mask) + (format #t "~Tmask[4] @ #x~X~%" (-> this mask)) + (format #t "~Tword: #x~X~%" (-> this word)) + this ) ;; definition of type ocean-trans-index @@ -190,11 +190,11 @@ ) ;; definition for method 3 of type ocean-trans-index -(defmethod inspect ocean-trans-index ((obj ocean-trans-index)) - (format #t "[~8x] ~A~%" obj 'ocean-trans-index) - (format #t "~Tparent: ~D~%" (-> obj parent)) - (format #t "~Tchild: ~D~%" (-> obj child)) - obj +(defmethod inspect ocean-trans-index ((this ocean-trans-index)) + (format #t "[~8x] ~A~%" this 'ocean-trans-index) + (format #t "~Tparent: ~D~%" (-> this parent)) + (format #t "~Tchild: ~D~%" (-> this child)) + this ) ;; definition of type ocean-trans-indices @@ -207,10 +207,10 @@ ) ;; definition for method 3 of type ocean-trans-indices -(defmethod inspect ocean-trans-indices ((obj ocean-trans-indices)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdata[2304] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect ocean-trans-indices ((this ocean-trans-indices)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdata[2304] @ #x~X~%" (-> this data)) + this ) ;; definition of type ocean-near-index @@ -223,10 +223,10 @@ ) ;; definition for method 3 of type ocean-near-index -(defmethod inspect ocean-near-index ((obj ocean-near-index)) - (format #t "[~8x] ~A~%" obj 'ocean-near-index) - (format #t "~Tdata[16] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect ocean-near-index ((this ocean-near-index)) + (format #t "[~8x] ~A~%" this 'ocean-near-index) + (format #t "~Tdata[16] @ #x~X~%" (-> this data)) + this ) ;; definition of type ocean-near-indices @@ -239,10 +239,10 @@ ) ;; definition for method 3 of type ocean-near-indices -(defmethod inspect ocean-near-indices ((obj ocean-near-indices)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdata: #x~X~%" (-> obj data)) - obj +(defmethod inspect ocean-near-indices ((this ocean-near-indices)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdata: #x~X~%" (-> this data)) + this ) ;; definition of type ocean-near-colors @@ -258,13 +258,13 @@ ) ;; definition for method 3 of type ocean-near-colors -(defmethod inspect ocean-near-colors ((obj ocean-near-colors)) - (format #t "[~8x] ~A~%" obj 'ocean-near-colors) - (format #t "~Tcolor0: #~%" (-> obj color0)) - (format #t "~Tcolor1: #~%" (-> obj color1)) - (format #t "~Tcolor2: #~%" (-> obj color2)) - (format #t "~Tcolor3: #~%" (-> obj color3)) - obj +(defmethod inspect ocean-near-colors ((this ocean-near-colors)) + (format #t "[~8x] ~A~%" this 'ocean-near-colors) + (format #t "~Tcolor0: #~%" (-> this color0)) + (format #t "~Tcolor1: #~%" (-> this color1)) + (format #t "~Tcolor2: #~%" (-> this color2)) + (format #t "~Tcolor3: #~%" (-> this color3)) + this ) ;; definition of type ocean-map @@ -284,17 +284,17 @@ ) ;; definition for method 3 of type ocean-map -(defmethod inspect ocean-map ((obj ocean-map)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tstart-corner: #~%" (-> obj start-corner)) - (format #t "~Tfar-color: #~%" (-> obj far-color)) - (format #t "~Tocean-spheres: #~%" (-> obj ocean-spheres)) - (format #t "~Tocean-colors: #~%" (-> obj ocean-colors)) - (format #t "~Tocean-mid-indices: ~A~%" (-> obj ocean-mid-indices)) - (format #t "~Tocean-trans-indices: ~A~%" (-> obj ocean-trans-indices)) - (format #t "~Tocean-near-indices: ~A~%" (-> obj ocean-near-indices)) - (format #t "~Tocean-mid-masks: ~A~%" (-> obj ocean-mid-masks)) - obj +(defmethod inspect ocean-map ((this ocean-map)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tstart-corner: #~%" (-> this start-corner)) + (format #t "~Tfar-color: #~%" (-> this far-color)) + (format #t "~Tocean-spheres: #~%" (-> this ocean-spheres)) + (format #t "~Tocean-colors: #~%" (-> this ocean-colors)) + (format #t "~Tocean-mid-indices: ~A~%" (-> this ocean-mid-indices)) + (format #t "~Tocean-trans-indices: ~A~%" (-> this ocean-trans-indices)) + (format #t "~Tocean-near-indices: ~A~%" (-> this ocean-near-indices)) + (format #t "~Tocean-mid-masks: ~A~%" (-> this ocean-mid-masks)) + this ) ;; definition of type ocean-trans-strip @@ -307,10 +307,10 @@ ) ;; definition for method 3 of type ocean-trans-strip -(defmethod inspect ocean-trans-strip ((obj ocean-trans-strip)) - (format #t "[~8x] ~A~%" obj 'ocean-trans-strip) - (format #t "~Tverts[10] @ #x~X~%" (-> obj verts)) - obj +(defmethod inspect ocean-trans-strip ((this ocean-trans-strip)) + (format #t "[~8x] ~A~%" this 'ocean-trans-strip) + (format #t "~Tverts[10] @ #x~X~%" (-> this verts)) + this ) ;; definition of type ocean-trans-strip-array @@ -323,10 +323,10 @@ ) ;; definition for method 3 of type ocean-trans-strip-array -(defmethod inspect ocean-trans-strip-array ((obj ocean-trans-strip-array)) - (format #t "[~8x] ~A~%" obj 'ocean-trans-strip-array) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect ocean-trans-strip-array ((this ocean-trans-strip-array)) + (format #t "[~8x] ~A~%" this 'ocean-trans-strip-array) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + this ) ;; definition of type ocean-wave-data @@ -339,10 +339,10 @@ ) ;; definition for method 3 of type ocean-wave-data -(defmethod inspect ocean-wave-data ((obj ocean-wave-data)) - (format #t "[~8x] ~A~%" obj 'ocean-wave-data) - (format #t "~Tdata[1024] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect ocean-wave-data ((this ocean-wave-data)) + (format #t "[~8x] ~A~%" this 'ocean-wave-data) + (format #t "~Tdata[1024] @ #x~X~%" (-> this data)) + this ) ;; definition of type ocean-wave-frames @@ -355,10 +355,10 @@ ) ;; definition for method 3 of type ocean-wave-frames -(defmethod inspect ocean-wave-frames ((obj ocean-wave-frames)) - (format #t "[~8x] ~A~%" obj 'ocean-wave-frames) - (format #t "~Tframe[64] @ #x~X~%" (-> obj frame)) - obj +(defmethod inspect ocean-wave-frames ((this ocean-wave-frames)) + (format #t "[~8x] ~A~%" this 'ocean-wave-frames) + (format #t "~Tframe[64] @ #x~X~%" (-> this frame)) + this ) ;; definition of type ocean-work @@ -395,34 +395,34 @@ ) ;; definition for method 3 of type ocean-work -(defmethod inspect ocean-work ((obj ocean-work)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdeltas: #~%" (-> obj deltas)) - (format #t "~Tmap-min: #~%" (-> obj map-min)) - (format #t "~Tmap-max: #~%" (-> obj map-max)) - (format #t "~Tinterp: #~%" (-> obj interp)) - (format #t "~Tcorner-array[25] @ #x~X~%" (-> obj corner-array)) - (format #t "~Tcorner-count: ~D~%" (-> obj corner-count)) - (format #t "~Ttemp-vecs[4] @ #x~X~%" (-> obj temp-vecs)) - (format #t "~Tmid-mask-ptrs[36] @ #x~X~%" (-> obj mid-mask-ptrs)) - (format #t "~Tmid-camera-masks[36] @ #x~X~%" (-> obj mid-camera-masks)) - (format #t "~Ttrans-mask-ptrs[64] @ #x~X~%" (-> obj trans-mask-ptrs)) - (format #t "~Ttrans-camera-masks[16] @ #x~X~%" (-> obj trans-camera-masks)) - (format #t "~Ttrans-temp-masks[16] @ #x~X~%" (-> obj trans-temp-masks)) - (format #t "~Tnear-mask-indices[16] @ #x~X~%" (-> obj near-mask-indices)) - (format #t "~Tmid-minx: ~D~%" (-> obj mid-minx)) - (format #t "~Tmid-maxx: ~D~%" (-> obj mid-maxx)) - (format #t "~Tmid-minz: ~D~%" (-> obj mid-minz)) - (format #t "~Tmid-maxz: ~D~%" (-> obj mid-maxz)) - (format #t "~Tnear-minx: ~D~%" (-> obj near-minx)) - (format #t "~Tnear-maxx: ~D~%" (-> obj near-maxx)) - (format #t "~Tnear-minz: ~D~%" (-> obj near-minz)) - (format #t "~Tnear-maxz: ~D~%" (-> obj near-maxz)) - (format #t "~Ttemp-minx: ~D~%" (-> obj temp-minx)) - (format #t "~Ttemp-maxx: ~D~%" (-> obj temp-maxx)) - (format #t "~Ttemp-minz: ~D~%" (-> obj temp-minz)) - (format #t "~Ttemp-maxz: ~D~%" (-> obj temp-maxz)) - obj +(defmethod inspect ocean-work ((this ocean-work)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdeltas: #~%" (-> this deltas)) + (format #t "~Tmap-min: #~%" (-> this map-min)) + (format #t "~Tmap-max: #~%" (-> this map-max)) + (format #t "~Tinterp: #~%" (-> this interp)) + (format #t "~Tcorner-array[25] @ #x~X~%" (-> this corner-array)) + (format #t "~Tcorner-count: ~D~%" (-> this corner-count)) + (format #t "~Ttemp-vecs[4] @ #x~X~%" (-> this temp-vecs)) + (format #t "~Tmid-mask-ptrs[36] @ #x~X~%" (-> this mid-mask-ptrs)) + (format #t "~Tmid-camera-masks[36] @ #x~X~%" (-> this mid-camera-masks)) + (format #t "~Ttrans-mask-ptrs[64] @ #x~X~%" (-> this trans-mask-ptrs)) + (format #t "~Ttrans-camera-masks[16] @ #x~X~%" (-> this trans-camera-masks)) + (format #t "~Ttrans-temp-masks[16] @ #x~X~%" (-> this trans-temp-masks)) + (format #t "~Tnear-mask-indices[16] @ #x~X~%" (-> this near-mask-indices)) + (format #t "~Tmid-minx: ~D~%" (-> this mid-minx)) + (format #t "~Tmid-maxx: ~D~%" (-> this mid-maxx)) + (format #t "~Tmid-minz: ~D~%" (-> this mid-minz)) + (format #t "~Tmid-maxz: ~D~%" (-> this mid-maxz)) + (format #t "~Tnear-minx: ~D~%" (-> this near-minx)) + (format #t "~Tnear-maxx: ~D~%" (-> this near-maxx)) + (format #t "~Tnear-minz: ~D~%" (-> this near-minz)) + (format #t "~Tnear-maxz: ~D~%" (-> this near-maxz)) + (format #t "~Ttemp-minx: ~D~%" (-> this temp-minx)) + (format #t "~Ttemp-maxx: ~D~%" (-> this temp-maxx)) + (format #t "~Ttemp-minz: ~D~%" (-> this temp-minz)) + (format #t "~Ttemp-maxz: ~D~%" (-> this temp-maxz)) + this ) ;; definition for symbol *ocean-work*, type ocean-work @@ -460,14 +460,14 @@ ) ;; definition for method 3 of type ocean-vu0-work -(defmethod inspect ocean-vu0-work ((obj ocean-vu0-work)) - (format #t "[~8x] ~A~%" obj 'ocean-vu0-work) - (format #t "~Tscales: #~%" (-> obj scales)) - (format #t "~Tmask-hi: #~%" (-> obj mask-hi)) - (format #t "~Tmask-lo: #~%" (-> obj mask-lo)) - (format #t "~Tlights: #~%" (-> obj lights)) - (format #t "~Twait-to-vu0: ~D~%" (-> obj wait-to-vu0)) - obj +(defmethod inspect ocean-vu0-work ((this ocean-vu0-work)) + (format #t "[~8x] ~A~%" this 'ocean-vu0-work) + (format #t "~Tscales: #~%" (-> this scales)) + (format #t "~Tmask-hi: #~%" (-> this mask-hi)) + (format #t "~Tmask-lo: #~%" (-> this mask-lo)) + (format #t "~Tlights: #~%" (-> this lights)) + (format #t "~Twait-to-vu0: ~D~%" (-> this wait-to-vu0)) + this ) ;; definition of type ocean-texture-constants @@ -486,16 +486,16 @@ ) ;; definition for method 3 of type ocean-texture-constants -(defmethod inspect ocean-texture-constants ((obj ocean-texture-constants)) - (format #t "[~8x] ~A~%" obj 'ocean-texture-constants) - (format #t "~Tgiftag: #~%" (-> obj giftag)) - (format #t "~Tbuffers: #~%" (-> obj buffers)) - (format #t "~Tdests: #~%" (-> obj dests)) - (format #t "~Tstart: #~%" (-> obj start)) - (format #t "~Toffsets: #~%" (-> obj offsets)) - (format #t "~Tconstants: #~%" (-> obj constants)) - (format #t "~Tcam-nrm: #~%" (-> obj cam-nrm)) - obj +(defmethod inspect ocean-texture-constants ((this ocean-texture-constants)) + (format #t "[~8x] ~A~%" this 'ocean-texture-constants) + (format #t "~Tgiftag: #~%" (-> this giftag)) + (format #t "~Tbuffers: #~%" (-> this buffers)) + (format #t "~Tdests: #~%" (-> this dests)) + (format #t "~Tstart: #~%" (-> this start)) + (format #t "~Toffsets: #~%" (-> this offsets)) + (format #t "~Tconstants: #~%" (-> this constants)) + (format #t "~Tcam-nrm: #~%" (-> this cam-nrm)) + this ) ;; definition of type ocean-texture-work @@ -510,12 +510,12 @@ ) ;; definition for method 3 of type ocean-texture-work -(defmethod inspect ocean-texture-work ((obj ocean-texture-work)) - (format #t "[~8x] ~A~%" obj 'ocean-texture-work) - (format #t "~Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) - (format #t "~Tsprite-tmpl2: #~%" (-> obj sprite-tmpl2)) - (format #t "~Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - obj +(defmethod inspect ocean-texture-work ((this ocean-texture-work)) + (format #t "[~8x] ~A~%" this 'ocean-texture-work) + (format #t "~Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~Tsprite-tmpl2: #~%" (-> this sprite-tmpl2)) + (format #t "~Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + this ) ;; definition of type ocean-mid-vertex @@ -530,12 +530,12 @@ ) ;; definition for method 3 of type ocean-mid-vertex -(defmethod inspect ocean-mid-vertex ((obj ocean-mid-vertex)) - (format #t "[~8x] ~A~%" obj 'ocean-mid-vertex) - (format #t "~Tstq: #~%" (-> obj stq)) - (format #t "~Tcol: #~%" (-> obj col)) - (format #t "~Tpos: #~%" (-> obj pos)) - obj +(defmethod inspect ocean-mid-vertex ((this ocean-mid-vertex)) + (format #t "[~8x] ~A~%" this 'ocean-mid-vertex) + (format #t "~Tstq: #~%" (-> this stq)) + (format #t "~Tcol: #~%" (-> this col)) + (format #t "~Tpos: #~%" (-> this pos)) + this ) ;; definition of type ocean-mid-constants @@ -568,30 +568,30 @@ ) ;; definition for method 3 of type ocean-mid-constants -(defmethod inspect ocean-mid-constants ((obj ocean-mid-constants)) - (format #t "[~8x] ~A~%" obj 'ocean-mid-constants) - (format #t "~Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) - (format #t "~Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~Tfog: #~%" (-> obj fog)) - (format #t "~Tconstants: #~%" (-> obj constants)) - (format #t "~Tconstants2: #~%" (-> obj constants2)) - (format #t "~Tdrw-fan: #~%" (-> obj drw-fan)) - (format #t "~Tenv-fan: #~%" (-> obj env-fan)) - (format #t "~Tdrw-adgif: #~%" (-> obj drw-adgif)) - (format #t "~Tdrw-texture: #~%" (-> obj drw-texture)) - (format #t "~Tdrw-strip-0: #~%" (-> obj drw-strip-0)) - (format #t "~Tdrw-strip-1: #~%" (-> obj drw-strip-1)) - (format #t "~Tenv-adgif: #~%" (-> obj env-adgif)) - (format #t "~Tenv-texture: #~%" (-> obj env-texture)) - (format #t "~Tenv-strip: #~%" (-> obj env-strip)) - (format #t "~Tenv-color: #~%" (-> obj env-color)) - (format #t "~Tindex-table[8] @ #x~X~%" (-> obj index-table)) - (format #t "~Tpos0: #~%" (-> obj pos0)) - (format #t "~Tpos1: #~%" (-> obj pos1)) - (format #t "~Tpos2: #~%" (-> obj pos2)) - (format #t "~Tpos3: #~%" (-> obj pos3)) - obj +(defmethod inspect ocean-mid-constants ((this ocean-mid-constants)) + (format #t "[~8x] ~A~%" this 'ocean-mid-constants) + (format #t "~Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~Tinv-hmge-scale: #~%" (-> this inv-hmge-scale)) + (format #t "~Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~Tfog: #~%" (-> this fog)) + (format #t "~Tconstants: #~%" (-> this constants)) + (format #t "~Tconstants2: #~%" (-> this constants2)) + (format #t "~Tdrw-fan: #~%" (-> this drw-fan)) + (format #t "~Tenv-fan: #~%" (-> this env-fan)) + (format #t "~Tdrw-adgif: #~%" (-> this drw-adgif)) + (format #t "~Tdrw-texture: #~%" (-> this drw-texture)) + (format #t "~Tdrw-strip-0: #~%" (-> this drw-strip-0)) + (format #t "~Tdrw-strip-1: #~%" (-> this drw-strip-1)) + (format #t "~Tenv-adgif: #~%" (-> this env-adgif)) + (format #t "~Tenv-texture: #~%" (-> this env-texture)) + (format #t "~Tenv-strip: #~%" (-> this env-strip)) + (format #t "~Tenv-color: #~%" (-> this env-color)) + (format #t "~Tindex-table[8] @ #x~X~%" (-> this index-table)) + (format #t "~Tpos0: #~%" (-> this pos0)) + (format #t "~Tpos1: #~%" (-> this pos1)) + (format #t "~Tpos2: #~%" (-> this pos2)) + (format #t "~Tpos3: #~%" (-> this pos3)) + this ) ;; definition of type ocean-mid-upload @@ -607,13 +607,13 @@ ) ;; definition for method 3 of type ocean-mid-upload -(defmethod inspect ocean-mid-upload ((obj ocean-mid-upload)) - (format #t "[~8x] ~A~%" obj 'ocean-mid-upload) - (format #t "~Trot: #~%" (-> obj rot)) - (format #t "~Tmatrix: #~%" (-> obj matrix)) - (format #t "~Tcolors[108] @ #x~X~%" (-> obj colors)) - (format #t "~Tmasks[2] @ #x~X~%" (-> obj masks)) - obj +(defmethod inspect ocean-mid-upload ((this ocean-mid-upload)) + (format #t "[~8x] ~A~%" this 'ocean-mid-upload) + (format #t "~Trot: #~%" (-> this rot)) + (format #t "~Tmatrix: #~%" (-> this matrix)) + (format #t "~Tcolors[108] @ #x~X~%" (-> this colors)) + (format #t "~Tmasks[2] @ #x~X~%" (-> this masks)) + this ) ;; definition of type ocean-mid-upload2 @@ -637,21 +637,21 @@ ) ;; definition for method 3 of type ocean-mid-upload2 -(defmethod inspect ocean-mid-upload2 ((obj ocean-mid-upload2)) - (format #t "[~8x] ~A~%" obj 'ocean-mid-upload2) - (format #t "~Trot: #~%" (-> obj rot)) - (format #t "~Tmatrix: #~%" (-> obj matrix)) - (format #t "~Tcount: #~%" (-> obj count)) - (format #t "~Ttex0: #~%" (-> obj tex0)) - (format #t "~Ttex1: #~%" (-> obj tex1)) - (format #t "~Ttex2: #~%" (-> obj tex2)) - (format #t "~Ttex3: #~%" (-> obj tex3)) - (format #t "~Tclr0: #~%" (-> obj clr0)) - (format #t "~Tclr1: #~%" (-> obj clr1)) - (format #t "~Tclr2: #~%" (-> obj clr2)) - (format #t "~Tclr3: #~%" (-> obj clr3)) - (format #t "~Tverts[18] @ #x~X~%" (-> obj verts)) - obj +(defmethod inspect ocean-mid-upload2 ((this ocean-mid-upload2)) + (format #t "[~8x] ~A~%" this 'ocean-mid-upload2) + (format #t "~Trot: #~%" (-> this rot)) + (format #t "~Tmatrix: #~%" (-> this matrix)) + (format #t "~Tcount: #~%" (-> this count)) + (format #t "~Ttex0: #~%" (-> this tex0)) + (format #t "~Ttex1: #~%" (-> this tex1)) + (format #t "~Ttex2: #~%" (-> this tex2)) + (format #t "~Ttex3: #~%" (-> this tex3)) + (format #t "~Tclr0: #~%" (-> this clr0)) + (format #t "~Tclr1: #~%" (-> this clr1)) + (format #t "~Tclr2: #~%" (-> this clr2)) + (format #t "~Tclr3: #~%" (-> this clr3)) + (format #t "~Tverts[18] @ #x~X~%" (-> this verts)) + this ) ;; definition of type ocean-mid-work @@ -670,16 +670,16 @@ ) ;; definition for method 3 of type ocean-mid-work -(defmethod inspect ocean-mid-work ((obj ocean-mid-work)) - (format #t "[~8x] ~A~%" obj 'ocean-mid-work) - (format #t "~Tenv0: #~%" (-> obj env0)) - (format #t "~Tenv1: #~%" (-> obj env1)) - (format #t "~Tenv2: #~%" (-> obj env2)) - (format #t "~Thmg0: #~%" (-> obj hmg0)) - (format #t "~Thmg1: #~%" (-> obj hmg1)) - (format #t "~Thmg2: #~%" (-> obj hmg2)) - (format #t "~Tindices[16] @ #x~X~%" (-> obj indices)) - obj +(defmethod inspect ocean-mid-work ((this ocean-mid-work)) + (format #t "[~8x] ~A~%" this 'ocean-mid-work) + (format #t "~Tenv0: #~%" (-> this env0)) + (format #t "~Tenv1: #~%" (-> this env1)) + (format #t "~Tenv2: #~%" (-> this env2)) + (format #t "~Thmg0: #~%" (-> this hmg0)) + (format #t "~Thmg1: #~%" (-> this hmg1)) + (format #t "~Thmg2: #~%" (-> this hmg2)) + (format #t "~Tindices[16] @ #x~X~%" (-> this indices)) + this ) ;; definition of type ocean-near-constants @@ -716,34 +716,34 @@ ) ;; definition for method 3 of type ocean-near-constants -(defmethod inspect ocean-near-constants ((obj ocean-near-constants)) - (format #t "[~8x] ~A~%" obj 'ocean-near-constants) - (format #t "~Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) - (format #t "~Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~Tfog: #~%" (-> obj fog)) - (format #t "~Tconstants: #~%" (-> obj constants)) - (format #t "~Tconstants2: #~%" (-> obj constants2)) - (format #t "~Tconstants3: #~%" (-> obj constants3)) - (format #t "~Tconstants4: #~%" (-> obj constants4)) - (format #t "~Tdrw-fan: #~%" (-> obj drw-fan)) - (format #t "~Tdrw2-fan: #~%" (-> obj drw2-fan)) - (format #t "~Tenv-fan: #~%" (-> obj env-fan)) - (format #t "~Tdrw-adgif: #~%" (-> obj drw-adgif)) - (format #t "~Tdrw-texture: #~%" (-> obj drw-texture)) - (format #t "~Tdrw-strip: #~%" (-> obj drw-strip)) - (format #t "~Tenv-adgif: #~%" (-> obj env-adgif)) - (format #t "~Tenv-texture: #~%" (-> obj env-texture)) - (format #t "~Tenv-strip: #~%" (-> obj env-strip)) - (format #t "~Tenv-color: #~%" (-> obj env-color)) - (format #t "~Tdrw2-adgif: #~%" (-> obj drw2-adgif)) - (format #t "~Tdrw2-tex0: #~%" (-> obj drw2-tex0)) - (format #t "~Tdrw2-frame: #~%" (-> obj drw2-frame)) - (format #t "~Tdrw2-strip: #~%" (-> obj drw2-strip)) - (format #t "~Tdrw3-adgif: #~%" (-> obj drw3-adgif)) - (format #t "~Tdrw3-frame: #~%" (-> obj drw3-frame)) - (format #t "~Tindex-table[4] @ #x~X~%" (-> obj index-table)) - obj +(defmethod inspect ocean-near-constants ((this ocean-near-constants)) + (format #t "[~8x] ~A~%" this 'ocean-near-constants) + (format #t "~Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~Tinv-hmge-scale: #~%" (-> this inv-hmge-scale)) + (format #t "~Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~Tfog: #~%" (-> this fog)) + (format #t "~Tconstants: #~%" (-> this constants)) + (format #t "~Tconstants2: #~%" (-> this constants2)) + (format #t "~Tconstants3: #~%" (-> this constants3)) + (format #t "~Tconstants4: #~%" (-> this constants4)) + (format #t "~Tdrw-fan: #~%" (-> this drw-fan)) + (format #t "~Tdrw2-fan: #~%" (-> this drw2-fan)) + (format #t "~Tenv-fan: #~%" (-> this env-fan)) + (format #t "~Tdrw-adgif: #~%" (-> this drw-adgif)) + (format #t "~Tdrw-texture: #~%" (-> this drw-texture)) + (format #t "~Tdrw-strip: #~%" (-> this drw-strip)) + (format #t "~Tenv-adgif: #~%" (-> this env-adgif)) + (format #t "~Tenv-texture: #~%" (-> this env-texture)) + (format #t "~Tenv-strip: #~%" (-> this env-strip)) + (format #t "~Tenv-color: #~%" (-> this env-color)) + (format #t "~Tdrw2-adgif: #~%" (-> this drw2-adgif)) + (format #t "~Tdrw2-tex0: #~%" (-> this drw2-tex0)) + (format #t "~Tdrw2-frame: #~%" (-> this drw2-frame)) + (format #t "~Tdrw2-strip: #~%" (-> this drw2-strip)) + (format #t "~Tdrw3-adgif: #~%" (-> this drw3-adgif)) + (format #t "~Tdrw3-frame: #~%" (-> this drw3-frame)) + (format #t "~Tindex-table[4] @ #x~X~%" (-> this index-table)) + this ) ;; definition of type ocean-near-upload @@ -761,15 +761,15 @@ ) ;; definition for method 3 of type ocean-near-upload -(defmethod inspect ocean-near-upload ((obj ocean-near-upload)) - (format #t "[~8x] ~A~%" obj 'ocean-near-upload) - (format #t "~Trot: #~%" (-> obj rot)) - (format #t "~Tmatrix: #~%" (-> obj matrix)) - (format #t "~Tmasks[2] @ #x~X~%" (-> obj masks)) - (format #t "~Tstart-height: #~%" (-> obj start-height)) - (format #t "~Tstart-st: #~%" (-> obj start-st)) - (format #t "~Tnear-colors: #~%" (-> obj near-colors)) - obj +(defmethod inspect ocean-near-upload ((this ocean-near-upload)) + (format #t "[~8x] ~A~%" this 'ocean-near-upload) + (format #t "~Trot: #~%" (-> this rot)) + (format #t "~Tmatrix: #~%" (-> this matrix)) + (format #t "~Tmasks[2] @ #x~X~%" (-> this masks)) + (format #t "~Tstart-height: #~%" (-> this start-height)) + (format #t "~Tstart-st: #~%" (-> this start-st)) + (format #t "~Tnear-colors: #~%" (-> this near-colors)) + this ) ;; definition of type ocean-near-vertex @@ -784,12 +784,12 @@ ) ;; definition for method 3 of type ocean-near-vertex -(defmethod inspect ocean-near-vertex ((obj ocean-near-vertex)) - (format #t "[~8x] ~A~%" obj 'ocean-near-vertex) - (format #t "~Tstq: #~%" (-> obj stq)) - (format #t "~Tclr: #~%" (-> obj clr)) - (format #t "~Tpos: #~%" (-> obj pos)) - obj +(defmethod inspect ocean-near-vertex ((this ocean-near-vertex)) + (format #t "[~8x] ~A~%" this 'ocean-near-vertex) + (format #t "~Tstq: #~%" (-> this stq)) + (format #t "~Tclr: #~%" (-> this clr)) + (format #t "~Tpos: #~%" (-> this pos)) + this ) ;; definition of type ocean-near-work @@ -803,11 +803,11 @@ ) ;; definition for method 3 of type ocean-near-work -(defmethod inspect ocean-near-work ((obj ocean-near-work)) - (format #t "[~8x] ~A~%" obj 'ocean-near-work) - (format #t "~Tverts-ptr: #~%" (-> obj verts-ptr)) - (format #t "~Tindices[16] @ #x~X~%" (-> obj indices)) - obj +(defmethod inspect ocean-near-work ((this ocean-near-work)) + (format #t "[~8x] ~A~%" this 'ocean-near-work) + (format #t "~Tverts-ptr: #~%" (-> this verts-ptr)) + (format #t "~Tindices[16] @ #x~X~%" (-> this indices)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-h_REF.gc index f7e3483f2e..5f6dd2e892 100644 --- a/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-h_REF.gc @@ -19,17 +19,17 @@ ) ;; definition for method 3 of type fake-shadow -(defmethod inspect fake-shadow ((obj fake-shadow)) - (format #t "[~8x] ~A~%" obj 'fake-shadow) - (format #t "~Tpx: ~f~%" (-> obj px)) - (format #t "~Tpy: ~f~%" (-> obj py)) - (format #t "~Tpz: ~f~%" (-> obj pz)) - (format #t "~Tscale: ~f~%" (-> obj scale)) - (format #t "~Tqx: ~f~%" (-> obj qx)) - (format #t "~Tqy: ~f~%" (-> obj qy)) - (format #t "~Tqz: ~f~%" (-> obj qz)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - obj +(defmethod inspect fake-shadow ((this fake-shadow)) + (format #t "[~8x] ~A~%" this 'fake-shadow) + (format #t "~Tpx: ~f~%" (-> this px)) + (format #t "~Tpy: ~f~%" (-> this py)) + (format #t "~Tpz: ~f~%" (-> this pz)) + (format #t "~Tscale: ~f~%" (-> this scale)) + (format #t "~Tqx: ~f~%" (-> this qx)) + (format #t "~Tqy: ~f~%" (-> this qy)) + (format #t "~Tqz: ~f~%" (-> this qz)) + (format #t "~Tflags: ~D~%" (-> this flags)) + this ) ;; definition of type fake-shadow-buffer @@ -43,11 +43,11 @@ ) ;; definition for method 3 of type fake-shadow-buffer -(defmethod inspect fake-shadow-buffer ((obj fake-shadow-buffer)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-shadows: ~D~%" (-> obj num-shadows)) - (format #t "~Tdata[32] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect fake-shadow-buffer ((this fake-shadow-buffer)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-shadows: ~D~%" (-> this num-shadows)) + (format #t "~Tdata[32] @ #x~X~%" (-> this data)) + this ) ;; definition for symbol *fake-shadow-buffer-1*, type fake-shadow-buffer diff --git a/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-vu1_REF.gc b/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-vu1_REF.gc index 01641dfdbf..89b0a085eb 100644 --- a/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-vu1_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/shadow/shadow-vu1_REF.gc @@ -22,21 +22,21 @@ ) ;; definition for method 3 of type shadow-vu1-constants -(defmethod inspect shadow-vu1-constants ((obj shadow-vu1-constants)) - (format #t "[~8x] ~A~%" obj 'shadow-vu1-constants) - (format #t "~Thmgescale: #~%" (-> obj hmgescale)) - (format #t "~Tinvhscale: #~%" (-> obj invhscale)) - (format #t "~Ttexoffset: #~%" (-> obj texoffset)) - (format #t "~Ttexscale: #~%" (-> obj texscale)) - (format #t "~Thvdfoff: #~%" (-> obj hvdfoff)) - (format #t "~Tfog: #~%" (-> obj fog)) - (format #t "~Tclrs[2] @ #x~X~%" (-> obj clrs)) - (format #t "~Tadgif: #~%" (-> obj adgif)) - (format #t "~Ttexflush: #~%" (-> obj texflush)) - (format #t "~Tflush: #~%" (-> obj flush)) - (format #t "~Ttrigif: #~%" (-> obj trigif)) - (format #t "~Tquadgif: #~%" (-> obj quadgif)) - obj +(defmethod inspect shadow-vu1-constants ((this shadow-vu1-constants)) + (format #t "[~8x] ~A~%" this 'shadow-vu1-constants) + (format #t "~Thmgescale: #~%" (-> this hmgescale)) + (format #t "~Tinvhscale: #~%" (-> this invhscale)) + (format #t "~Ttexoffset: #~%" (-> this texoffset)) + (format #t "~Ttexscale: #~%" (-> this texscale)) + (format #t "~Thvdfoff: #~%" (-> this hvdfoff)) + (format #t "~Tfog: #~%" (-> this fog)) + (format #t "~Tclrs[2] @ #x~X~%" (-> this clrs)) + (format #t "~Tadgif: #~%" (-> this adgif)) + (format #t "~Ttexflush: #~%" (-> this texflush)) + (format #t "~Tflush: #~%" (-> this flush)) + (format #t "~Ttrigif: #~%" (-> this trigif)) + (format #t "~Tquadgif: #~%" (-> this quadgif)) + this ) ;; definition of type shadow-vu1-gifbuf-template @@ -53,14 +53,14 @@ ) ;; definition for method 3 of type shadow-vu1-gifbuf-template -(defmethod inspect shadow-vu1-gifbuf-template ((obj shadow-vu1-gifbuf-template)) - (format #t "[~8x] ~A~%" obj 'shadow-vu1-gifbuf-template) - (format #t "~Tadgif: #~%" (-> obj adgif)) - (format #t "~Tad: #~%" (-> obj ad)) - (format #t "~Tflush: #~%" (-> obj flush)) - (format #t "~Ttrigif: #~%" (-> obj trigif)) - (format #t "~Tquadgif: #~%" (-> obj quadgif)) - obj +(defmethod inspect shadow-vu1-gifbuf-template ((this shadow-vu1-gifbuf-template)) + (format #t "[~8x] ~A~%" this 'shadow-vu1-gifbuf-template) + (format #t "~Tadgif: #~%" (-> this adgif)) + (format #t "~Tad: #~%" (-> this ad)) + (format #t "~Tflush: #~%" (-> this flush)) + (format #t "~Ttrigif: #~%" (-> this trigif)) + (format #t "~Tquadgif: #~%" (-> this quadgif)) + this ) ;; definition for symbol *shadow-vu1-tri-template*, type shadow-vu1-gifbuf-template diff --git a/test/decompiler/reference/jak1/engine/gfx/shrub/shrubbery-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/shrub/shrubbery-h_REF.gc index 6fdb25bb63..b8ce352401 100644 --- a/test/decompiler/reference/jak1/engine/gfx/shrub/shrubbery-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/shrub/shrubbery-h_REF.gc @@ -11,12 +11,12 @@ ) ;; definition for method 3 of type billboard -(defmethod inspect billboard ((obj billboard)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tflat: #~%" (-> obj flat)) - obj +(defmethod inspect billboard ((this billboard)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tflat: #~%" (-> this flat)) + this ) ;; definition of type shrub-view-data @@ -40,21 +40,21 @@ ) ;; definition for method 3 of type shrub-view-data -(defmethod inspect shrub-view-data ((obj shrub-view-data)) - (format #t "[~8x] ~A~%" obj 'shrub-view-data) - (format #t "~Tdata[3] @ #x~X~%" (-> obj data)) - (format #t "~Ttexture-giftag: #~%" (-> obj data)) - (format #t "~Tconsts: #~%" (&-> obj tex-start-ptr)) - (format #t "~Tfog-clamp: #~%" (&-> obj fog-min)) - (format #t "~Ttex-start-ptr: ~D~%" (-> obj tex-start-ptr)) - (format #t "~Tgifbufsum: ~f~%" (-> obj gifbufsum)) - (format #t "~Tmtx-buf-ptr: ~D~%" (-> obj mtx-buf-ptr)) - (format #t "~Texp23: ~f~%" (-> obj exp23)) - (format #t "~Tfog-0: ~f~%" (-> obj fog-0)) - (format #t "~Tfog-1: ~f~%" (-> obj fog-1)) - (format #t "~Tfog-min: ~f~%" (-> obj fog-min)) - (format #t "~Tfog-max: ~f~%" (-> obj fog-max)) - obj +(defmethod inspect shrub-view-data ((this shrub-view-data)) + (format #t "[~8x] ~A~%" this 'shrub-view-data) + (format #t "~Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~Ttexture-giftag: #~%" (-> this data)) + (format #t "~Tconsts: #~%" (&-> this tex-start-ptr)) + (format #t "~Tfog-clamp: #~%" (&-> this fog-min)) + (format #t "~Ttex-start-ptr: ~D~%" (-> this tex-start-ptr)) + (format #t "~Tgifbufsum: ~f~%" (-> this gifbufsum)) + (format #t "~Tmtx-buf-ptr: ~D~%" (-> this mtx-buf-ptr)) + (format #t "~Texp23: ~f~%" (-> this exp23)) + (format #t "~Tfog-0: ~f~%" (-> this fog-0)) + (format #t "~Tfog-1: ~f~%" (-> this fog-1)) + (format #t "~Tfog-min: ~f~%" (-> this fog-min)) + (format #t "~Tfog-max: ~f~%" (-> this fog-max)) + this ) ;; definition of type shrubbery @@ -76,21 +76,21 @@ ) ;; definition for method 3 of type shrubbery -(defmethod inspect shrubbery ((obj shrubbery)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (&-> obj obj)) - (format #t "~Ttextures: #x~X~%" (-> obj textures)) - (format #t "~Theader: #~%" (-> obj header)) - (format #t "~Tobj-qwc: ~D~%" (-> obj obj-qwc)) - (format #t "~Tvtx-qwc: ~D~%" (-> obj vtx-qwc)) - (format #t "~Tcol-qwc: ~D~%" (-> obj col-qwc)) - (format #t "~Tstq-qwc: ~D~%" (-> obj stq-qwc)) - (format #t "~Tobj: #x~X~%" (-> obj obj)) - (format #t "~Tvtx: #x~X~%" (-> obj vtx)) - (format #t "~Tcol: #x~X~%" (-> obj col)) - (format #t "~Tstq: #x~X~%" (-> obj stq)) - obj +(defmethod inspect shrubbery ((this shrubbery)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (&-> this obj)) + (format #t "~Ttextures: #x~X~%" (-> this textures)) + (format #t "~Theader: #~%" (-> this header)) + (format #t "~Tobj-qwc: ~D~%" (-> this obj-qwc)) + (format #t "~Tvtx-qwc: ~D~%" (-> this vtx-qwc)) + (format #t "~Tcol-qwc: ~D~%" (-> this col-qwc)) + (format #t "~Tstq-qwc: ~D~%" (-> this stq-qwc)) + (format #t "~Tobj: #x~X~%" (-> this obj)) + (format #t "~Tvtx: #x~X~%" (-> this vtx)) + (format #t "~Tcol: #x~X~%" (-> this col)) + (format #t "~Tstq: #x~X~%" (-> this stq)) + this ) ;; definition of type instance-shrubbery @@ -106,17 +106,17 @@ ) ;; definition for method 3 of type instance-shrubbery -(defmethod inspect instance-shrubbery ((obj instance-shrubbery)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tbucket-index: ~D~%" (-> obj bucket-index)) - (format #t "~Torigin: #~%" (-> obj origin)) - (format #t "~Twind-index: ~D~%" (-> obj wind-index)) - (format #t "~Tflat-normal: #~%" (-> obj flat-normal)) - (format #t "~Tflat-hwidth: ~f~%" (-> obj flat-normal w)) - (format #t "~Tcolor: ~D~%" (-> obj error)) - obj +(defmethod inspect instance-shrubbery ((this instance-shrubbery)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tbucket-index: ~D~%" (-> this bucket-index)) + (format #t "~Torigin: #~%" (-> this origin)) + (format #t "~Twind-index: ~D~%" (-> this wind-index)) + (format #t "~Tflat-normal: #~%" (-> this flat-normal)) + (format #t "~Tflat-hwidth: ~f~%" (-> this flat-normal w)) + (format #t "~Tcolor: ~D~%" (-> this error)) + this ) ;; definition of type drawable-inline-array-instance-shrub @@ -158,21 +158,21 @@ ) ;; definition for method 3 of type generic-shrub-fragment -(defmethod inspect generic-shrub-fragment ((obj generic-shrub-fragment)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (&-> obj cnt)) - (format #t "~Ttextures: #x~X~%" (-> obj textures)) - (format #t "~Tvtx-cnt: ~D~%" (-> obj vtx-cnt)) - (format #t "~Tcnt-qwc: ~D~%" (-> obj cnt-qwc)) - (format #t "~Tvtx-qwc: ~D~%" (-> obj vtx-qwc)) - (format #t "~Tcol-qwc: ~D~%" (-> obj col-qwc)) - (format #t "~Tstq-qwc: ~D~%" (-> obj stq-qwc)) - (format #t "~Tcnt: #x~X~%" (-> obj cnt)) - (format #t "~Tvtx: #x~X~%" (-> obj vtx)) - (format #t "~Tcol: #x~X~%" (-> obj col)) - (format #t "~Tstq: #x~X~%" (-> obj stq)) - obj +(defmethod inspect generic-shrub-fragment ((this generic-shrub-fragment)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (&-> this cnt)) + (format #t "~Ttextures: #x~X~%" (-> this textures)) + (format #t "~Tvtx-cnt: ~D~%" (-> this vtx-cnt)) + (format #t "~Tcnt-qwc: ~D~%" (-> this cnt-qwc)) + (format #t "~Tvtx-qwc: ~D~%" (-> this vtx-qwc)) + (format #t "~Tcol-qwc: ~D~%" (-> this col-qwc)) + (format #t "~Tstq-qwc: ~D~%" (-> this stq-qwc)) + (format #t "~Tcnt: #x~X~%" (-> this cnt)) + (format #t "~Tvtx: #x~X~%" (-> this vtx)) + (format #t "~Tcol: #x~X~%" (-> this col)) + (format #t "~Tstq: #x~X~%" (-> this stq)) + this ) ;; definition of type prototype-shrubbery @@ -212,21 +212,21 @@ ) ;; definition for method 3 of type shrubbery-matrix -(defmethod inspect shrubbery-matrix ((obj shrubbery-matrix)) - (format #t "[~8x] ~A~%" obj 'shrubbery-matrix) - (format #t "~Tmat: #~%" (-> obj mat)) - (format #t "~Tcolor: #~%" (-> obj color)) - obj +(defmethod inspect shrubbery-matrix ((this shrubbery-matrix)) + (format #t "[~8x] ~A~%" this 'shrubbery-matrix) + (format #t "~Tmat: #~%" (-> this mat)) + (format #t "~Tcolor: #~%" (-> this color)) + this ) ;; definition for function shrubbery-login-post-texture ;; INFO: Used lq/sq ;; INFO: Return type mismatch symbol vs none. -(defun shrubbery-login-post-texture ((obj shrubbery)) - (let* ((shader-count (-> obj header data 0)) - (dst (the-as qword (+ (the-as uint (-> obj header)) (* (+ (-> obj header data 1) 1) 16)))) +(defun shrubbery-login-post-texture ((this shrubbery)) + (let* ((shader-count (-> this header data 0)) + (dst (the-as qword (+ (the-as uint (-> this header)) (* (+ (-> this header data 1) 1) 16)))) (tex-dst (the-as qword (+ (the-as int dst) (* shader-count 64)))) - (src (the-as qword (-> obj textures))) + (src (the-as qword (-> this textures))) ) (dotimes (a0-1 (the-as int shader-count)) (set! (-> tex-dst quad) (-> src quad)) @@ -273,17 +273,17 @@ ) ;; definition for method 3 of type shrub-near-packet -(defmethod inspect shrub-near-packet ((obj shrub-near-packet)) - (format #t "[~8x] ~A~%" obj 'shrub-near-packet) - (format #t "~Tmatrix-tmpl: #~%" (-> obj matrix-tmpl)) - (format #t "~Theader-tmpl: #~%" (-> obj header-tmpl)) - (format #t "~Tstq-tmpl: #~%" (-> obj stq-tmpl)) - (format #t "~Tcolor-tmpl: #~%" (-> obj color-tmpl)) - (format #t "~Tvertex-tmpl: #~%" (-> obj vertex-tmpl)) - (format #t "~Tmscal-tmpl: #~%" (-> obj mscal-tmpl)) - (format #t "~Tinit-tmpl: #~%" (-> obj init-tmpl)) - (format #t "~Tinit-data[8] @ #x~X~%" (-> obj init-data)) - obj +(defmethod inspect shrub-near-packet ((this shrub-near-packet)) + (format #t "[~8x] ~A~%" this 'shrub-near-packet) + (format #t "~Tmatrix-tmpl: #~%" (-> this matrix-tmpl)) + (format #t "~Theader-tmpl: #~%" (-> this header-tmpl)) + (format #t "~Tstq-tmpl: #~%" (-> this stq-tmpl)) + (format #t "~Tcolor-tmpl: #~%" (-> this color-tmpl)) + (format #t "~Tvertex-tmpl: #~%" (-> this vertex-tmpl)) + (format #t "~Tmscal-tmpl: #~%" (-> this mscal-tmpl)) + (format #t "~Tinit-tmpl: #~%" (-> this init-tmpl)) + (format #t "~Tinit-data[8] @ #x~X~%" (-> this init-data)) + this ) ;; definition of type instance-shrub-work @@ -355,72 +355,72 @@ ) ;; definition for method 3 of type instance-shrub-work -(defmethod inspect instance-shrub-work ((obj instance-shrub-work)) - (format #t "[~8x] ~A~%" obj 'instance-shrub-work) - (format #t "~Tdummy[3] @ #x~X~%" (-> obj dummy)) - (format #t "~Tchaina[8] @ #x~X~%" (-> obj chaina)) - (format #t "~Tchainb[8] @ #x~X~%" (-> obj chainb)) - (format #t "~Tcolors[1024] @ #x~X~%" (-> obj colors)) - (format #t "~Tmatrix-tmpl[20] @ #x~X~%" (-> obj matrix-tmpl)) - (format #t "~Tcount-tmpl[20] @ #x~X~%" (-> obj count-tmpl)) - (format #t "~Tmscalf-tmpl: #~%" (-> obj mscalf-tmpl)) - (format #t "~Tmscalf-ret-tmpl: #~%" (-> obj mscalf-ret-tmpl)) - (format #t "~Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~Tbillboard-tmpl: #~%" (-> obj billboard-tmpl)) - (format #t "~Tbillboard-const: #~%" (-> obj billboard-const)) - (format #t "~Tshrub-near-packets[6] @ #x~X~%" (-> obj shrub-near-packets)) - (format #t "~Tdma-ref: #~%" (-> obj dma-ref)) - (format #t "~Tdma-end: #~%" (-> obj dma-end)) - (format #t "~Twind-const: #~%" (-> obj wind-const)) - (format #t "~Tconstants: #~%" (-> obj constants)) - (format #t "~Tcolor-constant: #~%" (-> obj color-constant)) - (format #t "~Thmge-d: #~%" (-> obj hmge-d)) - (format #t "~Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~Twind-force: #~%" (-> obj wind-force)) - (format #t "~Tcolor: #~%" (-> obj color)) - (format #t "~Tbb-color: #~%" (-> obj bb-color)) - (format #t "~Tmin-dist: #~%" (-> obj min-dist)) - (format #t "~Ttemp-vec: #~%" (-> obj temp-vec)) - (format #t "~Tguard-plane[4] @ #x~X~%" (-> obj guard-plane)) - (format #t "~Tplane[4] @ #x~X~%" (-> obj plane)) - (format #t "~Tlast[4] @ #x~X~%" (-> obj last)) - (format #t "~Tnext[4] @ #x~X~%" (-> obj next)) - (format #t "~Tcount[4] @ #x~X~%" (-> obj count)) - (format #t "~Tmod-count[4] @ #x~X~%" (-> obj mod-count)) - (format #t "~Twind-vectors: #x~X~%" (-> obj wind-vectors)) - (format #t "~Tinstance-ptr: ~D~%" (-> obj instance-ptr)) - (format #t "~Tchain-ptr: ~D~%" (-> obj chain-ptr)) - (format #t "~Tchain-ptr-next: ~D~%" (-> obj chain-ptr-next)) - (format #t "~Tstack-ptr: ~D~%" (-> obj stack-ptr)) - (format #t "~Tbucket-ptr: ~D~%" (-> obj bucket-ptr)) - (format #t "~Tsrc-ptr: ~D~%" (-> obj src-ptr)) - (format #t "~Tto-spr: ~D~%" (-> obj to-spr)) - (format #t "~Tfrom-spr: ~D~%" (-> obj from-spr)) - (format #t "~Tshrub-count: ~D~%" (-> obj shrub-count)) - (format #t "~Tstack-ptr: ~D~%" (-> obj stack-ptr)) - (format #t "~Tnode[6] @ #x~X~%" (-> obj node)) - (format #t "~Tlength[6] @ #x~X~%" (-> obj length)) - (format #t "~Tprototypes: ~D~%" (-> obj prototypes)) - (format #t "~Tbucket-ptr: ~D~%" (-> obj bucket-ptr)) - (format #t "~Tstart-bank[20] @ #x~X~%" (-> obj start-bank)) - (format #t "~Tbuffer-index: ~D~%" (-> obj buffer-index)) - (format #t "~Tcurrent-spr: ~D~%" (-> obj current-spr)) - (format #t "~Tcurrent-mem: ~D~%" (-> obj current-mem)) - (format #t "~Tcurrent-shrub-near-packet: ~D~%" (-> obj current-shrub-near-packet)) - (format #t "~Tto-spr: ~D~%" (-> obj to-spr)) - (format #t "~Tdma-buffer: ~A~%" (-> obj dma-buffer)) - (format #t "~Tnear-last: ~D~%" (-> obj near-last)) - (format #t "~Tnear-next: ~D~%" (-> obj near-next)) - (format #t "~Tnear-count: ~D~%" (-> obj near-count)) - (format #t "~Tlast-shrubs: ~D~%" (-> obj last-shrubs)) - (format #t "~Tchains: ~D~%" (-> obj chains)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tpaused: ~A~%" (-> obj paused)) - (format #t "~Tnode-count: ~D~%" (-> obj node-count)) - (format #t "~Tinst-count: ~D~%" (-> obj inst-count)) - (format #t "~Twait-from-spr: ~D~%" (-> obj wait-from-spr)) - (format #t "~Twait-to-spr: ~D~%" (-> obj wait-to-spr)) - obj +(defmethod inspect instance-shrub-work ((this instance-shrub-work)) + (format #t "[~8x] ~A~%" this 'instance-shrub-work) + (format #t "~Tdummy[3] @ #x~X~%" (-> this dummy)) + (format #t "~Tchaina[8] @ #x~X~%" (-> this chaina)) + (format #t "~Tchainb[8] @ #x~X~%" (-> this chainb)) + (format #t "~Tcolors[1024] @ #x~X~%" (-> this colors)) + (format #t "~Tmatrix-tmpl[20] @ #x~X~%" (-> this matrix-tmpl)) + (format #t "~Tcount-tmpl[20] @ #x~X~%" (-> this count-tmpl)) + (format #t "~Tmscalf-tmpl: #~%" (-> this mscalf-tmpl)) + (format #t "~Tmscalf-ret-tmpl: #~%" (-> this mscalf-ret-tmpl)) + (format #t "~Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~Tbillboard-tmpl: #~%" (-> this billboard-tmpl)) + (format #t "~Tbillboard-const: #~%" (-> this billboard-const)) + (format #t "~Tshrub-near-packets[6] @ #x~X~%" (-> this shrub-near-packets)) + (format #t "~Tdma-ref: #~%" (-> this dma-ref)) + (format #t "~Tdma-end: #~%" (-> this dma-end)) + (format #t "~Twind-const: #~%" (-> this wind-const)) + (format #t "~Tconstants: #~%" (-> this constants)) + (format #t "~Tcolor-constant: #~%" (-> this color-constant)) + (format #t "~Thmge-d: #~%" (-> this hmge-d)) + (format #t "~Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~Twind-force: #~%" (-> this wind-force)) + (format #t "~Tcolor: #~%" (-> this color)) + (format #t "~Tbb-color: #~%" (-> this bb-color)) + (format #t "~Tmin-dist: #~%" (-> this min-dist)) + (format #t "~Ttemp-vec: #~%" (-> this temp-vec)) + (format #t "~Tguard-plane[4] @ #x~X~%" (-> this guard-plane)) + (format #t "~Tplane[4] @ #x~X~%" (-> this plane)) + (format #t "~Tlast[4] @ #x~X~%" (-> this last)) + (format #t "~Tnext[4] @ #x~X~%" (-> this next)) + (format #t "~Tcount[4] @ #x~X~%" (-> this count)) + (format #t "~Tmod-count[4] @ #x~X~%" (-> this mod-count)) + (format #t "~Twind-vectors: #x~X~%" (-> this wind-vectors)) + (format #t "~Tinstance-ptr: ~D~%" (-> this instance-ptr)) + (format #t "~Tchain-ptr: ~D~%" (-> this chain-ptr)) + (format #t "~Tchain-ptr-next: ~D~%" (-> this chain-ptr-next)) + (format #t "~Tstack-ptr: ~D~%" (-> this stack-ptr)) + (format #t "~Tbucket-ptr: ~D~%" (-> this bucket-ptr)) + (format #t "~Tsrc-ptr: ~D~%" (-> this src-ptr)) + (format #t "~Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~Tfrom-spr: ~D~%" (-> this from-spr)) + (format #t "~Tshrub-count: ~D~%" (-> this shrub-count)) + (format #t "~Tstack-ptr: ~D~%" (-> this stack-ptr)) + (format #t "~Tnode[6] @ #x~X~%" (-> this node)) + (format #t "~Tlength[6] @ #x~X~%" (-> this length)) + (format #t "~Tprototypes: ~D~%" (-> this prototypes)) + (format #t "~Tbucket-ptr: ~D~%" (-> this bucket-ptr)) + (format #t "~Tstart-bank[20] @ #x~X~%" (-> this start-bank)) + (format #t "~Tbuffer-index: ~D~%" (-> this buffer-index)) + (format #t "~Tcurrent-spr: ~D~%" (-> this current-spr)) + (format #t "~Tcurrent-mem: ~D~%" (-> this current-mem)) + (format #t "~Tcurrent-shrub-near-packet: ~D~%" (-> this current-shrub-near-packet)) + (format #t "~Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~Tnear-last: ~D~%" (-> this near-last)) + (format #t "~Tnear-next: ~D~%" (-> this near-next)) + (format #t "~Tnear-count: ~D~%" (-> this near-count)) + (format #t "~Tlast-shrubs: ~D~%" (-> this last-shrubs)) + (format #t "~Tchains: ~D~%" (-> this chains)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tpaused: ~A~%" (-> this paused)) + (format #t "~Tnode-count: ~D~%" (-> this node-count)) + (format #t "~Tinst-count: ~D~%" (-> this inst-count)) + (format #t "~Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~Twait-to-spr: ~D~%" (-> this wait-to-spr)) + this ) ;; definition of type instance-shrub-dma @@ -436,13 +436,13 @@ ) ;; definition for method 3 of type instance-shrub-dma -(defmethod inspect instance-shrub-dma ((obj instance-shrub-dma)) - (format #t "[~8x] ~A~%" obj 'instance-shrub-dma) - (format #t "~Tinstancea[325] @ #x~X~%" (-> obj instancea)) - (format #t "~Tinstanceb[325] @ #x~X~%" (-> obj instanceb)) - (format #t "~Touta[128] @ #x~X~%" (-> obj outa)) - (format #t "~Toutb[128] @ #x~X~%" (-> obj outb)) - obj +(defmethod inspect instance-shrub-dma ((this instance-shrub-dma)) + (format #t "[~8x] ~A~%" this 'instance-shrub-dma) + (format #t "~Tinstancea[325] @ #x~X~%" (-> this instancea)) + (format #t "~Tinstanceb[325] @ #x~X~%" (-> this instanceb)) + (format #t "~Touta[128] @ #x~X~%" (-> this outa)) + (format #t "~Toutb[128] @ #x~X~%" (-> this outb)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/sky/sky-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sky/sky-h_REF.gc index 1759a61288..0eff26d5c5 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sky/sky-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sky/sky-h_REF.gc @@ -14,13 +14,13 @@ ) ;; definition for method 3 of type sky-color-hour -(defmethod inspect sky-color-hour ((obj sky-color-hour)) - (format #t "[~8x] ~A~%" obj 'sky-color-hour) - (format #t "~Tsnapshot1: ~D~%" (-> obj snapshot1)) - (format #t "~Tsnapshot2: ~D~%" (-> obj snapshot2)) - (format #t "~Tmorph-start: ~f~%" (-> obj morph-start)) - (format #t "~Tmorph-end: ~f~%" (-> obj morph-end)) - obj +(defmethod inspect sky-color-hour ((this sky-color-hour)) + (format #t "[~8x] ~A~%" this 'sky-color-hour) + (format #t "~Tsnapshot1: ~D~%" (-> this snapshot1)) + (format #t "~Tsnapshot2: ~D~%" (-> this snapshot2)) + (format #t "~Tmorph-start: ~f~%" (-> this morph-start)) + (format #t "~Tmorph-end: ~f~%" (-> this morph-end)) + this ) ;; definition of type sky-color-day @@ -33,10 +33,10 @@ ) ;; definition for method 3 of type sky-color-day -(defmethod inspect sky-color-day ((obj sky-color-day)) - (format #t "[~8x] ~A~%" obj 'sky-color-day) - (format #t "~Thour[24] @ #x~X~%" (-> obj hour)) - obj +(defmethod inspect sky-color-day ((this sky-color-day)) + (format #t "[~8x] ~A~%" this 'sky-color-day) + (format #t "~Thour[24] @ #x~X~%" (-> this hour)) + this ) ;; definition of type sky-circle-data @@ -49,10 +49,10 @@ ) ;; definition for method 3 of type sky-circle-data -(defmethod inspect sky-circle-data ((obj sky-circle-data)) - (format #t "[~8x] ~A~%" obj 'sky-circle-data) - (format #t "~Tdata[17] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect sky-circle-data ((this sky-circle-data)) + (format #t "[~8x] ~A~%" this 'sky-circle-data) + (format #t "~Tdata[17] @ #x~X~%" (-> this data)) + this ) ;; definition of type sky-sun-data @@ -75,20 +75,20 @@ ) ;; definition for method 3 of type sky-sun-data -(defmethod inspect sky-sun-data ((obj sky-sun-data)) - (format #t "[~8x] ~A~%" obj 'sky-sun-data) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~Tpos: #~%" (-> obj data)) - (format #t "~Tr-sun: ~f~%" (-> obj r-sun)) - (format #t "~Tr-halo: ~f~%" (-> obj r-halo)) - (format #t "~Tr-aurora: ~f~%" (-> obj r-aurora)) - (format #t "~Tc-sun-start: ~D~%" (-> obj c-sun-start)) - (format #t "~Tc-sun-end: ~D~%" (-> obj c-sun-end)) - (format #t "~Tc-halo-start: ~D~%" (-> obj c-halo-start)) - (format #t "~Tc-halo-end: ~D~%" (-> obj c-halo-end)) - (format #t "~Tc-aurora-start: ~D~%" (-> obj c-aurora-start)) - (format #t "~Tc-aurora-end: ~D~%" (-> obj c-aurora-end)) - obj +(defmethod inspect sky-sun-data ((this sky-sun-data)) + (format #t "[~8x] ~A~%" this 'sky-sun-data) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~Tpos: #~%" (-> this data)) + (format #t "~Tr-sun: ~f~%" (-> this r-sun)) + (format #t "~Tr-halo: ~f~%" (-> this r-halo)) + (format #t "~Tr-aurora: ~f~%" (-> this r-aurora)) + (format #t "~Tc-sun-start: ~D~%" (-> this c-sun-start)) + (format #t "~Tc-sun-end: ~D~%" (-> this c-sun-end)) + (format #t "~Tc-halo-start: ~D~%" (-> this c-halo-start)) + (format #t "~Tc-halo-end: ~D~%" (-> this c-halo-end)) + (format #t "~Tc-aurora-start: ~D~%" (-> this c-aurora-start)) + (format #t "~Tc-aurora-end: ~D~%" (-> this c-aurora-end)) + this ) ;; definition of type sky-moon-data @@ -103,12 +103,12 @@ ) ;; definition for method 3 of type sky-moon-data -(defmethod inspect sky-moon-data ((obj sky-moon-data)) - (format #t "[~8x] ~A~%" obj 'sky-moon-data) - (format #t "~Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~Tpos: #~%" (-> obj data)) - (format #t "~Tscale: #~%" (-> obj scale)) - obj +(defmethod inspect sky-moon-data ((this sky-moon-data)) + (format #t "[~8x] ~A~%" this 'sky-moon-data) + (format #t "~Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~Tpos: #~%" (-> this data)) + (format #t "~Tscale: #~%" (-> this scale)) + this ) ;; definition of type sky-orbit @@ -127,15 +127,15 @@ ) ;; definition for method 3 of type sky-orbit -(defmethod inspect sky-orbit ((obj sky-orbit)) - (format #t "[~8x] ~A~%" obj 'sky-orbit) - (format #t "~Thigh-noon: ~f~%" (-> obj high-noon)) - (format #t "~Ttilt: ~f~%" (-> obj tilt)) - (format #t "~Trise: ~f~%" (-> obj rise)) - (format #t "~Tdist: ~f~%" (-> obj dist)) - (format #t "~Tmin-halo: ~f~%" (-> obj min-halo)) - (format #t "~Tmax-halo: ~f~%" (-> obj max-halo)) - obj +(defmethod inspect sky-orbit ((this sky-orbit)) + (format #t "[~8x] ~A~%" this 'sky-orbit) + (format #t "~Thigh-noon: ~f~%" (-> this high-noon)) + (format #t "~Ttilt: ~f~%" (-> this tilt)) + (format #t "~Trise: ~f~%" (-> this rise)) + (format #t "~Tdist: ~f~%" (-> this dist)) + (format #t "~Tmin-halo: ~f~%" (-> this min-halo)) + (format #t "~Tmax-halo: ~f~%" (-> this max-halo)) + this ) ;; definition of type sky-upload-data @@ -151,13 +151,13 @@ ) ;; definition for method 3 of type sky-upload-data -(defmethod inspect sky-upload-data ((obj sky-upload-data)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdata[27] @ #x~X~%" (-> obj circle)) - (format #t "~Tcircle: #~%" (-> obj circle)) - (format #t "~Tsun[2] @ #x~X~%" (-> obj sun)) - (format #t "~Tmoon: #~%" (-> obj moon)) - obj +(defmethod inspect sky-upload-data ((this sky-upload-data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdata[27] @ #x~X~%" (-> this circle)) + (format #t "~Tcircle: #~%" (-> this circle)) + (format #t "~Tsun[2] @ #x~X~%" (-> this sun)) + (format #t "~Tmoon: #~%" (-> this moon)) + this ) ;; definition of type sky-parms @@ -178,15 +178,15 @@ ) ;; definition for method 3 of type sky-parms -(defmethod inspect sky-parms ((obj sky-parms)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Torbit[3] @ #x~X~%" (-> obj orbit)) - (format #t "~Tupload-data: #~%" (-> obj upload-data)) - (format #t "~Tsun-lights: #~%" (-> obj sun-lights)) - (format #t "~Tmoon-lights: #~%" (-> obj moon-lights)) - (format #t "~Tdefault-lights: #~%" (-> obj default-lights)) - (format #t "~Tdefault-vu-lights: #~%" (-> obj default-vu-lights)) - obj +(defmethod inspect sky-parms ((this sky-parms)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Torbit[3] @ #x~X~%" (-> this orbit)) + (format #t "~Tupload-data: #~%" (-> this upload-data)) + (format #t "~Tsun-lights: #~%" (-> this sun-lights)) + (format #t "~Tmoon-lights: #~%" (-> this moon-lights)) + (format #t "~Tdefault-lights: #~%" (-> this default-lights)) + (format #t "~Tdefault-vu-lights: #~%" (-> this default-vu-lights)) + this ) ;; definition for method 0 of type sky-parms @@ -232,19 +232,19 @@ ) ;; definition for method 3 of type sky-tng-data -(defmethod inspect sky-tng-data ((obj sky-tng-data)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tgiftag-base: #~%" (-> obj giftag-base)) - (format #t "~Tgiftag-roof: #~%" (-> obj giftag-roof)) - (format #t "~Tgiftag-ocean: #~%" (-> obj giftag-ocean)) - (format #t "~Tfog: #~%" (-> obj fog)) - (format #t "~Tsky[8] @ #x~X~%" (-> obj sky)) - (format #t "~Ttime: ~f~%" (-> obj time)) - (format #t "~Toff-s-0: ~D~%" (-> obj off-s-0)) - (format #t "~Toff-t-0: ~D~%" (-> obj off-t-0)) - (format #t "~Toff-s-1: ~D~%" (-> obj off-s-1)) - (format #t "~Toff-t-1: ~D~%" (-> obj off-t-1)) - obj +(defmethod inspect sky-tng-data ((this sky-tng-data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tgiftag-base: #~%" (-> this giftag-base)) + (format #t "~Tgiftag-roof: #~%" (-> this giftag-roof)) + (format #t "~Tgiftag-ocean: #~%" (-> this giftag-ocean)) + (format #t "~Tfog: #~%" (-> this fog)) + (format #t "~Tsky[8] @ #x~X~%" (-> this sky)) + (format #t "~Ttime: ~f~%" (-> this time)) + (format #t "~Toff-s-0: ~D~%" (-> this off-s-0)) + (format #t "~Toff-t-0: ~D~%" (-> this off-t-0)) + (format #t "~Toff-s-1: ~D~%" (-> this off-s-1)) + (format #t "~Toff-t-1: ~D~%" (-> this off-t-1)) + this ) ;; definition of type sky-work @@ -261,14 +261,14 @@ ) ;; definition for method 3 of type sky-work -(defmethod inspect sky-work ((obj sky-work)) - (format #t "[~8x] ~A~%" obj 'sky-work) - (format #t "~Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~Tdraw-tmpl: #~%" (-> obj draw-tmpl)) - (format #t "~Tblend-tmpl: #~%" (-> obj blend-tmpl)) - (format #t "~Tsky-data[5] @ #x~X~%" (-> obj sky-data)) - (format #t "~Tcloud-data[5] @ #x~X~%" (-> obj cloud-data)) - obj +(defmethod inspect sky-work ((this sky-work)) + (format #t "[~8x] ~A~%" this 'sky-work) + (format #t "~Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~Tdraw-tmpl: #~%" (-> this draw-tmpl)) + (format #t "~Tblend-tmpl: #~%" (-> this blend-tmpl)) + (format #t "~Tsky-data[5] @ #x~X~%" (-> this sky-data)) + (format #t "~Tcloud-data[5] @ #x~X~%" (-> this cloud-data)) + this ) ;; definition of type sky-vertex @@ -283,13 +283,12 @@ ) ;; definition for method 3 of type sky-vertex -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sky-vertex ((obj sky-vertex)) - (format #t "[~8x] ~A~%" obj 'sky-vertex) - (format #t "~Tpos: #~%" (-> obj pos)) - (format #t "~Tstq: #~%" (-> obj stq)) - (format #t "~Tcol: #~%" (-> obj col)) - obj +(defmethod inspect sky-vertex ((this sky-vertex)) + (format #t "[~8x] ~A~%" this 'sky-vertex) + (format #t "~Tpos: #~%" (-> this pos)) + (format #t "~Tstq: #~%" (-> this stq)) + (format #t "~Tcol: #~%" (-> this col)) + this ) ;; definition for symbol *sky-drawn*, type symbol diff --git a/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc index 76c50bb6b0..0bb7a3446a 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sky/sky-tng_REF.gc @@ -123,13 +123,12 @@ (init-sky-tng-data *sky-tng-data*) ;; definition for method 3 of type sky-vertex -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sky-vertex ((obj sky-vertex)) - (format #t "sky-vertex [~X]:~%" obj) - (format #t "~TPos: [~F ~F ~F ~F]~%" (-> obj pos x) (-> obj pos y) (-> obj pos z) (-> obj pos w)) - (format #t "~TSTQ: [~F ~F ~F ~F]~%" (-> obj stq x) (-> obj stq y) (-> obj stq z) (-> obj stq w)) - (format #t "~TCol: [~F ~F ~F ~F]~%" (-> obj col x) (-> obj col y) (-> obj col z) (-> obj col w)) - obj +(defmethod inspect sky-vertex ((this sky-vertex)) + (format #t "sky-vertex [~X]:~%" this) + (format #t "~TPos: [~F ~F ~F ~F]~%" (-> this pos x) (-> this pos y) (-> this pos z) (-> this pos w)) + (format #t "~TSTQ: [~F ~F ~F ~F]~%" (-> this stq x) (-> this stq y) (-> this stq z) (-> this stq w)) + (format #t "~TCol: [~F ~F ~F ~F]~%" (-> this col x) (-> this col y) (-> this col z) (-> this col w)) + this ) ;; definition for function update-sky-tng-data diff --git a/test/decompiler/reference/jak1/engine/gfx/sky/sky_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sky/sky_REF.gc index 5cbbdd81b3..93ca413333 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sky/sky_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sky/sky_REF.gc @@ -105,24 +105,24 @@ ) ;; definition for method 3 of type sky-frame-data -(defmethod inspect sky-frame-data ((obj sky-frame-data)) - (format #t "[~8x] ~A~%" obj 'sky-frame-data) - (format #t "~Tdata[18] @ #x~X~%" (-> obj data)) - (format #t "~Tworld-homo-matrix: #~%" (-> obj data)) - (format #t "~Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~Tconsts: #~%" (-> obj consts)) - (format #t "~Tpfog0: ~f~%" (-> obj consts x)) - (format #t "~Tradius: ~f~%" (-> obj consts y)) - (format #t "~Tnokick: ~f~%" (-> obj consts w)) - (format #t "~Tstrip-giftag: #~%" (-> obj strip-giftag)) - (format #t "~Tcol-adgif: #~%" (-> obj col-adgif)) - (format #t "~Tsave[5] @ #x~X~%" (-> obj save)) - (format #t "~Tsun-fan-giftag: #~%" (-> obj sun-fan-giftag)) - (format #t "~Tsun-strip-giftag: #~%" (-> obj sun-strip-giftag)) - (format #t "~Tsun-alpha: #~%" (-> obj sun-alpha)) - (format #t "~Tsun-alpha-giftag: #~%" (-> obj sun-alpha-giftag)) - obj +(defmethod inspect sky-frame-data ((this sky-frame-data)) + (format #t "[~8x] ~A~%" this 'sky-frame-data) + (format #t "~Tdata[18] @ #x~X~%" (-> this data)) + (format #t "~Tworld-homo-matrix: #~%" (-> this data)) + (format #t "~Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~Tconsts: #~%" (-> this consts)) + (format #t "~Tpfog0: ~f~%" (-> this consts x)) + (format #t "~Tradius: ~f~%" (-> this consts y)) + (format #t "~Tnokick: ~f~%" (-> this consts w)) + (format #t "~Tstrip-giftag: #~%" (-> this strip-giftag)) + (format #t "~Tcol-adgif: #~%" (-> this col-adgif)) + (format #t "~Tsave[5] @ #x~X~%" (-> this save)) + (format #t "~Tsun-fan-giftag: #~%" (-> this sun-fan-giftag)) + (format #t "~Tsun-strip-giftag: #~%" (-> this sun-strip-giftag)) + (format #t "~Tsun-alpha: #~%" (-> this sun-alpha)) + (format #t "~Tsun-alpha-giftag: #~%" (-> this sun-alpha-giftag)) + this ) ;; definition for symbol sky-vu1-block, type vu-function diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-h_REF.gc index ba52b20a4a..f792a70081 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-h_REF.gc @@ -50,40 +50,40 @@ ) ;; definition for method 3 of type sparticle-cpuinfo -(defmethod inspect sparticle-cpuinfo ((obj sparticle-cpuinfo)) - (format #t "[~8x] ~A~%" obj 'sparticle-cpuinfo) - (format #t "~Tsprite: #~%" (-> obj sprite)) - (format #t "~Tadgif: #~%" (-> obj adgif)) - (format #t "~Tradius: ~f~%" (-> obj radius)) - (format #t "~Tomega: ~f~%" (-> obj omega)) - (format #t "~Tvel-sxvel: #~%" (-> obj vel-sxvel)) - (format #t "~Trot-syvel: #~%" (-> obj rot-syvel)) - (format #t "~Tfade: #~%" (-> obj fade)) - (format #t "~Tacc: #~%" (-> obj acc)) - (format #t "~Trotvel3d: #~%" (-> obj rotvel3d)) - (format #t "~Tvel: #~%" (-> obj vel-sxvel)) - (format #t "~Taccel: #~%" (-> obj acc)) - (format #t "~Tscalevelx: ~f~%" (-> obj vel-sxvel w)) - (format #t "~Tscalevely: ~f~%" (-> obj rot-syvel w)) - (format #t "~Tfriction: ~f~%" (-> obj friction)) - (format #t "~Ttimer: ~D~%" (-> obj timer)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tuser-int32: ~D~%" (-> obj user-float)) - (format #t "~Tuser-uint32: ~D~%" (-> obj user-float)) - (format #t "~Tuser-float: ~f~%" (the-as float (-> obj user-float))) - (format #t "~Tuser-pntr: #x~X~%" (-> obj user-float)) - (format #t "~Tuser-sprite: #~%" (-> obj user-float)) - (format #t "~Tfunc: ~A~%" (-> obj func)) - (format #t "~Tnext-time: ~D~%" (-> obj next-time)) - (format #t "~Tnext-launcher: ~A~%" (-> obj next-launcher)) - (format #t "~Tcache-alpha: ~f~%" (-> obj cache-alpha)) - (format #t "~Tvalid: ~A~%" (-> obj valid)) - (format #t "~Tkey: ~A~%" (-> obj key)) - (format #t "~Tbinding: #~%" (-> obj binding)) - (format #t "~Tdata[1] @ #x~X~%" (&-> obj omega)) - (format #t "~Tdataf[1] @ #x~X~%" (&-> obj omega)) - (format #t "~Tdatac[1] @ #x~X~%" (&-> obj omega)) - obj +(defmethod inspect sparticle-cpuinfo ((this sparticle-cpuinfo)) + (format #t "[~8x] ~A~%" this 'sparticle-cpuinfo) + (format #t "~Tsprite: #~%" (-> this sprite)) + (format #t "~Tadgif: #~%" (-> this adgif)) + (format #t "~Tradius: ~f~%" (-> this radius)) + (format #t "~Tomega: ~f~%" (-> this omega)) + (format #t "~Tvel-sxvel: #~%" (-> this vel-sxvel)) + (format #t "~Trot-syvel: #~%" (-> this rot-syvel)) + (format #t "~Tfade: #~%" (-> this fade)) + (format #t "~Tacc: #~%" (-> this acc)) + (format #t "~Trotvel3d: #~%" (-> this rotvel3d)) + (format #t "~Tvel: #~%" (-> this vel-sxvel)) + (format #t "~Taccel: #~%" (-> this acc)) + (format #t "~Tscalevelx: ~f~%" (-> this vel-sxvel w)) + (format #t "~Tscalevely: ~f~%" (-> this rot-syvel w)) + (format #t "~Tfriction: ~f~%" (-> this friction)) + (format #t "~Ttimer: ~D~%" (-> this timer)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tuser-int32: ~D~%" (-> this user-float)) + (format #t "~Tuser-uint32: ~D~%" (-> this user-float)) + (format #t "~Tuser-float: ~f~%" (the-as float (-> this user-float))) + (format #t "~Tuser-pntr: #x~X~%" (-> this user-float)) + (format #t "~Tuser-sprite: #~%" (-> this user-float)) + (format #t "~Tfunc: ~A~%" (-> this func)) + (format #t "~Tnext-time: ~D~%" (-> this next-time)) + (format #t "~Tnext-launcher: ~A~%" (-> this next-launcher)) + (format #t "~Tcache-alpha: ~f~%" (-> this cache-alpha)) + (format #t "~Tvalid: ~A~%" (-> this valid)) + (format #t "~Tkey: ~A~%" (-> this key)) + (format #t "~Tbinding: #~%" (-> this binding)) + (format #t "~Tdata[1] @ #x~X~%" (&-> this omega)) + (format #t "~Tdataf[1] @ #x~X~%" (&-> this omega)) + (format #t "~Tdatac[1] @ #x~X~%" (&-> this omega)) + this ) ;; definition of type sparticle-launchinfo @@ -100,14 +100,14 @@ ) ;; definition for method 3 of type sparticle-launchinfo -(defmethod inspect sparticle-launchinfo ((obj sparticle-launchinfo)) - (format #t "[~8x] ~A~%" obj 'sparticle-launchinfo) - (format #t "~Tlaunchrot: #~%" (-> obj launchrot)) - (format #t "~Tconerot: #~%" (-> obj conerot)) - (format #t "~Tconeradius: ~f~%" (-> obj coneradius)) - (format #t "~Trotate-y: ~f~%" (-> obj rotate-y)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj launchrot)) - obj +(defmethod inspect sparticle-launchinfo ((this sparticle-launchinfo)) + (format #t "[~8x] ~A~%" this 'sparticle-launchinfo) + (format #t "~Tlaunchrot: #~%" (-> this launchrot)) + (format #t "~Tconerot: #~%" (-> this conerot)) + (format #t "~Tconeradius: ~f~%" (-> this coneradius)) + (format #t "~Trotate-y: ~f~%" (-> this rotate-y)) + (format #t "~Tdata[1] @ #x~X~%" (-> this launchrot)) + this ) ;; definition of type sparticle-system @@ -131,23 +131,19 @@ ) ;; definition for method 3 of type sparticle-system -(defmethod inspect sparticle-system ((obj sparticle-system)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tblocks[2] @ #x~X~%" (-> obj blocks)) - (format #t "~Tlength[2] @ #x~X~%" (-> obj length)) - (format #t "~Tnum-alloc[2] @ #x~X~%" (-> obj num-alloc)) - (format #t "~Tis-3d: ~A~%" (-> obj is-3d)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Talloc-table: #x~X~%" (-> obj alloc-table)) - (format #t "~Tcpuinfo-table: #x~X~%" (-> obj cpuinfo-table)) - (format #t "~Tvecdata-table: #x~X~%" (-> obj vecdata-table)) - (format #t "~Tadgifdata-table: #x~X~%" (-> obj adgifdata-table)) - obj +(defmethod inspect sparticle-system ((this sparticle-system)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tblocks[2] @ #x~X~%" (-> this blocks)) + (format #t "~Tlength[2] @ #x~X~%" (-> this length)) + (format #t "~Tnum-alloc[2] @ #x~X~%" (-> this num-alloc)) + (format #t "~Tis-3d: ~A~%" (-> this is-3d)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Talloc-table: #x~X~%" (-> this alloc-table)) + (format #t "~Tcpuinfo-table: #x~X~%" (-> this cpuinfo-table)) + (format #t "~Tvecdata-table: #x~X~%" (-> this vecdata-table)) + (format #t "~Tadgifdata-table: #x~X~%" (-> this adgifdata-table)) + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h_REF.gc index ea028ffc13..11da02f884 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher-h_REF.gc @@ -23,22 +23,22 @@ ) ;; definition for method 3 of type sp-field-init-spec -(defmethod inspect sp-field-init-spec ((obj sp-field-init-spec)) - (format #t "[~8x] ~A~%" obj 'sp-field-init-spec) - (format #t "~Tfield: ~D~%" (-> obj field)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tinitial-valuef: ~f~%" (-> obj initial-valuef)) - (format #t "~Trandom-rangef: ~f~%" (-> obj random-rangef)) - (format #t "~Trandom-multf: ~f~%" (-> obj random-multf)) - (format #t "~Tinitial-value: ~D~%" (-> obj initial-valuef)) - (format #t "~Trandom-range: ~D~%" (-> obj random-rangef)) - (format #t "~Trandom-mult: ~D~%" (-> obj random-multf)) - (format #t "~Tfunc: ~A~%" (-> obj initial-valuef)) - (format #t "~Ttex: ~D~%" (-> obj initial-valuef)) - (format #t "~Tpntr: #x~X~%" (-> obj initial-valuef)) - (format #t "~Tsym: ~A~%" (-> obj initial-valuef)) - (format #t "~Tsound: ~A~%" (-> obj initial-valuef)) - obj +(defmethod inspect sp-field-init-spec ((this sp-field-init-spec)) + (format #t "[~8x] ~A~%" this 'sp-field-init-spec) + (format #t "~Tfield: ~D~%" (-> this field)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tinitial-valuef: ~f~%" (-> this initial-valuef)) + (format #t "~Trandom-rangef: ~f~%" (-> this random-rangef)) + (format #t "~Trandom-multf: ~f~%" (-> this random-multf)) + (format #t "~Tinitial-value: ~D~%" (-> this initial-valuef)) + (format #t "~Trandom-range: ~D~%" (-> this random-rangef)) + (format #t "~Trandom-mult: ~D~%" (-> this random-multf)) + (format #t "~Tfunc: ~A~%" (-> this initial-valuef)) + (format #t "~Ttex: ~D~%" (-> this initial-valuef)) + (format #t "~Tpntr: #x~X~%" (-> this initial-valuef)) + (format #t "~Tsym: ~A~%" (-> this initial-valuef)) + (format #t "~Tsound: ~A~%" (-> this initial-valuef)) + this ) ;; definition of type sparticle-launcher @@ -53,13 +53,12 @@ ) ;; definition for method 3 of type sparticle-launcher -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sparticle-launcher ((obj sparticle-launcher)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tbirthaccum: ~f~%" (-> obj birthaccum)) - (format #t "~Tsoundaccum: ~f~%" (-> obj soundaccum)) - (format #t "~Tinit-specs: #x~X~%" (-> obj init-specs)) - obj +(defmethod inspect sparticle-launcher ((this sparticle-launcher)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tbirthaccum: ~f~%" (-> this birthaccum)) + (format #t "~Tsoundaccum: ~f~%" (-> this soundaccum)) + (format #t "~Tinit-specs: #x~X~%" (-> this init-specs)) + this ) ;; definition of type sparticle-group-item @@ -80,18 +79,18 @@ ) ;; definition for method 3 of type sparticle-group-item -(defmethod inspect sparticle-group-item ((obj sparticle-group-item)) - (format #t "[~8x] ~A~%" obj 'sparticle-group-item) - (format #t "~Tlauncher: ~D~%" (-> obj launcher)) - (format #t "~Tfade-after: (meters ~m)~%" (-> obj fade-after)) - (format #t "~Tfalloff-to: (meters ~m)~%" (-> obj falloff-to)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tperiod: ~D~%" (-> obj period)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Toffset: ~D~%" (-> obj offset)) - (format #t "~Thour-mask: ~D~%" (-> obj hour-mask)) - (format #t "~Tbinding: ~D~%" (-> obj binding)) - obj +(defmethod inspect sparticle-group-item ((this sparticle-group-item)) + (format #t "[~8x] ~A~%" this 'sparticle-group-item) + (format #t "~Tlauncher: ~D~%" (-> this launcher)) + (format #t "~Tfade-after: (meters ~m)~%" (-> this fade-after)) + (format #t "~Tfalloff-to: (meters ~m)~%" (-> this falloff-to)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tperiod: ~D~%" (-> this period)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Toffset: ~D~%" (-> this offset)) + (format #t "~Thour-mask: ~D~%" (-> this hour-mask)) + (format #t "~Tbinding: ~D~%" (-> this binding)) + this ) ;; definition of type sparticle-launch-state @@ -117,23 +116,23 @@ ) ;; definition for method 3 of type sparticle-launch-state -(defmethod inspect sparticle-launch-state ((obj sparticle-launch-state)) - (format #t "[~8x] ~A~%" obj 'sparticle-launch-state) - (format #t "~Tgroup-item: #~%" (-> obj group-item)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Trandomize: ~D~%" (-> obj randomize)) - (format #t "~Torigin: #~%" (-> obj origin)) - (format #t "~Tsprite3d: #~%" (-> obj sprite3d)) - (format #t "~Tsprite: ~A~%" (-> obj sprite)) - (format #t "~Toffset: ~D~%" (-> obj offset)) - (format #t "~Taccum: ~f~%" (-> obj accum)) - (format #t "~Tspawn-time: ~D~%" (-> obj spawn-time)) - (format #t "~Tswarm: ~A~%" (-> obj offset)) - (format #t "~Tseed: ~D~%" (-> obj accum)) - (format #t "~Ttime: ~D~%" (-> obj spawn-time)) - (format #t "~Tspec: ~A~%" (-> obj sprite)) - (format #t "~Tid: ~D~%" (-> obj sprite3d)) - obj +(defmethod inspect sparticle-launch-state ((this sparticle-launch-state)) + (format #t "[~8x] ~A~%" this 'sparticle-launch-state) + (format #t "~Tgroup-item: #~%" (-> this group-item)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Trandomize: ~D~%" (-> this randomize)) + (format #t "~Torigin: #~%" (-> this origin)) + (format #t "~Tsprite3d: #~%" (-> this sprite3d)) + (format #t "~Tsprite: ~A~%" (-> this sprite)) + (format #t "~Toffset: ~D~%" (-> this offset)) + (format #t "~Taccum: ~f~%" (-> this accum)) + (format #t "~Tspawn-time: ~D~%" (-> this spawn-time)) + (format #t "~Tswarm: ~A~%" (-> this offset)) + (format #t "~Tseed: ~D~%" (-> this accum)) + (format #t "~Ttime: ~D~%" (-> this spawn-time)) + (format #t "~Tspec: ~A~%" (-> this sprite)) + (format #t "~Tid: ~D~%" (-> this sprite3d)) + this ) ;; definition of type sparticle-launch-group @@ -155,16 +154,16 @@ ) ;; definition for method 3 of type sparticle-launch-group -(defmethod inspect sparticle-launch-group ((obj sparticle-launch-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tduration: ~D~%" (-> obj duration)) - (format #t "~Tlinger-duration: ~D~%" (-> obj linger-duration)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tlauncher: #x~X~%" (-> obj launcher)) - (format #t "~Tbounds: #~%" (-> obj bounds)) - obj +(defmethod inspect sparticle-launch-group ((this sparticle-launch-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tduration: ~D~%" (-> this duration)) + (format #t "~Tlinger-duration: ~D~%" (-> this linger-duration)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tlauncher: #x~X~%" (-> this launcher)) + (format #t "~Tbounds: #~%" (-> this bounds)) + this ) ;; definition of type sparticle-launch-control @@ -192,20 +191,20 @@ ) ;; definition for method 3 of type sparticle-launch-control -(defmethod inspect sparticle-launch-control ((obj sparticle-launch-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tgroup: ~A~%" (-> obj group)) - (format #t "~Tproc: ~A~%" (-> obj proc)) - (format #t "~Tlocal-clock: ~D~%" (-> obj local-clock)) - (format #t "~Tfade: ~f~%" (-> obj fade)) - (format #t "~Tmatrix: ~D~%" (-> obj matrix)) - (format #t "~Tlast-spawn-frame: ~D~%" (-> obj last-spawn-frame)) - (format #t "~Tlast-spawn-time: ~D~%" (-> obj last-spawn-time)) - (format #t "~Tcenter: ~`vector`P~%" (-> obj center)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect sparticle-launch-control ((this sparticle-launch-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tgroup: ~A~%" (-> this group)) + (format #t "~Tproc: ~A~%" (-> this proc)) + (format #t "~Tlocal-clock: ~D~%" (-> this local-clock)) + (format #t "~Tfade: ~f~%" (-> this fade)) + (format #t "~Tmatrix: ~D~%" (-> this matrix)) + (format #t "~Tlast-spawn-frame: ~D~%" (-> this last-spawn-frame)) + (format #t "~Tlast-spawn-time: ~D~%" (-> this last-spawn-time)) + (format #t "~Tcenter: ~`vector`P~%" (-> this center)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher_REF.gc index 66cb3fcadd..578b047063 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle-launcher_REF.gc @@ -22,27 +22,27 @@ ) ;; definition for method 3 of type sparticle-birthinfo -(defmethod inspect sparticle-birthinfo ((obj sparticle-birthinfo)) - (format #t "[~8x] ~A~%" obj 'sparticle-birthinfo) - (format #t "~Tsprite: ~D~%" (-> obj sprite)) - (format #t "~Tanim: ~D~%" (-> obj anim)) - (format #t "~Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~Tbirth-func: ~A~%" (-> obj birth-func)) - (format #t "~Tjoint-ppoint: ~D~%" (-> obj joint-ppoint)) - (format #t "~Tnum-to-birth: ~f~%" (-> obj num-to-birth)) - (format #t "~Tsound: ~A~%" (-> obj sound)) - (format #t "~Tdataf[1] @ #x~X~%" (&-> obj sprite)) - (format #t "~Tdata[1] @ #x~X~%" (&-> obj sprite)) - obj +(defmethod inspect sparticle-birthinfo ((this sparticle-birthinfo)) + (format #t "[~8x] ~A~%" this 'sparticle-birthinfo) + (format #t "~Tsprite: ~D~%" (-> this sprite)) + (format #t "~Tanim: ~D~%" (-> this anim)) + (format #t "~Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~Tbirth-func: ~A~%" (-> this birth-func)) + (format #t "~Tjoint-ppoint: ~D~%" (-> this joint-ppoint)) + (format #t "~Tnum-to-birth: ~f~%" (-> this num-to-birth)) + (format #t "~Tsound: ~A~%" (-> this sound)) + (format #t "~Tdataf[1] @ #x~X~%" (&-> this sprite)) + (format #t "~Tdata[1] @ #x~X~%" (&-> this sprite)) + this ) ;; definition for method 3 of type sparticle-launcher ;; INFO: Return type mismatch int vs sparticle-launcher. -(defmethod inspect sparticle-launcher ((obj sparticle-launcher)) - (format #t "~X: sparticle-launcher~%" obj) +(defmethod inspect sparticle-launcher ((this sparticle-launcher)) + (format #t "~X: sparticle-launcher~%" this) (let ((s5-0 0)) - (while (!= (-> obj init-specs s5-0 field) (sp-field-id spt-end)) - (let* ((v1-1 (-> obj init-specs s5-0)) + (while (!= (-> this init-specs s5-0 field) (sp-field-id spt-end)) + (let* ((v1-1 (-> this init-specs s5-0)) (t9-1 format) (a0-3 #t) (a1-1 "~T~S : ~F / #x~X / ~D~%") @@ -353,12 +353,12 @@ ) ;; definition for method 3 of type sp-queued-launch-particles -(defmethod inspect sp-queued-launch-particles ((obj sp-queued-launch-particles)) - (format #t "[~8x] ~A~%" obj 'sp-queued-launch-particles) - (format #t "~Tsp-system: ~A~%" (-> obj sp-system)) - (format #t "~Tsp-launcher: ~A~%" (-> obj sp-launcher)) - (format #t "~Tpos: #~%" (-> obj pos)) - obj +(defmethod inspect sp-queued-launch-particles ((this sp-queued-launch-particles)) + (format #t "[~8x] ~A~%" this 'sp-queued-launch-particles) + (format #t "~Tsp-system: ~A~%" (-> this sp-system)) + (format #t "~Tsp-launcher: ~A~%" (-> this sp-launcher)) + (format #t "~Tpos: #~%" (-> this pos)) + this ) ;; definition of type sp-launch-queue @@ -372,11 +372,11 @@ ) ;; definition for method 3 of type sp-launch-queue -(defmethod inspect sp-launch-queue ((obj sp-launch-queue)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tin-use: ~D~%" (-> obj in-use)) - (format #t "~Tqueue[32] @ #x~X~%" (-> obj queue)) - obj +(defmethod inspect sp-launch-queue ((this sp-launch-queue)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tin-use: ~D~%" (-> this in-use)) + (format #t "~Tqueue[32] @ #x~X~%" (-> this queue)) + this ) ;; definition for symbol *sp-launcher-lock*, type symbol @@ -423,14 +423,14 @@ ) ;; definition for method 3 of type particle-adgif-cache -(defmethod inspect particle-adgif-cache ((obj particle-adgif-cache)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tused: ~D~%" (-> obj used)) - (format #t "~Tlast: ~D~%" (-> obj last)) - (format #t "~Tlastgif: #~%" (-> obj lastgif)) - (format #t "~Ttidhash[80] @ #x~X~%" (-> obj tidhash)) - (format #t "~Tspadgif[80] @ #x~X~%" (-> obj spadgif)) - obj +(defmethod inspect particle-adgif-cache ((this particle-adgif-cache)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tused: ~D~%" (-> this used)) + (format #t "~Tlast: ~D~%" (-> this last)) + (format #t "~Tlastgif: #~%" (-> this lastgif)) + (format #t "~Ttidhash[80] @ #x~X~%" (-> this tidhash)) + (format #t "~Tspadgif[80] @ #x~X~%" (-> this spadgif)) + this ) ;; definition for symbol *particle-adgif-cache*, type particle-adgif-cache @@ -885,19 +885,19 @@ ;; definition for method 9 of type sparticle-launch-control ;; INFO: Return type mismatch int vs none. -(defmethod initialize sparticle-launch-control ((obj sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) +(defmethod initialize sparticle-launch-control ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) (let ((s5-0 0)) - (set! (-> obj group) arg0) - (set! (-> obj proc) arg1) - (set! (-> obj local-clock) 0) - (set! (-> obj fade) 1.0) - (set! (-> obj matrix) 0) - (set! (-> obj last-spawn-frame) (the-as int (+ (-> *display* real-actual-frame-counter) (seconds -0.007)))) - (set! (-> obj last-spawn-time) 0) + (set! (-> this group) arg0) + (set! (-> this proc) arg1) + (set! (-> this local-clock) 0) + (set! (-> this fade) 1.0) + (set! (-> this matrix) 0) + (set! (-> this last-spawn-frame) (the-as int (+ (-> *display* real-actual-frame-counter) (seconds -0.007)))) + (set! (-> this last-spawn-time) 0) (dotimes (s3-0 (-> arg0 length)) (let* ((a0-2 (-> arg0 launcher s3-0)) (a1-2 (-> *part-id-table* (-> a0-2 launcher))) - (v1-9 (-> obj data s5-0)) + (v1-9 (-> this data s5-0)) ) (when (nonzero? a1-2) (set! (-> v1-9 group-item) a0-2) @@ -916,7 +916,7 @@ ) (else (logior! (-> v1-9 flags) (sp-launch-state-flags launcher-active)) - (set! (-> v1-9 origin) (-> obj center)) + (set! (-> v1-9 origin) (-> this center)) (set! (-> v1-9 sprite3d) #f) (set! (-> v1-9 sprite) #f) ) @@ -930,7 +930,7 @@ ) ) ) - (set! (-> obj length) s5-0) + (set! (-> this length) s5-0) ) 0 (none) @@ -938,14 +938,14 @@ ;; definition for method 9 of type sparticle-launch-group ;; INFO: Return type mismatch object vs sparticle-launch-control. -(defmethod create-launch-control sparticle-launch-group ((obj sparticle-launch-group) (arg0 process)) - (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> obj length))))) +(defmethod create-launch-control sparticle-launch-group ((this sparticle-launch-group) (arg0 process)) + (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> this length))))) (when (zero? (the-as sparticle-launch-control gp-0)) (go process-drawable-art-error "memory") (set! gp-0 0) (goto cfg-4) ) - (initialize (the-as sparticle-launch-control gp-0) obj arg0) + (initialize (the-as sparticle-launch-control gp-0) this arg0) (label cfg-4) (the-as sparticle-launch-control gp-0) ) @@ -953,17 +953,17 @@ ;; definition for method 12 of type sparticle-launch-control ;; INFO: Return type mismatch int vs none. -(defmethod kill-and-free-particles sparticle-launch-control ((obj sparticle-launch-control)) - (countdown (v1-0 (-> obj length)) - (let ((a0-3 (-> obj data v1-0))) +(defmethod kill-and-free-particles sparticle-launch-control ((this sparticle-launch-control)) + (countdown (v1-0 (-> this length)) + (let ((a0-3 (-> this data v1-0))) (logclear! (-> a0-3 flags) (sp-launch-state-flags particles-active)) ) ) - (set! (-> obj local-clock) 0) - (set! (-> obj fade) 1.0) - (kill-all-particles-with-key obj) - (if (> (-> obj matrix) 0) - (sprite-release-user-hvdf (-> obj matrix)) + (set! (-> this local-clock) 0) + (set! (-> this fade) 1.0) + (kill-all-particles-with-key this) + (if (> (-> this matrix) 0) + (sprite-release-user-hvdf (-> this matrix)) ) 0 (none) @@ -971,28 +971,28 @@ ;; definition for method 13 of type sparticle-launch-control ;; INFO: Return type mismatch int vs none. -(defmethod kill-particles sparticle-launch-control ((obj sparticle-launch-control)) - (kill-all-particles-with-key obj) +(defmethod kill-particles sparticle-launch-control ((this sparticle-launch-control)) + (kill-all-particles-with-key this) 0 (none) ) ;; definition for method 10 of type sparticle-launch-control -(defmethod is-visible? sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) - (let* ((v1-0 (-> obj group)) +(defmethod is-visible? sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) + (let* ((v1-0 (-> this group)) (f0-0 (-> v1-0 bounds w)) ) (cond ((= f0-0 0.0) #t ) - ((nonzero? (-> obj matrix)) + ((nonzero? (-> this matrix)) #t ) (else (let ((gp-1 (vector+! (new 'stack-no-clear 'vector) arg0 (the-as vector (-> v1-0 bounds))))) (set! (-> gp-1 w) f0-0) - (if (and *display-actor-vis* (or (not *display-actor-anim*) (name= *display-actor-anim* (-> obj proc name)))) + (if (and *display-actor-vis* (or (not *display-actor-anim*) (name= *display-actor-anim* (-> this proc name)))) (add-debug-sphere *display-actor-vis* (bucket-id debug) gp-1 (-> gp-1 w) (new 'static 'rgba :g #xff :a #x80)) ) (sphere-in-view-frustum? (the-as sphere gp-1)) @@ -1005,25 +1005,25 @@ ;; definition for method 11 of type sparticle-launch-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs object. -(defmethod spawn sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) - (set! (-> obj center quad) (-> arg0 quad)) - (if (not (or (is-visible? obj arg0) (logtest? (-> obj group flags) (sp-group-flag always-draw screen-space)))) +(defmethod spawn sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) + (set! (-> this center quad) (-> arg0 quad)) + (if (not (or (is-visible? this arg0) (logtest? (-> this group flags) (sp-group-flag always-draw screen-space)))) (return (the-as object 0)) ) (let ((s4-0 *particle-300hz-timer*) - (s5-0 (-> obj last-spawn-time)) + (s5-0 (-> this last-spawn-time)) ) (let ((v1-8 (-> *display* real-actual-frame-counter))) - (if (!= v1-8 (+ (-> obj last-spawn-frame) 1)) + (if (!= v1-8 (+ (-> this last-spawn-frame) 1)) (set! s5-0 (- s4-0 (logand (the-as int (-> *sp-frame-time* x)) 255))) ) ) - (set! (-> obj last-spawn-frame) (the-as int (-> *display* real-actual-frame-counter))) - (set! (-> obj last-spawn-time) s4-0) - (when (logtest? (-> obj group flags) (sp-group-flag use-local-clock)) - (set! s5-0 (-> obj local-clock)) - (+! (-> obj local-clock) (logand (the-as int (-> *sp-frame-time* x)) 255)) - (set! s4-0 (-> obj local-clock)) + (set! (-> this last-spawn-frame) (the-as int (-> *display* real-actual-frame-counter))) + (set! (-> this last-spawn-time) s4-0) + (when (logtest? (-> this group flags) (sp-group-flag use-local-clock)) + (set! s5-0 (-> this local-clock)) + (+! (-> this local-clock) (logand (the-as int (-> *sp-frame-time* x)) 255)) + (set! s4-0 (-> this local-clock)) ) (let ((f30-0 (vector-vector-distance arg0 (math-camera-pos))) (s3-1 (ash 1 (if *time-of-day-proc* @@ -1033,13 +1033,13 @@ ) ) ) - (if (nonzero? (-> obj matrix)) + (if (nonzero? (-> this matrix)) (set! f30-0 0.0) ) - (let ((s2-1 (-> obj length))) + (let ((s2-1 (-> this length))) (while (begin (label cfg-79) (nonzero? s2-1)) (+! s2-1 -1) - (let* ((a3-0 (-> obj data s2-1)) + (let* ((a3-0 (-> this data s2-1)) (v1-29 (-> a3-0 group-item)) (a1-4 (-> *part-id-table* (-> v1-29 launcher))) ) @@ -1064,7 +1064,7 @@ a1-4 (-> a3-0 origin) :launch-state a3-0 - :launch-control obj + :launch-control this :rate f0-2 ) ) @@ -1084,8 +1084,8 @@ (let ((f0-4 (* 0.2 (the float (- s4-0 s5-0)) f0-2))) (b! #t cfg-72 :delay (nop!)) (label cfg-50) - (let ((a2-5 (mod (+ s5-0 (-> obj data s2-1 offset)) (the-as int (-> v1-29 period)))) - (a0-56 (mod (the-as uint (+ s4-0 (-> obj data s2-1 offset))) (-> v1-29 period))) + (let ((a2-5 (mod (+ s5-0 (-> this data s2-1 offset)) (the-as int (-> v1-29 period)))) + (a0-56 (mod (the-as uint (+ s4-0 (-> this data s2-1 offset))) (-> v1-29 period))) (t0-2 (-> v1-29 length)) ) (set! f0-4 (cond @@ -1103,11 +1103,11 @@ 0 (goto cfg-77) ) - (when (< (the-as uint (- s4-0 (the-as int (-> obj data s2-1 spawn-time)))) (-> v1-29 period)) + (when (< (the-as uint (- s4-0 (the-as int (-> this data s2-1 spawn-time)))) (-> v1-29 period)) 0 (goto cfg-77) ) - (set! (-> obj data s2-1 offset) (- (-> v1-29 period) a0-56)) + (set! (-> this data s2-1 offset) (- (-> v1-29 period) a0-56)) (* 0.2 (the float (- s4-0 s5-0)) f0-2) ) ) @@ -1125,7 +1125,7 @@ a1-4 (-> a3-0 origin) :launch-state a3-0 - :launch-control obj + :launch-control this :rate f0-4 ) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc index d55c4293fc..3ac271ef20 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sparticle/sparticle_REF.gc @@ -3,13 +3,13 @@ ;; definition for method 2 of type sparticle-cpuinfo ;; INFO: Return type mismatch object vs sparticle-cpuinfo. -(defmethod print sparticle-cpuinfo ((obj sparticle-cpuinfo)) +(defmethod print sparticle-cpuinfo ((this sparticle-cpuinfo)) (format #t "~%") (dotimes (s5-0 16) - (format #t "~D:~F~%" s5-0 (the-as float (-> obj data s5-0))) + (format #t "~D:~F~%" s5-0 (the-as float (-> this data s5-0))) ) - (format #t "TIMER:~D~%" (-> obj timer)) - (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> obj flags))) + (format #t "TIMER:~D~%" (-> this timer)) + (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> this flags))) ) ;; definition for function sp-particle-copy! diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc index bd6a5f7af5..8c2b95aa33 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-distort_REF.gc @@ -16,15 +16,15 @@ ) ;; definition for method 3 of type sprite-distorter-sine-tables -(defmethod inspect sprite-distorter-sine-tables ((obj sprite-distorter-sine-tables)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Taspx: ~f~%" (-> obj aspx)) - (format #t "~Taspy: ~f~%" (-> obj aspy)) - (format #t "~Tentry[128] @ #x~X~%" (-> obj entry)) - (format #t "~Tientry[9] @ #x~X~%" (-> obj ientry)) - (format #t "~Tgiftag: #~%" (-> obj giftag)) - (format #t "~Tcolor: #~%" (-> obj color)) - obj +(defmethod inspect sprite-distorter-sine-tables ((this sprite-distorter-sine-tables)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Taspx: ~f~%" (-> this aspx)) + (format #t "~Taspy: ~f~%" (-> this aspy)) + (format #t "~Tentry[128] @ #x~X~%" (-> this entry)) + (format #t "~Tientry[9] @ #x~X~%" (-> this ientry)) + (format #t "~Tgiftag: #~%" (-> this giftag)) + (format #t "~Tcolor: #~%" (-> this color)) + this ) ;; definition for symbol *sprite-distorter-sine-tables*, type sprite-distorter-sine-tables diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-h_REF.gc index b6812ba293..75925efd10 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite-h_REF.gc @@ -30,29 +30,29 @@ ) ;; definition for method 3 of type sprite-vec-data-2d -(defmethod inspect sprite-vec-data-2d ((obj sprite-vec-data-2d)) - (format #t "[~8x] ~A~%" obj 'sprite-vec-data-2d) - (format #t "~Tx-y-z-sx: #~%" (&-> obj x)) - (format #t "~Tflag-rot-sy: #~%" (&-> obj flag)) - (format #t "~Tr-g-b-a: #~%" (&-> obj r)) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tsx: ~f~%" (-> obj sx)) - (format #t "~Tsy: ~f~%" (-> obj sy)) - (format #t "~Trot: ~f~%" (-> obj rot)) - (format #t "~Tflag: ~D~%" (-> obj flag)) - (format #t "~Tmatrix: ~D~%" (-> obj matrix)) - (format #t "~Twarp-turns: ~D~%" (-> obj flag)) - (format #t "~Tr: ~f~%" (-> obj r)) - (format #t "~Tg: ~f~%" (-> obj g)) - (format #t "~Tb: ~f~%" (-> obj b)) - (format #t "~Ta: ~f~%" (-> obj a)) - (format #t "~Ttrans: #~%" (&-> obj x)) - (format #t "~Tcolor: #~%" (&-> obj r)) - (format #t "~Tdata[1] @ #x~X~%" (&-> obj x)) - (format #t "~Tdata64[6] @ #x~X~%" (&-> obj x)) - obj +(defmethod inspect sprite-vec-data-2d ((this sprite-vec-data-2d)) + (format #t "[~8x] ~A~%" this 'sprite-vec-data-2d) + (format #t "~Tx-y-z-sx: #~%" (&-> this x)) + (format #t "~Tflag-rot-sy: #~%" (&-> this flag)) + (format #t "~Tr-g-b-a: #~%" (&-> this r)) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tsx: ~f~%" (-> this sx)) + (format #t "~Tsy: ~f~%" (-> this sy)) + (format #t "~Trot: ~f~%" (-> this rot)) + (format #t "~Tflag: ~D~%" (-> this flag)) + (format #t "~Tmatrix: ~D~%" (-> this matrix)) + (format #t "~Twarp-turns: ~D~%" (-> this flag)) + (format #t "~Tr: ~f~%" (-> this r)) + (format #t "~Tg: ~f~%" (-> this g)) + (format #t "~Tb: ~f~%" (-> this b)) + (format #t "~Ta: ~f~%" (-> this a)) + (format #t "~Ttrans: #~%" (&-> this x)) + (format #t "~Tcolor: #~%" (&-> this r)) + (format #t "~Tdata[1] @ #x~X~%" (&-> this x)) + (format #t "~Tdata64[6] @ #x~X~%" (&-> this x)) + this ) ;; definition of type sprite-array-2d @@ -73,15 +73,15 @@ ) ;; definition for method 3 of type sprite-array-2d -(defmethod inspect sprite-array-2d ((obj sprite-array-2d)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-sprites[2] @ #x~X~%" (-> obj num-sprites)) - (format #t "~Tnum-valid[2] @ #x~X~%" (-> obj num-valid)) - (format #t "~Tvec-data: #x~X~%" (-> obj vec-data)) - (format #t "~Tadgif-data: #x~X~%" (-> obj adgif-data)) - (format #t "~Tpad[4] @ #x~X~%" (-> obj pad)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect sprite-array-2d ((this sprite-array-2d)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-sprites[2] @ #x~X~%" (-> this num-sprites)) + (format #t "~Tnum-valid[2] @ #x~X~%" (-> this num-valid)) + (format #t "~Tvec-data: #x~X~%" (-> this vec-data)) + (format #t "~Tadgif-data: #x~X~%" (-> this adgif-data)) + (format #t "~Tpad[4] @ #x~X~%" (-> this pad)) + (format #t "~Tdata[1] @ #x~X~%" (-> this data)) + this ) ;; definition of type sprite-vec-data-3d @@ -112,28 +112,28 @@ ) ;; definition for method 3 of type sprite-vec-data-3d -(defmethod inspect sprite-vec-data-3d ((obj sprite-vec-data-3d)) - (format #t "[~8x] ~A~%" obj 'sprite-vec-data-3d) - (format #t "~Tx-y-z-sx: #~%" (-> obj x-y-z-sx)) - (format #t "~Tqx-qy-qz-sy: #~%" (-> obj qx-qy-qz-sy)) - (format #t "~Tr-g-b-a: #~%" (-> obj r-g-b-a)) - (format #t "~Tx: ~f~%" (-> obj x-y-z-sx x)) - (format #t "~Ty: ~f~%" (-> obj x-y-z-sx y)) - (format #t "~Tz: ~f~%" (-> obj x-y-z-sx z)) - (format #t "~Tsx: ~f~%" (-> obj x-y-z-sx w)) - (format #t "~Tsy: ~f~%" (-> obj qx-qy-qz-sy w)) - (format #t "~Tqx: ~f~%" (-> obj qx-qy-qz-sy x)) - (format #t "~Tqy: ~f~%" (-> obj qx-qy-qz-sy y)) - (format #t "~Tqz: ~f~%" (-> obj qx-qy-qz-sy z)) - (format #t "~Tr: ~f~%" (-> obj r-g-b-a x)) - (format #t "~Tg: ~f~%" (-> obj r-g-b-a y)) - (format #t "~Tb: ~f~%" (-> obj r-g-b-a z)) - (format #t "~Ta: ~f~%" (-> obj r-g-b-a w)) - (format #t "~Ttrans: #~%" (-> obj x-y-z-sx)) - (format #t "~Trot: #~%" (-> obj qx-qy-qz-sy)) - (format #t "~Tcolor: #~%" (-> obj r-g-b-a)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj x-y-z-sx)) - obj +(defmethod inspect sprite-vec-data-3d ((this sprite-vec-data-3d)) + (format #t "[~8x] ~A~%" this 'sprite-vec-data-3d) + (format #t "~Tx-y-z-sx: #~%" (-> this x-y-z-sx)) + (format #t "~Tqx-qy-qz-sy: #~%" (-> this qx-qy-qz-sy)) + (format #t "~Tr-g-b-a: #~%" (-> this r-g-b-a)) + (format #t "~Tx: ~f~%" (-> this x-y-z-sx x)) + (format #t "~Ty: ~f~%" (-> this x-y-z-sx y)) + (format #t "~Tz: ~f~%" (-> this x-y-z-sx z)) + (format #t "~Tsx: ~f~%" (-> this x-y-z-sx w)) + (format #t "~Tsy: ~f~%" (-> this qx-qy-qz-sy w)) + (format #t "~Tqx: ~f~%" (-> this qx-qy-qz-sy x)) + (format #t "~Tqy: ~f~%" (-> this qx-qy-qz-sy y)) + (format #t "~Tqz: ~f~%" (-> this qx-qy-qz-sy z)) + (format #t "~Tr: ~f~%" (-> this r-g-b-a x)) + (format #t "~Tg: ~f~%" (-> this r-g-b-a y)) + (format #t "~Tb: ~f~%" (-> this r-g-b-a z)) + (format #t "~Ta: ~f~%" (-> this r-g-b-a w)) + (format #t "~Ttrans: #~%" (-> this x-y-z-sx)) + (format #t "~Trot: #~%" (-> this qx-qy-qz-sy)) + (format #t "~Tcolor: #~%" (-> this r-g-b-a)) + (format #t "~Tdata[1] @ #x~X~%" (-> this x-y-z-sx)) + this ) ;; definition of type sprite-array-3d @@ -153,14 +153,14 @@ ) ;; definition for method 3 of type sprite-array-3d -(defmethod inspect sprite-array-3d ((obj sprite-array-3d)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-sprites[2] @ #x~X~%" (-> obj num-sprites)) - (format #t "~Tnum-valid[2] @ #x~X~%" (-> obj num-valid)) - (format #t "~Tvec-data: #x~X~%" (-> obj vec-data)) - (format #t "~Tadgif-data: #x~X~%" (-> obj adgif-data)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect sprite-array-3d ((this sprite-array-3d)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-sprites[2] @ #x~X~%" (-> this num-sprites)) + (format #t "~Tnum-valid[2] @ #x~X~%" (-> this num-valid)) + (format #t "~Tvec-data: #x~X~%" (-> this vec-data)) + (format #t "~Tadgif-data: #x~X~%" (-> this adgif-data)) + (format #t "~Tdata[1] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc index a664596644..6888f8832a 100644 --- a/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/sprite/sprite_REF.gc @@ -12,11 +12,11 @@ ) ;; definition for method 3 of type sprite-header -(defmethod inspect sprite-header ((obj sprite-header)) - (format #t "[~8x] ~A~%" obj 'sprite-header) - (format #t "~Theader[1] @ #x~X~%" (-> obj header)) - (format #t "~Tnum-sprites: ~D~%" (-> obj num-sprites)) - obj +(defmethod inspect sprite-header ((this sprite-header)) + (format #t "[~8x] ~A~%" this 'sprite-header) + (format #t "~Theader[1] @ #x~X~%" (-> this header)) + (format #t "~Tnum-sprites: ~D~%" (-> this num-sprites)) + this ) ;; definition for function sprite-setup-header @@ -36,10 +36,10 @@ ) ;; definition for method 3 of type sprite-hvdf-data -(defmethod inspect sprite-hvdf-data ((obj sprite-hvdf-data)) - (format #t "[~8x] ~A~%" obj 'sprite-hvdf-data) - (format #t "~Tdata[76] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect sprite-hvdf-data ((this sprite-hvdf-data)) + (format #t "[~8x] ~A~%" this 'sprite-hvdf-data) + (format #t "~Tdata[76] @ #x~X~%" (-> this data)) + this ) ;; definition of type sprite-hvdf-control @@ -52,10 +52,10 @@ ) ;; definition for method 3 of type sprite-hvdf-control -(defmethod inspect sprite-hvdf-control ((obj sprite-hvdf-control)) - (format #t "[~8x] ~A~%" obj 'sprite-hvdf-control) - (format #t "~Talloc[76] @ #x~X~%" (-> obj alloc)) - obj +(defmethod inspect sprite-hvdf-control ((this sprite-hvdf-control)) + (format #t "[~8x] ~A~%" this 'sprite-hvdf-control) + (format #t "~Talloc[76] @ #x~X~%" (-> this alloc)) + this ) ;; definition for symbol *sprite-hvdf-data*, type sprite-hvdf-data @@ -88,12 +88,12 @@ ;; definition for method 3 of type sprite-aux-list ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sprite-aux-list ((obj sprite-aux-list)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-entries: ~D~%" (-> obj num-entries)) - (format #t "~Tentry: ~D~%" (-> obj entry)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect sprite-aux-list ((this sprite-aux-list)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-entries: ~D~%" (-> this num-entries)) + (format #t "~Tentry: ~D~%" (-> this entry)) + (format #t "~Tdata[1] @ #x~X~%" (-> this data)) + this ) ;; definition for method 0 of type sprite-aux-list @@ -108,12 +108,12 @@ ;; definition for method 3 of type sprite-aux-list ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch symbol vs sprite-aux-list. -(defmethod inspect sprite-aux-list ((obj sprite-aux-list)) - (format #t "[~X] sprite-aux-list:~%" obj) - (format #t "~Tnum-entries: ~D~%" (-> obj num-entries)) - (format #t "~Tentry: ~D~%" (-> obj entry)) - (dotimes (s5-0 (-> obj entry)) - (format #t "~T~D : ~X~%" s5-0 (-> obj data s5-0)) +(defmethod inspect sprite-aux-list ((this sprite-aux-list)) + (format #t "[~X] sprite-aux-list:~%" this) + (format #t "~Tnum-entries: ~D~%" (-> this num-entries)) + (format #t "~Tentry: ~D~%" (-> this entry)) + (dotimes (s5-0 (-> this entry)) + (format #t "~T~D : ~X~%" s5-0 (-> this data s5-0)) ) (the-as sprite-aux-list #f) ) @@ -181,43 +181,43 @@ ) ;; definition for method 3 of type sprite-frame-data -(defmethod inspect sprite-frame-data ((obj sprite-frame-data)) - (format #t "[~8x] ~A~%" obj 'sprite-frame-data) - (format #t "~Tdata[41] @ #x~X~%" (-> obj cdata)) - (format #t "~Tcdata[16] @ #x~X~%" (-> obj cdata)) - (format #t "~Tfdata[25] @ #x~X~%" (-> obj hmge-scale)) - (format #t "~Txy-array[8] @ #x~X~%" (-> obj cdata)) - (format #t "~Tst-array[4] @ #x~X~%" (-> obj cdata 8)) - (format #t "~Txyz-array[4] @ #x~X~%" (-> obj cdata 12)) - (format #t "~Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~Tconsts: #~%" (&-> obj pfog0)) - (format #t "~Tpfog0: ~f~%" (-> obj pfog0)) - (format #t "~Tdeg-to-rad: ~f~%" (-> obj deg-to-rad)) - (format #t "~Tmin-scale: ~f~%" (-> obj min-scale)) - (format #t "~Tinv-area: ~f~%" (-> obj inv-area)) - (format #t "~Tadgif-giftag: #~%" (-> obj adgif-giftag)) - (format #t "~Tsprite-2d-giftag: #~%" (-> obj sprite-2d-giftag)) - (format #t "~Tsprite-2d-giftag-2: #~%" (-> obj sprite-2d-giftag-2)) - (format #t "~Tsincos-01: #~%" (-> obj sincos-01)) - (format #t "~Tsincos-23: #~%" (-> obj sincos-23)) - (format #t "~Tsincos-45: #~%" (-> obj sincos-45)) - (format #t "~Tsincos-67: #~%" (-> obj sincos-67)) - (format #t "~Tsincos-89: #~%" (-> obj sincos-89)) - (format #t "~Tbasis-x: #~%" (-> obj basis-x)) - (format #t "~Tbasis-y: #~%" (-> obj basis-y)) - (format #t "~Tsprite-3d-giftag: #~%" (-> obj sprite-3d-giftag)) - (format #t "~Tscreen-shader: #~%" (-> obj screen-shader)) - (format #t "~Tclipped-giftag: #~%" (-> obj clipped-giftag)) - (format #t "~Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) - (format #t "~Tstq-offset: #~%" (-> obj stq-offset)) - (format #t "~Tstq-scale: #~%" (-> obj stq-scale)) - (format #t "~Trgba-plain: #~%" (-> obj rgba-plain)) - (format #t "~Twarp-giftag: #~%" (-> obj warp-giftag)) - (format #t "~Tfog-clamp: #~%" (-> obj fog-clamp)) - (format #t "~Tfog-min: ~f~%" (-> obj fog-clamp x)) - (format #t "~Tfog-max: ~f~%" (-> obj fog-clamp y)) - (format #t "~Tmax-scale: ~f~%" (-> obj fog-clamp z)) - obj +(defmethod inspect sprite-frame-data ((this sprite-frame-data)) + (format #t "[~8x] ~A~%" this 'sprite-frame-data) + (format #t "~Tdata[41] @ #x~X~%" (-> this cdata)) + (format #t "~Tcdata[16] @ #x~X~%" (-> this cdata)) + (format #t "~Tfdata[25] @ #x~X~%" (-> this hmge-scale)) + (format #t "~Txy-array[8] @ #x~X~%" (-> this cdata)) + (format #t "~Tst-array[4] @ #x~X~%" (-> this cdata 8)) + (format #t "~Txyz-array[4] @ #x~X~%" (-> this cdata 12)) + (format #t "~Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~Tconsts: #~%" (&-> this pfog0)) + (format #t "~Tpfog0: ~f~%" (-> this pfog0)) + (format #t "~Tdeg-to-rad: ~f~%" (-> this deg-to-rad)) + (format #t "~Tmin-scale: ~f~%" (-> this min-scale)) + (format #t "~Tinv-area: ~f~%" (-> this inv-area)) + (format #t "~Tadgif-giftag: #~%" (-> this adgif-giftag)) + (format #t "~Tsprite-2d-giftag: #~%" (-> this sprite-2d-giftag)) + (format #t "~Tsprite-2d-giftag-2: #~%" (-> this sprite-2d-giftag-2)) + (format #t "~Tsincos-01: #~%" (-> this sincos-01)) + (format #t "~Tsincos-23: #~%" (-> this sincos-23)) + (format #t "~Tsincos-45: #~%" (-> this sincos-45)) + (format #t "~Tsincos-67: #~%" (-> this sincos-67)) + (format #t "~Tsincos-89: #~%" (-> this sincos-89)) + (format #t "~Tbasis-x: #~%" (-> this basis-x)) + (format #t "~Tbasis-y: #~%" (-> this basis-y)) + (format #t "~Tsprite-3d-giftag: #~%" (-> this sprite-3d-giftag)) + (format #t "~Tscreen-shader: #~%" (-> this screen-shader)) + (format #t "~Tclipped-giftag: #~%" (-> this clipped-giftag)) + (format #t "~Tinv-hmge-scale: #~%" (-> this inv-hmge-scale)) + (format #t "~Tstq-offset: #~%" (-> this stq-offset)) + (format #t "~Tstq-scale: #~%" (-> this stq-scale)) + (format #t "~Trgba-plain: #~%" (-> this rgba-plain)) + (format #t "~Twarp-giftag: #~%" (-> this warp-giftag)) + (format #t "~Tfog-clamp: #~%" (-> this fog-clamp)) + (format #t "~Tfog-min: ~f~%" (-> this fog-clamp x)) + (format #t "~Tfog-max: ~f~%" (-> this fog-clamp y)) + (format #t "~Tmax-scale: ~f~%" (-> this fog-clamp z)) + this ) ;; definition for function sprite-setup-frame-data diff --git a/test/decompiler/reference/jak1/engine/gfx/texture/texture-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/texture/texture-h_REF.gc index 38e9757701..0f990b0e8f 100644 --- a/test/decompiler/reference/jak1/engine/gfx/texture/texture-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/texture/texture-h_REF.gc @@ -18,11 +18,11 @@ ) ;; definition for method 3 of type texture-id -(defmethod inspect texture-id ((obj texture-id)) - (format #t "[~8x] ~A~%" obj 'texture-id) - (format #t "~Tindex: ~D~%" (-> obj index)) - (format #t "~Tpage: ~D~%" (-> obj page)) - obj +(defmethod inspect texture-id ((this texture-id)) + (format #t "[~8x] ~A~%" this 'texture-id) + (format #t "~Tindex: ~D~%" (-> this index)) + (format #t "~Tpage: ~D~%" (-> this page)) + this ) ;; definition of type texture-pool-segment @@ -37,11 +37,11 @@ ) ;; definition for method 3 of type texture-pool-segment -(defmethod inspect texture-pool-segment ((obj texture-pool-segment)) - (format #t "[~8x] ~A~%" obj 'texture-pool-segment) - (format #t "~Tdest: #x~X~%" (-> obj dest)) - (format #t "~Tsize: #x~X~%" (-> obj size)) - obj +(defmethod inspect texture-pool-segment ((this texture-pool-segment)) + (format #t "[~8x] ~A~%" this 'texture-pool-segment) + (format #t "~Tdest: #x~X~%" (-> this dest)) + (format #t "~Tsize: #x~X~%" (-> this size)) + this ) ;; definition of type texture-pool @@ -80,19 +80,19 @@ ) ;; definition for method 3 of type texture-pool -(defmethod inspect texture-pool ((obj texture-pool)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttop: #x~X~%" (-> obj top)) - (format #t "~Tcur: #x~X~%" (-> obj cur)) - (format #t "~Tallocate-func: ~A~%" (-> obj allocate-func)) - (format #t "~Tfont-palette: ~D~%" (-> obj font-palette)) - (format #t "~Tsegment[4] @ #x~X~%" (-> obj segment-near)) - (format #t "~Tsegment-near: #~%" (-> obj segment-near)) - (format #t "~Tsegment-common: #~%" (-> obj segment-common)) - (format #t "~Tcommon-page[32] @ #x~X~%" (-> obj common-page)) - (format #t "~Tcommon-page-mask: ~D~%" (-> obj common-page-mask)) - (format #t "~Tids[126] @ #x~X~%" (-> obj ids)) - obj +(defmethod inspect texture-pool ((this texture-pool)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttop: #x~X~%" (-> this top)) + (format #t "~Tcur: #x~X~%" (-> this cur)) + (format #t "~Tallocate-func: ~A~%" (-> this allocate-func)) + (format #t "~Tfont-palette: ~D~%" (-> this font-palette)) + (format #t "~Tsegment[4] @ #x~X~%" (-> this segment-near)) + (format #t "~Tsegment-near: #~%" (-> this segment-near)) + (format #t "~Tsegment-common: #~%" (-> this segment-common)) + (format #t "~Tcommon-page[32] @ #x~X~%" (-> this common-page)) + (format #t "~Tcommon-page-mask: ~D~%" (-> this common-page-mask)) + (format #t "~Tids[126] @ #x~X~%" (-> this ids)) + this ) ;; definition of type texture @@ -120,23 +120,23 @@ ) ;; definition for method 3 of type texture -(defmethod inspect texture ((obj texture)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tw: ~D~%" (-> obj w)) - (format #t "~Th: ~D~%" (-> obj h)) - (format #t "~Tnum-mips: ~D~%" (-> obj num-mips)) - (format #t "~Ttex1-control: ~D~%" (-> obj tex1-control)) - (format #t "~Tpsm: ~D~%" (-> obj psm)) - (format #t "~Tmip-shift: ~D~%" (-> obj mip-shift)) - (format #t "~Tclutpsm: ~D~%" (-> obj clutpsm)) - (format #t "~Tdest[7] @ #x~X~%" (-> obj dest)) - (format #t "~Tclutdest: ~D~%" (-> obj clutdest)) - (format #t "~Twidth[7] @ #x~X~%" (-> obj width)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tsize: #x~X~%" (-> obj size)) - (format #t "~Tuv-dist: ~f~%" (-> obj uv-dist)) - (format #t "~Tmasks[3] @ #x~X~%" (-> obj masks)) - obj +(defmethod inspect texture ((this texture)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tw: ~D~%" (-> this w)) + (format #t "~Th: ~D~%" (-> this h)) + (format #t "~Tnum-mips: ~D~%" (-> this num-mips)) + (format #t "~Ttex1-control: ~D~%" (-> this tex1-control)) + (format #t "~Tpsm: ~D~%" (-> this psm)) + (format #t "~Tmip-shift: ~D~%" (-> this mip-shift)) + (format #t "~Tclutpsm: ~D~%" (-> this clutpsm)) + (format #t "~Tdest[7] @ #x~X~%" (-> this dest)) + (format #t "~Tclutdest: ~D~%" (-> this clutdest)) + (format #t "~Twidth[7] @ #x~X~%" (-> this width)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tsize: #x~X~%" (-> this size)) + (format #t "~Tuv-dist: ~f~%" (-> this uv-dist)) + (format #t "~Tmasks[3] @ #x~X~%" (-> this masks)) + this ) ;; definition of type texture-page-segment @@ -152,12 +152,12 @@ ) ;; definition for method 3 of type texture-page-segment -(defmethod inspect texture-page-segment ((obj texture-page-segment)) - (format #t "[~8x] ~A~%" obj 'texture-page-segment) - (format #t "~Tblock-data: #x~X~%" (-> obj block-data)) - (format #t "~Tsize: #x~X~%" (-> obj size)) - (format #t "~Tdest: #x~X~%" (-> obj dest)) - obj +(defmethod inspect texture-page-segment ((this texture-page-segment)) + (format #t "[~8x] ~A~%" this 'texture-page-segment) + (format #t "~Tblock-data: #x~X~%" (-> this block-data)) + (format #t "~Tsize: #x~X~%" (-> this size)) + (format #t "~Tdest: #x~X~%" (-> this dest)) + this ) ;; definition for function texture-mip->segment @@ -195,18 +195,18 @@ ) ;; definition for method 3 of type texture-page -(defmethod inspect texture-page ((obj texture-page)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tinfo: ~A~%" (-> obj info)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tmip0-size: ~D~%" (-> obj mip0-size)) - (format #t "~Tsize: #x~X~%" (-> obj size)) - (format #t "~Tsegment[3] @ #x~X~%" (-> obj segment)) - (format #t "~Tpad[16] @ #x~X~%" (-> obj pad)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect texture-page ((this texture-page)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tinfo: ~A~%" (-> this info)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tmip0-size: ~D~%" (-> this mip0-size)) + (format #t "~Tsize: #x~X~%" (-> this size)) + (format #t "~Tsegment[3] @ #x~X~%" (-> this segment)) + (format #t "~Tpad[16] @ #x~X~%" (-> this pad)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; definition of type shader-ptr @@ -228,10 +228,10 @@ ) ;; definition for method 3 of type texture-link -(defmethod inspect texture-link ((obj texture-link)) - (format #t "[~8x] ~A~%" obj 'texture-link) - (format #t "~Tnext: #x~X~%" (-> obj next 0)) - obj +(defmethod inspect texture-link ((this texture-link)) + (format #t "[~8x] ~A~%" this 'texture-link) + (format #t "~Tnext: #x~X~%" (-> this next 0)) + this ) ;; definition of type texture-page-dir-entry @@ -248,13 +248,13 @@ ) ;; definition for method 3 of type texture-page-dir-entry -(defmethod inspect texture-page-dir-entry ((obj texture-page-dir-entry)) - (format #t "[~8x] ~A~%" obj 'texture-page-dir-entry) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tstatus: ~D~%" (-> obj status)) - (format #t "~Tpage: ~A~%" (-> obj page)) - (format #t "~Tlink: #x~X~%" (-> obj link)) - obj +(defmethod inspect texture-page-dir-entry ((this texture-page-dir-entry)) + (format #t "[~8x] ~A~%" this 'texture-page-dir-entry) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tstatus: ~D~%" (-> this status)) + (format #t "~Tpage: ~A~%" (-> this page)) + (format #t "~Tlink: #x~X~%" (-> this link)) + this ) ;; definition of type texture-page-dir @@ -286,15 +286,15 @@ ) ;; definition for method 3 of type texture-relocate-later -(defmethod inspect texture-relocate-later ((obj texture-relocate-later)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tmemcpy: ~A~%" (-> obj memcpy)) - (format #t "~Tdest: ~D~%" (-> obj dest)) - (format #t "~Tsource: ~D~%" (-> obj source)) - (format #t "~Tmove: ~D~%" (-> obj move)) - (format #t "~Tentry: #~%" (-> obj entry)) - (format #t "~Tpage: ~A~%" (-> obj page)) - obj +(defmethod inspect texture-relocate-later ((this texture-relocate-later)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tmemcpy: ~A~%" (-> this memcpy)) + (format #t "~Tdest: ~D~%" (-> this dest)) + (format #t "~Tsource: ~D~%" (-> this source)) + (format #t "~Tmove: ~D~%" (-> this move)) + (format #t "~Tentry: #~%" (-> this entry)) + (format #t "~Tpage: ~A~%" (-> this page)) + this ) ;; definition for symbol *texture-relocate-later*, type texture-relocate-later @@ -327,20 +327,20 @@ ) ;; definition for method 3 of type adgif-shader -(defmethod inspect adgif-shader ((obj adgif-shader)) - (format #t "[~8x] ~A~%" obj 'adgif-shader) - (format #t "~Tquad[5] @ #x~X~%" (&-> obj tex0)) - (format #t "~Tprims[10] @ #x~X~%" (&-> obj tex0)) - (format #t "~Ttex0: #x~X~%" (-> obj tex0)) - (format #t "~Ttex1: #x~X~%" (-> obj tex1)) - (format #t "~Tmiptbp1: #x~X~%" (-> obj miptbp1)) - (format #t "~Tclamp: #x~X~%" (-> obj clamp)) - (format #t "~Tclamp-reg: ~D~%" (-> obj clamp-reg)) - (format #t "~Talpha: #x~X~%" (-> obj alpha)) - (format #t "~Tlink-test: ~D~%" (-> obj link-test)) - (format #t "~Ttexture-id: ~D~%" (-> obj texture-id)) - (format #t "~Tnext: #x~X~%" (-> obj next)) - obj +(defmethod inspect adgif-shader ((this adgif-shader)) + (format #t "[~8x] ~A~%" this 'adgif-shader) + (format #t "~Tquad[5] @ #x~X~%" (&-> this tex0)) + (format #t "~Tprims[10] @ #x~X~%" (&-> this tex0)) + (format #t "~Ttex0: #x~X~%" (-> this tex0)) + (format #t "~Ttex1: #x~X~%" (-> this tex1)) + (format #t "~Tmiptbp1: #x~X~%" (-> this miptbp1)) + (format #t "~Tclamp: #x~X~%" (-> this clamp)) + (format #t "~Tclamp-reg: ~D~%" (-> this clamp-reg)) + (format #t "~Talpha: #x~X~%" (-> this alpha)) + (format #t "~Tlink-test: ~D~%" (-> this link-test)) + (format #t "~Ttexture-id: ~D~%" (-> this texture-id)) + (format #t "~Tnext: #x~X~%" (-> this next)) + this ) ;; definition of type adgif-shader-array @@ -353,12 +353,12 @@ ) ;; definition for method 3 of type adgif-shader-array -(defmethod inspect adgif-shader-array ((obj adgif-shader-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect adgif-shader-array ((this adgif-shader-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/texture/texture_REF.gc b/test/decompiler/reference/jak1/engine/gfx/texture/texture_REF.gc index 7fdc298226..ca815b954e 100644 --- a/test/decompiler/reference/jak1/engine/gfx/texture/texture_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/texture/texture_REF.gc @@ -2,45 +2,45 @@ (in-package goal) ;; definition for method 2 of type texture-page -(defmethod print texture-page ((obj texture-page)) +(defmethod print texture-page ((this texture-page)) (format #t "#" - (-> obj name) - (-> obj length) - (shr (-> obj segment 0 dest) 6) - (shr (-> obj size) 8) - obj + (-> this name) + (-> this length) + (shr (-> this segment 0 dest) 6) + (shr (-> this size) 8) + this ) - obj + this ) ;; definition for method 4 of type texture-page -(defmethod length texture-page ((obj texture-page)) - (-> obj length) +(defmethod length texture-page ((this texture-page)) + (-> this length) ) ;; definition for method 5 of type texture-page ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of texture-page ((obj texture-page)) - (the-as int (+ (-> obj type size) (* (-> obj length) 4))) +(defmethod asize-of texture-page ((this texture-page)) + (the-as int (+ (-> this type size) (* (-> this length) 4))) ) ;; definition for method 8 of type texture-page -(defmethod mem-usage texture-page ((obj texture-page) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage texture-page ((this texture-page) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 80 (-> arg0 length))) (set! (-> arg0 data 79 name) "texture") - (+! (-> arg0 data 79 count) (-> obj length)) - (let ((v1-7 (- (asize-of obj) (the-as int (* (-> obj size) 4))))) - (dotimes (a0-6 (-> obj length)) - (if (-> obj data a0-6) + (+! (-> arg0 data 79 count) (-> this length)) + (let ((v1-7 (- (asize-of this) (the-as int (* (-> this size) 4))))) + (dotimes (a0-6 (-> this length)) + (if (-> this data a0-6) (+! v1-7 64) ) ) (+! (-> arg0 data 79 used) v1-7) (+! (-> arg0 data 79 total) (logand -16 (+ v1-7 15))) ) - obj + this ) ;; definition for function texture-bpp @@ -122,25 +122,25 @@ ) ;; definition for method 2 of type texture -(defmethod print texture ((obj texture)) +(defmethod print texture ((this texture)) (format #t "# obj name) - (psm->string (-> obj psm)) - (-> obj w) - (-> obj h) - (-> obj num-mips) - (shr (-> obj size) 8) + (-> this name) + (psm->string (-> this psm)) + (-> this w) + (-> this h) + (-> this num-mips) + (shr (-> this size) 8) ) - (dotimes (s5-1 (the-as int (-> obj num-mips))) - (format #t " #x~X/~X" (-> obj dest s5-1) (-> obj width s5-1)) + (dotimes (s5-1 (the-as int (-> this num-mips))) + (format #t " #x~X/~X" (-> this dest s5-1) (-> this width s5-1)) ) - (if (< (texture-bpp (-> obj psm)) 16) - (format #t " :clut #x~X/1" (-> obj clutdest)) + (if (< (texture-bpp (-> this psm)) 16) + (format #t " :clut #x~X/1" (-> this clutdest)) ) - (format #t " @ #x~X>" obj) - obj + (format #t " @ #x~X>" this) + this ) ;; definition for symbol ct32-24-block-table, type (array int32) @@ -594,15 +594,15 @@ ) ;; definition for method 15 of type texture-pool -(defmethod allocate-vram-words! texture-pool ((obj texture-pool) (word-count int)) - (let ((v0-0 (-> obj cur))) - (+! (-> obj cur) word-count) +(defmethod allocate-vram-words! texture-pool ((this texture-pool) (word-count int)) + (let ((v0-0 (-> this cur))) + (+! (-> this cur) word-count) v0-0 ) ) ;; definition for method 22 of type texture-pool -(defmethod lookup-boot-common-id texture-pool ((obj texture-pool) (tpage-id int)) +(defmethod lookup-boot-common-id texture-pool ((this texture-pool) (tpage-id int)) (case tpage-id ((1032) 0 @@ -671,60 +671,60 @@ ) ;; definition for method 9 of type texture-pool -(defmethod initialize! texture-pool ((obj texture-pool)) - (set! (-> obj cur) 0) - (set! (-> obj top) (-> obj cur)) - (set! (-> obj allocate-func) texture-page-default-allocate) - (allocate-defaults! obj) - (set! (-> obj font-palette) (allocate-vram-words! obj 64)) +(defmethod initialize! texture-pool ((this texture-pool)) + (set! (-> this cur) 0) + (set! (-> this top) (-> this cur)) + (set! (-> this allocate-func) texture-page-default-allocate) + (allocate-defaults! this) + (set! (-> this font-palette) (allocate-vram-words! this 64)) (dotimes (v1-6 32) - (set! (-> obj common-page v1-6) (the-as texture-page 0)) + (set! (-> this common-page v1-6) (the-as texture-page 0)) ) - (set! (-> obj common-page-mask) 0) + (set! (-> this common-page-mask) 0) (dotimes (v1-9 160) - (set! (-> obj ids v1-9) (the-as uint 0)) + (set! (-> this ids v1-9) (the-as uint 0)) ) - obj + this ) ;; definition for method 10 of type texture-page -(defmethod get-leftover-block-count texture-page ((obj texture-page) (segment-count int) (additional-size int)) +(defmethod get-leftover-block-count texture-page ((this texture-page) (segment-count int) (additional-size int)) (let ((v1-0 additional-size)) (dotimes (a2-1 segment-count) - (+! v1-0 (-> obj segment a2-1 size)) + (+! v1-0 (-> this segment a2-1 size)) ) (logand (/ v1-0 64) 63) ) ) ;; definition for method 10 of type texture-pool -(defmethod print-usage texture-pool ((obj texture-pool)) +(defmethod print-usage texture-pool ((this texture-pool)) (format #t "--------------------~%") (format #t "texture pool ~DK - ~DK (~DK used, ~DK free)~%" - (/ (-> obj top) 256) - (/ (-> obj cur) 256) - (/ (- (-> obj cur) (-> obj top)) 256) - (/ (- #xfa000 (-> obj cur)) 256) + (/ (-> this top) 256) + (/ (-> this cur) 256) + (/ (- (-> this cur) (-> this top)) 256) + (/ (- #xfa000 (-> this cur)) 256) ) (format #t "--------------------~%") - obj + this ) ;; definition for method 16 of type texture-pool -(defmethod allocate-segment! texture-pool ((obj texture-pool) (segment texture-pool-segment) (size int)) +(defmethod allocate-segment! texture-pool ((this texture-pool) (segment texture-pool-segment) (size int)) (set! (-> segment size) (the-as uint size)) - (set! (-> segment dest) (the-as uint (allocate-vram-words! obj size))) + (set! (-> segment dest) (the-as uint (allocate-vram-words! this size))) segment ) ;; definition for method 12 of type texture-pool ;; INFO: Return type mismatch int vs none. -(defmethod allocate-defaults! texture-pool ((obj texture-pool)) - (allocate-segment! obj (-> obj segment-common) #x1c000) - (allocate-segment! obj (-> obj segment-near) #x62000) - (set! *sky-base-vram-word* (allocate-vram-words! obj #x7000)) +(defmethod allocate-defaults! texture-pool ((this texture-pool)) + (allocate-segment! this (-> this segment-common) #x1c000) + (allocate-segment! this (-> this segment-near) #x62000) + (set! *sky-base-vram-word* (allocate-vram-words! this #x7000)) (set! *sky-base-block* (/ *sky-base-vram-word* 64)) (set! *sky-base-page* (sar *sky-base-vram-word* 11)) (set! *eyes-base-vram-word* (+ *sky-base-vram-word* 6144)) @@ -741,9 +741,9 @@ ) ;; definition for method 9 of type texture-page -(defmethod remove-from-heap texture-page ((obj texture-page) (seg kheap)) - (set! (-> seg current) (-> obj segment 0 block-data)) - obj +(defmethod remove-from-heap texture-page ((this texture-page) (seg kheap)) + (set! (-> seg current) (-> this segment 0 block-data)) + this ) ;; definition for function texture-page-default-allocate @@ -1305,7 +1305,7 @@ ;; definition for method 13 of type texture-pool ;; INFO: Return type mismatch int vs none. -(defmethod login-level-textures texture-pool ((obj texture-pool) (level level) (max-page-kind int) (id-array (pointer texture-id))) +(defmethod login-level-textures texture-pool ((this texture-pool) (level level) (max-page-kind int) (id-array (pointer texture-id))) (dotimes (page-idx 9) (set! (-> level texture-page page-idx) #f) ) @@ -1353,10 +1353,10 @@ ) ) ) - (let ((overflow-bits (texture-page-size-check obj level #t))) + (let ((overflow-bits (texture-page-size-check this level #t))) (when (nonzero? overflow-bits) (format #t "-------------------- tpage overflow error #x~X~%" overflow-bits) - (texture-page-size-check obj level #f) + (texture-page-size-check this level #f) (format #t "--------------------~%") ) ) @@ -1366,7 +1366,7 @@ ;; definition for method 14 of type texture-pool ;; INFO: Return type mismatch int vs none. -(defmethod add-tex-to-dma! texture-pool ((obj texture-pool) (level level) (tex-page-kind int)) +(defmethod add-tex-to-dma! texture-pool ((this texture-pool) (level level) (tex-page-kind int)) (when (zero? tex-page-kind) (let ((tfrag-page (-> level texture-page 0)) (tfrag-bucket (if (zero? (-> level index)) @@ -1391,7 +1391,7 @@ (set! (-> level upload-size 0) 0) (if (< distance 81920.0) (+! (-> level upload-size 0) - (upload-vram-pages obj (-> obj segment-near) tfrag-page 2 (the-as bucket-id tfrag-bucket)) + (upload-vram-pages this (-> this segment-near) tfrag-page 2 (the-as bucket-id tfrag-bucket)) ) ) (cond @@ -1399,12 +1399,12 @@ ) ((< 102400.0 distance) (+! (-> level upload-size 0) - (upload-vram-pages obj (-> obj segment-common) tfrag-page 0 (the-as bucket-id tfrag-bucket)) + (upload-vram-pages this (-> this segment-common) tfrag-page 0 (the-as bucket-id tfrag-bucket)) ) ) (else (+! (-> level upload-size 0) - (upload-vram-pages obj (-> obj segment-common) tfrag-page -2 (the-as bucket-id tfrag-bucket)) + (upload-vram-pages this (-> this segment-common) tfrag-page -2 (the-as bucket-id tfrag-bucket)) ) ) ) @@ -1422,8 +1422,8 @@ ) ) (set! (-> level upload-size 1) (upload-vram-pages-pris - obj - (-> obj segment-common) + this + (-> this segment-common) pris-page (the-as bucket-id pris-bucket) (the-as int (-> level texture-mask 7)) @@ -1460,7 +1460,7 @@ ) ) (set! (-> level upload-size 2) - (upload-vram-pages obj (-> obj segment-common) shrub-page shrub-mode (the-as bucket-id shrub-bucket)) + (upload-vram-pages this (-> this segment-common) shrub-page shrub-mode (the-as bucket-id shrub-bucket)) ) ) ) @@ -1491,13 +1491,13 @@ ) (let ((alpha-dest-chunk (shr (-> alpha-page segment 0 dest) 12))) (when (movie?) - (set! (-> obj ids alpha-dest-chunk) (the-as uint 0)) - (set! (-> obj ids (+ alpha-dest-chunk 1)) (the-as uint 0)) + (set! (-> this ids alpha-dest-chunk) (the-as uint 0)) + (set! (-> this ids (+ alpha-dest-chunk 1)) (the-as uint 0)) 0 ) ) (set! (-> level upload-size 3) - (upload-vram-pages obj (-> obj segment-common) alpha-page alpha-mode (the-as bucket-id alpha-bucket)) + (upload-vram-pages this (-> this segment-common) alpha-page alpha-mode (the-as bucket-id alpha-bucket)) ) ) ) @@ -1513,8 +1513,8 @@ ) ) (set! (-> level upload-size 4) (upload-vram-pages-pris - obj - (-> obj segment-common) + this + (-> this segment-common) water-page (the-as bucket-id water-bucket) (the-as int (-> level texture-mask 8)) @@ -1529,11 +1529,11 @@ ) ;; definition for method 21 of type texture-pool -(defmethod upload-one-common! texture-pool ((obj texture-pool) (arg0 level)) +(defmethod upload-one-common! texture-pool ((this texture-pool) (arg0 level)) (dotimes (v1-0 32) - (let ((a2-0 (-> obj common-page v1-0))) - (when (and (nonzero? a2-0) (logtest? (-> obj common-page-mask) (ash 1 v1-0))) - (upload-vram-pages obj (-> obj segment-common) a2-0 -2 (bucket-id common-page-tex)) + (let ((a2-0 (-> this common-page v1-0))) + (when (and (nonzero? a2-0) (logtest? (-> this common-page-mask) (ash 1 v1-0))) + (upload-vram-pages this (-> this segment-common) a2-0 -2 (bucket-id common-page-tex)) (return #f) ) ) @@ -1543,9 +1543,9 @@ ;; definition for method 11 of type level ;; INFO: Return type mismatch int vs none. -(defmethod add-irq-to-tex-buckets! level ((obj level)) +(defmethod add-irq-to-tex-buckets! level ((this level)) (cond - ((zero? (-> obj index)) + ((zero? (-> this index)) (let* ((v1-4 (-> *display* frames (-> *display* on-screen) frame global-buf)) (a2-0 (-> v1-4 base)) ) @@ -1767,13 +1767,13 @@ ;; definition for method 14 of type texture-page ;; INFO: Return type mismatch int vs none. -(defmethod upload-now! texture-page ((obj texture-page) (arg0 int)) +(defmethod upload-now! texture-page ((this texture-page) (arg0 int)) (let ((gp-0 *txt-dma-list*)) (let ((v1-0 gp-0)) (set! (-> v1-0 base) (-> v1-0 data)) (set! (-> v1-0 end) (&-> v1-0 data-buffer (-> v1-0 allocated-length))) ) - (add-to-dma-buffer obj gp-0 arg0) + (add-to-dma-buffer this gp-0 arg0) (let* ((v1-3 gp-0) (a0-1 (the-as object (-> v1-3 base))) ) @@ -1810,7 +1810,7 @@ ) ;; definition for method 13 of type texture-page -(defmethod add-to-dma-buffer texture-page ((obj texture-page) (dma-buff dma-buffer) (mode int)) +(defmethod add-to-dma-buffer texture-page ((this texture-page) (dma-buff dma-buffer) (mode int)) (local-vars (total-size int)) (let ((v1-0 mode)) (set! total-size (cond @@ -1818,21 +1818,21 @@ 0 ) ((= v1-0 -2) - (the-as int (+ (-> obj segment 0 size) (-> obj segment 1 size))) + (the-as int (+ (-> this segment 0 size) (-> this segment 1 size))) ) ((= v1-0 -1) - (the-as int (-> obj size)) + (the-as int (-> this size)) ) (else - (the-as int (-> obj segment mode size)) + (the-as int (-> this segment mode size)) ) ) ) ) (let* ((start-segment (max 0 mode)) (chunk-count (* (/ (+ (/ total-size 64) 63) 64) 32)) - (current-dest (shr (-> obj segment start-segment dest) 6)) - (current-data (-> obj segment start-segment block-data)) + (current-dest (shr (-> this segment start-segment dest) 6)) + (current-data (-> this segment start-segment block-data)) ) (while (> chunk-count 0) (let ((chunks-now (min 2048 chunk-count))) @@ -2019,10 +2019,10 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; INFO: Return type mismatch int vs none. -(defmethod setup-font-texture! texture-pool ((obj texture-pool)) +(defmethod setup-font-texture! texture-pool ((this texture-pool)) (local-vars (heap-before-font-tex int) (clut-dest-addr int)) - (let ((font-clut (-> obj font-palette))) - (set! heap-before-font-tex (-> obj cur)) + (let ((font-clut (-> this font-palette))) + (set! heap-before-font-tex (-> this cur)) (set! clut-dest-addr (/ font-clut 64)) (set! *font-texture* (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x4fe))) (let ((main-font-tx @@ -2123,9 +2123,9 @@ (dma-sync (the-as pointer #x10009000) 0 0) (if (and main-font-tx (-> main-font-tx page) - (= (-> obj cur) (+ heap-before-font-tex (-> main-font-tx page size))) + (= (-> this cur) (+ heap-before-font-tex (-> main-font-tx page size))) ) - (set! (-> obj cur) heap-before-font-tex) + (set! (-> this cur) heap-before-font-tex) (format 0 "ERROR: could not resize heap to remove gamefont.~%") ) ) @@ -2136,32 +2136,32 @@ ;; definition for method 5 of type texture-page-dir ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of texture-page-dir ((obj texture-page-dir)) - (the-as int (+ (-> texture-page-dir size) (* 12 (+ (-> obj length) -1)))) +(defmethod asize-of texture-page-dir ((this texture-page-dir)) + (the-as int (+ (-> texture-page-dir size) (* 12 (+ (-> this length) -1)))) ) ;; definition for method 4 of type texture-page-dir -(defmethod length texture-page-dir ((obj texture-page-dir)) - (-> obj length) +(defmethod length texture-page-dir ((this texture-page-dir)) + (-> this length) ) ;; definition for method 7 of type texture-page-dir ;; INFO: Return type mismatch texture-page-dir vs none. -(defmethod relocate texture-page-dir ((obj texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) - (set! *texture-page-dir* obj) +(defmethod relocate texture-page-dir ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) + (set! *texture-page-dir* this) (none) ) ;; definition for method 12 of type texture-page ;; INFO: Return type mismatch texture-page vs none. -(defmethod relocate-dests! texture-page ((obj texture-page) (new-dest int) (seg-id int)) +(defmethod relocate-dests! texture-page ((this texture-page) (new-dest int) (seg-id int)) (let ((v1-0 (shr new-dest 6)) - (dst-block (shr (-> obj segment seg-id dest) 6)) + (dst-block (shr (-> this segment seg-id dest) 6)) ) (when (!= v1-0 dst-block) - (dotimes (tex-id (-> obj length)) - (when (-> obj data tex-id) - (let* ((tex (-> obj data tex-id)) + (dotimes (tex-id (-> this length)) + (when (-> this data tex-id) + (let* ((tex (-> this data tex-id)) (num-mips (-> tex num-mips)) ) (if (zero? seg-id) @@ -2183,7 +2183,7 @@ ) ) ) - (set! (-> obj segment seg-id dest) (the-as uint new-dest)) + (set! (-> this segment seg-id dest) (the-as uint new-dest)) ) ) (none) @@ -2191,39 +2191,39 @@ ;; definition for method 7 of type texture-page ;; INFO: Return type mismatch texture-page vs none. -(defmethod relocate texture-page ((obj texture-page) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate texture-page ((this texture-page) (arg0 kheap) (arg1 (pointer uint8))) (local-vars (s4-0 texture-page-dir-entry)) (cond - ((or (not obj) (not (file-info-correct-version? (-> obj info) (file-kind tpage) 0))) - (set! obj (the-as texture-page #f)) + ((or (not this) (not (file-info-correct-version? (-> this info) (file-kind tpage) 0))) + (set! this (the-as texture-page #f)) ) ((begin (let ((v1-2 (-> *level* loading-level))) (when v1-2 - (set! (-> v1-2 loaded-texture-page (-> v1-2 loaded-texture-page-count)) obj) + (set! (-> v1-2 loaded-texture-page (-> v1-2 loaded-texture-page-count)) this) (+! (-> v1-2 loaded-texture-page-count) 1) ) ) - (set! (-> obj segment 1 dest) (-> obj segment 0 size)) - (set! (-> obj segment 2 dest) (+ (-> obj segment 0 size) (-> obj segment 1 size))) - (let ((a3-0 (-> obj id))) + (set! (-> this segment 1 dest) (-> this segment 0 size)) + (set! (-> this segment 2 dest) (+ (-> this segment 0 size) (-> this segment 1 size))) + (let ((a3-0 (-> this id))) (set! s4-0 (-> *texture-page-dir* entries a3-0)) (set! (-> *texture-relocate-later* memcpy) #f) - ((-> *texture-pool* allocate-func) *texture-pool* obj arg0 (the-as int a3-0)) + ((-> *texture-pool* allocate-func) *texture-pool* this arg0 (the-as int a3-0)) ) (not (-> *texture-relocate-later* memcpy)) ) - (set! (-> s4-0 page) obj) + (set! (-> s4-0 page) this) (if (not (-> s4-0 link)) (set! (-> s4-0 link) - (the-as texture-link (malloc 'loading-level (* (max (-> s4-0 length) (-> obj length)) 4))) + (the-as texture-link (malloc 'loading-level (* (max (-> s4-0 length) (-> this length)) 4))) ) ) ) (else (let ((v1-19 *texture-relocate-later*)) (set! (-> v1-19 entry) s4-0) - (set! (-> v1-19 page) obj) + (set! (-> v1-19 page) this) ) ) ) @@ -2281,7 +2281,7 @@ ) ;; definition for method 20 of type texture-pool -(defmethod unload! texture-pool ((obj texture-pool) (arg0 texture-page)) +(defmethod unload! texture-pool ((this texture-pool) (arg0 texture-page)) (local-vars (a0-2 int)) (let ((v1-0 *texture-page-dir*)) (dotimes (a0-1 (-> v1-0 length)) @@ -2323,13 +2323,13 @@ ) ;; definition for method 9 of type texture-page-dir -(defmethod unlink-textures-in-heap! texture-page-dir ((obj texture-page-dir) (heap kheap)) +(defmethod unlink-textures-in-heap! texture-page-dir ((this texture-page-dir) (heap kheap)) (local-vars (dist-past-end uint)) (let ((mem-start (-> heap base)) (mem-end (-> heap top-base)) ) - (dotimes (entry-idx (-> obj length)) - (let* ((entry (-> obj entries entry-idx)) + (dotimes (entry-idx (-> this length)) + (let* ((entry (-> this entries entry-idx)) (tex-page (-> entry page)) (link-arr (-> entry link next)) (tex-count (min (-> tex-page length) (-> entry length))) @@ -2592,9 +2592,9 @@ ) ;; definition for method 3 of type texture-page-dir -(defmethod inspect texture-page-dir ((obj texture-page-dir)) - (texture-page-dir-inspect obj #f) - obj +(defmethod inspect texture-page-dir ((this texture-page-dir)) + (texture-page-dir-inspect this #f) + this ) ;; definition for symbol *texture-pool*, type texture-pool diff --git a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-h_REF.gc index 81fa8968d1..3dd51cb4e4 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-h_REF.gc @@ -12,11 +12,11 @@ ) ;; definition for method 3 of type tfragment-stats -(defmethod inspect tfragment-stats ((obj tfragment-stats)) - (format #t "[~8x] ~A~%" obj 'tfragment-stats) - (format #t "~Tnum-tris[4] @ #x~X~%" (-> obj num-tris)) - (format #t "~Tnum-dverts[4] @ #x~X~%" (-> obj num-dverts)) - obj +(defmethod inspect tfragment-stats ((this tfragment-stats)) + (format #t "[~8x] ~A~%" this 'tfragment-stats) + (format #t "~Tnum-tris[4] @ #x~X~%" (-> this num-tris)) + (format #t "~Tnum-dverts[4] @ #x~X~%" (-> this num-dverts)) + this ) ;; definition of type tfragment-debug-data @@ -30,11 +30,11 @@ ) ;; definition for method 3 of type tfragment-debug-data -(defmethod inspect tfragment-debug-data ((obj tfragment-debug-data)) - (format #t "[~8x] ~A~%" obj 'tfragment-debug-data) - (format #t "~Tstats: #~%" (-> obj stats)) - (format #t "~Tdebug-lines: ~A~%" (-> obj debug-lines)) - obj +(defmethod inspect tfragment-debug-data ((this tfragment-debug-data)) + (format #t "[~8x] ~A~%" this 'tfragment-debug-data) + (format #t "~Tstats: #~%" (-> this stats)) + (format #t "~Tdebug-lines: ~A~%" (-> this debug-lines)) + this ) ;; definition of type generic-tfragment @@ -47,10 +47,10 @@ ) ;; definition for method 3 of type generic-tfragment -(defmethod inspect generic-tfragment ((obj generic-tfragment)) - (format #t "[~8x] ~A~%" obj 'generic-tfragment) - (format #t "~Tdummy: ~D~%" (-> obj dummy)) - obj +(defmethod inspect generic-tfragment ((this generic-tfragment)) + (format #t "[~8x] ~A~%" this 'generic-tfragment) + (format #t "~Tdummy: ~D~%" (-> this dummy)) + this ) ;; definition of type tfragment @@ -83,31 +83,31 @@ ) ;; definition for method 3 of type tfragment -(defmethod inspect tfragment ((obj tfragment)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tcolor-index: ~D~%" (-> obj color-index)) - (format #t "~Tdebug-data: #~%" (-> obj debug-data)) - (format #t "~Tcolor-indices: #x~X~%" (-> obj color-indices)) - (format #t "~Tcolors: #x~X~%" (-> obj color-indices)) - (format #t "~Tdma-chain[3] @ #x~X~%" (-> obj dma-chain)) - (format #t "~Tdma-common: #x~X~%" (-> obj dma-common)) - (format #t "~Tdma-level-0: #x~X~%" (-> obj dma-common)) - (format #t "~Tdma-base: #x~X~%" (-> obj dma-base)) - (format #t "~Tdma-level-1: #x~X~%" (-> obj dma-level-1)) - (format #t "~Tdma-qwc[4] @ #x~X~%" (-> obj dma-qwc)) - (format #t "~Tshader: #x~X~%" (-> obj shader)) - (format #t "~Tnum-shaders: ~D~%" (-> obj num-shaders)) - (format #t "~Tnum-base-colors: ~D~%" (-> obj num-base-colors)) - (format #t "~Tnum-level0-colors: ~D~%" (-> obj num-level0-colors)) - (format #t "~Tnum-level1-colors: ~D~%" (-> obj num-level1-colors)) - (format #t "~Tcolor-offset: ~D~%" (-> obj color-offset)) - (format #t "~Tcolor-count: ~D~%" (-> obj color-count)) - (format #t "~Tpad0: ~D~%" (-> obj pad0)) - (format #t "~Tpad1: ~D~%" (-> obj pad1)) - (format #t "~Tgeneric: #~%" (-> obj generic)) - obj +(defmethod inspect tfragment ((this tfragment)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tcolor-index: ~D~%" (-> this color-index)) + (format #t "~Tdebug-data: #~%" (-> this debug-data)) + (format #t "~Tcolor-indices: #x~X~%" (-> this color-indices)) + (format #t "~Tcolors: #x~X~%" (-> this color-indices)) + (format #t "~Tdma-chain[3] @ #x~X~%" (-> this dma-chain)) + (format #t "~Tdma-common: #x~X~%" (-> this dma-common)) + (format #t "~Tdma-level-0: #x~X~%" (-> this dma-common)) + (format #t "~Tdma-base: #x~X~%" (-> this dma-base)) + (format #t "~Tdma-level-1: #x~X~%" (-> this dma-level-1)) + (format #t "~Tdma-qwc[4] @ #x~X~%" (-> this dma-qwc)) + (format #t "~Tshader: #x~X~%" (-> this shader)) + (format #t "~Tnum-shaders: ~D~%" (-> this num-shaders)) + (format #t "~Tnum-base-colors: ~D~%" (-> this num-base-colors)) + (format #t "~Tnum-level0-colors: ~D~%" (-> this num-level0-colors)) + (format #t "~Tnum-level1-colors: ~D~%" (-> this num-level1-colors)) + (format #t "~Tcolor-offset: ~D~%" (-> this color-offset)) + (format #t "~Tcolor-count: ~D~%" (-> this color-count)) + (format #t "~Tpad0: ~D~%" (-> this pad0)) + (format #t "~Tpad1: ~D~%" (-> this pad1)) + (format #t "~Tgeneric: #~%" (-> this generic)) + this ) ;; definition of type drawable-inline-array-tfrag @@ -193,13 +193,13 @@ ) ;; definition for method 3 of type tfrag-dists -(defmethod inspect tfrag-dists ((obj tfrag-dists)) - (format #t "[~8x] ~A~%" obj 'tfrag-dists) - (format #t "~Tdata[16] @ #x~X~%" (-> obj k0s)) - (format #t "~Tvector[4] @ #x~X~%" (-> obj k0s)) - (format #t "~Tk0s[2] @ #x~X~%" (-> obj k0s)) - (format #t "~Tk1s[2] @ #x~X~%" (-> obj k1s)) - obj +(defmethod inspect tfrag-dists ((this tfrag-dists)) + (format #t "[~8x] ~A~%" this 'tfrag-dists) + (format #t "~Tdata[16] @ #x~X~%" (-> this k0s)) + (format #t "~Tvector[4] @ #x~X~%" (-> this k0s)) + (format #t "~Tk0s[2] @ #x~X~%" (-> this k0s)) + (format #t "~Tk1s[2] @ #x~X~%" (-> this k1s)) + this ) ;; definition of type tfrag-data @@ -226,24 +226,24 @@ ) ;; definition for method 3 of type tfrag-data -(defmethod inspect tfrag-data ((obj tfrag-data)) - (format #t "[~8x] ~A~%" obj 'tfrag-data) - (format #t "~Tdata[56] @ #x~X~%" (-> obj fog)) - (format #t "~Tvector[14] @ #x~X~%" (-> obj fog)) - (format #t "~Tfog: #~%" (-> obj fog)) - (format #t "~Tval: #~%" (-> obj val)) - (format #t "~Tstrgif: #~%" (-> obj strgif)) - (format #t "~Tfangif: #~%" (-> obj fangif)) - (format #t "~Tadgif: #~%" (-> obj adgif)) - (format #t "~Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~Tinvh-scale: #~%" (-> obj invh-scale)) - (format #t "~Tambient: #~%" (-> obj ambient)) - (format #t "~Tguard: #~%" (-> obj guard)) - (format #t "~Tdists: #~%" (-> obj dists)) - (format #t "~Tk0s[2] @ #x~X~%" (-> obj dists)) - (format #t "~Tk1s[2] @ #x~X~%" (-> obj dists k1s)) - obj +(defmethod inspect tfrag-data ((this tfrag-data)) + (format #t "[~8x] ~A~%" this 'tfrag-data) + (format #t "~Tdata[56] @ #x~X~%" (-> this fog)) + (format #t "~Tvector[14] @ #x~X~%" (-> this fog)) + (format #t "~Tfog: #~%" (-> this fog)) + (format #t "~Tval: #~%" (-> this val)) + (format #t "~Tstrgif: #~%" (-> this strgif)) + (format #t "~Tfangif: #~%" (-> this fangif)) + (format #t "~Tadgif: #~%" (-> this adgif)) + (format #t "~Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~Tinvh-scale: #~%" (-> this invh-scale)) + (format #t "~Tambient: #~%" (-> this ambient)) + (format #t "~Tguard: #~%" (-> this guard)) + (format #t "~Tdists: #~%" (-> this dists)) + (format #t "~Tk0s[2] @ #x~X~%" (-> this dists)) + (format #t "~Tk1s[2] @ #x~X~%" (-> this dists k1s)) + this ) ;; definition of type tfrag-control @@ -275,29 +275,29 @@ ) ;; definition for method 3 of type tfrag-control -(defmethod inspect tfrag-control ((obj tfrag-control)) - (format #t "[~8x] ~A~%" obj 'tfrag-control) - (format #t "~Tnum-base-points: ~D~%" (-> obj num-base-points)) - (format #t "~Tnum-shared-base-points: ~D~%" (-> obj num-shared-base-points)) - (format #t "~Tnum-level0-points: ~D~%" (-> obj num-level0-points)) - (format #t "~Tnum-shared-level0-points: ~D~%" (-> obj num-shared-level0-points)) - (format #t "~Tnum-level1-points: ~D~%" (-> obj num-level1-points)) - (format #t "~Tnum-shared-level1-points: ~D~%" (-> obj num-shared-level1-points)) - (format #t "~Tptr-vtxdata: ~D~%" (-> obj ptr-vtxdata)) - (format #t "~Tptr-base-points: ~D~%" (-> obj ptr-base-points)) - (format #t "~Tptr-shared-base-points: ~D~%" (-> obj ptr-shared-base-points)) - (format #t "~Tptr-level0-points: ~D~%" (-> obj ptr-level0-points)) - (format #t "~Tptr-shared-level0-points: ~D~%" (-> obj ptr-shared-level0-points)) - (format #t "~Tptr-level1-points: ~D~%" (-> obj ptr-level1-points)) - (format #t "~Tptr-shared-level1-points: ~D~%" (-> obj ptr-shared-level1-points)) - (format #t "~Tptr-draw-points: ~D~%" (-> obj ptr-draw-points)) - (format #t "~Tptr-interpolated-0: ~D~%" (-> obj ptr-interpolated-0)) - (format #t "~Tptr-shared-interpolated-0: ~D~%" (-> obj ptr-shared-interpolated-0)) - (format #t "~Tptr-interpolated1: ~D~%" (-> obj ptr-interpolated1)) - (format #t "~Tptr-shared-interpolated1: ~D~%" (-> obj ptr-shared-interpolated1)) - (format #t "~Tptr-strip-data: ~D~%" (-> obj ptr-strip-data)) - (format #t "~Tptr-texture-data: ~D~%" (-> obj ptr-texture-data)) - obj +(defmethod inspect tfrag-control ((this tfrag-control)) + (format #t "[~8x] ~A~%" this 'tfrag-control) + (format #t "~Tnum-base-points: ~D~%" (-> this num-base-points)) + (format #t "~Tnum-shared-base-points: ~D~%" (-> this num-shared-base-points)) + (format #t "~Tnum-level0-points: ~D~%" (-> this num-level0-points)) + (format #t "~Tnum-shared-level0-points: ~D~%" (-> this num-shared-level0-points)) + (format #t "~Tnum-level1-points: ~D~%" (-> this num-level1-points)) + (format #t "~Tnum-shared-level1-points: ~D~%" (-> this num-shared-level1-points)) + (format #t "~Tptr-vtxdata: ~D~%" (-> this ptr-vtxdata)) + (format #t "~Tptr-base-points: ~D~%" (-> this ptr-base-points)) + (format #t "~Tptr-shared-base-points: ~D~%" (-> this ptr-shared-base-points)) + (format #t "~Tptr-level0-points: ~D~%" (-> this ptr-level0-points)) + (format #t "~Tptr-shared-level0-points: ~D~%" (-> this ptr-shared-level0-points)) + (format #t "~Tptr-level1-points: ~D~%" (-> this ptr-level1-points)) + (format #t "~Tptr-shared-level1-points: ~D~%" (-> this ptr-shared-level1-points)) + (format #t "~Tptr-draw-points: ~D~%" (-> this ptr-draw-points)) + (format #t "~Tptr-interpolated-0: ~D~%" (-> this ptr-interpolated-0)) + (format #t "~Tptr-shared-interpolated-0: ~D~%" (-> this ptr-shared-interpolated-0)) + (format #t "~Tptr-interpolated1: ~D~%" (-> this ptr-interpolated1)) + (format #t "~Tptr-shared-interpolated1: ~D~%" (-> this ptr-shared-interpolated1)) + (format #t "~Tptr-strip-data: ~D~%" (-> this ptr-strip-data)) + (format #t "~Tptr-texture-data: ~D~%" (-> this ptr-texture-data)) + this ) ;; definition of type tfrag-stats @@ -325,25 +325,25 @@ ) ;; definition for method 3 of type tfrag-stats -(defmethod inspect tfrag-stats ((obj tfrag-stats)) - (format #t "[~8x] ~A~%" obj 'tfrag-stats) - (format #t "~Tfrom: ~D~%" (-> obj from)) - (format #t "~Tto: ~D~%" (-> obj to)) - (format #t "~Tcnt: ~D~%" (-> obj cnt)) - (format #t "~Ttris: ~D~%" (-> obj tris)) - (format #t "~Ttfaces: ~D~%" (-> obj tfaces)) - (format #t "~Ttfrags: ~D~%" (-> obj tfrags)) - (format #t "~Tdtris: ~D~%" (-> obj dtris)) - (format #t "~Tbase-verts: ~D~%" (-> obj base-verts)) - (format #t "~Tlevel0-verts: ~D~%" (-> obj level0-verts)) - (format #t "~Tlevel1-verts: ~D~%" (-> obj level1-verts)) - (format #t "~Tdma-cnt: ~D~%" (-> obj dma-cnt)) - (format #t "~Tdma-dta: ~D~%" (-> obj dma-dta)) - (format #t "~Tdma-tex: ~D~%" (-> obj dma-tex)) - (format #t "~Tstrips: ~D~%" (-> obj strips)) - (format #t "~Tdrawpoints: ~D~%" (-> obj drawpoints)) - (format #t "~Tvif: ~D~%" (-> obj vif)) - obj +(defmethod inspect tfrag-stats ((this tfrag-stats)) + (format #t "[~8x] ~A~%" this 'tfrag-stats) + (format #t "~Tfrom: ~D~%" (-> this from)) + (format #t "~Tto: ~D~%" (-> this to)) + (format #t "~Tcnt: ~D~%" (-> this cnt)) + (format #t "~Ttris: ~D~%" (-> this tris)) + (format #t "~Ttfaces: ~D~%" (-> this tfaces)) + (format #t "~Ttfrags: ~D~%" (-> this tfrags)) + (format #t "~Tdtris: ~D~%" (-> this dtris)) + (format #t "~Tbase-verts: ~D~%" (-> this base-verts)) + (format #t "~Tlevel0-verts: ~D~%" (-> this level0-verts)) + (format #t "~Tlevel1-verts: ~D~%" (-> this level1-verts)) + (format #t "~Tdma-cnt: ~D~%" (-> this dma-cnt)) + (format #t "~Tdma-dta: ~D~%" (-> this dma-dta)) + (format #t "~Tdma-tex: ~D~%" (-> this dma-tex)) + (format #t "~Tstrips: ~D~%" (-> this strips)) + (format #t "~Tdrawpoints: ~D~%" (-> this drawpoints)) + (format #t "~Tvif: ~D~%" (-> this vif)) + this ) ;; definition of type tfrag-packet @@ -356,10 +356,10 @@ ) ;; definition for method 3 of type tfrag-packet -(defmethod inspect tfrag-packet ((obj tfrag-packet)) - (format #t "[~8x] ~A~%" obj 'tfrag-packet) - (format #t "~Ttag[2] @ #x~X~%" (-> obj tag)) - obj +(defmethod inspect tfrag-packet ((this tfrag-packet)) + (format #t "[~8x] ~A~%" this 'tfrag-packet) + (format #t "~Ttag[2] @ #x~X~%" (-> this tag)) + this ) ;; definition of type tfrag-work @@ -394,32 +394,32 @@ ) ;; definition for method 3 of type tfrag-work -(defmethod inspect tfrag-work ((obj tfrag-work)) - (format #t "[~8x] ~A~%" obj 'tfrag-work) - (format #t "~Tbase-tmpl: #~%" (-> obj base-tmpl)) - (format #t "~Tlevel-0-tmpl: #~%" (-> obj level-0-tmpl)) - (format #t "~Tcommon-tmpl: #~%" (-> obj common-tmpl)) - (format #t "~Tlevel-1-tmpl: #~%" (-> obj level-1-tmpl)) - (format #t "~Tcolor-tmpl: #~%" (-> obj color-tmpl)) - (format #t "~Tfrag-dists: #~%" (-> obj frag-dists)) - (format #t "~Tmax-dist: #~%" (-> obj max-dist)) - (format #t "~Tmin-dist: #~%" (-> obj min-dist)) - (format #t "~Tcolor-ptr: #~%" (-> obj color-ptr)) - (format #t "~Ttr-stat-tfrag: #~%" (-> obj tr-stat-tfrag)) - (format #t "~Ttr-stat-tfrag-near: #~%" (-> obj tr-stat-tfrag-near)) - (format #t "~Tvu1-enable-tfrag: ~D~%" (-> obj vu1-enable-tfrag)) - (format #t "~Tvu1-enable-tfrag-near: ~D~%" (-> obj vu1-enable-tfrag-near)) - (format #t "~Tcur-vis-bits: ~D~%" (-> obj cur-vis-bits)) - (format #t "~Tend-vis-bits: ~D~%" (-> obj end-vis-bits)) - (format #t "~Tsrc-ptr: ~D~%" (-> obj src-ptr)) - (format #t "~Tlast-call: ~D~%" (-> obj last-call)) - (format #t "~Tdma-buffer: ~A~%" (-> obj dma-buffer)) - (format #t "~Ttest-id: ~D~%" (-> obj test-id)) - (format #t "~Twait-from-spr: ~D~%" (-> obj wait-from-spr)) - (format #t "~Twait-to-spr: ~D~%" (-> obj wait-to-spr)) - (format #t "~Tnear-wait-from-spr: ~D~%" (-> obj near-wait-from-spr)) - (format #t "~Tnear-wait-to-spr: ~D~%" (-> obj near-wait-to-spr)) - obj +(defmethod inspect tfrag-work ((this tfrag-work)) + (format #t "[~8x] ~A~%" this 'tfrag-work) + (format #t "~Tbase-tmpl: #~%" (-> this base-tmpl)) + (format #t "~Tlevel-0-tmpl: #~%" (-> this level-0-tmpl)) + (format #t "~Tcommon-tmpl: #~%" (-> this common-tmpl)) + (format #t "~Tlevel-1-tmpl: #~%" (-> this level-1-tmpl)) + (format #t "~Tcolor-tmpl: #~%" (-> this color-tmpl)) + (format #t "~Tfrag-dists: #~%" (-> this frag-dists)) + (format #t "~Tmax-dist: #~%" (-> this max-dist)) + (format #t "~Tmin-dist: #~%" (-> this min-dist)) + (format #t "~Tcolor-ptr: #~%" (-> this color-ptr)) + (format #t "~Ttr-stat-tfrag: #~%" (-> this tr-stat-tfrag)) + (format #t "~Ttr-stat-tfrag-near: #~%" (-> this tr-stat-tfrag-near)) + (format #t "~Tvu1-enable-tfrag: ~D~%" (-> this vu1-enable-tfrag)) + (format #t "~Tvu1-enable-tfrag-near: ~D~%" (-> this vu1-enable-tfrag-near)) + (format #t "~Tcur-vis-bits: ~D~%" (-> this cur-vis-bits)) + (format #t "~Tend-vis-bits: ~D~%" (-> this end-vis-bits)) + (format #t "~Tsrc-ptr: ~D~%" (-> this src-ptr)) + (format #t "~Tlast-call: ~D~%" (-> this last-call)) + (format #t "~Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~Ttest-id: ~D~%" (-> this test-id)) + (format #t "~Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~Tnear-wait-from-spr: ~D~%" (-> this near-wait-from-spr)) + (format #t "~Tnear-wait-to-spr: ~D~%" (-> this near-wait-to-spr)) + this ) ;; definition of type tfrag-dma @@ -436,14 +436,14 @@ ) ;; definition for method 3 of type tfrag-dma -(defmethod inspect tfrag-dma ((obj tfrag-dma)) - (format #t "[~8x] ~A~%" obj 'tfrag-dma) - (format #t "~Tbanka[16] @ #x~X~%" (-> obj banka)) - (format #t "~Tbankb[16] @ #x~X~%" (-> obj bankb)) - (format #t "~Touta[128] @ #x~X~%" (-> obj outa)) - (format #t "~Toutb[128] @ #x~X~%" (-> obj outb)) - (format #t "~Tcolors[2048] @ #x~X~%" (-> obj colors)) - obj +(defmethod inspect tfrag-dma ((this tfrag-dma)) + (format #t "[~8x] ~A~%" this 'tfrag-dma) + (format #t "~Tbanka[16] @ #x~X~%" (-> this banka)) + (format #t "~Tbankb[16] @ #x~X~%" (-> this bankb)) + (format #t "~Touta[128] @ #x~X~%" (-> this outa)) + (format #t "~Toutb[128] @ #x~X~%" (-> this outb)) + (format #t "~Tcolors[2048] @ #x~X~%" (-> this colors)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc index ebdd11082d..ca4b12fe5f 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag-methods_REF.gc @@ -731,12 +731,12 @@ ;; definition for method 10 of type drawable-tree-tfrag ;; INFO: Return type mismatch drawable-tree-tfrag vs none. -(defmethod draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* tfrag-trees v1-1) obj) + (set! (-> *background-work* tfrag-trees v1-1) this) (set! (-> *background-work* tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* tfrag-tree-count) 1) @@ -745,12 +745,12 @@ ;; definition for method 10 of type drawable-tree-trans-tfrag ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. -(defmethod draw drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag) (arg0 drawable-tree-trans-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag) (arg0 drawable-tree-trans-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* trans-tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* trans-tfrag-trees v1-1) obj) + (set! (-> *background-work* trans-tfrag-trees v1-1) this) (set! (-> *background-work* trans-tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* trans-tfrag-tree-count) 1) @@ -759,12 +759,12 @@ ;; definition for method 10 of type drawable-tree-dirt-tfrag ;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none. -(defmethod draw drawable-tree-dirt-tfrag ((obj drawable-tree-dirt-tfrag) (arg0 drawable-tree-dirt-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-dirt-tfrag ((this drawable-tree-dirt-tfrag) (arg0 drawable-tree-dirt-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* dirt-tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* dirt-tfrag-trees v1-1) obj) + (set! (-> *background-work* dirt-tfrag-trees v1-1) this) (set! (-> *background-work* dirt-tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* dirt-tfrag-tree-count) 1) @@ -773,12 +773,12 @@ ;; definition for method 10 of type drawable-tree-ice-tfrag ;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none. -(defmethod draw drawable-tree-ice-tfrag ((obj drawable-tree-ice-tfrag) (arg0 drawable-tree-ice-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-ice-tfrag ((this drawable-tree-ice-tfrag) (arg0 drawable-tree-ice-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* ice-tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* ice-tfrag-trees v1-1) obj) + (set! (-> *background-work* ice-tfrag-trees v1-1) this) (set! (-> *background-work* ice-tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* ice-tfrag-tree-count) 1) @@ -787,12 +787,12 @@ ;; definition for method 10 of type drawable-tree-lowres-tfrag ;; INFO: Return type mismatch drawable-tree-lowres-tfrag vs none. -(defmethod draw drawable-tree-lowres-tfrag ((obj drawable-tree-lowres-tfrag) (arg0 drawable-tree-lowres-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-lowres-tfrag ((this drawable-tree-lowres-tfrag) (arg0 drawable-tree-lowres-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* lowres-tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* lowres-tfrag-trees v1-1) obj) + (set! (-> *background-work* lowres-tfrag-trees v1-1) this) (set! (-> *background-work* lowres-tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* lowres-tfrag-tree-count) 1) @@ -801,12 +801,12 @@ ;; definition for method 10 of type drawable-tree-lowres-trans-tfrag ;; INFO: Return type mismatch drawable-tree-lowres-trans-tfrag vs none. -(defmethod draw drawable-tree-lowres-trans-tfrag ((obj drawable-tree-lowres-trans-tfrag) (arg0 drawable-tree-lowres-trans-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-lowres-trans-tfrag ((this drawable-tree-lowres-trans-tfrag) (arg0 drawable-tree-lowres-trans-tfrag) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* lowres-trans-tfrag-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* lowres-trans-tfrag-trees v1-1) obj) + (set! (-> *background-work* lowres-trans-tfrag-trees v1-1) this) (set! (-> *background-work* lowres-trans-tfrag-levels v1-1) a1-5) ) (+! (-> *background-work* lowres-trans-tfrag-tree-count) 1) @@ -814,15 +814,15 @@ ) ;; definition for method 14 of type tfragment -(defmethod collect-stats tfragment ((obj tfragment)) - (stats-tfrag-asm obj) +(defmethod collect-stats tfragment ((this tfragment)) + (stats-tfrag-asm this) (none) ) ;; definition for method 14 of type drawable-tree-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-tfrag vs none. -(defmethod collect-stats drawable-tree-tfrag ((obj drawable-tree-tfrag)) +(defmethod collect-stats drawable-tree-tfrag ((this drawable-tree-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) @@ -833,8 +833,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -843,7 +843,7 @@ ;; definition for method 14 of type drawable-tree-lowres-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-lowres-tfrag vs none. -(defmethod collect-stats drawable-tree-lowres-tfrag ((obj drawable-tree-lowres-tfrag)) +(defmethod collect-stats drawable-tree-lowres-tfrag ((this drawable-tree-lowres-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask tfrag)))) (set! (-> *tfrag-work* vu1-enable-tfrag-near) @@ -854,8 +854,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -864,7 +864,7 @@ ;; definition for method 14 of type drawable-tree-trans-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. -(defmethod collect-stats drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag)) +(defmethod collect-stats drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) @@ -877,8 +877,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -887,7 +887,7 @@ ;; definition for method 14 of type drawable-tree-lowres-trans-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-lowres-trans-tfrag vs none. -(defmethod collect-stats drawable-tree-lowres-trans-tfrag ((obj drawable-tree-lowres-trans-tfrag)) +(defmethod collect-stats drawable-tree-lowres-trans-tfrag ((this drawable-tree-lowres-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) @@ -900,8 +900,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -910,7 +910,7 @@ ;; definition for method 14 of type drawable-tree-dirt-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-dirt-tfrag vs none. -(defmethod collect-stats drawable-tree-dirt-tfrag ((obj drawable-tree-dirt-tfrag)) +(defmethod collect-stats drawable-tree-dirt-tfrag ((this drawable-tree-dirt-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) @@ -923,8 +923,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -933,7 +933,7 @@ ;; definition for method 14 of type drawable-tree-ice-tfrag ;; INFO: Used lq/sq ;; INFO: Return type mismatch drawable-tree-ice-tfrag vs none. -(defmethod collect-stats drawable-tree-ice-tfrag ((obj drawable-tree-ice-tfrag)) +(defmethod collect-stats drawable-tree-ice-tfrag ((this drawable-tree-ice-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand *vu1-enable-user* (vu1-renderer-mask trans-tfrag))) @@ -946,8 +946,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) (none) @@ -955,10 +955,10 @@ ;; definition for method 14 of type drawable-inline-array-tfrag ;; INFO: Return type mismatch drawable-inline-array-tfrag vs none. -(defmethod collect-stats drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag)) +(defmethod collect-stats drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (if (vis-cull (-> s4-0 id)) (collect-stats s4-0) ) @@ -970,10 +970,10 @@ ;; definition for method 14 of type drawable-inline-array-trans-tfrag ;; INFO: Return type mismatch drawable-inline-array-trans-tfrag vs none. -(defmethod collect-stats drawable-inline-array-trans-tfrag ((obj drawable-inline-array-trans-tfrag)) +(defmethod collect-stats drawable-inline-array-trans-tfrag ((this drawable-inline-array-trans-tfrag)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask trans-tfrag)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (if (vis-cull (-> s4-0 id)) (collect-stats s4-0) ) @@ -985,10 +985,10 @@ ;; definition for method 15 of type drawable-tree-tfrag ;; INFO: Return type mismatch drawable-tree-tfrag vs none. -(defmethod debug-draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) - (dotimes (s4-0 (-> obj length)) - (let ((a1-1 (-> obj arrays s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((a1-1 (-> this arrays s4-0))) (debug-draw a1-1 a1-1 arg1) ) ) @@ -998,10 +998,10 @@ ;; definition for method 15 of type drawable-tree-trans-tfrag ;; INFO: Return type mismatch drawable-tree-trans-tfrag vs none. -(defmethod debug-draw drawable-tree-trans-tfrag ((obj drawable-tree-trans-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-tree-trans-tfrag ((this drawable-tree-trans-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tfrag)) - (dotimes (s4-0 (-> obj length)) - (let ((a1-1 (-> obj arrays s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((a1-1 (-> this arrays s4-0))) (debug-draw a1-1 a1-1 arg1) ) ) @@ -1011,9 +1011,9 @@ ;; definition for method 15 of type drawable-inline-array-tfrag ;; INFO: Return type mismatch drawable-inline-array-tfrag vs none. -(defmethod debug-draw drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj data s4-0))) +(defmethod debug-draw drawable-inline-array-tfrag ((this drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this data s4-0))) (if (vis-cull (-> s3-0 id)) (debug-draw s3-0 s3-0 arg1) ) @@ -1023,8 +1023,8 @@ ) ;; definition for method 15 of type tfragment -(defmethod debug-draw tfragment ((obj tfragment) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw tfragment ((this tfragment) (arg0 drawable) (arg1 display-frame)) (-> arg1 global-buf) - (edge-debug-lines (-> obj debug-data debug-lines)) + (edge-debug-lines (-> this debug-data debug-lines)) (none) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc index acf70945ca..5c3c251c70 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tfrag/tfrag_REF.gc @@ -2,64 +2,64 @@ (in-package goal) ;; definition for method 9 of type tfragment -(defmethod login tfragment ((obj tfragment)) - (dotimes (s5-0 (the-as int (-> obj num-shaders))) - (adgif-shader-login-no-remap (-> obj shader s5-0)) +(defmethod login tfragment ((this tfragment)) + (dotimes (s5-0 (the-as int (-> this num-shaders))) + (adgif-shader-login-no-remap (-> this shader s5-0)) ) - obj + this ) ;; definition for method 8 of type tfragment -(defmethod mem-usage tfragment ((obj tfragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage tfragment ((this tfragment) (arg0 memory-usage-block) (arg1 int)) (when (logtest? arg1 2) (+! (-> arg0 data 19 count) 1) - (let ((v1-6 (+ (-> obj num-base-colors) (-> obj num-level0-colors) (-> obj num-level1-colors)))) + (let ((v1-6 (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors)))) (+! (-> arg0 data 19 used) v1-6) (+! (-> arg0 data 19 total) (logand -4 (+ v1-6 3))) ) - (set! obj obj) + (set! this this) (goto cfg-16) ) (let ((s4-0 1)) (set! (-> arg0 length) (max (-> arg0 length) (+ s4-0 8))) (set! (-> arg0 data s4-0 name) (symbol->string 'tfragment)) (+! (-> arg0 data s4-0 count) 1) - (let ((v1-22 (asize-of obj))) + (let ((v1-22 (asize-of this))) (+! (-> arg0 data s4-0 used) v1-22) (+! (-> arg0 data s4-0 total) (logand -16 (+ v1-22 15))) ) (set! (-> arg0 data (+ s4-0 1) name) "tfragment-base") (+! (-> arg0 data (+ s4-0 1) count) 1) - (let ((v1-33 (* (-> obj dma-qwc 0) 16))) + (let ((v1-33 (* (-> this dma-qwc 0) 16))) (+! (-> arg0 data (+ s4-0 1) used) v1-33) (+! (-> arg0 data (+ s4-0 1) total) v1-33) ) (set! (-> arg0 data (+ s4-0 2) name) "tfragment-common") (+! (-> arg0 data (+ s4-0 2) count) 1) - (let ((v1-43 (* (- (-> obj dma-qwc 1) (-> obj dma-qwc 0)) 16))) + (let ((v1-43 (* (- (-> this dma-qwc 1) (-> this dma-qwc 0)) 16))) (+! (-> arg0 data (+ s4-0 2) used) v1-43) (+! (-> arg0 data (+ s4-0 2) total) v1-43) ) (set! (-> arg0 data (+ s4-0 3) name) "tfragment-level0") - (when (nonzero? (-> obj num-level0-colors)) + (when (nonzero? (-> this num-level0-colors)) (+! (-> arg0 data (+ s4-0 3) count) 1) - (let ((v1-55 (* (- (-> obj dma-qwc 2) (-> obj dma-qwc 0)) 16))) + (let ((v1-55 (* (- (-> this dma-qwc 2) (-> this dma-qwc 0)) 16))) (+! (-> arg0 data (+ s4-0 3) used) v1-55) (+! (-> arg0 data (+ s4-0 3) total) v1-55) ) ) (set! (-> arg0 data (+ s4-0 4) name) "tfragment-level1") - (when (not (or (= (-> obj dma-level-1) (-> obj dma-common)) - (= (-> obj dma-level-1) (-> obj dma-base)) - (zero? (-> obj num-level1-colors)) + (when (not (or (= (-> this dma-level-1) (-> this dma-common)) + (= (-> this dma-level-1) (-> this dma-base)) + (zero? (-> this num-level1-colors)) ) ) (+! (-> arg0 data (+ s4-0 4) count) 1) (let ((v1-70 - (* (- (-> obj dma-qwc 3) + (* (- (-> this dma-qwc 3) (the-as uint - (- (/ (the-as int (- (-> obj dma-level-1) (-> obj dma-common))) 16) (the-as int (-> obj dma-qwc 0))) + (- (/ (the-as int (- (-> this dma-level-1) (-> this dma-common))) 16) (the-as int (-> this dma-qwc 0))) ) ) 16 @@ -75,7 +75,7 @@ (let ((v1-79 (if (logtest? arg1 1) 0 - (the-as int (* (+ (-> obj num-base-colors) (-> obj num-level0-colors) (-> obj num-level1-colors)) 2)) + (the-as int (* (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors)) 2)) ) ) ) @@ -85,30 +85,30 @@ (set! (-> arg0 data (+ s4-0 6) name) "tfragment-debug") ) (label cfg-16) - obj + this ) ;; definition for method 3 of type drawable-inline-array-tfrag -(defmethod inspect drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) ;; definition for method 9 of type drawable-inline-array-tfrag -(defmethod login drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) ;; definition for method 8 of type drawable-inline-array-tfrag -(defmethod mem-usage drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-tfrag ((this drawable-inline-array-tfrag) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -116,40 +116,40 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 8 of type drawable-tree-tfrag -(defmethod mem-usage drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 0 used) v1-6) (+! (-> arg0 data 0 total) (logand -16 (+ v1-6 15))) ) - (when (nonzero? (-> obj time-of-day-pal)) + (when (nonzero? (-> this time-of-day-pal)) (set! (-> arg0 length) (max 9 (-> arg0 length))) (set! (-> arg0 data 8 name) "tfragment-pal") (+! (-> arg0 data 8 count) 1) - (let ((v1-18 (asize-of (-> obj time-of-day-pal)))) + (let ((v1-18 (asize-of (-> this time-of-day-pal)))) (+! (-> arg0 data 8 used) v1-18) (+! (-> arg0 data 8 total) (logand -16 (+ v1-18 15))) ) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj arrays s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this arrays s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 5 of type drawable-inline-array-tfrag ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag)) - (the-as int (+ (-> drawable-inline-array-tfrag size) (* (+ (-> obj length) -1) 64))) +(defmethod asize-of drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) + (the-as int (+ (-> drawable-inline-array-tfrag size) (* (+ (-> this length) -1) 64))) ) ;; definition for symbol *tfrag-display-stats*, type symbol diff --git a/test/decompiler/reference/jak1/engine/gfx/generic/generic-tie-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/generic-tie-h_REF.gc similarity index 54% rename from test/decompiler/reference/jak1/engine/gfx/generic/generic-tie-h_REF.gc rename to test/decompiler/reference/jak1/engine/gfx/tie/generic-tie-h_REF.gc index 410f65b449..41d516a160 100644 --- a/test/decompiler/reference/jak1/engine/gfx/generic/generic-tie-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/generic-tie-h_REF.gc @@ -15,14 +15,14 @@ ) ;; definition for method 3 of type generic-tie-instance -(defmethod inspect generic-tie-instance ((obj generic-tie-instance)) - (format #t "[~8x] ~A~%" obj 'generic-tie-instance) - (format #t "~Tmatrix-tag: #~%" (-> obj matrix-tag)) - (format #t "~Tmatrix-data[6] @ #x~X~%" (-> obj matrix-data)) - (format #t "~Tindex-tag: #~%" (-> obj index-tag)) - (format #t "~Tindices[224] @ #x~X~%" (-> obj indices)) - (format #t "~Tend-tag: #~%" (-> obj end-tag)) - obj +(defmethod inspect generic-tie-instance ((this generic-tie-instance)) + (format #t "[~8x] ~A~%" this 'generic-tie-instance) + (format #t "~Tmatrix-tag: #~%" (-> this matrix-tag)) + (format #t "~Tmatrix-data[6] @ #x~X~%" (-> this matrix-data)) + (format #t "~Tindex-tag: #~%" (-> this index-tag)) + (format #t "~Tindices[224] @ #x~X~%" (-> this indices)) + (format #t "~Tend-tag: #~%" (-> this end-tag)) + this ) ;; definition of type generic-tie-input @@ -43,18 +43,18 @@ ) ;; definition for method 3 of type generic-tie-input -(defmethod inspect generic-tie-input ((obj generic-tie-input)) - (format #t "[~8x] ~A~%" obj 'generic-tie-input) - (format #t "~Tpalette-tag: #~%" (-> obj palette-tag)) - (format #t "~Tpalette[128] @ #x~X~%" (-> obj palette)) - (format #t "~Tmodel-tag: #~%" (-> obj model-tag)) - (format #t "~Tmodel[146] @ #x~X~%" (-> obj model)) - (format #t "~Tmatrix-tag: #~%" (-> obj matrix-tag)) - (format #t "~Tmatrix-data[6] @ #x~X~%" (-> obj matrix-data)) - (format #t "~Tindex-tag: #~%" (-> obj index-tag)) - (format #t "~Tindices[224] @ #x~X~%" (-> obj indices)) - (format #t "~Tend-tag: #~%" (-> obj end-tag)) - obj +(defmethod inspect generic-tie-input ((this generic-tie-input)) + (format #t "[~8x] ~A~%" this 'generic-tie-input) + (format #t "~Tpalette-tag: #~%" (-> this palette-tag)) + (format #t "~Tpalette[128] @ #x~X~%" (-> this palette)) + (format #t "~Tmodel-tag: #~%" (-> this model-tag)) + (format #t "~Tmodel[146] @ #x~X~%" (-> this model)) + (format #t "~Tmatrix-tag: #~%" (-> this matrix-tag)) + (format #t "~Tmatrix-data[6] @ #x~X~%" (-> this matrix-data)) + (format #t "~Tindex-tag: #~%" (-> this index-tag)) + (format #t "~Tindices[224] @ #x~X~%" (-> this indices)) + (format #t "~Tend-tag: #~%" (-> this end-tag)) + this ) ;; definition of type generic-tie-run-control @@ -78,21 +78,21 @@ ) ;; definition for method 3 of type generic-tie-run-control -(defmethod inspect generic-tie-run-control ((obj generic-tie-run-control)) - (format #t "[~8x] ~A~%" obj 'generic-tie-run-control) - (format #t "~Tskip-bp2: ~D~%" (-> obj skip-bp2)) - (format #t "~Tskip-ips: ~D~%" (-> obj skip-ips)) - (format #t "~Tgifbuf-skip: ~D~%" (-> obj gifbuf-skip)) - (format #t "~Tstrips: ~D~%" (-> obj strips)) - (format #t "~Ttarget-bp1: ~D~%" (-> obj target-bp1)) - (format #t "~Ttarget-bp2: ~D~%" (-> obj target-bp2)) - (format #t "~Ttarget-ip1: ~D~%" (-> obj target-ip1)) - (format #t "~Ttarget-ip2: ~D~%" (-> obj target-ip2)) - (format #t "~Ttarget-bps: ~D~%" (-> obj target-bps)) - (format #t "~Ttarget-ips: ~D~%" (-> obj target-ips)) - (format #t "~Tis-generic: ~D~%" (-> obj is-generic)) - (format #t "~Treserved: ~D~%" (-> obj reserved)) - obj +(defmethod inspect generic-tie-run-control ((this generic-tie-run-control)) + (format #t "[~8x] ~A~%" this 'generic-tie-run-control) + (format #t "~Tskip-bp2: ~D~%" (-> this skip-bp2)) + (format #t "~Tskip-ips: ~D~%" (-> this skip-ips)) + (format #t "~Tgifbuf-skip: ~D~%" (-> this gifbuf-skip)) + (format #t "~Tstrips: ~D~%" (-> this strips)) + (format #t "~Ttarget-bp1: ~D~%" (-> this target-bp1)) + (format #t "~Ttarget-bp2: ~D~%" (-> this target-bp2)) + (format #t "~Ttarget-ip1: ~D~%" (-> this target-ip1)) + (format #t "~Ttarget-ip2: ~D~%" (-> this target-ip2)) + (format #t "~Ttarget-bps: ~D~%" (-> this target-bps)) + (format #t "~Ttarget-ips: ~D~%" (-> this target-ips)) + (format #t "~Tis-generic: ~D~%" (-> this is-generic)) + (format #t "~Treserved: ~D~%" (-> this reserved)) + this ) ;; definition of type generic-tie-base-point @@ -117,21 +117,21 @@ ;; definition for method 3 of type generic-tie-base-point ;; INFO: Used lq/sq -(defmethod inspect generic-tie-base-point ((obj generic-tie-base-point)) - (format #t "[~8x] ~A~%" obj 'generic-tie-base-point) - (format #t "~Tdata[8] @ #x~X~%" (&-> obj x)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - (format #t "~Td0: ~D~%" (-> obj d0)) - (format #t "~Tvtx: ~D~%" (-> obj vtx)) - (format #t "~Tu: ~D~%" (-> obj u)) - (format #t "~Tv: ~D~%" (-> obj v)) - (format #t "~Ttex: ~D~%" (-> obj tex)) - (format #t "~Tw: ~D~%" (-> obj w)) - (format #t "~Td1: ~D~%" (-> obj d1)) - obj +(defmethod inspect generic-tie-base-point ((this generic-tie-base-point)) + (format #t "[~8x] ~A~%" this 'generic-tie-base-point) + (format #t "~Tdata[8] @ #x~X~%" (&-> this x)) + (format #t "~Tquad: ~D~%" (-> this quad)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + (format #t "~Td0: ~D~%" (-> this d0)) + (format #t "~Tvtx: ~D~%" (-> this vtx)) + (format #t "~Tu: ~D~%" (-> this u)) + (format #t "~Tv: ~D~%" (-> this v)) + (format #t "~Ttex: ~D~%" (-> this tex)) + (format #t "~Tw: ~D~%" (-> this w)) + (format #t "~Td1: ~D~%" (-> this d1)) + this ) ;; definition of type generic-tie-bps @@ -144,10 +144,10 @@ ) ;; definition for method 3 of type generic-tie-bps -(defmethod inspect generic-tie-bps ((obj generic-tie-bps)) - (format #t "[~8x] ~A~%" obj 'generic-tie-bps) - (format #t "~Tbp[4] @ #x~X~%" (-> obj bp)) - obj +(defmethod inspect generic-tie-bps ((this generic-tie-bps)) + (format #t "[~8x] ~A~%" this 'generic-tie-bps) + (format #t "~Tbp[4] @ #x~X~%" (-> this bp)) + this ) ;; definition of type generic-tie-interp-point @@ -177,26 +177,26 @@ ;; definition for method 3 of type generic-tie-interp-point ;; INFO: Used lq/sq -(defmethod inspect generic-tie-interp-point ((obj generic-tie-interp-point)) - (format #t "[~8x] ~A~%" obj 'generic-tie-interp-point) - (format #t "~Tdata[12] @ #x~X~%" (&-> obj x)) - (format #t "~Tquad: ~D~%" (-> (the-as (pointer uint128) obj) 0)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - (format #t "~Td0: ~D~%" (-> obj d0)) - (format #t "~Tvtx0: ~D~%" (-> obj vtx0)) - (format #t "~Tdx: ~D~%" (-> obj dx)) - (format #t "~Tdy: ~D~%" (-> obj dy)) - (format #t "~Tdz: ~D~%" (-> obj dz)) - (format #t "~Tunused: ~D~%" (-> obj unused)) - (format #t "~Tvtx1: ~D~%" (-> obj vtx1)) - (format #t "~Tu: ~D~%" (-> obj u)) - (format #t "~Tv: ~D~%" (-> obj v)) - (format #t "~Ttex: ~D~%" (-> obj tex)) - (format #t "~Tw: ~D~%" (-> obj w)) - (format #t "~Td1: ~D~%" (-> obj d1)) - obj +(defmethod inspect generic-tie-interp-point ((this generic-tie-interp-point)) + (format #t "[~8x] ~A~%" this 'generic-tie-interp-point) + (format #t "~Tdata[12] @ #x~X~%" (&-> this x)) + (format #t "~Tquad: ~D~%" (-> (the-as (pointer uint128) this) 0)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + (format #t "~Td0: ~D~%" (-> this d0)) + (format #t "~Tvtx0: ~D~%" (-> this vtx0)) + (format #t "~Tdx: ~D~%" (-> this dx)) + (format #t "~Tdy: ~D~%" (-> this dy)) + (format #t "~Tdz: ~D~%" (-> this dz)) + (format #t "~Tunused: ~D~%" (-> this unused)) + (format #t "~Tvtx1: ~D~%" (-> this vtx1)) + (format #t "~Tu: ~D~%" (-> this u)) + (format #t "~Tv: ~D~%" (-> this v)) + (format #t "~Ttex: ~D~%" (-> this tex)) + (format #t "~Tw: ~D~%" (-> this w)) + (format #t "~Td1: ~D~%" (-> this d1)) + this ) ;; definition of type generic-tie-ips @@ -209,10 +209,10 @@ ) ;; definition for method 3 of type generic-tie-ips -(defmethod inspect generic-tie-ips ((obj generic-tie-ips)) - (format #t "[~8x] ~A~%" obj 'generic-tie-ips) - (format #t "~Tip[2] @ #x~X~%" (-> obj ip)) - obj +(defmethod inspect generic-tie-ips ((this generic-tie-ips)) + (format #t "[~8x] ~A~%" this 'generic-tie-ips) + (format #t "~Tip[2] @ #x~X~%" (-> this ip)) + this ) ;; definition of type generic-tie-header @@ -234,19 +234,19 @@ ) ;; definition for method 3 of type generic-tie-header -(defmethod inspect generic-tie-header ((obj generic-tie-header)) - (format #t "[~8x] ~A~%" obj 'generic-tie-header) - (format #t "~Teffect: ~D~%" (-> obj effect)) - (format #t "~Tinterp-table-size: ~D~%" (-> obj interp-table-size)) - (format #t "~Tnum-bps: ~D~%" (-> obj num-bps)) - (format #t "~Tnum-ips: ~D~%" (-> obj num-ips)) - (format #t "~Ttint-color: ~D~%" (-> obj tint-color)) - (format #t "~Tindex-table-offset: ~D~%" (-> obj index-table-offset)) - (format #t "~Tkick-table-offset: ~D~%" (-> obj kick-table-offset)) - (format #t "~Tnormal-table-offset: ~D~%" (-> obj normal-table-offset)) - (format #t "~Tinterp-table-offset: ~D~%" (-> obj interp-table-offset)) - (format #t "~Tgsf-header: #~%" (-> obj gsf-header)) - obj +(defmethod inspect generic-tie-header ((this generic-tie-header)) + (format #t "[~8x] ~A~%" this 'generic-tie-header) + (format #t "~Teffect: ~D~%" (-> this effect)) + (format #t "~Tinterp-table-size: ~D~%" (-> this interp-table-size)) + (format #t "~Tnum-bps: ~D~%" (-> this num-bps)) + (format #t "~Tnum-ips: ~D~%" (-> this num-ips)) + (format #t "~Ttint-color: ~D~%" (-> this tint-color)) + (format #t "~Tindex-table-offset: ~D~%" (-> this index-table-offset)) + (format #t "~Tkick-table-offset: ~D~%" (-> this kick-table-offset)) + (format #t "~Tnormal-table-offset: ~D~%" (-> this normal-table-offset)) + (format #t "~Tinterp-table-offset: ~D~%" (-> this interp-table-offset)) + (format #t "~Tgsf-header: #~%" (-> this gsf-header)) + this ) ;; definition of type generic-tie-matrix @@ -261,12 +261,12 @@ ) ;; definition for method 3 of type generic-tie-matrix -(defmethod inspect generic-tie-matrix ((obj generic-tie-matrix)) - (format #t "[~8x] ~A~%" obj 'generic-tie-matrix) - (format #t "~Tmatrix: #~%" (-> obj matrix)) - (format #t "~Tmorph: #~%" (-> obj morph)) - (format #t "~Tfog: #~%" (-> obj fog)) - obj +(defmethod inspect generic-tie-matrix ((this generic-tie-matrix)) + (format #t "[~8x] ~A~%" this 'generic-tie-matrix) + (format #t "~Tmatrix: #~%" (-> this matrix)) + (format #t "~Tmorph: #~%" (-> this morph)) + (format #t "~Tfog: #~%" (-> this fog)) + this ) ;; definition of type generic-tie-normal @@ -282,13 +282,13 @@ ) ;; definition for method 3 of type generic-tie-normal -(defmethod inspect generic-tie-normal ((obj generic-tie-normal)) - (format #t "[~8x] ~A~%" obj 'generic-tie-normal) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - (format #t "~Tdummy: ~D~%" (-> obj dummy)) - obj +(defmethod inspect generic-tie-normal ((this generic-tie-normal)) + (format #t "[~8x] ~A~%" this 'generic-tie-normal) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + (format #t "~Tdummy: ~D~%" (-> this dummy)) + this ) ;; definition of type generic-tie-control @@ -315,24 +315,24 @@ ) ;; definition for method 3 of type generic-tie-control -(defmethod inspect generic-tie-control ((obj generic-tie-control)) - (format #t "[~8x] ~A~%" obj 'generic-tie-control) - (format #t "~Tptr-palette: #x~X~%" (-> obj ptr-palette)) - (format #t "~Tptr-shaders: #x~X~%" (-> obj ptr-shaders)) - (format #t "~Tptr-runctrl: #~%" (-> obj ptr-runctrl)) - (format #t "~Tptr-verts: #x~X~%" (-> obj ptr-verts)) - (format #t "~Tptr-generic: #~%" (-> obj ptr-generic)) - (format #t "~Tptr-dps: #x~X~%" (-> obj ptr-dps)) - (format #t "~Tptr-kicks: #x~X~%" (-> obj ptr-kicks)) - (format #t "~Tptr-normals: #x~X~%" (-> obj ptr-normals)) - (format #t "~Tptr-interp: #x~X~%" (-> obj ptr-interp)) - (format #t "~Tptr-mtxs: #~%" (-> obj ptr-mtxs)) - (format #t "~Tptr-cinds: #x~X~%" (-> obj ptr-cinds)) - (format #t "~Tnext-instance: #x~X~%" (-> obj next-instance)) - (format #t "~Tnext-model: #x~X~%" (-> obj next-model)) - (format #t "~Tnext-is-model: ~D~%" (-> obj next-is-model)) - (format #t "~Ttie-type: ~D~%" (-> obj tie-type)) - obj +(defmethod inspect generic-tie-control ((this generic-tie-control)) + (format #t "[~8x] ~A~%" this 'generic-tie-control) + (format #t "~Tptr-palette: #x~X~%" (-> this ptr-palette)) + (format #t "~Tptr-shaders: #x~X~%" (-> this ptr-shaders)) + (format #t "~Tptr-runctrl: #~%" (-> this ptr-runctrl)) + (format #t "~Tptr-verts: #x~X~%" (-> this ptr-verts)) + (format #t "~Tptr-generic: #~%" (-> this ptr-generic)) + (format #t "~Tptr-dps: #x~X~%" (-> this ptr-dps)) + (format #t "~Tptr-kicks: #x~X~%" (-> this ptr-kicks)) + (format #t "~Tptr-normals: #x~X~%" (-> this ptr-normals)) + (format #t "~Tptr-interp: #x~X~%" (-> this ptr-interp)) + (format #t "~Tptr-mtxs: #~%" (-> this ptr-mtxs)) + (format #t "~Tptr-cinds: #x~X~%" (-> this ptr-cinds)) + (format #t "~Tnext-instance: #x~X~%" (-> this next-instance)) + (format #t "~Tnext-model: #x~X~%" (-> this next-model)) + (format #t "~Tnext-is-model: ~D~%" (-> this next-is-model)) + (format #t "~Ttie-type: ~D~%" (-> this tie-type)) + this ) ;; definition of type generic-tie-stats @@ -353,18 +353,18 @@ ) ;; definition for method 3 of type generic-tie-stats -(defmethod inspect generic-tie-stats ((obj generic-tie-stats)) - (format #t "[~8x] ~A~%" obj 'generic-tie-stats) - (format #t "~Tnum-bps: ~D~%" (-> obj num-bps)) - (format #t "~Tnum-ips: ~D~%" (-> obj num-ips)) - (format #t "~Tnum-dps: ~D~%" (-> obj num-dps)) - (format #t "~Tnum-shaders: ~D~%" (-> obj num-shaders)) - (format #t "~Tnum-models: ~D~%" (-> obj num-models)) - (format #t "~Tnum-instances: ~D~%" (-> obj num-instances)) - (format #t "~Tnum-waits: ~D~%" (-> obj num-waits)) - (format #t "~Tnum-qwc: ~D~%" (-> obj num-qwc)) - (format #t "~Tmax-qwc: ~D~%" (-> obj max-qwc)) - obj +(defmethod inspect generic-tie-stats ((this generic-tie-stats)) + (format #t "[~8x] ~A~%" this 'generic-tie-stats) + (format #t "~Tnum-bps: ~D~%" (-> this num-bps)) + (format #t "~Tnum-ips: ~D~%" (-> this num-ips)) + (format #t "~Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~Tnum-shaders: ~D~%" (-> this num-shaders)) + (format #t "~Tnum-models: ~D~%" (-> this num-models)) + (format #t "~Tnum-instances: ~D~%" (-> this num-instances)) + (format #t "~Tnum-waits: ~D~%" (-> this num-waits)) + (format #t "~Tnum-qwc: ~D~%" (-> this num-qwc)) + (format #t "~Tmax-qwc: ~D~%" (-> this max-qwc)) + this ) ;; definition of type generic-tie-calls @@ -381,13 +381,13 @@ ) ;; definition for method 3 of type generic-tie-calls -(defmethod inspect generic-tie-calls ((obj generic-tie-calls)) - (format #t "[~8x] ~A~%" obj 'generic-tie-calls) - (format #t "~Tgeneric-prepare-dma-double: ~A~%" (-> obj generic-prepare-dma-double)) - (format #t "~Tgeneric-envmap-dproc: ~A~%" (-> obj generic-envmap-dproc)) - (format #t "~Tgeneric-interp-dproc: ~A~%" (-> obj generic-interp-dproc)) - (format #t "~Tgeneric-no-light-dproc: ~A~%" (-> obj generic-no-light-dproc)) - obj +(defmethod inspect generic-tie-calls ((this generic-tie-calls)) + (format #t "[~8x] ~A~%" this 'generic-tie-calls) + (format #t "~Tgeneric-prepare-dma-double: ~A~%" (-> this generic-prepare-dma-double)) + (format #t "~Tgeneric-envmap-dproc: ~A~%" (-> this generic-envmap-dproc)) + (format #t "~Tgeneric-interp-dproc: ~A~%" (-> this generic-interp-dproc)) + (format #t "~Tgeneric-no-light-dproc: ~A~%" (-> this generic-no-light-dproc)) + this ) ;; definition of type generic-tie-shadow @@ -409,18 +409,18 @@ ) ;; definition for method 3 of type generic-tie-shadow -(defmethod inspect generic-tie-shadow ((obj generic-tie-shadow)) - (format #t "[~8x] ~A~%" obj 'generic-tie-shadow) - (format #t "~Tout-buf: #~%" (-> obj out-buf)) - (format #t "~Tcur-buf: #x~X~%" (-> obj cur-buf)) - (format #t "~Ttie-type: ~D~%" (-> obj tie-type)) - (format #t "~Tptr-inst: #x~X~%" (-> obj ptr-inst)) - (format #t "~Tptr-buf: #x~X~%" (-> obj ptr-buf)) - (format #t "~Tinst-xor: ~D~%" (-> obj inst-xor)) - (format #t "~Tend-of-chain: ~D~%" (-> obj end-of-chain)) - (format #t "~Twrite-limit: ~D~%" (-> obj write-limit)) - (format #t "~Tcalls: #~%" (-> obj calls)) - obj +(defmethod inspect generic-tie-shadow ((this generic-tie-shadow)) + (format #t "[~8x] ~A~%" this 'generic-tie-shadow) + (format #t "~Tout-buf: #~%" (-> this out-buf)) + (format #t "~Tcur-buf: #x~X~%" (-> this cur-buf)) + (format #t "~Ttie-type: ~D~%" (-> this tie-type)) + (format #t "~Tptr-inst: #x~X~%" (-> this ptr-inst)) + (format #t "~Tptr-buf: #x~X~%" (-> this ptr-buf)) + (format #t "~Tinst-xor: ~D~%" (-> this inst-xor)) + (format #t "~Tend-of-chain: ~D~%" (-> this end-of-chain)) + (format #t "~Twrite-limit: ~D~%" (-> this write-limit)) + (format #t "~Tcalls: #~%" (-> this calls)) + this ) ;; definition of type generic-tie-work @@ -439,16 +439,16 @@ ) ;; definition for method 3 of type generic-tie-work -(defmethod inspect generic-tie-work ((obj generic-tie-work)) - (format #t "[~8x] ~A~%" obj 'generic-tie-work) - (format #t "~Tcontrol: #~%" (-> obj control)) - (format #t "~Tinterp-job: #~%" (-> obj interp-job)) - (format #t "~Tshadow: #~%" (-> obj shadow)) - (format #t "~Tinput-a: #~%" (-> obj input-a)) - (format #t "~Tinput-b: #~%" (-> obj input-b)) - (format #t "~Tinst-buf: #~%" (-> obj inst-buf)) - (format #t "~Tpalette-buf[128] @ #x~X~%" (-> obj palette-buf)) - obj +(defmethod inspect generic-tie-work ((this generic-tie-work)) + (format #t "[~8x] ~A~%" this 'generic-tie-work) + (format #t "~Tcontrol: #~%" (-> this control)) + (format #t "~Tinterp-job: #~%" (-> this interp-job)) + (format #t "~Tshadow: #~%" (-> this shadow)) + (format #t "~Tinput-a: #~%" (-> this input-a)) + (format #t "~Tinput-b: #~%" (-> this input-b)) + (format #t "~Tinst-buf: #~%" (-> this inst-buf)) + (format #t "~Tpalette-buf[128] @ #x~X~%" (-> this palette-buf)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/tie-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/tie-h_REF.gc index 4a21012aa4..3aadec5231 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/tie-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/tie-h_REF.gc @@ -25,26 +25,26 @@ ) ;; definition for method 3 of type tie-fragment -(defmethod inspect tie-fragment ((obj tie-fragment)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tgif-ref: #x~X~%" (-> obj gif-ref)) - (format #t "~Tpoint-ref: #x~X~%" (-> obj point-ref)) - (format #t "~Tcolor-index: ~D~%" (-> obj color-index)) - (format #t "~Tbase-colors: ~D~%" (-> obj base-colors)) - (format #t "~Ttex-count: ~D~%" (-> obj tex-count)) - (format #t "~Tgif-count: ~D~%" (-> obj gif-count)) - (format #t "~Tvertex-count: ~D~%" (-> obj vertex-count)) - (format #t "~Tcolor-count: ~D~%" (-> obj color-count)) - (format #t "~Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~Tnum-dverts: ~D~%" (-> obj num-dverts)) - (format #t "~Tdp-ref: #x~X~%" (-> obj dp-ref)) - (format #t "~Tdp-qwc: ~D~%" (-> obj dp-qwc)) - (format #t "~Tgeneric-ref: #x~X~%" (-> obj generic-ref)) - (format #t "~Tgeneric-count: ~D~%" (-> obj generic-count)) - (format #t "~Tdebug-lines: ~A~%" (-> obj debug-lines)) - obj +(defmethod inspect tie-fragment ((this tie-fragment)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tgif-ref: #x~X~%" (-> this gif-ref)) + (format #t "~Tpoint-ref: #x~X~%" (-> this point-ref)) + (format #t "~Tcolor-index: ~D~%" (-> this color-index)) + (format #t "~Tbase-colors: ~D~%" (-> this base-colors)) + (format #t "~Ttex-count: ~D~%" (-> this tex-count)) + (format #t "~Tgif-count: ~D~%" (-> this gif-count)) + (format #t "~Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~Tcolor-count: ~D~%" (-> this color-count)) + (format #t "~Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~Tnum-dverts: ~D~%" (-> this num-dverts)) + (format #t "~Tdp-ref: #x~X~%" (-> this dp-ref)) + (format #t "~Tdp-qwc: ~D~%" (-> this dp-qwc)) + (format #t "~Tgeneric-ref: #x~X~%" (-> this generic-ref)) + (format #t "~Tgeneric-count: ~D~%" (-> this generic-count)) + (format #t "~Tdebug-lines: ~A~%" (-> this debug-lines)) + this ) ;; definition of type instance-tie @@ -60,18 +60,18 @@ ) ;; definition for method 3 of type instance-tie -(defmethod inspect instance-tie ((obj instance-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tbucket-index: ~D~%" (-> obj bucket-index)) - (format #t "~Torigin: #~%" (-> obj origin)) - (format #t "~Twind-index: ~D~%" (-> obj wind-index)) - (format #t "~Tcolor-indices: #x~X~%" (-> obj error)) - (format #t "~Tbucket-ptr: ~A~%" (-> obj bucket-ptr)) - (format #t "~Tmax-scale: ~D~%" (-> obj max-scale)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - obj +(defmethod inspect instance-tie ((this instance-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tbucket-index: ~D~%" (-> this bucket-index)) + (format #t "~Torigin: #~%" (-> this origin)) + (format #t "~Twind-index: ~D~%" (-> this wind-index)) + (format #t "~Tcolor-indices: #x~X~%" (-> this error)) + (format #t "~Tbucket-ptr: ~A~%" (-> this bucket-ptr)) + (format #t "~Tmax-scale: ~D~%" (-> this max-scale)) + (format #t "~Tflags: ~D~%" (-> this flags)) + this ) ;; definition of type drawable-inline-array-instance-tie @@ -94,14 +94,14 @@ ) ;; definition for method 3 of type drawable-tree-instance-tie -(defmethod inspect drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) - (format #t "~Tprototypes: ~A~%" (-> obj prototypes)) - obj +(defmethod inspect drawable-tree-instance-tie ((this drawable-tree-instance-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[1] @ #x~X~%" (-> this data)) + (format #t "~Tprototypes: ~A~%" (-> this prototypes)) + this ) ;; definition of type prototype-tie @@ -126,12 +126,12 @@ ) ;; definition for method 3 of type tie-matrix -(defmethod inspect tie-matrix ((obj tie-matrix)) - (format #t "[~8x] ~A~%" obj 'tie-matrix) - (format #t "~Tmat: #~%" (-> obj mat)) - (format #t "~Tmorph: #~%" (-> obj morph)) - (format #t "~Tfog: #~%" (-> obj fog)) - obj +(defmethod inspect tie-matrix ((this tie-matrix)) + (format #t "[~8x] ~A~%" this 'tie-matrix) + (format #t "~Tmat: #~%" (-> this mat)) + (format #t "~Tmorph: #~%" (-> this morph)) + (format #t "~Tfog: #~%" (-> this fog)) + this ) ;; definition of type instance-tie-work @@ -177,43 +177,43 @@ ) ;; definition for method 3 of type instance-tie-work -(defmethod inspect instance-tie-work ((obj instance-tie-work)) - (format #t "[~8x] ~A~%" obj 'instance-tie-work) - (format #t "~Twind-const: #~%" (-> obj wind-const)) - (format #t "~Thmge-d: #~%" (-> obj hmge-d)) - (format #t "~Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~Twind-force: #~%" (-> obj wind-force)) - (format #t "~Tconstant: #~%" (-> obj constant)) - (format #t "~Tfar-morph: #~%" (-> obj far-morph)) - (format #t "~Tdist-test: #~%" (-> obj dist-test)) - (format #t "~Tmin-dist: #~%" (-> obj min-dist)) - (format #t "~Tguard-plane[4] @ #x~X~%" (-> obj guard-plane)) - (format #t "~Tupload-color-0: #~%" (-> obj upload-color-0)) - (format #t "~Tupload-color-1: #~%" (-> obj upload-color-1)) - (format #t "~Tupload-color-2: #~%" (-> obj upload-color-2)) - (format #t "~Tupload-color-ret: #~%" (-> obj upload-color-ret)) - (format #t "~Tupload-color-temp: #~%" (-> obj upload-color-temp)) - (format #t "~Tgeneric-color-0: #~%" (-> obj generic-color-0)) - (format #t "~Tgeneric-color-1: #~%" (-> obj generic-color-1)) - (format #t "~Tgeneric-color-end: #~%" (-> obj generic-color-end)) - (format #t "~Ttie-near-perspective-matrix: #~%" (-> obj tie-near-perspective-matrix)) - (format #t "~Twind-vectors: #x~X~%" (-> obj wind-vectors)) - (format #t "~Ttest-id: ~D~%" (-> obj test-id)) - (format #t "~Ttest-id2: ~D~%" (-> obj test-id2)) - (format #t "~Tdma-buffer: ~A~%" (-> obj dma-buffer)) - (format #t "~Tto-spr: ~D~%" (-> obj to-spr)) - (format #t "~Tfrom-spr: ~D~%" (-> obj from-spr)) - (format #t "~Twind-work: ~D~%" (-> obj wind-work)) - (format #t "~Tcur-vis-bits: ~D~%" (-> obj cur-vis-bits)) - (format #t "~Tend-vis-bits: ~D~%" (-> obj end-vis-bits)) - (format #t "~Tfirst-generic-prototype: #x~X~%" (-> obj first-generic-prototype)) - (format #t "~Trefl-fade-fac: ~f~%" (-> obj refl-fade-fac)) - (format #t "~Trefl-fade-end: ~f~%" (-> obj refl-fade-end)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Tpaused: ~A~%" (-> obj paused)) - (format #t "~Twait-from-spr: ~D~%" (-> obj wait-from-spr)) - (format #t "~Twait-to-spr: ~D~%" (-> obj wait-to-spr)) - obj +(defmethod inspect instance-tie-work ((this instance-tie-work)) + (format #t "[~8x] ~A~%" this 'instance-tie-work) + (format #t "~Twind-const: #~%" (-> this wind-const)) + (format #t "~Thmge-d: #~%" (-> this hmge-d)) + (format #t "~Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~Twind-force: #~%" (-> this wind-force)) + (format #t "~Tconstant: #~%" (-> this constant)) + (format #t "~Tfar-morph: #~%" (-> this far-morph)) + (format #t "~Tdist-test: #~%" (-> this dist-test)) + (format #t "~Tmin-dist: #~%" (-> this min-dist)) + (format #t "~Tguard-plane[4] @ #x~X~%" (-> this guard-plane)) + (format #t "~Tupload-color-0: #~%" (-> this upload-color-0)) + (format #t "~Tupload-color-1: #~%" (-> this upload-color-1)) + (format #t "~Tupload-color-2: #~%" (-> this upload-color-2)) + (format #t "~Tupload-color-ret: #~%" (-> this upload-color-ret)) + (format #t "~Tupload-color-temp: #~%" (-> this upload-color-temp)) + (format #t "~Tgeneric-color-0: #~%" (-> this generic-color-0)) + (format #t "~Tgeneric-color-1: #~%" (-> this generic-color-1)) + (format #t "~Tgeneric-color-end: #~%" (-> this generic-color-end)) + (format #t "~Ttie-near-perspective-matrix: #~%" (-> this tie-near-perspective-matrix)) + (format #t "~Twind-vectors: #x~X~%" (-> this wind-vectors)) + (format #t "~Ttest-id: ~D~%" (-> this test-id)) + (format #t "~Ttest-id2: ~D~%" (-> this test-id2)) + (format #t "~Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~Tfrom-spr: ~D~%" (-> this from-spr)) + (format #t "~Twind-work: ~D~%" (-> this wind-work)) + (format #t "~Tcur-vis-bits: ~D~%" (-> this cur-vis-bits)) + (format #t "~Tend-vis-bits: ~D~%" (-> this end-vis-bits)) + (format #t "~Tfirst-generic-prototype: #x~X~%" (-> this first-generic-prototype)) + (format #t "~Trefl-fade-fac: ~f~%" (-> this refl-fade-fac)) + (format #t "~Trefl-fade-end: ~f~%" (-> this refl-fade-end)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Tpaused: ~A~%" (-> this paused)) + (format #t "~Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~Twait-to-spr: ~D~%" (-> this wait-to-spr)) + this ) ;; definition of type instance-tie-dma @@ -230,14 +230,14 @@ ) ;; definition for method 3 of type instance-tie-dma -(defmethod inspect instance-tie-dma ((obj instance-tie-dma)) - (format #t "[~8x] ~A~%" obj 'instance-tie-dma) - (format #t "~Tbanka[32] @ #x~X~%" (-> obj banka)) - (format #t "~Tbankb[32] @ #x~X~%" (-> obj bankb)) - (format #t "~Touta[256] @ #x~X~%" (-> obj outa)) - (format #t "~Toutb[256] @ #x~X~%" (-> obj outb)) - (format #t "~Twork: #~%" (-> obj work 0)) - obj +(defmethod inspect instance-tie-dma ((this instance-tie-dma)) + (format #t "[~8x] ~A~%" this 'instance-tie-dma) + (format #t "~Tbanka[32] @ #x~X~%" (-> this banka)) + (format #t "~Tbankb[32] @ #x~X~%" (-> this bankb)) + (format #t "~Touta[256] @ #x~X~%" (-> this outa)) + (format #t "~Toutb[256] @ #x~X~%" (-> this outb)) + (format #t "~Twork: #~%" (-> this work 0)) + this ) ;; definition of type prototype-tie-work @@ -274,34 +274,34 @@ ) ;; definition for method 3 of type prototype-tie-work -(defmethod inspect prototype-tie-work ((obj prototype-tie-work)) - (format #t "[~8x] ~A~%" obj 'prototype-tie-work) - (format #t "~Tupload-palette-0: #~%" (-> obj upload-palette-0)) - (format #t "~Tupload-palette-1: #~%" (-> obj upload-palette-1)) - (format #t "~Tupload-model-0: #~%" (-> obj upload-model-0)) - (format #t "~Tupload-model-1: #~%" (-> obj upload-model-1)) - (format #t "~Tupload-model-2: #~%" (-> obj upload-model-2)) - (format #t "~Tupload-model-3: #~%" (-> obj upload-model-3)) - (format #t "~Tupload-model-near-0: #~%" (-> obj upload-model-near-0)) - (format #t "~Tupload-model-near-1: #~%" (-> obj upload-model-near-1)) - (format #t "~Tupload-model-near-2: #~%" (-> obj upload-model-near-2)) - (format #t "~Tupload-model-near-3: #~%" (-> obj upload-model-near-3)) - (format #t "~Tupload-model-near-4: #~%" (-> obj upload-model-near-4)) - (format #t "~Tgeneric-envmap-shader: #~%" (-> obj generic-envmap-shader)) - (format #t "~Tgeneric-palette: #~%" (-> obj generic-palette)) - (format #t "~Tgeneric-model-0: #~%" (-> obj generic-model-0)) - (format #t "~Tgeneric-model-1: #~%" (-> obj generic-model-1)) - (format #t "~Tgeneric-model-2: #~%" (-> obj generic-model-2)) - (format #t "~Tgeneric-model-next: #~%" (-> obj generic-model-next)) - (format #t "~Tclamp: ~D~%" (-> obj clamp)) - (format #t "~Tprototype-array: ~A~%" (-> obj prototype-array)) - (format #t "~Tgeneric-wait-from-spr: ~D~%" (-> obj generic-wait-from-spr)) - (format #t "~Tgeneric-wait-to-spr: ~D~%" (-> obj generic-wait-to-spr)) - (format #t "~Twait-from-spr: ~D~%" (-> obj wait-from-spr)) - (format #t "~Twait-to-spr: ~D~%" (-> obj wait-to-spr)) - (format #t "~Tnear-wait-from-spr: ~D~%" (-> obj near-wait-from-spr)) - (format #t "~Tnear-wait-to-spr: ~D~%" (-> obj near-wait-to-spr)) - obj +(defmethod inspect prototype-tie-work ((this prototype-tie-work)) + (format #t "[~8x] ~A~%" this 'prototype-tie-work) + (format #t "~Tupload-palette-0: #~%" (-> this upload-palette-0)) + (format #t "~Tupload-palette-1: #~%" (-> this upload-palette-1)) + (format #t "~Tupload-model-0: #~%" (-> this upload-model-0)) + (format #t "~Tupload-model-1: #~%" (-> this upload-model-1)) + (format #t "~Tupload-model-2: #~%" (-> this upload-model-2)) + (format #t "~Tupload-model-3: #~%" (-> this upload-model-3)) + (format #t "~Tupload-model-near-0: #~%" (-> this upload-model-near-0)) + (format #t "~Tupload-model-near-1: #~%" (-> this upload-model-near-1)) + (format #t "~Tupload-model-near-2: #~%" (-> this upload-model-near-2)) + (format #t "~Tupload-model-near-3: #~%" (-> this upload-model-near-3)) + (format #t "~Tupload-model-near-4: #~%" (-> this upload-model-near-4)) + (format #t "~Tgeneric-envmap-shader: #~%" (-> this generic-envmap-shader)) + (format #t "~Tgeneric-palette: #~%" (-> this generic-palette)) + (format #t "~Tgeneric-model-0: #~%" (-> this generic-model-0)) + (format #t "~Tgeneric-model-1: #~%" (-> this generic-model-1)) + (format #t "~Tgeneric-model-2: #~%" (-> this generic-model-2)) + (format #t "~Tgeneric-model-next: #~%" (-> this generic-model-next)) + (format #t "~Tclamp: ~D~%" (-> this clamp)) + (format #t "~Tprototype-array: ~A~%" (-> this prototype-array)) + (format #t "~Tgeneric-wait-from-spr: ~D~%" (-> this generic-wait-from-spr)) + (format #t "~Tgeneric-wait-to-spr: ~D~%" (-> this generic-wait-to-spr)) + (format #t "~Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~Tnear-wait-from-spr: ~D~%" (-> this near-wait-from-spr)) + (format #t "~Tnear-wait-to-spr: ~D~%" (-> this near-wait-to-spr)) + this ) ;; definition of type prototype-tie-dma @@ -323,19 +323,19 @@ ) ;; definition for method 3 of type prototype-tie-dma -(defmethod inspect prototype-tie-dma ((obj prototype-tie-dma)) - (format #t "[~8x] ~A~%" obj 'prototype-tie-dma) - (format #t "~Tcolora[256] @ #x~X~%" (-> obj colora)) - (format #t "~Tcolorb[256] @ #x~X~%" (-> obj colorb)) - (format #t "~Touta[256] @ #x~X~%" (-> obj outa)) - (format #t "~Toutb[256] @ #x~X~%" (-> obj outb)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdma-buffer: ~A~%" (-> obj dma-buffer)) - (format #t "~Tthis-frag-count: ~D~%" (-> obj this-frag-count)) - (format #t "~Tnext[4] @ #x~X~%" (-> obj next)) - (format #t "~Tgeometry[4] @ #x~X~%" (-> obj geometry)) - (format #t "~Tfrag-count[4] @ #x~X~%" (-> obj frag-count)) - obj +(defmethod inspect prototype-tie-dma ((this prototype-tie-dma)) + (format #t "[~8x] ~A~%" this 'prototype-tie-dma) + (format #t "~Tcolora[256] @ #x~X~%" (-> this colora)) + (format #t "~Tcolorb[256] @ #x~X~%" (-> this colorb)) + (format #t "~Touta[256] @ #x~X~%" (-> this outa)) + (format #t "~Toutb[256] @ #x~X~%" (-> this outb)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~Tthis-frag-count: ~D~%" (-> this this-frag-count)) + (format #t "~Tnext[4] @ #x~X~%" (-> this next)) + (format #t "~Tgeometry[4] @ #x~X~%" (-> this geometry)) + (format #t "~Tfrag-count[4] @ #x~X~%" (-> this frag-count)) + this ) ;; definition for symbol *instance-tie-work-copy*, type instance-tie-work diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc index 529bef94b6..8f8ec1d1f7 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/tie-methods_REF.gc @@ -187,11 +187,11 @@ ) ;; definition for method 3 of type tie-instance-debug -(defmethod inspect tie-instance-debug ((obj tie-instance-debug)) - (format #t "[~8x] ~A~%" obj 'tie-instance-debug) - (format #t "~Tmax-instance: ~D~%" (-> obj max-instance)) - (format #t "~Tmin-instance: ~D~%" (-> obj min-instance)) - obj +(defmethod inspect tie-instance-debug ((this tie-instance-debug)) + (format #t "[~8x] ~A~%" this 'tie-instance-debug) + (format #t "~Tmax-instance: ~D~%" (-> this max-instance)) + (format #t "~Tmin-instance: ~D~%" (-> this min-instance)) + this ) ;; definition for symbol *tie*, type tie-instance-debug @@ -236,14 +236,14 @@ ;; definition for method 9 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files -(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) - (if (nonzero? (-> obj prototypes prototype-array-tie)) - (login (-> obj prototypes prototype-array-tie)) +(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) + (if (nonzero? (-> this prototypes prototype-array-tie)) + (login (-> this prototypes prototype-array-tie)) ) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) ;; definition for function draw-drawable-tree-instance-tie @@ -591,12 +591,12 @@ ;; definition for method 10 of type drawable-tree-instance-tie ;; INFO: Return type mismatch drawable-tree-instance-tie vs none. -(defmethod draw drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 drawable-tree-instance-tie) (arg1 display-frame)) +(defmethod draw drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 drawable-tree-instance-tie) (arg1 display-frame)) (let* ((v1-1 (-> *background-work* tie-tree-count)) (a1-2 (-> (the-as terrain-context #x70000000) bsp lev-index)) (a1-5 (-> *level* level a1-2)) ) - (set! (-> *background-work* tie-trees v1-1) obj) + (set! (-> *background-work* tie-trees v1-1) this) (set! (-> *background-work* tie-levels v1-1) a1-5) ) (+! (-> *background-work* tie-tree-count) 1) @@ -605,10 +605,10 @@ ;; definition for method 14 of type drawable-tree-instance-tie ;; INFO: Return type mismatch symbol vs none. -(defmethod collect-stats drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) +(defmethod collect-stats drawable-tree-instance-tie ((this drawable-tree-instance-tie)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tie-near tie generic)) - (-> obj data (+ (-> obj length) -1)) - (let ((v1-8 (-> obj prototypes prototype-array-tie))) + (-> this data (+ (-> this length) -1)) + (let ((v1-8 (-> this prototypes prototype-array-tie))) (dotimes (a0-1 (-> v1-8 length)) (let ((a1-2 (-> v1-8 array-data a0-1))) (when (logtest? *vu1-enable-user* (vu1-renderer-mask generic)) @@ -706,9 +706,9 @@ ;; definition for method 15 of type drawable-tree-instance-tie ;; INFO: Return type mismatch symbol vs none. -(defmethod debug-draw drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 drawable) (arg1 display-frame)) - (-> obj data (+ (-> obj length) -1)) - (let* ((s5-0 (-> obj prototypes prototype-array-tie)) +(defmethod debug-draw drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 drawable) (arg1 display-frame)) + (-> this data (+ (-> this length) -1)) + (let* ((s5-0 (-> this prototypes prototype-array-tie)) (s4-0 (-> s5-0 length)) ) (dotimes (s3-0 s4-0) @@ -723,8 +723,8 @@ ;; definition for method 11 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-with-box (-> obj data 0) (-> obj length) arg1) +(defmethod collide-with-box drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-with-box (-> this data 0) (-> this length) arg1) 0 (none) ) @@ -732,8 +732,8 @@ ;; definition for method 12 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-y-probe (-> obj data 0) (-> obj length) arg1) +(defmethod collide-y-probe drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-y-probe (-> this data 0) (-> this length) arg1) 0 (none) ) @@ -741,8 +741,8 @@ ;; definition for method 13 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-ray (-> obj data 0) (-> obj length) arg1) +(defmethod collide-ray drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-ray (-> this data 0) (-> this length) arg1) 0 (none) ) @@ -750,8 +750,8 @@ ;; definition for method 11 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-with-box (-> obj data 0) (-> obj length) arg1) +(defmethod collide-with-box drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-with-box (-> this data 0) (-> this length) arg1) 0 (none) ) @@ -759,8 +759,8 @@ ;; definition for method 12 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-y-probe (-> obj data 0) (-> obj length) arg1) +(defmethod collide-y-probe drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-y-probe (-> this data 0) (-> this length) arg1) 0 (none) ) @@ -768,32 +768,32 @@ ;; definition for method 13 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-ray (-> obj data 0) (-> obj length) arg1) +(defmethod collide-ray drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-ray (-> this data 0) (-> this length) arg1) 0 (none) ) ;; definition for method 11 of type drawable-inline-array-instance-tie ;; INFO: Return type mismatch int vs none. -(defmethod collide-with-box drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-with-box (the-as instance-tie (-> obj data)) (-> obj length) arg1) +(defmethod collide-with-box drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-with-box (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) ) ;; definition for method 12 of type drawable-inline-array-instance-tie ;; INFO: Return type mismatch int vs none. -(defmethod collide-y-probe drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-y-probe (the-as instance-tie (-> obj data)) (-> obj length) arg1) +(defmethod collide-y-probe drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-y-probe (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) ) ;; definition for method 13 of type drawable-inline-array-instance-tie ;; INFO: Return type mismatch int vs none. -(defmethod collide-ray drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) - (collide-ray (the-as instance-tie (-> obj data)) (-> obj length) arg1) +(defmethod collide-ray drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 int) (arg1 collide-list)) + (collide-ray (the-as instance-tie (-> this data)) (-> this length) arg1) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/tie-near_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/tie-near_REF.gc index bf77e94e0a..a1d00da744 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/tie-near_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/tie-near_REF.gc @@ -22,21 +22,21 @@ ) ;; definition for method 3 of type tie-near-consts -(defmethod inspect tie-near-consts ((obj tie-near-consts)) - (format #t "[~8x] ~A~%" obj 'tie-near-consts) - (format #t "~Textra: #~%" (-> obj extra)) - (format #t "~Tgifbufs: #~%" (-> obj gifbufs)) - (format #t "~Tclrbufs: #~%" (-> obj clrbufs)) - (format #t "~Tadgif: #~%" (-> obj adgif)) - (format #t "~Tstrgif: #~%" (-> obj strgif)) - (format #t "~Tfangif: #~%" (-> obj fangif)) - (format #t "~Thvdfoffs: #~%" (-> obj hvdfoffs)) - (format #t "~Tinvhscale: #~%" (-> obj invhscale)) - (format #t "~Tguard: #~%" (-> obj guard)) - (format #t "~Tatest[2] @ #x~X~%" (-> obj atest)) - (format #t "~Tatest-tra: #~%" (-> obj atest)) - (format #t "~Tatest-def: #~%" (-> obj atest-def)) - obj +(defmethod inspect tie-near-consts ((this tie-near-consts)) + (format #t "[~8x] ~A~%" this 'tie-near-consts) + (format #t "~Textra: #~%" (-> this extra)) + (format #t "~Tgifbufs: #~%" (-> this gifbufs)) + (format #t "~Tclrbufs: #~%" (-> this clrbufs)) + (format #t "~Tadgif: #~%" (-> this adgif)) + (format #t "~Tstrgif: #~%" (-> this strgif)) + (format #t "~Tfangif: #~%" (-> this fangif)) + (format #t "~Thvdfoffs: #~%" (-> this hvdfoffs)) + (format #t "~Tinvhscale: #~%" (-> this invhscale)) + (format #t "~Tguard: #~%" (-> this guard)) + (format #t "~Tatest[2] @ #x~X~%" (-> this atest)) + (format #t "~Tatest-tra: #~%" (-> this atest)) + (format #t "~Tatest-def: #~%" (-> this atest-def)) + this ) ;; definition for symbol tie-near-vu1-block, type vu-function @@ -130,6 +130,18 @@ ;; definition for function tie-near-init-engine ;; INFO: Return type mismatch int vs none. ;; ERROR: Failed store: (s.w! (+ a0-2 8) a1-4) at op 19 +;; ERROR: Failed store: (s.w! (+ a0-2 12) a1-6) at op 24 +;; ERROR: Failed store: (s.w! (+ a0-6 8) a1-9) at op 40 +;; ERROR: Failed store: (s.w! (+ a0-6 12) a1-10) at op 42 +;; ERROR: Failed store: (s.w! (+ a0-8 8) 0) at op 49 +;; ERROR: Failed store: (s.w! (+ a0-8 12) a1-12) at op 51 +;; ERROR: Failed store: (s.w! (+ v1-7 4) a0-11) at op 58 +;; ERROR: Failed store: (s.w! (+ v1-7 8) a0-12) at op 60 +;; ERROR: Failed store: (s.w! (+ v1-7 12) a0-13) at op 62 +;; ERROR: Failed store: (s.w! (+ v1-7 16) a0-14) at op 64 +;; ERROR: Failed store: (s.w! (+ v1-7 20) a0-15) at op 66 +;; ERROR: Failed store: (s.w! (+ v1-7 24) a0-16) at op 68 +;; ERROR: Failed store: (s.w! (+ v1-7 28) a0-17) at op 70 (defun tie-near-init-engine ((arg0 dma-buffer) (arg1 gs-test) (arg2 int)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tie-near)) (dma-buffer-add-vu-function arg0 tie-near-vu1-block 1) @@ -203,7 +215,15 @@ ;; definition for function tie-near-end-buffer ;; INFO: Return type mismatch int vs none. -;; ERROR: Failed store: (s.w! (+ a1-0 8) 0) at op 7 +;; ERROR: Failed store: (s.w! (+ a1-6 8) a2-8) at op 34 +;; ERROR: Failed store: (s.w! (+ a1-6 12) 0) at op 35 +;; ERROR: Failed store: (s.w! (+ a0-1 4) a1-9) at op 43 +;; ERROR: Failed store: (s.w! (+ a0-1 8) a1-10) at op 45 +;; ERROR: Failed store: (s.w! (+ a0-1 12) a1-11) at op 47 +;; ERROR: Failed store: (s.w! (+ a0-1 16) 0) at op 48 +;; ERROR: Failed store: (s.w! (+ a0-1 20) 0) at op 49 +;; ERROR: Failed store: (s.w! (+ a0-1 24) 0) at op 50 +;; ERROR: Failed store: (s.w! (+ a0-1 28) 0) at op 51 (defun tie-near-end-buffer ((arg0 dma-buffer)) (when (logtest? *vu1-enable-user* (vu1-renderer-mask tie-near)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test diff --git a/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc b/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc index 5c87d95e20..2388483285 100644 --- a/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/tie/tie_REF.gc @@ -2,71 +2,71 @@ (in-package goal) ;; definition for method 9 of type tie-fragment -(defmethod login tie-fragment ((obj tie-fragment)) - (let ((s5-0 (-> obj gif-ref)) - (s4-0 (/ (-> obj tex-count) (the-as uint 5))) +(defmethod login tie-fragment ((this tie-fragment)) + (let ((s5-0 (-> this gif-ref)) + (s4-0 (/ (-> this tex-count) (the-as uint 5))) ) (dotimes (s3-0 (the-as int s4-0)) (adgif-shader-login-no-remap (-> s5-0 s3-0)) ) ) - obj + this ) ;; definition for method 3 of type drawable-inline-array-instance-tie -(defmethod inspect drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) ;; definition for method 5 of type drawable-inline-array-instance-tie ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie)) - (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> obj length) -1) 64))) +(defmethod asize-of drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) + (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64))) ) ;; definition for method 9 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files -(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) - obj +(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) + this ) ;; definition for method 9 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files ;; INFO: Return type mismatch symbol vs drawable-tree-instance-tie. -(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) (the-as drawable-tree-instance-tie #f) ) ;; definition for method 3 of type prototype-tie -(defmethod inspect prototype-tie ((obj prototype-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect prototype-tie ((this prototype-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) ;; definition for method 9 of type prototype-tie -(defmethod login prototype-tie ((obj prototype-tie)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login prototype-tie ((this prototype-tie)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) ;; definition for method 8 of type drawable-tree-instance-tie -(defmethod mem-usage drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -74,17 +74,17 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - (mem-usage (-> obj prototypes prototype-array-tie) arg0 (logior arg1 1)) - obj + (mem-usage (-> this prototypes prototype-array-tie) arg0 (logior arg1 1)) + this ) ;; definition for method 8 of type tie-fragment -(defmethod mem-usage tie-fragment ((obj tie-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage tie-fragment ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) (when (logtest? arg1 2) - (let ((v1-3 (* (-> obj color-count) 4)) + (let ((v1-3 (* (-> this color-count) 4)) (a0-2 (cond ((logtest? arg1 4) 20 @@ -103,7 +103,7 @@ (+! (-> arg0 data a0-2 total) (logand -4 (+ v1-3 3))) ) (set! (-> arg0 length) (max 23 (-> arg0 length))) - (set! obj obj) + (set! this this) (goto cfg-13) ) (set! (-> arg0 length) (max 18 (-> arg0 length))) @@ -115,53 +115,53 @@ (set! (-> arg0 data 13 name) "tie-draw-points") (set! (-> arg0 data 17 name) "tie-generic") (+! (-> arg0 data 9 count) 1) - (let ((v1-21 (asize-of obj))) + (let ((v1-21 (asize-of this))) (+! (-> arg0 data 9 used) v1-21) (+! (-> arg0 data 9 total) (logand -16 (+ v1-21 15))) ) - (let ((v1-26 (* (-> obj gif-count) 16))) - (+! (-> arg0 data 10 count) (-> obj tex-count)) + (let ((v1-26 (* (-> this gif-count) 16))) + (+! (-> arg0 data 10 count) (-> this tex-count)) (+! (-> arg0 data 10 used) v1-26) (+! (-> arg0 data 10 total) (logand -16 (+ v1-26 15))) ) - (let ((v1-31 (* (-> obj vertex-count) 16))) - (+! (-> arg0 data 11 count) (-> obj vertex-count)) + (let ((v1-31 (* (-> this vertex-count) 16))) + (+! (-> arg0 data 11 count) (-> this vertex-count)) (+! (-> arg0 data 11 used) v1-31) (+! (-> arg0 data 11 total) (logand -16 (+ v1-31 15))) ) - (let ((v1-36 (* (-> obj dp-qwc) 16))) - (+! (-> arg0 data 13 count) (* (-> obj dp-qwc) 16)) + (let ((v1-36 (* (-> this dp-qwc) 16))) + (+! (-> arg0 data 13 count) (* (-> this dp-qwc) 16)) (+! (-> arg0 data 13 used) v1-36) (+! (-> arg0 data 13 total) (logand -16 (+ v1-36 15))) ) - (let ((v1-41 (* (-> obj generic-count) 16))) + (let ((v1-41 (* (-> this generic-count) 16))) (+! (-> arg0 data 17 count) 1) (+! (-> arg0 data 17 used) v1-41) (+! (-> arg0 data 17 total) (logand -16 (+ v1-41 15))) ) - (when (nonzero? (-> obj debug-lines)) - (dotimes (s4-0 (-> obj debug-lines length)) - (+! (-> arg0 data 14 count) (-> (the-as (pointer int32) (-> obj debug-lines s4-0)) 0)) - (let ((v1-52 (asize-of (the-as basic (-> obj debug-lines s4-0))))) + (when (nonzero? (-> this debug-lines)) + (dotimes (s4-0 (-> this debug-lines length)) + (+! (-> arg0 data 14 count) (-> (the-as (pointer int32) (-> this debug-lines s4-0)) 0)) + (let ((v1-52 (asize-of (the-as basic (-> this debug-lines s4-0))))) (+! (-> arg0 data 12 used) v1-52) (+! (-> arg0 data 12 total) (logand -16 (+ v1-52 15))) ) ) ) (label cfg-13) - obj + this ) ;; definition for method 8 of type instance-tie -(defmethod mem-usage instance-tie ((obj instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage instance-tie ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 19 (-> arg0 length))) (set! (-> arg0 data 18 name) "instance-tie") (+! (-> arg0 data 18 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 18 used) v1-6) (+! (-> arg0 data 18 total) (logand -16 (+ v1-6 15))) ) - (when (nonzero? (-> obj error)) + (when (nonzero? (-> this error)) (set! (-> arg0 length) (max 24 (-> arg0 length))) (set! (-> arg0 data 23 name) "instance-tie-colors*") (set! (-> arg0 data 19 name) "instance-tie-colors0") @@ -169,7 +169,7 @@ (set! (-> arg0 data 21 name) "instance-tie-colors2") (set! (-> arg0 data 22 name) "instance-tie-colors3") (+! (-> arg0 data 23 count) 1) - (let ((s3-0 (-> obj bucket-ptr))) + (let ((s3-0 (-> this bucket-ptr))) (+ (-> arg0 data 19 used) (-> arg0 data 20 used) (-> arg0 data 21 used) (-> arg0 data 22 used)) (dotimes (s2-0 4) (let ((a0-10 (-> s3-0 geometry-override s2-0))) @@ -203,11 +203,11 @@ ) ) ) - obj + this ) ;; definition for method 8 of type drawable-inline-array-instance-tie -(defmethod mem-usage drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -215,14 +215,14 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 8 of type prototype-tie -(defmethod mem-usage prototype-tie ((obj prototype-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-tie ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -230,16 +230,16 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 5 of type prototype-tie ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of prototype-tie ((obj prototype-tie)) - (the-as int (+ (-> prototype-tie size) (* (+ (-> obj length) -1) 64))) +(defmethod asize-of prototype-tie ((this prototype-tie)) + (the-as int (+ (-> prototype-tie size) (* (+ (-> this length) -1) 64))) ) ;; definition of type tie-consts @@ -264,22 +264,22 @@ ) ;; definition for method 3 of type tie-consts -(defmethod inspect tie-consts ((obj tie-consts)) - (format #t "[~8x] ~A~%" obj 'tie-consts) - (format #t "~Tdata[24] @ #x~X~%" (-> obj data)) - (format #t "~Tvector[6] @ #x~X~%" (-> obj data)) - (format #t "~Tquads[6] @ #x~X~%" (-> obj data)) - (format #t "~Tadgif: #~%" (-> obj data)) - (format #t "~Tstrgif: #~%" (-> obj strgif)) - (format #t "~Textra: #~%" (-> obj extra)) - (format #t "~Tgifbufs: #~%" (-> obj gifbufs)) - (format #t "~Tclrbufs: #~%" (-> obj clrbufs)) - (format #t "~Tmisc: #~%" (-> obj misc)) - (format #t "~Tatestgif: #~%" (-> obj atestgif)) - (format #t "~Tatest[2] @ #x~X~%" (-> obj atest)) - (format #t "~Tatest-tra: #~%" (-> obj atest)) - (format #t "~Tatest-def: #~%" (-> obj atest-def)) - obj +(defmethod inspect tie-consts ((this tie-consts)) + (format #t "[~8x] ~A~%" this 'tie-consts) + (format #t "~Tdata[24] @ #x~X~%" (-> this data)) + (format #t "~Tvector[6] @ #x~X~%" (-> this data)) + (format #t "~Tquads[6] @ #x~X~%" (-> this data)) + (format #t "~Tadgif: #~%" (-> this data)) + (format #t "~Tstrgif: #~%" (-> this strgif)) + (format #t "~Textra: #~%" (-> this extra)) + (format #t "~Tgifbufs: #~%" (-> this gifbufs)) + (format #t "~Tclrbufs: #~%" (-> this clrbufs)) + (format #t "~Tmisc: #~%" (-> this misc)) + (format #t "~Tatestgif: #~%" (-> this atestgif)) + (format #t "~Tatest[2] @ #x~X~%" (-> this atest)) + (format #t "~Tatest-tra: #~%" (-> this atest)) + (format #t "~Tatest-def: #~%" (-> this atest-def)) + this ) ;; definition for symbol tie-vu1-block, type vu-function diff --git a/test/decompiler/reference/jak1/engine/gfx/vu1-user-h_REF.gc b/test/decompiler/reference/jak1/engine/gfx/vu1-user-h_REF.gc index 9635597185..2b35df913e 100644 --- a/test/decompiler/reference/jak1/engine/gfx/vu1-user-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/gfx/vu1-user-h_REF.gc @@ -40,13 +40,13 @@ ) ;; definition for method 3 of type dma-foreground-sink -(defmethod inspect dma-foreground-sink ((obj dma-foreground-sink)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tbucket: ~D~%" (-> obj bucket)) - (format #t "~Tforeground-texture-page: ~D~%" (-> obj foreground-texture-page)) - (format #t "~Tforeground-texture-level: ~D~%" (-> obj foreground-texture-level)) - (format #t "~Tforeground-output-bucket: ~D~%" (-> obj foreground-output-bucket)) - obj +(defmethod inspect dma-foreground-sink ((this dma-foreground-sink)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tbucket: ~D~%" (-> this bucket)) + (format #t "~Tforeground-texture-page: ~D~%" (-> this foreground-texture-page)) + (format #t "~Tforeground-texture-level: ~D~%" (-> this foreground-texture-level)) + (format #t "~Tforeground-output-bucket: ~D~%" (-> this foreground-output-bucket)) + this ) ;; definition of type generic-bucket-state @@ -61,11 +61,11 @@ ) ;; definition for method 3 of type generic-bucket-state -(defmethod inspect generic-bucket-state ((obj generic-bucket-state)) - (format #t "[~8x] ~A~%" obj 'generic-bucket-state) - (format #t "~Tgifbuf-adr: ~D~%" (-> obj gifbuf-adr)) - (format #t "~Tinbuf-adr: ~D~%" (-> obj inbuf-adr)) - obj +(defmethod inspect generic-bucket-state ((this generic-bucket-state)) + (format #t "[~8x] ~A~%" this 'generic-bucket-state) + (format #t "~Tgifbuf-adr: ~D~%" (-> this gifbuf-adr)) + (format #t "~Tinbuf-adr: ~D~%" (-> this inbuf-adr)) + this ) ;; definition of type generic-dma-foreground-sink @@ -78,14 +78,14 @@ ) ;; definition for method 3 of type generic-dma-foreground-sink -(defmethod inspect generic-dma-foreground-sink ((obj generic-dma-foreground-sink)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tbucket: ~D~%" (-> obj bucket)) - (format #t "~Tforeground-texture-page: ~D~%" (-> obj foreground-texture-page)) - (format #t "~Tforeground-texture-level: ~D~%" (-> obj foreground-texture-level)) - (format #t "~Tforeground-output-bucket: ~D~%" (-> obj foreground-output-bucket)) - (format #t "~Tstate: #~%" (-> obj state)) - obj +(defmethod inspect generic-dma-foreground-sink ((this generic-dma-foreground-sink)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tbucket: ~D~%" (-> this bucket)) + (format #t "~Tforeground-texture-page: ~D~%" (-> this foreground-texture-page)) + (format #t "~Tforeground-texture-level: ~D~%" (-> this foreground-texture-level)) + (format #t "~Tforeground-output-bucket: ~D~%" (-> this foreground-output-bucket)) + (format #t "~Tstate: #~%" (-> this state)) + this ) ;; definition of type dma-foreground-sink-group @@ -101,13 +101,13 @@ ) ;; definition for method 3 of type dma-foreground-sink-group -(defmethod inspect dma-foreground-sink-group ((obj dma-foreground-sink-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tsink[3] @ #x~X~%" (-> obj sink)) - (format #t "~Tmerc-sink: ~A~%" (-> obj merc-sink)) - (format #t "~Tgeneric-sink: ~A~%" (-> obj generic-sink)) - (format #t "~Tlevel: ~A~%" (-> obj level)) - obj +(defmethod inspect dma-foreground-sink-group ((this dma-foreground-sink-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tsink[3] @ #x~X~%" (-> this sink)) + (format #t "~Tmerc-sink: ~A~%" (-> this merc-sink)) + (format #t "~Tgeneric-sink: ~A~%" (-> this generic-sink)) + (format #t "~Tlevel: ~A~%" (-> this level)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/level/bsp-h_REF.gc b/test/decompiler/reference/jak1/engine/level/bsp-h_REF.gc index 47ec13726c..a4b8d46309 100644 --- a/test/decompiler/reference/jak1/engine/level/bsp-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/bsp-h_REF.gc @@ -15,14 +15,14 @@ ) ;; definition for method 3 of type bsp-node -(defmethod inspect bsp-node ((obj bsp-node)) - (format #t "[~8x] ~A~%" obj 'bsp-node) - (format #t "~Tfront: ~D~%" (-> obj front)) - (format #t "~Tback: ~D~%" (-> obj back)) - (format #t "~Tfront-flags: ~D~%" (-> obj front-flags)) - (format #t "~Tback-flags: ~D~%" (-> obj back-flags)) - (format #t "~Tplane: #~%" (-> obj plane)) - obj +(defmethod inspect bsp-node ((this bsp-node)) + (format #t "[~8x] ~A~%" this 'bsp-node) + (format #t "~Tfront: ~D~%" (-> this front)) + (format #t "~Tback: ~D~%" (-> this back)) + (format #t "~Tfront-flags: ~D~%" (-> this front-flags)) + (format #t "~Tback-flags: ~D~%" (-> this back-flags)) + (format #t "~Tplane: #~%" (-> this plane)) + this ) ;; definition of type bsp-header @@ -77,10 +77,10 @@ ) ;; definition for method 3 of type game-level -(defmethod inspect game-level ((obj game-level)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tmaster-bsp: ~A~%" (-> obj master-bsp)) - obj +(defmethod inspect game-level ((this game-level)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tmaster-bsp: ~A~%" (-> this master-bsp)) + this ) ;; definition of type view-frustum @@ -100,29 +100,29 @@ ) ;; definition for method 3 of type view-frustum -(defmethod inspect view-frustum ((obj view-frustum)) - (format #t "[~8x] ~A~%" obj 'view-frustum) - (format #t "~Thither-top-left: #~%" (-> obj hither-top-left)) - (format #t "~Thither-top-right: #~%" (-> obj hither-top-right)) - (format #t "~Thither-bottom-left: #~%" (-> obj hither-bottom-left)) - (format #t "~Thither-bottom-right: #~%" (-> obj hither-bottom-right)) - (format #t "~Tyon-top-left: #~%" (-> obj yon-top-left)) - (format #t "~Tyon-top-right: #~%" (-> obj yon-top-right)) - (format #t "~Tyon-bottom-left: #~%" (-> obj yon-bottom-left)) - (format #t "~Tyon-bottom-right: #~%" (-> obj yon-bottom-right)) - obj +(defmethod inspect view-frustum ((this view-frustum)) + (format #t "[~8x] ~A~%" this 'view-frustum) + (format #t "~Thither-top-left: #~%" (-> this hither-top-left)) + (format #t "~Thither-top-right: #~%" (-> this hither-top-right)) + (format #t "~Thither-bottom-left: #~%" (-> this hither-bottom-left)) + (format #t "~Thither-bottom-right: #~%" (-> this hither-bottom-right)) + (format #t "~Tyon-top-left: #~%" (-> this yon-top-left)) + (format #t "~Tyon-top-right: #~%" (-> this yon-top-right)) + (format #t "~Tyon-bottom-left: #~%" (-> this yon-bottom-left)) + (format #t "~Tyon-bottom-right: #~%" (-> this yon-bottom-right)) + this ) ;; definition for method 3 of type bsp-header -(defmethod inspect bsp-header ((obj bsp-header)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tall-visible-list: #x~X~%" (-> obj all-visible-list)) - (format #t "~Tvisible-list-length: ~D~%" (-> obj visible-list-length)) - (format #t "~Tdrawable-trees: ~A~%" (-> obj drawable-trees)) - (format #t "~Tpat: #x~X~%" (-> obj pat)) - (format #t "~Tpat-length: ~D~%" (-> obj pat-length)) - (inspect-bsp-tree obj (the-as bsp-node (-> obj nodes))) - obj +(defmethod inspect bsp-header ((this bsp-header)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tall-visible-list: #x~X~%" (-> this all-visible-list)) + (format #t "~Tvisible-list-length: ~D~%" (-> this visible-list-length)) + (format #t "~Tdrawable-trees: ~A~%" (-> this drawable-trees)) + (format #t "~Tpat: #x~X~%" (-> this pat)) + (format #t "~Tpat-length: ~D~%" (-> this pat-length)) + (inspect-bsp-tree this (the-as bsp-node (-> this nodes))) + this ) ;; definition (debug) for function inspect-bsp-tree @@ -184,12 +184,12 @@ ) ;; definition for method 3 of type cl-stat -(defmethod inspect cl-stat ((obj cl-stat)) - (format #t "[~8x] ~A~%" obj 'cl-stat) - (format #t "~Tfragments: ~D~%" (-> obj fragments)) - (format #t "~Ttris: ~D~%" (-> obj tris)) - (format #t "~Toutput: ~D~%" (-> obj output)) - obj +(defmethod inspect cl-stat ((this cl-stat)) + (format #t "[~8x] ~A~%" this 'cl-stat) + (format #t "~Tfragments: ~D~%" (-> this fragments)) + (format #t "~Ttris: ~D~%" (-> this tris)) + (format #t "~Toutput: ~D~%" (-> this output)) + this ) ;; definition of type collide-stats @@ -209,16 +209,16 @@ ) ;; definition for method 3 of type collide-stats -(defmethod inspect collide-stats ((obj collide-stats)) - (format #t "[~8x] ~A~%" obj 'collide-stats) - (format #t "~Tother: #~%" (-> obj other)) - (format #t "~Ttotal: #~%" (-> obj total)) - (format #t "~Tnodes: ~D~%" (-> obj nodes)) - (format #t "~Tcalls: ~D~%" (-> obj calls)) - (format #t "~Ttotal-target: #~%" (-> obj total-target)) - (format #t "~Ttarget-cache-fill: #~%" (-> obj target-cache-fill)) - (format #t "~Ttarget-ray-poly: #~%" (-> obj target-ray-poly)) - obj +(defmethod inspect collide-stats ((this collide-stats)) + (format #t "[~8x] ~A~%" this 'collide-stats) + (format #t "~Tother: #~%" (-> this other)) + (format #t "~Ttotal: #~%" (-> this total)) + (format #t "~Tnodes: ~D~%" (-> this nodes)) + (format #t "~Tcalls: ~D~%" (-> this calls)) + (format #t "~Ttotal-target: #~%" (-> this total-target)) + (format #t "~Ttarget-cache-fill: #~%" (-> this target-cache-fill)) + (format #t "~Ttarget-ray-poly: #~%" (-> this target-ray-poly)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/level/bsp_REF.gc b/test/decompiler/reference/jak1/engine/level/bsp_REF.gc index d268a64212..a04c512c05 100644 --- a/test/decompiler/reference/jak1/engine/level/bsp_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/bsp_REF.gc @@ -25,19 +25,19 @@ ) ;; definition for method 8 of type bsp-header -(defmethod mem-usage bsp-header ((obj bsp-header) (mem-use memory-usage-block) (flags int)) - (set! (-> mem-use work-bsp) obj) - (when (nonzero? (-> obj info)) +(defmethod mem-usage bsp-header ((this bsp-header) (mem-use memory-usage-block) (flags int)) + (set! (-> mem-use work-bsp) this) + (when (nonzero? (-> this info)) (set! (-> mem-use length) (max 82 (-> mem-use length))) (set! (-> mem-use data 81 name) "array") (+! (-> mem-use data 81 count) 1) - (let ((v1-8 (asize-of (-> obj info)))) + (let ((v1-8 (asize-of (-> this info)))) (+! (-> mem-use data 81 used) v1-8) (+! (-> mem-use data 81 total) (logand -16 (+ v1-8 15))) ) ) - (if (nonzero? (-> obj drawable-trees)) - (mem-usage (-> obj drawable-trees) mem-use flags) + (if (nonzero? (-> this drawable-trees)) + (mem-usage (-> this drawable-trees) mem-use flags) ) (set! (-> mem-use length) (max 63 (-> mem-use length))) (set! (-> mem-use data 43 name) "entity") @@ -54,98 +54,98 @@ (set! (-> mem-use length) (max 60 (-> mem-use length))) (set! (-> mem-use data 59 name) "bsp-leaf-vis-self") (+! (-> mem-use data 59 count) 1) - (let ((v1-36 (-> obj visible-list-length))) + (let ((v1-36 (-> this visible-list-length))) (+! (-> mem-use data 59 used) v1-36) (+! (-> mem-use data 59 total) (logand -16 (+ v1-36 15))) ) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-46 (* (-> obj texture-remap-table-len) 8))) + (let ((v1-46 (* (-> this texture-remap-table-len) 8))) (+! (-> mem-use data 57 used) v1-46) (+! (-> mem-use data 57 total) (logand -16 (+ v1-46 15))) ) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-56 (* (-> obj texture-page-count) 4))) + (let ((v1-56 (* (-> this texture-page-count) 4))) (+! (-> mem-use data 57 used) v1-56) (+! (-> mem-use data 57 total) (logand -16 (+ v1-56 15))) ) - (when (nonzero? (-> obj unk-zero-0)) + (when (nonzero? (-> this unk-zero-0)) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-68 (asize-of (-> obj unk-zero-0)))) + (let ((v1-68 (asize-of (-> this unk-zero-0)))) (+! (-> mem-use data 57 used) v1-68) (+! (-> mem-use data 57 total) (logand -16 (+ v1-68 15))) ) ) - (when (nonzero? (-> obj adgifs)) + (when (nonzero? (-> this adgifs)) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-80 (asize-of (-> obj adgifs)))) + (let ((v1-80 (asize-of (-> this adgifs)))) (+! (-> mem-use data 57 used) v1-80) (+! (-> mem-use data 57 total) (logand -16 (+ v1-80 15))) ) ) - (when (nonzero? (-> obj boxes)) + (when (nonzero? (-> this boxes)) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-92 (asize-of (-> obj boxes)))) + (let ((v1-92 (asize-of (-> this boxes)))) (+! (-> mem-use data 57 used) v1-92) (+! (-> mem-use data 57 total) (logand -16 (+ v1-92 15))) ) - (when (nonzero? (-> obj split-box-indices)) + (when (nonzero? (-> this split-box-indices)) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-105 (* (-> obj boxes length) 2))) + (let ((v1-105 (* (-> this boxes length) 2))) (+! (-> mem-use data 57 used) v1-105) (+! (-> mem-use data 57 total) (logand -16 (+ v1-105 15))) ) ) ) - (when (nonzero? (-> obj actor-birth-order)) + (when (nonzero? (-> this actor-birth-order)) (set! (-> mem-use length) (max 58 (-> mem-use length))) (set! (-> mem-use data 57 name) "bsp-misc") (+! (-> mem-use data 57 count) 1) - (let ((v1-118 (* (-> obj actors length) 4))) + (let ((v1-118 (* (-> this actors length) 4))) (+! (-> mem-use data 57 used) v1-118) (+! (-> mem-use data 57 total) (logand -16 (+ v1-118 15))) ) ) - (+! (-> mem-use data 62 count) (-> obj pat-length)) - (let ((v1-125 (* (-> obj pat-length) 4))) + (+! (-> mem-use data 62 count) (-> this pat-length)) + (let ((v1-125 (* (-> this pat-length) 4))) (+! (-> mem-use data 62 used) v1-125) (+! (-> mem-use data 62 total) (logand -16 (+ v1-125 15))) ) - (let ((s3-0 (-> obj cameras))) + (let ((s3-0 (-> this cameras))) (when (nonzero? s3-0) (dotimes (s2-0 (-> s3-0 length)) (mem-usage (-> s3-0 s2-0) mem-use (logior flags 256)) ) ) ) - (mem-usage-bsp-tree obj (the-as bsp-node (-> obj nodes)) mem-use flags) - obj + (mem-usage-bsp-tree this (the-as bsp-node (-> this nodes)) mem-use flags) + this ) ;; definition for method 9 of type bsp-header -(defmethod login bsp-header ((obj bsp-header)) - (if (nonzero? (-> obj drawable-trees)) - (login (-> obj drawable-trees)) +(defmethod login bsp-header ((this bsp-header)) + (if (nonzero? (-> this drawable-trees)) + (login (-> this drawable-trees)) ) - (when (nonzero? (-> obj adgifs)) - (let ((s5-0 (-> obj adgifs))) + (when (nonzero? (-> this adgifs)) + (let ((s5-0 (-> this adgifs))) (dotimes (s4-0 (-> s5-0 length)) (adgif-shader-login-no-remap (-> s5-0 data s4-0)) ) ) ) - obj + this ) ;; definition for symbol *test-shrub*, type int @@ -153,7 +153,7 @@ ;; definition for method 10 of type bsp-header ;; INFO: Used lq/sq -(defmethod draw bsp-header ((obj bsp-header) (other-draw bsp-header) (disp-frame display-frame)) +(defmethod draw bsp-header ((this bsp-header) (other-draw bsp-header) (disp-frame display-frame)) (local-vars (a3-4 uint128) (a3-5 uint128)) (rlet ((vf16 :class vf) (vf17 :class vf) @@ -172,7 +172,7 @@ (vf30 :class vf) (vf31 :class vf) ) - (let ((lev (-> obj level))) + (let ((lev (-> this level))) (set! (-> (the-as terrain-bsp #x70000000) lev-index) (-> lev index)) (set! (-> (the-as terrain-bsp #x70000000) mood) (-> lev mood)) (if *artist-use-menu-subdiv* @@ -180,7 +180,7 @@ (update-subdivide-settings! *subdivide-settings* *math-camera* (-> lev index)) ) (add-irq-to-tex-buckets! lev) - (let ((vis-list-qwc (/ (+ (-> obj visible-list-length) 15) 16))) + (let ((vis-list-qwc (/ (+ (-> this visible-list-length) 15) 16))) (dma-send-to-spr-no-flush (the-as uint (+ #x38b0 #x70000000)) (the-as uint (-> lev vis-bits)) @@ -190,9 +190,9 @@ ) ) (when *artist-flip-visible* - (let ((vis-list-qwc2 (/ (+ (-> obj visible-list-length) 15) 16)) + (let ((vis-list-qwc2 (/ (+ (-> this visible-list-length) 15) 16)) (vis-list-spad (the-as (pointer uint128) (+ #x38b0 #x70000000))) - (vis-list-lev (the-as (pointer uint128) (-> obj all-visible-list))) + (vis-list-lev (the-as (pointer uint128) (-> this all-visible-list))) ) (dotimes (current-qw vis-list-qwc2) (let ((a3-3 (-> vis-list-spad current-qw))) @@ -223,7 +223,7 @@ (.lvf vf30 (&-> at-0 camera-temp vector 2 quad)) (.lvf vf31 (&-> at-0 camera-temp vector 3 quad)) ) - (when (nonzero? (-> obj drawable-trees)) + (when (nonzero? (-> this drawable-trees)) (if *debug-segment* (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) @@ -231,7 +231,7 @@ (new 'static 'rgba :r #x40 :b #x40 :a #x80) ) ) - (let ((a1-7 (-> obj drawable-trees))) + (let ((a1-7 (-> this drawable-trees))) (draw a1-7 a1-7 disp-frame) ) (if *debug-segment* @@ -244,19 +244,19 @@ ) (let ((s5-1 (-> *display* frames (-> *display* on-screen) frame))) (foreground-engine-execute - (-> obj level foreground-draw-engine 0) + (-> this level foreground-draw-engine 0) s5-1 (-> (the-as terrain-bsp #x70000000) lev-index) 0 ) (foreground-engine-execute - (-> obj level foreground-draw-engine 1) + (-> this level foreground-draw-engine 1) s5-1 (-> (the-as terrain-bsp #x70000000) lev-index) 1 ) (foreground-engine-execute - (-> obj level foreground-draw-engine 2) + (-> this level foreground-draw-engine 2) s5-1 (-> (the-as terrain-bsp #x70000000) lev-index) 2 @@ -268,7 +268,7 @@ ;; definition for method 15 of type bsp-header ;; INFO: Return type mismatch profile-frame vs none. -(defmethod debug-draw bsp-header ((obj bsp-header) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw bsp-header ((this bsp-header) (arg0 drawable) (arg1 display-frame)) (rlet ((vf16 :class vf) (vf17 :class vf) (vf18 :class vf) @@ -286,11 +286,11 @@ (vf30 :class vf) (vf31 :class vf) ) - (let ((s4-0 (-> obj level))) + (let ((s4-0 (-> this level))) (set! (-> (the-as terrain-bsp #x70000000) lev-index) (-> s4-0 index)) (set! (-> (the-as terrain-bsp #x70000000) mood) (-> s4-0 mood)) (add-irq-to-tex-buckets! s4-0) - (let ((a2-1 (/ (+ (-> obj visible-list-length) 15) 16))) + (let ((a2-1 (/ (+ (-> this visible-list-length) 15) 16))) (dma-send-to-spr-no-flush (the-as uint (+ #x38b0 #x70000000)) (the-as uint (-> s4-0 vis-bits)) @@ -317,7 +317,7 @@ (.lvf vf30 (&-> at-0 camera-temp vector 2 quad)) (.lvf vf31 (&-> at-0 camera-temp vector 3 quad)) ) - (when (nonzero? (-> obj drawable-trees)) + (when (nonzero? (-> this drawable-trees)) (if *debug-segment* (add-frame (-> *display* frames (-> *display* on-screen) frame profile-bar 0) @@ -325,7 +325,7 @@ (new 'static 'rgba :r #x40 :b #x40 :a #x80) ) ) - (let ((a1-3 (-> obj drawable-trees))) + (let ((a1-3 (-> this drawable-trees))) (debug-draw a1-3 a1-3 arg1) ) (if *debug-segment* @@ -341,7 +341,7 @@ ) ;; definition for method 14 of type bsp-header -(defmethod collect-stats bsp-header ((obj bsp-header)) +(defmethod collect-stats bsp-header ((this bsp-header)) (rlet ((vf16 :class vf) (vf17 :class vf) (vf18 :class vf) @@ -359,8 +359,8 @@ (vf30 :class vf) (vf31 :class vf) ) - (let ((v1-0 (-> obj level)) - (a2-0 (/ (+ (-> obj visible-list-length) 15) 16)) + (let ((v1-0 (-> this level)) + (a2-0 (/ (+ (-> this visible-list-length) 15) 16)) ) (dma-send-to-spr-no-flush (the-as uint (+ #x38b0 #x70000000)) @@ -387,8 +387,8 @@ (.lvf vf30 (&-> at-0 camera-temp vector 2 quad)) (.lvf vf31 (&-> at-0 camera-temp vector 3 quad)) ) - (if (nonzero? (-> obj drawable-trees)) - (collect-stats (-> obj drawable-trees)) + (if (nonzero? (-> this drawable-trees)) + (collect-stats (-> this drawable-trees)) ) (none) ) @@ -429,9 +429,9 @@ ;; definition for method 11 of type bsp-header ;; INFO: Return type mismatch symbol vs none. -(defmethod collide-with-box bsp-header ((obj bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-with-box bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) (+! (-> *collide-stats* calls) 1) - (let ((s4-0 (-> obj drawable-trees))) + (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) (collide-with-box (-> s4-0 trees s3-0) arg0 arg1) ) @@ -441,9 +441,9 @@ ;; definition for method 12 of type bsp-header ;; INFO: Return type mismatch symbol vs none. -(defmethod collide-y-probe bsp-header ((obj bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-y-probe bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) (+! (-> *collide-stats* calls) 1) - (let ((s4-0 (-> obj drawable-trees))) + (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) (collide-y-probe (-> s4-0 trees s3-0) arg0 arg1) ) @@ -453,9 +453,9 @@ ;; definition for method 13 of type bsp-header ;; INFO: Return type mismatch symbol vs none. -(defmethod collide-ray bsp-header ((obj bsp-header) (arg0 int) (arg1 collide-list)) +(defmethod collide-ray bsp-header ((this bsp-header) (arg0 int) (arg1 collide-list)) (+! (-> *collide-stats* calls) 1) - (let ((s4-0 (-> obj drawable-trees))) + (let ((s4-0 (-> this drawable-trees))) (dotimes (s3-0 (-> s4-0 length)) (collide-ray (-> s4-0 trees s3-0) arg0 arg1) ) @@ -465,8 +465,8 @@ ;; definition for method 17 of type bsp-header ;; INFO: Return type mismatch symbol vs none. -(defmethod collect-ambients bsp-header ((obj bsp-header) (arg0 sphere) (arg1 int) (arg2 ambient-list)) - (let ((s3-0 (-> obj drawable-trees))) +(defmethod collect-ambients bsp-header ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 ambient-list)) + (let ((s3-0 (-> this drawable-trees))) (dotimes (s2-0 (-> s3-0 length)) (collect-ambients (-> s3-0 trees s2-0) arg0 arg1 arg2) ) diff --git a/test/decompiler/reference/jak1/engine/level/level-h_REF.gc b/test/decompiler/reference/jak1/engine/level/level-h_REF.gc index c827abd0ec..193df4c723 100644 --- a/test/decompiler/reference/jak1/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/level-h_REF.gc @@ -23,28 +23,28 @@ ) ;; definition for method 3 of type level-vis-info -(defmethod inspect level-vis-info ((obj level-vis-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlevel: ~A~%" (-> obj level)) - (format #t "~Tfrom-level: ~A~%" (-> obj from-level)) - (format #t "~Tfrom-bsp: ~A~%" (-> obj from-bsp)) - (format #t "~Tflags: #x~X~%" (-> obj flags)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdictionary-length: ~D~%" (-> obj dictionary-length)) - (format #t "~Tdictionary: #x~X~%" (-> obj dictionary)) - (format #t "~Tstring-block: #x~X~%" (-> obj string-block)) - (format #t "~Tramdisk: ~D~%" (-> obj ramdisk)) - (format #t "~Tvis-bits: #x~X~%" (-> obj vis-bits)) - (format #t "~Tcurrent-vis-string: ~D~%" (-> obj current-vis-string)) - (format #t "~Tvis-string[0] @ #x~X~%" (-> obj vis-string)) - obj +(defmethod inspect level-vis-info ((this level-vis-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlevel: ~A~%" (-> this level)) + (format #t "~Tfrom-level: ~A~%" (-> this from-level)) + (format #t "~Tfrom-bsp: ~A~%" (-> this from-bsp)) + (format #t "~Tflags: #x~X~%" (-> this flags)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdictionary-length: ~D~%" (-> this dictionary-length)) + (format #t "~Tdictionary: #x~X~%" (-> this dictionary)) + (format #t "~Tstring-block: #x~X~%" (-> this string-block)) + (format #t "~Tramdisk: ~D~%" (-> this ramdisk)) + (format #t "~Tvis-bits: #x~X~%" (-> this vis-bits)) + (format #t "~Tcurrent-vis-string: ~D~%" (-> this current-vis-string)) + (format #t "~Tvis-string[0] @ #x~X~%" (-> this vis-string)) + this ) ;; definition for method 5 of type level-vis-info ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of level-vis-info ((obj level-vis-info)) - (the-as int (+ (-> level-vis-info size) (-> obj dictionary-length))) +(defmethod asize-of level-vis-info ((this level-vis-info)) + (the-as int (+ (-> level-vis-info size) (-> this dictionary-length))) ) ;; definition of type level-load-info @@ -83,36 +83,36 @@ ) ;; definition for method 3 of type level-load-info -(defmethod inspect level-load-info ((obj level-load-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname-list[3] @ #x~X~%" (&-> obj name)) - (format #t "~Tindex: ~D~%" (-> obj index)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tvisname: ~A~%" (-> obj visname)) - (format #t "~Tnickname: ~A~%" (-> obj nickname)) - (format #t "~Tpackages: ~A~%" (-> obj packages)) - (format #t "~Tsound-banks: ~A~%" (-> obj sound-banks)) - (format #t "~Tmusic-bank: ~A~%" (-> obj music-bank)) - (format #t "~Tambient-sounds: ~A~%" (-> obj ambient-sounds)) - (format #t "~Tmood: ~A~%" (-> obj mood)) - (format #t "~Tmood-func: ~A~%" (-> obj mood-func)) - (format #t "~Tocean: ~A~%" (-> obj ocean)) - (format #t "~Tsky: ~A~%" (-> obj sky)) - (format #t "~Tsun-fade: ~f~%" (-> obj sun-fade)) - (format #t "~Tcontinues: ~A~%" (-> obj continues)) - (format #t "~Ttasks: ~A~%" (-> obj tasks)) - (format #t "~Tpriority: ~D~%" (-> obj priority)) - (format #t "~Tload-commands: ~A~%" (-> obj load-commands)) - (format #t "~Talt-load-commands: ~A~%" (-> obj alt-load-commands)) - (format #t "~Tbsp-mask: ~D~%" (-> obj bsp-mask)) - (format #t "~Tbsphere: #~%" (-> obj bsphere)) - (format #t "~Tbuzzer: ~D~%" (-> obj buzzer)) - (format #t "~Tbottom-height: (meters ~m)~%" (-> obj bottom-height)) - (format #t "~Trun-packages: ~A~%" (-> obj run-packages)) - (format #t "~Tprev-level: ~A~%" (-> obj prev-level)) - (format #t "~Tnext-level: ~A~%" (-> obj next-level)) - (format #t "~Twait-for-load: ~A~%" (-> obj wait-for-load)) - obj +(defmethod inspect level-load-info ((this level-load-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname-list[3] @ #x~X~%" (&-> this name)) + (format #t "~Tindex: ~D~%" (-> this index)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tvisname: ~A~%" (-> this visname)) + (format #t "~Tnickname: ~A~%" (-> this nickname)) + (format #t "~Tpackages: ~A~%" (-> this packages)) + (format #t "~Tsound-banks: ~A~%" (-> this sound-banks)) + (format #t "~Tmusic-bank: ~A~%" (-> this music-bank)) + (format #t "~Tambient-sounds: ~A~%" (-> this ambient-sounds)) + (format #t "~Tmood: ~A~%" (-> this mood)) + (format #t "~Tmood-func: ~A~%" (-> this mood-func)) + (format #t "~Tocean: ~A~%" (-> this ocean)) + (format #t "~Tsky: ~A~%" (-> this sky)) + (format #t "~Tsun-fade: ~f~%" (-> this sun-fade)) + (format #t "~Tcontinues: ~A~%" (-> this continues)) + (format #t "~Ttasks: ~A~%" (-> this tasks)) + (format #t "~Tpriority: ~D~%" (-> this priority)) + (format #t "~Tload-commands: ~A~%" (-> this load-commands)) + (format #t "~Talt-load-commands: ~A~%" (-> this alt-load-commands)) + (format #t "~Tbsp-mask: ~D~%" (-> this bsp-mask)) + (format #t "~Tbsphere: #~%" (-> this bsphere)) + (format #t "~Tbuzzer: ~D~%" (-> this buzzer)) + (format #t "~Tbottom-height: (meters ~m)~%" (-> this bottom-height)) + (format #t "~Trun-packages: ~A~%" (-> this run-packages)) + (format #t "~Tprev-level: ~A~%" (-> this prev-level)) + (format #t "~Tnext-level: ~A~%" (-> this next-level)) + (format #t "~Twait-for-load: ~A~%" (-> this wait-for-load)) + this ) ;; definition of type login-state @@ -128,13 +128,13 @@ ) ;; definition for method 3 of type login-state -(defmethod inspect login-state ((obj login-state)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tstate: ~D~%" (-> obj state)) - (format #t "~Tpos: ~D~%" (-> obj pos)) - (format #t "~Telts: ~D~%" (-> obj elts)) - (format #t "~Telt[16] @ #x~X~%" (-> obj elt)) - obj +(defmethod inspect login-state ((this login-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tstate: ~D~%" (-> this state)) + (format #t "~Tpos: ~D~%" (-> this pos)) + (format #t "~Telts: ~D~%" (-> this elts)) + (format #t "~Telt[16] @ #x~X~%" (-> this elt)) + this ) ;; definition of type level @@ -212,49 +212,49 @@ ) ;; definition for method 3 of type level -(defmethod inspect level ((obj level)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tload-name: ~A~%" (-> obj load-name)) - (format #t "~Tnickname: ~A~%" (-> obj nickname)) - (format #t "~Tindex: ~D~%" (-> obj index)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tother: ~A~%" (-> obj other)) - (format #t "~Theap: #~%" (-> obj heap)) - (format #t "~Tbsp: ~A~%" (-> obj bsp)) - (format #t "~Tart-group: ~A~%" (-> obj art-group)) - (format #t "~Tinfo: ~A~%" (-> obj info)) - (format #t "~Ttexture-page[9] @ #x~X~%" (-> obj texture-page)) - (format #t "~Tloaded-texture-page[16] @ #x~X~%" (-> obj loaded-texture-page)) - (format #t "~Tloaded-texture-page-count: ~D~%" (-> obj loaded-texture-page-count)) - (format #t "~Tforeground-sink-group[3] @ #x~X~%" (-> obj tfrag-tex-foreground-sink-group)) - (format #t "~Tforeground-draw-engine[3] @ #x~X~%" (-> obj foreground-draw-engine)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tambient: ~A~%" (-> obj ambient)) - (format #t "~Tclosest-object[9] @ #x~X~%" (-> obj closest-object)) - (format #t "~Tupload-size[9] @ #x~X~%" (-> obj upload-size)) - (format #t "~Tlevel-distance: (meters ~m)~%" (-> obj level-distance)) - (format #t "~Tinside-sphere?: ~A~%" (-> obj inside-sphere?)) - (format #t "~Tinside-boxes?: ~A~%" (-> obj inside-boxes?)) - (format #t "~Tdisplay?: ~A~%" (-> obj display?)) - (format #t "~Tmeta-inside?: ~A~%" (-> obj meta-inside?)) - (format #t "~Tmood: ~A~%" (-> obj mood)) - (format #t "~Tmood-func: ~A~%" (-> obj mood-func)) - (format #t "~Tvis-bits: #x~X~%" (-> obj vis-bits)) - (format #t "~Tall-visible?: ~A~%" (-> obj all-visible?)) - (format #t "~Tforce-all-visible?: ~A~%" (-> obj force-all-visible?)) - (format #t "~Tlinking: ~A~%" (-> obj linking)) - (format #t "~Tvis-info[8] @ #x~X~%" (-> obj vis-info)) - (format #t "~Tvis-self-index: ~D~%" (-> obj vis-self-index)) - (format #t "~Tvis-adj-index: ~D~%" (-> obj vis-adj-index)) - (format #t "~Tvis-buffer[2048] @ #x~X~%" (-> obj vis-buffer)) - (format #t "~Tmem-usage-block: ~A~%" (-> obj mem-usage-block)) - (format #t "~Tmem-usage: ~D~%" (-> obj mem-usage)) - (format #t "~Tcode-memory-start: #x~X~%" (-> obj code-memory-start)) - (format #t "~Tcode-memory-end: #x~X~%" (-> obj code-memory-end)) - (format #t "~Ttexture-mask[9] @ #x~X~%" (-> obj texture-mask)) - (format #t "~Tforce-inside?: ~A~%" (-> obj force-inside?)) - obj +(defmethod inspect level ((this level)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tload-name: ~A~%" (-> this load-name)) + (format #t "~Tnickname: ~A~%" (-> this nickname)) + (format #t "~Tindex: ~D~%" (-> this index)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tother: ~A~%" (-> this other)) + (format #t "~Theap: #~%" (-> this heap)) + (format #t "~Tbsp: ~A~%" (-> this bsp)) + (format #t "~Tart-group: ~A~%" (-> this art-group)) + (format #t "~Tinfo: ~A~%" (-> this info)) + (format #t "~Ttexture-page[9] @ #x~X~%" (-> this texture-page)) + (format #t "~Tloaded-texture-page[16] @ #x~X~%" (-> this loaded-texture-page)) + (format #t "~Tloaded-texture-page-count: ~D~%" (-> this loaded-texture-page-count)) + (format #t "~Tforeground-sink-group[3] @ #x~X~%" (-> this tfrag-tex-foreground-sink-group)) + (format #t "~Tforeground-draw-engine[3] @ #x~X~%" (-> this foreground-draw-engine)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tambient: ~A~%" (-> this ambient)) + (format #t "~Tclosest-object[9] @ #x~X~%" (-> this closest-object)) + (format #t "~Tupload-size[9] @ #x~X~%" (-> this upload-size)) + (format #t "~Tlevel-distance: (meters ~m)~%" (-> this level-distance)) + (format #t "~Tinside-sphere?: ~A~%" (-> this inside-sphere?)) + (format #t "~Tinside-boxes?: ~A~%" (-> this inside-boxes?)) + (format #t "~Tdisplay?: ~A~%" (-> this display?)) + (format #t "~Tmeta-inside?: ~A~%" (-> this meta-inside?)) + (format #t "~Tmood: ~A~%" (-> this mood)) + (format #t "~Tmood-func: ~A~%" (-> this mood-func)) + (format #t "~Tvis-bits: #x~X~%" (-> this vis-bits)) + (format #t "~Tall-visible?: ~A~%" (-> this all-visible?)) + (format #t "~Tforce-all-visible?: ~A~%" (-> this force-all-visible?)) + (format #t "~Tlinking: ~A~%" (-> this linking)) + (format #t "~Tvis-info[8] @ #x~X~%" (-> this vis-info)) + (format #t "~Tvis-self-index: ~D~%" (-> this vis-self-index)) + (format #t "~Tvis-adj-index: ~D~%" (-> this vis-adj-index)) + (format #t "~Tvis-buffer[2048] @ #x~X~%" (-> this vis-buffer)) + (format #t "~Tmem-usage-block: ~A~%" (-> this mem-usage-block)) + (format #t "~Tmem-usage: ~D~%" (-> this mem-usage)) + (format #t "~Tcode-memory-start: #x~X~%" (-> this code-memory-start)) + (format #t "~Tcode-memory-end: #x~X~%" (-> this code-memory-end)) + (format #t "~Ttexture-mask[9] @ #x~X~%" (-> this texture-mask)) + (format #t "~Tforce-inside?: ~A~%" (-> this force-inside?)) + this ) ;; definition of type level-group @@ -303,22 +303,22 @@ ) ;; definition for method 3 of type level-group -(defmethod inspect level-group ((obj level-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tentity-link: ~`entity-links`P~%" (-> obj entity-link)) - (format #t "~Tborder?: ~A~%" (-> obj border?)) - (format #t "~Tvis?: ~A~%" (-> obj vis?)) - (format #t "~Twant-level: ~A~%" (-> obj want-level)) - (format #t "~Treceiving-level: ~A~%" (-> obj receiving-level)) - (format #t "~Tload-commands: ~A~%" (-> obj load-commands)) - (format #t "~Tplay?: ~A~%" (-> obj play?)) - (format #t "~Tlevel[3] @ #x~X~%" (-> obj level0)) - (format #t "~Tdata[3] @ #x~X~%" (-> obj level0)) - (format #t "~Tlevel0: ~`level`P~%" (-> obj level0)) - (format #t "~Tlevel1: ~`level`P~%" (-> obj level1)) - (format #t "~Tlevel-default: ~`level`P~%" (-> obj level-default)) - obj +(defmethod inspect level-group ((this level-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tentity-link: ~`entity-links`P~%" (-> this entity-link)) + (format #t "~Tborder?: ~A~%" (-> this border?)) + (format #t "~Tvis?: ~A~%" (-> this vis?)) + (format #t "~Twant-level: ~A~%" (-> this want-level)) + (format #t "~Treceiving-level: ~A~%" (-> this receiving-level)) + (format #t "~Tload-commands: ~A~%" (-> this load-commands)) + (format #t "~Tplay?: ~A~%" (-> this play?)) + (format #t "~Tlevel[3] @ #x~X~%" (-> this level0)) + (format #t "~Tdata[3] @ #x~X~%" (-> this level0)) + (format #t "~Tlevel0: ~`level`P~%" (-> this level0)) + (format #t "~Tlevel1: ~`level`P~%" (-> this level1)) + (format #t "~Tlevel-default: ~`level`P~%" (-> this level-default)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/level/level_REF.gc b/test/decompiler/reference/jak1/engine/level/level_REF.gc index 6fa2b85445..c0ec362731 100644 --- a/test/decompiler/reference/jak1/engine/level/level_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/level_REF.gc @@ -21,7 +21,7 @@ ;; definition for method 21 of type level-group ;; INFO: Return type mismatch object vs pair. -(defmethod load-command-get-index level-group ((obj level-group) (name symbol) (cmd-idx int)) +(defmethod load-command-get-index level-group ((this level-group) (name symbol) (cmd-idx int)) (let ((cmd-lst (-> (lookup-level-info name) alt-load-commands))) (while (nonzero? cmd-idx) (+! cmd-idx -1) @@ -43,20 +43,20 @@ ) ;; definition for method 28 of type level -(defmethod art-group-get-by-name level ((obj level) (arg0 string)) - (countdown (s4-0 (-> obj art-group art-group-array length)) - (if (name= (-> obj art-group art-group-array s4-0 name) arg0) - (return (-> obj art-group art-group-array s4-0)) +(defmethod art-group-get-by-name level ((this level) (arg0 string)) + (countdown (s4-0 (-> this art-group art-group-array length)) + (if (name= (-> this art-group art-group-array s4-0 name) arg0) + (return (-> this art-group art-group-array s4-0)) ) ) (the-as art-group #f) ) ;; definition for method 13 of type level -(defmethod bsp-name level ((obj level)) - (if (and (!= (-> obj status) 'inactive) (-> obj bsp) (nonzero? (-> obj bsp name))) - (-> obj bsp name) - (-> obj name) +(defmethod bsp-name level ((this level)) + (if (and (!= (-> this status) 'inactive) (-> this bsp) (nonzero? (-> this bsp name))) + (-> this bsp name) + (-> this name) ) ) @@ -70,47 +70,47 @@ ) ;; definition for method 2 of type level -(defmethod print level ((obj level)) - (format #t "#<~A ~A ~S @ #x~X>" (-> obj type) (-> obj status) (-> obj name) obj) - obj +(defmethod print level ((this level)) + (format #t "#<~A ~A ~S @ #x~X>" (-> this type) (-> this status) (-> this name) this) + this ) ;; definition for method 7 of type bsp-header ;; INFO: Return type mismatch bsp-header vs none. -(defmethod relocate bsp-header ((obj bsp-header) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate bsp-header ((this bsp-header) (arg0 kheap) (arg1 (pointer uint8))) (let ((s5-0 (-> *level* loading-level))) (if s5-0 - (set! obj (cond - (obj - (cond - ((not (type-type? (-> obj type) bsp-header)) - (format 0 "ERROR: level ~A is not a bsp-header.~%" (-> s5-0 name)) - (the-as bsp-header #f) - ) - ((not (file-info-correct-version? (-> obj info) (file-kind level-bt) 0)) - (the-as bsp-header #f) - ) - ((< 2048 (-> obj visible-list-length)) - (format - 0 - "ERROR: level ~A visible-list-length ~d is greater than 2048 (16384 drawables).~%" - (-> s5-0 name) - (-> obj visible-list-length) - ) - (the-as bsp-header #f) - ) - (else - (set! (-> s5-0 bsp) obj) - (set! (-> obj level) s5-0) - obj + (set! this (cond + (this + (cond + ((not (type-type? (-> this type) bsp-header)) + (format 0 "ERROR: level ~A is not a bsp-header.~%" (-> s5-0 name)) + (the-as bsp-header #f) ) - ) - ) - (else - (format 0 "ERROR: level ~A is not a valid file.~%" (-> s5-0 name)) - (the-as bsp-header #f) - ) - ) + ((not (file-info-correct-version? (-> this info) (file-kind level-bt) 0)) + (the-as bsp-header #f) + ) + ((< 2048 (-> this visible-list-length)) + (format + 0 + "ERROR: level ~A visible-list-length ~d is greater than 2048 (16384 drawables).~%" + (-> s5-0 name) + (-> this visible-list-length) + ) + (the-as bsp-header #f) + ) + (else + (set! (-> s5-0 bsp) this) + (set! (-> this level) s5-0) + this + ) + ) + ) + (else + (format 0 "ERROR: level ~A is not a valid file.~%" (-> s5-0 name)) + (the-as bsp-header #f) + ) + ) ) ) ) @@ -118,41 +118,41 @@ ) ;; definition for method 24 of type level -(defmethod load-required-packages level ((obj level)) - (when (not (or (not (-> obj bsp)) (= *kernel-boot-mode* 'debug-boot))) - (if (not (null? (-> obj info packages))) +(defmethod load-required-packages level ((this level)) + (when (not (or (not (-> this bsp)) (= *kernel-boot-mode* 'debug-boot))) + (if (not (null? (-> this info packages))) (load-package "common" global) ) ) - obj + this ) ;; definition for method 26 of type level ;; INFO: Used lq/sq -(defmethod vis-clear level ((obj level)) +(defmethod vis-clear level ((this level)) (countdown (v1-0 8) (nop!) - (set! (-> obj vis-info v1-0) #f) + (set! (-> this vis-info v1-0) #f) ) (dotimes (v1-3 128) - (set! (-> (the-as (pointer int128) (&+ (-> obj vis-bits) (* v1-3 16)))) 0) + (set! (-> (the-as (pointer int128) (&+ (-> this vis-bits) (* v1-3 16)))) 0) ) - (set! (-> obj all-visible?) 'loading) + (set! (-> this all-visible?) 'loading) 0 ) ;; definition for method 20 of type level ;; INFO: Used lq/sq -(defmethod vis-load level ((obj level)) - (when (zero? (-> obj vis-info (-> obj vis-self-index) ramdisk)) - (let ((v1-10 (-> obj other vis-info (-> obj other vis-self-index)))) +(defmethod vis-load level ((this level)) + (when (zero? (-> this vis-info (-> this vis-self-index) ramdisk)) + (let ((v1-10 (-> this other vis-info (-> this other vis-self-index)))) (when (and v1-10 (nonzero? (-> v1-10 ramdisk))) (logand! (-> v1-10 flags) -1073741825) (set! (-> v1-10 ramdisk) (the-as uint 0)) 0 ) ) - (let ((s4-0 (make-file-name (file-kind vis) (the-as string (-> obj nickname)) 0 #f)) + (let ((s4-0 (make-file-name (file-kind vis) (the-as string (-> this nickname)) 0 #f)) (s3-0 (the-as ramdisk-rpc-fill (add-element *ramdisk-rpc*))) (s5-0 (+ *current-ramdisk-id* 1)) ) @@ -160,10 +160,10 @@ (set! (-> s3-0 filename) (string->sound-name s4-0)) (set! (-> s3-0 ee-id) s5-0) (call *ramdisk-rpc* (the-as uint 1) (the-as pointer 0) (the-as uint 0)) - (set! (-> obj vis-info (-> obj vis-self-index) ramdisk) (the-as uint s5-0)) + (set! (-> this vis-info (-> this vis-self-index) ramdisk) (the-as uint s5-0)) ) ) - (-> obj vis-info (-> obj vis-self-index) ramdisk) + (-> this vis-info (-> this vis-self-index) ramdisk) ) ;; definition for function load-vis-info @@ -182,16 +182,16 @@ ) ;; definition for method 25 of type level -(defmethod init-vis level ((obj level)) - (when (not (or (= (-> obj status) 'inactive) (not (-> obj bsp)))) - (set! (-> obj all-visible?) 'loading) - (let ((s5-0 (-> obj bsp vis-info 0))) +(defmethod init-vis level ((this level)) + (when (not (or (= (-> this status) 'inactive) (not (-> this bsp)))) + (set! (-> this all-visible?) 'loading) + (let ((s5-0 (-> this bsp vis-info 0))) (cond ((and s5-0 (nonzero? s5-0) (valid? s5-0 level-vis-info #f #f 0)) - (set! (-> obj vis-info 0) s5-0) + (set! (-> this vis-info 0) s5-0) (set! (-> s5-0 current-vis-string) (the-as uint -1)) - (set! (-> s5-0 from-bsp) (-> obj bsp)) - (set! (-> s5-0 vis-bits) (-> obj vis-bits)) + (set! (-> s5-0 from-bsp) (-> this bsp)) + (set! (-> s5-0 vis-bits) (-> this vis-bits)) (logand! (-> s5-0 flags) (the-as uint #xffffffff3fffffff)) (logior! (-> s5-0 flags) #x20000000) (set! (-> s5-0 ramdisk) (the-as uint 0)) @@ -199,25 +199,25 @@ (set! *vis-boot* #t) ) (else - (set! (-> obj vis-info 0) #f) + (set! (-> this vis-info 0) #f) ) ) ) (dotimes (s5-1 6) (let* ((s3-0 (+ s5-1 1)) - (s4-0 (-> obj bsp vis-info s3-0)) + (s4-0 (-> this bsp vis-info s3-0)) ) (cond ((and s4-0 (nonzero? s4-0) (valid? s4-0 level-vis-info #f #f 0)) - (set! (-> obj vis-info s3-0) s4-0) + (set! (-> this vis-info s3-0) s4-0) (set! (-> s4-0 current-vis-string) (the-as uint -1)) (set! (-> s4-0 from-bsp) #f) - (set! (-> s4-0 vis-bits) (-> obj vis-bits)) + (set! (-> s4-0 vis-bits) (-> this vis-bits)) (logand! (-> s4-0 flags) (the-as uint #xffffffff1fffffff)) (set! *vis-boot* #t) ) (else - (set! (-> obj vis-info s3-0) #f) + (set! (-> this vis-info s3-0) #f) ) ) ) @@ -227,20 +227,20 @@ ) ;; definition for method 11 of type level-group -(defmethod level-get-for-use level-group ((obj level-group) (arg0 symbol) (arg1 symbol)) +(defmethod level-get-for-use level-group ((this level-group) (arg0 symbol) (arg1 symbol)) (local-vars (s5-1 level)) - (alloc-levels! obj #f) + (alloc-levels! this #f) (let* ((s3-0 (lookup-level-info arg0)) (s2-0 (remap-level-name s3-0)) ) - (let ((s1-0 (level-get obj s2-0))) + (let ((s1-0 (level-get this s2-0))) (when s1-0 (level-status-set! s1-0 arg1) (set! s5-1 s1-0) (goto cfg-10) ) ) - (let ((a0-7 (level-get-most-disposable obj))) + (let ((a0-7 (level-get-most-disposable this))) (set! s5-1 (if a0-7 (level-status-set! a0-7 'inactive) a0-7 @@ -268,7 +268,7 @@ ) ;; definition for method 25 of type level-group -(defmethod level-status level-group ((obj level-group) (arg0 symbol)) +(defmethod level-status level-group ((this level-group) (arg0 symbol)) (let ((v1-1 (level-get *level* arg0))) (if v1-1 (-> v1-1 status) @@ -277,68 +277,68 @@ ) ;; definition for method 23 of type level -(defmethod level-status-set! level ((obj level) (arg0 symbol)) +(defmethod level-status-set! level ((this level) (arg0 symbol)) (case arg0 (('inactive) - (-> obj status) - (unload! obj) + (-> this status) + (unload! this) ) (('loading) - (case (-> obj status) + (case (-> this status) (('inactive) - (load-begin obj) + (load-begin this) ) ) ) (('loading-bt) - (case (-> obj status) + (case (-> this status) (('loading) - (set! (-> obj status) arg0) - (load-continue obj) + (set! (-> this status) arg0) + (load-continue this) ) ) ) (('loading-done) - (case (-> obj status) + (case (-> this status) (('loading-bt) - (set! (-> obj status) arg0) + (set! (-> this status) arg0) ) ) ) (('loaded) - (case (-> obj status) + (case (-> this status) (('loading-done) - (login-begin obj) + (login-begin this) ) (('alive 'active) - (deactivate obj) + (deactivate this) ) ) ) (('alive 'active) (when *dproc* - (case (-> obj status) + (case (-> this status) (('loaded) - (birth obj) - (level-status-set! obj arg0) + (birth this) + (level-status-set! this arg0) ) (('alive) (when (and *dproc* (= arg0 'active)) - (remove-by-param1 *background-draw-engine* (-> obj bsp)) - (add-connection *background-draw-engine* *dproc* add-bsp-drawable (-> obj bsp) obj #f) + (remove-by-param1 *background-draw-engine* (-> this bsp)) + (add-connection *background-draw-engine* *dproc* add-bsp-drawable (-> this bsp) this #f) (dotimes (v1-40 9) - (set! (-> obj closest-object v1-40) 0.0) - (set! (-> obj texture-mask v1-40) (the-as uint 0)) + (set! (-> this closest-object v1-40) 0.0) + (set! (-> this texture-mask v1-40) (the-as uint 0)) ) - (set! (-> obj level-distance) 0.0) - (set! (-> obj status) 'active) + (set! (-> this level-distance) 0.0) + (set! (-> this status) 'active) ) ) ) ) ) ) - obj + this ) ;; definition for symbol *login-state*, type login-state @@ -348,33 +348,33 @@ (define *print-login* #t) ;; definition for method 17 of type level -(defmethod load-continue level ((obj level)) +(defmethod load-continue level ((this level)) (local-vars (sv-16 symbol)) - (when (-> obj linking) + (when (-> this linking) (when (nonzero? (link-resume)) - (set! (-> obj linking) #f) - (case (-> obj status) + (set! (-> this linking) #f) + (case (-> this status) (('loading) (if (not (-> *texture-relocate-later* memcpy)) - (dgo-load-continue (logand -64 (&+ (-> obj heap current) 63))) + (dgo-load-continue (logand -64 (&+ (-> this heap current) 63))) ) ) (('loading-bt) - (level-status-set! obj 'loading-done) - (level-status-set! obj 'loaded) + (level-status-set! this 'loading-done) + (level-status-set! this 'loaded) ) ) ) - (set! obj obj) + (set! this this) (goto cfg-30) ) (when (-> *texture-relocate-later* memcpy) (relocate-later) - (dgo-load-continue (logand -64 (&+ (-> obj heap current) 63))) - (set! obj obj) + (dgo-load-continue (logand -64 (&+ (-> this heap current) 63))) + (set! this this) (goto cfg-30) ) - (case (-> obj status) + (case (-> this status) (('loading) (set! sv-16 (the-as symbol #f)) (let ((a0-15 (dgo-load-get-next (& sv-16)))) @@ -382,83 +382,83 @@ (cond ((not sv-16) (cond - ((dgo-load-link (the-as dgo-header a0-15) (-> obj heap) *print-login* #f) + ((dgo-load-link (the-as dgo-header a0-15) (-> this heap) *print-login* #f) (if (not (-> *texture-relocate-later* memcpy)) - (dgo-load-continue (logand -64 (&+ (-> obj heap current) 63))) + (dgo-load-continue (logand -64 (&+ (-> this heap current) 63))) ) ) (else - (set! (-> obj linking) #t) + (set! (-> this linking) #t) ) ) ) (else - (set! (-> obj heap top) (-> obj heap top-base)) - (level-status-set! obj 'loading-bt) + (set! (-> this heap top) (-> this heap top-base)) + (level-status-set! this 'loading-bt) ) ) ) ) ) (('login) - (level-update-after-load obj *login-state*) + (level-update-after-load this *login-state*) ) (('loading-bt) - (let ((a0-26 (logand -64 (&+ (-> obj heap current) 63)))) + (let ((a0-26 (logand -64 (&+ (-> this heap current) 63)))) (cond - ((dgo-load-link (the-as dgo-header a0-26) (-> obj heap) *print-login* #t) - (level-status-set! obj 'loading-done) - (level-status-set! obj 'loaded) + ((dgo-load-link (the-as dgo-header a0-26) (-> this heap) *print-login* #t) + (level-status-set! this 'loading-done) + (level-status-set! this 'loaded) ) (else - (set! (-> obj linking) #t) + (set! (-> this linking) #t) ) ) ) ) ) (label cfg-30) - obj + this ) ;; definition for method 18 of type level -(defmethod load-begin level ((obj level)) - (set! loading-level (-> obj heap)) - (set! (-> *level* loading-level) obj) +(defmethod load-begin level ((this level)) + (set! loading-level (-> this heap)) + (set! (-> *level* loading-level) this) (set! (-> *level* log-in-level-bsp) #f) - (set! (-> obj nickname) #f) - (set! (-> obj bsp) #f) - (set! (-> obj entity) #f) - (set! (-> obj ambient) #f) - (set! (-> obj linking) #f) - (vis-clear obj) - (set! (-> obj status) 'loading) + (set! (-> this nickname) #f) + (set! (-> this bsp) #f) + (set! (-> this entity) #f) + (set! (-> this ambient) #f) + (set! (-> this linking) #f) + (vis-clear this) + (set! (-> this status) 'loading) (set! (-> *texture-pool* allocate-func) texture-page-level-allocate) - (if (= (-> obj load-name) (-> obj info visname)) - (format (clear *temp-string*) "~S" (-> obj info nickname)) - (format (clear *temp-string*) "~S" (-> obj name)) + (if (= (-> this load-name) (-> this info visname)) + (format (clear *temp-string*) "~S" (-> this info nickname)) + (format (clear *temp-string*) "~S" (-> this name)) ) (set! (-> *temp-string* data 8) (the-as uint 0)) (format *temp-string* ".DGO") - (set! (-> obj heap top) (-> obj heap top-base)) - (let ((s4-0 (kmalloc (-> obj heap) #x200000 (kmalloc-flags align-64 top) "dgo-level-buf-2")) - (s5-2 (kmalloc (-> obj heap) #x200000 (kmalloc-flags align-64 top) "dgo-level-buf-2")) + (set! (-> this heap top) (-> this heap top-base)) + (let ((s4-0 (kmalloc (-> this heap) #x200000 (kmalloc-flags align-64 top) "dgo-level-buf-2")) + (s5-2 (kmalloc (-> this heap) #x200000 (kmalloc-flags align-64 top) "dgo-level-buf-2")) ) - (set! (-> obj code-memory-start) (-> obj heap current)) - (format 0 "-----------> begin load ~A [~S]~%" (-> obj load-name) *temp-string*) - (dgo-load-begin *temp-string* s5-2 s4-0 (logand -64 (&+ (-> obj heap current) 63))) + (set! (-> this code-memory-start) (-> this heap current)) + (format 0 "-----------> begin load ~A [~S]~%" (-> this load-name) *temp-string*) + (dgo-load-begin *temp-string* s5-2 s4-0 (logand -64 (&+ (-> this heap current) 63))) ) - obj + this ) ;; definition for method 19 of type level -(defmethod login-begin level ((obj level)) +(defmethod login-begin level ((this level)) (set! (-> *texture-pool* allocate-func) texture-page-default-allocate) (cond - ((-> obj bsp) - (set! (-> *level* log-in-level-bsp) (-> obj bsp)) - (login-level-textures *texture-pool* obj (-> obj bsp texture-page-count) (-> obj bsp texture-ids)) - (let ((v1-7 (-> obj bsp))) + ((-> this bsp) + (set! (-> *level* log-in-level-bsp) (-> this bsp)) + (login-level-textures *texture-pool* this (-> this bsp texture-page-count) (-> this bsp texture-ids)) + (let ((v1-7 (-> this bsp))) (when (nonzero? (-> v1-7 adgifs)) (let ((s5-0 (-> v1-7 adgifs))) (dotimes (s4-0 (-> s5-0 length)) @@ -470,15 +470,15 @@ (set! (-> *login-state* state) -1) (set! (-> *login-state* pos) (the-as uint 0)) (set! (-> *login-state* elts) (the-as uint 0)) - (set! (-> obj status) 'login) + (set! (-> this status) 'login) ) (else - (level-status-set! obj 'inactive) + (level-status-set! this 'inactive) (set! loading-level global) (set! (-> *level* loading-level) (-> *level* level-default)) ) ) - obj + this ) ;; definition for function level-update-after-load @@ -669,53 +669,53 @@ ) ;; definition for method 22 of type level -(defmethod birth level ((obj level)) - (case (-> obj status) +(defmethod birth level ((this level)) + (case (-> this status) (('loaded) (let ((s5-0 loading-level) (s4-0 (-> *level* loading-level)) (s3-1 (-> *level* log-in-level-bsp)) ) - (set! loading-level (-> obj heap)) - (set! (-> *level* log-in-level-bsp) (-> obj bsp)) - (set! (-> *level* loading-level) obj) - (birth (-> obj bsp)) - (set! (-> obj status) 'alive) - (copy-perms-to-level! *game-info* obj) - (send-event *camera* 'level-activate (-> obj name)) - (send-event *target* 'level-activate (-> obj name)) + (set! loading-level (-> this heap)) + (set! (-> *level* log-in-level-bsp) (-> this bsp)) + (set! (-> *level* loading-level) this) + (birth (-> this bsp)) + (set! (-> this status) 'alive) + (copy-perms-to-level! *game-info* this) + (send-event *camera* 'level-activate (-> this name)) + (send-event *target* 'level-activate (-> this name)) (set! loading-level s5-0) (set! (-> *level* loading-level) s4-0) (set! (-> *level* log-in-level-bsp) s3-1) ) ) ) - obj + this ) ;; definition for method 9 of type level ;; INFO: Used lq/sq -(defmethod deactivate level ((obj level)) - (case (-> obj status) +(defmethod deactivate level ((this level)) + (case (-> this status) (('active 'alive) - (format 0 "----------- kill ~A (status ~A)~%" obj (-> obj status)) - (copy-perms-from-level! *game-info* obj) - (send-event *camera* 'level-deactivate (-> obj name)) - (send-event *target* 'level-deactivate (-> obj name)) - (remove-by-param1 *background-draw-engine* (-> obj bsp)) - (deactivate-entities (-> obj bsp)) - (kill-all-particles-in-level obj) - (set! (-> obj inside-sphere?) #f) - (set! (-> obj inside-boxes?) #f) - (set! (-> obj meta-inside?) #f) - (set! (-> obj force-inside?) #f) - (set! (-> obj status) 'loaded) - (set! (-> obj all-visible?) 'loading) + (format 0 "----------- kill ~A (status ~A)~%" this (-> this status)) + (copy-perms-from-level! *game-info* this) + (send-event *camera* 'level-deactivate (-> this name)) + (send-event *target* 'level-deactivate (-> this name)) + (remove-by-param1 *background-draw-engine* (-> this bsp)) + (deactivate-entities (-> this bsp)) + (kill-all-particles-in-level this) + (set! (-> this inside-sphere?) #f) + (set! (-> this inside-boxes?) #f) + (set! (-> this meta-inside?) #f) + (set! (-> this force-inside?) #f) + (set! (-> this status) 'loaded) + (set! (-> this all-visible?) 'loading) (dotimes (v1-19 128) - (set! (-> (the-as (pointer int128) (&+ (-> obj vis-bits) (* v1-19 16)))) 0) + (set! (-> (the-as (pointer int128) (&+ (-> this vis-bits) (* v1-19 16)))) 0) ) (countdown (v1-22 8) - (let ((a0-14 (-> obj vis-info v1-22))) + (let ((a0-14 (-> this vis-info v1-22))) (if a0-14 (set! (-> a0-14 current-vis-string) (the-as uint -1)) ) @@ -723,58 +723,58 @@ ) ) ) - (if (= (-> *level* log-in-level-bsp) (-> obj bsp)) + (if (= (-> *level* log-in-level-bsp) (-> this bsp)) (set! (-> *level* log-in-level-bsp) #f) ) - obj + this ) ;; definition for method 12 of type level ;; ERROR: Failed load: (set! v1-52 (l.wu (+ a0-29 -4))) at op 146 -(defmethod unload! level ((obj level)) - (deactivate obj) - (when (!= (-> obj status) 'inactive) - (when (or (= (-> obj status) 'loaded) - (= (-> obj status) 'alive) - (= (-> obj status) 'active) - (= (-> obj status) 'login) +(defmethod unload! level ((this level)) + (deactivate this) + (when (!= (-> this status) 'inactive) + (when (or (= (-> this status) 'loaded) + (= (-> this status) 'alive) + (= (-> this status) 'active) + (= (-> this status) 'login) ) - (dotimes (s5-0 (-> obj art-group art-group-array length)) - (let ((s4-0 (-> obj art-group art-group-array s5-0))) + (dotimes (s5-0 (-> this art-group art-group-array length)) + (let ((s4-0 (-> this art-group art-group-array s5-0))) (if (needs-link? s4-0) (unlink-art! s4-0) ) ) ) ) - (set! (-> obj bsp) #f) - (set! (-> obj entity) #f) - (set! (-> obj ambient) #f) - (set! (-> obj status) 'inactive) - (set! (-> obj art-group string-array length) 0) - (set! (-> obj art-group art-group-array length) 0) - (countdown (s5-1 (-> obj loaded-texture-page-count)) + (set! (-> this bsp) #f) + (set! (-> this entity) #f) + (set! (-> this ambient) #f) + (set! (-> this status) 'inactive) + (set! (-> this art-group string-array length) 0) + (set! (-> this art-group art-group-array length) 0) + (countdown (s5-1 (-> this loaded-texture-page-count)) (dotimes (v1-27 32) - (when (= (-> obj loaded-texture-page s5-1) (-> *texture-pool* common-page v1-27)) + (when (= (-> this loaded-texture-page s5-1) (-> *texture-pool* common-page v1-27)) (set! (-> *texture-pool* common-page v1-27) (the-as texture-page 0)) 0 ) ) - (unload! *texture-pool* (-> obj loaded-texture-page s5-1)) + (unload! *texture-pool* (-> this loaded-texture-page s5-1)) ) - (set! (-> obj loaded-texture-page-count) 0) - (unlink-textures-in-heap! *texture-page-dir* (-> obj heap)) - (unlink-part-group-by-heap (-> obj heap)) + (set! (-> this loaded-texture-page-count) 0) + (unlink-textures-in-heap! *texture-page-dir* (-> this heap)) + (unlink-part-group-by-heap (-> this heap)) (dotimes (s5-2 2) (let ((v1-41 (-> *art-control* buffer s5-2 pending-load-file))) - (if (and (>= (the-as int v1-41) (the-as int (-> obj heap base))) - (< (the-as int v1-41) (the-as int (-> obj heap top-base))) + (if (and (>= (the-as int v1-41) (the-as int (-> this heap base))) + (< (the-as int v1-41) (the-as int (-> this heap top-base))) ) (set-pending-file (-> *art-control* buffer s5-2) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) ) ) - (let* ((s5-3 (-> obj info packages)) + (let* ((s5-3 (-> this info packages)) (a0-29 (car s5-3)) ) (while (not (null? s5-3)) @@ -790,26 +790,26 @@ (set! a0-29 (car s5-3)) ) ) - (vis-clear obj) - (let ((v1-64 (-> obj heap))) + (vis-clear this) + (let ((v1-64 (-> this heap))) (set! (-> v1-64 current) (-> v1-64 base)) ) - (set! (-> obj code-memory-start) (the-as pointer 0)) - (set! (-> obj code-memory-end) (the-as pointer 0)) - (when (= (-> *level* loading-level) obj) + (set! (-> this code-memory-start) (the-as pointer 0)) + (set! (-> this code-memory-end) (the-as pointer 0)) + (when (= (-> *level* loading-level) this) (set! loading-level global) (set! (-> *level* loading-level) (-> *level* level-default)) (set! (-> *level* log-in-level-bsp) #f) ) ) - obj + this ) ;; definition for method 10 of type level ;; ERROR: Unsupported inline assembly instruction kind - [addiu a0, a0, 56] -(defmethod is-object-visible? level ((obj level) (arg0 int)) +(defmethod is-object-visible? level ((this level) (arg0 int)) (local-vars (a0-1 int) (a0-3 int)) - (let ((v1-0 (-> obj vis-bits))) + (let ((v1-0 (-> this vis-bits))) (shift-arith-right-32 a0-1 arg0 3) (let ((v1-2 (-> (the-as (pointer int8) (+ a0-1 (the-as int v1-0)))))) (let ((a0-2 (logand arg0 7))) @@ -822,16 +822,16 @@ ;; definition for method 15 of type level ;; INFO: Return type mismatch object vs symbol. -(defmethod point-in-boxes? level ((obj level) (arg0 vector)) +(defmethod point-in-boxes? level ((this level) (arg0 vector)) (the-as symbol (cond - ((or (not (-> obj bsp)) (zero? (-> obj bsp boxes))) + ((or (not (-> this bsp)) (zero? (-> this bsp boxes))) #f ) - ((-> obj force-inside?) + ((-> this force-inside?) #t ) (else - (let* ((a0-1 (-> obj bsp boxes)) + (let* ((a0-1 (-> this bsp boxes)) (v1-5 (-> a0-1 data)) ) (countdown (a0-2 (-> a0-1 length)) @@ -855,12 +855,12 @@ ;; definition for method 27 of type level ;; INFO: Return type mismatch int vs none. -(defmethod debug-print-splitbox level ((obj level) (arg0 vector) (arg1 string)) +(defmethod debug-print-splitbox level ((this level) (arg0 vector) (arg1 string)) (cond - ((or (not (-> obj bsp)) (zero? (-> obj bsp boxes)) (zero? (-> obj bsp split-box-indices))) + ((or (not (-> this bsp)) (zero? (-> this bsp boxes)) (zero? (-> this bsp split-box-indices))) ) (else - (let* ((s3-0 (-> obj bsp boxes)) + (let* ((s3-0 (-> this bsp boxes)) (s2-0 (the-as object (-> s3-0 data))) ) (dotimes (s1-0 (-> s3-0 length)) @@ -871,7 +871,7 @@ (< (-> arg0 y) (-> (the-as (inline-array box8s) s2-0) 0 max y)) (< (-> arg0 z) (-> (the-as (inline-array box8s) s2-0) 0 max z)) ) - (format arg1 " splitbox-~D~%" (-> obj bsp split-box-indices s1-0)) + (format arg1 " splitbox-~D~%" (-> this bsp split-box-indices s1-0)) ) (set! s2-0 (-> (the-as (inline-array box8s) s2-0) 1)) ) @@ -883,35 +883,35 @@ ) ;; definition for method 8 of type level -(defmethod mem-usage level ((obj level) (arg0 memory-usage-block) (arg1 int)) - (when (= (-> obj status) 'active) +(defmethod mem-usage level ((this level) (arg0 memory-usage-block) (arg1 int)) + (when (= (-> this status) 'active) (set! (-> arg0 length) (max 65 (-> arg0 length))) (set! (-> arg0 data 64 name) "entity-links") - (+! (-> arg0 data 64 count) (-> obj entity length)) - (let ((v1-8 (asize-of (-> obj entity)))) + (+! (-> arg0 data 64 count) (-> this entity length)) + (let ((v1-8 (asize-of (-> this entity)))) (+! (-> arg0 data 64 used) v1-8) (+! (-> arg0 data 64 total) (logand -16 (+ v1-8 15))) ) (set! (-> arg0 length) (max 65 (-> arg0 length))) (set! (-> arg0 data 64 name) "ambient-links") - (+! (-> arg0 data 64 count) (-> obj ambient length)) - (let ((v1-18 (asize-of (-> obj ambient)))) + (+! (-> arg0 data 64 count) (-> this ambient length)) + (let ((v1-18 (asize-of (-> this ambient)))) (+! (-> arg0 data 64 used) v1-18) (+! (-> arg0 data 64 total) (logand -16 (+ v1-18 15))) ) - (mem-usage (-> obj art-group) arg0 arg1) + (mem-usage (-> this art-group) arg0 arg1) (set! (-> arg0 length) (max 64 (-> arg0 length))) (set! (-> arg0 data 63 name) "level-code") (+! (-> arg0 data 63 count) 1) - (let ((v1-30 (&- (-> obj code-memory-end) (the-as uint (-> obj code-memory-start))))) + (let ((v1-30 (&- (-> this code-memory-end) (the-as uint (-> this code-memory-start))))) (+! (-> arg0 data 63 used) v1-30) (+! (-> arg0 data 63 total) (logand -16 (+ v1-30 15))) ) - (countdown (s3-0 (-> obj loaded-texture-page-count)) - (mem-usage (-> obj loaded-texture-page s3-0) arg0 arg1) + (countdown (s3-0 (-> this loaded-texture-page-count)) + (mem-usage (-> this loaded-texture-page s3-0) arg0 arg1) ) (countdown (s3-1 8) - (let ((s2-0 (-> obj vis-info s3-1))) + (let ((s2-0 (-> this vis-info s3-1))) (when s2-0 (cond ((zero? s3-1) @@ -936,13 +936,13 @@ ) ) ) - (mem-usage (-> obj bsp) arg0 arg1) + (mem-usage (-> this bsp) arg0 arg1) ) - obj + this ) ;; definition for method 18 of type level-group -(defmethod alloc-levels! level-group ((obj level-group) (arg0 symbol)) +(defmethod alloc-levels! level-group ((this level-group) (arg0 symbol)) (when (zero? (-> *level* level0 heap base)) (when (nmember "game" *kernel-packages*) (set! *kernel-packages* (cons "art" *kernel-packages*)) @@ -959,7 +959,7 @@ ) ) (dotimes (s4-0 2) - (let ((s3-0 (-> obj level s4-0 heap))) + (let ((s3-0 (-> this level s4-0 heap))) (set! (-> s3-0 base) (malloc 'global s5-1)) (set! (-> s3-0 current) (-> s3-0 base)) (set! (-> s3-0 top-base) (&+ (-> s3-0 base) s5-1)) @@ -972,46 +972,46 @@ ) ;; definition for method 10 of type level-group -(defmethod level-get-with-status level-group ((obj level-group) (arg0 symbol)) - (dotimes (v1-0 (-> obj length)) - (if (= (-> obj level v1-0 status) arg0) - (return (-> obj level v1-0)) +(defmethod level-get-with-status level-group ((this level-group) (arg0 symbol)) + (dotimes (v1-0 (-> this length)) + (if (= (-> this level v1-0 status) arg0) + (return (-> this level v1-0)) ) ) (the-as level #f) ) ;; definition for method 26 of type level-group -(defmethod level-get-most-disposable level-group ((obj level-group)) - (dotimes (v1-0 (-> obj length)) - (case (-> obj level v1-0 status) +(defmethod level-get-most-disposable level-group ((this level-group)) + (dotimes (v1-0 (-> this length)) + (case (-> this level v1-0 status) (('inactive) - (return (-> obj level v1-0)) + (return (-> this level v1-0)) ) ) ) - (dotimes (v1-6 (-> obj length)) - (case (-> obj level v1-6 status) + (dotimes (v1-6 (-> this length)) + (case (-> this level v1-6 status) (('loading 'loading-bt) - (return (-> obj level v1-6)) + (return (-> this level v1-6)) ) ) ) - (dotimes (v1-12 (-> obj length)) - (case (-> obj level v1-12 status) + (dotimes (v1-12 (-> this length)) + (case (-> this level v1-12 status) (('loaded) - (return (-> obj level v1-12)) + (return (-> this level v1-12)) ) ) ) (let ((v0-0 (the-as level #f))) - (dotimes (v1-18 (-> obj length)) - (case (-> obj level v1-18 status) + (dotimes (v1-18 (-> this length)) + (case (-> this level v1-18 status) (('active) - (if (and (not (-> obj level v1-18 inside-boxes?)) - (or (not v0-0) (< (-> obj level v1-18 info priority) (-> v0-0 info priority))) + (if (and (not (-> this level v1-18 inside-boxes?)) + (or (not v0-0) (< (-> this level v1-18 info priority) (-> v0-0 info priority))) ) - (set! v0-0 (-> obj level v1-18)) + (set! v0-0 (-> this level v1-18)) ) ) ) @@ -1021,21 +1021,21 @@ ) ;; definition for method 9 of type level-group -(defmethod level-get level-group ((obj level-group) (arg0 symbol)) - (dotimes (v1-0 (-> obj length)) - (if (and (!= (-> obj level v1-0 status) 'inactive) - (or (= (-> obj level v1-0 name) arg0) (= (-> obj level v1-0 load-name) arg0)) +(defmethod level-get level-group ((this level-group) (arg0 symbol)) + (dotimes (v1-0 (-> this length)) + (if (and (!= (-> this level v1-0 status) 'inactive) + (or (= (-> this level v1-0 name) arg0) (= (-> this level v1-0 load-name) arg0)) ) - (return (-> obj level v1-0)) + (return (-> this level v1-0)) ) ) (the-as level #f) ) ;; definition for method 20 of type level-group -(defmethod art-group-get-by-name level-group ((obj level-group) (arg0 string)) +(defmethod art-group-get-by-name level-group ((this level-group) (arg0 string)) (countdown (s4-0 3) - (let ((s3-0 (-> obj level s4-0))) + (let ((s3-0 (-> this level s4-0))) (countdown (s2-0 (-> s3-0 art-group art-group-array length)) (if (name= (-> s3-0 art-group art-group-array s2-0 name) arg0) (return (-> s3-0 art-group art-group-array s2-0)) @@ -1047,19 +1047,19 @@ ) ;; definition for method 12 of type level-group -(defmethod activate-levels! level-group ((obj level-group)) - (dotimes (s5-0 (-> obj length)) - (level-status-set! (-> obj level s5-0) 'active) +(defmethod activate-levels! level-group ((this level-group)) + (dotimes (s5-0 (-> this length)) + (level-status-set! (-> this level s5-0) 'active) ) 0 ) ;; definition for method 17 of type level-group -(defmethod level-get-target-inside level-group ((obj level-group)) +(defmethod level-get-target-inside level-group ((this level-group)) (let ((s5-0 (target-pos 0))) (let ((v1-2 (-> *game-info* current-continue level))) - (dotimes (a0-2 (-> obj length)) - (let ((a1-3 (-> obj level a0-2))) + (dotimes (a0-2 (-> this length)) + (let ((a1-3 (-> this level a0-2))) (when (= (-> a1-3 status) 'active) (if (= (-> a1-3 name) v1-2) (return a1-3) @@ -1070,8 +1070,8 @@ ) (let ((s4-0 (the-as level #f))) (let ((f30-0 0.0)) - (dotimes (s3-0 (-> obj length)) - (let ((s2-0 (-> obj level s3-0))) + (dotimes (s3-0 (-> this length)) + (let ((s2-0 (-> this level s3-0))) (when (= (-> s2-0 status) 'active) (let ((f0-0 (vector-vector-distance (-> s2-0 bsp bsphere) s5-0))) (if (and (-> s2-0 inside-boxes?) (or (not s4-0) (< f0-0 f30-0))) @@ -1087,8 +1087,8 @@ ) ) ) - (dotimes (v1-20 (-> obj length)) - (let ((a0-8 (-> obj level v1-20))) + (dotimes (v1-20 (-> this length)) + (let ((a0-8 (-> this level v1-20))) (when (= (-> a0-8 status) 'active) (if (-> a0-8 meta-inside?) (return a0-8) @@ -1098,8 +1098,8 @@ ) (let ((v0-1 (the-as level #f))) (let ((f0-1 0.0)) - (dotimes (v1-23 (-> obj length)) - (let ((a0-13 (-> obj level v1-23))) + (dotimes (v1-23 (-> this length)) + (let ((a0-13 (-> this level v1-23))) (when (= (-> a0-13 status) 'active) (if (or (not v0-1) (< (-> a0-13 level-distance) f0-1)) (set! v0-1 a0-13) @@ -1113,17 +1113,17 @@ ) ;; definition for method 19 of type level-group -(defmethod load-commands-set! level-group ((obj level-group) (arg0 pair)) - (set! (-> obj load-commands) arg0) +(defmethod load-commands-set! level-group ((this level-group) (arg0 pair)) + (set! (-> this load-commands) arg0) arg0 ) ;; definition for method 8 of type level-group -(defmethod mem-usage level-group ((obj level-group) (arg0 memory-usage-block) (arg1 int)) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj level s3-0) arg0 arg1) +(defmethod mem-usage level-group ((this level-group) (arg0 memory-usage-block) (arg1 int)) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this level s3-0) arg0 arg1) ) - obj + this ) ;; definition for function bg @@ -1341,7 +1341,7 @@ ) ;; definition for method 10 of type load-state -(defmethod update! load-state ((obj load-state)) +(defmethod update! load-state ((this load-state)) (update-sound-banks) (let ((v1-0 #f)) (dotimes (s5-0 2) @@ -1349,7 +1349,7 @@ (when (!= (-> s4-0 status) 'inactive) (let ((a0-6 #f)) (dotimes (a1-2 2) - (if (= (-> s4-0 name) (-> obj want a1-2 name)) + (if (= (-> s4-0 name) (-> this want a1-2 name)) (set! a0-6 #t) ) ) @@ -1372,21 +1372,21 @@ (let ((a0-20 #f) (v1-5 #f) ) - (when (-> obj want 0 name) + (when (-> this want 0 name) (set! a0-20 #t) (dotimes (a1-12 3) (let ((a2-9 (-> *level* level a1-12))) - (if (and (!= (-> a2-9 status) 'inactive) (= (-> a2-9 name) (-> obj want 0 name))) + (if (and (!= (-> a2-9 status) 'inactive) (= (-> a2-9 name) (-> this want 0 name))) (set! a0-20 #f) ) ) ) ) - (when (-> obj want 1 name) + (when (-> this want 1 name) (set! v1-5 #t) (dotimes (a1-17 3) (let ((a2-17 (-> *level* level a1-17))) - (if (and (!= (-> a2-17 status) 'inactive) (= (-> a2-17 name) (-> obj want 1 name))) + (if (and (!= (-> a2-17 status) 'inactive) (= (-> a2-17 name) (-> this want 1 name))) (set! v1-5 #f) ) ) @@ -1396,7 +1396,7 @@ (cond ((and a0-20 v1-5) (set! s4-1 0) - (if (and (-> obj want 1 display?) (not (-> obj want 0 display?))) + (if (and (-> this want 1 display?) (not (-> this want 0 display?))) (set! s4-1 1) ) ) @@ -1409,9 +1409,9 @@ ) (when (!= s4-1 -1) (when (or s5-1 (not (check-busy *load-dgo-rpc*))) - (format 0 "Adding level ~A~%" (-> obj want s4-1 name)) - (let ((s3-0 (level-get-for-use *level* (-> obj want s4-1 name) 'loaded))) - (when (and s5-1 (-> obj want s4-1 display?)) + (format 0 "Adding level ~A~%" (-> this want s4-1 name)) + (let ((s3-0 (level-get-for-use *level* (-> this want s4-1 name) 'loaded))) + (when (and s5-1 (-> this want s4-1 display?)) (format 0 "Waiting for level to load~%") (while (or (= (-> s3-0 status) 'loading) (= (-> s3-0 status) 'loading-bt) (= (-> s3-0 status) 'login)) (load-continue s3-0) @@ -1425,48 +1425,48 @@ ) ) (dotimes (s5-2 2) - (when (-> obj want s5-2 name) + (when (-> this want s5-2 name) (dotimes (s4-2 3) (let ((s3-1 (-> *level* level s4-2))) (when (!= (-> s3-1 status) 'inactive) - (when (= (-> s3-1 name) (-> obj want s5-2 name)) - (when (!= (-> s3-1 display?) (-> obj want s5-2 display?)) + (when (= (-> s3-1 name) (-> this want s5-2 name)) + (when (!= (-> s3-1 display?) (-> this want s5-2 display?)) (cond ((not (-> s3-1 display?)) (cond ((or (= (-> s3-1 status) 'loaded) (= (-> s3-1 status) 'active)) - (format 0 "Displaying level ~A [~A]~%" (-> obj want s5-2 name) (-> obj want s5-2 display?)) + (format 0 "Displaying level ~A [~A]~%" (-> this want s5-2 name) (-> this want s5-2 display?)) (level-get-for-use *level* (-> s3-1 info name) 'active) - (set! (-> s3-1 display?) (-> obj want s5-2 display?)) + (set! (-> s3-1 display?) (-> this want s5-2 display?)) ) (else - (if (and (-> s3-1 info wait-for-load) (!= (-> obj want s5-2 display?) 'display-no-wait)) + (if (and (-> s3-1 info wait-for-load) (!= (-> this want s5-2 display?) 'display-no-wait)) (send-event *target* 'loading) ) (if (= *cheat-mode* 'debug) - (format *stdcon* "display on for ~A but level is loading~%" (-> obj want s5-2 name)) + (format *stdcon* "display on for ~A but level is loading~%" (-> this want s5-2 name)) ) ) ) ) - ((not (-> obj want s5-2 display?)) + ((not (-> this want s5-2 display?)) (set! (-> s3-1 display?) #f) (format 0 "Turning level ~A off~%" (-> s3-1 name)) (deactivate s3-1) ) (else - (format 0 "Setting level ~A display command to ~A~%" (-> obj want s5-2 name) (-> obj want s5-2 display?)) - (set! (-> s3-1 display?) (-> obj want s5-2 display?)) + (format 0 "Setting level ~A display command to ~A~%" (-> this want s5-2 name) (-> this want s5-2 display?)) + (set! (-> s3-1 display?) (-> this want s5-2 display?)) ) ) ) - (when (!= (-> s3-1 force-all-visible?) (-> obj want s5-2 force-vis?)) - (set! (-> s3-1 force-all-visible?) (-> obj want s5-2 force-vis?)) - (format 0 "Setting force-all-visible?[~A] to ~A~%" (-> obj want s5-2 name) (-> obj want s5-2 force-vis?)) + (when (!= (-> s3-1 force-all-visible?) (-> this want s5-2 force-vis?)) + (set! (-> s3-1 force-all-visible?) (-> this want s5-2 force-vis?)) + (format 0 "Setting force-all-visible?[~A] to ~A~%" (-> this want s5-2 name) (-> this want s5-2 force-vis?)) ) - (when (!= (-> s3-1 force-inside?) (-> obj want s5-2 force-inside?)) - (set! (-> s3-1 force-inside?) (-> obj want s5-2 force-inside?)) - (format 0 "Setting force-inside?[~A] to ~A~%" (-> obj want s5-2 name) (-> obj want s5-2 force-inside?)) + (when (!= (-> s3-1 force-inside?) (-> this want s5-2 force-inside?)) + (set! (-> s3-1 force-inside?) (-> this want s5-2 force-inside?)) + (format 0 "Setting force-inside?[~A] to ~A~%" (-> this want s5-2 name) (-> this want s5-2 force-inside?)) ) ) ) @@ -1484,13 +1484,13 @@ ) ) ) - (when (and (!= s5-3 (-> obj vis-nick)) (-> *level* vis?)) - (when (-> obj vis-nick) + (when (and (!= s5-3 (-> this vis-nick)) (-> *level* vis?)) + (when (-> this vis-nick) (dotimes (s4-3 (-> *level* length)) (let ((v1-133 (-> *level* level s4-3))) (when (= (-> v1-133 status) 'active) - (if (and (= (-> v1-133 nickname) (-> obj vis-nick)) (-> v1-133 inside-boxes?)) - (load-vis-info (-> obj vis-nick) s5-3) + (if (and (= (-> v1-133 nickname) (-> this vis-nick)) (-> v1-133 inside-boxes?)) + (load-vis-info (-> this vis-nick) s5-3) ) ) ) @@ -1502,17 +1502,17 @@ ) ;; definition for method 16 of type level-group -(defmethod level-update level-group ((obj level-group)) +(defmethod level-update level-group ((this level-group)) (camera-pos) (new 'static 'boxed-array :type symbol :length 0 :allocated-length 2) (update *setting-control*) (update *art-control* #t) (clear-rec *art-control*) (dotimes (s5-0 2) - (load-continue (-> obj level s5-0)) + (load-continue (-> this level s5-0)) ) - (dotimes (s5-1 (-> obj length)) - (let ((s4-0 (-> obj level s5-1))) + (dotimes (s5-1 (-> this length)) + (let ((s4-0 (-> this level s5-1))) (when (= (-> s4-0 status) 'active) (set! (-> s4-0 inside-boxes?) (point-in-boxes? s4-0 (-> *math-camera* trans))) (set! (-> s4-0 inside-sphere?) (>= (-> s4-0 bsp bsphere w) (-> s4-0 level-distance))) @@ -1523,13 +1523,13 @@ ) ) (update! *load-state*) - (dotimes (s5-2 (-> obj length)) - (let ((s4-1 (-> obj level s5-2))) + (dotimes (s5-2 (-> this length)) + (let ((s4-1 (-> this level s5-2))) (when (= (-> s4-1 status) 'active) (if (and (-> s4-1 inside-boxes?) (not (-> s4-1 other inside-boxes?))) (set! (-> s4-1 other meta-inside?) #f) ) - (when (and (null? (-> obj load-commands)) + (when (and (null? (-> this load-commands)) (= (-> s4-1 nickname) (-> *load-state* vis-nick)) (!= (-> s4-1 name) (-> *game-info* current-continue level)) (-> *level* border?) @@ -1555,8 +1555,8 @@ ) ) ) - (dotimes (v1-67 (-> obj length)) - (let ((a0-26 (-> obj level v1-67))) + (dotimes (v1-67 (-> this length)) + (let ((a0-26 (-> this level v1-67))) (when (= (-> a0-26 status) 'active) (set! (-> a0-26 vis-self-index) 0) (set! (-> a0-26 vis-adj-index) 7) @@ -1571,8 +1571,8 @@ ) ) (when *display-level-border* - (dotimes (s5-3 (-> obj length)) - (let ((s4-3 (-> obj level s5-3))) + (dotimes (s5-3 (-> this length)) + (let ((s4-3 (-> this level s5-3))) (when (= (-> s4-3 status) 'active) (let ((s3-1 (-> s4-3 bsp current-bsp-back-flags))) (dotimes (s2-1 6) @@ -1595,8 +1595,8 @@ ) ) ) - (dotimes (s5-4 (-> obj length)) - (let ((s4-4 (-> obj level s5-4))) + (dotimes (s5-4 (-> this length)) + (let ((s4-4 (-> this level s5-4))) (when (= (-> s4-4 status) 'active) (when (and (= (-> s4-4 nickname) (-> *load-state* vis-nick)) (not (-> s4-4 inside-boxes?))) (if (and (= *cheat-mode* 'debug) (-> s4-4 other inside-boxes?)) @@ -1608,16 +1608,16 @@ ) ) (cond - ((not (or (-> obj level0 inside-boxes?) (-> obj level1 inside-boxes?))) - (when (or (-> obj level0 vis-info 0) (-> obj level1 vis-info 0)) + ((not (or (-> this level0 inside-boxes?) (-> this level1 inside-boxes?))) + (when (or (-> this level0 vis-info 0) (-> this level1 vis-info 0)) (if (= *cheat-mode* 'debug) (format *stdcon* "~3Loutside of bsp~%~0L") ) ) ) (else - (dotimes (v1-125 (-> obj length)) - (let ((a0-44 (-> obj level v1-125))) + (dotimes (v1-125 (-> this length)) + (let ((a0-44 (-> this level v1-125))) (when (= (-> a0-44 status) 'active) (dotimes (a1-17 8) (let ((a2-18 (-> a0-44 vis-info a1-17))) @@ -1694,8 +1694,8 @@ ) ) ) - (dotimes (s5-5 (-> obj length)) - (let ((s4-5 (-> obj level s5-5))) + (dotimes (s5-5 (-> this length)) + (let ((s4-5 (-> this level s5-5))) (when (= (-> s4-5 status) 'active) (format *stdcon* diff --git a/test/decompiler/reference/jak1/engine/level/load-boundary-h_REF.gc b/test/decompiler/reference/jak1/engine/level/load-boundary-h_REF.gc index 884e09b806..be225afec6 100644 --- a/test/decompiler/reference/jak1/engine/level/load-boundary-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/load-boundary-h_REF.gc @@ -20,18 +20,18 @@ ;; definition for method 3 of type lbvtx ;; INFO: Used lq/sq -(defmethod inspect lbvtx ((obj lbvtx)) - (format #t "[~8x] ~A~%" obj 'lbvtx) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tv0: ~D~%" (-> obj v0)) - (format #t "~Tv1: ~D~%" (-> obj v1)) - (format #t "~Tv2: ~D~%" (-> obj v2)) - (format #t "~Tix: ~D~%" (-> obj ix)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - (format #t "~Tv: #~%" (&-> obj x)) - obj +(defmethod inspect lbvtx ((this lbvtx)) + (format #t "[~8x] ~A~%" this 'lbvtx) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tv0: ~D~%" (-> this v0)) + (format #t "~Tv1: ~D~%" (-> this v1)) + (format #t "~Tv2: ~D~%" (-> this v2)) + (format #t "~Tix: ~D~%" (-> this ix)) + (format #t "~Tquad: ~D~%" (-> this quad)) + (format #t "~Tv: #~%" (&-> this x)) + this ) ;; definition of type load-boundary-crossing-command @@ -55,20 +55,20 @@ ) ;; definition for method 3 of type load-boundary-crossing-command -(defmethod inspect load-boundary-crossing-command ((obj load-boundary-crossing-command)) - (format #t "[~8x] ~A~%" obj 'load-boundary-crossing-command) - (format #t "~Tcmd: ~D~%" (-> obj cmd)) - (format #t "~Tbparm[3] @ #x~X~%" (-> obj bparm)) - (format #t "~Tparm[2] @ #x~X~%" (-> obj parm)) - (format #t "~Tlev0: ~A~%" (-> obj lev0)) - (format #t "~Tlev1: ~A~%" (-> obj lev1)) - (format #t "~Tdisplev: ~A~%" (-> obj lev0)) - (format #t "~Tdispcmd: ~A~%" (-> obj lev1)) - (format #t "~Tnick: ~A~%" (-> obj lev0)) - (format #t "~Tforcelev: ~A~%" (-> obj lev0)) - (format #t "~Tforceonoff: ~A~%" (-> obj lev1)) - (format #t "~Tcheckname: ~A~%" (-> obj lev0)) - obj +(defmethod inspect load-boundary-crossing-command ((this load-boundary-crossing-command)) + (format #t "[~8x] ~A~%" this 'load-boundary-crossing-command) + (format #t "~Tcmd: ~D~%" (-> this cmd)) + (format #t "~Tbparm[3] @ #x~X~%" (-> this bparm)) + (format #t "~Tparm[2] @ #x~X~%" (-> this parm)) + (format #t "~Tlev0: ~A~%" (-> this lev0)) + (format #t "~Tlev1: ~A~%" (-> this lev1)) + (format #t "~Tdisplev: ~A~%" (-> this lev0)) + (format #t "~Tdispcmd: ~A~%" (-> this lev1)) + (format #t "~Tnick: ~A~%" (-> this lev0)) + (format #t "~Tforcelev: ~A~%" (-> this lev0)) + (format #t "~Tforceonoff: ~A~%" (-> this lev1)) + (format #t "~Tcheckname: ~A~%" (-> this lev0)) + this ) ;; definition of type load-boundary @@ -94,19 +94,19 @@ ) ;; definition for method 3 of type load-boundary -(defmethod inspect load-boundary ((obj load-boundary)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-points: ~D~%" (-> obj num-points)) - (format #t "~Tflags: ~D~%" (-> obj flags)) - (format #t "~Ttop-plane: ~f~%" (-> obj top-plane)) - (format #t "~Tbot-plane: ~f~%" (-> obj bot-plane)) - (format #t "~Ttri-cnt: ~D~%" (-> obj tri-cnt)) - (format #t "~Tnext: ~A~%" (-> obj next)) - (format #t "~Tcmd-fwd: #~%" (-> obj cmd-fwd)) - (format #t "~Tcmd-bwd: #~%" (-> obj cmd-bwd)) - (format #t "~Trejector: #~%" (-> obj rejector)) - (format #t "~Tdata[1] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect load-boundary ((this load-boundary)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-points: ~D~%" (-> this num-points)) + (format #t "~Tflags: ~D~%" (-> this flags)) + (format #t "~Ttop-plane: ~f~%" (-> this top-plane)) + (format #t "~Tbot-plane: ~f~%" (-> this bot-plane)) + (format #t "~Ttri-cnt: ~D~%" (-> this tri-cnt)) + (format #t "~Tnext: ~A~%" (-> this next)) + (format #t "~Tcmd-fwd: #~%" (-> this cmd-fwd)) + (format #t "~Tcmd-bwd: #~%" (-> this cmd-bwd)) + (format #t "~Trejector: #~%" (-> this rejector)) + (format #t "~Tdata[1] @ #x~X~%" (-> this data)) + this ) ;; definition for symbol *load-boundary-list*, type load-boundary diff --git a/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc b/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc index 2d5e794477..ab5454491c 100644 --- a/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc +++ b/test/decompiler/reference/jak1/engine/level/load-boundary_REF.gc @@ -14,13 +14,13 @@ ) ;; definition for method 3 of type lb-editor-parms -(defmethod inspect lb-editor-parms ((obj lb-editor-parms)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tboundary: ~A~%" (-> obj boundary)) - (format #t "~Tvertex: ~D~%" (-> obj vertex)) - (format #t "~Tx-origin: ~f~%" (-> obj x-origin)) - (format #t "~Tz-origin: ~f~%" (-> obj z-origin)) - obj +(defmethod inspect lb-editor-parms ((this lb-editor-parms)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tboundary: ~A~%" (-> this boundary)) + (format #t "~Tvertex: ~D~%" (-> this vertex)) + (format #t "~Tx-origin: ~f~%" (-> this x-origin)) + (format #t "~Tz-origin: ~f~%" (-> this z-origin)) + this ) ;; definition for symbol *lb-editor-parms*, type lb-editor-parms @@ -963,6 +963,7 @@ ) ;; definition for function lb-flip +;; INFO: Return type mismatch object vs none. ;; WARN: Function lb-flip has a return type of none, but the expression builder found a return statement. (defun lb-flip () (let ((gp-0 (-> *lb-editor-parms* boundary))) @@ -1539,56 +1540,56 @@ ) ;; definition for method 9 of type load-state -(defmethod reset! load-state ((obj load-state)) - (set! (-> obj want 0 name) #f) - (set! (-> obj want 0 display?) #f) - (set! (-> obj want 0 force-vis?) #f) - (set! (-> obj want 0 force-inside?) #f) - (set! (-> obj want 1 name) #f) - (set! (-> obj want 1 display?) #f) - (set! (-> obj want 1 force-vis?) #f) - (set! (-> obj want 1 force-inside?) #f) - (set! (-> obj command-list) '()) +(defmethod reset! load-state ((this load-state)) + (set! (-> this want 0 name) #f) + (set! (-> this want 0 display?) #f) + (set! (-> this want 0 force-vis?) #f) + (set! (-> this want 0 force-inside?) #f) + (set! (-> this want 1 name) #f) + (set! (-> this want 1 display?) #f) + (set! (-> this want 1 force-vis?) #f) + (set! (-> this want 1 force-inside?) #f) + (set! (-> this command-list) '()) (dotimes (v1-1 256) - (set! (-> obj object-name v1-1) #f) - (set! (-> obj object-status v1-1) (the-as basic 0)) + (set! (-> this object-name v1-1) #f) + (set! (-> this object-status v1-1) (the-as basic 0)) ) - obj + this ) ;; definition for method 11 of type load-state -(defmethod want-levels load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-levels load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) (cond - ((= (-> obj want v1-0 name) arg0) + ((= (-> this want v1-0 name) arg0) (set! arg0 #f) ) - ((= (-> obj want v1-0 name) arg1) + ((= (-> this want v1-0 name) arg1) (set! arg1 #f) ) (else - (set! (-> obj want v1-0 name) #f) + (set! (-> this want v1-0 name) #f) ) ) ) (when arg0 (dotimes (v1-4 2) - (when (not (-> obj want v1-4 name)) - (set! (-> obj want v1-4 name) arg0) - (set! (-> obj want v1-4 display?) #f) - (set! (-> obj want v1-4 force-vis?) #f) - (set! (-> obj want v1-4 force-inside?) #f) + (when (not (-> this want v1-4 name)) + (set! (-> this want v1-4 name) arg0) + (set! (-> this want v1-4 display?) #f) + (set! (-> this want v1-4 force-vis?) #f) + (set! (-> this want v1-4 force-inside?) #f) (set! v1-4 2) ) ) ) (when arg1 (dotimes (v1-10 2) - (when (not (-> obj want v1-10 name)) - (set! (-> obj want v1-10 name) arg1) - (set! (-> obj want v1-10 display?) #f) - (set! (-> obj want v1-10 force-vis?) #f) - (set! (-> obj want v1-10 force-inside?) #f) + (when (not (-> this want v1-10 name)) + (set! (-> this want v1-10 name) arg1) + (set! (-> this want v1-10 display?) #f) + (set! (-> this want v1-10 force-vis?) #f) + (set! (-> this want v1-10 force-inside?) #f) (set! v1-10 2) ) ) @@ -1597,10 +1598,10 @@ ) ;; definition for method 12 of type load-state -(defmethod want-display-level load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-display-level load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 display?) arg1) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 display?) arg1) (return 0) ) ) @@ -1611,16 +1612,16 @@ ) ;; definition for method 13 of type load-state -(defmethod want-vis load-state ((obj load-state) (arg0 symbol)) - (set! (-> obj vis-nick) arg0) +(defmethod want-vis load-state ((this load-state) (arg0 symbol)) + (set! (-> this vis-nick) arg0) 0 ) ;; definition for method 14 of type load-state -(defmethod want-force-vis load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-vis load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 force-vis?) arg1) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 force-vis?) arg1) (return 0) ) ) @@ -1631,10 +1632,10 @@ ;; definition for method 20 of type load-state ;; INFO: Return type mismatch int vs none. ;; WARN: Function (method 20 load-state) has a return type of none, but the expression builder found a return statement. -(defmethod set-force-inside! load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod set-force-inside! load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 2) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 force-inside?) arg1) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 force-inside?) arg1) (return 0) ) ) @@ -1670,45 +1671,45 @@ (define *backup-load-state* (new 'global 'load-state)) ;; definition for method 17 of type load-state -(defmethod backup-load-state-and-set-cmds load-state ((obj load-state) (arg0 pair)) +(defmethod backup-load-state-and-set-cmds load-state ((this load-state) (arg0 pair)) (dotimes (s4-0 256) - (when (-> obj object-name s4-0) - (format 0 "WARNING: load state somehow aquired object command ~A~%" (-> obj object-name s4-0)) - (set! (-> obj object-name s4-0) #f) + (when (-> this object-name s4-0) + (format 0 "WARNING: load state somehow aquired object command ~A~%" (-> this object-name s4-0)) + (set! (-> this object-name s4-0) #f) ) ) - (mem-copy! (&-> *backup-load-state* type) (&-> obj type) 2092) + (mem-copy! (&-> *backup-load-state* type) (&-> this type) 2092) (set! (-> *backup-load-state* command-list) '()) - (set! (-> obj command-list) arg0) + (set! (-> this command-list) arg0) 0 ) ;; definition for method 18 of type load-state -(defmethod restore-load-state-and-cleanup load-state ((obj load-state)) - (execute-commands-up-to obj 100000.0) +(defmethod restore-load-state-and-cleanup load-state ((this load-state)) + (execute-commands-up-to this 100000.0) (dotimes (s5-0 256) - (when (-> obj object-name s5-0) - (let ((a0-3 (entity-by-name (the-as string (-> obj object-name s5-0))))) - (set! (-> a0-3 extra perm status) (the-as entity-perm-status (-> obj object-status s5-0))) + (when (-> this object-name s5-0) + (let ((a0-3 (entity-by-name (the-as string (-> this object-name s5-0))))) + (set! (-> a0-3 extra perm status) (the-as entity-perm-status (-> this object-status s5-0))) (if (-> a0-3 extra process) (kill! a0-3) ) ) - (set! (-> obj object-name s5-0) #f) + (set! (-> this object-name s5-0) #f) ) ) - (mem-copy! (&-> obj type) (&-> *backup-load-state* type) 2092) + (mem-copy! (&-> this type) (&-> *backup-load-state* type) 2092) 0 ) ;; definition for method 19 of type load-state -(defmethod restore-load-state load-state ((obj load-state)) +(defmethod restore-load-state load-state ((this load-state)) (dotimes (v1-0 256) - (if (-> obj object-name v1-0) - (set! (-> obj object-name v1-0) #f) + (if (-> this object-name v1-0) + (set! (-> this object-name v1-0) #f) ) ) - (mem-copy! (&-> obj type) (&-> *backup-load-state* type) 2092) + (mem-copy! (&-> this type) (&-> *backup-load-state* type) 2092) 0 ) @@ -1787,33 +1788,33 @@ ) ;; definition for method 16 of type load-state -(defmethod execute-commands-up-to load-state ((obj load-state) (arg0 float)) - (while (not (null? (-> obj command-list))) - (let ((f0-0 (command-get-float (car (car (-> obj command-list))) 0.0)) - (s4-0 (cdr (car (-> obj command-list)))) +(defmethod execute-commands-up-to load-state ((this load-state) (arg0 float)) + (while (not (null? (-> this command-list))) + (let ((f0-0 (command-get-float (car (car (-> this command-list))) 0.0)) + (s4-0 (cdr (car (-> this command-list)))) ) (if (< arg0 f0-0) (return (the-as int #f)) ) (if *display-load-commands* - (format 0 "NOTICE: ~D: ~f: execute command ~A~%" (-> *display* base-frame-counter) f0-0 s4-0) + (format 0 "NOTICE: ~D: ~f: execute command ~A~%" (current-time) f0-0 s4-0) ) (cond ((pair? (car s4-0)) (let ((a1-3 (car s4-0))) (while (not (null? s4-0)) - (execute-command obj (the-as pair a1-3)) + (execute-command this (the-as pair a1-3)) (set! s4-0 (cdr s4-0)) (set! a1-3 (car s4-0)) ) ) ) (else - (execute-command obj s4-0) + (execute-command this s4-0) ) ) ) - (set! (-> obj command-list) (cdr (-> obj command-list))) + (set! (-> this command-list) (cdr (-> this command-list))) ) 0 ) @@ -1821,7 +1822,7 @@ ;; definition for method 15 of type load-state ;; INFO: Return type mismatch int vs none. ;; ERROR: Failed load: (set! v1-138 (l.wu (+ a0-142 -4))) at op 648 -(defmethod execute-command load-state ((obj load-state) (arg0 pair)) +(defmethod execute-command load-state ((this load-state) (arg0 pair)) (local-vars (v1-26 int) (v1-57 int)) (with-pp (cond @@ -1843,32 +1844,32 @@ ((the-as (function int) (command-get-param (car gp-0) #f))) ) ((= v1-4 'want-vis) - (want-vis obj (the-as symbol (command-get-param (car gp-0) #f))) + (want-vis this (the-as symbol (command-get-param (car gp-0) #f))) ) ((= v1-4 'want-levels) (want-levels - obj + this (the-as symbol (command-get-param (car gp-0) #f)) (the-as symbol (command-get-param (car (cdr gp-0)) #f)) ) ) ((= v1-4 'display-level) (want-display-level - obj + this (the-as symbol (command-get-param (car gp-0) #f)) (the-as symbol (command-get-param (car (cdr gp-0)) #f)) ) ) ((= v1-4 'want-force-vis) (want-force-vis - obj + this (the-as symbol (command-get-param (car gp-0) #f)) (the-as symbol (command-get-param (car (cdr gp-0)) #f)) ) ) ((= v1-4 'want-force-inside) (set-force-inside! - obj + this (the-as symbol (command-get-param (car gp-0) #f)) (the-as symbol (command-get-param (car (cdr gp-0)) #f)) ) @@ -1879,9 +1880,9 @@ (let ((gp-1 (entity-by-name (the-as string s4-5)))) (when gp-1 (dotimes (v1-25 256) - (when (not (-> obj object-name v1-25)) - (set! (-> obj object-name v1-25) (the-as symbol s4-5)) - (set! (-> obj object-status v1-25) (the-as basic (-> gp-1 extra perm status))) + (when (not (-> this object-name v1-25)) + (set! (-> this object-name v1-25) (the-as symbol s4-5)) + (set! (-> this object-status v1-25) (the-as basic (-> gp-1 extra perm status))) (set! v1-26 v1-25) (goto cfg-29) ) @@ -1908,12 +1909,12 @@ (let ((s4-6 (entity-by-name (the-as string s3-4)))) (when s4-6 (dotimes (gp-2 256) - (when (string= (the-as string (-> obj object-name gp-2)) (the-as string s3-4)) - (set! (-> s4-6 extra perm status) (the-as entity-perm-status (-> obj object-status gp-2))) + (when (string= (the-as string (-> this object-name gp-2)) (the-as string s3-4)) + (set! (-> s4-6 extra perm status) (the-as entity-perm-status (-> this object-status gp-2))) (if (-> s4-6 extra process) (kill! s4-6) ) - (set! (-> obj object-name gp-2) #f) + (set! (-> this object-name gp-2) #f) (goto cfg-45) ) ) @@ -1929,9 +1930,9 @@ (let ((gp-3 (entity-by-name (the-as string s4-7)))) (when gp-3 (dotimes (v1-56 256) - (when (not (-> obj object-name v1-56)) - (set! (-> obj object-name v1-56) (the-as symbol s4-7)) - (set! (-> obj object-status v1-56) (the-as basic (-> gp-3 extra perm status))) + (when (not (-> this object-name v1-56)) + (set! (-> this object-name v1-56) (the-as symbol s4-7)) + (set! (-> this object-status v1-56) (the-as basic (-> gp-3 extra perm status))) (set! v1-57 v1-56) (goto cfg-56) ) @@ -2045,7 +2046,7 @@ ) ) ((= v1-4 'save) - (mem-copy! (&-> *backup-load-state* type) (&-> obj type) 2092) + (mem-copy! (&-> *backup-load-state* type) (&-> this type) 2092) (set! (-> *backup-load-state* command-list) '()) (dotimes (v1-112 256) (if (-> *backup-load-state* object-name v1-112) diff --git a/test/decompiler/reference/jak1/engine/load/decomp-h_REF.gc b/test/decompiler/reference/jak1/engine/load/decomp-h_REF.gc index f8e4f8c56e..d57b5f1dc0 100644 --- a/test/decompiler/reference/jak1/engine/load/decomp-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/decomp-h_REF.gc @@ -14,13 +14,13 @@ ) ;; definition for method 3 of type decomp-work -(defmethod inspect decomp-work ((obj decomp-work)) - (format #t "[~8x] ~A~%" obj 'decomp-work) - (format #t "~Tbuffer0[2048] @ #x~X~%" (-> obj buffer0)) - (format #t "~Tbuffer1[2048] @ #x~X~%" (-> obj buffer1)) - (format #t "~Tindices[2048] @ #x~X~%" (-> obj indices)) - (format #t "~Ttemp-indices[2048] @ #x~X~%" (-> obj temp-indices)) - obj +(defmethod inspect decomp-work ((this decomp-work)) + (format #t "[~8x] ~A~%" this 'decomp-work) + (format #t "~Tbuffer0[2048] @ #x~X~%" (-> this buffer0)) + (format #t "~Tbuffer1[2048] @ #x~X~%" (-> this buffer1)) + (format #t "~Tindices[2048] @ #x~X~%" (-> this indices)) + (format #t "~Ttemp-indices[2048] @ #x~X~%" (-> this temp-indices)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/load/decomp_REF.gc b/test/decompiler/reference/jak1/engine/load/decomp_REF.gc index 13c25fd6f4..72f286da70 100644 --- a/test/decompiler/reference/jak1/engine/load/decomp_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/decomp_REF.gc @@ -51,11 +51,11 @@ ) ;; definition for method 3 of type huf-dictionary-node -(defmethod inspect huf-dictionary-node ((obj huf-dictionary-node)) - (format #t "[~8x] ~A~%" obj 'huf-dictionary-node) - (format #t "~Tzero: ~D~%" (-> obj zero)) - (format #t "~Tone: ~D~%" (-> obj one)) - obj +(defmethod inspect huf-dictionary-node ((this huf-dictionary-node)) + (format #t "[~8x] ~A~%" this 'huf-dictionary-node) + (format #t "~Tzero: ~D~%" (-> this zero)) + (format #t "~Tone: ~D~%" (-> this one)) + this ) ;; definition for function unpack-comp-huf @@ -108,7 +108,7 @@ ;; definition for method 16 of type level ;; INFO: Used lq/sq -(defmethod update-vis! level ((obj level) (vis-info level-vis-info) (arg1 uint) (arg2 uint)) +(defmethod update-vis! level ((this level) (vis-info level-vis-info) (arg1 uint) (arg2 uint)) (local-vars (t0-3 uint128) (vis-buffer object)) (let* ((cam-leaf-idx (-> vis-info from-bsp current-leaf-idx)) (curr-vis-str (-> vis-info current-vis-string)) @@ -123,7 +123,7 @@ (return #f) ) (logand! (-> vis-info flags) -1073741825) - (set! vis-buffer (-> obj vis-buffer)) + (set! vis-buffer (-> this vis-buffer)) (b! #t cfg-27 :delay (nop!)) (label cfg-6) (return #t) @@ -139,11 +139,11 @@ (set! vis-buffer (+ arg2 desired-vis-str)) (b! #t cfg-27 :delay (nop!)) (label cfg-15) - (let ((vis-load-result (vis-load obj))) + (let ((vis-load-result (vis-load this))) (b! (nonzero? vis-load-result) cfg-21 :delay (empty-form)) (let* ((dest-bits (-> vis-info vis-bits)) - (len (-> obj bsp visible-list-length)) - (bsp-bits (the-as (pointer uinteger) (-> obj bsp all-visible-list))) + (len (-> this bsp visible-list-length)) + (bsp-bits (the-as (pointer uinteger) (-> this bsp all-visible-list))) (len-qw (/ (+ len 15) 16)) ) (dotimes (a2-1 len-qw) @@ -158,21 +158,21 @@ (label cfg-21) (when (check-busy *ramdisk-rpc*) (set! (-> vis-info current-vis-string) (the-as uint -1)) - (set! (-> obj all-visible?) 'loading) + (set! (-> this all-visible?) 'loading) (if (= *cheat-mode* 'debug) (format *stdcon* "Ramdisk loading~%") ) (return #f) ) (logior! (-> vis-info flags) #x40000000) - (ramdisk-load (the-as int vis-load-result) desired-vis-str (the-as uint 2048) (-> obj vis-buffer)) + (ramdisk-load (the-as int vis-load-result) desired-vis-str (the-as uint 2048) (-> this vis-buffer)) (set! result #f) (b! #t cfg-55 :delay (nop!)) (label cfg-27) (let ((lower-flag-bits (the-as int (logand #x1fffffff (-> vis-info flags)))) (spad-start (the-as object (+ 16 #x70000000))) (spad-end (+ 2064 #x70000000)) - (list-len (-> obj bsp visible-list-length)) + (list-len (-> this bsp visible-list-length)) ) (when (zero? (the-as uint lower-flag-bits)) (let ((list-qwc (/ (+ list-len 15) 16))) @@ -190,7 +190,11 @@ (set! (-> (the-as (pointer uint128) spad-start) a0-32) (the-as uint128 0)) ) ) - (unpack-vis (-> obj bsp drawable-trees) (the-as (pointer int8) spad-start) (the-as (pointer int8) vis-buffer)) + (unpack-vis + (-> this bsp drawable-trees) + (the-as (pointer int8) spad-start) + (the-as (pointer int8) vis-buffer) + ) ) ((2) (unpack-comp-rle (the-as (pointer int8) spad-start) (the-as (pointer int8) vis-buffer)) @@ -210,7 +214,7 @@ (shift-arith-right-32 lower-flag-bits lower-flag-bits 3) ) (let ((s2-1 vis-buffer) - (s1-1 (the-as (pointer uinteger) (-> obj bsp all-visible-list))) + (s1-1 (the-as (pointer uinteger) (-> this bsp all-visible-list))) (v1-67 #f) ) (dotimes (s0-1 list-len) @@ -244,7 +248,7 @@ ) (let ((v1-71 vis-buffer) (a0-47 (-> vis-info vis-bits)) - (a1-22 (the-as (pointer uinteger) (-> obj bsp all-visible-list))) + (a1-22 (the-as (pointer uinteger) (-> this bsp all-visible-list))) (a2-11 (/ (+ list-len 15) 16)) ) (dotimes (a3-8 a2-11) diff --git a/test/decompiler/reference/jak1/engine/load/file-io_REF.gc b/test/decompiler/reference/jak1/engine/load/file-io_REF.gc index 3906d1b1d3..953ba7d2dc 100644 --- a/test/decompiler/reference/jak1/engine/load/file-io_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/file-io_REF.gc @@ -17,13 +17,13 @@ ) ;; definition for method 3 of type file-stream -(defmethod inspect file-stream ((obj file-stream)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tflags: #x~X~%" (-> obj flags)) - (format #t "~Tmode: ~A~%" (-> obj mode)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tfile: ~D~%" (-> obj file)) - obj +(defmethod inspect file-stream ((this file-stream)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tflags: #x~X~%" (-> this flags)) + (format #t "~Tmode: ~A~%" (-> this mode)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tfile: ~D~%" (-> this file)) + this ) ;; definition for method 0 of type file-stream @@ -59,30 +59,30 @@ ) ;; definition for method 3 of type file-info -(defmethod inspect file-info ((obj file-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tfile-type: ~A~%" (-> obj file-type)) - (format #t "~Tfile-name: ~A~%" (-> obj file-name)) - (format #t "~Tmajor-version: ~D~%" (-> obj major-version)) - (format #t "~Tminor-version: ~D~%" (-> obj minor-version)) - (format #t "~Tmaya-file-name: ~A~%" (-> obj maya-file-name)) - (format #t "~Ttool-debug: ~A~%" (-> obj tool-debug)) - (format #t "~Tmdb-file-name: ~A~%" (-> obj mdb-file-name)) - obj +(defmethod inspect file-info ((this file-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tfile-type: ~A~%" (-> this file-type)) + (format #t "~Tfile-name: ~A~%" (-> this file-name)) + (format #t "~Tmajor-version: ~D~%" (-> this major-version)) + (format #t "~Tminor-version: ~D~%" (-> this minor-version)) + (format #t "~Tmaya-file-name: ~A~%" (-> this maya-file-name)) + (format #t "~Ttool-debug: ~A~%" (-> this tool-debug)) + (format #t "~Tmdb-file-name: ~A~%" (-> this mdb-file-name)) + this ) ;; definition for method 2 of type file-info -(defmethod print file-info ((obj file-info)) +(defmethod print file-info ((this file-info)) (format #t "#<~A ~A :version ~D.~D @ #x~X>" - (-> obj type) - (-> obj file-name) - (-> obj major-version) - (-> obj minor-version) - obj + (-> this type) + (-> this file-name) + (-> this major-version) + (-> this minor-version) + this ) - obj + this ) ;; definition for symbol *file-temp-string*, type string diff --git a/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc b/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc index 6876066ae5..70c6755091 100644 --- a/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/load-dgo_REF.gc @@ -19,16 +19,16 @@ ;; definition for method 3 of type load-dgo-msg ;; INFO: Used lq/sq -(defmethod inspect load-dgo-msg ((obj load-dgo-msg)) - (format #t "[~8x] ~A~%" obj 'load-dgo-msg) - (format #t "~Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~Tresult: ~D~%" (-> obj result)) - (format #t "~Tb1: #x~X~%" (-> obj b1)) - (format #t "~Tb2: #x~X~%" (-> obj b2)) - (format #t "~Tbt: #x~X~%" (-> obj bt)) - (format #t "~Tname: ~D~%" (-> obj name)) - (format #t "~Taddress: ~D~%" (-> obj b1)) - obj +(defmethod inspect load-dgo-msg ((this load-dgo-msg)) + (format #t "[~8x] ~A~%" this 'load-dgo-msg) + (format #t "~Trsvd: ~D~%" (-> this rsvd)) + (format #t "~Tresult: ~D~%" (-> this result)) + (format #t "~Tb1: #x~X~%" (-> this b1)) + (format #t "~Tb2: #x~X~%" (-> this b2)) + (format #t "~Tbt: #x~X~%" (-> this bt)) + (format #t "~Tname: ~D~%" (-> this name)) + (format #t "~Taddress: ~D~%" (-> this b1)) + this ) ;; definition of type load-chunk-msg @@ -47,16 +47,16 @@ ) ;; definition for method 3 of type load-chunk-msg -(defmethod inspect load-chunk-msg ((obj load-chunk-msg)) - (format #t "[~8x] ~A~%" obj 'load-chunk-msg) - (format #t "~Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~Tresult: ~D~%" (-> obj result)) - (format #t "~Taddress: ~D~%" (-> obj address)) - (format #t "~Tsection: ~D~%" (-> obj section)) - (format #t "~Tmaxlen: ~D~%" (-> obj maxlen)) - (format #t "~Tid: ~D~%" (-> obj address)) - (format #t "~Tbasename[48] @ #x~X~%" (-> obj basename)) - obj +(defmethod inspect load-chunk-msg ((this load-chunk-msg)) + (format #t "[~8x] ~A~%" this 'load-chunk-msg) + (format #t "~Trsvd: ~D~%" (-> this rsvd)) + (format #t "~Tresult: ~D~%" (-> this result)) + (format #t "~Taddress: ~D~%" (-> this address)) + (format #t "~Tsection: ~D~%" (-> this section)) + (format #t "~Tmaxlen: ~D~%" (-> this maxlen)) + (format #t "~Tid: ~D~%" (-> this address)) + (format #t "~Tbasename[48] @ #x~X~%" (-> this basename)) + this ) ;; definition of type dgo-header @@ -71,11 +71,11 @@ ) ;; definition for method 3 of type dgo-header -(defmethod inspect dgo-header ((obj dgo-header)) - (format #t "[~8x] ~A~%" obj 'dgo-header) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Trootname[60] @ #x~X~%" (-> obj rootname)) - obj +(defmethod inspect dgo-header ((this dgo-header)) + (format #t "[~8x] ~A~%" this 'dgo-header) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Trootname[60] @ #x~X~%" (-> this rootname)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/load/loader-h_REF.gc b/test/decompiler/reference/jak1/engine/load/loader-h_REF.gc index 83e9f74916..9a95be8f31 100644 --- a/test/decompiler/reference/jak1/engine/load/loader-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/loader-h_REF.gc @@ -31,24 +31,24 @@ ;; definition for method 0 of type load-dir (defmethod new load-dir ((allocation symbol) (type-to-make type) (length int) (unk level)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj lev) unk) - (set! (-> obj string-array) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this lev) unk) + (set! (-> this string-array) (the-as (array string) ((method-of-type array new) allocation array string length)) ) - (set! (-> obj string-array length) 0) - (set! (-> obj data-array) (the-as (array basic) ((method-of-type array new) allocation array basic length))) - (set! (-> obj data-array length) 0) - obj + (set! (-> this string-array length) 0) + (set! (-> this data-array) (the-as (array basic) ((method-of-type array new) allocation array basic length))) + (set! (-> this data-array length) 0) + this ) ) ;; definition for method 0 of type load-dir-art-group ;; INFO: Return type mismatch load-dir vs load-dir-art-group. (defmethod new load-dir-art-group ((allocation symbol) (type-to-make type) (length int) (unk level)) - (let ((obj ((method-of-type load-dir new) allocation type-to-make length unk))) - (set! (-> obj data-array content-type) art-group) - (the-as load-dir-art-group obj) + (let ((this ((method-of-type load-dir new) allocation type-to-make length unk))) + (set! (-> this data-array content-type) art-group) + (the-as load-dir-art-group this) ) ) @@ -88,45 +88,45 @@ ) ;; definition for method 3 of type external-art-buffer -(defmethod inspect external-art-buffer ((obj external-art-buffer)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tindex: ~D~%" (-> obj index)) - (format #t "~Tother: ~A~%" (-> obj other)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tlocked?: ~A~%" (-> obj locked?)) - (format #t "~Tframe-lock: ~A~%" (-> obj frame-lock)) - (format #t "~Theap: #~%" (-> obj heap)) - (format #t "~Tpending-load-file: ~A~%" (-> obj pending-load-file)) - (format #t "~Tpending-load-file-part: ~D~%" (-> obj pending-load-file-part)) - (format #t "~Tpending-load-file-owner: ~D~%" (-> obj pending-load-file-owner)) - (format #t "~Tpending-load-file-priority: ~f~%" (-> obj pending-load-file-priority)) - (format #t "~Tload-file: ~A~%" (-> obj load-file)) - (format #t "~Tload-file-part: ~D~%" (-> obj load-file-part)) - (format #t "~Tload-file-owner: ~D~%" (-> obj load-file-owner)) - (format #t "~Tload-file-priority: ~f~%" (-> obj load-file-priority)) - (format #t "~Tbuf: #x~X~%" (-> obj buf)) - (format #t "~Tlen: ~D~%" (-> obj len)) - (format #t "~Tart-group: ~A~%" (-> obj art-group)) - obj +(defmethod inspect external-art-buffer ((this external-art-buffer)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tindex: ~D~%" (-> this index)) + (format #t "~Tother: ~A~%" (-> this other)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tlocked?: ~A~%" (-> this locked?)) + (format #t "~Tframe-lock: ~A~%" (-> this frame-lock)) + (format #t "~Theap: #~%" (-> this heap)) + (format #t "~Tpending-load-file: ~A~%" (-> this pending-load-file)) + (format #t "~Tpending-load-file-part: ~D~%" (-> this pending-load-file-part)) + (format #t "~Tpending-load-file-owner: ~D~%" (-> this pending-load-file-owner)) + (format #t "~Tpending-load-file-priority: ~f~%" (-> this pending-load-file-priority)) + (format #t "~Tload-file: ~A~%" (-> this load-file)) + (format #t "~Tload-file-part: ~D~%" (-> this load-file-part)) + (format #t "~Tload-file-owner: ~D~%" (-> this load-file-owner)) + (format #t "~Tload-file-priority: ~f~%" (-> this load-file-priority)) + (format #t "~Tbuf: #x~X~%" (-> this buf)) + (format #t "~Tlen: ~D~%" (-> this len)) + (format #t "~Tart-group: ~A~%" (-> this art-group)) + this ) ;; definition for method 0 of type external-art-buffer (defmethod new external-art-buffer ((allocation symbol) (type-to-make type) (idx int)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj index) idx) - (set! (-> obj load-file) #f) - (set! (-> obj load-file-part) -1) - (set! (-> obj load-file-owner) (the-as handle #f)) - (set! (-> obj load-file-priority) 100000000.0) - (set! (-> obj pending-load-file) #f) - (set! (-> obj pending-load-file-part) -1) - (set! (-> obj pending-load-file-owner) (the-as handle #f)) - (set! (-> obj pending-load-file-priority) 100000000.0) - (set! (-> obj art-group) #f) - (set! (-> obj status) 'initialize) - (set! (-> obj locked?) #f) - (set! (-> obj other) #f) - obj + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this index) idx) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) 100000000.0) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) 100000000.0) + (set! (-> this art-group) #f) + (set! (-> this status) 'initialize) + (set! (-> this locked?) #f) + (set! (-> this other) #f) + this ) ) @@ -148,15 +148,15 @@ ) ;; definition for method 3 of type spool-anim -(defmethod inspect spool-anim ((obj spool-anim)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tindex: ~D~%" (-> obj index)) - (format #t "~Tparts: ~D~%" (-> obj parts)) - (format #t "~Tpriority: ~f~%" (-> obj priority)) - (format #t "~Towner: ~D~%" (-> obj owner)) - (format #t "~Tcommand-list: ~A~%" (-> obj command-list)) - obj +(defmethod inspect spool-anim ((this spool-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tindex: ~D~%" (-> this index)) + (format #t "~Tparts: ~D~%" (-> this parts)) + (format #t "~Tpriority: ~f~%" (-> this priority)) + (format #t "~Towner: ~D~%" (-> this owner)) + (format #t "~Tcommand-list: ~A~%" (-> this command-list)) + this ) ;; definition of type external-art-control @@ -188,44 +188,44 @@ ) ;; definition for method 3 of type external-art-control -(defmethod inspect external-art-control ((obj external-art-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tbuffer[2] @ #x~X~%" (-> obj buffer)) - (format #t "~Trec[3] @ #x~X~%" (-> obj rec)) - (format #t "~Tspool-lock: ~D~%" (-> obj spool-lock)) - (format #t "~Treserve-buffer: ~A~%" (-> obj reserve-buffer)) - (format #t "~Treserve-buffer-count: ~D~%" (-> obj reserve-buffer-count)) - (format #t "~Tactive-stream: ~A~%" (-> obj active-stream)) - (format #t "~Tpreload-stream: #~%" (-> obj preload-stream)) - (format #t "~Tlast-preload-stream: #~%" (-> obj last-preload-stream)) - obj +(defmethod inspect external-art-control ((this external-art-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tbuffer[2] @ #x~X~%" (-> this buffer)) + (format #t "~Trec[3] @ #x~X~%" (-> this rec)) + (format #t "~Tspool-lock: ~D~%" (-> this spool-lock)) + (format #t "~Treserve-buffer: ~A~%" (-> this reserve-buffer)) + (format #t "~Treserve-buffer-count: ~D~%" (-> this reserve-buffer-count)) + (format #t "~Tactive-stream: ~A~%" (-> this active-stream)) + (format #t "~Tpreload-stream: #~%" (-> this preload-stream)) + (format #t "~Tlast-preload-stream: #~%" (-> this last-preload-stream)) + this ) ;; definition for method 0 of type external-art-control (defmethod new external-art-control ((allocation symbol) (type-to-make type)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) (dotimes (buff-idx 2) - (set! (-> obj buffer buff-idx) + (set! (-> this buffer buff-idx) ((method-of-type external-art-buffer new) allocation external-art-buffer buff-idx) ) ) - (set! (-> obj buffer 0 other) (-> obj buffer 1)) - (set! (-> obj buffer 1 other) (-> obj buffer 0)) + (set! (-> this buffer 0 other) (-> this buffer 1)) + (set! (-> this buffer 1 other) (-> this buffer 0)) (dotimes (rec-idx 3) - (set! (-> obj rec rec-idx name) #f) - (set! (-> obj rec rec-idx priority) 100000000.0) - (set! (-> obj rec rec-idx owner) (the-as handle #f)) + (set! (-> this rec rec-idx name) #f) + (set! (-> this rec rec-idx priority) 100000000.0) + (set! (-> this rec rec-idx owner) (the-as handle #f)) ) - (set! (-> obj spool-lock) (the-as handle #f)) - (set! (-> obj reserve-buffer) #f) - (set! (-> obj active-stream) #f) - (set! (-> obj preload-stream name) #f) - (set! (-> obj preload-stream priority) 100000000.0) - (set! (-> obj preload-stream owner) (the-as handle #f)) - (set! (-> obj last-preload-stream name) #f) - (set! (-> obj last-preload-stream priority) 100000000.0) - (set! (-> obj last-preload-stream owner) (the-as handle #f)) - obj + (set! (-> this spool-lock) (the-as handle #f)) + (set! (-> this reserve-buffer) #f) + (set! (-> this active-stream) #f) + (set! (-> this preload-stream name) #f) + (set! (-> this preload-stream priority) 100000000.0) + (set! (-> this preload-stream owner) (the-as handle #f)) + (set! (-> this last-preload-stream name) #f) + (set! (-> this last-preload-stream priority) 100000000.0) + (set! (-> this last-preload-stream owner) (the-as handle #f)) + this ) ) diff --git a/test/decompiler/reference/jak1/engine/load/loader_REF.gc b/test/decompiler/reference/jak1/engine/load/loader_REF.gc index 7351e0930a..8bb576d6d1 100644 --- a/test/decompiler/reference/jak1/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/loader_REF.gc @@ -3,79 +3,79 @@ ;; definition for method 3 of type load-dir ;; INFO: Used lq/sq -(defmethod inspect load-dir ((obj load-dir)) +(defmethod inspect load-dir ((this load-dir)) (local-vars (sv-16 basic)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlevel: ~A~%" (-> obj lev)) - (format #t "~Tallocated-length: ~D~%" (-> obj string-array allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj string-array length)) - (dotimes (s5-0 (-> obj string-array length)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlevel: ~A~%" (-> this lev)) + (format #t "~Tallocated-length: ~D~%" (-> this string-array allocated-length)) + (format #t "~Tlength: ~D~%" (-> this string-array length)) + (dotimes (s5-0 (-> this string-array length)) (let ((s4-0 format) (s3-0 #t) (s2-0 "~T [~D] ~S ~A (~D bytes)~%") (s1-0 s5-0) - (s0-0 (-> obj string-array s5-0)) + (s0-0 (-> this string-array s5-0)) ) - (set! sv-16 (-> obj data-array s5-0)) - (let ((t1-0 (mem-size (-> obj data-array s5-0) #f 0))) + (set! sv-16 (-> this data-array s5-0)) + (let ((t1-0 (mem-size (-> this data-array s5-0) #f 0))) (s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0) ) ) ) - obj + this ) ;; definition for method 8 of type load-dir ;; INFO: Return type mismatch symbol vs load-dir. -(defmethod mem-usage load-dir ((obj load-dir) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage load-dir ((this load-dir) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "array") (+! (-> arg0 data 81 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 81 used) v1-6) (+! (-> arg0 data 81 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "array") (set! (-> arg0 data 81 count) (-> arg0 data 81 count)) - (let ((v1-15 (asize-of (-> obj string-array)))) + (let ((v1-15 (asize-of (-> this string-array)))) (+! (-> arg0 data 81 used) v1-15) (+! (-> arg0 data 81 total) (logand -16 (+ v1-15 15))) ) (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "array") (set! (-> arg0 data 81 count) (-> arg0 data 81 count)) - (let ((v1-24 (asize-of (-> obj data-array)))) + (let ((v1-24 (asize-of (-> this data-array)))) (+! (-> arg0 data 81 used) v1-24) (+! (-> arg0 data 81 total) (logand -16 (+ v1-24 15))) ) - (dotimes (s3-0 (-> obj data-array length)) - (mem-usage (-> obj data-array s3-0) arg0 arg1) + (dotimes (s3-0 (-> this data-array length)) + (mem-usage (-> this data-array s3-0) arg0 arg1) ) (the-as load-dir #f) ) ;; definition for method 9 of type load-dir-art-group -(defmethod load-to-heap-by-name load-dir-art-group ((obj load-dir-art-group) (art-name string) (do-reload symbol) (heap kheap) (version int)) - (let ((s5-0 (-> obj string-array))) +(defmethod load-to-heap-by-name load-dir-art-group ((this load-dir-art-group) (art-name string) (do-reload symbol) (heap kheap) (version int)) + (let ((s5-0 (-> this string-array))) (dotimes (s3-0 (-> s5-0 length)) (when (string= art-name (-> s5-0 s3-0)) (when do-reload (let ((v1-4 (art-group-load-check art-name heap version))) (if v1-4 - (set! (-> obj art-group-array s3-0) v1-4) + (set! (-> this art-group-array s3-0) v1-4) ) ) ) - (return (-> obj art-group-array s3-0)) + (return (-> this art-group-array s3-0)) ) ) (let ((v0-2 (art-group-load-check art-name heap version))) (when v0-2 (set! (-> s5-0 (-> s5-0 length)) art-name) - (set! (-> obj art-group-array (-> s5-0 length)) v0-2) + (set! (-> this art-group-array (-> s5-0 length)) v0-2) (+! (-> s5-0 length) 1) - (+! (-> obj art-group-array length) 1) + (+! (-> this art-group-array length) 1) ) v0-2 ) @@ -83,20 +83,20 @@ ) ;; definition for method 10 of type load-dir-art-group -(defmethod set-loaded-art load-dir-art-group ((obj load-dir-art-group) (arg0 art-group)) - (let ((s4-0 (-> obj string-array))) +(defmethod set-loaded-art load-dir-art-group ((this load-dir-art-group) (arg0 art-group)) + (let ((s4-0 (-> this string-array))) (dotimes (s3-0 (-> s4-0 length)) (when (string= (-> arg0 name) (-> s4-0 s3-0)) - (set! (-> obj art-group-array s3-0) arg0) - (set! arg0 (-> obj art-group-array s3-0)) + (set! (-> this art-group-array s3-0) arg0) + (set! arg0 (-> this art-group-array s3-0)) (goto cfg-7) ) ) (set! (-> s4-0 (-> s4-0 length)) (-> arg0 name)) - (set! (-> obj art-group-array (-> s4-0 length)) arg0) + (set! (-> this art-group-array (-> s4-0 length)) arg0) (+! (-> s4-0 length) 1) ) - (+! (-> obj art-group-array length) 1) + (+! (-> this art-group-array length) 1) (label cfg-7) arg0 ) @@ -167,40 +167,40 @@ ) ;; definition for method 9 of type external-art-buffer -(defmethod set-pending-file external-art-buffer ((obj external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) - (set! (-> obj pending-load-file) arg0) - (set! (-> obj pending-load-file-part) arg1) - (set! (-> obj pending-load-file-owner) arg2) - (set! (-> obj pending-load-file-priority) arg3) +(defmethod set-pending-file external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) + (set! (-> this pending-load-file) arg0) + (set! (-> this pending-load-file-part) arg1) + (set! (-> this pending-load-file-owner) arg2) + (set! (-> this pending-load-file-priority) arg3) 0 ) ;; definition for method 15 of type external-art-buffer -(defmethod unlock! external-art-buffer ((obj external-art-buffer)) - (set! (-> obj locked?) #f) +(defmethod unlock! external-art-buffer ((this external-art-buffer)) + (set! (-> this locked?) #f) #f ) ;; definition for method 11 of type external-art-buffer -(defmethod inactive? external-art-buffer ((obj external-art-buffer)) - (!= (-> obj status) 'active) +(defmethod inactive? external-art-buffer ((this external-art-buffer)) + (!= (-> this status) 'active) ) ;; definition for method 12 of type external-art-buffer -(defmethod file-status external-art-buffer ((obj external-art-buffer) (arg0 string) (arg1 int)) - (when (and (name= (-> obj pending-load-file) arg0) (= (-> obj pending-load-file-part) arg1)) - (if (and (name= (-> obj load-file) arg0) (= (-> obj load-file-part) arg1)) - (-> obj status) +(defmethod file-status external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int)) + (when (and (name= (-> this pending-load-file) arg0) (= (-> this pending-load-file-part) arg1)) + (if (and (name= (-> this load-file) arg0) (= (-> this load-file-part) arg1)) + (-> this status) 'pending ) ) ) ;; definition for method 13 of type art-group -(defmethod link-art! art-group ((obj art-group)) - (when obj - (countdown (s5-0 (-> obj length)) - (let* ((art-elt (-> obj data s5-0)) +(defmethod link-art! art-group ((this art-group)) + (when this + (countdown (s5-0 (-> this length)) + (let* ((art-elt (-> this data s5-0)) (janim (if (and (nonzero? art-elt) (type-type? (-> art-elt type) art-joint-anim)) (the-as art-joint-anim art-elt) ) @@ -235,20 +235,20 @@ ) ) (if (not success) - (format 0 "ERROR: ~A could not find a master slot to link for ~A.~%" (-> obj name) janim) + (format 0 "ERROR: ~A could not find a master slot to link for ~A.~%" (-> this name) janim) ) ) ) ) ) - obj + this ) ;; definition for method 14 of type art-group -(defmethod unlink-art! art-group ((obj art-group)) - (when obj - (countdown (s5-0 (-> obj length)) - (let* ((art-elt (-> obj data s5-0)) +(defmethod unlink-art! art-group ((this art-group)) + (when this + (countdown (s5-0 (-> this length)) + (let* ((art-elt (-> this data s5-0)) (janim (if (and (nonzero? art-elt) (type-type? (-> art-elt type) art-joint-anim)) (the-as art-joint-anim art-elt) ) @@ -273,7 +273,7 @@ ) ) (if (not success) - (format 0 "ERROR: ~A could not find a master slot to unlink for ~A.~%" (-> obj name) janim) + (format 0 "ERROR: ~A could not find a master slot to unlink for ~A.~%" (-> this name) janim) ) ) ) @@ -283,186 +283,188 @@ ) ;; definition for method 13 of type external-art-buffer -(defmethod link-file external-art-buffer ((obj external-art-buffer) (arg0 art-group)) +(defmethod link-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) (when arg0 (link-art! arg0) - (set! (-> obj art-group) arg0) + (set! (-> this art-group) arg0) ) arg0 ) ;; definition for method 14 of type external-art-buffer -(defmethod unlink-file external-art-buffer ((obj external-art-buffer) (arg0 art-group)) +(defmethod unlink-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) (when arg0 (unlink-art! arg0) - (set! (-> obj art-group) #f) + (set! (-> this art-group) #f) ) 0 ) ;; definition for method 10 of type external-art-buffer ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. -(defmethod update external-art-buffer ((obj external-art-buffer)) - (when (or (not (name= (-> obj pending-load-file) (-> obj load-file))) - (!= (-> obj pending-load-file-part) (-> obj load-file-part)) +(defmethod update external-art-buffer ((this external-art-buffer)) + (when (or (not (name= (-> this pending-load-file) (-> this load-file))) + (!= (-> this pending-load-file-part) (-> this load-file-part)) ) - (when (not (handle->process (-> obj pending-load-file-owner))) - (set! (-> obj pending-load-file) #f) - (set! (-> obj pending-load-file-part) -1) - (set! (-> obj pending-load-file-owner) (the-as handle #f)) - (set! (-> obj pending-load-file-priority) 100000000.0) + (when (not (handle->process (-> this pending-load-file-owner))) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) 100000000.0) ) - (when (= (-> obj status) 'initialize) - (let ((v1-11 (-> obj heap))) - (set! (-> v1-11 base) (the-as pointer (+ #x84000 (* #x3dc00 (-> obj index))))) + (when (= (-> this status) 'initialize) + (let ((v1-11 (-> this heap))) + (set! (-> v1-11 base) (the-as pointer (+ #x84000 (* #x3dc00 (-> this index))))) (set! (-> v1-11 current) (-> v1-11 base)) (set! (-> v1-11 top-base) (&+ (-> v1-11 base) #x3dc00)) (set! (-> v1-11 top) (-> v1-11 top-base)) ) - (set! (-> obj status) 'inactive) + (set! (-> this status) 'inactive) ) (cond - ((-> obj load-file) - (if (= (-> obj status) 'loading) + ((-> this load-file) + (if (= (-> this status) 'loading) (str-load-cancel) ) - (set! (-> obj load-file) #f) - (set! (-> obj load-file-part) -1) - (set! (-> obj load-file-owner) (the-as handle #f)) - (set! (-> obj load-file-priority) 100000000.0) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) 100000000.0) ) (else - (set! (-> obj load-file) (-> obj pending-load-file)) - (set! (-> obj load-file-part) (-> obj pending-load-file-part)) - (set! (-> obj load-file-owner) (-> obj pending-load-file-owner)) - (set! (-> obj load-file-priority) (-> obj pending-load-file-priority)) + (set! (-> this load-file) (-> this pending-load-file)) + (set! (-> this load-file-part) (-> this pending-load-file-part)) + (set! (-> this load-file-owner) (-> this pending-load-file-owner)) + (set! (-> this load-file-priority) (-> this pending-load-file-priority)) ) ) ) (label cfg-18) (cond - ((-> obj load-file) - (case (-> obj status) + ((-> this load-file) + (case (-> this status) (('active 'reserved) ) (('error) - (set! (-> obj status) 'inactive) - (set! (-> obj load-file) #f) - (set! (-> obj load-file-part) -1) - (set! (-> obj load-file-owner) (the-as handle #f)) - (set! (-> obj load-file-priority) 100000000.0) - (set! (-> obj pending-load-file) #f) - (set! (-> obj pending-load-file-part) -1) - (set! (-> obj pending-load-file-owner) (the-as handle #f)) - (set! (-> obj pending-load-file-priority) 100000000.0) - (set! (-> obj art-group) #f) + (set! (-> this status) 'inactive) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) 100000000.0) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) 100000000.0) + (set! (-> this art-group) #f) ) (('inactive) - (let ((v1-28 (-> obj heap))) + (let ((v1-28 (-> this heap))) (set! (-> v1-28 current) (-> v1-28 base)) ) (cond - ((string= (-> obj load-file) "reserved") + ((string= (-> this load-file) "reserved") (cond ((-> *art-control* reserve-buffer) - (format 0 "ERROR: trying double reserve ~A when ~A is reserved~%" obj (-> *art-control* reserve-buffer)) + (format 0 "ERROR: trying double reserve ~A when ~A is reserved~%" this (-> *art-control* reserve-buffer)) ) (else - (set! (-> obj status) 'reserved) - (set! (-> *art-control* reserve-buffer) obj) + (set! (-> this status) 'reserved) + (set! (-> *art-control* reserve-buffer) this) ) ) ) - ((and (!= (-> *level* loading-level) (-> *level* level-default)) (< 81920.0 (-> obj load-file-priority))) + ((and (!= (-> *level* loading-level) (-> *level* level-default)) (< 81920.0 (-> this load-file-priority))) ) - ((str-load (-> obj load-file) (-> obj load-file-part) (logand -64 (&+ (-> obj heap current) 63)) #x3fc00) - (set! (-> obj status) 'loading) + ((str-load (-> this load-file) (-> this load-file-part) (logand -64 (&+ (-> this heap current) 63)) #x3fc00) + (set! (-> this status) 'loading) ) ) ) (('loading) - (case (str-load-status (&-> obj len)) + (case (str-load-status (&-> this len)) (('error) - (set! (-> obj status) 'error) + (set! (-> this status) 'error) ) (('busy) ) (else - (set! (-> obj buf) (logand -64 (&+ (-> obj heap current) 63))) - (set! (-> obj status) 'loaded) + (set! (-> this buf) (logand -64 (&+ (-> this heap current) 63))) + (set! (-> this status) 'loaded) (goto cfg-18) ) ) ) (('loaded) - (let ((a0-37 (-> obj buf))) - (set! (-> obj art-group) (the-as art-group (link a0-37 (-> obj load-file data) (-> obj len) (-> obj heap) 0))) + (let ((a0-37 (-> this buf))) + (set! (-> this art-group) + (the-as art-group (link a0-37 (-> this load-file data) (-> this len) (-> this heap) 0)) + ) ) - (let ((s4-0 (-> obj art-group)) - (s3-0 (-> obj load-file)) + (let ((s4-0 (-> this art-group)) + (s3-0 (-> this load-file)) ) (cond ((not s4-0) - (format 0 "ERROR: art-group ~A part ~D is not a valid file.~%" s3-0 (-> obj load-file-part)) - (set! (-> obj status) 'error) + (format 0 "ERROR: art-group ~A part ~D is not a valid file.~%" s3-0 (-> this load-file-part)) + (set! (-> this status) 'error) ) ((not (type-type? (-> s4-0 type) art-group)) - (format 0 "ERROR: art-group ~A part ~D is not a art-group.~%" s3-0 (-> obj load-file-part)) - (set! (-> obj status) 'error) + (format 0 "ERROR: art-group ~A part ~D is not a art-group.~%" s3-0 (-> this load-file-part)) + (set! (-> this status) 'error) ) ((not (file-info-correct-version? (-> s4-0 info) (file-kind art-group) 0)) - (set! (-> obj status) 'error) + (set! (-> this status) 'error) ) (else (login s4-0) - (set! (-> obj status) 'locked) + (set! (-> this status) 'locked) ) ) ) ) (('locked) - (when (and (not (-> obj locked?)) (handle->process (-> obj load-file-owner))) - (link-file obj (-> obj art-group)) - (set! (-> obj other locked?) #t) - (set! (-> obj status) 'active) + (when (and (not (-> this locked?)) (handle->process (-> this load-file-owner))) + (link-file this (-> this art-group)) + (set! (-> this other locked?) #t) + (set! (-> this status) 'active) (goto cfg-18) ) ) ) ) (else - (case (-> obj status) + (case (-> this status) (('initialize) ) (('reserved) (cond - ((= (-> *art-control* reserve-buffer) obj) + ((= (-> *art-control* reserve-buffer) this) (set! (-> *art-control* reserve-buffer) #f) - (set! (-> obj status) 'inactive) + (set! (-> this status) 'inactive) ) (else - (format 0 "ERROR: trying tro free ~A when ~A is reserved~%" obj (-> *art-control* reserve-buffer)) + (format 0 "ERROR: trying tro free ~A when ~A is reserved~%" this (-> *art-control* reserve-buffer)) ) ) ) (('active) - (unlink-file obj (-> obj art-group)) - (let ((v1-70 (-> obj heap))) + (unlink-file this (-> this art-group)) + (let ((v1-70 (-> this heap))) (set! (-> v1-70 current) (-> v1-70 base)) ) - (set! (-> obj art-group) #f) - (set! (-> obj status) 'inactive) - (when (-> obj other locked?) - (unlock! (-> obj other)) - (update (-> obj other)) + (set! (-> this art-group) #f) + (set! (-> this status) 'inactive) + (when (-> this other locked?) + (unlock! (-> this other)) + (update (-> this other)) ) ) (else - (let ((v1-79 (-> obj heap))) + (let ((v1-79 (-> this heap))) (set! (-> v1-79 current) (-> v1-79 base)) ) - (set! (-> obj art-group) #f) - (set! (-> obj status) 'inactive) + (set! (-> this art-group) #f) + (set! (-> this status) 'inactive) ) ) ) @@ -474,9 +476,9 @@ (define *preload-spool-anims* #t) ;; definition for method 12 of type external-art-control -(defmethod file-status external-art-control ((obj external-art-control) (arg0 string) (arg1 int)) +(defmethod file-status external-art-control ((this external-art-control) (arg0 string) (arg1 int)) (dotimes (s3-0 2) - (let ((v1-3 (file-status (-> obj buffer s3-0) arg0 arg1))) + (let ((v1-3 (file-status (-> this buffer s3-0) arg0 arg1))) (if v1-3 (return v1-3) ) @@ -486,31 +488,33 @@ ) ;; definition for method 9 of type external-art-control -(defmethod update external-art-control ((obj external-art-control) (arg0 symbol)) - (if (nonzero? (-> obj reserve-buffer-count)) - (spool-push obj "reserved" 0 *dproc* (if (-> obj reserve-buffer) - -110.0 - -0.5 - ) +(defmethod update external-art-control ((this external-art-control) (arg0 symbol)) + (if (nonzero? (-> this reserve-buffer-count)) + (spool-push this "reserved" 0 *dproc* (if (-> this reserve-buffer) + -110.0 + -0.5 + ) ) ) (dotimes (v1-5 2) - (set! (-> obj buffer v1-5 frame-lock) #f) + (set! (-> this buffer v1-5 frame-lock) #f) ) (dotimes (v1-8 3) - (set! (-> obj rec v1-8 index) (the-as int #f)) + (set! (-> this rec v1-8 index) (the-as int #f)) ) (dotimes (s4-0 2) - (let ((s3-0 (-> obj rec s4-0))) + (let ((s3-0 (-> this rec s4-0))) (when (-> s3-0 name) (dotimes (s2-0 2) - (when (and (file-status (-> obj buffer s2-0) (-> s3-0 name) (-> s3-0 parts)) (not (-> obj buffer s2-0 frame-lock))) - (set! (-> obj buffer s2-0 frame-lock) #t) - (set! (-> s3-0 index) (the-as int (-> obj buffer s2-0))) - (set! (-> obj buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) - (set! (-> obj buffer s2-0 load-file-owner) (-> s3-0 owner)) - (set! (-> obj buffer s2-0 pending-load-file-priority) (-> s3-0 priority)) - (set! (-> obj buffer s2-0 load-file-priority) (-> s3-0 priority)) + (when (and (file-status (-> this buffer s2-0) (-> s3-0 name) (-> s3-0 parts)) + (not (-> this buffer s2-0 frame-lock)) + ) + (set! (-> this buffer s2-0 frame-lock) #t) + (set! (-> s3-0 index) (the-as int (-> this buffer s2-0))) + (set! (-> this buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) + (set! (-> this buffer s2-0 load-file-owner) (-> s3-0 owner)) + (set! (-> this buffer s2-0 pending-load-file-priority) (-> s3-0 priority)) + (set! (-> this buffer s2-0 load-file-priority) (-> s3-0 priority)) (goto cfg-24) ) ) @@ -519,16 +523,16 @@ (label cfg-24) ) (dotimes (s4-1 2) - (let ((s3-1 (-> obj rec s4-1))) + (let ((s3-1 (-> this rec s4-1))) (when (and (-> s3-1 name) (not (-> s3-1 buf2))) (if (and (not *preload-spool-anims*) (>= (-> s3-1 priority) 0.0)) (goto cfg-46) ) (dotimes (s2-1 2) - (when (not (-> obj buffer s2-1 frame-lock)) - (set! (-> obj buffer s2-1 frame-lock) #t) - (set-pending-file (-> obj buffer s2-1) (-> s3-1 name) (-> s3-1 parts) (-> s3-1 owner) (-> s3-1 priority)) - (set! (-> s3-1 index) (the-as int (-> obj buffer s2-1))) + (when (not (-> this buffer s2-1 frame-lock)) + (set! (-> this buffer s2-1 frame-lock) #t) + (set-pending-file (-> this buffer s2-1) (-> s3-1 name) (-> s3-1 parts) (-> s3-1 owner) (-> s3-1 priority)) + (set! (-> s3-1 index) (the-as int (-> this buffer s2-1))) (goto cfg-46) ) ) @@ -536,8 +540,8 @@ ) (label cfg-46) ) - (when (not (-> obj reserve-buffer)) - (let ((s4-2 (-> obj rec 0 buf2))) + (when (not (-> this reserve-buffer)) + (let ((s4-2 (-> this rec 0 buf2))) (if (and s4-2 (-> s4-2 locked?) (not (string= (-> s4-2 pending-load-file) "reserved")) @@ -548,25 +552,25 @@ ) ) (dotimes (s4-3 2) - (update (-> obj buffer s4-3)) + (update (-> this buffer s4-3)) ) (let ((s4-4 (the-as spool-anim #f))) (countdown (s3-2 3) - (if (and (-> obj rec s3-2 name) (not (name= (-> obj rec s3-2 name) (-> obj active-stream)))) - (set! s4-4 (the-as spool-anim (-> obj rec))) + (if (and (-> this rec s3-2 name) (not (name= (-> this rec s3-2 name) (-> this active-stream)))) + (set! s4-4 (the-as spool-anim (-> this rec))) ) ) - (if (and (-> obj preload-stream name) (or (not s4-4) (< (-> obj preload-stream priority) (-> s4-4 priority)))) - (set! s4-4 (-> obj preload-stream)) + (if (and (-> this preload-stream name) (or (not s4-4) (< (-> this preload-stream priority) (-> s4-4 priority)))) + (set! s4-4 (-> this preload-stream)) ) (cond (s4-4 - (mem-copy! (&-> (-> obj last-preload-stream) type) (&-> s4-4 type) 44) + (mem-copy! (&-> (-> this last-preload-stream) type) (&-> s4-4 type) 44) (str-play-queue (-> s4-4 name)) ) (else - (set! (-> obj last-preload-stream name) #f) - (set! (-> obj last-preload-stream owner) (the-as handle #f)) + (set! (-> this last-preload-stream name) #f) + (set! (-> this last-preload-stream owner) (the-as handle #f)) ) ) ) @@ -576,10 +580,10 @@ (a0-29 *stdcon*) (a1-9 "rec ~d ~S ~D ~f ~A~%") (a2-5 s5-1) - (a3-3 (-> obj rec s5-1 name)) - (t0-3 (-> obj rec s5-1 parts)) - (t1-0 (-> obj rec s5-1 priority)) - (v1-123 (handle->process (-> obj rec s5-1 owner))) + (a3-3 (-> this rec s5-1 name)) + (t0-3 (-> this rec s5-1 parts)) + (t1-0 (-> this rec s5-1 priority)) + (v1-123 (handle->process (-> this rec s5-1 owner))) ) (t9-10 a0-29 a1-9 a2-5 a3-3 t0-3 t1-0 (if v1-123 (-> v1-123 name) @@ -592,15 +596,15 @@ (a0-30 *stdcon*) (a1-10 "buf ~d ~C ~S ~D ~A ~A~%") (a2-6 s5-2) - (a3-4 (if (-> obj buffer s5-2 locked?) + (a3-4 (if (-> this buffer s5-2 locked?) 108 32 ) ) - (t0-4 (-> obj buffer s5-2 pending-load-file)) - (t1-1 (-> obj buffer s5-2 pending-load-file-part)) - (t2-5 (-> obj buffer s5-2 status)) - (v1-144 (handle->process (-> obj buffer s5-2 pending-load-file-owner))) + (t0-4 (-> this buffer s5-2 pending-load-file)) + (t1-1 (-> this buffer s5-2 pending-load-file-part)) + (t2-5 (-> this buffer s5-2 status)) + (v1-144 (handle->process (-> this buffer s5-2 pending-load-file-owner))) ) (t9-11 a0-30 a1-10 a2-6 a3-4 t0-4 t1-1 t2-5 (if v1-144 (-> v1-144 name) @@ -608,12 +612,12 @@ ) ) ) - (format *stdcon* " a: ~S~%" (-> obj active-stream)) + (format *stdcon* " a: ~S~%" (-> this active-stream)) (let ((t9-13 format) (a0-32 *stdcon*) (a1-12 " p: ~S ~A~%") - (a2-8 (-> obj preload-stream name)) - (v1-149 (handle->process (-> obj preload-stream owner))) + (a2-8 (-> this preload-stream name)) + (v1-149 (handle->process (-> this preload-stream owner))) ) (t9-13 a0-32 a1-12 a2-8 (if v1-149 (-> v1-149 name) @@ -623,8 +627,8 @@ (let ((t9-14 format) (a0-33 *stdcon*) (a1-13 " q: ~S ~A~%") - (a2-9 (-> obj last-preload-stream name)) - (v1-152 (handle->process (-> obj last-preload-stream owner))) + (a2-9 (-> this last-preload-stream name)) + (v1-152 (handle->process (-> this last-preload-stream owner))) ) (t9-14 a0-33 a1-13 a2-9 (if v1-152 (-> v1-152 name) @@ -636,32 +640,32 @@ ) ;; definition for method 15 of type external-art-control -(defmethod none-reserved? external-art-control ((obj external-art-control)) - (zero? (-> obj reserve-buffer-count)) +(defmethod none-reserved? external-art-control ((this external-art-control)) + (zero? (-> this reserve-buffer-count)) ) ;; definition for method 13 of type external-art-control -(defmethod reserve-alloc external-art-control ((obj external-art-control)) - (set! (-> obj reserve-buffer-count) 1) - (if (-> obj reserve-buffer) - (-> obj reserve-buffer heap) +(defmethod reserve-alloc external-art-control ((this external-art-control)) + (set! (-> this reserve-buffer-count) 1) + (if (-> this reserve-buffer) + (-> this reserve-buffer heap) ) ) ;; definition for method 14 of type external-art-control -(defmethod reserve-free external-art-control ((obj external-art-control) (arg0 kheap)) +(defmethod reserve-free external-art-control ((this external-art-control) (arg0 kheap)) (cond - ((zero? (-> obj reserve-buffer-count)) + ((zero? (-> this reserve-buffer-count)) (format 0 "ERROR: illegal attempt to free a buffer #x~X which had not been reserved (none reserved).~%" arg0) ) - ((not (-> obj reserve-buffer)) - (set! (-> obj reserve-buffer-count) 0) + ((not (-> this reserve-buffer)) + (set! (-> this reserve-buffer-count) 0) 0 ) - ((= (-> obj reserve-buffer heap) arg0) - (set-pending-file (-> obj reserve-buffer) (the-as string #f) -1 (the-as handle #f) 100000000.0) - (update (-> obj reserve-buffer)) - (set! (-> obj reserve-buffer-count) 0) + ((= (-> this reserve-buffer heap) arg0) + (set-pending-file (-> this reserve-buffer) (the-as string #f) -1 (the-as handle #f) 100000000.0) + (update (-> this reserve-buffer)) + (set! (-> this reserve-buffer-count) 0) 0 ) (else @@ -672,115 +676,115 @@ ) ;; definition for method 10 of type external-art-control -(defmethod clear-rec external-art-control ((obj external-art-control)) +(defmethod clear-rec external-art-control ((this external-art-control)) (cond ((!= *master-mode* 'game) (dotimes (s5-0 3) - (when (name= (-> obj rec s5-0 name) "reserved") + (when (name= (-> this rec s5-0 name) "reserved") (let ((v1-5 s5-0)) (cond ((zero? v1-5) - (mem-copy! (&+ (the-as pointer (-> obj rec)) -4) (&-> (-> obj rec 1) type) 44) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec 2) type) 44) + (mem-copy! (&+ (the-as pointer (-> this rec)) -4) (&-> (-> this rec 1) type) 44) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec 2) type) 44) ) ((= v1-5 1) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec 2) type) 44) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec 2) type) 44) ) ) ) - (set! (-> obj rec 2 type) spool-anim) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 priority) 100000000.0) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (set! (-> this rec 2 type) spool-anim) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 priority) 100000000.0) + (set! (-> this rec 2 owner) (the-as handle #f)) ) ) ) (else (dotimes (v1-19 3) - (set! (-> obj rec v1-19 type) spool-anim) - (set! (-> obj rec v1-19 name) #f) - (set! (-> obj rec v1-19 priority) 100000000.0) - (set! (-> obj rec v1-19 owner) (the-as handle #f)) + (set! (-> this rec v1-19 type) spool-anim) + (set! (-> this rec v1-19 name) #f) + (set! (-> this rec v1-19 priority) 100000000.0) + (set! (-> this rec v1-19 owner) (the-as handle #f)) ) - (set! (-> obj preload-stream type) spool-anim) - (set! (-> obj preload-stream name) #f) - (set! (-> obj preload-stream priority) 100000000.0) - (set! (-> obj preload-stream owner) (the-as handle #f)) + (set! (-> this preload-stream type) spool-anim) + (set! (-> this preload-stream name) #f) + (set! (-> this preload-stream priority) 100000000.0) + (set! (-> this preload-stream owner) (the-as handle #f)) ) ) 0 ) ;; definition for method 16 of type external-art-control -(defmethod try-preload-stream external-art-control ((obj external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) +(defmethod try-preload-stream external-art-control ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) (when (and (= arg3 -99.0) arg2) (let ((a0-2 (target-pos 0))) (set! arg3 (vector-vector-distance a0-2 (-> (the-as process-drawable arg2) root trans))) ) ) - (when (not (and (-> obj preload-stream name) (>= arg3 (-> obj preload-stream priority)))) - (set! (-> obj preload-stream name) arg0) - (set! (-> obj preload-stream parts) arg1) - (set! (-> obj preload-stream priority) arg3) - (set! (-> obj preload-stream owner) (process->handle arg2)) + (when (not (and (-> this preload-stream name) (>= arg3 (-> this preload-stream priority)))) + (set! (-> this preload-stream name) arg0) + (set! (-> this preload-stream parts) arg1) + (set! (-> this preload-stream priority) arg3) + (set! (-> this preload-stream owner) (process->handle arg2)) ) 0 ) ;; definition for method 11 of type external-art-control -(defmethod spool-push external-art-control ((obj external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) +(defmethod spool-push external-art-control ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) (when (and (= arg3 -99.0) arg2) (let ((a0-2 (target-pos 0))) (set! arg3 (vector-vector-distance a0-2 (-> (the-as process-drawable arg2) root trans))) ) ) (cond - ((and (= arg1 (-> obj rec 0 parts)) (name= arg0 (-> obj rec 0 name))) - (if (>= arg3 (-> obj rec 0 priority)) + ((and (= arg1 (-> this rec 0 parts)) (name= arg0 (-> this rec 0 name))) + (if (>= arg3 (-> this rec 0 priority)) (return (the-as int #f)) ) - (mem-copy! (&-> (-> obj rec) 0 type) (&-> (-> obj rec 1) type) 44) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec 2) type) 44) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (mem-copy! (&-> (-> this rec) 0 type) (&-> (-> this rec 1) type) 44) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec 2) type) 44) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) - ((and (= arg1 (-> obj rec 1 parts)) (name= arg0 (-> obj rec 1 name))) - (if (>= arg3 (-> obj rec 1 priority)) + ((and (= arg1 (-> this rec 1 parts)) (name= arg0 (-> this rec 1 name))) + (if (>= arg3 (-> this rec 1 priority)) (return (the-as int #f)) ) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec 2) type) 44) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec 2) type) 44) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) - ((and (= arg1 (-> obj rec 2 parts)) (name= arg0 (-> obj rec 2 name))) - (if (>= arg3 (-> obj rec 2 priority)) + ((and (= arg1 (-> this rec 2 parts)) (name= arg0 (-> this rec 2 name))) + (if (>= arg3 (-> this rec 2 priority)) (return (the-as int #f)) ) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) ) (cond - ((< arg3 (-> obj rec 0 priority)) - (mem-copy! (&-> (-> obj rec 2) type) (&-> (-> obj rec 1) type) 44) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec) 0 type) 44) - (set! (-> obj rec 0 name) arg0) - (set! (-> obj rec 0 parts) arg1) - (set! (-> obj rec 0 priority) arg3) - (set! (-> obj rec 0 owner) (process->handle arg2)) + ((< arg3 (-> this rec 0 priority)) + (mem-copy! (&-> (-> this rec 2) type) (&-> (-> this rec 1) type) 44) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec) 0 type) 44) + (set! (-> this rec 0 name) arg0) + (set! (-> this rec 0 parts) arg1) + (set! (-> this rec 0 priority) arg3) + (set! (-> this rec 0 owner) (process->handle arg2)) ) - ((< arg3 (-> obj rec 1 priority)) - (mem-copy! (&-> (-> obj rec 2) type) (&-> (-> obj rec 1) type) 44) - (set! (-> obj rec 1 name) arg0) - (set! (-> obj rec 1 parts) arg1) - (set! (-> obj rec 1 priority) arg3) - (set! (-> obj rec 1 owner) (process->handle arg2)) + ((< arg3 (-> this rec 1 priority)) + (mem-copy! (&-> (-> this rec 2) type) (&-> (-> this rec 1) type) 44) + (set! (-> this rec 1 name) arg0) + (set! (-> this rec 1 parts) arg1) + (set! (-> this rec 1 priority) arg3) + (set! (-> this rec 1 owner) (process->handle arg2)) ) - ((< arg3 (-> obj rec 2 priority)) - (set! (-> obj rec 2 name) arg0) - (set! (-> obj rec 2 parts) arg1) - (set! (-> obj rec 2 priority) arg3) - (set! (-> obj rec 2 owner) (process->handle arg2)) + ((< arg3 (-> this rec 2 priority)) + (set! (-> this rec 2 name) arg0) + (set! (-> this rec 2 parts) arg1) + (set! (-> this rec 2 priority) arg3) + (set! (-> this rec 2 owner) (process->handle arg2)) ) ) 0 @@ -844,7 +848,7 @@ ) ) (set! (-> *art-control* spool-lock) (process->handle self)) - (set! sv-48 (the-as int (-> *display* base-frame-counter))) + (set! sv-48 (the-as int (current-time))) (while (< spool-part (-> arg0 parts)) (spool-push *art-control* (-> arg0 name) spool-part self -20.0) (update *art-control* #f) @@ -887,15 +891,12 @@ (f28-0 (+ sv-24 (/ (the float (+ (-> s2-4 data 0 length) -1)) f30-0))) ) (set! sv-72 (current-str-pos spool-sound)) - (set! sv-40 (the-as int (-> *display* base-frame-counter))) + (set! sv-40 (the-as int (current-time))) (until (>= (the float v0-39) f28-0) (if (= (-> self skel root-channel 0) (-> self skel channel)) (logior! (-> self skel status) (janim-status spool)) ) - (if (or (arg3 self) - (and (<= sv-72 0) (>= (- (-> *display* base-frame-counter) sv-40) (seconds 4))) - (and (< 300 sv-56) (<= sv-72 0)) - ) + (if (or (arg3 self) (and (<= sv-72 0) (time-elapsed? sv-40 (seconds 4))) (and (< 300 sv-56) (<= sv-72 0))) (goto cfg-88) ) (spool-push *art-control* (-> arg0 name) spool-part self -20.0) @@ -906,15 +907,15 @@ (execute-commands-up-to *load-state* (ja-aframe-num 0)) (cond ((and (< sv-32 sv-72) (= (current-str-id) spool-sound)) - (set! sv-56 (+ sv-56 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) - (set! sv-40 (the-as int (-> *display* base-frame-counter))) + (set! sv-56 (+ sv-56 (- (current-time) (-> *display* old-base-frame-counter)))) + (set! sv-40 (the-as int (current-time))) ) (else 0 ) ) (set! sv-32 sv-72) - (set! sv-48 (the-as int (-> *display* base-frame-counter))) + (set! sv-48 (the-as int (current-time))) (suspend) (let ((f0-14 (* (- (the float (current-str-pos spool-sound)) sv-24) f30-0))) (ja-no-eval :num! (seek!) :frame-num f0-14) diff --git a/test/decompiler/reference/jak1/engine/load/ramdisk_REF.gc b/test/decompiler/reference/jak1/engine/load/ramdisk_REF.gc index 3f64a087be..572c5eb71a 100644 --- a/test/decompiler/reference/jak1/engine/load/ramdisk_REF.gc +++ b/test/decompiler/reference/jak1/engine/load/ramdisk_REF.gc @@ -15,13 +15,13 @@ ;; definition for method 3 of type ramdisk-rpc-fill ;; INFO: Used lq/sq -(defmethod inspect ramdisk-rpc-fill ((obj ramdisk-rpc-fill)) - (format #t "[~8x] ~A~%" obj 'ramdisk-rpc-fill) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tee-id: ~D~%" (-> obj ee-id)) - (format #t "~Trsvd2[2] @ #x~X~%" (-> obj rsvd2)) - (format #t "~Tfilename: ~D~%" (-> obj filename)) - obj +(defmethod inspect ramdisk-rpc-fill ((this ramdisk-rpc-fill)) + (format #t "[~8x] ~A~%" this 'ramdisk-rpc-fill) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tee-id: ~D~%" (-> this ee-id)) + (format #t "~Trsvd2[2] @ #x~X~%" (-> this rsvd2)) + (format #t "~Tfilename: ~D~%" (-> this filename)) + this ) ;; definition of type ramdisk-rpc-load @@ -37,13 +37,13 @@ ) ;; definition for method 3 of type ramdisk-rpc-load -(defmethod inspect ramdisk-rpc-load ((obj ramdisk-rpc-load)) - (format #t "[~8x] ~A~%" obj 'ramdisk-rpc-load) - (format #t "~Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~Tee-id: ~D~%" (-> obj ee-id)) - (format #t "~Toffset: ~D~%" (-> obj offset)) - (format #t "~Tlength: ~D~%" (-> obj length)) - obj +(defmethod inspect ramdisk-rpc-load ((this ramdisk-rpc-load)) + (format #t "[~8x] ~A~%" this 'ramdisk-rpc-load) + (format #t "~Trsvd: ~D~%" (-> this rsvd)) + (format #t "~Tee-id: ~D~%" (-> this ee-id)) + (format #t "~Toffset: ~D~%" (-> this offset)) + (format #t "~Tlength: ~D~%" (-> this length)) + this ) ;; definition of type ramdisk-rpc-load-to-ee @@ -61,14 +61,14 @@ ;; definition for method 3 of type ramdisk-rpc-load-to-ee ;; INFO: Used lq/sq -(defmethod inspect ramdisk-rpc-load-to-ee ((obj ramdisk-rpc-load-to-ee)) - (format #t "[~8x] ~A~%" obj 'ramdisk-rpc-load-to-ee) - (format #t "~Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~Taddr: ~D~%" (-> obj addr)) - (format #t "~Toffset: ~D~%" (-> obj offset)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tfilename: ~D~%" (-> obj filename)) - obj +(defmethod inspect ramdisk-rpc-load-to-ee ((this ramdisk-rpc-load-to-ee)) + (format #t "[~8x] ~A~%" this 'ramdisk-rpc-load-to-ee) + (format #t "~Trsvd: ~D~%" (-> this rsvd)) + (format #t "~Taddr: ~D~%" (-> this addr)) + (format #t "~Toffset: ~D~%" (-> this offset)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tfilename: ~D~%" (-> this filename)) + this ) ;; definition for symbol *ramdisk-rpc*, type rpc-buffer-pair diff --git a/test/decompiler/reference/jak1/engine/math/euler-h_REF.gc b/test/decompiler/reference/jak1/engine/math/euler-h_REF.gc index 7ad6d5c905..a383413625 100644 --- a/test/decompiler/reference/jak1/engine/math/euler-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/euler-h_REF.gc @@ -17,15 +17,15 @@ ;; definition for method 3 of type euler-angles ;; INFO: Used lq/sq -(defmethod inspect euler-angles ((obj euler-angles)) - (format #t "[~8x] ~A~%" obj 'euler-angles) - (format #t "~Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tw: ~f~%" (-> obj w)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect euler-angles ((this euler-angles)) + (format #t "[~8x] ~A~%" this 'euler-angles) + (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tw: ~f~%" (-> this w)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/math/math_REF.gc b/test/decompiler/reference/jak1/engine/math/math_REF.gc index 2f7b323e73..17f2f5dd64 100644 --- a/test/decompiler/reference/jak1/engine/math/math_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/math_REF.gc @@ -203,10 +203,10 @@ ) ;; definition for method 3 of type random-generator -(defmethod inspect random-generator ((obj random-generator)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tseed: ~D~%" (-> obj seed)) - obj +(defmethod inspect random-generator ((this random-generator)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tseed: ~D~%" (-> this seed)) + this ) ;; definition for symbol *random-generator*, type random-generator diff --git a/test/decompiler/reference/jak1/engine/math/matrix-h_REF.gc b/test/decompiler/reference/jak1/engine/math/matrix-h_REF.gc index 4582501270..3cd541df64 100644 --- a/test/decompiler/reference/jak1/engine/math/matrix-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/matrix-h_REF.gc @@ -17,12 +17,12 @@ ;; definition for method 3 of type matrix ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix ((obj matrix)) - (format #t "[~8x] ~A~%" obj 'matrix) - (format #t "~Tdata[16] @ #x~X~%" (-> obj vector)) - (format #t "~Tvector[4] @ #x~X~%" (-> obj vector)) - (format #t "~Tquad[4] @ #x~X~%" (-> obj vector)) - obj +(defmethod inspect matrix ((this matrix)) + (format #t "[~8x] ~A~%" this 'matrix) + (format #t "~Tdata[16] @ #x~X~%" (-> this vector)) + (format #t "~Tvector[4] @ #x~X~%" (-> this vector)) + (format #t "~Tquad[4] @ #x~X~%" (-> this vector)) + this ) ;; definition of type matrix3 @@ -38,12 +38,12 @@ ;; definition for method 3 of type matrix3 ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix3 ((obj matrix3)) - (format #t "[~8x] ~A~%" obj 'matrix3) - (format #t "~Tdata[12] @ #x~X~%" (-> obj data)) - (format #t "~Tvector[3] @ #x~X~%" (-> obj data)) - (format #t "~Tquad[3] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect matrix3 ((this matrix3)) + (format #t "[~8x] ~A~%" this 'matrix3) + (format #t "~Tdata[12] @ #x~X~%" (-> this data)) + (format #t "~Tvector[3] @ #x~X~%" (-> this data)) + (format #t "~Tquad[3] @ #x~X~%" (-> this data)) + this ) ;; definition of type matrix4h @@ -58,12 +58,12 @@ ) ;; definition for method 3 of type matrix4h -(defmethod inspect matrix4h ((obj matrix4h)) - (format #t "[~8x] ~A~%" obj 'matrix4h) - (format #t "~Tdata[16] @ #x~X~%" (-> obj data)) - (format #t "~Tvector4h[4] @ #x~X~%" (-> obj data)) - (format #t "~Tlong[4] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect matrix4h ((this matrix4h)) + (format #t "[~8x] ~A~%" this 'matrix4h) + (format #t "~Tdata[16] @ #x~X~%" (-> this data)) + (format #t "~Tvector4h[4] @ #x~X~%" (-> this data)) + (format #t "~Tlong[4] @ #x~X~%" (-> this data)) + this ) ;; definition for function matrix-copy! diff --git a/test/decompiler/reference/jak1/engine/math/matrix_REF.gc b/test/decompiler/reference/jak1/engine/math/matrix_REF.gc index d1ed68ca56..50c7adf517 100644 --- a/test/decompiler/reference/jak1/engine/math/matrix_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/matrix_REF.gc @@ -3,51 +3,51 @@ ;; definition for method 3 of type matrix ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix ((obj matrix)) - (format #t "[~8x] matrix~%" obj) +(defmethod inspect matrix ((this matrix)) + (format #t "[~8x] matrix~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj vector 0 x) - (-> obj vector 0 y) - (-> obj vector 0 z) - (-> obj vector 0 w) + (-> this vector 0 x) + (-> this vector 0 y) + (-> this vector 0 z) + (-> this vector 0 w) ) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj vector 1 x) - (-> obj vector 1 y) - (-> obj vector 1 z) - (-> obj vector 1 w) + (-> this vector 1 x) + (-> this vector 1 y) + (-> this vector 1 z) + (-> this vector 1 w) ) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj vector 2 x) - (-> obj vector 2 y) - (-> obj vector 2 z) - (-> obj vector 2 w) + (-> this vector 2 x) + (-> this vector 2 y) + (-> this vector 2 z) + (-> this vector 2 w) ) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj vector 3 x) - (-> obj vector 3 y) - (-> obj vector 3 z) - (-> obj vector 3 w) + (-> this vector 3 x) + (-> this vector 3 y) + (-> this vector 3 z) + (-> this vector 3 w) ) - obj + this ) ;; definition for method 3 of type matrix3 ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect matrix3 ((obj matrix3)) - (format #t "[~8x] matrix3~%" obj) - (format #t "~T[~F] [~F] [~F]~%" (-> obj data 0) (-> obj data 1) (-> obj data 2)) - (format #t "~T[~F] [~F] [~F]~%" (-> obj data 4) (-> obj data 5) (-> obj data 6)) - (format #t "~T[~F] [~F] [~F]~%" (-> obj data 8) (-> obj data 9) (-> obj data 10)) - obj +(defmethod inspect matrix3 ((this matrix3)) + (format #t "[~8x] matrix3~%" this) + (format #t "~T[~F] [~F] [~F]~%" (-> this data 0) (-> this data 1) (-> this data 2)) + (format #t "~T[~F] [~F] [~F]~%" (-> this data 4) (-> this data 5) (-> this data 6)) + (format #t "~T[~F] [~F] [~F]~%" (-> this data 8) (-> this data 9) (-> this data 10)) + this ) ;; definition for function matrix-identity! diff --git a/test/decompiler/reference/jak1/engine/math/quaternion-h_REF.gc b/test/decompiler/reference/jak1/engine/math/quaternion-h_REF.gc index 476c6b6662..3c115486f8 100644 --- a/test/decompiler/reference/jak1/engine/math/quaternion-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/quaternion-h_REF.gc @@ -19,16 +19,16 @@ ;; definition for method 3 of type quaternion ;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect quaternion ((obj quaternion)) - (format #t "[~8x] ~A~%" obj 'quaternion) - (format #t "~Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tw: ~f~%" (-> obj w)) - (format #t "~Tvec: #~%" (&-> obj x)) - (format #t "~Tquad: ~D~%" (-> obj vec quad)) - obj +(defmethod inspect quaternion ((this quaternion)) + (format #t "[~8x] ~A~%" this 'quaternion) + (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tw: ~f~%" (-> this w)) + (format #t "~Tvec: #~%" (&-> this x)) + (format #t "~Tquad: ~D~%" (-> this vec quad)) + this ) ;; definition for symbol *unity-quaternion*, type quaternion diff --git a/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc index ab79b9c186..2a1a7fe3ee 100644 --- a/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/quaternion_REF.gc @@ -3,16 +3,17 @@ ;; definition for method 3 of type quaternion ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect quaternion ((obj quaternion)) - (format #t "[~8x] quaternion~%" obj) - (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj x) (-> obj y) (-> obj z) (-> obj w)) - (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> obj x) (-> obj x)) (* (-> obj y) (-> obj y)) (* (-> obj z) (-> obj z))))))) - (format #t "~Taxis: ~F ~F ~F" (* f0-5 (-> obj x)) (* f0-5 (-> obj y)) (* f0-5 (-> obj z))) +(defmethod inspect quaternion ((this quaternion)) + (format #t "[~8x] quaternion~%" this) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) + (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> this x) (-> this x)) (* (-> this y) (-> this y)) (* (-> this z) (-> this z)))))) + ) + (format #t "~Taxis: ~F ~F ~F" (* f0-5 (-> this x)) (* f0-5 (-> this y)) (* f0-5 (-> this z))) ) - (let ((f0-9 (* 2.0 (acos (-> obj w))))) + (let ((f0-9 (* 2.0 (acos (-> this w))))) (format #t "~T~Tangle: (deg ~R)~%" f0-9) ) - obj + this ) ;; definition for function quaternion-axis-angle! diff --git a/test/decompiler/reference/jak1/engine/math/transform-h_REF.gc b/test/decompiler/reference/jak1/engine/math/transform-h_REF.gc index 04c23c754e..0565e6c8ab 100644 --- a/test/decompiler/reference/jak1/engine/math/transform-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/transform-h_REF.gc @@ -13,12 +13,12 @@ ) ;; definition for method 3 of type transform -(defmethod inspect transform ((obj transform)) - (format #t "[~8x] ~A~%" obj 'transform) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Trot: ~`vector`P~%" (-> obj rot)) - (format #t "~Tscale: ~`vector`P~%" (-> obj scale)) - obj +(defmethod inspect transform ((this transform)) + (format #t "[~8x] ~A~%" this 'transform) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Trot: ~`vector`P~%" (-> this rot)) + (format #t "~Tscale: ~`vector`P~%" (-> this scale)) + this ) ;; definition of type trs @@ -36,12 +36,12 @@ ) ;; definition for method 3 of type trs -(defmethod inspect trs ((obj trs)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Trot: ~`vector`P~%" (-> obj rot)) - (format #t "~Tscale: ~`vector`P~%" (-> obj scale)) - obj +(defmethod inspect trs ((this trs)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Trot: ~`vector`P~%" (-> this rot)) + (format #t "~Tscale: ~`vector`P~%" (-> this scale)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/math/transform_REF.gc b/test/decompiler/reference/jak1/engine/math/transform_REF.gc index d4542fff83..34b41606a7 100644 --- a/test/decompiler/reference/jak1/engine/math/transform_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/transform_REF.gc @@ -2,21 +2,21 @@ (in-package goal) ;; definition for method 2 of type transform -(defmethod print transform ((obj transform)) - (format #t "# obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) - (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> obj rot x) (-> obj rot y) (-> obj rot z) (-> obj rot w)) - (format #t "~T~Tscale:~F ~F ~F ~F>" (-> obj scale x) (-> obj scale y) (-> obj scale z) (-> obj scale w)) - obj +(defmethod print transform ((this transform)) + (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) + (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> this rot x) (-> this rot y) (-> this rot z) (-> this rot w)) + (format #t "~T~Tscale:~F ~F ~F ~F>" (-> this scale x) (-> this scale y) (-> this scale z) (-> this scale w)) + this ) ;; definition for method 0 of type trs (defmethod new trs ((allocation symbol) (type-to-make type)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj trans w) 1.0) - (set! (-> obj rot w) 1.0) - (vector-identity! (-> obj scale)) - obj + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this trans w) 1.0) + (set! (-> this rot w) 1.0) + (vector-identity! (-> this scale)) + this ) ) diff --git a/test/decompiler/reference/jak1/engine/math/transformq-h_REF.gc b/test/decompiler/reference/jak1/engine/math/transformq-h_REF.gc index dd6cc1c3e1..7e0333723f 100644 --- a/test/decompiler/reference/jak1/engine/math/transformq-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/transformq-h_REF.gc @@ -11,13 +11,13 @@ ) ;; definition for method 3 of type transformq -(defmethod inspect transformq ((obj transformq)) - (format #t "[~8x] ~A~%" obj 'transformq) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Trot: ~`vector`P~%" (-> obj quat)) - (format #t "~Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~Tquat: #~%" (-> obj quat)) - obj +(defmethod inspect transformq ((this transformq)) + (format #t "[~8x] ~A~%" this 'transformq) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Trot: ~`vector`P~%" (-> this quat)) + (format #t "~Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~Tquat: #~%" (-> this quat)) + this ) ;; definition of type trsq @@ -30,13 +30,13 @@ ) ;; definition for method 3 of type trsq -(defmethod inspect trsq ((obj trsq)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Trot: ~`vector`P~%" (-> obj quat)) - (format #t "~Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~Tquat: #~%" (-> obj quat)) - obj +(defmethod inspect trsq ((this trsq)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Trot: ~`vector`P~%" (-> this quat)) + (format #t "~Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~Tquat: #~%" (-> this quat)) + this ) ;; definition of type trsqv @@ -77,31 +77,31 @@ ) ;; definition for method 3 of type trsqv -(defmethod inspect trsqv ((obj trsqv)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Trot: ~`vector`P~%" (-> obj quat)) - (format #t "~Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~Tquat: #~%" (-> obj quat)) - (format #t "~Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance)) - (format #t "~Tnav-radius: (meters ~m)~%" (-> obj nav-radius)) - (format #t "~Ttransv: ~`vector`P~%" (-> obj transv)) - (format #t "~Trotv: ~`vector`P~%" (-> obj rotv)) - (format #t "~Tscalev: ~`vector`P~%" (-> obj scalev)) - (format #t "~Tdir-targ: #~%" (-> obj dir-targ)) - (format #t "~Tangle-change-time: ~D~%" (-> obj angle-change-time)) - (format #t "~Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff)) - obj +(defmethod inspect trsqv ((this trsqv)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Trot: ~`vector`P~%" (-> this quat)) + (format #t "~Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~Tquat: #~%" (-> this quat)) + (format #t "~Tpause-adjust-distance: (meters ~m)~%" (-> this pause-adjust-distance)) + (format #t "~Tnav-radius: (meters ~m)~%" (-> this nav-radius)) + (format #t "~Ttransv: ~`vector`P~%" (-> this transv)) + (format #t "~Trotv: ~`vector`P~%" (-> this rotv)) + (format #t "~Tscalev: ~`vector`P~%" (-> this scalev)) + (format #t "~Tdir-targ: #~%" (-> this dir-targ)) + (format #t "~Tangle-change-time: ~D~%" (-> this angle-change-time)) + (format #t "~Told-y-angle-diff: ~f~%" (-> this old-y-angle-diff)) + this ) ;; definition for method 23 of type trsqv -(defmethod global-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) - (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans))) +(defmethod global-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) ) ;; definition for method 24 of type trsqv -(defmethod relative-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) - (deg-diff (y-angle obj) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)))) +(defmethod relative-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) + (deg-diff (y-angle this) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/math/transformq_REF.gc b/test/decompiler/reference/jak1/engine/math/transformq_REF.gc index 79bf5b6223..6521aeaf47 100644 --- a/test/decompiler/reference/jak1/engine/math/transformq_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/transformq_REF.gc @@ -2,52 +2,48 @@ (in-package goal) ;; definition for method 2 of type transformq -(defmethod print transformq ((obj transformq)) - (format #t "# obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) - (format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> obj quat x) (-> obj quat y) (-> obj quat z) (-> obj quat w)) - (format #t "~T~Tscale:~F ~F ~F ~F>" (-> obj scale x) (-> obj scale y) (-> obj scale z) (-> obj scale w)) - obj +(defmethod print transformq ((this transformq)) + (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) + (format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> this quat x) (-> this quat y) (-> this quat z) (-> this quat w)) + (format #t "~T~Tscale:~F ~F ~F ~F>" (-> this scale x) (-> this scale y) (-> this scale z) (-> this scale w)) + this ) ;; definition for method 27 of type trsqv -(defmethod get-quaternion trsqv ((obj trsqv)) - (-> obj quat) +(defmethod get-quaternion trsqv ((this trsqv)) + (-> this quat) ) ;; definition for method 18 of type trsqv -(defmethod set-quaternion! trsqv ((obj trsqv) (arg0 quaternion)) - (quaternion-copy! (get-quaternion obj) arg0) +(defmethod set-quaternion! trsqv ((this trsqv) (arg0 quaternion)) + (quaternion-copy! (get-quaternion this) arg0) ) ;; definition for method 21 of type trsqv -(defmethod rot->dir-targ! trsqv ((obj trsqv)) - (quaternion-copy! (-> obj dir-targ) (get-quaternion obj)) +(defmethod rot->dir-targ! trsqv ((this trsqv)) + (quaternion-copy! (-> this dir-targ) (get-quaternion this)) ) ;; definition for method 22 of type trsqv -(defmethod y-angle trsqv ((obj trsqv)) - (quaternion-y-angle (get-quaternion obj)) +(defmethod y-angle trsqv ((this trsqv)) + (quaternion-y-angle (get-quaternion this)) ) ;; definition for method 9 of type trsqv -(defmethod seek-toward-heading-vec! trsqv ((obj trsqv) (dir vector) (vel float) (frame-count time-frame)) - (let* ((yaw-error (deg-diff (quaternion-y-angle (-> obj quat)) (vector-y-angle dir))) - (yaw-limit - (fmin (* vel (-> *display* seconds-per-frame)) (/ (* 5.0 (fabs yaw-error)) (the float frame-count))) - ) +(defmethod seek-toward-heading-vec! trsqv ((this trsqv) (dir vector) (vel float) (frame-count time-frame)) + (let* ((yaw-error (deg-diff (quaternion-y-angle (-> this quat)) (vector-y-angle dir))) + (yaw-limit (fmin (* vel (seconds-per-frame)) (/ (* 5.0 (fabs yaw-error)) (the float frame-count)))) (saturated-yaw (fmax (fmin yaw-error yaw-limit) (- yaw-limit))) ) - (let ((old-diff (-> obj old-y-angle-diff))) + (let ((old-diff (-> this old-y-angle-diff))) (set! saturated-yaw (cond ((or (= old-diff 0.0) (and (< 0.0 saturated-yaw) (< 0.0 old-diff)) - (or (and (< saturated-yaw 0.0) (< old-diff 0.0)) - (>= (- (-> *display* base-frame-counter) (-> obj angle-change-time)) (seconds 0.2)) - ) + (or (and (< saturated-yaw 0.0) (< old-diff 0.0)) (time-elapsed? (-> this angle-change-time) (seconds 0.2))) ) - (set! (-> obj angle-change-time) (-> *display* base-frame-counter)) + (set-time! (-> this angle-change-time)) saturated-yaw ) (else @@ -56,16 +52,16 @@ ) ) ) - (set! (-> obj old-y-angle-diff) saturated-yaw) - (let ((quat (get-quaternion obj))) + (set! (-> this old-y-angle-diff) saturated-yaw) + (let ((quat (get-quaternion this))) (quaternion-rotate-y! quat quat saturated-yaw) ) ) ) ;; definition for method 10 of type trsqv -(defmethod set-heading-vec! trsqv ((obj trsqv) (arg0 vector)) - (let ((s3-0 (get-quaternion obj))) +(defmethod set-heading-vec! trsqv ((this trsqv) (arg0 vector)) + (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) @@ -75,55 +71,55 @@ ) ;; definition for method 11 of type trsqv -(defmethod seek-to-point-toward-point! trsqv ((obj trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) - (seek-toward-heading-vec! obj (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) arg1 arg2) +(defmethod seek-to-point-toward-point! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) + (seek-toward-heading-vec! this (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) arg1 arg2) ) ;; definition for method 12 of type trsqv -(defmethod point-toward-point! trsqv ((obj trsqv) (arg0 vector)) - (let ((s3-0 (get-quaternion obj))) +(defmethod point-toward-point! trsqv ((this trsqv) (arg0 vector)) + (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0) ) ) ) ;; definition for method 13 of type trsqv -(defmethod seek-toward-yaw-angle! trsqv ((obj trsqv) (yaw float) (vel float) (frame-count time-frame)) - (let ((s3-0 (method-of-object obj seek-toward-heading-vec!)) +(defmethod seek-toward-yaw-angle! trsqv ((this trsqv) (yaw float) (vel float) (frame-count time-frame)) + (let ((s3-0 (method-of-object this seek-toward-heading-vec!)) (s2-0 (new 'stack-no-clear 'vector)) ) (set! (-> s2-0 x) (sin yaw)) (set! (-> s2-0 y) 0.0) (set! (-> s2-0 z) (cos yaw)) (set! (-> s2-0 w) 1.0) - (s3-0 obj s2-0 vel frame-count) + (s3-0 this s2-0 vel frame-count) ) ) ;; definition for method 14 of type trsqv -(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((obj trsqv) (arg0 float)) - (let ((s5-0 (method-of-object obj set-heading-vec-clear-roll-pitch!)) +(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((this trsqv) (arg0 float)) + (let ((s5-0 (method-of-object this set-heading-vec-clear-roll-pitch!)) (s4-0 (new 'stack-no-clear 'vector)) ) (set! (-> s4-0 x) (sin arg0)) (set! (-> s4-0 y) 0.0) (set! (-> s4-0 z) (cos arg0)) (set! (-> s4-0 w) 1.0) - (s5-0 obj s4-0) + (s5-0 this s4-0) ) ) ;; definition for method 15 of type trsqv -(defmethod set-roll-to-grav! trsqv ((obj trsqv) (arg0 float)) - (set-roll-to-grav-2! obj arg0) +(defmethod set-roll-to-grav! trsqv ((this trsqv) (arg0 float)) + (set-roll-to-grav-2! this arg0) ) ;; definition for method 16 of type trsqv -(defmethod set-roll-to-grav-2! trsqv ((obj trsqv) (arg0 float)) - (let* ((quat (get-quaternion obj)) +(defmethod set-roll-to-grav-2! trsqv ((this trsqv) (arg0 float)) + (let* ((quat (get-quaternion this)) (grav (-> *standard-dynamics* gravity-normal)) (rot-mat (quaternion->matrix (new 'stack-no-clear 'matrix) quat)) ) @@ -139,8 +135,8 @@ ) ;; definition for method 25 of type trsqv -(defmethod roll-relative-to-gravity trsqv ((obj trsqv)) - (let* ((quat (get-quaternion obj)) +(defmethod roll-relative-to-gravity trsqv ((this trsqv)) + (let* ((quat (get-quaternion this)) (dir-z (vector-z-quaternion! (new 'stack-no-clear 'vector) quat)) (dir-y (vector-y-quaternion! (new 'stack-no-clear 'vector) quat)) (dir-grav (-> *standard-dynamics* gravity-normal)) @@ -156,9 +152,9 @@ ;; definition for method 17 of type trsqv ;; INFO: Used lq/sq -(defmethod rotate-toward-orientation! trsqv ((obj trsqv) (target quaternion) (y-rate float) (z-rate float)) +(defmethod rotate-toward-orientation! trsqv ((this trsqv) (target quaternion) (y-rate float) (z-rate float)) (local-vars (sv-96 vector)) - (let ((quat (get-quaternion obj))) + (let ((quat (get-quaternion this))) (let ((temp-quat (new 'stack-no-clear 'quaternion))) (when (< 0.0 z-rate) (let ((s1-0 quaternion-from-two-vectors-max-angle!) @@ -166,7 +162,7 @@ ) (set! sv-96 (vector-y-quaternion! (new 'stack-no-clear 'vector) quat)) (let ((a2-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) target)) - (a3-1 (* z-rate (-> *display* seconds-per-frame))) + (a3-1 (* z-rate (seconds-per-frame))) ) (s1-0 s0-0 sv-96 a2-1 a3-1) ) @@ -178,7 +174,7 @@ temp-quat (vector-z-quaternion! (new 'stack-no-clear 'vector) quat) (vector-z-quaternion! (new 'stack-no-clear 'vector) target) - (* y-rate (-> *display* seconds-per-frame)) + (* y-rate (seconds-per-frame)) ) (quaternion-normalize! (quaternion*! quat temp-quat quat)) ) @@ -188,19 +184,19 @@ ) ;; definition for method 19 of type trsqv -(defmethod set-heading-vec-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector)) +(defmethod set-heading-vec-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) (forward-up->quaternion - (get-quaternion obj) + (get-quaternion this) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) (new 'static 'vector :y 1.0 :w 1.0) ) ) ;; definition for method 20 of type trsqv -(defmethod point-toward-point-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector)) +(defmethod point-toward-point-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) (forward-up->quaternion - (get-quaternion obj) - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0) + (get-quaternion this) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) (new 'static 'vector :y 1.0 :w 1.0) ) ) diff --git a/test/decompiler/reference/jak1/engine/math/vector-h_REF.gc b/test/decompiler/reference/jak1/engine/math/vector-h_REF.gc index 91f6a57f02..49b551f522 100644 --- a/test/decompiler/reference/jak1/engine/math/vector-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/vector-h_REF.gc @@ -21,60 +21,60 @@ ) ;; definition for method 3 of type bit-array -(defmethod inspect bit-array ((obj bit-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - obj +(defmethod inspect bit-array ((this bit-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + this ) ;; definition for method 0 of type bit-array (defmethod new bit-array ((allocation symbol) (type-to-make type) (length int)) - (let ((obj (object-new allocation type-to-make (+ (/ (logand -8 (+ length 7)) 8) -1 (-> type-to-make size))))) - (set! (-> obj length) length) - (set! (-> obj allocated-length) length) - obj + (let ((this (object-new allocation type-to-make (+ (/ (logand -8 (+ length 7)) 8) -1 (-> type-to-make size))))) + (set! (-> this length) length) + (set! (-> this allocated-length) length) + this ) ) ;; definition for method 4 of type bit-array -(defmethod length bit-array ((obj bit-array)) - (-> obj length) +(defmethod length bit-array ((this bit-array)) + (-> this length) ) ;; definition for method 5 of type bit-array ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of bit-array ((obj bit-array)) - (the-as int (+ (-> obj type size) (/ (logand -8 (+ (-> obj allocated-length) 7)) 8))) +(defmethod asize-of bit-array ((this bit-array)) + (the-as int (+ (-> this type size) (/ (logand -8 (+ (-> this allocated-length) 7)) 8))) ) ;; definition for method 9 of type bit-array -(defmethod get-bit bit-array ((obj bit-array) (arg0 int)) - (let ((v1-2 (-> obj bytes (/ arg0 8)))) +(defmethod get-bit bit-array ((this bit-array) (arg0 int)) + (let ((v1-2 (-> this bytes (/ arg0 8)))) (logtest? v1-2 (ash 1 (logand arg0 7))) ) ) ;; definition for method 10 of type bit-array -(defmethod clear-bit bit-array ((obj bit-array) (arg0 int)) - (logclear! (-> obj bytes (/ arg0 8)) (ash 1 (logand arg0 7))) +(defmethod clear-bit bit-array ((this bit-array) (arg0 int)) + (logclear! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) ;; definition for method 11 of type bit-array -(defmethod set-bit bit-array ((obj bit-array) (arg0 int)) - (logior! (-> obj bytes (/ arg0 8)) (ash 1 (logand arg0 7))) +(defmethod set-bit bit-array ((this bit-array) (arg0 int)) + (logior! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) ;; definition for method 12 of type bit-array -(defmethod clear-all! bit-array ((obj bit-array)) - (countdown (idx (/ (logand -8 (+ (-> obj allocated-length) 7)) 8)) +(defmethod clear-all! bit-array ((this bit-array)) + (countdown (idx (/ (logand -8 (+ (-> this allocated-length) 7)) 8)) (nop!) (nop!) - (set! (-> obj bytes idx) (the-as uint 0)) + (set! (-> this bytes idx) (the-as uint 0)) ) - obj + this ) ;; definition of type vector4ub @@ -93,15 +93,15 @@ ) ;; definition for method 3 of type vector4ub -(defmethod inspect vector4ub ((obj vector4ub)) - (format #t "[~8x] ~A~%" obj 'vector4ub) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - (format #t "~Tw: ~D~%" (-> obj w)) - (format #t "~Tclr: ~D~%" (-> obj clr)) - obj +(defmethod inspect vector4ub ((this vector4ub)) + (format #t "[~8x] ~A~%" this 'vector4ub) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + (format #t "~Tw: ~D~%" (-> this w)) + (format #t "~Tclr: ~D~%" (-> this clr)) + this ) ;; definition of type vector4b @@ -118,14 +118,14 @@ ) ;; definition for method 3 of type vector4b -(defmethod inspect vector4b ((obj vector4b)) - (format #t "[~8x] ~A~%" obj 'vector4b) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - (format #t "~Tw: ~D~%" (-> obj w)) - obj +(defmethod inspect vector4b ((this vector4b)) + (format #t "[~8x] ~A~%" this 'vector4b) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + (format #t "~Tw: ~D~%" (-> this w)) + this ) ;; definition of type vector2h @@ -141,12 +141,12 @@ ) ;; definition for method 3 of type vector2h -(defmethod inspect vector2h ((obj vector2h)) - (format #t "[~8x] ~A~%" obj 'vector2h) - (format #t "~Tdata[2] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - obj +(defmethod inspect vector2h ((this vector2h)) + (format #t "[~8x] ~A~%" this 'vector2h) + (format #t "~Tdata[2] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + this ) ;; definition of type vector2uh @@ -163,13 +163,13 @@ ) ;; definition for method 3 of type vector2uh -(defmethod inspect vector2uh ((obj vector2uh)) - (format #t "[~8x] ~A~%" obj 'vector2uh) - (format #t "~Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tval: ~D~%" (-> obj val)) - obj +(defmethod inspect vector2uh ((this vector2uh)) + (format #t "[~8x] ~A~%" this 'vector2uh) + (format #t "~Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tval: ~D~%" (-> this val)) + this ) ;; definition of type vector3h @@ -185,13 +185,13 @@ ) ;; definition for method 3 of type vector3h -(defmethod inspect vector3h ((obj vector3h)) - (format #t "[~8x] ~A~%" obj 'vector3h) - (format #t "~Tdata[2] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - obj +(defmethod inspect vector3h ((this vector3h)) + (format #t "[~8x] ~A~%" this 'vector3h) + (format #t "~Tdata[2] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + this ) ;; definition of type vector2w @@ -207,12 +207,12 @@ ) ;; definition for method 3 of type vector2w -(defmethod inspect vector2w ((obj vector2w)) - (format #t "[~8x] ~A~%" obj 'vector2w) - (format #t "~Tdata[2] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - obj +(defmethod inspect vector2w ((this vector2w)) + (format #t "[~8x] ~A~%" this 'vector2w) + (format #t "~Tdata[2] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + this ) ;; definition of type vector3w @@ -229,13 +229,13 @@ ) ;; definition for method 3 of type vector3w -(defmethod inspect vector3w ((obj vector3w)) - (format #t "[~8x] ~A~%" obj 'vector3w) - (format #t "~Tdata[3] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - obj +(defmethod inspect vector3w ((this vector3w)) + (format #t "[~8x] ~A~%" this 'vector3w) + (format #t "~Tdata[3] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + this ) ;; definition of type vector4w @@ -255,22 +255,22 @@ ;; definition for method 3 of type vector4w ;; INFO: Used lq/sq -(defmethod inspect vector4w ((obj vector4w)) - (format #t "[~8x] ~A~%" obj 'vector4w) - (format #t "~Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - (format #t "~Tw: ~D~%" (-> obj w)) - (format #t "~Tdword[2] @ #x~X~%" (&-> obj x)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect vector4w ((this vector4w)) + (format #t "[~8x] ~A~%" this 'vector4w) + (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + (format #t "~Tw: ~D~%" (-> this w)) + (format #t "~Tdword[2] @ #x~X~%" (&-> this x)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; definition for method 2 of type vector4w -(defmethod print vector4w ((obj vector4w)) - (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) - obj +(defmethod print vector4w ((this vector4w)) + (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) + this ) ;; definition of type vector4w-2 @@ -285,12 +285,12 @@ ) ;; definition for method 3 of type vector4w-2 -(defmethod inspect vector4w-2 ((obj vector4w-2)) - (format #t "[~8x] ~A~%" obj 'vector4w-2) - (format #t "~Tdata[8] @ #x~X~%" (-> obj quad)) - (format #t "~Tquad[2] @ #x~X~%" (-> obj quad)) - (format #t "~Tvector[2] @ #x~X~%" (-> obj quad)) - obj +(defmethod inspect vector4w-2 ((this vector4w-2)) + (format #t "[~8x] ~A~%" this 'vector4w-2) + (format #t "~Tdata[8] @ #x~X~%" (-> this quad)) + (format #t "~Tquad[2] @ #x~X~%" (-> this quad)) + (format #t "~Tvector[2] @ #x~X~%" (-> this quad)) + this ) ;; definition of type vector4w-3 @@ -305,12 +305,12 @@ ) ;; definition for method 3 of type vector4w-3 -(defmethod inspect vector4w-3 ((obj vector4w-3)) - (format #t "[~8x] ~A~%" obj 'vector4w-3) - (format #t "~Tdata[12] @ #x~X~%" (-> obj vector)) - (format #t "~Tquad[3] @ #x~X~%" (-> obj vector)) - (format #t "~Tvector[3] @ #x~X~%" (-> obj vector)) - obj +(defmethod inspect vector4w-3 ((this vector4w-3)) + (format #t "[~8x] ~A~%" this 'vector4w-3) + (format #t "~Tdata[12] @ #x~X~%" (-> this vector)) + (format #t "~Tquad[3] @ #x~X~%" (-> this vector)) + (format #t "~Tvector[3] @ #x~X~%" (-> this vector)) + this ) ;; definition of type vector4w-4 @@ -325,12 +325,12 @@ ) ;; definition for method 3 of type vector4w-4 -(defmethod inspect vector4w-4 ((obj vector4w-4)) - (format #t "[~8x] ~A~%" obj 'vector4w-4) - (format #t "~Tdata[16] @ #x~X~%" (-> obj quad)) - (format #t "~Tquad[4] @ #x~X~%" (-> obj quad)) - (format #t "~Tvector[4] @ #x~X~%" (-> obj quad)) - obj +(defmethod inspect vector4w-4 ((this vector4w-4)) + (format #t "[~8x] ~A~%" this 'vector4w-4) + (format #t "~Tdata[16] @ #x~X~%" (-> this quad)) + (format #t "~Tquad[4] @ #x~X~%" (-> this quad)) + (format #t "~Tvector[4] @ #x~X~%" (-> this quad)) + this ) ;; definition of type vector4h @@ -349,15 +349,15 @@ ) ;; definition for method 3 of type vector4h -(defmethod inspect vector4h ((obj vector4h)) - (format #t "[~8x] ~A~%" obj 'vector4h) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~Tx: ~D~%" (-> obj x)) - (format #t "~Ty: ~D~%" (-> obj y)) - (format #t "~Tz: ~D~%" (-> obj z)) - (format #t "~Tw: ~D~%" (-> obj w)) - (format #t "~Tlong: ~D~%" (-> obj long)) - obj +(defmethod inspect vector4h ((this vector4h)) + (format #t "[~8x] ~A~%" this 'vector4h) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~Tx: ~D~%" (-> this x)) + (format #t "~Ty: ~D~%" (-> this y)) + (format #t "~Tz: ~D~%" (-> this z)) + (format #t "~Tw: ~D~%" (-> this w)) + (format #t "~Tlong: ~D~%" (-> this long)) + this ) ;; definition of type vector8h @@ -372,11 +372,11 @@ ;; definition for method 3 of type vector8h ;; INFO: Used lq/sq -(defmethod inspect vector8h ((obj vector8h)) - (format #t "[~8x] ~A~%" obj 'vector8h) - (format #t "~Tdata[8] @ #x~X~%" (-> obj data)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect vector8h ((this vector8h)) + (format #t "[~8x] ~A~%" this 'vector8h) + (format #t "~Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; definition of type vector16b @@ -391,11 +391,11 @@ ;; definition for method 3 of type vector16b ;; INFO: Used lq/sq -(defmethod inspect vector16b ((obj vector16b)) - (format #t "[~8x] ~A~%" obj 'vector16b) - (format #t "~Tdata[8] @ #x~X~%" (-> obj data)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect vector16b ((this vector16b)) + (format #t "[~8x] ~A~%" this 'vector16b) + (format #t "~Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; definition of type vector @@ -415,29 +415,29 @@ ;; definition for method 3 of type vector ;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect vector ((obj vector)) - (format #t "[~8x] ~A~%" obj 'vector) - (format #t "~Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tw: ~f~%" (-> obj w)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect vector ((this vector)) + (format #t "[~8x] ~A~%" this 'vector) + (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tw: ~f~%" (-> this w)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; definition for method 3 of type vector ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect vector ((obj vector)) - (format #t "[~8x] vector~%" obj) - (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj x) (-> obj y) (-> obj z) (-> obj w)) - obj +(defmethod inspect vector ((this vector)) + (format #t "[~8x] vector~%" this) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) + this ) ;; definition for method 2 of type vector -(defmethod print vector ((obj vector)) - (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) - obj +(defmethod print vector ((this vector)) + (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) + this ) ;; definition for symbol *null-vector*, type vector @@ -470,12 +470,12 @@ ) ;; definition for method 3 of type vector4s-3 -(defmethod inspect vector4s-3 ((obj vector4s-3)) - (format #t "[~8x] ~A~%" obj 'vector4s-3) - (format #t "~Tdata[12] @ #x~X~%" (-> obj data)) - (format #t "~Tquad[3] @ #x~X~%" (-> obj data)) - (format #t "~Tvector[3] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect vector4s-3 ((this vector4s-3)) + (format #t "[~8x] ~A~%" this 'vector4s-3) + (format #t "~Tdata[12] @ #x~X~%" (-> this data)) + (format #t "~Tquad[3] @ #x~X~%" (-> this data)) + (format #t "~Tvector[3] @ #x~X~%" (-> this data)) + this ) ;; definition of type vector-array @@ -488,12 +488,12 @@ ) ;; definition for method 3 of type vector-array -(defmethod inspect vector-array ((obj vector-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect vector-array ((this vector-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -513,19 +513,19 @@ ;; definition for method 3 of type rgbaf ;; INFO: Used lq/sq -(defmethod inspect rgbaf ((obj rgbaf)) - (format #t "[~8x] ~A~%" obj 'rgbaf) - (format #t "~Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tw: ~f~%" (-> obj w)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - (format #t "~Tr: ~f~%" (-> obj x)) - (format #t "~Tg: ~f~%" (-> obj y)) - (format #t "~Tb: ~f~%" (-> obj z)) - (format #t "~Ta: ~f~%" (-> obj w)) - obj +(defmethod inspect rgbaf ((this rgbaf)) + (format #t "[~8x] ~A~%" this 'rgbaf) + (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tw: ~f~%" (-> this w)) + (format #t "~Tquad: ~D~%" (-> this quad)) + (format #t "~Tr: ~f~%" (-> this x)) + (format #t "~Tg: ~f~%" (-> this y)) + (format #t "~Tb: ~f~%" (-> this z)) + (format #t "~Ta: ~f~%" (-> this w)) + this ) ;; definition of type plane @@ -542,19 +542,19 @@ ;; definition for method 3 of type plane ;; INFO: Used lq/sq -(defmethod inspect plane ((obj plane)) - (format #t "[~8x] ~A~%" obj 'plane) - (format #t "~Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tw: ~f~%" (-> obj w)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - (format #t "~Ta: ~f~%" (-> obj x)) - (format #t "~Tb: ~f~%" (-> obj y)) - (format #t "~Tc: ~f~%" (-> obj z)) - (format #t "~Td: ~f~%" (-> obj w)) - obj +(defmethod inspect plane ((this plane)) + (format #t "[~8x] ~A~%" this 'plane) + (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tw: ~f~%" (-> this w)) + (format #t "~Tquad: ~D~%" (-> this quad)) + (format #t "~Ta: ~f~%" (-> this x)) + (format #t "~Tb: ~f~%" (-> this y)) + (format #t "~Tc: ~f~%" (-> this z)) + (format #t "~Td: ~f~%" (-> this w)) + this ) ;; definition of type sphere @@ -568,16 +568,16 @@ ;; definition for method 3 of type sphere ;; INFO: Used lq/sq -(defmethod inspect sphere ((obj sphere)) - (format #t "[~8x] ~A~%" obj 'sphere) - (format #t "~Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tw: ~f~%" (-> obj w)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - (format #t "~Tr: ~f~%" (-> obj w)) - obj +(defmethod inspect sphere ((this sphere)) + (format #t "[~8x] ~A~%" this 'sphere) + (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tw: ~f~%" (-> this w)) + (format #t "~Tquad: ~D~%" (-> this quad)) + (format #t "~Tr: ~f~%" (-> this w)) + this ) ;; definition of type isphere @@ -602,14 +602,14 @@ ) ;; definition for method 3 of type box8s -(defmethod inspect box8s ((obj box8s)) - (format #t "[~8x] ~A~%" obj 'box8s) - (format #t "~Tdata[8] @ #x~X~%" (-> obj data)) - (format #t "~Tquad[2] @ #x~X~%" (-> obj data)) - (format #t "~Tvector[2] @ #x~X~%" (-> obj data)) - (format #t "~Tmin: #~%" (-> obj data)) - (format #t "~Tmax: #~%" (-> obj max)) - obj +(defmethod inspect box8s ((this box8s)) + (format #t "[~8x] ~A~%" this 'box8s) + (format #t "~Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~Tquad[2] @ #x~X~%" (-> this data)) + (format #t "~Tvector[2] @ #x~X~%" (-> this data)) + (format #t "~Tmin: #~%" (-> this data)) + (format #t "~Tmax: #~%" (-> this max)) + this ) ;; definition of type box8s-array @@ -622,12 +622,12 @@ ) ;; definition for method 3 of type box8s-array -(defmethod inspect box8s-array ((obj box8s-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect box8s-array ((this box8s-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -650,13 +650,13 @@ ) ;; definition for method 3 of type cylinder -(defmethod inspect cylinder ((obj cylinder)) - (format #t "[~8x] ~A~%" obj 'cylinder) - (format #t "~Torigin: #~%" (-> obj origin)) - (format #t "~Taxis: #~%" (-> obj axis)) - (format #t "~Tradius: ~f~%" (-> obj radius)) - (format #t "~Tlength: ~f~%" (-> obj length)) - obj +(defmethod inspect cylinder ((this cylinder)) + (format #t "[~8x] ~A~%" this 'cylinder) + (format #t "~Torigin: #~%" (-> this origin)) + (format #t "~Taxis: #~%" (-> this axis)) + (format #t "~Tradius: ~f~%" (-> this radius)) + (format #t "~Tlength: ~f~%" (-> this length)) + this ) ;; definition of type cylinder-flat @@ -676,13 +676,13 @@ ) ;; definition for method 3 of type cylinder-flat -(defmethod inspect cylinder-flat ((obj cylinder-flat)) - (format #t "[~8x] ~A~%" obj 'cylinder-flat) - (format #t "~Torigin: #~%" (-> obj origin)) - (format #t "~Taxis: #~%" (-> obj axis)) - (format #t "~Tradius: ~f~%" (-> obj radius)) - (format #t "~Tlength: ~f~%" (-> obj length)) - obj +(defmethod inspect cylinder-flat ((this cylinder-flat)) + (format #t "[~8x] ~A~%" this 'cylinder-flat) + (format #t "~Torigin: #~%" (-> this origin)) + (format #t "~Taxis: #~%" (-> this axis)) + (format #t "~Tradius: ~f~%" (-> this radius)) + (format #t "~Tlength: ~f~%" (-> this length)) + this ) ;; definition of type vertical-planes @@ -695,10 +695,10 @@ ) ;; definition for method 3 of type vertical-planes -(defmethod inspect vertical-planes ((obj vertical-planes)) - (format #t "[~8x] ~A~%" obj 'vertical-planes) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect vertical-planes ((this vertical-planes)) + (format #t "[~8x] ~A~%" this 'vertical-planes) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + this ) ;; definition of type vertical-planes-array @@ -712,11 +712,11 @@ ) ;; definition for method 3 of type vertical-planes-array -(defmethod inspect vertical-planes-array ((obj vertical-planes-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect vertical-planes-array ((this vertical-planes-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; definition of type qword @@ -737,17 +737,17 @@ ;; definition for method 3 of type qword ;; INFO: Used lq/sq -(defmethod inspect qword ((obj qword)) - (format #t "[~8x] ~A~%" obj 'qword) - (format #t "~Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~Tbyte[16] @ #x~X~%" (-> obj data)) - (format #t "~Thword[8] @ #x~X~%" (-> obj data)) - (format #t "~Tword[4] @ #x~X~%" (-> obj data)) - (format #t "~Tdword[2] @ #x~X~%" (-> obj data)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - (format #t "~Tvector: #~%" (-> obj data)) - (format #t "~Tvector4w: #~%" (-> obj data)) - obj +(defmethod inspect qword ((this qword)) + (format #t "[~8x] ~A~%" this 'qword) + (format #t "~Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~Tbyte[16] @ #x~X~%" (-> this data)) + (format #t "~Thword[8] @ #x~X~%" (-> this data)) + (format #t "~Tword[4] @ #x~X~%" (-> this data)) + (format #t "~Tdword[2] @ #x~X~%" (-> this data)) + (format #t "~Tquad: ~D~%" (-> this quad)) + (format #t "~Tvector: #~%" (-> this data)) + (format #t "~Tvector4w: #~%" (-> this data)) + this ) ;; definition of type vector3s @@ -763,13 +763,13 @@ ) ;; definition for method 3 of type vector3s -(defmethod inspect vector3s ((obj vector3s)) - (format #t "[~8x] ~A~%" obj 'vector3s) - (format #t "~Tdata[3] @ #x~X~%" (-> obj data)) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - obj +(defmethod inspect vector3s ((this vector3s)) + (format #t "[~8x] ~A~%" this 'vector3s) + (format #t "~Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + this ) ;; definition for function vector-dot diff --git a/test/decompiler/reference/jak1/engine/math/vector_REF.gc b/test/decompiler/reference/jak1/engine/math/vector_REF.gc index 7ef66b5653..037bca7a87 100644 --- a/test/decompiler/reference/jak1/engine/math/vector_REF.gc +++ b/test/decompiler/reference/jak1/engine/math/vector_REF.gc @@ -436,36 +436,36 @@ ;; definition for function vector-v! (defun vector-v! ((arg0 vector)) - (vector-float*! arg0 arg0 (-> *display* seconds-per-frame)) + (vector-float*! arg0 arg0 (seconds-per-frame)) arg0 ) ;; definition for function vector-v+! (defun vector-v+! ((result vector) (position vector) (velocity vector)) - (vector+float*! result position velocity (-> *display* seconds-per-frame)) + (vector+float*! result position velocity (seconds-per-frame)) result ) ;; definition for function vector-v*float+! (defun vector-v*float+! ((result vector) (position vector) (velocity vector) (velocity-scale float)) - (vector+float*! result position velocity (* velocity-scale (-> *display* seconds-per-frame))) + (vector+float*! result position velocity (* velocity-scale (seconds-per-frame))) result ) ;; definition for function vector-v++! (defun vector-v++! ((position vector) (velocity vector)) - (vector+float*! position position velocity (-> *display* seconds-per-frame)) + (vector+float*! position position velocity (seconds-per-frame)) position ) ;; definition for function vector-v*float! (defun vector-v*float! ((delta-p vector) (velocity vector) (scale float)) - (vector-float*! delta-p velocity (* scale (-> *display* seconds-per-frame))) + (vector-float*! delta-p velocity (* scale (seconds-per-frame))) ) ;; definition for function vector-v*float++! (defun vector-v*float++! ((position vector) (velocity vector) (scale float)) - (vector+float*! position position velocity (* scale (-> *display* seconds-per-frame))) + (vector+float*! position position velocity (* scale (seconds-per-frame))) position ) @@ -498,7 +498,7 @@ ) (init-vf0-vector) (.lvf vf1 (&-> arg1 quad)) - (let ((f0-0 (-> *display* seconds-per-frame))) + (let ((f0-0 (seconds-per-frame))) (.mov at-0 f0-0) ) (.mov vf2 at-0) diff --git a/test/decompiler/reference/jak1/engine/nav/navigate-h_REF.gc b/test/decompiler/reference/jak1/engine/nav/navigate-h_REF.gc index 7eafb5e8e0..8a64551e48 100644 --- a/test/decompiler/reference/jak1/engine/nav/navigate-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/nav/navigate-h_REF.gc @@ -15,13 +15,13 @@ ) ;; definition for method 3 of type nav-poly -(defmethod inspect nav-poly ((obj nav-poly)) - (format #t "[~8x] ~A~%" obj 'nav-poly) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tvertex[3] @ #x~X~%" (-> obj vertex)) - (format #t "~Tadj-poly[3] @ #x~X~%" (-> obj adj-poly)) - (format #t "~Tpat: ~D~%" (-> obj pat)) - obj +(defmethod inspect nav-poly ((this nav-poly)) + (format #t "[~8x] ~A~%" this 'nav-poly) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tvertex[3] @ #x~X~%" (-> this vertex)) + (format #t "~Tadj-poly[3] @ #x~X~%" (-> this adj-poly)) + (format #t "~Tpat: ~D~%" (-> this pat)) + this ) ;; definition of type nav-vertex @@ -34,15 +34,15 @@ ;; definition for method 3 of type nav-vertex ;; INFO: Used lq/sq -(defmethod inspect nav-vertex ((obj nav-vertex)) - (format #t "[~8x] ~A~%" obj 'nav-vertex) - (format #t "~Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tw: ~f~%" (-> obj w)) - (format #t "~Tquad: ~D~%" (-> obj quad)) - obj +(defmethod inspect nav-vertex ((this nav-vertex)) + (format #t "[~8x] ~A~%" this 'nav-vertex) + (format #t "~Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tw: ~f~%" (-> this w)) + (format #t "~Tquad: ~D~%" (-> this quad)) + this ) ;; definition of type nav-sphere @@ -55,10 +55,10 @@ ) ;; definition for method 3 of type nav-sphere -(defmethod inspect nav-sphere ((obj nav-sphere)) - (format #t "[~8x] ~A~%" obj 'nav-sphere) - (format #t "~Ttrans: #~%" (-> obj trans)) - obj +(defmethod inspect nav-sphere ((this nav-sphere)) + (format #t "[~8x] ~A~%" this 'nav-sphere) + (format #t "~Ttrans: #~%" (-> this trans)) + this ) ;; definition of type nav-ray @@ -81,20 +81,20 @@ ) ;; definition for method 3 of type nav-ray -(defmethod inspect nav-ray ((obj nav-ray)) - (format #t "[~8x] ~A~%" obj 'nav-ray) - (format #t "~Tcurrent-pos: #~%" (-> obj current-pos)) - (format #t "~Tdir: #~%" (-> obj dir)) - (format #t "~Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~Tcurrent-poly: #~%" (-> obj current-poly)) - (format #t "~Tnext-poly: #~%" (-> obj next-poly)) - (format #t "~Tlen: (meters ~m)~%" (-> obj len)) - (format #t "~Tlast-edge: ~D~%" (-> obj last-edge)) - (format #t "~Tterminated: ~A~%" (-> obj terminated)) - (format #t "~Treached-dest: ~A~%" (-> obj reached-dest)) - (format #t "~Thit-boundary: ~A~%" (-> obj hit-boundary)) - (format #t "~Thit-gap: ~A~%" (-> obj hit-gap)) - obj +(defmethod inspect nav-ray ((this nav-ray)) + (format #t "[~8x] ~A~%" this 'nav-ray) + (format #t "~Tcurrent-pos: #~%" (-> this current-pos)) + (format #t "~Tdir: #~%" (-> this dir)) + (format #t "~Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~Tcurrent-poly: #~%" (-> this current-poly)) + (format #t "~Tnext-poly: #~%" (-> this next-poly)) + (format #t "~Tlen: (meters ~m)~%" (-> this len)) + (format #t "~Tlast-edge: ~D~%" (-> this last-edge)) + (format #t "~Tterminated: ~A~%" (-> this terminated)) + (format #t "~Treached-dest: ~A~%" (-> this reached-dest)) + (format #t "~Thit-boundary: ~A~%" (-> this hit-boundary)) + (format #t "~Thit-gap: ~A~%" (-> this hit-gap)) + this ) ;; definition of type nav-route-portal @@ -109,12 +109,12 @@ ) ;; definition for method 3 of type nav-route-portal -(defmethod inspect nav-route-portal ((obj nav-route-portal)) - (format #t "[~8x] ~A~%" obj 'nav-route-portal) - (format #t "~Tnext-poly: #~%" (-> obj next-poly)) - (format #t "~Tvertex[2] @ #x~X~%" (-> obj vertex)) - (format #t "~Tedge-index: ~D~%" (-> obj edge-index)) - obj +(defmethod inspect nav-route-portal ((this nav-route-portal)) + (format #t "[~8x] ~A~%" this 'nav-route-portal) + (format #t "~Tnext-poly: #~%" (-> this next-poly)) + (format #t "~Tvertex[2] @ #x~X~%" (-> this vertex)) + (format #t "~Tedge-index: ~D~%" (-> this edge-index)) + this ) ;; definition of type clip-travel-vector-to-mesh-return-info @@ -138,21 +138,21 @@ ) ;; definition for method 3 of type clip-travel-vector-to-mesh-return-info -(defmethod inspect clip-travel-vector-to-mesh-return-info ((obj clip-travel-vector-to-mesh-return-info)) - (format #t "[~8x] ~A~%" obj 'clip-travel-vector-to-mesh-return-info) - (format #t "~Tfound-boundary: ~A~%" (-> obj found-boundary)) - (format #t "~Tintersection: #~%" (-> obj intersection)) - (format #t "~Tboundary-normal: #~%" (-> obj boundary-normal)) - (format #t "~Tprev-normal: #~%" (-> obj prev-normal)) - (format #t "~Tnext-normal: #~%" (-> obj next-normal)) - (format #t "~Tpoly: #~%" (-> obj poly)) - (format #t "~Tgap-poly: #~%" (-> obj gap-poly)) - (format #t "~Tedge: ~D~%" (-> obj edge)) - (format #t "~Tvert-prev: #~%" (-> obj vert-prev)) - (format #t "~Tvert-0: #~%" (-> obj vert-0)) - (format #t "~Tvert-1: #~%" (-> obj vert-1)) - (format #t "~Tvert-next: #~%" (-> obj vert-next)) - obj +(defmethod inspect clip-travel-vector-to-mesh-return-info ((this clip-travel-vector-to-mesh-return-info)) + (format #t "[~8x] ~A~%" this 'clip-travel-vector-to-mesh-return-info) + (format #t "~Tfound-boundary: ~A~%" (-> this found-boundary)) + (format #t "~Tintersection: #~%" (-> this intersection)) + (format #t "~Tboundary-normal: #~%" (-> this boundary-normal)) + (format #t "~Tprev-normal: #~%" (-> this prev-normal)) + (format #t "~Tnext-normal: #~%" (-> this next-normal)) + (format #t "~Tpoly: #~%" (-> this poly)) + (format #t "~Tgap-poly: #~%" (-> this gap-poly)) + (format #t "~Tedge: ~D~%" (-> this edge)) + (format #t "~Tvert-prev: #~%" (-> this vert-prev)) + (format #t "~Tvert-0: #~%" (-> this vert-0)) + (format #t "~Tvert-1: #~%" (-> this vert-1)) + (format #t "~Tvert-next: #~%" (-> this vert-next)) + this ) ;; definition of type nav-node @@ -182,27 +182,27 @@ ) ;; definition for method 3 of type nav-node -(defmethod inspect nav-node ((obj nav-node)) - (format #t "[~8x] ~A~%" obj 'nav-node) - (format #t "~Tcenter-x: ~f~%" (-> obj center-x)) - (format #t "~Tcenter-y: ~f~%" (-> obj center-y)) - (format #t "~Tcenter-z: ~f~%" (-> obj center-z)) - (format #t "~Ttype: ~D~%" (-> obj type)) - (format #t "~Tparent-offset: ~D~%" (-> obj parent-offset)) - (format #t "~Tcenter: #~%" (&-> obj center-x)) - (format #t "~Tradius-x: ~f~%" (-> obj radius-x)) - (format #t "~Tradius-y: ~f~%" (-> obj radius-y)) - (format #t "~Tradius-z: ~f~%" (-> obj radius-z)) - (format #t "~Tleft-offset: ~D~%" (-> obj left-offset)) - (format #t "~Tright-offset: ~D~%" (-> obj right-offset)) - (format #t "~Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~Tradius: #~%" (&-> obj radius-x)) - (format #t "~Tscale-x: ~f~%" (-> obj scale-x)) - (format #t "~Tfirst-tris[4] @ #x~X~%" (-> obj first-tris)) - (format #t "~Tscale-z: ~f~%" (-> obj scale-z)) - (format #t "~Tlast-tris[4] @ #x~X~%" (-> obj last-tris)) - (format #t "~Tscale: #~%" (&-> obj scale-x)) - obj +(defmethod inspect nav-node ((this nav-node)) + (format #t "[~8x] ~A~%" this 'nav-node) + (format #t "~Tcenter-x: ~f~%" (-> this center-x)) + (format #t "~Tcenter-y: ~f~%" (-> this center-y)) + (format #t "~Tcenter-z: ~f~%" (-> this center-z)) + (format #t "~Ttype: ~D~%" (-> this type)) + (format #t "~Tparent-offset: ~D~%" (-> this parent-offset)) + (format #t "~Tcenter: #~%" (&-> this center-x)) + (format #t "~Tradius-x: ~f~%" (-> this radius-x)) + (format #t "~Tradius-y: ~f~%" (-> this radius-y)) + (format #t "~Tradius-z: ~f~%" (-> this radius-z)) + (format #t "~Tleft-offset: ~D~%" (-> this left-offset)) + (format #t "~Tright-offset: ~D~%" (-> this right-offset)) + (format #t "~Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~Tradius: #~%" (&-> this radius-x)) + (format #t "~Tscale-x: ~f~%" (-> this scale-x)) + (format #t "~Tfirst-tris[4] @ #x~X~%" (-> this first-tris)) + (format #t "~Tscale-z: ~f~%" (-> this scale-z)) + (format #t "~Tlast-tris[4] @ #x~X~%" (-> this last-tris)) + (format #t "~Tscale: #~%" (&-> this scale-x)) + this ) ;; definition of type nav-lookup-elem @@ -222,17 +222,17 @@ ) ;; definition for method 3 of type nav-lookup-elem -(defmethod inspect nav-lookup-elem ((obj nav-lookup-elem)) - (format #t "[~8x] ~A~%" obj 'nav-lookup-elem) - (format #t "~Tvec: #~%" (-> obj vec)) - (format #t "~Ty-thresh: ~f~%" (-> obj vec w)) - (format #t "~Ttime: ~D~%" (-> obj time)) - (format #t "~Tnode-offset: ~D~%" (-> obj node-offset)) - (format #t "~Tlookup-type: ~D~%" (-> obj lookup-type)) - (format #t "~Tpoly-ind: ~D~%" (-> obj poly-ind)) - (format #t "~Tdummy0: ~D~%" (-> obj dummy0)) - (format #t "~Tdummy: ~D~%" (-> obj dummy)) - obj +(defmethod inspect nav-lookup-elem ((this nav-lookup-elem)) + (format #t "[~8x] ~A~%" this 'nav-lookup-elem) + (format #t "~Tvec: #~%" (-> this vec)) + (format #t "~Ty-thresh: ~f~%" (-> this vec w)) + (format #t "~Ttime: ~D~%" (-> this time)) + (format #t "~Tnode-offset: ~D~%" (-> this node-offset)) + (format #t "~Tlookup-type: ~D~%" (-> this lookup-type)) + (format #t "~Tpoly-ind: ~D~%" (-> this poly-ind)) + (format #t "~Tdummy0: ~D~%" (-> this dummy0)) + (format #t "~Tdummy: ~D~%" (-> this dummy)) + this ) ;; definition of type nav-mesh @@ -282,24 +282,24 @@ ) ;; definition for method 3 of type nav-mesh -(defmethod inspect nav-mesh ((obj nav-mesh)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tuser-list: ~A~%" (-> obj user-list)) - (format #t "~Tpoly-lookup-history[2] @ #x~X~%" (-> obj poly-lookup-history)) - (format #t "~Tdebug-time: ~D~%" (-> obj debug-time)) - (format #t "~Tstatic-sphere-count: ~D~%" (-> obj static-sphere-count)) - (format #t "~Tstatic-sphere: #x~X~%" (-> obj static-sphere)) - (format #t "~Tbounds: ~`sphere`P~%" (-> obj bounds)) - (format #t "~Torigin: ~`vector`P~%" (-> obj origin)) - (format #t "~Tcache[4] @ #x~X~%" (-> obj cache)) - (format #t "~Tnode-count: ~D~%" (-> obj node-count)) - (format #t "~Tnodes: #x~X~%" (-> obj nodes)) - (format #t "~Tvertex-count: ~D~%" (-> obj vertex-count)) - (format #t "~Tvertex: #x~X~%" (-> obj vertex)) - (format #t "~Tpoly-count: ~D~%" (-> obj poly-count)) - (format #t "~Tpoly: #x~X~%" (-> obj poly)) - (format #t "~Troute: #x~X~%" (-> obj route)) - obj +(defmethod inspect nav-mesh ((this nav-mesh)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tuser-list: ~A~%" (-> this user-list)) + (format #t "~Tpoly-lookup-history[2] @ #x~X~%" (-> this poly-lookup-history)) + (format #t "~Tdebug-time: ~D~%" (-> this debug-time)) + (format #t "~Tstatic-sphere-count: ~D~%" (-> this static-sphere-count)) + (format #t "~Tstatic-sphere: #x~X~%" (-> this static-sphere)) + (format #t "~Tbounds: ~`sphere`P~%" (-> this bounds)) + (format #t "~Torigin: ~`vector`P~%" (-> this origin)) + (format #t "~Tcache[4] @ #x~X~%" (-> this cache)) + (format #t "~Tnode-count: ~D~%" (-> this node-count)) + (format #t "~Tnodes: #x~X~%" (-> this nodes)) + (format #t "~Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~Tvertex: #x~X~%" (-> this vertex)) + (format #t "~Tpoly-count: ~D~%" (-> this poly-count)) + (format #t "~Tpoly: #x~X~%" (-> this poly)) + (format #t "~Troute: #x~X~%" (-> this route)) + this ) ;; definition of type check-vector-collision-with-nav-spheres-info @@ -314,12 +314,12 @@ ) ;; definition for method 3 of type check-vector-collision-with-nav-spheres-info -(defmethod inspect check-vector-collision-with-nav-spheres-info ((obj check-vector-collision-with-nav-spheres-info)) - (format #t "[~8x] ~A~%" obj 'check-vector-collision-with-nav-spheres-info) - (format #t "~Tu: ~f~%" (-> obj u)) - (format #t "~Tintersect: #~%" (-> obj intersect)) - (format #t "~Tnormal: #~%" (-> obj normal)) - obj +(defmethod inspect check-vector-collision-with-nav-spheres-info ((this check-vector-collision-with-nav-spheres-info)) + (format #t "[~8x] ~A~%" this 'check-vector-collision-with-nav-spheres-info) + (format #t "~Tu: ~f~%" (-> this u)) + (format #t "~Tintersect: #~%" (-> this intersect)) + (format #t "~Tnormal: #~%" (-> this normal)) + this ) ;; definition of type nav-gap-info @@ -333,11 +333,11 @@ ) ;; definition for method 3 of type nav-gap-info -(defmethod inspect nav-gap-info ((obj nav-gap-info)) - (format #t "[~8x] ~A~%" obj 'nav-gap-info) - (format #t "~Tdest: #~%" (-> obj dest)) - (format #t "~Tpoly: #~%" (-> obj poly)) - obj +(defmethod inspect nav-gap-info ((this nav-gap-info)) + (format #t "[~8x] ~A~%" this 'nav-gap-info) + (format #t "~Tdest: #~%" (-> this dest)) + (format #t "~Tpoly: #~%" (-> this poly)) + this ) ;; definition of type nav-control @@ -405,35 +405,35 @@ ) ;; definition for method 3 of type nav-control -(defmethod inspect nav-control ((obj nav-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tflags: #x~X~%" (-> obj flags)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tshape: ~A~%" (-> obj shape)) - (format #t "~Tmesh: ~A~%" (-> obj mesh)) - (format #t "~Tgap-event: ~A~%" (-> obj gap-event)) - (format #t "~Tblock-event: ~A~%" (-> obj block-event)) - (format #t "~Tcurrent-poly: #~%" (-> obj current-poly)) - (format #t "~Tnext-poly: #~%" (-> obj next-poly)) - (format #t "~Ttarget-poly: #~%" (-> obj target-poly)) - (format #t "~Tportal[2] @ #x~X~%" (-> obj portal)) - (format #t "~Tnearest-y-threshold: (meters ~m)~%" (-> obj nearest-y-threshold)) - (format #t "~Tevent-temp: ~`vector`P~%" (-> obj event-temp)) - (format #t "~Told-travel: ~`vector`P~%" (-> obj old-travel)) - (format #t "~Tblocked-travel: ~`vector`P~%" (-> obj blocked-travel)) - (format #t "~Tprev-pos: ~`vector`P~%" (-> obj prev-pos)) - (format #t "~Textra-nav-sphere: ~`vector`P~%" (-> obj extra-nav-sphere)) - (format #t "~Ttravel: ~`vector`P~%" (-> obj travel)) - (format #t "~Ttarget-pos: ~`vector`P~%" (-> obj target-pos)) - (format #t "~Tdestination-pos: ~`vector`P~%" (-> obj destination-pos)) - (format #t "~Tblock-time: ~D~%" (-> obj block-time)) - (format #t "~Tblock-count: ~f~%" (-> obj block-count)) - (format #t "~Tuser-poly: #~%" (-> obj user-poly)) - (format #t "~Tnav-cull-radius: ~f~%" (-> obj nav-cull-radius)) - (format #t "~Tnum-spheres: ~D~%" (-> obj num-spheres)) - (format #t "~Tmax-spheres: ~D~%" (-> obj max-spheres)) - (format #t "~Tsphere[0] @ #x~X~%" (-> obj sphere)) - obj +(defmethod inspect nav-control ((this nav-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tflags: #x~X~%" (-> this flags)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tshape: ~A~%" (-> this shape)) + (format #t "~Tmesh: ~A~%" (-> this mesh)) + (format #t "~Tgap-event: ~A~%" (-> this gap-event)) + (format #t "~Tblock-event: ~A~%" (-> this block-event)) + (format #t "~Tcurrent-poly: #~%" (-> this current-poly)) + (format #t "~Tnext-poly: #~%" (-> this next-poly)) + (format #t "~Ttarget-poly: #~%" (-> this target-poly)) + (format #t "~Tportal[2] @ #x~X~%" (-> this portal)) + (format #t "~Tnearest-y-threshold: (meters ~m)~%" (-> this nearest-y-threshold)) + (format #t "~Tevent-temp: ~`vector`P~%" (-> this event-temp)) + (format #t "~Told-travel: ~`vector`P~%" (-> this old-travel)) + (format #t "~Tblocked-travel: ~`vector`P~%" (-> this blocked-travel)) + (format #t "~Tprev-pos: ~`vector`P~%" (-> this prev-pos)) + (format #t "~Textra-nav-sphere: ~`vector`P~%" (-> this extra-nav-sphere)) + (format #t "~Ttravel: ~`vector`P~%" (-> this travel)) + (format #t "~Ttarget-pos: ~`vector`P~%" (-> this target-pos)) + (format #t "~Tdestination-pos: ~`vector`P~%" (-> this destination-pos)) + (format #t "~Tblock-time: ~D~%" (-> this block-time)) + (format #t "~Tblock-count: ~f~%" (-> this block-count)) + (format #t "~Tuser-poly: #~%" (-> this user-poly)) + (format #t "~Tnav-cull-radius: ~f~%" (-> this nav-cull-radius)) + (format #t "~Tnum-spheres: ~D~%" (-> this num-spheres)) + (format #t "~Tmax-spheres: ~D~%" (-> this max-spheres)) + (format #t "~Tsphere[0] @ #x~X~%" (-> this sphere)) + this ) ;; definition for function nav-mesh-connect @@ -487,43 +487,43 @@ (sphere-count int) (nearest-y-threshold-default float) ) - (let ((obj (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* sphere-count 16)))))) - (when (zero? obj) + (let ((this (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* sphere-count 16)))))) + (when (zero? this) (go process-drawable-art-error "memory") - (set! obj (the-as nav-control 0)) + (set! this (the-as nav-control 0)) (goto cfg-4) ) - (set! (-> obj max-spheres) sphere-count) - (set! (-> obj flags) (nav-control-flags navcf8 navcf13)) - (set! (-> obj mesh) (nav-mesh-connect (-> shape process) shape obj)) + (set! (-> this max-spheres) sphere-count) + (set! (-> this flags) (nav-control-flags navcf8 navcf13)) + (set! (-> this mesh) (nav-mesh-connect (-> shape process) shape this)) (let ((ent (-> shape process entity))) - (set! (-> obj nearest-y-threshold) + (set! (-> this nearest-y-threshold) (res-lump-float ent 'nearest-y-threshold :default nearest-y-threshold-default) ) ) - (set! (-> obj shape) shape) - (set! (-> obj process) (-> shape process)) - (set! (-> obj gap-event) #f) - (set! (-> obj current-poly) #f) - (set! (-> obj next-poly) #f) - (set! (-> obj target-poly) #f) - (set! (-> obj user-poly) #f) - (set! (-> obj portal 0) #f) - (set! (-> obj portal 1) #f) - (set! (-> obj nav-cull-radius) 40960.0) + (set! (-> this shape) shape) + (set! (-> this process) (-> shape process)) + (set! (-> this gap-event) #f) + (set! (-> this current-poly) #f) + (set! (-> this next-poly) #f) + (set! (-> this target-poly) #f) + (set! (-> this user-poly) #f) + (set! (-> this portal 0) #f) + (set! (-> this portal 1) #f) + (set! (-> this nav-cull-radius) 40960.0) (label cfg-4) - (the-as nav-control obj) + (the-as nav-control this) ) ) ;; definition for method 29 of type nav-control -(defmethod should-display? nav-control ((obj nav-control)) - (and *display-nav-marks* (logtest? (-> obj flags) (nav-control-flags display-marks))) +(defmethod should-display? nav-control ((this nav-control)) + (and *display-nav-marks* (logtest? (-> this flags) (nav-control-flags display-marks))) ) ;; definition for method 10 of type nav-control -(defmethod point-in-bounds? nav-control ((obj nav-control) (arg0 vector)) - (let ((v1-1 (-> obj mesh bounds))) +(defmethod point-in-bounds? nav-control ((this nav-control) (arg0 vector)) + (let ((v1-1 (-> this mesh bounds))) (>= (-> v1-1 w) (vector-vector-distance arg0 v1-1)) ) ) @@ -531,8 +531,8 @@ ;; definition for method 15 of type nav-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs none. -(defmethod set-target-pos! nav-control ((obj nav-control) (arg0 vector)) - (set! (-> obj target-pos quad) (-> arg0 quad)) +(defmethod set-target-pos! nav-control ((this nav-control) (arg0 vector)) + (set! (-> this target-pos quad) (-> arg0 quad)) (none) ) diff --git a/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc b/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc index f2a6092a28..1c6f7158a1 100644 --- a/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc +++ b/test/decompiler/reference/jak1/engine/nav/navigate_REF.gc @@ -163,14 +163,14 @@ ) ;; definition for method 4 of type nav-control -(defmethod length nav-control ((obj nav-control)) - (-> obj num-spheres) +(defmethod length nav-control ((this nav-control)) + (-> this num-spheres) ) ;; definition for method 5 of type nav-control ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of nav-control ((obj nav-control)) - (the-as int (+ (-> nav-control size) (* (-> obj max-spheres) 16))) +(defmethod asize-of nav-control ((this nav-control)) + (the-as int (+ (-> nav-control size) (* (-> this max-spheres) 16))) ) ;; definition for symbol *default-nav-mesh*, type nav-mesh @@ -213,15 +213,15 @@ ) ;; definition for method 4 of type nav-mesh -(defmethod length nav-mesh ((obj nav-mesh)) - (-> obj poly-count) +(defmethod length nav-mesh ((this nav-mesh)) + (-> this poly-count) ) ;; definition for method 20 of type nav-mesh ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw-poly nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 rgba)) - (let ((s5-0 (-> obj origin)) - (s2-0 (-> obj vertex)) +(defmethod debug-draw-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) + (let ((s5-0 (-> this origin)) + (s2-0 (-> this vertex)) (gp-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) @@ -265,17 +265,17 @@ ;; definition for method 10 of type nav-mesh ;; INFO: Used lq/sq -(defmethod tri-centroid-local nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) - (set! (-> arg1 quad) (-> obj vertex (-> arg0 vertex 0) quad)) - (vector+! arg1 arg1 (the-as vector (-> obj vertex (-> arg0 vertex 1)))) - (vector+! arg1 arg1 (the-as vector (-> obj vertex (-> arg0 vertex 2)))) +(defmethod tri-centroid-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (set! (-> arg1 quad) (-> this vertex (-> arg0 vertex 0) quad)) + (vector+! arg1 arg1 (the-as vector (-> this vertex (-> arg0 vertex 1)))) + (vector+! arg1 arg1 (the-as vector (-> this vertex (-> arg0 vertex 2)))) (vector-float*! arg1 arg1 0.333333) ) ;; definition for method 9 of type nav-mesh -(defmethod tri-centroid-world nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) - (tri-centroid-local obj arg0 arg1) - (vector+! arg1 arg1 (-> obj origin)) +(defmethod tri-centroid-world nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (tri-centroid-local this arg0 arg1) + (vector+! arg1 arg1 (-> this origin)) ) ;; definition for symbol *edge-vert0-table*, type (array int8) @@ -365,19 +365,19 @@ ) ;; definition for method 21 of type nav-mesh -(defmethod point-in-poly? nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod point-in-poly? nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (vu-point-triangle-intersection? arg1 - (-> obj vertex (-> arg0 vertex 0)) - (-> obj vertex (-> arg0 vertex 1)) - (-> obj vertex (-> arg0 vertex 2)) + (-> this vertex (-> arg0 vertex 0)) + (-> this vertex (-> arg0 vertex 1)) + (-> this vertex (-> arg0 vertex 2)) ) ) ;; definition for method 24 of type nav-mesh ;; INFO: Used lq/sq -(defmethod closest-point-on-boundary nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) - (let ((s2-0 (-> obj vertex)) +(defmethod closest-point-on-boundary nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) + (let ((s2-0 (-> this vertex)) (s1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -400,10 +400,10 @@ ;; definition for method 26 of type nav-mesh ;; INFO: Used lq/sq -(defmethod project-point-into-tri-2d nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) - (if (point-in-poly? obj arg0 arg2) +(defmethod project-point-into-tri-2d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) + (if (point-in-poly? this arg0 arg2) (set! (-> arg1 quad) (-> arg2 quad)) - (closest-point-on-boundary obj arg0 arg1 arg2) + (closest-point-on-boundary this arg0 arg1 arg2) ) arg1 ) @@ -544,19 +544,19 @@ ;; definition for method 27 of type nav-mesh ;; INFO: Used lq/sq -(defmethod find-poly-fast nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 meters)) +(defmethod find-poly-fast nav-mesh ((this nav-mesh) (arg0 vector) (arg1 meters)) (local-vars (a0-6 symbol) (a2-3 uint128) (a2-4 uint128)) -1 (let ((s2-0 -1) - (s3-0 (-> *display* base-frame-counter)) - (f0-0 (-> obj bounds w)) + (s3-0 (current-time)) + (f0-0 (-> this bounds w)) ) (when (>= (* f0-0 f0-0) (vector-length-squared arg0)) (dotimes (v1-3 4) - (set! a0-6 (and (= (-> obj cache v1-3 time) s3-0) - (= (-> obj cache v1-3 vec w) arg1) + (set! a0-6 (and (= (-> this cache v1-3 time) s3-0) + (= (-> this cache v1-3 vec w) arg1) (begin - (let ((a3-0 (-> obj cache v1-3)) + (let ((a3-0 (-> this cache v1-3)) (a2-1 arg0) ) (set! a0-6 #t) @@ -577,16 +577,16 @@ ) (label cfg-10) (if a0-6 - (return (-> obj poly (-> obj cache v1-3 poly-ind))) + (return (-> this poly (-> this cache v1-3 poly-ind))) ) - (if (and (< s2-0 0) (!= (-> obj cache v1-3 time) s3-0)) + (if (and (< s2-0 0) (!= (-> this cache v1-3 time) s3-0)) (set! s2-0 v1-3) ) ) - (let ((v1-12 (recursive-inside-poly obj (-> obj nodes 0) arg0 arg1))) + (let ((v1-12 (recursive-inside-poly this (-> this nodes 0) arg0 arg1))) (when (>= v1-12 0) (when (>= s2-0 0) - (let ((a0-24 (-> obj cache s2-0))) + (let ((a0-24 (-> this cache s2-0))) (set! (-> a0-24 vec x) (-> arg0 x)) (set! (-> a0-24 vec y) (-> arg0 y)) (set! (-> a0-24 vec z) (-> arg0 z)) @@ -595,7 +595,7 @@ (set! (-> a0-24 poly-ind) (the-as uint v1-12)) ) ) - (return (-> obj poly v1-12)) + (return (-> this poly v1-12)) ) ) ) @@ -804,7 +804,7 @@ ;; definition for method 29 of type nav-mesh ;; ERROR: Failed load: (set! vf3 (l.vf a0-4)) at op 42 -(defmethod is-in-mesh? nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 float) (arg2 meters)) +(defmethod is-in-mesh? nav-mesh ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 meters)) (local-vars (v1-10 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -814,17 +814,17 @@ (vf6 :class vf) (vf7 :class vf) ) - (let ((f0-1 (+ arg1 (-> obj bounds w)))) + (let ((f0-1 (+ arg1 (-> this bounds w)))) (when (>= (* f0-1 f0-1) (vector-length-squared arg0)) (let ((s2-0 (new 'stack-no-clear 'inline-array 'nav-vertex 6)) (f30-1 0.33333334) ) - (countdown (s1-0 (-> obj poly-count)) + (countdown (s1-0 (-> this poly-count)) (set! *debug-traverse* (+ *debug-traverse* 1)) - (let ((a0-3 (-> obj poly s1-0))) + (let ((a0-3 (-> this poly s1-0))) (when (not (logtest? (-> a0-3 pat) 1)) (nop!) - (let ((v1-8 (the-as object (-> obj vertex)))) + (let ((v1-8 (the-as object (-> this vertex)))) (nop!) (let ((a2-1 (-> a0-3 vertex 0))) (nop!) @@ -886,15 +886,15 @@ ;; definition for method 14 of type nav-mesh ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod move-along-nav-ray! nav-mesh ((obj nav-mesh) (arg0 nav-ray)) +(defmethod move-along-nav-ray! nav-mesh ((this nav-mesh) (arg0 nav-ray)) (local-vars (a2-7 int) (a3-3 int)) (let ((v1-0 -1) (f0-1 (- (-> arg0 dest-pos x) (-> arg0 current-pos x))) (f1-2 (- (-> arg0 dest-pos z) (-> arg0 current-pos z))) ) (dotimes (a2-0 3) - (let* ((a3-1 (-> obj vertex (-> arg0 current-poly vertex (-> *edge-vert0-table* a2-0)))) - (t0-7 (-> obj vertex (-> arg0 current-poly vertex (-> *edge-vert1-table* a2-0)))) + (let* ((a3-1 (-> this vertex (-> arg0 current-poly vertex (-> *edge-vert0-table* a2-0)))) + (t0-7 (-> this vertex (-> arg0 current-poly vertex (-> *edge-vert1-table* a2-0)))) (f4-0 (- (-> a3-1 z) (-> t0-7 z))) (f3-2 (- (-> t0-7 x) (-> a3-1 x))) (f2-4 (+ (* f0-1 f4-0) (* f1-2 f3-2))) @@ -934,7 +934,7 @@ ) (let ((a2-9 (-> arg0 current-poly adj-poly a2-7))) (if (!= a2-9 255) - (set! (-> arg0 next-poly) (-> obj poly a2-9)) + (set! (-> arg0 next-poly) (-> this poly a2-9)) ) ) (cond @@ -991,14 +991,14 @@ ) ;; definition for method 15 of type nav-mesh -(defmethod try-move-along-ray nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod try-move-along-ray nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (v1-2 symbol)) (let ((gp-0 (new 'stack-no-clear 'nav-ray))) (let ((s4-0 0)) (init-ray-dir-local gp-0 arg0 arg1 arg2 arg3) (until v1-2 (+! s4-0 1) - (move-along-nav-ray! obj gp-0) + (move-along-nav-ray! this gp-0) (set! v1-2 (or (>= s4-0 15) (-> gp-0 terminated))) ) ) @@ -1066,14 +1066,14 @@ ;; definition for method 18 of type nav-mesh ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-mesh-method-18 nav-mesh ((obj nav-mesh) (arg0 int) (arg1 vector) (arg2 int) (arg3 (pointer int8)) (arg4 int)) +(defmethod nav-mesh-method-18 nav-mesh ((this nav-mesh) (arg0 int) (arg1 vector) (arg2 int) (arg3 (pointer int8)) (arg4 int)) (local-vars (sv-32 int) (sv-48 uint)) (set! (-> arg3 arg2) 1) - (nav-mesh-update-route-table obj arg0 arg2 (the-as uint 3)) - (nav-mesh-update-route-table obj arg2 arg0 (the-as uint 3)) + (nav-mesh-update-route-table this arg0 arg2 (the-as uint 3)) + (nav-mesh-update-route-table this arg2 arg0 (the-as uint 3)) (set! *nav-update-route-table-route-count* (+ *nav-update-route-table-route-count* 1)) (when (> arg4 0) - (let ((s1-1 (-> obj poly arg2)) + (let ((s1-1 (-> this poly arg2)) (s0-0 (new 'stack-no-clear 'vector)) ) (set! sv-32 0) @@ -1081,15 +1081,15 @@ (set! sv-48 (-> (the-as nav-poly (+ sv-32 (the-as int s1-1))) adj-poly 0)) (when (and (!= sv-48 255) (!= 1 (-> (the-as (pointer uint8) (&+ arg3 sv-48))))) (set! (-> arg3 sv-48) 1) - (when (not (logtest? (-> obj poly sv-48 pat) 1)) - (let ((v0-3 (= (nav-mesh-lookup-route obj arg0 (the-as int sv-48)) 3))) + (when (not (logtest? (-> this poly sv-48 pat) 1)) + (let ((v0-3 (= (nav-mesh-lookup-route this arg0 (the-as int sv-48)) 3))) (when (not v0-3) - (tri-centroid-local obj s1-1 s0-0) + (tri-centroid-local this s1-1 s0-0) (set! *nav-update-route-table-ray-count* (+ *nav-update-route-table-ray-count* 1)) - (set! v0-3 (nav-ray-test-local? obj (-> obj poly arg0) arg1 s0-0)) + (set! v0-3 (nav-ray-test-local? this (-> this poly arg0) arg1 s0-0)) ) (when v0-3 - (let* ((a0-16 obj) + (let* ((a0-16 this) (t9-5 (method-of-object a0-16 nav-mesh-method-18)) (a1-7 arg0) (a2-6 arg1) @@ -1112,7 +1112,7 @@ ;; definition for method 17 of type nav-mesh ;; INFO: Return type mismatch int vs none. -(defmethod update-route-table nav-mesh ((obj nav-mesh)) +(defmethod update-route-table nav-mesh ((this nav-mesh)) (when *nav-patch-route-table* (stopwatch-init *nav-timer*) (stopwatch-begin *nav-timer*) @@ -1121,17 +1121,17 @@ (let ((s4-0 (new 'stack-no-clear 'array 'int8 256))) (set! *nav-update-route-table-ray-count* 0) (set! *nav-update-route-table-route-count* 0) - (countdown (s3-0 (-> obj poly-count)) - (let ((s2-0 (-> obj poly s3-0))) + (countdown (s3-0 (-> this poly-count)) + (let ((s2-0 (-> this poly s3-0))) (when (not (logtest? (-> s2-0 pat) 1)) - (tri-centroid-local obj s2-0 s5-0) + (tri-centroid-local this s2-0 s5-0) (mem-set32! s4-0 64 0) (set! (-> s4-0 s3-0) 1) (dotimes (s1-0 3) (let ((a3-0 (-> s2-0 adj-poly s1-0))) (when (!= a3-0 255) - (if (not (logtest? (-> obj poly a3-0 pat) 1)) - (nav-mesh-method-18 obj s3-0 s5-0 (the-as int a3-0) s4-0 0) + (if (not (logtest? (-> this poly a3-0 pat) 1)) + (nav-mesh-method-18 this s3-0 s5-0 (the-as int a3-0) s4-0 0) ) ) ) @@ -1249,9 +1249,9 @@ ;; definition for method 28 of type nav-mesh ;; INFO: Used lq/sq -(defmethod find-poly nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 meters) (arg2 (pointer nav-control-flags))) +(defmethod find-poly nav-mesh ((this nav-mesh) (arg0 vector) (arg1 meters) (arg2 (pointer nav-control-flags))) (local-vars (s3-1 nav-poly)) - (let ((v1-1 (find-poly-fast obj arg0 arg1))) + (let ((v1-1 (find-poly-fast this arg0 arg1))) (when v1-1 (if arg2 (logior! (-> arg2 0) (nav-control-flags navcf20)) @@ -1266,12 +1266,12 @@ (let ((s2-0 (new 'stack-no-clear 'inline-array 'nav-vertex 3))) (set! s3-1 (the-as nav-poly #f)) (let ((f30-0 10000000000000000000000000000000000000.0)) - (countdown (s1-0 (-> obj poly-count)) - (let ((s0-0 (-> obj poly s1-0))) + (countdown (s1-0 (-> this poly-count)) + (let ((s0-0 (-> this poly s1-0))) (when (not (logtest? (-> s0-0 pat) 1)) - (set! (-> s2-0 0 quad) (-> obj vertex (-> s0-0 vertex 0) quad)) - (set! (-> s2-0 1 quad) (-> obj vertex (-> s0-0 vertex 1) quad)) - (set! (-> s2-0 2 quad) (-> obj vertex (-> s0-0 vertex 2) quad)) + (set! (-> s2-0 0 quad) (-> this vertex (-> s0-0 vertex 0) quad)) + (set! (-> s2-0 1 quad) (-> this vertex (-> s0-0 vertex 1) quad)) + (set! (-> s2-0 2 quad) (-> this vertex (-> s0-0 vertex 2) quad)) (let ((f1-2 (- (-> arg0 y) (* 0.333333 (+ (-> s2-0 0 y) (-> s2-0 1 y) (-> s2-0 2 y)))))) (when (>= arg1 (fabs f1-2)) (let ((f0-2 (point-triangle-distance-min arg0 f30-0 s2-0))) @@ -1292,14 +1292,14 @@ ) ;; definition for method 12 of type nav-mesh -(defmethod setup-portal nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) +(defmethod setup-portal nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) (local-vars (t0-6 int) (t1-1 int)) (set! (-> arg2 next-poly) #f) (cond ((and arg0 arg1) - (let* ((v1-3 (* (+ (-> arg1 id) (* (the-as int (-> arg0 id)) (-> obj poly-count))) 2)) + (let* ((v1-3 (* (+ (-> arg1 id) (* (the-as int (-> arg0 id)) (-> this poly-count))) 2)) (v1-8 - (logand (ash (-> (the-as (pointer uint8) (-> obj route)) (/ (the-as int v1-3) 8)) (- (the-as int (logand v1-3 7)))) + (logand (ash (-> (the-as (pointer uint8) (-> this route)) (/ (the-as int v1-3) 8)) (- (the-as int (logand v1-3 7)))) 3 ) ) @@ -1309,8 +1309,8 @@ (let ((a2-9 (-> arg0 adj-poly v1-8))) (when (!= a2-9 255) (set! (-> arg2 edge-index) (the-as int v1-8)) - (set! (-> arg2 next-poly) (-> obj poly a2-9)) - (let ((a2-12 (-> obj vertex))) + (set! (-> arg2 next-poly) (-> this poly a2-9)) + (let ((a2-12 (-> this vertex))) (let ((t0-5 (+ v1-8 1))) (let ((t1-0 2)) (set-on-less-than t1-1 t1-0 t0-5) @@ -1319,7 +1319,7 @@ ) (set! (-> arg2 vertex 0) (-> a2-12 (-> arg0 vertex t0-6))) ) - (set! (-> arg2 vertex 1) (-> obj vertex (-> arg0 vertex v1-8))) + (set! (-> arg2 vertex 1) (-> this vertex (-> arg0 vertex v1-8))) #t ) ) @@ -1333,13 +1333,13 @@ ) ;; definition for method 11 of type nav-mesh -(defmethod get-adj-poly nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 symbol)) +(defmethod get-adj-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 symbol)) (local-vars (v1-12 uint) (t0-6 int) (t1-1 int)) (cond ((and arg0 arg1) - (let* ((v1-3 (* (+ (-> arg1 id) (* (the-as int (-> arg0 id)) (-> obj poly-count))) 2)) + (let* ((v1-3 (* (+ (-> arg1 id) (* (the-as int (-> arg0 id)) (-> this poly-count))) 2)) (a2-6 - (logand (ash (-> (the-as (pointer uint8) (-> obj route)) (/ (the-as int v1-3) 8)) (- (the-as int (logand v1-3 7)))) + (logand (ash (-> (the-as (pointer uint8) (-> this route)) (/ (the-as int v1-3) 8)) (- (the-as int (logand v1-3 7)))) 3 ) ) @@ -1364,7 +1364,7 @@ ) (set! (-> arg2 value) (logior (-> arg0 vertex t0-6) (shl (-> arg0 vertex a2-6) 16))) ) - (-> obj poly v1-12) + (-> this poly v1-12) ) ) ) @@ -1377,7 +1377,7 @@ ;; definition for method 19 of type nav-mesh ;; INFO: Return type mismatch int vs none. -(defmethod compute-bounding-box nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector)) +(defmethod compute-bounding-box nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector)) (let ((f0-0 10000000000000000000000000000000000000.0) (f1-0 -10000000000000000000000000000000000000.0) ) @@ -1388,8 +1388,8 @@ (set! (-> arg1 y) f1-0) (set! (-> arg1 z) f1-0) ) - (dotimes (v1-1 (-> obj vertex-count)) - (let ((a3-1 (-> obj vertex v1-1))) + (dotimes (v1-1 (-> this vertex-count)) + (let ((a3-1 (-> this vertex v1-1))) (set! (-> arg0 x) (fmin (-> arg0 x) (-> a3-1 x))) (set! (-> arg0 y) (fmin (-> arg0 y) (-> a3-1 y))) (set! (-> arg0 z) (fmin (-> arg0 z) (-> a3-1 z))) @@ -1398,8 +1398,8 @@ (set! (-> arg1 z) (fmax (-> arg1 z) (-> a3-1 z))) ) ) - (vector+! arg0 arg0 (-> obj origin)) - (vector+! arg1 arg1 (-> obj origin)) + (vector+! arg0 arg0 (-> this origin)) + (vector+! arg1 arg1 (-> this origin)) 0 (none) ) @@ -1407,12 +1407,12 @@ ;; definition for method 13 of type nav-mesh ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod initialize-mesh! nav-mesh ((obj nav-mesh)) +(defmethod initialize-mesh! nav-mesh ((this nav-mesh)) (local-vars (sv-32 vector) (sv-48 int)) (with-pp (set! sv-32 (new 'stack-no-clear 'vector)) - (let ((s5-0 (-> obj poly-count)) - (s3-0 (-> obj vertex-count)) + (let ((s5-0 (-> this poly-count)) + (s3-0 (-> this vertex-count)) (s1-0 0) (s2-0 0) (s4-0 0) @@ -1421,13 +1421,13 @@ (set! sv-48 s5-0) (while (nonzero? sv-48) (set! sv-48 (+ sv-48 -1)) - (let ((v1-4 (-> obj poly sv-48))) + (let ((v1-4 (-> this poly sv-48))) (if (logtest? (-> v1-4 pat) 1) (+! s4-0 1) ) - (let ((a1-2 (-> obj vertex (-> v1-4 vertex 0))) - (a2-2 (-> obj vertex (-> v1-4 vertex 1))) - (a3-0 (-> obj vertex (-> v1-4 vertex 2))) + (let ((a1-2 (-> this vertex (-> v1-4 vertex 0))) + (a2-2 (-> this vertex (-> v1-4 vertex 1))) + (a3-0 (-> this vertex (-> v1-4 vertex 2))) ) (vector-3pt-cross! sv-32 a1-2 a2-2 a3-0) ) @@ -1481,7 +1481,7 @@ ) ;; definition for method 22 of type nav-mesh -(defmethod find-opposite-vertices nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) +(defmethod find-opposite-vertices nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) (when (!= arg0 arg1) (dotimes (v1-1 3) (dotimes (a0-1 3) @@ -1564,9 +1564,9 @@ ;; definition for method 23 of type nav-mesh ;; INFO: Used lq/sq -(defmethod nav-mesh-method-23 nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 nav-route-portal)) +(defmethod nav-mesh-method-23 nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 nav-route-portal)) (local-vars (v1-32 int) (a0-14 int) (a0-17 int) (a1-10 int) (sv-16 nav-vertex)) - (let ((s1-0 (-> obj vertex)) + (let ((s1-0 (-> this vertex)) (s0-0 -1) ) (set! (-> arg2 quad) (-> arg3 quad)) @@ -1597,7 +1597,7 @@ (let ((v1-11 (-> arg0 adj-poly (-> *edge-vert0-table* s0-0)))) (cond ((!= v1-11 255) - (set! (-> arg4 next-poly) (-> obj poly v1-11)) + (set! (-> arg4 next-poly) (-> this poly v1-11)) (set! s0-0 -1) ) ((let ((a1-8 (-> s1-0 (-> arg0 vertex (-> *edge-vert0-table* s0-0))))) @@ -1638,16 +1638,16 @@ ;; definition for method 25 of type nav-mesh ;; INFO: Used lq/sq -(defmethod project-point-into-tri-3d nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-tri-3d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'matrix)) ) (dotimes (v1-0 3) (set! (-> s4-0 vector v1-0 quad) (the-as uint128 0)) ) - (set! (-> s4-0 vector 0 quad) (-> obj vertex (-> arg0 vertex 0) quad)) - (set! (-> s4-0 vector 1 quad) (-> obj vertex (-> arg0 vertex 1) quad)) - (set! (-> s4-0 vector 2 quad) (-> obj vertex (-> arg0 vertex 2) quad)) + (set! (-> s4-0 vector 0 quad) (-> this vertex (-> arg0 vertex 0) quad)) + (set! (-> s4-0 vector 1 quad) (-> this vertex (-> arg0 vertex 1) quad)) + (set! (-> s4-0 vector 2 quad) (-> this vertex (-> arg0 vertex 2) quad)) (normal-of-plane s3-0 (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) (-> s4-0 vector 2)) (closest-pt-in-triangle arg1 arg2 s4-0 s3-0) ) @@ -1656,13 +1656,13 @@ ;; definition for method 17 of type nav-control ;; INFO: Used lq/sq -(defmethod project-onto-nav-mesh nav-control ((obj nav-control) (arg0 vector) (arg1 vector)) +(defmethod project-onto-nav-mesh nav-control ((this nav-control) (arg0 vector) (arg1 vector)) (local-vars (sv-32 int)) - (let ((s5-0 (-> obj mesh)) - (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 (-> obj mesh origin))) + (let ((s5-0 (-> this mesh)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 (-> this mesh origin))) ) (set! sv-32 0) - (let ((a1-5 (find-poly s5-0 s3-1 (-> obj nearest-y-threshold) (the-as (pointer nav-control-flags) (& sv-32))))) + (let ((a1-5 (find-poly s5-0 s3-1 (-> this nearest-y-threshold) (the-as (pointer nav-control-flags) (& sv-32))))) (cond ((logtest? #x100000 sv-32) (set! (-> arg0 quad) (-> arg1 quad)) @@ -1678,40 +1678,40 @@ ) ;; definition for method 18 of type nav-control -(defmethod find-poly nav-control ((obj nav-control) (arg0 vector)) +(defmethod find-poly nav-control ((this nav-control) (arg0 vector)) (find-poly - (-> obj mesh) - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj mesh origin)) - (-> obj nearest-y-threshold) + (-> this mesh) + (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) + (-> this nearest-y-threshold) (the-as (pointer nav-control-flags) #f) ) ) ;; definition for method 20 of type nav-control -(defmethod project-point-into-tri-3d nav-control ((obj nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-tri-3d nav-control ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (project-point-into-tri-3d - (-> obj mesh) + (-> this mesh) arg0 arg1 - (vector-! (new 'stack-no-clear 'vector) arg2 (-> obj mesh origin)) + (vector-! (new 'stack-no-clear 'vector) arg2 (-> this mesh origin)) ) - (vector+! arg1 arg1 (-> obj mesh origin)) + (vector+! arg1 arg1 (-> this mesh origin)) arg1 ) ;; definition for method 25 of type nav-control -(defmethod is-in-mesh? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) - (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj mesh origin))) - (a1-1 (-> obj mesh)) +(defmethod is-in-mesh? nav-control ((this nav-control) (arg0 vector) (arg1 float)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin))) + (a1-1 (-> this mesh)) ) - (is-in-mesh? a1-1 v1-1 arg1 (-> obj nearest-y-threshold)) + (is-in-mesh? a1-1 v1-1 arg1 (-> this nearest-y-threshold)) ) ) ;; definition for method 9 of type nav-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw nav-control ((obj nav-control)) +(defmethod debug-draw nav-control ((this nav-control)) (local-vars (sv-192 vector) (sv-208 uint) @@ -1721,16 +1721,16 @@ (sv-272 int) (sv-288 (function _varargs_ object)) ) - (let ((a0-1 obj)) + (let ((a0-1 this)) (when (and *display-nav-marks* (logtest? (-> a0-1 flags) (nav-control-flags display-marks))) - (let ((s5-0 (-> obj mesh)) + (let ((s5-0 (-> this mesh)) (s4-0 (new 'stack-no-clear 'vector)) ) - (= (-> obj mesh debug-time) (logand (-> *display* actual-frame-counter) 255)) + (= (-> this mesh debug-time) (logand (-> *display* actual-frame-counter) 255)) (when #t (set! (-> s5-0 debug-time) (the-as uint (-> *display* actual-frame-counter))) (add-debug-sphere - (logtest? (-> obj flags) (nav-control-flags navcf1)) + (logtest? (-> this flags) (nav-control-flags navcf1)) (bucket-id debug) (-> s5-0 bounds) (-> s5-0 bounds w) @@ -1738,7 +1738,7 @@ ) (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *x-vector* (meters 1) *color-red*) (add-debug-vector #t (bucket-id debug-no-zbuf) (-> s5-0 origin) *z-vector* (meters 1) *color-blue*) - (when (logtest? (-> obj flags) (nav-control-flags navcf2)) + (when (logtest? (-> this flags) (nav-control-flags navcf2)) (dotimes (s3-0 (-> s5-0 vertex-count)) (add-debug-x #t @@ -1793,7 +1793,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf3)) + (when (logtest? (-> this flags) (nav-control-flags navcf3)) (dotimes (s3-2 (-> s5-0 poly-count)) (let ((s2-1 (-> s5-0 poly s3-2))) (debug-draw-poly s5-0 s2-1 (cond @@ -1817,7 +1817,7 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf4)) + (when (logtest? (-> this flags) (nav-control-flags navcf4)) (let ((s1-1 add-debug-text-3d) (s0-1 #t) ) @@ -1841,18 +1841,18 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf5)) - (if (-> obj next-poly) - (debug-draw-poly s5-0 (-> obj next-poly) *color-cyan*) + (when (logtest? (-> this flags) (nav-control-flags navcf5)) + (if (-> this next-poly) + (debug-draw-poly s5-0 (-> this next-poly) *color-cyan*) ) - (if (-> obj target-poly) - (debug-draw-poly s5-0 (-> obj target-poly) *color-yellow*) + (if (-> this target-poly) + (debug-draw-poly s5-0 (-> this target-poly) *color-yellow*) ) - (if (-> obj current-poly) - (debug-draw-poly s5-0 (-> obj current-poly) *color-red*) + (if (-> this current-poly) + (debug-draw-poly s5-0 (-> this current-poly) *color-red*) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf7)) + (when (logtest? (-> this flags) (nav-control-flags navcf7)) (dotimes (s3-3 (the-as int (-> s5-0 static-sphere-count))) (let ((s2-2 (-> s5-0 static-sphere s3-3))) (add-debug-sphere #t (bucket-id debug) (the-as vector s2-2) (-> s2-2 trans w) *color-blue*) @@ -1885,8 +1885,8 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf6)) - (when (and (-> obj portal 0) (-> obj portal 1)) + (when (logtest? (-> this flags) (nav-control-flags navcf6)) + (when (and (-> this portal 0) (-> this portal 1)) (let ((v1-80 (-> s5-0 origin)) (a2-22 (new 'stack-no-clear 'vector)) (a3-13 (new 'stack-no-clear 'vector)) @@ -1894,8 +1894,8 @@ (add-debug-line #t (bucket-id debug-no-zbuf) - (vector+! a2-22 v1-80 (the-as vector (-> obj portal 0))) - (vector+! a3-13 v1-80 (the-as vector (-> obj portal 1))) + (vector+! a2-22 v1-80 (the-as vector (-> this portal 0))) + (vector+! a3-13 v1-80 (the-as vector (-> this portal 1))) (new 'static 'rgba :r #xff :g #x80 :b #x40 :a #x80) #f (the-as rgba -1) @@ -1905,42 +1905,42 @@ (add-debug-vector #t (bucket-id debug-no-zbuf) - (-> obj shape trans) - (-> obj travel) + (-> this shape trans) + (-> this travel) (meters 0.00024414062) *color-white* ) (add-debug-vector #t (bucket-id debug-no-zbuf) - (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (new 'static 'vector :y 4096.0 :w 1.0)) - (-> obj old-travel) + (vector+! (new 'stack-no-clear 'vector) (-> this shape trans) (new 'static 'vector :y 4096.0 :w 1.0)) + (-> this old-travel) (meters 0.00024414062) *color-yellow* ) (add-debug-x #t (bucket-id debug-no-zbuf) - (vector+! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj travel)) + (vector+! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this travel)) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf7)) + (when (logtest? (-> this flags) (nav-control-flags navcf7)) (add-debug-sphere #t (bucket-id debug-no-zbuf) - (the-as vector (-> obj shape root-prim prim-core)) - (-> obj shape nav-radius) + (the-as vector (-> this shape root-prim prim-core)) + (-> this shape nav-radius) (new 'static 'rgba :g #xff :b #xff :a #x20) ) - (dotimes (s3-4 (-> obj num-spheres)) - (let ((v1-95 (-> obj sphere s3-4))) + (dotimes (s3-4 (-> this num-spheres)) + (let ((v1-95 (-> this sphere s3-4))) (vector+! s4-0 (-> s5-0 origin) (the-as vector (&-> v1-95 x))) (add-debug-sphere #t (bucket-id debug-no-zbuf) s4-0 - (- (-> v1-95 w) (-> obj shape nav-radius)) + (- (-> v1-95 w) (-> this shape nav-radius)) (new 'static 'rgba :g #xff :b #xff :a #x20) ) ) @@ -1955,32 +1955,32 @@ ;; definition for method 8 of type nav-mesh ;; INFO: Return type mismatch int vs nav-mesh. -(defmethod mem-usage nav-mesh ((obj nav-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage nav-mesh ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 45 used) v1-6) (+! (-> arg0 data 45 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-16 (* (-> obj vertex-count) 16))) + (let ((v1-16 (* (-> this vertex-count) 16))) (+! (-> arg0 data 45 used) v1-16) (+! (-> arg0 data 45 total) (logand -16 (+ v1-16 15))) ) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-26 (* (-> obj poly-count) 8))) + (let ((v1-26 (* (-> this poly-count) 8))) (+! (-> arg0 data 45 used) v1-26) (+! (-> arg0 data 45 total) (logand -16 (+ v1-26 15))) ) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-38 (/ (* (* (-> obj poly-count) (-> obj poly-count)) 2) 8))) + (let ((v1-38 (/ (* (* (-> this poly-count) (-> this poly-count)) 2) 8))) (+! (-> arg0 data 45 used) v1-38) (+! (-> arg0 data 45 total) (logand -16 (+ v1-38 15))) ) @@ -1989,19 +1989,19 @@ ;; definition for method 14 of type nav-control ;; INFO: Return type mismatch int vs none. -(defmethod set-current-poly! nav-control ((obj nav-control) (arg0 nav-poly)) - (set! (-> obj current-poly) arg0) - (logior! (-> obj flags) (nav-control-flags navcf9)) +(defmethod set-current-poly! nav-control ((this nav-control) (arg0 nav-poly)) + (set! (-> this current-poly) arg0) + (logior! (-> this flags) (nav-control-flags navcf9)) 0 (none) ) ;; definition for method 30 of type nav-control -(defmethod nav-control-method-30 nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod nav-control-method-30 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (the-as sphere #f))) (let ((f30-0 -0.000001)) - (countdown (s1-0 (-> obj num-spheres)) - (let* ((s0-0 (-> obj sphere s1-0)) + (countdown (s1-0 (-> this num-spheres)) + (let* ((s0-0 (-> this sphere s1-0)) (f0-1 (ray-circle-intersect arg0 arg1 (the-as vector (&-> s0-0 x)) (-> s0-0 w))) ) (when (< f30-0 f0-1) @@ -2017,7 +2017,7 @@ ) ;; definition for method 31 of type nav-control -(defmethod intersect-ray-line-segment? nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod intersect-ray-line-segment? nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (ray-line-segment-intersection? arg0 arg1 arg2 arg3) ) @@ -2091,7 +2091,7 @@ ;; definition for method 28 of type nav-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-control-method-28 nav-control ((obj nav-control) (arg0 collide-kind)) +(defmethod nav-control-method-28 nav-control ((this nav-control) (arg0 collide-kind)) (local-vars (sv-32 nav-control) (sv-48 sphere) @@ -2101,18 +2101,18 @@ (sv-112 vector) (sv-128 sphere) ) - (set! (-> obj num-spheres) 0) - (let ((s4-0 (-> obj mesh user-list)) + (set! (-> this num-spheres) 0) + (let ((s4-0 (-> this mesh user-list)) (s3-0 (new 'stack-no-clear 'vector)) ) (when (and *target* - (or (logtest? (-> obj flags) (nav-control-flags navcf11)) + (or (logtest? (-> this flags) (nav-control-flags navcf11)) (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) ) - (let ((s2-0 obj) + (let ((s2-0 this) (s1-0 (-> *target* control)) ) (let ((s0-0 s3-0)) @@ -2156,10 +2156,10 @@ ) ) ) - (when (logtest? (-> obj flags) (nav-control-flags navcf13)) - (countdown (s2-1 (-> obj mesh static-sphere-count)) - (let ((s1-2 obj) - (s0-2 (-> obj mesh static-sphere s2-1)) + (when (logtest? (-> this flags) (nav-control-flags navcf13)) + (countdown (s2-1 (-> this mesh static-sphere-count)) + (let ((s1-2 this) + (s0-2 (-> this mesh static-sphere s2-1)) ) (when (< (-> s1-2 num-spheres) (-> s1-2 max-spheres)) (set! sv-64 (-> s1-2 sphere (-> s1-2 num-spheres))) @@ -2183,8 +2183,8 @@ ) (while (!= v1-71 (-> s4-0 alive-list-end)) (let ((s0-3 (the-as collide-shape (-> (the-as connection v1-71) param3)))) - (when (not (or (= s0-3 (-> obj shape)) (not (logtest? arg0 (-> s0-3 root-prim prim-core collide-as))))) - (let ((s1-3 obj)) + (when (not (or (= s0-3 (-> this shape)) (not (logtest? arg0 (-> s0-3 root-prim prim-core collide-as))))) + (let ((s1-3 this)) (set! sv-112 s3-0) (when (logtest? (-> s0-3 nav-flags) (nav-flags navf0)) (set! (-> sv-112 quad) (-> s0-3 root-prim prim-core world-sphere quad)) @@ -2241,10 +2241,10 @@ ;; definition for method 35 of type nav-control ;; INFO: Return type mismatch symbol vs none. -(defmethod nav-control-method-35 nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-control-method-35 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg1 (-> obj mesh origin)) - (nav-control-method-32 obj arg0 v1-0 arg2 arg3 arg4) + (vector-! v1-0 arg1 (-> this mesh origin)) + (nav-control-method-32 this arg0 v1-0 arg2 arg3 arg4) ) (none) ) @@ -2260,11 +2260,11 @@ ) ;; definition for method 3 of type cfs-travel-vec -(defmethod inspect cfs-travel-vec ((obj cfs-travel-vec)) - (format #t "[~8x] ~A~%" obj 'cfs-travel-vec) - (format #t "~Tdir: #~%" (-> obj dir)) - (format #t "~Tdelta-angle: ~f~%" (-> obj delta-angle)) - obj +(defmethod inspect cfs-travel-vec ((this cfs-travel-vec)) + (format #t "[~8x] ~A~%" this 'cfs-travel-vec) + (format #t "~Tdir: #~%" (-> this dir)) + (format #t "~Tdelta-angle: ~f~%" (-> this delta-angle)) + this ) ;; definition of type cfs-work @@ -2289,22 +2289,22 @@ ) ;; definition for method 3 of type cfs-work -(defmethod inspect cfs-work ((obj cfs-work)) - (format #t "[~8x] ~A~%" obj 'cfs-work) - (format #t "~Tdesired-travel-dist: ~f~%" (-> obj desired-travel-dist)) - (format #t "~Tdesired-angle: ~f~%" (-> obj desired-angle)) - (format #t "~Tmax-dist: ~f~%" (-> obj max-dist)) - (format #t "~Told-angle: ~f~%" (-> obj old-angle)) - (format #t "~Tmodified: ~D~%" (-> obj modified)) - (format #t "~Tblocked-mask: ~D~%" (-> obj blocked-mask)) - (format #t "~Ttravel: #~%" (-> obj travel)) - (format #t "~Tcurrent: #~%" (-> obj current)) - (format #t "~Tnew-travel[2] @ #x~X~%" (-> obj new-travel)) - (format #t "~Ttemp-travel[2] @ #x~X~%" (-> obj temp-travel)) - (format #t "~Tprev-dir: #~%" (-> obj prev-dir)) - (format #t "~Tattempt-dir: #~%" (-> obj attempt-dir)) - (format #t "~Ttangent[2] @ #x~X~%" (-> obj tangent)) - obj +(defmethod inspect cfs-work ((this cfs-work)) + (format #t "[~8x] ~A~%" this 'cfs-work) + (format #t "~Tdesired-travel-dist: ~f~%" (-> this desired-travel-dist)) + (format #t "~Tdesired-angle: ~f~%" (-> this desired-angle)) + (format #t "~Tmax-dist: ~f~%" (-> this max-dist)) + (format #t "~Told-angle: ~f~%" (-> this old-angle)) + (format #t "~Tmodified: ~D~%" (-> this modified)) + (format #t "~Tblocked-mask: ~D~%" (-> this blocked-mask)) + (format #t "~Ttravel: #~%" (-> this travel)) + (format #t "~Tcurrent: #~%" (-> this current)) + (format #t "~Tnew-travel[2] @ #x~X~%" (-> this new-travel)) + (format #t "~Ttemp-travel[2] @ #x~X~%" (-> this temp-travel)) + (format #t "~Tprev-dir: #~%" (-> this prev-dir)) + (format #t "~Tattempt-dir: #~%" (-> this attempt-dir)) + (format #t "~Ttangent[2] @ #x~X~%" (-> this tangent)) + this ) ;; definition of type nav-control-cfs-work @@ -2335,28 +2335,28 @@ ) ;; definition for method 3 of type nav-control-cfs-work -(defmethod inspect nav-control-cfs-work ((obj nav-control-cfs-work)) - (format #t "[~8x] ~A~%" obj 'nav-control-cfs-work) - (format #t "~Tin-dir: #~%" (-> obj in-dir)) - (format #t "~Tright-dir: #~%" (-> obj right-dir)) - (format #t "~Tbest-dir[2] @ #x~X~%" (-> obj best-dir)) - (format #t "~Ttemp-dir[2] @ #x~X~%" (-> obj temp-dir)) - (format #t "~Taway-dir: #~%" (-> obj away-dir)) - (format #t "~Tbest-dir-angle[2] @ #x~X~%" (-> obj best-dir-angle)) - (format #t "~Tignore-mask: ~D~%" (-> obj ignore-mask)) - (format #t "~Tinitial-ignore-mask: ~D~%" (-> obj initial-ignore-mask)) - (format #t "~Ti-sphere: ~D~%" (-> obj i-sphere)) - (format #t "~Ti-first-sphere: ~D~%" (-> obj i-first-sphere)) - (format #t "~Ti-inside-sphere: ~D~%" (-> obj i-inside-sphere)) - (format #t "~Tinside-sphere-dist: ~f~%" (-> obj inside-sphere-dist)) - (format #t "~Tsign: ~f~%" (-> obj sign)) - (format #t "~Ttravel-len: ~f~%" (-> obj travel-len)) - (format #t "~Tdist2: ~f~%" (-> obj dist2)) - (format #t "~Tinside-dist: ~f~%" (-> obj inside-dist)) - (format #t "~Trand-angle: ~f~%" (-> obj rand-angle)) - (format #t "~Tdir-update: ~A~%" (-> obj dir-update)) - (format #t "~Tdebug-offset: #~%" (-> obj debug-offset)) - obj +(defmethod inspect nav-control-cfs-work ((this nav-control-cfs-work)) + (format #t "[~8x] ~A~%" this 'nav-control-cfs-work) + (format #t "~Tin-dir: #~%" (-> this in-dir)) + (format #t "~Tright-dir: #~%" (-> this right-dir)) + (format #t "~Tbest-dir[2] @ #x~X~%" (-> this best-dir)) + (format #t "~Ttemp-dir[2] @ #x~X~%" (-> this temp-dir)) + (format #t "~Taway-dir: #~%" (-> this away-dir)) + (format #t "~Tbest-dir-angle[2] @ #x~X~%" (-> this best-dir-angle)) + (format #t "~Tignore-mask: ~D~%" (-> this ignore-mask)) + (format #t "~Tinitial-ignore-mask: ~D~%" (-> this initial-ignore-mask)) + (format #t "~Ti-sphere: ~D~%" (-> this i-sphere)) + (format #t "~Ti-first-sphere: ~D~%" (-> this i-first-sphere)) + (format #t "~Ti-inside-sphere: ~D~%" (-> this i-inside-sphere)) + (format #t "~Tinside-sphere-dist: ~f~%" (-> this inside-sphere-dist)) + (format #t "~Tsign: ~f~%" (-> this sign)) + (format #t "~Ttravel-len: ~f~%" (-> this travel-len)) + (format #t "~Tdist2: ~f~%" (-> this dist2)) + (format #t "~Tinside-dist: ~f~%" (-> this inside-dist)) + (format #t "~Trand-angle: ~f~%" (-> this rand-angle)) + (format #t "~Tdir-update: ~A~%" (-> this dir-update)) + (format #t "~Tdebug-offset: #~%" (-> this debug-offset)) + this ) ;; definition for function circle-tangent-directions @@ -2441,7 +2441,7 @@ ;; definition for method 32 of type nav-control ;; INFO: Used lq/sq -(defmethod nav-control-method-32 nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-control-method-32 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) (local-vars (v0-3 symbol) (v1-38 int) (a0-29 int) (a3-7 int) (sv-208 sphere)) (let ((gp-0 (new 'stack-no-clear 'nav-control-cfs-work))) (set! (-> gp-0 in-dir quad) (-> arg2 quad)) @@ -2458,8 +2458,8 @@ (set! (-> gp-0 initial-ignore-mask) (the-as uint 0)) (set! (-> gp-0 i-inside-sphere) -1) (set! (-> gp-0 inside-sphere-dist) 0.0) - (dotimes (s0-0 (-> obj num-spheres)) - (set! sv-208 (-> obj sphere s0-0)) + (dotimes (s0-0 (-> this num-spheres)) + (set! sv-208 (-> this sphere s0-0)) (set! (-> gp-0 dist2) (vector-vector-xz-distance-squared arg1 sv-208)) (let ((f0-10 (-> gp-0 dist2)) (f1-0 (-> sv-208 w)) @@ -2482,8 +2482,8 @@ arg1 (-> gp-0 in-dir) (-> gp-0 travel-len) - (-> obj num-spheres) - (-> obj sphere) + (-> this num-spheres) + (-> this sphere) (the-as int (-> gp-0 initial-ignore-mask)) ) ) @@ -2494,7 +2494,7 @@ (the-as none 0) ) (+! (-> gp-0 initial-ignore-mask) (ash 1 (-> gp-0 i-first-sphere))) - (let ((a1-9 (-> obj sphere (-> gp-0 i-first-sphere)))) + (let ((a1-9 (-> this sphere (-> gp-0 i-first-sphere)))) (circle-tangent-directions arg1 a1-9 (the-as vector (-> gp-0 temp-dir)) (-> gp-0 temp-dir 1)) ) (dotimes (v1-31 2) @@ -2517,7 +2517,12 @@ (b! #t cfg-31 :delay (nop!)) (label cfg-22) (+! (-> gp-0 ignore-mask) (ash 1 v1-38)) - (circle-tangent-directions arg1 (-> obj sphere v1-38) (the-as vector (-> gp-0 temp-dir)) (-> gp-0 temp-dir 1)) + (circle-tangent-directions + arg1 + (-> this sphere v1-38) + (the-as vector (-> gp-0 temp-dir)) + (-> gp-0 temp-dir 1) + ) (set! (-> gp-0 dir-update) #f) (dotimes (v1-40 2) (let ((f0-23 (-> gp-0 sign)) @@ -2544,8 +2549,8 @@ arg1 (-> gp-0 best-dir s1-1) (-> gp-0 travel-len) - (-> obj num-spheres) - (-> obj sphere) + (-> this num-spheres) + (-> this sphere) (the-as int (-> gp-0 ignore-mask)) ) ) @@ -2554,7 +2559,7 @@ (set! (-> gp-0 sign) (* -1.0 (-> gp-0 sign))) ) (when (!= (-> gp-0 i-inside-sphere) -1) - (let ((s2-1 (-> obj sphere (-> gp-0 i-inside-sphere)))) + (let ((s2-1 (-> this sphere (-> gp-0 i-inside-sphere)))) (vector-! (-> gp-0 away-dir) arg1 (the-as vector s2-1)) (set! (-> gp-0 away-dir y) 0.0) (when (>= 40.96 (vector-length (-> gp-0 away-dir))) @@ -2596,13 +2601,13 @@ ) ;; definition for method 23 of type nav-control -(defmethod nav-control-method-23 nav-control ((obj nav-control) (arg0 vector) (arg1 check-vector-collision-with-nav-spheres-info)) - (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj mesh origin))) +(defmethod nav-control-method-23 nav-control ((this nav-control) (arg0 vector) (arg1 check-vector-collision-with-nav-spheres-info)) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this mesh origin))) (f30-0 -1.0) ) (let ((s3-0 -1)) - (countdown (s1-0 (-> obj num-spheres)) - (let* ((s0-0 (-> obj sphere s1-0)) + (countdown (s1-0 (-> this num-spheres)) + (let* ((s0-0 (-> this sphere s1-0)) (f0-1 (ray-circle-intersect s2-1 arg0 (the-as vector (&-> s0-0 x)) (-> s0-0 w))) ) (when (>= f0-1 0.0) @@ -2621,11 +2626,11 @@ (when arg1 (set! (-> arg1 u) f30-0) (when (>= f30-0 0.0) - (vector+float*! (-> arg1 intersect) (-> obj shape trans) arg0 f30-0) - (let ((a1-4 (-> obj sphere s3-0)) + (vector+float*! (-> arg1 intersect) (-> this shape trans) arg0 f30-0) + (let ((a1-4 (-> this sphere s3-0)) (v1-19 (new 'stack-no-clear 'vector)) ) - (vector+! v1-19 (the-as vector (&-> a1-4 x)) (-> obj mesh origin)) + (vector+! v1-19 (the-as vector (&-> a1-4 x)) (-> this mesh origin)) (vector-! (-> arg1 normal) (-> arg1 intersect) v1-19) ) (set! (-> arg1 normal w) 1.0) @@ -2639,17 +2644,17 @@ ;; definition for method 33 of type nav-control ;; INFO: Used lq/sq -(defmethod nav-control-method-33 nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) - (let ((f30-0 (vector-xz-length (-> obj travel)))) - (when (nav-control-method-32 obj arg0 arg1 arg2 arg3 f30-0) - (set! (-> obj blocked-travel quad) (-> obj travel quad)) - (let ((f0-0 (vector-xz-length (-> obj travel)))) +(defmethod nav-control-method-33 nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 float)) + (let ((f30-0 (vector-xz-length (-> this travel)))) + (when (nav-control-method-32 this arg0 arg1 arg2 arg3 f30-0) + (set! (-> this blocked-travel quad) (-> this travel quad)) + (let ((f0-0 (vector-xz-length (-> this travel)))) (when (and (>= f30-0 f0-0) (< f0-0 204.8)) - (logior! (-> obj flags) (nav-control-flags navcf17)) - (set! (-> obj block-time) (-> *display* base-frame-counter)) - (+! (-> obj block-count) 1.0) - (if (-> obj block-event) - (send-event (the-as process-tree (-> obj process)) (the-as symbol (-> obj block-event)) obj) + (logior! (-> this flags) (nav-control-flags navcf17)) + (set-time! (-> this block-time)) + (+! (-> this block-count) 1.0) + (if (-> this block-event) + (send-event (the-as process-tree (-> this process)) (the-as symbol (-> this block-event)) this) ) ) ) @@ -2679,9 +2684,9 @@ ;; definition for method 19 of type nav-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs none. -(defmethod nav-control-method-19 nav-control ((obj nav-control) (arg0 vector) (arg1 collide-shape-moving) (arg2 vector) (arg3 float)) +(defmethod nav-control-method-19 nav-control ((this nav-control) (arg0 vector) (arg1 collide-shape-moving) (arg2 vector) (arg3 float)) (local-vars (sv-48 float)) - (let ((f30-0 (* arg3 (-> *display* seconds-per-frame))) + (let ((f30-0 (* arg3 (seconds-per-frame))) (s0-0 arg1) (s1-0 arg2) (s2-0 deg-diff) @@ -2691,23 +2696,23 @@ (f28-0 (s2-0 sv-48 a1-1)) ) (cond - ((or (vector= arg2 (-> obj target-pos)) (< (fabs f28-0) 364.0889)) - (logior! (-> obj flags) (nav-control-flags navcf21)) + ((or (vector= arg2 (-> this target-pos)) (< (fabs f28-0) 364.0889)) + (logior! (-> this flags) (nav-control-flags navcf21)) (set! (-> arg0 quad) (-> arg2 quad)) ) (else (let ((s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg1 quat)))) (vector-rotate-y! s2-1 s2-1 (fmax (fmin f28-0 f30-0) (- f30-0))) (vector-normalize! s2-1 819.2) - (logclear! (-> obj flags) (nav-control-flags navcf21)) + (logclear! (-> this flags) (nav-control-flags navcf21)) (vector+! arg0 (-> arg1 trans) s2-1) ) - (when (or (not (nav-control-method-16 obj arg0)) - (logtest? (nav-control-flags navcf17) (-> obj flags)) - (not (logtest? (-> obj flags) (nav-control-flags navcf10))) + (when (or (not (nav-control-method-16 this arg0)) + (logtest? (nav-control-flags navcf17) (-> this flags)) + (not (logtest? (-> this flags) (nav-control-flags navcf10))) ) - (logior! (-> obj flags) (nav-control-flags navcf21)) - (vector-! (-> obj travel) arg2 (-> arg1 trans)) + (logior! (-> this flags) (nav-control-flags navcf21)) + (vector-! (-> this travel) arg2 (-> arg1 trans)) (set! (-> arg0 quad) (-> arg2 quad)) ) ) @@ -2718,32 +2723,32 @@ ) ;; definition for method 16 of type nav-control -(defmethod nav-control-method-16 nav-control ((obj nav-control) (arg0 vector)) +(defmethod nav-control-method-16 nav-control ((this nav-control) (arg0 vector)) (find-poly-fast - (-> obj mesh) - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj mesh origin)) - (-> obj nearest-y-threshold) + (-> this mesh) + (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) + (-> this nearest-y-threshold) ) ) ;; definition for method 21 of type nav-control -(defmethod nav-control-method-21 nav-control ((obj nav-control) (arg0 vector)) +(defmethod nav-control-method-21 nav-control ((this nav-control) (arg0 vector)) (find-poly-fast - (-> obj mesh) - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj mesh origin)) - (-> obj nearest-y-threshold) + (-> this mesh) + (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) + (-> this nearest-y-threshold) ) ) ;; definition for method 22 of type nav-control ;; INFO: Return type mismatch structure vs symbol. -(defmethod nav-control-method-22 nav-control ((obj nav-control) (arg0 vector) (arg1 float)) +(defmethod nav-control-method-22 nav-control ((this nav-control) (arg0 vector) (arg1 float)) (the-as symbol (and (find-poly-fast - (-> obj mesh) - (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj mesh origin)) - (-> obj nearest-y-threshold) + (-> this mesh) + (vector-! (new 'stack-no-clear 'vector) arg0 (-> this mesh origin)) + (-> this nearest-y-threshold) ) - (< (-> arg0 y) (+ (-> obj mesh origin y) arg1)) + (< (-> arg0 y) (+ (-> this mesh origin y) arg1)) ) ) ) @@ -2761,7 +2766,7 @@ ;; definition for method 26 of type nav-control ;; INFO: Return type mismatch int vs none. -(defmethod nav-control-method-26 nav-control ((obj nav-control)) +(defmethod nav-control-method-26 nav-control ((this nav-control)) 0 (none) ) @@ -2769,17 +2774,17 @@ ;; definition for method 27 of type nav-control ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-control-method-27 nav-control ((obj nav-control)) +(defmethod nav-control-method-27 nav-control ((this nav-control)) (local-vars (v1-7 symbol)) (cond - ((-> obj current-poly) - (let ((s4-0 (-> obj mesh)) + ((-> this current-poly) + (let ((s4-0 (-> this mesh)) (s5-0 (new 'stack-no-clear 'nav-ray)) ) (let ((s3-0 0)) - (set! (-> s5-0 current-poly) (-> obj current-poly)) - (vector-! (-> s5-0 current-pos) (-> obj prev-pos) (-> s4-0 origin)) - (vector-! (-> s5-0 dest-pos) (-> obj shape trans) (-> s4-0 origin)) + (set! (-> s5-0 current-poly) (-> this current-poly)) + (vector-! (-> s5-0 current-pos) (-> this prev-pos) (-> s4-0 origin)) + (vector-! (-> s5-0 dest-pos) (-> this shape trans) (-> s4-0 origin)) (init-ray s5-0) (until v1-7 (+! s3-0 1) @@ -2787,7 +2792,7 @@ (set! v1-7 (or (>= s3-0 15) (-> s5-0 terminated))) ) ) - (set! (-> obj current-poly) (-> s5-0 current-poly)) + (set! (-> this current-poly) (-> s5-0 current-poly)) (when (-> s5-0 reached-dest) (if (not (point-in-poly? s4-0 (-> s5-0 current-poly) (-> s5-0 dest-pos))) (set! (-> s5-0 reached-dest) #f) @@ -2795,22 +2800,22 @@ ) (cond ((-> s5-0 reached-dest) - (set! (-> obj prev-pos quad) (-> obj shape trans quad)) + (set! (-> this prev-pos quad) (-> this shape trans quad)) ) (else - (set! (-> obj prev-pos quad) (-> obj shape trans quad)) - (set! (-> obj current-poly) (find-poly obj (-> obj shape trans))) + (set! (-> this prev-pos quad) (-> this shape trans quad)) + (set! (-> this current-poly) (find-poly this (-> this shape trans))) ) ) ) 0 ) (else - (set! (-> obj prev-pos quad) (-> obj shape trans quad)) - (set! (-> obj current-poly) (find-poly obj (-> obj shape trans))) + (set! (-> this prev-pos quad) (-> this shape trans quad)) + (set! (-> this current-poly) (find-poly this (-> this shape trans))) ) ) - (nav-control-method-26 obj) + (nav-control-method-26 this) 0 (none) ) @@ -2818,7 +2823,7 @@ ;; definition for method 16 of type nav-mesh ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-mesh-method-16 nav-mesh ((obj nav-mesh) +(defmethod nav-mesh-method-16 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) @@ -2842,14 +2847,14 @@ (init-ray s0-0) (until v1-10 (set! sv-128 (+ sv-128 1)) - (move-along-nav-ray! obj s0-0) + (move-along-nav-ray! this s0-0) (set! v1-10 (or (>= sv-128 15) (or (>= (-> s0-0 len) (fmax 20480.0 arg4)) (-> s0-0 terminated)))) ) (cond ((and (-> s0-0 hit-boundary) (and (< (-> s0-0 len) arg4) (!= (-> s0-0 last-edge) -1) (< sv-112 1))) (set! sv-112 (+ sv-112 1)) - (let* ((v1-22 (-> obj vertex (-> s0-0 current-poly vertex (-> *edge-vert0-table* (-> s0-0 last-edge))))) - (a0-15 (-> obj vertex (-> s0-0 current-poly vertex (-> *edge-vert1-table* (-> s0-0 last-edge))))) + (let* ((v1-22 (-> this vertex (-> s0-0 current-poly vertex (-> *edge-vert0-table* (-> s0-0 last-edge))))) + (a0-15 (-> this vertex (-> s0-0 current-poly vertex (-> *edge-vert1-table* (-> s0-0 last-edge))))) (f2-1 (- (-> v1-22 z) (-> a0-15 z))) (f3-0 (- (-> a0-15 x) (-> v1-22 x))) (f1-5 (-> arg2 x)) @@ -2864,14 +2869,14 @@ ) (when arg5 (set! (-> arg5 found-boundary) #t) - (vector+! (-> arg5 intersection) (-> s0-0 current-pos) (-> obj origin)) + (vector+! (-> arg5 intersection) (-> s0-0 current-pos) (-> this origin)) (set! (-> arg5 boundary-normal x) f2-2) (set! (-> arg5 boundary-normal y) 0.0) (set! (-> arg5 boundary-normal z) f3-1) (set! (-> arg5 poly) (-> s0-0 current-poly)) (set! (-> arg5 edge) (-> s0-0 last-edge)) - (vector+! (-> arg5 vert-0) (the-as vector v1-22) (-> obj origin)) - (vector+! (-> arg5 vert-1) (the-as vector a0-15) (-> obj origin)) + (vector+! (-> arg5 vert-0) (the-as vector v1-22) (-> this origin)) + (vector+! (-> arg5 vert-1) (the-as vector a0-15) (-> this origin)) ) (set! (-> s0-0 dest-pos quad) (-> s0-0 current-pos quad)) (cond @@ -2913,22 +2918,22 @@ ;; definition for method 24 of type nav-control ;; INFO: Return type mismatch int vs none. -(defmethod nav-control-method-24 nav-control ((obj nav-control) (arg0 float) (arg1 clip-travel-vector-to-mesh-return-info)) +(defmethod nav-control-method-24 nav-control ((this nav-control) (arg0 float) (arg1 clip-travel-vector-to-mesh-return-info)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 (-> obj shape trans) (-> obj mesh origin)) + (vector-! v1-0 (-> this shape trans) (-> this mesh origin)) (nav-mesh-method-16 - (-> obj mesh) + (-> this mesh) v1-0 - (-> obj current-poly) - (-> obj travel) - (not (logtest? (-> obj flags) (nav-control-flags navcf12))) + (-> this current-poly) + (-> this travel) + (not (logtest? (-> this flags) (nav-control-flags navcf12))) arg0 arg1 ) ) (when arg1 (if (-> arg1 gap-poly) - (set! (-> obj next-poly) (-> arg1 gap-poly)) + (set! (-> this next-poly) (-> arg1 gap-poly)) ) ) 0 @@ -3038,7 +3043,7 @@ ;; definition for method 13 of type nav-control ;; INFO: Used lq/sq -(defmethod nav-control-method-13 nav-control ((obj nav-control) (arg0 vector) (arg1 vector)) +(defmethod nav-control-method-13 nav-control ((this nav-control) (arg0 vector) (arg1 vector)) (local-vars (sv-80 vector) (sv-84 vector) @@ -3049,32 +3054,32 @@ ) (set! sv-80 (new 'stack-no-clear 'vector)) (set! sv-84 (new 'stack-no-clear 'vector)) - (set! sv-88 (-> obj current-poly)) + (set! sv-88 (-> this current-poly)) (set! sv-92 (new 'stack-no-clear 'vector)) (set! sv-96 (new 'stack-no-clear 'nav-route-portal)) (set! sv-100 (the-as symbol #f)) - (vector-! sv-80 (-> obj shape trans) (-> obj mesh origin)) + (vector-! sv-80 (-> this shape trans) (-> this mesh origin)) (set! (-> sv-84 quad) (-> sv-80 quad)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 arg0 (-> obj mesh origin)) - (set! (-> obj target-poly) (find-poly (-> obj mesh) s4-0 (-> obj nearest-y-threshold) (&-> obj flags))) - (if (not (-> obj target-poly)) - (set! (-> obj target-poly) (-> obj current-poly)) + (vector-! s4-0 arg0 (-> this mesh origin)) + (set! (-> this target-poly) (find-poly (-> this mesh) s4-0 (-> this nearest-y-threshold) (&-> this flags))) + (if (not (-> this target-poly)) + (set! (-> this target-poly) (-> this current-poly)) ) - (project-point-into-tri-2d (-> obj mesh) (-> obj target-poly) sv-92 s4-0) + (project-point-into-tri-2d (-> this mesh) (-> this target-poly) sv-92 s4-0) ) - (vector-! (-> obj travel) sv-92 sv-80) - (setup-portal (-> obj mesh) (-> obj current-poly) (-> obj target-poly) sv-96) + (vector-! (-> this travel) sv-92 sv-80) + (setup-portal (-> this mesh) (-> this current-poly) (-> this target-poly) sv-96) (cond ((not (-> sv-96 next-poly)) - (set! (-> obj next-poly) #f) - (set! (-> obj portal 0) #f) - (set! (-> obj portal 1) #f) + (set! (-> this next-poly) #f) + (set! (-> this portal 0) #f) + (set! (-> this portal 1) #f) ) (else - (set! (-> obj next-poly) (-> sv-96 next-poly)) - (set! (-> obj portal 0) (the-as nav-route-portal (-> sv-96 vertex 0))) - (set! (-> obj portal 1) (the-as nav-route-portal (-> sv-96 vertex 1))) + (set! (-> this next-poly) (-> sv-96 next-poly)) + (set! (-> this portal 0) (the-as nav-route-portal (-> sv-96 vertex 0))) + (set! (-> this portal 1) (the-as nav-route-portal (-> sv-96 vertex 1))) (set! sv-100 #t) (while (and sv-100 (-> sv-96 next-poly) @@ -3083,29 +3088,29 @@ (when #t #t (vector-segment-distance-point! sv-80 (-> sv-96 vertex 0) (-> sv-96 vertex 1) sv-84) - (vector-! (-> obj travel) sv-92 sv-84) + (vector-! (-> this travel) sv-92 sv-84) 0 ) (cond ((logtest? (-> sv-96 next-poly pat) 1) (vector-segment-distance-point! sv-80 (-> sv-96 vertex 0) (-> sv-96 vertex 1) sv-92) - (vector-! (-> obj travel) sv-92 sv-84) - (set! (-> obj next-poly) (-> sv-96 next-poly)) + (vector-! (-> this travel) sv-92 sv-84) + (set! (-> this next-poly) (-> sv-96 next-poly)) (set! sv-100 (the-as symbol #f)) ) ((begin (set! sv-88 (-> sv-96 next-poly)) - (setup-portal (-> obj mesh) (-> sv-96 next-poly) (-> obj target-poly) sv-96) + (setup-portal (-> this mesh) (-> sv-96 next-poly) (-> this target-poly) sv-96) ) - (set! (-> obj next-poly) (-> sv-96 next-poly)) - (set! (-> obj portal 0) (the-as nav-route-portal (-> sv-96 vertex 0))) - (set! (-> obj portal 1) (the-as nav-route-portal (-> sv-96 vertex 1))) + (set! (-> this next-poly) (-> sv-96 next-poly)) + (set! (-> this portal 0) (the-as nav-route-portal (-> sv-96 vertex 0))) + (set! (-> this portal 1) (the-as nav-route-portal (-> sv-96 vertex 1))) 0 ) (else - (set! (-> obj next-poly) #f) - (set! (-> obj portal 0) #f) - (set! (-> obj portal 1) #f) + (set! (-> this next-poly) #f) + (set! (-> this portal 0) #f) + (set! (-> this portal 1) #f) (set! sv-100 (the-as symbol #f)) ) ) @@ -3115,53 +3120,53 @@ (when sv-100 (when (not (ray-ccw-line-segment-intersection? sv-84 - (-> obj travel) - (the-as vector (-> obj portal 0)) - (the-as vector (-> obj portal 1)) + (-> this travel) + (the-as vector (-> this portal 0)) + (the-as vector (-> this portal 1)) ) ) - (let ((a0-18 (choose-travel-portal-vertex (-> obj mesh) sv-96 (-> obj target-poly) sv-92))) - (vector-! (-> obj travel) (the-as vector (-> sv-96 vertex a0-18)) sv-84) + (let ((a0-18 (choose-travel-portal-vertex (-> this mesh) sv-96 (-> this target-poly) sv-92))) + (vector-! (-> this travel) (the-as vector (-> sv-96 vertex a0-18)) sv-84) ) ) ) - (nav-control-method-33 obj (-> obj travel) sv-84 (-> obj travel) arg1 40960.0) + (nav-control-method-33 this (-> this travel) sv-84 (-> this travel) arg1 40960.0) (let ((s5-1 (new 'stack-no-clear 'clip-travel-vector-to-mesh-return-info))) (nav-mesh-method-16 - (-> obj mesh) + (-> this mesh) sv-84 sv-88 - (-> obj travel) - (not (logtest? (-> obj flags) (nav-control-flags navcf12))) + (-> this travel) + (not (logtest? (-> this flags) (nav-control-flags navcf12))) 204.8 s5-1 ) (if (-> s5-1 gap-poly) - (set! (-> obj next-poly) (-> s5-1 gap-poly)) + (set! (-> this next-poly) (-> s5-1 gap-poly)) ) ) (let ((v1-82 (new 'stack-no-clear 'vector))) (vector-! v1-82 sv-84 sv-80) - (vector+! (-> obj travel) (-> obj travel) v1-82) + (vector+! (-> this travel) (-> this travel) v1-82) ) - (set! (-> obj travel y) 0.0) - (-> obj travel) + (set! (-> this travel y) 0.0) + (-> this travel) ) ;; definition for method 12 of type nav-control ;; INFO: Used lq/sq -(defmethod nav-control-method-12 nav-control ((obj nav-control) (arg0 nav-gap-info)) - (when (and (-> obj next-poly) (logtest? (-> obj next-poly pat) 1)) - (let ((s4-0 (-> obj next-poly)) - (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj mesh origin))) +(defmethod nav-control-method-12 nav-control ((this nav-control) (arg0 nav-gap-info)) + (when (and (-> this next-poly) (logtest? (-> this next-poly pat) 1)) + (let ((s4-0 (-> this next-poly)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this mesh origin))) ) (while (and s4-0 (logtest? (-> s4-0 pat) 1)) - (set! s4-0 (get-adj-poly (-> obj mesh) s4-0 (-> obj target-poly) #f)) + (set! s4-0 (get-adj-poly (-> this mesh) s4-0 (-> this target-poly) #f)) ) - (when (and s4-0 (-> obj gap-event)) - (let ((s2-0 (-> obj event-temp))) - (closest-point-on-boundary (-> obj mesh) s4-0 s2-0 s3-1) - (vector+! s2-0 s2-0 (-> obj mesh origin)) + (when (and s4-0 (-> this gap-event)) + (let ((s2-0 (-> this event-temp))) + (closest-point-on-boundary (-> this mesh) s4-0 s2-0 s3-1) + (vector+! s2-0 s2-0 (-> this mesh origin)) (set! (-> arg0 dest quad) (-> s2-0 quad)) ) (set! (-> arg0 poly) s4-0) @@ -3218,30 +3223,30 @@ ;; definition for method 11 of type nav-control ;; INFO: Used lq/sq -(defmethod nav-control-method-11 nav-control ((obj nav-control) (arg0 vector)) - (set! (-> obj old-travel quad) (-> obj travel quad)) - (-> obj block-count) - (seek! (-> obj block-count) 0.0 0.016666668) - (logclear! (-> obj flags) (nav-control-flags navcf9 navcf17 navcf18 navcf19)) - (nav-control-method-27 obj) - (if (logtest? (-> obj flags) (nav-control-flags navcf8)) - (nav-control-method-28 obj (the-as collide-kind -1)) +(defmethod nav-control-method-11 nav-control ((this nav-control) (arg0 vector)) + (set! (-> this old-travel quad) (-> this travel quad)) + (-> this block-count) + (seek! (-> this block-count) 0.0 0.016666668) + (logclear! (-> this flags) (nav-control-flags navcf9 navcf17 navcf18 navcf19)) + (nav-control-method-27 this) + (if (logtest? (-> this flags) (nav-control-flags navcf8)) + (nav-control-method-28 this (the-as collide-kind -1)) ) - (nav-control-method-13 obj arg0 (-> obj old-travel)) - (-> obj mesh) - (vector-! (new 'stack-no-clear 'vector) (-> obj shape trans) (-> obj mesh origin)) + (nav-control-method-13 this arg0 (-> this old-travel)) + (-> this mesh) + (vector-! (new 'stack-no-clear 'vector) (-> this shape trans) (-> this mesh origin)) (let ((s5-1 (new 'stack-no-clear 'nav-gap-info))) - (when (< (vector-xz-length (-> obj travel)) 204.8) + (when (< (vector-xz-length (-> this travel)) 204.8) (cond - ((logtest? (nav-control-flags navcf17) (-> obj flags)) + ((logtest? (nav-control-flags navcf17) (-> this flags)) ) - ((-> obj next-poly) + ((-> this next-poly) (cond - ((nav-control-method-12 obj s5-1) - (set! (-> obj next-poly) #f) + ((nav-control-method-12 this s5-1) + (set! (-> this next-poly) #f) (send-event - (the-as process-tree (-> obj process)) - (the-as symbol (-> obj gap-event)) + (the-as process-tree (-> this process)) + (the-as symbol (-> this gap-event)) (-> s5-1 dest) (-> s5-1 poly) ) @@ -3251,12 +3256,12 @@ ) ) (else - (logior! (-> obj flags) (nav-control-flags navcf19)) + (logior! (-> this flags) (nav-control-flags navcf19)) ) ) ) ) - (-> obj travel) + (-> this travel) ) ;; definition (debug) for function nav-sphere-from-cam diff --git a/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc b/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc index 27ab2512d9..84124d6520 100644 --- a/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/physics/dynamics-h_REF.gc @@ -17,16 +17,16 @@ ) ;; definition for method 3 of type dynamics -(defmethod inspect dynamics ((obj dynamics)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tgravity-max: (meters ~m)~%" (-> obj gravity-max)) - (format #t "~Tgravity-length: (meters ~m)~%" (-> obj gravity-length)) - (format #t "~Tgravity: ~`vector`P~%" (-> obj gravity)) - (format #t "~Tgravity-normal: ~`vector`P~%" (-> obj gravity-normal)) - (format #t "~Twalk-distance: (meters ~m)~%" (-> obj walk-distance)) - (format #t "~Trun-distance: (meters ~m)~%" (-> obj run-distance)) - obj +(defmethod inspect dynamics ((this dynamics)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tgravity-max: (meters ~m)~%" (-> this gravity-max)) + (format #t "~Tgravity-length: (meters ~m)~%" (-> this gravity-length)) + (format #t "~Tgravity: ~`vector`P~%" (-> this gravity)) + (format #t "~Tgravity-normal: ~`vector`P~%" (-> this gravity-normal)) + (format #t "~Twalk-distance: (meters ~m)~%" (-> this walk-distance)) + (format #t "~Trun-distance: (meters ~m)~%" (-> this run-distance)) + this ) ;; definition for function time-to-apex diff --git a/test/decompiler/reference/jak1/engine/physics/trajectory-h_REF.gc b/test/decompiler/reference/jak1/engine/physics/trajectory-h_REF.gc index 94943ca219..fa38d0f80c 100644 --- a/test/decompiler/reference/jak1/engine/physics/trajectory-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/physics/trajectory-h_REF.gc @@ -23,18 +23,14 @@ ) ;; definition for method 3 of type trajectory -(defmethod inspect trajectory ((obj trajectory)) - (format #t "[~8x] ~A~%" obj 'trajectory) - (format #t "~Tinitial-position: ~`vector`P~%" (-> obj initial-position)) - (format #t "~Tinitial-velocity: ~`vector`P~%" (-> obj initial-velocity)) - (format #t "~Ttime: ~f~%" (-> obj time)) - (format #t "~Tgravity: (meters ~m)~%" (-> obj gravity)) - obj +(defmethod inspect trajectory ((this trajectory)) + (format #t "[~8x] ~A~%" this 'trajectory) + (format #t "~Tinitial-position: ~`vector`P~%" (-> this initial-position)) + (format #t "~Tinitial-velocity: ~`vector`P~%" (-> this initial-velocity)) + (format #t "~Ttime: ~f~%" (-> this time)) + (format #t "~Tgravity: (meters ~m)~%" (-> this gravity)) + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc index 6de6f518ca..f65670026d 100644 --- a/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak1/engine/physics/trajectory_REF.gc @@ -2,38 +2,37 @@ (in-package goal) ;; definition for method 9 of type trajectory -;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod eval-position! trajectory ((obj trajectory) (time float) (result vector)) - (set! (-> result quad) (-> obj initial-position quad)) - (+! (-> result x) (* time (-> obj initial-velocity x))) - (+! (-> result y) (* time (-> obj initial-velocity y))) - (+! (-> result z) (* time (-> obj initial-velocity z))) - (+! (-> result y) (* 0.5 time time (-> obj gravity))) +(defmethod eval-position! trajectory ((this trajectory) (time float) (result vector)) + (set! (-> result quad) (-> this initial-position quad)) + (+! (-> result x) (* time (-> this initial-velocity x))) + (+! (-> result y) (* time (-> this initial-velocity y))) + (+! (-> result z) (* time (-> this initial-velocity z))) + (+! (-> result y) (* 0.5 time time (-> this gravity))) result ) ;; definition for method 10 of type trajectory ;; INFO: Used lq/sq -(defmethod eval-velocity! trajectory ((obj trajectory) (time float) (result vector)) - (set! (-> result quad) (-> obj initial-velocity quad)) - (+! (-> result y) (* time (-> obj gravity))) +(defmethod eval-velocity! trajectory ((this trajectory) (time float) (result vector)) + (set! (-> result quad) (-> this initial-velocity quad)) + (+! (-> result y) (* time (-> this gravity))) result ) ;; definition for method 11 of type trajectory ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod setup-from-to-duration! trajectory ((obj trajectory) (from vector) (to vector) (duration float) (grav float)) - (set! (-> obj initial-position quad) (-> from quad)) - (set! (-> obj gravity) grav) - (set! (-> obj time) duration) +(defmethod setup-from-to-duration! trajectory ((this trajectory) (from vector) (to vector) (duration float) (grav float)) + (set! (-> this initial-position quad) (-> from quad)) + (set! (-> this gravity) grav) + (set! (-> this time) duration) (let ((xz-vel (/ (vector-vector-xz-distance to from) duration))) - (vector-! (-> obj initial-velocity) to from) - (vector-xz-normalize! (-> obj initial-velocity) xz-vel) + (vector-! (-> this initial-velocity) to from) + (vector-xz-normalize! (-> this initial-velocity) xz-vel) ) - (set! (-> obj initial-velocity y) - (- (/ (- (-> to y) (-> from y)) duration) (* 0.5 duration (-> obj gravity))) + (set! (-> this initial-velocity y) + (- (/ (- (-> to y) (-> from y)) duration) (* 0.5 duration (-> this gravity))) ) 0 (none) @@ -41,9 +40,9 @@ ;; definition for method 12 of type trajectory ;; INFO: Return type mismatch int vs none. -(defmethod setup-from-to-xz-vel! trajectory ((obj trajectory) (from vector) (to vector) (xz-vel float) (grav float)) +(defmethod setup-from-to-xz-vel! trajectory ((this trajectory) (from vector) (to vector) (xz-vel float) (grav float)) (let ((duration (/ (vector-vector-xz-distance to from) xz-vel))) - (setup-from-to-duration! obj from to duration grav) + (setup-from-to-duration! this from to duration grav) ) 0 (none) @@ -51,7 +50,7 @@ ;; definition for method 13 of type trajectory ;; INFO: Return type mismatch int vs none. -(defmethod setup-from-to-y-vel! trajectory ((obj trajectory) (from vector) (to vector) (y-vel float) (grav float)) +(defmethod setup-from-to-y-vel! trajectory ((this trajectory) (from vector) (to vector) (y-vel float) (grav float)) (let* ((f0-0 y-vel) (f1-3 (- (* f0-0 f0-0) (* 2.0 (- (-> from y) (-> to y)) grav))) (f0-3 900.0) @@ -61,7 +60,7 @@ (set! f0-3 (fmax (/ (- (- y-vel) f0-4) grav) (/ (+ (- y-vel) f0-4) grav))) ) ) - (setup-from-to-duration! obj from to f0-3 grav) + (setup-from-to-duration! this from to f0-3 grav) ) 0 (none) @@ -69,7 +68,7 @@ ;; definition for method 14 of type trajectory ;; INFO: Return type mismatch int vs none. -(defmethod setup-from-to-height! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let* ((f1-2 (+ arg2 (fmax (-> arg0 y) (-> arg1 y)))) (f1-5 (* 2.0 (- (-> arg0 y) f1-2) arg3)) (f0-3 4096.0) @@ -77,7 +76,7 @@ (if (< 0.0 f1-5) (set! f0-3 (sqrtf f1-5)) ) - (setup-from-to-y-vel! obj arg0 arg1 f0-3 arg3) + (setup-from-to-y-vel! this arg0 arg1 f0-3 arg3) ) 0 (none) @@ -86,16 +85,16 @@ ;; definition for method 15 of type trajectory ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod debug-draw! trajectory ((obj trajectory)) +(defmethod debug-draw! trajectory ((this trajectory)) (let ((prev-pos (new 'stack-no-clear 'vector)) (pos (new 'stack-no-clear 'vector)) (num-segments 10) ) - (set! (-> pos quad) (-> obj initial-position quad)) + (set! (-> pos quad) (-> this initial-position quad)) (dotimes (s2-0 num-segments) (set! (-> prev-pos quad) (-> pos quad)) - (let ((t-eval (* (-> obj time) (/ (+ 1.0 (the float s2-0)) (the float num-segments))))) - (eval-position! obj t-eval pos) + (let ((t-eval (* (-> this time) (/ (+ 1.0 (the float s2-0)) (the float num-segments))))) + (eval-position! this t-eval pos) ) (add-debug-line #t diff --git a/test/decompiler/reference/jak1/engine/ps2/memcard-h_REF.gc b/test/decompiler/reference/jak1/engine/ps2/memcard-h_REF.gc index 6f3c876c33..a6f6f5855a 100644 --- a/test/decompiler/reference/jak1/engine/ps2/memcard-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/memcard-h_REF.gc @@ -33,23 +33,23 @@ ) ;; definition for method 3 of type mc-file-info -(defmethod inspect mc-file-info ((obj mc-file-info)) - (format #t "[~8x] ~A~%" obj 'mc-file-info) - (format #t "~Tpresent: ~D~%" (-> obj present)) - (format #t "~Tblind-data[16] @ #x~X~%" (-> obj blind-data)) - (format #t "~Tblind-data-int8[64] @ #x~X~%" (-> obj blind-data)) - (format #t "~Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~Tfuel-cell-count: ~f~%" (-> obj fuel-cell-count)) - (format #t "~Tmoney-count: ~f~%" (-> obj money-count)) - (format #t "~Tbuzzer-count: ~f~%" (-> obj buzzer-count)) - (format #t "~Tcompletion-percentage: ~f~%" (-> obj completion-percentage)) - (format #t "~Tminute: #x~X~%" (-> obj minute)) - (format #t "~Thour: #x~X~%" (-> obj hour)) - (format #t "~Tweek: #x~X~%" (-> obj week)) - (format #t "~Tday: #x~X~%" (-> obj day)) - (format #t "~Tmonth: #x~X~%" (-> obj month)) - (format #t "~Tyear: #x~X~%" (-> obj year)) - obj +(defmethod inspect mc-file-info ((this mc-file-info)) + (format #t "[~8x] ~A~%" this 'mc-file-info) + (format #t "~Tpresent: ~D~%" (-> this present)) + (format #t "~Tblind-data[16] @ #x~X~%" (-> this blind-data)) + (format #t "~Tblind-data-int8[64] @ #x~X~%" (-> this blind-data)) + (format #t "~Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~Tfuel-cell-count: ~f~%" (-> this fuel-cell-count)) + (format #t "~Tmoney-count: ~f~%" (-> this money-count)) + (format #t "~Tbuzzer-count: ~f~%" (-> this buzzer-count)) + (format #t "~Tcompletion-percentage: ~f~%" (-> this completion-percentage)) + (format #t "~Tminute: #x~X~%" (-> this minute)) + (format #t "~Thour: #x~X~%" (-> this hour)) + (format #t "~Tweek: #x~X~%" (-> this week)) + (format #t "~Tday: #x~X~%" (-> this day)) + (format #t "~Tmonth: #x~X~%" (-> this month)) + (format #t "~Tyear: #x~X~%" (-> this year)) + this ) ;; definition of type mc-slot-info @@ -70,17 +70,17 @@ ) ;; definition for method 3 of type mc-slot-info -(defmethod inspect mc-slot-info ((obj mc-slot-info)) - (format #t "[~8x] ~A~%" obj 'mc-slot-info) - (format #t "~Thandle: ~D~%" (-> obj handle)) - (format #t "~Tknown: ~D~%" (-> obj known)) - (format #t "~Tformatted: ~D~%" (-> obj formatted)) - (format #t "~Tinited: ~D~%" (-> obj inited)) - (format #t "~Tlast-file: ~D~%" (-> obj last-file)) - (format #t "~Tmem-required: ~D~%" (-> obj mem-required)) - (format #t "~Tmem-actual: ~D~%" (-> obj mem-actual)) - (format #t "~Tfile[4] @ #x~X~%" (-> obj file)) - obj +(defmethod inspect mc-slot-info ((this mc-slot-info)) + (format #t "[~8x] ~A~%" this 'mc-slot-info) + (format #t "~Thandle: ~D~%" (-> this handle)) + (format #t "~Tknown: ~D~%" (-> this known)) + (format #t "~Tformatted: ~D~%" (-> this formatted)) + (format #t "~Tinited: ~D~%" (-> this inited)) + (format #t "~Tlast-file: ~D~%" (-> this last-file)) + (format #t "~Tmem-required: ~D~%" (-> this mem-required)) + (format #t "~Tmem-actual: ~D~%" (-> this mem-actual)) + (format #t "~Tfile[4] @ #x~X~%" (-> this file)) + this ) ;; definition for function mc-sync diff --git a/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc b/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc index e03f6c970d..201b70ef43 100644 --- a/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/pad_REF.gc @@ -22,18 +22,18 @@ ) ;; definition for method 3 of type hw-cpad -(defmethod inspect hw-cpad ((obj hw-cpad)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tvalid: #x~X~%" (-> obj valid)) - (format #t "~Tstatus: #x~X~%" (-> obj status)) - (format #t "~Tbutton0: #x~X~%" (-> obj button0)) - (format #t "~Trightx: ~D~%" (-> obj rightx)) - (format #t "~Trighty: ~D~%" (-> obj righty)) - (format #t "~Tleftx: ~D~%" (-> obj leftx)) - (format #t "~Tlefty: ~D~%" (-> obj lefty)) - (format #t "~Tabutton[12] @ #x~X~%" (-> obj abutton)) - (format #t "~Tdummy[12] @ #x~X~%" (-> obj dummy)) - obj +(defmethod inspect hw-cpad ((this hw-cpad)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tvalid: #x~X~%" (-> this valid)) + (format #t "~Tstatus: #x~X~%" (-> this status)) + (format #t "~Tbutton0: #x~X~%" (-> this button0)) + (format #t "~Trightx: ~D~%" (-> this rightx)) + (format #t "~Trighty: ~D~%" (-> this righty)) + (format #t "~Tleftx: ~D~%" (-> this leftx)) + (format #t "~Tlefty: ~D~%" (-> this lefty)) + (format #t "~Tabutton[12] @ #x~X~%" (-> this abutton)) + (format #t "~Tdummy[12] @ #x~X~%" (-> this dummy)) + this ) ;; definition of type cpad-info @@ -64,34 +64,34 @@ ) ;; definition for method 3 of type cpad-info -(defmethod inspect cpad-info ((obj cpad-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tvalid: #x~X~%" (-> obj valid)) - (format #t "~Tstatus: #x~X~%" (-> obj status)) - (format #t "~Tbutton0: #x~X~%" (-> obj button0)) - (format #t "~Trightx: ~D~%" (-> obj rightx)) - (format #t "~Trighty: ~D~%" (-> obj righty)) - (format #t "~Tleftx: ~D~%" (-> obj leftx)) - (format #t "~Tlefty: ~D~%" (-> obj lefty)) - (format #t "~Tabutton[12] @ #x~X~%" (-> obj abutton)) - (format #t "~Tdummy[12] @ #x~X~%" (-> obj dummy)) - (format #t "~Tnumber: ~D~%" (-> obj number)) - (format #t "~Tcpad-file: ~D~%" (-> obj cpad-file)) - (format #t "~Tbutton0-abs[3] @ #x~X~%" (-> obj button0-abs)) - (format #t "~Tbutton0-shadow-abs[1] @ #x~X~%" (-> obj button0-shadow-abs)) - (format #t "~Tbutton0-rel[3] @ #x~X~%" (-> obj button0-rel)) - (format #t "~Tstick0-dir: ~f~%" (-> obj stick0-dir)) - (format #t "~Tstick0-speed: ~f~%" (-> obj stick0-speed)) - (format #t "~Tnew-pad: ~D~%" (-> obj new-pad)) - (format #t "~Tstate: ~D~%" (-> obj state)) - (format #t "~Talign[6] @ #x~X~%" (-> obj align)) - (format #t "~Tdirect[6] @ #x~X~%" (-> obj direct)) - (format #t "~Tbuzz-val[2] @ #x~X~%" (-> obj buzz-val)) - (format #t "~Tbuzz-time[2] @ #x~X~%" (-> obj buzz-time)) - (format #t "~Tbuzz: ~A~%" (-> obj buzz)) - (format #t "~Tbuzz-act: ~D~%" (-> obj buzz-act)) - (format #t "~Tchange-time: ~D~%" (-> obj change-time)) - obj +(defmethod inspect cpad-info ((this cpad-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tvalid: #x~X~%" (-> this valid)) + (format #t "~Tstatus: #x~X~%" (-> this status)) + (format #t "~Tbutton0: #x~X~%" (-> this button0)) + (format #t "~Trightx: ~D~%" (-> this rightx)) + (format #t "~Trighty: ~D~%" (-> this righty)) + (format #t "~Tleftx: ~D~%" (-> this leftx)) + (format #t "~Tlefty: ~D~%" (-> this lefty)) + (format #t "~Tabutton[12] @ #x~X~%" (-> this abutton)) + (format #t "~Tdummy[12] @ #x~X~%" (-> this dummy)) + (format #t "~Tnumber: ~D~%" (-> this number)) + (format #t "~Tcpad-file: ~D~%" (-> this cpad-file)) + (format #t "~Tbutton0-abs[3] @ #x~X~%" (-> this button0-abs)) + (format #t "~Tbutton0-shadow-abs[1] @ #x~X~%" (-> this button0-shadow-abs)) + (format #t "~Tbutton0-rel[3] @ #x~X~%" (-> this button0-rel)) + (format #t "~Tstick0-dir: ~f~%" (-> this stick0-dir)) + (format #t "~Tstick0-speed: ~f~%" (-> this stick0-speed)) + (format #t "~Tnew-pad: ~D~%" (-> this new-pad)) + (format #t "~Tstate: ~D~%" (-> this state)) + (format #t "~Talign[6] @ #x~X~%" (-> this align)) + (format #t "~Tdirect[6] @ #x~X~%" (-> this direct)) + (format #t "~Tbuzz-val[2] @ #x~X~%" (-> this buzz-val)) + (format #t "~Tbuzz-time[2] @ #x~X~%" (-> this buzz-time)) + (format #t "~Tbuzz: ~A~%" (-> this buzz)) + (format #t "~Tbuzz-act: ~D~%" (-> this buzz-act)) + (format #t "~Tchange-time: ~D~%" (-> this change-time)) + this ) ;; definition for function cpad-invalid! @@ -129,11 +129,11 @@ ;; definition for method 0 of type cpad-info (defmethod new cpad-info ((alloction symbol) (type-to-make type) (idx int)) - (let ((obj (object-new alloction type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj number) idx) - (set! (-> obj buzz) #f) - (cpad-open obj idx) - (cpad-invalid! obj) + (let ((this (object-new alloction type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this number) idx) + (set! (-> this buzz) #f) + (cpad-open this idx) + (cpad-invalid! this) ) ) @@ -151,11 +151,11 @@ ) ;; definition for method 3 of type cpad-list -(defmethod inspect cpad-list ((obj cpad-list)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-cpads: ~D~%" (-> obj num-cpads)) - (format #t "~Tcpads[2] @ #x~X~%" (-> obj cpads)) - obj +(defmethod inspect cpad-list ((this cpad-list)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-cpads: ~D~%" (-> this num-cpads)) + (format #t "~Tcpads[2] @ #x~X~%" (-> this cpads)) + this ) ;; definition for method 0 of type cpad-list diff --git a/test/decompiler/reference/jak1/engine/ps2/rpc-h_REF.gc b/test/decompiler/reference/jak1/engine/ps2/rpc-h_REF.gc index 3db3e761f0..dd0eed447f 100644 --- a/test/decompiler/reference/jak1/engine/ps2/rpc-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/rpc-h_REF.gc @@ -19,15 +19,15 @@ ) ;; definition for method 3 of type rpc-buffer -(defmethod inspect rpc-buffer ((obj rpc-buffer)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Telt-size: ~D~%" (-> obj elt-size)) - (format #t "~Telt-count: ~D~%" (-> obj elt-count)) - (format #t "~Telt-used: ~D~%" (-> obj elt-used)) - (format #t "~Tbusy: ~A~%" (-> obj busy)) - (format #t "~Tbase: ~D~%" (-> obj base)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect rpc-buffer ((this rpc-buffer)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Telt-size: ~D~%" (-> this elt-size)) + (format #t "~Telt-count: ~D~%" (-> this elt-count)) + (format #t "~Telt-used: ~D~%" (-> this elt-used)) + (format #t "~Tbusy: ~A~%" (-> this busy)) + (format #t "~Tbase: ~D~%" (-> this base)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; definition for method 0 of type rpc-buffer @@ -66,13 +66,13 @@ ) ;; definition for method 3 of type rpc-buffer-pair -(defmethod inspect rpc-buffer-pair ((obj rpc-buffer-pair)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tbuffer[2] @ #x~X~%" (-> obj buffer)) - (format #t "~Tcurrent: ~A~%" (-> obj current)) - (format #t "~Tlast-recv-buffer: #x~X~%" (-> obj last-recv-buffer)) - (format #t "~Trpc-port: ~D~%" (-> obj rpc-port)) - obj +(defmethod inspect rpc-buffer-pair ((this rpc-buffer-pair)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tbuffer[2] @ #x~X~%" (-> this buffer)) + (format #t "~Tcurrent: ~A~%" (-> this current)) + (format #t "~Tlast-recv-buffer: #x~X~%" (-> this last-recv-buffer)) + (format #t "~Trpc-port: ~D~%" (-> this rpc-port)) + this ) ;; definition for method 0 of type rpc-buffer-pair @@ -88,19 +88,19 @@ ) ;; definition for method 12 of type rpc-buffer-pair -(defmethod sync rpc-buffer-pair ((obj rpc-buffer-pair) (arg0 symbol)) - (let ((s5-0 (if (= (-> obj current) (-> obj buffer 0)) - (-> obj buffer 1) - (-> obj buffer 0) +(defmethod sync rpc-buffer-pair ((this rpc-buffer-pair) (arg0 symbol)) + (let ((s5-0 (if (= (-> this current) (-> this buffer 0)) + (-> this buffer 1) + (-> this buffer 0) ) ) ) (when (-> s5-0 busy) - (when (nonzero? (rpc-busy? (-> obj rpc-port))) + (when (nonzero? (rpc-busy? (-> this rpc-port))) (if arg0 - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) ) - (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (while (nonzero? (rpc-busy? (-> this rpc-port))) (nop!) (nop!) (nop!) @@ -120,15 +120,15 @@ ) ;; definition for method 13 of type rpc-buffer-pair -(defmethod check-busy rpc-buffer-pair ((obj rpc-buffer-pair)) - (let ((gp-0 (if (= (-> obj current) (-> obj buffer 0)) - (-> obj buffer 1) - (-> obj buffer 0) +(defmethod check-busy rpc-buffer-pair ((this rpc-buffer-pair)) + (let ((gp-0 (if (= (-> this current) (-> this buffer 0)) + (-> this buffer 1) + (-> this buffer 0) ) ) ) (when (-> gp-0 busy) - (if (nonzero? (rpc-busy? (-> obj rpc-port))) + (if (nonzero? (rpc-busy? (-> this rpc-port))) (return #t) ) (set! (-> gp-0 busy) #f) @@ -140,18 +140,18 @@ ) ;; definition for method 9 of type rpc-buffer-pair -(defmethod call rpc-buffer-pair ((obj rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) - (when (nonzero? (-> obj current elt-used)) - (let ((s2-0 (if (= (-> obj current) (-> obj buffer 0)) - (-> obj buffer 1) - (-> obj buffer 0) +(defmethod call rpc-buffer-pair ((this rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) + (when (nonzero? (-> this current elt-used)) + (let ((s2-0 (if (= (-> this current) (-> this buffer 0)) + (-> this buffer 1) + (-> this buffer 0) ) ) ) (when (-> s2-0 busy) - (when (nonzero? (rpc-busy? (-> obj rpc-port))) - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) - (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (when (nonzero? (rpc-busy? (-> this rpc-port))) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) + (while (nonzero? (rpc-busy? (-> this rpc-port))) (nop!) (nop!) (nop!) @@ -166,9 +166,9 @@ (set! (-> s2-0 elt-used) (the-as uint 0)) 0 ) - (let ((s1-0 (-> obj current))) + (let ((s1-0 (-> this current))) (rpc-call - (-> obj rpc-port) + (-> this rpc-port) arg0 (the-as uint 1) (the-as uint (-> s1-0 base)) @@ -178,30 +178,30 @@ ) (set! (-> s1-0 busy) #t) ) - (set! (-> obj last-recv-buffer) arg1) - (set! (-> obj current) s2-0) + (set! (-> this last-recv-buffer) arg1) + (set! (-> this current) s2-0) ) ) 0 ) ;; definition for method 14 of type rpc-buffer-pair -(defmethod pop-last-received rpc-buffer-pair ((obj rpc-buffer-pair)) - (let ((v0-0 (-> obj last-recv-buffer))) - (set! (-> obj last-recv-buffer) (the-as pointer #f)) +(defmethod pop-last-received rpc-buffer-pair ((this rpc-buffer-pair)) + (let ((v0-0 (-> this last-recv-buffer))) + (set! (-> this last-recv-buffer) (the-as pointer #f)) v0-0 ) ) ;; definition for method 10 of type rpc-buffer-pair -(defmethod add-element rpc-buffer-pair ((obj rpc-buffer-pair)) - (let ((v1-0 (-> obj current))) +(defmethod add-element rpc-buffer-pair ((this rpc-buffer-pair)) + (let ((v1-0 (-> this current))) (when (= (-> v1-0 elt-used) (-> v1-0 elt-count)) - (if (zero? (-> obj rpc-port)) + (if (zero? (-> this rpc-port)) (format 0 "WARNING: too many sound commands queued~%") ) - (call obj (the-as uint 0) (the-as pointer 0) (the-as uint 0)) - (set! v1-0 (-> obj current)) + (call this (the-as uint 0) (the-as pointer 0) (the-as uint 0)) + (set! v1-0 (-> this current)) ) (let ((v0-2 (&+ (-> v1-0 base) (* (-> v1-0 elt-used) (-> v1-0 elt-size))))) (+! (-> v1-0 elt-used) 1) @@ -211,9 +211,9 @@ ) ;; definition for method 11 of type rpc-buffer-pair -(defmethod decrement-elt-used rpc-buffer-pair ((obj rpc-buffer-pair)) - (if (> (-> obj current elt-used) 0) - (+! (-> obj current elt-used) -1) +(defmethod decrement-elt-used rpc-buffer-pair ((this rpc-buffer-pair)) + (if (> (-> this current elt-used) 0) + (+! (-> this current elt-used) -1) ) 0 ) diff --git a/test/decompiler/reference/jak1/engine/ps2/timer-h_REF.gc b/test/decompiler/reference/jak1/engine/ps2/timer-h_REF.gc index 76c634759a..61f8d2ad41 100644 --- a/test/decompiler/reference/jak1/engine/ps2/timer-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/timer-h_REF.gc @@ -31,12 +31,12 @@ ) ;; definition for method 3 of type timer-bank -(defmethod inspect timer-bank ((obj timer-bank)) - (format #t "[~8x] ~A~%" obj 'timer-bank) - (format #t "~Tcount: #x~X~%" (-> obj count)) - (format #t "~Tmode: #x~X~%" (-> obj mode)) - (format #t "~Tcomp: #x~X~%" (-> obj comp)) - obj +(defmethod inspect timer-bank ((this timer-bank)) + (format #t "[~8x] ~A~%" this 'timer-bank) + (format #t "~Tcount: #x~X~%" (-> this count)) + (format #t "~Tmode: #x~X~%" (-> this mode)) + (format #t "~Tcomp: #x~X~%" (-> this comp)) + this ) ;; definition of type timer-hold-bank @@ -49,13 +49,13 @@ ) ;; definition for method 3 of type timer-hold-bank -(defmethod inspect timer-hold-bank ((obj timer-hold-bank)) - (format #t "[~8x] ~A~%" obj 'timer-hold-bank) - (format #t "~Tcount: #x~X~%" (-> obj count)) - (format #t "~Tmode: #x~X~%" (-> obj mode)) - (format #t "~Tcomp: #x~X~%" (-> obj comp)) - (format #t "~Thold: #x~X~%" (-> obj hold)) - obj +(defmethod inspect timer-hold-bank ((this timer-hold-bank)) + (format #t "[~8x] ~A~%" this 'timer-hold-bank) + (format #t "~Tcount: #x~X~%" (-> this count)) + (format #t "~Tmode: #x~X~%" (-> this mode)) + (format #t "~Tcomp: #x~X~%" (-> this comp)) + (format #t "~Thold: #x~X~%" (-> this hold)) + this ) ;; definition of type stopwatch @@ -70,12 +70,12 @@ ) ;; definition for method 3 of type stopwatch -(defmethod inspect stopwatch ((obj stopwatch)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tprev-time-elapsed: ~D~%" (-> obj prev-time-elapsed)) - (format #t "~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~Tbegin-level: ~D~%" (-> obj begin-level)) - obj +(defmethod inspect stopwatch ((this stopwatch)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tprev-time-elapsed: ~D~%" (-> this prev-time-elapsed)) + (format #t "~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~Tbegin-level: ~D~%" (-> this begin-level)) + this ) ;; definition for symbol *ticks-per-frame*, type int @@ -107,22 +107,22 @@ ;; definition for method 3 of type profile-frame ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect profile-frame ((obj profile-frame)) - (format #t "[~8x] ~A~%" obj 'profile-frame) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Ttime-stamp: ~D~%" (-> obj time-stamp)) - (format #t "~Tcolor: ~D~%" (-> obj color)) - obj +(defmethod inspect profile-frame ((this profile-frame)) + (format #t "[~8x] ~A~%" this 'profile-frame) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Ttime-stamp: ~D~%" (-> this time-stamp)) + (format #t "~Tcolor: ~D~%" (-> this color)) + this ) ;; definition for method 3 of type profile-frame ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect profile-frame ((obj profile-frame)) - (format #t "[~8x] profile-frame~%" obj) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Ttime-stamp: ~D~%" (-> obj time-stamp)) - (format #t "~Tcolor: ~D ~D ~D~%" (-> obj color r) (-> obj color g) (-> obj color b)) - obj +(defmethod inspect profile-frame ((this profile-frame)) + (format #t "[~8x] profile-frame~%" this) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Ttime-stamp: ~D~%" (-> this time-stamp)) + (format #t "~Tcolor: ~D ~D ~D~%" (-> this color r) (-> this color g) (-> this color b)) + this ) ;; definition of type profile-bar @@ -145,17 +145,17 @@ ) ;; definition for method 3 of type profile-bar -(defmethod inspect profile-bar ((obj profile-bar)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tprofile-frame-count: ~D~%" (-> obj profile-frame-count)) - (format #t "~Tcache-time: ~D~%" (-> obj cache-time)) - (format #t "~Tdata[1024] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect profile-bar ((this profile-bar)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tprofile-frame-count: ~D~%" (-> this profile-frame-count)) + (format #t "~Tcache-time: ~D~%" (-> this cache-time)) + (format #t "~Tdata[1024] @ #x~X~%" (-> this data)) + this ) ;; definition for method 9 of type profile-bar -(defmethod get-last-frame-time-stamp profile-bar ((obj profile-bar)) - (-> obj data (+ (-> obj profile-frame-count) -2) time-stamp) +(defmethod get-last-frame-time-stamp profile-bar ((this profile-bar)) + (-> this data (+ (-> this profile-frame-count) -2) time-stamp) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/ps2/vif-h_REF.gc b/test/decompiler/reference/jak1/engine/ps2/vif-h_REF.gc index 8bca32aee8..7dad2b46e7 100644 --- a/test/decompiler/reference/jak1/engine/ps2/vif-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ps2/vif-h_REF.gc @@ -20,19 +20,19 @@ ) ;; definition for method 3 of type vif-stat -(defmethod inspect vif-stat ((obj vif-stat)) - (format #t "[~8x] ~A~%" obj 'vif-stat) - (format #t "~Tvps: ~D~%" (-> obj vps)) - (format #t "~Tvew: ~D~%" (-> obj vew)) - (format #t "~Tmrk: ~D~%" (-> obj mrk)) - (format #t "~Tvss: ~D~%" (-> obj vss)) - (format #t "~Tvfs: ~D~%" (-> obj vfs)) - (format #t "~Tvis: ~D~%" (-> obj vis)) - (format #t "~Tint: ~D~%" (-> obj int)) - (format #t "~Ter0: ~D~%" (-> obj er0)) - (format #t "~Ter1: ~D~%" (-> obj er1)) - (format #t "~Tfqc: ~D~%" (-> obj fqc)) - obj +(defmethod inspect vif-stat ((this vif-stat)) + (format #t "[~8x] ~A~%" this 'vif-stat) + (format #t "~Tvps: ~D~%" (-> this vps)) + (format #t "~Tvew: ~D~%" (-> this vew)) + (format #t "~Tmrk: ~D~%" (-> this mrk)) + (format #t "~Tvss: ~D~%" (-> this vss)) + (format #t "~Tvfs: ~D~%" (-> this vfs)) + (format #t "~Tvis: ~D~%" (-> this vis)) + (format #t "~Tint: ~D~%" (-> this int)) + (format #t "~Ter0: ~D~%" (-> this er0)) + (format #t "~Ter1: ~D~%" (-> this er1)) + (format #t "~Tfqc: ~D~%" (-> this fqc)) + this ) ;; definition of type vif-fbrst @@ -90,32 +90,32 @@ ) ;; definition for method 3 of type vif-bank -(defmethod inspect vif-bank ((obj vif-bank)) - (format #t "[~8x] ~A~%" obj 'vif-bank) - (format #t "~Tstat: #x~X~%" (-> obj stat)) - (format #t "~Tfbrst: #x~X~%" (-> obj fbrst)) - (format #t "~Terr: #x~X~%" (-> obj err)) - (format #t "~Tmark: #x~X~%" (-> obj mark)) - (format #t "~Tcycle: #x~X~%" (-> obj cycle)) - (format #t "~Tmode: #x~X~%" (-> obj mode)) - (format #t "~Tnum: #x~X~%" (-> obj num)) - (format #t "~Tmask: #x~X~%" (-> obj mask)) - (format #t "~Tcode: #x~X~%" (-> obj code)) - (format #t "~Titops: #x~X~%" (-> obj itops)) - (format #t "~Tbase: #x~X~%" (-> obj base)) - (format #t "~Toffset: #x~X~%" (-> obj offset)) - (format #t "~Ttops: #x~X~%" (-> obj tops)) - (format #t "~Titop: #x~X~%" (-> obj itop)) - (format #t "~Ttop: #x~X~%" (-> obj top)) - (format #t "~Tr0: #x~X~%" (-> obj r0)) - (format #t "~Tr1: #x~X~%" (-> obj r1)) - (format #t "~Tr2: #x~X~%" (-> obj r2)) - (format #t "~Tr3: #x~X~%" (-> obj r3)) - (format #t "~Tc0: #x~X~%" (-> obj c0)) - (format #t "~Tc1: #x~X~%" (-> obj c1)) - (format #t "~Tc2: #x~X~%" (-> obj c2)) - (format #t "~Tc3: #x~X~%" (-> obj c3)) - obj +(defmethod inspect vif-bank ((this vif-bank)) + (format #t "[~8x] ~A~%" this 'vif-bank) + (format #t "~Tstat: #x~X~%" (-> this stat)) + (format #t "~Tfbrst: #x~X~%" (-> this fbrst)) + (format #t "~Terr: #x~X~%" (-> this err)) + (format #t "~Tmark: #x~X~%" (-> this mark)) + (format #t "~Tcycle: #x~X~%" (-> this cycle)) + (format #t "~Tmode: #x~X~%" (-> this mode)) + (format #t "~Tnum: #x~X~%" (-> this num)) + (format #t "~Tmask: #x~X~%" (-> this mask)) + (format #t "~Tcode: #x~X~%" (-> this code)) + (format #t "~Titops: #x~X~%" (-> this itops)) + (format #t "~Tbase: #x~X~%" (-> this base)) + (format #t "~Toffset: #x~X~%" (-> this offset)) + (format #t "~Ttops: #x~X~%" (-> this tops)) + (format #t "~Titop: #x~X~%" (-> this itop)) + (format #t "~Ttop: #x~X~%" (-> this top)) + (format #t "~Tr0: #x~X~%" (-> this r0)) + (format #t "~Tr1: #x~X~%" (-> this r1)) + (format #t "~Tr2: #x~X~%" (-> this r2)) + (format #t "~Tr3: #x~X~%" (-> this r3)) + (format #t "~Tc0: #x~X~%" (-> this c0)) + (format #t "~Tc1: #x~X~%" (-> this c1)) + (format #t "~Tc2: #x~X~%" (-> this c2)) + (format #t "~Tc3: #x~X~%" (-> this c3)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/sound/gsound-h_REF.gc b/test/decompiler/reference/jak1/engine/sound/gsound-h_REF.gc index ef2febd5c9..7ef504a8b7 100644 --- a/test/decompiler/reference/jak1/engine/sound/gsound-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/sound/gsound-h_REF.gc @@ -41,11 +41,11 @@ ) ;; definition for method 3 of type sound-rpc-cmd -(defmethod inspect sound-rpc-cmd ((obj sound-rpc-cmd)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-cmd) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - obj +(defmethod inspect sound-rpc-cmd ((this sound-rpc-cmd)) + (format #t "[~8x] ~A~%" this 'sound-rpc-cmd) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + this ) ;; definition of type sound-play-parms @@ -68,19 +68,19 @@ ) ;; definition for method 3 of type sound-play-parms -(defmethod inspect sound-play-parms ((obj sound-play-parms)) - (format #t "[~8x] ~A~%" obj 'sound-play-parms) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tpitch-mod: ~D~%" (-> obj pitch-mod)) - (format #t "~Tbend: ~D~%" (-> obj bend)) - (format #t "~Tfo-min: ~D~%" (-> obj fo-min)) - (format #t "~Tfo-max: ~D~%" (-> obj fo-max)) - (format #t "~Tfo-curve: ~D~%" (-> obj fo-curve)) - (format #t "~Tpriority: ~D~%" (-> obj priority)) - (format #t "~Tvolume: ~D~%" (-> obj volume)) - (format #t "~Ttrans[3] @ #x~X~%" (-> obj trans)) - (format #t "~Tgroup: ~D~%" (-> obj group)) - obj +(defmethod inspect sound-play-parms ((this sound-play-parms)) + (format #t "[~8x] ~A~%" this 'sound-play-parms) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tpitch-mod: ~D~%" (-> this pitch-mod)) + (format #t "~Tbend: ~D~%" (-> this bend)) + (format #t "~Tfo-min: ~D~%" (-> this fo-min)) + (format #t "~Tfo-max: ~D~%" (-> this fo-max)) + (format #t "~Tfo-curve: ~D~%" (-> this fo-curve)) + (format #t "~Tpriority: ~D~%" (-> this priority)) + (format #t "~Tvolume: ~D~%" (-> this volume)) + (format #t "~Ttrans[3] @ #x~X~%" (-> this trans)) + (format #t "~Tgroup: ~D~%" (-> this group)) + this ) ;; definition of type sound-rpc-bank-cmd @@ -94,12 +94,12 @@ ;; definition for method 3 of type sound-rpc-bank-cmd ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-bank-cmd ((obj sound-rpc-bank-cmd)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-bank-cmd) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tbank-name: ~D~%" (-> obj bank-name)) - obj +(defmethod inspect sound-rpc-bank-cmd ((this sound-rpc-bank-cmd)) + (format #t "[~8x] ~A~%" this 'sound-rpc-bank-cmd) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tbank-name: ~D~%" (-> this bank-name)) + this ) ;; definition of type sound-rpc-sound-cmd @@ -112,12 +112,12 @@ ) ;; definition for method 3 of type sound-rpc-sound-cmd -(defmethod inspect sound-rpc-sound-cmd ((obj sound-rpc-sound-cmd)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-sound-cmd) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tid: ~D~%" (-> obj id)) - obj +(defmethod inspect sound-rpc-sound-cmd ((this sound-rpc-sound-cmd)) + (format #t "[~8x] ~A~%" this 'sound-rpc-sound-cmd) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tid: ~D~%" (-> this id)) + this ) ;; definition of type sound-rpc-group-cmd @@ -130,12 +130,12 @@ ) ;; definition for method 3 of type sound-rpc-group-cmd -(defmethod inspect sound-rpc-group-cmd ((obj sound-rpc-group-cmd)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-group-cmd) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tgroup: ~D~%" (-> obj group)) - obj +(defmethod inspect sound-rpc-group-cmd ((this sound-rpc-group-cmd)) + (format #t "[~8x] ~A~%" this 'sound-rpc-group-cmd) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tgroup: ~D~%" (-> this group)) + this ) ;; definition of type sound-rpc-load-bank @@ -148,12 +148,12 @@ ;; definition for method 3 of type sound-rpc-load-bank ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-load-bank ((obj sound-rpc-load-bank)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-load-bank) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tbank-name: ~D~%" (-> obj bank-name)) - obj +(defmethod inspect sound-rpc-load-bank ((this sound-rpc-load-bank)) + (format #t "[~8x] ~A~%" this 'sound-rpc-load-bank) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tbank-name: ~D~%" (-> this bank-name)) + this ) ;; definition of type sound-rpc-load-music @@ -166,12 +166,12 @@ ;; definition for method 3 of type sound-rpc-load-music ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-load-music ((obj sound-rpc-load-music)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-load-music) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tbank-name: ~D~%" (-> obj bank-name)) - obj +(defmethod inspect sound-rpc-load-music ((this sound-rpc-load-music)) + (format #t "[~8x] ~A~%" this 'sound-rpc-load-music) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tbank-name: ~D~%" (-> this bank-name)) + this ) ;; definition of type sound-rpc-unload-bank @@ -184,12 +184,12 @@ ;; definition for method 3 of type sound-rpc-unload-bank ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-unload-bank ((obj sound-rpc-unload-bank)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-unload-bank) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tbank-name: ~D~%" (-> obj bank-name)) - obj +(defmethod inspect sound-rpc-unload-bank ((this sound-rpc-unload-bank)) + (format #t "[~8x] ~A~%" this 'sound-rpc-unload-bank) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tbank-name: ~D~%" (-> this bank-name)) + this ) ;; definition of type sound-rpc-play @@ -204,14 +204,14 @@ ;; definition for method 3 of type sound-rpc-play ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-play ((obj sound-rpc-play)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-play) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tname: ~D~%" (-> obj name)) - (format #t "~Tparms: #~%" (-> obj parms)) - obj +(defmethod inspect sound-rpc-play ((this sound-rpc-play)) + (format #t "[~8x] ~A~%" this 'sound-rpc-play) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tname: ~D~%" (-> this name)) + (format #t "~Tparms: #~%" (-> this parms)) + this ) ;; definition of type sound-rpc-pause-sound @@ -223,12 +223,12 @@ ) ;; definition for method 3 of type sound-rpc-pause-sound -(defmethod inspect sound-rpc-pause-sound ((obj sound-rpc-pause-sound)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-pause-sound) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tid: ~D~%" (-> obj id)) - obj +(defmethod inspect sound-rpc-pause-sound ((this sound-rpc-pause-sound)) + (format #t "[~8x] ~A~%" this 'sound-rpc-pause-sound) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tid: ~D~%" (-> this id)) + this ) ;; definition of type sound-rpc-stop-sound @@ -240,12 +240,12 @@ ) ;; definition for method 3 of type sound-rpc-stop-sound -(defmethod inspect sound-rpc-stop-sound ((obj sound-rpc-stop-sound)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-stop-sound) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tid: ~D~%" (-> obj id)) - obj +(defmethod inspect sound-rpc-stop-sound ((this sound-rpc-stop-sound)) + (format #t "[~8x] ~A~%" this 'sound-rpc-stop-sound) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tid: ~D~%" (-> this id)) + this ) ;; definition of type sound-rpc-continue-sound @@ -257,12 +257,12 @@ ) ;; definition for method 3 of type sound-rpc-continue-sound -(defmethod inspect sound-rpc-continue-sound ((obj sound-rpc-continue-sound)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-continue-sound) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tid: ~D~%" (-> obj id)) - obj +(defmethod inspect sound-rpc-continue-sound ((this sound-rpc-continue-sound)) + (format #t "[~8x] ~A~%" this 'sound-rpc-continue-sound) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tid: ~D~%" (-> this id)) + this ) ;; definition of type sound-rpc-set-param @@ -277,15 +277,15 @@ ) ;; definition for method 3 of type sound-rpc-set-param -(defmethod inspect sound-rpc-set-param ((obj sound-rpc-set-param)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-param) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Tparms: #~%" (-> obj parms)) - (format #t "~Tauto-time: ~D~%" (-> obj auto-time)) - (format #t "~Tauto-from: ~D~%" (-> obj auto-from)) - obj +(defmethod inspect sound-rpc-set-param ((this sound-rpc-set-param)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-param) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Tparms: #~%" (-> this parms)) + (format #t "~Tauto-time: ~D~%" (-> this auto-time)) + (format #t "~Tauto-from: ~D~%" (-> this auto-from)) + this ) ;; definition of type sound-rpc-set-master-volume @@ -298,13 +298,13 @@ ) ;; definition for method 3 of type sound-rpc-set-master-volume -(defmethod inspect sound-rpc-set-master-volume ((obj sound-rpc-set-master-volume)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-master-volume) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tgroup: ~D~%" (-> obj group)) - (format #t "~Tvolume: ~D~%" (-> obj volume)) - obj +(defmethod inspect sound-rpc-set-master-volume ((this sound-rpc-set-master-volume)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-master-volume) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tgroup: ~D~%" (-> this group)) + (format #t "~Tvolume: ~D~%" (-> this volume)) + this ) ;; definition of type sound-rpc-pause-group @@ -316,12 +316,12 @@ ) ;; definition for method 3 of type sound-rpc-pause-group -(defmethod inspect sound-rpc-pause-group ((obj sound-rpc-pause-group)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-pause-group) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tgroup: ~D~%" (-> obj group)) - obj +(defmethod inspect sound-rpc-pause-group ((this sound-rpc-pause-group)) + (format #t "[~8x] ~A~%" this 'sound-rpc-pause-group) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tgroup: ~D~%" (-> this group)) + this ) ;; definition of type sound-rpc-stop-group @@ -333,12 +333,12 @@ ) ;; definition for method 3 of type sound-rpc-stop-group -(defmethod inspect sound-rpc-stop-group ((obj sound-rpc-stop-group)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-stop-group) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tgroup: ~D~%" (-> obj group)) - obj +(defmethod inspect sound-rpc-stop-group ((this sound-rpc-stop-group)) + (format #t "[~8x] ~A~%" this 'sound-rpc-stop-group) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tgroup: ~D~%" (-> this group)) + this ) ;; definition of type sound-rpc-continue-group @@ -350,12 +350,12 @@ ) ;; definition for method 3 of type sound-rpc-continue-group -(defmethod inspect sound-rpc-continue-group ((obj sound-rpc-continue-group)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-continue-group) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tgroup: ~D~%" (-> obj group)) - obj +(defmethod inspect sound-rpc-continue-group ((this sound-rpc-continue-group)) + (format #t "[~8x] ~A~%" this 'sound-rpc-continue-group) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tgroup: ~D~%" (-> this group)) + this ) ;; definition of type sound-rpc-get-irx-version @@ -370,14 +370,14 @@ ) ;; definition for method 3 of type sound-rpc-get-irx-version -(defmethod inspect sound-rpc-get-irx-version ((obj sound-rpc-get-irx-version)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-get-irx-version) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tmajor: ~D~%" (-> obj major)) - (format #t "~Tminor: ~D~%" (-> obj minor)) - (format #t "~Tee-addr: ~D~%" (-> obj ee-addr)) - obj +(defmethod inspect sound-rpc-get-irx-version ((this sound-rpc-get-irx-version)) + (format #t "[~8x] ~A~%" this 'sound-rpc-get-irx-version) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tmajor: ~D~%" (-> this major)) + (format #t "~Tminor: ~D~%" (-> this minor)) + (format #t "~Tee-addr: ~D~%" (-> this ee-addr)) + this ) ;; definition of type sound-rpc-set-language @@ -390,12 +390,12 @@ ) ;; definition for method 3 of type sound-rpc-set-language -(defmethod inspect sound-rpc-set-language ((obj sound-rpc-set-language)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-language) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tlang: ~D~%" (-> obj lang)) - obj +(defmethod inspect sound-rpc-set-language ((this sound-rpc-set-language)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-language) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tlang: ~D~%" (-> this lang)) + this ) ;; definition of type sound-rpc-set-falloff-curve @@ -410,14 +410,14 @@ ) ;; definition for method 3 of type sound-rpc-set-falloff-curve -(defmethod inspect sound-rpc-set-falloff-curve ((obj sound-rpc-set-falloff-curve)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-falloff-curve) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tcurve: ~D~%" (-> obj curve)) - (format #t "~Tfalloff: ~D~%" (-> obj falloff)) - (format #t "~Tease: ~D~%" (-> obj ease)) - obj +(defmethod inspect sound-rpc-set-falloff-curve ((this sound-rpc-set-falloff-curve)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-falloff-curve) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tcurve: ~D~%" (-> this curve)) + (format #t "~Tfalloff: ~D~%" (-> this falloff)) + (format #t "~Tease: ~D~%" (-> this ease)) + this ) ;; definition of type sound-rpc-set-sound-falloff @@ -434,15 +434,15 @@ ;; definition for method 3 of type sound-rpc-set-sound-falloff ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-set-sound-falloff ((obj sound-rpc-set-sound-falloff)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-sound-falloff) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tname: ~D~%" (-> obj name)) - (format #t "~Tcurve: ~D~%" (-> obj curve)) - (format #t "~Tmin: ~D~%" (-> obj min)) - (format #t "~Tmax: ~D~%" (-> obj max)) - obj +(defmethod inspect sound-rpc-set-sound-falloff ((this sound-rpc-set-sound-falloff)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-sound-falloff) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tname: ~D~%" (-> this name)) + (format #t "~Tcurve: ~D~%" (-> this curve)) + (format #t "~Tmin: ~D~%" (-> this min)) + (format #t "~Tmax: ~D~%" (-> this max)) + this ) ;; definition of type sound-rpc-reload-info @@ -454,11 +454,11 @@ ) ;; definition for method 3 of type sound-rpc-reload-info -(defmethod inspect sound-rpc-reload-info ((obj sound-rpc-reload-info)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-reload-info) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - obj +(defmethod inspect sound-rpc-reload-info ((this sound-rpc-reload-info)) + (format #t "[~8x] ~A~%" this 'sound-rpc-reload-info) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + this ) ;; definition of type sound-rpc-set-reverb @@ -474,15 +474,15 @@ ) ;; definition for method 3 of type sound-rpc-set-reverb -(defmethod inspect sound-rpc-set-reverb ((obj sound-rpc-set-reverb)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-reverb) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tcore: ~D~%" (-> obj core)) - (format #t "~Treverb: ~D~%" (-> obj reverb)) - (format #t "~Tleft: ~D~%" (-> obj left)) - (format #t "~Tright: ~D~%" (-> obj right)) - obj +(defmethod inspect sound-rpc-set-reverb ((this sound-rpc-set-reverb)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-reverb) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tcore: ~D~%" (-> this core)) + (format #t "~Treverb: ~D~%" (-> this reverb)) + (format #t "~Tleft: ~D~%" (-> this left)) + (format #t "~Tright: ~D~%" (-> this right)) + this ) ;; definition of type sound-rpc-set-ear-trans @@ -497,14 +497,14 @@ ) ;; definition for method 3 of type sound-rpc-set-ear-trans -(defmethod inspect sound-rpc-set-ear-trans ((obj sound-rpc-set-ear-trans)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-ear-trans) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tear-trans[3] @ #x~X~%" (-> obj ear-trans)) - (format #t "~Tcam-trans[3] @ #x~X~%" (-> obj cam-trans)) - (format #t "~Tcam-angle: ~D~%" (-> obj cam-angle)) - obj +(defmethod inspect sound-rpc-set-ear-trans ((this sound-rpc-set-ear-trans)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-ear-trans) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tear-trans[3] @ #x~X~%" (-> this ear-trans)) + (format #t "~Tcam-trans[3] @ #x~X~%" (-> this cam-trans)) + (format #t "~Tcam-angle: ~D~%" (-> this cam-angle)) + this ) ;; definition of type sound-rpc-set-flava @@ -517,12 +517,12 @@ ) ;; definition for method 3 of type sound-rpc-set-flava -(defmethod inspect sound-rpc-set-flava ((obj sound-rpc-set-flava)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-flava) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - (format #t "~Tflava: ~D~%" (-> obj flava)) - obj +(defmethod inspect sound-rpc-set-flava ((this sound-rpc-set-flava)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-flava) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + (format #t "~Tflava: ~D~%" (-> this flava)) + this ) ;; definition of type sound-rpc-shutdown @@ -534,11 +534,11 @@ ) ;; definition for method 3 of type sound-rpc-shutdown -(defmethod inspect sound-rpc-shutdown ((obj sound-rpc-shutdown)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-shutdown) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - obj +(defmethod inspect sound-rpc-shutdown ((this sound-rpc-shutdown)) + (format #t "[~8x] ~A~%" this 'sound-rpc-shutdown) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + this ) ;; definition of type sound-rpc-list-sounds @@ -550,11 +550,11 @@ ) ;; definition for method 3 of type sound-rpc-list-sounds -(defmethod inspect sound-rpc-list-sounds ((obj sound-rpc-list-sounds)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-list-sounds) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - obj +(defmethod inspect sound-rpc-list-sounds ((this sound-rpc-list-sounds)) + (format #t "[~8x] ~A~%" this 'sound-rpc-list-sounds) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + this ) ;; definition of type sound-rpc-unload-music @@ -566,11 +566,11 @@ ) ;; definition for method 3 of type sound-rpc-unload-music -(defmethod inspect sound-rpc-unload-music ((obj sound-rpc-unload-music)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-unload-music) - (format #t "~Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~Tcommand: ~D~%" (-> obj command)) - obj +(defmethod inspect sound-rpc-unload-music ((this sound-rpc-unload-music)) + (format #t "[~8x] ~A~%" this 'sound-rpc-unload-music) + (format #t "~Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~Tcommand: ~D~%" (-> this command)) + this ) ;; definition of type sound-rpc-union @@ -607,32 +607,32 @@ ) ;; definition for method 3 of type sound-rpc-union -(defmethod inspect sound-rpc-union ((obj sound-rpc-union)) - (format #t "[~8x] ~A~%" obj 'sound-rpc-union) - (format #t "~Tdata[20] @ #x~X~%" (-> obj data)) - (format #t "~Tload-bank: #~%" (-> obj load-bank)) - (format #t "~Tunload-bank: #~%" (-> obj load-bank)) - (format #t "~Tplay: #~%" (-> obj load-bank)) - (format #t "~Tpause-sound: #~%" (-> obj load-bank)) - (format #t "~Tstop-sound: #~%" (-> obj load-bank)) - (format #t "~Tcontinue-sound: #~%" (-> obj load-bank)) - (format #t "~Tset-param: #~%" (-> obj load-bank)) - (format #t "~Tset-master-volume: #~%" (-> obj load-bank)) - (format #t "~Tpause-group: #~%" (-> obj load-bank)) - (format #t "~Tstop-group: #~%" (-> obj load-bank)) - (format #t "~Tcontinue-group: #~%" (-> obj load-bank)) - (format #t "~Tget-irx-version: #~%" (-> obj load-bank)) - (format #t "~Tset-falloff-curve: #~%" (-> obj load-bank)) - (format #t "~Tset-sound-falloff: #~%" (-> obj load-bank)) - (format #t "~Treload-info: #~%" (-> obj load-bank)) - (format #t "~Tset-language: #~%" (-> obj load-bank)) - (format #t "~Tset-reverb: #~%" (-> obj load-bank)) - (format #t "~Tset-ear-trans: #~%" (-> obj load-bank)) - (format #t "~Tset-flava: #~%" (-> obj load-bank)) - (format #t "~Tshutdown: #~%" (-> obj load-bank)) - (format #t "~Tlist-sounds: #~%" (-> obj load-bank)) - (format #t "~Tunload-music: #~%" (-> obj load-bank)) - obj +(defmethod inspect sound-rpc-union ((this sound-rpc-union)) + (format #t "[~8x] ~A~%" this 'sound-rpc-union) + (format #t "~Tdata[20] @ #x~X~%" (-> this data)) + (format #t "~Tload-bank: #~%" (-> this load-bank)) + (format #t "~Tunload-bank: #~%" (-> this load-bank)) + (format #t "~Tplay: #~%" (-> this load-bank)) + (format #t "~Tpause-sound: #~%" (-> this load-bank)) + (format #t "~Tstop-sound: #~%" (-> this load-bank)) + (format #t "~Tcontinue-sound: #~%" (-> this load-bank)) + (format #t "~Tset-param: #~%" (-> this load-bank)) + (format #t "~Tset-master-volume: #~%" (-> this load-bank)) + (format #t "~Tpause-group: #~%" (-> this load-bank)) + (format #t "~Tstop-group: #~%" (-> this load-bank)) + (format #t "~Tcontinue-group: #~%" (-> this load-bank)) + (format #t "~Tget-irx-version: #~%" (-> this load-bank)) + (format #t "~Tset-falloff-curve: #~%" (-> this load-bank)) + (format #t "~Tset-sound-falloff: #~%" (-> this load-bank)) + (format #t "~Treload-info: #~%" (-> this load-bank)) + (format #t "~Tset-language: #~%" (-> this load-bank)) + (format #t "~Tset-reverb: #~%" (-> this load-bank)) + (format #t "~Tset-ear-trans: #~%" (-> this load-bank)) + (format #t "~Tset-flava: #~%" (-> this load-bank)) + (format #t "~Tshutdown: #~%" (-> this load-bank)) + (format #t "~Tlist-sounds: #~%" (-> this load-bank)) + (format #t "~Tunload-music: #~%" (-> this load-bank)) + this ) ;; definition of type sound-spec @@ -660,24 +660,24 @@ ;; definition for method 3 of type sound-spec ;; INFO: Used lq/sq -(defmethod inspect sound-spec ((obj sound-spec)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tnum: ~f~%" (-> obj num)) - (format #t "~Tgroup: ~D~%" (-> obj group)) - (format #t "~Tsound-name-char[16] @ #x~X~%" (&-> obj sound-name)) - (format #t "~Tsound-name: ~D~%" (-> obj sound-name)) - (format #t "~Ttrans[4] @ #x~X~%" (-> obj trans)) - (format #t "~Tvolume: ~D~%" (-> obj volume)) - (format #t "~Tpitch-mod: ~D~%" (-> obj pitch-mod)) - (format #t "~Tbend: ~D~%" (-> obj bend)) - (format #t "~Tfo-min: ~D~%" (-> obj fo-min)) - (format #t "~Tfo-max: ~D~%" (-> obj fo-max)) - (format #t "~Tfo-curve: ~D~%" (-> obj fo-curve)) - (format #t "~Tpriority: ~D~%" (-> obj priority)) - (format #t "~Tauto-time: ~D~%" (-> obj auto-time)) - (format #t "~Tauto-from: ~D~%" (-> obj auto-from)) - obj +(defmethod inspect sound-spec ((this sound-spec)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tnum: ~f~%" (-> this num)) + (format #t "~Tgroup: ~D~%" (-> this group)) + (format #t "~Tsound-name-char[16] @ #x~X~%" (&-> this sound-name)) + (format #t "~Tsound-name: ~D~%" (-> this sound-name)) + (format #t "~Ttrans[4] @ #x~X~%" (-> this trans)) + (format #t "~Tvolume: ~D~%" (-> this volume)) + (format #t "~Tpitch-mod: ~D~%" (-> this pitch-mod)) + (format #t "~Tbend: ~D~%" (-> this bend)) + (format #t "~Tfo-min: ~D~%" (-> this fo-min)) + (format #t "~Tfo-max: ~D~%" (-> this fo-max)) + (format #t "~Tfo-curve: ~D~%" (-> this fo-curve)) + (format #t "~Tpriority: ~D~%" (-> this priority)) + (format #t "~Tauto-time: ~D~%" (-> this auto-time)) + (format #t "~Tauto-from: ~D~%" (-> this auto-from)) + this ) ;; definition for symbol *current-sound-id*, type sound-id @@ -717,25 +717,25 @@ ;; definition for method 3 of type ambient-sound ;; INFO: Used lq/sq -(defmethod inspect ambient-sound ((obj ambient-sound)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tspec: ~A~%" (-> obj spec)) - (format #t "~Tplaying-id: ~D~%" (-> obj playing-id)) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Tname: ~D~%" (-> obj name)) - (format #t "~Tplay-time: ~D~%" (-> obj play-time)) - (format #t "~Ttime-base: ~D~%" (-> obj time-base)) - (format #t "~Ttime-random: ~D~%" (-> obj time-random)) - (format #t "~Tvolume: ~D~%" (-> obj volume)) - (format #t "~Tpitch: ~D~%" (-> obj pitch)) - (format #t "~Tfalloff-near: ~D~%" (-> obj falloff-near)) - (format #t "~Tfalloff-far: ~D~%" (-> obj falloff-far)) - (format #t "~Tfalloff-mode: ~D~%" (-> obj falloff-mode)) - (format #t "~Tparams: #x~X~%" (-> obj params)) - (format #t "~Tparam-count: ~D~%" (-> obj param-count)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tsound-count: ~D~%" (-> obj sound-count)) - obj +(defmethod inspect ambient-sound ((this ambient-sound)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tspec: ~A~%" (-> this spec)) + (format #t "~Tplaying-id: ~D~%" (-> this playing-id)) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Tname: ~D~%" (-> this name)) + (format #t "~Tplay-time: ~D~%" (-> this play-time)) + (format #t "~Ttime-base: ~D~%" (-> this time-base)) + (format #t "~Ttime-random: ~D~%" (-> this time-random)) + (format #t "~Tvolume: ~D~%" (-> this volume)) + (format #t "~Tpitch: ~D~%" (-> this pitch)) + (format #t "~Tfalloff-near: ~D~%" (-> this falloff-near)) + (format #t "~Tfalloff-far: ~D~%" (-> this falloff-far)) + (format #t "~Tfalloff-mode: ~D~%" (-> this falloff-mode)) + (format #t "~Tparams: #x~X~%" (-> this params)) + (format #t "~Tparam-count: ~D~%" (-> this param-count)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tsound-count: ~D~%" (-> this sound-count)) + this ) ;; definition for symbol *sound-bank-1*, type symbol diff --git a/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc index ef7d910fd3..955b41db60 100644 --- a/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak1/engine/sound/gsound_REF.gc @@ -35,23 +35,23 @@ ) ;; definition for method 3 of type sound-iop-info -(defmethod inspect sound-iop-info ((obj sound-iop-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tframe: ~D~%" (-> obj frame)) - (format #t "~Tstrpos: ~D~%" (-> obj strpos)) - (format #t "~Tstr-id: ~D~%" (-> obj str-id)) - (format #t "~Tstr-id-sign: ~D~%" (-> obj str-id-sign)) - (format #t "~Tfreemem: ~D~%" (-> obj freemem)) - (format #t "~Tchinfo[48] @ #x~X~%" (-> obj chinfo)) - (format #t "~Tfreemem2: ~D~%" (-> obj freemem2)) - (format #t "~Tnocd: ~D~%" (-> obj nocd)) - (format #t "~Tdirtycd: ~D~%" (-> obj dirtycd)) - (format #t "~Tdiskspeed[2] @ #x~X~%" (-> obj diskspeed)) - (format #t "~Tlastspeed: ~D~%" (-> obj lastspeed)) - (format #t "~Tdupseg: ~D~%" (-> obj dupseg)) - (format #t "~Ttimes[41] @ #x~X~%" (-> obj times)) - (format #t "~Ttimes-seq: ~D~%" (-> obj times-seq)) - obj +(defmethod inspect sound-iop-info ((this sound-iop-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tframe: ~D~%" (-> this frame)) + (format #t "~Tstrpos: ~D~%" (-> this strpos)) + (format #t "~Tstr-id: ~D~%" (-> this str-id)) + (format #t "~Tstr-id-sign: ~D~%" (-> this str-id-sign)) + (format #t "~Tfreemem: ~D~%" (-> this freemem)) + (format #t "~Tchinfo[48] @ #x~X~%" (-> this chinfo)) + (format #t "~Tfreemem2: ~D~%" (-> this freemem2)) + (format #t "~Tnocd: ~D~%" (-> this nocd)) + (format #t "~Tdirtycd: ~D~%" (-> this dirtycd)) + (format #t "~Tdiskspeed[2] @ #x~X~%" (-> this diskspeed)) + (format #t "~Tlastspeed: ~D~%" (-> this lastspeed)) + (format #t "~Tdupseg: ~D~%" (-> this dupseg)) + (format #t "~Ttimes[41] @ #x~X~%" (-> this times)) + (format #t "~Ttimes-seq: ~D~%" (-> this times-seq)) + this ) ;; definition for symbol *sound-iop-info*, type sound-iop-info @@ -675,35 +675,35 @@ ambient-sound (cond ((or sv-16 (nonzero? sv-32)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj spec) sv-16) - (set! (-> obj name) sv-32) - (set! (-> obj playing-id) (new-sound-id)) - (set! (-> obj params) (the-as (pointer float) sv-52)) - (set! (-> obj param-count) sv-56) - (set! (-> obj entity) #f) - (set! (-> obj sound-count) 1) - (set! (-> obj volume) 1024) - (set! (-> obj pitch) 0) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this spec) sv-16) + (set! (-> this name) sv-32) + (set! (-> this playing-id) (new-sound-id)) + (set! (-> this params) (the-as (pointer float) sv-52)) + (set! (-> this param-count) sv-56) + (set! (-> this entity) #f) + (set! (-> this sound-count) 1) + (set! (-> this volume) 1024) + (set! (-> this pitch) 0) (when (and sv-16 (!= sv-16 *ambient-spec*)) (if (logtest? (-> (the-as sound-spec sv-16) mask) (sound-mask volume)) - (set! (-> obj volume) (-> (the-as sound-spec sv-16) volume)) + (set! (-> this volume) (-> (the-as sound-spec sv-16) volume)) ) (if (logtest? (-> (the-as sound-spec sv-16) mask) (sound-mask pitch)) - (set! (-> obj pitch) (-> (the-as sound-spec sv-16) pitch-mod)) + (set! (-> this pitch) (-> (the-as sound-spec sv-16) pitch-mod)) ) ) (cond (sv-48 - (set! (-> obj time-base) (the-as time-frame (the int (* 300.0 (-> sv-48 0))))) - (set! (-> obj time-random) (the-as time-frame (the int (* 300.0 (-> sv-48 1))))) + (set! (-> this time-base) (the-as time-frame (the int (* 300.0 (-> sv-48 0))))) + (set! (-> this time-random) (the-as time-frame (the int (* 300.0 (-> sv-48 1))))) ) (else - (set! (-> obj time-base) -1) + (set! (-> this time-base) -1) ) ) - (set! (-> obj trans quad) (-> arg1 quad)) - obj + (set! (-> this trans quad) (-> arg1 quad)) + this ) ) (else @@ -715,39 +715,39 @@ ;; definition for method 9 of type ambient-sound ;; INFO: Used lq/sq -(defmethod update! ambient-sound ((obj ambient-sound)) +(defmethod update! ambient-sound ((this ambient-sound)) (with-pp (if (not *ambient-sound-class*) (return (the-as int #f)) ) (cond - ((-> obj spec) - (when (or (< (-> obj time-base) 0) (>= (-> *display* base-frame-counter) (-> obj play-time))) - (when (>= (-> obj time-base) 0) - (set! (-> obj play-time) - (+ (-> *display* base-frame-counter) (-> obj time-base) (rand-vu-int-count (the-as int (-> obj time-random)))) + ((-> this spec) + (when (or (< (-> this time-base) 0) (>= (current-time) (-> this play-time))) + (when (>= (-> this time-base) 0) + (set! (-> this play-time) + (+ (current-time) (-> this time-base) (rand-vu-int-count (the-as int (-> this time-random)))) ) - (set! (-> obj playing-id) (new-sound-id)) + (set! (-> this playing-id) (new-sound-id)) ) - (let ((spec (-> obj spec))) + (let ((spec (-> this spec))) (when (= spec *ambient-spec*) - (set! (-> spec volume) (-> obj volume)) - (set! (-> spec pitch-mod) (-> obj pitch)) + (set! (-> spec volume) (-> this volume)) + (set! (-> spec pitch-mod) (-> this pitch)) (set! (-> spec bend) 0) - (set! (-> spec sound-name) (-> obj name)) - (set! (-> spec fo-max) (-> obj falloff-far)) + (set! (-> spec sound-name) (-> this name)) + (set! (-> spec fo-max) (-> this falloff-far)) (set! (-> spec mask) (sound-mask)) - (if (-> obj params) - (effect-param->sound-spec spec (-> obj params) (-> obj param-count)) + (if (-> this params) + (effect-param->sound-spec spec (-> this params) (-> this param-count)) ) ) (if (and (nonzero? (-> spec fo-max)) - (< (* 4096.0 (the float (-> spec fo-max))) (vector-vector-distance (ear-trans) (-> obj trans))) + (< (* 4096.0 (the float (-> spec fo-max))) (vector-vector-distance (ear-trans) (-> this trans))) ) (return 0) ) - (when (and *debug-effect-control* (>= (-> obj time-base) 0)) - (format #t "(~5D) effect sound ~A ~G " (-> *display* base-frame-counter) (-> pp name) (&-> spec sound-name)) + (when (and *debug-effect-control* (>= (-> this time-base) 0)) + (format #t "(~5D) effect sound ~A ~G " (current-time) (-> pp name) (&-> spec sound-name)) (format #t "volume: ~f pitch-mod: ~f~%" @@ -756,40 +756,40 @@ ) ) (let ((spec-volume (-> spec volume))) - (set! (-> spec volume) (-> obj volume)) - (set! (-> obj playing-id) (sound-play-by-spec spec (-> obj playing-id) (-> obj trans))) + (set! (-> spec volume) (-> this volume)) + (set! (-> this playing-id) (sound-play-by-spec spec (-> this playing-id) (-> this trans))) (set! (-> spec volume) spec-volume) ) ) ) ) - ((< (-> obj time-base) 0) - (set! (-> obj playing-id) (sound-play-by-name - (-> obj name) - (-> obj playing-id) - (-> obj volume) - (-> obj pitch) - 0 - (sound-group sfx) - (the-as symbol (-> obj trans)) - ) + ((< (-> this time-base) 0) + (set! (-> this playing-id) (sound-play-by-name + (-> this name) + (-> this playing-id) + (-> this volume) + (-> this pitch) + 0 + (sound-group sfx) + (the-as symbol (-> this trans)) + ) ) ) (else - (when (>= (-> *display* base-frame-counter) (-> obj play-time)) - (set! (-> obj playing-id) + (when (>= (current-time) (-> this play-time)) + (set! (-> this playing-id) (sound-play-by-name - (-> obj name) + (-> this name) (new-sound-id) - (-> obj volume) - (-> obj pitch) + (-> this volume) + (-> this pitch) 0 (sound-group sfx) - (the-as symbol (-> obj trans)) + (the-as symbol (-> this trans)) ) ) - (set! (-> obj play-time) - (+ (-> *display* base-frame-counter) (-> obj time-base) (rand-vu-int-count (the-as int (-> obj time-random)))) + (set! (-> this play-time) + (+ (current-time) (-> this time-base) (rand-vu-int-count (the-as int (-> this time-random)))) ) ) ) @@ -799,20 +799,20 @@ ) ;; definition for method 13 of type ambient-sound -(defmethod stop! ambient-sound ((obj ambient-sound)) - (sound-stop (-> obj playing-id)) +(defmethod stop! ambient-sound ((this ambient-sound)) + (sound-stop (-> this playing-id)) 0 ) ;; definition for method 11 of type ambient-sound ;; INFO: Used lq/sq -(defmethod update-trans! ambient-sound ((obj ambient-sound) (arg0 vector)) +(defmethod update-trans! ambient-sound ((this ambient-sound) (arg0 vector)) (with-pp - (set! (-> obj trans quad) (-> arg0 quad)) - (when (nonzero? (-> obj playing-id)) + (set! (-> this trans quad) (-> arg0 quad)) + (when (nonzero? (-> this playing-id)) (let ((cmd (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command set-param)) - (set! (-> cmd id) (-> obj playing-id)) + (set! (-> cmd id) (-> this playing-id)) (let ((s4-1 pp)) (when (= arg0 #t) (if (and (the-as process-drawable s4-1) @@ -834,27 +834,27 @@ ) ;; definition for method 12 of type ambient-sound -(defmethod update-vol! ambient-sound ((obj ambient-sound) (arg0 int)) - (when (nonzero? (-> obj playing-id)) +(defmethod update-vol! ambient-sound ((this ambient-sound) (arg0 int)) + (when (nonzero? (-> this playing-id)) (let ((cmd (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> cmd command) (sound-command set-param)) - (set! (-> cmd id) (-> obj playing-id)) + (set! (-> cmd id) (-> this playing-id)) (set! (-> cmd parms volume) (the int (* 10.24 (the float arg0)))) (set! (-> cmd parms mask) (sound-mask volume)) (-> cmd id) ) ) - (set! (-> obj volume) (the int (* 10.24 (the float arg0)))) + (set! (-> this volume) (the int (* 10.24 (the float arg0)))) 0 ) ;; definition for method 10 of type ambient-sound ;; INFO: Used lq/sq -(defmethod change-sound! ambient-sound ((obj ambient-sound) (arg0 sound-name)) - (when (not (and (= (the-as uint (-> obj name)) (the-as uint arg0)) (= (-> arg0 hi) (-> obj name hi)))) - (stop! obj) - (set! (-> obj playing-id) (new-sound-id)) - (set! (-> obj name) arg0) +(defmethod change-sound! ambient-sound ((this ambient-sound) (arg0 sound-name)) + (when (not (and (= (the-as uint (-> this name)) (the-as uint arg0)) (= (-> arg0 hi) (-> this name hi)))) + (stop! this) + (set! (-> this playing-id) (new-sound-id)) + (set! (-> this name) arg0) ) 0 ) @@ -954,11 +954,11 @@ ) ;; definition for method 3 of type flava-table-row -(defmethod inspect flava-table-row ((obj flava-table-row)) - (format #t "[~8x] ~A~%" obj 'flava-table-row) - (format #t "~Tmusic: ~A~%" (-> obj music)) - (format #t "~Tflava[50] @ #x~X~%" (-> obj flava)) - obj +(defmethod inspect flava-table-row ((this flava-table-row)) + (format #t "[~8x] ~A~%" this 'flava-table-row) + (format #t "~Tmusic: ~A~%" (-> this music)) + (format #t "~Tflava[50] @ #x~X~%" (-> this flava)) + this ) ;; definition of type flava-table @@ -972,11 +972,11 @@ ) ;; definition for method 3 of type flava-table -(defmethod inspect flava-table ((obj flava-table)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Trow[20] @ #x~X~%" (-> obj row)) - (format #t "~Tcount: ~D~%" (-> obj count)) - obj +(defmethod inspect flava-table ((this flava-table)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Trow[20] @ #x~X~%" (-> this row)) + (format #t "~Tcount: ~D~%" (-> this count)) + this ) ;; definition for symbol *flava-table*, type flava-table diff --git a/test/decompiler/reference/jak1/engine/target/collide-reaction-target_REF.gc b/test/decompiler/reference/jak1/engine/target/collide-reaction-target_REF.gc index 92b6e1f836..00cdb26fbd 100644 --- a/test/decompiler/reference/jak1/engine/target/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/collide-reaction-target_REF.gc @@ -173,9 +173,9 @@ ) ) (set! sv-32 (logior sv-32 128)) - (set! (-> arg0 unknown-dword-coverage) (the-as int (-> *display* base-frame-counter))) + (set! (-> arg0 unknown-dword-coverage) (the-as int (current-time))) (set! sv-40 (logior sv-40 128)) - (set! (-> arg0 unknown-dword21) (-> *display* base-frame-counter)) + (set-time! (-> arg0 unknown-dword21)) (let ((f30-0 (vector-dot sv-52 (-> arg0 unknown-vector22))) (f0-21 (if (logtest? sv-32 2) (cos (- 16384.0 (acos (-> arg0 coverage)))) @@ -223,13 +223,13 @@ ) (set! sv-32 (logior sv-32 64)) (set! sv-40 (logior sv-40 128)) - (set! (-> arg0 unknown-dword21) (-> *display* base-frame-counter)) + (set-time! (-> arg0 unknown-dword21)) (set! sv-48 (the-as symbol #f)) ) (#t (set! sv-32 (logior sv-32 64)) (set! sv-40 (logior sv-40 128)) - (set! (-> arg0 unknown-dword21) (-> *display* base-frame-counter)) + (set-time! (-> arg0 unknown-dword21)) ) ) ) @@ -382,7 +382,7 @@ ) ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) - (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) + (not (time-elapsed? (-> arg0 unknown-dword10) (seconds 0.3))) (not (logtest? sv-104 32)) ) ) @@ -413,7 +413,7 @@ (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) (set! (-> arg0 unknown-vector53 quad) (-> sv-84 quad)) (set! (-> arg0 unknown-float60) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) - (set! (-> arg0 unknown-dword10) (-> *display* base-frame-counter)) + (set-time! (-> arg0 unknown-dword10)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) (set! (-> arg0 ground-touch-point quad) (-> arg1 best-tri intersect quad)) (set! (-> arg0 unknown-vector55 quad) (-> arg1 best-from-prim prim-core world-sphere quad)) 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 49eddf5caf..82f3081096 100644 --- a/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/logic-target_REF.gc @@ -457,7 +457,7 @@ arg1 "~0ky:~,,2M t:~d cy: ~,,2M my: ~,,2M impv:~,,2M " (-> arg0 control unknown-vector52 y) - (- (-> *display* base-frame-counter) (-> arg0 control unknown-dword11)) + (- (current-time) (-> arg0 control unknown-dword11)) (- (-> arg0 control trans y) (-> arg0 control unknown-vector52 y)) (- (-> arg0 control unknown-vector111 y) (-> arg0 control unknown-vector110 y)) (-> arg0 control ground-impact-vel) @@ -565,14 +565,14 @@ (set! (-> self control unknown-int10) a0-3) (set! (-> self control unknown-float100) f1-1) (if (logtest? (-> self control unknown-surface01 flags) (surface-flags no-turn-around)) - (set! (-> v1-6 0) (the-as uint (-> *display* base-frame-counter))) + (set! (-> v1-6 0) (the-as uint (current-time))) ) - (and (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> v1-6 0)))) (the-as uint 300)) + (and (time-elapsed? (the-as int (-> v1-6 0)) (seconds 1)) (< f0-1 0.0) (< 32768.0 f1-1) (< 0.7 (-> self control unknown-float20)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) (seconds 0.3)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) (seconds 0.3)) + (time-elapsed? (-> self control unknown-dword20) (seconds 0.3)) + (time-elapsed? (-> self control unknown-dword21) (seconds 0.3)) (logtest? (-> self control status) (cshape-moving-flags onsurf)) (and (< 0.7 (-> self control surface-angle)) #t) ) @@ -591,7 +591,7 @@ (let* ((v1-0 127) (a1-6 (-> self control history-data (logand (+ (-> self control unknown-halfword00) v1-0) 127))) ) - (while (and (< (- (-> *display* base-frame-counter) (-> a1-6 time)) arg0) (> v1-0 0)) + (while (and (not (time-elapsed? (-> a1-6 time) arg0)) (> v1-0 0)) (vector+! s5-0 s5-0 (-> a1-6 trans)) (+! gp-0 1) (+! v1-0 -1) @@ -761,7 +761,7 @@ (set! (-> s3-3 z) (fmax 0.0 (fmin (-> s3-3 z) (-> s4-0 z)))) ) (if (< 0.2 (-> self control unknown-float70)) - (vector-seek! s3-3 s4-0 (* 122880.0 (-> *display* seconds-per-frame))) + (vector-seek! s3-3 s4-0 (* 122880.0 (seconds-per-frame))) ) (vector-matrix*! s2-3 s3-3 (-> self control unknown-matrix01)) (let ((f28-2 (vector-vector-xz-distance s3-3 s4-0))) @@ -791,9 +791,9 @@ ) ) ) - (set! (-> self control unknown-dword70) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword70)) ) - (if (< (- (-> *display* base-frame-counter) (-> self control unknown-dword70)) (seconds 0.2)) + (if (not (time-elapsed? (-> self control unknown-dword70) (seconds 0.2))) (set! f30-4 (+ 204800.0 f30-4)) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags twall))) @@ -806,7 +806,7 @@ (set! (-> gp-0 z) 0.0) ) (let ((s4-2 (vector-! (new-stack-vector0) s5-0 gp-0))) - (let ((f30-5 (* f30-4 (-> *display* seconds-per-frame)))) + (let ((f30-5 (* f30-4 (seconds-per-frame)))) (set! (-> s4-2 y) 0.0) (if (< f30-5 (vector-xz-length s4-2)) (vector-xz-normalize! s4-2 f30-5) @@ -924,10 +924,10 @@ (s5-0 (if (and (or (not (logtest? (logior (-> self control status) (-> self control old-status)) (cshape-moving-flags onsurf tsurf)) ) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) (seconds 0.5)) + (not (time-elapsed? (-> self control unknown-dword20) (seconds 0.5))) (!= (-> self next-state name) 'target-walk) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) (seconds 0.5)) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) + (not (time-elapsed? (-> self control unknown-dword21) (seconds 0.5))) (logtest? (-> self control unknown-surface01 flags) (surface-flags no-rotate-toward-transv)) (!= (-> self control unknown-float41) 0.0) ) @@ -942,7 +942,7 @@ (s4-0 (forward-up-nopitch->quaternion (new-stack-quaternion0) gp-0 s3-0)) (s3-1 (forward-up-nopitch->quaternion (new-stack-quaternion0) s5-0 s3-0)) (f0-2 (acos (vector-dot gp-0 s5-0))) - (f1-2 (* (-> self control unknown-surface01 turnvv) (-> *display* seconds-per-frame))) + (f1-2 (* (-> self control unknown-surface01 turnvv) (seconds-per-frame))) ) (quaternion-slerp! (-> self control dir-targ) s4-0 s3-1 (cond ((>= 0.0 (-> self control unknown-float12)) @@ -1004,7 +1004,7 @@ (set! (-> self current-level) (level-get-target-inside *level*)) (if (and (-> self current-level) (>= (-> *level-task-data-remap* length) (-> self current-level info index))) (+! (-> *game-info* in-level-time (-> *level-task-data-remap* (+ (-> self current-level info index) -1))) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) + (- (current-time) (-> *display* old-base-frame-counter)) ) ) (if (and (or (not gp-0) (!= (-> gp-0 name) (-> self current-level name))) (-> self current-level)) @@ -1024,7 +1024,7 @@ ((-> self control unknown-surface01 active-hook)) (cond ((logtest? (-> self control status) (cshape-moving-flags onsurf)) - (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword11)) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) (if (and (>= (-> self control coverage) 1.0) (not (logtest? (-> self control status) (cshape-moving-flags t-act on-water))) @@ -1064,7 +1064,7 @@ ) ) (-> *setting-control* current allow-look-around) - (>= (- (-> *display* base-frame-counter) (-> self no-look-around-wait)) (seconds 0.05)) + (time-elapsed? (-> self no-look-around-wait) (seconds 0.05)) (not (and (= (-> self control ground-pat material) (pat-material ice)) (< 4096.0 (-> self control unknown-float01)) ) @@ -1145,7 +1145,7 @@ ) ) (let ((v1-146 (-> self current-level))) - (if (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 2)) + (if (and (time-elapsed? (-> self control unknown-dword11) (seconds 2)) (and v1-146 (< (-> self control trans y) (-> v1-146 info bottom-height)) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) @@ -1162,14 +1162,14 @@ ;; INFO: Return type mismatch int vs none. (defbehavior post-flag-setup target () (if (logtest? (-> self control status) (cshape-moving-flags twall t-act)) - (set! (-> self control unknown-dword20) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword20)) ) (when (logtest? (-> self state-flags) (state-flags timed-invulnerable)) - (if (< (logand (- (-> *display* base-frame-counter) (-> self control unknown-dword80)) 3) 1) + (if (< (logand (- (current-time) (-> self control unknown-dword80)) 3) 1) (logior! (-> self draw status) (draw-status hidden)) (logclear! (-> self draw status) (draw-status hidden)) ) - (if (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword80)) (-> self control unknown-dword81)) + (if (time-elapsed? (-> self control unknown-dword80) (-> self control unknown-dword81)) (target-timed-invulnerable-off self) ) ) @@ -1195,11 +1195,7 @@ ) ) ) - (seek! - (-> self control unknown-float80) - f0-2 - (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) - ) + (seek! (-> self control unknown-float80) f0-2 (* (-> self control unknown-float82) (seconds-per-frame))) ) (vector-deg-slerp (-> self control dynam gravity-normal) @@ -1284,14 +1280,14 @@ (set! (-> self control unknown-float110) (vector-length s4-1)) (cond ((and (< 819.2 (-> self control unknown-float110)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword40)) (seconds 0.2)) + (time-elapsed? (-> self control unknown-dword40) (seconds 0.2)) ) (vector-normalize! s4-1 1228.8) (move-by-vector! (-> self control) s4-1) (vector-float*! (-> self control rider-last-move) s4-1 (-> *display* frames-per-second)) - (set! (-> self control rider-time) (-> *display* base-frame-counter)) - (if (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword41)) (seconds 0.5)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword40)) (seconds 0.5)) + (set-time! (-> self control rider-time)) + (if (and (time-elapsed? (-> self control unknown-dword41) (seconds 0.5)) + (time-elapsed? (-> self control unknown-dword40) (seconds 0.5)) ) (send-event self 'end-mode) ) @@ -1300,12 +1296,12 @@ (let ((a1-6 (new 'stack-no-clear 'vector))) (vector-! a1-6 (-> s5-0 center-hold) (-> self control unknown-vector91)) (vector-float*! (-> self control rider-last-move) s4-1 (-> *display* frames-per-second)) - (set! (-> self control rider-time) (-> *display* base-frame-counter)) + (set-time! (-> self control rider-time)) (move-to-point! (-> self control) a1-6) ) (set! (-> self control unknown-float110) 0.0) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) - (set! (-> self control unknown-dword40) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword40)) ) ) ) @@ -1338,7 +1334,7 @@ ) (let ((a1-7 (vector-! (new-stack-vector0) (-> gp-0 center-hold) (-> gp-0 center-hold-old)))) (vector-float*! (-> self control rider-last-move) a1-7 (-> *display* frames-per-second)) - (set! (-> self control rider-time) (-> *display* base-frame-counter)) + (set-time! (-> self control rider-time)) (move-by-vector! (-> self control) a1-7) ) ) @@ -1968,7 +1964,7 @@ (set! (-> self control unknown-vector02 quad) (-> self control unknown-dynamics00 gravity-normal quad)) (quaternion-identity! (-> self control unknown-quaternion01)) (set! (-> self control unknown-float00) 0.0) - (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword11)) (set! (-> self control unknown-float80) 0.0) (set! (-> self control unknown-float82) 32.0) (set! (-> self cam-user-mode) 'normal) @@ -2104,9 +2100,9 @@ ) ;; definition for method 10 of type target -(defmethod deactivate target ((obj target)) +(defmethod deactivate target ((this target)) (set-zero! *camera-smush-control*) - ((the-as (function process-drawable none) (find-parent-method target 10)) obj) + ((the-as (function process-drawable none) (find-parent-method target 10)) this) (none) ) diff --git a/test/decompiler/reference/jak1/engine/target/target-death_REF.gc b/test/decompiler/reference/jak1/engine/target/target-death_REF.gc index 334e67ec22..f3753bfafe 100644 --- a/test/decompiler/reference/jak1/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-death_REF.gc @@ -56,7 +56,7 @@ (remove-setting! 'music) ) :code (behavior ((arg0 continue-point)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (-> *art-control* reserve-buffer) (reserve-free *art-control* (-> *art-control* reserve-buffer heap)) ) @@ -251,8 +251,8 @@ ) ) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 2)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) @@ -260,7 +260,7 @@ (suspend) (set! v1-10 (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed)))) ) - (set! (-> *cpad-list* cpads 0 change-time) (-> *display* base-frame-counter)) + (set-time! (-> *cpad-list* cpads 0 change-time)) (reset-actors 'dead) (start 'play (get-continue-by-name *game-info* "misty-start")) ) @@ -427,8 +427,8 @@ ) ) (else - (let ((s5-7 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-7) (seconds 0.05)) + (let ((s5-7 (current-time))) + (until (time-elapsed? s5-7 (seconds 0.05)) (suspend) ) ) @@ -620,9 +620,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -643,9 +641,7 @@ ) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (the-as time-frame (-> *TARGET-bank* stuck-time)) - ) + (and (time-elapsed? (-> self state-time) (the-as time-frame (-> *TARGET-bank* stuck-time))) (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) ) @@ -779,7 +775,7 @@ #t (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (ja-group) data 0 length) -1)) (ja-step 0)))))) (until v1-40 - (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) + (+! f30-1 (* (-> arg0 shove-back) f28-1 (seconds-per-frame))) (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) (suspend) (ja :num! (seek!)) @@ -787,7 +783,7 @@ ) (while (and (or (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) s2-1) (!= s2-1 'stuck)) (arg2) - (+! f30-1 (* (-> arg0 shove-back) f28-1 (-> *display* seconds-per-frame))) + (+! f30-1 (* (-> arg0 shove-back) f28-1 (seconds-per-frame))) (set! s2-1 (target-hit-push s3-1 s1-1 f30-1 (* (-> arg0 shove-back) f28-1) arg0)) (if (not s2-1) (logclear! (-> self state-flags) (state-flags being-attacked)) @@ -838,7 +834,7 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags wt16)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((v1-4 gp-0)) @@ -883,7 +879,7 @@ ) (when (= arg0 'attack) (logior! (-> self state-flags) (state-flags being-attacked)) - (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('endlessfall) (cond @@ -891,8 +887,8 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-known-safe-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s3-1) (seconds 1)) + (let ((s3-1 (current-time))) + (until (time-elapsed? s3-1 (seconds 1)) (suspend) ) ) @@ -1059,8 +1055,8 @@ (-> self attack-info attacker) (ja-channel-set! 0) (ja-post) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 1)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -1078,7 +1074,7 @@ ) (set! (-> gp-3 frame-group) (the-as art-joint-anim eichar-swim-walk-to-down-ja)) (set! (-> gp-3 param 0) (ja-aframe (the-as float 73.0) 0)) - (let ((f30-1 (seek f30-0 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame))))) + (let ((f30-1 (seek f30-0 (the-as float 0.05) (* 1.5 (seconds-per-frame))))) (set! (-> gp-3 param 1) f30-1) (set! (-> gp-3 frame-num) 0.0) (joint-control-channel-group! gp-3 (the-as art-joint-anim eichar-swim-walk-to-down-ja) num-func-seek!) @@ -1086,7 +1082,7 @@ (suspend) (let ((gp-4 (-> self skel root-channel 0))) (set! (-> gp-4 param 0) (ja-aframe (the-as float 73.0) 0)) - (set! f30-1 (seek f30-1 (the-as float 0.05) (* 1.5 (-> *display* seconds-per-frame)))) + (set! f30-1 (seek f30-1 (the-as float 0.05) (* 1.5 (seconds-per-frame)))) (set! (-> gp-4 param 1) f30-1) (joint-control-channel-group-eval! gp-4 (the-as art-joint-anim #f) num-func-seek!) ) @@ -1137,8 +1133,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((gp-9 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-9) (seconds 2)) + (let ((gp-9 (current-time))) + (until (time-elapsed? gp-9 (seconds 2)) (suspend) ) ) @@ -1169,7 +1165,7 @@ (set! (-> self trans-hook) (lambda :behavior target () - (vector-seek! (-> self draw color-mult) *zero-vector* (-> *display* seconds-per-frame)) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) (let ((gp-0 (new-stack-vector0)) (f30-0 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) ) @@ -1199,8 +1195,8 @@ (target-falling-anim (seconds 0.1) (seconds 0.33)) (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! eichar-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) - (let ((gp-12 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-12) (seconds 0.8)) + (let ((gp-12 (current-time))) + (until (time-elapsed? gp-12 (seconds 0.8)) (ja :group! eichar-launch-jump-loop-ja :num! (loop! 0.5)) (suspend) ) @@ -1350,7 +1346,7 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (anim-loop) ) :post target-no-stick-post diff --git a/test/decompiler/reference/jak1/engine/target/target-h_REF.gc b/test/decompiler/reference/jak1/engine/target/target-h_REF.gc index 55670afd8a..64481803d7 100644 --- a/test/decompiler/reference/jak1/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-h_REF.gc @@ -149,35 +149,35 @@ ) ;; definition for method 3 of type target -(defmethod inspect target ((obj target)) +(defmethod inspect target ((this target)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcontrol: ~A~%" (-> obj control)) - (format #t "~T~Tskel2: ~A~%" (-> obj skel2)) - (format #t "~T~Tracer: ~A~%" (-> obj racer)) - (format #t "~T~Tgame: ~A~%" (-> obj game)) - (format #t "~T~Tneck: ~A~%" (-> obj neck)) - (format #t "~T~Tstate-hook-time: ~D~%" (-> obj state-hook-time)) - (format #t "~T~Tstate-hook: ~A~%" (-> obj state-hook)) - (format #t "~T~Tcam-user-mode: ~A~%" (-> obj cam-user-mode)) - (format #t "~T~Tsidekick: #x~X~%" (-> obj sidekick)) - (format #t "~T~Tmanipy: #x~X~%" (-> obj manipy)) - (format #t "~T~Tattack-info: #~%" (-> obj attack-info)) - (format #t "~T~Tattack-info-rec: #~%" (-> obj attack-info-rec)) - (format #t "~T~Tanim-seed: ~D~%" (-> obj anim-seed)) - (format #t "~T~Talt-cam-pos: ~`vector`P~%" (-> obj alt-cam-pos)) - (format #t "~T~Tsnowball: ~A~%" (-> obj snowball)) - (format #t "~T~Ttube: ~A~%" (-> obj tube)) - (format #t "~T~Tflut: ~A~%" (-> obj flut)) - (format #t "~T~Tcurrent-level: ~A~%" (-> obj current-level)) - (format #t "~T~Tsaved-pos: #~%" (-> obj saved-pos)) - (format #t "~T~Tsaved-owner: ~D~%" (-> obj saved-owner)) - (format #t "~T~Talt-neck-pos: ~`vector`P~%" (-> obj alt-neck-pos)) - (format #t "~T~Tfp-hud: ~D~%" (-> obj fp-hud)) - (format #t "~T~Tno-load-wait: ~D~%" (-> obj no-load-wait)) - (format #t "~T~Tno-look-around-wait: ~D~%" (-> obj no-look-around-wait)) - obj + (format #t "~T~Tcontrol: ~A~%" (-> this control)) + (format #t "~T~Tskel2: ~A~%" (-> this skel2)) + (format #t "~T~Tracer: ~A~%" (-> this racer)) + (format #t "~T~Tgame: ~A~%" (-> this game)) + (format #t "~T~Tneck: ~A~%" (-> this neck)) + (format #t "~T~Tstate-hook-time: ~D~%" (-> this state-hook-time)) + (format #t "~T~Tstate-hook: ~A~%" (-> this state-hook)) + (format #t "~T~Tcam-user-mode: ~A~%" (-> this cam-user-mode)) + (format #t "~T~Tsidekick: #x~X~%" (-> this sidekick)) + (format #t "~T~Tmanipy: #x~X~%" (-> this manipy)) + (format #t "~T~Tattack-info: #~%" (-> this attack-info)) + (format #t "~T~Tattack-info-rec: #~%" (-> this attack-info-rec)) + (format #t "~T~Tanim-seed: ~D~%" (-> this anim-seed)) + (format #t "~T~Talt-cam-pos: ~`vector`P~%" (-> this alt-cam-pos)) + (format #t "~T~Tsnowball: ~A~%" (-> this snowball)) + (format #t "~T~Ttube: ~A~%" (-> this tube)) + (format #t "~T~Tflut: ~A~%" (-> this flut)) + (format #t "~T~Tcurrent-level: ~A~%" (-> this current-level)) + (format #t "~T~Tsaved-pos: #~%" (-> this saved-pos)) + (format #t "~T~Tsaved-owner: ~D~%" (-> this saved-owner)) + (format #t "~T~Talt-neck-pos: ~`vector`P~%" (-> this alt-neck-pos)) + (format #t "~T~Tfp-hud: ~D~%" (-> this fp-hud)) + (format #t "~T~Tno-load-wait: ~D~%" (-> this no-load-wait)) + (format #t "~T~Tno-look-around-wait: ~D~%" (-> this no-look-around-wait)) + this ) ;; definition (perm) for symbol *target*, type target @@ -200,16 +200,16 @@ ) ;; definition for method 3 of type sidekick -(defmethod inspect sidekick ((obj sidekick)) +(defmethod inspect sidekick ((this sidekick)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcontrol: ~A~%" (-> obj root)) - (format #t "~T~Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~T~Tstate-flags: ~D~%" (-> obj state-flags)) - (format #t "~T~Tanim-seed: ~D~%" (-> obj anim-seed)) - (format #t "~T~Tshadow-in-movie?: ~A~%" (-> obj shadow-in-movie?)) - obj + (format #t "~T~Tcontrol: ~A~%" (-> this root)) + (format #t "~T~Tstate-time: ~D~%" (-> this state-time)) + (format #t "~T~Tstate-flags: ~D~%" (-> this state-flags)) + (format #t "~T~Tanim-seed: ~D~%" (-> this anim-seed)) + (format #t "~T~Tshadow-in-movie?: ~A~%" (-> this shadow-in-movie?)) + this ) ;; definition (perm) for symbol *sidekick*, type sidekick diff --git a/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc index e3476797fc..77a42be265 100644 --- a/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-handler_REF.gc @@ -60,9 +60,7 @@ (if (and (zero? (-> *game-info* enter-level-time (-> s5-1 index))) (>= (-> *level-task-data-remap* length) (-> s5-1 index)) ) - (set! (-> *game-info* enter-level-time (-> *level-task-data-remap* (+ (-> s5-1 index) -1))) - (-> *display* base-frame-counter) - ) + (set-time! (-> *game-info* enter-level-time (-> *level-task-data-remap* (+ (-> s5-1 index) -1)))) ) ) (send-event (ppointer->process (-> *hud-parts* buzzers)) 'sync) @@ -111,7 +109,7 @@ ) (rot->dir-targ! (-> self control)) (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) - (set! v0-0 (-> *display* base-frame-counter)) + (set! v0-0 (current-time)) (set! (-> self control unknown-dword11) (the-as time-frame v0-0)) v0-0 ) @@ -254,14 +252,12 @@ ) ) (('no-load-wait) - (set! v0-0 (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0)))) + (set! v0-0 (+ (current-time) (the-as time-frame (-> arg3 param 0)))) (set! (-> self no-load-wait) (the-as time-frame v0-0)) v0-0 ) (('no-look-around) - (set! (-> self no-look-around-wait) - (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0))) - ) + (set! (-> self no-look-around-wait) (+ (current-time) (the-as time-frame (-> arg3 param 0)))) (if (= (-> self next-state name) 'target-look-around) (send-event self 'end-mode) ) @@ -774,7 +770,7 @@ (logtest? (-> self control root-prim prim-core action) (collide-action edgegrab-cam swingpole-active racer snowball tube flut) ) - (>= (-> self no-load-wait) (-> *display* base-frame-counter)) + (>= (-> self no-load-wait) (current-time)) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/target/target-part_REF.gc b/test/decompiler/reference/jak1/engine/target/target-part_REF.gc index af33eda41c..3c7778444e 100644 --- a/test/decompiler/reference/jak1/engine/target/target-part_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-part_REF.gc @@ -2272,13 +2272,13 @@ (defbehavior process-drawable-burn-effect target ((arg0 time-frame)) (sound-play "get-burned") (let ((s5-1 (new 'stack 'rgbaf)) - (s3-0 (-> *display* base-frame-counter)) + (s3-0 (current-time)) (s4-1 (-> self parent)) ) (set! (-> s5-1 quad) (-> (the-as process-drawable (-> s4-1 0)) draw color-mult quad)) (let ((s2-1 (vector-float*! (the-as vector (new 'stack 'rgbaf)) (the-as vector s5-1) 0.0))) - (while (< (- (-> *display* base-frame-counter) s3-0) arg0) - (let ((v1-8 (- (-> *display* base-frame-counter) s3-0))) + (while (not (time-elapsed? s3-0 arg0)) + (let ((v1-8 (- (current-time) s3-0))) (if (< v1-8 (/ arg0 2)) (vector-lerp! (-> (the-as process-drawable (-> s4-1 0)) draw color-mult) diff --git a/test/decompiler/reference/jak1/engine/target/target-util_REF.gc b/test/decompiler/reference/jak1/engine/target/target-util_REF.gc index 02ecb2cb76..5894ce03f8 100644 --- a/test/decompiler/reference/jak1/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target-util_REF.gc @@ -113,91 +113,91 @@ ) ;; definition for method 3 of type target-bank -(defmethod inspect target-bank ((obj target-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tjump-collide-offset: (meters ~m)~%" (-> obj jump-collide-offset)) - (format #t "~Tjump-height-min: (meters ~m)~%" (-> obj jump-height-min)) - (format #t "~Tjump-height-max: (meters ~m)~%" (-> obj jump-height-max)) - (format #t "~Tdouble-jump-height-min: (meters ~m)~%" (-> obj double-jump-height-min)) - (format #t "~Tdouble-jump-height-max: (meters ~m)~%" (-> obj double-jump-height-max)) - (format #t "~Tflip-jump-height-min: (meters ~m)~%" (-> obj flip-jump-height-min)) - (format #t "~Tflip-jump-height-max: (meters ~m)~%" (-> obj flip-jump-height-max)) - (format #t "~Tduck-jump-height-min: (meters ~m)~%" (-> obj duck-jump-height-min)) - (format #t "~Tduck-jump-height-max: (meters ~m)~%" (-> obj duck-jump-height-max)) - (format #t "~Tflop-jump-height-min: (meters ~m)~%" (-> obj flop-jump-height-min)) - (format #t "~Tflop-jump-height-max: (meters ~m)~%" (-> obj flop-jump-height-max)) - (format #t "~Tattack-jump-height-min: (meters ~m)~%" (-> obj attack-jump-height-min)) - (format #t "~Tattack-jump-height-max: (meters ~m)~%" (-> obj attack-jump-height-max)) - (format #t "~Tedge-grab-jump-height-min: (meters ~m)~%" (-> obj edge-grab-jump-height-min)) - (format #t "~Tedge-grab-jump-height-max: (meters ~m)~%" (-> obj edge-grab-jump-height-max)) - (format #t "~Tswim-jump-height-min: (meters ~m)~%" (-> obj swim-jump-height-min)) - (format #t "~Tswim-jump-height-max: (meters ~m)~%" (-> obj swim-jump-height-max)) - (format #t "~Ttube-jump-height-min: (meters ~m)~%" (-> obj tube-jump-height-min)) - (format #t "~Ttube-jump-height-max: (meters ~m)~%" (-> obj tube-jump-height-max)) - (format #t "~Twheel-duration: ~D~%" (-> obj wheel-duration)) - (format #t "~Twheel-jump-pre-window: ~D~%" (-> obj wheel-jump-pre-window)) - (format #t "~Twheel-jump-post-window: ~D~%" (-> obj wheel-jump-post-window)) - (format #t "~Twheel-timeout: ~D~%" (-> obj wheel-timeout)) - (format #t "~Twheel-speed-min: (meters ~m)~%" (-> obj wheel-speed-min)) - (format #t "~Twheel-speed-inc: (meters ~m)~%" (-> obj wheel-speed-inc)) - (format #t "~Twheel-flip-duration: ~D~%" (-> obj wheel-flip-duration)) - (format #t "~Twheel-flip-height: (meters ~m)~%" (-> obj wheel-flip-height)) - (format #t "~Twheel-flip-dist: (meters ~m)~%" (-> obj wheel-flip-dist)) - (format #t "~Twheel-flip-art-height: (meters ~m)~%" (-> obj wheel-flip-art-height)) - (format #t "~Twheel-flip-art-dist: (meters ~m)~%" (-> obj wheel-flip-art-dist)) - (format #t "~Tduck-slide-distance: (meters ~m)~%" (-> obj duck-slide-distance)) - (format #t "~Tfall-far: (meters ~m)~%" (-> obj fall-far)) - (format #t "~Tfall-far-inc: (meters ~m)~%" (-> obj fall-far-inc)) - (format #t "~Tattack-timeout: ~D~%" (-> obj attack-timeout)) - (format #t "~Tground-timeout: ~D~%" (-> obj ground-timeout)) - (format #t "~Tslide-down-timeout: ~D~%" (-> obj slide-down-timeout)) - (format #t "~Tfall-timeout: ~D~%" (-> obj fall-timeout)) - (format #t "~Tfall-stumble-threshold: (meters ~m)~%" (-> obj fall-stumble-threshold)) - (format #t "~Tyellow-projectile-speed: (meters ~m)~%" (-> obj yellow-projectile-speed)) - (format #t "~Thit-invulnerable-timeout: ~D~%" (-> obj hit-invulnerable-timeout)) - (format #t "~Trun-cycle-length: ~f~%" (-> obj run-cycle-length)) - (format #t "~Twalk-cycle-dist: (meters ~m)~%" (-> obj walk-cycle-dist)) - (format #t "~Twalk-up-cycle-dist: (meters ~m)~%" (-> obj walk-up-cycle-dist)) - (format #t "~Twalk-down-cycle-dist: (meters ~m)~%" (-> obj walk-down-cycle-dist)) - (format #t "~Twalk-side-cycle-dist: (meters ~m)~%" (-> obj walk-side-cycle-dist)) - (format #t "~Trun-cycle-dist: (meters ~m)~%" (-> obj run-cycle-dist)) - (format #t "~Trun-up-cycle-dist: (meters ~m)~%" (-> obj run-up-cycle-dist)) - (format #t "~Trun-down-cycle-dist: (meters ~m)~%" (-> obj run-down-cycle-dist)) - (format #t "~Trun-side-cycle-dist: (meters ~m)~%" (-> obj run-side-cycle-dist)) - (format #t "~Trun-wall-cycle-dist: (meters ~m)~%" (-> obj run-wall-cycle-dist)) - (format #t "~Tduck-walk-cycle-dist: (meters ~m)~%" (-> obj duck-walk-cycle-dist)) - (format #t "~Twade-shallow-walk-cycle-dist: (meters ~m)~%" (-> obj wade-shallow-walk-cycle-dist)) - (format #t "~Twade-deep-walk-cycle-dist: (meters ~m)~%" (-> obj wade-deep-walk-cycle-dist)) - (format #t "~Tsmack-surface-dist: (meters ~m)~%" (-> obj smack-surface-dist)) - (format #t "~Tsmack-surface-height: (meters ~m)~%" (-> obj smack-surface-height)) - (format #t "~Tmin-dive-depth: (meters ~m)~%" (-> obj min-dive-depth)) - (format #t "~Troot-radius: (meters ~m)~%" (-> obj root-radius)) - (format #t "~Troot-offset: ~`vector`P~%" (-> obj root-offset)) - (format #t "~Tbody-radius: (meters ~m)~%" (-> obj body-radius)) - (format #t "~Tedge-radius: (meters ~m)~%" (-> obj edge-radius)) - (format #t "~Tedge-offset: ~`vector`P~%" (-> obj edge-offset)) - (format #t "~Thead-radius: (meters ~m)~%" (-> obj head-radius)) - (format #t "~Thead-height: (meters ~m)~%" (-> obj head-height)) - (format #t "~Thead-offset: ~`vector`P~%" (-> obj head-offset)) - (format #t "~Tspin-radius: (meters ~m)~%" (-> obj spin-radius)) - (format #t "~Tspin-offset: ~`vector`P~%" (-> obj spin-offset)) - (format #t "~Tduck-spin-radius: (meters ~m)~%" (-> obj duck-spin-radius)) - (format #t "~Tduck-spin-offset: ~`vector`P~%" (-> obj duck-spin-offset)) - (format #t "~Tpunch-radius: (meters ~m)~%" (-> obj punch-radius)) - (format #t "~Tpunch-offset: ~`vector`P~%" (-> obj punch-offset)) - (format #t "~Tuppercut-radius: (meters ~m)~%" (-> obj uppercut-radius)) - (format #t "~Tuppercut0-offset: ~`vector`P~%" (-> obj uppercut0-offset)) - (format #t "~Tuppercut1-offset: ~`vector`P~%" (-> obj uppercut1-offset)) - (format #t "~Tflop-radius: (meters ~m)~%" (-> obj flop-radius)) - (format #t "~Tflop0-offset: ~`vector`P~%" (-> obj flop0-offset)) - (format #t "~Tflop1-offset: ~`vector`P~%" (-> obj flop1-offset)) - (format #t "~Tstuck-time: (seconds ~e)~%" (-> obj stuck-time)) - (format #t "~Tstuck-timeout: (seconds ~e)~%" (-> obj stuck-timeout)) - (format #t "~Tstuck-distance: (meters ~m)~%" (-> obj stuck-distance)) - (format #t "~Ttongue-pull-speed-min: ~f~%" (-> obj tongue-pull-speed-min)) - (format #t "~Ttongue-pull-speed-max: ~f~%" (-> obj tongue-pull-speed-max)) - (format #t "~Tyellow-attack-timeout: ~D~%" (-> obj yellow-attack-timeout)) - obj +(defmethod inspect target-bank ((this target-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tjump-collide-offset: (meters ~m)~%" (-> this jump-collide-offset)) + (format #t "~Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) + (format #t "~Tjump-height-max: (meters ~m)~%" (-> this jump-height-max)) + (format #t "~Tdouble-jump-height-min: (meters ~m)~%" (-> this double-jump-height-min)) + (format #t "~Tdouble-jump-height-max: (meters ~m)~%" (-> this double-jump-height-max)) + (format #t "~Tflip-jump-height-min: (meters ~m)~%" (-> this flip-jump-height-min)) + (format #t "~Tflip-jump-height-max: (meters ~m)~%" (-> this flip-jump-height-max)) + (format #t "~Tduck-jump-height-min: (meters ~m)~%" (-> this duck-jump-height-min)) + (format #t "~Tduck-jump-height-max: (meters ~m)~%" (-> this duck-jump-height-max)) + (format #t "~Tflop-jump-height-min: (meters ~m)~%" (-> this flop-jump-height-min)) + (format #t "~Tflop-jump-height-max: (meters ~m)~%" (-> this flop-jump-height-max)) + (format #t "~Tattack-jump-height-min: (meters ~m)~%" (-> this attack-jump-height-min)) + (format #t "~Tattack-jump-height-max: (meters ~m)~%" (-> this attack-jump-height-max)) + (format #t "~Tedge-grab-jump-height-min: (meters ~m)~%" (-> this edge-grab-jump-height-min)) + (format #t "~Tedge-grab-jump-height-max: (meters ~m)~%" (-> this edge-grab-jump-height-max)) + (format #t "~Tswim-jump-height-min: (meters ~m)~%" (-> this swim-jump-height-min)) + (format #t "~Tswim-jump-height-max: (meters ~m)~%" (-> this swim-jump-height-max)) + (format #t "~Ttube-jump-height-min: (meters ~m)~%" (-> this tube-jump-height-min)) + (format #t "~Ttube-jump-height-max: (meters ~m)~%" (-> this tube-jump-height-max)) + (format #t "~Twheel-duration: ~D~%" (-> this wheel-duration)) + (format #t "~Twheel-jump-pre-window: ~D~%" (-> this wheel-jump-pre-window)) + (format #t "~Twheel-jump-post-window: ~D~%" (-> this wheel-jump-post-window)) + (format #t "~Twheel-timeout: ~D~%" (-> this wheel-timeout)) + (format #t "~Twheel-speed-min: (meters ~m)~%" (-> this wheel-speed-min)) + (format #t "~Twheel-speed-inc: (meters ~m)~%" (-> this wheel-speed-inc)) + (format #t "~Twheel-flip-duration: ~D~%" (-> this wheel-flip-duration)) + (format #t "~Twheel-flip-height: (meters ~m)~%" (-> this wheel-flip-height)) + (format #t "~Twheel-flip-dist: (meters ~m)~%" (-> this wheel-flip-dist)) + (format #t "~Twheel-flip-art-height: (meters ~m)~%" (-> this wheel-flip-art-height)) + (format #t "~Twheel-flip-art-dist: (meters ~m)~%" (-> this wheel-flip-art-dist)) + (format #t "~Tduck-slide-distance: (meters ~m)~%" (-> this duck-slide-distance)) + (format #t "~Tfall-far: (meters ~m)~%" (-> this fall-far)) + (format #t "~Tfall-far-inc: (meters ~m)~%" (-> this fall-far-inc)) + (format #t "~Tattack-timeout: ~D~%" (-> this attack-timeout)) + (format #t "~Tground-timeout: ~D~%" (-> this ground-timeout)) + (format #t "~Tslide-down-timeout: ~D~%" (-> this slide-down-timeout)) + (format #t "~Tfall-timeout: ~D~%" (-> this fall-timeout)) + (format #t "~Tfall-stumble-threshold: (meters ~m)~%" (-> this fall-stumble-threshold)) + (format #t "~Tyellow-projectile-speed: (meters ~m)~%" (-> this yellow-projectile-speed)) + (format #t "~Thit-invulnerable-timeout: ~D~%" (-> this hit-invulnerable-timeout)) + (format #t "~Trun-cycle-length: ~f~%" (-> this run-cycle-length)) + (format #t "~Twalk-cycle-dist: (meters ~m)~%" (-> this walk-cycle-dist)) + (format #t "~Twalk-up-cycle-dist: (meters ~m)~%" (-> this walk-up-cycle-dist)) + (format #t "~Twalk-down-cycle-dist: (meters ~m)~%" (-> this walk-down-cycle-dist)) + (format #t "~Twalk-side-cycle-dist: (meters ~m)~%" (-> this walk-side-cycle-dist)) + (format #t "~Trun-cycle-dist: (meters ~m)~%" (-> this run-cycle-dist)) + (format #t "~Trun-up-cycle-dist: (meters ~m)~%" (-> this run-up-cycle-dist)) + (format #t "~Trun-down-cycle-dist: (meters ~m)~%" (-> this run-down-cycle-dist)) + (format #t "~Trun-side-cycle-dist: (meters ~m)~%" (-> this run-side-cycle-dist)) + (format #t "~Trun-wall-cycle-dist: (meters ~m)~%" (-> this run-wall-cycle-dist)) + (format #t "~Tduck-walk-cycle-dist: (meters ~m)~%" (-> this duck-walk-cycle-dist)) + (format #t "~Twade-shallow-walk-cycle-dist: (meters ~m)~%" (-> this wade-shallow-walk-cycle-dist)) + (format #t "~Twade-deep-walk-cycle-dist: (meters ~m)~%" (-> this wade-deep-walk-cycle-dist)) + (format #t "~Tsmack-surface-dist: (meters ~m)~%" (-> this smack-surface-dist)) + (format #t "~Tsmack-surface-height: (meters ~m)~%" (-> this smack-surface-height)) + (format #t "~Tmin-dive-depth: (meters ~m)~%" (-> this min-dive-depth)) + (format #t "~Troot-radius: (meters ~m)~%" (-> this root-radius)) + (format #t "~Troot-offset: ~`vector`P~%" (-> this root-offset)) + (format #t "~Tbody-radius: (meters ~m)~%" (-> this body-radius)) + (format #t "~Tedge-radius: (meters ~m)~%" (-> this edge-radius)) + (format #t "~Tedge-offset: ~`vector`P~%" (-> this edge-offset)) + (format #t "~Thead-radius: (meters ~m)~%" (-> this head-radius)) + (format #t "~Thead-height: (meters ~m)~%" (-> this head-height)) + (format #t "~Thead-offset: ~`vector`P~%" (-> this head-offset)) + (format #t "~Tspin-radius: (meters ~m)~%" (-> this spin-radius)) + (format #t "~Tspin-offset: ~`vector`P~%" (-> this spin-offset)) + (format #t "~Tduck-spin-radius: (meters ~m)~%" (-> this duck-spin-radius)) + (format #t "~Tduck-spin-offset: ~`vector`P~%" (-> this duck-spin-offset)) + (format #t "~Tpunch-radius: (meters ~m)~%" (-> this punch-radius)) + (format #t "~Tpunch-offset: ~`vector`P~%" (-> this punch-offset)) + (format #t "~Tuppercut-radius: (meters ~m)~%" (-> this uppercut-radius)) + (format #t "~Tuppercut0-offset: ~`vector`P~%" (-> this uppercut0-offset)) + (format #t "~Tuppercut1-offset: ~`vector`P~%" (-> this uppercut1-offset)) + (format #t "~Tflop-radius: (meters ~m)~%" (-> this flop-radius)) + (format #t "~Tflop0-offset: ~`vector`P~%" (-> this flop0-offset)) + (format #t "~Tflop1-offset: ~`vector`P~%" (-> this flop1-offset)) + (format #t "~Tstuck-time: (seconds ~e)~%" (-> this stuck-time)) + (format #t "~Tstuck-timeout: (seconds ~e)~%" (-> this stuck-timeout)) + (format #t "~Tstuck-distance: (meters ~m)~%" (-> this stuck-distance)) + (format #t "~Ttongue-pull-speed-min: ~f~%" (-> this tongue-pull-speed-min)) + (format #t "~Ttongue-pull-speed-max: ~f~%" (-> this tongue-pull-speed-max)) + (format #t "~Tyellow-attack-timeout: ~D~%" (-> this yellow-attack-timeout)) + this ) ;; definition for symbol *TARGET-bank*, type target-bank @@ -725,8 +725,8 @@ ) ;; definition for method 27 of type control-info -(defmethod get-quaternion control-info ((obj control-info)) - (-> obj unknown-quaternion00) +(defmethod get-quaternion control-info ((this control-info)) + (-> this unknown-quaternion00) ) ;; definition for function target-align-vel-z-adjust @@ -743,23 +743,22 @@ ;; definition for method 16 of type target ;; INFO: Used lq/sq ;; INFO: Return type mismatch control-info vs collide-shape. -(defmethod apply-alignment target ((obj target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment target ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg2 quad)) (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) - (let* ((s3-0 (-> obj control unknown-matrix01)) - (s0-0 (-> obj control unknown-matrix00)) - (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control dynam gravity) s0-0)) - (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control transv) s0-0)) + (let* ((s3-0 (-> this control unknown-matrix01)) + (s0-0 (-> this control unknown-matrix00)) + (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control dynam gravity) s0-0)) + (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control transv) s0-0)) ) (if (logtest? arg0 (align-opts no-gravity)) (set-vector! s1-0 0.0 0.0 0.0 1.0) ) (when (logtest? arg0 (align-opts adjust-x-vel)) - (set! (-> a1-3 x) (+ (* (-> arg1 trans x) (-> s2-0 x) (-> *display* frames-per-second)) - (* (-> s1-0 x) (-> *display* seconds-per-frame)) - ) + (set! (-> a1-3 x) + (+ (* (-> arg1 trans x) (-> s2-0 x) (-> *display* frames-per-second)) (* (-> s1-0 x) (seconds-per-frame))) ) (if (not (logtest? arg0 (align-opts adjust-xz-vel keep-other-velocities))) (set! (-> a1-3 z) 0.0) @@ -768,30 +767,28 @@ (if (and (logtest? arg0 (align-opts adjust-y-vel)) (not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0))) ) - (set! (-> a1-3 y) (+ (* (-> arg1 trans y) (-> s2-0 y) (-> *display* frames-per-second)) - (* (-> s1-0 y) (-> *display* seconds-per-frame)) - ) + (set! (-> a1-3 y) + (+ (* (-> arg1 trans y) (-> s2-0 y) (-> *display* frames-per-second)) (* (-> s1-0 y) (seconds-per-frame))) ) ) (when (logtest? arg0 (align-opts adjust-xz-vel)) - (set! (-> a1-3 z) (+ (* (-> arg1 trans z) (-> s2-0 z) (-> *display* frames-per-second)) - (* (-> s1-0 z) (-> *display* seconds-per-frame)) - ) + (set! (-> a1-3 z) + (+ (* (-> arg1 trans z) (-> s2-0 z) (-> *display* frames-per-second)) (* (-> s1-0 z) (seconds-per-frame))) ) (if (not (logtest? arg0 (align-opts adjust-x-vel keep-other-velocities))) (set! (-> a1-3 x) 0.0) ) ) - (vector-matrix*! (-> obj control transv) a1-3 s3-0) + (vector-matrix*! (-> this control transv) a1-3 s3-0) ) ) ) (if (logtest? arg0 (align-opts adjust-quat)) (quaternion-normalize! - (quaternion*! (-> obj control unknown-quaternion00) (-> obj control unknown-quaternion00) (-> arg1 quat)) + (quaternion*! (-> this control unknown-quaternion00) (-> this control unknown-quaternion00) (-> arg1 quat)) ) ) - (the-as collide-shape (-> obj control)) + (the-as collide-shape (-> this control)) ) ;; definition for function average-turn-angle @@ -813,7 +810,7 @@ ;; definition for function can-play-stance-amibent? (defbehavior can-play-stance-amibent? target () - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 30)) + (and (time-elapsed? (-> self state-time) (seconds 30)) (not (-> *setting-control* current talking)) (not (-> *setting-control* current spooling)) (not (-> *setting-control* current movie)) @@ -826,7 +823,7 @@ ;; definition for function can-jump? (defbehavior can-jump? target ((arg0 symbol)) (and (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) + (not (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout))) (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) (< 0.866 (-> self control surface-angle)) ) @@ -859,7 +856,7 @@ ;; INFO: Return type mismatch object vs none. (defbehavior fall-test target () (when (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-15 (ja-group))) (or (not (or (= v1-15 (-> self draw art-group data 59)) @@ -871,7 +868,7 @@ ) ) ) - (when (and (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (-> *TARGET-bank* ground-timeout)) + (when (and (not (time-elapsed? (-> self control rider-time) (-> *TARGET-bank* ground-timeout))) (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground)) ) (+! (-> self control transv x) (-> self control rider-last-move x)) @@ -886,7 +883,7 @@ ;; INFO: Return type mismatch object vs none. (defbehavior slide-down-test target () (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf csmf07))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout)) (logtest? (-> self control status) (cshape-moving-flags tsurf)) (< 0.5 (-> self control surface-angle)) ) @@ -974,26 +971,24 @@ ) #f ) - ((and (or (not arg0) - (and (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) - (< (-> self control unknown-float61) 0.7) - ) + ((and (or (not arg0) (and (not (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout))) + (< (-> self control unknown-float61) 0.7) + ) ) - (>= (- (-> *display* base-frame-counter) - (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) - (>= (-> self fact-info-target eco-level) 1.0) - ) - (-> *TARGET-bank* yellow-attack-timeout) - (-> *TARGET-bank* attack-timeout) + (time-elapsed? + (if (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) + (>= (-> self fact-info-target eco-level) 1.0) ) - ) - (-> self control unknown-dword31) - ) + (-> *TARGET-bank* yellow-attack-timeout) + (-> *TARGET-bank* attack-timeout) + ) + (-> self control unknown-dword31) + ) ) #t ) (else - (set! (-> self control unknown-dword32) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword32)) #f ) ) @@ -1007,11 +1002,11 @@ ) #f ) - ((>= (- (-> *display* base-frame-counter) (-> *TARGET-bank* attack-timeout)) (-> self control unknown-dword33)) + ((time-elapsed? (-> *TARGET-bank* attack-timeout) (-> self control unknown-dword33)) #t ) (else - (set! (-> self control unknown-dword34) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword34)) #f ) ) @@ -1093,7 +1088,7 @@ ;; INFO: Return type mismatch int vs none. (defun target-timed-invulnerable ((arg0 time-frame) (arg1 target)) (logior! (-> arg1 state-flags) (state-flags timed-invulnerable)) - (set! (-> arg1 control unknown-dword80) (-> *display* base-frame-counter)) + (set-time! (-> arg1 control unknown-dword80)) (set! (-> arg1 control unknown-dword81) arg0) (set-collide-kinds (-> arg1 control) 2 (collide-kind target-attack) (collide-kind)) 0 @@ -1113,88 +1108,88 @@ ;; definition for method 9 of type attack-info ;; INFO: Used lq/sq ;; INFO: Return type mismatch attack-info vs none. -(defmethod combine! attack-info ((obj attack-info) (arg0 attack-info)) +(defmethod combine! attack-info ((this attack-info) (arg0 attack-info)) (with-pp (let ((s4-0 (-> arg0 mask))) - (set! (-> obj mask) (-> arg0 mask)) + (set! (-> this mask) (-> arg0 mask)) (if (logtest? s4-0 (attack-mask attacker)) - (set! (-> obj attacker) (-> arg0 attacker)) + (set! (-> this attacker) (-> arg0 attacker)) ) (if (logtest? s4-0 (attack-mask mode)) - (set! (-> obj mode) (-> arg0 mode)) + (set! (-> this mode) (-> arg0 mode)) ) (if (logtest? s4-0 (attack-mask angle)) - (set! (-> obj angle) (-> arg0 angle)) + (set! (-> this angle) (-> arg0 angle)) ) (if (logtest? s4-0 (attack-mask dist)) - (set! (-> obj dist) (-> arg0 dist)) + (set! (-> this dist) (-> arg0 dist)) ) (if (logtest? s4-0 (attack-mask control)) - (set! (-> obj control) (-> arg0 control)) + (set! (-> this control) (-> arg0 control)) ) (if (logtest? s4-0 (attack-mask speed)) - (set! (-> obj speed) (-> arg0 speed)) + (set! (-> this speed) (-> arg0 speed)) ) (if (logtest? s4-0 (attack-mask shove-back)) - (set! (-> obj shove-back) (-> arg0 shove-back)) + (set! (-> this shove-back) (-> arg0 shove-back)) ) (if (logtest? s4-0 (attack-mask shove-up)) - (set! (-> obj shove-up) (-> arg0 shove-up)) + (set! (-> this shove-up) (-> arg0 shove-up)) ) (if (logtest? s4-0 (attack-mask invinc-time)) - (set! (-> obj invinc-time) (-> arg0 invinc-time)) + (set! (-> this invinc-time) (-> arg0 invinc-time)) ) (if (logtest? s4-0 (attack-mask rotate-to)) - (set! (-> obj rotate-to) (-> arg0 rotate-to)) + (set! (-> this rotate-to) (-> arg0 rotate-to)) ) (if (logtest? s4-0 (attack-mask intersection)) - (set! (-> obj intersection quad) (-> arg0 intersection quad)) + (set! (-> this intersection quad) (-> arg0 intersection quad)) ) (cond ((not (logtest? s4-0 (attack-mask vector))) (let* ((s3-0 pp) - (s2-0 (handle->process (-> obj attacker))) + (s2-0 (handle->process (-> this attacker))) (v1-39 (if (and (nonzero? s2-0) (type-type? (-> s2-0 type) process-drawable)) s2-0 ) ) ) (when v1-39 - (set! (-> obj trans quad) (-> (the-as process-drawable v1-39) root trans quad)) + (set! (-> this trans quad) (-> (the-as process-drawable v1-39) root trans quad)) (vector-! - (-> obj vector) + (-> this vector) (-> (the-as process-drawable s3-0) root trans) (-> (the-as process-drawable v1-39) root trans) ) - (logior! (-> obj mask) (attack-mask vector)) + (logior! (-> this mask) (attack-mask vector)) ) ) ) (else - (let* ((s3-1 (handle->process (-> obj attacker))) + (let* ((s3-1 (handle->process (-> this attacker))) (a0-16 (if (and (nonzero? s3-1) (type-type? (-> s3-1 type) process-drawable)) s3-1 ) ) ) (if a0-16 - (set! (-> obj trans quad) (-> (the-as process-drawable a0-16) root trans quad)) + (set! (-> this trans quad) (-> (the-as process-drawable a0-16) root trans quad)) ) ) - (set! (-> obj vector quad) (-> arg0 vector quad)) + (set! (-> this vector quad) (-> arg0 vector quad)) (if (not (logtest? s4-0 (attack-mask shove-back))) - (set! (-> obj shove-back) (vector-xz-length (-> obj vector))) + (set! (-> this shove-back) (vector-xz-length (-> this vector))) ) (if (not (logtest? s4-0 (attack-mask shove-up))) - (set! (-> obj shove-up) (-> obj vector y)) + (set! (-> this shove-up) (-> this vector y)) ) ) ) - (if (not (logtest? (-> obj mask) (attack-mask dist))) - (set! (-> obj dist) (fabs (-> obj shove-back))) + (if (not (logtest? (-> this mask) (attack-mask dist))) + (set! (-> this dist) (fabs (-> this shove-back))) ) (if (logtest? s4-0 (attack-mask trans)) - (set! (-> obj trans quad) (-> arg0 trans quad)) + (set! (-> this trans quad) (-> arg0 trans quad)) ) ) (none) diff --git a/test/decompiler/reference/jak1/engine/target/target2_REF.gc b/test/decompiler/reference/jak1/engine/target/target2_REF.gc index f6f94cfea9..6614f88fef 100644 --- a/test/decompiler/reference/jak1/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target2_REF.gc @@ -6,7 +6,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('loading) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) (else @@ -17,8 +17,8 @@ :exit target-exit :code (behavior () (set! (-> self control unknown-surface00) *walk-no-turn-mods*) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.05))) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! eichar-trip-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -28,8 +28,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.3)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.3)) (suspend) (ja :num! (seek! (ja-aframe (the-as float 19.0) 0) 0.05)) (suspend) @@ -91,7 +91,7 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (let ((a0-0 (-> self control unknown-spoolanim00))) @@ -159,32 +159,32 @@ ) ;; definition for method 3 of type first-person-hud -(defmethod inspect first-person-hud ((obj first-person-hud)) +(defmethod inspect first-person-hud ((this first-person-hud)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmax-nb-of-particles: ~D~%" (-> obj max-nb-of-particles)) - (format #t "~T~Tnb-of-particles: ~D~%" (-> obj nb-of-particles)) - (format #t "~T~Tparticles[3] @ #x~X~%" (-> obj particles)) - (format #t "~T~Tin-out-position: ~D~%" (-> obj in-out-position)) - (format #t "~T~Tsides-x-scale: ~f~%" (-> obj sides-x-scale)) - (format #t "~T~Tsides-y-scale: ~f~%" (-> obj sides-y-scale)) - (format #t "~T~Tx-offset: ~D~%" (-> obj x-offset)) - obj + (format #t "~T~Tmax-nb-of-particles: ~D~%" (-> this max-nb-of-particles)) + (format #t "~T~Tnb-of-particles: ~D~%" (-> this nb-of-particles)) + (format #t "~T~Tparticles[3] @ #x~X~%" (-> this particles)) + (format #t "~T~Tin-out-position: ~D~%" (-> this in-out-position)) + (format #t "~T~Tsides-x-scale: ~f~%" (-> this sides-x-scale)) + (format #t "~T~Tsides-y-scale: ~f~%" (-> this sides-y-scale)) + (format #t "~T~Tx-offset: ~D~%" (-> this x-offset)) + this ) ;; definition for symbol *fp-hud-stack*, type pointer (define *fp-hud-stack* (malloc 'global #x3800)) ;; definition for method 10 of type first-person-hud -(defmethod deactivate first-person-hud ((obj first-person-hud)) - (dotimes (s5-0 (-> obj nb-of-particles)) - (kill-and-free-particles (-> obj particles s5-0 part)) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod deactivate first-person-hud ((this first-person-hud)) + (dotimes (s5-0 (-> this nb-of-particles)) + (kill-and-free-particles (-> this particles s5-0 part)) + (set! (-> this particles s5-0 part matrix) -1) ) (enable-hud) (set! (-> *target* fp-hud) (the-as handle #f)) - ((the-as (function process none) (find-parent-method first-person-hud 10)) obj) + ((the-as (function process none) (find-parent-method first-person-hud 10)) this) (none) ) @@ -248,39 +248,39 @@ ;; definition for method 7 of type first-person-hud ;; INFO: Return type mismatch process vs first-person-hud. -(defmethod relocate first-person-hud ((obj first-person-hud) (arg0 int)) - (dotimes (v1-0 (-> obj nb-of-particles)) - (when (-> obj particles v1-0 part) - (if (nonzero? (-> obj particles v1-0 part)) - (&+! (-> obj particles v1-0 part) arg0) +(defmethod relocate first-person-hud ((this first-person-hud) (arg0 int)) + (dotimes (v1-0 (-> this nb-of-particles)) + (when (-> this particles v1-0 part) + (if (nonzero? (-> this particles v1-0 part)) + (&+! (-> this particles v1-0 part) arg0) ) ) ) - (the-as first-person-hud ((method-of-type process relocate) obj arg0)) + (the-as first-person-hud ((method-of-type process relocate) this arg0)) ) ;; definition for method 14 of type first-person-hud ;; INFO: Return type mismatch int vs none. -(defmethod dumb-15 first-person-hud ((obj first-person-hud)) - (dotimes (s5-0 (-> obj nb-of-particles)) - (set! (-> obj particles s5-0 pos x) (+ -256.0 (-> obj particles s5-0 init-pos x))) - (set! (-> obj particles s5-0 pos y) - (* 0.5 (- (* (-> obj particles s5-0 init-pos y) (-> *video-parms* relative-y-scale)) +(defmethod dumb-15 first-person-hud ((this first-person-hud)) + (dotimes (s5-0 (-> this nb-of-particles)) + (set! (-> this particles s5-0 pos x) (+ -256.0 (-> this particles s5-0 init-pos x))) + (set! (-> this particles s5-0 pos y) + (* 0.5 (- (* (-> this particles s5-0 init-pos y) (-> *video-parms* relative-y-scale)) (the float (-> *video-parms* screen-sy)) ) ) ) - (set! (-> obj particles s5-0 pos z) (-> obj particles s5-0 init-pos z)) - (if (> (-> obj particles s5-0 part matrix) 0) + (set! (-> this particles s5-0 pos z) (-> this particles s5-0 init-pos z)) + (if (> (-> this particles s5-0 part matrix) 0) (set-vector! - (sprite-get-user-hvdf (-> obj particles s5-0 part matrix)) - (the float (+ (the int (-> obj particles s5-0 pos x)) 2048)) - (the float (+ (the int (-> obj particles s5-0 pos y)) 2048)) - (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> obj particles s5-0 pos z))) + (sprite-get-user-hvdf (-> this particles s5-0 part matrix)) + (the float (+ (the int (-> this particles s5-0 pos x)) 2048)) + (the float (+ (the int (-> this particles s5-0 pos y)) 2048)) + (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> this particles s5-0 pos z))) (-> *math-camera* hvdf-off w) ) ) - (spawn (-> obj particles s5-0 part) *null-vector*) + (spawn (-> this particles s5-0 part) *null-vector*) ) 0 (none) @@ -449,7 +449,7 @@ (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'dist-from-interp-src) (and (< (send-event-function *camera* a1-0) 4915.2) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.07)) + (not (time-elapsed? (-> self state-time) (seconds 0.07))) (zero? (ja-group-size)) ) ) @@ -533,7 +533,7 @@ (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.5)) + (time-elapsed? (-> self control unknown-dword82) (seconds 0.5)) (not *pause-lock*) ) (let ((gp-1 (vector-float*! @@ -585,7 +585,7 @@ ) ) ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword82)) ) (when (cpad-pressed? (-> self control unknown-cpad-info00 number) triangle) (logclear! @@ -683,7 +683,7 @@ ) (pad-buttons r2 circle square) ) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.45)) + (time-elapsed? (-> self control unknown-dword82) (seconds 0.45)) (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) @@ -738,7 +738,7 @@ ) ) ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword82)) ) ) ) @@ -804,7 +804,7 @@ (let ((gp-0 0)) (while (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (target-falling-anim-trans) - (+! gp-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) + (+! gp-0 (- (current-time) (-> *display* old-base-frame-counter))) (suspend) ) (if (or (> gp-0 0) (let ((v1-11 (ja-group))) @@ -926,7 +926,7 @@ ) :enter (behavior ((arg0 handle)) (set! (-> self control unknown-handle10) arg0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *pole-mods*) (logior! (-> self control root-prim prim-core action) (collide-action swingpole-active)) (target-collide-set! 'pole (the-as float 0.0)) @@ -949,7 +949,7 @@ (pad-buttons x) ) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (set! (-> self control transv quad) (the-as uint128 0)) (cond @@ -1139,9 +1139,9 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *edge-grab-mods*) - (set! (-> self control unknown-dword41) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword41)) (logior! (-> self control root-prim prim-core action) (collide-action edgegrab-active edgegrab-cam)) (set! (-> self control unknown-vector102 quad) (-> self control transv quad)) (set! (-> self control transv quad) (the-as uint128 0)) @@ -1154,7 +1154,7 @@ ) ) :trans (behavior () - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) ) @@ -1305,7 +1305,7 @@ (set! (-> self control transv quad) (the-as uint128 0)) (logclear! (-> self control root-prim prim-core action) (collide-action edgegrab-active edgegrab-cam)) (vector-float*! (-> self control transv) (-> self control unknown-vector101) -40960.0) - (when (and (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (seconds 0.2)) + (when (and (not (time-elapsed? (-> self control rider-time) (seconds 0.2))) (or (logtest? (-> self control unknown-surface01 flags) (surface-flags moving-ground)) (= (-> self control poly-pat material) (pat-material rotate)) ) @@ -1322,7 +1322,7 @@ (defstate target-yellow-blast (target) :event (-> target-running-attack event) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *run-attack-mods*) (set! (-> *run-attack-mods* turnv) 655360.0) (set! (-> *run-attack-mods* turnvv) 655360.0) @@ -1353,7 +1353,7 @@ :exit (behavior () (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) - (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword31)) (target-exit) ) :code (behavior () @@ -1382,7 +1382,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (suspend) @@ -1417,14 +1417,12 @@ ) ) ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword82)) ) ) (ja-no-eval :group! eichar-yellow-running-blast-ja :num! (seek!) :frame-num (ja-aframe (the-as float 9.0) 0)) (until (ja-done? 0) - (if (or (< (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) - (the-as uint 30) - ) + (if (or (not (time-elapsed? (the-as int (-> self control unknown-uint30)) (seconds 0.1))) (= (-> self control unknown-uint31) 1) ) (send-event (handle->process gp-0) 'die) @@ -1490,7 +1488,7 @@ ) :exit (behavior () (rot->dir-targ! (-> self control)) - (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword31)) (target-exit) ) :code (behavior () @@ -1538,9 +1536,9 @@ #f :to self ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) - (let ((gp-4 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-4) (seconds 0.1)) + (set-time! (-> self control unknown-dword82)) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 0.1)) (suspend) ) ) @@ -1566,7 +1564,7 @@ ) :code (behavior ((arg0 object) (arg1 float)) (set! (-> self neck flex-blend) 0.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (= arg1 (-> *FACT-bank* eco-full-inc)) (set! (-> self control unknown-surface00) *double-jump-mods*) (set! (-> self control unknown-surface00) *walk-mods*) @@ -1642,7 +1640,7 @@ (defstate target-wade-stance (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *wade-mods*) (set-zero! (-> self water bob)) ) @@ -1657,7 +1655,7 @@ :trans (behavior () ((-> self state-hook)) (when (and (not (logtest? (-> self water flags) (water-flags wt10))) - (>= (- (-> *display* base-frame-counter) (-> self water wade-time)) (seconds 0.05)) + (time-elapsed? (-> self water wade-time) (seconds 0.05)) ) (if (logtest? (-> self water flags) (water-flags wt11)) (go target-swim-stance) @@ -1702,7 +1700,7 @@ :trans (behavior () ((-> self state-hook)) (when (and (not (logtest? (-> self water flags) (water-flags wt10))) - (>= (- (-> *display* base-frame-counter) (-> self water wade-time)) (seconds 0.1)) + (time-elapsed? (-> self water wade-time) (seconds 0.1)) ) (if (logtest? (-> self water flags) (water-flags wt11)) (go target-swim-stance) @@ -1863,7 +1861,7 @@ (the-as float 16384.0) (the-as float 32768.0) ) - (* 4.0 (-> *display* seconds-per-frame)) + (* 4.0 (seconds-per-frame)) ) ) (set! (-> self skel root-channel 1 frame-interp) f24-1) @@ -1878,7 +1876,7 @@ (ja :chan 2 :num! (chan 0)) (ja :chan 3 :num! (chan 0)) (ja :chan 4 :num! (chan 0)) - (when (and (>= (- (-> *display* base-frame-counter) (the-as time-frame gp-6)) (seconds 0.2)) + (when (and (time-elapsed? (the-as time-frame gp-6) (seconds 0.2)) (< (- (-> self water height) (-> self control trans y)) 4096.0) ) (case (the int (ja-aframe-num 0)) @@ -1890,7 +1888,7 @@ 0 (vector-float*! (new 'stack-no-clear 'vector) (-> self control transv) 2.5) ) - (set! gp-6 (the-as int (-> *display* base-frame-counter))) + (set! gp-6 (the-as int (current-time))) ) ((46 47 48 49) (create-splash @@ -1900,7 +1898,7 @@ 0 (vector-float*! (new 'stack-no-clear 'vector) (-> self control transv) 2.5) ) - (set! gp-6 (the-as int (-> *display* base-frame-counter))) + (set! gp-6 (the-as int (current-time))) ) ) ) @@ -1922,7 +1920,7 @@ (seek! (-> self control unknown-float130) (fmax (fmin (* (+ f0-1 arg2) (fmax 0.5 (+ 0.5 (vector-dot gp-0 v1-2)))) arg3) (- arg3)) - (* arg1 (-> *display* seconds-per-frame)) + (* arg1 (seconds-per-frame)) ) ) (let ((a2-2 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00)))) @@ -1940,8 +1938,8 @@ ) (set! (-> self control unknown-float00) (fabs (-> self control unknown-float130))) (if (= (-> self next-state name) 'target-swim-down) - (seek! (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (-> *display* seconds-per-frame))) - (seek! (-> self control unknown-float131) (the-as float 0.0) (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-float131) (the-as float -6144.0) (* 4096.0 (seconds-per-frame))) + (seek! (-> self control unknown-float131) (the-as float 0.0) (* 2048.0 (seconds-per-frame))) ) (set! (-> self control unknown-vector11 y) (-> self control unknown-float131)) ) @@ -1950,7 +1948,7 @@ (defstate target-swim-stance (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *swim-mods*) (logior! (-> self water flags) (water-flags wt04)) ) @@ -1976,7 +1974,7 @@ (set-zero! (-> self water bob)) ) (when (and (not (logtest? (-> self water flags) (water-flags wt11))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) @@ -1991,7 +1989,7 @@ (pad-buttons x) ) (can-jump? #f) - (>= (- (-> *display* base-frame-counter) (-> self water enter-swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) ) (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) ) @@ -2078,7 +2076,7 @@ :enter (behavior () ((-> target-swim-stance enter)) (die-on-next-update! (-> self water bob)) - (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self control unknown-uint20) (the-as uint (current-time))) ) :exit (-> target-swim-stance exit) :trans (behavior () @@ -2089,7 +2087,7 @@ (set-zero! (-> self water bob)) ) (when (and (not (logtest? (-> self water flags) (water-flags wt11))) - (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water swim-time) (seconds 0.1)) ) (if (logtest? (-> self water flags) (water-flags wt10)) (go target-wade-stance) @@ -2104,7 +2102,7 @@ (pad-buttons x) ) (can-jump? #f) - (>= (- (-> *display* base-frame-counter) (-> self water enter-swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) ) (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) ) @@ -2121,14 +2119,12 @@ ) (cond ((= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (if (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 15) - ) + (if (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.05)) (go target-swim-stance) ) ) (else - (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self control unknown-uint20) (the-as uint (current-time))) ) ) (target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0)) @@ -2195,12 +2191,12 @@ (target-standard-event-handler proc argc message block) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self water flags) (water-flags wt04)) (set! (-> self control unknown-surface00) *dive-mods*) (set! (-> self control dynam gravity-max) 16384.0) (set! (-> self control dynam gravity-length) 16384.0) - (set! (-> self water swim-time) (-> *display* base-frame-counter)) + (set-time! (-> self water swim-time)) (set! (-> self control unknown-uint20) (the-as uint #f)) (if (= (-> self next-state name) 'target-swim-down) (set! (-> self control unknown-float130) 0.0) @@ -2221,11 +2217,11 @@ ) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.5)) + (if (time-elapsed? (-> self water swim-time) (seconds 0.5)) (go target-stance) ) (cond - ((>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) + ((time-elapsed? (-> self control unknown-dword11) (seconds 0.1)) (set! (-> self control unknown-surface00) *dive-mods*) (if (= (-> self next-state name) 'target-swim-down) (target-swim-tilt (the-as float -0.9) (the-as float 1.0) (the-as float 0.0) (the-as float 0.5)) @@ -2295,15 +2291,13 @@ (if (and (or (not (cpad-hold? (-> self control unknown-cpad-info00 number) square)) (-> self control unknown-spoolanim00) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + (time-elapsed? (-> self state-time) gp-0) ) (go target-swim-up) ) - (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) s5-0) + (if (or (time-elapsed? (-> self state-time) s5-0) (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (and (< (-> self water swim-depth) 8192.0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) - ) + (and (< (-> self water swim-depth) 8192.0) (time-elapsed? (-> self state-time) gp-0)) ) ) (go target-swim-up) @@ -2317,7 +2311,7 @@ (f26-0 f28-0) (f24-1 (+ f24-0 f30-0)) ) - (set! f30-0 (seek f30-0 (the-as float 0.0) (* 32768.0 (-> *display* seconds-per-frame)))) + (set! f30-0 (seek f30-0 (the-as float 0.0) (* 32768.0 (seconds-per-frame)))) (vector+! (-> self control transv) (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f24-1) @@ -2358,7 +2352,7 @@ (the-as surface #f) ) ) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) + (if (and (time-elapsed? (-> self state-time) (seconds 10)) (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) ) (send-event self 'attack #f (static-attack-info ((mode 'drown-death)))) @@ -2427,14 +2421,14 @@ ) (suspend) (ja :num! (loop! f30-0)) - (set! f30-0 (seek f30-0 (the-as float 1.0) (-> *display* seconds-per-frame))) + (set! f30-0 (seek f30-0 (the-as float 1.0) (seconds-per-frame))) ) ) (label cfg-37) (logior! (-> self water flags) (water-flags wt04)) - (set! (-> self water swim-time) (-> *display* base-frame-counter)) + (set-time! (-> self water swim-time)) (start-bobbing! (-> self water) (the-as float -4096.0) 600 1500) - (set! (-> self water bob start-time) (+ (-> *display* base-frame-counter) (seconds -0.05))) + (set! (-> self water bob start-time) (+ (current-time) (seconds -0.05))) (go target-swim-stance) ) :post target-swim-post @@ -2447,7 +2441,7 @@ :exit target-exit :trans (behavior () (cond - ((< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + ((not (time-elapsed? (-> self state-time) (seconds 0.5))) (logior! (-> self water flags) (water-flags wt16)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) ) @@ -2570,7 +2564,7 @@ ) ) :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *turn-around-mods*) (ja-channel-push! 1 (seconds 0.15)) (set-forward-vel (the-as float 0.0)) @@ -2588,13 +2582,13 @@ (lambda :behavior process ((arg0 vector) (arg1 time-frame) (arg2 float)) (local-vars (sv-32 time-frame) (sv-40 vector) (sv-44 symbol)) - (set! sv-32 (-> *display* base-frame-counter)) + (set! sv-32 (current-time)) (let ((v1-2 (new-stack-vector0))) (set! (-> v1-2 quad) (-> arg0 quad)) (set! sv-40 v1-2) ) (set! sv-44 #t) - (until (>= (- (-> *display* base-frame-counter) sv-32) arg1) + (until (time-elapsed? sv-32 arg1) (let ((s4-0 (ppointer->process (-> self parent)))) (cond ((and sv-44 @@ -2612,7 +2606,7 @@ ) (else (if sv-44 - (set! sv-32 (-> *display* base-frame-counter)) + (set! sv-32 (current-time)) ) (set! sv-44 (the-as symbol #f)) (when (or (= (-> (the-as target s4-0) next-state name) 'target-duck-high-jump-jump) @@ -2810,7 +2804,7 @@ ) (rot->dir-targ! (-> self control)) (logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) - (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword11)) (ja-channel-set! 0) (ja-post) (target-exit) diff --git a/test/decompiler/reference/jak1/engine/target/target_REF.gc b/test/decompiler/reference/jak1/engine/target/target_REF.gc index e59dfef5bf..0a05ac341b 100644 --- a/test/decompiler/reference/jak1/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak1/engine/target/target_REF.gc @@ -42,8 +42,8 @@ ) ) (ja-no-eval :group! eichar-jump-loop-ja :num! (loop!) :frame-num 0.0) - (let ((s5-1 (-> *display* base-frame-counter))) - (while (or (= arg0 -1) (< (- (-> *display* base-frame-counter) s5-1) arg0)) + (let ((s5-1 (current-time))) + (while (or (= arg0 -1) (not (time-elapsed? s5-1 arg0))) (suspend) (ja :group! eichar-jump-loop-ja :num! (loop!)) ) @@ -93,7 +93,7 @@ (pad-buttons x) ) (not (logtest? (-> self water flags) (water-flags wt09))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (not (time-elapsed? (-> self state-time) (seconds 3))) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) @@ -104,7 +104,7 @@ ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) (>= arg1 0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) arg1) + (time-elapsed? (-> self state-time) arg1) (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) #t @@ -112,7 +112,7 @@ (logior! (-> self control status) (cshape-moving-flags onsurf)) (go target-hit-ground 'stuck) ) - (if (!= (-> self state-time) (-> *display* base-frame-counter)) + (if (!= (-> self state-time) (current-time)) (slide-down-test) ) 0 @@ -160,7 +160,7 @@ ) ) ) - (let ((f30-1 (seek f30-0 (the-as float 1.0) (* 0.5 (-> *display* seconds-per-frame))))) + (let ((f30-1 (seek f30-0 (the-as float 1.0) (* 0.5 (seconds-per-frame))))) (set! (-> s5-0 param 1) f30-1) (set! (-> s5-0 frame-num) 0.0) (joint-control-channel-group! @@ -206,7 +206,7 @@ (suspend) (let ((s5-1 (-> self skel root-channel 0))) (set! (-> s5-1 param 0) (the float (+ (-> s5-1 frame-group data 0 length) -1))) - (set! f30-1 (seek f30-1 (the-as float 1.0) (* 0.5 (-> *display* seconds-per-frame)))) + (set! f30-1 (seek f30-1 (the-as float 1.0) (* 0.5 (seconds-per-frame)))) (set! (-> s5-1 param 1) f30-1) (joint-control-channel-group-eval! s5-1 (the-as art-joint-anim #f) num-func-seek!) ) @@ -335,7 +335,7 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control unknown-surface00) *walk-mods*) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (set! (-> self control unknown-float81) 0.0) @@ -449,7 +449,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (seek! (-> self control unknown-float81) (the-as float 0.0) (-> *display* seconds-per-frame)) + (seek! (-> self control unknown-float81) (the-as float 0.0) (seconds-per-frame)) (suspend) (ja :num! (seek!)) ) @@ -568,7 +568,7 @@ (defstate target-walk (target) :event target-walk-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *walk-mods*) ) :exit (behavior () @@ -589,7 +589,7 @@ ) (pad-buttons l1 r1) ) - (and (>= (- (-> *display* base-frame-counter) (-> *TARGET-bank* wheel-timeout)) (-> self control unknown-dword30)) + (and (time-elapsed? (-> *TARGET-bank* wheel-timeout) (-> self control unknown-dword30)) (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?)) ) ) @@ -630,7 +630,7 @@ (if (can-hands? #t) (go target-running-attack) ) - (when (and (turn-around?) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.3))) + (when (and (turn-around?) (time-elapsed? (-> self state-time) (seconds 0.3))) (set! (-> self control transv quad) (-> self control unknown-vector-array10 (-> self control unknown-int10) quad) ) @@ -790,10 +790,10 @@ ) (until (ja-done? 0) (suspend) - (ja :num! (seek! max (/ (* (fmax 20480.0 (-> self control unknown-float01)) (-> *display* seconds-per-frame)) - (/ (-> *TARGET-bank* run-up-cycle-dist) (-> *TARGET-bank* run-cycle-length)) - ) - ) + (ja :num! (seek! max (/ (* (fmax 20480.0 (-> self control unknown-float01)) (seconds-per-frame)) + (/ (-> *TARGET-bank* run-up-cycle-dist) (-> *TARGET-bank* run-cycle-length)) + ) + ) ) ) (set! f28-0 30.0) @@ -860,7 +860,7 @@ (set! f30-0 (seek f30-0 (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -16384.0 (-> self control unknown-float01))))) - (* 2.0 (-> *display* seconds-per-frame)) + (* 2.0 (seconds-per-frame)) ) ) (let ((v1-317 (-> self skel effect))) @@ -979,7 +979,7 @@ (go target-running-attack) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.08)) + (time-elapsed? (-> self control unknown-dword11) (seconds 0.08)) ) (go target-falling #f) ) @@ -1013,7 +1013,7 @@ (set! (-> self control unknown-surface00) *jump-mods*) ) :exit (behavior () - (set! (-> self control unknown-dword35) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword35)) ) :trans (behavior () (when (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) @@ -1045,7 +1045,7 @@ (defbehavior init-var-jump target ((arg0 float) (arg1 float) (arg2 vector) (arg3 vector) (arg4 vector)) (logclear! (-> self control status) (cshape-moving-flags csmf14)) (delete-back-vel) - (when (< (- (-> *display* base-frame-counter) (-> self control rider-time)) (seconds 0.05)) + (when (not (time-elapsed? (-> self control rider-time) (seconds 0.05))) (let ((f0-1 (fmax 0.0 @@ -1109,7 +1109,7 @@ ;; INFO: Used lq/sq (defbehavior mod-var-jump target ((arg0 symbol) (arg1 symbol) (arg2 symbol) (arg3 vector)) (local-vars (v0-2 vector)) - (let ((f30-0 (* 0.033333335 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (let ((f30-0 (* 0.033333335 (the float (- (current-time) (-> self state-time)))))) (cond ((or (< 1.0 f30-0) (< (-> self control unknown-float123) 0.0) (not arg2)) (set! (-> self control unknown-float123) -1.0) @@ -1369,7 +1369,7 @@ (go target-launch (the-as float a0-9) (the-as symbol a1-5) a2-5 (-> self control unknown-dword63)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 70) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) @@ -1417,9 +1417,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -1441,7 +1439,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 float) (arg1 float) (arg2 surface)) @@ -1519,7 +1517,7 @@ (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-0 (-> self control unknown-dword63)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *double-jump-mods*) @@ -1535,9 +1533,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -1554,13 +1550,13 @@ ) ) ) - (if (!= (-> self state-time) (-> *display* base-frame-counter)) + (if (!= (-> self state-time) (current-time)) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) ) (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 float) (arg1 float)) @@ -1596,7 +1592,7 @@ (if (or (= arg2 'duck) (= arg2 'launch)) (go target-duck-high-jump arg0 arg1 (the-as symbol arg2)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (sound-play "jump" :pitch 0.3) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) @@ -1633,9 +1629,7 @@ ) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -1656,7 +1650,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (-> target-jump code) @@ -1667,7 +1661,7 @@ (defstate target-duck-high-jump (target) :event target-standard-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *turn-around-mods*) ) @@ -1701,7 +1695,7 @@ (defstate target-duck-high-jump-jump (target) :event target-jump-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 80 :pitch -0.4) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) @@ -1780,7 +1774,7 @@ :enter (behavior ((arg0 symbol)) (set! (-> self control unknown-surface00) *jump-mods*) (set! (-> self control unknown-uint20) (the-as uint arg0)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (target-falling-trans @@ -1899,7 +1893,7 @@ (defstate target-attack (target) :event target-dangerous-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (target-start-attack) (target-danger-set! 'spin #f) (set! (-> self control unknown-surface00) *attack-mods*) @@ -1907,7 +1901,7 @@ (set! (-> self neck flex-blend) 0.0) ) :exit (behavior () - (set! (-> self control unknown-dword33) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword33)) (target-exit) ) :code (behavior () @@ -1970,7 +1964,7 @@ ) ) (when gp-1 - (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self control unknown-uint20) (the-as uint (current-time))) (let ((v1-9 (if (and (nonzero? proc) (type-type? (-> proc type) process-drawable)) proc ) @@ -1993,7 +1987,7 @@ ) ) (when (or (= gp-1 'die) (= gp-1 'push)) - (let ((v0-2 (the-as object (-> *display* base-frame-counter)))) + (let ((v0-2 (the-as object (current-time)))) (set! (-> self control unknown-int21) (the-as int v0-2)) v0-2 ) @@ -2015,11 +2009,11 @@ (if (or (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 1.5)) + (not (time-elapsed? (-> self control unknown-dword82) (seconds 1.5))) ) (go target-yellow-blast) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control unknown-int21) 0) (set! (-> self control unknown-uint31) (the-as uint 0)) @@ -2037,18 +2031,18 @@ (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) - (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword31)) (target-exit) ) :trans (behavior () - (when (!= (-> self state-time) (-> *display* base-frame-counter)) + (when (!= (-> self state-time) (current-time)) (if (and (or (smack-surface? #t) (and (>= (-> self control unknown-float63) 0.7) (not (logtest? (-> self control status) (cshape-moving-flags t-act))) ) ) (begin - (set! (-> self control unknown-int21) (the-as int (-> *display* base-frame-counter))) + (set! (-> self control unknown-int21) (the-as int (current-time))) (set! (-> self control unknown-float81) 0.0) (let ((gp-0 (new-stack-vector0)) (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -2069,9 +2063,7 @@ #t ) (or (zero? (-> self control unknown-uint20)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.04)) ) (!= (-> self control unknown-uint31) 1) ) @@ -2084,7 +2076,7 @@ ) (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) x) (and (< 4096.0 (-> self control unknown-float01)) - (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (or (time-elapsed? (-> self state-time) (seconds 0.1)) (not (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons square) ) @@ -2101,7 +2093,7 @@ ) ) (if (and (logtest? (-> self water flags) (water-flags wt09)) - (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) + (zero? (mod (- (current-time) (-> self state-time)) 21)) ) (create-splash (-> self water) @@ -2144,7 +2136,7 @@ (cond ((and (>= (ja-aframe-num 0) 20.0) (and (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-39 (ja-group))) (or (not (or (= v1-39 eichar-attack-punch-ja) @@ -2156,22 +2148,18 @@ ) ) ) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.04)) ) ) (go target-falling #f) ) ((and (nonzero? (-> self control unknown-uint30)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint30)) (seconds 0.04)) ) (set-forward-vel (the-as float 0.0)) ) ((and (not (cpad-hold? (-> self control unknown-cpad-info00 number) square)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) ) (if (= (-> self control ground-pat material) (pat-material ice)) (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control unknown-float01)))) @@ -2196,7 +2184,7 @@ ) (suspend) (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (if (< 2 gp-2) @@ -2206,7 +2194,7 @@ ) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *TARGET-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *TARGET-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-121 (ja-group))) (or (not (or (= v1-121 eichar-attack-punch-ja) @@ -2241,7 +2229,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (target-start-attack) (target-danger-set! 'spin-air #f) @@ -2267,8 +2255,8 @@ ) ) (else - (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (-> *display* seconds-per-frame)))) - (f30-0 (* 0.5 f1-5 (-> *display* seconds-per-frame) f0-1)) + (let* ((f1-5 (/ f0-1 (* (-> self control dynam gravity-length) (seconds-per-frame)))) + (f30-0 (* 0.5 f1-5 (seconds-per-frame) f0-1)) ) (if (ja-group? eichar-attack-uppercut-ja) (set! f30-0 @@ -2316,14 +2304,14 @@ (set-quaternion! (-> self control) (-> self control dir-targ)) (go target-hit-ground #f) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (seek! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length) - (* 245760.0 (-> *display* seconds-per-frame)) + (* 245760.0 (seconds-per-frame)) ) ) - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.05)) (< (vector-dot (-> self control dynam gravity-normal) (-> self control unknown-vector10)) (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) ) @@ -2360,13 +2348,13 @@ (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) (while (not (or (and (< (fabs (/ f0-8 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.7)) + (time-elapsed? (-> self state-time) (seconds 1.7)) ) ) (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) - (* f30-0 (-> *display* seconds-per-frame)) + (* f30-0 (seconds-per-frame)) ) (suspend) (ja :num! (loop!)) @@ -2381,7 +2369,7 @@ (quaternion-rotate-y! (-> self control unknown-quaternion00) (-> self control unknown-quaternion00) - (* f30-0 (-> *display* seconds-per-frame)) + (* f30-0 (seconds-per-frame)) ) ) (else @@ -2413,7 +2401,7 @@ (defstate target-attack-uppercut (target) :event target-dangerous-event-handler :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (target-start-attack) (target-danger-set! 'uppercut #f) (set! (-> self control unknown-surface00) *turn-around-mods*) @@ -2448,7 +2436,7 @@ ) (set-forward-vel (the-as float 32768.0)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *uppercut-jump-mods*) @@ -2463,9 +2451,7 @@ (when (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -2581,7 +2567,7 @@ (set-forward-vel arg2) (set-forward-vel (-> self control unknown-float01)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flop-mods*) (set! (-> self control unknown-uint20) (the-as uint 0)) @@ -2623,7 +2609,7 @@ (not (logtest? (-> self control status) (cshape-moving-flags t-act))) (>= (-> self control unknown-uint20) (the-as uint 2)) ) - (set! (-> self control unknown-dword36) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword36)) (set! gp-1 'stuck) ) ) @@ -2640,11 +2626,8 @@ (ppointer->process s5-1) 'function (lambda ((arg0 target)) - (set! (-> arg0 control root-prim local-sphere w) (seek - (-> arg0 control root-prim local-sphere w) - (the-as float 28672.0) - (* 286720.0 (-> *display* seconds-per-frame)) - ) + (set! (-> arg0 control root-prim local-sphere w) + (seek (-> arg0 control root-prim local-sphere w) (the-as float 28672.0) (* 286720.0 (seconds-per-frame))) ) ) ) @@ -2761,7 +2744,7 @@ ) ) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *TARGET-bank* fall-timeout)) + (if (time-elapsed? (-> self state-time) (-> *TARGET-bank* fall-timeout)) (go target-falling #f) ) (if (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2) (not *pause-lock*)) @@ -2799,7 +2782,7 @@ ) (target-land-effect) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-uint20) (the-as uint arg0)) (set-forward-vel (the-as float 0.0)) (set! (-> self control unknown-surface00) *flop-land-mods*) @@ -2816,7 +2799,7 @@ (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-red)) (>= (-> self fact-info-target eco-level) 1.0) ) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) + (not (time-elapsed? (-> self state-time) (seconds 0.25))) ) (effect-control-method-10 (-> self skel effect) @@ -2854,7 +2837,7 @@ (target-standard-event-handler proc argc message block) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *wheel-mods*) (+! (-> self control unknown-int50) 1) (rot->dir-targ! (-> self control)) @@ -2872,7 +2855,7 @@ :exit (behavior () (when (!= (-> self next-state name) 'target-wheel) (set! (-> self control unknown-int50) 0) - (set! (-> self control unknown-dword30) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword30)) ) (target-exit) ) @@ -2886,13 +2869,11 @@ (ja :group! eichar-duck-roll-ja :num! min) (until (ja-done? 0) (if (cpad-pressed? (-> self control unknown-cpad-info00 number) x) - (set! gp-0 (the-as int (-> *display* base-frame-counter))) + (set! gp-0 (the-as int (current-time))) ) (when (and (or (smack-surface? #f) (>= (-> self control unknown-float63) 0.7)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 3) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1) + (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.01)) + (time-elapsed? (-> self state-time) 1) ) (if (>= 6.0 (ja-aframe-num 0)) (target-shoved @@ -2903,11 +2884,11 @@ ) ) (if (zero? s5-0) - (set! s5-0 (the-as int (-> *display* base-frame-counter))) + (set! s5-0 (the-as int (current-time))) ) ) (if (cpad-pressed? (-> self control unknown-cpad-info00 number) square) - (-> *display* base-frame-counter) + (current-time) ) (compute-alignment! (-> self align)) (cond @@ -2927,7 +2908,7 @@ (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) ) ) - (if (and (or (< (- (-> *display* base-frame-counter) (the-as time-frame gp-0)) (-> *TARGET-bank* wheel-jump-pre-window)) + (if (and (or (not (time-elapsed? (the-as time-frame gp-0) (-> *TARGET-bank* wheel-jump-pre-window))) (cpad-pressed? (-> self control unknown-cpad-info00 number) x) ) (can-jump? 'target-wheel-flip) @@ -2935,12 +2916,12 @@ (go target-wheel-flip (-> *TARGET-bank* wheel-flip-height) (-> *TARGET-bank* wheel-flip-dist)) ) ) - (set! (-> self state-hook-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-hook-time)) (set! (-> self state-hook) (lambda :behavior target () (cond - ((>= (- (-> *display* base-frame-counter) (-> self state-hook-time)) (-> *TARGET-bank* wheel-jump-post-window)) + ((time-elapsed? (-> self state-hook-time) (-> *TARGET-bank* wheel-jump-post-window)) (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) ) (else @@ -2976,7 +2957,7 @@ (if (and (or (smack-surface? #f) (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) ) - (!= (-> self state-time) (-> *display* base-frame-counter)) + (!= (-> self state-time) (current-time)) ) (target-shoved (-> *TARGET-bank* smack-surface-dist) @@ -3031,9 +3012,9 @@ (set! f30-0 (* f30-0 (fmin 1.0 (-> self control unknown-float140)))) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (while (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.01)) + (when (time-elapsed? (-> self state-time) (seconds 0.01)) (when (not (ja-group? eichar-jump-loop-ja)) (ja-channel-push! 1 (seconds 0.1)) (ja :group! eichar-jump-loop-ja :num! min) @@ -3062,12 +3043,12 @@ ) ) (target-land-effect) - (set! (-> self state-hook-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-hook-time)) (set! (-> self state-hook) (lambda :behavior target () (cond - ((>= (- (-> *display* base-frame-counter) (-> self state-hook-time)) (seconds 0.1)) + ((time-elapsed? (-> self state-hook-time) (seconds 0.1)) (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) ) (else diff --git a/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc index 2ac6c5a30d..099912eeba 100644 --- a/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/hud-classes_REF.gc @@ -134,29 +134,29 @@ ) ;; definition for method 3 of type hud-pickups -(defmethod inspect hud-pickups ((obj hud-pickups)) +(defmethod inspect hud-pickups ((this hud-pickups)) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 15 of type hud-pickups ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-pickups ((obj hud-pickups)) +(defmethod draw-hud hud-pickups ((this hud-pickups)) (let ((t9-0 (method-of-type hud draw-hud))) - (t9-0 obj) + (t9-0 this) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> s5-0 base)) ) (let ((s4-0 draw-string-xy)) - (format (clear *temp-string*) "~D" (-> obj value)) + (format (clear *temp-string*) "~D" (-> this value)) (s4-0 *temp-string* s5-0 - (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset))) - (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) + (+ (-> this text-x) (* (-> this x-sgn) (-> this offset))) + (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale)) ) 2 @@ -186,9 +186,9 @@ ;; definition for method 19 of type hud-pickups ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-pickups ((obj hud-pickups)) +(defmethod hud-update hud-pickups ((this hud-pickups)) (if *target* - (tally-value obj (the int (+ 0.5 (-> *target* fact-info-target eco-pill))) 0) + (tally-value this (the int (+ 0.5 (-> *target* fact-info-target eco-pill))) 0) ) 0 (none) @@ -196,28 +196,28 @@ ;; definition for method 20 of type hud-pickups ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-pickups ((obj hud-pickups) (arg0 int)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 75) obj)) - (set! (-> obj particles s5-0 init-pos x) 110.0) - (set! (-> obj particles s5-0 init-pos y) 55.0) - (set! (-> obj particles s5-0 init-pos z) 1.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod init-particles! hud-pickups ((this hud-pickups) (arg0 int)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 75) this)) + (set! (-> this particles s5-0 init-pos x) 110.0) + (set! (-> this particles s5-0 init-pos y) 55.0) + (set! (-> this particles s5-0 init-pos z) 1.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-1 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-1 part matrix) -1) - (set! (-> obj particles s5-1 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-1 (-> this nb-of-particles)) + (if (= (-> this particles s5-1 part matrix) -1) + (set! (-> this particles s5-1 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set! (-> obj text-x) 118) - (set! (-> obj text-y) 45) - (set! (-> obj x-sgn) -1) - (set! (-> obj y-sgn) -1) - (set! (-> obj friend) 3) + (set! (-> this text-x) 118) + (set! (-> this text-y) 45) + (set! (-> this x-sgn) -1) + (set! (-> this y-sgn) -1) + (set! (-> this friend) 3) 0 (none) ) @@ -305,12 +305,12 @@ ) ;; definition for method 3 of type hud-health -(defmethod inspect hud-health ((obj hud-health)) +(defmethod inspect hud-health ((this hud-health)) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tscale: ~f~%" (-> obj scale)) - obj + (format #t "~T~Tscale: ~f~%" (-> this scale)) + this ) ;; definition for function part-hud-health-01-func @@ -378,18 +378,18 @@ ;; definition for method 15 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-health ((obj hud-health)) - ((method-of-type hud draw-hud) obj) +(defmethod draw-hud hud-health ((this hud-health)) + ((method-of-type hud draw-hud) this) 0 (none) ) ;; definition for method 19 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-health ((obj hud-health)) +(defmethod hud-update hud-health ((this hud-health)) (if *target* (tally-value - obj + this (the int (-> *target* fact-info-target health)) (the-as int (-> *target* fact-info-target health-pickup-time)) ) @@ -400,74 +400,74 @@ ;; definition for method 20 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-health ((obj hud-health) (arg0 int)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 76) obj)) - (set! (-> obj particles s5-0 init-pos x) 61.0) - (set! (-> obj particles s5-0 init-pos y) 55.0) - (set! (-> obj particles s5-0 init-pos z) 5.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod init-particles! hud-health ((this hud-health) (arg0 int)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 76) this)) + (set! (-> this particles s5-0 init-pos x) 61.0) + (set! (-> this particles s5-0 init-pos y) 55.0) + (set! (-> this particles s5-0 init-pos z) 5.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 77) obj)) - (set! (-> obj particles s5-1 init-pos x) 98.0) - (set! (-> obj particles s5-1 init-pos y) 55.0) - (set! (-> obj particles s5-1 init-pos z) 5.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 77) this)) + (set! (-> this particles s5-1 init-pos x) 98.0) + (set! (-> this particles s5-1 init-pos y) 55.0) + (set! (-> this particles s5-1 init-pos z) 5.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 78) obj)) - (set! (-> obj particles s5-2 init-pos x) 70.0) - (set! (-> obj particles s5-2 init-pos y) 76.0) - (set! (-> obj particles s5-2 init-pos z) 5.0) - (set! (-> obj particles s5-2 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-2 (-> this nb-of-particles))) + (set! (-> this particles s5-2) (new 'static 'hud-particle)) + (set! (-> this particles s5-2 part) (create-launch-control (-> *part-group-id-table* 78) this)) + (set! (-> this particles s5-2 init-pos x) 70.0) + (set! (-> this particles s5-2 init-pos y) 76.0) + (set! (-> this particles s5-2 init-pos z) 5.0) + (set! (-> this particles s5-2 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-3 part matrix) -1) - (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-3 (-> this nb-of-particles)) + (if (= (-> this particles s5-3 part matrix) -1) + (set! (-> this particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) - (set! (-> obj x-sgn) -1) - (set! (-> obj y-sgn) -1) - (set! (-> obj friend) 0) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set! (-> this x-sgn) -1) + (set! (-> this y-sgn) -1) + (set! (-> this friend) 0) 0 (none) ) ;; definition for method 24 of type hud-health ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-health ((obj hud-health) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-health ((this hud-health) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj particles 0 init-pos x) 65.0) - (set! (-> obj particles 0 init-pos y) 55.0) - (set! (-> obj particles 1 init-pos x) 98.0) - (set! (-> obj particles 1 init-pos y) 55.0) - (set! (-> obj particles 2 init-pos x) 73.0) - (set! (-> obj particles 2 init-pos y) 80.0) - (set! (-> obj scale) 6144.0) + (set! (-> this particles 0 init-pos x) 65.0) + (set! (-> this particles 0 init-pos y) 55.0) + (set! (-> this particles 1 init-pos x) 98.0) + (set! (-> this particles 1 init-pos y) 55.0) + (set! (-> this particles 2 init-pos x) 73.0) + (set! (-> this particles 2 init-pos y) 80.0) + (set! (-> this scale) 6144.0) ) (else - (set! (-> obj particles 0 init-pos x) 61.0) - (set! (-> obj particles 0 init-pos y) 55.0) - (set! (-> obj particles 1 init-pos x) 98.0) - (set! (-> obj particles 1 init-pos y) 55.0) - (set! (-> obj particles 2 init-pos x) 70.0) - (set! (-> obj particles 2 init-pos y) 76.0) - (set! (-> obj scale) 6963.2) + (set! (-> this particles 0 init-pos x) 61.0) + (set! (-> this particles 0 init-pos y) 55.0) + (set! (-> this particles 1 init-pos x) 98.0) + (set! (-> this particles 1 init-pos y) 55.0) + (set! (-> this particles 2 init-pos x) 70.0) + (set! (-> this particles 2 init-pos y) 76.0) + (set! (-> this scale) 6963.2) ) ) 0 @@ -513,35 +513,35 @@ ) ;; definition for method 3 of type hud-money-all -(defmethod inspect hud-money-all ((obj hud-money-all)) +(defmethod inspect hud-money-all ((this hud-money-all)) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tx-scale: ~f~%" (-> obj x-scale)) - (format #t "~T~Ty-scale: ~f~%" (-> obj y-scale)) - (format #t "~T~Ty-pos: ~D~%" (-> obj y-pos)) - (format #t "~T~Ttotal-orbs: ~D~%" (-> obj total-orbs)) - (format #t "~T~Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~T~Tstart-time: ~D~%" (-> obj start-time)) - obj + (format #t "~T~Tx-scale: ~f~%" (-> this x-scale)) + (format #t "~T~Ty-scale: ~f~%" (-> this y-scale)) + (format #t "~T~Ty-pos: ~D~%" (-> this y-pos)) + (format #t "~T~Ttotal-orbs: ~D~%" (-> this total-orbs)) + (format #t "~T~Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~T~Tstart-time: ~D~%" (-> this start-time)) + this ) ;; definition for method 15 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-money-all ((obj hud-money-all)) +(defmethod draw-hud hud-money-all ((this hud-money-all)) (let ((t9-0 (method-of-type hud draw-hud))) - (t9-0 obj) + (t9-0 this) ) 0 (let ((s5-0 0)) - (when (>= (-> obj level-index) 0) + (when (>= (-> this level-index) 0) (let ((s5-1 (new 'stack 'font-context *font-default-matrix* - (+ (* (-> obj x-sgn) (-> obj offset)) -60 (-> obj text-x)) - (+ (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) + (+ (* (-> this x-sgn) (-> this offset)) -60 (-> this text-x)) + (+ (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale)) ) 2 @@ -565,7 +565,7 @@ ) (set! (-> s5-1 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text - (lookup-text! *common-text* (-> *level-task-data* (-> obj level-index) level-name-id) #f) + (lookup-text! *common-text* (-> *level-task-data* (-> this level-index) level-name-id) #f) s5-1 #f 128 @@ -579,12 +579,12 @@ (s4-1 (-> s3-0 base)) ) (let ((s2-0 draw-string-xy)) - (format (clear *temp-string*) "~D/~D" (-> obj total-orbs) (-> obj total-orbs)) + (format (clear *temp-string*) "~D/~D" (-> this total-orbs) (-> this total-orbs)) (s2-0 *temp-string* s3-0 - (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset)) s1-0) - (+ (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) + (+ (-> this text-x) (* (-> this x-sgn) (-> this offset)) s1-0) + (+ (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale)) ) 2 @@ -617,15 +617,15 @@ ;; definition for method 19 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-money-all ((obj hud-money-all)) +(defmethod hud-update hud-money-all ((this hud-money-all)) (when *target* (hide-bottom-hud) (when (!= *master-mode* 'pause) - (when (and (!= (-> obj icons 0) 0) (-> obj icons 0 icon)) - (set! (-> obj icons 0 scale-x) (-> obj x-scale)) - (set! (-> obj icons 0 scale-y) (-> obj y-scale)) - (set! (-> obj icons 0 icon-y) (* (-> obj y-pos) (the int (-> *video-parms* relative-y-scale)))) - (let ((a0-6 (-> obj icons 0 icon 0 root))) + (when (and (!= (-> this icons 0) 0) (-> this icons 0 icon)) + (set! (-> this icons 0 scale-x) (-> this x-scale)) + (set! (-> this icons 0 scale-y) (-> this y-scale)) + (set! (-> this icons 0 icon-y) (* (-> this y-pos) (the int (-> *video-parms* relative-y-scale)))) + (let ((a0-6 (-> this icons 0 icon 0 root))) (set-yaw-angle-clear-roll-pitch! a0-6 (- (y-angle a0-6) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) @@ -633,9 +633,9 @@ ) ) ) - (if (>= (+ (-> *display* base-frame-counter) (seconds -5)) (-> obj start-time)) - (set! (-> obj deactivate-when-hidden) #t) - (tally-value obj (the-as int (-> *display* base-frame-counter)) 0) + (if (>= (+ (current-time) (seconds -5)) (-> this start-time)) + (set! (-> this deactivate-when-hidden) #t) + (tally-value this (the-as int (current-time)) 0) ) ) 0 @@ -644,11 +644,11 @@ ;; definition for method 20 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-money-all ((obj hud-money-all) (arg0 int)) - (when (< (-> obj nb-of-icons) 6) - (let ((s4-0 (-> obj nb-of-icons))) - (set! (-> obj icons s4-0) (new 'static 'hud-icon)) - (let ((s3-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to obj))) +(defmethod init-particles! hud-money-all ((this hud-money-all) (arg0 int)) + (when (< (-> this nb-of-icons) 6) + (let ((s4-0 (-> this nb-of-icons))) + (set! (-> this icons s4-0) (new 'static 'hud-icon)) + (let ((s3-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to this))) (when s3-0 (set! (-> (the-as process-drawable (-> s3-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s3-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -657,42 +657,42 @@ (send-event (ppointer->process s3-0) 'trans-hook #f) ) ) - (set! (-> obj icons s4-0 icon) (the-as (pointer manipy) s3-0)) + (set! (-> this icons s4-0 icon) (the-as (pointer manipy) s3-0)) (when s3-0 (logior! (-> s3-0 0 mask) (process-mask pause)) (logclear! (-> s3-0 0 mask) (process-mask menu progress)) (set! (-> (the-as process-drawable (-> s3-0 0)) root trans z) 1024.0) - (set! (-> obj icons s4-0 icon-x) 170) - (set! (-> obj icons s4-0 icon-y) 0) - (set! (-> obj icons s4-0 icon-z) 0) - (set! (-> obj icons s4-0 scale-x) 0.0095) - (set! (-> obj icons s4-0 scale-y) -0.011) + (set! (-> this icons s4-0 icon-x) 170) + (set! (-> this icons s4-0 icon-y) 0) + (set! (-> this icons s4-0 icon-z) 0) + (set! (-> this icons s4-0 scale-x) 0.0095) + (set! (-> this icons s4-0 scale-y) -0.011) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s4-1 (-> obj nb-of-particles))) - (set! (-> obj particles s4-1) (new 'static 'hud-particle)) - (set! (-> obj particles s4-1 part) (create-launch-control (-> *part-group-id-table* 705) obj)) - (set! (-> obj particles s4-1 init-pos x) 172.0) - (set! (-> obj particles s4-1 init-pos y) 330.0) - (set! (-> obj particles s4-1 init-pos z) 2.0) - (set! (-> obj particles s4-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s4-1 (-> this nb-of-particles))) + (set! (-> this particles s4-1) (new 'static 'hud-particle)) + (set! (-> this particles s4-1 part) (create-launch-control (-> *part-group-id-table* 705) this)) + (set! (-> this particles s4-1 init-pos x) 172.0) + (set! (-> this particles s4-1 init-pos y) 330.0) + (set! (-> this particles s4-1 init-pos z) 2.0) + (set! (-> this particles s4-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) - (dotimes (s4-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s4-3 part matrix) -1) - (set! (-> obj particles s4-3 part matrix) (sprite-allocate-user-hvdf)) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (dotimes (s4-3 (-> this nb-of-particles)) + (if (= (-> this particles s4-3 part matrix) -1) + (set! (-> this particles s4-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set! (-> obj text-x) 251) - (set! (-> obj text-y) 305) - (set! (-> obj x-sgn) 0) - (set! (-> obj y-sgn) 1) + (set! (-> this text-x) 251) + (set! (-> this text-y) 305) + (set! (-> this x-sgn) 0) + (set! (-> this y-sgn) 1) (hide-bottom-hud) (let ((s4-4 0) (s3-2 0) @@ -713,19 +713,19 @@ ) (cond ((= s3-2 s4-4) - (set! (-> obj total-orbs) s4-4) - (set! (-> obj total-orbs) s4-4) - (set! (-> obj level-index) -1) + (set! (-> this total-orbs) s4-4) + (set! (-> this total-orbs) s4-4) + (set! (-> this level-index) -1) ) - ((begin (set! (-> obj total-orbs) s2-2) (< arg0 (length *level-task-data*))) - (set! (-> obj level-index) arg0) + ((begin (set! (-> this total-orbs) s2-2) (< arg0 (length *level-task-data*))) + (set! (-> this level-index) arg0) ) (else - (set! (-> obj level-index) -1) + (set! (-> this level-index) -1) ) ) ) - (set! (-> obj start-time) (-> *display* base-frame-counter)) + (set-time! (-> this start-time)) (sound-play "get-all-orbs") 0 (none) @@ -733,27 +733,27 @@ ;; definition for method 24 of type hud-money-all ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-money-all ((obj hud-money-all) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-money-all ((this hud-money-all) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj x-scale) 0.01845) - (set! (-> obj y-scale) -0.02175) - (set! (-> obj y-pos) (if arg1 - 374 - 373 - ) + (set! (-> this x-scale) 0.01845) + (set! (-> this y-scale) -0.02175) + (set! (-> this y-pos) (if arg1 + 374 + 373 + ) ) ) (else - (set! (-> obj x-scale) 0.013499999) - (set! (-> obj y-scale) -0.01575) - (set! (-> obj y-pos) 361) + (set! (-> this x-scale) 0.013499999) + (set! (-> this y-scale) -0.01575) + (set! (-> this y-pos) 361) ) ) (when arg1 - (set! (-> obj x-scale) (* 1.02 (-> obj x-scale))) - (set! (-> obj y-scale) (* 1.2 (-> obj y-scale))) - (set! (-> obj y-pos) (the int (* 1.21 (the float (-> obj y-pos))))) + (set! (-> this x-scale) (* 1.02 (-> this x-scale))) + (set! (-> this y-scale) (* 1.2 (-> this y-scale))) + (set! (-> this y-pos) (the int (* 1.21 (the float (-> this y-pos))))) ) 0 (none) @@ -795,32 +795,32 @@ ) ;; definition for method 3 of type hud-money -(defmethod inspect hud-money ((obj hud-money)) +(defmethod inspect hud-money ((this hud-money)) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tx-scale: ~f~%" (-> obj x-scale)) - (format #t "~T~Ty-scale: ~f~%" (-> obj y-scale)) - (format #t "~T~Ty-pos: ~D~%" (-> obj y-pos)) - obj + (format #t "~T~Tx-scale: ~f~%" (-> this x-scale)) + (format #t "~T~Ty-scale: ~f~%" (-> this y-scale)) + (format #t "~T~Ty-pos: ~D~%" (-> this y-pos)) + this ) ;; definition for method 15 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-money ((obj hud-money)) +(defmethod draw-hud hud-money ((this hud-money)) (let ((t9-0 (method-of-type hud draw-hud))) - (t9-0 obj) + (t9-0 this) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> s5-0 base)) ) (let ((s4-0 draw-string-xy)) - (format (clear *temp-string*) "~D" (-> obj value)) + (format (clear *temp-string*) "~D" (-> this value)) (s4-0 *temp-string* s5-0 - (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset))) - (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) + (+ (-> this text-x) (* (-> this x-sgn) (-> this offset))) + (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale)) ) 2 @@ -850,14 +850,14 @@ ;; definition for method 19 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-money ((obj hud-money)) +(defmethod hud-update hud-money ((this hud-money)) (when *target* (when (!= *master-mode* 'pause) - (when (and (!= (-> obj icons 0) 0) (-> obj icons 0 icon)) - (set! (-> obj icons 0 scale-x) (-> obj x-scale)) - (set! (-> obj icons 0 scale-y) (-> obj y-scale)) - (set! (-> obj icons 0 icon-y) (* (-> obj y-pos) (the int (-> *video-parms* relative-y-scale)))) - (let ((a0-6 (-> obj icons 0 icon 0 root))) + (when (and (!= (-> this icons 0) 0) (-> this icons 0 icon)) + (set! (-> this icons 0 scale-x) (-> this x-scale)) + (set! (-> this icons 0 scale-y) (-> this y-scale)) + (set! (-> this icons 0 icon-y) (* (-> this y-pos) (the int (-> *video-parms* relative-y-scale)))) + (let ((a0-6 (-> this icons 0 icon 0 root))) (set-yaw-angle-clear-roll-pitch! a0-6 (- (y-angle a0-6) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) @@ -865,7 +865,7 @@ ) ) ) - (tally-value obj (the int (+ 0.5 (-> *target* game money))) 0) + (tally-value this (the int (+ 0.5 (-> *target* game money))) 0) ) 0 (none) @@ -873,11 +873,11 @@ ;; definition for method 20 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-money ((obj hud-money) (arg0 int)) - (when (< (-> obj nb-of-icons) 6) - (let ((s5-0 (-> obj nb-of-icons))) - (set! (-> obj icons s5-0) (new 'static 'hud-icon)) - (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to obj))) +(defmethod init-particles! hud-money ((this hud-money) (arg0 int)) + (when (< (-> this nb-of-icons) 6) + (let ((s5-0 (-> this nb-of-icons))) + (set! (-> this icons s5-0) (new 'static 'hud-icon)) + (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *money-sg* #f :to this))) (when s4-0 (set! (-> (the-as process-drawable (-> s4-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s4-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -886,71 +886,71 @@ (send-event (ppointer->process s4-0) 'trans-hook #f) ) ) - (set! (-> obj icons s5-0 icon) (the-as (pointer manipy) s4-0)) + (set! (-> this icons s5-0 icon) (the-as (pointer manipy) s4-0)) (when s4-0 (logior! (-> s4-0 0 mask) (process-mask pause)) (logclear! (-> s4-0 0 mask) (process-mask menu progress)) (set! (-> (the-as process-drawable (-> s4-0 0)) root trans z) 1024.0) - (set! (-> obj icons s5-0 icon-x) 399) - (set! (-> obj icons s5-0 icon-y) 79) - (set! (-> obj icons s5-0 icon-z) 0) - (set! (-> obj icons s5-0 scale-x) 0.0095) - (set! (-> obj icons s5-0 scale-y) -0.011) + (set! (-> this icons s5-0 icon-x) 399) + (set! (-> this icons s5-0 icon-y) 79) + (set! (-> this icons s5-0 icon-z) 0) + (set! (-> this icons s5-0 scale-x) 0.0095) + (set! (-> this icons s5-0 scale-y) -0.011) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 79) obj)) - (set! (-> obj particles s5-1 init-pos x) 400.0) - (set! (-> obj particles s5-1 init-pos y) 58.0) - (set! (-> obj particles s5-1 init-pos z) 2.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 79) this)) + (set! (-> this particles s5-1 init-pos x) 400.0) + (set! (-> this particles s5-1 init-pos y) 58.0) + (set! (-> this particles s5-1 init-pos z) 2.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) - (dotimes (s5-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-3 part matrix) -1) - (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (dotimes (s5-3 (-> this nb-of-particles)) + (if (= (-> this particles s5-3 part matrix) -1) + (set! (-> this particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set! (-> obj text-x) 420) - (set! (-> obj text-y) 45) - (set! (-> obj x-sgn) 1) - (set! (-> obj y-sgn) -1) - (set! (-> obj increment-on-event) #t) + (set! (-> this text-x) 420) + (set! (-> this text-y) 45) + (set! (-> this x-sgn) 1) + (set! (-> this y-sgn) -1) + (set! (-> this increment-on-event) #t) 0 (none) ) ;; definition for method 24 of type hud-money ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-money ((obj hud-money) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-money ((this hud-money) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj x-scale) 0.0123) - (set! (-> obj y-scale) -0.0145) - (set! (-> obj y-pos) 86) + (set! (-> this x-scale) 0.0123) + (set! (-> this y-scale) -0.0145) + (set! (-> this y-pos) 86) ) (else - (set! (-> obj x-scale) 0.0095) - (set! (-> obj y-scale) -0.011) - (set! (-> obj y-pos) 79) + (set! (-> this x-scale) 0.0095) + (set! (-> this y-scale) -0.011) + (set! (-> this y-pos) 79) ) ) (when arg1 - (set! (-> obj x-scale) (* 1.1 (-> obj x-scale))) - (set! (-> obj y-scale) (* 1.2 (-> obj y-scale))) - (set! (-> obj y-pos) (the int (* (the float (-> obj y-pos)) (if arg0 - 0.95 - 0.9 - ) - ) - ) + (set! (-> this x-scale) (* 1.1 (-> this x-scale))) + (set! (-> this y-scale) (* 1.2 (-> this y-scale))) + (set! (-> this y-pos) (the int (* (the float (-> this y-pos)) (if arg0 + 0.95 + 0.9 + ) + ) + ) ) ) 0 @@ -958,22 +958,22 @@ ) ;; definition for method 21 of type hud-money -(defmethod get-icon-pos-x hud-money ((obj hud-money)) - (-> obj icons 0 icon-x) +(defmethod get-icon-pos-x hud-money ((this hud-money)) + (-> this icons 0 icon-x) ) ;; definition for method 22 of type hud-money -(defmethod get-icon-pos-y hud-money ((obj hud-money)) - (-> obj icons 0 icon-y) +(defmethod get-icon-pos-y hud-money ((this hud-money)) + (-> this icons 0 icon-y) ) ;; definition for method 25 of type hud-money -(defmethod get-icon-scale-x hud-money ((obj hud-money)) +(defmethod get-icon-scale-x hud-money ((this hud-money)) 0.01 ) ;; definition for method 26 of type hud-money -(defmethod get-icon-scale-y hud-money ((obj hud-money)) +(defmethod get-icon-scale-y hud-money ((this hud-money)) -0.011 ) @@ -1210,36 +1210,36 @@ ) ;; definition for method 3 of type hud-fuel-cell -(defmethod inspect hud-fuel-cell ((obj hud-fuel-cell)) +(defmethod inspect hud-fuel-cell ((this hud-fuel-cell)) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tscale-starburst-3-x: ~f~%" (-> obj scale-starburst-3-x)) - (format #t "~T~Tscale-starburst-3-y: ~f~%" (-> obj scale-starburst-3-y)) - (format #t "~T~Tscale-starburst-4-x: ~f~%" (-> obj scale-starburst-4-x)) - (format #t "~T~Tscale-starburst-4-y: ~f~%" (-> obj scale-starburst-4-y)) - (format #t "~T~Tscale-icon: ~f~%" (-> obj scale-icon)) - (format #t "~T~Tscale-center: ~f~%" (-> obj scale-center)) - (format #t "~T~Ticon-pos-y: ~D~%" (-> obj icon-pos-y)) - obj + (format #t "~T~Tscale-starburst-3-x: ~f~%" (-> this scale-starburst-3-x)) + (format #t "~T~Tscale-starburst-3-y: ~f~%" (-> this scale-starburst-3-y)) + (format #t "~T~Tscale-starburst-4-x: ~f~%" (-> this scale-starburst-4-x)) + (format #t "~T~Tscale-starburst-4-y: ~f~%" (-> this scale-starburst-4-y)) + (format #t "~T~Tscale-icon: ~f~%" (-> this scale-icon)) + (format #t "~T~Tscale-center: ~f~%" (-> this scale-center)) + (format #t "~T~Ticon-pos-y: ~D~%" (-> this icon-pos-y)) + this ) ;; definition for method 15 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-fuel-cell ((obj hud-fuel-cell)) +(defmethod draw-hud hud-fuel-cell ((this hud-fuel-cell)) (let ((t9-0 (method-of-type hud draw-hud))) - (t9-0 obj) + (t9-0 this) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> s5-0 base)) ) (let ((s4-0 draw-string-xy)) - (format (clear *temp-string*) "~D" (-> obj value)) + (format (clear *temp-string*) "~D" (-> this value)) (s4-0 *temp-string* s5-0 - (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset))) - (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) + (+ (-> this text-x) (* (-> this x-sgn) (-> this offset))) + (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale)) ) 2 @@ -1321,23 +1321,23 @@ ;; definition for method 19 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-fuel-cell ((obj hud-fuel-cell)) +(defmethod hud-update hud-fuel-cell ((this hud-fuel-cell)) (when *target* (when (!= *master-mode* 'pause) - (let ((a0-2 (-> obj icons 0 icon 0 root))) + (let ((a0-2 (-> this icons 0 icon 0 root))) (set-yaw-angle-clear-roll-pitch! a0-2 (+ (y-angle a0-2) (* 182.04445 (* 0.5 (-> *display* time-adjust-ratio)))) ) ) ) - (set! (-> obj icons 0 icon-y) (-> obj icon-pos-y)) - (tally-value obj (the int (+ 0.5 (-> *target* game fuel))) 0) + (set! (-> this icons 0 icon-y) (-> this icon-pos-y)) + (tally-value this (the int (+ 0.5 (-> *target* game fuel))) 0) (let ((s5-1 (new 'stack-no-clear 'vector))) - (vector<-cspace! s5-1 (-> obj icons 0 icon 0 node-list data 3)) - (set! (-> obj particles 0 pos x) (-> s5-1 x)) - (set! (-> obj particles 0 pos y) (* 0.5 (-> s5-1 y))) - (set! (-> obj particles 0 pos z) (+ 2.0 (* 0.05 (+ -2048.0 (-> s5-1 z))))) + (vector<-cspace! s5-1 (-> this icons 0 icon 0 node-list data 3)) + (set! (-> this particles 0 pos x) (-> s5-1 x)) + (set! (-> this particles 0 pos y) (* 0.5 (-> s5-1 y))) + (set! (-> this particles 0 pos z) (+ 2.0 (* 0.05 (+ -2048.0 (-> s5-1 z))))) ) ) 0 @@ -1346,27 +1346,27 @@ ;; definition for method 20 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-fuel-cell ((obj hud-fuel-cell) (arg0 int)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 80) obj)) - (set! (-> obj particles s5-0 init-pos x) 256.0) - (set! (-> obj particles s5-0 init-pos y) 224.0) - (set! (-> obj particles s5-0 init-pos z) 1.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod init-particles! hud-fuel-cell ((this hud-fuel-cell) (arg0 int)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 80) this)) + (set! (-> this particles s5-0 init-pos x) 256.0) + (set! (-> this particles s5-0 init-pos y) 224.0) + (set! (-> this particles s5-0 init-pos z) 1.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-1 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-1 part matrix) -1) - (set! (-> obj particles s5-1 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-1 (-> this nb-of-particles)) + (if (= (-> this particles s5-1 part matrix) -1) + (set! (-> this particles s5-1 part matrix) (sprite-allocate-user-hvdf)) ) ) - (when (< (-> obj nb-of-icons) 6) - (let ((s5-2 (-> obj nb-of-icons))) - (set! (-> obj icons s5-2) (new 'static 'hud-icon)) - (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *fuelcell-naked-sg* #f :to obj))) + (when (< (-> this nb-of-icons) 6) + (let ((s5-2 (-> this nb-of-icons))) + (set! (-> this icons s5-2) (new 'static 'hud-icon)) + (let ((s4-0 (manipy-spawn (new 'static 'vector :w 1.0) #f *fuelcell-naked-sg* #f :to this))) (when s4-0 (set! (-> (the-as process-drawable (-> s4-0 0)) draw dma-add-func) dma-add-process-drawable-hud) (set-vector! (-> (the-as process-drawable (-> s4-0 0)) root trans) 0.0 0.0 0.0 1.0) @@ -1375,31 +1375,31 @@ (send-event (ppointer->process s4-0) 'trans-hook #f) ) ) - (set! (-> obj icons s5-2 icon) (the-as (pointer manipy) s4-0)) + (set! (-> this icons s5-2 icon) (the-as (pointer manipy) s4-0)) (when s4-0 (logior! (-> s4-0 0 mask) (process-mask pause)) (logclear! (-> s4-0 0 mask) (process-mask menu progress)) (set! (-> (the-as process-drawable (-> s4-0 0)) root trans z) 2048.0) - (set! (-> obj icons s5-2 icon-x) 256) - (set! (-> obj icons s5-2 icon-y) 62) - (set! (-> obj icons s5-2 icon-z) 0) - (set! (-> obj icons s5-2 scale-x) 0.009) - (set! (-> obj icons s5-2 scale-y) 0.009) + (set! (-> this icons s5-2 icon-x) 256) + (set! (-> this icons s5-2 icon-y) 62) + (set! (-> this icons s5-2 icon-z) 0) + (set! (-> this icons s5-2 scale-x) 0.009) + (set! (-> this icons s5-2 scale-y) 0.009) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (set! (-> obj text-x) 276) - (set! (-> obj text-y) 45) - (set! (-> obj x-sgn) 0) - (set! (-> obj y-sgn) -1) - (set! (-> obj increment-on-event) #t) - (set! (-> obj skip-particle) -2) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set! (-> this text-x) 276) + (set! (-> this text-y) 45) + (set! (-> this x-sgn) 0) + (set! (-> this y-sgn) -1) + (set! (-> this increment-on-event) #t) + (set! (-> this skip-particle) -2) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) (let ((s5-4 (new 'stack-no-clear 'quaternion))) (quaternion-axis-angle! s5-4 0.0 1.0 0.0 16384.0) - (quaternion*! (-> obj icons 0 icon 0 root quat) s5-4 (-> obj icons 0 icon 0 root quat)) + (quaternion*! (-> this icons 0 icon 0 root quat) s5-4 (-> this icons 0 icon 0 root quat)) ) 0 (none) @@ -1407,34 +1407,34 @@ ;; definition for method 24 of type hud-fuel-cell ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-fuel-cell ((obj hud-fuel-cell) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-fuel-cell ((this hud-fuel-cell) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj scale-starburst-3-x) 10240.0) - (set! (-> obj scale-starburst-3-y) 9420.8) - (set! (-> obj scale-starburst-4-x) 9420.8) - (set! (-> obj scale-starburst-4-y) 8192.0) - (set! (-> obj scale-icon) 0.007) - (set! (-> obj scale-center) 6144.0) - (set! (-> obj icon-pos-y) 62) + (set! (-> this scale-starburst-3-x) 10240.0) + (set! (-> this scale-starburst-3-y) 9420.8) + (set! (-> this scale-starburst-4-x) 9420.8) + (set! (-> this scale-starburst-4-y) 8192.0) + (set! (-> this scale-icon) 0.007) + (set! (-> this scale-center) 6144.0) + (set! (-> this icon-pos-y) 62) ) (else - (set! (-> obj scale-starburst-3-x) 12288.0) - (set! (-> obj scale-starburst-3-y) 10240.0) - (set! (-> obj scale-starburst-4-x) 12288.0) - (set! (-> obj scale-starburst-4-y) 10240.0) - (set! (-> obj scale-icon) 0.009) - (set! (-> obj scale-center) 7372.8) - (set! (-> obj icon-pos-y) 62) + (set! (-> this scale-starburst-3-x) 12288.0) + (set! (-> this scale-starburst-3-y) 10240.0) + (set! (-> this scale-starburst-4-x) 12288.0) + (set! (-> this scale-starburst-4-y) 10240.0) + (set! (-> this scale-icon) 0.009) + (set! (-> this scale-center) 7372.8) + (set! (-> this icon-pos-y) 62) ) ) (if arg1 - (set! (-> obj icon-pos-y) (the int (* (the float (-> obj icon-pos-y)) (if arg0 - 1.1 - 1.14 - ) - ) - ) + (set! (-> this icon-pos-y) (the int (* (the float (-> this icon-pos-y)) (if arg0 + 1.1 + 1.14 + ) + ) + ) ) ) 0 @@ -1498,13 +1498,13 @@ ) ;; definition for method 3 of type hud-buzzers -(defmethod inspect hud-buzzers ((obj hud-buzzers)) +(defmethod inspect hud-buzzers ((this hud-buzzers)) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tscale: ~f~%" (-> obj scale)) - (format #t "~T~Ttext-y-offset: ~D~%" (-> obj text-y-offset)) - obj + (format #t "~T~Tscale: ~f~%" (-> this scale)) + (format #t "~T~Ttext-y-offset: ~D~%" (-> this text-y-offset)) + this ) ;; definition for function part-hud-buzzer-func @@ -1519,27 +1519,27 @@ ;; definition for method 15 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud-buzzers ((obj hud-buzzers)) +(defmethod draw-hud hud-buzzers ((this hud-buzzers)) (let ((t9-0 (method-of-type hud draw-hud))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj text-y) (+ (if (nonzero? (-> obj next-y-offset)) - (-> obj text-y-offset) - 0 - ) - 362 - ) + (set! (-> this text-y) (+ (if (nonzero? (-> this next-y-offset)) + (-> this text-y-offset) + 0 + ) + 362 + ) ) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> s5-0 base)) ) (let ((s3-0 draw-string-xy)) - (format (clear *temp-string*) "~2,' D" (-> obj value)) + (format (clear *temp-string*) "~2,' D" (-> this value)) (s3-0 *temp-string* s5-0 - (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset))) - (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) + (+ (-> this text-x) (* (-> this x-sgn) (-> this offset))) + (/ (* (+ (-> this text-y) (* (-> this y-sgn) (-> this offset)) (-> this y-offset)) (the int (-> *video-parms* relative-y-scale)) ) 2 @@ -1569,9 +1569,9 @@ ;; definition for method 19 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-buzzers ((obj hud-buzzers)) +(defmethod hud-update hud-buzzers ((this hud-buzzers)) (if *target* - (tally-value obj (the int (+ 0.5 (-> *target* fact-info-target buzzer))) 0) + (tally-value this (the int (+ 0.5 (-> *target* fact-info-target buzzer))) 0) ) 0 (none) @@ -1579,70 +1579,70 @@ ;; definition for method 20 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-buzzers ((obj hud-buzzers) (arg0 int)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 81) obj)) - (set! (-> obj particles s5-0 init-pos x) 60.0) - (set! (-> obj particles s5-0 init-pos y) 380.0) - (set! (-> obj particles s5-0 init-pos z) 1.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod init-particles! hud-buzzers ((this hud-buzzers) (arg0 int)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 81) this)) + (set! (-> this particles s5-0 init-pos x) 60.0) + (set! (-> this particles s5-0 init-pos y) 380.0) + (set! (-> this particles s5-0 init-pos z) 1.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-1 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-1 part matrix) -1) - (set! (-> obj particles s5-1 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-1 (-> this nb-of-particles)) + (if (= (-> this particles s5-1 part matrix) -1) + (set! (-> this particles s5-1 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) - (set! (-> obj text-x) 85) - (set! (-> obj text-y) 362) - (set! (-> obj x-sgn) -1) - (set! (-> obj y-sgn) 1) - (set! (-> obj text-y-offset) 0) - (set! (-> obj increment-on-event) #t) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set! (-> this text-x) 85) + (set! (-> this text-y) 362) + (set! (-> this x-sgn) -1) + (set! (-> this y-sgn) 1) + (set! (-> this text-y-offset) 0) + (set! (-> this increment-on-event) #t) 0 (none) ) ;; definition for method 21 of type hud-buzzers -(defmethod get-icon-pos-x hud-buzzers ((obj hud-buzzers)) - (-> obj text-x) +(defmethod get-icon-pos-x hud-buzzers ((this hud-buzzers)) + (-> this text-x) ) ;; definition for method 22 of type hud-buzzers -(defmethod get-icon-pos-y hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-pos-y hud-buzzers ((this hud-buzzers)) (+ (if (= (-> *setting-control* current video-mode) 'pal) - (+ (-> obj text-y) 120) - (+ (-> obj text-y) 50) + (+ (-> this text-y) 120) + (+ (-> this text-y) 50) ) - (-> obj next-y-offset) + (-> this next-y-offset) ) ) ;; definition for method 25 of type hud-buzzers -(defmethod get-icon-scale-x hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-scale-x hud-buzzers ((this hud-buzzers)) 0.008 ) ;; definition for method 26 of type hud-buzzers -(defmethod get-icon-scale-y hud-buzzers ((obj hud-buzzers)) +(defmethod get-icon-scale-y hud-buzzers ((this hud-buzzers)) -0.008 ) ;; definition for method 24 of type hud-buzzers ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-buzzers ((obj hud-buzzers) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-buzzers ((this hud-buzzers) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj scale) 6553.6) - (set! (-> obj text-y-offset) -40) + (set! (-> this scale) 6553.6) + (set! (-> this text-y-offset) -40) ) (else - (set! (-> obj scale) 7372.8) - (set! (-> obj text-y-offset) 0) + (set! (-> this scale) 7372.8) + (set! (-> this text-y-offset) 0) 0 ) ) @@ -1767,14 +1767,14 @@ ) ;; definition for method 3 of type hud-power -(defmethod inspect hud-power ((obj hud-power)) +(defmethod inspect hud-power ((this hud-power)) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tscale-timer: ~f~%" (-> obj scale-timer)) - (format #t "~T~Tscale-backing: ~f~%" (-> obj scale-backing)) - (format #t "~T~Tscale-blue: ~f~%" (-> obj scale-blue)) - obj + (format #t "~T~Tscale-timer: ~f~%" (-> this scale-timer)) + (format #t "~T~Tscale-backing: ~f~%" (-> this scale-backing)) + (format #t "~T~Tscale-blue: ~f~%" (-> this scale-blue)) + this ) ;; definition for function calculate-rotation-and-color-for-slice @@ -1981,10 +1981,10 @@ ;; definition for method 19 of type hud-power ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-power ((obj hud-power)) +(defmethod hud-update hud-power ((this hud-power)) (if *target* (tally-value - obj + this (max 0 (min @@ -2006,65 +2006,65 @@ ;; definition for method 20 of type hud-power ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-power ((obj hud-power) (arg0 int)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 83) obj)) - (set! (-> obj particles s5-0 init-pos x) 435.0) - (set! (-> obj particles s5-0 init-pos y) 370.0) - (set! (-> obj particles s5-0 init-pos z) 10.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod init-particles! hud-power ((this hud-power) (arg0 int)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 83) this)) + (set! (-> this particles s5-0 init-pos x) 435.0) + (set! (-> this particles s5-0 init-pos y) 370.0) + (set! (-> this particles s5-0 init-pos z) 10.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 84) obj)) - (set! (-> obj particles s5-1 init-pos x) 432.0) - (set! (-> obj particles s5-1 init-pos y) 368.0) - (set! (-> obj particles s5-1 init-pos z) 3.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 84) this)) + (set! (-> this particles s5-1 init-pos x) 432.0) + (set! (-> this particles s5-1 init-pos y) 368.0) + (set! (-> this particles s5-1 init-pos z) 3.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 82) obj)) - (set! (-> obj particles s5-2 init-pos x) 435.0) - (set! (-> obj particles s5-2 init-pos y) 370.0) - (set! (-> obj particles s5-2 init-pos z) 2.0) - (set! (-> obj particles s5-2 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-2 (-> this nb-of-particles))) + (set! (-> this particles s5-2) (new 'static 'hud-particle)) + (set! (-> this particles s5-2 part) (create-launch-control (-> *part-group-id-table* 82) this)) + (set! (-> this particles s5-2 init-pos x) 435.0) + (set! (-> this particles s5-2 init-pos y) 370.0) + (set! (-> this particles s5-2 init-pos z) 2.0) + (set! (-> this particles s5-2 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-3 part matrix) -1) - (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-3 (-> this nb-of-particles)) + (if (= (-> this particles s5-3 part matrix) -1) + (set! (-> this particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set-pos-and-scale obj (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) - (set! (-> obj x-sgn) 1) - (set! (-> obj y-sgn) 1) + (set-pos-and-scale this (= (get-aspect-ratio) 'aspect16x9) (= (get-video-mode) 'pal)) + (set! (-> this x-sgn) 1) + (set! (-> this y-sgn) 1) 0 (none) ) ;; definition for method 24 of type hud-power ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud-power ((obj hud-power) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud-power ((this hud-power) (arg0 symbol) (arg1 symbol)) (cond (arg0 - (set! (-> obj scale-blue) 7168.0) - (set! (-> obj scale-timer) 11468.8) - (set! (-> obj scale-backing) 8960.0) + (set! (-> this scale-blue) 7168.0) + (set! (-> this scale-timer) 11468.8) + (set! (-> this scale-backing) 8960.0) ) (else - (set! (-> obj scale-blue) 8192.0) - (set! (-> obj scale-timer) 13107.2) - (set! (-> obj scale-backing) 10240.0) + (set! (-> this scale-blue) 8192.0) + (set! (-> this scale-timer) 13107.2) + (set! (-> this scale-backing) 10240.0) ) ) 0 diff --git a/test/decompiler/reference/jak1/engine/ui/hud-h_REF.gc b/test/decompiler/reference/jak1/engine/ui/hud-h_REF.gc index d8e6eac65e..cd588695d5 100644 --- a/test/decompiler/reference/jak1/engine/ui/hud-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/hud-h_REF.gc @@ -16,15 +16,15 @@ ) ;; definition for method 3 of type hud-icon -(defmethod inspect hud-icon ((obj hud-icon)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ticon: #x~X~%" (-> obj icon)) - (format #t "~Ticon-y: ~D~%" (-> obj icon-y)) - (format #t "~Ticon-x: ~D~%" (-> obj icon-x)) - (format #t "~Ticon-z: ~D~%" (-> obj icon-z)) - (format #t "~Tscale-x: ~f~%" (-> obj scale-x)) - (format #t "~Tscale-y: ~f~%" (-> obj scale-y)) - obj +(defmethod inspect hud-icon ((this hud-icon)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ticon: #x~X~%" (-> this icon)) + (format #t "~Ticon-y: ~D~%" (-> this icon-y)) + (format #t "~Ticon-x: ~D~%" (-> this icon-x)) + (format #t "~Ticon-z: ~D~%" (-> this icon-z)) + (format #t "~Tscale-x: ~f~%" (-> this scale-x)) + (format #t "~Tscale-y: ~f~%" (-> this scale-y)) + this ) ;; definition of type hud-particle @@ -40,13 +40,13 @@ ) ;; definition for method 3 of type hud-particle -(defmethod inspect hud-particle ((obj hud-particle)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tpart: ~A~%" (-> obj part)) - (format #t "~Tinit-pos: #~%" (-> obj init-pos)) - (format #t "~Tpos: #~%" (-> obj pos)) - (format #t "~Tprev-pos: #~%" (-> obj prev-pos)) - obj +(defmethod inspect hud-particle ((this hud-particle)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tpart: ~A~%" (-> this part)) + (format #t "~Tinit-pos: #~%" (-> this init-pos)) + (format #t "~Tpos: #~%" (-> this pos)) + (format #t "~Tprev-pos: #~%" (-> this prev-pos)) + this ) ;; definition of type hud @@ -106,37 +106,37 @@ ) ;; definition for method 3 of type hud -(defmethod inspect hud ((obj hud)) +(defmethod inspect hud ((this hud)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tvalue: ~D~%" (-> obj value)) - (format #t "~T~Tvalue2: ~D~%" (-> obj value2)) - (format #t "~T~Ttarget-value: ~D~%" (-> obj target-value)) - (format #t "~T~Tlast-increment-time: ~D~%" (-> obj last-increment-time)) - (format #t "~T~Tlast-target-equal-time: ~D~%" (-> obj last-target-equal-time)) - (format #t "~T~Toffset: ~D~%" (-> obj offset)) - (format #t "~T~Ty-offset: ~D~%" (-> obj y-offset)) - (format #t "~T~Tnext-y-offset: ~D~%" (-> obj next-y-offset)) - (format #t "~T~Tx-sgn: ~D~%" (-> obj x-sgn)) - (format #t "~T~Ty-sgn: ~D~%" (-> obj y-sgn)) - (format #t "~T~Ttext-x: ~D~%" (-> obj text-x)) - (format #t "~T~Ttext-y: ~D~%" (-> obj text-y)) - (format #t "~T~Tfriend: ~D~%" (-> obj friend)) - (format #t "~T~Tfirst-init: ~A~%" (-> obj first-init)) - (format #t "~T~Tincrement-on-event: ~A~%" (-> obj increment-on-event)) - (format #t "~T~Tskip-particle: ~D~%" (-> obj skip-particle)) - (format #t "~T~Tdisable: ~A~%" (-> obj disable)) - (format #t "~T~Tforce-on-screen: ~A~%" (-> obj force-on-screen)) - (format #t "~T~Tdeactivate-when-hidden: ~A~%" (-> obj deactivate-when-hidden)) - (format #t "~T~Ttrigger-time: ~D~%" (-> obj trigger-time)) - (format #t "~T~Tlast-hide-time: ~D~%" (-> obj last-hide-time)) - (format #t "~T~Tnb-of-icons: ~D~%" (-> obj nb-of-icons)) - (format #t "~T~Ticons[6] @ #x~X~%" (-> obj icons)) - (format #t "~T~Tmax-nb-of-particles: ~D~%" (-> obj max-nb-of-particles)) - (format #t "~T~Tnb-of-particles: ~D~%" (-> obj nb-of-particles)) - (format #t "~T~Tparticles[7] @ #x~X~%" (-> obj particles)) - obj + (format #t "~T~Tvalue: ~D~%" (-> this value)) + (format #t "~T~Tvalue2: ~D~%" (-> this value2)) + (format #t "~T~Ttarget-value: ~D~%" (-> this target-value)) + (format #t "~T~Tlast-increment-time: ~D~%" (-> this last-increment-time)) + (format #t "~T~Tlast-target-equal-time: ~D~%" (-> this last-target-equal-time)) + (format #t "~T~Toffset: ~D~%" (-> this offset)) + (format #t "~T~Ty-offset: ~D~%" (-> this y-offset)) + (format #t "~T~Tnext-y-offset: ~D~%" (-> this next-y-offset)) + (format #t "~T~Tx-sgn: ~D~%" (-> this x-sgn)) + (format #t "~T~Ty-sgn: ~D~%" (-> this y-sgn)) + (format #t "~T~Ttext-x: ~D~%" (-> this text-x)) + (format #t "~T~Ttext-y: ~D~%" (-> this text-y)) + (format #t "~T~Tfriend: ~D~%" (-> this friend)) + (format #t "~T~Tfirst-init: ~A~%" (-> this first-init)) + (format #t "~T~Tincrement-on-event: ~A~%" (-> this increment-on-event)) + (format #t "~T~Tskip-particle: ~D~%" (-> this skip-particle)) + (format #t "~T~Tdisable: ~A~%" (-> this disable)) + (format #t "~T~Tforce-on-screen: ~A~%" (-> this force-on-screen)) + (format #t "~T~Tdeactivate-when-hidden: ~A~%" (-> this deactivate-when-hidden)) + (format #t "~T~Ttrigger-time: ~D~%" (-> this trigger-time)) + (format #t "~T~Tlast-hide-time: ~D~%" (-> this last-hide-time)) + (format #t "~T~Tnb-of-icons: ~D~%" (-> this nb-of-icons)) + (format #t "~T~Ticons[6] @ #x~X~%" (-> this icons)) + (format #t "~T~Tmax-nb-of-particles: ~D~%" (-> this max-nb-of-particles)) + (format #t "~T~Tnb-of-particles: ~D~%" (-> this nb-of-particles)) + (format #t "~T~Tparticles[7] @ #x~X~%" (-> this particles)) + this ) ;; definition of type hud-parts @@ -158,19 +158,19 @@ ) ;; definition for method 3 of type hud-parts -(defmethod inspect hud-parts ((obj hud-parts)) - (format #t "[~8x] ~A~%" obj 'hud-parts) - (format #t "~Tdata[9] @ #x~X~%" (&-> obj pickups)) - (format #t "~Tpickups: #x~X~%" (-> obj pickups)) - (format #t "~Tmoney: #x~X~%" (-> obj money)) - (format #t "~Tfuel-cell: #x~X~%" (-> obj fuel-cell)) - (format #t "~Thealth: #x~X~%" (-> obj health)) - (format #t "~Tbuzzers: #x~X~%" (-> obj buzzers)) - (format #t "~Tpower: #x~X~%" (-> obj power)) - (format #t "~Tbike-speed: #x~X~%" (-> obj bike-speed)) - (format #t "~Tbike-heat: #x~X~%" (-> obj bike-heat)) - (format #t "~Tmoney-all: #x~X~%" (-> obj money-all)) - obj +(defmethod inspect hud-parts ((this hud-parts)) + (format #t "[~8x] ~A~%" this 'hud-parts) + (format #t "~Tdata[9] @ #x~X~%" (&-> this pickups)) + (format #t "~Tpickups: #x~X~%" (-> this pickups)) + (format #t "~Tmoney: #x~X~%" (-> this money)) + (format #t "~Tfuel-cell: #x~X~%" (-> this fuel-cell)) + (format #t "~Thealth: #x~X~%" (-> this health)) + (format #t "~Tbuzzers: #x~X~%" (-> this buzzers)) + (format #t "~Tpower: #x~X~%" (-> this power)) + (format #t "~Tbike-speed: #x~X~%" (-> this bike-speed)) + (format #t "~Tbike-heat: #x~X~%" (-> this bike-heat)) + (format #t "~Tmoney-all: #x~X~%" (-> this money-all)) + this ) ;; definition for symbol *hud-parts*, type hud-parts diff --git a/test/decompiler/reference/jak1/engine/ui/hud_REF.gc b/test/decompiler/reference/jak1/engine/ui/hud_REF.gc index d08b005cdb..253a5c3d31 100644 --- a/test/decompiler/reference/jak1/engine/ui/hud_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/hud_REF.gc @@ -3,38 +3,38 @@ ;; definition for method 7 of type hud ;; INFO: Return type mismatch process vs hud. -(defmethod relocate hud ((obj hud) (arg0 int)) - (dotimes (v1-0 (-> obj nb-of-particles)) - (if (nonzero? (-> obj particles v1-0 part)) - (&+! (-> obj particles v1-0 part) arg0) +(defmethod relocate hud ((this hud) (arg0 int)) + (dotimes (v1-0 (-> this nb-of-particles)) + (if (nonzero? (-> this particles v1-0 part)) + (&+! (-> this particles v1-0 part) arg0) ) ) - (the-as hud ((method-of-type process relocate) obj arg0)) + (the-as hud ((method-of-type process relocate) this arg0)) ) ;; definition for method 10 of type hud -(defmethod deactivate hud ((obj hud)) +(defmethod deactivate hud ((this hud)) (dotimes (v1-0 9) - (if (and (-> *hud-parts* parts v1-0) (= (ppointer->process (-> *hud-parts* parts v1-0)) obj)) + (if (and (-> *hud-parts* parts v1-0) (= (ppointer->process (-> *hud-parts* parts v1-0)) this)) (set! (-> *hud-parts* parts v1-0) (the-as (pointer hud) #f)) ) ) - (dotimes (s5-0 (-> obj nb-of-particles)) - (kill-and-free-particles (-> obj particles s5-0 part)) - (set! (-> obj particles s5-0 part matrix) -1) + (dotimes (s5-0 (-> this nb-of-particles)) + (kill-and-free-particles (-> this particles s5-0 part)) + (set! (-> this particles s5-0 part matrix) -1) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; definition for method 15 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod draw-hud hud ((obj hud)) - (when (and (not (hidden? obj)) (not (paused?))) - (dotimes (s5-0 (-> obj nb-of-particles)) - (when (!= s5-0 (-> obj skip-particle)) - (if (or (!= (-> obj particles 0 pos x) 0.0) (!= (-> obj particles 0 pos y) 0.0)) - (spawn (-> obj particles s5-0 part) *null-vector*) +(defmethod draw-hud hud ((this hud)) + (when (and (not (hidden? this)) (not (paused?))) + (dotimes (s5-0 (-> this nb-of-particles)) + (when (!= s5-0 (-> this skip-particle)) + (if (or (!= (-> this particles 0 pos x) 0.0) (!= (-> this particles 0 pos y) 0.0)) + (spawn (-> this particles s5-0 part) *null-vector*) ) ) ) @@ -45,60 +45,55 @@ ;; definition for method 16 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod tally-value hud ((obj hud) (arg0 int) (arg1 int)) - (if (= arg0 (-> obj target-value)) - (set! (-> obj last-target-equal-time) (-> *display* base-frame-counter)) +(defmethod tally-value hud ((this hud) (arg0 int) (arg1 int)) + (if (= arg0 (-> this target-value)) + (set-time! (-> this last-target-equal-time)) ) (when (and (not *progress-process*) - (and (!= (-> obj last-hide-time) (-> *display* base-frame-counter)) + (and (!= (-> this last-hide-time) (current-time)) (not (movie?)) - (>= (- (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) (seconds 0.1)) - (>= (- (-> *display* base-frame-counter) (-> *game-info* blackout-time)) (seconds 0.1)) + (time-elapsed? (-> *game-info* letterbox-time) (seconds 0.1)) + (time-elapsed? (-> *game-info* blackout-time) (seconds 0.1)) (not (and *target* (logtest? (-> *target* state-flags) (state-flags grabbed)))) ) ) - (when (or (!= (-> obj value) arg0) - (!= (-> obj value2) arg1) - (-> obj force-on-screen) - (or (and (cpad-hold? 0 l2) (not (-> obj disable))) + (when (or (!= (-> this value) arg0) + (!= (-> this value2) arg1) + (-> this force-on-screen) + (or (and (cpad-hold? 0 l2) (not (-> this disable))) (and (not *cheat-mode*) (cpad-hold? 0 r2)) - (-> obj first-init) + (-> this first-init) ) ) (cond - ((and (-> obj increment-on-event) - (< (-> obj value) arg0) - (not (-> obj first-init)) - (< (- (-> *display* base-frame-counter) (-> obj last-target-equal-time)) (seconds 1.5)) + ((and (-> this increment-on-event) + (< (-> this value) arg0) + (not (-> this first-init)) + (not (time-elapsed? (-> this last-target-equal-time) (seconds 1.5))) ) - (when (and (!= (-> obj value) (-> obj target-value)) - (>= (- (-> *display* base-frame-counter) (-> obj last-increment-time)) (seconds 0.1)) - ) + (when (and (!= (-> this value) (-> this target-value)) (time-elapsed? (-> this last-increment-time) (seconds 0.1))) (sound-play "cursor-options") - (+! (-> obj value) 1) - (set! (-> obj last-increment-time) (-> *display* base-frame-counter)) + (+! (-> this value) 1) + (set-time! (-> this last-increment-time)) ) ) (else - (if (not (and (not (-> obj first-init)) - (>= (- (-> *display* base-frame-counter) (-> obj last-target-equal-time)) (seconds 1.5)) - ) - ) - (set! (-> obj value) arg0) + (if (not (and (not (-> this first-init)) (time-elapsed? (-> this last-target-equal-time) (seconds 1.5)))) + (set! (-> this value) arg0) ) - (set! (-> obj target-value) arg0) - (set! (-> obj last-target-equal-time) (-> *display* base-frame-counter)) + (set! (-> this target-value) arg0) + (set-time! (-> this last-target-equal-time)) ) ) - (set! (-> obj value2) arg1) - (when (and (not (movie?)) (= *master-mode* 'game) (not (-> obj first-init)) (not (-> obj disable))) - (if (>= (-> obj friend) 0) - (send-event (ppointer->process (-> *hud-parts* parts (-> obj friend))) 'show) + (set! (-> this value2) arg1) + (when (and (not (movie?)) (= *master-mode* 'game) (not (-> this first-init)) (not (-> this disable))) + (if (>= (-> this friend) 0) + (send-event (ppointer->process (-> *hud-parts* parts (-> this friend))) 'show) ) (go hud-arriving) ) - (set! (-> obj trigger-time) (-> *display* base-frame-counter)) - (set! (-> obj first-init) #f) + (set-time! (-> this trigger-time)) + (set! (-> this first-init) #f) ) ) 0 @@ -107,26 +102,26 @@ ;; definition for method 17 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod draw-icons hud ((obj hud)) - (dotimes (v1-0 (-> obj nb-of-icons)) +(defmethod draw-icons hud ((this hud)) + (dotimes (v1-0 (-> this nb-of-icons)) (set-vector! - (-> obj icons v1-0 icon 0 root scale) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) - (* (-> obj icons v1-0 scale-y) (-> *video-parms* relative-y-scale)) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) + (-> this icons v1-0 icon 0 root scale) + (* (-> this icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) + (* (-> this icons v1-0 scale-y) (-> *video-parms* relative-y-scale)) + (* (-> this icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) 1.0 ) - (set! (-> obj icons v1-0 icon 0 root trans x) - (the float (+ (-> obj icons v1-0 icon-x) -256 (* (-> obj x-sgn) (-> obj offset)))) + (set! (-> this icons v1-0 icon 0 root trans x) + (the float (+ (-> this icons v1-0 icon-x) -256 (* (-> this x-sgn) (-> this offset)))) ) - (set! (-> obj icons v1-0 icon 0 root trans y) - (- (+ (the float (-> obj icons v1-0 icon-y)) - (* (the float (-> obj y-sgn)) - (the float (-> obj offset)) + (set! (-> this icons v1-0 icon 0 root trans y) + (- (+ (the float (-> this icons v1-0 icon-y)) + (* (the float (-> this y-sgn)) + (the float (-> this offset)) (-> *video-parms* relative-y-scale) (-> *video-parms* relative-y-scale) ) - (* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical)) + (* (the float (-> this y-offset)) (-> *video-parms* relative-x-scale-reciprical)) ) (the float (-> *video-parms* screen-sy)) ) @@ -138,31 +133,31 @@ ;; definition for method 18 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod draw-particles hud ((obj hud)) - (dotimes (s5-0 (-> obj nb-of-particles)) - (when (!= (-> obj skip-particle) -2) - (set! (-> obj particles s5-0 pos x) - (+ -256.0 (the float (* (-> obj x-sgn) (-> obj offset))) (-> obj particles s5-0 init-pos x)) +(defmethod draw-particles hud ((this hud)) + (dotimes (s5-0 (-> this nb-of-particles)) + (when (!= (-> this skip-particle) -2) + (set! (-> this particles s5-0 pos x) + (+ -256.0 (the float (* (-> this x-sgn) (-> this offset))) (-> this particles s5-0 init-pos x)) ) - (set! (-> obj particles s5-0 pos y) + (set! (-> this particles s5-0 pos y) (* 0.5 (- (* (-> *video-parms* relative-y-scale) - (+ (-> obj particles s5-0 init-pos y) - (the float (* (-> obj y-sgn) (-> obj offset))) - (* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical)) + (+ (-> this particles s5-0 init-pos y) + (the float (* (-> this y-sgn) (-> this offset))) + (* (the float (-> this y-offset)) (-> *video-parms* relative-x-scale-reciprical)) ) ) (the float (-> *video-parms* screen-sy)) ) ) ) - (set! (-> obj particles s5-0 pos z) (-> obj particles s5-0 init-pos z)) + (set! (-> this particles s5-0 pos z) (-> this particles s5-0 init-pos z)) ) - (if (> (-> obj particles s5-0 part matrix) 0) + (if (> (-> this particles s5-0 part matrix) 0) (set-vector! - (sprite-get-user-hvdf (-> obj particles s5-0 part matrix)) - (the float (+ (the int (-> obj particles s5-0 pos x)) 2048)) - (the float (+ (the int (-> obj particles s5-0 pos y)) 2048)) - (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> obj particles s5-0 pos z))) + (sprite-get-user-hvdf (-> this particles s5-0 part matrix)) + (the float (+ (the int (-> this particles s5-0 pos x)) 2048)) + (the float (+ (the int (-> this particles s5-0 pos y)) 2048)) + (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> this particles s5-0 pos z))) (-> *math-camera* hvdf-off w) ) ) @@ -173,48 +168,48 @@ ;; definition for method 19 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud ((obj hud)) +(defmethod hud-update hud ((this hud)) 0 (none) ) ;; definition for method 20 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud ((obj hud) (arg0 int)) +(defmethod init-particles! hud ((this hud) (arg0 int)) 0 (none) ) ;; definition for method 21 of type hud -(defmethod get-icon-pos-x hud ((obj hud)) +(defmethod get-icon-pos-x hud ((this hud)) 0 ) ;; definition for method 22 of type hud -(defmethod get-icon-pos-y hud ((obj hud)) +(defmethod get-icon-pos-y hud ((this hud)) 0 ) ;; definition for method 25 of type hud -(defmethod get-icon-scale-x hud ((obj hud)) +(defmethod get-icon-scale-x hud ((this hud)) 0.0 ) ;; definition for method 26 of type hud -(defmethod get-icon-scale-y hud ((obj hud)) +(defmethod get-icon-scale-y hud ((this hud)) 0.0 ) ;; definition for method 24 of type hud ;; INFO: Return type mismatch int vs none. -(defmethod set-pos-and-scale hud ((obj hud) (arg0 symbol) (arg1 symbol)) +(defmethod set-pos-and-scale hud ((this hud) (arg0 symbol) (arg1 symbol)) 0 (none) ) ;; definition for method 14 of type hud -(defmethod hidden? hud ((obj hud)) - (= (-> obj next-state name) 'hud-hidden) +(defmethod hidden? hud ((this hud)) + (= (-> this next-state name) 'hud-hidden) ) ;; failed to figure out what this is: @@ -223,17 +218,17 @@ (local-vars (v0-0 object)) (case message (('show) - (if (and (not *progress-process*) (!= (-> self last-hide-time) (-> *display* base-frame-counter))) + (if (and (not *progress-process*) (!= (-> self last-hide-time) (current-time))) (go hud-arriving) ) ) (('hide) - (set! v0-0 (-> *display* base-frame-counter)) + (set! v0-0 (current-time)) (set! (-> self last-hide-time) (the-as time-frame v0-0)) v0-0 ) (('hide-quick) - (set! v0-0 (-> *display* base-frame-counter)) + (set! v0-0 (current-time)) (set! (-> self last-hide-time) (the-as time-frame v0-0)) v0-0 ) @@ -296,7 +291,7 @@ (local-vars (v0-3 object)) (case message (('hide-quick) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) (draw-particles self) @@ -305,12 +300,12 @@ (go hud-hidden) ) (('hide) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (set! (-> self force-on-screen) #f) (go hud-leaving 10) ) (('show) - (if (and (not *progress-process*) (!= (-> self last-hide-time) (-> *display* base-frame-counter))) + (if (and (not *progress-process*) (!= (-> self last-hide-time) (current-time))) (go hud-arriving) ) ) @@ -358,7 +353,7 @@ (go hud-in) ) (when (movie?) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) (draw-particles self) @@ -380,14 +375,14 @@ (defstate hud-in (hud) :event (-> hud-arriving event) :code (behavior () - (set! (-> self trigger-time) (-> *display* base-frame-counter)) - (while (and (< (- (-> *display* base-frame-counter) (-> self trigger-time)) (seconds 2)) (not (movie?))) + (set-time! (-> self trigger-time)) + (while (and (not (time-elapsed? (-> self trigger-time) (seconds 2))) (not (movie?))) (set! (-> self offset) 0) (draw-icons self) (suspend) ) (when (movie?) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) (draw-particles self) @@ -410,7 +405,7 @@ ) (draw-icons self) (when (movie?) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (set! (-> self force-on-screen) #f) (set! (-> self offset) 128) (draw-particles self) @@ -435,8 +430,8 @@ (set! (-> self max-nb-of-particles) 7) (set! (-> self first-init) #t) (set! (-> self friend) -1) - (set! (-> self last-increment-time) (-> *display* base-frame-counter)) - (set! (-> self last-target-equal-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-increment-time)) + (set-time! (-> self last-target-equal-time)) (set! (-> self increment-on-event) #f) (set! (-> self skip-particle) -1) (set! (-> self disable) #f) @@ -444,7 +439,7 @@ (set! (-> self deactivate-when-hidden) #f) (set! (-> self y-offset) 0) (set! (-> self next-y-offset) 0) - (set! (-> self last-hide-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hide-time)) (logior! (-> self mask) (process-mask menu)) (logclear! (-> self mask) (process-mask pause progress)) (init-particles! self arg0) @@ -485,7 +480,7 @@ (f22-0 (-> self root scale z)) ) (loop - (let ((f0-7 (* f30-0 (-> *display* seconds-per-frame)))) + (let ((f0-7 (* f30-0 (seconds-per-frame)))) (+! f26-0 f0-7) (when (< 1.0 f26-0) (let ((f0-8 (- f26-0 f0-7))) diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc index 0ac67c65ab..76be18f8db 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress-draw_REF.gc @@ -12,7 +12,7 @@ ;; definition for method 24 of type progress ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod draw-fuel-cell-screen progress ((obj progress) (arg0 int)) +(defmethod draw-fuel-cell-screen progress ((this progress) (arg0 int)) (local-vars (sv-112 int) (sv-128 int) @@ -32,25 +32,25 @@ (set! (-> *progress-process* 0 particles 15 init-pos x) -320.0) (set! (-> *progress-process* 0 icons 4 icon-x) -320) (when (and (!= s5-0 #f) (= (-> *game-info* level-opened arg0) 1)) - (set! sv-112 (- (-> *task-egg-starting-x* (-> s5-0 nb-of-tasks)) (-> obj left-x-offset))) - (set! sv-128 (the int (* 47.0 (-> obj transition-percentage-invert)))) + (set! sv-112 (- (-> *task-egg-starting-x* (-> s5-0 nb-of-tasks)) (-> this left-x-offset))) + (set! sv-128 (the int (* 47.0 (-> this transition-percentage-invert)))) 0 (let ((s0-0 6) (s2-0 0) - (s4-1 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (s4-1 (if (= (-> this level-transition) 1) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) - (f30-0 (-> obj transition-percentage-invert)) + (f30-0 (-> this transition-percentage-invert)) (s1-0 0) (s3-0 #f) ) - (when (-> obj stat-transition) + (when (-> this stat-transition) (set! sv-128 47) - (set! s2-0 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (set! s2-0 (if (!= (-> this display-state) (-> this next-display-state)) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) (set! s4-1 0) @@ -58,7 +58,7 @@ ) (set! sv-144 0) (while (< sv-144 4) - (let ((a0-18 (-> obj icons sv-144 icon 0 root))) + (let ((a0-18 (-> this icons sv-144 icon 0 root))) (set! sv-176 a0-18) (set! sv-160 (method-of-object sv-176 set-yaw-angle-clear-roll-pitch!)) (let ((a1-2 (+ (y-angle a0-18) (* 182.04445 (* 0.5 (-> *display* time-adjust-ratio)))))) @@ -74,16 +74,16 @@ (v1-59 -1) (a0-25 #f) ) - (set! (-> obj particle-state s0-0) 2) + (set! (-> this particle-state s0-0) 2) (cond ((or (= v0-4 (task-status need-hint)) (= v0-4 (task-status unknown))) (if (= *kernel-boot-message* 'play) - (set! (-> obj particle-state s0-0) 1) + (set! (-> this particle-state s0-0) 1) ) ) ((= v0-4 (task-status invalid)) (set! v1-59 (-> s5-0 task-info sv-208 text-index-when-resolved)) - (set! (-> obj particle-state s0-0) 3) + (set! (-> this particle-state s0-0) 3) (set! a0-25 #t) ) ((= v0-4 (task-status need-introduction)) @@ -105,14 +105,14 @@ (if (and (!= *kernel-boot-message* 'play) (= v1-59 -1)) (set! v1-59 0) ) - (set! (-> obj particles s0-0 init-pos x) (the float (+ sv-192 s2-0))) - (set! (-> obj particles s0-0 init-pos y) (the float (+ s4-1 204))) + (set! (-> this particles s0-0 init-pos x) (the float (+ sv-192 s2-0))) + (set! (-> this particles s0-0 init-pos y) (the float (+ s4-1 204))) (+! s0-0 1) - (when (= sv-208 (-> obj task-index)) + (when (= sv-208 (-> this task-index)) (set! s1-0 v1-59) (set! s3-0 a0-25) - (set! (-> obj particles 5 init-pos x) (the float (+ sv-192 s2-0))) - (set! (-> obj particles 5 init-pos y) (the float (+ s4-1 204))) + (set! (-> this particles 5 init-pos x) (the float (+ sv-192 s2-0))) + (set! (-> this particles 5 init-pos y) (the float (+ s4-1 204))) ) ) (set! sv-192 (+ sv-192 sv-128)) @@ -120,20 +120,20 @@ ) (dotimes (v1-77 (- 8 (-> s5-0 nb-of-tasks))) (set! (-> *progress-process* 0 particles s0-0 init-pos x) (the float (+ s2-0 -320))) - (set! (-> obj particles s0-0 init-pos y) (the float (+ s4-1 194))) + (set! (-> this particles s0-0 init-pos y) (the float (+ s4-1 194))) (+! s0-0 1) ) (when *common-text* (when (and (!= s1-0 -1) (> (-> s5-0 nb-of-tasks) 0) - (>= (-> obj task-index) 0) - (< (-> obj task-index) (-> s5-0 nb-of-tasks)) + (>= (-> this task-index) 0) + (< (-> this task-index) (-> s5-0 nb-of-tasks)) ) (let ((s0-1 (new 'stack 'font-context *font-default-matrix* - (- (+ s2-0 32) (-> obj left-x-offset)) + (- (+ s2-0 32) (-> this left-x-offset)) (+ (/ s4-1 2) 125) 8325000.0 (font-color progress-yellow) @@ -152,7 +152,7 @@ ) (set! (-> s0-1 flags) (font-flags shadow kerning middle middle-vert large)) (set! sv-224 print-game-text-scaled) - (let ((a0-47 (lookup-text! *common-text* (-> s5-0 task-info (-> obj task-index) task-name s1-0) #f)) + (let ((a0-47 (lookup-text! *common-text* (-> s5-0 task-info (-> this task-index) task-name s1-0) #f)) (a1-57 f30-0) (a2-15 s0-1) (a3-2 (the int (* 128.0 f30-0))) @@ -160,7 +160,7 @@ (sv-224 a0-47 a1-57 a2-15 a3-2) ) (when s3-0 - (set! (-> s0-1 origin x) (the float (- (+ s2-0 32) (-> obj left-x-offset)))) + (set! (-> s0-1 origin x) (the float (- (+ s2-0 32) (-> this left-x-offset)))) (set! (-> s0-1 origin y) (the float (+ (/ s4-1 2) 175))) (let ((a0-49 s0-1)) (set! (-> a0-49 color) (font-color progress-blue)) @@ -190,32 +190,32 @@ ;; definition for method 25 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-money-screen progress ((obj progress) (arg0 int)) +(defmethod draw-money-screen progress ((this progress) (arg0 int)) (hide-progress-icons) - (let* ((v1-1 (/ (-> obj transition-offset) 16)) - (s4-0 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (let* ((v1-1 (/ (-> this transition-offset) 16)) + (s4-0 (if (= (-> this level-transition) 1) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) - (f30-0 (-> obj transition-percentage-invert)) + (f30-0 (-> this transition-percentage-invert)) (s3-0 (- v1-1)) ) - (when (-> obj stat-transition) - (set! v1-1 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (when (-> this stat-transition) + (set! v1-1 (if (!= (-> this display-state) (-> this next-display-state)) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) (set! s3-0 v1-1) (set! s4-0 0) (set! f30-0 1.0) ) - (set! (-> obj particles 15 init-pos x) (the float (- (+ v1-1 150) (-> obj left-x-offset)))) - (set! (-> obj particles 15 init-pos y) (the float (+ s4-0 214))) - (set! (-> obj icons 4 icon-x) (- (+ v1-1 148) (-> obj left-x-offset))) - (set! (-> obj icons 4 icon-y) (+ (-> obj big-orb-y-offset) s4-0)) - (let ((a0-15 (-> obj icons 4 icon 0 root))) + (set! (-> this particles 15 init-pos x) (the float (- (+ v1-1 150) (-> this left-x-offset)))) + (set! (-> this particles 15 init-pos y) (the float (+ s4-0 214))) + (set! (-> this icons 4 icon-x) (- (+ v1-1 148) (-> this left-x-offset))) + (set! (-> this icons 4 icon-y) (+ (-> this big-orb-y-offset) s4-0)) + (let ((a0-15 (-> this icons 4 icon 0 root))) (set-yaw-angle-clear-roll-pitch! a0-15 (- (y-angle a0-15) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) @@ -226,7 +226,7 @@ 'stack 'font-context *font-default-matrix* - (- (+ s3-0 200) (-> obj left-x-offset)) + (- (+ s3-0 200) (-> this left-x-offset)) (+ (/ s4-0 2) 96) 8325000.0 (font-color default) @@ -264,7 +264,7 @@ ) (+! (-> s4-1 origin y) 15.0) (let ((s5-2 print-game-text-scaled)) - (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* money-total)) (-> obj total-nb-of-orbs)) + (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* money-total)) (-> this total-nb-of-orbs)) (s5-2 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) ) ) @@ -275,30 +275,30 @@ ;; definition for method 26 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-buzzer-screen progress ((obj progress) (arg0 int)) +(defmethod draw-buzzer-screen progress ((this progress) (arg0 int)) (hide-progress-icons) (let* ((v1-2 (-> *level-task-data* arg0)) - (a0-3 (/ (-> obj transition-offset) 16)) - (s4-0 (if (= (-> obj level-transition) 1) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (a0-3 (/ (-> this transition-offset) 16)) + (s4-0 (if (= (-> this level-transition) 1) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) - (f30-0 (-> obj transition-percentage-invert)) + (f30-0 (-> this transition-percentage-invert)) (s3-0 (- a0-3)) ) - (when (-> obj stat-transition) - (set! a0-3 (if (!= (-> obj display-state) (-> obj next-display-state)) - (- (-> obj transition-offset)) - (-> obj transition-offset) + (when (-> this stat-transition) + (set! a0-3 (if (!= (-> this display-state) (-> this next-display-state)) + (- (-> this transition-offset)) + (-> this transition-offset) ) ) (set! s3-0 a0-3) (set! s4-0 0) (set! f30-0 1.0) ) - (set! (-> obj particles 14 init-pos x) (the float (- (+ a0-3 150) (-> obj left-x-offset)))) - (set! (-> obj particles 14 init-pos y) (the float (+ s4-0 214))) + (set! (-> this particles 14 init-pos x) (the float (- (+ a0-3 150) (-> this left-x-offset)))) + (set! (-> this particles 14 init-pos y) (the float (+ s4-0 214))) (let ((s2-0 0)) (let ((a1-8 (-> v1-2 buzzer-task-index))) (if (!= a1-8 -1) @@ -310,7 +310,7 @@ 'stack 'font-context *font-default-matrix* - (- (+ s3-0 200) (-> obj left-x-offset)) + (- (+ s3-0 200) (-> this left-x-offset)) (+ (/ s4-0 2) 96) 8325000.0 (font-color default) @@ -343,7 +343,7 @@ ) (+! (-> s4-1 origin y) 15.0) (let ((s5-2 print-game-text-scaled)) - (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* buzzer-total)) (-> obj total-nb-of-buzzers)) + (format (clear *temp-string*) "~D/~D" (the int (-> *game-info* buzzer-total)) (-> this total-nb-of-buzzers)) (s5-2 *temp-string* f30-0 s4-1 (the int (* 128.0 f30-0))) ) ) @@ -355,7 +355,7 @@ ;; definition for method 35 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-storage-error progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-storage-error progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.55) ) @@ -367,7 +367,7 @@ ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s4-0 (text-id memcard-not-formatted-title))) - (case (-> obj display-state) + (case (-> this display-state) (((progress-screen memcard-no-space)) (set! s4-0 (text-id memcard-no-space)) ) @@ -377,10 +377,10 @@ ) (let ((s3-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* s4-0 #f) 1) - (s3-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s3-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 70.0) (let ((v1-12 arg0)) (set! (-> v1-12 width) (the float 350)) @@ -392,12 +392,12 @@ (format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-space-requirement1) #f) - (if (-> obj card-info) - (-> obj card-info mem-required) + (if (-> this card-info) + (-> this card-info mem-required) 0 ) ) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-1 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (set! (-> arg0 origin y) 115.0) (let ((v1-17 arg0)) @@ -405,7 +405,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id memcard-space-requirement2) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -415,7 +415,7 @@ (set! (-> arg0 origin y) 160.0) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -425,7 +425,7 @@ ;; definition for method 49 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-format progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-format progress ((this progress) (arg0 font-context)) (set! (-> arg0 origin y) 35.0) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.55) @@ -439,9 +439,9 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s4-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-not-formatted-title) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 105.0) (let ((v1-7 arg0)) (set! (-> v1-7 width) (the float 360)) @@ -451,7 +451,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id memcard-not-formatted-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -464,7 +464,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id format?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -474,12 +474,12 @@ ;; definition for method 36 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-data-exists progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-data-exists progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 55.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 365)) @@ -489,7 +489,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id save-data-already-exists) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -502,7 +502,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id overwrite?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -512,12 +512,12 @@ ;; definition for method 37 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-no-data progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-no-data progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 40.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 365)) @@ -527,7 +527,7 @@ ) (let ((s4-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id no-save-data) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (set! (-> arg0 origin y) 130.0) (let ((v1-7 arg0)) @@ -538,7 +538,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id create-save-data?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -548,12 +548,12 @@ ;; definition for method 38 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-accessing progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-accessing progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 1.0) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 35.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 365)) @@ -561,9 +561,9 @@ (let ((v1-5 arg0)) (set! (-> v1-5 height) (the float 75)) ) - (when (or (< (mod (-> *display* real-frame-counter) 300) 150) (!= (-> obj transition-percentage-invert) 1.0)) + (when (or (< (mod (-> *display* real-frame-counter) 300) 150) (!= (-> this transition-percentage-invert) 1.0)) (let ((a1-1 (text-id loading-data))) - (case (-> obj display-state) + (case (-> this display-state) (((progress-screen memcard-saving)) (set! a1-1 (text-id saving-data)) ) @@ -574,14 +574,14 @@ (set! a1-1 (text-id creating-save-data)) ) ) - (print-game-text-scaled (lookup-text! *common-text* a1-1 #f) (-> obj transition-percentage-invert) arg0 128) + (print-game-text-scaled (lookup-text! *common-text* a1-1 #f) (-> this transition-percentage-invert) arg0 128) ) ) (let ((v1-18 arg0)) (set! (-> v1-18 scale) 0.65) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 15 (-> this left-x-offset)))) (set! (-> arg0 origin y) 100.0) (let ((v1-22 arg0)) (set! (-> v1-22 width) (the float 370)) @@ -591,7 +591,7 @@ ) (let ((s4-1 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-do-not-remove) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-1 *temp-string* (-> this transition-percentage-invert) arg0 128) ) 0 (none) @@ -599,12 +599,12 @@ ;; definition for method 39 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-insert progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-insert progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.65) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 35.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 310)) @@ -614,7 +614,7 @@ ) (let ((s4-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id insert-memcard) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (let ((v1-7 arg0)) (set! (-> v1-7 scale) 0.65) @@ -625,7 +625,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id back?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -636,7 +636,7 @@ ;; definition for method 40 of type progress ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-file-select progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-file-select progress ((this progress) (arg0 font-context)) (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object)) @@ -648,29 +648,29 @@ (sv-128 (function _varargs_ object)) (sv-144 (function _varargs_ object)) ) - (let ((s4-0 (* (+ (-> obj transition-offset) -256) 2))) + (let ((s4-0 (* (+ (-> this transition-offset) -256) 2))) (if (< s4-0 0) (set! s4-0 0) ) (if (< 500 s4-0) (set! s4-0 700) ) - (set! (-> obj particles 19 init-pos x) (the float (- (- 202 (adjust-pos s4-0 150)) (-> obj left-x-offset)))) - (set! (-> obj particles 20 init-pos x) (the float (- (+ (adjust-pos s4-0 100) 202) (-> obj left-x-offset)))) - (set! (-> obj particles 21 init-pos x) (the float (- (- 202 (adjust-pos s4-0 50)) (-> obj left-x-offset)))) - (set! (-> obj particles 22 init-pos x) (the float (- (+ s4-0 202) (-> obj left-x-offset)))) + (set! (-> this particles 19 init-pos x) (the float (- (- 202 (adjust-pos s4-0 150)) (-> this left-x-offset)))) + (set! (-> this particles 20 init-pos x) (the float (- (+ (adjust-pos s4-0 100) 202) (-> this left-x-offset)))) + (set! (-> this particles 21 init-pos x) (the float (- (- 202 (adjust-pos s4-0 50)) (-> this left-x-offset)))) + (set! (-> this particles 22 init-pos x) (the float (- (+ s4-0 202) (-> this left-x-offset)))) ) (cond ((= (-> *setting-control* current video-mode) 'pal) - (set! (-> obj particles 21 init-pos y) 256.0) - (set! (-> obj particles 22 init-pos y) 338.0) + (set! (-> this particles 21 init-pos y) 256.0) + (set! (-> this particles 22 init-pos y) 338.0) ) (else - (set! (-> obj particles 21 init-pos y) 255.0) - (set! (-> obj particles 22 init-pos y) 336.0) + (set! (-> this particles 21 init-pos y) 255.0) + (set! (-> this particles 22 init-pos y) 336.0) ) ) - (let ((f0-13 (* 2.0 (+ -0.5 (-> obj transition-percentage-invert))))) + (let ((f0-13 (* 2.0 (+ -0.5 (-> this transition-percentage-invert))))) 128 (if (< f0-13 0.0) (set! f0-13 0.0) @@ -680,7 +680,7 @@ (set! (-> v1-29 scale) 0.5) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 102 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 102 (-> this left-x-offset)))) (set! (-> arg0 origin y) 5.0) (let ((v1-33 arg0)) (set! (-> v1-33 width) (the float 200)) @@ -691,7 +691,7 @@ (print-game-text (lookup-text! *common-text* - (if (= (-> obj display-state) (progress-screen load-game)) + (if (= (-> this display-state) (progress-screen load-game)) (text-id select-file-to-load) (text-id select-file-to-save) ) @@ -706,11 +706,11 @@ (let ((v1-37 arg0)) (set! (-> v1-37 height) (the float 20)) ) - (let ((s3-3 (-> obj card-info)) + (let ((s3-3 (-> this card-info)) (s2-0 23) ) (dotimes (s1-0 4) - (set! (-> arg0 origin x) (the float (- 41 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 41 (-> this left-x-offset)))) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (let ((a0-17 arg0)) (set! (-> a0-17 color) (font-color default)) @@ -720,7 +720,7 @@ ) (cond ((and s3-3 (= (-> s3-3 formatted) 1) (= (-> s3-3 inited) 1) (= (-> s3-3 file s1-0 present) 1)) - (set! (-> obj particles s2-0 init-pos x) (the float (- 66 (-> obj left-x-offset)))) + (set! (-> this particles s2-0 init-pos x) (the float (- 66 (-> this left-x-offset)))) (let ((v1-57 arg0)) (set! (-> v1-57 scale) 0.6) ) @@ -744,10 +744,10 @@ (set! (-> a0-28 color) (font-color progress-memcard)) ) (cond - ((or (>= (seconds 2) (- (-> *display* real-frame-counter) (-> obj last-option-index-change))) - (or (< (mod (- (-> *display* real-frame-counter) (-> obj last-option-index-change)) 1200) 600) - (!= (-> obj option-index) s1-0) - (-> obj in-transition) + ((or (>= (seconds 2) (- (-> *display* real-frame-counter) (-> this last-option-index-change))) + (or (< (mod (- (-> *display* real-frame-counter) (-> this last-option-index-change)) 1200) 600) + (!= (-> this option-index) s1-0) + (-> this in-transition) ) ) (let ((v1-87 arg0)) @@ -755,7 +755,7 @@ ) (+! (-> arg0 origin y) 16.0) (set! (-> arg0 flags) (font-flags shadow kerning middle large)) - (set! (-> arg0 origin x) (the float (- -73 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- -73 (-> this left-x-offset)))) (let ((v1-91 arg0)) (set! (-> v1-91 width) (the float 350)) ) @@ -769,7 +769,7 @@ ) (s0-2 *temp-string* arg0 #f s4-1 22) ) - (set! (-> arg0 origin x) (the float (- 1 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 1 (-> this left-x-offset)))) (let ((s0-3 print-game-text)) (set! sv-32 format) (let ((a0-44 (clear *temp-string*)) @@ -780,7 +780,7 @@ ) (s0-3 *temp-string* arg0 #f s4-1 22) ) - (set! (-> arg0 origin x) (the float (- 79 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 79 (-> this left-x-offset)))) (let ((s0-4 print-game-text)) (set! sv-48 format) (let ((a0-48 (clear *temp-string*)) @@ -796,7 +796,7 @@ (set! (-> v1-108 scale) 1.0) ) (set! (-> arg0 flags) (font-flags shadow kerning right large)) - (set! (-> arg0 origin x) (the float (- 352 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 352 (-> this left-x-offset)))) (let ((s0-5 print-game-text)) (set! sv-64 format) (let ((a0-52 (clear *temp-string*)) @@ -812,13 +812,13 @@ ) (+! (-> arg0 origin y) 9.0) (set! (-> arg0 flags) (font-flags shadow kerning large)) - (set! (-> arg0 origin x) (the float (- 85 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 85 (-> this left-x-offset)))) (let ((s0-6 print-game-text)) (set! sv-80 format) (let ((a0-56 (clear *temp-string*)) (a1-21 "/~D") (a2-17 (if (< 100 (the int (-> s3-3 file s1-0 fuel-cell-count))) - (-> obj total-nb-of-power-cells) + (-> this total-nb-of-power-cells) 100 ) ) @@ -827,23 +827,23 @@ ) (s0-6 *temp-string* arg0 #f s4-1 22) ) - (set! (-> arg0 origin x) (the float (- 150 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 150 (-> this left-x-offset)))) (let ((s0-7 print-game-text)) (set! sv-96 format) (let ((a0-60 (clear *temp-string*)) (a1-23 "/~D") - (a2-19 (-> obj total-nb-of-orbs)) + (a2-19 (-> this total-nb-of-orbs)) ) (sv-96 a0-60 a1-23 a2-19) ) (s0-7 *temp-string* arg0 #f s4-1 22) ) - (set! (-> arg0 origin x) (the float (- 238 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 238 (-> this left-x-offset)))) (let ((s0-8 print-game-text)) (set! sv-112 format) (let ((a0-64 (clear *temp-string*)) (a1-25 "/~D") - (a2-21 (-> obj total-nb-of-buzzers)) + (a2-21 (-> this total-nb-of-buzzers)) ) (sv-112 a0-64 a1-25 a2-21) ) @@ -853,7 +853,7 @@ ) (else (+! (-> arg0 origin y) 18.0) - (set! (-> arg0 origin x) (the float (- 28 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 28 (-> this left-x-offset)))) (let ((v1-131 arg0)) (set! (-> v1-131 scale) 0.8) ) @@ -895,13 +895,13 @@ ) ) ) - (set! (-> obj particles s2-0 init-pos x) -320.0) + (set! (-> this particles s2-0 init-pos x) -320.0) (+! (-> arg0 origin y) 23.0) ) ) ) (else - (set! (-> obj particles s2-0 init-pos x) -320.0) + (set! (-> this particles s2-0 init-pos x) -320.0) (+! (-> arg0 origin y) 12.0) (let ((v1-173 arg0)) (set! (-> v1-173 scale) 0.7) @@ -921,12 +921,12 @@ ;; definition for method 41 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-auto-save-error progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-auto-save-error progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.6) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 70 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 70 (-> this left-x-offset)))) (set! (-> arg0 origin y) 5.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 265)) @@ -936,11 +936,11 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id error-saving) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 34.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 360)) @@ -950,7 +950,7 @@ ) (let ((s4-1 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id check-memcard) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-1 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (set! (-> arg0 origin y) 89.0) (let ((v1-12 arg0)) @@ -961,7 +961,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-title) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -974,7 +974,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -987,7 +987,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -997,12 +997,12 @@ ;; definition for method 42 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-removed progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-removed progress ((this progress) (arg0 font-context)) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.6) ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) - (set! (-> arg0 origin x) (the float (- 70 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 70 (-> this left-x-offset)))) (set! (-> arg0 origin y) 10.0) (let ((v1-4 arg0)) (set! (-> v1-4 width) (the float 265)) @@ -1012,9 +1012,9 @@ ) (let ((s4-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id memcard-removed) #f) 1) - (s4-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 78.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 360)) @@ -1024,7 +1024,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-title) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1037,7 +1037,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-disabled-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1050,7 +1050,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1060,7 +1060,7 @@ ;; definition for method 43 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-memcard-error progress ((obj progress) (arg0 font-context)) +(defmethod draw-memcard-error progress ((this progress) (arg0 font-context)) (set! (-> arg0 origin y) 15.0) (let ((v1-0 arg0)) (set! (-> v1-0 scale) 0.7) @@ -1073,7 +1073,7 @@ ) (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (let ((s4-0 (text-id error-loading))) - (case (-> obj display-state) + (case (-> this display-state) (((progress-screen memcard-error-saving)) (set! s4-0 (text-id error-saving)) ) @@ -1086,10 +1086,10 @@ ) (let ((s3-0 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* s4-0 #f) 1) - (s3-0 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s3-0 *temp-string* (-> this transition-percentage-invert) arg0 128) ) ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 80.0) (let ((v1-13 arg0)) (set! (-> v1-13 width) (the float 360)) @@ -1099,7 +1099,7 @@ ) (let ((s4-1 print-game-text-scaled)) (format (clear *temp-string*) (lookup-text! *common-text* (text-id check-memcard-and-retry) #f) 1) - (s4-1 *temp-string* (-> obj transition-percentage-invert) arg0 128) + (s4-1 *temp-string* (-> this transition-percentage-invert) arg0 128) ) (let ((v1-16 arg0)) (set! (-> v1-16 scale) 0.65) @@ -1110,7 +1110,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1120,8 +1120,8 @@ ;; definition for method 50 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-auto-save progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 35 (-> obj left-x-offset)))) +(defmethod draw-auto-save progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 35 (-> this left-x-offset)))) (set! (-> arg0 origin y) 18.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1135,11 +1135,11 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-warn-title) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 15 (-> this left-x-offset)))) (set! (-> arg0 origin y) 110.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 370)) @@ -1149,7 +1149,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id autosave-warn-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1162,7 +1162,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1174,11 +1174,11 @@ ) (set! (-> *progress-process* 0 particles 31 init-pos x) (the float - (- (if (or (< (mod (-> *display* real-frame-counter) 300) 270) (!= (-> obj transition-percentage-invert) 1.0)) + (- (if (or (< (mod (-> *display* real-frame-counter) 300) 270) (!= (-> this transition-percentage-invert) 1.0)) 205 -320 ) - (-> obj left-x-offset) + (-> this left-x-offset) ) ) ) @@ -1188,8 +1188,8 @@ ;; definition for method 54 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-pal-change-to-60hz progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) +(defmethod draw-pal-change-to-60hz progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 20.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1203,11 +1203,11 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id screen-change-to-60hz) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) - (set! (-> arg0 origin x) (the float (- 15 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 15 (-> this left-x-offset)))) (set! (-> arg0 origin y) 60.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 370)) @@ -1217,7 +1217,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id screen-60hz-warn-support) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1227,7 +1227,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id screen-60hz-warn-timer) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1240,7 +1240,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1250,8 +1250,8 @@ ;; definition for method 56 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-no-disc progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) +(defmethod draw-no-disc progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 50.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1265,11 +1265,11 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id no-disc-title) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 90.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 360)) @@ -1279,7 +1279,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id no-disc-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1293,7 +1293,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1304,8 +1304,8 @@ ;; definition for method 57 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-bad-disc progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) +(defmethod draw-bad-disc progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 50.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1319,11 +1319,11 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id bad-disc-title) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) - (set! (-> arg0 origin x) (the float (- 20 (-> obj left-x-offset)))) + (set! (-> arg0 origin x) (the float (- 20 (-> this left-x-offset)))) (set! (-> arg0 origin y) 90.0) (let ((v1-9 arg0)) (set! (-> v1-9 width) (the float 360)) @@ -1333,7 +1333,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id bad-disc-msg) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1346,7 +1346,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id continue?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1356,8 +1356,8 @@ ;; definition for method 58 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-quit progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) +(defmethod draw-quit progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 70.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1371,7 +1371,7 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id quit?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1381,8 +1381,8 @@ ;; definition for method 55 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-pal-now-60hz progress ((obj progress) (arg0 font-context)) - (set! (-> arg0 origin x) (the float (- 50 (-> obj left-x-offset)))) +(defmethod draw-pal-now-60hz progress ((this progress) (arg0 font-context)) + (set! (-> arg0 origin x) (the float (- 50 (-> this left-x-offset)))) (set! (-> arg0 origin y) 45.0) (let ((v1-2 arg0)) (set! (-> v1-2 scale) 0.6) @@ -1396,7 +1396,7 @@ (set! (-> arg0 flags) (font-flags shadow kerning middle middle-vert large)) (print-game-text-scaled (lookup-text! *common-text* (text-id screen-now-60hz) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1406,7 +1406,7 @@ ) (print-game-text-scaled (lookup-text! *common-text* (text-id screen-60hz-keep?) #f) - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) arg0 128 ) @@ -1416,14 +1416,14 @@ ;; definition for method 27 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-notice-screen progress ((obj progress)) +(defmethod draw-notice-screen progress ((this progress)) (hide-progress-icons) (when *common-text* (let ((a1-1 (new 'stack 'font-context *font-default-matrix* - (- 70 (-> obj left-x-offset)) + (- 70 (-> this left-x-offset)) 10 0.0 (font-color default) @@ -1431,65 +1431,65 @@ ) ) ) - (case (-> obj display-state) + (case (-> this display-state) (((progress-screen memcard-format)) - (draw-memcard-format obj a1-1) + (draw-memcard-format this a1-1) ) (((progress-screen memcard-no-space) (progress-screen memcard-not-inserted) (progress-screen memcard-not-formatted) ) - (draw-memcard-storage-error obj a1-1) + (draw-memcard-storage-error this a1-1) ) (((progress-screen memcard-data-exists)) - (draw-memcard-data-exists obj a1-1) + (draw-memcard-data-exists this a1-1) ) (((progress-screen memcard-no-data)) - (draw-memcard-no-data obj a1-1) + (draw-memcard-no-data this a1-1) ) (((progress-screen memcard-loading) (progress-screen memcard-saving) (progress-screen memcard-formatting) (progress-screen memcard-creating) ) - (draw-memcard-accessing obj a1-1) + (draw-memcard-accessing this a1-1) ) (((progress-screen memcard-insert)) - (draw-memcard-insert obj a1-1) + (draw-memcard-insert this a1-1) ) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (draw-memcard-file-select obj a1-1) + (draw-memcard-file-select this a1-1) ) (((progress-screen memcard-auto-save-error)) - (draw-memcard-auto-save-error obj a1-1) + (draw-memcard-auto-save-error this a1-1) ) (((progress-screen memcard-removed)) - (draw-memcard-removed obj a1-1) + (draw-memcard-removed this a1-1) ) (((progress-screen memcard-error-loading) (progress-screen memcard-error-saving) (progress-screen memcard-error-formatting) (progress-screen memcard-error-creating) ) - (draw-memcard-error obj a1-1) + (draw-memcard-error this a1-1) ) (((progress-screen auto-save)) - (draw-auto-save obj a1-1) + (draw-auto-save this a1-1) ) (((progress-screen pal-change-to-60hz)) - (draw-pal-change-to-60hz obj a1-1) + (draw-pal-change-to-60hz this a1-1) ) (((progress-screen pal-now-60hz)) - (draw-pal-now-60hz obj a1-1) + (draw-pal-now-60hz this a1-1) ) (((progress-screen no-disc)) - (draw-no-disc obj a1-1) + (draw-no-disc this a1-1) ) (((progress-screen bad-disc)) - (draw-bad-disc obj a1-1) + (draw-bad-disc this a1-1) ) (((progress-screen quit)) - (draw-quit obj a1-1) + (draw-quit this a1-1) ) ) ) @@ -1551,7 +1551,7 @@ ;; definition for method 28 of type progress ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod draw-options progress ((obj progress) (arg0 int) (arg1 int) (arg2 float)) +(defmethod draw-options progress ((this progress) (arg0 int) (arg1 int) (arg2 float)) (local-vars (sv-112 font-context) (sv-128 int) @@ -1605,7 +1605,7 @@ (sv-896 string) (sv-912 string) ) - (let ((s3-0 (-> *options-remap* (-> obj display-state)))) + (let ((s3-0 (-> *options-remap* (-> this display-state)))) (when s3-0 (let ((s2-1 (- arg0 (/ (* arg1 (length s3-0)) 2))) (s1-0 0) @@ -1666,11 +1666,11 @@ ) ) ) - ((and (-> obj selected-option) (= (-> obj option-index) s0-0)) + ((and (-> this selected-option) (= (-> this option-index) s0-0)) (let ((a0-19 sv-112)) (set! (-> a0-19 color) (font-color default)) ) - (set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset)))) + (set! (-> sv-112 origin x) (the float (- sv-128 (-> this left-x-offset)))) (case (-> s3-0 s0-0 option-type) (((game-option-type center-screen)) (set! (-> sv-112 origin y) (the float (+ s2-1 -20))) @@ -1708,7 +1708,7 @@ (a0-34 (logior (logand v1-82 -256) (shr (shl (the int (+ 64.0 (* 191.0 f0-12))) 56) 56))) (a3-5 (logior (logand a0-34 -65281) (shr (shl (shr (shl a0-34 56) 56) 56) 48))) ) - (draw-percent-bar (- 75 (-> obj left-x-offset)) (+ s2-1 8) f0-12 (the-as rgba a3-5)) + (draw-percent-bar (- 75 (-> this left-x-offset)) (+ s2-1 8) f0-12 (the-as rgba a3-5)) ) (set! sv-304 format) (let ((a0-42 (clear *temp-string*)) @@ -1748,7 +1748,7 @@ ) ) (((game-option-type language)) - (set! sv-512 (the-as int (-> obj language-selection))) + (set! sv-512 (the-as int (-> this language-selection))) (set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) (if (and (zero? (scf-get-territory)) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) @@ -1756,14 +1756,14 @@ (set! sv-464 5) (set! sv-464 6) ) - (if (-> obj language-transition) - (seekl! (-> obj language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio)))) + (if (-> this language-transition) + (seekl! (-> this language-x-offset) 200 (the int (* 10.0 (-> *display* time-adjust-ratio)))) ) - (when (>= (-> obj language-x-offset) 100) - (set! (-> obj language-selection) (the-as language-enum sv-448)) + (when (>= (-> this language-x-offset) 100) + (set! (-> this language-selection) (the-as language-enum sv-448)) (set! sv-512 (the-as int sv-448)) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) + (set! (-> this language-transition) #f) + (set! (-> this language-x-offset) 0) 0 ) (set! (-> sv-112 origin y) (the float (+ s2-1 3))) @@ -1777,11 +1777,11 @@ ) (set! sv-496 (mod (+ sv-464 -2 sv-512) sv-464)) (cond - ((-> obj language-direction) - (let ((a2-22 (- 200 (+ (-> obj language-x-offset) 100)))) + ((-> this language-direction) + (let ((a2-22 (- 200 (+ (-> this language-x-offset) 100)))) (print-language-name a0-66 sv-112 a2-22 #f) ) - (let ((a2-23 (+ (-> obj language-x-offset) 100))) + (let ((a2-23 (+ (-> this language-x-offset) 100))) (cond ((< a2-23 150) (let ((t9-27 print-language-name) @@ -1792,7 +1792,7 @@ ) ) (else - (let ((a2-24 (- 200 (-> obj language-x-offset))) + (let ((a2-24 (- 200 (-> this language-x-offset))) (t9-28 print-language-name) (a1-31 sv-112) (a3-10 #f) @@ -1804,33 +1804,33 @@ ) ) (else - (let ((a2-25 (+ (-> obj language-x-offset) 100))) + (let ((a2-25 (+ (-> this language-x-offset) 100))) (cond ((< a2-25 150) (print-language-name a0-66 sv-112 a2-25 #f) ) (else - (let ((a2-26 (- 200 (-> obj language-x-offset)))) + (let ((a2-26 (- 200 (-> this language-x-offset)))) (print-language-name v1-153 sv-112 a2-26 #t) ) ) ) ) - (let ((a2-27 (- 200 (+ (-> obj language-x-offset) 100)))) + (let ((a2-27 (- 200 (+ (-> this language-x-offset) 100)))) (print-language-name sv-480 sv-112 a2-27 #t) ) ) ) ) - (when (not (-> obj language-transition)) + (when (not (-> this language-transition)) (let ((a0-75 sv-112)) (set! (-> a0-75 color) (font-color progress-selected)) ) ) (let ((t9-32 print-language-name) (a1-37 sv-112) - (a2-28 (-> obj language-x-offset)) - (a3-14 (-> obj language-direction)) + (a2-28 (-> this language-x-offset)) + (a3-14 (-> this language-direction)) ) (t9-32 sv-512 a1-37 a2-28 a3-14) ) @@ -1941,15 +1941,15 @@ ) ) (when sv-912 - (let ((f0-23 (-> obj transition-percentage-invert))) + (let ((f0-23 (-> this transition-percentage-invert))) (let ((v1-235 sv-112)) - (set! (-> v1-235 color) (if (and (= s0-0 (-> obj option-index)) (not (-> obj in-transition))) + (set! (-> v1-235 color) (if (and (= s0-0 (-> this option-index)) (not (-> this in-transition))) (font-color progress-selected) (font-color default) ) ) ) - (set! (-> sv-112 origin x) (the float (- sv-128 (-> obj left-x-offset)))) + (set! (-> sv-112 origin x) (the float (- sv-128 (-> this left-x-offset)))) (set! (-> sv-112 origin y) (the float (the int (* (the float sv-144) (if (-> s3-0 s0-0 scale) f0-23 1.0 @@ -1983,17 +1983,17 @@ ;; definition for method 17 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod draw-progress progress ((obj progress)) - (let ((f30-0 (+ -409.0 (-> obj particles 2 init-pos x) (* 0.8 (the float (-> obj left-x-offset))))) - (s5-0 (if (or (-> obj stat-transition) (nonzero? (-> obj level-transition))) +(defmethod draw-progress progress ((this progress)) + (let ((f30-0 (+ -409.0 (-> this particles 2 init-pos x) (* 0.8 (the float (-> this left-x-offset))))) + (s5-0 (if (or (-> this stat-transition) (nonzero? (-> this level-transition))) 0 - (-> obj transition-offset) + (-> this transition-offset) ) ) ) - (let ((f28-0 (if (or (-> obj stat-transition) (nonzero? (-> obj level-transition))) + (let ((f28-0 (if (or (-> this stat-transition) (nonzero? (-> this level-transition))) 1.0 - (-> obj transition-percentage-invert) + (-> this transition-percentage-invert) ) ) ) @@ -2053,7 +2053,7 @@ 'stack 'font-context *font-default-matrix* - (the int (+ (- 423.0 (the float (/ (-> obj left-x-offset) 2))) f30-0 (the float (adjust-pos s5-0 150)))) + (the int (+ (- 423.0 (the float (/ (-> this left-x-offset) 2))) f30-0 (the float (adjust-pos s5-0 150)))) 131 0.0 (font-color default) @@ -2103,27 +2103,27 @@ ) ) 0.0 - (let ((f28-1 (+ -94.0 (-> obj particles 2 init-pos x))) + (let ((f28-1 (+ -94.0 (-> this particles 2 init-pos x))) (s3-4 90) (s4-3 224) (s2-5 (/ s5-0 5)) - (f26-3 (-> obj button-scale)) + (f26-3 (-> this button-scale)) ) (let ((f24-0 (* 182.04445 (- (/ -36.0 f26-3) (the float s2-5))))) - (set! (-> obj particles 27 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-0)))))) - (set! (-> obj particles 27 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-0)))))) + (set! (-> this particles 27 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-0)))))) + (set! (-> this particles 27 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-0)))))) ) (let ((f24-2 (* 182.04445 (- (/ -21.0 f26-3) (the float (adjust-pos s2-5 10)))))) - (set! (-> obj particles 28 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-2)))))) - (set! (-> obj particles 28 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-2)))))) + (set! (-> this particles 28 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-2)))))) + (set! (-> this particles 28 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-2)))))) ) (let ((f24-4 (* 182.04445 (- (/ -6.0 f26-3) (the float (adjust-pos s2-5 15)))))) - (set! (-> obj particles 29 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-4)))))) - (set! (-> obj particles 29 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-4)))))) + (set! (-> this particles 29 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f24-4)))))) + (set! (-> this particles 29 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f24-4)))))) ) (let ((f26-5 (* 182.04445 (- (/ 9.0 f26-3) (the float (adjust-pos s2-5 20)))))) - (set! (-> obj particles 30 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f26-5)))))) - (set! (-> obj particles 30 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f26-5)))))) + (set! (-> this particles 30 init-pos x) (the float (+ s3-4 (the int (* f28-1 (cos f26-5)))))) + (set! (-> this particles 30 init-pos y) (the float (+ s4-3 (the int (* f28-1 (sin f26-5)))))) ) ) (when *cheat-mode* @@ -2159,7 +2159,7 @@ ) ) ) - (let ((a0-52 (-> obj icons 5 icon 0 root))) + (let ((a0-52 (-> this icons 5 icon 0 root))) (set-yaw-angle-clear-roll-pitch! a0-52 (- (y-angle a0-52) (* 182.04445 (* 4.0 (-> *display* time-adjust-ratio)))) @@ -2168,28 +2168,28 @@ (let* ((f28-2 (* 0.00024414062 (the float (-> *progress-process* 0 in-out-position)))) (f30-1 (* 300.0 f28-2)) ) - (set! (-> obj particles 18 init-pos x) - (the float (+ (the int (the float (adjust-pos s5-0 50))) 394 (the int f30-1) (-> obj right-x-offset))) + (set! (-> this particles 18 init-pos x) + (the float (+ (the int (the float (adjust-pos s5-0 50))) 394 (the int f30-1) (-> this right-x-offset))) ) - (set! (-> obj particles 18 init-pos y) (the float (- 40 (the int (* 80.0 f28-2))))) - (set! (-> obj icons 5 icon-x) - (+ (the int (the float (adjust-pos s5-0 50))) 393 (the int f30-1) (-> obj right-x-offset)) + (set! (-> this particles 18 init-pos y) (the float (- 40 (the int (* 80.0 f28-2))))) + (set! (-> this icons 5 icon-x) + (+ (the int (the float (adjust-pos s5-0 50))) 393 (the int f30-1) (-> this right-x-offset)) ) - (set! (-> obj icons 5 icon-y) (- (-> obj small-orb-y-offset) (the int (* 80.0 f28-2)))) - (set! (-> obj particles 16 init-pos x) - (the float (+ (the int (the float (adjust-pos s5-0 100))) 425 (the int f30-1) (-> obj right-x-offset))) + (set! (-> this icons 5 icon-y) (- (-> this small-orb-y-offset) (the int (* 80.0 f28-2)))) + (set! (-> this particles 16 init-pos x) + (the float (+ (the int (the float (adjust-pos s5-0 100))) 425 (the int f30-1) (-> this right-x-offset))) ) - (set! (-> obj particles 16 init-pos y) (the float (- 112 (the int (* 60.0 f28-2))))) - (set! (-> obj particles 17 init-pos x) (the float (+ (the int (the float (adjust-pos s5-0 150))) - 442 - (the int f30-1) - (the int (* 0.7 (the float (-> obj right-x-offset)))) - ) - ) + (set! (-> this particles 16 init-pos y) (the float (- 112 (the int (* 60.0 f28-2))))) + (set! (-> this particles 17 init-pos x) (the float (+ (the int (the float (adjust-pos s5-0 150))) + 442 + (the int f30-1) + (the int (* 0.7 (the float (-> this right-x-offset)))) + ) + ) ) ) ) - (set! (-> obj particles 17 init-pos y) 193.0) + (set! (-> this particles 17 init-pos y) 193.0) 0 (none) ) diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress-h_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress-h_REF.gc index 93baeaf5e5..ab4fa423c8 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress-h_REF.gc @@ -13,11 +13,11 @@ ) ;; definition for method 3 of type count-info -(defmethod inspect count-info ((obj count-info)) - (format #t "[~8x] ~A~%" obj 'count-info) - (format #t "~Tmoney-count: ~D~%" (-> obj money-count)) - (format #t "~Tbuzzer-count: ~D~%" (-> obj buzzer-count)) - obj +(defmethod inspect count-info ((this count-info)) + (format #t "[~8x] ~A~%" this 'count-info) + (format #t "~Tmoney-count: ~D~%" (-> this money-count)) + (format #t "~Tbuzzer-count: ~D~%" (-> this buzzer-count)) + this ) ;; definition of type game-count-info @@ -31,11 +31,11 @@ ) ;; definition for method 3 of type game-count-info -(defmethod inspect game-count-info ((obj game-count-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect game-count-info ((this game-count-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; definition of type task-info-data @@ -50,12 +50,12 @@ ) ;; definition for method 3 of type task-info-data -(defmethod inspect task-info-data ((obj task-info-data)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttask-id: ~D~%" (-> obj task-id)) - (format #t "~Ttask-name[4] @ #x~X~%" (-> obj task-name)) - (format #t "~Ttext-index-when-resolved: ~D~%" (-> obj text-index-when-resolved)) - obj +(defmethod inspect task-info-data ((this task-info-data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttask-id: ~D~%" (-> this task-id)) + (format #t "~Ttask-name[4] @ #x~X~%" (-> this task-name)) + (format #t "~Ttext-index-when-resolved: ~D~%" (-> this text-index-when-resolved)) + this ) ;; definition of type level-tasks-info @@ -72,14 +72,14 @@ ) ;; definition for method 3 of type level-tasks-info -(defmethod inspect level-tasks-info ((obj level-tasks-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlevel-name-id: ~D~%" (-> obj level-name-id)) - (format #t "~Ttext-group-index: ~D~%" (-> obj text-group-index)) - (format #t "~Tnb-of-tasks: ~D~%" (-> obj nb-of-tasks)) - (format #t "~Tbuzzer-task-index: ~D~%" (-> obj buzzer-task-index)) - (format #t "~Ttask-info[8] @ #x~X~%" (-> obj task-info)) - obj +(defmethod inspect level-tasks-info ((this level-tasks-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlevel-name-id: ~D~%" (-> this level-name-id)) + (format #t "~Ttext-group-index: ~D~%" (-> this text-group-index)) + (format #t "~Tnb-of-tasks: ~D~%" (-> this nb-of-tasks)) + (format #t "~Tbuzzer-task-index: ~D~%" (-> this buzzer-task-index)) + (format #t "~Ttask-info[8] @ #x~X~%" (-> this task-info)) + this ) ;; definition of type game-option @@ -98,16 +98,16 @@ ) ;; definition for method 3 of type game-option -(defmethod inspect game-option ((obj game-option)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Toption-type: ~D~%" (-> obj option-type)) - (format #t "~Tname: ~D~%" (-> obj name)) - (format #t "~Tscale: ~A~%" (-> obj scale)) - (format #t "~Tparam1: ~f~%" (-> obj param1)) - (format #t "~Tparam2: ~f~%" (-> obj param2)) - (format #t "~Tparam3: ~D~%" (-> obj param3)) - (format #t "~Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) - obj +(defmethod inspect game-option ((this game-option)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Toption-type: ~D~%" (-> this option-type)) + (format #t "~Tname: ~D~%" (-> this name)) + (format #t "~Tscale: ~A~%" (-> this scale)) + (format #t "~Tparam1: ~f~%" (-> this param1)) + (format #t "~Tparam2: ~f~%" (-> this param2)) + (format #t "~Tparam3: ~D~%" (-> this param3)) + (format #t "~Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) + this ) ;; definition of type progress @@ -229,65 +229,65 @@ ) ;; definition for method 3 of type progress -(defmethod inspect progress ((obj progress)) +(defmethod inspect progress ((this progress)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcurrent-debug-string: ~D~%" (-> obj current-debug-string)) - (format #t "~T~Tcurrent-debug-language: ~D~%" (-> obj current-debug-language)) - (format #t "~T~Tcurrent-debug-group: ~D~%" (-> obj current-debug-group)) - (format #t "~T~Tin-out-position: ~D~%" (-> obj in-out-position)) - (format #t "~T~Tdisplay-state: ~D~%" (-> obj display-state)) - (format #t "~T~Tnext-display-state: ~D~%" (-> obj next-display-state)) - (format #t "~T~Toption-index: ~D~%" (-> obj option-index)) - (format #t "~T~Tselected-option: ~A~%" (-> obj selected-option)) - (format #t "~T~Tcompletion-percentage: ~f~%" (-> obj completion-percentage)) - (format #t "~T~Tready-to-run: ~A~%" (-> obj ready-to-run)) - (format #t "~T~Tdisplay-level-index: ~D~%" (-> obj display-level-index)) - (format #t "~T~Tnext-level-index: ~D~%" (-> obj next-level-index)) - (format #t "~T~Ttask-index: ~D~%" (-> obj task-index)) - (format #t "~T~Tin-transition: ~A~%" (-> obj in-transition)) - (format #t "~T~Tlast-in-transition: ~A~%" (-> obj last-in-transition)) - (format #t "~T~Tforce-transition: ~A~%" (-> obj force-transition)) - (format #t "~T~Tstat-transition: ~A~%" (-> obj stat-transition)) - (format #t "~T~Tlevel-transition: ~D~%" (-> obj level-transition)) - (format #t "~T~Tlanguage-selection: ~D~%" (-> obj language-selection)) - (format #t "~T~Tlanguage-direction: ~A~%" (-> obj language-direction)) - (format #t "~T~Tlanguage-transition: ~A~%" (-> obj language-transition)) - (format #t "~T~Tlanguage-x-offset: ~D~%" (-> obj language-x-offset)) - (format #t "~T~Tsides-x-scale: ~f~%" (-> obj sides-x-scale)) - (format #t "~T~Tsides-y-scale: ~f~%" (-> obj sides-y-scale)) - (format #t "~T~Tleft-x-offset: ~D~%" (-> obj left-x-offset)) - (format #t "~T~Tright-x-offset: ~D~%" (-> obj right-x-offset)) - (format #t "~T~Tbutton-scale: ~f~%" (-> obj button-scale)) - (format #t "~T~Tslot-scale: ~f~%" (-> obj slot-scale)) - (format #t "~T~Tleft-side-x-scale: ~f~%" (-> obj left-side-x-scale)) - (format #t "~T~Tleft-side-y-scale: ~f~%" (-> obj left-side-y-scale)) - (format #t "~T~Tright-side-x-scale: ~f~%" (-> obj right-side-x-scale)) - (format #t "~T~Tright-side-y-scale: ~f~%" (-> obj right-side-y-scale)) - (format #t "~T~Tsmall-orb-y-offset: ~D~%" (-> obj small-orb-y-offset)) - (format #t "~T~Tbig-orb-y-offset: ~D~%" (-> obj big-orb-y-offset)) - (format #t "~T~Ttransition-offset: ~D~%" (-> obj transition-offset)) - (format #t "~T~Ttransition-offset-invert: ~D~%" (-> obj transition-offset-invert)) - (format #t "~T~Ttransition-percentage: ~f~%" (-> obj transition-percentage)) - (format #t "~T~Ttransition-percentage-invert: ~f~%" (-> obj transition-percentage-invert)) - (format #t "~T~Ttransition-speed: ~f~%" (-> obj transition-speed)) - (format #t "~T~Ttotal-nb-of-power-cells: ~D~%" (-> obj total-nb-of-power-cells)) - (format #t "~T~Ttotal-nb-of-orbs: ~D~%" (-> obj total-nb-of-orbs)) - (format #t "~T~Ttotal-nb-of-buzzers: ~D~%" (-> obj total-nb-of-buzzers)) - (format #t "~T~Tcard-info: #~%" (-> obj card-info)) - (format #t "~T~Tlast-option-index-change: ~D~%" (-> obj last-option-index-change)) - (format #t "~T~Tvideo-mode-timeout: ~D~%" (-> obj video-mode-timeout)) - (format #t "~T~Tdisplay-state-stack[5] @ #x~X~%" (-> obj display-state-stack)) - (format #t "~T~Toption-index-stack[5] @ #x~X~%" (-> obj option-index-stack)) - (format #t "~T~Tdisplay-state-pos: ~D~%" (-> obj display-state-pos)) - (format #t "~T~Tnb-of-icons: ~D~%" (-> obj nb-of-icons)) - (format #t "~T~Ticons[6] @ #x~X~%" (-> obj icons)) - (format #t "~T~Tmax-nb-of-particles: ~D~%" (-> obj max-nb-of-particles)) - (format #t "~T~Tnb-of-particles: ~D~%" (-> obj nb-of-particles)) - (format #t "~T~Tparticles[40] @ #x~X~%" (-> obj particles)) - (format #t "~T~Tparticle-state[40] @ #x~X~%" (-> obj particle-state)) - obj + (format #t "~T~Tcurrent-debug-string: ~D~%" (-> this current-debug-string)) + (format #t "~T~Tcurrent-debug-language: ~D~%" (-> this current-debug-language)) + (format #t "~T~Tcurrent-debug-group: ~D~%" (-> this current-debug-group)) + (format #t "~T~Tin-out-position: ~D~%" (-> this in-out-position)) + (format #t "~T~Tdisplay-state: ~D~%" (-> this display-state)) + (format #t "~T~Tnext-display-state: ~D~%" (-> this next-display-state)) + (format #t "~T~Toption-index: ~D~%" (-> this option-index)) + (format #t "~T~Tselected-option: ~A~%" (-> this selected-option)) + (format #t "~T~Tcompletion-percentage: ~f~%" (-> this completion-percentage)) + (format #t "~T~Tready-to-run: ~A~%" (-> this ready-to-run)) + (format #t "~T~Tdisplay-level-index: ~D~%" (-> this display-level-index)) + (format #t "~T~Tnext-level-index: ~D~%" (-> this next-level-index)) + (format #t "~T~Ttask-index: ~D~%" (-> this task-index)) + (format #t "~T~Tin-transition: ~A~%" (-> this in-transition)) + (format #t "~T~Tlast-in-transition: ~A~%" (-> this last-in-transition)) + (format #t "~T~Tforce-transition: ~A~%" (-> this force-transition)) + (format #t "~T~Tstat-transition: ~A~%" (-> this stat-transition)) + (format #t "~T~Tlevel-transition: ~D~%" (-> this level-transition)) + (format #t "~T~Tlanguage-selection: ~D~%" (-> this language-selection)) + (format #t "~T~Tlanguage-direction: ~A~%" (-> this language-direction)) + (format #t "~T~Tlanguage-transition: ~A~%" (-> this language-transition)) + (format #t "~T~Tlanguage-x-offset: ~D~%" (-> this language-x-offset)) + (format #t "~T~Tsides-x-scale: ~f~%" (-> this sides-x-scale)) + (format #t "~T~Tsides-y-scale: ~f~%" (-> this sides-y-scale)) + (format #t "~T~Tleft-x-offset: ~D~%" (-> this left-x-offset)) + (format #t "~T~Tright-x-offset: ~D~%" (-> this right-x-offset)) + (format #t "~T~Tbutton-scale: ~f~%" (-> this button-scale)) + (format #t "~T~Tslot-scale: ~f~%" (-> this slot-scale)) + (format #t "~T~Tleft-side-x-scale: ~f~%" (-> this left-side-x-scale)) + (format #t "~T~Tleft-side-y-scale: ~f~%" (-> this left-side-y-scale)) + (format #t "~T~Tright-side-x-scale: ~f~%" (-> this right-side-x-scale)) + (format #t "~T~Tright-side-y-scale: ~f~%" (-> this right-side-y-scale)) + (format #t "~T~Tsmall-orb-y-offset: ~D~%" (-> this small-orb-y-offset)) + (format #t "~T~Tbig-orb-y-offset: ~D~%" (-> this big-orb-y-offset)) + (format #t "~T~Ttransition-offset: ~D~%" (-> this transition-offset)) + (format #t "~T~Ttransition-offset-invert: ~D~%" (-> this transition-offset-invert)) + (format #t "~T~Ttransition-percentage: ~f~%" (-> this transition-percentage)) + (format #t "~T~Ttransition-percentage-invert: ~f~%" (-> this transition-percentage-invert)) + (format #t "~T~Ttransition-speed: ~f~%" (-> this transition-speed)) + (format #t "~T~Ttotal-nb-of-power-cells: ~D~%" (-> this total-nb-of-power-cells)) + (format #t "~T~Ttotal-nb-of-orbs: ~D~%" (-> this total-nb-of-orbs)) + (format #t "~T~Ttotal-nb-of-buzzers: ~D~%" (-> this total-nb-of-buzzers)) + (format #t "~T~Tcard-info: #~%" (-> this card-info)) + (format #t "~T~Tlast-option-index-change: ~D~%" (-> this last-option-index-change)) + (format #t "~T~Tvideo-mode-timeout: ~D~%" (-> this video-mode-timeout)) + (format #t "~T~Tdisplay-state-stack[5] @ #x~X~%" (-> this display-state-stack)) + (format #t "~T~Toption-index-stack[5] @ #x~X~%" (-> this option-index-stack)) + (format #t "~T~Tdisplay-state-pos: ~D~%" (-> this display-state-pos)) + (format #t "~T~Tnb-of-icons: ~D~%" (-> this nb-of-icons)) + (format #t "~T~Ticons[6] @ #x~X~%" (-> this icons)) + (format #t "~T~Tmax-nb-of-particles: ~D~%" (-> this max-nb-of-particles)) + (format #t "~T~Tnb-of-particles: ~D~%" (-> this nb-of-particles)) + (format #t "~T~Tparticles[40] @ #x~X~%" (-> this particles)) + (format #t "~T~Tparticle-state[40] @ #x~X~%" (-> this particle-state)) + this ) ;; definition for symbol *progress-process*, type (pointer progress) diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress-part_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress-part_REF.gc index 67f80d8c55..ef54323180 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress-part_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress-part_REF.gc @@ -958,358 +958,358 @@ ;; definition for method 34 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod initialize-particles progress ((obj progress)) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 90) obj)) - (set! (-> obj particles s5-0 init-pos x) 256.0) - (set! (-> obj particles s5-0 init-pos y) 224.0) - (set! (-> obj particles s5-0 init-pos z) 16.0) - (set! (-> obj particles s5-0 part matrix) -1) +(defmethod initialize-particles progress ((this progress)) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 90) this)) + (set! (-> this particles s5-0 init-pos x) 256.0) + (set! (-> this particles s5-0 init-pos y) 224.0) + (set! (-> this particles s5-0 init-pos z) 16.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 88) obj)) - (set! (-> obj particles s5-1 init-pos x) -42.0) - (set! (-> obj particles s5-1 init-pos y) 254.0) - (set! (-> obj particles s5-1 init-pos z) 5.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 88) this)) + (set! (-> this particles s5-1 init-pos x) -42.0) + (set! (-> this particles s5-1 init-pos y) 254.0) + (set! (-> this particles s5-1 init-pos z) 5.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 89) obj)) - (set! (-> obj particles s5-2 init-pos x) 610.0) - (set! (-> obj particles s5-2 init-pos y) 254.0) - (set! (-> obj particles s5-2 init-pos z) 5.0) - (set! (-> obj particles s5-2 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-2 (-> this nb-of-particles))) + (set! (-> this particles s5-2) (new 'static 'hud-particle)) + (set! (-> this particles s5-2 part) (create-launch-control (-> *part-group-id-table* 89) this)) + (set! (-> this particles s5-2 init-pos x) 610.0) + (set! (-> this particles s5-2 init-pos y) 254.0) + (set! (-> this particles s5-2 init-pos z) 5.0) + (set! (-> this particles s5-2 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-3 (-> obj nb-of-particles))) - (set! (-> obj particles s5-3) (new 'static 'hud-particle)) - (set! (-> obj particles s5-3 part) (create-launch-control (-> *part-group-id-table* 85) obj)) - (set! (-> obj particles s5-3 init-pos x) -320.0) - (set! (-> obj particles s5-3 init-pos y) 40.0) - (set! (-> obj particles s5-3 init-pos z) 14.0) - (set! (-> obj particles s5-3 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-3 (-> this nb-of-particles))) + (set! (-> this particles s5-3) (new 'static 'hud-particle)) + (set! (-> this particles s5-3 part) (create-launch-control (-> *part-group-id-table* 85) this)) + (set! (-> this particles s5-3 init-pos x) -320.0) + (set! (-> this particles s5-3 init-pos y) 40.0) + (set! (-> this particles s5-3 init-pos z) 14.0) + (set! (-> this particles s5-3 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-4 (-> obj nb-of-particles))) - (set! (-> obj particles s5-4) (new 'static 'hud-particle)) - (set! (-> obj particles s5-4 part) (create-launch-control (-> *part-group-id-table* 86) obj)) - (set! (-> obj particles s5-4 init-pos x) -320.0) - (set! (-> obj particles s5-4 init-pos y) 400.0) - (set! (-> obj particles s5-4 init-pos z) 14.0) - (set! (-> obj particles s5-4 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-4 (-> this nb-of-particles))) + (set! (-> this particles s5-4) (new 'static 'hud-particle)) + (set! (-> this particles s5-4 part) (create-launch-control (-> *part-group-id-table* 86) this)) + (set! (-> this particles s5-4 init-pos x) -320.0) + (set! (-> this particles s5-4 init-pos y) 400.0) + (set! (-> this particles s5-4 init-pos z) 14.0) + (set! (-> this particles s5-4 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-5 (-> obj nb-of-particles))) - (set! (-> obj particles s5-5) (new 'static 'hud-particle)) - (set! (-> obj particles s5-5 part) (create-launch-control (-> *part-group-id-table* 87) obj)) - (set! (-> obj particles s5-5 init-pos x) -320.0) - (set! (-> obj particles s5-5 init-pos y) 194.0) - (set! (-> obj particles s5-5 init-pos z) 15.0) - (set! (-> obj particles s5-5 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-5 (-> this nb-of-particles))) + (set! (-> this particles s5-5) (new 'static 'hud-particle)) + (set! (-> this particles s5-5 part) (create-launch-control (-> *part-group-id-table* 87) this)) + (set! (-> this particles s5-5 init-pos x) -320.0) + (set! (-> this particles s5-5 init-pos y) 194.0) + (set! (-> this particles s5-5 init-pos z) 15.0) + (set! (-> this particles s5-5 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-6 (-> obj nb-of-particles))) - (set! (-> obj particles s5-6) (new 'static 'hud-particle)) - (set! (-> obj particles s5-6 part) (create-launch-control (-> *part-group-id-table* 97) obj)) - (set! (-> obj particles s5-6 init-pos x) -320.0) - (set! (-> obj particles s5-6 init-pos y) 194.0) - (set! (-> obj particles s5-6 init-pos z) 14.0) - (set! (-> obj particles s5-6 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-6 (-> this nb-of-particles))) + (set! (-> this particles s5-6) (new 'static 'hud-particle)) + (set! (-> this particles s5-6 part) (create-launch-control (-> *part-group-id-table* 97) this)) + (set! (-> this particles s5-6 init-pos x) -320.0) + (set! (-> this particles s5-6 init-pos y) 194.0) + (set! (-> this particles s5-6 init-pos z) 14.0) + (set! (-> this particles s5-6 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-7 (-> obj nb-of-particles))) - (set! (-> obj particles s5-7) (new 'static 'hud-particle)) - (set! (-> obj particles s5-7 part) (create-launch-control (-> *part-group-id-table* 97) obj)) - (set! (-> obj particles s5-7 init-pos x) -320.0) - (set! (-> obj particles s5-7 init-pos y) 194.0) - (set! (-> obj particles s5-7 init-pos z) 14.0) - (set! (-> obj particles s5-7 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-7 (-> this nb-of-particles))) + (set! (-> this particles s5-7) (new 'static 'hud-particle)) + (set! (-> this particles s5-7 part) (create-launch-control (-> *part-group-id-table* 97) this)) + (set! (-> this particles s5-7 init-pos x) -320.0) + (set! (-> this particles s5-7 init-pos y) 194.0) + (set! (-> this particles s5-7 init-pos z) 14.0) + (set! (-> this particles s5-7 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-8 (-> obj nb-of-particles))) - (set! (-> obj particles s5-8) (new 'static 'hud-particle)) - (set! (-> obj particles s5-8 part) (create-launch-control (-> *part-group-id-table* 97) obj)) - (set! (-> obj particles s5-8 init-pos x) -320.0) - (set! (-> obj particles s5-8 init-pos y) 194.0) - (set! (-> obj particles s5-8 init-pos z) 14.0) - (set! (-> obj particles s5-8 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-8 (-> this nb-of-particles))) + (set! (-> this particles s5-8) (new 'static 'hud-particle)) + (set! (-> this particles s5-8 part) (create-launch-control (-> *part-group-id-table* 97) this)) + (set! (-> this particles s5-8 init-pos x) -320.0) + (set! (-> this particles s5-8 init-pos y) 194.0) + (set! (-> this particles s5-8 init-pos z) 14.0) + (set! (-> this particles s5-8 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-9 (-> obj nb-of-particles))) - (set! (-> obj particles s5-9) (new 'static 'hud-particle)) - (set! (-> obj particles s5-9 part) (create-launch-control (-> *part-group-id-table* 97) obj)) - (set! (-> obj particles s5-9 init-pos x) -320.0) - (set! (-> obj particles s5-9 init-pos y) 194.0) - (set! (-> obj particles s5-9 init-pos z) 14.0) - (set! (-> obj particles s5-9 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-9 (-> this nb-of-particles))) + (set! (-> this particles s5-9) (new 'static 'hud-particle)) + (set! (-> this particles s5-9 part) (create-launch-control (-> *part-group-id-table* 97) this)) + (set! (-> this particles s5-9 init-pos x) -320.0) + (set! (-> this particles s5-9 init-pos y) 194.0) + (set! (-> this particles s5-9 init-pos z) 14.0) + (set! (-> this particles s5-9 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-10 (-> obj nb-of-particles))) - (set! (-> obj particles s5-10) (new 'static 'hud-particle)) - (set! (-> obj particles s5-10 part) (create-launch-control (-> *part-group-id-table* 97) obj)) - (set! (-> obj particles s5-10 init-pos x) -320.0) - (set! (-> obj particles s5-10 init-pos y) 194.0) - (set! (-> obj particles s5-10 init-pos z) 14.0) - (set! (-> obj particles s5-10 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-10 (-> this nb-of-particles))) + (set! (-> this particles s5-10) (new 'static 'hud-particle)) + (set! (-> this particles s5-10 part) (create-launch-control (-> *part-group-id-table* 97) this)) + (set! (-> this particles s5-10 init-pos x) -320.0) + (set! (-> this particles s5-10 init-pos y) 194.0) + (set! (-> this particles s5-10 init-pos z) 14.0) + (set! (-> this particles s5-10 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-11 (-> obj nb-of-particles))) - (set! (-> obj particles s5-11) (new 'static 'hud-particle)) - (set! (-> obj particles s5-11 part) (create-launch-control (-> *part-group-id-table* 97) obj)) - (set! (-> obj particles s5-11 init-pos x) -320.0) - (set! (-> obj particles s5-11 init-pos y) 194.0) - (set! (-> obj particles s5-11 init-pos z) 14.0) - (set! (-> obj particles s5-11 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-11 (-> this nb-of-particles))) + (set! (-> this particles s5-11) (new 'static 'hud-particle)) + (set! (-> this particles s5-11 part) (create-launch-control (-> *part-group-id-table* 97) this)) + (set! (-> this particles s5-11 init-pos x) -320.0) + (set! (-> this particles s5-11 init-pos y) 194.0) + (set! (-> this particles s5-11 init-pos z) 14.0) + (set! (-> this particles s5-11 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-12 (-> obj nb-of-particles))) - (set! (-> obj particles s5-12) (new 'static 'hud-particle)) - (set! (-> obj particles s5-12 part) (create-launch-control (-> *part-group-id-table* 97) obj)) - (set! (-> obj particles s5-12 init-pos x) -320.0) - (set! (-> obj particles s5-12 init-pos y) 194.0) - (set! (-> obj particles s5-12 init-pos z) 14.0) - (set! (-> obj particles s5-12 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-12 (-> this nb-of-particles))) + (set! (-> this particles s5-12) (new 'static 'hud-particle)) + (set! (-> this particles s5-12 part) (create-launch-control (-> *part-group-id-table* 97) this)) + (set! (-> this particles s5-12 init-pos x) -320.0) + (set! (-> this particles s5-12 init-pos y) 194.0) + (set! (-> this particles s5-12 init-pos z) 14.0) + (set! (-> this particles s5-12 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-13 (-> obj nb-of-particles))) - (set! (-> obj particles s5-13) (new 'static 'hud-particle)) - (set! (-> obj particles s5-13 part) (create-launch-control (-> *part-group-id-table* 97) obj)) - (set! (-> obj particles s5-13 init-pos x) -320.0) - (set! (-> obj particles s5-13 init-pos y) 194.0) - (set! (-> obj particles s5-13 init-pos z) 14.0) - (set! (-> obj particles s5-13 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-13 (-> this nb-of-particles))) + (set! (-> this particles s5-13) (new 'static 'hud-particle)) + (set! (-> this particles s5-13 part) (create-launch-control (-> *part-group-id-table* 97) this)) + (set! (-> this particles s5-13 init-pos x) -320.0) + (set! (-> this particles s5-13 init-pos y) 194.0) + (set! (-> this particles s5-13 init-pos z) 14.0) + (set! (-> this particles s5-13 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-14 (-> obj nb-of-particles))) - (set! (-> obj particles s5-14) (new 'static 'hud-particle)) - (set! (-> obj particles s5-14 part) (create-launch-control (-> *part-group-id-table* 98) obj)) - (set! (-> obj particles s5-14 init-pos x) -320.0) - (set! (-> obj particles s5-14 init-pos y) 224.0) - (set! (-> obj particles s5-14 init-pos z) 14.0) - (set! (-> obj particles s5-14 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-14 (-> this nb-of-particles))) + (set! (-> this particles s5-14) (new 'static 'hud-particle)) + (set! (-> this particles s5-14 part) (create-launch-control (-> *part-group-id-table* 98) this)) + (set! (-> this particles s5-14 init-pos x) -320.0) + (set! (-> this particles s5-14 init-pos y) 224.0) + (set! (-> this particles s5-14 init-pos z) 14.0) + (set! (-> this particles s5-14 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-15 (-> obj nb-of-particles))) - (set! (-> obj particles s5-15) (new 'static 'hud-particle)) - (set! (-> obj particles s5-15 part) (create-launch-control (-> *part-group-id-table* 99) obj)) - (set! (-> obj particles s5-15 init-pos x) -320.0) - (set! (-> obj particles s5-15 init-pos y) 224.0) - (set! (-> obj particles s5-15 init-pos z) 14.0) - (set! (-> obj particles s5-15 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-15 (-> this nb-of-particles))) + (set! (-> this particles s5-15) (new 'static 'hud-particle)) + (set! (-> this particles s5-15 part) (create-launch-control (-> *part-group-id-table* 99) this)) + (set! (-> this particles s5-15 init-pos x) -320.0) + (set! (-> this particles s5-15 init-pos y) 224.0) + (set! (-> this particles s5-15 init-pos z) 14.0) + (set! (-> this particles s5-15 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-16 (-> obj nb-of-particles))) - (set! (-> obj particles s5-16) (new 'static 'hud-particle)) - (set! (-> obj particles s5-16 part) (create-launch-control (-> *part-group-id-table* 97) obj)) - (set! (-> obj particles s5-16 init-pos x) -320.0) - (set! (-> obj particles s5-16 init-pos y) 112.0) - (set! (-> obj particles s5-16 init-pos z) 4.0) - (set! (-> obj particles s5-16 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-16 (-> this nb-of-particles))) + (set! (-> this particles s5-16) (new 'static 'hud-particle)) + (set! (-> this particles s5-16 part) (create-launch-control (-> *part-group-id-table* 97) this)) + (set! (-> this particles s5-16 init-pos x) -320.0) + (set! (-> this particles s5-16 init-pos y) 112.0) + (set! (-> this particles s5-16 init-pos z) 4.0) + (set! (-> this particles s5-16 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-17 (-> obj nb-of-particles))) - (set! (-> obj particles s5-17) (new 'static 'hud-particle)) - (set! (-> obj particles s5-17 part) (create-launch-control (-> *part-group-id-table* 100) obj)) - (set! (-> obj particles s5-17 init-pos x) -320.0) - (set! (-> obj particles s5-17 init-pos y) 193.0) - (set! (-> obj particles s5-17 init-pos z) 4.0) - (set! (-> obj particles s5-17 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-17 (-> this nb-of-particles))) + (set! (-> this particles s5-17) (new 'static 'hud-particle)) + (set! (-> this particles s5-17 part) (create-launch-control (-> *part-group-id-table* 100) this)) + (set! (-> this particles s5-17 init-pos x) -320.0) + (set! (-> this particles s5-17 init-pos y) 193.0) + (set! (-> this particles s5-17 init-pos z) 4.0) + (set! (-> this particles s5-17 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-18 (-> obj nb-of-particles))) - (set! (-> obj particles s5-18) (new 'static 'hud-particle)) - (set! (-> obj particles s5-18 part) (create-launch-control (-> *part-group-id-table* 101) obj)) - (set! (-> obj particles s5-18 init-pos x) -320.0) - (set! (-> obj particles s5-18 init-pos y) 40.0) - (set! (-> obj particles s5-18 init-pos z) 4.0) - (set! (-> obj particles s5-18 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-18 (-> this nb-of-particles))) + (set! (-> this particles s5-18) (new 'static 'hud-particle)) + (set! (-> this particles s5-18 part) (create-launch-control (-> *part-group-id-table* 101) this)) + (set! (-> this particles s5-18 init-pos x) -320.0) + (set! (-> this particles s5-18 init-pos y) 40.0) + (set! (-> this particles s5-18 init-pos z) 4.0) + (set! (-> this particles s5-18 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-19 (-> obj nb-of-particles))) - (set! (-> obj particles s5-19) (new 'static 'hud-particle)) - (set! (-> obj particles s5-19 part) (create-launch-control (-> *part-group-id-table* 92) obj)) - (set! (-> obj particles s5-19 init-pos x) -320.0) - (set! (-> obj particles s5-19 init-pos y) 90.0) - (set! (-> obj particles s5-19 init-pos z) 16.0) - (set! (-> obj particles s5-19 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-19 (-> this nb-of-particles))) + (set! (-> this particles s5-19) (new 'static 'hud-particle)) + (set! (-> this particles s5-19 part) (create-launch-control (-> *part-group-id-table* 92) this)) + (set! (-> this particles s5-19 init-pos x) -320.0) + (set! (-> this particles s5-19 init-pos y) 90.0) + (set! (-> this particles s5-19 init-pos z) 16.0) + (set! (-> this particles s5-19 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-20 (-> obj nb-of-particles))) - (set! (-> obj particles s5-20) (new 'static 'hud-particle)) - (set! (-> obj particles s5-20 part) (create-launch-control (-> *part-group-id-table* 93) obj)) - (set! (-> obj particles s5-20 init-pos x) -320.0) - (set! (-> obj particles s5-20 init-pos y) 172.0) - (set! (-> obj particles s5-20 init-pos z) 16.0) - (set! (-> obj particles s5-20 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-20 (-> this nb-of-particles))) + (set! (-> this particles s5-20) (new 'static 'hud-particle)) + (set! (-> this particles s5-20 part) (create-launch-control (-> *part-group-id-table* 93) this)) + (set! (-> this particles s5-20 init-pos x) -320.0) + (set! (-> this particles s5-20 init-pos y) 172.0) + (set! (-> this particles s5-20 init-pos z) 16.0) + (set! (-> this particles s5-20 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-21 (-> obj nb-of-particles))) - (set! (-> obj particles s5-21) (new 'static 'hud-particle)) - (set! (-> obj particles s5-21 part) (create-launch-control (-> *part-group-id-table* 94) obj)) - (set! (-> obj particles s5-21 init-pos x) -320.0) - (set! (-> obj particles s5-21 init-pos y) 254.0) - (set! (-> obj particles s5-21 init-pos z) 16.0) - (set! (-> obj particles s5-21 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-21 (-> this nb-of-particles))) + (set! (-> this particles s5-21) (new 'static 'hud-particle)) + (set! (-> this particles s5-21 part) (create-launch-control (-> *part-group-id-table* 94) this)) + (set! (-> this particles s5-21 init-pos x) -320.0) + (set! (-> this particles s5-21 init-pos y) 254.0) + (set! (-> this particles s5-21 init-pos z) 16.0) + (set! (-> this particles s5-21 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-22 (-> obj nb-of-particles))) - (set! (-> obj particles s5-22) (new 'static 'hud-particle)) - (set! (-> obj particles s5-22 part) (create-launch-control (-> *part-group-id-table* 95) obj)) - (set! (-> obj particles s5-22 init-pos x) -320.0) - (set! (-> obj particles s5-22 init-pos y) 336.0) - (set! (-> obj particles s5-22 init-pos z) 16.0) - (set! (-> obj particles s5-22 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-22 (-> this nb-of-particles))) + (set! (-> this particles s5-22) (new 'static 'hud-particle)) + (set! (-> this particles s5-22 part) (create-launch-control (-> *part-group-id-table* 95) this)) + (set! (-> this particles s5-22 init-pos x) -320.0) + (set! (-> this particles s5-22 init-pos y) 336.0) + (set! (-> this particles s5-22 init-pos z) 16.0) + (set! (-> this particles s5-22 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-23 (-> obj nb-of-particles))) - (set! (-> obj particles s5-23) (new 'static 'hud-particle)) - (set! (-> obj particles s5-23 part) (create-launch-control (-> *part-group-id-table* 91) obj)) - (set! (-> obj particles s5-23 init-pos x) -320.0) - (set! (-> obj particles s5-23 init-pos y) 102.0) - (set! (-> obj particles s5-23 init-pos z) 13.0) - (set! (-> obj particles s5-23 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-23 (-> this nb-of-particles))) + (set! (-> this particles s5-23) (new 'static 'hud-particle)) + (set! (-> this particles s5-23 part) (create-launch-control (-> *part-group-id-table* 91) this)) + (set! (-> this particles s5-23 init-pos x) -320.0) + (set! (-> this particles s5-23 init-pos y) 102.0) + (set! (-> this particles s5-23 init-pos z) 13.0) + (set! (-> this particles s5-23 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-24 (-> obj nb-of-particles))) - (set! (-> obj particles s5-24) (new 'static 'hud-particle)) - (set! (-> obj particles s5-24 part) (create-launch-control (-> *part-group-id-table* 91) obj)) - (set! (-> obj particles s5-24 init-pos x) -320.0) - (set! (-> obj particles s5-24 init-pos y) 184.0) - (set! (-> obj particles s5-24 init-pos z) 13.0) - (set! (-> obj particles s5-24 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-24 (-> this nb-of-particles))) + (set! (-> this particles s5-24) (new 'static 'hud-particle)) + (set! (-> this particles s5-24 part) (create-launch-control (-> *part-group-id-table* 91) this)) + (set! (-> this particles s5-24 init-pos x) -320.0) + (set! (-> this particles s5-24 init-pos y) 184.0) + (set! (-> this particles s5-24 init-pos z) 13.0) + (set! (-> this particles s5-24 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-25 (-> obj nb-of-particles))) - (set! (-> obj particles s5-25) (new 'static 'hud-particle)) - (set! (-> obj particles s5-25 part) (create-launch-control (-> *part-group-id-table* 91) obj)) - (set! (-> obj particles s5-25 init-pos x) -320.0) - (set! (-> obj particles s5-25 init-pos y) 266.0) - (set! (-> obj particles s5-25 init-pos z) 13.0) - (set! (-> obj particles s5-25 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-25 (-> this nb-of-particles))) + (set! (-> this particles s5-25) (new 'static 'hud-particle)) + (set! (-> this particles s5-25 part) (create-launch-control (-> *part-group-id-table* 91) this)) + (set! (-> this particles s5-25 init-pos x) -320.0) + (set! (-> this particles s5-25 init-pos y) 266.0) + (set! (-> this particles s5-25 init-pos z) 13.0) + (set! (-> this particles s5-25 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-26 (-> obj nb-of-particles))) - (set! (-> obj particles s5-26) (new 'static 'hud-particle)) - (set! (-> obj particles s5-26 part) (create-launch-control (-> *part-group-id-table* 91) obj)) - (set! (-> obj particles s5-26 init-pos x) -320.0) - (set! (-> obj particles s5-26 init-pos y) 348.0) - (set! (-> obj particles s5-26 init-pos z) 13.0) - (set! (-> obj particles s5-26 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-26 (-> this nb-of-particles))) + (set! (-> this particles s5-26) (new 'static 'hud-particle)) + (set! (-> this particles s5-26 part) (create-launch-control (-> *part-group-id-table* 91) this)) + (set! (-> this particles s5-26 init-pos x) -320.0) + (set! (-> this particles s5-26 init-pos y) 348.0) + (set! (-> this particles s5-26 init-pos z) 13.0) + (set! (-> this particles s5-26 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-27 (-> obj nb-of-particles))) - (set! (-> obj particles s5-27) (new 'static 'hud-particle)) - (set! (-> obj particles s5-27 part) (create-launch-control (-> *part-group-id-table* 570) obj)) - (set! (-> obj particles s5-27 init-pos x) -320.0) - (set! (-> obj particles s5-27 init-pos y) 338.0) - (set! (-> obj particles s5-27 init-pos z) 4.0) - (set! (-> obj particles s5-27 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-27 (-> this nb-of-particles))) + (set! (-> this particles s5-27) (new 'static 'hud-particle)) + (set! (-> this particles s5-27 part) (create-launch-control (-> *part-group-id-table* 570) this)) + (set! (-> this particles s5-27 init-pos x) -320.0) + (set! (-> this particles s5-27 init-pos y) 338.0) + (set! (-> this particles s5-27 init-pos z) 4.0) + (set! (-> this particles s5-27 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-28 (-> obj nb-of-particles))) - (set! (-> obj particles s5-28) (new 'static 'hud-particle)) - (set! (-> obj particles s5-28 part) (create-launch-control (-> *part-group-id-table* 571) obj)) - (set! (-> obj particles s5-28 init-pos x) -320.0) - (set! (-> obj particles s5-28 init-pos y) 338.0) - (set! (-> obj particles s5-28 init-pos z) 4.0) - (set! (-> obj particles s5-28 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-28 (-> this nb-of-particles))) + (set! (-> this particles s5-28) (new 'static 'hud-particle)) + (set! (-> this particles s5-28 part) (create-launch-control (-> *part-group-id-table* 571) this)) + (set! (-> this particles s5-28 init-pos x) -320.0) + (set! (-> this particles s5-28 init-pos y) 338.0) + (set! (-> this particles s5-28 init-pos z) 4.0) + (set! (-> this particles s5-28 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-29 (-> obj nb-of-particles))) - (set! (-> obj particles s5-29) (new 'static 'hud-particle)) - (set! (-> obj particles s5-29 part) (create-launch-control (-> *part-group-id-table* 572) obj)) - (set! (-> obj particles s5-29 init-pos x) -320.0) - (set! (-> obj particles s5-29 init-pos y) 338.0) - (set! (-> obj particles s5-29 init-pos z) 4.0) - (set! (-> obj particles s5-29 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-29 (-> this nb-of-particles))) + (set! (-> this particles s5-29) (new 'static 'hud-particle)) + (set! (-> this particles s5-29 part) (create-launch-control (-> *part-group-id-table* 572) this)) + (set! (-> this particles s5-29 init-pos x) -320.0) + (set! (-> this particles s5-29 init-pos y) 338.0) + (set! (-> this particles s5-29 init-pos z) 4.0) + (set! (-> this particles s5-29 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-30 (-> obj nb-of-particles))) - (set! (-> obj particles s5-30) (new 'static 'hud-particle)) - (set! (-> obj particles s5-30 part) (create-launch-control (-> *part-group-id-table* 573) obj)) - (set! (-> obj particles s5-30 init-pos x) -320.0) - (set! (-> obj particles s5-30 init-pos y) 338.0) - (set! (-> obj particles s5-30 init-pos z) 4.0) - (set! (-> obj particles s5-30 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-30 (-> this nb-of-particles))) + (set! (-> this particles s5-30) (new 'static 'hud-particle)) + (set! (-> this particles s5-30 part) (create-launch-control (-> *part-group-id-table* 573) this)) + (set! (-> this particles s5-30 init-pos x) -320.0) + (set! (-> this particles s5-30 init-pos y) 338.0) + (set! (-> this particles s5-30 init-pos z) 4.0) + (set! (-> this particles s5-30 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-31 (-> obj nb-of-particles))) - (set! (-> obj particles s5-31) (new 'static 'hud-particle)) - (set! (-> obj particles s5-31 part) (create-launch-control (-> *part-group-id-table* 615) obj)) - (set! (-> obj particles s5-31 init-pos x) -320.0) - (set! (-> obj particles s5-31 init-pos y) 180.0) - (set! (-> obj particles s5-31 init-pos z) 4.0) - (set! (-> obj particles s5-31 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-31 (-> this nb-of-particles))) + (set! (-> this particles s5-31) (new 'static 'hud-particle)) + (set! (-> this particles s5-31 part) (create-launch-control (-> *part-group-id-table* 615) this)) + (set! (-> this particles s5-31 init-pos x) -320.0) + (set! (-> this particles s5-31 init-pos y) 180.0) + (set! (-> this particles s5-31 init-pos z) 4.0) + (set! (-> this particles s5-31 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) 0 (none) diff --git a/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc index 84687bb4c6..87a045eabf 100644 --- a/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/progress/progress_REF.gc @@ -23,22 +23,22 @@ ) ;; definition for method 3 of type progress-global-state -(defmethod inspect progress-global-state ((obj progress-global-state)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Taspect-ratio-choice: ~A~%" (-> obj aspect-ratio-choice)) - (format #t "~Tvideo-mode-choice: ~A~%" (-> obj video-mode-choice)) - (format #t "~Tyes-no-choice: ~A~%" (-> obj yes-no-choice)) - (format #t "~Twhich: ~D~%" (-> obj which)) - (format #t "~Tstarting-state: ~D~%" (-> obj starting-state)) - (format #t "~Tlast-slot-saved: ~D~%" (-> obj last-slot-saved)) - (format #t "~Tslider-backup: ~f~%" (-> obj slider-backup)) - (format #t "~Tlanguage-backup: ~D~%" (-> obj language-backup)) - (format #t "~Ton-off-backup: ~A~%" (-> obj on-off-backup)) - (format #t "~Tcenter-x-backup: ~D~%" (-> obj center-x-backup)) - (format #t "~Tcenter-y-backup: ~D~%" (-> obj center-y-backup)) - (format #t "~Taspect-ratio-backup: ~A~%" (-> obj aspect-ratio-backup)) - (format #t "~Tlast-slider-sound: ~D~%" (-> obj last-slider-sound)) - obj +(defmethod inspect progress-global-state ((this progress-global-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Taspect-ratio-choice: ~A~%" (-> this aspect-ratio-choice)) + (format #t "~Tvideo-mode-choice: ~A~%" (-> this video-mode-choice)) + (format #t "~Tyes-no-choice: ~A~%" (-> this yes-no-choice)) + (format #t "~Twhich: ~D~%" (-> this which)) + (format #t "~Tstarting-state: ~D~%" (-> this starting-state)) + (format #t "~Tlast-slot-saved: ~D~%" (-> this last-slot-saved)) + (format #t "~Tslider-backup: ~f~%" (-> this slider-backup)) + (format #t "~Tlanguage-backup: ~D~%" (-> this language-backup)) + (format #t "~Ton-off-backup: ~A~%" (-> this on-off-backup)) + (format #t "~Tcenter-x-backup: ~D~%" (-> this center-x-backup)) + (format #t "~Tcenter-y-backup: ~D~%" (-> this center-y-backup)) + (format #t "~Taspect-ratio-backup: ~A~%" (-> this aspect-ratio-backup)) + (format #t "~Tlast-slider-sound: ~D~%" (-> this last-slider-sound)) + this ) ;; definition for symbol *progress-state*, type progress-global-state @@ -56,8 +56,8 @@ (movie?) (handle->process (-> *game-info* pov-camera-handle)) (handle->process (-> *game-info* other-camera-handle)) - (< (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) - (< (-> *display* base-frame-counter) (-> *game-info* blackout-time)) + (< (current-time) (-> *game-info* letterbox-time)) + (< (current-time) (-> *game-info* blackout-time)) (!= (-> *setting-control* current bg-a) 0.0) (!= (-> *setting-control* current bg-a-force) 0.0) (not (-> *setting-control* current allow-progress)) @@ -72,7 +72,7 @@ ;; definition for function pause-allowed? (defun pause-allowed? () - (not (or (< (-> *display* base-frame-counter) (-> *game-info* blackout-time)) + (not (or (< (current-time) (-> *game-info* blackout-time)) (!= (-> *setting-control* current bg-a) 0.0) (!= (-> *setting-control* current bg-a-force) 0.0) (not (-> *setting-control* current allow-pause)) @@ -342,14 +342,14 @@ ;; definition for method 33 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod initialize-icons progress ((obj progress)) - (when (< (-> obj nb-of-icons) 6) - (let ((s5-0 (-> obj nb-of-icons))) - (set! (-> obj icons s5-0) (new 'static 'hud-icon)) +(defmethod initialize-icons progress ((this progress)) + (when (< (-> this nb-of-icons) 6) + (let ((s5-0 (-> this nb-of-icons))) + (set! (-> this icons s5-0) (new 'static 'hud-icon)) (let* ((s3-0 (get-process *default-dead-pool* manipy #x4000)) (s4-0 (when s3-0 (let ((t9-1 (method-of-type manipy activate))) - (t9-1 (the-as manipy s3-0) obj 'manipy (the-as pointer #x70004000)) + (t9-1 (the-as manipy s3-0) this 'manipy (the-as pointer #x70004000)) ) ((the-as (function process function object object object object object) run-function-in-process) s3-0 @@ -371,28 +371,28 @@ (send-event (ppointer->process s4-0) 'trans-hook #f) ) ) - (set! (-> obj icons s5-0 icon) (the-as (pointer manipy) s4-0)) + (set! (-> this icons s5-0 icon) (the-as (pointer manipy) s4-0)) (when s4-0 (logior! (-> s4-0 0 mask) (process-mask pause)) (logclear! (-> s4-0 0 mask) (process-mask menu progress)) (set! (-> (the-as manipy (-> s4-0 0)) root trans z) 2048.0) - (set! (-> obj icons s5-0 icon-x) 256) - (set! (-> obj icons s5-0 icon-y) 77) - (set! (-> obj icons s5-0 icon-z) 0) - (set! (-> obj icons s5-0 scale-x) 0.006) - (set! (-> obj icons s5-0 scale-y) 0.006) + (set! (-> this icons s5-0 icon-x) 256) + (set! (-> this icons s5-0 icon-y) 77) + (set! (-> this icons s5-0 icon-z) 0) + (set! (-> this icons s5-0 scale-x) 0.006) + (set! (-> this icons s5-0 scale-y) 0.006) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (when (< (-> obj nb-of-icons) 6) - (let ((s5-1 (-> obj nb-of-icons))) - (set! (-> obj icons s5-1) (new 'static 'hud-icon)) + (when (< (-> this nb-of-icons) 6) + (let ((s5-1 (-> this nb-of-icons))) + (set! (-> this icons s5-1) (new 'static 'hud-icon)) (let* ((s3-1 (get-process *default-dead-pool* manipy #x4000)) (s4-1 (when s3-1 (let ((t9-5 (method-of-type manipy activate))) - (t9-5 (the-as manipy s3-1) obj 'manipy (the-as pointer #x70004000)) + (t9-5 (the-as manipy s3-1) this 'manipy (the-as pointer #x70004000)) ) ((the-as (function process function object object object object object) run-function-in-process) s3-1 @@ -414,28 +414,28 @@ (send-event (ppointer->process s4-1) 'trans-hook #f) ) ) - (set! (-> obj icons s5-1 icon) (the-as (pointer manipy) s4-1)) + (set! (-> this icons s5-1 icon) (the-as (pointer manipy) s4-1)) (when s4-1 (logior! (-> s4-1 0 mask) (process-mask pause)) (logclear! (-> s4-1 0 mask) (process-mask menu progress)) (set! (-> (the-as manipy (-> s4-1 0)) root trans z) 2048.0) - (set! (-> obj icons s5-1 icon-x) 256) - (set! (-> obj icons s5-1 icon-y) 77) - (set! (-> obj icons s5-1 icon-z) 0) - (set! (-> obj icons s5-1 scale-x) 0.006) - (set! (-> obj icons s5-1 scale-y) 0.006) + (set! (-> this icons s5-1 icon-x) 256) + (set! (-> this icons s5-1 icon-y) 77) + (set! (-> this icons s5-1 icon-z) 0) + (set! (-> this icons s5-1 scale-x) 0.006) + (set! (-> this icons s5-1 scale-y) 0.006) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (when (< (-> obj nb-of-icons) 6) - (let ((s5-2 (-> obj nb-of-icons))) - (set! (-> obj icons s5-2) (new 'static 'hud-icon)) + (when (< (-> this nb-of-icons) 6) + (let ((s5-2 (-> this nb-of-icons))) + (set! (-> this icons s5-2) (new 'static 'hud-icon)) (let* ((s3-2 (get-process *default-dead-pool* manipy #x4000)) (s4-2 (when s3-2 (let ((t9-9 (method-of-type manipy activate))) - (t9-9 (the-as manipy s3-2) obj 'manipy (the-as pointer #x70004000)) + (t9-9 (the-as manipy s3-2) this 'manipy (the-as pointer #x70004000)) ) ((the-as (function process function object object object object object) run-function-in-process) s3-2 @@ -457,28 +457,28 @@ (send-event (ppointer->process s4-2) 'trans-hook #f) ) ) - (set! (-> obj icons s5-2 icon) (the-as (pointer manipy) s4-2)) + (set! (-> this icons s5-2 icon) (the-as (pointer manipy) s4-2)) (when s4-2 (logior! (-> s4-2 0 mask) (process-mask pause)) (logclear! (-> s4-2 0 mask) (process-mask menu progress)) (set! (-> (the-as manipy (-> s4-2 0)) root trans z) 2048.0) - (set! (-> obj icons s5-2 icon-x) 256) - (set! (-> obj icons s5-2 icon-y) 77) - (set! (-> obj icons s5-2 icon-z) 0) - (set! (-> obj icons s5-2 scale-x) 0.006) - (set! (-> obj icons s5-2 scale-y) 0.006) + (set! (-> this icons s5-2 icon-x) 256) + (set! (-> this icons s5-2 icon-y) 77) + (set! (-> this icons s5-2 icon-z) 0) + (set! (-> this icons s5-2 scale-x) 0.006) + (set! (-> this icons s5-2 scale-y) 0.006) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (when (< (-> obj nb-of-icons) 6) - (let ((s5-3 (-> obj nb-of-icons))) - (set! (-> obj icons s5-3) (new 'static 'hud-icon)) + (when (< (-> this nb-of-icons) 6) + (let ((s5-3 (-> this nb-of-icons))) + (set! (-> this icons s5-3) (new 'static 'hud-icon)) (let* ((s3-3 (get-process *default-dead-pool* manipy #x4000)) (s4-3 (when s3-3 (let ((t9-13 (method-of-type manipy activate))) - (t9-13 (the-as manipy s3-3) obj 'manipy (the-as pointer #x70004000)) + (t9-13 (the-as manipy s3-3) this 'manipy (the-as pointer #x70004000)) ) ((the-as (function process function object object object object object) run-function-in-process) s3-3 @@ -500,28 +500,28 @@ (send-event (ppointer->process s4-3) 'trans-hook #f) ) ) - (set! (-> obj icons s5-3 icon) (the-as (pointer manipy) s4-3)) + (set! (-> this icons s5-3 icon) (the-as (pointer manipy) s4-3)) (when s4-3 (logior! (-> s4-3 0 mask) (process-mask pause)) (logclear! (-> s4-3 0 mask) (process-mask menu progress)) (set! (-> (the-as manipy (-> s4-3 0)) root trans z) 2048.0) - (set! (-> obj icons s5-3 icon-x) 256) - (set! (-> obj icons s5-3 icon-y) 77) - (set! (-> obj icons s5-3 icon-z) 0) - (set! (-> obj icons s5-3 scale-x) 0.006) - (set! (-> obj icons s5-3 scale-y) 0.006) + (set! (-> this icons s5-3 icon-x) 256) + (set! (-> this icons s5-3 icon-y) 77) + (set! (-> this icons s5-3 icon-z) 0) + (set! (-> this icons s5-3 scale-x) 0.006) + (set! (-> this icons s5-3 scale-y) 0.006) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (when (< (-> obj nb-of-icons) 6) - (let ((s5-4 (-> obj nb-of-icons))) - (set! (-> obj icons s5-4) (new 'static 'hud-icon)) + (when (< (-> this nb-of-icons) 6) + (let ((s5-4 (-> this nb-of-icons))) + (set! (-> this icons s5-4) (new 'static 'hud-icon)) (let* ((s3-4 (get-process *default-dead-pool* manipy #x4000)) (s4-4 (when s3-4 (let ((t9-17 (method-of-type manipy activate))) - (t9-17 (the-as manipy s3-4) obj 'manipy (the-as pointer #x70004000)) + (t9-17 (the-as manipy s3-4) this 'manipy (the-as pointer #x70004000)) ) ((the-as (function process function object object object object object) run-function-in-process) s3-4 @@ -543,28 +543,28 @@ (send-event (ppointer->process s4-4) 'trans-hook #f) ) ) - (set! (-> obj icons s5-4 icon) (the-as (pointer manipy) s4-4)) + (set! (-> this icons s5-4 icon) (the-as (pointer manipy) s4-4)) (when s4-4 (logior! (-> s4-4 0 mask) (process-mask pause)) (logclear! (-> s4-4 0 mask) (process-mask menu progress)) (set! (-> (the-as manipy (-> s4-4 0)) root trans z) 69632.0) - (set! (-> obj icons s5-4 icon-x) -320) - (set! (-> obj icons s5-4 icon-y) 253) - (set! (-> obj icons s5-4 icon-z) 0) - (set! (-> obj icons s5-4 scale-x) 0.013) - (set! (-> obj icons s5-4 scale-y) -0.015) + (set! (-> this icons s5-4 icon-x) -320) + (set! (-> this icons s5-4 icon-y) 253) + (set! (-> this icons s5-4 icon-z) 0) + (set! (-> this icons s5-4 scale-x) 0.013) + (set! (-> this icons s5-4 scale-y) -0.015) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (when (< (-> obj nb-of-icons) 6) - (let ((s5-5 (-> obj nb-of-icons))) - (set! (-> obj icons s5-5) (new 'static 'hud-icon)) + (when (< (-> this nb-of-icons) 6) + (let ((s5-5 (-> this nb-of-icons))) + (set! (-> this icons s5-5) (new 'static 'hud-icon)) (let* ((s3-5 (get-process *default-dead-pool* manipy #x4000)) (s4-5 (when s3-5 (let ((t9-21 (method-of-type manipy activate))) - (t9-21 (the-as manipy s3-5) obj 'manipy (the-as pointer #x70004000)) + (t9-21 (the-as manipy s3-5) this 'manipy (the-as pointer #x70004000)) ) ((the-as (function process function object object object object object) run-function-in-process) s3-5 @@ -586,57 +586,57 @@ (send-event (ppointer->process s4-5) 'trans-hook #f) ) ) - (set! (-> obj icons s5-5 icon) (the-as (pointer manipy) s4-5)) + (set! (-> this icons s5-5 icon) (the-as (pointer manipy) s4-5)) (when s4-5 (logior! (-> s4-5 0 mask) (process-mask pause)) (logclear! (-> s4-5 0 mask) (process-mask menu progress)) (set! (-> (the-as manipy (-> s4-5 0)) root trans z) 1024.0) - (set! (-> obj icons s5-5 icon-x) -320) - (set! (-> obj icons s5-5 icon-y) 253) - (set! (-> obj icons s5-5 icon-z) 0) - (set! (-> obj icons s5-5 scale-x) 0.008) - (set! (-> obj icons s5-5 scale-y) -0.009) + (set! (-> this icons s5-5 icon-x) -320) + (set! (-> this icons s5-5 icon-y) 253) + (set! (-> this icons s5-5 icon-z) 0) + (set! (-> this icons s5-5 scale-x) 0.008) + (set! (-> this icons s5-5 scale-y) -0.009) ) ) ) - (+! (-> obj nb-of-icons) 1) + (+! (-> this nb-of-icons) 1) ) - (send-event (ppointer->process (-> obj icons 1 icon)) 'set-frame-num 2.5) - (send-event (ppointer->process (-> obj icons 2 icon)) 'set-frame-num 10.0) - (send-event (ppointer->process (-> obj icons 3 icon)) 'set-frame-num 15.5) + (send-event (ppointer->process (-> this icons 1 icon)) 'set-frame-num 2.5) + (send-event (ppointer->process (-> this icons 2 icon)) 'set-frame-num 10.0) + (send-event (ppointer->process (-> this icons 3 icon)) 'set-frame-num 15.5) 0 (none) ) ;; definition for method 48 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod enter! progress ((obj progress) (screen progress-screen) (option int)) - (when (!= (-> obj display-state) screen) +(defmethod enter! progress ((this progress) (screen progress-screen) (option int)) + (when (!= (-> this display-state) screen) (set! (-> *progress-state* yes-no-choice) #f) - (set! (-> obj selected-option) #f) - (set! (-> obj option-index) option) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) - (set! (-> obj display-state) screen) - (set! (-> obj next-display-state) screen) - (set-transition-speed! obj) - (case (-> obj display-state) + (set! (-> this selected-option) #f) + (set! (-> this option-index) option) + (set! (-> this last-option-index-change) (-> *display* real-frame-counter)) + (set! (-> this display-state) screen) + (set! (-> this next-display-state) screen) + (set-transition-speed! this) + (case (-> this display-state) (((progress-screen memcard-creating)) - (auto-save-command 'create-file 0 0 obj) + (auto-save-command 'create-file 0 0 this) ) (((progress-screen memcard-loading)) (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which)) (sound-volume-off) - (auto-save-command 'restore 0 (-> *progress-state* which) obj) + (auto-save-command 'restore 0 (-> *progress-state* which) this) ) (((progress-screen memcard-saving)) (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which)) - (auto-save-command 'save 0 (-> *progress-state* which) obj) + (auto-save-command 'save 0 (-> *progress-state* which) this) ) (((progress-screen memcard-formatting)) - (auto-save-command 'format-card 0 0 obj) + (auto-save-command 'format-card 0 0 this) ) (((progress-screen save-game) (progress-screen load-game)) - (set! (-> obj option-index) (max 0 (-> *progress-state* last-slot-saved))) + (set! (-> this option-index) (max 0 (-> *progress-state* last-slot-saved))) ) (((progress-screen memcard-removed)) (set! (-> *progress-state* last-slot-saved) 0) @@ -650,13 +650,13 @@ ;; definition for method 45 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod push! progress ((obj progress)) - (let ((v1-0 (-> obj display-state-pos))) +(defmethod push! progress ((this progress)) + (let ((v1-0 (-> this display-state-pos))) (cond ((< v1-0 5) - (set! (-> obj display-state-stack v1-0) (-> obj display-state)) - (set! (-> obj option-index-stack v1-0) (-> obj option-index)) - (set! (-> obj display-state-pos) (+ v1-0 1)) + (set! (-> this display-state-stack v1-0) (-> this display-state)) + (set! (-> this option-index-stack v1-0) (-> this option-index)) + (set! (-> this display-state-pos) (+ v1-0 1)) ) (else (format #t "ERROR: Can't push any more states on the display-state-stack.~%") @@ -669,13 +669,13 @@ ;; definition for method 46 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod pop! progress ((obj progress)) - (let ((v1-0 (-> obj display-state-pos))) +(defmethod pop! progress ((this progress)) + (let ((v1-0 (-> this display-state-pos))) (cond ((> v1-0 0) (let ((a2-0 (+ v1-0 -1))) - (set! (-> obj display-state-pos) a2-0) - (enter! obj (-> obj display-state-stack a2-0) (-> obj option-index-stack a2-0)) + (set! (-> this display-state-pos) a2-0) + (enter! this (-> this display-state-stack a2-0) (-> this option-index-stack a2-0)) ) ) (else @@ -689,19 +689,19 @@ ;; definition for method 51 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod set-transition-progress! progress ((obj progress) (arg0 int)) - (set! (-> obj transition-offset) arg0) - (set! (-> obj transition-offset-invert) (- 512 arg0)) - (set! (-> obj transition-percentage) (* 0.001953125 (the float arg0))) - (set! (-> obj transition-percentage-invert) (- 1.0 (-> obj transition-percentage))) +(defmethod set-transition-progress! progress ((this progress) (arg0 int)) + (set! (-> this transition-offset) arg0) + (set! (-> this transition-offset-invert) (- 512 arg0)) + (set! (-> this transition-percentage) (* 0.001953125 (the float arg0))) + (set! (-> this transition-percentage-invert) (- 1.0 (-> this transition-percentage))) 0 (none) ) ;; definition for method 52 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod set-transition-speed! progress ((obj progress)) - (case (-> obj display-state) +(defmethod set-transition-speed! progress ((this progress)) + (case (-> this display-state) (((progress-screen fuel-cell) (progress-screen money) (progress-screen buzzer) @@ -709,10 +709,10 @@ (progress-screen save-game) (progress-screen save-game-title) ) - (set! (-> obj transition-speed) 15.0) + (set! (-> this transition-speed) 15.0) ) (else - (set! (-> obj transition-speed) 45.0) + (set! (-> this transition-speed) 45.0) ) ) 0 @@ -912,56 +912,56 @@ ) ;; definition for method 7 of type game-count-info -(defmethod relocate game-count-info ((obj game-count-info) (arg0 int)) - (set! *game-counts* obj) - obj +(defmethod relocate game-count-info ((this game-count-info) (arg0 int)) + (set! *game-counts* this) + this ) ;; definition for method 7 of type progress ;; INFO: Return type mismatch process vs progress. -(defmethod relocate progress ((obj progress) (arg0 int)) - (dotimes (v1-0 (-> obj nb-of-particles)) - (when (-> obj particles v1-0 part) - (if (nonzero? (-> obj particles v1-0 part)) - (set! (-> obj particles v1-0 part) - (the-as sparticle-launch-control (&+ (the-as pointer (-> obj particles v1-0 part)) arg0)) +(defmethod relocate progress ((this progress) (arg0 int)) + (dotimes (v1-0 (-> this nb-of-particles)) + (when (-> this particles v1-0 part) + (if (nonzero? (-> this particles v1-0 part)) + (set! (-> this particles v1-0 part) + (the-as sparticle-launch-control (&+ (the-as pointer (-> this particles v1-0 part)) arg0)) ) ) ) ) - (the-as progress ((method-of-type process relocate) obj arg0)) + (the-as progress ((method-of-type process relocate) this arg0)) ) ;; definition for method 21 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod adjust-sprites progress ((obj progress)) - (let ((f0-1 (* 0.00024414062 (the float (-> obj in-out-position))))) - (set! (-> obj particles 2 init-pos x) (the float (+ (-> obj right-x-offset) 409 (the int (* 301.5 f0-1))))) - (set! (-> obj particles 1 init-pos x) (the float (+ (-> obj left-x-offset) 59))) - (set! (-> obj left-side-x-scale) (* 4096.0 (+ (/ 3.5 (-> obj sides-x-scale)) (* 10.0 f0-1)))) - (set! (-> obj left-side-y-scale) (* 4096.0 (+ (-> obj sides-y-scale) (* 10.0 f0-1)))) - (set! (-> obj right-side-x-scale) (* 4096.0 (+ (/ 6.0 (-> obj sides-x-scale)) (* 4.0 f0-1)))) - (set! (-> obj right-side-y-scale) (* 4096.0 (+ (-> obj sides-y-scale) (* 4.0 f0-1)))) +(defmethod adjust-sprites progress ((this progress)) + (let ((f0-1 (* 0.00024414062 (the float (-> this in-out-position))))) + (set! (-> this particles 2 init-pos x) (the float (+ (-> this right-x-offset) 409 (the int (* 301.5 f0-1))))) + (set! (-> this particles 1 init-pos x) (the float (+ (-> this left-x-offset) 59))) + (set! (-> this left-side-x-scale) (* 4096.0 (+ (/ 3.5 (-> this sides-x-scale)) (* 10.0 f0-1)))) + (set! (-> this left-side-y-scale) (* 4096.0 (+ (-> this sides-y-scale) (* 10.0 f0-1)))) + (set! (-> this right-side-x-scale) (* 4096.0 (+ (/ 6.0 (-> this sides-x-scale)) (* 4.0 f0-1)))) + (set! (-> this right-side-y-scale) (* 4096.0 (+ (-> this sides-y-scale) (* 4.0 f0-1)))) ) - (dotimes (s5-0 (-> obj nb-of-particles)) - (set! (-> obj particles s5-0 pos x) (+ -256.0 (-> obj particles s5-0 init-pos x))) - (set! (-> obj particles s5-0 pos y) - (* 0.5 (- (* (-> obj particles s5-0 init-pos y) (-> *video-parms* relative-y-scale)) + (dotimes (s5-0 (-> this nb-of-particles)) + (set! (-> this particles s5-0 pos x) (+ -256.0 (-> this particles s5-0 init-pos x))) + (set! (-> this particles s5-0 pos y) + (* 0.5 (- (* (-> this particles s5-0 init-pos y) (-> *video-parms* relative-y-scale)) (the float (-> *video-parms* screen-sy)) ) ) ) - (set! (-> obj particles s5-0 pos z) (-> obj particles s5-0 init-pos z)) - (if (> (-> obj particles s5-0 part matrix) 0) + (set! (-> this particles s5-0 pos z) (-> this particles s5-0 init-pos z)) + (if (> (-> this particles s5-0 part matrix) 0) (set-vector! - (sprite-get-user-hvdf (-> obj particles s5-0 part matrix)) - (the float (+ (the int (-> obj particles s5-0 pos x)) 2048)) - (the float (+ (the int (-> obj particles s5-0 pos y)) 2048)) - (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> obj particles s5-0 pos z))) + (sprite-get-user-hvdf (-> this particles s5-0 part matrix)) + (the float (+ (the int (-> this particles s5-0 pos x)) 2048)) + (the float (+ (the int (-> this particles s5-0 pos y)) 2048)) + (- (-> *math-camera* hvdf-off z) (* 1024.0 (-> this particles s5-0 pos z))) (-> *math-camera* hvdf-off w) ) ) - (spawn (-> obj particles s5-0 part) *null-vector*) + (spawn (-> this particles s5-0 part) *null-vector*) ) 0 (none) @@ -969,20 +969,20 @@ ;; definition for method 22 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod adjust-icons progress ((obj progress)) - (dotimes (v1-0 (-> obj nb-of-icons)) +(defmethod adjust-icons progress ((this progress)) + (dotimes (v1-0 (-> this nb-of-icons)) (when (>= v1-0 4) (set-vector! - (-> obj icons v1-0 icon 0 root scale) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) - (* (-> obj icons v1-0 scale-y) (-> *video-parms* relative-y-scale)) - (* (-> obj icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) + (-> this icons v1-0 icon 0 root scale) + (* (-> this icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) + (* (-> this icons v1-0 scale-y) (-> *video-parms* relative-y-scale)) + (* (-> this icons v1-0 scale-x) (-> *video-parms* relative-x-scale)) 1.0 ) - (set! (-> obj icons v1-0 icon 0 root trans x) (the float (+ (-> obj icons v1-0 icon-x) -256))) - (set! (-> obj icons v1-0 icon 0 root trans y) + (set! (-> this icons v1-0 icon 0 root trans x) (the float (+ (-> this icons v1-0 icon-x) -256))) + (set! (-> this icons v1-0 icon 0 root trans y) (* (-> *video-parms* relative-y-scale) - (- (* (-> *video-parms* relative-y-scale) (the float (-> obj icons v1-0 icon-y))) + (- (* (-> *video-parms* relative-y-scale) (the float (-> this icons v1-0 icon-y))) (the float (-> *video-parms* screen-sy)) ) ) @@ -995,51 +995,51 @@ ;; definition for method 23 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod adjust-ratios progress ((obj progress) (aspect symbol) (video-mode symbol)) +(defmethod adjust-ratios progress ((this progress) (aspect symbol) (video-mode symbol)) (case aspect (('aspect4x3) - (set! (-> obj sides-x-scale) 1.0) - (set! (-> obj sides-y-scale) 13.0) - (set! (-> obj left-x-offset) 0) - (set! (-> obj right-x-offset) 0) - (set! (-> obj button-scale) 1.0) - (set! (-> obj slot-scale) 8192.0) - (set! (-> obj small-orb-y-offset) 58) - (set! (-> obj icons 5 scale-x) 0.008) - (set! (-> obj icons 5 scale-y) -0.009) - (set! (-> obj big-orb-y-offset) 243) - (set! (-> obj icons 4 scale-x) 0.013) - (set! (-> obj icons 4 scale-y) -0.015) + (set! (-> this sides-x-scale) 1.0) + (set! (-> this sides-y-scale) 13.0) + (set! (-> this left-x-offset) 0) + (set! (-> this right-x-offset) 0) + (set! (-> this button-scale) 1.0) + (set! (-> this slot-scale) 8192.0) + (set! (-> this small-orb-y-offset) 58) + (set! (-> this icons 5 scale-x) 0.008) + (set! (-> this icons 5 scale-y) -0.009) + (set! (-> this big-orb-y-offset) 243) + (set! (-> this icons 4 scale-x) 0.013) + (set! (-> this icons 4 scale-y) -0.015) ) (('aspect16x9) - (set! (-> obj sides-x-scale) 1.2) - (set! (-> obj sides-y-scale) 9.8) - (set! (-> obj left-x-offset) -10) - (set! (-> obj right-x-offset) 17) - (set! (-> obj button-scale) 1.05) - (set! (-> obj slot-scale) 6144.0) - (set! (-> obj small-orb-y-offset) 59) - (set! (-> obj icons 5 scale-x) 0.008) - (set! (-> obj icons 5 scale-y) -0.0098) - (set! (-> obj big-orb-y-offset) 255) - (set! (-> obj icons 4 scale-x) 0.017) - (set! (-> obj icons 4 scale-y) -0.0205) + (set! (-> this sides-x-scale) 1.2) + (set! (-> this sides-y-scale) 9.8) + (set! (-> this left-x-offset) -10) + (set! (-> this right-x-offset) 17) + (set! (-> this button-scale) 1.05) + (set! (-> this slot-scale) 6144.0) + (set! (-> this small-orb-y-offset) 59) + (set! (-> this icons 5 scale-x) 0.008) + (set! (-> this icons 5 scale-y) -0.0098) + (set! (-> this big-orb-y-offset) 255) + (set! (-> this icons 4 scale-x) 0.017) + (set! (-> this icons 4 scale-y) -0.0205) ) ) (when (= video-mode 'pal) - (set! (-> obj icons 5 scale-y) (* 1.15 (-> obj icons 5 scale-y))) - (set! (-> obj icons 4 scale-x) (* 1.05 (-> obj icons 4 scale-x))) - (set! (-> obj icons 4 scale-y) (* (-> obj icons 4 scale-y) (the-as float (if (= aspect 'aspect16x9) - 1.18 - 1.15 - ) - ) - ) + (set! (-> this icons 5 scale-y) (* 1.15 (-> this icons 5 scale-y))) + (set! (-> this icons 4 scale-x) (* 1.05 (-> this icons 4 scale-x))) + (set! (-> this icons 4 scale-y) (* (-> this icons 4 scale-y) (the-as float (if (= aspect 'aspect16x9) + 1.18 + 1.15 + ) + ) + ) ) - (+! (-> obj big-orb-y-offset) (if (= aspect 'aspect16x9) - 3 - 2 - ) + (+! (-> this big-orb-y-offset) (if (= aspect 'aspect16x9) + 3 + 2 + ) ) ) 0 @@ -1047,13 +1047,13 @@ ) ;; definition for method 32 of type progress -(defmethod can-go-back? progress ((obj progress)) +(defmethod can-go-back? progress ((this progress)) (let ((v1-2 (-> *progress-process* 0 display-state)) (a1-1 (-> *progress-state* starting-state)) ) - (and (= (-> obj next-state name) 'progress-normal) - (not (-> obj in-transition)) - (not (-> obj selected-option)) + (and (= (-> this next-state name) 'progress-normal) + (not (-> this in-transition)) + (not (-> this selected-option)) (or (= v1-2 (progress-screen fuel-cell)) (= v1-2 (progress-screen money)) (= v1-2 (progress-screen buzzer)) @@ -1077,12 +1077,12 @@ ;; definition for method 19 of type progress ;; INFO: Return type mismatch object vs symbol. -(defmethod visible? progress ((obj progress)) +(defmethod visible? progress ((this progress)) (the-as symbol (and *progress-process* (zero? (-> *progress-process* 0 in-out-position)))) ) ;; definition for method 20 of type progress -(defmethod hidden? progress ((obj progress)) +(defmethod hidden? progress ((this progress)) (or (not *progress-process*) (= (-> *progress-process* 0 in-out-position) 4096)) ) @@ -1124,8 +1124,8 @@ ) ;; definition for method 53 of type progress -(defmethod set-memcard-screen progress ((obj progress) (arg0 progress-screen)) - (let ((s4-0 (-> obj card-info)) +(defmethod set-memcard-screen progress ((this progress) (arg0 progress-screen)) + (let ((s4-0 (-> this card-info)) (gp-0 arg0) ) (when s4-0 @@ -1140,7 +1140,7 @@ ) ((zero? (-> s4-0 formatted)) (cond - ((or (zero? (-> obj display-state-pos)) + ((or (zero? (-> this display-state-pos)) (and (!= (-> *progress-state* starting-state) 27) (nonzero? (-> *progress-state* starting-state))) ) (set-master-mode 'game) @@ -1155,7 +1155,7 @@ ((and (zero? (-> s4-0 inited)) (< (-> s4-0 mem-actual) (-> s4-0 mem-required))) (set! gp-0 (progress-screen memcard-no-space)) ) - ((or (zero? (-> obj display-state-pos)) + ((or (zero? (-> this display-state-pos)) (and (!= (-> *progress-state* starting-state) 27) (nonzero? (-> *progress-state* starting-state))) ) (set-master-mode 'game) @@ -1227,41 +1227,41 @@ ;; definition for method 31 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod respond-memcard progress ((obj progress)) - (let ((s5-0 (-> obj card-info))) - (when (and s5-0 (not (-> obj in-transition))) +(defmethod respond-memcard progress ((this progress)) + (let ((s5-0 (-> this card-info))) + (when (and s5-0 (not (-> this in-transition))) (when (or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (case (-> obj display-state) + (case (-> this display-state) (((progress-screen load-game)) (cond - ((< (-> obj option-index) 4) - (when (nonzero? (-> s5-0 file (-> obj option-index) present)) + ((< (-> this option-index) 4) + (when (nonzero? (-> s5-0 file (-> this option-index) present)) (sound-play "start-options") - (set! (-> *progress-state* which) (-> obj option-index)) - (set! (-> obj next-display-state) (progress-screen memcard-loading)) + (set! (-> *progress-state* which) (-> this option-index)) + (set! (-> this next-display-state) (progress-screen memcard-loading)) ) ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) (((progress-screen save-game) (progress-screen save-game-title)) (cond - ((< (-> obj option-index) 4) + ((< (-> this option-index) 4) (sound-play "start-options") - (set! (-> *progress-state* which) (-> obj option-index)) - (if (zero? (-> s5-0 file (-> obj option-index) present)) - (set! (-> obj next-display-state) (progress-screen memcard-saving)) - (set! (-> obj next-display-state) (progress-screen memcard-data-exists)) + (set! (-> *progress-state* which) (-> this option-index)) + (if (zero? (-> s5-0 file (-> this option-index) present)) + (set! (-> this next-display-state) (progress-screen memcard-saving)) + (set! (-> this next-display-state) (progress-screen memcard-data-exists)) ) ) - ((and (= (-> obj display-state) (progress-screen save-game-title)) (= (-> obj option-index) 4)) + ((and (= (-> this display-state) (progress-screen save-game-title)) (= (-> this option-index) 4)) (sound-play "starts-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) @@ -1270,25 +1270,25 @@ ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) (((progress-screen memcard-insert)) (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) (((progress-screen memcard-data-exists)) (cond ((-> *progress-state* yes-no-choice) (sound-play "start-options") - (set! (-> obj next-display-state) (progress-screen memcard-saving)) + (set! (-> this next-display-state) (progress-screen memcard-saving)) ) (else (sound-play "cursor-options") - (if (= (-> obj display-state-stack 0) (progress-screen title)) - (set! (-> obj next-display-state) (progress-screen save-game-title)) - (set! (-> obj next-display-state) (progress-screen save-game)) + (if (= (-> this display-state-stack 0) (progress-screen title)) + (set! (-> this next-display-state) (progress-screen save-game-title)) + (set! (-> this next-display-state) (progress-screen save-game)) ) ) ) @@ -1297,7 +1297,7 @@ (cond ((-> *progress-state* yes-no-choice) (sound-play "start-options") - (set! (-> obj next-display-state) (progress-screen memcard-creating)) + (set! (-> this next-display-state) (progress-screen memcard-creating)) ) (else (sound-play "cursor-options") @@ -1313,20 +1313,20 @@ (progress-screen memcard-not-formatted) ) (cond - ((= (-> obj display-state-stack 0) (progress-screen title)) + ((= (-> this display-state-stack 0) (progress-screen title)) (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) (initialize! *game-info* 'game (the-as game-save #f) "intro-start") (set-master-mode 'game) ) - ((nonzero? (-> obj display-state-stack 0)) + ((nonzero? (-> this display-state-stack 0)) (sound-play "start-options") (set-master-mode 'game) ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) @@ -1339,20 +1339,20 @@ (progress-screen auto-save) ) (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) (((progress-screen pal-change-to-60hz)) (cond ((-> *progress-state* yes-no-choice) (sound-play "start-options") (set! (-> *setting-control* default video-mode) (-> *progress-state* video-mode-choice)) - (set! (-> obj video-mode-timeout) (-> *display* real-frame-counter)) - (set! (-> obj next-display-state) (progress-screen pal-now-60hz)) + (set! (-> this video-mode-timeout) (-> *display* real-frame-counter)) + (set! (-> this next-display-state) (progress-screen pal-now-60hz)) ) (else (sound-play "cursor-options") (set! (-> *progress-state* video-mode-choice) 'pal) - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) @@ -1367,12 +1367,12 @@ (sound-play "start-options") ) ) - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) (((progress-screen no-disc) (progress-screen bad-disc)) (when (is-cd-in?) (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) (((progress-screen quit)) @@ -1385,7 +1385,7 @@ ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) @@ -1393,9 +1393,9 @@ (cond ((-> *progress-state* yes-no-choice) (sound-play "start-options") - (set! (-> obj next-display-state) (progress-screen memcard-formatting)) + (set! (-> this next-display-state) (progress-screen memcard-formatting)) ) - ((= (-> obj display-state-stack 0) (progress-screen title)) + ((= (-> this display-state-stack 0) (progress-screen title)) (sound-play "start-options") (sound-volume-off) (set! (-> *game-info* mode) 'play) @@ -1404,7 +1404,7 @@ ) (else (sound-play "cursor-options") - (set! (-> obj next-display-state) (progress-screen invalid)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) @@ -1418,30 +1418,30 @@ ;; definition for method 29 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod respond-common progress ((obj progress)) +(defmethod respond-common progress ((this progress)) (mc-get-slot-info 0 *progress-save-info*) - (set! (-> obj card-info) *progress-save-info*) - (let ((s5-0 (-> *options-remap* (-> obj display-state)))) - (when (and s5-0 (not (-> obj in-transition))) + (set! (-> this card-info) *progress-save-info*) + (let ((s5-0 (-> *options-remap* (-> this display-state)))) + (when (and s5-0 (not (-> this in-transition))) (cond ((cpad-hold? 0 up) (cond ((cpad-pressed? 0 up) - (when (not (-> obj selected-option)) + (when (not (-> this selected-option)) (if (!= (length s5-0) 1) (sound-play "cursor-up-down") ) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) - (if (> (-> obj option-index) 0) - (+! (-> obj option-index) -1) - (set! (-> obj option-index) (+ (length s5-0) -1)) + (set! (-> this last-option-index-change) (-> *display* real-frame-counter)) + (if (> (-> this option-index) 0) + (+! (-> this option-index) -1) + (set! (-> this option-index) (+ (length s5-0) -1)) ) ) ) (else - (when (-> obj selected-option) + (when (-> this selected-option) (let ((v1-34 #f)) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type center-screen)) (when (< -48 (-> *setting-control* current screeny)) (set! v1-34 #t) @@ -1463,26 +1463,26 @@ ((cpad-hold? 0 down) (cond ((cpad-pressed? 0 down) - (when (not (-> obj selected-option)) + (when (not (-> this selected-option)) (if (!= (length s5-0) 1) (sound-play "cursor-up-down") ) - (set! (-> obj last-option-index-change) (-> *display* real-frame-counter)) + (set! (-> this last-option-index-change) (-> *display* real-frame-counter)) (cond - ((< (-> obj option-index) (+ (length s5-0) -1)) - (+! (-> obj option-index) 1) + ((< (-> this option-index) (+ (length s5-0) -1)) + (+! (-> this option-index) 1) ) (else - (set! (-> obj option-index) 0) + (set! (-> this option-index) 0) 0 ) ) ) ) (else - (when (-> obj selected-option) + (when (-> this selected-option) (let ((v1-69 #f)) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type center-screen)) (when (< (-> *setting-control* current screeny) 48) (set! v1-69 #t) @@ -1504,30 +1504,30 @@ ((cpad-hold? 0 left) (cond ((cpad-pressed? 0 left) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) + (when (or (-> this selected-option) (= (-> s5-0 (-> this option-index) option-type) (game-option-type yes-no))) (let ((s4-5 #f)) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type on-off) (game-option-type yes-no)) - (when (not (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (when (not (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) (set! s4-5 #t) - (if (= (-> s5-0 (-> obj option-index) value-to-modify) (&-> *setting-control* current vibration)) + (if (= (-> s5-0 (-> this option-index) value-to-modify) (&-> *setting-control* current vibration)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) ) ) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #t) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) #t) ) (((game-option-type aspect-ratio)) - (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3) + (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'aspect16x9)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'aspect4x3) ) (((game-option-type video-mode)) - (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal) + (set! s4-5 (= (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'ntsc)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'pal) ) (((game-option-type language)) - (if (> (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) 0) - (+! (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))) -1) - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) + (if (> (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> this option-index) value-to-modify)))) 0) + (+! (-> (the-as (pointer uint64) (-> s5-0 (-> this option-index) value-to-modify))) -1) + (set! (-> (the-as (pointer int64) (-> s5-0 (-> this option-index) value-to-modify))) (if (and (zero? (scf-get-territory)) (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) ) @@ -1536,8 +1536,8 @@ ) ) ) - (set! (-> obj language-transition) #t) - (set! (-> obj language-direction) #t) + (set! (-> this language-transition) #t) + (set! (-> this language-direction) #t) (set! s4-5 #t) ) ) @@ -1548,22 +1548,22 @@ ) ) (else - (when (-> obj selected-option) + (when (-> this selected-option) (let ((v1-157 #f)) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type slider)) (cond - ((>= (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (+ 1.0 (-> s5-0 (-> obj option-index) param1)) + ((>= (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) + (+ 1.0 (-> s5-0 (-> this option-index) param1)) ) - (+! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) -1.0) + (+! (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) -1.0) (set! v1-157 #t) ) - ((< (-> s5-0 (-> obj option-index) param1) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ((< (-> s5-0 (-> this option-index) param1) + (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param1) + (set! (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) + (-> s5-0 (-> this option-index) param1) ) (set! v1-157 #t) ) @@ -1578,9 +1578,9 @@ ) (when v1-157 (let ((f30-0 100.0)) - (case (-> s5-0 (-> obj option-index) name) + (case (-> s5-0 (-> this option-index) name) (((text-id music-volume) (text-id speech-volume)) - (set! f30-0 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) + (set! f30-0 (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) @@ -1597,20 +1597,20 @@ ((cpad-hold? 0 right) (cond ((cpad-pressed? 0 right) - (when (or (-> obj selected-option) (= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no))) + (when (or (-> this selected-option) (= (-> s5-0 (-> this option-index) option-type) (game-option-type yes-no))) (let ((v1-217 (the-as object #f))) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type on-off) (game-option-type yes-no)) - (set! v1-217 (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) #f) + (set! v1-217 (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) #f) ) (((game-option-type aspect-ratio)) - (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect4x3)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'aspect16x9) + (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'aspect4x3)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'aspect16x9) ) (((game-option-type video-mode)) - (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'pal)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) 'ntsc) + (set! v1-217 (= (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'pal)) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) 'ntsc) ) (((game-option-type language)) (let ((v1-243 (if (and (zero? (scf-get-territory)) @@ -1622,17 +1622,17 @@ ) ) (cond - ((< (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) v1-243) - (+! (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify))) 1) + ((< (the-as int (-> (the-as (pointer uint64) (-> s5-0 (-> this option-index) value-to-modify)))) v1-243) + (+! (-> (the-as (pointer uint64) (-> s5-0 (-> this option-index) value-to-modify))) 1) ) (else - (set! (-> (the-as (pointer int64) (-> s5-0 (-> obj option-index) value-to-modify))) 0) + (set! (-> (the-as (pointer int64) (-> s5-0 (-> this option-index) value-to-modify))) 0) 0 ) ) ) - (set! (-> obj language-transition) #t) - (set! (-> obj language-direction) #f) + (set! (-> this language-transition) #t) + (set! (-> this language-direction) #f) (set! v1-217 #t) ) ) @@ -1643,22 +1643,22 @@ ) ) (else - (when (-> obj selected-option) + (when (-> this selected-option) (let ((v1-263 #f)) - (case (-> s5-0 (-> obj option-index) option-type) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type slider)) (cond - ((>= (+ -1.0 (-> s5-0 (-> obj option-index) param2)) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + ((>= (+ -1.0 (-> s5-0 (-> this option-index) param2)) + (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) ) - (+! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) 1.0) + (+! (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) 1.0) (set! v1-263 #t) ) - ((< (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) + ((< (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) + (-> s5-0 (-> this option-index) param2) ) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) - (-> s5-0 (-> obj option-index) param2) + (set! (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) + (-> s5-0 (-> this option-index) param2) ) (set! v1-263 #t) ) @@ -1673,9 +1673,9 @@ ) (when v1-263 (let ((f30-1 100.0)) - (case (-> s5-0 (-> obj option-index) name) + (case (-> s5-0 (-> this option-index) name) (((text-id music-volume) (text-id speech-volume)) - (set! f30-1 (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify)))) + (set! f30-1 (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (when (< (seconds 0.3) (- (-> *display* real-frame-counter) (-> *progress-state* last-slider-sound))) @@ -1691,20 +1691,20 @@ ) ((or (cpad-pressed? 0 square) (cpad-pressed? 0 triangle)) (cond - ((-> obj selected-option) - (case (-> s5-0 (-> obj option-index) option-type) + ((-> this selected-option) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type slider)) - (set! (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (set! (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) (-> *progress-state* slider-backup) ) ) (((game-option-type language)) - (set! (-> (the-as (pointer language-enum) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (set! (-> (the-as (pointer language-enum) (-> s5-0 (-> this option-index) value-to-modify)) 0) (-> *progress-state* language-backup) ) ) (((game-option-type on-off)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) (-> *progress-state* on-off-backup) ) ) @@ -1713,81 +1713,81 @@ (set! (-> *setting-control* default screeny) (-> *progress-state* center-y-backup)) ) (((game-option-type aspect-ratio) (game-option-type video-mode)) - (set! (-> (the-as (pointer symbol) (-> s5-0 (-> obj option-index) value-to-modify)) 0) + (set! (-> (the-as (pointer symbol) (-> s5-0 (-> this option-index) value-to-modify)) 0) (-> *progress-state* aspect-ratio-backup) ) ) ) (sound-play "cursor-options") - (set! (-> obj selected-option) #f) + (set! (-> this selected-option) #f) ) - ((or (can-go-back? obj) - (= (-> obj display-state) (progress-screen load-game)) - (= (-> obj display-state) (progress-screen save-game)) - (= (-> obj display-state) (progress-screen save-game-title)) + ((or (can-go-back? this) + (= (-> this display-state) (progress-screen load-game)) + (= (-> this display-state) (progress-screen save-game)) + (= (-> this display-state) (progress-screen save-game-title)) ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons square)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons square)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (if (= (-> obj display-state) (progress-screen settings)) + (if (= (-> this display-state) (progress-screen settings)) (sound-play "menu-stats") (sound-play "cursor-options") ) - (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) - (set! (-> obj next-display-state) (progress-screen invalid)) + (load-level-text-files (-> *level-task-data* (-> this display-level-index) text-group-index)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) ((or (cpad-pressed? 0 x) (cpad-pressed? 0 circle)) (cond - ((not (-> obj selected-option)) + ((not (-> this selected-option)) (cond - ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type menu)) + ((= (-> s5-0 (-> this option-index) option-type) (game-option-type menu)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (push! obj) + (push! this) (sound-play "select-option") - (set! (-> obj next-display-state) (the-as progress-screen (-> s5-0 (-> obj option-index) param3))) - (case (-> obj next-display-state) + (set! (-> this next-display-state) (the-as progress-screen (-> s5-0 (-> this option-index) param3))) + (case (-> this next-display-state) (((progress-screen load-game) (progress-screen save-game) (progress-screen save-game-title)) - (set! (-> obj next-display-state) (set-memcard-screen obj (-> obj next-display-state))) + (set! (-> this next-display-state) (set-memcard-screen this (-> this next-display-state))) ) ) ) - ((= (-> s5-0 (-> obj option-index) option-type) (game-option-type button)) + ((= (-> s5-0 (-> this option-index) option-type) (game-option-type button)) (cond - ((= (-> s5-0 (-> obj option-index) name) (text-id exit-demo)) + ((= (-> s5-0 (-> this option-index) name) (text-id exit-demo)) (set! *master-exit* 'force) (set-master-mode 'game) ) - ((= (-> s5-0 (-> obj option-index) name) (text-id back)) - (if (= (-> obj display-state) (progress-screen settings)) + ((= (-> s5-0 (-> this option-index) name) (text-id back)) + (if (= (-> this display-state) (progress-screen settings)) (sound-play "menu-stats") (sound-play "cursor-options") ) - (load-level-text-files (-> *level-task-data* (-> obj display-level-index) text-group-index)) - (set! (-> obj next-display-state) (progress-screen invalid)) + (load-level-text-files (-> *level-task-data* (-> this display-level-index) text-group-index)) + (set! (-> this next-display-state) (progress-screen invalid)) ) ) ) - ((!= (-> s5-0 (-> obj option-index) option-type) (game-option-type yes-no)) - (case (-> s5-0 (-> obj option-index) option-type) + ((!= (-> s5-0 (-> this option-index) option-type) (game-option-type yes-no)) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type slider)) (set! (-> *progress-state* slider-backup) - (-> (the-as (pointer float) (-> s5-0 (-> obj option-index) value-to-modify))) + (-> (the-as (pointer float) (-> s5-0 (-> this option-index) value-to-modify))) ) ) (((game-option-type language)) (set! (-> *progress-state* language-backup) - (the-as language-enum (-> (the-as (pointer uint64) (-> s5-0 (-> obj option-index) value-to-modify)))) + (the-as language-enum (-> (the-as (pointer uint64) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (((game-option-type on-off)) (set! (-> *progress-state* on-off-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (((game-option-type center-screen)) @@ -1796,7 +1796,7 @@ ) (((game-option-type aspect-ratio) (game-option-type video-mode)) (set! (-> *progress-state* aspect-ratio-backup) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) ) @@ -1805,12 +1805,12 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) - (set! (-> obj selected-option) #t) - (when (= (-> s5-0 (-> obj option-index) option-type) (game-option-type language)) - (set! (-> obj language-selection) (-> *setting-control* current language)) - (set! (-> obj language-direction) #t) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) + (set! (-> this selected-option) #t) + (when (= (-> s5-0 (-> this option-index) option-type) (game-option-type language)) + (set! (-> this language-selection) (-> *setting-control* current language)) + (set! (-> this language-direction) #t) + (set! (-> this language-transition) #f) + (set! (-> this language-x-offset) 0) 0 ) ) @@ -1818,29 +1818,29 @@ ) (else (sound-play "start-options") - (set! (-> obj selected-option) #f) - (case (-> s5-0 (-> obj option-index) option-type) + (set! (-> this selected-option) #f) + (case (-> s5-0 (-> this option-index) option-type) (((game-option-type aspect-ratio)) (set! (-> *setting-control* default aspect-ratio) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (((game-option-type video-mode)) - (case (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify))) + (case (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify))) (('pal) (set! (-> *setting-control* default video-mode) - (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> obj option-index) value-to-modify)))) + (the-as symbol (-> (the-as (pointer uint32) (-> s5-0 (-> this option-index) value-to-modify)))) ) ) (('ntsc) - (push! obj) - (set! (-> obj next-display-state) (progress-screen pal-change-to-60hz)) + (push! this) + (set! (-> this next-display-state) (progress-screen pal-change-to-60hz)) ) ) ) (((game-option-type language)) - (if (not (-> obj language-transition)) - (load-level-text-files (-> obj display-level-index)) + (if (not (-> this language-transition)) + (load-level-text-files (-> this display-level-index)) ) ) ) @@ -1856,69 +1856,69 @@ ;; definition for method 30 of type progress ;; INFO: Return type mismatch int vs none. -(defmethod respond-progress progress ((obj progress)) - (when (not (-> obj in-transition)) +(defmethod respond-progress progress ((this progress)) + (when (not (-> this in-transition)) (cond ((cpad-pressed? 0 up) - (let ((s5-0 (-> obj display-level-index))) - (set! (-> obj next-level-index) (get-next-level-down s5-0)) - (when (!= s5-0 (-> obj next-level-index)) + (let ((s5-0 (-> this display-level-index))) + (set! (-> this next-level-index) (get-next-level-down s5-0)) + (when (!= s5-0 (-> this next-level-index)) (sound-play "cursor-up-down") - (set! (-> obj level-transition) 2) + (set! (-> this level-transition) 2) ) ) ) ((cpad-pressed? 0 down) - (let ((s5-2 (-> obj next-level-index))) - (set! (-> obj next-level-index) (get-next-level-up s5-2)) - (when (!= s5-2 (-> obj next-level-index)) + (let ((s5-2 (-> this next-level-index))) + (set! (-> this next-level-index) (get-next-level-up s5-2)) + (when (!= s5-2 (-> this next-level-index)) (sound-play "cursor-up-down") - (set! (-> obj level-transition) 1) + (set! (-> this level-transition) 1) ) ) ) ((cpad-pressed? 0 square) - (when (nonzero? (-> obj display-state)) + (when (nonzero? (-> this display-state)) (sound-play "select-option") - (set! (-> obj next-display-state) (progress-screen fuel-cell)) - (set! (-> obj stat-transition) #t) + (set! (-> this next-display-state) (progress-screen fuel-cell)) + (set! (-> this stat-transition) #t) ) ) ((cpad-pressed? 0 x) - (when (!= (-> obj display-state) (progress-screen money)) + (when (!= (-> this display-state) (progress-screen money)) (sound-play "select-option") - (set! (-> obj next-display-state) (progress-screen money)) - (set! (-> obj stat-transition) #t) + (set! (-> this next-display-state) (progress-screen money)) + (set! (-> this stat-transition) #t) ) ) ((cpad-pressed? 0 triangle) - (when (!= (-> obj display-state) (progress-screen buzzer)) + (when (!= (-> this display-state) (progress-screen buzzer)) (sound-play "select-option") - (set! (-> obj next-display-state) (progress-screen buzzer)) - (set! (-> obj stat-transition) #t) + (set! (-> this next-display-state) (progress-screen buzzer)) + (set! (-> this stat-transition) #t) ) ) ((cpad-pressed? 0 circle) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (sound-play "start-options") - (push! obj) - (set! (-> obj next-display-state) (progress-screen settings)) + (push! this) + (set! (-> this next-display-state) (progress-screen settings)) ) - ((= (-> obj display-state) (progress-screen fuel-cell)) + ((= (-> this display-state) (progress-screen fuel-cell)) (cond ((cpad-pressed? 0 left) - (let ((s5-8 (-> obj task-index))) - (set! (-> obj task-index) (get-next-task-down (-> obj task-index) (-> obj display-level-index))) - (if (!= s5-8 (-> obj task-index)) + (let ((s5-8 (-> this task-index))) + (set! (-> this task-index) (get-next-task-down (-> this task-index) (-> this display-level-index))) + (if (!= s5-8 (-> this task-index)) (sound-play "cursor-l-r") ) ) ) ((cpad-pressed? 0 right) - (let ((s5-10 (-> obj task-index))) - (set! (-> obj task-index) (get-next-task-up (-> obj task-index) (-> obj display-level-index))) - (if (!= s5-10 (-> obj task-index)) + (let ((s5-10 (-> this task-index))) + (set! (-> this task-index) (get-next-task-up (-> this task-index) (-> this display-level-index))) + (if (!= s5-10 (-> this task-index)) (sound-play "cursor-l-r") ) ) diff --git a/test/decompiler/reference/jak1/engine/ui/text-h_REF.gc b/test/decompiler/reference/jak1/engine/ui/text-h_REF.gc index 0fd3cba0b8..3e558b334f 100644 --- a/test/decompiler/reference/jak1/engine/ui/text-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/text-h_REF.gc @@ -13,11 +13,11 @@ ) ;; definition for method 3 of type game-text -(defmethod inspect game-text ((obj game-text)) - (format #t "[~8x] ~A~%" obj 'game-text) - (format #t "~Tid: ~D~%" (-> obj id)) - (format #t "~Ttext: ~A~%" (-> obj text)) - obj +(defmethod inspect game-text ((this game-text)) + (format #t "[~8x] ~A~%" this 'game-text) + (format #t "~Tid: ~D~%" (-> this id)) + (format #t "~Ttext: ~A~%" (-> this text)) + this ) ;; definition of type game-text-info @@ -36,14 +36,13 @@ ) ;; definition for method 3 of type game-text-info -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-text-info ((obj game-text-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tlanguage-id: ~D~%" (-> obj language-id)) - (format #t "~Tgroup-name: ~A~%" (-> obj group-name)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect game-text-info ((this game-text-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tlanguage-id: ~D~%" (-> this language-id)) + (format #t "~Tgroup-name: ~A~%" (-> this group-name)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; definition for symbol *text-group-names*, type (array string) diff --git a/test/decompiler/reference/jak1/engine/ui/text_REF.gc b/test/decompiler/reference/jak1/engine/ui/text_REF.gc index d8d300b4dc..208070c119 100644 --- a/test/decompiler/reference/jak1/engine/ui/text_REF.gc +++ b/test/decompiler/reference/jak1/engine/ui/text_REF.gc @@ -21,58 +21,57 @@ ) ;; definition for method 4 of type game-text-info -(defmethod length game-text-info ((obj game-text-info)) - (-> obj length) +(defmethod length game-text-info ((this game-text-info)) + (-> this length) ) ;; definition for method 5 of type game-text-info ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of game-text-info ((obj game-text-info)) - (the-as int (+ (-> obj type size) (* (-> obj length) 8))) +(defmethod asize-of game-text-info ((this game-text-info)) + (the-as int (+ (-> this type size) (* (-> this length) 8))) ) ;; definition for method 3 of type game-text-info -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-text-info ((obj game-text-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] #x~X ~A~%" s5-0 (-> obj data s5-0 id) (-> obj data s5-0 text)) +(defmethod inspect game-text-info ((this game-text-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] #x~X ~A~%" s5-0 (-> this data s5-0 id) (-> this data s5-0 text)) ) - obj + this ) ;; definition for method 8 of type game-text-info -(defmethod mem-usage game-text-info ((obj game-text-info) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage game-text-info ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (+! (-> arg0 data 80 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 80 used) v1-6) (+! (-> arg0 data 80 total) (logand -16 (+ v1-6 15))) ) - (dotimes (s4-0 (-> obj length)) + (dotimes (s4-0 (-> this length)) (set! (-> arg0 length) (max 81 (-> arg0 length))) (set! (-> arg0 data 80 name) "string") (+! (-> arg0 data 80 count) 1) - (let ((v1-18 (asize-of (-> obj data s4-0 text)))) + (let ((v1-18 (asize-of (-> this data s4-0 text)))) (+! (-> arg0 data 80 used) v1-18) (+! (-> arg0 data 80 total) (logand -16 (+ v1-18 15))) ) ) - obj + this ) ;; definition for method 9 of type game-text-info -(defmethod lookup-text! game-text-info ((obj game-text-info) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text! game-text-info ((this game-text-info) (arg0 text-id) (arg1 symbol)) (let* ((a1-1 0) - (a3-0 (+ (-> obj length) 1)) + (a3-0 (+ (-> this length) 1)) (v1-2 (/ (+ a1-1 a3-0) 2)) ) (let ((t0-0 -1)) - (while (and (!= (-> obj data v1-2 id) arg0) (!= v1-2 t0-0)) - (if (< (the-as uint arg0) (the-as uint (-> obj data v1-2 id))) + (while (and (!= (-> this data v1-2 id) arg0) (!= v1-2 t0-0)) + (if (< (the-as uint arg0) (the-as uint (-> this data v1-2 id))) (set! a3-0 v1-2) (set! a1-1 v1-2) ) @@ -81,7 +80,7 @@ ) ) (cond - ((!= (-> obj data v1-2 id) arg0) + ((!= (-> this data v1-2 id) arg0) (cond (arg1 (the-as string #f) @@ -93,7 +92,7 @@ ) ) (else - (-> obj data v1-2 text) + (-> this data v1-2 text) ) ) ) diff --git a/test/decompiler/reference/jak1/engine/util/capture_REF.gc b/test/decompiler/reference/jak1/engine/util/capture_REF.gc index 1d1d501711..625bcfcdd1 100644 --- a/test/decompiler/reference/jak1/engine/util/capture_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/capture_REF.gc @@ -26,21 +26,21 @@ ;; definition for method 3 of type gs-store-image-packet ;; INFO: Used lq/sq -(defmethod inspect gs-store-image-packet ((obj gs-store-image-packet)) - (format #t "[~8x] ~A~%" obj 'gs-store-image-packet) - (format #t "~Tvifcode[4] @ #x~X~%" (-> obj vifcode)) - (format #t "~Tgiftag: ~D~%" (-> obj giftag)) - (format #t "~Tbitbltbuf: ~D~%" (-> obj bitbltbuf)) - (format #t "~Tbitbltbuf-addr: ~D~%" (-> obj bitbltbuf-addr)) - (format #t "~Ttrxpos: ~D~%" (-> obj trxpos)) - (format #t "~Ttrxpos-addr: ~D~%" (-> obj trxpos-addr)) - (format #t "~Ttrxreg: ~D~%" (-> obj trxreg)) - (format #t "~Ttrxreg-addr: ~D~%" (-> obj trxreg-addr)) - (format #t "~Tfinish: ~D~%" (-> obj finish)) - (format #t "~Tfinish-addr: ~D~%" (-> obj finish-addr)) - (format #t "~Ttrxdir: ~D~%" (-> obj trxdir)) - (format #t "~Ttrxdir-addr: ~D~%" (-> obj trxdir-addr)) - obj +(defmethod inspect gs-store-image-packet ((this gs-store-image-packet)) + (format #t "[~8x] ~A~%" this 'gs-store-image-packet) + (format #t "~Tvifcode[4] @ #x~X~%" (-> this vifcode)) + (format #t "~Tgiftag: ~D~%" (-> this giftag)) + (format #t "~Tbitbltbuf: ~D~%" (-> this bitbltbuf)) + (format #t "~Tbitbltbuf-addr: ~D~%" (-> this bitbltbuf-addr)) + (format #t "~Ttrxpos: ~D~%" (-> this trxpos)) + (format #t "~Ttrxpos-addr: ~D~%" (-> this trxpos-addr)) + (format #t "~Ttrxreg: ~D~%" (-> this trxreg)) + (format #t "~Ttrxreg-addr: ~D~%" (-> this trxreg-addr)) + (format #t "~Tfinish: ~D~%" (-> this finish)) + (format #t "~Tfinish-addr: ~D~%" (-> this finish-addr)) + (format #t "~Ttrxdir: ~D~%" (-> this trxdir)) + (format #t "~Ttrxdir-addr: ~D~%" (-> this trxdir-addr)) + this ) ;; definition for function gs-set-default-store-image diff --git a/test/decompiler/reference/jak1/engine/util/glist-h_REF.gc b/test/decompiler/reference/jak1/engine/util/glist-h_REF.gc index b717c46465..e67e95272d 100644 --- a/test/decompiler/reference/jak1/engine/util/glist-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/glist-h_REF.gc @@ -15,11 +15,11 @@ ) ;; definition for method 3 of type glst-node -(defmethod inspect glst-node ((obj glst-node)) - (format #t "[~8x] ~A~%" obj 'glst-node) - (format #t "~Tnext: #~%" (-> obj next)) - (format #t "~Tprev: #~%" (-> obj prev)) - obj +(defmethod inspect glst-node ((this glst-node)) + (format #t "[~8x] ~A~%" this 'glst-node) + (format #t "~Tnext: #~%" (-> this next)) + (format #t "~Tprev: #~%" (-> this prev)) + this ) ;; definition of type glst-named-node @@ -32,12 +32,12 @@ ) ;; definition for method 3 of type glst-named-node -(defmethod inspect glst-named-node ((obj glst-named-node)) - (format #t "[~8x] ~A~%" obj 'glst-named-node) - (format #t "~Tnext: #~%" (-> obj next)) - (format #t "~Tprev: #~%" (-> obj prev)) - (format #t "~Tprivname: ~A~%" (-> obj privname)) - obj +(defmethod inspect glst-named-node ((this glst-named-node)) + (format #t "[~8x] ~A~%" this 'glst-named-node) + (format #t "~Tnext: #~%" (-> this next)) + (format #t "~Tprev: #~%" (-> this prev)) + (format #t "~Tprivname: ~A~%" (-> this privname)) + this ) ;; definition of type glst-list @@ -54,13 +54,13 @@ ) ;; definition for method 3 of type glst-list -(defmethod inspect glst-list ((obj glst-list)) - (format #t "[~8x] ~A~%" obj 'glst-list) - (format #t "~Thead: #~%" (-> obj head)) - (format #t "~Ttail: #~%" (-> obj tail)) - (format #t "~Ttailpred: #~%" (-> obj tailpred)) - (format #t "~Tnumelem: ~D~%" (-> obj numelem)) - obj +(defmethod inspect glst-list ((this glst-list)) + (format #t "[~8x] ~A~%" this 'glst-list) + (format #t "~Thead: #~%" (-> this head)) + (format #t "~Ttail: #~%" (-> this tail)) + (format #t "~Ttailpred: #~%" (-> this tailpred)) + (format #t "~Tnumelem: ~D~%" (-> this numelem)) + this ) ;; definition for function glst-next diff --git a/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc b/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc index a111eddb45..0ee0b08b98 100644 --- a/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/smush-control-h_REF.gc @@ -26,55 +26,55 @@ ) ;; definition for method 3 of type smush-control -(defmethod inspect smush-control ((obj smush-control)) - (format #t "[~8x] ~A~%" obj 'smush-control) - (format #t "~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~Tperiod: ~f~%" (-> obj period)) - (format #t "~Tduration: ~f~%" (-> obj duration)) - (format #t "~Tamp: ~f~%" (-> obj amp)) - (format #t "~Tdamp-amp: ~f~%" (-> obj damp-amp)) - (format #t "~Tdamp-period: ~f~%" (-> obj damp-period)) - (format #t "~Tticks: ~f~%" (-> obj ticks)) - obj +(defmethod inspect smush-control ((this smush-control)) + (format #t "[~8x] ~A~%" this 'smush-control) + (format #t "~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~Tperiod: ~f~%" (-> this period)) + (format #t "~Tduration: ~f~%" (-> this duration)) + (format #t "~Tamp: ~f~%" (-> this amp)) + (format #t "~Tdamp-amp: ~f~%" (-> this damp-amp)) + (format #t "~Tdamp-period: ~f~%" (-> this damp-period)) + (format #t "~Tticks: ~f~%" (-> this ticks)) + this ) ;; definition for method 13 of type smush-control -(defmethod nonzero-amplitude? smush-control ((obj smush-control)) - (!= (-> obj amp) 0.0) +(defmethod nonzero-amplitude? smush-control ((this smush-control)) + (!= (-> this amp) 0.0) ) ;; definition for method 9 of type smush-control -(defmethod set-zero! smush-control ((obj smush-control)) - (set! (-> obj period) 0.0) - (set! (-> obj duration) 0.0) - (set! (-> obj amp) 0.0) - (set! (-> obj damp-amp) 0.0) - (set! (-> obj damp-period) 0.0) - (set! (-> obj ticks) 0.0) - obj +(defmethod set-zero! smush-control ((this smush-control)) + (set! (-> this period) 0.0) + (set! (-> this duration) 0.0) + (set! (-> this amp) 0.0) + (set! (-> this damp-amp) 0.0) + (set! (-> this damp-period) 0.0) + (set! (-> this ticks) 0.0) + this ) ;; definition for method 10 of type smush-control -(defmethod update! smush-control ((obj smush-control)) +(defmethod update! smush-control ((this smush-control)) (cond - ((!= (-> obj amp) 0.0) - (let* ((f30-0 (the float (- (-> *display* base-frame-counter) (-> obj start-time)))) - (f0-2 (-> obj period)) + ((!= (-> this amp) 0.0) + (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) + (f0-2 (-> this period)) (f28-0 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) ) - (when (>= (- f30-0 (-> obj ticks)) (-> obj period)) - (set! (-> obj amp) (* (-> obj amp) (-> obj damp-amp))) - (set! (-> obj period) (* (-> obj period) (-> obj damp-period))) - (set! (-> obj ticks) f30-0) - (if (< (-> obj damp-period) 0.0) - (set-zero! obj) + (when (>= (- f30-0 (-> this ticks)) (-> this period)) + (set! (-> this amp) (* (-> this amp) (-> this damp-amp))) + (set! (-> this period) (* (-> this period) (-> this damp-period))) + (set! (-> this ticks) f30-0) + (if (< (-> this damp-period) 0.0) + (set-zero! this) ) ) - (if (>= f30-0 (-> obj duration)) - (set-zero! obj) + (if (>= f30-0 (-> this duration)) + (set-zero! this) ) - (* (sin (/ (* 65536.0 f28-0) (-> obj period))) - (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + (* (sin (/ (* 65536.0 f28-0) (-> this period))) + (* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration))) ) ) ) @@ -85,15 +85,15 @@ ) ;; definition for method 11 of type smush-control -(defmethod get-no-update smush-control ((obj smush-control)) +(defmethod get-no-update smush-control ((this smush-control)) (cond - ((!= (-> obj amp) 0.0) - (let* ((f30-0 (the float (- (-> *display* base-frame-counter) (-> obj start-time)))) - (f0-2 (-> obj period)) + ((!= (-> this amp) 0.0) + (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) + (f0-2 (-> this period)) (f0-4 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) ) - (* (sin (/ (* 65536.0 f0-4) (-> obj period))) - (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + (* (sin (/ (* 65536.0 f0-4) (-> this period))) + (* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration))) ) ) ) @@ -104,23 +104,23 @@ ) ;; definition for method 14 of type smush-control -(defmethod die-on-next-update! smush-control ((obj smush-control)) - (if (!= (-> obj amp) 0.0) - (set! (-> obj damp-period) -1.0) +(defmethod die-on-next-update! smush-control ((this smush-control)) + (if (!= (-> this amp) 0.0) + (set! (-> this damp-period) -1.0) ) - obj + this ) ;; definition for method 12 of type smush-control -(defmethod activate! smush-control ((obj smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float)) - (when (>= (fabs (* 0.2 (-> obj amp))) (fabs (get-no-update obj))) - (set! (-> obj amp) arg0) - (set! (-> obj period) (the float arg1)) - (set! (-> obj duration) (the float arg2)) - (set! (-> obj damp-amp) arg3) - (set! (-> obj damp-period) arg4) - (set! (-> obj ticks) 0.0) - (set! (-> obj start-time) (-> *display* base-frame-counter)) +(defmethod activate! smush-control ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float)) + (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) + (set! (-> this amp) arg0) + (set! (-> this period) (the float arg1)) + (set! (-> this duration) (the float arg2)) + (set! (-> this damp-amp) arg3) + (set! (-> this damp-period) arg4) + (set! (-> this ticks) 0.0) + (set-time! (-> this start-time)) ) - obj + this ) diff --git a/test/decompiler/reference/jak1/engine/util/sync-info-h_REF.gc b/test/decompiler/reference/jak1/engine/util/sync-info-h_REF.gc index 6a1b00d12a..cf87e03a06 100644 --- a/test/decompiler/reference/jak1/engine/util/sync-info-h_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/sync-info-h_REF.gc @@ -24,11 +24,11 @@ ) ;; definition for method 3 of type sync-info -(defmethod inspect sync-info ((obj sync-info)) - (format #t "[~8x] ~A~%" obj 'sync-info) - (format #t "~Toffset: ~f~%" (-> obj offset)) - (format #t "~Tperiod: ~D~%" (-> obj period)) - obj +(defmethod inspect sync-info ((this sync-info)) + (format #t "[~8x] ~A~%" this 'sync-info) + (format #t "~Toffset: ~f~%" (-> this offset)) + (format #t "~Tperiod: ~D~%" (-> this period)) + this ) ;; definition of type sync-info-eased @@ -46,16 +46,16 @@ ) ;; definition for method 3 of type sync-info-eased -(defmethod inspect sync-info-eased ((obj sync-info-eased)) - (format #t "[~8x] ~A~%" obj 'sync-info-eased) - (format #t "~Toffset: ~f~%" (-> obj offset)) - (format #t "~Tperiod: ~D~%" (-> obj period)) - (format #t "~Ttlo: ~f~%" (-> obj tlo)) - (format #t "~Tthi: ~f~%" (-> obj thi)) - (format #t "~Tylo: ~f~%" (-> obj ylo)) - (format #t "~Tm2: ~f~%" (-> obj m2)) - (format #t "~Tyend: ~f~%" (-> obj yend)) - obj +(defmethod inspect sync-info-eased ((this sync-info-eased)) + (format #t "[~8x] ~A~%" this 'sync-info-eased) + (format #t "~Toffset: ~f~%" (-> this offset)) + (format #t "~Tperiod: ~D~%" (-> this period)) + (format #t "~Ttlo: ~f~%" (-> this tlo)) + (format #t "~Tthi: ~f~%" (-> this thi)) + (format #t "~Tylo: ~f~%" (-> this ylo)) + (format #t "~Tm2: ~f~%" (-> this m2)) + (format #t "~Tyend: ~f~%" (-> this yend)) + this ) ;; definition of type sync-info-paused @@ -70,13 +70,13 @@ ) ;; definition for method 3 of type sync-info-paused -(defmethod inspect sync-info-paused ((obj sync-info-paused)) - (format #t "[~8x] ~A~%" obj 'sync-info-paused) - (format #t "~Toffset: ~f~%" (-> obj offset)) - (format #t "~Tperiod: ~D~%" (-> obj period)) - (format #t "~Tpause-after-out: ~f~%" (-> obj pause-after-out)) - (format #t "~Tpause-after-in: ~f~%" (-> obj pause-after-in)) - obj +(defmethod inspect sync-info-paused ((this sync-info-paused)) + (format #t "[~8x] ~A~%" this 'sync-info-paused) + (format #t "~Toffset: ~f~%" (-> this offset)) + (format #t "~Tperiod: ~D~%" (-> this period)) + (format #t "~Tpause-after-out: ~f~%" (-> this pause-after-out)) + (format #t "~Tpause-after-in: ~f~%" (-> this pause-after-in)) + this ) ;; definition of type delayed-rand-float @@ -99,15 +99,15 @@ ) ;; definition for method 3 of type delayed-rand-float -(defmethod inspect delayed-rand-float ((obj delayed-rand-float)) - (format #t "[~8x] ~A~%" obj 'delayed-rand-float) - (format #t "~Tmin-time: ~D~%" (-> obj min-time)) - (format #t "~Tmax-time: ~D~%" (-> obj max-time)) - (format #t "~Tmax-val: ~f~%" (-> obj max-val)) - (format #t "~Ttimer: ~D~%" (-> obj timer)) - (format #t "~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~Tvalue: ~f~%" (-> obj value)) - obj +(defmethod inspect delayed-rand-float ((this delayed-rand-float)) + (format #t "[~8x] ~A~%" this 'delayed-rand-float) + (format #t "~Tmin-time: ~D~%" (-> this min-time)) + (format #t "~Tmax-time: ~D~%" (-> this max-time)) + (format #t "~Tmax-val: ~f~%" (-> this max-val)) + (format #t "~Ttimer: ~D~%" (-> this timer)) + (format #t "~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~Tvalue: ~f~%" (-> this value)) + this ) ;; definition of type oscillating-float @@ -130,15 +130,15 @@ ) ;; definition for method 3 of type oscillating-float -(defmethod inspect oscillating-float ((obj oscillating-float)) - (format #t "[~8x] ~A~%" obj 'oscillating-float) - (format #t "~Tvalue: ~f~%" (-> obj value)) - (format #t "~Ttarget: ~f~%" (-> obj target)) - (format #t "~Tvel: ~f~%" (-> obj vel)) - (format #t "~Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~Tdamping: ~f~%" (-> obj damping)) - (format #t "~Taccel: ~f~%" (-> obj accel)) - obj +(defmethod inspect oscillating-float ((this oscillating-float)) + (format #t "[~8x] ~A~%" this 'oscillating-float) + (format #t "~Tvalue: ~f~%" (-> this value)) + (format #t "~Ttarget: ~f~%" (-> this target)) + (format #t "~Tvel: ~f~%" (-> this vel)) + (format #t "~Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~Tdamping: ~f~%" (-> this damping)) + (format #t "~Taccel: ~f~%" (-> this accel)) + this ) ;; definition of type bouncing-float @@ -162,14 +162,14 @@ ) ;; definition for method 3 of type bouncing-float -(defmethod inspect bouncing-float ((obj bouncing-float)) - (format #t "[~8x] ~A~%" obj 'bouncing-float) - (format #t "~Tosc: #~%" (-> obj osc)) - (format #t "~Tmax-value: ~f~%" (-> obj max-value)) - (format #t "~Tmin-value: ~f~%" (-> obj min-value)) - (format #t "~Telasticity: ~f~%" (-> obj elasticity)) - (format #t "~Tstate: ~D~%" (-> obj state)) - obj +(defmethod inspect bouncing-float ((this bouncing-float)) + (format #t "[~8x] ~A~%" this 'bouncing-float) + (format #t "~Tosc: #~%" (-> this osc)) + (format #t "~Tmax-value: ~f~%" (-> this max-value)) + (format #t "~Tmin-value: ~f~%" (-> this min-value)) + (format #t "~Telasticity: ~f~%" (-> this elasticity)) + (format #t "~Tstate: ~D~%" (-> this state)) + this ) ;; definition of type delayed-rand-vector @@ -194,16 +194,16 @@ ) ;; definition for method 3 of type delayed-rand-vector -(defmethod inspect delayed-rand-vector ((obj delayed-rand-vector)) - (format #t "[~8x] ~A~%" obj 'delayed-rand-vector) - (format #t "~Tmin-time: ~D~%" (-> obj min-time)) - (format #t "~Tmax-time: ~D~%" (-> obj max-time)) - (format #t "~Txz-max: ~f~%" (-> obj xz-max)) - (format #t "~Ty-max: ~f~%" (-> obj y-max)) - (format #t "~Ttimer: ~D~%" (-> obj timer)) - (format #t "~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~Tvalue: #~%" (-> obj value)) - obj +(defmethod inspect delayed-rand-vector ((this delayed-rand-vector)) + (format #t "[~8x] ~A~%" this 'delayed-rand-vector) + (format #t "~Tmin-time: ~D~%" (-> this min-time)) + (format #t "~Tmax-time: ~D~%" (-> this max-time)) + (format #t "~Txz-max: ~f~%" (-> this xz-max)) + (format #t "~Ty-max: ~f~%" (-> this y-max)) + (format #t "~Ttimer: ~D~%" (-> this timer)) + (format #t "~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~Tvalue: #~%" (-> this value)) + this ) ;; definition of type oscillating-vector @@ -225,15 +225,15 @@ ) ;; definition for method 3 of type oscillating-vector -(defmethod inspect oscillating-vector ((obj oscillating-vector)) - (format #t "[~8x] ~A~%" obj 'oscillating-vector) - (format #t "~Tvalue: #~%" (-> obj value)) - (format #t "~Ttarget: #~%" (-> obj target)) - (format #t "~Tvel: #~%" (-> obj vel)) - (format #t "~Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~Tdamping: ~f~%" (-> obj damping)) - (format #t "~Taccel: ~f~%" (-> obj accel)) - obj +(defmethod inspect oscillating-vector ((this oscillating-vector)) + (format #t "[~8x] ~A~%" this 'oscillating-vector) + (format #t "~Tvalue: #~%" (-> this value)) + (format #t "~Ttarget: #~%" (-> this target)) + (format #t "~Tvel: #~%" (-> this vel)) + (format #t "~Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~Tdamping: ~f~%" (-> this damping)) + (format #t "~Taccel: ~f~%" (-> this accel)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc b/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc index fb4a818a98..0e18d0364a 100644 --- a/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc +++ b/test/decompiler/reference/jak1/engine/util/sync-info_REF.gc @@ -3,12 +3,12 @@ ;; definition for method 14 of type sync-info ;; INFO: Return type mismatch int vs none. -(defmethod setup-params! sync-info ((obj sync-info) (period uint) (phase float) (arg2 float) (arg3 float)) - (set! (-> obj period) period) +(defmethod setup-params! sync-info ((this sync-info) (period uint) (phase float) (arg2 float) (arg3 float)) + (set! (-> this period) period) (let* ((period-float (the float period)) (value (* phase period-float)) ) - (set! (-> obj offset) (- value (* (the float (the int (/ value period-float))) period-float))) + (set! (-> this offset) (- value (* (the float (the int (/ value period-float))) period-float))) ) 0 (none) @@ -16,12 +16,12 @@ ;; definition for method 14 of type sync-info-eased ;; INFO: Return type mismatch int vs none. -(defmethod setup-params! sync-info-eased ((obj sync-info-eased) (period uint) (phase float) (out-param float) (in-param float)) - (set! (-> obj period) period) +(defmethod setup-params! sync-info-eased ((this sync-info-eased) (period uint) (phase float) (out-param float) (in-param float)) + (set! (-> this period) period) (let* ((period-float (the float period)) (value (* phase period-float)) ) - (set! (-> obj offset) (- value (* (the float (the int (/ value period-float))) period-float))) + (set! (-> this offset) (- value (* (the float (the int (/ value period-float))) period-float))) ) (if (< out-param 0.0) (set! out-param 0.0) @@ -48,11 +48,11 @@ (f4-3 (/ f0-10 (- 1.0 f1-12))) (y-end (+ (* (- 1.0 f1-12) (- 1.0 f1-12) f4-3) f3-3)) ) - (set! (-> obj tlo) f0-10) - (set! (-> obj thi) f1-12) - (set! (-> obj ylo) f2-5) - (set! (-> obj m2) f4-3) - (set! (-> obj yend) y-end) + (set! (-> this tlo) f0-10) + (set! (-> this thi) f1-12) + (set! (-> this ylo) f2-5) + (set! (-> this m2) f4-3) + (set! (-> this yend) y-end) ) ) 0 @@ -61,12 +61,12 @@ ;; definition for method 14 of type sync-info-paused ;; INFO: Return type mismatch int vs none. -(defmethod setup-params! sync-info-paused ((obj sync-info-paused) (period uint) (phase float) (out-param float) (in-param float)) - (set! (-> obj period) period) +(defmethod setup-params! sync-info-paused ((this sync-info-paused) (period uint) (phase float) (out-param float) (in-param float)) + (set! (-> this period) period) (let* ((f0-1 (the float period)) (f1-1 (* phase f0-1)) ) - (set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1))) + (set! (-> this offset) (- f1-1 (* (the float (the int (/ f1-1 f0-1))) f0-1))) ) (cond ((< out-param 0.0) @@ -84,15 +84,15 @@ (set! in-param (- 1.0 out-param)) ) ) - (set! (-> obj pause-after-in) in-param) - (set! (-> obj pause-after-out) out-param) + (set! (-> this pause-after-in) in-param) + (set! (-> this pause-after-out) out-param) 0 (none) ) ;; definition for method 15 of type sync-info ;; INFO: Used lq/sq -(defmethod load-params! sync-info ((obj sync-info) +(defmethod load-params! sync-info ((this sync-info) (proc process) (default-period uint) (default-phase float) @@ -105,7 +105,7 @@ (cond (v1-1 (setup-params! - obj + this (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) (-> (the-as (pointer float) v1-1) 1) 0.15 @@ -114,7 +114,7 @@ #t ) (else - (setup-params! obj default-period default-phase 0.15 0.15) + (setup-params! this default-period default-phase 0.15 0.15) #f ) ) @@ -123,7 +123,7 @@ ;; definition for method 15 of type sync-info-eased ;; INFO: Used lq/sq -(defmethod load-params! sync-info-eased ((obj sync-info-eased) +(defmethod load-params! sync-info-eased ((this sync-info-eased) (proc process) (default-period uint) (default-phase float) @@ -137,14 +137,14 @@ (v1-1 (if (>= (-> sv-16 elt-count) (the-as uint 4)) (setup-params! - obj + this (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) (-> (the-as (pointer float) v1-1) 1) (-> (the-as (pointer float) v1-1) 2) (-> (the-as (pointer float) v1-1) 3) ) (setup-params! - obj + this (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) (-> (the-as (pointer float) v1-1) 1) default-out @@ -154,7 +154,7 @@ #t ) (else - (setup-params! obj default-period default-phase default-out default-in) + (setup-params! this default-period default-phase default-out default-in) #f ) ) @@ -163,7 +163,7 @@ ;; definition for method 15 of type sync-info-paused ;; INFO: Used lq/sq -(defmethod load-params! sync-info-paused ((obj sync-info-paused) +(defmethod load-params! sync-info-paused ((this sync-info-paused) (proc process) (default-period uint) (default-phase float) @@ -177,14 +177,14 @@ (v1-1 (if (>= (-> sv-16 elt-count) (the-as uint 4)) (setup-params! - obj + this (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) (-> (the-as (pointer float) v1-1) 1) (-> (the-as (pointer float) v1-1) 2) (-> (the-as (pointer float) v1-1) 3) ) (setup-params! - obj + this (the-as uint (the int (* 300.0 (-> (the-as (pointer float) v1-1) 0)))) (-> (the-as (pointer float) v1-1) 1) default-out @@ -194,7 +194,7 @@ #t ) (else - (setup-params! obj default-period default-phase default-out default-in) + (setup-params! this default-period default-phase default-out default-in) #f ) ) @@ -202,70 +202,70 @@ ) ;; definition for method 10 of type sync-info -(defmethod get-current-phase-no-mod sync-info ((obj sync-info)) - (let* ((period (-> obj period)) +(defmethod get-current-phase-no-mod sync-info ((this sync-info)) + (let* ((period (-> this period)) (period-float (the float period)) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) ) (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) ) ) ;; definition for method 17 of type sync-info -(defmethod get-phase-offset sync-info ((obj sync-info)) - (/ (-> obj offset) (the float (-> obj period))) +(defmethod get-phase-offset sync-info ((this sync-info)) + (/ (-> this offset) (the float (-> this period))) ) ;; definition for method 16 of type sync-info -(defmethod sync-now! sync-info ((obj sync-info) (user-time-offset float)) - (let* ((period (-> obj period)) +(defmethod sync-now! sync-info ((this sync-info) (user-time-offset float)) + (let* ((period (-> this period)) (period-float (the float period)) (wrapped-user-offset (- user-time-offset (* (the float (the int (/ user-time-offset period-float))) period-float)) ) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) (current-time-wrapped (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) ) (combined-offset - (+ (* (- wrapped-user-offset current-time-wrapped) period-float) period-float (-> obj offset)) + (+ (* (- wrapped-user-offset current-time-wrapped) period-float) period-float (-> this offset)) ) ) - (set! (-> obj offset) + (set! (-> this offset) (- combined-offset (* (the float (the int (/ combined-offset period-float))) period-float)) ) ) ) ;; definition for method 11 of type sync-info -(defmethod get-current-phase sync-info ((obj sync-info)) - (let* ((period (-> obj period)) +(defmethod get-current-phase sync-info ((this sync-info)) + (let* ((period (-> this period)) (period-float (the float period)) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) ) (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) ) ) ;; definition for method 11 of type sync-info-paused -(defmethod get-current-phase sync-info-paused ((obj sync-info-paused)) - (let* ((period (-> obj period)) +(defmethod get-current-phase sync-info-paused ((this sync-info-paused)) + (let* ((period (-> this period)) (period-float (the float period)) (max-phase 1.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) ) (fmin max-phase (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) - (* period-float (- 1.0 (-> obj pause-after-out))) + (* period-float (- 1.0 (-> this pause-after-out))) ) ) ) ) ;; definition for method 9 of type sync-info -(defmethod get-current-value sync-info ((obj sync-info) (max-val float)) - (let* ((period (-> obj period)) +(defmethod get-current-value sync-info ((this sync-info) (max-val float)) + (let* ((period (-> this period)) (period-float (the float period)) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) ) (* (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) max-val @@ -274,16 +274,16 @@ ) ;; definition for method 9 of type sync-info-paused -(defmethod get-current-value sync-info-paused ((obj sync-info-paused) (arg0 float)) - (* (get-current-phase obj) arg0) +(defmethod get-current-value sync-info-paused ((this sync-info-paused) (arg0 float)) + (* (get-current-phase this) arg0) ) ;; definition for method 13 of type sync-info -(defmethod get-current-phase-with-mirror sync-info ((obj sync-info)) - (let* ((period (-> obj period)) +(defmethod get-current-phase-with-mirror sync-info ((this sync-info)) + (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) (phase-out-of-2 (* max-val (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) @@ -298,11 +298,11 @@ ) ;; definition for method 13 of type sync-info-eased -(defmethod get-current-phase-with-mirror sync-info-eased ((obj sync-info-eased)) - (let* ((period (-> obj period)) +(defmethod get-current-phase-with-mirror sync-info-eased ((this sync-info-eased)) + (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) (current-val (* max-val (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) @@ -314,21 +314,21 @@ (set! in-mirror? #t) (set! current-val (+ -1.0 current-val)) ) - (let* ((tlo (-> obj tlo)) + (let* ((tlo (-> this tlo)) (eased-phase (/ (cond ((< current-val tlo) (* current-val current-val) ) - ((< current-val (-> obj thi)) - (+ (* 2.0 tlo (- current-val tlo)) (-> obj ylo)) + ((< current-val (-> this thi)) + (+ (* 2.0 tlo (- current-val tlo)) (-> this ylo)) ) (else (let ((f1-7 (- 1.0 current-val))) - (- (-> obj yend) (* f1-7 f1-7 (-> obj m2))) + (- (-> this yend) (* f1-7 f1-7 (-> this m2))) ) ) ) - (-> obj yend) + (-> this yend) ) ) ) @@ -341,14 +341,14 @@ ) ;; definition for method 13 of type sync-info-paused -(defmethod get-current-phase-with-mirror sync-info-paused ((obj sync-info-paused)) - (let* ((v1-0 (-> obj period)) +(defmethod get-current-phase-with-mirror sync-info-paused ((this sync-info-paused)) + (let* ((v1-0 (-> this period)) (f1-0 (the float v1-0)) (f0-1 2.0) - (f2-2 (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) v1-0)) (-> obj offset))) + (f2-2 (+ (the float (mod (the-as uint (current-time)) v1-0)) (-> this offset))) (f0-2 (* f0-1 (/ (- f2-2 (* (the float (the int (/ f2-2 f1-0))) f1-0)) f1-0))) - (f1-3 (- 1.0 (* 2.0 (-> obj pause-after-in)))) - (f2-7 (- 1.0 (* 2.0 (-> obj pause-after-out)))) + (f1-3 (- 1.0 (* 2.0 (-> this pause-after-in)))) + (f2-7 (- 1.0 (* 2.0 (-> this pause-after-out)))) ) (cond ((>= f0-2 (+ 1.0 f1-3)) @@ -368,11 +368,11 @@ ) ;; definition for method 12 of type sync-info -(defmethod get-current-value-with-mirror sync-info ((obj sync-info) (max-out-val float)) - (let* ((period (-> obj period)) +(defmethod get-current-value-with-mirror sync-info ((this sync-info) (max-out-val float)) + (let* ((period (-> this period)) (period-float (the float period)) (max-val 2.0) - (current-time (+ (the float (mod (the-as uint (-> *display* base-frame-counter)) period)) (-> obj offset))) + (current-time (+ (the float (mod (the-as uint (current-time)) period)) (-> this offset))) (current-val (* max-val (/ (- current-time (* (the float (the int (/ current-time period-float))) period-float)) period-float) @@ -387,63 +387,64 @@ ) ;; definition for method 12 of type sync-info-eased -(defmethod get-current-value-with-mirror sync-info-eased ((obj sync-info-eased) (max-out-val float)) - (* (get-current-phase-with-mirror obj) max-out-val) +(defmethod get-current-value-with-mirror sync-info-eased ((this sync-info-eased) (max-out-val float)) + (* (get-current-phase-with-mirror this) max-out-val) ) ;; definition for method 12 of type sync-info-paused -(defmethod get-current-value-with-mirror sync-info-paused ((obj sync-info-paused) (max-out-val float)) - (* (get-current-phase-with-mirror obj) max-out-val) +(defmethod get-current-value-with-mirror sync-info-paused ((this sync-info-paused) (max-out-val float)) + (* (get-current-phase-with-mirror this) max-out-val) ) ;; definition for method 9 of type delayed-rand-float -(defmethod set-params! delayed-rand-float ((obj delayed-rand-float) (min-tim int) (max-time int) (max-times-two float)) - (set! (-> obj min-time) min-tim) - (set! (-> obj max-time) max-time) - (set! (-> obj max-val) (* 0.5 max-times-two)) - (set! (-> obj start-time) 0) - (set! (-> obj timer) 0) - (set! (-> obj value) 0.0) - (-> obj value) +(defmethod set-params! delayed-rand-float ((this delayed-rand-float) (min-tim int) (max-time int) (max-times-two float)) + (set! (-> this min-time) min-tim) + (set! (-> this max-time) max-time) + (set! (-> this max-val) (* 0.5 max-times-two)) + (set! (-> this start-time) 0) + (set! (-> this timer) 0) + (set! (-> this value) 0.0) + (-> this value) ) ;; definition for method 10 of type delayed-rand-float -(defmethod update! delayed-rand-float ((obj delayed-rand-float)) - (when (>= (- (-> *display* base-frame-counter) (-> obj start-time)) (-> obj timer)) - (set! (-> obj start-time) (-> *display* base-frame-counter)) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value) (rand-vu-float-range (- (-> obj max-val)) (-> obj max-val))) +(defmethod update! delayed-rand-float ((this delayed-rand-float)) + (when (time-elapsed? (-> this start-time) (-> this timer)) + (set-time! (-> this start-time)) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value) (rand-vu-float-range (- (-> this max-val)) (-> this max-val))) ) - (-> obj value) + (-> this value) ) ;; definition for method 9 of type oscillating-float -(defmethod set-params! oscillating-float ((obj oscillating-float) (init-val float) (accel float) (max-vel float) (damping float)) - (set! (-> obj value) init-val) - (set! (-> obj target) init-val) - (set! (-> obj vel) 0.0) - (set! (-> obj max-vel) max-vel) - (set! (-> obj damping) damping) - (set! (-> obj accel) accel) - (-> obj value) +(defmethod set-params! oscillating-float ((this oscillating-float) (init-val float) (accel float) (max-vel float) (damping float)) + (set! (-> this value) init-val) + (set! (-> this target) init-val) + (set! (-> this vel) 0.0) + (set! (-> this max-vel) max-vel) + (set! (-> this damping) damping) + (set! (-> this accel) accel) + (-> this value) ) ;; definition for method 10 of type oscillating-float -(defmethod update! oscillating-float ((obj oscillating-float) (target-offset float)) - (let ((acc - (* (- (+ (-> obj target) target-offset) (-> obj value)) (* (-> obj accel) (-> *display* time-adjust-ratio))) - ) +(defmethod update! oscillating-float ((this oscillating-float) (target-offset float)) + (let ((acc (* (- (+ (-> this target) target-offset) (-> this value)) + (* (-> this accel) (-> *display* time-adjust-ratio)) + ) + ) ) - (+! (-> obj vel) acc) + (+! (-> this vel) acc) ) - (set! (-> obj vel) (fmin (-> obj max-vel) (fmax (- (-> obj max-vel)) (-> obj vel)))) - (set! (-> obj vel) (* (-> obj vel) (-> obj damping))) - (+! (-> obj value) (* (-> obj vel) (-> *display* time-adjust-ratio))) - (-> obj value) + (set! (-> this vel) (fmin (-> this max-vel) (fmax (- (-> this max-vel)) (-> this vel)))) + (set! (-> this vel) (* (-> this vel) (-> this damping))) + (+! (-> this value) (* (-> this vel) (-> *display* time-adjust-ratio))) + (-> this value) ) ;; definition for method 9 of type bouncing-float -(defmethod set-params! bouncing-float ((obj bouncing-float) +(defmethod set-params! bouncing-float ((this bouncing-float) (init-val float) (max-val float) (min-val float) @@ -452,126 +453,126 @@ (max-vel float) (damping float) ) - (set-params! (-> obj osc) init-val accel max-vel damping) - (set! (-> obj max-value) max-val) - (set! (-> obj min-value) min-val) - (set! (-> obj elasticity) elast) - (set! (-> obj state) 0) - (-> obj osc value) + (set-params! (-> this osc) init-val accel max-vel damping) + (set! (-> this max-value) max-val) + (set! (-> this min-value) min-val) + (set! (-> this elasticity) elast) + (set! (-> this state) 0) + (-> this osc value) ) ;; definition for method 10 of type bouncing-float -(defmethod update! bouncing-float ((obj bouncing-float) (arg0 float)) - (update! (-> obj osc) arg0) - (set! (-> obj state) 0) - (when (>= (-> obj osc value) (-> obj max-value)) - (set! (-> obj osc value) (-> obj max-value)) - (if (< 0.0 (-> obj osc vel)) - (set! (-> obj osc vel) (* (-> obj osc vel) (- (-> obj elasticity)))) +(defmethod update! bouncing-float ((this bouncing-float) (arg0 float)) + (update! (-> this osc) arg0) + (set! (-> this state) 0) + (when (>= (-> this osc value) (-> this max-value)) + (set! (-> this osc value) (-> this max-value)) + (if (< 0.0 (-> this osc vel)) + (set! (-> this osc vel) (* (-> this osc vel) (- (-> this elasticity)))) ) - (set! (-> obj state) 1) + (set! (-> this state) 1) ) - (when (>= (-> obj min-value) (-> obj osc value)) - (set! (-> obj osc value) (-> obj min-value)) - (if (< (-> obj osc vel) 0.0) - (set! (-> obj osc vel) (* (-> obj osc vel) (- (-> obj elasticity)))) + (when (>= (-> this min-value) (-> this osc value)) + (set! (-> this osc value) (-> this min-value)) + (if (< (-> this osc vel) 0.0) + (set! (-> this osc vel) (* (-> this osc vel) (- (-> this elasticity)))) ) - (set! (-> obj state) -1) + (set! (-> this state) -1) ) - (-> obj osc value) + (-> this osc value) ) ;; definition for method 11 of type bouncing-float -(defmethod at-min? bouncing-float ((obj bouncing-float)) - (= (-> obj state) -1) +(defmethod at-min? bouncing-float ((this bouncing-float)) + (= (-> this state) -1) ) ;; definition for method 12 of type bouncing-float -(defmethod at-max? bouncing-float ((obj bouncing-float)) - (= (-> obj state) 1) +(defmethod at-max? bouncing-float ((this bouncing-float)) + (= (-> this state) 1) ) ;; definition for method 9 of type delayed-rand-vector -(defmethod set-params! delayed-rand-vector ((obj delayed-rand-vector) (min-time int) (max-time int) (xz-range float) (y-range float)) - (set! (-> obj min-time) min-time) - (set! (-> obj max-time) max-time) - (set! (-> obj xz-max) (* 0.5 xz-range)) - (set! (-> obj y-max) (* 0.5 y-range)) - (set! (-> obj start-time) 0) - (set! (-> obj timer) 0) - (vector-reset! (-> obj value)) - (-> obj value) +(defmethod set-params! delayed-rand-vector ((this delayed-rand-vector) (min-time int) (max-time int) (xz-range float) (y-range float)) + (set! (-> this min-time) min-time) + (set! (-> this max-time) max-time) + (set! (-> this xz-max) (* 0.5 xz-range)) + (set! (-> this y-max) (* 0.5 y-range)) + (set! (-> this start-time) 0) + (set! (-> this timer) 0) + (vector-reset! (-> this value)) + (-> this value) ) ;; definition for method 10 of type delayed-rand-vector -(defmethod update-now! delayed-rand-vector ((obj delayed-rand-vector)) - (set! (-> obj start-time) (-> *display* base-frame-counter)) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value x) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (set! (-> obj value y) (rand-vu-float-range (- (-> obj y-max)) (-> obj y-max))) - (set! (-> obj value z) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (-> obj value) +(defmethod update-now! delayed-rand-vector ((this delayed-rand-vector)) + (set-time! (-> this start-time)) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (set! (-> this value y) (rand-vu-float-range (- (-> this y-max)) (-> this y-max))) + (set! (-> this value z) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (-> this value) ) ;; definition for method 11 of type delayed-rand-vector -(defmethod update-with-delay! delayed-rand-vector ((obj delayed-rand-vector)) - (if (>= (- (-> *display* base-frame-counter) (-> obj start-time)) (-> obj timer)) - (update-now! obj) +(defmethod update-with-delay! delayed-rand-vector ((this delayed-rand-vector)) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (update-now! this) ) - (-> obj value) + (-> this value) ) ;; definition for method 12 of type delayed-rand-vector -(defmethod update-with-delay-or-reset! delayed-rand-vector ((obj delayed-rand-vector)) - (if (>= (- (-> *display* base-frame-counter) (-> obj start-time)) (-> obj timer)) - (update-now! obj) - (vector-reset! (-> obj value)) +(defmethod update-with-delay-or-reset! delayed-rand-vector ((this delayed-rand-vector)) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (update-now! this) + (vector-reset! (-> this value)) ) - (-> obj value) + (-> this value) ) ;; definition for method 9 of type oscillating-vector ;; INFO: Used lq/sq -(defmethod set-params! oscillating-vector ((obj oscillating-vector) (init-val vector) (accel float) (max-vel float) (damping float)) +(defmethod set-params! oscillating-vector ((this oscillating-vector) (init-val vector) (accel float) (max-vel float) (damping float)) (cond (init-val - (set! (-> obj value quad) (-> init-val quad)) - (set! (-> obj target quad) (-> init-val quad)) + (set! (-> this value quad) (-> init-val quad)) + (set! (-> this target quad) (-> init-val quad)) ) (else - (vector-reset! (-> obj value)) - (vector-reset! (-> obj target)) + (vector-reset! (-> this value)) + (vector-reset! (-> this target)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj max-vel) max-vel) - (set! (-> obj damping) damping) - (set! (-> obj accel) accel) - (-> obj value) + (vector-reset! (-> this vel)) + (set! (-> this max-vel) max-vel) + (set! (-> this damping) damping) + (set! (-> this accel) accel) + (-> this value) ) ;; definition for method 10 of type oscillating-vector -(defmethod update! oscillating-vector ((obj oscillating-vector) (target-offset vector)) +(defmethod update! oscillating-vector ((this oscillating-vector) (target-offset vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (cond (target-offset - (vector+! s5-0 (-> obj target) target-offset) - (vector-! s5-0 s5-0 (-> obj value)) + (vector+! s5-0 (-> this target) target-offset) + (vector-! s5-0 s5-0 (-> this value)) ) (else - (vector-! s5-0 (-> obj target) (-> obj value)) + (vector-! s5-0 (-> this target) (-> this value)) ) ) - (vector-float*! s5-0 s5-0 (* (-> obj accel) (-> *display* time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) s5-0) - (let ((vel (vector-length (-> obj vel)))) - (if (< (-> obj max-vel) vel) - (vector-float*! (-> obj vel) (-> obj vel) (/ (-> obj max-vel) vel)) + (vector-float*! s5-0 s5-0 (* (-> this accel) (-> *display* time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) s5-0) + (let ((vel (vector-length (-> this vel)))) + (if (< (-> this max-vel) vel) + (vector-float*! (-> this vel) (-> this vel) (/ (-> this max-vel) vel)) ) ) - (vector-float*! (-> obj vel) (-> obj vel) (-> obj damping)) - (vector-float*! s5-0 (-> obj vel) (-> *display* time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) s5-0) + (vector-float*! (-> this vel) (-> this vel) (-> this damping)) + (vector-float*! s5-0 (-> this vel) (-> *display* time-adjust-ratio)) + (vector+! (-> this value) (-> this value) s5-0) ) - (-> obj value) + (-> this value) ) diff --git a/test/decompiler/reference/jak1/kernel/dgo-h_REF.gc b/test/decompiler/reference/jak1/kernel/dgo-h_REF.gc index d33866dfa1..aab79fe33c 100644 --- a/test/decompiler/reference/jak1/kernel/dgo-h_REF.gc +++ b/test/decompiler/reference/jak1/kernel/dgo-h_REF.gc @@ -12,11 +12,11 @@ ) ;; definition for method 3 of type dgo-entry -(defmethod inspect dgo-entry ((obj dgo-entry)) - (format #t "[~8x] ~A~%" obj 'dgo-entry) - (format #t "~Toffset: ~D~%" (-> obj offset)) - (format #t "~Tlength: ~D~%" (-> obj length)) - obj +(defmethod inspect dgo-entry ((this dgo-entry)) + (format #t "[~8x] ~A~%" this 'dgo-entry) + (format #t "~Toffset: ~D~%" (-> this offset)) + (format #t "~Tlength: ~D~%" (-> this length)) + this ) ;; definition of type dgo-file @@ -32,13 +32,13 @@ ) ;; definition for method 3 of type dgo-file -(defmethod inspect dgo-file ((obj dgo-file)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-go-files: ~D~%" (-> obj num-go-files)) - (format #t "~Ttotal-length: ~D~%" (-> obj total-length)) - (format #t "~Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect dgo-file ((this dgo-file)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-go-files: ~D~%" (-> this num-go-files)) + (format #t "~Ttotal-length: ~D~%" (-> this total-length)) + (format #t "~Trsvd: ~D~%" (-> this rsvd)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/kernel/gcommon_REF.gc b/test/decompiler/reference/jak1/kernel/gcommon_REF.gc index 4c775144fd..c7259d8b9f 100644 --- a/test/decompiler/reference/jak1/kernel/gcommon_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gcommon_REF.gc @@ -2,8 +2,8 @@ (in-package goal) ;; definition for function identity -(defun identity ((obj object)) - obj +(defun identity ((this object)) + this ) ;; definition for function 1/ @@ -112,19 +112,19 @@ ) ;; definition for method 3 of type vec4s -(defmethod inspect vec4s ((obj vec4s)) - (format #t "[~8x] ~A~%" obj 'vec4s) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tz: ~f~%" (-> obj z)) - (format #t "~Tw: ~f~%" (-> obj w)) - obj +(defmethod inspect vec4s ((this vec4s)) + (format #t "[~8x] ~A~%" this 'vec4s) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tz: ~f~%" (-> this z)) + (format #t "~Tw: ~f~%" (-> this w)) + this ) ;; definition for method 2 of type vec4s -(defmethod print vec4s ((obj vec4s)) - (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) - obj +(defmethod print vec4s ((this vec4s)) + (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) + this ) ;; definition of type bfloat @@ -137,27 +137,27 @@ ) ;; definition for method 3 of type bfloat -(defmethod inspect bfloat ((obj bfloat)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tdata: ~f~%" (-> obj data)) - obj +(defmethod inspect bfloat ((this bfloat)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tdata: ~f~%" (-> this data)) + this ) ;; definition for method 2 of type bfloat -(defmethod print bfloat ((obj bfloat)) - (format #t "~f" (-> obj data)) - obj +(defmethod print bfloat ((this bfloat)) + (format #t "~f" (-> this data)) + this ) ;; definition for method 5 of type type ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of type ((obj type)) - (the-as int (logand (the-as uint #xfffffff0) (+ (* (-> obj allocated-length) 4) 43))) +(defmethod asize-of type ((this type)) + (the-as int (logand (the-as uint #xfffffff0) (+ (* (-> this allocated-length) 4) 43))) ) ;; definition for function basic-type? -(defun basic-type? ((obj basic) (parent-type type)) - (let ((obj-type (-> obj type)) +(defun basic-type? ((this basic) (parent-type type)) + (let ((obj-type (-> this type)) (end-type object) ) (until (= obj-type end-type) @@ -212,14 +212,14 @@ ) ;; definition for method 4 of type pair -(defmethod length pair ((obj pair)) +(defmethod length pair ((this pair)) (local-vars (result int)) (cond - ((null? obj) + ((null? this) (set! result 0) ) (else - (let ((iter (cdr obj))) + (let ((iter (cdr this))) (set! result 1) (while (and (not (null? iter)) (pair? iter)) (+! result 1) @@ -233,7 +233,7 @@ ;; definition for method 5 of type pair ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of pair ((obj pair)) +(defmethod asize-of pair ((this pair)) (the-as int (-> pair size)) ) @@ -250,9 +250,9 @@ ) ;; definition for function member -(defun member ((obj object) (lst object)) +(defun member ((this object) (lst object)) (let ((iter lst)) - (while (not (or (null? iter) (= (car iter) obj))) + (while (not (or (null? iter) (= (car iter) this))) (set! iter (cdr iter)) ) (if (not (null? iter)) @@ -262,8 +262,8 @@ ) ;; definition for function nmember -(defun nmember ((obj basic) (lst object)) - (while (not (or (null? lst) (name= (the-as basic (car lst)) obj))) +(defun nmember ((this basic) (lst object)) + (while (not (or (null? lst) (name= (the-as basic (car lst)) this))) (set! lst (cdr lst)) ) (if (not (null? lst)) @@ -446,302 +446,302 @@ ) ;; definition for method 3 of type inline-array-class -(defmethod inspect inline-array-class ((obj inline-array-class)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - obj +(defmethod inspect inline-array-class ((this inline-array-class)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + this ) ;; definition for method 0 of type inline-array-class (defmethod new inline-array-class ((allocation symbol) (type-to-make type) (size int)) - (let ((obj (object-new - allocation - type-to-make - (the-as int (+ (-> type-to-make size) (* (the-as uint size) (-> type-to-make heap-base)))) - ) - ) + (let ((this (object-new + allocation + type-to-make + (the-as int (+ (-> type-to-make size) (* (the-as uint size) (-> type-to-make heap-base)))) + ) + ) ) - (when (nonzero? obj) - (set! (-> obj length) size) - (set! (-> obj allocated-length) size) + (when (nonzero? this) + (set! (-> this length) size) + (set! (-> this allocated-length) size) ) - obj + this ) ) ;; definition for method 4 of type inline-array-class -(defmethod length inline-array-class ((obj inline-array-class)) - (-> obj length) +(defmethod length inline-array-class ((this inline-array-class)) + (-> this length) ) ;; definition for method 5 of type inline-array-class ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of inline-array-class ((obj inline-array-class)) - (the-as int (+ (-> obj type size) (* (-> obj allocated-length) (the-as int (-> obj type heap-base))))) +(defmethod asize-of inline-array-class ((this inline-array-class)) + (the-as int (+ (-> this type size) (* (-> this allocated-length) (the-as int (-> this type heap-base))))) ) ;; definition for method 0 of type array (defmethod new array ((allocation symbol) (type-to-make type) (content-type type) (len int)) - (let ((obj (object-new - allocation - type-to-make - (the-as int (+ (-> type-to-make size) (* len (if (type-type? content-type number) - (the-as int (-> content-type size)) - 4 - ) - ) - ) - ) - ) - ) + (let ((this (object-new + allocation + type-to-make + (the-as int (+ (-> type-to-make size) (* len (if (type-type? content-type number) + (the-as int (-> content-type size)) + 4 + ) + ) + ) + ) + ) + ) ) - (set! (-> obj allocated-length) len) - (set! (-> obj length) len) - (set! (-> obj content-type) content-type) - obj + (set! (-> this allocated-length) len) + (set! (-> this length) len) + (set! (-> this content-type) content-type) + this ) ) ;; definition for method 2 of type array ;; INFO: Used lq/sq -(defmethod print array ((obj array)) +(defmethod print array ((this array)) (format #t "#(") (cond - ((type-type? (-> obj content-type) integer) - (case (-> obj content-type symbol) + ((type-type? (-> this content-type) integer) + (case (-> this content-type symbol) (('int32) - (dotimes (s5-0 (-> obj length)) + (dotimes (s5-0 (-> this length)) (format #t (if (zero? s5-0) "~D" " ~D" ) - (-> (the-as (array int32) obj) s5-0) + (-> (the-as (array int32) this) s5-0) ) ) ) (('uint32) - (dotimes (s5-1 (-> obj length)) + (dotimes (s5-1 (-> this length)) (format #t (if (zero? s5-1) "~D" " ~D" ) - (-> (the-as (array uint32) obj) s5-1) + (-> (the-as (array uint32) this) s5-1) ) ) ) (('int64) - (dotimes (s5-2 (-> obj length)) + (dotimes (s5-2 (-> this length)) (format #t (if (zero? s5-2) "~D" " ~D" ) - (-> (the-as (array int64) obj) s5-2) + (-> (the-as (array int64) this) s5-2) ) ) ) (('uint64) - (dotimes (s5-3 (-> obj length)) + (dotimes (s5-3 (-> this length)) (format #t (if (zero? s5-3) "#x~X" " #x~X" ) - (-> (the-as (array uint64) obj) s5-3) + (-> (the-as (array uint64) this) s5-3) ) ) ) (('int8) - (dotimes (s5-4 (-> obj length)) + (dotimes (s5-4 (-> this length)) (format #t (if (zero? s5-4) "~D" " ~D" ) - (-> (the-as (array int8) obj) s5-4) + (-> (the-as (array int8) this) s5-4) ) ) ) (('uint8) - (dotimes (s5-5 (-> obj length)) + (dotimes (s5-5 (-> this length)) (format #t (if (zero? s5-5) "~D" " ~D" ) - (-> (the-as (array uint8) obj) s5-5) + (-> (the-as (array uint8) this) s5-5) ) ) ) (('int16) - (dotimes (s5-6 (-> obj length)) + (dotimes (s5-6 (-> this length)) (format #t (if (zero? s5-6) "~D" " ~D" ) - (-> (the-as (array int16) obj) s5-6) + (-> (the-as (array int16) this) s5-6) ) ) ) (('uint16) - (dotimes (s5-7 (-> obj length)) + (dotimes (s5-7 (-> this length)) (format #t (if (zero? s5-7) "~D" " ~D" ) - (-> (the-as (array uint16) obj) s5-7) + (-> (the-as (array uint16) this) s5-7) ) ) ) (('uint128 'int128) - (dotimes (s5-8 (-> obj length)) + (dotimes (s5-8 (-> this length)) (format #t (if (zero? s5-8) "#x~X" " #x~X" ) - (-> (the-as (array uint128) obj) s5-8) + (-> (the-as (array uint128) this) s5-8) ) ) ) (else - (dotimes (s5-9 (-> obj length)) + (dotimes (s5-9 (-> this length)) (format #t (if (zero? s5-9) "~D" " ~D" ) - (-> (the-as (array int32) obj) s5-9) + (-> (the-as (array int32) this) s5-9) ) ) ) ) ) - ((= (-> obj content-type) float) - (dotimes (s5-10 (-> obj length)) + ((= (-> this content-type) float) + (dotimes (s5-10 (-> this length)) (if (zero? s5-10) - (format #t "~f" (-> (the-as (array float) obj) s5-10)) - (format #t " ~f" (-> (the-as (array float) obj) s5-10)) + (format #t "~f" (-> (the-as (array float) this) s5-10)) + (format #t " ~f" (-> (the-as (array float) this) s5-10)) ) ) ) (else - (dotimes (s5-11 (-> obj length)) + (dotimes (s5-11 (-> this length)) (if (zero? s5-11) - (format #t "~A" (-> (the-as (array basic) obj) s5-11)) - (format #t " ~A" (-> (the-as (array basic) obj) s5-11)) + (format #t "~A" (-> (the-as (array basic) this) s5-11)) + (format #t " ~A" (-> (the-as (array basic) this) s5-11)) ) ) ) ) (format #t ")") - obj + this ) ;; definition for method 3 of type array ;; INFO: Used lq/sq -(defmethod inspect array ((obj array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tcontent-type: ~A~%" (-> obj content-type)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj data)) +(defmethod inspect array ((this array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tcontent-type: ~A~%" (-> this content-type)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this allocated-length) (-> this data)) (cond - ((type-type? (-> obj content-type) integer) - (case (-> obj content-type symbol) + ((type-type? (-> this content-type) integer) + (case (-> this content-type symbol) (('int32) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-0 (-> (the-as (array int32) obj) s5-0)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~D~%" s5-0 (-> (the-as (array int32) this) s5-0)) ) ) (('uint32) - (dotimes (s5-1 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-1 (-> (the-as (array uint32) obj) s5-1)) + (dotimes (s5-1 (-> this length)) + (format #t "~T [~D] ~D~%" s5-1 (-> (the-as (array uint32) this) s5-1)) ) ) (('int64) - (dotimes (s5-2 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-2 (-> (the-as (array int64) obj) s5-2)) + (dotimes (s5-2 (-> this length)) + (format #t "~T [~D] ~D~%" s5-2 (-> (the-as (array int64) this) s5-2)) ) ) (('uint64) - (dotimes (s5-3 (-> obj length)) - (format #t "~T [~D] #x~X~%" s5-3 (-> (the-as (array uint64) obj) s5-3)) + (dotimes (s5-3 (-> this length)) + (format #t "~T [~D] #x~X~%" s5-3 (-> (the-as (array uint64) this) s5-3)) ) ) (('int8) - (dotimes (s5-4 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-4 (-> (the-as (array int8) obj) s5-4)) + (dotimes (s5-4 (-> this length)) + (format #t "~T [~D] ~D~%" s5-4 (-> (the-as (array int8) this) s5-4)) ) ) (('uint8) - (dotimes (s5-5 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-5 (-> (the-as (array int8) obj) s5-5)) + (dotimes (s5-5 (-> this length)) + (format #t "~T [~D] ~D~%" s5-5 (-> (the-as (array int8) this) s5-5)) ) ) (('int16) - (dotimes (s5-6 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-6 (-> (the-as (array int16) obj) s5-6)) + (dotimes (s5-6 (-> this length)) + (format #t "~T [~D] ~D~%" s5-6 (-> (the-as (array int16) this) s5-6)) ) ) (('uint16) - (dotimes (s5-7 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-7 (-> (the-as (array uint16) obj) s5-7)) + (dotimes (s5-7 (-> this length)) + (format #t "~T [~D] ~D~%" s5-7 (-> (the-as (array uint16) this) s5-7)) ) ) (('int128 'uint128) - (dotimes (s5-8 (-> obj length)) - (format #t "~T [~D] #x~X~%" s5-8 (-> (the-as (array uint128) obj) s5-8)) + (dotimes (s5-8 (-> this length)) + (format #t "~T [~D] #x~X~%" s5-8 (-> (the-as (array uint128) this) s5-8)) ) ) (else - (dotimes (s5-9 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-9 (-> (the-as (array int32) obj) s5-9)) + (dotimes (s5-9 (-> this length)) + (format #t "~T [~D] ~D~%" s5-9 (-> (the-as (array int32) this) s5-9)) ) ) ) ) - ((= (-> obj content-type) float) - (dotimes (s5-10 (-> obj length)) - (format #t "~T [~D] ~f~%" s5-10 (-> (the-as (array float) obj) s5-10)) + ((= (-> this content-type) float) + (dotimes (s5-10 (-> this length)) + (format #t "~T [~D] ~f~%" s5-10 (-> (the-as (array float) this) s5-10)) ) ) (else - (dotimes (s5-11 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-11 (-> (the-as (array basic) obj) s5-11)) + (dotimes (s5-11 (-> this length)) + (format #t "~T [~D] ~A~%" s5-11 (-> (the-as (array basic) this) s5-11)) ) ) ) - obj + this ) ;; definition for method 4 of type array -(defmethod length array ((obj array)) - (-> obj length) +(defmethod length array ((this array)) + (-> this length) ) ;; definition for method 5 of type array ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of array ((obj array)) - (the-as int (+ (-> array size) (* (-> obj allocated-length) (if (type-type? (-> obj content-type) number) - (the-as int (-> obj content-type size)) - 4 - ) +(defmethod asize-of array ((this array)) + (the-as int (+ (-> array size) (* (-> this allocated-length) (if (type-type? (-> this content-type) number) + (the-as int (-> this content-type size)) + 4 + ) ) ) ) @@ -830,13 +830,13 @@ (define *print-column* (the-as binteger 0)) ;; definition for function print -;; WARN: Failed load: (set! v1-1 (l.wu (+ a0-0 -4))) at op 5 +;; ERROR: Failed load: (set! v1-1 (l.wu (+ a0-0 -4))) at op 5 (defun print ((arg0 object)) ((method-of-type (rtype-of arg0) print) arg0) ) ;; definition for function printl -;; WARN: Failed load: (set! v1-1 (l.wu (+ a0-1 -4))) at op 7 +;; ERROR: Failed load: (set! v1-1 (l.wu (+ a0-1 -4))) at op 7 (defun printl ((arg0 object)) (let ((a0-1 arg0)) ((method-of-type (rtype-of a0-1) print) a0-1) @@ -846,7 +846,7 @@ ) ;; definition for function inspect -;; WARN: Failed load: (set! v1-1 (l.wu (+ a0-0 -4))) at op 5 +;; ERROR: Failed load: (set! v1-1 (l.wu (+ a0-0 -4))) at op 5 (defun inspect ((arg0 object)) ((method-of-type (rtype-of arg0) inspect) arg0) ) @@ -893,33 +893,28 @@ ) ;; definition for function valid? -;; WARN: Failed load: (set! a0-23 (l.wu (+ a0-0 -4))) at op 190 -;; WARN: Failed load: (set! t1-1 (l.wu (+ a0-0 -4))) at op 211 -;; WARN: Failed load: (set! a0-25 (l.wu (+ a0-0 -4))) at op 222 -;; WARN: Failed load: (set! t1-2 (l.wu (+ a0-0 -4))) at op 238 -;; WARN: Failed load: (set! v1-28 (l.wu (+ a0-0 -4))) at op 159 -;; WARN: Failed load: (set! t1-0 (l.wu (+ a0-0 -4))) at op 175 +;; ERROR: Failed load: (set! a0-23 (l.wu (+ a0-0 -4))) at op 190 ;; ERROR: Unsupported inline assembly instruction kind - [daddu v1, v1, s7] ;; ERROR: Unsupported inline assembly instruction kind - [daddu v1, v1, s7] ;; ERROR: Unsupported inline assembly instruction kind - [daddu v1, v1, s7] -(defun valid? ((obj object) (expected-type type) (name basic) (allow-false basic) (print-dest object)) +(defun valid? ((this object) (expected-type type) (name basic) (allow-false basic) (print-dest object)) (local-vars (v1-11 int) (v1-44 int) (v1-48 int) (s7-0 none)) (let ((in-goal-mem - (and (>= (the-as uint obj) (the-as uint __START-OF-TABLE__)) (< (the-as uint obj) (the-as uint #x8000000))) + (and (>= (the-as uint this) (the-as uint __START-OF-TABLE__)) (< (the-as uint this) (the-as uint #x8000000))) ) ) (cond ((not expected-type) (cond - ((logtest? (the-as int obj) 3) + ((logtest? (the-as int this) 3) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object (misaligned)~%" obj name) + (format print-dest "ERROR: object #x~X ~S is not a valid object (misaligned)~%" this name) ) #f ) ((not in-goal-mem) (if name - (format print-dest "ERROR: object #x~X ~S is not a valid object (bad address)~%" obj name) + (format print-dest "ERROR: object #x~X ~S is not a valid object (bad address)~%" this name) ) #f ) @@ -928,17 +923,17 @@ ) ) ) - ((and allow-false (not obj)) + ((and allow-false (not this)) #t ) ((= expected-type structure) (cond - ((logtest? (the-as int obj) 15) + ((logtest? (the-as int this) 15) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" - obj + this name expected-type ) @@ -949,14 +944,14 @@ (let ((v1-10 #x8000)) (.daddu v1-11 v1-10 s7-0) ) - (< (the-as uint obj) (the-as uint v1-11)) + (< (the-as uint this) (the-as uint v1-11)) ) ) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" - obj + this name expected-type ) @@ -970,12 +965,12 @@ ) ((= expected-type pair) (cond - ((!= (logand (the-as int obj) 7) 2) + ((!= (logand (the-as int this) 7) 2) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" - obj + this name expected-type ) @@ -987,7 +982,7 @@ (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" - obj + this name expected-type ) @@ -1001,7 +996,7 @@ ) ((= expected-type binteger) (cond - ((not (logtest? (the-as int obj) 7)) + ((not (logtest? (the-as int this) 7)) #t ) (else @@ -1009,7 +1004,7 @@ (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" - obj + this name expected-type ) @@ -1018,12 +1013,12 @@ ) ) ) - ((!= (logand (the-as int obj) 7) 4) + ((!= (logand (the-as int this) 7) 4) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (misaligned)~%" - obj + this name expected-type ) @@ -1035,48 +1030,48 @@ (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (bad address)~%" - obj + this name expected-type ) ) #f ) - ((and (= expected-type type) (!= (rtype-of obj) type)) + ((and (= expected-type type) (!= (rtype-of this) type)) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (invalid type #x~X)~%" - obj + this name expected-type - (rtype-of obj) + (rtype-of this) ) ) #f ) - ((and (!= expected-type type) (not (valid? (rtype-of obj) type #f #t 0))) + ((and (!= expected-type type) (not (valid? (rtype-of this) type #f #t 0))) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (invalid type #x~X)~%" - obj + this name expected-type - (rtype-of obj) + (rtype-of this) ) ) #f ) - ((not (type-type? (rtype-of obj) expected-type)) + ((not (type-type? (rtype-of this) expected-type)) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (is type '~A' instead)~%" - obj + this name expected-type - (rtype-of obj) + (rtype-of this) ) ) #f @@ -1086,12 +1081,12 @@ (.daddu v1-44 v1-43 s7-0) ) (cond - ((>= (the-as uint obj) (the-as uint v1-44)) + ((>= (the-as uint this) (the-as uint v1-44)) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (not in symbol table)~%" - obj + this name expected-type ) @@ -1107,13 +1102,13 @@ (let ((v1-47 #x8000)) (.daddu v1-48 v1-47 s7-0) ) - (< (the-as uint obj) (the-as uint v1-48)) + (< (the-as uint this) (the-as uint v1-48)) ) (if name (format print-dest "ERROR: object #x~X ~S is not a valid object of type '~A' (inside symbol table)~%" - obj + this name expected-type ) diff --git a/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc b/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc index 1fc5e99dc6..bfb29db4d5 100644 --- a/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gkernel-h_REF.gc @@ -21,20 +21,20 @@ ) ;; definition for method 3 of type kernel-context -(defmethod inspect kernel-context ((obj kernel-context)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tprevent-from-run: ~D~%" (-> obj prevent-from-run)) - (format #t "~Trequire-for-run: ~D~%" (-> obj require-for-run)) - (format #t "~Tallow-to-run: ~D~%" (-> obj allow-to-run)) - (format #t "~Tnext-pid: ~D~%" (-> obj next-pid)) - (format #t "~Tfast-stack-top: #x~X~%" (-> obj fast-stack-top)) - (format #t "~Tcurrent-process: ~A~%" (-> obj current-process)) - (format #t "~Trelocating-process: ~A~%" (-> obj relocating-process)) - (format #t "~Trelocating-min: #x~X~%" (-> obj relocating-min)) - (format #t "~Trelocating-max: #x~X~%" (-> obj relocating-max)) - (format #t "~Trelocating-offset: ~D~%" (-> obj relocating-offset)) - (format #t "~Tlow-memory-message: ~A~%" (-> obj low-memory-message)) - obj +(defmethod inspect kernel-context ((this kernel-context)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tprevent-from-run: ~D~%" (-> this prevent-from-run)) + (format #t "~Trequire-for-run: ~D~%" (-> this require-for-run)) + (format #t "~Tallow-to-run: ~D~%" (-> this allow-to-run)) + (format #t "~Tnext-pid: ~D~%" (-> this next-pid)) + (format #t "~Tfast-stack-top: #x~X~%" (-> this fast-stack-top)) + (format #t "~Tcurrent-process: ~A~%" (-> this current-process)) + (format #t "~Trelocating-process: ~A~%" (-> this relocating-process)) + (format #t "~Trelocating-min: #x~X~%" (-> this relocating-min)) + (format #t "~Trelocating-max: #x~X~%" (-> this relocating-max)) + (format #t "~Trelocating-offset: ~D~%" (-> this relocating-offset)) + (format #t "~Tlow-memory-message: ~A~%" (-> this low-memory-message)) + this ) ;; definition of type thread @@ -60,18 +60,18 @@ ) ;; definition for method 3 of type thread -(defmethod inspect thread ((obj thread)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tprevious: ~A~%" (-> obj previous)) - (format #t "~Tsuspend-hook: ~A~%" (-> obj suspend-hook)) - (format #t "~Tresume-hook: ~A~%" (-> obj resume-hook)) - (format #t "~Tpc: #x~X~%" (-> obj pc)) - (format #t "~Tsp: #x~X~%" (-> obj sp)) - (format #t "~Tstack-top: #x~X~%" (-> obj stack-top)) - (format #t "~Tstack-size: ~D~%" (-> obj stack-size)) - obj +(defmethod inspect thread ((this thread)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tprevious: ~A~%" (-> this previous)) + (format #t "~Tsuspend-hook: ~A~%" (-> this suspend-hook)) + (format #t "~Tresume-hook: ~A~%" (-> this resume-hook)) + (format #t "~Tpc: #x~X~%" (-> this pc)) + (format #t "~Tsp: #x~X~%" (-> this sp)) + (format #t "~Tstack-top: #x~X~%" (-> this stack-top)) + (format #t "~Tstack-size: ~D~%" (-> this stack-size)) + this ) ;; definition of type cpu-thread @@ -89,21 +89,21 @@ ) ;; definition for method 3 of type cpu-thread -(defmethod inspect cpu-thread ((obj cpu-thread)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tprevious: ~A~%" (-> obj previous)) - (format #t "~Tsuspend-hook: ~A~%" (-> obj suspend-hook)) - (format #t "~Tresume-hook: ~A~%" (-> obj resume-hook)) - (format #t "~Tpc: #x~X~%" (-> obj pc)) - (format #t "~Tsp: #x~X~%" (-> obj sp)) - (format #t "~Tstack-top: #x~X~%" (-> obj stack-top)) - (format #t "~Tstack-size: ~D~%" (-> obj stack-size)) - (format #t "~Trreg[8] @ #x~X~%" (-> obj rreg)) - (format #t "~Tfreg[6] @ #x~X~%" (&-> obj freg 2)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect cpu-thread ((this cpu-thread)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tprevious: ~A~%" (-> this previous)) + (format #t "~Tsuspend-hook: ~A~%" (-> this suspend-hook)) + (format #t "~Tresume-hook: ~A~%" (-> this resume-hook)) + (format #t "~Tpc: #x~X~%" (-> this pc)) + (format #t "~Tsp: #x~X~%" (-> this sp)) + (format #t "~Tstack-top: #x~X~%" (-> this stack-top)) + (format #t "~Tstack-size: ~D~%" (-> this stack-size)) + (format #t "~Trreg[8] @ #x~X~%" (-> this rreg)) + (format #t "~Tfreg[6] @ #x~X~%" (&-> this freg 2)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; definition of type dead-pool @@ -120,16 +120,16 @@ ) ;; definition for method 3 of type dead-pool -(defmethod inspect dead-pool ((obj dead-pool)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - obj +(defmethod inspect dead-pool ((this dead-pool)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + this ) ;; definition of type dead-pool-heap-rec @@ -145,12 +145,12 @@ ) ;; definition for method 3 of type dead-pool-heap-rec -(defmethod inspect dead-pool-heap-rec ((obj dead-pool-heap-rec)) - (format #t "[~8x] ~A~%" obj 'dead-pool-heap-rec) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tprev: #~%" (-> obj prev)) - (format #t "~Tnext: #~%" (-> obj next)) - obj +(defmethod inspect dead-pool-heap-rec ((this dead-pool-heap-rec)) + (format #t "[~8x] ~A~%" this 'dead-pool-heap-rec) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tprev: #~%" (-> this prev)) + (format #t "~Tnext: #~%" (-> this next)) + this ) ;; definition of type dead-pool-heap @@ -189,28 +189,28 @@ ;; definition for method 3 of type dead-pool-heap ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect dead-pool-heap ((obj dead-pool-heap)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tcompact-time: ~D~%" (-> obj compact-time)) - (format #t "~Tcompact-count-targ: ~D~%" (-> obj compact-count-targ)) - (format #t "~Tcompact-count: ~D~%" (-> obj compact-count)) - (format #t "~Tfill-percent: ~f~%" (-> obj fill-percent)) - (format #t "~Tfirst-gap: #~%" (-> obj first-gap)) - (format #t "~Tfirst-shrink: #~%" (-> obj first-shrink)) - (format #t "~Theap: #~%" (-> obj heap)) - (format #t "~Talive-list: #~%" (-> obj alive-list)) - (format #t "~Tlast: #~%" (-> obj alive-list prev)) - (format #t "~Tdead-list: #~%" (-> obj dead-list)) - (format #t "~Tprocess-list[0] @ #x~X~%" (-> obj process-list)) - obj +(defmethod inspect dead-pool-heap ((this dead-pool-heap)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tcompact-time: ~D~%" (-> this compact-time)) + (format #t "~Tcompact-count-targ: ~D~%" (-> this compact-count-targ)) + (format #t "~Tcompact-count: ~D~%" (-> this compact-count)) + (format #t "~Tfill-percent: ~f~%" (-> this fill-percent)) + (format #t "~Tfirst-gap: #~%" (-> this first-gap)) + (format #t "~Tfirst-shrink: #~%" (-> this first-shrink)) + (format #t "~Theap: #~%" (-> this heap)) + (format #t "~Talive-list: #~%" (-> this alive-list)) + (format #t "~Tlast: #~%" (-> this alive-list prev)) + (format #t "~Tdead-list: #~%" (-> this dead-list)) + (format #t "~Tprocess-list[0] @ #x~X~%" (-> this process-list)) + this ) ;; definition of type catch-frame @@ -229,15 +229,15 @@ ) ;; definition for method 3 of type catch-frame -(defmethod inspect catch-frame ((obj catch-frame)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnext: ~A~%" (-> obj next)) - (format #t "~Tsp: #x~X~%" (-> obj sp)) - (format #t "~Tra: #x~X~%" (-> obj ra)) - (format #t "~Tfreg[6] @ #x~X~%" (-> obj freg)) - (format #t "~Trreg[8] @ #x~X~%" (&-> obj freg 7)) - obj +(defmethod inspect catch-frame ((this catch-frame)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnext: ~A~%" (-> this next)) + (format #t "~Tsp: #x~X~%" (-> this sp)) + (format #t "~Tra: #x~X~%" (-> this ra)) + (format #t "~Tfreg[6] @ #x~X~%" (-> this freg)) + (format #t "~Trreg[8] @ #x~X~%" (&-> this freg 7)) + this ) ;; definition of type protect-frame @@ -253,12 +253,12 @@ ) ;; definition for method 3 of type protect-frame -(defmethod inspect protect-frame ((obj protect-frame)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnext: ~A~%" (-> obj next)) - (format #t "~Texit: ~A~%" (-> obj exit)) - obj +(defmethod inspect protect-frame ((this protect-frame)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnext: ~A~%" (-> this next)) + (format #t "~Texit: ~A~%" (-> this exit)) + this ) ;; definition of type handle @@ -273,20 +273,20 @@ ) ;; definition for method 3 of type handle -(defmethod inspect handle ((obj handle)) - (format #t "[~8x] ~A~%" obj 'handle) - (format #t "~Tprocess: #x~X~%" (-> obj process)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - obj +(defmethod inspect handle ((this handle)) + (format #t "[~8x] ~A~%" this 'handle) + (format #t "~Tprocess: #x~X~%" (-> this process)) + (format #t "~Tpid: ~D~%" (-> this pid)) + this ) ;; definition for method 2 of type handle -(defmethod print handle ((obj handle)) - (if (nonzero? obj) - (format #t "#" (handle->process obj) (-> obj pid)) +(defmethod print handle ((this handle)) + (if (nonzero? this) + (format #t "#" (handle->process this) (-> this pid)) (format #t "#") ) - obj + this ) ;; definition of type state @@ -306,17 +306,17 @@ ) ;; definition for method 3 of type state -(defmethod inspect state ((obj state)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tnext: ~A~%" (-> obj next)) - (format #t "~Texit: ~A~%" (-> obj exit)) - (format #t "~Tcode: ~A~%" (-> obj code)) - (format #t "~Ttrans: ~A~%" (-> obj trans)) - (format #t "~Tpost: ~A~%" (-> obj post)) - (format #t "~Tenter: ~A~%" (-> obj enter)) - (format #t "~Tevent: ~A~%" (-> obj event)) - obj +(defmethod inspect state ((this state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tnext: ~A~%" (-> this next)) + (format #t "~Texit: ~A~%" (-> this exit)) + (format #t "~Tcode: ~A~%" (-> this code)) + (format #t "~Ttrans: ~A~%" (-> this trans)) + (format #t "~Tpost: ~A~%" (-> this post)) + (format #t "~Tenter: ~A~%" (-> this enter)) + (format #t "~Tevent: ~A~%" (-> this event)) + this ) ;; definition of type event-message-block @@ -334,14 +334,14 @@ ) ;; definition for method 3 of type event-message-block -(defmethod inspect event-message-block ((obj event-message-block)) - (format #t "[~8x] ~A~%" obj 'event-message-block) - (format #t "~Tto: ~A~%" (-> obj to)) - (format #t "~Tfrom: ~A~%" (-> obj from)) - (format #t "~Tnum-params: ~D~%" (-> obj num-params)) - (format #t "~Tmessage: ~A~%" (-> obj message)) - (format #t "~Tparam[7] @ #x~X~%" (-> obj param)) - obj +(defmethod inspect event-message-block ((this event-message-block)) + (format #t "[~8x] ~A~%" this 'event-message-block) + (format #t "~Tto: ~A~%" (-> this to)) + (format #t "~Tfrom: ~A~%" (-> this from)) + (format #t "~Tnum-params: ~D~%" (-> this num-params)) + (format #t "~Tmessage: ~A~%" (-> this message)) + (format #t "~Tparam[7] @ #x~X~%" (-> this param)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/kernel/gkernel_REF.gc b/test/decompiler/reference/jak1/kernel/gkernel_REF.gc index 1eacc2a6ad..fb0665b6ec 100644 --- a/test/decompiler/reference/jak1/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gkernel_REF.gc @@ -26,8 +26,8 @@ (define *last-loado-debug-usage* 0) ;; definition for method 7 of type object -(defmethod relocate object ((obj object) (arg0 int)) - obj +(defmethod relocate object ((this object) (arg0 int)) + this ) ;; definition for symbol *kernel-packages*, type pair @@ -75,34 +75,42 @@ ;; definition for method 1 of type thread ;; INFO: Return type mismatch thread vs none. -(defmethod delete thread ((obj thread)) - (when (= obj (-> obj process main-thread)) +(defmethod delete thread ((this thread)) + (when (= this (-> this process main-thread)) (break!) 0 ) - (set! (-> obj process top-thread) (-> obj previous)) + (set! (-> this process top-thread) (-> this previous)) (none) ) ;; definition for method 2 of type thread -(defmethod print thread ((obj thread)) - (format #t "#<~A ~S of ~S pc: #x~X @ #x~X>" (-> obj type) (-> obj name) (-> obj process name) (-> obj pc) obj) - obj +(defmethod print thread ((this thread)) + (format + #t + "#<~A ~S of ~S pc: #x~X @ #x~X>" + (-> this type) + (-> this name) + (-> this process name) + (-> this pc) + this + ) + this ) ;; definition for method 9 of type thread ;; INFO: Return type mismatch int vs none. -(defmethod stack-size-set! thread ((obj thread) (arg0 int)) - (let ((a2-0 (-> obj process))) +(defmethod stack-size-set! thread ((this thread) (arg0 int)) + (let ((a2-0 (-> this process))) (cond - ((!= obj (-> a2-0 main-thread)) + ((!= this (-> a2-0 main-thread)) (format 0 "ERROR: illegal attempt change stack size of ~A when the main-thread is not the top-thread.~%" a2-0) ) - ((= (-> obj stack-size) arg0) + ((= (-> this stack-size) arg0) ) - ((= (-> a2-0 heap-cur) (+ (+ (-> obj stack-size) -4 (-> obj type size)) (the-as int obj))) - (set! (-> a2-0 heap-cur) (the-as pointer (+ (+ arg0 -4 (-> obj type size)) (the-as int obj)))) - (set! (-> obj stack-size) arg0) + ((= (-> a2-0 heap-cur) (+ (+ (-> this stack-size) -4 (-> this type size)) (the-as int this))) + (set! (-> a2-0 heap-cur) (the-as pointer (+ (+ arg0 -4 (-> this type size)) (the-as int this)))) + (set! (-> this stack-size) arg0) ) (else (format 0 "ERROR: illegal attempt change stack size of ~A after more heap allocation has occured.~%" a2-0) @@ -116,38 +124,38 @@ ;; definition for method 0 of type cpu-thread ;; INFO: Return type mismatch pointer vs cpu-thread. (defmethod new cpu-thread ((allocation symbol) (type-to-make type) (arg0 process) (arg1 symbol) (arg2 int) (arg3 pointer)) - (let ((obj (the-as cpu-thread (cond - ((-> arg0 top-thread) - (the-as cpu-thread (&+ arg3 -7164)) - ) - (else - (let ((v1-2 (logand -16 (&+ (-> arg0 heap-cur) 15)))) - (set! (-> arg0 heap-cur) (&+ (&+ v1-2 (-> type-to-make size)) arg2)) - (the-as cpu-thread (&+ v1-2 4)) - ) + (let ((this (the-as cpu-thread (cond + ((-> arg0 top-thread) + (the-as cpu-thread (&+ arg3 -7164)) ) - ) - ) - ) + (else + (let ((v1-2 (logand -16 (&+ (-> arg0 heap-cur) 15)))) + (set! (-> arg0 heap-cur) (&+ (&+ v1-2 (-> type-to-make size)) arg2)) + (the-as cpu-thread (&+ v1-2 4)) + ) + ) + ) + ) + ) ) - (set! (-> obj type) type-to-make) - (set! (-> obj name) arg1) - (set! (-> obj process) arg0) - (set! (-> obj sp) arg3) - (set! (-> obj stack-top) arg3) - (set! (-> obj previous) (-> arg0 top-thread)) - (set! (-> arg0 top-thread) obj) - (set! (-> obj suspend-hook) (method-of-object obj thread-suspend)) - (set! (-> obj resume-hook) (method-of-object obj thread-resume)) - (set! (-> obj stack-size) arg2) - (the-as cpu-thread obj) + (set! (-> this type) type-to-make) + (set! (-> this name) arg1) + (set! (-> this process) arg0) + (set! (-> this sp) arg3) + (set! (-> this stack-top) arg3) + (set! (-> this previous) (-> arg0 top-thread)) + (set! (-> arg0 top-thread) this) + (set! (-> this suspend-hook) (method-of-object this thread-suspend)) + (set! (-> this resume-hook) (method-of-object this thread-resume)) + (set! (-> this stack-size) arg2) + (the-as cpu-thread this) ) ) ;; definition for method 5 of type cpu-thread ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of cpu-thread ((obj cpu-thread)) - (the-as int (+ (-> obj type size) (-> obj stack-size))) +(defmethod asize-of cpu-thread ((this cpu-thread)) + (the-as int (+ (-> this type size) (-> this stack-size))) ) ;; definition for function remove-exit @@ -263,14 +271,14 @@ ) ;; definition for method 3 of type process-tree -(defmethod inspect process-tree ((obj process-tree)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~S~%" (-> obj name)) - (format #t "~Tmask: #x~X~%" (-> obj mask)) - (format #t "~Tparent: ~A~%" (ppointer->process (-> obj parent))) - (format #t "~Tbrother: ~A~%" (ppointer->process (-> obj brother))) - (format #t "~Tchild: ~A~%" (ppointer->process (-> obj child))) - obj +(defmethod inspect process-tree ((this process-tree)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~S~%" (-> this name)) + (format #t "~Tmask: #x~X~%" (-> this mask)) + (format #t "~Tparent: ~A~%" (ppointer->process (-> this parent))) + (format #t "~Tbrother: ~A~%" (ppointer->process (-> this brother))) + (format #t "~Tchild: ~A~%" (ppointer->process (-> this child))) + this ) ;; definition for method 0 of type process @@ -315,72 +323,71 @@ ;; definition for function inspect-process-heap (defun inspect-process-heap ((arg0 process)) - (let ((obj (&+ (-> arg0 heap-base) 4))) - (while (< (the-as int obj) (the-as int (-> arg0 heap-cur))) - (inspect (the-as basic obj)) - (&+! obj (logand -16 (+ (asize-of (the-as basic obj)) 15))) + (let ((this (&+ (-> arg0 heap-base) 4))) + (while (< (the-as int this) (the-as int (-> arg0 heap-cur))) + (inspect (the-as basic this)) + (&+! this (logand -16 (+ (asize-of (the-as basic this)) 15))) ) ) #f ) ;; definition for method 3 of type process -(defmethod inspect process ((obj process)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~S~%" (-> obj name)) - (format #t "~Tmask: #x~X~%" (-> obj mask)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tparent: ~A~%" (ppointer->process (-> obj parent))) - (format #t "~Tbrother: ~A~%" (ppointer->process (-> obj brother))) - (format #t "~Tchild: ~A~%" (ppointer->process (-> obj child))) - (format #t "~Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) +(defmethod inspect process ((this process)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~S~%" (-> this name)) + (format #t "~Tmask: #x~X~%" (-> this mask)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tparent: ~A~%" (ppointer->process (-> this parent))) + (format #t "~Tbrother: ~A~%" (ppointer->process (-> this brother))) + (format #t "~Tchild: ~A~%" (ppointer->process (-> this child))) + (format #t "~Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) (let ((s5-0 *print-column*)) (set! *print-column* (+ *print-column* 64)) (format #t "----~%") - (inspect-process-heap obj) + (inspect-process-heap this) (format #t "----~%") (set! *print-column* s5-0) ) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tstack[~D] @ #x~X~%" (-> obj allocated-length) (-> obj stack)) - obj + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tstack[~D] @ #x~X~%" (-> this allocated-length) (-> this stack)) + this ) ;; definition for method 5 of type process ;; INFO: Return type mismatch uint vs int. -(defmethod asize-of process ((obj process)) - (the-as int (+ (-> process size) (-> obj allocated-length))) +(defmethod asize-of process ((this process)) + (the-as int (+ (-> process size) (-> this allocated-length))) ) ;; definition for method 2 of type process -;; INFO: this function exists in multiple non-identical object files -(defmethod print process ((obj process)) - (format #t "#<~A ~S ~A :state ~S " (-> obj type) (-> obj name) (-> obj status) (if (-> obj state) - (-> obj state name) - ) +(defmethod print process ((this process)) + (format #t "#<~A ~S ~A :state ~S " (-> this type) (-> this name) (-> this status) (if (-> this state) + (-> this state name) + ) ) (format #t ":stack ~D/~D :heap ~D/~D @ #x~X>" - (&- (-> obj top-thread stack-top) (the-as uint (-> obj top-thread sp))) - (-> obj main-thread stack-size) - (- (-> obj allocated-length) (&- (-> obj heap-top) (the-as uint (-> obj heap-cur)))) - (-> obj allocated-length) - obj + (&- (-> this top-thread stack-top) (the-as uint (-> this top-thread sp))) + (-> this main-thread stack-size) + (- (-> this allocated-length) (&- (-> this heap-top) (the-as uint (-> this heap-cur)))) + (-> this allocated-length) + this ) - obj + this ) ;; definition for function return-from-thread @@ -423,9 +430,9 @@ ) ;; definition for method 14 of type dead-pool -(defmethod get-process dead-pool ((obj dead-pool) (arg0 type) (arg1 int)) - (let ((s4-0 (the-as object (-> obj child)))) - (when (and (not (the-as (pointer process-tree) s4-0)) *debug-segment* (!= obj *debug-dead-pool*)) +(defmethod get-process dead-pool ((this dead-pool) (arg0 type) (arg1 int)) + (let ((s4-0 (the-as object (-> this child)))) + (when (and (not (the-as (pointer process-tree) s4-0)) *debug-segment* (!= this *debug-dead-pool*)) (set! s4-0 (get-process *debug-dead-pool* arg0 arg1)) (if (the-as process s4-0) (format @@ -433,7 +440,7 @@ "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%" arg0 (ppointer->process (the-as process s4-0)) - (-> obj name) + (-> this name) ) ) ) @@ -448,7 +455,7 @@ "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" arg0 (ppointer->process (the-as (pointer process) s4-0)) - (-> obj name) + (-> this name) ) (the-as process #f) ) @@ -458,78 +465,78 @@ ;; definition for method 15 of type dead-pool ;; INFO: Return type mismatch process-tree vs none. -(defmethod return-process dead-pool ((obj dead-pool) (arg0 process)) - (change-parent arg0 obj) +(defmethod return-process dead-pool ((this dead-pool) (arg0 process)) + (change-parent arg0 this) (none) ) ;; definition for method 0 of type dead-pool-heap (defmethod new dead-pool-heap ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 int) (arg2 int)) - (let ((obj (object-new - allocation - type-to-make - (the-as int (+ (-> type-to-make size) (logand -16 (+ (* 12 arg1) 15)) arg2)) - ) - ) + (let ((this (object-new + allocation + type-to-make + (the-as int (+ (-> type-to-make size) (logand -16 (+ (* 12 arg1) 15)) arg2)) + ) + ) ) - (set! (-> obj name) arg0) - (set! (-> obj mask) (process-mask process-tree)) - (set! (-> obj allocated-length) arg1) - (set! (-> obj parent) (the-as (pointer process-tree) #f)) - (set! (-> obj brother) (the-as (pointer process-tree) #f)) - (set! (-> obj child) (the-as (pointer process-tree) #f)) - (set! (-> obj self) obj) - (set! (-> obj ppointer) (the-as (pointer process) (&-> obj self))) + (set! (-> this name) arg0) + (set! (-> this mask) (process-mask process-tree)) + (set! (-> this allocated-length) arg1) + (set! (-> this parent) (the-as (pointer process-tree) #f)) + (set! (-> this brother) (the-as (pointer process-tree) #f)) + (set! (-> this child) (the-as (pointer process-tree) #f)) + (set! (-> this self) this) + (set! (-> this ppointer) (the-as (pointer process) (&-> this self))) (countdown (v1-4 arg1) - (let ((a0-4 (-> obj process-list v1-4))) + (let ((a0-4 (-> this process-list v1-4))) (set! (-> a0-4 process) *null-process*) - (set! (-> a0-4 next) (-> obj process-list (+ v1-4 1))) + (set! (-> a0-4 next) (-> this process-list (+ v1-4 1))) ) ) - (set! (-> obj dead-list next) (the-as dead-pool-heap-rec (-> obj process-list))) - (set! (-> obj alive-list process) #f) - (set! (-> obj process-list (+ arg1 -1) next) #f) - (set! (-> obj alive-list prev) (-> obj alive-list)) - (set! (-> obj alive-list next) #f) - (set! (-> obj alive-list process) #f) - (set! (-> obj first-gap) (-> obj alive-list)) - (set! (-> obj first-shrink) #f) - (set! (-> obj heap base) (the-as pointer (logand -16 (+ (the-as int obj) 115 (* 12 arg1))))) - (set! (-> obj heap current) (-> obj heap base)) - (set! (-> obj heap top) (&+ (-> obj heap base) arg2)) - (set! (-> obj heap top-base) (-> obj heap top)) - obj + (set! (-> this dead-list next) (the-as dead-pool-heap-rec (-> this process-list))) + (set! (-> this alive-list process) #f) + (set! (-> this process-list (+ arg1 -1) next) #f) + (set! (-> this alive-list prev) (-> this alive-list)) + (set! (-> this alive-list next) #f) + (set! (-> this alive-list process) #f) + (set! (-> this first-gap) (-> this alive-list)) + (set! (-> this first-shrink) #f) + (set! (-> this heap base) (the-as pointer (logand -16 (+ (the-as int this) 115 (* 12 arg1))))) + (set! (-> this heap current) (-> this heap base)) + (set! (-> this heap top) (&+ (-> this heap base) arg2)) + (set! (-> this heap top-base) (-> this heap top)) + this ) ) ;; definition for method 22 of type dead-pool-heap ;; INFO: Return type mismatch object vs pointer. -(defmethod gap-location dead-pool-heap ((obj dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-location dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) (the-as pointer (if (-> arg0 process) (+ (+ (-> arg0 process allocated-length) -4 (-> process size)) (the-as int (-> arg0 process))) - (-> obj heap base) + (-> this heap base) ) ) ) ;; definition for method 21 of type dead-pool-heap -(defmethod gap-size dead-pool-heap ((obj dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-size dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) (cond ((-> arg0 process) (let ((v1-3 (&+ (&+ (the-as pointer (-> arg0 process)) (-> process size)) (-> arg0 process allocated-length)))) (if (-> arg0 next) (&- (the-as pointer (-> arg0 next process)) (the-as uint v1-3)) - (&- (-> obj heap top) (the-as uint (&+ v1-3 4))) + (&- (-> this heap top) (the-as uint (&+ v1-3 4))) ) ) ) ((-> arg0 next) - (&- (the-as pointer (-> arg0 next process)) (the-as uint (&+ (-> obj heap base) 4))) + (&- (the-as pointer (-> arg0 next process)) (the-as uint (&+ (-> this heap base) 4))) ) (else - (&- (-> obj heap top) (the-as uint (-> obj heap base))) + (&- (-> this heap top) (the-as uint (-> this heap base))) ) ) ) @@ -544,87 +551,87 @@ ;; definition for method 3 of type dead-pool-heap ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect dead-pool-heap ((obj dead-pool-heap)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Theap: #~%" (-> obj heap)) - (format #t "~Tfirst-gap: #~%" (-> obj first-gap)) - (format #t "~Tfirst-shrink: #~%" (-> obj first-shrink)) - (format #t "~Talive-list: #~%" (-> obj alive-list)) - (format #t "~Tlast: #~%" (-> obj alive-list prev)) - (format #t "~Tdead-list: #~%" (-> obj dead-list)) - (let* ((s5-0 (&- (-> obj heap top) (the-as uint (-> obj heap base)))) - (v1-3 (if (-> obj alive-list prev) - (gap-size obj (-> obj alive-list prev)) +(defmethod inspect dead-pool-heap ((this dead-pool-heap)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Theap: #~%" (-> this heap)) + (format #t "~Tfirst-gap: #~%" (-> this first-gap)) + (format #t "~Tfirst-shrink: #~%" (-> this first-shrink)) + (format #t "~Talive-list: #~%" (-> this alive-list)) + (format #t "~Tlast: #~%" (-> this alive-list prev)) + (format #t "~Tdead-list: #~%" (-> this dead-list)) + (let* ((s5-0 (&- (-> this heap top) (the-as uint (-> this heap base)))) + (v1-3 (if (-> this alive-list prev) + (gap-size this (-> this alive-list prev)) s5-0 ) ) ) - (format #t "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%" (-> obj process-list) (- s5-0 v1-3) s5-0) + (format #t "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%" (-> this process-list) (- s5-0 v1-3) s5-0) ) - (let ((s5-1 (-> obj alive-list)) + (let ((s5-1 (-> this alive-list)) (s4-0 0) ) (while s5-1 (if (-> s5-1 process) (format #t "~T [~3D] # ~A~%" s4-0 s5-1 (-> s5-1 process)) ) - (let ((s3-0 (gap-size obj s5-1))) + (let ((s3-0 (gap-size this s5-1))) (if (nonzero? s3-0) - (format #t "~T gap: ~D bytes @ #x~X~%" s3-0 (gap-location obj s5-1)) + (format #t "~T gap: ~D bytes @ #x~X~%" s3-0 (gap-location this s5-1)) ) ) (set! s5-1 (-> s5-1 next)) (+! s4-0 1) ) ) - obj + this ) ;; definition for method 5 of type dead-pool-heap -(defmethod asize-of dead-pool-heap ((obj dead-pool-heap)) - (+ (the-as int (- -4 (the-as int obj))) (the-as int (-> obj heap top))) +(defmethod asize-of dead-pool-heap ((this dead-pool-heap)) + (+ (the-as int (- -4 (the-as int this))) (the-as int (-> this heap top))) ) ;; definition for method 19 of type dead-pool-heap -(defmethod memory-used dead-pool-heap ((obj dead-pool-heap)) - (if (-> obj alive-list prev) - (- (memory-total obj) (gap-size obj (-> obj alive-list prev))) +(defmethod memory-used dead-pool-heap ((this dead-pool-heap)) + (if (-> this alive-list prev) + (- (memory-total this) (gap-size this (-> this alive-list prev))) 0 ) ) ;; definition for method 20 of type dead-pool-heap -(defmethod memory-total dead-pool-heap ((obj dead-pool-heap)) - (&- (-> obj heap top) (the-as uint (-> obj heap base))) +(defmethod memory-total dead-pool-heap ((this dead-pool-heap)) + (&- (-> this heap top) (the-as uint (-> this heap base))) ) ;; definition for method 25 of type dead-pool-heap -(defmethod memory-free dead-pool-heap ((obj dead-pool-heap)) - (let ((v1-0 (-> obj heap top))) - (if (-> obj alive-list prev) - (gap-size obj (-> obj alive-list prev)) - (&- v1-0 (the-as uint (-> obj heap base))) +(defmethod memory-free dead-pool-heap ((this dead-pool-heap)) + (let ((v1-0 (-> this heap top))) + (if (-> this alive-list prev) + (gap-size this (-> this alive-list prev)) + (&- v1-0 (the-as uint (-> this heap base))) ) ) ) ;; definition for method 26 of type dead-pool-heap -(defmethod compact-time dead-pool-heap ((obj dead-pool-heap)) - (-> obj compact-time) +(defmethod compact-time dead-pool-heap ((this dead-pool-heap)) + (-> this compact-time) ) ;; definition for method 24 of type dead-pool-heap -(defmethod find-gap-by-size dead-pool-heap ((obj dead-pool-heap) (arg0 int)) - (let ((gp-0 (-> obj first-gap))) - (while (and gp-0 (< (gap-size obj gp-0) arg0)) +(defmethod find-gap-by-size dead-pool-heap ((this dead-pool-heap) (arg0 int)) + (let ((gp-0 (-> this first-gap))) + (while (and gp-0 (< (gap-size this gp-0) arg0)) (set! gp-0 (-> gp-0 next)) ) gp-0 @@ -632,14 +639,14 @@ ) ;; definition for method 14 of type dead-pool-heap -(defmethod get-process dead-pool-heap ((obj dead-pool-heap) (arg0 type) (arg1 int)) - (let ((s4-0 (-> obj dead-list next)) +(defmethod get-process dead-pool-heap ((this dead-pool-heap) (arg0 type) (arg1 int)) + (let ((s4-0 (-> this dead-list next)) (s3-0 (the-as process #f)) ) - (let ((s1-0 (find-gap-by-size obj (the-as int (+ (-> process size) arg1))))) + (let ((s1-0 (find-gap-by-size this (the-as int (+ (-> process size) arg1))))) (cond ((and s4-0 s1-0) - (set! (-> obj dead-list next) (-> s4-0 next)) + (set! (-> this dead-list next) (-> s4-0 next)) (let ((v1-5 (-> s1-0 next))) (set! (-> s1-0 next) s4-0) (set! (-> s4-0 next) v1-5) @@ -648,26 +655,26 @@ ) ) (set! (-> s4-0 prev) s1-0) - (if (= s1-0 (-> obj alive-list prev)) - (set! (-> obj alive-list prev) s4-0) + (if (= s1-0 (-> this alive-list prev)) + (set! (-> this alive-list prev) s4-0) ) - (let ((a0-4 (gap-location obj s1-0))) + (let ((a0-4 (gap-location this s1-0))) (set! s3-0 ((method-of-type process new) (the-as symbol a0-4) process 'process arg1)) ) (set! (-> s4-0 process) s3-0) (set! (-> s3-0 ppointer) (&-> s4-0 process)) - (if (= (-> obj first-gap) s1-0) - (set! (-> obj first-gap) (find-gap obj s4-0)) + (if (= (-> this first-gap) s1-0) + (set! (-> this first-gap) (find-gap this s4-0)) ) - (if (or (not (-> obj first-shrink)) (< (the-as int s3-0) (the-as int (-> obj first-shrink process)))) - (set! (-> obj first-shrink) s4-0) + (if (or (not (-> this first-shrink)) (< (the-as int s3-0) (the-as int (-> this first-shrink process)))) + (set! (-> this first-shrink) s4-0) ) - (set! (-> s3-0 parent) (-> obj ppointer)) - (set! (-> s3-0 pool) obj) - (set! (-> obj child) (&-> s4-0 process)) + (set! (-> s3-0 parent) (-> this ppointer)) + (set! (-> s3-0 pool) this) + (set! (-> this child) (&-> s4-0 process)) ) (else - (when (and *debug-segment* (!= obj *debug-dead-pool*)) + (when (and *debug-segment* (!= this *debug-dead-pool*)) (set! s3-0 (get-process *debug-dead-pool* arg0 arg1)) (if (and s3-0 *vis-boot*) (format @@ -675,7 +682,7 @@ "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%" arg0 s3-0 - (-> obj name) + (-> this name) ) ) ) @@ -684,7 +691,7 @@ ) (if s3-0 (set! (-> s3-0 type) arg0) - (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" arg0 s3-0 (-> obj name)) + (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" arg0 s3-0 (-> this name)) ) s3-0 ) @@ -692,32 +699,32 @@ ;; definition for method 15 of type dead-pool-heap ;; INFO: Return type mismatch int vs none. -(defmethod return-process dead-pool-heap ((obj dead-pool-heap) (arg0 process)) - (if (!= obj (-> arg0 pool)) - (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" arg0 obj) +(defmethod return-process dead-pool-heap ((this dead-pool-heap) (arg0 process)) + (if (!= this (-> arg0 pool)) + (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" arg0 this) ) - (change-parent arg0 obj) - (set! (-> obj child) (the-as (pointer process-tree) #f)) + (change-parent arg0 this) + (set! (-> this child) (the-as (pointer process-tree) #f)) (let ((s5-1 (-> arg0 ppointer))) - (if (or (= (-> obj first-gap) s5-1) (< (the-as int (gap-location obj (the-as dead-pool-heap-rec s5-1))) - (the-as int (gap-location obj (-> obj first-gap))) - ) + (if (or (= (-> this first-gap) s5-1) (< (the-as int (gap-location this (the-as dead-pool-heap-rec s5-1))) + (the-as int (gap-location this (-> this first-gap))) + ) ) - (set! (-> obj first-gap) (the-as dead-pool-heap-rec (-> s5-1 1))) + (set! (-> this first-gap) (the-as dead-pool-heap-rec (-> s5-1 1))) ) - (when (= (-> obj first-shrink) s5-1) - (set! (-> obj first-shrink) (the-as dead-pool-heap-rec (-> s5-1 1))) - (if (not (-> obj first-shrink process)) - (set! (-> obj first-shrink) #f) + (when (= (-> this first-shrink) s5-1) + (set! (-> this first-shrink) (the-as dead-pool-heap-rec (-> s5-1 1))) + (if (not (-> this first-shrink process)) + (set! (-> this first-shrink) #f) ) ) (set! (-> s5-1 1 parent) (the-as (pointer process-tree) (-> s5-1 2))) (if (-> s5-1 2) (set! (-> s5-1 2 mask) (the-as process-mask (-> s5-1 1))) - (set! (-> obj alive-list prev) (the-as dead-pool-heap-rec (-> s5-1 1))) + (set! (-> this alive-list prev) (the-as dead-pool-heap-rec (-> s5-1 1))) ) - (set! (-> s5-1 2) (the-as process (-> obj dead-list next))) - (set! (-> obj dead-list next) (the-as dead-pool-heap-rec s5-1)) + (set! (-> s5-1 2) (the-as process (-> this dead-list next))) + (set! (-> this dead-list next) (the-as dead-pool-heap-rec s5-1)) (set! (-> s5-1 0) *null-process*) ) 0 @@ -725,7 +732,7 @@ ) ;; definition for method 17 of type dead-pool-heap -(defmethod shrink-heap dead-pool-heap ((obj dead-pool-heap) (arg0 process)) +(defmethod shrink-heap dead-pool-heap ((this dead-pool-heap) (arg0 process)) (when arg0 (let ((s5-0 (-> arg0 ppointer))) (when (not (or (logtest? (-> arg0 mask) (process-mask heap-shrunk)) @@ -734,24 +741,24 @@ ) (set! (-> arg0 allocated-length) (&- (-> arg0 heap-cur) (the-as uint (-> arg0 stack)))) (set! (-> arg0 heap-top) (&-> arg0 stack (-> arg0 allocated-length))) - (if (< (the-as int arg0) (the-as int (gap-location obj (-> obj first-gap)))) - (set! (-> obj first-gap) (find-gap obj (the-as dead-pool-heap-rec s5-0))) + (if (< (the-as int arg0) (the-as int (gap-location this (-> this first-gap)))) + (set! (-> this first-gap) (find-gap this (the-as dead-pool-heap-rec s5-0))) ) (logior! (-> arg0 mask) (process-mask heap-shrunk)) ) - (if (= (-> obj first-shrink) s5-0) - (set! (-> obj first-shrink) (the-as dead-pool-heap-rec (-> s5-0 2))) + (if (= (-> this first-shrink) s5-0) + (set! (-> this first-shrink) (the-as dead-pool-heap-rec (-> s5-0 2))) ) ) ) - obj + this ) ;; definition for method 16 of type dead-pool-heap ;; INFO: Return type mismatch int vs none. -(defmethod compact dead-pool-heap ((obj dead-pool-heap) (arg0 int)) - (let* ((s4-0 (memory-free obj)) - (v1-2 (memory-total obj)) +(defmethod compact dead-pool-heap ((this dead-pool-heap) (arg0 int)) + (let* ((s4-0 (memory-free this)) + (v1-2 (memory-total this)) (f0-2 (/ (the float s4-0) (the float v1-2))) ) (cond @@ -769,33 +776,33 @@ ) ) ) - (set! (-> obj compact-count-targ) (the-as uint arg0)) - (set! (-> obj compact-count) (the-as uint 0)) + (set! (-> this compact-count-targ) (the-as uint arg0)) + (set! (-> this compact-count) (the-as uint 0)) (while (nonzero? arg0) (+! arg0 -1) - (let ((v1-13 (-> obj first-shrink))) + (let ((v1-13 (-> this first-shrink))) (when (not v1-13) - (set! v1-13 (-> obj alive-list next)) - (set! (-> obj first-shrink) v1-13) + (set! v1-13 (-> this alive-list next)) + (set! (-> this first-shrink) v1-13) ) (if v1-13 - (shrink-heap obj (-> v1-13 process)) + (shrink-heap this (-> v1-13 process)) ) ) - (let ((s4-1 (-> obj first-gap))) + (let ((s4-1 (-> this first-gap))) (when (-> s4-1 next) (let ((s3-0 (-> s4-1 next process)) - (s2-0 (gap-size obj s4-1)) + (s2-0 (gap-size this s4-1)) ) (when (nonzero? s2-0) (when (< s2-0 0) (break!) 0 ) - (shrink-heap obj s3-0) + (shrink-heap this s3-0) (relocate s3-0 (- s2-0)) - (set! (-> obj first-gap) (find-gap obj s4-1)) - (+! (-> obj compact-count) 1) + (set! (-> this first-gap) (find-gap this s4-1)) + (+! (-> this compact-count) 1) ) ) ) @@ -807,28 +814,28 @@ ;; definition for method 18 of type dead-pool-heap ;; INFO: Return type mismatch int vs none. -(defmethod churn dead-pool-heap ((obj dead-pool-heap) (arg0 int)) +(defmethod churn dead-pool-heap ((this dead-pool-heap) (arg0 int)) (while (nonzero? arg0) (+! arg0 -1) - (let ((s4-0 (-> obj alive-list next))) + (let ((s4-0 (-> this alive-list next))) (when s4-0 - (if (or (= (-> obj first-gap) s4-0) - (< (the-as int (gap-location obj s4-0)) (the-as int (gap-location obj (-> obj first-gap)))) + (if (or (= (-> this first-gap) s4-0) + (< (the-as int (gap-location this s4-0)) (the-as int (gap-location this (-> this first-gap)))) ) - (set! (-> obj first-gap) (-> s4-0 prev)) + (set! (-> this first-gap) (-> s4-0 prev)) ) - (when (= (-> obj first-shrink) s4-0) - (set! (-> obj first-shrink) (-> s4-0 prev)) - (if (not (-> obj first-shrink process)) - (set! (-> obj first-shrink) #f) + (when (= (-> this first-shrink) s4-0) + (set! (-> this first-shrink) (-> s4-0 prev)) + (if (not (-> this first-shrink process)) + (set! (-> this first-shrink) #f) ) ) (set! (-> s4-0 prev next) (-> s4-0 next)) (if (-> s4-0 next) (set! (-> s4-0 next prev) (-> s4-0 prev)) - (set! (-> obj alive-list prev) (-> s4-0 prev)) + (set! (-> this alive-list prev) (-> s4-0 prev)) ) - (let ((a1-3 (-> obj alive-list prev))) + (let ((a1-3 (-> this alive-list prev))) (let ((v1-19 (-> a1-3 next))) (set! (-> a1-3 next) s4-0) (set! (-> s4-0 next) v1-19) @@ -837,9 +844,9 @@ ) ) (set! (-> s4-0 prev) a1-3) - (set! (-> obj alive-list prev) s4-0) + (set! (-> this alive-list prev) s4-0) (set! (-> s4-0 process) - (relocate (-> s4-0 process) (&- (gap-location obj a1-3) (the-as uint (&-> (-> s4-0 process) type)))) + (relocate (-> s4-0 process) (&- (gap-location this a1-3) (the-as uint (&-> (-> s4-0 process) type)))) ) ) ) @@ -931,7 +938,7 @@ ) ;; definition for method 12 of type process -(defmethod run-logic? process ((obj process)) +(defmethod run-logic? process ((this process)) #t ) @@ -1289,35 +1296,35 @@ ) ;; definition for method 9 of type process -(defmethod activate process ((obj process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) - (set! (-> obj mask) (logclear (-> arg0 mask) (process-mask sleep sleep-code process-tree heap-shrunk))) - (set! (-> obj status) 'ready) +(defmethod activate process ((this process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) + (set! (-> this mask) (logclear (-> arg0 mask) (process-mask sleep sleep-code process-tree heap-shrunk))) + (set! (-> this status) 'ready) (let ((v1-4 (-> *kernel-context* next-pid))) - (set! (-> obj pid) v1-4) + (set! (-> this pid) v1-4) (set! (-> *kernel-context* next-pid) (+ v1-4 1)) ) - (set! (-> obj top-thread) #f) - (set! (-> obj main-thread) #f) - (set! (-> obj name) arg1) - (let ((v1-9 (&-> obj stack (-> obj type heap-base)))) - (set! (-> obj heap-cur) v1-9) - (set! (-> obj heap-base) v1-9) + (set! (-> this top-thread) #f) + (set! (-> this main-thread) #f) + (set! (-> this name) arg1) + (let ((v1-9 (&-> this stack (-> this type heap-base)))) + (set! (-> this heap-cur) v1-9) + (set! (-> this heap-base) v1-9) ) - (set! (-> obj stack-frame-top) #f) - (mem-set32! (-> obj stack) (the-as int (shr (-> obj type heap-base) 2)) 0) - (set! (-> obj trans-hook) #f) - (set! (-> obj post-hook) #f) - (set! (-> obj event-hook) #f) - (set! (-> obj state) #f) - (set! (-> obj next-state) #f) + (set! (-> this stack-frame-top) #f) + (mem-set32! (-> this stack) (the-as int (shr (-> this type heap-base) 2)) 0) + (set! (-> this trans-hook) #f) + (set! (-> this post-hook) #f) + (set! (-> this event-hook) #f) + (set! (-> this state) #f) + (set! (-> this next-state) #f) (if (logtest? (-> arg0 mask) (process-mask process-tree)) - (set! (-> obj entity) #f) - (set! (-> obj entity) (-> (the-as process arg0) entity)) + (set! (-> this entity) #f) + (set! (-> this entity) (-> (the-as process arg0) entity)) ) - (set! (-> obj connection-list next1) #f) - (set! (-> obj connection-list prev1) #f) - (set! (-> obj main-thread) (new 'process 'cpu-thread obj 'code 256 arg2)) - (change-parent obj arg0) + (set! (-> this connection-list next1) #f) + (set! (-> this connection-list prev1) #f) + (set! (-> this main-thread) (new 'process 'cpu-thread this 'code 256 arg2)) + (change-parent this arg0) ) ;; definition for function run-function-in-process @@ -1355,7 +1362,7 @@ ;; definition for method 10 of type process-tree ;; INFO: Return type mismatch symbol vs none. -(defmethod deactivate process-tree ((obj process-tree)) +(defmethod deactivate process-tree ((this process-tree)) (none) ) @@ -1371,16 +1378,16 @@ ;; INFO: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod deactivate process ((obj process)) +(defmethod deactivate process ((this process)) (local-vars (s7-0 none) (ra-0 int)) (with-pp - (when (!= (-> obj status) 'dead) - (set! (-> obj next-state) dead-state) - (if (-> obj entity) - (entity-deactivate-handler obj (-> obj entity)) + (when (!= (-> this status) 'dead) + (set! (-> this next-state) dead-state) + (if (-> this entity) + (entity-deactivate-handler this (-> this entity)) ) (let ((s5-0 pp)) - (set! pp obj) + (set! pp this) (let ((s4-0 (-> pp stack-frame-top))) (while (the-as protect-frame s4-0) (case (-> s4-0 type) @@ -1393,8 +1400,8 @@ ) (set! pp s5-0) ) - (process-disconnect obj) - (let ((v1-11 (-> obj child))) + (process-disconnect this) + (let ((v1-11 (-> this child))) (while v1-11 (let ((s5-1 (-> v1-11 0 brother))) (deactivate (-> v1-11 0)) @@ -1402,25 +1409,25 @@ ) ) ) - (return-process (-> obj pool) obj) - (set! (-> obj state) #f) - (set! (-> obj next-state) #f) - (set! (-> obj entity) #f) - (set! (-> obj pid) 0) + (return-process (-> this pool) this) + (set! (-> this state) #f) + (set! (-> this next-state) #f) + (set! (-> this entity) #f) + (set! (-> this pid) 0) (cond - ((= (-> *kernel-context* current-process) obj) - (set! (-> obj status) 'dead) + ((= (-> *kernel-context* current-process) this) + (set! (-> this status) 'dead) (.lw ra-0 return-from-thread s7-0) (.jr ra-0) (nop!) 0 ) - ((= (-> obj status) 'initialize) - (set! (-> obj status) 'dead) + ((= (-> this status) 'initialize) + (set! (-> this status) 'dead) (throw 'initialize #f) ) ) - (set! (-> obj status) 'dead) + (set! (-> this status) 'dead) 0 ) (none) diff --git a/test/decompiler/reference/jak1/kernel/gstate_REF.gc b/test/decompiler/reference/jak1/kernel/gstate_REF.gc index 70fa3cfc4a..c8fd1dd129 100644 --- a/test/decompiler/reference/jak1/kernel/gstate_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gstate_REF.gc @@ -11,16 +11,16 @@ (exit (function object)) (event (function process int symbol event-message-block object)) ) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> obj name) name) - (set! (-> obj next) #f) - (set! (-> obj exit) exit) - (set! (-> obj code) code) - (set! (-> obj trans) trans) - (set! (-> obj post) #f) - (set! (-> obj enter) enter) - (set! (-> obj event) event) - obj + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> this name) name) + (set! (-> this next) #f) + (set! (-> this exit) exit) + (set! (-> this code) code) + (set! (-> this trans) trans) + (set! (-> this post) #f) + (set! (-> this enter) enter) + (set! (-> this event) event) + this ) ) @@ -36,9 +36,9 @@ ) ;; definition for method 2 of type state -(defmethod print state ((obj state)) - (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print state ((this state)) + (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) + this ) ;; definition for function enter-state diff --git a/test/decompiler/reference/jak1/kernel/gstring_REF.gc b/test/decompiler/reference/jak1/kernel/gstring_REF.gc index fcad694113..866a684935 100644 --- a/test/decompiler/reference/jak1/kernel/gstring_REF.gc +++ b/test/decompiler/reference/jak1/kernel/gstring_REF.gc @@ -2,21 +2,21 @@ (in-package goal) ;; definition for method 4 of type string -(defmethod length string ((obj string)) - (let ((v1-0 (-> obj data))) +(defmethod length string ((this string)) + (let ((v1-0 (-> this data))) (while (nonzero? (-> v1-0 0)) (nop!) (nop!) (nop!) (set! v1-0 (&-> v1-0 1)) ) - (&- v1-0 (the-as uint (-> obj data))) + (&- v1-0 (the-as uint (-> this data))) ) ) ;; definition for method 5 of type string -(defmethod asize-of string ((obj string)) - (+ (-> obj allocated-length) 1 (-> string size)) +(defmethod asize-of string ((this string)) + (+ (-> this allocated-length) 1 (-> string size)) ) ;; definition for function copy-string<-string diff --git a/test/decompiler/reference/jak1/levels/beach/air-h_REF.gc b/test/decompiler/reference/jak1/levels/beach/air-h_REF.gc index 7e33217569..322b0b1ae8 100644 --- a/test/decompiler/reference/jak1/levels/beach/air-h_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/air-h_REF.gc @@ -18,17 +18,17 @@ ) ;; definition for method 3 of type air-box -(defmethod inspect air-box ((obj air-box)) - (format #t "[~8x] ~A~%" obj 'air-box) - (format #t "~Tvecs[2] @ #x~X~%" (-> obj vecs)) - (format #t "~Tx-pos: ~f~%" (the-as float (-> obj x-pos))) - (format #t "~Theight-level: ~f~%" (the-as float (-> obj height-level))) - (format #t "~Tz-pos: ~f~%" (the-as float (-> obj z-pos))) - (format #t "~Tcos-angle: ~f~%" (-> obj cos-angle)) - (format #t "~Tx-length: ~f~%" (-> obj x-length)) - (format #t "~Tz-length: ~f~%" (-> obj z-length)) - (format #t "~Tsin-angle: ~f~%" (-> obj sin-angle)) - obj +(defmethod inspect air-box ((this air-box)) + (format #t "[~8x] ~A~%" this 'air-box) + (format #t "~Tvecs[2] @ #x~X~%" (-> this vecs)) + (format #t "~Tx-pos: ~f~%" (the-as float (-> this x-pos))) + (format #t "~Theight-level: ~f~%" (the-as float (-> this height-level))) + (format #t "~Tz-pos: ~f~%" (the-as float (-> this z-pos))) + (format #t "~Tcos-angle: ~f~%" (-> this cos-angle)) + (format #t "~Tx-length: ~f~%" (-> this x-length)) + (format #t "~Tz-length: ~f~%" (-> this z-length)) + (format #t "~Tsin-angle: ~f~%" (-> this sin-angle)) + this ) ;; definition for function point-in-air-box-area? 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 e543becc65..ed71bb6407 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-obs_REF.gc @@ -22,12 +22,12 @@ ) ;; definition for method 3 of type windmill-one -(defmethod inspect windmill-one ((obj windmill-one)) +(defmethod inspect windmill-one ((this windmill-one)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - obj + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + this ) ;; failed to figure out what this is: @@ -64,9 +64,9 @@ ;; definition for method 11 of type windmill-one ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! windmill-one ((obj windmill-one) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! windmill-one ((this windmill-one) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -101,14 +101,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj root-override pause-adjust-distance) 409600.0) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *windmill-one-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this root-override pause-adjust-distance) 409600.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *windmill-one-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this sound-id) (new-sound-id)) (go windmill-one-idle) (none) ) @@ -209,16 +209,16 @@ ) ;; definition for method 3 of type grottopole -(defmethod inspect grottopole ((obj grottopole)) +(defmethod inspect grottopole ((this grottopole)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspeed: (meters ~m)~%" (-> obj speed)) - (format #t "~T~Tdistance: (meters ~m)~%" (-> obj distance)) - (format #t "~T~Tposition: ~D~%" (-> obj position)) - (format #t "~T~Tmax-position: ~D~%" (-> obj max-position)) - (format #t "~T~Tincomming-attack-id: ~D~%" (-> obj incomming-attack-id)) - obj + (format #t "~T~Tspeed: (meters ~m)~%" (-> this speed)) + (format #t "~T~Tdistance: (meters ~m)~%" (-> this distance)) + (format #t "~T~Tposition: ~D~%" (-> this position)) + (format #t "~T~Tmax-position: ~D~%" (-> this max-position)) + (format #t "~T~Tincomming-attack-id: ~D~%" (-> this incomming-attack-id)) + this ) ;; failed to figure out what this is: @@ -274,7 +274,7 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! (-> self draw art-group data 3) :num! min) (transform-post) (suspend) @@ -297,7 +297,7 @@ (set! (-> arg0 part local-clock) 0) (set-vector! s4-0 0.0 0.0 0.0 1.0) (while (and (not s2-0) (< f30-0 (-> arg0 distance))) - (let ((f28-0 (* (-> arg0 speed) (-> *display* seconds-per-frame)))) + (let ((f28-0 (* (-> arg0 speed) (seconds-per-frame)))) (when (< (-> arg0 distance) (+ f30-0 f28-0)) (set! f28-0 (- (-> arg0 distance) f30-0)) (set! s2-0 #t) @@ -358,8 +358,8 @@ ;; definition for method 11 of type grottopole ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! grottopole ((obj grottopole) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! grottopole ((this grottopole) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -396,17 +396,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *grottopole-sg* '()) - (set! (-> obj speed) (res-lump-float arg0 'speed :default 81920.0)) - (set! (-> obj distance) (res-lump-float arg0 'distance :default 3072.0)) - (set! (-> obj position) 0) - (set! (-> obj max-position) (res-lump-value arg0 'num-positions int :default (the-as uint128 3))) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 155) obj)) - (set! (-> obj position) (-> obj entity extra perm user-int16 0)) - (move-grottopole-to-position obj) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *grottopole-sg* '()) + (set! (-> this speed) (res-lump-float arg0 'speed :default 81920.0)) + (set! (-> this distance) (res-lump-float arg0 'distance :default 3072.0)) + (set! (-> this position) 0) + (set! (-> this max-position) (res-lump-value arg0 'num-positions int :default (the-as uint128 3))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 155) this)) + (set! (-> this position) (-> this entity extra perm user-int16 0)) + (move-grottopole-to-position this) (go grottopole-idle) (none) ) @@ -426,11 +426,11 @@ ) ;; definition for method 3 of type ecoventrock -(defmethod inspect ecoventrock ((obj ecoventrock)) +(defmethod inspect ecoventrock ((this ecoventrock)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -601,7 +601,7 @@ (defstate ecoventrock-break (ecoventrock) :event process-drawable-fuel-cell-handler :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior ((arg0 symbol)) (local-vars (sv-128 symbol)) @@ -675,8 +675,8 @@ (set! sv-128 (the-as symbol #f)) (apply-all (-> self link) actor-link-subtask-complete-hook (& sv-128)) (when sv-128 - (let ((s5-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-2) (seconds 0.5)) + (let ((s5-2 (current-time))) + (until (time-elapsed? s5-2 (seconds 0.5)) (suspend) ) ) @@ -711,9 +711,9 @@ ;; definition for method 11 of type ecoventrock ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ecoventrock ((obj ecoventrock) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! ecoventrock ((this ecoventrock) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -725,14 +725,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ecoventrock-sg* '()) - (set! (-> obj link) (new 'process 'actor-link-info obj)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ecoventrock-sg* '()) + (set! (-> this link) (new 'process 'actor-link-info this)) (transform-post) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go ecoventrock-break #t) (go ecoventrock-idle) ) @@ -755,12 +755,12 @@ ) ;; definition for method 3 of type flying-rock -(defmethod inspect flying-rock ((obj flying-rock)) +(defmethod inspect flying-rock ((this flying-rock)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttumble: #~%" (-> obj tumble)) - obj + (format #t "~T~Ttumble: #~%" (-> this tumble)) + this ) ;; failed to figure out what this is: @@ -772,7 +772,7 @@ ;; failed to figure out what this is: (defstate flying-rock-rolling (flying-rock) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (let ((gp-0 #f) @@ -838,7 +838,7 @@ ) (set-vector! gp-2 (-> self root-override transv z) 0.0 (- (-> self root-override transv x)) 1.0) (vector-normalize! gp-2 1.0) - (let ((f0-12 (* 0.00061035156 (-> *display* seconds-per-frame) f30-1))) + (let ((f0-12 (* 0.00061035156 (seconds-per-frame) f30-1))) (quaternion-vector-angle! (-> self tumble) gp-2 (* 10430.379 f0-12)) ) ) @@ -848,7 +848,7 @@ (go flying-rock-idle) ) :post (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go flying-rock-idle) ) (ja-post) @@ -938,12 +938,12 @@ ) ;; definition for method 3 of type bladeassm -(defmethod inspect bladeassm ((obj bladeassm)) +(defmethod inspect bladeassm ((this bladeassm)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tangle: ~f~%" (-> obj angle)) - obj + (format #t "~T~Tangle: ~f~%" (-> this angle)) + this ) ;; failed to figure out what this is: @@ -957,7 +957,7 @@ (defstate bladeassm-idle (bladeassm) :code (behavior () (loop - (+! (-> self angle) (* 3640.889 (-> *display* seconds-per-frame))) + (+! (-> self angle) (* 3640.889 (seconds-per-frame))) (set! (-> self angle) (the float (sar (shl (the int (-> self angle)) 48) 48))) (pusher-post) (suspend) @@ -976,9 +976,9 @@ ;; definition for method 11 of type bladeassm ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! bladeassm ((obj bladeassm) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! bladeassm ((this bladeassm) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -995,14 +995,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *bladeassm-sg* '()) - (set! (-> obj skel prebind-function) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *bladeassm-sg* '()) + (set! (-> this skel prebind-function) (the-as (function pointer int process-drawable none) bladeassm-prebind-function) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (go bladeassm-idle) (none) ) @@ -1037,21 +1037,21 @@ ) ;; definition for method 3 of type flutflutegg -(defmethod inspect flutflutegg ((obj flutflutegg)) +(defmethod inspect flutflutegg ((this flutflutegg)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tfall-dist: (meters ~m)~%" (-> obj fall-dist)) - (format #t "~T~Tstart: ~`vector`P~%" (-> obj start)) - (format #t "~T~Tdir: ~`vector`P~%" (-> obj dir)) - (format #t "~T~Tpos: ~f~%" (-> obj pos)) - (format #t "~T~Tvel: ~f~%" (-> obj vel)) - (format #t "~T~Twobbler: ~A~%" (-> obj wobbler)) - (format #t "~T~Tlast-impulse-time: ~D~%" (-> obj last-impulse-time)) - (format #t "~T~Tincomming-attack-id: ~D~%" (-> obj incomming-attack-id)) - (format #t "~T~Tambients-played: ~D~%" (-> obj ambients-played)) - (format #t "~T~Tambient: #~%" (-> obj ambient)) - obj + (format #t "~T~Tfall-dist: (meters ~m)~%" (-> this fall-dist)) + (format #t "~T~Tstart: ~`vector`P~%" (-> this start)) + (format #t "~T~Tdir: ~`vector`P~%" (-> this dir)) + (format #t "~T~Tpos: ~f~%" (-> this pos)) + (format #t "~T~Tvel: ~f~%" (-> this vel)) + (format #t "~T~Twobbler: ~A~%" (-> this wobbler)) + (format #t "~T~Tlast-impulse-time: ~D~%" (-> this last-impulse-time)) + (format #t "~T~Tincomming-attack-id: ~D~%" (-> this incomming-attack-id)) + (format #t "~T~Tambients-played: ~D~%" (-> this ambients-played)) + (format #t "~T~Tambient: #~%" (-> this ambient)) + this ) ;; failed to figure out what this is: @@ -1068,26 +1068,26 @@ ;; definition for method 7 of type flutflutegg ;; INFO: Return type mismatch process-drawable vs flutflutegg. -(defmethod relocate flutflutegg ((obj flutflutegg) (arg0 int)) - (if (nonzero? (-> obj wobbler)) - (&+! (-> obj wobbler) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method flutflutegg 7)) this arg0) ) ) ;; definition for method 20 of type flutflutegg ;; INFO: Return type mismatch int vs none. ;; WARN: Function (method 20 flutflutegg) has a return type of none, but the expression builder found a return statement. -(defmethod flutflutegg-method-20 flutflutegg ((obj flutflutegg) (arg0 float) (arg1 float) (arg2 float)) - (if (< (- (-> *display* base-frame-counter) (the-as time-frame (-> obj last-impulse-time))) (seconds 0.5)) +(defmethod flutflutegg-method-20 flutflutegg ((this flutflutegg) (arg0 float) (arg1 float) (arg2 float)) + (if (not (time-elapsed? (the-as time-frame (-> this last-impulse-time)) (seconds 0.5))) (return 0) ) - (set! (-> obj last-impulse-time) (the-as int (-> *display* base-frame-counter))) - (+! (-> obj vel) arg0) - (inc-xy-vel! (-> obj wobbler) arg1 arg2) + (set! (-> this last-impulse-time) (the-as int (current-time))) + (+! (-> this vel) arg0) + (inc-xy-vel! (-> this wobbler) arg1 arg2) 0 (none) ) @@ -1177,7 +1177,7 @@ ) ((< (-> gp-0 y) -24576.0) ) - ((< (- (-> *display* base-frame-counter) (-> self ambient last-ambient-time)) (seconds 30)) + ((not (time-elapsed? (-> self ambient last-ambient-time) (seconds 30))) ) ((< 0.8 f30-0) (play-ambient (-> self ambient) "BIR-AM07" #f (-> self root-override trans)) @@ -1208,7 +1208,7 @@ ;; failed to figure out what this is: (defstate flutflutegg-physics (flutflutegg) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.5)) (= message 'attack) (or (= (-> block param 1) 'punch) (= (-> block param 1) 'spin) (= (-> block param 1) 'spin-air)) (!= (-> self incomming-attack-id) (-> block param 2)) @@ -1233,9 +1233,9 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (+! (-> self pos) (* (-> self vel) (-> *display* seconds-per-frame))) + (+! (-> self pos) (* (-> self vel) (seconds-per-frame))) (set! (-> self vel) (* 0.95 (-> self vel))) (move! (-> self wobbler)) (let ((a1-0 (new 'stack-no-clear 'vector))) @@ -1275,8 +1275,8 @@ ) (camera-change-to "camera-135" 0 #f) (camera-look-at (the-as pair (ppointer->process (-> self parent))) (the-as uint 9)) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 4)) (suspend) ) ) @@ -1293,7 +1293,7 @@ (close-specific-task! (game-task beach-flutflut) (task-status need-reminder)) (loop (vector-float*! (-> self root-override transv) (-> self dir) (-> self vel)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (until v1-25 (vector-v++! (-> self root-override transv) @@ -1314,7 +1314,7 @@ (quaternion*! (-> self root-override quat) (-> self root-override quat) a2-6) ) (suspend) - (set! v1-25 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (set! v1-25 (and (time-elapsed? (-> self state-time) (seconds 0.5)) (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) ) ) @@ -1351,9 +1351,9 @@ ) (suspend) ) - (let ((gp-2 (-> *display* base-frame-counter))) + (let ((gp-2 (current-time))) (while (not (task-closed? (game-task beach-flutflut) (task-status need-reward-speech))) - (if (>= (- (-> *display* base-frame-counter) gp-2) (seconds 10)) + (if (time-elapsed? gp-2 (seconds 10)) (level-hint-spawn (text-id beach-flutflutegg-hint) "sksp0029" @@ -1384,8 +1384,8 @@ ;; definition for method 11 of type flutflutegg ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! flutflutegg ((obj flutflutegg) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! flutflutegg ((this flutflutegg) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1417,20 +1417,20 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *flutflutegg-sg* '()) - (vector-z-quaternion! (-> obj dir) (-> obj root-override quat)) - (set! (-> obj start quad) (-> obj root-override trans quad)) - (set! (-> obj fall-dist) 20480.0) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (+ -16384.0 (y-angle (-> obj root-override)))) - (set! (-> obj pos) 0.0) - (set! (-> obj vel) 0.0) - (set! (-> obj wobbler) (new 'process 'wobbler)) - (reset! (-> obj wobbler) 0.1 0.98 4096.0) - (set! (-> obj last-impulse-time) 0) - (set! (-> obj ambients-played) 0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *flutflutegg-sg* '()) + (vector-z-quaternion! (-> this dir) (-> this root-override quat)) + (set! (-> this start quad) (-> this root-override trans quad)) + (set! (-> this fall-dist) 20480.0) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) (+ -16384.0 (y-angle (-> this root-override)))) + (set! (-> this pos) 0.0) + (set! (-> this vel) 0.0) + (set! (-> this wobbler) (new 'process 'wobbler)) + (reset! (-> this wobbler) 0.1 0.98 4096.0) + (set! (-> this last-impulse-time) 0) + (set! (-> this ambients-played) 0) (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) (go flutflutegg-break #t) (go flutflutegg-idle) @@ -1454,12 +1454,12 @@ ) ;; definition for method 3 of type harvester -(defmethod inspect harvester ((obj harvester)) +(defmethod inspect harvester ((this harvester)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; failed to figure out what this is: @@ -1515,9 +1515,9 @@ ;; definition for method 11 of type harvester ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! harvester ((obj harvester) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! harvester ((this harvester) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind background)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1573,11 +1573,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *harvester-sg* '()) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *harvester-sg* '()) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (go harvester-idle) (none) ) @@ -1591,35 +1591,35 @@ ) ;; definition for method 3 of type beachcam -(defmethod inspect beachcam ((obj beachcam)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect beachcam ((this beachcam)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; definition for function beachcam-spawn diff --git a/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc b/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc index 32fb0c684a..660ceaff61 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-part_REF.gc @@ -14,11 +14,11 @@ ) ;; definition for method 3 of type beach-part -(defmethod inspect beach-part ((obj beach-part)) +(defmethod inspect beach-part ((this beach-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: 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 755e4944af..3b4995bc20 100644 --- a/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/beach-rocks_REF.gc @@ -254,39 +254,42 @@ ) ;; definition for method 3 of type beach-rock -(defmethod inspect beach-rock ((obj beach-rock)) +(defmethod inspect beach-rock ((this beach-rock)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttrigger: ~A~%" (-> obj trigger)) - (format #t "~T~Tmovie-start: ~D~%" (-> obj movie-start)) - (format #t "~T~Tpart-falling: ~A~%" (-> obj part-falling)) - (format #t "~T~Tpart-landing: ~A~%" (-> obj part-landing)) - (format #t "~T~Tprev-frame: ~f~%" (-> obj prev-frame)) - obj + (format #t "~T~Ttrigger: ~A~%" (-> this trigger)) + (format #t "~T~Tmovie-start: ~D~%" (-> this movie-start)) + (format #t "~T~Tpart-falling: ~A~%" (-> this part-falling)) + (format #t "~T~Tpart-landing: ~A~%" (-> this part-landing)) + (format #t "~T~Tprev-frame: ~f~%" (-> this prev-frame)) + this ) ;; definition for method 7 of type beach-rock ;; INFO: Return type mismatch none vs beach-rock. -(defmethod relocate beach-rock ((obj beach-rock) (arg0 int)) - (if (nonzero? (-> obj part-falling)) - (set! (-> obj part-falling) (the-as sparticle-launch-control (+ (the-as int (-> obj part-falling)) arg0))) +(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))) ) - (if (nonzero? (-> obj part-landing)) - (set! (-> obj part-landing) (the-as sparticle-launch-control (+ (the-as int (-> obj part-landing)) arg0))) + (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)) obj arg0)) + (the-as + beach-rock + ((the-as (function process-drawable int none) (find-parent-method beach-rock 7)) this arg0) + ) ) ;; definition for method 10 of type beach-rock -(defmethod deactivate beach-rock ((obj beach-rock)) - (if (nonzero? (-> obj part-falling)) - (kill-and-free-particles (-> obj part-falling)) +(defmethod deactivate beach-rock ((this beach-rock)) + (if (nonzero? (-> this part-falling)) + (kill-and-free-particles (-> this part-falling)) ) - (if (nonzero? (-> obj part-landing)) - (kill-and-free-particles (-> obj part-landing)) + (if (nonzero? (-> this part-landing)) + (kill-and-free-particles (-> this part-landing)) ) - ((the-as (function process-drawable none) (find-parent-method beach-rock 10)) obj) + ((the-as (function process-drawable none) (find-parent-method beach-rock 10)) this) (none) ) @@ -384,7 +387,7 @@ ) ) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) - (set! (-> self movie-start) (-> *display* base-frame-counter)) + (set-time! (-> self movie-start)) (spool-push *art-control* "lrocklrg-falling" 0 self -1.0) (ja-play-spooled-anim (new 'static 'spool-anim @@ -449,37 +452,37 @@ ;; definition for method 11 of type beach-rock ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! beach-rock ((obj beach-rock) (arg0 entity-actor)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj align) (new 'process 'align-control obj)) - (set! (-> obj trigger) #f) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 553) obj)) - (set! (-> obj part-falling) (create-launch-control (-> *part-group-id-table* 554) obj)) - (set! (-> obj part-landing) (create-launch-control (-> *part-group-id-table* 555) obj)) - (set! (-> obj prev-frame) -1000.0) - (set! (-> obj draw origin-joint-index) (the-as uint 4)) - (case (get-task-status (-> obj entity extra perm task)) +(defmethod init-from-entity! beach-rock ((this beach-rock) (arg0 entity-actor)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this trigger) #f) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 553) this)) + (set! (-> this part-falling) (create-launch-control (-> *part-group-id-table* 554) this)) + (set! (-> this part-landing) (create-launch-control (-> *part-group-id-table* 555) this)) + (set! (-> this prev-frame) -1000.0) + (set! (-> this draw origin-joint-index) (the-as uint 4)) + (case (get-task-status (-> this entity extra perm task)) (((task-status invalid)) - (go (method-of-object obj fallen)) + (go (method-of-object this fallen)) ) (((task-status need-resolution)) (let ((s5-0 (new 'stack-no-clear 'vector))) (ja-post) - (vector<-cspace! s5-0 (-> obj node-list data 8)) + (vector<-cspace! s5-0 (-> this node-list data 8)) (birth-pickup-at-point s5-0 (pickup-type fuel-cell) - (the float (the-as int (-> obj entity extra perm task))) + (the float (the-as int (-> this entity extra perm task))) #f - obj + this (the-as fact-info #f) ) ) - (go (method-of-object obj fallen)) + (go (method-of-object this fallen)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -495,17 +498,17 @@ ) ;; definition for method 3 of type lrocklrg -(defmethod inspect lrocklrg ((obj lrocklrg)) +(defmethod inspect lrocklrg ((this lrocklrg)) (let ((t9-0 (method-of-type beach-rock inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 11 of type lrocklrg -(defmethod init-from-entity! lrocklrg ((obj lrocklrg) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! lrocklrg ((this lrocklrg) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -522,10 +525,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lrocklrg-sg* '()) - ((method-of-type beach-rock init-from-entity!) obj arg0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lrocklrg-sg* '()) + ((method-of-type beach-rock init-from-entity!) this arg0) (none) ) diff --git a/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc b/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc index e584134780..ef3a6fc96b 100644 --- a/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/bird-lady-beach_REF.gc @@ -13,13 +13,13 @@ ) ;; definition for method 3 of type bird-lady-beach -(defmethod inspect bird-lady-beach ((obj bird-lady-beach)) +(defmethod inspect bird-lady-beach ((this bird-lady-beach)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tflutflut: ~D~%" (-> obj flutflut)) - (format #t "~T~Tegg: ~D~%" (-> obj egg)) - obj + (format #t "~T~Tflutflut: ~D~%" (-> this flutflut)) + (format #t "~T~Tegg: ~D~%" (-> this egg)) + this ) ;; failed to figure out what this is: @@ -51,21 +51,23 @@ ) ;; definition for method 32 of type bird-lady-beach -(defmethod play-anim! bird-lady-beach ((obj bird-lady-beach) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! bird-lady-beach ((this bird-lady-beach) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) - (set! (-> obj flutflut) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *flutflut-naked-sg* #f :to obj)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) + (set! (-> this flutflut) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *flutflut-naked-sg* #f :to this) + ) ) - (send-event (handle->process (-> obj flutflut)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj flutflut)) 'blend-shape #t) - (set! (-> obj egg) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *flutflutegg-sg* #f :to obj)) + (send-event (handle->process (-> this flutflut)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this flutflut)) 'blend-shape #t) + (set! (-> this egg) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *flutflutegg-sg* #f :to this)) ) - (send-event (handle->process (-> obj egg)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this egg)) 'anim-mode 'clone-anim) ) (new 'static 'spool-anim :name "bird-lady-beach-resolution" @@ -79,30 +81,30 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 31 of type bird-lady-beach -(defmethod get-art-elem bird-lady-beach ((obj bird-lady-beach)) - (-> obj draw art-group data 3) +(defmethod get-art-elem bird-lady-beach ((this bird-lady-beach)) + (-> this draw art-group data 3) ) ;; definition for method 39 of type bird-lady-beach -(defmethod should-display? bird-lady-beach ((obj bird-lady-beach)) - (= (current-status (-> obj tasks)) (task-status need-reward-speech)) +(defmethod should-display? bird-lady-beach ((this bird-lady-beach)) + (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) ;; definition for method 11 of type bird-lady-beach -(defmethod init-from-entity! bird-lady-beach ((obj bird-lady-beach) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *bird-lady-beach-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task beach-flutflut))) - (set! (-> obj sound-flava) (music-flava birdlady)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! bird-lady-beach ((this bird-lady-beach) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *bird-lady-beach-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task beach-flutflut))) + (set! (-> this sound-flava) (music-flava birdlady)) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/beach/bird-lady_REF.gc b/test/decompiler/reference/jak1/levels/beach/bird-lady_REF.gc index b7fac3726e..96d2c895ab 100644 --- a/test/decompiler/reference/jak1/levels/beach/bird-lady_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/bird-lady_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type bird-lady -(defmethod inspect bird-lady ((obj bird-lady)) +(defmethod inspect bird-lady ((this bird-lady)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -27,10 +27,10 @@ ;; definition for method 52 of type bird-lady ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 bird-lady ((obj bird-lady)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 bird-lady ((this bird-lady)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0))) ) @@ -47,21 +47,22 @@ ) ;; definition for method 48 of type bird-lady -(defmethod draw-npc-shadow bird-lady ((obj bird-lady)) - (-> obj draw shadow-ctrl) +;; INFO: Return type mismatch object vs none. +(defmethod draw-npc-shadow bird-lady ((this bird-lady)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -71,11 +72,11 @@ ) ;; definition for method 32 of type bird-lady -(defmethod play-anim! bird-lady ((obj bird-lady) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! bird-lady ((this bird-lady) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "bird-lady-introduction" @@ -105,17 +106,17 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (if arg0 - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) (new 'static 'spool-anim :name "bird-lady-reminder-1" :index 5 :parts 4 :command-list '()) ) (else (if arg0 - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) (new 'static 'spool-anim :name "bird-lady-reminder-2" :index 6 :parts 5 :command-list '()) ) @@ -126,33 +127,33 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 31 of type bird-lady -(defmethod get-art-elem bird-lady ((obj bird-lady)) - (-> obj draw art-group data 3) +(defmethod get-art-elem bird-lady ((this bird-lady)) + (-> this draw art-group data 3) ) ;; definition for method 43 of type bird-lady -(defmethod process-taskable-method-43 bird-lady ((obj bird-lady)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 bird-lady ((this bird-lady)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) - (play-ambient (-> obj ambient) "BIR-LO02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIR-LO02" #f (-> this root-override trans)) ) ((< 0.33 f0-2) - (play-ambient (-> obj ambient) "BIR-LO03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIR-LO03" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "BIR-am08" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIR-am08" #f (-> this root-override trans)) ) ) ) @@ -161,19 +162,20 @@ ;; definition for method 47 of type bird-lady ;; INFO: Return type mismatch basic vs symbol. -(defmethod target-above-threshold? bird-lady ((obj bird-lady)) +(defmethod target-above-threshold? bird-lady ((this bird-lady)) (the-as symbol (and *target* (< (-> (target-pos 0) z) -81920.0))) ) ;; definition for method 11 of type bird-lady -(defmethod init-from-entity! bird-lady ((obj bird-lady) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *bird-lady-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task beach-flutflut))) - (set! (-> obj sound-flava) (music-flava birdlady)) - (set! (-> obj draw light-index) (the-as uint 4)) - (if (closed? (-> obj tasks) (game-task beach-flutflut) (task-status need-reminder)) - (cleanup-for-death obj) - (go (method-of-object obj idle)) +;; INFO: Return type mismatch object vs none. +(defmethod init-from-entity! bird-lady ((this bird-lady) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *bird-lady-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task beach-flutflut))) + (set! (-> this sound-flava) (music-flava birdlady)) + (set! (-> this draw light-index) (the-as uint 4)) + (if (closed? (-> this tasks) (game-task beach-flutflut) (task-status need-reminder)) + (cleanup-for-death this) + (go (method-of-object this idle)) ) (none) ) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc index c8e4cf787b..a98db06df1 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkercrab_REF.gc @@ -66,12 +66,12 @@ ) ;; definition for method 3 of type lurkercrab -(defmethod inspect lurkercrab ((obj lurkercrab)) +(defmethod inspect lurkercrab ((this lurkercrab)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Torient: ~A~%" (-> obj orient)) - obj + (format #t "~T~Torient: ~A~%" (-> this orient)) + this ) ;; failed to figure out what this is: @@ -82,56 +82,56 @@ ;; definition for method 44 of type lurkercrab ;; INFO: Return type mismatch symbol vs object. -(defmethod touch-handler lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block)) - (if (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod touch-handler lurkercrab ((this lurkercrab) (arg0 process) (arg1 event-message-block)) + (if (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) (send-shove-back - (-> obj collide-info) + (-> this collide-info) arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 0.7 6144.0 16384.0 ) - (if (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8))) - (do-push-aways! (-> obj collide-info)) + (if (not (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf8))) + (do-push-aways! (-> this collide-info)) ) ) ;; definition for method 43 of type lurkercrab ;; INFO: Used lq/sq -(defmethod attack-handler lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block)) - (let ((s5-0 (-> obj incomming-attack-id))) - (set! (-> obj incomming-attack-id) (the-as handle (-> arg1 param 2))) +(defmethod attack-handler lurkercrab ((this lurkercrab) (arg0 process) (arg1 event-message-block)) + (let ((s5-0 (-> this incomming-attack-id))) + (set! (-> this incomming-attack-id) (the-as handle (-> arg1 param 2))) (let ((v1-1 (-> arg1 param 1))) (cond ((or (= v1-1 'flop) (= v1-1 'explode) (= v1-1 'darkeco)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj nav-enemy-die)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this nav-enemy-die)) ) ((= v1-1 'punch) (cond - ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj nav-enemy-die)) + ((logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this nav-enemy-die)) ) ((begin (let ((s4-0 (new 'stack-no-clear 'vector))) (let ((f30-0 (quaternion-xz-angle (target-rot)))) (set-vector! s4-0 (* 24576.0 (sin f30-0)) 0.0 (* 24576.0 (cos f30-0)) 1.0) ) - (vector+! s4-0 (-> obj collide-info trans) s4-0) - (set! (-> obj nav target-pos quad) (-> s4-0 quad)) + (vector+! s4-0 (-> this collide-info trans) s4-0) + (set! (-> this nav target-pos quad) (-> s4-0 quad)) ) (go lurkercrab-pushed) - (= s5-0 (-> obj incomming-attack-id)) + (= s5-0 (-> this incomming-attack-id)) ) 'push ) @@ -140,19 +140,19 @@ ) ) ) - ((logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj nav-enemy-die)) + ((logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this nav-enemy-die)) ) ((begin (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector-! s4-1 (-> obj collide-info trans) (target-pos 0)) + (vector-! s4-1 (-> this collide-info trans) (target-pos 0)) (vector-normalize! s4-1 24576.0) - (vector+! s4-1 (-> obj collide-info trans) s4-1) - (set! (-> obj nav target-pos quad) (-> s4-1 quad)) + (vector+! s4-1 (-> this collide-info trans) s4-1) + (set! (-> this nav target-pos quad) (-> s4-1 quad)) ) (go lurkercrab-pushed) - (= s5-0 (-> obj incomming-attack-id)) + (= s5-0 (-> this incomming-attack-id)) ) 'push ) @@ -169,23 +169,28 @@ nav-enemy-default-event-handler ;; definition for method 37 of type lurkercrab ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-37 lurkercrab ((obj lurkercrab)) - (when (-> obj orient) - (if (logtest? (nav-control-flags navcf19) (-> obj nav flags)) +(defmethod nav-enemy-method-37 lurkercrab ((this lurkercrab)) + (when (-> this orient) + (if (logtest? (nav-control-flags navcf19) (-> this nav flags)) (seek-to-point-toward-point! - (-> obj collide-info) - (-> obj nav target-pos) - (-> obj rotate-speed) - (-> obj turn-time) + (-> this collide-info) + (-> this nav target-pos) + (-> this rotate-speed) + (-> this turn-time) + ) + (seek-toward-heading-vec! + (-> this collide-info) + (-> this nav travel) + (-> this rotate-speed) + (-> this turn-time) ) - (seek-toward-heading-vec! (-> obj collide-info) (-> obj nav travel) (-> obj rotate-speed) (-> obj turn-time)) ) ) - (if (not (-> obj orient)) + (if (not (-> this orient)) (quaternion-rotate-y! - (-> obj collide-info quat) - (-> obj collide-info quat) - (* 163840.0 (-> *display* seconds-per-frame)) + (-> this collide-info quat) + (-> this collide-info quat) + (* 163840.0 (seconds-per-frame)) ) ) 0 @@ -194,10 +199,10 @@ nav-enemy-default-event-handler ;; definition for method 38 of type lurkercrab ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-38 lurkercrab ((obj lurkercrab)) +(defmethod nav-enemy-method-38 lurkercrab ((this lurkercrab)) (integrate-for-enemy-with-move-to-ground! - (-> obj collide-info) - (-> obj collide-info transv) + (-> this collide-info) + (-> this collide-info transv) (collide-kind background) 8192.0 #f @@ -221,8 +226,8 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.075)) (loop (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 3)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 3)) (suspend) ) ) @@ -232,8 +237,8 @@ nav-enemy-default-event-handler (ja :num! (seek! (ja-aframe 19.0 0))) ) (ja :num-func num-func-identity :frame-num (ja-aframe 19.0 0)) - (let ((gp-5 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 1)) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 1)) (suspend) ) ) @@ -305,8 +310,8 @@ nav-enemy-default-event-handler (nav-enemy-rnd-int-range 2 6) (until (not (nav-enemy-rnd-go-idle? 0.2)) (ja :group! lurkercrab-idle-ja :num! (identity (ja-aframe 1.0 0))) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 2)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 2)) (suspend) ) ) @@ -445,10 +450,10 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-channel-push! 1 (seconds 0.075)) (ja :group! (-> self draw art-group data (-> self nav-info victory-anim))) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (ja :num-func num-func-identity :frame-num 0.0) (suspend) ) @@ -471,13 +476,13 @@ nav-enemy-default-event-handler (suspend) (ja :num! (seek! (ja-aframe 18.0 0) 0.75)) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.25)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.25)) (suspend) ) ) - (let ((gp-3 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-3) (seconds 0.1)) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 0.1)) (suspend) ) ) @@ -549,8 +554,8 @@ nav-enemy-default-event-handler ;; definition for method 11 of type lurkercrab ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lurkercrab ((obj lurkercrab) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! lurkercrab ((this lurkercrab) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -589,17 +594,17 @@ nav-enemy-default-event-handler ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lurkercrab-sg* '()) - (init-defaults! obj *lurkercrab-nav-enemy-info*) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 159) obj)) - (set! (-> obj orient) #t) - (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5 navenmf6)) - (set! (-> obj target-speed) 0.0) - (set! (-> obj momentum-speed) 0.0) - (set! (-> obj draw force-lod) 2) - (go (method-of-object obj nav-enemy-idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lurkercrab-sg* '()) + (init-defaults! this *lurkercrab-nav-enemy-info*) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 159) this)) + (set! (-> this orient) #t) + (logclear! (-> this nav-enemy-flags) (nav-enemy-flags navenmf5 navenmf6)) + (set! (-> this target-speed) 0.0) + (set! (-> this momentum-speed) 0.0) + (set! (-> this draw force-lod) 2) + (go (method-of-object this nav-enemy-idle)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc index 992ebc19cf..6aa74e7d14 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkerpuppy_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type lurkerpuppy -(defmethod inspect lurkerpuppy ((obj lurkerpuppy)) +(defmethod inspect lurkerpuppy ((this lurkerpuppy)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -110,9 +110,9 @@ nav-enemy-default-event-handler (ja :group! lurkerpuppy-idle-ja) (ja :num-func num-func-identity :frame-num 0.0) (let ((gp-2 (rand-vu-int-range 750 900)) - (s5-0 (-> *display* base-frame-counter)) + (s5-0 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) s5-0) gp-2) + (until (time-elapsed? s5-0 gp-2) (ja :num! (loop!)) (ja-blend-eval) (suspend) @@ -248,8 +248,8 @@ nav-enemy-default-event-handler ;; definition for method 47 of type lurkerpuppy ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision lurkerpuppy ((obj lurkerpuppy)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision lurkerpuppy ((this lurkerpuppy)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -265,7 +265,7 @@ nav-enemy-default-event-handler ) (set! (-> s5-0 nav-radius) 2048.0) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -273,13 +273,13 @@ nav-enemy-default-event-handler ;; definition for method 48 of type lurkerpuppy ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 lurkerpuppy ((obj lurkerpuppy)) - (initialize-skeleton obj *lurkerpuppy-sg* '()) - (init-defaults! obj *lurkerpuppy-nav-enemy-info*) - (when (nonzero? (-> obj neck)) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 lurkerpuppy ((this lurkerpuppy)) + (initialize-skeleton this *lurkerpuppy-sg* '()) + (init-defaults! this *lurkerpuppy-nav-enemy-info*) + (when (nonzero? (-> this neck)) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) ) 0 (none) diff --git a/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc b/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc index 40b52590c1..03e7e6c66b 100644 --- a/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/lurkerworm_REF.gc @@ -31,37 +31,37 @@ ) ;; definition for method 3 of type lurkerworm -(defmethod inspect lurkerworm ((obj lurkerworm)) +(defmethod inspect lurkerworm ((this lurkerworm)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttwister: ~A~%" (-> obj twister)) - (format #t "~T~Thead-tilt: ~f~%" (-> obj head-tilt)) - (format #t "~T~Tstrike-count: ~D~%" (-> obj strike-count)) - (format #t "~T~Tangle: ~f~%" (-> obj angle)) - (format #t "~T~Tvulnerable: ~A~%" (-> obj vulnerable)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - obj + (format #t "~T~Ttwister: ~A~%" (-> this twister)) + (format #t "~T~Thead-tilt: ~f~%" (-> this head-tilt)) + (format #t "~T~Tstrike-count: ~D~%" (-> this strike-count)) + (format #t "~T~Tangle: ~f~%" (-> this angle)) + (format #t "~T~Tvulnerable: ~A~%" (-> this vulnerable)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + this ) ;; definition for method 7 of type lurkerworm ;; INFO: Return type mismatch process-drawable vs lurkerworm. -(defmethod relocate lurkerworm ((obj lurkerworm) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate lurkerworm ((this lurkerworm) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj twister)) - (&+! (-> obj twister) arg0) + (if (nonzero? (-> this twister)) + (&+! (-> this twister) arg0) ) - (the-as lurkerworm ((method-of-type process-drawable relocate) obj arg0)) + (the-as lurkerworm ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type lurkerworm -(defmethod deactivate lurkerworm ((obj lurkerworm)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate lurkerworm ((this lurkerworm)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -224,18 +224,18 @@ ;; definition for method 20 of type lurkerworm ;; INFO: Return type mismatch int vs none. -(defmethod lurkerworm-method-20 lurkerworm ((obj lurkerworm)) +(defmethod lurkerworm-method-20 lurkerworm ((this lurkerworm)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (target-pos 0) (-> obj root-override trans)) - (set-target! (-> obj twister) (atan (-> s5-0 x) (-> s5-0 z))) - (twister-method-11 (-> obj twister)) + (vector-! s5-0 (target-pos 0) (-> this root-override trans)) + (set-target! (-> this twister) (atan (-> s5-0 x) (-> s5-0 z))) + (twister-method-11 (-> this twister)) (let* ((f0-5 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) (f0-6 (atan (-> s5-0 y) f0-5)) ) - (seek! (-> obj head-tilt) f0-6 (* 5461.3335 (-> *display* seconds-per-frame))) + (seek! (-> this head-tilt) f0-6 (* 5461.3335 (seconds-per-frame))) ) ) - (set! (-> obj head-tilt) (fmin 8192.0 (fmax -5461.3335 (-> obj head-tilt)))) + (set! (-> this head-tilt) (fmin 8192.0 (fmax -5461.3335 (-> this head-tilt)))) 0 (none) ) @@ -266,17 +266,17 @@ ;; definition for method 21 of type lurkerworm ;; INFO: Return type mismatch int vs none. -(defmethod particle-effect lurkerworm ((obj lurkerworm)) - (let ((a2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 5)))) +(defmethod particle-effect lurkerworm ((this lurkerworm)) + (let ((a2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 5)))) (launch-particles (-> *part-id-table* 661) a2-0) ) - (let ((a2-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 6)))) + (let ((a2-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 6)))) (launch-particles (-> *part-id-table* 661) a2-1) ) - (let ((a2-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7)))) + (let ((a2-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7)))) (launch-particles (-> *part-id-table* 661) a2-2) ) - (let ((a2-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8)))) + (let ((a2-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8)))) (launch-particles (-> *part-id-table* 661) a2-3) ) 0 @@ -322,11 +322,11 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter (behavior () (ja-channel-set! 0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (loop - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -342,7 +342,7 @@ lurkerworm-default-post-behavior (defstate lurkerworm-spot (lurkerworm) :event lurkerworm-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sound-play "worm-rise1") ) :code (behavior () @@ -350,7 +350,7 @@ lurkerworm-default-post-behavior (loop (spawn (-> self part) (-> self root-override trans)) (particle-effect self) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (if (and *target* (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (go lurkerworm-rise) (go lurkerworm-idle) @@ -366,7 +366,7 @@ lurkerworm-default-post-behavior (defstate lurkerworm-rise (lurkerworm) :event lurkerworm-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (ja-channel-set! 1) @@ -387,7 +387,7 @@ lurkerworm-default-post-behavior (defstate lurkerworm-rest (lurkerworm) :event lurkerworm-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self vulnerable) #t) ) :exit (behavior () @@ -469,7 +469,7 @@ lurkerworm-default-post-behavior (defstate lurkerworm-sink (lurkerworm) :event lurkerworm-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (ja-no-eval :group! lurkerworm-sink-ja :num! (seek!) :frame-num 0.0) @@ -506,9 +506,9 @@ lurkerworm-default-post-behavior ;; definition for method 11 of type lurkerworm ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lurkerworm ((obj lurkerworm) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! lurkerworm ((this lurkerworm) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -576,24 +576,24 @@ lurkerworm-default-post-behavior ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lurkerworm-sg* '()) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lurkerworm-sg* '()) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj angle) 0.0) - (set! (-> obj vulnerable) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 157) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 158) obj)) - (set! (-> obj twister) (new 'process 'twister 3 15 1092.2667 72.81778 0.25 0.001)) - (twister-method-9 (-> obj twister) 3 9 910.2222) - (set! (-> obj head-tilt) 0.0) - (set! (-> obj skel prebind-function) lurkerworm-prebind-function) - (set! (-> obj skel postbind-function) lurkerworm-joint-callback) - (set! (-> obj root-override nav-radius) 12288.0) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (set! (-> this angle) 0.0) + (set! (-> this vulnerable) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 157) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 158) this)) + (set! (-> this twister) (new 'process 'twister 3 15 1092.2667 72.81778 0.25 0.001)) + (twister-method-9 (-> this twister) 3 9 910.2222) + (set! (-> this head-tilt) 0.0) + (set! (-> this skel prebind-function) lurkerworm-prebind-function) + (set! (-> this skel postbind-function) lurkerworm-joint-callback) + (set! (-> this root-override nav-radius) 12288.0) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) (go lurkerworm-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc b/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc index 88716556c2..74deed5457 100644 --- a/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/mayor_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type mayor -(defmethod inspect mayor ((obj mayor)) +(defmethod inspect mayor ((this mayor)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -27,10 +27,10 @@ ;; definition for method 52 of type mayor ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-52 mayor ((obj mayor)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 mayor ((this mayor)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -45,21 +45,21 @@ ;; definition for method 48 of type mayor ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow mayor ((obj mayor)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow mayor ((this mayor)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (set! (-> v1-14 settings flags) (the-as shadow-flags (logior (the-as int (-> v1-14 settings flags)) 32))) ) 0 @@ -79,17 +79,17 @@ ) ;; definition for method 32 of type mayor -(defmethod play-anim! mayor ((obj mayor) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! mayor ((this mayor) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 (close-specific-task! (game-task jungle-lurkerm) (task-status need-introduction)) (close-specific-task! (game-task village1-mayor-money) (task-status need-introduction)) ) (cond - ((closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder)) - (mayor-lurkerm-reward-speech obj arg0) + ((closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder)) + (mayor-lurkerm-reward-speech this arg0) ) (else (new 'static 'spool-anim :name "mayor-introduction" :index 4 :parts 16 :command-list '()) @@ -181,9 +181,9 @@ ) ) (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reward-speech)) (new 'static 'spool-anim :name "mayor-reminder-donation" :index 6 @@ -266,7 +266,7 @@ ) ) ) - ((closed? (-> obj tasks) (game-task village1-mayor-money) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task village1-mayor-money) (task-status need-reward-speech)) (new 'static 'spool-anim :name "mayor-reminder-beams" :index 5 @@ -349,9 +349,9 @@ ) ) ) - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (if arg0 - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) (new 'static 'spool-anim :name "mayor-reminder-beams" @@ -437,7 +437,7 @@ ) (else (if arg0 - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) (new 'static 'spool-anim :name "mayor-reminder-donation" @@ -525,21 +525,21 @@ ) (((task-status need-reward-speech)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task jungle-lurkerm)) - (mayor-lurkerm-reward-speech obj arg0) + (mayor-lurkerm-reward-speech this arg0) ) (else (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) ) (else - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (new 'static 'spool-anim @@ -631,70 +631,70 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 31 of type mayor -(defmethod get-art-elem mayor ((obj mayor)) - (-> obj draw art-group data 3) +(defmethod get-art-elem mayor ((this mayor)) + (-> this draw art-group data 3) ) ;; definition for method 39 of type mayor -(defmethod should-display? mayor ((obj mayor)) +(defmethod should-display? mayor ((this mayor)) (if *target* - (< (- (-> (target-pos 0) z) (-> obj root-override trans z)) 57344.0) - (< (- (-> (camera-pos) z) (-> obj root-override trans z)) 57344.0) + (< (- (-> (target-pos 0) z) (-> this root-override trans z)) 57344.0) + (< (- (-> (camera-pos) z) (-> this root-override trans z)) 57344.0) ) ) ;; definition for method 43 of type mayor -(defmethod process-taskable-method-43 mayor ((obj mayor)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 mayor ((this mayor)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-LO01" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-LO01" #f (-> this root-override trans)) ) ) ((< 0.7777778 f0-2) - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-LO02" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-LO02" #f (-> this root-override trans)) ) ) ((< 0.6666667 f0-2) - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-AM07" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-AM07" #f (-> this root-override trans)) ) ) ((< 0.5555556 f0-2) - (play-ambient (-> obj ambient) "CHI-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "CHI-AM06" #f (-> this root-override trans)) ) ((< 0.44444445 f0-2) - (play-ambient (-> obj ambient) "CHI-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "CHI-AM05" #f (-> this root-override trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "CHI-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "CHI-AM04" #f (-> this root-override trans)) ) ((< 0.22222222 f0-2) - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-AM03" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-AM03" #f (-> this root-override trans)) ) ) ((< 0.11111111 f0-2) - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-AM02" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-AM02" #f (-> this root-override trans)) ) ) (else - (if (not (closed? (-> obj tasks) (game-task jungle-lurkerm) (task-status need-reminder))) - (play-ambient (-> obj ambient) "CHI-AM01" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task jungle-lurkerm) (task-status need-reminder))) + (play-ambient (-> this ambient) "CHI-AM01" #f (-> this root-override trans)) ) ) ) @@ -722,12 +722,12 @@ ) ;; definition for method 11 of type mayor -(defmethod init-from-entity! mayor ((obj mayor) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *mayor-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) - (set! (-> obj bounce-away) #f) - (set! (-> obj tasks) (get-task-control (game-task jungle-lurkerm))) - (set! (-> obj sound-flava) (music-flava mayor)) - (set! (-> obj draw light-index) (the-as uint 2)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! mayor ((this mayor) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *mayor-sg* 3 51 (new 'static 'vector :y 4096.0 :w 4096.0) 5) + (set! (-> this bounce-away) #f) + (set! (-> this tasks) (get-task-control (game-task jungle-lurkerm))) + (set! (-> this sound-flava) (music-flava mayor)) + (set! (-> this draw light-index) (the-as uint 2)) + (process-taskable-method-42 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 adc03e1b49..5164aa030b 100644 --- a/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/pelican_REF.gc @@ -20,19 +20,19 @@ ) ;; definition for method 3 of type pelican-bank -(defmethod inspect pelican-bank ((obj pelican-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tcircle-speed: (meters ~m)~%" (-> obj circle-speed)) - (format #t "~Tdive-time: (seconds ~e)~%" (-> obj dive-time)) - (format #t "~Tto-nest0-time: (seconds ~e)~%" (-> obj to-nest0-time)) - (format #t "~Tto-nest1-time: (seconds ~e)~%" (-> obj to-nest1-time)) - (format #t "~Tland-time: (seconds ~e)~%" (-> obj land-time)) - (format #t "~Tfrom-nest-time: (seconds ~e)~%" (-> obj from-nest-time)) - (format #t "~Tspit-time: (seconds ~e)~%" (-> obj spit-time)) - (format #t "~Tpre-spit-wait-time: (seconds ~e)~%" (-> obj pre-spit-wait-time)) - (format #t "~Tpost-spit-wait-time: (seconds ~e)~%" (-> obj post-spit-wait-time)) - (format #t "~Trun-away-time: (seconds ~e)~%" (-> obj run-away-time)) - obj +(defmethod inspect pelican-bank ((this pelican-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tcircle-speed: (meters ~m)~%" (-> this circle-speed)) + (format #t "~Tdive-time: (seconds ~e)~%" (-> this dive-time)) + (format #t "~Tto-nest0-time: (seconds ~e)~%" (-> this to-nest0-time)) + (format #t "~Tto-nest1-time: (seconds ~e)~%" (-> this to-nest1-time)) + (format #t "~Tland-time: (seconds ~e)~%" (-> this land-time)) + (format #t "~Tfrom-nest-time: (seconds ~e)~%" (-> this from-nest-time)) + (format #t "~Tspit-time: (seconds ~e)~%" (-> this spit-time)) + (format #t "~Tpre-spit-wait-time: (seconds ~e)~%" (-> this pre-spit-wait-time)) + (format #t "~Tpost-spit-wait-time: (seconds ~e)~%" (-> this post-spit-wait-time)) + (format #t "~Trun-away-time: (seconds ~e)~%" (-> this run-away-time)) + this ) ;; definition for symbol *PELICAN-bank*, type pelican-bank @@ -95,53 +95,53 @@ ) ;; definition for method 3 of type pelican -(defmethod inspect pelican ((obj pelican)) +(defmethod inspect pelican ((this pelican)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tquery: #~%" (-> obj query)) - (format #t "~T~Tfuel-cell: ~D~%" (-> obj fuel-cell)) - (format #t "~T~Tcam-tracker: ~D~%" (-> obj cam-tracker)) - (format #t "~T~Tpath-data[8] @ #x~X~%" (-> obj path-data)) - (format #t "~T~Tpath-circle: ~A~%" (-> obj path-circle)) - (format #t "~T~Tpath-dive0: ~A~%" (-> obj path-dive0)) - (format #t "~T~Tpath-to-nest0: ~A~%" (-> obj path-to-nest0)) - (format #t "~T~Tpath-from-nest0: ~A~%" (-> obj path-from-nest0)) - (format #t "~T~Tpath-spit0: ~A~%" (-> obj path-spit0)) - (format #t "~T~Tpath-dive1: ~A~%" (-> obj path-dive1)) - (format #t "~T~Tpath-to-nest1: ~A~%" (-> obj path-to-nest1)) - (format #t "~T~Tpath-to-nest2: ~A~%" (-> obj path-to-nest2)) - (format #t "~T~Tpath-cache: ~A~%" (-> obj path-cache)) - (format #t "~T~Ttime-cache: ~D~%" (-> obj time-cache)) - (format #t "~T~Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~T~Tpath-speed: ~f~%" (-> obj path-speed)) - (format #t "~T~Tpath-max: ~f~%" (-> obj path-max)) - (format #t "~T~Tpath-vector: ~`vector`P~%" (-> obj path-vector)) - (format #t "~T~Tstate-vector: ~`vector`P~%" (-> obj state-vector)) - (format #t "~T~Tstate-vector1: ~`vector`P~%" (-> obj state-vector1)) - (format #t "~T~Tstate-float[2] @ #x~X~%" (-> obj state-float)) - (format #t "~T~Tstate-object: ~A~%" (-> obj state-object)) - (format #t "~T~Tneck: ~A~%" (-> obj neck)) - obj + (format #t "~T~Tquery: #~%" (-> this query)) + (format #t "~T~Tfuel-cell: ~D~%" (-> this fuel-cell)) + (format #t "~T~Tcam-tracker: ~D~%" (-> this cam-tracker)) + (format #t "~T~Tpath-data[8] @ #x~X~%" (-> this path-data)) + (format #t "~T~Tpath-circle: ~A~%" (-> this path-circle)) + (format #t "~T~Tpath-dive0: ~A~%" (-> this path-dive0)) + (format #t "~T~Tpath-to-nest0: ~A~%" (-> this path-to-nest0)) + (format #t "~T~Tpath-from-nest0: ~A~%" (-> this path-from-nest0)) + (format #t "~T~Tpath-spit0: ~A~%" (-> this path-spit0)) + (format #t "~T~Tpath-dive1: ~A~%" (-> this path-dive1)) + (format #t "~T~Tpath-to-nest1: ~A~%" (-> this path-to-nest1)) + (format #t "~T~Tpath-to-nest2: ~A~%" (-> this path-to-nest2)) + (format #t "~T~Tpath-cache: ~A~%" (-> this path-cache)) + (format #t "~T~Ttime-cache: ~D~%" (-> this time-cache)) + (format #t "~T~Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~T~Tpath-speed: ~f~%" (-> this path-speed)) + (format #t "~T~Tpath-max: ~f~%" (-> this path-max)) + (format #t "~T~Tpath-vector: ~`vector`P~%" (-> this path-vector)) + (format #t "~T~Tstate-vector: ~`vector`P~%" (-> this state-vector)) + (format #t "~T~Tstate-vector1: ~`vector`P~%" (-> this state-vector1)) + (format #t "~T~Tstate-float[2] @ #x~X~%" (-> this state-float)) + (format #t "~T~Tstate-object: ~A~%" (-> this state-object)) + (format #t "~T~Tneck: ~A~%" (-> this neck)) + this ) ;; definition for method 7 of type pelican ;; INFO: Return type mismatch process-drawable vs pelican. -(defmethod relocate pelican ((obj pelican) (arg0 int)) +(defmethod relocate pelican ((this pelican) (arg0 int)) (countdown (v1-0 8) - (if (nonzero? (-> obj path-data v1-0)) - (&+! (-> obj path-data v1-0) arg0) + (if (nonzero? (-> this path-data v1-0)) + (&+! (-> this path-data v1-0) arg0) ) ) - (if (nonzero? (-> obj path-cache)) - (&+! (-> obj path-cache) arg0) + (if (nonzero? (-> this path-cache)) + (&+! (-> this path-cache) arg0) ) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) + (if (nonzero? (-> this neck)) + (&+! (-> this neck) arg0) ) (the-as pelican - ((the-as (function process-drawable int process-drawable) (find-parent-method pelican 7)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method pelican 7)) this arg0) ) ) @@ -281,7 +281,7 @@ ) :trans (behavior () (pelican-path-update 728177.75 30 1.0 (/ (-> self path-max) (path-distance (-> self path))) #f) - (let ((f0-3 (+ (-> self path-pos) (* (-> self path-speed) (-> *display* seconds-per-frame)))) + (let ((f0-3 (+ (-> self path-pos) (* (-> self path-speed) (seconds-per-frame)))) (f1-2 (-> self path-max)) ) (set! (-> self path-pos) (- f0-3 (* (the float (the int (/ f0-3 f1-2))) f1-2))) @@ -373,7 +373,7 @@ :enter (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame)) (init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f)) (set! (-> self state-object) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set-roll-to-grav-2! (-> self root-override) 0.0) (let ((a0-4 (handle->process (-> self fuel-cell)))) (cond @@ -405,7 +405,7 @@ (go pelican-fly-to-end (-> self path-to-nest2) (-> *PELICAN-bank* run-away-time)) ) (pelican-path-update 364088.88 30 0.0 0.0 #t) - (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-to-nest (-> self path-cache) (the-as int (-> self time-cache))) ) @@ -449,7 +449,7 @@ ) :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) - (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-wait-at-nest #f) ) @@ -556,7 +556,7 @@ (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> self root-override trans quad)) - (vector-seek! gp-0 a1-0 (* (-> self state-float 0) (-> *display* seconds-per-frame))) + (vector-seek! gp-0 a1-0 (* (-> self state-float 0) (seconds-per-frame))) (move-to-point! (-> self root-override) gp-0) ) (do-push-aways! (-> self root-override)) @@ -745,7 +745,7 @@ ) :trans (behavior () (pelican-path-update 131072.0 150 0.0 0.0 #f) - (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-dive (-> self path-dive1) (-> self path-to-nest1) (-> *PELICAN-bank* to-nest1-time)) ) @@ -767,7 +767,7 @@ (logior! (-> v1-2 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-2 user-int8 0) 10) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self path) arg0) (set! (-> self path-pos) 0.0) (set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1))) @@ -781,14 +781,12 @@ ) :trans (behavior () (pelican-path-update 546133.3 30 0.0 0.0 #f) - (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) (-> self path-max) (* (-> self path-speed) (seconds-per-frame))) (if (= (-> self path-pos) (-> self path-max)) (go pelican-wait-at-end #f) ) - (when (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int (-> self state-float 1))) - (set! (-> self state-float 0) - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self state-float 1)) - ) + (when (not (time-elapsed? (-> self state-time) (the int (-> self state-float 1)))) + (set! (-> self state-float 0) (/ (the float (- (current-time) (-> self state-time))) (-> self state-float 1))) (vector-lerp! (-> self root-override trans) (-> self state-vector) @@ -871,9 +869,9 @@ ;; definition for method 11 of type pelican ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! pelican ((obj pelican) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! pelican ((this pelican) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -889,31 +887,31 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *pelican-sg* '()) - (set! (-> obj draw shadow-ctrl) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *pelican-sg* '()) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -81920.0 4096.0 614400.0 (the-as float 25) 409600.0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj align) (new 'process 'align-control obj)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this align) (new 'process 'align-control this)) (dotimes (s5-1 8) - (let ((v1-27 (new 'process 'curve-control obj 'path (the float (+ s5-1 1))))) - (set! (-> obj path-data s5-1) v1-27) + (let ((v1-27 (new 'process 'curve-control this 'path (the float (+ s5-1 1))))) + (set! (-> this path-data s5-1) v1-27) (logior! (-> v1-27 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) - (set! (-> obj fuel-cell) (the-as handle #f)) - (set! (-> obj cam-tracker) (the-as handle #f)) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 9)) - (set-vector! (-> obj neck twist-max) 2730.6667 2730.6667 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 61440.0) - (set! (-> obj neck ignore-angle) 16384.0) - (case (-> obj entity extra perm user-int8 0) + (set! (-> this fuel-cell) (the-as handle #f)) + (set! (-> this cam-tracker) (the-as handle #f)) + (set! (-> this neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) this 9)) + (set-vector! (-> this neck twist-max) 2730.6667 2730.6667 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 61440.0) + (set! (-> this neck ignore-angle) 16384.0) + (case (-> this entity extra perm user-int8 0) ((10) (go pelican-wait-at-end #t) ) @@ -922,18 +920,18 @@ ) ((2) (let ((s5-2 (manipy-spawn - (-> obj root-override trans) - (-> obj entity) + (-> this root-override trans) + (-> this entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) - :to obj + :to this ) ) ) - (set! (-> obj fuel-cell) (if s5-2 - (ppointer->handle s5-2) - (the-as handle #f) - ) + (set! (-> this fuel-cell) (if s5-2 + (ppointer->handle s5-2) + (the-as handle #f) + ) ) (when s5-2 (send-event diff --git a/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc b/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc index b60a95ca9b..3c12010744 100644 --- a/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/sculptor_REF.gc @@ -12,12 +12,12 @@ ) ;; definition for method 3 of type sculptor -(defmethod inspect sculptor ((obj sculptor)) +(defmethod inspect sculptor ((this sculptor)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmuse: ~D~%" (-> obj muse)) - obj + (format #t "~T~Tmuse: ~D~%" (-> this muse)) + this ) ;; failed to figure out what this is: @@ -35,10 +35,10 @@ ;; definition for method 52 of type sculptor ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-52 sculptor ((obj sculptor)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 sculptor ((this sculptor)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -53,21 +53,21 @@ ;; definition for method 48 of type sculptor ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow sculptor ((obj sculptor)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow sculptor ((this sculptor)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -103,11 +103,11 @@ ) ;; definition for method 32 of type sculptor -(defmethod play-anim! sculptor ((obj sculptor) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! sculptor ((this sculptor) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "sculptor-introduction" @@ -134,23 +134,25 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (new 'static 'spool-anim :name "sculptor-reminder-1" :index 17 :parts 2 :command-list '()) ) (((task-status need-reward-speech)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) - (set! (-> obj muse) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *sculptor-muse-sg* #f :to obj)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) + (set! (-> this muse) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *sculptor-muse-sg* #f :to this) + ) ) - (let ((v1-18 (handle->process (-> obj muse)))) + (let ((v1-18 (handle->process (-> this muse)))) (if v1-18 (set! (-> (the-as muse v1-18) draw light-index) (the-as uint 3)) ) ) - (send-event (handle->process (-> obj muse)) 'center-joint 4) - (send-event (handle->process (-> obj muse)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this muse)) 'center-joint 4) + (send-event (handle->process (-> this muse)) 'anim-mode 'clone-anim) ) (new 'static 'spool-anim :name "sculptor-resolution" @@ -164,52 +166,52 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) ;; definition for method 31 of type sculptor -(defmethod get-art-elem sculptor ((obj sculptor)) - (case (current-status (-> obj tasks)) +(defmethod get-art-elem sculptor ((this sculptor)) + (case (current-status (-> this tasks)) (((task-status invalid) (task-status need-resolution)) - (-> obj draw art-group data 11) + (-> this draw art-group data 11) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 43 of type sculptor -(defmethod process-taskable-method-43 sculptor ((obj sculptor)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 sculptor ((this sculptor)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> obj ambient) "SCU-LO01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-LO01" #f (-> this root-override trans)) ) ((< 0.71428573 f0-2) - (play-ambient (-> obj ambient) "SCU-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM05" #f (-> this root-override trans)) ) ((< 0.5714286 f0-2) - (play-ambient (-> obj ambient) "SCU-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM06" #f (-> this root-override trans)) ) ((< 0.42857143 f0-2) - (play-ambient (-> obj ambient) "SCU-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM03" #f (-> this root-override trans)) ) ((< 0.2857143 f0-2) - (play-ambient (-> obj ambient) "SCU-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM04" #f (-> this root-override trans)) ) ((< 0.14285715 f0-2) - (play-ambient (-> obj ambient) "SCU-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM01" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "SCU-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SCU-AM02" #f (-> this root-override trans)) ) ) ) @@ -358,12 +360,12 @@ ) ;; definition for method 11 of type sculptor -(defmethod init-from-entity! sculptor ((obj sculptor) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sculptor-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task misty-muse))) - (set! (-> obj muse) (the-as handle #f)) - (set! (-> obj sound-flava) (music-flava sculptor)) - (set! (-> obj draw light-index) (the-as uint 3)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! sculptor ((this sculptor) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sculptor-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task misty-muse))) + (set! (-> this muse) (the-as handle #f)) + (set! (-> this sound-flava) (music-flava sculptor)) + (set! (-> this draw light-index) (the-as uint 3)) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc b/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc index 593ef7ea03..5247acd10e 100644 --- a/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/seagull_REF.gc @@ -68,24 +68,24 @@ ) ;; definition for method 3 of type seagull -(defmethod inspect seagull ((obj seagull)) +(defmethod inspect seagull ((this seagull)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tindex: ~D~%" (-> obj index)) - (format #t "~T~Tflock: #x~X~%" (-> obj flock)) - (format #t "~T~Theading: ~f~%" (-> obj heading)) - (format #t "~T~Ttilt: ~f~%" (-> obj tilt)) - (format #t "~T~Tmax-tilt: ~f~%" (-> obj max-tilt)) - (format #t "~T~Tangletan: ~f~%" (-> obj angletan)) - (format #t "~T~Ttarget-dist: ~f~%" (-> obj target-dist)) - (format #t "~T~Tscared: ~D~%" (-> obj scared)) - (format #t "~T~Ttemp-heading: ~f~%" (-> obj temp-heading)) - (format #t "~T~Ttemp-heading-time: ~D~%" (-> obj temp-heading-time)) - (format #t "~T~Tpart-time: ~D~%" (-> obj part-time)) - (format #t "~T~Tthrust: ~f~%" (-> obj thrust)) - (format #t "~T~Tteleport: ~A~%" (-> obj teleport)) - obj + (format #t "~T~Tindex: ~D~%" (-> this index)) + (format #t "~T~Tflock: #x~X~%" (-> this flock)) + (format #t "~T~Theading: ~f~%" (-> this heading)) + (format #t "~T~Ttilt: ~f~%" (-> this tilt)) + (format #t "~T~Tmax-tilt: ~f~%" (-> this max-tilt)) + (format #t "~T~Tangletan: ~f~%" (-> this angletan)) + (format #t "~T~Ttarget-dist: ~f~%" (-> this target-dist)) + (format #t "~T~Tscared: ~D~%" (-> this scared)) + (format #t "~T~Ttemp-heading: ~f~%" (-> this temp-heading)) + (format #t "~T~Ttemp-heading-time: ~D~%" (-> this temp-heading-time)) + (format #t "~T~Tpart-time: ~D~%" (-> this part-time)) + (format #t "~T~Tthrust: ~f~%" (-> this thrust)) + (format #t "~T~Tteleport: ~A~%" (-> this teleport)) + this ) ;; definition of type seagullflock @@ -123,49 +123,49 @@ ) ;; definition for method 3 of type seagullflock -(defmethod inspect seagullflock ((obj seagullflock)) +(defmethod inspect seagullflock ((this seagullflock)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpath: ~A~%" (-> obj path)) - (format #t "~T~Ttrans: #~%" (-> obj trans)) - (format #t "~T~Tbird[64] @ #x~X~%" (-> obj bird)) - (format #t "~T~Tbirds: ~D~%" (-> obj birds)) - (format #t "~T~Tlink: ~A~%" (-> obj link)) - (format #t "~T~Tbird-at-waterfall: ~D~%" (-> obj bird-at-waterfall)) - (format #t "~T~Tbirds-at-waterfall: ~D~%" (-> obj birds-at-waterfall)) - (format #t "~T~Ttarget: #~%" (-> obj target)) - (format #t "~T~Ttargetnum: ~D~%" (-> obj targetnum)) - (format #t "~T~Talert-time: ~D~%" (-> obj alert-time)) - (format #t "~T~Tteleport-frames: ~D~%" (-> obj teleport-frames)) - (format #t "~T~Tcam-tracker: ~D~%" (-> obj cam-tracker)) - (format #t "~T~Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~T~Tsquall: ~A~%" (-> obj squall)) - (format #t "~T~Tmax-lift: ~f~%" (-> obj max-lift)) - obj + (format #t "~T~Tpath: ~A~%" (-> this path)) + (format #t "~T~Ttrans: #~%" (-> this trans)) + (format #t "~T~Tbird[64] @ #x~X~%" (-> this bird)) + (format #t "~T~Tbirds: ~D~%" (-> this birds)) + (format #t "~T~Tlink: ~A~%" (-> this link)) + (format #t "~T~Tbird-at-waterfall: ~D~%" (-> this bird-at-waterfall)) + (format #t "~T~Tbirds-at-waterfall: ~D~%" (-> this birds-at-waterfall)) + (format #t "~T~Ttarget: #~%" (-> this target)) + (format #t "~T~Ttargetnum: ~D~%" (-> this targetnum)) + (format #t "~T~Talert-time: ~D~%" (-> this alert-time)) + (format #t "~T~Tteleport-frames: ~D~%" (-> this teleport-frames)) + (format #t "~T~Tcam-tracker: ~D~%" (-> this cam-tracker)) + (format #t "~T~Tstate-time: ~D~%" (-> this state-time)) + (format #t "~T~Tsquall: ~A~%" (-> this squall)) + (format #t "~T~Tmax-lift: ~f~%" (-> this max-lift)) + this ) ;; definition for method 7 of type seagullflock ;; INFO: Return type mismatch process vs seagullflock. -(defmethod relocate seagullflock ((obj seagullflock) (arg0 int)) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) +(defmethod relocate seagullflock ((this seagullflock) (arg0 int)) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - (if (nonzero? (-> obj link)) - (&+! (-> obj link) arg0) + (if (nonzero? (-> this link)) + (&+! (-> this link) arg0) ) - (if (nonzero? (-> obj squall)) - (&+! (-> obj squall) arg0) + (if (nonzero? (-> this squall)) + (&+! (-> this squall) arg0) ) - (the-as seagullflock ((method-of-type process relocate) obj arg0)) + (the-as seagullflock ((method-of-type process relocate) this arg0)) ) ;; definition for method 10 of type seagullflock -(defmethod deactivate seagullflock ((obj seagullflock)) - (if (nonzero? (-> obj squall)) - (stop! (-> obj squall)) +(defmethod deactivate seagullflock ((this seagullflock)) + (if (nonzero? (-> this squall)) + (stop! (-> this squall)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -233,11 +233,11 @@ ;; definition for method 25 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod seagull-method-25 seagull ((obj seagull) (arg0 float)) - (let ((f1-1 (the float (sar (shl (the int (- arg0 (-> obj heading))) 48) 48))) - (f0-5 (- (-> obj tilt))) +(defmethod seagull-method-25 seagull ((this seagull) (arg0 float)) + (let ((f1-1 (the float (sar (shl (the int (- arg0 (-> this heading))) 48) 48))) + (f0-5 (- (-> this tilt))) ) - (let ((f2-0 (-> obj max-tilt))) + (let ((f2-0 (-> this max-tilt))) (set! f0-5 (cond ((< f1-1 -364.0889) (if (< (- f2-0) f0-5) @@ -260,8 +260,8 @@ ) ) ) - (set! (-> obj tilt) (- f0-5)) - (set! (-> obj heading) (the float (sar (shl (the int (+ (-> obj heading) (* 0.05 f0-5))) 48) 48))) + (set! (-> this tilt) (- f0-5)) + (set! (-> this heading) (the float (sar (shl (the int (+ (-> this heading) (* 0.05 f0-5))) 48) 48))) ) 0 (none) @@ -269,22 +269,22 @@ ;; definition for method 24 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod seagull-method-24 seagull ((obj seagull)) +(defmethod seagull-method-24 seagull ((this seagull)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> obj flock 0 target) (-> obj root-override trans)) + (vector-! s5-0 (-> this flock 0 target) (-> this root-override trans)) (when (< (vector-dot s5-0 s5-0) 6710886400.0) - (let ((v1-5 (ash 1 (-> obj index)))) - (when (not (logtest? v1-5 (-> obj flock 0 bird-at-waterfall))) - (logior! (-> obj flock 0 bird-at-waterfall) v1-5) - (+! (-> obj flock 0 birds-at-waterfall) 1) + (let ((v1-5 (ash 1 (-> this index)))) + (when (not (logtest? v1-5 (-> this flock 0 bird-at-waterfall))) + (logior! (-> this flock 0 bird-at-waterfall) v1-5) + (+! (-> this flock 0 birds-at-waterfall) 1) ) ) ) (cond - ((> (-> obj temp-heading-time) 0) - (+! (-> obj temp-heading-time) -1) - (let* ((v1-15 obj) - (f1-2 (the float (sar (shl (the int (- (-> obj temp-heading) (-> v1-15 heading))) 48) 48))) + ((> (-> this temp-heading-time) 0) + (+! (-> this temp-heading-time) -1) + (let* ((v1-15 this) + (f1-2 (the float (sar (shl (the int (- (-> this temp-heading) (-> v1-15 heading))) 48) 48))) (f0-7 (- (-> v1-15 tilt))) ) (let ((f2-0 (-> v1-15 max-tilt))) @@ -317,7 +317,7 @@ ) (else (let* ((f0-15 (atan (-> s5-0 x) (-> s5-0 z))) - (v1-18 obj) + (v1-18 this) (f1-12 (the float (sar (shl (the int (- f0-15 (-> v1-18 heading))) 48) 48))) (f0-20 (- (-> v1-18 tilt))) ) @@ -351,8 +351,8 @@ ) ) (let ((f0-28 (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))) - (set! (-> obj angletan) (/ (- (-> s5-0 y)) (sqrtf f0-28))) - (set! (-> obj target-dist) (sqrtf (+ f0-28 (* (-> s5-0 y) (-> s5-0 y))))) + (set! (-> this angletan) (/ (- (-> s5-0 y)) (sqrtf f0-28))) + (set! (-> this target-dist) (sqrtf (+ f0-28 (* (-> s5-0 y) (-> s5-0 y))))) ) ) 0 @@ -503,11 +503,11 @@ ;; definition for method 20 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod move-vertically! seagull ((obj seagull) (arg0 symbol)) - (let ((f0-0 (-> obj root-override transv y))) +(defmethod move-vertically! seagull ((this seagull) (arg0 symbol)) + (let ((f0-0 (-> this root-override transv y))) (set! f0-0 (cond (arg0 - (if (< f0-0 (-> obj flock 0 max-lift)) + (if (< f0-0 (-> this flock 0 max-lift)) (set! f0-0 (+ 12288.0 f0-0)) ) f0-0 @@ -517,46 +517,46 @@ ) ) ) - (set! (-> obj root-override transv y) f0-0) + (set! (-> this root-override transv y) f0-0) ) 0 (none) ) ;; definition for method 26 of type seagull -(defmethod seagull-method-26 seagull ((obj seagull)) +(defmethod seagull-method-26 seagull ((this seagull)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((f30-0 -4096.0) (f28-0 8192.0) ) - (set! (-> s5-0 x) (+ f30-0 (* f28-0 (rand-float-gen)) (-> obj flock 0 target x))) + (set! (-> s5-0 x) (+ f30-0 (* f28-0 (rand-float-gen)) (-> this flock 0 target x))) ) (let ((f30-1 -4096.0) (f28-1 8192.0) ) - (set! (-> s5-0 y) (+ f30-1 (* f28-1 (rand-float-gen)) (-> obj flock 0 target y))) + (set! (-> s5-0 y) (+ f30-1 (* f28-1 (rand-float-gen)) (-> this flock 0 target y))) ) (let ((f30-2 -4096.0) (f28-2 8192.0) ) - (set! (-> s5-0 z) (+ f30-2 (* f28-2 (rand-float-gen)) (-> obj flock 0 target z))) + (set! (-> s5-0 z) (+ f30-2 (* f28-2 (rand-float-gen)) (-> this flock 0 target z))) ) - (vector-! s5-0 s5-0 (-> obj root-override trans)) + (vector-! s5-0 s5-0 (-> this root-override trans)) (vector-float*! s5-0 s5-0 0.9) - (move-by-vector! (-> obj root-override) s5-0) + (move-by-vector! (-> this root-override) s5-0) ) - (set! (-> obj teleport) #f) + (set! (-> this teleport) #f) #f ) ;; definition for method 21 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod adjust-heading-around-point-slow! seagull ((obj seagull) (arg0 float)) - (let ((f30-1 (* arg0 (sin (-> obj heading)))) - (f0-4 (* arg0 (cos (-> obj heading)))) +(defmethod adjust-heading-around-point-slow! seagull ((this seagull) (arg0 float)) + (let ((f30-1 (* arg0 (sin (-> this heading)))) + (f0-4 (* arg0 (cos (-> this heading)))) ) - (set! (-> obj root-override transv x) (+ (* 0.8 (-> obj root-override transv x)) (* 0.2 f30-1))) - (set! (-> obj root-override transv z) (+ (* 0.8 (-> obj root-override transv z)) (* 0.2 f0-4))) + (set! (-> this root-override transv x) (+ (* 0.8 (-> this root-override transv x)) (* 0.2 f30-1))) + (set! (-> this root-override transv z) (+ (* 0.8 (-> this root-override transv z)) (* 0.2 f0-4))) ) 0 (none) @@ -564,12 +564,12 @@ ;; definition for method 23 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod adjust-heading-around-point! seagull ((obj seagull) (arg0 float)) - (let ((f30-1 (* arg0 (sin (-> obj heading)))) - (f0-4 (* arg0 (cos (-> obj heading)))) +(defmethod adjust-heading-around-point! seagull ((this seagull) (arg0 float)) + (let ((f30-1 (* arg0 (sin (-> this heading)))) + (f0-4 (* arg0 (cos (-> this heading)))) ) - (set! (-> obj root-override transv x) f30-1) - (set! (-> obj root-override transv z) f0-4) + (set! (-> this root-override transv x) f30-1) + (set! (-> this root-override transv z) f0-4) ) 0 (none) @@ -577,14 +577,14 @@ ;; definition for method 22 of type seagull ;; INFO: Return type mismatch int vs none. -(defmethod seagull-method-22 seagull ((obj seagull)) - (set! (-> obj root-override transv y) -8192.0) +(defmethod seagull-method-22 seagull ((this seagull)) + (set! (-> this root-override transv y) -8192.0) 0 (none) ) ;; definition for method 27 of type seagull -(defmethod seagull-method-27 seagull ((obj seagull)) +(defmethod seagull-method-27 seagull ((this seagull)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -592,13 +592,13 @@ ) (init-vf0-vector) (let ((v1-0 (new 'stack-no-clear 'vector)) - (a0-2 (-> obj root-override trans)) - (s5-0 (-> obj root-override transv)) + (a0-2 (-> this root-override trans)) + (s5-0 (-> this root-override transv)) (a1-1 (new 'stack-no-clear 'vector)) ) (let ((a2-0 v1-0)) (.lvf vf1 (&-> s5-0 quad)) - (let ((f0-0 (-> *display* seconds-per-frame))) + (let ((f0-0 (seconds-per-frame))) (.mov at-0 f0-0) ) (.mov vf2 at-0) @@ -608,8 +608,8 @@ ) (vector+! a1-1 a0-2 v1-0) (if (points-in-air? a0-2 a1-1 *seagull-boxes* 10) - (integrate-no-collide! (-> obj root-override) (-> obj root-override transv)) - (fill-cache-integrate-and-collide! (-> obj root-override) s5-0 (collide-kind background)) + (integrate-no-collide! (-> this root-override) (-> this root-override transv)) + (fill-cache-integrate-and-collide! (-> this root-override) s5-0 (collide-kind background)) ) ) (none) @@ -619,13 +619,13 @@ ;; failed to figure out what this is: (defstate seagull-takeoff (seagull) :trans (behavior () - (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) + (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) ) :code (behavior () - (set! (-> self part-time) (-> *display* base-frame-counter)) + (set-time! (-> self part-time)) (ja-no-eval :group! seagull-takeoff-ja :num! (seek! (ja-aframe 4.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) (when (and (>= (ja-frame-num 0) (ja-aframe 2.0 0)) (>= (ja-aframe 3.0 0) (ja-frame-num 0))) @@ -672,7 +672,7 @@ ;; failed to figure out what this is: (defstate seagull-flying (seagull) :trans (behavior () - (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) + (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) @@ -863,13 +863,13 @@ ;; failed to figure out what this is: (defstate seagull-soaring (seagull) :trans (behavior () - (when (< (+ (-> *display* base-frame-counter) (seconds -2)) (-> self part-time)) + (when (< (+ (current-time) (seconds -2)) (-> self part-time)) (-> self part) (-> self root-override root-prim prim-core) ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self max-tilt) 4551.1113) (loop (ja-no-eval :group! seagull-slowfly-ja :num! (seek!) :frame-num 0.0) @@ -987,7 +987,7 @@ (go seagull-flying) ) (when (< (-> self root-override trans y) 204800.0) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) (let* ((f30-1 0.99) (v1-67 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-68 (the-as number (logior #x3f800000 v1-67))) @@ -1048,7 +1048,7 @@ (vector+! gp-0 gp-0 (-> self root-override trans)) (while (< 0.5 f30-0) (suspend) - (set! f30-0 (- f30-0 (-> *display* seconds-per-frame))) + (set! f30-0 (- f30-0 (seconds-per-frame))) (fill-cache-integrate-and-collide! (-> self root-override) (-> self root-override transv) @@ -1092,7 +1092,7 @@ (while (< 0.0 f30-0) (suspend) (ja :num! (seek!)) - (set! f30-0 (- f30-0 (-> *display* seconds-per-frame))) + (set! f30-0 (- f30-0 (seconds-per-frame))) (fill-cache-integrate-and-collide! (-> self root-override) (-> self root-override transv) @@ -1242,30 +1242,30 @@ ;; definition for method 15 of type seagullflock ;; INFO: Return type mismatch time-frame vs none. -(defmethod play-hint seagullflock ((obj seagullflock) (arg0 int)) - (when (>= (- (-> *display* base-frame-counter) (-> obj alert-time)) (seconds 5)) - (eval-path-curve-div! (-> obj path) (-> obj target) (the float (-> obj targetnum)) 'interp) +(defmethod play-hint seagullflock ((this seagullflock) (arg0 int)) + (when (time-elapsed? (-> this alert-time) (seconds 5)) + (eval-path-curve-div! (-> this path) (-> this target) (the float (-> this targetnum)) 'interp) (let ((f0-2 4096.0) - (v1-6 (-> obj targetnum)) + (v1-6 (-> this targetnum)) ) - (set! (-> obj max-lift) (* f0-2 (cond - ((= v1-6 1) - 4.0 - ) - ((= v1-6 2) - 4.0 - ) - ((= v1-6 3) - 4.0 - ) - (else - 10.0 + (set! (-> this max-lift) (* f0-2 (cond + ((= v1-6 1) + 4.0 ) - ) - ) + ((= v1-6 2) + 4.0 + ) + ((= v1-6 3) + 4.0 + ) + (else + 10.0 + ) + ) + ) ) ) - (case (-> obj targetnum) + (case (-> this targetnum) ((1) (level-hint-spawn (text-id sidekick-seagulls1) "sksp0020" (the-as entity #f) *entity-pool* (game-task none)) ) @@ -1279,30 +1279,30 @@ (level-hint-spawn (text-id sidekick-seagulls4) "sksp0024" (the-as entity #f) *entity-pool* (game-task none)) ) ) - (let ((v1-16 (-> obj entity extra perm))) + (let ((v1-16 (-> this entity extra perm))) (logior! (-> v1-16 status) (entity-perm-status user-set-from-cstage)) - (set! (-> v1-16 user-int8 0) (min 2 (-> obj targetnum))) + (set! (-> v1-16 user-int8 0) (min 2 (-> this targetnum))) ) - (+! (-> obj targetnum) 1) - (dotimes (v1-19 (-> obj birds)) - (set! (-> obj bird v1-19 0 scared) (+ (* v1-19 2) 5)) + (+! (-> this targetnum) 1) + (dotimes (v1-19 (-> this birds)) + (set! (-> this bird v1-19 0 scared) (+ (* v1-19 2) 5)) ) - (set! (-> obj bird arg0 0 scared) 1) - (set! (-> obj bird-at-waterfall) (the-as uint 0)) - (set! (-> obj birds-at-waterfall) 0) - (if (>= (-> obj targetnum) 4) - (set! (-> obj teleport-frames) 1500) + (set! (-> this bird arg0 0 scared) 1) + (set! (-> this bird-at-waterfall) (the-as uint 0)) + (set! (-> this birds-at-waterfall) 0) + (if (>= (-> this targetnum) 4) + (set! (-> this teleport-frames) 1500) ) (sound-play "seagull-takeoff") - (set! (-> obj alert-time) (-> *display* base-frame-counter)) + (set-time! (-> this alert-time)) ) (none) ) ;; definition for method 16 of type seagullflock -(defmethod seagullflock-method-16 seagullflock ((obj seagullflock) (arg0 seagull)) +(defmethod seagullflock-method-16 seagullflock ((this seagullflock) (arg0 seagull)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (eval-path-curve-div! (-> obj path) gp-0 (the float (-> obj targetnum)) 'interp) + (eval-path-curve-div! (-> this path) gp-0 (the float (-> this targetnum)) 'interp) (vector-! gp-0 gp-0 (-> arg0 root-override trans)) (atan (-> gp-0 x) (-> gp-0 z)) ) @@ -1317,7 +1317,7 @@ (t9-1 (function process-tree event-message-block object)) ) (aybabtu 2) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (-> self link next) (until (t9-1 a0-2 a1-0) (suspend) @@ -1333,7 +1333,7 @@ ) ) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self teleport-frames)) + (until (time-elapsed? (-> self state-time) (-> self teleport-frames)) (suspend) ) (close-specific-task! (game-task beach-seagull) (task-status need-reminder)) @@ -1384,23 +1384,23 @@ ;; definition for method 11 of type seagullflock ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! seagullflock ((obj seagullflock) (arg0 entity-actor)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj targetnum) (+ (-> arg0 extra perm user-int8 0) 1)) - (eval-path-curve-div! (-> obj path) (-> obj trans) (the float (+ (-> obj targetnum) -1)) 'interp) - (set! (-> obj target quad) (-> obj trans quad)) - (set! (-> obj max-lift) 20480.0) - (set! (-> obj birds) 0) +(defmethod init-from-entity! seagullflock ((this seagullflock) (arg0 entity-actor)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this targetnum) (+ (-> arg0 extra perm user-int8 0) 1)) + (eval-path-curve-div! (-> this path) (-> this trans) (the float (+ (-> this targetnum) -1)) 'interp) + (set! (-> this target quad) (-> this trans quad)) + (set! (-> this max-lift) 20480.0) + (set! (-> this birds) 0) (dotimes (v1-16 64) - (set! (-> obj bird v1-16) (the-as (pointer seagull) #f)) + (set! (-> this bird v1-16) (the-as (pointer seagull) #f)) ) - (spawn-bird obj (-> obj trans)) + (spawn-bird this (-> this trans)) (dotimes (s5-1 20) (let ((s4-0 (new 'stack-no-clear 'vector))) - (let* ((f30-0 (-> obj trans x)) + (let* ((f30-0 (-> this trans x)) (f28-0 4096.0) (f26-0 10.0) (v1-22 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -1408,7 +1408,7 @@ ) (set! (-> s4-0 x) (+ f30-0 (* f28-0 (* f26-0 (+ -1.0 (the-as float v1-23)))))) ) - (let* ((f30-1 (-> obj trans z)) + (let* ((f30-1 (-> this trans z)) (f28-1 4096.0) (f26-1 10.0) (v1-26 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -1416,26 +1416,26 @@ ) (set! (-> s4-0 z) (+ f30-1 (* f28-1 (* f26-1 (+ -1.0 (the-as float v1-27)))))) ) - (set! (-> s4-0 y) (-> obj trans y)) + (set! (-> s4-0 y) (-> this trans y)) (set! (-> s4-0 w) 1.0) - (spawn-bird obj s4-0) + (spawn-bird this s4-0) ) ) - (set! (-> obj squall) (new 'process 'ambient-sound sound-seagull-squall (-> obj trans))) - (set! (-> obj teleport-frames) 0) - (logior! (-> obj mask) (process-mask enemy)) + (set! (-> this squall) (new 'process 'ambient-sound sound-seagull-squall (-> this trans))) + (set! (-> this teleport-frames) 0) + (logior! (-> this mask) (process-mask enemy)) (go seagullflock-idle) (none) ) ;; definition for method 14 of type seagullflock -(defmethod spawn-bird seagullflock ((obj seagullflock) (arg0 vector)) - (if (= (-> obj birds) 64) +(defmethod spawn-bird seagullflock ((this seagullflock) (arg0 vector)) + (if (= (-> this birds) 64) (return (the-as (pointer process) #f)) ) - (let ((v0-0 (process-spawn seagull arg0 (-> obj birds) obj :to obj))) - (set! (-> obj bird (-> obj birds)) (the-as (pointer seagull) v0-0)) - (+! (-> obj birds) 1) + (let ((v0-0 (process-spawn seagull arg0 (-> this birds) this :to this))) + (set! (-> this bird (-> this birds)) (the-as (pointer seagull) v0-0)) + (+! (-> this birds) 1) v0-0 ) ) diff --git a/test/decompiler/reference/jak1/levels/beach/twister_REF.gc b/test/decompiler/reference/jak1/levels/beach/twister_REF.gc index 28214bbbd7..878664486f 100644 --- a/test/decompiler/reference/jak1/levels/beach/twister_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/twister_REF.gc @@ -13,11 +13,11 @@ ) ;; definition for method 3 of type twist-joint -(defmethod inspect twist-joint ((obj twist-joint)) - (format #t "[~8x] ~A~%" obj 'twist-joint) - (format #t "~Try: ~f~%" (-> obj ry)) - (format #t "~Tmax-dry: ~f~%" (-> obj max-dry)) - obj +(defmethod inspect twist-joint ((this twist-joint)) + (format #t "[~8x] ~A~%" this 'twist-joint) + (format #t "~Try: ~f~%" (-> this ry)) + (format #t "~Tmax-dry: ~f~%" (-> this max-dry)) + this ) ;; definition of type twister @@ -47,19 +47,19 @@ ) ;; definition for method 3 of type twister -(defmethod inspect twister ((obj twister)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~Tfirst-joint: ~D~%" (-> obj first-joint)) - (format #t "~Tlast-joint: ~D~%" (-> obj last-joint)) - (format #t "~Tmax-speed: ~f~%" (-> obj max-speed)) - (format #t "~Tsmoothing: ~f~%" (-> obj smoothing)) - (format #t "~Tmin-dist: ~f~%" (-> obj min-dist)) - (format #t "~Ttarget: ~f~%" (-> obj target)) - (format #t "~Try: ~f~%" (-> obj ry)) - (format #t "~Tmax-speed-ry: ~f~%" (-> obj max-speed-ry)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect twister ((this twister)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~Tfirst-joint: ~D~%" (-> this first-joint)) + (format #t "~Tlast-joint: ~D~%" (-> this last-joint)) + (format #t "~Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~Tsmoothing: ~f~%" (-> this smoothing)) + (format #t "~Tmin-dist: ~f~%" (-> this min-dist)) + (format #t "~Ttarget: ~f~%" (-> this target)) + (format #t "~Try: ~f~%" (-> this ry)) + (format #t "~Tmax-speed-ry: ~f~%" (-> this max-speed-ry)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; definition for method 0 of type twister @@ -93,18 +93,18 @@ ) ;; definition for method 5 of type twister -(defmethod asize-of twister ((obj twister)) - (+ (* (-> obj num-joints) 16) 40) +(defmethod asize-of twister ((this twister)) + (+ (* (-> this num-joints) 16) 40) ) ;; definition for method 9 of type twister ;; INFO: Return type mismatch int vs none. -(defmethod twister-method-9 twister ((obj twister) (arg0 int) (arg1 int) (arg2 float)) - (let ((v1-1 (- arg0 (-> obj first-joint))) - (a1-2 (- arg1 (-> obj first-joint))) +(defmethod twister-method-9 twister ((this twister) (arg0 int) (arg1 int) (arg2 float)) + (let ((v1-1 (- arg0 (-> this first-joint))) + (a1-2 (- arg1 (-> this first-joint))) ) (while (>= a1-2 v1-1) - (set! (-> obj data v1-1 max-dry) arg2) + (set! (-> this data v1-1 max-dry) arg2) (+! v1-1 1) ) ) @@ -114,25 +114,25 @@ ;; definition for method 10 of type twister ;; INFO: Return type mismatch int vs none. -(defmethod set-target! twister ((obj twister) (arg0 float)) - (set! (-> obj target) arg0) +(defmethod set-target! twister ((this twister) (arg0 float)) + (set! (-> this target) arg0) 0 (none) ) ;; definition for method 11 of type twister ;; INFO: Return type mismatch int vs none. -(defmethod twister-method-11 twister ((obj twister)) - (let* ((s5-0 (+ (-> obj num-joints) -1)) - (s4-0 (-> obj data s5-0)) +(defmethod twister-method-11 twister ((this twister)) + (let* ((s5-0 (+ (-> this num-joints) -1)) + (s4-0 (-> this data s5-0)) ) - (let ((f0-2 (deg-diff (-> s4-0 ry) (-> obj target)))) - (+! (-> s4-0 ry) (seek-with-smooth 0.0 f0-2 (-> obj max-speed) (-> obj smoothing) (-> obj min-dist))) + (let ((f0-2 (deg-diff (-> s4-0 ry) (-> this target)))) + (+! (-> s4-0 ry) (seek-with-smooth 0.0 f0-2 (-> this max-speed) (-> this smoothing) (-> this min-dist))) ) (let ((f30-1 (-> s4-0 ry))) (while (> s5-0 0) (+! s5-0 -1) - (let ((s4-1 (-> obj data s5-0))) + (let ((s4-1 (-> this data s5-0))) (let ((f0-9 (deg-diff f30-1 (-> s4-1 ry)))) (cond ((= (-> s4-1 max-dry) 0.0) @@ -142,11 +142,13 @@ ) ((< f0-9 0.0) (set! f0-9 - (seek-with-smooth f0-9 (- (-> s4-1 max-dry)) (-> obj max-speed) (-> obj smoothing) (-> obj min-dist)) + (seek-with-smooth f0-9 (- (-> s4-1 max-dry)) (-> this max-speed) (-> this smoothing) (-> this min-dist)) ) ) (else - (set! f0-9 (seek-with-smooth f0-9 (-> s4-1 max-dry) (-> obj max-speed) (-> obj smoothing) (-> obj min-dist))) + (set! f0-9 + (seek-with-smooth f0-9 (-> s4-1 max-dry) (-> this max-speed) (-> this smoothing) (-> this min-dist)) + ) ) ) (+! f30-1 f0-9) @@ -162,11 +164,11 @@ ;; definition for method 12 of type twister ;; INFO: Return type mismatch int vs none. -(defmethod twister-method-12 twister ((obj twister) (arg0 process-drawable)) +(defmethod twister-method-12 twister ((this twister) (arg0 process-drawable)) (let ((s4-0 (new 'stack-no-clear 'matrix))) - (dotimes (s3-0 (-> obj num-joints)) - (let ((s2-0 (-> arg0 node-list data (+ (-> obj first-joint) s3-0) bone transform))) - (matrix-rotate-y! s4-0 (-> obj data s3-0 ry)) + (dotimes (s3-0 (-> this num-joints)) + (let ((s2-0 (-> arg0 node-list data (+ (-> this first-joint) s3-0) bone transform))) + (matrix-rotate-y! s4-0 (-> this data s3-0 ry)) (vector-! (-> s2-0 vector 3) (-> s2-0 vector 3) (-> arg0 root trans)) (matrix*! s2-0 s2-0 s4-0) (vector+! (-> s2-0 vector 3) (-> s2-0 vector 3) (-> arg0 root trans)) diff --git a/test/decompiler/reference/jak1/levels/beach/wobbler_REF.gc b/test/decompiler/reference/jak1/levels/beach/wobbler_REF.gc index 63d6e4529e..92c273bcc7 100644 --- a/test/decompiler/reference/jak1/levels/beach/wobbler_REF.gc +++ b/test/decompiler/reference/jak1/levels/beach/wobbler_REF.gc @@ -23,63 +23,63 @@ ) ;; definition for method 3 of type wobbler -(defmethod inspect wobbler ((obj wobbler)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tposx: ~f~%" (-> obj posx)) - (format #t "~Tposy: ~f~%" (-> obj posy)) - (format #t "~Tvelx: ~f~%" (-> obj velx)) - (format #t "~Tvely: ~f~%" (-> obj vely)) - (format #t "~Tspring: ~f~%" (-> obj spring)) - (format #t "~Tdamping: ~f~%" (-> obj damping)) - (format #t "~Theight: ~f~%" (-> obj height)) - obj +(defmethod inspect wobbler ((this wobbler)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tposx: ~f~%" (-> this posx)) + (format #t "~Tposy: ~f~%" (-> this posy)) + (format #t "~Tvelx: ~f~%" (-> this velx)) + (format #t "~Tvely: ~f~%" (-> this vely)) + (format #t "~Tspring: ~f~%" (-> this spring)) + (format #t "~Tdamping: ~f~%" (-> this damping)) + (format #t "~Theight: ~f~%" (-> this height)) + this ) ;; definition for method 9 of type wobbler ;; INFO: Return type mismatch int vs none. -(defmethod reset! wobbler ((obj wobbler) (arg0 float) (arg1 float) (arg2 float)) - (set! (-> obj posx) 0.0) - (set! (-> obj posy) 0.0) - (set! (-> obj velx) 0.0) - (set! (-> obj vely) 0.0) - (set! (-> obj spring) arg0) - (set! (-> obj damping) arg1) - (set! (-> obj height) arg2) +(defmethod reset! wobbler ((this wobbler) (arg0 float) (arg1 float) (arg2 float)) + (set! (-> this posx) 0.0) + (set! (-> this posy) 0.0) + (set! (-> this velx) 0.0) + (set! (-> this vely) 0.0) + (set! (-> this spring) arg0) + (set! (-> this damping) arg1) + (set! (-> this height) arg2) 0 (none) ) ;; definition for method 10 of type wobbler ;; INFO: Return type mismatch int vs none. -(defmethod inc-xy-vel! wobbler ((obj wobbler) (arg0 float) (arg1 float)) - (+! (-> obj velx) arg0) - (+! (-> obj vely) arg1) +(defmethod inc-xy-vel! wobbler ((this wobbler) (arg0 float) (arg1 float)) + (+! (-> this velx) arg0) + (+! (-> this vely) arg1) 0 (none) ) ;; definition for method 11 of type wobbler ;; INFO: Return type mismatch int vs none. -(defmethod move! wobbler ((obj wobbler)) - (+! (-> obj posx) (* (-> obj velx) (-> *display* seconds-per-frame))) - (+! (-> obj posy) (* (-> obj vely) (-> *display* seconds-per-frame))) - (set! (-> obj velx) (* (-> obj velx) (-> obj damping))) - (set! (-> obj vely) (* (-> obj vely) (-> obj damping))) - (+! (-> obj velx) (* -1.0 (-> obj posx) (-> obj spring))) - (+! (-> obj vely) (* -1.0 (-> obj posy) (-> obj spring))) +(defmethod move! wobbler ((this wobbler)) + (+! (-> this posx) (* (-> this velx) (seconds-per-frame))) + (+! (-> this posy) (* (-> this vely) (seconds-per-frame))) + (set! (-> this velx) (* (-> this velx) (-> this damping))) + (set! (-> this vely) (* (-> this vely) (-> this damping))) + (+! (-> this velx) (* -1.0 (-> this posx) (-> this spring))) + (+! (-> this vely) (* -1.0 (-> this posy) (-> this spring))) 0 (none) ) ;; definition for method 12 of type wobbler ;; INFO: Return type mismatch int vs none. -(defmethod wobbler-method-12 wobbler ((obj wobbler) (arg0 quaternion)) +(defmethod wobbler-method-12 wobbler ((this wobbler) (arg0 quaternion)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 x) (-> obj posy)) + (set! (-> s5-0 x) (-> this posy)) (set! (-> s5-0 y) 0.0) - (set! (-> s5-0 z) (- (-> obj posx))) + (set! (-> s5-0 z) (- (-> this posx))) (vector-normalize! s5-0 1.0) - (let* ((f0-8 (/ (sqrtf (+ (* (-> obj posx) (-> obj posx)) (* (-> obj posy) (-> obj posy)))) (-> obj height))) + (let* ((f0-8 (/ (sqrtf (+ (* (-> this posx) (-> this posx)) (* (-> this posy) (-> this posy)))) (-> this height))) (f0-9 (atan f0-8 1.0)) ) (quaternion-vector-angle! arg0 s5-0 f0-9) diff --git a/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc b/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc index 9ad5f43c34..f325a70635 100644 --- a/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/assistant-citadel_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type assistant-lavatube-end -(defmethod inspect assistant-lavatube-end ((obj assistant-lavatube-end)) +(defmethod inspect assistant-lavatube-end ((this assistant-lavatube-end)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -26,14 +26,14 @@ ) ;; definition for method 32 of type assistant-lavatube-end -(defmethod play-anim! assistant-lavatube-end ((obj assistant-lavatube-end) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! assistant-lavatube-end ((this assistant-lavatube-end) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint)) (new 'static 'spool-anim :name "assistant-lavatube-end-resolution" :index 4 :parts 11 :command-list '()) ) (((task-status need-reward-speech)) (if arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "assistant-lavatube-end-resolution" @@ -60,18 +60,18 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) ;; definition for method 31 of type assistant-lavatube-end -(defmethod get-art-elem assistant-lavatube-end ((obj assistant-lavatube-end)) - (-> obj draw art-group data 3) +(defmethod get-art-elem assistant-lavatube-end ((this assistant-lavatube-end)) + (-> this draw art-group data 3) ) ;; failed to figure out what this is: @@ -114,9 +114,9 @@ ) ;; definition for method 39 of type assistant-lavatube-end -(defmethod should-display? assistant-lavatube-end ((obj assistant-lavatube-end)) - (first-any (-> obj tasks) #t) - (let ((v1-3 (current-status (-> obj tasks)))) +(defmethod should-display? assistant-lavatube-end ((this assistant-lavatube-end)) + (first-any (-> this tasks) #t) + (let ((v1-3 (current-status (-> this tasks)))) (and (or (= v1-3 (task-status need-reward-speech)) (= v1-3 (task-status invalid))) (not (task-closed? (game-task citadel-sage-green) (task-status need-hint))) ) @@ -124,10 +124,10 @@ ) ;; definition for method 11 of type assistant-lavatube-end -(defmethod init-from-entity! assistant-lavatube-end ((obj assistant-lavatube-end) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-lavatube-end-sg* 3 29 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task village4-button))) - (first-any (-> obj tasks) #t) - (process-taskable-method-42 obj) +(defmethod init-from-entity! assistant-lavatube-end ((this assistant-lavatube-end) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-lavatube-end-sg* 3 29 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task village4-button))) + (first-any (-> this tasks) #t) + (process-taskable-method-42 this) (none) ) 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 0751a6acd6..8621d9585c 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-obs_REF.gc @@ -21,16 +21,16 @@ ) ;; definition for method 3 of type citb-arm-section -(defmethod inspect citb-arm-section ((obj citb-arm-section)) +(defmethod inspect citb-arm-section ((this citb-arm-section)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tcull-dir-local: #~%" (-> obj cull-dir-local)) - (format #t "~T~Tcull-dot: ~f~%" (-> obj cull-dot)) - (format #t "~T~Trot-scale: ~f~%" (-> obj rot-scale)) - (format #t "~T~Ty-angle: ~f~%" (-> obj y-angle)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tcull-dir-local: #~%" (-> this cull-dir-local)) + (format #t "~T~Tcull-dot: ~f~%" (-> this cull-dot)) + (format #t "~T~Trot-scale: ~f~%" (-> this rot-scale)) + (format #t "~T~Ty-angle: ~f~%" (-> this y-angle)) + this ) ;; failed to figure out what this is: @@ -113,42 +113,42 @@ ;; definition for method 20 of type citb-arm-section ;; INFO: Return type mismatch int vs none. -(defmethod init-root! citb-arm-section ((obj citb-arm-section)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod init-root! citb-arm-section ((this citb-arm-section)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) ;; definition for method 21 of type citb-arm-section ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm-section ((obj citb-arm-section)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) +(defmethod setup-new-process! citb-arm-section ((this citb-arm-section)) + (logclear! (-> this mask) (process-mask actor-pause)) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (cond - ((> (-> obj sync period) 0) - (set! (-> obj rot-scale) 1.0) + ((> (-> this sync period) 0) + (set! (-> this rot-scale) 1.0) ) (else - (set! (-> obj rot-scale) -1.0) - (let ((v1-6 (abs (the-as int (-> obj sync period))))) - (set! (-> obj sync period) (the-as uint v1-6)) + (set! (-> this rot-scale) -1.0) + (let ((v1-6 (abs (the-as int (-> this sync period))))) + (set! (-> this sync period) (the-as uint v1-6)) ) ) ) - (logior! (-> obj skel status) (janim-status inited)) - (set-vector! (-> obj cull-dir-local) 0.0 0.0 -1.0 1.0) - (set! (-> obj cull-dot) (cos 5461.3335)) + (logior! (-> this skel status) (janim-status inited)) + (set-vector! (-> this cull-dir-local) 0.0 0.0 -1.0 1.0) + (set! (-> this cull-dot) (cos 5461.3335)) 0 (none) ) ;; definition for method 11 of type citb-arm-section ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-arm-section ((obj citb-arm-section) (arg0 entity-actor)) - (init-root! obj) - (process-drawable-from-entity! obj arg0) - (setup-new-process! obj) - (go (method-of-object obj idle)) +(defmethod init-from-entity! citb-arm-section ((this citb-arm-section) (arg0 entity-actor)) + (init-root! this) + (process-drawable-from-entity! this arg0) + (setup-new-process! this) + (go (method-of-object this idle)) (none) ) @@ -163,11 +163,11 @@ ) ;; definition for method 3 of type citb-arm -(defmethod inspect citb-arm ((obj citb-arm)) +(defmethod inspect citb-arm ((this citb-arm)) (let ((t9-0 (method-of-type citb-arm-section inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -185,8 +185,8 @@ ;; definition for method 20 of type citb-arm ;; INFO: Return type mismatch int vs none. -(defmethod init-root! citb-arm ((obj citb-arm)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-root! citb-arm ((this citb-arm)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -204,7 +204,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -212,11 +212,11 @@ ;; definition for method 21 of type citb-arm ;; INFO: Return type mismatch int vs none. -(defmethod setup-new-process! citb-arm ((obj citb-arm)) - ((the-as (function citb-arm-section none) (find-parent-method citb-arm 21)) 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)) +(defmethod setup-new-process! citb-arm ((this citb-arm)) + ((the-as (function citb-arm-section none) (find-parent-method citb-arm 21)) 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)) 0 (none) ) @@ -231,20 +231,20 @@ ) ;; definition for method 3 of type citb-arm-shoulder -(defmethod inspect citb-arm-shoulder ((obj citb-arm-shoulder)) +(defmethod inspect citb-arm-shoulder ((this citb-arm-shoulder)) (let ((t9-0 (method-of-type citb-arm-section inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 21 of type citb-arm-shoulder ;; INFO: Return type mismatch int vs none. -(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) - (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)) +(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) + (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)) 0 (none) ) @@ -259,11 +259,11 @@ ) ;; definition for method 3 of type citb-arm-a -(defmethod inspect citb-arm-a ((obj citb-arm-a)) +(defmethod inspect citb-arm-a ((this citb-arm-a)) (let ((t9-0 (method-of-type citb-arm inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type citb-arm-b @@ -276,11 +276,11 @@ ) ;; definition for method 3 of type citb-arm-b -(defmethod inspect citb-arm-b ((obj citb-arm-b)) +(defmethod inspect citb-arm-b ((this citb-arm-b)) (let ((t9-0 (method-of-type citb-arm inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type citb-arm-c @@ -293,11 +293,11 @@ ) ;; definition for method 3 of type citb-arm-c -(defmethod inspect citb-arm-c ((obj citb-arm-c)) +(defmethod inspect citb-arm-c ((this citb-arm-c)) (let ((t9-0 (method-of-type citb-arm inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type citb-arm-d @@ -310,11 +310,11 @@ ) ;; definition for method 3 of type citb-arm-d -(defmethod inspect citb-arm-d ((obj citb-arm-d)) +(defmethod inspect citb-arm-d ((this citb-arm-d)) (let ((t9-0 (method-of-type citb-arm inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type citb-arm-shoulder-a @@ -327,11 +327,11 @@ ) ;; definition for method 3 of type citb-arm-shoulder-a -(defmethod inspect citb-arm-shoulder-a ((obj citb-arm-shoulder-a)) +(defmethod inspect citb-arm-shoulder-a ((this citb-arm-shoulder-a)) (let ((t9-0 (method-of-type citb-arm-shoulder inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type citb-arm-shoulder-b @@ -344,67 +344,67 @@ ) ;; definition for method 3 of type citb-arm-shoulder-b -(defmethod inspect citb-arm-shoulder-b ((obj citb-arm-shoulder-b)) +(defmethod inspect citb-arm-shoulder-b ((this citb-arm-shoulder-b)) (let ((t9-0 (method-of-type citb-arm-shoulder inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 21 of type citb-arm-a ;; INFO: Return type mismatch int vs none. -(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) - (set! (-> obj root-override root-prim local-sphere z) -184320.0) +(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) + (set! (-> this root-override root-prim local-sphere z) -184320.0) 0 (none) ) ;; definition for method 21 of type citb-arm-b ;; INFO: Return type mismatch int vs none. -(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) - (set! (-> obj root-override root-prim local-sphere z) -225280.0) +(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) + (set! (-> this root-override root-prim local-sphere z) -225280.0) 0 (none) ) ;; definition for method 21 of type citb-arm-c ;; INFO: Return type mismatch int vs none. -(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) - (set! (-> obj root-override root-prim local-sphere z) -266240.0) +(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) + (set! (-> this root-override root-prim local-sphere z) -266240.0) 0 (none) ) ;; definition for method 21 of type citb-arm-d ;; INFO: Return type mismatch int vs none. -(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) - (set! (-> obj root-override root-prim local-sphere z) -307200.0) +(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) + (set! (-> this root-override root-prim local-sphere z) -307200.0) 0 (none) ) ;; definition for method 21 of type citb-arm-shoulder-a ;; INFO: Return type mismatch int vs none. -(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)) +(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)) 0 (none) ) ;; definition for method 21 of type citb-arm-shoulder-b ;; INFO: Return type mismatch int vs 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)) +(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)) 0 (none) ) @@ -457,13 +457,13 @@ ) ;; definition for method 3 of type citb-disc -(defmethod inspect citb-disc ((obj citb-disc)) +(defmethod inspect citb-disc ((this citb-disc)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Trot-scale: ~f~%" (-> obj rot-scale)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Trot-scale: ~f~%" (-> this rot-scale)) + this ) ;; failed to figure out what this is: @@ -495,8 +495,8 @@ ;; definition for method 20 of type citb-disc ;; INFO: Return type mismatch int vs none. -(defmethod init! citb-disc ((obj citb-disc)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init! citb-disc ((this citb-disc)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -514,7 +514,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -522,34 +522,34 @@ ;; definition for method 21 of type citb-disc ;; INFO: Return type mismatch int vs none. -(defmethod citb-disc-method-21 citb-disc ((obj citb-disc)) +(defmethod citb-disc-method-21 citb-disc ((this citb-disc)) 0 (none) ) ;; definition for method 11 of type citb-disc ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-disc ((obj citb-disc) (arg0 entity-actor)) - (init! obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) +(defmethod init-from-entity! citb-disc ((this citb-disc) (arg0 entity-actor)) + (init! this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (cond - ((> (-> obj sync period) 0) - (set! (-> obj rot-scale) 1.0) + ((> (-> this sync period) 0) + (set! (-> this rot-scale) 1.0) ) (else - (set! (-> obj rot-scale) -1.0) - (let ((v1-8 (abs (the-as int (-> obj sync period))))) - (set! (-> obj sync period) (the-as uint v1-8)) + (set! (-> this rot-scale) -1.0) + (let ((v1-8 (abs (the-as int (-> this sync period))))) + (set! (-> this sync period) (the-as uint v1-8)) ) ) ) - (citb-disc-method-21 obj) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> obj root-override trans)) + (citb-disc-method-21 this) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root-override trans)) ) - (logior! (-> obj skel status) (janim-status inited)) + (logior! (-> this skel status) (janim-status inited)) (go citb-disc-idle) (none) ) @@ -564,11 +564,11 @@ ) ;; definition for method 3 of type citb-disc-a -(defmethod inspect citb-disc-a ((obj citb-disc-a)) +(defmethod inspect citb-disc-a ((this citb-disc-a)) (let ((t9-0 (method-of-type citb-disc inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type citb-disc-b @@ -581,11 +581,11 @@ ) ;; definition for method 3 of type citb-disc-b -(defmethod inspect citb-disc-b ((obj citb-disc-b)) +(defmethod inspect citb-disc-b ((this citb-disc-b)) (let ((t9-0 (method-of-type citb-disc inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type citb-disc-c @@ -598,11 +598,11 @@ ) ;; definition for method 3 of type citb-disc-c -(defmethod inspect citb-disc-c ((obj citb-disc-c)) +(defmethod inspect citb-disc-c ((this citb-disc-c)) (let ((t9-0 (method-of-type citb-disc inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type citb-disc-d @@ -615,41 +615,41 @@ ) ;; definition for method 3 of type citb-disc-d -(defmethod inspect citb-disc-d ((obj citb-disc-d)) +(defmethod inspect citb-disc-d ((this citb-disc-d)) (let ((t9-0 (method-of-type citb-disc inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 21 of type citb-disc-a ;; INFO: Return type mismatch int vs none. -(defmethod citb-disc-method-21 citb-disc-a ((obj citb-disc-a)) - (initialize-skeleton obj *citb-disc-a-sg* '()) +(defmethod citb-disc-method-21 citb-disc-a ((this citb-disc-a)) + (initialize-skeleton this *citb-disc-a-sg* '()) 0 (none) ) ;; definition for method 21 of type citb-disc-b ;; INFO: Return type mismatch int vs none. -(defmethod citb-disc-method-21 citb-disc-b ((obj citb-disc-b)) - (initialize-skeleton obj *citb-disc-b-sg* '()) +(defmethod citb-disc-method-21 citb-disc-b ((this citb-disc-b)) + (initialize-skeleton this *citb-disc-b-sg* '()) 0 (none) ) ;; definition for method 21 of type citb-disc-c ;; INFO: Return type mismatch int vs none. -(defmethod citb-disc-method-21 citb-disc-c ((obj citb-disc-c)) - (initialize-skeleton obj *citb-disc-c-sg* '()) +(defmethod citb-disc-method-21 citb-disc-c ((this citb-disc-c)) + (initialize-skeleton this *citb-disc-c-sg* '()) 0 (none) ) ;; definition for method 21 of type citb-disc-d ;; INFO: Return type mismatch int vs none. -(defmethod citb-disc-method-21 citb-disc-d ((obj citb-disc-d)) - (initialize-skeleton obj *citb-disc-d-sg* '()) +(defmethod citb-disc-method-21 citb-disc-d ((this citb-disc-d)) + (initialize-skeleton this *citb-disc-d-sg* '()) 0 (none) ) @@ -664,11 +664,11 @@ ) ;; definition for method 3 of type citb-iris-door -(defmethod inspect citb-iris-door ((obj citb-iris-door)) +(defmethod inspect citb-iris-door ((this citb-iris-door)) (let ((t9-0 (method-of-type eco-door inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -679,8 +679,8 @@ ;; definition for method 24 of type citb-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 citb-iris-door ((obj citb-iris-door)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod eco-door-method-24 citb-iris-door ((this citb-iris-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -692,7 +692,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -700,13 +700,13 @@ ;; definition for method 25 of type citb-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 citb-iris-door ((obj citb-iris-door)) - (initialize-skeleton obj *citb-iris-door-sg* '()) - (set! (-> obj open-distance) 32768.0) - (set! (-> obj close-distance) 49152.0) - (set! (-> obj auto-close) #t) - (process-entity-status! obj (entity-perm-status complete) #t) - (update-transforms! (-> obj root-override)) +(defmethod eco-door-method-25 citb-iris-door ((this citb-iris-door)) + (initialize-skeleton this *citb-iris-door-sg* '()) + (set! (-> this open-distance) 32768.0) + (set! (-> this close-distance) 49152.0) + (set! (-> this auto-close) #t) + (process-entity-status! this (entity-perm-status complete) #t) + (update-transforms! (-> this root-override)) 0 (none) ) @@ -727,17 +727,17 @@ ) ;; definition for method 3 of type citb-button -(defmethod inspect citb-button ((obj citb-button)) +(defmethod inspect citb-button ((this citb-button)) (let ((t9-0 (method-of-type basebutton inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 27 of type citb-button ;; INFO: Return type mismatch int vs collide-shape-moving. -(defmethod basebutton-method-27 citb-button ((obj citb-button)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod basebutton-method-27 citb-button ((this citb-button)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -754,43 +754,43 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) (the-as collide-shape-moving 0) ) ;; definition for method 26 of type citb-button -(defmethod basebutton-method-26 citb-button ((obj citb-button)) - (initialize-skeleton obj *citb-button-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) +(defmethod basebutton-method-26 citb-button ((this citb-button)) + (initialize-skeleton this *citb-button-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) (cond - ((-> obj down?) - (let ((s5-0 (-> obj skel root-channel 0))) + ((-> this down?) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) ) (else - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) ) ) - (set! (-> obj anim-speed) 2.0) - (set! (-> obj timeout) 1.0) - (update-transforms! (-> obj root-override)) + (set! (-> this anim-speed) 2.0) + (set! (-> this timeout) 1.0) + (update-transforms! (-> this root-override)) (ja-post) (none) ) @@ -806,12 +806,12 @@ ) ;; definition for method 3 of type citb-launcher -(defmethod inspect citb-launcher ((obj citb-launcher)) +(defmethod inspect citb-launcher ((this citb-launcher)) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tlauncher: #x~X~%" (-> obj launcher)) - obj + (format #t "~T~Tlauncher: #x~X~%" (-> this launcher)) + this ) ;; failed to figure out what this is: @@ -834,20 +834,20 @@ ) ;; definition for method 23 of type citb-launcher -(defmethod get-unlit-skel citb-launcher ((obj citb-launcher)) +(defmethod get-unlit-skel citb-launcher ((this citb-launcher)) *citb-launcher-sg* ) ;; definition for method 26 of type citb-launcher ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 citb-launcher ((obj citb-launcher)) - (let ((f30-0 (res-lump-float (-> obj entity) 'spring-height :default 163840.0)) - (s5-0 (res-lump-value (-> obj entity) 'mode uint128)) +(defmethod baseplat-method-26 citb-launcher ((this citb-launcher)) + (let ((f30-0 (res-lump-float (-> this entity) 'spring-height :default 163840.0)) + (s5-0 (res-lump-value (-> this entity) 'mode uint128)) ) - (set! (-> obj launcher) (process-spawn launcher (-> obj root-override trans) f30-0 s5-0 81920.0 :to obj)) + (set! (-> this launcher) (process-spawn launcher (-> this root-override trans) f30-0 s5-0 81920.0 :to this)) ) - (set! (-> obj root-override root-prim local-sphere w) 18432.0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root-override root-prim local-sphere w) 18432.0) + (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) ) @@ -930,12 +930,12 @@ ) ;; definition for method 3 of type citb-robotboss -(defmethod inspect citb-robotboss ((obj citb-robotboss)) +(defmethod inspect citb-robotboss ((this citb-robotboss)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tshield-on: ~A~%" (-> obj shield-on)) - obj + (format #t "~T~Tshield-on: ~A~%" (-> this shield-on)) + this ) ;; failed to figure out what this is: @@ -1058,8 +1058,8 @@ ;; definition for method 11 of type citb-robotboss ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-robotboss ((obj citb-robotboss) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! citb-robotboss ((this citb-robotboss) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1071,17 +1071,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *citb-robotboss-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 601) obj)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj shield-on) #t) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "robotcage-lp" :fo-max 150) (-> obj root-override trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *citb-robotboss-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 601) this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this shield-on) #t) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "robotcage-lp" :fo-max 150) (-> this root-override trans)) ) - (if (= (get-task-status (-> obj entity extra perm task)) (task-status invalid)) + (if (= (get-task-status (-> this entity extra perm task)) (task-status invalid)) (go citb-robotboss-die) (go citb-robotboss-idle) ) @@ -1110,29 +1110,29 @@ ) ;; definition for method 3 of type citb-coil -(defmethod inspect citb-coil ((obj citb-coil)) +(defmethod inspect citb-coil ((this citb-coil)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpart-off: ~A~%" (-> obj part-off)) - obj + (format #t "~T~Tpart-off: ~A~%" (-> this part-off)) + this ) ;; definition for method 7 of type citb-coil ;; INFO: Return type mismatch process-drawable vs citb-coil. -(defmethod relocate citb-coil ((obj citb-coil) (arg0 int)) - (if (nonzero? (-> obj part-off)) - (&+! (-> obj part-off) arg0) +(defmethod relocate citb-coil ((this citb-coil) (arg0 int)) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) arg0) ) - (the-as citb-coil ((method-of-type process-drawable relocate) obj arg0)) + (the-as citb-coil ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type citb-coil -(defmethod deactivate citb-coil ((obj citb-coil)) - (if (nonzero? (-> obj part-off)) - (kill-and-free-particles (-> obj part-off)) +(defmethod deactivate citb-coil ((this citb-coil)) + (if (nonzero? (-> this part-off)) + (kill-and-free-particles (-> this part-off)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -1193,15 +1193,15 @@ ;; definition for method 11 of type citb-coil ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-coil ((obj citb-coil) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *citb-coil-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 596) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 602) obj)) - (let ((v1-9 (entity-actor-lookup (-> obj entity) 'state-actor 0))) +(defmethod init-from-entity! citb-coil ((this citb-coil) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *citb-coil-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 596) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 602) this)) + (let ((v1-9 (entity-actor-lookup (-> this entity) 'state-actor 0))) (if (not v1-9) - (set! v1-9 (-> obj entity)) + (set! v1-9 (-> this entity)) ) (if (logtest? (-> v1-9 extra perm status) (entity-perm-status complete)) (go citb-coil-broken) @@ -1232,11 +1232,11 @@ ) ;; definition for method 3 of type citb-hose -(defmethod inspect citb-hose ((obj citb-hose)) +(defmethod inspect citb-hose ((this citb-hose)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for function citb-hose-event-handler @@ -1299,13 +1299,13 @@ ;; definition for method 11 of type citb-hose ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-hose ((obj citb-hose) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *citb-hose-sg* '()) - (let ((v1-3 (entity-actor-lookup (-> obj entity) 'state-actor 0))) +(defmethod init-from-entity! citb-hose ((this citb-hose) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *citb-hose-sg* '()) + (let ((v1-3 (entity-actor-lookup (-> this entity) 'state-actor 0))) (if (not v1-3) - (set! v1-3 (-> obj entity)) + (set! v1-3 (-> this entity)) ) (if (logtest? (-> v1-3 extra perm status) (entity-perm-status complete)) (go citb-hose-die) @@ -1324,35 +1324,35 @@ ) ;; definition for method 3 of type citb-chains -(defmethod inspect citb-chains ((obj citb-chains)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect citb-chains ((this citb-chains)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; failed to figure out what this is: @@ -1395,42 +1395,42 @@ ) ;; definition for method 3 of type citb-generator -(defmethod inspect citb-generator ((obj citb-generator)) +(defmethod inspect citb-generator ((this citb-generator)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tnormal-look: #~%" (-> obj normal-look)) - (format #t "~T~Tbroken-look: #~%" (-> obj broken-look)) - (format #t "~T~Tmushroom-pos: #~%" (-> obj mushroom-pos)) - (format #t "~T~Tmushroom: ~A~%" (-> obj mushroom)) - (format #t "~T~Tbirth-fuel-cell: ~A~%" (-> obj birth-fuel-cell)) - (format #t "~T~Ttrigger-others: ~A~%" (-> obj trigger-others)) - (format #t "~T~Tpart-broken: ~A~%" (-> obj part-broken)) - (format #t "~T~Tpart-mushroom: ~A~%" (-> obj part-mushroom)) - obj + (format #t "~T~Tnormal-look: #~%" (-> this normal-look)) + (format #t "~T~Tbroken-look: #~%" (-> this broken-look)) + (format #t "~T~Tmushroom-pos: #~%" (-> this mushroom-pos)) + (format #t "~T~Tmushroom: ~A~%" (-> this mushroom)) + (format #t "~T~Tbirth-fuel-cell: ~A~%" (-> this birth-fuel-cell)) + (format #t "~T~Ttrigger-others: ~A~%" (-> this trigger-others)) + (format #t "~T~Tpart-broken: ~A~%" (-> this part-broken)) + (format #t "~T~Tpart-mushroom: ~A~%" (-> this part-mushroom)) + this ) ;; definition for method 7 of type citb-generator ;; INFO: Return type mismatch process-drawable vs citb-generator. -(defmethod relocate citb-generator ((obj citb-generator) (arg0 int)) - (if (nonzero? (-> obj part-broken)) - (&+! (-> obj part-broken) arg0) +(defmethod relocate citb-generator ((this citb-generator) (arg0 int)) + (if (nonzero? (-> this part-broken)) + (&+! (-> this part-broken) arg0) ) - (if (nonzero? (-> obj part-mushroom)) - (&+! (-> obj part-mushroom) arg0) + (if (nonzero? (-> this part-mushroom)) + (&+! (-> this part-mushroom) arg0) ) - (the-as citb-generator ((method-of-type process-drawable relocate) obj arg0)) + (the-as citb-generator ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type citb-generator -(defmethod deactivate citb-generator ((obj citb-generator)) - (if (nonzero? (-> obj part-broken)) - (kill-and-free-particles (-> obj part-broken)) +(defmethod deactivate citb-generator ((this citb-generator)) + (if (nonzero? (-> this part-broken)) + (kill-and-free-particles (-> this part-broken)) ) - (if (nonzero? (-> obj part-mushroom)) - (kill-and-free-particles (-> obj part-mushroom)) + (if (nonzero? (-> this part-mushroom)) + (kill-and-free-particles (-> this part-mushroom)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -1468,10 +1468,10 @@ ) ) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (while (< (- (-> *display* base-frame-counter) gp-1) (seconds 0.5)) + (let ((gp-1 (current-time))) + (while (not (time-elapsed? gp-1 (seconds 0.5))) (if (movie?) - (set! gp-1 (-> *display* base-frame-counter)) + (set! gp-1 (current-time)) ) (suspend) ) @@ -1641,8 +1641,8 @@ ;; definition for method 20 of type citb-generator ;; INFO: Return type mismatch int vs none. -(defmethod init! citb-generator ((obj citb-generator)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init! citb-generator ((this citb-generator)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1653,7 +1653,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -1662,46 +1662,46 @@ ;; definition for method 21 of type citb-generator ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod citb-generator-method-21 citb-generator ((obj citb-generator)) - (initialize-skeleton obj *citb-generator-sg* '()) - (setup-lods! (-> obj normal-look) *citb-generator-sg* (-> obj draw art-group) (-> obj entity)) - (setup-lods! (-> obj broken-look) *citb-generator-broken-sg* (-> obj draw art-group) (-> obj entity)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj birth-fuel-cell) (< (the-as uint 1) (the-as uint (-> obj entity extra perm task)))) - (set! (-> obj trigger-others) #f) - (set! (-> obj mushroom-pos quad) (-> obj root-override trans quad)) +(defmethod citb-generator-method-21 citb-generator ((this citb-generator)) + (initialize-skeleton this *citb-generator-sg* '()) + (setup-lods! (-> this normal-look) *citb-generator-sg* (-> this draw art-group) (-> this entity)) + (setup-lods! (-> this broken-look) *citb-generator-broken-sg* (-> this draw art-group) (-> this entity)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this birth-fuel-cell) (< (the-as uint 1) (the-as uint (-> this entity extra perm task)))) + (set! (-> this trigger-others) #f) + (set! (-> this mushroom-pos quad) (-> this root-override trans quad)) (let ((f30-0 0.0)) (cond - ((name= (-> obj name) "citb-generator-1") - (set! (-> obj mushroom) #t) + ((name= (-> this name) "citb-generator-1") + (set! (-> this mushroom) #t) (set! f30-0 21845.334) ) - ((name= (-> obj name) "citb-generator-2") - (set! (-> obj mushroom) #t) + ((name= (-> this name) "citb-generator-2") + (set! (-> this mushroom) #t) (set! f30-0 16384.0) ) - ((name= (-> obj name) "citb-generator-3") - (set! (-> obj mushroom) #t) + ((name= (-> this name) "citb-generator-3") + (set! (-> this mushroom) #t) (set! f30-0 16384.0) ) - ((name= (-> obj name) "citb-generator-4") - (set! (-> obj mushroom) #t) + ((name= (-> this name) "citb-generator-4") + (set! (-> this mushroom) #t) (set! f30-0 -5461.3335) ) (else - (set! (-> obj mushroom) #f) + (set! (-> this mushroom) #f) ) ) - (when (-> obj mushroom) - (+! (-> obj mushroom-pos x) (* 19251.2 (sin f30-0))) - (+! (-> obj mushroom-pos z) (* 19251.2 (cos f30-0))) + (when (-> this mushroom) + (+! (-> this mushroom-pos x) (* 19251.2 (sin f30-0))) + (+! (-> this mushroom-pos z) (* 19251.2 (cos f30-0))) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 600) obj)) - (set! (-> obj part-broken) (create-launch-control (-> *part-group-id-table* 597) obj)) - (set! (-> obj part-mushroom) (create-launch-control (-> *part-group-id-table* 599) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "mushroom-gen" :fo-max 20) (-> obj root-override trans)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 600) this)) + (set! (-> this part-broken) (create-launch-control (-> *part-group-id-table* 597) this)) + (set! (-> this part-mushroom) (create-launch-control (-> *part-group-id-table* 599) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "mushroom-gen" :fo-max 20) (-> this root-override trans)) ) 0 (none) @@ -1709,13 +1709,13 @@ ;; definition for method 11 of type citb-generator ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-generator ((obj citb-generator) (arg0 entity-actor)) - (init! obj) - (process-drawable-from-entity! obj arg0) - (citb-generator-method-21 obj) - (let ((v1-4 (entity-actor-lookup (-> obj entity) 'state-actor 0))) +(defmethod init-from-entity! citb-generator ((this citb-generator) (arg0 entity-actor)) + (init! this) + (process-drawable-from-entity! this arg0) + (citb-generator-method-21 this) + (let ((v1-4 (entity-actor-lookup (-> this entity) 'state-actor 0))) (if (not v1-4) - (set! v1-4 (-> obj entity)) + (set! v1-4 (-> this entity)) ) (if (logtest? (-> v1-4 extra perm status) (entity-perm-status complete)) (go citb-generator-broken) @@ -1745,11 +1745,11 @@ ) ;; definition for method 3 of type citadelcam -(defmethod inspect citadelcam ((obj citadelcam)) +(defmethod inspect citadelcam ((this citadelcam)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1824,10 +1824,10 @@ ;; definition for method 11 of type citadelcam ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citadelcam ((obj citadelcam) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) +(defmethod init-from-entity! citadelcam ((this citadelcam) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (go citadelcam-idle) (none) ) @@ -1842,11 +1842,11 @@ ) ;; definition for method 3 of type citb-battlecontroller -(defmethod inspect citb-battlecontroller ((obj citb-battlecontroller)) +(defmethod inspect citb-battlecontroller ((this citb-battlecontroller)) (let ((t9-0 (method-of-type battlecontroller inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1893,9 +1893,9 @@ ;; definition for method 27 of type citb-battlecontroller ;; INFO: Return type mismatch int vs none. -(defmethod battlecontroller-method-27 citb-battlecontroller ((obj citb-battlecontroller)) - ((the-as (function battlecontroller none) (find-parent-method citb-battlecontroller 27)) obj) - (set! (-> obj activate-distance) 143360.0) +(defmethod battlecontroller-method-27 citb-battlecontroller ((this citb-battlecontroller)) + ((the-as (function battlecontroller none) (find-parent-method citb-battlecontroller 27)) this) + (set! (-> this activate-distance) 143360.0) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc index 4f104c676e..2a2897dc2e 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type citb-part -(defmethod inspect citb-part ((obj citb-part)) +(defmethod inspect citb-part ((this citb-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: 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 1b03af2435..1c4e208ffe 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citadel-sages_REF.gc @@ -30,15 +30,15 @@ ) ;; definition for method 3 of type citb-sagecage -(defmethod inspect citb-sagecage ((obj citb-sagecage)) +(defmethod inspect citb-sagecage ((this citb-sagecage)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbar-array[12] @ #x~X~%" (-> obj bar-array)) - (format #t "~T~Tangle-offset: ~f~%" (-> obj angle-offset)) - (format #t "~T~Tbars-on: ~A~%" (-> obj bars-on)) - (format #t "~T~Tcloning: ~A~%" (-> obj cloning)) - obj + (format #t "~T~Tbar-array[12] @ #x~X~%" (-> this bar-array)) + (format #t "~T~Tangle-offset: ~f~%" (-> this angle-offset)) + (format #t "~T~Tbars-on: ~A~%" (-> this bars-on)) + (format #t "~T~Tcloning: ~A~%" (-> this cloning)) + this ) ;; definition for function citb-sagecage-draw-bars @@ -155,8 +155,8 @@ ;; definition for method 20 of type citb-sagecage ;; INFO: Return type mismatch int vs none. -(defmethod citb-sagecage-method-20 citb-sagecage ((obj citb-sagecage)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod citb-sagecage-method-20 citb-sagecage ((this citb-sagecage)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -174,7 +174,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -182,37 +182,37 @@ ;; definition for method 21 of type citb-sagecage ;; INFO: Return type mismatch int vs none. -(defmethod citb-sagecage-method-21 citb-sagecage ((obj citb-sagecage)) - (initialize-skeleton obj *citb-sagecage-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj root-override pause-adjust-distance) 409600.0) +(defmethod citb-sagecage-method-21 citb-sagecage ((this citb-sagecage)) + (initialize-skeleton this *citb-sagecage-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this root-override pause-adjust-distance) 409600.0) (let ((f0-1 20766.72) (f4-0 14745.6) (f1-0 -14745.6) (f2-0 7372.8) ) (let ((f3-0 -7372.8)) - (set-vector! (-> obj bar-array 0) f4-0 f0-1 f3-0 1.0) - (set-vector! (-> obj bar-array 1) f4-0 f0-1 0.0 1.0) - (set-vector! (-> obj bar-array 2) f4-0 f0-1 f2-0 1.0) - (set-vector! (-> obj bar-array 3) f1-0 f0-1 f3-0 1.0) - (set-vector! (-> obj bar-array 4) f1-0 f0-1 0.0 1.0) - (set-vector! (-> obj bar-array 5) f1-0 f0-1 f2-0 1.0) - (set-vector! (-> obj bar-array 6) f3-0 f0-1 f4-0 1.0) - (set-vector! (-> obj bar-array 7) 0.0 f0-1 f4-0 1.0) - (set-vector! (-> obj bar-array 8) f2-0 f0-1 f4-0 1.0) - (set-vector! (-> obj bar-array 9) f3-0 f0-1 f1-0 1.0) + (set-vector! (-> this bar-array 0) f4-0 f0-1 f3-0 1.0) + (set-vector! (-> this bar-array 1) f4-0 f0-1 0.0 1.0) + (set-vector! (-> this bar-array 2) f4-0 f0-1 f2-0 1.0) + (set-vector! (-> this bar-array 3) f1-0 f0-1 f3-0 1.0) + (set-vector! (-> this bar-array 4) f1-0 f0-1 0.0 1.0) + (set-vector! (-> this bar-array 5) f1-0 f0-1 f2-0 1.0) + (set-vector! (-> this bar-array 6) f3-0 f0-1 f4-0 1.0) + (set-vector! (-> this bar-array 7) 0.0 f0-1 f4-0 1.0) + (set-vector! (-> this bar-array 8) f2-0 f0-1 f4-0 1.0) + (set-vector! (-> this bar-array 9) f3-0 f0-1 f1-0 1.0) ) - (set-vector! (-> obj bar-array 10) 0.0 f0-1 f1-0 1.0) - (set-vector! (-> obj bar-array 11) f2-0 f0-1 f1-0 1.0) + (set-vector! (-> this bar-array 10) 0.0 f0-1 f1-0 1.0) + (set-vector! (-> this bar-array 11) f2-0 f0-1 f1-0 1.0) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> obj root-override trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "sagecage-gen" :fo-max 20) (-> this root-override trans)) ) - (set! (-> obj bars-on) (not (task-complete? *game-info* (-> obj entity extra perm task)))) + (set! (-> this bars-on) (not (task-complete? *game-info* (-> this entity extra perm task)))) (citb-sagecage-update-collision) - (set! (-> obj cloning) #t) - (set! (-> obj event-hook) (-> citb-sagecage-idle event)) + (set! (-> this cloning) #t) + (set! (-> this event-hook) (-> citb-sagecage-idle event)) 0 (none) ) @@ -297,79 +297,79 @@ ) ;; definition for method 3 of type citb-sage -(defmethod inspect citb-sage ((obj citb-sage)) +(defmethod inspect citb-sage ((this citb-sage)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspawn-pos: #~%" (-> obj spawn-pos)) - (format #t "~T~Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~T~Tdir: #~%" (-> obj dir)) - (format #t "~T~Trot-y: ~f~%" (-> obj rot-y)) - (format #t "~T~Trot-x: ~f~%" (-> obj rot-x)) - (format #t "~T~Tidle-anim: ~D~%" (-> obj idle-anim)) - (format #t "~T~Tattack-start-anim: ~D~%" (-> obj attack-start-anim)) - (format #t "~T~Tattack-anim: ~D~%" (-> obj attack-anim)) - (format #t "~T~Tbeam-joint: ~D~%" (-> obj beam-joint)) - (format #t "~T~Tcage: ~D~%" (-> obj cage)) - (format #t "~T~Tpart-impact: ~A~%" (-> obj part-impact)) - (format #t "~T~Tbeam-on: ~A~%" (-> obj beam-on)) - (format #t "~T~Tresolution-anim: ~A~%" (-> obj resolution-anim)) - (format #t "~T~Tsound-name: ~A~%" (-> obj sound-name)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Tspawn-pos: #~%" (-> this spawn-pos)) + (format #t "~T~Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~T~Tdir: #~%" (-> this dir)) + (format #t "~T~Trot-y: ~f~%" (-> this rot-y)) + (format #t "~T~Trot-x: ~f~%" (-> this rot-x)) + (format #t "~T~Tidle-anim: ~D~%" (-> this idle-anim)) + (format #t "~T~Tattack-start-anim: ~D~%" (-> this attack-start-anim)) + (format #t "~T~Tattack-anim: ~D~%" (-> this attack-anim)) + (format #t "~T~Tbeam-joint: ~D~%" (-> this beam-joint)) + (format #t "~T~Tcage: ~D~%" (-> this cage)) + (format #t "~T~Tpart-impact: ~A~%" (-> this part-impact)) + (format #t "~T~Tbeam-on: ~A~%" (-> this beam-on)) + (format #t "~T~Tresolution-anim: ~A~%" (-> this resolution-anim)) + (format #t "~T~Tsound-name: ~A~%" (-> this sound-name)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; definition for method 7 of type citb-sage ;; INFO: Return type mismatch process-taskable vs citb-sage. -(defmethod relocate citb-sage ((obj citb-sage) (arg0 int)) - (if (nonzero? (-> obj part-impact)) - (&+! (-> obj part-impact) arg0) +(defmethod relocate citb-sage ((this citb-sage) (arg0 int)) + (if (nonzero? (-> this part-impact)) + (&+! (-> this part-impact) arg0) ) - (the-as citb-sage ((method-of-type process-taskable relocate) obj arg0)) + (the-as citb-sage ((method-of-type process-taskable relocate) this arg0)) ) ;; definition for method 10 of type citb-sage -(defmethod deactivate citb-sage ((obj citb-sage)) - (if (nonzero? (-> obj part-impact)) - (kill-and-free-particles (-> obj part-impact)) +(defmethod deactivate citb-sage ((this citb-sage)) + (if (nonzero? (-> this part-impact)) + (kill-and-free-particles (-> this part-impact)) ) - (sound-stop (-> obj sound-id)) - ((method-of-type process-taskable deactivate) obj) + (sound-stop (-> this sound-id)) + ((method-of-type process-taskable deactivate) this) (none) ) ;; definition for method 44 of type citb-sage ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs symbol. -(defmethod play-reminder citb-sage ((obj citb-sage)) - (set! (-> obj root-override pause-adjust-distance) 409600.0) - (set! (-> obj cage) (ppointer->handle (process-spawn citb-sagecage obj :to obj))) - (set! (-> obj beam-on) #f) - (set! (-> obj sound-id) (new-sound-id)) - (if (zero? (-> obj sound-name)) - (set! (-> obj sound-name) "") +(defmethod play-reminder citb-sage ((this citb-sage)) + (set! (-> this root-override pause-adjust-distance) 409600.0) + (set! (-> this cage) (ppointer->handle (process-spawn citb-sagecage this :to this))) + (set! (-> this beam-on) #f) + (set! (-> this sound-id) (new-sound-id)) + (if (zero? (-> this sound-name)) + (set! (-> this sound-name) "") ) - (let ((v1-9 (the-as entity (entity-actor-lookup (-> obj entity) 'alt-actor 0))) + (let ((v1-9 (the-as entity (entity-actor-lookup (-> this entity) 'alt-actor 0))) (s5-1 (new 'stack-no-clear 'vector)) ) (let ((s4-0 (new 'stack-no-clear 'vector))) (if (not (the-as entity-actor v1-9)) (set! v1-9 (entity-by-name "citb-robotboss-1")) ) - (set! (-> obj alt-actor) (the-as entity-actor v1-9)) - (set! (-> obj spawn-pos quad) (-> obj root-override trans quad)) + (set! (-> this alt-actor) (the-as entity-actor v1-9)) + (set! (-> this spawn-pos quad) (-> this root-override trans quad)) (set! (-> s5-1 quad) (-> v1-9 extra trans quad)) (+! (-> s5-1 y) 81920.0) - (vector-! s4-0 (-> obj spawn-pos) s5-1) + (vector-! s4-0 (-> this spawn-pos) s5-1) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (vector+*! (-> obj target-pos) s5-1 s4-0 116940.8) + (vector+*! (-> this target-pos) s5-1 s4-0 116940.8) ) - (when (nonzero? (-> obj part)) - (vector-! s5-1 (-> obj target-pos) (-> obj spawn-pos)) - (vector-float*! (the-as vector (-> obj part group bounds)) s5-1 0.5) - (set! (-> obj part group bounds w) (* 0.6 (vector-vector-distance (-> obj spawn-pos) (-> obj target-pos)))) + (when (nonzero? (-> this part)) + (vector-! s5-1 (-> this target-pos) (-> this spawn-pos)) + (vector-float*! (the-as vector (-> this part group bounds)) s5-1 0.5) + (set! (-> this part group bounds w) (* 0.6 (vector-vector-distance (-> this spawn-pos) (-> this target-pos)))) ) ) (the-as symbol 0) @@ -378,42 +378,42 @@ ;; definition for method 45 of type citb-sage ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-45 citb-sage ((obj citb-sage)) - (set! (-> obj spawn-pos quad) (-> obj root-override trans quad)) +(defmethod process-taskable-method-45 citb-sage ((this citb-sage)) + (set! (-> this spawn-pos quad) (-> this root-override trans quad)) (the-as symbol 0) ) ;; definition for method 42 of type citb-sage ;; INFO: Return type mismatch object vs none. -(defmethod process-taskable-method-42 citb-sage ((obj citb-sage)) - (if (not (should-display? obj)) - (go (method-of-object obj hidden)) - (go (method-of-object obj idle)) +(defmethod process-taskable-method-42 citb-sage ((this citb-sage)) + (if (not (should-display? this)) + (go (method-of-object this hidden)) + (go (method-of-object this idle)) ) (none) ) ;; definition for method 32 of type citb-sage ;; INFO: Return type mismatch spool-anim vs basic. -(defmethod play-anim! citb-sage ((obj citb-sage) (arg0 symbol)) - (the-as basic (-> obj resolution-anim)) +(defmethod play-anim! citb-sage ((this citb-sage) (arg0 symbol)) + (the-as basic (-> this resolution-anim)) ) ;; definition for method 31 of type citb-sage -(defmethod get-art-elem citb-sage ((obj citb-sage)) +(defmethod get-art-elem citb-sage ((this citb-sage)) (cond - ((= (current-status (-> obj tasks)) (task-status invalid)) - (set! (-> obj beam-on) #t) - (-> obj draw art-group data (-> obj attack-anim)) + ((= (current-status (-> this tasks)) (task-status invalid)) + (set! (-> this beam-on) #t) + (-> this draw art-group data (-> this attack-anim)) ) (else - (-> obj draw art-group data (-> obj idle-anim)) + (-> this draw art-group data (-> this idle-anim)) ) ) ) ;; definition for method 39 of type citb-sage -(defmethod should-display? citb-sage ((obj citb-sage)) +(defmethod should-display? citb-sage ((this citb-sage)) (!= (get-task-status (game-task citadel-sage-green)) (task-status invalid)) ) @@ -502,17 +502,17 @@ ) ;; definition for method 3 of type red-sagecage -(defmethod inspect red-sagecage ((obj red-sagecage)) +(defmethod inspect red-sagecage ((this red-sagecage)) (let ((t9-0 (method-of-type citb-sage inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 52 of type red-sagecage ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 red-sagecage ((obj red-sagecage)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 red-sagecage ((this red-sagecage)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) (set! (-> a0-1 settings bot-plane w) (- -8192.0)) @@ -530,21 +530,21 @@ ;; definition for method 48 of type red-sagecage ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow red-sagecage ((obj red-sagecage)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow red-sagecage ((this red-sagecage)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -555,58 +555,58 @@ ;; definition for method 45 of type red-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-45 red-sagecage ((obj red-sagecage)) - (set! (-> *part-id-table* 2455 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2455 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2457 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2457 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2454 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2454 init-specs 13 initial-valuef) (-> obj rot-x)) +(defmethod process-taskable-method-45 red-sagecage ((this red-sagecage)) + (set! (-> *part-id-table* 2455 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2455 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2457 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2457 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2454 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2454 init-specs 13 initial-valuef) (-> this rot-x)) (the-as symbol 0) ) ;; definition for method 44 of type red-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod play-reminder red-sagecage ((obj red-sagecage)) - (set! (-> obj idle-anim) 4) - (set! (-> obj attack-start-anim) 5) - (set! (-> obj attack-anim) 6) - (set! (-> obj beam-joint) 20) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 604) obj)) - (set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 608) obj)) - (set! (-> obj resolution-anim) (new 'static 'spool-anim - :name "redsage-resolution" - :index 7 - :parts 9 - :command-list '((15 send-event self disable-bars) - (45 joint "cameraB") - (216 joint "camera") - (435 joint "cameraB") - (685 joint "camera") - ) - ) +(defmethod play-reminder red-sagecage ((this red-sagecage)) + (set! (-> this idle-anim) 4) + (set! (-> this attack-start-anim) 5) + (set! (-> this attack-anim) 6) + (set! (-> this beam-joint) 20) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 604) this)) + (set! (-> this part-impact) (create-launch-control (-> *part-group-id-table* 608) this)) + (set! (-> this resolution-anim) (new 'static 'spool-anim + :name "redsage-resolution" + :index 7 + :parts 9 + :command-list '((15 send-event self disable-bars) + (45 joint "cameraB") + (216 joint "camera") + (435 joint "cameraB") + (685 joint "camera") + ) + ) ) - (set! (-> obj sound-name) "redsage-fires") - ((the-as (function citb-sage none) (find-parent-method red-sagecage 44)) obj) + (set! (-> this sound-name) "redsage-fires") + ((the-as (function citb-sage none) (find-parent-method red-sagecage 44)) this) (the-as symbol 0) ) ;; definition for method 43 of type red-sagecage -(defmethod process-taskable-method-43 red-sagecage ((obj red-sagecage)) - (if (-> obj beam-on) +(defmethod process-taskable-method-43 red-sagecage ((this red-sagecage)) + (if (-> this beam-on) (return #f) ) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> obj ambient) "RED-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "RED-AM01" #f (-> this root-override trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "RED-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "RED-AM02" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "RED-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "RED-AM03" #f (-> this root-override trans)) ) ) ) @@ -614,12 +614,12 @@ ) ;; definition for method 11 of type red-sagecage -(defmethod init-from-entity! red-sagecage ((obj red-sagecage) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *redsage-sg* 3 33 (new 'static 'vector :w 8192.0) 5) - (set! (-> obj tasks) (get-task-control (-> obj entity extra perm task))) - (play-reminder obj) - (set! (-> obj sound-flava) (music-flava sage-red)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! red-sagecage ((this red-sagecage) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *redsage-sg* 3 33 (new 'static 'vector :w 8192.0) 5) + (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) + (play-reminder this) + (set! (-> this sound-flava) (music-flava sage-red)) + (process-taskable-method-42 this) (none) ) @@ -633,17 +633,17 @@ ) ;; definition for method 3 of type blue-sagecage -(defmethod inspect blue-sagecage ((obj blue-sagecage)) +(defmethod inspect blue-sagecage ((this blue-sagecage)) (let ((t9-0 (method-of-type citb-sage inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 52 of type blue-sagecage ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 blue-sagecage ((obj blue-sagecage)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 blue-sagecage ((this blue-sagecage)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) (set! (-> a0-1 settings bot-plane w) (- -10035.2)) @@ -661,21 +661,21 @@ ;; definition for method 48 of type blue-sagecage ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow blue-sagecage ((obj blue-sagecage)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow blue-sagecage ((this blue-sagecage)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -686,63 +686,63 @@ ;; definition for method 45 of type blue-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-45 blue-sagecage ((obj blue-sagecage)) - (set! (-> *part-id-table* 2448 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2448 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2450 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2450 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2447 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2447 init-specs 13 initial-valuef) (-> obj rot-x)) +(defmethod process-taskable-method-45 blue-sagecage ((this blue-sagecage)) + (set! (-> *part-id-table* 2448 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2448 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2450 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2450 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2447 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2447 init-specs 13 initial-valuef) (-> this rot-x)) (the-as symbol 0) ) ;; definition for method 44 of type blue-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod play-reminder blue-sagecage ((obj blue-sagecage)) - (set! (-> obj idle-anim) 4) - (set! (-> obj attack-start-anim) 5) - (set! (-> obj attack-anim) 6) - (set! (-> obj beam-joint) 53) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 603) obj)) - (set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 607) obj)) - (set! (-> obj resolution-anim) (new 'static 'spool-anim - :name "bluesage-resolution" - :index 7 - :parts 9 - :command-list '((15 send-event self disable-bars) - (45 joint "cameraB") - (74 shadow self #f) - (185 joint "camera") - (256 joint "cameraB") - (505 joint "camera") - (590 joint "cameraB") - (670 joint "camera") - (875 shadow self #t) - (876 joint "cameraB") - ) - ) +(defmethod play-reminder blue-sagecage ((this blue-sagecage)) + (set! (-> this idle-anim) 4) + (set! (-> this attack-start-anim) 5) + (set! (-> this attack-anim) 6) + (set! (-> this beam-joint) 53) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 603) this)) + (set! (-> this part-impact) (create-launch-control (-> *part-group-id-table* 607) this)) + (set! (-> this resolution-anim) (new 'static 'spool-anim + :name "bluesage-resolution" + :index 7 + :parts 9 + :command-list '((15 send-event self disable-bars) + (45 joint "cameraB") + (74 shadow self #f) + (185 joint "camera") + (256 joint "cameraB") + (505 joint "camera") + (590 joint "cameraB") + (670 joint "camera") + (875 shadow self #t) + (876 joint "cameraB") + ) + ) ) - (set! (-> obj sound-name) "bluesage-fires") - ((the-as (function citb-sage none) (find-parent-method blue-sagecage 44)) obj) + (set! (-> this sound-name) "bluesage-fires") + ((the-as (function citb-sage none) (find-parent-method blue-sagecage 44)) this) (the-as symbol 0) ) ;; definition for method 43 of type blue-sagecage -(defmethod process-taskable-method-43 blue-sagecage ((obj blue-sagecage)) - (if (-> obj beam-on) +(defmethod process-taskable-method-43 blue-sagecage ((this blue-sagecage)) + (if (-> this beam-on) (return #f) ) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> obj ambient) "BLU-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BLU-AM01" #f (-> this root-override trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "BLU-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BLU-AM02" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "BLU-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BLU-AM03" #f (-> this root-override trans)) ) ) ) @@ -750,12 +750,12 @@ ) ;; definition for method 11 of type blue-sagecage -(defmethod init-from-entity! blue-sagecage ((obj blue-sagecage) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *bluesage-sg* 3 54 (new 'static 'vector :w 8192.0) 5) - (set! (-> obj tasks) (get-task-control (-> obj entity extra perm task))) - (play-reminder obj) - (set! (-> obj sound-flava) (music-flava sage-blue)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! blue-sagecage ((this blue-sagecage) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *bluesage-sg* 3 54 (new 'static 'vector :w 8192.0) 5) + (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) + (play-reminder this) + (set! (-> this sound-flava) (music-flava sage-blue)) + (process-taskable-method-42 this) (none) ) @@ -769,17 +769,17 @@ ) ;; definition for method 3 of type yellow-sagecage -(defmethod inspect yellow-sagecage ((obj yellow-sagecage)) +(defmethod inspect yellow-sagecage ((this yellow-sagecage)) (let ((t9-0 (method-of-type citb-sage inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 52 of type yellow-sagecage ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 yellow-sagecage ((obj yellow-sagecage)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 yellow-sagecage ((this yellow-sagecage)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 (let ((a0-1 v1-1)) (set! (-> a0-1 settings bot-plane w) (- -6144.0)) @@ -797,21 +797,21 @@ ;; definition for method 48 of type yellow-sagecage ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow yellow-sagecage ((obj yellow-sagecage)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow yellow-sagecage ((this yellow-sagecage)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -822,58 +822,58 @@ ;; definition for method 45 of type yellow-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-45 yellow-sagecage ((obj yellow-sagecage)) - (set! (-> *part-id-table* 2462 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2462 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2464 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2464 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2461 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2461 init-specs 13 initial-valuef) (-> obj rot-x)) +(defmethod process-taskable-method-45 yellow-sagecage ((this yellow-sagecage)) + (set! (-> *part-id-table* 2462 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2462 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2464 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2464 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2461 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2461 init-specs 13 initial-valuef) (-> this rot-x)) (the-as symbol 0) ) ;; definition for method 44 of type yellow-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod play-reminder yellow-sagecage ((obj yellow-sagecage)) - (set! (-> obj idle-anim) 4) - (set! (-> obj attack-start-anim) 5) - (set! (-> obj attack-anim) 6) - (set! (-> obj beam-joint) 74) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 605) obj)) - (set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 609) obj)) - (set! (-> obj resolution-anim) (new 'static 'spool-anim - :name "yellowsage-resolution" - :index 7 - :parts 6 - :command-list '((15 send-event self disable-bars) - (45 joint "cameraB") - (256 joint "camera") - (314 joint "cameraB") - (600 joint "camera") - ) - ) +(defmethod play-reminder yellow-sagecage ((this yellow-sagecage)) + (set! (-> this idle-anim) 4) + (set! (-> this attack-start-anim) 5) + (set! (-> this attack-anim) 6) + (set! (-> this beam-joint) 74) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 605) this)) + (set! (-> this part-impact) (create-launch-control (-> *part-group-id-table* 609) this)) + (set! (-> this resolution-anim) (new 'static 'spool-anim + :name "yellowsage-resolution" + :index 7 + :parts 6 + :command-list '((15 send-event self disable-bars) + (45 joint "cameraB") + (256 joint "camera") + (314 joint "cameraB") + (600 joint "camera") + ) + ) ) - (set! (-> obj sound-name) "yellsage-fire") - ((the-as (function citb-sage none) (find-parent-method yellow-sagecage 44)) obj) + (set! (-> this sound-name) "yellsage-fire") + ((the-as (function citb-sage none) (find-parent-method yellow-sagecage 44)) this) (the-as symbol 0) ) ;; definition for method 43 of type yellow-sagecage -(defmethod process-taskable-method-43 yellow-sagecage ((obj yellow-sagecage)) - (if (-> obj beam-on) +(defmethod process-taskable-method-43 yellow-sagecage ((this yellow-sagecage)) + (if (-> this beam-on) (return #f) ) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.6666667 f0-2) - (play-ambient (-> obj ambient) "YEL-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "YEL-AM01" #f (-> this root-override trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "YEL-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "YEL-AM02" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "YEL-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "YEL-AM03" #f (-> this root-override trans)) ) ) ) @@ -881,12 +881,12 @@ ) ;; definition for method 11 of type yellow-sagecage -(defmethod init-from-entity! yellow-sagecage ((obj yellow-sagecage) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *yellowsage-sg* 3 50 (new 'static 'vector :w 8192.0) 5) - (set! (-> obj tasks) (get-task-control (-> obj entity extra perm task))) - (play-reminder obj) - (set! (-> obj sound-flava) (music-flava sage-yellow)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! yellow-sagecage ((this yellow-sagecage) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *yellowsage-sg* 3 50 (new 'static 'vector :w 8192.0) 5) + (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) + (play-reminder this) + (set! (-> this sound-flava) (music-flava sage-yellow)) + (process-taskable-method-42 this) (none) ) @@ -905,66 +905,66 @@ ) ;; definition for method 3 of type green-sagecage -(defmethod inspect green-sagecage ((obj green-sagecage)) +(defmethod inspect green-sagecage ((this green-sagecage)) (let ((t9-0 (method-of-type citb-sage inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Twhich-movie: ~D~%" (-> obj which-movie)) - (format #t "~T~Tevilbro: ~D~%" (-> obj evilbro)) - (format #t "~T~Tevilsis: ~D~%" (-> obj evilsis)) - (format #t "~T~Trobotboss: ~D~%" (-> obj robotboss)) - (format #t "~T~Texitplat: ~D~%" (-> obj exitplat)) - obj + (format #t "~T~Twhich-movie: ~D~%" (-> this which-movie)) + (format #t "~T~Tevilbro: ~D~%" (-> this evilbro)) + (format #t "~T~Tevilsis: ~D~%" (-> this evilsis)) + (format #t "~T~Trobotboss: ~D~%" (-> this robotboss)) + (format #t "~T~Texitplat: ~D~%" (-> this exitplat)) + this ) ;; definition for method 45 of type green-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod process-taskable-method-45 green-sagecage ((obj green-sagecage)) - (set! (-> *part-id-table* 2469 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2469 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2471 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2471 init-specs 13 initial-valuef) (-> obj rot-x)) - (set! (-> *part-id-table* 2468 init-specs 14 initial-valuef) (-> obj rot-y)) - (set! (-> *part-id-table* 2468 init-specs 13 initial-valuef) (-> obj rot-x)) +(defmethod process-taskable-method-45 green-sagecage ((this green-sagecage)) + (set! (-> *part-id-table* 2469 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2469 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2471 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2471 init-specs 13 initial-valuef) (-> this rot-x)) + (set! (-> *part-id-table* 2468 init-specs 14 initial-valuef) (-> this rot-y)) + (set! (-> *part-id-table* 2468 init-specs 13 initial-valuef) (-> this rot-x)) (the-as symbol 0) ) ;; definition for method 44 of type green-sagecage ;; INFO: Return type mismatch int vs symbol. -(defmethod play-reminder green-sagecage ((obj green-sagecage)) - (set! (-> obj idle-anim) 4) - (set! (-> obj attack-start-anim) 4) - (set! (-> obj attack-anim) 4) - (set! (-> obj beam-joint) 22) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 606) obj)) - (set! (-> obj part-impact) (create-launch-control (-> *part-group-id-table* 610) obj)) - (set! (-> obj resolution-anim) (new 'static 'spool-anim - :name "green-sagecage-resolution" - :index 6 - :parts 12 - :command-list '((33 joint "cameraB") - (156 joint "camera") - (405 joint "cameraB") - (576 joint "camera") - (823 joint "cameraB") - (1156 joint "camera") - (1199 joint "cameraB") - ) - ) +(defmethod play-reminder green-sagecage ((this green-sagecage)) + (set! (-> this idle-anim) 4) + (set! (-> this attack-start-anim) 4) + (set! (-> this attack-anim) 4) + (set! (-> this beam-joint) 22) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 606) this)) + (set! (-> this part-impact) (create-launch-control (-> *part-group-id-table* 610) this)) + (set! (-> this resolution-anim) (new 'static 'spool-anim + :name "green-sagecage-resolution" + :index 6 + :parts 12 + :command-list '((33 joint "cameraB") + (156 joint "camera") + (405 joint "cameraB") + (576 joint "camera") + (823 joint "cameraB") + (1156 joint "camera") + (1199 joint "cameraB") + ) + ) ) - (set! (-> obj sound-name) "greensage-fires") - ((the-as (function citb-sage none) (find-parent-method green-sagecage 44)) obj) + (set! (-> this sound-name) "greensage-fires") + ((the-as (function citb-sage none) (find-parent-method green-sagecage 44)) this) (the-as symbol 0) ) ;; definition for method 32 of type green-sagecage -(defmethod play-anim! green-sagecage ((obj green-sagecage) (arg0 symbol)) +(defmethod play-anim! green-sagecage ((this green-sagecage) (arg0 symbol)) (local-vars (v1-7 int)) - (let ((v1-1 (current-status (-> obj tasks)))) + (let ((v1-1 (current-status (-> this tasks)))) (cond ((= v1-1 (task-status need-hint)) (when arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) (close-specific-task! (game-task citadel-sage-blue) (task-status need-hint)) (close-specific-task! (game-task citadel-sage-red) (task-status need-hint)) (close-specific-task! (game-task citadel-sage-yellow) (task-status need-hint)) @@ -983,31 +983,35 @@ ) ) ) - ((begin (set! v1-7 (-> obj which-movie)) (zero? v1-7)) + ((begin (set! v1-7 (-> this which-movie)) (zero? v1-7)) (when arg0 - (send-event (handle->process (-> obj cage)) 'disable-bars) - (+! (-> obj which-movie) 1) - (set! (-> obj draw bounds w) 40960.0) + (send-event (handle->process (-> this cage)) 'disable-bars) + (+! (-> this which-movie) 1) + (set! (-> this draw bounds w) 40960.0) ) - (-> obj resolution-anim) + (-> this resolution-anim) ) ((= v1-7 1) (when arg0 - (+! (-> obj which-movie) 1) - (set! (-> obj draw bounds w) 40960.0) - (set! (-> obj evilbro) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilbro-citadel-sg* #f :to obj)) + (+! (-> this which-movie) 1) + (set! (-> this draw bounds w) 40960.0) + (set! (-> this evilbro) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *evilbro-citadel-sg* #f :to this) + ) ) - (send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilbro)) 'blend-shape #t) - (send-event (handle->process (-> obj evilbro)) 'center-joint 3) - (set! (-> obj evilsis) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilsis-citadel-sg* #f :to obj)) + (send-event (handle->process (-> this evilbro)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this evilbro)) 'blend-shape #t) + (send-event (handle->process (-> this evilbro)) 'center-joint 3) + (set! (-> this evilsis) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *evilsis-citadel-sg* #f :to this) + ) ) - (send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilsis)) 'blend-shape #t) - (send-event (handle->process (-> obj evilsis)) 'center-joint 3) - (if (handle->process (-> obj exitplat)) + (send-event (handle->process (-> this evilsis)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this evilsis)) 'blend-shape #t) + (send-event (handle->process (-> this evilsis)) 'center-joint 3) + (if (handle->process (-> this exitplat)) (format 0 "exitplat activated~%") ) ) @@ -1099,11 +1103,11 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) @@ -1218,8 +1222,8 @@ ) ;; definition for method 39 of type green-sagecage -(defmethod should-display? green-sagecage ((obj green-sagecage)) - (< (-> obj which-movie) 2) +(defmethod should-display? green-sagecage ((this green-sagecage)) + (< (-> this which-movie) 2) ) ;; failed to figure out what this is: @@ -1241,24 +1245,24 @@ ) ;; definition for method 11 of type green-sagecage -(defmethod init-from-entity! green-sagecage ((obj green-sagecage) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *green-sagecage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (-> obj entity extra perm task))) - (play-reminder obj) - (set! (-> obj evilbro) (the-as handle #f)) - (set! (-> obj evilsis) (the-as handle #f)) - (set! (-> obj robotboss) (the-as handle #f)) - (set! (-> obj exitplat) (the-as handle #f)) +(defmethod init-from-entity! green-sagecage ((this green-sagecage) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *green-sagecage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) + (play-reminder this) + (set! (-> this evilbro) (the-as handle #f)) + (set! (-> this evilsis) (the-as handle #f)) + (set! (-> this robotboss) (the-as handle #f)) + (set! (-> this exitplat) (the-as handle #f)) (cond - ((= (current-status (-> obj tasks)) (task-status invalid)) - (set! (-> obj which-movie) 2) + ((= (current-status (-> this tasks)) (task-status invalid)) + (set! (-> this which-movie) 2) ) (else - (set! (-> obj which-movie) 0) + (set! (-> this which-movie) 0) 0 ) ) - (set! (-> obj sound-flava) (music-flava sage)) - (process-taskable-method-42 obj) + (set! (-> this sound-flava) (music-flava sage)) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/citadel/citb-bunny_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citb-bunny_REF.gc index e50b623511..ad7aa51086 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citb-bunny_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citb-bunny_REF.gc @@ -14,11 +14,11 @@ ) ;; definition for method 3 of type citb-bunny -(defmethod inspect citb-bunny ((obj citb-bunny)) +(defmethod inspect citb-bunny ((this citb-bunny)) (let ((t9-0 (method-of-type snow-bunny inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -82,63 +82,63 @@ ;; definition for method 60 of type citb-bunny ;; INFO: Return type mismatch int vs none. -(defmethod snow-bunny-method-60 citb-bunny ((obj citb-bunny)) - (initialize-skeleton obj *citb-bunny-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) +(defmethod snow-bunny-method-60 citb-bunny ((this citb-bunny)) + (initialize-skeleton this *citb-bunny-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) 0 (none) ) ;; definition for method 48 of type citb-bunny ;; INFO: Return type mismatch int vs none. -(defmethod citb-bunny-method-48 citb-bunny ((obj citb-bunny) (arg0 object)) - (snow-bunny-method-60 obj) - (init-defaults! obj *citb-bunny-nav-enemy-info*) - (logclear! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf03)) +(defmethod citb-bunny-method-48 citb-bunny ((this citb-bunny) (arg0 object)) + (snow-bunny-method-60 this) + (init-defaults! this *citb-bunny-nav-enemy-info*) + (logclear! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond - ((zero? (res-lump-value (-> obj entity) 'mode uint128)) - (set! (-> obj defense) (the-as uint 1)) - (set! (-> obj retreat-timeout) 5.0) + ((zero? (res-lump-value (-> this entity) 'mode uint128)) + (set! (-> this defense) (the-as uint 1)) + (set! (-> this retreat-timeout) 5.0) ) (else - (set! (-> obj defense) (the-as uint 0)) - (set! (-> obj retreat-timeout) 0.1) + (set! (-> this defense) (the-as uint 0)) + (set! (-> this retreat-timeout) 0.1) ) ) - (set! (-> obj last-nondangerous-time) (-> *display* base-frame-counter)) - (set! (-> obj gnd-popup) 16384.0) - (set! (-> obj got-jump-event?) #f) - (set! (-> obj notice-land-anim) 8) - (set! (-> obj attack-anim) 4) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj patrol-rand-distraction) (+ (nav-enemy-rnd-int-count 5) 1)) - (set! (-> obj patrol-hop-failed?) #f) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set-time! (-> this last-nondangerous-time)) + (set! (-> this gnd-popup) 16384.0) + (set! (-> this got-jump-event?) #f) + (set! (-> this notice-land-anim) 8) + (set! (-> this attack-anim) 4) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this patrol-rand-distraction) (+ (nav-enemy-rnd-int-count 5) 1)) + (set! (-> this patrol-hop-failed?) #f) + (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) ) ;; definition for method 56 of type citb-bunny ;; INFO: Return type mismatch float vs none. -(defmethod set-jump-height-factor! citb-bunny ((obj citb-bunny) (arg0 int)) +(defmethod set-jump-height-factor! citb-bunny ((this citb-bunny) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (set! (-> obj jump-anim) 6) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.6) + (set! (-> this jump-anim) 6) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.6) ) ((= v1-0 1) - (set! (-> obj jump-anim) 5) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.6) + (set! (-> this jump-anim) 5) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.6) ) ((= v1-0 2) - (set! (-> obj jump-anim) 5) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.4) + (set! (-> this jump-anim) 5) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.4) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc b/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc index ee4dd20986..d8220982f9 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citb-drop-plat_REF.gc @@ -60,18 +60,18 @@ ) ;; definition for method 3 of type drop-plat -(defmethod inspect drop-plat ((obj drop-plat)) +(defmethod inspect drop-plat ((this drop-plat)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspin-axis: #~%" (-> obj spin-axis)) - (format #t "~T~Tspin-angle: ~f~%" (-> obj spin-angle)) - (format #t "~T~Tspin-speed: ~f~%" (-> obj spin-speed)) - (format #t "~T~Tinterp: ~f~%" (-> obj interp)) - (format #t "~T~Tduration: ~D~%" (-> obj duration)) - (format #t "~T~Tdelay: ~D~%" (-> obj delay)) - (format #t "~T~Tcolor: ~D~%" (-> obj color)) - obj + (format #t "~T~Tspin-axis: #~%" (-> this spin-axis)) + (format #t "~T~Tspin-angle: ~f~%" (-> this spin-angle)) + (format #t "~T~Tspin-speed: ~f~%" (-> this spin-speed)) + (format #t "~T~Tinterp: ~f~%" (-> this interp)) + (format #t "~T~Tduration: ~D~%" (-> this duration)) + (format #t "~T~Tdelay: ~D~%" (-> this delay)) + (format #t "~T~Tcolor: ~D~%" (-> this color)) + this ) ;; failed to figure out what this is: @@ -92,10 +92,10 @@ :code (behavior () (suspend) (update-transforms! (-> self root-override)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self mask) (process-mask actor-pause)) (loop - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self duration)) + (if (time-elapsed? (-> self state-time) (-> self duration)) (go drop-plat-drop) ) (suspend) @@ -136,9 +136,9 @@ ) (logior! (-> self draw status) (draw-status hidden)) (ja-post) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay)) + (when (time-elapsed? (-> self state-time) (-> self delay)) (let ((v1-14 (logclear (-> self draw status) (draw-status hidden))) (a0-5 (-> self draw)) ) @@ -162,7 +162,7 @@ ) :code (behavior ((arg0 draw-control)) (set! (-> self interp) 1.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self spin-angle) 0.0) (set! (-> self root-override trans y) (+ -204800.0 (-> (the-as process-drawable (-> self parent 0)) root trans y)) @@ -173,10 +173,7 @@ (set! (-> gp-0 quad) (-> self root-override trans quad)) (set! (-> gp-0 y) (-> (the-as process-drawable (-> self parent 0)) root trans y)) (loop - (let ((f0-6 - (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) - ) - ) + (let ((f0-6 (fmax 0.0 (- 1.0 (* 0.0033333334 (the float (- (current-time) (-> self state-time)))))))) (set! (-> self interp) (* f0-6 f0-6)) ) (set! (-> self root-override trans y) @@ -208,13 +205,11 @@ (defstate drop-plat-drop (drop-plat) :code (behavior () (when (= (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sound-play "bridge-piece-dn") (let ((gp-1 (the int (* 300.0 (rand-vu-float-range 0.2 0.3))))) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-1) - (set! (-> self interp) - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) (the float gp-1)) - ) + (while (not (time-elapsed? (-> self state-time) gp-1)) + (set! (-> self interp) (/ (the float (- (current-time) (-> self state-time))) (the float gp-1))) (set! (-> self spin-angle) (* 910.2222 (sin (* 196608.0 (-> self interp))))) (suspend) ) @@ -231,7 +226,7 @@ ) (go drop-plat-die) ) - (+! (-> self spin-angle) (* (-> self spin-speed) (-> *display* seconds-per-frame))) + (+! (-> self spin-angle) (* (-> self spin-speed) (seconds-per-frame))) (suspend) ) ) @@ -254,8 +249,8 @@ ;; definition for method 20 of type drop-plat ;; INFO: Return type mismatch int vs none. -(defmethod drop-plat-method-20 drop-plat ((obj drop-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod drop-plat-method-20 drop-plat ((this drop-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -273,7 +268,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -281,25 +276,25 @@ ;; definition for method 21 of type drop-plat ;; INFO: Return type mismatch int vs none. -(defmethod drop-plat-method-21 drop-plat ((obj drop-plat)) - (case (-> obj color) +(defmethod drop-plat-method-21 drop-plat ((this drop-plat)) + (case (-> this color) ((1) - (initialize-skeleton obj *citb-drop-plat-red-sg* '()) + (initialize-skeleton this *citb-drop-plat-red-sg* '()) ) ((2) - (initialize-skeleton obj *citb-drop-plat-green-sg* '()) + (initialize-skeleton this *citb-drop-plat-green-sg* '()) ) ((3) - (initialize-skeleton obj *citb-drop-plat-blue-sg* '()) + (initialize-skeleton this *citb-drop-plat-blue-sg* '()) ) ((4) - (initialize-skeleton obj *citb-drop-plat-yellow-sg* '()) + (initialize-skeleton this *citb-drop-plat-yellow-sg* '()) ) (else - (initialize-skeleton obj *citb-drop-plat-sg* '()) + (initialize-skeleton this *citb-drop-plat-sg* '()) ) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -311,13 +306,13 @@ (set! (-> s3-0 y) (* f30-1 (* f0-2 f0-2))) ) (vector-sincos! s5-0 s4-0 s3-0) - (set! (-> obj spin-axis x) (* (-> s4-0 y) (-> s4-0 x))) - (set! (-> obj spin-axis y) (-> s5-0 y)) - (set! (-> obj spin-axis z) (* (-> s4-0 y) (-> s5-0 x))) + (set! (-> this spin-axis x) (* (-> s4-0 y) (-> s4-0 x))) + (set! (-> this spin-axis y) (-> s5-0 y)) + (set! (-> this spin-axis z) (* (-> s4-0 y) (-> s5-0 x))) ) - (set! (-> obj spin-axis w) 1.0) - (set! (-> obj spin-angle) 0.0) - (set! (-> obj spin-speed) (* 8192.0 (+ 1.0 (rand-vu)))) + (set! (-> this spin-axis w) 1.0) + (set! (-> this spin-angle) 0.0) + (set! (-> this spin-speed) (* 8192.0 (+ 1.0 (rand-vu)))) 0 (none) ) @@ -348,12 +343,12 @@ ) ;; definition for method 3 of type handle-inline-array -(defmethod inspect handle-inline-array ((obj handle-inline-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect handle-inline-array ((this handle-inline-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -386,33 +381,33 @@ ) ;; definition for method 3 of type citb-drop-plat -(defmethod inspect citb-drop-plat ((obj citb-drop-plat)) +(defmethod inspect citb-drop-plat ((this citb-drop-plat)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tx-count: ~D~%" (-> obj x-count)) - (format #t "~T~Tz-count: ~D~%" (-> obj z-count)) - (format #t "~T~Tchild-count: ~D~%" (-> obj child-count)) - (format #t "~T~Tchild-array: ~A~%" (-> obj child-array)) - (format #t "~T~Tchild-color-array: #x~X~%" (-> obj child-color-array)) - (format #t "~T~Tx-dir: #~%" (-> obj x-dir)) - (format #t "~T~Tz-dir: #~%" (-> obj z-dir)) - (format #t "~T~Torigin: #~%" (-> obj origin)) - (format #t "~T~Tx-spacing: ~f~%" (-> obj x-spacing)) - (format #t "~T~Tz-spacing: ~f~%" (-> obj z-spacing)) - (format #t "~T~Tidle-distance: ~f~%" (-> obj idle-distance)) - (format #t "~T~Tduration: ~D~%" (-> obj duration)) - (format #t "~T~Tdrop-time: ~D~%" (-> obj drop-time)) - obj + (format #t "~T~Tx-count: ~D~%" (-> this x-count)) + (format #t "~T~Tz-count: ~D~%" (-> this z-count)) + (format #t "~T~Tchild-count: ~D~%" (-> this child-count)) + (format #t "~T~Tchild-array: ~A~%" (-> this child-array)) + (format #t "~T~Tchild-color-array: #x~X~%" (-> this child-color-array)) + (format #t "~T~Tx-dir: #~%" (-> this x-dir)) + (format #t "~T~Tz-dir: #~%" (-> this z-dir)) + (format #t "~T~Torigin: #~%" (-> this origin)) + (format #t "~T~Tx-spacing: ~f~%" (-> this x-spacing)) + (format #t "~T~Tz-spacing: ~f~%" (-> this z-spacing)) + (format #t "~T~Tidle-distance: ~f~%" (-> this idle-distance)) + (format #t "~T~Tduration: ~D~%" (-> this duration)) + (format #t "~T~Tdrop-time: ~D~%" (-> this drop-time)) + this ) ;; definition for method 7 of type citb-drop-plat ;; INFO: Return type mismatch process-drawable vs citb-drop-plat. -(defmethod relocate citb-drop-plat ((obj citb-drop-plat) (arg0 int)) - (if (nonzero? (-> obj child-array)) - (&+! (-> obj child-array) arg0) +(defmethod relocate citb-drop-plat ((this citb-drop-plat) (arg0 int)) + (if (nonzero? (-> this child-array)) + (&+! (-> this child-array) arg0) ) - (the-as citb-drop-plat ((method-of-type process-drawable relocate) obj arg0)) + (the-as citb-drop-plat ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for function citb-drop-plat-spawn-children @@ -472,8 +467,8 @@ ) ) ) - (let ((s2-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s2-1) (seconds 0.12)) + (let ((s2-1 (current-time))) + (until (time-elapsed? s2-1 (seconds 0.12)) (suspend) ) ) @@ -481,7 +476,7 @@ ) ) ) - (set! (-> self drop-time) (-> *display* base-frame-counter)) + (set-time! (-> self drop-time)) 0 (none) ) @@ -538,8 +533,8 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('player-stepped) - (when (>= (- (-> *display* base-frame-counter) (-> self drop-time)) (seconds 0.2)) - (set! (-> self drop-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self drop-time) (seconds 0.2)) + (set-time! (-> self drop-time)) (citb-drop-plat-drop-children (the-as int (-> block param 0))) ) ) @@ -549,10 +544,10 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (citb-drop-plat-spawn-children) (loop - (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (+ (-> self duration) (seconds 2))) + (if (or (time-elapsed? (-> self state-time) (+ (-> self duration) (seconds 2))) (or (not *target*) (< (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) @@ -568,38 +563,38 @@ ;; definition for method 11 of type citb-drop-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-drop-plat ((obj citb-drop-plat) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! citb-drop-plat ((this citb-drop-plat) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (let ((v1-2 (res-lump-data arg0 'count pointer))) (when v1-2 - (set! (-> obj x-count) (-> (the-as (pointer int32) v1-2) 0)) - (set! (-> obj z-count) (-> (the-as (pointer int32) v1-2) 1)) + (set! (-> this x-count) (-> (the-as (pointer int32) v1-2) 0)) + (set! (-> this z-count) (-> (the-as (pointer int32) v1-2) 1)) ) ) - (set! (-> obj child-count) (* (-> obj x-count) (-> obj z-count))) - (set! (-> obj child-color-array) (res-lump-data arg0 'plat-type (pointer int8))) - (when (> (-> obj child-count) 0) - (set! (-> obj child-array) (new 'process 'handle-inline-array (-> obj child-count))) - (dotimes (v1-9 (-> obj child-count)) - (set! (-> obj child-array data v1-9) (the-as handle #f)) + (set! (-> this child-count) (* (-> this x-count) (-> this z-count))) + (set! (-> this child-color-array) (res-lump-data arg0 'plat-type (pointer int8))) + (when (> (-> this child-count) 0) + (set! (-> this child-array) (new 'process 'handle-inline-array (-> this child-count))) + (dotimes (v1-9 (-> this child-count)) + (set! (-> this child-array data v1-9) (the-as handle #f)) ) ) - (set! (-> obj x-spacing) 16384.0) - (set! (-> obj z-spacing) 16384.0) - (set! (-> obj idle-distance) (+ 40960.0 (* 0.5 (the float (-> obj z-count)) (-> obj z-spacing)))) - (set! (-> obj duration) (the-as time-frame (the int (* 300.0 (+ 2.0 (the float (-> obj z-count))))))) + (set! (-> this x-spacing) 16384.0) + (set! (-> this z-spacing) 16384.0) + (set! (-> this idle-distance) (+ 40960.0 (* 0.5 (the float (-> this z-count)) (-> this z-spacing)))) + (set! (-> this duration) (the-as time-frame (the int (* 300.0 (+ 2.0 (the float (-> this z-count))))))) (let ((f0-7 (res-lump-float arg0 'rotoffset))) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-7) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-7) ) - (vector-x-quaternion! (-> obj x-dir) (-> obj root quat)) - (vector-z-quaternion! (-> obj z-dir) (-> obj root quat)) - (set! (-> obj origin quad) (-> obj root trans quad)) - (let ((f0-10 (* -0.5 (the float (+ (-> obj x-count) -1)) (-> obj x-spacing))) - (f30-0 (* -0.5 (the float (+ (-> obj z-count) -1)) (-> obj z-spacing))) + (vector-x-quaternion! (-> this x-dir) (-> this root quat)) + (vector-z-quaternion! (-> this z-dir) (-> this root quat)) + (set! (-> this origin quad) (-> this root trans quad)) + (let ((f0-10 (* -0.5 (the float (+ (-> this x-count) -1)) (-> this x-spacing))) + (f30-0 (* -0.5 (the float (+ (-> this z-count) -1)) (-> this z-spacing))) ) - (vector+*! (-> obj origin) (-> obj origin) (-> obj x-dir) f0-10) - (vector+*! (-> obj origin) (-> obj origin) (-> obj z-dir) f30-0) + (vector+*! (-> this origin) (-> this origin) (-> this x-dir) f0-10) + (vector+*! (-> this origin) (-> this origin) (-> this z-dir) f30-0) ) (go citb-drop-plat-idle) (none) 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 05a8d3963a..6d0a3f2194 100644 --- a/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/citadel/citb-plat_REF.gc @@ -50,12 +50,12 @@ ) ;; definition for method 3 of type citb-base-plat -(defmethod inspect citb-base-plat ((obj citb-base-plat)) +(defmethod inspect citb-base-plat ((this citb-base-plat)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tidle-distance: ~f~%" (-> obj idle-distance)) - obj + (format #t "~T~Tidle-distance: ~f~%" (-> this idle-distance)) + this ) ;; failed to figure out what this is: @@ -91,8 +91,8 @@ ;; definition for method 21 of type citb-base-plat ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-21 citb-base-plat ((obj citb-base-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod citb-base-plat-method-21 citb-base-plat ((this citb-base-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -110,7 +110,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -118,28 +118,28 @@ ;; definition for method 22 of type citb-base-plat ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-22 citb-base-plat ((obj citb-base-plat)) - (initialize-skeleton obj *plat-citb-sg* '()) +(defmethod citb-base-plat-method-22 citb-base-plat ((this citb-base-plat)) + (initialize-skeleton this *plat-citb-sg* '()) 0 (none) ) ;; definition for method 24 of type citb-base-plat ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-24 citb-base-plat ((obj citb-base-plat)) - (go (method-of-object obj citb-base-plat-idle)) +(defmethod citb-base-plat-method-24 citb-base-plat ((this citb-base-plat)) + (go (method-of-object this citb-base-plat-idle)) 0 (none) ) ;; definition for method 11 of type citb-base-plat -(defmethod init-from-entity! citb-base-plat ((obj citb-base-plat) (arg0 entity-actor)) - (citb-base-plat-method-21 obj) - (process-drawable-from-entity! obj arg0) - (set! (-> obj idle-distance) 245760.0) - (citb-base-plat-method-22 obj) - (logior! (-> obj skel status) (janim-status inited)) - (citb-base-plat-method-24 obj) +(defmethod init-from-entity! citb-base-plat ((this citb-base-plat) (arg0 entity-actor)) + (citb-base-plat-method-21 this) + (process-drawable-from-entity! this arg0) + (set! (-> this idle-distance) 245760.0) + (citb-base-plat-method-22 this) + (logior! (-> this skel status) (janim-status inited)) + (citb-base-plat-method-24 this) (none) ) @@ -153,17 +153,17 @@ ) ;; definition for method 3 of type citb-plat-eco -(defmethod inspect citb-plat-eco ((obj citb-plat-eco)) +(defmethod inspect citb-plat-eco ((this citb-plat-eco)) (let ((t9-0 (method-of-type plat-eco inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 24 of type citb-plat-eco ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 citb-plat-eco ((obj citb-plat-eco)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod baseplat-method-24 citb-plat-eco ((this citb-plat-eco)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -181,7 +181,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -189,19 +189,19 @@ ;; definition for method 26 of type citb-plat-eco ;; INFO: Return type mismatch float vs none. -(defmethod baseplat-method-26 citb-plat-eco ((obj citb-plat-eco)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj notice-dist) 8192.0) +(defmethod baseplat-method-26 citb-plat-eco ((this citb-plat-eco)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this notice-dist) 8192.0) (none) ) ;; definition for method 23 of type citb-plat-eco -(defmethod get-unlit-skel citb-plat-eco ((obj citb-plat-eco)) +(defmethod get-unlit-skel citb-plat-eco ((this citb-plat-eco)) *plat-eco-citb-unlit-sg* ) ;; definition for method 27 of type citb-plat-eco -(defmethod get-lit-skel citb-plat-eco ((obj citb-plat-eco)) +(defmethod get-lit-skel citb-plat-eco ((this citb-plat-eco)) *plat-eco-citb-lit-sg* ) @@ -216,12 +216,12 @@ ) ;; definition for method 3 of type citb-plat -(defmethod inspect citb-plat ((obj citb-plat)) +(defmethod inspect citb-plat ((this citb-plat)) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttrans-offset: #~%" (-> obj trans-offset)) - obj + (format #t "~T~Ttrans-offset: #~%" (-> this trans-offset)) + this ) ;; failed to figure out what this is: @@ -243,14 +243,14 @@ ) ;; definition for method 23 of type citb-plat -(defmethod get-unlit-skel citb-plat ((obj citb-plat)) +(defmethod get-unlit-skel citb-plat ((this citb-plat)) *plat-citb-sg* ) ;; definition for method 24 of type citb-plat ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 citb-plat ((obj citb-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod baseplat-method-24 citb-plat ((this citb-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -268,7 +268,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -277,27 +277,27 @@ ;; definition for method 26 of type citb-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 citb-plat ((obj citb-plat)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj root-override scale quad) (-> (res-lump-struct (-> obj entity) 'scale vector) quad)) - (let ((f0-0 (-> obj root-override scale x))) - (set! (-> obj root-override root-prim local-sphere w) - (* (-> obj root-override root-prim local-sphere w) f0-0) +(defmethod baseplat-method-26 citb-plat ((this citb-plat)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this root-override scale quad) (-> (res-lump-struct (-> this entity) 'scale vector) quad)) + (let ((f0-0 (-> this root-override scale x))) + (set! (-> this root-override root-prim local-sphere w) + (* (-> this root-override root-prim local-sphere w) f0-0) ) - (set! (-> obj draw bounds w) (* (-> obj draw bounds w) f0-0)) + (set! (-> this draw bounds w) (* (-> this draw bounds w) f0-0)) ) - (set! (-> obj trans-offset quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) - (-> obj entity) - 'trans-offset - 'interp - -1000000000.0 - *null-vector* - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - quad - ) + (set! (-> this trans-offset quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) + (-> this entity) + 'trans-offset + 'interp + -1000000000.0 + *null-vector* + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + quad + ) ) 0 (none) @@ -317,15 +317,15 @@ ) ;; definition for method 3 of type citb-stair-plat -(defmethod inspect citb-stair-plat ((obj citb-stair-plat)) +(defmethod inspect citb-stair-plat ((this citb-stair-plat)) (let ((t9-0 (method-of-type citb-base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tidle-height: ~f~%" (-> obj idle-height)) - (format #t "~T~Trise-height: ~f~%" (-> obj rise-height)) - (format #t "~T~Tdelay: ~D~%" (-> obj delay)) - (format #t "~T~Trise: ~A~%" (-> obj rise)) - obj + (format #t "~T~Tidle-height: ~f~%" (-> this idle-height)) + (format #t "~T~Trise-height: ~f~%" (-> this rise-height)) + (format #t "~T~Tdelay: ~D~%" (-> this delay)) + (format #t "~T~Trise: ~A~%" (-> this rise)) + this ) ;; failed to figure out what this is: @@ -350,14 +350,14 @@ ) (logclear! (-> self draw status) (draw-status hidden)) (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (-> self delay))) (ja-post) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (let ((f30-0 (- 1.0 (* 0.0011111111 (the float (- (-> *display* base-frame-counter) (-> self state-time))))))) + (let ((f30-0 (- 1.0 (* 0.0011111111 (the float (- (current-time) (-> self state-time))))))) (when (< f30-0 0.0) (set! (-> self root-override trans y) (-> self rise-height)) (go-virtual citb-base-plat-active) @@ -392,21 +392,21 @@ ;; definition for method 22 of type citb-stair-plat ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-22 citb-stair-plat ((obj citb-stair-plat)) - (initialize-skeleton obj *plat-citb-sg* '()) - (set! (-> obj rise-height) (-> obj root-override trans y)) - (set! (-> obj idle-height) (+ -409600.0 (-> obj rise-height))) - (set! (-> obj root-override trans y) (-> obj idle-height)) - (set! (-> obj rise) #f) - (set! (-> obj delay) - (the-as time-frame (the int (* 300.0 (res-lump-float (-> obj entity) 'delay :default 1.0)))) +(defmethod citb-base-plat-method-22 citb-stair-plat ((this citb-stair-plat)) + (initialize-skeleton this *plat-citb-sg* '()) + (set! (-> this rise-height) (-> this root-override trans y)) + (set! (-> this idle-height) (+ -409600.0 (-> this rise-height))) + (set! (-> this root-override trans y) (-> this idle-height)) + (set! (-> this rise) #f) + (set! (-> this delay) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'delay :default 1.0)))) ) (let ((f0-7 1.5)) - (set-vector! (-> obj root-override scale) f0-7 f0-7 f0-7 1.0) - (set! (-> obj root-override root-prim local-sphere w) - (* (-> obj root-override root-prim local-sphere w) f0-7) + (set-vector! (-> this root-override scale) f0-7 f0-7 f0-7 1.0) + (set! (-> this root-override root-prim local-sphere w) + (* (-> this root-override root-prim local-sphere w) f0-7) ) - (set! (-> obj draw bounds w) (* (-> obj draw bounds w) f0-7)) + (set! (-> this draw bounds w) (* (-> this draw bounds w) f0-7)) ) 0 (none) @@ -414,13 +414,13 @@ ;; definition for method 24 of type citb-stair-plat ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-24 citb-stair-plat ((obj citb-stair-plat)) +(defmethod citb-base-plat-method-24 citb-stair-plat ((this citb-stair-plat)) (if (and (task-complete? *game-info* (game-task citadel-sage-blue)) (task-complete? *game-info* (game-task citadel-sage-red)) (task-complete? *game-info* (game-task citadel-sage-yellow)) ) - (go (method-of-object obj citb-base-plat-active)) - (go (method-of-object obj citb-base-plat-idle)) + (go (method-of-object this citb-base-plat-active)) + (go (method-of-object this citb-base-plat-idle)) ) 0 (none) @@ -471,42 +471,42 @@ ) ;; definition for method 3 of type citb-chain-plat -(defmethod inspect citb-chain-plat ((obj citb-chain-plat)) +(defmethod inspect citb-chain-plat ((this citb-chain-plat)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Torig-trans: #~%" (-> obj orig-trans)) - (format #t "~T~Torig-quat: #~%" (-> obj orig-quat)) - (format #t "~T~Tbeam-end: #~%" (-> obj beam-end)) - (format #t "~T~Tfloat-offset: ~f~%" (-> obj float-offset)) - (format #t "~T~Tidle-offset: ~f~%" (-> obj idle-offset)) - obj + (format #t "~T~Torig-trans: #~%" (-> this orig-trans)) + (format #t "~T~Torig-quat: #~%" (-> this orig-quat)) + (format #t "~T~Tbeam-end: #~%" (-> this beam-end)) + (format #t "~T~Tfloat-offset: ~f~%" (-> this float-offset)) + (format #t "~T~Tidle-offset: ~f~%" (-> this idle-offset)) + this ) ;; definition for method 22 of type citb-chain-plat -(defmethod rigid-body-platform-method-22 citb-chain-plat ((obj citb-chain-plat) (arg0 vector) (arg1 float)) +(defmethod rigid-body-platform-method-22 citb-chain-plat ((this citb-chain-plat) (arg0 vector) (arg1 float)) (+ 12288.0 (* 2048.0 - (fmax 0.0 (fmin 1.0 (* 0.000024414063 (-> obj float-height-offset)))) + (fmax 0.0 (fmin 1.0 (* 0.000024414063 (-> this float-height-offset)))) (cos (* 109.22667 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z))))) ) - (-> obj float-height-offset) - (-> obj orig-trans y) + (-> this float-height-offset) + (-> this orig-trans y) ) ) ;; definition for method 27 of type citb-chain-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-27 citb-chain-plat ((obj citb-chain-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-27 citb-chain-plat ((this citb-chain-plat) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 arg0 (-> obj rbody position)) + (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) (let* ((f0-1 (vector-length gp-0)) (f1-1 (* 4.0 (fmax 0.0 (fmin 4096.0 (+ -819.2 f0-1))))) ) (when (< 0.0 f1-1) (vector-float*! gp-0 gp-0 (/ f1-1 f0-1)) - (rigid-body-method-15 (-> obj rbody) gp-0) + (rigid-body-method-15 (-> this rbody) gp-0) ) ) ) @@ -516,9 +516,9 @@ ;; 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 ((obj citb-chain-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method citb-chain-plat 23)) obj arg0) - (rigid-body-platform-method-27 obj (-> obj orig-trans)) +(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) + (rigid-body-platform-method-27 this (-> this orig-trans)) 0 (none) ) @@ -527,8 +527,8 @@ (defstate rigid-body-platform-idle (citb-chain-plat) :virtual #t :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (set-time! (-> self state-time)) (if (and (and *target* (>= (-> self info idle-distance) (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) ) @@ -550,7 +550,7 @@ :virtual #t :event rigid-body-platform-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (stop! (-> self sound)) @@ -563,18 +563,18 @@ ) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) - (when (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (when (not (time-elapsed? (-> self state-time) (seconds 1))) (if (rand-vu-percent? 0.05) (spawn-projectile-blue *target*) ) ) - (seek! (-> self float-height-offset) (-> self float-offset) (* 8192.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) (-> self float-offset) (* 8192.0 (seconds-per-frame))) (draw-eco-beam (-> self root-overlay trans) (-> self beam-end)) (update-trans! (-> self sound) (-> self root-overlay trans)) (update! (-> self sound)) ) (else - (seek! (-> self float-height-offset) (-> self idle-offset) (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) (-> self idle-offset) (* 16384.0 (seconds-per-frame))) (stop! (-> self sound)) (if (= (-> self float-height-offset) (-> self idle-offset)) (go citb-chain-plat-settle) @@ -597,9 +597,9 @@ ) (set! (-> gp-0 quad) (-> self root-overlay trans quad)) (quaternion-copy! s5-0 (-> self root-overlay quat)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) - (let ((f30-0 (* 0.013333334 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.25))) + (let ((f30-0 (* 0.013333334 (the float (- (current-time) (-> self state-time)))))) (quaternion-slerp! (-> self root-overlay quat) s5-0 (-> self orig-quat) f30-0) (vector-lerp! (-> self root-overlay trans) gp-0 (-> self orig-trans) f30-0) ) @@ -623,8 +623,8 @@ ;; definition for method 30 of type citb-chain-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 citb-chain-plat ((obj citb-chain-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 citb-chain-plat ((this citb-chain-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -642,7 +642,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -651,22 +651,22 @@ ;; definition for method 31 of type citb-chain-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 citb-chain-plat ((obj citb-chain-plat)) - (initialize-skeleton obj *citb-chain-plat-sg* '()) - (set! (-> obj orig-trans quad) (-> obj root-overlay trans quad)) - (quaternion-copy! (-> obj orig-quat) (-> obj root-overlay quat)) - (set! (-> obj beam-end quad) (-> obj orig-trans quad)) - (+! (-> obj beam-end y) -49152.0) - (rigid-body-platform-method-29 obj *citb-chain-plat-constants*) - (set! (-> obj idle-offset) 0.0) - (set! (-> obj float-offset) (res-lump-float (-> obj entity) 'height-info :default 4096.0)) - (set! (-> obj float-height-offset) (-> obj idle-offset)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "eco-plat-hover" :fo-max 50) (-> obj root-overlay trans)) +(defmethod rigid-body-platform-method-31 citb-chain-plat ((this citb-chain-plat)) + (initialize-skeleton this *citb-chain-plat-sg* '()) + (set! (-> this orig-trans quad) (-> this root-overlay trans quad)) + (quaternion-copy! (-> this orig-quat) (-> this root-overlay quat)) + (set! (-> this beam-end quad) (-> this orig-trans quad)) + (+! (-> this beam-end y) -49152.0) + (rigid-body-platform-method-29 this *citb-chain-plat-constants*) + (set! (-> this idle-offset) 0.0) + (set! (-> this float-offset) (res-lump-float (-> this entity) 'height-info :default 4096.0)) + (set! (-> this float-height-offset) (-> this idle-offset)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "eco-plat-hover" :fo-max 50) (-> this root-overlay trans)) ) - (let ((s5-0 (-> obj info control-point-count))) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0))))) (set! (-> s3-0 local-pos x) (* 16384.0 (sin f30-0))) (set! (-> s3-0 local-pos y) 0.0) @@ -696,11 +696,11 @@ ) ;; definition for method 3 of type citb-rotatebox -(defmethod inspect citb-rotatebox ((obj citb-rotatebox)) +(defmethod inspect citb-rotatebox ((this citb-rotatebox)) (let ((t9-0 (method-of-type citb-base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -726,8 +726,8 @@ ;; definition for method 21 of type citb-rotatebox ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-21 citb-rotatebox ((obj citb-rotatebox)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod citb-base-plat-method-21 citb-rotatebox ((this citb-rotatebox)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -745,7 +745,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -753,8 +753,8 @@ ;; definition for method 22 of type citb-rotatebox ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-22 citb-rotatebox ((obj citb-rotatebox)) - (initialize-skeleton obj *citb-rotatebox-sg* '()) +(defmethod citb-base-plat-method-22 citb-rotatebox ((this citb-rotatebox)) + (initialize-skeleton this *citb-rotatebox-sg* '()) 0 (none) ) @@ -776,12 +776,12 @@ ) ;; definition for method 3 of type citb-donut -(defmethod inspect citb-donut ((obj citb-donut)) +(defmethod inspect citb-donut ((this citb-donut)) (let ((t9-0 (method-of-type citb-base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + this ) ;; failed to figure out what this is: @@ -802,8 +802,8 @@ ;; definition for method 21 of type citb-donut ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-21 citb-donut ((obj citb-donut)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod citb-base-plat-method-21 citb-donut ((this citb-donut)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -821,7 +821,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -829,13 +829,13 @@ ;; definition for method 22 of type citb-donut ;; INFO: Return type mismatch int vs none. -(defmethod citb-base-plat-method-22 citb-donut ((obj citb-donut)) - (initialize-skeleton obj *citb-donut-sg* '()) - (setup-params! (-> obj sync) (the-as uint 9000) 0.0 0.15 0.15) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> obj root-override trans)) +(defmethod citb-base-plat-method-22 citb-donut ((this citb-donut)) + (initialize-skeleton this *citb-donut-sg* '()) + (setup-params! (-> this sync) (the-as uint 9000) 0.0 0.15 0.15) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "rotate-plat" :fo-max 20) (-> this root-override trans)) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) ) @@ -856,11 +856,11 @@ ) ;; definition for method 3 of type citb-stopbox -(defmethod inspect citb-stopbox ((obj citb-stopbox)) +(defmethod inspect citb-stopbox ((this citb-stopbox)) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -877,14 +877,14 @@ ) ;; definition for method 23 of type citb-stopbox -(defmethod get-unlit-skel citb-stopbox ((obj citb-stopbox)) +(defmethod get-unlit-skel citb-stopbox ((this citb-stopbox)) *citb-stopbox-sg* ) ;; definition for method 24 of type citb-stopbox ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 citb-stopbox ((obj citb-stopbox)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod baseplat-method-24 citb-stopbox ((this citb-stopbox)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -902,7 +902,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -910,9 +910,9 @@ ;; definition for method 26 of type citb-stopbox ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 citb-stopbox ((obj citb-stopbox)) - (logior! (-> obj fact options) (fact-options wrap-phase)) - (logclear! (-> obj mask) (process-mask actor-pause)) +(defmethod baseplat-method-26 citb-stopbox ((this citb-stopbox)) + (logior! (-> this fact options) (fact-options wrap-phase)) + (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) ) @@ -937,15 +937,15 @@ ) ;; definition for method 3 of type citb-firehose -(defmethod inspect citb-firehose ((obj citb-firehose)) +(defmethod inspect citb-firehose ((this citb-firehose)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tidle-distance: ~f~%" (-> obj idle-distance)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tlast-sync: ~f~%" (-> obj last-sync)) - (format #t "~T~Tblast-pos: #~%" (-> obj blast-pos)) - obj + (format #t "~T~Tidle-distance: ~f~%" (-> this idle-distance)) + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tlast-sync: ~f~%" (-> this last-sync)) + (format #t "~T~Tblast-pos: #~%" (-> this blast-pos)) + this ) ;; failed to figure out what this is: @@ -1058,8 +1058,8 @@ ;; definition for method 11 of type citb-firehose ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! citb-firehose ((obj citb-firehose) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! citb-firehose ((this citb-firehose) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1090,14 +1090,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *citb-firehose-sg* '()) - (load-params! (-> obj sync) obj (the-as uint 900) 0.0 0.15 0.15) - (set! (-> obj idle-distance) 286720.0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 685) obj)) - (clear-collide-with-as (-> obj root-override)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *citb-firehose-sg* '()) + (load-params! (-> this sync) this (the-as uint 900) 0.0 0.15 0.15) + (set! (-> this idle-distance) 286720.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 685) this)) + (clear-collide-with-as (-> this root-override)) (go citb-firehose-idle) (none) ) @@ -1125,14 +1125,14 @@ ) ;; definition for method 3 of type citb-exit-plat -(defmethod inspect citb-exit-plat ((obj citb-exit-plat)) +(defmethod inspect citb-exit-plat ((this citb-exit-plat)) (let ((t9-0 (method-of-type plat-button inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tidle-height: ~f~%" (-> obj idle-height)) - (format #t "~T~Trise-height: ~f~%" (-> obj rise-height)) - (format #t "~T~Tactivated: ~A~%" (-> obj activated)) - obj + (format #t "~T~Tidle-height: ~f~%" (-> this idle-height)) + (format #t "~T~Trise-height: ~f~%" (-> this rise-height)) + (format #t "~T~Tactivated: ~A~%" (-> this activated)) + this ) ;; failed to figure out what this is: @@ -1163,9 +1163,9 @@ :code (behavior () (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root-override)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (let ((f30-0 (- 1.0 (* 0.0016666667 (the float (- (-> *display* base-frame-counter) (-> self state-time))))))) + (let ((f30-0 (- 1.0 (* 0.0016666667 (the float (- (current-time) (-> self state-time))))))) (when (< f30-0 0.0) (set! (-> self root-override trans y) (-> self rise-height)) (go-virtual plat-button-idle) @@ -1235,21 +1235,21 @@ ) ;; definition for method 26 of type citb-exit-plat -(defmethod can-activate? citb-exit-plat ((obj citb-exit-plat)) +(defmethod can-activate? citb-exit-plat ((this citb-exit-plat)) (not (movie?)) ) ;; definition for method 31 of type citb-exit-plat -(defmethod plat-button-method-31 citb-exit-plat ((obj citb-exit-plat)) - (initialize-skeleton obj *citb-exit-plat-sg* '()) +(defmethod plat-button-method-31 citb-exit-plat ((this citb-exit-plat)) + (initialize-skeleton this *citb-exit-plat-sg* '()) (none) ) ;; definition for method 32 of type citb-exit-plat ;; INFO: Return type mismatch int vs none. -(defmethod plat-button-method-32 citb-exit-plat ((obj citb-exit-plat)) - (if (-> obj activated) - (go (method-of-object obj plat-button-idle)) +(defmethod plat-button-method-32 citb-exit-plat ((this citb-exit-plat)) + (if (-> this activated) + (go (method-of-object this plat-button-idle)) (go citb-exit-plat-idle) ) 0 @@ -1257,8 +1257,8 @@ ) ;; definition for method 28 of type citb-exit-plat -(defmethod plat-button-method-28 citb-exit-plat ((obj citb-exit-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod plat-button-method-28 citb-exit-plat ((this citb-exit-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1293,45 +1293,45 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) s5-0 ) ) ;; definition for method 29 of type citb-exit-plat ;; INFO: Return type mismatch int vs none. -(defmethod can-target-move? citb-exit-plat ((obj citb-exit-plat)) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj draw light-index) (the-as uint 255)) - (let ((a0-5 (entity-actor-lookup (-> obj entity) 'state-actor 0))) - (set! (-> obj activated) (logtest? (-> a0-5 extra perm status) (entity-perm-status complete))) +(defmethod can-target-move? citb-exit-plat ((this citb-exit-plat)) + (process-entity-status! this (entity-perm-status bit-7) #t) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 255)) + (let ((a0-5 (entity-actor-lookup (-> this entity) 'state-actor 0))) + (set! (-> this activated) (logtest? (-> a0-5 extra perm status) (entity-perm-status complete))) ) (cond ((= (-> *game-info* current-continue level) 'finalboss) - (let ((v1-8 (-> obj entity extra perm))) + (let ((v1-8 (-> this entity extra perm))) (logior! (-> v1-8 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-8 user-int8 0) 1) ) - (set! (-> obj activated) #t) - (set! (-> obj path-pos) 0.0) + (set! (-> this activated) #t) + (set! (-> this path-pos) 0.0) ) (else - (set! (-> obj path-pos) 1.0) + (set! (-> this path-pos) 1.0) ) ) - (let ((s5-0 (-> obj root-override trans))) - (eval-path-curve! (-> obj path) s5-0 (-> obj path-pos) 'interp) - (vector+! s5-0 s5-0 (-> obj trans-off)) + (let ((s5-0 (-> this root-override trans))) + (eval-path-curve! (-> this path) s5-0 (-> this path-pos) 'interp) + (vector+! s5-0 s5-0 (-> this trans-off)) ) - (set! (-> obj rise-height) (-> obj root-override trans y)) - (set! (-> obj idle-height) (+ -286720.0 (-> obj rise-height))) - (if (-> obj activated) - (set! (-> obj root-override trans y) (-> obj rise-height)) - (set! (-> obj root-override trans y) (-> obj idle-height)) + (set! (-> this rise-height) (-> this root-override trans y)) + (set! (-> this idle-height) (+ -286720.0 (-> this rise-height))) + (if (-> this activated) + (set! (-> this root-override trans y) (-> this rise-height)) + (set! (-> this root-override trans y) (-> this idle-height)) ) - (set! (-> obj allow-auto-kill) #f) - (process-entity-status! obj (entity-perm-status bit-3) #t) + (set! (-> this allow-auto-kill) #f) + (process-entity-status! this (entity-perm-status bit-3) #t) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc index 4d997d0f8c..226fc8ecc6 100644 --- a/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/battlecontroller_REF.gc @@ -16,15 +16,15 @@ ) ;; definition for method 3 of type battlecontroller-spawner -(defmethod inspect battlecontroller-spawner ((obj battlecontroller-spawner)) - (format #t "[~8x] ~A~%" obj 'battlecontroller-spawner) - (format #t "~Tpath: ~A~%" (-> obj path)) - (format #t "~Tcreature: ~D~%" (-> obj creature)) - (format #t "~Ttrigger-actor: ~A~%" (-> obj trigger-actor)) - (format #t "~Tblocker-actor: ~A~%" (-> obj blocker-actor)) - (format #t "~Tstate: ~D~%" (-> obj state)) - (format #t "~Tenabled: ~A~%" (-> obj enabled)) - obj +(defmethod inspect battlecontroller-spawner ((this battlecontroller-spawner)) + (format #t "[~8x] ~A~%" this 'battlecontroller-spawner) + (format #t "~Tpath: ~A~%" (-> this path)) + (format #t "~Tcreature: ~D~%" (-> this creature)) + (format #t "~Ttrigger-actor: ~A~%" (-> this trigger-actor)) + (format #t "~Tblocker-actor: ~A~%" (-> this blocker-actor)) + (format #t "~Tstate: ~D~%" (-> this state)) + (format #t "~Tenabled: ~A~%" (-> this enabled)) + this ) ;; definition of type battlecontroller-creature-type @@ -43,15 +43,15 @@ ) ;; definition for method 3 of type battlecontroller-creature-type -(defmethod inspect battlecontroller-creature-type ((obj battlecontroller-creature-type)) - (format #t "[~8x] ~A~%" obj 'battlecontroller-creature-type) - (format #t "~Ttype2: ~A~%" (-> obj type2)) - (format #t "~Tpercent: ~f~%" (-> obj percent)) - (format #t "~Tpickup-percent: ~f~%" (-> obj pickup-percent)) - (format #t "~Tpickup-type: ~D~%" (-> obj pickup-type)) - (format #t "~Tmax-pickup-count: ~D~%" (-> obj max-pickup-count)) - (format #t "~Tpickup-count: ~D~%" (-> obj pickup-count)) - obj +(defmethod inspect battlecontroller-creature-type ((this battlecontroller-creature-type)) + (format #t "[~8x] ~A~%" this 'battlecontroller-creature-type) + (format #t "~Ttype2: ~A~%" (-> this type2)) + (format #t "~Tpercent: ~f~%" (-> this percent)) + (format #t "~Tpickup-percent: ~f~%" (-> this pickup-percent)) + (format #t "~Tpickup-type: ~D~%" (-> this pickup-type)) + (format #t "~Tmax-pickup-count: ~D~%" (-> this max-pickup-count)) + (format #t "~Tpickup-count: ~D~%" (-> this pickup-count)) + this ) ;; definition of type battlecontroller @@ -95,31 +95,31 @@ ) ;; definition for method 3 of type battlecontroller -(defmethod inspect battlecontroller ((obj battlecontroller)) +(defmethod inspect battlecontroller ((this battlecontroller)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tfinal-pickup-spawn-point: #~%" (-> obj final-pickup-spawn-point)) - (format #t "~T~Tactivate-distance: ~f~%" (-> obj activate-distance)) - (format #t "~T~Tmax-spawn-count: ~D~%" (-> obj max-spawn-count)) - (format #t "~T~Tspawn-count: ~D~%" (-> obj spawn-count)) - (format #t "~T~Tdie-count: ~D~%" (-> obj die-count)) - (format #t "~T~Ttarget-count: ~D~%" (-> obj target-count)) - (format #t "~T~Tspawner-count: ~D~%" (-> obj spawner-count)) - (format #t "~T~Tcreature-type-count: ~D~%" (-> obj creature-type-count)) - (format #t "~T~Tspawner-array[8] @ #x~X~%" (-> obj spawner-array)) - (format #t "~T~Tspawn-period: ~D~%" (-> obj spawn-period)) - (format #t "~T~Tpath-spawn: ~A~%" (-> obj path-spawn)) - (format #t "~T~Tcreature-type-array[4] @ #x~X~%" (-> obj creature-type-array)) - (format #t "~T~Tfinal-pickup-type: ~D~%" (-> obj final-pickup-type)) - (format #t "~T~Tprespawn: ~A~%" (-> obj prespawn)) - (format #t "~T~Tnoticed-player: ~A~%" (-> obj noticed-player)) - (format #t "~T~Tcamera-on: ~A~%" (-> obj camera-on)) - (format #t "~T~Tmisty-ambush-collision-hack: ~A~%" (-> obj misty-ambush-collision-hack)) - (format #t "~T~Tdisable-ocean: ~A~%" (-> obj disable-ocean)) - (format #t "~T~Tdisable-near-ocean: ~A~%" (-> obj disable-near-ocean)) - (format #t "~T~Tdisable-mid-ocean: ~A~%" (-> obj disable-mid-ocean)) - obj + (format #t "~T~Tfinal-pickup-spawn-point: #~%" (-> this final-pickup-spawn-point)) + (format #t "~T~Tactivate-distance: ~f~%" (-> this activate-distance)) + (format #t "~T~Tmax-spawn-count: ~D~%" (-> this max-spawn-count)) + (format #t "~T~Tspawn-count: ~D~%" (-> this spawn-count)) + (format #t "~T~Tdie-count: ~D~%" (-> this die-count)) + (format #t "~T~Ttarget-count: ~D~%" (-> this target-count)) + (format #t "~T~Tspawner-count: ~D~%" (-> this spawner-count)) + (format #t "~T~Tcreature-type-count: ~D~%" (-> this creature-type-count)) + (format #t "~T~Tspawner-array[8] @ #x~X~%" (-> this spawner-array)) + (format #t "~T~Tspawn-period: ~D~%" (-> this spawn-period)) + (format #t "~T~Tpath-spawn: ~A~%" (-> this path-spawn)) + (format #t "~T~Tcreature-type-array[4] @ #x~X~%" (-> this creature-type-array)) + (format #t "~T~Tfinal-pickup-type: ~D~%" (-> this final-pickup-type)) + (format #t "~T~Tprespawn: ~A~%" (-> this prespawn)) + (format #t "~T~Tnoticed-player: ~A~%" (-> this noticed-player)) + (format #t "~T~Tcamera-on: ~A~%" (-> this camera-on)) + (format #t "~T~Tmisty-ambush-collision-hack: ~A~%" (-> this misty-ambush-collision-hack)) + (format #t "~T~Tdisable-ocean: ~A~%" (-> this disable-ocean)) + (format #t "~T~Tdisable-near-ocean: ~A~%" (-> this disable-near-ocean)) + (format #t "~T~Tdisable-mid-ocean: ~A~%" (-> this disable-mid-ocean)) + this ) ;; definition for function battlecontroller-spawners-full? @@ -458,13 +458,13 @@ battlecontroller-default-event-handler 0 ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (-> self prespawn) (battlecontroller-fill-all-spawners) ) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (set-time! (-> self state-time)) (when (and *target* (>= (-> self activate-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) ) @@ -523,11 +523,11 @@ battlecontroller-default-event-handler (battlecontroller-update-spawners) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (battlecontroller-camera-on) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (set-time! (-> self state-time)) (let ((gp-0 0)) (let ((v1-8 (-> self child))) (while v1-8 @@ -541,8 +541,8 @@ battlecontroller-default-event-handler (go-virtual battlecontroller-die) ) (when (< gp-0 (-> self target-count)) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (-> self spawn-period)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (-> self spawn-period)) (suspend) ) ) @@ -665,33 +665,33 @@ battlecontroller-default-event-handler ;; definition for method 7 of type battlecontroller ;; INFO: Return type mismatch process-drawable vs battlecontroller. -(defmethod relocate battlecontroller ((obj battlecontroller) (arg0 int)) - (dotimes (v1-0 (-> obj spawner-count)) - (let ((a0-3 (-> obj spawner-array v1-0))) +(defmethod relocate battlecontroller ((this battlecontroller) (arg0 int)) + (dotimes (v1-0 (-> this spawner-count)) + (let ((a0-3 (-> this spawner-array v1-0))) (if (nonzero? (-> a0-3 path)) (&+! (-> a0-3 path) arg0) ) ) ) - (if (nonzero? (-> obj path-spawn)) - (&+! (-> obj path-spawn) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method battlecontroller 7)) this arg0) ) ) ;; definition for method 10 of type battlecontroller ;; INFO: Return type mismatch int vs none. -(defmethod deactivate battlecontroller ((obj battlecontroller)) +(defmethod deactivate battlecontroller ((this battlecontroller)) (with-pp (let ((gp-0 pp)) - (set! pp obj) + (set! pp this) (battlecontroller-off) (set! pp gp-0) ) - ((the-as (function process-drawable none) (find-parent-method battlecontroller 10)) obj) + ((the-as (function process-drawable none) (find-parent-method battlecontroller 10)) this) 0 (none) ) @@ -700,24 +700,24 @@ battlecontroller-default-event-handler ;; definition for method 27 of type battlecontroller ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod battlecontroller-method-27 battlecontroller ((obj battlecontroller)) +(defmethod battlecontroller-method-27 battlecontroller ((this battlecontroller)) (local-vars (sv-16 res-tag)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj activate-distance) 122880.0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this activate-distance) 122880.0) (let ((s5-0 0)) (let* ((s4-0 '(patha pathb pathc pathd pathe pathf pathg pathh)) (s2-0 (car s4-0)) ) (while (not (null? s4-0)) - (let ((v1-7 (res-lump-struct (-> obj entity) (the-as symbol s2-0) structure)) - (s3-0 (-> obj spawner-array s5-0)) + (let ((v1-7 (res-lump-struct (-> this entity) (the-as symbol s2-0) structure)) + (s3-0 (-> this spawner-array s5-0)) ) (when (and v1-7 (< s5-0 8)) - (set! (-> s3-0 path) (new 'process 'path-control obj (the-as symbol s2-0) 0.0)) + (set! (-> s3-0 path) (new 'process 'path-control this (the-as symbol s2-0) 0.0)) (set! (-> s3-0 creature) (the-as handle #f)) (set! (-> s3-0 trigger-actor) #f) (set! (-> s3-0 blocker-actor) #f) @@ -730,96 +730,96 @@ battlecontroller-default-event-handler (set! s2-0 (car s4-0)) ) ) - (set! (-> obj spawner-count) s5-0) + (set! (-> this spawner-count) s5-0) ) 0 - (if (res-lump-struct (-> obj entity) 'pathspawn structure) - (set! (-> obj path-spawn) (new 'process 'path-control obj 'pathspawn 0.0)) + (if (res-lump-struct (-> this entity) 'pathspawn structure) + (set! (-> this path-spawn) (new 'process 'path-control this 'pathspawn 0.0)) ) - (let ((s5-1 (entity-actor-count (-> obj entity) 'spawner-trigger-actor))) + (let ((s5-1 (entity-actor-count (-> this entity) 'spawner-trigger-actor))) (dotimes (s4-1 s5-1) - (if (< s4-1 (-> obj spawner-count)) - (set! (-> obj spawner-array s4-1 trigger-actor) - (entity-actor-lookup (-> obj entity) 'spawner-trigger-actor s4-1) + (if (< s4-1 (-> this spawner-count)) + (set! (-> this spawner-array s4-1 trigger-actor) + (entity-actor-lookup (-> this entity) 'spawner-trigger-actor s4-1) ) ) ) ) - (let ((s5-2 (entity-actor-count (-> obj entity) 'spawner-blocker-actor))) + (let ((s5-2 (entity-actor-count (-> this entity) 'spawner-blocker-actor))) (dotimes (s4-2 s5-2) - (if (< s4-2 (-> obj spawner-count)) - (set! (-> obj spawner-array s4-2 blocker-actor) - (entity-actor-lookup (-> obj entity) 'spawner-blocker-actor s4-2) + (if (< s4-2 (-> this spawner-count)) + (set! (-> this spawner-array s4-2 blocker-actor) + (entity-actor-lookup (-> this entity) 'spawner-blocker-actor s4-2) ) ) ) ) - (set! (-> obj spawn-period) - (the-as time-frame (the int (* 300.0 (res-lump-float (-> obj entity) 'delay :default 0.1)))) + (set! (-> this spawn-period) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'delay :default 0.1)))) ) - (set! (-> obj target-count) 10) - (set! (-> obj max-spawn-count) 100) - (set! (-> obj spawn-count) 0) - (set! (-> obj die-count) 0) - (set! (-> obj creature-type-count) 1) - (set! (-> obj noticed-player) #f) - (set! (-> obj camera-on) #f) - (let ((v1-46 (res-lump-data (-> obj entity) 'num-lurkers (pointer int32)))) + (set! (-> this target-count) 10) + (set! (-> this max-spawn-count) 100) + (set! (-> this spawn-count) 0) + (set! (-> this die-count) 0) + (set! (-> this creature-type-count) 1) + (set! (-> this noticed-player) #f) + (set! (-> this camera-on) #f) + (let ((v1-46 (res-lump-data (-> this entity) 'num-lurkers (pointer int32)))) (when v1-46 - (set! (-> obj target-count) (-> v1-46 0)) - (set! (-> obj max-spawn-count) (-> v1-46 1)) + (set! (-> this target-count) (-> v1-46 0)) + (set! (-> this max-spawn-count) (-> v1-46 1)) ) ) - (set! (-> obj creature-type-array 0 type2) babak) - (set! (-> obj creature-type-array 0 percent) 1.0) + (set! (-> this creature-type-array 0 type2) babak) + (set! (-> this creature-type-array 0 percent) 1.0) (let ((s5-3 0)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-49 (res-lump-data (-> obj entity) 'lurker-type pointer :tag-ptr (& sv-16)))) + (let ((v1-49 (res-lump-data (-> this entity) 'lurker-type pointer :tag-ptr (& sv-16)))) (when v1-49 (dotimes (a0-22 (the-as int (-> sv-16 elt-count))) (let ((a1-15 (-> (the-as (pointer uint32) (&+ v1-49 (* a0-22 4)))))) (when (nonzero? a1-15) - (set! (-> obj creature-type-array s5-3 type2) (the-as type a1-15)) + (set! (-> this creature-type-array s5-3 type2) (the-as type a1-15)) (+! s5-3 1) ) ) ) ) ) - (set! (-> obj creature-type-count) s5-3) + (set! (-> this creature-type-count) s5-3) ) - (let ((v1-52 (res-lump-data (-> obj entity) 'percent pointer)) + (let ((v1-52 (res-lump-data (-> this entity) 'percent pointer)) (f0-6 0.0) ) (when v1-52 - (dotimes (a0-26 (-> obj creature-type-count)) - (set! (-> obj creature-type-array a0-26 percent) (fabs (-> (the-as (pointer float) (&+ v1-52 (* a0-26 4)))))) - (+! f0-6 (-> obj creature-type-array a0-26 percent)) + (dotimes (a0-26 (-> this creature-type-count)) + (set! (-> this creature-type-array a0-26 percent) (fabs (-> (the-as (pointer float) (&+ v1-52 (* a0-26 4)))))) + (+! f0-6 (-> this creature-type-array a0-26 percent)) ) (cond ((= f0-6 0.0) - (set! (-> obj creature-type-count) 1) - (set! (-> obj creature-type-array 0 percent) 1.0) + (set! (-> this creature-type-count) 1) + (set! (-> this creature-type-array 0 percent) 1.0) ) (else (let ((f0-9 (/ 1.0 f0-6))) - (dotimes (v1-57 (-> obj creature-type-count)) - (set! (-> obj creature-type-array 0 percent) (* (-> obj creature-type-array 0 percent) f0-9)) + (dotimes (v1-57 (-> this creature-type-count)) + (set! (-> this creature-type-array 0 percent) (* (-> this creature-type-array 0 percent) f0-9)) ) ) ) ) ) ) - (set! (-> obj final-pickup-type) - (res-lump-value (-> obj entity) 'final-pickup pickup-type :default (the-as uint128 7)) + (set! (-> this final-pickup-type) + (res-lump-value (-> this entity) 'final-pickup pickup-type :default (the-as uint128 7)) ) - (let ((s5-4 (res-lump-data (-> obj entity) 'pickup-type pointer)) - (s4-3 (res-lump-data (-> obj entity) 'max-pickup-count pointer)) - (v1-63 (res-lump-data (-> obj entity) 'pickup-percent pointer)) + (let ((s5-4 (res-lump-data (-> this entity) 'pickup-type pointer)) + (s4-3 (res-lump-data (-> this entity) 'max-pickup-count pointer)) + (v1-63 (res-lump-data (-> this entity) 'pickup-percent pointer)) ) - (dotimes (a0-34 (-> obj creature-type-count)) - (let ((a1-34 (-> obj creature-type-array a0-34))) + (dotimes (a0-34 (-> this creature-type-count)) + (let ((a1-34 (-> this creature-type-array a0-34))) (set! (-> a1-34 pickup-count) 0) (if s5-4 (set! (-> a1-34 pickup-type) (the-as pickup-type (-> (the-as (pointer int32) (&+ s5-4 (* a0-34 4)))))) @@ -833,33 +833,33 @@ battlecontroller-default-event-handler ) ) ) - (set! (-> obj misty-ambush-collision-hack) #f) - (set! (-> obj disable-ocean) #f) - (set! (-> obj disable-mid-ocean) #f) - (set! (-> obj disable-near-ocean) #t) - (set! (-> obj final-pickup-spawn-point quad) (-> obj root trans quad)) - (set! (-> obj prespawn) (= (res-lump-value (-> obj entity) 'mode uint128) 1)) + (set! (-> this misty-ambush-collision-hack) #f) + (set! (-> this disable-ocean) #f) + (set! (-> this disable-mid-ocean) #f) + (set! (-> this disable-near-ocean) #t) + (set! (-> this final-pickup-spawn-point quad) (-> this root trans quad)) + (set! (-> this prespawn) (= (res-lump-value (-> this entity) 'mode uint128) 1)) 0 (none) ) ;; definition for method 28 of type battlecontroller ;; INFO: Return type mismatch int vs none. -(defmethod cleanup-if-finished! battlecontroller ((obj battlecontroller)) +(defmethod cleanup-if-finished! battlecontroller ((this battlecontroller)) (if (battlecontroller-task-completed?) - (go (method-of-object obj battlecontroller-die)) - (go (method-of-object obj battlecontroller-idle)) + (go (method-of-object this battlecontroller-die)) + (go (method-of-object this battlecontroller-idle)) ) 0 (none) ) ;; definition for method 11 of type battlecontroller -(defmethod init-from-entity! battlecontroller ((obj battlecontroller) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (battlecontroller-method-27 obj) - (cleanup-if-finished! obj) +(defmethod init-from-entity! battlecontroller ((this battlecontroller) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (battlecontroller-method-27 this) + (cleanup-if-finished! this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc b/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc index 58edc0f17d..56ccc7dd6e 100644 --- a/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/blocking-plane_REF.gc @@ -14,11 +14,11 @@ ) ;; definition for method 3 of type blocking-plane -(defmethod inspect blocking-plane ((obj blocking-plane)) +(defmethod inspect blocking-plane ((this blocking-plane)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc b/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc index 5792861923..2d71314bf8 100644 --- a/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc +++ b/test/decompiler/reference/jak1/levels/common/launcherdoor_REF.gc @@ -21,16 +21,16 @@ ) ;; definition for method 3 of type launcherdoor -(defmethod inspect launcherdoor ((obj launcherdoor)) +(defmethod inspect launcherdoor ((this launcherdoor)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tnotify-player-passed-thru?: ~A~%" (-> obj notify-player-passed-thru?)) - (format #t "~T~Tthresh-y: ~f~%" (-> obj thresh-y)) - (format #t "~T~Topen-speed: ~f~%" (-> obj open-speed)) - (format #t "~T~Tclose-speed: ~f~%" (-> obj close-speed)) - (format #t "~T~Tload-mode: ~A~%" (-> obj load-mode)) - obj + (format #t "~T~Tnotify-player-passed-thru?: ~A~%" (-> this notify-player-passed-thru?)) + (format #t "~T~Tthresh-y: ~f~%" (-> this thresh-y)) + (format #t "~T~Topen-speed: ~f~%" (-> this open-speed)) + (format #t "~T~Tclose-speed: ~f~%" (-> this close-speed)) + (format #t "~T~Tload-mode: ~A~%" (-> this load-mode)) + this ) ;; failed to figure out what this is: @@ -145,11 +145,11 @@ ;; definition for method 11 of type launcherdoor ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! launcherdoor ((obj launcherdoor) (arg0 entity-actor)) - (set! (-> obj notify-player-passed-thru?) #f) - (set! (-> obj open-speed) 4.0) - (set! (-> obj close-speed) 2.0) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! launcherdoor ((this launcherdoor) (arg0 entity-actor)) + (set! (-> this notify-player-passed-thru?) #f) + (set! (-> this open-speed) 4.0) + (set! (-> this close-speed) 2.0) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -161,37 +161,37 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (cond - ((= (-> (if (-> obj entity) - (-> obj entity extra level) + ((= (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name ) 'maincave ) - (set! (-> obj close-speed) 4.0) - (initialize-skeleton obj *launcherdoor-maincave-sg* '()) + (set! (-> this close-speed) 4.0) + (initialize-skeleton this *launcherdoor-maincave-sg* '()) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) ) (else - (initialize-skeleton obj *launcherdoor-sg* '()) + (initialize-skeleton this *launcherdoor-sg* '()) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) @@ -199,19 +199,19 @@ ) ) (transform-post) - (case (-> obj entity extra level name) + (case (-> this entity extra level name) (('jungle) - (set! (-> obj draw shadow-mask) (the-as uint 28)) + (set! (-> this draw shadow-mask) (the-as uint 28)) ) ) - (set! (-> obj load-mode) (-> (if (-> obj entity) - (-> obj entity extra level) - (-> *level* level-default) - ) - name - ) + (set! (-> this load-mode) (-> (if (-> this entity) + (-> this entity extra level) + (-> *level* level-default) + ) + name + ) ) - (set! (-> obj thresh-y) (+ -81920.0 (-> obj root-override trans y))) + (set! (-> this thresh-y) (+ -81920.0 (-> this root-override trans y))) (if (and *target* (= (-> *target* control unknown-surface00 name) 'launch-jump)) (go launcherdoor-open #t) (go launcherdoor-closed #t) diff --git a/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc b/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc index 3f1559b3f0..4b91bf8584 100644 --- a/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/darkcave/darkcave-obs_REF.gc @@ -35,26 +35,26 @@ ) ;; definition for method 3 of type cavecrystal -(defmethod inspect cavecrystal ((obj cavecrystal)) +(defmethod inspect cavecrystal ((this cavecrystal)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tis-master?: ~A~%" (-> obj is-master?)) - (format #t "~T~Tcrystal-id: ~D~%" (-> obj crystal-id)) - (format #t "~T~Tglow-u: ~f~%" (-> obj glow-u)) - (format #t "~T~Tglow-wf-period: ~D~%" (-> obj glow-wf-period)) - (format #t "~T~Tglow-wf-offset: ~D~%" (-> obj glow-wf-offset)) - (format #t "~T~Tprev-compute-glow-time: ~D~%" (-> obj prev-compute-glow-time)) - (format #t "~T~Tstart-fade-time: ~D~%" (-> obj start-fade-time)) - (format #t "~T~Tend-fade-time: ~D~%" (-> obj end-fade-time)) - (format #t "~T~Tactivated-time: ~D~%" (-> obj activated-time)) - (format #t "~T~Tlast-updated-user-lighting: ~D~%" (-> obj last-updated-user-lighting)) - (format #t "~T~Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - (format #t "~T~Ton-color-mult: #~%" (-> obj on-color-mult)) - (format #t "~T~Ton-color-emissive: #~%" (-> obj on-color-emissive)) - (format #t "~T~Toff-color-mult: #~%" (-> obj off-color-mult)) - (format #t "~T~Toff-color-emissive: #~%" (-> obj off-color-emissive)) - obj + (format #t "~T~Tis-master?: ~A~%" (-> this is-master?)) + (format #t "~T~Tcrystal-id: ~D~%" (-> this crystal-id)) + (format #t "~T~Tglow-u: ~f~%" (-> this glow-u)) + (format #t "~T~Tglow-wf-period: ~D~%" (-> this glow-wf-period)) + (format #t "~T~Tglow-wf-offset: ~D~%" (-> this glow-wf-offset)) + (format #t "~T~Tprev-compute-glow-time: ~D~%" (-> this prev-compute-glow-time)) + (format #t "~T~Tstart-fade-time: ~D~%" (-> this start-fade-time)) + (format #t "~T~Tend-fade-time: ~D~%" (-> this end-fade-time)) + (format #t "~T~Tactivated-time: ~D~%" (-> this activated-time)) + (format #t "~T~Tlast-updated-user-lighting: ~D~%" (-> this last-updated-user-lighting)) + (format #t "~T~Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + (format #t "~T~Ton-color-mult: #~%" (-> this on-color-mult)) + (format #t "~T~Ton-color-emissive: #~%" (-> this on-color-emissive)) + (format #t "~T~Toff-color-mult: #~%" (-> this off-color-mult)) + (format #t "~T~Toff-color-emissive: #~%" (-> this off-color-emissive)) + this ) ;; failed to figure out what this is: @@ -65,11 +65,11 @@ ;; definition for method 20 of type cavecrystal ;; INFO: Return type mismatch int vs none. -(defmethod update-connected-crystals! cavecrystal ((obj cavecrystal)) - (when (-> obj is-master?) - (let ((v1-2 (-> *display* base-frame-counter))) - (when (!= (-> obj last-updated-user-lighting) v1-2) - (set! (-> obj last-updated-user-lighting) v1-2) +(defmethod update-connected-crystals! cavecrystal ((this cavecrystal)) + (when (-> this is-master?) + (let ((v1-2 (current-time))) + (when (!= (-> this last-updated-user-lighting) v1-2) + (set! (-> this last-updated-user-lighting) v1-2) (execute-connections *cavecrystal-light-control*) ) ) @@ -78,14 +78,13 @@ ) ;; definition for method 21 of type cavecrystal -(defmethod compute-glow cavecrystal ((obj cavecrystal)) - (set! (-> obj prev-compute-glow-time) (-> *display* game-frame-counter)) - (let* ((gp-1 (max 1 (+ (- 1 (-> obj activated-time)) (-> *display* game-frame-counter)))) - (f0-2 - (/ (the float (mod (+ (-> *display* base-frame-counter) (-> obj glow-wf-offset)) (-> obj glow-wf-period))) - (the float (-> obj glow-wf-period)) - ) - ) +(defmethod compute-glow cavecrystal ((this cavecrystal)) + (set! (-> this prev-compute-glow-time) (-> *display* game-frame-counter)) + (let* ((gp-1 (max 1 (+ (- 1 (-> this activated-time)) (-> *display* game-frame-counter)))) + (f0-2 (/ (the float (mod (+ (current-time) (-> this glow-wf-offset)) (-> this glow-wf-period))) + (the float (-> this glow-wf-period)) + ) + ) (f30-1 (* 0.1 (cos (* 65536.0 f0-2)))) ) (cond @@ -99,11 +98,11 @@ (fmin 2.0 (+ (lerp 2.0 1.0 a2-0) f30-1)) ) ) - ((>= (-> obj start-fade-time) gp-1) + ((>= (-> this start-fade-time) gp-1) (+ 1.0 f30-1) ) (else - (let ((v1-20 (fmin 1.0 (* 0.004761905 (the float (- gp-1 (-> obj start-fade-time))))))) + (let ((v1-20 (fmin 1.0 (* 0.004761905 (the float (- gp-1 (-> this start-fade-time))))))) (fmax 0.0 (- (+ 1.0 (* (- 1.0 v1-20) f30-1)) v1-20)) ) ) @@ -204,26 +203,26 @@ ) ;; definition for method 10 of type cavecrystal -(defmethod deactivate cavecrystal ((obj cavecrystal)) - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) +(defmethod deactivate cavecrystal ((this cavecrystal)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 11 of type cavecrystal ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavecrystal ((obj cavecrystal) (arg0 entity-actor)) - (set! (-> obj glow-u) 0.0) - (set! (-> obj player-attack-id) (the-as uint 0)) - (set! (-> obj last-updated-user-lighting) 0) - (set-vector! (-> obj off-color-mult) 0.0 0.0 0.0 1.0) - (set-vector! (-> obj off-color-emissive) 0.0 0.0 0.0 0.0) - (set-vector! (-> obj on-color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj on-color-emissive) 0.0 0.0 0.0 0.0) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! cavecrystal ((this cavecrystal) (arg0 entity-actor)) + (set! (-> this glow-u) 0.0) + (set! (-> this player-attack-id) (the-as uint 0)) + (set! (-> this last-updated-user-lighting) 0) + (set-vector! (-> this off-color-mult) 0.0 0.0 0.0 1.0) + (set-vector! (-> this off-color-emissive) 0.0 0.0 0.0 0.0) + (set-vector! (-> this on-color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this on-color-emissive) 0.0 0.0 0.0 0.0) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -235,38 +234,38 @@ ) (set! (-> s4-0 nav-radius) 4915.2) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj crystal-id) (actor-count-before (-> obj link))) - (set! (-> obj is-master?) (= (-> obj crystal-id) 3)) - (set! (-> obj glow-wf-period) (rand-vu-int-range 225 375)) - (set! (-> obj glow-wf-offset) (rand-vu-int-range 0 300)) - (if (-> obj is-master?) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this crystal-id) (actor-count-before (-> this link))) + (set! (-> this is-master?) (= (-> this crystal-id) 3)) + (set! (-> this glow-wf-period) (rand-vu-int-range 225 375)) + (set! (-> this glow-wf-offset) (rand-vu-int-range 0 300)) + (if (-> this is-master?) + (logclear! (-> this mask) (process-mask actor-pause)) ) - (set! (-> obj start-fade-time) - (the-as time-frame (the int (* 300.0 (res-lump-float (-> obj entity) 'timeout :default 8.0)))) + (set! (-> this start-fade-time) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'timeout :default 8.0)))) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *cavecrystal-sg* '()) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj draw color-mult quad) (-> obj off-color-mult quad)) - (set! (-> obj draw color-emissive quad) (-> obj off-color-emissive quad)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *cavecrystal-sg* '()) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this draw color-mult quad) (-> this off-color-mult quad)) + (set! (-> this draw color-emissive quad) (-> this off-color-emissive quad)) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (cavecrystal-light-control-method-9 *cavecrystal-light-control* (-> obj crystal-id) 0.0 obj) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "crystal-on" :fo-max 80) (-> obj root-override trans)) + (update-transforms! (-> this root-override)) + (cavecrystal-light-control-method-9 *cavecrystal-light-control* (-> this crystal-id) 0.0 this) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "crystal-on" :fo-max 80) (-> this root-override trans)) ) (go cavecrystal-idle) (none) diff --git a/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc b/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc index ecfc253eff..debbe097fd 100644 --- a/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc +++ b/test/decompiler/reference/jak1/levels/demo/static-screen_REF.gc @@ -16,42 +16,42 @@ ) ;; definition for method 3 of type static-screen -(defmethod inspect static-screen ((obj static-screen)) +(defmethod inspect static-screen ((this static-screen)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpart[1] @ #x~X~%" (-> obj stack)) - (format #t "~T~Tstate-time: ~D~%" (-> obj state-time)) - obj + (format #t "~T~Tpart[1] @ #x~X~%" (-> this stack)) + (format #t "~T~Tstate-time: ~D~%" (-> this state-time)) + this ) ;; definition for method 7 of type static-screen ;; INFO: Return type mismatch process vs static-screen. -(defmethod relocate static-screen ((obj static-screen) (arg0 int)) +(defmethod relocate static-screen ((this static-screen) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) (dotimes (v1-2 1) - (if (nonzero? (-> obj part v1-2)) - (&+! (-> obj part v1-2) arg0) + (if (nonzero? (-> this part v1-2)) + (&+! (-> this part v1-2) arg0) ) ) - (the-as static-screen ((method-of-type process relocate) obj arg0)) + (the-as static-screen ((method-of-type process relocate) this arg0)) ) ;; definition for method 10 of type static-screen -(defmethod deactivate static-screen ((obj static-screen)) +(defmethod deactivate static-screen ((this static-screen)) (dotimes (s5-0 1) - (if (nonzero? (-> obj part s5-0)) - (kill-and-free-particles (-> obj part s5-0)) + (if (nonzero? (-> this part s5-0)) + (kill-and-free-particles (-> this part s5-0)) ) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -126,12 +126,12 @@ ) :code (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol)) (local-vars (v1-6 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (until v1-6 (suspend) - (set! v1-6 (or (and (> arg1 0) (>= (- (-> *display* base-frame-counter) (-> self state-time)) arg1)) + (set! v1-6 (or (and (> arg1 0) (time-elapsed? (-> self state-time) arg1)) (and arg2 - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (time-elapsed? (-> self state-time) (seconds 1)) (cpad-pressed? 0 select start triangle circle x square) ) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc index 38bcb00439..3b833fed23 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/final-door_REF.gc @@ -10,35 +10,35 @@ ) ;; definition for method 3 of type fin-door -(defmethod inspect fin-door ((obj fin-door)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect fin-door ((this fin-door)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; definition of type final-door @@ -56,11 +56,11 @@ ) ;; definition for method 3 of type final-door -(defmethod inspect final-door ((obj final-door)) +(defmethod inspect final-door ((this final-door)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -148,8 +148,8 @@ ;; definition for method 11 of type final-door ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! final-door ((obj final-door) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! final-door ((this final-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -166,11 +166,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (final-door-method-21 obj) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (final-door-method-21 this) + (go (method-of-object this idle)) (none) ) @@ -184,11 +184,11 @@ ) ;; definition for method 3 of type power-left -(defmethod inspect power-left ((obj power-left)) +(defmethod inspect power-left ((this power-left)) (let ((t9-0 (method-of-type final-door inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type power-right @@ -201,11 +201,11 @@ ) ;; definition for method 3 of type power-right -(defmethod inspect power-right ((obj power-right)) +(defmethod inspect power-right ((this power-right)) (let ((t9-0 (method-of-type final-door inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -238,16 +238,16 @@ ;; definition for method 21 of type power-left ;; INFO: Return type mismatch int vs none. -(defmethod final-door-method-21 power-left ((obj power-left)) - (initialize-skeleton obj *power-left-sg* '()) +(defmethod final-door-method-21 power-left ((this power-left)) + (initialize-skeleton this *power-left-sg* '()) 0 (none) ) ;; definition for method 21 of type power-right ;; INFO: Return type mismatch int vs none. -(defmethod final-door-method-21 power-right ((obj power-right)) - (initialize-skeleton obj *power-right-sg* '()) +(defmethod final-door-method-21 power-right ((this power-right)) + (initialize-skeleton this *power-right-sg* '()) 0 (none) ) @@ -271,14 +271,14 @@ ) ;; definition for method 3 of type powercellalt -(defmethod inspect powercellalt ((obj powercellalt)) +(defmethod inspect powercellalt ((this powercellalt)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tjump-pos: ~`vector`P~%" (-> obj jump-pos)) - (format #t "~T~Tbase: ~`vector`P~%" (-> obj base)) - (format #t "~T~Tindex: ~D~%" (-> obj index)) - obj + (format #t "~T~Tjump-pos: ~`vector`P~%" (-> this jump-pos)) + (format #t "~T~Tbase: ~`vector`P~%" (-> this base)) + (format #t "~T~Tindex: ~D~%" (-> this index)) + this ) ;; failed to figure out what this is: @@ -289,9 +289,9 @@ (let ((gp-1 (new 'stack 'trajectory))) (set! (-> self base y) (-> self jump-pos y)) (setup-from-to-duration! gp-1 (-> self root-override trans) (-> self jump-pos) 300.0 -2.2755556) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - (let ((f0-2 (the float (- (-> *display* base-frame-counter) (-> self state-time))))) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) + (let ((f0-2 (the float (- (current-time) (-> self state-time))))) (eval-position! gp-1 f0-2 (-> self root-override trans)) ) (transform-post) @@ -426,8 +426,8 @@ ) ) ) - (let ((s1-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s1-1) (seconds 0.1)) + (let ((s1-1 (current-time))) + (until (time-elapsed? s1-1 (seconds 0.1)) (suspend) ) ) @@ -448,15 +448,15 @@ ) ) ) - (let ((s1-3 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s1-3) (seconds 0.1)) + (let ((s1-3 (current-time))) + (until (time-elapsed? s1-3 (seconds 0.1)) (suspend) ) ) ) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 2)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc index ae9b746200..a42701faea 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/green-eco-lurker_REF.gc @@ -24,15 +24,15 @@ ) ;; definition for method 3 of type green-eco-lurker -(defmethod inspect green-eco-lurker ((obj green-eco-lurker)) +(defmethod inspect green-eco-lurker ((this green-eco-lurker)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tplayed-sound?: ~A~%" (-> obj played-sound?)) - (format #t "~T~Tsound-delay: ~D~%" (-> obj sound-delay)) - (format #t "~T~Tappear-dest: #~%" (-> obj appear-dest)) - (format #t "~T~Ttraj: #~%" (-> obj traj)) - obj + (format #t "~T~Tplayed-sound?: ~A~%" (-> this played-sound?)) + (format #t "~T~Tsound-delay: ~D~%" (-> this sound-delay)) + (format #t "~T~Tappear-dest: #~%" (-> this appear-dest)) + (format #t "~T~Ttraj: #~%" (-> this traj)) + this ) ;; definition of type green-eco-lurker-gen @@ -51,14 +51,14 @@ ) ;; definition for method 3 of type green-eco-lurker-gen -(defmethod inspect green-eco-lurker-gen ((obj green-eco-lurker-gen)) +(defmethod inspect green-eco-lurker-gen ((this green-eco-lurker-gen)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tnum-to-spawn: ~D~%" (-> obj num-to-spawn)) - (format #t "~T~Tnum-spawned: ~D~%" (-> obj num-spawned)) - (format #t "~T~Tnum-alive: ~D~%" (-> obj num-alive)) - obj + (format #t "~T~Tnum-to-spawn: ~D~%" (-> this num-to-spawn)) + (format #t "~T~Tnum-spawned: ~D~%" (-> this num-spawned)) + (format #t "~T~Tnum-alive: ~D~%" (-> this num-alive)) + this ) ;; failed to figure out what this is: @@ -323,75 +323,75 @@ ) ;; definition for method 43 of type green-eco-lurker -(defmethod attack-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (cond ((= (-> arg0 type) target) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) + (send-event (ppointer->process (-> this parent)) 'blob-hit-jak) ) #f ) (else (nav-enemy-set-hit-from-direction arg0) - ((method-of-type nav-enemy attack-handler) obj arg0 arg1) + ((method-of-type nav-enemy attack-handler) this arg0 arg1) ) ) ) ;; definition for method 73 of type green-eco-lurker -(defmethod nav-enemy-attack-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod nav-enemy-attack-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) (cond ((= (-> arg0 type) target) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) + (send-event (ppointer->process (-> this parent)) 'blob-hit-jak) ) #f ) (else - ((method-of-type nav-enemy nav-enemy-attack-handler) obj arg0 arg1) + ((method-of-type nav-enemy nav-enemy-attack-handler) this arg0 arg1) ) ) ) ;; definition for method 44 of type green-eco-lurker -(defmethod touch-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod touch-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) + (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) + (send-event (ppointer->process (-> this parent)) 'blob-hit-jak) ) ) ) ;; definition for method 72 of type green-eco-lurker -(defmethod nav-enemy-touch-handler green-eco-lurker ((obj green-eco-lurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod nav-enemy-touch-handler green-eco-lurker ((this green-eco-lurker) (arg0 process) (arg1 event-message-block)) + (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (send-event (ppointer->process (-> obj parent)) 'blob-hit-jak) + (send-event (ppointer->process (-> this parent)) 'blob-hit-jak) ) ) ) ;; definition for method 51 of type green-eco-lurker ;; INFO: Used lq/sq -(defmethod green-eco-lurker-method-51 green-eco-lurker ((obj green-eco-lurker) (arg0 vector)) +(defmethod green-eco-lurker-method-51 green-eco-lurker ((this green-eco-lurker) (arg0 vector)) (when (or (not *target*) (>= (vector-vector-xz-distance arg0 (target-pos 0)) 36864.0)) (let ((v1-3 (new 'stack-no-clear 'vector))) (set! (-> v1-3 quad) (-> arg0 quad)) - (set! (-> v1-3 w) (-> obj collide-info root-prim local-sphere w)) + (set! (-> v1-3 w) (-> this collide-info root-prim local-sphere w)) ) - (if (not (nav-enemy-method-50 obj arg0)) + (if (not (nav-enemy-method-50 this arg0)) (return #t) ) ) @@ -399,15 +399,15 @@ ) ;; definition for method 52 of type green-eco-lurker -(defmethod nav-enemy-method-52 green-eco-lurker ((obj green-eco-lurker) (arg0 vector)) - (let ((s4-0 (-> obj path curve num-cverts))) +(defmethod nav-enemy-method-52 green-eco-lurker ((this green-eco-lurker) (arg0 vector)) + (let ((s4-0 (-> this path curve num-cverts))) (when (> s4-0 0) (let ((s2-0 (nav-enemy-rnd-int-count s4-0)) (s3-0 s4-0) ) (while (> s3-0 0) - (eval-path-curve-div! (-> obj path) arg0 (the float s2-0) 'interp) - (if (green-eco-lurker-method-51 obj arg0) + (eval-path-curve-div! (-> this path) arg0 (the float s2-0) 'interp) + (if (green-eco-lurker-method-51 this arg0) (return #t) ) (set! s2-0 (mod (+ s2-0 1) s4-0)) @@ -455,14 +455,14 @@ ;; definition for method 53 of type green-eco-lurker ;; INFO: Return type mismatch int vs symbol. -(defmethod nav-enemy-method-53 green-eco-lurker ((obj green-eco-lurker)) +(defmethod nav-enemy-method-53 green-eco-lurker ((this green-eco-lurker)) (the-as symbol (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((f0-0 (-> obj appear-dest y)) - (v1-7 (-> obj draw shadow-ctrl)) + (let ((f0-0 (-> this appear-dest y)) + (v1-7 (-> this draw shadow-ctrl)) ) (let ((a0-1 v1-7)) (logclear! (-> a0-1 settings flags) (shadow-flags disable-draw)) @@ -477,7 +477,7 @@ 0 ) (else - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logior! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 @@ -489,7 +489,7 @@ ;; failed to figure out what this is: (defstate green-eco-lurker-appear (green-eco-lurker) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self played-sound?) #f) (set! (-> self sound-delay) (nav-enemy-rnd-int-range 30 150)) (let ((f0-1 (- (-> self appear-dest x) (-> (the-as green-eco-lurker-gen (-> self parent 0)) root trans x)))) @@ -524,7 +524,7 @@ ) ) :trans (behavior () - (let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self traj time)))) + (let ((f30-0 (fmin (the float (- (current-time) (-> self state-time))) (-> self traj time)))) (eval-position! (-> self traj) f30-0 (-> self collide-info trans)) (when (= f30-0 (-> self traj time)) (logior! (-> self collide-info nav-flags) (nav-flags navf0)) @@ -532,9 +532,7 @@ (go green-eco-lurker-appear-land) ) ) - (when (and (not (-> self played-sound?)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self sound-delay)) - ) + (when (and (not (-> self played-sound?)) (time-elapsed? (-> self state-time) (-> self sound-delay))) (set! (-> self played-sound?) #t) (sound-play "blob-jump" :pitch (nav-enemy-rnd-float-range -0.5 0.5)) ) @@ -697,8 +695,8 @@ ;; definition for method 47 of type green-eco-lurker ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision green-eco-lurker ((obj green-eco-lurker)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision green-eco-lurker ((this green-eco-lurker)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -771,7 +769,7 @@ (set! (-> s5-0 nav-radius) 8192.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -779,15 +777,15 @@ ;; definition for method 48 of type green-eco-lurker ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 green-eco-lurker ((obj green-eco-lurker)) - (initialize-skeleton obj *green-eco-lurker-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) - (init-defaults! obj *green-eco-lurker-nav-enemy-info*) - (logior! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf02)) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 green-eco-lurker ((this green-eco-lurker)) + (initialize-skeleton this *green-eco-lurker-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (logclear! (-> this collide-info nav-flags) (nav-flags navf0)) + (init-defaults! this *green-eco-lurker-nav-enemy-info*) + (logior! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf02)) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) @@ -824,8 +822,8 @@ (while (< (-> self num-spawned) (-> self num-to-spawn)) (when (< (-> self num-alive) 3) (when (nonzero? (-> self num-spawned)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc index f296adf82b..06ad391548 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/light-eco_REF.gc @@ -29,18 +29,18 @@ ) ;; definition for method 3 of type light-eco-child -(defmethod inspect light-eco-child ((obj light-eco-child)) +(defmethod inspect light-eco-child ((this light-eco-child)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tangle-bit: ~D~%" (-> obj angle-bit)) - (format #t "~T~Tground-y: ~f~%" (-> obj ground-y)) - (format #t "~T~Tfalling-start-time: ~D~%" (-> obj falling-start-time)) - (format #t "~T~Tlast-update-time: ~D~%" (-> obj last-update-time)) - (format #t "~T~Trot: #~%" (-> obj rot)) - (format #t "~T~Trotv: #~%" (-> obj rotv)) - (format #t "~T~Ttraj: #~%" (-> obj traj)) - obj + (format #t "~T~Tangle-bit: ~D~%" (-> this angle-bit)) + (format #t "~T~Tground-y: ~f~%" (-> this ground-y)) + (format #t "~T~Tfalling-start-time: ~D~%" (-> this falling-start-time)) + (format #t "~T~Tlast-update-time: ~D~%" (-> this last-update-time)) + (format #t "~T~Trot: #~%" (-> this rot)) + (format #t "~T~Trotv: #~%" (-> this rotv)) + (format #t "~T~Ttraj: #~%" (-> this traj)) + this ) ;; definition of type light-eco-mother @@ -68,17 +68,17 @@ ) ;; definition for method 3 of type light-eco-mother -(defmethod inspect light-eco-mother ((obj light-eco-mother)) +(defmethod inspect light-eco-mother ((this light-eco-mother)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tplayer-got-eco?: ~A~%" (-> obj player-got-eco?)) - (format #t "~T~Tangle-mask: ~D~%" (-> obj angle-mask)) - (format #t "~T~Tdelay-til-spawn: ~D~%" (-> obj delay-til-spawn)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tlast-update-time: ~D~%" (-> obj last-update-time)) - (format #t "~T~Tlast-spawned-time: ~D~%" (-> obj last-spawned-time)) - obj + (format #t "~T~Tplayer-got-eco?: ~A~%" (-> this player-got-eco?)) + (format #t "~T~Tangle-mask: ~D~%" (-> this angle-mask)) + (format #t "~T~Tdelay-til-spawn: ~D~%" (-> this delay-til-spawn)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tlast-update-time: ~D~%" (-> this last-update-time)) + (format #t "~T~Tlast-spawned-time: ~D~%" (-> this last-spawned-time)) + this ) ;; failed to figure out what this is: @@ -406,21 +406,21 @@ ;; definition for method 20 of type light-eco-child ;; INFO: Return type mismatch object vs none. -(defmethod common-trans light-eco-child ((obj light-eco-child)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-update-time)) - (set! (-> obj last-update-time) v1-1) +(defmethod common-trans light-eco-child ((this light-eco-child)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-update-time)) + (set! (-> this last-update-time) v1-1) (let* ((s5-0 (new 'stack-no-clear 'vector)) - (s4-0 (-> obj rot)) + (s4-0 (-> this rot)) (f30-0 (-> s4-0 w)) ) - (vector-v++! s4-0 (-> obj rotv)) - (set! (-> s4-0 w) (+ f30-0 (* (-> obj rotv w) (-> *display* seconds-per-frame)))) + (vector-v++! s4-0 (-> this rotv)) + (set! (-> s4-0 w) (+ f30-0 (* (-> this rotv w) (seconds-per-frame)))) (set-vector! s5-0 (cos (-> s4-0 x)) (cos (-> s4-0 y)) (cos (-> s4-0 z)) 1.0) (vector-normalize! s5-0 1.0) - (quaternion-vector-angle! (-> obj root-override quat) s5-0 f30-0) + (quaternion-vector-angle! (-> this root-override quat) s5-0 f30-0) ) - (spawn (-> obj part) (-> obj root-override trans)) + (spawn (-> this part) (-> this root-override trans)) ) ) (none) @@ -430,13 +430,10 @@ (defstate light-eco-child-appear (light-eco-child) :event light-eco-child-default-event-handler :enter (behavior () - (set! (-> self falling-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self falling-start-time)) ) :trans (behavior () - (let ((f30-0 - (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) - ) - ) + (let ((f30-0 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) (eval-position! (-> self traj) f30-0 (-> self root-override trans)) (if (= f30-0 (-> self traj time)) (go light-eco-child-hit-ground) @@ -457,10 +454,10 @@ (defstate light-eco-child-hit-ground (light-eco-child) :event light-eco-child-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (-> *display* seconds-per-frame))))) + (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (seconds-per-frame))))) (when (and (< f30-0 0.0) (>= (-> self ground-y) (-> self root-override trans y))) (if (>= 4096.0 (fabs f30-0)) (go light-eco-child-idle) @@ -504,10 +501,10 @@ (defstate light-eco-child-idle (light-eco-child) :event light-eco-child-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (if (time-elapsed? (-> self state-time) (seconds 4)) (go light-eco-child-die) ) (common-trans self) @@ -527,8 +524,8 @@ (send-event (ppointer->process (-> self parent)) 'untrigger (-> self angle-bit)) (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.1)) (suspend) ) ) @@ -599,40 +596,36 @@ ;; definition for method 21 of type light-eco-mother ;; INFO: Return type mismatch int vs none. -(defmethod common-trans light-eco-mother ((obj light-eco-mother)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-update-time)) - (set! (-> obj last-update-time) v1-1) +(defmethod common-trans light-eco-mother ((this light-eco-mother)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-update-time)) + (set! (-> this last-update-time) v1-1) (let ((s5-0 (new 'stack-no-clear 'vector))) (set-vector! s5-0 - (cos (* 25.700392 (the float (mod (-> *display* base-frame-counter) 2550)))) - (cos (* 24.59229 (the float (mod (-> *display* base-frame-counter) 2664)))) - (cos (* 26.121408 (the float (mod (-> *display* base-frame-counter) 2508)))) + (cos (* 25.700392 (the float (mod (current-time) 2550)))) + (cos (* 24.59229 (the float (mod (current-time) 2664)))) + (cos (* 26.121408 (the float (mod (current-time) 2508)))) 1.0 ) (vector-normalize! s5-0 1.0) - (quaternion-vector-angle! - (-> obj root quat) - s5-0 - (* 48.860058 (the float (mod (-> *display* base-frame-counter) 1341))) - ) + (quaternion-vector-angle! (-> this root quat) s5-0 (* 48.860058 (the float (mod (current-time) 1341)))) ) (cond ((and *target* (logtest? (-> *target* state-flags) (state-flags grabbed))) - (set! (-> obj last-spawned-time) (-> *display* base-frame-counter)) - (set! (-> obj delay-til-spawn) 2400) + (set-time! (-> this last-spawned-time)) + (set! (-> this delay-til-spawn) 2400) ) (else - (when (>= (- (-> *display* base-frame-counter) (-> obj last-spawned-time)) (-> obj delay-til-spawn)) - (when (spawn-child-eco obj) - (set! (-> obj last-spawned-time) (-> *display* base-frame-counter)) - (set! (-> obj delay-til-spawn) (rand-vu-int-range 300 600)) + (when (time-elapsed? (-> this last-spawned-time) (-> this delay-til-spawn)) + (when (spawn-child-eco this) + (set-time! (-> this last-spawned-time)) + (set! (-> this delay-til-spawn) (rand-vu-int-range 300 600)) ) ) ) ) - (update! (-> obj sound)) + (update! (-> this sound)) 0 ) ) @@ -640,20 +633,20 @@ ) ;; definition for method 20 of type light-eco-mother -(defmethod spawn-child-eco light-eco-mother ((obj light-eco-mother)) +(defmethod spawn-child-eco light-eco-mother ((this light-eco-mother)) (countdown (s3-0 4) (let ((gp-0 (rand-vu-int-count 32))) - (when (not (logtest? (-> obj angle-mask) (ash 1 gp-0))) + (when (not (logtest? (-> this angle-mask) (ash 1 gp-0))) (let ((f28-0 (* 2048.0 (the float gp-0))) (f30-0 (rand-vu-float-range 61440.0 88514.56)) (s4-0 (new 'stack-no-clear 'vector)) ) (set-vector! s4-0 (* (sin f28-0) f30-0) 0.0 (* (cos f28-0) f30-0) 1.0) - (vector+! s4-0 s4-0 (-> obj root trans)) + (vector+! s4-0 s4-0 (-> this root trans)) (set! (-> s4-0 y) 1974272.0) (when (or (not *target*) (>= (vector-vector-xz-distance s4-0 (target-pos 0)) 49152.0)) - (logior! (-> obj angle-mask) (ash 1 gp-0)) - (process-spawn light-eco-child (-> obj entity) (-> obj root trans) s4-0 gp-0 :to obj) + (logior! (-> this angle-mask) (ash 1 gp-0)) + (process-spawn light-eco-child (-> this entity) (-> this root trans) s4-0 gp-0 :to this) (return #t) ) ) @@ -702,7 +695,7 @@ ) :code (behavior () (while (!= (-> self root scale x) 12.0) - (let ((f0-3 (seek-with-smooth (-> self root scale x) 12.0 (* 6.0 (-> *display* seconds-per-frame)) 0.25 0.001))) + (let ((f0-3 (seek-with-smooth (-> self root scale x) 12.0 (* 6.0 (seconds-per-frame)) 0.25 0.001))) (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) (suspend) @@ -738,7 +731,7 @@ ) :code (behavior () (while (!= (-> self root scale x) 0.0) - (let ((f0-3 (seek-with-smooth (-> self root scale x) 0.0 (* 12.0 (-> *display* seconds-per-frame)) 0.5 0.001))) + (let ((f0-3 (seek-with-smooth (-> self root scale x) 0.0 (* 12.0 (seconds-per-frame)) 0.5 0.001))) (set-vector! (-> self root scale) f0-3 f0-3 f0-3 1.0) ) (suspend) @@ -753,21 +746,21 @@ ) ;; definition for method 10 of type light-eco-mother -(defmethod deactivate light-eco-mother ((obj light-eco-mother)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate light-eco-mother ((this light-eco-mother)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type projectile deactivate) (the-as projectile obj)) + ((method-of-type projectile deactivate) (the-as projectile this)) (none) ) ;; definition for method 7 of type light-eco-mother ;; INFO: Return type mismatch projectile vs light-eco-mother. -(defmethod relocate light-eco-mother ((obj light-eco-mother) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate light-eco-mother ((this light-eco-mother) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as light-eco-mother ((method-of-type projectile relocate) (the-as projectile obj) arg0)) + (the-as light-eco-mother ((method-of-type projectile relocate) (the-as projectile this) arg0)) ) ;; definition for function light-eco-mother-init-by-other @@ -776,7 +769,7 @@ (defbehavior light-eco-mother-init-by-other light-eco-mother ((arg0 entity-actor) (arg1 vector)) (set! (-> self entity) arg0) (set! (-> self last-update-time) 0) - (set! (-> self last-spawned-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-spawned-time)) (set! (-> self delay-til-spawn) 2400) (set! (-> self angle-mask) 0) (set! (-> self player-got-eco?) #f) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-h_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-h_REF.gc index a53e3c63a4..df9b99ac63 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-h_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-h_REF.gc @@ -22,21 +22,21 @@ ) ;; definition for method 3 of type robotboss-dda -(defmethod inspect robotboss-dda ((obj robotboss-dda)) - (format #t "[~8x] ~A~%" obj 'robotboss-dda) - (format #t "~Tblue-bomb-time: ~f~%" (-> obj blue-bomb-time)) - (format #t "~Tnum-blobs: ~D~%" (-> obj num-blobs)) - (format #t "~Tgreen-bomb-time: ~f~%" (-> obj green-bomb-time)) - (format #t "~Tred-shots-min: ~D~%" (-> obj red-shots-min)) - (format #t "~Tred-shots-rnd: ~D~%" (-> obj red-shots-rnd)) - (format #t "~Tred-shot-time-min: ~f~%" (-> obj red-shot-time-min)) - (format #t "~Tred-shot-time-rnd: ~f~%" (-> obj red-shot-time-rnd)) - (format #t "~Tred-bomb-time: ~f~%" (-> obj red-bomb-time)) - (format #t "~Tyellow-shot-time-min: ~f~%" (-> obj yellow-shot-time-min)) - (format #t "~Tyellow-shot-time-rnd: ~f~%" (-> obj yellow-shot-time-rnd)) - (format #t "~Tyellow-gun-hits: ~D~%" (-> obj yellow-gun-hits)) - (format #t "~Tyellow-bomb-time: ~f~%" (-> obj yellow-bomb-time)) - obj +(defmethod inspect robotboss-dda ((this robotboss-dda)) + (format #t "[~8x] ~A~%" this 'robotboss-dda) + (format #t "~Tblue-bomb-time: ~f~%" (-> this blue-bomb-time)) + (format #t "~Tnum-blobs: ~D~%" (-> this num-blobs)) + (format #t "~Tgreen-bomb-time: ~f~%" (-> this green-bomb-time)) + (format #t "~Tred-shots-min: ~D~%" (-> this red-shots-min)) + (format #t "~Tred-shots-rnd: ~D~%" (-> this red-shots-rnd)) + (format #t "~Tred-shot-time-min: ~f~%" (-> this red-shot-time-min)) + (format #t "~Tred-shot-time-rnd: ~f~%" (-> this red-shot-time-rnd)) + (format #t "~Tred-bomb-time: ~f~%" (-> this red-bomb-time)) + (format #t "~Tyellow-shot-time-min: ~f~%" (-> this yellow-shot-time-min)) + (format #t "~Tyellow-shot-time-rnd: ~f~%" (-> this yellow-shot-time-rnd)) + (format #t "~Tyellow-gun-hits: ~D~%" (-> this yellow-gun-hits)) + (format #t "~Tyellow-bomb-time: ~f~%" (-> this yellow-bomb-time)) + this ) ;; definition of type robotboss @@ -101,78 +101,78 @@ ) ;; definition for method 3 of type robotboss -(defmethod inspect robotboss ((obj robotboss)) +(defmethod inspect robotboss ((this robotboss)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Talts[13] @ #x~X~%" (-> obj alts)) - (format #t "~T~Tdesired-loc: #~%" (-> obj desired-loc)) - (format #t "~T~Told-loc: #~%" (-> obj old-loc)) - (format #t "~T~Tloc-t: ~f~%" (-> obj loc-t)) - (format #t "~T~Tloc-t-start: ~D~%" (-> obj loc-t-start)) - (format #t "~T~Tloc-t-duration: ~D~%" (-> obj loc-t-duration)) - (format #t "~T~Thits-to-go: ~D~%" (-> obj hits-to-go)) - (format #t "~T~Ttook-hit: ~A~%" (-> obj took-hit)) - (format #t "~T~Tchildren-spawned: ~D~%" (-> obj children-spawned)) - (format #t "~T~Tvulnerable: ~D~%" (-> obj vulnerable)) - (format #t "~T~Ttill-next-shot: ~D~%" (-> obj till-next-shot)) - (format #t "~T~Tshot-attractor: ~D~%" (-> obj shot-attractor)) - (format #t "~T~Tdesired-pool-y: ~f~%" (-> obj desired-pool-y)) - (format #t "~T~Tparticle[7] @ #x~X~%" (-> obj particle)) - (format #t "~T~Tblue-smoke: ~A~%" (-> obj blue-smoke)) - (format #t "~T~Tred-smoke: ~A~%" (-> obj red-smoke)) - (format #t "~T~Tyellow-smoke: ~A~%" (-> obj yellow-smoke)) - (format #t "~T~Twhite-eco: ~D~%" (-> obj white-eco)) - (format #t "~T~Tdes-cam-entity: ~A~%" (-> obj des-cam-entity)) - (format #t "~T~Tuse-interesting: ~A~%" (-> obj use-interesting)) - (format #t "~T~Tignore-camera: ~A~%" (-> obj ignore-camera)) - (format #t "~T~Tambient: #~%" (-> obj ambient)) - (format #t "~T~Tyellow-gun: ~A~%" (-> obj yellow-gun)) - (format #t "~T~Tpalette-val: ~f~%" (-> obj palette-val)) - (format #t "~T~Tlooping-sound[4] @ #x~X~%" (-> obj looping-sound)) - (format #t "~T~Tdda: #~%" (-> obj dda)) - (format #t "~T~Tvalid-frames: ~D~%" (-> obj valid-frames)) - (format #t "~T~Tskip-cut: ~A~%" (-> obj skip-cut)) - (format #t "~T~Tkeep-charging: ~A~%" (-> obj keep-charging)) - obj + (format #t "~T~Talts[13] @ #x~X~%" (-> this alts)) + (format #t "~T~Tdesired-loc: #~%" (-> this desired-loc)) + (format #t "~T~Told-loc: #~%" (-> this old-loc)) + (format #t "~T~Tloc-t: ~f~%" (-> this loc-t)) + (format #t "~T~Tloc-t-start: ~D~%" (-> this loc-t-start)) + (format #t "~T~Tloc-t-duration: ~D~%" (-> this loc-t-duration)) + (format #t "~T~Thits-to-go: ~D~%" (-> this hits-to-go)) + (format #t "~T~Ttook-hit: ~A~%" (-> this took-hit)) + (format #t "~T~Tchildren-spawned: ~D~%" (-> this children-spawned)) + (format #t "~T~Tvulnerable: ~D~%" (-> this vulnerable)) + (format #t "~T~Ttill-next-shot: ~D~%" (-> this till-next-shot)) + (format #t "~T~Tshot-attractor: ~D~%" (-> this shot-attractor)) + (format #t "~T~Tdesired-pool-y: ~f~%" (-> this desired-pool-y)) + (format #t "~T~Tparticle[7] @ #x~X~%" (-> this particle)) + (format #t "~T~Tblue-smoke: ~A~%" (-> this blue-smoke)) + (format #t "~T~Tred-smoke: ~A~%" (-> this red-smoke)) + (format #t "~T~Tyellow-smoke: ~A~%" (-> this yellow-smoke)) + (format #t "~T~Twhite-eco: ~D~%" (-> this white-eco)) + (format #t "~T~Tdes-cam-entity: ~A~%" (-> this des-cam-entity)) + (format #t "~T~Tuse-interesting: ~A~%" (-> this use-interesting)) + (format #t "~T~Tignore-camera: ~A~%" (-> this ignore-camera)) + (format #t "~T~Tambient: #~%" (-> this ambient)) + (format #t "~T~Tyellow-gun: ~A~%" (-> this yellow-gun)) + (format #t "~T~Tpalette-val: ~f~%" (-> this palette-val)) + (format #t "~T~Tlooping-sound[4] @ #x~X~%" (-> this looping-sound)) + (format #t "~T~Tdda: #~%" (-> this dda)) + (format #t "~T~Tvalid-frames: ~D~%" (-> this valid-frames)) + (format #t "~T~Tskip-cut: ~A~%" (-> this skip-cut)) + (format #t "~T~Tkeep-charging: ~A~%" (-> this keep-charging)) + this ) ;; definition for method 7 of type robotboss ;; INFO: Return type mismatch process-drawable vs robotboss. -(defmethod relocate robotboss ((obj robotboss) (arg0 int)) +(defmethod relocate robotboss ((this robotboss) (arg0 int)) (dotimes (v1-0 7) - (if (nonzero? (-> obj particle v1-0)) - (&+! (-> obj particle v1-0) arg0) + (if (nonzero? (-> this particle v1-0)) + (&+! (-> this particle v1-0) arg0) ) ) (dotimes (v1-3 4) - (if (nonzero? (-> obj looping-sound v1-3)) - (&+! (-> obj looping-sound v1-3) arg0) + (if (nonzero? (-> this looping-sound v1-3)) + (&+! (-> this looping-sound v1-3) arg0) ) ) - (if (nonzero? (-> obj yellow-gun)) - (&+! (-> obj yellow-gun) arg0) + (if (nonzero? (-> this yellow-gun)) + (&+! (-> this yellow-gun) arg0) ) - (the-as robotboss ((method-of-type process-drawable relocate) obj arg0)) + (the-as robotboss ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type robotboss -(defmethod deactivate robotboss ((obj robotboss)) +(defmethod deactivate robotboss ((this robotboss)) (dotimes (s5-0 7) - (let ((a0-1 (-> obj particle s5-0))) + (let ((a0-1 (-> this particle s5-0))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) (dotimes (s5-1 4) - (let ((a0-2 (-> obj looping-sound s5-1))) + (let ((a0-2 (-> this looping-sound s5-1))) (if (nonzero? a0-2) (stop! a0-2) ) ) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc index 1675f456f6..12ac58e13c 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-misc_REF.gc @@ -89,12 +89,12 @@ ) ;; definition for method 3 of type ecoclaw-part-info -(defmethod inspect ecoclaw-part-info ((obj ecoclaw-part-info)) - (format #t "[~8x] ~A~%" obj 'ecoclaw-part-info) - (format #t "~Ttracker: ~D~%" (-> obj tracker)) - (format #t "~Tkind: ~A~%" (-> obj kind)) - (format #t "~Ttrans: #~%" (-> obj trans)) - obj +(defmethod inspect ecoclaw-part-info ((this ecoclaw-part-info)) + (format #t "[~8x] ~A~%" this 'ecoclaw-part-info) + (format #t "~Ttracker: ~D~%" (-> this tracker)) + (format #t "~Tkind: ~A~%" (-> this kind)) + (format #t "~Ttrans: #~%" (-> this trans)) + this ) ;; definition of type ecoclaw @@ -112,12 +112,12 @@ ) ;; definition for method 3 of type ecoclaw -(defmethod inspect ecoclaw ((obj ecoclaw)) +(defmethod inspect ecoclaw ((this ecoclaw)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tparticles[3] @ #x~X~%" (-> obj particles)) - obj + (format #t "~T~Tparticles[3] @ #x~X~%" (-> this particles)) + this ) ;; failed to figure out what this is: @@ -231,9 +231,7 @@ (dotimes (gp-0 2) (cond ((handle->process (-> self particles gp-0 tracker)) - (set! (-> (the-as part-tracker (-> self particles gp-0 tracker process 0)) start-time) - (-> *display* base-frame-counter) - ) + (set-time! (-> (the-as part-tracker (-> self particles gp-0 tracker process 0)) start-time)) ) ((-> self particles gp-0 kind) (set! (-> self particles gp-0 tracker) (ppointer->handle (process-spawn @@ -282,15 +280,15 @@ ;; definition for method 11 of type ecoclaw ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ecoclaw ((obj ecoclaw) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ecoclaw-sg* '()) +(defmethod init-from-entity! ecoclaw ((this ecoclaw) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ecoclaw-sg* '()) (dotimes (v1-3 3) - (set! (-> obj particles v1-3 kind) #f) - (set! (-> obj particles v1-3 tracker) (the-as handle #f)) + (set! (-> this particles v1-3 kind) #f) + (set! (-> this particles v1-3 tracker) (the-as handle #f)) ) - (set! *ecoclaw* (the-as (pointer ecoclaw) (process->ppointer obj))) + (set! *ecoclaw* (the-as (pointer ecoclaw) (process->ppointer this))) (go ecoclaw-idle) (none) ) @@ -310,12 +308,12 @@ ) ;; definition for method 3 of type silodoor -(defmethod inspect silodoor ((obj silodoor)) +(defmethod inspect silodoor ((this silodoor)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpart-opened: ~f~%" (-> obj part-opened)) - obj + (format #t "~T~Tpart-opened: ~f~%" (-> this part-opened)) + this ) ;; failed to figure out what this is: @@ -385,8 +383,8 @@ ;; definition for method 11 of type silodoor ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! silodoor ((obj silodoor) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! silodoor ((this silodoor) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -439,18 +437,18 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *silodoor-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj root pause-adjust-distance) 1228800.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "silo-moves" :fo-max 80) (-> obj root trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *silodoor-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this root pause-adjust-distance) 1228800.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "silo-moves" :fo-max 80) (-> this root trans)) ) - (logclear! (-> obj mask) (process-mask actor-pause crate enemy attackable)) - (set! (-> obj part-opened) 0.0) - (go (method-of-object obj idle)) + (logclear! (-> this mask) (process-mask actor-pause crate enemy attackable)) + (set! (-> this part-opened) 0.0) + (go (method-of-object this idle)) (none) ) @@ -465,12 +463,12 @@ ) ;; definition for method 3 of type finalbosscam -(defmethod inspect finalbosscam ((obj finalbosscam)) +(defmethod inspect finalbosscam ((this finalbosscam)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Trobotboss: ~D~%" (-> obj robotboss)) - obj + (format #t "~T~Trobotboss: ~D~%" (-> this robotboss)) + this ) ;; failed to figure out what this is: @@ -492,17 +490,17 @@ ;; definition for method 32 of type finalbosscam ;; INFO: Return type mismatch spool-anim vs basic. -(defmethod play-anim! finalbosscam ((obj finalbosscam) (arg0 symbol)) +(defmethod play-anim! finalbosscam ((this finalbosscam) (arg0 symbol)) (when arg0 - (set! (-> obj robotboss) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *robotboss-sg* #f :to obj)) + (set! (-> this robotboss) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *robotboss-sg* #f :to this)) ) - (send-event (handle->process (-> obj robotboss)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj robotboss)) 'center-joint 3) - (send-event (handle->process (-> obj robotboss)) 'origin-joint-index 3) - (send-event (handle->process (-> obj robotboss)) 'trans-hook robotboss-manipy-trans-hook) + (send-event (handle->process (-> this robotboss)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this robotboss)) 'center-joint 3) + (send-event (handle->process (-> this robotboss)) 'origin-joint-index 3) + (send-event (handle->process (-> this robotboss)) 'trans-hook robotboss-manipy-trans-hook) (send-event - (handle->process (-> obj robotboss)) + (handle->process (-> this robotboss)) 'eval (lambda :behavior finalbosscam () (let ((v0-0 (create-launch-control (-> *part-group-id-table* 645) self))) (set! (-> self part) v0-0) @@ -510,7 +508,7 @@ ) ) ) - (let ((v1-43 (handle->process (-> obj robotboss)))) + (let ((v1-43 (handle->process (-> this robotboss)))) (if v1-43 (set! (-> (the-as robotboss v1-43) draw bounds w) 327680.0) ) @@ -520,12 +518,12 @@ ) ;; definition for method 31 of type finalbosscam -(defmethod get-art-elem finalbosscam ((obj finalbosscam)) - (-> obj draw art-group data 2) +(defmethod get-art-elem finalbosscam ((this finalbosscam)) + (-> this draw art-group data 2) ) ;; definition for method 39 of type finalbosscam -(defmethod should-display? finalbosscam ((obj finalbosscam)) +(defmethod should-display? finalbosscam ((this finalbosscam)) #f ) diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc index 1211c9e6b6..4afe245f83 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss-weapon_REF.gc @@ -20,40 +20,40 @@ ) ;; definition for method 3 of type torus -(defmethod inspect torus ((obj torus)) - (format #t "[~8x] ~A~%" obj 'torus) - (format #t "~Torigin: #~%" (-> obj origin)) - (format #t "~Taxis: #~%" (-> obj axis)) - (format #t "~Tradius-primary: ~f~%" (-> obj radius-primary)) - (format #t "~Tradius-secondary: ~f~%" (-> obj radius-secondary)) - obj +(defmethod inspect torus ((this torus)) + (format #t "[~8x] ~A~%" this 'torus) + (format #t "~Torigin: #~%" (-> this origin)) + (format #t "~Taxis: #~%" (-> this axis)) + (format #t "~Tradius-primary: ~f~%" (-> this radius-primary)) + (format #t "~Tradius-secondary: ~f~%" (-> this radius-secondary)) + this ) ;; definition for method 10 of type torus -(defmethod torus-method-10 torus ((obj torus) (arg0 collide-prim-core) (arg1 vector)) +(defmethod torus-method-10 torus ((this torus) (arg0 collide-prim-core) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) - (f30-0 (+ (-> obj radius-secondary) (-> arg0 world-sphere w))) + (f30-0 (+ (-> this radius-secondary) (-> arg0 world-sphere w))) ) - (vector-! gp-0 (the-as vector arg0) (-> obj origin)) - (vector-flatten! s5-0 gp-0 (-> obj axis)) - (vector-normalize! s5-0 (-> obj radius-primary)) + (vector-! gp-0 (the-as vector arg0) (-> this origin)) + (vector-flatten! s5-0 gp-0 (-> this axis)) + (vector-normalize! s5-0 (-> this radius-primary)) (vector-! arg1 gp-0 s5-0) (< (vector-length-squared arg1) (* f30-0 f30-0)) ) ) ;; definition for method 11 of type torus -(defmethod torus-method-11 torus ((obj torus) (arg0 vector)) +(defmethod torus-method-11 torus ((this torus) (arg0 vector)) (let ((s4-0 (the-as collide-shape-prim-group (-> *target* control root-prim)))) (when (and (logtest? (-> s4-0 prim-core collide-as) (collide-kind target)) - (torus-method-10 obj (-> s4-0 prim-core) arg0) + (torus-method-10 this (-> s4-0 prim-core) arg0) ) (countdown (s3-0 (-> s4-0 num-prims)) (let ((v1-9 (-> s4-0 prims s3-0))) (if (and (logtest? (-> v1-9 prim-core action) (collide-action solid)) (logtest? (-> v1-9 prim-core collide-as) (collide-kind target)) - (torus-method-10 obj (-> v1-9 prim-core) arg0) + (torus-method-10 this (-> v1-9 prim-core) arg0) ) (return #t) ) @@ -74,16 +74,16 @@ ) ;; definition for method 3 of type torus-verts -(defmethod inspect torus-verts ((obj torus-verts)) - (format #t "[~8x] ~A~%" obj 'torus-verts) - (format #t "~Tvert[8] @ #x~X~%" (-> obj vert)) - obj +(defmethod inspect torus-verts ((this torus-verts)) + (format #t "[~8x] ~A~%" this 'torus-verts) + (format #t "~Tvert[8] @ #x~X~%" (-> this vert)) + this ) ;; definition for method 9 of type torus ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod torus-method-9 torus ((obj torus) (arg0 vector)) +(defmethod torus-method-9 torus ((this torus) (arg0 vector)) (local-vars (sv-256 int) (sv-272 int) (sv-288 int)) (let ((s0-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -92,38 +92,38 @@ (s1-0 (new 'stack-no-clear 'inline-array 'vector 8)) ) (set-vector! s0-0 0.0 0.0 1.0 1.0) - (vector-flatten! s0-0 s0-0 (-> obj axis)) + (vector-flatten! s0-0 s0-0 (-> this axis)) (if (= (vector-normalize-ret-len! s0-0 1.0) 0.0) (set-vector! s0-0 0.0 1.0 0.0 1.0) ) - (vector-cross! s4-0 s0-0 (-> obj axis)) + (vector-cross! s4-0 s0-0 (-> this axis)) (matrix-axis-angle! s2-0 s4-0 8192.0) - (vector-float*! (-> s1-0 0) s0-0 (-> obj radius-secondary)) + (vector-float*! (-> s1-0 0) s0-0 (-> this radius-secondary)) (set! sv-256 0) (while (< sv-256 7) (vector-matrix*! (-> s1-0 (+ sv-256 1)) (-> s1-0 sv-256) s2-0) (set! sv-256 (+ sv-256 1)) ) - (vector-float*! s0-0 s0-0 (-> obj radius-primary)) + (vector-float*! s0-0 s0-0 (-> this radius-primary)) (dotimes (v1-21 8) (vector+! (-> s1-0 v1-21) (-> s1-0 v1-21) s0-0) ) - (matrix-axis-angle! s2-0 (-> obj axis) 4096.0) + (matrix-axis-angle! s2-0 (-> this axis) 4096.0) (dotimes (s0-1 16) (set! sv-272 0) (while (< sv-272 7) - (vector+! s4-0 (-> s1-0 sv-272) (-> obj origin)) - (vector+! s3-0 (-> s1-0 (+ sv-272 1)) (-> obj origin)) + (vector+! s4-0 (-> s1-0 sv-272) (-> this origin)) + (vector+! s3-0 (-> s1-0 (+ sv-272 1)) (-> this origin)) (camera-line s4-0 s3-0 (the-as vector4w arg0)) (set! sv-272 (+ sv-272 1)) ) - (vector+! s4-0 (-> s1-0 0) (-> obj origin)) + (vector+! s4-0 (-> s1-0 0) (-> this origin)) (camera-line s4-0 s3-0 (the-as vector4w arg0)) (set! sv-288 0) (while (< sv-288 8) - (vector+! s4-0 (-> s1-0 sv-288) (-> obj origin)) + (vector+! s4-0 (-> s1-0 sv-288) (-> this origin)) (vector-matrix*! (-> s1-0 sv-288) (-> s1-0 sv-288) s2-0) - (vector+! s3-0 (-> s1-0 sv-288) (-> obj origin)) + (vector+! s3-0 (-> s1-0 sv-288) (-> this origin)) (camera-line s4-0 s3-0 (the-as vector4w arg0)) (set! sv-288 (+ sv-288 1)) ) @@ -134,17 +134,17 @@ ) ;; definition for method 12 of type torus -(defmethod torus-method-12 torus ((obj torus) (arg0 vector)) +(defmethod torus-method-12 torus ((this torus) (arg0 vector)) (let* ((f30-0 65536.0) (v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-2 (the-as number (logior #x3f800000 v1-1))) (f30-1 (* f30-0 (+ -1.0 (the-as float v1-2)))) ) (set! (-> arg0 x) 0.0) - (set! (-> arg0 y) (* (-> obj radius-secondary) (sin f30-1))) - (set! (-> arg0 z) (* (-> obj radius-secondary) (cos f30-1))) + (set! (-> arg0 y) (* (-> this radius-secondary) (sin f30-1))) + (set! (-> arg0 z) (* (-> this radius-secondary) (cos f30-1))) ) - (+! (-> arg0 z) (-> obj radius-primary)) + (+! (-> arg0 z) (-> this radius-primary)) (set! (-> arg0 w) 0.0) (let ((s2-0 (new 'stack-no-clear 'matrix))) (let* ((s4-0 matrix-rotate-y!) @@ -156,10 +156,10 @@ (s4-0 s3-0 (* f30-2 (+ -1.0 (the-as float v1-7)))) ) (vector-matrix*! arg0 arg0 s2-0) - (matrix-from-two-vectors! s2-0 (new 'static 'vector :y 1.0 :w 1.0) (-> obj axis)) + (matrix-from-two-vectors! s2-0 (new 'static 'vector :y 1.0 :w 1.0) (-> this axis)) (vector-matrix*! arg0 arg0 s2-0) ) - (vector+! arg0 arg0 (-> obj origin)) + (vector+! arg0 arg0 (-> this origin)) arg0 ) @@ -181,15 +181,15 @@ ) ;; definition for method 3 of type arcing-shot -(defmethod inspect arcing-shot ((obj arcing-shot)) +(defmethod inspect arcing-shot ((this arcing-shot)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ty-vel: ~f~%" (-> obj y-vel)) - (format #t "~T~Tgrav: ~f~%" (-> obj grav)) - (format #t "~T~Tfrom: #~%" (-> obj from)) - (format #t "~T~Tto: #~%" (-> obj to)) - obj + (format #t "~T~Ty-vel: ~f~%" (-> this y-vel)) + (format #t "~T~Tgrav: ~f~%" (-> this grav)) + (format #t "~T~Tfrom: #~%" (-> this from)) + (format #t "~T~Tto: #~%" (-> this to)) + this ) ;; definition for function arcing-shot-setup @@ -270,15 +270,15 @@ ) ;; definition for method 3 of type darkecobomb -(defmethod inspect darkecobomb ((obj darkecobomb)) +(defmethod inspect darkecobomb ((this darkecobomb)) (let ((t9-0 (method-of-type arcing-shot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tflight-time: ~D~%" (-> obj flight-time)) - (format #t "~T~Tcountdown-time: ~f~%" (-> obj countdown-time)) - (format #t "~T~Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~T~Tnext-tick: ~f~%" (-> obj next-tick)) - obj + (format #t "~T~Tflight-time: ~D~%" (-> this flight-time)) + (format #t "~T~Tcountdown-time: ~f~%" (-> this countdown-time)) + (format #t "~T~Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~T~Tnext-tick: ~f~%" (-> this next-tick)) + this ) ;; failed to figure out what this is: @@ -313,8 +313,8 @@ ) (send-event (ppointer->process (-> self parent)) 'bomb-going) (send-event *camera* 'change-to-entity-by-name "camera-402") - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (suspend) ) (send-event *camera* 'force-blend 0) @@ -531,12 +531,12 @@ ) ;; definition for method 3 of type greenshot -(defmethod inspect greenshot ((obj greenshot)) +(defmethod inspect greenshot ((this greenshot)) (let ((t9-0 (method-of-type arcing-shot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tflight-time: ~D~%" (-> obj flight-time)) - obj + (format #t "~T~Tflight-time: ~D~%" (-> this flight-time)) + this ) ;; failed to figure out what this is: @@ -626,41 +626,41 @@ ) ;; definition for method 3 of type redshot -(defmethod inspect redshot ((obj redshot)) +(defmethod inspect redshot ((this redshot)) (let ((t9-0 (method-of-type arcing-shot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tflight-time: ~D~%" (-> obj flight-time)) - (format #t "~T~Tstall-time: ~D~%" (-> obj stall-time)) - (format #t "~T~Tring: #~%" (-> obj ring)) - (format #t "~T~Trotation-offset: ~D~%" (-> obj rotation-offset)) - (format #t "~T~Tpart-track: ~D~%" (-> obj part-track)) - (format #t "~T~Tshot-particle: ~A~%" (-> obj shot-particle)) - (format #t "~T~Ttest-particle: ~A~%" (-> obj test-particle)) - obj + (format #t "~T~Tflight-time: ~D~%" (-> this flight-time)) + (format #t "~T~Tstall-time: ~D~%" (-> this stall-time)) + (format #t "~T~Tring: #~%" (-> this ring)) + (format #t "~T~Trotation-offset: ~D~%" (-> this rotation-offset)) + (format #t "~T~Tpart-track: ~D~%" (-> this part-track)) + (format #t "~T~Tshot-particle: ~A~%" (-> this shot-particle)) + (format #t "~T~Ttest-particle: ~A~%" (-> this test-particle)) + this ) ;; definition for method 7 of type redshot ;; INFO: Return type mismatch arcing-shot vs redshot. -(defmethod relocate redshot ((obj redshot) (arg0 int)) - (if (nonzero? (-> obj shot-particle)) - (&+! (-> obj shot-particle) arg0) +(defmethod relocate redshot ((this redshot) (arg0 int)) + (if (nonzero? (-> this shot-particle)) + (&+! (-> this shot-particle) arg0) ) - (if (nonzero? (-> obj test-particle)) - (&+! (-> obj test-particle) arg0) + (if (nonzero? (-> this test-particle)) + (&+! (-> this test-particle) arg0) ) - (the-as redshot ((method-of-type arcing-shot relocate) obj arg0)) + (the-as redshot ((method-of-type arcing-shot relocate) this arg0)) ) ;; definition for method 10 of type redshot -(defmethod deactivate redshot ((obj redshot)) - (if (nonzero? (-> obj shot-particle)) - (kill-and-free-particles (-> obj shot-particle)) +(defmethod deactivate redshot ((this redshot)) + (if (nonzero? (-> this shot-particle)) + (kill-and-free-particles (-> this shot-particle)) ) - (if (nonzero? (-> obj test-particle)) - (kill-and-free-particles (-> obj test-particle)) + (if (nonzero? (-> this test-particle)) + (kill-and-free-particles (-> this test-particle)) ) - ((method-of-type arcing-shot deactivate) obj) + ((method-of-type arcing-shot deactivate) this) (none) ) @@ -875,12 +875,12 @@ ) ;; definition for method 3 of type yellowshot -(defmethod inspect yellowshot ((obj yellowshot)) +(defmethod inspect yellowshot ((this yellowshot)) (let ((t9-0 (method-of-type arcing-shot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tflight-time: ~D~%" (-> obj flight-time)) - obj + (format #t "~T~Tflight-time: ~D~%" (-> this flight-time)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc index 33d370fe4d..0a226ee60e 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/robotboss_REF.gc @@ -2,8 +2,8 @@ (in-package goal) ;; definition for method 20 of type robotboss -(defmethod ease-loc-t robotboss ((obj robotboss)) - (parameter-ease-sin-clamp (-> obj loc-t)) +(defmethod ease-loc-t robotboss ((this robotboss)) + (parameter-ease-sin-clamp (-> this loc-t)) ) ;; failed to figure out what this is: @@ -633,7 +633,7 @@ :enter (behavior () (logior! (-> self draw status) (draw-status hidden)) (set! (-> self children-spawned) 0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-post) ) :exit (behavior () @@ -641,9 +641,7 @@ ) :trans (behavior () (spool-push *art-control* "green-sagecage-daxter-sacrifice" 0 self (the-as float -1.0)) - (when (and (< (-> self children-spawned) 1) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.95)) - ) + (when (and (< (-> self children-spawned) 1) (time-elapsed? (-> self state-time) (seconds 0.95))) (+! (-> self children-spawned) 1) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self entity extra trans quad)) @@ -1327,12 +1325,12 @@ ) ;; definition for method 3 of type redshot-launch-info -(defmethod inspect redshot-launch-info ((obj redshot-launch-info)) - (format #t "[~8x] ~A~%" obj 'redshot-launch-info) - (format #t "~Tdest: #~%" (-> obj dest)) - (format #t "~Tflight-time: ~D~%" (-> obj flight-time)) - (format #t "~Tstall-time: ~D~%" (-> obj stall-time)) - obj +(defmethod inspect redshot-launch-info ((this redshot-launch-info)) + (format #t "[~8x] ~A~%" this 'redshot-launch-info) + (format #t "~Tdest: #~%" (-> this dest)) + (format #t "~Tflight-time: ~D~%" (-> this flight-time)) + (format #t "~Tstall-time: ~D~%" (-> this stall-time)) + this ) ;; definition of type redshot-launch-array @@ -1345,10 +1343,10 @@ ) ;; definition for method 3 of type redshot-launch-array -(defmethod inspect redshot-launch-array ((obj redshot-launch-array)) - (format #t "[~8x] ~A~%" obj 'redshot-launch-array) - (format #t "~Tinfo[6] @ #x~X~%" (-> obj info)) - obj +(defmethod inspect redshot-launch-array ((this redshot-launch-array)) + (format #t "[~8x] ~A~%" this 'redshot-launch-array) + (format #t "~Tinfo[6] @ #x~X~%" (-> this info)) + this ) ;; definition for function robotboss-redshot-fill-array @@ -2694,9 +2692,9 @@ ;; definition for method 11 of type robotboss ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! robotboss ((obj robotboss) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! robotboss ((this robotboss) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -2883,81 +2881,81 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *robotboss-sg* '()) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *robotboss-sg* '()) (aybabtu 2) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 (the-as float 40960.0))) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) - (set! (-> obj path) (new 'process 'path-control obj 'path (the-as float 0.0))) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj root-override pause-adjust-distance) 1228800.0) - (set-vector! (-> obj old-loc) 8192.0 0.0 245760.0 1.0) - (set! (-> obj desired-loc quad) (-> obj old-loc quad)) - (set! (-> obj loc-t) 1.0) - (set! (-> obj loc-t-duration) 1) - (set! (-> obj loc-t-start) 0) - (set! (-> obj shot-attractor) (the-as handle #f)) - (set! (-> obj white-eco) (the-as handle #f)) - (set! (-> obj desired-pool-y) -30720.0) - (set! (-> obj des-cam-entity) #f) - (set! (-> obj use-interesting) #f) - (set! (-> obj ignore-camera) #f) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 (the-as float 40960.0))) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (logclear! (-> this root-override nav-flags) (nav-flags navf0)) + (set! (-> this path) (new 'process 'path-control this 'path (the-as float 0.0))) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this root-override pause-adjust-distance) 1228800.0) + (set-vector! (-> this old-loc) 8192.0 0.0 245760.0 1.0) + (set! (-> this desired-loc quad) (-> this old-loc quad)) + (set! (-> this loc-t) 1.0) + (set! (-> this loc-t-duration) 1) + (set! (-> this loc-t-start) 0) + (set! (-> this shot-attractor) (the-as handle #f)) + (set! (-> this white-eco) (the-as handle #f)) + (set! (-> this desired-pool-y) -30720.0) + (set! (-> this des-cam-entity) #f) + (set! (-> this use-interesting) #f) + (set! (-> this ignore-camera) #f) (dotimes (v1-211 13) - (set! (-> obj alts v1-211) #f) + (set! (-> this alts v1-211) #f) ) - (let ((s5-1 (entity-actor-count (-> obj entity) 'alt-actor))) + (let ((s5-1 (entity-actor-count (-> this entity) 'alt-actor))) (dotimes (s4-1 (min 13 s5-1)) - (set! (-> obj alts s4-1) (entity-actor-lookup (-> obj entity) 'alt-actor s4-1)) + (set! (-> this alts s4-1) (entity-actor-lookup (-> this entity) 'alt-actor s4-1)) ) ) - (set! (-> obj particle 0) (create-launch-control (-> *part-group-id-table* 636) obj)) - (set! (-> obj particle 1) (create-launch-control (-> *part-group-id-table* 637) obj)) - (set! (-> obj particle 2) (create-launch-control (-> *part-group-id-table* 645) obj)) - (set! (-> obj particle 3) (create-launch-control (-> *part-group-id-table* 650) obj)) - (set! (-> obj particle 4) (create-launch-control (-> *part-group-id-table* 654) obj)) - (set! (-> obj particle 5) (create-launch-control (-> *part-group-id-table* 646) obj)) - (set! (-> obj particle 6) (create-launch-control (-> *part-group-id-table* 651) obj)) - (set! (-> obj looping-sound 0) - (new 'process 'ambient-sound (static-sound-spec "robo-blue-lp" :fo-max 80) (-> obj root-override trans)) + (set! (-> this particle 0) (create-launch-control (-> *part-group-id-table* 636) this)) + (set! (-> this particle 1) (create-launch-control (-> *part-group-id-table* 637) this)) + (set! (-> this particle 2) (create-launch-control (-> *part-group-id-table* 645) this)) + (set! (-> this particle 3) (create-launch-control (-> *part-group-id-table* 650) this)) + (set! (-> this particle 4) (create-launch-control (-> *part-group-id-table* 654) this)) + (set! (-> this particle 5) (create-launch-control (-> *part-group-id-table* 646) this)) + (set! (-> this particle 6) (create-launch-control (-> *part-group-id-table* 651) this)) + (set! (-> this looping-sound 0) + (new 'process 'ambient-sound (static-sound-spec "robo-blue-lp" :fo-max 80) (-> this root-override trans)) ) - (set! (-> obj looping-sound 1) - (new 'process 'ambient-sound (static-sound-spec "eco-torch" :fo-max 80) (-> obj root-override trans)) + (set! (-> this looping-sound 1) + (new 'process 'ambient-sound (static-sound-spec "eco-torch" :fo-max 80) (-> this root-override trans)) ) - (set! (-> obj looping-sound 2) - (new 'process 'ambient-sound (static-sound-spec "red-buzz" :fo-max 80) (-> obj root-override trans)) + (set! (-> this looping-sound 2) + (new 'process 'ambient-sound (static-sound-spec "red-buzz" :fo-max 80) (-> this root-override trans)) ) - (set! (-> obj looping-sound 3) - (new 'process 'ambient-sound (static-sound-spec "bfg-buzz" :fo-max 80) (-> obj root-override trans)) + (set! (-> this looping-sound 3) + (new 'process 'ambient-sound (static-sound-spec "bfg-buzz" :fo-max 80) (-> this root-override trans)) ) - (set! (-> obj blue-smoke) #f) - (set! (-> obj red-smoke) #f) - (set! (-> obj yellow-smoke) #f) - (ambient-control-method-9 (-> obj ambient)) - (set! (-> obj yellow-gun) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 16)) - (set-vector! (-> obj yellow-gun twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj yellow-gun up) (the-as uint 1)) - (set! (-> obj yellow-gun nose) (the-as uint 2)) - (set! (-> obj yellow-gun ear) (the-as uint 0)) - (set! (-> obj yellow-gun max-dist) 819200.0) - (set! (-> obj yellow-gun ignore-angle) 16384.0) - (set! (-> obj palette-val) 0.0) - (set! (-> obj dda) (new 'static 'robotboss-dda - :blue-bomb-time 4200.0 - :num-blobs 12 - :green-bomb-time 4200.0 - :red-shots-min 5 - :red-shot-time-min 3600.0 - :red-shot-time-rnd 600.0 - :red-bomb-time 3600.0 - :yellow-shot-time-min 900.0 - :yellow-shot-time-rnd 600.0 - :yellow-gun-hits 5 - :yellow-bomb-time 3600.0 - ) + (set! (-> this blue-smoke) #f) + (set! (-> this red-smoke) #f) + (set! (-> this yellow-smoke) #f) + (ambient-control-method-9 (-> this ambient)) + (set! (-> this yellow-gun) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) this 16)) + (set-vector! (-> this yellow-gun twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this yellow-gun up) (the-as uint 1)) + (set! (-> this yellow-gun nose) (the-as uint 2)) + (set! (-> this yellow-gun ear) (the-as uint 0)) + (set! (-> this yellow-gun max-dist) 819200.0) + (set! (-> this yellow-gun ignore-angle) 16384.0) + (set! (-> this palette-val) 0.0) + (set! (-> this dda) (new 'static 'robotboss-dda + :blue-bomb-time 4200.0 + :num-blobs 12 + :green-bomb-time 4200.0 + :red-shots-min 5 + :red-shot-time-min 3600.0 + :red-shot-time-rnd 600.0 + :red-bomb-time 3600.0 + :yellow-shot-time-min 900.0 + :yellow-shot-time-rnd 600.0 + :yellow-gun-hits 5 + :yellow-bomb-time 3600.0 + ) ) (go robotboss-blue-wait) (none) diff --git a/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc b/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc index d367919d47..66589782ae 100644 --- a/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/finalboss/sage-finalboss_REF.gc @@ -46,37 +46,37 @@ ) ;; definition for method 3 of type plat-eco-finalboss -(defmethod inspect plat-eco-finalboss ((obj plat-eco-finalboss)) +(defmethod inspect plat-eco-finalboss ((this plat-eco-finalboss)) (let ((t9-0 (method-of-type plat-eco inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tforce-dest: ~f~%" (-> obj force-dest)) - (format #t "~T~Ttarg-dest: ~f~%" (-> obj targ-dest)) - (format #t "~T~Tdest: ~f~%" (-> obj dest)) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Ttouch-time: ~D~%" (-> obj touch-time)) - obj + (format #t "~T~Tforce-dest: ~f~%" (-> this force-dest)) + (format #t "~T~Ttarg-dest: ~f~%" (-> this targ-dest)) + (format #t "~T~Tdest: ~f~%" (-> this dest)) + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Ttouch-time: ~D~%" (-> this touch-time)) + this ) ;; definition for method 23 of type plat-eco-finalboss -(defmethod get-unlit-skel plat-eco-finalboss ((obj plat-eco-finalboss)) +(defmethod get-unlit-skel plat-eco-finalboss ((this plat-eco-finalboss)) *plat-eco-finalboss-unlit-sg* ) ;; definition for method 27 of type plat-eco-finalboss -(defmethod get-lit-skel plat-eco-finalboss ((obj plat-eco-finalboss)) +(defmethod get-lit-skel plat-eco-finalboss ((this plat-eco-finalboss)) *plat-eco-finalboss-lit-sg* ) ;; definition for method 26 of type plat-eco-finalboss ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 plat-eco-finalboss ((obj plat-eco-finalboss)) - (set! (-> obj force-dest) -1.0) - (set! (-> obj targ-dest) -1.0) - (set! (-> obj dest) 0.0) - (set! (-> obj speed) 0.1) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status bit-3) #t) +(defmethod baseplat-method-26 plat-eco-finalboss ((this plat-eco-finalboss)) + (set! (-> this force-dest) -1.0) + (set! (-> this targ-dest) -1.0) + (set! (-> this dest) 0.0) + (set! (-> this speed) 0.1) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status bit-3) #t) (none) ) @@ -90,7 +90,7 @@ (set! (-> self force-dest) (the-as float (-> block param 0))) ) (('ridden 'edge-grabbed) - (if (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 2)) + (if (time-elapsed? (-> self touch-time) (seconds 2)) (set! (-> self targ-dest) (cond ((= (-> self path-pos) 0.0) (set! (-> self force-dest) -1.0) @@ -105,7 +105,7 @@ ) ) ) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) #f ) (else @@ -114,7 +114,7 @@ ) ) :enter (behavior ((arg0 plat)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (lods-assign! (-> self draw) (-> self lit-look)) (process-entity-status! self (entity-perm-status complete) #t) (cond @@ -131,7 +131,7 @@ (let ((s5-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp)) (gp-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 1.0 'interp)) ) - (if (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 3)) + (if (time-elapsed? (-> self touch-time) (seconds 3)) (set! (-> self targ-dest) -1.0) ) (set! (-> self dest) @@ -151,10 +151,10 @@ ) ) ) - (if (= (-> self state-time) (-> *display* base-frame-counter)) + (if (= (-> self state-time) (current-time)) (set! (-> self path-pos) (-> self dest)) ) - (seek! (-> self path-pos) (-> self dest) (* (-> self speed) (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) (-> self dest) (* (-> self speed) (seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (if (< (vector-vector-distance (-> self root-override trans) (ear-trans)) 81920.0) (sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) @@ -179,11 +179,11 @@ ) ;; definition for method 3 of type sage-finalboss-particle -(defmethod inspect sage-finalboss-particle ((obj sage-finalboss-particle)) - (format #t "[~8x] ~A~%" obj 'sage-finalboss-particle) - (format #t "~Tpart: ~A~%" (-> obj part)) - (format #t "~Tactive: ~A~%" (-> obj active)) - obj +(defmethod inspect sage-finalboss-particle ((this sage-finalboss-particle)) + (format #t "[~8x] ~A~%" this 'sage-finalboss-particle) + (format #t "~Tpart: ~A~%" (-> this part)) + (format #t "~Tactive: ~A~%" (-> this active)) + this ) ;; definition of type sage-finalboss @@ -216,57 +216,57 @@ ) ;; definition for method 3 of type sage-finalboss -(defmethod inspect sage-finalboss ((obj sage-finalboss)) +(defmethod inspect sage-finalboss ((this sage-finalboss)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tredsage: ~D~%" (-> obj redsage)) - (format #t "~T~Tbluesage: ~D~%" (-> obj bluesage)) - (format #t "~T~Tyellowsage: ~D~%" (-> obj yellowsage)) - (format #t "~T~Tassistant: ~D~%" (-> obj assistant)) - (format #t "~T~Trobotplat: ~D~%" (-> obj robotplat)) - (format #t "~T~Trobotboss: ~D~%" (-> obj robotboss)) - (format #t "~T~Tsilodoor: ~D~%" (-> obj silodoor)) - (format #t "~T~Tjak-white: ~D~%" (-> obj jak-white)) - (format #t "~T~Tleft-door: ~A~%" (-> obj left-door)) - (format #t "~T~Tright-door: ~A~%" (-> obj right-door)) - (format #t "~T~Tkick-in-the-door: ~A~%" (-> obj kick-in-the-door)) - (format #t "~T~Tkick-the-credits: ~A~%" (-> obj kick-the-credits)) - (format #t "~T~Tcredit-fade: ~f~%" (-> obj credit-fade)) - (format #t "~T~Tpalette-val: ~f~%" (-> obj palette-val)) - (format #t "~T~Tparticle[9] @ #x~X~%" (-> obj particle)) - (format #t "~T~Tparticle-whiteout: ~A~%" (-> obj particle-whiteout)) - (format #t "~T~Tcredits-played: ~A~%" (-> obj credits-played)) - obj + (format #t "~T~Tredsage: ~D~%" (-> this redsage)) + (format #t "~T~Tbluesage: ~D~%" (-> this bluesage)) + (format #t "~T~Tyellowsage: ~D~%" (-> this yellowsage)) + (format #t "~T~Tassistant: ~D~%" (-> this assistant)) + (format #t "~T~Trobotplat: ~D~%" (-> this robotplat)) + (format #t "~T~Trobotboss: ~D~%" (-> this robotboss)) + (format #t "~T~Tsilodoor: ~D~%" (-> this silodoor)) + (format #t "~T~Tjak-white: ~D~%" (-> this jak-white)) + (format #t "~T~Tleft-door: ~A~%" (-> this left-door)) + (format #t "~T~Tright-door: ~A~%" (-> this right-door)) + (format #t "~T~Tkick-in-the-door: ~A~%" (-> this kick-in-the-door)) + (format #t "~T~Tkick-the-credits: ~A~%" (-> this kick-the-credits)) + (format #t "~T~Tcredit-fade: ~f~%" (-> this credit-fade)) + (format #t "~T~Tpalette-val: ~f~%" (-> this palette-val)) + (format #t "~T~Tparticle[9] @ #x~X~%" (-> this particle)) + (format #t "~T~Tparticle-whiteout: ~A~%" (-> this particle-whiteout)) + (format #t "~T~Tcredits-played: ~A~%" (-> this credits-played)) + this ) ;; definition for method 7 of type sage-finalboss ;; INFO: Return type mismatch process-taskable vs sage-finalboss. -(defmethod relocate sage-finalboss ((obj sage-finalboss) (arg0 int)) +(defmethod relocate sage-finalboss ((this sage-finalboss) (arg0 int)) (dotimes (v1-0 9) - (if (nonzero? (-> obj particle v1-0 part)) - (&+! (-> obj particle v1-0 part) arg0) + (if (nonzero? (-> this particle v1-0 part)) + (&+! (-> this particle v1-0 part) arg0) ) ) - (if (nonzero? (-> obj particle-whiteout)) - (&+! (-> obj particle-whiteout) arg0) + (if (nonzero? (-> this particle-whiteout)) + (&+! (-> this particle-whiteout) arg0) ) - (the-as sage-finalboss ((method-of-type process-taskable relocate) obj arg0)) + (the-as sage-finalboss ((method-of-type process-taskable relocate) this arg0)) ) ;; definition for method 10 of type sage-finalboss -(defmethod deactivate sage-finalboss ((obj sage-finalboss)) +(defmethod deactivate sage-finalboss ((this sage-finalboss)) (dotimes (s5-0 9) - (let ((a0-1 (-> obj particle s5-0 part))) + (let ((a0-1 (-> this particle s5-0 part))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) - (if (nonzero? (-> obj particle-whiteout)) - (kill-and-free-particles (-> obj particle-whiteout)) + (if (nonzero? (-> this particle-whiteout)) + (kill-and-free-particles (-> this particle-whiteout)) ) - ((method-of-type process-taskable deactivate) obj) + ((method-of-type process-taskable deactivate) this) (none) ) @@ -279,40 +279,40 @@ ;; definition for method 44 of type sage-finalboss ;; INFO: Return type mismatch object vs symbol. -(defmethod play-reminder sage-finalboss ((obj sage-finalboss)) +(defmethod play-reminder sage-finalboss ((this sage-finalboss)) (let ((s5-0 (entity-by-name "red-sagecage-1"))) (when s5-0 - (set! (-> obj redsage) - (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-0 *redsage-sg* #f :to obj)) + (set! (-> this redsage) + (ppointer->handle (manipy-spawn (-> this root-override trans) s5-0 *redsage-sg* #f :to this)) ) - (send-event (handle->process (-> obj redsage)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj redsage)) 'blend-shape #t) - (send-event (handle->process (-> obj redsage)) 'center-joint 3) - (send-event (handle->process (-> obj redsage)) 'origin-joint-index 3) + (send-event (handle->process (-> this redsage)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this redsage)) 'blend-shape #t) + (send-event (handle->process (-> this redsage)) 'center-joint 3) + (send-event (handle->process (-> this redsage)) 'origin-joint-index 3) ) ) (let ((s5-1 (entity-by-name "blue-sagecage-1"))) (when s5-1 - (set! (-> obj bluesage) - (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-1 *bluesage-sg* #f :to obj)) + (set! (-> this bluesage) + (ppointer->handle (manipy-spawn (-> this root-override trans) s5-1 *bluesage-sg* #f :to this)) ) - (send-event (handle->process (-> obj bluesage)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj bluesage)) 'blend-shape #t) - (send-event (handle->process (-> obj bluesage)) 'center-joint 3) - (send-event (handle->process (-> obj bluesage)) 'origin-joint-index 3) + (send-event (handle->process (-> this bluesage)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this bluesage)) 'blend-shape #t) + (send-event (handle->process (-> this bluesage)) 'center-joint 3) + (send-event (handle->process (-> this bluesage)) 'origin-joint-index 3) ) ) (let ((s5-2 (entity-by-name "yellow-sagecage-1"))) (the-as symbol (when s5-2 - (set! (-> obj yellowsage) - (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-2 *yellowsage-sg* #f :to obj)) + (set! (-> this yellowsage) + (ppointer->handle (manipy-spawn (-> this root-override trans) s5-2 *yellowsage-sg* #f :to this)) ) - (send-event (handle->process (-> obj yellowsage)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj yellowsage)) 'blend-shape #t) - (send-event (handle->process (-> obj yellowsage)) 'center-joint 3) - (send-event (handle->process (-> obj yellowsage)) 'origin-joint-index 3) + (send-event (handle->process (-> this yellowsage)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this yellowsage)) 'blend-shape #t) + (send-event (handle->process (-> this yellowsage)) 'center-joint 3) + (send-event (handle->process (-> this yellowsage)) 'origin-joint-index 3) ) ) ) @@ -320,23 +320,23 @@ ;; definition for method 45 of type sage-finalboss ;; INFO: Return type mismatch object vs symbol. -(defmethod process-taskable-method-45 sage-finalboss ((obj sage-finalboss)) +(defmethod process-taskable-method-45 sage-finalboss ((this sage-finalboss)) (let ((s5-0 (entity-by-name "assistant-lavatube-end-3"))) (the-as symbol (when s5-0 - (set! (-> obj assistant) - (ppointer->handle (manipy-spawn (-> obj root-override trans) s5-0 *assistant-lavatube-end-sg* #f :to obj)) + (set! (-> this assistant) + (ppointer->handle (manipy-spawn (-> this root-override trans) s5-0 *assistant-lavatube-end-sg* #f :to this)) ) - (let ((s5-1 (handle->process (-> obj assistant)))) + (let ((s5-1 (handle->process (-> this assistant)))) (if (the-as manipy s5-1) (set! (-> (the-as manipy s5-1) draw level-index) (the-as uint (-> (level-get *level* 'finalboss) index))) ) ) - (send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj assistant)) 'blend-shape #t) - (send-event (handle->process (-> obj assistant)) 'center-joint 3) - (send-event (handle->process (-> obj assistant)) 'origin-joint-index 3) + (send-event (handle->process (-> this assistant)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this assistant)) 'blend-shape #t) + (send-event (handle->process (-> this assistant)) 'center-joint 3) + (send-event (handle->process (-> this assistant)) 'origin-joint-index 3) ) ) ) @@ -344,12 +344,12 @@ ;; definition for method 32 of type sage-finalboss ;; INFO: Used lq/sq -(defmethod play-anim! sage-finalboss ((obj sage-finalboss) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! sage-finalboss ((this sage-finalboss) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status unknown)) (when arg0 - (close-current! (-> obj tasks)) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) + (close-current! (-> this tasks)) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) ) (new 'static 'spool-anim :name "green-sagecage-daxter-sacrifice" @@ -360,36 +360,36 @@ ) (((task-status need-introduction)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) - (close-current! (-> obj tasks)) - (set! (-> obj jak-white) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *jak-white-sg* #f :to obj)) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) + (close-current! (-> this tasks)) + (set! (-> this jak-white) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *jak-white-sg* #f :to this)) ) (send-event - (handle->process (-> obj jak-white)) + (handle->process (-> this jak-white)) 'eval (lambda :behavior sage-finalboss () (set-vector! (-> self draw color-emissive) 0.5 0.5 0.5 0.0) (none)) ) - (send-event (handle->process (-> obj jak-white)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj jak-white)) 'origin-joint-index 3) - (send-event (handle->process (-> obj jak-white)) 'blend-shape #t) - (set! (-> obj robotboss) + (send-event (handle->process (-> this jak-white)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this jak-white)) 'origin-joint-index 3) + (send-event (handle->process (-> this jak-white)) 'blend-shape #t) + (set! (-> this robotboss) (ppointer->handle - (manipy-spawn (-> obj root-override trans) (-> obj entity) *robotboss-cinematic-sg* #f :to obj) + (manipy-spawn (-> this root-override trans) (-> this entity) *robotboss-cinematic-sg* #f :to this) ) ) - (send-event (handle->process (-> obj robotboss)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj robotboss)) 'origin-joint-index 3) - (let ((v1-67 (handle->process (-> obj robotboss)))) + (send-event (handle->process (-> this robotboss)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this robotboss)) 'origin-joint-index 3) + (let ((v1-67 (handle->process (-> this robotboss)))) (if (the-as manipy v1-67) (set! (-> (the-as manipy v1-67) draw bounds w) 2048000.0) ) ) - (set! (-> obj silodoor) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *silodoor-sg* #f :to obj)) + (set! (-> this silodoor) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *silodoor-sg* #f :to this)) ) - (send-event (handle->process (-> obj silodoor)) 'anim-mode 'clone-anim) - (let ((v1-84 (handle->process (-> obj silodoor)))) + (send-event (handle->process (-> this silodoor)) 'anim-mode 'clone-anim) + (let ((v1-84 (handle->process (-> this silodoor)))) (if (the-as manipy v1-84) (set! (-> (the-as silodoor v1-84) draw bounds w) 2048000.0) ) @@ -441,22 +441,22 @@ ) (((task-status need-reminder-a)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) 0.0) - (close-current! (-> obj tasks)) - (play-reminder obj) - (process-taskable-method-45 obj) - (set! (-> obj kick-the-credits) #t) - (set! (-> obj robotplat) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) 0.0) + (close-current! (-> this tasks)) + (play-reminder this) + (process-taskable-method-45 this) + (set! (-> this kick-the-credits) #t) + (set! (-> this robotplat) (ppointer->handle - (manipy-spawn (-> obj root-override trans) (-> obj entity) *plat-eco-finalboss-lit-sg* #f :to obj) + (manipy-spawn (-> this root-override trans) (-> this entity) *plat-eco-finalboss-lit-sg* #f :to this) ) ) - (send-event (handle->process (-> obj robotplat)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj robotplat)) 'origin-joint-index 3) - (set! (-> obj old-target-pos trans quad) + (send-event (handle->process (-> this robotplat)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this robotplat)) 'origin-joint-index 3) + (set! (-> this old-target-pos trans quad) (-> (new 'static 'vector :x 11368946.0 :y 2215900.2 :z -19405602.0 :w 1.0) quad) ) - (quaternion-copy! (-> obj old-target-pos quat) (new 'static 'quaternion :y -0.8472 :w 0.5312)) + (quaternion-copy! (-> this old-target-pos quat) (new 'static 'quaternion :y -0.8472 :w 0.5312)) (set-setting! 'music #f 0.0 0) (set-setting! 'sfx-volume 'abs 0.0 0) (set-setting! 'ambient-volume 'abs 0.0 0) @@ -496,9 +496,9 @@ ) (((task-status need-reminder)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) - (close-current! (-> obj tasks)) - (process-taskable-method-45 obj) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) -13116.667) + (close-current! (-> this tasks)) + (process-taskable-method-45 this) (send-event *camera* 'teleport) (set-setting! 'allow-progress #f 0.0 0) ) @@ -544,11 +544,11 @@ ) (((task-status need-reward-speech)) (when arg0 - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) -13116.667) - (close-current! (-> obj tasks)) - (process-taskable-method-45 obj) - (set! (-> obj left-door) (the-as entity-actor (entity-by-name "power-left-2"))) - (set! (-> obj right-door) (the-as entity-actor (entity-by-name "power-right-2"))) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) -13116.667) + (close-current! (-> this tasks)) + (process-taskable-method-45 this) + (set! (-> this left-door) (the-as entity-actor (entity-by-name "power-left-2"))) + (set! (-> this right-door) (the-as entity-actor (entity-by-name "power-right-2"))) (set-setting! 'allow-progress #f 0.0 0) ) (new 'static 'spool-anim @@ -575,18 +575,18 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) ;; definition for method 31 of type sage-finalboss -(defmethod get-art-elem sage-finalboss ((obj sage-finalboss)) - (-> obj draw art-group data 4) +(defmethod get-art-elem sage-finalboss ((this sage-finalboss)) + (-> this draw art-group data 4) ) ;; definition for function sage-finalboss-credit-particle @@ -968,11 +968,11 @@ ((paused?) ) ((and (< 1300.0 f30-0) (cpad-hold? 0 circle x)) - (set! f28-0 (seek f28-0 16.0 (* 4.0 (-> *display* seconds-per-frame)))) + (set! f28-0 (seek f28-0 16.0 (* 4.0 (seconds-per-frame)))) (+! f30-0 (* f28-0 (-> *display* time-adjust-ratio))) ) (else - (set! f28-0 (seek f28-0 0.5 (* 16.0 (-> *display* seconds-per-frame)))) + (set! f28-0 (seek f28-0 0.5 (* 16.0 (seconds-per-frame)))) (+! f30-0 (* f28-0 (-> *display* time-adjust-ratio))) ) ) @@ -988,8 +988,8 @@ (remove-setting! 'music) (apply-settings *setting-control*) (set-blackout-frames (seconds 0.05)) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 0.05)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.05)) (suspend) ) ) @@ -998,7 +998,7 @@ ) ;; definition for method 39 of type sage-finalboss -(defmethod should-display? sage-finalboss ((obj sage-finalboss)) +(defmethod should-display? sage-finalboss ((this sage-finalboss)) #f ) @@ -1066,43 +1066,43 @@ ;; definition for method 11 of type sage-finalboss ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sage-finalboss ((obj sage-finalboss) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sage-finalboss-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task finalboss-movies))) - (set! (-> obj redsage) (the-as handle #f)) - (set! (-> obj bluesage) (the-as handle #f)) - (set! (-> obj yellowsage) (the-as handle #f)) - (set! (-> obj assistant) (the-as handle #f)) - (set! (-> obj robotplat) (the-as handle #f)) - (set! (-> obj robotboss) (the-as handle #f)) - (set! (-> obj jak-white) (the-as handle #f)) - (set! (-> obj silodoor) (the-as handle #f)) - (set! (-> obj left-door) #f) - (set! (-> obj right-door) #f) - (set! (-> obj kick-in-the-door) #f) - (set! (-> obj kick-the-credits) #f) - (set! (-> obj credits-played) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 682) obj)) - (set! (-> obj part matrix) (sprite-allocate-user-hvdf)) - (set! (-> obj particle-whiteout) (create-launch-control (-> *part-group-id-table* 706) obj)) - (set! (-> obj particle-whiteout matrix) (sprite-allocate-user-hvdf)) - (set! (-> obj particle 0 part) (create-launch-control (-> *part-group-id-table* 699) obj)) - (set! (-> obj particle 1 part) (create-launch-control (-> *part-group-id-table* 700) obj)) - (set! (-> obj particle 2 part) (create-launch-control (-> *part-group-id-table* 701) obj)) - (set! (-> obj particle 3 part) (create-launch-control (-> *part-group-id-table* 702) obj)) - (set! (-> obj particle 7 part) (create-launch-control (-> *part-group-id-table* 645) obj)) - (set! (-> obj particle 4 part) (create-launch-control (-> *part-group-id-table* 703) obj)) - (set! (-> obj particle 5 part) (create-launch-control (-> *part-group-id-table* 696) obj)) - (set! (-> obj particle 6 part) (create-launch-control (-> *part-group-id-table* 704) obj)) - (set! (-> obj particle 8 part) (create-launch-control (-> *part-group-id-table* 698) obj)) +(defmethod init-from-entity! sage-finalboss ((this sage-finalboss) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sage-finalboss-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task finalboss-movies))) + (set! (-> this redsage) (the-as handle #f)) + (set! (-> this bluesage) (the-as handle #f)) + (set! (-> this yellowsage) (the-as handle #f)) + (set! (-> this assistant) (the-as handle #f)) + (set! (-> this robotplat) (the-as handle #f)) + (set! (-> this robotboss) (the-as handle #f)) + (set! (-> this jak-white) (the-as handle #f)) + (set! (-> this silodoor) (the-as handle #f)) + (set! (-> this left-door) #f) + (set! (-> this right-door) #f) + (set! (-> this kick-in-the-door) #f) + (set! (-> this kick-the-credits) #f) + (set! (-> this credits-played) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 682) this)) + (set! (-> this part matrix) (sprite-allocate-user-hvdf)) + (set! (-> this particle-whiteout) (create-launch-control (-> *part-group-id-table* 706) this)) + (set! (-> this particle-whiteout matrix) (sprite-allocate-user-hvdf)) + (set! (-> this particle 0 part) (create-launch-control (-> *part-group-id-table* 699) this)) + (set! (-> this particle 1 part) (create-launch-control (-> *part-group-id-table* 700) this)) + (set! (-> this particle 2 part) (create-launch-control (-> *part-group-id-table* 701) this)) + (set! (-> this particle 3 part) (create-launch-control (-> *part-group-id-table* 702) this)) + (set! (-> this particle 7 part) (create-launch-control (-> *part-group-id-table* 645) this)) + (set! (-> this particle 4 part) (create-launch-control (-> *part-group-id-table* 703) this)) + (set! (-> this particle 5 part) (create-launch-control (-> *part-group-id-table* 696) this)) + (set! (-> this particle 6 part) (create-launch-control (-> *part-group-id-table* 704) this)) + (set! (-> this particle 8 part) (create-launch-control (-> *part-group-id-table* 698) this)) (dotimes (v1-37 9) - (set! (-> obj particle v1-37 active) #f) + (set! (-> this particle v1-37 active) #f) ) - (set! (-> obj palette-val) 0.0) - (+! (-> obj root-override trans y) 2048.0) - (if (not (should-display? obj)) - (go (method-of-object obj hidden)) - (go (method-of-object obj idle)) + (set! (-> this palette-val) 0.0) + (+! (-> this root-override trans y) 2048.0) + (if (not (should-display? this)) + (go (method-of-object this hidden)) + (go (method-of-object this idle)) ) (none) ) diff --git a/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc b/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc index 8981cb0172..d31d88afdd 100644 --- a/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc +++ b/test/decompiler/reference/jak1/levels/firecanyon/assistant-firecanyon_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type assistant-firecanyon -(defmethod inspect assistant-firecanyon ((obj assistant-firecanyon)) +(defmethod inspect assistant-firecanyon ((this assistant-firecanyon)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -26,11 +26,11 @@ ) ;; definition for method 32 of type assistant-firecanyon -(defmethod play-anim! assistant-firecanyon ((obj assistant-firecanyon) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! assistant-firecanyon ((this assistant-firecanyon) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (if arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "assistant-firecanyon-resolution" @@ -57,20 +57,20 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 31 of type assistant-firecanyon -(defmethod get-art-elem assistant-firecanyon ((obj assistant-firecanyon)) - (if (= (current-status (-> obj tasks)) (task-status invalid)) - (-> obj draw art-group data 8) - (-> obj draw art-group data 3) +(defmethod get-art-elem assistant-firecanyon ((this assistant-firecanyon)) + (if (= (current-status (-> this tasks)) (task-status invalid)) + (-> this draw art-group data 8) + (-> this draw art-group data 3) ) ) @@ -84,7 +84,7 @@ #t ) (else - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) ) @@ -92,7 +92,7 @@ (not (movie?)) (not (level-hint-displayed?)) (not (and *cheat-mode* (cpad-hold? 0 l3))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) + (not (time-elapsed? (-> self state-time) (seconds 10))) ) ) (hide-hud) @@ -256,16 +256,16 @@ ) ;; definition for method 39 of type assistant-firecanyon -(defmethod should-display? assistant-firecanyon ((obj assistant-firecanyon)) - (first-any (-> obj tasks) #t) - (= (current-status (-> obj tasks)) (task-status need-reward-speech)) +(defmethod should-display? assistant-firecanyon ((this assistant-firecanyon)) + (first-any (-> this tasks) #t) + (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) ;; definition for method 11 of type assistant-firecanyon -(defmethod init-from-entity! assistant-firecanyon ((obj assistant-firecanyon) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-firecanyon-sg* 3 29 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task firecanyon-assistant))) - (first-any (-> obj tasks) #t) - (process-taskable-method-42 obj) +(defmethod init-from-entity! assistant-firecanyon ((this assistant-firecanyon) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-firecanyon-sg* 3 29 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task firecanyon-assistant))) + (first-any (-> this tasks) #t) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc index fc975f37f3..725b094197 100644 --- a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-obs_REF.gc @@ -16,11 +16,11 @@ ) ;; definition for method 3 of type balloon -(defmethod inspect balloon ((obj balloon)) +(defmethod inspect balloon ((this balloon)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -143,8 +143,8 @@ ;; definition for method 11 of type balloon ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! balloon ((obj balloon) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! balloon ((this balloon) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -154,11 +154,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *balloon-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 227) obj)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *balloon-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 227) this)) (go balloon-idle) (none) ) @@ -180,12 +180,12 @@ ) ;; definition for method 3 of type spike -(defmethod inspect spike ((obj spike)) +(defmethod inspect spike ((this spike)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tnum-alts: ~D~%" (-> obj num-alts)) - obj + (format #t "~T~Tnum-alts: ~D~%" (-> this num-alts)) + this ) ;; failed to figure out what this is: @@ -323,8 +323,8 @@ ;; definition for method 11 of type spike ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! spike ((obj spike) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! spike ((this spike) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -372,13 +372,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *spike-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj num-alts) (entity-actor-count (-> obj entity) 'alt-actor)) - (if (zero? (-> obj num-alts)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *spike-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (set! (-> this num-alts) (entity-actor-count (-> this entity) 'alt-actor)) + (if (zero? (-> this num-alts)) (go spike-down) (go spike-idle) ) @@ -406,11 +406,11 @@ ) ;; definition for method 3 of type crate-darkeco-cluster -(defmethod inspect crate-darkeco-cluster ((obj crate-darkeco-cluster)) +(defmethod inspect crate-darkeco-cluster ((this crate-darkeco-cluster)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -651,8 +651,8 @@ ;; definition for method 11 of type crate-darkeco-cluster ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! crate-darkeco-cluster ((obj crate-darkeco-cluster) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! crate-darkeco-cluster ((this crate-darkeco-cluster) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind crate)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -664,10 +664,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *crate-darkeco-cluster-sg* '()) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *crate-darkeco-cluster-sg* '()) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-part_REF.gc b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-part_REF.gc index b71aea1e48..7fbe7d09c9 100644 --- a/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/firecanyon/firecanyon-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type firecanyon-part -(defmethod inspect firecanyon-part ((obj firecanyon-part)) +(defmethod inspect firecanyon-part ((this firecanyon-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc b/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc index c9be0932d5..c27700d3cd 100644 --- a/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc +++ b/test/decompiler/reference/jak1/levels/flut_common/flutflut_REF.gc @@ -33,30 +33,30 @@ ) ;; definition for method 3 of type flutflut -(defmethod inspect flutflut ((obj flutflut)) +(defmethod inspect flutflut ((this flutflut)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Textra-trans: ~`vector`P~%" (-> obj extra-trans)) - (format #t "~T~Tcondition: ~D~%" (-> obj condition)) - (format #t "~T~Tauto-get-off: ~A~%" (-> obj auto-get-off)) - (format #t "~T~Tcell: ~D~%" (-> obj cell)) - (format #t "~T~Tpath-data[2] @ #x~X~%" (-> obj path-data)) - (format #t "~T~Tpath-target: ~A~%" (-> obj path-target)) - (format #t "~T~Tpath-flut: ~A~%" (-> obj path-flut)) - (format #t "~T~Ttouch-time: ~D~%" (-> obj touch-time)) - obj + (format #t "~T~Textra-trans: ~`vector`P~%" (-> this extra-trans)) + (format #t "~T~Tcondition: ~D~%" (-> this condition)) + (format #t "~T~Tauto-get-off: ~A~%" (-> this auto-get-off)) + (format #t "~T~Tcell: ~D~%" (-> this cell)) + (format #t "~T~Tpath-data[2] @ #x~X~%" (-> this path-data)) + (format #t "~T~Tpath-target: ~A~%" (-> this path-target)) + (format #t "~T~Tpath-flut: ~A~%" (-> this path-flut)) + (format #t "~T~Ttouch-time: ~D~%" (-> this touch-time)) + this ) ;; definition for method 7 of type flutflut ;; INFO: Return type mismatch process-drawable vs flutflut. -(defmethod relocate flutflut ((obj flutflut) (arg0 int)) +(defmethod relocate flutflut ((this flutflut) (arg0 int)) (countdown (v1-0 2) - (if (-> obj path-data v1-0) - (&+! (-> obj path-data v1-0) arg0) + (if (-> this path-data v1-0) + (&+! (-> this path-data v1-0) arg0) ) ) - (the-as flutflut ((method-of-type process-drawable relocate) obj arg0)) + (the-as flutflut ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for symbol *flutflut-shadow-control*, type shadow-control @@ -102,7 +102,7 @@ ) ) (('touch 'attack) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) #f ) ) @@ -146,7 +146,7 @@ ) (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)) - (< (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 0.05)) + (not (time-elapsed? (-> self touch-time) (seconds 0.05))) ) (go-virtual pickup (method-of-object self idle)) ) @@ -280,8 +280,8 @@ (flutflut-effect) (suspend) ) - (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 1)) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 1)) (flutflut-effect) (suspend) ) @@ -320,8 +320,8 @@ ;; definition for method 11 of type flutflut ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! flutflut ((obj flutflut) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! flutflut ((this flutflut) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -335,46 +335,46 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (res-lump-float arg0 'rotoffset)) - (initialize-skeleton obj *flutflut-sg* '()) - (logior! (-> obj skel status) (janim-status eye)) - (set! (-> obj draw shadow-ctrl) *flutflut-shadow-control*) - (let ((v1-24 (-> obj node-list data))) + (process-drawable-from-entity! this arg0) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) (res-lump-float arg0 'rotoffset)) + (initialize-skeleton this *flutflut-sg* '()) + (logior! (-> this skel status) (janim-status eye)) + (set! (-> this draw shadow-ctrl) *flutflut-shadow-control*) + (let ((v1-24 (-> this node-list data))) (set! (-> v1-24 0 param0) cspace<-transformq+trans!) - (set! (-> v1-24 0 param1) (the-as basic (-> obj root-override trans))) - (set! (-> v1-24 0 param2) (the-as basic (-> obj extra-trans))) + (set! (-> v1-24 0 param1) (the-as basic (-> this root-override trans))) + (set! (-> v1-24 0 param2) (the-as basic (-> this extra-trans))) ) (dotimes (s4-2 2) - (let ((v1-27 (new 'process 'curve-control obj 'path (the float (+ s4-2 1))))) - (set! (-> obj path-data s4-2) v1-27) + (let ((v1-27 (new 'process 'curve-control this 'path (the float (+ s4-2 1))))) + (set! (-> this path-data s4-2) v1-27) (if v1-27 (logior! (-> v1-27 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) ) - (set! (-> obj condition) (res-lump-value arg0 'index int)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this condition) (res-lump-value arg0 'index int)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 120) obj)) - (set! (-> obj auto-get-off) #f) - (move-to-ground (-> obj root-override) 40960.0 40960.0 #t (collide-kind background)) - (set! (-> obj cell) (the-as handle #f)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 120) this)) + (set! (-> this auto-get-off) #f) + (move-to-ground (-> this root-override) 40960.0 40960.0 #t (collide-kind background)) + (set! (-> this cell) (the-as handle #f)) (blocking-plane-spawn (the-as curve-control (if (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action flut))) - (-> obj path-flut) - (-> obj path-target) + (-> this path-flut) + (-> this path-target) ) ) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> obj root-override trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root-override trans)) ) - (go (method-of-object obj wait-for-start)) + (go (method-of-object this wait-for-start)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc index ffc53152d7..5272c6d1af 100644 --- a/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc +++ b/test/decompiler/reference/jak1/levels/flut_common/target-flut_REF.gc @@ -16,15 +16,15 @@ ) ;; definition for method 3 of type flut-info -(defmethod inspect flut-info ((obj flut-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tflut-trans: ~`vector`P~%" (-> obj flut-trans)) - (format #t "~Tflut-quat: ~`vector`P~%" (-> obj flut-quat)) - (format #t "~Tflut-scale: ~`vector`P~%" (-> obj flut-scale)) - (format #t "~Tstick-lock: ~A~%" (-> obj stick-lock)) - (format #t "~Tflap-sound-id: ~D~%" (-> obj flap-sound-id)) - obj +(defmethod inspect flut-info ((this flut-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tflut-trans: ~`vector`P~%" (-> this flut-trans)) + (format #t "~Tflut-quat: ~`vector`P~%" (-> this flut-quat)) + (format #t "~Tflut-scale: ~`vector`P~%" (-> this flut-scale)) + (format #t "~Tstick-lock: ~A~%" (-> this stick-lock)) + (format #t "~Tflap-sound-id: ~D~%" (-> this flap-sound-id)) + this ) ;; definition of type flut-bank @@ -42,15 +42,15 @@ ) ;; definition for method 3 of type flut-bank -(defmethod inspect flut-bank ((obj flut-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tjump-height-min: (meters ~m)~%" (-> obj jump-height-min)) - (format #t "~Tjump-height-max: (meters ~m)~%" (-> obj jump-height-max)) - (format #t "~Tdouble-jump-height-min: (meters ~m)~%" (-> obj double-jump-height-min)) - (format #t "~Tdouble-jump-height-max: (meters ~m)~%" (-> obj double-jump-height-max)) - (format #t "~Tair-attack-speed: (meters ~m)~%" (-> obj air-attack-speed)) - (format #t "~Tground-timeout: ~D~%" (-> obj ground-timeout)) - obj +(defmethod inspect flut-bank ((this flut-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) + (format #t "~Tjump-height-max: (meters ~m)~%" (-> this jump-height-max)) + (format #t "~Tdouble-jump-height-min: (meters ~m)~%" (-> this double-jump-height-min)) + (format #t "~Tdouble-jump-height-max: (meters ~m)~%" (-> this double-jump-height-max)) + (format #t "~Tair-attack-speed: (meters ~m)~%" (-> this air-attack-speed)) + (format #t "~Tground-timeout: ~D~%" (-> this ground-timeout)) + this ) ;; definition for symbol *FLUT-bank*, type flut-bank @@ -565,7 +565,7 @@ (go target-flut-running-attack) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (and (time-elapsed? (-> self control unknown-dword11) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-37 (ja-group))) (or (not (or (= v1-37 (-> self draw art-group data 59)) @@ -628,7 +628,7 @@ (defstate target-flut-walk (target) :event target-flut-standard-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *flut-walk-mods*) (set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-surface00 turnv))) (set! (-> self control unknown-int21) (the-as int (-> self control unknown-surface00 target-speed))) @@ -657,7 +657,7 @@ (go target-flut-running-attack) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (and (time-elapsed? (-> self control unknown-dword11) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-37 (ja-group))) (or (not (or (= v1-37 (-> self draw art-group data 59)) @@ -685,12 +685,12 @@ (seek! (-> self control unknown-surface00 target-speed) (the-as float 4096.0) - (* 245760.0 (-> *display* seconds-per-frame)) + (* 245760.0 (seconds-per-frame)) ) (seek! (-> self control unknown-surface00 target-speed) (the-as float (-> self control unknown-uint30)) - (* 81920.0 (-> *display* seconds-per-frame)) + (* 81920.0 (seconds-per-frame)) ) ) ) @@ -753,7 +753,7 @@ ) ) ) - (set! f30-0 (seek f30-0 f0-13 (* 4.0 (-> *display* seconds-per-frame)))) + (set! f30-0 (seek f30-0 f0-13 (* 4.0 (seconds-per-frame)))) ) (set! (-> self skel root-channel 1 frame-interp) f30-0) (let* ((f0-16 (current-cycle-distance (-> self skel))) @@ -817,7 +817,7 @@ ) ) :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sound-play "jump" :pitch -0.5) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) @@ -855,9 +855,7 @@ (if (and (cpad-pressed? (-> self control unknown-cpad-info00 number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 61440.0) (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) @@ -866,7 +864,7 @@ (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (and (time-elapsed? (-> self state-time) (seconds 0.1)) (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) ) @@ -881,7 +879,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 float) (arg1 float)) @@ -945,7 +943,7 @@ (defstate target-flut-double-jump (target) :event (-> target-flut-jump event) :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv)) (set! (-> self control dynam gravity-max) 40960.0) (set! (-> self control dynam gravity-length) 245760.0) @@ -972,15 +970,13 @@ (and (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control unknown-surface01 flags) (surface-flags prevent-attacks-during-launch-jump surf08)) ) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (time-elapsed? (-> self control unknown-dword36) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (< 4096.0 (target-height-above-ground)) ) ) (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) ) - (if (!= (-> self state-time) (-> *display* base-frame-counter)) + (if (!= (-> self state-time) (current-time)) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) x) (-> self control transv)) ) (if (ja-group? (-> self draw art-group data 149)) @@ -989,7 +985,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 float) (arg1 float)) @@ -1022,15 +1018,15 @@ (seek! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max) - (* 163840.0 (-> *display* seconds-per-frame)) + (* 163840.0 (seconds-per-frame)) ) (seek! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length) - (* 163840.0 (-> *display* seconds-per-frame)) + (* 163840.0 (seconds-per-frame)) ) ) - (-> *display* base-frame-counter) + (current-time) (ja-channel-push! 2 (seconds 0.1)) (ja-no-eval :group! (-> self draw art-group data 144) :num! (loop!) :frame-num 0.0) (ja :chan 1 @@ -1043,12 +1039,12 @@ (seek! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max) - (* 163840.0 (-> *display* seconds-per-frame)) + (* 163840.0 (seconds-per-frame)) ) (seek! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length) - (* 163840.0 (-> *display* seconds-per-frame)) + (* 163840.0 (seconds-per-frame)) ) (ja :num! (loop! max)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122)) @@ -1086,7 +1082,7 @@ (go target-flut-walk) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (and (time-elapsed? (-> self control unknown-dword11) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-34 (ja-group))) (or (not (or (= v1-34 (-> self draw art-group data 59)) @@ -1116,15 +1112,13 @@ :event (-> target-flut-jump event) :enter (behavior ((arg0 symbol)) (set! (-> self control unknown-surface00) *flut-jump-mods*) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (-> target-flut-start exit) :trans (behavior () (when (or (logtest? (-> self control status) (cshape-moving-flags onsurf)) (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (/ (the-as int (-> *TARGET-bank* stuck-time)) 2) - ) + (and (time-elapsed? (-> self state-time) (/ (the-as int (-> *TARGET-bank* stuck-time)) 2)) (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) ) @@ -1137,7 +1131,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 symbol)) @@ -1187,7 +1181,7 @@ ) ) (when gp-1 - (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) + (set! (-> self control unknown-uint20) (the-as uint (current-time))) (let ((v1-9 (if (and (nonzero? proc) (type-type? (-> proc type) process-drawable)) proc ) @@ -1211,7 +1205,7 @@ ) ) (when (or (= gp-1 'die) (= gp-1 'push)) - (let ((v0-2 (the-as object (-> *display* base-frame-counter)))) + (let ((v0-2 (the-as object (current-time)))) (set! (-> self control unknown-int21) (the-as int v0-2)) v0-2 ) @@ -1230,7 +1224,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-uint20) (the-as uint 0)) (set! (-> self control unknown-int21) 0) (set! (-> self control unknown-uint31) (the-as uint 0)) @@ -1242,7 +1236,7 @@ (when (and (and (= (-> self fact-info-target eco-type) (pickup-type eco-yellow)) (>= (-> self fact-info-target eco-level) 1.0) ) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.25)) + (time-elapsed? (-> self control unknown-dword82) (seconds 0.25)) ) (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 32))) @@ -1264,7 +1258,7 @@ :to self ) ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword82)) ) ) :exit (behavior () @@ -1272,18 +1266,18 @@ (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) - (set! (-> self control unknown-dword31) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword31)) (target-exit) ) :trans (behavior () - (when (!= (-> self state-time) (-> *display* base-frame-counter)) + (when (!= (-> self state-time) (current-time)) (if (and (or (smack-surface? #t) (and (>= (-> self control unknown-float63) 0.7) (not (logtest? (-> self control status) (cshape-moving-flags t-act))) ) ) (begin - (set! (-> self control unknown-int21) (the-as int (-> *display* base-frame-counter))) + (set! (-> self control unknown-int21) (the-as int (current-time))) (set! (-> self control unknown-float81) 0.0) (let ((gp-0 (new-stack-vector0)) (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -1304,16 +1298,14 @@ #t ) (or (zero? (-> self control unknown-uint20)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.04)) ) (!= (-> self control unknown-uint31) 1) ) (target-shoved (meters 2) (-> *TARGET-bank* smack-surface-height) (the-as process #f) target-flut-hit) ) (if (and (logtest? (-> self water flags) (water-flags wt09)) - (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) + (zero? (mod (- (current-time) (-> self state-time)) 21)) ) (create-splash (-> self water) @@ -1332,7 +1324,7 @@ (set! (-> self control dynam gravity-max) 368640.0) (set! (-> self control dynam gravity-length) 368640.0) (let ((f28-0 0.0) - (f30-0 (the-as float (if (= (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (f30-0 (the-as float (if (= (-> self control unknown-dword82) (current-time)) 0.2 0.8 ) @@ -1345,7 +1337,7 @@ (cond ((and (>= (ja-aframe-num 0) 20.0) (and (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-39 (ja-group))) (or (not (or (= v1-39 (-> self draw art-group data 59)) @@ -1357,17 +1349,13 @@ ) ) ) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint20)) (seconds 0.04)) ) ) (go target-flut-falling #f) ) ((and (nonzero? (-> self control unknown-uint30)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) - (the-as uint 12) - ) + (time-elapsed? (the-as int (-> self control unknown-uint30)) (seconds 0.04)) ) (set-forward-vel (the-as float 0.0)) (set! f30-0 0.0) @@ -1390,15 +1378,15 @@ ) (suspend) (ja :num! (seek! max (-> self control unknown-surface01 align-speed))) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *flut-run-attack-mods* turnvv) 0.0) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! f30-0 (* f30-0 (the-as float (fmin 1.0 (the-as float (-> self control unknown-float140)))))) ) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (time-elapsed? (-> self control unknown-dword11) (-> *FLUT-bank* ground-timeout)) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (let ((v1-105 (ja-group))) (or (not (or (= v1-105 (-> self draw art-group data 59)) @@ -1460,7 +1448,7 @@ ) :enter (behavior ((arg0 float)) (set-forward-vel arg0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *flut-air-attack-mods*) (target-start-attack) @@ -1516,7 +1504,7 @@ (go target-flut-air-attack-hit-ground) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) 4096.0) - (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (and (time-elapsed? (-> self state-time) (seconds 0.5)) (not (and *cheat-mode* (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) ) @@ -1587,7 +1575,7 @@ (seek! (-> arg0 collide-info root-prim local-sphere w) (the-as float 28672.0) - (* 286720.0 (-> *display* seconds-per-frame)) + (* 286720.0 (seconds-per-frame)) ) (update-transforms! (-> arg0 collide-info)) (none) @@ -1644,7 +1632,7 @@ ) ) :code (behavior ((arg0 symbol) (arg1 attack-info)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((v1-2 gp-0)) @@ -1689,7 +1677,7 @@ ) (when (= arg0 'attack) (logior! (-> self state-flags) (state-flags being-attacked)) - (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('endlessfall) (cond @@ -1697,8 +1685,8 @@ (let ((s4-1 (new-stack-vector0))) (set! (-> s4-1 quad) (-> self control last-known-safe-ground quad)) (ja-channel-set! 0) - (let ((s3-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s3-1) (seconds 1)) + (let ((s3-1 (current-time))) + (until (time-elapsed? s3-1 (seconds 1)) (suspend) ) ) @@ -1825,10 +1813,10 @@ ) ) ) - (let ((gp-4 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-4) (seconds 1)) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 1)) (target-flut-falling-anim-trans) - (vector-seek! (-> self draw color-mult) *zero-vector* (-> *display* seconds-per-frame)) + (vector-seek! (-> self draw color-mult) *zero-vector* (seconds-per-frame)) (let ((s5-2 (new-stack-vector0)) (f30-1 (the-as number (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) ) @@ -1876,10 +1864,10 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (until v1-104 (suspend) - (set! v1-104 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (movie?)))) + (set! v1-104 (and (time-elapsed? (-> self state-time) (seconds 1)) (not (movie?)))) ) (go target-flut-stance) ) @@ -1894,7 +1882,7 @@ (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self alt-cam-pos quad) (-> (&-> (-> self control) unknown-qword00) 0)) (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1947,20 +1935,14 @@ ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) - (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (current-time) (-> self state-time)))))) ) (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) (set! (-> gp-0 y) (lerp (-> self control unknown-vector102 y) (-> self control unknown-vector103 y) - (fmax - 0.0 - (fmin - 1.0 - (* 0.006666667 (the float (+ (- (the-as int (-> self state-time))) (-> *display* base-frame-counter)))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (+ (- (the-as int (-> self state-time))) (current-time)))))) ) ) (move-to-point! (-> self control) gp-0) @@ -1984,7 +1966,7 @@ (let ((s5-0 0)) (while (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) (target-flut-falling-anim-trans) - (+! s5-0 (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) + (+! s5-0 (- (current-time) (-> *display* old-base-frame-counter))) (suspend) ) ) @@ -2001,7 +1983,7 @@ :event target-generic-event-handler :exit (-> target-flut-start exit) :code (behavior ((arg0 handle)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) @@ -2056,23 +2038,15 @@ ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) - (f30-0 - (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) - ) + (f30-0 (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (current-time) (-> self state-time))))))) ) - (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (fmax 0.0 (fmin 1.0 (* 0.006666667 (the float (- (current-time) (-> self state-time)))))) (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) (set! (-> gp-0 y) (lerp (-> self control unknown-vector102 y) (-> self control unknown-vector103 y) - (fmax - 0.0 - (fmin - 1.0 - (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (-> *display* base-frame-counter)))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (current-time)))))) ) ) (move-to-point! (-> self control) gp-0) diff --git a/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc b/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc index 6e89896a47..a33dfca0af 100644 --- a/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc +++ b/test/decompiler/reference/jak1/levels/intro/evilbro_REF.gc @@ -12,12 +12,12 @@ ) ;; definition for method 3 of type evilbro -(defmethod inspect evilbro ((obj evilbro)) +(defmethod inspect evilbro ((this evilbro)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tevilsis: ~A~%" (-> obj evilsis)) - obj + (format #t "~T~Tevilsis: ~A~%" (-> this evilsis)) + this ) ;; failed to figure out what this is: @@ -29,22 +29,22 @@ ;; definition for method 32 of type evilbro ;; INFO: Return type mismatch spool-anim vs basic. -(defmethod play-anim! evilbro ((obj evilbro) (arg0 symbol)) +(defmethod play-anim! evilbro ((this evilbro) (arg0 symbol)) (cond (arg0 (close-specific-task! (game-task leaving-misty) (task-status need-introduction)) - (send-event (-> obj evilsis extra process) 'clone (process->handle obj)) + (send-event (-> this evilsis extra process) 'clone (process->handle this)) ) (else - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) ) (the-as basic (new 'static 'spool-anim :name "evilbro-misty-end" :index 5 :parts 9 :command-list '())) ) ;; definition for method 31 of type evilbro -(defmethod get-art-elem evilbro ((obj evilbro)) - (-> obj draw art-group data 3) +(defmethod get-art-elem evilbro ((this evilbro)) + (-> this draw art-group data 3) ) ;; failed to figure out what this is: @@ -69,8 +69,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (while (let ((s5-0 (-> *display* base-frame-counter)) + (let ((gp-0 (current-time))) + (while (let ((s5-0 (current-time)) (f30-0 300.0) (f28-0 0.16) (f26-0 0.17000002) @@ -85,8 +85,8 @@ (suspend) (ja :num! (seek! (ja-aframe 0.0 0))) ) - (let ((gp-3 (-> *display* base-frame-counter))) - (while (let ((s5-1 (-> *display* base-frame-counter)) + (let ((gp-3 (current-time))) + (while (let ((s5-1 (current-time)) (f30-1 300.0) (f28-1 0.16) (f26-1 0.17000002) @@ -101,11 +101,11 @@ ) ;; definition for method 11 of type evilbro -(defmethod init-from-entity! evilbro ((obj evilbro) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *evilbro-intro-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task leaving-misty))) - (set! (-> obj evilsis) (entity-actor-lookup arg0 'alt-actor 0)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! evilbro ((this evilbro) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *evilbro-intro-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task leaving-misty))) + (set! (-> this evilsis) (entity-actor-lookup arg0 'alt-actor 0)) + (process-taskable-method-42 this) (none) ) @@ -119,11 +119,11 @@ ) ;; definition for method 3 of type evilsis -(defmethod inspect evilsis ((obj evilsis)) +(defmethod inspect evilsis ((this evilsis)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -135,21 +135,21 @@ ;; definition for method 32 of type evilsis ;; INFO: Return type mismatch art-element vs basic. -(defmethod play-anim! evilsis ((obj evilsis) (arg0 symbol)) +(defmethod play-anim! evilsis ((this evilsis) (arg0 symbol)) (if arg0 (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (the-as basic (get-art-elem obj)) + (the-as basic (get-art-elem this)) ) ;; definition for method 31 of type evilsis -(defmethod get-art-elem evilsis ((obj evilsis)) - (-> obj draw art-group data 3) +(defmethod get-art-elem evilsis ((this evilsis)) + (-> this draw art-group data 3) ) ;; failed to figure out what this is: @@ -162,9 +162,9 @@ ) ;; definition for method 11 of type evilsis -(defmethod init-from-entity! evilsis ((obj evilsis) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *evilsis-intro-sg* 3 0 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task leaving-misty))) - (process-taskable-method-42 obj) +(defmethod init-from-entity! evilsis ((this evilsis) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *evilsis-intro-sg* 3 0 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task leaving-misty))) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc b/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc index c17559e2ad..174a77d7e3 100644 --- a/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/bouncer_REF.gc @@ -18,13 +18,13 @@ ) ;; definition for method 3 of type springbox -(defmethod inspect springbox ((obj springbox)) +(defmethod inspect springbox ((this springbox)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspring-height: (meters ~m)~%" (-> obj spring-height)) - (format #t "~T~Tsmush: ~f~%" (-> obj smush)) - obj + (format #t "~T~Tspring-height: (meters ~m)~%" (-> this spring-height)) + (format #t "~T~Tsmush: ~f~%" (-> this smush)) + this ) ;; failed to figure out what this is: @@ -74,7 +74,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('touch) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) (else @@ -83,10 +83,10 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self smush) 0.0) (loop - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) (ja :num! (seek! 0.0 0.1)) (ja :num! (seek! (lerp-scale @@ -125,8 +125,8 @@ ;; definition for method 11 of type springbox ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! springbox ((obj springbox) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! springbox ((this springbox) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -143,12 +143,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *bouncer-sg* '()) - (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) - (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *bouncer-sg* '()) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) (go bouncer-wait) (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc index 1f74c4c097..ef81c525f1 100644 --- a/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/darkvine_REF.gc @@ -24,31 +24,31 @@ ) ;; definition for method 3 of type darkvine -(defmethod inspect darkvine ((obj darkvine)) +(defmethod inspect darkvine ((this darkvine)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Ttip-index: ~D~%" (-> obj tip-index)) - (format #t "~T~Tdangerous: ~A~%" (-> obj dangerous)) - (format #t "~T~Tvulnerable: ~A~%" (-> obj vulnerable)) - (format #t "~T~Thit-player: ~A~%" (-> obj hit-player)) - (format #t "~T~Ttouch-time: ~D~%" (-> obj touch-time)) - (format #t "~T~Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - obj + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Ttip-index: ~D~%" (-> this tip-index)) + (format #t "~T~Tdangerous: ~A~%" (-> this dangerous)) + (format #t "~T~Tvulnerable: ~A~%" (-> this vulnerable)) + (format #t "~T~Thit-player: ~A~%" (-> this hit-player)) + (format #t "~T~Ttouch-time: ~D~%" (-> this touch-time)) + (format #t "~T~Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + this ) ;; definition for method 12 of type darkvine -(defmethod run-logic? darkvine ((obj darkvine)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-status was-drawn)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override pause-adjust-distance)) - (vector-vector-distance (-> obj root-override trans) (math-camera-pos)) +(defmethod run-logic? darkvine ((this darkvine)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-status was-drawn)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root-override pause-adjust-distance)) + (vector-vector-distance (-> this root-override trans) (math-camera-pos)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) @@ -193,9 +193,7 @@ ) ) :post (behavior () - (when (and (-> self hit-player) - (or (not *target*) (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 0.05))) - ) + (when (and (-> self hit-player) (or (not *target*) (time-elapsed? (-> self touch-time) (seconds 0.05)))) (set-collide-offense (-> self root-override) 2 (collide-offense indestructible)) (set! (-> self hit-player) #f) ) @@ -215,7 +213,7 @@ (defstate darkvine-retreat (darkvine) :event darkvine-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self dangerous) #f) (set! (-> self vulnerable) #f) (logclear! (-> self mask) (process-mask actor-pause)) @@ -227,8 +225,8 @@ (ja :num! (seek!)) ) (ja-channel-set! 0) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 2)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) (suspend) ) ) @@ -243,8 +241,8 @@ (-> self root-override trans) :to *entity-pool* ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.5)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -282,9 +280,9 @@ ;; definition for method 11 of type darkvine ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! darkvine ((obj darkvine) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! darkvine ((this darkvine) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -330,14 +328,14 @@ ) (set! (-> s4-0 nav-radius) 2048.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj tip-index) 8) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *darkvine-sg* '()) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj hit-player) #f) - (set! (-> obj speed) (rand-vu-float-range 0.95 1.05)) + (set! (-> this tip-index) 8) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *darkvine-sg* '()) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this hit-player) #f) + (set! (-> this speed) (rand-vu-float-range 0.95 1.05)) (if (logtest? (get-reminder (get-task-control (game-task jungle-plant)) 0) 1) (go darkvine-die #t) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc index 315cd277b5..9d8f17f6f5 100644 --- a/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/fisher_REF.gc @@ -14,13 +14,13 @@ ) ;; definition for method 3 of type fisher-bank -(defmethod inspect fisher-bank ((obj fisher-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Twidth: (meters ~m)~%" (-> obj width)) - (format #t "~Tnet-radius: (meters ~m)~%" (-> obj net-radius)) - (format #t "~Tmax-caught: ~D~%" (-> obj max-caught)) - (format #t "~Tmax-missed: ~D~%" (-> obj max-missed)) - obj +(defmethod inspect fisher-bank ((this fisher-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Twidth: (meters ~m)~%" (-> this width)) + (format #t "~Tnet-radius: (meters ~m)~%" (-> this net-radius)) + (format #t "~Tmax-caught: ~D~%" (-> this max-caught)) + (format #t "~Tmax-missed: ~D~%" (-> this max-missed)) + this ) ;; definition for symbol *FISHER-bank*, type fisher-bank @@ -185,18 +185,18 @@ ) ;; definition for method 3 of type fisher-params -(defmethod inspect fisher-params ((obj fisher-params)) - (format #t "[~8x] ~A~%" obj 'fisher-params) - (format #t "~Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~Tvel: ~f~%" (-> obj vel)) - (format #t "~Tswing-min: ~D~%" (-> obj swing-min)) - (format #t "~Tswing-max: ~D~%" (-> obj swing-max)) - (format #t "~Tperiod: ~D~%" (-> obj period)) - (format #t "~Tfish-vel: ~f~%" (-> obj fish-vel)) - (format #t "~Tbad-percent: ~f~%" (-> obj bad-percent)) - (format #t "~Tdeadly-percent: ~f~%" (-> obj deadly-percent)) - (format #t "~Tpowerup-percent: ~f~%" (-> obj powerup-percent)) - obj +(defmethod inspect fisher-params ((this fisher-params)) + (format #t "[~8x] ~A~%" this 'fisher-params) + (format #t "~Ttimeout: ~D~%" (-> this timeout)) + (format #t "~Tvel: ~f~%" (-> this vel)) + (format #t "~Tswing-min: ~D~%" (-> this swing-min)) + (format #t "~Tswing-max: ~D~%" (-> this swing-max)) + (format #t "~Tperiod: ~D~%" (-> this period)) + (format #t "~Tfish-vel: ~f~%" (-> this fish-vel)) + (format #t "~Tbad-percent: ~f~%" (-> this bad-percent)) + (format #t "~Tdeadly-percent: ~f~%" (-> this deadly-percent)) + (format #t "~Tpowerup-percent: ~f~%" (-> this powerup-percent)) + this ) ;; definition for symbol *fisher-params*, type (array (inline-array fisher-params)) @@ -780,34 +780,34 @@ ) ;; definition for method 3 of type fisher -(defmethod inspect fisher ((obj fisher)) +(defmethod inspect fisher ((this fisher)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpaddle-end[2] @ #x~X~%" (-> obj paddle-end)) - (format #t "~T~Tpaddle-pos: ~`vector`P~%" (-> obj paddle-pos)) - (format #t "~T~Tpaddle: ~f~%" (-> obj paddle)) - (format #t "~T~Tpaddle-vel: ~f~%" (-> obj paddle-vel)) - (format #t "~T~Tspawner: ~f~%" (-> obj spawner)) - (format #t "~T~Tspawner-last: ~f~%" (-> obj spawner-last)) - (format #t "~T~Tspawn-time: ~D~%" (-> obj spawn-time)) - (format #t "~T~Tturn-time: ~D~%" (-> obj turn-time)) - (format #t "~T~Tswing-time: ~D~%" (-> obj swing-time)) - (format #t "~T~Tblock-time: ~D~%" (-> obj block-time)) - (format #t "~T~Tblock: ~D~%" (-> obj block)) - (format #t "~T~Tcaught: ~D~%" (-> obj caught)) - (format #t "~T~Tmissed: ~D~%" (-> obj missed)) - (format #t "~T~Tdifficulty: ~D~%" (-> obj difficulty)) - (format #t "~T~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~T~Tambient-big-one: ~D~%" (-> obj ambient-big-one)) - (format #t "~T~Tambient-steady: ~D~%" (-> obj ambient-steady)) - (format #t "~T~Tambient-sagging: ~D~%" (-> obj ambient-sagging)) - (format #t "~T~Tambient-almost: ~D~%" (-> obj ambient-almost)) - (format #t "~T~Tcheat-temp: ~D~%" (-> obj cheat-temp)) - (format #t "~T~Thard: ~A~%" (-> obj hard)) - (format #t "~T~Ttraining: ~A~%" (-> obj training)) - (format #t "~T~Tparams: #~%" (-> obj params)) - obj + (format #t "~T~Tpaddle-end[2] @ #x~X~%" (-> this paddle-end)) + (format #t "~T~Tpaddle-pos: ~`vector`P~%" (-> this paddle-pos)) + (format #t "~T~Tpaddle: ~f~%" (-> this paddle)) + (format #t "~T~Tpaddle-vel: ~f~%" (-> this paddle-vel)) + (format #t "~T~Tspawner: ~f~%" (-> this spawner)) + (format #t "~T~Tspawner-last: ~f~%" (-> this spawner-last)) + (format #t "~T~Tspawn-time: ~D~%" (-> this spawn-time)) + (format #t "~T~Tturn-time: ~D~%" (-> this turn-time)) + (format #t "~T~Tswing-time: ~D~%" (-> this swing-time)) + (format #t "~T~Tblock-time: ~D~%" (-> this block-time)) + (format #t "~T~Tblock: ~D~%" (-> this block)) + (format #t "~T~Tcaught: ~D~%" (-> this caught)) + (format #t "~T~Tmissed: ~D~%" (-> this missed)) + (format #t "~T~Tdifficulty: ~D~%" (-> this difficulty)) + (format #t "~T~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~T~Tambient-big-one: ~D~%" (-> this ambient-big-one)) + (format #t "~T~Tambient-steady: ~D~%" (-> this ambient-steady)) + (format #t "~T~Tambient-sagging: ~D~%" (-> this ambient-sagging)) + (format #t "~T~Tambient-almost: ~D~%" (-> this ambient-almost)) + (format #t "~T~Tcheat-temp: ~D~%" (-> this cheat-temp)) + (format #t "~T~Thard: ~A~%" (-> this hard)) + (format #t "~T~Ttraining: ~A~%" (-> this training)) + (format #t "~T~Tparams: #~%" (-> this params)) + this ) ;; definition of type fisher-fish @@ -831,17 +831,17 @@ ) ;; definition for method 3 of type fisher-fish -(defmethod inspect fisher-fish ((obj fisher-fish)) +(defmethod inspect fisher-fish ((this fisher-fish)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdir: #~%" (-> obj dir)) - (format #t "~T~Toffset: ~f~%" (-> obj offset)) - (format #t "~T~Tpos: ~f~%" (-> obj pos)) - (format #t "~T~Tvel: ~f~%" (-> obj vel)) - (format #t "~T~Tmode: ~A~%" (-> obj mode)) - (format #t "~T~Tsize: (meters ~m)~%" (-> obj size)) - obj + (format #t "~T~Tdir: #~%" (-> this dir)) + (format #t "~T~Toffset: ~f~%" (-> this offset)) + (format #t "~T~Tpos: ~f~%" (-> this pos)) + (format #t "~T~Tvel: ~f~%" (-> this vel)) + (format #t "~T~Tmode: ~A~%" (-> this mode)) + (format #t "~T~Tsize: (meters ~m)~%" (-> this size)) + this ) ;; failed to figure out what this is: @@ -877,10 +877,10 @@ ;; definition for method 52 of type fisher ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 fisher ((obj fisher)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 fisher ((this fisher)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -1024.0 f0-0))) ) @@ -898,21 +898,21 @@ ;; definition for method 48 of type fisher ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow fisher ((obj fisher)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow fisher ((this fisher)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -943,7 +943,7 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. (defbehavior fisher-fish-move fisher-fish () - (+! (-> self pos) (* (-> self vel) (-> *display* seconds-per-frame))) + (+! (-> self pos) (* (-> self vel) (seconds-per-frame))) (eval-path-curve-div! (-> (the-as fisher (-> self parent 0)) path) (-> self root trans) (-> self pos) 'interp) (path-control-method-12 (-> (the-as fisher (-> self parent 0)) path) (-> self dir) (-> self pos)) (seek-toward-heading-vec! (-> self root) (-> self dir) 291271.12 (seconds 0.2)) @@ -1179,16 +1179,16 @@ ) ;; definition for method 32 of type fisher -(defmethod play-anim! fisher ((obj fisher) (arg0 symbol)) +(defmethod play-anim! fisher ((this fisher) (arg0 symbol)) (if arg0 - (set! (-> obj training) #f) + (set! (-> this training) #f) ) - (case (current-status (-> obj tasks)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 - (set! (-> obj blend-on-exit) (the-as art-joint-anim #t)) - (close-status! (-> obj tasks) (task-status need-introduction)) - (set! (-> obj training) #t) + (set! (-> this blend-on-exit) (the-as art-joint-anim #t)) + (close-status! (-> this tasks) (task-status need-introduction)) + (set! (-> this training) #t) ) (new 'static 'spool-anim :name "fisher-introduction" @@ -1226,14 +1226,14 @@ ) ) (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) - (set! (-> obj blend-on-exit) (the-as art-joint-anim #t)) + (set! (-> this skippable) #t) + (set! (-> this blend-on-exit) (the-as art-joint-anim #t)) (new 'static 'spool-anim :name "fisher-reminder-1" :index 10 :parts 1 :command-list '()) ) (((task-status need-reward-speech)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "fisher-resolution" @@ -1247,44 +1247,44 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) ;; definition for method 31 of type fisher -(defmethod get-art-elem fisher ((obj fisher)) - (if (closed? (-> obj tasks) (game-task jungle-fishgame) (task-status need-reminder)) - (-> obj draw art-group data 7) - (-> obj draw art-group data 6) +(defmethod get-art-elem fisher ((this fisher)) + (if (closed? (-> this tasks) (game-task jungle-fishgame) (task-status need-reminder)) + (-> this draw art-group data 7) + (-> this draw art-group data 6) ) ) ;; definition for method 38 of type fisher ;; INFO: Return type mismatch object vs none. -(defmethod process-taskable-method-38 fisher ((obj fisher)) - (case (current-status (-> obj tasks)) +(defmethod process-taskable-method-38 fisher ((this fisher)) + (case (current-status (-> this tasks)) (((task-status need-reminder-a) (task-status need-reminder)) - (go (method-of-object obj query)) + (go (method-of-object this query)) ) (((task-status need-reward-speech)) - (go (method-of-object obj play-anim)) + (go (method-of-object this play-anim)) ) (else - ((the-as (function fisher none) (find-parent-method fisher 38)) obj) + ((the-as (function fisher none) (find-parent-method fisher 38)) this) ) ) (none) ) ;; definition for method 34 of type fisher -(defmethod get-accept-anim fisher ((obj fisher) (arg0 symbol)) +(defmethod get-accept-anim fisher ((this fisher) (arg0 symbol)) (when arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) (aybabtu 2) ) (new 'static 'spool-anim @@ -1296,7 +1296,7 @@ ) ;; definition for method 36 of type fisher -(defmethod get-reject-anim fisher ((obj fisher) (arg0 symbol)) +(defmethod get-reject-anim fisher ((this fisher) (arg0 symbol)) (new 'static 'spool-anim :name "fisher-reject" :index 11 :parts 2 :command-list '()) ) @@ -1314,7 +1314,7 @@ ) (ja-channel-set! 1) (ja :group! (get-art-elem self)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (while (-> self child) (deactivate (-> self child 0)) ) @@ -1406,8 +1406,8 @@ ) (process-spawn-function process (lambda :behavior process () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.1)) (suspend) ) ) @@ -1433,7 +1433,7 @@ ((< (-> self caught) 0) ) (else - (when (< (mod (-> *display* base-frame-counter) 300) 150) + (when (< (mod (current-time) 300) 150) (let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf)) (gp-0 (-> s5-0 base)) ) @@ -1486,26 +1486,26 @@ (let ((f0-2 (rand-float-gen))) (cond ((and (< 0.3 f0-2) (< (+ (-> *FISHER-bank* max-caught) -30) (-> self caught))) - (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-almost)) (seconds 10)) + (if (and (time-elapsed? (-> self ambient-almost) (seconds 10)) (play-ambient (-> self ambient) "FIS-TA11" #t (-> self root-override trans)) ) - (set! (-> self ambient-almost) (-> *display* base-frame-counter)) + (set-time! (-> self ambient-almost)) ) ) ((< 0.125 f0-2) ) ((< 0.1 f0-2) - (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-steady)) (seconds 10)) + (if (and (time-elapsed? (-> self ambient-steady) (seconds 10)) (play-ambient (-> self ambient) "FIS-TA06" #t (-> self root-override trans)) ) - (set! (-> self ambient-steady) (-> *display* base-frame-counter)) + (set-time! (-> self ambient-steady)) ) ) ((< (+ (-> *FISHER-bank* max-missed) -6) (-> self missed)) - (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-sagging)) (seconds 10)) + (if (and (time-elapsed? (-> self ambient-sagging) (seconds 10)) (play-ambient (-> self ambient) "FIS-TA07" #t (-> self root-override trans)) ) - (set! (-> self ambient-sagging) (-> *display* base-frame-counter)) + (set-time! (-> self ambient-sagging)) ) ) ) @@ -1516,8 +1516,8 @@ ;; definition for function fisher-game-update ;; INFO: Return type mismatch int vs none. (defbehavior fisher-game-update fisher () - (when (>= (- (-> *display* base-frame-counter) (-> self block-time)) (-> self params timeout)) - (set! (-> self block-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self block-time) (-> self params timeout)) + (set-time! (-> self block-time)) (+! (-> self block) 1) (mem-copy! (the-as pointer (-> self params)) @@ -1525,14 +1525,14 @@ 56 ) ) - (when (>= (- (-> *display* base-frame-counter) (-> self turn-time)) (-> self swing-time)) - (set! (-> self turn-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self turn-time) (-> self swing-time)) + (set-time! (-> self turn-time)) (set! (-> self swing-time) (rand-vu-int-range (the-as int (-> self params swing-min)) (the-as int (-> self params swing-max))) ) (set! (-> self params vel) (- (-> self params vel))) ) - (+! (-> self spawner) (* (-> self params vel) (-> *display* seconds-per-frame))) + (+! (-> self spawner) (* (-> self params vel) (seconds-per-frame))) (if (= (-> self params swing-min) (seconds 333.33)) (set! (-> self spawner) (* 0.01 (the float (-> self params swing-max)))) ) @@ -1546,16 +1546,14 @@ (set! (-> self spawner) 0.0) ) ) - (when (and (nonzero? (-> self params period)) - (>= (- (-> *display* base-frame-counter) (-> self spawn-time)) (-> self params period)) - ) + (when (and (nonzero? (-> self params period)) (time-elapsed? (-> self spawn-time) (-> self params period))) (let ((gp-0 (cond ((rand-vu-percent? (-> self params powerup-percent)) - (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-big-one)) (seconds 30)) + (if (and (time-elapsed? (-> self ambient-big-one) (seconds 30)) (play-ambient (-> self ambient) "FIS-TA03" #t (-> self root-override trans)) ) - (set! (-> self ambient-big-one) (-> *display* base-frame-counter)) + (set-time! (-> self ambient-big-one)) ) 'powerup ) @@ -1575,18 +1573,18 @@ (set! (-> self spawner) (* 0.5 (+ (-> self spawner-last) (-> self spawner)))) ) (set! (-> self spawner-last) (-> self spawner)) - (set! (-> self spawn-time) (-> *display* base-frame-counter)) + (set-time! (-> self spawn-time)) (sound-play "fish-spawn" :vol 70) (fisher-spawn-ambient) (process-spawn fisher-fish gp-0 (-> self spawner) (* 1.85 (-> self params fish-vel)) :to self) ) ) (let ((f1-14 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 32.0 110.0 28.0))) - (+! (-> self paddle-vel) (* f1-14 (-> *display* seconds-per-frame))) + (+! (-> self paddle-vel) (* f1-14 (seconds-per-frame))) ) - (seek! (-> self paddle-vel) 0.0 (* 15.0 (-> *display* seconds-per-frame))) + (seek! (-> self paddle-vel) 0.0 (* 15.0 (seconds-per-frame))) (set! (-> self paddle-vel) (fmax -2.0 (fmin 2.0 (-> self paddle-vel)))) - (+! (-> self paddle) (* (-> self paddle-vel) (-> *display* seconds-per-frame))) + (+! (-> self paddle) (* (-> self paddle-vel) (seconds-per-frame))) (set! (-> self paddle) (fmax 0.0 (fmin 1.0 (-> self paddle)))) (vector-lerp! (-> self paddle-pos) @@ -1677,14 +1675,14 @@ (set! *display-profile* #f) (set! (-> self paddle) 0.5) (set! (-> self paddle-vel) 0.0) - (set! (-> self start-time) (-> *display* base-frame-counter)) + (set-time! (-> self start-time)) (set! (-> self caught) 0) (set! (-> self missed) 0) (set! (-> self spawner) 0.5) (set! (-> self spawner-last) 0.5) (set! (-> self swing-time) 0) (set! (-> self block) -1) - (set! (-> self block-time) (-> *display* base-frame-counter)) + (set-time! (-> self block-time)) (+! (-> self block) 1) (mem-copy! (the-as pointer (-> self params)) @@ -1740,45 +1738,45 @@ ) ;; definition for method 43 of type fisher -(defmethod process-taskable-method-43 fisher ((obj fisher)) +(defmethod process-taskable-method-43 fisher ((this fisher)) (cond - ((closed? (-> obj tasks) (game-task jungle-fishgame) (task-status need-reminder)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 1) 122880.0 obj) + ((closed? (-> this tasks) (game-task jungle-fishgame) (task-status need-reminder)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 1) 122880.0 this) (let ((f0-2 (rand-float-gen))) (if (< 0.5 f0-2) - (play-ambient (-> obj ambient) "FIS-LO03" #f (-> obj root-override trans)) - (play-ambient (-> obj ambient) "FIS-LO05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-LO03" #f (-> this root-override trans)) + (play-ambient (-> this ambient) "FIS-LO05" #f (-> this root-override trans)) ) ) ) ) (else - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-5 (rand-float-gen))) (cond ((< 0.875 f0-5) - (play-ambient (-> obj ambient) "FIS-LO01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-LO01" #f (-> this root-override trans)) ) ((< 0.75 f0-5) - (play-ambient (-> obj ambient) "FIS-LO04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-LO04" #f (-> this root-override trans)) ) ((< 0.625 f0-5) - (play-ambient (-> obj ambient) "FIS-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM01" #f (-> this root-override trans)) ) ((< 0.5 f0-5) - (play-ambient (-> obj ambient) "FIS-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM02" #f (-> this root-override trans)) ) ((< 0.375 f0-5) - (play-ambient (-> obj ambient) "FIS-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM03" #f (-> this root-override trans)) ) ((< 0.25 f0-5) - (play-ambient (-> obj ambient) "FIS-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM04" #f (-> this root-override trans)) ) ((< 0.125 f0-5) - (play-ambient (-> obj ambient) "FIS-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM05" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "FIS-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FIS-AM06" #f (-> this root-override trans)) ) ) ) @@ -1991,8 +1989,8 @@ ;; definition for method 41 of type fisher ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision fisher ((obj fisher) (arg0 int) (arg1 vector)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision fisher ((this fisher) (arg0 int) (arg1 vector)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -2021,38 +2019,38 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) ;; definition for method 47 of type fisher -(defmethod target-above-threshold? fisher ((obj fisher)) - (or (= (current-task (-> obj tasks)) (game-task jungle-fishgame)) (-> obj hard)) +(defmethod target-above-threshold? fisher ((this fisher)) + (or (= (current-task (-> this tasks)) (game-task jungle-fishgame)) (-> this hard)) ) ;; definition for method 11 of type fisher ;; INFO: Used lq/sq -(defmethod init-from-entity! fisher ((obj fisher) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *fisher-sg* 3 49 (new 'static 'vector :w 4096.0) 33) - (set! (-> obj tasks) (get-task-control (game-task jungle-fishgame))) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (let ((s5-0 (eval-path-curve-div! (-> obj path) (-> obj paddle-pos) 6.5 'interp)) - (s4-0 (path-control-method-12 (-> obj path) (new-stack-vector0) 6.5)) +(defmethod init-from-entity! fisher ((this fisher) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *fisher-sg* 3 49 (new 'static 'vector :w 4096.0) 33) + (set! (-> this tasks) (get-task-control (game-task jungle-fishgame))) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s5-0 (eval-path-curve-div! (-> this path) (-> this paddle-pos) 6.5 'interp)) + (s4-0 (path-control-method-12 (-> this path) (new-stack-vector0) 6.5)) ) (+! (-> s5-0 y) 2457.6) (vector-normalize! (vector-rotate-y! s4-0 s4-0 16384.0) (-> *FISHER-bank* width)) - (vector-! (the-as vector (-> obj paddle-end)) s5-0 s4-0) - (vector+! (the-as vector (&-> obj stack 288)) s5-0 s4-0) + (vector-! (the-as vector (-> this paddle-end)) s5-0 s4-0) + (vector+! (the-as vector (&-> this stack 288)) s5-0 s4-0) ) - (set! (-> obj music) 'fishgame) - (set! (-> obj difficulty) (the-as int (-> obj entity extra perm user-uint8 6))) - (set! (-> obj hard) #f) + (set! (-> this music) 'fishgame) + (set! (-> this difficulty) (the-as int (-> this entity extra perm user-uint8 6))) + (set! (-> this hard) #f) (set! (-> *FISHER-bank* max-caught) 200) - (set! (-> obj training) #f) - (process-taskable-method-42 obj) + (set! (-> this training) #f) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc b/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc index 2075562dec..1f4b314031 100644 --- a/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/hopper_REF.gc @@ -13,13 +13,13 @@ ) ;; definition for method 3 of type hopper -(defmethod inspect hopper ((obj hopper)) +(defmethod inspect hopper ((this hopper)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tjump-length: ~f~%" (-> obj jump-length)) - (format #t "~T~Tshadow-min-y: ~f~%" (-> obj shadow-min-y)) - obj + (format #t "~T~Tjump-length: ~f~%" (-> this jump-length)) + (format #t "~T~Tshadow-min-y: ~f~%" (-> this shadow-min-y)) + this ) ;; failed to figure out what this is: @@ -35,12 +35,12 @@ nav-enemy-default-event-handler ;; definition for method 39 of type hopper ;; INFO: Return type mismatch int vs none. -(defmethod common-post hopper ((obj hopper)) - (let ((v1-1 (-> obj draw shadow-ctrl))) - (set! (-> v1-1 settings bot-plane w) (- (- (-> obj shadow-min-y) (-> obj collide-info trans y)))) +(defmethod common-post hopper ((this hopper)) + (let ((v1-1 (-> this draw shadow-ctrl))) + (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)) obj) + ((the-as (function nav-enemy none) (find-parent-method hopper 39)) this) 0 (none) ) @@ -183,9 +183,9 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.075)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! hopper-idle-ja :num! min) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) (ja :num! (loop!)) ) @@ -247,9 +247,9 @@ nav-enemy-default-event-handler (ja-channel-push! 1 (seconds 0.075)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! hopper-idle-ja :num! min) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) (ja :num! (loop!)) ) @@ -326,8 +326,8 @@ nav-enemy-default-event-handler ;; definition for method 47 of type hopper ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision hopper ((obj hopper)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision hopper ((this hopper)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -359,7 +359,7 @@ nav-enemy-default-event-handler (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -367,10 +367,10 @@ nav-enemy-default-event-handler ;; definition for method 48 of type hopper ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 hopper ((obj hopper)) - (initialize-skeleton obj *hopper-sg* '()) - (init-defaults! obj *hopper-nav-enemy-info*) - (set! (-> obj shadow-min-y) (+ (-> obj collide-info trans y) (-> obj nav-info shadow-min-y))) +(defmethod nav-enemy-method-48 hopper ((this hopper)) + (initialize-skeleton this *hopper-sg* '()) + (init-defaults! this *hopper-nav-enemy-info*) + (set! (-> this shadow-min-y) (+ (-> this collide-info trans y) (-> this nav-info shadow-min-y))) 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 312e9976c5..90132492b6 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-elevator_REF.gc @@ -14,19 +14,19 @@ ) ;; definition for method 3 of type jungle-elevator -(defmethod inspect jungle-elevator ((obj jungle-elevator)) +(defmethod inspect jungle-elevator ((this jungle-elevator)) (let ((t9-0 (method-of-type plat-button inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbottom-height: ~f~%" (-> obj bottom-height)) - (format #t "~T~Tteleport-if-below-y: ~f~%" (-> obj teleport-if-below-y)) - (format #t "~T~Tteleport-if-above-y: ~f~%" (-> obj teleport-if-above-y)) - obj + (format #t "~T~Tbottom-height: ~f~%" (-> this bottom-height)) + (format #t "~T~Tteleport-if-below-y: ~f~%" (-> this teleport-if-below-y)) + (format #t "~T~Tteleport-if-above-y: ~f~%" (-> this teleport-if-above-y)) + this ) ;; definition for method 26 of type jungle-elevator -(defmethod can-activate? jungle-elevator ((obj jungle-elevator)) - (and ((method-of-type plat-button can-activate?) obj) (task-complete? *game-info* (game-task jungle-tower))) +(defmethod can-activate? jungle-elevator ((this jungle-elevator)) + (and ((method-of-type plat-button can-activate?) this) (task-complete? *game-info* (game-task jungle-tower))) ) ;; failed to figure out what this is: @@ -67,7 +67,7 @@ (send-event *target* 'reset-height) ) ) - (if (and (>= (-> self path-pos) 0.2) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))) + (if (and (>= (-> self path-pos) 0.2) (not (time-elapsed? (-> self state-time) (seconds 0.2)))) (load-commands-set! *level* (load-command-get-index *level* 'jungle 0)) ) ) @@ -101,7 +101,7 @@ (t9-0) ) ) - (if (and (< (-> self path-pos) 0.8) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))) + (if (and (< (-> self path-pos) 0.8) (not (time-elapsed? (-> self state-time) (seconds 0.2)))) (load-commands-set! *level* (load-command-get-index *level* 'jungle 1)) ) ) @@ -136,18 +136,18 @@ ) ;; definition for method 30 of type jungle-elevator -(defmethod should-teleport? jungle-elevator ((obj jungle-elevator)) +(defmethod should-teleport? jungle-elevator ((this jungle-elevator)) (let ((f0-0 (-> (camera-pos) y))) - (case (-> obj path-pos) + (case (-> this path-pos) ((0.0) - (when (< f0-0 (-> obj teleport-if-below-y)) - (set! (-> obj draw light-index) (the-as uint 1)) + (when (< f0-0 (-> this teleport-if-below-y)) + (set! (-> this draw light-index) (the-as uint 1)) (return #t) ) ) ((1.0) - (when (< (-> obj teleport-if-above-y) f0-0) - (set! (-> obj draw light-index) (the-as uint 255)) + (when (< (-> this teleport-if-above-y) f0-0) + (set! (-> this draw light-index) (the-as uint 255)) (return #t) ) ) @@ -158,15 +158,15 @@ ;; definition for method 29 of type jungle-elevator ;; INFO: Return type mismatch symbol vs none. -(defmethod can-target-move? jungle-elevator ((obj jungle-elevator)) +(defmethod can-target-move? jungle-elevator ((this jungle-elevator)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (eval-path-curve! (-> obj path) s5-0 0.4 'interp) - (set! (-> obj teleport-if-above-y) (-> s5-0 y)) - (eval-path-curve! (-> obj path) s5-0 0.6 'interp) - (set! (-> obj teleport-if-below-y) (-> s5-0 y)) + (eval-path-curve! (-> this path) s5-0 0.4 'interp) + (set! (-> this teleport-if-above-y) (-> s5-0 y)) + (eval-path-curve! (-> this path) s5-0 0.6 'interp) + (set! (-> this teleport-if-below-y) (-> s5-0 y)) ) - (set! (-> obj draw light-index) (the-as uint 255)) - (set! (-> obj bidirectional?) #f) - (set! (-> obj should-grab-player?) #t) + (set! (-> this draw light-index) (the-as uint 255)) + (set! (-> this bidirectional?) #f) + (set! (-> this should-grab-player?) #t) (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc index 05304a7fa9..2c19bc5495 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-mirrors_REF.gc @@ -549,55 +549,55 @@ ) ;; definition for method 3 of type periscope -(defmethod inspect periscope ((obj periscope)) +(defmethod inspect periscope ((this periscope)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ty-offset: (meters ~m)~%" (-> obj y-offset)) - (format #t "~T~Ty-offset-grips: (meters ~m)~%" (-> obj y-offset-grips)) - (format #t "~T~Theight: (meters ~m)~%" (-> obj height)) - (format #t "~T~Tturn: (deg ~r)~%" (-> obj turn)) - (format #t "~T~Ttilt: (deg ~r)~%" (-> obj tilt)) - (format #t "~T~Ttarget-turn: (deg ~r)~%" (-> obj target-turn)) - (format #t "~T~Ttarget-tilt: (deg ~r)~%" (-> obj target-tilt)) - (format #t "~T~Tbase: ~`vector`P~%" (-> obj base)) - (format #t "~T~Treflector-trans: ~`vector`P~%" (-> obj reflector-trans)) - (format #t "~T~Tnext-reflector-trans: ~`vector`P~%" (-> obj next-reflector-trans)) - (format #t "~T~Tprev-reflector-trans: ~`vector`P~%" (-> obj prev-reflector-trans)) - (format #t "~T~Told-camera-matrix: ~`matrix`P~%" (-> obj old-camera-matrix)) - (format #t "~T~Treflector: #x~X~%" (-> obj reflector)) - (format #t "~T~Tgauge-rot: (deg ~r)~%" (-> obj gauge-rot)) - (format #t "~T~Tlock-time: ~D~%" (-> obj lock-time)) - (format #t "~T~Taligned?: ~A~%" (-> obj aligned?)) - (format #t "~T~Traised?: ~A~%" (-> obj raised?)) - (format #t "~T~Tplayer-touching-grips?: ~A~%" (-> obj player-touching-grips?)) - (format #t "~T~Tgrips-moving?: ~A~%" (-> obj grips-moving?)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~T~Trise-sound-id: ~D~%" (-> obj rise-sound-id)) - (format #t "~T~Tgrips-sound-id: ~D~%" (-> obj grips-sound-id)) - (format #t "~T~Tgrips: ~A~%" (-> obj grips)) - (format #t "~T~Tpart-aligned: ~A~%" (-> obj part-aligned)) - obj + (format #t "~T~Ty-offset: (meters ~m)~%" (-> this y-offset)) + (format #t "~T~Ty-offset-grips: (meters ~m)~%" (-> this y-offset-grips)) + (format #t "~T~Theight: (meters ~m)~%" (-> this height)) + (format #t "~T~Tturn: (deg ~r)~%" (-> this turn)) + (format #t "~T~Ttilt: (deg ~r)~%" (-> this tilt)) + (format #t "~T~Ttarget-turn: (deg ~r)~%" (-> this target-turn)) + (format #t "~T~Ttarget-tilt: (deg ~r)~%" (-> this target-tilt)) + (format #t "~T~Tbase: ~`vector`P~%" (-> this base)) + (format #t "~T~Treflector-trans: ~`vector`P~%" (-> this reflector-trans)) + (format #t "~T~Tnext-reflector-trans: ~`vector`P~%" (-> this next-reflector-trans)) + (format #t "~T~Tprev-reflector-trans: ~`vector`P~%" (-> this prev-reflector-trans)) + (format #t "~T~Told-camera-matrix: ~`matrix`P~%" (-> this old-camera-matrix)) + (format #t "~T~Treflector: #x~X~%" (-> this reflector)) + (format #t "~T~Tgauge-rot: (deg ~r)~%" (-> this gauge-rot)) + (format #t "~T~Tlock-time: ~D~%" (-> this lock-time)) + (format #t "~T~Taligned?: ~A~%" (-> this aligned?)) + (format #t "~T~Traised?: ~A~%" (-> this raised?)) + (format #t "~T~Tplayer-touching-grips?: ~A~%" (-> this player-touching-grips?)) + (format #t "~T~Tgrips-moving?: ~A~%" (-> this grips-moving?)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~T~Trise-sound-id: ~D~%" (-> this rise-sound-id)) + (format #t "~T~Tgrips-sound-id: ~D~%" (-> this grips-sound-id)) + (format #t "~T~Tgrips: ~A~%" (-> this grips)) + (format #t "~T~Tpart-aligned: ~A~%" (-> this part-aligned)) + this ) ;; definition for method 7 of type periscope ;; INFO: Return type mismatch process-drawable vs periscope. -(defmethod relocate periscope ((obj periscope) (arg0 int)) - (if (nonzero? (-> obj grips)) - (&+! (-> obj grips) arg0) +(defmethod relocate periscope ((this periscope) (arg0 int)) + (if (nonzero? (-> this grips)) + (&+! (-> this grips) arg0) ) - (if (nonzero? (-> obj part-aligned)) - (&+! (-> obj part-aligned) arg0) + (if (nonzero? (-> this part-aligned)) + (&+! (-> this part-aligned) arg0) ) - (the-as periscope ((method-of-type process-drawable relocate) obj arg0)) + (the-as periscope ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type periscope -(defmethod deactivate periscope ((obj periscope)) - (if (nonzero? (-> obj part-aligned)) - (kill-and-free-particles (-> obj part-aligned)) +(defmethod deactivate periscope ((this periscope)) + (if (nonzero? (-> this part-aligned)) + (kill-and-free-particles (-> this part-aligned)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -616,11 +616,11 @@ ) ;; definition for method 3 of type reflector -(defmethod inspect reflector ((obj reflector)) +(defmethod inspect reflector ((this reflector)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type reflector-origin @@ -641,16 +641,16 @@ ) ;; definition for method 3 of type reflector-origin -(defmethod inspect reflector-origin ((obj reflector-origin)) +(defmethod inspect reflector-origin ((this reflector-origin)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Treflector-trans: ~`vector`P~%" (-> obj reflector-trans)) - (format #t "~T~Tnext-reflector-trans: ~`vector`P~%" (-> obj next-reflector-trans)) - (format #t "~T~Treflector: #x~X~%" (-> obj reflector)) - (format #t "~T~Tnext: ~A~%" (-> obj next)) - (format #t "~T~Tblocker: ~A~%" (-> obj blocker)) - obj + (format #t "~T~Treflector-trans: ~`vector`P~%" (-> this reflector-trans)) + (format #t "~T~Tnext-reflector-trans: ~`vector`P~%" (-> this next-reflector-trans)) + (format #t "~T~Treflector: #x~X~%" (-> this reflector)) + (format #t "~T~Tnext: ~A~%" (-> this next)) + (format #t "~T~Tblocker: ~A~%" (-> this blocker)) + this ) ;; definition of type reflector-mirror @@ -669,12 +669,12 @@ ) ;; definition for method 3 of type reflector-mirror -(defmethod inspect reflector-mirror ((obj reflector-mirror)) +(defmethod inspect reflector-mirror ((this reflector-mirror)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbeam-end: #~%" (-> obj beam-end)) - obj + (format #t "~T~Tbeam-end: #~%" (-> this beam-end)) + this ) ;; failed to figure out what this is: @@ -918,7 +918,7 @@ (set! (-> v1-30 y) (- (- 2048 (/ (-> v1-30 y) 16)))) ) (let ((f0-9 (- (atan (the float (-> v1-30 x)) (the float (- (-> v1-30 y))))))) - (set! (-> self gauge-rot) (deg-seek (-> self gauge-rot) f0-9 (* 131072.0 (-> *display* seconds-per-frame)))) + (set! (-> self gauge-rot) (deg-seek (-> self gauge-rot) f0-9 (* 131072.0 (seconds-per-frame)))) ) ) ) @@ -1313,7 +1313,7 @@ :code (behavior () (local-vars (v1-13 symbol)) (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (link-to-next-and-prev-actor (-> self link)) (periscope-find-next) (periscope-find-reflection-angles) @@ -1323,9 +1323,9 @@ ) (until (and v1-13 (= (-> self turn) (-> self target-turn)) (= (-> self tilt) (-> self target-tilt))) (sound-play "eco-tower-rise" :id (-> self rise-sound-id) :position (the-as symbol (-> self base))) - (seek! (-> self y-offset) (-> self height) (* 16384.0 (-> *display* seconds-per-frame))) - (seek! (-> self turn) (-> self target-turn) (* 7281.778 (-> *display* seconds-per-frame))) - (seek! (-> self tilt) (-> self target-tilt) (* 7281.778 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset) (-> self height) (* 16384.0 (seconds-per-frame))) + (seek! (-> self turn) (-> self target-turn) (* 7281.778 (seconds-per-frame))) + (seek! (-> self tilt) (-> self target-tilt) (* 7281.778 (seconds-per-frame))) (set! (-> self raised?) (< (+ -12288.0 (-> self height)) (-> self y-offset))) (periscope-update-joints) (suspend) @@ -1344,7 +1344,7 @@ (set! (-> self raised?) #t) (let ((f30-0 (+ -20480.0 (-> self height)))) (until (= (-> self y-offset-grips) f30-0) - (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (seconds-per-frame))) (periscope-update-joints) (suspend) ) @@ -1417,7 +1417,7 @@ (level-hint-spawn (text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) - (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (seconds-per-frame))) (periscope-update-joints) (suspend) ) @@ -1437,7 +1437,7 @@ (when (and *target* (>= f30-1 (vector-vector-distance a0-10 (-> *target* control trans)))) (when (logtest? (-> *target* control status) (cshape-moving-flags onsurf)) (let ((f0-7 (fmax 4096.0 (fmin 12288.0 (+ (- 5120.0 (-> self base y)) (-> *target* control trans y)))))) - (seek! (-> self y-offset-grips) f0-7 (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset-grips) f0-7 (* 16384.0 (seconds-per-frame))) ) ) (vector-! gp-1 (target-pos 0) (-> self base)) @@ -1446,7 +1446,7 @@ (-> self grips transform quat) (-> self grips transform quat) (the-as quaternion gp-1) - (* 27306.666 (-> *display* seconds-per-frame)) + (* 27306.666 (seconds-per-frame)) ) (vector-z-quaternion! s3-0 (-> self grips transform quat)) (set! (-> self grips-moving?) (< (vector-dot s4-0 s3-0) (cos 182.04445))) @@ -1514,7 +1514,7 @@ (hide-hud) ) :code (behavior () - (set! (-> self lock-time) (-> *display* base-frame-counter)) + (set-time! (-> self lock-time)) (link-to-next-and-prev-actor (-> self link)) (periscope-find-next) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) @@ -1622,12 +1622,10 @@ (suspend) (loop (if (not (-> self aligned?)) - (set! (-> self lock-time) (-> *display* base-frame-counter)) + (set-time! (-> self lock-time)) ) (periscope-crosshair) - (when (or (cpad-pressed? 0 triangle x) - (and (-> self aligned?) (>= (- (-> *display* base-frame-counter) (-> self lock-time)) (seconds 3))) - ) + (when (or (cpad-pressed? 0 triangle x) (and (-> self aligned?) (time-elapsed? (-> self lock-time) (seconds 3)))) (sound-stop (-> self sound-id)) (if (periscope-test-task-complete?) (close-specific-task! (game-task jungle-lurkerm) (task-status need-reminder)) @@ -1733,7 +1731,7 @@ (set! (-> self tilt) (-> self target-tilt)) (let ((f30-0 (+ -20480.0 (-> self height)))) (until (= (-> self y-offset-grips) f30-0) - (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset-grips) f30-0 (* 16384.0 (seconds-per-frame))) (periscope-update-joints) (sound-play "site-moves" :id (-> self grips-sound-id) :position (the-as symbol (-> self grips transform))) (suspend) @@ -1751,9 +1749,9 @@ ;; definition for method 11 of type periscope ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! periscope ((obj periscope) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! periscope ((this periscope) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1790,42 +1788,42 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj height) (res-lump-float (-> obj entity) 'height-info)) - (set! (-> obj y-offset) (-> obj height)) - (set! (-> obj y-offset-grips) (+ -20480.0 (-> obj height))) - (set! (-> obj base quad) (-> obj root-override trans quad)) - (set! (-> obj reflector-trans quad) (-> obj base quad)) - (+! (-> obj reflector-trans y) (-> obj height)) - (set! (-> obj reflector) (process-spawn reflector (-> obj reflector-trans) :to obj)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) + (process-drawable-from-entity! this arg0) + (set! (-> this height) (res-lump-float (-> this entity) 'height-info)) + (set! (-> this y-offset) (-> this height)) + (set! (-> this y-offset-grips) (+ -20480.0 (-> this height))) + (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this reflector-trans quad) (-> this base quad)) + (+! (-> this reflector-trans y) (-> this height)) + (set! (-> this reflector) (process-spawn reflector (-> this reflector-trans) :to this)) + (set! (-> this link) (new 'process 'actor-link-info this)) (periscope-find-next) - (initialize-skeleton obj *periscope-base-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 176) obj)) - (set! (-> obj part-aligned) (create-launch-control (-> *part-group-id-table* 689) obj)) - (set! (-> obj grips) (new 'process 'joint-mod-set-world obj 4 #t)) - (transformq-copy! (-> obj grips transform) (the-as transformq (-> obj root-override trans))) + (initialize-skeleton this *periscope-base-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 176) this)) + (set! (-> this part-aligned) (create-launch-control (-> *part-group-id-table* 689) this)) + (set! (-> this grips) (new 'process 'joint-mod-set-world this 4 #t)) + (transformq-copy! (-> this grips transform) (the-as transformq (-> this root-override trans))) (periscope-find-reflection-angles) - (set! (-> obj turn) (-> obj target-turn)) - (set! (-> obj tilt) (-> obj target-tilt)) + (set! (-> this turn) (-> this target-turn)) + (set! (-> this tilt) (-> this target-tilt)) (periscope-update-joints) - (set! (-> obj grips-moving?) #f) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> obj reflector-trans)) + (set! (-> this grips-moving?) #f) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> this reflector-trans)) ) - (set! (-> obj rise-sound-id) (new-sound-id)) - (set! (-> obj grips-sound-id) (new-sound-id)) - (set! (-> obj root-override nav-radius) 8192.0) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (set! (-> this rise-sound-id) (new-sound-id)) + (set! (-> this grips-sound-id) (new-sound-id)) + (set! (-> this root-override nav-radius) 8192.0) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go periscope-power-on) ) ((periscope-has-power-input?) - (set! (-> obj y-offset-grips) 8192.0) + (set! (-> this y-offset-grips) 8192.0) (go periscope-wait-for-player) ) (else @@ -1900,13 +1898,13 @@ ;; definition for method 11 of type reflector-origin ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! reflector-origin ((obj reflector-origin) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj blocker) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj reflector-trans quad) (-> obj root trans quad)) +(defmethod init-from-entity! reflector-origin ((this reflector-origin) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this blocker) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this reflector-trans quad) (-> this root trans quad)) (go reflector-origin-idle) (none) ) @@ -1985,8 +1983,8 @@ ) (send-event (ppointer->process v1-11) 'anim-mode 'play1) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.5)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -2011,8 +2009,8 @@ ;; definition for method 11 of type reflector-mirror ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! reflector-mirror ((obj reflector-mirror) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! reflector-mirror ((this reflector-mirror) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -2047,17 +2045,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (initialize-skeleton obj *reflector-mirror-sg* '()) - (set-vector! (-> obj beam-end) 1805721.6 167936.0 -932659.2 1.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> obj beam-end)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (initialize-skeleton this *reflector-mirror-sg* '()) + (set-vector! (-> this beam-end) 1805721.6 167936.0 -932659.2 1.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "eco-beam" :fo-max 50) (-> this beam-end)) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go reflector-mirror-broken #t) (go reflector-mirror-idle) ) 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 7fb59b2c26..6460bf7f86 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-obs_REF.gc @@ -29,11 +29,11 @@ ) ;; definition for method 3 of type logtrap -(defmethod inspect logtrap ((obj logtrap)) +(defmethod inspect logtrap ((this logtrap)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -79,9 +79,9 @@ ;; definition for method 11 of type logtrap ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! logtrap ((obj logtrap) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! logtrap ((this logtrap) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -96,14 +96,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *logtrap-sg* '()) - (set! (-> obj draw shadow-ctrl) (new 'process 'shadow-control -5734.4 0.0 614400.0 (the-as float 1) 163840.0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (update-transforms! (-> obj root-override)) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *logtrap-sg* '()) + (set! (-> this draw shadow-ctrl) + (new 'process 'shadow-control -5734.4 0.0 614400.0 (the-as float 1) 163840.0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (update-transforms! (-> this root-override)) + (go (method-of-object this idle)) (none) ) @@ -121,11 +123,11 @@ ) ;; definition for method 3 of type towertop -(defmethod inspect towertop ((obj towertop)) +(defmethod inspect towertop ((this towertop)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -150,12 +152,12 @@ ;; definition for method 11 of type towertop ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! towertop ((obj towertop) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root-override) (new 'process 'trsq)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *towertop-sg* '()) +(defmethod init-from-entity! towertop ((this towertop) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root-override) (new 'process 'trsq)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *towertop-sg* '()) (go towertop-idle) (none) ) @@ -176,13 +178,13 @@ ) ;; definition for method 3 of type lurkerm-tall-sail -(defmethod inspect lurkerm-tall-sail ((obj lurkerm-tall-sail)) +(defmethod inspect lurkerm-tall-sail ((this lurkerm-tall-sail)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; failed to figure out what this is: @@ -213,7 +215,7 @@ (quaternion-rotate-local-y! (-> self root-override quat) (-> self root-override quat) - (* 12743.111 (-> *display* seconds-per-frame) (-> self speed)) + (* 12743.111 (seconds-per-frame) (-> self speed)) ) (suspend) (ja :num! (seek! max (* 0.5 (-> self speed)))) @@ -225,9 +227,9 @@ ;; definition for method 11 of type lurkerm-tall-sail ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lurkerm-tall-sail ((obj lurkerm-tall-sail) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! lurkerm-tall-sail ((this lurkerm-tall-sail) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -253,16 +255,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lurkerm-tall-sail-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj speed) 1.0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj speed) 0.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lurkerm-tall-sail-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this speed) 1.0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this speed) 0.0) ) (go lurkerm-tall-sail-idle) (none) @@ -284,13 +286,13 @@ ) ;; definition for method 3 of type lurkerm-short-sail -(defmethod inspect lurkerm-short-sail ((obj lurkerm-short-sail)) +(defmethod inspect lurkerm-short-sail ((this lurkerm-short-sail)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; failed to figure out what this is: @@ -317,7 +319,7 @@ (quaternion-rotate-local-y! (-> self root-override quat) (-> self root-override quat) - (* -12743.111 (-> *display* seconds-per-frame) (-> self speed)) + (* -12743.111 (seconds-per-frame) (-> self speed)) ) (suspend) (ja :num! (seek! max (* 0.5 (-> self speed)))) @@ -329,9 +331,9 @@ ;; definition for method 11 of type lurkerm-short-sail ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lurkerm-short-sail ((obj lurkerm-short-sail) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! lurkerm-short-sail ((this lurkerm-short-sail) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -374,16 +376,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lurkerm-short-sail-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj speed) 1.0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj speed) 0.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lurkerm-short-sail-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this speed) 1.0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this speed) 0.0) ) (go lurkerm-short-sail-idle) (none) @@ -408,16 +410,16 @@ ) ;; definition for method 3 of type lurkerm-piston -(defmethod inspect lurkerm-piston ((obj lurkerm-piston)) +(defmethod inspect lurkerm-piston ((this lurkerm-piston)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tbase: ~`vector`P~%" (-> obj base)) - (format #t "~T~Theight: ~`vector`P~%" (-> obj height)) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tbase: ~`vector`P~%" (-> this base)) + (format #t "~T~Theight: ~`vector`P~%" (-> this height)) + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; failed to figure out what this is: @@ -457,10 +459,10 @@ ;; definition for method 11 of type lurkerm-piston ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lurkerm-piston ((obj lurkerm-piston) (arg0 entity-actor)) +(defmethod init-from-entity! lurkerm-piston ((this lurkerm-piston) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -478,26 +480,26 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *lurkerm-piston-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj base quad) (-> obj root-override trans quad)) - (let ((f30-0 (-> obj base y))) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *lurkerm-piston-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this base quad) (-> this root-override trans quad)) + (let ((f30-0 (-> this base y))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-32 (res-lump-data arg0 'height-info pointer :tag-ptr (& sv-16)))) - (set! (-> obj base y) (+ f30-0 (if (and v1-32 (> (the-as int (-> sv-16 elt-count)) 0)) - (-> (the-as (pointer float) v1-32)) - 0.0 - ) - ) + (set! (-> this base y) (+ f30-0 (if (and v1-32 (> (the-as int (-> sv-16 elt-count)) 0)) + (-> (the-as (pointer float) v1-32)) + 0.0 + ) + ) ) ) ) - (let ((s4-1 (-> obj height))) + (let ((s4-1 (-> this height))) (set! (-> s4-1 x) 0.0) (set! sv-32 (new 'static 'res-tag)) (let ((v1-35 (res-lump-data arg0 'height-info (pointer float) :tag-ptr (& sv-32)))) @@ -510,11 +512,11 @@ (set! (-> s4-1 z) 0.0) (set! (-> s4-1 w) 1.0) ) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj speed) 1.0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj speed) 0.0) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this speed) 1.0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this speed) 0.0) ) (go lurkerm-piston-idle) (none) @@ -535,13 +537,13 @@ ) ;; definition for method 3 of type accordian -(defmethod inspect accordian ((obj accordian)) +(defmethod inspect accordian ((this accordian)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; failed to figure out what this is: @@ -576,15 +578,15 @@ ;; definition for method 11 of type accordian ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! accordian ((obj accordian) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *accordian-sg* '()) - (set! (-> obj root pause-adjust-distance) 204800.0) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj speed) 1.0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj speed) 0.0) +(defmethod init-from-entity! accordian ((this accordian) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *accordian-sg* '()) + (set! (-> this root pause-adjust-distance) 204800.0) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this speed) 1.0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this speed) 0.0) ) (go accordian-idle) (none) @@ -605,35 +607,35 @@ ) ;; definition for method 3 of type junglecam -(defmethod inspect junglecam ((obj junglecam)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect junglecam ((this junglecam)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; definition of type precurbridgecam @@ -646,11 +648,11 @@ ) ;; definition for method 3 of type precurbridgecam -(defmethod inspect precurbridgecam ((obj precurbridgecam)) +(defmethod inspect precurbridgecam ((this precurbridgecam)) (let ((t9-0 (method-of-type pov-camera inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -683,9 +685,9 @@ ) ;; definition for method 3 of type precurbridge-span -(defmethod inspect precurbridge-span ((obj precurbridge-span)) - (format #t "[~8x] ~A~%" obj 'precurbridge-span) - obj +(defmethod inspect precurbridge-span ((this precurbridge-span)) + (format #t "[~8x] ~A~%" this 'precurbridge-span) + this ) ;; definition of type precurbridge @@ -708,15 +710,15 @@ ) ;; definition for method 3 of type precurbridge -(defmethod inspect precurbridge ((obj precurbridge)) +(defmethod inspect precurbridge ((this precurbridge)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsmush: #~%" (-> obj smush)) - (format #t "~T~Tbase: ~`vector`P~%" (-> obj base)) - (format #t "~T~Tactivation-point: #~%" (-> obj activation-point)) - (format #t "~T~Tspan-array[8] @ #x~X~%" (-> obj span-array)) - obj + (format #t "~T~Tsmush: #~%" (-> this smush)) + (format #t "~T~Tbase: ~`vector`P~%" (-> this base)) + (format #t "~T~Tactivation-point: #~%" (-> this activation-point)) + (format #t "~T~Tspan-array[8] @ #x~X~%" (-> this span-array)) + this ) ;; failed to figure out what this is: @@ -865,10 +867,10 @@ ;; definition for method 11 of type precurbridge ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! precurbridge ((obj precurbridge) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! precurbridge ((this precurbridge) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1029,19 +1031,19 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set-vector! (-> obj activation-point) 1765785.6 61440.0 -1279180.8 1.0) - (initialize-skeleton obj *precurbridge-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (set-vector! (-> this activation-point) 1765785.6 61440.0 -1279180.8 1.0) + (initialize-skeleton this *precurbridge-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-post) - (update-transforms! (-> obj root-override)) - (set! (-> obj base quad) (-> obj root-override trans quad)) - (set! (-> obj sound) (new 'process 'ambient-sound arg0 (-> obj root-override trans))) + (update-transforms! (-> this root-override)) + (set! (-> this base quad) (-> this root-override trans quad)) + (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root-override trans))) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (logclear! (-> obj mask) (process-mask actor-pause)) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (logclear! (-> this mask) (process-mask actor-pause)) (go precurbridge-active #t) ) (else @@ -1067,12 +1069,12 @@ ) ;; definition for method 3 of type maindoor -(defmethod inspect maindoor ((obj maindoor)) +(defmethod inspect maindoor ((this maindoor)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tthresh: ~`vector`P~%" (-> obj thresh)) - obj + (format #t "~T~Tthresh: ~`vector`P~%" (-> this thresh)) + this ) ;; failed to figure out what this is: @@ -1152,8 +1154,8 @@ ;; definition for method 11 of type maindoor ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! maindoor ((obj maindoor) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! maindoor ((this maindoor) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1165,15 +1167,15 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *maindoor-sg* '()) - (update-transforms! (-> obj root-override)) - (set! (-> obj thresh w) 61440.0) - (if (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *maindoor-sg* '()) + (update-transforms! (-> this root-override)) + (set! (-> this thresh w) 61440.0) + (if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (and (and *target* - (>= (-> obj thresh w) (vector-vector-distance (-> obj root-override trans) (-> *target* control trans))) + (>= (-> this thresh w) (vector-vector-distance (-> this root-override trans) (-> *target* control trans))) ) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) @@ -1194,11 +1196,11 @@ ) ;; definition for method 3 of type sidedoor -(defmethod inspect sidedoor ((obj sidedoor)) +(defmethod inspect sidedoor ((this sidedoor)) (let ((t9-0 (method-of-type eco-door inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1209,8 +1211,8 @@ ;; definition for method 24 of type sidedoor ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 sidedoor ((obj sidedoor)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod eco-door-method-24 sidedoor ((this sidedoor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1222,7 +1224,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -1230,12 +1232,12 @@ ;; definition for method 25 of type sidedoor ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 sidedoor ((obj sidedoor)) - (initialize-skeleton obj *sidedoor-sg* '()) - (set! (-> obj open-distance) 22528.0) - (set! (-> obj close-distance) 61440.0) - (set! (-> obj speed) 6.0) - (update-transforms! (-> obj root-override)) +(defmethod eco-door-method-25 sidedoor ((this sidedoor)) + (initialize-skeleton this *sidedoor-sg* '()) + (set! (-> this open-distance) 22528.0) + (set! (-> this close-distance) 61440.0) + (set! (-> this speed) 6.0) + (update-transforms! (-> this root-override)) 0 (none) ) @@ -1256,24 +1258,24 @@ ) ;; definition for method 3 of type jngpusher -(defmethod inspect jngpusher ((obj jngpusher)) +(defmethod inspect jngpusher ((this jngpusher)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tback-prim: ~A~%" (-> obj back-prim)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tback-prim: ~A~%" (-> this back-prim)) + this ) ;; definition for method 7 of type jngpusher ;; INFO: Return type mismatch process-drawable vs jngpusher. -(defmethod relocate jngpusher ((obj jngpusher) (arg0 int)) - (if (nonzero? (-> obj back-prim)) - (&+! (-> obj back-prim) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method jngpusher 7)) this arg0) ) ) @@ -1307,9 +1309,9 @@ ;; definition for method 11 of type jngpusher ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! jngpusher ((obj jngpusher) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! jngpusher ((this jngpusher) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1339,16 +1341,16 @@ (set! (-> s2-1 transform-index) 4) (set-vector! (-> s2-1 local-sphere) 36864.0 0.0 0.0 20480.0) (append-prim s3-0 s2-1) - (set! (-> obj back-prim) s2-1) + (set! (-> this back-prim) s2-1) ) ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *jngpusher-sg* '()) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *jngpusher-sg* '()) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) (go jngpusher-idle) (none) ) @@ -1363,11 +1365,11 @@ ) ;; definition for method 3 of type jungle-water -(defmethod inspect jungle-water ((obj jungle-water)) +(defmethod inspect jungle-water ((this jungle-water)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for symbol ripple-for-jungle-water, type ripple-wave-set @@ -1386,13 +1388,13 @@ ;; definition for method 22 of type jungle-water ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 jungle-water ((obj jungle-water)) +(defmethod water-vol-method-22 jungle-water ((this jungle-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) diff --git a/test/decompiler/reference/jak1/levels/jungle/jungle-part_REF.gc b/test/decompiler/reference/jak1/levels/jungle/jungle-part_REF.gc index b71dc4401b..ede3de3dd4 100644 --- a/test/decompiler/reference/jak1/levels/jungle/jungle-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/jungle-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type jungle-part -(defmethod inspect jungle-part ((obj jungle-part)) +(defmethod inspect jungle-part ((this jungle-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; 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 b209d05684..7b1d396f2c 100644 --- a/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/junglefish_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type junglefish -(defmethod inspect junglefish ((obj junglefish)) +(defmethod inspect junglefish ((this junglefish)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -29,9 +29,9 @@ nav-enemy-default-event-handler ;; definition for method 39 of type junglefish ;; INFO: Return type mismatch int vs none. -(defmethod common-post junglefish ((obj junglefish)) - (water-control-method-10 (-> obj water)) - ((the-as (function nav-enemy none) (find-parent-method junglefish 39)) obj) +(defmethod common-post junglefish ((this junglefish)) + (water-control-method-10 (-> this water)) + ((the-as (function nav-enemy none) (find-parent-method junglefish 39)) this) 0 (none) ) @@ -236,8 +236,8 @@ nav-enemy-default-event-handler ;; definition for method 11 of type junglefish ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! junglefish ((obj junglefish) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! junglefish ((this junglefish) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -253,16 +253,16 @@ nav-enemy-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *junglefish-sg* '()) - (init-defaults! obj *junglefish-nav-enemy-info*) - (set! (-> obj water) (new 'process 'water-control obj 7 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01)) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 5734.4) - (set! (-> obj collide-info trans y) (+ -4096.0 (-> obj water height))) - (go (method-of-object obj nav-enemy-idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *junglefish-sg* '()) + (init-defaults! this *junglefish-nav-enemy-info*) + (set! (-> this water) (new 'process 'water-control this 7 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 5734.4) + (set! (-> this collide-info trans y) (+ -4096.0 (-> this water height))) + (go (method-of-object this nav-enemy-idle)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc b/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc index fc29ee2d18..f992b423d4 100644 --- a/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungle/junglesnake_REF.gc @@ -53,12 +53,12 @@ ) ;; definition for method 3 of type junglesnake-twist-joint -(defmethod inspect junglesnake-twist-joint ((obj junglesnake-twist-joint)) - (format #t "[~8x] ~A~%" obj 'junglesnake-twist-joint) - (format #t "~Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~Try: ~f~%" (-> obj ry)) - (format #t "~Tdrag-delta-ry: ~f~%" (-> obj drag-delta-ry)) - obj +(defmethod inspect junglesnake-twist-joint ((this junglesnake-twist-joint)) + (format #t "[~8x] ~A~%" this 'junglesnake-twist-joint) + (format #t "~Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~Try: ~f~%" (-> this ry)) + (format #t "~Tdrag-delta-ry: ~f~%" (-> this drag-delta-ry)) + this ) ;; definition of type junglesnake-tilt-joint @@ -73,11 +73,11 @@ ) ;; definition for method 3 of type junglesnake-tilt-joint -(defmethod inspect junglesnake-tilt-joint ((obj junglesnake-tilt-joint)) - (format #t "[~8x] ~A~%" obj 'junglesnake-tilt-joint) - (format #t "~Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~Tflip-it: ~A~%" (-> obj flip-it)) - obj +(defmethod inspect junglesnake-tilt-joint ((this junglesnake-tilt-joint)) + (format #t "[~8x] ~A~%" this 'junglesnake-tilt-joint) + (format #t "~Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~Tflip-it: ~A~%" (-> this flip-it)) + this ) ;; definition of type junglesnake @@ -118,23 +118,23 @@ ) ;; definition for method 3 of type junglesnake -(defmethod inspect junglesnake ((obj junglesnake)) +(defmethod inspect junglesnake ((this junglesnake)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~T~Thit-player: ~A~%" (-> obj hit-player)) - (format #t "~T~Tis-lethal?: ~A~%" (-> obj is-lethal?)) - (format #t "~T~Trefractory-delay: ~D~%" (-> obj refractory-delay)) - (format #t "~T~Try: ~f~%" (-> obj ry)) - (format #t "~T~Tdes-ry: ~f~%" (-> obj des-ry)) - (format #t "~T~Ttilt: ~f~%" (-> obj tilt)) - (format #t "~T~Tdes-tilt: ~f~%" (-> obj des-tilt)) - (format #t "~T~Ttrack-player-ry: ~A~%" (-> obj track-player-ry)) - (format #t "~T~Ttrack-player-tilt: ~A~%" (-> obj track-player-tilt)) - (format #t "~T~Ttwist-joints[24] @ #x~X~%" (-> obj twist-joints)) - (format #t "~T~Ttilt-joints[3] @ #x~X~%" (-> obj tilt-joints)) - obj + (format #t "~T~Tstate-time: ~D~%" (-> this state-time)) + (format #t "~T~Thit-player: ~A~%" (-> this hit-player)) + (format #t "~T~Tis-lethal?: ~A~%" (-> this is-lethal?)) + (format #t "~T~Trefractory-delay: ~D~%" (-> this refractory-delay)) + (format #t "~T~Try: ~f~%" (-> this ry)) + (format #t "~T~Tdes-ry: ~f~%" (-> this des-ry)) + (format #t "~T~Ttilt: ~f~%" (-> this tilt)) + (format #t "~T~Tdes-tilt: ~f~%" (-> this des-tilt)) + (format #t "~T~Ttrack-player-ry: ~A~%" (-> this track-player-ry)) + (format #t "~T~Ttrack-player-tilt: ~A~%" (-> this track-player-tilt)) + (format #t "~T~Ttwist-joints[24] @ #x~X~%" (-> this twist-joints)) + (format #t "~T~Ttilt-joints[3] @ #x~X~%" (-> this tilt-joints)) + this ) ;; definition for function junglesnake-default-event-handler @@ -184,20 +184,20 @@ junglesnake-default-event-handler ;; definition for method 20 of type junglesnake -(defmethod junglesnake-method-20 junglesnake ((obj junglesnake)) - (when (and *target* (-> obj track-player-ry)) +(defmethod junglesnake-method-20 junglesnake ((this junglesnake)) + (when (and *target* (-> this track-player-ry)) (let ((v1-3 (target-pos 0))) - (set! (-> obj des-ry) - (atan (- (-> v1-3 x) (-> obj root-override trans x)) (- (-> v1-3 z) (-> obj root-override trans z))) + (set! (-> this des-ry) + (atan (- (-> v1-3 x) (-> this root-override trans x)) (- (-> v1-3 z) (-> this root-override trans z))) ) ) ) - (let ((f0-7 (deg-diff (-> obj ry) (-> obj des-ry)))) - (+! (-> obj ry) (seek-with-smooth 0.0 f0-7 (* 655360.0 (-> *display* seconds-per-frame)) 0.125 0.001)) + (let ((f0-7 (deg-diff (-> this ry) (-> this des-ry)))) + (+! (-> this ry) (seek-with-smooth 0.0 f0-7 (* 655360.0 (seconds-per-frame)) 0.125 0.001)) ) - (let ((f30-1 (-> obj ry))) + (let ((f30-1 (-> this ry))) (dotimes (s5-0 24) - (let ((s4-0 (-> obj twist-joints s5-0))) + (let ((s4-0 (-> this twist-joints s5-0))) (let ((f28-0 (-> s4-0 drag-delta-ry))) (cond ((= f28-0 0.0) @@ -215,7 +215,7 @@ junglesnake-default-event-handler ) ) (let ((f0-16 (deg-diff (-> s4-0 ry) f26-0))) - (+! (-> s4-0 ry) (seek-with-smooth 0.0 f0-16 (* 327680.0 (-> *display* seconds-per-frame)) 0.25 0.001)) + (+! (-> s4-0 ry) (seek-with-smooth 0.0 f0-16 (* 327680.0 (seconds-per-frame)) 0.25 0.001)) ) ) ) @@ -319,7 +319,7 @@ junglesnake-default-event-handler ) (let* ((f30-1 (-> s5-0 tilt)) (f0-21 (deg-diff f30-1 (-> s5-0 des-tilt))) - (f28-0 (+ f30-1 (seek-with-smooth 0.0 f0-21 (* 65536.0 (-> *display* seconds-per-frame)) 0.2 0.001))) + (f28-0 (+ f30-1 (seek-with-smooth 0.0 f0-21 (* 65536.0 (seconds-per-frame)) 0.2 0.001))) ) (set! (-> s5-0 tilt) f28-0) (let ((f30-2 (cos f28-0)) @@ -431,13 +431,13 @@ junglesnake-default-event-handler (defstate junglesnake-tracking (junglesnake) :event junglesnake-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self track-player-ry) #t) (set! (-> self track-player-tilt) #t) ) :trans (behavior () (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self refractory-delay)) + (time-elapsed? (-> self state-time) (-> self refractory-delay)) (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) @@ -526,7 +526,7 @@ junglesnake-default-event-handler (seek f30-0 (lerp-scale 0.0 1.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)) 0.0 24576.0) - (* 2.0 (-> *display* seconds-per-frame)) + (* 2.0 (seconds-per-frame)) ) ) (ja :num! (seek! max 1.25)) @@ -560,7 +560,7 @@ junglesnake-default-event-handler (defstate junglesnake-give-up (junglesnake) :event junglesnake-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self track-player-ry) #f) (set! (-> self track-player-tilt) #f) (set! (-> self des-ry) (-> self ry)) @@ -618,10 +618,10 @@ junglesnake-default-event-handler ;; definition for method 23 of type junglesnake ;; INFO: Return type mismatch int vs none. -(defmethod junglesnake-method-23 junglesnake ((obj junglesnake)) - (when (not (-> obj is-lethal?)) - (set! (-> obj is-lethal?) #t) - (let ((v1-5 (-> (the-as collide-shape-prim-group (-> obj root-override root-prim)) prims 0))) +(defmethod junglesnake-method-23 junglesnake ((this junglesnake)) + (when (not (-> this is-lethal?)) + (set! (-> this is-lethal?) #t) + (let ((v1-5 (-> (the-as collide-shape-prim-group (-> this root-override root-prim)) prims 0))) (logclear! (-> v1-5 prim-core action) (collide-action solid)) ) ) @@ -631,13 +631,13 @@ junglesnake-default-event-handler ;; definition for method 24 of type junglesnake ;; INFO: Return type mismatch int vs none. -(defmethod junglesnake-method-24 junglesnake ((obj junglesnake)) - (when (-> obj is-lethal?) - (set! (-> obj is-lethal?) #f) - (let ((v1-4 (-> (the-as collide-shape-prim-group (-> obj root-override root-prim)) prims 0))) +(defmethod junglesnake-method-24 junglesnake ((this junglesnake)) + (when (-> this is-lethal?) + (set! (-> this is-lethal?) #f) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root-override root-prim)) prims 0))) (logior! (-> v1-4 prim-core action) (collide-action solid)) ) - (do-push-aways! (-> obj root-override)) + (do-push-aways! (-> this root-override)) ) 0 (none) @@ -677,10 +677,10 @@ junglesnake-default-event-handler ) ;; definition for method 22 of type junglesnake -(defmethod junglesnake-method-22 junglesnake ((obj junglesnake) (arg0 float)) +(defmethod junglesnake-method-22 junglesnake ((this junglesnake) (arg0 float)) (let ((f0-0 0.0)) (dotimes (v1-0 24) - (let ((a2-2 (-> obj twist-joints v1-0))) + (let ((a2-2 (-> this twist-joints v1-0))) (set! (-> a2-2 ry) arg0) (set! (-> a2-2 joint-index) (- 26 v1-0)) (let ((f1-1 (-> *junglesnake-twist-max-deltas* v1-0))) @@ -694,17 +694,17 @@ junglesnake-default-event-handler ) ;; definition for method 21 of type junglesnake -(defmethod junglesnake-method-21 junglesnake ((obj junglesnake)) +(defmethod junglesnake-method-21 junglesnake ((this junglesnake)) (dotimes (v1-0 3) - (let ((a1-2 (-> obj tilt-joints v1-0))) + (let ((a1-2 (-> this tilt-joints v1-0))) (set! (-> a1-2 joint-index) (+ v1-0 23)) (set! (-> a1-2 flip-it) #f) ) ) - (let ((v1-3 (the-as object (&-> obj stack 524)))) + (let ((v1-3 (the-as object (&-> this stack 524)))) (set! (-> (the-as junglesnake-tilt-joint v1-3) flip-it) #t) ) - (let ((v1-4 (the-as object (&-> obj stack 476))) + (let ((v1-4 (the-as object (&-> this stack 476))) (v0-0 #t) ) (set! (-> (the-as junglesnake-twist-joint v1-4) ry) (the-as float v0-0)) @@ -714,9 +714,9 @@ junglesnake-default-event-handler ;; definition for method 11 of type junglesnake ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! junglesnake ((obj junglesnake) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! junglesnake ((this junglesnake) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -807,25 +807,25 @@ junglesnake-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *junglesnake-sg* '()) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *junglesnake-sg* '()) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 173) obj)) - (set! (-> obj is-lethal?) #f) - (set! (-> obj ry) (y-angle (-> obj root-override))) - (set! (-> obj des-ry) (-> obj ry)) - (set! (-> obj tilt) 0.0) - (set! (-> obj des-tilt) (-> obj tilt)) - (set! (-> obj track-player-ry) #f) - (set! (-> obj track-player-tilt) #f) - (quaternion-identity! (-> obj root-override quat)) - (junglesnake-method-22 obj (-> obj ry)) - (junglesnake-method-21 obj) - (logior! (-> obj skel status) (janim-status inited)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 173) this)) + (set! (-> this is-lethal?) #f) + (set! (-> this ry) (y-angle (-> this root-override))) + (set! (-> this des-ry) (-> this ry)) + (set! (-> this tilt) 0.0) + (set! (-> this des-tilt) (-> this tilt)) + (set! (-> this track-player-ry) #f) + (set! (-> this track-player-tilt) #f) + (quaternion-identity! (-> this root-override quat)) + (junglesnake-method-22 this (-> this ry)) + (junglesnake-method-21 this) + (logior! (-> this skel status) (janim-status inited)) (go junglesnake-sleeping) (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc index 1071ad3519..b484aaf21d 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/aphid_REF.gc @@ -12,12 +12,12 @@ ) ;; definition for method 3 of type aphid -(defmethod inspect aphid ((obj aphid)) +(defmethod inspect aphid ((this aphid)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttry: ~D~%" (-> obj try)) - obj + (format #t "~T~Ttry: ~D~%" (-> this try)) + this ) ;; failed to figure out what this is: @@ -42,17 +42,17 @@ ) ;; definition for method 43 of type aphid -(defmethod attack-handler aphid ((obj aphid) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler aphid ((this aphid) (arg0 process) (arg1 event-message-block)) (cond - ((or (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf5)) - (= arg0 (ppointer->process (-> obj parent))) + ((or (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf5)) + (= arg0 (ppointer->process (-> this parent))) ) (send-event arg0 'get-attack-count 1) - (logclear! (-> obj mask) (process-mask actor-pause attackable)) - (go (method-of-object obj nav-enemy-die)) + (logclear! (-> this mask) (process-mask actor-pause attackable)) + (go (method-of-object this nav-enemy-die)) ) (else - (touch-handler obj arg0 arg1) + (touch-handler this arg0 arg1) ) ) ) @@ -91,10 +91,10 @@ (ja :group! (-> self draw art-group data 5)) (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)) - (s5-1 (-> *display* base-frame-counter)) + (s5-1 (current-time)) (s4-1 (- (the int (nav-enemy-rnd-float-range 900.0 1440.0)) gp-0)) ) - (until (>= (- (-> *display* base-frame-counter) s5-1) s4-1) + (until (time-elapsed? s5-1 s4-1) (suspend) (ja :num! (loop! f30-0)) ) @@ -111,10 +111,10 @@ (ja :group! (-> self draw art-group data (-> self nav-info run-anim))) (ja :num-func num-func-identity :frame-num 0.0) (let ((f30-1 (nav-enemy-rnd-float-range 0.9 1.1)) - (s5-3 (-> *display* base-frame-counter)) + (s5-3 (current-time)) (s4-3 (+ (the int (nav-enemy-rnd-float-range 660.0 900.0)) gp-0)) ) - (until (>= (- (-> *display* base-frame-counter) s5-3) s4-3) + (until (time-elapsed? s5-3 s4-3) (suspend) (ja :num! (loop! f30-1)) ) @@ -265,8 +265,8 @@ ;; definition for method 47 of type aphid ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision aphid ((obj aphid)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision aphid ((this aphid)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -283,7 +283,7 @@ (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -291,12 +291,12 @@ ;; definition for method 48 of type aphid ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 aphid ((obj aphid)) - (initialize-skeleton obj *aphid-sg* '()) - (init-defaults! obj *aphid-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 aphid ((this aphid)) + (initialize-skeleton this *aphid-sg* '()) + (init-defaults! this *aphid-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc index c233434424..fc12982559 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/jungleb-obs_REF.gc @@ -18,13 +18,13 @@ ) ;; definition for method 3 of type eggtop -(defmethod inspect eggtop ((obj eggtop)) +(defmethod inspect eggtop ((this eggtop)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcam-tracker: ~D~%" (-> obj cam-tracker)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - obj + (format #t "~T~Tcam-tracker: ~D~%" (-> this cam-tracker)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + this ) ;; failed to figure out what this is: @@ -250,16 +250,16 @@ (while (not (process-grab? *target*)) (suspend) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) (send-event *camera* 'blend-from-as-fixed) (camera-look-at (the-as pair "ecovent-171") (the-as uint 0)) (camera-change-to "camera-223" 0 #f) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 3)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 3)) (suspend) ) ) @@ -308,8 +308,8 @@ ;; definition for method 11 of type eggtop ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! eggtop ((obj eggtop) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! eggtop ((this eggtop) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -327,25 +327,25 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *eggtop-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 189) obj)) - (set! (-> obj sound-id) (new-sound-id)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *eggtop-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 189) this)) + (set! (-> this sound-id) (new-sound-id)) (cond - ((task-complete? *game-info* (-> obj entity extra perm task)) + ((task-complete? *game-info* (-> this entity extra perm task)) (go eggtop-close #t) ) (else (birth-pickup-at-point - (vector+! (new 'stack-no-clear 'vector) (-> obj root-override trans) (new 'static 'vector :y 6144.0 :w 1.0)) + (vector+! (new 'stack-no-clear 'vector) (-> this root-override trans) (new 'static 'vector :y 6144.0 :w 1.0)) (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) + (the float (-> this entity extra perm task)) #f - obj + this (the-as fact-info #f) ) (go eggtop-idle) @@ -364,11 +364,11 @@ ) ;; definition for method 3 of type jng-iris-door -(defmethod inspect jng-iris-door ((obj jng-iris-door)) +(defmethod inspect jng-iris-door ((this jng-iris-door)) (let ((t9-0 (method-of-type eco-door inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -379,8 +379,8 @@ ;; definition for method 24 of type jng-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 jng-iris-door ((obj jng-iris-door)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod eco-door-method-24 jng-iris-door ((this jng-iris-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -392,7 +392,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -400,11 +400,11 @@ ;; definition for method 25 of type jng-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 jng-iris-door ((obj jng-iris-door)) - (initialize-skeleton obj *jng-iris-door-sg* '()) - (set! (-> obj open-distance) 32768.0) - (set! (-> obj close-distance) 49152.0) - (update-transforms! (-> obj root-override)) +(defmethod eco-door-method-25 jng-iris-door ((this jng-iris-door)) + (initialize-skeleton this *jng-iris-door-sg* '()) + (set! (-> this open-distance) 32768.0) + (set! (-> this close-distance) 49152.0) + (update-transforms! (-> this root-override)) 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 c57153c7bf..facfbd3470 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/plant-boss_REF.gc @@ -45,52 +45,52 @@ ) ;; definition for method 3 of type plant-boss -(defmethod inspect plant-boss ((obj plant-boss)) +(defmethod inspect plant-boss ((this plant-boss)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tneck: ~A~%" (-> obj neck)) - (format #t "~T~Tbody: ~A~%" (-> obj body)) - (format #t "~T~Tleaf[2] @ #x~X~%" (-> obj leaf)) - (format #t "~T~Tenergy: ~f~%" (-> obj energy)) - (format #t "~T~Thealth: ~f~%" (-> obj health)) - (format #t "~T~Tate: ~A~%" (-> obj ate)) - (format #t "~T~Tcycle-count: ~D~%" (-> obj cycle-count)) - (format #t "~T~Tsnap-count: ~D~%" (-> obj snap-count)) - (format #t "~T~Tattack-prim[3] @ #x~X~%" (-> obj attack-prim)) - (format #t "~T~Tdeath-prim[3] @ #x~X~%" (-> obj death-prim)) - (format #t "~T~Tcam-tracker: ~D~%" (-> obj cam-tracker)) - (format #t "~T~Twant-aphid-count: ~D~%" (-> obj want-aphid-count)) - (format #t "~T~Taphid-count: ~D~%" (-> obj aphid-count)) - (format #t "~T~Taphid-spawn-time: ~D~%" (-> obj aphid-spawn-time)) - (format #t "~T~Tinterp: ~f~%" (-> obj interp)) - (format #t "~T~Ttry: ~D~%" (-> obj try)) - (format #t "~T~Tcamera: ~D~%" (-> obj camera)) - (format #t "~T~Tmoney: ~D~%" (-> obj money)) - (format #t "~T~Ttry-inc: ~A~%" (-> obj try-inc)) - obj + (format #t "~T~Tneck: ~A~%" (-> this neck)) + (format #t "~T~Tbody: ~A~%" (-> this body)) + (format #t "~T~Tleaf[2] @ #x~X~%" (-> this leaf)) + (format #t "~T~Tenergy: ~f~%" (-> this energy)) + (format #t "~T~Thealth: ~f~%" (-> this health)) + (format #t "~T~Tate: ~A~%" (-> this ate)) + (format #t "~T~Tcycle-count: ~D~%" (-> this cycle-count)) + (format #t "~T~Tsnap-count: ~D~%" (-> this snap-count)) + (format #t "~T~Tattack-prim[3] @ #x~X~%" (-> this attack-prim)) + (format #t "~T~Tdeath-prim[3] @ #x~X~%" (-> this death-prim)) + (format #t "~T~Tcam-tracker: ~D~%" (-> this cam-tracker)) + (format #t "~T~Twant-aphid-count: ~D~%" (-> this want-aphid-count)) + (format #t "~T~Taphid-count: ~D~%" (-> this aphid-count)) + (format #t "~T~Taphid-spawn-time: ~D~%" (-> this aphid-spawn-time)) + (format #t "~T~Tinterp: ~f~%" (-> this interp)) + (format #t "~T~Ttry: ~D~%" (-> this try)) + (format #t "~T~Tcamera: ~D~%" (-> this camera)) + (format #t "~T~Tmoney: ~D~%" (-> this money)) + (format #t "~T~Ttry-inc: ~A~%" (-> this try-inc)) + this ) ;; definition for method 7 of type plant-boss ;; INFO: Return type mismatch process-drawable vs plant-boss. -(defmethod relocate plant-boss ((obj plant-boss) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(defmethod relocate plant-boss ((this plant-boss) (arg0 int)) + (if (nonzero? (-> this neck)) + (&+! (-> this neck) arg0) ) - (if (nonzero? (-> obj body)) - (&+! (-> obj body) arg0) + (if (nonzero? (-> this body)) + (&+! (-> this body) arg0) ) (dotimes (v1-8 3) - (if (nonzero? (-> obj attack-prim v1-8)) - (&+! (-> obj attack-prim v1-8) arg0) + (if (nonzero? (-> this attack-prim v1-8)) + (&+! (-> this attack-prim v1-8) arg0) ) - (if (nonzero? (-> obj death-prim v1-8)) - (&+! (-> obj death-prim v1-8) arg0) + (if (nonzero? (-> this death-prim v1-8)) + (&+! (-> this 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) + ((the-as (function process-drawable int process-drawable) (find-parent-method plant-boss 7)) this arg0) ) ) @@ -120,12 +120,12 @@ ) ;; definition for method 3 of type plant-boss-arm -(defmethod inspect plant-boss-arm ((obj plant-boss-arm)) +(defmethod inspect plant-boss-arm ((this plant-boss-arm)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tside: ~D~%" (-> obj side)) - obj + (format #t "~T~Tside: ~D~%" (-> this side)) + this ) ;; definition of type plant-boss-leaf @@ -150,14 +150,14 @@ ) ;; definition for method 3 of type plant-boss-leaf -(defmethod inspect plant-boss-leaf ((obj plant-boss-leaf)) +(defmethod inspect plant-boss-leaf ((this plant-boss-leaf)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tside: ~D~%" (-> obj side)) - (format #t "~T~Tstate-object: ~A~%" (-> obj state-object)) - (format #t "~T~Tstate-time-frame: ~D~%" (-> obj state-time-frame)) - obj + (format #t "~T~Tside: ~D~%" (-> this side)) + (format #t "~T~Tstate-object: ~A~%" (-> this state-object)) + (format #t "~T~Tstate-time-frame: ~D~%" (-> this state-time-frame)) + this ) ;; failed to figure out what this is: @@ -545,9 +545,9 @@ :code (behavior ((arg0 symbol)) (when (not arg0) (let ((f30-0 (rand-vu-float-range (the-as float 0.0) (the-as float 1.0))) - (gp-0 (-> *display* base-frame-counter)) + (gp-0 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) gp-0) (the int (* 300.0 f30-0))) + (until (time-elapsed? gp-0 (the int (* 300.0 f30-0))) (ja :num! (loop!)) (suspend) ) @@ -591,9 +591,9 @@ (defstate plant-boss-root-die (plant-boss-arm) :code (behavior ((arg0 symbol)) (when (not arg0) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4)) - (+! (-> self root-override trans z) (* -4096.0 (-> *display* seconds-per-frame))) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 4)) + (+! (-> self root-override trans z) (* -4096.0 (seconds-per-frame))) (suspend) ) ) @@ -829,7 +829,7 @@ (case message (('kill) (set! (-> self state-object) #t) - (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> block param 0)))))) + (let ((v0-0 (the-as object (+ (current-time) (the-as time-frame (-> block param 0)))))) (set! (-> self state-time-frame) (the-as time-frame v0-0)) v0-0 ) @@ -864,7 +864,7 @@ (until v1-19 (suspend) (ja :num! (loop!)) - (set! v1-19 (and (-> self state-object) (< (-> self state-time-frame) (-> *display* base-frame-counter)))) + (set! v1-19 (and (-> self state-object) (< (-> self state-time-frame) (current-time)))) ) (go plant-boss-leaf-close) ) @@ -877,7 +877,7 @@ (case message (('kill) (set! (-> self state-object) #t) - (let ((v0-0 (the-as object (+ (-> *display* base-frame-counter) (the-as time-frame (-> block param 0)))))) + (let ((v0-0 (the-as object (+ (current-time) (the-as time-frame (-> block param 0)))))) (set! (-> self state-time-frame) (the-as time-frame v0-0)) v0-0 ) @@ -1020,7 +1020,7 @@ (loop (ja-no-eval :group! plant-boss-main-initial-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (seek! (-> self energy) (the-as float 0.25) (-> *display* seconds-per-frame)) + (seek! (-> self energy) (the-as float 0.25) (seconds-per-frame)) (if (and (and *target* (>= 245760.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) @@ -1049,7 +1049,7 @@ (ja :group! plant-boss-main-intro-ja :num! (identity (ja-aframe (the-as float 510.0) 0))) (b! #t cfg-3 :delay (nop!)) (label cfg-2) - (seek! (-> self energy) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self energy) (the-as float 1.0) (* 2.0 (seconds-per-frame))) (suspend) (label cfg-3) (let ((v1-22 (-> self skel channel))) @@ -1077,8 +1077,8 @@ (suspend) ) (camera-change-to "camera-222" 600 #f) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 2)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) (suspend) ) ) @@ -1108,7 +1108,7 @@ (ja-channel-push! 1 (seconds 0.5)) (ja-no-eval :group! plant-boss-main-intro-ja :num! (seek! (ja-aframe (the-as float 510.0) 0)) :frame-num 0.0) (until (ja-done? 0) - (seek! (-> self energy) (the-as float 1.0) (* 0.2 (-> *display* seconds-per-frame))) + (seek! (-> self energy) (the-as float 1.0) (* 0.2 (seconds-per-frame))) (ja-blend-eval) (suspend) (ja :num! (seek! (ja-aframe (the-as float 510.0) 0))) @@ -1131,7 +1131,7 @@ :event plant-boss-default-event-handler :enter (behavior () (set-setting! 'music 'danger 0.0 0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self body flex-blend) 0.0) (set! (-> self neck flex-blend) 1.0) ) @@ -1141,21 +1141,21 @@ (go plant-boss-far-idle) ) (if (and (< f30-0 143360.0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (cond - ((>= (-> self try) 15) - 1500 - ) - ((>= (-> self try) 10) - 1200 - ) - ((>= (-> self try) 5) - 900 - ) - (else - 600 - ) - ) - ) + (time-elapsed? (-> self state-time) (cond + ((>= (-> self try) 15) + 1500 + ) + ((>= (-> self try) 10) + 1200 + ) + ((>= (-> self try) 5) + 900 + ) + (else + 600 + ) + ) + ) *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -1241,7 +1241,7 @@ ) (set! (-> self try-inc) #t) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (+! (-> self cycle-count) 1) (set! (-> self snap-count) 0) (set! (-> self body flex-blend) 0.0) @@ -1284,11 +1284,11 @@ ) ) ) - ((>= (- (-> *display* base-frame-counter) (-> self aphid-spawn-time)) (seconds 1.4)) + ((time-elapsed? (-> self aphid-spawn-time) (seconds 1.4)) (when (process-spawn aphid self (-> self root-override trans) (target-pos 0) :to self) (+! (-> self aphid-count) 1) (seekl! (-> self want-aphid-count) 0 1) - (set! (-> self aphid-spawn-time) (-> *display* base-frame-counter)) + (set-time! (-> self aphid-spawn-time)) ) ) ) @@ -1322,7 +1322,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self body flex-blend) 0.0) (set! (-> self neck flex-blend) 0.0) (set! (-> self attack-prim 0 local-sphere w) 12288.0) @@ -1381,7 +1381,7 @@ ) ) ) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) gp-5) + (while (not (time-elapsed? (-> self state-time) gp-5)) (ja-no-eval :group! plant-boss-main-vulnerable-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) @@ -1446,8 +1446,8 @@ ) ) (until (or v1-64 (ja-done? 0)) - (seek! (-> self body flex-blend) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) - (seek! (-> self neck flex-blend) (the-as float 0.0) (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self body flex-blend) (the-as float 1.0) (* 2.0 (seconds-per-frame))) + (seek! (-> self neck flex-blend) (the-as float 0.0) (* 2.0 (seconds-per-frame))) (set! f30-0 (seek f30-0 (lerp-scale @@ -1457,7 +1457,7 @@ (the-as float 26624.0) (the-as float 86016.0) ) - (* 2.0 (-> *display* seconds-per-frame)) + (* 2.0 (seconds-per-frame)) ) ) (set! (-> self interp) f30-0) @@ -1503,7 +1503,7 @@ ) (until (>= (ja-aframe-num 0) 285.0) (try-preload-stream *art-control* "$GAMCAM29" 0 self (the-as float -99.0)) - (seek! (-> self energy) (the-as float 0.5) (* 0.2 (-> *display* seconds-per-frame))) + (seek! (-> self energy) (the-as float 0.5) (* 0.2 (seconds-per-frame))) (when (and (>= (ja-aframe-num 0) 175.0) (zero? gp-0)) (set! gp-0 1) (set! (-> self camera) (ppointer->handle (process-spawn othercam self 28 #f #t :to self))) @@ -1514,8 +1514,8 @@ (set! gp-0 2) (send-event (handle->process (-> self camera)) 'joint "camera2") ) - (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) - (seek! (-> self interp) (the-as float 0.0) (-> *display* seconds-per-frame)) + (seek! (-> self body flex-blend) (the-as float 0.0) (seconds-per-frame)) + (seek! (-> self interp) (the-as float 0.0) (seconds-per-frame)) (ja :num! (seek! max 0.66)) (ja :chan 1 :num! (chan 0) :frame-interp (-> self interp)) (suspend) @@ -1552,9 +1552,9 @@ (ja-no-eval :group! plant-boss-main-reset-ja :num! (seek! (ja-aframe (the-as float 210.0) 0)) :frame-num 0.0) (until (ja-done? 0) (ja-blend-eval) - (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) + (seek! (-> self body flex-blend) (the-as float 0.0) (seconds-per-frame)) (if (>= 1 arg0) - (seek! (-> self neck flex-blend) (the-as float 1.0) (-> *display* seconds-per-frame)) + (seek! (-> self neck flex-blend) (the-as float 1.0) (seconds-per-frame)) ) (suspend) (ja :num! (seek! (ja-aframe (the-as float 210.0) 0))) @@ -1567,8 +1567,8 @@ :frame-num (ja-aframe (the-as float 210.0) 0) ) (until (ja-done? 0) - (seek! (-> self body flex-blend) (the-as float 0.0) (-> *display* seconds-per-frame)) - (seek! (-> self neck flex-blend) (the-as float 1.0) (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self body flex-blend) (the-as float 0.0) (seconds-per-frame)) + (seek! (-> self neck flex-blend) (the-as float 1.0) (* 2.0 (seconds-per-frame))) (suspend) (ja :num! (seek! (ja-aframe (the-as float 240.0) 0))) ) @@ -1762,8 +1762,8 @@ :code (behavior () (ja-channel-set! 1) (ja :group! plant-boss-main-die-ja :num! max) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 5)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 5)) (transform-post) (do-push-aways! (-> self root-override)) (suspend) @@ -1811,9 +1811,9 @@ ;; definition for method 11 of type plant-boss ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! plant-boss ((obj plant-boss) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! plant-boss ((this plant-boss) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1844,7 +1844,7 @@ (set! (-> s2-2 transform-index) 13) (set-vector! (-> s2-2 local-sphere) 0.0 8192.0 0.0 16384.0) (append-prim s3-0 s2-2) - (set! (-> obj attack-prim 0) s2-2) + (set! (-> this attack-prim 0) s2-2) ) (let ((s2-3 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s2-3 prim-core collide-as) (collide-kind)) @@ -1853,7 +1853,7 @@ (set! (-> s2-3 transform-index) 13) (set-vector! (-> s2-3 local-sphere) 0.0 8192.0 0.0 16384.0) (append-prim s3-0 s2-3) - (set! (-> obj death-prim 0) s2-3) + (set! (-> this death-prim 0) s2-3) ) (let ((s2-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) (set! (-> s2-4 prim-core collide-as) (collide-kind)) @@ -1862,147 +1862,163 @@ (set! (-> s2-4 transform-index) 12) (set-vector! (-> s2-4 local-sphere) 0.0 -24576.0 0.0 40960.0) (append-prim s3-0 s2-4) - (set! (-> obj death-prim 1) s2-4) + (set! (-> this death-prim 1) s2-4) ) ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *plant-boss-sg* '()) - (set! (-> obj draw shadow-ctrl) *plant-boss-shadow-control*) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *plant-boss-sg* '()) + (set! (-> this draw shadow-ctrl) *plant-boss-shadow-control*) (process-spawn plant-boss-arm :init plant-boss-arm-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0)) + (vector+! + (new-stack-vector0) + (-> this root-override trans) + (new 'static 'vector :x -24576.0 :z 8192.0 :w 1.0) + ) -8192.0 1 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-arm-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 24576.0 :z 8192.0 :w 1.0)) 8192.0 0 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-back-arms-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :w 1.0)) 0.0 2 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 38912.0 :z 8192.0 :w 1.0)) (new 'static 'vector :y 14563.556) 1.0 3 - :to obj - ) - (process-spawn - plant-boss-arm - :init plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0)) - (new 'static 'vector :y -5461.3335) - 1.0 - 3 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-vine-init (vector+! (new-stack-vector0) - (-> obj root-override trans) + (-> this root-override trans) + (new 'static 'vector :x -40960.0 :z 8192.0 :w 1.0) + ) + (new 'static 'vector :y -5461.3335) + 1.0 + 3 + :to this + ) + (process-spawn + plant-boss-arm + :init plant-boss-vine-init + (vector+! + (new-stack-vector0) + (-> this root-override trans) (new 'static 'vector :x -29491.2 :z -7168.0 :w 1.0) ) (new 'static 'vector :x -1820.4445 :y -11286.756) 0.8 3 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-vine-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0)) + (vector+! + (new-stack-vector0) + (-> this root-override trans) + (new 'static 'vector :x 32768.0 :z -3072.0 :w 1.0) + ) (new 'static 'vector :x -910.2222 :y 22755.555) 0.8 3 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :x 18841.6 :z 4096.0 :w 1.0)) (new 'static 'vector :y -4096.0) (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) 4 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0)) + (vector+! + (new-stack-vector0) + (-> this root-override trans) + (new 'static 'vector :x -18841.6 :z 4096.0 :w 1.0) + ) (new 'static 'vector :x 364.0889 :y 4096.0) (new 'static 'vector :x 1.0 :y 1.25 :z 1.0) 4 - :to obj + :to this ) (process-spawn plant-boss-arm :init plant-boss-root-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :z -2048.0 :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :z -2048.0 :w 1.0)) (new 'static 'vector :x 1820.4445) (new 'static 'vector :x 0.9 :y 1.5 :z 1.0) 4 - :to obj + :to this ) - (set! (-> obj leaf 0) + (set! (-> this leaf 0) (process-spawn plant-boss-leaf :init plant-boss-leaf-init - (vector+! (new-stack-vector0) (-> obj root-override trans) (new 'static 'vector :w 1.0)) + (vector+! (new-stack-vector0) (-> this root-override trans) (new 'static 'vector :w 1.0)) 0.0 0 - :to obj + :to this ) ) - (set! (-> obj leaf 1) (process-spawn - plant-boss-leaf - :init plant-boss-leaf-init - (vector+! - (new-stack-vector0) - (-> obj root-override trans) - (new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0) - ) - 0.0 - 1 - :to obj - ) + (set! (-> this leaf 1) (process-spawn + plant-boss-leaf + :init plant-boss-leaf-init + (vector+! + (new-stack-vector0) + (-> this root-override trans) + (new 'static 'vector :x -13189.12 :y 2838.528 :z 12288.0 :w 1.0) + ) + 0.0 + 1 + :to this + ) ) - (set! (-> obj energy) 0.25) - (set! (-> obj health) 3.0) - (set! (-> obj cam-tracker) (the-as handle #f)) - (set! (-> obj camera) (the-as handle #f)) - (set! (-> obj money) (the-as handle #f)) - (set! (-> obj try-inc) #f) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 13)) - (set-vector! (-> obj neck twist-max) 3640.889 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) - (set! (-> obj body) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) obj 4)) - (set-vector! (-> obj body twist-max) 0.0 8192.0 0.0 1.0) - (set! (-> obj body up) (the-as uint 1)) - (set! (-> obj body nose) (the-as uint 0)) - (set! (-> obj body ear) (the-as uint 2)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this energy) 0.25) + (set! (-> this health) 3.0) + (set! (-> this cam-tracker) (the-as handle #f)) + (set! (-> this camera) (the-as handle #f)) + (set! (-> this money) (the-as handle #f)) + (set! (-> this try-inc) #f) + (set! (-> this neck) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) this 13)) + (set-vector! (-> this neck twist-max) 3640.889 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) + (set! (-> this body) (new 'process 'joint-mod (joint-mod-handler-mode flex-blend) this 4)) + (set-vector! (-> this body twist-max) 0.0 8192.0 0.0 1.0) + (set! (-> this body up) (the-as uint 1)) + (set! (-> this body nose) (the-as uint 0)) + (set! (-> this body ear) (the-as uint 2)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go plant-boss-dead #t) ) (go plant-boss-far-idle) diff --git a/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc b/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc index c3abaff6b6..941fc9386c 100644 --- a/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc +++ b/test/decompiler/reference/jak1/levels/jungleb/plat-flip_REF.gc @@ -24,20 +24,20 @@ ) ;; definition for method 3 of type plat-flip -(defmethod inspect plat-flip ((obj plat-flip)) +(defmethod inspect plat-flip ((this plat-flip)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~T~Tbefore-turn-down-time: ~f~%" (-> obj before-turn-down-time)) - (format #t "~T~Tturn-down-time: ~f~%" (-> obj turn-down-time)) - (format #t "~T~Tbefore-turn-up-time: ~f~%" (-> obj before-turn-up-time)) - (format #t "~T~Tturn-up-time: ~f~%" (-> obj turn-up-time)) - (format #t "~T~Ttotal-time: ~f~%" (-> obj total-time)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tbase-pos: #~%" (-> obj base-pos)) - (format #t "~T~Tsmush: #~%" (-> obj smush)) - obj + (format #t "~T~Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~T~Tbefore-turn-down-time: ~f~%" (-> this before-turn-down-time)) + (format #t "~T~Tturn-down-time: ~f~%" (-> this turn-down-time)) + (format #t "~T~Tbefore-turn-up-time: ~f~%" (-> this before-turn-up-time)) + (format #t "~T~Tturn-up-time: ~f~%" (-> this turn-up-time)) + (format #t "~T~Ttotal-time: ~f~%" (-> this total-time)) + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tbase-pos: #~%" (-> this base-pos)) + (format #t "~T~Tsmush: #~%" (-> this smush)) + this ) ;; failed to figure out what this is: @@ -117,10 +117,10 @@ ;; definition for method 11 of type plat-flip ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! plat-flip ((obj plat-flip) (arg0 entity-actor)) +(defmethod init-from-entity! plat-flip ((this plat-flip) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -138,42 +138,45 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj base-pos quad) (-> obj root-override trans quad)) - (initialize-skeleton obj *plat-flip-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (set! (-> this base-pos quad) (-> this root-override trans quad)) + (initialize-skeleton this *plat-flip-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (let ((f30-0 300.0)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-28 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-16)))) - (set! (-> obj before-turn-down-time) (* f30-0 (if (and v1-28 (> (the-as int (-> sv-16 elt-count)) 0)) - (-> (the-as (pointer float) v1-28)) - 2.0 - ) - ) + (set! (-> this before-turn-down-time) (* f30-0 (if (and v1-28 (> (the-as int (-> sv-16 elt-count)) 0)) + (-> (the-as (pointer float) v1-28)) + 2.0 + ) + ) ) ) ) (let ((f30-1 300.0)) (set! sv-32 (new 'static 'res-tag)) (let ((v1-31 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-32)))) - (set! (-> obj before-turn-up-time) (* f30-1 (if (and v1-31 (< 1 (the-as int (-> sv-32 elt-count)))) - (-> (the-as (pointer float) v1-31) 1) - 0.2 - ) - ) + (set! (-> this before-turn-up-time) (* f30-1 (if (and v1-31 (< 1 (the-as int (-> sv-32 elt-count)))) + (-> (the-as (pointer float) v1-31) 1) + 0.2 + ) + ) ) ) ) - (set! (-> obj turn-down-time) 300.0) - (set! (-> obj turn-up-time) 300.0) - (set! (-> obj total-time) - (+ (-> obj before-turn-down-time) (-> obj turn-down-time) (-> obj before-turn-up-time) (-> obj turn-up-time)) + (set! (-> this turn-down-time) 300.0) + (set! (-> this turn-up-time) 300.0) + (set! (-> this total-time) (+ (-> this before-turn-down-time) + (-> this turn-down-time) + (-> this before-turn-up-time) + (-> this turn-up-time) + ) ) - (let ((s4-1 (-> obj sync)) + (let ((s4-1 (-> this sync)) (s3-1 (method-of-type sync-info setup-params!)) - (s2-0 (the int (-> obj total-time))) + (s2-0 (the int (-> this total-time))) ) (set! sv-48 (new 'static 'res-tag)) (let ((v1-35 (res-lump-data arg0 'sync-percent pointer :tag-ptr (& sv-48)))) @@ -189,7 +192,7 @@ ) ) ) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (go plat-flip-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc index 8ed8ca9740..a9b411cb42 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/assistant-lavatube_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type assistant-lavatube-start -(defmethod inspect assistant-lavatube-start ((obj assistant-lavatube-start)) +(defmethod inspect assistant-lavatube-start ((this assistant-lavatube-start)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -26,11 +26,11 @@ ) ;; definition for method 32 of type assistant-lavatube-start -(defmethod play-anim! assistant-lavatube-start ((obj assistant-lavatube-start) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! assistant-lavatube-start ((this assistant-lavatube-start) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (if arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "assistant-lavatube-start-resolution" @@ -44,18 +44,18 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) ;; definition for method 31 of type assistant-lavatube-start -(defmethod get-art-elem assistant-lavatube-start ((obj assistant-lavatube-start)) - (-> obj draw art-group data 3) +(defmethod get-art-elem assistant-lavatube-start ((this assistant-lavatube-start)) + (-> this draw art-group data 3) ) ;; failed to figure out what this is: @@ -68,7 +68,7 @@ #t ) (else - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) ) @@ -76,7 +76,7 @@ (not (movie?)) (not (level-hint-displayed?)) (not (and *cheat-mode* (cpad-hold? 0 l3))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) + (not (time-elapsed? (-> self state-time) (seconds 10))) ) ) (hide-hud) @@ -146,16 +146,16 @@ ) ;; definition for method 39 of type assistant-lavatube-start -(defmethod should-display? assistant-lavatube-start ((obj assistant-lavatube-start)) - (first-any (-> obj tasks) #t) - (= (current-status (-> obj tasks)) (task-status need-reward-speech)) +(defmethod should-display? assistant-lavatube-start ((this assistant-lavatube-start)) + (first-any (-> this tasks) #t) + (= (current-status (-> this tasks)) (task-status need-reward-speech)) ) ;; definition for method 11 of type assistant-lavatube-start -(defmethod init-from-entity! assistant-lavatube-start ((obj assistant-lavatube-start) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-lavatube-start-sg* 3 29 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task lavatube-start))) - (first-any (-> obj tasks) #t) - (process-taskable-method-42 obj) +(defmethod init-from-entity! assistant-lavatube-start ((this assistant-lavatube-start) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-lavatube-start-sg* 3 29 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task lavatube-start))) + (first-any (-> this tasks) #t) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc index 031f6c8547..9dd99fa0a9 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-energy_REF.gc @@ -388,12 +388,12 @@ ) ;; definition for method 3 of type energydoor -(defmethod inspect energydoor ((obj energydoor)) +(defmethod inspect energydoor ((this energydoor)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; failed to figure out what this is: @@ -565,9 +565,9 @@ ;; definition for method 11 of type energydoor ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! energydoor ((obj energydoor) (arg0 entity-actor)) +(defmethod init-from-entity! energydoor ((this energydoor) (arg0 entity-actor)) (with-pp - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -584,17 +584,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *energydoor-sg* '()) - (set! (-> obj root-override pause-adjust-distance) 245760.0) - (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *energydoor-sg* '()) + (set! (-> this root-override pause-adjust-distance) 245760.0) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) (cond ((< (energydoor-player-dist) -409600.0) (go energydoor-closed-till-near) ) - ((task-closed? (-> obj entity extra perm task) (task-status need-resolution)) + ((task-closed? (-> this entity extra perm task) (task-status need-resolution)) (go energydoor-opened) ) (else @@ -603,7 +603,7 @@ (set! (-> a1-9 num-params) 0) (set! (-> a1-9 message) 'open?) (let ((t9-12 send-event-function) - (v1-25 (-> obj alt-actor)) + (v1-25 (-> this alt-actor)) ) (cond ((t9-12 @@ -644,11 +644,11 @@ ) ;; definition for method 3 of type energybase -(defmethod inspect energybase ((obj energybase)) +(defmethod inspect energybase ((this energybase)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -713,10 +713,10 @@ ;; definition for method 11 of type energybase ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! energybase ((obj energybase) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *energybase-sg* '()) +(defmethod init-from-entity! energybase ((this energybase) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *energybase-sg* '()) (if (task-closed? (game-task lavatube-balls) (task-status need-resolution)) (go energybase-stopped) (go energybase-idle) @@ -749,20 +749,20 @@ ) ;; definition for method 3 of type energyhub -(defmethod inspect energyhub ((obj energyhub)) +(defmethod inspect energyhub ((this energyhub)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Talts[3] @ #x~X~%" (-> obj alts)) - (format #t "~T~Tarm[5] @ #x~X~%" (-> obj arm)) - (format #t "~T~Trot-mat: #~%" (-> obj rot-mat)) - (format #t "~T~Trot-mat-init: #~%" (-> obj rot-mat-init)) - (format #t "~T~Trotation-speed: #~%" (-> obj rotation-speed)) - (format #t "~T~Trotation-speed-offset: #~%" (-> obj rotation-speed-offset)) - (format #t "~T~Ty-rotation: ~f~%" (-> obj y-rotation)) - (format #t "~T~Tx-rotation: ~f~%" (-> obj x-rotation)) - (format #t "~T~Tpalette-val: ~f~%" (-> obj palette-val)) - obj + (format #t "~T~Talts[3] @ #x~X~%" (-> this alts)) + (format #t "~T~Tarm[5] @ #x~X~%" (-> this arm)) + (format #t "~T~Trot-mat: #~%" (-> this rot-mat)) + (format #t "~T~Trot-mat-init: #~%" (-> this rot-mat-init)) + (format #t "~T~Trotation-speed: #~%" (-> this rotation-speed)) + (format #t "~T~Trotation-speed-offset: #~%" (-> this rotation-speed-offset)) + (format #t "~T~Ty-rotation: ~f~%" (-> this y-rotation)) + (format #t "~T~Tx-rotation: ~f~%" (-> this x-rotation)) + (format #t "~T~Tpalette-val: ~f~%" (-> this palette-val)) + this ) ;; definition of type energyarm @@ -793,20 +793,20 @@ ) ;; definition for method 3 of type energyarm -(defmethod inspect energyarm ((obj energyarm)) +(defmethod inspect energyarm ((this energyarm)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Toffset: #~%" (-> obj offset)) - (format #t "~T~Ty-rotation: ~f~%" (-> obj y-rotation)) - (format #t "~T~Ty-chatter-rotation: #~%" (-> obj y-chatter-rotation)) - (format #t "~T~Ty-chatter-min: #~%" (-> obj y-chatter-min)) - (format #t "~T~Tx-rotation: #~%" (-> obj x-rotation)) - (format #t "~T~Tx-fall-rotation: #~%" (-> obj x-fall-rotation)) - (format #t "~T~Trot-mat: #~%" (-> obj rot-mat)) - (format #t "~T~Tball: ~D~%" (-> obj ball)) - (format #t "~T~Tx-correction: ~f~%" (-> obj x-correction)) - obj + (format #t "~T~Toffset: #~%" (-> this offset)) + (format #t "~T~Ty-rotation: ~f~%" (-> this y-rotation)) + (format #t "~T~Ty-chatter-rotation: #~%" (-> this y-chatter-rotation)) + (format #t "~T~Ty-chatter-min: #~%" (-> this y-chatter-min)) + (format #t "~T~Tx-rotation: #~%" (-> this x-rotation)) + (format #t "~T~Tx-fall-rotation: #~%" (-> this x-fall-rotation)) + (format #t "~T~Trot-mat: #~%" (-> this rot-mat)) + (format #t "~T~Tball: ~D~%" (-> this ball)) + (format #t "~T~Tx-correction: ~f~%" (-> this x-correction)) + this ) ;; definition of type energyball @@ -824,11 +824,11 @@ ) ;; definition for method 3 of type energyball -(defmethod inspect energyball ((obj energyball)) +(defmethod inspect energyball ((this energyball)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -876,7 +876,7 @@ ) (s4-0 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'matrix)) - (f0-1 (the float (-> *display* base-frame-counter))) + (f0-1 (the float (current-time))) (f30-0 (- f0-1 (* (the float (the int (/ f0-1 -150.0))) -150.0))) ) (when gp-0 @@ -1224,11 +1224,10 @@ ;; definition for function energyhub-trans (defbehavior energyhub-trans energyhub () - (+! (-> self y-rotation) - (* 36.40889 - (-> self rotation-speed value) - (the float (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) - ) + (+! (-> self y-rotation) (* 36.40889 + (-> self rotation-speed value) + (the float (- (current-time) (-> *display* old-base-frame-counter))) + ) ) (cond ((< 65536.0 (-> self y-rotation)) @@ -1239,7 +1238,7 @@ ) ) (let ((gp-0 (new 'stack-no-clear 'matrix))) - (let* ((f0-9 (the float (-> *display* base-frame-counter))) + (let* ((f0-9 (the float (current-time))) (f28-0 (- f0-9 (* (the float (the int (/ f0-9 1200.0))) 1200.0))) ) (matrix-rotate-y! gp-0 (-> self y-rotation)) @@ -1462,17 +1461,17 @@ ;; definition for method 11 of type energyhub ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! energyhub ((obj energyhub) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *energyhub-sg* '()) - (set! (-> obj sound) (new 'process 'ambient-sound arg0 (-> obj root trans))) - (let ((s5-1 (entity-actor-count (-> obj entity) 'alt-actor))) +(defmethod init-from-entity! energyhub ((this energyhub) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *energyhub-sg* '()) + (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root trans))) + (let ((s5-1 (entity-actor-count (-> this entity) 'alt-actor))) (dotimes (s4-0 (min 3 s5-1)) - (set! (-> obj alts s4-0) (entity-actor-lookup (-> obj entity) 'alt-actor s4-0)) + (set! (-> this alts s4-0) (entity-actor-lookup (-> this entity) 'alt-actor s4-0)) ) ) - (quaternion->matrix (-> obj rot-mat-init) (-> obj root quat)) + (quaternion->matrix (-> this rot-mat-init) (-> this root quat)) (let ((f30-0 13107.2) (s5-2 (new 'stack-no-clear 'vector)) (s4-1 (new 'stack-no-clear 'matrix)) @@ -1480,22 +1479,24 @@ (set-vector! s5-2 0.0 2457.6 -24576.0 1.0) (matrix-rotate-y! s4-1 f30-0) (dotimes (s3-0 5) - (set! (-> obj arm s3-0) (ppointer->handle (process-spawn energyarm s5-2 (* (the float s3-0) f30-0) :to obj))) + (set! (-> this arm s3-0) + (ppointer->handle (process-spawn energyarm s5-2 (* (the float s3-0) f30-0) :to this)) + ) (vector-matrix*! s5-2 s5-2 s4-1) ) ) - (set! (-> obj root pause-adjust-distance) 245760.0) - (set! (-> obj y-rotation) 0.0) - (set! (-> obj x-rotation) 0.0) - (set-params! (-> obj rotation-speed-offset) 300 600 0.25) - (set! (-> obj palette-val) 0.0) + (set! (-> this root pause-adjust-distance) 245760.0) + (set! (-> this y-rotation) 0.0) + (set! (-> this x-rotation) 0.0) + (set-params! (-> this rotation-speed-offset) 300 600 0.25) + (set! (-> this palette-val) 0.0) (cond ((task-closed? (game-task lavatube-balls) (task-status need-resolution)) - (set-params! (-> obj rotation-speed) 0.0 0.01 0.1 0.9) + (set-params! (-> this rotation-speed) 0.0 0.01 0.1 0.9) (go energyhub-stopped) ) (else - (set-params! (-> obj rotation-speed) 1.0 0.01 0.1 0.9) + (set-params! (-> this rotation-speed) 1.0 0.01 0.1 0.9) (go energyhub-idle) ) ) @@ -1516,11 +1517,11 @@ ) ;; definition for method 3 of type energylava -(defmethod inspect energylava ((obj energylava)) +(defmethod inspect energylava ((this energylava)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1542,10 +1543,10 @@ ;; definition for method 11 of type energylava ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! energylava ((obj energylava) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *energylava-sg* '()) +(defmethod init-from-entity! energylava ((this energylava) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *energylava-sg* '()) (go energylava-idle) (none) ) 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 6ebac18490..0502dd5ad2 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-obs_REF.gc @@ -14,11 +14,11 @@ ) ;; definition for method 3 of type lavabase -(defmethod inspect lavabase ((obj lavabase)) +(defmethod inspect lavabase ((this lavabase)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -44,10 +44,10 @@ ;; definition for method 11 of type lavabase ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavabase ((obj lavabase) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavabase-sg* '()) +(defmethod init-from-entity! lavabase ((this lavabase) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavabase-sg* '()) (go lavabase-idle) (none) ) @@ -65,11 +65,11 @@ ) ;; definition for method 3 of type lavafall -(defmethod inspect lavafall ((obj lavafall)) +(defmethod inspect lavafall ((this lavafall)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -95,10 +95,10 @@ ;; definition for method 11 of type lavafall ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavafall ((obj lavafall) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavafall-sg* '()) +(defmethod init-from-entity! lavafall ((this lavafall) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavafall-sg* '()) (go lavafall-idle) (none) ) @@ -116,11 +116,11 @@ ) ;; definition for method 3 of type lavashortcut -(defmethod inspect lavashortcut ((obj lavashortcut)) +(defmethod inspect lavashortcut ((this lavashortcut)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -146,10 +146,10 @@ ;; definition for method 11 of type lavashortcut ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavashortcut ((obj lavashortcut) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavashortcut-sg* '()) +(defmethod init-from-entity! lavashortcut ((this lavashortcut) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavashortcut-sg* '()) (go lavashortcut-idle) (none) ) @@ -392,11 +392,11 @@ ) ;; definition for method 3 of type darkecobarrel-leak -(defmethod inspect darkecobarrel-leak ((obj darkecobarrel-leak)) - (format #t "[~8x] ~A~%" obj 'darkecobarrel-leak) - (format #t "~Toffset: #~%" (-> obj offset)) - (format #t "~Tfirst-frame: ~A~%" (-> obj first-frame)) - obj +(defmethod inspect darkecobarrel-leak ((this darkecobarrel-leak)) + (format #t "[~8x] ~A~%" this 'darkecobarrel-leak) + (format #t "~Toffset: #~%" (-> this offset)) + (format #t "~Tfirst-frame: ~A~%" (-> this first-frame)) + this ) ;; definition of type darkecobarrel-base @@ -412,13 +412,13 @@ ) ;; definition for method 3 of type darkecobarrel-base -(defmethod inspect darkecobarrel-base ((obj darkecobarrel-base)) +(defmethod inspect darkecobarrel-base ((this darkecobarrel-base)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Tsync: ~D~%" (-> obj sync)) - obj + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Tsync: ~D~%" (-> this sync)) + this ) ;; definition of type darkecobarrel-mover @@ -442,18 +442,18 @@ ) ;; definition for method 3 of type darkecobarrel-mover -(defmethod inspect darkecobarrel-mover ((obj darkecobarrel-mover)) +(defmethod inspect darkecobarrel-mover ((this darkecobarrel-mover)) (let ((t9-0 (method-of-type darkecobarrel-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~T~Thits: ~D~%" (-> obj hits)) - (format #t "~T~Tleak[1] @ #x~X~%" (-> obj leak)) - (format #t "~T~Ty-offset: #~%" (-> obj y-offset)) - (format #t "~T~Ty-offset-tgt: #~%" (-> obj y-offset-tgt)) - (format #t "~T~Tdown: #~%" (-> obj down)) - (format #t "~T~Tdown-tgt: #~%" (-> obj down-tgt)) - obj + (format #t "~T~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~T~Thits: ~D~%" (-> this hits)) + (format #t "~T~Tleak[1] @ #x~X~%" (-> this leak)) + (format #t "~T~Ty-offset: #~%" (-> this y-offset)) + (format #t "~T~Ty-offset-tgt: #~%" (-> this y-offset-tgt)) + (format #t "~T~Tdown: #~%" (-> this down)) + (format #t "~T~Tdown-tgt: #~%" (-> this down-tgt)) + this ) ;; definition of type darkecobarrel @@ -472,24 +472,24 @@ ) ;; definition for method 3 of type darkecobarrel -(defmethod inspect darkecobarrel ((obj darkecobarrel)) +(defmethod inspect darkecobarrel ((this darkecobarrel)) (let ((t9-0 (method-of-type darkecobarrel-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspawn-array: ~A~%" (-> obj spawn-array)) - (format #t "~T~Tcur-spawn: ~D~%" (-> obj cur-spawn)) - obj + (format #t "~T~Tspawn-array: ~A~%" (-> this spawn-array)) + (format #t "~T~Tcur-spawn: ~D~%" (-> this cur-spawn)) + this ) ;; definition for method 7 of type darkecobarrel ;; INFO: Return type mismatch darkecobarrel-base vs darkecobarrel. -(defmethod relocate darkecobarrel ((obj darkecobarrel) (arg0 int)) - (if (nonzero? (-> obj spawn-array)) - (&+! (-> obj spawn-array) arg0) +(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)) obj arg0) + ((the-as (function darkecobarrel-base int darkecobarrel-base) (find-parent-method darkecobarrel 7)) this arg0) ) ) @@ -502,7 +502,7 @@ ;; definition for function darkecobarrel-base-time (defbehavior darkecobarrel-base-time darkecobarrel-base () - (+ (-> *display* base-frame-counter) (-> self sync)) + (+ (current-time) (-> self sync)) ) ;; definition for function darkecobarrel-base-pos @@ -597,8 +597,8 @@ ) ) (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (cleanup-for-death self) @@ -806,62 +806,62 @@ ;; definition for method 11 of type darkecobarrel ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! darkecobarrel ((obj darkecobarrel) (arg0 entity-actor)) +(defmethod init-from-entity! darkecobarrel ((this darkecobarrel) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj root-override) (the-as collide-shape-moving (new 'process 'trsqv))) + (set! (-> this root-override) (the-as collide-shape-moving (new 'process 'trsqv))) (darkecobarrel-base-init arg0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> obj root-override trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "lav-dark-eco" :fo-max 30) (-> this root-override trans)) ) - (logior! (-> obj draw status) (draw-status hidden)) - (set! (-> obj speed) (/ 300.0 (res-lump-float (-> obj entity) 'speed :default 61440.0))) + (logior! (-> this draw status) (draw-status hidden)) + (set! (-> this speed) (/ 300.0 (res-lump-float (-> this entity) 'speed :default 61440.0))) (set! sv-16 (new 'static 'res-tag)) (let ((s5-1 (res-lump-data arg0 'delay pointer :tag-ptr (& sv-16)))) (cond (s5-1 - (set! (-> obj spawn-array) (new 'process 'boxed-array time-frame (the-as int (-> sv-16 elt-count)))) + (set! (-> this spawn-array) (new 'process 'boxed-array time-frame (the-as int (-> sv-16 elt-count)))) (dotimes (v1-12 (the-as int (-> sv-16 elt-count))) - (set! (-> obj spawn-array v1-12) - (the int (* (fabs (-> obj speed)) (-> (the-as (pointer float) (&+ s5-1 (* v1-12 4)))))) + (set! (-> this spawn-array v1-12) + (the int (* (fabs (-> this speed)) (-> (the-as (pointer float) (&+ s5-1 (* v1-12 4)))))) ) ) ) (else - (set! (-> obj spawn-array) (new 'process 'boxed-array time-frame 4)) - (set! (-> obj spawn-array 0) (the int (* 45056.0 (fabs (-> obj speed))))) - (set! (-> obj spawn-array 1) (the int (* 90112.0 (fabs (-> obj speed))))) - (set! (-> obj spawn-array 2) (the int (* 45056.0 (fabs (-> obj speed))))) - (set! (-> obj spawn-array 3) (the int (* 135168.0 (fabs (-> obj speed))))) + (set! (-> this spawn-array) (new 'process 'boxed-array time-frame 4)) + (set! (-> this spawn-array 0) (the int (* 45056.0 (fabs (-> this speed))))) + (set! (-> this spawn-array 1) (the int (* 90112.0 (fabs (-> this speed))))) + (set! (-> this spawn-array 2) (the int (* 45056.0 (fabs (-> this speed))))) + (set! (-> this spawn-array 3) (the int (* 135168.0 (fabs (-> this speed))))) ) ) ) - (dotimes (v1-19 (+ (-> obj spawn-array length) -1)) - (+! (-> obj spawn-array (+ v1-19 1)) (-> obj spawn-array v1-19)) + (dotimes (v1-19 (+ (-> this spawn-array length) -1)) + (+! (-> this spawn-array (+ v1-19 1)) (-> this spawn-array v1-19)) ) - (set! (-> obj sync) - (the-as time-frame (the int (* (fabs (-> obj speed)) (res-lump-float (-> obj entity) 'sync)))) + (set! (-> this sync) + (the-as time-frame (the int (* (fabs (-> this speed)) (res-lump-float (-> this entity) 'sync)))) ) - (set! (-> obj speed) (/ 1.0 (* (-> obj speed) (path-distance (-> obj path))))) + (set! (-> this speed) (/ 1.0 (* (-> this speed) (path-distance (-> this path))))) (let ((s5-3 (mod (darkecobarrel-base-time) (darkecobarrel-cycle-time)))) - (set! (-> obj cur-spawn) 0) - (while (>= s5-3 (-> obj spawn-array (-> obj cur-spawn))) + (set! (-> this cur-spawn) 0) + (while (>= s5-3 (-> this spawn-array (-> this cur-spawn))) (darkecobarrel-advance-curspawn) ) - (+! (-> obj cur-spawn) -1) - (when (< (-> obj cur-spawn) 0) - (set! (-> obj cur-spawn) (+ (-> obj spawn-array length) -1)) - (+! s5-3 (-> obj spawn-array (-> obj cur-spawn))) + (+! (-> this cur-spawn) -1) + (when (< (-> this cur-spawn) 0) + (set! (-> this cur-spawn) (+ (-> this spawn-array length) -1)) + (+! s5-3 (-> this spawn-array (-> this cur-spawn))) ) - (let ((s4-0 (-> obj cur-spawn)) - (s5-4 (- (darkecobarrel-base-time) (the-as time-frame (- s5-3 (-> obj spawn-array (-> obj cur-spawn)))))) + (let ((s4-0 (-> this cur-spawn)) + (s5-4 (- (darkecobarrel-base-time) (the-as time-frame (- s5-3 (-> this spawn-array (-> this cur-spawn)))))) ) (until (darkecobarrel-base-done? (darkecobarrel-base-pos s5-4)) - (process-spawn darkecobarrel-mover (-> obj entity) (-> obj speed) s5-4 (-> obj sync) :to obj) - (set! s5-4 (- s5-4 (the-as time-frame (-> obj spawn-array s4-0)))) + (process-spawn darkecobarrel-mover (-> this entity) (-> this speed) s5-4 (-> this sync) :to this) + (set! s5-4 (- s5-4 (the-as time-frame (-> this spawn-array s4-0)))) (+! s4-0 -1) (if (< s4-0 0) - (set! s4-0 (+ (-> obj spawn-array length) -1)) - (+! s5-4 (-> obj spawn-array s4-0)) + (set! s4-0 (+ (-> this spawn-array length) -1)) + (+! s5-4 (-> this spawn-array s4-0)) ) ) ) @@ -884,11 +884,11 @@ ) ;; definition for method 3 of type lavafallsewera -(defmethod inspect lavafallsewera ((obj lavafallsewera)) +(defmethod inspect lavafallsewera ((this lavafallsewera)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -913,10 +913,10 @@ ;; definition for method 11 of type lavafallsewera ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavafallsewera ((obj lavafallsewera) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavafallsewera-sg* '()) +(defmethod init-from-entity! lavafallsewera ((this lavafallsewera) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavafallsewera-sg* '()) (go lavafallsewera-idle) (none) ) @@ -934,11 +934,11 @@ ) ;; definition for method 3 of type lavafallsewerb -(defmethod inspect lavafallsewerb ((obj lavafallsewerb)) +(defmethod inspect lavafallsewerb ((this lavafallsewerb)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -963,10 +963,10 @@ ;; definition for method 11 of type lavafallsewerb ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavafallsewerb ((obj lavafallsewerb) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavafallsewerb-sg* '()) +(defmethod init-from-entity! lavafallsewerb ((this lavafallsewerb) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavafallsewerb-sg* '()) (go lavafallsewerb-idle) (none) ) @@ -986,11 +986,11 @@ ) ;; definition for method 3 of type chainmine -(defmethod inspect chainmine ((obj chainmine)) +(defmethod inspect chainmine ((this chainmine)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1161,8 +1161,8 @@ ) ) (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (cleanup-for-death self) @@ -1198,9 +1198,9 @@ ;; definition for method 11 of type chainmine ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! chainmine ((obj chainmine) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask attackable)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! chainmine ((this chainmine) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask attackable)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1217,14 +1217,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *chainmine-sg* '()) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> obj root-override trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *chainmine-sg* '()) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "lava-mine-chain" :fo-max 30) (-> this root-override trans)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1250,12 +1250,12 @@ ) ;; definition for method 3 of type lavaballoon -(defmethod inspect lavaballoon ((obj lavaballoon)) +(defmethod inspect lavaballoon ((this lavaballoon)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmove-per-tick: ~f~%" (-> obj move-per-tick)) - obj + (format #t "~T~Tmove-per-tick: ~f~%" (-> this move-per-tick)) + this ) ;; failed to figure out what this is: @@ -1367,7 +1367,7 @@ ) :trans (behavior () (when (not (logtest? (-> self path flags) (path-control-flag not-found))) - (let ((f0-4 (* 0.5 (+ 1.0 (sin (* (-> self move-per-tick) (the float (-> *display* base-frame-counter)))))))) + (let ((f0-4 (* 0.5 (+ 1.0 (sin (* (-> self move-per-tick) (the float (current-time)))))))) (eval-path-curve! (-> self path) (-> self root-override trans) f0-4 'interp) ) ) @@ -1386,8 +1386,8 @@ ;; definition for method 11 of type lavaballoon ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavaballoon ((obj lavaballoon) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! lavaballoon ((this lavaballoon) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1397,20 +1397,20 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavaballoon-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 543) obj)) - (set! (-> obj root-override pause-adjust-distance) 122880.0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (when (not (logtest? (-> obj path flags) (path-control-flag not-found))) - (let ((f30-0 (res-lump-float (-> obj entity) 'speed :default 12288.0))) - (set! (-> obj move-per-tick) (* 32768.0 (/ 1.0 (* 300.0 (path-distance (-> obj path)))) f30-0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavaballoon-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 543) this)) + (set! (-> this root-override pause-adjust-distance) 122880.0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (when (not (logtest? (-> this path flags) (path-control-flag not-found))) + (let ((f30-0 (res-lump-float (-> this entity) 'speed :default 12288.0))) + (set! (-> this move-per-tick) (* 32768.0 (/ 1.0 (* 300.0 (path-distance (-> this path)))) f30-0)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1424,11 +1424,11 @@ ) ;; definition for method 3 of type lavatube-lava -(defmethod inspect lavatube-lava ((obj lavatube-lava)) +(defmethod inspect lavatube-lava ((this lavatube-lava)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for symbol ripple-for-lavatube-lava, type ripple-wave-set @@ -1459,18 +1459,18 @@ ;; definition for method 22 of type lavatube-lava ;; INFO: Return type mismatch symbol vs none. -(defmethod water-vol-method-22 lavatube-lava ((obj lavatube-lava)) +(defmethod water-vol-method-22 lavatube-lava ((this lavatube-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) + (set! (-> this draw ripple) v1-2) (set! (-> v1-2 global-scale) 2048.0) (set! (-> v1-2 waveform) ripple-for-lavatube-lava) ) - (logclear! (-> obj flags) (water-flags wt23)) - (logior! (-> obj flags) (water-flags wt25)) - (set! (-> obj attack-event) 'heat) + (logclear! (-> this flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt25)) + (set! (-> this attack-event) 'heat) (none) ) @@ -1487,11 +1487,11 @@ ) ;; definition for method 3 of type lavayellowtarp -(defmethod inspect lavayellowtarp ((obj lavayellowtarp)) +(defmethod inspect lavayellowtarp ((this lavayellowtarp)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1516,10 +1516,10 @@ ;; definition for method 11 of type lavayellowtarp ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lavayellowtarp ((obj lavayellowtarp) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lavayellowtarp-sg* '()) +(defmethod init-from-entity! lavayellowtarp ((this lavayellowtarp) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lavayellowtarp-sg* '()) (go lavayellowtarp-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/lavatube/lavatube-part_REF.gc b/test/decompiler/reference/jak1/levels/lavatube/lavatube-part_REF.gc index e22c37e27d..735f9dc33c 100644 --- a/test/decompiler/reference/jak1/levels/lavatube/lavatube-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/lavatube/lavatube-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type lavatube-part -(defmethod inspect lavatube-part ((obj lavatube-part)) +(defmethod inspect lavatube-part ((this lavatube-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; 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 fa03fcb357..3414b5661d 100644 --- a/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/baby-spider_REF.gc @@ -22,17 +22,17 @@ ) ;; definition for method 3 of type baby-spider-spawn-params -(defmethod inspect baby-spider-spawn-params ((obj baby-spider-spawn-params)) - (format #t "[~8x] ~A~%" obj 'baby-spider-spawn-params) - (format #t "~Thatched?: ~A~%" (-> obj hatched?)) - (format #t "~Tfast-start?: ~A~%" (-> obj fast-start?)) - (format #t "~Thack-move-above-ground?: ~A~%" (-> obj hack-move-above-ground?)) - (format #t "~Tdie-if-not-visible?: ~A~%" (-> obj die-if-not-visible?)) - (format #t "~Tpickup: ~D~%" (-> obj pickup)) - (format #t "~Tpickup-amount: ~D~%" (-> obj pickup-amount)) - (format #t "~Tevent-death: ~A~%" (-> obj event-death)) - (format #t "~Tdelay-before-dying-if-not-visible: ~D~%" (-> obj delay-before-dying-if-not-visible)) - obj +(defmethod inspect baby-spider-spawn-params ((this baby-spider-spawn-params)) + (format #t "[~8x] ~A~%" this 'baby-spider-spawn-params) + (format #t "~Thatched?: ~A~%" (-> this hatched?)) + (format #t "~Tfast-start?: ~A~%" (-> this fast-start?)) + (format #t "~Thack-move-above-ground?: ~A~%" (-> this hack-move-above-ground?)) + (format #t "~Tdie-if-not-visible?: ~A~%" (-> this die-if-not-visible?)) + (format #t "~Tpickup: ~D~%" (-> this pickup)) + (format #t "~Tpickup-amount: ~D~%" (-> this pickup-amount)) + (format #t "~Tevent-death: ~A~%" (-> this event-death)) + (format #t "~Tdelay-before-dying-if-not-visible: ~D~%" (-> this delay-before-dying-if-not-visible)) + this ) ;; definition of type baby-spider @@ -66,26 +66,26 @@ ) ;; definition for method 3 of type baby-spider -(defmethod inspect baby-spider ((obj baby-spider)) +(defmethod inspect baby-spider ((this baby-spider)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdie-if-not-visible?: ~A~%" (-> obj die-if-not-visible?)) - (format #t "~T~Thack-move-above-ground?: ~A~%" (-> obj hack-move-above-ground?)) - (format #t "~T~Tstate-float: ~f~%" (-> obj state-float)) - (format #t "~T~Twiggle-angle: ~f~%" (-> obj wiggle-angle)) - (format #t "~T~Tdelta-wiggle-angle: ~f~%" (-> obj delta-wiggle-angle)) - (format #t "~T~Twiggle-factor: ~f~%" (-> obj wiggle-factor)) - (format #t "~T~Tevent-death: ~A~%" (-> obj event-death)) - (format #t "~T~Tdelay-before-dying-if-not-visible: ~D~%" (-> obj delay-before-dying-if-not-visible)) - (format #t "~T~Tchase-rest-time: ~D~%" (-> obj chase-rest-time)) - (format #t "~T~Ttarget-nav-time: ~D~%" (-> obj target-nav-time)) - (format #t "~T~Tfree-time: ~D~%" (-> obj free-time)) - (format #t "~T~Twiggle-time: ~D~%" (-> obj wiggle-time)) - (format #t "~T~Tlast-visible-time: ~D~%" (-> obj last-visible-time)) - (format #t "~T~Tup-vector: #~%" (-> obj up-vector)) - (format #t "~T~Tstate-vector: ~`vector`P~%" (-> obj state-vector)) - obj + (format #t "~T~Tdie-if-not-visible?: ~A~%" (-> this die-if-not-visible?)) + (format #t "~T~Thack-move-above-ground?: ~A~%" (-> this hack-move-above-ground?)) + (format #t "~T~Tstate-float: ~f~%" (-> this state-float)) + (format #t "~T~Twiggle-angle: ~f~%" (-> this wiggle-angle)) + (format #t "~T~Tdelta-wiggle-angle: ~f~%" (-> this delta-wiggle-angle)) + (format #t "~T~Twiggle-factor: ~f~%" (-> this wiggle-factor)) + (format #t "~T~Tevent-death: ~A~%" (-> this event-death)) + (format #t "~T~Tdelay-before-dying-if-not-visible: ~D~%" (-> this delay-before-dying-if-not-visible)) + (format #t "~T~Tchase-rest-time: ~D~%" (-> this chase-rest-time)) + (format #t "~T~Ttarget-nav-time: ~D~%" (-> this target-nav-time)) + (format #t "~T~Tfree-time: ~D~%" (-> this free-time)) + (format #t "~T~Twiggle-time: ~D~%" (-> this wiggle-time)) + (format #t "~T~Tlast-visible-time: ~D~%" (-> this last-visible-time)) + (format #t "~T~Tup-vector: #~%" (-> this up-vector)) + (format #t "~T~Tstate-vector: ~`vector`P~%" (-> this state-vector)) + this ) ;; failed to figure out what this is: @@ -205,7 +205,7 @@ ;; definition for method 9 of type baby-spider-spawn-params ;; INFO: Return type mismatch int vs none. -(defmethod init! baby-spider-spawn-params ((obj baby-spider-spawn-params) +(defmethod init! baby-spider-spawn-params ((this baby-spider-spawn-params) (arg0 symbol) (arg1 symbol) (arg2 symbol) @@ -214,33 +214,33 @@ (arg5 int) (arg6 symbol) ) - (set! (-> obj hatched?) arg0) - (set! (-> obj fast-start?) arg1) - (set! (-> obj die-if-not-visible?) arg2) - (set! (-> obj hack-move-above-ground?) arg3) - (set! (-> obj pickup) arg4) - (set! (-> obj pickup-amount) arg5) - (set! (-> obj event-death) arg6) - (set! (-> obj delay-before-dying-if-not-visible) (seconds 2)) + (set! (-> this hatched?) arg0) + (set! (-> this fast-start?) arg1) + (set! (-> this die-if-not-visible?) arg2) + (set! (-> this hack-move-above-ground?) arg3) + (set! (-> this pickup) arg4) + (set! (-> this pickup-amount) arg5) + (set! (-> this event-death) arg6) + (set! (-> this delay-before-dying-if-not-visible) (seconds 2)) (none) ) ;; definition for method 10 of type baby-spider-spawn-params ;; INFO: Return type mismatch time-frame vs none. -(defmethod set-delay! baby-spider-spawn-params ((obj baby-spider-spawn-params) (arg0 time-frame)) - (set! (-> obj delay-before-dying-if-not-visible) arg0) +(defmethod set-delay! baby-spider-spawn-params ((this baby-spider-spawn-params) (arg0 time-frame)) + (set! (-> this delay-before-dying-if-not-visible) arg0) (none) ) ;; definition for method 44 of type baby-spider -(defmethod touch-handler baby-spider ((obj baby-spider) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler baby-spider ((this baby-spider) (arg0 process) (arg1 event-message-block)) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) (if (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (go (method-of-object obj nav-enemy-victory)) + (go (method-of-object this nav-enemy-victory)) ) ) ) @@ -262,25 +262,25 @@ baby-spider-default-event-handler ;; definition for method 39 of type baby-spider ;; INFO: Used lq/sq -(defmethod common-post baby-spider ((obj baby-spider)) - (when (logtest? (-> obj collide-info status) (cshape-moving-flags onsurf)) - (vector-deg-seek (-> obj up-vector) (-> obj up-vector) (-> obj collide-info surface-normal) 910.2222) - (vector-normalize! (-> obj up-vector) 1.0) +(defmethod common-post baby-spider ((this baby-spider)) + (when (logtest? (-> this collide-info status) (cshape-moving-flags onsurf)) + (vector-deg-seek (-> this up-vector) (-> this up-vector) (-> this collide-info surface-normal) 910.2222) + (vector-normalize! (-> this up-vector) 1.0) ) (forward-up-nopitch->quaternion - (-> obj collide-info quat) - (vector-z-quaternion! (new-stack-vector0) (-> obj collide-info quat)) - (-> obj up-vector) + (-> this collide-info quat) + (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)) obj) + ((the-as (function nav-enemy none) (find-parent-method baby-spider 39)) this) (none) ) ;; definition for method 38 of type baby-spider -(defmethod nav-enemy-method-38 baby-spider ((obj baby-spider)) +(defmethod nav-enemy-method-38 baby-spider ((this baby-spider)) (integrate-for-enemy-with-move-to-ground! - (-> obj collide-info) - (-> obj collide-info transv) + (-> this collide-info) + (-> this collide-info transv) (collide-kind background) 8192.0 #t @@ -292,16 +292,16 @@ baby-spider-default-event-handler ;; definition for method 51 of type baby-spider ;; INFO: Return type mismatch float vs none. -(defmethod nav-enemy-method-51 baby-spider ((obj baby-spider)) +(defmethod nav-enemy-method-51 baby-spider ((this baby-spider)) (let* ((f0-0 (rand-vu-float-range 0.0 1.0)) (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) (f0-2 (+ 1.0 (* 0.2 f0-0))) ) - (set! (-> obj delta-wiggle-angle) (* 910.2222 f1-1)) - (set! (-> obj wiggle-factor) (* 1.5 f2-4)) - (set! (-> obj target-speed) (* 28672.0 f0-2)) + (set! (-> this delta-wiggle-angle) (* 910.2222 f1-1)) + (set! (-> this wiggle-factor) (* 1.5 f2-4)) + (set! (-> this target-speed) (* 28672.0 f0-2)) ) (none) ) @@ -309,18 +309,18 @@ baby-spider-default-event-handler ;; definition for method 52 of type baby-spider ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs symbol. -(defmethod nav-enemy-method-52 baby-spider ((obj baby-spider) (arg0 vector)) - (+! (-> obj wiggle-angle) (-> obj delta-wiggle-angle)) - (if (< 65536.0 (-> obj wiggle-angle)) - (+! (-> obj wiggle-angle) -65536.0) +(defmethod nav-enemy-method-52 baby-spider ((this baby-spider) (arg0 vector)) + (+! (-> this wiggle-angle) (-> this delta-wiggle-angle)) + (if (< 65536.0 (-> this wiggle-angle)) + (+! (-> this wiggle-angle) -65536.0) ) - (let* ((v1-3 (-> obj collide-info trans)) + (let* ((v1-3 (-> this collide-info trans)) (a1-2 (vector-! (new 'stack-no-clear 'vector) v1-3 arg0)) (s2-0 (vector-rotate-around-y! (new 'stack-no-clear 'vector) a1-2 16384.0)) (v1-4 - (vector+*! (new 'stack-no-clear 'vector) arg0 s2-0 (* (-> obj wiggle-factor) (sin (-> obj wiggle-angle)))) + (vector+*! (new 'stack-no-clear 'vector) arg0 s2-0 (* (-> this wiggle-factor) (sin (-> this wiggle-angle)))) ) - (v0-3 (-> obj nav target-pos)) + (v0-3 (-> this nav target-pos)) ) (set! (-> v0-3 quad) (-> v1-4 quad)) (the-as symbol v0-3) @@ -328,18 +328,15 @@ baby-spider-default-event-handler ) ;; definition for method 53 of type baby-spider -(defmethod nav-enemy-method-53 baby-spider ((obj baby-spider)) +(defmethod nav-enemy-method-53 baby-spider ((this baby-spider)) (cond - ((logtest? (-> obj draw status) (draw-status was-drawn)) - (set! (-> obj last-visible-time) (-> *display* base-frame-counter)) + ((logtest? (-> this draw status) (draw-status was-drawn)) + (set-time! (-> this last-visible-time)) (return #f) ) (else - (if (-> obj die-if-not-visible?) - (return (>= (- (-> *display* base-frame-counter) (-> obj last-visible-time)) - (-> obj delay-before-dying-if-not-visible) - ) - ) + (if (-> this die-if-not-visible?) + (return (time-elapsed? (-> this last-visible-time) (-> this delay-before-dying-if-not-visible))) ) ) ) @@ -379,7 +376,7 @@ baby-spider-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn)) ) @@ -488,7 +485,7 @@ baby-spider-default-event-handler (if (nav-enemy-method-53 self) (go baby-spider-die-fast) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) + (if (time-elapsed? (-> self state-time) (-> self chase-rest-time)) (go-virtual nav-enemy-victory) ) (let ((t9-3 (-> (method-of-type nav-enemy nav-enemy-chase) trans))) @@ -498,15 +495,15 @@ baby-spider-default-event-handler ) ) :code (behavior () - (set! (-> self target-nav-time) (-> *display* base-frame-counter)) - (set! (-> self wiggle-time) (+ (-> *display* base-frame-counter) (seconds -10))) + (set-time! (-> self target-nav-time)) + (set! (-> self wiggle-time) (+ (current-time) (seconds -10))) (set! (-> self wiggle-angle) 0.0) (set! (-> self chase-rest-time) (rand-vu-int-range (seconds 1) (seconds 4))) (ja-channel-push! 1 (seconds 0.17)) (ja :group! baby-spider-run-ja :num! min) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self wiggle-time)) (seconds 1)) - (set! (-> self wiggle-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self wiggle-time) (seconds 1)) + (set-time! (-> self wiggle-time)) (nav-enemy-method-51 self) ) (suspend) @@ -565,9 +562,9 @@ baby-spider-default-event-handler (ja-no-eval :num! (loop!)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) - (s5-0 (-> *display* base-frame-counter)) + (s5-0 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) + (until (time-elapsed? s5-0 gp-0) (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend) @@ -694,8 +691,8 @@ baby-spider-default-event-handler ;; definition for method 47 of type baby-spider ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision baby-spider ((obj baby-spider)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision baby-spider ((this baby-spider)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -711,7 +708,7 @@ baby-spider-default-event-handler ) (set! (-> s5-0 nav-radius) 4096.0) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -720,27 +717,27 @@ baby-spider-default-event-handler ;; definition for method 48 of type baby-spider ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 baby-spider ((obj baby-spider)) - (set! (-> obj last-visible-time) (-> *display* base-frame-counter)) - (initialize-skeleton obj *baby-spider-sg* '()) - (if (= (-> obj parent 0 type) cave-trap) - (init-defaults! obj *baby-spider-nav-enemy-info-for-cave-trap*) - (init-defaults! obj *baby-spider-nav-enemy-info*) +(defmethod nav-enemy-method-48 baby-spider ((this baby-spider)) + (set-time! (-> this last-visible-time)) + (initialize-skeleton this *baby-spider-sg* '()) + (if (= (-> this parent 0 type) cave-trap) + (init-defaults! this *baby-spider-nav-enemy-info-for-cave-trap*) + (init-defaults! this *baby-spider-nav-enemy-info*) ) - (let ((v1-11 (-> obj draw shadow-ctrl settings))) + (let ((v1-11 (-> this draw shadow-ctrl settings))) (logclear! (-> v1-11 flags) (shadow-flags shdf03)) (set! (-> v1-11 fade-dist) 98304.0) ) - (vector-float*! (-> obj collide-info scale) *identity-vector* 0.63) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj wiggle-angle) 0.0) - (set! (-> obj delta-wiggle-angle) 910.2222) - (set! (-> obj wiggle-factor) 1.5) - (set! (-> obj reaction-time) (rand-vu-int-range (seconds 0.1) (seconds 0.8))) - (set! (-> obj chase-rest-time) (seconds 1)) - (set! (-> obj up-vector quad) (-> *y-vector* quad)) + (vector-float*! (-> this collide-info scale) *identity-vector* 0.63) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this wiggle-angle) 0.0) + (set! (-> this delta-wiggle-angle) 910.2222) + (set! (-> this wiggle-factor) 1.5) + (set! (-> this reaction-time) (rand-vu-int-range (seconds 0.1) (seconds 0.8))) + (set! (-> this chase-rest-time) (seconds 1)) + (set! (-> this up-vector quad) (-> *y-vector* quad)) 0 (none) ) @@ -787,28 +784,28 @@ baby-spider-default-event-handler ;; definition for method 11 of type baby-spider ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! baby-spider ((obj baby-spider) (arg0 entity-actor)) - (set! (-> obj die-if-not-visible?) #f) - (set! (-> obj delay-before-dying-if-not-visible) (seconds 2)) - (set! (-> obj hack-move-above-ground?) #f) - (set! (-> obj event-death) #f) - (initialize-collision obj) - (process-drawable-from-entity! obj arg0) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj nav) (new 'process 'nav-control (-> obj collide-info) 24 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) +(defmethod init-from-entity! baby-spider ((this baby-spider) (arg0 entity-actor)) + (set! (-> this die-if-not-visible?) #f) + (set! (-> this delay-before-dying-if-not-visible) (seconds 2)) + (set! (-> this hack-move-above-ground?) #f) + (set! (-> this event-death) #f) + (initialize-collision this) + (process-drawable-from-entity! this arg0) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this nav) (new 'process 'nav-control (-> this collide-info) 24 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) -1 4096.0 ) - (nav-enemy-method-48 obj) - (go (method-of-object obj nav-enemy-idle)) + (nav-enemy-method-48 this) + (go (method-of-object this nav-enemy-idle)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/cavecrystal-light_REF.gc b/test/decompiler/reference/jak1/levels/maincave/cavecrystal-light_REF.gc index ad55ca2cef..5d29a8e32a 100644 --- a/test/decompiler/reference/jak1/levels/maincave/cavecrystal-light_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/cavecrystal-light_REF.gc @@ -20,16 +20,16 @@ ) ;; definition for method 3 of type cavecrystal-light -(defmethod inspect cavecrystal-light ((obj cavecrystal-light)) - (format #t "[~8x] ~A~%" obj 'cavecrystal-light) - (format #t "~Tnext: #~%" (-> obj next)) - (format #t "~Tcrystal-id: ~D~%" (-> obj crystal-id)) - (format #t "~Tintensity: ~f~%" (-> obj intensity)) - (format #t "~Tfade-start: ~f~%" (-> obj fade-start)) - (format #t "~Tfade-end: ~f~%" (-> obj fade-end)) - (format #t "~Tcrystal-handle: ~D~%" (-> obj crystal-handle)) - (format #t "~Ttrans: #~%" (-> obj trans)) - obj +(defmethod inspect cavecrystal-light ((this cavecrystal-light)) + (format #t "[~8x] ~A~%" this 'cavecrystal-light) + (format #t "~Tnext: #~%" (-> this next)) + (format #t "~Tcrystal-id: ~D~%" (-> this crystal-id)) + (format #t "~Tintensity: ~f~%" (-> this intensity)) + (format #t "~Tfade-start: ~f~%" (-> this fade-start)) + (format #t "~Tfade-end: ~f~%" (-> this fade-end)) + (format #t "~Tcrystal-handle: ~D~%" (-> this crystal-handle)) + (format #t "~Ttrans: #~%" (-> this trans)) + this ) ;; definition of type cavecrystal-light-control @@ -53,13 +53,13 @@ ) ;; definition for method 3 of type cavecrystal-light-control -(defmethod inspect cavecrystal-light-control ((obj cavecrystal-light-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tactive-count: ~D~%" (-> obj active-count)) - (format #t "~Thead: #~%" (-> obj head)) - (format #t "~Tlast-known-valid-time: ~D~%" (-> obj last-known-valid-time)) - (format #t "~Tcrystal[7] @ #x~X~%" (-> obj crystal)) - obj +(defmethod inspect cavecrystal-light-control ((this cavecrystal-light-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tactive-count: ~D~%" (-> this active-count)) + (format #t "~Thead: #~%" (-> this head)) + (format #t "~Tlast-known-valid-time: ~D~%" (-> this last-known-valid-time)) + (format #t "~Tcrystal[7] @ #x~X~%" (-> this crystal)) + this ) ;; definition for symbol *cavecrystal-light-control*, type cavecrystal-light-control @@ -88,7 +88,7 @@ ) ;; definition for method 13 of type cavecrystal-light-control -(defmethod create-connection! cavecrystal-light-control ((obj cavecrystal-light-control) +(defmethod create-connection! cavecrystal-light-control ((this cavecrystal-light-control) (arg0 process-drawable) (arg1 res-lump) (arg2 (function object object object object object)) @@ -101,24 +101,24 @@ ) ;; definition for method 14 of type cavecrystal-light-control -(defmethod execute-connections cavecrystal-light-control ((obj cavecrystal-light-control)) +(defmethod execute-connections cavecrystal-light-control ((this cavecrystal-light-control)) (execute-connections *cavecrystal-engine* #f) ) ;; definition for method 12 of type cavecrystal-light-control ;; INFO: Return type mismatch symbol vs none. -(defmethod cavecrystal-light-control-method-12 cavecrystal-light-control ((obj cavecrystal-light-control)) - (let ((v1-0 (-> obj last-known-valid-time)) - (a1-1 (-> *display* base-frame-counter)) +(defmethod cavecrystal-light-control-method-12 cavecrystal-light-control ((this cavecrystal-light-control)) + (let ((v1-0 (-> this last-known-valid-time)) + (a1-1 (current-time)) ) (when (!= v1-0 a1-1) - (set! (-> obj last-known-valid-time) a1-1) + (set! (-> this last-known-valid-time) a1-1) (cond ((zero? v1-0) - (set! (-> obj active-count) 0) - (set! (-> obj head) #f) + (set! (-> this active-count) 0) + (set! (-> this head) #f) (dotimes (v1-1 7) - (let ((a1-5 (-> obj crystal v1-1))) + (let ((a1-5 (-> this crystal v1-1))) (set! (-> a1-5 next) #f) (set! (-> a1-5 crystal-id) v1-1) (set! (-> a1-5 intensity) 0.0) @@ -129,9 +129,9 @@ ) ) (else - (when (> (-> obj active-count) 0) + (when (> (-> this active-count) 0) (let ((v1-4 (the-as cavecrystal-light #f)) - (a1-7 (-> obj head)) + (a1-7 (-> this head)) ) (while a1-7 (cond @@ -141,11 +141,11 @@ ) (else (let ((a2-4 (-> a1-7 next))) - (+! (-> obj active-count) -1) + (+! (-> this active-count) -1) (set! (-> a1-7 next) #f) (set! (-> a1-7 intensity) 0.0) (if v1-4 - (set! (-> obj head) a2-4) + (set! (-> this head) a2-4) (set! (-> v1-4 next) a2-4) ) (set! a1-7 a2-4) @@ -164,25 +164,25 @@ ;; definition for method 11 of type cavecrystal-light-control ;; INFO: Return type mismatch int vs none. -(defmethod inc-intensities! cavecrystal-light-control ((obj cavecrystal-light-control)) - (set! (-> obj head) #f) +(defmethod inc-intensities! cavecrystal-light-control ((this cavecrystal-light-control)) + (set! (-> this head) #f) (let ((a1-0 (the-as cavecrystal-light #f)) (v0-0 0) ) (dotimes (v1-0 7) - (let ((a2-3 (-> obj crystal v1-0))) + (let ((a2-3 (-> this crystal v1-0))) (set! (-> a2-3 next) #f) (when (< 0.0 (-> a2-3 intensity)) (+! v0-0 1) (if a1-0 (set! (-> a1-0 next) a2-3) - (set! (-> obj head) a2-3) + (set! (-> this head) a2-3) ) (set! a1-0 a2-3) ) ) ) - (set! (-> obj active-count) v0-0) + (set! (-> this active-count) v0-0) ) (none) ) @@ -191,25 +191,25 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. ;; WARN: Function (method 9 cavecrystal-light-control) has a return type of none, but the expression builder found a return statement. -(defmethod cavecrystal-light-control-method-9 cavecrystal-light-control ((obj cavecrystal-light-control) (arg0 int) (arg1 float) (arg2 process-drawable)) - (cavecrystal-light-control-method-12 obj) +(defmethod cavecrystal-light-control-method-9 cavecrystal-light-control ((this cavecrystal-light-control) (arg0 int) (arg1 float) (arg2 process-drawable)) + (cavecrystal-light-control-method-12 this) (when (or (< arg0 0) (>= arg0 7)) (format 0 "ERROR: Bogus cavecrystal id!~%") (return #f) ) - (let ((s3-0 (-> obj crystal arg0))) + (let ((s3-0 (-> this crystal arg0))) (cond ((and (< 0.0 arg1) (>= 0.0 (-> s3-0 intensity))) - (+! (-> obj active-count) 1) + (+! (-> this active-count) 1) (set! (-> s3-0 intensity) arg1) (set! (-> s3-0 crystal-handle) (process->handle arg2)) (set! (-> s3-0 trans quad) (-> arg2 root trans quad)) - (inc-intensities! obj) + (inc-intensities! this) ) ((and (>= 0.0 arg1) (< 0.0 (-> s3-0 intensity))) - (+! (-> obj active-count) -1) + (+! (-> this active-count) -1) (set! (-> s3-0 intensity) 0.0) - (inc-intensities! obj) + (inc-intensities! this) ) ((< 0.0 arg1) (set! (-> s3-0 intensity) arg1) @@ -221,9 +221,9 @@ ) ;; definition for method 10 of type cavecrystal-light-control -(defmethod cavecrystal-light-control-method-10 cavecrystal-light-control ((obj cavecrystal-light-control) (arg0 vector)) - (cavecrystal-light-control-method-12 obj) - (let ((s5-1 (-> obj head)) +(defmethod cavecrystal-light-control-method-10 cavecrystal-light-control ((this cavecrystal-light-control) (arg0 vector)) + (cavecrystal-light-control-method-12 this) + (let ((s5-1 (-> this head)) (f30-0 0.0) ) (when s5-1 diff --git a/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc b/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc index 9150334fab..3bca115787 100644 --- a/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/dark-crystal_REF.gc @@ -29,18 +29,18 @@ ) ;; definition for method 3 of type dark-crystal -(defmethod inspect dark-crystal ((obj dark-crystal)) +(defmethod inspect dark-crystal ((this dark-crystal)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcrystal-num: ~D~%" (-> obj crystal-num)) - (format #t "~T~Tunderwater?: ~A~%" (-> obj underwater?)) - (format #t "~T~Texplode-danger-radius: ~f~%" (-> obj explode-danger-radius)) - (format #t "~T~Tlit-color-mult: #~%" (-> obj lit-color-mult)) - (format #t "~T~Tlit-color-emissive: #~%" (-> obj lit-color-emissive)) - (format #t "~T~Tunlit-color-mult: #~%" (-> obj unlit-color-mult)) - (format #t "~T~Tunlit-color-emissive: #~%" (-> obj unlit-color-emissive)) - obj + (format #t "~T~Tcrystal-num: ~D~%" (-> this crystal-num)) + (format #t "~T~Tunderwater?: ~A~%" (-> this underwater?)) + (format #t "~T~Texplode-danger-radius: ~f~%" (-> this explode-danger-radius)) + (format #t "~T~Tlit-color-mult: #~%" (-> this lit-color-mult)) + (format #t "~T~Tlit-color-emissive: #~%" (-> this lit-color-emissive)) + (format #t "~T~Tunlit-color-mult: #~%" (-> this unlit-color-mult)) + (format #t "~T~Tunlit-color-emissive: #~%" (-> this unlit-color-emissive)) + this ) ;; failed to figure out what this is: @@ -475,15 +475,15 @@ (sound-play "warning") (set! (-> self draw color-mult quad) (-> self lit-color-mult quad)) (set! (-> self draw color-emissive quad) (-> self lit-color-emissive quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.1)) (suspend) ) (set! (-> self draw color-mult quad) (-> self unlit-color-mult quad)) (set! (-> self draw color-emissive quad) (-> self unlit-color-emissive quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((s5-1 (-> *dark-crystal-flash-delays* gp-0))) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) s5-1) + (until (time-elapsed? (-> self state-time) s5-1) (suspend) ) ) @@ -495,7 +495,7 @@ ;; failed to figure out what this is: (defstate dark-crystal-explode (dark-crystal) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (clear-collide-with-as (-> self root-override)) (let ((gp-0 (new 'stack 'joint-exploder-tuning 0))) @@ -533,8 +533,8 @@ (-> self root-override trans) :to *entity-pool* ) - (let ((s5-4 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-4) (seconds 0.25)) + (let ((s5-4 (current-time))) + (until (time-elapsed? s5-4 (seconds 0.25)) (suspend) ) ) @@ -587,17 +587,17 @@ ;; definition for method 20 of type dark-crystal ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod dark-crystal-method-20 dark-crystal ((obj dark-crystal)) +(defmethod dark-crystal-method-20 dark-crystal ((this dark-crystal)) (when *target* (let ((s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> obj root-override trans quad)) + (set! (-> s5-0 quad) (-> this root-override trans quad)) (+! (-> s5-0 y) 6144.0) (set! (-> s3-0 quad) (-> (target-pos 0) quad)) (+! (-> s3-0 y) 6144.0) - (when (>= (-> obj explode-danger-radius) (vector-vector-distance s5-0 s3-0)) + (when (>= (-> this explode-danger-radius) (vector-vector-distance s5-0 s3-0)) (vector-! s4-0 s3-0 s5-0) (let ((t2-0 (new 'stack-no-clear 'collide-tri-result))) (if (< (fill-and-probe-using-line-sphere @@ -606,7 +606,7 @@ s4-0 819.2 (collide-kind background) - obj + this t2-0 (new 'static 'pat-surface :noentity #x1) ) @@ -622,16 +622,16 @@ ) ;; definition for method 21 of type dark-crystal -(defmethod dark-crystal-method-21 dark-crystal ((obj dark-crystal)) +(defmethod dark-crystal-method-21 dark-crystal ((this dark-crystal)) (let ((s5-0 #f)) - (when (nonzero? (-> obj crystal-num)) + (when (nonzero? (-> this crystal-num)) (let* ((s4-0 (get-task-control (game-task cave-dark-crystals))) - (s3-0 (logior (get-reminder s4-0 3) (ash 1 (-> obj crystal-num)))) + (s3-0 (logior (get-reminder s4-0 3) (ash 1 (-> this crystal-num)))) ) (save-reminder s4-0 s3-0 3) (when (= s3-0 62) (set! s5-0 #t) - (process-entity-status! obj (entity-perm-status complete) #t) + (process-entity-status! this (entity-perm-status complete) #t) ) ) ) @@ -642,13 +642,13 @@ ;; definition for method 11 of type dark-crystal ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! dark-crystal ((obj dark-crystal) (arg0 entity-actor)) - (set-vector! (-> obj unlit-color-mult) 0.5 0.5 0.5 1.0) - (set-vector! (-> obj unlit-color-emissive) 0.0 0.0 0.0 0.0) - (set-vector! (-> obj lit-color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj lit-color-emissive) 1.0 1.0 1.0 0.0) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! dark-crystal ((this dark-crystal) (arg0 entity-actor)) + (set-vector! (-> this unlit-color-mult) 0.5 0.5 0.5 1.0) + (set-vector! (-> this unlit-color-emissive) 0.0 0.0 0.0 0.0) + (set-vector! (-> this lit-color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this lit-color-emissive) 1.0 1.0 1.0 0.0) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -660,29 +660,29 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *dark-crystal-sg* '()) - (logior! (-> obj mask) (process-mask attackable)) - (set! (-> obj draw color-mult quad) (-> obj unlit-color-mult quad)) - (set! (-> obj draw color-emissive quad) (-> obj unlit-color-emissive quad)) - (set! (-> obj underwater?) (= (res-lump-value arg0 'mode uint128) 1)) - (set! (-> obj explode-danger-radius) (res-lump-float arg0 'extra-radius :default 28672.0)) - (set! (-> obj crystal-num) (res-lump-value arg0 'extra-id int)) - (set-vector! (-> obj root-override scale) 2.0 2.0 2.0 1.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *dark-crystal-sg* '()) + (logior! (-> this mask) (process-mask attackable)) + (set! (-> this draw color-mult quad) (-> this unlit-color-mult quad)) + (set! (-> this draw color-emissive quad) (-> this unlit-color-emissive quad)) + (set! (-> this underwater?) (= (res-lump-value arg0 'mode uint128) 1)) + (set! (-> this explode-danger-radius) (res-lump-float arg0 'extra-radius :default 28672.0)) + (set! (-> this crystal-num) (res-lump-value arg0 'extra-id int)) + (set-vector! (-> this root-override scale) 2.0 2.0 2.0 1.0) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (update-transforms! (-> this root-override)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go dark-crystal-spawn-fuel-cell) (go dark-crystal-idle) ) 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 cc6f867b7c..f8e4f1e421 100644 --- a/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/driller-lurker_REF.gc @@ -56,35 +56,35 @@ ) ;; definition for method 3 of type driller-lurker -(defmethod inspect driller-lurker ((obj driller-lurker)) +(defmethod inspect driller-lurker ((this driller-lurker)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Thit-player?: ~A~%" (-> obj hit-player?)) - (format #t "~T~Tplayed-drill-sound?: ~A~%" (-> obj played-drill-sound?)) - (format #t "~T~Tmode: ~D~%" (-> obj mode)) - (format #t "~T~Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~T~Tpath-units-per-meter: ~f~%" (-> obj path-units-per-meter)) - (format #t "~T~Tpath-speed: ~f~%" (-> obj path-speed)) - (format #t "~T~Ttarg-path-speed: ~f~%" (-> obj targ-path-speed)) - (format #t "~T~Tpath-dir: ~f~%" (-> obj path-dir)) - (format #t "~T~Tpath-ry: ~f~%" (-> obj path-ry)) - (format #t "~T~Tfacing-ry: ~f~%" (-> obj facing-ry)) - (format #t "~T~Tdrill-rz: ~f~%" (-> obj drill-rz)) - (format #t "~T~Tdrill-speed: ~f~%" (-> obj drill-speed)) - (format #t "~T~Tup-blend: ~f~%" (-> obj up-blend)) - (format #t "~T~Tplayer-path-u: ~f~%" (-> obj player-path-u)) - (format #t "~T~Tambient-drilling-u: ~f~%" (-> obj ambient-drilling-u)) - (format #t "~T~Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~T~Tneck: ~A~%" (-> obj neck)) - (format #t "~T~Tdrill: ~A~%" (-> obj drill)) - (format #t "~T~Tsound2: ~A~%" (-> obj sound2)) - (format #t "~T~Tlast-update-time: ~D~%" (-> obj last-update-time)) - (format #t "~T~Tlast-player-path-u-time: ~D~%" (-> obj last-player-path-u-time)) - (format #t "~T~Tstarted-chasing-time: ~D~%" (-> obj started-chasing-time)) - (format #t "~T~Thit-player-time: ~D~%" (-> obj hit-player-time)) - (format #t "~T~Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - obj + (format #t "~T~Thit-player?: ~A~%" (-> this hit-player?)) + (format #t "~T~Tplayed-drill-sound?: ~A~%" (-> this played-drill-sound?)) + (format #t "~T~Tmode: ~D~%" (-> this mode)) + (format #t "~T~Tpath-u: ~f~%" (-> this path-u)) + (format #t "~T~Tpath-units-per-meter: ~f~%" (-> this path-units-per-meter)) + (format #t "~T~Tpath-speed: ~f~%" (-> this path-speed)) + (format #t "~T~Ttarg-path-speed: ~f~%" (-> this targ-path-speed)) + (format #t "~T~Tpath-dir: ~f~%" (-> this path-dir)) + (format #t "~T~Tpath-ry: ~f~%" (-> this path-ry)) + (format #t "~T~Tfacing-ry: ~f~%" (-> this facing-ry)) + (format #t "~T~Tdrill-rz: ~f~%" (-> this drill-rz)) + (format #t "~T~Tdrill-speed: ~f~%" (-> this drill-speed)) + (format #t "~T~Tup-blend: ~f~%" (-> this up-blend)) + (format #t "~T~Tplayer-path-u: ~f~%" (-> this player-path-u)) + (format #t "~T~Tambient-drilling-u: ~f~%" (-> this ambient-drilling-u)) + (format #t "~T~Ttimeout: ~D~%" (-> this timeout)) + (format #t "~T~Tneck: ~A~%" (-> this neck)) + (format #t "~T~Tdrill: ~A~%" (-> this drill)) + (format #t "~T~Tsound2: ~A~%" (-> this sound2)) + (format #t "~T~Tlast-update-time: ~D~%" (-> this last-update-time)) + (format #t "~T~Tlast-player-path-u-time: ~D~%" (-> this last-player-path-u-time)) + (format #t "~T~Tstarted-chasing-time: ~D~%" (-> this started-chasing-time)) + (format #t "~T~Thit-player-time: ~D~%" (-> this hit-player-time)) + (format #t "~T~Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + this ) ;; failed to figure out what this is: @@ -294,7 +294,7 @@ (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) ) (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-time! (-> self hit-player-time)) (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) (let ((v1-39 (-> self mode))) (if (or (zero? v1-39) (= v1-39 1) (= v1-39 2)) @@ -337,7 +337,7 @@ (static-attack-info ((shove-up (meters 2)) (shove-back (meters 3)))) ) (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-time! (-> self hit-player-time)) (set-collide-offense (-> self root-overeride) 2 (collide-offense no-offense)) (let ((v1-62 (-> self mode))) (if (or (zero? v1-62) (= v1-62 1) (= v1-62 2)) @@ -352,19 +352,19 @@ ;; definition for method 20 of type driller-lurker ;; INFO: Used lq/sq -(defmethod driller-lurker-method-20 driller-lurker ((obj driller-lurker) (arg0 symbol) (arg1 target)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-update-time)) - (set! (-> obj last-update-time) v1-1) - (let* ((f0-0 (-> obj path-speed)) - (f1-1 (seek f0-0 (-> obj targ-path-speed) (* 12288.0 (-> *display* seconds-per-frame)))) +(defmethod driller-lurker-method-20 driller-lurker ((this driller-lurker) (arg0 symbol) (arg1 target)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-update-time)) + (set! (-> this last-update-time) v1-1) + (let* ((f0-0 (-> this path-speed)) + (f1-1 (seek f0-0 (-> this targ-path-speed) (* 12288.0 (seconds-per-frame)))) ) - (set! (-> obj path-speed) f1-1) + (set! (-> this path-speed) f1-1) (when (< 0.0 f1-1) - (let* ((f0-5 (-> obj path-u)) - (f30-0 (* (-> obj path-dir) f1-1 (-> *display* seconds-per-frame))) + (let* ((f0-5 (-> this path-u)) + (f30-0 (* (-> this path-dir) f1-1 (seconds-per-frame))) (s4-0 #t) - (f0-6 (+ f0-5 (* 0.00024414062 (-> obj path-units-per-meter) f30-0))) + (f0-6 (+ f0-5 (* 0.00024414062 (-> this path-units-per-meter) f30-0))) ) (cond ((< f0-6 0.0) @@ -372,12 +372,12 @@ (cond (arg0 (set! f0-6 (- f0-6)) - (set! (-> obj path-dir) (- (-> obj path-dir))) - (set! (-> obj path-speed) 0.0) + (set! (-> this path-dir) (- (-> this path-dir))) + (set! (-> this path-speed) 0.0) ) (else (set! f0-6 0.0) - (set! (-> obj path-speed) 0.0) + (set! (-> this path-speed) 0.0) ) ) ) @@ -386,23 +386,23 @@ (cond (arg0 (set! f0-6 (- 2.0 f0-6)) - (set! (-> obj path-dir) (- (-> obj path-dir))) - (set! (-> obj path-speed) 0.0) + (set! (-> this path-dir) (- (-> this path-dir))) + (set! (-> this path-speed) 0.0) ) (else (set! f0-6 1.0) - (set! (-> obj path-speed) 0.0) + (set! (-> this path-speed) 0.0) ) ) ) ) - (set! (-> obj path-u) f0-6) + (set! (-> this path-u) f0-6) (let ((s3-1 (new 'stack-no-clear 'vector))) - (set! (-> s3-1 quad) (-> obj root-overeride trans quad)) - (eval-path-curve! (-> obj path) (-> obj root-overeride trans) f0-6 'interp) + (set! (-> s3-1 quad) (-> this root-overeride trans quad)) + (eval-path-curve! (-> this path) (-> this root-overeride trans) f0-6 'interp) (when s4-0 - (let ((f0-7 (vector-vector-xz-distance s3-1 (-> obj root-overeride trans)))) - (set! (-> obj path-units-per-meter) (* (/ (fabs f30-0) f0-7) (-> obj path-units-per-meter))) + (let ((f0-7 (vector-vector-xz-distance s3-1 (-> this root-overeride trans)))) + (set! (-> this path-units-per-meter) (* (/ (fabs f30-0) f0-7) (-> this path-units-per-meter))) ) ) ) @@ -410,187 +410,190 @@ ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (path-control-method-14 (-> obj path) s4-1 (-> obj path-u)) + (path-control-method-14 (-> this path) s4-1 (-> this path-u)) (let ((f0-13 (atan (-> s4-1 x) (-> s4-1 z)))) - (if (< (-> obj path-dir) 0.0) + (if (< (-> this path-dir) 0.0) (set! f0-13 (+ 32768.0 f0-13)) ) - (set! (-> obj path-ry) f0-13) + (set! (-> this path-ry) f0-13) ) ) - (case (-> obj mode) + (case (-> this mode) ((4) (when *target* (let ((a0-13 (target-pos 0)) (v1-26 (new 'stack-no-clear 'vector)) ) - (vector-! v1-26 a0-13 (-> obj root-overeride trans)) + (vector-! v1-26 a0-13 (-> this root-overeride trans)) (let ((f0-16 (atan (-> v1-26 x) (-> v1-26 z)))) - (set! (-> obj facing-ry) - (deg-seek-smooth (-> obj facing-ry) f0-16 (* 32768.0 (-> *display* seconds-per-frame)) 0.25) - ) + (set! (-> this facing-ry) (deg-seek-smooth (-> this facing-ry) f0-16 (* 32768.0 (seconds-per-frame)) 0.25)) ) ) - (when (< 16384.0 (fabs (deg- (-> obj facing-ry) (-> obj path-ry)))) - (set! (-> obj path-dir) (- (-> obj path-dir))) - (+! (-> obj path-ry) 32768.0) + (when (< 16384.0 (fabs (deg- (-> this facing-ry) (-> this path-ry)))) + (set! (-> this path-dir) (- (-> this path-dir))) + (+! (-> this path-ry) 32768.0) ) ) ) (else - (if (!= (-> obj mode) 1) - (set! (-> obj facing-ry) - (deg-seek-smooth (-> obj facing-ry) (-> obj path-ry) (* 32768.0 (-> *display* seconds-per-frame)) 0.25) + (if (!= (-> this mode) 1) + (set! (-> this facing-ry) + (deg-seek-smooth (-> this facing-ry) (-> this path-ry) (* 32768.0 (seconds-per-frame)) 0.25) ) ) ) ) - (quaternion-axis-angle! (-> obj root-overeride quat) 0.0 1.0 0.0 (-> obj facing-ry)) + (quaternion-axis-angle! (-> this root-overeride quat) 0.0 1.0 0.0 (-> this facing-ry)) (let ((f30-2 0.0)) (when *target* - (let ((f0-34 (vector-vector-xz-distance (target-pos 0) (-> obj root-overeride trans)))) + (let ((f0-34 (vector-vector-xz-distance (target-pos 0) (-> this root-overeride trans)))) (if (< f0-34 36864.0) (set! f30-2 (- 1.0 (* 0.00006510417 (fmax 0.0 (+ -21504.0 f0-34))))) ) ) ) - (let ((f28-1 (* 0.0001373291 (fmin 7281.778 (fabs (deg- (-> obj path-ry) (-> obj facing-ry))))))) + (let ((f28-1 (* 0.0001373291 (fmin 7281.778 (fabs (deg- (-> this path-ry) (-> this facing-ry))))))) (cond ((< 0.0 f30-2) (let ((s3-2 (new 'stack-no-clear 'vector))) - (vector-! s3-2 (target-pos 0) (-> obj root-overeride trans)) + (vector-! s3-2 (target-pos 0) (-> this root-overeride trans)) (let* ((f1-27 (vector-x-angle s3-2)) (f1-29 (fmax 728.1778 (fmin 10194.489 f1-27))) (f0-46 (* 0.000105637766 (+ -728.1778 f1-29))) (f0-47 (lerp f28-1 f0-46 f30-2)) ) - (set! (-> obj up-blend) - (seek-with-smooth (-> obj up-blend) f0-47 (* 8192.0 (-> *display* seconds-per-frame)) 0.25 0.01) - ) + (set! (-> this up-blend) (seek-with-smooth (-> this up-blend) f0-47 (* 8192.0 (seconds-per-frame)) 0.25 0.01)) ) ) ) (else - (set! (-> obj up-blend) - (seek-with-smooth (-> obj up-blend) f28-1 (* 8192.0 (-> *display* seconds-per-frame)) 0.125 0.01) + (set! (-> this up-blend) + (seek-with-smooth (-> this up-blend) f28-1 (* 8192.0 (seconds-per-frame)) 0.125 0.01) ) ) ) ) ) (when (and arg1 *target*) - (set-target! (-> obj neck) (target-pos 5)) + (set-target! (-> this neck) (target-pos 5)) (if *target* - (look-at-enemy! (-> *target* neck) (the-as vector (-> obj root-overeride root-prim prim-core)) 'attacking obj) + (look-at-enemy! + (-> *target* neck) + (the-as vector (-> this root-overeride root-prim prim-core)) + 'attacking + this + ) ) ) - (let ((f30-3 (-> obj drill-speed))) - (let ((v1-56 (-> obj mode))) + (let ((f30-3 (-> this drill-speed))) + (let ((v1-56 (-> this mode))) (cond ((or (= v1-56 2) (zero? v1-56)) - (set! f30-3 (seek f30-3 72817.78 (* 372827.03 (-> *display* seconds-per-frame)))) + (set! f30-3 (seek f30-3 72817.78 (* 372827.03 (seconds-per-frame)))) ) ((= v1-56 1) - (set! f30-3 (seek f30-3 276707.56 (* 372827.03 (-> *display* seconds-per-frame)))) + (set! f30-3 (seek f30-3 276707.56 (* 372827.03 (seconds-per-frame)))) ) ((or (= v1-56 3) (= v1-56 4)) - (set! f30-3 (if (>= (- (-> *display* base-frame-counter) (-> obj started-chasing-time)) (seconds 2.25)) - (seek f30-3 0.0 (* 600746.7 (-> *display* seconds-per-frame))) - (seek f30-3 276707.56 (* 372827.03 (-> *display* seconds-per-frame))) + (set! f30-3 (if (time-elapsed? (-> this started-chasing-time) (seconds 2.25)) + (seek f30-3 0.0 (* 600746.7 (seconds-per-frame))) + (seek f30-3 276707.56 (* 372827.03 (seconds-per-frame))) ) ) ) ((= v1-56 5) - (set! f30-3 (if (>= (- (-> *display* base-frame-counter) (-> obj started-chasing-time)) (seconds 5.75)) - (seek f30-3 276707.56 (* 372827.03 (-> *display* seconds-per-frame))) - (seek f30-3 0.0 (* 600746.7 (-> *display* seconds-per-frame))) + (set! f30-3 (if (time-elapsed? (-> this started-chasing-time) (seconds 5.75)) + (seek f30-3 276707.56 (* 372827.03 (seconds-per-frame))) + (seek f30-3 0.0 (* 600746.7 (seconds-per-frame))) ) ) ) ) ) - (set! (-> obj drill-speed) f30-3) + (set! (-> this drill-speed) f30-3) (cond ((>= f30-3 36408.89) - (update-trans! (-> obj sound) (-> obj root-overeride trans)) - (update! (-> obj sound)) - (set! (-> obj played-drill-sound?) #t) + (update-trans! (-> this sound) (-> this root-overeride trans)) + (update! (-> this sound)) + (set! (-> this played-drill-sound?) #t) ) (else - (when (-> obj played-drill-sound?) - (set! (-> obj played-drill-sound?) #f) - (stop! (-> obj sound)) + (when (-> this played-drill-sound?) + (set! (-> this played-drill-sound?) #f) + (stop! (-> this sound)) ) ) ) - (let ((f0-69 (+ (-> obj drill-rz) (* f30-3 (-> *display* seconds-per-frame))))) - (set! (-> obj drill-rz) (- f0-69 (* (the float (the int (/ f0-69 65536.0))) 65536.0))) + (let ((f0-69 (+ (-> this drill-rz) (* f30-3 (seconds-per-frame))))) + (set! (-> this drill-rz) (- f0-69 (* (the float (the int (/ f0-69 65536.0))) 65536.0))) ) ) (let ((s5-2 (new 'stack-no-clear 'quaternion))) - (quaternion-axis-angle! s5-2 0.0 0.0 1.0 (-> obj drill-rz)) - (set-trs! (-> obj drill) (the-as vector #f) s5-2 (the-as vector #f)) + (quaternion-axis-angle! s5-2 0.0 0.0 1.0 (-> this drill-rz)) + (set-trs! (-> this drill) (the-as vector #f) s5-2 (the-as vector #f)) ) 0 ) ) - (when (and (-> obj hit-player?) + (when (and (-> this hit-player?) (or (not *target*) (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (>= (- (-> *display* base-frame-counter) (-> obj hit-player-time)) (seconds 0.05)) + (time-elapsed? (-> this hit-player-time) (seconds 0.05)) ) ) ) - (set-collide-offense (-> obj root-overeride) 2 (collide-offense touch)) - (set! (-> obj hit-player?) #f) + (set-collide-offense (-> this root-overeride) 2 (collide-offense touch)) + (set! (-> this hit-player?) #f) #f ) ) ;; definition for method 23 of type driller-lurker -(defmethod driller-lurker-method-23 driller-lurker ((obj driller-lurker)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-player-path-u-time)) - (set! (-> obj last-player-path-u-time) v1-1) +(defmethod driller-lurker-method-23 driller-lurker ((this driller-lurker)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-player-path-u-time)) + (set! (-> this last-player-path-u-time) v1-1) (cond (*target* - (let* ((s5-0 (-> obj path)) + (let* ((s5-0 (-> this path)) (s4-0 (method-of-object s5-0 path-control-method-20)) ) (target-pos 0) - (set! (-> obj player-path-u) (s4-0 s5-0)) + (set! (-> this player-path-u) (s4-0 s5-0)) ) ) (else - (set! (-> obj player-path-u) 0.0) + (set! (-> this player-path-u) 0.0) ) ) ) ) - (-> obj player-path-u) + (-> this player-path-u) ) ;; definition for method 25 of type driller-lurker -(defmethod driller-lurker-method-25 driller-lurker ((obj driller-lurker)) +(defmethod driller-lurker-method-25 driller-lurker ((this driller-lurker)) (when *target* (let* ((s5-0 (target-pos 0)) - (f0-1 (- (-> s5-0 y) (-> obj root-overeride trans y))) + (f0-1 (- (-> s5-0 y) (-> this root-overeride trans y))) ) (when (and (>= 32768.0 f0-1) (>= f0-1 -2048.0)) - (case (-> obj mode) + (case (-> this mode) ((1) - (if (>= 73728.0 (vector-vector-xz-distance (-> obj root-overeride trans) s5-0)) + (if (>= 73728.0 (vector-vector-xz-distance (-> this root-overeride trans) s5-0)) (return #t) ) ) (else - (when (>= 102400.0 (vector-vector-xz-distance (-> obj root-overeride trans) s5-0)) - (let ((f0-8 (atan (- (-> s5-0 x) (-> obj root-overeride trans x)) (- (-> s5-0 z) (-> obj root-overeride trans z)))) + (when (>= 102400.0 (vector-vector-xz-distance (-> this root-overeride trans) s5-0)) + (let ((f0-8 + (atan (- (-> s5-0 x) (-> this root-overeride trans x)) (- (-> s5-0 z) (-> this root-overeride trans z))) + ) ) - (if (>= 20024.889 (fabs (deg- f0-8 (-> obj facing-ry)))) + (if (>= 20024.889 (fabs (deg- f0-8 (-> this facing-ry)))) (return #t) ) ) @@ -604,14 +607,14 @@ ) ;; definition for method 26 of type driller-lurker -(defmethod driller-lurker-method-26 driller-lurker ((obj driller-lurker)) +(defmethod driller-lurker-method-26 driller-lurker ((this driller-lurker)) (when *target* (let* ((a1-0 (target-pos 0)) - (f0-1 (- (-> a1-0 y) (-> obj root-overeride trans y))) + (f0-1 (- (-> a1-0 y) (-> this root-overeride trans y))) ) (if (and (< f0-1 40960.0) (< -10240.0 f0-1) - (< (vector-vector-xz-distance (-> obj root-overeride trans) a1-0) 143360.0) + (< (vector-vector-xz-distance (-> this root-overeride trans) a1-0) 143360.0) ) (return #f) ) @@ -621,22 +624,22 @@ ) ;; definition for method 24 of type driller-lurker -(defmethod driller-lurker-method-24 driller-lurker ((obj driller-lurker)) +(defmethod driller-lurker-method-24 driller-lurker ((this driller-lurker)) (when *target* (let* ((a1-0 (target-pos 0)) - (f0-1 (- (-> a1-0 y) (-> obj root-overeride trans y))) + (f0-1 (- (-> a1-0 y) (-> this root-overeride trans y))) ) (when (and (< f0-1 40960.0) (< -10240.0 f0-1)) - (let ((f0-2 (vector-vector-xz-distance (-> obj root-overeride trans) a1-0))) + (let ((f0-2 (vector-vector-xz-distance (-> this root-overeride trans) a1-0))) (cond ((>= 17408.0 f0-2) (return #t) ) ((< f0-2 143360.0) - (let ((f0-3 (driller-lurker-method-23 obj)) - (f1-5 (-> obj path-u)) + (let ((f0-3 (driller-lurker-method-23 this)) + (f1-5 (-> this path-u)) ) - (if (>= (* 0.1 (-> obj path-units-per-meter)) (fabs (- f0-3 f1-5))) + (if (>= (* 0.1 (-> this path-units-per-meter)) (fabs (- f0-3 f1-5))) (return #t) ) ) @@ -650,14 +653,14 @@ ) ;; definition for method 27 of type driller-lurker -(defmethod driller-lurker-method-27 driller-lurker ((obj driller-lurker)) - (let ((a2-0 (-> obj node-list data 25 bone transform)) +(defmethod driller-lurker-method-27 driller-lurker ((this driller-lurker)) + (let ((a2-0 (-> this node-list data 25 bone transform)) (s5-0 (new 'stack-no-clear 'vector)) ) (set-vector! s5-0 0.0 0.0 8192.0 1.0) (vector-matrix*! s5-0 s5-0 a2-0) (vector-float*! s5-0 s5-0 (/ 1.0 (-> s5-0 w))) - (spawn (-> obj part) s5-0) + (spawn (-> this part) s5-0) ) ) @@ -726,7 +729,7 @@ :event driller-lurker-default-event-handler :enter (behavior () (set! (-> self mode) (the-as uint 2)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self timeout) (rand-vu-int-range 900 3600)) (set! (-> self targ-path-speed) 15360.0) (if (>= 4096.0 (-> self path-speed)) @@ -751,7 +754,7 @@ (ja :chan 1 :num! (chan 0) :frame-interp (-> self up-blend)) ) (when (ja-done? 0) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self timeout)) + (if (and (time-elapsed? (-> self state-time) (-> self timeout)) (>= 546.13336 (fabs (deg- (-> self path-ry) (-> self facing-ry)))) ) (go driller-lurker-patrol-pause) @@ -825,10 +828,10 @@ :event driller-lurker-default-event-handler :enter (behavior ((arg0 symbol)) (if arg0 - (set! (-> self started-chasing-time) (-> *display* base-frame-counter)) + (set-time! (-> self started-chasing-time)) ) (set! (-> self mode) (the-as uint 3)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self targ-path-speed) 23552.0) ) :trans (behavior () @@ -838,7 +841,7 @@ (if (driller-lurker-method-26 self) (go driller-lurker-patrol) ) - (if (>= (- (-> *display* base-frame-counter) (-> self started-chasing-time)) (seconds 3)) + (if (time-elapsed? (-> self started-chasing-time) (seconds 3)) (go driller-lurker-jammed-standing) ) (let* ((gp-0 (-> self path)) @@ -889,22 +892,22 @@ :event driller-lurker-default-event-handler :enter (behavior () (set! (-> self mode) (the-as uint 4)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self path-speed) 0.0) (set! (-> self targ-path-speed) 0.0) ) :trans (behavior () (cond ((driller-lurker-method-24 self) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (go driller-lurker-chase #f) ) ) ) - (if (>= (- (-> *display* base-frame-counter) (-> self started-chasing-time)) (seconds 3)) + (if (time-elapsed? (-> self started-chasing-time) (seconds 3)) (go driller-lurker-jammed-standing) ) (driller-lurker-method-20 self #f (the-as target #t)) @@ -946,7 +949,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self started-chasing-time) (-> *display* base-frame-counter)) + (set-time! (-> self started-chasing-time)) (cond (*target* (go driller-lurker-chase #f) @@ -985,49 +988,49 @@ ;; definition for method 7 of type driller-lurker ;; INFO: Return type mismatch process-drawable vs driller-lurker. -(defmethod relocate driller-lurker ((obj driller-lurker) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(defmethod relocate driller-lurker ((this driller-lurker) (arg0 int)) + (if (nonzero? (-> this neck)) + (&+! (-> this neck) arg0) ) - (if (nonzero? (-> obj drill)) - (&+! (-> obj drill) arg0) + (if (nonzero? (-> this drill)) + (&+! (-> this drill) arg0) ) - (if (nonzero? (-> obj sound2)) - (&+! (-> obj sound2) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method driller-lurker 7)) this arg0) ) ) ;; definition for method 10 of type driller-lurker -(defmethod deactivate driller-lurker ((obj driller-lurker)) - (if (nonzero? (-> obj sound2)) - (stop! (-> obj sound2)) +(defmethod deactivate driller-lurker ((this driller-lurker)) + (if (nonzero? (-> this sound2)) + (stop! (-> this sound2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 11 of type driller-lurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! driller-lurker ((obj driller-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! driller-lurker ((this driller-lurker) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj hit-player?) #f) - (set! (-> obj played-drill-sound?) #f) - (set! (-> obj hit-player-time) 0) - (set! (-> obj mode) (the-as uint 0)) - (set! (-> obj drill-rz) 0.0) - (set! (-> obj drill-speed) 72817.78) - (set! (-> obj last-update-time) 0) - (set! (-> obj last-player-path-u-time) 0) - (set! (-> obj started-chasing-time) 0) - (set! (-> obj player-attack-id) (the-as uint 0)) - (set! (-> obj ambient-drilling-u) -1.0) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this hit-player?) #f) + (set! (-> this played-drill-sound?) #f) + (set! (-> this hit-player-time) 0) + (set! (-> this mode) (the-as uint 0)) + (set! (-> this drill-rz) 0.0) + (set! (-> this drill-speed) 72817.78) + (set! (-> this last-update-time) 0) + (set! (-> this last-player-path-u-time) 0) + (set! (-> this started-chasing-time) 0) + (set! (-> this player-attack-id) (the-as uint 0)) + (set! (-> this ambient-drilling-u) -1.0) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1091,34 +1094,34 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-overeride) s4-0) + (set! (-> this root-overeride) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *driller-lurker-sg* '()) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (if (< (-> obj path curve num-cverts) 2) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *driller-lurker-sg* '()) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj draw shadow-ctrl) *driller-lurker-shadow-control*) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "drill-idle" :fo-max 40) (-> obj root-overeride trans)) + (set! (-> this draw shadow-ctrl) *driller-lurker-shadow-control*) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "drill-idle" :fo-max 40) (-> this root-overeride trans)) ) - (set! (-> obj sound2) - (new 'process 'ambient-sound (static-sound-spec "drill-idle2" :fo-max 60) (-> obj root-overeride trans)) + (set! (-> this sound2) + (new 'process 'ambient-sound (static-sound-spec "drill-idle2" :fo-max 60) (-> this root-overeride trans)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 331) obj)) - (let ((f0-34 (path-distance (-> obj path)))) - (set! (-> obj path-units-per-meter) (/ 4096.0 f0-34)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 331) this)) + (let ((f0-34 (path-distance (-> this path)))) + (set! (-> this path-units-per-meter) (/ 4096.0 f0-34)) ) - (set! (-> obj path-dir) 1.0) - (set! (-> obj path-u) 0.0) - (set! (-> obj path-speed) 15360.0) - (set! (-> obj targ-path-speed) 15360.0) - (set! (-> obj up-blend) 0.0) + (set! (-> this path-dir) 1.0) + (set! (-> this path-u) 0.0) + (set! (-> this path-speed) 15360.0) + (set! (-> this targ-path-speed) 15360.0) + (set! (-> this up-blend) 0.0) (set! sv-16 (new 'static 'res-tag)) (let ((v1-91 (res-lump-data @@ -1130,54 +1133,54 @@ ) ) (when v1-91 - (set! (-> obj path-u) (fmax 0.0 (fmin 1.0 (-> v1-91 0)))) + (set! (-> this path-u) (fmax 0.0 (fmin 1.0 (-> v1-91 0)))) (if (< (-> v1-91 1) 0.0) - (set! (-> obj path-dir) -1.0) + (set! (-> this path-dir) -1.0) ) (let ((f0-45 (-> v1-91 2))) (when (!= f0-45 12345.0) (let ((f30-0 (* 182.04445 f0-45))) - (set! (-> obj ambient-drilling-u) (-> obj path-u)) - (quaternion-axis-angle! (-> obj root-overeride quat) 0.0 1.0 0.0 f30-0) - (set! (-> obj facing-ry) f30-0) + (set! (-> this ambient-drilling-u) (-> this path-u)) + (quaternion-axis-angle! (-> this root-overeride quat) 0.0 1.0 0.0 f30-0) + (set! (-> this facing-ry) f30-0) ) ) ) ) ) - (eval-path-curve! (-> obj path) (-> obj root-overeride trans) (-> obj path-u) 'interp) + (eval-path-curve! (-> this path) (-> this root-overeride trans) (-> this path-u) 'interp) (let ((s5-1 (new 'stack-no-clear 'vector))) - (path-control-method-14 (-> obj path) s5-1 (-> obj path-u)) + (path-control-method-14 (-> this path) s5-1 (-> this path-u)) (let ((f0-51 (atan (-> s5-1 x) (-> s5-1 z)))) - (if (< (-> obj path-dir) 0.0) + (if (< (-> this path-dir) 0.0) (set! f0-51 (+ 32768.0 f0-51)) ) - (set! (-> obj path-ry) f0-51) - (if (< (-> obj ambient-drilling-u) 0.0) - (set! (-> obj facing-ry) f0-51) + (set! (-> this path-ry) f0-51) + (if (< (-> this ambient-drilling-u) 0.0) + (set! (-> this facing-ry) f0-51) ) ) ) - (let ((v1-103 (new 'process 'joint-mod (joint-mod-handler-mode reset) obj 6))) - (set! (-> obj neck) v1-103) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) + (let ((v1-103 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 6))) + (set! (-> this neck) v1-103) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) (set! (-> v1-103 up) (the-as uint 1)) (set! (-> v1-103 nose) (the-as uint 2)) (set! (-> v1-103 ear) (the-as uint 0)) (set! (-> v1-103 max-dist) 102400.0) (set! (-> v1-103 ignore-angle) 16384.0) ) - (set! (-> obj drill) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) obj 38)) + (set! (-> this drill) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) this 38)) (transform-post) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) -1 8192.0 ) - (if (>= (-> obj ambient-drilling-u) 0.0) + (if (>= (-> this ambient-drilling-u) 0.0) (go driller-lurker-idle-drilling) (go driller-lurker-patrol) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc index 145ee8dab4..3f303c5013 100644 --- a/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/gnawer_REF.gc @@ -17,14 +17,14 @@ ) ;; definition for method 3 of type gnawer-falling-segment -(defmethod inspect gnawer-falling-segment ((obj gnawer-falling-segment)) +(defmethod inspect gnawer-falling-segment ((this gnawer-falling-segment)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttransv: #~%" (-> obj transv)) - (format #t "~T~Tfacing-rot: #~%" (-> obj facing-rot)) - (format #t "~T~Tfacing-rotv: #~%" (-> obj facing-rotv)) - obj + (format #t "~T~Ttransv: #~%" (-> this transv)) + (format #t "~T~Tfacing-rot: #~%" (-> this facing-rot)) + (format #t "~T~Tfacing-rotv: #~%" (-> this facing-rotv)) + this ) ;; definition of type gnawer-segment-info @@ -38,11 +38,11 @@ ) ;; definition for method 3 of type gnawer-segment-info -(defmethod inspect gnawer-segment-info ((obj gnawer-segment-info)) - (format #t "[~8x] ~A~%" obj 'gnawer-segment-info) - (format #t "~Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~Tjoint-index[8] @ #x~X~%" (-> obj joint-index)) - obj +(defmethod inspect gnawer-segment-info ((this gnawer-segment-info)) + (format #t "[~8x] ~A~%" this 'gnawer-segment-info) + (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~Tjoint-index[8] @ #x~X~%" (-> this joint-index)) + this ) ;; definition of type gnawer-segment @@ -58,13 +58,13 @@ ) ;; definition for method 3 of type gnawer-segment -(defmethod inspect gnawer-segment ((obj gnawer-segment)) - (format #t "[~8x] ~A~%" obj 'gnawer-segment) - (format #t "~Tplace: ~D~%" (-> obj place)) - (format #t "~Tworld-pos: #~%" (-> obj world-pos)) - (format #t "~Tanim-to-local-trans-offset: #~%" (-> obj anim-to-local-trans-offset)) - (format #t "~Torient-mat: #~%" (-> obj orient-mat)) - obj +(defmethod inspect gnawer-segment ((this gnawer-segment)) + (format #t "[~8x] ~A~%" this 'gnawer-segment) + (format #t "~Tplace: ~D~%" (-> this place)) + (format #t "~Tworld-pos: #~%" (-> this world-pos)) + (format #t "~Tanim-to-local-trans-offset: #~%" (-> this anim-to-local-trans-offset)) + (format #t "~Torient-mat: #~%" (-> this orient-mat)) + this ) ;; definition of type gnawer-route @@ -87,20 +87,20 @@ ) ;; definition for method 3 of type gnawer-route -(defmethod inspect gnawer-route ((obj gnawer-route)) - (format #t "[~8x] ~A~%" obj 'gnawer-route) - (format #t "~Tsrc-pt-index: ~D~%" (-> obj src-pt-index)) - (format #t "~Tdest-pt-index: ~D~%" (-> obj dest-pt-index)) - (format #t "~Ttotal-travel-time: ~D~%" (-> obj total-travel-time)) - (format #t "~Tsrc-ang: ~f~%" (-> obj src-ang)) - (format #t "~Tdest-ang: ~f~%" (-> obj dest-ang)) - (format #t "~Tdelta-ang: ~f~%" (-> obj delta-ang)) - (format #t "~Tsurface-dist: ~f~%" (-> obj surface-dist)) - (format #t "~Ttotal-dist: ~f~%" (-> obj total-dist)) - (format #t "~Tsrc-pt-offset: #~%" (-> obj src-pt-offset)) - (format #t "~Tdest-pt-offset: #~%" (-> obj dest-pt-offset)) - (format #t "~Tsurface-dir: #~%" (-> obj surface-dir)) - obj +(defmethod inspect gnawer-route ((this gnawer-route)) + (format #t "[~8x] ~A~%" this 'gnawer-route) + (format #t "~Tsrc-pt-index: ~D~%" (-> this src-pt-index)) + (format #t "~Tdest-pt-index: ~D~%" (-> this dest-pt-index)) + (format #t "~Ttotal-travel-time: ~D~%" (-> this total-travel-time)) + (format #t "~Tsrc-ang: ~f~%" (-> this src-ang)) + (format #t "~Tdest-ang: ~f~%" (-> this dest-ang)) + (format #t "~Tdelta-ang: ~f~%" (-> this delta-ang)) + (format #t "~Tsurface-dist: ~f~%" (-> this surface-dist)) + (format #t "~Ttotal-dist: ~f~%" (-> this total-dist)) + (format #t "~Tsrc-pt-offset: #~%" (-> this src-pt-offset)) + (format #t "~Tdest-pt-offset: #~%" (-> this dest-pt-offset)) + (format #t "~Tsurface-dir: #~%" (-> this surface-dir)) + this ) ;; definition of type gnawer @@ -154,28 +154,28 @@ ) ;; definition for method 3 of type gnawer -(defmethod inspect gnawer ((obj gnawer)) +(defmethod inspect gnawer ((this gnawer)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Thit-points: ~D~%" (-> obj hit-points)) - (format #t "~T~Tgnawer-id: ~D~%" (-> obj gnawer-id)) - (format #t "~T~Ttotal-money: ~D~%" (-> obj total-money)) - (format #t "~T~Tmoney-mask: ~D~%" (-> obj money-mask)) - (format #t "~T~Teco-green-mask: ~D~%" (-> obj eco-green-mask)) - (format #t "~T~Thidden?: ~A~%" (-> obj hidden?)) - (format #t "~T~Tshow-damage?: ~A~%" (-> obj show-damage?)) - (format #t "~T~Troute-dist: ~f~%" (-> obj route-dist)) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tsound2: ~A~%" (-> obj sound2)) - (format #t "~T~Tlast-hit-time: ~D~%" (-> obj last-hit-time)) - (format #t "~T~Tpost-trans: #~%" (-> obj post-trans)) - (format #t "~T~Tfall-trans: #~%" (-> obj fall-trans)) - (format #t "~T~Troute: #~%" (-> obj route)) - (format #t "~T~Tsegments[10] @ #x~X~%" (-> obj segments)) - obj + (format #t "~T~Thit-points: ~D~%" (-> this hit-points)) + (format #t "~T~Tgnawer-id: ~D~%" (-> this gnawer-id)) + (format #t "~T~Ttotal-money: ~D~%" (-> this total-money)) + (format #t "~T~Tmoney-mask: ~D~%" (-> this money-mask)) + (format #t "~T~Teco-green-mask: ~D~%" (-> this eco-green-mask)) + (format #t "~T~Thidden?: ~A~%" (-> this hidden?)) + (format #t "~T~Tshow-damage?: ~A~%" (-> this show-damage?)) + (format #t "~T~Troute-dist: ~f~%" (-> this route-dist)) + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tsound2: ~A~%" (-> this sound2)) + (format #t "~T~Tlast-hit-time: ~D~%" (-> this last-hit-time)) + (format #t "~T~Tpost-trans: #~%" (-> this post-trans)) + (format #t "~T~Tfall-trans: #~%" (-> this fall-trans)) + (format #t "~T~Troute: #~%" (-> this route)) + (format #t "~T~Tsegments[10] @ #x~X~%" (-> this segments)) + this ) ;; failed to figure out what this is: @@ -388,14 +388,14 @@ (defstate falling (gnawer-falling-segment) :virtual #t :trans (behavior () - (+! (-> self transv y) (* -409600.0 (-> *display* seconds-per-frame))) + (+! (-> self transv y) (* -409600.0 (seconds-per-frame))) (vector-v+! (-> self root trans) (-> self root trans) (-> self transv)) - (+! (-> self facing-rot x) (* (-> self facing-rotv x) (-> *display* seconds-per-frame))) + (+! (-> self facing-rot x) (* (-> self facing-rotv x) (seconds-per-frame))) (set! (-> self facing-rot z) - (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (-> *display* seconds-per-frame))) + (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (seconds-per-frame))) ) (quaternion-zxy! (-> self root quat) (-> self facing-rot)) - (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) + (seek! (-> self root scale x) 0.0 (* 0.5 (seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) ) @@ -464,30 +464,30 @@ ;; definition for method 23 of type gnawer ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs none. -(defmethod gnawer-method-23 gnawer ((obj gnawer)) - (when (not (-> obj hidden?)) - (set! (-> obj hidden?) #t) - (logior! (-> obj draw status) (draw-status hidden)) - (logclear! (-> obj mask) (process-mask attackable)) - (set! (-> obj skel postbind-function) #f) - (set! (-> obj root-override trans quad) (-> obj post-trans quad)) - (clear-collide-with-as (-> obj root-override)) +(defmethod gnawer-method-23 gnawer ((this gnawer)) + (when (not (-> this hidden?)) + (set! (-> this hidden?) #t) + (logior! (-> this draw status) (draw-status hidden)) + (logclear! (-> this mask) (process-mask attackable)) + (set! (-> this skel postbind-function) #f) + (set! (-> this root-override trans quad) (-> this post-trans quad)) + (clear-collide-with-as (-> this root-override)) (dotimes (v1-12 10) - (set! (-> obj segments v1-12 world-pos quad) (-> obj post-trans quad)) + (set! (-> this segments v1-12 world-pos quad) (-> this post-trans quad)) ) - (set-vector! (-> obj draw bounds) 0.0 0.0 0.0 12288.0) + (set-vector! (-> this draw bounds) 0.0 0.0 0.0 12288.0) ) (none) ) ;; definition for method 26 of type gnawer ;; INFO: Return type mismatch draw-status vs none. -(defmethod gnawer-method-26 gnawer ((obj gnawer)) - (when (-> obj hidden?) - (set! (-> obj hidden?) #f) - (restore-collide-with-as (-> obj root-override)) - (set! (-> obj skel postbind-function) gnawer-joint-callback) - (logclear! (-> obj draw status) (draw-status hidden)) +(defmethod gnawer-method-26 gnawer ((this gnawer)) + (when (-> this hidden?) + (set! (-> this hidden?) #f) + (restore-collide-with-as (-> this root-override)) + (set! (-> this skel postbind-function) gnawer-joint-callback) + (logclear! (-> this draw status) (draw-status hidden)) ) (none) ) @@ -495,13 +495,13 @@ ;; definition for method 24 of type gnawer ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod gnawer-method-24 gnawer ((obj gnawer)) +(defmethod gnawer-method-24 gnawer ((this gnawer)) (local-vars (sv-48 vector) (sv-64 vector)) (let ((s5-0 0) (s4-0 0) ) (let ((f30-0 -1.0) - (s3-0 (-> obj path curve num-cverts)) + (s3-0 (-> this path curve num-cverts)) ) (dotimes (s2-0 3) (let ((s1-0 (rand-vu-int-count s3-0)) @@ -515,8 +515,8 @@ ) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-64 (new 'stack-no-clear 'vector)) - (eval-path-curve-div! (-> obj path) sv-48 (the float s1-0) 'interp) - (eval-path-curve-div! (-> obj path) sv-64 (the float s0-0) 'interp) + (eval-path-curve-div! (-> this path) sv-48 (the float s1-0) 'interp) + (eval-path-curve-div! (-> this path) sv-64 (the float s0-0) 'interp) (let ((f0-4 (vector-vector-distance sv-48 sv-64))) (when (< f30-0 f0-4) (set! f30-0 f0-4) @@ -527,32 +527,32 @@ ) ) ) - (set! (-> obj route src-pt-index) s5-0) - (set! (-> obj route dest-pt-index) s4-0) + (set! (-> this route src-pt-index) s5-0) + (set! (-> this route dest-pt-index) s4-0) ) - (let ((v1-13 (-> obj route src-pt-index)) - (s5-1 (-> obj route dest-pt-index)) + (let ((v1-13 (-> this route src-pt-index)) + (s5-1 (-> this route dest-pt-index)) ) - (eval-path-curve-div! (-> obj path) (-> obj route src-pt-offset) (the float v1-13) 'interp) - (eval-path-curve-div! (-> obj path) (-> obj route dest-pt-offset) (the float s5-1) 'interp) + (eval-path-curve-div! (-> this path) (-> this route src-pt-offset) (the float v1-13) 'interp) + (eval-path-curve-div! (-> this path) (-> this route dest-pt-offset) (the float s5-1) 'interp) ) - (vector-! (-> obj route src-pt-offset) (-> obj route src-pt-offset) (-> obj post-trans)) - (vector-! (-> obj route dest-pt-offset) (-> obj route dest-pt-offset) (-> obj post-trans)) - (let ((f30-1 (-> obj route src-pt-offset y))) - (set! (-> obj route src-pt-offset y) 0.0) - (vector-normalize! (-> obj route src-pt-offset) 10240.0) - (set! (-> obj route src-pt-offset y) f30-1) + (vector-! (-> this route src-pt-offset) (-> this route src-pt-offset) (-> this post-trans)) + (vector-! (-> this route dest-pt-offset) (-> this route dest-pt-offset) (-> this post-trans)) + (let ((f30-1 (-> this route src-pt-offset y))) + (set! (-> this route src-pt-offset y) 0.0) + (vector-normalize! (-> this route src-pt-offset) 10240.0) + (set! (-> this route src-pt-offset y) f30-1) ) - (let ((f30-2 (-> obj route dest-pt-offset y))) - (set! (-> obj route dest-pt-offset y) 0.0) - (vector-normalize! (-> obj route dest-pt-offset) 10240.0) - (set! (-> obj route dest-pt-offset y) f30-2) + (let ((f30-2 (-> this route dest-pt-offset y))) + (set! (-> this route dest-pt-offset y) 0.0) + (vector-normalize! (-> this route dest-pt-offset) 10240.0) + (set! (-> this route dest-pt-offset y) f30-2) ) - (let ((f30-3 (atan (-> obj route src-pt-offset x) (-> obj route src-pt-offset z))) - (f0-15 (atan (-> obj route dest-pt-offset x) (-> obj route dest-pt-offset z))) + (let ((f30-3 (atan (-> this route src-pt-offset x) (-> this route src-pt-offset z))) + (f0-15 (atan (-> this route dest-pt-offset x) (-> this route dest-pt-offset z))) ) - (set! (-> obj route src-ang) f30-3) - (set! (-> obj route dest-ang) f0-15) + (set! (-> this route src-ang) f30-3) + (set! (-> this route dest-ang) f0-15) (let ((f30-4 (deg- f0-15 f30-3))) 0.0 (let* ((v0-13 (rand-vu-int-count 100)) @@ -569,39 +569,39 @@ ) ) ) - (set! (-> obj route delta-ang) (if (>= f30-4 0.0) - (- f30-4 f0-17) - (+ f30-4 f0-17) - ) + (set! (-> this route delta-ang) (if (>= f30-4 0.0) + (- f30-4 f0-17) + (+ f30-4 f0-17) + ) ) ) ) ) - (let ((f30-5 (* 0.9817476 (-> obj route delta-ang))) - (f28-0 (- (-> obj route dest-pt-offset y) (-> obj route src-pt-offset y))) + (let ((f30-5 (* 0.9817476 (-> this route delta-ang))) + (f28-0 (- (-> this route dest-pt-offset y) (-> this route src-pt-offset y))) ) - (set-vector! (-> obj route surface-dir) f30-5 f28-0 0.0 1.0) - (vector-normalize! (-> obj route surface-dir) 1.0) + (set-vector! (-> this route surface-dir) f30-5 f28-0 0.0 1.0) + (vector-normalize! (-> this route surface-dir) 1.0) (let ((f0-25 (sqrtf (+ (* f30-5 f30-5) (* f28-0 f28-0))))) - (set! (-> obj route surface-dist) f0-25) - (set! (-> obj route total-dist) (+ 20480.0 f0-25)) + (set! (-> this route surface-dist) f0-25) + (set! (-> this route total-dist) (+ 20480.0 f0-25)) ) ) - (set! (-> obj route total-travel-time) - (the-as time-frame (the int (/ (-> obj route total-dist) (* 0.016666668 (-> obj speed))))) + (set! (-> this route total-travel-time) + (the-as time-frame (the int (/ (-> this route total-dist) (* 0.016666668 (-> this speed))))) ) (none) ) ;; definition for method 22 of type gnawer ;; INFO: Used lq/sq -(defmethod gnawer-method-22 gnawer ((obj gnawer) (arg0 float)) +(defmethod gnawer-method-22 gnawer ((this gnawer) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'bounding-box)) (a3-0 #t) (gp-0 #t) ) (dotimes (s2-0 10) - (let ((v1-4 (-> obj segments s2-0 place))) + (let ((v1-4 (-> this segments s2-0 place))) (cond ((>= v1-4 0) (let ((f0-1 (- arg0 (* 3891.2 (the float v1-4))))) @@ -610,43 +610,43 @@ (set! f0-1 0.0) (set! gp-0 #f) ) - ((>= f0-1 (-> obj route total-dist)) - (set! f0-1 (-> obj route total-dist)) + ((>= f0-1 (-> this route total-dist)) + (set! f0-1 (-> this route total-dist)) ) (else (set! gp-0 #f) ) ) - (gnawer-method-21 obj s2-0 s4-0 a3-0 f0-1) + (gnawer-method-21 this s2-0 s4-0 a3-0 f0-1) ) ) (else - (gnawer-method-20 obj s2-0) + (gnawer-method-20 this s2-0) ) ) ) (set! a3-0 #f) ) (set-vector! - (-> obj root-override trans) + (-> this root-override trans) (* 0.5 (+ (-> s4-0 min x) (-> s4-0 max x))) (* 0.5 (+ (-> s4-0 min y) (-> s4-0 max y))) (* 0.5 (+ (-> s4-0 min z) (-> s4-0 max z))) 1.0 ) - (let* ((f0-10 (- (-> s4-0 max x) (-> obj root-override trans x))) - (f1-12 (- (-> s4-0 max y) (-> obj root-override trans y))) - (f2-7 (- (-> s4-0 max z) (-> obj root-override trans z))) + (let* ((f0-10 (- (-> s4-0 max x) (-> this root-override trans x))) + (f1-12 (- (-> s4-0 max y) (-> this root-override trans y))) + (f2-7 (- (-> s4-0 max z) (-> this root-override trans z))) (f0-14 (sqrtf (+ (* f0-10 f0-10) (* f1-12 f1-12) (* f2-7 f2-7)))) - (a0-3 (-> obj draw bounds)) - (v1-21 (-> obj root-override root-prim)) + (a0-3 (-> this draw bounds)) + (v1-21 (-> this root-override root-prim)) (f0-15 (+ 12288.0 f0-14)) ) (vector-reset! a0-3) (set! (-> a0-3 w) f0-15) (vector-reset! (-> v1-21 local-sphere)) (set! (-> v1-21 local-sphere w) f0-15) - (set! (-> v1-21 prim-core world-sphere quad) (-> obj root-override trans quad)) + (set! (-> v1-21 prim-core world-sphere quad) (-> this root-override trans quad)) (set! (-> v1-21 prim-core world-sphere w) f0-15) ) gp-0 @@ -655,37 +655,37 @@ ;; definition for method 21 of type gnawer ;; INFO: Used lq/sq -(defmethod gnawer-method-21 gnawer ((obj gnawer) (arg0 int) (arg1 bounding-box) (arg2 symbol) (arg3 float)) - (let ((gp-0 (-> obj segments arg0))) - (let ((f0-1 (+ 10240.0 (-> obj route surface-dist)))) +(defmethod gnawer-method-21 gnawer ((this gnawer) (arg0 int) (arg1 bounding-box) (arg2 symbol) (arg3 float)) + (let ((gp-0 (-> this segments arg0))) + (let ((f0-1 (+ 10240.0 (-> this route surface-dist)))) (cond ((< arg3 10240.0) (let ((f0-3 (* 0.00009765625 arg3))) - (vector-float*! (-> gp-0 world-pos) (-> obj route src-pt-offset) f0-3) + (vector-float*! (-> gp-0 world-pos) (-> this route src-pt-offset) f0-3) ) - (set! (-> gp-0 world-pos y) (-> obj route src-pt-offset y)) - (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> obj post-trans)) + (set! (-> gp-0 world-pos y) (-> this route src-pt-offset y)) + (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> this post-trans)) ) ((< arg3 f0-1) - (let* ((f30-0 (/ (+ -10240.0 arg3) (-> obj route surface-dist))) - (f28-0 (+ (* (-> obj route delta-ang) f30-0) (-> obj route src-ang))) + (let* ((f30-0 (/ (+ -10240.0 arg3) (-> this route surface-dist))) + (f28-0 (+ (* (-> this route delta-ang) f30-0) (-> this route src-ang))) ) (set-vector! (-> gp-0 world-pos) (* 10240.0 (sin f28-0)) - (lerp (-> obj route src-pt-offset y) (-> obj route dest-pt-offset y) f30-0) + (lerp (-> this route src-pt-offset y) (-> this route dest-pt-offset y) f30-0) (* 10240.0 (cos f28-0)) 1.0 ) ) - (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> obj post-trans)) + (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> this post-trans)) ) (else (let ((f0-19 (- 1.0 (* 0.00009765625 (- arg3 f0-1))))) - (vector-float*! (-> gp-0 world-pos) (-> obj route dest-pt-offset) f0-19) + (vector-float*! (-> gp-0 world-pos) (-> this route dest-pt-offset) f0-19) ) - (set! (-> gp-0 world-pos y) (-> obj route dest-pt-offset y)) - (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> obj post-trans)) + (set! (-> gp-0 world-pos y) (-> this route dest-pt-offset y)) + (vector+! (-> gp-0 world-pos) (-> gp-0 world-pos) (-> this post-trans)) ) ) ) @@ -699,13 +699,13 @@ ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector-! s4-1 (-> gp-0 world-pos) (-> obj post-trans)) + (vector-! s4-1 (-> gp-0 world-pos) (-> this post-trans)) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) (let ((f0-24 (atan (-> s4-1 x) (-> s4-1 z))) (s3-1 (new 'stack-no-clear 'vector)) ) - (vector-rotate-around-y! s3-1 (-> obj route surface-dir) f0-24) + (vector-rotate-around-y! s3-1 (-> this route surface-dir) f0-24) (set! (-> gp-0 orient-mat vector 1 quad) (-> s4-1 quad)) (set! (-> gp-0 orient-mat vector 2 quad) (-> s3-1 quad)) ) @@ -724,9 +724,9 @@ ;; definition for method 20 of type gnawer ;; INFO: Used lq/sq -(defmethod gnawer-method-20 gnawer ((obj gnawer) (arg0 int)) - (let ((v1-3 (-> obj segments arg0)) - (a0-1 (-> obj segments (+ arg0 -1))) +(defmethod gnawer-method-20 gnawer ((this gnawer) (arg0 int)) + (let ((v1-3 (-> this segments arg0)) + (a0-1 (-> this segments (+ arg0 -1))) ) (set! (-> v1-3 world-pos quad) (-> a0-1 world-pos quad)) (let ((v0-0 (-> v1-3 orient-mat))) @@ -747,27 +747,27 @@ ) ;; definition for method 25 of type gnawer -(defmethod gnawer-method-25 gnawer ((obj gnawer)) +(defmethod gnawer-method-25 gnawer ((this gnawer)) (dotimes (s5-0 3) - (when (> (-> obj hit-points) 0) - (+! (-> obj hit-points) -1) - (+! (-> obj speed) 4096.0) - (when (> (-> obj hit-points) 0) - (set! (-> obj show-damage?) #t) - (let ((s4-0 (+ (-> obj hit-points) 2))) - (let ((s3-0 (-> obj segments s4-0))) + (when (> (-> this hit-points) 0) + (+! (-> this hit-points) -1) + (+! (-> this speed) 4096.0) + (when (> (-> this hit-points) 0) + (set! (-> this show-damage?) #t) + (let ((s4-0 (+ (-> this hit-points) 2))) + (let ((s3-0 (-> this segments s4-0))) (let ((s1-0 (new 'stack-no-clear 'vector)) (s2-0 (-> s3-0 world-pos)) ) - (vector-! s1-0 s2-0 (-> obj root-override trans)) + (vector-! s1-0 s2-0 (-> this root-override trans)) (set! (-> s1-0 y) 0.0) (vector-normalize! s1-0 1.0) - (process-spawn gnawer-falling-segment obj s2-0 s1-0 :to obj) + (process-spawn gnawer-falling-segment this s2-0 s1-0 :to this) ) (set! (-> s3-0 place) -1) ) (while (< s4-0 10) - (let ((v1-20 (-> obj segments s4-0))) + (let ((v1-20 (-> this segments s4-0))) (if (>= (-> v1-20 place) 0) (+! (-> v1-20 place) -1) ) @@ -779,12 +779,12 @@ ) ) (close-specific-task! (game-task cave-gnawers) (task-status need-hint)) - (<= (-> obj hit-points) 0) + (<= (-> this hit-points) 0) ) ;; definition for method 28 of type gnawer ;; INFO: Return type mismatch int vs symbol. -(defmethod gnawer-method-28 gnawer ((obj gnawer) (arg0 int) (arg1 int)) +(defmethod gnawer-method-28 gnawer ((this gnawer) (arg0 int) (arg1 int)) (when (> arg0 0) (let* ((v1-1 (rand-vu-int-count arg0)) (a0-2 v1-1) @@ -804,20 +804,20 @@ ;; definition for method 27 of type gnawer ;; INFO: Return type mismatch int vs none. -(defmethod gnawer-method-27 gnawer ((obj gnawer)) - (set! (-> obj eco-green-mask) (the-as uint 0)) - (let ((s4-0 (-> obj path curve num-cverts)) +(defmethod gnawer-method-27 gnawer ((this gnawer)) + (set! (-> this eco-green-mask) (the-as uint 0)) + (let ((s4-0 (-> this path curve num-cverts)) (s3-0 (get-death-count *game-info* #f)) - (s5-0 (-> obj money-mask)) + (s5-0 (-> this money-mask)) ) (when (and *target* (or (and (= s3-0 1) (and (>= 1.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.1))) (and (< 1 s3-0) (and (>= 2.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.05))) ) ) - (let ((v1-14 (gnawer-method-28 obj s4-0 (the-as int s5-0)))) + (let ((v1-14 (gnawer-method-28 this s4-0 (the-as int s5-0)))) (logior s5-0 (the-as uint v1-14)) - (set! (-> obj eco-green-mask) (the-as uint (logior (-> obj eco-green-mask) (the-as uint v1-14)))) + (set! (-> this eco-green-mask) (the-as uint (logior (-> this eco-green-mask) (the-as uint v1-14)))) ) ) ) @@ -825,22 +825,22 @@ ) ;; definition for method 29 of type gnawer -(defmethod gnawer-method-29 gnawer ((obj gnawer) (arg0 int) (arg1 vector) (arg2 vector)) - (let ((s1-0 (-> obj path curve num-cverts)) +(defmethod gnawer-method-29 gnawer ((this gnawer) (arg0 int) (arg1 vector) (arg2 vector)) + (let ((s1-0 (-> this path curve num-cverts)) (s2-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (eval-path-curve-div! (-> obj path) s2-0 0.0 'interp) + (eval-path-curve-div! (-> this path) s2-0 0.0 'interp) (let* ((f30-0 (-> s2-0 y)) (f28-0 f30-0) ) - (eval-path-curve-div! (-> obj path) s2-0 (the float (+ s1-0 -1)) 'interp) + (eval-path-curve-div! (-> this path) s2-0 (the float (+ s1-0 -1)) 'interp) (let ((f30-1 (fmin f30-0 (-> s2-0 y))) (f28-1 (fmax f28-0 (-> s2-0 y))) ) - (eval-path-curve-div! (-> obj path) arg1 (the float arg0) 'interp) - (vector-! arg2 arg1 (-> obj post-trans)) + (eval-path-curve-div! (-> this path) arg1 (the float arg0) 'interp) + (vector-! arg2 arg1 (-> this post-trans)) (let ((f0-9 (+ 16384.0 (* 16384.0 (/ (fmax 0.0 (- (-> arg2 y) f30-1)) (- f28-1 f30-1)))))) (set! (-> arg2 y) 0.0) (vector-normalize! arg2 f0-9) @@ -848,27 +848,27 @@ ) ) ) - (vector+! arg2 arg2 (-> obj post-trans)) + (vector+! arg2 arg2 (-> this post-trans)) (set! (-> arg2 y) (+ 4096.0 (-> arg2 y))) ) ;; definition for method 30 of type gnawer ;; INFO: Used lq/sq -(defmethod gnawer-method-30 gnawer ((obj gnawer) (arg0 process-drawable)) +(defmethod gnawer-method-30 gnawer ((this gnawer) (arg0 process-drawable)) (local-vars (sv-48 vector)) - (let ((gp-0 (-> obj entity extra perm))) + (let ((gp-0 (-> this entity extra perm))) (logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage)) (let ((s5-0 (-> gp-0 user-uint16 0)) (s2-0 -1) ) (let ((f30-0 0.0) - (s1-0 (-> obj path curve num-cverts)) + (s1-0 (-> this path curve num-cverts)) ) (dotimes (s0-0 s1-0) (when (logtest? (ash 1 s0-0) s5-0) (let ((a2-0 (new 'stack-no-clear 'vector))) (set! sv-48 (new 'stack-no-clear 'vector)) - (gnawer-method-29 obj s0-0 a2-0 sv-48) + (gnawer-method-29 this s0-0 a2-0 sv-48) ) (let* ((t9-1 vector-vector-xz-distance) (a1-2 (-> arg0 root trans)) @@ -1031,9 +1031,9 @@ :code (behavior () (set! (-> self draw origin-joint-index) (the-as uint 0)) (gnawer-method-23 self) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (rand-vu-int-range 240 360))) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + (until (time-elapsed? (-> self state-time) gp-0) (suspend) ) ) @@ -1067,7 +1067,7 @@ ) ) (else - (if (< (- (-> *display* base-frame-counter) (-> self last-hit-time)) (seconds 0.5)) + (if (not (time-elapsed? (-> self last-hit-time) (seconds 0.5))) (return #f) ) (let* ((a2-1 (the-as object (-> block param 0))) @@ -1097,7 +1097,7 @@ (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self route-dist) 0.0) (gnawer-method-24 self) - (set! (-> self last-hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-hit-time)) (gnawer-method-26 self) ) :exit (behavior () @@ -1105,7 +1105,7 @@ (stop! (-> self sound)) ) :trans (behavior () - (+! (-> self route-dist) (* (-> self speed) (-> *display* seconds-per-frame))) + (+! (-> self route-dist) (* (-> self speed) (seconds-per-frame))) (if (gnawer-method-22 self (-> self route-dist)) (go gnawer-wait-to-run) ) @@ -1154,7 +1154,7 @@ (vector-normalize! (-> self root-override transv) 32768.0) ) :trans (behavior () - (+! (-> self root-override transv y) (* -409600.0 (-> *display* seconds-per-frame))) + (+! (-> self root-override transv y) (* -409600.0 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self fall-trans quad)) (vector-v+! (-> self fall-trans) (-> self fall-trans) (-> self root-override transv)) @@ -1231,8 +1231,8 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.05)) (suspend) ) ) @@ -1401,45 +1401,45 @@ ) ;; definition for method 10 of type gnawer -(defmethod deactivate gnawer ((obj gnawer)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate gnawer ((this gnawer)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj sound2)) - (stop! (-> obj sound2)) + (if (nonzero? (-> this sound2)) + (stop! (-> this sound2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type gnawer ;; INFO: Return type mismatch nav-enemy vs gnawer. -(defmethod relocate gnawer ((obj gnawer) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate gnawer ((this gnawer) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj sound2)) - (&+! (-> obj sound2) arg0) + (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 obj) arg0) + ((the-as (function nav-enemy int nav-enemy) (find-parent-method gnawer 7)) (the-as nav-enemy this) arg0) ) ) ;; definition for method 11 of type gnawer ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! gnawer ((obj gnawer) (arg0 entity-actor)) +(defmethod init-from-entity! gnawer ((this gnawer) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) - (set! (-> obj hidden?) #f) - (set! (-> obj show-damage?) #f) - (set! (-> obj hit-points) 6) - (set! (-> obj speed) 24576.0) - (set! (-> obj last-hit-time) 0) - (set! (-> obj route-dist) 0.0) - (logclear! (-> obj mask) (process-mask attackable)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this hidden?) #f) + (set! (-> this show-damage?) #f) + (set! (-> this hit-points) 6) + (set! (-> this speed) 24576.0) + (set! (-> this last-hit-time) 0) + (set! (-> this route-dist) 0.0) + (logclear! (-> this mask) (process-mask attackable)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 8) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1512,55 +1512,55 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (quaternion-identity! (-> obj root-override quat)) - (initialize-skeleton obj *gnawer-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 8)) - (set! (-> obj post-trans quad) (-> obj root-override trans quad)) - (let ((f0-40 (res-lump-float (-> obj entity) 'rotoffset))) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-40) + (process-drawable-from-entity! this arg0) + (quaternion-identity! (-> this root-override quat)) + (initialize-skeleton this *gnawer-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 8)) + (set! (-> this post-trans quad) (-> this root-override trans quad)) + (let ((f0-40 (res-lump-float (-> this entity) 'rotoffset))) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-40) ) - (+! (-> obj root-override trans y) -2048.0) + (+! (-> this root-override trans y) -2048.0) (set! sv-16 (new 'static 'res-tag)) (let ((v1-81 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-81 - (+! (-> obj root-override trans x) (-> v1-81 0)) - (+! (-> obj root-override trans y) (-> v1-81 1)) - (+! (-> obj root-override trans z) (-> v1-81 2)) + (+! (-> this root-override trans x) (-> v1-81 0)) + (+! (-> this root-override trans y) (-> v1-81 1)) + (+! (-> this root-override trans z) (-> v1-81 2)) ) ) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (if (< (-> obj path curve num-cverts) 2) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 330) obj)) - (set! (-> obj total-money) 0) - (set! (-> obj money-mask) (the-as uint 0)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 330) this)) + (set! (-> this total-money) 0) + (set! (-> this money-mask) (the-as uint 0)) (set! sv-32 (new 'static 'res-tag)) (let ((v1-96 (res-lump-data arg0 'extra-count (pointer int32) :tag-ptr (& sv-32)))) (when v1-96 (case (-> v1-96 0) ((5) - (set! (-> obj total-money) (-> v1-96 1)) + (set! (-> this total-money) (-> v1-96 1)) ) ) ) ) - (when (> (-> obj total-money) 0) + (when (> (-> this total-money) 0) (set! sv-48 (new 'static 'res-tag)) (let ((a0-49 (res-lump-data arg0 'gnawer (pointer int32) :tag-ptr (& sv-48)))) (cond (a0-49 (let ((v1-100 0)) - (dotimes (a1-30 (-> obj total-money)) + (dotimes (a1-30 (-> this total-money)) (let ((a3-15 (-> a0-49 a1-30))) (set! v1-100 (logior v1-100 (ash 1 a3-15))) ) ) - (set! (-> obj money-mask) (the-as uint v1-100)) + (set! (-> this money-mask) (the-as uint v1-100)) ) ) (else @@ -1569,30 +1569,30 @@ ) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 329) obj)) - (set! (-> obj sound) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 329) this)) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "gnawer-crawl" :fo-min 30 :fo-max 30) - (-> obj root-override trans) + (-> this root-override trans) ) ) - (set! (-> obj sound2) - (new 'process 'ambient-sound (static-sound-spec "gnawer-chew" :fo-max 40) (-> obj root-override trans)) + (set! (-> this sound2) + (new 'process 'ambient-sound (static-sound-spec "gnawer-chew" :fo-max 40) (-> this root-override trans)) ) (dotimes (v1-110 10) - (let ((a0-59 (-> obj segments v1-110))) + (let ((a0-59 (-> this segments v1-110))) (set! (-> a0-59 place) v1-110) - (set! (-> a0-59 world-pos quad) (-> obj post-trans quad)) + (set! (-> a0-59 world-pos quad) (-> this post-trans quad)) (vector-reset! (-> a0-59 anim-to-local-trans-offset)) (+! (-> a0-59 anim-to-local-trans-offset z) (* 5447.68 (the float v1-110))) ) ) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj gnawer-id) (+ (actor-count-before (-> obj link)) 1)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this gnawer-id) (+ (actor-count-before (-> this link)) 1)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go gnawer-put-items-at-dest) (go gnawer-chewing-on-post) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc b/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc index 62873ec037..a9b65c492e 100644 --- a/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/maincave-obs_REF.gc @@ -12,12 +12,12 @@ ) ;; definition for method 3 of type maincavecam -(defmethod inspect maincavecam ((obj maincavecam)) +(defmethod inspect maincavecam ((this maincavecam)) (let ((t9-0 (method-of-type pov-camera inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tseq: ~D~%" (-> obj seq)) - obj + (format #t "~T~Tseq: ~D~%" (-> this seq)) + this ) ;; failed to figure out what this is: @@ -27,8 +27,8 @@ ) ;; definition for method 29 of type maincavecam -(defmethod set-stack-size! maincavecam ((obj maincavecam)) - (stack-size-set! (-> obj main-thread) 512) +(defmethod set-stack-size! maincavecam ((this maincavecam)) + (stack-size-set! (-> this main-thread) 512) (none) ) @@ -82,11 +82,11 @@ ) ;; definition for method 3 of type cave-water -(defmethod inspect cave-water ((obj cave-water)) +(defmethod inspect cave-water ((this cave-water)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for symbol ripple-for-cave-water, type ripple-wave-set @@ -105,20 +105,20 @@ ;; definition for method 22 of type cave-water ;; INFO: Return type mismatch rgbaf vs none. -(defmethod water-vol-method-22 cave-water ((obj cave-water)) +(defmethod water-vol-method-22 cave-water ((this cave-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) + (set! (-> this draw ripple) v1-2) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) (set! (-> v1-2 waveform) ripple-for-cave-water) ) - (case (-> obj look) + (case (-> this look) ((37 14) - (set-vector! (-> obj draw color-mult) 0.2 0.1 0.3 0.75) + (set-vector! (-> this draw color-mult) 0.2 0.1 0.3 0.75) ) ) (none) @@ -138,11 +138,11 @@ ) ;; definition for method 3 of type cavecrusher -(defmethod inspect cavecrusher ((obj cavecrusher)) +(defmethod inspect cavecrusher ((this cavecrusher)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -184,8 +184,8 @@ ;; definition for method 11 of type cavecrusher ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavecrusher ((obj cavecrusher) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! cavecrusher ((this cavecrusher) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -197,24 +197,24 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *cavecrusher-sg* '()) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> obj root-override trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *cavecrusher-sg* '()) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "crush-click" :fo-max 30) (-> this root-override trans)) ) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (go cavecrusher-idle) (none) ) @@ -235,12 +235,12 @@ ) ;; definition for method 3 of type cavetrapdoor -(defmethod inspect cavetrapdoor ((obj cavetrapdoor)) +(defmethod inspect cavetrapdoor ((this cavetrapdoor)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdelay-before-wiggle: ~D~%" (-> obj delay-before-wiggle)) - obj + (format #t "~T~Tdelay-before-wiggle: ~D~%" (-> this delay-before-wiggle)) + this ) ;; failed to figure out what this is: @@ -281,8 +281,8 @@ :virtual #t :code (behavior () (when (nonzero? (-> self delay-before-wiggle)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay-before-wiggle)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (-> self delay-before-wiggle)) (suspend) ) ) @@ -345,9 +345,9 @@ ;; definition for method 11 of type cavetrapdoor ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavetrapdoor ((obj cavetrapdoor) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! cavetrapdoor ((this cavetrapdoor) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -365,38 +365,38 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *cavetrapdoor-sg* '()) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *cavetrapdoor-sg* '()) (ja-channel-push! 1 0) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (let ((f0-7 (quaternion-y-angle (-> obj root-override quat))) - (s4-2 (-> obj draw bounds)) + (update-transforms! (-> this root-override)) + (let ((f0-7 (quaternion-y-angle (-> this root-override quat))) + (s4-2 (-> this draw bounds)) ) (set-vector! s4-2 0.0 -8192.0 4096.0 1.0) (vector-rotate-around-y! s4-2 s4-2 f0-7) (set! (-> s4-2 w) 25600.0) ) - (set! (-> obj delay-before-wiggle) (the int (* 300.0 (res-lump-float arg0 'delay)))) + (set! (-> this delay-before-wiggle) (the int (* 300.0 (res-lump-float arg0 'delay)))) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) -1 8192.0 ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -421,18 +421,18 @@ ) ;; definition for method 3 of type caveflamepots -(defmethod inspect caveflamepots ((obj caveflamepots)) +(defmethod inspect caveflamepots ((this caveflamepots)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tshove-up: ~f~%" (-> obj shove-up)) - (format #t "~T~Tcycle-speed: ~D~%" (-> obj cycle-speed)) - (format #t "~T~Tcycle-pause: ~D~%" (-> obj cycle-pause)) - (format #t "~T~Tcycle-offset: ~D~%" (-> obj cycle-offset)) - (format #t "~T~Twas-deadly?: ~A~%" (-> obj was-deadly?)) - (format #t "~T~Tshould-play-sound?: ~A~%" (-> obj should-play-sound?)) - (format #t "~T~Tlaunch-pos[2] @ #x~X~%" (-> obj launch-pos)) - obj + (format #t "~T~Tshove-up: ~f~%" (-> this shove-up)) + (format #t "~T~Tcycle-speed: ~D~%" (-> this cycle-speed)) + (format #t "~T~Tcycle-pause: ~D~%" (-> this cycle-pause)) + (format #t "~T~Tcycle-offset: ~D~%" (-> this cycle-offset)) + (format #t "~T~Twas-deadly?: ~A~%" (-> this was-deadly?)) + (format #t "~T~Tshould-play-sound?: ~A~%" (-> this should-play-sound?)) + (format #t "~T~Tlaunch-pos[2] @ #x~X~%" (-> this launch-pos)) + this ) ;; failed to figure out what this is: @@ -496,7 +496,7 @@ (let ((s4-0 (new 'stack 'attack-info))) (calc-shove-up (-> self root-override) s4-0 (-> self shove-up)) (if (or (= (-> *target* control unknown-surface00 mode) 'air) - (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) + (>= (+ (current-time) (seconds -0.2)) (-> *target* control unknown-dword11)) (< 0.75 (-> *target* control poly-normal y)) ) (send-event @@ -527,7 +527,7 @@ :trans (behavior () (let* ((v1-0 (-> self cycle-speed)) (a0-1 (- v1-0 (-> self cycle-pause))) - (gp-0 (mod (+ (-> *display* base-frame-counter) (the-as time-frame (-> self cycle-offset))) v1-0)) + (gp-0 (mod (+ (current-time) (the-as time-frame (-> self cycle-offset))) v1-0)) ) (cond ((< gp-0 a0-1) @@ -579,15 +579,15 @@ ;; definition for method 11 of type caveflamepots ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! caveflamepots ((obj caveflamepots) (arg0 entity-actor)) +(defmethod init-from-entity! caveflamepots ((this caveflamepots) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) - (set! (-> obj was-deadly?) #f) - (set! (-> obj should-play-sound?) #f) - (set! (-> obj shove-up) (res-lump-float arg0 'shove :default 8192.0)) - (logclear! (-> obj mask) (process-mask enemy)) - (logclear! (-> obj mask) (process-mask attackable)) - (logior! (-> obj mask) (process-mask actor-pause)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (set! (-> this was-deadly?) #f) + (set! (-> this should-play-sound?) #f) + (set! (-> this shove-up) (res-lump-float arg0 'shove :default 8192.0)) + (logclear! (-> this mask) (process-mask enemy)) + (logclear! (-> this mask) (process-mask attackable)) + (logior! (-> this mask) (process-mask actor-pause)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -625,11 +625,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (let ((v1-42 (new 'process 'path-control obj 'path 0.0))) - (set! (-> obj path) v1-42) + (process-drawable-from-entity! this arg0) + (let ((v1-42 (new 'process 'path-control this 'path 0.0))) + (set! (-> this path) v1-42) (logior! (-> v1-42 flags) (path-control-flag display draw-line draw-point draw-text)) (if (<= (-> v1-42 curve num-cverts) 0) (go process-drawable-art-error "no path") @@ -637,11 +637,11 @@ ) (let ((f0-23 (res-lump-float arg0 'rotoffset))) (if (!= f0-23 0.0) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-23) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-23) ) ) - (let ((f30-0 (quaternion-y-angle (-> obj root-override quat)))) - (let ((s4-1 (-> obj launch-pos))) + (let ((f30-0 (quaternion-y-angle (-> this root-override quat)))) + (let ((s4-1 (-> this launch-pos))) (let ((v1-53 s4-1)) (set! (-> v1-53 0 x) 6144.0) (set! (-> v1-53 0 y) 0.0) @@ -649,14 +649,14 @@ (set! (-> v1-53 0 w) 1.0) ) (vector-rotate-around-y! (the-as vector s4-1) (the-as vector s4-1) f30-0) - (vector+! (the-as vector s4-1) (the-as vector s4-1) (-> obj root-override trans)) + (vector+! (the-as vector s4-1) (the-as vector s4-1) (-> this root-override trans)) ) - (let ((s4-2 (the-as object (&-> obj stack 112)))) + (let ((s4-2 (the-as object (&-> this stack 112)))) (set-vector! (the-as vector s4-2) -6144.0 0.0 0.0 1.0) (vector-rotate-around-y! (the-as vector s4-2) (the-as vector s4-2) f30-0) - (vector+! (the-as vector s4-2) (the-as vector s4-2) (-> obj root-override trans)) + (vector+! (the-as vector s4-2) (the-as vector s4-2) (-> this root-override trans)) ) - (let ((s4-3 (-> obj root-override root-prim))) + (let ((s4-3 (-> this root-override root-prim))) (dotimes (s3-1 (-> (the-as collide-shape-prim-group s4-3) num-prims)) (let ((a1-19 (-> (the-as collide-shape-prim-group s4-3) prims s3-1 local-sphere))) (vector-rotate-around-y! a1-19 a1-19 f30-0) @@ -664,23 +664,23 @@ ) ) ) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (let ((f30-1 300.0)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-70 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-16)))) - (set! (-> obj cycle-speed) (the int (* f30-1 (if (and v1-70 (> (the-as int (-> sv-16 elt-count)) 0)) - (-> v1-70 0) - 4.0 - ) - ) - ) + (set! (-> this cycle-speed) (the int (* f30-1 (if (and v1-70 (> (the-as int (-> sv-16 elt-count)) 0)) + (-> v1-70 0) + 4.0 + ) + ) + ) ) ) ) - (let ((f30-2 (the float (-> obj cycle-speed)))) + (let ((f30-2 (the float (-> this cycle-speed)))) (set! sv-32 (new 'static 'res-tag)) (let ((v1-74 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-32)))) - (set! (-> obj cycle-offset) + (set! (-> this cycle-offset) (the-as uint (the int (* f30-2 (if (and v1-74 (< 1 (the-as int (-> sv-32 elt-count)))) (-> v1-74 1) 0.0 @@ -694,12 +694,12 @@ (let ((f30-3 300.0)) (set! sv-48 (new 'static 'res-tag)) (let ((v1-77 (res-lump-data arg0 'cycle-speed (pointer float) :tag-ptr (& sv-48)))) - (set! (-> obj cycle-pause) (the int (* f30-3 (if (and v1-77 (< 2 (the-as int (-> sv-48 elt-count)))) - (-> v1-77 2) - 2.0 - ) - ) - ) + (set! (-> this cycle-pause) (the int (* f30-3 (if (and v1-77 (< 2 (the-as int (-> sv-48 elt-count)))) + (-> v1-77 2) + 2.0 + ) + ) + ) ) ) ) @@ -722,12 +722,12 @@ ) ;; definition for method 3 of type cavespatula -(defmethod inspect cavespatula ((obj cavespatula)) +(defmethod inspect cavespatula ((this cavespatula)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + this ) ;; failed to figure out what this is: @@ -762,9 +762,9 @@ ;; definition for method 11 of type cavespatula ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavespatula ((obj cavespatula) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! cavespatula ((this cavespatula) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -782,51 +782,56 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> obj root-override trans)) + (process-drawable-from-entity! this arg0) + (set! (-> this sound) + (new + 'process + 'ambient-sound + (static-sound-spec "spatula" :fo-min 25 :fo-max 50) + (-> this root-override trans) + ) ) - (case (-> (if (-> obj entity) - (-> obj entity extra level) + (case (-> (if (-> this entity) + (-> this entity extra level) (-> *level* level-default) ) name ) (('darkcave) - (initialize-skeleton obj *cavespatula-darkcave-sg* '()) + (initialize-skeleton this *cavespatula-darkcave-sg* '()) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) ) (else - (initialize-skeleton obj *cavespatula-sg* '()) + (initialize-skeleton this *cavespatula-sg* '()) (ja-channel-push! 1 0) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) ) ) - (logior! (-> obj skel status) (janim-status inited)) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) + (logior! (-> this skel status) (janim-status inited)) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) -1 32768.0 @@ -850,12 +855,12 @@ ) ;; definition for method 3 of type cavespatulatwo -(defmethod inspect cavespatulatwo ((obj cavespatulatwo)) +(defmethod inspect cavespatulatwo ((this cavespatulatwo)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + this ) ;; failed to figure out what this is: @@ -885,9 +890,9 @@ ;; definition for method 11 of type cavespatulatwo ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavespatulatwo ((obj cavespatulatwo) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! cavespatulatwo ((this cavespatulatwo) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -905,25 +910,29 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *cavespatulatwo-sg* '()) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj skel status) (janim-status inited)) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *cavespatulatwo-sg* '()) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this skel status) (janim-status inited)) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "spatula" :fo-min 25 :fo-max 50) (-> obj root-override trans)) + (set! (-> this sound) (new + 'process + 'ambient-sound + (static-sound-spec "spatula" :fo-min 25 :fo-max 50) + (-> this root-override trans) + ) ) (go cavespatulatwo-idle) (none) @@ -960,20 +969,20 @@ ) ;; definition for method 3 of type caveelevator -(defmethod inspect caveelevator ((obj caveelevator)) +(defmethod inspect caveelevator ((this caveelevator)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Telev-mode: ~D~%" (-> obj elev-mode)) - (format #t "~T~Telev-type: ~D~%" (-> obj elev-type)) - (format #t "~T~Tprev-frame-num: ~f~%" (-> obj prev-frame-num)) - (format #t "~T~Tlast-update-bounce-time: ~D~%" (-> obj last-update-bounce-time)) - (format #t "~T~Torig-trans: #~%" (-> obj orig-trans)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tsmush: #~%" (-> obj smush)) - (format #t "~T~Tanim[2] @ #x~X~%" (-> obj anim)) - (format #t "~T~Twheel-ry-mat: #~%" (-> obj wheel-ry-mat)) - obj + (format #t "~T~Telev-mode: ~D~%" (-> this elev-mode)) + (format #t "~T~Telev-type: ~D~%" (-> this elev-type)) + (format #t "~T~Tprev-frame-num: ~f~%" (-> this prev-frame-num)) + (format #t "~T~Tlast-update-bounce-time: ~D~%" (-> this last-update-bounce-time)) + (format #t "~T~Torig-trans: #~%" (-> this orig-trans)) + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tsmush: #~%" (-> this smush)) + (format #t "~T~Tanim[2] @ #x~X~%" (-> this anim)) + (format #t "~T~Twheel-ry-mat: #~%" (-> this wheel-ry-mat)) + this ) ;; failed to figure out what this is: @@ -1004,15 +1013,15 @@ ;; definition for method 20 of type caveelevator ;; INFO: Used lq/sq -(defmethod caveelevator-method-20 caveelevator ((obj caveelevator)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-update-bounce-time)) - (set! (-> obj last-update-bounce-time) v1-1) - (when (!= (-> obj smush amp) 0.0) +(defmethod caveelevator-method-20 caveelevator ((this caveelevator)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-update-bounce-time)) + (set! (-> this last-update-bounce-time) v1-1) + (when (!= (-> this smush amp) 0.0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj orig-trans quad)) - (+! (-> s5-0 y) (* 819.2 (update! (-> obj smush)))) - (move-to-point! (-> obj root-override) s5-0) + (set! (-> s5-0 quad) (-> this orig-trans quad)) + (+! (-> s5-0 y) (* 819.2 (update! (-> this smush)))) + (move-to-point! (-> this root-override) s5-0) ) ) ) @@ -1021,12 +1030,12 @@ ) ;; definition for method 21 of type caveelevator -(defmethod caveelevator-method-21 caveelevator ((obj caveelevator)) +(defmethod caveelevator-method-21 caveelevator ((this caveelevator)) (let ((s5-0 (new 'stack-no-clear 'vector)) - (gp-0 (-> obj draw bounds)) + (gp-0 (-> this draw bounds)) ) - (vector<-cspace! s5-0 (-> obj node-list data 3)) - (vector-! gp-0 s5-0 (-> obj root-override trans)) + (vector<-cspace! s5-0 (-> this node-list data 3)) + (vector-! gp-0 s5-0 (-> this root-override trans)) (set! (-> gp-0 w) 17408.0) ) ) @@ -1149,17 +1158,17 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (cond ((zero? (-> self root-override riders num-riders)) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go caveelevator-one-way-travel-to-start) ) ) (else - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) ) (rider-trans) @@ -1238,12 +1247,12 @@ ;; definition for method 11 of type caveelevator ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! caveelevator ((obj caveelevator) (arg0 entity-actor)) +(defmethod init-from-entity! caveelevator ((this caveelevator) (arg0 entity-actor)) (local-vars (v1-43 int) (sv-16 res-tag)) - (set! (-> obj prev-frame-num) 10000.0) - (set! (-> obj last-update-bounce-time) 0) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> this prev-frame-num) 10000.0) + (set! (-> this last-update-bounce-time) 0) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1261,61 +1270,61 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *caveelevator-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj skel postbind-function) caveelevator-joint-callback) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *caveelevator-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this skel postbind-function) caveelevator-joint-callback) (set! sv-16 (new 'static 'res-tag)) (let ((v1-28 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-28 - (+! (-> obj root-override trans x) (-> v1-28 0)) - (+! (-> obj root-override trans y) (-> v1-28 1)) - (+! (-> obj root-override trans z) (-> v1-28 2)) + (+! (-> this root-override trans x) (-> v1-28 0)) + (+! (-> this root-override trans y) (-> v1-28 1)) + (+! (-> this root-override trans z) (-> v1-28 2)) ) ) - (set! (-> obj orig-trans quad) (-> obj root-override trans quad)) - (let ((f0-13 (res-lump-float (-> obj entity) 'rotoffset))) + (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (let ((f0-13 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-13 0.0) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-13) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-13) ) ) - (let ((f0-14 (quaternion-y-angle (-> obj root-override quat)))) - (matrix-rotate-y! (-> obj wheel-ry-mat) f0-14) + (let ((f0-14 (quaternion-y-angle (-> this root-override quat)))) + (matrix-rotate-y! (-> this wheel-ry-mat) f0-14) ) - (set-zero! (-> obj smush)) + (set-zero! (-> this smush)) (let ((s5-1 (res-lump-value arg0 'mode uint128))) 0 - (set! (-> obj elev-type) (the-as int s5-1)) + (set! (-> this elev-type) (the-as int s5-1)) (let ((v1-42 s5-1)) (cond ((zero? v1-42) (set! v1-43 0) - (set! (-> obj anim 0) 2) + (set! (-> this anim 0) 2) ) ((= (the-as uint v1-42) 1) (set! v1-43 1) - (set! (-> obj anim 0) 3) - (set! (-> obj anim 1) 4) + (set! (-> this anim 0) 3) + (set! (-> this anim 1) 4) ) ((= (the-as uint v1-42) 2) (set! v1-43 0) - (set! (-> obj anim 0) 5) + (set! (-> this anim 0) 5) ) (else (set! v1-43 0) - (set! (-> obj anim 0) 2) - (set! (-> obj elev-type) (the-as int s5-1)) + (set! (-> this anim 0) 2) + (set! (-> this elev-type) (the-as int s5-1)) ) ) ) - (set! (-> obj elev-mode) (the-as uint v1-43)) + (set! (-> this elev-mode) (the-as uint v1-43)) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data (-> obj anim 0))) + (the-as art-joint-anim (-> this draw art-group data (-> this anim 0))) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) @@ -1323,16 +1332,16 @@ (if (= (the-as uint s5-1) 1) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-caveelevator-callback) 3 8192.0 ) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) 3 8192.0 @@ -1340,10 +1349,10 @@ ) ) (transform-post) - (let ((v1-55 (-> obj elev-mode))) + (let ((v1-55 (-> this elev-mode))) (cond ((zero? v1-55) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) (go caveelevator-cycle-active) ) ((= v1-55 1) diff --git a/test/decompiler/reference/jak1/levels/maincave/maincave-part_REF.gc b/test/decompiler/reference/jak1/levels/maincave/maincave-part_REF.gc index 0eb35ab8ee..e8f19c84b4 100644 --- a/test/decompiler/reference/jak1/levels/maincave/maincave-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/maincave-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type maincave-part -(defmethod inspect maincave-part ((obj maincave-part)) +(defmethod inspect maincave-part ((this maincave-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type darkcave-part @@ -28,11 +28,11 @@ ) ;; definition for method 3 of type darkcave-part -(defmethod inspect darkcave-part ((obj darkcave-part)) +(defmethod inspect darkcave-part ((this darkcave-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc index 823dd7d575..643a3d581a 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-egg_REF.gc @@ -33,19 +33,19 @@ ) ;; definition for method 3 of type mother-spider-egg -(defmethod inspect mother-spider-egg ((obj mother-spider-egg)) +(defmethod inspect mother-spider-egg ((this mother-spider-egg)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tfalling-start-time: ~D~%" (-> obj falling-start-time)) - (format #t "~T~Tfall-dest: #~%" (-> obj fall-dest)) - (format #t "~T~Tfall-dest-normal: #~%" (-> obj fall-dest-normal)) - (format #t "~T~Tbroken-look: #~%" (-> obj broken-look)) - (format #t "~T~Ttraj: #~%" (-> obj traj)) - (format #t "~T~Tshadow-pos: #~%" (-> obj shadow-pos)) - obj + (format #t "~T~Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tfalling-start-time: ~D~%" (-> this falling-start-time)) + (format #t "~T~Tfall-dest: #~%" (-> this fall-dest)) + (format #t "~T~Tfall-dest-normal: #~%" (-> this fall-dest-normal)) + (format #t "~T~Tbroken-look: #~%" (-> this broken-look)) + (format #t "~T~Ttraj: #~%" (-> this traj)) + (format #t "~T~Tshadow-pos: #~%" (-> this shadow-pos)) + this ) ;; failed to figure out what this is: @@ -175,17 +175,17 @@ ;; definition for method 21 of type mother-spider-egg ;; INFO: Used lq/sq -(defmethod draw-egg-shadow mother-spider-egg ((obj mother-spider-egg) (arg0 vector) (arg1 symbol)) +(defmethod draw-egg-shadow mother-spider-egg ((this mother-spider-egg) (arg0 vector) (arg1 symbol)) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result)) (a1-1 (new 'stack-no-clear 'vector)) (a2-1 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> obj root-override trans quad)) + (set! (-> a1-1 quad) (-> this root-override trans quad)) (+! (-> a1-1 y) 1228.8) (set-vector! a2-1 0.0 -61440.0 0.0 1.0) (cond @@ -195,28 +195,28 @@ a2-1 7372.8 (collide-kind background) - obj + this s5-0 (new 'static 'pat-surface :noentity #x1) ) 0.0 ) - (let ((v1-11 (-> obj draw shadow-ctrl))) + (let ((v1-11 (-> this draw shadow-ctrl))) (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (set! (-> v1-14 settings bot-plane w) (- (+ -4096.0 (-> s5-0 intersect y)))) ) 0 - (let ((v1-17 (-> obj draw shadow-ctrl))) + (let ((v1-17 (-> this draw shadow-ctrl))) (set! (-> v1-17 settings top-plane w) (- (+ 6144.0 (-> s5-0 intersect y)))) ) 0 (return #t) ) (else - (let ((v1-22 (-> obj draw shadow-ctrl))) + (let ((v1-22 (-> this draw shadow-ctrl))) (logior! (-> v1-22 settings flags) (shadow-flags disable-draw)) ) 0 @@ -225,7 +225,7 @@ ) ) (else - (let ((v1-25 (-> obj draw shadow-ctrl))) + (let ((v1-25 (-> this draw shadow-ctrl))) (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 @@ -244,13 +244,10 @@ ) ) :enter (behavior () - (set! (-> self falling-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self falling-start-time)) ) :trans (behavior () - (let ((f30-0 - (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) - ) - ) + (let ((f30-0 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) (let ((f28-0 (/ f30-0 (-> self traj time)))) (eval-position! (-> self traj) f30-0 (-> self root-override trans)) (let ((f0-3 (lerp 0.3 0.4 f28-0))) @@ -297,13 +294,13 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (not (draw-egg-shadow self (-> self shadow-pos) #t)) (set! (-> self shadow-pos quad) (-> self fall-dest quad)) ) ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (go mother-spider-egg-hatch) ) (draw-egg-shadow self (-> self shadow-pos) #f) @@ -428,10 +425,7 @@ ;; failed to figure out what this is: (defstate mother-spider-egg-die-while-falling (mother-spider-egg) :trans (behavior () - (let ((f0-2 - (fmin (the float (- (-> *display* base-frame-counter) (-> self falling-start-time))) (-> self traj time)) - ) - ) + (let ((f0-2 (fmin (the float (- (current-time) (-> self falling-start-time))) (-> self traj time)))) (eval-position! (-> self traj) f0-2 (-> self root-override trans)) ) ) @@ -489,7 +483,7 @@ (defbehavior mother-spider-egg-init-by-other mother-spider-egg ((arg0 entity-actor) (arg1 vector) (arg2 vector) (arg3 vector)) (set! (-> self entity) arg0) (set! (-> self anim-speed) (rand-vu-float-range 0.8 1.2)) - (set! (-> self falling-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self falling-start-time)) (set! (-> self fall-dest quad) (-> arg2 quad)) (set! (-> self fall-dest-normal quad) (-> arg3 quad)) (let ((s4-1 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-h_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-h_REF.gc index 7dceed2b65..bb7ce43ed0 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-h_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-h_REF.gc @@ -18,15 +18,15 @@ ) ;; definition for method 3 of type mother-spider-leg -(defmethod inspect mother-spider-leg ((obj mother-spider-leg)) +(defmethod inspect mother-spider-leg ((this mother-spider-leg)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tgravity: ~f~%" (-> obj gravity)) - (format #t "~T~Ttransv: #~%" (-> obj transv)) - (format #t "~T~Tfacing-rot: #~%" (-> obj facing-rot)) - (format #t "~T~Tfacing-rotv: #~%" (-> obj facing-rotv)) - obj + (format #t "~T~Tgravity: ~f~%" (-> this gravity)) + (format #t "~T~Ttransv: #~%" (-> this transv)) + (format #t "~T~Tfacing-rot: #~%" (-> this facing-rot)) + (format #t "~T~Tfacing-rotv: #~%" (-> this facing-rotv)) + this ) ;; definition of type mother-spider-thread @@ -42,12 +42,12 @@ ) ;; definition for method 3 of type mother-spider-thread -(defmethod inspect mother-spider-thread ((obj mother-spider-thread)) - (format #t "[~8x] ~A~%" obj 'mother-spider-thread) - (format #t "~Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~Ttrans-u: ~f~%" (-> obj trans-u)) - (format #t "~Tswing-arc-u: ~f~%" (-> obj swing-arc-u)) - obj +(defmethod inspect mother-spider-thread ((this mother-spider-thread)) + (format #t "[~8x] ~A~%" this 'mother-spider-thread) + (format #t "~Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~Ttrans-u: ~f~%" (-> this trans-u)) + (format #t "~Tswing-arc-u: ~f~%" (-> this swing-arc-u)) + this ) ;; definition of type mother-spider-leg-info @@ -62,12 +62,12 @@ ) ;; definition for method 3 of type mother-spider-leg-info -(defmethod inspect mother-spider-leg-info ((obj mother-spider-leg-info)) - (format #t "[~8x] ~A~%" obj 'mother-spider-leg-info) - (format #t "~Tjoint-index0: ~D~%" (-> obj joint-index0)) - (format #t "~Tjoint-index1: ~D~%" (-> obj joint-index1)) - (format #t "~Tcprim-index: ~D~%" (-> obj cprim-index)) - obj +(defmethod inspect mother-spider-leg-info ((this mother-spider-leg-info)) + (format #t "[~8x] ~A~%" this 'mother-spider-leg-info) + (format #t "~Tjoint-index0: ~D~%" (-> this joint-index0)) + (format #t "~Tjoint-index1: ~D~%" (-> this joint-index1)) + (format #t "~Tcprim-index: ~D~%" (-> this cprim-index)) + this ) ;; definition of type mother-spider-history @@ -80,10 +80,10 @@ ) ;; definition for method 3 of type mother-spider-history -(defmethod inspect mother-spider-history ((obj mother-spider-history)) - (format #t "[~8x] ~A~%" obj 'mother-spider-history) - (format #t "~Ttrans: #~%" (-> obj trans)) - obj +(defmethod inspect mother-spider-history ((this mother-spider-history)) + (format #t "[~8x] ~A~%" this 'mother-spider-history) + (format #t "~Ttrans: #~%" (-> this trans)) + this ) ;; definition of type mother-spider-history-array @@ -96,12 +96,12 @@ ) ;; definition for method 3 of type mother-spider-history-array -(defmethod inspect mother-spider-history-array ((obj mother-spider-history-array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[0] @ #x~X~%" (-> obj data)) - obj +(defmethod inspect mother-spider-history-array ((this mother-spider-history-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[0] @ #x~X~%" (-> this data)) + this ) ;; failed to figure out what this is: @@ -189,53 +189,53 @@ ) ;; definition for method 3 of type mother-spider -(defmethod inspect mother-spider ((obj mother-spider)) +(defmethod inspect mother-spider ((this mother-spider)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmode: ~D~%" (-> obj mode)) - (format #t "~T~Tdamage: ~D~%" (-> obj damage)) - (format #t "~T~Tbaby-count: ~D~%" (-> obj baby-count)) - (format #t "~T~Tmax-baby-count: ~D~%" (-> obj max-baby-count)) - (format #t "~T~Tbirthing-counter: ~D~%" (-> obj birthing-counter)) - (format #t "~T~Tspit-counter: ~D~%" (-> obj spit-counter)) - (format #t "~T~Tleg-socket-part-mask: ~D~%" (-> obj leg-socket-part-mask)) - (format #t "~T~Tdist-from-anchor: ~f~%" (-> obj dist-from-anchor)) - (format #t "~T~Ttarg-dist-from-anchor: ~f~%" (-> obj targ-dist-from-anchor)) - (format #t "~T~Tidle-dist-from-anchor: ~f~%" (-> obj idle-dist-from-anchor)) - (format #t "~T~Tplayer-sticky-dist-from-anchor: ~f~%" (-> obj player-sticky-dist-from-anchor)) - (format #t "~T~Tmax-dist-from-anchor: ~f~%" (-> obj max-dist-from-anchor)) - (format #t "~T~Tactivate-xz-dist: ~f~%" (-> obj activate-xz-dist)) - (format #t "~T~Tdeactivate-xz-dist: ~f~%" (-> obj deactivate-xz-dist)) - (format #t "~T~Tmax-spit-xz-dist: ~f~%" (-> obj max-spit-xz-dist)) - (format #t "~T~Tmax-swing-radius: ~f~%" (-> obj max-swing-radius)) - (format #t "~T~Tspin-vel: ~f~%" (-> obj spin-vel)) - (format #t "~T~Tthread-speed: ~f~%" (-> obj thread-speed)) - (format #t "~T~Tthread-vel: ~f~%" (-> obj thread-vel)) - (format #t "~T~Thistory: ~A~%" (-> obj history)) - (format #t "~T~Thistory-len: ~D~%" (-> obj history-len)) - (format #t "~T~Thistory-next-index: ~D~%" (-> obj history-next-index)) - (format #t "~T~Thit?: ~A~%" (-> obj hit?)) - (format #t "~T~Tgoing-up?: ~A~%" (-> obj going-up?)) - (format #t "~T~Tcheck-z-thresh?: ~A~%" (-> obj check-z-thresh?)) - (format #t "~T~Tactivate-z-thresh: ~f~%" (-> obj activate-z-thresh)) - (format #t "~T~Tdeactivate-z-thresh: ~f~%" (-> obj deactivate-z-thresh)) - (format #t "~T~Tspawned-time: ~D~%" (-> obj spawned-time)) - (format #t "~T~Tlast-update-time: ~D~%" (-> obj last-update-time)) - (format #t "~T~Tspin-time: ~D~%" (-> obj spin-time)) - (format #t "~T~Tlast-spit-time: ~D~%" (-> obj last-spit-time)) - (format #t "~T~Tlast-player-in-air-time: ~D~%" (-> obj last-player-in-air-time)) - (format #t "~T~Tstarted-birthing-time: ~D~%" (-> obj started-birthing-time)) - (format #t "~T~Tneck: ~A~%" (-> obj neck)) - (format #t "~T~Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - (format #t "~T~Tleg-socket-part-time[6] @ #x~X~%" (-> obj leg-socket-part-time)) - (format #t "~T~Torient-rot: #~%" (-> obj orient-rot)) - (format #t "~T~Tanchor-trans: #~%" (-> obj anchor-trans)) - (format #t "~T~Tthread-min-trans: #~%" (-> obj thread-min-trans)) - (format #t "~T~Tswing-pos: #~%" (-> obj swing-pos)) - (format #t "~T~Tswing-base-pos: #~%" (-> obj swing-base-pos)) - (format #t "~T~Tswing-vel: #~%" (-> obj swing-vel)) - obj + (format #t "~T~Tmode: ~D~%" (-> this mode)) + (format #t "~T~Tdamage: ~D~%" (-> this damage)) + (format #t "~T~Tbaby-count: ~D~%" (-> this baby-count)) + (format #t "~T~Tmax-baby-count: ~D~%" (-> this max-baby-count)) + (format #t "~T~Tbirthing-counter: ~D~%" (-> this birthing-counter)) + (format #t "~T~Tspit-counter: ~D~%" (-> this spit-counter)) + (format #t "~T~Tleg-socket-part-mask: ~D~%" (-> this leg-socket-part-mask)) + (format #t "~T~Tdist-from-anchor: ~f~%" (-> this dist-from-anchor)) + (format #t "~T~Ttarg-dist-from-anchor: ~f~%" (-> this targ-dist-from-anchor)) + (format #t "~T~Tidle-dist-from-anchor: ~f~%" (-> this idle-dist-from-anchor)) + (format #t "~T~Tplayer-sticky-dist-from-anchor: ~f~%" (-> this player-sticky-dist-from-anchor)) + (format #t "~T~Tmax-dist-from-anchor: ~f~%" (-> this max-dist-from-anchor)) + (format #t "~T~Tactivate-xz-dist: ~f~%" (-> this activate-xz-dist)) + (format #t "~T~Tdeactivate-xz-dist: ~f~%" (-> this deactivate-xz-dist)) + (format #t "~T~Tmax-spit-xz-dist: ~f~%" (-> this max-spit-xz-dist)) + (format #t "~T~Tmax-swing-radius: ~f~%" (-> this max-swing-radius)) + (format #t "~T~Tspin-vel: ~f~%" (-> this spin-vel)) + (format #t "~T~Tthread-speed: ~f~%" (-> this thread-speed)) + (format #t "~T~Tthread-vel: ~f~%" (-> this thread-vel)) + (format #t "~T~Thistory: ~A~%" (-> this history)) + (format #t "~T~Thistory-len: ~D~%" (-> this history-len)) + (format #t "~T~Thistory-next-index: ~D~%" (-> this history-next-index)) + (format #t "~T~Thit?: ~A~%" (-> this hit?)) + (format #t "~T~Tgoing-up?: ~A~%" (-> this going-up?)) + (format #t "~T~Tcheck-z-thresh?: ~A~%" (-> this check-z-thresh?)) + (format #t "~T~Tactivate-z-thresh: ~f~%" (-> this activate-z-thresh)) + (format #t "~T~Tdeactivate-z-thresh: ~f~%" (-> this deactivate-z-thresh)) + (format #t "~T~Tspawned-time: ~D~%" (-> this spawned-time)) + (format #t "~T~Tlast-update-time: ~D~%" (-> this last-update-time)) + (format #t "~T~Tspin-time: ~D~%" (-> this spin-time)) + (format #t "~T~Tlast-spit-time: ~D~%" (-> this last-spit-time)) + (format #t "~T~Tlast-player-in-air-time: ~D~%" (-> this last-player-in-air-time)) + (format #t "~T~Tstarted-birthing-time: ~D~%" (-> this started-birthing-time)) + (format #t "~T~Tneck: ~A~%" (-> this neck)) + (format #t "~T~Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + (format #t "~T~Tleg-socket-part-time[6] @ #x~X~%" (-> this leg-socket-part-time)) + (format #t "~T~Torient-rot: #~%" (-> this orient-rot)) + (format #t "~T~Tanchor-trans: #~%" (-> this anchor-trans)) + (format #t "~T~Tthread-min-trans: #~%" (-> this thread-min-trans)) + (format #t "~T~Tswing-pos: #~%" (-> this swing-pos)) + (format #t "~T~Tswing-base-pos: #~%" (-> this swing-base-pos)) + (format #t "~T~Tswing-vel: #~%" (-> this swing-vel)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc index dbff343173..b48a0f8278 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider-proj_REF.gc @@ -13,12 +13,12 @@ ) ;; definition for method 3 of type mother-spider-proj -(defmethod inspect mother-spider-proj ((obj mother-spider-proj)) +(defmethod inspect mother-spider-proj ((this mother-spider-proj)) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tfacing-dir: #~%" (-> obj facing-dir)) - obj + (format #t "~T~Tfacing-dir: #~%" (-> this facing-dir)) + this ) ;; failed to figure out what this is: @@ -239,13 +239,13 @@ ) ;; definition for method 24 of type mother-spider-proj -(defmethod projectile-method-24 mother-spider-proj ((obj mother-spider-proj)) +(defmethod projectile-method-24 mother-spider-proj ((this mother-spider-proj)) (with-pp - (spawn (-> obj part) (the-as vector (-> obj root-override root-prim prim-core))) + (spawn (-> this part) (the-as vector (-> this root-override root-prim prim-core))) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) - (set! (-> s5-0 id) (-> obj sound-id)) - (let ((a1-1 (-> obj root-override trans))) + (set! (-> s5-0 id) (-> this sound-id)) + (let ((a1-1 (-> this root-override trans))) (let ((s4-0 pp)) (when (= a1-1 #t) (if (and s4-0 (type-type? (-> s4-0 type) process-drawable) (nonzero? (-> (the-as process-drawable s4-0) root))) @@ -259,9 +259,9 @@ (set! (-> s5-0 parms mask) (sound-mask trans)) (-> s5-0 id) ) - (let ((f0-5 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (-> *display* base-frame-counter) 75))))))))) + (let ((f0-5 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (current-time) 75))))))))) (find-ground-and-draw-shadow - (-> obj root-override trans) + (-> this root-override trans) (the-as vector #f) f0-5 (collide-kind background) @@ -293,7 +293,7 @@ s3-2 s5-0 s4-0 - (* (-> arg0 max-turn) (-> *display* seconds-per-frame)) + (* (-> arg0 max-turn) (seconds-per-frame)) (-> arg0 tween) ) (vector-matrix*! s5-0 s5-0 s3-2) @@ -308,8 +308,8 @@ ;; definition for method 26 of type mother-spider-proj ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-26 mother-spider-proj ((obj mother-spider-proj)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod projectile-method-26 mother-spider-proj ((this mother-spider-proj)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) (set! (-> s5-0 no-reaction) @@ -329,12 +329,12 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (logclear! (-> obj mask) (process-mask enemy)) - (logclear! (-> obj mask) (process-mask crate)) - (logclear! (-> obj mask) (process-mask attackable)) - (logior! (-> obj mask) (process-mask projectile)) + (logclear! (-> this mask) (process-mask enemy)) + (logclear! (-> this mask) (process-mask crate)) + (logclear! (-> this mask) (process-mask attackable)) + (logior! (-> this mask) (process-mask projectile)) 0 (none) ) @@ -342,18 +342,18 @@ ;; definition for method 27 of type mother-spider-proj ;; INFO: Used lq/sq ;; INFO: Return type mismatch sound-id vs none. -(defmethod projectile-method-27 mother-spider-proj ((obj mother-spider-proj)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 326) obj)) - (set! (-> obj max-speed) 32768.0) - (set! (-> obj update-velocity) mother-spider-proj-update-velocity) - (set! (-> obj max-turn) 5916.4443) - (set! (-> obj tween) 0.02) - (set! (-> obj attack-mode) 'mother-spider-proj) - (set! (-> obj timeout) (seconds 4)) - (set! (-> obj target quad) (-> (target-pos 0) quad)) - (+! (-> obj target y) 4915.2) - (set! (-> obj target-base quad) (-> obj target quad)) - (set! (-> obj sound-id) (sound-play "mother-track")) +(defmethod projectile-method-27 mother-spider-proj ((this mother-spider-proj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 326) this)) + (set! (-> this max-speed) 32768.0) + (set! (-> this update-velocity) mother-spider-proj-update-velocity) + (set! (-> this max-turn) 5916.4443) + (set! (-> this tween) 0.02) + (set! (-> this attack-mode) 'mother-spider-proj) + (set! (-> this timeout) (seconds 4)) + (set! (-> this target quad) (-> (target-pos 0) quad)) + (+! (-> this target y) 4915.2) + (set! (-> this target-base quad) (-> this target quad)) + (set! (-> this sound-id) (sound-play "mother-track")) (sound-play "mother-fire") (none) ) @@ -361,17 +361,17 @@ ;; definition for method 28 of type mother-spider-proj ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs none. -(defmethod projectile-method-28 mother-spider-proj ((obj mother-spider-proj)) +(defmethod projectile-method-28 mother-spider-proj ((this mother-spider-proj)) (when (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) ) - (let ((gp-0 (-> obj target))) + (let ((gp-0 (-> this target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (+! (-> gp-0 y) 4915.2) - (let ((f0-2 (vector-vector-distance gp-0 (-> obj root-override trans))) + (let ((f0-2 (vector-vector-distance gp-0 (-> this root-override trans))) (a2-0 (new 'stack-no-clear 'vector)) ) (if (>= 0.0 f0-2) @@ -379,8 +379,8 @@ ) (set! (-> a2-0 quad) (-> *target* control transv quad)) (set! (-> a2-0 y) 0.0) - (let ((f0-3 (/ f0-2 (* 32768.0 (-> *display* seconds-per-frame))))) - (vector+float*! gp-0 gp-0 a2-0 (* f0-3 (-> *display* seconds-per-frame))) + (let ((f0-3 (/ f0-2 (* 32768.0 (seconds-per-frame))))) + (vector+float*! gp-0 gp-0 a2-0 (* f0-3 (seconds-per-frame))) ) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc index b3ab633633..ab4d5b7856 100644 --- a/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/mother-spider_REF.gc @@ -84,13 +84,13 @@ (vf2 :class vf) ) (init-vf0-vector) - (+! (-> self transv y) (* (-> self gravity) (-> *display* seconds-per-frame))) + (+! (-> self transv y) (* (-> self gravity) (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'collide-tri-result)) (a2-0 (new 'stack-no-clear 'vector)) ) (let ((v1-1 a2-0)) (.lvf vf1 (&-> (-> self transv) quad)) - (let ((f0-2 (-> *display* seconds-per-frame))) + (let ((f0-2 (seconds-per-frame))) (.mov at-0 f0-2) ) (.mov vf2 at-0) @@ -128,12 +128,12 @@ ) ) (vector-v+! (-> self root trans) (-> self root trans) (-> self transv)) - (+! (-> self facing-rot x) (* (-> self facing-rotv x) (-> *display* seconds-per-frame))) + (+! (-> self facing-rot x) (* (-> self facing-rotv x) (seconds-per-frame))) (set! (-> self facing-rot z) - (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (-> *display* seconds-per-frame))) + (deg-seek (-> self facing-rot z) 16384.0 (* (-> self facing-rotv z) (seconds-per-frame))) ) (quaternion-zxy! (-> self root quat) (-> self facing-rot)) - (seek! (-> self root scale x) 0.0 (* 0.5 (-> *display* seconds-per-frame))) + (seek! (-> self root scale x) 0.0 (* 0.5 (seconds-per-frame))) (set! (-> self root scale y) (-> self root scale x)) (set! (-> self root scale z) (-> self root scale x)) ) @@ -349,31 +349,31 @@ ) ;; definition for method 30 of type mother-spider -(defmethod spawn-child mother-spider ((obj mother-spider) (arg0 vector) (arg1 vector) (arg2 symbol)) +(defmethod spawn-child mother-spider ((this mother-spider) (arg0 vector) (arg1 vector) (arg2 symbol)) (let ((s3-0 (new 'stack-no-clear 'baby-spider-spawn-params))) (init! s3-0 arg2 #f #t #f 7 1 'untrigger) (set-delay! s3-0 (seconds 9)) - (process-spawn baby-spider obj arg0 arg1 s3-0 :to obj) + (process-spawn baby-spider this arg0 arg1 s3-0 :to this) ) - (let ((v0-5 (+ (-> obj baby-count) 1))) - (set! (-> obj baby-count) v0-5) + (let ((v0-5 (+ (-> this baby-count) 1))) + (set! (-> this baby-count) v0-5) v0-5 ) ) ;; definition for method 31 of type mother-spider -(defmethod is-player-stuck? mother-spider ((obj mother-spider)) +(defmethod is-player-stuck? mother-spider ((this mother-spider)) (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) (surface-flags jump)) (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) ) (let* ((v1-10 (target-pos 0)) - (f0-1 (- (-> obj anchor-trans y) (-> v1-10 y))) - (f1-2 (- (-> obj player-sticky-dist-from-anchor) f0-1)) + (f0-1 (- (-> this anchor-trans y) (-> v1-10 y))) + (f1-2 (- (-> this player-sticky-dist-from-anchor) f0-1)) ) (when (or (< 8192.0 f1-2) (< f1-2 -8192.0)) - (set! (-> obj player-sticky-dist-from-anchor) f0-1) + (set! (-> this player-sticky-dist-from-anchor) f0-1) (return #t) ) ) @@ -383,30 +383,30 @@ ;; definition for method 27 of type mother-spider ;; INFO: Return type mismatch symbol vs none. -(defmethod mother-spider-method-27 mother-spider ((obj mother-spider)) +(defmethod mother-spider-method-27 mother-spider ((this mother-spider)) (none) ) ;; definition for method 28 of type mother-spider ;; INFO: Return type mismatch int vs none. -(defmethod mother-spider-method-28 mother-spider ((obj mother-spider)) +(defmethod mother-spider-method-28 mother-spider ((this mother-spider)) 0 (none) ) ;; definition for method 24 of type mother-spider ;; INFO: Used lq/sq -(defmethod shadow-handler mother-spider ((obj mother-spider)) +(defmethod shadow-handler mother-spider ((this mother-spider)) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result)) (a1-0 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> obj root-override trans quad)) + (set! (-> a1-0 quad) (-> this root-override trans quad)) (set-vector! a2-0 0.0 -81920.0 0.0 1.0) (+! (-> a1-0 y) -8192.0) (cond @@ -416,32 +416,32 @@ a2-0 8192.0 (collide-kind background) - obj + this s5-0 (new 'static 'pat-surface :noentity #x1) ) 0.0 ) - (let ((v1-11 (-> obj draw shadow-ctrl))) + (let ((v1-11 (-> this draw shadow-ctrl))) (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (set! (-> v1-14 settings bot-plane w) (- (+ -6144.0 (-> s5-0 intersect y)))) ) 0 - (let ((v1-17 (-> obj draw shadow-ctrl))) + (let ((v1-17 (-> this draw shadow-ctrl))) (set! (-> v1-17 settings top-plane w) (- (+ 6144.0 (-> s5-0 intersect y)))) ) 0 - (let* ((f3-0 (vector-vector-distance (-> s5-0 intersect) (-> obj root-override trans))) + (let* ((f3-0 (vector-vector-distance (-> s5-0 intersect) (-> this root-override trans))) (f0-14 (* 0.000030517578 (fmin 32768.0 (fmax 0.0 (+ -57344.0 f3-0))))) ) - (set! (-> obj draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-14)) + (set! (-> this draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-14)) ) ) (else - (let ((v1-23 (-> obj draw shadow-ctrl))) + (let ((v1-23 (-> this draw shadow-ctrl))) (logior! (-> v1-23 settings flags) (shadow-flags disable-draw)) ) 0 @@ -450,7 +450,7 @@ ) ) (else - (let ((v1-25 (-> obj draw shadow-ctrl))) + (let ((v1-25 (-> this draw shadow-ctrl))) (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 @@ -459,16 +459,16 @@ ) ;; definition for method 26 of type mother-spider -(defmethod grab-player? mother-spider ((obj mother-spider)) +(defmethod grab-player? mother-spider ((this mother-spider)) (when *target* (let ((s5-0 (target-pos 0))) - (when (and (>= 40960.0 (- (-> obj thread-min-trans y) (-> s5-0 y))) - (>= (-> obj activate-xz-dist) (vector-vector-xz-distance (-> obj thread-min-trans) s5-0)) + (when (and (>= 40960.0 (- (-> this thread-min-trans y) (-> s5-0 y))) + (>= (-> this activate-xz-dist) (vector-vector-xz-distance (-> this thread-min-trans) s5-0)) ) (cond - ((-> obj check-z-thresh?) - (let ((f0-3 (- (-> s5-0 z) (-> obj root-override trans z)))) - (if (>= (-> obj activate-z-thresh) f0-3) + ((-> this check-z-thresh?) + (let ((f0-3 (- (-> s5-0 z) (-> this root-override trans z)))) + (if (>= (-> this activate-z-thresh) f0-3) (return #t) ) ) @@ -484,18 +484,18 @@ ) ;; definition for method 25 of type mother-spider -(defmethod letgo-player? mother-spider ((obj mother-spider)) +(defmethod letgo-player? mother-spider ((this mother-spider)) (if (not *target*) (return #t) ) (let ((a1-0 (target-pos 0))) - (when (-> obj check-z-thresh?) - (if (>= (- (-> a1-0 z) (-> obj root-override trans z)) (-> obj deactivate-z-thresh)) + (when (-> this check-z-thresh?) + (if (>= (- (-> a1-0 z) (-> this root-override trans z)) (-> this deactivate-z-thresh)) (return #t) ) ) - (if (or (>= (- (-> obj thread-min-trans y) (-> a1-0 y)) 49152.0) - (>= (vector-vector-xz-distance (-> obj thread-min-trans) a1-0) (-> obj deactivate-xz-dist)) + (if (or (>= (- (-> this thread-min-trans y) (-> a1-0 y)) 49152.0) + (>= (vector-vector-xz-distance (-> this thread-min-trans) a1-0) (-> this deactivate-xz-dist)) ) (return #t) ) @@ -505,19 +505,19 @@ ;; definition for method 21 of type mother-spider ;; INFO: Used lq/sq -(defmethod mother-spider-method-21 mother-spider ((obj mother-spider) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod mother-spider-method-21 mother-spider ((this mother-spider) (arg0 vector) (arg1 float) (arg2 symbol)) (local-vars (sv-112 process) (sv-128 vector) (sv-144 vector)) - (let ((f30-0 (vector-length (-> obj swing-pos)))) + (let ((f30-0 (vector-length (-> this swing-pos)))) (when (< 0.0 f30-0) (let ((s1-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) ) - (vector-normalize-copy! s1-0 (-> obj swing-pos) 1.0) + (vector-normalize-copy! s1-0 (-> this swing-pos) 1.0) (vector-rotate-around-y! s2-0 s1-0 16384.0) (if (< (vector-dot arg0 s2-0) 0.0) (vector-negate! s2-0 s2-0) ) - (let ((f0-4 (fmin 1.0 (/ f30-0 (-> obj max-swing-radius))))) + (let ((f0-4 (fmin 1.0 (/ f30-0 (-> this max-swing-radius))))) (vector-lerp! arg0 arg0 s2-0 f0-4) ) ) @@ -526,28 +526,28 @@ ) (let ((s2-1 (new 'stack-no-clear 'vector))) (vector-float*! s2-1 arg0 arg1) - (vector-flatten! (-> obj swing-vel) (-> obj swing-vel) arg0) - (vector+! (-> obj swing-vel) (-> obj swing-vel) s2-1) + (vector-flatten! (-> this swing-vel) (-> this swing-vel) arg0) + (vector+! (-> this swing-vel) (-> this swing-vel) s2-1) ) - (set! (-> obj swing-vel y) 0.0) + (set! (-> this swing-vel y) 0.0) (when arg2 - (set! (-> obj hit?) #t) - (set! (-> obj spin-vel) 131072.0) - (set! (-> obj spin-time) (-> *display* base-frame-counter)) - (let ((s4-1 (-> obj damage)) - (s3-1 (-> obj root-override root-prim)) + (set! (-> this hit?) #t) + (set! (-> this spin-vel) 131072.0) + (set-time! (-> this spin-time)) + (let ((s4-1 (-> this damage)) + (s3-1 (-> this root-override root-prim)) ) (dotimes (s2-2 2) - (when (< (-> obj damage) 6) - (+! (-> obj damage) 1) - (logior! (-> obj leg-socket-part-mask) (ash 1 s4-1)) - (set! (-> obj leg-socket-part-time s4-1) (-> *display* base-frame-counter)) + (when (< (-> this damage) 6) + (+! (-> this damage) 1) + (logior! (-> this leg-socket-part-mask) (ash 1 s4-1)) + (set-time! (-> this leg-socket-part-time s4-1)) (let ((s1-1 (-> *mother-spider-leg-infos* s4-1))) (let ((s0-0 (new 'stack-no-clear 'vector))) (set! sv-128 (new 'stack-no-clear 'vector)) (set! sv-144 (new 'stack-no-clear 'vector)) - (vector<-cspace! s0-0 (-> obj node-list data (-> s1-1 joint-index0))) - (vector<-cspace! sv-128 (-> obj node-list data (-> s1-1 joint-index1))) + (vector<-cspace! s0-0 (-> this node-list data (-> s1-1 joint-index0))) + (vector<-cspace! sv-128 (-> this node-list data (-> s1-1 joint-index1))) (vector-! sv-128 sv-128 s0-0) (vector-normalize! sv-128 1.0) (vector-lerp! sv-144 sv-128 arg0 0.6) @@ -557,9 +557,9 @@ (set! sv-112 (get-process *default-dead-pool* mother-spider-leg #x4000)) (when sv-112 (let ((t9-15 (method-of-type mother-spider-leg activate))) - (t9-15 (the-as mother-spider-leg sv-112) obj 'mother-spider-leg (the-as pointer #x70004000)) + (t9-15 (the-as mother-spider-leg sv-112) this 'mother-spider-leg (the-as pointer #x70004000)) ) - (run-now-in-process sv-112 mother-spider-leg-init-by-other obj s0-0 sv-128 sv-144) + (run-now-in-process sv-112 mother-spider-leg-init-by-other this s0-0 sv-128 sv-144) (-> sv-112 ppointer) ) ) @@ -574,44 +574,44 @@ ) ) ) - (>= (-> obj damage) 6) + (>= (-> this damage) 6) ) ;; definition for method 29 of type mother-spider -(defmethod mother-spider-method-29 mother-spider ((obj mother-spider) (arg0 symbol) (arg1 symbol)) - (let ((v1-1 (-> *display* base-frame-counter))) - (when (!= v1-1 (-> obj last-update-time)) - (set! (-> obj last-update-time) v1-1) - (mother-spider-method-23 obj) - (let ((f0-1 (fmax 0.0 (- (-> obj dist-from-anchor) (-> obj idle-dist-from-anchor))))) +(defmethod mother-spider-method-29 mother-spider ((this mother-spider) (arg0 symbol) (arg1 symbol)) + (let ((v1-1 (current-time))) + (when (!= v1-1 (-> this last-update-time)) + (set! (-> this last-update-time) v1-1) + (mother-spider-method-23 this) + (let ((f0-1 (fmax 0.0 (- (-> this dist-from-anchor) (-> this idle-dist-from-anchor))))) (cond ((>= f0-1 20480.0) - (vector-identity! (-> obj root-override scale)) + (vector-identity! (-> this root-override scale)) ) (else (let ((f0-2 (* 0.000048828126 f0-1))) - (set-vector! (-> obj root-override scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root-override scale) f0-2 f0-2 f0-2 1.0) ) ) ) ) (if arg0 - (shadow-handler obj) + (shadow-handler this) ) - (let ((s4-1 (-> obj leg-socket-part-mask))) + (let ((s4-1 (-> this leg-socket-part-mask))) (when (nonzero? s4-1) (dotimes (s3-0 6) (when (logtest? s4-1 1) (cond - ((>= (+ (-> *display* base-frame-counter) (seconds -1)) (-> obj leg-socket-part-time s3-0)) - (logxor! (-> obj leg-socket-part-mask) (ash 1 s3-0)) + ((>= (+ (current-time) (seconds -1)) (-> this leg-socket-part-time s3-0)) + (logxor! (-> this leg-socket-part-mask) (ash 1 s3-0)) ) (else (let ((v1-20 (-> *mother-spider-leg-infos* s3-0)) (s2-0 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s2-0 (-> obj node-list data (-> v1-20 joint-index0))) - (spawn (-> obj part) s2-0) + (vector<-cspace! s2-0 (-> this node-list data (-> v1-20 joint-index0))) + (spawn (-> this part) s2-0) ) ) ) @@ -622,15 +622,20 @@ ) (when arg1 (when *target* - (case (-> obj mode) + (case (-> this mode) ((1 2) (if *target* - (look-at-enemy! (-> *target* neck) (the-as vector (-> obj root-override root-prim prim-core)) 'attacking obj) + (look-at-enemy! + (-> *target* neck) + (the-as vector (-> this root-override root-prim prim-core)) + 'attacking + this + ) ) ) ) ) - (set-target! (-> obj neck) (target-pos 5)) + (set-target! (-> this neck) (target-pos 5)) ) ) ) @@ -640,20 +645,20 @@ ;; definition for method 23 of type mother-spider ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod mother-spider-method-23 mother-spider ((obj mother-spider)) +(defmethod mother-spider-method-23 mother-spider ((this mother-spider)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (let* ((f2-0 (-> obj dist-from-anchor)) - (f1-0 (- (-> obj targ-dist-from-anchor) f2-0)) - (f0-1 (-> obj thread-vel)) + (let* ((f2-0 (-> this dist-from-anchor)) + (f1-0 (- (-> this targ-dist-from-anchor) f2-0)) + (f0-1 (-> this thread-vel)) ) (when (or (!= f0-1 0.0) (!= f1-0 0.0)) (let ((f0-2 (+ f0-1 (* 2.0 f1-0)))) - (let ((f3-4 (-> obj thread-speed))) + (let ((f3-4 (-> this thread-speed))) (if (< f3-4 (fabs f0-2)) (set! f0-2 (if (>= f0-2 0.0) f3-4 @@ -662,8 +667,8 @@ ) ) ) - (let ((f2-1 (+ f2-0 (* f0-2 (-> *display* seconds-per-frame))))) - (let ((f3-8 (- (-> obj targ-dist-from-anchor) f2-1))) + (let ((f2-1 (+ f2-0 (* f0-2 (seconds-per-frame))))) + (let ((f3-8 (- (-> this targ-dist-from-anchor) f2-1))) (cond ((>= f1-0 0.0) (if (>= 0.0 f3-8) @@ -677,40 +682,40 @@ ) ) ) - (set! (-> obj dist-from-anchor) (fmax 0.0 f2-1)) + (set! (-> this dist-from-anchor) (fmax 0.0 f2-1)) ) - (set! (-> obj thread-vel) f0-2) + (set! (-> this thread-vel) f0-2) ) ) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-negate! s5-0 (-> obj swing-base-pos)) + (vector-negate! s5-0 (-> this swing-base-pos)) (set! (-> s5-0 y) 0.0) (let ((f0-4 (vector-length s5-0))) (when (< 0.0 f0-4) - (let ((f1-11 (* 61440.0 (-> *display* seconds-per-frame)))) + (let ((f1-11 (* 61440.0 (seconds-per-frame)))) (if (< f1-11 f0-4) (vector-normalize! s5-0 f1-11) ) ) - (vector+! (-> obj swing-vel) (-> obj swing-vel) s5-0) + (vector+! (-> this swing-vel) (-> this swing-vel) s5-0) ) ) ) - (let ((f0-5 (vector-length (-> obj swing-vel)))) + (let ((f0-5 (vector-length (-> this swing-vel)))) (when (< 0.0 f0-5) (let ((f0-6 (* 0.995 f0-5))) (cond ((< 40.96 f0-6) - (vector-normalize! (-> obj swing-vel) f0-6) + (vector-normalize! (-> this swing-vel) f0-6) (let ((s5-1 (new 'stack-no-clear 'event-message-block)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s4-0 (-> obj node-list data 6)) + (vector<-cspace! s4-0 (-> this node-list data 6)) (let ((v1-20 s3-0)) - (.lvf vf1 (&-> (-> obj swing-vel) quad)) - (let ((f0-7 (-> *display* seconds-per-frame))) + (.lvf vf1 (&-> (-> this swing-vel) quad)) + (let ((f0-7 (seconds-per-frame))) (.mov at-0 f0-7) ) (.mov vf2 at-0) @@ -724,84 +729,86 @@ s3-0 4915.2 (collide-kind background) - obj + this (the-as collide-tri-result s5-1) (new 'static 'pat-surface :noentity #x1) ) 0.0 ) - (vector-reflect! (-> obj swing-vel) (-> obj swing-vel) (the-as vector (&-> s5-1 param 6))) - (set! (-> obj swing-vel y) 0.0) - (vector-normalize! (-> obj swing-vel) (* 0.5 (vector-length (-> obj swing-vel)))) - (when (and (!= (-> obj spin-vel) 0.0) (>= (- (-> *display* base-frame-counter) (-> obj spin-time)) (seconds 0.5))) - (set! (-> obj spin-vel) (* 0.75 (- (-> obj spin-vel)))) - (set! (-> obj spin-time) (-> *display* base-frame-counter)) + (vector-reflect! (-> this swing-vel) (-> this swing-vel) (the-as vector (&-> s5-1 param 6))) + (set! (-> this swing-vel y) 0.0) + (vector-normalize! (-> this swing-vel) (* 0.5 (vector-length (-> this swing-vel)))) + (when (and (!= (-> this spin-vel) 0.0) (time-elapsed? (-> this spin-time) (seconds 0.5))) + (set! (-> this spin-vel) (* 0.75 (- (-> this spin-vel)))) + (set-time! (-> this spin-time)) ) ) ) - (vector-v+! (-> obj swing-base-pos) (-> obj swing-base-pos) (-> obj swing-vel)) + (vector-v+! (-> this swing-base-pos) (-> this swing-base-pos) (-> this swing-vel)) 0 ) (else - (vector-reset! (-> obj swing-vel)) + (vector-reset! (-> this swing-vel)) ) ) ) ) ) - (set! (-> obj swing-pos quad) (-> obj swing-base-pos quad)) - (let ((f30-1 (the float (- (-> *display* base-frame-counter) (-> obj spawned-time))))) - (+! (-> obj swing-pos x) (* 1024.0 (cos (* 54.613335 f30-1)))) - (+! (-> obj swing-pos z) (* 1024.0 (cos (* 81.817726 f30-1)))) + (set! (-> this swing-pos quad) (-> this swing-base-pos quad)) + (let ((f30-1 (the float (- (current-time) (-> this spawned-time))))) + (+! (-> this swing-pos x) (* 1024.0 (cos (* 54.613335 f30-1)))) + (+! (-> this swing-pos z) (* 1024.0 (cos (* 81.817726 f30-1)))) ) - (let ((f0-26 (vector-length (-> obj swing-pos)))) + (let ((f0-26 (vector-length (-> this swing-pos)))) (cond ((!= f0-26 0.0) - (let* ((f30-2 (-> obj dist-from-anchor)) + (let* ((f30-2 (-> this dist-from-anchor)) (f28-2 (* 10430.379 (/ f0-26 f30-2))) ) - (set-vector! (-> obj root-override trans) 0.0 (* (cos f28-2) (- f30-2)) (* (sin f28-2) f30-2) 1.0) + (set-vector! (-> this root-override trans) 0.0 (* (cos f28-2) (- f30-2)) (* (sin f28-2) f30-2) 1.0) ) - (let ((f0-36 (atan (-> obj swing-pos x) (-> obj swing-pos z)))) - (vector-rotate-around-y! (-> obj root-override trans) (-> obj root-override trans) f0-36) + (let ((f0-36 (atan (-> this swing-pos x) (-> this swing-pos z)))) + (vector-rotate-around-y! (-> this root-override trans) (-> this root-override trans) f0-36) ) - (vector+! (-> obj root-override trans) (-> obj root-override trans) (-> obj anchor-trans)) + (vector+! (-> this root-override trans) (-> this root-override trans) (-> this anchor-trans)) ) (else - (set! (-> obj root-override trans quad) (-> obj anchor-trans quad)) - (set! (-> obj root-override trans y) (- (-> obj root-override trans y) (-> obj dist-from-anchor))) + (set! (-> this root-override trans quad) (-> this anchor-trans quad)) + (set! (-> this root-override trans y) (- (-> this root-override trans y) (-> this dist-from-anchor))) ) ) ) - (let ((v1-51 (-> obj draw bounds))) - (vector+! v1-51 (-> obj root-override trans) (-> obj anchor-trans)) + (let ((v1-51 (-> this draw bounds))) + (vector+! v1-51 (-> this root-override trans) (-> this anchor-trans)) (vector-float*! v1-51 v1-51 0.5) - (vector-! v1-51 v1-51 (-> obj root-override trans)) - (set! (-> v1-51 w) (+ 28672.0 (* 0.5 (-> obj dist-from-anchor)))) + (vector-! v1-51 v1-51 (-> this root-override trans)) + (set! (-> v1-51 w) (+ 28672.0 (* 0.5 (-> this dist-from-anchor)))) ) (cond - ((!= (-> obj spin-vel) 0.0) - (let ((f0-44 (+ (-> obj orient-rot y) (* (-> obj spin-vel) (-> *display* seconds-per-frame))))) - (set! (-> obj orient-rot y) (- f0-44 (* (the float (the int (/ f0-44 65536.0))) 65536.0))) + ((!= (-> this spin-vel) 0.0) + (let ((f0-44 (+ (-> this orient-rot y) (* (-> this spin-vel) (seconds-per-frame))))) + (set! (-> this orient-rot y) (- f0-44 (* (the float (the int (/ f0-44 65536.0))) 65536.0))) ) - (seek! (-> obj spin-vel) 0.0 (* 91022.22 (-> *display* seconds-per-frame))) - (when (< (fabs (-> obj spin-vel)) 69176.89) - (if (>= (-> obj spin-vel) 0.0) - (set! (-> obj spin-vel) 69176.89) - (set! (-> obj spin-vel) -69176.89) + (seek! (-> this spin-vel) 0.0 (* 91022.22 (seconds-per-frame))) + (when (< (fabs (-> this spin-vel)) 69176.89) + (if (>= (-> this spin-vel) 0.0) + (set! (-> this spin-vel) 69176.89) + (set! (-> this spin-vel) -69176.89) ) (cond (*target* (let* ((v1-59 (target-pos 0)) - (f0-59 (atan (- (-> v1-59 x) (-> obj root-override trans x)) (- (-> v1-59 z) (-> obj root-override trans z)))) + (f0-59 + (atan (- (-> v1-59 x) (-> this root-override trans x)) (- (-> v1-59 z) (-> this root-override trans z))) + ) ) - (if (>= 3640.889 (fabs (deg- f0-59 (-> obj orient-rot y)))) - (set! (-> obj spin-vel) 0.0) + (if (>= 3640.889 (fabs (deg- f0-59 (-> this orient-rot y)))) + (set! (-> this spin-vel) 0.0) ) ) ) (else - (set! (-> obj spin-vel) 0.0) + (set! (-> this spin-vel) 0.0) ) ) ) @@ -809,16 +816,18 @@ (else (when *target* (let* ((v1-66 (target-pos 0)) - (f0-69 (atan (- (-> v1-66 x) (-> obj root-override trans x)) (- (-> v1-66 z) (-> obj root-override trans z)))) + (f0-69 + (atan (- (-> v1-66 x) (-> this root-override trans x)) (- (-> v1-66 z) (-> this root-override trans z))) + ) ) - (set! (-> obj orient-rot y) - (deg-seek-smooth (-> obj orient-rot y) f0-69 (* 32768.0 (-> *display* seconds-per-frame)) 0.2) + (set! (-> this orient-rot y) + (deg-seek-smooth (-> this orient-rot y) f0-69 (* 32768.0 (seconds-per-frame)) 0.2) ) ) ) ) ) - (quaternion-zxy! (-> obj root-override quat) (-> obj orient-rot)) + (quaternion-zxy! (-> this root-override quat) (-> this orient-rot)) 0 (none) ) @@ -1007,7 +1016,7 @@ (go mother-spider-tracking) ) ((= v1-22 2) - (set! (-> self started-birthing-time) (-> *display* base-frame-counter)) + (set-time! (-> self started-birthing-time)) (set! (-> self birthing-counter) (max 0 (- (-> self max-baby-count) (-> self baby-count)))) (go mother-spider-birthing) ) @@ -1022,8 +1031,8 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) + (set-time! (-> self last-player-in-air-time)) ) :trans (behavior () (if (-> self hit?) @@ -1058,11 +1067,11 @@ (not (logtest? (-> *target* control status) (cshape-moving-flags onsurf))) ) ) - (set! (-> self last-player-in-air-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-player-in-air-time)) ) (when (and *target* - (>= (- (-> *display* base-frame-counter) (-> self last-spit-time)) (seconds 3)) - (>= (- (-> *display* base-frame-counter) (-> self last-player-in-air-time)) (seconds 0.06)) + (time-elapsed? (-> self last-spit-time) (seconds 3)) + (time-elapsed? (-> self last-player-in-air-time) (seconds 0.06)) (>= (-> self max-spit-xz-dist) (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) ) (let ((gp-2 (new 'stack-no-clear 'vector)) @@ -1079,7 +1088,7 @@ (go mother-spider-spit) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self last-spit-time)) (seconds 5)) + (if (time-elapsed? (-> self last-spit-time) (seconds 5)) (go mother-spider-traveling (the-as uint 2)) ) ) @@ -1153,7 +1162,7 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (-> self hit?) @@ -1197,7 +1206,7 @@ :to self ) (set! gp-0 #t) - (set! (-> self last-spit-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-spit-time)) (vector-negate! s5-0 s5-0) (mother-spider-method-21 self s5-0 49152.0 #f) (when (nonzero? (-> self max-baby-count)) @@ -1228,7 +1237,7 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (-> self hit?) @@ -1237,7 +1246,7 @@ (if (letgo-player? self) (go mother-spider-traveling (the-as uint 0)) ) - (if (and (>= (- (-> *display* base-frame-counter) (-> self started-birthing-time)) (seconds 6)) + (if (and (time-elapsed? (-> self started-birthing-time) (seconds 6)) (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) @@ -1245,7 +1254,7 @@ ) (go mother-spider-traveling (the-as uint 1)) ) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.25)) (> (-> self birthing-counter) 0) (and (>= 49152.0 (- (-> self max-dist-from-anchor) (-> self dist-from-anchor))) (not (logtest? (-> *target* state-flags) @@ -1288,7 +1297,7 @@ :event mother-spider-default-event-handler :enter (behavior () (set! (-> self hit?) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (-> self hit?) @@ -1331,12 +1340,12 @@ ;; definition for method 20 of type mother-spider ;; INFO: Used lq/sq -(defmethod mother-spider-method-20 mother-spider ((obj mother-spider) (arg0 vector) (arg1 vector)) - (set! (-> obj nav nav-cull-radius) 40960.0) - (set-current-poly! (-> obj nav) (nav-control-method-16 (-> obj nav) (-> obj root-override trans))) - (nav-control-method-28 (-> obj nav) (the-as collide-kind -1)) +(defmethod mother-spider-method-20 mother-spider ((this mother-spider) (arg0 vector) (arg1 vector)) + (set! (-> this nav nav-cull-radius) 40960.0) + (set-current-poly! (-> this nav) (nav-control-method-16 (-> this nav) (-> this root-override trans))) + (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) (dotimes (s3-1 4) - (let ((f28-0 (+ 32768.0 (-> obj orient-rot y))) + (let ((f28-0 (+ 32768.0 (-> this orient-rot y))) (f30-0 (rand-vu-float-range 16384.0 40960.0)) ) (let ((s1-0 (new 'stack-no-clear 'vector)) @@ -1346,13 +1355,13 @@ (set-vector! s1-0 (sin f28-1) 0.0 (cos f28-1) 1.0) ) (vector-float*! s2-1 s1-0 f30-0) - (nav-control-method-35 (-> obj nav) (-> obj nav travel) (-> obj root-override trans) s2-1 s1-0 f30-0) + (nav-control-method-35 (-> this nav) (-> this nav travel) (-> this root-override trans) s2-1 s1-0 f30-0) ) - (nav-control-method-24 (-> obj nav) f30-0 (the-as clip-travel-vector-to-mesh-return-info #f)) + (nav-control-method-24 (-> this nav) f30-0 (the-as clip-travel-vector-to-mesh-return-info #f)) ) (cond - ((>= (vector-xz-length (-> obj nav travel)) 4096.0) - (vector+! arg0 (-> obj root-override trans) (-> obj nav travel)) + ((>= (vector-xz-length (-> this nav travel)) 4096.0) + (vector+! arg0 (-> this root-override trans) (-> this nav travel)) (let ((s2-2 (new 'stack-no-clear 'collide-tri-result))) (cond ((>= (fill-and-probe-using-line-sphere @@ -1361,7 +1370,7 @@ (new 'static 'vector :y -69632.0 :w 1.0) 40.96 (collide-kind background) - obj + this s2-2 (new 'static 'pat-surface :noentity #x1) ) @@ -1382,7 +1391,7 @@ ) ) ) - (project-onto-nav-mesh (-> obj nav) arg0 (-> obj root-override trans)) + (project-onto-nav-mesh (-> this nav) arg0 (-> this root-override trans)) (let ((a1-12 (new 'stack-no-clear 'vector)) (s3-2 (new 'stack-no-clear 'collide-tri-result)) ) @@ -1395,7 +1404,7 @@ (new 'static 'vector :y -69632.0 :w 1.0) 40.96 (collide-kind background) - obj + this s3-2 (new 'static 'pat-surface :noentity #x1) ) @@ -1594,7 +1603,7 @@ ) ;; definition for method 22 of type mother-spider -(defmethod mother-spider-method-22 mother-spider ((obj mother-spider) (arg0 matrix) (arg1 vector)) +(defmethod mother-spider-method-22 mother-spider ((this mother-spider) (arg0 matrix) (arg1 vector)) (rlet ((vf0 :class vf)) (init-vf0-vector) (vector-! (-> arg0 vector 2) arg1 (-> arg0 vector 3)) @@ -1618,57 +1627,57 @@ ) ;; definition for method 12 of type mother-spider -(defmethod run-logic? mother-spider ((obj mother-spider)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (< (vector-vector-xz-distance (-> obj root-override trans) (math-camera-pos)) (-> obj deactivate-xz-dist)) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) +(defmethod run-logic? mother-spider ((this mother-spider)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (< (vector-vector-xz-distance (-> this root-override trans) (math-camera-pos)) (-> this deactivate-xz-dist)) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) ;; definition for method 7 of type mother-spider ;; INFO: Return type mismatch process-drawable vs mother-spider. -(defmethod relocate mother-spider ((obj mother-spider) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(defmethod relocate mother-spider ((this mother-spider) (arg0 int)) + (if (nonzero? (-> this neck)) + (&+! (-> this neck) arg0) ) - (the-as mother-spider ((method-of-type process-drawable relocate) obj arg0)) + (the-as mother-spider ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type mother-spider ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! mother-spider ((obj mother-spider) (arg0 entity-actor)) +(defmethod init-from-entity! mother-spider ((this mother-spider) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-64 vector)) - (set! (-> obj baby-count) 0) - (set! (-> obj spit-counter) 0) - (set! (-> obj leg-socket-part-mask) 0) - (set! (-> obj mode) (the-as uint 0)) - (set! (-> obj damage) 0) - (set! (-> obj player-attack-id) (the-as uint 0)) - (set! (-> obj spin-vel) 0.0) - (set! (-> obj thread-speed) 245760.0) - (set! (-> obj thread-vel) 0.0) - (set! (-> obj hit?) #f) - (set! (-> obj last-update-time) 0) - (set! (-> obj spawned-time) (-> *display* base-frame-counter)) - (set! (-> obj spin-time) (-> *display* base-frame-counter)) - (set! (-> obj last-spit-time) 0) - (set! (-> obj started-birthing-time) 0) - (set! (-> obj check-z-thresh?) #f) - (set! (-> obj activate-z-thresh) 0.0) - (set! (-> obj deactivate-z-thresh) 0.0) - (vector-reset! (-> obj swing-pos)) - (vector-reset! (-> obj swing-base-pos)) - (vector-reset! (-> obj swing-vel)) - (when (name= (-> obj name) "mother-spider-7") - (set! (-> obj check-z-thresh?) #t) - (set! (-> obj activate-z-thresh) -12288.0) - (set! (-> obj deactivate-z-thresh) 24985.6) + (set! (-> this baby-count) 0) + (set! (-> this spit-counter) 0) + (set! (-> this leg-socket-part-mask) 0) + (set! (-> this mode) (the-as uint 0)) + (set! (-> this damage) 0) + (set! (-> this player-attack-id) (the-as uint 0)) + (set! (-> this spin-vel) 0.0) + (set! (-> this thread-speed) 245760.0) + (set! (-> this thread-vel) 0.0) + (set! (-> this hit?) #f) + (set! (-> this last-update-time) 0) + (set-time! (-> this spawned-time)) + (set-time! (-> this spin-time)) + (set! (-> this last-spit-time) 0) + (set! (-> this started-birthing-time) 0) + (set! (-> this check-z-thresh?) #f) + (set! (-> this activate-z-thresh) 0.0) + (set! (-> this deactivate-z-thresh) 0.0) + (vector-reset! (-> this swing-pos)) + (vector-reset! (-> this swing-base-pos)) + (vector-reset! (-> this swing-vel)) + (when (name= (-> this name) "mother-spider-7") + (set! (-> this check-z-thresh?) #t) + (set! (-> this activate-z-thresh) -12288.0) + (set! (-> this deactivate-z-thresh) 24985.6) ) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind mother-spider)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1750,74 +1759,74 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *mother-spider-sg* '()) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj nav nearest-y-threshold) 409600.0) - (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) - (logclear! (-> obj root-override nav-flags) (nav-flags navf1)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *mother-spider-sg* '()) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this nav nearest-y-threshold) 409600.0) + (logclear! (-> this root-override nav-flags) (nav-flags navf0)) + (logclear! (-> this root-override nav-flags) (nav-flags navf1)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 4096000.0 (the-as float 60) 245760.0)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 618) obj)) - (logior! (-> obj skel status) (janim-status inited)) - (let ((v0-30 (new 'process 'joint-mod (joint-mod-handler-mode reset) obj 19))) - (set! (-> obj neck) v0-30) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 4096000.0 (the-as float 60) 245760.0)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 618) this)) + (logior! (-> this skel status) (janim-status inited)) + (let ((v0-30 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 19))) + (set! (-> this neck) v0-30) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) (set! (-> v0-30 up) (the-as uint 1)) (set! (-> v0-30 nose) (the-as uint 2)) (set! (-> v0-30 ear) (the-as uint 0)) (set! (-> v0-30 max-dist) 102400.0) (set! (-> v0-30 ignore-angle) 16384.0) ) - (set! (-> obj thread-min-trans quad) (-> obj root-override trans quad)) - (set! (-> obj anchor-trans quad) (-> obj root-override trans quad)) - (set! (-> obj max-swing-radius) 73728.0) - (set! (-> obj max-baby-count) 4) + (set! (-> this thread-min-trans quad) (-> this root-override trans quad)) + (set! (-> this anchor-trans quad) (-> this root-override trans quad)) + (set! (-> this max-swing-radius) 73728.0) + (set! (-> this max-baby-count) 4) (let ((s4-1 #f)) (set! sv-16 (new 'static 'res-tag)) (let ((v0-31 (res-lump-data arg0 'mother-spider pointer :tag-ptr (& sv-16)))) (cond (v0-31 - (+! (-> obj thread-min-trans y) (-> (the-as (pointer float) v0-31) 0)) - (+! (-> obj anchor-trans y) (-> (the-as (pointer float) v0-31) 1)) - (set! (-> obj max-swing-radius) (-> (the-as (pointer float) v0-31) 2)) - (set! (-> obj max-baby-count) (the int (-> (the-as (pointer float) v0-31) 3))) + (+! (-> this thread-min-trans y) (-> (the-as (pointer float) v0-31) 0)) + (+! (-> this anchor-trans y) (-> (the-as (pointer float) v0-31) 1)) + (set! (-> this max-swing-radius) (-> (the-as (pointer float) v0-31) 2)) + (set! (-> this max-baby-count) (the int (-> (the-as (pointer float) v0-31) 3))) (set! s4-1 (!= (-> (the-as (pointer float) v0-31) 4) 0.0)) - (set! (-> obj max-spit-xz-dist) (-> (the-as (pointer float) v0-31) 5)) - (set! (-> obj activate-xz-dist) (-> (the-as (pointer float) v0-31) 6)) - (set! (-> obj deactivate-xz-dist) (-> (the-as (pointer float) v0-31) 7)) + (set! (-> this max-spit-xz-dist) (-> (the-as (pointer float) v0-31) 5)) + (set! (-> this activate-xz-dist) (-> (the-as (pointer float) v0-31) 6)) + (set! (-> this deactivate-xz-dist) (-> (the-as (pointer float) v0-31) 7)) ) (else - (+! (-> obj thread-min-trans y) 28672.0) - (+! (-> obj anchor-trans y) 204800.0) - (set! (-> obj max-spit-xz-dist) 81920.0) - (set! (-> obj activate-xz-dist) 143360.0) - (set! (-> obj deactivate-xz-dist) 163430.4) + (+! (-> this thread-min-trans y) 28672.0) + (+! (-> this anchor-trans y) 204800.0) + (set! (-> this max-spit-xz-dist) 81920.0) + (set! (-> this activate-xz-dist) 143360.0) + (set! (-> this deactivate-xz-dist) 163430.4) ) ) ) - (set! (-> obj thread-min-trans w) 1.0) - (set! (-> obj anchor-trans w) 1.0) - (set! (-> obj idle-dist-from-anchor) 16384.0) - (set! (-> obj max-dist-from-anchor) (- (-> obj anchor-trans y) (-> obj thread-min-trans y))) - (set! (-> obj player-sticky-dist-from-anchor) (-> obj max-dist-from-anchor)) - (set! (-> obj targ-dist-from-anchor) (-> obj idle-dist-from-anchor)) - (set! (-> obj root-override trans quad) (-> obj anchor-trans quad)) - (set! (-> obj root-override trans y) (- (-> obj root-override trans y) (-> obj idle-dist-from-anchor))) - (set-vector! (-> obj orient-rot) 0.0 0.0 0.0 1.0) - (quaternion-zxy! (-> obj root-override quat) (-> obj orient-rot)) + (set! (-> this thread-min-trans w) 1.0) + (set! (-> this anchor-trans w) 1.0) + (set! (-> this idle-dist-from-anchor) 16384.0) + (set! (-> this max-dist-from-anchor) (- (-> this anchor-trans y) (-> this thread-min-trans y))) + (set! (-> this player-sticky-dist-from-anchor) (-> this max-dist-from-anchor)) + (set! (-> this targ-dist-from-anchor) (-> this idle-dist-from-anchor)) + (set! (-> this root-override trans quad) (-> this anchor-trans quad)) + (set! (-> this root-override trans y) (- (-> this root-override trans y) (-> this idle-dist-from-anchor))) + (set-vector! (-> this orient-rot) 0.0 0.0 0.0 1.0) + (quaternion-zxy! (-> this root-override quat) (-> this orient-rot)) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 5)) + (the-as art-joint-anim (-> this draw art-group data 5)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) @@ -1825,14 +1834,14 @@ (transform-post) (create-connection! *cavecrystal-light-control* - obj - (-> obj entity) + this + (-> this entity) (the-as (function object object object object object) cavecrystal-light-control-default-callback) -1 10240.0 ) (let ((v1-121 #f)) - (if (nonzero? (-> obj entity extra perm user-int8 0)) + (if (nonzero? (-> this entity extra perm user-int8 0)) (set! v1-121 #t) ) (cond @@ -1841,12 +1850,12 @@ ) (else (when s4-1 - (let ((s5-3 (max 0 (min (+ (-> obj path curve num-cverts) -1) (-> obj max-baby-count)))) + (let ((s5-3 (max 0 (min (+ (-> this path curve num-cverts) -1) (-> this max-baby-count)))) (s4-2 (new 'stack-no-clear 'vector)) (s3-1 (new 'stack-no-clear 'vector)) ) (dotimes (s2-9 s5-3) - (eval-path-curve-div! (-> obj path) s4-2 (the float s2-9) 'interp) + (eval-path-curve-div! (-> this path) s4-2 (the float s2-9) 'interp) (vector-! s3-1 (target-pos 0) s4-2) (set! (-> s3-1 y) 0.0) (let ((s1-2 vector-rotate-around-y!) @@ -1858,11 +1867,11 @@ ) ) (vector-normalize! s3-1 1.0) - (spawn-child obj s4-2 s3-1 #f) + (spawn-child this s4-2 s3-1 #f) ) ) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (go mother-spider-idle) ) ) diff --git a/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc b/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc index 5774c7cd19..552fe0e41a 100644 --- a/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc +++ b/test/decompiler/reference/jak1/levels/maincave/spiderwebs_REF.gc @@ -46,12 +46,12 @@ ) ;; definition for method 3 of type spiderwebs -(defmethod inspect spiderwebs ((obj spiderwebs)) +(defmethod inspect spiderwebs ((this spiderwebs)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspring-height: (meters ~m)~%" (-> obj spring-height)) - obj + (format #t "~T~Tspring-height: (meters ~m)~%" (-> this spring-height)) + this ) ;; failed to figure out what this is: @@ -131,9 +131,9 @@ ;; definition for method 11 of type spiderwebs ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! spiderwebs ((obj spiderwebs) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! spiderwebs ((this spiderwebs) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -150,26 +150,26 @@ ) (set! (-> s4-0 nav-radius) 13926.4) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *spiderwebs-sg* '()) - (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *spiderwebs-sg* '()) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) (ja-channel-set! 1) - (let ((a0-11 (-> obj skel root-channel 0))) + (let ((a0-11 (-> this skel root-channel 0))) (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group data 0 length) -1))) (set! (-> a0-11 param 1) 1.0) (joint-control-channel-group! a0-11 (the-as art-joint-anim #f) num-func-seek!) ) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) - (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) (transform-post) (go spiderwebs-idle) (none) 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 039c1bd2d0..af3bee82bf 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 @@ -18,13 +18,13 @@ ) ;; definition for method 3 of type babak-with-cannon -(defmethod inspect babak-with-cannon ((obj babak-with-cannon)) +(defmethod inspect babak-with-cannon ((this babak-with-cannon)) (let ((t9-0 (method-of-type babak inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcannon-ent: ~A~%" (-> obj cannon-ent)) - (format #t "~T~Tdistance: ~f~%" (-> obj distance)) - obj + (format #t "~T~Tcannon-ent: ~A~%" (-> this cannon-ent)) + (format #t "~T~Tdistance: ~f~%" (-> this distance)) + this ) ;; failed to figure out what this is: @@ -39,7 +39,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) ) (go-virtual nav-enemy-patrol) ) @@ -62,9 +62,9 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((f30-0 (- (-> (target-pos 0) y) (-> self collide-info trans y)))) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (if (and (time-elapsed? (-> self state-time) (seconds 3)) (or (or (not *target*) (< (-> self distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) ) @@ -74,7 +74,7 @@ nav-enemy-default-event-handler (go babak-run-to-cannon) ) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (if (or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) @@ -94,7 +94,7 @@ nav-enemy-default-event-handler (defstate babak-run-to-cannon (babak) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self nav destination-pos quad) (-> self entity extra trans quad)) (set! (-> self nav target-pos quad) (-> self entity extra trans quad)) ) @@ -181,7 +181,7 @@ nav-enemy-default-event-handler (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self rotate-speed) (-> self nav-info run-rotate-speed)) (set! (-> self turn-time) (-> self nav-info run-turn-time)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) @@ -251,7 +251,7 @@ nav-enemy-default-event-handler (logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (nav-enemy-initialize-jump (-> self entity extra trans)) (nav-enemy-neck-control-look-at) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel)) @@ -278,7 +278,7 @@ nav-enemy-default-event-handler (defstate babak-with-cannon-shooting (babak-with-cannon) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor 0))) (if v1-2 (logior! (-> v1-2 extra perm status) (entity-perm-status complete)) @@ -298,7 +298,7 @@ nav-enemy-default-event-handler (and (and *target* (>= (-> self distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) ) ) (go babak-with-cannon-jump-off-cannon) @@ -369,33 +369,33 @@ nav-enemy-default-event-handler ) ;; definition for method 39 of type babak-with-cannon -(defmethod common-post babak-with-cannon ((obj babak-with-cannon)) +(defmethod common-post babak-with-cannon ((this babak-with-cannon)) (cond ((= (level-status *level* 'beach) 'active) - (spool-push *art-control* "beachcam-cannon" 0 obj -99.0) + (spool-push *art-control* "beachcam-cannon" 0 this -99.0) ) ((= (level-status *level* 'misty) 'active) - (spool-push *art-control* "mistycam-cannon" 0 obj -99.0) + (spool-push *art-control* "mistycam-cannon" 0 this -99.0) ) ) - ((method-of-type nav-enemy common-post) obj) + ((method-of-type nav-enemy common-post) this) (none) ) ;; definition for method 11 of type babak-with-cannon ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! babak-with-cannon ((obj babak-with-cannon) (arg0 entity-actor)) - (initialize-collision obj) - (process-drawable-from-entity! obj arg0) - (nav-enemy-method-48 obj) - (set! (-> obj distance) (res-lump-float arg0 'distance :default 163840.0)) - (set! (-> obj cannon-ent) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (if (or (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))) - (not (logtest? (-> obj enemy-info options) (fact-options has-power-cell))) +(defmethod init-from-entity! babak-with-cannon ((this babak-with-cannon) (arg0 entity-actor)) + (initialize-collision this) + (process-drawable-from-entity! this arg0) + (nav-enemy-method-48 this) + (set! (-> this distance) (res-lump-float arg0 'distance :default 163840.0)) + (set! (-> this cannon-ent) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (if (or (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete)))) + (not (logtest? (-> this enemy-info options) (fact-options has-power-cell))) ) - (go (method-of-object obj nav-enemy-idle)) + (go (method-of-object this nav-enemy-idle)) ) - (go (method-of-object obj nav-enemy-fuel-cell)) + (go (method-of-object this nav-enemy-fuel-cell)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc index c821711a7b..3ea4f4b731 100644 --- a/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/balloonlurker_REF.gc @@ -237,19 +237,19 @@ ) ;; definition for method 3 of type balloonlurker-bank -(defmethod inspect balloonlurker-bank ((obj balloonlurker-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tbuoyancy-depth-offset: (meters ~m)~%" (-> obj buoyancy-depth-offset)) - (format #t "~Tplayer-mass: ~f~%" (-> obj player-mass)) - (format #t "~Trudder-factor: ~f~%" (-> obj rudder-factor)) - (format #t "~Tmax-engine-thrust: ~f~%" (-> obj max-engine-thrust)) - (format #t "~Tmax-rudder-deflection-angle: ~f~%" (-> obj max-rudder-deflection-angle)) - (format #t "~Tthrottle-factor: ~f~%" (-> obj throttle-factor)) - (format #t "~Tthrottle-distance: ~f~%" (-> obj throttle-distance)) - (format #t "~Tthrottle-close-distance: ~f~%" (-> obj throttle-close-distance)) - (format #t "~Texplosion-force: ~f~%" (-> obj explosion-force)) - (format #t "~Tmine-weight: ~f~%" (-> obj mine-weight)) - obj +(defmethod inspect balloonlurker-bank ((this balloonlurker-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tbuoyancy-depth-offset: (meters ~m)~%" (-> this buoyancy-depth-offset)) + (format #t "~Tplayer-mass: ~f~%" (-> this player-mass)) + (format #t "~Trudder-factor: ~f~%" (-> this rudder-factor)) + (format #t "~Tmax-engine-thrust: ~f~%" (-> this max-engine-thrust)) + (format #t "~Tmax-rudder-deflection-angle: ~f~%" (-> this max-rudder-deflection-angle)) + (format #t "~Tthrottle-factor: ~f~%" (-> this throttle-factor)) + (format #t "~Tthrottle-distance: ~f~%" (-> this throttle-distance)) + (format #t "~Tthrottle-close-distance: ~f~%" (-> this throttle-close-distance)) + (format #t "~Texplosion-force: ~f~%" (-> this explosion-force)) + (format #t "~Tmine-weight: ~f~%" (-> this mine-weight)) + this ) ;; definition for symbol *BALLOONLURKER-bank*, type balloonlurker-bank @@ -333,33 +333,33 @@ ) ;; definition for method 3 of type balloonlurker -(defmethod inspect balloonlurker ((obj balloonlurker)) +(defmethod inspect balloonlurker ((this balloonlurker)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Texplosion-force-position: #~%" (-> obj explosion-force-position)) - (format #t "~T~Texplosion-force: #~%" (-> obj explosion-force)) - (format #t "~T~Texplosion: ~A~%" (-> obj explosion)) - (format #t "~T~Texplosion-joint-index[2] @ #x~X~%" (-> obj explosion-joint-index-bytes)) - (format #t "~T~Tvulnerable: ~A~%" (-> obj vulnerable)) - (format #t "~T~Twater-y: ~f~%" (-> obj water-y)) - (format #t "~T~Tpropeller: ~A~%" (-> obj propeller)) - (format #t "~T~Trudder: ~A~%" (-> obj rudder)) - (format #t "~T~Tmine[2] @ #x~X~%" (-> obj mine)) - (format #t "~T~Tbuoyancy-factor: ~f~%" (-> obj buoyancy-factor)) - (format #t "~T~Trudder-control: ~f~%" (-> obj rudder-control)) - (format #t "~T~Tthrottle-control: ~f~%" (-> obj throttle-control)) - (format #t "~T~Tengine-thrust: ~f~%" (-> obj engine-thrust)) - (format #t "~T~Tdest-point: #~%" (-> obj dest-point)) - (format #t "~T~Tdest-point-old: #~%" (-> obj dest-point-old)) - (format #t "~T~Tdest-index: ~D~%" (-> obj dest-index)) - (format #t "~T~Tauto-pilot: ~A~%" (-> obj auto-pilot)) - (format #t "~T~Tdead: ~A~%" (-> obj dead)) - (format #t "~T~Tanim-frame: ~f~%" (-> obj anim-frame)) - (format #t "~T~Tengine-sound-id: ~D~%" (-> obj engine-sound-id)) - (format #t "~T~Tpedal-sound-id: ~D~%" (-> obj pedal-sound-id)) - (format #t "~T~Tframe-count: ~D~%" (-> obj frame-count)) - obj + (format #t "~T~Texplosion-force-position: #~%" (-> this explosion-force-position)) + (format #t "~T~Texplosion-force: #~%" (-> this explosion-force)) + (format #t "~T~Texplosion: ~A~%" (-> this explosion)) + (format #t "~T~Texplosion-joint-index[2] @ #x~X~%" (-> this explosion-joint-index-bytes)) + (format #t "~T~Tvulnerable: ~A~%" (-> this vulnerable)) + (format #t "~T~Twater-y: ~f~%" (-> this water-y)) + (format #t "~T~Tpropeller: ~A~%" (-> this propeller)) + (format #t "~T~Trudder: ~A~%" (-> this rudder)) + (format #t "~T~Tmine[2] @ #x~X~%" (-> this mine)) + (format #t "~T~Tbuoyancy-factor: ~f~%" (-> this buoyancy-factor)) + (format #t "~T~Trudder-control: ~f~%" (-> this rudder-control)) + (format #t "~T~Tthrottle-control: ~f~%" (-> this throttle-control)) + (format #t "~T~Tengine-thrust: ~f~%" (-> this engine-thrust)) + (format #t "~T~Tdest-point: #~%" (-> this dest-point)) + (format #t "~T~Tdest-point-old: #~%" (-> this dest-point-old)) + (format #t "~T~Tdest-index: ~D~%" (-> this dest-index)) + (format #t "~T~Tauto-pilot: ~A~%" (-> this auto-pilot)) + (format #t "~T~Tdead: ~A~%" (-> this dead)) + (format #t "~T~Tanim-frame: ~f~%" (-> this anim-frame)) + (format #t "~T~Tengine-sound-id: ~D~%" (-> this engine-sound-id)) + (format #t "~T~Tpedal-sound-id: ~D~%" (-> this pedal-sound-id)) + (format #t "~T~Tframe-count: ~D~%" (-> this frame-count)) + this ) ;; definition of type balloonlurker-pilot @@ -382,11 +382,11 @@ ) ;; definition for method 3 of type balloonlurker-pilot -(defmethod inspect balloonlurker-pilot ((obj balloonlurker-pilot)) +(defmethod inspect balloonlurker-pilot ((this balloonlurker-pilot)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -548,24 +548,24 @@ ;; definition for method 23 of type balloonlurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 balloonlurker ((obj balloonlurker) (arg0 float)) +(defmethod rigid-body-platform-method-23 balloonlurker ((this balloonlurker) (arg0 float)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s3-0 (new 'stack-no-clear 'vector)) - (s4-0 (-> obj rbody matrix)) + (s4-0 (-> this rbody matrix)) ) (dotimes (s2-0 4) - (let ((s1-0 (-> obj control-point-array data s2-0))) + (let ((s1-0 (-> this control-point-array data s2-0))) (vector-matrix*! (-> s1-0 world-pos) (-> s1-0 local-pos) s4-0) - (rigid-body-method-17 (-> obj rbody) (-> s1-0 world-pos) (-> s1-0 velocity)) - (let* ((f30-0 (vector-vector-xz-distance (-> obj dest-point) (-> obj root-overlay trans))) - (f0-0 (vector-vector-xz-distance (-> obj dest-point-old) (-> obj root-overlay trans))) + (rigid-body-method-17 (-> this rbody) (-> s1-0 world-pos) (-> s1-0 velocity)) + (let* ((f30-0 (vector-vector-xz-distance (-> this dest-point) (-> this root-overlay trans))) + (f0-0 (vector-vector-xz-distance (-> this dest-point-old) (-> this root-overlay trans))) (f0-6 - (/ (- (+ (/ (+ (* f30-0 (-> obj dest-point-old y)) (* f0-0 (-> obj dest-point y))) (fmax 409.6 (+ f30-0 f0-0))) + (/ (- (+ (/ (+ (* f30-0 (-> this dest-point-old y)) (* f0-0 (-> this dest-point y))) (fmax 409.6 (+ f30-0 f0-0))) (-> *BALLOONLURKER-bank* buoyancy-depth-offset) ) (-> s1-0 world-pos y) ) - (-> obj info max-buoyancy-depth) + (-> this info max-buoyancy-depth) ) ) ) @@ -573,24 +573,24 @@ s5-0 *y-vector* (* 0.25 - (-> obj buoyancy-factor) - (-> obj info gravity-factor) + (-> this buoyancy-factor) + (-> this info gravity-factor) (fmax 0.3 (fmin 1.0 f0-6)) - (-> obj info gravity) - (-> obj rbody mass) + (-> this info gravity) + (-> this rbody mass) ) ) ) - (rigid-body-method-13 (-> obj rbody) (-> s1-0 world-pos) s5-0) - (vector-float*! s5-0 (-> s1-0 velocity) (* -1.0 (-> obj info drag-factor))) - (rigid-body-method-13 (-> obj rbody) (-> s1-0 world-pos) s5-0) + (rigid-body-method-13 (-> this rbody) (-> s1-0 world-pos) s5-0) + (vector-float*! s5-0 (-> s1-0 velocity) (* -1.0 (-> this info drag-factor))) + (rigid-body-method-13 (-> this rbody) (-> s1-0 world-pos) s5-0) ) 0 ) - (let ((s2-1 (-> obj control-point-array data 4))) - (let ((f30-1 (* (-> *BALLOONLURKER-bank* max-rudder-deflection-angle) (-> obj rudder-control)))) + (let ((s2-1 (-> this control-point-array data 4))) + (let ((f30-1 (* (-> *BALLOONLURKER-bank* max-rudder-deflection-angle) (-> this rudder-control)))) (vector-matrix*! (-> s2-1 world-pos) (-> s2-1 local-pos) s4-0) - (rigid-body-method-17 (-> obj rbody) (-> s2-1 world-pos) (-> s2-1 velocity)) + (rigid-body-method-17 (-> this rbody) (-> s2-1 world-pos) (-> s2-1 velocity)) (set-vector! s3-0 (cos f30-1) 0.0 (sin f30-1) 1.0) ) (vector-rotate*! s3-0 s3-0 s4-0) @@ -599,44 +599,44 @@ s3-0 (* -1.0 (-> *BALLOONLURKER-bank* rudder-factor) (vector-dot s3-0 (-> s2-1 velocity))) ) - (rigid-body-method-13 (-> obj rbody) (-> s2-1 world-pos) s5-0) + (rigid-body-method-13 (-> this rbody) (-> s2-1 world-pos) s5-0) ) 0 - (let ((s3-1 (-> obj control-point-array data 5))) + (let ((s3-1 (-> this control-point-array data 5))) (vector-matrix*! (-> s3-1 world-pos) (-> s3-1 local-pos) s4-0) (set! (-> s3-1 world-pos quad) (-> s3-1 world-pos quad)) - (vector-float*! s5-0 (-> s4-0 vector 2) (-> obj engine-thrust)) - (rigid-body-method-13 (-> obj rbody) (-> s3-1 world-pos) s5-0) + (vector-float*! s5-0 (-> s4-0 vector 2) (-> this engine-thrust)) + (rigid-body-method-13 (-> this rbody) (-> s3-1 world-pos) s5-0) ) ) (dotimes (s4-1 2) - (when (-> obj mine s4-1 enable) - (let ((v1-43 (-> obj control-point-array data (if (zero? s4-1) - 5 - 4 - ) + (when (-> this mine s4-1 enable) + (let ((v1-43 (-> this control-point-array data (if (zero? s4-1) + 5 + 4 + ) ) ) ) (vector-float*! s5-0 *y-vector* (-> *BALLOONLURKER-bank* mine-weight)) - (rigid-body-method-13 (-> obj rbody) (-> v1-43 world-pos) s5-0) + (rigid-body-method-13 (-> this rbody) (-> v1-43 world-pos) s5-0) ) ) ) (vector-float*! s5-0 *y-vector* - (* -1.0 (-> obj info gravity-factor) (-> obj info gravity) (-> obj rbody mass)) + (* -1.0 (-> this info gravity-factor) (-> this info gravity) (-> this rbody mass)) ) - (rigid-body-method-15 (-> obj rbody) s5-0) + (rigid-body-method-15 (-> this rbody) s5-0) ) - (when (or (-> obj player-impulse) (-> obj player-contact)) - (set! (-> obj player-impulse) #f) - (rigid-body-method-13 (-> obj rbody) (-> obj player-force-position) (-> obj player-force)) + (when (or (-> this player-impulse) (-> this player-contact)) + (set! (-> this player-impulse) #f) + (rigid-body-method-13 (-> this rbody) (-> this player-force-position) (-> this player-force)) ) - (when (-> obj explosion) - (set! (-> obj explosion) #f) - (rigid-body-method-13 (-> obj rbody) (-> obj explosion-force-position) (-> obj explosion-force)) + (when (-> this explosion) + (set! (-> this explosion) #f) + (rigid-body-method-13 (-> this rbody) (-> this explosion-force-position) (-> this explosion-force)) ) 0 (none) @@ -710,7 +710,7 @@ (seek! (-> self rudder-control) (fmax -1.0 (fmin 1.0 (/ f2-2 (fmax 4096.0 f0-4)))) - (* 4.0 (-> *display* seconds-per-frame)) + (* 4.0 (seconds-per-frame)) ) ) (let ((f0-12 0.0) @@ -725,11 +725,11 @@ ) (else (let ((f0-14 (analog-input (the-as int (-> *cpad-list* cpads 1 leftx)) 128.0 48.0 110.0 -1.0))) - (seek! (-> self rudder-control) f0-14 (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self rudder-control) f0-14 (* 2.0 (seconds-per-frame))) ) (if (cpad-hold? 1 x) - (seek! (-> self throttle-control) 1.0 (-> *display* seconds-per-frame)) - (seek! (-> self throttle-control) 0.0 (* 0.25 (-> *display* seconds-per-frame))) + (seek! (-> self throttle-control) 1.0 (seconds-per-frame)) + (seek! (-> self throttle-control) 0.0 (* 0.25 (seconds-per-frame))) ) ) ) @@ -834,7 +834,7 @@ (defstate balloonlurker-die (balloonlurker) :event #f :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self vulnerable) #f) (set! (-> self dead) #t) ) @@ -850,8 +850,8 @@ (apply-all (-> self link) actor-link-dead-hook (& sv-16)) (when (and sv-16 sv-24) (process-grab? *target*) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -880,7 +880,7 @@ (until v1-27 (suspend) (ja :num! (loop!)) - (set! v1-27 (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 30)) + (set! v1-27 (or (time-elapsed? (-> self state-time) (seconds 30)) (< 819200.0 (- (-> self root-overlay trans y) (-> self water-y))) ) ) @@ -895,22 +895,22 @@ ;; definition for method 7 of type balloonlurker ;; INFO: Return type mismatch process-drawable vs balloonlurker. -(defmethod relocate balloonlurker ((obj balloonlurker) (arg0 int)) - (if (nonzero? (-> obj propeller)) - (&+! (-> obj propeller) arg0) +(defmethod relocate balloonlurker ((this balloonlurker) (arg0 int)) + (if (nonzero? (-> this propeller)) + (&+! (-> this propeller) arg0) ) - (if (nonzero? (-> obj rudder)) - (&+! (-> obj rudder) arg0) + (if (nonzero? (-> this rudder)) + (&+! (-> this rudder) arg0) ) - (if (nonzero? (-> obj mine 0)) - (&+! (-> obj mine 0) arg0) + (if (nonzero? (-> this mine 0)) + (&+! (-> this mine 0) arg0) ) - (if (nonzero? (-> obj mine 1)) - (&+! (-> obj mine 1) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method balloonlurker 7)) this arg0) ) ) @@ -982,8 +982,8 @@ ;; definition for method 20 of type balloonlurker-pilot ;; INFO: Return type mismatch int vs none. -(defmethod balloonlurker-pilot-method-20 balloonlurker-pilot ((obj balloonlurker-pilot)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod balloonlurker-pilot-method-20 balloonlurker-pilot ((this balloonlurker-pilot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -999,7 +999,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -1007,9 +1007,9 @@ ;; definition for method 21 of type balloonlurker-pilot ;; INFO: Return type mismatch int vs none. -(defmethod balloonlurker-pilot-method-21 balloonlurker-pilot ((obj balloonlurker-pilot)) - (initialize-skeleton obj *balloonlurker-pilot-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 6)) +(defmethod balloonlurker-pilot-method-21 balloonlurker-pilot ((this balloonlurker-pilot)) + (initialize-skeleton this *balloonlurker-pilot-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 6)) 0 (none) ) @@ -1034,8 +1034,8 @@ ;; definition for method 30 of type balloonlurker ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 balloonlurker ((obj balloonlurker)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 balloonlurker ((this balloonlurker)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1083,7 +1083,7 @@ (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -1092,22 +1092,22 @@ ;; definition for method 31 of type balloonlurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 balloonlurker ((obj balloonlurker)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *balloonlurker-sg* '()) - (set! (-> obj root-overlay pause-adjust-distance) 1228800.0) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) +(defmethod rigid-body-platform-method-31 balloonlurker ((this balloonlurker)) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *balloonlurker-sg* '()) + (set! (-> this root-overlay pause-adjust-distance) 1228800.0) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj water-y) (-> obj root-overlay trans y)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) + (set! (-> this water-y) (-> this root-overlay trans y)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this link) (new 'process 'actor-link-info this)) (balloonlurker-find-nearest-path-point) - (balloonlurker-snap-to-path-point (-> obj dest-index)) - (rigid-body-platform-method-29 obj *balloonlurker-constants*) + (balloonlurker-snap-to-path-point (-> this dest-index)) + (rigid-body-platform-method-29 this *balloonlurker-constants*) (dotimes (s5-0 4) - (let ((s4-0 (-> obj control-point-array data s5-0))) + (let ((s4-0 (-> this control-point-array data s5-0))) (let ((f30-0 (* 16384.0 (the float (logand s5-0 3))))) (set! (-> s4-0 local-pos x) (* 24576.0 (cos f30-0))) (set! (-> s4-0 local-pos y) 61440.0) @@ -1116,41 +1116,43 @@ (set! (-> s4-0 local-pos w) 1.0) ) ) - (let ((v1-22 (-> obj control-point-array data 4))) + (let ((v1-22 (-> this control-point-array data 4))) (set! (-> v1-22 local-pos x) 0.0) (set! (-> v1-22 local-pos y) 61440.0) (set! (-> v1-22 local-pos z) -40960.0) (set! (-> v1-22 local-pos w) 1.0) ) - (let ((v1-24 (-> obj control-point-array data 5))) + (let ((v1-24 (-> this control-point-array data 5))) (set! (-> v1-24 local-pos x) 0.0) (set! (-> v1-24 local-pos y) 61440.0) (set! (-> v1-24 local-pos z) 40960.0) (set! (-> v1-24 local-pos w) 1.0) ) - (let ((v1-26 (-> obj control-point-array data 6))) + (let ((v1-26 (-> this control-point-array data 6))) (set! (-> v1-26 local-pos x) 0.0) (set! (-> v1-26 local-pos y) 0.0) (set! (-> v1-26 local-pos z) 0.0) (set! (-> v1-26 local-pos w) 1.0) ) - (set! (-> obj buoyancy-factor) (-> obj info buoyancy-factor)) - (set! (-> obj player-impulse) #f) - (set! (-> obj player-contact) #f) - (set! (-> obj auto-pilot) #t) - (set! (-> obj vulnerable) #t) - (set! (-> obj dead) #f) - (set! (-> obj explosion) #f) - (set! (-> obj propeller) (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :z -1.0 :w 1.0) 8192.0)) - (set! (-> obj rudder) (new 'process 'joint-mod-set-local obj 12 #f #t #f)) - (set! (-> obj mine 0) (new 'process 'joint-mod-set-world obj 8 #f)) - (set! (-> obj mine 1) (new 'process 'joint-mod-set-world obj 5 #f)) - (set! (-> obj explosion-joint-index-bytes 0) 10) - (set! (-> obj explosion-joint-index-bytes 1) 7) - (set! (-> obj engine-sound-id) (new 'static 'sound-id)) - (set! (-> obj pedal-sound-id) (new 'static 'sound-id)) - (set! (-> obj player-force quad) (-> *null-vector* quad)) - (set! (-> obj player-velocity quad) (-> *null-vector* quad)) + (set! (-> this buoyancy-factor) (-> this info buoyancy-factor)) + (set! (-> this player-impulse) #f) + (set! (-> this player-contact) #f) + (set! (-> this auto-pilot) #t) + (set! (-> this vulnerable) #t) + (set! (-> this dead) #f) + (set! (-> this explosion) #f) + (set! (-> this propeller) + (new 'process 'joint-mod-spinner this 4 (new 'static 'vector :z -1.0 :w 1.0) 8192.0) + ) + (set! (-> this rudder) (new 'process 'joint-mod-set-local this 12 #f #t #f)) + (set! (-> this mine 0) (new 'process 'joint-mod-set-world this 8 #f)) + (set! (-> this mine 1) (new 'process 'joint-mod-set-world this 5 #f)) + (set! (-> this explosion-joint-index-bytes 0) 10) + (set! (-> this explosion-joint-index-bytes 1) 7) + (set! (-> this engine-sound-id) (new 'static 'sound-id)) + (set! (-> this pedal-sound-id) (new 'static 'sound-id)) + (set! (-> this player-force quad) (-> *null-vector* quad)) + (set! (-> this player-velocity quad) (-> *null-vector* quad)) 0 (none) ) @@ -1158,20 +1160,20 @@ ;; definition for method 11 of type balloonlurker ;; INFO: Return type mismatch object vs none. ;; WARN: Function (method 11 balloonlurker) has a return type of none, but the expression builder found a return statement. -(defmethod init-from-entity! balloonlurker ((obj balloonlurker) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) +(defmethod init-from-entity! balloonlurker ((this balloonlurker) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) (cond - ((logtest? (-> (entity-actor-lookup (-> obj entity) 'alt-actor 0) extra perm status) + ((logtest? (-> (entity-actor-lookup (-> this entity) 'alt-actor 0) extra perm status) (entity-perm-status complete) ) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (return #f) ) (else - (process-spawn balloonlurker-pilot obj :to obj) + (process-spawn balloonlurker-pilot this :to this) (go balloonlurker-patrol) ) ) diff --git a/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc index 74fba02f6d..874fc94987 100644 --- a/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/bonelurker_REF.gc @@ -15,12 +15,12 @@ ) ;; definition for method 3 of type bonelurker -(defmethod inspect bonelurker ((obj bonelurker)) +(defmethod inspect bonelurker ((this bonelurker)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbump-player-time: ~D~%" (-> obj bump-player-time)) - obj + (format #t "~T~Tbump-player-time: ~D~%" (-> this bump-player-time)) + this ) ;; failed to figure out what this is: @@ -48,16 +48,16 @@ ;; definition for method 44 of type bonelurker ;; INFO: Return type mismatch symbol vs object. -(defmethod touch-handler bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) - (when (and (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) +(defmethod touch-handler bonelurker ((this bonelurker) (arg0 process) (arg1 event-message-block)) + (when (and (logtest? (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) ) (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (set! (-> obj speed-scale) 0.5) + (set! (-> this speed-scale) 0.5) #t ) ) @@ -65,9 +65,9 @@ ;; definition for method 43 of type bonelurker ;; INFO: Return type mismatch symbol vs object. -(defmethod attack-handler bonelurker ((obj bonelurker) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler bonelurker ((this bonelurker) (arg0 process) (arg1 event-message-block)) (with-pp - (set! (-> obj state-time) (-> *display* base-frame-counter)) + (set-time! (-> this state-time)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) pp) (set! (-> a1-1 num-params) 2) @@ -76,15 +76,15 @@ (set! (-> a1-1 param 1) (the-as uint 2)) (cond ((or (send-event-function *target* a1-1) (= (-> arg1 param 1) 'explode)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj nav-enemy-die)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this nav-enemy-die)) 'die ) (else (cond (((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 2) ) (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) @@ -93,21 +93,21 @@ ) ((and ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) - (= (-> obj skel root-channel 0) (-> obj skel channel)) - (let ((v1-30 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (= (-> this skel root-channel 0) (-> this skel channel)) + (let ((v1-30 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (or (= v1-30 (-> obj draw art-group data 9)) (= v1-30 (-> obj draw art-group data 10))) + (or (= v1-30 (-> this draw art-group data 9)) (= v1-30 (-> this draw art-group data 10))) ) ) (send-event arg0 'shove (-> arg1 param 0) (static-attack-info ((shove-back (meters 4))))) - (set! (-> obj bump-player-time) (-> *display* base-frame-counter)) - (logclear! (-> obj nav-enemy-flags) (nav-enemy-flags navenmf6)) + (set-time! (-> this bump-player-time)) + (logclear! (-> this nav-enemy-flags) (nav-enemy-flags navenmf6)) 'push ) ) @@ -122,7 +122,7 @@ (defbehavior bonelurker-stunned-event-handler bonelurker ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('attack) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (nav-enemy-set-hit-from-direction arg0) (send-event arg0 'get-attack-count 1) (logclear! (-> self mask) (process-mask actor-pause)) @@ -204,7 +204,7 @@ nav-enemy-default-event-handler :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) (if (and (not (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf6))) - (>= (- (-> *display* base-frame-counter) (-> self bump-player-time)) (seconds 0.5)) + (time-elapsed? (-> self bump-player-time) (seconds 0.5)) ) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6)) ) @@ -471,8 +471,8 @@ nav-enemy-default-event-handler ;; definition for method 47 of type bonelurker ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision bonelurker ((obj bonelurker)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision bonelurker ((this bonelurker)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -512,7 +512,7 @@ nav-enemy-default-event-handler (set! (-> s5-0 nav-radius) 8192.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -520,12 +520,12 @@ nav-enemy-default-event-handler ;; definition for method 48 of type bonelurker ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 bonelurker ((obj bonelurker)) - (initialize-skeleton obj *bonelurker-sg* '()) - (init-defaults! obj *bonelurker-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 bonelurker ((this bonelurker)) + (initialize-skeleton this *bonelurker-sg* '()) + (init-defaults! this *bonelurker-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) 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 6d4d736b40..7a65302368 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-conveyor_REF.gc @@ -62,13 +62,13 @@ ) ;; definition for method 3 of type keg-conveyor -(defmethod inspect keg-conveyor ((obj keg-conveyor)) +(defmethod inspect keg-conveyor ((this keg-conveyor)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpivot: ~A~%" (-> obj pivot)) - (format #t "~T~Tquat: #~%" (-> obj quat)) - obj + (format #t "~T~Tpivot: ~A~%" (-> this pivot)) + (format #t "~T~Tquat: #~%" (-> this quat)) + this ) ;; definition of type keg-conveyor-paddle @@ -87,13 +87,13 @@ ) ;; definition for method 3 of type keg-conveyor-paddle -(defmethod inspect keg-conveyor-paddle ((obj keg-conveyor-paddle)) +(defmethod inspect keg-conveyor-paddle ((this keg-conveyor-paddle)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tobject-on-paddle: #x~X~%" (-> obj object-on-paddle)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - obj + (format #t "~T~Tobject-on-paddle: #x~X~%" (-> this object-on-paddle)) + (format #t "~T~Tsync: #~%" (-> this sync)) + this ) ;; definition of type keg @@ -120,17 +120,17 @@ ) ;; definition for method 3 of type keg -(defmethod inspect keg ((obj keg)) +(defmethod inspect keg ((this keg)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync-offset: ~f~%" (-> obj sync-offset)) - (format #t "~T~Tkeg-behavior: ~D~%" (-> obj keg-behavior)) - (format #t "~T~Tpath-position: #~%" (-> obj path-position)) - (format #t "~T~Tshadow-enable-plane: #~%" (-> obj shadow-enable-plane)) - (format #t "~T~Tsmush: #~%" (-> obj smush)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - obj + (format #t "~T~Tsync-offset: ~f~%" (-> this sync-offset)) + (format #t "~T~Tkeg-behavior: ~D~%" (-> this keg-behavior)) + (format #t "~T~Tpath-position: #~%" (-> this path-position)) + (format #t "~T~Tshadow-enable-plane: #~%" (-> this shadow-enable-plane)) + (format #t "~T~Tsmush: #~%" (-> this smush)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + this ) ;; failed to figure out what this is: @@ -219,7 +219,7 @@ (vector<-cspace! (-> self root-override trans) gp-0) ) (set! (-> self path-position quad) (-> self root-override trans quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (suspend) ) ) @@ -244,10 +244,10 @@ 0.0 (forward-up-nopitch->quaternion s3-0 a1-3 (new 'static 'vector :y 1.0 :w 1.0)) (loop - (if (>= (the float (- (-> *display* base-frame-counter) (-> self state-time))) f30-0) + (if (>= (the float (- (current-time) (-> self state-time))) f30-0) (go keg-on-path) ) - (let ((f28-0 (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) f30-0))) + (let ((f28-0 (/ (the float (- (current-time) (-> self state-time))) f30-0))) (vector-lerp! (-> self root-override trans) gp-0 s5-0 f28-0) (set! (-> self path-position quad) (-> self root-override trans quad)) (quaternion-slerp! (-> self root-override quat) s4-0 s3-0 f28-0) @@ -338,8 +338,8 @@ (set! f22-0 (/ f0-32 f20-0)) ) ) - (set! sv-64 (+ sv-64 (* sv-80 (-> *display* seconds-per-frame)))) - (set! sv-48 (+ sv-48 (* sv-64 (-> *display* seconds-per-frame)))) + (set! sv-64 (+ sv-64 (* sv-80 (seconds-per-frame)))) + (set! sv-48 (+ sv-48 (* sv-64 (seconds-per-frame)))) (when (< sv-48 0.0) (set! sv-48 0.0) (activate! (-> self smush) -0.15 90 150 1.0 1.0) @@ -398,15 +398,15 @@ 0 (clear-collide-with-as (-> self root-override)) (vector-normalize! gp-0 1.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (go keg-die) ) (let ((v1-23 (-> self root-override trans))) - (vector-float*! s5-0 gp-0 (* f30-0 (-> *display* seconds-per-frame))) - (set! (-> s5-0 y) (* f28-0 (-> *display* seconds-per-frame))) - (+! f28-0 (* f26-0 (-> *display* seconds-per-frame))) + (vector-float*! s5-0 gp-0 (* f30-0 (seconds-per-frame))) + (set! (-> s5-0 y) (* f28-0 (seconds-per-frame))) + (+! f28-0 (* f26-0 (seconds-per-frame))) (vector+! v1-23 v1-23 s5-0) ) (ja :num! (loop!)) @@ -613,13 +613,13 @@ ;; definition for method 7 of type keg-conveyor ;; INFO: Return type mismatch process-drawable vs keg-conveyor. -(defmethod relocate keg-conveyor ((obj keg-conveyor) (arg0 int)) - (if (nonzero? (-> obj pivot)) - (&+! (-> obj pivot) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method keg-conveyor 7)) this arg0) ) ) @@ -627,30 +627,30 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. ;; WARN: Function (method 11 keg-conveyor) has a return type of none, but the expression builder found a return statement. -(defmethod init-from-entity! keg-conveyor ((obj keg-conveyor) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy death)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *keg-conveyor-sg* '()) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (when (logtest? (-> obj path flags) (path-control-flag not-found)) +(defmethod init-from-entity! keg-conveyor ((this keg-conveyor) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy death)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *keg-conveyor-sg* '()) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (when (logtest? (-> this path flags) (path-control-flag not-found)) (go process-drawable-art-error "path") (return #f) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj pivot) (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :x 1.0 :w 1.0) 65536.0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this pivot) (new 'process 'joint-mod-spinner this 4 (new 'static 'vector :x 1.0 :w 1.0) 65536.0)) (let ((s5-1 (new-stack-vector0))) (let ((s4-0 (new-stack-matrix0))) - (path-control-method-12 (-> obj path) s5-1 0.0) - (set-heading-vec! (-> obj root) s5-1) - (quaternion->matrix s4-0 (-> obj root quat)) + (path-control-method-12 (-> this path) s5-1 0.0) + (set-heading-vec! (-> this root) s5-1) + (quaternion->matrix s4-0 (-> this root quat)) (set-vector! s5-1 -4096.0 -3072.0 -1433.6 1.0) (vector-rotate*! s5-1 s5-1 s4-0) ) - (vector+! (-> obj root trans) (-> obj root trans) s5-1) + (vector+! (-> this root trans) (-> this root trans) s5-1) ) - (process-spawn keg-conveyor-paddle obj :to obj) + (process-spawn keg-conveyor-paddle this :to this) (go keg-conveyor-idle) (none) ) 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 b4cd85f5c5..9df7fb3fb8 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-obs_REF.gc @@ -1055,11 +1055,11 @@ ) ;; definition for method 3 of type boatpaddle -(defmethod inspect boatpaddle ((obj boatpaddle)) +(defmethod inspect boatpaddle ((this boatpaddle)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1073,11 +1073,7 @@ :code (behavior () (local-vars (s4-0 int)) (loop - (quaternion-rotate-local-x! - (-> self root quat) - (-> self root quat) - (* -5461.3335 (-> *display* seconds-per-frame)) - ) + (quaternion-rotate-local-x! (-> self root quat) (-> self root quat) (* -5461.3335 (seconds-per-frame))) (let ((gp-0 (-> self part)) (s5-0 (-> self root trans)) ) @@ -1099,13 +1095,13 @@ ;; definition for method 11 of type boatpaddle ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! boatpaddle ((obj boatpaddle) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *boatpaddle-sg* '()) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 196) obj)) +(defmethod init-from-entity! boatpaddle ((this boatpaddle) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *boatpaddle-sg* '()) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 196) this)) (go boatpaddle-idle) (none) ) @@ -1125,13 +1121,13 @@ ) ;; definition for method 3 of type windturbine -(defmethod inspect windturbine ((obj windturbine)) +(defmethod inspect windturbine ((this windturbine)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspawn-particle-enable: ~A~%" (-> obj spawn-particle-enable)) - (format #t "~T~Tangle-speed: ~f~%" (-> obj angle-speed)) - obj + (format #t "~T~Tspawn-particle-enable: ~A~%" (-> this spawn-particle-enable)) + (format #t "~T~Tangle-speed: ~f~%" (-> this angle-speed)) + this ) ;; failed to figure out what this is: @@ -1158,7 +1154,7 @@ (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) - (* -1.0 (-> *display* seconds-per-frame) (-> self angle-speed)) + (* -1.0 (seconds-per-frame) (-> self angle-speed)) ) (if (-> self spawn-particle-enable) (spawn (-> self part) (-> self root trans)) @@ -1171,16 +1167,16 @@ ;; definition for method 11 of type windturbine ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! windturbine ((obj windturbine) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj spawn-particle-enable) (= (res-lump-value arg0 'particle-select uint128) 1)) - (if (-> obj spawn-particle-enable) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 191) obj)) +(defmethod init-from-entity! windturbine ((this windturbine) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this spawn-particle-enable) (= (res-lump-value arg0 'particle-select uint128) 1)) + (if (-> this spawn-particle-enable) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 191) this)) ) - (initialize-skeleton obj *windturbine-sg* '()) + (initialize-skeleton this *windturbine-sg* '()) (go windturbine-idle) (none) ) @@ -1206,15 +1202,15 @@ ) ;; definition for method 3 of type mis-bone-bridge -(defmethod inspect mis-bone-bridge ((obj mis-bone-bridge)) +(defmethod inspect mis-bone-bridge ((this mis-bone-bridge)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tparticle-group: ~A~%" (-> obj particle-group)) - (format #t "~T~Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - (format #t "~T~Tfall-anim-index: ~D~%" (-> obj fall-anim-index)) - (format #t "~T~Thit-points: ~D~%" (-> obj hit-points)) - obj + (format #t "~T~Tparticle-group: ~A~%" (-> this particle-group)) + (format #t "~T~Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + (format #t "~T~Tfall-anim-index: ~D~%" (-> this fall-anim-index)) + (format #t "~T~Thit-points: ~D~%" (-> this hit-points)) + this ) ;; failed to figure out what this is: @@ -1349,9 +1345,9 @@ ;; definition for method 11 of type mis-bone-bridge ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! mis-bone-bridge ((obj mis-bone-bridge) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! mis-bone-bridge ((this mis-bone-bridge) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1387,36 +1383,36 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *mis-bone-bridge-sg* '()) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *mis-bone-bridge-sg* '()) (let ((v1-40 (res-lump-value arg0 'animation-select uint128))) (cond ((= (the-as uint v1-40) 1) - (set! (-> obj fall-anim-index) 2) - (set! (-> obj particle-group) (-> *part-group-id-table* 192)) + (set! (-> this fall-anim-index) 2) + (set! (-> this particle-group) (-> *part-group-id-table* 192)) ) ((= (the-as uint v1-40) 2) - (set! (-> obj fall-anim-index) 3) - (set! (-> obj particle-group) (-> *part-group-id-table* 194)) + (set! (-> this fall-anim-index) 3) + (set! (-> this particle-group) (-> *part-group-id-table* 194)) ) ((= (the-as uint v1-40) 3) - (set! (-> obj fall-anim-index) 2) - (set! (-> obj particle-group) (-> *part-group-id-table* 193)) + (set! (-> this fall-anim-index) 2) + (set! (-> this particle-group) (-> *part-group-id-table* 193)) ) ((= (the-as uint v1-40) 7) - (set! (-> obj fall-anim-index) 4) - (set! (-> obj particle-group) (-> *part-group-id-table* 195)) + (set! (-> this fall-anim-index) 4) + (set! (-> this particle-group) (-> *part-group-id-table* 195)) ) (else - (set! (-> obj fall-anim-index) 2) - (set! (-> obj particle-group) (-> *part-group-id-table* 192)) + (set! (-> this fall-anim-index) 2) + (set! (-> this particle-group) (-> *part-group-id-table* 192)) ) ) ) - (set! (-> obj hit-points) 3) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this hit-points) 3) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go mis-bone-bridge-fall #t) (go mis-bone-bridge-idle) ) @@ -1443,11 +1439,11 @@ ) ;; definition for method 3 of type breakaway -(defmethod inspect breakaway ((obj breakaway)) +(defmethod inspect breakaway ((this breakaway)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1466,8 +1462,8 @@ ;; definition for function actor-wait-for-period (defun actor-wait-for-period ((arg0 time-frame)) - (let ((s5-0 (-> *display* base-frame-counter))) - (while (< (- (-> *display* base-frame-counter) s5-0) arg0) + (let ((s5-0 (current-time))) + (while (not (time-elapsed? s5-0 arg0)) (suspend) ) ) @@ -1480,16 +1476,16 @@ (sound-play "falling-bones") (launch-particles (-> *part-id-table* 281) (-> self root-override trans)) (let ((gp-1 #f) - (s5-1 (-> *display* base-frame-counter)) + (s5-1 (current-time)) ) (loop (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 15.0 0)) :frame-num (ja-aframe 1.0 0)) (until (ja-done? 0) - (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.15))) + (when (and (not gp-1) (time-elapsed? s5-1 (seconds 0.15))) (set! gp-1 #t) (send-to-next-and-prev (-> self link) 'touch) ) - (if (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.25)) + (if (time-elapsed? s5-1 (seconds 0.25)) (go breakaway-fall) ) (suspend) @@ -1510,8 +1506,8 @@ ) (ja-no-eval :group! (ja-group) :num! (seek! (ja-aframe 32.0 0) 0.4) :frame-num (ja-aframe 16.0 0)) (until (ja-done? 0) - (+! f30-0 (* f28-0 (-> *display* seconds-per-frame))) - (+! f28-0 (* f26-0 (-> *display* seconds-per-frame))) + (+! f30-0 (* f28-0 (seconds-per-frame))) + (+! f28-0 (* f26-0 (seconds-per-frame))) (+! (-> self root-override trans y) f30-0) (suspend) (ja :num! (seek! (ja-aframe 32.0 0) 0.4)) @@ -1523,9 +1519,9 @@ ) ;; definition for method 20 of type breakaway -(defmethod init! breakaway ((obj breakaway) (arg0 res-lump) (arg1 int)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init! breakaway ((this breakaway) (arg0 res-lump) (arg1 int)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1543,16 +1539,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (process-drawable-from-entity! obj (the-as entity-actor arg0)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (process-drawable-from-entity! this (the-as entity-actor arg0)) (none) ) ;; definition for method 21 of type breakaway ;; INFO: Return type mismatch object vs none. -(defmethod go-idle breakaway ((obj breakaway)) +(defmethod go-idle breakaway ((this breakaway)) (go breakaway-idle) (none) ) @@ -1567,11 +1563,11 @@ ) ;; definition for method 3 of type breakaway-right -(defmethod inspect breakaway-right ((obj breakaway-right)) +(defmethod inspect breakaway-right ((this breakaway-right)) (let ((t9-0 (method-of-type breakaway inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type breakaway-mid @@ -1584,11 +1580,11 @@ ) ;; definition for method 3 of type breakaway-mid -(defmethod inspect breakaway-mid ((obj breakaway-mid)) +(defmethod inspect breakaway-mid ((this breakaway-mid)) (let ((t9-0 (method-of-type breakaway inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type breakaway-left @@ -1601,11 +1597,11 @@ ) ;; definition for method 3 of type breakaway-left -(defmethod inspect breakaway-left ((obj breakaway-left)) +(defmethod inspect breakaway-left ((this breakaway-left)) (let ((t9-0 (method-of-type breakaway inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1627,26 +1623,26 @@ ) ;; definition for method 11 of type breakaway-right -(defmethod init-from-entity! breakaway-right ((obj breakaway-right) (arg0 entity-actor)) - (init! obj arg0 3) - (initialize-skeleton obj *breakaway-right-sg* '()) - (go-idle obj) +(defmethod init-from-entity! breakaway-right ((this breakaway-right) (arg0 entity-actor)) + (init! this arg0 3) + (initialize-skeleton this *breakaway-right-sg* '()) + (go-idle this) (none) ) ;; definition for method 11 of type breakaway-mid -(defmethod init-from-entity! breakaway-mid ((obj breakaway-mid) (arg0 entity-actor)) - (init! obj arg0 3) - (initialize-skeleton obj *breakaway-mid-sg* '()) - (go-idle obj) +(defmethod init-from-entity! breakaway-mid ((this breakaway-mid) (arg0 entity-actor)) + (init! this arg0 3) + (initialize-skeleton this *breakaway-mid-sg* '()) + (go-idle this) (none) ) ;; definition for method 11 of type breakaway-left -(defmethod init-from-entity! breakaway-left ((obj breakaway-left) (arg0 entity-actor)) - (init! obj arg0 3) - (initialize-skeleton obj *breakaway-left-sg* '()) - (go-idle obj) +(defmethod init-from-entity! breakaway-left ((this breakaway-left) (arg0 entity-actor)) + (init! this arg0 3) + (initialize-skeleton this *breakaway-left-sg* '()) + (go-idle this) (none) ) @@ -1689,12 +1685,12 @@ ) ;; definition for method 3 of type bone-platform -(defmethod inspect bone-platform ((obj bone-platform)) +(defmethod inspect bone-platform ((this bone-platform)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tanchor-point: #~%" (-> obj anchor-point)) - obj + (format #t "~T~Tanchor-point: #~%" (-> this anchor-point)) + this ) ;; failed to figure out what this is: @@ -1705,16 +1701,16 @@ ;; definition for method 27 of type bone-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-27 bone-platform ((obj bone-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-27 bone-platform ((this bone-platform) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 arg0 (-> obj rbody position)) + (vector-! gp-0 arg0 (-> this rbody position)) (set! (-> gp-0 y) 0.0) (let* ((f0-1 (vector-length gp-0)) (f1-1 (* 20.0 (fmax 0.0 (fmin 4096.0 (+ -819.2 f0-1))))) ) (when (< 0.0 f1-1) (vector-float*! gp-0 gp-0 (/ f1-1 f0-1)) - (rigid-body-method-15 (-> obj rbody) gp-0) + (rigid-body-method-15 (-> this rbody) gp-0) ) ) ) @@ -1724,12 +1720,12 @@ ;; definition for method 23 of type bone-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 bone-platform ((obj bone-platform) (arg0 float)) +(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)) - obj + this (the-as basic arg0) ) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) @@ -1760,14 +1756,14 @@ ) ) (let ((f30-1 -4096.0)) - (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (seconds-per-frame))) ) ) ) @@ -1784,8 +1780,8 @@ ;; definition for method 30 of type bone-platform ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 bone-platform ((obj bone-platform)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 bone-platform ((this bone-platform)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1803,7 +1799,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -1812,16 +1808,16 @@ ;; definition for method 31 of type bone-platform ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 bone-platform ((obj bone-platform)) - (initialize-skeleton obj *mis-bone-platform-sg* '()) - (rigid-body-platform-method-29 obj *bone-platform-constants*) - (set! (-> obj float-height-offset) -4096.0) - (if (name= (-> obj name) "bone-platform-5") - (set-vector! (-> obj root-overlay scale) 0.8 1.0 0.8 1.0) +(defmethod rigid-body-platform-method-31 bone-platform ((this bone-platform)) + (initialize-skeleton this *mis-bone-platform-sg* '()) + (rigid-body-platform-method-29 this *bone-platform-constants*) + (set! (-> this float-height-offset) -4096.0) + (if (name= (-> this name) "bone-platform-5") + (set-vector! (-> this root-overlay scale) 0.8 1.0 0.8 1.0) ) - (let ((s5-0 (-> obj info control-point-count))) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0))))) (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) (set! (-> s3-0 local-pos y) -12288.0) @@ -1831,7 +1827,7 @@ ) ) ) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) 0 (none) ) @@ -1845,35 +1841,35 @@ ) ;; definition for method 3 of type mistycam -(defmethod inspect mistycam ((obj mistycam)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect mistycam ((this mistycam)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; failed to figure out what this is: @@ -1933,11 +1929,11 @@ ) ;; definition for method 3 of type misty-battlecontroller -(defmethod inspect misty-battlecontroller ((obj misty-battlecontroller)) +(defmethod inspect misty-battlecontroller ((this misty-battlecontroller)) (let ((t9-0 (method-of-type battlecontroller inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1959,9 +1955,9 @@ ;; definition for method 27 of type misty-battlecontroller ;; INFO: Return type mismatch int vs none. -(defmethod battlecontroller-method-27 misty-battlecontroller ((obj misty-battlecontroller)) - ((the-as (function battlecontroller none) (find-parent-method misty-battlecontroller 27)) obj) - (set! (-> obj misty-ambush-collision-hack) #t) +(defmethod battlecontroller-method-27 misty-battlecontroller ((this misty-battlecontroller)) + ((the-as (function battlecontroller none) (find-parent-method misty-battlecontroller 27)) this) + (set! (-> this misty-ambush-collision-hack) #t) 0 (none) ) @@ -2025,12 +2021,12 @@ ) ;; definition for method 3 of type boat-fuelcell -(defmethod inspect boat-fuelcell ((obj boat-fuelcell)) +(defmethod inspect boat-fuelcell ((this boat-fuelcell)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tplay-cutscene?: ~A~%" (-> obj play-cutscene?)) - obj + (format #t "~T~Tplay-cutscene?: ~A~%" (-> this play-cutscene?)) + this ) ;; failed to figure out what this is: @@ -2081,12 +2077,12 @@ ;; definition for method 11 of type boat-fuelcell ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! boat-fuelcell ((obj boat-fuelcell) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj play-cutscene?) #f) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) +(defmethod init-from-entity! boat-fuelcell ((this boat-fuelcell) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this play-cutscene?) #f) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go boat-fuelcell-spawn) (go boat-fuelcell-idle) ) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-part_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-part_REF.gc index cd6c2f3b96..7ff60a9ba9 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type misty-part -(defmethod inspect misty-part ((obj misty-part)) +(defmethod inspect misty-part ((this misty-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc index e73811c774..b25515fef8 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-teetertotter_REF.gc @@ -19,14 +19,14 @@ ) ;; definition for method 3 of type teetertotter -(defmethod inspect teetertotter ((obj teetertotter)) +(defmethod inspect teetertotter ((this teetertotter)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tlaunched-player: ~A~%" (-> obj launched-player)) - (format #t "~T~Tin-launch-window: ~A~%" (-> obj in-launch-window)) - (format #t "~T~Trock-is-dangerous: ~A~%" (-> obj rock-is-dangerous)) - obj + (format #t "~T~Tlaunched-player: ~A~%" (-> this launched-player)) + (format #t "~T~Tin-launch-window: ~A~%" (-> this in-launch-window)) + (format #t "~T~Trock-is-dangerous: ~A~%" (-> this rock-is-dangerous)) + this ) ;; failed to figure out what this is: @@ -146,8 +146,8 @@ ;; definition for method 11 of type teetertotter ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! teetertotter ((obj teetertotter) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! teetertotter ((this teetertotter) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -208,13 +208,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *teetertotter-sg* '()) - (set! (-> obj launched-player) #f) - (set! (-> obj in-launch-window) #f) - (set! (-> obj rock-is-dangerous) #f) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *teetertotter-sg* '()) + (set! (-> this launched-player) #f) + (set! (-> this in-launch-window) #f) + (set! (-> this rock-is-dangerous) #f) (go teetertotter-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc b/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc index c3b4bd26d9..38cbe9d288 100644 --- a/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/misty-warehouse_REF.gc @@ -18,13 +18,13 @@ ) ;; definition for method 3 of type silostep -(defmethod inspect silostep ((obj silostep)) +(defmethod inspect silostep ((this silostep)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tanim-limit: ~f~%" (-> obj anim-limit)) - (format #t "~T~Tcam-tracker: ~D~%" (-> obj cam-tracker)) - obj + (format #t "~T~Tanim-limit: ~f~%" (-> this anim-limit)) + (format #t "~T~Tcam-tracker: ~D~%" (-> this cam-tracker)) + this ) ;; failed to figure out what this is: @@ -68,8 +68,8 @@ (suspend) ) (camera-change-to "camera-160" 150 #f) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 3)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 3)) (suspend) ) ) @@ -95,9 +95,9 @@ ) (save-reminder gp-0 (logior v1-1 2) 0) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 1)) + (set-time! (-> self state-time)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -133,9 +133,9 @@ ;; definition for method 11 of type silostep ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! silostep ((obj silostep) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask movie-subject)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! silostep ((this silostep) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask movie-subject)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -153,17 +153,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *silostep-sg* '()) - (set! (-> obj anim-limit) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *silostep-sg* '()) + (set! (-> this anim-limit) (* (res-lump-float arg0 'distance :default 1.0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this link) (new 'process 'actor-link-info this)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go silostep-rise #t) (go silostep-idle) ) @@ -186,17 +186,17 @@ ) ;; definition for method 3 of type rounddoor -(defmethod inspect rounddoor ((obj rounddoor)) +(defmethod inspect rounddoor ((this rounddoor)) (let ((t9-0 (method-of-type eco-door inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 24 of type rounddoor ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 rounddoor ((obj rounddoor)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod eco-door-method-24 rounddoor ((this rounddoor)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -208,7 +208,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -217,18 +217,18 @@ ;; definition for method 25 of type rounddoor ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 rounddoor ((obj rounddoor)) - (initialize-skeleton obj *rounddoor-sg* '()) - (set! (-> obj open-distance) 69632.0) - (set! (-> obj close-distance) 81920.0) - (set! (-> obj open-sound) (static-sound-name "arenadoor-open")) - (set! (-> obj close-sound) (static-sound-name "arenadoor-close")) - (set! (-> obj speed) 1.5) - (set! (-> obj auto-close) #t) - (set! (-> obj one-way) #t) - (vector-x-quaternion! (-> obj out-dir) (-> obj root-override quat)) - (set! (-> obj out-dir w) (- 8192.0 (vector-dot (-> obj out-dir) (-> obj root-override trans)))) - (update-transforms! (-> obj root-override)) +(defmethod eco-door-method-25 rounddoor ((this rounddoor)) + (initialize-skeleton this *rounddoor-sg* '()) + (set! (-> this open-distance) 69632.0) + (set! (-> this close-distance) 81920.0) + (set! (-> this open-sound) (static-sound-name "arenadoor-open")) + (set! (-> this close-sound) (static-sound-name "arenadoor-close")) + (set! (-> this speed) 1.5) + (set! (-> this auto-close) #t) + (set! (-> this one-way) #t) + (vector-x-quaternion! (-> this out-dir) (-> this root-override quat)) + (set! (-> this out-dir w) (- 8192.0 (vector-dot (-> this out-dir) (-> this root-override trans)))) + (update-transforms! (-> this root-override)) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc index 57bf5c9b67..fc32b80141 100644 --- a/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/mistycannon_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type angle-tracker -(defmethod inspect angle-tracker ((obj angle-tracker)) - (format #t "[~8x] ~A~%" obj 'angle-tracker) - (format #t "~Tvalue: ~f~%" (-> obj value)) - (format #t "~Tmin: ~f~%" (-> obj min)) - (format #t "~Trange: ~f~%" (-> obj range)) - (format #t "~Tspeed: ~f~%" (-> obj speed)) - obj +(defmethod inspect angle-tracker ((this angle-tracker)) + (format #t "[~8x] ~A~%" this 'angle-tracker) + (format #t "~Tvalue: ~f~%" (-> this value)) + (format #t "~Tmin: ~f~%" (-> this min)) + (format #t "~Trange: ~f~%" (-> this range)) + (format #t "~Tspeed: ~f~%" (-> this speed)) + this ) ;; definition for function angle-tracker-apply-move! (defun angle-tracker-apply-move! ((arg0 angle-tracker) (arg1 float)) - (let* ((f0-2 (* arg1 (-> arg0 speed) (-> *display* seconds-per-frame))) + (let* ((f0-2 (* arg1 (-> arg0 speed) (seconds-per-frame))) (f0-3 (+ (-> arg0 value) f0-2)) ) (when (!= (-> arg0 range) 0.0) @@ -85,7 +85,7 @@ (defun angle-tracker-seek! ((arg0 angle-tracker) (arg1 float)) (let* ((v1-0 arg0) (f1-1 (the float (sar (shl (the int (+ (-> v1-0 min) (-> v1-0 value))) 48) 48))) - (f0-6 (* (-> arg0 speed) (-> *display* seconds-per-frame))) + (f0-6 (* (-> arg0 speed) (seconds-per-frame))) (v1-9 (the float (sar (shl (the int (- arg1 f1-1)) 48) 48))) ) (when (< (fabs v1-9) f0-6) @@ -661,35 +661,35 @@ ) ;; definition for method 3 of type mistycannon-missile -(defmethod inspect mistycannon-missile ((obj mistycannon-missile)) +(defmethod inspect mistycannon-missile ((this mistycannon-missile)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmuzzle-time: ~f~%" (-> obj muzzle-time)) - (format #t "~T~Ttumble-quat: #~%" (-> obj tumble-quat)) - (format #t "~T~Tblast-radius: ~f~%" (-> obj blast-radius)) - (format #t "~T~Twater-height: ~f~%" (-> obj water-height)) - (format #t "~T~Tsfx: ~D~%" (-> obj sfx)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tground-time: ~D~%" (-> obj ground-time)) - obj + (format #t "~T~Tmuzzle-time: ~f~%" (-> this muzzle-time)) + (format #t "~T~Ttumble-quat: #~%" (-> this tumble-quat)) + (format #t "~T~Tblast-radius: ~f~%" (-> this blast-radius)) + (format #t "~T~Twater-height: ~f~%" (-> this water-height)) + (format #t "~T~Tsfx: ~D~%" (-> this sfx)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tground-time: ~D~%" (-> this ground-time)) + this ) ;; definition for method 7 of type mistycannon-missile ;; INFO: Return type mismatch process-drawable vs mistycannon-missile. -(defmethod relocate mistycannon-missile ((obj mistycannon-missile) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate mistycannon-missile ((this mistycannon-missile) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as mistycannon-missile ((method-of-type process-drawable relocate) obj arg0)) + (the-as mistycannon-missile ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type mistycannon-missile -(defmethod deactivate mistycannon-missile ((obj mistycannon-missile)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate mistycannon-missile ((this mistycannon-missile)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -701,9 +701,9 @@ ;; definition for method 20 of type mistycannon-missile ;; INFO: Return type mismatch int vs none. -(defmethod spawn-part mistycannon-missile ((obj mistycannon-missile)) - (let ((gp-0 (-> obj part)) - (a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7))) +(defmethod spawn-part mistycannon-missile ((this mistycannon-missile)) + (let ((gp-0 (-> this part)) + (a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7))) ) (spawn gp-0 a1-1) ) @@ -721,7 +721,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self sfx) (the-as uint 0)) 0 ) @@ -732,14 +732,15 @@ ) :code (behavior () (clear-collide-with-as (-> self root-override)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self muzzle-time)))) + (while (not (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self muzzle-time))))) (quaternion*! (-> self root-override quat) (-> self root-override quat) (-> self tumble-quat)) (suspend) - (let ((f0-1 (fmin 1.0 (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) - (the float (the int (* 300.0 (-> self muzzle-time)))) - ) - ) - ) + (let ((f0-1 + (fmin + 1.0 + (/ (the float (- (current-time) (-> self state-time))) (the float (the int (* 300.0 (-> self muzzle-time))))) + ) + ) ) (set! (-> self root-override scale x) (* 0.6 f0-1)) (set! (-> self root-override scale y) (* 0.6 f0-1)) @@ -790,7 +791,7 @@ (set! (-> self sfx) (the-as uint 0)) 0 ) - (set! (-> self ground-time) (-> *display* base-frame-counter)) + (set-time! (-> self ground-time)) (sound-play "sack-land" :position (the-as symbol (-> self root-override trans))) (ja-no-eval :group! sack-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -961,8 +962,8 @@ ) (suspend) (clear-collide-with-as (-> self root-override)) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 3)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 3)) (spawn (-> self part2) (-> self root-override trans)) (suspend) ) @@ -1010,15 +1011,15 @@ ) ;; definition for method 3 of type mistycannon-init-data -(defmethod inspect mistycannon-init-data ((obj mistycannon-init-data)) - (format #t "[~8x] ~A~%" obj 'mistycannon-init-data) - (format #t "~Tpos: #~%" (-> obj pos)) - (format #t "~Tvel: #~%" (-> obj vel)) - (format #t "~Trotate: ~f~%" (-> obj rotate)) - (format #t "~Tflight-time: ~f~%" (-> obj flight-time)) - (format #t "~Tmuzzle-time: ~f~%" (-> obj muzzle-time)) - (format #t "~Tblast-radius: ~f~%" (-> obj blast-radius)) - obj +(defmethod inspect mistycannon-init-data ((this mistycannon-init-data)) + (format #t "[~8x] ~A~%" this 'mistycannon-init-data) + (format #t "~Tpos: #~%" (-> this pos)) + (format #t "~Tvel: #~%" (-> this vel)) + (format #t "~Trotate: ~f~%" (-> this rotate)) + (format #t "~Tflight-time: ~f~%" (-> this flight-time)) + (format #t "~Tmuzzle-time: ~f~%" (-> this muzzle-time)) + (format #t "~Tblast-radius: ~f~%" (-> this blast-radius)) + this ) ;; definition for function mistycannon-missile-init-by-other @@ -1133,29 +1134,29 @@ ) ;; definition for method 3 of type mistycannon -(defmethod inspect mistycannon ((obj mistycannon)) +(defmethod inspect mistycannon ((this mistycannon)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Trotate: #~%" (-> obj rotate)) - (format #t "~T~Ttilt: #~%" (-> obj tilt)) - (format #t "~T~Tfront-wheel: ~f~%" (-> obj front-wheel)) - (format #t "~T~Trear-wheel: ~f~%" (-> obj rear-wheel)) - (format #t "~T~Tlast-known-rotation: ~f~%" (-> obj last-known-rotation)) - (format #t "~T~Tpart-timer: ~D~%" (-> obj part-timer)) - (format #t "~T~Thellmouth: #~%" (-> obj hellmouth)) - (format #t "~T~Tpostbindinfo-ok: ~A~%" (-> obj postbindinfo-ok)) - (format #t "~T~Tlaunch-origin: #~%" (-> obj launch-origin)) - (format #t "~T~Tgoggles: #~%" (-> obj goggles)) - (format #t "~T~Tavoid-entity: ~A~%" (-> obj avoid-entity)) - (format #t "~T~Tcenter-point: #~%" (-> obj center-point)) - (format #t "~T~Tat-point: #~%" (-> obj at-point)) - (format #t "~T~Taccuracy-range: ~f~%" (-> obj accuracy-range)) - (format #t "~T~Ttarget-theta: ~f~%" (-> obj target-theta)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~T~Taim-sound-id: ~D~%" (-> obj aim-sound-id)) - (format #t "~T~Tplayer-touching-grips?: ~A~%" (-> obj player-touching-grips?)) - obj + (format #t "~T~Trotate: #~%" (-> this rotate)) + (format #t "~T~Ttilt: #~%" (-> this tilt)) + (format #t "~T~Tfront-wheel: ~f~%" (-> this front-wheel)) + (format #t "~T~Trear-wheel: ~f~%" (-> this rear-wheel)) + (format #t "~T~Tlast-known-rotation: ~f~%" (-> this last-known-rotation)) + (format #t "~T~Tpart-timer: ~D~%" (-> this part-timer)) + (format #t "~T~Thellmouth: #~%" (-> this hellmouth)) + (format #t "~T~Tpostbindinfo-ok: ~A~%" (-> this postbindinfo-ok)) + (format #t "~T~Tlaunch-origin: #~%" (-> this launch-origin)) + (format #t "~T~Tgoggles: #~%" (-> this goggles)) + (format #t "~T~Tavoid-entity: ~A~%" (-> this avoid-entity)) + (format #t "~T~Tcenter-point: #~%" (-> this center-point)) + (format #t "~T~Tat-point: #~%" (-> this at-point)) + (format #t "~T~Taccuracy-range: ~f~%" (-> this accuracy-range)) + (format #t "~T~Ttarget-theta: ~f~%" (-> this target-theta)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~T~Taim-sound-id: ~D~%" (-> this aim-sound-id)) + (format #t "~T~Tplayer-touching-grips?: ~A~%" (-> this player-touching-grips?)) + this ) ;; definition for function mistycannon-pick-random-target-point @@ -1175,16 +1176,16 @@ ;; definition for method 20 of type mistycannon ;; INFO: Return type mismatch int vs none. -(defmethod rotate! mistycannon ((obj mistycannon) (arg0 float)) - (angle-tracker-apply-move! (-> obj rotate) arg0) +(defmethod rotate! mistycannon ((this mistycannon) (arg0 float)) + (angle-tracker-apply-move! (-> this rotate) arg0) 0 (none) ) ;; definition for method 21 of type mistycannon ;; INFO: Return type mismatch int vs none. -(defmethod tilt! mistycannon ((obj mistycannon) (arg0 float)) - (angle-tracker-apply-move! (-> obj tilt) arg0) +(defmethod tilt! mistycannon ((this mistycannon) (arg0 float)) + (angle-tracker-apply-move! (-> this tilt) arg0) 0 (none) ) @@ -1192,15 +1193,15 @@ ;; definition for method 22 of type mistycannon ;; INFO: Return type mismatch int vs none. ;; WARN: Function (method 22 mistycannon) has a return type of none, but the expression builder found a return statement. -(defmethod mistycannon-method-22 mistycannon ((obj mistycannon) (arg0 float) (arg1 float) (arg2 float)) - (if (not (-> obj postbindinfo-ok)) +(defmethod mistycannon-method-22 mistycannon ((this mistycannon) (arg0 float) (arg1 float) (arg2 float)) + (if (not (-> this postbindinfo-ok)) (return #f) ) - (let* ((s3-0 (-> obj launch-origin)) + (let* ((s3-0 (-> this launch-origin)) (s2-0 (new 'stack-no-clear 'vector)) - (v1-3 (-> obj rotate)) + (v1-3 (-> this rotate)) (f30-0 (the float (sar (shl (the int (+ (-> v1-3 min) (-> v1-3 value))) 48) 48))) - (v1-8 (-> obj tilt)) + (v1-8 (-> this tilt)) (f26-0 (the float (sar (shl (the int (+ (-> v1-8 min) (-> v1-8 value))) 48) 48))) (f28-0 (/ 24576.0 arg0)) ) @@ -1209,13 +1210,13 @@ (set! (-> s2-0 z) (* arg0 f24-0 (cos f30-0))) ) (set! (-> s2-0 y) (* arg0 (sin f26-0))) - (vector-float*! (-> obj hellmouth) s2-0 f28-0) - (vector+! (-> obj hellmouth) (-> obj hellmouth) s3-0) - (spawn-mistycannon-missile obj s3-0 s2-0 f30-0 arg1 f28-0 arg2 (-> obj entity)) + (vector-float*! (-> this hellmouth) s2-0 f28-0) + (vector+! (-> this hellmouth) (-> this hellmouth) s3-0) + (spawn-mistycannon-missile this s3-0 s2-0 f30-0 arg1 f28-0 arg2 (-> this entity)) ) (sound-play "cannon-shot") - (set! (-> obj part local-clock) 0) - (set! (-> obj part-timer) (-> *display* base-frame-counter)) + (set! (-> this part local-clock) 0) + (set-time! (-> this part-timer)) (mistycannon-pick-random-target-point) 0 (none) @@ -1223,45 +1224,45 @@ ;; definition for method 23 of type mistycannon ;; INFO: Return type mismatch int vs none. -(defmethod mistycannon-method-23 mistycannon ((obj mistycannon)) - (when (< (- (-> *display* base-frame-counter) (-> obj part-timer)) (seconds 3)) - (let ((v1-4 (-> obj rotate))) +(defmethod mistycannon-method-23 mistycannon ((this mistycannon)) + (when (not (time-elapsed? (-> this part-timer) (seconds 3))) + (let ((v1-4 (-> this rotate))) (set! (-> *part-id-table* 529 init-specs 24 initial-valuef) (the float (sar (shl (the int (+ (-> v1-4 min) (-> v1-4 value))) 48) 48)) ) ) - (let ((v1-12 (-> obj rotate))) + (let ((v1-12 (-> this rotate))) (set! (-> *part-id-table* 530 init-specs 23 initial-valuef) (the float (sar (shl (the int (+ (-> v1-12 min) (-> v1-12 value))) 48) 48)) ) ) - (let ((v1-20 (-> obj rotate))) + (let ((v1-20 (-> this rotate))) (set! (-> *part-id-table* 534 init-specs 21 initial-valuef) (the float (sar (shl (the int (+ (-> v1-20 min) (-> v1-20 value))) 48) 48)) ) ) (let ((f0-18 16384.0) - (v1-28 (-> obj tilt)) + (v1-28 (-> this tilt)) ) (set! (-> *part-id-table* 529 init-specs 22 initial-valuef) (- f0-18 (the float (sar (shl (the int (+ (-> v1-28 min) (-> v1-28 value))) 48) 48))) ) ) (let ((f0-20 16384.0) - (v1-36 (-> obj tilt)) + (v1-36 (-> this tilt)) ) (set! (-> *part-id-table* 530 init-specs 21 initial-valuef) (- f0-20 (the float (sar (shl (the int (+ (-> v1-36 min) (-> v1-36 value))) 48) 48))) ) ) (let ((f0-22 16384.0) - (v1-44 (-> obj tilt)) + (v1-44 (-> this tilt)) ) (set! (-> *part-id-table* 534 init-specs 20 initial-valuef) (- f0-22 (the float (sar (shl (the int (+ (-> v1-44 min) (-> v1-44 value))) 48) 48))) ) ) - (spawn (-> obj part) (-> obj hellmouth)) + (spawn (-> this part) (-> this hellmouth)) ) 0 (none) @@ -1379,11 +1380,11 @@ ) ;; definition for method 3 of type quadratic-solution -(defmethod inspect quadratic-solution ((obj quadratic-solution)) - (format #t "[~8x] ~A~%" obj 'quadratic-solution) - (format #t "~Ts1: ~f~%" (-> obj s1)) - (format #t "~Ts2: ~f~%" (-> obj s2)) - obj +(defmethod inspect quadratic-solution ((this quadratic-solution)) + (format #t "[~8x] ~A~%" this 'quadratic-solution) + (format #t "~Ts1: ~f~%" (-> this s1)) + (format #t "~Ts2: ~f~%" (-> this s2)) + this ) ;; definition for function solve-missile-tilt @@ -1421,15 +1422,15 @@ ) ;; definition for method 3 of type trajectory-params -(defmethod inspect trajectory-params ((obj trajectory-params)) - (format #t "[~8x] ~A~%" obj 'trajectory-params) - (format #t "~Tx: ~f~%" (-> obj x)) - (format #t "~Ty: ~f~%" (-> obj y)) - (format #t "~Tgravity: ~f~%" (-> obj gravity)) - (format #t "~Ttheta: ~f~%" (-> obj theta)) - (format #t "~Tspeed: ~f~%" (-> obj speed)) - (format #t "~Ttime: ~f~%" (-> obj time)) - obj +(defmethod inspect trajectory-params ((this trajectory-params)) + (format #t "[~8x] ~A~%" this 'trajectory-params) + (format #t "~Tx: ~f~%" (-> this x)) + (format #t "~Ty: ~f~%" (-> this y)) + (format #t "~Tgravity: ~f~%" (-> this gravity)) + (format #t "~Ttheta: ~f~%" (-> this theta)) + (format #t "~Tspeed: ~f~%" (-> this speed)) + (format #t "~Ttime: ~f~%" (-> this time)) + this ) ;; definition for function solve-missile-velocity @@ -1538,16 +1539,16 @@ ) (mistycannon-find-trajectory gp-0) (when (= (-> gp-0 time) 0.0) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (when (time-elapsed? (-> self state-time) (seconds 3)) (mistycannon-method-22 self 409600.0 2.0 20480.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (return #f) ) (when (angle-tracker-seek! (-> self tilt) (-> gp-0 theta)) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (when (time-elapsed? (-> self state-time) (seconds 3)) (mistycannon-method-22 self (fmax 163840.0 (fmin 409600.0 (-> gp-0 speed))) (-> gp-0 time) 20480.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) ) ) @@ -1558,7 +1559,7 @@ ;; failed to figure out what this is: (defstate mistycannon-aim-at-player (mistycannon) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) @@ -1708,7 +1709,7 @@ :code (behavior () (send-event *camera* 'change-state cam-mistycannon 0) (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 0) (s5-0 0) ) @@ -1739,12 +1740,10 @@ (suspend) ) ) - (let ((v1-45 (and (cpad-hold? 0 x) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1))))) + (let ((v1-45 (and (cpad-hold? 0 x) (time-elapsed? (-> self state-time) (seconds 1))))) (when (zero? s5-0) (when v1-45 - (set! gp-0 - (seekl gp-0 300 (the-as int (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) - ) + (set! gp-0 (seekl gp-0 300 (the-as int (- (current-time) (-> *display* old-base-frame-counter))))) (sound-play "cannon-charge" :id (-> self sound-id) :pitch (* 0.008 (the float gp-0))) ) (when (or (= gp-0 300) (and (not (cpad-hold? 0 x)) (nonzero? gp-0))) @@ -1752,7 +1751,7 @@ (level-hint-spawn (text-id sidekick-mistycannon) "sksp009f" (the-as entity #f) *entity-pool* (game-task none)) (mistycannon-method-22 self (* 4096.0 (the float gp-1)) 2.0 40960.0) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! gp-0 0) (set! s5-0 1) (sound-stop (-> self sound-id)) @@ -1789,7 +1788,7 @@ (-> self root-override) (the-as uint 1) ) - (let ((v0-0 (-> *display* base-frame-counter))) + (let ((v0-0 (current-time))) (set! (-> self state-time) v0-0) v0-0 ) @@ -1798,14 +1797,14 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans rider-trans :code (behavior () (loop (suspend) (mistycannon-method-23 self) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (go mistycannon-waiting-for-player) ) ) @@ -1816,10 +1815,10 @@ ;; definition for method 11 of type mistycannon ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! mistycannon ((obj mistycannon) (arg0 entity-actor)) +(defmethod init-from-entity! mistycannon ((this mistycannon) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1853,78 +1852,78 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (quaternion-identity! (-> obj root-override quat)) - (initialize-skeleton obj *mistycannon-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (set! (-> obj skel prebind-function) mistycannon-prebind-function) - (set! (-> obj skel postbind-function) mistycannon-postbind-function) - (set! (-> obj fact-info-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (quaternion-identity! (-> this root-override quat)) + (initialize-skeleton this *mistycannon-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (set! (-> this skel prebind-function) mistycannon-prebind-function) + (set! (-> this skel postbind-function) mistycannon-postbind-function) + (set! (-> this fact-info-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((f30-0 (res-lump-float arg0 'rotmin :default 16384.0)) (f28-0 (res-lump-float arg0 'rotmax :default 32768.0)) (f0-15 (res-lump-float arg0 'rotspeed :default 3640.889)) ) - (angle-tracker-init-range! (-> obj rotate) f30-0 f28-0 f0-15) + (angle-tracker-init-range! (-> this rotate) f30-0 f28-0 f0-15) ) (let ((f30-1 (res-lump-float arg0 'tiltmin :default -1820.4445)) (f28-1 (res-lump-float arg0 'tiltmax :default 12743.111)) (f0-16 (res-lump-float arg0 'tiltspeed :default 3640.889)) ) - (angle-tracker-init-range! (-> obj tilt) f30-1 f28-1 f0-16) + (angle-tracker-init-range! (-> this tilt) f30-1 f28-1 f0-16) ) - (set! (-> obj avoid-entity) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj center-point w) (res-lump-float arg0 'center-radius)) + (set! (-> this avoid-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this center-point w) (res-lump-float arg0 'center-radius)) (cond - ((= (-> obj center-point w) 0.0) - (set! (-> obj center-point quad) (-> obj root-override trans quad)) - (set! (-> obj center-point w) (-> obj fact-info-override idle-distance)) + ((= (-> this center-point w) 0.0) + (set! (-> this center-point quad) (-> this root-override trans quad)) + (set! (-> this center-point w) (-> this fact-info-override idle-distance)) ) (else (set! sv-16 (new 'static 'res-tag)) (let ((v1-64 (res-lump-data arg0 'center-point pointer :tag-ptr (& sv-16)))) - (set! (-> obj center-point x) (if (and v1-64 (< 0.0 (the float (-> sv-16 elt-count)))) - (-> (the-as (pointer float) v1-64)) - 0.0 - ) + (set! (-> this center-point x) (if (and v1-64 (< 0.0 (the float (-> sv-16 elt-count)))) + (-> (the-as (pointer float) v1-64)) + 0.0 + ) ) ) (set! sv-32 (new 'static 'res-tag)) (let ((v1-67 (res-lump-data arg0 'center-point (pointer float) :tag-ptr (& sv-32)))) - (set! (-> obj center-point y) (if (and v1-67 (< 1.0 (the float (-> sv-32 elt-count)))) - (-> v1-67 1) - 0.0 - ) + (set! (-> this center-point y) (if (and v1-67 (< 1.0 (the float (-> sv-32 elt-count)))) + (-> v1-67 1) + 0.0 + ) ) ) (set! sv-48 (new 'static 'res-tag)) (let ((v1-70 (res-lump-data arg0 'center-point (pointer float) :tag-ptr (& sv-48)))) - (set! (-> obj center-point z) (if (and v1-70 (< 2.0 (the float (-> sv-48 elt-count)))) - (-> v1-70 2) - 0.0 - ) + (set! (-> this center-point z) (if (and v1-70 (< 2.0 (the float (-> sv-48 elt-count)))) + (-> v1-70 2) + 0.0 + ) ) ) ) ) - (set! (-> obj accuracy-range) 16384.0) + (set! (-> this accuracy-range) 16384.0) (mistycannon-pick-random-target-point) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 119) obj)) - (set! (-> obj part-timer) (+ (-> *display* base-frame-counter) (seconds -10))) - (set! (-> obj postbindinfo-ok) #f) - (let ((v1-79 (-> obj rotate))) - (set! (-> obj last-known-rotation) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 119) this)) + (set! (-> this part-timer) (+ (current-time) (seconds -10))) + (set! (-> this postbindinfo-ok) #f) + (let ((v1-79 (-> this rotate))) + (set! (-> this last-known-rotation) (the float (sar (shl (the int (+ (-> v1-79 min) (-> v1-79 value))) 48) 48)) ) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj aim-sound-id) (new-sound-id)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this aim-sound-id) (new-sound-id)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go mistycannon-idle) (go mistycannon-waiting-for-player) ) diff --git a/test/decompiler/reference/jak1/levels/misty/mud_REF.gc b/test/decompiler/reference/jak1/levels/misty/mud_REF.gc index 8aa1f1c317..94b132fc8a 100644 --- a/test/decompiler/reference/jak1/levels/misty/mud_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/mud_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type mud -(defmethod inspect mud ((obj mud)) +(defmethod inspect mud ((this mud)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for symbol ripple-for-mud, type ripple-wave-set @@ -48,29 +48,29 @@ ;; definition for method 22 of type mud ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 mud ((obj mud)) +(defmethod water-vol-method-22 mud ((this mud)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) - (logclear! (-> obj flags) (water-flags wt23)) - (logior! (-> obj flags) (water-flags wt18)) + (logclear! (-> this flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt18)) (let ((gp-0 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) gp-0) + (set! (-> this draw ripple) gp-0) (set! (-> gp-0 global-scale) 3072.0) (set! (-> gp-0 waveform) ripple-for-mud) - (let ((v1-9 (res-lump-data (-> obj entity) 'water-anim-fade-dist (pointer float)))) + (let ((v1-9 (res-lump-data (-> this entity) 'water-anim-fade-dist (pointer float)))) (when v1-9 (set! (-> gp-0 close-fade-dist) (-> v1-9 0)) (set! (-> gp-0 far-fade-dist) (-> v1-9 1)) ) ) - (case (-> obj look) + (case (-> this look) ((21 25 29) (set! (-> gp-0 close-fade-dist) 4096000000.0) (set! (-> gp-0 far-fade-dist) 8192000000.0) ) ) - (case (-> obj look) + (case (-> this look) ((22 25 24 27 26 31) (set! (-> gp-0 waveform) ripple-for-small-mud) ) diff --git a/test/decompiler/reference/jak1/levels/misty/muse_REF.gc b/test/decompiler/reference/jak1/levels/misty/muse_REF.gc index 1dca49a42c..54d2b95be4 100644 --- a/test/decompiler/reference/jak1/levels/misty/muse_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/muse_REF.gc @@ -26,21 +26,21 @@ ) ;; definition for method 3 of type muse -(defmethod inspect muse ((obj muse)) +(defmethod inspect muse ((this muse)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcurrent-path-index: ~f~%" (-> obj current-path-index)) - (format #t "~T~Tprev-path-index: ~f~%" (-> obj prev-path-index)) - (format #t "~T~Tdest-path-index: ~f~%" (-> obj dest-path-index)) - (format #t "~T~Tplayer-path-index: ~f~%" (-> obj player-path-index)) - (format #t "~T~Tmax-path-index: ~f~%" (-> obj max-path-index)) - (format #t "~T~Tsprint-distance: ~f~%" (-> obj sprint-distance)) - (format #t "~T~Tdest-point: #~%" (-> obj dest-point)) - (format #t "~T~Tanim: ~A~%" (-> obj anim)) - (format #t "~T~Tvictory-anim: ~A~%" (-> obj victory-anim)) - (format #t "~T~Told-target-pos: #~%" (-> obj old-target-pos)) - obj + (format #t "~T~Tcurrent-path-index: ~f~%" (-> this current-path-index)) + (format #t "~T~Tprev-path-index: ~f~%" (-> this prev-path-index)) + (format #t "~T~Tdest-path-index: ~f~%" (-> this dest-path-index)) + (format #t "~T~Tplayer-path-index: ~f~%" (-> this player-path-index)) + (format #t "~T~Tmax-path-index: ~f~%" (-> this max-path-index)) + (format #t "~T~Tsprint-distance: ~f~%" (-> this sprint-distance)) + (format #t "~T~Tdest-point: #~%" (-> this dest-point)) + (format #t "~T~Tanim: ~A~%" (-> this anim)) + (format #t "~T~Tvictory-anim: ~A~%" (-> this victory-anim)) + (format #t "~T~Told-target-pos: #~%" (-> this old-target-pos)) + this ) ;; definition of type point-on-path-segment-info @@ -59,16 +59,16 @@ ) ;; definition for method 3 of type point-on-path-segment-info -(defmethod inspect point-on-path-segment-info ((obj point-on-path-segment-info)) - (format #t "[~8x] ~A~%" obj 'point-on-path-segment-info) - (format #t "~Tpoint: #~%" (-> obj point)) - (format #t "~Tsegment[2] @ #x~X~%" (-> obj segment)) - (format #t "~Tdir: #~%" (-> obj dir)) - (format #t "~Tnearest-point: #~%" (-> obj nearest-point)) - (format #t "~Tsegment-length: ~f~%" (-> obj segment-length)) - (format #t "~Tdistance-to-segment: ~f~%" (-> obj distance-to-segment)) - (format #t "~Tparametric-index: ~f~%" (-> obj parametric-index)) - obj +(defmethod inspect point-on-path-segment-info ((this point-on-path-segment-info)) + (format #t "[~8x] ~A~%" this 'point-on-path-segment-info) + (format #t "~Tpoint: #~%" (-> this point)) + (format #t "~Tsegment[2] @ #x~X~%" (-> this segment)) + (format #t "~Tdir: #~%" (-> this dir)) + (format #t "~Tnearest-point: #~%" (-> this nearest-point)) + (format #t "~Tsegment-length: ~f~%" (-> this segment-length)) + (format #t "~Tdistance-to-segment: ~f~%" (-> this distance-to-segment)) + (format #t "~Tparametric-index: ~f~%" (-> this parametric-index)) + this ) ;; definition for function analyze-point-on-path-segment @@ -173,12 +173,12 @@ ;; definition for method 51 of type muse ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-51 muse ((obj muse)) +(defmethod nav-enemy-method-51 muse ((this muse)) (dotimes (s5-0 2) - (let ((v1-2 (rand-vu-int-range 3 (+ (-> obj node-list length) -1)))) + (let ((v1-2 (rand-vu-int-range 3 (+ (-> this node-list length) -1)))) (launch-particles (-> *part-id-table* 271) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data v1-2)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data v1-2)) ) ) ) @@ -187,10 +187,10 @@ ) ;; definition for method 39 of type muse -(defmethod common-post muse ((obj muse)) - (spool-push *art-control* (-> obj anim name) 0 obj -99.0) - (nav-enemy-method-51 obj) - ((method-of-type nav-enemy common-post) obj) +(defmethod common-post muse ((this muse)) + (spool-push *art-control* (-> this anim name) 0 this -99.0) + (nav-enemy-method-51 this) + ((method-of-type nav-enemy common-post) this) (none) ) @@ -202,12 +202,12 @@ ) ;; definition for method 44 of type muse -(defmethod touch-handler muse ((obj muse) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler muse ((this muse) (arg0 process) (arg1 event-message-block)) (go muse-caught) ) ;; definition for method 43 of type muse -(defmethod attack-handler muse ((obj muse) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler muse ((this muse) (arg0 process) (arg1 event-message-block)) (go muse-caught) ) @@ -218,7 +218,7 @@ nav-enemy-default-event-handler (defstate muse-idle (muse) :event nav-enemy-default-event-handler :trans (behavior () - (seek! (-> self sprint-distance) 61440.0 (* 8192.0 (-> *display* seconds-per-frame))) + (seek! (-> self sprint-distance) 61440.0 (* 8192.0 (seconds-per-frame))) (if (and *target* (>= 102400.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) (level-hint-spawn (text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) @@ -255,7 +255,7 @@ nav-enemy-default-event-handler :virtual #t :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (cond @@ -277,7 +277,7 @@ nav-enemy-default-event-handler (set! (-> self target-speed) 61440.0) ) ) - (seek! (-> self sprint-distance) 0.0 (* 4096.0 (-> *display* seconds-per-frame))) + (seek! (-> self sprint-distance) 0.0 (* 4096.0 (seconds-per-frame))) (muse-check-dest-point) ) :code (behavior () @@ -494,10 +494,10 @@ nav-enemy-default-event-handler ;; definition for method 11 of type muse ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! muse ((obj muse) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! muse ((this muse) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -513,34 +513,34 @@ nav-enemy-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *muse-sg* '()) - (logclear! (-> obj mask) (process-mask actor-pause)) - (init-defaults! obj *muse-nav-enemy-info*) - (set! (-> obj max-path-index) (the float (+ (-> obj path curve num-cverts) -1))) - (set! (-> obj current-path-index) 7.0) - (set! (-> obj prev-path-index) 7.0) - (set! (-> obj dest-path-index) 7.0) - (set! (-> obj player-path-index) 0.0) - (eval-path-curve-div! (-> obj path) (-> obj dest-point) (-> obj current-path-index) 'interp) - (set! (-> obj collide-info trans quad) (-> obj dest-point quad)) - (set! (-> obj nav nearest-y-threshold) 20480.0) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) - (set! (-> obj neck max-dist) 102400.0) - (set! (-> obj neck ignore-angle) 16384.0) - (set! (-> obj anim) (new 'static 'spool-anim - :name "muse-victory" - :index 9 - :parts 2 - :command-list '((1 blackout 0) (219 blackout 60)) - ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *muse-sg* '()) + (logclear! (-> this mask) (process-mask actor-pause)) + (init-defaults! this *muse-nav-enemy-info*) + (set! (-> this max-path-index) (the float (+ (-> this path curve num-cverts) -1))) + (set! (-> this current-path-index) 7.0) + (set! (-> this prev-path-index) 7.0) + (set! (-> this dest-path-index) 7.0) + (set! (-> this player-path-index) 0.0) + (eval-path-curve-div! (-> this path) (-> this dest-point) (-> this current-path-index) 'interp) + (set! (-> this collide-info trans quad) (-> this dest-point quad)) + (set! (-> this nav nearest-y-threshold) 20480.0) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) + (set! (-> this anim) (new 'static 'spool-anim + :name "muse-victory" + :index 9 + :parts 2 + :command-list '((1 blackout 0) (219 blackout 60)) + ) ) - (set! (-> obj victory-anim) (fuel-cell-pick-anim obj)) + (set! (-> this victory-anim) (fuel-cell-pick-anim this)) (go muse-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc b/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc index df72105494..c225b5f3f9 100644 --- a/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/quicksandlurker_REF.gc @@ -308,11 +308,11 @@ ) ;; definition for method 3 of type quicksandlurker-missile -(defmethod inspect quicksandlurker-missile ((obj quicksandlurker-missile)) +(defmethod inspect quicksandlurker-missile ((this quicksandlurker-missile)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -347,10 +347,10 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (while (not (time-elapsed? (-> self state-time) (seconds 4))) (fill-cache-integrate-and-collide! (-> self root-override) (-> self root-override transv) @@ -397,8 +397,8 @@ (-> self root-override trans) :to *entity-pool* ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (cleanup-for-death self) @@ -416,11 +416,11 @@ ) ;; definition for method 3 of type quicksandlurker-missile-init-data -(defmethod inspect quicksandlurker-missile-init-data ((obj quicksandlurker-missile-init-data)) - (format #t "[~8x] ~A~%" obj 'quicksandlurker-missile-init-data) - (format #t "~Tposition: #~%" (-> obj position)) - (format #t "~Tvelocity: #~%" (-> obj velocity)) - obj +(defmethod inspect quicksandlurker-missile-init-data ((this quicksandlurker-missile-init-data)) + (format #t "[~8x] ~A~%" this 'quicksandlurker-missile-init-data) + (format #t "~Tposition: #~%" (-> this position)) + (format #t "~Tvelocity: #~%" (-> this velocity)) + this ) ;; definition for function quicksandlurker-missile-init-by-other @@ -501,17 +501,17 @@ ) ;; definition for method 3 of type quicksandlurker -(defmethod inspect quicksandlurker ((obj quicksandlurker)) +(defmethod inspect quicksandlurker ((this quicksandlurker)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Toriginal-position: #~%" (-> obj original-position)) - (format #t "~T~Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~T~Ttheta-angle: ~f~%" (-> obj theta-angle)) - (format #t "~T~Tradial-offset: ~f~%" (-> obj radial-offset)) - (format #t "~T~Tbob-angle: ~f~%" (-> obj bob-angle)) - (format #t "~T~Tmud-entity: ~A~%" (-> obj mud-entity)) - obj + (format #t "~T~Toriginal-position: #~%" (-> this original-position)) + (format #t "~T~Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~T~Ttheta-angle: ~f~%" (-> this theta-angle)) + (format #t "~T~Tradial-offset: ~f~%" (-> this radial-offset)) + (format #t "~T~Tbob-angle: ~f~%" (-> this bob-angle)) + (format #t "~T~Tmud-entity: ~A~%" (-> this mud-entity)) + this ) ;; failed to figure out what this is: @@ -561,8 +561,8 @@ ;; definition for function quicksandlurker-post ;; INFO: Return type mismatch int vs none. (defbehavior quicksandlurker-post quicksandlurker () - (inc-angle (&-> self theta-angle) (* 9102.223 (-> *display* seconds-per-frame))) - (inc-angle (&-> self bob-angle) (* 14563.556 (-> *display* seconds-per-frame))) + (inc-angle (&-> self theta-angle) (* 9102.223 (seconds-per-frame))) + (inc-angle (&-> self bob-angle) (* 14563.556 (seconds-per-frame))) (let ((f28-0 (* (-> self radial-offset) (cos (-> self theta-angle)))) (f30-2 (* 0.0 (sin (-> self theta-angle)))) ) @@ -649,31 +649,31 @@ ((or (not *target*) (< 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - (seek! (-> self y-offset) -6553.6 (* 20480.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset) -6553.6 (* 20480.0 (seconds-per-frame))) (if (= (-> self y-offset) -6553.6) (go quicksandlurker-idle) ) ) (else - (seek! (-> self y-offset) 1228.8 (* 20480.0 (-> *display* seconds-per-frame))) + (seek! (-> self y-offset) 1228.8 (* 20480.0 (seconds-per-frame))) ) ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 1.5 2.0)))) (s5-0 5) (s4-0 0) ) (ja-channel-push! 1 (seconds 0.1)) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + (when (time-elapsed? (-> self state-time) gp-0) (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (+! s4-0 1) (when (< s5-0 s4-0) (set! s4-0 0) @@ -720,19 +720,19 @@ (quicksandlurker-check-hide-transition) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (the int (* 300.0 (rand-vu-float-range 0.8 1.2)))) (s5-0 1) (s4-0 0) ) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + (when (time-elapsed? (-> self state-time) gp-0) (ja-no-eval :group! quicksandlurker-idle-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (+! s4-0 1) (when (>= s4-0 s5-0) (if (logtest? (-> self draw status) (draw-status was-drawn)) @@ -833,7 +833,7 @@ (defstate quicksandlurker-hide (quicksandlurker) :event quicksandlurker-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (restore-collide-with-as (-> self root-override)) @@ -851,10 +851,10 @@ ) (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (go quicksandlurker-popup) ) ) @@ -933,9 +933,9 @@ ;; definition for method 11 of type quicksandlurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! quicksandlurker ((obj quicksandlurker) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! quicksandlurker ((this quicksandlurker) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -969,23 +969,23 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (+! (-> obj root-override trans y) -2048.0) - (set! (-> obj original-position quad) (-> obj root-override trans quad)) - (set! (-> obj theta-angle) (rand-vu-float-range 0.0 65536.0)) - (set! (-> obj bob-angle) (rand-vu-float-range 0.0 65536.0)) - (set! (-> obj radial-offset) 4096.0) - (set! (-> obj y-offset) -6553.6) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (rand-vu-float-range 0.0 65536.0)) - (initialize-skeleton obj *quicksandlurker-sg* '()) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (+! (-> this root-override trans y) -2048.0) + (set! (-> this original-position quad) (-> this root-override trans quad)) + (set! (-> this theta-angle) (rand-vu-float-range 0.0 65536.0)) + (set! (-> this bob-angle) (rand-vu-float-range 0.0 65536.0)) + (set! (-> this radial-offset) 4096.0) + (set! (-> this y-offset) -6553.6) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) (rand-vu-float-range 0.0 65536.0)) + (initialize-skeleton this *quicksandlurker-sg* '()) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj mud-entity) (entity-actor-lookup (-> obj entity) 'water-actor 0)) + (set! (-> this mud-entity) (entity-actor-lookup (-> this entity) 'water-actor 0)) (go quicksandlurker-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc b/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc index 91ac10ebf6..2a4d1befd9 100644 --- a/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc +++ b/test/decompiler/reference/jak1/levels/misty/sidekick-human_REF.gc @@ -10,35 +10,35 @@ ) ;; definition for method 3 of type sequenceA -(defmethod inspect sequenceA ((obj sequenceA)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect sequenceA ((this sequenceA)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; failed to figure out what this is: @@ -1161,15 +1161,15 @@ ) ;; definition for method 3 of type sequenceB -(defmethod inspect sequenceB ((obj sequenceB)) +(defmethod inspect sequenceB ((this sequenceB)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbonelurker: ~D~%" (-> obj bonelurker)) - (format #t "~T~Tevilbro: ~D~%" (-> obj evilbro)) - (format #t "~T~Tevilsis: ~D~%" (-> obj evilsis)) - (format #t "~T~Tlurker-army[9] @ #x~X~%" (-> obj lurker-army)) - obj + (format #t "~T~Tbonelurker: ~D~%" (-> this bonelurker)) + (format #t "~T~Tevilbro: ~D~%" (-> this evilbro)) + (format #t "~T~Tevilsis: ~D~%" (-> this evilsis)) + (format #t "~T~Tlurker-army[9] @ #x~X~%" (-> this lurker-army)) + this ) ;; definition of type sequenceC @@ -1185,14 +1185,14 @@ ) ;; definition for method 3 of type sequenceC -(defmethod inspect sequenceC ((obj sequenceC)) +(defmethod inspect sequenceC ((this sequenceC)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbonelurker: ~D~%" (-> obj bonelurker)) - (format #t "~T~Tdarkecocan: ~D~%" (-> obj darkecocan)) - (format #t "~T~Tdarkecocan-glowing-look: #~%" (-> obj darkecocan-glowing-look)) - obj + (format #t "~T~Tbonelurker: ~D~%" (-> this bonelurker)) + (format #t "~T~Tdarkecocan: ~D~%" (-> this darkecocan)) + (format #t "~T~Tdarkecocan-glowing-look: #~%" (-> this darkecocan-glowing-look)) + this ) ;; failed to figure out what this is: @@ -1239,13 +1239,13 @@ ) ;; definition for method 3 of type army-info -(defmethod inspect army-info ((obj army-info)) - (format #t "[~8x] ~A~%" obj 'army-info) - (format #t "~Tpos: #~%" (-> obj pos)) - (format #t "~Trot: ~f~%" (-> obj rot)) - (format #t "~Tstart-frame: ~f~%" (-> obj start-frame)) - (format #t "~Tskel: ~A~%" (-> obj skel)) - obj +(defmethod inspect army-info ((this army-info)) + (format #t "[~8x] ~A~%" this 'army-info) + (format #t "~Tpos: #~%" (-> this pos)) + (format #t "~Trot: ~f~%" (-> this rot)) + (format #t "~Tstart-frame: ~f~%" (-> this start-frame)) + (format #t "~Tskel: ~A~%" (-> this skel)) + this ) ;; definition for symbol *lurker-army*, type (array army-info) @@ -1334,15 +1334,15 @@ ) ;; definition for method 32 of type sequenceB -(defmethod play-anim! sequenceB ((obj sequenceB) (arg0 symbol)) +(defmethod play-anim! sequenceB ((this sequenceB) (arg0 symbol)) (cond (arg0 (send-event *target* 'sidekick #f) - (set! (-> obj bonelurker) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f :to obj)) + (set! (-> this bonelurker) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *bonelurker-sg* #f :to this)) ) - (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) + (send-event (handle->process (-> this bonelurker)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this bonelurker)) 'center-joint 3) (set-setting! 'music-volume-movie 'abs 0.0 0) (set-setting! 'sfx-volume-movie 'abs 0.0 0) (set-setting! 'ambient-volume-movie 'abs 0.0 0) @@ -1350,10 +1350,10 @@ (let ((s4-0 (-> *lurker-army* s5-1))) (cond ((= (-> s4-0 skel) 'bonelurker) - (set! (-> obj lurker-army s5-1) - (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> obj entity) *bonelurker-sg* #f :to obj)) + (set! (-> this lurker-army s5-1) + (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> this entity) *bonelurker-sg* #f :to this)) ) - (let ((s3-1 (handle->process (-> obj lurker-army s5-1)))) + (let ((s3-1 (handle->process (-> this lurker-army s5-1)))) (when s3-1 (set! (-> (the-as babak s3-1) draw light-index) (the-as uint 1)) (set! (-> (the-as babak s3-1) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) @@ -1361,24 +1361,24 @@ ) ) (else - (set! (-> obj lurker-army s5-1) - (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> obj entity) *babak-sg* #f :to obj)) + (set! (-> this lurker-army s5-1) + (ppointer->handle (manipy-spawn (-> s4-0 pos) (-> this entity) *babak-sg* #f :to this)) ) - (let ((s3-3 (handle->process (-> obj lurker-army s5-1)))) + (let ((s3-3 (handle->process (-> this lurker-army s5-1)))) (when s3-3 (set! (-> (the-as babak s3-3) draw light-index) (the-as uint 1)) (set! (-> (the-as babak s3-3) draw level-index) (the-as uint (-> (level-get *level* 'misty) index))) ) ) - (send-event (handle->process (-> obj lurker-army s5-1)) 'art-joint-anim "idle" 0) + (send-event (handle->process (-> this lurker-army s5-1)) 'art-joint-anim "idle" 0) ) ) - (send-event (handle->process (-> obj lurker-army s5-1)) 'rot (-> s4-0 rot)) + (send-event (handle->process (-> this lurker-army s5-1)) 'rot (-> s4-0 rot)) ) ) ) ((!= (level-status *level* 'intro) 'active) - (return (get-art-elem obj)) + (return (get-art-elem this)) ) ) (new 'static 'spool-anim @@ -1485,8 +1485,8 @@ ) ;; definition for method 31 of type sequenceB -(defmethod get-art-elem sequenceB ((obj sequenceB)) - (-> obj draw art-group data 3) +(defmethod get-art-elem sequenceB ((this sequenceB)) + (-> this draw art-group data 3) ) ;; failed to figure out what this is: @@ -1606,21 +1606,21 @@ ) ;; definition for method 39 of type sequenceB -(defmethod should-display? sequenceB ((obj sequenceB)) +(defmethod should-display? sequenceB ((this sequenceB)) #f ) ;; definition for method 11 of type sequenceB -(defmethod init-from-entity! sequenceB ((obj sequenceB) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) - (set! (-> obj tasks) (get-task-control (game-task intro))) - (set! (-> obj bonelurker) (the-as handle #f)) - (set! (-> obj evilbro) (the-as handle #f)) - (set! (-> obj evilsis) (the-as handle #f)) +(defmethod init-from-entity! sequenceB ((this sequenceB) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) + (set! (-> this tasks) (get-task-control (game-task intro))) + (set! (-> this bonelurker) (the-as handle #f)) + (set! (-> this evilbro) (the-as handle #f)) + (set! (-> this evilsis) (the-as handle #f)) (dotimes (v1-2 9) - (set! (-> obj lurker-army v1-2) (the-as handle #f)) + (set! (-> this lurker-army v1-2) (the-as handle #f)) ) - (process-taskable-method-42 obj) + (process-taskable-method-42 this) (none) ) @@ -1663,24 +1663,24 @@ ;; definition for method 32 of type sequenceC ;; INFO: Return type mismatch spool-anim vs basic. -(defmethod play-anim! sequenceC ((obj sequenceC) (arg0 symbol)) +(defmethod play-anim! sequenceC ((this sequenceC) (arg0 symbol)) (when arg0 (set-setting! 'music-volume-movie 'abs 0.0 0) (set-setting! 'sfx-volume-movie 'abs 0.0 0) (set-setting! 'ambient-volume-movie 'abs 0.0 0) - (set! (-> obj bonelurker) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *bonelurker-sg* #f :to obj)) + (set! (-> this bonelurker) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *bonelurker-sg* #f :to this)) ) - (send-event (handle->process (-> obj bonelurker)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj bonelurker)) 'center-joint 3) - (set! (-> obj darkecocan) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *darkecocan-sg* #f :to obj)) + (send-event (handle->process (-> this bonelurker)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this bonelurker)) 'center-joint 3) + (set! (-> this darkecocan) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *darkecocan-sg* #f :to this)) ) - (send-event (handle->process (-> obj darkecocan)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj darkecocan)) 'center-joint 3) - (send-event (handle->process (-> obj darkecocan)) 'trans-hook sequenceC-can-trans-hook) + (send-event (handle->process (-> this darkecocan)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this darkecocan)) 'center-joint 3) + (send-event (handle->process (-> this darkecocan)) 'trans-hook sequenceC-can-trans-hook) (send-event - (handle->process (-> obj darkecocan)) + (handle->process (-> this darkecocan)) 'eval (lambda :behavior sequenceC () @@ -1757,8 +1757,8 @@ ) ;; definition for method 31 of type sequenceC -(defmethod get-art-elem sequenceC ((obj sequenceC)) - (-> obj draw art-group data 3) +(defmethod get-art-elem sequenceC ((this sequenceC)) + (-> this draw art-group data 3) ) ;; failed to figure out what this is: @@ -1785,7 +1785,7 @@ ) ;; definition for method 39 of type sequenceC -(defmethod should-display? sequenceC ((obj sequenceC)) +(defmethod should-display? sequenceC ((this sequenceC)) #f ) @@ -1814,12 +1814,12 @@ ) ;; definition for method 11 of type sequenceC -(defmethod init-from-entity! sequenceC ((obj sequenceC) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) - (set! (-> obj tasks) (get-task-control (game-task intro))) - (set! (-> obj bonelurker) (the-as handle #f)) - (set! (-> obj darkecocan) (the-as handle #f)) - (set! (-> obj cur-trans-hook) sequenceC-trans-hook) - (process-taskable-method-42 obj) +(defmethod init-from-entity! sequenceC ((this sequenceC) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sidekick-human-sg* 3 44 (new 'static 'vector :w 4096.0) -1) + (set! (-> this tasks) (get-task-control (game-task intro))) + (set! (-> this bonelurker) (the-as handle #f)) + (set! (-> this darkecocan) (the-as handle #f)) + (set! (-> this cur-trans-hook) sequenceC-trans-hook) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc index 6ff9192690..371faf6a76 100644 --- a/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/flying-lurker_REF.gc @@ -25,13 +25,13 @@ ) ;; definition for method 3 of type plunger-lurker -(defmethod inspect plunger-lurker ((obj plunger-lurker)) +(defmethod inspect plunger-lurker ((this plunger-lurker)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - (format #t "~T~Tgot-hit: ~A~%" (-> obj got-hit)) - obj + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + (format #t "~T~Tgot-hit: ~A~%" (-> this got-hit)) + this ) ;; failed to figure out what this is: @@ -262,9 +262,9 @@ ;; definition for method 11 of type plunger-lurker ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! plunger-lurker ((obj plunger-lurker) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! plunger-lurker ((this plunger-lurker) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -276,13 +276,13 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *plunger-lurker-sg* '()) - (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj got-hit) #f) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) -16384.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *plunger-lurker-sg* '()) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this got-hit) #f) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) -16384.0) (if (= (get-task-status (game-task plunger-lurker-hit)) (task-status invalid)) (go plunger-lurker-die) (go plunger-lurker-idle) @@ -330,30 +330,30 @@ ) ;; definition for method 3 of type flying-lurker -(defmethod inspect flying-lurker ((obj flying-lurker)) +(defmethod inspect flying-lurker ((this flying-lurker)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcurve-position: ~f~%" (-> obj curve-position)) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Ttangent: #~%" (-> obj tangent)) - (format #t "~T~Tanim-blend: ~f~%" (-> obj anim-blend)) - (format #t "~T~Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~T~Ty-offset-desired: ~f~%" (-> obj y-offset-desired)) - (format #t "~T~Ty-vel: ~f~%" (-> obj y-vel)) - (format #t "~T~Tlast-look-time: ~D~%" (-> obj last-look-time)) - (format #t "~T~Ttime-to-next-look: ~D~%" (-> obj time-to-next-look)) - (format #t "~T~Ttake-off: ~A~%" (-> obj take-off)) - (format #t "~T~Trace-seconds: ~f~%" (-> obj race-seconds)) - (format #t "~T~Trace-start-time: ~D~%" (-> obj race-start-time)) - (format #t "~T~Trank: ~D~%" (-> obj rank)) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - (format #t "~T~Talt-trans: #~%" (-> obj alt-trans)) - (format #t "~T~Tshadow-backup: ~A~%" (-> obj shadow-backup)) - (format #t "~T~Ttry-count: ~D~%" (-> obj try-count)) - (format #t "~T~Ttry-counted: ~A~%" (-> obj try-counted)) - (format #t "~T~Tdefault-bounds: #~%" (-> obj default-bounds)) - obj + (format #t "~T~Tcurve-position: ~f~%" (-> this curve-position)) + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Ttangent: #~%" (-> this tangent)) + (format #t "~T~Tanim-blend: ~f~%" (-> this anim-blend)) + (format #t "~T~Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~T~Ty-offset-desired: ~f~%" (-> this y-offset-desired)) + (format #t "~T~Ty-vel: ~f~%" (-> this y-vel)) + (format #t "~T~Tlast-look-time: ~D~%" (-> this last-look-time)) + (format #t "~T~Ttime-to-next-look: ~D~%" (-> this time-to-next-look)) + (format #t "~T~Ttake-off: ~A~%" (-> this take-off)) + (format #t "~T~Trace-seconds: ~f~%" (-> this race-seconds)) + (format #t "~T~Trace-start-time: ~D~%" (-> this race-start-time)) + (format #t "~T~Trank: ~D~%" (-> this rank)) + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + (format #t "~T~Talt-trans: #~%" (-> this alt-trans)) + (format #t "~T~Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~T~Ttry-count: ~D~%" (-> this try-count)) + (format #t "~T~Ttry-counted: ~A~%" (-> this try-counted)) + (format #t "~T~Tdefault-bounds: #~%" (-> this default-bounds)) + this ) ;; failed to figure out what this is: @@ -370,20 +370,20 @@ ;; definition for method 20 of type flying-lurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod flying-lurker-method-20 flying-lurker ((obj flying-lurker)) +(defmethod flying-lurker-method-20 flying-lurker ((this flying-lurker)) (with-pp - (let ((s5-0 (-> obj draw shadow-ctrl)) + (let ((s5-0 (-> this draw shadow-ctrl)) (s4-0 #f) ) - (when (-> obj draw shadow) - (when (or (logtest? (-> obj draw status) (draw-status was-drawn)) - (< (vector-vector-xz-distance-squared (-> obj root trans) (camera-pos)) 10485760000.0) + (when (-> this draw shadow) + (when (or (logtest? (-> this draw status) (draw-status was-drawn)) + (< (vector-vector-xz-distance-squared (-> this root trans) (camera-pos)) 10485760000.0) ) (let ((s3-1 (new 'stack-no-clear 'collide-tri-result)) (a1-1 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-1 quad) (-> obj root trans quad)) + (set! (-> a1-1 quad) (-> this root trans quad)) (+! (-> a1-1 y) -8192.0) (set-vector! a2-0 0.0 -81920.0 0.0 1.0) (when (>= (fill-and-probe-using-line-sphere @@ -417,24 +417,24 @@ 0 (let ((s2-2 (new 'stack-no-clear 'bounding-box))) (let ((s1-1 (new 'stack-no-clear 'vector))) - (vector<-cspace! s1-1 (-> obj node-list data 4)) + (vector<-cspace! s1-1 (-> this node-list data 4)) (vector+float! (-> s2-2 min) s1-1 -18432.0) (vector+float! (-> s2-2 max) s1-1 18432.0) ) (add-spheres! s2-2 (the-as (inline-array sphere) (-> s3-1 intersect)) 1) (let ((f0-17 (* 0.5 (vector-vector-distance (-> s2-2 min) (-> s2-2 max))))) (set-vector! - (-> obj draw bounds) + (-> this draw bounds) (* 0.5 (+ (-> s2-2 min x) (-> s2-2 max x))) (* 0.5 (+ (-> s2-2 min y) (-> s2-2 max y))) (* 0.5 (+ (-> s2-2 min z) (-> s2-2 max z))) 1.0 ) - (vector-! (-> obj draw bounds) (-> obj draw bounds) (-> obj root trans)) - (set! (-> obj draw bounds w) f0-17) + (vector-! (-> this draw bounds) (-> this draw bounds) (-> this root trans)) + (set! (-> this draw bounds w) f0-17) ) ) - (set! (-> obj draw origin-joint-index) (the-as uint 0)) + (set! (-> this draw origin-joint-index) (the-as uint 0)) 0 ) ) @@ -444,8 +444,8 @@ (when (not s4-0) (logior! (-> s5-0 settings flags) (shadow-flags disable-draw)) 0 - (set! (-> obj draw bounds quad) (-> obj default-bounds quad)) - (set! (-> obj draw origin-joint-index) (the-as uint 4)) + (set! (-> this draw bounds quad) (-> this default-bounds quad)) + (set! (-> this draw origin-joint-index) (the-as uint 4)) ) ) (none) @@ -542,9 +542,7 @@ ;; INFO: Return type mismatch float vs none. (defbehavior flying-lurker-move flying-lurker () (+! (-> self curve-position) - (/ (the float - (* (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) (the int (-> self speed))) - ) + (/ (the float (* (- (current-time) (-> *display* old-base-frame-counter)) (the int (-> self speed)))) (path-distance (-> self path)) ) ) @@ -769,14 +767,14 @@ ) (ja :num! (loop! (flying-lurker-calc-anim-speed))) (suspend) - (when (>= (- (-> *display* base-frame-counter) (-> self last-look-time)) (-> self time-to-next-look)) + (when (time-elapsed? (-> self last-look-time) (-> self time-to-next-look)) (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! flying-lurker-look-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) (ja :num! (seek!)) ) - (set! (-> self last-look-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-look-time)) (let* ((f30-0 300.0) (f28-0 3.0) (f26-0 5.0) @@ -960,8 +958,8 @@ process (lambda :behavior process () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 0.1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.1)) (suspend) ) ) @@ -1212,8 +1210,8 @@ ) (when (and *target* (>= 172032.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)))) (process-grab? *target*) - (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 1)) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 1)) (suspend) ) ) @@ -1244,46 +1242,46 @@ ;; definition for method 11 of type flying-lurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! flying-lurker ((obj flying-lurker) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *flying-lurker-sg* '()) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj root pause-adjust-distance) 122880.0) - (set! (-> obj curve-position) 0.0) +(defmethod init-from-entity! flying-lurker ((this flying-lurker) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *flying-lurker-sg* '()) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this root pause-adjust-distance) 122880.0) + (set! (-> this curve-position) 0.0) (cond ((play-movie?) - (eval-path-curve! (-> obj path) (-> obj root trans) (-> obj curve-position) 'interp) - (path-control-method-14 (-> obj path) (-> obj tangent) (-> obj curve-position)) - (quaternion-identity! (-> obj root quat)) + (eval-path-curve! (-> this path) (-> this root trans) (-> this curve-position) 'interp) + (path-control-method-14 (-> this path) (-> this tangent) (-> this curve-position)) + (quaternion-identity! (-> this root quat)) ) (else (flying-lurker-move) (flying-lurker-rotate) ) ) - (set! (-> obj y-offset) 0.0) - (set! (-> obj y-vel) 0.0) - (set! (-> obj last-look-time) 0) - (set! (-> obj time-to-next-look) 0) - (set! (-> obj draw origin-joint-index) (the-as uint 4)) - (set! (-> obj draw shadow-joint-index) (the-as uint 4)) - (set! (-> obj take-off) #f) - (set-vector! (-> obj default-bounds) 0.0 8192.0 0.0 24576.0) - (set! (-> obj draw bounds quad) (-> obj default-bounds quad)) - (set! (-> obj draw shadow-ctrl) + (set! (-> this y-offset) 0.0) + (set! (-> this y-vel) 0.0) + (set! (-> this last-look-time) 0) + (set! (-> this time-to-next-look) 0) + (set! (-> this draw origin-joint-index) (the-as uint 4)) + (set! (-> this draw shadow-joint-index) (the-as uint 4)) + (set! (-> this take-off) #f) + (set-vector! (-> this default-bounds) 0.0 8192.0 0.0 24576.0) + (set! (-> this draw bounds quad) (-> this default-bounds quad)) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 131072.0 151552.0 614400.0 (the-as float 60) 409600.0) ) - (let ((v1-27 (-> obj draw shadow-ctrl))) + (let ((v1-27 (-> this draw shadow-ctrl))) (logclear! (-> v1-27 settings flags) (shadow-flags disable-draw)) ) 0 - (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj shadow-backup) (-> obj draw shadow)) - (set! (-> obj try-counted) #f) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this shadow-backup) (-> this draw shadow)) + (set! (-> this try-counted) #f) (if (= (get-task-status (game-task plunger-lurker-hit)) (task-status invalid)) (go flying-lurker-die) (go flying-lurker-idle) 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 5f0d60c5a4..a9f0518c83 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogre-obs_REF.gc @@ -321,11 +321,11 @@ ) ;; definition for method 3 of type tntbarrel -(defmethod inspect tntbarrel ((obj tntbarrel)) +(defmethod inspect tntbarrel ((this tntbarrel)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -393,8 +393,8 @@ ;; definition for method 11 of type tntbarrel ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! tntbarrel ((obj tntbarrel) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! tntbarrel ((this tntbarrel) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind crate)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -406,12 +406,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *tntbarrel-sg* '()) - (set-vector! (-> obj draw color-mult) 1.3 1.3 1.3 1.0) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *tntbarrel-sg* '()) + (set-vector! (-> this draw color-mult) 1.3 1.3 1.3 1.0) + (go (method-of-object this idle)) (none) ) @@ -473,24 +473,27 @@ ) ;; definition for method 3 of type ogre-plat -(defmethod inspect ogre-plat ((obj ogre-plat)) +(defmethod inspect ogre-plat ((this ogre-plat)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tanchor-point: #~%" (-> obj anchor-point)) - (format #t "~T~Tidle-y-offset: ~f~%" (-> obj idle-y-offset)) - (format #t "~T~Tfloat-y-offset: ~f~%" (-> obj float-y-offset)) - (format #t "~T~Tdelay: ~D~%" (-> obj delay)) - (format #t "~T~Tactive: ~A~%" (-> obj active)) - (format #t "~T~Ttriggered: ~A~%" (-> obj triggered)) - obj + (format #t "~T~Tanchor-point: #~%" (-> this anchor-point)) + (format #t "~T~Tidle-y-offset: ~f~%" (-> this idle-y-offset)) + (format #t "~T~Tfloat-y-offset: ~f~%" (-> this float-y-offset)) + (format #t "~T~Tdelay: ~D~%" (-> this delay)) + (format #t "~T~Tactive: ~A~%" (-> this active)) + (format #t "~T~Ttriggered: ~A~%" (-> this triggered)) + this ) ;; definition for method 23 of type ogre-plat ;; INFO: Return type mismatch int vs none. -(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)) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) +(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) + ) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) @@ -503,7 +506,7 @@ (('trigger) (set! (-> self triggered) (the-as entity-actor #t)) (set! (-> self delay) (the-as time-frame (-> block param 0))) - (let ((v0-0 (-> *display* base-frame-counter))) + (let ((v0-0 (current-time))) (set! (-> self state-time) v0-0) v0-0 ) @@ -524,7 +527,7 @@ ) ) (else - (if (and (-> self triggered) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay))) + (if (and (-> self triggered) (time-elapsed? (-> self state-time) (-> self delay))) (set! (-> self active) #t) ) ) @@ -550,14 +553,14 @@ ) ) (let ((f30-1 (-> self idle-y-offset))) - (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (seek! (-> self float-height-offset) (-> self float-y-offset) (* 32768.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) (-> self float-y-offset) (* 32768.0 (seconds-per-frame))) ) ) ) @@ -572,8 +575,8 @@ ;; definition for method 30 of type ogre-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 ogre-plat ((obj ogre-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod rigid-body-platform-method-30 ogre-plat ((this ogre-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -591,7 +594,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -600,13 +603,13 @@ ;; definition for method 31 of type ogre-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-plat ((obj ogre-plat)) - (set! (-> obj float-height-offset) (-> obj idle-y-offset)) - (let ((s5-0 (-> obj info control-point-count))) +(defmethod rigid-body-platform-method-31 ogre-plat ((this ogre-plat)) + (set! (-> this float-height-offset) (-> this idle-y-offset)) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0)))) - (f28-0 (-> obj root-overlay root-prim local-sphere w)) + (f28-0 (-> this root-overlay root-prim local-sphere w)) ) (set! (-> s3-0 local-pos x) (* f28-0 (sin f30-0))) (set! (-> s3-0 local-pos y) 0.0) @@ -616,9 +619,9 @@ ) ) ) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) - (set! (-> obj active) #f) - (set! (-> obj triggered) #f) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) + (set! (-> this active) #f) + (set! (-> this triggered) #f) 0 (none) ) @@ -660,24 +663,24 @@ ) ;; definition for method 3 of type ogre-step -(defmethod inspect ogre-step ((obj ogre-step)) +(defmethod inspect ogre-step ((this ogre-step)) (let ((t9-0 (method-of-type ogre-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 31 of type ogre-step ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-step ((obj ogre-step)) - (set! (-> obj idle-y-offset) -28672.0) - (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) - (let ((a0-5 (entity-actor-lookup (-> obj entity) 'alt-actor 0))) +(defmethod rigid-body-platform-method-31 ogre-step ((this ogre-step)) + (set! (-> this idle-y-offset) -28672.0) + (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) + (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! (-> obj active) #t) + (set! (-> this active) #t) ) ) 0 @@ -686,10 +689,10 @@ ;; definition for method 34 of type ogre-step ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-34 ogre-step ((obj ogre-step)) - (if (-> obj active) - (go (method-of-object obj rigid-body-platform-float)) - (go (method-of-object obj rigid-body-platform-idle)) +(defmethod rigid-body-platform-method-34 ogre-step ((this ogre-step)) + (if (-> this active) + (go (method-of-object this rigid-body-platform-float)) + (go (method-of-object this rigid-body-platform-idle)) ) 0 (none) @@ -705,11 +708,11 @@ ) ;; definition for method 3 of type ogre-step-a -(defmethod inspect ogre-step-a ((obj ogre-step-a)) +(defmethod inspect ogre-step-a ((this ogre-step-a)) (let ((t9-0 (method-of-type ogre-step inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type ogre-step-b @@ -722,11 +725,11 @@ ) ;; definition for method 3 of type ogre-step-b -(defmethod inspect ogre-step-b ((obj ogre-step-b)) +(defmethod inspect ogre-step-b ((this ogre-step-b)) (let ((t9-0 (method-of-type ogre-step inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type ogre-step-c @@ -739,11 +742,11 @@ ) ;; definition for method 3 of type ogre-step-c -(defmethod inspect ogre-step-c ((obj ogre-step-c)) +(defmethod inspect ogre-step-c ((this ogre-step-c)) (let ((t9-0 (method-of-type ogre-step inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type ogre-step-d @@ -756,49 +759,49 @@ ) ;; definition for method 3 of type ogre-step-d -(defmethod inspect ogre-step-d ((obj ogre-step-d)) +(defmethod inspect ogre-step-d ((this ogre-step-d)) (let ((t9-0 (method-of-type ogre-step inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 31 of type ogre-step-a ;; INFO: Return type mismatch int vs none. -(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) +(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) 0 (none) ) ;; definition for method 31 of type ogre-step-b ;; INFO: Return type mismatch int vs none. -(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) +(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) 0 (none) ) ;; definition for method 31 of type ogre-step-c ;; INFO: Return type mismatch int vs none. -(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) +(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) 0 (none) ) ;; definition for method 31 of type ogre-step-d ;; INFO: Return type mismatch int vs none. -(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) +(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) 0 (none) ) @@ -841,21 +844,21 @@ ) ;; definition for method 3 of type ogre-isle -(defmethod inspect ogre-isle ((obj ogre-isle)) +(defmethod inspect ogre-isle ((this ogre-isle)) (let ((t9-0 (method-of-type ogre-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 31 of type ogre-isle ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-isle ((obj ogre-isle)) - (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) - (set! (-> obj active) #t) +(defmethod rigid-body-platform-method-31 ogre-isle ((this ogre-isle)) + (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) + (set! (-> this active) #t) 0 (none) ) @@ -870,11 +873,11 @@ ) ;; definition for method 3 of type ogre-isle-b -(defmethod inspect ogre-isle-b ((obj ogre-isle-b)) +(defmethod inspect ogre-isle-b ((this ogre-isle-b)) (let ((t9-0 (method-of-type ogre-isle inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type ogre-isle-c @@ -887,11 +890,11 @@ ) ;; definition for method 3 of type ogre-isle-c -(defmethod inspect ogre-isle-c ((obj ogre-isle-c)) +(defmethod inspect ogre-isle-c ((this ogre-isle-c)) (let ((t9-0 (method-of-type ogre-isle inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type ogre-isle-d @@ -904,43 +907,43 @@ ) ;; definition for method 3 of type ogre-isle-d -(defmethod inspect ogre-isle-d ((obj ogre-isle-d)) +(defmethod inspect ogre-isle-d ((this ogre-isle-d)) (let ((t9-0 (method-of-type ogre-isle inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 31 of type ogre-isle-b ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-isle-b ((obj ogre-isle-b)) - (+! (-> 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) +(defmethod rigid-body-platform-method-31 ogre-isle-b ((this ogre-isle-b)) + (+! (-> 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) 0 (none) ) ;; definition for method 31 of type ogre-isle-c ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-isle-c ((obj ogre-isle-c)) - (+! (-> 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) +(defmethod rigid-body-platform-method-31 ogre-isle-c ((this ogre-isle-c)) + (+! (-> 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) 0 (none) ) ;; definition for method 31 of type ogre-isle-d ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 ogre-isle-d ((obj ogre-isle-d)) - (+! (-> obj root-overlay trans x) -8192.0) - (+! (-> 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) +(defmethod rigid-body-platform-method-31 ogre-isle-d ((this ogre-isle-d)) + (+! (-> this root-overlay trans x) -8192.0) + (+! (-> 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) 0 (none) ) @@ -971,26 +974,26 @@ ) ;; definition for method 3 of type ogre-bridge -(defmethod inspect ogre-bridge ((obj ogre-bridge)) +(defmethod inspect ogre-bridge ((this ogre-bridge)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tjoint-mod-array[8] @ #x~X~%" (-> obj joint-mod-array)) - (format #t "~T~Tdead-joint-count: ~D~%" (-> obj dead-joint-count)) - obj + (format #t "~T~Tjoint-mod-array[8] @ #x~X~%" (-> this joint-mod-array)) + (format #t "~T~Tdead-joint-count: ~D~%" (-> this dead-joint-count)) + this ) ;; definition for method 7 of type ogre-bridge ;; INFO: Return type mismatch process-drawable vs ogre-bridge. -(defmethod relocate ogre-bridge ((obj ogre-bridge) (arg0 int)) +(defmethod relocate ogre-bridge ((this ogre-bridge) (arg0 int)) (dotimes (v1-0 8) - (if (nonzero? (-> obj joint-mod-array v1-0)) - (&+! (-> obj joint-mod-array v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method ogre-bridge 7)) this arg0) ) ) @@ -1133,10 +1136,10 @@ ;; definition for method 11 of type ogre-bridge ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ogre-bridge ((obj ogre-bridge) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! ogre-bridge ((this ogre-bridge) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1306,21 +1309,21 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *ogre-bridge-sg* '()) - (logior! (-> obj skel effect flags) 1) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *ogre-bridge-sg* '()) + (logior! (-> this skel effect flags) 1) (dotimes (s5-1 8) - (let ((v1-185 (new 'process 'joint-mod-set-local obj (the-as int (-> *ogre-bridge-joint-array* s5-1)) #f #f #f))) - (set! (-> obj joint-mod-array s5-1) (the-as joint-mod v1-185)) + (let ((v1-185 (new 'process 'joint-mod-set-local this (the-as int (-> *ogre-bridge-joint-array* s5-1)) #f #f #f))) + (set! (-> this joint-mod-array s5-1) (the-as joint-mod v1-185)) (vector-reset! (-> v1-185 transform scale)) ) ) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (set! (-> obj dead-joint-count) 8) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (set! (-> this dead-joint-count) 8) (ogre-bridge-update-joints) (go ogre-bridge-activated) ) @@ -1351,11 +1354,11 @@ ) ;; definition for method 3 of type ogre-bridgeend -(defmethod inspect ogre-bridgeend ((obj ogre-bridgeend)) +(defmethod inspect ogre-bridgeend ((this ogre-bridgeend)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1368,8 +1371,8 @@ ;; definition for method 11 of type ogre-bridgeend ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ogre-bridgeend ((obj ogre-bridgeend) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! ogre-bridgeend ((this ogre-bridgeend) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1381,10 +1384,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ogre-bridgeend-sg* '()) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ogre-bridgeend-sg* '()) (go ogre-bridgeend-idle) (none) ) @@ -1401,13 +1404,13 @@ ) ;; definition for method 3 of type ogre-lava -(defmethod inspect ogre-lava ((obj ogre-lava)) +(defmethod inspect ogre-lava ((this ogre-lava)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tidle-anim: ~D~%" (-> obj idle-anim)) - (format #t "~T~Tanim: ~D~%" (-> obj anim)) - obj + (format #t "~T~Tidle-anim: ~D~%" (-> this idle-anim)) + (format #t "~T~Tanim: ~D~%" (-> this anim)) + this ) ;; failed to figure out what this is: @@ -1484,18 +1487,18 @@ ;; definition for method 22 of type ogre-lava ;; INFO: Return type mismatch symbol vs none. -(defmethod water-vol-method-22 ogre-lava ((obj ogre-lava)) +(defmethod water-vol-method-22 ogre-lava ((this ogre-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) + (set! (-> this draw ripple) v1-2) (set! (-> v1-2 global-scale) 2048.0) (set! (-> v1-2 waveform) ripple-for-ogre-lava) ) - (logclear! (-> obj flags) (water-flags wt23)) - (logior! (-> obj flags) (water-flags wt25)) - (set! (-> obj attack-event) 'lava) + (logclear! (-> this flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt25)) + (set! (-> this attack-event) 'lava) (none) ) @@ -1515,12 +1518,12 @@ ) ;; definition for method 3 of type shortcut-boulder -(defmethod inspect shortcut-boulder ((obj shortcut-boulder)) +(defmethod inspect shortcut-boulder ((this shortcut-boulder)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbroken-look: #~%" (-> obj broken-look)) - obj + (format #t "~T~Tbroken-look: #~%" (-> this broken-look)) + this ) ;; failed to figure out what this is: @@ -1666,8 +1669,8 @@ ;; definition for method 11 of type shortcut-boulder ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! shortcut-boulder ((obj shortcut-boulder) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! shortcut-boulder ((this shortcut-boulder) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1679,12 +1682,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *shortcut-boulder-whole-sg* '()) - (setup-lods! (-> obj broken-look) *shortcut-boulder-broken-sg* (-> obj draw art-group) (-> obj entity)) - (set-vector! (-> obj draw color-emissive) 0.125 0.0625 0.0 0.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *shortcut-boulder-whole-sg* '()) + (setup-lods! (-> this broken-look) *shortcut-boulder-broken-sg* (-> this draw art-group) (-> this entity)) + (set-vector! (-> this draw color-emissive) 0.125 0.0625 0.0 0.0) (go shortcut-boulder-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc index 95c0c47d1b..1c3fdcc8f8 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogre-part_REF.gc @@ -690,11 +690,11 @@ ) ;; definition for method 3 of type ogre-part -(defmethod inspect ogre-part ((obj ogre-part)) +(defmethod inspect ogre-part ((this ogre-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc index 3f0e3989e6..8b7d15e20f 100644 --- a/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc +++ b/test/decompiler/reference/jak1/levels/ogre/ogreboss_REF.gc @@ -91,32 +91,32 @@ ) ;; definition for method 3 of type ogreboss-missile -(defmethod inspect ogreboss-missile ((obj ogreboss-missile)) +(defmethod inspect ogreboss-missile ((this ogreboss-missile)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttrajectory: #~%" (-> obj trajectory)) - (format #t "~T~Tsrc-pos: #~%" (-> obj src-pos)) - (format #t "~T~Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~T~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~T~Ttumble-quat: #~%" (-> obj tumble-quat)) - (format #t "~T~Tblast-radius: ~f~%" (-> obj blast-radius)) - (format #t "~T~Tpickup-type: ~D~%" (-> obj pickup-type)) - obj + (format #t "~T~Ttrajectory: #~%" (-> this trajectory)) + (format #t "~T~Tsrc-pos: #~%" (-> this src-pos)) + (format #t "~T~Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~T~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~T~Ttumble-quat: #~%" (-> this tumble-quat)) + (format #t "~T~Tblast-radius: ~f~%" (-> this blast-radius)) + (format #t "~T~Tpickup-type: ~D~%" (-> this pickup-type)) + this ) ;; failed to figure out what this is: (defstate ogreboss-missile-idle (ogreboss-missile) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'collide-tri-result)) ) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 6)) - (let ((f0-1 (the float (- (-> *display* base-frame-counter) (-> self start-time))))) + (while (not (time-elapsed? (-> self state-time) (seconds 6))) + (let ((f0-1 (the float (- (current-time) (-> self start-time))))) (eval-position! (-> self trajectory) f0-1 gp-0) ) (vector-! s5-0 gp-0 (-> self root-override trans)) @@ -197,7 +197,7 @@ (defun ogreboss-missile-scale-explosion ((arg0 handle)) (let* ((gp-0 (handle->process arg0)) (f0-0 (-> (the-as process-drawable gp-0) root scale x)) - (f0-2 (seek f0-0 (the-as float 0.0) (-> *display* seconds-per-frame))) + (f0-2 (seek f0-0 (the-as float 0.0) (seconds-per-frame))) ) (set-vector! (-> (the-as process-drawable gp-0) root scale) f0-2 f0-2 f0-2 1.0) ) @@ -347,15 +347,15 @@ ) ;; definition for method 3 of type ogreboss-missile-init-data -(defmethod inspect ogreboss-missile-init-data ((obj ogreboss-missile-init-data)) - (format #t "[~8x] ~A~%" obj 'ogreboss-missile-init-data) - (format #t "~Tsrc: #~%" (-> obj src)) - (format #t "~Tdest: #~%" (-> obj dest)) - (format #t "~Tduration: ~D~%" (-> obj duration)) - (format #t "~Txz-speed: ~f~%" (-> obj xz-speed)) - (format #t "~Tblast-radius: ~f~%" (-> obj blast-radius)) - (format #t "~Tpickup-type: ~D~%" (-> obj pickup-type)) - obj +(defmethod inspect ogreboss-missile-init-data ((this ogreboss-missile-init-data)) + (format #t "[~8x] ~A~%" this 'ogreboss-missile-init-data) + (format #t "~Tsrc: #~%" (-> this src)) + (format #t "~Tdest: #~%" (-> this dest)) + (format #t "~Tduration: ~D~%" (-> this duration)) + (format #t "~Txz-speed: ~f~%" (-> this xz-speed)) + (format #t "~Tblast-radius: ~f~%" (-> this blast-radius)) + (format #t "~Tpickup-type: ~D~%" (-> this pickup-type)) + this ) ;; definition for function ogreboss-missile-init-by-other @@ -407,7 +407,7 @@ (the-as float -0.22755557) ) ) - (set! (-> self start-time) (-> *display* base-frame-counter)) + (set-time! (-> self start-time)) (set! (-> self blast-radius) (-> arg0 blast-radius)) (set! (-> self pickup-type) (-> arg0 pickup-type)) (let ((f30-1 (* 65536.0 (rand-vu)))) @@ -457,22 +457,22 @@ ) ;; definition for method 3 of type ogreboss-super-boulder -(defmethod inspect ogreboss-super-boulder ((obj ogreboss-super-boulder)) +(defmethod inspect ogreboss-super-boulder ((this ogreboss-super-boulder)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Torig-pos: #~%" (-> obj orig-pos)) - (format #t "~T~Tsrc-pos: #~%" (-> obj src-pos)) - (format #t "~T~Tspin-axis: #~%" (-> obj spin-axis)) - (format #t "~T~Tjoint: ~A~%" (-> obj joint)) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Tsize: ~f~%" (-> obj size)) - (format #t "~T~Tgrow-rate: ~f~%" (-> obj grow-rate)) - (format #t "~T~Tlava: ~A~%" (-> obj lava)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~T~Thit-boss: ~A~%" (-> obj hit-boss)) - (format #t "~T~Ttumble-quat: #~%" (-> obj tumble-quat)) - obj + (format #t "~T~Torig-pos: #~%" (-> this orig-pos)) + (format #t "~T~Tsrc-pos: #~%" (-> this src-pos)) + (format #t "~T~Tspin-axis: #~%" (-> this spin-axis)) + (format #t "~T~Tjoint: ~A~%" (-> this joint)) + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Tsize: ~f~%" (-> this size)) + (format #t "~T~Tgrow-rate: ~f~%" (-> this grow-rate)) + (format #t "~T~Tlava: ~A~%" (-> this lava)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~T~Thit-boss: ~A~%" (-> this hit-boss)) + (format #t "~T~Ttumble-quat: #~%" (-> this tumble-quat)) + this ) ;; definition for function ogreboss-super-boulder-event-handler @@ -544,18 +544,18 @@ (ja :group! ogreboss-super-boulder-idle-ja :num! min) (set! (-> self joint enable) #t) (set! (-> self joint blend) 1.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (quaternion-vector-angle! (-> self tumble-quat) (-> self spin-axis) - (* 32768.0 (-> *display* seconds-per-frame) (-> self speed)) + (* 32768.0 (seconds-per-frame) (-> self speed)) ) (quaternion*! (-> self joint transform quat) (-> self joint transform quat) (-> self tumble-quat)) - (+! (-> self size) (* (-> self grow-rate) (-> *display* seconds-per-frame))) + (+! (-> self size) (* (-> self grow-rate) (seconds-per-frame))) (set! (-> self size) (fmin 1.0 (-> self size))) (let* ((f0-10 (sqrtf (-> self size))) - (f28-0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> self state-time))))) + (f28-0 (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) (f30-0 (* 116508.445 f28-0 (-> self speed))) ) (set-vector! (-> self joint transform scale) f0-10 f0-10 f0-10 1.0) @@ -601,7 +601,7 @@ (set! (-> self src-pos quad) (-> self root-override trans quad)) (ja-no-eval :group! ogreboss-super-boulder-hit-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (-> *display* seconds-per-frame))) + (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (seconds-per-frame))) (let* ((f1-1 (/ (- (ja-frame-num 0) (ja-aframe (the-as float 54.0) 0)) (- (the float (ja-num-frames 0)) (ja-aframe (the-as float 54.0) 0)) ) @@ -624,7 +624,7 @@ (set! (-> self src-pos quad) (-> self root-override trans quad)) (ja-no-eval :group! ogreboss-super-boulder-throw-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (-> *display* seconds-per-frame))) + (seek! (-> self joint blend) (the-as float 0.0) (* 5.0 (seconds-per-frame))) (let* ((f1-1 (/ (- (ja-frame-num 0) (ja-aframe (the-as float 32.0) 0)) (- (the float (ja-num-frames 0)) (ja-aframe (the-as float 32.0) 0)) ) @@ -772,14 +772,14 @@ ;; definition for method 7 of type ogreboss-super-boulder ;; INFO: Return type mismatch process-drawable vs ogreboss-super-boulder. -(defmethod relocate ogreboss-super-boulder ((obj ogreboss-super-boulder) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(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)) - obj + this arg0 ) ) @@ -869,16 +869,16 @@ ) ;; definition for method 3 of type ogreboss-bounce-boulder -(defmethod inspect ogreboss-bounce-boulder ((obj ogreboss-bounce-boulder)) +(defmethod inspect ogreboss-bounce-boulder ((this ogreboss-bounce-boulder)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsrc-pos: #~%" (-> obj src-pos)) - (format #t "~T~Tside-dir: #~%" (-> obj side-dir)) - (format #t "~T~Tside-pos: ~f~%" (-> obj side-pos)) - (format #t "~T~Tdest-pos: ~f~%" (-> obj dest-pos)) - (format #t "~T~Tboulder-type: ~D~%" (-> obj boulder-type)) - obj + (format #t "~T~Tsrc-pos: #~%" (-> this src-pos)) + (format #t "~T~Tside-dir: #~%" (-> this side-dir)) + (format #t "~T~Tside-pos: ~f~%" (-> this side-pos)) + (format #t "~T~Tdest-pos: ~f~%" (-> this dest-pos)) + (format #t "~T~Tboulder-type: ~D~%" (-> this boulder-type)) + this ) ;; definition for function ogreboss-bounce-boulder-event-handler @@ -901,7 +901,7 @@ (defstate ogreboss-bounce-boulder-idle (ogreboss-bounce-boulder) :event ogreboss-bounce-boulder-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((f30-0 2.0)) (ja-no-eval :group! ogreboss-bounce-boulder-idle-ja :num! (seek! (ja-aframe (the-as float 40.0) 0) f30-0) @@ -920,7 +920,7 @@ ) (until (ja-done? 0) (if (>= (ja-frame-num 0) (ja-aframe (the-as float 235.0) 0)) - (seek! (-> self side-pos) (the-as float 0.0) (* 20480.0 (-> *display* seconds-per-frame))) + (seek! (-> self side-pos) (the-as float 0.0) (* 20480.0 (seconds-per-frame))) ) (suspend) (ja :num! (seek! max f30-0)) @@ -1049,37 +1049,37 @@ ) ;; definition for method 3 of type ogreboss -(defmethod inspect ogreboss ((obj ogreboss)) +(defmethod inspect ogreboss ((this ogreboss)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Told-player-transform: #~%" (-> obj old-player-transform)) - (format #t "~T~Tlevel: ~f~%" (-> obj level)) - (format #t "~T~Tdifficulty: ~f~%" (-> obj difficulty)) - (format #t "~T~Tboulder: ~D~%" (-> obj boulder)) - (format #t "~T~Tcolumn: ~D~%" (-> obj column)) - (format #t "~T~Tz-plane: #~%" (-> obj z-plane)) - (format #t "~T~Tfar-pos: #~%" (-> obj far-pos)) - (format #t "~T~Tnear-pos: #~%" (-> obj near-pos)) - (format #t "~T~Tside-dir: #~%" (-> obj side-dir)) - (format #t "~T~Ttarget-offset-array[3] @ #x~X~%" (-> obj target-offset-array)) - (format #t "~T~Ttarget-actor-array[3] @ #x~X~%" (-> obj target-actor-array)) - (format #t "~T~Ttarget-blast-radius-array[3] @ #x~X~%" (-> obj target-blast-radius-array)) - (format #t "~T~Tshuffle-pos: ~f~%" (-> obj shuffle-pos)) - (format #t "~T~Ttarget-count: ~D~%" (-> obj target-count)) - (format #t "~T~Thit-count: ~D~%" (-> obj hit-count)) - (format #t "~T~Tmax-hit-count: ~D~%" (-> obj max-hit-count)) - (format #t "~T~Troll-boulder: ~D~%" (-> obj roll-boulder)) - (format #t "~T~Ttry-count: ~D~%" (-> obj try-count)) - (format #t "~T~Thit-time: ~D~%" (-> obj hit-time)) - (format #t "~T~Tgrow-time: ~f~%" (-> obj grow-time)) - (format #t "~T~Tlava: ~A~%" (-> obj lava)) - (format #t "~T~Tvulnerable: ~A~%" (-> obj vulnerable)) - (format #t "~T~Tbridge-assembled: ~A~%" (-> obj bridge-assembled)) - (format #t "~T~Tat-near-spot: ~A~%" (-> obj at-near-spot)) - (format #t "~T~Tsubmerged: ~A~%" (-> obj submerged)) - (format #t "~T~Ttry-counted: ~A~%" (-> obj try-counted)) - obj + (format #t "~T~Told-player-transform: #~%" (-> this old-player-transform)) + (format #t "~T~Tlevel: ~f~%" (-> this level)) + (format #t "~T~Tdifficulty: ~f~%" (-> this difficulty)) + (format #t "~T~Tboulder: ~D~%" (-> this boulder)) + (format #t "~T~Tcolumn: ~D~%" (-> this column)) + (format #t "~T~Tz-plane: #~%" (-> this z-plane)) + (format #t "~T~Tfar-pos: #~%" (-> this far-pos)) + (format #t "~T~Tnear-pos: #~%" (-> this near-pos)) + (format #t "~T~Tside-dir: #~%" (-> this side-dir)) + (format #t "~T~Ttarget-offset-array[3] @ #x~X~%" (-> this target-offset-array)) + (format #t "~T~Ttarget-actor-array[3] @ #x~X~%" (-> this target-actor-array)) + (format #t "~T~Ttarget-blast-radius-array[3] @ #x~X~%" (-> this target-blast-radius-array)) + (format #t "~T~Tshuffle-pos: ~f~%" (-> this shuffle-pos)) + (format #t "~T~Ttarget-count: ~D~%" (-> this target-count)) + (format #t "~T~Thit-count: ~D~%" (-> this hit-count)) + (format #t "~T~Tmax-hit-count: ~D~%" (-> this max-hit-count)) + (format #t "~T~Troll-boulder: ~D~%" (-> this roll-boulder)) + (format #t "~T~Ttry-count: ~D~%" (-> this try-count)) + (format #t "~T~Thit-time: ~D~%" (-> this hit-time)) + (format #t "~T~Tgrow-time: ~f~%" (-> this grow-time)) + (format #t "~T~Tlava: ~A~%" (-> this lava)) + (format #t "~T~Tvulnerable: ~A~%" (-> this vulnerable)) + (format #t "~T~Tbridge-assembled: ~A~%" (-> this bridge-assembled)) + (format #t "~T~Tat-near-spot: ~A~%" (-> this at-near-spot)) + (format #t "~T~Tsubmerged: ~A~%" (-> this submerged)) + (format #t "~T~Ttry-counted: ~A~%" (-> this try-counted)) + this ) ;; definition for function ogreboss-inc-try-count @@ -1135,8 +1135,8 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 140.0) 0))) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.167)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.167)) (suspend) ) ) @@ -1148,8 +1148,8 @@ (suspend) (ja :num! (seek! (ja-aframe (the-as float 168.0) 0))) ) - (let ((gp-5 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.167)) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 0.167)) (suspend) ) ) @@ -1433,8 +1433,8 @@ ) (logior! (-> self draw status) (draw-status hidden)) (set! (-> self submerged) #t) - (let ((s5-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-1) arg0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 arg0) (suspend) ) ) @@ -1543,12 +1543,12 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (and (-> self bridge-assembled) (ogreboss-player-inside-range? (the-as float 524288.0)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (go ogreboss-stage2) ) @@ -1674,7 +1674,7 @@ (let ((f1-0 0.0) (f0-0 0.0) ) - (let ((f30-0 (the float (- (-> *display* base-frame-counter) (-> self hit-time))))) + (let ((f30-0 (the float (- (current-time) (-> self hit-time))))) (when (and (> (-> self hit-count) 0) (>= 45.0 f30-0)) (set! f0-0 (+ (ja-aframe (the-as float 0.0) 1) (* 0.022222223 f30-0 (- (ja-aframe (the-as float 8.0) 1) (ja-aframe (the-as float 0.0) 1))) @@ -1736,7 +1736,7 @@ (ja :chan 1 :group! ogreboss-hit-crotch-ja :num! min :frame-interp 0.0) (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) ) - (set! (-> self hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self hit-time)) (let ((v1-17 (rand-vu-int-range 0 2))) (cond ((zero? v1-17) @@ -1781,10 +1781,10 @@ (suspend) (ja :num! (seek! max 1.5)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (while (not gp-0) (ogreboss-roll-boulder) - (set! gp-0 (or (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (set! gp-0 (or (and (time-elapsed? (-> self state-time) (seconds 2)) (not (ogreboss-player-inside-range? (the-as float 524288.0))) ) (ogreboss-player-inside-range? (the-as float 409600.0)) @@ -1828,7 +1828,7 @@ (defstate ogreboss-stage3-shuffle (ogreboss) :event ogreboss-attack-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self hit-count) 0) (set! (-> self max-hit-count) (the int (* 6.0 (-> self difficulty)))) (set! (-> self grow-time) (* 300.0 (+ (/ 10.0 (-> self difficulty)) (* -1.0 (-> self level))))) @@ -1845,9 +1845,9 @@ ) ) (when (and (not (ogreboss-player-inside-range? (the-as float 409600.0))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (send-event (handle->process (-> self boulder)) 'grow-faster) ) 0 @@ -1868,7 +1868,7 @@ (ja :num! (seek! max f30-0)) ) (ogreboss-spawn-super-boulder) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-channel-push! 2 (seconds 0.05)) (ja :chan 1 :group! ogreboss-hit-chest-ja :num! min :frame-interp 0.0) (set! (-> self vulnerable) #t) @@ -1893,7 +1893,7 @@ (ja-no-eval :group! ogreboss-shuffle-right-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) - (set! (-> self shuffle-pos) (- (-> self shuffle-pos) (* 16384.0 (-> *display* seconds-per-frame) f30-0))) + (set! (-> self shuffle-pos) (- (-> self shuffle-pos) (* 16384.0 (seconds-per-frame) f30-0))) (suspend) (ja :num! (seek! max f30-0)) ) @@ -1920,7 +1920,7 @@ (ja-no-eval :group! ogreboss-shuffle-left-loop-ja :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (ogreboss-update-shuffling) - (+! (-> self shuffle-pos) (* 16384.0 (-> *display* seconds-per-frame) f30-0)) + (+! (-> self shuffle-pos) (* 16384.0 (seconds-per-frame) f30-0)) (suspend) (ja :num! (seek! max f30-0)) ) @@ -2116,9 +2116,9 @@ ;; definition for method 11 of type ogreboss ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ogreboss ((obj ogreboss) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask attackable)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! ogreboss ((this ogreboss) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask attackable)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 6) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -2182,46 +2182,46 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *ogreboss-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 5)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *ogreboss-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 5)) (ogreboss-get-targets) - (set! (-> obj try-count) (-> obj entity extra perm user-uint8 0)) + (set! (-> this try-count) (-> this entity extra perm user-uint8 0)) (cond - ((< (-> obj try-count) (the-as uint 5)) - (set! (-> obj difficulty) 1.0) + ((< (-> this try-count) (the-as uint 5)) + (set! (-> this difficulty) 1.0) ) - ((< (-> obj try-count) (the-as uint 10)) - (set! (-> obj difficulty) 0.83334) + ((< (-> this try-count) (the-as uint 10)) + (set! (-> this difficulty) 0.83334) ) - ((< (-> obj try-count) (the-as uint 15)) - (set! (-> obj difficulty) 0.66667) + ((< (-> this try-count) (the-as uint 15)) + (set! (-> this difficulty) 0.66667) ) (else - (set! (-> obj difficulty) 0.5) + (set! (-> this difficulty) 0.5) ) ) - (set! (-> obj lava) (entity-actor-lookup (-> obj entity) 'water-actor 0)) - (set! *ogreboss* (the-as ogreboss (process->ppointer obj))) - (set! (-> obj level) 0.0) - (set! (-> obj vulnerable) #f) - (set! (-> obj bridge-assembled) #f) - (set! (-> obj submerged) #f) - (vector-z-quaternion! (-> obj z-plane) (-> obj root-override quat)) - (set! (-> obj z-plane w) (- (vector-dot (-> obj z-plane) (-> obj root-override trans)))) - (vector-x-quaternion! (-> obj side-dir) (-> obj root-override quat)) - (set! (-> obj far-pos quad) (-> obj root-override trans quad)) + (set! (-> this lava) (entity-actor-lookup (-> this entity) 'water-actor 0)) + (set! *ogreboss* (the-as ogreboss (process->ppointer this))) + (set! (-> this level) 0.0) + (set! (-> this vulnerable) #f) + (set! (-> this bridge-assembled) #f) + (set! (-> this submerged) #f) + (vector-z-quaternion! (-> this z-plane) (-> this root-override quat)) + (set! (-> this z-plane w) (- (vector-dot (-> this z-plane) (-> this root-override trans)))) + (vector-x-quaternion! (-> this side-dir) (-> this root-override quat)) + (set! (-> this far-pos quad) (-> this root-override trans quad)) (let ((f0-38 1.0)) - (set-vector! (-> obj root-override scale) f0-38 f0-38 f0-38 1.0) + (set-vector! (-> this root-override scale) f0-38 f0-38 f0-38 1.0) ) - (vector+*! (-> obj near-pos) (-> obj far-pos) (-> obj z-plane) (the-as float 348160.0)) - (set! (-> obj at-near-spot) #t) - (set! (-> obj try-counted) #f) - (set! (-> obj root-override trans quad) (-> obj near-pos quad)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (vector+*! (-> this near-pos) (-> this far-pos) (-> this z-plane) (the-as float 348160.0)) + (set! (-> this at-near-spot) #t) + (set! (-> this try-counted) #f) + (set! (-> this root-override trans quad) (-> this near-pos quad)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go ogreboss-dead) (go ogreboss-idle) ) diff --git a/test/decompiler/reference/jak1/levels/racer_common/collide-reaction-racer_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/collide-reaction-racer_REF.gc index e451189bac..ef250c41d9 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/collide-reaction-racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/collide-reaction-racer_REF.gc @@ -120,7 +120,7 @@ ) ) (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) - (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) (seconds 0.3)) + (not (time-elapsed? (-> arg0 unknown-dword10) (seconds 0.3))) (not (logtest? sv-104 32)) ) ) @@ -167,7 +167,7 @@ (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) (set! (-> arg0 unknown-vector53 quad) (-> sv-84 quad)) (set! (-> arg0 unknown-float60) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) - (set! (-> arg0 unknown-dword10) (-> *display* base-frame-counter)) + (set-time! (-> arg0 unknown-dword10)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) (set! (-> arg0 ground-touch-point quad) (-> arg1 best-tri intersect quad)) (set! sv-104 (logior sv-104 2048)) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc index b0d9f13ecb..7e0e8f7783 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer-part_REF.gc @@ -33,8 +33,8 @@ (cond ((< (-> *hud-parts* bike-speed 0 offset) 10) (if (< f0-1 (-> arg2 vector 1 z)) - (set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 131072.0 (-> *display* seconds-per-frame)))) - (set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 32768.0 (-> *display* seconds-per-frame)))) + (set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 131072.0 (seconds-per-frame)))) + (set! (-> arg2 vector 1 z) (deg-seek (-> arg2 vector 1 z) f0-1 (* 32768.0 (seconds-per-frame)))) ) ) (else @@ -340,18 +340,18 @@ ) ;; definition for method 3 of type hud-bike-heat -(defmethod inspect hud-bike-heat ((obj hud-bike-heat)) +(defmethod inspect hud-bike-heat ((this hud-bike-heat)) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 19 of type hud-bike-heat ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-bike-heat ((obj hud-bike-heat)) +(defmethod hud-update hud-bike-heat ((this hud-bike-heat)) (if *target* - (tally-value obj (the int (-> *target* racer heat)) 0) + (tally-value this (the int (-> *target* racer heat)) 0) ) 0 (none) @@ -359,60 +359,60 @@ ;; definition for method 20 of type hud-bike-heat ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-bike-heat ((obj hud-bike-heat) (arg0 int)) +(defmethod init-particles! hud-bike-heat ((this hud-bike-heat) (arg0 int)) (add-setting! 'common-page 'set 0.0 2) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 111) obj)) - (set! (-> obj particles s5-0 init-pos x) 13.0) - (set! (-> obj particles s5-0 init-pos y) 370.0) - (set! (-> obj particles s5-0 init-pos z) 10.0) - (set! (-> obj particles s5-0 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 111) this)) + (set! (-> this particles s5-0 init-pos x) 13.0) + (set! (-> this particles s5-0 init-pos y) 370.0) + (set! (-> this particles s5-0 init-pos z) 10.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 112) obj)) - (set! (-> obj particles s5-1 init-pos x) 70.0) - (set! (-> obj particles s5-1 init-pos y) 370.0) - (set! (-> obj particles s5-1 init-pos z) 6.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 112) this)) + (set! (-> this particles s5-1 init-pos x) 70.0) + (set! (-> this particles s5-1 init-pos y) 370.0) + (set! (-> this particles s5-1 init-pos z) 6.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 113) obj)) - (set! (-> obj particles s5-2 init-pos x) 20.0) - (set! (-> obj particles s5-2 init-pos y) 370.0) - (set! (-> obj particles s5-2 init-pos z) 1.0) - (set! (-> obj particles s5-2 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-2 (-> this nb-of-particles))) + (set! (-> this particles s5-2) (new 'static 'hud-particle)) + (set! (-> this particles s5-2 part) (create-launch-control (-> *part-group-id-table* 113) this)) + (set! (-> this particles s5-2 init-pos x) 20.0) + (set! (-> this particles s5-2 init-pos y) 370.0) + (set! (-> this particles s5-2 init-pos z) 1.0) + (set! (-> this particles s5-2 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-3 (-> obj nb-of-particles))) - (set! (-> obj particles s5-3) (new 'static 'hud-particle)) - (set! (-> obj particles s5-3 part) (create-launch-control (-> *part-group-id-table* 114) obj)) - (set! (-> obj particles s5-3 init-pos x) 70.0) - (set! (-> obj particles s5-3 init-pos y) 370.0) - (set! (-> obj particles s5-3 init-pos z) 7.0) - (set! (-> obj particles s5-3 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-3 (-> this nb-of-particles))) + (set! (-> this particles s5-3) (new 'static 'hud-particle)) + (set! (-> this particles s5-3 part) (create-launch-control (-> *part-group-id-table* 114) this)) + (set! (-> this particles s5-3 init-pos x) 70.0) + (set! (-> this particles s5-3 init-pos y) 370.0) + (set! (-> this particles s5-3 init-pos z) 7.0) + (set! (-> this particles s5-3 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-4 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-4 part matrix) -1) - (set! (-> obj particles s5-4 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-4 (-> this nb-of-particles)) + (if (= (-> this particles s5-4 part matrix) -1) + (set! (-> this particles s5-4 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set! (-> obj x-sgn) -1) - (set! (-> obj y-sgn) 1) - (set! (-> obj force-on-screen) #t) + (set! (-> this x-sgn) -1) + (set! (-> this y-sgn) 1) + (set! (-> this force-on-screen) #t) 0 (none) ) @@ -427,18 +427,18 @@ ) ;; definition for method 3 of type hud-bike-speed -(defmethod inspect hud-bike-speed ((obj hud-bike-speed)) +(defmethod inspect hud-bike-speed ((this hud-bike-speed)) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 19 of type hud-bike-speed ;; INFO: Return type mismatch int vs none. -(defmethod hud-update hud-bike-speed ((obj hud-bike-speed)) +(defmethod hud-update hud-bike-speed ((this hud-bike-speed)) (if *target* - (tally-value obj (the int (-> *target* control unknown-float01)) 0) + (tally-value this (the int (-> *target* control unknown-float01)) 0) ) 0 (none) @@ -446,49 +446,49 @@ ;; definition for method 20 of type hud-bike-speed ;; INFO: Return type mismatch int vs none. -(defmethod init-particles! hud-bike-speed ((obj hud-bike-speed) (arg0 int)) +(defmethod init-particles! hud-bike-speed ((this hud-bike-speed) (arg0 int)) (add-setting! 'common-page 'set 0.0 2) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-0 (-> obj nb-of-particles))) - (set! (-> obj particles s5-0) (new 'static 'hud-particle)) - (set! (-> obj particles s5-0 part) (create-launch-control (-> *part-group-id-table* 108) obj)) - (set! (-> obj particles s5-0 init-pos x) 433.0) - (set! (-> obj particles s5-0 init-pos y) 370.0) - (set! (-> obj particles s5-0 init-pos z) 3.0) - (set! (-> obj particles s5-0 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-0 (-> this nb-of-particles))) + (set! (-> this particles s5-0) (new 'static 'hud-particle)) + (set! (-> this particles s5-0 part) (create-launch-control (-> *part-group-id-table* 108) this)) + (set! (-> this particles s5-0 init-pos x) 433.0) + (set! (-> this particles s5-0 init-pos y) 370.0) + (set! (-> this particles s5-0 init-pos z) 3.0) + (set! (-> this particles s5-0 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-1 (-> obj nb-of-particles))) - (set! (-> obj particles s5-1) (new 'static 'hud-particle)) - (set! (-> obj particles s5-1 part) (create-launch-control (-> *part-group-id-table* 109) obj)) - (set! (-> obj particles s5-1 init-pos x) 378.0) - (set! (-> obj particles s5-1 init-pos y) 370.0) - (set! (-> obj particles s5-1 init-pos z) 5.0) - (set! (-> obj particles s5-1 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-1 (-> this nb-of-particles))) + (set! (-> this particles s5-1) (new 'static 'hud-particle)) + (set! (-> this particles s5-1 part) (create-launch-control (-> *part-group-id-table* 109) this)) + (set! (-> this particles s5-1 init-pos x) 378.0) + (set! (-> this particles s5-1 init-pos y) 370.0) + (set! (-> this particles s5-1 init-pos z) 5.0) + (set! (-> this particles s5-1 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (when (< (-> obj nb-of-particles) (-> obj max-nb-of-particles)) - (let ((s5-2 (-> obj nb-of-particles))) - (set! (-> obj particles s5-2) (new 'static 'hud-particle)) - (set! (-> obj particles s5-2 part) (create-launch-control (-> *part-group-id-table* 110) obj)) - (set! (-> obj particles s5-2 init-pos x) 415.0) - (set! (-> obj particles s5-2 init-pos y) 370.0) - (set! (-> obj particles s5-2 init-pos z) 1.0) - (set! (-> obj particles s5-2 part matrix) -1) + (when (< (-> this nb-of-particles) (-> this max-nb-of-particles)) + (let ((s5-2 (-> this nb-of-particles))) + (set! (-> this particles s5-2) (new 'static 'hud-particle)) + (set! (-> this particles s5-2 part) (create-launch-control (-> *part-group-id-table* 110) this)) + (set! (-> this particles s5-2 init-pos x) 415.0) + (set! (-> this particles s5-2 init-pos y) 370.0) + (set! (-> this particles s5-2 init-pos z) 1.0) + (set! (-> this particles s5-2 part matrix) -1) ) - (+! (-> obj nb-of-particles) 1) + (+! (-> this nb-of-particles) 1) ) - (dotimes (s5-3 (-> obj nb-of-particles)) - (if (= (-> obj particles s5-3 part matrix) -1) - (set! (-> obj particles s5-3 part matrix) (sprite-allocate-user-hvdf)) + (dotimes (s5-3 (-> this nb-of-particles)) + (if (= (-> this particles s5-3 part matrix) -1) + (set! (-> this particles s5-3 part matrix) (sprite-allocate-user-hvdf)) ) ) - (set! (-> obj x-sgn) 1) - (set! (-> obj y-sgn) 1) - (set! (-> obj force-on-screen) #t) + (set! (-> this x-sgn) 1) + (set! (-> this y-sgn) 1) + (set! (-> this force-on-screen) #t) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc index 92868792a5..50e090a1e3 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer-states_REF.gc @@ -9,7 +9,7 @@ 'racer ) ((and (= message 'get-pickup) (= (-> block param 0) 3)) - (if (>= (- (-> *display* base-frame-counter) (-> self racer boost-time)) (seconds 1)) + (if (time-elapsed? (-> self racer boost-time) (seconds 1)) (send-event self 'boost (fmax 1.0 (fmin 2.0 (the-as float (-> block param 1))))) ) ) @@ -48,7 +48,7 @@ (('boost) (sound-play "get-blue-eco") (set! (-> self racer boost-sound-id) (sound-play "zoom-boost")) - (set! (-> self racer boost-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer boost-time)) (set! (-> self racer boost-level) (seek (-> self racer boost-level) (-> *RACER-bank* boost-level-max) @@ -154,7 +154,7 @@ (set! (-> self racer stick-lock) #f) (set! (-> self racer stick-off) #f) (set! (-> self racer heavy) #f) - (set! (-> self racer unstuck-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer unstuck-time)) (set! (-> self racer stuck-count) 0) (set! (-> self racer cushion-base) 10240.0) (set! (-> self racer shock-offset) 0.0) @@ -331,7 +331,7 @@ ) (pad-buttons l1 r1) ) - (or (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) + (or (not (time-elapsed? (-> self control unknown-dword11) (seconds 0.1))) (< (vector-dot (-> self control dynam gravity-normal) (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) @@ -352,11 +352,7 @@ ) ) (if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf))) - (or (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) - (* (-> *TARGET-bank* ground-timeout) 2) - ) - (< 75 v1-28) - ) + (or (time-elapsed? (-> self control unknown-dword11) (* (-> *TARGET-bank* ground-timeout) 2)) (< 75 v1-28)) (< 30 v1-28) (< 4096.0 f30-0) ) @@ -384,7 +380,7 @@ (gp-0 #f) ) (when (and (< (fabs (-> self racer bob-mult-trans)) 0.2) - (and (>= (- (-> *display* base-frame-counter) (-> self racer racing-time)) (seconds 0.15)) + (and (time-elapsed? (-> self racer racing-time) (seconds 0.15)) (< 16384.0 (-> self control ground-impact-vel)) ) ) @@ -407,8 +403,8 @@ (set! (-> self racer bob-meta-timer) f0-14) ) (set! (-> self racer bob-mult-trans) (lerp-scale 0.2 2.5 (-> self control ground-impact-vel) 20480.0 81920.0)) - (set! (-> self racer bob-hit-ground-time) (-> *display* base-frame-counter)) - (set! (-> self racer bob-meta-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer bob-hit-ground-time)) + (set-time! (-> self racer bob-meta-time)) (cond ((or s5-0 (and (>= (-> self racer bounce) 1) (< (-> self racer bounce) 2))) (+! (-> self racer bounce) 1) @@ -444,7 +440,7 @@ ) (set! (-> self racer bounce) 0) (loop - (let ((gp-3 (-> *display* base-frame-counter))) + (let ((gp-3 (current-time))) (when (not (ja-group? (-> self draw art-group data 123))) (ja-channel-push! 4 (seconds 0.1)) (ja :group! (-> self draw art-group data 123) :num! (identity (ja-aframe (-> self racer turn-anim-frame) 0))) @@ -452,13 +448,13 @@ (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) - (while (< (- (-> *display* base-frame-counter) gp-3) (seconds 1)) + (while (not (time-elapsed? gp-3 (seconds 1))) (if (or (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (or (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1 x) (>= (fabs (-> self racer turn-anim-frame)) 1.0) ) ) - (set! gp-3 (-> *display* base-frame-counter)) + (set! gp-3 (current-time)) ) (target-racing-turn-anim) (suspend) @@ -481,7 +477,7 @@ ) :post (behavior () (if (= (-> self next-state name) 'target-racing) - (set! (-> self racer racing-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer racing-time)) ) (target-racing-post) ) @@ -493,7 +489,7 @@ :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self racer shock-offsetv) 0.0) (sound-play "zoomer-jump") - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (when arg2 (when (>= (-> self racer hill-ground-value) 0.11) (set! (-> self racer hill-boost) (* 40960.0 (-> self racer hill-ground-value))) @@ -515,7 +511,7 @@ (if (< (-> self racer slide-mode) 0) (set! (-> self racer slide-down-time 0) (the-as time-frame (if (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) - (the-as int (-> *display* base-frame-counter)) + (the-as int (current-time)) 0 ) ) @@ -536,15 +532,13 @@ ) (cond ((cpad-pressed? (-> self control unknown-cpad-info00 number) l1 r1) - (set! (-> self racer slide-down-time 0) (-> *display* base-frame-counter)) + (set-time! (-> self racer slide-down-time 0)) ) ((not (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1)) (set! (-> self racer slide-down-time 0) 0) 0 ) - ((and (>= (- (-> *display* base-frame-counter) (-> self racer slide-down-time 0)) - (the-as time-frame (-> *RACER-bank* slide-hold-time)) - ) + ((and (time-elapsed? (-> self racer slide-down-time 0) (the-as time-frame (-> *RACER-bank* slide-hold-time))) (< (-> self racer slide-mode) 0) (or (< (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) leftx) (the-as uint 64)) (< (the-as uint 192) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) leftx)) @@ -556,7 +550,7 @@ 1 ) ) - (set! (-> self racer slide-enter-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer slide-enter-time)) (set! (-> self racer slide-amp) 1.0) (set! (-> self racer slide-grip-mult) 0.0) ) @@ -573,7 +567,7 @@ ) ) (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (go target-racing) ) @@ -587,7 +581,7 @@ (set! (-> self racer hop?) #f) ) (target-racing-smack-check) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (logior! (-> self control root-prim prim-core action) (collide-action racer-grounded)) ) (mod-var-jump #t #t (cpad-hold? (-> self control unknown-cpad-info00 number) l1 r1) (-> self control transv)) @@ -612,7 +606,7 @@ :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (logior! (-> self control root-prim prim-core action) (collide-action racer-grounded)) (sound-play "zoomer-jump") - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (racer-calc-gravity) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) @@ -638,7 +632,7 @@ ) (pad-buttons l1 r1) ) - (or (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.2)) + (or (not (time-elapsed? (-> self control unknown-dword11) (seconds 0.2))) (< (vector-dot (-> self control dynam gravity-normal) (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) @@ -650,7 +644,7 @@ (go target-racing-jump 2048.0 5324.8 #t) ) (if (and (logtest? (-> self control status) (cshape-moving-flags onsurf)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (go target-racing) ) @@ -726,7 +720,7 @@ :event (-> target-racing-start event) :enter (behavior () (set! (-> self control unknown-surface00) *racer-air-mods*) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (logclear! (-> self control root-prim prim-core action) (collide-action racer-grounded)) @@ -738,7 +732,7 @@ ) (target-racing-smack-check) (racer-buzz 0.3) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (logior! (-> self control root-prim prim-core action) (collide-action racer-grounded)) ) ) @@ -788,7 +782,7 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.3)) (sound-play "oof") ) - (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self game hit-time)) (logior! (-> self state-flags) (state-flags being-attacked)) (set! (-> self racer boost-curve) 0.0) (set! (-> self racer boost-level) 0.0) @@ -937,7 +931,7 @@ (ja-no-eval :group! (-> self draw art-group data 139) :num! (seek! (ja-aframe 240.0 0)) :frame-num 0.0) (until (ja-done? 0) (set! (-> self racer stick-lock) #t) - (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (seconds-per-frame))) (send-event *camera* 'joystick 0.0 1.0) (suspend) (ja :num! (seek! (ja-aframe 240.0 0))) @@ -948,7 +942,7 @@ (until (ja-done? 0) (set! (-> self racer stick-lock) #t) (send-event *camera* 'joystick 0.0 1.0) - (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 12288.0 (seconds-per-frame))) (if (>= (ja-aframe-num 0) 245.0) (set-forward-vel (* 0.5 (-> self control unknown-float01))) ) @@ -975,8 +969,8 @@ (set! (-> self post-hook) target-no-ja-move-post) (ja-channel-set! 0) (ja-post) - (let ((gp-6 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-6) (seconds 2)) + (let ((gp-6 (current-time))) + (until (time-elapsed? gp-6 (seconds 2)) (suspend) ) ) @@ -1002,9 +996,9 @@ ) ) ) - (let ((gp-9 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-9) (seconds 0.75)) - (vector-seek! (-> self draw color-mult) *zero-vector* (* 1.5 (-> *display* seconds-per-frame))) + (let ((gp-9 (current-time))) + (until (time-elapsed? gp-9 (seconds 0.75)) + (vector-seek! (-> self draw color-mult) *zero-vector* (* 1.5 (seconds-per-frame))) (set-forward-vel (* 0.96 (-> self control unknown-float01))) (let ((s5-3 (new-stack-vector0)) (f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -1035,10 +1029,10 @@ (set! (-> self control unknown-float01) 0.0) (set! (-> self post-hook) target-no-stick-post) (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (until v1-154 (suspend) - (set! v1-154 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set! v1-154 (and (time-elapsed? (-> self state-time) (seconds 1)) (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask movie))) ) ) @@ -1056,7 +1050,7 @@ (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self alt-cam-pos quad) (-> (&-> (-> self control) unknown-qword00) 0)) (logior! (-> self state-flags) (state-flags use-alt-cam-pos)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self control trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1102,16 +1096,10 @@ (set! (-> self racer front-rotv) 65536.0) (set! (-> self racer front-rot) (the float - (sar - (shl - (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (-> *display* seconds-per-frame)))) - 48 - ) - 48 - ) + (sar (shl (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (seconds-per-frame)))) 48) 48) ) ) - (+! (-> self racer bottom-rot) (* 364088.88 (-> *display* seconds-per-frame))) + (+! (-> self racer bottom-rot) (* 364088.88 (seconds-per-frame))) (set-twist! (-> self racer front-blade) (the-as float #f) (- (-> self racer front-rot)) (the-as float #f)) (set-twist! (-> self racer bottom-blade) (the-as float #f) (the-as float #f) (- (-> self racer bottom-rot))) ) @@ -1144,20 +1132,14 @@ ) :post (behavior () (let ((gp-0 (new 'stack-no-clear 'vector)) - (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) + (f30-0 (fmin 1.0 (* 0.0044444446 (the float (- (current-time) (-> self state-time)))))) ) (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) (set! (-> gp-0 y) (lerp (-> self control unknown-vector102 y) (-> self control unknown-vector103 y) - (fmax - 0.0 - (fmin - 1.0 - (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (-> *display* base-frame-counter)))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (current-time)))))) ) ) (move-to-point! (-> self control) gp-0) @@ -1168,12 +1150,7 @@ f30-0 ) ) - (let ((f30-1 - (fmax - 0.0 - (fmin 1.0 (* 0.010528533 (+ -279.99 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) - ) - ) + (let ((f30-1 (fmax 0.0 (fmin 1.0 (* 0.010528533 (+ -279.99 (the float (- (current-time) (-> self state-time)))))))) ) (set! (-> self control unknown-vector11 y) (lerp (the-as float (-> self control unknown-uint20)) (-> self racer cushion-base) f30-1) @@ -1195,7 +1172,7 @@ :event target-generic-event-handler :exit (-> target-racing-start exit) :code (behavior ((arg0 handle)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *racer-mods*) (let ((a0-2 (-> *hud-parts* bike-speed))) (if a0-2 @@ -1214,14 +1191,14 @@ (ja :chan 2 :group! (-> self draw art-group data 125) :num! (chan 0)) (ja :chan 3 :group! (-> self draw art-group data 126) :num! (chan 0)) ) - (let ((s5-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.5)) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 0.5)) (set! (-> self racer stick-lock) #t) (set-forward-vel (* 0.9 (-> self control unknown-float01))) (set! (-> self racer turn-anim-targ) 0.0) (set! (-> self racer turn-anim-targ) 0.0) (target-racing-turn-anim) - (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-vector11 y) 6144.0 (* 3.0 (seconds-per-frame))) (suspend) ) ) @@ -1236,7 +1213,7 @@ :exit (-> target-racing-start exit) :code (behavior ((arg0 handle)) (sound-play "zoomer-stop") - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control transv quad) (the-as uint128 0)) (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> self control trans quad)) @@ -1293,17 +1270,11 @@ ) ) ) - (seek! (-> self racer front-rotv) f0-5 (* 54613.332 (-> *display* seconds-per-frame))) + (seek! (-> self racer front-rotv) f0-5 (* 54613.332 (seconds-per-frame))) ) (set! (-> self racer front-rot) (the float - (sar - (shl - (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (-> *display* seconds-per-frame)))) - 48 - ) - 48 - ) + (sar (shl (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (seconds-per-frame)))) 48) 48) ) ) (when (and (< (fabs (deg-diff (-> *RACER-bank* default-front-blade) (-> self racer front-rot))) 1820.4445) @@ -1312,33 +1283,19 @@ (set! (-> self racer front-rotv) 0.0) (set! (-> self racer front-rot) (-> *RACER-bank* default-front-blade)) ) - (+! (-> self racer bottom-rot) (* 364088.88 (-> *display* seconds-per-frame))) + (+! (-> self racer bottom-rot) (* 364088.88 (seconds-per-frame))) (set-twist! (-> self racer front-blade) (the-as float #f) (- (-> self racer front-rot)) (the-as float #f)) (set-twist! (-> self racer bottom-blade) (the-as float #f) (the-as float #f) (- (-> self racer bottom-rot))) (let ((gp-0 (new 'stack-no-clear 'vector)) - (f30-0 - (fmax - 0.0 - (fmin 1.0 (* 0.004761905 (+ -150.0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) - ) - ) + (f30-0 (fmax 0.0 (fmin 1.0 (* 0.004761905 (+ -150.0 (the float (- (current-time) (-> self state-time)))))))) ) - (fmax - 0.0 - (fmin 1.0 (* 0.006666667 (+ -225.0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))))) - ) + (fmax 0.0 (fmin 1.0 (* 0.006666667 (+ -225.0 (the float (- (current-time) (-> self state-time))))))) (vector-lerp! gp-0 (-> self control unknown-vector102) (-> self control unknown-vector103) f30-0) (set! (-> gp-0 y) (lerp (-> self control unknown-vector102 y) (-> self control unknown-vector103 y) - (fmax - 0.0 - (fmin - 1.0 - (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (-> *display* base-frame-counter)))) - ) - ) + (fmax 0.0 (fmin 1.0 (* 0.0044444446 (the float (+ (- (seconds -0.5) (-> self state-time)) (current-time)))))) ) ) (move-to-point! (-> self control) gp-0) @@ -1460,7 +1417,7 @@ ) :post (behavior () (racer-sounds) - (seek! (-> self racer heat) 0.0 (* (-> *RACER-bank* surface-heat-inc) (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) 0.0 (* (-> *RACER-bank* surface-heat-inc) (seconds-per-frame))) (vector+! (-> self racer bike-trans) (-> self control trans) (-> self control unknown-vector12)) (quaternion-copy! (the-as quaternion (-> self racer bike-quat)) (-> self control quat)) (set! (-> self racer bike-scale quad) (-> self control scale quad)) diff --git a/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc index fe57f7160f..02528f50dd 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/racer_REF.gc @@ -32,30 +32,30 @@ ) ;; definition for method 3 of type racer -(defmethod inspect racer ((obj racer)) +(defmethod inspect racer ((this racer)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Textra-trans: ~`vector`P~%" (-> obj extra-trans)) - (format #t "~T~Tcondition: ~D~%" (-> obj condition)) - (format #t "~T~Tcell: ~D~%" (-> obj cell)) - (format #t "~T~Tpath-data[2] @ #x~X~%" (-> obj path-data)) - (format #t "~T~Tpath-target: ~A~%" (-> obj path-target)) - (format #t "~T~Tpath-racer: ~A~%" (-> obj path-racer)) - (format #t "~T~Tauto-get-off: ~A~%" (-> obj auto-get-off)) - (format #t "~T~Tshadow-backup: ~A~%" (-> obj shadow-backup)) - obj + (format #t "~T~Textra-trans: ~`vector`P~%" (-> this extra-trans)) + (format #t "~T~Tcondition: ~D~%" (-> this condition)) + (format #t "~T~Tcell: ~D~%" (-> this cell)) + (format #t "~T~Tpath-data[2] @ #x~X~%" (-> this path-data)) + (format #t "~T~Tpath-target: ~A~%" (-> this path-target)) + (format #t "~T~Tpath-racer: ~A~%" (-> this path-racer)) + (format #t "~T~Tauto-get-off: ~A~%" (-> this auto-get-off)) + (format #t "~T~Tshadow-backup: ~A~%" (-> this shadow-backup)) + this ) ;; definition for method 7 of type racer ;; INFO: Return type mismatch process-drawable vs racer. -(defmethod relocate racer ((obj racer) (arg0 int)) +(defmethod relocate racer ((this racer) (arg0 int)) (countdown (v1-0 2) - (if (-> obj path-data v1-0) - (&+! (-> obj path-data v1-0) arg0) + (if (-> this path-data v1-0) + (&+! (-> this path-data v1-0) arg0) ) ) - (the-as racer ((method-of-type process-drawable relocate) obj arg0)) + (the-as racer ((method-of-type process-drawable relocate) this arg0)) ) ;; failed to figure out what this is: @@ -334,8 +334,8 @@ (racer-effect) (suspend) ) - (let ((s5-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-0) (seconds 1)) + (let ((s5-0 (current-time))) + (until (time-elapsed? s5-0 (seconds 1)) (racer-effect) (suspend) ) @@ -392,8 +392,8 @@ ;; definition for method 11 of type racer ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! racer ((obj racer) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! racer ((this racer) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -407,50 +407,50 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (res-lump-float arg0 'rotoffset)) - (initialize-skeleton obj *racer-sg* '()) - (set! (-> obj shadow-backup) (-> obj draw shadow)) - (set! (-> obj draw shadow-ctrl) *racer-shadow-control*) - (let ((v1-23 (-> obj node-list data))) + (process-drawable-from-entity! this arg0) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) (res-lump-float arg0 'rotoffset)) + (initialize-skeleton this *racer-sg* '()) + (set! (-> this shadow-backup) (-> this draw shadow)) + (set! (-> this draw shadow-ctrl) *racer-shadow-control*) + (let ((v1-23 (-> this node-list data))) (set! (-> v1-23 0 param0) cspace<-transformq+trans!) - (set! (-> v1-23 0 param1) (the-as basic (-> obj root-override trans))) - (set! (-> v1-23 0 param2) (the-as basic (-> obj extra-trans))) + (set! (-> v1-23 0 param1) (the-as basic (-> this root-override trans))) + (set! (-> v1-23 0 param2) (the-as basic (-> this extra-trans))) ) - (set! (-> obj condition) (res-lump-value arg0 'index int)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this condition) (res-lump-value arg0 'index int)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 115) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 115) this)) (dotimes (s5-1 2) - (let ((v1-32 (new 'process 'curve-control obj 'path (the float (+ s5-1 1))))) - (set! (-> obj path-data s5-1) v1-32) + (let ((v1-32 (new 'process 'curve-control this 'path (the float (+ s5-1 1))))) + (set! (-> this path-data s5-1) v1-32) (if v1-32 (logior! (-> v1-32 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) ) - (set! (-> obj path) (-> obj path-target)) - (set-vector! (-> obj extra-trans) 0.0 6144.0 0.0 1.0) - (set! (-> obj auto-get-off) #f) - (move-to-ground (-> obj root-override) 40960.0 40960.0 #t (collide-kind background)) - (set! (-> obj cell) (the-as handle #f)) + (set! (-> this path) (-> this path-target)) + (set-vector! (-> this extra-trans) 0.0 6144.0 0.0 1.0) + (set! (-> this auto-get-off) #f) + (move-to-ground (-> this root-override) 40960.0 40960.0 #t (collide-kind background)) + (set! (-> this cell) (the-as handle #f)) (blocking-plane-spawn (the-as curve-control (if (or (and *target* (logtest? (-> *target* control root-prim prim-core action) (collide-action racer))) - (= (-> obj condition) 3) + (= (-> this condition) 3) ) - (-> obj path-racer) - (-> obj path-target) + (-> this path-racer) + (-> this path-target) ) ) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> obj root-override trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "zoom-teleport" :fo-max 30) (-> this root-override trans)) ) - (go (method-of-object obj wait-for-start)) + (go (method-of-object this wait-for-start)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/racer_common/target-racer-h_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/target-racer-h_REF.gc index f187c5177e..6e93c0df47 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/target-racer-h_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/target-racer-h_REF.gc @@ -97,96 +97,96 @@ ) ;; definition for method 3 of type racer-info -(defmethod inspect racer-info ((obj racer-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tbike-trans: ~`vector`P~%" (-> obj bike-trans)) - (format #t "~Tbike-quat: ~`vector`P~%" (-> obj bike-quat)) - (format #t "~Tbike-scale: ~`vector`P~%" (-> obj bike-scale)) - (format #t "~Tmod-x: ~f~%" (-> obj mod-x)) - (format #t "~Trot: ~`vector`P~%" (-> obj rot)) - (format #t "~Trot-old: ~`vector`P~%" (-> obj rot-old)) - (format #t "~Trotv: ~`vector`P~%" (-> obj rotv)) - (format #t "~Tlean-rotx: (deg ~r)~%" (-> obj lean-rotx)) - (format #t "~Tchange-roty: (deg ~r)~%" (-> obj change-roty)) - (format #t "~Tchange-roty-old: (deg ~r)~%" (-> obj change-roty-old)) - (format #t "~Tquat: ~`vector`P~%" (-> obj quat)) - (format #t "~Tsurface-y: (meters ~m)~%" (-> obj surface-y)) - (format #t "~Tsurface-vy: (meters ~m)~%" (-> obj surface-vy)) - (format #t "~Tsurface-quat: ~`vector`P~%" (-> obj surface-quat)) - (format #t "~Tsurface-quat-smooth: ~`vector`P~%" (-> obj surface-quat-smooth)) - (format #t "~Tcushion-base: (meters ~m)~%" (-> obj cushion-base)) - (format #t "~Tcushion-offset: (meters ~m)~%" (-> obj cushion-offset)) - (format #t "~Tcushion-bob: (meters ~m)~%" (-> obj cushion-bob)) - (format #t "~Tcushion-bob-old: (meters ~m)~%" (-> obj cushion-bob-old)) - (format #t "~Tcushion-smush: #~%" (-> obj cushion-smush)) - (format #t "~Tshock-offset: (meters ~m)~%" (-> obj shock-offset)) - (format #t "~Tshock-offsetv: (meters ~m)~%" (-> obj shock-offsetv)) - (format #t "~Tshock-rotx: (meters ~m)~%" (-> obj shock-rotx)) - (format #t "~Thill-value: ~f~%" (-> obj hill-value)) - (format #t "~Thill-ground-value: ~f~%" (-> obj hill-ground-value)) - (format #t "~Thill-offset: (meters ~m)~%" (-> obj hill-offset)) - (format #t "~Thill-rotx: (deg ~r)~%" (-> obj hill-rotx)) - (format #t "~Thill-boost: (meters ~m)~%" (-> obj hill-boost)) - (format #t "~Tbob-timer: ~f~%" (-> obj bob-timer)) - (format #t "~Tbob-meta-timer: ~f~%" (-> obj bob-meta-timer)) - (format #t "~Tbob-meta-meta-timer: ~f~%" (-> obj bob-meta-meta-timer)) - (format #t "~Tbob-mult-rot: ~f~%" (-> obj bob-mult-rot)) - (format #t "~Tbob-mult-trans: ~f~%" (-> obj bob-mult-trans)) - (format #t "~Tbob-period: ~f~%" (-> obj bob-period)) - (format #t "~Tbob-meta-time: ~D~%" (-> obj bob-meta-time)) - (format #t "~Tbob-hit-ground-time: ~D~%" (-> obj bob-hit-ground-time)) - (format #t "~Tcur-rotx: (deg ~r)~%" (-> obj cur-rotx)) - (format #t "~Ttarg-rotx: (deg ~r)~%" (-> obj targ-rotx)) - (format #t "~Tspeed-rotx: ~f~%" (-> obj speed-rotx)) - (format #t "~Tmult-rotx: (deg ~r)~%" (-> obj mult-rotx)) - (format #t "~Tfront-blade: ~A~%" (-> obj front-blade)) - (format #t "~Tfront-rot: (deg ~r)~%" (-> obj front-rot)) - (format #t "~Tfront-rotv: (deg ~r)~%" (-> obj front-rotv)) - (format #t "~Tbottom-blade: ~A~%" (-> obj bottom-blade)) - (format #t "~Tbottom-rot: (deg ~r)~%" (-> obj bottom-rot)) - (format #t "~Tfront: ~A~%" (-> obj front)) - (format #t "~Tfront-turn: (deg ~r)~%" (-> obj front-turn)) - (format #t "~Ttail: ~A~%" (-> obj tail)) - (format #t "~Ttail-tilt: (deg ~r)~%" (-> obj tail-tilt)) - (format #t "~Ttransv-max: (meters ~m)~%" (-> obj transv-max)) - (format #t "~Tslide-down-time[2] @ #x~X~%" (-> obj slide-down-time)) - (format #t "~Tslide-enter-time: ~D~%" (-> obj slide-enter-time)) - (format #t "~Tslide-mode: ~D~%" (-> obj slide-mode)) - (format #t "~Tslide-amp: ~f~%" (-> obj slide-amp)) - (format #t "~Tslide-grip-mult: ~f~%" (-> obj slide-grip-mult)) - (format #t "~Tslide-shift-x: ~f~%" (-> obj slide-shift-x)) - (format #t "~Tslide-interp: ~f~%" (-> obj slide-interp)) - (format #t "~Theat: ~f~%" (-> obj heat)) - (format #t "~Tboost-time: ~D~%" (-> obj boost-time)) - (format #t "~Tboost-duration: ~D~%" (-> obj boost-duration)) - (format #t "~Tboost-curve: ~f~%" (-> obj boost-curve)) - (format #t "~Tboost-level: ~f~%" (-> obj boost-level)) - (format #t "~Tboost-target: ~f~%" (-> obj boost-target)) - (format #t "~Tboost-output: ~f~%" (-> obj boost-output)) - (format #t "~Thop?: ~A~%" (-> obj hop?)) - (format #t "~Thop-start-y: ~f~%" (-> obj hop-start-y)) - (format #t "~Tbounce: ~D~%" (-> obj bounce)) - (format #t "~Tbounce-hit: ~f~%" (-> obj bounce-hit)) - (format #t "~Tengine-sound-id: ~D~%" (-> obj engine-sound-id)) - (format #t "~Tboost-sound-id: ~D~%" (-> obj boost-sound-id)) - (format #t "~Tengine-sound-pitch: ~f~%" (-> obj engine-sound-pitch)) - (format #t "~Tturn-anim-targ: ~f~%" (-> obj turn-anim-targ)) - (format #t "~Tturn-anim-frame: ~f~%" (-> obj turn-anim-frame)) - (format #t "~Tturn-anim-vel: ~f~%" (-> obj turn-anim-vel)) - (format #t "~Ttail-anim-vel: ~f~%" (-> obj tail-anim-vel)) - (format #t "~Ttail-anim-frame: ~f~%" (-> obj tail-anim-frame)) - (format #t "~Trudd-anim-vel: ~f~%" (-> obj rudd-anim-vel)) - (format #t "~Trudd-anim-frame: ~f~%" (-> obj rudd-anim-frame)) - (format #t "~Tracing-time: ~D~%" (-> obj racing-time)) - (format #t "~Tstick-lock: ~A~%" (-> obj stick-lock)) - (format #t "~Tstick-off: ~A~%" (-> obj stick-off)) - (format #t "~Theavy: ~A~%" (-> obj heavy)) - (format #t "~Tunstuck-time: ~D~%" (-> obj unstuck-time)) - (format #t "~Tstuck-count: ~D~%" (-> obj stuck-count)) - (format #t "~Tscrape-sound-id: ~D~%" (-> obj scrape-sound-id)) - (format #t "~Theat-sound-time: ~D~%" (-> obj heat-sound-time)) - obj +(defmethod inspect racer-info ((this racer-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tbike-trans: ~`vector`P~%" (-> this bike-trans)) + (format #t "~Tbike-quat: ~`vector`P~%" (-> this bike-quat)) + (format #t "~Tbike-scale: ~`vector`P~%" (-> this bike-scale)) + (format #t "~Tmod-x: ~f~%" (-> this mod-x)) + (format #t "~Trot: ~`vector`P~%" (-> this rot)) + (format #t "~Trot-old: ~`vector`P~%" (-> this rot-old)) + (format #t "~Trotv: ~`vector`P~%" (-> this rotv)) + (format #t "~Tlean-rotx: (deg ~r)~%" (-> this lean-rotx)) + (format #t "~Tchange-roty: (deg ~r)~%" (-> this change-roty)) + (format #t "~Tchange-roty-old: (deg ~r)~%" (-> this change-roty-old)) + (format #t "~Tquat: ~`vector`P~%" (-> this quat)) + (format #t "~Tsurface-y: (meters ~m)~%" (-> this surface-y)) + (format #t "~Tsurface-vy: (meters ~m)~%" (-> this surface-vy)) + (format #t "~Tsurface-quat: ~`vector`P~%" (-> this surface-quat)) + (format #t "~Tsurface-quat-smooth: ~`vector`P~%" (-> this surface-quat-smooth)) + (format #t "~Tcushion-base: (meters ~m)~%" (-> this cushion-base)) + (format #t "~Tcushion-offset: (meters ~m)~%" (-> this cushion-offset)) + (format #t "~Tcushion-bob: (meters ~m)~%" (-> this cushion-bob)) + (format #t "~Tcushion-bob-old: (meters ~m)~%" (-> this cushion-bob-old)) + (format #t "~Tcushion-smush: #~%" (-> this cushion-smush)) + (format #t "~Tshock-offset: (meters ~m)~%" (-> this shock-offset)) + (format #t "~Tshock-offsetv: (meters ~m)~%" (-> this shock-offsetv)) + (format #t "~Tshock-rotx: (meters ~m)~%" (-> this shock-rotx)) + (format #t "~Thill-value: ~f~%" (-> this hill-value)) + (format #t "~Thill-ground-value: ~f~%" (-> this hill-ground-value)) + (format #t "~Thill-offset: (meters ~m)~%" (-> this hill-offset)) + (format #t "~Thill-rotx: (deg ~r)~%" (-> this hill-rotx)) + (format #t "~Thill-boost: (meters ~m)~%" (-> this hill-boost)) + (format #t "~Tbob-timer: ~f~%" (-> this bob-timer)) + (format #t "~Tbob-meta-timer: ~f~%" (-> this bob-meta-timer)) + (format #t "~Tbob-meta-meta-timer: ~f~%" (-> this bob-meta-meta-timer)) + (format #t "~Tbob-mult-rot: ~f~%" (-> this bob-mult-rot)) + (format #t "~Tbob-mult-trans: ~f~%" (-> this bob-mult-trans)) + (format #t "~Tbob-period: ~f~%" (-> this bob-period)) + (format #t "~Tbob-meta-time: ~D~%" (-> this bob-meta-time)) + (format #t "~Tbob-hit-ground-time: ~D~%" (-> this bob-hit-ground-time)) + (format #t "~Tcur-rotx: (deg ~r)~%" (-> this cur-rotx)) + (format #t "~Ttarg-rotx: (deg ~r)~%" (-> this targ-rotx)) + (format #t "~Tspeed-rotx: ~f~%" (-> this speed-rotx)) + (format #t "~Tmult-rotx: (deg ~r)~%" (-> this mult-rotx)) + (format #t "~Tfront-blade: ~A~%" (-> this front-blade)) + (format #t "~Tfront-rot: (deg ~r)~%" (-> this front-rot)) + (format #t "~Tfront-rotv: (deg ~r)~%" (-> this front-rotv)) + (format #t "~Tbottom-blade: ~A~%" (-> this bottom-blade)) + (format #t "~Tbottom-rot: (deg ~r)~%" (-> this bottom-rot)) + (format #t "~Tfront: ~A~%" (-> this front)) + (format #t "~Tfront-turn: (deg ~r)~%" (-> this front-turn)) + (format #t "~Ttail: ~A~%" (-> this tail)) + (format #t "~Ttail-tilt: (deg ~r)~%" (-> this tail-tilt)) + (format #t "~Ttransv-max: (meters ~m)~%" (-> this transv-max)) + (format #t "~Tslide-down-time[2] @ #x~X~%" (-> this slide-down-time)) + (format #t "~Tslide-enter-time: ~D~%" (-> this slide-enter-time)) + (format #t "~Tslide-mode: ~D~%" (-> this slide-mode)) + (format #t "~Tslide-amp: ~f~%" (-> this slide-amp)) + (format #t "~Tslide-grip-mult: ~f~%" (-> this slide-grip-mult)) + (format #t "~Tslide-shift-x: ~f~%" (-> this slide-shift-x)) + (format #t "~Tslide-interp: ~f~%" (-> this slide-interp)) + (format #t "~Theat: ~f~%" (-> this heat)) + (format #t "~Tboost-time: ~D~%" (-> this boost-time)) + (format #t "~Tboost-duration: ~D~%" (-> this boost-duration)) + (format #t "~Tboost-curve: ~f~%" (-> this boost-curve)) + (format #t "~Tboost-level: ~f~%" (-> this boost-level)) + (format #t "~Tboost-target: ~f~%" (-> this boost-target)) + (format #t "~Tboost-output: ~f~%" (-> this boost-output)) + (format #t "~Thop?: ~A~%" (-> this hop?)) + (format #t "~Thop-start-y: ~f~%" (-> this hop-start-y)) + (format #t "~Tbounce: ~D~%" (-> this bounce)) + (format #t "~Tbounce-hit: ~f~%" (-> this bounce-hit)) + (format #t "~Tengine-sound-id: ~D~%" (-> this engine-sound-id)) + (format #t "~Tboost-sound-id: ~D~%" (-> this boost-sound-id)) + (format #t "~Tengine-sound-pitch: ~f~%" (-> this engine-sound-pitch)) + (format #t "~Tturn-anim-targ: ~f~%" (-> this turn-anim-targ)) + (format #t "~Tturn-anim-frame: ~f~%" (-> this turn-anim-frame)) + (format #t "~Tturn-anim-vel: ~f~%" (-> this turn-anim-vel)) + (format #t "~Ttail-anim-vel: ~f~%" (-> this tail-anim-vel)) + (format #t "~Ttail-anim-frame: ~f~%" (-> this tail-anim-frame)) + (format #t "~Trudd-anim-vel: ~f~%" (-> this rudd-anim-vel)) + (format #t "~Trudd-anim-frame: ~f~%" (-> this rudd-anim-frame)) + (format #t "~Tracing-time: ~D~%" (-> this racing-time)) + (format #t "~Tstick-lock: ~A~%" (-> this stick-lock)) + (format #t "~Tstick-off: ~A~%" (-> this stick-off)) + (format #t "~Theavy: ~A~%" (-> this heavy)) + (format #t "~Tunstuck-time: ~D~%" (-> this unstuck-time)) + (format #t "~Tstuck-count: ~D~%" (-> this stuck-count)) + (format #t "~Tscrape-sound-id: ~D~%" (-> this scrape-sound-id)) + (format #t "~Theat-sound-time: ~D~%" (-> this heat-sound-time)) + this ) ;; definition of type racer-bank @@ -216,27 +216,27 @@ ) ;; definition for method 3 of type racer-bank -(defmethod inspect racer-bank ((obj racer-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tslide-hold-time: (seconds ~e)~%" (-> obj slide-hold-time)) - (format #t "~Theat-max: ~f~%" (-> obj heat-max)) - (format #t "~Thotcoals-heat-inc: ~f~%" (-> obj hotcoals-heat-inc)) - (format #t "~Tlava-heat-inc: ~f~%" (-> obj lava-heat-inc)) - (format #t "~Tlava-air-heat-inc: ~f~%" (-> obj lava-air-heat-inc)) - (format #t "~Tsurface-heat-inc: ~f~%" (-> obj surface-heat-inc)) - (format #t "~Tjump-heat-inc: ~f~%" (-> obj jump-heat-inc)) - (format #t "~Tlavatube-hotcoals-heat-inc: ~f~%" (-> obj lavatube-hotcoals-heat-inc)) - (format #t "~Tlavatube-lava-heat-inc: ~f~%" (-> obj lavatube-lava-heat-inc)) - (format #t "~Tlavatube-lava-air-heat-inc: ~f~%" (-> obj lavatube-lava-air-heat-inc)) - (format #t "~Tlavatube-surface-heat-inc: ~f~%" (-> obj lavatube-surface-heat-inc)) - (format #t "~Tlavatube-jump-heat-inc: ~f~%" (-> obj lavatube-jump-heat-inc)) - (format #t "~Tboost-curve-max: (meters ~m)~%" (-> obj boost-curve-max)) - (format #t "~Tboost-level-max: (meters ~m)~%" (-> obj boost-level-max)) - (format #t "~Tboost-level-inc: (meters ~m)~%" (-> obj boost-level-inc)) - (format #t "~Tboost-duration: (seconds ~e)~%" (-> obj boost-duration)) - (format #t "~Tdefault-front-blade: (deg ~r)~%" (-> obj default-front-blade)) - (format #t "~Tyellow-projectile-speed: (meters ~m)~%" (-> obj yellow-projectile-speed)) - obj +(defmethod inspect racer-bank ((this racer-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tslide-hold-time: (seconds ~e)~%" (-> this slide-hold-time)) + (format #t "~Theat-max: ~f~%" (-> this heat-max)) + (format #t "~Thotcoals-heat-inc: ~f~%" (-> this hotcoals-heat-inc)) + (format #t "~Tlava-heat-inc: ~f~%" (-> this lava-heat-inc)) + (format #t "~Tlava-air-heat-inc: ~f~%" (-> this lava-air-heat-inc)) + (format #t "~Tsurface-heat-inc: ~f~%" (-> this surface-heat-inc)) + (format #t "~Tjump-heat-inc: ~f~%" (-> this jump-heat-inc)) + (format #t "~Tlavatube-hotcoals-heat-inc: ~f~%" (-> this lavatube-hotcoals-heat-inc)) + (format #t "~Tlavatube-lava-heat-inc: ~f~%" (-> this lavatube-lava-heat-inc)) + (format #t "~Tlavatube-lava-air-heat-inc: ~f~%" (-> this lavatube-lava-air-heat-inc)) + (format #t "~Tlavatube-surface-heat-inc: ~f~%" (-> this lavatube-surface-heat-inc)) + (format #t "~Tlavatube-jump-heat-inc: ~f~%" (-> this lavatube-jump-heat-inc)) + (format #t "~Tboost-curve-max: (meters ~m)~%" (-> this boost-curve-max)) + (format #t "~Tboost-level-max: (meters ~m)~%" (-> this boost-level-max)) + (format #t "~Tboost-level-inc: (meters ~m)~%" (-> this boost-level-inc)) + (format #t "~Tboost-duration: (seconds ~e)~%" (-> this boost-duration)) + (format #t "~Tdefault-front-blade: (deg ~r)~%" (-> this default-front-blade)) + (format #t "~Tyellow-projectile-speed: (meters ~m)~%" (-> this yellow-projectile-speed)) + this ) ;; definition for symbol *RACER-bank*, type racer-bank diff --git a/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc b/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc index 617ef81ebe..690347fdda 100644 --- a/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc +++ b/test/decompiler/reference/jak1/levels/racer_common/target-racer_REF.gc @@ -104,7 +104,7 @@ ((or (-> self racer hop?) (= (-> self next-state name) 'target-racing-bounce)) (lerp-scale 81920.0 163840.0 (-> self control unknown-float01) 0.0 (-> self racer transv-max)) ) - ((>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.6)) + ((time-elapsed? (-> self control unknown-dword11) (seconds 0.6)) (lerp-scale 81920.0 122880.0 (-> self control unknown-float01) 0.0 (-> self racer transv-max)) ) (else @@ -151,7 +151,7 @@ ) ) ) - (seek! (-> self racer slide-amp) 0.0 (* 0.3 (-> *display* seconds-per-frame))) + (seek! (-> self racer slide-amp) 0.0 (* 0.3 (seconds-per-frame))) (if (= (-> self racer slide-amp) 0.0) (set! (-> self racer slide-mode) -1) ) @@ -164,7 +164,7 @@ ;; INFO: Return type mismatch int vs none. (defbehavior racer-xz target ((arg0 float) (arg1 float)) (set! (-> self racer slide-shift-x) arg1) - (seek! (-> self racer slide-interp) 0.0 (-> *display* seconds-per-frame)) + (seek! (-> self racer slide-interp) 0.0 (seconds-per-frame)) (let ((f30-1 (if (or (< (* arg1 arg0) 0.0) (not (racer-on-ground?))) 1.0 @@ -178,7 +178,7 @@ (lerp-scale 91022.22 236657.78 (-> self control unknown-float01) 0.0 (* 0.125 (-> self racer transv-max))) ) ) - (seek! (-> self racer rotv y) (* arg0 f30-1 (- f28-1)) (* f0-18 (-> *display* seconds-per-frame))) + (seek! (-> self racer rotv y) (* arg0 f30-1 (- f28-1)) (* f0-18 (seconds-per-frame))) ) (set! (-> self racer rotv y) (* (-> self racer rotv y) @@ -193,7 +193,7 @@ (set! (-> self racer slide-grip-mult) 1.0) ) (s5-1 - (seek! (-> self racer slide-grip-mult) 1.0 (-> *display* seconds-per-frame)) + (seek! (-> self racer slide-grip-mult) 1.0 (seconds-per-frame)) ) ) (let ((f30-4 (* (deg-diff f30-3 0.0) (-> self racer slide-grip-mult)))) @@ -212,10 +212,7 @@ (vector-rotate-y! (-> self control unknown-vector00) (-> self control unknown-vector00) - (fmax - (fmin f30-4 (* 10922.667 (-> *display* seconds-per-frame))) - (* -10922.667 (-> *display* seconds-per-frame)) - ) + (fmax (fmin f30-4 (* 10922.667 (seconds-per-frame))) (* -10922.667 (seconds-per-frame))) ) ) ) @@ -277,24 +274,18 @@ ) ) ) - (+! (-> self control unknown-vector00 z) (* f1-4 (-> *display* seconds-per-frame))) + (+! (-> self control unknown-vector00 z) (* f1-4 (seconds-per-frame))) ) ) (seek! (-> self racer front-rotv) (+ 65536.0 (* 364088.88 (+ f0-0 (* 0.1 arg1)))) - (* 364088.88 (-> *display* seconds-per-frame)) + (* 364088.88 (seconds-per-frame)) ) ) (set! (-> self racer front-rot) (the float - (sar - (shl - (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (-> *display* seconds-per-frame)))) - 48 - ) - 48 - ) + (sar (shl (the int (+ (-> self racer front-rot) (* (-> self racer front-rotv) (seconds-per-frame)))) 48) 48) ) ) (let* ((f1-12 (-> self control unknown-surface01 fric)) @@ -340,7 +331,7 @@ ) ) (+! (-> self racer bottom-rot) - (* (+ 364088.88 (* 0.32 (fabs (-> self control unknown-vector00 y)))) (-> *display* seconds-per-frame)) + (* (+ 364088.88 (* 0.32 (fabs (-> self control unknown-vector00 y)))) (seconds-per-frame)) ) 0 (none) @@ -352,11 +343,7 @@ (defbehavior racer-cushion target ((arg0 float)) (let ((f30-0 (-> self racer bob-period))) (let ((f28-0 1.0)) - (seek! - (-> self racer bob-meta-timer) - (-> self racer bob-meta-meta-timer) - (* 4.0 (-> *display* seconds-per-frame)) - ) + (seek! (-> self racer bob-meta-timer) (-> self racer bob-meta-meta-timer) (* 4.0 (seconds-per-frame))) (let* ((f0-8 (sin (/ (* 65536.0 (-> self racer bob-timer)) f30-0))) (f0-9 (* 1228.8 (-> self racer bob-mult-trans) f28-0 f0-8)) ) @@ -399,7 +386,7 @@ (set! (-> self racer hill-offset) (lerp (-> self racer hill-offset) 0.0 0.05)) ) ) - (seek! (-> self racer hill-boost) 0.0 (* 81920.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer hill-boost) 0.0 (* 81920.0 (seconds-per-frame))) (set! (-> self racer hill-offset) 0.0) 0 (none) @@ -419,20 +406,20 @@ ) (+! (-> self racer shock-offsetv) (* (- (-> gp-0 y) (-> self control transv y)) f30-0)) (+! (-> self racer shock-offsetv) - (+ (* -20.0 (-> *display* seconds-per-frame) (-> self racer shock-offset)) + (+ (* -20.0 (seconds-per-frame) (-> self racer shock-offset)) (if (racer-on-ground?) - (* (-> self control dynam gravity-length) (-> *display* seconds-per-frame) f30-0) + (* (-> self control dynam gravity-length) (seconds-per-frame) f30-0) 0.0 ) ) ) ) - (if (and (or (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.2)) + (if (and (or (not (time-elapsed? (-> self control unknown-dword11) (seconds 0.2))) (< (-> self racer shock-offset) 0.0) ) (!= (-> self control unknown-surface00 mode) 'air) ) - (+! (-> self racer shock-offset) (* (-> self racer shock-offsetv) (-> *display* seconds-per-frame))) + (+! (-> self racer shock-offset) (* (-> self racer shock-offsetv) (seconds-per-frame))) ) (set! (-> self racer shock-offset) (* (-> self racer shock-offset) (lerp-scale 0.99 0.98 (-> self control unknown-float01) 0.0 28672.0)) @@ -555,11 +542,7 @@ ) ) ) - (seek! - (-> self control unknown-float80) - f0-2 - (* (-> self control unknown-float82) (-> *display* seconds-per-frame)) - ) + (seek! (-> self control unknown-float80) f0-2 (* (-> self control unknown-float82) (seconds-per-frame))) ) (vector-deg-slerp (-> self control dynam gravity-normal) @@ -600,7 +583,7 @@ (if (< 2.5 f0-6) (set! f0-6 2.5) ) - (seek! (-> self racer engine-sound-pitch) f0-6 (* 4.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer engine-sound-pitch) f0-6 (* 4.0 (seconds-per-frame))) ) ) (let ((f0-11 (lerp-scale 100.0 60.0 (-> self racer engine-sound-pitch) 0.8 2.0))) @@ -619,18 +602,18 @@ ((or (logtest? (-> self control status) (cshape-moving-flags onground)) (< 12288.0 (vector-length (-> self control transv))) ) - (let ((v0-5 (the-as object (-> *display* base-frame-counter)))) + (let ((v0-5 (the-as object (current-time)))) (set! (-> self racer unstuck-time) (the-as time-frame v0-5)) v0-5 ) ) - ((>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) (seconds 5)) + ((time-elapsed? (-> self racer unstuck-time) (seconds 5)) (send-event self 'attack #f (static-attack-info ((mode 'heat)))) ) - ((and (>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) (seconds 3)) - (>= (- (-> *display* base-frame-counter) (-> self racer heat-sound-time)) (seconds 1)) + ((and (time-elapsed? (-> self racer unstuck-time) (seconds 3)) + (time-elapsed? (-> self racer heat-sound-time) (seconds 1)) ) - (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer heat-sound-time)) (sound-play "warning") ) ) @@ -803,7 +786,7 @@ (>= (-> self fact-info-target eco-level) 1.0) ) (cpad-pressed? (-> self control unknown-cpad-info00 number) circle square) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) (seconds 0.25)) + (time-elapsed? (-> self control unknown-dword82) (seconds 0.25)) (not (logtest? (-> self state-flags) (state-flags being-attacked dying))) ) (let ((gp-6 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) @@ -826,7 +809,7 @@ :to self ) ) - (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) + (set-time! (-> self control unknown-dword82)) ) (let ((f22-0 (-> *RACER-bank* hotcoals-heat-inc)) (f24-0 (-> *RACER-bank* lava-heat-inc)) @@ -849,24 +832,24 @@ ) (case (-> self control poly-pat material) (((pat-material hotcoals)) - (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f22-1 (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f22-1 (seconds-per-frame))) ) (((pat-material lava)) (if (racer-on-ground?) - (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f24-1 (-> *display* seconds-per-frame))) - (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f28-2 (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f24-1 (seconds-per-frame))) + (seek! (-> self racer heat) (-> *RACER-bank* heat-max) (* f28-2 (seconds-per-frame))) ) ) (else (if (not (racer-on-ground?)) - (seek! (-> self racer heat) 0.0 (* f26-0 (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) 0.0 (* f26-0 (seconds-per-frame))) ) ) ) ) - (let ((v1-189 (- (-> *display* base-frame-counter) (-> self control unknown-dword11)))) + (let ((v1-189 (- (current-time) (-> self control unknown-dword11)))) (if (and (>= v1-189 (seconds 0.9)) (>= (seconds 3) v1-189)) - (seek! (-> self racer heat) 0.0 (* f30-2 (-> *display* seconds-per-frame))) + (seek! (-> self racer heat) 0.0 (* f30-2 (seconds-per-frame))) ) ) ) @@ -876,7 +859,7 @@ (if (and *cheat-mode* *debug-segment* (cpad-pressed? 0 l2)) (send-event self 'boost 1.0) ) - (let ((v1-218 (- (-> *display* base-frame-counter) (-> self racer boost-time)))) + (let ((v1-218 (- (current-time) (-> self racer boost-time)))) (if (< v1-218 (-> self racer boost-duration)) (set! (-> self racer boost-curve) (* (-> *RACER-bank* boost-curve-max) @@ -906,7 +889,7 @@ (set! (-> self racer boost-level) 0.0) ) (set! (-> self racer boost-target) (+ (-> self racer boost-curve) (-> self racer boost-level))) - (seek! (-> self racer boost-output) (-> self racer boost-target) (* 40960.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer boost-output) (-> self racer boost-target) (* 40960.0 (seconds-per-frame))) (when (!= (-> self racer boost-output) 0.0) (dotimes (gp-7 8) (let ((v1-258 (rand-vu-int-range 3 (+ (-> self node-list length) -1)))) @@ -953,12 +936,13 @@ ) (when (and (< (-> self racer heat) (-> *RACER-bank* heat-max)) (and (< (* 0.8 (-> *RACER-bank* heat-max)) (-> self racer heat)) - (>= (- (-> *display* base-frame-counter) (-> self racer heat-sound-time)) - (the int (* 3000.0 (- 1.0 (/ (-> self racer heat) (-> *RACER-bank* heat-max))))) - ) + (time-elapsed? + (-> self racer heat-sound-time) + (the int (* 3000.0 (- 1.0 (/ (-> self racer heat) (-> *RACER-bank* heat-max))))) + ) ) ) - (set! (-> self racer heat-sound-time) (-> *display* base-frame-counter)) + (set-time! (-> self racer heat-sound-time)) (sound-play "warning") ) (when (rand-vu-percent? (/ (-> self racer heat) (-> *RACER-bank* heat-max))) @@ -1008,7 +992,7 @@ 0.0 (* 0.3 (-> self racer transv-max)) ) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) (set! (-> self racer turn-anim-vel) @@ -1022,7 +1006,7 @@ ) ) ) - (+! (-> self racer turn-anim-frame) (* (-> self racer turn-anim-vel) (-> *display* seconds-per-frame))) + (+! (-> self racer turn-anim-frame) (* (-> self racer turn-anim-vel) (seconds-per-frame))) (set! (-> self racer turn-anim-frame) (fmax -20.0 (fmin 20.0 (-> self racer turn-anim-frame)))) (cond ((and (>= (-> self racer turn-anim-frame) 20.0) (>= (-> self racer turn-anim-vel) 0.0)) @@ -1034,14 +1018,14 @@ ) (+! (-> self racer tail-anim-vel) (* -50.0 - (-> *display* seconds-per-frame) + (seconds-per-frame) (- (-> self racer tail-anim-frame) (* -0.0091552725 (- (-> self racer change-roty) (-> self racer change-roty-old))) ) ) ) (set! (-> self racer tail-anim-vel) (fmax -100.0 (fmin 100.0 (* 0.8 (-> self racer tail-anim-vel))))) - (+! (-> self racer tail-anim-frame) (* (-> self racer tail-anim-vel) (-> *display* seconds-per-frame))) + (+! (-> self racer tail-anim-frame) (* (-> self racer tail-anim-vel) (seconds-per-frame))) (set! (-> self racer tail-anim-frame) (fmax -20.0 (fmin 20.0 (-> self racer tail-anim-frame)))) (cond ((and (>= (-> self racer tail-anim-frame) 20.0) (>= (-> self racer tail-anim-vel) 0.0)) @@ -1052,10 +1036,10 @@ ) ) (+! (-> self racer rudd-anim-vel) - (* 40.0 (-> *display* seconds-per-frame) (- (-> self racer tail-anim-frame) (-> self racer rudd-anim-frame))) + (* 40.0 (seconds-per-frame) (- (-> self racer tail-anim-frame) (-> self racer rudd-anim-frame))) ) (set! (-> self racer rudd-anim-vel) (fmax -100.0 (fmin 100.0 (* 0.96 (-> self racer rudd-anim-vel))))) - (+! (-> self racer rudd-anim-frame) (* (-> self racer rudd-anim-vel) (-> *display* seconds-per-frame))) + (+! (-> self racer rudd-anim-frame) (* (-> self racer rudd-anim-vel) (seconds-per-frame))) (set! (-> self racer rudd-anim-frame) (fmax -20.0 (fmin 20.0 (-> self racer rudd-anim-frame)))) (cond ((and (>= (-> self racer rudd-anim-frame) 20.0) (>= (-> self racer rudd-anim-vel) 0.0)) @@ -1150,7 +1134,7 @@ (loop (suspend) (let ((gp-3 (-> self skel root-channel 1))) - (set! f30-1 (seek f30-1 1.0 (-> *display* seconds-per-frame))) + (set! f30-1 (seek f30-1 1.0 (seconds-per-frame))) (set! (-> gp-3 frame-interp) f30-1) ) ) @@ -1325,8 +1309,8 @@ ) (cond ((racer-on-ground?) - (seek! (-> self control unknown-float81) 1.0 (* 8.0 (-> *display* seconds-per-frame))) - (seek! (-> self racer mult-rotx) 0.0 (* 2.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-float81) 1.0 (* 8.0 (seconds-per-frame))) + (seek! (-> self racer mult-rotx) 0.0 (* 2.0 (seconds-per-frame))) (set! (-> self racer targ-rotx) 0.0) (set! (-> self racer hill-rotx) 0.0) (set! (-> self racer speed-rotx) 0.25) @@ -1343,14 +1327,14 @@ (if (< 1.5 (-> self racer bob-meta-meta-timer)) (seek! (-> self racer bob-meta-meta-timer) 1.0 0.5) ) - (when (>= (- (-> *display* base-frame-counter) (-> self racer bob-meta-time)) (seconds 2.2)) - (set! (-> self racer bob-meta-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self racer bob-meta-time) (seconds 2.2)) + (set-time! (-> self racer bob-meta-time)) (set! (-> self racer bob-meta-meta-timer) (rand-vu-float-range 0.8 1.2)) ) ) ) (let ((f0-63 (lerp-scale -1.0 -0.33 (-> self control unknown-float01) 0.0 (-> self racer transv-max)))) - (seek! (-> self racer bob-mult-rot) f0-63 (* 8.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer bob-mult-rot) f0-63 (* 8.0 (seconds-per-frame))) ) (if (< 0.0 f30-1) (set! f30-1 0.0) @@ -1358,8 +1342,8 @@ (set! (-> self racer stick-lock) #f) ) (else - (seek! (-> self control unknown-float81) 0.0 (* 2.0 (-> *display* seconds-per-frame))) - (seek! (-> self racer mult-rotx) 1.0 (* 16.0 (-> *display* seconds-per-frame))) + (seek! (-> self control unknown-float81) 0.0 (* 2.0 (seconds-per-frame))) + (seek! (-> self racer mult-rotx) 1.0 (* 16.0 (seconds-per-frame))) (let ((f0-77 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (the-as vector (-> self control trans-old))) (let* ((v1-128 (-> self racer bounce)) @@ -1393,8 +1377,8 @@ (and (= (-> self next-state name) 'target-racing-bounce) (= (-> self racer bounce) 1)) ) (set! (-> self racer speed-rotx) 0.5) - (when (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) - (seek! (-> self racer hill-rotx) 0.0 (* 65536.0 (-> *display* seconds-per-frame))) + (when (time-elapsed? (-> self control unknown-dword11) (seconds 0.1)) + (seek! (-> self racer hill-rotx) 0.0 (* 65536.0 (seconds-per-frame))) (set! (-> self racer speed-rotx) 0.6) ) ) @@ -1402,7 +1386,7 @@ (set! (-> self racer speed-rotx) 0.25) ) ) - (seek! (-> self racer mult-rotx) 1.0 (* 64.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer mult-rotx) 1.0 (* 64.0 (seconds-per-frame))) ) (else (set! (-> self racer speed-rotx) 0.025) @@ -1414,20 +1398,14 @@ ) (set! (-> self racer bob-timer) (- f0-91 (* (the float (the int (/ f0-91 f1-44))) f1-44))) ) - (seek! (-> self racer bob-mult-rot) 0.0 (* 16.0 (-> *display* seconds-per-frame))) - (seek! (-> self racer bob-mult-trans) 0.0 (* 16.0 (-> *display* seconds-per-frame))) + (seek! (-> self racer bob-mult-rot) 0.0 (* 16.0 (seconds-per-frame))) + (seek! (-> self racer bob-mult-trans) 0.0 (* 16.0 (seconds-per-frame))) (set! f30-1 - (lerp-scale - f30-1 - 1820.4445 - (the float (- (-> *display* base-frame-counter) (-> self control unknown-dword11))) - 0.0 - 900.0 - ) + (lerp-scale f30-1 1820.4445 (the float (- (current-time) (-> self control unknown-dword11))) 0.0 900.0) ) (cond ((and (logtest? (-> self control status) (cshape-moving-flags twall)) - (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (seconds 0.1)) + (and (time-elapsed? (-> self control unknown-dword11) (seconds 0.1)) (or (-> self racer stick-lock) (< (target-move-dist (-> *TARGET-bank* stuck-time)) 4096.0)) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control unknown-cpad-info00 number) r2))) ) @@ -1462,10 +1440,7 @@ (set! (-> self racer change-roty-old) (-> self racer change-roty)) (set! (-> self racer rot y) (the float - (sar - (shl (the int (+ (-> self racer rot y) (* (-> self racer rotv y) (-> *display* seconds-per-frame)))) 48) - 48 - ) + (sar (shl (the int (+ (-> self racer rot y) (* (-> self racer rotv y) (seconds-per-frame)))) 48) 48) ) ) (set! (-> self racer change-roty) 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 211975a7be..03d8be7682 100644 --- a/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc +++ b/test/decompiler/reference/jak1/levels/robocave/cave-trap_REF.gc @@ -25,16 +25,16 @@ ) ;; definition for method 3 of type cave-trap -(defmethod inspect cave-trap ((obj cave-trap)) +(defmethod inspect cave-trap ((this cave-trap)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspider-count: ~D~%" (-> obj spider-count)) - (format #t "~T~Talt-actors: ~A~%" (-> obj alt-actors)) - (format #t "~T~Tspawn-delay: ~D~%" (-> obj spawn-delay)) - (format #t "~T~Tlast-spawn-time: ~D~%" (-> obj last-spawn-time)) - (format #t "~T~Tdebug-targ-pos: #~%" (-> obj debug-targ-pos)) - obj + (format #t "~T~Tspider-count: ~D~%" (-> this spider-count)) + (format #t "~T~Talt-actors: ~A~%" (-> this alt-actors)) + (format #t "~T~Tspawn-delay: ~D~%" (-> this spawn-delay)) + (format #t "~T~Tlast-spawn-time: ~D~%" (-> this last-spawn-time)) + (format #t "~T~Tdebug-targ-pos: #~%" (-> this debug-targ-pos)) + this ) ;; definition of type spider-vent @@ -51,12 +51,12 @@ ) ;; definition for method 3 of type spider-vent -(defmethod inspect spider-vent ((obj spider-vent)) +(defmethod inspect spider-vent ((this spider-vent)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tlast-spawn-time: ~D~%" (-> obj last-spawn-time)) - obj + (format #t "~T~Tlast-spawn-time: ~D~%" (-> this last-spawn-time)) + this ) ;; failed to figure out what this is: @@ -65,11 +65,11 @@ (local-vars (v0-0 object)) (case message (('can-spawn?) - (return (>= (- (-> *display* base-frame-counter) (-> self last-spawn-time)) (seconds 1))) + (return (time-elapsed? (-> self last-spawn-time) (seconds 1))) v0-0 ) (('notify-spawned) - (set! v0-0 (-> *display* base-frame-counter)) + (set! v0-0 (current-time)) (set! (-> self last-spawn-time) (the-as time-frame v0-0)) v0-0 ) @@ -84,10 +84,10 @@ ;; definition for method 11 of type spider-vent ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! spider-vent ((obj spider-vent) (arg0 entity-actor)) - (set! (-> obj last-spawn-time) 0) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! spider-vent ((this spider-vent) (arg0 entity-actor)) + (set! (-> this last-spawn-time) 0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (go spider-vent-idle) (none) ) @@ -122,11 +122,11 @@ ) ;; definition for method 3 of type spawn-baby-spider-best -(defmethod inspect spawn-baby-spider-best ((obj spawn-baby-spider-best)) - (format #t "[~8x] ~A~%" obj 'spawn-baby-spider-best) - (format #t "~Tindex: ~D~%" (-> obj index)) - (format #t "~Tdist: ~f~%" (-> obj dist)) - obj +(defmethod inspect spawn-baby-spider-best ((this spawn-baby-spider-best)) + (format #t "[~8x] ~A~%" this 'spawn-baby-spider-best) + (format #t "~Tindex: ~D~%" (-> this index)) + (format #t "~Tdist: ~f~%" (-> this dist)) + this ) ;; definition of type spawn-baby-spider-work @@ -139,17 +139,17 @@ ) ;; definition for method 3 of type spawn-baby-spider-work -(defmethod inspect spawn-baby-spider-work ((obj spawn-baby-spider-work)) - (format #t "[~8x] ~A~%" obj 'spawn-baby-spider-work) - (format #t "~Tbest[4] @ #x~X~%" (-> obj best)) - obj +(defmethod inspect spawn-baby-spider-work ((this spawn-baby-spider-work)) + (format #t "[~8x] ~A~%" this 'spawn-baby-spider-work) + (format #t "~Tbest[4] @ #x~X~%" (-> this best)) + this ) ;; definition for method 20 of type cave-trap ;; INFO: Used lq/sq -(defmethod cave-trap-method-20 cave-trap ((obj cave-trap)) - (set! (-> obj last-spawn-time) (-> *display* base-frame-counter)) - (set! (-> obj spawn-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.5))) +(defmethod cave-trap-method-20 cave-trap ((this cave-trap)) + (set-time! (-> this last-spawn-time)) + (set! (-> this spawn-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.5))) (let ((s5-0 (new 'stack-no-clear 'spawn-baby-spider-work))) (let ((s4-0 (new 'stack-no-clear 'vector))) (dotimes (v1-2 4) @@ -160,8 +160,8 @@ (vector-normalize! s4-0 102400.0) (vector+! s4-0 s4-0 (camera-pos)) (set! (-> s4-0 y) (-> (target-pos 0) y)) - (dotimes (s3-2 (-> obj alt-actors length)) - (let* ((v1-10 (-> obj alt-actors s3-2)) + (dotimes (s3-2 (-> this alt-actors length)) + (let* ((v1-10 (-> this alt-actors s3-2)) (s1-0 (if v1-10 (-> v1-10 extra process) ) @@ -217,7 +217,7 @@ (dotimes (s4-1 4) (let ((v1-29 (-> s5-0 best s4-1 index))) (when (>= v1-29 0) - (let* ((v1-32 (-> obj alt-actors v1-29)) + (let* ((v1-32 (-> this alt-actors v1-29)) (s2-3 (if v1-32 (-> v1-32 extra process) ) @@ -232,10 +232,10 @@ (vector-! s2-4 (target-pos 0) (-> (the-as process-drawable s3-3) root trans)) (vector-normalize! s2-4 1.0) (init! s1-1 (= (-> s3-3 type) spider-egg) #t #t #t 7 1 'untrigger) - (let ((v1-40 (process-spawn baby-spider obj (-> (the-as process-drawable s3-3) root trans) s2-4 s1-1 :to obj))) + (let ((v1-40 (process-spawn baby-spider this (-> (the-as process-drawable s3-3) root trans) s2-4 s1-1 :to this))) (when v1-40 (set! (-> (the-as baby-spider (-> v1-40 0)) die-if-not-visible?) #t) - (+! (-> obj spider-count) 1) + (+! (-> this spider-count) 1) (send-event s3-3 'notify-spawned) (return #f) ) @@ -293,9 +293,7 @@ (go cave-trap-give-up) ) ) - (if (and (< (-> self spider-count) 8) - (>= (- (-> *display* base-frame-counter) (-> self last-spawn-time)) (-> self spawn-delay)) - ) + (if (and (< (-> self spider-count) 8) (time-elapsed? (-> self last-spawn-time) (-> self spawn-delay))) (cave-trap-method-20 self) ) ) @@ -323,23 +321,23 @@ ;; definition for method 7 of type cave-trap ;; INFO: Return type mismatch process-drawable vs cave-trap. -(defmethod relocate cave-trap ((obj cave-trap) (arg0 int)) - (if (nonzero? (-> obj alt-actors)) - (&+! (-> obj alt-actors) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method cave-trap 7)) this arg0) ) ) ;; definition for method 11 of type cave-trap ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cave-trap ((obj cave-trap) (arg0 entity-actor)) - (set! (-> obj spider-count) 0) - (set! (-> obj spawn-delay) 0) - (set! (-> obj last-spawn-time) 0) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! cave-trap ((this cave-trap) (arg0 entity-actor)) + (set! (-> this spider-count) 0) + (set! (-> this spawn-delay) 0) + (set! (-> this last-spawn-time) 0) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core offense) (collide-offense no-offense)) (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 4096.0) @@ -347,19 +345,19 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj nav nearest-y-threshold) 409600.0) - (logclear! (-> obj root-override nav-flags) (nav-flags navf0)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (process-drawable-from-entity! this arg0) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this nav nearest-y-threshold) 409600.0) + (logclear! (-> this root-override nav-flags) (nav-flags navf0)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s4-1 (entity-actor-count arg0 'alt-actor))) - (set! (-> obj alt-actors) (new 'process 'boxed-array entity-actor s4-1)) + (set! (-> this alt-actors) (new 'process 'boxed-array entity-actor s4-1)) (dotimes (s3-1 s4-1) - (set! (-> obj alt-actors s3-1) (entity-actor-lookup arg0 'alt-actor s3-1)) + (set! (-> this alt-actors s3-1) (entity-actor-lookup arg0 'alt-actor s3-1)) ) ) (go cave-trap-idle) diff --git a/test/decompiler/reference/jak1/levels/robocave/robocave-part_REF.gc b/test/decompiler/reference/jak1/levels/robocave/robocave-part_REF.gc index 35bca4b3c1..a0fb29d984 100644 --- a/test/decompiler/reference/jak1/levels/robocave/robocave-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/robocave/robocave-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type robocave-part -(defmethod inspect robocave-part ((obj robocave-part)) +(defmethod inspect robocave-part ((this robocave-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc b/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc index 433817fdc4..035f056760 100644 --- a/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc +++ b/test/decompiler/reference/jak1/levels/robocave/spider-egg_REF.gc @@ -19,13 +19,13 @@ ) ;; definition for method 3 of type spider-egg -(defmethod inspect spider-egg ((obj spider-egg)) +(defmethod inspect spider-egg ((this spider-egg)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tnotify-actor: ~A~%" (-> obj notify-actor)) - (format #t "~T~Tbroken-look: #~%" (-> obj broken-look)) - obj + (format #t "~T~Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~T~Tbroken-look: #~%" (-> this broken-look)) + this ) ;; failed to figure out what this is: @@ -74,7 +74,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :code (behavior ((arg0 symbol)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) @@ -220,10 +220,10 @@ ;; definition for method 11 of type spider-egg ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! spider-egg ((obj spider-egg) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask attackable)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! spider-egg ((this spider-egg) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask attackable)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -239,34 +239,34 @@ ) (set! (-> s4-0 nav-radius) 4096.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *spider-egg-unbroken-sg* '()) - (setup-lods! (-> obj broken-look) *spider-egg-broken-sg* (-> obj draw art-group) (-> obj entity)) - (set-vector! (-> obj root-override scale) 0.4 0.4 0.4 1.0) - (if (not (move-to-ground (-> obj root-override) 12288.0 40960.0 #t (collide-kind background))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *spider-egg-unbroken-sg* '()) + (setup-lods! (-> this broken-look) *spider-egg-broken-sg* (-> this draw art-group) (-> this entity)) + (set-vector! (-> this root-override scale) 0.4 0.4 0.4 1.0) + (if (not (move-to-ground (-> this root-override) 12288.0 40960.0 #t (collide-kind background))) (go process-drawable-art-error "no ground") ) - (+! (-> obj root-override trans y) -409.6) + (+! (-> this root-override trans y) -409.6) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> s4-1 quad) (-> obj root-override surface-normal quad)) + (set! (-> s4-1 quad) (-> this root-override surface-normal quad)) (+! (-> s4-1 x) (rand-vu-float-range -0.2 0.2)) (+! (-> s4-1 z) (rand-vu-float-range -0.2 0.2)) (vector-normalize! s4-1 1.0) (quaternion-axis-angle! - (-> obj root-override quat) + (-> this root-override quat) (-> s4-1 x) (-> s4-1 y) (-> s4-1 z) (rand-vu-float-range 0.0 65536.0) ) ) - (update-transforms! (-> obj root-override)) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) + (update-transforms! (-> this root-override)) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) (if (> (entity-actor-count arg0 'alt-actor) 0) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj notify-actor) #f) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this notify-actor) #f) ) (go spider-egg-idle #t) (none) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc index 20c40a0c55..b0cc117ef3 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-lightning-mole_REF.gc @@ -150,27 +150,27 @@ ) ;; definition for method 3 of type fleeing-nav-enemy-info -(defmethod inspect fleeing-nav-enemy-info ((obj fleeing-nav-enemy-info)) - (format #t "[~8x] ~A~%" obj 'fleeing-nav-enemy-info) - (format #t "~Tmin-reflect-angle: ~f~%" (-> obj min-reflect-angle)) - (format #t "~Tmax-reflect-angle: ~f~%" (-> obj max-reflect-angle)) - (format #t "~Tmax-boundary-deflection: ~f~%" (-> obj max-boundary-deflection)) - (format #t "~Tdeflection-min-dist: ~f~%" (-> obj deflection-min-dist)) - (format #t "~Tdeflection-max-dist: ~f~%" (-> obj deflection-max-dist)) - (format #t "~Treflection-time: ~D~%" (-> obj reflection-time)) - (format #t "~Ttravel-rotate-speed: ~f~%" (-> obj travel-rotate-speed)) - (format #t "~Tblend_interp_angle: ~f~%" (-> obj blend_interp_angle)) - (format #t "~Tmin-speed-adjust: ~f~%" (-> obj min-speed-adjust)) - (format #t "~Tmax-speed-adjust: ~f~%" (-> obj max-speed-adjust)) - (format #t "~Tspeed-adjust-center: ~f~%" (-> obj speed-adjust-center)) - (format #t "~Tspeed-adjust-range: ~f~%" (-> obj speed-adjust-range)) - (format #t "~Tabort-notice-distance: ~f~%" (-> obj abort-notice-distance)) - (format #t "~Tmin-notice-dist: ~f~%" (-> obj min-notice-dist)) - (format #t "~Tmax-notice-dist: ~f~%" (-> obj max-notice-dist)) - (format #t "~Tmin-stop-chase-dist: ~f~%" (-> obj min-stop-chase-dist)) - (format #t "~Tmax-stop-chase-dist: ~f~%" (-> obj max-stop-chase-dist)) - (format #t "~Tmax-flee-rotation: ~f~%" (-> obj max-flee-rotation)) - obj +(defmethod inspect fleeing-nav-enemy-info ((this fleeing-nav-enemy-info)) + (format #t "[~8x] ~A~%" this 'fleeing-nav-enemy-info) + (format #t "~Tmin-reflect-angle: ~f~%" (-> this min-reflect-angle)) + (format #t "~Tmax-reflect-angle: ~f~%" (-> this max-reflect-angle)) + (format #t "~Tmax-boundary-deflection: ~f~%" (-> this max-boundary-deflection)) + (format #t "~Tdeflection-min-dist: ~f~%" (-> this deflection-min-dist)) + (format #t "~Tdeflection-max-dist: ~f~%" (-> this deflection-max-dist)) + (format #t "~Treflection-time: ~D~%" (-> this reflection-time)) + (format #t "~Ttravel-rotate-speed: ~f~%" (-> this travel-rotate-speed)) + (format #t "~Tblend_interp_angle: ~f~%" (-> this blend_interp_angle)) + (format #t "~Tmin-speed-adjust: ~f~%" (-> this min-speed-adjust)) + (format #t "~Tmax-speed-adjust: ~f~%" (-> this max-speed-adjust)) + (format #t "~Tspeed-adjust-center: ~f~%" (-> this speed-adjust-center)) + (format #t "~Tspeed-adjust-range: ~f~%" (-> this speed-adjust-range)) + (format #t "~Tabort-notice-distance: ~f~%" (-> this abort-notice-distance)) + (format #t "~Tmin-notice-dist: ~f~%" (-> this min-notice-dist)) + (format #t "~Tmax-notice-dist: ~f~%" (-> this max-notice-dist)) + (format #t "~Tmin-stop-chase-dist: ~f~%" (-> this min-stop-chase-dist)) + (format #t "~Tmax-stop-chase-dist: ~f~%" (-> this max-stop-chase-dist)) + (format #t "~Tmax-flee-rotation: ~f~%" (-> this max-flee-rotation)) + this ) ;; definition of type fleeing-nav-enemy @@ -192,17 +192,17 @@ ) ;; definition for method 3 of type fleeing-nav-enemy -(defmethod inspect fleeing-nav-enemy ((obj fleeing-nav-enemy)) +(defmethod inspect fleeing-nav-enemy ((this fleeing-nav-enemy)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tlast-reflection-time: ~D~%" (-> obj last-reflection-time)) - (format #t "~T~Trun-blend-interp: ~f~%" (-> obj run-blend-interp)) - (format #t "~T~Tdesired-travel: #~%" (-> obj desired-travel)) - (format #t "~T~Tsaved-travel: #~%" (-> obj saved-travel)) - (format #t "~T~Tspeed-adjust: ~f~%" (-> obj speed-adjust)) - (format #t "~T~Tflee-info: #~%" (-> obj flee-info)) - obj + (format #t "~T~Tlast-reflection-time: ~D~%" (-> this last-reflection-time)) + (format #t "~T~Trun-blend-interp: ~f~%" (-> this run-blend-interp)) + (format #t "~T~Tdesired-travel: #~%" (-> this desired-travel)) + (format #t "~T~Tsaved-travel: #~%" (-> this saved-travel)) + (format #t "~T~Tspeed-adjust: ~f~%" (-> this speed-adjust)) + (format #t "~T~Tflee-info: #~%" (-> this flee-info)) + this ) ;; definition for function fleeing-nav-enemy-adjust-nav-info @@ -384,7 +384,7 @@ ) ) ) - (when (>= (- (-> *display* base-frame-counter) (-> self last-reflection-time)) (-> self flee-info reflection-time)) + (when (time-elapsed? (-> self last-reflection-time) (-> self flee-info reflection-time)) (let ((s3-0 (new 'stack-no-clear 'matrix)) (s5-2 (new 'stack-no-clear 'vector)) ) @@ -405,7 +405,7 @@ ) ) (if (fleeing-nav-enemy-clip-travel self (-> self desired-travel)) - (set! (-> self last-reflection-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-reflection-time)) ) (fleeing-nav-enemy-adjust-travel self (-> self desired-travel)) (fleeing-nav-enemy-chase-post-func) @@ -562,13 +562,13 @@ ) ;; definition for method 3 of type lightning-mole -(defmethod inspect lightning-mole ((obj lightning-mole)) +(defmethod inspect lightning-mole ((this lightning-mole)) (let ((t9-0 (method-of-type fleeing-nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdebug-vector: #~%" (-> obj debug-vector)) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Tdebug-vector: #~%" (-> this debug-vector)) + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; failed to figure out what this is: @@ -695,12 +695,12 @@ (set! (-> gp-0 quad) (-> self debug-vector quad)) (set! (-> self target-speed) (-> self nav-info run-travel-speed)) (format *stdcon* "tgt-speed ~M defmd ~M~%" (-> self target-speed) (-> self flee-info deflection-max-dist)) - (if (>= (- (-> *display* base-frame-counter) (-> self last-reflection-time)) (-> self flee-info reflection-time)) + (if (time-elapsed? (-> self last-reflection-time) (-> self flee-info reflection-time)) (vector-normalize-copy! (-> self desired-travel) gp-0 (-> self flee-info deflection-max-dist)) ) ) (if (fleeing-nav-enemy-clip-travel self (-> self desired-travel)) - (set! (-> self last-reflection-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-reflection-time)) ) (set! (-> self debug-vector quad) (-> self desired-travel quad)) (fleeing-nav-enemy-adjust-travel self (-> self desired-travel)) @@ -937,9 +937,9 @@ ;; definition for method 43 of type lightning-mole ;; INFO: Return type mismatch symbol vs object. -(defmethod attack-handler lightning-mole ((obj lightning-mole) (arg0 process) (arg1 event-message-block)) +(defmethod attack-handler lightning-mole ((this lightning-mole) (arg0 process) (arg1 event-message-block)) (send-event arg0 'get-attack-count 1) - (when (!= (-> obj state) lightning-mole-yelp) + (when (!= (-> this state) lightning-mole-yelp) (send-event arg0 'jump 32768.0 32768.0) (go lightning-mole-yelp) ) @@ -948,8 +948,8 @@ ;; definition for method 44 of type lightning-mole ;; INFO: Return type mismatch symbol vs object. -(defmethod touch-handler lightning-mole ((obj lightning-mole) (arg0 process) (arg1 event-message-block)) - (when (!= (-> obj state) lightning-mole-yelp) +(defmethod touch-handler lightning-mole ((this lightning-mole) (arg0 process) (arg1 event-message-block)) + (when (!= (-> this state) lightning-mole-yelp) (send-event arg0 'jump 32768.0 32768.0) (go lightning-mole-yelp) ) @@ -1012,8 +1012,8 @@ ;; definition for method 11 of type lightning-mole ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! lightning-mole ((obj lightning-mole) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! lightning-mole ((this lightning-mole) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1029,42 +1029,42 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lightning-mole-sg* '()) - (init-defaults! obj *lightning-mole-nav-enemy-info*) - (logclear! (-> obj nav flags) (nav-control-flags navcf5 navcf6 navcf7)) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj reaction-time) (seconds 0.05)) - (set! (-> obj last-reflection-time) 0) - (set! (-> obj collide-info pause-adjust-distance) 122880.0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj flee-info min-reflect-angle) 10922.667) - (set! (-> obj flee-info max-reflect-angle) 14563.556) - (set! (-> obj flee-info max-boundary-deflection) 18204.445) - (set! (-> obj flee-info deflection-min-dist) 20480.0) - (set! (-> obj flee-info deflection-max-dist) 49152.0) - (set! (-> obj flee-info reflection-time) 225) - (set! (-> obj flee-info travel-rotate-speed) 1820.4445) - (set! (-> obj flee-info blend_interp_angle) 2184.5334) - (set! (-> obj flee-info min-speed-adjust) 0.8) - (set! (-> obj flee-info max-speed-adjust) 1.2) - (set! (-> obj flee-info speed-adjust-center) 40960.0) - (set! (-> obj flee-info speed-adjust-range) 20480.0) - (set! (-> obj flee-info abort-notice-distance) 49152.0) - (set! (-> obj flee-info min-notice-dist) 61440.0) - (set! (-> obj flee-info max-notice-dist) 143360.0) - (set! (-> obj flee-info min-stop-chase-dist) 40960.0) - (set! (-> obj flee-info max-stop-chase-dist) 184320.0) - (set! (-> obj flee-info max-flee-rotation) 364.0889) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lightning-mole-sg* '()) + (init-defaults! this *lightning-mole-nav-enemy-info*) + (logclear! (-> this nav flags) (nav-control-flags navcf5 navcf6 navcf7)) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (set! (-> this reaction-time) (seconds 0.05)) + (set! (-> this last-reflection-time) 0) + (set! (-> this collide-info pause-adjust-distance) 122880.0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this flee-info min-reflect-angle) 10922.667) + (set! (-> this flee-info max-reflect-angle) 14563.556) + (set! (-> this flee-info max-boundary-deflection) 18204.445) + (set! (-> this flee-info deflection-min-dist) 20480.0) + (set! (-> this flee-info deflection-max-dist) 49152.0) + (set! (-> this flee-info reflection-time) 225) + (set! (-> this flee-info travel-rotate-speed) 1820.4445) + (set! (-> this flee-info blend_interp_angle) 2184.5334) + (set! (-> this flee-info min-speed-adjust) 0.8) + (set! (-> this flee-info max-speed-adjust) 1.2) + (set! (-> this flee-info speed-adjust-center) 40960.0) + (set! (-> this flee-info speed-adjust-range) 20480.0) + (set! (-> this flee-info abort-notice-distance) 49152.0) + (set! (-> this flee-info min-notice-dist) 61440.0) + (set! (-> this flee-info max-notice-dist) 143360.0) + (set! (-> this flee-info min-stop-chase-dist) 40960.0) + (set! (-> this flee-info max-stop-chase-dist) 184320.0) + (set! (-> this flee-info max-flee-rotation) 364.0889) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go lightning-mole-gone) ) - ((task-closed? (-> obj entity extra perm task) (task-status need-introduction)) - (go (method-of-object obj nav-enemy-idle)) + ((task-closed? (-> this entity extra perm task) (task-status need-introduction)) + (go (method-of-object this nav-enemy-idle)) ) (else (go lightning-mole-hiding) @@ -1252,11 +1252,11 @@ ) ;; definition for method 3 of type peeper -(defmethod inspect peeper ((obj peeper)) +(defmethod inspect peeper ((this peeper)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1264,7 +1264,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('hide) - (let ((v0-0 (-> *display* base-frame-counter))) + (let ((v0-0 (current-time))) (set! (-> self state-time) v0-0) v0-0 ) @@ -1275,10 +1275,10 @@ (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (not (and *target* (>= 81920.0 (vector-vector-xz-distance (-> self root trans) (-> *target* control trans))))) ) (go peeper-up) @@ -1326,8 +1326,8 @@ ) :code (behavior () (logior! (-> self draw status) (draw-status hidden)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (let* ((f30-0 2.0) @@ -1335,19 +1335,19 @@ (v1-11 (the-as number (logior #x3f800000 v1-10))) ) (countdown (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-11)))) 1)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 5)) (if (nonzero? (-> self sound)) (update! (-> self sound)) ) (spawn (-> self part) (-> self root trans)) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (suspend) ) ) @@ -1392,12 +1392,12 @@ ;; definition for method 11 of type peeper ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! peeper ((obj peeper) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *lightning-mole-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 456) obj)) - (set! (-> obj sound) (new 'process 'ambient-sound arg0 (-> obj root trans))) +(defmethod init-from-entity! peeper ((this peeper) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *lightning-mole-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 456) this)) + (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root trans))) (go peeper-up) (none) ) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc index 1e2a254741..7461a34644 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-obs_REF.gc @@ -12,11 +12,11 @@ ) ;; definition for method 3 of type rolling-part -(defmethod inspect rolling-part ((obj rolling-part)) +(defmethod inspect rolling-part ((this rolling-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type rollingcam @@ -28,35 +28,35 @@ ) ;; definition for method 3 of type rollingcam -(defmethod inspect rollingcam ((obj rollingcam)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect rollingcam ((this rollingcam)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; failed to figure out what this is: @@ -77,12 +77,12 @@ ) ;; definition for method 3 of type pusher-base -(defmethod inspect pusher-base ((obj pusher-base)) +(defmethod inspect pusher-base ((this pusher-base)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmax-frame: ~f~%" (-> obj max-frame)) - obj + (format #t "~T~Tmax-frame: ~f~%" (-> this max-frame)) + this ) ;; definition of type pusher @@ -100,13 +100,13 @@ ) ;; definition for method 3 of type pusher -(defmethod inspect pusher ((obj pusher)) +(defmethod inspect pusher ((this pusher)) (let ((t9-0 (method-of-type pusher-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tcyl: #~%" (-> obj cyl)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tcyl: #~%" (-> this cyl)) + this ) ;; definition of type gorge-pusher @@ -123,12 +123,12 @@ ) ;; definition for method 3 of type gorge-pusher -(defmethod inspect gorge-pusher ((obj gorge-pusher)) +(defmethod inspect gorge-pusher ((this gorge-pusher)) (let ((t9-0 (method-of-type pusher-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmin-frame: ~f~%" (-> obj min-frame)) - obj + (format #t "~T~Tmin-frame: ~f~%" (-> this min-frame)) + this ) ;; failed to figure out what this is: @@ -196,17 +196,17 @@ ;; definition for method 11 of type pusher ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! pusher ((obj pusher) (arg0 entity-actor)) +(defmethod init-from-entity! pusher ((this pusher) (arg0 entity-actor)) (pusher-base-init) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *pusher-sg* '()) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) - (set! (-> obj max-frame) (res-lump-float arg0 'max-frame :default (the float (ja-num-frames 0)))) - (set! (-> obj cyl origin quad) (-> obj root-override trans quad)) - (vector-x-quaternion! (-> obj cyl axis) (-> obj root-override quat)) - (vector-negate! (-> obj cyl axis) (-> obj cyl axis)) - (set! (-> obj cyl length) 36864.0) - (set! (-> obj cyl radius) 20480.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *pusher-sg* '()) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) + (set! (-> this max-frame) (res-lump-float arg0 'max-frame :default (the float (ja-num-frames 0)))) + (set! (-> this cyl origin quad) (-> this root-override trans quad)) + (vector-x-quaternion! (-> this cyl axis) (-> this root-override quat)) + (vector-negate! (-> this cyl axis) (-> this cyl axis)) + (set! (-> this cyl length) 36864.0) + (set! (-> this cyl radius) 20480.0) (go pusher-idle) (none) ) @@ -228,25 +228,25 @@ ;; definition for method 11 of type gorge-pusher ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! gorge-pusher ((obj gorge-pusher) (arg0 entity-actor)) +(defmethod init-from-entity! gorge-pusher ((this gorge-pusher) (arg0 entity-actor)) (pusher-base-init) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *pusher-sg* '()) - (set! (-> obj max-frame) (res-lump-float arg0 'max-frame :default 1.0)) - (set! (-> obj max-frame) (* (-> obj max-frame) (the float (ja-num-frames 0)))) - (set! (-> obj min-frame) (res-lump-float arg0 'min-frame)) - (set! (-> obj min-frame) (* (-> obj min-frame) (the float (ja-num-frames 0)))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *pusher-sg* '()) + (set! (-> this max-frame) (res-lump-float arg0 'max-frame :default 1.0)) + (set! (-> this max-frame) (* (-> this max-frame) (the float (ja-num-frames 0)))) + (set! (-> this min-frame) (res-lump-float arg0 'min-frame)) + (set! (-> this min-frame) (* (-> this min-frame) (the float (ja-num-frames 0)))) (cond ((task-closed? (game-task rolling-race) (task-status need-introduction)) - (let ((v1-6 (-> obj skel root-channel 0))) + (let ((v1-6 (-> this skel root-channel 0))) (set! (-> v1-6 num-func) num-func-identity) - (set! (-> v1-6 frame-num) (-> obj min-frame)) + (set! (-> v1-6 frame-num) (-> this min-frame)) ) ) (else - (let ((v1-10 (-> obj skel root-channel 0))) + (let ((v1-10 (-> this skel root-channel 0))) (set! (-> v1-10 num-func) num-func-identity) - (set! (-> v1-10 frame-num) (-> obj max-frame)) + (set! (-> v1-10 frame-num) (-> this max-frame)) ) ) ) @@ -273,13 +273,13 @@ ) ;; definition for method 3 of type dark-plant -(defmethod inspect dark-plant ((obj dark-plant)) +(defmethod inspect dark-plant ((this dark-plant)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tnum-alts: ~D~%" (-> obj num-alts)) - (format #t "~T~Talts[4] @ #x~X~%" (-> obj alts)) - obj + (format #t "~T~Tnum-alts: ~D~%" (-> this num-alts)) + (format #t "~T~Talts[4] @ #x~X~%" (-> this alts)) + this ) ;; failed to figure out what this is: @@ -376,20 +376,20 @@ (v1-5 (the-as number (logior #x3f800000 v1-4))) (gp-0 (+ (the int (* f30-0 (+ -1.0 (the-as float v1-5)))) 3000)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (when (and (!= (get-task-status (game-task rolling-plants)) (task-status invalid)) (!= (get-task-status (game-task rolling-plants)) 7) ) (cond - ((>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + ((time-elapsed? (-> self state-time) gp-0) (go dark-plant-sprout) ) ((dark-plant-check-target self) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) ((not (dark-plant-has-bad-neighbor self)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (else ) @@ -550,19 +550,19 @@ ;; definition for method 11 of type dark-plant ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! dark-plant ((obj dark-plant) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *dark-plant-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 455) obj)) - (set! (-> obj num-alts) (min 4 (entity-actor-count (-> obj entity) 'alt-actor))) - (dotimes (s5-3 (-> obj num-alts)) - (set! (-> obj alts s5-3) (entity-actor-lookup (-> obj entity) 'alt-actor s5-3)) +(defmethod init-from-entity! dark-plant ((this dark-plant) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *dark-plant-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 455) this)) + (set! (-> this num-alts) (min 4 (entity-actor-count (-> this entity) 'alt-actor))) + (dotimes (s5-3 (-> this num-alts)) + (set! (-> this alts s5-3) (entity-actor-lookup (-> this entity) 'alt-actor s5-3)) ) - (if (zero? (-> obj num-alts)) - (format 0 "ERROR: ~S has no alternates~%" (-> obj name)) + (if (zero? (-> this num-alts)) + (format 0 "ERROR: ~S has no alternates~%" (-> this name)) ) - (dark-plant-randomize obj) + (dark-plant-randomize this) (case (get-task-status (game-task rolling-plants)) (((task-status invalid) (task-status need-resolution)) (go dark-plant-gone) @@ -591,12 +591,12 @@ ) ;; definition for method 3 of type happy-plant -(defmethod inspect happy-plant ((obj happy-plant)) +(defmethod inspect happy-plant ((this happy-plant)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; failed to figure out what this is: @@ -724,9 +724,9 @@ ;; definition for method 11 of type happy-plant ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! happy-plant ((obj happy-plant) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! happy-plant ((this happy-plant) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -737,28 +737,28 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *happy-plant-sg* '()) - (set! (-> obj alt-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *happy-plant-sg* '()) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (case (get-task-status (game-task rolling-plants)) (((task-status invalid)) - (let ((v1-19 (-> obj skel root-channel 0))) - (set! (-> v1-19 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((v1-19 (-> this skel root-channel 0))) + (set! (-> v1-19 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) ) (go happy-plant-opened) ) (((task-status need-resolution)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (let ((v1-23 (-> obj skel root-channel 0))) - (set! (-> v1-23 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((v1-23 (-> this skel root-channel 0))) + (set! (-> v1-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) ) - (logior! (-> obj skel status) (janim-status inited)) + (logior! (-> this skel status) (janim-status inited)) (ja-post) - (logclear! (-> obj skel status) (janim-status inited)) - (vector<-cspace! s5-1 (-> obj node-list data 25)) - (birth-pickup-at-point s5-1 (pickup-type fuel-cell) 55.0 #f obj (the-as fact-info #f)) + (logclear! (-> this skel status) (janim-status inited)) + (vector<-cspace! s5-1 (-> this node-list data 25)) + (birth-pickup-at-point s5-1 (pickup-type fuel-cell) 55.0 #f this (the-as fact-info #f)) ) (go happy-plant-opened) ) @@ -780,10 +780,10 @@ ) ;; definition for method 3 of type race-time -(defmethod inspect race-time ((obj race-time)) - (format #t "[~8x] ~A~%" obj 'race-time) - (format #t "~Tdigit[5] @ #x~X~%" (-> obj digit)) - obj +(defmethod inspect race-time ((this race-time)) + (format #t "[~8x] ~A~%" this 'race-time) + (format #t "~Tdigit[5] @ #x~X~%" (-> this digit)) + this ) ;; definition for function race-time-copy! @@ -910,13 +910,13 @@ ) ;; definition for method 3 of type rolling-start -(defmethod inspect rolling-start ((obj rolling-start)) +(defmethod inspect rolling-start ((this rolling-start)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Twhole-look: #~%" (-> obj whole-look)) - (format #t "~T~Tbroken-look: #~%" (-> obj broken-look)) - obj + (format #t "~T~Twhole-look: #~%" (-> this whole-look)) + (format #t "~T~Tbroken-look: #~%" (-> this broken-look)) + this ) ;; failed to figure out what this is: @@ -1011,14 +1011,14 @@ ) ;; definition for method 3 of type gorge -(defmethod inspect gorge ((obj gorge)) +(defmethod inspect gorge ((this gorge)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcoord: #~%" (-> obj coord)) - (format #t "~T~Tradius: ~f~%" (-> obj radius)) - (format #t "~T~Tthickness: ~f~%" (-> obj thickness)) - obj + (format #t "~T~Tcoord: #~%" (-> this coord)) + (format #t "~T~Tradius: ~f~%" (-> this radius)) + (format #t "~T~Tthickness: ~f~%" (-> this thickness)) + this ) ;; definition for function gorge-init @@ -1058,18 +1058,18 @@ ) ;; definition for method 3 of type gorge-start -(defmethod inspect gorge-start ((obj gorge-start)) +(defmethod inspect gorge-start ((this gorge-start)) (let ((t9-0 (method-of-type gorge inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttasks: ~A~%" (-> obj tasks)) - (format #t "~T~Trecord-time: #~%" (-> obj record-time)) - (format #t "~T~Tthis-time: #~%" (-> obj this-time)) - (format #t "~T~Tstart-banner: ~D~%" (-> obj start-banner)) - (format #t "~T~Tend-banner: ~D~%" (-> obj end-banner)) - (format #t "~T~Ttimer-pos-offset: ~D~%" (-> obj timer-pos-offset)) - (format #t "~T~Tticker: #~%" (-> obj ticker)) - obj + (format #t "~T~Ttasks: ~A~%" (-> this tasks)) + (format #t "~T~Trecord-time: #~%" (-> this record-time)) + (format #t "~T~Tthis-time: #~%" (-> this this-time)) + (format #t "~T~Tstart-banner: ~D~%" (-> this start-banner)) + (format #t "~T~Tend-banner: ~D~%" (-> this end-banner)) + (format #t "~T~Ttimer-pos-offset: ~D~%" (-> this timer-pos-offset)) + (format #t "~T~Tticker: #~%" (-> this ticker)) + this ) ;; definition of type gorge-finish @@ -1086,12 +1086,12 @@ ) ;; definition for method 3 of type gorge-finish -(defmethod inspect gorge-finish ((obj gorge-finish)) +(defmethod inspect gorge-finish ((this gorge-finish)) (let ((t9-0 (method-of-type gorge inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; definition of type gorge-abort @@ -1107,11 +1107,11 @@ ) ;; definition for method 3 of type gorge-abort -(defmethod inspect gorge-abort ((obj gorge-abort)) +(defmethod inspect gorge-abort ((this gorge-abort)) (let ((t9-0 (method-of-type gorge inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for function gorge-behind @@ -1350,8 +1350,8 @@ :code (behavior () (gorge-start-draw-time #t #t) (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (seekl! (-> self timer-pos-offset) 100 (the int (* 3.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) @@ -1373,8 +1373,8 @@ (gorge-trans) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (seekl! (-> self timer-pos-offset) 100 (the int (* 5.0 (-> *display* time-adjust-ratio)))) (when (= (-> self timer-pos-offset) 100) (send-event (ppointer->process (-> *hud-parts* fuel-cell)) 'enable) @@ -1565,18 +1565,18 @@ ;; definition for method 11 of type gorge-start ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! gorge-start ((obj gorge-start) (arg0 entity-actor)) - (set! (-> obj root-override) (the-as collide-shape-moving (new 'process 'trsqv))) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! gorge-start ((this gorge-start) (arg0 entity-actor)) + (set! (-> this root-override) (the-as collide-shape-moving (new 'process 'trsqv))) + (process-drawable-from-entity! this arg0) (let ((a0-3 (new 'stack-no-clear 'vector))) - (set! (-> a0-3 quad) (-> obj root-override trans quad)) + (set! (-> a0-3 quad) (-> this root-override trans quad)) (+! (-> a0-3 y) -8192.0) (gorge-init a0-3 (new 'static 'vector :z 1.0) 102400.0 40960.0) ) - (set! (-> obj tasks) (get-task-control (-> obj entity extra perm task))) - (set! (-> obj start-banner) (the-as handle #f)) - (set! (-> obj end-banner) (the-as handle #f)) - (set! (-> obj timer-pos-offset) 100) + (set! (-> this tasks) (get-task-control (-> this entity extra perm task))) + (set! (-> this start-banner) (the-as handle #f)) + (set! (-> this end-banner) (the-as handle #f)) + (set! (-> this timer-pos-offset) 100) (go gorge-start-idle) (none) ) @@ -1591,11 +1591,11 @@ ) ;; definition for method 3 of type rolling-water -(defmethod inspect rolling-water ((obj rolling-water)) +(defmethod inspect rolling-water ((this rolling-water)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for symbol ripple-for-rolling-water, type object @@ -1616,18 +1616,18 @@ ;; definition for method 22 of type rolling-water ;; INFO: Return type mismatch water-flags vs none. -(defmethod water-vol-method-22 rolling-water ((obj rolling-water)) +(defmethod water-vol-method-22 rolling-water ((this rolling-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) (set! (-> v1-2 waveform) (the-as ripple-wave-set ripple-for-rolling-water)) ) - (logclear! (-> obj flags) (water-flags wt23)) + (logclear! (-> this flags) (water-flags wt23)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc index a14dc92a38..01a06f1b19 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-race-ring_REF.gc @@ -25,20 +25,20 @@ ) ;; definition for method 3 of type race-ring -(defmethod inspect race-ring ((obj race-ring)) +(defmethod inspect race-ring ((this race-ring)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Trot-y: ~f~%" (-> obj rot-y)) - (format #t "~T~Tface-vec: #~%" (-> obj face-vec)) - (format #t "~T~Tpart-track: ~D~%" (-> obj part-track)) - (format #t "~T~Tkeep-part-track-alive: ~A~%" (-> obj keep-part-track-alive)) - (format #t "~T~Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - (format #t "~T~Talt-task: ~D~%" (-> obj alt-task)) - (format #t "~T~Tcyl: #~%" (-> obj cyl)) - (format #t "~T~Told-hips: #~%" (-> obj old-hips)) - obj + (format #t "~T~Trot-y: ~f~%" (-> this rot-y)) + (format #t "~T~Tface-vec: #~%" (-> this face-vec)) + (format #t "~T~Tpart-track: ~D~%" (-> this part-track)) + (format #t "~T~Tkeep-part-track-alive: ~A~%" (-> this keep-part-track-alive)) + (format #t "~T~Ttimeout: ~D~%" (-> this timeout)) + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + (format #t "~T~Talt-task: ~D~%" (-> this alt-task)) + (format #t "~T~Tcyl: #~%" (-> this cyl)) + (format #t "~T~Told-hips: #~%" (-> this old-hips)) + this ) ;; failed to figure out what this is: @@ -750,7 +750,7 @@ (cond ((handle->process (-> self part-track)) (if (-> self keep-part-track-alive) - (set! (-> (the-as part-tracker (-> self part-track process 0)) start-time) (-> *display* base-frame-counter)) + (set-time! (-> (the-as part-tracker (-> self part-track process 0)) start-time)) ) ) ((= (-> self entity extra perm task) (game-task rolling-ring-chase-2)) @@ -990,94 +990,96 @@ ;; definition for method 11 of type race-ring ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! race-ring ((obj race-ring) (arg0 entity-actor)) +(defmethod init-from-entity! race-ring ((this race-ring) (arg0 entity-actor)) (let ((a0-1 arg0)) (if (not (entity-actor-lookup a0-1 'next-actor 0)) - (stack-size-set! (-> obj main-thread) 512) + (stack-size-set! (-> this main-thread) 512) ) ) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *race-ring-sg* '()) - (set! (-> obj root pause-adjust-distance) 122880.0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj part-track) (the-as handle #f)) - (set! (-> obj alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (logior! (-> obj draw status) (draw-status hidden)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "loop-racering" :fo-max 40) (-> obj root trans)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *race-ring-sg* '()) + (set! (-> this root pause-adjust-distance) 122880.0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this part-track) (the-as handle #f)) + (set! (-> this alt-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (logior! (-> this draw status) (draw-status hidden)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "loop-racering" :fo-max 40) (-> this root trans)) ) (let ((f0-1 (res-lump-float arg0 'timeout))) - (set! (-> obj timeout) (the-as time-frame (the int (* 300.0 f0-1)))) + (set! (-> this timeout) (the-as time-frame (the int (* 300.0 f0-1)))) ) (let ((s4-0 (new 'stack-no-clear 'vector))) (cond - ((-> obj link next) - (vector-! (-> obj face-vec) (-> obj link next extra trans) (-> obj root trans)) + ((-> this link next) + (vector-! (-> this face-vec) (-> this link next extra trans) (-> this root trans)) ) - ((-> obj link prev) - (vector-! (-> obj face-vec) (-> obj root trans) (-> obj link prev extra trans)) + ((-> this link prev) + (vector-! (-> this face-vec) (-> this root trans) (-> this link prev extra trans)) ) ) - (vector-flatten! (-> obj face-vec) (-> obj face-vec) (new 'static 'vector :y 1.0)) - (vector-normalize! (-> obj face-vec) 1.0) + (vector-flatten! (-> this face-vec) (-> this face-vec) (new 'static 'vector :y 1.0)) + (vector-normalize! (-> this face-vec) 1.0) (cond - ((and (-> obj link next) (-> obj link prev)) - (vector-! s4-0 (-> obj link prev extra trans) (-> obj root trans)) + ((and (-> this link next) (-> this link prev)) + (vector-! s4-0 (-> this link prev extra trans) (-> this root trans)) (vector-flatten! s4-0 s4-0 (new 'static 'vector :y 1.0)) (vector-normalize! s4-0 1.0) - (vector+! s4-0 s4-0 (-> obj face-vec)) + (vector+! s4-0 s4-0 (-> this face-vec)) (vector-normalize! s4-0 1.0) - (set! (-> obj rot-y) (acos (vector-dot s4-0 (new 'static 'vector :z 1.0)))) + (set! (-> this rot-y) (acos (vector-dot s4-0 (new 'static 'vector :z 1.0)))) (if (< (vector-dot s4-0 (new 'static 'vector :x 1.0)) 0.0) - (set! (-> obj rot-y) (- (-> obj rot-y))) + (set! (-> this rot-y) (- (-> this rot-y))) ) ) (else - (set! (-> obj rot-y) (acos (vector-dot (-> obj face-vec) (new 'static 'vector :z 1.0)))) - (if (< (vector-dot (-> obj face-vec) (new 'static 'vector :x 1.0)) 0.0) - (set! (-> obj rot-y) (- (-> obj rot-y))) + (set! (-> this rot-y) (acos (vector-dot (-> this face-vec) (new 'static 'vector :z 1.0)))) + (if (< (vector-dot (-> this face-vec) (new 'static 'vector :x 1.0)) 0.0) + (set! (-> this rot-y) (- (-> this rot-y))) ) - (+! (-> obj rot-y) 16384.0) + (+! (-> this rot-y) 16384.0) ) ) ) - (+! (-> obj rot-y) (res-lump-float arg0 'rotoffset)) - (set-vector! (-> obj cyl axis) (cos (-> obj rot-y)) 0.0 (- (sin (-> obj rot-y))) 1.0) - (vector+float*! (the-as vector (-> obj cyl)) (-> obj root trans) (-> obj cyl axis) -2048.0) - (set! (-> obj cyl radius) 24576.0) - (set! (-> obj cyl length) 4096.0) + (+! (-> this rot-y) (res-lump-float arg0 'rotoffset)) + (set-vector! (-> this cyl axis) (cos (-> this rot-y)) 0.0 (- (sin (-> this rot-y))) 1.0) + (vector+float*! (the-as vector (-> this cyl)) (-> this root trans) (-> this cyl axis) -2048.0) + (set! (-> this cyl radius) 24576.0) + (set! (-> this cyl length) 4096.0) (cond - ((and (first-ring? obj) - (!= (get-task-status (-> obj entity extra perm task)) (task-status invalid)) - (!= (get-task-status (-> obj entity extra perm task)) 7) + ((and (first-ring? this) + (!= (get-task-status (-> this entity extra perm task)) (task-status invalid)) + (!= (get-task-status (-> this entity extra perm task)) 7) ) - (set! (-> obj alt-task) (res-lump-value (-> obj entity) 'alt-task uint)) - (if (or (= (-> obj alt-task) 0) (= (get-task-status (the-as game-task (-> obj alt-task))) (task-status invalid))) + (set! (-> this alt-task) (res-lump-value (-> this entity) 'alt-task uint)) + (if (or (= (-> this alt-task) 0) + (= (get-task-status (the-as game-task (-> this alt-task))) (task-status invalid)) + ) (go race-ring-active) (go race-ring-wait) ) ) - ((and (last-ring? obj) (= (get-task-status (-> obj entity extra perm task)) (task-status need-resolution))) + ((and (last-ring? this) (= (get-task-status (-> this entity extra perm task)) (task-status need-resolution))) (let ((s5-2 (new 'stack-no-clear 'vector))) - (logclear! (-> obj draw status) (draw-status hidden)) + (logclear! (-> this draw status) (draw-status hidden)) (ja-post) - (vector<-cspace! s5-2 (-> obj node-list data 5)) - (logior! (-> obj draw status) (draw-status hidden)) + (vector<-cspace! s5-2 (-> this node-list data 5)) + (logior! (-> this draw status) (draw-status hidden)) (birth-pickup-at-point s5-2 (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) + (the float (-> this entity extra perm task)) #f - obj + this (the-as fact-info #f) ) ) ) - ((and (last-ring? obj) (!= (get-task-status (-> obj entity extra perm task)) (task-status invalid))) + ((and (last-ring? this) (!= (get-task-status (-> this entity extra perm task)) (task-status invalid))) ) ) - (set! (-> obj event-hook) (-> race-ring-idle event)) + (set! (-> this event-hook) (-> race-ring-idle event)) (go race-ring-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc b/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc index 3a0921b8cc..8d7a0ef169 100644 --- a/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc +++ b/test/decompiler/reference/jak1/levels/rolling/rolling-robber_REF.gc @@ -15,18 +15,18 @@ (set! (-> *camera-other-fov* data) 11650.845) (set! (-> *camera-other-trans* quad) (-> *math-camera* trans quad)) (set! (-> *camera-other-root* quad) (-> *math-camera* trans quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (dotimes (v1-14 (the int (-> *display* time-adjust-ratio))) (set! arg2 (* 0.95 arg2)) ) - (when (and (< (fabs arg2) 13.653334) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.5))) + (when (and (< (fabs arg2) 13.653334) (time-elapsed? (-> self state-time) (seconds 1.5))) (if *target* (process-release? *target*) ) (go-virtual wait) ) - (set! arg1 (+ arg1 (/ (* arg2 (-> *display* seconds-per-frame)) (path-distance (-> self path))))) + (set! arg1 (+ arg1 (/ (* arg2 (seconds-per-frame)) (path-distance (-> self path))))) (cond ((< 1.0 arg1) (set! arg1 (+ -1.0 arg1)) @@ -106,25 +106,25 @@ ) ;; definition for method 3 of type robber -(defmethod inspect robber ((obj robber)) +(defmethod inspect robber ((this robber)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcurve-position: ~f~%" (-> obj curve-position)) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Tfacing: #~%" (-> obj facing)) - (format #t "~T~Ttangent: #~%" (-> obj tangent)) - (format #t "~T~Trun-blend-interp: ~f~%" (-> obj run-blend-interp)) - (format #t "~T~Tnear-timer: ~D~%" (-> obj near-timer)) - (format #t "~T~Tfar-time: ~D~%" (-> obj far-time)) - (format #t "~T~Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~T~Ty-offset-desired: ~f~%" (-> obj y-offset-desired)) - (format #t "~T~Ty-vel: ~f~%" (-> obj y-vel)) - (format #t "~T~Twater-height: ~f~%" (-> obj water-height)) - (format #t "~T~Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~T~Tlast-ambient-time: ~D~%" (-> obj last-ambient-time)) - (format #t "~T~Ttime-to-next-ambient: ~D~%" (-> obj time-to-next-ambient)) - obj + (format #t "~T~Tcurve-position: ~f~%" (-> this curve-position)) + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Tfacing: #~%" (-> this facing)) + (format #t "~T~Ttangent: #~%" (-> this tangent)) + (format #t "~T~Trun-blend-interp: ~f~%" (-> this run-blend-interp)) + (format #t "~T~Tnear-timer: ~D~%" (-> this near-timer)) + (format #t "~T~Tfar-time: ~D~%" (-> this far-time)) + (format #t "~T~Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~T~Ty-offset-desired: ~f~%" (-> this y-offset-desired)) + (format #t "~T~Ty-vel: ~f~%" (-> this y-vel)) + (format #t "~T~Twater-height: ~f~%" (-> this water-height)) + (format #t "~T~Ttimeout: ~D~%" (-> this timeout)) + (format #t "~T~Tlast-ambient-time: ~D~%" (-> this last-ambient-time)) + (format #t "~T~Ttime-to-next-ambient: ~D~%" (-> this time-to-next-ambient)) + this ) ;; failed to figure out what this is: @@ -240,9 +240,7 @@ ;; definition for function robber-move (defbehavior robber-move robber () (+! (-> self curve-position) - (/ (the float - (* (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) (the int (-> self speed))) - ) + (/ (the float (* (- (current-time) (-> *display* old-base-frame-counter)) (the int (-> self speed)))) (path-distance (-> self path)) ) ) @@ -486,7 +484,7 @@ (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (when (>= (- (-> *display* base-frame-counter) (-> self last-ambient-time)) (-> self time-to-next-ambient)) + (when (time-elapsed? (-> self last-ambient-time) (-> self time-to-next-ambient)) (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -496,7 +494,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self last-ambient-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-ambient-time)) (let* ((f30-0 300.0) (f28-0 2.0) (f26-0 2.0) @@ -518,7 +516,7 @@ :event robber-event-handler :enter (behavior () (set! (-> self near-timer) 3000) - (set! (-> self far-time) (-> *display* base-frame-counter)) + (set-time! (-> self far-time)) (set! (-> self y-offset-desired) 0.0) ) :trans (behavior () @@ -531,16 +529,15 @@ (when (and *target* (>= 102400.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) ) - (set! (-> self near-timer) (- (the-as time-frame (-> self near-timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) + (set! (-> self near-timer) + (- (the-as time-frame (-> self near-timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) (if (<= (-> self near-timer) 0) (go robber-tired) ) - (set! (-> self far-time) (-> *display* base-frame-counter)) + (set-time! (-> self far-time)) ) - (if (>= (- (-> *display* base-frame-counter) (-> self far-time)) (seconds 3)) + (if (time-elapsed? (-> self far-time) (seconds 3)) (set! (-> self near-timer) (the-as int (-> self timeout))) ) ) @@ -555,7 +552,7 @@ (robber-move) (robber-rotate (the-as target #f) 1820.4445) (suspend) - (when (>= (- (-> *display* base-frame-counter) (-> self last-ambient-time)) (-> self time-to-next-ambient)) + (when (time-elapsed? (-> self last-ambient-time) (-> self time-to-next-ambient)) (ja-channel-push! 1 (seconds 0.2)) (ja-no-eval :group! (-> self draw art-group data 11) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -565,7 +562,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self last-ambient-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-ambient-time)) (let* ((f30-0 300.0) (f28-0 3.0) (f26-0 5.0) @@ -683,8 +680,8 @@ ;; definition for method 11 of type robber ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! robber ((obj robber) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! robber ((this robber) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -701,43 +698,43 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *robber-sg* '()) - (set! (-> obj root-override pause-adjust-distance) 122880.0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *robber-sg* '()) + (set! (-> this root-override pause-adjust-distance) 122880.0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj curve-position) (res-lump-float (-> obj entity) 'initial-spline-pos)) - (eval-path-curve! (-> obj path) (-> obj root-override trans) (-> obj curve-position) 'interp) - (path-control-method-14 (-> obj path) (-> obj tangent) (-> obj curve-position)) - (set! (-> obj facing quad) (-> obj tangent quad)) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (set! (-> this curve-position) (res-lump-float (-> this entity) 'initial-spline-pos)) + (eval-path-curve! (-> this path) (-> this root-override trans) (-> this curve-position) 'interp) + (path-control-method-14 (-> this path) (-> this tangent) (-> this curve-position)) + (set! (-> this facing quad) (-> this tangent quad)) (let ((s4-1 (new 'stack-no-clear 'matrix))) - (forward-down->inv-matrix s4-1 (-> obj facing) (new 'static 'vector :y -1.0)) - (matrix->quaternion (-> obj root-override quat) s4-1) + (forward-down->inv-matrix s4-1 (-> this facing) (new 'static 'vector :y -1.0)) + (matrix->quaternion (-> this root-override quat) s4-1) ) - (set! (-> obj y-vel) 0.0) - (set! (-> obj water-height) (res-lump-float (-> obj entity) 'water-height)) + (set! (-> this y-vel) 0.0) + (set! (-> this water-height) (res-lump-float (-> this entity) 'water-height)) (robber-find-ground) - (set! (-> obj y-offset) (-> obj y-offset-desired)) + (set! (-> this y-offset) (-> this y-offset-desired)) (let ((f0-14 (res-lump-float arg0 'timeout :default 10.0))) - (set! (-> obj timeout) (the-as time-frame (the int (* 300.0 f0-14)))) + (set! (-> this timeout) (the-as time-frame (the int (* 300.0 f0-14)))) ) - (set! (-> obj last-ambient-time) 0) - (set! (-> obj time-to-next-ambient) 0) - (set! (-> obj speed) 0.0) - (let ((v1-42 (-> obj entity extra perm))) + (set! (-> this last-ambient-time) 0) + (set! (-> this time-to-next-ambient) 0) + (set! (-> this speed) 0.0) + (let ((v1-42 (-> this entity extra perm))) (logior! (-> v1-42 status) (entity-perm-status user-set-from-cstage)) (if (nonzero? (-> v1-42 user-object 1)) (go robber-die) ) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go robber-dead) (go robber-initial) ) 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 4034190050..f46679d1bb 100644 --- a/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/ice-cube_REF.gc @@ -50,27 +50,27 @@ ) ;; definition for method 3 of type ice-cube -(defmethod inspect ice-cube ((obj ice-cube)) +(defmethod inspect ice-cube ((this ice-cube)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tpart3: ~A~%" (-> obj part3)) - (format #t "~T~Tpart4: ~A~%" (-> obj part4)) - (format #t "~T~Ttrack-target?: ~A~%" (-> obj track-target?)) - (format #t "~T~Tslow-down?: ~A~%" (-> obj slow-down?)) - (format #t "~T~Ttracking-player?: ~A~%" (-> obj tracking-player?)) - (format #t "~T~Tforce-spawn-pt: ~D~%" (-> obj force-spawn-pt)) - (format #t "~T~Tspeed: ~f~%" (-> obj speed)) - (format #t "~T~Tanim-blend: ~f~%" (-> obj anim-blend)) - (format #t "~T~Tprev-charge-angle-diff: ~f~%" (-> obj prev-charge-angle-diff)) - (format #t "~T~Tcharge-angle: ~f~%" (-> obj charge-angle)) - (format #t "~T~Tground-y: ~f~%" (-> obj ground-y)) - (format #t "~T~Tcprims-type: ~D~%" (-> obj cprims-type)) - (format #t "~T~Tnext-skid-sound-time: ~D~%" (-> obj next-skid-sound-time)) - (format #t "~T~Tstarting-pos: #~%" (-> obj starting-pos)) - (format #t "~T~Ttarget-pt: #~%" (-> obj target-pt)) - obj + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tpart3: ~A~%" (-> this part3)) + (format #t "~T~Tpart4: ~A~%" (-> this part4)) + (format #t "~T~Ttrack-target?: ~A~%" (-> this track-target?)) + (format #t "~T~Tslow-down?: ~A~%" (-> this slow-down?)) + (format #t "~T~Ttracking-player?: ~A~%" (-> this tracking-player?)) + (format #t "~T~Tforce-spawn-pt: ~D~%" (-> this force-spawn-pt)) + (format #t "~T~Tspeed: ~f~%" (-> this speed)) + (format #t "~T~Tanim-blend: ~f~%" (-> this anim-blend)) + (format #t "~T~Tprev-charge-angle-diff: ~f~%" (-> this prev-charge-angle-diff)) + (format #t "~T~Tcharge-angle: ~f~%" (-> this charge-angle)) + (format #t "~T~Tground-y: ~f~%" (-> this ground-y)) + (format #t "~T~Tcprims-type: ~D~%" (-> this cprims-type)) + (format #t "~T~Tnext-skid-sound-time: ~D~%" (-> this next-skid-sound-time)) + (format #t "~T~Tstarting-pos: #~%" (-> this starting-pos)) + (format #t "~T~Ttarget-pt: #~%" (-> this target-pt)) + this ) ;; failed to figure out what this is: @@ -499,8 +499,8 @@ ;; definition for method 47 of type ice-cube ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision ice-cube ((obj ice-cube)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision ice-cube ((this ice-cube)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -556,22 +556,22 @@ (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) - (set! (-> obj cprims-type) (the-as uint 0)) - (set-root-prim-collide-with! (-> obj collide-info) (collide-kind target)) - (set! (-> obj collide-info event-self) 'touched) - (nav-enemy-method-57 obj) + (set! (-> this cprims-type) (the-as uint 0)) + (set-root-prim-collide-with! (-> this collide-info) (collide-kind target)) + (set! (-> this collide-info event-self) 'touched) + (nav-enemy-method-57 this) 0 (none) ) ;; definition for method 57 of type ice-cube ;; INFO: Return type mismatch vector vs none. -(defmethod nav-enemy-method-57 ice-cube ((obj ice-cube)) - (when (!= (-> obj cprims-type) 1) - (set! (-> obj cprims-type) (the-as uint 1)) - (let ((v1-3 (-> obj collide-info root-prim))) +(defmethod nav-enemy-method-57 ice-cube ((this ice-cube)) + (when (!= (-> this cprims-type) 1) + (set! (-> this cprims-type) (the-as uint 1)) + (let ((v1-3 (-> this collide-info root-prim))) (set-vector! (-> v1-3 local-sphere) 0.0 12288.0 0.0 14745.6) (set-vector! (-> (the-as collide-shape-prim-group v1-3) prims 3 local-sphere) 819.2 0.0 0.0 2048.0) (set-vector! (-> (the-as collide-shape-prim-group v1-3) prims 4 local-sphere) 0.0 2048.0 0.0 4505.6) @@ -582,10 +582,10 @@ ;; definition for method 58 of type ice-cube ;; INFO: Return type mismatch vector vs none. -(defmethod nav-enemy-method-58 ice-cube ((obj ice-cube)) - (when (!= (-> obj cprims-type) 2) - (set! (-> obj cprims-type) (the-as uint 2)) - (let ((v1-3 (-> obj collide-info root-prim))) +(defmethod nav-enemy-method-58 ice-cube ((this ice-cube)) + (when (!= (-> this cprims-type) 2) + (set! (-> this cprims-type) (the-as uint 2)) + (let ((v1-3 (-> this collide-info root-prim))) (set-vector! (-> v1-3 local-sphere) 0.0 12288.0 0.0 16384.0) (set-vector! (-> (the-as collide-shape-prim-group v1-3) prims 3 local-sphere) 819.2 0.0 0.0 4915.2) (set-vector! (-> (the-as collide-shape-prim-group v1-3) prims 4 local-sphere) 0.0 2048.0 0.0 9420.8) @@ -596,64 +596,64 @@ ;; definition for method 48 of type ice-cube ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 ice-cube ((obj ice-cube)) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-skeleton obj *ice-cube-sg* '()) - (init-defaults! obj *ice-cube-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 ice-cube ((this ice-cube)) + (process-drawable-from-entity! this (-> this entity)) + (initialize-skeleton this *ice-cube-sg* '()) + (init-defaults! this *ice-cube-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) ;; definition for method 10 of type ice-cube -(defmethod deactivate ice-cube ((obj ice-cube)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate ice-cube ((this ice-cube)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj part3)) - (kill-and-free-particles (-> obj part3)) + (if (nonzero? (-> this part3)) + (kill-and-free-particles (-> this part3)) ) - (if (nonzero? (-> obj part4)) - (kill-and-free-particles (-> obj part4)) + (if (nonzero? (-> this part4)) + (kill-and-free-particles (-> this part4)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type ice-cube ;; INFO: Return type mismatch nav-enemy vs ice-cube. -(defmethod relocate ice-cube ((obj ice-cube) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate ice-cube ((this ice-cube) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj part3)) - (&+! (-> obj part3) arg0) + (if (nonzero? (-> this part3)) + (&+! (-> this part3) arg0) ) - (if (nonzero? (-> obj part4)) - (&+! (-> obj part4) arg0) + (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)) obj arg0)) + (the-as ice-cube ((the-as (function nav-enemy int nav-enemy) (find-parent-method ice-cube 7)) this arg0)) ) ;; definition for method 11 of type ice-cube ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ice-cube ((obj ice-cube) (arg0 entity-actor)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 507) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 508) obj)) - (set! (-> obj part3) (create-launch-control (-> *part-group-id-table* 509) obj)) - (set! (-> obj part4) (create-launch-control (-> *part-group-id-table* 567) obj)) - (initialize-collision obj) - (nav-enemy-method-48 obj) - (let ((s4-0 (-> obj path curve num-cverts))) +(defmethod init-from-entity! ice-cube ((this ice-cube) (arg0 entity-actor)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 507) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 508) this)) + (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 509) this)) + (set! (-> this part4) (create-launch-control (-> *part-group-id-table* 567) this)) + (initialize-collision this) + (nav-enemy-method-48 this) + (let ((s4-0 (-> this path curve num-cverts))) (if (<= s4-0 0) (go process-drawable-art-error "no path") ) (let ((v1-21 (res-lump-value arg0 'mode uint128 :default (the-as uint128 -1)))) (if (and (>= (the-as int v1-21) 0) (< (the-as int v1-21) s4-0)) - (set! (-> obj force-spawn-pt) (the-as int v1-21)) - (set! (-> obj force-spawn-pt) -1) + (set! (-> this force-spawn-pt) (the-as int v1-21)) + (set! (-> this force-spawn-pt) -1) ) ) ) @@ -663,16 +663,16 @@ ;; definition for method 60 of type ice-cube ;; INFO: Used lq/sq -(defmethod nav-enemy-method-60 ice-cube ((obj ice-cube) (arg0 symbol)) +(defmethod nav-enemy-method-60 ice-cube ((this ice-cube) (arg0 symbol)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (when (-> obj tracking-player?) + (when (-> this tracking-player?) (if (and *target* arg0) - (set! (-> obj target-pt quad) (-> (target-pos 0) quad)) + (set! (-> this target-pt quad) (-> (target-pos 0) quad)) ) ) - (vector-! gp-0 (-> obj target-pt) (-> obj collide-info trans)) - (seek-toward-heading-vec! (-> obj collide-info) gp-0 524288.0 (seconds 0.1)) - (let ((v0-5 (< (fabs (deg- (quaternion-y-angle (-> obj collide-info quat)) (vector-y-angle gp-0))) 364.0889))) + (vector-! gp-0 (-> this target-pt) (-> this collide-info trans)) + (seek-toward-heading-vec! (-> this collide-info) gp-0 524288.0 (seconds 0.1)) + (let ((v0-5 (< (fabs (deg- (quaternion-y-angle (-> this collide-info quat)) (vector-y-angle gp-0))) 364.0889))) (b! #t cfg-10 :delay (nop!)) (the-as none 0) (set! v0-5 (the-as symbol #f)) @@ -684,7 +684,7 @@ ;; definition for method 51 of type ice-cube ;; INFO: Used lq/sq -(defmethod ice-cube-method-51 ice-cube ((obj ice-cube) (arg0 vector) (arg1 vector)) +(defmethod ice-cube-method-51 ice-cube ((this ice-cube) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let* ((s4-0 (new 'stack-no-clear 'collide-tri-result)) (f0-0 40960.0) @@ -697,7 +697,7 @@ s5-0 f30-0 (collide-kind background) - (-> obj collide-info process) + (-> this collide-info process) s4-0 (new 'static 'pat-surface :noentity #x1) ) @@ -716,13 +716,13 @@ ;; definition for method 52 of type ice-cube ;; INFO: Used lq/sq -(defmethod nav-enemy-method-52 ice-cube ((obj ice-cube) (arg0 vector)) +(defmethod nav-enemy-method-52 ice-cube ((this ice-cube) (arg0 vector)) (when *target* (let ((f0-0 (vector-vector-xz-distance arg0 (target-pos 0)))) - (when (and (>= f0-0 40960.0) (>= 81920.0 f0-0) (not (nav-enemy-method-50 obj arg0))) + (when (and (>= f0-0 40960.0) (>= 81920.0 f0-0) (not (nav-enemy-method-50 this arg0))) (let ((a0-4 (new 'stack-no-clear 'vector))) (set! (-> a0-4 quad) (-> arg0 quad)) - (set! (-> a0-4 w) (-> obj collide-info root-prim local-sphere w)) + (set! (-> a0-4 w) (-> this collide-info root-prim local-sphere w)) (if (sphere-in-view-frustum? (the-as sphere a0-4)) (return #t) ) @@ -735,15 +735,15 @@ ;; definition for method 53 of type ice-cube ;; INFO: Used lq/sq -(defmethod ice-cube-method-53 ice-cube ((obj ice-cube) (arg0 vector) (arg1 vector)) +(defmethod ice-cube-method-53 ice-cube ((this ice-cube) (arg0 vector) (arg1 vector)) (local-vars (s1-0 int) (s2-0 int)) - (let ((s3-0 (-> obj path curve num-cverts))) + (let ((s3-0 (-> this path curve num-cverts))) (if (<= s3-0 0) (return #f) ) (cond - ((>= (-> obj force-spawn-pt) 0) - (set! s1-0 (-> obj force-spawn-pt)) + ((>= (-> this force-spawn-pt) 0) + (set! s1-0 (-> this force-spawn-pt)) (set! s2-0 1) ) (else @@ -752,8 +752,8 @@ ) ) (while (> s2-0 0) - (eval-path-curve-div! (-> obj path) arg0 (the float s1-0) 'interp) - (when (nav-enemy-method-52 obj arg0) + (eval-path-curve-div! (-> this path) arg0 (the float s1-0) 'interp) + (when (nav-enemy-method-52 this arg0) (let ((a1-3 (new 'stack-no-clear 'vector)) (s3-1 (new 'stack-no-clear 'collide-tri-result)) ) @@ -765,7 +765,7 @@ (new 'static 'vector :y -32768.0 :w 1.0) 409.6 (collide-kind background) - obj + this s3-1 (new 'static 'pat-surface :noentity #x1) ) @@ -948,7 +948,7 @@ (defstate ice-cube-face-player (ice-cube) :event ice-cube-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-method-57 self) (logclear! (-> self mask) (process-mask actor-pause)) @@ -984,7 +984,7 @@ (set! (-> self collide-info transv y) f30-0) ) ) - (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) (let* ((v1-26 (>= 0.0 (-> self collide-info transv y))) (v1-27 (and v1-26 (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)))) ) @@ -1013,7 +1013,7 @@ #f #f ) - (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) (set! gp-0 (nav-enemy-method-60 self (not s5-0))) ) (suspend) @@ -1063,16 +1063,16 @@ ;; definition for method 54 of type ice-cube ;; INFO: Used lq/sq -(defmethod nav-enemy-method-54 ice-cube ((obj ice-cube) (arg0 vector)) - (let* ((s4-0 (-> obj path curve num-cverts)) +(defmethod nav-enemy-method-54 ice-cube ((this ice-cube) (arg0 vector)) + (let* ((s4-0 (-> this path curve num-cverts)) (s2-0 (nav-enemy-rnd-int-count s4-0)) (s5-0 (new 'stack-no-clear 'vector)) ) (dotimes (s3-0 s4-0) - (eval-path-curve-div! (-> obj path) s5-0 (the float s2-0) 'interp) - (when (>= (vector-vector-xz-distance s5-0 (-> obj collide-info trans)) 32768.0) - (when (ice-cube-method-51 obj s5-0 s5-0) - (set! (-> obj target-pt quad) (-> s5-0 quad)) + (eval-path-curve-div! (-> this path) s5-0 (the float s2-0) 'interp) + (when (>= (vector-vector-xz-distance s5-0 (-> this collide-info trans)) 32768.0) + (when (ice-cube-method-51 this s5-0 s5-0) + (set! (-> this target-pt quad) (-> s5-0 quad)) (return #t) ) ) @@ -1086,7 +1086,7 @@ (defstate ice-cube-mean-turn-to-charge (ice-cube) :event ice-cube-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) (nav-enemy-method-58 self) (if (or (not *target*) @@ -1121,7 +1121,7 @@ (set! (-> self collide-info transv y) f30-0) ) ) - (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) (let* ((v1-26 (>= 0.0 (-> self collide-info transv y))) (v1-27 (and v1-26 (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)))) ) @@ -1150,7 +1150,7 @@ #f #f ) - (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) (set! gp-0 (nav-enemy-method-60 self (not s5-0))) ) (suspend) @@ -1176,10 +1176,10 @@ (defstate ice-cube-mean-charge (ice-cube) :event ice-cube-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (nav-enemy-method-58 self) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) - (set! (-> self next-skid-sound-time) (-> *display* base-frame-counter)) + (set-time! (-> self next-skid-sound-time)) (if (or (not *target*) (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) @@ -1242,7 +1242,7 @@ ) (cond ((-> self track-target?) - (let ((f26-0 (deg-seek-smooth (-> self charge-angle) f0-5 (* 2730.6667 (-> *display* seconds-per-frame)) 0.25))) + (let ((f26-0 (deg-seek-smooth (-> self charge-angle) f0-5 (* 2730.6667 (seconds-per-frame)) 0.25))) (set! (-> self prev-charge-angle-diff) (deg- f26-0 (-> self charge-angle))) (set! (-> self charge-angle) f26-0) ) @@ -1264,9 +1264,7 @@ ) (set! (-> self nav travel y) 0.0) (when (-> self slow-down?) - (set! (-> self speed) - (seek-with-smooth (-> self speed) 0.0 (* 81920.0 (-> *display* seconds-per-frame)) 0.8 1638.4) - ) + (set! (-> self speed) (seek-with-smooth (-> self speed) 0.0 (* 81920.0 (seconds-per-frame)) 0.8 1638.4)) (if (>= 0.0 (-> self speed)) (go ice-cube-mean-charge-done) ) @@ -1278,8 +1276,8 @@ (spawn (-> self part4) gp-3) ) ) - (when (>= (-> *display* base-frame-counter) (-> self next-skid-sound-time)) - (set! (-> self next-skid-sound-time) (+ (-> *display* base-frame-counter) (nav-enemy-rnd-int-range 60 120))) + (when (>= (current-time) (-> self next-skid-sound-time)) + (set! (-> self next-skid-sound-time) (+ (current-time) (nav-enemy-rnd-int-range 60 120))) (sound-play "ice-stop" :vol (the float (the int (* 0.0012207031 (-> self speed))))) ) ) @@ -1299,7 +1297,7 @@ (-> self collide-info quat) (-> self collide-info quat) (the-as quaternion (-> self collide-info transv)) - (* 16384.0 (-> *display* seconds-per-frame)) + (* 16384.0 (seconds-per-frame)) ) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) @@ -1367,10 +1365,10 @@ (defstate ice-cube-tired (ice-cube) :event ice-cube-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (when (time-elapsed? (-> self state-time) (seconds 2)) (cond ((or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) 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 141b08c0ac..8f5fd442a0 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ball_REF.gc @@ -14,11 +14,11 @@ ) ;; definition for method 3 of type snow-ball-shadow -(defmethod inspect snow-ball-shadow ((obj snow-ball-shadow)) +(defmethod inspect snow-ball-shadow ((this snow-ball-shadow)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type snow-ball-junction @@ -32,11 +32,11 @@ ) ;; definition for method 3 of type snow-ball-junction -(defmethod inspect snow-ball-junction ((obj snow-ball-junction)) - (format #t "[~8x] ~A~%" obj 'snow-ball-junction) - (format #t "~Tenter-time: ~D~%" (-> obj enter-time)) - (format #t "~Texit-time: ~D~%" (-> obj exit-time)) - obj +(defmethod inspect snow-ball-junction ((this snow-ball-junction)) + (format #t "[~8x] ~A~%" this 'snow-ball-junction) + (format #t "~Tenter-time: ~D~%" (-> this enter-time)) + (format #t "~Texit-time: ~D~%" (-> this exit-time)) + this ) ;; definition of type snow-ball-path-info @@ -50,11 +50,11 @@ ) ;; definition for method 3 of type snow-ball-path-info -(defmethod inspect snow-ball-path-info ((obj snow-ball-path-info)) - (format #t "[~8x] ~A~%" obj 'snow-ball-path-info) - (format #t "~Thug-path?: ~A~%" (-> obj hug-path?)) - (format #t "~Tpath-pos: #~%" (-> obj path-pos)) - obj +(defmethod inspect snow-ball-path-info ((this snow-ball-path-info)) + (format #t "[~8x] ~A~%" this 'snow-ball-path-info) + (format #t "~Thug-path?: ~A~%" (-> this hug-path?)) + (format #t "~Tpath-pos: #~%" (-> this path-pos)) + this ) ;; definition of type snow-ball-roller @@ -90,25 +90,25 @@ ) ;; definition for method 3 of type snow-ball-roller -(defmethod inspect snow-ball-roller ((obj snow-ball-roller)) +(defmethod inspect snow-ball-roller ((this snow-ball-roller)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Twhich-path: ~D~%" (-> obj which-path)) - (format #t "~T~Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~T~Tpath-speed: ~f~%" (-> obj path-speed)) - (format #t "~T~Tpath-length: ~f~%" (-> obj path-length)) - (format #t "~T~Tpath-fall-u: ~f~%" (-> obj path-fall-u)) - (format #t "~T~Tpath-coming-out-u: ~f~%" (-> obj path-coming-out-u)) - (format #t "~T~Tpath-faded-up-u: ~f~%" (-> obj path-faded-up-u)) - (format #t "~T~Tdelay-til-bounce: ~D~%" (-> obj delay-til-bounce)) - (format #t "~T~Trolling-sound-id: ~D~%" (-> obj rolling-sound-id)) - (format #t "~T~Trolling-sound-enabled?: ~A~%" (-> obj rolling-sound-enabled?)) - (format #t "~T~Tlast-bounce-time: ~D~%" (-> obj last-bounce-time)) - (format #t "~T~Thit-player-time: ~D~%" (-> obj hit-player-time)) - (format #t "~T~Tpath-info: #~%" (-> obj path-info)) - (format #t "~T~Tjunctions[4] @ #x~X~%" (-> obj junctions)) - obj + (format #t "~T~Twhich-path: ~D~%" (-> this which-path)) + (format #t "~T~Tpath-u: ~f~%" (-> this path-u)) + (format #t "~T~Tpath-speed: ~f~%" (-> this path-speed)) + (format #t "~T~Tpath-length: ~f~%" (-> this path-length)) + (format #t "~T~Tpath-fall-u: ~f~%" (-> this path-fall-u)) + (format #t "~T~Tpath-coming-out-u: ~f~%" (-> this path-coming-out-u)) + (format #t "~T~Tpath-faded-up-u: ~f~%" (-> this path-faded-up-u)) + (format #t "~T~Tdelay-til-bounce: ~D~%" (-> this delay-til-bounce)) + (format #t "~T~Trolling-sound-id: ~D~%" (-> this rolling-sound-id)) + (format #t "~T~Trolling-sound-enabled?: ~A~%" (-> this rolling-sound-enabled?)) + (format #t "~T~Tlast-bounce-time: ~D~%" (-> this last-bounce-time)) + (format #t "~T~Thit-player-time: ~D~%" (-> this hit-player-time)) + (format #t "~T~Tpath-info: #~%" (-> this path-info)) + (format #t "~T~Tjunctions[4] @ #x~X~%" (-> this junctions)) + this ) ;; definition of type snow-ball @@ -134,16 +134,16 @@ ) ;; definition for method 3 of type snow-ball -(defmethod inspect snow-ball ((obj snow-ball)) +(defmethod inspect snow-ball ((this snow-ball)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~T~Tlast-path-picked: ~D~%" (-> obj last-path-picked)) - (format #t "~T~Tsame-path-picked-count: ~D~%" (-> obj same-path-picked-count)) - (format #t "~T~Tdelay-til-next: ~D~%" (-> obj delay-til-next)) - (format #t "~T~Tpath[2] @ #x~X~%" (-> obj path)) - obj + (format #t "~T~Tstate-time: ~D~%" (-> this state-time)) + (format #t "~T~Tlast-path-picked: ~D~%" (-> this last-path-picked)) + (format #t "~T~Tsame-path-picked-count: ~D~%" (-> this same-path-picked-count)) + (format #t "~T~Tdelay-til-next: ~D~%" (-> this delay-til-next)) + (format #t "~T~Tpath[2] @ #x~X~%" (-> this path)) + this ) ;; failed to figure out what this is: @@ -216,42 +216,42 @@ ;; definition for method 20 of type snow-ball-roller ;; INFO: Used lq/sq ;; INFO: Return type mismatch float vs none. -(defmethod follow-path snow-ball-roller ((obj snow-ball-roller)) - (let ((s5-0 (-> obj path-info))) +(defmethod follow-path snow-ball-roller ((this snow-ball-roller)) + (let ((s5-0 (-> this path-info))) (set! (-> s5-0 hug-path?) #f) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> s5-0 path-pos quad)) - (eval-path-curve! (-> obj path) (-> s5-0 path-pos) (-> obj path-u) 'interp) - (let ((f0-1 (-> obj path-coming-out-u))) - (when (< (-> obj path-u) f0-1) - (+! (-> s5-0 path-pos y) (- -20480.0 (* -20480.0 (/ (-> obj path-u) f0-1)))) + (eval-path-curve! (-> this path) (-> s5-0 path-pos) (-> this path-u) 'interp) + (let ((f0-1 (-> this path-coming-out-u))) + (when (< (-> this path-u) f0-1) + (+! (-> s5-0 path-pos y) (- -20480.0 (* -20480.0 (/ (-> this path-u) f0-1)))) (set! (-> s5-0 hug-path?) #t) ) ) - (let ((f0-6 (-> obj path-faded-up-u))) + (let ((f0-6 (-> this path-faded-up-u))) (cond - ((< (-> obj path-u) f0-6) - (let* ((f0-7 (/ (-> obj path-u) f0-6)) + ((< (-> this path-u) f0-6) + (let* ((f0-7 (/ (-> this path-u) f0-6)) (f0-8 (* f0-7 f0-7)) ) - (set-vector! (-> obj draw color-mult) f0-8 f0-8 f0-8 1.0) + (set-vector! (-> this draw color-mult) f0-8 f0-8 f0-8 1.0) ) ) (else - (vector-identity! (-> obj draw color-mult)) + (vector-identity! (-> this draw color-mult)) ) ) ) (cond - ((>= (-> obj path-u) (-> obj path-fall-u)) + ((>= (-> this path-u) (-> this path-fall-u)) (set! (-> s5-0 path-pos y) -409600.0) - (set! (-> s5-0 path-pos x) (+ (-> s4-0 x) (-> obj root-override transv x))) - (set! (-> s5-0 path-pos z) (+ (-> s4-0 z) (-> obj root-override transv z))) - (set! (-> obj rolling-sound-enabled?) #f) + (set! (-> s5-0 path-pos x) (+ (-> s4-0 x) (-> this root-override transv x))) + (set! (-> s5-0 path-pos z) (+ (-> s4-0 z) (-> this root-override transv z))) + (set! (-> this rolling-sound-enabled?) #f) ) (else - (set! (-> obj root-override transv x) (- (-> s5-0 path-pos x) (-> s4-0 x))) - (set! (-> obj root-override transv z) (- (-> s5-0 path-pos z) (-> s4-0 z))) + (set! (-> this root-override transv x) (- (-> s5-0 path-pos x) (-> s4-0 x))) + (set! (-> this root-override transv z) (- (-> s5-0 path-pos z) (-> s4-0 z))) ) ) ) @@ -260,7 +260,7 @@ ) ;; definition for method 21 of type snow-ball-roller -(defmethod play-landing-sound snow-ball-roller ((obj snow-ball-roller) (arg0 float)) +(defmethod play-landing-sound snow-ball-roller ((this snow-ball-roller) (arg0 float)) (let ((f30-0 (* 0.0018780049 (fmin 53248.0 (fmax 0.0 (+ -4096.0 (fabs arg0))))))) (sound-play "snowball-land" :vol f30-0) ) @@ -272,8 +272,8 @@ (defbehavior snow-ball-roller-path-update snow-ball-roller () (local-vars (f0-5 float)) (let ((f0-0 (-> self root-override trans y))) - (+! (-> self root-override transv y) (* -491520.0 (-> *display* seconds-per-frame))) - (let ((f30-0 (+ f0-0 (* (-> self root-override transv y) (-> *display* seconds-per-frame))))) + (+! (-> self root-override transv y) (* -491520.0 (seconds-per-frame))) + (let ((f30-0 (+ f0-0 (* (-> self root-override transv y) (seconds-per-frame))))) (follow-path self) (let ((a1-0 (new 'stack-no-clear 'vector))) (let ((a0-1 (-> self path-info))) @@ -303,12 +303,12 @@ ) ) (when (< (-> self path-u) (-> self path-fall-u)) - (when (>= (- (-> *display* base-frame-counter) (-> self last-bounce-time)) (-> self delay-til-bounce)) + (when (time-elapsed? (-> self last-bounce-time) (-> self delay-til-bounce)) (let ((f0-13 (rand-vu-float-range 8192.0 20480.0))) (+! (-> self root-override transv y) f0-13) (play-landing-sound self f0-13) ) - (set! (-> self last-bounce-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-bounce-time)) (set! (-> self delay-til-bounce) (rand-vu-int-range 300 2100)) ) ) @@ -331,7 +331,7 @@ (matrix->quaternion (-> self root-override quat) gp-0) ) ) - (+! (-> self path-u) (* (-> self path-speed) (-> *display* seconds-per-frame))) + (+! (-> self path-u) (* (-> self path-speed) (seconds-per-frame))) (if (< 1.0 (-> self path-u)) (set! (-> self path-u) 1.0) ) @@ -380,27 +380,27 @@ ;; definition for method 22 of type snow-ball-roller ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod snow-ball-roller-method-22 snow-ball-roller ((obj snow-ball-roller) (arg0 process-drawable)) +(defmethod snow-ball-roller-method-22 snow-ball-roller ((this snow-ball-roller) (arg0 process-drawable)) (cond - ((< (+ 4096.0 (-> arg0 root trans y)) (-> obj root-override trans y)) + ((< (+ 4096.0 (-> arg0 root trans y)) (-> this root-override trans y)) (let ((f0-2 81920.0)) - (+! (-> obj root-override transv y) f0-2) - (play-landing-sound obj f0-2) + (+! (-> this root-override transv y) f0-2) + (play-landing-sound this f0-2) ) ) (else (let ((f0-3 24576.0)) - (+! (-> obj root-override transv y) f0-3) - (play-landing-sound obj f0-3) + (+! (-> this root-override transv y) f0-3) + (play-landing-sound this f0-3) ) ) ) (let ((s4-0 (new 'stack-no-clear 'vector))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> arg0 root trans) (-> obj root-override trans)) + (vector-! s4-0 (-> arg0 root trans) (-> this root-override trans)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (path-control-method-14 (-> obj path) s3-0 (-> obj path-u)) + (path-control-method-14 (-> this path) s3-0 (-> this path-u)) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (let* ((f28-0 (atan (-> s4-0 x) (-> s4-0 z))) @@ -421,7 +421,7 @@ ) ) (vector-normalize! s4-0 25600.0) - (vector+! s4-0 s4-0 (-> obj root-override trans)) + (vector+! s4-0 s4-0 (-> this root-override trans)) (vector-! s4-0 s4-0 (-> arg0 root trans)) (set! (-> s4-0 y) 0.0) (let ((f30-2 (vector-length s4-0))) @@ -439,8 +439,8 @@ (('touch 'attack) (when (= (-> proc type) target) (do-push-aways! (-> self root-override)) - (when (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.5)) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self hit-player-time) (seconds 0.5)) + (set-time! (-> self hit-player-time)) (snow-ball-roller-method-22 self *target*) ) ) @@ -448,7 +448,7 @@ ) ) :enter (behavior () - (set! (-> self last-bounce-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-bounce-time)) (snow-ball-roller-path-init) ) :exit (behavior () @@ -528,15 +528,15 @@ ) ;; definition for method 14 of type snow-ball -(defmethod snow-ball-method-14 snow-ball ((obj snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 float) (arg2 int)) +(defmethod snow-ball-method-14 snow-ball ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 float) (arg2 int)) (local-vars (v1-0 (pointer float))) (if (zero? arg2) (set! v1-0 (new 'static 'array float 8 0.3309 0.36 0.4691 0.5061 0.6904 0.7264 0.864 0.8667)) (set! v1-0 (new 'static 'array float 8 0.3344 0.3528 0.4919 0.5246 0.6967 0.7272 0.8677 0.9105)) ) - (let ((a0-4 (* arg1 (-> *display* seconds-per-frame))) + (let ((a0-4 (* arg1 (seconds-per-frame))) (a1-1 (-> arg0 0)) - (a2-2 (-> *display* base-frame-counter)) + (a2-2 (current-time)) ) (dotimes (a3-1 4) (set! (-> a1-1 enter-time) (+ a2-2 (the int (/ (-> v1-0 0) a0-4)))) @@ -549,9 +549,9 @@ ) ;; definition for method 15 of type snow-ball -(defmethod snow-ball-method-15 snow-ball ((obj snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 int)) +(defmethod snow-ball-method-15 snow-ball ((this snow-ball) (arg0 (inline-array snow-ball-junction)) (arg1 int)) (local-vars (v0-0 symbol)) - (let ((v1-0 (-> obj child-override))) + (let ((v1-0 (-> this child-override))) (while v1-0 (let ((a0-1 (-> arg0 0)) (a3-1 (-> v1-0 0 junctions)) @@ -580,10 +580,10 @@ (defstate snow-ball-idle (snow-ball) :code (behavior () (local-vars (gp-0 int)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self delay-til-next) 0) (label cfg-1) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self delay-til-next)) + (when (time-elapsed? (-> self state-time) (-> self delay-til-next)) (set! gp-0 (cond ((>= (-> self same-path-picked-count) 2) (if (zero? (-> self last-path-picked)) @@ -605,7 +605,7 @@ (snow-ball-method-14 self s5-0 s3-0 gp-0) (when (snow-ball-method-15 self s5-0 gp-0) (process-spawn snow-ball-roller (-> self entity) self s3-0 gp-0 s5-0 :to self) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self delay-til-next) (rand-vu-int-range 450 1650)) (cond ((= gp-0 (-> self last-path-picked)) @@ -634,14 +634,14 @@ ;; definition for method 7 of type snow-ball ;; INFO: Return type mismatch process-drawable vs snow-ball. -(defmethod relocate snow-ball ((obj snow-ball) (arg0 int)) +(defmethod relocate snow-ball ((this snow-ball) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj path v1-0)) - (&+! (-> obj path v1-0) arg0) + (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 obj) + (the-as process-drawable this) arg0 ) ) @@ -649,13 +649,13 @@ ;; definition for method 11 of type snow-ball ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-ball ((obj snow-ball) (arg0 entity-actor)) - (set! (-> obj last-path-picked) 1) - (set! (-> obj same-path-picked-count) 1) +(defmethod init-from-entity! snow-ball ((this snow-ball) (arg0 entity-actor)) + (set! (-> this last-path-picked) 1) + (set! (-> this same-path-picked-count) 1) (dotimes (s5-0 2) - (set! (-> obj path s5-0) (new 'process 'curve-control obj 'path (the float (+ s5-0 1)))) + (set! (-> this path s5-0) (new 'process 'curve-control this 'path (the float (+ s5-0 1)))) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (go snow-ball-idle) (none) ) 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 c4b1e538c5..d39743c241 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bumper_REF.gc @@ -27,16 +27,16 @@ ) ;; definition for method 3 of type snow-bumper -(defmethod inspect snow-bumper ((obj snow-bumper)) +(defmethod inspect snow-bumper ((this snow-bumper)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbumper-id: ~D~%" (-> obj bumper-id)) - (format #t "~T~Tbase-shove-ry: ~f~%" (-> obj base-shove-ry)) - (format #t "~T~Tmax-shove-diff-ry: ~f~%" (-> obj max-shove-diff-ry)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tlast-shoved-player-time: ~D~%" (-> obj last-shoved-player-time)) - obj + (format #t "~T~Tbumper-id: ~D~%" (-> this bumper-id)) + (format #t "~T~Tbase-shove-ry: ~f~%" (-> this base-shove-ry)) + (format #t "~T~Tmax-shove-diff-ry: ~f~%" (-> this max-shove-diff-ry)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tlast-shoved-player-time: ~D~%" (-> this last-shoved-player-time)) + this ) ;; failed to figure out what this is: @@ -113,14 +113,14 @@ ;; definition for method 21 of type snow-bumper ;; INFO: Used lq/sq ;; INFO: Return type mismatch time-frame vs none. -(defmethod shove-player snow-bumper ((obj snow-bumper) (arg0 process-drawable)) +(defmethod shove-player snow-bumper ((this snow-bumper) (arg0 process-drawable)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> arg0 root trans) (-> obj root trans)) + (vector-! s5-0 (-> arg0 root trans) (-> this root trans)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) (let* ((f0-3 (atan (-> s5-0 x) (-> s5-0 z))) - (f30-0 (-> obj base-shove-ry)) - (f28-0 (-> obj max-shove-diff-ry)) + (f30-0 (-> this base-shove-ry)) + (f28-0 (-> this max-shove-diff-ry)) (f0-4 (deg- f0-3 f30-0)) ) (when (< f28-0 (fabs f0-4)) @@ -137,16 +137,16 @@ (let ((f0-12 (+ -16384.0 (atan (-> s5-0 x) (-> s5-0 z))))) (set! (-> *part-id-table* 1895 init-specs 17 initial-valuef) (+ -4096.0 f0-12)) ) - (spawn (-> obj part2) (-> obj root trans)) + (spawn (-> this part2) (-> this root trans)) (let ((s3-1 (new 'stack-no-clear 'vector))) (vector-normalize-copy! s3-1 s5-0 32768.0) - (vector+! s3-1 s3-1 (-> obj root trans)) + (vector+! s3-1 s3-1 (-> this root trans)) (vector-! s5-0 s3-1 (-> arg0 root trans)) ) (let ((f30-3 (vector-xz-length s5-0))) (vector-normalize! s5-0 1.0) (if (send-event *target* 'shove #f (static-attack-info ((vector s5-0) (shove-up (meters 1)) (shove-back f30-3)))) - (set! (-> obj last-shoved-player-time) (-> *display* base-frame-counter)) + (set-time! (-> this last-shoved-player-time)) ) ) ) @@ -203,7 +203,7 @@ (if (< 368640.0 f30-0) (go snow-bumper-active-far-idle) ) - (if (and (>= (- (-> *display* base-frame-counter) (-> self last-shoved-player-time)) (seconds 0.5)) + (if (and (time-elapsed? (-> self last-shoved-player-time) (seconds 0.5)) (>= 20480.0 f30-0) (>= f28-0 -4096.0) (>= 11059.2 f28-0) @@ -248,8 +248,8 @@ (ja :num! (seek! max 0.05)) ) (stop! (-> self sound)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) (ja-no-eval :group! snow-bumper-collapse-ja :num! (seek! max 0.02) :frame-num 0.0) @@ -307,33 +307,33 @@ ) ;; definition for method 10 of type snow-bumper -(defmethod deactivate snow-bumper ((obj snow-bumper)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate snow-bumper ((this snow-bumper)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type snow-bumper ;; INFO: Return type mismatch process-drawable vs snow-bumper. -(defmethod relocate snow-bumper ((obj snow-bumper) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method snow-bumper 7)) this arg0) ) ) ;; definition for method 11 of type snow-bumper ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-bumper ((obj snow-bumper) (arg0 entity-actor)) +(defmethod init-from-entity! snow-bumper ((this snow-bumper) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj last-shoved-player-time) 0) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> this last-shoved-player-time) 0) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -366,41 +366,41 @@ ) (set! (-> s4-0 nav-radius) 20480.0) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-bumper-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 519) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 520) obj)) - (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj bumper-id) (+ (actor-count-before (-> obj link)) 1)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "snow-bumper" :fo-max 40) (-> obj root trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-bumper-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 519) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 520) this)) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this bumper-id) (+ (actor-count-before (-> this link)) 1)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "snow-bumper" :fo-max 40) (-> this root trans)) ) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> obj base-shove-ry) 0.0) - (set! (-> obj max-shove-diff-ry) 32768.0) + (set! (-> this base-shove-ry) 0.0) + (set! (-> this max-shove-diff-ry) 32768.0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-52 (res-lump-data (-> obj entity) 'rotmin (pointer float) :tag-ptr (& sv-16)))) + (let ((v1-52 (res-lump-data (-> this entity) 'rotmin (pointer float) :tag-ptr (& sv-16)))) (when v1-52 - (set! (-> obj base-shove-ry) (-> v1-52 0)) - (set! (-> obj max-shove-diff-ry) (-> v1-52 1)) + (set! (-> this base-shove-ry) (-> v1-52 0)) + (set! (-> this max-shove-diff-ry) (-> v1-52 1)) ) ) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (if (and (= (get-reminder (get-task-control (game-task snow-bumpers)) 0) (-> obj bumper-id)) - (not (task-complete? *game-info* (-> obj entity extra perm task))) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (if (and (= (get-reminder (get-task-control (game-task snow-bumpers)) 0) (-> this bumper-id)) + (not (task-complete? *game-info* (-> this entity extra perm task))) ) (go snow-bumper-spawn-fuel-cell) (go snow-bumper-inactive-idle) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc index 1634996253..9a82444ebd 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-bunny_REF.gc @@ -39,31 +39,31 @@ ) ;; definition for method 3 of type snow-bunny -(defmethod inspect snow-bunny ((obj snow-bunny)) +(defmethod inspect snow-bunny ((this snow-bunny)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpatrol-rand-distraction: ~D~%" (-> obj patrol-rand-distraction)) - (format #t "~T~Tbase-hop-dist: ~f~%" (-> obj base-hop-dist)) - (format #t "~T~Thalfway-dist: ~f~%" (-> obj halfway-dist)) - (format #t "~T~Tretreat-timeout: ~f~%" (-> obj retreat-timeout)) - (format #t "~T~Tgnd-popup: ~f~%" (-> obj gnd-popup)) - (format #t "~T~Tjump-height-min: ~f~%" (-> obj jump-height-min)) - (format #t "~T~Tjump-height-factor: ~f~%" (-> obj jump-height-factor)) - (format #t "~T~Tjump-anim-start-frame: ~f~%" (-> obj jump-anim-start-frame)) - (format #t "~T~Tdefense: ~D~%" (-> obj defense)) - (format #t "~T~Tretreat-timeout-time: ~D~%" (-> obj retreat-timeout-time)) - (format #t "~T~Tlast-nondangerous-time: ~D~%" (-> obj last-nondangerous-time)) - (format #t "~T~Tpatrol-hop-failed?: ~A~%" (-> obj patrol-hop-failed?)) - (format #t "~T~Tshould-retreat?: ~A~%" (-> obj should-retreat?)) - (format #t "~T~Tgot-jump-event?: ~A~%" (-> obj got-jump-event?)) - (format #t "~T~Tusing-jump-event?: ~A~%" (-> obj using-jump-event?)) - (format #t "~T~Tjump-anim: ~D~%" (-> obj jump-anim)) - (format #t "~T~Tnotice-land-anim: ~D~%" (-> obj notice-land-anim)) - (format #t "~T~Tattack-anim: ~D~%" (-> obj attack-anim)) - (format #t "~T~Tfinal-dest: #~%" (-> obj final-dest)) - (format #t "~T~Tjump-event-dest: #~%" (-> obj jump-event-dest)) - obj + (format #t "~T~Tpatrol-rand-distraction: ~D~%" (-> this patrol-rand-distraction)) + (format #t "~T~Tbase-hop-dist: ~f~%" (-> this base-hop-dist)) + (format #t "~T~Thalfway-dist: ~f~%" (-> this halfway-dist)) + (format #t "~T~Tretreat-timeout: ~f~%" (-> this retreat-timeout)) + (format #t "~T~Tgnd-popup: ~f~%" (-> this gnd-popup)) + (format #t "~T~Tjump-height-min: ~f~%" (-> this jump-height-min)) + (format #t "~T~Tjump-height-factor: ~f~%" (-> this jump-height-factor)) + (format #t "~T~Tjump-anim-start-frame: ~f~%" (-> this jump-anim-start-frame)) + (format #t "~T~Tdefense: ~D~%" (-> this defense)) + (format #t "~T~Tretreat-timeout-time: ~D~%" (-> this retreat-timeout-time)) + (format #t "~T~Tlast-nondangerous-time: ~D~%" (-> this last-nondangerous-time)) + (format #t "~T~Tpatrol-hop-failed?: ~A~%" (-> this patrol-hop-failed?)) + (format #t "~T~Tshould-retreat?: ~A~%" (-> this should-retreat?)) + (format #t "~T~Tgot-jump-event?: ~A~%" (-> this got-jump-event?)) + (format #t "~T~Tusing-jump-event?: ~A~%" (-> this using-jump-event?)) + (format #t "~T~Tjump-anim: ~D~%" (-> this jump-anim)) + (format #t "~T~Tnotice-land-anim: ~D~%" (-> this notice-land-anim)) + (format #t "~T~Tattack-anim: ~D~%" (-> this attack-anim)) + (format #t "~T~Tfinal-dest: #~%" (-> this final-dest)) + (format #t "~T~Tjump-event-dest: #~%" (-> this jump-event-dest)) + this ) ;; failed to figure out what this is: @@ -136,7 +136,7 @@ ) (('touch) (when (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) (set-collide-offense (-> self collide-info) 2 (collide-offense no-offense)) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8)) (go-virtual snow-bunny-attack) @@ -156,12 +156,12 @@ ;; definition for method 76 of type snow-bunny ;; INFO: Return type mismatch int vs none. -(defmethod snow-bunny-method-76 snow-bunny ((obj snow-bunny) (arg0 symbol)) +(defmethod snow-bunny-method-76 snow-bunny ((this snow-bunny) (arg0 symbol)) (let ((f0-0 -4096.0)) (if arg0 (set! f0-0 -20480.0) ) - (let ((v1-3 (-> obj draw shadow-ctrl))) + (let ((v1-3 (-> this draw shadow-ctrl))) (set! (-> v1-3 settings bot-plane w) (- f0-0)) ) ) @@ -171,8 +171,8 @@ ;; definition for method 47 of type snow-bunny ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision snow-bunny ((obj snow-bunny)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision snow-bunny ((this snow-bunny)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -212,7 +212,7 @@ (set! (-> s5-0 nav-radius) 2048.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -220,60 +220,60 @@ ;; definition for method 60 of type snow-bunny ;; INFO: Return type mismatch int vs none. -(defmethod snow-bunny-method-60 snow-bunny ((obj snow-bunny)) - (initialize-skeleton obj *snow-bunny-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) +(defmethod snow-bunny-method-60 snow-bunny ((this snow-bunny)) + (initialize-skeleton this *snow-bunny-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) (none) ) ;; definition for method 48 of type snow-bunny ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 snow-bunny ((obj snow-bunny)) - (snow-bunny-method-60 obj) - (init-defaults! obj *snow-bunny-nav-enemy-info*) - (logclear! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf03)) +(defmethod nav-enemy-method-48 snow-bunny ((this snow-bunny)) + (snow-bunny-method-60 this) + (init-defaults! this *snow-bunny-nav-enemy-info*) + (logclear! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf03)) (cond - ((zero? (res-lump-value (-> obj entity) 'mode uint128)) - (set! (-> obj defense) (the-as uint 1)) - (set! (-> obj retreat-timeout) 5.0) + ((zero? (res-lump-value (-> this entity) 'mode uint128)) + (set! (-> this defense) (the-as uint 1)) + (set! (-> this retreat-timeout) 5.0) ) (else - (set! (-> obj defense) (the-as uint 0)) - (set! (-> obj retreat-timeout) 0.1) + (set! (-> this defense) (the-as uint 0)) + (set! (-> this retreat-timeout) 0.1) ) ) - (set! (-> obj last-nondangerous-time) (-> *display* base-frame-counter)) - (set! (-> obj gnd-popup) 16384.0) - (set! (-> obj got-jump-event?) #f) - (set! (-> obj notice-land-anim) 10) - (set! (-> obj attack-anim) 6) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj patrol-rand-distraction) (+ (nav-enemy-rnd-int-count 5) 1)) - (set! (-> obj patrol-hop-failed?) #f) + (set-time! (-> this last-nondangerous-time)) + (set! (-> this gnd-popup) 16384.0) + (set! (-> this got-jump-event?) #f) + (set! (-> this notice-land-anim) 10) + (set! (-> this attack-anim) 6) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this patrol-rand-distraction) (+ (nav-enemy-rnd-int-count 5) 1)) + (set! (-> this patrol-hop-failed?) #f) 0 (none) ) ;; definition for method 11 of type snow-bunny -(defmethod init-from-entity! snow-bunny ((obj snow-bunny) (arg0 entity-actor)) - (initialize-collision obj) - (process-drawable-from-entity! obj arg0) - (nav-enemy-method-48 obj) - (if (<= (-> obj path curve num-cverts) 0) +(defmethod init-from-entity! snow-bunny ((this snow-bunny) (arg0 entity-actor)) + (initialize-collision this) + (process-drawable-from-entity! this arg0) + (nav-enemy-method-48 this) + (if (<= (-> this path curve num-cverts) 0) (go process-drawable-art-error "no path") ) - (set! *snow-bunny* (the-as (pointer snow-bunny) (process->ppointer obj))) - (nav-enemy-method-59 obj) + (set! *snow-bunny* (the-as (pointer snow-bunny) (process->ppointer this))) + (nav-enemy-method-59 this) (none) ) ;; definition for method 58 of type snow-bunny ;; INFO: Return type mismatch time-frame vs none. -(defmethod nav-enemy-method-58 snow-bunny ((obj snow-bunny)) +(defmethod nav-enemy-method-58 snow-bunny ((this snow-bunny)) (if (not (logtest? (-> *target* state-flags) (state-flags dangerous))) - (set! (-> obj last-nondangerous-time) (-> *display* base-frame-counter)) + (set-time! (-> this last-nondangerous-time)) ) (none) ) @@ -298,26 +298,26 @@ ;; definition for method 56 of type snow-bunny ;; INFO: Return type mismatch float vs none. -(defmethod set-jump-height-factor! snow-bunny ((obj snow-bunny) (arg0 int)) +(defmethod set-jump-height-factor! snow-bunny ((this snow-bunny) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (set! (-> obj jump-anim) 8) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.6) - (set! (-> obj jump-anim-start-frame) 4.0) + (set! (-> this jump-anim) 8) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.6) + (set! (-> this jump-anim-start-frame) 4.0) ) ((= v1-0 1) - (set! (-> obj jump-anim) 7) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.6) - (set! (-> obj jump-anim-start-frame) 11.0) + (set! (-> this jump-anim) 7) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.6) + (set! (-> this jump-anim-start-frame) 11.0) ) ((= v1-0 2) - (set! (-> obj jump-anim) 7) - (set! (-> obj jump-height-min) 4096.0) - (set! (-> obj jump-height-factor) 0.4) - (set! (-> obj jump-anim-start-frame) 11.0) + (set! (-> this jump-anim) 7) + (set! (-> this jump-height-min) 4096.0) + (set! (-> this jump-height-factor) 0.4) + (set! (-> this jump-anim-start-frame) 11.0) ) ) ) @@ -325,11 +325,11 @@ ) ;; definition for method 57 of type snow-bunny -(defmethod snow-bunny-method-57 snow-bunny ((obj snow-bunny)) +(defmethod snow-bunny-method-57 snow-bunny ((this snow-bunny)) (if (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags dangerous)))) (return #f) ) - (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> obj collide-info trans)))) + (let ((f0-0 (vector-vector-xz-distance (target-pos 0) (-> this collide-info trans)))) (if (< 73728.0 f0-0) (return #f) ) @@ -339,12 +339,8 @@ (if (>= 40.96 f0-2) (set! f0-2 40.96) ) - (let ((v1-13 (the int (/ f0-2 (* (-> obj nav-info run-travel-speed) (-> *display* seconds-per-frame)))))) - (if (<= (- (- (seconds 0.36) (- (-> *display* base-frame-counter) (-> obj last-nondangerous-time))) - (the-as time-frame v1-13) - ) - 0 - ) + (let ((v1-13 (the int (/ f0-2 (* (-> this nav-info run-travel-speed) (seconds-per-frame)))))) + (if (<= (- (- (seconds 0.36) (- (current-time) (-> this last-nondangerous-time))) (the-as time-frame v1-13)) 0) (return #f) ) ) @@ -432,7 +428,7 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (snow-bunny-method-76 self #f) (logior! (-> self nav flags) (nav-control-flags navcf19)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) @@ -443,7 +439,7 @@ (if (snow-bunny-method-57 self) (go-virtual snow-bunny-defend) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (if (not *target*) (go-virtual nav-enemy-idle) ) @@ -472,8 +468,8 @@ :num! (identity (rand-vu-float-range 0.0 (the float (+ (-> (ja-group) data 0 length) -1)))) ) (loop - (let ((s5-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 2.52)) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 2.52)) (suspend) (ja :num! (loop!)) ) @@ -497,10 +493,10 @@ ;; definition for method 51 of type snow-bunny ;; INFO: Used lq/sq -(defmethod snow-bunny-method-51 snow-bunny ((obj snow-bunny) (arg0 vector) (arg1 vector)) +(defmethod snow-bunny-method-51 snow-bunny ((this snow-bunny) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let* ((s4-0 (new 'stack-no-clear 'collide-tri-result)) - (f0-0 (-> obj gnd-popup)) + (f0-0 (-> this gnd-popup)) (f30-0 (+ f0-0 40960.0)) ) (set! (-> s5-0 quad) (-> arg0 quad)) @@ -510,7 +506,7 @@ s5-0 f30-0 (collide-kind background) - (-> obj collide-info process) + (-> this collide-info process) s4-0 (new 'static 'pat-surface :noentity #x1) ) @@ -529,19 +525,19 @@ ;; definition for method 53 of type snow-bunny ;; INFO: Used lq/sq -(defmethod nav-enemy-method-53 snow-bunny ((obj snow-bunny)) - (let* ((s4-0 (-> obj path curve num-cverts)) +(defmethod nav-enemy-method-53 snow-bunny ((this snow-bunny)) + (let* ((s4-0 (-> this path curve num-cverts)) (s2-0 (nav-enemy-rnd-int-count s4-0)) (s5-0 (new 'stack-no-clear 'vector)) ) (dotimes (s3-0 s4-0) - (eval-path-curve-div! (-> obj path) s5-0 (the float s2-0) 'interp) - (let ((f30-0 (vector-vector-xz-distance s5-0 (-> obj collide-info trans)))) + (eval-path-curve-div! (-> this path) s5-0 (the float s2-0) 'interp) + (let ((f30-0 (vector-vector-xz-distance s5-0 (-> this collide-info trans)))) (when (>= f30-0 6144.0) - (when (snow-bunny-method-51 obj s5-0 s5-0) - (set! (-> obj final-dest quad) (-> s5-0 quad)) - (set! (-> obj halfway-dist) (* 0.5 f30-0)) - (set! (-> obj base-hop-dist) (rand-vu-float-range 6144.0 22118.4)) + (when (snow-bunny-method-51 this s5-0 s5-0) + (set! (-> this final-dest quad) (-> s5-0 quad)) + (set! (-> this halfway-dist) (* 0.5 f30-0)) + (set! (-> this base-hop-dist) (rand-vu-float-range 6144.0 22118.4)) (return #t) ) ) @@ -554,12 +550,12 @@ ;; definition for method 54 of type snow-bunny ;; INFO: Used lq/sq -(defmethod snow-bunny-method-54 snow-bunny ((obj snow-bunny)) +(defmethod snow-bunny-method-54 snow-bunny ((this snow-bunny)) (local-vars (sv-48 (function float float))) - (set! (-> obj using-jump-event?) #f) - (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> obj final-dest) (-> obj collide-info trans))) + (set! (-> this using-jump-event?) #f) + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this final-dest) (-> this collide-info trans))) (f30-0 (vector-length s5-1)) - (f1-0 (-> obj halfway-dist)) + (f1-0 (-> this halfway-dist)) (f0-1 (- 1.0 (/ (fabs (- f30-0 f1-0)) (* 2.0 f1-0)))) ) (cond @@ -570,10 +566,10 @@ (set! f0-1 1.0) ) ) - (let ((f28-0 (* (-> obj base-hop-dist) f0-1))) + (let ((f28-0 (* (-> this base-hop-dist) f0-1))) (cond ((>= (+ 4096.0 f28-0) f30-0) - (set! (-> obj nav target-pos quad) (-> obj final-dest quad)) + (set! (-> this nav target-pos quad) (-> this final-dest quad)) ) (else (vector-rotate-around-y! s5-1 s5-1 16384.0) @@ -581,7 +577,7 @@ (let ((s4-0 (new 'stack-no-clear 'vector))) (let ((s3-0 vector+*!) (s2-0 s4-0) - (s1-0 (-> obj final-dest)) + (s1-0 (-> this final-dest)) (s0-0 s5-1) ) (set! sv-48 sin) @@ -589,32 +585,32 @@ (s3-0 s2-0 s1-0 s0-0 (sv-48 a0-9)) ) ) - (vector-! s5-1 s4-0 (-> obj collide-info trans)) + (vector-! s5-1 s4-0 (-> this collide-info trans)) (when (< f28-0 (vector-length s5-1)) (vector-normalize! s5-1 f28-0) - (vector+! s4-0 (-> obj collide-info trans) s5-1) + (vector+! s4-0 (-> this collide-info trans) s5-1) ) - (set! (-> obj nav target-pos quad) (-> s4-0 quad)) + (set! (-> this nav target-pos quad) (-> s4-0 quad)) ) ) ) ) ) - (set! (-> obj got-jump-event?) #f) - (nav-control-method-11 (-> obj nav) (-> obj nav target-pos)) + (set! (-> this got-jump-event?) #f) + (nav-control-method-11 (-> this nav) (-> this nav target-pos)) (cond - ((-> obj got-jump-event?) - (set! (-> obj nav target-pos quad) (-> obj jump-event-dest quad)) - (set! (-> obj using-jump-event?) #t) + ((-> this got-jump-event?) + (set! (-> this nav target-pos quad) (-> this jump-event-dest quad)) + (set! (-> this using-jump-event?) #t) ) (else - (let ((s5-2 (-> obj nav travel))) + (let ((s5-2 (-> this nav travel))) (if (< (vector-length s5-2) 0.01) (return #f) ) - (let ((a2-2 (-> obj nav target-pos))) - (vector+! a2-2 (-> obj collide-info trans) s5-2) - (if (not (snow-bunny-method-51 obj a2-2 a2-2)) + (let ((a2-2 (-> this nav target-pos))) + (vector+! a2-2 (-> this collide-info trans) s5-2) + (if (not (snow-bunny-method-51 this a2-2 a2-2)) (return #f) ) ) @@ -629,7 +625,7 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (when (not (snow-bunny-method-54 self)) (set! (-> self patrol-hop-failed?) #t) (go-virtual snow-bunny-patrol-idle) @@ -696,7 +692,7 @@ ) (until (logtest? (-> self collide-info status) (cshape-moving-flags onsurf)) (ja :num! (seek! max f30-0)) - (+! (-> self collide-info transv y) (* -546119.7 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -546119.7 (seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) @@ -743,25 +739,25 @@ ;; definition for method 52 of type snow-bunny ;; INFO: Used lq/sq -(defmethod snow-bunny-method-52 snow-bunny ((obj snow-bunny)) +(defmethod snow-bunny-method-52 snow-bunny ((this snow-bunny)) (local-vars (sv-48 (function float float))) - (set! (-> obj using-jump-event?) #f) + (set! (-> this using-jump-event?) #f) (if (not *target*) (return #f) ) - (let ((s4-0 (-> obj final-dest))) + (let ((s4-0 (-> this final-dest))) (set! (-> s4-0 quad) (-> (target-pos 0) quad)) - (if (not (snow-bunny-method-51 obj s4-0 s4-0)) + (if (not (snow-bunny-method-51 this s4-0 s4-0)) (return #f) ) - (set! (-> obj base-hop-dist) (rand-vu-float-range 18022.4 22118.4)) - (let* ((s5-2 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> obj collide-info trans))) + (set! (-> this base-hop-dist) (rand-vu-float-range 18022.4 22118.4)) + (let* ((s5-2 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> this collide-info trans))) (f28-0 (vector-length s5-2)) - (f30-0 (-> obj base-hop-dist)) + (f30-0 (-> this base-hop-dist)) ) (cond ((>= (+ 4096.0 f30-0) f28-0) - (set! (-> obj nav target-pos quad) (-> s4-0 quad)) + (set! (-> this nav target-pos quad) (-> s4-0 quad)) ) (else (vector-rotate-around-y! s5-2 s5-2 16384.0) @@ -776,32 +772,32 @@ (s2-0 s1-0 s4-0 s0-0 (sv-48 a0-11)) ) ) - (vector-! s5-2 s3-0 (-> obj collide-info trans)) + (vector-! s5-2 s3-0 (-> this collide-info trans)) (when (< f30-0 (vector-length s5-2)) (vector-normalize! s5-2 f30-0) - (vector+! s3-0 (-> obj collide-info trans) s5-2) + (vector+! s3-0 (-> this collide-info trans) s5-2) ) - (set! (-> obj nav target-pos quad) (-> s3-0 quad)) + (set! (-> this nav target-pos quad) (-> s3-0 quad)) ) ) ) ) ) - (set! (-> obj got-jump-event?) #f) - (nav-control-method-11 (-> obj nav) (-> obj nav target-pos)) + (set! (-> this got-jump-event?) #f) + (nav-control-method-11 (-> this nav) (-> this nav target-pos)) (cond - ((-> obj got-jump-event?) - (set! (-> obj nav target-pos quad) (-> obj jump-event-dest quad)) - (set! (-> obj using-jump-event?) #t) + ((-> this got-jump-event?) + (set! (-> this nav target-pos quad) (-> this jump-event-dest quad)) + (set! (-> this using-jump-event?) #t) ) (else - (let ((s5-3 (-> obj nav travel))) + (let ((s5-3 (-> this nav travel))) (if (< (vector-length s5-3) 0.01) (return #f) ) - (let ((a2-3 (-> obj nav target-pos))) - (vector+! a2-3 (-> obj collide-info trans) s5-3) - (if (not (snow-bunny-method-51 obj a2-3 a2-3)) + (let ((a2-3 (-> this nav target-pos))) + (vector+! a2-3 (-> this collide-info trans) s5-3) + (if (not (snow-bunny-method-51 this a2-3 a2-3)) (return #f) ) ) @@ -816,7 +812,7 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self should-retreat?) #f) (if (or (not *target*) (logtest? (-> *target* state-flags) (state-flags do-not-notice))) (go-virtual nav-enemy-patrol) @@ -885,31 +881,31 @@ ) ;; definition for method 3 of type snow-bunny-retreat-work -(defmethod inspect snow-bunny-retreat-work ((obj snow-bunny-retreat-work)) - (format #t "[~8x] ~A~%" obj 'snow-bunny-retreat-work) - (format #t "~Tfound-best: ~A~%" (-> obj found-best)) - (format #t "~Tusing-jump-event?: ~A~%" (-> obj using-jump-event?)) - (format #t "~Tbest-travel-dist: ~f~%" (-> obj best-travel-dist)) - (format #t "~Tbest-dest: #~%" (-> obj best-dest)) - (format #t "~Taway-vec: #~%" (-> obj away-vec)) - obj +(defmethod inspect snow-bunny-retreat-work ((this snow-bunny-retreat-work)) + (format #t "[~8x] ~A~%" this 'snow-bunny-retreat-work) + (format #t "~Tfound-best: ~A~%" (-> this found-best)) + (format #t "~Tusing-jump-event?: ~A~%" (-> this using-jump-event?)) + (format #t "~Tbest-travel-dist: ~f~%" (-> this best-travel-dist)) + (format #t "~Tbest-dest: #~%" (-> this best-dest)) + (format #t "~Taway-vec: #~%" (-> this away-vec)) + this ) ;; definition for method 55 of type snow-bunny ;; INFO: Used lq/sq -(defmethod nav-enemy-method-55 snow-bunny ((obj snow-bunny)) - (set! (-> obj using-jump-event?) #f) +(defmethod nav-enemy-method-55 snow-bunny ((this snow-bunny)) + (set! (-> this using-jump-event?) #f) (if (not *target*) (return #f) ) (let ((s5-0 (new 'stack-no-clear 'snow-bunny-retreat-work))) (set! (-> s5-0 found-best) #f) - (let ((s4-0 (-> obj nav))) + (let ((s4-0 (-> this nav))) (nav-control-method-27 s4-0) (nav-control-method-28 s4-0 (the-as collide-kind -1)) ) (let ((s4-1 (target-pos 0))) - (vector-! (-> s5-0 away-vec) (-> obj collide-info trans) s4-1) + (vector-! (-> s5-0 away-vec) (-> this collide-info trans) s4-1) (set! (-> s5-0 away-vec y) 0.0) (vector-normalize! (-> s5-0 away-vec) 86016.0) (let* ((s3-0 (quaternion-y-angle (-> *target* control quat))) @@ -931,7 +927,7 @@ (s1-0 (new 'stack-no-clear 'vector)) ) (vector-rotate-around-y! s1-0 (-> s5-0 away-vec) f0-7) - (vector+! (-> obj final-dest) s4-1 s1-0) + (vector+! (-> this final-dest) s4-1 s1-0) ) ) ) @@ -945,11 +941,11 @@ (s1-1 (new 'stack-no-clear 'vector)) ) (vector-rotate-around-y! s1-1 (-> s5-0 away-vec) f0-10) - (vector+! (-> obj final-dest) s4-1 s1-1) + (vector+! (-> this final-dest) s4-1 s1-1) ) ) ) - (let* ((s1-3 (vector-! (new 'stack-no-clear 'vector) (-> obj final-dest) (-> obj collide-info trans))) + (let* ((s1-3 (vector-! (new 'stack-no-clear 'vector) (-> this final-dest) (-> this collide-info trans))) (f0-12 (vector-length s1-3)) ) (let ((f1-4 (* 0.000011625744 f0-12))) @@ -961,41 +957,41 @@ (set! f1-4 0.4) ) ) - (set! (-> obj base-hop-dist) (+ 16384.0 (* 20480.0 f1-4))) + (set! (-> this base-hop-dist) (+ 16384.0 (* 20480.0 f1-4))) ) - (when (< (-> obj base-hop-dist) f0-12) - (vector-normalize! s1-3 (-> obj base-hop-dist)) - (vector+! (-> obj final-dest) (-> obj collide-info trans) s1-3) + (when (< (-> this base-hop-dist) f0-12) + (vector-normalize! s1-3 (-> this base-hop-dist)) + (vector+! (-> this final-dest) (-> this collide-info trans) s1-3) ) ) - (set! (-> obj nav target-pos quad) (-> obj final-dest quad)) - (set! (-> obj got-jump-event?) #f) - (nav-control-method-13 (-> obj nav) (-> obj nav target-pos) (-> obj nav old-travel)) - (when (< (vector-xz-length (-> obj nav travel)) 204.8) + (set! (-> this nav target-pos quad) (-> this final-dest quad)) + (set! (-> this got-jump-event?) #f) + (nav-control-method-13 (-> this nav) (-> this nav target-pos) (-> this nav old-travel)) + (when (< (vector-xz-length (-> this nav travel)) 204.8) (let ((s1-4 (new 'stack-no-clear 'nav-gap-info))) - (when (nav-control-method-12 (-> obj nav) s1-4) - (set! (-> obj got-jump-event?) #t) - (set! (-> obj jump-event-dest quad) (-> s1-4 dest quad)) + (when (nav-control-method-12 (-> this nav) s1-4) + (set! (-> this got-jump-event?) #t) + (set! (-> this jump-event-dest quad) (-> s1-4 dest quad)) ) ) ) (cond - ((-> obj got-jump-event?) + ((-> this got-jump-event?) (when (zero? s2-0) - (set! (-> obj nav target-pos quad) (-> obj jump-event-dest quad)) - (set! (-> obj using-jump-event?) #t) + (set! (-> this nav target-pos quad) (-> this jump-event-dest quad)) + (set! (-> this using-jump-event?) #t) (return #t) ) ) (else - (let* ((s0-0 (-> obj nav travel)) + (let* ((s0-0 (-> this nav travel)) (f30-2 (vector-length s0-0)) ) (when (>= f30-2 409.6) - (let ((s1-5 (-> obj nav target-pos))) - (vector+! s1-5 (-> obj collide-info trans) s0-0) - (when (snow-bunny-method-51 obj s1-5 s1-5) - (if (>= f30-2 (+ -409.6 (-> obj base-hop-dist))) + (let ((s1-5 (-> this nav target-pos))) + (vector+! s1-5 (-> this collide-info trans) s0-0) + (when (snow-bunny-method-51 this s1-5 s1-5) + (if (>= f30-2 (+ -409.6 (-> this base-hop-dist))) (return #t) ) (when (or (not (-> s5-0 found-best)) (< (-> s5-0 best-travel-dist) f30-2)) @@ -1013,8 +1009,8 @@ ) ) (when (-> s5-0 found-best) - (set! (-> obj nav target-pos quad) (-> s5-0 best-dest quad)) - (vector-! (-> obj nav travel) (-> s5-0 best-dest) (-> obj collide-info trans)) + (set! (-> this nav target-pos quad) (-> s5-0 best-dest quad)) + (vector-! (-> this nav travel) (-> s5-0 best-dest) (-> this collide-info trans)) (return #t) ) ) @@ -1026,18 +1022,16 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (not *target*) (go-virtual nav-enemy-patrol) ) (let ((v1-8 (>= 73728.0 (vector-vector-xz-distance (target-pos 0) (-> self collide-info trans))))) (when (or (-> self should-retreat?) (and v1-8 (logtest? (-> *target* state-flags) (state-flags dangerous)))) - (set! (-> self retreat-timeout-time) - (+ (-> *display* base-frame-counter) (the int (* 300.0 (-> self retreat-timeout)))) - ) + (set! (-> self retreat-timeout-time) (+ (current-time) (the int (* 300.0 (-> self retreat-timeout))))) (set! (-> self should-retreat?) #f) ) - (when (or (>= (-> *display* base-frame-counter) (-> self retreat-timeout-time)) (not v1-8)) + (when (or (>= (current-time) (-> self retreat-timeout-time)) (not v1-8)) (if (or (not *target*) (logtest? (-> *target* state-flags) (state-flags do-not-notice)) (not (target-in-range? self (-> self nav-info stop-chase-distance))) @@ -1079,7 +1073,7 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (snow-bunny-method-76 self #f) ) :trans (behavior () @@ -1119,7 +1113,7 @@ :virtual override :event snow-bunny-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set-vector! (-> self collide-info transv) 0.0 0.0 0.0 1.0) (snow-bunny-method-76 self #t) ) @@ -1130,7 +1124,7 @@ (seek-toward-heading-vec! (-> self collide-info) gp-0 524288.0 (seconds 0.1)) ) ) - (+! (-> self collide-info transv y) (* -546119.7 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -546119.7 (seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc index 8972165060..8ee6ecf88d 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-flutflut-obs_REF.gc @@ -32,23 +32,23 @@ ) ;; definition for method 3 of type flutflut-plat -(defmethod inspect flutflut-plat ((obj flutflut-plat)) +(defmethod inspect flutflut-plat ((this flutflut-plat)) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Thas-path?: ~A~%" (-> obj has-path?)) - (format #t "~T~Tplat-type: ~D~%" (-> obj plat-type)) - (format #t "~T~Trise-time: ~D~%" (-> obj rise-time)) - (format #t "~T~Tfall-time: ~D~%" (-> obj fall-time)) - (format #t "~T~Tpart-ry: ~f~%" (-> obj part-ry)) - (format #t "~T~Tsync-starting-val: ~f~%" (-> obj sync-starting-val)) - (format #t "~T~Tflutflut-button: ~A~%" (-> obj flutflut-button)) - (format #t "~T~Tappear-trans-top: #~%" (-> obj appear-trans-top)) - (format #t "~T~Tappear-trans-bottom: #~%" (-> obj appear-trans-bottom)) - (format #t "~T~Tappear-quat-top: #~%" (-> obj appear-quat-top)) - (format #t "~T~Tappear-quat-bottom: #~%" (-> obj appear-quat-bottom)) - (format #t "~T~Tstart-trans: #~%" (-> obj start-trans)) - obj + (format #t "~T~Thas-path?: ~A~%" (-> this has-path?)) + (format #t "~T~Tplat-type: ~D~%" (-> this plat-type)) + (format #t "~T~Trise-time: ~D~%" (-> this rise-time)) + (format #t "~T~Tfall-time: ~D~%" (-> this fall-time)) + (format #t "~T~Tpart-ry: ~f~%" (-> this part-ry)) + (format #t "~T~Tsync-starting-val: ~f~%" (-> this sync-starting-val)) + (format #t "~T~Tflutflut-button: ~A~%" (-> this flutflut-button)) + (format #t "~T~Tappear-trans-top: #~%" (-> this appear-trans-top)) + (format #t "~T~Tappear-trans-bottom: #~%" (-> this appear-trans-bottom)) + (format #t "~T~Tappear-quat-top: #~%" (-> this appear-quat-top)) + (format #t "~T~Tappear-quat-bottom: #~%" (-> this appear-quat-bottom)) + (format #t "~T~Tstart-trans: #~%" (-> this start-trans)) + this ) ;; definition of type snow-button @@ -73,16 +73,16 @@ ) ;; definition for method 3 of type snow-button -(defmethod inspect snow-button ((obj snow-button)) +(defmethod inspect snow-button ((this snow-button)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Twiggled?: ~A~%" (-> obj wiggled?)) - (format #t "~T~Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~T~Tdelay-til-wiggle: ~D~%" (-> obj delay-til-wiggle)) - (format #t "~T~Tprev-button: ~A~%" (-> obj prev-button)) - (format #t "~T~Tticker: #~%" (-> obj ticker)) - obj + (format #t "~T~Twiggled?: ~A~%" (-> this wiggled?)) + (format #t "~T~Ttimeout: ~D~%" (-> this timeout)) + (format #t "~T~Tdelay-til-wiggle: ~D~%" (-> this delay-til-wiggle)) + (format #t "~T~Tprev-button: ~A~%" (-> this prev-button)) + (format #t "~T~Tticker: #~%" (-> this ticker)) + this ) ;; failed to figure out what this is: @@ -308,7 +308,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self wiggled?) #f) (sleep (-> self ticker) (-> self timeout)) (when (-> self prev-button) @@ -369,8 +369,8 @@ :trans rider-trans :code (behavior () (send-to-all-after (-> self link) 'untrigger) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.6)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.6)) (suspend) ) (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) @@ -385,8 +385,8 @@ ;; definition for method 11 of type snow-button ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-button ((obj snow-button) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-button ((this snow-button) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -428,23 +428,23 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (initialize-skeleton obj *snow-button-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj timeout) (the-as time-frame (the int (* 300.0 (res-lump-float arg0 'timeout :default 10.0))))) - (set! (-> obj delay-til-wiggle) (+ (-> obj timeout) (seconds -0.4))) + (process-drawable-from-entity! this arg0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (initialize-skeleton this *snow-button-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this timeout) (the-as time-frame (the int (* 300.0 (res-lump-float arg0 'timeout :default 10.0))))) + (set! (-> this delay-til-wiggle) (+ (-> this timeout) (seconds -0.4))) (if (> (entity-actor-count arg0 'alt-actor) 0) - (set! (-> obj prev-button) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj prev-button) #f) + (set! (-> this prev-button) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this prev-button) #f) ) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) @@ -457,62 +457,62 @@ ;; definition for method 26 of type flutflut-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-26 flutflut-plat ((obj flutflut-plat)) +(defmethod baseplat-method-26 flutflut-plat ((this flutflut-plat)) (let ((t9-0 (method-of-type plat baseplat-method-26))) - (t9-0 obj) + (t9-0 this) ) - (if (zero? (-> obj link)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) + (if (zero? (-> this link)) + (set! (-> this link) (new 'process 'actor-link-info this)) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj plat-type) (res-lump-value (-> obj entity) 'mode int)) - (set! (-> obj flutflut-button) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (let ((f0-0 (res-lump-float (-> obj entity) 'rotoffset))) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this plat-type) (res-lump-value (-> this entity) 'mode int)) + (set! (-> this flutflut-button) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-0 0.0) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-0) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-0) ) ) - (set! (-> obj has-path?) - (and (not (logtest? (-> obj path flags) (path-control-flag not-found))) (> (-> obj sync period) 0)) + (set! (-> this has-path?) + (and (not (logtest? (-> this path flags) (path-control-flag not-found))) (> (-> this sync period) 0)) ) - (when (nonzero? (-> obj plat-type)) + (when (nonzero? (-> this plat-type)) (cond - ((-> obj has-path?) - (set! (-> obj sync-starting-val) (get-phase-offset (-> obj sync))) - (sync-now! (-> obj sync) (-> obj sync-starting-val)) + ((-> this has-path?) + (set! (-> this sync-starting-val) (get-phase-offset (-> this sync))) + (sync-now! (-> this sync) (-> this sync-starting-val)) (eval-path-curve! - (-> obj path) - (-> obj appear-trans-top) - (if (logtest? (-> obj fact options) (fact-options wrap-phase)) - (get-current-phase (-> obj sync)) - (get-current-phase-with-mirror (-> obj sync)) + (-> this path) + (-> this appear-trans-top) + (if (logtest? (-> this fact options) (fact-options wrap-phase)) + (get-current-phase (-> this sync)) + (get-current-phase-with-mirror (-> this sync)) ) 'interp ) ) (else - (set! (-> obj appear-trans-top quad) (-> obj root-override trans quad)) + (set! (-> this appear-trans-top quad) (-> this root-override trans quad)) ) ) - (set! (-> obj appear-trans-bottom quad) (-> obj appear-trans-top quad)) - (+! (-> obj appear-trans-bottom y) -286720.0) - (quaternion-copy! (-> obj appear-quat-top) (-> obj root-override quat)) - (let ((v1-33 (res-lump-value (-> obj entity) 'extra-id uint128))) - (set! (-> obj rise-time) (the int (* 300.0 (+ 0.6 (* 0.15 (the float v1-33)))))) + (set! (-> this appear-trans-bottom quad) (-> this appear-trans-top quad)) + (+! (-> this appear-trans-bottom y) -286720.0) + (quaternion-copy! (-> this appear-quat-top) (-> this root-override quat)) + (let ((v1-33 (res-lump-value (-> this entity) 'extra-id uint128))) + (set! (-> this rise-time) (the int (* 300.0 (+ 0.6 (* 0.15 (the float v1-33)))))) ) - (set! (-> obj fall-time) 180) + (set! (-> this fall-time) 180) ) (none) ) ;; definition for method 27 of type flutflut-plat ;; INFO: Return type mismatch symbol vs skeleton-group. -(defmethod get-lit-skel flutflut-plat ((obj flutflut-plat)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) +(defmethod get-lit-skel flutflut-plat ((this flutflut-plat)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (return (the-as skeleton-group #t)) ) - (when (task-complete? *game-info* (-> obj entity extra perm task)) - (process-entity-status! obj (entity-perm-status complete) #t) + (when (task-complete? *game-info* (-> this entity extra perm task)) + (process-entity-status! this (entity-perm-status complete) #t) (return (the-as skeleton-group #t)) ) (the-as skeleton-group #f) @@ -602,7 +602,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self draw status) (draw-status hidden)) (restore-collide-with-as (-> self root-override)) @@ -623,12 +623,7 @@ ) :trans (behavior () (plat-trans) - (let* ((f0-1 - (fmin - 1.0 - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) (the float (-> self rise-time))) - ) - ) + (let* ((f0-1 (fmin 1.0 (/ (the float (- (current-time) (-> self state-time))) (the float (-> self rise-time))))) (f0-2 (- 1.0 f0-1)) (f0-3 (* f0-2 f0-2)) (f30-0 (- 1.0 f0-3)) @@ -750,7 +745,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self root-override root-prim prim-core action) (collide-action rider-plat-sticky)) (set! (-> self start-trans quad) (-> self root-override trans quad)) @@ -771,12 +766,7 @@ ) :trans (behavior () (plat-trans) - (let* ((f0-1 - (fmin - 1.0 - (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) (the float (-> self fall-time))) - ) - ) + (let* ((f0-1 (fmin 1.0 (/ (the float (- (current-time) (-> self state-time))) (the float (-> self fall-time))))) (f30-0 (* f0-1 f0-1)) ) (vector-lerp! (-> self basetrans) (-> self start-trans) (-> self appear-trans-bottom) f30-0) @@ -840,7 +830,7 @@ (baseplat-method-22 self) (go elevator-idle-at-fort) ) - (seek! (-> self path-pos) 1.0 (* 0.06666667 (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) 1.0 (* 0.06666667 (seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (baseplat-method-20 self) @@ -894,7 +884,7 @@ (baseplat-method-22 self) (go elevator-idle-at-cave) ) - (seek! (-> self path-pos) 0.0 (* 0.06666667 (-> *display* seconds-per-frame))) + (seek! (-> self path-pos) 0.0 (* 0.06666667 (seconds-per-frame))) (eval-path-curve! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) (plat-trans) (baseplat-method-20 self) @@ -913,11 +903,11 @@ ) ;; definition for method 3 of type flutflut-plat-small -(defmethod inspect flutflut-plat-small ((obj flutflut-plat-small)) +(defmethod inspect flutflut-plat-small ((this flutflut-plat-small)) (let ((t9-0 (method-of-type flutflut-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type flutflut-plat-med @@ -930,11 +920,11 @@ ) ;; definition for method 3 of type flutflut-plat-med -(defmethod inspect flutflut-plat-med ((obj flutflut-plat-med)) +(defmethod inspect flutflut-plat-med ((this flutflut-plat-med)) (let ((t9-0 (method-of-type flutflut-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type flutflut-plat-large @@ -947,52 +937,52 @@ ) ;; definition for method 3 of type flutflut-plat-large -(defmethod inspect flutflut-plat-large ((obj flutflut-plat-large)) +(defmethod inspect flutflut-plat-large ((this flutflut-plat-large)) (let ((t9-0 (method-of-type flutflut-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 23 of type flutflut-plat-small -(defmethod get-unlit-skel flutflut-plat-small ((obj flutflut-plat-small)) +(defmethod get-unlit-skel flutflut-plat-small ((this flutflut-plat-small)) *flutflut-plat-small-sg* ) ;; definition for method 25 of type flutflut-plat-small ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. -(defmethod baseplat-method-25 flutflut-plat-small ((obj flutflut-plat-small)) - (let ((v0-0 (create-launch-control (-> *part-group-id-table* 516) obj))) - (set! (-> obj part) v0-0) +(defmethod baseplat-method-25 flutflut-plat-small ((this flutflut-plat-small)) + (let ((v0-0 (create-launch-control (-> *part-group-id-table* 516) this))) + (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) ;; definition for method 20 of type flutflut-plat-small ;; INFO: Return type mismatch object vs none. -(defmethod baseplat-method-20 flutflut-plat-small ((obj flutflut-plat-small)) - (when (nonzero? (-> obj part)) - (set! (-> *part-id-table* 2087 init-specs 12 initial-valuef) (-> obj part-ry)) - (set! (-> *part-id-table* 2088 init-specs 17 initial-valuef) (-> obj part-ry)) - (spawn (-> obj part) (-> obj root-override trans)) +(defmethod baseplat-method-20 flutflut-plat-small ((this flutflut-plat-small)) + (when (nonzero? (-> this part)) + (set! (-> *part-id-table* 2087 init-specs 12 initial-valuef) (-> this part-ry)) + (set! (-> *part-id-table* 2088 init-specs 17 initial-valuef) (-> this part-ry)) + (spawn (-> this part) (-> this root-override trans)) ) (none) ) ;; definition for method 26 of type flutflut-plat-small ;; INFO: Return type mismatch float vs none. -(defmethod baseplat-method-26 flutflut-plat-small ((obj flutflut-plat-small)) +(defmethod baseplat-method-26 flutflut-plat-small ((this flutflut-plat-small)) (let ((t9-0 (method-of-type flutflut-plat baseplat-method-26))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj part-ry) (+ 16384.0 (quaternion-y-angle (-> obj root-override quat)))) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) (none) ) ;; definition for method 24 of type flutflut-plat-small ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 flutflut-plat-small ((obj flutflut-plat-small)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 flutflut-plat-small ((this flutflut-plat-small)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1010,30 +1000,30 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) ;; definition for method 23 of type flutflut-plat-med -(defmethod get-unlit-skel flutflut-plat-med ((obj flutflut-plat-med)) +(defmethod get-unlit-skel flutflut-plat-med ((this flutflut-plat-med)) *flutflut-plat-med-sg* ) ;; definition for method 25 of type flutflut-plat-med ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. -(defmethod baseplat-method-25 flutflut-plat-med ((obj flutflut-plat-med)) - (let ((v0-0 (create-launch-control (-> *part-group-id-table* 517) obj))) - (set! (-> obj part) v0-0) +(defmethod baseplat-method-25 flutflut-plat-med ((this flutflut-plat-med)) + (let ((v0-0 (create-launch-control (-> *part-group-id-table* 517) this))) + (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) ;; definition for method 24 of type flutflut-plat-med ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 flutflut-plat-med ((obj flutflut-plat-med)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 flutflut-plat-med ((this flutflut-plat-med)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1051,51 +1041,51 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) ;; definition for method 23 of type flutflut-plat-large -(defmethod get-unlit-skel flutflut-plat-large ((obj flutflut-plat-large)) +(defmethod get-unlit-skel flutflut-plat-large ((this flutflut-plat-large)) *flutflut-plat-large-sg* ) ;; definition for method 25 of type flutflut-plat-large ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. -(defmethod baseplat-method-25 flutflut-plat-large ((obj flutflut-plat-large)) - (let ((v0-0 (create-launch-control (-> *part-group-id-table* 518) obj))) - (set! (-> obj part) v0-0) +(defmethod baseplat-method-25 flutflut-plat-large ((this flutflut-plat-large)) + (let ((v0-0 (create-launch-control (-> *part-group-id-table* 518) this))) + (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) ;; definition for method 20 of type flutflut-plat-large ;; INFO: Return type mismatch object vs none. -(defmethod baseplat-method-20 flutflut-plat-large ((obj flutflut-plat-large)) - (when (nonzero? (-> obj part)) - (set! (-> *part-id-table* 2091 init-specs 12 initial-valuef) (-> obj part-ry)) - (set! (-> *part-id-table* 2092 init-specs 17 initial-valuef) (-> obj part-ry)) - (spawn (-> obj part) (-> obj root-override trans)) +(defmethod baseplat-method-20 flutflut-plat-large ((this flutflut-plat-large)) + (when (nonzero? (-> this part)) + (set! (-> *part-id-table* 2091 init-specs 12 initial-valuef) (-> this part-ry)) + (set! (-> *part-id-table* 2092 init-specs 17 initial-valuef) (-> this part-ry)) + (spawn (-> this part) (-> this root-override trans)) ) (none) ) ;; definition for method 26 of type flutflut-plat-large ;; INFO: Return type mismatch float vs none. -(defmethod baseplat-method-26 flutflut-plat-large ((obj flutflut-plat-large)) +(defmethod baseplat-method-26 flutflut-plat-large ((this flutflut-plat-large)) (let ((t9-0 (method-of-type flutflut-plat baseplat-method-26))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj part-ry) (+ 16384.0 (quaternion-y-angle (-> obj root-override quat)))) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) (none) ) ;; definition for method 24 of type flutflut-plat-large ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 flutflut-plat-large ((obj flutflut-plat-large)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 flutflut-plat-large ((this flutflut-plat-large)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1113,7 +1103,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) 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 640f2ec078..b71cbb686c 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-obs_REF.gc @@ -12,12 +12,12 @@ ) ;; definition for method 3 of type snowcam -(defmethod inspect snowcam ((obj snowcam)) +(defmethod inspect snowcam ((this snowcam)) (let ((t9-0 (method-of-type pov-camera inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tseq: ~D~%" (-> obj seq)) - obj + (format #t "~T~Tseq: ~D~%" (-> this seq)) + this ) ;; failed to figure out what this is: @@ -27,8 +27,8 @@ ) ;; definition for method 29 of type snowcam -(defmethod set-stack-size! snowcam ((obj snowcam)) - (stack-size-set! (-> obj main-thread) 512) +(defmethod set-stack-size! snowcam ((this snowcam)) + (stack-size-set! (-> this main-thread) 512) (none) ) @@ -54,8 +54,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 4.5)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 4.5)) (suspend) ) ) @@ -131,13 +131,13 @@ ) ;; definition for method 3 of type snow-eggtop -(defmethod inspect snow-eggtop ((obj snow-eggtop)) +(defmethod inspect snow-eggtop ((this snow-eggtop)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspawn-trans: #~%" (-> obj spawn-trans)) - (format #t "~T~Tplay-sound?: ~A~%" (-> obj play-sound?)) - obj + (format #t "~T~Tspawn-trans: #~%" (-> this spawn-trans)) + (format #t "~T~Tplay-sound?: ~A~%" (-> this play-sound?)) + this ) ;; failed to figure out what this is: @@ -413,8 +413,8 @@ *entity-pool* (game-task none) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1.1)) (if (-> self play-sound?) (update! (-> self sound)) ) @@ -458,8 +458,8 @@ ;; definition for method 11 of type snow-eggtop ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-eggtop ((obj snow-eggtop) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-eggtop ((this snow-eggtop) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -477,32 +477,32 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-eggtop-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj spawn-trans quad) (-> obj root-override trans quad)) - (+! (-> obj root-override trans y) -2662.4) - (update-transforms! (-> obj root-override)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 510) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "electric-loop" :fo-max 40) (-> obj root-override trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-eggtop-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this spawn-trans quad) (-> this root-override trans quad)) + (+! (-> this root-override trans y) -2662.4) + (update-transforms! (-> this root-override)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 510) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "electric-loop" :fo-max 40) (-> this root-override trans)) ) (cond - ((task-complete? *game-info* (-> obj entity extra perm task)) + ((task-complete? *game-info* (-> this entity extra perm task)) (go snow-eggtop-idle-down) ) (else (let ((a0-17 (new 'stack-no-clear 'vector))) - (set! (-> a0-17 quad) (-> obj root-override trans quad)) + (set! (-> a0-17 quad) (-> this root-override trans quad)) (+! (-> a0-17 y) 3072.0) (birth-pickup-at-point a0-17 (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) + (the float (-> this entity extra perm task)) #f - obj + this (the-as fact-info #f) ) ) @@ -531,15 +531,15 @@ ;; definition for method 3 of type snowpusher ;; INFO: Used lq/sq -(defmethod inspect snowpusher ((obj snowpusher)) +(defmethod inspect snowpusher ((this snowpusher)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmax-frame: ~f~%" (-> obj max-frame)) - (format #t "~T~Topen-sound: ~D~%" (-> obj open-sound)) - (format #t "~T~Tclose-sound: ~D~%" (-> obj close-sound)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - obj + (format #t "~T~Tmax-frame: ~f~%" (-> this max-frame)) + (format #t "~T~Topen-sound: ~D~%" (-> this open-sound)) + (format #t "~T~Tclose-sound: ~D~%" (-> this close-sound)) + (format #t "~T~Tsync: #~%" (-> this sync)) + this ) ;; failed to figure out what this is: @@ -588,14 +588,14 @@ ;; definition for method 11 of type snowpusher ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snowpusher ((obj snowpusher) (arg0 entity-actor)) +(defmethod init-from-entity! snowpusher ((this snowpusher) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (logior! (-> obj mask) (process-mask enemy platform)) + (logior! (-> this mask) (process-mask enemy platform)) (let ((s3-0 0) (s4-0 0) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-3 (res-lump-data (-> obj entity) 'mode (pointer int32) :tag-ptr (& sv-16)))) + (let ((v1-3 (res-lump-data (-> this entity) 'mode (pointer int32) :tag-ptr (& sv-16)))) (when v1-3 (set! s3-0 (-> v1-3 0)) (set! s4-0 (-> v1-3 1)) @@ -603,19 +603,19 @@ ) (cond ((zero? s3-0) - (set! (-> obj open-sound) (static-sound-name "snow-piston-opn")) - (set! (-> obj close-sound) (static-sound-name "snow-piston-cls")) + (set! (-> this open-sound) (static-sound-name "snow-piston-opn")) + (set! (-> this close-sound) (static-sound-name "snow-piston-cls")) ) ((= s3-0 1) - (set! (-> obj open-sound) (static-sound-name "snow-pist-opn3")) - (set! (-> obj close-sound) (static-sound-name "snow-pist-cls3")) + (set! (-> this open-sound) (static-sound-name "snow-pist-opn3")) + (set! (-> this close-sound) (static-sound-name "snow-pist-cls3")) ) ((= s3-0 2) - (set! (-> obj open-sound) (static-sound-name "snow-pist-opn2")) - (set! (-> obj close-sound) (static-sound-name "snow-pist-cls2")) + (set! (-> this open-sound) (static-sound-name "snow-pist-opn2")) + (set! (-> this close-sound) (static-sound-name "snow-pist-cls2")) ) ) - (let ((s3-1 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s3-1 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s3-1 dynam) (copy *standard-dynamics* 'process)) (set! (-> s3-1 reaction) default-collision-reaction) (set! (-> s3-1 no-reaction) @@ -632,22 +632,22 @@ ) (set! (-> s3-1 nav-radius) (* 0.75 (-> s3-1 root-prim local-sphere w))) (backup-collide-with-as s3-1) - (set! (-> obj root-override) s3-1) + (set! (-> this root-override) s3-1) ) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snowpusher-sg* '()) - (let ((s4-2 (-> obj skel root-channel 0))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snowpusher-sg* '()) + (let ((s4-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-2 frame-num) 0.0) ) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) - (set! (-> obj max-frame) (* (the float (ja-num-frames 0)) (res-lump-float arg0 'max-frame :default 1.0))) - (logclear! (-> obj mask) (process-mask actor-pause)) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) + (set! (-> this max-frame) (* (the float (ja-num-frames 0)) (res-lump-float arg0 'max-frame :default 1.0))) + (logclear! (-> this mask) (process-mask actor-pause)) (go snowpusher-idle) (none) ) @@ -667,13 +667,13 @@ ) ;; definition for method 3 of type snow-spatula -(defmethod inspect snow-spatula ((obj snow-spatula)) +(defmethod inspect snow-spatula ((this snow-spatula)) (let ((t9-0 (method-of-type baseplat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tstartmat: #~%" (-> obj startmat)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tstartmat: #~%" (-> this startmat)) + this ) ;; failed to figure out what this is: @@ -734,9 +734,9 @@ ;; definition for method 11 of type snow-spatula ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-spatula ((obj snow-spatula) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-spatula ((this snow-spatula) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -754,14 +754,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-spatula-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) - (quaternion->matrix (-> obj startmat) (-> obj root-override quat)) - (baseplat-method-21 obj) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-spatula-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) + (quaternion->matrix (-> this startmat) (-> this root-override quat)) + (baseplat-method-21 this) (go snow-spatula-idle) (none) ) @@ -786,15 +786,15 @@ ) ;; definition for method 3 of type snow-fort-gate -(defmethod inspect snow-fort-gate ((obj snow-fort-gate)) +(defmethod inspect snow-fort-gate ((this snow-fort-gate)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tpart3: ~A~%" (-> obj part3)) - (format #t "~T~Topen-trans: #~%" (-> obj open-trans)) - (format #t "~T~Tclosed-trans: #~%" (-> obj closed-trans)) - obj + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tpart3: ~A~%" (-> this part3)) + (format #t "~T~Topen-trans: #~%" (-> this open-trans)) + (format #t "~T~Tclosed-trans: #~%" (-> this closed-trans)) + this ) ;; failed to figure out what this is: @@ -1043,7 +1043,7 @@ (go snow-fort-gate-idle-open) ) ) - (vector-seek-3d-smooth! s5-0 (-> self open-trans) (* 16384.0 (-> *display* seconds-per-frame)) 0.9) + (vector-seek-3d-smooth! s5-0 (-> self open-trans) (* 16384.0 (seconds-per-frame)) 0.9) (move-to-point! (-> self root-override) s5-0) ) (let ((a1-7 (new 'stack-no-clear 'vector))) @@ -1077,37 +1077,37 @@ ) ;; definition for method 10 of type snow-fort-gate -(defmethod deactivate snow-fort-gate ((obj snow-fort-gate)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate snow-fort-gate ((this snow-fort-gate)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj part3)) - (kill-and-free-particles (-> obj part3)) + (if (nonzero? (-> this part3)) + (kill-and-free-particles (-> this part3)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type snow-fort-gate ;; INFO: Return type mismatch process-drawable vs snow-fort-gate. -(defmethod relocate snow-fort-gate ((obj snow-fort-gate) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate snow-fort-gate ((this snow-fort-gate) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj part3)) - (&+! (-> obj part3) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method snow-fort-gate 7)) this arg0) ) ) ;; definition for method 11 of type snow-fort-gate ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-fort-gate ((obj snow-fort-gate) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! snow-fort-gate ((this snow-fort-gate) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind ground-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1119,37 +1119,37 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-fort-gate-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 512) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 513) obj)) - (set! (-> obj part3) (create-launch-control (-> *part-group-id-table* 514) obj)) - (set! (-> obj open-trans quad) (-> obj root-override trans quad)) - (set! (-> obj closed-trans quad) (-> obj open-trans quad)) - (+! (-> obj open-trans y) -141312.0) - (+! (-> obj open-trans z) 32768.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "lodge-door-mov" :fo-max 80) (-> obj open-trans)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-fort-gate-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 512) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 513) this)) + (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 514) this)) + (set! (-> this open-trans quad) (-> this root-override trans quad)) + (set! (-> this closed-trans quad) (-> this open-trans quad)) + (+! (-> this open-trans y) -141312.0) + (+! (-> this open-trans z) 32768.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "lodge-door-mov" :fo-max 80) (-> this open-trans)) ) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (cond ((task-complete? *game-info* (game-task snow-ball)) - (set! (-> obj root-override trans quad) (-> obj open-trans quad)) + (set! (-> this root-override trans quad) (-> this open-trans quad)) (transform-post) (go snow-fort-gate-idle-open) ) (else - (set! (-> obj root-override trans quad) (-> obj closed-trans quad)) + (set! (-> this root-override trans quad) (-> this closed-trans quad)) (transform-post) (go snow-fort-gate-idle-closed) ) @@ -1176,11 +1176,11 @@ ) ;; definition for method 3 of type snow-gears -(defmethod inspect snow-gears ((obj snow-gears)) +(defmethod inspect snow-gears ((this snow-gears)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1261,11 +1261,11 @@ ;; definition for method 20 of type snow-gears ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod snow-gears-method-20 snow-gears ((obj snow-gears)) +(defmethod snow-gears-method-20 snow-gears ((this snow-gears)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (set! (-> a1-0 quad) (-> obj root trans quad)) + (set! (-> a1-0 quad) (-> this root trans quad)) (+! (-> a1-0 y) 61440.0) - (spawn (-> obj part) a1-0) + (spawn (-> this part) a1-0) ) (none) ) @@ -1309,9 +1309,9 @@ (suspend) (ja :num! (seek! max 0.35)) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! (-> self draw art-group data 2) :num! min) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (update! (-> self sound)) (suspend) ) @@ -1361,13 +1361,13 @@ ;; definition for method 11 of type snow-gears ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-gears ((obj snow-gears) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-gears-sg* '()) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 515) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "snow-engine" :fo-max 300) (-> obj root trans)) +(defmethod init-from-entity! snow-gears ((this snow-gears) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-gears-sg* '()) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 515) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "snow-engine" :fo-max 300) (-> this root trans)) ) (go snow-gears-idle) (none) @@ -1392,14 +1392,14 @@ ) ;; definition for method 3 of type snow-switch -(defmethod inspect snow-switch ((obj snow-switch)) +(defmethod inspect snow-switch ((this snow-switch)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpressed?: ~A~%" (-> obj pressed?)) - (format #t "~T~Tfcell-handle: ~D~%" (-> obj fcell-handle)) - (format #t "~T~Torig-trans: #~%" (-> obj orig-trans)) - obj + (format #t "~T~Tpressed?: ~A~%" (-> this pressed?)) + (format #t "~T~Tfcell-handle: ~D~%" (-> this fcell-handle)) + (format #t "~T~Torig-trans: #~%" (-> this orig-trans)) + this ) ;; failed to figure out what this is: @@ -1503,7 +1503,7 @@ ) (else (set! (-> s5-1 y) - (seek-with-smooth (-> self root-override trans y) f0-1 (* 6144.0 (-> *display* seconds-per-frame)) 0.2 204.8) + (seek-with-smooth (-> self root-override trans y) f0-1 (* 6144.0 (seconds-per-frame)) 0.2 204.8) ) (move-to-point! (-> self root-override) s5-1) ) @@ -1534,11 +1534,11 @@ ;; definition for method 11 of type snow-switch ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-switch ((obj snow-switch) (arg0 entity-actor)) - (set! (-> obj pressed?) #f) - (set! (-> obj fcell-handle) (the-as handle #f)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-switch ((this snow-switch) (arg0 entity-actor)) + (set! (-> this pressed?) #f) + (set! (-> this fcell-handle) (the-as handle #f)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1556,37 +1556,37 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-switch-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-switch-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (set! (-> obj orig-trans quad) (-> obj root-override trans quad)) + (set! (-> this orig-trans quad) (-> this root-override trans quad)) (let ((s5-2 (task-complete? *game-info* (game-task snow-ball)))) - (set! (-> obj pressed?) s5-2) + (set! (-> this pressed?) s5-2) (when (not s5-2) (let ((a0-17 (new 'stack-no-clear 'vector))) - (set! (-> a0-17 quad) (-> obj orig-trans quad)) + (set! (-> a0-17 quad) (-> this orig-trans quad)) (+! (-> a0-17 y) 12288.0) - (set! (-> obj fcell-handle) (ppointer->handle (birth-pickup-at-point - a0-17 - (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) - #f - obj - (the-as fact-info #f) - ) - ) + (set! (-> this fcell-handle) (ppointer->handle (birth-pickup-at-point + a0-17 + (pickup-type fuel-cell) + (the float (-> this entity extra perm task)) + #f + this + (the-as fact-info #f) + ) + ) ) ) ) @@ -1616,12 +1616,12 @@ ) ;; definition for method 3 of type snow-log -(defmethod inspect snow-log ((obj snow-log)) +(defmethod inspect snow-log ((this snow-log)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmaster: ~A~%" (-> obj master)) - obj + (format #t "~T~Tmaster: ~A~%" (-> this master)) + this ) ;; failed to figure out what this is: @@ -1765,8 +1765,8 @@ ;; definition for method 11 of type snow-log ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-log ((obj snow-log) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-log ((this snow-log) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1784,18 +1784,18 @@ ) (set! (-> s4-0 nav-radius) 11264.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-log-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (logior! (-> obj draw status) (draw-status hidden)) - (+! (-> obj root-override trans x) -1024.0) - (+! (-> obj root-override trans y) -4915.2) - (set-vector! (-> obj root-override scale) 1.5 1.0 1.5 1.0) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj master) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-log-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (logior! (-> this draw status) (draw-status hidden)) + (+! (-> this root-override trans x) -1024.0) + (+! (-> this root-override trans y) -4915.2) + (set-vector! (-> this root-override scale) 1.5 1.0 1.5 1.0) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this master) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this draw origin-joint-index) (the-as uint 3)) (go snow-log-wait-for-master) (none) ) @@ -1818,13 +1818,13 @@ ) ;; definition for method 3 of type snow-log-button -(defmethod inspect snow-log-button ((obj snow-log-button)) +(defmethod inspect snow-log-button ((this snow-log-button)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tlog: ~A~%" (-> obj log)) - (format #t "~T~Torig-trans: #~%" (-> obj orig-trans)) - obj + (format #t "~T~Tlog: ~A~%" (-> this log)) + (format #t "~T~Torig-trans: #~%" (-> this orig-trans)) + this ) ;; definition for function snow-log-button-event-handler @@ -1899,13 +1899,8 @@ ) (go snow-log-button-idle-down) ) - (set! (-> self root-override trans y) (seek-with-smooth - (-> self root-override trans y) - f30-0 - (* 12288.0 (-> *display* seconds-per-frame)) - 0.2 - 204.8 - ) + (set! (-> self root-override trans y) + (seek-with-smooth (-> self root-override trans y) f30-0 (* 12288.0 (seconds-per-frame)) 0.2 204.8) ) ) (suspend) @@ -1931,8 +1926,8 @@ ;; definition for method 11 of type snow-log-button ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! snow-log-button ((obj snow-log-button) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! snow-log-button ((this snow-log-button) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1950,24 +1945,24 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *snow-switch-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *snow-switch-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-push! 1 0) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) (transform-post) - (set! (-> obj orig-trans quad) (-> obj root-override trans quad)) - (set! (-> obj log) (entity-actor-lookup arg0 'alt-actor 0)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (set! (-> this log) (entity-actor-lookup arg0 'alt-actor 0)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go snow-log-button-idle-down) (go snow-log-button-idle-up) ) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-part_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-part_REF.gc index 20f9b7930b..002edc447e 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type snow-part -(defmethod inspect snow-part ((obj snow-part)) +(defmethod inspect snow-part ((this snow-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -765,7 +765,7 @@ ;; INFO: Return type mismatch int vs none. (defun snow-bird-bob-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (set! (-> arg2 y) (+ (-> (the-as process-drawable (-> arg1 key proc)) root trans y) - (* -2048.0 (sin (* 218.45334 (the float (mod (-> *display* base-frame-counter) 300))))) + (* -2048.0 (sin (* 218.45334 (the float (mod (current-time) 300))))) ) ) 0 diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc index a4ad30a134..7aff61e69f 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ram-boss_REF.gc @@ -22,17 +22,17 @@ ) ;; definition for method 3 of type ram-boss-proj -(defmethod inspect ram-boss-proj ((obj ram-boss-proj)) +(defmethod inspect ram-boss-proj ((this ram-boss-proj)) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tlaunched?: ~A~%" (-> obj launched?)) - (format #t "~T~Tgrowth: ~f~%" (-> obj growth)) - (format #t "~T~Tcharge-sound-id: ~D~%" (-> obj charge-sound-id)) - (format #t "~T~Tlaunch-time: ~D~%" (-> obj launch-time)) - (format #t "~T~Tfacing-dir: #~%" (-> obj facing-dir)) - obj + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tlaunched?: ~A~%" (-> this launched?)) + (format #t "~T~Tgrowth: ~f~%" (-> this growth)) + (format #t "~T~Tcharge-sound-id: ~D~%" (-> this charge-sound-id)) + (format #t "~T~Tlaunch-time: ~D~%" (-> this launch-time)) + (format #t "~T~Tfacing-dir: #~%" (-> this facing-dir)) + this ) ;; definition of type ram-boss @@ -79,25 +79,25 @@ ) ;; definition for method 3 of type ram-boss -(defmethod inspect ram-boss ((obj ram-boss)) +(defmethod inspect ram-boss ((this ram-boss)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tfacing-y: ~f~%" (-> obj facing-y)) - (format #t "~T~Tplayer-dir-y: ~f~%" (-> obj player-dir-y)) - (format #t "~T~Tlast-turn-speed: ~f~%" (-> obj last-turn-speed)) - (format #t "~T~Tfrustration: ~D~%" (-> obj frustration)) - (format #t "~T~Tdead?: ~A~%" (-> obj dead?)) - (format #t "~T~Thas-shield?: ~A~%" (-> obj has-shield?)) - (format #t "~T~Tproj-stoked: ~A~%" (-> obj proj-stoked)) - (format #t "~T~Tproj-status: ~D~%" (-> obj proj-status)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tproj-last-thrown-time: ~D~%" (-> obj proj-last-thrown-time)) - (format #t "~T~Tnav-enemy-patrol-timeout: ~D~%" (-> obj nav-enemy-patrol-timeout)) - (format #t "~T~Tproj-launch-vec: #~%" (-> obj proj-launch-vec)) - (format #t "~T~Tlocal-throw-point: #~%" (-> obj local-throw-point)) - (format #t "~T~Tshield-jmod: ~A~%" (-> obj shield-jmod)) - obj + (format #t "~T~Tfacing-y: ~f~%" (-> this facing-y)) + (format #t "~T~Tplayer-dir-y: ~f~%" (-> this player-dir-y)) + (format #t "~T~Tlast-turn-speed: ~f~%" (-> this last-turn-speed)) + (format #t "~T~Tfrustration: ~D~%" (-> this frustration)) + (format #t "~T~Tdead?: ~A~%" (-> this dead?)) + (format #t "~T~Thas-shield?: ~A~%" (-> this has-shield?)) + (format #t "~T~Tproj-stoked: ~A~%" (-> this proj-stoked)) + (format #t "~T~Tproj-status: ~D~%" (-> this proj-status)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tproj-last-thrown-time: ~D~%" (-> this proj-last-thrown-time)) + (format #t "~T~Tnav-enemy-patrol-timeout: ~D~%" (-> this nav-enemy-patrol-timeout)) + (format #t "~T~Tproj-launch-vec: #~%" (-> this proj-launch-vec)) + (format #t "~T~Tlocal-throw-point: #~%" (-> this local-throw-point)) + (format #t "~T~Tshield-jmod: ~A~%" (-> this shield-jmod)) + this ) ;; failed to figure out what this is: @@ -503,21 +503,21 @@ ;; definition for method 24 of type ram-boss-proj ;; INFO: Return type mismatch sound-id vs none. -(defmethod projectile-method-24 ram-boss-proj ((obj ram-boss-proj)) +(defmethod projectile-method-24 ram-boss-proj ((this ram-boss-proj)) (with-pp (quaternion-rotate-local-x! - (-> obj root-override quat) - (-> obj root-override quat) - (* 65718.05 (-> *display* seconds-per-frame)) + (-> this root-override quat) + (-> this root-override quat) + (* 65718.05 (seconds-per-frame)) ) (quaternion-rotate-local-y! - (-> obj root-override quat) - (-> obj root-override quat) - (* 32221.867 (-> *display* seconds-per-frame)) + (-> this root-override quat) + (-> this root-override quat) + (* 32221.867 (seconds-per-frame)) ) - (let ((f0-9 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (-> *display* base-frame-counter) 75))))))))) + (let ((f0-9 (* 5120.0 (+ 0.9 (* 0.1 (cos (* 873.81335 (the float (mod (current-time) 75))))))))) (find-ground-and-draw-shadow - (-> obj root-override trans) + (-> this root-override trans) (the-as vector #f) f0-9 (collide-kind background) @@ -526,13 +526,13 @@ 81920.0 ) ) - (if (-> obj launched?) - (spawn (-> obj part2) (the-as vector (-> obj root-override root-prim prim-core))) + (if (-> this launched?) + (spawn (-> this part2) (the-as vector (-> this root-override root-prim prim-core))) ) (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) - (set! (-> s5-0 id) (-> obj sound-id)) - (let ((a1-4 (-> obj root-override trans))) + (set! (-> s5-0 id) (-> this sound-id)) + (let ((a1-4 (-> this root-override trans))) (let ((gp-1 pp)) (when (= a1-4 #t) (if (and gp-1 (type-type? (-> gp-1 type) process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) @@ -569,7 +569,7 @@ s3-2 s5-0 s4-0 - (* (-> arg0 max-turn) (-> *display* seconds-per-frame)) + (* (-> arg0 max-turn) (seconds-per-frame)) (-> arg0 tween) ) (vector-matrix*! s5-0 s5-0 s3-2) @@ -584,7 +584,7 @@ ;; definition for method 25 of type ram-boss-proj ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-25 ram-boss-proj ((obj ram-boss-proj)) +(defmethod projectile-method-25 ram-boss-proj ((this ram-boss-proj)) (go ram-boss-proj-growing) 0 (none) @@ -592,8 +592,8 @@ ;; definition for method 26 of type ram-boss-proj ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-26 ram-boss-proj ((obj ram-boss-proj)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod projectile-method-26 ram-boss-proj ((this ram-boss-proj)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-collision-reaction) (set! (-> s5-0 no-reaction) @@ -612,7 +612,7 @@ (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -620,21 +620,21 @@ ;; definition for method 27 of type ram-boss-proj ;; INFO: Return type mismatch int vs none. -(defmethod projectile-method-27 ram-boss-proj ((obj ram-boss-proj)) - (set! (-> obj charge-sound-id) (new 'static 'sound-id)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 521) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 522) obj)) - (set! (-> obj launched?) #f) - (set! (-> obj growth) 0.0) - (set! (-> obj max-speed) 40960.0) - (set! (-> obj update-velocity) snow-ram-proj-update-velocity) - (set! (-> obj max-turn) 11832.889) - (set! (-> obj tween) 0.02) - (set! (-> obj attack-mode) 'snow-ram-proj) - (set! (-> obj launch-time) (-> *display* base-frame-counter)) - (set! (-> obj timeout) (seconds 4)) - (set! (-> obj sound-id) (sound-play "ramboss-track")) - (let ((v1-12 (-> obj parent-override))) +(defmethod projectile-method-27 ram-boss-proj ((this ram-boss-proj)) + (set! (-> this charge-sound-id) (new 'static 'sound-id)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 521) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 522) this)) + (set! (-> this launched?) #f) + (set! (-> this growth) 0.0) + (set! (-> this max-speed) 40960.0) + (set! (-> this update-velocity) snow-ram-proj-update-velocity) + (set! (-> this max-turn) 11832.889) + (set! (-> this tween) 0.02) + (set! (-> this attack-mode) 'snow-ram-proj) + (set-time! (-> this launch-time)) + (set! (-> this timeout) (seconds 4)) + (set! (-> this sound-id) (sound-play "ramboss-track")) + (let ((v1-12 (-> this parent-override))) (set! (-> v1-12 0 proj-stoked) #t) (set! (-> v1-12 0 proj-status) (the-as uint 1)) ) @@ -642,37 +642,37 @@ ) ;; definition for method 10 of type ram-boss-proj -(defmethod deactivate ram-boss-proj ((obj ram-boss-proj)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate ram-boss-proj ((this ram-boss-proj)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type projectile deactivate) obj) + ((method-of-type projectile deactivate) this) (none) ) ;; definition for method 7 of type ram-boss-proj ;; INFO: Return type mismatch projectile vs ram-boss-proj. -(defmethod relocate ram-boss-proj ((obj ram-boss-proj) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate ram-boss-proj ((this ram-boss-proj) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as ram-boss-proj ((method-of-type projectile relocate) obj arg0)) + (the-as ram-boss-proj ((method-of-type projectile relocate) this arg0)) ) ;; definition for method 28 of type ram-boss-proj ;; INFO: Used lq/sq ;; INFO: Return type mismatch vector vs none. -(defmethod projectile-method-28 ram-boss-proj ((obj ram-boss-proj)) +(defmethod projectile-method-28 ram-boss-proj ((this ram-boss-proj)) (when (and *target* (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) ) - (let ((gp-0 (-> obj target))) + (let ((gp-0 (-> this target))) (set! (-> gp-0 quad) (-> (target-pos 0) quad)) (+! (-> gp-0 y) 4915.2) - (let ((f0-2 (vector-vector-distance gp-0 (-> obj root-override trans))) + (let ((f0-2 (vector-vector-distance gp-0 (-> this root-override trans))) (a2-0 (new 'stack-no-clear 'vector)) ) (if (>= 0.0 f0-2) @@ -680,8 +680,8 @@ ) (set! (-> a2-0 quad) (-> *target* control transv quad)) (set! (-> a2-0 y) 0.0) - (let ((f0-3 (/ f0-2 (* 40960.0 (-> *display* seconds-per-frame))))) - (vector+float*! gp-0 gp-0 a2-0 (* f0-3 (-> *display* seconds-per-frame))) + (let ((f0-3 (/ f0-2 (* 40960.0 (seconds-per-frame))))) + (vector+float*! gp-0 gp-0 a2-0 (* f0-3 (seconds-per-frame))) ) ) ) @@ -718,9 +718,7 @@ (cond ((-> gp-1 0 proj-stoked) (set! (-> gp-1 0 proj-stoked) #f) - (set! (-> self growth) - (seek-with-smooth (-> self growth) 1.0 (* 1.25 (-> *display* seconds-per-frame)) 0.8 0.01) - ) + (set! (-> self growth) (seek-with-smooth (-> self growth) 1.0 (* 1.25 (seconds-per-frame)) 0.8 0.01)) (if (>= (-> self growth) 1.0) (set! (-> gp-1 0 proj-status) (the-as uint 2)) (set! (-> gp-1 0 proj-status) (the-as uint 1)) @@ -751,7 +749,7 @@ (set! (-> self launched?) #t) (set! (-> self growth) 1.0) (logior! (-> self root-override root-prim prim-core action) (collide-action solid)) - (set! (-> self launch-time) (-> *display* base-frame-counter)) + (set-time! (-> self launch-time)) (vector-float*! (-> self root-override transv) (-> self parent-override 0 proj-launch-vec) 40960.0) (set! (-> self target quad) (-> (target-pos 0) quad)) (+! (-> self target y) 4915.2) @@ -1022,7 +1020,7 @@ ) ) ((= (-> arg3 param 0) 'die) - (let* ((v1-73 (- (-> *display* base-frame-counter) (-> (the-as ram-boss-proj v1-66) launch-time))) + (let* ((v1-73 (- (current-time) (-> (the-as ram-boss-proj v1-66) launch-time))) (v1-74 (the-as int (- (seconds 4) v1-73))) ) (cond @@ -1049,30 +1047,30 @@ ) ;; definition for method 10 of type ram-boss -(defmethod deactivate ram-boss ((obj ram-boss)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate ram-boss ((this ram-boss)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type nav-enemy deactivate) obj) + ((method-of-type nav-enemy deactivate) this) (none) ) ;; definition for method 7 of type ram-boss ;; INFO: Return type mismatch nav-enemy vs ram-boss. -(defmethod relocate ram-boss ((obj ram-boss) (arg0 int)) - (if (nonzero? (-> obj shield-jmod)) - (&+! (-> obj shield-jmod) arg0) +(defmethod relocate ram-boss ((this ram-boss) (arg0 int)) + (if (nonzero? (-> this shield-jmod)) + (&+! (-> this shield-jmod) arg0) ) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as ram-boss ((method-of-type nav-enemy relocate) obj arg0)) + (the-as ram-boss ((method-of-type nav-enemy relocate) this arg0)) ) ;; definition for method 47 of type ram-boss ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision ram-boss ((obj ram-boss)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision ram-boss ((this ram-boss)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1118,7 +1116,7 @@ (set! (-> s5-0 nav-radius) 10240.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -1126,8 +1124,8 @@ ;; definition for method 52 of type ram-boss ;; INFO: Return type mismatch vector vs symbol. -(defmethod ram-boss-method-52 ram-boss ((obj ram-boss)) - (let ((v1-1 (the-as basic (-> obj collide-info root-prim)))) +(defmethod ram-boss-method-52 ram-boss ((this ram-boss)) + (let ((v1-1 (the-as basic (-> this collide-info root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-1) local-sphere) 0.0 8192.0 0.0 13516.8) (set-vector! (-> (the-as (array collide-shape-prim) v1-1) 16 local-sphere) 0.0 4096.0 0.0 4505.6) (set-vector! (-> (the-as (array collide-shape-prim) v1-1) 17 local-sphere) 0.0 9830.4 0.0 4505.6) @@ -1149,8 +1147,8 @@ ;; definition for method 53 of type ram-boss ;; INFO: Return type mismatch int vs symbol. -(defmethod nav-enemy-method-53 ram-boss ((obj ram-boss)) - (let ((v1-1 (the-as (array collide-shape-prim) (-> obj collide-info root-prim)))) +(defmethod nav-enemy-method-53 ram-boss ((this ram-boss)) + (let ((v1-1 (the-as (array collide-shape-prim) (-> this collide-info root-prim)))) (let ((a0-1 (-> v1-1 16))) (set! (-> a0-1 prim-core offense) (collide-offense touch)) ) @@ -1173,27 +1171,27 @@ ;; definition for method 48 of type ram-boss ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 ram-boss ((obj ram-boss)) - (initialize-skeleton obj *ram-boss-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (init-defaults! obj *ram-boss-nav-enemy-info*) - (logclear! (-> obj enemy-info options) (fact-options has-power-cell)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 525) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 574) obj)) - (set! (-> obj shield-jmod) (new 'process 'joint-mod-set-local obj 32 #f #f #t)) - (set! (-> obj shield-jmod enable) #f) - (set! (-> obj has-shield?) #t) - (when (nonzero? (-> obj entity extra perm user-int8 1)) - (set! (-> obj has-shield?) #f) - (init-jm! obj *ram-boss-nav-enemy-info-no-shield*) - (let ((v1-23 (-> obj shield-jmod))) +(defmethod nav-enemy-method-48 ram-boss ((this ram-boss)) + (initialize-skeleton this *ram-boss-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (init-defaults! this *ram-boss-nav-enemy-info*) + (logclear! (-> this enemy-info options) (fact-options has-power-cell)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 525) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 574) this)) + (set! (-> this shield-jmod) (new 'process 'joint-mod-set-local this 32 #f #f #t)) + (set! (-> this shield-jmod enable) #f) + (set! (-> this has-shield?) #t) + (when (nonzero? (-> this entity extra perm user-int8 1)) + (set! (-> this has-shield?) #f) + (init-jm! this *ram-boss-nav-enemy-info-no-shield*) + (let ((v1-23 (-> this shield-jmod))) (set! (-> v1-23 enable) #t) (set! (-> v1-23 transform scale quad) (the-as uint128 0)) ) ) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) 0 (none) ) @@ -1205,7 +1203,7 @@ (set! (-> self dead?) #f) (set! (-> self proj-status) (the-as uint 0)) (set! (-> self proj-stoked) #f) - (set! (-> self proj-last-thrown-time) (-> *display* base-frame-counter)) + (set-time! (-> self proj-last-thrown-time)) (set-vector! (-> self local-throw-point) 10456.269 9961.882 1510.6049 1.0) (set! (-> self frustration) 0) (set! (-> self nav-enemy-patrol-timeout) (seconds 1)) @@ -1234,8 +1232,8 @@ ;; definition for method 54 of type ram-boss ;; INFO: Return type mismatch vector vs symbol. -(defmethod nav-enemy-method-54 ram-boss ((obj ram-boss) (arg0 vector)) - (let ((a2-0 (-> obj node-list data 18 bone transform))) +(defmethod nav-enemy-method-54 ram-boss ((this ram-boss) (arg0 vector)) + (let ((a2-0 (-> this node-list data 18 bone transform))) (set-vector! arg0 0.0 0.0 -2457.6 1.0) (vector-matrix*! arg0 arg0 a2-0) ) @@ -1244,14 +1242,14 @@ ;; definition for method 55 of type ram-boss ;; INFO: Used lq/sq -(defmethod nav-enemy-method-55 ram-boss ((obj ram-boss)) +(defmethod nav-enemy-method-55 ram-boss ((this ram-boss)) (if (not *target*) (return #f) ) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> obj collide-info trans quad)) + (set! (-> s5-0 quad) (-> this collide-info trans quad)) (+! (-> s5-0 y) 8192.0) (set! (-> s4-0 quad) (-> (target-pos 0) quad)) (+! (-> s4-0 y) 4915.2) @@ -1263,7 +1261,7 @@ s4-0 1228.8 (collide-kind background cak-2 ground-object) - obj + this t2-0 (new 'static 'pat-surface :noentity #x1) ) @@ -1281,8 +1279,8 @@ ) ;; definition for method 51 of type ram-boss -(defmethod ram-boss-method-51 ram-boss ((obj ram-boss) (arg0 vector)) - (let* ((f30-0 (quaternion-y-angle (-> obj collide-info quat))) +(defmethod ram-boss-method-51 ram-boss ((this ram-boss) (arg0 vector)) + (let* ((f30-0 (quaternion-y-angle (-> this collide-info quat))) (f0-2 (atan (-> arg0 x) (-> arg0 z))) (f0-3 (deg- f30-0 f0-2)) ) @@ -1299,34 +1297,34 @@ ;; definition for method 56 of type ram-boss ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod set-jump-height-factor! ram-boss ((obj ram-boss) (arg0 int)) +(defmethod set-jump-height-factor! ram-boss ((this ram-boss) (arg0 int)) (cond - ((zero? (-> obj proj-status)) - (when (and *target* (>= (- (-> *display* base-frame-counter) (-> obj proj-last-thrown-time)) (seconds 2))) + ((zero? (-> this proj-status)) + (when (and *target* (time-elapsed? (-> this proj-last-thrown-time) (seconds 2))) (when arg0 - (set! (-> obj proj-stoked) #t) + (set! (-> this proj-stoked) #t) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (the-as uint128 0)) (let ((v1-9 (process-spawn ram-boss-proj :init projectile-init-by-other - (-> obj entity) - (-> obj collide-info trans) + (-> this entity) + (-> this collide-info trans) s5-0 0 (process->handle *target*) - :to obj + :to this ) ) ) - (set! (-> (the-as (pointer ram-boss-proj) v1-9) 0 notify-handle) (process->handle obj)) + (set! (-> (the-as (pointer ram-boss-proj) v1-9) 0 notify-handle) (process->handle this)) ) ) ) ) ) (else - (set! (-> obj proj-stoked) #t) + (set! (-> this proj-stoked) #t) ) ) (none) @@ -1425,7 +1423,7 @@ (set! (-> self collide-info transv y) 102400.0) ) :trans (behavior () - (+! (-> self collide-info transv y) (* -544768.0 (-> *display* seconds-per-frame))) + (+! (-> self collide-info transv y) (* -544768.0 (seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self collide-info) (-> self collide-info transv) @@ -1577,7 +1575,7 @@ (if (>= 18432.0 f30-0) (go ram-boss-tracking) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (not (target-in-range? self (-> self nav-info stop-chase-distance))) (go-virtual nav-enemy-patrol) ) @@ -1588,12 +1586,12 @@ ) (cond ((logtest? (nav-control-flags navcf17) (-> self nav flags)) - (if (>= (- (-> *display* base-frame-counter) (-> self free-time)) (seconds 1)) + (if (time-elapsed? (-> self free-time) (seconds 1)) (go-virtual nav-enemy-patrol) ) ) (else - (set! (-> self free-time) (-> *display* base-frame-counter)) + (set-time! (-> self free-time)) ) ) 0 @@ -1611,11 +1609,11 @@ ) ;; definition for method 57 of type ram-boss -(defmethod ram-boss-method-57 ram-boss ((obj ram-boss) (arg0 float)) +(defmethod ram-boss-method-57 ram-boss ((this ram-boss) (arg0 float)) (let ((f0-0 0.0)) (when *target* (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s3-0 (target-pos 0) (-> obj collide-info trans)) + (vector-! s3-0 (target-pos 0) (-> this collide-info trans)) (let ((f0-1 (vector-x-angle s3-0))) (set! f0-0 (* 0.000091552734 f0-1)) ) @@ -1640,15 +1638,12 @@ (defstate ram-boss-tracking (ram-boss) :event ram-boss-on-ground-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self facing-y) (quaternion-y-angle (-> self collide-info quat))) (logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2)) ) :trans (behavior () - (set-jump-height-factor! - self - (the-as int (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.75))) - ) + (set-jump-height-factor! self (the-as int (time-elapsed? (-> self state-time) (seconds 0.75)))) (if (not *target*) (go-virtual nav-enemy-patrol) ) @@ -1662,7 +1657,7 @@ ) ) (f30-0 (-> self facing-y)) - (f0-6 (deg-seek-smooth f30-0 (-> self player-dir-y) (* v1-13 (-> *display* seconds-per-frame)) 0.25)) + (f0-6 (deg-seek-smooth f30-0 (-> self player-dir-y) (* v1-13 (seconds-per-frame)) 0.25)) (f0-7 (deg- f0-6 f30-0)) ) (cond @@ -1701,7 +1696,7 @@ (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (time-elapsed? (-> self state-time) (seconds 0.2)) ) (let ((gp-2 (new 'stack-no-clear 'vector)) (s5-2 (new 'stack-no-clear 'vector)) @@ -1862,7 +1857,7 @@ (set! gp-0 (-> gp-0 0 brother)) ) ) - (set! (-> self proj-last-thrown-time) (-> *display* base-frame-counter)) + (set-time! (-> self proj-last-thrown-time)) ) :trans (behavior () (set-jump-height-factor! self (the-as int #t)) diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ram-h_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ram-h_REF.gc index fd00bfe813..04c62789d4 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ram-h_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ram-h_REF.gc @@ -28,17 +28,17 @@ ) ;; definition for method 3 of type ram -(defmethod inspect ram ((obj ram)) +(defmethod inspect ram ((this ram)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tram-id: ~D~%" (-> obj ram-id)) - (format #t "~T~Tgive-fuel-cell?: ~A~%" (-> obj give-fuel-cell?)) - (format #t "~T~Tgive-fuel-cell-anim: ~A~%" (-> obj give-fuel-cell-anim)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Torient-ry: ~f~%" (-> obj orient-ry)) - (format #t "~T~Tfuel-cell-dest-pos: #~%" (-> obj fuel-cell-dest-pos)) - obj + (format #t "~T~Tram-id: ~D~%" (-> this ram-id)) + (format #t "~T~Tgive-fuel-cell?: ~A~%" (-> this give-fuel-cell?)) + (format #t "~T~Tgive-fuel-cell-anim: ~A~%" (-> this give-fuel-cell-anim)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Torient-ry: ~f~%" (-> this orient-ry)) + (format #t "~T~Tfuel-cell-dest-pos: #~%" (-> this fuel-cell-dest-pos)) + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc b/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc index b853f2868b..9b6d57887f 100644 --- a/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/snow-ram_REF.gc @@ -109,15 +109,15 @@ ) ;; definition for method 20 of type ram -(defmethod ram-method-20 ram ((obj ram)) - (let ((gp-0 (-> obj part))) +(defmethod ram-method-20 ram ((this ram)) + (let ((gp-0 (-> this part))) (when (nonzero? gp-0) - (let ((a2-0 (-> obj node-list data 8 bone transform)) + (let ((a2-0 (-> this node-list data 8 bone transform)) (s5-0 (new 'stack-no-clear 'vector)) ) (set-vector! s5-0 0.0 0.0 -49152.0 1.0) (vector-matrix*! s5-0 s5-0 a2-0) - (set! (-> *part-id-table* 1920 init-specs 16 initial-valuef) (+ 16384.0 (-> obj orient-ry))) + (set! (-> *part-id-table* 1920 init-specs 16 initial-valuef) (+ 16384.0 (-> this orient-ry))) (spawn gp-0 s5-0) ) ) @@ -125,31 +125,31 @@ ) ;; definition for method 21 of type ram -(defmethod ram-method-21 ram ((obj ram)) - (let ((gp-0 (-> obj part2))) +(defmethod ram-method-21 ram ((this ram)) + (let ((gp-0 (-> this part2))) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s3-0 (-> obj node-list data 5)) + (vector<-cspace! s3-0 (-> this node-list data 5)) (set-vector! s4-0 13312.0 -5324.8 0.0 1.0) - (vector-rotate-around-y! s4-0 s4-0 (-> obj orient-ry)) + (vector-rotate-around-y! s4-0 s4-0 (-> this orient-ry)) (vector+! s4-0 s4-0 s3-0) (spawn gp-0 s4-0) (set-vector! s4-0 -13312.0 -5324.8 0.0 1.0) - (vector-rotate-around-y! s4-0 s4-0 (-> obj orient-ry)) + (vector-rotate-around-y! s4-0 s4-0 (-> this orient-ry)) (vector+! s4-0 s4-0 s3-0) (spawn gp-0 s4-0) ) (let ((s3-1 (new 'stack-no-clear 'vector)) (s4-1 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s3-1 (-> obj node-list data 6)) + (vector<-cspace! s3-1 (-> this node-list data 6)) (set-vector! s4-1 13312.0 -5324.8 0.0 1.0) - (vector-rotate-around-y! s4-1 s4-1 (-> obj orient-ry)) + (vector-rotate-around-y! s4-1 s4-1 (-> this orient-ry)) (vector+! s4-1 s4-1 s3-1) (spawn gp-0 s4-1) (set-vector! s4-1 -13312.0 -5324.8 0.0 1.0) - (vector-rotate-around-y! s4-1 s4-1 (-> obj orient-ry)) + (vector-rotate-around-y! s4-1 s4-1 (-> this orient-ry)) (vector+! s4-1 s4-1 s3-1) (spawn gp-0 s4-1) ) @@ -157,16 +157,16 @@ ) ;; definition for method 22 of type ram -(defmethod ram-method-22 ram ((obj ram)) - (process-entity-status! obj (entity-perm-status complete) #t) - (let ((v1-0 (alt-actor-list-subtask-incomplete-count obj))) +(defmethod ram-method-22 ram ((this ram)) + (process-entity-status! this (entity-perm-status complete) #t) + (let ((v1-0 (alt-actor-list-subtask-incomplete-count this))) (cond ((zero? v1-0) - (let ((v1-3 (-> obj entity extra perm))) + (let ((v1-3 (-> this entity extra perm))) (logior! (-> v1-3 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-3 user-int8 2) 1) ) - (if (not (task-complete? *game-info* (-> obj entity extra perm task))) + (if (not (task-complete? *game-info* (-> this entity extra perm task))) (return #t) ) ) @@ -333,29 +333,29 @@ ) ;; definition for method 10 of type ram -(defmethod deactivate ram ((obj ram)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate ram ((this ram)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type ram ;; INFO: Return type mismatch process-drawable vs ram. -(defmethod relocate ram ((obj ram) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate ram ((this ram) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as ram ((method-of-type process-drawable relocate) obj arg0)) + (the-as ram ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type ram ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ram ((obj ram) (arg0 entity-actor)) - (set! (-> obj give-fuel-cell?) #f) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! ram ((this ram) (arg0 entity-actor)) + (set! (-> this give-fuel-cell?) #f) + (set! (-> this link) (new 'process 'actor-link-info this)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -397,58 +397,58 @@ ) (set! (-> s4-0 nav-radius) 20480.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ram-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ram-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-post) - (update-transforms! (-> obj root-override)) - (set! (-> obj orient-ry) (quaternion-y-angle (-> obj root-override quat))) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 526) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 527) obj)) - (set! (-> obj ram-id) (res-lump-value arg0 'extra-id int)) - (case (-> obj ram-id) + (update-transforms! (-> this root-override)) + (set! (-> this orient-ry) (quaternion-y-angle (-> this root-override quat))) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 526) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 527) this)) + (set! (-> this ram-id) (res-lump-value arg0 'extra-id int)) + (case (-> this ram-id) ((1) - (set! (-> obj give-fuel-cell-anim) + (set! (-> this give-fuel-cell-anim) (new 'static 'spool-anim :name "snowcam-ram-boss-in-cave-fuel-cell" :index 7 :parts 1 :command-list '()) ) - (set-vector! (-> obj fuel-cell-dest-pos) 3137396.8 803676.2 -13560558.0 1.0) + (set-vector! (-> this fuel-cell-dest-pos) 3137396.8 803676.2 -13560558.0 1.0) ) ((2) - (set! (-> obj give-fuel-cell-anim) + (set! (-> this give-fuel-cell-anim) (new 'static 'spool-anim :name "snowcam-ram-boss-ice-pond-fuel-cell" :index 8 :parts 1 :command-list '()) ) - (set-vector! (-> obj fuel-cell-dest-pos) 2790289.5 1058152.5 -13639766.0 1.0) + (set-vector! (-> this fuel-cell-dest-pos) 2790289.5 1058152.5 -13639766.0 1.0) ) ((3) - (set! (-> obj give-fuel-cell-anim) + (set! (-> this give-fuel-cell-anim) (new 'static 'spool-anim :name "snowcam-ram-boss-snow-ball-fuel-cell" :index 9 :parts 1 :command-list '()) ) - (set-vector! (-> obj fuel-cell-dest-pos) 4208423.0 1037348.9 -13591491.0 1.0) + (set-vector! (-> this fuel-cell-dest-pos) 4208423.0 1037348.9 -13591491.0 1.0) ) (else - (set! (-> obj give-fuel-cell-anim) #f) + (set! (-> this give-fuel-cell-anim) #f) ) ) (let ((s4-1 #f)) - (if (nonzero? (-> obj entity extra perm user-int8 0)) + (if (nonzero? (-> this entity extra perm user-int8 0)) (set! s4-1 #t) ) (let ((s3-1 (= (res-lump-value arg0 'mode uint128) 1))) (when (not s3-1) - (when (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (set! s3-1 #t) - (if (and (nonzero? (-> obj entity extra perm user-int8 2)) - (not (task-complete? *game-info* (-> obj entity extra perm task))) + (if (and (nonzero? (-> this entity extra perm user-int8 2)) + (not (task-complete? *game-info* (-> this entity extra perm task))) ) (birth-pickup-at-point - (-> obj fuel-cell-dest-pos) + (-> this fuel-cell-dest-pos) (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) + (the float (-> this entity extra perm task)) #f - obj + this (the-as fact-info #f) ) ) @@ -459,11 +459,11 @@ ((and (not s3-1) (has-nav-mesh? arg0)) (cond (s4-1 - (process-spawn ram-boss (-> obj entity) obj #t :to obj) + (process-spawn ram-boss (-> this entity) this #t :to this) (go ram-fun-idle) ) (else - (process-spawn ram-boss (-> obj entity) obj #f :to obj) + (process-spawn ram-boss (-> this entity) this #f :to this) (go ram-idle) ) ) diff --git a/test/decompiler/reference/jak1/levels/snow/target-ice_REF.gc b/test/decompiler/reference/jak1/levels/snow/target-ice_REF.gc index e59935bc3a..c5947e47bd 100644 --- a/test/decompiler/reference/jak1/levels/snow/target-ice_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/target-ice_REF.gc @@ -107,7 +107,7 @@ :frame-num 0.0 ) (until (ja-done? 0) - (seek! (-> self control unknown-float81) 0.0 (-> *display* seconds-per-frame)) + (seek! (-> self control unknown-float81) 0.0 (seconds-per-frame)) (suspend) (ja :num! (seek!)) ) @@ -158,7 +158,7 @@ (defstate target-ice-walk (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self control unknown-surface00) *walk-mods*) ) :exit (behavior () @@ -178,7 +178,7 @@ ) (pad-buttons l1 r1) ) - (and (>= (- (-> *display* base-frame-counter) (-> *TARGET-bank* wheel-timeout)) (-> self control unknown-dword30)) + (and (time-elapsed? (-> *TARGET-bank* wheel-timeout) (-> self control unknown-dword30)) (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?)) ) ) diff --git a/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc b/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc index 868306e265..631f19f6aa 100644 --- a/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/target-snowball_REF.gc @@ -11,10 +11,10 @@ ) ;; definition for method 3 of type snowball-info -(defmethod inspect snowball-info ((obj snowball-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - obj +(defmethod inspect snowball-info ((this snowball-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tentity: ~A~%" (-> this entity)) + this ) ;; definition of type snowball-bank @@ -26,9 +26,9 @@ ) ;; definition for method 3 of type snowball-bank -(defmethod inspect snowball-bank ((obj snowball-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - obj +(defmethod inspect snowball-bank ((this snowball-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + this ) ;; definition for symbol *SNOWBALL-bank*, type snowball-bank diff --git a/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc b/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc index 7b8c50be67..382c0aae6c 100644 --- a/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc +++ b/test/decompiler/reference/jak1/levels/snow/yeti_REF.gc @@ -18,13 +18,13 @@ ) ;; definition for method 3 of type yeti-slave -(defmethod inspect yeti-slave ((obj yeti-slave)) +(defmethod inspect yeti-slave ((this yeti-slave)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tground-y: ~f~%" (-> obj ground-y)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - obj + (format #t "~T~Tground-y: ~f~%" (-> this ground-y)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + this ) ;; definition of type yeti @@ -53,15 +53,15 @@ ) ;; definition for method 3 of type yeti -(defmethod inspect yeti ((obj yeti)) +(defmethod inspect yeti ((this yeti)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdesired-num-children: ~D~%" (-> obj desired-num-children)) - (format #t "~T~Tspawn-delay: ~D~%" (-> obj spawn-delay)) - (format #t "~T~Tfirst-time-spawn-dist: ~f~%" (-> obj first-time-spawn-dist)) - (format #t "~T~Tstate-time: ~D~%" (-> obj state-time)) - obj + (format #t "~T~Tdesired-num-children: ~D~%" (-> this desired-num-children)) + (format #t "~T~Tspawn-delay: ~D~%" (-> this spawn-delay)) + (format #t "~T~Tfirst-time-spawn-dist: ~f~%" (-> this first-time-spawn-dist)) + (format #t "~T~Tstate-time: ~D~%" (-> this state-time)) + this ) ;; failed to figure out what this is: @@ -238,7 +238,7 @@ :event yeti-slave-default-event-handler :enter (behavior () (nav-enemy-neck-control-inactive) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (-> self nav-info move-to-ground) (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) ) @@ -502,8 +502,8 @@ ;; definition for method 47 of type yeti-slave ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision yeti-slave ((obj yeti-slave)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision yeti-slave ((this yeti-slave)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -543,7 +543,7 @@ (set! (-> s5-0 nav-radius) 6144.0) (backup-collide-with-as s5-0) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -551,33 +551,33 @@ ;; definition for method 48 of type yeti-slave ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 yeti-slave ((obj yeti-slave)) - (initialize-skeleton obj *yeti-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (init-defaults! obj *yeti-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 0)) - (set! (-> obj neck nose) (the-as uint 1)) - (set! (-> obj neck ear) (the-as uint 2)) +(defmethod nav-enemy-method-48 yeti-slave ((this yeti-slave)) + (initialize-skeleton this *yeti-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (init-defaults! this *yeti-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 0)) + (set! (-> this neck nose) (the-as uint 1)) + (set! (-> this neck ear) (the-as uint 2)) 0 (none) ) ;; definition for method 10 of type yeti-slave -(defmethod deactivate yeti-slave ((obj yeti-slave)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate yeti-slave ((this yeti-slave)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type yeti-slave ;; INFO: Return type mismatch nav-enemy vs yeti-slave. -(defmethod relocate yeti-slave ((obj yeti-slave) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(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)) obj arg0)) + (the-as yeti-slave ((the-as (function nav-enemy int nav-enemy) (find-parent-method yeti-slave 7)) this arg0)) ) ;; definition for function yeti-slave-init-by-other @@ -600,8 +600,8 @@ ) ;; definition for method 21 of type yeti -(defmethod aggro? yeti ((obj yeti) (arg0 vector)) - (let ((s5-0 (the-as (pointer process-tree) (-> obj child-process)))) +(defmethod aggro? yeti ((this yeti) (arg0 vector)) + (let ((s5-0 (the-as (pointer process-tree) (-> this child-process)))) (while s5-0 (if (< (vector-vector-xz-distance-squared arg0 (-> (the-as (pointer yeti-slave) s5-0) 0 collide-info trans)) 603979800.0 @@ -620,8 +620,8 @@ ) ;; definition for method 20 of type yeti -(defmethod yeti-method-20 yeti ((obj yeti) (arg0 vector) (arg1 vector)) - (let ((s3-0 (-> obj path curve num-cverts))) +(defmethod yeti-method-20 yeti ((this yeti) (arg0 vector) (arg1 vector)) + (let ((s3-0 (-> this path curve num-cverts))) (if (<= s3-0 0) (return #f) ) @@ -629,8 +629,8 @@ (s2-0 s3-0) ) (while (> s2-0 0) - (eval-path-curve-div! (-> obj path) arg0 (the float s1-0) 'interp) - (when (aggro? obj arg0) + (eval-path-curve-div! (-> this path) arg0 (the float s1-0) 'interp) + (when (aggro? this arg0) (cond (*target* (vector-! arg1 (target-pos 0) arg0) @@ -712,12 +712,12 @@ ) (when (< v1-1 (-> self desired-num-children)) (set! (-> self spawn-delay) (rand-vu-int-range 150 1200)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) ) ) (else - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self spawn-delay)) + (when (time-elapsed? (-> self state-time) (-> self spawn-delay)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -737,16 +737,16 @@ ;; definition for method 11 of type yeti ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! yeti ((obj yeti) (arg0 entity-actor)) - (set! (-> obj spawn-delay) 0) - (set! (-> obj root) (new 'process 'trsqv)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj desired-num-children) - (res-lump-value arg0 'num-lurkers int :default (the-as uint128 (-> obj path curve num-cverts))) +(defmethod init-from-entity! yeti ((this yeti) (arg0 entity-actor)) + (set! (-> this spawn-delay) 0) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (process-drawable-from-entity! this arg0) + (set! (-> this desired-num-children) + (res-lump-value arg0 'num-lurkers int :default (the-as uint128 (-> this path curve num-cverts))) ) - (set! (-> obj first-time-spawn-dist) (res-lump-float arg0 'notice-dist :default 204800.0)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this first-time-spawn-dist) (res-lump-float arg0 'notice-dist :default 204800.0)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) (go yeti-resuming-start) (go yeti-first-time-start) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc b/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc index 01bee5ac4a..41792faa3e 100644 --- a/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/bully_REF.gc @@ -15,11 +15,11 @@ ) ;; definition for method 3 of type bully-broken-cage -(defmethod inspect bully-broken-cage ((obj bully-broken-cage)) +(defmethod inspect bully-broken-cage ((this bully-broken-cage)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type bully @@ -57,24 +57,24 @@ ) ;; definition for method 3 of type bully -(defmethod inspect bully ((obj bully)) +(defmethod inspect bully ((this bully)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Thit-player?: ~A~%" (-> obj hit-player?)) - (format #t "~T~Tbounced?: ~A~%" (-> obj bounced?)) - (format #t "~T~Tbounce-volume: ~D~%" (-> obj bounce-volume)) - (format #t "~T~Tfacing-ry: ~f~%" (-> obj facing-ry)) - (format #t "~T~Ttravel-ry: ~f~%" (-> obj travel-ry)) - (format #t "~T~Tspeed-u: ~f~%" (-> obj speed-u)) - (format #t "~T~Tspin-vel: ~f~%" (-> obj spin-vel)) - (format #t "~T~Ttravel-speed: ~f~%" (-> obj travel-speed)) - (format #t "~T~Treaction-delay: ~D~%" (-> obj reaction-delay)) - (format #t "~T~Tstart-spin-time: ~D~%" (-> obj start-spin-time)) - (format #t "~T~Tslow-down: ~D~%" (-> obj slow-down)) - (format #t "~T~Thit-player-time: ~D~%" (-> obj hit-player-time)) - (format #t "~T~Tneck: ~A~%" (-> obj neck)) - obj + (format #t "~T~Thit-player?: ~A~%" (-> this hit-player?)) + (format #t "~T~Tbounced?: ~A~%" (-> this bounced?)) + (format #t "~T~Tbounce-volume: ~D~%" (-> this bounce-volume)) + (format #t "~T~Tfacing-ry: ~f~%" (-> this facing-ry)) + (format #t "~T~Ttravel-ry: ~f~%" (-> this travel-ry)) + (format #t "~T~Tspeed-u: ~f~%" (-> this speed-u)) + (format #t "~T~Tspin-vel: ~f~%" (-> this spin-vel)) + (format #t "~T~Ttravel-speed: ~f~%" (-> this travel-speed)) + (format #t "~T~Treaction-delay: ~D~%" (-> this reaction-delay)) + (format #t "~T~Tstart-spin-time: ~D~%" (-> this start-spin-time)) + (format #t "~T~Tslow-down: ~D~%" (-> this slow-down)) + (format #t "~T~Thit-player-time: ~D~%" (-> this hit-player-time)) + (format #t "~T~Tneck: ~A~%" (-> this neck)) + this ) ;; failed to figure out what this is: @@ -357,7 +357,7 @@ (set! (-> self hit-player?) #t) (set! (-> self bounced?) #t) (set! (-> self bounce-volume) 100) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-time! (-> self hit-player-time)) (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) ) ) @@ -404,7 +404,7 @@ (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + (time-elapsed? (-> self hit-player-time) (seconds 0.05)) ) ) ) @@ -417,7 +417,7 @@ ;; definition for method 20 of type bully ;; INFO: Used lq/sq -(defmethod bully-method-20 bully ((obj bully)) +(defmethod bully-method-20 bully ((this bully)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -425,17 +425,17 @@ ) (init-vf0-vector) (set-vector! - (-> obj root-override transv) - (* (sin (-> obj travel-ry)) (-> obj travel-speed)) + (-> this root-override transv) + (* (sin (-> this travel-ry)) (-> this travel-speed)) 0.0 - (* (cos (-> obj travel-ry)) (-> obj travel-speed)) + (* (cos (-> this travel-ry)) (-> this travel-speed)) 1.0 ) (let ((s5-1 #f)) - (nav-control-method-28 (-> obj nav) (collide-kind wall-object ground-object)) - (let ((v1-4 (-> obj nav travel))) - (.lvf vf1 (&-> (-> obj root-override transv) quad)) - (let ((f0-8 (-> *display* seconds-per-frame))) + (nav-control-method-28 (-> this nav) (collide-kind wall-object ground-object)) + (let ((v1-4 (-> this nav travel))) + (.lvf vf1 (&-> (-> this root-override transv) quad)) + (let ((f0-8 (seconds-per-frame))) (.mov at-0 f0-8) ) (.mov vf2 at-0) @@ -444,47 +444,47 @@ (.svf (&-> v1-4 quad) vf1) ) (let ((s4-0 (new 'stack-no-clear 'check-vector-collision-with-nav-spheres-info))) - (when (>= (nav-control-method-23 (-> obj nav) (-> obj nav travel) s4-0) 0.0) + (when (>= (nav-control-method-23 (-> this nav) (-> this nav travel) s4-0) 0.0) (let ((s5-2 (new 'stack-no-clear 'vector))) (set! (-> s5-2 quad) (-> s4-0 normal quad)) (set! (-> s5-2 y) 0.0) (vector-normalize! s5-2 1.0) - (vector-reflect! (-> obj root-override transv) (-> obj root-override transv) s5-2) + (vector-reflect! (-> this root-override transv) (-> this root-override transv) s5-2) ) - (set! (-> obj travel-ry) (atan (-> obj root-override transv x) (-> obj root-override transv z))) - (+! (-> obj travel-ry) (rand-vu-float-range -910.2222 910.2222)) - (vector-reset! (-> obj root-override transv)) + (set! (-> this travel-ry) (atan (-> this root-override transv x) (-> this root-override transv z))) + (+! (-> this travel-ry) (rand-vu-float-range -910.2222 910.2222)) + (vector-reset! (-> this root-override transv)) (set! s5-1 #t) - (set! (-> obj bounced?) #t) - (set! (-> obj bounce-volume) 100) + (set! (-> this bounced?) #t) + (set! (-> this bounce-volume) 100) ) ) (when (not s5-1) - (vector-normalize-copy! (-> obj nav travel) (-> obj root-override transv) 2048.0) + (vector-normalize-copy! (-> this nav travel) (-> this root-override transv) 2048.0) (let ((s5-3 (new 'stack 'clip-travel-vector-to-mesh-return-info))) - (nav-control-method-24 (-> obj nav) 2048.0 s5-3) + (nav-control-method-24 (-> this nav) 2048.0 s5-3) (when (and (-> s5-3 found-boundary) - (>= (* (-> obj travel-speed) (-> *display* seconds-per-frame)) - (vector-vector-xz-distance (-> s5-3 intersection) (-> obj root-override trans)) + (>= (* (-> this travel-speed) (seconds-per-frame)) + (vector-vector-xz-distance (-> s5-3 intersection) (-> this root-override trans)) ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) (vector-negate! s4-1 (-> s5-3 boundary-normal)) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) - (vector-reflect! (-> obj root-override transv) (-> obj root-override transv) s4-1) + (vector-reflect! (-> this root-override transv) (-> this root-override transv) s4-1) ) - (set! (-> obj travel-ry) (atan (-> obj root-override transv x) (-> obj root-override transv z))) - (+! (-> obj travel-ry) (rand-vu-float-range -910.2222 910.2222)) - (vector-reset! (-> obj root-override transv)) + (set! (-> this travel-ry) (atan (-> this root-override transv x) (-> this root-override transv z))) + (+! (-> this travel-ry) (rand-vu-float-range -910.2222 910.2222)) + (vector-reset! (-> this root-override transv)) #t - (set! (-> obj bounced?) #t) - (set! (-> obj bounce-volume) 60) + (set! (-> this bounced?) #t) + (set! (-> this bounce-volume) 60) ) ) ) ) - (set! (-> obj root-override transv y) (+ -36864.0 (-> obj root-override transv y))) + (set! (-> this root-override transv y) (+ -36864.0 (-> this root-override transv y))) ) ) @@ -492,7 +492,7 @@ (defstate bully-idle (bully) :event bully-default-event-handler :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self reaction-delay) (rand-vu-int-range 0 (seconds 0.35))) (set! (-> self travel-speed) 0.0) (shut-down! (-> self neck)) @@ -512,7 +512,7 @@ (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-delay)) + (time-elapsed? (-> self state-time) (-> self reaction-delay)) ) (start-hint-timer (text-id sunken-bully-dive-hint)) (go bully-notice) @@ -561,7 +561,7 @@ ) (until (logtest? (-> self root-override status) (cshape-moving-flags onsurf)) (ja :num! (seek!)) - (+! (-> self root-override transv y) (* -545996.8 (-> *display* seconds-per-frame))) + (+! (-> self root-override transv y) (* -545996.8 (seconds-per-frame))) (integrate-for-enemy-with-move-to-ground! (-> self root-override) (-> self root-override transv) @@ -594,8 +594,8 @@ (defstate bully-start-spinning (bully) :event bully-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) - (set! (-> self start-spin-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) + (set-time! (-> self start-spin-time)) (set! (-> self slow-down) (rand-vu-int-range (seconds 4) (seconds 8))) (set! (-> self speed-u) 0.2) (set! (-> self bounced?) #f) @@ -621,19 +621,19 @@ (set-target! (-> self neck) (target-pos 5)) ) (cond - ((>= (- (-> *display* base-frame-counter) (-> self start-spin-time)) (-> self slow-down)) - (seek! (-> self speed-u) 0.0 (* 0.5555556 (-> *display* seconds-per-frame))) + ((time-elapsed? (-> self start-spin-time) (-> self slow-down)) + (seek! (-> self speed-u) 0.0 (* 0.5555556 (seconds-per-frame))) (if (= (-> self speed-u) 0.0) (go bully-stop-spinning) ) ) (else - (seek! (-> self speed-u) 1.0 (* 0.5555556 (-> *display* seconds-per-frame))) + (seek! (-> self speed-u) 1.0 (* 0.5555556 (seconds-per-frame))) ) ) (set! (-> self spin-vel) (* 196608.0 (-> self speed-u))) (set! (-> self travel-speed) (* 41779.2 (-> self speed-u))) - (+! (-> self facing-ry) (* (-> self spin-vel) (-> *display* seconds-per-frame))) + (+! (-> self facing-ry) (* (-> self spin-vel) (seconds-per-frame))) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self facing-ry)) (bully-method-20 self) (integrate-for-enemy-with-move-to-ground! @@ -688,7 +688,7 @@ (defstate bully-stop-spinning (bully) :event bully-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self reaction-delay) (rand-vu-int-range (seconds 2) (seconds 3))) (set! (-> self travel-speed) 0.0) (set! (-> self bounced?) #f) @@ -710,7 +710,7 @@ (local-vars (v1-17 symbol) (v1-35 symbol)) (let ((gp-0 2)) (ja-channel-push! 1 (seconds 0.2)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-delay)) + (until (time-elapsed? (-> self state-time) (-> self reaction-delay)) (cond ((>= gp-0 0) (+! gp-0 -1) @@ -780,26 +780,26 @@ ;; definition for method 7 of type bully ;; INFO: Return type mismatch process-drawable vs bully. -(defmethod relocate bully ((obj bully) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method bully 7)) this arg0) ) ) ;; definition for method 11 of type bully ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! bully ((obj bully) (arg0 entity-actor)) - (set! (-> obj hit-player?) #f) - (set! (-> obj bounced?) #f) - (set! (-> obj bounce-volume) 100) - (set! (-> obj spin-vel) 0.0) - (set! (-> obj travel-speed) 0.0) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! bully ((this bully) (arg0 entity-actor)) + (set! (-> this hit-player?) #f) + (set! (-> this bounced?) #f) + (set! (-> this bounce-volume) 100) + (set! (-> this spin-vel) 0.0) + (set! (-> this travel-speed) 0.0) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -831,22 +831,22 @@ ) (set! (-> s4-0 nav-radius) 7680.0) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj root-override event-self) 'touched) - (set! (-> obj root-override event-other) 'touch) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *bully-sg* '()) - (set! (-> obj draw shadow-ctrl) *bully-shadow-control*) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 454) obj)) - (set! (-> obj fact-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this root-override event-self) 'touched) + (set! (-> this root-override event-other) 'touch) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *bully-sg* '()) + (set! (-> this draw shadow-ctrl) *bully-shadow-control*) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 454) this)) + (set! (-> this fact-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (let ((v1-49 (new 'process 'joint-mod (joint-mod-handler-mode reset) obj 5))) - (set! (-> obj neck) v1-49) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) + (let ((v1-49 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 5))) + (set! (-> this neck) v1-49) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) (set! (-> v1-49 up) (the-as uint 1)) (set! (-> v1-49 nose) (the-as uint 2)) (set! (-> v1-49 ear) (the-as uint 0)) @@ -854,10 +854,10 @@ (set! (-> v1-49 ignore-angle) 16384.0) ) (transform-post) - (if (not (move-to-ground (-> obj root-override) 12288.0 40960.0 #t (collide-kind background))) + (if (not (move-to-ground (-> this root-override) 12288.0 40960.0 #t (collide-kind background))) (go process-drawable-art-error "no ground") ) - (set! (-> obj facing-ry) (quaternion-y-angle (-> obj root-override quat))) + (set! (-> this facing-ry) (quaternion-y-angle (-> this root-override quat))) (go bully-idle #t) (none) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc b/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc index ffebaf4f76..291874cda2 100644 --- a/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/double-lurker_REF.gc @@ -19,12 +19,12 @@ ) ;; definition for method 3 of type double-lurker-top -(defmethod inspect double-lurker-top ((obj double-lurker-top)) +(defmethod inspect double-lurker-top ((this double-lurker-top)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tfall-dest: #~%" (-> obj fall-dest)) - obj + (format #t "~T~Tfall-dest: #~%" (-> this fall-dest)) + this ) ;; definition of type double-lurker @@ -55,16 +55,16 @@ ) ;; definition for method 3 of type double-lurker -(defmethod inspect double-lurker ((obj double-lurker)) +(defmethod inspect double-lurker ((this double-lurker)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tknocked-back-speed: ~f~%" (-> obj knocked-back-speed)) - (format #t "~T~Tbuddy-on-shoulders?: ~A~%" (-> obj buddy-on-shoulders?)) - (format #t "~T~Tdead?: ~A~%" (-> obj dead?)) - (format #t "~T~Tbuddy-dead?: ~A~%" (-> obj buddy-dead?)) - (format #t "~T~Tbuddy-handle: ~D~%" (-> obj buddy-handle)) - obj + (format #t "~T~Tknocked-back-speed: ~f~%" (-> this knocked-back-speed)) + (format #t "~T~Tbuddy-on-shoulders?: ~A~%" (-> this buddy-on-shoulders?)) + (format #t "~T~Tdead?: ~A~%" (-> this dead?)) + (format #t "~T~Tbuddy-dead?: ~A~%" (-> this buddy-dead?)) + (format #t "~T~Tbuddy-handle: ~D~%" (-> this buddy-handle)) + this ) ;; failed to figure out what this is: @@ -369,7 +369,7 @@ (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn)) ) @@ -413,16 +413,16 @@ ) ;; definition for method 51 of type double-lurker-top -(defmethod nav-enemy-method-51 double-lurker-top ((obj double-lurker-top)) - (restore-collide-with-as (-> obj collide-info)) - (logior! (-> obj collide-info nav-flags) (nav-flags navf0)) - (nav-control-method-27 (-> obj nav)) +(defmethod nav-enemy-method-51 double-lurker-top ((this double-lurker-top)) + (restore-collide-with-as (-> this collide-info)) + (logior! (-> this collide-info nav-flags) (nav-flags navf0)) + (nav-control-method-27 (-> this nav)) (none) ) ;; definition for method 47 of type double-lurker-top -(defmethod initialize-collision double-lurker-top ((obj double-lurker-top)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision double-lurker-top ((this double-lurker-top)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -485,25 +485,25 @@ ) (set! (-> s5-0 nav-radius) 9011.2) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) - (clear-collide-with-as (-> obj collide-info)) + (clear-collide-with-as (-> this collide-info)) (none) ) ;; definition for method 48 of type double-lurker-top ;; INFO: Used lq/sq ;; INFO: Return type mismatch nav-flags vs none. -(defmethod nav-enemy-method-48 double-lurker-top ((obj double-lurker-top)) - (initialize-skeleton obj *double-lurker-top-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (init-defaults! obj *double-lurker-top-nav-enemy-info*) - (let ((v1-5 (-> obj parent-process))) - (set! (-> obj collide-info trans quad) (-> v1-5 0 collide-info trans quad)) - (set-vector! (-> obj collide-info scale) 1.0 1.0 1.0 1.0) - (quaternion-copy! (-> obj collide-info quat) (-> v1-5 0 collide-info quat)) +(defmethod nav-enemy-method-48 double-lurker-top ((this double-lurker-top)) + (initialize-skeleton this *double-lurker-top-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (init-defaults! this *double-lurker-top-nav-enemy-info*) + (let ((v1-5 (-> this parent-process))) + (set! (-> this collide-info trans quad) (-> v1-5 0 collide-info trans quad)) + (set-vector! (-> this collide-info scale) 1.0 1.0 1.0 1.0) + (quaternion-copy! (-> this collide-info quat) (-> v1-5 0 collide-info quat)) ) - (logclear! (-> obj collide-info nav-flags) (nav-flags navf0)) + (logclear! (-> this collide-info nav-flags) (nav-flags navf0)) (none) ) @@ -545,7 +545,7 @@ (local-vars (v0-0 object)) (case arg2 (('touch) - (set! (-> self touch-time) (-> *display* base-frame-counter)) + (set-time! (-> self touch-time)) (touch-handler self arg0 arg3) ) (('attack) @@ -635,7 +635,7 @@ (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (time-elapsed? (-> self state-time) (-> self state-timeout)) (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status was-drawn)) ) @@ -735,17 +735,15 @@ (vf2 :class vf) ) (init-vf0-vector) - (let* ((f0-3 - (seek-with-smooth (-> self knocked-back-speed) 0.0 (* 49152.0 (-> *display* seconds-per-frame)) 0.5 0.01) - ) - (f30-0 (* f0-3 (-> *display* seconds-per-frame))) + (let* ((f0-3 (seek-with-smooth (-> self knocked-back-speed) 0.0 (* 49152.0 (seconds-per-frame)) 0.5 0.01)) + (f30-0 (* f0-3 (seconds-per-frame))) ) (set! (-> self knocked-back-speed) f0-3) (vector-float*! (-> self collide-info transv) (-> self hit-from-dir) f0-3) (when (< 0.0 f0-3) (let ((v1-7 (-> self nav travel))) (.lvf vf1 (&-> (-> self collide-info transv) quad)) - (let ((f0-4 (-> *display* seconds-per-frame))) + (let ((f0-4 (seconds-per-frame))) (.mov at-0 f0-4) ) (.mov vf2 at-0) @@ -802,15 +800,15 @@ ;; definition for method 52 of type double-lurker ;; INFO: Used lq/sq -(defmethod nav-enemy-method-52 double-lurker ((obj double-lurker) (arg0 vector)) - (nav-control-method-28 (-> obj nav) (the-as collide-kind -1)) +(defmethod nav-enemy-method-52 double-lurker ((this double-lurker) (arg0 vector)) + (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) (let ((a1-2 (new 'stack-no-clear 'vector))) - (vector-float*! a1-2 (-> obj hit-from-dir) 22937.602) - (vector+! a1-2 a1-2 (-> obj collide-info trans)) - (nav-control-method-13 (-> obj nav) a1-2 (-> obj hit-from-dir)) + (vector-float*! a1-2 (-> this hit-from-dir) 22937.602) + (vector+! a1-2 a1-2 (-> this collide-info trans)) + (nav-control-method-13 (-> this nav) a1-2 (-> this hit-from-dir)) ) - (when (>= (vector-xz-length (-> obj nav travel)) 18841.602) - (vector+! arg0 (-> obj collide-info trans) (-> obj nav travel)) + (when (>= (vector-xz-length (-> this nav travel)) 18841.602) + (vector+! arg0 (-> this collide-info trans) (-> this nav travel)) (let ((a1-5 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'collide-tri-result)) ) @@ -822,7 +820,7 @@ (new 'static 'vector :y -40960.0 :w 1.0) 40.96 (collide-kind background) - obj + this s4-0 (new 'static 'pat-surface :noentity #x1) ) @@ -882,17 +880,15 @@ (vf2 :class vf) ) (init-vf0-vector) - (let* ((f0-3 - (seek-with-smooth (-> self knocked-back-speed) 0.0 (* 49152.0 (-> *display* seconds-per-frame)) 0.5 0.01) - ) - (f30-0 (* f0-3 (-> *display* seconds-per-frame))) + (let* ((f0-3 (seek-with-smooth (-> self knocked-back-speed) 0.0 (* 49152.0 (seconds-per-frame)) 0.5 0.01)) + (f30-0 (* f0-3 (seconds-per-frame))) ) (set! (-> self knocked-back-speed) f0-3) (vector-float*! (-> self collide-info transv) (-> self hit-from-dir) f0-3) (when (< 0.0 f0-3) (let ((v1-7 (-> self nav travel))) (.lvf vf1 (&-> (-> self collide-info transv) quad)) - (let ((f0-4 (-> *display* seconds-per-frame))) + (let ((f0-4 (seconds-per-frame))) (.mov at-0 f0-4) ) (.mov vf2 at-0) @@ -959,14 +955,14 @@ ) ;; definition for method 53 of type double-lurker -(defmethod double-lurker-method-53 double-lurker ((obj double-lurker) (arg0 vector)) - (let* ((s3-0 (-> obj path curve num-cverts)) +(defmethod double-lurker-method-53 double-lurker ((this double-lurker) (arg0 vector)) + (let* ((s3-0 (-> this path curve num-cverts)) (s4-0 (rand-vu-int-count s3-0)) ) (while (nonzero? s3-0) (+! s3-0 -1) - (eval-path-curve-div! (-> obj path) arg0 (the float s4-0) 'interp) - (if (not (nav-enemy-method-50 obj arg0)) + (eval-path-curve-div! (-> this path) arg0 (the float s4-0) 'interp) + (if (not (nav-enemy-method-50 this arg0)) (return #t) ) ) @@ -975,8 +971,8 @@ ) ;; definition for method 47 of type double-lurker -(defmethod initialize-collision double-lurker ((obj double-lurker)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision double-lurker ((this double-lurker)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1063,15 +1059,15 @@ ) (set! (-> s5-0 nav-radius) 9830.4) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) s5-0 ) ) ;; definition for method 51 of type double-lurker ;; INFO: Return type mismatch symbol vs none. -(defmethod nav-enemy-method-51 double-lurker ((obj double-lurker)) - (let ((v1-1 (-> obj collide-info root-prim))) +(defmethod nav-enemy-method-51 double-lurker ((this double-lurker)) + (let ((v1-1 (-> this collide-info root-prim))) (let ((a0-1 0)) (dotimes (a1-0 3) (let ((a2-2 (-> (the-as collide-shape-prim-group v1-1) prims a0-1))) @@ -1098,70 +1094,70 @@ ;; definition for method 48 of type double-lurker ;; INFO: Used lq/sq ;; INFO: Return type mismatch float vs none. -(defmethod nav-enemy-method-48 double-lurker ((obj double-lurker)) - (set! (-> obj buddy-handle) (the-as handle #f)) - (process-drawable-from-entity! obj (-> obj entity)) - (set! (-> obj align) (new 'process 'align-control obj)) - (initialize-skeleton obj *double-lurker-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj buddy-on-shoulders?) #t) - (set! (-> obj dead?) #f) - (set! (-> obj buddy-dead?) #f) - (let ((v1-7 (-> obj entity extra perm))) +(defmethod nav-enemy-method-48 double-lurker ((this double-lurker)) + (set! (-> this buddy-handle) (the-as handle #f)) + (process-drawable-from-entity! this (-> this entity)) + (set! (-> this align) (new 'process 'align-control this)) + (initialize-skeleton this *double-lurker-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (set! (-> this buddy-on-shoulders?) #t) + (set! (-> this dead?) #f) + (set! (-> this buddy-dead?) #f) + (let ((v1-7 (-> this entity extra perm))) (if (nonzero? (-> v1-7 user-int8 2)) - (set! (-> obj buddy-on-shoulders?) #f) + (set! (-> this buddy-on-shoulders?) #f) ) (when (nonzero? (-> v1-7 user-int8 0)) - (set! (-> obj dead?) #t) - (set! (-> obj buddy-on-shoulders?) #f) + (set! (-> this dead?) #t) + (set! (-> this buddy-on-shoulders?) #f) ) (when (nonzero? (-> v1-7 user-int8 1)) - (set! (-> obj buddy-dead?) #t) - (set! (-> obj buddy-on-shoulders?) #f) + (set! (-> this buddy-dead?) #t) + (set! (-> this buddy-on-shoulders?) #f) ) ) - (init-defaults! obj *double-lurker-when-both-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set-vector! (-> obj neck twist-max) 12743.111 12743.111 0.0 1.0) - (when (not (-> obj buddy-dead?)) + (init-defaults! this *double-lurker-when-both-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set-vector! (-> this neck twist-max) 12743.111 12743.111 0.0 1.0) + (when (not (-> this buddy-dead?)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (not (-> obj buddy-on-shoulders?)) - (when (not (double-lurker-method-53 obj s5-0)) - (set! (-> obj buddy-on-shoulders?) #t) - (let ((v1-29 (-> obj entity extra perm))) + (when (not (-> this buddy-on-shoulders?)) + (when (not (double-lurker-method-53 this s5-0)) + (set! (-> this buddy-on-shoulders?) #t) + (let ((v1-29 (-> this entity extra perm))) (logior! (-> v1-29 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-29 user-int8 2) 0) ) 0 ) ) - (if (-> obj buddy-on-shoulders?) - (set! (-> s5-0 quad) (-> obj collide-info trans quad)) + (if (-> this buddy-on-shoulders?) + (set! (-> s5-0 quad) (-> this collide-info trans quad)) ) - (set! (-> obj buddy-handle) + (set! (-> this buddy-handle) (ppointer->handle - (process-spawn double-lurker-top (-> obj entity) obj (-> obj buddy-on-shoulders?) s5-0 :to obj) + (process-spawn double-lurker-top (-> this entity) this (-> this buddy-on-shoulders?) s5-0 :to this) ) ) ) ) - (when (and (not (-> obj dead?)) (not (-> obj buddy-on-shoulders?))) - (nav-enemy-method-51 obj) - (init-jm! obj *double-lurker-nav-enemy-info*) + (when (and (not (-> this dead?)) (not (-> this buddy-on-shoulders?))) + (nav-enemy-method-51 this) + (init-jm! this *double-lurker-nav-enemy-info*) ) (none) ) ;; definition for method 11 of type double-lurker ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! double-lurker ((obj double-lurker) (arg0 entity-actor)) - (initialize-collision obj) - (nav-enemy-method-48 obj) - (if (-> obj dead?) +(defmethod init-from-entity! double-lurker ((this double-lurker) (arg0 entity-actor)) + (initialize-collision this) + (nav-enemy-method-48 this) + (if (-> this dead?) (go double-lurker-waiting-to-die) - (go (method-of-object obj nav-enemy-idle)) + (go (method-of-object this nav-enemy-idle)) ) (none) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc b/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc index df41320d4a..070daea6cb 100644 --- a/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/floating-launcher_REF.gc @@ -18,13 +18,13 @@ ) ;; definition for method 3 of type floating-launcher -(defmethod inspect floating-launcher ((obj floating-launcher)) +(defmethod inspect floating-launcher ((this floating-launcher)) (let ((t9-0 (method-of-type baseplat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttrigger-height: ~f~%" (-> obj trigger-height)) - (format #t "~T~Tlauncher: #x~X~%" (-> obj launcher)) - obj + (format #t "~T~Ttrigger-height: ~f~%" (-> this trigger-height)) + (format #t "~T~Tlauncher: #x~X~%" (-> this launcher)) + this ) ;; failed to figure out what this is: @@ -72,7 +72,7 @@ ) (let ((f30-0 1.0)) (while (!= f30-0 0.0) - (set! f30-0 (seek f30-0 0.0 (-> *display* seconds-per-frame))) + (set! f30-0 (seek f30-0 0.0 (seconds-per-frame))) (eval-path-curve-div! (-> self path) (-> self basetrans) f30-0 'interp) (set! (-> self launcher 0 root-override trans quad) (-> self basetrans quad)) (update-transforms! (-> self launcher 0 root-override)) @@ -97,9 +97,9 @@ ;; definition for method 11 of type floating-launcher ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! floating-launcher ((obj floating-launcher) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! floating-launcher ((this floating-launcher) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -117,20 +117,20 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (eval-path-curve-div! (-> obj path) (-> obj root-override trans) 1.0 'interp) + (process-drawable-from-entity! this arg0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (eval-path-curve-div! (-> this path) (-> this root-override trans) 1.0 'interp) (let ((f30-0 (res-lump-float arg0 'spring-height :default 163840.0))) - (set! (-> obj launcher) (process-spawn launcher (-> obj root-override trans) f30-0 0 81920.0 :to obj)) + (set! (-> this launcher) (process-spawn launcher (-> this root-override trans) f30-0 0 81920.0 :to this)) ) - (initialize-skeleton obj *floating-launcher-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (set! (-> obj trigger-height) (res-lump-float arg0 'trigger-height)) + (initialize-skeleton this *floating-launcher-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (set! (-> this trigger-height) (res-lump-float arg0 'trigger-height)) (go floating-launcher-idle) (none) ) 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 c7e39abb5d..e276abf93a 100644 --- a/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/helix-water_REF.gc @@ -17,11 +17,11 @@ ) ;; definition for method 3 of type helix-slide-door -(defmethod inspect helix-slide-door ((obj helix-slide-door)) +(defmethod inspect helix-slide-door ((this helix-slide-door)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -53,16 +53,16 @@ ) ;; definition for method 3 of type helix-button -(defmethod inspect helix-button ((obj helix-button)) +(defmethod inspect helix-button ((this helix-button)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmy-water: ~A~%" (-> obj my-water)) - (format #t "~T~Tmy-door: ~A~%" (-> obj my-door)) - (format #t "~T~Tfcell-handle: ~D~%" (-> obj fcell-handle)) - (format #t "~T~Tdown-y: ~f~%" (-> obj down-y)) - (format #t "~T~Tspawn-trans: #~%" (-> obj spawn-trans)) - obj + (format #t "~T~Tmy-water: ~A~%" (-> this my-water)) + (format #t "~T~Tmy-door: ~A~%" (-> this my-door)) + (format #t "~T~Tfcell-handle: ~D~%" (-> this fcell-handle)) + (format #t "~T~Tdown-y: ~f~%" (-> this down-y)) + (format #t "~T~Tspawn-trans: #~%" (-> this spawn-trans)) + this ) ;; failed to figure out what this is: @@ -81,11 +81,11 @@ ) ;; definition for method 3 of type helix-dark-eco -(defmethod inspect helix-dark-eco ((obj helix-dark-eco)) +(defmethod inspect helix-dark-eco ((this helix-dark-eco)) (let ((t9-0 (method-of-type dark-eco-pool inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type helix-water @@ -112,17 +112,17 @@ ) ;; definition for method 3 of type helix-water -(defmethod inspect helix-water ((obj helix-water)) +(defmethod inspect helix-water ((this helix-water)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tlast-alt-actor-consumed: ~D~%" (-> obj last-alt-actor-consumed)) - (format #t "~T~Talt-actors: ~A~%" (-> obj alt-actors)) - (format #t "~T~Ttransv-y: ~f~%" (-> obj transv-y)) - (format #t "~T~Tstart-y: ~f~%" (-> obj start-y)) - (format #t "~T~Tend-y: ~f~%" (-> obj end-y)) - (format #t "~T~Tdark-eco: #x~X~%" (-> obj dark-eco)) - obj + (format #t "~T~Tlast-alt-actor-consumed: ~D~%" (-> this last-alt-actor-consumed)) + (format #t "~T~Talt-actors: ~A~%" (-> this alt-actors)) + (format #t "~T~Ttransv-y: ~f~%" (-> this transv-y)) + (format #t "~T~Tstart-y: ~f~%" (-> this start-y)) + (format #t "~T~Tend-y: ~f~%" (-> this end-y)) + (format #t "~T~Tdark-eco: #x~X~%" (-> this dark-eco)) + this ) ;; failed to figure out what this is: @@ -212,8 +212,8 @@ ;; definition for method 11 of type helix-slide-door ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! helix-slide-door ((obj helix-slide-door) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! helix-slide-door ((this helix-slide-door) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -225,23 +225,23 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *helix-slide-door-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *helix-slide-door-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (set! *helix-slide-door* obj) + (update-transforms! (-> this root-override)) + (set! *helix-slide-door* this) (go helix-slide-door-idle-open) (none) ) @@ -350,7 +350,7 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (when *target* (let ((gp-1 (new 'stack-no-clear 'vector))) (vector-! gp-1 (-> self root-override trans) (target-pos 0)) @@ -363,7 +363,7 @@ ) ) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.5)) + (until (time-elapsed? (-> self state-time) (seconds 1.5)) (suspend) ) (level-hint-spawn (text-id sunken-helix-hint) "sksp0124" (the-as entity #f) *entity-pool* (game-task none)) @@ -376,8 +376,8 @@ (f0-2 (-> self root-override trans y)) (a1-11 (new 'stack-no-clear 'vector)) ) - (let* ((f1-1 (+ f1-0 (* -737280.0 (-> *display* seconds-per-frame)))) - (f0-3 (+ f0-2 (* f1-1 (-> *display* seconds-per-frame)))) + (let* ((f1-1 (+ f1-0 (* -737280.0 (seconds-per-frame)))) + (f0-3 (+ f0-2 (* f1-1 (seconds-per-frame)))) ) (when (>= (-> self down-y) f0-3) (set! f0-3 (-> self down-y)) @@ -393,12 +393,12 @@ (suspend) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.25)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1.25)) (suspend) ) (sound-play "maindoor") - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.9)) + (until (time-elapsed? (-> self state-time) (seconds 1.9)) (suspend) ) (let ((a1-13 (new 'stack-no-clear 'event-message-block))) @@ -416,7 +416,7 @@ ) ) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3.5)) + (until (time-elapsed? (-> self state-time) (seconds 3.5)) (suspend) ) (let ((a1-14 (new 'stack-no-clear 'event-message-block))) @@ -441,10 +441,10 @@ *entity-pool* (game-task none) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (suspend) ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (send-event *target* 'play-anim 'shock-out) (send-event *target* 'neck 1.0 (-> self my-door extra trans)) (suspend) @@ -512,8 +512,8 @@ (f0-0 (-> self root-override trans y)) (a1-5 (new 'stack-no-clear 'vector)) ) - (let* ((f1-1 (+ f1-0 (* -737280.0 (-> *display* seconds-per-frame)))) - (f0-1 (+ f0-0 (* f1-1 (-> *display* seconds-per-frame)))) + (let* ((f1-1 (+ f1-0 (* -737280.0 (seconds-per-frame)))) + (f0-1 (+ f0-0 (* f1-1 (seconds-per-frame)))) ) (when (>= (-> self down-y) f0-1) (set! f0-1 (-> self down-y)) @@ -546,11 +546,11 @@ ;; definition for method 11 of type helix-button ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! helix-button ((obj helix-button) (arg0 entity-actor)) - (set! (-> obj fcell-handle) (the-as handle #f)) - (set! (-> obj my-water) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj my-door) (entity-actor-lookup arg0 'alt-actor 1)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! helix-button ((this helix-button) (arg0 entity-actor)) + (set! (-> this fcell-handle) (the-as handle #f)) + (set! (-> this my-water) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this my-door) (entity-actor-lookup arg0 'alt-actor 1)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -568,38 +568,38 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *helix-button-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *helix-button-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) - (set! (-> obj spawn-trans quad) (-> obj root-override trans quad)) - (+! (-> obj root-override trans y) -26624.0) - (set! (-> obj down-y) (+ -6553.6 (-> obj root-override trans y))) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this spawn-trans quad) (-> this root-override trans quad)) + (+! (-> this root-override trans y) -26624.0) + (set! (-> this down-y) (+ -6553.6 (-> this root-override trans y))) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (ja-post) - (update-transforms! (-> obj root-override)) - (set! *helix-button* obj) + (update-transforms! (-> this root-override)) + (set! *helix-button* this) (go helix-button-startup) (none) ) ;; definition for method 21 of type helix-water -(defmethod helix-water-method-21 helix-water ((obj helix-water)) - (let ((s5-0 (+ (-> obj last-alt-actor-consumed) 1))) - (when (< s5-0 (-> obj alt-actors length)) - (let* ((v1-5 (-> obj alt-actors s5-0)) +(defmethod helix-water-method-21 helix-water ((this helix-water)) + (let ((s5-0 (+ (-> this last-alt-actor-consumed) 1))) + (when (< s5-0 (-> this alt-actors length)) + (let* ((v1-5 (-> this alt-actors s5-0)) (s4-0 (if v1-5 (-> v1-5 extra process) ) @@ -609,11 +609,11 @@ ) ) ) - (+ -1638.4 (-> obj root trans y)) + (+ -1638.4 (-> this root trans y)) (cond (a0-3 - (when (< (-> (the-as process-drawable a0-3) root trans y) (-> obj root trans y)) - (set! (-> obj last-alt-actor-consumed) s5-0) + (when (< (-> (the-as process-drawable a0-3) root trans y) (-> this root trans y)) + (set! (-> this last-alt-actor-consumed) s5-0) (case (-> a0-3 type) ((babak) (send-event a0-3 'instant-death) @@ -628,7 +628,7 @@ ) ) (else - (set! (-> obj last-alt-actor-consumed) s5-0) + (set! (-> this last-alt-actor-consumed) s5-0) s5-0 ) ) @@ -676,7 +676,7 @@ ) ) :trans (behavior () - (seek! (-> self root scale y) 0.8 (* 0.667 (-> *display* seconds-per-frame))) + (seek! (-> self root scale y) 0.8 (* 0.667 (seconds-per-frame))) (when *target* (let ((f0-4 (-> (target-pos 0) y))) (when (not (logtest? (-> *target* state-flags) (state-flags grabbed))) @@ -697,7 +697,7 @@ ) ) ) - (+! (-> self root trans y) (* (-> self transv-y) (-> *display* seconds-per-frame))) + (+! (-> self root trans y) (* (-> self transv-y) (seconds-per-frame))) (if (< (-> self end-y) (-> self root trans y)) (set! (-> self root trans y) (-> self end-y)) ) @@ -716,35 +716,37 @@ ;; definition for method 7 of type helix-water ;; INFO: Return type mismatch process-drawable vs helix-water. -(defmethod relocate helix-water ((obj helix-water) (arg0 int)) - (if (nonzero? (-> obj alt-actors)) - (&+! (-> obj alt-actors) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method helix-water 7)) this arg0) ) ) ;; definition for method 11 of type helix-water ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! helix-water ((obj helix-water) (arg0 entity-actor)) - (set! (-> obj last-alt-actor-consumed) -1) - (set! (-> obj transv-y) 9216.0) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj start-y) (+ -49152.0 (-> obj root trans y))) - (set! (-> obj end-y) (+ 851968.0 (-> obj start-y))) - (set-vector! (-> obj root scale) 1.0 0.8 1.0 1.0) +(defmethod init-from-entity! helix-water ((this helix-water) (arg0 entity-actor)) + (set! (-> this last-alt-actor-consumed) -1) + (set! (-> this transv-y) 9216.0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this start-y) (+ -49152.0 (-> this root trans y))) + (set! (-> this end-y) (+ 851968.0 (-> this start-y))) + (set-vector! (-> this root scale) 1.0 0.8 1.0 1.0) (let ((s4-0 (entity-actor-count arg0 'alt-actor))) - (set! (-> obj alt-actors) (new 'process 'boxed-array entity-actor s4-0)) + (set! (-> this alt-actors) (new 'process 'boxed-array entity-actor s4-0)) (dotimes (s3-0 s4-0) - (set! (-> obj alt-actors s3-0) (entity-actor-lookup arg0 'alt-actor s3-0)) + (set! (-> this alt-actors s3-0) (entity-actor-lookup arg0 'alt-actor s3-0)) ) ) - (set! (-> obj root trans y) (-> obj start-y)) - (set! (-> obj dark-eco) (process-spawn helix-dark-eco :init water-vol-init-by-other (-> obj entity) :to obj)) - (set! *helix-water* obj) + (set! (-> this root trans y) (-> this start-y)) + (set! (-> this dark-eco) + (process-spawn helix-dark-eco :init water-vol-init-by-other (-> this entity) :to this) + ) + (set! *helix-water* this) (go helix-water-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc index 82ad275f30..973407b315 100644 --- a/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/orbit-plat_REF.gc @@ -19,12 +19,12 @@ ) ;; definition for method 3 of type orbit-plat-bottom -(defmethod inspect orbit-plat-bottom ((obj orbit-plat-bottom)) +(defmethod inspect orbit-plat-bottom ((this orbit-plat-bottom)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - obj + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + this ) ;; failed to figure out what this is: @@ -62,18 +62,18 @@ ) ;; definition for method 3 of type orbit-plat -(defmethod inspect orbit-plat ((obj orbit-plat)) +(defmethod inspect orbit-plat ((this orbit-plat)) (let ((t9-0 (method-of-type baseplat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tother: ~A~%" (-> obj other)) - (format #t "~T~Trot-dir: ~f~%" (-> obj rot-dir)) - (format #t "~T~Treset-trans: #~%" (-> obj reset-trans)) - (format #t "~T~Tis-reset?: ~A~%" (-> obj is-reset?)) - (format #t "~T~Treset-length: ~f~%" (-> obj reset-length)) - (format #t "~T~Ttimeout: ~f~%" (-> obj timeout)) - (format #t "~T~Tplat-status: ~D~%" (-> obj plat-status)) - obj + (format #t "~T~Tother: ~A~%" (-> this other)) + (format #t "~T~Trot-dir: ~f~%" (-> this rot-dir)) + (format #t "~T~Treset-trans: #~%" (-> this reset-trans)) + (format #t "~T~Tis-reset?: ~A~%" (-> this is-reset?)) + (format #t "~T~Treset-length: ~f~%" (-> this reset-length)) + (format #t "~T~Ttimeout: ~f~%" (-> this timeout)) + (format #t "~T~Tplat-status: ~D~%" (-> this plat-status)) + this ) ;; failed to figure out what this is: @@ -161,7 +161,7 @@ ;; definition for method 20 of type orbit-plat-bottom ;; INFO: Return type mismatch int vs none. -(defmethod orbit-plat-bottom-method-20 orbit-plat-bottom ((obj orbit-plat-bottom) (arg0 vector) (arg1 vector)) +(defmethod orbit-plat-bottom-method-20 orbit-plat-bottom ((this orbit-plat-bottom) (arg0 vector) (arg1 vector)) (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) (f30-0 (vector-length s5-1)) ) @@ -255,19 +255,19 @@ ;; definition for method 7 of type orbit-plat-bottom ;; INFO: Return type mismatch process-drawable vs orbit-plat-bottom. -(defmethod relocate orbit-plat-bottom ((obj orbit-plat-bottom) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate orbit-plat-bottom ((this orbit-plat-bottom) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as orbit-plat-bottom ((method-of-type process-drawable relocate) obj arg0)) + (the-as orbit-plat-bottom ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type orbit-plat-bottom -(defmethod deactivate orbit-plat-bottom ((obj orbit-plat-bottom)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate orbit-plat-bottom ((this orbit-plat-bottom)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -383,13 +383,13 @@ ) ;; definition for method 28 of type orbit-plat -(defmethod orbit-plat-method-28 orbit-plat ((obj orbit-plat)) - (when (>= (- (-> *display* base-frame-counter) (-> obj state-time)) (the int (* 300.0 (-> obj timeout)))) +(defmethod orbit-plat-method-28 orbit-plat ((this orbit-plat)) + (when (time-elapsed? (-> this state-time) (the int (* 300.0 (-> this timeout)))) (cond (*target* (let ((s5-0 (target-pos 0))) - (if (or (>= (vector-vector-xz-distance s5-0 (-> obj root-override trans)) 102400.0) - (>= (- (-> obj root-override trans y) (-> s5-0 y)) 16384.0) + (if (or (>= (vector-vector-xz-distance s5-0 (-> this root-override trans)) 102400.0) + (>= (- (-> this root-override trans y) (-> s5-0 y)) 16384.0) ) (return #t) ) @@ -418,7 +418,7 @@ :trans plat-trans :code (behavior () (set! (-> self plat-status) (the-as uint 0)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-no-eval :num! (seek! 0.0)) (until (orbit-plat-method-28 self) (when (nonzero? (-> self root-override riders num-riders)) @@ -493,7 +493,7 @@ (set! (-> s2-0 x) (* arg4 (-> s5-0 z))) (set! (-> s2-0 y) 0.0) (set! (-> s2-0 z) (- (* arg4 (-> s5-0 x)))) - (vector-normalize! s2-0 (* arg5 (-> *display* seconds-per-frame))) + (vector-normalize! s2-0 (* arg5 (seconds-per-frame))) (+! (-> s5-0 x) (-> s2-0 x)) (+! (-> s5-0 z) (-> s2-0 z)) ) @@ -514,7 +514,7 @@ (if (< arg3 f0-0) (set! f0-0 arg3) ) - (vector-normalize! (-> arg1 nav travel) (* f0-0 (-> *display* seconds-per-frame))) + (vector-normalize! (-> arg1 nav travel) (* f0-0 (seconds-per-frame))) ) (set! (-> arg0 x) (+ (-> arg1 root-override trans x) (-> arg1 nav travel x))) (set! (-> arg0 y) (-> arg1 root-override trans x)) @@ -586,9 +586,9 @@ ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs symbol. ;; WARN: disable def twice: 132. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod orbit-plat-method-27 orbit-plat ((obj orbit-plat)) +(defmethod orbit-plat-method-27 orbit-plat ((this orbit-plat)) (local-vars (v0-11 object)) - (let* ((v1-0 (-> obj other)) + (let* ((v1-0 (-> this other)) (s5-0 (if v1-0 (-> v1-0 extra process) ) @@ -599,27 +599,27 @@ (cond ((and s5-0 (< (vector-vector-xz-distance (the-as vector (&-> s5-0 stack 96)) (the-as vector (&-> s5-0 stack 128))) - (vector-vector-xz-distance (-> obj basetrans) (-> obj reset-trans)) + (vector-vector-xz-distance (-> this basetrans) (-> this reset-trans)) ) ) (cond ((-> (the-as orbit-plat s5-0) is-reset?) - (when (!= (-> obj plat-status) 2) - (set! (-> obj plat-status) (the-as uint 2)) + (when (!= (-> this plat-status) 2) + (set! (-> this plat-status) (the-as uint 2)) (let ((f30-1 (atan - (- (-> obj basetrans x) (-> (the-as orbit-plat s5-0) basetrans x)) - (- (-> obj basetrans z) (-> (the-as orbit-plat s5-0) basetrans z)) + (- (-> this basetrans x) (-> (the-as orbit-plat s5-0) basetrans x)) + (- (-> this basetrans z) (-> (the-as orbit-plat s5-0) basetrans z)) ) ) (f0-9 (atan - (- (-> obj reset-trans x) (-> (the-as orbit-plat s5-0) basetrans x)) - (- (-> obj reset-trans z) (-> (the-as orbit-plat s5-0) basetrans z)) + (- (-> this reset-trans x) (-> (the-as orbit-plat s5-0) basetrans x)) + (- (-> this reset-trans z) (-> (the-as orbit-plat s5-0) basetrans z)) ) ) ) (if (>= (deg- f0-9 f30-1) 0.0) - (set! (-> obj rot-dir) 1.0) - (set! (-> obj rot-dir) -1.0) + (set! (-> this rot-dir) 1.0) + (set! (-> this rot-dir) -1.0) ) ) ) @@ -629,7 +629,7 @@ (s5-1 (new 'stack-no-clear 'vector)) ) (let ((v1-9 s4-0) - (a1-5 (-> obj other)) + (a1-5 (-> this other)) ) (set! (-> v1-9 quad) (-> (the-as orbit-plat (if a1-5 (-> a1-5 extra process) @@ -641,36 +641,36 @@ ) ) ) - (vector-! a0-7 (-> obj basetrans) s4-0) + (vector-! a0-7 (-> this basetrans) s4-0) (let ((f30-2 (vector-length a0-7))) - (get-rotate-point! s5-1 s4-0 (-> obj basetrans) (the-as vector f30-2) (-> obj rot-dir) 40960.0) + (get-rotate-point! s5-1 s4-0 (-> this basetrans) (the-as vector f30-2) (-> this rot-dir) 40960.0) (cond - ((nav-control-method-16 (-> obj nav) s5-1) - (set! (-> obj basetrans quad) (-> s5-1 quad)) + ((nav-control-method-16 (-> this nav) s5-1) + (set! (-> this basetrans quad) (-> s5-1 quad)) ) (else - (set! (-> obj rot-dir) (- (-> obj rot-dir))) - (get-rotate-point! s5-1 s4-0 (-> obj basetrans) (the-as vector f30-2) (-> obj rot-dir) 40960.0) - (if (nav-control-method-16 (-> obj nav) s5-1) - (set! (-> obj basetrans quad) (-> s5-1 quad)) + (set! (-> this rot-dir) (- (-> this rot-dir))) + (get-rotate-point! s5-1 s4-0 (-> this basetrans) (the-as vector f30-2) (-> this rot-dir) 40960.0) + (if (nav-control-method-16 (-> this nav) s5-1) + (set! (-> this basetrans quad) (-> s5-1 quad)) ) ) ) ) ) ) - (when (>= 614.4 (vector-vector-xz-distance (-> obj basetrans) (-> obj reset-trans))) - (set! v0-11 (logior (nav-control-flags navcf19) (-> obj nav flags))) - (set! (-> obj nav flags) (the-as nav-control-flags v0-11)) + (when (>= 614.4 (vector-vector-xz-distance (-> this basetrans) (-> this reset-trans))) + (set! v0-11 (logior (nav-control-flags navcf19) (-> this nav flags))) + (set! (-> this nav flags) (the-as nav-control-flags v0-11)) v0-11 ) ) (else (let ((s5-2 (new 'stack-no-clear 'vector))) (let ((s4-1 (new 'stack-no-clear 'vector))) - (get-nav-point! s5-2 obj (-> obj reset-trans) 40960.0) + (get-nav-point! s5-2 this (-> this reset-trans) 40960.0) (let ((v1-20 s4-1) - (a0-19 (-> obj other)) + (a0-19 (-> this other)) ) (set! (-> v1-20 quad) (-> (the-as orbit-plat (if a0-19 (-> a0-19 extra process) @@ -684,36 +684,36 @@ ) (set! (-> s5-2 y) (-> s4-1 y)) (vector-! s5-2 s5-2 s4-1) - (vector-normalize! s5-2 (-> obj reset-length)) + (vector-normalize! s5-2 (-> this reset-length)) (vector+! s5-2 s5-2 s4-1) - (when (not (nav-control-method-16 (-> obj nav) s5-2)) - (logclear! (-> obj nav flags) (nav-control-flags navcf19)) - (get-rotate-point! s5-2 s4-1 (-> obj basetrans) (the-as vector (-> obj reset-length)) 0.0 40960.0) - (when (not (nav-control-method-16 (-> obj nav) s5-2)) + (when (not (nav-control-method-16 (-> this nav) s5-2)) + (logclear! (-> this nav flags) (nav-control-flags navcf19)) + (get-rotate-point! s5-2 s4-1 (-> this basetrans) (the-as vector (-> this reset-length)) 0.0 40960.0) + (when (not (nav-control-method-16 (-> this nav) s5-2)) (get-rotate-point! s5-2 s4-1 - (-> obj basetrans) - (the-as vector (-> obj reset-length)) - (-> obj rot-dir) + (-> this basetrans) + (the-as vector (-> this reset-length)) + (-> this rot-dir) 40960.0 ) - (when (not (nav-control-method-16 (-> obj nav) s5-2)) - (set! (-> obj rot-dir) (- (-> obj rot-dir))) + (when (not (nav-control-method-16 (-> this nav) s5-2)) + (set! (-> this rot-dir) (- (-> this rot-dir))) (get-rotate-point! s5-2 s4-1 - (-> obj basetrans) - (the-as vector (-> obj reset-length)) - (-> obj rot-dir) + (-> this basetrans) + (the-as vector (-> this reset-length)) + (-> this rot-dir) 40960.0 ) ) ) ) ) - (set! (-> s5-2 y) (-> obj basetrans y)) - (set! v0-11 (-> obj basetrans)) + (set! (-> s5-2 y) (-> this basetrans y)) + (set! v0-11 (-> this basetrans)) (set! (-> (the-as vector v0-11) quad) (-> s5-2 quad)) ) v0-11 @@ -722,9 +722,9 @@ ) (else (let ((s5-3 (new 'stack-no-clear 'vector))) - (set! (-> s5-3 quad) (-> obj basetrans quad)) - (get-nav-point! (-> obj basetrans) obj (-> obj reset-trans) 40960.0) - (set! (-> obj basetrans y) (-> s5-3 y)) + (set! (-> s5-3 quad) (-> this basetrans quad)) + (get-nav-point! (-> this basetrans) this (-> this reset-trans) 40960.0) + (set! (-> this basetrans y) (-> s5-3 y)) ) ) ) @@ -806,10 +806,10 @@ ;; definition for method 11 of type orbit-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! orbit-plat ((obj orbit-plat) (arg0 entity-actor)) - (set! (-> obj plat-status) (the-as uint 0)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! orbit-plat ((this orbit-plat) (arg0 entity-actor)) + (set! (-> this plat-status) (the-as uint 0)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -827,35 +827,35 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *orbit-plat-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *orbit-plat-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj nav gap-event) 'blocked) - (set! (-> obj other) (entity-actor-lookup arg0 'alt-actor 0)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this nav gap-event) 'blocked) + (set! (-> this other) (entity-actor-lookup arg0 'alt-actor 0)) (let ((f0-7 (res-lump-float arg0 'scale :default 1.0))) - (set-vector! (-> obj root-override scale) f0-7 f0-7 f0-7 1.0) + (set-vector! (-> this root-override scale) f0-7 f0-7 f0-7 1.0) ) - (set! (-> obj timeout) (res-lump-float arg0 'timeout :default 10.0)) - (set! (-> obj rot-dir) 1.0) - (set! (-> obj reset-trans quad) (-> obj basetrans quad)) - (set! (-> obj is-reset?) #t) - (process-spawn orbit-plat-bottom (-> obj entity) obj :to obj) + (set! (-> this timeout) (res-lump-float arg0 'timeout :default 10.0)) + (set! (-> this rot-dir) 1.0) + (set! (-> this reset-trans quad) (-> this basetrans quad)) + (set! (-> this is-reset?) #t) + (process-spawn orbit-plat-bottom (-> this entity) this :to this) (go orbit-plat-wait-for-other) (none) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc index d8d845c7ea..4ddaea648f 100644 --- a/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/puffer_REF.gc @@ -60,38 +60,38 @@ ) ;; definition for method 3 of type puffer -(defmethod inspect puffer ((obj puffer)) +(defmethod inspect puffer ((this puffer)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpath-index: ~D~%" (-> obj path-index)) - (format #t "~T~Tfacing-ry: ~f~%" (-> obj facing-ry)) - (format #t "~T~Ttravel-ry: ~f~%" (-> obj travel-ry)) - (format #t "~T~Ttravel-speed: ~f~%" (-> obj travel-speed)) - (format #t "~T~Tattack-bottom-y: ~f~%" (-> obj attack-bottom-y)) - (format #t "~T~Tpatrol-bottom-y: ~f~%" (-> obj patrol-bottom-y)) - (format #t "~T~Ttop-y: ~f~%" (-> obj top-y)) - (format #t "~T~Ttarg-trans-y: ~f~%" (-> obj targ-trans-y)) - (format #t "~T~Tacc-y: ~f~%" (-> obj acc-y)) - (format #t "~T~Ttravel-turn-speed: ~f~%" (-> obj travel-turn-speed)) - (format #t "~T~Tnotice-dist: ~f~%" (-> obj notice-dist)) - (format #t "~T~Tgive-up-dist: ~f~%" (-> obj give-up-dist)) - (format #t "~T~Tattacking?: ~A~%" (-> obj attacking?)) - (format #t "~T~Thit-player?: ~A~%" (-> obj hit-player?)) - (format #t "~T~Tlook-mean?: ~A~%" (-> obj look-mean?)) - (format #t "~T~Tcprims-type: ~D~%" (-> obj cprims-type)) - (format #t "~T~Tneck: ~A~%" (-> obj neck)) - (format #t "~T~Thit-player-time: ~D~%" (-> obj hit-player-time)) - (format #t "~T~Treaction-delay: ~D~%" (-> obj reaction-delay)) - (format #t "~T~Tpicked-point-time: ~D~%" (-> obj picked-point-time)) - (format #t "~T~Tpick-new-point-delay: ~D~%" (-> obj pick-new-point-delay)) - (format #t "~T~Tlast-on-screen-time: ~D~%" (-> obj last-on-screen-time)) - (format #t "~T~Tbuddy: ~A~%" (-> obj buddy)) - (format #t "~T~Tnice-look: #~%" (-> obj nice-look)) - (format #t "~T~Tmean-look: #~%" (-> obj mean-look)) - (format #t "~T~Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - obj + (format #t "~T~Tpath-index: ~D~%" (-> this path-index)) + (format #t "~T~Tfacing-ry: ~f~%" (-> this facing-ry)) + (format #t "~T~Ttravel-ry: ~f~%" (-> this travel-ry)) + (format #t "~T~Ttravel-speed: ~f~%" (-> this travel-speed)) + (format #t "~T~Tattack-bottom-y: ~f~%" (-> this attack-bottom-y)) + (format #t "~T~Tpatrol-bottom-y: ~f~%" (-> this patrol-bottom-y)) + (format #t "~T~Ttop-y: ~f~%" (-> this top-y)) + (format #t "~T~Ttarg-trans-y: ~f~%" (-> this targ-trans-y)) + (format #t "~T~Tacc-y: ~f~%" (-> this acc-y)) + (format #t "~T~Ttravel-turn-speed: ~f~%" (-> this travel-turn-speed)) + (format #t "~T~Tnotice-dist: ~f~%" (-> this notice-dist)) + (format #t "~T~Tgive-up-dist: ~f~%" (-> this give-up-dist)) + (format #t "~T~Tattacking?: ~A~%" (-> this attacking?)) + (format #t "~T~Thit-player?: ~A~%" (-> this hit-player?)) + (format #t "~T~Tlook-mean?: ~A~%" (-> this look-mean?)) + (format #t "~T~Tcprims-type: ~D~%" (-> this cprims-type)) + (format #t "~T~Tneck: ~A~%" (-> this neck)) + (format #t "~T~Thit-player-time: ~D~%" (-> this hit-player-time)) + (format #t "~T~Treaction-delay: ~D~%" (-> this reaction-delay)) + (format #t "~T~Tpicked-point-time: ~D~%" (-> this picked-point-time)) + (format #t "~T~Tpick-new-point-delay: ~D~%" (-> this pick-new-point-delay)) + (format #t "~T~Tlast-on-screen-time: ~D~%" (-> this last-on-screen-time)) + (format #t "~T~Tbuddy: ~A~%" (-> this buddy)) + (format #t "~T~Tnice-look: #~%" (-> this nice-look)) + (format #t "~T~Tmean-look: #~%" (-> this mean-look)) + (format #t "~T~Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~T~Tsync: #~%" (-> this sync)) + this ) ;; failed to figure out what this is: @@ -143,7 +143,7 @@ (static-attack-info ((shove-up (meters 1.5)) (shove-back (meters 2.5)))) ) (set! (-> self hit-player?) #t) - (set! (-> self hit-player-time) (-> *display* base-frame-counter)) + (set-time! (-> self hit-player-time)) (set-collide-offense (-> self root-override) 2 (collide-offense no-offense)) ) ) @@ -160,7 +160,7 @@ (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (>= (- (-> *display* base-frame-counter) (-> self hit-player-time)) (seconds 0.05)) + (time-elapsed? (-> self hit-player-time) (seconds 0.05)) ) ) ) @@ -174,17 +174,17 @@ ;; definition for method 28 of type puffer ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod puffer-method-28 puffer ((obj puffer)) +(defmethod puffer-method-28 puffer ((this puffer)) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result)) (a1-0 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-0 quad) (-> obj root-override trans quad)) + (set! (-> a1-0 quad) (-> this root-override trans quad)) (set-vector! a2-0 0.0 -40960.0 0.0 1.0) (cond ((>= (fill-and-probe-using-line-sphere @@ -193,27 +193,27 @@ a2-0 8192.0 (collide-kind background cak-3 ground-object) - obj + this s5-0 (new 'static 'pat-surface :noentity #x1) ) 0.0 ) - (let ((v1-11 (-> obj draw shadow-ctrl))) + (let ((v1-11 (-> this draw shadow-ctrl))) (logclear! (-> v1-11 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (set! (-> v1-14 settings bot-plane w) (- (+ -12288.0 (-> s5-0 intersect y)))) ) 0 - (let ((v1-17 (-> obj draw shadow-ctrl))) + (let ((v1-17 (-> this draw shadow-ctrl))) (set! (-> v1-17 settings top-plane w) (- (+ 4096.0 (-> s5-0 intersect y)))) ) 0 ) (else - (let ((v1-19 (-> obj draw shadow-ctrl))) + (let ((v1-19 (-> this draw shadow-ctrl))) (logior! (-> v1-19 settings flags) (shadow-flags disable-draw)) ) 0 @@ -222,7 +222,7 @@ ) ) (else - (let ((v1-21 (-> obj draw shadow-ctrl))) + (let ((v1-21 (-> this draw shadow-ctrl))) (logior! (-> v1-21 settings flags) (shadow-flags disable-draw)) ) 0 @@ -232,15 +232,15 @@ ) ;; definition for method 24 of type puffer -(defmethod puffer-method-24 puffer ((obj puffer) (arg0 vector)) - (and (is-in-mesh? (-> obj nav) arg0 11468.8) - (< (-> arg0 y) (+ (-> obj root-override trans y) (-> obj fact-info-override notice-top))) +(defmethod puffer-method-24 puffer ((this puffer) (arg0 vector)) + (and (is-in-mesh? (-> this nav) arg0 11468.8) + (< (-> arg0 y) (+ (-> this root-override trans y) (-> this fact-info-override notice-top))) ) ) ;; definition for method 22 of type puffer -(defmethod puffer-method-22 puffer ((obj puffer)) - (let* ((a1-0 (-> obj buddy)) +(defmethod puffer-method-22 puffer ((this puffer)) + (let* ((a1-0 (-> this buddy)) (v1-0 (if a1-0 (-> a1-0 ppointer 3) ) @@ -248,7 +248,7 @@ ) (if (and v1-0 (>= 25395.2 - (vector-vector-xz-distance (-> obj root-override trans) (-> (the-as process-drawable v1-0) root trans)) + (vector-vector-xz-distance (-> this root-override trans) (-> (the-as process-drawable v1-0) root trans)) ) ) (return #t) @@ -258,20 +258,20 @@ ) ;; definition for method 25 of type puffer -(defmethod puffer-method-25 puffer ((obj puffer) (arg0 float)) +(defmethod puffer-method-25 puffer ((this puffer) (arg0 float)) (when *target* (let ((gp-0 (target-pos 0))) (when (and (not (logtest? (-> *target* state-flags) (state-flags being-attacked invulnerable timed-invulnerable invuln-powerup do-not-notice dying) ) ) - (puffer-method-24 obj gp-0) - (>= (-> gp-0 y) (+ -14336.0 (-> obj attack-bottom-y))) - (>= (+ 2048.0 (-> obj top-y)) (-> gp-0 y)) + (puffer-method-24 this gp-0) + (>= (-> gp-0 y) (+ -14336.0 (-> this attack-bottom-y))) + (>= (+ 2048.0 (-> this top-y)) (-> gp-0 y)) ) - (let ((f30-0 (vector-vector-xz-distance gp-0 (-> obj root-override trans)))) + (let ((f30-0 (vector-vector-xz-distance gp-0 (-> this root-override trans)))) (when (>= arg0 f30-0) - (let* ((a0-4 (-> obj buddy)) + (let* ((a0-4 (-> this buddy)) (v1-12 (if a0-4 (-> a0-4 ppointer 3) ) @@ -314,23 +314,23 @@ ) ;; definition for method 3 of type pick-patrol-point-away-from-buddy-work -(defmethod inspect pick-patrol-point-away-from-buddy-work ((obj pick-patrol-point-away-from-buddy-work)) - (format #t "[~8x] ~A~%" obj 'pick-patrol-point-away-from-buddy-work) - (format #t "~Tbest-path-index: ~D~%" (-> obj best-path-index)) - (format #t "~Tbest-rating: ~f~%" (-> obj best-rating)) - (format #t "~Tbest-dest: #~%" (-> obj best-dest)) - (format #t "~Tpt-dir: #~%" (-> obj pt-dir)) - (format #t "~Tbuddy-dir: #~%" (-> obj buddy-dir)) - (format #t "~Tdest: #~%" (-> obj dest)) - obj +(defmethod inspect pick-patrol-point-away-from-buddy-work ((this pick-patrol-point-away-from-buddy-work)) + (format #t "[~8x] ~A~%" this 'pick-patrol-point-away-from-buddy-work) + (format #t "~Tbest-path-index: ~D~%" (-> this best-path-index)) + (format #t "~Tbest-rating: ~f~%" (-> this best-rating)) + (format #t "~Tbest-dest: #~%" (-> this best-dest)) + (format #t "~Tpt-dir: #~%" (-> this pt-dir)) + (format #t "~Tbuddy-dir: #~%" (-> this buddy-dir)) + (format #t "~Tdest: #~%" (-> this dest)) + this ) ;; definition for method 23 of type puffer ;; INFO: Used lq/sq -(defmethod puffer-method-23 puffer ((obj puffer) (arg0 symbol)) +(defmethod puffer-method-23 puffer ((this puffer) (arg0 symbol)) (local-vars (v1-0 process)) (set! v1-0 (when arg0 - (let ((a0-1 (-> obj buddy))) + (let ((a0-1 (-> this buddy))) (set! v1-0 (if a0-1 (-> a0-1 ppointer 3) ) @@ -344,16 +344,16 @@ ) (cond (arg0 - (let ((s4-0 (-> obj path curve num-cverts)) + (let ((s4-0 (-> this path curve num-cverts)) (s5-0 (new 'stack-no-clear 'inline-array 'vector 5)) ) (set! (-> s5-0 0 x) (the-as float -1)) - (vector-! (-> s5-0 3) (-> obj root-override trans) (-> (the-as process-drawable v1-0) root trans)) + (vector-! (-> s5-0 3) (-> this root-override trans) (-> (the-as process-drawable v1-0) root trans)) (set! (-> s5-0 3 y) 0.0) (vector-normalize! (-> s5-0 3) 1.0) (dotimes (s3-0 s4-0) - (eval-path-curve-div! (-> obj path) (-> s5-0 4) (the float s3-0) 'interp) - (vector-! (-> s5-0 2) (-> s5-0 4) (-> obj root-override trans)) + (eval-path-curve-div! (-> this path) (-> s5-0 4) (the float s3-0) 'interp) + (vector-! (-> s5-0 2) (-> s5-0 4) (-> this root-override trans)) (when (>= (vector-xz-length (-> s5-0 2)) 10240.0) (set! (-> s5-0 2 y) 0.0) (vector-normalize! (-> s5-0 2) 1.0) @@ -369,24 +369,24 @@ ) ) (when (>= (the-as int (-> s5-0 0 x)) 0) - (set! (-> obj dest-pos quad) (-> s5-0 1 quad)) - (set! (-> obj dest-pos y) (-> obj root-override trans y)) + (set! (-> this dest-pos quad) (-> s5-0 1 quad)) + (set! (-> this dest-pos y) (-> this root-override trans y)) (return #t) ) ) ) (else - (let* ((s3-1 (-> obj path curve num-cverts)) + (let* ((s3-1 (-> this path curve num-cverts)) (s4-1 (new 'stack-no-clear 'vector)) (s5-1 (rand-vu-int-count s3-1)) ) (while (nonzero? s3-1) (+! s3-1 -1) - (eval-path-curve-div! (-> obj path) s4-1 (the float s5-1) 'interp) - (when (>= (vector-vector-xz-distance s4-1 (-> obj root-override trans)) 10240.0) - (set! (-> obj dest-pos quad) (-> s4-1 quad)) - (set! (-> obj dest-pos y) (-> obj root-override trans y)) - (set! (-> obj path-index) s5-1) + (eval-path-curve-div! (-> this path) s4-1 (the float s5-1) 'interp) + (when (>= (vector-vector-xz-distance s4-1 (-> this root-override trans)) 10240.0) + (set! (-> this dest-pos quad) (-> s4-1 quad)) + (set! (-> this dest-pos y) (-> this root-override trans y)) + (set! (-> this path-index) s5-1) (return #t) ) ) @@ -398,50 +398,45 @@ ;; definition for method 20 of type puffer ;; INFO: Used lq/sq -(defmethod puffer-method-20 puffer ((obj puffer) (arg0 vector)) - (if (-> obj attacking?) - (set! (-> obj travel-speed) - (seek-with-smooth (-> obj travel-speed) 30720.0 (* 8192.0 (-> *display* seconds-per-frame)) 0.125 40.96) +(defmethod puffer-method-20 puffer ((this puffer) (arg0 vector)) + (if (-> this attacking?) + (set! (-> this travel-speed) + (seek-with-smooth (-> this travel-speed) 30720.0 (* 8192.0 (seconds-per-frame)) 0.125 40.96) ) - (set! (-> obj travel-speed) - (seek-with-smooth (-> obj travel-speed) 18432.0 (* 2048.0 (-> *display* seconds-per-frame)) 0.125 40.96) + (set! (-> this travel-speed) + (seek-with-smooth (-> this travel-speed) 18432.0 (* 2048.0 (seconds-per-frame)) 0.125 40.96) ) ) - (nav-control-method-27 (-> obj nav)) - (nav-control-method-28 (-> obj nav) (the-as collide-kind -1)) - (nav-control-method-13 (-> obj nav) arg0 (-> obj root-override transv)) - (let ((f30-0 (* (vector-xz-length (-> obj nav travel)) (-> *display* frames-per-second)))) - (let ((f0-11 (atan (-> obj nav travel x) (-> obj nav travel z))) + (nav-control-method-27 (-> this nav)) + (nav-control-method-28 (-> this nav) (the-as collide-kind -1)) + (nav-control-method-13 (-> this nav) arg0 (-> this root-override transv)) + (let ((f30-0 (* (vector-xz-length (-> this nav travel)) (-> *display* frames-per-second)))) + (let ((f0-11 (atan (-> this nav travel x) (-> this nav travel z))) (s5-1 (new 'stack-no-clear 'vector)) ) - (if (< (-> obj travel-speed) f30-0) - (set! f30-0 (-> obj travel-speed)) + (if (< (-> this travel-speed) f30-0) + (set! f30-0 (-> this travel-speed)) ) - (set! (-> s5-1 quad) (-> obj nav travel quad)) - (set! (-> obj travel-ry) - (deg-seek-smooth - (-> obj travel-ry) - f0-11 - (* (-> obj travel-turn-speed) (-> *display* seconds-per-frame)) - 0.125 - ) + (set! (-> s5-1 quad) (-> this nav travel quad)) + (set! (-> this travel-ry) + (deg-seek-smooth (-> this travel-ry) f0-11 (* (-> this travel-turn-speed) (seconds-per-frame)) 0.125) ) - (let* ((f0-16 (* f30-0 (-> *display* seconds-per-frame))) + (let* ((f0-16 (* f30-0 (seconds-per-frame))) (f28-0 (* 150.0 f0-16)) (f26-0 -1.0) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set-vector! s4-0 (* (sin (-> obj travel-ry)) f28-0) 0.0 (* (cos (-> obj travel-ry)) f28-0) 1.0) + (set-vector! s4-0 (* (sin (-> this travel-ry)) f28-0) 0.0 (* (cos (-> this travel-ry)) f28-0) 1.0) (let ((s3-1 (new 'stack 'clip-travel-vector-to-mesh-return-info))) - (set! (-> obj nav travel quad) (-> s4-0 quad)) - (nav-control-method-24 (-> obj nav) f28-0 s3-1) + (set! (-> this nav travel quad) (-> s4-0 quad)) + (nav-control-method-24 (-> this nav) f28-0 s3-1) (if (-> s3-1 found-boundary) - (set! f26-0 (vector-vector-xz-distance (-> s3-1 intersection) (-> obj root-override trans))) + (set! f26-0 (vector-vector-xz-distance (-> s3-1 intersection) (-> this root-override trans))) ) ) (let ((s3-2 (new 'stack-no-clear 'matrix))) - (when (>= (nav-control-method-23 (-> obj nav) s4-0 (the-as check-vector-collision-with-nav-spheres-info s3-2)) 0.0) - (let ((f0-26 (vector-vector-xz-distance (-> s3-2 vector 1) (-> obj root-override trans)))) + (when (>= (nav-control-method-23 (-> this nav) s4-0 (the-as check-vector-collision-with-nav-spheres-info s3-2)) 0.0) + (let ((f0-26 (vector-vector-xz-distance (-> s3-2 vector 1) (-> this root-override trans)))) (if (or (< f26-0 0.0) (< f0-26 f26-0)) (set! f26-0 f0-26) ) @@ -451,91 +446,91 @@ ) (when (>= f26-0 0.0) (let ((f26-1 (- 1.0 (/ f26-0 f28-0)))) - (+! (-> obj travel-ry) (* f26-1 (deg- (atan (-> s5-1 x) (-> s5-1 z)) (-> obj travel-ry)))) + (+! (-> this travel-ry) (* f26-1 (deg- (atan (-> s5-1 x) (-> s5-1 z)) (-> this travel-ry)))) ) ) ) ) (set-vector! - (-> obj root-override transv) - (* (sin (-> obj travel-ry)) f30-0) - (-> obj root-override transv y) - (* (cos (-> obj travel-ry)) f30-0) + (-> this root-override transv) + (* (sin (-> this travel-ry)) f30-0) + (-> this root-override transv y) + (* (cos (-> this travel-ry)) f30-0) 1.0 ) ) - (set! (-> obj facing-ry) - (deg-seek-smooth (-> obj facing-ry) (-> obj travel-ry) (* 32768.0 (-> *display* seconds-per-frame)) 0.125) + (set! (-> this facing-ry) + (deg-seek-smooth (-> this facing-ry) (-> this travel-ry) (* 32768.0 (seconds-per-frame)) 0.125) ) - (puffer-method-27 obj) + (puffer-method-27 this) (none) ) ;; definition for method 27 of type puffer ;; INFO: Return type mismatch float vs none. -(defmethod puffer-method-27 puffer ((obj puffer)) - (let ((f30-0 (-> obj patrol-bottom-y))) +(defmethod puffer-method-27 puffer ((this puffer)) + (let ((f30-0 (-> this patrol-bottom-y))) (cond - ((-> obj attacking?) - (let ((f30-1 (-> obj attack-bottom-y))) - (set! (-> obj targ-trans-y) (fmax (fmin (+ 4096.0 (-> (target-pos 0) y)) (-> obj top-y)) f30-1)) + ((-> this attacking?) + (let ((f30-1 (-> this attack-bottom-y))) + (set! (-> this targ-trans-y) (fmax (fmin (+ 4096.0 (-> (target-pos 0) y)) (-> this top-y)) f30-1)) ) - (set! (-> obj root-override transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> obj targ-trans-y) (-> obj root-override trans y))) + (set! (-> this root-override transv y) + (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root-override trans y))) ) - (when (< 6144.0 (fabs (-> obj root-override transv y))) - (if (>= (-> obj root-override transv y) 0.0) - (set! (-> obj root-override transv y) 6144.0) - (set! (-> obj root-override transv y) -6144.0) + (when (< 6144.0 (fabs (-> this root-override transv y))) + (if (>= (-> this root-override transv y) 0.0) + (set! (-> this root-override transv y) 6144.0) + (set! (-> this root-override transv y) -6144.0) ) ) ) - ((< (-> obj root-override trans y) f30-0) - (set! (-> obj targ-trans-y) (* 0.5 (+ (-> obj top-y) (-> obj patrol-bottom-y)))) - (set! (-> obj root-override transv y) - (* 0.125 (-> *display* frames-per-second) (- (-> obj targ-trans-y) (-> obj root-override trans y))) + ((< (-> this root-override trans y) f30-0) + (set! (-> this targ-trans-y) (* 0.5 (+ (-> this top-y) (-> this patrol-bottom-y)))) + (set! (-> this root-override transv y) + (* 0.125 (-> *display* frames-per-second) (- (-> this targ-trans-y) (-> this root-override trans y))) ) - (when (< 2048.0 (fabs (-> obj root-override transv y))) - (if (>= (-> obj root-override transv y) 0.0) - (set! (-> obj root-override transv y) 2048.0) - (set! (-> obj root-override transv y) -2048.0) + (when (< 2048.0 (fabs (-> this root-override transv y))) + (if (>= (-> this root-override transv y) 0.0) + (set! (-> this root-override transv y) 2048.0) + (set! (-> this root-override transv y) -2048.0) ) ) ) (else - (let ((f0-22 (- (-> obj targ-trans-y) (-> obj root-override trans y)))) - (when (or (and (>= f0-22 0.0) (< (-> obj acc-y) 0.0)) (and (< f0-22 0.0) (>= (-> obj acc-y) 0.0))) - (when (not (-> obj attacking?)) + (let ((f0-22 (- (-> this targ-trans-y) (-> this root-override trans y)))) + (when (or (and (>= f0-22 0.0) (< (-> this acc-y) 0.0)) (and (< f0-22 0.0) (>= (-> this acc-y) 0.0))) + (when (not (-> this attacking?)) (cond - ((>= (-> obj acc-y) 0.0) - (if (< f30-0 (-> obj targ-trans-y)) - (set! (-> obj targ-trans-y) (rand-vu-float-range f30-0 (-> obj targ-trans-y))) + ((>= (-> this acc-y) 0.0) + (if (< f30-0 (-> this targ-trans-y)) + (set! (-> this targ-trans-y) (rand-vu-float-range f30-0 (-> this targ-trans-y))) ) ) (else - (if (< (-> obj targ-trans-y) (-> obj top-y)) - (set! (-> obj targ-trans-y) (rand-vu-float-range (-> obj targ-trans-y) (-> obj top-y))) + (if (< (-> this targ-trans-y) (-> this top-y)) + (set! (-> this targ-trans-y) (rand-vu-float-range (-> this targ-trans-y) (-> this top-y))) ) ) ) ) - (set! (-> obj acc-y) (- (-> obj acc-y))) + (set! (-> this acc-y) (- (-> this acc-y))) ) ) - (+! (-> obj root-override transv y) (* (-> obj acc-y) (-> *display* seconds-per-frame))) - (let ((f0-37 (* (-> obj root-override transv y) (-> *display* seconds-per-frame)))) + (+! (-> this root-override transv y) (* (-> this acc-y) (seconds-per-frame))) + (let ((f0-37 (* (-> this root-override transv y) (seconds-per-frame)))) (cond ((>= f0-37 0.0) - (let ((f1-27 (* 0.0625 (- (-> obj top-y) (-> obj root-override trans y))))) + (let ((f1-27 (* 0.0625 (- (-> this top-y) (-> this root-override trans y))))) (if (< f1-27 f0-37) - (set! (-> obj root-override transv y) (* f1-27 (-> *display* frames-per-second))) + (set! (-> this root-override transv y) (* f1-27 (-> *display* frames-per-second))) ) ) ) (else - (let ((f1-29 (* 0.0625 (- f30-0 (-> obj root-override trans y))))) + (let ((f1-29 (* 0.0625 (- f30-0 (-> this root-override trans y))))) (if (< f0-37 f1-29) - (set! (-> obj root-override transv y) (* f1-29 (-> *display* frames-per-second))) + (set! (-> this root-override transv y) (* f1-29 (-> *display* frames-per-second))) ) ) ) @@ -551,7 +546,7 @@ (defstate puffer-idle (puffer) :event puffer-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self attacking?) #f) (shut-down! (-> self neck)) (let ((v1-5 (-> self draw shadow-ctrl))) @@ -566,7 +561,7 @@ ) ) (logtest? (-> self draw status) (draw-status was-drawn)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (time-elapsed? (-> self state-time) (seconds 0.2)) ) (go puffer-patrol) ) @@ -581,15 +576,15 @@ (defstate puffer-patrol (puffer) :event puffer-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self attacking?) #f) (set! (-> self reaction-delay) (rand-vu-int-range (seconds 0.1) (seconds 0.35))) (if (not (puffer-method-23 self #f)) (go puffer-idle) ) - (set! (-> self picked-point-time) (-> *display* base-frame-counter)) + (set-time! (-> self picked-point-time)) (set! (-> self pick-new-point-delay) (rand-vu-int-range (seconds 3) (seconds 10))) - (set! (-> self last-on-screen-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-on-screen-time)) ) :trans (behavior () (if (and (not (and *target* (>= (-> self fact-info-override idle-distance) @@ -597,36 +592,36 @@ ) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) ) (go puffer-idle) ) (cond ((logtest? (-> self draw status) (draw-status was-drawn)) - (set! (-> self last-on-screen-time) (-> *display* base-frame-counter)) + (set-time! (-> self last-on-screen-time)) ) (else - (if (>= (- (-> *display* base-frame-counter) (-> self last-on-screen-time)) (seconds 8)) + (if (time-elapsed? (-> self last-on-screen-time) (seconds 8)) (go puffer-idle) ) ) ) (when (puffer-method-22 self) (when (puffer-method-23 self #t) - (set! (-> self picked-point-time) (-> *display* base-frame-counter)) + (set-time! (-> self picked-point-time)) (set! (-> self pick-new-point-delay) (rand-vu-int-range (seconds 3) (seconds 10))) ) ) - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-delay)) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-delay)) (puffer-method-25 self (-> self notice-dist)) ) (go puffer-attack) ) (when (or (< (vector-vector-xz-distance (-> self root-override trans) (-> self dest-pos)) 8192.0) - (>= (- (-> *display* base-frame-counter) (-> self picked-point-time)) (-> self pick-new-point-delay)) + (time-elapsed? (-> self picked-point-time) (-> self pick-new-point-delay)) ) (when (puffer-method-23 self #f) - (set! (-> self picked-point-time) (-> *display* base-frame-counter)) + (set-time! (-> self picked-point-time)) (set! (-> self pick-new-point-delay) (rand-vu-int-range (seconds 3) (seconds 10))) ) ) @@ -652,7 +647,7 @@ :event puffer-default-event-handler :enter (behavior () (set! (-> self attacking?) #t) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self travel-turn-speed) 21845.334) ) :exit (behavior () @@ -727,8 +722,8 @@ ;; definition for method 21 of type puffer ;; INFO: Return type mismatch int vs none. -(defmethod puffer-method-21 puffer ((obj puffer)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod puffer-method-21 puffer ((this puffer)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -766,30 +761,30 @@ ) (set! (-> s5-0 nav-radius) 12288.0) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (puffer-method-30 obj) + (puffer-method-30 this) 0 (none) ) ;; definition for method 29 of type puffer -(defmethod flip-look! puffer ((obj puffer) (arg0 symbol)) - (when (!= arg0 (-> obj look-mean?)) - (set! (-> obj look-mean?) arg0) +(defmethod flip-look! puffer ((this puffer) (arg0 symbol)) + (when (!= arg0 (-> this look-mean?)) + (set! (-> this look-mean?) arg0) (if arg0 - (lods-assign! (-> obj draw) (-> obj mean-look)) - (lods-assign! (-> obj draw) (-> obj nice-look)) + (lods-assign! (-> this draw) (-> this mean-look)) + (lods-assign! (-> this draw) (-> this nice-look)) ) ) (none) ) ;; definition for method 30 of type puffer -(defmethod puffer-method-30 puffer ((obj puffer)) - (when (!= (-> obj cprims-type) 1) - (set! (-> obj cprims-type) (the-as uint 1)) - (let ((v1-3 (the-as basic (-> obj root-override root-prim)))) +(defmethod puffer-method-30 puffer ((this puffer)) + (when (!= (-> this cprims-type) 1) + (set! (-> this cprims-type) (the-as uint 1)) + (let ((v1-3 (the-as basic (-> this root-override root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-3) local-sphere) 0.0 6144.0 0.0 18432.0) (let ((v0-0 (-> (the-as (array collide-shape-prim) v1-3) 17 local-sphere))) (set! (-> v0-0 x) 0.0) @@ -803,10 +798,10 @@ ) ;; definition for method 31 of type puffer -(defmethod puffer-method-31 puffer ((obj puffer)) - (when (!= (-> obj cprims-type) 2) - (set! (-> obj cprims-type) (the-as uint 2)) - (let ((v1-3 (the-as basic (-> obj root-override root-prim)))) +(defmethod puffer-method-31 puffer ((this puffer)) + (when (!= (-> this cprims-type) 2) + (set! (-> this cprims-type) (the-as uint 2)) + (let ((v1-3 (the-as basic (-> this root-override root-prim)))) (set-vector! (-> (the-as collide-shape-prim v1-3) local-sphere) 0.0 6144.0 0.0 18432.0) (let ((v0-0 (-> (the-as (array collide-shape-prim) v1-3) 17 local-sphere))) (set! (-> v0-0 x) 0.0) @@ -821,50 +816,50 @@ ;; definition for method 26 of type puffer ;; INFO: Return type mismatch vector vs none. -(defmethod puffer-method-26 puffer ((obj puffer)) - (let ((f30-0 (get-current-phase (-> obj sync)))) +(defmethod puffer-method-26 puffer ((this puffer)) + (let ((f30-0 (get-current-phase (-> this sync)))) (if (and (< 0.025 f30-0) (< f30-0 0.525)) - (flip-look! obj #f) - (flip-look! obj #t) + (flip-look! this #f) + (flip-look! this #t) ) (cond ((< f30-0 0.5) (cond - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 9) + (-> this draw art-group data 9) ) (cond - ((-> obj attacking?) + ((-> this attacking?) (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-0 (-> obj skel root-channel 0))) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 11)) + (the-as art-joint-anim (-> this draw art-group data 11)) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 param 0) (the float (+ (-> a0-10 frame-group data 0 length) -1))) (set! (-> a0-10 param 1) 1.0) (joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-seek!) ) ) ((ja-done? 0) - (let ((v1-28 (-> obj skel root-channel 0))) + (let ((v1-28 (-> this skel root-channel 0))) (set! (-> v1-28 num-func) num-func-identity) (set! (-> v1-28 frame-num) 0.0) ) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 param 0) (the float (+ (-> a0-13 frame-group data 0 length) -1))) (set! (-> a0-13 param 1) 1.0) (joint-control-channel-group! a0-13 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group data 0 length) -1))) (set! (-> a0-14 param 1) 1.0) (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) @@ -872,41 +867,41 @@ ) ) ) - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 11) + (-> this draw art-group data 11) ) (cond - ((not (-> obj attacking?)) + ((not (-> this attacking?)) (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 9)) + (the-as art-joint-anim (-> this draw art-group data 9)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) - (let ((a0-21 (-> obj skel root-channel 0))) + (let ((a0-21 (-> this skel root-channel 0))) (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) (set! (-> a0-21 param 1) 1.0) (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-seek!) ) ) ((ja-done? 0) - (let ((v1-64 (-> obj skel root-channel 0))) + (let ((v1-64 (-> this skel root-channel 0))) (set! (-> v1-64 num-func) num-func-identity) (set! (-> v1-64 frame-num) 0.0) ) - (let ((a0-24 (-> obj skel root-channel 0))) + (let ((a0-24 (-> this skel root-channel 0))) (set! (-> a0-24 param 0) (the float (+ (-> a0-24 frame-group data 0 length) -1))) (set! (-> a0-24 param 1) 1.0) (joint-control-channel-group! a0-24 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-25 (-> obj skel root-channel 0))) + (let ((a0-25 (-> this skel root-channel 0))) (set! (-> a0-25 param 0) (the float (+ (-> a0-25 frame-group data 0 length) -1))) (set! (-> a0-25 param 1) 1.0) (joint-control-channel-group-eval! a0-25 (the-as art-joint-anim #f) num-func-seek!) @@ -914,44 +909,44 @@ ) ) ) - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 14) + (-> this draw art-group data 14) ) (cond ((ja-done? 0) (ja-channel-push! 1 (seconds 0.2)) (cond - ((-> obj attacking?) - (let ((s5-2 (-> obj skel root-channel 0))) + ((-> this attacking?) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 11)) + (the-as art-joint-anim (-> this draw art-group data 11)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) ) (else - (let ((s5-3 (-> obj skel root-channel 0))) + (let ((s5-3 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-3 - (the-as art-joint-anim (-> obj draw art-group data 9)) + (the-as art-joint-anim (-> this draw art-group data 9)) num-func-identity ) (set! (-> s5-3 frame-num) 0.0) ) ) ) - (let ((a0-34 (-> obj skel root-channel 0))) + (let ((a0-34 (-> this skel root-channel 0))) (set! (-> a0-34 param 0) (the float (+ (-> a0-34 frame-group data 0 length) -1))) (set! (-> a0-34 param 1) 1.0) (joint-control-channel-group! a0-34 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-35 (-> obj skel root-channel 0))) + (let ((a0-35 (-> this skel root-channel 0))) (set! (-> a0-35 param 0) (the float (+ (-> a0-35 frame-group data 0 length) -1))) (set! (-> a0-35 param 1) 1.0) (joint-control-channel-group-eval! a0-35 (the-as art-joint-anim #f) num-func-seek!) @@ -961,15 +956,15 @@ ) (else (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-4 (-> obj skel root-channel 0))) + (let ((s5-4 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-4 - (the-as art-joint-anim (-> obj draw art-group data 14)) + (the-as art-joint-anim (-> this draw art-group data 14)) num-func-identity ) (set! (-> s5-4 frame-num) 0.0) ) - (let ((a0-38 (-> obj skel root-channel 0))) + (let ((a0-38 (-> this skel root-channel 0))) (set! (-> a0-38 param 0) (the float (+ (-> a0-38 frame-group data 0 length) -1))) (set! (-> a0-38 param 1) 1.0) (joint-control-channel-group! a0-38 (the-as art-joint-anim #f) num-func-seek!) @@ -977,41 +972,41 @@ ) ) ) - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 10) + (-> this draw art-group data 10) ) (cond - ((-> obj attacking?) + ((-> this attacking?) (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-5 (-> obj skel root-channel 0))) + (let ((s5-5 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-5 - (the-as art-joint-anim (-> obj draw art-group data 12)) + (the-as art-joint-anim (-> this draw art-group data 12)) num-func-identity ) (set! (-> s5-5 frame-num) 0.0) ) - (let ((a0-45 (-> obj skel root-channel 0))) + (let ((a0-45 (-> this skel root-channel 0))) (set! (-> a0-45 param 0) (the float (+ (-> a0-45 frame-group data 0 length) -1))) (set! (-> a0-45 param 1) 1.0) (joint-control-channel-group! a0-45 (the-as art-joint-anim #f) num-func-seek!) ) ) ((ja-done? 0) - (let ((v1-142 (-> obj skel root-channel 0))) + (let ((v1-142 (-> this skel root-channel 0))) (set! (-> v1-142 num-func) num-func-identity) (set! (-> v1-142 frame-num) 0.0) ) - (let ((a0-48 (-> obj skel root-channel 0))) + (let ((a0-48 (-> this skel root-channel 0))) (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group data 0 length) -1))) (set! (-> a0-48 param 1) 1.0) (joint-control-channel-group! a0-48 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-49 (-> obj skel root-channel 0))) + (let ((a0-49 (-> this skel root-channel 0))) (set! (-> a0-49 param 0) (the float (+ (-> a0-49 frame-group data 0 length) -1))) (set! (-> a0-49 param 1) 1.0) (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-seek!) @@ -1019,41 +1014,41 @@ ) ) ) - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 12) + (-> this draw art-group data 12) ) (cond - ((not (-> obj attacking?)) + ((not (-> this attacking?)) (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-6 (-> obj skel root-channel 0))) + (let ((s5-6 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-6 - (the-as art-joint-anim (-> obj draw art-group data 10)) + (the-as art-joint-anim (-> this draw art-group data 10)) num-func-identity ) (set! (-> s5-6 frame-num) 0.0) ) - (let ((a0-56 (-> obj skel root-channel 0))) + (let ((a0-56 (-> this skel root-channel 0))) (set! (-> a0-56 param 0) (the float (+ (-> a0-56 frame-group data 0 length) -1))) (set! (-> a0-56 param 1) 1.0) (joint-control-channel-group! a0-56 (the-as art-joint-anim #f) num-func-seek!) ) ) ((ja-done? 0) - (let ((v1-178 (-> obj skel root-channel 0))) + (let ((v1-178 (-> this skel root-channel 0))) (set! (-> v1-178 num-func) num-func-identity) (set! (-> v1-178 frame-num) 0.0) ) - (let ((a0-59 (-> obj skel root-channel 0))) + (let ((a0-59 (-> this skel root-channel 0))) (set! (-> a0-59 param 0) (the float (+ (-> a0-59 frame-group data 0 length) -1))) (set! (-> a0-59 param 1) 1.0) (joint-control-channel-group! a0-59 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-60 (-> obj skel root-channel 0))) + (let ((a0-60 (-> this skel root-channel 0))) (set! (-> a0-60 param 0) (the float (+ (-> a0-60 frame-group data 0 length) -1))) (set! (-> a0-60 param 1) 1.0) (joint-control-channel-group-eval! a0-60 (the-as art-joint-anim #f) num-func-seek!) @@ -1061,30 +1056,30 @@ ) ) ) - ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((= (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (-> obj draw art-group data 13) + (-> this draw art-group data 13) ) (cond ((ja-done? 0) (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-7 (-> obj skel root-channel 0))) + (let ((s5-7 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-7 - (the-as art-joint-anim (-> obj draw art-group data 10)) + (the-as art-joint-anim (-> this draw art-group data 10)) num-func-identity ) (set! (-> s5-7 frame-num) 0.0) ) - (let ((a0-68 (-> obj skel root-channel 0))) + (let ((a0-68 (-> this skel root-channel 0))) (set! (-> a0-68 param 0) (the float (+ (-> a0-68 frame-group data 0 length) -1))) (set! (-> a0-68 param 1) 1.0) (joint-control-channel-group! a0-68 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (let ((a0-69 (-> obj skel root-channel 0))) + (let ((a0-69 (-> this skel root-channel 0))) (set! (-> a0-69 param 0) (the float (+ (-> a0-69 frame-group data 0 length) -1))) (set! (-> a0-69 param 1) 1.0) (joint-control-channel-group-eval! a0-69 (the-as art-joint-anim #f) num-func-seek!) @@ -1094,15 +1089,15 @@ ) (else (ja-channel-push! 1 (seconds 0.2)) - (let ((s5-8 (-> obj skel root-channel 0))) + (let ((s5-8 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-8 - (the-as art-joint-anim (-> obj draw art-group data 13)) + (the-as art-joint-anim (-> this draw art-group data 13)) num-func-identity ) (set! (-> s5-8 frame-num) 0.0) ) - (let ((a0-72 (-> obj skel root-channel 0))) + (let ((a0-72 (-> this skel root-channel 0))) (set! (-> a0-72 param 0) (the float (+ (-> a0-72 frame-group data 0 length) -1))) (set! (-> a0-72 param 1) 1.0) (joint-control-channel-group! a0-72 (the-as art-joint-anim #f) num-func-seek!) @@ -1110,14 +1105,14 @@ ) ) ) - (case (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (case (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (((-> obj draw art-group data 10) (-> obj draw art-group data 12)) - (puffer-method-31 obj) + (((-> this draw art-group data 10) (-> this draw art-group data 12)) + (puffer-method-31 this) ) (else - (puffer-method-30 obj) + (puffer-method-30 this) ) ) (none) @@ -1125,70 +1120,70 @@ ;; definition for method 7 of type puffer ;; INFO: Return type mismatch process-drawable vs puffer. -(defmethod relocate puffer ((obj puffer) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method puffer 7)) this arg0) ) ) ;; definition for method 11 of type puffer ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! puffer ((obj puffer) (arg0 entity-actor)) +(defmethod init-from-entity! puffer ((this puffer) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj cprims-type) (the-as uint 0)) - (set! (-> obj attacking?) #f) - (set! (-> obj buddy) #f) - (set! (-> obj hit-player?) #f) - (set! (-> obj look-mean?) #f) - (set! (-> obj travel-turn-speed) 16384.0) - (puffer-method-21 obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-skeleton obj *puffer-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask enemy)) - (setup-lods! (-> obj nice-look) *puffer-sg* (-> obj draw art-group) (-> obj entity)) - (setup-lods! (-> obj mean-look) *puffer-mean-sg* (-> obj draw art-group) (-> obj entity)) - (load-params! (-> obj sync) obj (the-as uint 2400) 0.0 0.15 0.15) - (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default 57344.0)) - (set! (-> obj give-up-dist) (+ 20480.0 (-> obj notice-dist))) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (nav-control-method-26 (-> obj nav)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact-info-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this cprims-type) (the-as uint 0)) + (set! (-> this attacking?) #f) + (set! (-> this buddy) #f) + (set! (-> this hit-player?) #f) + (set! (-> this look-mean?) #f) + (set! (-> this travel-turn-speed) 16384.0) + (puffer-method-21 this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-skeleton this *puffer-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask enemy)) + (setup-lods! (-> this nice-look) *puffer-sg* (-> this draw art-group) (-> this entity)) + (setup-lods! (-> this mean-look) *puffer-mean-sg* (-> this draw art-group) (-> this entity)) + (load-params! (-> this sync) this (the-as uint 2400) 0.0 0.15 0.15) + (set! (-> this notice-dist) (res-lump-float arg0 'notice-dist :default 57344.0)) + (set! (-> this give-up-dist) (+ 20480.0 (-> this notice-dist))) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (nav-control-method-26 (-> this nav)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact-info-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) - (if (<= (-> obj path curve num-cverts) 0) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (the-as float 60) 245760.0)) + (if (<= (-> this path curve num-cverts) 0) (go process-drawable-art-error "no path") ) - (set! (-> obj buddy) (the-as process-drawable (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this buddy) (the-as process-drawable (entity-actor-lookup arg0 'alt-actor 0))) (ja-channel-set! 1) - (let ((a0-21 (-> obj skel root-channel 0))) + (let ((a0-21 (-> this skel root-channel 0))) (set! (-> a0-21 param 0) (the float (+ (-> a0-21 frame-group data 0 length) -1))) (set! (-> a0-21 param 1) 1.0) (joint-control-channel-group! a0-21 (the-as art-joint-anim #f) num-func-seek!) ) - (let ((s4-0 (-> obj skel root-channel 0))) + (let ((s4-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-0 - (the-as art-joint-anim (-> obj draw art-group data 9)) + (the-as art-joint-anim (-> this draw art-group data 9)) num-func-identity ) (set! (-> s4-0 frame-num) 0.0) ) - (set! (-> obj facing-ry) (quaternion-y-angle (-> obj root-override quat))) - (set! (-> obj travel-ry) (-> obj facing-ry)) - (set! (-> obj travel-speed) 18432.0) - (vector-reset! (-> obj root-override transv)) - (set! (-> obj patrol-bottom-y) (-> obj root-override trans y)) + (set! (-> this facing-ry) (quaternion-y-angle (-> this root-override quat))) + (set! (-> this travel-ry) (-> this facing-ry)) + (set! (-> this travel-speed) 18432.0) + (vector-reset! (-> this root-override transv)) + (set! (-> this patrol-bottom-y) (-> this root-override trans y)) (let ((f28-0 8192.0) (f30-0 -8192.0) ) @@ -1199,22 +1194,22 @@ (set! f30-0 (-> v1-54 1)) ) ) - (set! (-> obj top-y) (+ (-> obj patrol-bottom-y) f28-0)) - (set! (-> obj attack-bottom-y) (+ (-> obj patrol-bottom-y) f30-0)) + (set! (-> this top-y) (+ (-> this patrol-bottom-y) f28-0)) + (set! (-> this attack-bottom-y) (+ (-> this patrol-bottom-y) f30-0)) ) - (set! (-> obj root-override trans y) (rand-vu-float-range (-> obj patrol-bottom-y) (-> obj top-y))) - (set! (-> obj targ-trans-y) (-> obj root-override trans y)) - (set! (-> obj acc-y) 2048.0) - (let ((v1-59 (new 'process 'joint-mod (joint-mod-handler-mode reset) obj 5))) - (set! (-> obj neck) v1-59) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this root-override trans y) (rand-vu-float-range (-> this patrol-bottom-y) (-> this top-y))) + (set! (-> this targ-trans-y) (-> this root-override trans y)) + (set! (-> this acc-y) 2048.0) + (let ((v1-59 (new 'process 'joint-mod (joint-mod-handler-mode reset) this 5))) + (set! (-> this neck) v1-59) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) (set! (-> v1-59 up) (the-as uint 1)) (set! (-> v1-59 nose) (the-as uint 2)) (set! (-> v1-59 ear) (the-as uint 0)) (set! (-> v1-59 max-dist) 102400.0) (set! (-> v1-59 ignore-angle) 16384.0) ) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (go puffer-idle) (none) ) 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 01ac6e0054..1743cbb464 100644 --- a/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/qbert-plat_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type qbert-plat-on -(defmethod inspect qbert-plat-on ((obj qbert-plat-on)) +(defmethod inspect qbert-plat-on ((this qbert-plat-on)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -44,16 +44,16 @@ ) ;; definition for method 3 of type qbert-plat -(defmethod inspect qbert-plat ((obj qbert-plat)) +(defmethod inspect qbert-plat ((this qbert-plat)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tanchor-point: #~%" (-> obj anchor-point)) - (format #t "~T~Tplat-id: ~D~%" (-> obj plat-id)) - (format #t "~T~Ton?: ~A~%" (-> obj on?)) - (format #t "~T~Tplayer-is-riding?: ~A~%" (-> obj player-is-riding?)) - (format #t "~T~Tmaster: ~A~%" (-> obj master)) - obj + (format #t "~T~Tanchor-point: #~%" (-> this anchor-point)) + (format #t "~T~Tplat-id: ~D~%" (-> this plat-id)) + (format #t "~T~Ton?: ~A~%" (-> this on?)) + (format #t "~T~Tplayer-is-riding?: ~A~%" (-> this player-is-riding?)) + (format #t "~T~Tmaster: ~A~%" (-> this master)) + this ) ;; failed to figure out what this is: @@ -118,22 +118,22 @@ ) ;; definition for method 3 of type qbert-plat-master -(defmethod inspect qbert-plat-master ((obj qbert-plat-master)) +(defmethod inspect qbert-plat-master ((this qbert-plat-master)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tlast-plat-triggered: ~D~%" (-> obj last-plat-triggered)) - (format #t "~T~Tplat-states: ~D~%" (-> obj plat-states)) - (format #t "~T~Tplat-states-needed-to-open-door: ~D~%" (-> obj plat-states-needed-to-open-door)) - (format #t "~T~Tplayer-in-bounds?: ~A~%" (-> obj player-in-bounds?)) - (format #t "~T~Tplayer-in-water?: ~A~%" (-> obj player-in-water?)) - (format #t "~T~Tplay-door-cam?: ~A~%" (-> obj play-door-cam?)) - (format #t "~T~Tpuzzle-beaten?: ~A~%" (-> obj puzzle-beaten?)) - (format #t "~T~Tdoor: ~A~%" (-> obj door)) - (format #t "~T~Tdoor-plat: ~A~%" (-> obj door-plat)) - (format #t "~T~Tbounds-start: #~%" (-> obj bounds-start)) - (format #t "~T~Tbounds-end: #~%" (-> obj bounds-end)) - obj + (format #t "~T~Tlast-plat-triggered: ~D~%" (-> this last-plat-triggered)) + (format #t "~T~Tplat-states: ~D~%" (-> this plat-states)) + (format #t "~T~Tplat-states-needed-to-open-door: ~D~%" (-> this plat-states-needed-to-open-door)) + (format #t "~T~Tplayer-in-bounds?: ~A~%" (-> this player-in-bounds?)) + (format #t "~T~Tplayer-in-water?: ~A~%" (-> this player-in-water?)) + (format #t "~T~Tplay-door-cam?: ~A~%" (-> this play-door-cam?)) + (format #t "~T~Tpuzzle-beaten?: ~A~%" (-> this puzzle-beaten?)) + (format #t "~T~Tdoor: ~A~%" (-> this door)) + (format #t "~T~Tdoor-plat: ~A~%" (-> this door-plat)) + (format #t "~T~Tbounds-start: #~%" (-> this bounds-start)) + (format #t "~T~Tbounds-end: #~%" (-> this bounds-end)) + this ) ;; failed to figure out what this is: @@ -204,38 +204,38 @@ ) ;; definition for method 33 of type qbert-plat -(defmethod rigid-body-platform-method-33 qbert-plat ((obj qbert-plat)) - (let* ((a1-0 (-> obj master)) +(defmethod rigid-body-platform-method-33 qbert-plat ((this qbert-plat)) + (let* ((a1-0 (-> this master)) (v1-0 (if a1-0 (-> a1-0 extra process) ) ) ) (if v1-0 - (send-event v1-0 'trigger (-> obj plat-id)) + (send-event v1-0 'trigger (-> this plat-id)) ) ) ) ;; definition for method 32 of type qbert-plat -(defmethod rigid-body-platform-method-32 qbert-plat ((obj qbert-plat)) - (let* ((v1-0 (-> obj master)) +(defmethod rigid-body-platform-method-32 qbert-plat ((this qbert-plat)) + (let* ((v1-0 (-> this master)) (a0-1 (if v1-0 (-> v1-0 extra process) ) ) ) (when (the-as qbert-plat-master a0-1) - (let ((v1-3 (plat-state-set? (the-as qbert-plat-master a0-1) (the-as uint (-> obj plat-id))))) - (when (!= v1-3 (-> obj on?)) - (set! (-> obj on?) v1-3) + (let ((v1-3 (plat-state-set? (the-as qbert-plat-master a0-1) (the-as uint (-> this plat-id))))) + (when (!= v1-3 (-> this on?)) + (set! (-> this on?) v1-3) (cond (v1-3 - (process-spawn qbert-plat-on (-> obj entity) obj :to obj) + (process-spawn qbert-plat-on (-> this entity) this :to this) (sound-play "plat-light-on") ) (else - (let ((gp-2 (-> obj child))) + (let ((gp-2 (-> this child))) (while gp-2 (send-event (ppointer->process gp-2) 'die) (set! gp-2 (-> gp-2 0 brother)) @@ -318,26 +318,26 @@ ) ;; definition for method 22 of type qbert-plat -(defmethod rigid-body-platform-method-22 qbert-plat ((obj qbert-plat) (arg0 vector) (arg1 float)) - (+ (-> obj anchor-point y) - (-> obj float-height-offset) +(defmethod rigid-body-platform-method-22 qbert-plat ((this qbert-plat) (arg0 vector) (arg1 float)) + (+ (-> this anchor-point y) + (-> this float-height-offset) (* 512.0 (cos (* 546.13336 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z)))))) ) ) ;; definition for method 23 of type qbert-plat ;; INFO: Return type mismatch int vs none. -(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) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) +(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) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) ;; definition for method 30 of type qbert-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 qbert-plat ((obj qbert-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod rigid-body-platform-method-30 qbert-plat ((this qbert-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -355,7 +355,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -364,60 +364,60 @@ ;; definition for method 31 of type qbert-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 qbert-plat ((obj qbert-plat)) - (initialize-skeleton obj *qbert-plat-sg* '()) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-overlay)) - (rigid-body-platform-method-29 obj *qbert-plat-constants*) - (set! (-> obj float-height-offset) 6144.0) - (let ((v1-11 (-> obj control-point-array data))) +(defmethod rigid-body-platform-method-31 qbert-plat ((this qbert-plat)) + (initialize-skeleton this *qbert-plat-sg* '()) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-overlay)) + (rigid-body-platform-method-29 this *qbert-plat-constants*) + (set! (-> this float-height-offset) 6144.0) + (let ((v1-11 (-> this control-point-array data))) (set! (-> v1-11 0 local-pos x) -14336.0) (set! (-> v1-11 0 local-pos y) 0.0) (set! (-> v1-11 0 local-pos z) -14336.0) (set! (-> v1-11 0 local-pos w) 1.0) ) - (let ((v1-13 (-> obj control-point-array data 1))) + (let ((v1-13 (-> this control-point-array data 1))) (set! (-> v1-13 local-pos x) -14336.0) (set! (-> v1-13 local-pos y) 0.0) (set! (-> v1-13 local-pos z) 14336.0) (set! (-> v1-13 local-pos w) 1.0) ) - (let ((v1-15 (-> obj control-point-array data 2))) + (let ((v1-15 (-> this control-point-array data 2))) (set! (-> v1-15 local-pos x) 14336.0) (set! (-> v1-15 local-pos y) 0.0) (set! (-> v1-15 local-pos z) 14336.0) (set! (-> v1-15 local-pos w) 1.0) ) - (let ((v1-17 (-> obj control-point-array data 3))) + (let ((v1-17 (-> this control-point-array data 3))) (set! (-> v1-17 local-pos x) 14336.0) (set! (-> v1-17 local-pos y) 0.0) (set! (-> v1-17 local-pos z) -14336.0) (set! (-> v1-17 local-pos w) 1.0) ) - (set! (-> obj on?) #f) - (set! (-> obj player-is-riding?) #f) - (set! (-> obj master) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj plat-id) (actor-count-before (-> obj link))) + (set! (-> this on?) #f) + (set! (-> this player-is-riding?) #f) + (set! (-> this master) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this plat-id) (actor-count-before (-> this link))) 0 (none) ) ;; definition for method 11 of type qbert-plat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! qbert-plat ((obj qbert-plat) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) +(defmethod init-from-entity! qbert-plat ((this qbert-plat) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) (go qbert-plat-wait-for-master) (none) ) ;; definition for method 20 of type qbert-plat-master -(defmethod plat-state-set? qbert-plat-master ((obj qbert-plat-master) (arg0 uint)) - (logtest? (-> obj plat-states) (ash 1 arg0)) +(defmethod plat-state-set? qbert-plat-master ((this qbert-plat-master) (arg0 uint)) + (logtest? (-> this plat-states) (ash 1 arg0)) ) ;; failed to figure out what this is: @@ -653,19 +653,19 @@ ) (go qbert-plat-master-idle) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (cond (arg0 (ambient-hint-spawn "gamcam08" (the-as vector #f) *entity-pool* 'camera) (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "qbert-show-door-open" 0 #f '() :to self) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.4)) + (until (time-elapsed? (-> self state-time) (seconds 1.4)) (suspend) ) ) (else (ambient-hint-spawn "gamcam07" (the-as vector #f) *entity-pool* 'camera) (process-spawn pov-camera (-> self root trans) *sunkencam-sg* "qbert-show-door-close" 0 #f '() :to self) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) @@ -773,30 +773,30 @@ ;; definition for method 11 of type qbert-plat-master ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! qbert-plat-master ((obj qbert-plat-master) (arg0 entity-actor)) - (set! (-> obj last-plat-triggered) -1) - (set! (-> obj player-in-water?) #f) - (set! (-> obj player-in-bounds?) #f) - (set! (-> obj play-door-cam?) #t) - (set! (-> obj puzzle-beaten?) #f) - (set! (-> obj plat-states) (the-as uint 0)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj plat-states-needed-to-open-door) - (the-as uint (get-matching-actor-type-mask (-> obj link) qbert-plat)) +(defmethod init-from-entity! qbert-plat-master ((this qbert-plat-master) (arg0 entity-actor)) + (set! (-> this last-plat-triggered) -1) + (set! (-> this player-in-water?) #f) + (set! (-> this player-in-bounds?) #f) + (set! (-> this play-door-cam?) #t) + (set! (-> this puzzle-beaten?) #f) + (set! (-> this plat-states) (the-as uint 0)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this plat-states-needed-to-open-door) + (the-as uint (get-matching-actor-type-mask (-> this link) qbert-plat)) ) - (set! (-> obj door) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj door-plat) (entity-actor-lookup arg0 'alt-actor 1)) - (set-vector! (-> obj bounds-start) -39034.88 0.0 27729.92 1.0) - (vector+! (-> obj bounds-start) (-> obj bounds-start) (-> obj root trans)) - (set-vector! (-> obj bounds-end) 128573.44 0.0 -38420.48 1.0) - (vector+! (-> obj bounds-end) (-> obj bounds-end) (-> obj root trans)) + (set! (-> this door) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this door-plat) (entity-actor-lookup arg0 'alt-actor 1)) + (set-vector! (-> this bounds-start) -39034.88 0.0 27729.92 1.0) + (vector+! (-> this bounds-start) (-> this bounds-start) (-> this root trans)) + (set-vector! (-> this bounds-end) 128573.44 0.0 -38420.48 1.0) + (vector+! (-> this bounds-end) (-> this bounds-end) (-> this root trans)) (let ((v1-11 (task-complete? *game-info* (game-task sunken-platforms)))) - (set! (-> obj puzzle-beaten?) v1-11) + (set! (-> this puzzle-beaten?) v1-11) (when v1-11 - (set! (-> obj plat-states) (-> obj plat-states-needed-to-open-door)) - (set! (-> obj play-door-cam?) #f) + (set! (-> this plat-states) (-> this plat-states-needed-to-open-door)) + (set! (-> this play-door-cam?) #f) ) ) (go qbert-plat-master-wait-for-door) diff --git a/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc b/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc index 07db4fa658..212534095e 100644 --- a/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/shover_REF.gc @@ -16,12 +16,12 @@ ) ;; definition for method 3 of type shover -(defmethod inspect shover ((obj shover)) +(defmethod inspect shover ((this shover)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tshove-up: ~f~%" (-> obj shove-up)) - obj + (format #t "~T~Tshove-up: ~f~%" (-> this shove-up)) + this ) ;; failed to figure out what this is: @@ -46,7 +46,7 @@ (calc-shove-up (-> self root-override) s4-0 (-> self shove-up)) (level-hint-spawn (text-id sunken-hotpipes) "sksp0134" (the-as entity #f) *entity-pool* (game-task none)) (if (or (= (-> *target* control unknown-surface00 mode) 'air) - (>= (+ (-> *display* base-frame-counter) (seconds -0.2)) (-> *target* control unknown-dword11)) + (>= (+ (current-time) (seconds -0.2)) (-> *target* control unknown-dword11)) (< 0.75 (-> *target* control poly-normal y)) ) (send-event @@ -80,11 +80,11 @@ ;; definition for method 11 of type shover ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! shover ((obj shover) (arg0 entity-actor)) +(defmethod init-from-entity! shover ((this shover) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj shove-up) (res-lump-float arg0 'shove :default 12288.0)) + (set! (-> this shove-up) (res-lump-float arg0 'shove :default 12288.0)) (let ((s3-0 (res-lump-value arg0 'collision-mesh-id uint128)) - (s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))) + (s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))) ) (let ((s3-1 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint s3-0) (the-as uint 0)))) (set! (-> s3-1 prim-core collide-as) (collide-kind wall-object)) @@ -97,12 +97,12 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *shover-sg* '()) - (let ((v1-17 (new 'process 'path-control obj 'path 0.0))) - (set! (-> obj path) v1-17) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *shover-sg* '()) + (let ((v1-17 (new 'process 'path-control this 'path 0.0))) + (set! (-> this path) v1-17) (logior! (-> v1-17 flags) (path-control-flag display draw-line draw-point draw-text)) (if (<= (-> v1-17 curve num-cverts) 0) (go process-drawable-art-error "no path") @@ -111,28 +111,28 @@ (set! sv-16 (new 'static 'res-tag)) (let ((v1-23 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-23 - (+! (-> obj root-override trans x) (-> v1-23 0)) - (+! (-> obj root-override trans y) (-> v1-23 1)) - (+! (-> obj root-override trans z) (-> v1-23 2)) + (+! (-> this root-override trans x) (-> v1-23 0)) + (+! (-> this root-override trans y) (-> v1-23 1)) + (+! (-> this root-override trans z) (-> v1-23 2)) ) ) (let ((f0-13 (res-lump-float arg0 'rotoffset))) (if (!= f0-13 0.0) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-13) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-13) ) ) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (set! *shover* obj) + (update-transforms! (-> this root-override)) + (set! *shover* this) (go shover-idle) (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 efc555fe5d..fdbef2f1d8 100644 --- a/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/square-platform_REF.gc @@ -30,21 +30,21 @@ ) ;; definition for method 3 of type square-platform -(defmethod inspect square-platform ((obj square-platform)) +(defmethod inspect square-platform ((this square-platform)) (let ((t9-0 (method-of-type baseplat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tplat-id: ~D~%" (-> obj plat-id)) - (format #t "~T~Tpos-u: ~f~%" (-> obj pos-u)) - (format #t "~T~Twater-entity: ~A~%" (-> obj water-entity)) - (format #t "~T~Tsplash-counter: ~D~%" (-> obj splash-counter)) - (format #t "~T~Tstart-splash-time: ~D~%" (-> obj start-splash-time)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tpart3: ~A~%" (-> obj part3)) - (format #t "~T~Tpart4: ~A~%" (-> obj part4)) - (format #t "~T~Tup-pos: #~%" (-> obj up-pos)) - (format #t "~T~Tdown-pos: #~%" (-> obj down-pos)) - obj + (format #t "~T~Tplat-id: ~D~%" (-> this plat-id)) + (format #t "~T~Tpos-u: ~f~%" (-> this pos-u)) + (format #t "~T~Twater-entity: ~A~%" (-> this water-entity)) + (format #t "~T~Tsplash-counter: ~D~%" (-> this splash-counter)) + (format #t "~T~Tstart-splash-time: ~D~%" (-> this start-splash-time)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tpart3: ~A~%" (-> this part3)) + (format #t "~T~Tpart4: ~A~%" (-> this part4)) + (format #t "~T~Tup-pos: #~%" (-> this up-pos)) + (format #t "~T~Tdown-pos: #~%" (-> this down-pos)) + this ) ;; failed to figure out what this is: @@ -63,11 +63,11 @@ ) ;; definition for method 3 of type square-platform-button -(defmethod inspect square-platform-button ((obj square-platform-button)) +(defmethod inspect square-platform-button ((this square-platform-button)) (let ((t9-0 (method-of-type basebutton inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type square-platform-master @@ -93,20 +93,20 @@ ) ;; definition for method 3 of type square-platform-master -(defmethod inspect square-platform-master ((obj square-platform-master)) +(defmethod inspect square-platform-master ((this square-platform-master)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tbutton-id: ~D~%" (-> obj button-id)) - (format #t "~T~Tplat-id: ~D~%" (-> obj plat-id)) - (format #t "~T~Tplat-mask: ~D~%" (-> obj plat-mask)) - (format #t "~T~Tplat-id-dir: ~D~%" (-> obj plat-id-dir)) - (format #t "~T~Twiggled?: ~A~%" (-> obj wiggled?)) - (format #t "~T~Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~T~Tlast-plat-activated-time: ~D~%" (-> obj last-plat-activated-time)) - (format #t "~T~Tdelay-til-wiggle: ~D~%" (-> obj delay-til-wiggle)) - (format #t "~T~Tticker: #~%" (-> obj ticker)) - obj + (format #t "~T~Tbutton-id: ~D~%" (-> this button-id)) + (format #t "~T~Tplat-id: ~D~%" (-> this plat-id)) + (format #t "~T~Tplat-mask: ~D~%" (-> this plat-mask)) + (format #t "~T~Tplat-id-dir: ~D~%" (-> this plat-id-dir)) + (format #t "~T~Twiggled?: ~A~%" (-> this wiggled?)) + (format #t "~T~Ttimeout: ~D~%" (-> this timeout)) + (format #t "~T~Tlast-plat-activated-time: ~D~%" (-> this last-plat-activated-time)) + (format #t "~T~Tdelay-til-wiggle: ~D~%" (-> this delay-til-wiggle)) + (format #t "~T~Tticker: #~%" (-> this ticker)) + this ) ;; failed to figure out what this is: @@ -220,20 +220,20 @@ ;; definition for method 27 of type square-platform ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod square-platform-method-27 square-platform ((obj square-platform) (arg0 symbol)) +(defmethod square-platform-method-27 square-platform ((this square-platform) (arg0 symbol)) (local-vars (v0-3 sound-id) (sv-48 int)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj root-override trans quad)) + (set! (-> s4-0 quad) (-> this root-override trans quad)) (+! (-> s4-0 y) -20480.0) - (let* ((v1-1 (-> obj water-entity)) + (let* ((v1-1 (-> this water-entity)) (a0-4 (if v1-1 (-> v1-1 extra process) ) ) ) (when (not a0-4) - (set! (-> obj water-entity) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (let ((v1-4 (-> obj water-entity))) + (set! (-> this water-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (let ((v1-4 (-> this water-entity))) (set! a0-4 (if v1-4 (-> v1-4 extra process) ) @@ -246,17 +246,17 @@ ) (set! (-> s3-0 quad) (-> s4-0 quad)) (set! (-> s3-0 y) f0-2) - (if (zero? (-> obj start-splash-time)) + (if (zero? (-> this start-splash-time)) (set! v0-3 (cond (arg0 (if (>= (-> s4-0 y) f0-2) - (set! (-> obj start-splash-time) (-> *display* base-frame-counter)) + (set-time! (-> this start-splash-time)) ) v0-3 ) (else (when (>= f0-2 (-> s4-0 y)) - (set! (-> obj start-splash-time) (-> *display* base-frame-counter)) + (set-time! (-> this start-splash-time)) (let ((s2-0 sound-play-by-name) (s1-0 (make-u128 #x6873616c (the-as uint #x70732d656772616c))) (s0-0 (new-sound-id)) @@ -275,26 +275,26 @@ ) ) ) - (when (nonzero? (-> obj start-splash-time)) + (when (nonzero? (-> this start-splash-time)) (cond (arg0 - (let ((v1-21 (-> obj splash-counter))) + (let ((v1-21 (-> this splash-counter))) (when (< v1-21 2) - (set! (-> obj splash-counter) (+ v1-21 1)) - (spawn (-> obj part2) s3-0) + (set! (-> this splash-counter) (+ v1-21 1)) + (spawn (-> this part2) s3-0) ) ) ) (else - (spawn (-> obj part3) s4-0) + (spawn (-> this part3) s4-0) ) ) ) (when (not arg0) - (let ((v1-25 (-> obj splash-counter))) + (let ((v1-25 (-> this splash-counter))) (when (< v1-25 2) - (set! (-> obj splash-counter) (+ v1-25 1)) - (spawn (-> obj part4) s3-0) + (set! (-> this splash-counter) (+ v1-25 1)) + (spawn (-> this part4) s3-0) ) ) ) @@ -431,45 +431,45 @@ ) ;; definition for method 10 of type square-platform -(defmethod deactivate square-platform ((obj square-platform)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate square-platform ((this square-platform)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj part3)) - (kill-and-free-particles (-> obj part3)) + (if (nonzero? (-> this part3)) + (kill-and-free-particles (-> this part3)) ) - (if (nonzero? (-> obj part4)) - (kill-and-free-particles (-> obj part4)) + (if (nonzero? (-> this part4)) + (kill-and-free-particles (-> this part4)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type square-platform ;; INFO: Return type mismatch baseplat vs square-platform. -(defmethod relocate square-platform ((obj square-platform) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate square-platform ((this square-platform) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj part3)) - (&+! (-> obj part3) arg0) + (if (nonzero? (-> this part3)) + (&+! (-> this part3) arg0) ) - (if (nonzero? (-> obj part4)) - (&+! (-> obj part4) arg0) + (if (nonzero? (-> this part4)) + (&+! (-> this part4) arg0) ) (the-as square-platform - ((the-as (function baseplat int baseplat) (find-parent-method square-platform 7)) obj arg0) + ((the-as (function baseplat int baseplat) (find-parent-method square-platform 7)) this arg0) ) ) ;; definition for method 11 of type square-platform ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! square-platform ((obj square-platform) (arg0 entity-actor)) +(defmethod init-from-entity! square-platform ((this square-platform) (arg0 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (set! (-> obj pos-u) 0.0) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (set! (-> this pos-u) 0.0) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -487,24 +487,24 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj plat-id) (actor-count-before (-> obj link))) - (initialize-skeleton obj *square-platform-sg* '()) - (baseplat-method-21 obj) + (process-drawable-from-entity! this arg0) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this plat-id) (actor-count-before (-> this link))) + (initialize-skeleton this *square-platform-sg* '()) + (baseplat-method-21 this) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) (set! sv-16 (new 'static 'res-tag)) - (let* ((v1-32 (res-lump-data (-> obj entity) 'distance pointer :tag-ptr (& sv-16))) + (let* ((v1-32 (res-lump-data (-> this entity) 'distance pointer :tag-ptr (& sv-16))) (f30-0 (if (and v1-32 (> (the-as int (-> sv-16 elt-count)) 0)) (-> (the-as (pointer float) v1-32)) -8192.0 @@ -512,27 +512,27 @@ ) ) (set! sv-32 (new 'static 'res-tag)) - (let* ((v1-35 (res-lump-data (-> obj entity) 'distance pointer :tag-ptr (& sv-32))) + (let* ((v1-35 (res-lump-data (-> this entity) 'distance pointer :tag-ptr (& sv-32))) (f0-10 (if (and v1-35 (< 1 (the-as int (-> sv-32 elt-count)))) (-> (the-as (pointer float) v1-35) 1) 16384.0 ) ) ) - (set! (-> obj down-pos quad) (-> obj root-override trans quad)) - (+! (-> obj down-pos y) f30-0) - (set! (-> obj up-pos quad) (-> obj root-override trans quad)) - (+! (-> obj up-pos y) f0-10) + (set! (-> this down-pos quad) (-> this root-override trans quad)) + (+! (-> this down-pos y) f30-0) + (set! (-> this up-pos quad) (-> this root-override trans quad)) + (+! (-> this up-pos y) f0-10) ) ) - (set! (-> obj basetrans quad) (-> obj down-pos quad)) - (set! (-> obj root-override trans quad) (-> obj basetrans quad)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 437) obj)) - (set! (-> obj part3) (create-launch-control (-> *part-group-id-table* 438) obj)) - (set! (-> obj part4) (create-launch-control (-> *part-group-id-table* 439) obj)) - (set! (-> obj water-entity) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this basetrans quad) (-> this down-pos quad)) + (set! (-> this root-override trans quad) (-> this basetrans quad)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 437) this)) + (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 438) this)) + (set! (-> this part4) (create-launch-control (-> *part-group-id-table* 439) this)) + (set! (-> this water-entity) (entity-actor-lookup arg0 'alt-actor 0)) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (go square-platform-lowered) (none) ) @@ -561,7 +561,7 @@ ;; failed to figure out what this is: (defstate square-platform-master-activate (square-platform-master) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self wiggled?) #f) (sleep (-> self ticker) (-> self timeout)) (set! (-> self plat-id) -1) @@ -663,8 +663,8 @@ (send-to-all (-> self link) 'bounce) ) ) - (when (>= (- (-> *display* base-frame-counter) (-> self last-plat-activated-time)) (seconds 0.3)) - (set! (-> self last-plat-activated-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self last-plat-activated-time) (seconds 0.3)) + (set-time! (-> self last-plat-activated-time)) (let ((v1-20 (-> self plat-id)) (a0-5 (-> self plat-id-dir)) (a1-3 (-> self plat-mask)) @@ -701,17 +701,17 @@ ;; definition for method 11 of type square-platform-master ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! square-platform-master ((obj square-platform-master) (arg0 entity-actor)) - (set! (-> obj button-id) -1) - (set! (-> obj plat-id) -1) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj timeout) - (the-as time-frame (the int (* 300.0 (res-lump-float (-> obj entity) 'timeout :default 10.0)))) +(defmethod init-from-entity! square-platform-master ((this square-platform-master) (arg0 entity-actor)) + (set! (-> this button-id) -1) + (set! (-> this plat-id) -1) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this timeout) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'timeout :default 10.0)))) ) - (set! (-> obj delay-til-wiggle) (+ (-> obj timeout) (seconds -0.4))) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj plat-mask) (the-as uint (get-matching-actor-type-mask (-> obj link) square-platform))) + (set! (-> this delay-til-wiggle) (+ (-> this timeout) (seconds -0.4))) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this plat-mask) (the-as uint (get-matching-actor-type-mask (-> this link) square-platform))) (go square-platform-master-idle) (none) ) 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 cc8acc26e6..89be9fd4dc 100644 --- a/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/steam-cap_REF.gc @@ -12,11 +12,11 @@ ) ;; definition for method 3 of type steam-cap-control-pt -(defmethod inspect steam-cap-control-pt ((obj steam-cap-control-pt)) - (format #t "[~8x] ~A~%" obj 'steam-cap-control-pt) - (format #t "~Ttrans: #~%" (-> obj trans)) - (format #t "~Ttransv: #~%" (-> obj transv)) - obj +(defmethod inspect steam-cap-control-pt ((this steam-cap-control-pt)) + (format #t "[~8x] ~A~%" this 'steam-cap-control-pt) + (format #t "~Ttrans: #~%" (-> this trans)) + (format #t "~Ttransv: #~%" (-> this transv)) + this ) ;; definition of type steam-cap @@ -48,22 +48,22 @@ ) ;; definition for method 3 of type steam-cap -(defmethod inspect steam-cap ((obj steam-cap)) +(defmethod inspect steam-cap ((this steam-cap)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdo-burst?: ~A~%" (-> obj do-burst?)) - (format #t "~T~Tdo-falling-sound?: ~A~%" (-> obj do-falling-sound?)) - (format #t "~T~Tdo-landing-sound?: ~A~%" (-> obj do-landing-sound?)) - (format #t "~T~Tbegin-travel-up: ~f~%" (-> obj begin-travel-up)) - (format #t "~T~Tbegin-travel-down: ~f~%" (-> obj begin-travel-down)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - (format #t "~T~Tpart3: ~A~%" (-> obj part3)) - (format #t "~T~Tdown: #~%" (-> obj down)) - (format #t "~T~Tup: #~%" (-> obj up)) - (format #t "~T~Tcontrol-pt[3] @ #x~X~%" (-> obj control-pt)) - obj + (format #t "~T~Tdo-burst?: ~A~%" (-> this do-burst?)) + (format #t "~T~Tdo-falling-sound?: ~A~%" (-> this do-falling-sound?)) + (format #t "~T~Tdo-landing-sound?: ~A~%" (-> this do-landing-sound?)) + (format #t "~T~Tbegin-travel-up: ~f~%" (-> this begin-travel-up)) + (format #t "~T~Tbegin-travel-down: ~f~%" (-> this begin-travel-down)) + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + (format #t "~T~Tpart3: ~A~%" (-> this part3)) + (format #t "~T~Tdown: #~%" (-> this down)) + (format #t "~T~Tup: #~%" (-> this up)) + (format #t "~T~Tcontrol-pt[3] @ #x~X~%" (-> this control-pt)) + this ) ;; failed to figure out what this is: @@ -453,23 +453,23 @@ ;; definition for method 20 of type steam-cap ;; INFO: Return type mismatch object vs none. -(defmethod steam-cap-method-20 steam-cap ((obj steam-cap)) +(defmethod steam-cap-method-20 steam-cap ((this steam-cap)) (when *target* (let* ((a1-0 (target-pos 0)) (f0-0 (-> a1-0 y)) ) - (when (and (>= f0-0 (+ -8192.0 (-> obj down y))) - (and (>= (+ -4096.0 (-> obj root-override trans y)) f0-0) (zero? (-> obj root-override riders num-riders))) + (when (and (>= f0-0 (+ -8192.0 (-> this down y))) + (and (>= (+ -4096.0 (-> this root-override trans y)) f0-0) (zero? (-> this root-override riders num-riders))) ) - (let ((f0-1 (vector-vector-xz-distance-squared (-> obj down) a1-0))) + (let ((f0-1 (vector-vector-xz-distance-squared (-> this down) a1-0))) (when (>= 104857600.0 f0-1) (let ((s5-0 (>= 37748736.0 f0-1))) (when (not s5-0) - (when (>= (- (-> obj root-override trans y) (-> obj down y)) 3072.0) + (when (>= (- (-> this root-override trans y) (-> this down y)) 3072.0) (let ((a1-1 (new 'stack-no-clear 'vector))) (set! (-> a1-1 x) (the-as float 1)) (set! (-> a1-1 y) (the-as float #f)) - (if (find-overlapping-shapes (-> obj root-override) (the-as overlaps-others-params a1-1)) + (if (find-overlapping-shapes (-> this root-override) (the-as overlaps-others-params a1-1)) (set! s5-0 #t) ) ) @@ -489,23 +489,23 @@ ;; definition for method 21 of type steam-cap ;; INFO: Used lq/sq -(defmethod steam-cap-method-21 steam-cap ((obj steam-cap)) +(defmethod steam-cap-method-21 steam-cap ((this steam-cap)) (local-vars (at-0 int) (at-1 int) (s5-0 symbol)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (let ((f0-0 (get-current-phase (-> obj sync)))) + (let ((f0-0 (get-current-phase (-> this sync)))) #t (cond - ((< f0-0 (-> obj begin-travel-up)) - (let ((f30-0 (/ f0-0 (-> obj begin-travel-up)))) + ((< f0-0 (-> this begin-travel-up)) + (let ((f30-0 (/ f0-0 (-> this begin-travel-up)))) (set! s5-0 #t) (dotimes (s4-0 3) - (let ((s3-0 (-> obj control-pt s4-0))) - (when (= (-> s3-0 trans y) (-> obj down y)) - (set! (-> obj do-burst?) #t) + (let ((s3-0 (-> this control-pt s4-0))) + (when (= (-> s3-0 trans y) (-> this down y)) + (set! (-> this do-burst?) #t) (let ((a0-2 (+ (the int (* 60.0 (- 1.0 f30-0))) 3))) (if (zero? (rand-vu-int-count a0-2)) (+! (-> s3-0 transv y) (* (rand-vu-float-range 40960.0 57344.0) f30-0)) @@ -516,56 +516,56 @@ ) (let ((a0-4 (+ (the int (* 60.0 (- 1.0 f30-0))) 1))) (if (zero? (rand-vu-int-count a0-4)) - (spawn (-> obj part) (-> obj down)) + (spawn (-> this part) (-> this down)) ) ) ) ) - ((< f0-0 (-> obj begin-travel-down)) - (let ((f30-1 (/ (- f0-0 (-> obj begin-travel-up)) (- (-> obj begin-travel-down) (-> obj begin-travel-up))))) + ((< f0-0 (-> this begin-travel-down)) + (let ((f30-1 (/ (- f0-0 (-> this begin-travel-up)) (- (-> this begin-travel-down) (-> this begin-travel-up))))) (set! s5-0 #f) - (set! (-> obj do-falling-sound?) #t) - (when (-> obj do-burst?) + (set! (-> this do-falling-sound?) #t) + (when (-> this do-burst?) (sound-play "sunk-top-rises") - (set! (-> obj do-burst?) #f) - (spawn (-> obj part) (-> obj down)) - (spawn (-> obj part) (-> obj down)) - (spawn (-> obj part) (-> obj down)) - (spawn (-> obj part) (-> obj down)) + (set! (-> this do-burst?) #f) + (spawn (-> this part) (-> this down)) + (spawn (-> this part) (-> this down)) + (spawn (-> this part) (-> this down)) + (spawn (-> this part) (-> this down)) ) (when (< f30-1 0.94) - (spawn (-> obj part2) (-> obj down)) + (spawn (-> this part2) (-> this down)) (let ((a1-8 (new 'stack-no-clear 'vector))) - (set! (-> a1-8 quad) (-> obj root-override trans quad)) + (set! (-> a1-8 quad) (-> this root-override trans quad)) (+! (-> a1-8 y) -3072.0) - (spawn (-> obj part3) a1-8) + (spawn (-> this part3) a1-8) ) ) ) ) (else (set! s5-0 #t) - (when (-> obj do-falling-sound?) - (set! (-> obj do-falling-sound?) #f) + (when (-> this do-falling-sound?) + (set! (-> this do-falling-sound?) #f) (sound-play "sunk-top-falls") ) ) ) ) (dotimes (s4-3 3) - (let ((s2-0 (-> obj control-pt s4-3)) + (let ((s2-0 (-> this control-pt s4-3)) (s3-3 (new 'stack-no-clear 'vector)) ) (set! (-> s3-3 quad) (-> s2-0 trans quad)) (cond (s5-0 - (+! (-> s2-0 transv y) (* -819200.0 (-> *display* seconds-per-frame))) + (+! (-> s2-0 transv y) (* -819200.0 (seconds-per-frame))) (let ((a1-10 s3-3) (v1-42 s3-3) (a0-21 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> (-> s2-0 transv) quad)) - (let ((f0-17 (-> *display* seconds-per-frame))) + (let ((f0-17 (seconds-per-frame))) (.mov at-0 f0-17) ) (.mov vf2 at-0) @@ -574,12 +574,12 @@ (.svf (&-> a0-21 quad) vf1) (vector+! a1-10 v1-42 a0-21) ) - (when (< (-> s3-3 y) (-> obj down y)) - (when (-> obj do-landing-sound?) - (set! (-> obj do-landing-sound?) #f) + (when (< (-> s3-3 y) (-> this down y)) + (when (-> this do-landing-sound?) + (set! (-> this do-landing-sound?) #f) (sound-play "sunk-top-lands") ) - (set! (-> s3-3 y) (-> obj down y)) + (set! (-> s3-3 y) (-> this down y)) (let ((f0-20 (-> s2-0 transv y))) (when (< f0-20 0.0) (let ((f0-22 (* 0.3 (- f0-20)))) @@ -593,8 +593,8 @@ ) ) (else - (set! (-> obj do-landing-sound?) #t) - (let ((f0-24 (* 0.000048828126 (- (-> obj up y) (-> s2-0 trans y))))) + (set! (-> this do-landing-sound?) #t) + (let ((f0-24 (* 0.000048828126 (- (-> this up y) (-> s2-0 trans y))))) (cond ((< 1.0 f0-24) (set! f0-24 1.0) @@ -603,7 +603,7 @@ (set! f0-24 -1.0) ) ) - (+! (-> s2-0 transv y) (* 819200.0 (-> *display* seconds-per-frame) f0-24)) + (+! (-> s2-0 transv y) (* 819200.0 (seconds-per-frame) f0-24)) (let ((f1-24 (-> s2-0 transv y))) (when (< 122880.0 (fabs f1-24)) (if (>= f1-24 0.0) @@ -617,7 +617,7 @@ (a0-26 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> (-> s2-0 transv) quad)) - (let ((f1-27 (-> *display* seconds-per-frame))) + (let ((f1-27 (seconds-per-frame))) (.mov at-1 f1-27) ) (.mov vf2 at-1) @@ -626,7 +626,7 @@ (.svf (&-> a0-26 quad) vf1) (vector+! a1-14 v1-61 a0-26) ) - (let ((f1-29 (- (-> obj up y) (-> s3-3 y))) + (let ((f1-29 (- (-> this up y) (-> s3-3 y))) (v1-62 (>= f0-24 0.0)) ) (when (!= v1-62 (>= f1-29 0.0)) @@ -649,27 +649,27 @@ ) (let ((f0-31 0.0)) (dotimes (v1-71 3) - (+! f0-31 (-> obj control-pt v1-71 trans y)) + (+! f0-31 (-> this control-pt v1-71 trans y)) ) (let ((f0-32 (* 0.33333334 f0-31)) (a1-16 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-16 quad) (-> obj root-override trans quad)) + (set! (-> a1-16 quad) (-> this root-override trans quad)) (set! (-> a1-16 y) f0-32) - (move-to-point! (-> obj root-override) a1-16) + (move-to-point! (-> this root-override) a1-16) ) ) (let ((v1-77 (new 'stack-no-clear 'vector)) (a0-35 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'vector)) ) - (vector-! v1-77 (the-as vector (&-> obj stack 176)) (the-as vector (-> obj control-pt))) - (vector-! a0-35 (the-as vector (&-> obj stack 208)) (the-as vector (-> obj control-pt))) + (vector-! v1-77 (the-as vector (&-> this stack 176)) (the-as vector (-> this control-pt))) + (vector-! a0-35 (the-as vector (&-> this stack 208)) (the-as vector (-> this control-pt))) (vector-cross! s5-1 v1-77 a0-35) (vector-normalize! s5-1 1.0) (forward-up-nopitch->quaternion - (-> obj root-override quat) - (vector-z-quaternion! (new-stack-vector0) (-> obj root-override quat)) + (-> this root-override quat) + (vector-z-quaternion! (new-stack-vector0) (-> this root-override quat)) s5-1 ) ) @@ -691,38 +691,38 @@ ;; definition for method 7 of type steam-cap ;; INFO: Return type mismatch process-drawable vs steam-cap. -(defmethod relocate steam-cap ((obj steam-cap) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate steam-cap ((this steam-cap) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj part3)) - (&+! (-> obj part3) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method steam-cap 7)) this arg0) ) ) ;; definition for method 10 of type steam-cap -(defmethod deactivate steam-cap ((obj steam-cap)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate steam-cap ((this steam-cap)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj part3)) - (kill-and-free-particles (-> obj part3)) + (if (nonzero? (-> this part3)) + (kill-and-free-particles (-> this part3)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 11 of type steam-cap ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! steam-cap ((obj steam-cap) (arg0 entity-actor)) +(defmethod init-from-entity! steam-cap ((this steam-cap) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -740,25 +740,25 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (set! (-> obj do-burst?) #f) - (set! (-> obj do-falling-sound?) #f) - (set! (-> obj do-landing-sound?) #f) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *steam-cap-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (set! (-> this do-burst?) #f) + (set! (-> this do-falling-sound?) #f) + (set! (-> this do-landing-sound?) #f) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *steam-cap-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) - (update-transforms! (-> obj root-override)) - (load-params! (-> obj sync) obj (the-as uint 1800) 0.0 0.15 0.15) + (update-transforms! (-> this root-override)) + (load-params! (-> this sync) this (the-as uint 1800) 0.0 0.15 0.15) (let ((f30-0 0.4) (f28-0 0.9) ) @@ -782,25 +782,25 @@ ) ) ) - (set! (-> obj begin-travel-up) f30-0) - (set! (-> obj begin-travel-down) f28-0) + (set! (-> this begin-travel-up) f30-0) + (set! (-> this begin-travel-down) f28-0) ) - (set! (-> obj down quad) (-> obj root-override trans quad)) - (set! (-> obj up quad) (-> obj root-override trans quad)) - (+! (-> obj up y) 40960.0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 441) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 442) obj)) - (set! (-> obj part3) (create-launch-control (-> *part-group-id-table* 443) obj)) - (vector-reset! (-> obj root-override transv)) + (set! (-> this down quad) (-> this root-override trans quad)) + (set! (-> this up quad) (-> this root-override trans quad)) + (+! (-> this up y) 40960.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 441) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 442) this)) + (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 443) this)) + (vector-reset! (-> this root-override transv)) (let ((s5-1 (new 'stack-no-clear 'vector)) (f30-1 0.0) ) (dotimes (s4-2 3) - (let ((s3-1 (-> obj control-pt s4-2))) + (let ((s3-1 (-> this control-pt s4-2))) (set-vector! s5-1 0.0 0.0 10240.0 1.0) (vector-rotate-around-y! s5-1 s5-1 f30-1) (set! f30-1 (+ 21845.334 f30-1)) - (vector+! (-> s3-1 trans) s5-1 (-> obj root-override trans)) + (vector+! (-> s3-1 trans) s5-1 (-> this root-override trans)) (vector-reset! (-> s3-1 transv)) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc index 41bcd7e1c0..c76a1406e5 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sun-exit-chamber_REF.gc @@ -23,15 +23,15 @@ ) ;; definition for method 3 of type blue-eco-charger-orb -(defmethod inspect blue-eco-charger-orb ((obj blue-eco-charger-orb)) +(defmethod inspect blue-eco-charger-orb ((this blue-eco-charger-orb)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Torbit-rot: #~%" (-> obj orbit-rot)) - (format #t "~T~Torbit-rotv: #~%" (-> obj orbit-rotv)) - (format #t "~T~Ttarg-orbit-rotv: #~%" (-> obj targ-orbit-rotv)) - (format #t "~T~Trest-pos: #~%" (-> obj rest-pos)) - obj + (format #t "~T~Torbit-rot: #~%" (-> this orbit-rot)) + (format #t "~T~Torbit-rotv: #~%" (-> this orbit-rotv)) + (format #t "~T~Ttarg-orbit-rotv: #~%" (-> this targ-orbit-rotv)) + (format #t "~T~Trest-pos: #~%" (-> this rest-pos)) + this ) ;; failed to figure out what this is: @@ -64,14 +64,14 @@ ) ;; definition for method 3 of type blue-eco-charger -(defmethod inspect blue-eco-charger ((obj blue-eco-charger)) +(defmethod inspect blue-eco-charger ((this blue-eco-charger)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcharger-id: ~D~%" (-> obj charger-id)) - (format #t "~T~Topen-level: ~f~%" (-> obj open-level)) - (format #t "~T~Tmaster: ~A~%" (-> obj master)) - obj + (format #t "~T~Tcharger-id: ~D~%" (-> this charger-id)) + (format #t "~T~Topen-level: ~f~%" (-> this open-level)) + (format #t "~T~Tmaster: ~A~%" (-> this master)) + this ) ;; failed to figure out what this is: @@ -94,14 +94,14 @@ ) ;; definition for method 3 of type exit-chamber-items -(defmethod inspect exit-chamber-items ((obj exit-chamber-items)) - (format #t "[~8x] ~A~%" obj 'exit-chamber-items) - (format #t "~Tdoor-pos: #~%" (-> obj door-pos)) - (format #t "~Tdoor-quat: #~%" (-> obj door-quat)) - (format #t "~Tbutton-pos: #~%" (-> obj button-pos)) - (format #t "~Tbutton-quat: #~%" (-> obj button-quat)) - (format #t "~Tfcell-pos: #~%" (-> obj fcell-pos)) - obj +(defmethod inspect exit-chamber-items ((this exit-chamber-items)) + (format #t "[~8x] ~A~%" this 'exit-chamber-items) + (format #t "~Tdoor-pos: #~%" (-> this door-pos)) + (format #t "~Tdoor-quat: #~%" (-> this door-quat)) + (format #t "~Tbutton-pos: #~%" (-> this button-pos)) + (format #t "~Tbutton-quat: #~%" (-> this button-quat)) + (format #t "~Tfcell-pos: #~%" (-> this fcell-pos)) + this ) ;; definition of type exit-chamber @@ -140,21 +140,21 @@ ) ;; definition for method 3 of type exit-chamber -(defmethod inspect exit-chamber ((obj exit-chamber)) +(defmethod inspect exit-chamber ((this exit-chamber)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tchargers-active: ~D~%" (-> obj chargers-active)) - (format #t "~T~Tmove-player?: ~A~%" (-> obj move-player?)) - (format #t "~T~Tmove-fcell?: ~A~%" (-> obj move-fcell?)) - (format #t "~T~Tplay-assistant-message?: ~A~%" (-> obj play-assistant-message?)) - (format #t "~T~Twave-scale: ~f~%" (-> obj wave-scale)) - (format #t "~T~Tbutton: #x~X~%" (-> obj button)) - (format #t "~T~Tdoor: #x~X~%" (-> obj door)) - (format #t "~T~Tfcell-handle: ~D~%" (-> obj fcell-handle)) - (format #t "~T~Torig-trans: #~%" (-> obj orig-trans)) - (format #t "~T~Tlast-pos: #~%" (-> obj last-pos)) - obj + (format #t "~T~Tchargers-active: ~D~%" (-> this chargers-active)) + (format #t "~T~Tmove-player?: ~A~%" (-> this move-player?)) + (format #t "~T~Tmove-fcell?: ~A~%" (-> this move-fcell?)) + (format #t "~T~Tplay-assistant-message?: ~A~%" (-> this play-assistant-message?)) + (format #t "~T~Twave-scale: ~f~%" (-> this wave-scale)) + (format #t "~T~Tbutton: #x~X~%" (-> this button)) + (format #t "~T~Tdoor: #x~X~%" (-> this door)) + (format #t "~T~Tfcell-handle: ~D~%" (-> this fcell-handle)) + (format #t "~T~Torig-trans: #~%" (-> this orig-trans)) + (format #t "~T~Tlast-pos: #~%" (-> this last-pos)) + this ) ;; failed to figure out what this is: @@ -232,15 +232,15 @@ ) ;; definition for method 20 of type blue-eco-charger-orb -(defmethod blue-eco-charger-orb-method-20 blue-eco-charger-orb ((obj blue-eco-charger-orb) (arg0 float)) +(defmethod blue-eco-charger-orb-method-20 blue-eco-charger-orb ((this blue-eco-charger-orb) (arg0 float)) (set-vector! - (-> obj targ-orbit-rotv) + (-> this targ-orbit-rotv) (rand-vu-float-range 72817.78 258503.11) (rand-vu-float-range 72817.78 258503.11) (rand-vu-float-range 72817.78 258503.11) 1.0 ) - (vector-float*! (-> obj targ-orbit-rotv) (-> obj targ-orbit-rotv) arg0) + (vector-float*! (-> this targ-orbit-rotv) (-> this targ-orbit-rotv) arg0) ) ;; failed to figure out what this is: @@ -292,7 +292,7 @@ (a0-6 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> (-> self orbit-rotv) quad)) - (let ((f0-11 (-> *display* seconds-per-frame))) + (let ((f0-11 (seconds-per-frame))) (.mov at-0 f0-11) ) (.mov vf2 at-0) @@ -308,17 +308,13 @@ (vector+! (-> self root trans) gp-0 (-> self rest-pos)) (set-vector! gp-0 - (cos (* 436.90668 (the float (mod (-> *display* base-frame-counter) 150)))) - (cos (* 247.39902 (the float (mod (-> *display* base-frame-counter) 264)))) - (cos (* 601.7998 (the float (mod (-> *display* base-frame-counter) 108)))) + (cos (* 436.90668 (the float (mod (current-time) 150)))) + (cos (* 247.39902 (the float (mod (current-time) 264)))) + (cos (* 601.7998 (the float (mod (current-time) 108)))) 1.0 ) (vector-normalize! gp-0 1.0) - (quaternion-vector-angle! - (-> self root quat) - gp-0 - (* 463.8075 (the float (mod (-> *display* base-frame-counter) 141))) - ) + (quaternion-vector-angle! (-> self root quat) gp-0 (* 463.8075 (the float (mod (current-time) 141)))) ) ) (let ((gp-1 (new 'stack-no-clear 'vector))) @@ -361,16 +357,16 @@ ) ;; definition for method 21 of type blue-eco-charger -(defmethod blue-eco-charger-method-21 blue-eco-charger ((obj blue-eco-charger) (arg0 symbol)) - (let* ((v1-0 (-> obj master)) +(defmethod blue-eco-charger-method-21 blue-eco-charger ((this blue-eco-charger) (arg0 symbol)) + (let* ((v1-0 (-> this master)) (a0-1 (if v1-0 (-> v1-0 extra process) ) ) ) (when (not a0-1) - (set! (-> obj master) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (let ((v1-3 (-> obj master))) + (set! (-> this master) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (let ((v1-3 (-> this master))) (set! a0-1 (if v1-3 (-> v1-3 extra process) ) @@ -385,15 +381,15 @@ 1 2 ) - (-> obj charger-id) + (-> this charger-id) ) ) ) ) ;; definition for method 20 of type blue-eco-charger -(defmethod blue-eco-charger-method-20 blue-eco-charger ((obj blue-eco-charger)) - (and (and *target* (>= 16384.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))) +(defmethod blue-eco-charger-method-20 blue-eco-charger ((this blue-eco-charger)) + (and (and *target* (>= 16384.0 (vector-vector-distance (-> this root-override trans) (-> *target* control trans)))) (send-event *target* 'query 'powerup (pickup-type eco-blue)) ) ) @@ -434,7 +430,7 @@ ;; failed to figure out what this is: (defstate blue-eco-charger-open (blue-eco-charger) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if arg0 (sound-play "blue-eco-start") ) @@ -442,7 +438,7 @@ ) :trans (behavior () (if (blue-eco-charger-method-20 self) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (update! (-> self sound)) ) @@ -456,7 +452,7 @@ (loop (cond ((zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 20)) + (when (time-elapsed? (-> self state-time) (seconds 20)) (level-hint-spawn (text-id sunken-blue-eco-charger-all-hint) "sksp0133" @@ -518,9 +514,9 @@ ;; definition for method 11 of type blue-eco-charger ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! blue-eco-charger ((obj blue-eco-charger) (arg0 entity-actor)) - (set! (-> obj open-level) 0.0) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! blue-eco-charger ((this blue-eco-charger) (arg0 entity-actor)) + (set! (-> this open-level) 0.0) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -532,33 +528,33 @@ ) (set! (-> s4-0 nav-radius) 6553.6) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *blue-eco-charger-sg* '()) - (let ((f0-6 (res-lump-float (-> obj entity) 'rotoffset))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *blue-eco-charger-sg* '()) + (let ((f0-6 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-6 0.0) - (quaternion-rotate-y! (-> obj root-override quat) (-> obj root-override quat) f0-6) + (quaternion-rotate-y! (-> this root-override quat) (-> this root-override quat) f0-6) ) ) (ja-channel-set! 1) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj master) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj charger-id) (+ (actor-count-before (-> obj link)) 1)) - (process-spawn blue-eco-charger-orb (-> obj entity) obj :to obj) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "blue-eco-charg" :fo-max 35) (-> obj root-override trans)) + (update-transforms! (-> this root-override)) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this master) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this charger-id) (+ (actor-count-before (-> this link)) 1)) + (process-spawn blue-eco-charger-orb (-> this entity) this :to this) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "blue-eco-charg" :fo-max 35) (-> this root-override trans)) ) (if (zero? (get-reminder (get-task-control (game-task sunken-room)) 0)) (go blue-eco-charger-idle) @@ -577,11 +573,11 @@ ) ;; definition for method 3 of type exit-chamber-button -(defmethod inspect exit-chamber-button ((obj exit-chamber-button)) +(defmethod inspect exit-chamber-button ((this exit-chamber-button)) (let ((t9-0 (method-of-type basebutton inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for function exit-chamber-button-init-by-other @@ -591,11 +587,9 @@ ) ;; definition for method 20 of type exit-chamber -(defmethod exit-chamber-method-20 exit-chamber ((obj exit-chamber) (arg0 float)) - (set! (-> obj root-override trans y) - (+ (-> obj orig-trans y) - (* 2252.8 arg0 (cos (* 36.40889 (the float (mod (-> *display* base-frame-counter) 1800))))) - ) +(defmethod exit-chamber-method-20 exit-chamber ((this exit-chamber) (arg0 float)) + (set! (-> this root-override trans y) + (+ (-> this orig-trans y) (* 2252.8 arg0 (cos (* 36.40889 (the float (mod (current-time) 1800)))))) ) ) @@ -620,8 +614,8 @@ ) ;; definition for method 24 of type exit-chamber -(defmethod exit-chamber-method-24 exit-chamber ((obj exit-chamber) (arg0 float)) - (let ((s4-0 (-> obj node-list data 3 bone transform)) +(defmethod exit-chamber-method-24 exit-chamber ((this exit-chamber) (arg0 float)) + (let ((s4-0 (-> this node-list data 3 bone transform)) (f30-0 (rand-vu-float-range 0.0 65536.0)) (f28-0 (rand-vu-float-range 8192.0 40960.0)) (gp-0 (new 'stack-no-clear 'vector)) @@ -636,8 +630,8 @@ ) ;; definition for method 21 of type exit-chamber -(defmethod exit-chamber-method-21 exit-chamber ((obj exit-chamber) (arg0 exit-chamber-items)) - (let ((s5-0 (-> obj node-list data 3 bone transform))) +(defmethod exit-chamber-method-21 exit-chamber ((this exit-chamber) (arg0 exit-chamber-items)) + (let ((s5-0 (-> this node-list data 3 bone transform))) (set-vector! (-> arg0 door-pos) 0.0 13107.2 -40960.0 1.0) (vector-matrix*! (-> arg0 door-pos) (-> arg0 door-pos) s5-0) (vector-float*! (-> arg0 door-pos) (-> arg0 door-pos) (/ 1.0 (-> arg0 door-pos w))) @@ -654,21 +648,21 @@ ;; definition for method 23 of type exit-chamber ;; INFO: Used lq/sq -(defmethod exit-chamber-method-23 exit-chamber ((obj exit-chamber) (arg0 symbol)) +(defmethod exit-chamber-method-23 exit-chamber ((this exit-chamber) (arg0 symbol)) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector<-cspace! (-> obj last-pos) (-> obj node-list data 3)) - (vector-! s5-0 (-> obj last-pos) (-> obj root-override trans)) - (set! (-> obj draw bounds quad) (-> s5-0 quad)) + (vector<-cspace! (-> this last-pos) (-> this node-list data 3)) + (vector-! s5-0 (-> this last-pos) (-> this root-override trans)) + (set! (-> this draw bounds quad) (-> s5-0 quad)) ) - (+! (-> obj draw bounds y) 16384.0) - (set! (-> obj draw bounds w) 67584.0) + (+! (-> this draw bounds y) 16384.0) + (set! (-> this draw bounds w) 67584.0) (let ((s5-1 (new 'stack-no-clear 'exit-chamber-items))) - (exit-chamber-method-21 obj s5-1) - (if (-> obj button) - (send-event (ppointer->process (-> obj button)) 'move-to (-> s5-1 button-pos) (-> s5-1 button-quat)) + (exit-chamber-method-21 this s5-1) + (if (-> this button) + (send-event (ppointer->process (-> this button)) 'move-to (-> s5-1 button-pos) (-> s5-1 button-quat)) ) - (when (and *target* (-> obj move-player?)) + (when (and *target* (-> this move-player?)) (let ((a1-6 (new 'stack-no-clear 'vector))) (set! (-> a1-6 quad) (-> s5-1 button-pos quad)) (+! (-> a1-6 y) 2662.4) @@ -676,16 +670,16 @@ ) (vector-reset! (-> *target* control transv)) ) - (if (-> obj door) - (send-event (ppointer->process (-> obj door)) 'move-to (-> s5-1 door-pos) (-> s5-1 door-quat)) + (if (-> this door) + (send-event (ppointer->process (-> this door)) 'move-to (-> s5-1 door-pos) (-> s5-1 door-quat)) ) (when arg0 - (let ((a0-12 (handle->process (-> obj fcell-handle)))) + (let ((a0-12 (handle->process (-> this fcell-handle)))) (when a0-12 - (when (or (-> obj move-fcell?) (< (-> (the-as fuel-cell a0-12) root-override trans y) (-> s5-1 fcell-pos y))) - (when (not (-> obj move-fcell?)) - (set! (-> obj move-fcell?) #t) - (let ((v1-50 (-> obj entity extra perm))) + (when (or (-> this move-fcell?) (< (-> (the-as fuel-cell a0-12) root-override trans y) (-> s5-1 fcell-pos y))) + (when (not (-> this move-fcell?)) + (set! (-> this move-fcell?) #t) + (let ((v1-50 (-> this entity extra perm))) (logior! (-> v1-50 status) (entity-perm-status user-set-from-cstage)) (set! (-> v1-50 user-int8 0) 1) ) @@ -761,8 +755,8 @@ '() :to self ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2.5)) (suspend) ) (send-event (ppointer->process (-> self door)) 'trigger) @@ -863,11 +857,11 @@ ) 0 (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-1 #f)) (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.75)) (-> self door)) + (when (and (not gp-1) (time-elapsed? (-> self state-time) (seconds 0.75)) (-> self door)) (set! gp-1 #t) (send-event (ppointer->process (-> self door)) 'untrigger) ) @@ -925,8 +919,8 @@ (restore-collide-with-as (-> (the-as fuel-cell v1-143) root-override)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (seek! (-> self wave-scale) 1.0 0.0016666667) (exit-chamber-method-20 self (-> self wave-scale)) (suspend) @@ -934,8 +928,8 @@ (if (-> self door) (send-event (ppointer->process (-> self door)) 'trigger) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2.5)) (seek! (-> self wave-scale) 1.0 0.0016666667) (exit-chamber-method-20 self (-> self wave-scale)) (suspend) @@ -975,7 +969,7 @@ ) :enter (behavior ((arg0 symbol)) (logior! (-> self mask) (process-mask platform)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (logclear! (-> self mask) (process-mask platform)) @@ -1065,17 +1059,17 @@ ) (load-state-want-display-level 'sunken 'display) (suspend) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-1 #f) (s5-0 #f) ) (ja-no-eval :group! (-> self draw art-group data 7) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) - (when (and (not gp-1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.25)) (-> self door)) + (when (and (not gp-1) (time-elapsed? (-> self state-time) (seconds 0.25)) (-> self door)) (set! gp-1 #t) (send-event (ppointer->process (-> self door)) 'untrigger) ) - (when (+ (-> *display* base-frame-counter) (seconds -0.1)) + (when (+ (current-time) (seconds -0.1)) (let ((a0-9 (new 'stack-no-clear 'vector))) (set! (-> a0-9 quad) (-> self last-pos quad)) (+! (-> a0-9 y) 64102.4) @@ -1118,8 +1112,8 @@ (restore-collide-with-as (-> (the-as fuel-cell v1-109) root-override)) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (suspend) ) (set-continue! *game-info* "sunkenb-start") @@ -1137,15 +1131,15 @@ ;; definition for method 11 of type exit-chamber ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! exit-chamber ((obj exit-chamber) (arg0 entity-actor)) - (process-entity-status! obj (entity-perm-status bit-3) #t) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (set! (-> obj move-player?) #f) - (set! (-> obj move-fcell?) #f) - (set! (-> obj play-assistant-message?) #t) - (set! (-> obj wave-scale) 0.0) - (set! (-> obj fcell-handle) (the-as handle #f)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! exit-chamber ((this exit-chamber) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status bit-3) #t) + (process-entity-status! this (entity-perm-status bit-7) #t) + (set! (-> this move-player?) #f) + (set! (-> this move-fcell?) #f) + (set! (-> this play-assistant-message?) #t) + (set! (-> this wave-scale) 0.0) + (set! (-> this fcell-handle) (the-as handle #f)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1163,63 +1157,63 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *exit-chamber-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 620) obj)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *exit-chamber-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 620) this)) (ja-channel-set! 1) (let ((s4-1 (get-reminder (get-task-control (game-task sunken-room)) 0))) (let ((s2-0 #f) (s3-1 (new 'stack-no-clear 'matrix)) ) - (let ((a0-17 (-> obj entity extra perm))) - (set! (-> obj move-fcell?) (nonzero? (-> a0-17 user-int8 0))) + (let ((a0-17 (-> this entity extra perm))) + (set! (-> this move-fcell?) (nonzero? (-> a0-17 user-int8 0))) ) (let ((v1-35 s4-1)) (cond ((zero? v1-35) - (set! (-> obj chargers-active) (the-as uint 0)) - (let ((s1-0 (-> obj skel root-channel 0))) + (set! (-> this chargers-active) (the-as uint 0)) + (let ((s1-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s1-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s1-0 frame-num) 0.0) ) ) ((= v1-35 1) - (set! (-> obj chargers-active) (the-as uint 62)) - (let ((s1-1 (-> obj skel root-channel 0))) + (set! (-> this chargers-active) (the-as uint 62)) + (let ((s1-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s1-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s1-1 frame-num) 0.0) ) ) ((= v1-35 2) - (set! (-> obj chargers-active) (the-as uint 62)) - (let ((s1-2 (-> obj skel root-channel 0))) + (set! (-> this chargers-active) (the-as uint 62)) + (let ((s1-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s1-2 - (the-as art-joint-anim (-> obj draw art-group data 6)) + (the-as art-joint-anim (-> this draw art-group data 6)) num-func-identity ) (set! (-> s1-2 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 6)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 6)) data 0 length) -1)) ) ) ) ) ) (ja-post) - (update-transforms! (-> obj root-override)) - (exit-chamber-method-21 obj (the-as exit-chamber-items s3-1)) + (update-transforms! (-> this root-override)) + (exit-chamber-method-21 this (the-as exit-chamber-items s3-1)) (let ((s1-3 #t)) (let ((v1-64 s4-1)) (cond @@ -1227,23 +1221,23 @@ (set! s1-3 #f) ) ((= v1-64 2) - (if (or (not *target*) (< 114688.0 (vector-vector-xz-distance (target-pos 0) (-> obj last-pos)))) + (if (or (not *target*) (< 114688.0 (vector-vector-xz-distance (target-pos 0) (-> this last-pos)))) (set! s1-3 #f) ) ) ) ) - (set! (-> obj door) (process-spawn sun-iris-door (-> s3-1 vector) (-> s3-1 vector 1) s1-3 :to obj)) + (set! (-> this door) (process-spawn sun-iris-door (-> s3-1 vector) (-> s3-1 vector 1) s1-3 :to this)) ) - (set! (-> obj button) - (process-spawn exit-chamber-button (-> s3-1 vector 2) (-> s3-1 vector 3) arg0 #f :to obj) + (set! (-> this button) + (process-spawn exit-chamber-button (-> s3-1 vector 2) (-> s3-1 vector 3) arg0 #f :to this) ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (static-sound-spec "chamber-move" :fo-min 300 :fo-max 400) - (-> obj root-override trans) - ) + (set! (-> this sound) (new + 'process + 'ambient-sound + (static-sound-spec "chamber-move" :fo-min 300 :fo-max 400) + (-> this root-override trans) + ) ) (when (not (task-complete? *game-info* (game-task sunken-room))) (let ((a0-40 (new 'stack-no-clear 'vector))) @@ -1251,24 +1245,24 @@ (set! (-> a0-40 quad) (-> (&+ s3-1 64) vector 0 quad)) (set-vector! a0-40 2357755.5 -882327.1 -6879603.0 1.0) ) - (set! (-> obj fcell-handle) (ppointer->handle (birth-pickup-at-point - a0-40 - (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) - #f - obj - (the-as fact-info #f) - ) - ) + (set! (-> this fcell-handle) (ppointer->handle (birth-pickup-at-point + a0-40 + (pickup-type fuel-cell) + (the float (-> this entity extra perm task)) + #f + this + (the-as fact-info #f) + ) + ) ) ) ) ) - (set! (-> obj orig-trans quad) (-> obj root-override trans quad)) - (set! (-> obj last-pos quad) (-> obj root-override trans quad)) - (set! (-> obj move-player?) #f) - (exit-chamber-method-23 obj #t) - (set! (-> obj move-player?) #f) + (set! (-> this orig-trans quad) (-> this root-override trans quad)) + (set! (-> this last-pos quad) (-> this root-override trans quad)) + (set! (-> this move-player?) #f) + (exit-chamber-method-23 this #t) + (set! (-> this move-player?) #f) (cond ((zero? s4-1) (go exit-chamber-charger-puzzle) diff --git a/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc index 6e80d5ac6e..0361936ef4 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sun-iris-door_REF.gc @@ -32,21 +32,21 @@ ) ;; definition for method 3 of type sun-iris-door -(defmethod inspect sun-iris-door ((obj sun-iris-door)) +(defmethod inspect sun-iris-door ((this sun-iris-door)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttimeout: ~f~%" (-> obj timeout)) - (format #t "~T~Tproximity?: ~A~%" (-> obj proximity?)) - (format #t "~T~Tdirectional-proximity?: ~A~%" (-> obj directional-proximity?)) - (format #t "~T~Tmove-to?: ~A~%" (-> obj move-to?)) - (format #t "~T~Tlocked-by-task?: ~A~%" (-> obj locked-by-task?)) - (format #t "~T~Tclose-dist: ~f~%" (-> obj close-dist)) - (format #t "~T~Topen-dist: ~f~%" (-> obj open-dist)) - (format #t "~T~Tmove-to-pos: #~%" (-> obj move-to-pos)) - (format #t "~T~Toutward-vec: #~%" (-> obj outward-vec)) - (format #t "~T~Tmove-to-quat: #~%" (-> obj move-to-quat)) - obj + (format #t "~T~Ttimeout: ~f~%" (-> this timeout)) + (format #t "~T~Tproximity?: ~A~%" (-> this proximity?)) + (format #t "~T~Tdirectional-proximity?: ~A~%" (-> this directional-proximity?)) + (format #t "~T~Tmove-to?: ~A~%" (-> this move-to?)) + (format #t "~T~Tlocked-by-task?: ~A~%" (-> this locked-by-task?)) + (format #t "~T~Tclose-dist: ~f~%" (-> this close-dist)) + (format #t "~T~Topen-dist: ~f~%" (-> this open-dist)) + (format #t "~T~Tmove-to-pos: #~%" (-> this move-to-pos)) + (format #t "~T~Toutward-vec: #~%" (-> this outward-vec)) + (format #t "~T~Tmove-to-quat: #~%" (-> this move-to-quat)) + this ) ;; failed to figure out what this is: @@ -56,33 +56,33 @@ ) ;; definition for method 21 of type sun-iris-door -(defmethod should-open? sun-iris-door ((obj sun-iris-door)) +(defmethod should-open? sun-iris-door ((this sun-iris-door)) (let ((f30-0 1228800.0)) 0.0 (let ((f0-7 (cond - ((-> obj directional-proximity?) + ((-> this directional-proximity?) (let ((s5-0 (new 'stack-no-clear 'vector))) (when *target* - (vector-! s5-0 (target-pos 0) (-> obj root-override trans)) + (vector-! s5-0 (target-pos 0) (-> this root-override trans)) (set! (-> s5-0 y) 0.0) - (set! f30-0 (fabs (vector-dot s5-0 (-> obj outward-vec)))) + (set! f30-0 (fabs (vector-dot s5-0 (-> this outward-vec)))) ) - (vector-! s5-0 (camera-pos) (-> obj root-override trans)) + (vector-! s5-0 (camera-pos) (-> this root-override trans)) (set! (-> s5-0 y) 0.0) - (fabs (vector-dot s5-0 (-> obj outward-vec))) + (fabs (vector-dot s5-0 (-> this outward-vec))) ) ) (else (if *target* - (set! f30-0 (vector-vector-xz-distance (-> obj root-override trans) (target-pos 0))) + (set! f30-0 (vector-vector-xz-distance (-> this root-override trans) (target-pos 0))) ) - (vector-vector-xz-distance (-> obj root-override trans) (camera-pos)) + (vector-vector-xz-distance (-> this root-override trans) (camera-pos)) ) ) ) ) - (when (or (>= (-> obj open-dist) f30-0) (>= (-> obj open-dist) f0-7)) - (if (or (not (-> obj locked-by-task?)) (task-complete? *game-info* (-> obj entity extra perm task))) + (when (or (>= (-> this open-dist) f30-0) (>= (-> this open-dist) f0-7)) + (if (or (not (-> this locked-by-task?)) (task-complete? *game-info* (-> this entity extra perm task))) (return #t) ) ) @@ -168,43 +168,43 @@ ) ;; definition for method 20 of type sun-iris-door -(defmethod should-close? sun-iris-door ((obj sun-iris-door)) +(defmethod should-close? sun-iris-door ((this sun-iris-door)) (let ((f30-0 1228800.0)) 0.0 (let ((f0-7 (cond - ((-> obj directional-proximity?) + ((-> this directional-proximity?) (let ((s5-0 (new 'stack-no-clear 'vector))) (when *target* - (vector-! s5-0 (target-pos 0) (-> obj root-override trans)) + (vector-! s5-0 (target-pos 0) (-> this root-override trans)) (set! (-> s5-0 y) 0.0) - (set! f30-0 (fabs (vector-dot s5-0 (-> obj outward-vec)))) + (set! f30-0 (fabs (vector-dot s5-0 (-> this outward-vec)))) ) - (vector-! s5-0 (camera-pos) (-> obj root-override trans)) + (vector-! s5-0 (camera-pos) (-> this root-override trans)) (set! (-> s5-0 y) 0.0) - (fabs (vector-dot s5-0 (-> obj outward-vec))) + (fabs (vector-dot s5-0 (-> this outward-vec))) ) ) (else (if *target* - (set! f30-0 (vector-vector-xz-distance (-> obj root-override trans) (target-pos 0))) + (set! f30-0 (vector-vector-xz-distance (-> this root-override trans) (target-pos 0))) ) - (vector-vector-xz-distance (-> obj root-override trans) (camera-pos)) + (vector-vector-xz-distance (-> this root-override trans) (camera-pos)) ) ) ) ) - (when (and (>= f30-0 (-> obj close-dist)) (>= f0-7 (-> obj close-dist))) + (when (and (>= f30-0 (-> this close-dist)) (>= f0-7 (-> this close-dist))) (cond - ((and *target* (-> obj directional-proximity?)) + ((and *target* (-> this directional-proximity?)) (let ((s4-6 (new 'stack-no-clear 'vector)) (s5-3 (new 'stack-no-clear 'vector)) ) - (vector-! s4-6 (target-pos 0) (-> obj root-override trans)) + (vector-! s4-6 (target-pos 0) (-> this root-override trans)) (set! (-> s4-6 y) 0.0) - (vector-! s5-3 (camera-pos) (-> obj root-override trans)) + (vector-! s5-3 (camera-pos) (-> this root-override trans)) (set! (-> s5-3 y) 0.0) - (case (>= (vector-dot (-> obj outward-vec) s4-6) 0.0) - (((>= (vector-dot (-> obj outward-vec) s5-3) 0.0)) + (case (>= (vector-dot (-> this outward-vec) s4-6) 0.0) + (((>= (vector-dot (-> this outward-vec) s5-3) 0.0)) (return #t) ) ) @@ -225,7 +225,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('trigger) - (let ((v0-0 (the-as object (-> *display* base-frame-counter)))) + (let ((v0-0 (the-as object (current-time)))) (set! (-> self state-time) (the-as time-frame v0-0)) v0-0 ) @@ -241,7 +241,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (clear-collide-with-as (-> self root-override)) (logior! (-> self draw status) (draw-status hidden)) ) @@ -255,9 +255,7 @@ (go sun-iris-door-closing) ) ) - (if (and (!= (-> self timeout) 0.0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self timeout)))) - ) + (if (and (!= (-> self timeout) 0.0) (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout))))) (go sun-iris-door-closing) ) ) @@ -319,10 +317,10 @@ ;; definition for method 11 of type sun-iris-door ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sun-iris-door ((obj sun-iris-door) (arg0 entity-actor)) +(defmethod init-from-entity! sun-iris-door ((this sun-iris-door) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj move-to?) #f) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) + (set! (-> this move-to?) #f) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -334,49 +332,49 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *sun-iris-door-sg* '()) - (set! (-> obj close-dist) 49152.0) - (set! (-> obj open-dist) 40960.0) - (set! (-> obj timeout) (res-lump-float arg0 'timeout)) - (set! (-> obj proximity?) (nonzero? (res-lump-value arg0 'proximity uint128))) - (set! (-> obj directional-proximity?) #f) - (when (name= (-> obj name) "sun-iris-door-6") - (set! (-> obj close-dist) 16384.0) - (set! (-> obj open-dist) 8192.0) - (set! (-> obj directional-proximity?) #t) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *sun-iris-door-sg* '()) + (set! (-> this close-dist) 49152.0) + (set! (-> this open-dist) 40960.0) + (set! (-> this timeout) (res-lump-float arg0 'timeout)) + (set! (-> this proximity?) (nonzero? (res-lump-value arg0 'proximity uint128))) + (set! (-> this directional-proximity?) #f) + (when (name= (-> this name) "sun-iris-door-6") + (set! (-> this close-dist) 16384.0) + (set! (-> this open-dist) 8192.0) + (set! (-> this directional-proximity?) #t) ) - (set! (-> obj locked-by-task?) (nonzero? (-> obj entity extra perm task))) + (set! (-> this locked-by-task?) (nonzero? (-> this entity extra perm task))) (let ((f0-11 (res-lump-float arg0 'scale-factor :default 1.0))) - (set-vector! (-> obj root-override scale) f0-11 f0-11 f0-11 1.0) - (set! (-> obj draw bounds w) (* 18432.0 f0-11)) - (let ((v1-25 (-> obj root-override root-prim))) + (set-vector! (-> this root-override scale) f0-11 f0-11 f0-11 1.0) + (set! (-> this draw bounds w) (* 18432.0 f0-11)) + (let ((v1-25 (-> this root-override root-prim))) (set! (-> v1-25 local-sphere w) (* 24576.0 f0-11 f0-11)) ) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-28 (res-lump-data (-> obj entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) + (let ((v1-28 (res-lump-data (-> this entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-28 - (+! (-> obj root-override trans x) (-> v1-28 0)) - (+! (-> obj root-override trans y) (-> v1-28 1)) - (+! (-> obj root-override trans z) (-> v1-28 2)) + (+! (-> this root-override trans x) (-> v1-28 0)) + (+! (-> this root-override trans y) (-> v1-28 1)) + (+! (-> this root-override trans z) (-> v1-28 2)) ) ) - (let ((f30-0 (quaternion-y-angle (-> obj root-override quat)))) - (set-vector! (-> obj outward-vec) (sin f30-0) 0.0 (cos f30-0) 1.0) + (let ((f30-0 (quaternion-y-angle (-> this root-override quat)))) + (set-vector! (-> this outward-vec) (sin f30-0) 0.0 (cos f30-0) 1.0) ) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (ja-post) (go sun-iris-door-closed) (none) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc index 8dc345ad11..1c48492a52 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-fish_REF.gc @@ -38,25 +38,25 @@ ) ;; definition for method 3 of type sunkenfisha -(defmethod inspect sunkenfisha ((obj sunkenfisha)) +(defmethod inspect sunkenfisha ((this sunkenfisha)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~T~Tpath-speed: ~f~%" (-> obj path-speed)) - (format #t "~T~Tpath-speed-seek-speed: ~f~%" (-> obj path-speed-seek-speed)) - (format #t "~T~Ttarg-path-speed: ~f~%" (-> obj targ-path-speed)) - (format #t "~T~Tpath-normal-speed-lo: ~f~%" (-> obj path-normal-speed-lo)) - (format #t "~T~Tpath-normal-speed-hi: ~f~%" (-> obj path-normal-speed-hi)) - (format #t "~T~Tpath-dir: ~f~%" (-> obj path-dir)) - (format #t "~T~Tchange-path-dir-time: ~D~%" (-> obj change-path-dir-time)) - (format #t "~T~Tlocal-path-offset: #~%" (-> obj local-path-offset)) - (format #t "~T~Ttarg-local-path-offset: #~%" (-> obj targ-local-path-offset)) - (format #t "~T~Tlocal-path-offset-dir: #~%" (-> obj local-path-offset-dir)) - (format #t "~T~Tmax-local-path-offset: #~%" (-> obj max-local-path-offset)) - (format #t "~T~Tfacing-rot: #~%" (-> obj facing-rot)) - (format #t "~T~Tpath-trans-offset: #~%" (-> obj path-trans-offset)) - obj + (format #t "~T~Tpath-u: ~f~%" (-> this path-u)) + (format #t "~T~Tpath-speed: ~f~%" (-> this path-speed)) + (format #t "~T~Tpath-speed-seek-speed: ~f~%" (-> this path-speed-seek-speed)) + (format #t "~T~Ttarg-path-speed: ~f~%" (-> this targ-path-speed)) + (format #t "~T~Tpath-normal-speed-lo: ~f~%" (-> this path-normal-speed-lo)) + (format #t "~T~Tpath-normal-speed-hi: ~f~%" (-> this path-normal-speed-hi)) + (format #t "~T~Tpath-dir: ~f~%" (-> this path-dir)) + (format #t "~T~Tchange-path-dir-time: ~D~%" (-> this change-path-dir-time)) + (format #t "~T~Tlocal-path-offset: #~%" (-> this local-path-offset)) + (format #t "~T~Ttarg-local-path-offset: #~%" (-> this targ-local-path-offset)) + (format #t "~T~Tlocal-path-offset-dir: #~%" (-> this local-path-offset-dir)) + (format #t "~T~Tmax-local-path-offset: #~%" (-> this max-local-path-offset)) + (format #t "~T~Tfacing-rot: #~%" (-> this facing-rot)) + (format #t "~T~Tpath-trans-offset: #~%" (-> this path-trans-offset)) + this ) ;; failed to figure out what this is: @@ -79,17 +79,17 @@ ;; definition for method 22 of type sunkenfisha ;; INFO: Return type mismatch int vs none. -(defmethod sunkenfisha-method-22 sunkenfisha ((obj sunkenfisha)) +(defmethod sunkenfisha-method-22 sunkenfisha ((this sunkenfisha)) 0 (none) ) ;; definition for method 21 of type sunkenfisha -(defmethod sunkenfisha-method-21 sunkenfisha ((obj sunkenfisha) (arg0 vector) (arg1 float) (arg2 vector)) - (eval-path-curve! (-> obj path) arg0 arg1 'interp) - (vector+! arg0 arg0 (-> obj path-trans-offset)) +(defmethod sunkenfisha-method-21 sunkenfisha ((this sunkenfisha) (arg0 vector) (arg1 float) (arg2 vector)) + (eval-path-curve! (-> this path) arg0 arg1 'interp) + (vector+! arg0 arg0 (-> this path-trans-offset)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (path-control-method-14 (-> obj path) s2-0 arg1) + (path-control-method-14 (-> this path) s2-0 arg1) (let ((f0-2 (atan (-> s2-0 x) (-> s2-0 z))) (s4-1 (new 'stack-no-clear 'vector)) ) @@ -100,98 +100,94 @@ ) ;; definition for method 24 of type sunkenfisha -(defmethod sunkenfisha-method-24 sunkenfisha ((obj sunkenfisha)) +(defmethod sunkenfisha-method-24 sunkenfisha ((this sunkenfisha)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'matrix)) (gp-0 (new 'stack-no-clear 'vector)) ) - (vector-! s4-0 (-> obj targ-local-path-offset) (-> obj local-path-offset)) - (when (>= (* 4096.0 (-> *display* seconds-per-frame)) (vector-length s4-0)) - (until (< (* 16384.0 (-> *display* seconds-per-frame)) (vector-length s4-0)) - (set! (-> obj targ-local-path-offset x) - (rand-vu-float-range (- (-> obj max-local-path-offset x)) (-> obj max-local-path-offset x)) + (vector-! s4-0 (-> this targ-local-path-offset) (-> this local-path-offset)) + (when (>= (* 4096.0 (seconds-per-frame)) (vector-length s4-0)) + (until (< (* 16384.0 (seconds-per-frame)) (vector-length s4-0)) + (set! (-> this targ-local-path-offset x) + (rand-vu-float-range (- (-> this max-local-path-offset x)) (-> this max-local-path-offset x)) ) - (set! (-> obj targ-local-path-offset y) - (rand-vu-float-range (- (-> obj max-local-path-offset y)) (-> obj max-local-path-offset y)) + (set! (-> this targ-local-path-offset y) + (rand-vu-float-range (- (-> this max-local-path-offset y)) (-> this max-local-path-offset y)) ) - (vector-! s4-0 (-> obj targ-local-path-offset) (-> obj local-path-offset)) + (vector-! s4-0 (-> this targ-local-path-offset) (-> this local-path-offset)) ) ) (vector-normalize! s4-0 1.0) (matrix-from-two-vectors-max-angle-partial! s3-0 - (-> obj local-path-offset-dir) + (-> this local-path-offset-dir) s4-0 - (* 16384.0 (-> *display* seconds-per-frame)) + (* 16384.0 (seconds-per-frame)) 0.1 ) - (vector-matrix*! (-> obj local-path-offset-dir) (-> obj local-path-offset-dir) s3-0) - (vector-normalize! (-> obj local-path-offset-dir) 1.0) - (vector-float*! gp-0 (-> obj local-path-offset-dir) (* 4096.0 (-> *display* seconds-per-frame))) - (vector+! (-> obj local-path-offset) (-> obj local-path-offset) gp-0) + (vector-matrix*! (-> this local-path-offset-dir) (-> this local-path-offset-dir) s3-0) + (vector-normalize! (-> this local-path-offset-dir) 1.0) + (vector-float*! gp-0 (-> this local-path-offset-dir) (* 4096.0 (seconds-per-frame))) + (vector+! (-> this local-path-offset) (-> this local-path-offset) gp-0) ) ) ;; definition for method 25 of type sunkenfisha ;; INFO: Return type mismatch float vs none. -(defmethod sunkenfisha-method-25 sunkenfisha ((obj sunkenfisha)) - (let* ((f0-0 (-> obj path-speed)) - (f1-1 - (seek f0-0 (-> obj targ-path-speed) (* (-> obj path-speed-seek-speed) (-> *display* seconds-per-frame))) - ) +(defmethod sunkenfisha-method-25 sunkenfisha ((this sunkenfisha)) + (let* ((f0-0 (-> this path-speed)) + (f1-1 (seek f0-0 (-> this targ-path-speed) (* (-> this path-speed-seek-speed) (seconds-per-frame)))) ) - (set! (-> obj path-speed) f1-1) - (let ((f30-0 (+ (-> obj path-u) (* (-> obj path-dir) f1-1 (-> *display* seconds-per-frame))))) + (set! (-> this path-speed) f1-1) + (let ((f30-0 (+ (-> this path-u) (* (-> this path-dir) f1-1 (seconds-per-frame))))) (cond ((< f30-0 0.0) (set! f30-0 (- f30-0)) - (sunkenfisha-method-20 obj) + (sunkenfisha-method-20 this) ) ((< 1.0 f30-0) (+! f30-0 (* 2.0 (- 1.0 f30-0))) - (sunkenfisha-method-20 obj) + (sunkenfisha-method-20 this) ) ) - (set! (-> obj path-u) f30-0) + (set! (-> this path-u) f30-0) ) ) (none) ) ;; definition for method 23 of type sunkenfisha -(defmethod sunkenfisha-method-23 sunkenfisha ((obj sunkenfisha)) +(defmethod sunkenfisha-method-23 sunkenfisha ((this sunkenfisha)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set-vector! s5-0 (- (vector-x-angle (-> obj root transv))) (vector-y-angle (-> obj root transv)) 0.0 1.0) - (set! (-> obj facing-rot x) - (deg-seek-smooth (-> obj facing-rot x) (-> s5-0 x) (* 16384.0 (-> *display* seconds-per-frame)) 0.1) + (set-vector! s5-0 (- (vector-x-angle (-> this root transv))) (vector-y-angle (-> this root transv)) 0.0 1.0) + (set! (-> this facing-rot x) + (deg-seek-smooth (-> this facing-rot x) (-> s5-0 x) (* 16384.0 (seconds-per-frame)) 0.1) ) - (set! (-> obj facing-rot y) - (deg-seek-smooth (-> obj facing-rot y) (-> s5-0 y) (* 32768.0 (-> *display* seconds-per-frame)) 0.1) + (set! (-> this facing-rot y) + (deg-seek-smooth (-> this facing-rot y) (-> s5-0 y) (* 32768.0 (seconds-per-frame)) 0.1) ) ) - (quaternion-zxy! (-> obj root quat) (-> obj facing-rot)) + (quaternion-zxy! (-> this root quat) (-> this facing-rot)) ) ;; definition for method 20 of type sunkenfisha -(defmethod sunkenfisha-method-20 sunkenfisha ((obj sunkenfisha)) - (set! (-> obj path-dir) (- (-> obj path-dir))) - (set! (-> obj path-speed) 0.0) - (set! (-> obj targ-path-speed) - (rand-vu-float-range (-> obj path-normal-speed-lo) (-> obj path-normal-speed-hi)) +(defmethod sunkenfisha-method-20 sunkenfisha ((this sunkenfisha)) + (set! (-> this path-dir) (- (-> this path-dir))) + (set! (-> this path-speed) 0.0) + (set! (-> this targ-path-speed) + (rand-vu-float-range (-> this path-normal-speed-lo) (-> this path-normal-speed-hi)) ) - (set! (-> obj change-path-dir-time) - (+ (-> *display* base-frame-counter) (rand-vu-int-range (seconds 5) (seconds 18))) + (set! (-> this change-path-dir-time) (+ (current-time) (rand-vu-int-range (seconds 5) (seconds 18)))) + (set! (-> this targ-local-path-offset y) + (* 0.5 (+ (-> this targ-local-path-offset y) (-> this local-path-offset y))) ) - (set! (-> obj targ-local-path-offset y) - (* 0.5 (+ (-> obj targ-local-path-offset y) (-> obj local-path-offset y))) - ) - (let* ((f0-8 (-> obj local-path-offset x)) - (f1-3 (- (-> obj targ-local-path-offset x) f0-8)) + (let* ((f0-8 (-> this local-path-offset x)) + (f1-3 (- (-> this targ-local-path-offset x) f0-8)) ) (when (< (fabs f1-3) 12288.0) (if (>= f1-3 0.0) - (set! (-> obj targ-local-path-offset x) (fmin (+ 12288.0 f0-8) (-> obj max-local-path-offset x))) - (set! (-> obj targ-local-path-offset x) (fmax (+ -12288.0 f0-8) (- (-> obj max-local-path-offset x)))) + (set! (-> this targ-local-path-offset x) (fmin (+ 12288.0 f0-8) (-> this max-local-path-offset x))) + (set! (-> this targ-local-path-offset x) (fmax (+ -12288.0 f0-8) (- (-> this max-local-path-offset x)))) ) ) ) @@ -206,7 +202,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (if (>= (-> *display* base-frame-counter) (-> self change-path-dir-time)) + (if (>= (current-time) (-> self change-path-dir-time)) (sunkenfisha-method-20 self) ) (sunkenfisha-method-24 self) @@ -242,28 +238,28 @@ ) ;; definition for method 26 of type sunkenfisha -(defmethod sunkenfisha-method-26 sunkenfisha ((obj sunkenfisha)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj (-> obj entity)) - (set-vector! (-> obj root scale) 6.0 6.0 6.0 1.0) +(defmethod sunkenfisha-method-26 sunkenfisha ((this sunkenfisha)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this (-> this entity)) + (set-vector! (-> this root scale) 6.0 6.0 6.0 1.0) (let ((v1-3 (rand-vu-int-count 3))) (cond ((zero? v1-3) - (initialize-skeleton obj *sunkenfisha-red-yellow-sg* '()) + (initialize-skeleton this *sunkenfisha-red-yellow-sg* '()) ) ((= v1-3 1) - (initialize-skeleton obj *sunkenfisha-yellow-blue-sg* '()) + (initialize-skeleton this *sunkenfisha-yellow-blue-sg* '()) ) ((= v1-3 2) - (initialize-skeleton obj *sunkenfisha-yellow-eye-sg* '()) + (initialize-skeleton this *sunkenfisha-yellow-eye-sg* '()) ) ) ) (ja-channel-set! 1) - (let ((s5-0 (-> obj skel root-channel 0))) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 6)) + (the-as art-joint-anim (-> this draw art-group data 6)) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) @@ -272,78 +268,80 @@ ;; definition for method 27 of type sunkenfisha ;; INFO: Used lq/sq -(defmethod sunkenfisha-method-27 sunkenfisha ((obj sunkenfisha)) +(defmethod sunkenfisha-method-27 sunkenfisha ((this sunkenfisha)) (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag)) - (vector-reset! (-> obj path-trans-offset)) - (set! (-> obj path-u) (rand-vu-float-range 0.0 1.0)) + (vector-reset! (-> this path-trans-offset)) + (set! (-> this path-u) (rand-vu-float-range 0.0 1.0)) (if (zero? (rand-vu-int-count 2)) - (set! (-> obj path-dir) 1.0) - (set! (-> obj path-dir) -1.0) + (set! (-> this path-dir) 1.0) + (set! (-> this path-dir) -1.0) ) - (set-vector! (-> obj max-local-path-offset) 16384.0 28672.0 0.0 1.0) + (set-vector! (-> this max-local-path-offset) 16384.0 28672.0 0.0 1.0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-5 (res-lump-data (-> obj entity) 'path-max-offset (pointer float) :tag-ptr (& sv-16)))) + (let ((v1-5 (res-lump-data (-> this entity) 'path-max-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-5 - (set! (-> obj max-local-path-offset x) (-> v1-5 0)) - (set! (-> obj max-local-path-offset y) (-> v1-5 1)) + (set! (-> this max-local-path-offset x) (-> v1-5 0)) + (set! (-> this max-local-path-offset y) (-> v1-5 1)) ) ) - (set-vector! (-> obj local-path-offset) 0.0 0.0 0.0 1.0) - (set! (-> obj local-path-offset x) - (rand-vu-float-range (- (-> obj max-local-path-offset x)) (-> obj max-local-path-offset x)) + (set-vector! (-> this local-path-offset) 0.0 0.0 0.0 1.0) + (set! (-> this local-path-offset x) + (rand-vu-float-range (- (-> this max-local-path-offset x)) (-> this max-local-path-offset x)) ) - (set! (-> obj local-path-offset y) - (rand-vu-float-range (- (-> obj max-local-path-offset y)) (-> obj max-local-path-offset y)) + (set! (-> this local-path-offset y) + (rand-vu-float-range (- (-> this max-local-path-offset y)) (-> this max-local-path-offset y)) ) - (set! (-> obj targ-local-path-offset quad) (-> obj local-path-offset quad)) - (set! (-> obj targ-local-path-offset x) - (rand-vu-float-range (- (-> obj max-local-path-offset x)) (-> obj max-local-path-offset x)) + (set! (-> this targ-local-path-offset quad) (-> this local-path-offset quad)) + (set! (-> this targ-local-path-offset x) + (rand-vu-float-range (- (-> this max-local-path-offset x)) (-> this max-local-path-offset x)) ) - (set! (-> obj targ-local-path-offset y) - (rand-vu-float-range (- (-> obj max-local-path-offset y)) (-> obj max-local-path-offset y)) + (set! (-> this targ-local-path-offset y) + (rand-vu-float-range (- (-> this max-local-path-offset y)) (-> this max-local-path-offset y)) ) - (vector-! (-> obj local-path-offset-dir) (-> obj targ-local-path-offset) (-> obj local-path-offset)) - (vector-normalize! (-> obj local-path-offset-dir) 1.0) - (set! (-> obj change-path-dir-time) - (+ (-> *display* base-frame-counter) (rand-vu-int-range (seconds 5) (seconds 18))) - ) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (vector-! (-> this local-path-offset-dir) (-> this targ-local-path-offset) (-> this local-path-offset)) + (vector-normalize! (-> this local-path-offset-dir) 1.0) + (set! (-> this change-path-dir-time) (+ (current-time) (rand-vu-int-range (seconds 5) (seconds 18)))) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-16 (res-lump-data (-> obj entity) 'path-trans-offset (pointer float) :tag-ptr (& sv-32)))) + (let ((v1-16 (res-lump-data (-> this entity) 'path-trans-offset (pointer float) :tag-ptr (& sv-32)))) (when v1-16 - (+! (-> obj path-trans-offset x) (-> v1-16 0)) - (+! (-> obj path-trans-offset y) (-> v1-16 1)) - (+! (-> obj path-trans-offset z) (-> v1-16 2)) + (+! (-> this path-trans-offset x) (-> v1-16 0)) + (+! (-> this path-trans-offset y) (-> v1-16 1)) + (+! (-> this path-trans-offset z) (-> v1-16 2)) ) ) - (if (< (-> obj path curve num-cverts) 2) + (if (< (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) (let ((f28-0 8192.0) (f30-0 26624.0) ) (set! sv-48 (new 'static 'res-tag)) - (let ((v1-23 (res-lump-data (-> obj entity) 'speed (pointer float) :tag-ptr (& sv-48)))) + (let ((v1-23 (res-lump-data (-> this entity) 'speed (pointer float) :tag-ptr (& sv-48)))) (when v1-23 (set! f28-0 (-> v1-23 0)) (set! f30-0 (-> v1-23 1)) ) ) - (let ((f0-35 (path-distance (-> obj path)))) - (set! (-> obj path-normal-speed-lo) (/ f28-0 f0-35)) - (set! (-> obj path-normal-speed-hi) (/ f30-0 f0-35)) + (let ((f0-35 (path-distance (-> this path)))) + (set! (-> this path-normal-speed-lo) (/ f28-0 f0-35)) + (set! (-> this path-normal-speed-hi) (/ f30-0 f0-35)) ) ) - (set! (-> obj path-speed-seek-speed) (* 2.0 (- (-> obj path-normal-speed-hi) (-> obj path-normal-speed-lo)))) - (set! (-> obj path-speed) (rand-vu-float-range (-> obj path-normal-speed-lo) (-> obj path-normal-speed-hi))) - (set! (-> obj targ-path-speed) (-> obj path-speed)) + (set! (-> this path-speed-seek-speed) + (* 2.0 (- (-> this path-normal-speed-hi) (-> this path-normal-speed-lo))) + ) + (set! (-> this path-speed) + (rand-vu-float-range (-> this path-normal-speed-lo) (-> this path-normal-speed-hi)) + ) + (set! (-> this targ-path-speed) (-> this path-speed)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (path-control-method-14 (-> obj path) s4-0 (-> obj path-u)) - (set-vector! (-> obj facing-rot) 0.0 (atan (-> s4-0 x) (-> s4-0 z)) 0.0 1.0) + (path-control-method-14 (-> this path) s4-0 (-> this path-u)) + (set-vector! (-> this facing-rot) 0.0 (atan (-> s4-0 x) (-> s4-0 z)) 0.0 1.0) ) - (if (< (-> obj path-dir) 0.0) - (set! (-> obj facing-rot y) (- (-> obj facing-rot y))) + (if (< (-> this path-dir) 0.0) + (set! (-> this facing-rot y) (- (-> this facing-rot y))) ) ) @@ -359,12 +357,12 @@ ;; definition for method 11 of type sunkenfisha ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sunkenfisha ((obj sunkenfisha) (arg0 entity-actor)) - (sunkenfisha-method-26 obj) - (sunkenfisha-method-27 obj) - (let ((s5-0 (+ (res-lump-value (-> obj entity) 'count uint128 :default (the-as uint128 1)) -1))) +(defmethod init-from-entity! sunkenfisha ((this sunkenfisha) (arg0 entity-actor)) + (sunkenfisha-method-26 this) + (sunkenfisha-method-27 this) + (let ((s5-0 (+ (res-lump-value (-> this entity) 'count uint128 :default (the-as uint128 1)) -1))) (while (> (the-as int s5-0) 0) - (process-spawn sunkenfisha (-> obj entity) :to obj) + (process-spawn sunkenfisha (-> this entity) :to this) (+! s5-0 -1) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc index 4ec5668e29..c47ebe7ae7 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-obs_REF.gc @@ -10,35 +10,35 @@ ) ;; definition for method 3 of type water-vol-deadly -(defmethod inspect water-vol-deadly ((obj water-vol-deadly)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect water-vol-deadly ((this water-vol-deadly)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; definition of type side-to-side-plat @@ -52,12 +52,12 @@ ) ;; definition for method 3 of type side-to-side-plat -(defmethod inspect side-to-side-plat ((obj side-to-side-plat)) +(defmethod inspect side-to-side-plat ((this side-to-side-plat)) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpart-ry: ~f~%" (-> obj part-ry)) - obj + (format #t "~T~Tpart-ry: ~f~%" (-> this part-ry)) + this ) ;; failed to figure out what this is: @@ -122,14 +122,14 @@ ) ;; definition for method 23 of type side-to-side-plat -(defmethod get-unlit-skel side-to-side-plat ((obj side-to-side-plat)) +(defmethod get-unlit-skel side-to-side-plat ((this side-to-side-plat)) *side-to-side-plat-sg* ) ;; definition for method 24 of type side-to-side-plat ;; INFO: Return type mismatch int vs none. -(defmethod baseplat-method-24 side-to-side-plat ((obj side-to-side-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod baseplat-method-24 side-to-side-plat ((this side-to-side-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -147,7 +147,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -155,27 +155,27 @@ ;; definition for method 26 of type side-to-side-plat ;; INFO: Return type mismatch float vs none. -(defmethod baseplat-method-26 side-to-side-plat ((obj side-to-side-plat)) - (set! (-> obj part-ry) (+ 16384.0 (quaternion-y-angle (-> obj root-override quat)))) +(defmethod baseplat-method-26 side-to-side-plat ((this side-to-side-plat)) + (set! (-> this part-ry) (+ 16384.0 (quaternion-y-angle (-> this root-override quat)))) (none) ) ;; definition for method 25 of type side-to-side-plat ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. -(defmethod baseplat-method-25 side-to-side-plat ((obj side-to-side-plat)) - (let ((v0-0 (create-launch-control (-> *part-group-id-table* 436) obj))) - (set! (-> obj part) v0-0) +(defmethod baseplat-method-25 side-to-side-plat ((this side-to-side-plat)) + (let ((v0-0 (create-launch-control (-> *part-group-id-table* 436) this))) + (set! (-> this part) v0-0) (the-as sparticle-launch-group v0-0) ) ) ;; definition for method 20 of type side-to-side-plat ;; INFO: Return type mismatch object vs none. -(defmethod baseplat-method-20 side-to-side-plat ((obj side-to-side-plat)) - (when (nonzero? (-> obj part)) - (set! (-> *part-id-table* 1713 init-specs 14 initial-valuef) (-> obj part-ry)) - (set! (-> *part-id-table* 1714 init-specs 19 initial-valuef) (-> obj part-ry)) - (spawn (-> obj part) (-> obj root-override trans)) +(defmethod baseplat-method-20 side-to-side-plat ((this side-to-side-plat)) + (when (nonzero? (-> this part)) + (set! (-> *part-id-table* 1713 init-specs 14 initial-valuef) (-> this part-ry)) + (set! (-> *part-id-table* 1714 init-specs 19 initial-valuef) (-> this part-ry)) + (spawn (-> this part) (-> this root-override trans)) ) (none) ) @@ -192,12 +192,12 @@ ) ;; definition for method 3 of type sunkencam -(defmethod inspect sunkencam ((obj sunkencam)) +(defmethod inspect sunkencam ((this sunkencam)) (let ((t9-0 (method-of-type pov-camera inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tseq: ~D~%" (-> obj seq)) - obj + (format #t "~T~Tseq: ~D~%" (-> this seq)) + this ) ;; failed to figure out what this is: @@ -207,8 +207,8 @@ ) ;; definition for method 29 of type sunkencam -(defmethod set-stack-size! sunkencam ((obj sunkencam)) - (stack-size-set! (-> obj main-thread) 512) +(defmethod set-stack-size! sunkencam ((this sunkencam)) + (stack-size-set! (-> this main-thread) 512) (none) ) @@ -289,8 +289,8 @@ (send-event gp-2 'change-state cam-fixed 0) (send-event gp-2 'change-state *camera-base-mode* 0) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) @@ -326,8 +326,8 @@ (new 'static 'vector :x 2834432.0 :y -634880.0 :z -6811648.0) 1.3 ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) ) @@ -371,12 +371,12 @@ ) ;; definition for method 3 of type seaweed -(defmethod inspect seaweed ((obj seaweed)) +(defmethod inspect seaweed ((this seaweed)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tanim-speed: ~f~%" (-> obj anim-speed)) - obj + (format #t "~T~Tanim-speed: ~f~%" (-> this anim-speed)) + this ) ;; failed to figure out what this is: @@ -406,20 +406,20 @@ ;; definition for method 11 of type seaweed ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! seaweed ((obj seaweed) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *seaweed-sg* '()) +(defmethod init-from-entity! seaweed ((this seaweed) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *seaweed-sg* '()) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) data 0 @@ -431,8 +431,8 @@ ) ) ) - (set! (-> obj anim-speed) (rand-vu-float-range 0.2 0.4)) - (set! *seaweed* obj) + (set! (-> this anim-speed) (rand-vu-float-range 0.2 0.4)) + (set! *seaweed* this) (go seaweed-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-part_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-part_REF.gc index 9873985cd0..3e8d89b027 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type sunken-part -(defmethod inspect sunken-part ((obj sunken-part)) +(defmethod inspect sunken-part ((this sunken-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: 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 c6d6c81b3f..dce450794e 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-pipegame_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type sunken-pipegame-button -(defmethod inspect sunken-pipegame-button ((obj sunken-pipegame-button)) +(defmethod inspect sunken-pipegame-button ((this sunken-pipegame-button)) (let ((t9-0 (method-of-type basebutton inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type sunken-pipegame-prize @@ -39,21 +39,21 @@ ) ;; definition for method 3 of type sunken-pipegame-prize -(defmethod inspect sunken-pipegame-prize ((obj sunken-pipegame-prize)) - (format #t "[~8x] ~A~%" obj 'sunken-pipegame-prize) - (format #t "~Tpuzzle-delay: ~D~%" (-> obj puzzle-delay)) - (format #t "~Tpipe-travel-time-to-far: ~D~%" (-> obj pipe-travel-time-to-far)) - (format #t "~Tpipe-travel-time-to-jar: ~D~%" (-> obj pipe-travel-time-to-jar)) - (format #t "~Tactor-handle: ~D~%" (-> obj actor-handle)) - (format #t "~Tjar-pos: #~%" (-> obj jar-pos)) - (format #t "~Tfar-pos: #~%" (-> obj far-pos)) - (format #t "~Tsucked-up-jar-part-pos: #~%" (-> obj sucked-up-jar-part-pos)) - (format #t "~Tsucked-up-far-part-pos: #~%" (-> obj sucked-up-far-part-pos)) - (format #t "~Tblown-out-jar-part-pos: #~%" (-> obj blown-out-jar-part-pos)) - (format #t "~Tblown-out-far-part-pos: #~%" (-> obj blown-out-far-part-pos)) - (format #t "~Tsucked-up-part: ~A~%" (-> obj sucked-up-part)) - (format #t "~Tblown-out-part: ~A~%" (-> obj blown-out-part)) - obj +(defmethod inspect sunken-pipegame-prize ((this sunken-pipegame-prize)) + (format #t "[~8x] ~A~%" this 'sunken-pipegame-prize) + (format #t "~Tpuzzle-delay: ~D~%" (-> this puzzle-delay)) + (format #t "~Tpipe-travel-time-to-far: ~D~%" (-> this pipe-travel-time-to-far)) + (format #t "~Tpipe-travel-time-to-jar: ~D~%" (-> this pipe-travel-time-to-jar)) + (format #t "~Tactor-handle: ~D~%" (-> this actor-handle)) + (format #t "~Tjar-pos: #~%" (-> this jar-pos)) + (format #t "~Tfar-pos: #~%" (-> this far-pos)) + (format #t "~Tsucked-up-jar-part-pos: #~%" (-> this sucked-up-jar-part-pos)) + (format #t "~Tsucked-up-far-part-pos: #~%" (-> this sucked-up-far-part-pos)) + (format #t "~Tblown-out-jar-part-pos: #~%" (-> this blown-out-jar-part-pos)) + (format #t "~Tblown-out-far-part-pos: #~%" (-> this blown-out-far-part-pos)) + (format #t "~Tsucked-up-part: ~A~%" (-> this sucked-up-part)) + (format #t "~Tblown-out-part: ~A~%" (-> this blown-out-part)) + this ) ;; definition of type sunken-pipegame @@ -84,17 +84,17 @@ ) ;; definition for method 3 of type sunken-pipegame -(defmethod inspect sunken-pipegame ((obj sunken-pipegame)) +(defmethod inspect sunken-pipegame ((this sunken-pipegame)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tabort-audio-if-beaten?: ~A~%" (-> obj abort-audio-if-beaten?)) - (format #t "~T~Tchallenges-mask: ~D~%" (-> obj challenges-mask)) - (format #t "~T~Tchallenge: ~D~%" (-> obj challenge)) - (format #t "~T~Tticker: #~%" (-> obj ticker)) - (format #t "~T~Tbutton[3] @ #x~X~%" (-> obj button)) - (format #t "~T~Tprize[3] @ #x~X~%" (-> obj prize)) - obj + (format #t "~T~Tabort-audio-if-beaten?: ~A~%" (-> this abort-audio-if-beaten?)) + (format #t "~T~Tchallenges-mask: ~D~%" (-> this challenges-mask)) + (format #t "~T~Tchallenge: ~D~%" (-> this challenge)) + (format #t "~T~Tticker: #~%" (-> this ticker)) + (format #t "~T~Tbutton[3] @ #x~X~%" (-> this button)) + (format #t "~T~Tprize[3] @ #x~X~%" (-> this prize)) + this ) ;; failed to figure out what this is: @@ -554,7 +554,7 @@ ;; definition for method 20 of type sunken-pipegame ;; INFO: Return type mismatch int vs uint. -(defmethod sunken-pipegame-method-20 sunken-pipegame ((obj sunken-pipegame)) +(defmethod sunken-pipegame-method-20 sunken-pipegame ((this sunken-pipegame)) (let ((gp-0 0)) (if (task-complete? *game-info* (game-task sunken-pipe)) (+! gp-0 1) @@ -623,7 +623,7 @@ ) :code (behavior () (local-vars (v1-112 symbol)) - (let ((gp-0 (-> *display* base-frame-counter))) + (let ((gp-0 (current-time))) (if (not (handle->process (-> self prize (-> self challenge) actor-handle))) (go sunken-pipegame-end-play) ) @@ -644,14 +644,14 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((f30-0 0.0)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (let ((s5-3 (-> self prize (-> self challenge)))) (spawn (-> s5-3 sucked-up-part) (-> s5-3 sucked-up-jar-part-pos)) (spawn (-> s5-3 blown-out-part) (-> s5-3 blown-out-far-part-pos)) ) - (+! f30-0 (* 1024.0 (-> *display* seconds-per-frame))) + (+! f30-0 (* 1024.0 (seconds-per-frame))) (let ((s5-4 (new 'stack-no-clear 'vector))) (set! (-> s5-4 quad) (-> (the-as (pointer uint128) (&+ (&-> self stack 160) (* 144 (-> self challenge)))))) (let* ((f28-0 (-> s5-4 y)) @@ -679,7 +679,7 @@ (let ((s5-5 (-> self prize (-> self challenge)))) (spawn (-> s5-5 sucked-up-part) (-> s5-5 sucked-up-jar-part-pos)) (spawn (-> s5-5 blown-out-part) (-> s5-5 blown-out-far-part-pos)) - (set! f28-1 (seek f28-1 20480.0 (* 81920.0 (-> *display* seconds-per-frame)))) + (set! f28-1 (seek f28-1 20480.0 (* 81920.0 (seconds-per-frame)))) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> s5-5 jar-pos quad)) (let* ((f26-0 (-> s4-0 y)) @@ -705,7 +705,7 @@ ) ) ) - (until (>= (- (-> *display* base-frame-counter) gp-0) (-> self prize (-> self challenge) pipe-travel-time-to-far)) + (until (time-elapsed? gp-0 (-> self prize (-> self challenge) pipe-travel-time-to-far)) (let ((s5-6 (-> self prize (-> self challenge)))) (spawn (-> s5-6 sucked-up-part) (-> s5-6 sucked-up-jar-part-pos)) (spawn (-> s5-6 blown-out-part) (-> s5-6 blown-out-far-part-pos)) @@ -716,7 +716,7 @@ (sunken-pipegame-method-22 self #t) (let ((f30-1 20480.0)) (until (= f30-1 0.0) - (set! f30-1 (seek f30-1 0.0 (* 81920.0 (-> *display* seconds-per-frame)))) + (set! f30-1 (seek f30-1 0.0 (* 81920.0 (seconds-per-frame)))) (let ((gp-1 (-> self prize (-> self challenge)))) (spawn (-> gp-1 sucked-up-part) (-> gp-1 sucked-up-jar-part-pos)) (spawn (-> gp-1 blown-out-part) (-> gp-1 blown-out-far-part-pos)) @@ -746,9 +746,9 @@ (suspend) (set! v1-112 (or (not *target*) (not (logtest? (-> *target* state-flags) (state-flags grabbed))))) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (sleep (-> self ticker) (-> self prize (-> self challenge) puzzle-delay)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (completed? (-> self ticker)) (suspend) ) @@ -760,13 +760,13 @@ (kill-current-level-hint '(camera) '() 'exit) (ambient-hint-spawn "gamcam26" (the-as vector #f) *entity-pool* 'camera) (set! (-> self abort-audio-if-beaten?) #t) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((f30-2 0.0)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (let ((gp-2 (-> self prize (-> self challenge)))) (spawn (-> gp-2 sucked-up-part) (-> gp-2 sucked-up-far-part-pos)) (spawn (-> gp-2 blown-out-part) (-> gp-2 blown-out-jar-part-pos)) - (+! f30-2 (* 1024.0 (-> *display* seconds-per-frame))) + (+! f30-2 (* 1024.0 (seconds-per-frame))) (let ((s5-7 (new 'stack-no-clear 'vector))) (set! (-> s5-7 quad) (-> gp-2 far-pos quad)) (let* ((f28-2 (-> s5-7 y)) @@ -795,7 +795,7 @@ (let ((gp-3 (-> self prize (-> self challenge)))) (spawn (-> gp-3 sucked-up-part) (-> gp-3 sucked-up-far-part-pos)) (spawn (-> gp-3 blown-out-part) (-> gp-3 blown-out-jar-part-pos)) - (set! f28-3 (seek f28-3 20480.0 (* 81920.0 (-> *display* seconds-per-frame)))) + (set! f28-3 (seek f28-3 20480.0 (* 81920.0 (seconds-per-frame)))) (let ((s5-8 (new 'stack-no-clear 'vector))) (set! (-> s5-8 quad) (-> gp-3 far-pos quad)) (let* ((f26-1 (-> s5-8 y)) @@ -830,10 +830,8 @@ (+! (-> a0-109 y) 40960.0) (send-event (handle->process (-> v1-184 actor-handle)) 'trans a0-109) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (-> self prize (-> self challenge) pipe-travel-time-to-jar) - ) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (-> self prize (-> self challenge) pipe-travel-time-to-jar)) (let ((gp-4 (-> self prize (-> self challenge)))) (spawn (-> gp-4 sucked-up-part) (-> gp-4 sucked-up-far-part-pos)) (spawn (-> gp-4 blown-out-part) (-> gp-4 blown-out-jar-part-pos)) @@ -842,7 +840,7 @@ ) (let ((f30-3 20480.0)) (until (= f30-3 0.0) - (set! f30-3 (seek f30-3 0.0 (* 40960.0 (-> *display* seconds-per-frame)))) + (set! f30-3 (seek f30-3 0.0 (* 40960.0 (seconds-per-frame)))) (let ((v1-203 (new 'stack-no-clear 'vector))) (set! (-> v1-203 quad) (-> (the-as (pointer uint128) (&+ (&-> self stack 160) (* 144 (-> self challenge)))))) (+! (-> v1-203 y) f30-3) @@ -861,8 +859,8 @@ (suspend) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1.5)) (suspend) ) (ambient-hint-spawn "st-lose" (the-as vector #f) *entity-pool* 'stinger) @@ -907,13 +905,13 @@ ) ;; definition for method 22 of type sunken-pipegame -(defmethod sunken-pipegame-method-22 sunken-pipegame ((obj sunken-pipegame) (arg0 symbol)) - (let* ((v1-0 (-> obj challenge)) +(defmethod sunken-pipegame-method-22 sunken-pipegame ((this sunken-pipegame) (arg0 symbol)) + (let* ((v1-0 (-> this challenge)) (a2-0 v1-0) ) (cond ((zero? a2-0) - (let ((v1-5 (handle->process (-> obj prize v1-0 actor-handle)))) + (let ((v1-5 (handle->process (-> this prize v1-0 actor-handle)))) (when v1-5 (if arg0 (restore-collide-with-as (-> (the-as collectable v1-5) root-override)) @@ -923,7 +921,7 @@ ) ) ((or (= a2-0 1) (= a2-0 2)) - (let ((v1-13 (handle->process (-> obj prize v1-0 actor-handle)))) + (let ((v1-13 (handle->process (-> this prize v1-0 actor-handle)))) (when v1-13 (if arg0 (restore-collide-with-as (-> (the-as collectable v1-13) root-override)) @@ -938,12 +936,12 @@ ) ;; definition for method 21 of type sunken-pipegame -(defmethod sunken-pipegame-method-21 sunken-pipegame ((obj sunken-pipegame) (arg0 symbol)) +(defmethod sunken-pipegame-method-21 sunken-pipegame ((this sunken-pipegame) (arg0 symbol)) (if arg0 - (logior! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) ) - (let ((v1-4 (-> obj child))) + (let ((v1-4 (-> this child))) (while v1-4 (if arg0 (logior! (-> v1-4 0 mask) (process-mask actor-pause)) @@ -956,9 +954,9 @@ ) ;; definition for method 10 of type sunken-pipegame -(defmethod deactivate sunken-pipegame ((obj sunken-pipegame)) +(defmethod deactivate sunken-pipegame ((this sunken-pipegame)) (dotimes (s5-0 3) - (let ((s4-0 (-> obj prize s5-0))) + (let ((s4-0 (-> this prize s5-0))) (if (nonzero? (-> s4-0 sucked-up-part)) (kill-and-free-particles (-> s4-0 sucked-up-part)) ) @@ -967,15 +965,15 @@ ) ) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type sunken-pipegame ;; INFO: Return type mismatch process-drawable vs sunken-pipegame. -(defmethod relocate sunken-pipegame ((obj sunken-pipegame) (arg0 int)) +(defmethod relocate sunken-pipegame ((this sunken-pipegame) (arg0 int)) (dotimes (v1-0 3) - (let ((a0-4 (-> obj prize v1-0))) + (let ((a0-4 (-> this prize v1-0))) (when (nonzero? (-> a0-4 sucked-up-part)) (if (nonzero? (-> a0-4 sucked-up-part)) (&+! (-> a0-4 sucked-up-part) arg0) @@ -990,36 +988,36 @@ ) (the-as sunken-pipegame - ((the-as (function process-drawable int process-drawable) (find-parent-method sunken-pipegame 7)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method sunken-pipegame 7)) this arg0) ) ) ;; definition for method 11 of type sunken-pipegame ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sunken-pipegame ((obj sunken-pipegame) (arg0 entity-actor)) - (set! (-> obj abort-audio-if-beaten?) #f) - (stack-size-set! (-> obj main-thread) 512) - (set! (-> obj challenge) -1) +(defmethod init-from-entity! sunken-pipegame ((this sunken-pipegame) (arg0 entity-actor)) + (set! (-> this abort-audio-if-beaten?) #f) + (stack-size-set! (-> this main-thread) 512) + (set! (-> this challenge) -1) (dotimes (v1-3 3) - (set! (-> obj prize v1-3 actor-handle) (the-as handle #f)) + (set! (-> this prize v1-3 actor-handle) (the-as handle #f)) ) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj challenges-mask) (sunken-pipegame-method-20 obj)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this challenges-mask) (sunken-pipegame-method-20 this)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'quaternion)) ) (quaternion-identity! s3-0) (dotimes (s2-0 3) - (let* ((s0-0 (-> obj prize s2-0)) + (let* ((s0-0 (-> this prize s2-0)) (v1-17 (ash 1 s2-0)) - (s1-1 (logtest? v1-17 (-> obj challenges-mask))) + (s1-1 (logtest? v1-17 (-> this challenges-mask))) ) - (eval-path-curve-div! (-> obj path) (-> s0-0 jar-pos) (the float (* s2-0 2)) 'interp) - (eval-path-curve-div! (-> obj path) (-> s0-0 far-pos) (the float (+ (* s2-0 2) 1)) 'interp) + (eval-path-curve-div! (-> this path) (-> s0-0 jar-pos) (the float (* s2-0 2)) 'interp) + (eval-path-curve-div! (-> this path) (-> s0-0 far-pos) (the float (+ (* s2-0 2) 1)) 'interp) (set! (-> s0-0 sucked-up-jar-part-pos quad) (-> s0-0 jar-pos quad)) (set! (-> s0-0 sucked-up-far-part-pos quad) (-> s0-0 far-pos quad)) (set! (-> s0-0 blown-out-jar-part-pos quad) (-> s0-0 jar-pos quad)) @@ -1033,14 +1031,14 @@ (set! (-> s0-0 pipe-travel-time-to-far) (seconds 8.5)) (set! (-> s0-0 pipe-travel-time-to-jar) (seconds 2.5)) (set-vector! s4-0 -30720.0 1146.88 5120.0 1.0) - (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 448) obj)) - (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 451) obj)) + (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 448) this)) + (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 451) this)) (+! (-> s0-0 jar-pos y) 11673.6) (+! (-> s0-0 far-pos y) 11673.6) (when (not s1-1) (set! (-> s0-0 actor-handle) (ppointer->handle - (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type fuel-cell) 45.0 #f obj (the-as fact-info #f)) + (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type fuel-cell) 45.0 #f this (the-as fact-info #f)) ) ) (let ((a1-10 (handle->process (-> s0-0 actor-handle)))) @@ -1055,15 +1053,15 @@ (set! (-> s0-0 pipe-travel-time-to-far) (seconds 5.5)) (set! (-> s0-0 pipe-travel-time-to-jar) (seconds 2.5)) (set-vector! s4-0 0.0 1146.88 5120.0 1.0) - (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 449) obj)) - (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 452) obj)) + (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 449) this)) + (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 452) this)) (+! (-> s0-0 jar-pos y) 7168.0) (+! (-> s0-0 far-pos y) 7168.0) (+! (-> s0-0 blown-out-far-part-pos y) 4096.0) (when (not s1-1) (set! (-> s0-0 actor-handle) (ppointer->handle - (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type buzzer) 49.0 #f obj (the-as fact-info #f)) + (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type buzzer) 49.0 #f this (the-as fact-info #f)) ) ) (let ((s0-1 (handle->process (-> s0-0 actor-handle)))) @@ -1079,15 +1077,15 @@ (set! (-> s0-0 pipe-travel-time-to-far) (seconds 4.5)) (set! (-> s0-0 pipe-travel-time-to-jar) (seconds 2.5)) (set-vector! s4-0 30720.0 1146.88 5120.0 1.0) - (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 450) obj)) - (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 453) obj)) + (set! (-> s0-0 sucked-up-part) (create-launch-control (-> *part-group-id-table* 450) this)) + (set! (-> s0-0 blown-out-part) (create-launch-control (-> *part-group-id-table* 453) this)) (+! (-> s0-0 jar-pos y) 7168.0) (+! (-> s0-0 far-pos y) 7168.0) (+! (-> s0-0 blown-out-far-part-pos y) 4096.0) (when (not s1-1) (set! (-> s0-0 actor-handle) (ppointer->handle - (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type buzzer) 65585.0 #f obj (the-as fact-info #f)) + (birth-pickup-at-point (-> s0-0 jar-pos) (pickup-type buzzer) 65585.0 #f this (the-as fact-info #f)) ) ) (let ((s0-2 (handle->process (-> s0-0 actor-handle)))) @@ -1100,9 +1098,9 @@ ) ) ) - (vector+! s4-0 s4-0 (-> obj root trans)) - (let ((v1-102 (process-spawn sunken-pipegame-button s4-0 s3-0 arg0 s1-1 :to obj))) - (set! (-> obj button s2-0) (the-as (pointer sunken-pipegame-button) v1-102)) + (vector+! s4-0 s4-0 (-> this root trans)) + (let ((v1-102 (process-spawn sunken-pipegame-button s4-0 s3-0 arg0 s1-1 :to this))) + (set! (-> this button s2-0) (the-as (pointer sunken-pipegame-button) v1-102)) (set! (-> (the-as (pointer sunken-pipegame-button) v1-102) 0 button-id) s2-0) ) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc b/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc index d12e350eb9..6e648de80a 100644 --- a/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/sunken-water_REF.gc @@ -23,20 +23,20 @@ ) ;; definition for method 3 of type sunken-water -(defmethod inspect sunken-water ((obj sunken-water)) +(defmethod inspect sunken-water ((this sunken-water)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tuse-sync?: ~A~%" (-> obj use-sync?)) - (format #t "~T~Tplaying-deadly-sound?: ~A~%" (-> obj playing-deadly-sound?)) - (format #t "~T~Tdeadly-time: ~f~%" (-> obj deadly-time)) - (format #t "~T~Tdeadly-fade: ~f~%" (-> obj deadly-fade)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tsafe-color-mult: #~%" (-> obj safe-color-mult)) - (format #t "~T~Tsafe-color-emissive: #~%" (-> obj safe-color-emissive)) - (format #t "~T~Tdeadly-color-mult: #~%" (-> obj deadly-color-mult)) - (format #t "~T~Tdeadly-color-emissive: #~%" (-> obj deadly-color-emissive)) - obj + (format #t "~T~Tuse-sync?: ~A~%" (-> this use-sync?)) + (format #t "~T~Tplaying-deadly-sound?: ~A~%" (-> this playing-deadly-sound?)) + (format #t "~T~Tdeadly-time: ~f~%" (-> this deadly-time)) + (format #t "~T~Tdeadly-fade: ~f~%" (-> this deadly-fade)) + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tsafe-color-mult: #~%" (-> this safe-color-mult)) + (format #t "~T~Tsafe-color-emissive: #~%" (-> this safe-color-emissive)) + (format #t "~T~Tdeadly-color-mult: #~%" (-> this deadly-color-mult)) + (format #t "~T~Tdeadly-color-emissive: #~%" (-> this deadly-color-emissive)) + this ) ;; definition for symbol ripple-for-sunken-water, type ripple-wave-set @@ -88,10 +88,10 @@ ) ;; definition for method 30 of type sunken-water -(defmethod draw-ripple sunken-water ((obj sunken-water)) - (set! (-> obj draw ripple send-query) #t) - (let ((gp-0 (-> obj draw ripple query))) - (let ((a0-1 (-> *display* base-frame-counter))) +(defmethod draw-ripple sunken-water ((this sunken-water)) + (set! (-> this draw ripple send-query) #t) + (let ((gp-0 (-> this draw ripple query))) + (let ((a0-1 (current-time))) (set! (-> gp-0 start-vertex) (logand (* 13 (logand a0-1 127)) 127)) ) (set! (-> gp-0 vertex-skip) 128) @@ -128,7 +128,7 @@ (cond ((< (get-current-phase (-> self sync)) (-> self deadly-time)) (when (!= (-> self deadly-fade) 1.0) - (seek! (-> self deadly-fade) 1.0 (* 8.0 (-> *display* seconds-per-frame))) + (seek! (-> self deadly-fade) 1.0 (* 8.0 (seconds-per-frame))) (let ((f30-0 (-> self deadly-fade))) (vector-lerp! (-> self draw color-mult) (-> self safe-color-mult) (-> self deadly-color-mult) f30-0) (vector-lerp! @@ -153,7 +153,7 @@ (else (logclear! (-> self flags) (water-flags wt19)) (when (!= (-> self deadly-fade) 0.0) - (seek! (-> self deadly-fade) 0.0 (* 8.0 (-> *display* seconds-per-frame))) + (seek! (-> self deadly-fade) 0.0 (* 8.0 (seconds-per-frame))) (let ((f30-1 (-> self deadly-fade))) (vector-lerp! (-> self draw color-mult) (-> self safe-color-mult) (-> self deadly-color-mult) f30-1) (vector-lerp! @@ -197,23 +197,23 @@ ;; definition for method 25 of type sunken-water ;; INFO: Return type mismatch uint vs none. -(defmethod water-vol-method-25 sunken-water ((obj sunken-water)) +(defmethod water-vol-method-25 sunken-water ((this sunken-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-25))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj playing-deadly-sound?) #f) - (set-vector! (-> obj safe-color-mult) 0.125 0.225 0.22 0.5) - (set-vector! (-> obj safe-color-emissive) 0.0 0.0 0.0 1.0) - (set-vector! (-> obj deadly-color-mult) 0.125 0.225 0.22 0.5) - (set-vector! (-> obj deadly-color-emissive) 0.33 0.6 0.0 1.0) - (let ((s5-0 (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15))) - (let ((f0-16 (res-lump-float (-> obj entity) 'percent :default -1.0))) + (set! (-> this playing-deadly-sound?) #f) + (set-vector! (-> this safe-color-mult) 0.125 0.225 0.22 0.5) + (set-vector! (-> this safe-color-emissive) 0.0 0.0 0.0 1.0) + (set-vector! (-> this deadly-color-mult) 0.125 0.225 0.22 0.5) + (set-vector! (-> this deadly-color-emissive) 0.33 0.6 0.0 1.0) + (let ((s5-0 (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15))) + (let ((f0-16 (res-lump-float (-> this entity) 'percent :default -1.0))) (if (or (< f0-16 0.0) (< 1.0 f0-16)) (set! f0-16 (cond (s5-0 0.5 ) - ((logtest? (water-flags wt19) (-> obj flags)) + ((logtest? (water-flags wt19) (-> this flags)) 1.0 ) (else @@ -225,17 +225,17 @@ (when (and s5-0 (or (= f0-16 0.0) (= f0-16 1.0))) (set! s5-0 #f) (if (= f0-16 0.0) - (logior! (-> obj flags) (water-flags wt19)) - (logclear! (-> obj flags) (water-flags wt19)) + (logior! (-> this flags) (water-flags wt19)) + (logclear! (-> this flags) (water-flags wt19)) ) ) - (set! (-> obj use-sync?) s5-0) - (set! (-> obj deadly-time) f0-16) + (set! (-> this use-sync?) s5-0) + (set! (-> this deadly-time) f0-16) ) (when s5-0 - (if (< (get-current-phase (-> obj sync)) (-> obj deadly-time)) - (set! (-> obj flags) (the-as water-flags (logior (water-flags wt19) (-> obj flags)))) - (set! (-> obj flags) (the-as water-flags (logclear (-> obj flags) (water-flags wt19)))) + (if (< (get-current-phase (-> this sync)) (-> this deadly-time)) + (set! (-> this flags) (the-as water-flags (logior (water-flags wt19) (-> this flags)))) + (set! (-> this flags) (the-as water-flags (logclear (-> this flags) (water-flags wt19)))) ) ) ) @@ -245,25 +245,25 @@ ;; definition for method 22 of type sunken-water ;; INFO: Used lq/sq ;; INFO: Return type mismatch ripple-merc-query vs none. -(defmethod water-vol-method-22 sunken-water ((obj sunken-water)) +(defmethod water-vol-method-22 sunken-water ((this sunken-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj play-ambient-sound?) #f) + (set! (-> this play-ambient-sound?) #f) (cond - ((logtest? (water-flags wt19) (-> obj flags)) - (set! (-> obj draw color-mult quad) (-> obj deadly-color-mult quad)) - (set! (-> obj draw color-emissive quad) (-> obj deadly-color-emissive quad)) - (set! (-> obj deadly-fade) 1.0) + ((logtest? (water-flags wt19) (-> this flags)) + (set! (-> this draw color-mult quad) (-> this deadly-color-mult quad)) + (set! (-> this draw color-emissive quad) (-> this deadly-color-emissive quad)) + (set! (-> this deadly-fade) 1.0) ) (else - (set! (-> obj draw color-mult quad) (-> obj safe-color-mult quad)) - (set! (-> obj draw color-emissive quad) (-> obj safe-color-emissive quad)) - (set! (-> obj deadly-fade) 0.0) + (set! (-> this draw color-mult quad) (-> this safe-color-mult quad)) + (set! (-> this draw color-emissive quad) (-> this safe-color-emissive quad)) + (set! (-> this deadly-fade) 0.0) ) ) (let ((s5-0 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) s5-0) + (set! (-> this draw ripple) s5-0) (set! (-> s5-0 global-scale) 3072.0) (set! (-> s5-0 close-fade-dist) 163840.0) (set! (-> s5-0 far-fade-dist) 245760.0) diff --git a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc index d7dfcdae24..e67392b00b 100644 --- a/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/target-tube_REF.gc @@ -140,25 +140,25 @@ ) ;; definition for method 3 of type tube-info -(defmethod inspect tube-info ((obj tube-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Ttube: ~D~%" (-> obj tube)) - (format #t "~Tdownhill: ~`vector`P~%" (-> obj downhill)) - (format #t "~Tcentertube: ~`vector`P~%" (-> obj centertube)) - (format #t "~Tdowntube: ~`vector`P~%" (-> obj downtube)) - (format #t "~Tsidetube: ~`vector`P~%" (-> obj sidetube)) - (format #t "~Tforetube: ~`vector`P~%" (-> obj foretube)) - (format #t "~Told-transv: ~`vector`P~%" (-> obj old-transv)) - (format #t "~Tmod-x: ~f~%" (-> obj mod-x)) - (format #t "~Tmod-y: ~f~%" (-> obj mod-y)) - (format #t "~Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~Tturn-anim-targ: ~f~%" (-> obj turn-anim-targ)) - (format #t "~Tturn-anim-frame: ~f~%" (-> obj turn-anim-frame)) - (format #t "~Tturn-anim-vel: ~f~%" (-> obj turn-anim-vel)) - (format #t "~Ttube-sound-id: ~D~%" (-> obj tube-sound-id)) - (format #t "~Ttube-sound-vol: ~f~%" (-> obj tube-sound-vol)) - obj +(defmethod inspect tube-info ((this tube-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Ttube: ~D~%" (-> this tube)) + (format #t "~Tdownhill: ~`vector`P~%" (-> this downhill)) + (format #t "~Tcentertube: ~`vector`P~%" (-> this centertube)) + (format #t "~Tdowntube: ~`vector`P~%" (-> this downtube)) + (format #t "~Tsidetube: ~`vector`P~%" (-> this sidetube)) + (format #t "~Tforetube: ~`vector`P~%" (-> this foretube)) + (format #t "~Told-transv: ~`vector`P~%" (-> this old-transv)) + (format #t "~Tmod-x: ~f~%" (-> this mod-x)) + (format #t "~Tmod-y: ~f~%" (-> this mod-y)) + (format #t "~Tstart-time: ~D~%" (-> this start-time)) + (format #t "~Tturn-anim-targ: ~f~%" (-> this turn-anim-targ)) + (format #t "~Tturn-anim-frame: ~f~%" (-> this turn-anim-frame)) + (format #t "~Tturn-anim-vel: ~f~%" (-> this turn-anim-vel)) + (format #t "~Ttube-sound-id: ~D~%" (-> this tube-sound-id)) + (format #t "~Ttube-sound-vol: ~f~%" (-> this tube-sound-vol)) + this ) ;; definition of type tube-bank @@ -170,9 +170,9 @@ ) ;; definition for method 3 of type tube-bank -(defmethod inspect tube-bank ((obj tube-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - obj +(defmethod inspect tube-bank ((this tube-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + this ) ;; definition for symbol *TUBE-bank*, type tube-bank @@ -186,7 +186,7 @@ 100.0 0.0 ) - (* 200.0 (-> *display* seconds-per-frame)) + (* 200.0 (seconds-per-frame)) ) (let ((f30-0 (-> self tube tube-sound-vol)) (f0-5 (lerp-scale -0.3 0.3 (-> self control unknown-float01) 0.0 122880.0)) @@ -305,7 +305,7 @@ (vector-v++! (-> self control unknown-vector00) s4-2) ) (let* ((f1-6 (-> self control unknown-surface01 fric)) - (f1-9 (- 1.0 (* 60.0 (-> *display* seconds-per-frame) (- 1.0 f1-6)))) + (f1-9 (- 1.0 (* 60.0 (seconds-per-frame) (- 1.0 f1-6)))) (f0-21 (* 0.5 (+ 1.0 f1-9))) ) (set! (-> self control unknown-vector00 x) (* (-> self control unknown-vector00 x) f0-21)) @@ -532,7 +532,7 @@ (set! (-> self tube entity) (-> a0-4 entity)) ) ) - (set! (-> self tube start-time) (-> *display* base-frame-counter)) + (set-time! (-> self tube start-time)) (set! (-> self tube tube-sound-id) (new-sound-id)) (set! (-> self tube tube-sound-vol) 0.0) (target-collide-set! 'tube 0.0) @@ -593,7 +593,7 @@ 0.0 36864.0 ) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) (set! (-> self tube turn-anim-vel) @@ -605,7 +605,7 @@ ) ) ) - (+! (-> self tube turn-anim-frame) (* (-> self tube turn-anim-vel) (-> *display* seconds-per-frame))) + (+! (-> self tube turn-anim-frame) (* (-> self tube turn-anim-vel) (seconds-per-frame))) (set! (-> self tube turn-anim-frame) (fmax -20.0 (fmin 20.0 (-> self tube turn-anim-frame)))) (cond ((and (>= (-> self tube turn-anim-frame) 20.0) (>= (-> self tube turn-anim-vel) 0.0)) @@ -674,7 +674,7 @@ (defstate target-tube-jump (target) :event (-> target-tube-start event) :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #f) (-> self control transv)) (logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf)) (set! (-> self control unknown-surface00) *tube-jump-mods*) @@ -688,7 +688,7 @@ (seek! (-> self control unknown-float122) (fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01))))) - (-> *display* seconds-per-frame) + (seconds-per-frame) ) ) :code (behavior ((arg0 float) (arg1 float)) @@ -747,9 +747,9 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (let ((gp-0 (-> self attack-info))) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self state-flags) (state-flags being-attacked)) - (set! (-> self game hit-time) (-> *display* base-frame-counter)) + (set-time! (-> self game hit-time)) (when (not (logtest? (-> arg1 mask) (attack-mask vector))) (vector-! (-> arg1 vector) @@ -872,10 +872,10 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (until v1-40 (suspend) - (set! v1-40 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (movie?)))) + (set! v1-40 (and (time-elapsed? (-> self state-time) (seconds 1)) (not (movie?)))) ) (go target-tube) ) @@ -901,16 +901,16 @@ ) ;; definition for method 3 of type slide-control -(defmethod inspect slide-control ((obj slide-control)) +(defmethod inspect slide-control ((this slide-control)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttarget: ~D~%" (-> obj target)) - (format #t "~T~Tpos: ~f~%" (-> obj pos)) - (format #t "~T~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~T~Trot: ~`vector`P~%" (-> obj rot)) - (format #t "~T~Tside: ~`vector`P~%" (-> obj side)) - obj + (format #t "~T~Ttarget: ~D~%" (-> this target)) + (format #t "~T~Tpos: ~f~%" (-> this pos)) + (format #t "~T~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~T~Trot: ~`vector`P~%" (-> this rot)) + (format #t "~T~Tside: ~`vector`P~%" (-> this side)) + this ) ;; definition for function distance-from-tangent @@ -1045,13 +1045,13 @@ ;; definition for method 11 of type slide-control ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! slide-control ((obj slide-control) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj target) (the-as handle #f)) - (go (method-of-object obj slide-control-watch)) +(defmethod init-from-entity! slide-control ((this slide-control) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this target) (the-as handle #f)) + (go (method-of-object this slide-control-watch)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc b/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc index 2cdc0d431d..26c42ca9b7 100644 --- a/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/wall-plat_REF.gc @@ -24,16 +24,16 @@ ) ;; definition for method 3 of type wall-plat -(defmethod inspect wall-plat ((obj wall-plat)) +(defmethod inspect wall-plat ((this wall-plat)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tuse-sync?: ~A~%" (-> obj use-sync?)) - (format #t "~T~Textended-amount: ~f~%" (-> obj extended-amount)) - (format #t "~T~Tin-trans: #~%" (-> obj in-trans)) - (format #t "~T~Tout-trans: #~%" (-> obj out-trans)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - obj + (format #t "~T~Tuse-sync?: ~A~%" (-> this use-sync?)) + (format #t "~T~Textended-amount: ~f~%" (-> this extended-amount)) + (format #t "~T~Tin-trans: #~%" (-> this in-trans)) + (format #t "~T~Tout-trans: #~%" (-> this out-trans)) + (format #t "~T~Tsync: #~%" (-> this sync)) + this ) ;; failed to figure out what this is: @@ -79,9 +79,9 @@ :trans rider-trans :code (behavior () (restore-collide-with-as (-> self root-override)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (seek! (-> self extended-amount) 1.0 (* 2.5 (-> *display* seconds-per-frame))) + (seek! (-> self extended-amount) 1.0 (* 2.5 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) (move-to-point! (-> self root-override) gp-0) @@ -130,9 +130,9 @@ ) :trans rider-trans :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (seek! (-> self extended-amount) 0.0 (* 2.5 (-> *display* seconds-per-frame))) + (seek! (-> self extended-amount) 0.0 (* 2.5 (seconds-per-frame))) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-lerp! gp-0 (-> self in-trans) (-> self out-trans) (-> self extended-amount)) (move-to-point! (-> self root-override) gp-0) @@ -198,10 +198,10 @@ ;; definition for method 11 of type wall-plat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! wall-plat ((obj wall-plat) (arg0 entity-actor)) - (set! (-> obj extended-amount) 0.0) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! wall-plat ((this wall-plat) (arg0 entity-actor)) + (set! (-> this extended-amount) 0.0) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -219,36 +219,36 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *wall-plat-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (set! (-> obj use-sync?) (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.2 0.2)) - (let ((f30-0 (quaternion-y-angle (-> obj root-override quat))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *wall-plat-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (set! (-> this use-sync?) (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.2 0.2)) + (let ((f30-0 (quaternion-y-angle (-> this root-override quat))) (s4-1 (new 'stack-no-clear 'vector)) ) (set-vector! s4-1 0.0 0.0 (+ 1638.4 (res-lump-float arg0 'tunemeters)) 1.0) (vector-rotate-around-y! s4-1 s4-1 f30-0) - (vector+! (-> obj out-trans) (-> obj root-override trans) s4-1) + (vector+! (-> this out-trans) (-> this root-override trans) s4-1) (set-vector! s4-1 0.0 0.0 20480.0 1.0) (vector-rotate-around-y! s4-1 s4-1 f30-0) - (vector+! (-> obj in-trans) (-> obj out-trans) s4-1) + (vector+! (-> this in-trans) (-> this out-trans) s4-1) ) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (cond - ((-> obj use-sync?) - (logclear! (-> obj mask) (process-mask actor-pause)) + ((-> this use-sync?) + (logclear! (-> this mask) (process-mask actor-pause)) (go wall-plat-sync-idle) ) (else diff --git a/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc b/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc index cab7e099a3..3067c44c57 100644 --- a/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/wedge-plats_REF.gc @@ -18,15 +18,15 @@ ) ;; definition for method 3 of type wedge-plat-master -(defmethod inspect wedge-plat-master ((obj wedge-plat-master)) +(defmethod inspect wedge-plat-master ((this wedge-plat-master)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcenter: #~%" (-> obj center)) - (format #t "~T~Trotspeed: ~f~%" (-> obj rotspeed)) - (format #t "~T~Trotate-inner: ~f~%" (-> obj rotate-inner)) - (format #t "~T~Trotate-outer: ~f~%" (-> obj rotate-outer)) - obj + (format #t "~T~Tcenter: #~%" (-> this center)) + (format #t "~T~Trotspeed: ~f~%" (-> this rotspeed)) + (format #t "~T~Trotate-inner: ~f~%" (-> this rotate-inner)) + (format #t "~T~Trotate-outer: ~f~%" (-> this rotate-outer)) + this ) ;; failed to figure out what this is: @@ -34,14 +34,10 @@ :code (behavior () (loop (set! (-> self rotate-inner) - (the float - (sar (shl (the int (+ (-> self rotate-inner) (* (-> self rotspeed) (-> *display* seconds-per-frame)))) 48) 48) - ) + (the float (sar (shl (the int (+ (-> self rotate-inner) (* (-> self rotspeed) (seconds-per-frame)))) 48) 48)) ) (set! (-> self rotate-outer) - (the float - (sar (shl (the int (- (-> self rotate-outer) (* (-> self rotspeed) (-> *display* seconds-per-frame)))) 48) 48) - ) + (the float (sar (shl (the int (- (-> self rotate-outer) (* (-> self rotspeed) (seconds-per-frame)))) 48) 48)) ) (suspend) ) @@ -51,14 +47,14 @@ ;; definition for method 11 of type wedge-plat-master ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! wedge-plat-master ((obj wedge-plat-master) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (set! (-> obj center quad) (-> arg0 extra trans quad)) - (+! (-> obj center y) 819.2) - (set! (-> obj rotspeed) (res-lump-float arg0 'rotspeed)) - (set! (-> obj rotate-inner) 0.0) - (set! (-> obj rotate-outer) 0.0) - (logclear! (-> obj mask) (process-mask actor-pause)) +(defmethod init-from-entity! wedge-plat-master ((this wedge-plat-master) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (set! (-> this center quad) (-> arg0 extra trans quad)) + (+! (-> this center y) 819.2) + (set! (-> this rotspeed) (res-lump-float arg0 'rotspeed)) + (set! (-> this rotate-inner) 0.0) + (set! (-> this rotate-outer) 0.0) + (logclear! (-> this mask) (process-mask actor-pause)) (go wedge-plat-master-idle) (none) ) @@ -83,14 +79,14 @@ ) ;; definition for method 3 of type wedge-plat -(defmethod inspect wedge-plat ((obj wedge-plat)) +(defmethod inspect wedge-plat ((this wedge-plat)) (let ((t9-0 (method-of-type baseplat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmaster: ~A~%" (-> obj master)) - (format #t "~T~Tdistance: ~f~%" (-> obj distance)) - (format #t "~T~Toffset: ~f~%" (-> obj offset)) - obj + (format #t "~T~Tmaster: ~A~%" (-> this master)) + (format #t "~T~Tdistance: ~f~%" (-> this distance)) + (format #t "~T~Toffset: ~f~%" (-> this offset)) + this ) ;; failed to figure out what this is: @@ -100,8 +96,8 @@ ) ;; definition for method 27 of type wedge-plat -(defmethod wedge-plat-method-27 wedge-plat ((obj wedge-plat)) - (let* ((a0-1 (-> obj master)) +(defmethod wedge-plat-method-27 wedge-plat ((this wedge-plat)) + (let* ((a0-1 (-> this master)) (v1-0 (if a0-1 (-> (the-as process-drawable (-> a0-1 ppointer)) brother) ) @@ -109,20 +105,20 @@ ) (when v1-0 (let ((s4-0 (&-> v1-0 27)) - (f30-0 (-> obj distance)) - (f28-0 (the float (sar (shl (the int (+ (the-as float (-> v1-0 32)) (-> obj offset))) 48) 48))) + (f30-0 (-> this distance)) + (f28-0 (the float (sar (shl (the int (+ (the-as float (-> v1-0 32)) (-> this offset))) 48) 48))) (s5-0 #f) ) (quaternion-axis-angle! - (-> obj root-override quat) + (-> this root-override quat) 0.0 1.0 0.0 (the float (sar (shl (the int (- 49152.0 f28-0)) 48) 48)) ) - (set! (-> obj basetrans x) (+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))) - (set! (-> obj basetrans y) (the-as float (-> s4-0 1))) - (set! (-> obj basetrans z) (+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))) + (set! (-> this basetrans x) (+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))) + (set! (-> this basetrans y) (the-as float (-> s4-0 1))) + (set! (-> this basetrans z) (+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))) (let ((f0-16 (cos f28-0))) (if (or (< 0.95 f0-16) (< f0-16 -0.95)) (set! s5-0 #t) @@ -189,8 +185,8 @@ (suspend) (ja :num! (seek! (ja-aframe 100.0 0))) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (ja :num-func num-func-identity :frame-num (ja-aframe 100.0 0)) (wedge-plat-method-27 self) (suspend) @@ -211,9 +207,9 @@ ;; definition for method 11 of type wedge-plat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! wedge-plat ((obj wedge-plat) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! wedge-plat ((this wedge-plat) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -231,17 +227,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *wedge-plat-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (set! (-> obj master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) - (set! (-> obj offset) (res-lump-float arg0 'rotoffset)) - (set! (-> obj distance) (res-lump-float arg0 'distance :default 36864.0)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *wedge-plat-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (set! (-> this master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this offset) (res-lump-float arg0 'rotoffset)) + (set! (-> this distance) (res-lump-float arg0 'distance :default 36864.0)) + (logclear! (-> this mask) (process-mask actor-pause)) (go wedge-plat-idle) (none) ) @@ -260,11 +256,11 @@ ) ;; definition for method 3 of type wedge-plat-outer -(defmethod inspect wedge-plat-outer ((obj wedge-plat-outer)) +(defmethod inspect wedge-plat-outer ((this wedge-plat-outer)) (let ((t9-0 (method-of-type wedge-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -274,8 +270,8 @@ ) ;; definition for method 27 of type wedge-plat-outer -(defmethod wedge-plat-method-27 wedge-plat-outer ((obj wedge-plat-outer)) - (let* ((a0-1 (-> obj master)) +(defmethod wedge-plat-method-27 wedge-plat-outer ((this wedge-plat-outer)) + (let* ((a0-1 (-> this master)) (v1-0 (if a0-1 (-> (the-as process-drawable (-> a0-1 ppointer)) brother) ) @@ -283,20 +279,20 @@ ) (when v1-0 (let ((s4-0 (&-> v1-0 27)) - (f30-0 (-> obj distance)) - (f28-0 (the float (sar (shl (the int (+ (the-as float (-> v1-0 33)) (-> obj offset))) 48) 48))) + (f30-0 (-> this distance)) + (f28-0 (the float (sar (shl (the int (+ (the-as float (-> v1-0 33)) (-> this offset))) 48) 48))) (s5-0 #f) ) (quaternion-axis-angle! - (-> obj root-override quat) + (-> this root-override quat) 0.0 1.0 0.0 (the float (sar (shl (the int (- 49152.0 f28-0)) 48) 48)) ) - (set! (-> obj basetrans x) (+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))) - (set! (-> obj basetrans y) (the-as float (-> s4-0 1))) - (set! (-> obj basetrans z) (+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))) + (set! (-> this basetrans x) (+ (the-as float (-> s4-0 0)) (* f30-0 (cos f28-0)))) + (set! (-> this basetrans y) (the-as float (-> s4-0 1))) + (set! (-> this basetrans z) (+ (the-as float (-> s4-0 2)) (* f30-0 (sin f28-0)))) (let ((f0-16 (sin f28-0))) (if (or (< 0.95 f0-16) (< f0-16 -0.95)) (set! s5-0 #t) @@ -362,8 +358,8 @@ (suspend) (ja :num! (seek! (ja-aframe 100.0 0))) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (ja :num-func num-func-identity :frame-num (ja-aframe 100.0 0)) (wedge-plat-method-27 self) (suspend) @@ -384,9 +380,9 @@ ;; definition for method 11 of type wedge-plat-outer ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! wedge-plat-outer ((obj wedge-plat-outer) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! wedge-plat-outer ((this wedge-plat-outer) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -404,17 +400,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *wedge-plat-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) - (update-transforms! (-> obj root-override)) - (baseplat-method-21 obj) - (set! (-> obj master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) - (set! (-> obj offset) (res-lump-float arg0 'rotoffset)) - (set! (-> obj distance) (res-lump-float arg0 'distance :default 69632.0)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *wedge-plat-sg* '()) + (logior! (-> this skel status) (janim-status inited)) + (update-transforms! (-> this root-override)) + (baseplat-method-21 this) + (set! (-> this master) (the-as wedge-plat-master (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this offset) (res-lump-float arg0 'rotoffset)) + (set! (-> this distance) (res-lump-float arg0 'distance :default 69632.0)) + (logclear! (-> this mask) (process-mask actor-pause)) (go wedge-plat-outer-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc b/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc index f332f28e68..97438bdf7c 100644 --- a/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc +++ b/test/decompiler/reference/jak1/levels/sunken/whirlpool_REF.gc @@ -22,15 +22,15 @@ ) ;; definition for method 3 of type whirlpool -(defmethod inspect whirlpool ((obj whirlpool)) +(defmethod inspect whirlpool ((this whirlpool)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tspin-ry: ~f~%" (-> obj spin-ry)) - (format #t "~T~Tspin-speed-idle: ~f~%" (-> obj spin-speed-idle)) - (format #t "~T~Tspin-speed-delta: ~f~%" (-> obj spin-speed-delta)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - obj + (format #t "~T~Tspin-ry: ~f~%" (-> this spin-ry)) + (format #t "~T~Tspin-speed-idle: ~f~%" (-> this spin-speed-idle)) + (format #t "~T~Tspin-speed-delta: ~f~%" (-> this spin-speed-delta)) + (format #t "~T~Tsync: #~%" (-> this sync)) + this ) ;; failed to figure out what this is: @@ -297,21 +297,21 @@ ) ;; definition for method 20 of type whirlpool -(defmethod whirlpool-method-20 whirlpool ((obj whirlpool) (arg0 float)) +(defmethod whirlpool-method-20 whirlpool ((this whirlpool) (arg0 float)) (let* ((gp-0 (target-pos 0)) - (f28-0 (vector-vector-xz-distance (-> obj root-override trans) gp-0)) + (f28-0 (vector-vector-xz-distance (-> this root-override trans) gp-0)) ) (when (< f28-0 40960.0) (let* ((f0-2 (* 0.000024414063 (- 40960.0 f28-0))) (f26-0 (* f0-2 f0-2)) - (f0-7 (atan (- (-> gp-0 x) (-> obj root-override trans x)) (- (-> gp-0 z) (-> obj root-override trans z)))) - (f30-0 (* 0.5 f26-0 arg0 (-> *display* seconds-per-frame))) + (f0-7 (atan (- (-> gp-0 x) (-> this root-override trans x)) (- (-> gp-0 z) (-> this root-override trans z)))) + (f30-0 (* 0.5 f26-0 arg0 (seconds-per-frame))) (f24-0 (+ f0-7 f30-0)) - (f28-1 (- f28-0 (fmin f28-0 (* 0.16874999 f26-0 (fabs arg0) (-> *display* seconds-per-frame))))) + (f28-1 (- f28-0 (fmin f28-0 (* 0.16874999 f26-0 (fabs arg0) (seconds-per-frame))))) (s4-1 (new 'stack-no-clear 'vector)) ) (set-vector! s4-1 (* (sin f24-0) f28-1) 0.0 (* (cos f24-0) f28-1) 1.0) - (vector+! s4-1 s4-1 (-> obj root-override trans)) + (vector+! s4-1 s4-1 (-> this root-override trans)) (set! (-> s4-1 x) (* (- (-> s4-1 x) (-> gp-0 x)) (-> *display* frames-per-second))) (set! (-> s4-1 y) 0.0) (set! (-> s4-1 z) (* (- (-> s4-1 z) (-> gp-0 z)) (-> *display* frames-per-second))) @@ -343,7 +343,7 @@ (spawn (-> self part) a1-0) ) ) - (+! (-> self spin-ry) (* f30-0 (-> *display* seconds-per-frame))) + (+! (-> self spin-ry) (* f30-0 (seconds-per-frame))) (quaternion-axis-angle! (-> self root-override quat) 0.0 1.0 0.0 (-> self spin-ry)) (if (and *target* (logtest? (-> *target* water flags) (water-flags wt09))) (whirlpool-method-20 self f30-0) @@ -359,21 +359,21 @@ ) ;; definition for method 10 of type whirlpool -(defmethod deactivate whirlpool ((obj whirlpool)) - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) +(defmethod deactivate whirlpool ((this whirlpool)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 11 of type whirlpool ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! whirlpool ((obj whirlpool) (arg0 entity-actor)) +(defmethod init-from-entity! whirlpool ((this whirlpool) (arg0 entity-actor)) (local-vars (sv-16 res-tag)) - (set! (-> obj spin-ry) (rand-vu-float-range 0.0 65536.0)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (set! (-> this spin-ry) (rand-vu-float-range 0.0 65536.0)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -384,11 +384,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *whirlpool-sg* '()) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *whirlpool-sg* '()) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) (let ((f30-0 32768.0) (f28-0 145635.56) ) @@ -399,24 +399,24 @@ (set! f28-0 (-> v1-17 1)) ) ) - (set! (-> obj spin-speed-idle) f30-0) - (set! (-> obj spin-speed-delta) (- f28-0 f30-0)) + (set! (-> this spin-speed-idle) f30-0) + (set! (-> this spin-speed-delta) (- f28-0 f30-0)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 447) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "whirlpool" :fo-max 55) (-> obj root-override trans)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 447) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "whirlpool" :fo-max 55) (-> this root-override trans)) ) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (go whirlpool-idle) (none) ) diff --git a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc index 380f325240..d97c9fd913 100644 --- a/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/billy_REF.gc @@ -30,38 +30,38 @@ ) ;; definition for method 3 of type billy -(defmethod inspect billy ((obj billy)) +(defmethod inspect billy ((this billy)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tfarthy: ~D~%" (-> obj farthy)) - (format #t "~T~Tpath-data[3] @ #x~X~%" (-> obj path-data)) - (format #t "~T~Tpath-snacks: ~A~%" (-> obj path-snacks)) - (format #t "~T~Tpath-starts: ~A~%" (-> obj path-starts)) - (format #t "~T~Tpath-waypts: ~A~%" (-> obj path-waypts)) - (format #t "~T~Tpassed-last-stage: ~A~%" (-> obj passed-last-stage)) - (format #t "~T~Tspawn-rats: ~A~%" (-> obj spawn-rats)) - (format #t "~T~Tcurrent-wave: ~D~%" (-> obj current-wave)) - (format #t "~T~Twave-start-time: ~D~%" (-> obj wave-start-time)) - (format #t "~T~Tnum-snacks: ~D~%" (-> obj num-snacks)) - (format #t "~T~Tnum-rats: ~D~%" (-> obj num-rats)) - (format #t "~T~Tmax-rats: ~D~%" (-> obj max-rats)) - (format #t "~T~Trat-speed: ~f~%" (-> obj rat-speed)) - (format #t "~T~Toffending-rat: ~D~%" (-> obj offending-rat)) - obj + (format #t "~T~Tfarthy: ~D~%" (-> this farthy)) + (format #t "~T~Tpath-data[3] @ #x~X~%" (-> this path-data)) + (format #t "~T~Tpath-snacks: ~A~%" (-> this path-snacks)) + (format #t "~T~Tpath-starts: ~A~%" (-> this path-starts)) + (format #t "~T~Tpath-waypts: ~A~%" (-> this path-waypts)) + (format #t "~T~Tpassed-last-stage: ~A~%" (-> this passed-last-stage)) + (format #t "~T~Tspawn-rats: ~A~%" (-> this spawn-rats)) + (format #t "~T~Tcurrent-wave: ~D~%" (-> this current-wave)) + (format #t "~T~Twave-start-time: ~D~%" (-> this wave-start-time)) + (format #t "~T~Tnum-snacks: ~D~%" (-> this num-snacks)) + (format #t "~T~Tnum-rats: ~D~%" (-> this num-rats)) + (format #t "~T~Tmax-rats: ~D~%" (-> this max-rats)) + (format #t "~T~Trat-speed: ~f~%" (-> this rat-speed)) + (format #t "~T~Toffending-rat: ~D~%" (-> this offending-rat)) + this ) ;; definition for method 7 of type billy ;; INFO: Return type mismatch process-drawable vs billy. -(defmethod relocate billy ((obj billy) (arg0 int)) +(defmethod relocate billy ((this billy) (arg0 int)) (countdown (v1-0 3) - (if (nonzero? (-> obj path-data v1-0)) - (&+! (-> obj path-data v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method billy 7)) this arg0) ) ) @@ -80,12 +80,12 @@ ) ;; definition for method 3 of type billy-snack -(defmethod inspect billy-snack ((obj billy-snack)) +(defmethod inspect billy-snack ((this billy-snack)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tnum-rats: ~D~%" (-> obj num-rats)) - obj + (format #t "~T~Tnum-rats: ~D~%" (-> this num-rats)) + this ) ;; failed to figure out what this is: @@ -162,15 +162,15 @@ ) ;; definition for method 3 of type billy-rat -(defmethod inspect billy-rat ((obj billy-rat)) +(defmethod inspect billy-rat ((this billy-rat)) (let ((t9-0 (method-of-type swamp-rat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdest-type: ~D~%" (-> obj dest-type)) - (format #t "~T~Tsnack: ~D~%" (-> obj snack)) - (format #t "~T~Tdestination: #~%" (-> obj destination)) - (format #t "~T~Tbilly: #x~X~%" (-> obj billy)) - obj + (format #t "~T~Tdest-type: ~D~%" (-> this dest-type)) + (format #t "~T~Tsnack: ~D~%" (-> this snack)) + (format #t "~T~Tdestination: #~%" (-> this destination)) + (format #t "~T~Tbilly: #x~X~%" (-> this billy)) + this ) ;; definition for function rat-about-to-eat? @@ -286,7 +286,7 @@ :trans (behavior () (set! (-> self speed-scale) (-> self billy 0 rat-speed)) (if (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) + (time-elapsed? (-> self state-time) (-> self chase-rest-time)) ) (go-virtual nav-enemy-victory) ) @@ -343,18 +343,18 @@ ) ;; definition for method 32 of type billy -(defmethod play-anim! billy ((obj billy) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! billy ((this billy) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 - (set! (-> obj blend-on-exit) (the-as art-joint-anim #t)) - (close-status! (-> obj tasks) (task-status need-introduction)) + (set! (-> this blend-on-exit) (the-as art-joint-anim #t)) + (close-status! (-> this tasks) (task-status need-introduction)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (dotimes (s4-0 (+ (the int (the float (+ (-> obj path-snacks curve num-cverts) -1))) 1)) - (eval-path-curve-div! (-> obj path-snacks) s5-1 (the float s4-0) 'exact) + (dotimes (s4-0 (+ (the int (the float (+ (-> this path-snacks curve num-cverts) -1))) 1)) + (eval-path-curve-div! (-> this path-snacks) s5-1 (the float s4-0) 'exact) (+! (-> s5-1 x) -40960.0) (+! (-> s5-1 z) 20480.0) - (manipy-spawn s5-1 (-> obj entity) *farthy-snack-sg* #f :to obj) + (manipy-spawn s5-1 (-> this entity) *farthy-snack-sg* #f :to this) ) ) ) @@ -396,9 +396,9 @@ ) ) (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) - (set! (-> obj blend-on-exit) (the-as art-joint-anim #t)) - (set! (-> obj will-talk) #t) + (set! (-> this skippable) #t) + (set! (-> this blend-on-exit) (the-as art-joint-anim #t)) + (set! (-> this will-talk) #t) (new 'static 'spool-anim :name "billy-reminder-1" :index 8 @@ -430,8 +430,8 @@ ) (((task-status need-reward-speech)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "billy-resolution" @@ -467,54 +467,54 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 31 of type billy -(defmethod get-art-elem billy ((obj billy)) - (case (current-status (-> obj tasks)) +(defmethod get-art-elem billy ((this billy)) + (case (current-status (-> this tasks)) (((task-status invalid) (task-status need-resolution)) - (-> obj draw art-group data 10) + (-> this draw art-group data 10) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 38 of type billy ;; INFO: Return type mismatch object vs none. -(defmethod process-taskable-method-38 billy ((obj billy)) - (case (current-status (-> obj tasks)) +(defmethod process-taskable-method-38 billy ((this billy)) + (case (current-status (-> this tasks)) (((task-status need-reminder-a) (task-status need-reminder)) - (go (method-of-object obj query)) + (go (method-of-object this query)) ) (((task-status need-reward-speech)) - (go (method-of-object obj play-anim)) + (go (method-of-object this play-anim)) ) (else - ((the-as (function nav-enemy none) (find-parent-method billy 38)) (the-as nav-enemy obj)) + ((the-as (function nav-enemy none) (find-parent-method billy 38)) (the-as nav-enemy this)) ) ) (none) ) ;; definition for method 34 of type billy -(defmethod get-accept-anim billy ((obj billy) (arg0 symbol)) +(defmethod get-accept-anim billy ((this billy) (arg0 symbol)) (if arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "billy-accept" :index 6 :parts 3 :command-list '()) ) ;; definition for method 36 of type billy -(defmethod get-reject-anim billy ((obj billy) (arg0 symbol)) +(defmethod get-reject-anim billy ((this billy) (arg0 symbol)) (new 'static 'spool-anim :name "billy-reject" :index 7 :parts 3 :command-list '()) ) @@ -634,27 +634,27 @@ (set! (-> self rat-speed) 1.0) (set! (-> self spawn-rats) #t) (set! (-> self passed-last-stage) #f) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 15)) + (when (time-elapsed? (-> self wave-start-time) (seconds 15)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-5 2) (set! (-> self max-rats) 8) (set! (-> self rat-speed) 1.2) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 20)) + (when (time-elapsed? (-> self wave-start-time) (seconds 20)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-5 4) (set! (-> self max-rats) 10) (set! (-> self rat-speed) 1.35) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 25)) + (when (time-elapsed? (-> self wave-start-time) (seconds 25)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ) @@ -668,27 +668,27 @@ (set! (-> self rat-speed) 1.0) (set! (-> self spawn-rats) #t) (set! (-> self passed-last-stage) #f) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 15)) + (when (time-elapsed? (-> self wave-start-time) (seconds 15)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-30 2) (set! (-> self max-rats) 7) (set! (-> self rat-speed) 1.2) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 20)) + (when (time-elapsed? (-> self wave-start-time) (seconds 20)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-30 4) (set! (-> self max-rats) 10) (set! (-> self rat-speed) 1.3) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 22)) + (when (time-elapsed? (-> self wave-start-time) (seconds 22)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ) @@ -702,27 +702,27 @@ (set! (-> self rat-speed) 1.0) (set! (-> self spawn-rats) #t) (set! (-> self passed-last-stage) #f) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 15)) + (when (time-elapsed? (-> self wave-start-time) (seconds 15)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-55 2) (set! (-> self max-rats) 7) (set! (-> self rat-speed) 1.1) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 18)) + (when (time-elapsed? (-> self wave-start-time) (seconds 18)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-55 4) (set! (-> self max-rats) 9) (set! (-> self rat-speed) 1.25) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 20)) + (when (time-elapsed? (-> self wave-start-time) (seconds 20)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ) @@ -736,27 +736,27 @@ (set! (-> self rat-speed) 0.9) (set! (-> self spawn-rats) #t) (set! (-> self passed-last-stage) #f) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 15)) + (when (time-elapsed? (-> self wave-start-time) (seconds 15)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-80 2) (set! (-> self max-rats) 6) (set! (-> self rat-speed) 1.0) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 18)) + (when (time-elapsed? (-> self wave-start-time) (seconds 18)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ((= v1-80 4) (set! (-> self max-rats) 8) (set! (-> self rat-speed) 1.1) (set! (-> self spawn-rats) #t) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 20)) + (when (time-elapsed? (-> self wave-start-time) (seconds 20)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ) @@ -780,13 +780,13 @@ (set! (-> self passed-last-stage) #t) ) ((begin (set! (-> self spawn-rats) #f) (zero? (-> self num-rats))) - (when (>= (- (-> *display* base-frame-counter) (-> self wave-start-time)) (seconds 3)) + (when (time-elapsed? (-> self wave-start-time) (seconds 3)) (+! (-> self current-wave) 1) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) (else - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) ) ) ) @@ -931,7 +931,7 @@ (ja-channel-set! 0) (clear-collide-with-as (-> self root-override)) (init! (-> self query) (the-as string #f) 40 150 25 #t (lookup-text! *common-text* (text-id quit) #f)) - (set! (-> self wave-start-time) (-> *display* base-frame-counter)) + (set-time! (-> self wave-start-time)) (set! (-> self num-snacks) 0) (set! (-> self num-rats) 0) (set! (-> self current-wave) 0) @@ -1026,63 +1026,63 @@ ) ;; definition for method 43 of type billy -(defmethod process-taskable-method-43 billy ((obj billy)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 billy ((this billy)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f30-0 (rand-float-gen))) (cond ((< 0.9411765 f30-0) - (play-ambient (-> obj ambient) "BIL-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM01" #f (-> this root-override trans)) ) ((< 0.88235295 f30-0) - (play-ambient (-> obj ambient) "BIL-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM02" #f (-> this root-override trans)) ) ((< 0.8235294 f30-0) - (play-ambient (-> obj ambient) "BIL-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM03" #f (-> this root-override trans)) ) ((< 0.7647059 f30-0) - (play-ambient (-> obj ambient) "BIL-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM04" #f (-> this root-override trans)) ) ((< 0.7058824 f30-0) - (play-ambient (-> obj ambient) "BIL-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM05" #f (-> this root-override trans)) ) ((< 0.64705884 f30-0) - (play-ambient (-> obj ambient) "BIL-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM06" #f (-> this root-override trans)) ) ((< 0.5882353 f30-0) - (play-ambient (-> obj ambient) "BIL-AM07" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM07" #f (-> this root-override trans)) ) ((< 0.5294118 f30-0) - (play-ambient (-> obj ambient) "BIL-AM08" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM08" #f (-> this root-override trans)) ) ((< 0.47058824 f30-0) - (play-ambient (-> obj ambient) "BIL-AM1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM1A" #f (-> this root-override trans)) ) ((< 0.4117647 f30-0) - (play-ambient (-> obj ambient) "BIL-AM2A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM2A" #f (-> this root-override trans)) ) ((< 0.3529412 f30-0) - (play-ambient (-> obj ambient) "BIL-AM2B" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-AM2B" #f (-> this root-override trans)) ) - ((= (current-status (-> obj tasks)) (task-status invalid)) + ((= (current-status (-> this tasks)) (task-status invalid)) #f ) ((< 0.29411766 f30-0) - (play-ambient (-> obj ambient) "BIL-LO01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO01" #f (-> this root-override trans)) ) ((< 0.23529412 f30-0) - (play-ambient (-> obj ambient) "BIL-LO02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO02" #f (-> this root-override trans)) ) ((< 0.1764706 f30-0) - (play-ambient (-> obj ambient) "BIL-LO03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO03" #f (-> this root-override trans)) ) ((< 0.11764706 f30-0) - (play-ambient (-> obj ambient) "BIL-LO1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO1A" #f (-> this root-override trans)) ) ((< 0.05882353 f30-0) - (play-ambient (-> obj ambient) "BIL-LO2A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO2A" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "BIL-LO2B" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "BIL-LO2B" #f (-> this root-override trans)) ) ) ) @@ -1133,7 +1133,7 @@ ;; definition for method 47 of type billy ;; INFO: Return type mismatch basic vs symbol. -(defmethod target-above-threshold? billy ((obj billy)) +(defmethod target-above-threshold? billy ((this billy)) (the-as symbol (and *target* (not (logtest? (-> *target* control root-prim prim-core action) (collide-action flut)))) @@ -1141,21 +1141,23 @@ ) ;; definition for method 11 of type billy -(defmethod init-from-entity! billy ((obj billy) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *billy-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task swamp-billy))) +(defmethod init-from-entity! billy ((this billy) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *billy-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task swamp-billy))) (dotimes (s5-0 3) - (let ((v1-3 (new 'process 'curve-control obj 'path (the float s5-0)))) - (set! (-> obj path-data s5-0) v1-3) + (let ((v1-3 (new 'process 'curve-control this 'path (the float s5-0)))) + (set! (-> this path-data s5-0) v1-3) (logior! (-> v1-3 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) - (set! (-> obj path) (-> obj path-snacks)) - (set! (-> obj farthy) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *billy-sidekick-sg* #f :to obj)) + (set! (-> this path) (-> this path-snacks)) + (set! (-> this farthy) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *billy-sidekick-sg* #f :to this) + ) ) - (send-event (handle->process (-> obj farthy)) 'center-joint 3) - (send-event (handle->process (-> obj farthy)) 'anim-mode 'clone-anim) - (process-taskable-method-42 obj) + (send-event (handle->process (-> this farthy)) 'center-joint 3) + (send-event (handle->process (-> this farthy)) 'anim-mode 'clone-anim) + (process-taskable-method-42 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 21879b9bbe..3e51388ac2 100644 --- a/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/kermit_REF.gc @@ -417,24 +417,24 @@ ) ;; definition for method 3 of type joint-mod-tracker -(defmethod inspect joint-mod-tracker ((obj joint-mod-tracker)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~Ttarget-pos-func: ~A~%" (-> obj target-pos-func)) - (format #t "~Tinv-forward-scale-factor: ~f~%" (-> obj inv-forward-scale-factor)) - (format #t "~Tforward-scale-control: ~f~%" (-> obj forward-scale-control)) - (format #t "~Tforward-scale-max: ~f~%" (-> obj forward-scale-max)) - (format #t "~Tprocess: ~A~%" (-> obj process)) - (format #t "~Tenable: ~A~%" (-> obj enable)) - (format #t "~Tup-axis: ~D~%" (-> obj up-axis)) - (format #t "~Tforward-axis: ~D~%" (-> obj forward-axis)) - obj +(defmethod inspect joint-mod-tracker ((this joint-mod-tracker)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~Ttarget-pos-func: ~A~%" (-> this target-pos-func)) + (format #t "~Tinv-forward-scale-factor: ~f~%" (-> this inv-forward-scale-factor)) + (format #t "~Tforward-scale-control: ~f~%" (-> this forward-scale-control)) + (format #t "~Tforward-scale-max: ~f~%" (-> this forward-scale-max)) + (format #t "~Tprocess: ~A~%" (-> this process)) + (format #t "~Tenable: ~A~%" (-> this enable)) + (format #t "~Tup-axis: ~D~%" (-> this up-axis)) + (format #t "~Tforward-axis: ~D~%" (-> this forward-axis)) + this ) ;; definition for method 7 of type joint-mod-tracker -(defmethod relocate joint-mod-tracker ((obj joint-mod-tracker) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate joint-mod-tracker ((this joint-mod-tracker) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for function build-matrix-from-up-and-forward-axes! @@ -550,12 +550,12 @@ ) ;; definition for method 3 of type kermit-pulse -(defmethod inspect kermit-pulse ((obj kermit-pulse)) +(defmethod inspect kermit-pulse ((this kermit-pulse)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - obj + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + this ) ;; failed to figure out what this is: @@ -569,13 +569,13 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :exit (behavior () (sound-stop (-> self sound-id)) ) :code (behavior () - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4)) + (while (not (time-elapsed? (-> self state-time) (seconds 4))) (sound-play "kermit-loop" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans))) (spawn (-> self part) (-> self root-override trans)) (find-ground-and-draw-shadow @@ -688,39 +688,39 @@ ) ;; definition for method 3 of type kermit -(defmethod inspect kermit ((obj kermit)) +(defmethod inspect kermit ((this kermit)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Trotate-dir: #~%" (-> obj rotate-dir)) - (format #t "~T~Tcharging-part: ~A~%" (-> obj charging-part)) - (format #t "~T~Tairborne: ~A~%" (-> obj airborne)) - (format #t "~T~Ttongue-control: ~A~%" (-> obj tongue-control)) - (format #t "~T~Ttongue-pulse-pos: ~f~%" (-> obj tongue-pulse-pos)) - (format #t "~T~Tmiss-count: ~D~%" (-> obj miss-count)) - (format #t "~T~Tcharged-up: ~A~%" (-> obj charged-up)) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - obj + (format #t "~T~Trotate-dir: #~%" (-> this rotate-dir)) + (format #t "~T~Tcharging-part: ~A~%" (-> this charging-part)) + (format #t "~T~Tairborne: ~A~%" (-> this airborne)) + (format #t "~T~Ttongue-control: ~A~%" (-> this tongue-control)) + (format #t "~T~Ttongue-pulse-pos: ~f~%" (-> this tongue-pulse-pos)) + (format #t "~T~Tmiss-count: ~D~%" (-> this miss-count)) + (format #t "~T~Tcharged-up: ~A~%" (-> this charged-up)) + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + this ) ;; definition for method 7 of type kermit ;; INFO: Return type mismatch nav-enemy vs kermit. -(defmethod relocate kermit ((obj kermit) (arg0 int)) - (if (nonzero? (-> obj tongue-control)) - (&+! (-> obj tongue-control) arg0) +(defmethod relocate kermit ((this kermit) (arg0 int)) + (if (nonzero? (-> this tongue-control)) + (&+! (-> this tongue-control) arg0) ) - (if (nonzero? (-> obj charging-part)) - (&+! (-> obj charging-part) arg0) + (if (nonzero? (-> this charging-part)) + (&+! (-> this charging-part) arg0) ) - (the-as kermit ((method-of-type nav-enemy relocate) obj arg0)) + (the-as kermit ((method-of-type nav-enemy relocate) this arg0)) ) ;; definition for method 10 of type kermit -(defmethod deactivate kermit ((obj kermit)) - (if (nonzero? (-> obj charging-part)) - (kill-and-free-particles (-> obj charging-part)) +(defmethod deactivate kermit ((this kermit)) + (if (nonzero? (-> this charging-part)) + (kill-and-free-particles (-> this charging-part)) ) - ((method-of-type nav-enemy deactivate) obj) + ((method-of-type nav-enemy deactivate) this) (none) ) @@ -925,9 +925,9 @@ nav-enemy-default-event-handler ;; definition for method 39 of type kermit ;; INFO: Return type mismatch int vs none. -(defmethod common-post kermit ((obj kermit)) - ((the-as (function nav-enemy none) (find-parent-method kermit 39)) obj) - (when (-> obj charged-up) +(defmethod common-post kermit ((this kermit)) + ((the-as (function nav-enemy none) (find-parent-method kermit 39)) this) + (when (-> this charged-up) ) 0 (none) @@ -1021,7 +1021,7 @@ nav-enemy-default-event-handler (defstate kermit-patrol (kermit) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) (kermit-get-new-patrol-point) (nav-control-method-11 (-> self nav) (-> self nav target-pos)) @@ -1031,7 +1031,7 @@ nav-enemy-default-event-handler (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (time-elapsed? (-> self state-time) (seconds 1)) ) (go kermit-idle) ) @@ -1090,7 +1090,7 @@ nav-enemy-default-event-handler (defstate kermit-chase-new-position (kermit) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self miss-count) 0) (let* ((a1-1 (kermit-get-head-dir-xz self (new 'stack-no-clear 'vector))) (gp-0 (vector-rotate-around-y! (new 'stack-no-clear 'vector) a1-1 16384.0)) @@ -1115,9 +1115,9 @@ nav-enemy-default-event-handler ) :trans (behavior () (when (not (-> self airborne)) - (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (if (or (time-elapsed? (-> self state-time) (seconds 3)) (and (logtest? (nav-control-flags navcf19) (-> self nav flags)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) ) ) (go kermit-chase) @@ -1145,7 +1145,7 @@ nav-enemy-default-event-handler (defstate kermit-chase (kermit) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (kermit-set-nav-mesh-target (-> self collide-info trans)) (nav-control-method-11 (-> self nav) (-> self nav target-pos)) @@ -1154,7 +1154,7 @@ nav-enemy-default-event-handler (kermit-set-nav-mesh-target (-> self collide-info trans)) (kermit-set-rotate-dir-to-player) (if (nav-enemy-test-point-in-nav-mesh? (target-pos 0)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (kermit-tongue-pos self) (let ((v1-5 (kermit-player-target-pos))) @@ -1177,7 +1177,7 @@ nav-enemy-default-event-handler ) ) ) - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go kermit-give-up) ) ) @@ -1277,7 +1277,7 @@ nav-enemy-default-event-handler ) (go kermit-retract-tongue) ) - (seek! (-> self tongue-pulse-pos) 1.0 (* 0.3 (-> *display* seconds-per-frame))) + (seek! (-> self tongue-pulse-pos) 1.0 (* 0.3 (seconds-per-frame))) (when (and (-> self child-override) (let ((v1-9 (-> self child-override))) (= (-> (if v1-9 (-> v1-9 0 self-override) @@ -1322,7 +1322,7 @@ nav-enemy-default-event-handler (defstate kermit-retract-tongue (kermit) :event nav-enemy-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self charged-up) #f) (+! (-> self miss-count) 1) ) @@ -1334,7 +1334,7 @@ nav-enemy-default-event-handler (kermit-set-nav-mesh-target (-> self collide-info trans)) (kermit-set-rotate-dir-to-player) (when (not (-> self airborne)) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 2.5)) + (when (time-elapsed? (-> self state-time) (seconds 2.5)) (kill-and-free-particles (-> self charging-part)) (set! (-> self charged-up) #t) (go kermit-chase) @@ -1422,9 +1422,9 @@ nav-enemy-default-event-handler ;; definition for method 11 of type kermit ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! kermit ((obj kermit) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! kermit ((this kermit) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1448,31 +1448,33 @@ nav-enemy-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj collide-info) s4-0) + (set! (-> this collide-info) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *kermit-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (set! (-> obj airborne) #f) - (init-defaults! obj *kermit-nav-enemy-info*) - (set-vector! (-> obj neck twist-max) 3640.889 3640.889 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 102400.0) - (set! (-> obj neck ignore-angle) 16384.0) - (set! (-> obj miss-count) 0) - (set! (-> obj tongue-control) (new 'process 'joint-mod-tracker obj 24 kermit-get-tongue-target-callback 1 2)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *kermit-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (set! (-> this airborne) #f) + (init-defaults! this *kermit-nav-enemy-info*) + (set-vector! (-> this neck twist-max) 3640.889 3640.889 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) + (set! (-> this miss-count) 0) + (set! (-> this tongue-control) + (new 'process 'joint-mod-tracker this 24 kermit-get-tongue-target-callback 1 2) + ) (let ((f0-16 49152.0)) - (set! (-> obj tongue-control inv-forward-scale-factor) (/ 1.0 f0-16)) + (set! (-> this tongue-control inv-forward-scale-factor) (/ 1.0 f0-16)) ) - (set! (-> obj tongue-control forward-scale-control) 0.0) - (set! (-> obj tongue-control forward-scale-max) 2.0) - (set! (-> obj tongue-control enable) #f) - (set! (-> obj charged-up) #t) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 299) obj)) - (set! (-> obj charging-part) (create-launch-control (-> *part-group-id-table* 298) obj)) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this tongue-control forward-scale-control) 0.0) + (set! (-> this tongue-control forward-scale-max) 2.0) + (set! (-> this tongue-control enable) #f) + (set! (-> this charged-up) #t) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 299) this)) + (set! (-> this charging-part) (create-launch-control (-> *part-group-id-table* 298) this)) + (set! (-> this sound-id) (new-sound-id)) (go kermit-idle) (none) ) 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 b7635a3c22..7afc91c410 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-bat_REF.gc @@ -16,21 +16,21 @@ ) ;; definition for method 3 of type swamp-bat-idle-path -(defmethod inspect swamp-bat-idle-path ((obj swamp-bat-idle-path)) - (format #t "[~8x] ~A~%" obj 'swamp-bat-idle-path) - (format #t "~Torigin: #~%" (-> obj origin)) - (format #t "~Tx-axis: #~%" (-> obj x-axis)) - (format #t "~Ty-axis: #~%" (-> obj y-axis)) - obj +(defmethod inspect swamp-bat-idle-path ((this swamp-bat-idle-path)) + (format #t "[~8x] ~A~%" this 'swamp-bat-idle-path) + (format #t "~Torigin: #~%" (-> this origin)) + (format #t "~Tx-axis: #~%" (-> this x-axis)) + (format #t "~Ty-axis: #~%" (-> this y-axis)) + this ) ;; definition for method 9 of type swamp-bat-idle-path ;; INFO: Used lq/sq -(defmethod swamp-bat-idle-path-method-9 swamp-bat-idle-path ((obj swamp-bat-idle-path) (arg0 vector) (arg1 float)) +(defmethod swamp-bat-idle-path-method-9 swamp-bat-idle-path ((this swamp-bat-idle-path) (arg0 vector) (arg1 float)) (let ((f30-0 (* 65536.0 arg1))) - (set! (-> arg0 quad) (-> obj origin quad)) - (vector+*! arg0 arg0 (-> obj x-axis) (cos f30-0)) - (vector+*! arg0 arg0 (-> obj y-axis) (sin f30-0)) + (set! (-> arg0 quad) (-> this origin quad)) + (vector+*! arg0 arg0 (-> this x-axis) (cos f30-0)) + (vector+*! arg0 arg0 (-> this y-axis) (sin f30-0)) ) arg0 ) @@ -59,31 +59,31 @@ ) ;; definition for method 3 of type swamp-bat -(defmethod inspect swamp-bat ((obj swamp-bat)) +(defmethod inspect swamp-bat ((this swamp-bat)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpath-origin: #~%" (-> obj path-origin)) - (format #t "~T~Tidle-position-angle[8] @ #x~X~%" (-> obj idle-position-angle)) - (format #t "~T~Tpath-select-plane[2] @ #x~X~%" (-> obj path-select-plane)) - (format #t "~T~Tpath-list[2] @ #x~X~%" (-> obj path-list)) - (format #t "~T~Tpath-select: ~D~%" (-> obj path-select)) - (format #t "~T~Tslave-count: ~D~%" (-> obj slave-count)) - (format #t "~T~Tpath-count: ~D~%" (-> obj path-count)) - obj + (format #t "~T~Tpath-origin: #~%" (-> this path-origin)) + (format #t "~T~Tidle-position-angle[8] @ #x~X~%" (-> this idle-position-angle)) + (format #t "~T~Tpath-select-plane[2] @ #x~X~%" (-> this path-select-plane)) + (format #t "~T~Tpath-list[2] @ #x~X~%" (-> this path-list)) + (format #t "~T~Tpath-select: ~D~%" (-> this path-select)) + (format #t "~T~Tslave-count: ~D~%" (-> this slave-count)) + (format #t "~T~Tpath-count: ~D~%" (-> this path-count)) + this ) ;; definition for method 7 of type swamp-bat ;; INFO: Return type mismatch process-drawable vs swamp-bat. -(defmethod relocate swamp-bat ((obj swamp-bat) (arg0 int)) +(defmethod relocate swamp-bat ((this swamp-bat) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj path-list v1-0)) - (&+! (-> obj path-list v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method swamp-bat 7)) this arg0) ) ) @@ -120,21 +120,21 @@ ) ;; definition for method 3 of type swamp-bat-slave -(defmethod inspect swamp-bat-slave ((obj swamp-bat-slave)) +(defmethod inspect swamp-bat-slave ((this swamp-bat-slave)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tidle-anim-speed: ~f~%" (-> obj idle-anim-speed)) - (format #t "~T~Tstrafe-envelope: ~f~%" (-> obj strafe-envelope)) - (format #t "~T~Tstrafe-distance: ~f~%" (-> obj strafe-distance)) - (format #t "~T~Tpath-point-count: ~f~%" (-> obj path-point-count)) - (format #t "~T~Tidle-path: #~%" (-> obj idle-path)) - (format #t "~T~Tidle-position: #~%" (-> obj idle-position)) - (format #t "~T~Tidle-position-index: ~D~%" (-> obj idle-position-index)) - (format #t "~T~Tpath-select: ~D~%" (-> obj path-select)) - (format #t "~T~Tlaunch-ready: ~A~%" (-> obj launch-ready)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tidle-anim-speed: ~f~%" (-> this idle-anim-speed)) + (format #t "~T~Tstrafe-envelope: ~f~%" (-> this strafe-envelope)) + (format #t "~T~Tstrafe-distance: ~f~%" (-> this strafe-distance)) + (format #t "~T~Tpath-point-count: ~f~%" (-> this path-point-count)) + (format #t "~T~Tidle-path: #~%" (-> this idle-path)) + (format #t "~T~Tidle-position: #~%" (-> this idle-position)) + (format #t "~T~Tidle-position-index: ~D~%" (-> this idle-position-index)) + (format #t "~T~Tpath-select: ~D~%" (-> this path-select)) + (format #t "~T~Tlaunch-ready: ~A~%" (-> this launch-ready)) + this ) ;; definition for function swamp-bat-slave-event-handler @@ -165,8 +165,8 @@ swamp-bat-slave-event-handler ) ;; definition for method 20 of type swamp-bat-slave -(defmethod swamp-bat-slave-method-20 swamp-bat-slave ((obj swamp-bat-slave)) - (* (get-current-phase (-> obj sync)) (-> obj path-point-count)) +(defmethod swamp-bat-slave-method-20 swamp-bat-slave ((this swamp-bat-slave)) + (* (get-current-phase (-> this sync)) (-> this path-point-count)) ) ;; definition for function swamp-bat-slave-path-post @@ -189,7 +189,7 @@ swamp-bat-slave-event-handler ) ) ) - (seek! (-> self strafe-distance) f0-4 (* 20480.0 (-> *display* seconds-per-frame))) + (seek! (-> self strafe-distance) f0-4 (* 20480.0 (seconds-per-frame))) ) (vector-float*! s4-0 s4-0 (-> self strafe-distance)) (vector+! (-> self root-override trans) s5-0 s4-0) @@ -235,7 +235,7 @@ swamp-bat-slave-event-handler (defstate swamp-bat-slave-idle (swamp-bat-slave) :event swamp-bat-slave-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self launch-ready) #f) (ja-channel-push! 1 (seconds 0.165)) (ja :group! swamp-bat-idle-ja) @@ -258,7 +258,7 @@ swamp-bat-slave-event-handler ) (forward-up->quaternion gp-0 s2-0 (new 'static 'vector :y 1.0 :w 1.0)) (loop - (let ((v1-17 (- (-> *display* base-frame-counter) (-> self state-time)))) + (let ((v1-17 (- (current-time) (-> self state-time)))) (when (>= v1-17 s3-0) 0 (goto cfg-10) @@ -296,7 +296,7 @@ swamp-bat-slave-event-handler ) (ja :num! (loop! (-> self idle-anim-speed))) (suspend) - (+! f30-2 (* 32768.0 (-> *display* seconds-per-frame) (-> self idle-anim-speed))) + (+! f30-2 (* 32768.0 (seconds-per-frame) (-> self idle-anim-speed))) ) ) ) @@ -307,7 +307,7 @@ swamp-bat-slave-event-handler (defstate swamp-bat-slave-launch (swamp-bat-slave) :event swamp-bat-slave-event-handler :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self launch-ready) #f) (ja-channel-push! 1 (seconds 0.1)) (let ((gp-0 (new-stack-vector0))) @@ -316,7 +316,7 @@ swamp-bat-slave-event-handler (eval-path-curve-div! (-> self parent-process 0 path-list (-> self path-select)) s5-0 0.0 'interp) (ja :group! swamp-bat-idle-ja) (loop - (let ((s4-0 (- (-> *display* base-frame-counter) (-> self state-time)))) + (let ((s4-0 (- (current-time) (-> self state-time)))) (if (>= s4-0 (seconds 0.3)) (go swamp-bat-slave-swoop) ) @@ -572,7 +572,7 @@ swamp-bat-slave-event-handler (deactivate self) ) (loop - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) *target* (>= (-> self fact-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) @@ -621,11 +621,11 @@ swamp-bat-slave-event-handler (defstate swamp-bat-launch-slaves (swamp-bat) :trans swamp-bat-debug :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (swamp-bat-update-path) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) + (set-time! (-> self state-time)) (if (not (swamp-bat-launch-slave)) (go swamp-bat-idle) ) @@ -638,47 +638,47 @@ swamp-bat-slave-event-handler ;; definition for method 11 of type swamp-bat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-bat ((obj swamp-bat) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! swamp-bat ((this swamp-bat) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 0.0) (set-root-prim! s4-0 s3-0) ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask enemy)) - (set! (-> obj vol) (new 'process 'vol-control obj)) - (logior! (-> obj vol flags) 3) - (set! (-> obj path-list 0) (new 'process 'curve-control obj 'path -1000000000.0)) - (set! (-> obj path-list 1) (new 'process 'curve-control obj 'pathb -1000000000.0)) - (logior! (-> obj path-list 0 flags) (path-control-flag display draw-line draw-point draw-text)) - (logior! (-> obj path-list 1 flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-count) 0) - (when (< 0.0 (the float (+ (-> obj path-list 0 curve num-cverts) -1))) - (+! (-> obj path-count) 1) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this vol) (new 'process 'vol-control this)) + (logior! (-> this vol flags) 3) + (set! (-> this path-list 0) (new 'process 'curve-control this 'path -1000000000.0)) + (set! (-> this path-list 1) (new 'process 'curve-control this 'pathb -1000000000.0)) + (logior! (-> this path-list 0 flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this path-list 1 flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-count) 0) + (when (< 0.0 (the float (+ (-> this path-list 0 curve num-cverts) -1))) + (+! (-> this path-count) 1) (swamp-bat-make-path-select-plane 0) ) - (when (< 0.0 (the float (+ (-> obj path-list 1 curve num-cverts) -1))) - (+! (-> obj path-count) 1) + (when (< 0.0 (the float (+ (-> this path-list 1 curve num-cverts) -1))) + (+! (-> this path-count) 1) (swamp-bat-make-path-select-plane 1) ) - (if (!= (-> obj path-count) 2) + (if (!= (-> this path-count) 2) (go process-drawable-art-error "need 2 paths") ) - (set! (-> obj fact-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (set! (-> this fact-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) (let ((a1-10 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 6)))) - (set! (-> obj slave-count) (max 2 (min 8 (the-as int a1-10)))) + (set! (-> this slave-count) (max 2 (min 8 (the-as int a1-10)))) ) (swamp-bat-setup-new-path 0) (swamp-bat-update-path) - (dotimes (s5-1 (-> obj slave-count)) - (process-spawn swamp-bat-slave obj s5-1 :to obj :stack-size 4512) + (dotimes (s5-1 (-> this slave-count)) + (process-spawn swamp-bat-slave this s5-1 :to this :stack-size 4512) ) (go swamp-bat-idle) (none) 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 aba5efaeac..a6af529ca5 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-obs_REF.gc @@ -128,14 +128,14 @@ ) ;; definition for method 3 of type swamp-spike -(defmethod inspect swamp-spike ((obj swamp-spike)) +(defmethod inspect swamp-spike ((this swamp-spike)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Topen-gate: ~A~%" (-> obj open-gate)) - (format #t "~T~Tdangerous: ~A~%" (-> obj dangerous)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Topen-gate: ~A~%" (-> this open-gate)) + (format #t "~T~Tdangerous: ~A~%" (-> this dangerous)) + this ) ;; failed to figure out what this is: @@ -200,7 +200,7 @@ (vector-z-quaternion! gp-0 (-> self root-override quat)) (set! (-> gp-0 w) (- (vector-dot gp-0 (-> self root-override trans)))) (loop - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! (-> self draw art-group data 3)) (until (>= (get-current-phase (-> self sync)) 0.5) (ja :num-func num-func-identity :frame-num 0.0) @@ -248,7 +248,7 @@ (ja :num! (seek!)) ) (set! (-> self dangerous) #f) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :num-func num-func-identity :frame-num max) (until (< (get-current-phase (-> self sync)) 0.5) (suspend) @@ -293,7 +293,7 @@ ) ) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! (-> self draw art-group data 4)) (until (-> self open-gate) (ja :num-func num-func-identity :frame-num 0.0) @@ -330,8 +330,8 @@ ) ;; definition for method 20 of type swamp-spike -(defmethod init! swamp-spike ((obj swamp-spike)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init! swamp-spike ((this swamp-spike)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -359,21 +359,21 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-skeleton obj *swamp-spike-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (load-params! (-> obj sync) obj (the-as uint 1500) 0.0 0.15 0.15) - (set! (-> obj open-gate) #f) - (set! (-> obj dangerous) #f) + (process-drawable-from-entity! this (-> this entity)) + (initialize-skeleton this *swamp-spike-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (load-params! (-> this sync) this (the-as uint 1500) 0.0 0.15 0.15) + (set! (-> this open-gate) #f) + (set! (-> this dangerous) #f) #f ) ;; definition for method 11 of type swamp-spike ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-spike ((obj swamp-spike) (arg0 entity-actor)) - (init! obj) +(defmethod init-from-entity! swamp-spike ((this swamp-spike) (arg0 entity-actor)) + (init! this) (go swamp-spike-idle) (none) ) @@ -392,17 +392,17 @@ ) ;; definition for method 3 of type swampgate -(defmethod inspect swampgate ((obj swampgate)) +(defmethod inspect swampgate ((this swampgate)) (let ((t9-0 (method-of-type swamp-spike inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for method 11 of type swampgate ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swampgate ((obj swampgate) (arg0 entity-actor)) - (init! obj) +(defmethod init-from-entity! swampgate ((this swampgate) (arg0 entity-actor)) + (init! this) (if (logtest? (-> arg0 extra perm status) (entity-perm-status complete)) (go swamp-spike-gate-down) (go swamp-spike-gate-up) @@ -430,17 +430,17 @@ ) ;; definition for method 3 of type balance-plat -(defmethod inspect balance-plat ((obj balance-plat)) +(defmethod inspect balance-plat ((this balance-plat)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ty-travel: ~f~%" (-> obj y-travel)) - (format #t "~T~Ty-init: ~f~%" (-> obj y-init)) - (format #t "~T~Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~T~Ty-vel: ~f~%" (-> obj y-vel)) - (format #t "~T~Ty-accel: ~f~%" (-> obj y-accel)) - (format #t "~T~Tgot-grow: ~A~%" (-> obj got-grow)) - obj + (format #t "~T~Ty-travel: ~f~%" (-> this y-travel)) + (format #t "~T~Ty-init: ~f~%" (-> this y-init)) + (format #t "~T~Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~T~Ty-vel: ~f~%" (-> this y-vel)) + (format #t "~T~Ty-accel: ~f~%" (-> this y-accel)) + (format #t "~T~Tgot-grow: ~A~%" (-> this got-grow)) + this ) ;; failed to figure out what this is: @@ -506,9 +506,9 @@ ;; definition for method 11 of type balance-plat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! balance-plat ((obj balance-plat) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! balance-plat ((this balance-plat) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -526,17 +526,17 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *balance-plat-sg* '()) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj y-accel) 0.0) - (set! (-> obj y-vel) 0.0) - (set! (-> obj y-offset) 0.0) - (set! (-> obj y-init) (-> obj root-override trans y)) - (set! (-> obj got-grow) #f) - (set! (-> obj y-travel) (res-lump-float arg0 'distance :default 20480.0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *balance-plat-sg* '()) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this y-accel) 0.0) + (set! (-> this y-vel) 0.0) + (set! (-> this y-offset) 0.0) + (set! (-> this y-init) (-> this root-override trans y)) + (set! (-> this got-grow) #f) + (set! (-> this y-travel) (res-lump-float arg0 'distance :default 20480.0)) (go balance-plat-idle) (none) ) @@ -556,11 +556,11 @@ ) ;; definition for method 3 of type swamp-rock -(defmethod inspect swamp-rock ((obj swamp-rock)) +(defmethod inspect swamp-rock ((this swamp-rock)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -695,10 +695,10 @@ ;; definition for method 11 of type swamp-rock ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-rock ((obj swamp-rock) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask attackable)) +(defmethod init-from-entity! swamp-rock ((this swamp-rock) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask attackable)) (let ((f30-0 (res-lump-float arg0 'scale-factor :default 1.0))) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -710,14 +710,14 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (vector-float*! (-> obj root scale) *identity-vector* f30-0) + (process-drawable-from-entity! this arg0) + (vector-float*! (-> this root scale) *identity-vector* f30-0) ) - (initialize-skeleton obj *swamp-rock-sg* '()) - (nav-mesh-connect obj (-> obj root) (the-as nav-control #f)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 291) obj)) + (initialize-skeleton this *swamp-rock-sg* '()) + (nav-mesh-connect this (-> this root) (the-as nav-control #f)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 291) this)) (go swamp-rock-idle) (none) ) @@ -801,28 +801,28 @@ ) ;; definition for method 3 of type tar-plat -(defmethod inspect tar-plat ((obj tar-plat)) +(defmethod inspect tar-plat ((this tar-plat)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tanchor-point: #~%" (-> obj anchor-point)) - (format #t "~T~Tfloat-height: ~f~%" (-> obj float-height)) - obj + (format #t "~T~Tanchor-point: #~%" (-> this anchor-point)) + (format #t "~T~Tfloat-height: ~f~%" (-> this float-height)) + this ) ;; definition for method 22 of type tar-plat -(defmethod rigid-body-platform-method-22 tar-plat ((obj tar-plat) (arg0 vector) (arg1 float)) - (+ (-> obj float-height) - (-> obj float-height-offset) +(defmethod rigid-body-platform-method-22 tar-plat ((this tar-plat) (arg0 vector) (arg1 float)) + (+ (-> this float-height) + (-> this float-height-offset) (* 512.0 (cos (* 109.22667 (+ (* 60.0 arg1) (* 0.03 (-> arg0 x)) (* 0.03 (-> arg0 z)))))) ) ) ;; definition for method 23 of type tar-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 tar-plat ((obj tar-plat) (arg0 float)) - ((the-as (function rigid-body-platform basic none) (find-parent-method tar-plat 23)) obj (the-as basic arg0)) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) +(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)) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) @@ -852,14 +852,14 @@ ) ) (let ((f30-1 -2048.0)) - (seek! (-> self float-height-offset) f30-1 (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) f30-1 (* 2048.0 (seconds-per-frame))) (if (= (-> self float-height-offset) f30-1) (go-virtual rigid-body-platform-idle) ) ) ) (else - (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (-> *display* seconds-per-frame))) + (seek! (-> self float-height-offset) 4096.0 (* 2048.0 (seconds-per-frame))) ) ) ) @@ -876,8 +876,8 @@ ;; definition for method 30 of type tar-plat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 tar-plat ((obj tar-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 tar-plat ((this tar-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -895,7 +895,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -904,14 +904,14 @@ ;; definition for method 31 of type tar-plat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 tar-plat ((obj tar-plat)) - (initialize-skeleton obj *tar-plat-sg* '()) - (rigid-body-platform-method-29 obj *tar-plat-constants*) - (set! (-> obj float-height) (-> obj entity extra trans y)) - (set! (-> obj float-height-offset) -2048.0) - (let ((s5-0 (-> obj info control-point-count))) +(defmethod rigid-body-platform-method-31 tar-plat ((this tar-plat)) + (initialize-skeleton this *tar-plat-sg* '()) + (rigid-body-platform-method-29 this *tar-plat-constants*) + (set! (-> this float-height) (-> this entity extra trans y)) + (set! (-> this float-height-offset) -2048.0) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f26-0 (+ 8192.0 (* 65536.0 (/ (the float s4-0) (the float s5-0))))) (f28-0 20480.0) (f30-0 12288.0) @@ -924,8 +924,8 @@ ) ) ) - (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f)) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) + (nav-mesh-connect this (-> this root-overlay) (the-as nav-control #f)) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) 0 (none) ) @@ -940,11 +940,11 @@ ) ;; definition for method 3 of type swamp-barrel -(defmethod inspect swamp-barrel ((obj swamp-barrel)) +(defmethod inspect swamp-barrel ((this swamp-barrel)) (let ((t9-0 (method-of-type barrel inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type swampcam @@ -956,35 +956,35 @@ ) ;; definition for method 3 of type swampcam -(defmethod inspect swampcam ((obj swampcam)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect swampcam ((this swampcam)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; failed to figure out what this is: @@ -1003,11 +1003,11 @@ ) ;; definition for method 3 of type swamp-battlecontroller -(defmethod inspect swamp-battlecontroller ((obj swamp-battlecontroller)) +(defmethod inspect swamp-battlecontroller ((this swamp-battlecontroller)) (let ((t9-0 (method-of-type battlecontroller inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-part_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-part_REF.gc index 27cab6a577..6f2e7fffff 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type swamp-part -(defmethod inspect swamp-part ((obj swamp-part)) +(defmethod inspect swamp-part ((this swamp-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc b/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc index 92c97b9cf5..626b9ee8a7 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat-nest_REF.gc @@ -620,21 +620,21 @@ ) ;; definition for method 3 of type swamp-rat-nest -(defmethod inspect swamp-rat-nest ((obj swamp-rat-nest)) +(defmethod inspect swamp-rat-nest ((this swamp-rat-nest)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tdummy: #x~X~%" (-> obj dummy)) - (format #t "~T~Tdamaged: ~A~%" (-> obj damaged)) - (format #t "~T~Tdummy-type: ~D~%" (-> obj dummy-type)) - (format #t "~T~Trat-count: ~D~%" (-> obj rat-count)) - (format #t "~T~Thit-points: ~D~%" (-> obj hit-points)) - (format #t "~T~Tdefensive-rat-count: ~D~%" (-> obj defensive-rat-count)) - (format #t "~T~Tspawn-period: ~f~%" (-> obj spawn-period)) - (format #t "~T~Tspawn-period-scale: ~f~%" (-> obj spawn-period-scale)) - (format #t "~T~Ttest-interval: ~D~%" (-> obj test-interval)) - (format #t "~T~Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - obj + (format #t "~T~Tdummy: #x~X~%" (-> this dummy)) + (format #t "~T~Tdamaged: ~A~%" (-> this damaged)) + (format #t "~T~Tdummy-type: ~D~%" (-> this dummy-type)) + (format #t "~T~Trat-count: ~D~%" (-> this rat-count)) + (format #t "~T~Thit-points: ~D~%" (-> this hit-points)) + (format #t "~T~Tdefensive-rat-count: ~D~%" (-> this defensive-rat-count)) + (format #t "~T~Tspawn-period: ~f~%" (-> this spawn-period)) + (format #t "~T~Tspawn-period-scale: ~f~%" (-> this spawn-period-scale)) + (format #t "~T~Ttest-interval: ~D~%" (-> this test-interval)) + (format #t "~T~Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + this ) ;; definition of type swamp-rat-nest-dummy @@ -664,16 +664,16 @@ ) ;; definition for method 3 of type swamp-rat-nest-dummy -(defmethod inspect swamp-rat-nest-dummy ((obj swamp-rat-nest-dummy)) +(defmethod inspect swamp-rat-nest-dummy ((this swamp-rat-nest-dummy)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttop-sphere: #~%" (-> obj top-sphere)) - (format #t "~T~Tdeath-part: ~A~%" (-> obj death-part)) - (format #t "~T~Tspawn-joint-array[6] @ #x~X~%" (-> obj spawn-joint-array)) - (format #t "~T~Tspawn-joint-count: ~D~%" (-> obj spawn-joint-count)) - (format #t "~T~Tparticle-spawn-joint: ~D~%" (-> obj particle-spawn-joint)) - obj + (format #t "~T~Ttop-sphere: #~%" (-> this top-sphere)) + (format #t "~T~Tdeath-part: ~A~%" (-> this death-part)) + (format #t "~T~Tspawn-joint-array[6] @ #x~X~%" (-> this spawn-joint-array)) + (format #t "~T~Tspawn-joint-count: ~D~%" (-> this spawn-joint-count)) + (format #t "~T~Tparticle-spawn-joint: ~D~%" (-> this particle-spawn-joint)) + this ) ;; definition of type swamp-rat-nest-dummy-a @@ -686,11 +686,11 @@ ) ;; definition for method 3 of type swamp-rat-nest-dummy-a -(defmethod inspect swamp-rat-nest-dummy-a ((obj swamp-rat-nest-dummy-a)) +(defmethod inspect swamp-rat-nest-dummy-a ((this swamp-rat-nest-dummy-a)) (let ((t9-0 (method-of-type swamp-rat-nest-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type swamp-rat-nest-dummy-b @@ -703,11 +703,11 @@ ) ;; definition for method 3 of type swamp-rat-nest-dummy-b -(defmethod inspect swamp-rat-nest-dummy-b ((obj swamp-rat-nest-dummy-b)) +(defmethod inspect swamp-rat-nest-dummy-b ((this swamp-rat-nest-dummy-b)) (let ((t9-0 (method-of-type swamp-rat-nest-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type swamp-rat-nest-dummy-c @@ -720,11 +720,11 @@ ) ;; definition for method 3 of type swamp-rat-nest-dummy-c -(defmethod inspect swamp-rat-nest-dummy-c ((obj swamp-rat-nest-dummy-c)) +(defmethod inspect swamp-rat-nest-dummy-c ((this swamp-rat-nest-dummy-c)) (let ((t9-0 (method-of-type swamp-rat-nest-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for function swamp-rat-nest-dummy-draw-spawn-joints @@ -800,7 +800,7 @@ (defstate swamp-rat-nest-dummy-hit (swamp-rat-nest-dummy) :event swamp-rat-nest-dummy-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (<= (-> self parent-process 0 hit-points) 0) (go swamp-rat-nest-dummy-die) ) @@ -837,7 +837,7 @@ (defstate swamp-rat-nest-dummy-die (swamp-rat-nest-dummy) :event #f :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self parent-process 0 dummy) (the-as (pointer swamp-rat-nest-dummy) #f)) (process-spawn part-tracker @@ -850,7 +850,7 @@ (-> self node-list data (-> self particle-spawn-joint) bone transform vector 3) :to *entity-pool* ) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (until (time-elapsed? (-> self state-time) (seconds 0.1)) (suspend) ) (ja-channel-set! 0) @@ -997,7 +997,7 @@ swamp-rat-nest-default-event-handler ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (and *target* (>= (-> self fact-override idle-distance) @@ -1020,12 +1020,12 @@ swamp-rat-nest-default-event-handler (defstate swamp-rat-nest-active (swamp-rat-nest) :event swamp-rat-nest-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (swamp-rat-nest-check-dummy) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self test-interval)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (-> self test-interval)) + (set-time! (-> self state-time)) (set! (-> self test-interval) (seconds 0.2)) (let ((v1-6 0)) (let ((a0-2 (the-as (pointer process-tree) (-> self child-process)))) @@ -1054,13 +1054,11 @@ swamp-rat-nest-default-event-handler (defstate swamp-rat-nest-gestate (swamp-rat-nest) :event swamp-rat-nest-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (swamp-rat-nest-check-dummy) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (the int (* (-> self spawn-period-scale) (-> self spawn-period))) - ) + (when (time-elapsed? (-> self state-time) (the int (* (-> self spawn-period-scale) (-> self spawn-period)))) (send-event (ppointer->process (-> self dummy)) 'shake) (swamp-rat-nest-spawn-rat) (go swamp-rat-nest-active) @@ -1114,32 +1112,32 @@ swamp-rat-nest-default-event-handler ;; definition for method 11 of type swamp-rat-nest ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-rat-nest ((obj swamp-rat-nest) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask enemy)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj fact-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) +(defmethod init-from-entity! swamp-rat-nest ((this swamp-rat-nest) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this fact-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s5-1 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 3)))) (if (>= (get-health-percent-lost *game-info* #f) 0.5) (+! s5-1 -1) ) - (set! (-> obj rat-count) (max 1 (min 4 (the-as int s5-1)))) + (set! (-> this rat-count) (max 1 (min 4 (the-as int s5-1)))) ) - (set! (-> obj defensive-rat-count) 2) + (set! (-> this defensive-rat-count) 2) (if (>= (get-health-percent-lost *game-info* #f) 0.75) - (+! (-> obj defensive-rat-count) -1) + (+! (-> this defensive-rat-count) -1) ) - (set! (-> obj dummy) (the-as (pointer swamp-rat-nest-dummy) #f)) - (set! (-> obj dummy-type) 0) - (set! (-> obj hit-points) 0) - (set! (-> obj damaged) #f) - (set! (-> obj spawn-period) (* 1200.0 (rand-vu-float-range 0.9 1.1))) - (set! (-> obj spawn-period-scale) (+ 1.0 (* 2.0 (get-health-percent-lost *game-info* #f)))) - (set! (-> obj test-interval) (rand-vu-int-range (seconds 0.1) (seconds 0.2))) + (set! (-> this dummy) (the-as (pointer swamp-rat-nest-dummy) #f)) + (set! (-> this dummy-type) 0) + (set! (-> this hit-points) 0) + (set! (-> this damaged) #f) + (set! (-> this spawn-period) (* 1200.0 (rand-vu-float-range 0.9 1.1))) + (set! (-> this spawn-period-scale) (+ 1.0 (* 2.0 (get-health-percent-lost *game-info* #f)))) + (set! (-> this test-interval) (rand-vu-int-range (seconds 0.1) (seconds 0.2))) (go swamp-rat-nest-idle) (none) ) @@ -1163,8 +1161,8 @@ swamp-rat-nest-default-event-handler ) ;; definition for method 20 of type swamp-rat-nest-dummy-a -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-a ((obj swamp-rat-nest-dummy-a)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-a ((this swamp-rat-nest-dummy-a)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1176,15 +1174,15 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (initialize-skeleton obj *swamp-rat-nest-dummy-a-sg* '()) + (initialize-skeleton this *swamp-rat-nest-dummy-a-sg* '()) (none) ) ;; definition for method 20 of type swamp-rat-nest-dummy-b -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-b ((obj swamp-rat-nest-dummy-b)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-b ((this swamp-rat-nest-dummy-b)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1196,15 +1194,15 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (initialize-skeleton obj *swamp-rat-nest-dummy-b-sg* '()) + (initialize-skeleton this *swamp-rat-nest-dummy-b-sg* '()) (none) ) ;; definition for method 20 of type swamp-rat-nest-dummy-c -(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-c ((obj swamp-rat-nest-dummy-c)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod swamp-rat-nest-dummy-method-20 swamp-rat-nest-dummy-c ((this swamp-rat-nest-dummy-c)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -1216,83 +1214,83 @@ swamp-rat-nest-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) - (initialize-skeleton obj *swamp-rat-nest-dummy-c-sg* '()) + (initialize-skeleton this *swamp-rat-nest-dummy-c-sg* '()) (none) ) ;; definition for method 21 of type swamp-rat-nest-dummy-a -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-a ((obj swamp-rat-nest-dummy-a)) +(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-a ((this swamp-rat-nest-dummy-a)) (let ((v1-0 0)) (let* ((a0-1 '(5 6 7 8 9 10)) (a1-0 (car a0-1)) ) (while (not (null? a0-1)) (when (< v1-0 6) - (set! (-> obj spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) + (set! (-> this spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) (+! v1-0 1) ) (set! a0-1 (cdr a0-1)) (set! a1-0 (car a0-1)) ) ) - (set! (-> obj spawn-joint-count) v1-0) + (set! (-> this spawn-joint-count) v1-0) ) - (set! (-> obj death-part) (-> *part-group-id-table* 292)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 295) obj)) + (set! (-> this death-part) (-> *part-group-id-table* 292)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 295) this)) (let ((v0-1 6)) - (set! (-> obj particle-spawn-joint) v0-1) + (set! (-> this particle-spawn-joint) v0-1) v0-1 ) ) ;; definition for method 21 of type swamp-rat-nest-dummy-b -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-b ((obj swamp-rat-nest-dummy-b)) +(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-b ((this swamp-rat-nest-dummy-b)) (let ((v1-0 0)) (let* ((a0-1 '(5 9 10 6 7 8)) (a1-0 (car a0-1)) ) (while (not (null? a0-1)) (when (< v1-0 6) - (set! (-> obj spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) + (set! (-> this spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) (+! v1-0 1) ) (set! a0-1 (cdr a0-1)) (set! a1-0 (car a0-1)) ) ) - (set! (-> obj spawn-joint-count) v1-0) + (set! (-> this spawn-joint-count) v1-0) ) - (set! (-> obj death-part) (-> *part-group-id-table* 293)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 296) obj)) + (set! (-> this death-part) (-> *part-group-id-table* 293)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 296) this)) (let ((v0-1 9)) - (set! (-> obj particle-spawn-joint) v0-1) + (set! (-> this particle-spawn-joint) v0-1) v0-1 ) ) ;; definition for method 21 of type swamp-rat-nest-dummy-c -(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-c ((obj swamp-rat-nest-dummy-c)) +(defmethod swamp-rat-nest-dummy-method-21 swamp-rat-nest-dummy-c ((this swamp-rat-nest-dummy-c)) (let ((v1-0 0)) (let* ((a0-1 '(5 6)) (a1-0 (car a0-1)) ) (while (not (null? a0-1)) (when (< v1-0 6) - (set! (-> obj spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) + (set! (-> this spawn-joint-array v1-0) (/ (the-as int a1-0) 8)) (+! v1-0 1) ) (set! a0-1 (cdr a0-1)) (set! a1-0 (car a0-1)) ) ) - (set! (-> obj spawn-joint-count) v1-0) + (set! (-> this spawn-joint-count) v1-0) ) - (set! (-> obj death-part) (-> *part-group-id-table* 294)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 297) obj)) + (set! (-> this death-part) (-> *part-group-id-table* 294)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 297) this)) (let ((v0-1 5)) - (set! (-> obj particle-spawn-joint) v0-1) + (set! (-> this particle-spawn-joint) v0-1) v0-1 ) ) 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 6495591d99..6e9713e07f 100644 --- a/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc +++ b/test/decompiler/reference/jak1/levels/swamp/swamp-rat_REF.gc @@ -25,22 +25,22 @@ ) ;; definition for method 3 of type swamp-rat -(defmethod inspect swamp-rat ((obj swamp-rat)) +(defmethod inspect swamp-rat ((this swamp-rat)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tup-vector: #~%" (-> obj up-vector)) - (format #t "~T~Tstate-float: ~f~%" (-> obj state-float)) - (format #t "~T~Tstate-vector: ~`vector`P~%" (-> obj state-vector)) - (format #t "~T~Tfree-time: ~D~%" (-> obj free-time)) - (format #t "~T~Twiggle-time: ~D~%" (-> obj wiggle-time)) - (format #t "~T~Twiggle-angle: ~f~%" (-> obj wiggle-angle)) - (format #t "~T~Tdelta-wiggle-angle: ~f~%" (-> obj delta-wiggle-angle)) - (format #t "~T~Twiggle-factor: ~f~%" (-> obj wiggle-factor)) - (format #t "~T~Tmin-height: ~f~%" (-> obj min-height)) - (format #t "~T~Tchase-rest-time: ~D~%" (-> obj chase-rest-time)) - (format #t "~T~Ttarget-nav-time: ~D~%" (-> obj target-nav-time)) - obj + (format #t "~T~Tup-vector: #~%" (-> this up-vector)) + (format #t "~T~Tstate-float: ~f~%" (-> this state-float)) + (format #t "~T~Tstate-vector: ~`vector`P~%" (-> this state-vector)) + (format #t "~T~Tfree-time: ~D~%" (-> this free-time)) + (format #t "~T~Twiggle-time: ~D~%" (-> this wiggle-time)) + (format #t "~T~Twiggle-angle: ~f~%" (-> this wiggle-angle)) + (format #t "~T~Tdelta-wiggle-angle: ~f~%" (-> this delta-wiggle-angle)) + (format #t "~T~Twiggle-factor: ~f~%" (-> this wiggle-factor)) + (format #t "~T~Tmin-height: ~f~%" (-> this min-height)) + (format #t "~T~Tchase-rest-time: ~D~%" (-> this chase-rest-time)) + (format #t "~T~Ttarget-nav-time: ~D~%" (-> this target-nav-time)) + this ) ;; failed to figure out what this is: @@ -51,14 +51,14 @@ ) ;; definition for method 44 of type swamp-rat -(defmethod touch-handler swamp-rat ((obj swamp-rat) (arg0 process) (arg1 event-message-block)) +(defmethod touch-handler swamp-rat ((this swamp-rat) (arg0 process) (arg1 event-message-block)) (when ((method-of-type touching-shapes-entry prims-touching?) (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) + (-> this collide-info) (the-as uint 1) ) (when (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) - (let* ((s5-1 (-> obj parent)) + (let* ((s5-1 (-> this parent)) (a0-4 (if (and (nonzero? s5-1) (type-type? pointer process-drawable)) s5-1 ) @@ -66,7 +66,7 @@ ) (if a0-4 (send-event (the-as process-tree a0-4) 'victory) - (go (method-of-object obj nav-enemy-victory)) + (go (method-of-object this nav-enemy-victory)) ) ) ) @@ -90,38 +90,38 @@ swamp-rat-default-event-handler ;; definition for method 39 of type swamp-rat ;; INFO: Used lq/sq -(defmethod common-post swamp-rat ((obj swamp-rat)) - (when (logtest? (-> obj collide-info status) (cshape-moving-flags onsurf)) - (vector-deg-seek (-> obj up-vector) (-> obj up-vector) (-> obj collide-info surface-normal) 910.2222) - (vector-normalize! (-> obj up-vector) 1.0) +(defmethod common-post swamp-rat ((this swamp-rat)) + (when (logtest? (-> this collide-info status) (cshape-moving-flags onsurf)) + (vector-deg-seek (-> this up-vector) (-> this up-vector) (-> this collide-info surface-normal) 910.2222) + (vector-normalize! (-> this up-vector) 1.0) ) (forward-up-nopitch->quaternion - (-> obj collide-info quat) - (vector-z-quaternion! (new-stack-vector0) (-> obj collide-info quat)) - (-> obj up-vector) + (-> this collide-info quat) + (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)) obj) + ((the-as (function nav-enemy none) (find-parent-method swamp-rat 39)) this) (none) ) ;; definition for method 38 of type swamp-rat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-38 swamp-rat ((obj swamp-rat)) +(defmethod nav-enemy-method-38 swamp-rat ((this swamp-rat)) (integrate-for-enemy-with-move-to-ground! - (-> obj collide-info) - (-> obj collide-info transv) + (-> this collide-info) + (-> this collide-info transv) (collide-kind background) 8192.0 #t #f #f ) - (when (< (-> obj collide-info trans y) (-> obj min-height)) + (when (< (-> this collide-info trans y) (-> this min-height)) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> obj collide-info trans quad)) - (set! (-> a1-1 y) (-> obj min-height)) - (move-to-ground-point! (-> obj collide-info) a1-1 (-> obj collide-info transv) *y-vector*) + (set! (-> a1-1 quad) (-> this collide-info trans quad)) + (set! (-> a1-1 y) (-> this min-height)) + (move-to-ground-point! (-> this collide-info) a1-1 (-> this collide-info transv) *y-vector*) ) ) 0 @@ -214,21 +214,21 @@ swamp-rat-default-event-handler :virtual #t :event swamp-rat-default-event-handler :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self chase-rest-time)) + (if (time-elapsed? (-> self state-time) (-> self chase-rest-time)) (go-virtual nav-enemy-victory) ) ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) ) :code (behavior () - (set! (-> self target-nav-time) (-> *display* base-frame-counter)) - (set! (-> self wiggle-time) (+ (-> *display* base-frame-counter) (seconds -10))) + (set-time! (-> self target-nav-time)) + (set! (-> self wiggle-time) (+ (current-time) (seconds -10))) (set! (-> self wiggle-angle) 0.0) (set! (-> self chase-rest-time) (rand-vu-int-range (seconds 1) (seconds 4))) (ja-channel-push! 1 (seconds 0.17)) (ja :group! swamp-rat-run-ja :num! min) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self wiggle-time)) (seconds 1)) - (set! (-> self wiggle-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self wiggle-time) (seconds 1)) + (set-time! (-> self wiggle-time)) (swamp-rat-update-wiggle-params) ) (suspend) @@ -267,9 +267,9 @@ swamp-rat-default-event-handler (ja-no-eval :num! (loop!)) (logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel)) (let ((gp-0 (rand-vu-int-range 300 600)) - (s5-0 (-> *display* base-frame-counter)) + (s5-0 (current-time)) ) - (until (>= (- (-> *display* base-frame-counter) s5-0) gp-0) + (until (time-elapsed? s5-0 gp-0) (ja :num-func num-func-identity :frame-num 0.0) (ja-blend-eval) (suspend) @@ -341,7 +341,7 @@ swamp-rat-default-event-handler (set! (-> gp-0 z) 0.0) (set! (-> gp-0 w) 1.0) (let ((f30-0 0.125)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja :group! swamp-rat-fall-ja :num! min) (loop (set! f30-0 (seek f30-0 1.5 0.1)) @@ -356,9 +356,7 @@ swamp-rat-default-event-handler #f ) (when (or (logtest? (-> self collide-info status) (cshape-moving-flags tsurf)) - (or (< (-> self collide-info trans y) (-> self min-height)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) - ) + (or (< (-> self collide-info trans y) (-> self min-height)) (time-elapsed? (-> self state-time) (seconds 1))) ) 0 (goto cfg-13) @@ -444,8 +442,8 @@ swamp-rat-default-event-handler ;; definition for method 47 of type swamp-rat ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision swamp-rat ((obj swamp-rat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision swamp-rat ((this swamp-rat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -461,7 +459,7 @@ swamp-rat-default-event-handler ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -470,24 +468,24 @@ swamp-rat-default-event-handler ;; definition for method 48 of type swamp-rat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 swamp-rat ((obj swamp-rat)) - (initialize-skeleton obj *swamp-rat-sg* '()) - (init-defaults! obj *swamp-rat-nav-enemy-info*) - (vector-float*! (-> obj collide-info scale) *identity-vector* 1.5) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj wiggle-angle) 0.0) - (set! (-> obj delta-wiggle-angle) 910.2222) - (set! (-> obj wiggle-factor) 1.5) - (set! (-> obj reaction-time) (rand-vu-int-range (seconds 0.1) (seconds 0.8))) - (set! (-> obj chase-rest-time) (seconds 1)) - (set! (-> obj water) (new 'process 'water-control obj 7 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01)) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 12288.0) - (set! (-> obj min-height) (+ -2048.0 (-> obj water height))) - (set! (-> obj up-vector quad) (-> *y-vector* quad)) +(defmethod nav-enemy-method-48 swamp-rat ((this swamp-rat)) + (initialize-skeleton this *swamp-rat-sg* '()) + (init-defaults! this *swamp-rat-nav-enemy-info*) + (vector-float*! (-> this collide-info scale) *identity-vector* 1.5) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this wiggle-angle) 0.0) + (set! (-> this delta-wiggle-angle) 910.2222) + (set! (-> this wiggle-factor) 1.5) + (set! (-> this reaction-time) (rand-vu-int-range (seconds 0.1) (seconds 0.8))) + (set! (-> this chase-rest-time) (seconds 1)) + (set! (-> this water) (new 'process 'water-control this 7 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 12288.0) + (set! (-> this min-height) (+ -2048.0 (-> this water height))) + (set! (-> this up-vector quad) (-> *y-vector* quad)) 0 (none) ) diff --git a/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc index b8fb1e9b48..5981be2d80 100644 --- a/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/title/title-obs_REF.gc @@ -27,30 +27,30 @@ ) ;; definition for method 3 of type logo -(defmethod inspect logo ((obj logo)) +(defmethod inspect logo ((this logo)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tcamera: ~D~%" (-> obj camera)) - (format #t "~T~Tcamera-anim: ~D~%" (-> obj camera-anim)) - (format #t "~T~Tvolumes: ~D~%" (-> obj volumes)) - (format #t "~T~Tblack: ~D~%" (-> obj black)) - (format #t "~T~Ttarget: ~D~%" (-> obj target)) - (format #t "~T~Tsidekick: ~D~%" (-> obj sidekick)) - (format #t "~T~Tmain-joint: ~A~%" (-> obj main-joint)) - (format #t "~T~Tanim: ~A~%" (-> obj anim)) - (format #t "~T~Tnext-anim: ~A~%" (-> obj next-anim)) - (format #t "~T~Tdone?: ~A~%" (-> obj done?)) - obj + (format #t "~T~Tcamera: ~D~%" (-> this camera)) + (format #t "~T~Tcamera-anim: ~D~%" (-> this camera-anim)) + (format #t "~T~Tvolumes: ~D~%" (-> this volumes)) + (format #t "~T~Tblack: ~D~%" (-> this black)) + (format #t "~T~Ttarget: ~D~%" (-> this target)) + (format #t "~T~Tsidekick: ~D~%" (-> this sidekick)) + (format #t "~T~Tmain-joint: ~A~%" (-> this main-joint)) + (format #t "~T~Tanim: ~A~%" (-> this anim)) + (format #t "~T~Tnext-anim: ~A~%" (-> this next-anim)) + (format #t "~T~Tdone?: ~A~%" (-> this done?)) + this ) ;; definition for method 7 of type logo ;; INFO: Return type mismatch process-drawable vs logo. -(defmethod relocate logo ((obj logo) (arg0 int)) - (if (nonzero? (-> obj main-joint)) - (&+! (-> obj main-joint) arg0) +(defmethod relocate logo ((this logo) (arg0 int)) + (if (nonzero? (-> this main-joint)) + (&+! (-> this main-joint) arg0) ) - (the-as logo ((method-of-type process-drawable relocate) obj arg0)) + (the-as logo ((method-of-type process-drawable relocate) this arg0)) ) ;; definition of type logo-slave @@ -68,21 +68,21 @@ ) ;; definition for method 3 of type logo-slave -(defmethod inspect logo-slave ((obj logo-slave)) +(defmethod inspect logo-slave ((this logo-slave)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tmain-joint: ~A~%" (-> obj main-joint)) - obj + (format #t "~T~Tmain-joint: ~A~%" (-> this main-joint)) + this ) ;; definition for method 7 of type logo-slave ;; INFO: Return type mismatch process-drawable vs logo-slave. -(defmethod relocate logo-slave ((obj logo-slave) (arg0 int)) - (if (nonzero? (-> obj main-joint)) - (&+! (-> obj main-joint) arg0) +(defmethod relocate logo-slave ((this logo-slave) (arg0 int)) + (if (nonzero? (-> this main-joint)) + (&+! (-> this main-joint) arg0) ) - (the-as logo-slave ((method-of-type process-drawable relocate) obj arg0)) + (the-as logo-slave ((method-of-type process-drawable relocate) this arg0)) ) ;; failed to figure out what this is: @@ -456,8 +456,8 @@ ) (loop (when (and (none-reserved? *art-control*) (not (paused?))) - (let ((gp-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-1) (seconds 0.1)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.1)) (set! *camera-look-through-other* 2) (suspend) ) @@ -483,7 +483,7 @@ :enter (behavior () (set-setting! 'bg-a 'abs 0.0 0) (apply-settings *setting-control*) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if *time-of-day-proc* (set! (-> *time-of-day-proc* 0 hour) 12) ) @@ -503,7 +503,7 @@ ) (when (and (= (-> *setting-control* current bg-a) 1.0) (and (member (level-status *level* 'village1) '(active loaded)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (let ((gp-2 (level-get *level* 'village1))) (when gp-2 (load-state-want-levels 'title 'village1) @@ -672,7 +672,7 @@ (set-setting! 'allow-progress #f 0.0 0) (set-setting! 'border-mode #f 0.0 0) (apply-settings *setting-control*) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self manipy) (the-as (pointer manipy) #f)) (ja-channel-set! 0) (ja-post) @@ -711,8 +711,8 @@ (set-blackout-frames (seconds 0.05)) (suspend) ) - (let ((s5-1 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s5-1) (seconds 0.25)) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 0.25)) (set-blackout-frames (seconds 0.05)) (suspend) ) @@ -752,8 +752,8 @@ (while *progress-process* (suspend) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.01)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.01)) (suspend) ) ) 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 741c180ab7..c4fefd5a7b 100644 --- a/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/training/training-obs_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type training-water -(defmethod inspect training-water ((obj training-water)) +(defmethod inspect training-water ((this training-water)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for symbol ripple-for-training-water, type ripple-wave-set @@ -34,13 +34,13 @@ ;; definition for method 22 of type training-water ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 training-water ((obj training-water)) +(defmethod water-vol-method-22 training-water ((this training-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) @@ -72,24 +72,24 @@ ) ;; definition for method 3 of type training-cam -(defmethod inspect training-cam ((obj training-cam)) +(defmethod inspect training-cam ((this training-cam)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Troot: ~A~%" (-> obj root)) - (format #t "~T~Trange: (meters ~m)~%" (-> obj range)) - (format #t "~T~Tindex: ~D~%" (-> obj index)) - (format #t "~T~Tstate-time: ~D~%" (-> obj state-time)) - obj + (format #t "~T~Troot: ~A~%" (-> this root)) + (format #t "~T~Trange: (meters ~m)~%" (-> this range)) + (format #t "~T~Tindex: ~D~%" (-> this index)) + (format #t "~T~Tstate-time: ~D~%" (-> this state-time)) + this ) ;; definition for method 7 of type training-cam ;; INFO: Return type mismatch process vs training-cam. -(defmethod relocate training-cam ((obj training-cam) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate training-cam ((this training-cam) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (the-as training-cam ((method-of-type process relocate) obj arg0)) + (the-as training-cam ((method-of-type process relocate) this arg0)) ) ;; failed to figure out what this is: @@ -113,7 +113,7 @@ ) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-grab? *target*) (process-entity-status! self (entity-perm-status bit-3) #t) (until (not (or (-> *setting-control* current talking) (or (-> *setting-control* current spooling) @@ -141,7 +141,7 @@ (suspend) ) ) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (suspend) ) (remove-setting! 'movie) @@ -194,8 +194,8 @@ (when (not (task-complete? *game-info* (game-task training-climb))) (clear-text-seen! *game-info* (text-id training-double-jump)) (level-hint-spawn (text-id training-double-jump) "sagevb27" (the-as entity #f) *entity-pool* (game-task none)) - (let ((gp-8 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-8) (seconds 30)) + (let ((gp-8 (current-time))) + (until (time-elapsed? gp-8 (seconds 30)) (suspend) ) ) @@ -232,16 +232,16 @@ ;; definition for method 11 of type training-cam ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! training-cam ((obj training-cam) (arg0 entity-actor)) +(defmethod init-from-entity! training-cam ((this training-cam) (arg0 entity-actor)) "Copy defaults from the entity." - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj root) (new 'process 'trsq)) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 quat)) - (vector-identity! (-> obj root scale)) - (set! (-> obj range) (res-lump-float arg0 'cam-notice-dist :default 81920.0)) - (set! (-> obj index) (res-lump-value arg0 'index int)) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsq)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (set! (-> this range) (res-lump-float arg0 'cam-notice-dist :default 81920.0)) + (set! (-> this index) (res-lump-value arg0 'index int)) + (go (method-of-object this idle)) (none) ) @@ -256,31 +256,31 @@ ) ;; definition for method 3 of type tra-pontoon -(defmethod inspect tra-pontoon ((obj tra-pontoon)) +(defmethod inspect tra-pontoon ((this tra-pontoon)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tanchor-point: #~%" (-> obj anchor-point)) - obj + (format #t "~T~Tanchor-point: #~%" (-> this anchor-point)) + this ) ;; definition for method 11 of type tra-pontoon ;; INFO: Return type mismatch int vs none. -(defmethod init-from-entity! tra-pontoon ((obj tra-pontoon) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) - (go (method-of-object obj rigid-body-platform-idle)) +(defmethod init-from-entity! tra-pontoon ((this tra-pontoon) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) + (go (method-of-object this rigid-body-platform-idle)) 0 (none) ) ;; definition for method 23 of type tra-pontoon ;; INFO: Return type mismatch int vs none. -(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) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) +(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) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) @@ -320,8 +320,8 @@ ;; definition for method 30 of type tra-pontoon ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 tra-pontoon ((obj tra-pontoon)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 tra-pontoon ((this tra-pontoon)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -339,7 +339,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -348,37 +348,37 @@ ;; definition for method 31 of type tra-pontoon ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 tra-pontoon ((obj tra-pontoon)) - (initialize-skeleton obj *tra-pontoon-sg* '()) - (rigid-body-platform-method-29 obj *tra-pontoon-constants*) - (set! (-> obj float-height-offset) 6144.0) - (set! (-> obj root-overlay nav-radius) 20480.0) - (let ((v1-6 (-> obj control-point-array data))) +(defmethod rigid-body-platform-method-31 tra-pontoon ((this tra-pontoon)) + (initialize-skeleton this *tra-pontoon-sg* '()) + (rigid-body-platform-method-29 this *tra-pontoon-constants*) + (set! (-> this float-height-offset) 6144.0) + (set! (-> this root-overlay nav-radius) 20480.0) + (let ((v1-6 (-> this control-point-array data))) (set! (-> v1-6 0 local-pos x) 9216.0) (set! (-> v1-6 0 local-pos y) 0.0) (set! (-> v1-6 0 local-pos z) 12083.2) (set! (-> v1-6 0 local-pos w) 1.0) ) - (let ((v1-8 (-> obj control-point-array data 1))) + (let ((v1-8 (-> this control-point-array data 1))) (set! (-> v1-8 local-pos x) 9216.0) (set! (-> v1-8 local-pos y) 0.0) (set! (-> v1-8 local-pos z) -12083.2) (set! (-> v1-8 local-pos w) 1.0) ) - (let ((v1-10 (-> obj control-point-array data 2))) + (let ((v1-10 (-> this control-point-array data 2))) (set! (-> v1-10 local-pos x) -9216.0) (set! (-> v1-10 local-pos y) 0.0) (set! (-> v1-10 local-pos z) -12083.2) (set! (-> v1-10 local-pos w) 1.0) ) - (let ((v1-12 (-> obj control-point-array data 3))) + (let ((v1-12 (-> this control-point-array data 3))) (set! (-> v1-12 local-pos x) -9216.0) (set! (-> v1-12 local-pos y) 0.0) (set! (-> v1-12 local-pos z) 12083.2) (set! (-> v1-12 local-pos w) 1.0) ) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) - (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f)) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) + (nav-mesh-connect this (-> this root-overlay) (the-as nav-control #f)) 0 (none) ) @@ -393,11 +393,11 @@ ) ;; definition for method 3 of type tra-iris-door -(defmethod inspect tra-iris-door ((obj tra-iris-door)) +(defmethod inspect tra-iris-door ((this tra-iris-door)) (let ((t9-0 (method-of-type eco-door inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -408,8 +408,8 @@ ;; definition for method 24 of type tra-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-24 tra-iris-door ((obj tra-iris-door)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod eco-door-method-24 tra-iris-door ((this tra-iris-door)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -421,7 +421,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) @@ -429,11 +429,11 @@ ;; definition for method 25 of type tra-iris-door ;; INFO: Return type mismatch int vs none. -(defmethod eco-door-method-25 tra-iris-door ((obj tra-iris-door)) - (initialize-skeleton obj *tra-iris-door-sg* '()) - (set! (-> obj open-distance) 32768.0) - (set! (-> obj close-distance) 49152.0) - (update-transforms! (-> obj root-override)) +(defmethod eco-door-method-25 tra-iris-door ((this tra-iris-door)) + (initialize-skeleton this *tra-iris-door-sg* '()) + (set! (-> this open-distance) 32768.0) + (set! (-> this close-distance) 49152.0) + (update-transforms! (-> this root-override)) 0 (none) ) @@ -626,13 +626,13 @@ ) ;; definition for method 3 of type scarecrow-a -(defmethod inspect scarecrow-a ((obj scarecrow-a)) +(defmethod inspect scarecrow-a ((this scarecrow-a)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tincomming-attack-id: ~D~%" (-> obj incomming-attack-id)) - (format #t "~T~Tintersection: ~`vector`P~%" (-> obj intersection)) - obj + (format #t "~T~Tincomming-attack-id: ~D~%" (-> this incomming-attack-id)) + (format #t "~T~Tintersection: ~`vector`P~%" (-> this intersection)) + this ) ;; definition of type scarecrow-b @@ -652,13 +652,13 @@ ) ;; definition for method 3 of type scarecrow-b -(defmethod inspect scarecrow-b ((obj scarecrow-b)) +(defmethod inspect scarecrow-b ((this scarecrow-b)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tincomming-attack-id: ~D~%" (-> obj incomming-attack-id)) - (format #t "~T~Tintersection: ~`vector`P~%" (-> obj intersection)) - obj + (format #t "~T~Tincomming-attack-id: ~D~%" (-> this incomming-attack-id)) + (format #t "~T~Tintersection: ~`vector`P~%" (-> this intersection)) + this ) ;; failed to figure out what this is: @@ -862,8 +862,8 @@ ;; definition for method 11 of type scarecrow-a ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! scarecrow-a ((obj scarecrow-a) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! scarecrow-a ((this scarecrow-a) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -889,11 +889,11 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *scarecrow-a-sg* '()) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *scarecrow-a-sg* '()) + (go (method-of-object this idle)) (none) ) @@ -1007,8 +1007,8 @@ ;; definition for method 11 of type scarecrow-b ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! scarecrow-b ((obj scarecrow-b) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! scarecrow-b ((this scarecrow-b) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1042,10 +1042,10 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *scarecrow-b-sg* '()) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *scarecrow-b-sg* '()) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/training/training-part_REF.gc b/test/decompiler/reference/jak1/levels/training/training-part_REF.gc index 8f623b0b5c..df0ed14b79 100644 --- a/test/decompiler/reference/jak1/levels/training/training-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/training/training-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type training-part -(defmethod inspect training-part ((obj training-part)) +(defmethod inspect training-part ((this training-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -852,7 +852,7 @@ ;; INFO: Return type mismatch int vs none. (defun tra-bird-bob-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (set! (-> arg2 y) (+ (-> (the-as process-drawable (-> arg1 key proc)) root trans y) - (* -2048.0 (sin (* 218.45334 (the float (mod (-> *display* base-frame-counter) 300))))) + (* -2048.0 (sin (* 218.45334 (the float (mod (current-time) 300))))) ) ) 0 diff --git a/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc b/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc index 56b2aae350..7d5d7297b4 100644 --- a/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/assistant_REF.gc @@ -12,12 +12,12 @@ ) ;; definition for method 3 of type assistant -(defmethod inspect assistant ((obj assistant)) +(defmethod inspect assistant ((this assistant)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - obj + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + this ) ;; failed to figure out what this is: @@ -29,10 +29,10 @@ ;; definition for method 52 of type assistant ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 assistant ((obj assistant)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 assistant ((this assistant)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -50,21 +50,21 @@ ;; definition for method 48 of type assistant ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow assistant ((obj assistant)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow assistant ((this assistant)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -74,18 +74,18 @@ ) ;; definition for method 32 of type assistant -(defmethod play-anim! assistant ((obj assistant) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! assistant ((this assistant) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task jungle-eggtop)) (when arg0 - (let* ((s5-1 (-> obj tasks)) + (let* ((s5-1 (-> this tasks)) (s4-0 (method-of-object s5-1 save-reminder)) ) (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "assistant-introduction-blue-eco-switch" @@ -122,7 +122,7 @@ ) (else (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "assistant-introduction-race-bike" @@ -134,28 +134,28 @@ ) ) (((task-status need-reminder) (task-status need-reminder-a)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((= (current-task (-> obj tasks)) (game-task none)) + ((= (current-task (-> this tasks)) (game-task none)) (new 'static 'spool-anim :name "assistant-reminder-1-generic" :index 14 :parts 2 :command-list '()) ) - ((closed? (-> obj tasks) (game-task jungle-eggtop) (task-status need-resolution)) + ((closed? (-> this tasks) (game-task jungle-eggtop) (task-status need-resolution)) (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) ) - ((or (closed? (-> obj tasks) (game-task misty-bike) (task-status need-resolution)) - (not (closed? (-> obj tasks) (game-task misty-bike) (task-status need-introduction))) + ((or (closed? (-> this tasks) (game-task misty-bike) (task-status need-resolution)) + (not (closed? (-> this tasks) (game-task misty-bike) (task-status need-introduction))) ) (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) ) - ((zero? (get-reminder (-> obj tasks) 2)) + ((zero? (get-reminder (-> this tasks) 2)) (if arg0 - (save-reminder (-> obj tasks) 1 2) + (save-reminder (-> this tasks) 1 2) ) (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) ) (else (if arg0 - (save-reminder (-> obj tasks) 0 2) + (save-reminder (-> this tasks) 0 2) ) (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) ) @@ -166,23 +166,24 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 31 of type assistant -(defmethod get-art-elem assistant ((obj assistant)) - (-> obj draw art-group data 3) +(defmethod get-art-elem assistant ((this assistant)) + (-> this draw art-group data 3) ) ;; definition for method 43 of type assistant -(defmethod process-taskable-method-43 assistant ((obj assistant)) - (let ((s5-0 (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj))) +(defmethod process-taskable-method-43 assistant ((this assistant)) + (let ((s5-0 (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this)) + ) (when s5-0 (let ((f0-2 (rand-float-gen))) (cond @@ -190,19 +191,19 @@ #f ) ((< 0.8 f0-2) - (play-ambient (-> obj ambient) "ASSTLP01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP01" #f (-> this root-override trans)) ) ((< 0.6 f0-2) - (play-ambient (-> obj ambient) "ASSTLP04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP04" #f (-> this root-override trans)) ) ((< 0.4 f0-2) - (play-ambient (-> obj ambient) "ASSTLP05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP05" #f (-> this root-override trans)) ) ((< 0.2 f0-2) - (play-ambient (-> obj ambient) "ASSTLP02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP02" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "ASSTLP03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP03" #f (-> this root-override trans)) ) ) ) @@ -381,20 +382,20 @@ ;; definition for method 11 of type assistant ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! assistant ((obj assistant) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-sg* 3 31 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj bounce-away) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 122) obj)) - (set! (-> obj tasks) (get-task-control (game-task jungle-eggtop))) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj draw light-index) (the-as uint 1)) +(defmethod init-from-entity! assistant ((this assistant) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-sg* 3 31 (new 'static 'vector :w 4096.0) 5) + (set! (-> this bounce-away) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 122) this)) + (set! (-> this tasks) (get-task-control (game-task jungle-eggtop))) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this draw light-index) (the-as uint 1)) (case (get-task-status (game-task firecanyon-assistant)) (((task-status unknown)) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) (else - (cleanup-for-death obj) - (deactivate obj) + (cleanup-for-death this) + (deactivate this) ) ) (none) diff --git a/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc b/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc index f8be8a9e5c..5656a0c909 100644 --- a/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/explorer_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type explorer -(defmethod inspect explorer ((obj explorer)) +(defmethod inspect explorer ((this explorer)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -27,10 +27,10 @@ ;; definition for method 52 of type explorer ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 explorer ((obj explorer)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 explorer ((this explorer)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -48,21 +48,21 @@ ;; definition for method 48 of type explorer ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow explorer ((obj explorer)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow explorer ((this explorer)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -72,12 +72,12 @@ ) ;; definition for method 32 of type explorer -(defmethod play-anim! explorer ((obj explorer) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! explorer ((this explorer) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "explorer-introduction" @@ -87,11 +87,11 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (if arg0 - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) (new 'static 'spool-anim :name "explorer-reminder-1" @@ -108,7 +108,7 @@ ) (else (if arg0 - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) (new 'static 'spool-anim :name "explorer-reminder-2" :index 11 :parts 3 :command-list '()) ) @@ -117,13 +117,13 @@ (((task-status need-reward-speech)) (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) ) (else - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this will-talk) #t) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (new 'static 'spool-anim @@ -138,49 +138,49 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 31 of type explorer -(defmethod get-art-elem explorer ((obj explorer)) - (-> obj draw art-group data 3) +(defmethod get-art-elem explorer ((this explorer)) + (-> this draw art-group data 3) ) ;; definition for method 43 of type explorer -(defmethod process-taskable-method-43 explorer ((obj explorer)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 explorer ((this explorer)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> obj ambient) "EXP-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "EXP-AM05" #f (-> this root-override trans)) ) ((< 0.71428573 f0-2) - (if (not (closed? (-> obj tasks) (game-task village1-uncle-money) (task-status need-reminder))) - (play-ambient (-> obj ambient) "EXP-LO02" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task village1-uncle-money) (task-status need-reminder))) + (play-ambient (-> this ambient) "EXP-LO02" #f (-> this root-override trans)) ) ) ((< 0.5714286 f0-2) - (play-ambient (-> obj ambient) "EXP-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "EXP-AM04" #f (-> this root-override trans)) ) ((< 0.42857143 f0-2) - (play-ambient (-> obj ambient) "EXP-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "EXP-AM03" #f (-> this root-override trans)) ) ((< 0.2857143 f0-2) - (play-ambient (-> obj ambient) "EXP-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "EXP-AM02" #f (-> this root-override trans)) ) ((< 0.14285715 f0-2) - (if (not (closed? (-> obj tasks) (game-task village1-uncle-money) (task-status need-reminder))) - (play-ambient (-> obj ambient) "EXP-AM01" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task village1-uncle-money) (task-status need-reminder))) + (play-ambient (-> this ambient) "EXP-AM01" #f (-> this root-override trans)) ) ) (else - (play-ambient (-> obj ambient) "EXP-LO1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "EXP-LO1A" #f (-> this root-override trans)) ) ) ) @@ -189,7 +189,7 @@ ;; definition for method 47 of type explorer ;; INFO: Return type mismatch basic vs symbol. -(defmethod target-above-threshold? explorer ((obj explorer)) +(defmethod target-above-threshold? explorer ((this explorer)) (the-as symbol (and *target* (< (-> (target-pos 0) x) -202752.0) (< 98304.0 (-> (target-pos 0) z)))) ) @@ -222,8 +222,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (while (let ((s5-0 (-> *display* base-frame-counter)) + (let ((gp-1 (current-time))) + (while (let ((s5-0 (current-time)) (f30-1 300.0) (f28-0 0.5) (f26-0 0.5) @@ -239,8 +239,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (while (let ((s5-1 (-> *display* base-frame-counter)) + (let ((gp-2 (current-time))) + (while (let ((s5-1 (current-time)) (f30-2 300.0) (f28-1 0.5) (f26-1 0.5) @@ -261,8 +261,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-3 (-> *display* base-frame-counter))) - (while (let ((s5-2 (-> *display* base-frame-counter)) + (let ((gp-3 (current-time))) + (while (let ((s5-2 (current-time)) (f30-3 300.0) (f28-2 0.5) (f26-2 0.5) @@ -291,8 +291,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-4 (-> *display* base-frame-counter))) - (while (let ((s5-3 (-> *display* base-frame-counter)) + (let ((gp-4 (current-time))) + (while (let ((s5-3 (current-time)) (f30-4 300.0) (f28-3 0.5) (f26-3 0.5) @@ -307,8 +307,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-5 (-> *display* base-frame-counter))) - (while (let ((s5-4 (-> *display* base-frame-counter)) + (let ((gp-5 (current-time))) + (while (let ((s5-4 (current-time)) (f30-5 300.0) (f28-4 0.5) (f26-4 0.5) @@ -323,8 +323,8 @@ (suspend) (ja :num! (seek! 0.0)) ) - (let ((gp-6 (-> *display* base-frame-counter))) - (while (let ((s5-5 (-> *display* base-frame-counter)) + (let ((gp-6 (current-time))) + (while (let ((s5-5 (current-time)) (f30-6 300.0) (f28-5 0.5) (f26-5 0.5) @@ -346,11 +346,11 @@ ) ;; definition for method 11 of type explorer -(defmethod init-from-entity! explorer ((obj explorer) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *explorer-sg* 3 42 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task village1-uncle-money))) - (set! (-> obj sound-flava) (music-flava explorer)) - (set! (-> obj draw light-index) (the-as uint 5)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! explorer ((this explorer) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *explorer-sg* 3 42 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task village1-uncle-money))) + (set! (-> this sound-flava) (music-flava explorer)) + (set! (-> this draw light-index) (the-as uint 5)) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/village1/farmer_REF.gc b/test/decompiler/reference/jak1/levels/village1/farmer_REF.gc index 09943b3840..31285a51a4 100644 --- a/test/decompiler/reference/jak1/levels/village1/farmer_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/farmer_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type farmer -(defmethod inspect farmer ((obj farmer)) +(defmethod inspect farmer ((this farmer)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -26,26 +26,26 @@ ) ;; definition for method 32 of type farmer -(defmethod play-anim! farmer ((obj farmer) (arg0 symbol)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! farmer ((this farmer) (arg0 symbol)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "farmer-introduction" :index 6 :parts 5 :command-list '()) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (if arg0 - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) (new 'static 'spool-anim :name "farmer-reminder-1" :index 7 :parts 2 :command-list '()) ) (else (if arg0 - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) (new 'static 'spool-anim :name "farmer-reminder-2" :index 8 :parts 2 :command-list '()) ) @@ -53,8 +53,8 @@ ) (((task-status need-reward-speech)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "farmer-resolution" :index 9 :parts 4 :command-list '()) ) @@ -63,46 +63,46 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) ;; definition for method 31 of type farmer -(defmethod get-art-elem farmer ((obj farmer)) - (case (current-status (-> obj tasks)) +(defmethod get-art-elem farmer ((this farmer)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction) (task-status need-resolution) (task-status invalid)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (else - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ) ) ;; definition for method 43 of type farmer -(defmethod process-taskable-method-43 farmer ((obj farmer)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 farmer ((this farmer)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8333333 f0-2) - (play-ambient (-> obj ambient) "FAR-LO1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FAR-LO1A" #f (-> this root-override trans)) ) ((< 0.6666667 f0-2) - (play-ambient (-> obj ambient) "FAR-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FAR-AM01" #f (-> this root-override trans)) ) ((< 0.5 f0-2) #f ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "FAR-AM2A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FAR-AM2A" #f (-> this root-override trans)) ) ((< 0.16666667 f0-2) - (play-ambient (-> obj ambient) "FAR-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "FAR-AM02" #f (-> this root-override trans)) ) (else #f @@ -114,8 +114,8 @@ ;; definition for method 41 of type farmer ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision farmer ((obj farmer) (arg0 int) (arg1 vector)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision farmer ((this farmer) (arg0 int) (arg1 vector)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -142,18 +142,18 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) ;; definition for method 11 of type farmer -(defmethod init-from-entity! farmer ((obj farmer) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *farmer-sg* 3 25 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj root-override nav-radius) 40960.0) - (nav-mesh-connect obj (-> obj root-override) (the-as nav-control #f)) - (set! (-> obj tasks) (get-task-control (game-task village1-yakow))) - (process-taskable-method-42 obj) +(defmethod init-from-entity! farmer ((this farmer) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *farmer-sg* 3 25 (new 'static 'vector :w 4096.0) 5) + (set! (-> this root-override nav-radius) 40960.0) + (nav-mesh-connect this (-> this root-override) (the-as nav-control #f)) + (set! (-> this tasks) (get-task-control (game-task village1-yakow))) + (process-taskable-method-42 this) (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 4222e538e6..bef42ed0d7 100644 --- a/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/fishermans-boat_REF.gc @@ -41,11 +41,11 @@ ) ;; definition for method 3 of type boat-stabilizer -(defmethod inspect boat-stabilizer ((obj boat-stabilizer)) - (format #t "[~8x] ~A~%" obj 'boat-stabilizer) - (format #t "~Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~Tnormal: #~%" (-> obj normal)) - obj +(defmethod inspect boat-stabilizer ((this boat-stabilizer)) + (format #t "[~8x] ~A~%" this 'boat-stabilizer) + (format #t "~Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~Tnormal: #~%" (-> this normal)) + this ) ;; definition of type vehicle-path @@ -66,32 +66,32 @@ ) ;; definition for method 3 of type vehicle-path -(defmethod inspect vehicle-path ((obj vehicle-path)) - (format #t "[~8x] ~A~%" obj 'vehicle-path) - (format #t "~Tpoint-array[10] @ #x~X~%" (-> obj point-array)) - (format #t "~Tpoint-count: ~D~%" (-> obj point-count)) - obj +(defmethod inspect vehicle-path ((this vehicle-path)) + (format #t "[~8x] ~A~%" this 'vehicle-path) + (format #t "~Tpoint-array[10] @ #x~X~%" (-> this point-array)) + (format #t "~Tpoint-count: ~D~%" (-> this point-count)) + this ) ;; definition for method 9 of type vehicle-path -(defmethod get-point-count vehicle-path ((obj vehicle-path)) - (-> obj point-count) +(defmethod get-point-count vehicle-path ((this vehicle-path)) + (-> this point-count) ) ;; definition for method 10 of type vehicle-path ;; INFO: Used lq/sq -(defmethod nth-point vehicle-path ((obj vehicle-path) (arg0 int) (arg1 vector)) - (set! (-> arg1 quad) (-> obj point-array arg0 quad)) +(defmethod nth-point vehicle-path ((this vehicle-path) (arg0 int) (arg1 vector)) + (set! (-> arg1 quad) (-> this point-array arg0 quad)) arg1 ) ;; definition for method 11 of type vehicle-path -(defmethod distance-to-next-point vehicle-path ((obj vehicle-path) (arg0 int) (arg1 vector)) +(defmethod distance-to-next-point vehicle-path ((this vehicle-path) (arg0 int) (arg1 vector)) (let ((a2-1 (+ arg0 1))) - (if (>= a2-1 (-> obj point-count)) + (if (>= a2-1 (-> this point-count)) (set! a2-1 0) ) - (vector-! arg1 (-> obj point-array a2-1) (-> obj point-array arg0)) + (vector-! arg1 (-> this point-array a2-1) (-> this point-array arg0)) ) (set! (-> arg1 y) 0.0) (vector-normalize! arg1 1.0) @@ -100,11 +100,11 @@ ;; definition for method 12 of type vehicle-path ;; INFO: Return type mismatch int vs none. -(defmethod add-point! vehicle-path ((obj vehicle-path) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (let ((v1-0 (-> obj point-count))) +(defmethod add-point! vehicle-path ((this vehicle-path) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (let ((v1-0 (-> this point-count))) (when (< v1-0 10) - (set-vector! (-> obj point-array v1-0) arg0 arg1 arg2 arg3) - (+! (-> obj point-count) 1) + (set-vector! (-> this point-array v1-0) arg0 arg1 arg2 arg3) + (+! (-> this point-count) 1) ) ) 0 @@ -113,7 +113,7 @@ ;; definition for method 13 of type vehicle-path ;; INFO: Used lq/sq -(defmethod debug-draw vehicle-path ((obj vehicle-path)) +(defmethod debug-draw vehicle-path ((this vehicle-path)) (local-vars (sv-64 int) (sv-80 (function _varargs_ object))) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -121,10 +121,10 @@ ) (set! (-> s5-0 y) 0.0) (set! (-> s5-0 w) 1.0) - (dotimes (s2-0 (-> obj point-count)) - (let ((v1-1 (mod (+ s2-0 1) (-> obj point-count)))) - (set! (-> s4-0 quad) (-> obj point-array s2-0 quad)) - (set! (-> s3-0 quad) (-> obj point-array v1-1 quad)) + (dotimes (s2-0 (-> this point-count)) + (let ((v1-1 (mod (+ s2-0 1) (-> this point-count)))) + (set! (-> s4-0 quad) (-> this point-array s2-0 quad)) + (set! (-> s3-0 quad) (-> this point-array v1-1 quad)) ) (let ((f30-0 (-> s4-0 y)) (f28-0 (-> s4-0 w)) @@ -287,33 +287,33 @@ ) ;; definition for method 3 of type vehicle-controller -(defmethod inspect vehicle-controller ((obj vehicle-controller)) - (format #t "[~8x] ~A~%" obj 'vehicle-controller) - (format #t "~Tpath: #~%" (-> obj path)) - (format #t "~Tturning-radius-table: #x~X~%" (-> obj turning-radius-table)) - (format #t "~Tthrottle-control-table: #x~X~%" (-> obj throttle-control-table)) - (format #t "~Ttable-step: ~f~%" (-> obj table-step)) - (format #t "~Ttable-length: ~D~%" (-> obj table-length)) - (format #t "~Tcircle-radius: ~f~%" (-> obj circle-radius)) - (format #t "~Tthrottle: ~f~%" (-> obj throttle)) - (format #t "~Tsteering: ~f~%" (-> obj steering)) - (format #t "~Tpath-dest-index: ~D~%" (-> obj path-dest-index)) - (format #t "~Tleft-circle: ~D~%" (-> obj left-circle)) - (format #t "~Tpath-dest-point: #~%" (-> obj path-dest-point)) - (format #t "~Tpath-dest-velocity: #~%" (-> obj path-dest-velocity)) - (format #t "~Tdest-circle: #~%" (-> obj dest-circle)) - (format #t "~Ttarget-point: #~%" (-> obj target-point)) - (format #t "~Tsample-dir: #~%" (-> obj sample-dir)) - (format #t "~Tsample-time: ~D~%" (-> obj sample-time)) - (format #t "~Tsample-index: ~D~%" (-> obj sample-index)) - obj +(defmethod inspect vehicle-controller ((this vehicle-controller)) + (format #t "[~8x] ~A~%" this 'vehicle-controller) + (format #t "~Tpath: #~%" (-> this path)) + (format #t "~Tturning-radius-table: #x~X~%" (-> this turning-radius-table)) + (format #t "~Tthrottle-control-table: #x~X~%" (-> this throttle-control-table)) + (format #t "~Ttable-step: ~f~%" (-> this table-step)) + (format #t "~Ttable-length: ~D~%" (-> this table-length)) + (format #t "~Tcircle-radius: ~f~%" (-> this circle-radius)) + (format #t "~Tthrottle: ~f~%" (-> this throttle)) + (format #t "~Tsteering: ~f~%" (-> this steering)) + (format #t "~Tpath-dest-index: ~D~%" (-> this path-dest-index)) + (format #t "~Tleft-circle: ~D~%" (-> this left-circle)) + (format #t "~Tpath-dest-point: #~%" (-> this path-dest-point)) + (format #t "~Tpath-dest-velocity: #~%" (-> this path-dest-velocity)) + (format #t "~Tdest-circle: #~%" (-> this dest-circle)) + (format #t "~Ttarget-point: #~%" (-> this target-point)) + (format #t "~Tsample-dir: #~%" (-> this sample-dir)) + (format #t "~Tsample-time: ~D~%" (-> this sample-time)) + (format #t "~Tsample-index: ~D~%" (-> this sample-index)) + this ) ;; definition for method 7 of type vehicle-controller ;; INFO: Return type mismatch int vs vehicle-controller. -(defmethod relocate vehicle-controller ((obj vehicle-controller) (arg0 int)) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) +(defmethod relocate vehicle-controller ((this vehicle-controller) (arg0 int)) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) (the-as vehicle-controller 0) ) @@ -321,36 +321,36 @@ ;; definition for method 12 of type vehicle-controller ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-12 vehicle-controller ((obj vehicle-controller) (arg0 int) (arg1 vector)) - (when (< arg0 (get-point-count (-> obj path))) - (set! (-> obj path-dest-index) arg0) - (nth-point (-> obj path) arg0 (-> obj path-dest-point)) - (let ((f30-0 (-> obj path-dest-point y)) - (f28-0 (-> obj path-dest-point w)) +(defmethod vehicle-controller-method-12 vehicle-controller ((this vehicle-controller) (arg0 int) (arg1 vector)) + (when (< arg0 (get-point-count (-> this path))) + (set! (-> this path-dest-index) arg0) + (nth-point (-> this path) arg0 (-> this path-dest-point)) + (let ((f30-0 (-> this path-dest-point y)) + (f28-0 (-> this path-dest-point w)) ) - (set! (-> obj path-dest-velocity x) (* f30-0 (cos f28-0))) - (set! (-> obj path-dest-velocity z) (* f30-0 (sin f28-0))) + (set! (-> this path-dest-velocity x) (* f30-0 (cos f28-0))) + (set! (-> this path-dest-velocity z) (* f30-0 (sin f28-0))) ) - (set! (-> obj path-dest-velocity y) 0.0) - (set! (-> obj path-dest-velocity w) 1.0) - (set! (-> obj path-dest-point y) 0.0) - (set! (-> obj path-dest-point w) 1.0) + (set! (-> this path-dest-velocity y) 0.0) + (set! (-> this path-dest-velocity w) 1.0) + (set! (-> this path-dest-point y) 0.0) + (set! (-> this path-dest-point w) 1.0) (let ((s5-1 (new 'stack-no-clear 'vector))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s3-0 (-> obj path-dest-point) arg1) - (set! (-> s5-1 quad) (-> obj path-dest-velocity quad)) - (set! (-> s5-1 x) (-> obj path-dest-velocity z)) - (set! (-> s5-1 z) (- (-> obj path-dest-velocity x))) + (vector-! s3-0 (-> this path-dest-point) arg1) + (set! (-> s5-1 quad) (-> this path-dest-velocity quad)) + (set! (-> s5-1 x) (-> this path-dest-velocity z)) + (set! (-> s5-1 z) (- (-> this path-dest-velocity x))) (vector-xz-normalize! s5-1 1.0) - (set! (-> obj left-circle) 1) + (set! (-> this left-circle) 1) (when (< 0.0 (vector-dot s3-0 s5-1)) - (set! (-> obj left-circle) 0) + (set! (-> this left-circle) 0) (vector-float*! s5-1 s5-1 -1.0) ) ) - (vector+*! (-> obj dest-circle) (-> obj path-dest-point) s5-1 (-> obj circle-radius)) + (vector+*! (-> this dest-circle) (-> this path-dest-point) s5-1 (-> this circle-radius)) ) - (set! (-> obj dest-circle w) (-> obj circle-radius)) + (set! (-> this dest-circle w) (-> this circle-radius)) ) 0 (none) @@ -358,12 +358,12 @@ ;; definition for method 13 of type vehicle-controller ;; INFO: Return type mismatch int vs none. -(defmethod move-to-next-point vehicle-controller ((obj vehicle-controller) (arg0 vector)) - (let ((s4-0 (+ (-> obj path-dest-index) 1))) - (if (>= s4-0 (get-point-count (-> obj path))) +(defmethod move-to-next-point vehicle-controller ((this vehicle-controller) (arg0 vector)) + (let ((s4-0 (+ (-> this path-dest-index) 1))) + (if (>= s4-0 (get-point-count (-> this path))) (set! s4-0 0) ) - (vehicle-controller-method-12 obj s4-0 arg0) + (vehicle-controller-method-12 this s4-0 arg0) ) 0 (none) @@ -372,13 +372,13 @@ ;; definition for method 14 of type vehicle-controller ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-14 vehicle-controller ((obj vehicle-controller) (arg0 vector) (arg1 vector)) +(defmethod vehicle-controller-method-14 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (vector-! s5-0 (-> obj dest-circle) arg0) + (vector-! s5-0 (-> this dest-circle) arg0) (let ((f30-0 (vector-xz-length s5-0)) - (f28-0 (-> obj dest-circle w)) + (f28-0 (-> this dest-circle w)) ) (if (< f30-0 f28-0) (set! f28-0 (* 0.9 f30-0)) @@ -386,7 +386,7 @@ (vector-normalize! s5-0 1.0) (set! (-> s3-0 x) (-> s5-0 z)) (set! (-> s3-0 z) (- (-> s5-0 x))) - (if (= (-> obj left-circle) 1) + (if (= (-> this left-circle) 1) (vector-float*! s3-0 s3-0 -1.0) ) (let* ((f0-5 f30-0) @@ -397,9 +397,9 @@ ) (let ((f0-12 (/ (* f0-9 f0-9) f30-0))) (set! (-> arg1 quad) (-> arg0 quad)) - (vector+*! arg1 (-> obj target-point) s5-0 f0-12) + (vector+*! arg1 (-> this target-point) s5-0 f0-12) ) - (vector+*! arg1 (-> obj target-point) s3-0 f28-1) + (vector+*! arg1 (-> this target-point) s3-0 f28-1) ) ) ) @@ -410,28 +410,28 @@ ;; definition for method 15 of type vehicle-controller ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-15 vehicle-controller ((obj vehicle-controller) (arg0 collide-shape-moving)) - (vehicle-controller-method-14 obj (-> arg0 trans) (-> obj target-point)) +(defmethod vehicle-controller-method-15 vehicle-controller ((this vehicle-controller) (arg0 collide-shape-moving)) + (vehicle-controller-method-14 this (-> arg0 trans) (-> this target-point)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> obj path-dest-velocity quad)) + (set! (-> s3-0 quad) (-> this path-dest-velocity quad)) (vector-xz-normalize! s3-0 1.0) - (vector-! s4-0 (-> obj path-dest-point) (-> arg0 trans)) + (vector-! s4-0 (-> this path-dest-point) (-> arg0 trans)) (let ((f30-0 (vector-dot s3-0 s4-0))) - (if (and (< (vector-xz-length s4-0) (-> obj circle-radius)) (< f30-0 0.0)) - (move-to-next-point obj (-> arg0 trans)) + (if (and (< (vector-xz-length s4-0) (-> this circle-radius)) (< f30-0 0.0)) + (move-to-next-point this (-> arg0 trans)) ) ) ) (let ((s4-2 (max 0 (min - (the int (/ (vector-xz-length (-> obj path-dest-velocity)) (-> obj table-step))) - (+ (-> obj table-length) -1) + (the int (/ (vector-xz-length (-> this path-dest-velocity)) (-> this table-step))) + (+ (-> this table-length) -1) ) ) ) ) - (set! (-> obj throttle) (-> obj throttle-control-table s4-2)) + (set! (-> this throttle) (-> this throttle-control-table s4-2)) ) (let ((s3-1 (new 'stack-no-clear 'vector)) (s4-3 (new 'stack-no-clear 'vector)) @@ -439,10 +439,10 @@ (vector-z-quaternion! s3-1 (-> arg0 quat)) (vector-x-quaternion! s4-3 (-> arg0 quat)) (let* ((v1-16 (-> arg0 trans)) - (f0-9 (- (vector-dot s3-1 (-> obj target-point)) (vector-dot s3-1 v1-16))) - (f3-0 (- (vector-dot s4-3 (-> obj target-point)) (vector-dot s4-3 v1-16))) + (f0-9 (- (vector-dot s3-1 (-> this target-point)) (vector-dot s3-1 v1-16))) + (f3-0 (- (vector-dot s4-3 (-> this target-point)) (vector-dot s4-3 v1-16))) ) - (set! (-> obj steering) (fmax -1.0 (fmin 1.0 (/ (* 4.0 f3-0) (fmax 4096.0 f0-9))))) + (set! (-> this steering) (fmax -1.0 (fmin 1.0 (/ (* 4.0 f3-0) (fmax 4096.0 f0-9))))) ) ) 0 @@ -452,16 +452,16 @@ ;; definition for method 11 of type vehicle-controller ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-11 vehicle-controller ((obj vehicle-controller)) +(defmethod vehicle-controller-method-11 vehicle-controller ((this vehicle-controller)) (format #t "(define *turning-radius-table* (new 'static 'inline-array 'float 0~%") - (dotimes (s5-0 (-> obj table-length)) - (format #t " (meters ~4,,2M)~%" (-> obj turning-radius-table s5-0)) + (dotimes (s5-0 (-> this table-length)) + (format #t " (meters ~4,,2M)~%" (-> this turning-radius-table s5-0)) ) (format #t " )~%") (format #t " )~%") (format #t "(define *throttle-control-table* (new 'static 'inline-array 'float 0~%") - (dotimes (s5-1 (-> obj table-length)) - (format #t " ~f~%" (-> obj throttle-control-table s5-1)) + (dotimes (s5-1 (-> this table-length)) + (format #t " ~f~%" (-> this throttle-control-table s5-1)) ) (format #t " )~%") (format #t " )~%") @@ -472,30 +472,30 @@ ;; definition for method 10 of type vehicle-controller ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-10 vehicle-controller ((obj vehicle-controller) (arg0 vector) (arg1 float) (arg2 int)) +(defmethod vehicle-controller-method-10 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 float) (arg2 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 quad) (-> arg0 quad)) (set! (-> s3-0 y) 0.0) (vector-xz-normalize! s3-0 1.0) (cond - ((= arg2 (-> obj sample-index)) - (let* ((f30-0 (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> obj sample-time))))) - (f28-0 (* (-> obj table-step) (the float arg2))) - (f0-4 (acos-rad (vector-dot s3-0 (-> obj sample-dir)))) + ((= arg2 (-> this sample-index)) + (let* ((f30-0 (* 0.0033333334 (the float (- (current-time) (-> this sample-time))))) + (f28-0 (* (-> this table-step) (the float arg2))) + (f0-4 (acos-rad (vector-dot s3-0 (-> this sample-dir)))) (f26-0 (/ (* f28-0 f30-0) f0-4)) ) - (when (and (>= arg2 0) (< arg2 (-> obj table-length))) - (set! (-> obj turning-radius-table arg2) f26-0) - (set! (-> obj throttle-control-table arg2) arg1) + (when (and (>= arg2 0) (< arg2 (-> this table-length))) + (set! (-> this turning-radius-table arg2) f26-0) + (set! (-> this throttle-control-table arg2) arg1) (format #t "sample ~d (~M m/s) angle ~f deg, time ~f sec~%" arg2 f28-0 (* 57.29747 f0-4) f30-0) (format #t "sample ~d (~M m/s) radius ~M throttle ~f~%" arg2 f28-0 f26-0 arg1) ) ) ) (else - (set! (-> obj sample-index) arg2) - (set! (-> obj sample-time) (-> *display* base-frame-counter)) - (set! (-> obj sample-dir quad) (-> s3-0 quad)) + (set! (-> this sample-index) arg2) + (set-time! (-> this sample-time)) + (set! (-> this sample-dir quad) (-> s3-0 quad)) ) ) ) @@ -505,19 +505,19 @@ ;; definition for method 16 of type vehicle-controller ;; INFO: Return type mismatch int vs none. -(defmethod vehicle-controller-method-16 vehicle-controller ((obj vehicle-controller)) - (debug-draw (-> obj path)) +(defmethod vehicle-controller-method-16 vehicle-controller ((this vehicle-controller)) + (debug-draw (-> this path)) (add-debug-sphere #t (bucket-id debug-no-zbuf) - (-> obj dest-circle) - (-> obj dest-circle w) + (-> this dest-circle) + (-> this dest-circle w) (new 'static 'rgba :g #xff :a #x80) ) (add-debug-x #t (bucket-id debug-no-zbuf) - (-> obj target-point) + (-> this target-point) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) 0 @@ -526,19 +526,19 @@ ;; definition for method 9 of type vehicle-controller ;; INFO: Return type mismatch int vs none. -(defmethod init! vehicle-controller ((obj vehicle-controller) +(defmethod init! vehicle-controller ((this vehicle-controller) (arg0 vehicle-path) (arg1 (pointer float)) (arg2 (pointer float)) (arg3 int) (arg4 float) ) - (set! (-> obj path) arg0) - (set! (-> obj turning-radius-table) arg1) - (set! (-> obj throttle-control-table) arg2) - (set! (-> obj table-length) arg3) - (set! (-> obj table-step) arg4) - (set! (-> obj circle-radius) 102400.0) + (set! (-> this path) arg0) + (set! (-> this turning-radius-table) arg1) + (set! (-> this throttle-control-table) arg2) + (set! (-> this table-length) arg3) + (set! (-> this table-step) arg4) + (set! (-> this circle-radius) 102400.0) 0 (none) ) @@ -591,38 +591,38 @@ ) ;; definition for method 3 of type fishermans-boat -(defmethod inspect fishermans-boat ((obj fishermans-boat)) +(defmethod inspect fishermans-boat ((this fishermans-boat)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tstabilizer-array[2] @ #x~X~%" (-> obj stabilizer-array)) - (format #t "~T~Tengine-thrust-local-pos: #~%" (-> obj engine-thrust-local-pos)) - (format #t "~T~Tignition: ~A~%" (-> obj ignition)) - (format #t "~T~Tengine-thrust: ~f~%" (-> obj engine-thrust)) - (format #t "~T~Tpropeller: ~A~%" (-> obj propeller)) - (format #t "~T~Tdock-point: #~%" (-> obj dock-point)) - (format #t "~T~Tdest-dir: #~%" (-> obj dest-dir)) - (format #t "~T~Tdock-point-index: ~D~%" (-> obj dock-point-index)) - (format #t "~T~Tauto-pilot: ~A~%" (-> obj auto-pilot)) - (format #t "~T~Tanchored: ~A~%" (-> obj anchored)) - (format #t "~T~Twaiting-for-player: ~A~%" (-> obj waiting-for-player)) - (format #t "~T~Tplayer-riding: ~A~%" (-> obj player-riding)) - (format #t "~T~Tboat-path: #~%" (-> obj boat-path)) - (format #t "~T~Tcam-tracker: ~D~%" (-> obj cam-tracker)) - (format #t "~T~Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - (format #t "~T~Tkill-player: ~A~%" (-> obj kill-player)) - (format #t "~T~Tengine-sound-id: ~D~%" (-> obj engine-sound-id)) - (format #t "~T~Tengine-sound-envelope: ~f~%" (-> obj engine-sound-envelope)) - (format #t "~T~Tdebug-draw: ~A~%" (-> obj debug-draw)) - (format #t "~T~Tdebug-path-record: ~A~%" (-> obj debug-path-record)) - (format #t "~T~Tdebug-path-playback: ~A~%" (-> obj debug-path-playback)) - (format #t "~T~Tmeasure-parameters: ~A~%" (-> obj measure-parameters)) - (format #t "~T~Tcontroller: #~%" (-> obj controller)) - (format #t "~T~Tanim: ~A~%" (-> obj anim)) - (format #t "~T~Told-target-pos: #~%" (-> obj old-target-pos)) - (format #t "~T~Tevilbro: ~D~%" (-> obj evilbro)) - (format #t "~T~Tevilsis: ~D~%" (-> obj evilsis)) - obj + (format #t "~T~Tstabilizer-array[2] @ #x~X~%" (-> this stabilizer-array)) + (format #t "~T~Tengine-thrust-local-pos: #~%" (-> this engine-thrust-local-pos)) + (format #t "~T~Tignition: ~A~%" (-> this ignition)) + (format #t "~T~Tengine-thrust: ~f~%" (-> this engine-thrust)) + (format #t "~T~Tpropeller: ~A~%" (-> this propeller)) + (format #t "~T~Tdock-point: #~%" (-> this dock-point)) + (format #t "~T~Tdest-dir: #~%" (-> this dest-dir)) + (format #t "~T~Tdock-point-index: ~D~%" (-> this dock-point-index)) + (format #t "~T~Tauto-pilot: ~A~%" (-> this auto-pilot)) + (format #t "~T~Tanchored: ~A~%" (-> this anchored)) + (format #t "~T~Twaiting-for-player: ~A~%" (-> this waiting-for-player)) + (format #t "~T~Tplayer-riding: ~A~%" (-> this player-riding)) + (format #t "~T~Tboat-path: #~%" (-> this boat-path)) + (format #t "~T~Tcam-tracker: ~D~%" (-> this cam-tracker)) + (format #t "~T~Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + (format #t "~T~Tkill-player: ~A~%" (-> this kill-player)) + (format #t "~T~Tengine-sound-id: ~D~%" (-> this engine-sound-id)) + (format #t "~T~Tengine-sound-envelope: ~f~%" (-> this engine-sound-envelope)) + (format #t "~T~Tdebug-draw: ~A~%" (-> this debug-draw)) + (format #t "~T~Tdebug-path-record: ~A~%" (-> this debug-path-record)) + (format #t "~T~Tdebug-path-playback: ~A~%" (-> this debug-path-playback)) + (format #t "~T~Tmeasure-parameters: ~A~%" (-> this measure-parameters)) + (format #t "~T~Tcontroller: #~%" (-> this controller)) + (format #t "~T~Tanim: ~A~%" (-> this anim)) + (format #t "~T~Told-target-pos: #~%" (-> this old-target-pos)) + (format #t "~T~Tevilbro: ~D~%" (-> this evilbro)) + (format #t "~T~Tevilsis: ~D~%" (-> this evilsis)) + this ) ;; failed to figure out what this is: @@ -647,40 +647,40 @@ ;; definition for method 23 of type fishermans-boat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-23 fishermans-boat ((obj fishermans-boat) (arg0 float)) +(defmethod rigid-body-platform-method-23 fishermans-boat ((this fishermans-boat) (arg0 float)) (local-vars (sv-128 int) (sv-144 rigid-body-control-point) (sv-160 int) (sv-176 vector)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) - (s3-0 (-> obj rbody matrix)) + (s3-0 (-> this rbody matrix)) ) (set! (-> s2-0 quad) (-> s3-0 vector 2 quad)) (set! sv-128 0) (while (< sv-128 6) - (set! sv-144 (-> obj control-point-array data sv-128)) + (set! sv-144 (-> this control-point-array data sv-128)) (vector-matrix*! s5-0 (-> sv-144 local-pos) s3-0) (set! (-> sv-144 world-pos quad) (-> s5-0 quad)) - (rigid-body-method-17 (-> obj rbody) s5-0 s1-0) + (rigid-body-method-17 (-> this rbody) s5-0 s1-0) (set! (-> sv-144 velocity quad) (-> s1-0 quad)) (set! (-> sv-144 world-pos w) (ocean-get-height s5-0)) (let* ((f0-2 (- (-> sv-144 world-pos w) (-> s5-0 y))) - (f30-0 (fmin 1.0 (/ f0-2 (-> obj info max-buoyancy-depth)))) + (f30-0 (fmin 1.0 (/ f0-2 (-> this info max-buoyancy-depth)))) ) (when (< 0.0 f0-2) - (vector-float*! s4-0 *y-vector* (* 20.0 f0-2 (-> obj rbody mass))) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (vector-float*! s4-0 *y-vector* (* 20.0 f0-2 (-> this rbody mass))) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) (vector-float*! s4-0 *y-vector* (* 1.6 f30-0 (fmax 0.0 (vector-dot s2-0 s1-0)))) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) - (vector-float*! s4-0 s1-0 (* -1.0 (-> obj info drag-factor) f30-0)) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) + (vector-float*! s4-0 s1-0 (* -1.0 (-> this info drag-factor) f30-0)) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) (vector-float*! s4-0 (the-as vector (-> s3-0 vector)) (* -0.5 (vector-dot (the-as vector (-> s3-0 vector)) s1-0)) ) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) ) ) 0 @@ -688,28 +688,28 @@ ) (set! sv-160 0) (while (< sv-160 2) - (set! sv-176 (-> obj stabilizer-array sv-160 local-pos)) + (set! sv-176 (-> this stabilizer-array sv-160 local-pos)) (vector-matrix*! s5-0 (the-as vector (&-> sv-176 x)) s3-0) (vector-rotate*! s0-0 (&+ sv-176 16) s3-0) - (rigid-body-method-17 (-> obj rbody) s5-0 s1-0) + (rigid-body-method-17 (-> this rbody) s5-0 s1-0) (vector-float*! s4-0 s0-0 (* -1.0 (vector-dot s0-0 s1-0))) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) 0 (set! sv-160 (+ sv-160 1)) ) - (when (-> obj anchored) + (when (-> this anchored) (let ((s1-1 (new 'stack-no-clear 'vector))) (vector+*! s5-0 (-> s3-0 vector 3) s2-0 24576.0) - (vector+*! s1-1 (-> obj dock-point) (-> obj dest-dir) 24576.0) + (vector+*! s1-1 (-> this dock-point) (-> this dest-dir) 24576.0) (vector-! s4-0 s1-1 s5-0) (set! (-> s4-0 y) 0.0) (vector-float*! s4-0 s4-0 10.0) (if (< 81920.0 (vector-length s4-0)) (vector-normalize! s4-0 81920.0) ) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) (vector+*! s5-0 (-> s3-0 vector 3) s2-0 -24576.0) - (vector+*! s1-1 (-> obj dock-point) (-> obj dest-dir) -24576.0) + (vector+*! s1-1 (-> this dock-point) (-> this dest-dir) -24576.0) (vector-! s4-0 s1-1 s5-0) ) (set! (-> s4-0 y) 0.0) @@ -717,21 +717,21 @@ (if (< 81920.0 (vector-length s4-0)) (vector-normalize! s4-0 81920.0) ) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) ) - (when (-> obj ignition) + (when (-> this ignition) (let ((s2-1 (new 'stack-no-clear 'vector))) - (vector-matrix*! s5-0 (-> obj engine-thrust-local-pos) s3-0) - (set-vector! s2-1 (- (-> obj controller steering)) 0.0 2.0 1.0) + (vector-matrix*! s5-0 (-> this engine-thrust-local-pos) s3-0) + (set-vector! s2-1 (- (-> this controller steering)) 0.0 2.0 1.0) (vector-rotate*! s2-1 s2-1 s3-0) (vector-normalize! s2-1 1.0) - (vector-float*! s4-0 s2-1 (-> obj engine-thrust)) + (vector-float*! s4-0 s2-1 (-> this engine-thrust)) ) - (rigid-body-method-13 (-> obj rbody) s5-0 s4-0) + (rigid-body-method-13 (-> this rbody) s5-0 s4-0) ) ) - (rigid-body-platform-method-26 obj) - (rigid-body-platform-method-25 obj) + (rigid-body-platform-method-26 this) + (rigid-body-platform-method-25 this) 0 (none) ) @@ -827,8 +827,8 @@ ;; INFO: Return type mismatch int vs none. (defbehavior fishermans-boat-play-sounds fishermans-boat () (if (-> self ignition) - (seek! (-> self engine-sound-envelope) 1.0 (* 2.0 (-> *display* seconds-per-frame))) - (seek! (-> self engine-sound-envelope) 0.0 (-> *display* seconds-per-frame)) + (seek! (-> self engine-sound-envelope) 1.0 (* 2.0 (seconds-per-frame))) + (seek! (-> self engine-sound-envelope) 0.0 (seconds-per-frame)) ) (cond ((< 0.0 (-> self engine-sound-envelope)) @@ -878,11 +878,11 @@ (else (when (not (-> self measure-parameters)) (let ((f0-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0))) - (seek! (-> self controller steering) (fmax -1.0 (fmin 1.0 f0-0)) (-> *display* seconds-per-frame)) + (seek! (-> self controller steering) (fmax -1.0 (fmin 1.0 f0-0)) (seconds-per-frame)) ) (if (cpad-hold? 0 x) - (seek! (-> self controller throttle) 0.8 (-> *display* seconds-per-frame)) - (seek! (-> self controller throttle) 0.0 (* 0.25 (-> *display* seconds-per-frame))) + (seek! (-> self controller throttle) 0.8 (seconds-per-frame)) + (seek! (-> self controller throttle) 0.0 (* 0.25 (seconds-per-frame))) ) 0 ) @@ -952,7 +952,7 @@ (when (and (< (vector-vector-distance (target-pos 0) (-> self rbody position)) 6144.0) (or (task-complete? *game-info* (game-task jungle-fishgame)) (and *cheat-mode* (cpad-hold? 0 l3))) (not (level-hint-displayed?)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (file-status *art-control* (-> self anim name) 0) ) (hide-hud) @@ -1009,7 +1009,7 @@ (defstate fishermans-boat-docked-village (fishermans-boat) :event rigid-body-platform-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (fishermans-boat-leave-dock?) @@ -1119,7 +1119,7 @@ (defstate fishermans-boat-docked-misty (fishermans-boat) :event rigid-body-platform-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (fishermans-boat-leave-dock?) @@ -1316,11 +1316,11 @@ (let ((f30-0 (* (the float s5-0) (-> self controller table-step)))) (set! (-> self measure-parameters) #t) (set! (-> self controller steering) 1.0) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (let ((f0-6 (/ (fabs (- f30-0 (vector-xz-length (-> self rbody lin-velocity)))) f30-0))) (if (< 0.05 f0-6) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) ) (fishermans-boat-set-throttle-by-speed f30-0) @@ -1328,8 +1328,8 @@ ) (vector-z-quaternion! gp-0 (-> self root-overlay quat)) (vehicle-controller-method-10 (-> self controller) gp-0 (-> self controller throttle) s5-0) - (let ((s3-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) s3-0) (seconds 1)) + (let ((s3-0 (current-time))) + (until (time-elapsed? s3-0 (seconds 1)) (fishermans-boat-set-throttle-by-speed f30-0) (suspend) (suspend) @@ -1348,15 +1348,15 @@ ;; definition for method 7 of type fishermans-boat ;; INFO: Return type mismatch rigid-body-platform vs fishermans-boat. -(defmethod relocate fishermans-boat ((obj fishermans-boat) (arg0 int)) - (relocate (-> obj controller) arg0) - (if (nonzero? (-> obj propeller)) - (&+! (-> obj propeller) arg0) +(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)) - obj + this arg0 ) ) @@ -1364,8 +1364,8 @@ ;; definition for method 30 of type fishermans-boat ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 fishermans-boat ((obj fishermans-boat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) +(defmethod rigid-body-platform-method-30 fishermans-boat ((this fishermans-boat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -1391,7 +1391,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -1400,102 +1400,102 @@ ;; definition for method 31 of type fishermans-boat ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 fishermans-boat ((obj fishermans-boat)) - (initialize-skeleton obj *fishermans-boat-sg* '()) - (logclear! (-> obj mask) (process-mask actor-pause movie)) - (logior! (-> obj skel status) (janim-status inited)) - (process-entity-status! obj (entity-perm-status bit-3) #t) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj boat-path point-count) 0) - (add-point! (-> obj boat-path) -88473.6 28672.0 425984.0 16384.0) - (add-point! (-> obj boat-path) 18432.0 69632.0 1014169.6 14563.556) - (add-point! (-> obj boat-path) 292864.0 122880.0 2875801.5 18204.445) - (add-point! (-> obj boat-path) 167936.0 40960.0 3069952.0 32768.0) - (add-point! (-> obj boat-path) 49971.2 28672.0 2924544.0 -16384.0) - (add-point! (-> obj boat-path) 175718.4 122880.0 626688.0 -18204.445) - (add-point! (-> obj boat-path) 50790.4 40960.0 197427.2 32768.0) +(defmethod rigid-body-platform-method-31 fishermans-boat ((this fishermans-boat)) + (initialize-skeleton this *fishermans-boat-sg* '()) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (logior! (-> this skel status) (janim-status inited)) + (process-entity-status! this (entity-perm-status bit-3) #t) + (process-entity-status! this (entity-perm-status bit-7) #t) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this boat-path point-count) 0) + (add-point! (-> this boat-path) -88473.6 28672.0 425984.0 16384.0) + (add-point! (-> this boat-path) 18432.0 69632.0 1014169.6 14563.556) + (add-point! (-> this boat-path) 292864.0 122880.0 2875801.5 18204.445) + (add-point! (-> this boat-path) 167936.0 40960.0 3069952.0 32768.0) + (add-point! (-> this boat-path) 49971.2 28672.0 2924544.0 -16384.0) + (add-point! (-> this boat-path) 175718.4 122880.0 626688.0 -18204.445) + (add-point! (-> this boat-path) 50790.4 40960.0 197427.2 32768.0) (init! - (-> obj controller) - (-> obj boat-path) + (-> this controller) + (-> this boat-path) *boat-turning-radius-table* *boat-throttle-control-table* 30 4096.0 ) - (set! (-> obj propeller) (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :z -1.0 :w 1.0) 0.0)) - (set! (-> obj ignition) #f) - (set! (-> obj anchored) #t) - (set! (-> obj player-riding) #f) - (set! (-> obj kill-player) #f) - (set! (-> obj debug-draw) #f) - (set! (-> obj cam-tracker) (the-as handle #f)) - (set! (-> obj auto-pilot) #f) + (set! (-> this propeller) (new 'process 'joint-mod-spinner this 4 (new 'static 'vector :z -1.0 :w 1.0) 0.0)) + (set! (-> this ignition) #f) + (set! (-> this anchored) #t) + (set! (-> this player-riding) #f) + (set! (-> this kill-player) #f) + (set! (-> this debug-draw) #f) + (set! (-> this cam-tracker) (the-as handle #f)) + (set! (-> this auto-pilot) #f) (if (= (-> *game-info* current-continue level) 'misty) (fishermans-boat-set-dock-point 4) (fishermans-boat-set-dock-point 0) ) - (fishermans-boat-set-path-point (-> obj dock-point-index)) + (fishermans-boat-set-path-point (-> this dock-point-index)) (fishermans-boat-next-path-point) - (set! (-> obj root-overlay trans quad) (-> obj dock-point quad)) - (set! (-> obj root-overlay trans y) 0.0) - (forward-up-nopitch->quaternion (-> obj root-overlay quat) (-> obj dest-dir) *up-vector*) - (rigid-body-platform-method-29 obj *fishermans-boat-constants*) - (let ((v1-39 (-> obj control-point-array data))) + (set! (-> this root-overlay trans quad) (-> this dock-point quad)) + (set! (-> this root-overlay trans y) 0.0) + (forward-up-nopitch->quaternion (-> this root-overlay quat) (-> this dest-dir) *up-vector*) + (rigid-body-platform-method-29 this *fishermans-boat-constants*) + (let ((v1-39 (-> this control-point-array data))) (set! (-> v1-39 0 local-pos x) 0.0) (set! (-> v1-39 0 local-pos y) 0.0) (set! (-> v1-39 0 local-pos z) 24576.0) (set! (-> v1-39 0 local-pos w) 1.0) ) - (let ((v1-41 (-> obj control-point-array data 1))) + (let ((v1-41 (-> this control-point-array data 1))) (set! (-> v1-41 local-pos x) 22528.0) (set! (-> v1-41 local-pos y) 0.0) (set! (-> v1-41 local-pos z) -20480.0) (set! (-> v1-41 local-pos w) 1.0) ) - (let ((v1-43 (-> obj control-point-array data 2))) + (let ((v1-43 (-> this control-point-array data 2))) (set! (-> v1-43 local-pos x) -22528.0) (set! (-> v1-43 local-pos y) 0.0) (set! (-> v1-43 local-pos z) -20480.0) (set! (-> v1-43 local-pos w) 1.0) ) - (let ((v1-45 (-> obj control-point-array data 3))) + (let ((v1-45 (-> this control-point-array data 3))) (set! (-> v1-45 local-pos x) 0.0) (set! (-> v1-45 local-pos y) 0.0) (set! (-> v1-45 local-pos z) 49152.0) (set! (-> v1-45 local-pos w) 1.0) ) - (let ((v1-47 (-> obj control-point-array data 4))) + (let ((v1-47 (-> this control-point-array data 4))) (set! (-> v1-47 local-pos x) 22528.0) (set! (-> v1-47 local-pos y) 0.0) (set! (-> v1-47 local-pos z) 12288.0) (set! (-> v1-47 local-pos w) 1.0) ) - (let ((v1-49 (-> obj control-point-array data 5))) + (let ((v1-49 (-> this control-point-array data 5))) (set! (-> v1-49 local-pos x) -22528.0) (set! (-> v1-49 local-pos y) 0.0) (set! (-> v1-49 local-pos z) 12288.0) (set! (-> v1-49 local-pos w) 1.0) ) - (let ((v1-50 (-> obj stabilizer-array))) + (let ((v1-50 (-> this stabilizer-array))) (set! (-> v1-50 0 local-pos x) 16384.0) (set! (-> v1-50 0 local-pos y) 20480.0) (set! (-> v1-50 0 local-pos z) -32768.0) (set! (-> v1-50 0 local-pos w) 1.0) ) - (set-vector! (-> obj stabilizer-array 1 local-pos) -16384.0 20480.0 -32768.0 1.0) - (set-vector! (-> obj stabilizer-array 0 normal) 0.0 0.75 0.2 1.0) - (set-vector! (-> obj stabilizer-array 1 normal) 0.0 0.75 0.2 1.0) - (set-vector! (-> obj engine-thrust-local-pos) 0.0 12288.0 -20480.0 1.0) - (set! (-> obj root-overlay nav-radius) 53248.0) - (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f)) - (set! (-> obj engine-sound-id) (new 'static 'sound-id)) - (set! (-> obj debug-path-record) #f) - (set! (-> obj debug-path-playback) #f) - (set! (-> obj measure-parameters) #f) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (let ((a0-29 (-> obj entity))) + (set-vector! (-> this stabilizer-array 1 local-pos) -16384.0 20480.0 -32768.0 1.0) + (set-vector! (-> this stabilizer-array 0 normal) 0.0 0.75 0.2 1.0) + (set-vector! (-> this stabilizer-array 1 normal) 0.0 0.75 0.2 1.0) + (set-vector! (-> this engine-thrust-local-pos) 0.0 12288.0 -20480.0 1.0) + (set! (-> this root-overlay nav-radius) 53248.0) + (nav-mesh-connect this (-> this root-overlay) (the-as nav-control #f)) + (set! (-> this engine-sound-id) (new 'static 'sound-id)) + (set! (-> this debug-path-record) #f) + (set! (-> this debug-path-playback) #f) + (set! (-> this measure-parameters) #f) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (let ((a0-29 (-> this entity))) (if (when a0-29 (let ((a0-30 (-> a0-29 extra perm task))) (if a0-30 @@ -1503,7 +1503,7 @@ ) ) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) (none) @@ -1511,12 +1511,12 @@ ;; definition for method 11 of type fishermans-boat ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! fishermans-boat ((obj fishermans-boat) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask platform)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) +(defmethod init-from-entity! fishermans-boat ((this fishermans-boat) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask platform)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) (if (= (-> *game-info* current-continue level) 'misty) (go fishermans-boat-docked-misty) (go fishermans-boat-docked-village) @@ -1592,8 +1592,8 @@ process (lambda :behavior fishermans-boat () - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) diff --git a/test/decompiler/reference/jak1/levels/village1/sage_REF.gc b/test/decompiler/reference/jak1/levels/village1/sage_REF.gc index aa867a9176..cd78c5b6e8 100644 --- a/test/decompiler/reference/jak1/levels/village1/sage_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/sage_REF.gc @@ -13,13 +13,13 @@ ) ;; definition for method 3 of type sage -(defmethod inspect sage ((obj sage)) +(defmethod inspect sage ((this sage)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Treminder-played: ~A~%" (-> obj reminder-played)) - (format #t "~T~Tassistant: ~D~%" (-> obj assistant)) - obj + (format #t "~T~Treminder-played: ~A~%" (-> this reminder-played)) + (format #t "~T~Tassistant: ~D~%" (-> this assistant)) + this ) ;; failed to figure out what this is: @@ -30,7 +30,7 @@ ) ;; definition for method 32 of type sage -(defmethod play-anim! sage ((obj sage) (arg0 symbol)) +(defmethod play-anim! sage ((this sage) (arg0 symbol)) (when (!= *kernel-boot-message* 'play) (close-specific-task! (game-task intro) (task-status need-resolution)) (return (new 'static 'spool-anim @@ -51,12 +51,12 @@ ) ) ) - (case (current-status (-> obj tasks)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task intro)) (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) (set-setting! 'music-volume-movie 'abs 0.0 0) (apply-settings *setting-control*) ) @@ -117,12 +117,12 @@ ) (((game-task beach-ecorocks)) (when arg0 - (let* ((s5-1 (-> obj tasks)) + (let* ((s5-1 (-> this tasks)) (s4-0 (method-of-object s5-1 save-reminder)) ) (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "sage-intro-sequence-e" @@ -166,7 +166,7 @@ ) (else (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "sage-introduction-misty-cannon" @@ -185,11 +185,11 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (if arg0 - (set! (-> obj reminder-played) #t) + (set! (-> this reminder-played) #t) ) - (case (get-reminder (-> obj tasks) 0) + (case (get-reminder (-> this tasks) 0) ((3) (new 'static 'spool-anim :name "sage-reminder-2-generic" :index 13 :parts 4 :command-list '()) ) @@ -235,19 +235,19 @@ (when arg0 (set-setting! 'music-volume-movie 'abs 0.0 0) (apply-settings *setting-control*) - (close-status! (-> obj tasks) (task-status need-reward-speech)) - (set! (-> obj assistant) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *assistant-sg* #f :to obj)) + (close-status! (-> this tasks) (task-status need-reward-speech)) + (set! (-> this assistant) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *assistant-sg* #f :to this)) ) - (send-event (handle->process (-> obj assistant)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj assistant)) 'blend-shape #t) - (send-event (handle->process (-> obj assistant)) 'center-joint 3) - (let ((v1-68 (handle->process (-> obj assistant)))) + (send-event (handle->process (-> this assistant)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this assistant)) 'blend-shape #t) + (send-event (handle->process (-> this assistant)) 'center-joint 3) + (let ((v1-68 (handle->process (-> this assistant)))) (if v1-68 (set! (-> (the-as assistant v1-68) draw light-index) (the-as uint 1)) ) ) - (set! (-> obj draw bounds w) 40960.0) + (set! (-> this draw bounds w) 40960.0) ) (new 'static 'spool-anim :name "sage-intro-sequence-d2" @@ -330,29 +330,31 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) ;; definition for method 45 of type sage -(defmethod process-taskable-method-45 sage ((obj sage)) +(defmethod process-taskable-method-45 sage ((this sage)) (cond - ((and (closed? (-> obj tasks) (game-task beach-ecorocks) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 0) + ((and (closed? (-> this tasks) (game-task beach-ecorocks) (task-status need-reminder)) + (= (get-reminder (-> this tasks) 0) 0) ) #t ) - ((and (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 1) + ((and (closed? (-> this tasks) (game-task misty-cannon) (task-status need-reminder)) + (= (get-reminder (-> this tasks) 0) 1) ) #t ) - ((and (-> obj reminder-played) (< 81920.0 (vector-vector-distance (-> obj root-override trans) (camera-pos)))) + ((and (-> this reminder-played) + (< 81920.0 (vector-vector-distance (-> this root-override trans) (camera-pos))) + ) #t ) (else @@ -362,71 +364,72 @@ ) ;; definition for method 31 of type sage -(defmethod get-art-elem sage ((obj sage)) +(defmethod get-art-elem sage ((this sage)) (cond - ((and (= (current-task (-> obj tasks)) (game-task beach-ecorocks)) - (or (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) + ((and (= (current-task (-> this tasks)) (game-task beach-ecorocks)) + (or (= (current-status (-> this tasks)) (task-status need-hint)) + (= (current-status (-> this tasks)) (task-status need-introduction)) ) ) - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) - ((and (= (current-task (-> obj tasks)) (game-task misty-cannon)) - (or (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) + ((and (= (current-task (-> this tasks)) (game-task misty-cannon)) + (or (= (current-status (-> this tasks)) (task-status need-hint)) + (= (current-status (-> this tasks)) (task-status need-introduction)) ) ) - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) - ((process-taskable-method-45 obj) - (set! (-> obj reminder-played) #f) + ((process-taskable-method-45 this) + (set! (-> this reminder-played) #f) (cond - ((= (current-task (-> obj tasks)) (game-task none)) - (case (get-reminder (-> obj tasks) 0) + ((= (current-task (-> this tasks)) (game-task none)) + (case (get-reminder (-> this tasks) 0) ((2) - (save-reminder (-> obj tasks) 3 0) + (save-reminder (-> this tasks) 3 0) ) (else - (save-reminder (-> obj tasks) 2 0) + (save-reminder (-> this tasks) 2 0) ) ) ) - ((closed? (-> obj tasks) (game-task beach-ecorocks) (task-status need-reminder)) - (save-reminder (-> obj tasks) 1 0) + ((closed? (-> this tasks) (game-task beach-ecorocks) (task-status need-reminder)) + (save-reminder (-> this tasks) 1 0) ) - ((or (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-reminder)) - (not (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-introduction))) + ((or (closed? (-> this tasks) (game-task misty-cannon) (task-status need-reminder)) + (not (closed? (-> this tasks) (game-task misty-cannon) (task-status need-introduction))) ) - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) - ((zero? (get-reminder (-> obj tasks) 0)) - (save-reminder (-> obj tasks) 1 0) + ((zero? (get-reminder (-> this tasks) 0)) + (save-reminder (-> this tasks) 1 0) ) (else - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) ) ) ) - (case (get-reminder (-> obj tasks) 0) + (case (get-reminder (-> this tasks) 0) ((3) - (-> obj draw art-group data 7) + (-> this draw art-group data 7) ) ((2) - (-> obj draw art-group data 6) + (-> this draw art-group data 6) ) ((1) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) (else - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) ;; definition for method 43 of type sage -(defmethod process-taskable-method-43 sage ((obj sage)) - (let ((s5-0 (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj))) +(defmethod process-taskable-method-43 sage ((this sage)) + (let ((s5-0 (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this)) + ) (when s5-0 (let ((f0-2 (rand-float-gen))) (cond @@ -434,19 +437,19 @@ #f ) ((< 0.8 f0-2) - (play-ambient (-> obj ambient) "SAGELP03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP03" #f (-> this root-override trans)) ) ((< 0.6 f0-2) - (play-ambient (-> obj ambient) "SAGELP04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP04" #f (-> this root-override trans)) ) ((< 0.4 f0-2) - (play-ambient (-> obj ambient) "SAGELP05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP05" #f (-> this root-override trans)) ) ((< 0.2 f0-2) - (play-ambient (-> obj ambient) "SAGELP06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP06" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "SAGELP11" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP11" #f (-> this root-override trans)) ) ) ) @@ -532,14 +535,14 @@ ) ;; definition for method 39 of type sage -(defmethod should-display? sage ((obj sage)) +(defmethod should-display? sage ((this sage)) (not (sages-kidnapped?)) ) ;; definition for method 41 of type sage ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision sage ((obj sage) (arg0 int) (arg1 vector)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision sage ((this sage) (arg0 int) (arg1 vector)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -569,20 +572,20 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) ;; definition for method 11 of type sage -(defmethod init-from-entity! sage ((obj sage) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task misty-cannon))) - (set! (-> obj reminder-played) #f) - (set! (-> obj sound-flava) (music-flava sage)) - (set! (-> obj assistant) (the-as handle #f)) - (set! (-> obj draw light-index) (the-as uint 1)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! sage ((this sage) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sage-sg* 3 40 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task misty-cannon))) + (set! (-> this reminder-played) #f) + (set! (-> this sound-flava) (music-flava sage)) + (set! (-> this assistant) (the-as handle #f)) + (set! (-> this draw light-index) (the-as uint 1)) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc b/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc index f9fe30ec52..77314659b8 100644 --- a/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/sequence-a-village1_REF.gc @@ -210,18 +210,18 @@ ) ;; definition for method 3 of type sequenceA-village1 -(defmethod inspect sequenceA-village1 ((obj sequenceA-village1)) +(defmethod inspect sequenceA-village1 ((this sequenceA-village1)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tboat: ~D~%" (-> obj boat)) - (format #t "~T~Tside: ~D~%" (-> obj side)) - obj + (format #t "~T~Tboat: ~D~%" (-> this boat)) + (format #t "~T~Tside: ~D~%" (-> this side)) + this ) ;; definition for method 32 of type sequenceA-village1 ;; INFO: Return type mismatch spool-anim vs basic. -(defmethod play-anim! sequenceA-village1 ((obj sequenceA-village1) (arg0 symbol)) +(defmethod play-anim! sequenceA-village1 ((this sequenceA-village1) (arg0 symbol)) (when arg0 (set! (-> *time-of-day-proc* 0 time-ratio) 0.0) (set! (-> *time-of-day-proc* 0 hour) 23) @@ -230,11 +230,13 @@ (send-event *camera* 'force-blend 0) (send-event *camera* 'change-state cam-fixed 0) (send-event *target* 'sidekick #f) - (set! (-> obj boat) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *fishermans-boat-sg* #f :to obj)) + (set! (-> this boat) + (ppointer->handle + (manipy-spawn (-> this root-override trans) (-> this entity) *fishermans-boat-sg* #f :to this) + ) ) - (send-event (handle->process (-> obj boat)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj boat)) 'origin-joint-index 3) + (send-event (handle->process (-> this boat)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this boat)) 'origin-joint-index 3) ) (the-as basic (new 'static 'spool-anim :name "sage-intro-sequence-a" @@ -266,8 +268,8 @@ ) ;; definition for method 31 of type sequenceA-village1 -(defmethod get-art-elem sequenceA-village1 ((obj sequenceA-village1)) - (-> obj draw art-group data 3) +(defmethod get-art-elem sequenceA-village1 ((this sequenceA-village1)) + (-> this draw art-group data 3) ) ;; failed to figure out what this is: @@ -325,7 +327,7 @@ ) ;; definition for method 39 of type sequenceA-village1 -(defmethod should-display? sequenceA-village1 ((obj sequenceA-village1)) +(defmethod should-display? sequenceA-village1 ((this sequenceA-village1)) #f ) 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 a0845faefc..3b9d7f0c6b 100644 --- a/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/village-obs_REF.gc @@ -207,33 +207,33 @@ ) ;; definition for method 3 of type windmill-sail -(defmethod inspect windmill-sail ((obj windmill-sail)) +(defmethod inspect windmill-sail ((this windmill-sail)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tblade-normal: #~%" (-> obj blade-normal)) - (format #t "~T~Torig-quat: #~%" (-> obj orig-quat)) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - (format #t "~T~Tpart2: ~A~%" (-> obj part2)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tblade-normal: #~%" (-> this blade-normal)) + (format #t "~T~Torig-quat: #~%" (-> this orig-quat)) + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + (format #t "~T~Tpart2: ~A~%" (-> this part2)) + this ) ;; definition for method 7 of type windmill-sail ;; INFO: Return type mismatch process-drawable vs windmill-sail. -(defmethod relocate windmill-sail ((obj windmill-sail) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate windmill-sail ((this windmill-sail) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as windmill-sail ((method-of-type process-drawable relocate) obj arg0)) + (the-as windmill-sail ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type windmill-sail -(defmethod deactivate windmill-sail ((obj windmill-sail)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate windmill-sail ((this windmill-sail)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -323,19 +323,19 @@ ;; definition for method 11 of type windmill-sail ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! windmill-sail ((obj windmill-sail) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (load-params! (-> obj sync) obj (the-as uint 4800) 0.0 0.15 0.15) - (set! (-> obj root-override) (new 'process 'trsq)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *windmill-sail-sg* '()) - (quaternion-copy! (-> obj orig-quat) (-> obj root-override quat)) - (vector-x-quaternion! (-> obj blade-normal) (-> obj root-override quat)) - (vector-normalize! (-> obj blade-normal) 1.0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 123) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 124) obj)) - (set! (-> obj sound) (new 'process 'ambient-sound arg0 (-> obj root-override trans))) +(defmethod init-from-entity! windmill-sail ((this windmill-sail) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (load-params! (-> this sync) this (the-as uint 4800) 0.0 0.15 0.15) + (set! (-> this root-override) (new 'process 'trsq)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *windmill-sail-sg* '()) + (quaternion-copy! (-> this orig-quat) (-> this root-override quat)) + (vector-x-quaternion! (-> this blade-normal) (-> this root-override quat)) + (vector-normalize! (-> this blade-normal) 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 123) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 124) this)) + (set! (-> this sound) (new 'process 'ambient-sound arg0 (-> this root-override trans))) (go windmill-sail-idle) (none) ) @@ -357,14 +357,14 @@ ) ;; definition for method 3 of type sagesail -(defmethod inspect sagesail ((obj sagesail)) +(defmethod inspect sagesail ((this sagesail)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsync: #~%" (-> obj sync)) - (format #t "~T~Tblade-normal: #~%" (-> obj blade-normal)) - (format #t "~T~Torig-quat: #~%" (-> obj orig-quat)) - obj + (format #t "~T~Tsync: #~%" (-> this sync)) + (format #t "~T~Tblade-normal: #~%" (-> this blade-normal)) + (format #t "~T~Torig-quat: #~%" (-> this orig-quat)) + this ) ;; failed to figure out what this is: @@ -395,16 +395,16 @@ ;; definition for method 11 of type sagesail ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! sagesail ((obj sagesail) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (load-params! (-> obj sync) obj (the-as uint 3000) 0.0 0.15 0.15) - (set! (-> obj root-override) (new 'process 'trsq)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton obj *sagesail-sg* '()) - (quaternion-copy! (-> obj orig-quat) (-> obj root-override quat)) - (vector-z-quaternion! (-> obj blade-normal) (-> obj root-override quat)) - (vector-normalize! (-> obj blade-normal) 1.0) +(defmethod init-from-entity! sagesail ((this sagesail) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (load-params! (-> this sync) this (the-as uint 3000) 0.0 0.15 0.15) + (set! (-> this root-override) (new 'process 'trsq)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton this *sagesail-sg* '()) + (quaternion-copy! (-> this orig-quat) (-> this root-override quat)) + (vector-z-quaternion! (-> this blade-normal) (-> this root-override quat)) + (vector-normalize! (-> this blade-normal) 1.0) (go sagesail-idle) (none) ) @@ -426,28 +426,28 @@ ) ;; definition for method 3 of type windspinner -(defmethod inspect windspinner ((obj windspinner)) +(defmethod inspect windspinner ((this windspinner)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tblade-normal: #~%" (-> obj blade-normal)) - (format #t "~T~Torig-quat: #~%" (-> obj orig-quat)) - (format #t "~T~Tangle: ~f~%" (-> obj angle)) - (format #t "~T~Tangle-vel: ~f~%" (-> obj angle-vel)) - obj + (format #t "~T~Tblade-normal: #~%" (-> this blade-normal)) + (format #t "~T~Torig-quat: #~%" (-> this orig-quat)) + (format #t "~T~Tangle: ~f~%" (-> this angle)) + (format #t "~T~Tangle-vel: ~f~%" (-> this angle-vel)) + this ) ;; definition for method 12 of type windspinner -(defmethod run-logic? windspinner ((obj windspinner)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-status was-drawn)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) +(defmethod run-logic? windspinner ((this windspinner)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-status was-drawn)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status no-skeleton-update))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-status no-skeleton-update))) ) ) ) @@ -501,17 +501,17 @@ ;; definition for method 11 of type windspinner ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! windspinner ((obj windspinner) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj angle) 0.0) - (set! (-> obj angle-vel) 145.63556) - (set! (-> obj root) (the-as trsqv (new 'process 'trsq))) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *windspinner-sg* '()) - (set! (-> obj root pause-adjust-distance) 819200.0) - (quaternion-copy! (-> obj orig-quat) (-> obj root quat)) - (vector-y-quaternion! (-> obj blade-normal) (-> obj root quat)) - (vector-normalize! (-> obj blade-normal) 1.0) +(defmethod init-from-entity! windspinner ((this windspinner) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this angle) 0.0) + (set! (-> this angle-vel) 145.63556) + (set! (-> this root) (the-as trsqv (new 'process 'trsq))) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *windspinner-sg* '()) + (set! (-> this root pause-adjust-distance) 819200.0) + (quaternion-copy! (-> this orig-quat) (-> this root quat)) + (vector-y-quaternion! (-> this blade-normal) (-> this root quat)) + (vector-normalize! (-> this blade-normal) 1.0) (go windspinner-idle) (none) ) @@ -530,12 +530,12 @@ ) ;; definition for method 3 of type mayorgears -(defmethod inspect mayorgears ((obj mayorgears)) +(defmethod inspect mayorgears ((this mayorgears)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Talt-actor: ~A~%" (-> obj alt-actor)) - obj + (format #t "~T~Talt-actor: ~A~%" (-> this alt-actor)) + this ) ;; failed to figure out what this is: @@ -560,12 +560,12 @@ ;; definition for method 11 of type mayorgears ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! mayorgears ((obj mayorgears) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *mayorgears-sg* '()) - (set! (-> obj draw shadow-mask) (the-as uint 255)) +(defmethod init-from-entity! mayorgears ((this mayorgears) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *mayorgears-sg* '()) + (set! (-> this draw shadow-mask) (the-as uint 255)) (go mayorgears-idle) (none) ) @@ -585,13 +585,13 @@ ) ;; definition for method 3 of type reflector-middle -(defmethod inspect reflector-middle ((obj reflector-middle)) +(defmethod inspect reflector-middle ((this reflector-middle)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Treflector-trans: ~`vector`P~%" (-> obj reflector-trans)) - (format #t "~T~Tnext-reflector-trans: ~`vector`P~%" (-> obj next-reflector-trans)) - obj + (format #t "~T~Treflector-trans: ~`vector`P~%" (-> this reflector-trans)) + (format #t "~T~Tnext-reflector-trans: ~`vector`P~%" (-> this next-reflector-trans)) + this ) ;; failed to figure out what this is: @@ -615,21 +615,21 @@ ;; definition for method 11 of type reflector-middle ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! reflector-middle ((obj reflector-middle) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *reflector-middle-sg* '()) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj reflector-trans quad) (-> obj root trans quad)) - (+! (-> obj reflector-trans y) (res-lump-float arg0 'height-info)) - (let ((a0-10 (-> obj link next))) +(defmethod init-from-entity! reflector-middle ((this reflector-middle) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *reflector-middle-sg* '()) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this reflector-trans quad) (-> this root trans quad)) + (+! (-> this reflector-trans y) (res-lump-float arg0 'height-info)) + (let ((a0-10 (-> this link next))) (when a0-10 - (set! (-> obj next-reflector-trans quad) (-> a0-10 extra trans quad)) - (+! (-> obj next-reflector-trans y) (res-lump-float a0-10 'height-info)) + (set! (-> this next-reflector-trans quad) (-> a0-10 extra trans quad)) + (+! (-> this next-reflector-trans y) (res-lump-float a0-10 'height-info)) ) ) - (logior! (-> obj draw status) (draw-status do-not-check-distance)) + (logior! (-> this draw status) (draw-status do-not-check-distance)) (go reflector-middle-idle) (none) ) @@ -647,11 +647,11 @@ ) ;; definition for method 3 of type reflector-end -(defmethod inspect reflector-end ((obj reflector-end)) +(defmethod inspect reflector-end ((this reflector-end)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -661,9 +661,9 @@ ;; definition for method 11 of type reflector-end ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! reflector-end ((obj reflector-end) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! reflector-end ((this reflector-end) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (go reflector-end-idle) (none) ) @@ -682,12 +682,12 @@ ) ;; definition for method 3 of type villa-starfish -(defmethod inspect villa-starfish ((obj villa-starfish)) +(defmethod inspect villa-starfish ((this villa-starfish)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tchild-count: ~D~%" (-> obj child-count)) - obj + (format #t "~T~Tchild-count: ~D~%" (-> this child-count)) + this ) ;; failed to figure out what this is: @@ -710,18 +710,18 @@ ) ;; definition for method 3 of type starfish -(defmethod inspect starfish ((obj starfish)) +(defmethod inspect starfish ((this starfish)) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: (defstate starfish-idle (starfish) :enter (behavior () (move-to-ground (-> self collide-info) 40960.0 40960.0 #t (collide-kind background)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-channel-set! 0) ) :exit (behavior () @@ -743,11 +743,11 @@ ;; failed to figure out what this is: (defstate starfish-patrol (starfish) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav flags) (nav-control-flags navcf19)) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (if (or (not *target*) (< 204800.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) ) @@ -825,9 +825,9 @@ ;; definition for method 47 of type starfish ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision starfish ((obj starfish)) - (logior! (-> obj mask) (process-mask enemy)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod initialize-collision starfish ((this starfish)) + (logior! (-> this mask) (process-mask enemy)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -840,7 +840,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj collide-info) s5-0) + (set! (-> this collide-info) s5-0) ) 0 (none) @@ -848,9 +848,9 @@ ;; definition for method 48 of type starfish ;; INFO: Return type mismatch int vs none. -(defmethod nav-enemy-method-48 starfish ((obj starfish)) - (initialize-skeleton obj *starfish-sg* '()) - (init-defaults! obj *starfish-nav-enemy-info*) +(defmethod nav-enemy-method-48 starfish ((this starfish)) + (initialize-skeleton this *starfish-sg* '()) + (init-defaults! this *starfish-nav-enemy-info*) 0 (none) ) @@ -898,10 +898,10 @@ ;; failed to figure out what this is: (defstate villa-starfish-idle (villa-starfish) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) + (set-time! (-> self state-time)) (if (and (and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (< (process-drawable-child-count) (-> self child-count)) ) @@ -916,13 +916,13 @@ ;; definition for method 11 of type villa-starfish ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! villa-starfish ((obj villa-starfish) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! villa-starfish ((this villa-starfish) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (let ((a1-4 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 3)))) - (set! (-> obj child-count) (max 1 (min 8 (the-as int a1-4)))) + (set! (-> this child-count) (max 1 (min 8 (the-as int a1-4)))) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0)) (go villa-starfish-idle) (none) ) @@ -941,18 +941,18 @@ ) ;; definition for method 3 of type village-fish -(defmethod inspect village-fish ((obj village-fish)) +(defmethod inspect village-fish ((this village-fish)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tchild-count: ~D~%" (-> obj child-count)) - obj + (format #t "~T~Tchild-count: ~D~%" (-> this child-count)) + this ) ;; failed to figure out what this is: (defstate village-fish-idle (village-fish) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (suspend) ) @@ -962,9 +962,9 @@ ;; definition for method 11 of type village-fish ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! village-fish ((obj village-fish) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) +(defmethod init-from-entity! village-fish ((this village-fish) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (go village-fish-idle) (none) ) @@ -979,11 +979,11 @@ ) ;; definition for method 3 of type villa-fisha -(defmethod inspect villa-fisha ((obj villa-fisha)) +(defmethod inspect villa-fisha ((this villa-fisha)) (let ((t9-0 (method-of-type village-fish inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type villa-fishb @@ -996,11 +996,11 @@ ) ;; definition for method 3 of type villa-fishb -(defmethod inspect villa-fishb ((obj villa-fishb)) +(defmethod inspect villa-fishb ((this villa-fishb)) (let ((t9-0 (method-of-type village-fish inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type cyclegen @@ -1015,11 +1015,11 @@ ) ;; definition for method 3 of type cyclegen -(defmethod inspect cyclegen ((obj cyclegen)) - (format #t "[~8x] ~A~%" obj 'cyclegen) - (format #t "~Toutput: ~f~%" (-> obj output)) - (format #t "~Tinc: ~f~%" (-> obj inc)) - obj +(defmethod inspect cyclegen ((this cyclegen)) + (format #t "[~8x] ~A~%" this 'cyclegen) + (format #t "~Toutput: ~f~%" (-> this output)) + (format #t "~Tinc: ~f~%" (-> this inc)) + this ) ;; definition for function set-period @@ -1050,24 +1050,24 @@ ) ;; definition for method 3 of type hutlamp -(defmethod inspect hutlamp ((obj hutlamp)) +(defmethod inspect hutlamp ((this hutlamp)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tpivot: ~A~%" (-> obj pivot)) - (format #t "~T~Tclock: #~%" (-> obj clock)) - obj + (format #t "~T~Tpivot: ~A~%" (-> this pivot)) + (format #t "~T~Tclock: #~%" (-> this clock)) + this ) ;; definition for method 7 of type hutlamp ;; INFO: Return type mismatch process-drawable vs hutlamp. -(defmethod relocate hutlamp ((obj hutlamp) (arg0 int)) - (if (nonzero? (-> obj pivot)) - (&+! (-> obj pivot) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method hutlamp 7)) this arg0) ) ) @@ -1093,13 +1093,13 @@ ;; definition for method 11 of type hutlamp ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! hutlamp ((obj hutlamp) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *hutlamp-sg* '()) - (set! (-> obj pivot) (new 'process 'joint-mod-set-local obj 3 #f #t #f)) - (set-period (-> obj clock) 900) - (set! (-> obj clock output) (rand-vu)) +(defmethod init-from-entity! hutlamp ((this hutlamp) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *hutlamp-sg* '()) + (set! (-> this pivot) (new 'process 'joint-mod-set-local this 3 #f #t #f)) + (set-period (-> this clock) 900) + (set! (-> this clock output) (rand-vu)) (go hutlamp-idle) (none) ) @@ -1117,11 +1117,11 @@ ) ;; definition for method 3 of type revcycleprop -(defmethod inspect revcycleprop ((obj revcycleprop)) +(defmethod inspect revcycleprop ((this revcycleprop)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1139,12 +1139,12 @@ ;; definition for method 11 of type revcycleprop ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! revcycleprop ((obj revcycleprop) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *revcycleprop-sg* '()) - (set! (-> obj draw light-index) (the-as uint 1)) - (go (method-of-object obj idle)) +(defmethod init-from-entity! revcycleprop ((this revcycleprop) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *revcycleprop-sg* '()) + (set! (-> this draw light-index) (the-as uint 1)) + (go (method-of-object this idle)) (none) ) @@ -1161,11 +1161,11 @@ ) ;; definition for method 3 of type revcycle -(defmethod inspect revcycle ((obj revcycle)) +(defmethod inspect revcycle ((this revcycle)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -1183,12 +1183,12 @@ ;; definition for method 11 of type revcycle ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! revcycle ((obj revcycle) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *revcycle-sg* '()) - (set! (-> obj draw light-index) (the-as uint 1)) - (go (method-of-object obj idle)) +(defmethod init-from-entity! revcycle ((this revcycle) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *revcycle-sg* '()) + (set! (-> this draw light-index) (the-as uint 1)) + (go (method-of-object this idle)) (none) ) @@ -1202,11 +1202,11 @@ ) ;; definition for method 3 of type villagea-water -(defmethod inspect villagea-water ((obj villagea-water)) +(defmethod inspect villagea-water ((this villagea-water)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for symbol ripple-for-villagea-water, type ripple-wave-set @@ -1225,13 +1225,13 @@ ;; definition for method 22 of type villagea-water ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 villagea-water ((obj villagea-water)) +(defmethod water-vol-method-22 villagea-water ((this villagea-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) diff --git a/test/decompiler/reference/jak1/levels/village1/village1-part_REF.gc b/test/decompiler/reference/jak1/levels/village1/village1-part_REF.gc index 6c0a0b4f53..1f0c751624 100644 --- a/test/decompiler/reference/jak1/levels/village1/village1-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/village1-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type villagea-part -(defmethod inspect villagea-part ((obj villagea-part)) +(defmethod inspect villagea-part ((this villagea-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -822,7 +822,7 @@ ;; INFO: Return type mismatch int vs none. (defun bird-bob-func ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) (set! (-> arg2 y) (+ (-> (the-as process-drawable (-> arg1 key proc)) root trans y) - (* -2048.0 (sin (* 218.45334 (the float (mod (-> *display* base-frame-counter) 300))))) + (* -2048.0 (sin (* 218.45334 (the float (mod (current-time) 300))))) ) ) 0 diff --git a/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc b/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc index e8d94385dd..2f0bc79542 100644 --- a/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc +++ b/test/decompiler/reference/jak1/levels/village1/yakow_REF.gc @@ -54,34 +54,34 @@ ) ;; definition for method 3 of type yakow-bank -(defmethod inspect yakow-bank ((obj yakow-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Twalk-cycle-frame-count: ~f~%" (-> obj walk-cycle-frame-count)) - (format #t "~Trun-cycle-frame-count: ~f~%" (-> obj run-cycle-frame-count)) - (format #t "~Twalk-speed: (meters ~m)~%" (-> obj walk-speed)) - (format #t "~Trun-speed: (meters ~m)~%" (-> obj run-speed)) - (format #t "~Twalk-anim-speed: ~f~%" (-> obj walk-anim-speed)) - (format #t "~Trun-anim-speed: ~f~%" (-> obj run-anim-speed)) - (format #t "~Twalk-away-dist: (meters ~m)~%" (-> obj walk-away-dist)) - (format #t "~Trun-away-dist: (meters ~m)~%" (-> obj run-away-dist)) - (format #t "~Twalk-rotate-speed: ~f~%" (-> obj walk-rotate-speed)) - (format #t "~Trun-rotate-speed: ~f~%" (-> obj run-rotate-speed)) - (format #t "~Twalk-turn-time: ~D~%" (-> obj walk-turn-time)) - (format #t "~Trun-turn-time: ~D~%" (-> obj run-turn-time)) - (format #t "~Tmax-walk-speed: ~f~%" (-> obj max-walk-speed)) - (format #t "~Tmin-run-speed: ~f~%" (-> obj min-run-speed)) - (format #t "~Twalk-run-blend-rate: ~f~%" (-> obj walk-run-blend-rate)) - (format #t "~Twalk-turn-blend-rate: ~f~%" (-> obj walk-turn-blend-rate)) - (format #t "~Tmax-run-speed: ~f~%" (-> obj max-run-speed)) - (format #t "~Tacceleration: (meters ~m)~%" (-> obj acceleration)) - (format #t "~Tdefault-patrol-time: ~D~%" (-> obj default-patrol-time)) - (format #t "~Tdefault-idle-distance: (meters ~m)~%" (-> obj default-idle-distance)) - (format #t "~Tsafe-distance: (meters ~m)~%" (-> obj safe-distance)) - (format #t "~Tmin-run-anim-speed: ~f~%" (-> obj min-run-anim-speed)) - (format #t "~Tmax-run-anim-speed: ~f~%" (-> obj max-run-anim-speed)) - (format #t "~Tmin-walk-anim-speed: ~f~%" (-> obj min-walk-anim-speed)) - (format #t "~Tspeed-boost-impulse: (meters ~m)~%" (-> obj speed-boost-impulse)) - obj +(defmethod inspect yakow-bank ((this yakow-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Twalk-cycle-frame-count: ~f~%" (-> this walk-cycle-frame-count)) + (format #t "~Trun-cycle-frame-count: ~f~%" (-> this run-cycle-frame-count)) + (format #t "~Twalk-speed: (meters ~m)~%" (-> this walk-speed)) + (format #t "~Trun-speed: (meters ~m)~%" (-> this run-speed)) + (format #t "~Twalk-anim-speed: ~f~%" (-> this walk-anim-speed)) + (format #t "~Trun-anim-speed: ~f~%" (-> this run-anim-speed)) + (format #t "~Twalk-away-dist: (meters ~m)~%" (-> this walk-away-dist)) + (format #t "~Trun-away-dist: (meters ~m)~%" (-> this run-away-dist)) + (format #t "~Twalk-rotate-speed: ~f~%" (-> this walk-rotate-speed)) + (format #t "~Trun-rotate-speed: ~f~%" (-> this run-rotate-speed)) + (format #t "~Twalk-turn-time: ~D~%" (-> this walk-turn-time)) + (format #t "~Trun-turn-time: ~D~%" (-> this run-turn-time)) + (format #t "~Tmax-walk-speed: ~f~%" (-> this max-walk-speed)) + (format #t "~Tmin-run-speed: ~f~%" (-> this min-run-speed)) + (format #t "~Twalk-run-blend-rate: ~f~%" (-> this walk-run-blend-rate)) + (format #t "~Twalk-turn-blend-rate: ~f~%" (-> this walk-turn-blend-rate)) + (format #t "~Tmax-run-speed: ~f~%" (-> this max-run-speed)) + (format #t "~Tacceleration: (meters ~m)~%" (-> this acceleration)) + (format #t "~Tdefault-patrol-time: ~D~%" (-> this default-patrol-time)) + (format #t "~Tdefault-idle-distance: (meters ~m)~%" (-> this default-idle-distance)) + (format #t "~Tsafe-distance: (meters ~m)~%" (-> this safe-distance)) + (format #t "~Tmin-run-anim-speed: ~f~%" (-> this min-run-anim-speed)) + (format #t "~Tmax-run-anim-speed: ~f~%" (-> this max-run-anim-speed)) + (format #t "~Tmin-walk-anim-speed: ~f~%" (-> this min-walk-anim-speed)) + (format #t "~Tspeed-boost-impulse: (meters ~m)~%" (-> this speed-boost-impulse)) + this ) ;; definition for symbol *YAKOW-bank*, type yakow-bank @@ -153,28 +153,28 @@ ) ;; definition for method 3 of type yakow -(defmethod inspect yakow ((obj yakow)) +(defmethod inspect yakow ((this yakow)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - (format #t "~T~Twalk-run-blend: ~f~%" (-> obj walk-run-blend)) - (format #t "~T~Twalk-turn-blend: ~f~%" (-> obj walk-turn-blend)) - (format #t "~T~Trun-mode: ~A~%" (-> obj run-mode)) - (format #t "~T~Ttravel-speed: (meters ~m)~%" (-> obj travel-speed)) - (format #t "~T~Tfinal-speed: (meters ~m)~%" (-> obj final-speed)) - (format #t "~T~Trotate-speed: ~f~%" (-> obj rotate-speed)) - (format #t "~T~Tturn-time: ~D~%" (-> obj turn-time)) - (format #t "~T~Tvulnerable: ~A~%" (-> obj vulnerable)) - (format #t "~T~Tgrazing: ~A~%" (-> obj grazing)) - (format #t "~T~Tpush-velocity: #~%" (-> obj push-velocity)) - (format #t "~T~Thome-base: ~`vector`P~%" (-> obj home-base)) - (format #t "~T~Tdest-base: ~`vector`P~%" (-> obj dest-base)) - (format #t "~T~Tdest-rot: (deg ~r)~%" (-> obj dest-rot)) - (format #t "~T~Tenable-turn-around: ~A~%" (-> obj enable-turn-around)) - (format #t "~T~Trotating: ~A~%" (-> obj rotating)) - (format #t "~T~Tin-pen: ~A~%" (-> obj in-pen)) - obj + (format #t "~T~Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + (format #t "~T~Twalk-run-blend: ~f~%" (-> this walk-run-blend)) + (format #t "~T~Twalk-turn-blend: ~f~%" (-> this walk-turn-blend)) + (format #t "~T~Trun-mode: ~A~%" (-> this run-mode)) + (format #t "~T~Ttravel-speed: (meters ~m)~%" (-> this travel-speed)) + (format #t "~T~Tfinal-speed: (meters ~m)~%" (-> this final-speed)) + (format #t "~T~Trotate-speed: ~f~%" (-> this rotate-speed)) + (format #t "~T~Tturn-time: ~D~%" (-> this turn-time)) + (format #t "~T~Tvulnerable: ~A~%" (-> this vulnerable)) + (format #t "~T~Tgrazing: ~A~%" (-> this grazing)) + (format #t "~T~Tpush-velocity: #~%" (-> this push-velocity)) + (format #t "~T~Thome-base: ~`vector`P~%" (-> this home-base)) + (format #t "~T~Tdest-base: ~`vector`P~%" (-> this dest-base)) + (format #t "~T~Tdest-rot: (deg ~r)~%" (-> this dest-rot)) + (format #t "~T~Tenable-turn-around: ~A~%" (-> this enable-turn-around)) + (format #t "~T~Trotating: ~A~%" (-> this rotating)) + (format #t "~T~Tin-pen: ~A~%" (-> this in-pen)) + this ) ;; failed to figure out what this is: @@ -305,7 +305,7 @@ yakow-default-event-handler (-> self turn-time) ) (vector-z-quaternion! gp-0 (-> self root-override quat)) - (set! (-> self rotating) (< (vector-dot gp-0 s5-0) (cos (* 8192.0 (-> *display* seconds-per-frame))))) + (set! (-> self rotating) (< (vector-dot gp-0 s5-0) (cos (* 8192.0 (seconds-per-frame))))) (when (-> self rotating) (let ((v1-16 (new 'stack-no-clear 'vector))) (vector-cross! v1-16 gp-0 s5-0) @@ -314,11 +314,7 @@ yakow-default-event-handler ) ) ) - (seek! - (-> self walk-turn-blend) - f30-0 - (* (-> *YAKOW-bank* walk-turn-blend-rate) (-> *display* seconds-per-frame)) - ) + (seek! (-> self walk-turn-blend) f30-0 (* (-> *YAKOW-bank* walk-turn-blend-rate) (seconds-per-frame))) ) (set! (-> self final-speed) (fmin (-> self travel-speed) (* (vector-length (-> self nav travel)) (-> *display* frames-per-second))) @@ -397,7 +393,7 @@ yakow-default-event-handler ;; definition for function yakow-blend-walk-run (defbehavior yakow-blend-walk-run yakow () - (let ((gp-0 (-> *display* base-frame-counter))) + (let ((gp-0 (current-time))) (loop (let ((f30-0 (-> self final-speed))) (cond @@ -406,13 +402,13 @@ yakow-default-event-handler (ja-channel-push! 1 (seconds 0.15)) ) (ja :group! yakow-idle-ja :num! min) - (while (or (< (- (-> *display* base-frame-counter) gp-0) (seconds 0.2)) (< (-> self final-speed) 409.6)) + (while (or (not (time-elapsed? gp-0 (seconds 0.2))) (< (-> self final-speed) 409.6)) (suspend) (ja :num! (loop!)) ) ) (else - (set! gp-0 (-> *display* base-frame-counter)) + (set! gp-0 (current-time)) ) ) (when (not (ja-group? yakow-walk-ja)) @@ -434,16 +430,8 @@ yakow-default-event-handler ) ) (if (-> self run-mode) - (seek! - (-> self walk-run-blend) - 1.0 - (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame)) - ) - (seek! - (-> self walk-run-blend) - 0.0 - (* (-> *YAKOW-bank* walk-run-blend-rate) (-> *display* seconds-per-frame)) - ) + (seek! (-> self walk-run-blend) 1.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (seconds-per-frame))) + (seek! (-> self walk-run-blend) 0.0 (* (-> *YAKOW-bank* walk-run-blend-rate) (seconds-per-frame))) ) (ja :chan 1 :frame-interp (fabs (-> self walk-turn-blend))) (ja :chan 2 :frame-interp (-> self walk-run-blend)) @@ -505,11 +493,11 @@ yakow-default-event-handler (defstate yakow-idle (yakow) :event yakow-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self travel-speed) 0.0) ) :trans (behavior () - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) + (if (and (time-elapsed? (-> self state-time) (-> *YAKOW-bank* default-patrol-time)) (and *target* (>= (-> self fact-override idle-distance) (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) ) @@ -555,7 +543,7 @@ yakow-default-event-handler (defstate yakow-notice (yakow) :event yakow-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self travel-speed) 0.0) ) :code (behavior () @@ -568,14 +556,14 @@ yakow-default-event-handler (defstate yakow-walk-to (yakow) :event yakow-default-event-handler :enter (behavior ((arg0 vector)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self nav destination-pos quad) (-> arg0 quad)) (set! (-> self rotate-speed) (-> *YAKOW-bank* walk-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* walk-turn-time)) ) :trans (behavior () - (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> *YAKOW-bank* default-patrol-time)) + (if (and (time-elapsed? (-> self state-time) (-> *YAKOW-bank* default-patrol-time)) (not (-> self in-pen)) (and *target* (>= (-> self fact-override idle-distance) @@ -586,7 +574,7 @@ yakow-default-event-handler ) (go yakow-notice) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) + (when (time-elapsed? (-> self state-time) (seconds 0.05)) (when (or (logtest? (nav-control-flags navcf19) (-> self nav flags)) (< (vector-vector-xz-distance (-> self root-override trans) (-> self nav destination-pos)) 4096.0) ) @@ -599,7 +587,7 @@ yakow-default-event-handler (seek! (-> self travel-speed) (-> *YAKOW-bank* walk-speed) - (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) + (* (-> *YAKOW-bank* acceleration) (seconds-per-frame)) ) ) :code (the-as (function vector object) yakow-blend-walk-run) @@ -622,7 +610,7 @@ yakow-default-event-handler (defstate yakow-graze (yakow) :event yakow-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self travel-speed) 0.0) (set! (-> self grazing) #t) (let ((v1-3 (entity-actor-lookup (-> self entity) 'alt-actor 0))) @@ -682,7 +670,7 @@ yakow-default-event-handler (defstate yakow-run-away (yakow) :event yakow-default-event-handler :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (logior! (-> self nav flags) (nav-control-flags navcf10)) (set! (-> self rotate-speed) (-> *YAKOW-bank* run-rotate-speed)) (set! (-> self turn-time) (-> *YAKOW-bank* run-turn-time)) @@ -717,7 +705,7 @@ yakow-default-event-handler (set! f30-2 0.0) ) (set! (-> self enable-turn-around) (< (-> *YAKOW-bank* run-speed) f30-2)) - (seek! (-> self travel-speed) f30-2 (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame))) + (seek! (-> self travel-speed) f30-2 (* (-> *YAKOW-bank* acceleration) (seconds-per-frame))) ) ) :code yakow-blend-walk-run @@ -728,7 +716,7 @@ yakow-default-event-handler (defstate yakow-kicked (yakow) :event #f :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (if (-> self grazing) (go yakow-graze-kicked) ) @@ -743,11 +731,11 @@ yakow-default-event-handler '() ) :trans (behavior () - (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) (seek! (-> self travel-speed) (-> *YAKOW-bank* run-speed) - (* (-> *YAKOW-bank* acceleration) (-> *display* seconds-per-frame)) + (* (-> *YAKOW-bank* acceleration) (seconds-per-frame)) ) ) 0 @@ -810,9 +798,9 @@ yakow-default-event-handler ;; definition for method 11 of type yakow ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! yakow ((obj yakow) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! yakow ((this yakow) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -828,44 +816,44 @@ yakow-default-event-handler ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj align) (new 'process 'align-control obj)) - (set! (-> obj nav) (new 'process 'nav-control (-> obj root-override) 16 40960.0)) - (logior! (-> obj nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) - (set! (-> obj nav nearest-y-threshold) 409600.0) - (set! (-> obj fact-override) - (new 'process 'fact-info-enemy obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this nav) (new 'process 'nav-control (-> this root-override) 16 40960.0)) + (logior! (-> this nav flags) (nav-control-flags display-marks navcf3 navcf5 navcf6 navcf7)) + (set! (-> this nav nearest-y-threshold) 409600.0) + (set! (-> this fact-override) + (new 'process 'fact-info-enemy this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj fact-override idle-distance) (-> *YAKOW-bank* default-idle-distance)) - (initialize-skeleton obj *yakow-sg* '()) - (set! (-> obj draw shadow-ctrl) + (set! (-> this fact-override idle-distance) (-> *YAKOW-bank* default-idle-distance)) + (initialize-skeleton this *yakow-sg* '()) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -4096.0 4096.0 614400.0 (the-as float 24) 245760.0) ) - (set! (-> obj link) (new 'process 'actor-link-info obj)) - (set! (-> obj water) (new 'process 'water-control obj 6 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags wt01)) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 12288.0) - (set! (-> obj home-base quad) (-> obj root-override trans quad)) - (let ((v1-40 (res-lump-struct (-> obj entity) 'alt-vector vector))) + (set! (-> this link) (new 'process 'actor-link-info this)) + (set! (-> this water) (new 'process 'water-control this 6 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags wt01)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 12288.0) + (set! (-> this home-base quad) (-> this root-override trans quad)) + (let ((v1-40 (res-lump-struct (-> this entity) 'alt-vector vector))) (when v1-40 - (set! (-> obj dest-base quad) (-> v1-40 quad)) - (set! (-> obj dest-rot) (-> v1-40 w)) - (set! (-> obj dest-base w) 1.0) + (set! (-> this dest-base quad) (-> v1-40 quad)) + (set! (-> this dest-rot) (-> v1-40 w)) + (set! (-> this dest-base w) 1.0) ) ) - (set! (-> obj vulnerable) #t) - (set! (-> obj grazing) #f) - (set! (-> obj enable-turn-around) #f) - (set! (-> obj in-pen) - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (set! (-> this vulnerable) #t) + (set! (-> this grazing) #f) + (set! (-> this enable-turn-around) #f) + (set! (-> this in-pen) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) ) (cond - ((-> obj in-pen) - (set! (-> obj root-override trans quad) (-> obj dest-base quad)) - (set-yaw-angle-clear-roll-pitch! (-> obj root-override) (-> obj dest-rot)) + ((-> this in-pen) + (set! (-> this root-override trans quad) (-> this dest-base quad)) + (set-yaw-angle-clear-roll-pitch! (-> this root-override) (-> this dest-rot)) (go yakow-graze) ) (else diff --git a/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc b/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc index f70bd5e74d..eb8ea2af4f 100644 --- a/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/assistant-village2_REF.gc @@ -16,36 +16,36 @@ ) ;; definition for method 3 of type assistant-levitator -(defmethod inspect assistant-levitator ((obj assistant-levitator)) +(defmethod inspect assistant-levitator ((this assistant-levitator)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tboulder: ~A~%" (-> obj boulder)) - (format #t "~T~Tparticle[4] @ #x~X~%" (-> obj particle)) - obj + (format #t "~T~Tboulder: ~A~%" (-> this boulder)) + (format #t "~T~Tparticle[4] @ #x~X~%" (-> this particle)) + this ) ;; definition for method 7 of type assistant-levitator ;; INFO: Return type mismatch process-taskable vs assistant-levitator. -(defmethod relocate assistant-levitator ((obj assistant-levitator) (arg0 int)) +(defmethod relocate assistant-levitator ((this assistant-levitator) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj particle v1-0)) - (&+! (-> obj particle v1-0) arg0) + (if (nonzero? (-> this particle v1-0)) + (&+! (-> this particle v1-0) arg0) ) ) - (the-as assistant-levitator ((method-of-type process-taskable relocate) obj arg0)) + (the-as assistant-levitator ((method-of-type process-taskable relocate) this arg0)) ) ;; definition for method 10 of type assistant-levitator -(defmethod deactivate assistant-levitator ((obj assistant-levitator)) +(defmethod deactivate assistant-levitator ((this assistant-levitator)) (dotimes (s5-0 4) - (let ((a0-1 (-> obj particle s5-0))) + (let ((a0-1 (-> this particle s5-0))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) - ((method-of-type process-taskable deactivate) obj) + ((method-of-type process-taskable deactivate) this) (none) ) @@ -67,10 +67,10 @@ ;; definition for method 52 of type assistant-levitator ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 assistant-levitator ((obj assistant-levitator)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 assistant-levitator ((this assistant-levitator)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -409.6 f0-0))) ) @@ -88,21 +88,21 @@ ;; definition for method 48 of type assistant-levitator ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow assistant-levitator ((obj assistant-levitator)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow assistant-levitator ((this assistant-levitator)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -112,19 +112,19 @@ ) ;; definition for method 32 of type assistant-bluehut -(defmethod play-anim! assistant-bluehut ((obj assistant-bluehut) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk-to-assistant)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! assistant-bluehut ((this assistant-bluehut) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk-to-assistant)) + (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint) (task-status need-introduction)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task village2-levitator)) (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> obj sage extra process) 'clone (process->handle obj)) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) + (close-status! (-> this tasks) (task-status need-introduction)) + (send-event (-> this sage extra process) 'clone (process->handle this)) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "assistant-village2-introduction" @@ -287,23 +287,23 @@ ) (((game-task sunken-room)) (when arg0 - (let* ((s5-2 (-> obj tasks)) + (let* ((s5-2 (-> this tasks)) (s4-0 (method-of-object s5-2 save-reminder)) ) (s4-0 s5-2 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) - (set! (-> obj jaws) - (ppointer->handle (manipy-spawn (-> obj root-override trans) (-> obj entity) *jaws-sg* #f :to obj)) + (close-status! (-> this tasks) (task-status need-introduction)) + (set! (-> this jaws) + (ppointer->handle (manipy-spawn (-> this root-override trans) (-> this entity) *jaws-sg* #f :to this)) ) - (let ((v1-42 (handle->process (-> obj jaws)))) + (let ((v1-42 (handle->process (-> this jaws)))) (if v1-42 (set! (-> (the-as manipy v1-42) draw light-index) (the-as uint 1)) ) ) - (send-event (handle->process (-> obj jaws)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj jaws)) 'center-joint 3) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) + (send-event (handle->process (-> this jaws)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this jaws)) 'center-joint 3) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "assistant-village2-introduction-room" @@ -322,12 +322,12 @@ ) (((game-task rolling-robbers)) (when arg0 - (let* ((s5-5 (-> obj tasks)) + (let* ((s5-5 (-> this tasks)) (s4-1 (method-of-object s5-5 save-reminder)) ) (s4-1 s5-5 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "assistant-village2-introduction-robbers" @@ -338,8 +338,8 @@ ) (else (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle obj)) + (close-status! (-> this tasks) (task-status need-introduction)) + (send-event (-> (entity-by-type flutflut-bluehut) extra process) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "assistant-village2-introduction-flutflut" @@ -351,8 +351,8 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) + (set! (-> this skippable) #t) + (let ((s4-2 (+ (get-reminder (-> this tasks) 0) 1))) (if (< (the-as uint 2) (the-as uint s4-2)) (set! s4-2 0) ) @@ -378,7 +378,7 @@ ) ) (if arg0 - (save-reminder (-> obj tasks) s4-2 2) + (save-reminder (-> this tasks) s4-2 2) ) (cond ((zero? s4-2) @@ -398,24 +398,24 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ) ) ;; definition for method 31 of type assistant-bluehut -(defmethod get-art-elem assistant-bluehut ((obj assistant-bluehut)) - (-> obj draw art-group data 10) +(defmethod get-art-elem assistant-bluehut ((this assistant-bluehut)) + (-> this draw art-group data 10) ) ;; definition for method 44 of type assistant-bluehut -(defmethod play-reminder assistant-bluehut ((obj assistant-bluehut)) +(defmethod play-reminder assistant-bluehut ((this assistant-bluehut)) (cond - ((and (-> obj will-talk) *target*) + ((and (-> this will-talk) *target*) (let* ((f30-1 (+ -1552384.0 (-> (target-pos 0) x))) (f0-3 (+ 6352896.0 (-> (target-pos 0) z) f30-1)) ) @@ -429,29 +429,29 @@ ) ;; definition for method 47 of type assistant-bluehut -(defmethod target-above-threshold? assistant-bluehut ((obj assistant-bluehut)) - (when (not (play-reminder obj)) - (set! (-> obj im-talking) #f) +(defmethod target-above-threshold? assistant-bluehut ((this assistant-bluehut)) + (when (not (play-reminder this)) + (set! (-> this im-talking) #f) (return #f) ) - (let ((s5-0 (-> obj sage extra process))) + (let ((s5-0 (-> this sage extra process))) (when (not s5-0) (let ((v1-7 #t)) - (set! (-> obj im-talking) v1-7) + (set! (-> this im-talking) v1-7) (return v1-7) ) ) (when (!= (-> (the-as sage-bluehut s5-0) next-state name) 'idle) - (set! (-> obj im-talking) #f) + (set! (-> this im-talking) #f) (return #f) ) (when (not (play-reminder (the-as sage-bluehut s5-0))) (let ((v1-15 #t)) - (set! (-> obj im-talking) v1-15) + (set! (-> this im-talking) v1-15) (return v1-15) ) ) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj center-joint-index)))) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this center-joint-index)))) (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as sage-bluehut s5-0) node-list data (-> (the-as sage-bluehut s5-0) center-joint-index)) @@ -461,17 +461,17 @@ ) (cond ((< f0-1 -4096.0) - (set! (-> obj im-talking) #f) + (set! (-> this im-talking) #f) (return #f) ) ((< 4096.0 f0-1) (let ((v1-24 #t)) - (set! (-> obj im-talking) v1-24) + (set! (-> this im-talking) v1-24) (return v1-24) ) ) (else - (return (-> obj im-talking)) + (return (-> this im-talking)) ) ) ) @@ -480,18 +480,18 @@ ) ;; definition for method 43 of type assistant-bluehut -(defmethod process-taskable-method-43 assistant-bluehut ((obj assistant-bluehut)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 assistant-bluehut ((this assistant-bluehut)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f30-0 (rand-float-gen))) (cond ((= (get-task-status (game-task village2-levitator)) (task-status invalid)) #f ) ((< 0.5 f30-0) - (play-ambient (-> obj ambient) "ASSTLP23" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP23" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "ASSTLP24" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP24" #f (-> this root-override trans)) ) ) ) @@ -528,8 +528,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-1 (-> *display* base-frame-counter))) - (while (let ((s5-1 (-> *display* base-frame-counter)) + (let ((gp-1 (current-time))) + (while (let ((s5-1 (current-time)) (f30-0 300.0) (f28-0 0.16) (f26-0 0.17000002) @@ -611,10 +611,10 @@ ) ;; definition for method 39 of type assistant-bluehut -(defmethod should-display? assistant-bluehut ((obj assistant-bluehut)) +(defmethod should-display? assistant-bluehut ((this assistant-bluehut)) (cond - ((not (closed? (-> obj tasks) (game-task village2-levitator) (task-status unknown))) - (process-taskable-method-33 obj) + ((not (closed? (-> this tasks) (game-task village2-levitator) (task-status unknown))) + (process-taskable-method-33 this) #f ) ((or (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) (sages-kidnapped?)) @@ -713,16 +713,16 @@ ) ;; definition for method 11 of type assistant-bluehut -(defmethod init-from-entity! assistant-bluehut ((obj assistant-bluehut) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 288) obj)) - (set! (-> obj tasks) (get-task-control (game-task village2-levitator))) - (set! (-> obj jaws) (the-as handle #f)) - (set! (-> obj sage) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj im-talking) #t) - (set! (-> obj draw light-index) (the-as uint 1)) - (set! (-> obj sound-id) (new-sound-id)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! assistant-bluehut ((this assistant-bluehut) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 288) this)) + (set! (-> this tasks) (get-task-control (game-task village2-levitator))) + (set! (-> this jaws) (the-as handle #f)) + (set! (-> this sage) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this im-talking) #t) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this sound-id) (new-sound-id)) + (process-taskable-method-42 this) (none) ) @@ -1266,19 +1266,19 @@ ) ;; definition for method 32 of type assistant-levitator -(defmethod play-anim! assistant-levitator ((obj assistant-levitator) (arg0 symbol)) +(defmethod play-anim! assistant-levitator ((this assistant-levitator) (arg0 symbol)) (with-pp - (case (current-status (-> obj tasks)) + (case (current-status (-> this tasks)) (((task-status need-reward-speech)) (when arg0 - (close-current! (-> obj tasks)) + (close-current! (-> this tasks)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) pp) (set! (-> a1-1 num-params) 1) (set! (-> a1-1 message) 'clone) - (set! (-> a1-1 param 0) (the-as uint (process->handle obj))) + (set! (-> a1-1 param 0) (the-as uint (process->handle this))) (let ((t9-2 send-event-function) - (v1-10 (-> obj boulder)) + (v1-10 (-> this boulder)) ) (t9-2 (if v1-10 @@ -1309,21 +1309,21 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ) ) ) ;; definition for method 31 of type assistant-levitator -(defmethod get-art-elem assistant-levitator ((obj assistant-levitator)) +(defmethod get-art-elem assistant-levitator ((this assistant-levitator)) (if (= (get-task-status (game-task village2-levitator)) (task-status invalid)) - (-> obj draw art-group data 9) - (-> obj draw art-group data 5) + (-> this draw art-group data 9) + (-> this draw art-group data 5) ) ) @@ -1367,7 +1367,7 @@ #t ) (else - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) ) @@ -1376,7 +1376,7 @@ (not (movie?)) (not (level-hint-displayed?)) (not (and *cheat-mode* (cpad-hold? 0 l3))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 10)) + (not (time-elapsed? (-> self state-time) (seconds 10))) ) ) (hide-hud) @@ -1415,7 +1415,7 @@ ) ;; definition for method 47 of type assistant-levitator -(defmethod target-above-threshold? assistant-levitator ((obj assistant-levitator)) +(defmethod target-above-threshold? assistant-levitator ((this assistant-levitator)) (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) ) @@ -1489,7 +1489,7 @@ ) ;; definition for method 39 of type assistant-levitator -(defmethod should-display? assistant-levitator ((obj assistant-levitator)) +(defmethod should-display? assistant-levitator ((this assistant-levitator)) (or (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) (zero? (get-task-status (game-task village2-levitator))) ) @@ -1510,20 +1510,20 @@ ;; definition for method 11 of type assistant-levitator ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! assistant-levitator ((obj assistant-levitator) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task village2-levitator))) - (set! (-> obj boulder) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj particle 0) (create-launch-control (-> *part-group-id-table* 658) obj)) - (set! (-> obj particle 1) (create-launch-control (-> *part-group-id-table* 659) obj)) - (set! (-> obj particle 2) (create-launch-control (-> *part-group-id-table* 660) obj)) - (set! (-> obj particle 3) (create-launch-control (-> *part-group-id-table* 661) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> obj root-override trans)) +(defmethod init-from-entity! assistant-levitator ((this assistant-levitator) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-village2-sg* 3 31 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task village2-levitator))) + (set! (-> this boulder) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this particle 0) (create-launch-control (-> *part-group-id-table* 658) this)) + (set! (-> this particle 1) (create-launch-control (-> *part-group-id-table* 659) this)) + (set! (-> this particle 2) (create-launch-control (-> *part-group-id-table* 660) this)) + (set! (-> this particle 3) (create-launch-control (-> *part-group-id-table* 661) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "lev-mach-idle" :fo-max 30) (-> this root-override trans)) ) (if (= (get-task-status (game-task village2-levitator)) (task-status invalid)) (go just-particles) - (process-taskable-method-42 obj) + (process-taskable-method-42 this) ) (none) ) diff --git a/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc b/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc index 53f59852d0..5777f128a5 100644 --- a/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/flutflut-bluehut_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type flutflut-bluehut -(defmethod inspect flutflut-bluehut ((obj flutflut-bluehut)) +(defmethod inspect flutflut-bluehut ((this flutflut-bluehut)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -26,27 +26,27 @@ ;; definition for method 32 of type flutflut-bluehut ;; INFO: Return type mismatch art-element vs basic. -(defmethod play-anim! flutflut-bluehut ((obj flutflut-bluehut) (arg0 symbol)) - (current-status (-> obj tasks)) +(defmethod play-anim! flutflut-bluehut ((this flutflut-bluehut) (arg0 symbol)) + (current-status (-> this tasks)) (if arg0 (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (the-as basic (get-art-elem obj)) + (the-as basic (get-art-elem this)) ) ;; definition for method 31 of type flutflut-bluehut -(defmethod get-art-elem flutflut-bluehut ((obj flutflut-bluehut)) - (-> obj draw art-group data 2) +(defmethod get-art-elem flutflut-bluehut ((this flutflut-bluehut)) + (-> this draw art-group data 2) ) ;; definition for method 39 of type flutflut-bluehut -(defmethod should-display? flutflut-bluehut ((obj flutflut-bluehut)) - (and (closed? (-> obj tasks) (game-task village2-levitator) (task-status need-introduction)) +(defmethod should-display? flutflut-bluehut ((this flutflut-bluehut)) + (and (closed? (-> this tasks) (game-task village2-levitator) (task-status need-introduction)) (task-closed? (game-task beach-flutflut) (task-status need-resolution)) ) ) @@ -74,8 +74,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((s5-0 (-> *display* base-frame-counter))) - (while (< (+ (-> *display* base-frame-counter) (seconds -0.5)) s5-0) + (let ((s5-0 (current-time))) + (while (< (+ (current-time) (seconds -0.5)) s5-0) (suspend) ) ) @@ -84,8 +84,8 @@ (suspend) (ja :num! (seek! 0.0)) ) - (let ((s5-1 (-> *display* base-frame-counter))) - (while (< (+ (-> *display* base-frame-counter) (seconds -0.5)) s5-1) + (let ((s5-1 (current-time))) + (while (< (+ (current-time) (seconds -0.5)) s5-1) (suspend) ) ) @@ -119,10 +119,10 @@ ) ;; definition for method 11 of type flutflut-bluehut -(defmethod init-from-entity! flutflut-bluehut ((obj flutflut-bluehut) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *flutflut-bluehut-sg* 3 0 (new 'static 'vector :w 4096.0) 27) - (set! (-> obj tasks) (get-task-control (game-task village2-levitator))) - (set! (-> obj draw light-index) (the-as uint 1)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! flutflut-bluehut ((this flutflut-bluehut) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *flutflut-bluehut-sg* 3 0 (new 'static 'vector :w 4096.0) 27) + (set! (-> this tasks) (get-task-control (game-task village2-levitator))) + (set! (-> this draw light-index) (the-as uint 1)) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc b/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc index f7991fcfd2..6f44af01dc 100644 --- a/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/gambler_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type gambler -(defmethod inspect gambler ((obj gambler)) +(defmethod inspect gambler ((this gambler)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -26,12 +26,12 @@ ) ;; definition for method 32 of type gambler -(defmethod play-anim! gambler ((obj gambler) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! gambler ((this gambler) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) (close-specific-task! (game-task village2-gambler-money) (task-status need-introduction)) ) (new 'static 'spool-anim @@ -59,23 +59,23 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((closed? (-> obj tasks) (game-task rolling-race) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task rolling-race) (task-status need-reward-speech)) (new 'static 'spool-anim :name "gambler-reminder-money" :index 13 :parts 2 :command-list '()) ) - ((closed? (-> obj tasks) (game-task village2-gambler-money) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task village2-gambler-money) (task-status need-reward-speech)) (new 'static 'spool-anim :name "gambler-reminder-race" :index 12 :parts 2 :command-list '()) ) - ((zero? (get-reminder (-> obj tasks) 5)) + ((zero? (get-reminder (-> this tasks) 5)) (if arg0 - (save-reminder (-> obj tasks) 1 5) + (save-reminder (-> this tasks) 1 5) ) (new 'static 'spool-anim :name "gambler-reminder-race" :index 12 :parts 2 :command-list '()) ) (else (if arg0 - (save-reminder (-> obj tasks) 0 5) + (save-reminder (-> this tasks) 0 5) ) (new 'static 'spool-anim :name "gambler-reminder-money" :index 13 :parts 2 :command-list '()) ) @@ -83,25 +83,25 @@ ) (((task-status need-reward-speech)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task rolling-race)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "gambler-resolution-race" :index 14 :parts 3 :command-list '()) ) (else (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) ) (else - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (new 'static 'spool-anim :name "gambler-resolution-money" :index 15 :parts 2 :command-list '()) @@ -113,65 +113,65 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 7) + (-> this draw art-group data 7) ) ) ) ;; definition for method 31 of type gambler -(defmethod get-art-elem gambler ((obj gambler)) - (-> obj draw art-group data 7) +(defmethod get-art-elem gambler ((this gambler)) + (-> this draw art-group data 7) ) ;; definition for method 43 of type gambler -(defmethod process-taskable-method-43 gambler ((obj gambler)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 61440.0 obj) +(defmethod process-taskable-method-43 gambler ((this gambler)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 61440.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.9230769 f0-2) - (play-ambient (-> obj ambient) "GAM-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM01" #f (-> this root-override trans)) ) ((< 0.84615386 f0-2) - (play-ambient (-> obj ambient) "GAM-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM02" #f (-> this root-override trans)) ) ((< 0.7692308 f0-2) - (play-ambient (-> obj ambient) "GAM-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM03" #f (-> this root-override trans)) ) ((< 0.6923077 f0-2) - (play-ambient (-> obj ambient) "GAM-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM04" #f (-> this root-override trans)) ) ((< 0.61538464 f0-2) - (play-ambient (-> obj ambient) "GAM-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM05" #f (-> this root-override trans)) ) ((< 0.53846157 f0-2) - (play-ambient (-> obj ambient) "GAM-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM06" #f (-> this root-override trans)) ) ((< 0.46153846 f0-2) - (play-ambient (-> obj ambient) "GAM-AM07" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM07" #f (-> this root-override trans)) ) ((< 0.3846154 f0-2) - (play-ambient (-> obj ambient) "GAM-AM08" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM08" #f (-> this root-override trans)) ) ((< 0.30769232 f0-2) - (play-ambient (-> obj ambient) "GAM-AM09" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM09" #f (-> this root-override trans)) ) ((< 0.23076923 f0-2) (if (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) - (play-ambient (-> obj ambient) "GAM-AM10" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM10" #f (-> this root-override trans)) ) ) ((< 0.15384616 f0-2) - (play-ambient (-> obj ambient) "GAM-AM11" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM11" #f (-> this root-override trans)) ) ((< 0.07692308 f0-2) - (play-ambient (-> obj ambient) "GAM-AM12" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM12" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "GAM-AM13" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GAM-AM13" #f (-> this root-override trans)) ) ) ) @@ -220,11 +220,11 @@ ) ;; definition for method 11 of type gambler -(defmethod init-from-entity! gambler ((obj gambler) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *gambler-sg* 3 32 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task rolling-race))) - (set! (-> obj sound-flava) (music-flava gambler)) - (set! (-> obj draw light-index) (the-as uint 4)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! gambler ((this gambler) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *gambler-sg* 3 32 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task rolling-race))) + (set! (-> this sound-flava) (music-flava gambler)) + (set! (-> this draw light-index) (the-as uint 4)) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/village2/geologist_REF.gc b/test/decompiler/reference/jak1/levels/village2/geologist_REF.gc index 9105e505c1..a4e9721eb8 100644 --- a/test/decompiler/reference/jak1/levels/village2/geologist_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/geologist_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type geologist -(defmethod inspect geologist ((obj geologist)) +(defmethod inspect geologist ((this geologist)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -26,12 +26,12 @@ ) ;; definition for method 32 of type geologist -(defmethod play-anim! geologist ((obj geologist) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! geologist ((this geologist) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) (close-specific-task! (game-task village2-geologist-money) (task-status need-introduction)) ) (new 'static 'spool-anim @@ -51,23 +51,23 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (cond - ((closed? (-> obj tasks) (game-task rolling-moles) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task rolling-moles) (task-status need-reward-speech)) (new 'static 'spool-anim :name "geologist-reminder-money" :index 8 :parts 2 :command-list '()) ) - ((closed? (-> obj tasks) (game-task village2-geologist-money) (task-status need-reward-speech)) + ((closed? (-> this tasks) (game-task village2-geologist-money) (task-status need-reward-speech)) (new 'static 'spool-anim :name "geologist-reminder-moles" :index 7 :parts 3 :command-list '()) ) - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (if arg0 - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) (new 'static 'spool-anim :name "geologist-reminder-moles" :index 7 :parts 3 :command-list '()) ) (else (if arg0 - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) (new 'static 'spool-anim :name "geologist-reminder-money" :index 8 :parts 2 :command-list '()) ) @@ -75,25 +75,25 @@ ) (((task-status need-reward-speech)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task rolling-moles)) (when arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) ) (new 'static 'spool-anim :name "geologist-resolution-moles" :index 9 :parts 3 :command-list '()) ) (else (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) ) (else - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (new 'static 'spool-anim :name "geologist-resolution-money" :index 10 :parts 2 :command-list '()) @@ -105,60 +105,60 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ) ) ;; definition for method 31 of type geologist -(defmethod get-art-elem geologist ((obj geologist)) - (-> obj draw art-group data 5) +(defmethod get-art-elem geologist ((this geologist)) + (-> this draw art-group data 5) ) ;; definition for method 43 of type geologist -(defmethod process-taskable-method-43 geologist ((obj geologist)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 geologist ((this geologist)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8888889 f0-2) - (play-ambient (-> obj ambient) "GEO-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-AM01" #f (-> this root-override trans)) ) ((< 0.7777778 f0-2) - (if (not (closed? (-> obj tasks) (game-task rolling-moles) (task-status need-reminder))) - (play-ambient (-> obj ambient) "GEO-AM02" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task rolling-moles) (task-status need-reminder))) + (play-ambient (-> this ambient) "GEO-AM02" #f (-> this root-override trans)) ) ) ((< 0.6666667 f0-2) - (play-ambient (-> obj ambient) "GEO-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-AM03" #f (-> this root-override trans)) ) ((< 0.5555556 f0-2) - (if (closed? (-> obj tasks) (game-task village2-geologist-money) (task-status need-introduction)) - (play-ambient (-> obj ambient) "GEO-AM04" #f (-> obj root-override trans)) + (if (closed? (-> this tasks) (game-task village2-geologist-money) (task-status need-introduction)) + (play-ambient (-> this ambient) "GEO-AM04" #f (-> this root-override trans)) ) ) ((< 0.44444445 f0-2) - (play-ambient (-> obj ambient) "GEO-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-AM05" #f (-> this root-override trans)) ) ((< 0.33333334 f0-2) - (play-ambient (-> obj ambient) "GEO-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-AM06" #f (-> this root-override trans)) ) ((< 0.22222222 f0-2) - (if (not (closed? (-> obj tasks) (game-task rolling-moles) (task-status need-reminder))) - (play-ambient (-> obj ambient) "GEO-AM07" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task rolling-moles) (task-status need-reminder))) + (play-ambient (-> this ambient) "GEO-AM07" #f (-> this root-override trans)) ) ) ((< 0.11111111 f0-2) - (play-ambient (-> obj ambient) "GEO-LO02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-LO02" #f (-> this root-override trans)) ) - ((closed? (-> obj tasks) (game-task village2-geologist-money) (task-status need-resolution)) - (play-ambient (-> obj ambient) "GEO-AM08" #f (-> obj root-override trans)) + ((closed? (-> this tasks) (game-task village2-geologist-money) (task-status need-resolution)) + (play-ambient (-> this ambient) "GEO-AM08" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "GEO-LO01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "GEO-LO01" #f (-> this root-override trans)) ) ) ) @@ -166,11 +166,11 @@ ) ;; definition for method 11 of type geologist -(defmethod init-from-entity! geologist ((obj geologist) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *geologist-sg* 3 45 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task rolling-moles))) - (set! (-> obj sound-flava) (music-flava geologist)) - (set! (-> obj draw light-index) (the-as uint 2)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! geologist ((this geologist) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *geologist-sg* 3 45 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task rolling-moles))) + (set! (-> this sound-flava) (music-flava geologist)) + (set! (-> this draw light-index) (the-as uint 2)) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc b/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc index 86475c4475..56b14df74a 100644 --- a/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/sage-bluehut_REF.gc @@ -15,15 +15,15 @@ ) ;; definition for method 3 of type assistant-bluehut -(defmethod inspect assistant-bluehut ((obj assistant-bluehut)) +(defmethod inspect assistant-bluehut ((this assistant-bluehut)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~T~Tjaws: ~D~%" (-> obj jaws)) - (format #t "~T~Tsage: ~A~%" (-> obj sage)) - (format #t "~T~Tim-talking: ~A~%" (-> obj im-talking)) - obj + (format #t "~T~Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~T~Tjaws: ~D~%" (-> this jaws)) + (format #t "~T~Tsage: ~A~%" (-> this sage)) + (format #t "~T~Tim-talking: ~A~%" (-> this im-talking)) + this ) ;; definition of type sage-bluehut @@ -38,13 +38,13 @@ ) ;; definition for method 3 of type sage-bluehut -(defmethod inspect sage-bluehut ((obj sage-bluehut)) +(defmethod inspect sage-bluehut ((this sage-bluehut)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Treminder-played: ~A~%" (-> obj reminder-played)) - (format #t "~T~Tassistant: ~A~%" (-> obj assistant)) - obj + (format #t "~T~Treminder-played: ~A~%" (-> this reminder-played)) + (format #t "~T~Tassistant: ~A~%" (-> this assistant)) + this ) ;; failed to figure out what this is: @@ -55,28 +55,28 @@ ) ;; definition for method 32 of type sage-bluehut -(defmethod play-anim! sage-bluehut ((obj sage-bluehut) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk-to-sage)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! sage-bluehut ((this sage-bluehut) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk-to-sage)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task rolling-plants)) (when arg0 - (let* ((s5-1 (-> obj tasks)) + (let* ((s5-1 (-> this tasks)) (s4-0 (method-of-object s5-1 save-reminder)) ) (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) - (let ((s5-2 (-> obj assistant extra process))) + (close-status! (-> this tasks) (task-status need-introduction)) + (let ((s5-2 (-> this assistant extra process))) (if (and s5-2 (should-display? (the-as assistant-bluehut s5-2))) - (send-event s5-2 'clone (process->handle obj)) + (send-event s5-2 'clone (process->handle this)) ) ) - (set! (-> obj draw bounds w) 40960.0) + (set! (-> this draw bounds w) 40960.0) ) (new 'static 'spool-anim :name "sage-bluehut-introduction-crop-dusting" @@ -87,7 +87,7 @@ ) (else (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) (close-specific-task! (game-task swamp-tether-1) (task-status need-introduction)) (close-specific-task! (game-task swamp-tether-2) (task-status need-introduction)) (close-specific-task! (game-task swamp-tether-3) (task-status need-introduction)) @@ -109,17 +109,17 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (if arg0 - (set! (-> obj reminder-played) #t) + (set! (-> this reminder-played) #t) ) (cond - ((zero? (get-reminder (-> obj tasks) 0)) + ((zero? (get-reminder (-> this tasks) 0)) (new 'static 'spool-anim :name "sage-bluehut-reminder-1-crop-dusting" :index 9 :parts 3 :command-list '()) ) (else (if arg0 - (set! (-> obj draw bounds w) 40960.0) + (set! (-> this draw bounds w) 40960.0) ) (new 'static 'spool-anim :name "sage-bluehut-reminder-1-prec-arm" @@ -135,35 +135,37 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) ;; definition for method 45 of type sage-bluehut -(defmethod process-taskable-method-45 sage-bluehut ((obj sage-bluehut)) +(defmethod process-taskable-method-45 sage-bluehut ((this sage-bluehut)) (cond - ((= (current-status (-> obj tasks)) (task-status unknown)) + ((= (current-status (-> this tasks)) (task-status unknown)) #f ) - ((= (current-status (-> obj tasks)) (task-status invalid)) + ((= (current-status (-> this tasks)) (task-status invalid)) #f ) - ((and (closed? (-> obj tasks) (game-task rolling-plants) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 0) + ((and (closed? (-> this tasks) (game-task rolling-plants) (task-status need-reminder)) + (= (get-reminder (-> this tasks) 0) 0) ) #t ) - ((and (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 1) + ((and (closed? (-> this tasks) (game-task swamp-arm) (task-status need-reminder)) + (= (get-reminder (-> this tasks) 0) 1) ) #t ) - ((and (-> obj reminder-played) (< 81920.0 (vector-vector-distance (-> obj root-override trans) (camera-pos)))) + ((and (-> this reminder-played) + (< 81920.0 (vector-vector-distance (-> this root-override trans) (camera-pos))) + ) #t ) (else @@ -173,45 +175,45 @@ ) ;; definition for method 31 of type sage-bluehut -(defmethod get-art-elem sage-bluehut ((obj sage-bluehut)) +(defmethod get-art-elem sage-bluehut ((this sage-bluehut)) (cond - ((and (= (current-task (-> obj tasks)) (game-task rolling-plants)) - (or (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) + ((and (= (current-task (-> this tasks)) (game-task rolling-plants)) + (or (= (current-status (-> this tasks)) (task-status need-hint)) + (= (current-status (-> this tasks)) (task-status need-introduction)) ) ) - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) - ((and (= (current-task (-> obj tasks)) (game-task swamp-arm)) - (or (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) + ((and (= (current-task (-> this tasks)) (game-task swamp-arm)) + (or (= (current-status (-> this tasks)) (task-status need-hint)) + (= (current-status (-> this tasks)) (task-status need-introduction)) ) ) - (save-reminder (-> obj tasks) 1 0) + (save-reminder (-> this tasks) 1 0) ) - ((process-taskable-method-45 obj) - (set! (-> obj reminder-played) #f) + ((process-taskable-method-45 this) + (set! (-> this reminder-played) #f) (cond - ((closed? (-> obj tasks) (game-task rolling-plants) (task-status need-reminder)) - (save-reminder (-> obj tasks) 1 0) + ((closed? (-> this tasks) (game-task rolling-plants) (task-status need-reminder)) + (save-reminder (-> this tasks) 1 0) ) - ((or (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-reminder)) - (not (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-introduction))) + ((or (closed? (-> this tasks) (game-task swamp-arm) (task-status need-reminder)) + (not (closed? (-> this tasks) (game-task swamp-arm) (task-status need-introduction))) ) - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) - ((zero? (get-reminder (-> obj tasks) 0)) - (save-reminder (-> obj tasks) 1 0) + ((zero? (get-reminder (-> this tasks) 0)) + (save-reminder (-> this tasks) 1 0) ) (else - (save-reminder (-> obj tasks) 0 0) + (save-reminder (-> this tasks) 0 0) ) ) ) ) - (if (zero? (get-reminder (-> obj tasks) 0)) - (-> obj draw art-group data 4) - (-> obj draw art-group data 5) + (if (zero? (get-reminder (-> this tasks) 0)) + (-> this draw art-group data 4) + (-> this draw art-group data 5) ) ) @@ -226,26 +228,26 @@ ) ;; definition for method 39 of type sage-bluehut -(defmethod should-display? sage-bluehut ((obj sage-bluehut)) +(defmethod should-display? sage-bluehut ((this sage-bluehut)) (and (task-closed? (game-task village2-levitator) (task-status need-introduction)) (not (sages-kidnapped?))) ) ;; definition for method 44 of type sage-bluehut ;; INFO: Return type mismatch basic vs symbol. -(defmethod play-reminder sage-bluehut ((obj sage-bluehut)) +(defmethod play-reminder sage-bluehut ((this sage-bluehut)) (the-as symbol - (and (-> obj will-talk) *target* (< -6365184.0 (-> (target-pos 0) z)) (< (-> (target-pos 0) x) 1612800.0)) + (and (-> this will-talk) *target* (< -6365184.0 (-> (target-pos 0) z)) (< (-> (target-pos 0) x) 1612800.0)) ) ) ;; definition for method 47 of type sage-bluehut -(defmethod target-above-threshold? sage-bluehut ((obj sage-bluehut)) +(defmethod target-above-threshold? sage-bluehut ((this sage-bluehut)) (local-vars (v0-1 symbol)) - (if (not (play-reminder obj)) + (if (not (play-reminder this)) (return #f) ) - (let ((gp-1 (-> obj assistant extra process))) + (let ((gp-1 (-> this assistant extra process))) (if (not gp-1) (return #t) ) @@ -256,24 +258,24 @@ ) ;; definition for method 43 of type sage-bluehut -(defmethod process-taskable-method-43 sage-bluehut ((obj sage-bluehut)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 sage-bluehut ((this sage-bluehut)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.8 f0-2) - (play-ambient (-> obj ambient) "SAGELP20" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP20" #f (-> this root-override trans)) ) ((< 0.6 f0-2) - (play-ambient (-> obj ambient) "SAGELP21" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP21" #f (-> this root-override trans)) ) ((< 0.4 f0-2) - (play-ambient (-> obj ambient) "SAGELP22" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP22" #f (-> this root-override trans)) ) ((< 0.2 f0-2) - (play-ambient (-> obj ambient) "SAGELP23" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP23" #f (-> this root-override trans)) ) ((nonzero? (get-task-status (game-task citadel-sage-blue))) - (play-ambient (-> obj ambient) "SAGELP24" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP24" #f (-> this root-override trans)) ) ) ) @@ -340,13 +342,13 @@ ) ;; definition for method 11 of type sage-bluehut -(defmethod init-from-entity! sage-bluehut ((obj sage-bluehut) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sage-bluehut-sg* 3 40 (new 'static 'vector :w 4505.6) 5) - (set! (-> obj tasks) (get-task-control (game-task rolling-plants))) - (set! (-> obj reminder-played) #f) - (set! (-> obj assistant) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj draw light-index) (the-as uint 1)) - (set! (-> obj sound-flava) (music-flava sage)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! sage-bluehut ((this sage-bluehut) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sage-bluehut-sg* 3 40 (new 'static 'vector :w 4505.6) 5) + (set! (-> this tasks) (get-task-control (game-task rolling-plants))) + (set! (-> this reminder-played) #f) + (set! (-> this assistant) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this sound-flava) (music-flava sage)) + (process-taskable-method-42 this) (none) ) 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 b243d0d1ca..a582682917 100644 --- a/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/sunken-elevator_REF.gc @@ -14,14 +14,14 @@ ) ;; definition for method 3 of type sunken-elevator -(defmethod inspect sunken-elevator ((obj sunken-elevator)) +(defmethod inspect sunken-elevator ((this sunken-elevator)) (let ((t9-0 (method-of-type plat-button inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tplay-at-top-going-up-camera?: ~A~%" (-> obj play-at-top-going-up-camera?)) - (format #t "~T~Tteleport-if-below-y: ~f~%" (-> obj teleport-if-below-y)) - (format #t "~T~Tteleport-if-above-y: ~f~%" (-> obj teleport-if-above-y)) - obj + (format #t "~T~Tplay-at-top-going-up-camera?: ~A~%" (-> this play-at-top-going-up-camera?)) + (format #t "~T~Tteleport-if-below-y: ~f~%" (-> this teleport-if-below-y)) + (format #t "~T~Tteleport-if-above-y: ~f~%" (-> this teleport-if-above-y)) + this ) ;; failed to figure out what this is: @@ -31,16 +31,16 @@ ) ;; definition for method 30 of type sunken-elevator -(defmethod should-teleport? sunken-elevator ((obj sunken-elevator)) +(defmethod should-teleport? sunken-elevator ((this sunken-elevator)) (let ((f0-0 (-> (camera-pos) y))) - (case (-> obj path-pos) + (case (-> this path-pos) ((0.0) - (if (< f0-0 (-> obj teleport-if-below-y)) + (if (< f0-0 (-> this teleport-if-below-y)) (return #t) ) ) ((1.0) - (if (< (-> obj teleport-if-above-y) f0-0) + (if (< (-> this teleport-if-above-y) f0-0) (return #t) ) ) @@ -174,54 +174,54 @@ ;; definition for method 29 of type sunken-elevator ;; INFO: Return type mismatch float vs none. -(defmethod can-target-move? sunken-elevator ((obj sunken-elevator)) - (set! (-> obj play-at-top-going-up-camera?) #f) +(defmethod can-target-move? sunken-elevator ((this sunken-elevator)) + (set! (-> this play-at-top-going-up-camera?) #f) (let ((s5-0 (new 'stack-no-clear 'vector))) - (eval-path-curve! (-> obj path) s5-0 0.4 'interp) - (set! (-> obj teleport-if-above-y) (-> s5-0 y)) - (eval-path-curve! (-> obj path) s5-0 0.6 'interp) - (set! (-> obj teleport-if-below-y) (-> s5-0 y)) + (eval-path-curve! (-> this path) s5-0 0.4 'interp) + (set! (-> this teleport-if-above-y) (-> s5-0 y)) + (eval-path-curve! (-> this path) s5-0 0.6 'interp) + (set! (-> this teleport-if-below-y) (-> s5-0 y)) ) (none) ) ;; definition for method 27 of type sunken-elevator ;; INFO: Return type mismatch symbol vs none. -(defmethod plat-button-method-27 sunken-elevator ((obj sunken-elevator)) +(defmethod plat-button-method-27 sunken-elevator ((this sunken-elevator)) (ja-channel-set! 1) (cond - ((can-activate? obj) - (let ((s5-0 (-> obj skel root-channel 0))) + ((can-activate? this) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) ) (else - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) ) ) (ja-post) - (update-transforms! (-> obj root-override)) + (update-transforms! (-> this root-override)) (none) ) ;; definition for method 31 of type sunken-elevator ;; INFO: Return type mismatch int vs none. -(defmethod plat-button-method-31 sunken-elevator ((obj sunken-elevator)) - (initialize-skeleton obj *sunken-elevator-sg* '()) +(defmethod plat-button-method-31 sunken-elevator ((this sunken-elevator)) + (initialize-skeleton this *sunken-elevator-sg* '()) 0 (none) ) 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 044404571f..dfd5c8af4e 100644 --- a/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/swamp-blimp_REF.gc @@ -212,13 +212,13 @@ ) ;; definition for method 3 of type swamp-blimp-bank -(defmethod inspect swamp-blimp-bank ((obj swamp-blimp-bank)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tarm-index: ~D~%" (-> obj arm-index)) - (format #t "~Tpause-before-dropping-arm: ~D~%" (-> obj pause-before-dropping-arm)) - (format #t "~Trise-per-break: ~f~%" (-> obj rise-per-break)) - (format #t "~Tarm-sink-wait: ~f~%" (-> obj arm-sink-wait)) - obj +(defmethod inspect swamp-blimp-bank ((this swamp-blimp-bank)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tarm-index: ~D~%" (-> this arm-index)) + (format #t "~Tpause-before-dropping-arm: ~D~%" (-> this pause-before-dropping-arm)) + (format #t "~Trise-per-break: ~f~%" (-> this rise-per-break)) + (format #t "~Tarm-sink-wait: ~f~%" (-> this arm-sink-wait)) + this ) ;; definition for symbol *SWAMP_BLIMP-bank*, type swamp-blimp-bank @@ -241,15 +241,15 @@ ) ;; definition for method 3 of type tetherrock-info -(defmethod inspect tetherrock-info ((obj tetherrock-info)) - (format #t "[~8x] ~A~%" obj 'tetherrock-info) - (format #t "~Trock-camera: ~A~%" (-> obj rock-camera)) - (format #t "~Tarm-camera: ~A~%" (-> obj arm-camera)) - (format #t "~Tblimp-rp: ~D~%" (-> obj blimp-rp)) - (format #t "~Tother-rp: ~D~%" (-> obj other-rp)) - (format #t "~Tconnected-to-rock: ~A~%" (-> obj connected-to-rock)) - (format #t "~Tdamping: ~f~%" (-> obj damping)) - obj +(defmethod inspect tetherrock-info ((this tetherrock-info)) + (format #t "[~8x] ~A~%" this 'tetherrock-info) + (format #t "~Trock-camera: ~A~%" (-> this rock-camera)) + (format #t "~Tarm-camera: ~A~%" (-> this arm-camera)) + (format #t "~Tblimp-rp: ~D~%" (-> this blimp-rp)) + (format #t "~Tother-rp: ~D~%" (-> this other-rp)) + (format #t "~Tconnected-to-rock: ~A~%" (-> this connected-to-rock)) + (format #t "~Tdamping: ~f~%" (-> this damping)) + this ) ;; definition for function tetherrock-get-info @@ -327,38 +327,37 @@ ) ;; definition for method 3 of type swamp-rope-rand-float -(defmethod inspect swamp-rope-rand-float ((obj swamp-rope-rand-float)) - (format #t "[~8x] ~A~%" obj 'swamp-rope-rand-float) - (format #t "~Tmin-time: ~D~%" (-> obj min-time)) - (format #t "~Tmax-time: ~D~%" (-> obj max-time)) - (format #t "~Tmax-val: ~f~%" (-> obj max-val)) - (format #t "~Ttimer: ~D~%" (-> obj timer)) - (format #t "~Tvalue: ~f~%" (-> obj value)) - obj +(defmethod inspect swamp-rope-rand-float ((this swamp-rope-rand-float)) + (format #t "[~8x] ~A~%" this 'swamp-rope-rand-float) + (format #t "~Tmin-time: ~D~%" (-> this min-time)) + (format #t "~Tmax-time: ~D~%" (-> this max-time)) + (format #t "~Tmax-val: ~f~%" (-> this max-val)) + (format #t "~Ttimer: ~D~%" (-> this timer)) + (format #t "~Tvalue: ~f~%" (-> this value)) + this ) ;; definition for method 9 of type swamp-rope-rand-float ;; INFO: Return type mismatch int vs none. -(defmethod init! swamp-rope-rand-float ((obj swamp-rope-rand-float) (arg0 int) (arg1 int) (arg2 float)) - (set! (-> obj min-time) arg0) - (set! (-> obj max-time) arg1) - (set! (-> obj max-val) (* 0.5 arg2)) - (set! (-> obj timer) 0) - (set! (-> obj value) 0.0) +(defmethod init! swamp-rope-rand-float ((this swamp-rope-rand-float) (arg0 int) (arg1 int) (arg2 float)) + (set! (-> this min-time) arg0) + (set! (-> this max-time) arg1) + (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this timer) 0) + (set! (-> this value) 0.0) 0 (none) ) ;; definition for method 10 of type swamp-rope-rand-float ;; INFO: Return type mismatch int vs none. -(defmethod update-timer! swamp-rope-rand-float ((obj swamp-rope-rand-float)) - (set! (-> obj timer) (- (the-as time-frame (-> obj timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) +(defmethod update-timer! swamp-rope-rand-float ((this swamp-rope-rand-float)) + (set! (-> this timer) + (- (the-as time-frame (-> this timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) - (when (<= (-> obj timer) 0) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value) (rand-vu-float-range (- (-> obj max-val)) (-> obj max-val))) + (when (<= (-> this timer) 0) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value) (rand-vu-float-range (- (-> this max-val)) (-> this max-val))) ) 0 (none) @@ -384,39 +383,40 @@ ) ;; definition for method 3 of type swamp-rope-oscillator -(defmethod inspect swamp-rope-oscillator ((obj swamp-rope-oscillator)) - (format #t "[~8x] ~A~%" obj 'swamp-rope-oscillator) - (format #t "~Ttarget: ~f~%" (-> obj target)) - (format #t "~Tvalue: ~f~%" (-> obj value)) - (format #t "~Tvel: ~f~%" (-> obj vel)) - (format #t "~Taccel: ~f~%" (-> obj accel)) - (format #t "~Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~Tdamping: ~f~%" (-> obj damping)) - obj +(defmethod inspect swamp-rope-oscillator ((this swamp-rope-oscillator)) + (format #t "[~8x] ~A~%" this 'swamp-rope-oscillator) + (format #t "~Ttarget: ~f~%" (-> this target)) + (format #t "~Tvalue: ~f~%" (-> this value)) + (format #t "~Tvel: ~f~%" (-> this vel)) + (format #t "~Taccel: ~f~%" (-> this accel)) + (format #t "~Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~Tdamping: ~f~%" (-> this damping)) + this ) ;; definition for method 9 of type swamp-rope-oscillator ;; INFO: Return type mismatch int vs none. -(defmethod init! swamp-rope-oscillator ((obj swamp-rope-oscillator) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (set! (-> obj target) arg0) - (set! (-> obj value) arg0) - (set! (-> obj vel) 0.0) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj damping) arg3) +(defmethod init! swamp-rope-oscillator ((this swamp-rope-oscillator) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> this target) arg0) + (set! (-> this value) arg0) + (set! (-> this vel) 0.0) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this damping) arg3) 0 (none) ) ;; definition for method 10 of type swamp-rope-oscillator ;; INFO: Return type mismatch int vs none. -(defmethod swamp-rope-oscillator-method-10 swamp-rope-oscillator ((obj swamp-rope-oscillator) (arg0 float)) - (let ((f0-3 (* (- (+ (-> obj target) arg0) (-> obj value)) (* (-> obj accel) (-> *display* time-adjust-ratio))))) - (+! (-> obj vel) f0-3) +(defmethod swamp-rope-oscillator-method-10 swamp-rope-oscillator ((this swamp-rope-oscillator) (arg0 float)) + (let ((f0-3 (* (- (+ (-> this target) arg0) (-> this value)) (* (-> this accel) (-> *display* time-adjust-ratio)))) + ) + (+! (-> this vel) f0-3) ) - (set! (-> obj vel) (fmin (-> obj max-vel) (fmax (- (-> obj max-vel)) (-> obj vel)))) - (set! (-> obj vel) (* (-> obj vel) (-> obj damping))) - (+! (-> obj value) (* (-> obj vel) (-> *display* time-adjust-ratio))) + (set! (-> this vel) (fmin (-> this max-vel) (fmax (- (-> this max-vel)) (-> this vel)))) + (set! (-> this vel) (* (-> this vel) (-> this damping))) + (+! (-> this value) (* (-> this vel) (-> *display* time-adjust-ratio))) 0 (none) ) @@ -440,42 +440,41 @@ ) ;; definition for method 3 of type swamp-blimp-rand-vector -(defmethod inspect swamp-blimp-rand-vector ((obj swamp-blimp-rand-vector)) - (format #t "[~8x] ~A~%" obj 'swamp-blimp-rand-vector) - (format #t "~Tmin-time: ~D~%" (-> obj min-time)) - (format #t "~Tmax-time: ~D~%" (-> obj max-time)) - (format #t "~Txz-max: ~f~%" (-> obj xz-max)) - (format #t "~Ty-max: ~f~%" (-> obj y-max)) - (format #t "~Ttimer: ~D~%" (-> obj timer)) - (format #t "~Tvalue: #~%" (-> obj value)) - obj +(defmethod inspect swamp-blimp-rand-vector ((this swamp-blimp-rand-vector)) + (format #t "[~8x] ~A~%" this 'swamp-blimp-rand-vector) + (format #t "~Tmin-time: ~D~%" (-> this min-time)) + (format #t "~Tmax-time: ~D~%" (-> this max-time)) + (format #t "~Txz-max: ~f~%" (-> this xz-max)) + (format #t "~Ty-max: ~f~%" (-> this y-max)) + (format #t "~Ttimer: ~D~%" (-> this timer)) + (format #t "~Tvalue: #~%" (-> this value)) + this ) ;; definition for method 9 of type swamp-blimp-rand-vector ;; INFO: Return type mismatch int vs none. -(defmethod init! swamp-blimp-rand-vector ((obj swamp-blimp-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) - (set! (-> obj min-time) arg0) - (set! (-> obj max-time) arg1) - (set! (-> obj xz-max) (* 0.5 arg2)) - (set! (-> obj y-max) (* 0.5 arg3)) - (set! (-> obj timer) 0) - (vector-reset! (-> obj value)) +(defmethod init! swamp-blimp-rand-vector ((this swamp-blimp-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) + (set! (-> this min-time) arg0) + (set! (-> this max-time) arg1) + (set! (-> this xz-max) (* 0.5 arg2)) + (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this timer) 0) + (vector-reset! (-> this value)) 0 (none) ) ;; definition for method 10 of type swamp-blimp-rand-vector ;; INFO: Return type mismatch int vs none. -(defmethod update-timer! swamp-blimp-rand-vector ((obj swamp-blimp-rand-vector)) - (set! (-> obj timer) (- (the-as time-frame (-> obj timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) +(defmethod update-timer! swamp-blimp-rand-vector ((this swamp-blimp-rand-vector)) + (set! (-> this timer) + (- (the-as time-frame (-> this timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) - (when (<= (-> obj timer) 0) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value x) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (set! (-> obj value y) (rand-vu-float-range (- (-> obj y-max)) (-> obj y-max))) - (set! (-> obj value z) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) + (when (<= (-> this timer) 0) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (set! (-> this value y) (rand-vu-float-range (- (-> this y-max)) (-> this y-max))) + (set! (-> this value z) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) ) 0 (none) @@ -501,62 +500,62 @@ ) ;; definition for method 3 of type swamp-blimp-oscillator -(defmethod inspect swamp-blimp-oscillator ((obj swamp-blimp-oscillator)) - (format #t "[~8x] ~A~%" obj 'swamp-blimp-oscillator) - (format #t "~Ttarget: #~%" (-> obj target)) - (format #t "~Tvalue: #~%" (-> obj value)) - (format #t "~Tvel: #~%" (-> obj vel)) - (format #t "~Taccel: ~f~%" (-> obj accel)) - (format #t "~Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~Tdamping: ~f~%" (-> obj damping)) - obj +(defmethod inspect swamp-blimp-oscillator ((this swamp-blimp-oscillator)) + (format #t "[~8x] ~A~%" this 'swamp-blimp-oscillator) + (format #t "~Ttarget: #~%" (-> this target)) + (format #t "~Tvalue: #~%" (-> this value)) + (format #t "~Tvel: #~%" (-> this vel)) + (format #t "~Taccel: ~f~%" (-> this accel)) + (format #t "~Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~Tdamping: ~f~%" (-> this damping)) + this ) ;; definition for method 9 of type swamp-blimp-oscillator ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod init! swamp-blimp-oscillator ((obj swamp-blimp-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init! swamp-blimp-oscillator ((this swamp-blimp-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj value quad) (-> arg0 quad)) + (set! (-> this target quad) (-> arg0 quad)) + (set! (-> this value quad) (-> arg0 quad)) ) (else - (vector-reset! (-> obj target)) - (vector-reset! (-> obj value)) + (vector-reset! (-> this target)) + (vector-reset! (-> this value)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj damping) arg3) + (vector-reset! (-> this vel)) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this damping) arg3) 0 (none) ) ;; definition for method 10 of type swamp-blimp-oscillator ;; INFO: Return type mismatch int vs none. -(defmethod swamp-blimp-oscillator-method-10 swamp-blimp-oscillator ((obj swamp-blimp-oscillator) (arg0 vector)) +(defmethod swamp-blimp-oscillator-method-10 swamp-blimp-oscillator ((this swamp-blimp-oscillator) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) (cond (arg0 - (vector+! gp-0 (-> obj target) arg0) - (vector-! gp-0 gp-0 (-> obj value)) + (vector+! gp-0 (-> this target) arg0) + (vector-! gp-0 gp-0 (-> this value)) ) (else - (vector-! gp-0 (-> obj target) (-> obj value)) + (vector-! gp-0 (-> this target) (-> this value)) ) ) - (vector-float*! gp-0 gp-0 (* (-> obj accel) (-> *display* time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) gp-0) - (let ((f0-2 (vector-length (-> obj vel)))) - (if (< (-> obj max-vel) f0-2) - (vector-float*! (-> obj vel) (-> obj vel) (/ (-> obj max-vel) f0-2)) + (vector-float*! gp-0 gp-0 (* (-> this accel) (-> *display* time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) gp-0) + (let ((f0-2 (vector-length (-> this vel)))) + (if (< (-> this max-vel) f0-2) + (vector-float*! (-> this vel) (-> this vel) (/ (-> this max-vel) f0-2)) ) ) - (vector-float*! (-> obj vel) (-> obj vel) (-> obj damping)) - (vector-float*! gp-0 (-> obj vel) (-> *display* time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) gp-0) + (vector-float*! (-> this vel) (-> this vel) (-> this damping)) + (vector-float*! gp-0 (-> this vel) (-> *display* time-adjust-ratio)) + (vector+! (-> this value) (-> this value) gp-0) ) 0 (none) @@ -584,16 +583,16 @@ ) ;; definition for method 3 of type swamp-tetherrock -(defmethod inspect swamp-tetherrock ((obj swamp-tetherrock)) +(defmethod inspect swamp-tetherrock ((this swamp-tetherrock)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttension: ~f~%" (-> obj tension)) - (format #t "~T~Ttension-pt: #~%" (-> obj tension-pt)) - (format #t "~T~Tblimp: ~A~%" (-> obj blimp)) - (format #t "~T~Trot-at-init: #~%" (-> obj rot-at-init)) - (format #t "~T~Thits: ~D~%" (-> obj hits)) - obj + (format #t "~T~Ttension: ~f~%" (-> this tension)) + (format #t "~T~Ttension-pt: #~%" (-> this tension-pt)) + (format #t "~T~Tblimp: ~A~%" (-> this blimp)) + (format #t "~T~Trot-at-init: #~%" (-> this rot-at-init)) + (format #t "~T~Thits: ~D~%" (-> this hits)) + this ) ;; definition of type precursor-arm @@ -620,19 +619,19 @@ ) ;; definition for method 3 of type precursor-arm -(defmethod inspect precursor-arm ((obj precursor-arm)) +(defmethod inspect precursor-arm ((this precursor-arm)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ty-init: ~f~%" (-> obj y-init)) - (format #t "~T~Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~T~Trot-speed: ~f~%" (-> obj rot-speed)) - (format #t "~T~Trot-dist: ~f~%" (-> obj rot-dist)) - (format #t "~T~Trot-base: ~f~%" (-> obj rot-base)) - (format #t "~T~Trot-t: ~f~%" (-> obj rot-t)) - (format #t "~T~Tinit-mat: #~%" (-> obj init-mat)) - (format #t "~T~Ttension: ~f~%" (-> obj tension)) - obj + (format #t "~T~Ty-init: ~f~%" (-> this y-init)) + (format #t "~T~Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~T~Trot-speed: ~f~%" (-> this rot-speed)) + (format #t "~T~Trot-dist: ~f~%" (-> this rot-dist)) + (format #t "~T~Trot-base: ~f~%" (-> this rot-base)) + (format #t "~T~Trot-t: ~f~%" (-> this rot-t)) + (format #t "~T~Tinit-mat: #~%" (-> this init-mat)) + (format #t "~T~Ttension: ~f~%" (-> this tension)) + this ) ;; definition of type swamp-rope @@ -666,29 +665,29 @@ ) ;; definition for method 3 of type swamp-rope -(defmethod inspect swamp-rope ((obj swamp-rope)) +(defmethod inspect swamp-rope ((this swamp-rope)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tparent-rp: ~D~%" (-> obj parent-rp)) - (format #t "~T~Tother-entity: ~A~%" (-> obj other-entity)) - (format #t "~T~Tother-rp: ~D~%" (-> obj other-rp)) - (format #t "~T~Told-scale: ~f~%" (-> obj old-scale)) - (format #t "~T~Tframe: #~%" (-> obj frame)) - (format #t "~T~Tother-pos: #~%" (-> obj other-pos)) - (format #t "~T~Tscale-base: ~f~%" (-> obj scale-base)) - (format #t "~T~Tbase-vec: #~%" (-> obj base-vec)) - (format #t "~T~Tscale-t: ~f~%" (-> obj scale-t)) - (format #t "~T~Tx-t: ~f~%" (-> obj x-t)) - (format #t "~T~Tz-t: ~f~%" (-> obj z-t)) - (format #t "~T~Trot-speed: ~f~%" (-> obj rot-speed)) - obj + (format #t "~T~Tparent-rp: ~D~%" (-> this parent-rp)) + (format #t "~T~Tother-entity: ~A~%" (-> this other-entity)) + (format #t "~T~Tother-rp: ~D~%" (-> this other-rp)) + (format #t "~T~Told-scale: ~f~%" (-> this old-scale)) + (format #t "~T~Tframe: #~%" (-> this frame)) + (format #t "~T~Tother-pos: #~%" (-> this other-pos)) + (format #t "~T~Tscale-base: ~f~%" (-> this scale-base)) + (format #t "~T~Tbase-vec: #~%" (-> this base-vec)) + (format #t "~T~Tscale-t: ~f~%" (-> this scale-t)) + (format #t "~T~Tx-t: ~f~%" (-> this x-t)) + (format #t "~T~Tz-t: ~f~%" (-> this z-t)) + (format #t "~T~Trot-speed: ~f~%" (-> this rot-speed)) + this ) ;; definition for method 20 of type swamp-rope -(defmethod swamp-rope-method-20 swamp-rope ((obj swamp-rope)) - (and (-> obj other-entity) - (not (task-closed? (-> obj other-entity extra perm task) (task-status need-reminder))) +(defmethod swamp-rope-method-20 swamp-rope ((this swamp-rope)) + (and (-> this other-entity) + (not (task-closed? (-> this other-entity extra perm task) (task-status need-reminder))) ) ) @@ -723,41 +722,45 @@ ) ;; definition for method 3 of type swamp-blimp -(defmethod inspect swamp-blimp ((obj swamp-blimp)) +(defmethod inspect swamp-blimp ((this swamp-blimp)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tthe-ropes[5] @ #x~X~%" (-> obj the-ropes)) - (format #t "~T~Tarm-timer: ~D~%" (-> obj arm-timer)) - (format #t "~T~Ttrans-at-init: #~%" (-> obj trans-at-init)) - (format #t "~T~Trot-at-init: #~%" (-> obj rot-at-init)) - (format #t "~T~Ty-vel: ~f~%" (-> obj y-vel)) - (format #t "~T~Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~T~Ty-offset-target: ~f~%" (-> obj y-offset-target)) - (format #t "~T~Tmain-tilt-rand: #~%" (-> obj main-tilt-rand)) - (format #t "~T~Tmain-tilt-oscillator: #~%" (-> obj main-tilt-oscillator)) - (format #t "~T~Tgondola-tilt-oscillator: #~%" (-> obj gondola-tilt-oscillator)) - (format #t "~T~Tpos-rand: #~%" (-> obj pos-rand)) - (format #t "~T~Tpos-oscillator: #~%" (-> obj pos-oscillator)) - (format #t "~T~Tscale-rand: #~%" (-> obj scale-rand)) - (format #t "~T~Tscale-oscillator: #~%" (-> obj scale-oscillator)) - (format #t "~T~Tgondola: ~A~%" (-> obj gondola)) - (format #t "~T~Tbag: ~A~%" (-> obj bag)) - obj + (format #t "~T~Tthe-ropes[5] @ #x~X~%" (-> this the-ropes)) + (format #t "~T~Tarm-timer: ~D~%" (-> this arm-timer)) + (format #t "~T~Ttrans-at-init: #~%" (-> this trans-at-init)) + (format #t "~T~Trot-at-init: #~%" (-> this rot-at-init)) + (format #t "~T~Ty-vel: ~f~%" (-> this y-vel)) + (format #t "~T~Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~T~Ty-offset-target: ~f~%" (-> this y-offset-target)) + (format #t "~T~Tmain-tilt-rand: #~%" (-> this main-tilt-rand)) + (format #t "~T~Tmain-tilt-oscillator: #~%" (-> this main-tilt-oscillator)) + (format + #t + "~T~Tgondola-tilt-oscillator: #~%" + (-> this gondola-tilt-oscillator) + ) + (format #t "~T~Tpos-rand: #~%" (-> this pos-rand)) + (format #t "~T~Tpos-oscillator: #~%" (-> this pos-oscillator)) + (format #t "~T~Tscale-rand: #~%" (-> this scale-rand)) + (format #t "~T~Tscale-oscillator: #~%" (-> this scale-oscillator)) + (format #t "~T~Tgondola: ~A~%" (-> this gondola)) + (format #t "~T~Tbag: ~A~%" (-> this bag)) + this ) ;; definition for method 7 of type swamp-blimp ;; INFO: Return type mismatch process-drawable vs swamp-blimp. -(defmethod relocate swamp-blimp ((obj swamp-blimp) (arg0 int)) - (if (nonzero? (-> obj gondola)) - (&+! (-> obj gondola) arg0) +(defmethod relocate swamp-blimp ((this swamp-blimp) (arg0 int)) + (if (nonzero? (-> this gondola)) + (&+! (-> this gondola) arg0) ) - (if (nonzero? (-> obj bag)) - (&+! (-> obj bag) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method swamp-blimp 7)) this arg0) ) ) @@ -826,8 +829,8 @@ (set! (-> *camera-other-fov* data) (cam-slave-get-fov s5-1)) ) (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.6)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.6)) (set! *camera-look-through-other* 2) (suspend) ) @@ -886,8 +889,8 @@ (suspend) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (set! *camera-look-through-other* 2) (suspend) ) @@ -898,13 +901,13 @@ (set! (-> *camera-other-fov* data) (cam-slave-get-fov gp-1)) ) (set! (-> *camera-other-root* quad) (-> self root-override trans quad)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 5)) (set! *camera-look-through-other* 2) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 5)) (set! *camera-look-through-other* 2) (let ((gp-2 (new 'stack-no-clear 'vector)) (a0-58 (-> self blimp extra process)) @@ -1046,10 +1049,10 @@ ;; definition for method 11 of type swamp-tetherrock ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-tetherrock ((obj swamp-tetherrock) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask attackable)) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! swamp-tetherrock ((this swamp-tetherrock) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask attackable)) + (process-entity-status! this (entity-perm-status bit-7) #t) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1067,29 +1070,29 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *swamp-tetherrock-sg* '()) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *swamp-tetherrock-sg* '()) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-pill-inc)) ) - (set! (-> obj blimp) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj tension) 0.0) - (vector-reset! (-> obj tension-pt)) - (quaternion-copy! (-> obj rot-at-init) (-> obj root-override quat)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (case (get-task-status (-> obj entity extra perm task)) + (set! (-> this blimp) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this tension) 0.0) + (vector-reset! (-> this tension-pt)) + (quaternion-copy! (-> this rot-at-init) (-> this root-override quat)) + (logclear! (-> this mask) (process-mask actor-pause)) + (case (get-task-status (-> this entity extra perm task)) (((task-status invalid)) (go swamp-tetherrock-die) ) (((task-status need-resolution)) (birth-pickup-at-point - (-> obj root-override trans) + (-> this root-override trans) (pickup-type fuel-cell) - (the float (-> obj entity extra perm task)) + (the float (-> this entity extra perm task)) #f - obj + this (the-as fact-info #f) ) (go swamp-tetherrock-hide) @@ -1115,10 +1118,8 @@ ;; failed to figure out what this is: (defstate precursor-arm-sink (precursor-arm) :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) - (until (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (the int (-> *SWAMP_BLIMP-bank* arm-sink-wait)) - ) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (the int (-> *SWAMP_BLIMP-bank* arm-sink-wait))) (suspend) ) (close-specific-task! (-> self entity extra perm task) (task-status need-reminder)) @@ -1206,17 +1207,13 @@ ) (when (< 0.0 f28-2) (let ((f26-1 (+ f26-0 (* 0.14648438 f28-2)))) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int f26-1)) - (if (< (- f26-1 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) 150.0) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (the int f26-1))) + (if (< (- f26-1 (the float (- (current-time) (-> self state-time)))) 150.0) (set! (-> self tension) 0.5) ) (set! (-> self y-offset) - (+ f30-2 - (* f28-2 - (precursor-arm-slip (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) f26-1)) - ) - ) + (+ f30-2 (* f28-2 (precursor-arm-slip (/ (the float (- (current-time) (-> self state-time))) f26-1)))) ) (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) @@ -1232,17 +1229,13 @@ ) (when (< f28-4 0.0) (let ((f26-3 (- f26-2 (* 0.036621094 f28-4)))) - (set! (-> self state-time) (-> *display* base-frame-counter)) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (the int f26-3)) - (if (< (- f26-3 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) 150.0) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (the int f26-3))) + (if (< (- f26-3 (the float (- (current-time) (-> self state-time)))) 150.0) (set! (-> self tension) 1.5) ) (set! (-> self y-offset) - (+ f30-5 - (* f28-4 - (parameter-ease-sin-clamp (/ (the float (- (-> *display* base-frame-counter) (-> self state-time))) f26-3)) - ) - ) + (+ f30-5 (* f28-4 (parameter-ease-sin-clamp (/ (the float (- (current-time) (-> self state-time))) f26-3)))) ) (set! (-> self root-override trans y) (+ (-> self y-offset) (-> self y-init))) (suspend) @@ -1258,8 +1251,8 @@ ;; definition for method 11 of type precursor-arm ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! precursor-arm ((obj precursor-arm) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-from-entity! precursor-arm ((this precursor-arm) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (alloc-riders s4-0 1) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) @@ -1271,22 +1264,22 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *precursor-arm-sg* '()) - (set! (-> obj rot-speed) 0.0) - (set! (-> obj rot-dist) 0.0) - (set! (-> obj rot-base) 0.0) - (set! (-> obj rot-t) 1.0) - (quaternion->matrix (-> obj init-mat) (-> obj root-override quat)) - (set! (-> obj y-offset) 0.0) - (set! (-> obj y-init) (-> obj root-override trans y)) - (set! (-> obj tension) 0.0) - (process-entity-status! obj (entity-perm-status bit-7) #t) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj event-hook) (-> precursor-arm-idle event)) - (if (= (get-task-status (-> obj entity extra perm task)) (task-status invalid)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *precursor-arm-sg* '()) + (set! (-> this rot-speed) 0.0) + (set! (-> this rot-dist) 0.0) + (set! (-> this rot-base) 0.0) + (set! (-> this rot-t) 1.0) + (quaternion->matrix (-> this init-mat) (-> this root-override quat)) + (set! (-> this y-offset) 0.0) + (set! (-> this y-init) (-> this root-override trans y)) + (set! (-> this tension) 0.0) + (process-entity-status! this (entity-perm-status bit-7) #t) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this event-hook) (-> precursor-arm-idle event)) + (if (= (get-task-status (-> this entity extra perm task)) (task-status invalid)) (go precursor-arm-die) (go precursor-arm-idle) ) @@ -1353,9 +1346,9 @@ (vector-normalize! (-> gp-0 vector 1) 1.0) (set-vector! s5-0 - (sin (* (-> self rot-speed) (the float (- (-> *display* base-frame-counter) (-> self state-time))))) + (sin (* (-> self rot-speed) (the float (- (current-time) (-> self state-time))))) 0.0 - (cos (* (-> self rot-speed) (the float (- (-> *display* base-frame-counter) (-> self state-time))))) + (cos (* (-> self rot-speed) (the float (- (current-time) (-> self state-time))))) 1.0 ) (vector-cross! (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1) s5-0) @@ -1609,14 +1602,14 @@ ) :trans blimp-trans :code (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-copy! gp-0 (-> self rot-at-init)) (loop (quaternion-vector-angle! (-> self rot-at-init) (new 'static 'vector :y 1.0 :w 1.0) - (* 18.204445 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) + (* 18.204445 (the float (- (current-time) (-> self state-time)))) ) (quaternion*! (-> self rot-at-init) (-> self rot-at-init) gp-0) (if (< (-> self pos-oscillator target x) 409600.0) @@ -1735,27 +1728,24 @@ (ja :group! swamp-blimp-idle-ja) (loop (when (< 300 (-> self arm-timer)) - (set! (-> self arm-timer) (- (the-as time-frame (-> self arm-timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) + (set! (-> self arm-timer) + (- (the-as time-frame (-> self arm-timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) (if (>= 300 (-> self arm-timer)) (+! (-> self pos-oscillator target y) (* 16384.0 (-> *display* time-adjust-ratio))) ) ) (when (< 240 (-> self arm-timer)) - (set! (-> self arm-timer) (- (the-as time-frame (-> self arm-timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) + (set! (-> self arm-timer) + (- (the-as time-frame (-> self arm-timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) (if (>= 150 (-> self arm-timer)) (set! (-> self scale-oscillator target) 0.2) ) ) (when (> (-> self arm-timer) 0) - (set! (-> self arm-timer) (- (the-as time-frame (-> self arm-timer)) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) + (set! (-> self arm-timer) + (- (the-as time-frame (-> self arm-timer)) (- (current-time) (-> *display* old-base-frame-counter))) ) (when (<= (-> self arm-timer) 0) (set! (-> self scale-oscillator target) -0.2) @@ -1772,8 +1762,8 @@ ;; definition for method 11 of type swamp-blimp ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! swamp-blimp ((obj swamp-blimp) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! swamp-blimp ((this swamp-blimp) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -1791,44 +1781,44 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *swamp-blimp-sg* '()) - (quaternion-copy! (-> obj rot-at-init) (-> obj root-override quat)) - (set! (-> obj arm-timer) 0) - (set! (-> obj trans-at-init quad) (-> obj root-override trans quad)) - (set! (-> obj y-vel) 0.0) - (set! (-> obj y-offset) 0.0) - (set! (-> obj y-offset-target) 0.0) - (init! (-> obj main-tilt-rand) 300 900 0.05 0.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *swamp-blimp-sg* '()) + (quaternion-copy! (-> this rot-at-init) (-> this root-override quat)) + (set! (-> this arm-timer) 0) + (set! (-> this trans-at-init quad) (-> this root-override trans quad)) + (set! (-> this y-vel) 0.0) + (set! (-> this y-offset) 0.0) + (set! (-> this y-offset-target) 0.0) + (init! (-> this main-tilt-rand) 300 900 0.05 0.0) (let ((s5-1 (new 'stack-no-clear 'vector))) (set-vector! s5-1 0.0 1.0 0.0 1.0) - (init! (-> obj main-tilt-oscillator) s5-1 0.001 0.01 0.99) - (init! (-> obj gondola-tilt-oscillator) s5-1 0.001 0.01 0.99) + (init! (-> this main-tilt-oscillator) s5-1 0.001 0.01 0.99) + (init! (-> this gondola-tilt-oscillator) s5-1 0.001 0.01 0.99) ) - (init! (-> obj pos-rand) 1500 2400 20480.0 4096.0) - (init! (-> obj pos-oscillator) (the-as vector #f) 0.00032768 1638.4 0.995) - (init! (-> obj scale-rand) 1500 2400 0.02) - (init! (-> obj scale-oscillator) 0.0 0.002 0.015 0.99) + (init! (-> this pos-rand) 1500 2400 20480.0 4096.0) + (init! (-> this pos-oscillator) (the-as vector #f) 0.00032768 1638.4 0.995) + (init! (-> this scale-rand) 1500 2400 0.02) + (init! (-> this scale-oscillator) 0.0 0.002 0.015 0.99) (dotimes (v1-38 5) - (set! (-> obj the-ropes v1-38) (the-as handle #f)) + (set! (-> this the-ropes v1-38) (the-as handle #f)) ) - (let ((s5-2 (entity-actor-count (-> obj entity) 'alt-actor))) + (let ((s5-2 (entity-actor-count (-> this entity) 'alt-actor))) (dotimes (s4-1 s5-2) - (let ((s3-1 (entity-actor-lookup (-> obj entity) 'alt-actor s4-1))) + (let ((s3-1 (entity-actor-lookup (-> this entity) 'alt-actor s4-1))) (if s3-1 - (set! (-> obj the-ropes s4-1) - (ppointer->handle (process-spawn swamp-rope (-> obj trans-at-init) s3-1 :to obj)) + (set! (-> this the-ropes s4-1) + (ppointer->handle (process-spawn swamp-rope (-> this trans-at-init) s3-1 :to this)) ) ) ) ) ) - (set! (-> obj gondola) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) obj 5)) - (set! (-> obj bag) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) obj 3)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status bit-7) #t) + (set! (-> this gondola) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) this 5)) + (set! (-> this bag) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) this 3)) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status bit-7) #t) (swamp-blimp-setup) (go swamp-blimp-idle) (none) 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 be29b4b68d..83590cf481 100644 --- a/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/village2-obs_REF.gc @@ -12,12 +12,12 @@ ) ;; definition for method 3 of type village2cam -(defmethod inspect village2cam ((obj village2cam)) +(defmethod inspect village2cam ((this village2cam)) (let ((t9-0 (method-of-type pov-camera inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tseq: ~D~%" (-> obj seq)) - obj + (format #t "~T~Tseq: ~D~%" (-> this seq)) + this ) ;; failed to figure out what this is: @@ -27,8 +27,8 @@ ) ;; definition for method 29 of type village2cam -(defmethod set-stack-size! village2cam ((obj village2cam)) - (stack-size-set! (-> obj main-thread) 512) +(defmethod set-stack-size! village2cam ((this village2cam)) + (stack-size-set! (-> this main-thread) 512) (none) ) @@ -107,14 +107,14 @@ ) ;; definition for method 3 of type pontoon -(defmethod inspect pontoon ((obj pontoon)) +(defmethod inspect pontoon ((this pontoon)) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tanchor-point: #~%" (-> obj anchor-point)) - (format #t "~T~Ttask: ~D~%" (-> obj task)) - (format #t "~T~Talt-task: ~D~%" (-> obj alt-task)) - obj + (format #t "~T~Tanchor-point: #~%" (-> this anchor-point)) + (format #t "~T~Ttask: ~D~%" (-> this task)) + (format #t "~T~Talt-task: ~D~%" (-> this alt-task)) + this ) ;; failed to figure out what this is: @@ -178,26 +178,26 @@ ;; definition for method 11 of type pontoon ;; INFO: Return type mismatch int vs none. -(defmethod init-from-entity! pontoon ((obj pontoon) (arg0 entity-actor)) - (logior! (-> obj mask) (process-mask platform)) - (rigid-body-platform-method-30 obj) - (process-drawable-from-entity! obj arg0) - (rigid-body-platform-method-31 obj) - (set! (-> obj water-anim) #f) - (set! (-> obj root-overlay pause-adjust-distance) -122880.0) - (set! (-> obj task) (the-as uint (-> arg0 extra perm task))) - (set! (-> obj alt-task) (res-lump-value arg0 'alt-task uint)) +(defmethod init-from-entity! pontoon ((this pontoon) (arg0 entity-actor)) + (logior! (-> this mask) (process-mask platform)) + (rigid-body-platform-method-30 this) + (process-drawable-from-entity! this arg0) + (rigid-body-platform-method-31 this) + (set! (-> this water-anim) #f) + (set! (-> this root-overlay pause-adjust-distance) -122880.0) + (set! (-> this task) (the-as uint (-> arg0 extra perm task))) + (set! (-> this alt-task) (res-lump-value arg0 'alt-task uint)) (cond - ((and (nonzero? (-> obj alt-task)) - (task-closed? (the-as game-task (-> obj alt-task)) (task-status need-resolution)) + ((and (nonzero? (-> this alt-task)) + (task-closed? (the-as game-task (-> this alt-task)) (task-status need-resolution)) ) (go pontoon-die) ) - ((zero? (-> obj task)) - (go (method-of-object obj rigid-body-platform-idle)) + ((zero? (-> this task)) + (go (method-of-object this rigid-body-platform-idle)) ) - ((task-closed? (the-as game-task (-> obj task)) (task-status need-resolution)) - (go (method-of-object obj rigid-body-platform-idle)) + ((task-closed? (the-as game-task (-> this task)) (task-status need-resolution)) + (go (method-of-object this rigid-body-platform-idle)) ) (else (go pontoon-hidden) @@ -209,9 +209,9 @@ ;; definition for method 23 of type pontoon ;; INFO: Return type mismatch int vs none. -(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)) - (rigid-body-platform-method-27 obj (-> obj anchor-point)) +(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)) + (rigid-body-platform-method-27 this (-> this anchor-point)) 0 (none) ) @@ -280,11 +280,11 @@ ) ;; definition for method 3 of type pontoonfive -(defmethod inspect pontoonfive ((obj pontoonfive)) +(defmethod inspect pontoonfive ((this pontoonfive)) (let ((t9-0 (method-of-type pontoon inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type pontoonten @@ -297,11 +297,11 @@ ) ;; definition for method 3 of type pontoonten -(defmethod inspect pontoonten ((obj pontoonten)) +(defmethod inspect pontoonten ((this pontoonten)) (let ((t9-0 (method-of-type pontoon inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -320,8 +320,8 @@ ;; definition for method 30 of type pontoonfive ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 pontoonfive ((obj pontoonfive)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 pontoonfive ((this pontoonfive)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -339,7 +339,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -348,45 +348,45 @@ ;; definition for method 31 of type pontoonfive ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 pontoonfive ((obj pontoonfive)) - (initialize-skeleton obj *pontoonfive-sg* '()) - (rigid-body-platform-method-29 obj *pontoonfive-constants*) - (set! (-> obj float-height-offset) 6144.0) - (set! (-> obj root-overlay nav-radius) 12288.0) - (let ((v1-6 (-> obj control-point-array data))) +(defmethod rigid-body-platform-method-31 pontoonfive ((this pontoonfive)) + (initialize-skeleton this *pontoonfive-sg* '()) + (rigid-body-platform-method-29 this *pontoonfive-constants*) + (set! (-> this float-height-offset) 6144.0) + (set! (-> this root-overlay nav-radius) 12288.0) + (let ((v1-6 (-> this control-point-array data))) (set! (-> v1-6 0 local-pos x) 9216.0) (set! (-> v1-6 0 local-pos y) 0.0) (set! (-> v1-6 0 local-pos z) 12083.2) (set! (-> v1-6 0 local-pos w) 1.0) ) - (let ((v1-8 (-> obj control-point-array data 1))) + (let ((v1-8 (-> this control-point-array data 1))) (set! (-> v1-8 local-pos x) 9216.0) (set! (-> v1-8 local-pos y) 0.0) (set! (-> v1-8 local-pos z) -12083.2) (set! (-> v1-8 local-pos w) 1.0) ) - (let ((v1-10 (-> obj control-point-array data 2))) + (let ((v1-10 (-> this control-point-array data 2))) (set! (-> v1-10 local-pos x) -9216.0) (set! (-> v1-10 local-pos y) 0.0) (set! (-> v1-10 local-pos z) -12083.2) (set! (-> v1-10 local-pos w) 1.0) ) - (let ((v1-12 (-> obj control-point-array data 3))) + (let ((v1-12 (-> this control-point-array data 3))) (set! (-> v1-12 local-pos x) -9216.0) (set! (-> v1-12 local-pos y) 0.0) (set! (-> v1-12 local-pos z) 12083.2) (set! (-> v1-12 local-pos w) 1.0) ) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) - (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f)) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) + (nav-mesh-connect this (-> this root-overlay) (the-as nav-control #f)) 0 (none) ) ;; definition for method 30 of type pontoonten ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-30 pontoonten ((obj pontoonten)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod rigid-body-platform-method-30 pontoonten ((this pontoonten)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -404,7 +404,7 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-overlay) s5-0) + (set! (-> this root-overlay) s5-0) ) 0 (none) @@ -413,37 +413,37 @@ ;; definition for method 31 of type pontoonten ;; INFO: Used lq/sq ;; INFO: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-31 pontoonten ((obj pontoonten)) - (initialize-skeleton obj *pontoonten-sg* '()) - (rigid-body-platform-method-29 obj *pontoonten-constants*) - (set! (-> obj float-height-offset) 6144.0) - (set! (-> obj root-overlay nav-radius) 20480.0) - (let ((v1-6 (-> obj control-point-array data))) +(defmethod rigid-body-platform-method-31 pontoonten ((this pontoonten)) + (initialize-skeleton this *pontoonten-sg* '()) + (rigid-body-platform-method-29 this *pontoonten-constants*) + (set! (-> this float-height-offset) 6144.0) + (set! (-> this root-overlay nav-radius) 20480.0) + (let ((v1-6 (-> this control-point-array data))) (set! (-> v1-6 0 local-pos x) 17408.0) (set! (-> v1-6 0 local-pos y) 0.0) (set! (-> v1-6 0 local-pos z) 10035.2) (set! (-> v1-6 0 local-pos w) 1.0) ) - (let ((v1-8 (-> obj control-point-array data 1))) + (let ((v1-8 (-> this control-point-array data 1))) (set! (-> v1-8 local-pos x) 17408.0) (set! (-> v1-8 local-pos y) 0.0) (set! (-> v1-8 local-pos z) -10035.2) (set! (-> v1-8 local-pos w) 1.0) ) - (let ((v1-10 (-> obj control-point-array data 2))) + (let ((v1-10 (-> this control-point-array data 2))) (set! (-> v1-10 local-pos x) -17408.0) (set! (-> v1-10 local-pos y) 0.0) (set! (-> v1-10 local-pos z) -10035.2) (set! (-> v1-10 local-pos w) 1.0) ) - (let ((v1-12 (-> obj control-point-array data 3))) + (let ((v1-12 (-> this control-point-array data 3))) (set! (-> v1-12 local-pos x) -17408.0) (set! (-> v1-12 local-pos y) 0.0) (set! (-> v1-12 local-pos z) 10035.2) (set! (-> v1-12 local-pos w) 1.0) ) - (set! (-> obj anchor-point quad) (-> obj root-overlay trans quad)) - (nav-mesh-connect obj (-> obj root-overlay) (the-as nav-control #f)) + (set! (-> this anchor-point quad) (-> this root-overlay trans quad)) + (nav-mesh-connect this (-> this root-overlay) (the-as nav-control #f)) 0 (none) ) @@ -530,12 +530,12 @@ ) ;; definition for method 3 of type allpontoons -(defmethod inspect allpontoons ((obj allpontoons)) +(defmethod inspect allpontoons ((this allpontoons)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttask: ~D~%" (-> obj task)) - obj + (format #t "~T~Ttask: ~D~%" (-> this task)) + this ) ;; failed to figure out what this is: @@ -604,12 +604,12 @@ ;; definition for method 11 of type allpontoons ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! allpontoons ((obj allpontoons) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *allpontoons-sg* '()) - (set! (-> obj task) (the-as uint (-> arg0 extra perm task))) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 563) obj)) +(defmethod init-from-entity! allpontoons ((this allpontoons) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *allpontoons-sg* '()) + (set! (-> this task) (the-as uint (-> arg0 extra perm task))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 563) this)) (go allpontoons-idle) (none) ) @@ -632,13 +632,13 @@ ) ;; definition for method 3 of type fireboulder -(defmethod inspect fireboulder ((obj fireboulder)) +(defmethod inspect fireboulder ((this fireboulder)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Ttracker: ~D~%" (-> obj tracker)) - (format #t "~T~Ttask: ~D~%" (-> obj task)) - obj + (format #t "~T~Ttracker: ~D~%" (-> this tracker)) + (format #t "~T~Ttask: ~D~%" (-> this task)) + this ) ;; failed to figure out what this is: @@ -677,7 +677,7 @@ (cond ((handle->process (-> self tracker)) (let ((v1-6 (-> (the-as (pointer part-tracker) (-> self tracker process)) 0))) - (set! (-> v1-6 start-time) (-> *display* base-frame-counter)) + (set-time! (-> v1-6 start-time)) (set! v0-1 (-> v1-6 root trans)) ) (set! (-> (the-as vector v0-1) quad) (-> gp-0 quad)) @@ -803,9 +803,7 @@ ((zero? (-> self task)) ) ((handle->process (-> self tracker)) - (set! (-> (the-as (pointer part-tracker) (-> self tracker process)) 0 start-time) - (-> *display* base-frame-counter) - ) + (set-time! (-> (the-as (pointer part-tracker) (-> self tracker process)) 0 start-time)) ) (else (set! (-> self tracker) (ppointer->handle (process-spawn @@ -833,8 +831,8 @@ ;; definition for method 11 of type fireboulder ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! fireboulder ((obj fireboulder) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) +(defmethod init-from-entity! fireboulder ((this fireboulder) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind wall-object)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -863,26 +861,26 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (cond - ((name= (-> obj name) "fireboulder-6") - (quaternion-axis-angle! (-> obj root-override quat) 0.0 1.0 0.0 16384.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> obj root-override trans)) + ((name= (-> this name) "fireboulder-6") + (quaternion-axis-angle! (-> this root-override quat) 0.0 1.0 0.0 16384.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "rock-hover" :fo-max 30) (-> this root-override trans)) ) ) (else (fireboulder-disable-blocking-collision) ) ) - (initialize-skeleton obj *fireboulder-sg* '()) - (set! (-> obj tracker) (the-as handle #f)) - (set-vector! (-> obj draw color-emissive) 0.125 0.0625 0.0 0.0) - (set! (-> obj task) (the-as uint (-> arg0 extra perm task))) + (initialize-skeleton this *fireboulder-sg* '()) + (set! (-> this tracker) (the-as handle #f)) + (set-vector! (-> this draw color-emissive) 0.125 0.0625 0.0 0.0) + (set! (-> this task) (the-as uint (-> arg0 extra perm task))) (cond - ((zero? (-> obj task)) + ((zero? (-> this task)) (go fireboulder-idle) ) ((= (get-task-status (-> arg0 extra perm task)) (task-status invalid)) @@ -908,11 +906,11 @@ ) ;; definition for method 3 of type ceilingflag -(defmethod inspect ceilingflag ((obj ceilingflag)) +(defmethod inspect ceilingflag ((this ceilingflag)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -937,10 +935,10 @@ ;; definition for method 11 of type ceilingflag ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ceilingflag ((obj ceilingflag) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ceilingflag-sg* '()) +(defmethod init-from-entity! ceilingflag ((this ceilingflag) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ceilingflag-sg* '()) (go ceilingflag-idle) (none) ) @@ -964,13 +962,13 @@ ) ;; definition for method 3 of type exit-chamber-dummy -(defmethod inspect exit-chamber-dummy ((obj exit-chamber-dummy)) +(defmethod inspect exit-chamber-dummy ((this exit-chamber-dummy)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Torig-trans: #~%" (-> obj orig-trans)) - (format #t "~T~Tfcell-handle: ~D~%" (-> obj fcell-handle)) - obj + (format #t "~T~Torig-trans: #~%" (-> this orig-trans)) + (format #t "~T~Tfcell-handle: ~D~%" (-> this fcell-handle)) + this ) ;; failed to figure out what this is: @@ -980,7 +978,7 @@ ) ;; definition for method 20 of type exit-chamber-dummy -(defmethod skip-reminder? exit-chamber-dummy ((obj exit-chamber-dummy)) +(defmethod skip-reminder? exit-chamber-dummy ((this exit-chamber-dummy)) (case (get-reminder (get-task-control (game-task sunken-room)) 0) ((2) (let ((v1-4 (level-get *level* 'sunken))) @@ -1025,9 +1023,7 @@ (+! gp-0 1) ) (set! (-> self root trans y) - (+ (-> self orig-trans y) - (* 2252.8 (cos (* 36.40889 (the float (mod (-> *display* base-frame-counter) 1800))))) - ) + (+ (-> self orig-trans y) (* 2252.8 (cos (* 36.40889 (the float (mod (current-time) 1800)))))) ) (let ((a0-7 (handle->process (-> self fcell-handle)))) (when a0-7 @@ -1054,24 +1050,24 @@ ;; definition for method 11 of type exit-chamber-dummy ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! exit-chamber-dummy ((obj exit-chamber-dummy) (arg0 entity-actor)) - (set! (-> obj fcell-handle) (the-as handle #f)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (+! (-> obj root trans y) 24576.0) - (set! (-> obj orig-trans quad) (-> obj root trans quad)) - (initialize-skeleton obj *exit-chamber-dummy-sg* '()) +(defmethod init-from-entity! exit-chamber-dummy ((this exit-chamber-dummy) (arg0 entity-actor)) + (set! (-> this fcell-handle) (the-as handle #f)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (+! (-> this root trans y) 24576.0) + (set! (-> this orig-trans quad) (-> this root trans quad)) + (initialize-skeleton this *exit-chamber-dummy-sg* '()) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) - (logior! (-> obj draw status) (draw-status hidden)) + (logior! (-> this draw status) (draw-status hidden)) (go exit-chamber-dummy-wait-to-appear) (none) ) @@ -1091,12 +1087,12 @@ ) ;; definition for method 3 of type ogreboss-village2 -(defmethod inspect ogreboss-village2 ((obj ogreboss-village2)) +(defmethod inspect ogreboss-village2 ((this ogreboss-village2)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tboulder: ~D~%" (-> obj boulder)) - obj + (format #t "~T~Tboulder: ~D~%" (-> this boulder)) + this ) ;; failed to figure out what this is: @@ -1599,8 +1595,8 @@ (suspend) (ja :num! (seek! (ja-aframe 140.0 0))) ) - (let ((gp-2 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-2) (seconds 0.167)) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.167)) (suspend) ) ) @@ -1612,8 +1608,8 @@ (suspend) (ja :num! (seek! (ja-aframe 168.0 0))) ) - (let ((gp-5 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-5) (seconds 0.167)) + (let ((gp-5 (current-time))) + (until (time-elapsed? gp-5 (seconds 0.167)) (suspend) ) ) @@ -1663,8 +1659,8 @@ ;; definition for method 11 of type ogreboss-village2 ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! ogreboss-village2 ((obj ogreboss-village2) (arg0 entity-actor)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! ogreboss-village2 ((this ogreboss-village2) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s3-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s3-0 collide-with) (collide-kind target)) @@ -1682,15 +1678,15 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *ogreboss-village2-sg* '()) - (set-vector! (-> obj root scale) 0.65 0.65 0.65 1.0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *ogreboss-village2-sg* '()) + (set-vector! (-> this root scale) 0.65 0.65 0.65 1.0) (transform-post) - (set! (-> obj root pause-adjust-distance) 122880.0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj boulder) (the-as handle #f)) + (set! (-> this root pause-adjust-distance) 122880.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this boulder) (the-as handle #f)) (go ogreboss-village2-idle) (none) ) @@ -1705,11 +1701,11 @@ ) ;; definition for method 3 of type villageb-ogreboss -(defmethod inspect villageb-ogreboss ((obj villageb-ogreboss)) +(defmethod inspect villageb-ogreboss ((this villageb-ogreboss)) (let ((t9-0 (method-of-type ogreboss-village2 inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition of type villageb-water @@ -1722,11 +1718,11 @@ ) ;; definition for method 3 of type villageb-water -(defmethod inspect villageb-water ((obj villageb-water)) +(defmethod inspect villageb-water ((this villageb-water)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for symbol ripple-for-villageb-water, type ripple-wave-set @@ -1745,13 +1741,13 @@ ;; definition for method 22 of type villageb-water ;; INFO: Return type mismatch ripple-wave-set vs none. -(defmethod water-vol-method-22 villageb-water ((obj villageb-water)) +(defmethod water-vol-method-22 villageb-water ((this villageb-water)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) diff --git a/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc b/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc index 2ea3943ba9..218a1ccaec 100644 --- a/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/village2-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type villageb-part -(defmethod inspect villageb-part ((obj villageb-part)) +(defmethod inspect villageb-part ((this villageb-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc b/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc index 6e67c7442e..47fe04b0f4 100644 --- a/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc +++ b/test/decompiler/reference/jak1/levels/village2/warrior_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type warrior -(defmethod inspect warrior ((obj warrior)) +(defmethod inspect warrior ((this warrior)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -27,10 +27,10 @@ ;; definition for method 52 of type warrior ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-52 warrior ((obj warrior)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 warrior ((this warrior)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -45,21 +45,21 @@ ;; definition for method 48 of type warrior ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow warrior ((obj warrior)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow warrior ((this warrior)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -69,13 +69,13 @@ ) ;; definition for method 32 of type warrior -(defmethod play-anim! warrior ((obj warrior) (arg0 symbol)) +(defmethod play-anim! warrior ((this warrior) (arg0 symbol)) (with-pp - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "warrior-introduction" @@ -96,24 +96,24 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (new 'static 'spool-anim :name "warrior-reminder-1" :index 7 :parts 3 :command-list '()) ) (((task-status need-reward-speech)) (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) - (send-event (-> (entity-by-type allpontoons) extra process) 'clone (process->handle obj)) - (dotimes (s5-2 (entity-actor-count (-> obj entity) 'alt-actor)) - (entity-birth-no-kill (entity-actor-lookup (-> obj entity) 'alt-actor s5-2)) + (send-event (-> (entity-by-type allpontoons) extra process) 'clone (process->handle this)) + (dotimes (s5-2 (entity-actor-count (-> this entity) 'alt-actor)) + (entity-birth-no-kill (entity-actor-lookup (-> this entity) 'alt-actor s5-2)) (let ((s4-2 (new 'stack-no-clear 'event-message-block))) (set! (-> s4-2 from) pp) (set! (-> s4-2 num-params) 0) (set! (-> s4-2 message) 'die) (let ((s3-0 send-event-function) - (v1-25 (entity-actor-lookup (-> obj entity) 'alt-actor s5-2)) + (v1-25 (entity-actor-lookup (-> this entity) 'alt-actor s5-2)) ) (s3-0 (if v1-25 @@ -126,8 +126,8 @@ ) ) (else - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this will-talk) #t) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (new 'static 'spool-anim @@ -142,19 +142,19 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ) ) ) ;; definition for method 31 of type warrior -(defmethod get-art-elem warrior ((obj warrior)) - (-> obj draw art-group data 5) +(defmethod get-art-elem warrior ((this warrior)) + (-> this draw art-group data 5) ) ;; failed to figure out what this is: @@ -167,18 +167,18 @@ ) ;; definition for method 43 of type warrior -(defmethod process-taskable-method-43 warrior ((obj warrior)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 2) 61440.0 obj) +(defmethod process-taskable-method-43 warrior ((this warrior)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 2) 61440.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.66 f0-2) - (play-ambient (-> obj ambient) "WAR-LO1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1A" #f (-> this root-override trans)) ) ((< 0.33 f0-2) - (play-ambient (-> obj ambient) "WAR-LO1B" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1B" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "WAR-LO1C" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "WAR-LO1C" #f (-> this root-override trans)) ) ) ) @@ -187,8 +187,8 @@ ;; definition for method 41 of type warrior ;; INFO: Return type mismatch int vs none. -(defmethod initialize-collision warrior ((obj warrior) (arg0 int) (arg1 vector)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod initialize-collision warrior ((this warrior) (arg0 int) (arg1 vector)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s4-0 prim-core collide-as) (collide-kind enemy)) (set! (-> s4-0 collide-with) (collide-kind target)) @@ -215,18 +215,18 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) ) 0 (none) ) ;; definition for method 11 of type warrior -(defmethod init-from-entity! warrior ((obj warrior) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *warrior-sg* 3 33 (new 'static 'vector :y -4096.0 :w 10240.0) 5) - (set! (-> obj tasks) (get-task-control (game-task village2-warrior-money))) - (set! (-> obj sound-flava) (music-flava warrior)) - (set! (-> obj draw light-index) (the-as uint 3)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! warrior ((this warrior) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *warrior-sg* 3 33 (new 'static 'vector :y -4096.0 :w 10240.0) 5) + (set! (-> this tasks) (get-task-control (game-task village2-warrior-money))) + (set! (-> this sound-flava) (music-flava warrior)) + (set! (-> this draw light-index) (the-as uint 3)) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc b/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc index fda9587c59..23196bf35e 100644 --- a/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/assistant-village3_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type assistant-villagec -(defmethod inspect assistant-villagec ((obj assistant-villagec)) +(defmethod inspect assistant-villagec ((this assistant-villagec)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -27,10 +27,10 @@ ;; definition for method 52 of type assistant-villagec ;; INFO: Return type mismatch int vs none. -(defmethod process-taskable-method-52 assistant-villagec ((obj assistant-villagec)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 assistant-villagec ((this assistant-villagec)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -2048.0 f0-0))) ) @@ -45,21 +45,21 @@ ;; definition for method 48 of type assistant-villagec ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow assistant-villagec ((obj assistant-villagec)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow assistant-villagec ((this assistant-villagec)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -69,19 +69,19 @@ ) ;; definition for method 32 of type assistant-villagec -(defmethod play-anim! assistant-villagec ((obj assistant-villagec) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk-to-assistant)) +(defmethod play-anim! assistant-villagec ((this assistant-villagec) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk-to-assistant)) (cond ((= (get-task-status (game-task finalboss-movies)) (task-status need-introduction)) (if arg0 (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) (else (new 'static 'spool-anim :name "assistant-village3-reminder" :index 4 :parts 3 :command-list '()) @@ -90,58 +90,58 @@ ) ;; definition for method 31 of type assistant-villagec -(defmethod get-art-elem assistant-villagec ((obj assistant-villagec)) - (-> obj draw art-group data 3) +(defmethod get-art-elem assistant-villagec ((this assistant-villagec)) + (-> this draw art-group data 3) ) ;; definition for method 39 of type assistant-villagec -(defmethod should-display? assistant-villagec ((obj assistant-villagec)) +(defmethod should-display? assistant-villagec ((this assistant-villagec)) (and (task-closed? (game-task village3-button) (task-status need-introduction)) (not (sages-kidnapped?))) ) ;; definition for method 47 of type assistant-villagec ;; INFO: Return type mismatch basic vs symbol. -(defmethod target-above-threshold? assistant-villagec ((obj assistant-villagec)) +(defmethod target-above-threshold? assistant-villagec ((this assistant-villagec)) (the-as symbol (and *target* (< (-> (target-pos 0) z) -14245888.0))) ) ;; definition for method 43 of type assistant-villagec -(defmethod process-taskable-method-43 assistant-villagec ((obj assistant-villagec)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 assistant-villagec ((this assistant-villagec)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.85714287 f0-2) - (play-ambient (-> obj ambient) "ASSTLP31" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP31" #f (-> this root-override trans)) ) ((< 0.71428573 f0-2) - (play-ambient (-> obj ambient) "ASSTLP32" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP32" #f (-> this root-override trans)) ) ((< 0.5714286 f0-2) - (play-ambient (-> obj ambient) "ASSTLP33" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP33" #f (-> this root-override trans)) ) ((< 0.42857143 f0-2) (let ((v1-16 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-16 (task-status need-reward-speech)) (= v1-16 (task-status invalid)))) - (play-ambient (-> obj ambient) "ASSTLP34" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP34" #f (-> this root-override trans)) ) ) ) ((< 0.2857143 f0-2) (let ((v1-21 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-21 (task-status need-reward-speech)) (= v1-21 (task-status invalid)))) - (play-ambient (-> obj ambient) "ASSTLP35" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP35" #f (-> this root-override trans)) ) ) ) ((< 0.14285715 f0-2) (let ((v1-26 (get-task-status (game-task lavatube-end)))) (if (not (or (= v1-26 (task-status need-reward-speech)) (= v1-26 (task-status invalid)))) - (play-ambient (-> obj ambient) "ASSTLP36" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP36" #f (-> this root-override trans)) ) ) ) ((nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> obj ambient) "ASSTLP37" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "ASSTLP37" #f (-> this root-override trans)) ) ) ) @@ -162,8 +162,8 @@ (suspend) (ja :num! (seek!)) ) - (let ((gp-0 (-> *display* base-frame-counter))) - (while (let ((s5-0 (-> *display* base-frame-counter)) + (let ((gp-0 (current-time))) + (while (let ((s5-0 (current-time)) (f30-0 300.0) (f28-0 0.16) (f26-0 0.17000002) @@ -178,8 +178,8 @@ (suspend) (ja :num! (seek! (ja-aframe 0.0 0))) ) - (let ((gp-3 (-> *display* base-frame-counter))) - (while (let ((s5-1 (-> *display* base-frame-counter)) + (let ((gp-3 (current-time))) + (while (let ((s5-1 (current-time)) (f30-1 300.0) (f28-1 0.16) (f26-1 0.17000002) @@ -194,9 +194,9 @@ ) ;; definition for method 11 of type assistant-villagec -(defmethod init-from-entity! assistant-villagec ((obj assistant-villagec) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *assistant-village3-sg* 3 31 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task assistant-village3))) - (process-taskable-method-42 obj) +(defmethod init-from-entity! assistant-villagec ((this assistant-villagec) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *assistant-village3-sg* 3 31 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task assistant-village3))) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc b/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc index a49f8504b8..51d36478b0 100644 --- a/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/minecart_REF.gc @@ -27,14 +27,14 @@ ) ;; definition for method 3 of type minecartsteel -(defmethod inspect minecartsteel ((obj minecartsteel)) +(defmethod inspect minecartsteel ((this minecartsteel)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tindex: ~D~%" (-> obj index)) - (format #t "~T~Tanim: ~A~%" (-> obj anim)) - (format #t "~T~Tsync: #~%" (-> obj sync)) - obj + (format #t "~T~Tindex: ~D~%" (-> this index)) + (format #t "~T~Tanim: ~A~%" (-> this anim)) + (format #t "~T~Tsync: #~%" (-> this sync)) + this ) ;; failed to figure out what this is: @@ -142,14 +142,14 @@ ;; definition for method 11 of type minecartsteel ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! minecartsteel ((obj minecartsteel) (arg0 entity-actor)) +(defmethod init-from-entity! minecartsteel ((this minecartsteel) (arg0 entity-actor)) (dotimes (s4-0 4) (process-spawn minecartsteel :init minecartsteel-initialize-by-other arg0 (* 0.2 (the float (+ s4-0 1))) - :to obj + :to this ) ) (minecartsteel-initialize-by-other arg0 0.0) diff --git a/test/decompiler/reference/jak1/levels/village3/miners_REF.gc b/test/decompiler/reference/jak1/levels/village3/miners_REF.gc index 7fe31f8ff9..fe340873c0 100644 --- a/test/decompiler/reference/jak1/levels/village3/miners_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/miners_REF.gc @@ -29,11 +29,11 @@ ) ;; definition for method 3 of type minertall -(defmethod inspect minertall ((obj minertall)) +(defmethod inspect minertall ((this minertall)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -45,10 +45,10 @@ ;; definition for method 52 of type minertall ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 minertall ((obj minertall)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 minertall ((this minertall)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -66,21 +66,21 @@ ;; definition for method 48 of type minertall ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow minertall ((obj minertall)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow minertall ((this minertall)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -91,23 +91,23 @@ ;; definition for method 32 of type minertall ;; INFO: Return type mismatch art-element vs basic. -(defmethod play-anim! minertall ((obj minertall) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (current-status (-> obj tasks)) +(defmethod play-anim! minertall ((this minertall) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (current-status (-> this tasks)) (if arg0 (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (the-as basic (-> obj draw art-group data 3)) + (the-as basic (-> this draw art-group data 3)) ) ;; definition for method 31 of type minertall -(defmethod get-art-elem minertall ((obj minertall)) - (-> obj draw art-group data 3) +(defmethod get-art-elem minertall ((this minertall)) + (-> this draw art-group data 3) ) ;; failed to figure out what this is: @@ -121,11 +121,11 @@ ) ;; definition for method 11 of type minertall -(defmethod init-from-entity! minertall ((obj minertall) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *minertall-sg* 32 47 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj tasks) (get-task-control (game-task village3-miner-money1))) - (set! (-> obj draw light-index) (the-as uint 1)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! minertall ((this minertall) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *minertall-sg* 32 47 (new 'static 'vector :w 4096.0) 5) + (set! (-> this tasks) (get-task-control (game-task village3-miner-money1))) + (set! (-> this draw light-index) (the-as uint 1)) + (process-taskable-method-42 this) (none) ) @@ -140,12 +140,12 @@ ) ;; definition for method 3 of type minershort -(defmethod inspect minershort ((obj minershort)) +(defmethod inspect minershort ((this minershort)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tother-miner: ~A~%" (-> obj other-miner)) - obj + (format #t "~T~Tother-miner: ~A~%" (-> this other-miner)) + this ) ;; failed to figure out what this is: @@ -242,10 +242,10 @@ ;; definition for method 52 of type minershort ;; INFO: Return type mismatch shadow-flags vs none. -(defmethod process-taskable-method-52 minershort ((obj minershort)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-52 minershort ((this minershort)) + (let ((v1-1 (-> this draw shadow-ctrl))) (when v1-1 - (let ((f0-0 (-> obj root-override trans y))) + (let ((f0-0 (-> this root-override trans y))) (let ((a0-2 v1-1)) (set! (-> a0-2 settings bot-plane w) (- (+ -4096.0 f0-0))) ) @@ -263,21 +263,21 @@ ;; definition for method 48 of type minershort ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow minershort ((obj minershort)) - (-> obj draw shadow-ctrl) +(defmethod draw-npc-shadow minershort ((this minershort)) + (-> this draw shadow-ctrl) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) - (let ((v1-9 (-> obj draw shadow-ctrl))) + (let ((v1-9 (-> this draw shadow-ctrl))) (logclear! (-> v1-9 settings flags) (shadow-flags disable-draw)) ) 0 - (update-direction-from-time-of-day (-> obj draw shadow-ctrl)) + (update-direction-from-time-of-day (-> this draw shadow-ctrl)) ) (else - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logior! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 @@ -294,22 +294,22 @@ ) ;; definition for method 32 of type minershort -(defmethod play-anim! minershort ((obj minershort) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! minershort ((this minershort) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task village3-miner-money1)) (when arg0 - (let* ((s5-1 (-> obj tasks)) + (let* ((s5-1 (-> this tasks)) (s4-0 (method-of-object s5-1 save-reminder)) ) (s4-0 s5-1 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) (close-specific-task! (game-task village3-miner-money1) (task-status need-introduction)) (close-specific-task! (game-task village3-miner-money2) (task-status need-introduction)) (close-specific-task! (game-task village3-miner-money3) (task-status need-introduction)) @@ -334,13 +334,13 @@ ) (((game-task cave-gnawers)) (when arg0 - (let* ((s5-2 (-> obj tasks)) + (let* ((s5-2 (-> this tasks)) (s4-1 (method-of-object s5-2 save-reminder)) ) (s4-1 s5-2 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (close-status! (-> obj tasks) (task-status need-introduction)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "minershort-introduction-gnawers" @@ -359,8 +359,8 @@ ) (else (when arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (close-status! (-> obj tasks) (task-status need-introduction)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "minershort-introduction-switch" @@ -372,8 +372,8 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-2 (+ (get-reminder (-> obj tasks) 0) 1))) + (set! (-> this skippable) #t) + (let ((s4-2 (+ (get-reminder (-> this tasks) 0) 1))) (if (< (the-as uint 3) (the-as uint s4-2)) (set! s4-2 0) ) @@ -414,7 +414,7 @@ ) ) (if arg0 - (save-reminder (-> obj tasks) s4-2 0) + (save-reminder (-> this tasks) s4-2 0) ) (cond ((zero? s4-2) @@ -422,19 +422,19 @@ ) ((= s4-2 1) (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "minershort-reminder-1-gnawers" :index 10 :parts 3 :command-list '()) ) ((= s4-2 2) (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "minershort-reminder-2-orbs" :index 6 :parts 2 :command-list '()) ) (else (if arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) ) (new 'static 'spool-anim :name "minershort-reminder-1-switch" @@ -447,18 +447,18 @@ ) ) (((task-status need-reward-speech)) - (let ((s4-3 (get-reminder (-> obj tasks) 2))) + (let ((s4-3 (get-reminder (-> this tasks) 2))) (cond (arg0 - (send-event (-> obj other-miner ppointer 3) 'clone (process->handle obj)) - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (send-event (-> this other-miner ppointer 3) 'clone (process->handle this)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-task-inc))) - (save-reminder (-> obj tasks) (+ s4-3 1) 2) + (save-reminder (-> this tasks) (+ s4-3 1) 2) ) (else - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (text-id press-to-trade-money)) + (set! (-> this will-talk) #t) + (set! (-> this talk-message) (text-id press-to-trade-money)) ) ) (if (< (the-as uint s4-3) (the-as uint 3)) @@ -477,11 +477,11 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) @@ -496,101 +496,101 @@ ) ;; definition for method 31 of type minershort -(defmethod get-art-elem minershort ((obj minershort)) - (-> obj draw art-group data 3) +(defmethod get-art-elem minershort ((this minershort)) + (-> this draw art-group data 3) ) ;; definition for method 43 of type minershort -(defmethod process-taskable-method-43 minershort ((obj minershort)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 minershort ((this minershort)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.9655172 f0-2) - (play-ambient (-> obj ambient) "MIN-LO01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MIN-LO01" #f (-> this root-override trans)) ) ((< 0.9310345 f0-2) - (play-ambient (-> obj ambient) "MIN-LO03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MIN-LO03" #f (-> this root-override trans)) ) ((< 0.8965517 f0-2) - (play-ambient (-> obj ambient) "MIN-LO04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MIN-LO04" #f (-> this root-override trans)) ) ((< 0.86206895 f0-2) - (play-ambient (-> obj ambient) "MIN-LO05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MIN-LO05" #f (-> this root-override trans)) ) ((< 0.82758623 f0-2) - (play-ambient (-> obj ambient) "MIN-LO06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MIN-LO06" #f (-> this root-override trans)) ) ((< 0.79310346 f0-2) - (play-ambient (-> obj ambient) "MSH-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM01" #f (-> this root-override trans)) ) ((< 0.7586207 f0-2) - (play-ambient (-> obj ambient) "MSH-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM02" #f (-> this root-override trans)) ) ((< 0.7241379 f0-2) - (play-ambient (-> obj ambient) "MSH-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM03" #f (-> this root-override trans)) ) ((< 0.6896552 f0-2) - (play-ambient (-> obj ambient) "MSH-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM04" #f (-> this root-override trans)) ) ((< 0.6551724 f0-2) - (play-ambient (-> obj ambient) "MSH-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM05" #f (-> this root-override trans)) ) ((< 0.62068963 f0-2) - (play-ambient (-> obj ambient) "MSH-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM06" #f (-> this root-override trans)) ) ((< 0.5862069 f0-2) - (play-ambient (-> obj ambient) "MSH-AM07" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM07" #f (-> this root-override trans)) ) ((< 0.55172414 f0-2) - (play-ambient (-> obj ambient) "MSH-AM08" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM08" #f (-> this root-override trans)) ) ((< 0.51724136 f0-2) - (play-ambient (-> obj ambient) "MSH-AM09" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM09" #f (-> this root-override trans)) ) ((< 0.4827586 f0-2) - (play-ambient (-> obj ambient) "MSH-AM10" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM10" #f (-> this root-override trans)) ) ((< 0.44827586 f0-2) - (play-ambient (-> obj ambient) "MSH-AM11" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM11" #f (-> this root-override trans)) ) ((< 0.41379312 f0-2) - (play-ambient (-> obj ambient) "MSH-AM12" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM12" #f (-> this root-override trans)) ) ((< 0.37931034 f0-2) - (play-ambient (-> obj ambient) "MSH-AM1A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM1A" #f (-> this root-override trans)) ) ((< 0.3448276 f0-2) - (play-ambient (-> obj ambient) "MSH-AM2A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM2A" #f (-> this root-override trans)) ) ((< 0.31034482 f0-2) - (play-ambient (-> obj ambient) "MSH-AM3A" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MSH-AM3A" #f (-> this root-override trans)) ) ((< 0.27586207 f0-2) - (play-ambient (-> obj ambient) "MTA-AM01" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM01" #f (-> this root-override trans)) ) ((< 0.2413793 f0-2) - (play-ambient (-> obj ambient) "MTA-AM02" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM02" #f (-> this root-override trans)) ) ((< 0.20689656 f0-2) - (play-ambient (-> obj ambient) "MTA-AM03" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM03" #f (-> this root-override trans)) ) ((< 0.1724138 f0-2) - (play-ambient (-> obj ambient) "MTA-AM04" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM04" #f (-> this root-override trans)) ) ((< 0.13793103 f0-2) - (play-ambient (-> obj ambient) "MTA-AM05" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM05" #f (-> this root-override trans)) ) ((< 0.10344828 f0-2) - (play-ambient (-> obj ambient) "MTA-AM06" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM06" #f (-> this root-override trans)) ) ((< 0.06896552 f0-2) - (play-ambient (-> obj ambient) "MTA-AM07" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM07" #f (-> this root-override trans)) ) ((< 0.03448276 f0-2) - (play-ambient (-> obj ambient) "MTA-AM08" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM08" #f (-> this root-override trans)) ) (else - (play-ambient (-> obj ambient) "MTA-AM09" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "MTA-AM09" #f (-> this root-override trans)) ) ) ) @@ -604,15 +604,15 @@ ) ;; definition for method 11 of type minershort -(defmethod init-from-entity! minershort ((obj minershort) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *minershort-sg* 34 46 (new 'static 'vector :w 4096.0) 5) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 566) obj)) - (set! (-> obj tasks) (get-task-control (game-task village3-miner-money1))) - (set! (-> obj other-miner) (the-as minertall (entity-actor-lookup arg0 'alt-actor 0))) - (set! (-> obj cur-trans-hook) minershort-trans-hook) - (set! (-> obj sound-flava) (music-flava miners)) - (set! (-> obj draw light-index) (the-as uint 1)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! minershort ((this minershort) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *minershort-sg* 34 46 (new 'static 'vector :w 4096.0) 5) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 566) this)) + (set! (-> this tasks) (get-task-control (game-task village3-miner-money1))) + (set! (-> this other-miner) (the-as minertall (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this cur-trans-hook) minershort-trans-hook) + (set! (-> this sound-flava) (music-flava miners)) + (set! (-> this draw light-index) (the-as uint 1)) + (process-taskable-method-42 this) (none) ) @@ -629,11 +629,11 @@ ) ;; definition for method 3 of type cavegem -(defmethod inspect cavegem ((obj cavegem)) +(defmethod inspect cavegem ((this cavegem)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -659,14 +659,10 @@ ;; definition for method 11 of type cavegem ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! cavegem ((obj cavegem) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *cavegem-sg* '()) - (go (method-of-object obj idle)) +(defmethod init-from-entity! cavegem ((this cavegem) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *cavegem-sg* '()) + (go (method-of-object this idle)) (none) ) - - - - diff --git a/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc b/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc index 4fa614c4c4..4cc56ce96d 100644 --- a/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/sage-village3_REF.gc @@ -14,14 +14,14 @@ ) ;; definition for method 3 of type sage-villagec -(defmethod inspect sage-villagec ((obj sage-villagec)) +(defmethod inspect sage-villagec ((this sage-villagec)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tevilbro: ~D~%" (-> obj evilbro)) - (format #t "~T~Tevilsis: ~D~%" (-> obj evilsis)) - (format #t "~T~Tassistant: ~A~%" (-> obj assistant)) - obj + (format #t "~T~Tevilbro: ~D~%" (-> this evilbro)) + (format #t "~T~Tevilsis: ~D~%" (-> this evilsis)) + (format #t "~T~Tassistant: ~A~%" (-> this assistant)) + this ) ;; failed to figure out what this is: @@ -46,35 +46,35 @@ ) ;; definition for method 32 of type sage-villagec -(defmethod play-anim! sage-villagec ((obj sage-villagec) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk-to-sage)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! sage-villagec ((this sage-villagec) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk-to-sage)) + (case (current-status (-> this tasks)) (((task-status unknown) (task-status need-hint) (task-status need-introduction)) (if (not arg0) - (set! (-> obj will-talk) #t) + (set! (-> this will-talk) #t) ) - (case (current-task (-> obj tasks)) + (case (current-task (-> this tasks)) (((game-task village3-button)) (when arg0 - (close-status! (-> obj tasks) (task-status need-introduction)) - (send-event (-> obj assistant extra process) 'clone (process->handle obj)) - (set! (-> obj evilbro) + (close-status! (-> this tasks) (task-status need-introduction)) + (send-event (-> this assistant extra process) 'clone (process->handle this)) + (set! (-> this evilbro) (ppointer->handle - (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilbro-village3-sg* #f :to obj) + (manipy-spawn (-> this root-override trans) (-> this entity) *evilbro-village3-sg* #f :to this) ) ) - (send-event (handle->process (-> obj evilbro)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilbro)) 'blend-shape #t) - (send-event (handle->process (-> obj evilbro)) 'center-joint 3) - (set! (-> obj evilsis) + (send-event (handle->process (-> this evilbro)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this evilbro)) 'blend-shape #t) + (send-event (handle->process (-> this evilbro)) 'center-joint 3) + (set! (-> this evilsis) (ppointer->handle - (manipy-spawn (-> obj root-override trans) (-> obj entity) *evilsis-village3-sg* #f :to obj) + (manipy-spawn (-> this root-override trans) (-> this entity) *evilsis-village3-sg* #f :to this) ) ) - (send-event (handle->process (-> obj evilsis)) 'anim-mode 'clone-anim) - (send-event (handle->process (-> obj evilsis)) 'blend-shape #t) - (send-event (handle->process (-> obj evilsis)) 'center-joint 3) - (set! (-> obj draw bounds w) 40960.0) + (send-event (handle->process (-> this evilsis)) 'anim-mode 'clone-anim) + (send-event (handle->process (-> this evilsis)) 'blend-shape #t) + (send-event (handle->process (-> this evilsis)) 'center-joint 3) + (set! (-> this draw bounds w) 40960.0) ) (new 'static 'spool-anim :name "sage-village3-introduction" @@ -115,12 +115,12 @@ ) (((game-task cave-dark-crystals)) (when arg0 - (let* ((s5-3 (-> obj tasks)) + (let* ((s5-3 (-> this tasks)) (s4-0 (method-of-object s5-3 save-reminder)) ) (s4-0 s5-3 (the int (the-as float (send-event *target* 'query 'pickup (pickup-type fuel-cell)))) 1) ) - (close-status! (-> obj tasks) (task-status need-introduction)) + (close-status! (-> this tasks) (task-status need-introduction)) ) (new 'static 'spool-anim :name "sage-village3-introduction-dark-eco" @@ -143,8 +143,8 @@ ) ) (((task-status need-reminder-a) (task-status need-reminder)) - (set! (-> obj skippable) #t) - (let ((s4-1 (+ (get-reminder (-> obj tasks) 0) 1))) + (set! (-> this skippable) #t) + (let ((s4-1 (+ (get-reminder (-> this tasks) 0) 1))) (if (< (the-as uint 1) (the-as uint s4-1)) (set! s4-1 0) ) @@ -166,7 +166,7 @@ ) ) (if arg0 - (save-reminder (-> obj tasks) s4-1 0) + (save-reminder (-> this tasks) s4-1 0) ) (if (zero? s4-1) (new 'static 'spool-anim :name "sage-village3-reminder-1-dark-eco" :index 5 :parts 2 :command-list '()) @@ -179,60 +179,60 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (get-art-elem obj) + (get-art-elem this) ) ) ) ;; definition for method 31 of type sage-villagec -(defmethod get-art-elem sage-villagec ((obj sage-villagec)) - (-> obj draw art-group data 3) +(defmethod get-art-elem sage-villagec ((this sage-villagec)) + (-> this draw art-group data 3) ) ;; definition for method 47 of type sage-villagec ;; INFO: Return type mismatch basic vs symbol. -(defmethod target-above-threshold? sage-villagec ((obj sage-villagec)) +(defmethod target-above-threshold? sage-villagec ((this sage-villagec)) (the-as symbol (and *target* (< (-> (target-pos 0) x) 4575232.0) (< -14323302.0 (-> (target-pos 0) z)))) ) ;; definition for method 43 of type sage-villagec -(defmethod process-taskable-method-43 sage-villagec ((obj sage-villagec)) - (when (ambient-control-method-10 (-> obj ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 obj) +(defmethod process-taskable-method-43 sage-villagec ((this sage-villagec)) + (when (ambient-control-method-10 (-> this ambient) (new 'stack-no-clear 'vector) (seconds 30) 122880.0 this) (let ((f0-2 (rand-float-gen))) (cond ((< 0.875 f0-2) - (play-ambient (-> obj ambient) "SAGELP31" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP31" #f (-> this root-override trans)) ) ((< 0.75 f0-2) - (if (not (closed? (-> obj tasks) (game-task cave-dark-crystals) (task-status need-reminder))) - (play-ambient (-> obj ambient) "SAGELP32" #f (-> obj root-override trans)) + (if (not (closed? (-> this tasks) (game-task cave-dark-crystals) (task-status need-reminder))) + (play-ambient (-> this ambient) "SAGELP32" #f (-> this root-override trans)) ) ) ((< 0.625 f0-2) (if (nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> obj ambient) "SAGELP33" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP33" #f (-> this root-override trans)) ) ) ((< 0.5 f0-2) - (play-ambient (-> obj ambient) "SAGELP34" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP34" #f (-> this root-override trans)) ) ((< 0.375 f0-2) - (play-ambient (-> obj ambient) "SAGELP35" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP35" #f (-> this root-override trans)) ) ((< 0.25 f0-2) - (play-ambient (-> obj ambient) "SAGELP36" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP36" #f (-> this root-override trans)) ) ((< 0.125 f0-2) (if (nonzero? (get-task-status (game-task citadel-sage-green))) - (play-ambient (-> obj ambient) "SAGELP37" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP37" #f (-> this root-override trans)) ) ) ((!= (get-task-status (game-task citadel-sage-green)) (task-status need-resolution)) - (play-ambient (-> obj ambient) "SAGELP38" #f (-> obj root-override trans)) + (play-ambient (-> this ambient) "SAGELP38" #f (-> this root-override trans)) ) ) ) @@ -273,14 +273,14 @@ ) ;; definition for method 39 of type sage-villagec -(defmethod should-display? sage-villagec ((obj sage-villagec)) +(defmethod should-display? sage-villagec ((this sage-villagec)) (cond - ((not (closed? (-> obj tasks) (game-task village3-button) (task-status need-hint))) - (process-taskable-method-33 obj) + ((not (closed? (-> this tasks) (game-task village3-button) (task-status need-hint))) + (process-taskable-method-33 this) #f ) ((sages-kidnapped?) - (process-taskable-method-33 obj) + (process-taskable-method-33 this) #f ) (else @@ -291,12 +291,12 @@ ;; definition for method 48 of type sage-villagec ;; INFO: Return type mismatch object vs none. -(defmethod draw-npc-shadow sage-villagec ((obj sage-villagec)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod draw-npc-shadow sage-villagec ((this sage-villagec)) + (let ((v1-1 (-> this draw shadow-ctrl))) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-status was-drawn)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-status was-drawn)) ) (logclear! (-> v1-1 settings flags) (shadow-flags shdf03)) (logclear! (-> v1-1 settings flags) (shadow-flags shdf02)) @@ -317,13 +317,13 @@ ) ;; definition for method 11 of type sage-villagec -(defmethod init-from-entity! sage-villagec ((obj sage-villagec) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *sage-village3-sg* 3 40 (new 'static 'vector :w 8192.0) 5) - (set! (-> obj tasks) (get-task-control (game-task cave-dark-crystals))) - (set! (-> obj assistant) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj evilbro) (the-as handle #f)) - (set! (-> obj evilsis) (the-as handle #f)) - (set! (-> obj sound-flava) (music-flava sage)) - (process-taskable-method-42 obj) +(defmethod init-from-entity! sage-villagec ((this sage-villagec) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *sage-village3-sg* 3 40 (new 'static 'vector :w 8192.0) 5) + (set! (-> this tasks) (get-task-control (game-task cave-dark-crystals))) + (set! (-> this assistant) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this evilbro) (the-as handle #f)) + (set! (-> this evilsis) (the-as handle #f)) + (set! (-> this sound-flava) (music-flava sage)) + (process-taskable-method-42 this) (none) ) diff --git a/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc b/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc index 80ba95d3a8..251ea5ad3a 100644 --- a/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/village3-obs_REF.gc @@ -39,11 +39,11 @@ ) ;; definition for method 3 of type villagec-lava -(defmethod inspect villagec-lava ((obj villagec-lava)) +(defmethod inspect villagec-lava ((this villagec-lava)) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; definition for symbol ripple-for-villagec-lava, type ripple-wave-set @@ -61,18 +61,18 @@ ;; definition for method 22 of type villagec-lava ;; INFO: Return type mismatch symbol vs none. -(defmethod water-vol-method-22 villagec-lava ((obj villagec-lava)) +(defmethod water-vol-method-22 villagec-lava ((this villagec-lava)) (let ((t9-0 (method-of-type water-anim water-vol-method-22))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) + (set! (-> this draw ripple) v1-2) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 waveform) ripple-for-villagec-lava) ) - (logclear! (-> obj flags) (water-flags wt23)) - (logior! (-> obj flags) (water-flags wt25)) - (set! (-> obj attack-event) 'lava) + (logclear! (-> this flags) (water-flags wt23)) + (logior! (-> this flags) (water-flags wt25)) + (set! (-> this attack-event) 'lava) (none) ) @@ -94,13 +94,13 @@ ) ;; definition for method 3 of type gondola -(defmethod inspect gondola ((obj gondola)) +(defmethod inspect gondola ((this gondola)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tanim: ~A~%" (-> obj anim)) - (format #t "~T~Told-target-pos: #~%" (-> obj old-target-pos)) - obj + (format #t "~T~Tanim: ~A~%" (-> this anim)) + (format #t "~T~Told-target-pos: #~%" (-> this old-target-pos)) + this ) ;; failed to figure out what this is: @@ -114,7 +114,7 @@ (defstate idle (gondola) :virtual #t :code (behavior ((arg0 symbol)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (ja-channel-set! 1) (cond (arg0 @@ -164,7 +164,7 @@ ) (not (movie?)) (not (level-hint-displayed?)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (file-status *art-control* (-> self anim name) 0) ) ) @@ -338,9 +338,9 @@ ;; definition for method 11 of type gondola ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! gondola ((obj gondola) (arg0 entity-actor)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod init-from-entity! gondola ((this gondola) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) default-collision-reaction) (set! (-> s4-0 no-reaction) @@ -358,16 +358,16 @@ ) (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) (backup-collide-with-as s4-0) - (set! (-> obj root-override) s4-0) + (set! (-> this root-override) s4-0) ) - (process-drawable-from-entity! obj arg0) - (quaternion-identity! (-> obj root-override quat)) - (initialize-skeleton obj *gondola-sg* '()) - (set! (-> obj draw origin-joint-index) (the-as uint 3)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj draw shadow-joint-index) (the-as uint 3)) - (set! (-> obj draw shadow-ctrl) (copy *target-shadow-control* 'process)) - (let ((a0-16 (-> obj draw shadow-ctrl))) + (process-drawable-from-entity! this arg0) + (quaternion-identity! (-> this root-override quat)) + (initialize-skeleton this *gondola-sg* '()) + (set! (-> this draw origin-joint-index) (the-as uint 3)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw shadow-joint-index) (the-as uint 3)) + (set! (-> this draw shadow-ctrl) (copy *target-shadow-control* 'process)) + (let ((a0-16 (-> this draw shadow-ctrl))) (when a0-16 (let ((v1-32 a0-16)) (set! (-> v1-32 settings bot-plane w) (- -122880.0)) @@ -381,12 +381,12 @@ ) ) (cond - ((< (-> (target-pos 0) y) (+ 204800.0 (-> obj root-override trans y))) - (go (method-of-object obj idle) #f) + ((< (-> (target-pos 0) y) (+ 204800.0 (-> this root-override trans y))) + (go (method-of-object this idle) #f) ) (else - (set! (-> obj anim) (new 'static 'spool-anim :name "gondola-ride-down" :index 6 :parts 3 :command-list '())) - (go (method-of-object obj idle) #t) + (set! (-> this anim) (new 'static 'spool-anim :name "gondola-ride-down" :index 6 :parts 3 :command-list '())) + (go (method-of-object this idle) #t) ) ) (none) @@ -406,11 +406,11 @@ ) ;; definition for method 3 of type pistons -(defmethod inspect pistons ((obj pistons)) +(defmethod inspect pistons ((this pistons)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -444,16 +444,16 @@ ;; definition for method 11 of type pistons ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! pistons ((obj pistons) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *pistons-sg* '()) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "gdl-gen-loop" :fo-max 100) (-> obj root trans)) +(defmethod init-from-entity! pistons ((this pistons) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *pistons-sg* '()) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "gdl-gen-loop" :fo-max 100) (-> this root trans)) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (go (method-of-object obj active) (the-as handle #f) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) + (go (method-of-object this active) (the-as handle #f) #t) + (go (method-of-object this idle)) ) (none) ) @@ -471,11 +471,11 @@ ) ;; definition for method 3 of type gondolacables -(defmethod inspect gondolacables ((obj gondolacables)) +(defmethod inspect gondolacables ((this gondolacables)) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: @@ -512,19 +512,19 @@ ;; definition for method 11 of type gondolacables ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! gondolacables ((obj gondolacables) (arg0 entity-actor)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj *gondolacables-sg* '()) - (set! (-> obj draw mgeo effect 0 effect-bits) +(defmethod init-from-entity! gondolacables ((this gondolacables) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this *gondolacables-sg* '()) + (set! (-> this draw mgeo effect 0 effect-bits) (the-as uint - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) 1 0 ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak1/levels/village3/village3-part_REF.gc b/test/decompiler/reference/jak1/levels/village3/village3-part_REF.gc index 9f7b9d44f7..beedf1cff6 100644 --- a/test/decompiler/reference/jak1/levels/village3/village3-part_REF.gc +++ b/test/decompiler/reference/jak1/levels/village3/village3-part_REF.gc @@ -11,11 +11,11 @@ ) ;; definition for method 3 of type villagec-part -(defmethod inspect villagec-part ((obj villagec-part)) +(defmethod inspect villagec-part ((this villagec-part)) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc b/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc index 2640587a4b..df062be329 100644 --- a/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc +++ b/test/decompiler/reference/jak1/levels/village_common/oracle_REF.gc @@ -15,15 +15,15 @@ ) ;; definition for method 3 of type oracle -(defmethod inspect oracle ((obj oracle)) +(defmethod inspect oracle ((this oracle)) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Tfirst-task: ~D~%" (-> obj first-task)) - (format #t "~T~Tsecond-task: ~D~%" (-> obj second-task)) - (format #t "~T~Tleft-eye-cell: ~D~%" (-> obj left-eye-cell)) - (format #t "~T~Tright-eye-cell: ~D~%" (-> obj right-eye-cell)) - obj + (format #t "~T~Tfirst-task: ~D~%" (-> this first-task)) + (format #t "~T~Tsecond-task: ~D~%" (-> this second-task)) + (format #t "~T~Tleft-eye-cell: ~D~%" (-> this left-eye-cell)) + (format #t "~T~Tright-eye-cell: ~D~%" (-> this right-eye-cell)) + this ) ;; failed to figure out what this is: @@ -33,13 +33,13 @@ ) ;; definition for method 32 of type oracle -(defmethod play-anim! oracle ((obj oracle) (arg0 symbol)) - (set! (-> obj talk-message) (text-id press-to-talk)) - (case (current-status (-> obj tasks)) +(defmethod play-anim! oracle ((this oracle) (arg0 symbol)) + (set! (-> this talk-message) (text-id press-to-talk)) + (case (current-status (-> this tasks)) (((task-status need-hint) (task-status need-introduction)) (when arg0 - (close-specific-task! (the-as game-task (-> obj first-task)) (task-status need-introduction)) - (close-specific-task! (the-as game-task (-> obj second-task)) (task-status need-introduction)) + (close-specific-task! (the-as game-task (-> this first-task)) (task-status need-introduction)) + (close-specific-task! (the-as game-task (-> this second-task)) (task-status need-introduction)) ) (case (-> (level-get-target-inside *level*) name) (('village1) @@ -141,7 +141,7 @@ ) ) (((task-status need-reminder)) - (set! (-> obj skippable) #t) + (set! (-> this skippable) #t) (case (-> (level-get-target-inside *level*) name) (('village1) (new 'static 'spool-anim :name "oracle-reminder-1" :index 10 :parts 4 :command-list '()) @@ -157,19 +157,19 @@ (((task-status need-reward-speech)) (cond (arg0 - (set! (-> obj cell-for-task) (current-task (-> obj tasks))) - (close-current! (-> obj tasks)) + (set! (-> this cell-for-task) (current-task (-> this tasks))) + (close-current! (-> this tasks)) (send-event *target* 'get-pickup 5 (- (-> *GAME-bank* money-oracle-inc))) (cond - ((= (current-task (-> obj tasks)) (-> obj first-task)) - (let ((a0-25 (handle->process (-> obj right-eye-cell)))) + ((= (current-task (-> this tasks)) (-> this first-task)) + (let ((a0-25 (handle->process (-> this right-eye-cell)))) (if a0-25 (deactivate a0-25) ) ) ) (else - (let ((a0-29 (handle->process (-> obj left-eye-cell)))) + (let ((a0-29 (handle->process (-> this left-eye-cell)))) (if a0-29 (deactivate a0-29) ) @@ -178,12 +178,12 @@ ) ) (else - (set! (-> obj will-talk) #t) - (set! (-> obj talk-message) (text-id press-to-trade-money-oracle)) + (set! (-> this will-talk) #t) + (set! (-> this talk-message) (text-id press-to-trade-money-oracle)) ) ) (cond - ((= (current-task (-> obj tasks)) (-> obj first-task)) + ((= (current-task (-> this tasks)) (-> this first-task)) (case (-> (level-get-target-inside *level*) name) (('village1) (new 'static 'spool-anim :name "oracle-right-eye-1" :index 3 :parts 2 :command-list '()) @@ -216,18 +216,18 @@ (format 0 "ERROR: : ~S playing anim for task status ~S~%" - (-> obj name) - (task-status->string (current-status (-> obj tasks))) + (-> this name) + (task-status->string (current-status (-> this tasks))) ) ) - (-> obj draw art-group data 2) + (-> this draw art-group data 2) ) ) ) ;; definition for method 31 of type oracle -(defmethod get-art-elem oracle ((obj oracle)) - (-> obj draw art-group data 2) +(defmethod get-art-elem oracle ((this oracle)) + (-> this draw art-group data 2) ) ;; failed to figure out what this is: @@ -244,17 +244,17 @@ ) ;; definition for method 11 of type oracle -(defmethod init-from-entity! oracle ((obj oracle) (arg0 entity-actor)) - (process-taskable-method-40 obj arg0 *oracle-sg* 3 4 (new 'static 'vector :y -4096.0 :w 4096.0) -1) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "oracle-sleep" :fo-max 50) (-> obj root-override trans)) +(defmethod init-from-entity! oracle ((this oracle) (arg0 entity-actor)) + (process-taskable-method-40 this arg0 *oracle-sg* 3 4 (new 'static 'vector :y -4096.0 :w 4096.0) -1) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "oracle-sleep" :fo-max 50) (-> this root-override trans)) ) - (set! (-> obj first-task) (the-as uint (-> arg0 extra perm task))) - (set! (-> obj second-task) (res-lump-value arg0 'alt-task uint)) - (set! (-> obj tasks) (get-task-control (the-as game-task (-> obj first-task)))) - (set! (-> obj right-eye-cell) (the-as handle #f)) - (set! (-> obj left-eye-cell) (the-as handle #f)) - (logior! (-> obj draw status) (draw-status skip-bones)) + (set! (-> this first-task) (the-as uint (-> arg0 extra perm task))) + (set! (-> this second-task) (res-lump-value arg0 'alt-task uint)) + (set! (-> this tasks) (get-task-control (the-as game-task (-> this first-task)))) + (set! (-> this right-eye-cell) (the-as handle #f)) + (set! (-> this left-eye-cell) (the-as handle #f)) + (logior! (-> this draw status) (draw-status skip-bones)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-1 (lambda :behavior oracle () @@ -277,13 +277,15 @@ ) ) (ja-post) - (when (not (task-closed? (the-as game-task (-> obj first-task)) (task-status need-resolution))) - (vector<-cspace! s4-0 (-> obj node-list data 5)) - (set! (-> obj right-eye-cell) - (ppointer->handle (manipy-spawn s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to obj)) + (when (not (task-closed? (the-as game-task (-> this first-task)) (task-status need-resolution))) + (vector<-cspace! s4-0 (-> this node-list data 5)) + (set! (-> this right-eye-cell) + (ppointer->handle + (manipy-spawn s4-0 (-> this entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to this) + ) ) (send-event - (handle->process (-> obj right-eye-cell)) + (handle->process (-> this right-eye-cell)) 'eval (lambda :behavior oracle () (let ((v0-0 (create-launch-control (-> *part-group-id-table* 63) self))) (set! (-> self part) v0-0) @@ -291,15 +293,17 @@ ) ) ) - (send-event (handle->process (-> obj right-eye-cell)) 'trans-hook s5-1) + (send-event (handle->process (-> this right-eye-cell)) 'trans-hook s5-1) ) - (when (not (task-closed? (the-as game-task (-> obj second-task)) (task-status need-resolution))) - (vector<-cspace! s4-0 (-> obj node-list data 6)) - (set! (-> obj left-eye-cell) - (ppointer->handle (manipy-spawn s4-0 (-> obj entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to obj)) + (when (not (task-closed? (the-as game-task (-> this second-task)) (task-status need-resolution))) + (vector<-cspace! s4-0 (-> this node-list data 6)) + (set! (-> this left-eye-cell) + (ppointer->handle + (manipy-spawn s4-0 (-> this entity) *fuel-cell-sg* (new 'static 'vector :w 4915.2) :to this) + ) ) (send-event - (handle->process (-> obj left-eye-cell)) + (handle->process (-> this left-eye-cell)) 'eval (lambda :behavior oracle () (let ((v0-0 (create-launch-control (-> *part-group-id-table* 63) self))) (set! (-> self part) v0-0) @@ -307,9 +311,9 @@ ) ) ) - (send-event (handle->process (-> obj left-eye-cell)) 'trans-hook s5-1) + (send-event (handle->process (-> this left-eye-cell)) 'trans-hook s5-1) ) ) - (process-taskable-method-42 obj) + (process-taskable-method-42 this) (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 09d4d5d65a..5007c89efe 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 @@ -10,35 +10,35 @@ ) ;; definition for method 3 of type warpgate -(defmethod inspect warpgate ((obj warpgate)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tmask: ~D~%" (-> obj mask)) - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tpool: ~A~%" (-> obj pool)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tpid: ~D~%" (-> obj pid)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap: #~%" (&-> obj heap-base)) - (format #t "~Tconnection-list: ~`'connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack[0] @ #x~X~%" (-> obj stack)) - obj +(defmethod inspect warpgate ((this warpgate)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tmask: ~D~%" (-> this mask)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tpool: ~A~%" (-> this pool)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tpid: ~D~%" (-> this pid)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap: #~%" (&-> this heap-base)) + (format #t "~Tconnection-list: ~`'connectable`P~%" (-> this connection-list)) + (format #t "~Tstack[0] @ #x~X~%" (-> this stack)) + this ) ;; failed to figure out what this is: @@ -63,8 +63,8 @@ (ja-channel-set! 0) (vector-reset! (-> self control transv)) (move-to-point! (-> self control) (-> self control unknown-vector102)) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) (seconds 1)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -90,7 +90,7 @@ ) (set-heading-vec! (-> self control) (-> self control transv)) (rot->dir-targ! (-> self control)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self post-hook) target-no-stick-post) (ja-channel-set! 1) (send-event self 'do-effect 'death-warp-in -1.0) @@ -126,7 +126,7 @@ ) :code (behavior () (remove-setting! 'allow-progress) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (loop (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) (and (>= (-> self level-slot) 0) @@ -151,14 +151,14 @@ (can-grab-display? self) (cond ((or (= (-> *target* next-state name) 'target-warp-in) (= (-> *target* next-state name) 'target-warp-out)) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) #f ) (else #t ) ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (if (and (cpad-pressed? 0 circle) (process-grab? *target*)) (go-virtual active) @@ -251,11 +251,11 @@ (set-setting! 'allow-progress #f 0.0 0) (apply-settings *setting-control*) (sound-play "start-options") - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) :trans (behavior () (when (or (and (cpad-pressed? 0 triangle) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) (process-release? *target*) ) (not *target*) @@ -276,7 +276,7 @@ (send-event *target* 'rotate-y-angle - (fmax (fmin f0-0 (* 65536.0 (-> *display* seconds-per-frame))) (* -65536.0 (-> *display* seconds-per-frame))) + (fmax (fmin f0-0 (* 65536.0 (seconds-per-frame))) (* -65536.0 (seconds-per-frame))) ) ) ) @@ -320,7 +320,7 @@ (hide-hud) (let ((s1-2 (get-continue-by-name *game-info* (-> *warp-info* gp-0)))) (lookup-level-info (-> s1-2 level)) - (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.05)) (cpad-pressed? 0 circle)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.05)) (cpad-pressed? 0 circle)) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons circle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons circle)) (go-virtual use gp-0 (the-as level s1-2)) @@ -492,12 +492,12 @@ ) ;; definition for method 3 of type warp-gate-switch -(defmethod inspect warp-gate-switch ((obj warp-gate-switch)) +(defmethod inspect warp-gate-switch ((this warp-gate-switch)) (let ((t9-0 (method-of-type basebutton inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Twarp: ~D~%" (-> obj warp)) - obj + (format #t "~T~Twarp: ~D~%" (-> this warp)) + this ) ;; failed to figure out what this is: @@ -507,8 +507,8 @@ ) ;; definition for method 27 of type warp-gate-switch -(defmethod basebutton-method-27 warp-gate-switch ((obj warp-gate-switch)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod basebutton-method-27 warp-gate-switch ((this warp-gate-switch)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) default-collision-reaction) (set! (-> s5-0 no-reaction) @@ -533,14 +533,14 @@ ) (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) (backup-collide-with-as s5-0) - (set! (-> obj root-override) s5-0) + (set! (-> this root-override) s5-0) s5-0 ) ) ;; definition for method 32 of type warp-gate-switch -(defmethod pressable? warp-gate-switch ((obj warp-gate-switch)) - (let ((v1-2 (-> obj entity extra perm task))) +(defmethod pressable? warp-gate-switch ((this warp-gate-switch)) + (let ((v1-2 (-> this entity extra perm task))) (cond ((logtest? (-> *target* control root-prim prim-core action) (collide-action edgegrab-cam swingpole-active racer snowball tube flut) @@ -576,64 +576,64 @@ ) ;; definition for method 26 of type warp-gate-switch -(defmethod basebutton-method-26 warp-gate-switch ((obj warp-gate-switch)) - (set! (-> obj warp) (the-as handle #f)) - (let ((v1-2 (-> obj entity extra perm task))) +(defmethod basebutton-method-26 warp-gate-switch ((this warp-gate-switch)) + (set! (-> this warp) (the-as handle #f)) + (let ((v1-2 (-> this entity extra perm task))) (cond ((= v1-2 (game-task training-door)) - (set! (-> obj down?) + (set! (-> this down?) (the-as symbol - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status complete))) ) ) ) (else - (if (or (= v1-2 (game-task none)) (task-closed? (-> obj entity extra perm task) (task-status need-hint))) - (set! (-> obj down?) #t) + (if (or (= v1-2 (game-task none)) (task-closed? (-> this entity extra perm task) (task-status need-hint))) + (set! (-> this down?) #t) ) ) ) ) - (initialize-skeleton obj *warp-gate-switch-sg* '()) - (logior! (-> obj skel status) (janim-status inited)) + (initialize-skeleton this *warp-gate-switch-sg* '()) + (logior! (-> this skel status) (janim-status inited)) (ja-channel-set! 1) (cond - ((-> obj down?) - (let ((s5-0 (-> obj skel root-channel 0))) + ((-> this down?) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) data 0 length) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) data 0 length) -1)) ) ) ) (else - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) ) ) - (set! (-> obj anim-speed) 2.0) - (update-transforms! (-> obj root-override)) + (set! (-> this anim-speed) 2.0) + (update-transforms! (-> this root-override)) (ja-post) (none) ) ;; definition for method 31 of type warp-gate-switch ;; INFO: Return type mismatch none vs int. -(defmethod press! warp-gate-switch ((obj warp-gate-switch) (arg0 symbol)) +(defmethod press! warp-gate-switch ((this warp-gate-switch) (arg0 symbol)) (with-pp (when arg0 - (let ((s4-0 (-> obj entity extra perm task))) + (let ((s4-0 (-> this entity extra perm task))) (when (nonzero? s4-0) (close-specific-task! s4-0 (task-status need-hint)) (when (= s4-0 (game-task village3-button)) @@ -653,7 +653,7 @@ (set! (-> a1-5 num-params) 0) (set! (-> a1-5 message) 'start) (let ((t9-5 send-event-function) - (v1-14 (-> obj notify-actor)) + (v1-14 (-> this notify-actor)) ) (t9-5 (if v1-14 @@ -692,7 +692,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (let ((t9-0 (-> (method-of-type basebutton basebutton-up-idle) enter))) (if t9-0 (t9-0) @@ -715,7 +715,7 @@ ) ) ) - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 60)) + (when (time-elapsed? (-> self state-time) (seconds 60)) (case (-> self entity extra perm task) (((game-task training-door)) (when (and (task-complete? *game-info* (game-task training-door)) @@ -780,7 +780,7 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (let ((t9-13 (-> (method-of-type basebutton basebutton-up-idle) trans))) (if t9-13 @@ -804,7 +804,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (set! (-> self warp) (ppointer->handle (process-spawn warp-gate (-> self notify-actor extra trans) :to self))) (process-entity-status! self (entity-perm-status complete) #t) (let ((t9-4 (-> (method-of-type basebutton basebutton-down-idle) enter))) @@ -826,7 +826,7 @@ ) ) :trans (behavior () - (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 60)) + (when (time-elapsed? (-> self state-time) (seconds 60)) (case (-> self entity extra perm task) (((game-task training-door)) (when (not (task-closed? (game-task beach-ecorocks) (task-status need-introduction))) @@ -841,7 +841,7 @@ ) ) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) ) (let ((t9-3 (-> (method-of-type basebutton basebutton-down-idle) trans))) (if t9-3 @@ -919,24 +919,24 @@ ) ;; definition for method 3 of type village-cam -(defmethod inspect village-cam ((obj village-cam)) +(defmethod inspect village-cam ((this village-cam)) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~T~Troot: ~A~%" (-> obj root-override)) - (format #t "~T~Trange: (meters ~m)~%" (-> obj range)) - (format #t "~T~Tindex: ~D~%" (-> obj index)) - (format #t "~T~Tstate-time: ~D~%" (-> obj state-time)) - obj + (format #t "~T~Troot: ~A~%" (-> this root-override)) + (format #t "~T~Trange: (meters ~m)~%" (-> this range)) + (format #t "~T~Tindex: ~D~%" (-> this index)) + (format #t "~T~Tstate-time: ~D~%" (-> this state-time)) + this ) ;; definition for method 7 of type village-cam ;; INFO: Return type mismatch process vs village-cam. -(defmethod relocate village-cam ((obj village-cam) (arg0 int)) - (if (nonzero? (-> obj root-override)) - (&+! (-> obj root-override) arg0) +(defmethod relocate village-cam ((this village-cam) (arg0 int)) + (if (nonzero? (-> this root-override)) + (&+! (-> this root-override) arg0) ) - (the-as village-cam ((method-of-type process relocate) obj arg0)) + (the-as village-cam ((method-of-type process relocate) this arg0)) ) ;; failed to figure out what this is: @@ -1009,7 +1009,7 @@ ) (suspend) ) - (set! (-> self state-time) (-> *display* base-frame-counter)) + (set-time! (-> self state-time)) (process-grab? *target*) (process-entity-status! self (entity-perm-status bit-3) #t) (kill-current-level-hint '(ambient) '() 'exit) @@ -1041,7 +1041,7 @@ ) (suspend) ) - (while (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (suspend) ) (kill-current-level-hint '() '() 'die) @@ -1169,8 +1169,8 @@ (let ((a0-70 (-> self entity extra perm))) (when (= (-> a0-70 user-uint8 0) 1) (remove-setting! 'allow-progress) - (let ((gp-3 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-3) (seconds 300)) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 300)) (suspend) ) ) @@ -1191,15 +1191,15 @@ ;; definition for method 11 of type village-cam ;; INFO: Used lq/sq ;; INFO: Return type mismatch object vs none. -(defmethod init-from-entity! village-cam ((obj village-cam) (arg0 entity-actor)) +(defmethod init-from-entity! village-cam ((this village-cam) (arg0 entity-actor)) "Copy defaults from the entity." - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj root-override) (new 'process 'trsq)) - (set! (-> obj root-override trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root-override quat) (-> arg0 quat)) - (vector-identity! (-> obj root-override scale)) - (set! (-> obj range) (res-lump-float arg0 'cam-notice-dist :default 81920.0)) - (set! (-> obj index) (res-lump-value arg0 'index int)) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this root-override) (new 'process 'trsq)) + (set! (-> this root-override trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root-override quat) (-> arg0 quat)) + (vector-identity! (-> this root-override scale)) + (set! (-> this range) (res-lump-float arg0 'cam-notice-dist :default 81920.0)) + (set! (-> this index) (res-lump-value arg0 'index int)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/decompiler-macros.gc b/test/decompiler/reference/jak2/decompiler-macros.gc index e9c4694430..4a3646c9af 100644 --- a/test/decompiler/reference/jak2/decompiler-macros.gc +++ b/test/decompiler/reference/jak2/decompiler-macros.gc @@ -1640,3 +1640,11 @@ "generate a new attack-id" `(1+! (-> *game-info* attack-id)) ) + +(defmacro set-time! (time) + `(set! ,time (current-time)) + ) + +(defmacro time-elapsed? (time duration) + `(>= (- (current-time) ,time) ,duration) + ) \ No newline at end of file diff --git a/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc index b4c170ff01..6d175f0132 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy-h_REF.gc @@ -16,18 +16,18 @@ ) ;; definition for method 3 of type enemy-focus -(defmethod inspect enemy-focus ((obj enemy-focus)) - (when (not obj) - (set! obj obj) +(defmethod inspect enemy-focus ((this enemy-focus)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'enemy-focus) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~1Taware: ~D~%" (-> obj aware)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "[~8x] ~A~%" this 'enemy-focus) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~1Taware: ~D~%" (-> this aware)) + (format #t "~1Tflags: ~D~%" (-> this flags)) (label cfg-4) - obj + this ) ;; definition of type enemy-info @@ -124,95 +124,95 @@ ;; definition for method 3 of type enemy-info ;; INFO: Used lq/sq -(defmethod inspect enemy-info ((obj enemy-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect enemy-info ((this enemy-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tfact-defaults: ~A~%" (-> obj fact-defaults)) - (format #t "~1Tuse-die-falling: ~A~%" (-> obj use-die-falling)) - (format #t "~1Tuse-victory: ~A~%" (-> obj use-victory)) - (format #t "~1Tuse-jump-blocked: ~A~%" (-> obj use-jump-blocked)) - (format #t "~1Tdebug-draw-neck: ~A~%" (-> obj debug-draw-neck)) - (format #t "~1Tjump-debug-draw: ~A~%" (-> obj jump-debug-draw)) - (format #t "~1Tmove-to-ground: ~A~%" (-> obj move-to-ground)) - (format #t "~1Thover-if-no-ground: ~A~%" (-> obj hover-if-no-ground)) - (format #t "~1Tidle-anim-script: #x~X~%" (-> obj idle-anim-script)) - (format #t "~1Tidle-anim: ~D~%" (-> obj idle-anim)) - (format #t "~1Tnotice-anim: ~D~%" (-> obj notice-anim)) - (format #t "~1Thostile-anim: ~D~%" (-> obj hostile-anim)) - (format #t "~1Thit-anim: ~D~%" (-> obj hit-anim)) - (format #t "~1Tknocked-anim: ~D~%" (-> obj knocked-anim)) - (format #t "~1Tknocked-land-anim: ~D~%" (-> obj knocked-land-anim)) - (format #t "~1Tdie-anim: ~D~%" (-> obj die-anim)) - (format #t "~1Tdie-falling-anim: ~D~%" (-> obj die-falling-anim)) - (format #t "~1Tvictory-anim: ~D~%" (-> obj victory-anim)) - (format #t "~1Tjump-wind-up-anim: ~D~%" (-> obj jump-wind-up-anim)) - (format #t "~1Tjump-in-air-anim: ~D~%" (-> obj jump-in-air-anim)) - (format #t "~1Tjump-land-anim: ~D~%" (-> obj jump-land-anim)) - (format #t "~1Tneck-joint: ~D~%" (-> obj neck-joint)) - (format #t "~1Tlook-at-joint: ~D~%" (-> obj look-at-joint)) - (format #t "~1Tbullseye-joint: ~D~%" (-> obj bullseye-joint)) - (format #t "~1Tsound-hit: ~D~%" (-> obj sound-hit)) - (format #t "~1Tsound-die: ~D~%" (-> obj sound-die)) - (format #t "~1Tnotice-distance: (meters ~m)~%" (-> obj notice-distance)) - (format #t "~1Tnotice-distance-delta: (meters ~m)~%" (-> obj notice-distance-delta)) - (format #t "~1Tproximity-notice-distance: (meters ~m)~%" (-> obj proximity-notice-distance)) - (format #t "~1Tdefault-hit-points: ~D~%" (-> obj default-hit-points)) - (format #t "~1Tgnd-collide-with: ~D~%" (-> obj gnd-collide-with)) - (format #t "~1Toverlaps-others-collide-with-filter: ~D~%" (-> obj overlaps-others-collide-with-filter)) - (format #t "~1Tpenetrate-flinch: ~D~%" (-> obj penetrate-flinch)) - (format #t "~1Tpenetrate-knocked: ~D~%" (-> obj penetrate-knocked)) - (format #t "~1Tmovement-gravity: (meters ~m)~%" (-> obj movement-gravity)) - (format #t "~1Tfriction: ~f~%" (-> obj friction)) - (format #t "~1Tslip-factor: ~f~%" (-> obj slip-factor)) - (format #t "~1Tattack-shove-back: (meters ~m)~%" (-> obj attack-shove-back)) - (format #t "~1Tattack-shove-up: (meters ~m)~%" (-> obj attack-shove-up)) - (format #t "~1Tattack-mode: ~A~%" (-> obj attack-mode)) - (format #t "~1Tattack-damage: ~D~%" (-> obj attack-damage)) - (format #t "~1Trecover-gnd-collide-with: ~D~%" (-> obj recover-gnd-collide-with)) - (format #t "~1Tjump-height-min: (meters ~m)~%" (-> obj jump-height-min)) - (format #t "~1Tjump-height-factor: ~f~%" (-> obj jump-height-factor)) - (format #t "~1Tknocked-seek-ry-clamp: ~f~%" (-> obj knocked-seek-ry-clamp)) - (format #t "~1Tknocked-soft-vxz-lo: ~f~%" (-> obj knocked-soft-vxz-lo)) - (format #t "~1Tknocked-soft-vxz-hi: ~f~%" (-> obj knocked-soft-vxz-hi)) - (format #t "~1Tknocked-soft-vy-lo: ~f~%" (-> obj knocked-soft-vy-lo)) - (format #t "~1Tknocked-soft-vy-hi: ~f~%" (-> obj knocked-soft-vy-hi)) - (format #t "~1Tknocked-medium-vxz-lo: ~f~%" (-> obj knocked-medium-vxz-lo)) - (format #t "~1Tknocked-medium-vxz-hi: ~f~%" (-> obj knocked-medium-vxz-hi)) - (format #t "~1Tknocked-medium-vy-lo: ~f~%" (-> obj knocked-medium-vy-lo)) - (format #t "~1Tknocked-medium-vy-hi: ~f~%" (-> obj knocked-medium-vy-hi)) - (format #t "~1Tknocked-hard-vxz-lo: ~f~%" (-> obj knocked-hard-vxz-lo)) - (format #t "~1Tknocked-hard-vxz-hi: ~f~%" (-> obj knocked-hard-vxz-hi)) - (format #t "~1Tknocked-hard-vy-lo: ~f~%" (-> obj knocked-hard-vy-lo)) - (format #t "~1Tknocked-hard-vy-hi: ~f~%" (-> obj knocked-hard-vy-hi)) - (format #t "~1Tknocked-huge-vxz-lo: ~f~%" (-> obj knocked-huge-vxz-lo)) - (format #t "~1Tknocked-huge-vxz-hi: ~f~%" (-> obj knocked-huge-vxz-hi)) - (format #t "~1Tknocked-huge-vy-lo: ~f~%" (-> obj knocked-huge-vy-lo)) - (format #t "~1Tknocked-huge-vy-hi: ~f~%" (-> obj knocked-huge-vy-hi)) - (format #t "~1Tknocked-yellow-vxz-lo: ~f~%" (-> obj knocked-yellow-vxz-lo)) - (format #t "~1Tknocked-yellow-vxz-hi: ~f~%" (-> obj knocked-yellow-vxz-hi)) - (format #t "~1Tknocked-yellow-vy-lo: ~f~%" (-> obj knocked-yellow-vy-lo)) - (format #t "~1Tknocked-yellow-vy-hi: ~f~%" (-> obj knocked-yellow-vy-hi)) - (format #t "~1Tknocked-red-vxz-lo: ~f~%" (-> obj knocked-red-vxz-lo)) - (format #t "~1Tknocked-red-vxz-hi: ~f~%" (-> obj knocked-red-vxz-hi)) - (format #t "~1Tknocked-red-vy-lo: ~f~%" (-> obj knocked-red-vy-lo)) - (format #t "~1Tknocked-red-vy-hi: ~f~%" (-> obj knocked-red-vy-hi)) - (format #t "~1Tknocked-blue-vxz-lo: ~f~%" (-> obj knocked-blue-vxz-lo)) - (format #t "~1Tknocked-blue-vxz-hi: ~f~%" (-> obj knocked-blue-vxz-hi)) - (format #t "~1Tknocked-blue-vy-lo: ~f~%" (-> obj knocked-blue-vy-lo)) - (format #t "~1Tknocked-blue-vy-hi: ~f~%" (-> obj knocked-blue-vy-hi)) - (format #t "~1Tshadow-size: (meters ~m)~%" (-> obj shadow-size)) - (format #t "~1Tshadow-max-y: (meters ~m)~%" (-> obj shadow-max-y)) - (format #t "~1Tshadow-min-y: (meters ~m)~%" (-> obj shadow-min-y)) - (format #t "~1Tshadow-locus-dist: (meters ~m)~%" (-> obj shadow-locus-dist)) - (format #t "~1Tgem-joint: ~D~%" (-> obj gem-joint)) - (format #t "~1Tgem-seg: ~D~%" (-> obj gem-seg)) - (format #t "~1Tgem-no-seg: ~D~%" (-> obj gem-no-seg)) - (format #t "~1Tgem-offset: #~%" (-> obj gem-offset)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tfact-defaults: ~A~%" (-> this fact-defaults)) + (format #t "~1Tuse-die-falling: ~A~%" (-> this use-die-falling)) + (format #t "~1Tuse-victory: ~A~%" (-> this use-victory)) + (format #t "~1Tuse-jump-blocked: ~A~%" (-> this use-jump-blocked)) + (format #t "~1Tdebug-draw-neck: ~A~%" (-> this debug-draw-neck)) + (format #t "~1Tjump-debug-draw: ~A~%" (-> this jump-debug-draw)) + (format #t "~1Tmove-to-ground: ~A~%" (-> this move-to-ground)) + (format #t "~1Thover-if-no-ground: ~A~%" (-> this hover-if-no-ground)) + (format #t "~1Tidle-anim-script: #x~X~%" (-> this idle-anim-script)) + (format #t "~1Tidle-anim: ~D~%" (-> this idle-anim)) + (format #t "~1Tnotice-anim: ~D~%" (-> this notice-anim)) + (format #t "~1Thostile-anim: ~D~%" (-> this hostile-anim)) + (format #t "~1Thit-anim: ~D~%" (-> this hit-anim)) + (format #t "~1Tknocked-anim: ~D~%" (-> this knocked-anim)) + (format #t "~1Tknocked-land-anim: ~D~%" (-> this knocked-land-anim)) + (format #t "~1Tdie-anim: ~D~%" (-> this die-anim)) + (format #t "~1Tdie-falling-anim: ~D~%" (-> this die-falling-anim)) + (format #t "~1Tvictory-anim: ~D~%" (-> this victory-anim)) + (format #t "~1Tjump-wind-up-anim: ~D~%" (-> this jump-wind-up-anim)) + (format #t "~1Tjump-in-air-anim: ~D~%" (-> this jump-in-air-anim)) + (format #t "~1Tjump-land-anim: ~D~%" (-> this jump-land-anim)) + (format #t "~1Tneck-joint: ~D~%" (-> this neck-joint)) + (format #t "~1Tlook-at-joint: ~D~%" (-> this look-at-joint)) + (format #t "~1Tbullseye-joint: ~D~%" (-> this bullseye-joint)) + (format #t "~1Tsound-hit: ~D~%" (-> this sound-hit)) + (format #t "~1Tsound-die: ~D~%" (-> this sound-die)) + (format #t "~1Tnotice-distance: (meters ~m)~%" (-> this notice-distance)) + (format #t "~1Tnotice-distance-delta: (meters ~m)~%" (-> this notice-distance-delta)) + (format #t "~1Tproximity-notice-distance: (meters ~m)~%" (-> this proximity-notice-distance)) + (format #t "~1Tdefault-hit-points: ~D~%" (-> this default-hit-points)) + (format #t "~1Tgnd-collide-with: ~D~%" (-> this gnd-collide-with)) + (format #t "~1Toverlaps-others-collide-with-filter: ~D~%" (-> this overlaps-others-collide-with-filter)) + (format #t "~1Tpenetrate-flinch: ~D~%" (-> this penetrate-flinch)) + (format #t "~1Tpenetrate-knocked: ~D~%" (-> this penetrate-knocked)) + (format #t "~1Tmovement-gravity: (meters ~m)~%" (-> this movement-gravity)) + (format #t "~1Tfriction: ~f~%" (-> this friction)) + (format #t "~1Tslip-factor: ~f~%" (-> this slip-factor)) + (format #t "~1Tattack-shove-back: (meters ~m)~%" (-> this attack-shove-back)) + (format #t "~1Tattack-shove-up: (meters ~m)~%" (-> this attack-shove-up)) + (format #t "~1Tattack-mode: ~A~%" (-> this attack-mode)) + (format #t "~1Tattack-damage: ~D~%" (-> this attack-damage)) + (format #t "~1Trecover-gnd-collide-with: ~D~%" (-> this recover-gnd-collide-with)) + (format #t "~1Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) + (format #t "~1Tjump-height-factor: ~f~%" (-> this jump-height-factor)) + (format #t "~1Tknocked-seek-ry-clamp: ~f~%" (-> this knocked-seek-ry-clamp)) + (format #t "~1Tknocked-soft-vxz-lo: ~f~%" (-> this knocked-soft-vxz-lo)) + (format #t "~1Tknocked-soft-vxz-hi: ~f~%" (-> this knocked-soft-vxz-hi)) + (format #t "~1Tknocked-soft-vy-lo: ~f~%" (-> this knocked-soft-vy-lo)) + (format #t "~1Tknocked-soft-vy-hi: ~f~%" (-> this knocked-soft-vy-hi)) + (format #t "~1Tknocked-medium-vxz-lo: ~f~%" (-> this knocked-medium-vxz-lo)) + (format #t "~1Tknocked-medium-vxz-hi: ~f~%" (-> this knocked-medium-vxz-hi)) + (format #t "~1Tknocked-medium-vy-lo: ~f~%" (-> this knocked-medium-vy-lo)) + (format #t "~1Tknocked-medium-vy-hi: ~f~%" (-> this knocked-medium-vy-hi)) + (format #t "~1Tknocked-hard-vxz-lo: ~f~%" (-> this knocked-hard-vxz-lo)) + (format #t "~1Tknocked-hard-vxz-hi: ~f~%" (-> this knocked-hard-vxz-hi)) + (format #t "~1Tknocked-hard-vy-lo: ~f~%" (-> this knocked-hard-vy-lo)) + (format #t "~1Tknocked-hard-vy-hi: ~f~%" (-> this knocked-hard-vy-hi)) + (format #t "~1Tknocked-huge-vxz-lo: ~f~%" (-> this knocked-huge-vxz-lo)) + (format #t "~1Tknocked-huge-vxz-hi: ~f~%" (-> this knocked-huge-vxz-hi)) + (format #t "~1Tknocked-huge-vy-lo: ~f~%" (-> this knocked-huge-vy-lo)) + (format #t "~1Tknocked-huge-vy-hi: ~f~%" (-> this knocked-huge-vy-hi)) + (format #t "~1Tknocked-yellow-vxz-lo: ~f~%" (-> this knocked-yellow-vxz-lo)) + (format #t "~1Tknocked-yellow-vxz-hi: ~f~%" (-> this knocked-yellow-vxz-hi)) + (format #t "~1Tknocked-yellow-vy-lo: ~f~%" (-> this knocked-yellow-vy-lo)) + (format #t "~1Tknocked-yellow-vy-hi: ~f~%" (-> this knocked-yellow-vy-hi)) + (format #t "~1Tknocked-red-vxz-lo: ~f~%" (-> this knocked-red-vxz-lo)) + (format #t "~1Tknocked-red-vxz-hi: ~f~%" (-> this knocked-red-vxz-hi)) + (format #t "~1Tknocked-red-vy-lo: ~f~%" (-> this knocked-red-vy-lo)) + (format #t "~1Tknocked-red-vy-hi: ~f~%" (-> this knocked-red-vy-hi)) + (format #t "~1Tknocked-blue-vxz-lo: ~f~%" (-> this knocked-blue-vxz-lo)) + (format #t "~1Tknocked-blue-vxz-hi: ~f~%" (-> this knocked-blue-vxz-hi)) + (format #t "~1Tknocked-blue-vy-lo: ~f~%" (-> this knocked-blue-vy-lo)) + (format #t "~1Tknocked-blue-vy-hi: ~f~%" (-> this knocked-blue-vy-hi)) + (format #t "~1Tshadow-size: (meters ~m)~%" (-> this shadow-size)) + (format #t "~1Tshadow-max-y: (meters ~m)~%" (-> this shadow-max-y)) + (format #t "~1Tshadow-min-y: (meters ~m)~%" (-> this shadow-min-y)) + (format #t "~1Tshadow-locus-dist: (meters ~m)~%" (-> this shadow-locus-dist)) + (format #t "~1Tgem-joint: ~D~%" (-> this gem-joint)) + (format #t "~1Tgem-seg: ~D~%" (-> this gem-seg)) + (format #t "~1Tgem-no-seg: ~D~%" (-> this gem-no-seg)) + (format #t "~1Tgem-offset: #~%" (-> this gem-offset)) (label cfg-4) - obj + this ) ;; definition of type enemy-knocked-info @@ -228,18 +228,18 @@ ) ;; definition for method 3 of type enemy-knocked-info -(defmethod inspect enemy-knocked-info ((obj enemy-knocked-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect enemy-knocked-info ((this enemy-knocked-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'enemy-knocked-info) - (format #t "~1Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~1Ton-surface-count: ~D~%" (-> obj on-surface-count)) - (format #t "~1Tmove-count: ~D~%" (-> obj move-count)) - (format #t "~1Tland-can-land-time: ~D~%" (-> obj land-can-land-time)) + (format #t "[~8x] ~A~%" this 'enemy-knocked-info) + (format #t "~1Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~1Ton-surface-count: ~D~%" (-> this on-surface-count)) + (format #t "~1Tmove-count: ~D~%" (-> this move-count)) + (format #t "~1Tland-can-land-time: ~D~%" (-> this land-can-land-time)) (label cfg-4) - obj + this ) ;; definition of type enemy-jump-info @@ -257,20 +257,20 @@ ) ;; definition for method 3 of type enemy-jump-info -(defmethod inspect enemy-jump-info ((obj enemy-jump-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect enemy-jump-info ((this enemy-jump-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'enemy-jump-info) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~1Thang-time: ~D~%" (-> obj hang-time)) - (format #t "~1Tstart-pos: #~%" (-> obj start-pos)) - (format #t "~1Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~1Ttraj: #~%" (-> obj traj)) + (format #t "[~8x] ~A~%" this 'enemy-jump-info) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~1Thang-time: ~D~%" (-> this hang-time)) + (format #t "~1Tstart-pos: #~%" (-> this start-pos)) + (format #t "~1Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~1Ttraj: #~%" (-> this traj)) (label cfg-4) - obj + this ) ;; definition of type enemy-init-by-other-params @@ -287,19 +287,19 @@ ) ;; definition for method 3 of type enemy-init-by-other-params -(defmethod inspect enemy-init-by-other-params ((obj enemy-init-by-other-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect enemy-init-by-other-params ((this enemy-init-by-other-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'enemy-init-by-other-params) - (format #t "~1Ttrans: #~%" (-> obj trans)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tdirected?: ~A~%" (-> obj directed?)) - (format #t "~1Tno-initial-move-to-ground?: ~A~%" (-> obj no-initial-move-to-ground?)) + (format #t "[~8x] ~A~%" this 'enemy-init-by-other-params) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tdirected?: ~A~%" (-> this directed?)) + (format #t "~1Tno-initial-move-to-ground?: ~A~%" (-> this no-initial-move-to-ground?)) (label cfg-4) - obj + this ) ;; definition of type enemy-attack-info @@ -319,22 +319,22 @@ ) ;; definition for method 3 of type enemy-attack-info -(defmethod inspect enemy-attack-info ((obj enemy-attack-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect enemy-attack-info ((this enemy-attack-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'enemy-attack-info) - (format #t "~1Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~1Tknocked-type: ~D~%" (-> obj knocked-type)) - (format #t "~1Tblue-juggle-count: ~D~%" (-> obj blue-juggle-count)) - (format #t "~1Tattacker-handle: ~D~%" (-> obj attacker-handle)) - (format #t "~1Tattack-time: ~D~%" (-> obj attack-time)) - (format #t "~1Tpenetrate-using: ~D~%" (-> obj penetrate-using)) - (format #t "~1Tattacker-pos: ~`vector`P~%" (-> obj attacker-pos)) - (format #t "~1Tattack-direction: ~`vector`P~%" (-> obj attack-direction)) + (format #t "[~8x] ~A~%" this 'enemy-attack-info) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tknocked-type: ~D~%" (-> this knocked-type)) + (format #t "~1Tblue-juggle-count: ~D~%" (-> this blue-juggle-count)) + (format #t "~1Tattacker-handle: ~D~%" (-> this attacker-handle)) + (format #t "~1Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~1Tpenetrate-using: ~D~%" (-> this penetrate-using)) + (format #t "~1Tattacker-pos: ~`vector`P~%" (-> this attacker-pos)) + (format #t "~1Tattack-direction: ~`vector`P~%" (-> this attack-direction)) (label cfg-4) - obj + this ) ;; definition of type enemy-best-focus @@ -349,17 +349,17 @@ ) ;; definition for method 3 of type enemy-best-focus -(defmethod inspect enemy-best-focus ((obj enemy-best-focus)) - (when (not obj) - (set! obj obj) +(defmethod inspect enemy-best-focus ((this enemy-best-focus)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'enemy-best-focus) - (format #t "~1Tproc: ~A~%" (-> obj proc)) - (format #t "~1Trating: ~f~%" (-> obj rating)) - (format #t "~1Taware: ~D~%" (-> obj aware)) + (format #t "[~8x] ~A~%" this 'enemy-best-focus) + (format #t "~1Tproc: ~A~%" (-> this proc)) + (format #t "~1Trating: ~f~%" (-> this rating)) + (format #t "~1Taware: ~D~%" (-> this aware)) (label cfg-4) - obj + this ) ;; definition of type enemy @@ -521,16 +521,16 @@ ) ;; definition for method 3 of type enemy -(defmethod inspect enemy ((obj enemy)) - (when (not obj) - (set! obj obj) +(defmethod inspect enemy ((this enemy)) + (when (not this) + (set! this this) (goto cfg-79) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tenemy-flags: #x~X : (enemy-flag " (-> obj enemy-flags)) - (let ((s5-0 (-> obj enemy-flags))) + (format #t "~2Tenemy-flags: #x~X : (enemy-flag " (-> this enemy-flags)) + (let ((s5-0 (-> this enemy-flags))) (if (= (logand (enemy-flag actor-pause-backup) s5-0) (enemy-flag actor-pause-backup)) (format #t "lock-focus ") ) @@ -641,45 +641,45 @@ ) ) (format #t ")~%") - (format #t "~2Tenemy-info: ~A~%" (-> obj enemy-info)) - (format #t "~2Thit-points: ~D~%" (-> obj hit-points)) - (format #t "~2Tgnd-collide-with: ~D~%" (-> obj gnd-collide)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tpersistent-attack-id: ~D~%" (-> obj persistent-attack-id)) - (format #t "~2Twater-max-height: ~f~%" (-> obj water-max-height)) - (format #t "~2Twater-surface-height: ~f~%" (-> obj water-surface-height)) - (format #t "~2Tdesired-angle: ~f~%" (-> obj desired-angle)) - (format #t "~2Tjump-why: ~D~%" (-> obj jump-why)) - (format #t "~2Tpenetrated-by-all: ~D~%" (-> obj penetrated-by-all)) - (format #t "~2Tpenetrate-flinch: ~D~%" (-> obj penetrated-flinch)) - (format #t "~2Tpenetrate-knocked: ~D~%" (-> obj penetrated-knocked)) - (format #t "~2Treaction-time: ~D~%" (-> obj reaction-time)) - (format #t "~2Tnotice-time: ~D~%" (-> obj notice-time)) - (format #t "~2Tstate-timeout: ~D~%" (-> obj state-timeout)) - (format #t "~2Tauto-reset-penetrate-time: ~D~%" (-> obj auto-reset-penetrate-time)) - (format #t "~2Thit-focus-time: ~D~%" (-> obj hit-focus-time)) - (format #t "~2Tlast-draw-time: ~D~%" (-> obj last-draw-time)) - (format #t "~2Tstarting-time: ~D~%" (-> obj starting-time)) - (format #t "~2Tfated-time: ~D~%" (-> obj fated-time)) - (format #t "~2Tfocus-pos: ~`vector`P~%" (-> obj focus-pos)) - (format #t "~2Tevent-param-point: ~`vector`P~%" (-> obj event-param-point)) - (format #t "~2Tjump-dest: ~`vector`P~%" (-> obj event-param-point)) - (format #t "~2Tfocus: #~%" (-> obj focus)) - (format #t "~2Tincoming: #~%" (-> obj incoming)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-1 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-1 (-> obj actor-group s5-1)) + (format #t "~2Tenemy-info: ~A~%" (-> this enemy-info)) + (format #t "~2Thit-points: ~D~%" (-> this hit-points)) + (format #t "~2Tgnd-collide-with: ~D~%" (-> this gnd-collide)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tpersistent-attack-id: ~D~%" (-> this persistent-attack-id)) + (format #t "~2Twater-max-height: ~f~%" (-> this water-max-height)) + (format #t "~2Twater-surface-height: ~f~%" (-> this water-surface-height)) + (format #t "~2Tdesired-angle: ~f~%" (-> this desired-angle)) + (format #t "~2Tjump-why: ~D~%" (-> this jump-why)) + (format #t "~2Tpenetrated-by-all: ~D~%" (-> this penetrated-by-all)) + (format #t "~2Tpenetrate-flinch: ~D~%" (-> this penetrated-flinch)) + (format #t "~2Tpenetrate-knocked: ~D~%" (-> this penetrated-knocked)) + (format #t "~2Treaction-time: ~D~%" (-> this reaction-time)) + (format #t "~2Tnotice-time: ~D~%" (-> this notice-time)) + (format #t "~2Tstate-timeout: ~D~%" (-> this state-timeout)) + (format #t "~2Tauto-reset-penetrate-time: ~D~%" (-> this auto-reset-penetrate-time)) + (format #t "~2Thit-focus-time: ~D~%" (-> this hit-focus-time)) + (format #t "~2Tlast-draw-time: ~D~%" (-> this last-draw-time)) + (format #t "~2Tstarting-time: ~D~%" (-> this starting-time)) + (format #t "~2Tfated-time: ~D~%" (-> this fated-time)) + (format #t "~2Tfocus-pos: ~`vector`P~%" (-> this focus-pos)) + (format #t "~2Tevent-param-point: ~`vector`P~%" (-> this event-param-point)) + (format #t "~2Tjump-dest: ~`vector`P~%" (-> this event-param-point)) + (format #t "~2Tfocus: #~%" (-> this focus)) + (format #t "~2Tincoming: #~%" (-> this incoming)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-1 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-1 (-> this actor-group s5-1)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Tneck: ~A~%" (-> obj neck)) - (format #t "~2Ton-notice: ~A~%" (-> obj on-notice)) - (format #t "~2Ton-active: ~A~%" (-> obj on-active)) - (format #t "~2Ton-hostile: ~A~%" (-> obj on-hostile)) - (format #t "~2Ton-death: ~A~%" (-> obj on-death)) - (format #t "~2Tidle-anim-player: #~%" (-> obj idle-anim-player)) - (format #t "~2Trand-gen: ~A~%" (-> obj rand-gen)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tneck: ~A~%" (-> this neck)) + (format #t "~2Ton-notice: ~A~%" (-> this on-notice)) + (format #t "~2Ton-active: ~A~%" (-> this on-active)) + (format #t "~2Ton-hostile: ~A~%" (-> this on-hostile)) + (format #t "~2Ton-death: ~A~%" (-> this on-death)) + (format #t "~2Tidle-anim-player: #~%" (-> this idle-anim-player)) + (format #t "~2Trand-gen: ~A~%" (-> this rand-gen)) (label cfg-79) - obj + this ) ;; definition of type anim-info @@ -693,26 +693,26 @@ ) ;; definition for method 3 of type anim-info -(defmethod inspect anim-info ((obj anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect anim-info ((this anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) - (format #t "~1Ttravel-speed: (meters ~m)~%" (-> obj travel-speed)) + (format #t "[~8x] ~A~%" this 'anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~1Ttravel-speed: (meters ~m)~%" (-> this travel-speed)) (label cfg-4) - obj + this ) ;; definition for method 12 of type enemy-focus -(defmethod try-update-focus enemy-focus ((obj enemy-focus) (arg0 process-focusable) (arg1 enemy)) +(defmethod try-update-focus enemy-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy)) (let* ((t9-0 (method-of-type focus try-update-focus)) - (s3-0 (t9-0 obj arg0)) + (s3-0 (t9-0 this arg0)) ) (when (not s3-0) - (logclear! (-> obj flags) (enemy-flag lock-focus)) - (set! (-> obj aware) + (logclear! (-> this flags) (enemy-flag lock-focus)) + (set! (-> this aware) (the-as enemy-aware (enemy-method-61 arg1 (the-as int (update-target-awareness! arg1 arg0 (the-as enemy-best-focus #f)))) @@ -724,13 +724,13 @@ ) ;; definition for method 13 of type enemy-focus -(defmethod enemy-focus-method-13 enemy-focus ((obj enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-focus-method-13 enemy-focus ((this enemy-focus) (arg0 process-focusable) (arg1 enemy-aware)) (let* ((t9-0 (method-of-type focus try-update-focus)) - (v0-0 (t9-0 obj arg0)) + (v0-0 (t9-0 this arg0)) ) - (set! (-> obj aware) arg1) + (set! (-> this aware) arg1) (if (not v0-0) - (logclear! (-> obj flags) (enemy-flag lock-focus)) + (logclear! (-> this flags) (enemy-flag lock-focus)) ) v0-0 ) @@ -738,11 +738,11 @@ ;; definition for method 9 of type enemy-focus ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod clear-focused enemy-focus ((obj enemy-focus)) +(defmethod clear-focused enemy-focus ((this enemy-focus)) (let ((t9-0 (method-of-type focus clear-focused))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj aware) (enemy-aware enemy-aware-0)) - (logclear! (-> obj flags) (enemy-flag lock-focus)) + (set! (-> this aware) (enemy-aware enemy-aware-0)) + (logclear! (-> this flags) (enemy-flag lock-focus)) (none) ) diff --git a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc index 231c339131..6f288b66dc 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc @@ -3,9 +3,9 @@ ;; definition for method 9 of type enemy-info ;; WARN: Return type mismatch int vs none. -(defmethod copy-enemy-info! enemy-info ((obj enemy-info) (obj-to-copy enemy-info)) +(defmethod copy-enemy-info! enemy-info ((this enemy-info) (obj-to-copy enemy-info)) "Copies the given [[enemy-info]] into the current [[enemy-info]]" - (mem-copy! (&-> obj type) (&-> obj-to-copy type) 384) + (mem-copy! (&-> this type) (&-> obj-to-copy type) 384) 0 (none) ) @@ -23,24 +23,24 @@ ;; definition for method 7 of type enemy ;; WARN: Return type mismatch process-focusable vs enemy. -(defmethod relocate enemy ((obj enemy) (arg0 int)) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method enemy 7)) this arg0) ) ) ;; definition for method 117 of type enemy -(defmethod get-rand-float enemy ((obj enemy)) +(defmethod get-rand-float enemy ((this enemy)) "@returns the result of calling [[rand-vu]]" (rand-vu) ) ;; definition for method 118 of type enemy -(defmethod get-rand-float-range enemy ((obj enemy) (low float) (high float)) +(defmethod get-rand-float-range enemy ((this enemy) (low float) (high float)) "@param low The lower bound of the range (inclusive) @param high The upper bound of the range (exclusive) @returns A random float in the specified range" @@ -48,7 +48,7 @@ ) ;; definition for method 119 of type enemy -(defmethod get-rand-int enemy ((obj enemy) (high int)) +(defmethod get-rand-int enemy ((this enemy) (high int)) "@param high The upper bound of the range (exclusive) @returns a random integer in the range 0 to `high` @see [[rand-vu]]" @@ -56,7 +56,7 @@ ) ;; definition for method 121 of type enemy -(defmethod get-rand-int-range enemy ((obj enemy) (low int) (high int)) +(defmethod get-rand-int-range enemy ((this enemy) (low int) (high int)) "@param low The lower bound of the range (inclusive) @param high The upper bound of the range (exclusive) @returns A random integer in the specified range" @@ -64,7 +64,7 @@ ) ;; definition for method 122 of type enemy -(defmethod rng-hit? enemy ((obj enemy) (chance float)) +(defmethod rng-hit? enemy ((this enemy) (chance float)) "TODO - not the best name @param chance The value to compare ([[>=]]) with the result from [[rand-vu]]. @returns If `chance` is greater than the random draw" @@ -73,7 +73,7 @@ ;; definition for method 120 of type enemy ;; WARN: new jak 2 until loop case, check carefully -(defmethod enemy-method-120 enemy ((obj enemy) (arg0 int) (arg1 int)) +(defmethod enemy-method-120 enemy ((this enemy) (arg0 int) (arg1 int)) "TODO" (let ((v1-0 0) (s5-0 0) @@ -88,7 +88,7 @@ ) ) (when (> v1-0 0) - (let ((v1-1 (get-rand-int obj v1-0)) + (let ((v1-1 (get-rand-int this v1-0)) (a0-1 1) ) (until #f @@ -114,7 +114,7 @@ ) ;; definition for method 123 of type enemy -(defmethod enemy-method-123 enemy ((obj enemy) (arg0 float)) +(defmethod enemy-method-123 enemy ((this enemy) (arg0 float)) "TODO" (let* ((v1-5 (-> *display* frames (-> *display* last-screen) run-time)) (f1-2 (fmax 0.0 (fmin 1.0 (* 0.001 (+ -7000.0 (the float v1-5)))))) @@ -124,26 +124,26 @@ ) ;; definition for method 60 of type enemy -(defmethod coin-flip? enemy ((obj enemy)) +(defmethod coin-flip? enemy ((this enemy)) "@returns The result of a 50/50 RNG roll" - (zero? (get-rand-int obj 2)) + (zero? (get-rand-int this 2)) ) ;; definition for method 12 of type enemy ;; WARN: disable def twice: 40. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod run-logic? enemy ((obj enemy)) +(defmethod run-logic? enemy ((this enemy)) (cond - ((logtest? (-> obj mask) (process-mask actor-pause)) - (let ((draw (-> obj draw))) + ((logtest? (-> this mask) (process-mask actor-pause)) + (let ((draw (-> this draw))) (or (and (nonzero? draw) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (camera-pos)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (camera-pos)) ) (or (logtest? (-> draw status) (draw-control-status on-screen)) - (not (and (-> obj next-state) (= (-> obj next-state name) 'idle))) + (not (and (-> this next-state) (= (-> this next-state name) 'idle))) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) (and (nonzero? draw) (logtest? (-> draw status) (draw-control-status uninited))) ) ) @@ -156,15 +156,15 @@ ;; definition for method 53 of type enemy ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-53 enemy ((obj enemy) (proc-focus process-focusable)) +(defmethod enemy-method-53 enemy ((this enemy) (proc-focus process-focusable)) "TODO" - (the-as symbol (and proc-focus (!= obj proc-focus) (collide-check? (-> obj focus) proc-focus))) + (the-as symbol (and proc-focus (!= this proc-focus) (collide-check? (-> this focus) proc-focus))) ) ;; definition for method 20 of type enemy -(defmethod get-trans enemy ((obj enemy) (arg0 int)) +(defmethod get-trans enemy ((this enemy) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((s4-0 (-> obj root))) + (let ((s4-0 (-> this root))) (cond ((zero? arg0) (-> s4-0 trans) @@ -173,11 +173,11 @@ (-> s4-0 gspot-pos) ) ((= arg0 2) - (vector<-cspace! (new 'static 'vector) (-> obj node-list data (-> obj enemy-info look-at-joint))) + (vector<-cspace! (new 'static 'vector) (-> this node-list data (-> this enemy-info look-at-joint))) ) ((= arg0 3) - (let ((v0-0 (vector<-cspace! (new 'static 'vector) (-> obj node-list data (-> obj enemy-info bullseye-joint))))) - (set! (-> v0-0 w) (-> obj root root-prim prim-core world-sphere w)) + (let ((v0-0 (vector<-cspace! (new 'static 'vector) (-> this node-list data (-> this enemy-info bullseye-joint))))) + (set! (-> v0-0 w) (-> this root root-prim prim-core world-sphere w)) v0-0 ) ) @@ -189,46 +189,46 @@ ) ;; definition for method 124 of type enemy -(defmethod enemy-method-124 enemy ((obj enemy)) +(defmethod enemy-method-124 enemy ((this enemy)) "TODO" - (let* ((v1-0 (-> obj enemy-info)) - (v0-0 (if (logtest? (enemy-flag use-trigger) (-> obj enemy-flags)) + (let* ((v1-0 (-> this enemy-info)) + (v0-0 (if (logtest? (enemy-flag use-trigger) (-> this enemy-flags)) (-> v1-0 recover-gnd-collide-with) (-> v1-0 gnd-collide-with) ) ) ) - (set! (-> obj gnd-collide) (the-as uint v0-0)) + (set! (-> this gnd-collide) (the-as uint v0-0)) v0-0 ) ) ;; definition for method 59 of type enemy -(defmethod get-penetrate-info enemy ((obj enemy)) +(defmethod get-penetrate-info enemy ((this enemy)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" - (penetrated-by-all&hit-points->penetrated-by (-> obj penetrated-by-all) (-> obj hit-points)) + (penetrated-by-all&hit-points->penetrated-by (-> this penetrated-by-all) (-> this hit-points)) ) ;; definition for method 24 of type enemy -(defmethod get-water-height enemy ((obj enemy)) - (-> obj water-surface-height) +(defmethod get-water-height enemy ((this enemy)) + (-> this water-surface-height) ) ;; definition for method 54 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-54 enemy ((obj enemy)) - (let ((s4-0 (-> obj root))) - (when (>= (-> obj water-max-height) (-> s4-0 trans y)) +(defmethod enemy-method-54 enemy ((this enemy)) + (let ((s4-0 (-> this root))) + (when (>= (-> this water-max-height) (-> s4-0 trans y)) (let ((s5-0 (new 'stack-no-clear 'water-info))) (water-info-init! s4-0 s5-0 (collide-action solid semi-solid)) (let ((s3-0 (-> s5-0 flags))) (when (logtest? (water-flags touch-water) s3-0) - (logior! (-> obj enemy-flags) (enemy-flag directed-ready)) - (set! (-> obj water-surface-height) (-> s5-0 trans y)) - (when (not (focus-test? obj touch-water under-water)) + (logior! (-> this enemy-flags) (enemy-flag directed-ready)) + (set! (-> this water-surface-height) (-> s5-0 trans y)) + (when (not (focus-test? this touch-water under-water)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> obj root trans quad)) + (set! (-> s2-0 quad) (-> this root trans quad)) (set! (-> s2-0 y) (+ 409.6 (-> s5-0 trans y))) (let ((s1-0 (get-process *default-dead-pool* part-tracker #x4000))) (when s1-0 @@ -269,23 +269,23 @@ (cond ((logtest? s3-0 (water-flags dark-eco)) (sound-play "eco-splash") - (send-event obj 'instant-death) + (send-event this 'instant-death) ) (else (sound-play "splash") ) ) ) - (logior! (-> obj focus-status) (focus-status touch-water)) + (logior! (-> this focus-status) (focus-status touch-water)) (let* ((v1-32 (-> s4-0 root-prim prim-core)) (f0-5 (+ (-> v1-32 world-sphere y) (-> v1-32 world-sphere w))) ) - (if (focus-test? obj under-water) + (if (focus-test? this under-water) (set! f0-5 (+ -819.2 f0-5)) ) (if (< f0-5 (-> s5-0 trans y)) - (logior! (-> obj focus-status) (focus-status under-water)) - (logclear! (-> obj focus-status) (focus-status under-water)) + (logior! (-> this focus-status) (focus-status under-water)) + (logclear! (-> this focus-status) (focus-status under-water)) ) ) (return (the-as enemy-flag #f)) @@ -294,10 +294,10 @@ ) ) ) - (logclear! (-> obj focus-status) (focus-status touch-water under-water)) - (when (not (logtest? (enemy-flag use-trigger) (-> obj enemy-flags))) - (let ((v0-9 (logclear (-> obj enemy-flags) (enemy-flag directed-ready)))) - (set! (-> obj enemy-flags) v0-9) + (logclear! (-> this focus-status) (focus-status touch-water under-water)) + (when (not (logtest? (enemy-flag use-trigger) (-> this enemy-flags))) + (let ((v0-9 (logclear (-> this enemy-flags) (enemy-flag directed-ready)))) + (set! (-> this enemy-flags) v0-9) v0-9 ) ) @@ -311,7 +311,7 @@ - looks at the target and handles attacking @TODO Not extremely well understood yet" (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) (if (logtest? (enemy-flag use-trigger) (-> self enemy-flags)) @@ -339,7 +339,7 @@ ) ) (when (and (logtest? (-> self enemy-flags) (enemy-flag attackable-backup)) - (>= (- (current-time) (-> self auto-reset-penetrate-time)) (seconds 0.1)) + (time-elapsed? (-> self auto-reset-penetrate-time) (seconds 0.1)) ) (logclear! (-> self enemy-flags) (enemy-flag attackable-backup)) (set! (-> self root penetrated-by) (get-penetrate-info self)) @@ -365,17 +365,17 @@ ) ;; definition for method 136 of type enemy -(defmethod enemy-method-136 enemy ((obj enemy)) - (when (or (>= (- (current-time) (-> obj hit-focus-time)) (seconds 2)) - (and (handle->process (-> obj focus handle)) - (not (logtest? (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) +(defmethod enemy-method-136 enemy ((this enemy)) + (when (or (time-elapsed? (-> this hit-focus-time) (seconds 2)) + (and (handle->process (-> this focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) ) ) ) - (let ((v0-0 (logclear (-> obj enemy-flags) (enemy-flag look-at-focus)))) - (set! (-> obj enemy-flags) v0-0) + (let ((v0-0 (logclear (-> this enemy-flags) (enemy-flag look-at-focus)))) + (set! (-> this enemy-flags) v0-0) v0-0 ) ) @@ -413,9 +413,9 @@ ;; definition for method 107 of type enemy ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target enemy ((obj enemy)) +(defmethod get-enemy-target enemy ((this enemy)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" - (let ((v0-0 (handle->process (-> obj focus handle)))) + (let ((v0-0 (handle->process (-> this focus handle)))) (if (and v0-0 (not (and v0-0 (not (logtest? (-> (the-as process-focusable v0-0) focus-status) (focus-status disable dead ignore grabbed))) @@ -429,26 +429,26 @@ ) ;; definition for method 63 of type enemy -(defmethod enemy-method-63 enemy ((obj enemy) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 enemy ((this enemy) (arg0 process-focusable) (arg1 enemy-aware)) (if arg1 - (enemy-focus-method-13 (-> obj focus) arg0 arg1) - (try-update-focus (-> obj focus) arg0 obj) + (enemy-focus-method-13 (-> this focus) arg0 arg1) + (try-update-focus (-> this focus) arg0 this) ) ) ;; definition for method 62 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-62 enemy ((obj enemy)) - (when (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (let* ((s4-0 (handle->process (-> obj incoming attacker-handle))) +(defmethod enemy-method-62 enemy ((this enemy)) + (when (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) + (let* ((s4-0 (handle->process (-> this incoming attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) ) - (when (enemy-method-53 obj (the-as process-focusable s5-0)) - (enemy-method-63 obj (the-as process-focusable s5-0) (the-as enemy-aware #f)) - (logior! (-> obj focus flags) (enemy-flag lock-focus)) + (when (enemy-method-53 this (the-as process-focusable s5-0)) + (enemy-method-63 this (the-as process-focusable s5-0) (the-as enemy-aware #f)) + (logior! (-> this focus flags) (enemy-flag lock-focus)) ) ) ) @@ -457,17 +457,19 @@ ) ;; definition for method 108 of type enemy -(defmethod enemy-method-108 enemy ((obj enemy) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 enemy ((this enemy) (arg0 enemy) (arg1 event-message-block)) (let ((s4-0 (the-as touching-shapes-entry (-> arg1 param 0)))) (when (and s4-0 - (and (logtest? (-> obj incoming penetrate-using) 4096) (not (logtest? (-> obj incoming penetrate-using) 32))) + (and (logtest? (-> this incoming penetrate-using) 4096) + (not (logtest? (-> this incoming penetrate-using) 32)) + ) (begin (let ((s3-0 (-> s4-0 head))) (while s3-0 (let ((s2-0 (get-touched-prim s3-0 (-> arg0 root) s4-0))) - (get-touched-prim s3-0 (-> obj root) s4-0) + (get-touched-prim s3-0 (-> this root) s4-0) (when (logtest? (-> s2-0 prim-core action) (collide-action solid semi-solid deadly)) - (let* ((a0-5 obj) + (let* ((a0-5 this) (t9-2 (method-of-object a0-5 enemy-method-104)) (a1-3 arg0) (a2-3 s4-0) @@ -494,81 +496,81 @@ ;; definition for method 64 of type enemy ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-64 enemy ((obj enemy)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod enemy-method-64 enemy ((this enemy)) + (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) ) 0 - (logior! (-> obj draw status) (draw-control-status no-draw)) - (logior! (-> obj focus-status) (focus-status disable)) - (go (method-of-object obj dormant)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (logior! (-> this focus-status) (focus-status disable)) + (go (method-of-object this dormant)) (none) ) ;; definition for method 65 of type enemy ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-65 enemy ((obj enemy)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod enemy-method-65 enemy ((this enemy)) + (let ((v1-1 (-> this root root-prim))) (set! (-> v1-1 prim-core collide-as) (collide-spec)) (set! (-> v1-1 prim-core collide-with) (collide-spec)) ) 0 - (logior! (-> obj draw status) (draw-control-status no-draw)) - (logior! (-> obj focus-status) (focus-status disable)) - (go (method-of-object obj dormant-aware)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (logior! (-> this focus-status) (focus-status disable)) + (go (method-of-object this dormant-aware)) (none) ) ;; definition for method 67 of type enemy -(defmethod go-stare enemy ((obj enemy)) - (go (method-of-object obj stare)) +(defmethod go-stare enemy ((this enemy)) + (go (method-of-object this stare)) ) ;; definition for method 68 of type enemy -(defmethod go-stare2 enemy ((obj enemy)) - (go (method-of-object obj stare)) +(defmethod go-stare2 enemy ((this enemy)) + (go (method-of-object this stare)) ) ;; definition for method 70 of type enemy -(defmethod go-hostile enemy ((obj enemy)) - (go (method-of-object obj hostile)) +(defmethod go-hostile enemy ((this enemy)) + (go (method-of-object this hostile)) ) ;; definition for method 66 of type enemy -(defmethod go-ambush enemy ((obj enemy)) - (go (method-of-object obj ambush)) +(defmethod go-ambush enemy ((this enemy)) + (go (method-of-object this ambush)) ) ;; definition for method 71 of type enemy -(defmethod go-flee enemy ((obj enemy)) - (go (method-of-object obj flee)) +(defmethod go-flee enemy ((this enemy)) + (go (method-of-object this flee)) ) ;; definition for method 69 of type enemy -(defmethod go-directed enemy ((obj enemy)) - (go (method-of-object obj directed)) +(defmethod go-directed enemy ((this enemy)) + (go (method-of-object this directed)) ) ;; definition for method 72 of type enemy -(defmethod react-to-focus enemy ((obj enemy)) +(defmethod react-to-focus enemy ((this enemy)) "@TODO - flesh out docs" - (let ((s5-0 (-> obj focus aware))) + (let ((s5-0 (-> this focus aware))) (cond - ((and (= s5-0 (enemy-aware enemy-aware-3)) (get-enemy-target obj)) - (go-hostile obj) + ((and (= s5-0 (enemy-aware enemy-aware-3)) (get-enemy-target this)) + (go-hostile this) ) ((<= (the-as int s5-0) 0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((>= 1 (the-as int s5-0)) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ((= s5-0 (enemy-aware unaware)) - (go-flee obj) + (go-flee this) ) (else - (go-stare obj) + (go-stare this) ) ) ) @@ -576,34 +578,34 @@ ;; definition for method 93 of type enemy ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 enemy ((obj enemy)) - (if (logtest? (enemy-flag alert) (-> obj enemy-flags)) - (go-directed obj) - (react-to-focus obj) +(defmethod enemy-method-93 enemy ((this enemy)) + (if (logtest? (enemy-flag alert) (-> this enemy-flags)) + (go-directed this) + (react-to-focus this) ) (none) ) ;; definition for method 73 of type enemy -(defmethod kill-prefer-falling enemy ((obj enemy)) +(defmethod kill-prefer-falling enemy ((this enemy)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (if (-> obj enemy-info use-die-falling) - (go (method-of-object obj die-falling)) - (go (method-of-object obj die)) + (if (-> this enemy-info use-die-falling) + (go (method-of-object this die-falling)) + (go (method-of-object this die)) ) ) ;; definition for method 135 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-135 enemy ((obj enemy) (arg0 int)) +(defmethod enemy-method-135 enemy ((this enemy) (arg0 int)) (let ((gp-0 (make-u128 0 0))) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (set! gp-0 (the-as uint (-> obj enemy-info sound-hit))) + (set! gp-0 (the-as uint (-> this enemy-info sound-hit))) ) ((= v1-0 1) - (set! gp-0 (the-as uint (-> obj enemy-info sound-die))) + (set! gp-0 (the-as uint (-> this enemy-info sound-die))) ) ) ) @@ -615,8 +617,8 @@ ;; definition for method 94 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-94 enemy ((obj enemy) (arg0 vector) (arg1 float)) - (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) +(defmethod enemy-method-94 enemy ((this enemy) (arg0 vector) (arg1 float)) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> arg0 quad)) @@ -629,22 +631,22 @@ ) ;; definition for method 95 of type enemy -(defmethod enemy-method-95 enemy ((obj enemy) (arg0 vector) (arg1 float)) - (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj root trans)))) - (enemy-method-94 obj v1-1 arg1) +(defmethod enemy-method-95 enemy ((this enemy) (arg0 vector) (arg1 float)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans)))) + (enemy-method-94 this v1-1 arg1) ) ) ;; definition for method 96 of type enemy -(defmethod enemy-method-96 enemy ((obj enemy) (arg0 float) (arg1 symbol)) - (let ((a0-2 (handle->process (-> obj focus handle)))) +(defmethod enemy-method-96 enemy ((this enemy) (arg0 float) (arg1 symbol)) + (let ((a0-2 (handle->process (-> this focus handle)))) (cond (a0-2 (let ((s4-1 - (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) (-> obj root trans)) + (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) (-> this root trans)) ) ) - (enemy-method-94 obj s4-1 arg0) + (enemy-method-94 this s4-1 arg0) ) ) (else @@ -655,47 +657,47 @@ ) ;; definition for method 104 of type enemy -(defmethod enemy-method-104 enemy ((obj enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) - (let ((v1-1 (-> obj enemy-info attack-damage))) +(defmethod enemy-method-104 enemy ((this enemy) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + (let ((v1-1 (-> this enemy-info attack-damage))) (if (and (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) (= v1-1 1)) (set! v1-1 2) ) (when (send-event arg0 'attack arg1 (static-attack-info ((id arg2) - (shove-back (-> obj enemy-info attack-shove-back)) - (shove-up (-> obj enemy-info attack-shove-up)) - (mode (-> obj enemy-info attack-mode)) + (shove-back (-> this enemy-info attack-shove-back)) + (shove-up (-> this enemy-info attack-shove-up)) + (mode (-> this enemy-info attack-mode)) (damage (the float v1-1)) (knock (the-as uint 8)) ) ) ) - (enemy-method-105 obj arg0) + (enemy-method-105 this arg0) #t ) ) ) ;; definition for method 105 of type enemy -(defmethod enemy-method-105 enemy ((obj enemy) (arg0 process)) +(defmethod enemy-method-105 enemy ((this enemy) (arg0 process)) (when (logtest? (process-mask target bot) (-> arg0 mask)) - (set! (-> obj root penetrated-by) (the-as penetrate -1)) - (enemy-method-49 obj) + (set! (-> this root penetrated-by) (the-as penetrate -1)) + (enemy-method-49 this) ) (let ((s5-0 (if (type? arg0 process-focusable) arg0 ) ) ) - (when (enemy-method-53 obj (the-as process-focusable s5-0)) - (let ((v1-10 (handle->process (-> obj focus handle)))) - (when (or (= s5-0 v1-10) (and (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (or (not v1-10) (not (logtest? (-> obj focus flags) (enemy-flag lock-focus)))) + (when (enemy-method-53 this (the-as process-focusable s5-0)) + (let ((v1-10 (handle->process (-> this focus handle)))) + (when (or (= s5-0 v1-10) (and (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) + (or (not v1-10) (not (logtest? (-> this focus flags) (enemy-flag lock-focus)))) ) ) - (enemy-method-63 obj (the-as process-focusable s5-0) (the-as enemy-aware #f)) - (set! (-> obj hit-focus-time) (current-time)) - (let ((v0-3 (logior (-> obj enemy-flags) (enemy-flag look-at-focus)))) - (set! (-> obj enemy-flags) v0-3) + (enemy-method-63 this (the-as process-focusable s5-0) (the-as enemy-aware #f)) + (set-time! (-> this hit-focus-time)) + (let ((v0-3 (logior (-> this enemy-flags) (enemy-flag look-at-focus)))) + (set! (-> this enemy-flags) v0-3) v0-3 ) ) @@ -705,21 +707,21 @@ ) ;; definition for method 49 of type enemy -(defmethod enemy-method-49 enemy ((obj enemy)) - (logior! (-> obj enemy-flags) (enemy-flag attackable-backup)) +(defmethod enemy-method-49 enemy ((this enemy)) + (logior! (-> this enemy-flags) (enemy-flag attackable-backup)) (let ((v0-0 (current-time))) - (set! (-> obj auto-reset-penetrate-time) v0-0) + (set! (-> this auto-reset-penetrate-time) v0-0) v0-0 ) ) ;; definition for method 50 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-50 enemy ((obj enemy) (arg0 vector)) - (set! (-> arg0 quad) (-> obj incoming attack-direction quad)) +(defmethod enemy-method-50 enemy ((this enemy) (arg0 vector)) + (set! (-> arg0 quad) (-> this incoming attack-direction quad)) (let ((v1-1 arg0)) (when (= (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))) 0.0) - (vector-z-quaternion! arg0 (-> obj root quat)) + (vector-z-quaternion! arg0 (-> this root quat)) (vector-negate-in-place! arg0) ) ) @@ -729,7 +731,7 @@ ;; definition for method 131 of type enemy ;; WARN: Return type mismatch int vs uint. -(defmethod enemy-method-131 enemy ((obj enemy) (arg0 int)) +(defmethod enemy-method-131 enemy ((this enemy) (arg0 int)) (the-as uint (cond ((logtest? arg0 1024) 7 @@ -762,66 +764,66 @@ ;; definition for method 106 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-106 enemy ((obj enemy) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) - (set! (-> obj incoming penetrate-using) (the-as uint arg2)) - (set! (-> obj incoming attack-id) (-> arg3 id)) +(defmethod enemy-method-106 enemy ((this enemy) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) + (set! (-> this incoming penetrate-using) (the-as uint arg2)) + (set! (-> this incoming attack-id) (-> arg3 id)) (let ((v1-3 (if (logtest? (attack-mask knock) (-> arg3 mask)) (-> arg3 knock) - (enemy-method-131 obj arg2) + (enemy-method-131 this arg2) ) ) ) - (set! (-> obj incoming knocked-type) (the-as knocked-type v1-3)) + (set! (-> this incoming knocked-type) (the-as knocked-type v1-3)) (let ((a0-4 (current-time))) (cond ((!= v1-3 6) - (set! (-> obj incoming blue-juggle-count) (the-as uint 0)) + (set! (-> this incoming blue-juggle-count) (the-as uint 0)) 0 ) - ((>= (- (current-time) (-> obj incoming attack-time)) (seconds 1)) - (set! (-> obj incoming blue-juggle-count) (the-as uint 1)) + ((time-elapsed? (-> this incoming attack-time) (seconds 1)) + (set! (-> this incoming blue-juggle-count) (the-as uint 1)) ) (else - (+! (-> obj incoming blue-juggle-count) 1) + (+! (-> this incoming blue-juggle-count) 1) ) ) - (set! (-> obj incoming attack-time) a0-4) + (set! (-> this incoming attack-time) a0-4) ) (cond ((= v1-3 7) - (set! (-> obj incoming attack-direction quad) (-> arg3 vector quad)) + (set! (-> this incoming attack-direction quad) (-> arg3 vector quad)) ) (else (let ((s3-0 (new 'stack-no-clear 'attack-info))) - (attack-info-method-9 arg3 s3-0 (the-as process-drawable arg0) obj) - (set! (-> obj incoming attacker-pos quad) (-> s3-0 intersection quad)) - (set! (-> obj incoming attack-direction quad) (-> s3-0 attacker-velocity quad)) + (attack-info-method-9 arg3 s3-0 (the-as process-drawable arg0) this) + (set! (-> this incoming attacker-pos quad) (-> s3-0 intersection quad)) + (set! (-> this incoming attack-direction quad) (-> s3-0 attacker-velocity quad)) ) ) ) ) - (set! (-> obj incoming attacker-handle) (process->handle (enemy-method-134 obj arg0 arg3))) + (set! (-> this incoming attacker-handle) (process->handle (enemy-method-134 this arg0 arg3))) 0 (none) ) ;; definition for method 109 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod look-at-target! enemy ((obj enemy) (arg0 enemy-flag)) +(defmethod look-at-target! enemy ((this enemy) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" (case arg0 (((enemy-flag lock-focus)) - (logclear! (-> obj enemy-flags) (enemy-flag death-start)) - (logior! (-> obj enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> this enemy-flags) (enemy-flag death-start)) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) ) (((enemy-flag death-start)) - (logclear! (-> obj enemy-flags) (enemy-flag lock-focus)) - (logior! (-> obj enemy-flags) (enemy-flag death-start)) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (logior! (-> this enemy-flags) (enemy-flag death-start)) ) ) - (if (nonzero? (-> obj neck)) - (mode-set! (-> obj neck) (joint-mod-mode look-at)) + (if (nonzero? (-> this neck)) + (mode-set! (-> this neck) (joint-mod-mode look-at)) ) 0 (none) @@ -829,42 +831,42 @@ ;; definition for method 110 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod stop-looking-at-target! enemy ((obj enemy)) +(defmethod stop-looking-at-target! enemy ((this enemy)) "Will unset [[enemy-flag::death-start]] and [[enemy-flag::lock-focus]] and call [[joint-mod::shut-down]] if applicable" - (when (nonzero? (-> obj neck)) - (logclear! (-> obj enemy-flags) (enemy-flag lock-focus death-start)) - (shut-down (-> obj neck)) + (when (nonzero? (-> this neck)) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus death-start)) + (shut-down (-> this neck)) ) 0 (none) ) ;; definition for method 125 of type enemy -(defmethod enemy-method-125 enemy ((obj enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) - (when (find-ground (-> obj root) arg0 arg1 arg2 arg3 arg4) +(defmethod enemy-method-125 enemy ((this enemy) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) + (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) (let ((v0-1 (-> arg0 best-other-tri pat))) - (set! (-> obj root ground-pat) v0-1) + (set! (-> this root ground-pat) v0-1) v0-1 ) ) ) ;; definition for method 126 of type enemy -(defmethod enemy-above-ground? enemy ((obj enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float)) +(defmethod enemy-above-ground? enemy ((this enemy) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) (arg3 float) (arg4 float) (arg5 float)) "@returns if the enemy is above the ground or not @see [[above-ground?]]" - (above-ground? (-> obj root) arg0 arg1 arg2 arg3 arg4 arg5) + (above-ground? (-> this root) arg0 arg1 arg2 arg3 arg4 arg5) ) ;; definition for method 127 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-127 enemy ((obj enemy) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) +(defmethod enemy-method-127 enemy ((this enemy) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) (cond - ((enemy-method-125 obj s4-0 arg3 arg0 arg1 1024.0) - (let ((s5-1 (-> obj root))) + ((enemy-method-125 this s4-0 arg3 arg0 arg1 1024.0) + (let ((s5-1 (-> this root))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> obj root trans quad)) + (set! (-> s3-0 quad) (-> this root trans quad)) (set! (-> s3-0 y) (-> s4-0 best-other-tri intersect y)) (move-to-point! s5-1 s3-0) (let ((a0-3 (-> s4-0 best-other-tri normal)) @@ -885,7 +887,7 @@ #t ) (else - (let ((v1-11 (-> obj root))) + (let ((v1-11 (-> this root))) (logclear! (-> v1-11 status) (collide-status on-surface on-ground @@ -914,7 +916,7 @@ ) ) (if arg2 - (format 0 "WARNING: enemy::move-to-ground: failed to locate ground for ~S!~%" (-> obj name)) + (format 0 "WARNING: enemy::move-to-ground: failed to locate ground for ~S!~%" (-> this name)) ) #f ) @@ -925,8 +927,8 @@ ;; definition for method 128 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-128 enemy ((obj enemy) (arg0 vector) (arg1 move-above-ground-params)) - (let ((gp-0 (-> obj root))) +(defmethod enemy-method-128 enemy ((this enemy) (arg0 vector) (arg1 move-above-ground-params)) + (let ((gp-0 (-> this root))) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) (set! (-> arg1 old-gspot-pos quad) (-> gp-0 gspot-pos quad)) @@ -939,7 +941,7 @@ (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (cond - ((enemy-method-125 obj s2-0 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0) + ((enemy-method-125 this s2-0 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0) (when (>= (-> gp-0 gspot-pos y) (-> arg1 new-pos y)) (set! (-> arg1 on-ground?) #t) (set! (-> arg1 pat) (-> s2-0 best-other-tri pat)) @@ -1026,10 +1028,10 @@ ;; definition for method 111 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-111 enemy ((obj enemy)) - (let ((v1-0 (-> obj root))) +(defmethod enemy-method-111 enemy ((this enemy)) + (let ((v1-0 (-> this root))) (when (logtest? (-> v1-0 status) (collide-status touch-surface)) - (let ((f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 (-> obj enemy-info friction))))))) + (let ((f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 (-> this enemy-info friction))))))) (vector-float*! (-> v1-0 transv) (-> v1-0 transv) f0-1) ) 0 @@ -1041,7 +1043,7 @@ ;; definition for method 114 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! enemy ((obj enemy)) +(defmethod init-enemy-collision! enemy ((this enemy)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" 0 (none) @@ -1049,7 +1051,7 @@ ;; definition for method 115 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! enemy ((obj enemy)) +(defmethod init-enemy! enemy ((this enemy)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" 0 (none) @@ -1057,25 +1059,27 @@ ;; definition for method 116 of type enemy ;; WARN: Return type mismatch object vs none. -(defmethod go-idle enemy ((obj enemy)) - (go (method-of-object obj idle)) +(defmethod go-idle enemy ((this enemy)) + (go (method-of-object this idle)) (none) ) ;; definition for method 112 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod set-enemy-info! enemy ((obj enemy) (arg0 enemy-info)) +(defmethod set-enemy-info! enemy ((this enemy) (arg0 enemy-info)) "In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it @param info Set `enemy-info` accordingly" - (set! (-> obj enemy-info) arg0) - (when (and (!= (-> obj enemy-info neck-joint) -1) (zero? (-> obj neck))) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj (-> obj enemy-info neck-joint))) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 102400.0) - (set! (-> obj neck ignore-angle) 16384.0) + (set! (-> this enemy-info) arg0) + (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) + (set! (-> this neck) + (new 'process 'joint-mod (joint-mod-mode flex-blend) this (-> this enemy-info neck-joint)) + ) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) ) 0 (none) @@ -1084,112 +1088,112 @@ ;; definition for method 113 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-behaviour-and-stats! enemy ((obj enemy) (arg0 enemy-info)) +(defmethod init-enemy-behaviour-and-stats! enemy ((this enemy) (arg0 enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (local-vars (sv-16 res-tag)) - (when (coin-flip? obj) - (let ((a0-2 (-> obj node-list data 2))) + (when (coin-flip? this) + (let ((a0-2 (-> this node-list data 2))) (set! (-> a0-2 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!)) (set! (-> a0-2 param1) #f) (set! (-> a0-2 param2) #f) ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag dislike-combo) (-> obj enemy-flags)))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag dislike-combo) (-> this enemy-flags)))) ) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj enemy-flags) (enemy-flag notice)) - (set-enemy-info! obj arg0) - (let ((a1-2 (-> obj enemy-info idle-anim-script))) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask actor-pause)) + (logior! (-> this enemy-flags) (enemy-flag notice)) + (set-enemy-info! this arg0) + (let ((a1-2 (-> this enemy-info idle-anim-script))) (if a1-2 - (idle-control-method-9 (-> obj idle-anim-player) a1-2) + (idle-control-method-9 (-> this idle-anim-player) a1-2) ) ) - (if (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) (new - 'process - 'shadow-control - (-> obj enemy-info shadow-min-y) - (-> obj enemy-info shadow-max-y) - (-> obj enemy-info shadow-locus-dist) - (shadow-flags shdf00 shdf04) - 245760.0 - ) + (if (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new + 'process + 'shadow-control + (-> this enemy-info shadow-min-y) + (-> this enemy-info shadow-max-y) + (-> this enemy-info shadow-locus-dist) + (shadow-flags shdf00 shdf04) + 245760.0 + ) ) - (set! (-> obj draw shadow-ctrl) *enemy-dummy-shadow-control*) + (set! (-> this draw shadow-ctrl) *enemy-dummy-shadow-control*) ) - (set! (-> obj water-max-height) 8192.0) + (set! (-> this water-max-height) 8192.0) (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) - (set! (-> obj hit-points) (* (-> obj enemy-info default-hit-points) 2)) - (set! (-> obj hit-points) (-> obj enemy-info default-hit-points)) + (set! (-> this hit-points) (* (-> this enemy-info default-hit-points) 2)) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) ) (let* ((v1-38 *game-info*) (a0-10 (+ (-> v1-38 attack-id) 1)) ) (set! (-> v1-38 attack-id) a0-10) - (set! (-> obj attack-id) a0-10) + (set! (-> this attack-id) a0-10) ) (let* ((v1-39 *game-info*) (a0-12 (+ (-> v1-39 attack-id) 1)) ) (set! (-> v1-39 attack-id) a0-12) - (set! (-> obj persistent-attack-id) a0-12) + (set! (-> this persistent-attack-id) a0-12) ) - (set! (-> obj incoming attacker-handle) (the-as handle #f)) - (enemy-method-124 obj) - (set! (-> obj fact) (new - 'process - 'fact-info-enemy - obj - (the-as (pointer float) (-> arg0 fact-defaults)) - (pickup-type eco-pill-random) - (-> *FACT-bank* default-eco-pill-green-inc) - ) + (set! (-> this incoming attacker-handle) (the-as handle #f)) + (enemy-method-124 this) + (set! (-> this fact) (new + 'process + 'fact-info-enemy + this + (the-as (pointer float) (-> arg0 fact-defaults)) + (pickup-type eco-pill-random) + (-> *FACT-bank* default-eco-pill-green-inc) + ) ) - (let ((a1-5 (if (logtest? (enemy-option multi-focus) (-> obj fact enemy-options)) + (let ((a1-5 (if (logtest? (enemy-option multi-focus) (-> this fact enemy-options)) #x400406 #x400402 ) ) ) - (reset-to-collide-spec (-> obj focus) (the-as collide-spec a1-5)) + (reset-to-collide-spec (-> this focus) (the-as collide-spec a1-5)) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-49 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-49 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-49 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-49)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-49)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice symbol)) - (set! (-> obj on-active) (res-lump-struct (-> obj entity) 'on-active symbol)) - (set! (-> obj on-hostile) (res-lump-struct (-> obj entity) 'on-hostile symbol)) - (set! (-> obj on-death) (res-lump-struct (-> obj entity) 'on-death symbol)) - (if (-> obj on-notice) - (logior! (-> obj enemy-flags) (enemy-flag auto-reset-penetrate)) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice symbol)) + (set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active symbol)) + (set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile symbol)) + (set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death symbol)) + (if (-> this on-notice) + (logior! (-> this enemy-flags) (enemy-flag auto-reset-penetrate)) ) - (if (-> obj on-active) - (logior! (-> obj enemy-flags) (enemy-flag jump-check-blocked)) + (if (-> this on-active) + (logior! (-> this enemy-flags) (enemy-flag jump-check-blocked)) ) - (if (-> obj on-hostile) - (logior! (-> obj enemy-flags) (enemy-flag drawn-mirrored)) + (if (-> this on-hostile) + (logior! (-> this enemy-flags) (enemy-flag drawn-mirrored)) ) - (let ((s4-0 (-> obj root))) - (set! (-> obj penetrated-by-all) (-> s4-0 penetrated-by)) - (set! (-> s4-0 penetrated-by) (get-penetrate-info obj)) + (let ((s4-0 (-> this root))) + (set! (-> this penetrated-by-all) (-> s4-0 penetrated-by)) + (set! (-> s4-0 penetrated-by) (get-penetrate-info this)) (set! (-> s4-0 event-self) 'touched) ) - (set! (-> obj penetrated-flinch) (-> arg0 penetrate-flinch)) - (set! (-> obj penetrated-knocked) (-> arg0 penetrate-knocked)) - (set! (-> obj reaction-time) (the-as time-frame (get-rand-int-range obj 30 180))) - (let* ((v1-79 (-> obj enemy-flags)) - (a0-28 (-> obj fact enemy-options)) + (set! (-> this penetrated-flinch) (-> arg0 penetrate-flinch)) + (set! (-> this penetrated-knocked) (-> arg0 penetrate-knocked)) + (set! (-> this reaction-time) (the-as time-frame (get-rand-int-range this 30 180))) + (let* ((v1-79 (-> this enemy-flags)) + (a0-28 (-> this fact enemy-options)) (v1-80 (logior (enemy-flag enable-on-active checking-water @@ -1208,17 +1212,17 @@ (if (logtest? (enemy-option has-trigger) a0-28) (set! v1-80 (logior (enemy-flag called-dying) v1-80)) ) - (set! (-> obj enemy-flags) v1-80) + (set! (-> this enemy-flags) v1-80) ) - (logior! (-> obj mask) (process-mask collectable)) - (if (and (-> obj enemy-info move-to-ground) - (not (logtest? (enemy-flag vulnerable-backup) (-> obj enemy-flags))) - (not (logtest? (enemy-option ambush) (-> obj fact enemy-options))) + (logior! (-> this mask) (process-mask collectable)) + (if (and (-> this enemy-info move-to-ground) + (not (logtest? (enemy-flag vulnerable-backup) (-> this enemy-flags))) + (not (logtest? (enemy-option ambush) (-> this fact enemy-options))) ) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) + (enemy-method-127 this 40960.0 40960.0 #t (the-as collide-spec (-> this gnd-collide))) ) - (if (zero? (-> obj draw light-index)) - (set! (-> obj draw light-index) (the-as uint 10)) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) ) 0 (none) @@ -1297,20 +1301,20 @@ ;; definition for method 11 of type enemy ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! enemy ((obj enemy) (arg0 entity-actor)) +(defmethod init-from-entity! enemy ((this enemy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-enemy-collision! obj) - (process-drawable-from-entity! obj arg0) - (init-enemy! obj) - (when (>= (-> obj enemy-info gem-joint) 0) + (init-enemy-collision! this) + (process-drawable-from-entity! this arg0) + (init-enemy! this) + (when (>= (-> this enemy-info gem-joint) 0) (cond - ((and (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status save))) - (not (-> obj entity)) + ((and (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status save))) + (not (-> this entity)) ) (not (or (task-node-closed? (game-task-node city-win-introduction)) (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) @@ -1318,38 +1322,38 @@ This commonly includes things such as: ) ) (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-no-seg)) - (the-as int (-> obj enemy-info gem-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-no-seg)) + (the-as int (-> this enemy-info gem-seg)) ) ) (else (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-seg)) - (the-as int (-> obj enemy-info gem-no-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-seg)) + (the-as int (-> this enemy-info gem-no-seg)) ) - (add-connection *part-engine* obj (-> obj enemy-info gem-joint) obj 314 (-> obj enemy-info gem-offset)) + (add-connection *part-engine* this (-> this enemy-info gem-joint) this 314 (-> this enemy-info gem-offset)) ) ) ) - (let ((v1-28 (-> obj fact enemy-options))) + (let ((v1-28 (-> this fact enemy-options))) (cond ((logtest? (enemy-option spawner) v1-28) - (process-entity-status! obj (entity-perm-status dead) #t) - (go (method-of-object obj die-fast)) + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die-fast)) ) (*debug-view-anims* - (go (method-of-object obj view-anims)) + (go (method-of-object this view-anims)) ) ((logtest? (enemy-option dormant) v1-28) - (enemy-method-64 obj) + (enemy-method-64 this) ) ((logtest? (enemy-option dormant-aware) v1-28) - (enemy-method-65 obj) + (enemy-method-65 this) ) (else - (go-idle obj) + (go-idle this) ) ) ) @@ -1357,7 +1361,7 @@ This commonly includes things such as: ) ;; definition for method 98 of type enemy -(defmethod in-aggro-range? enemy ((obj enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? enemy ((this enemy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -1367,17 +1371,17 @@ This commonly includes things such as: ) ;; definition for method 99 of type enemy -(defmethod enemy-method-99 enemy ((obj enemy) (arg0 process-focusable)) +(defmethod enemy-method-99 enemy ((this enemy) (arg0 process-focusable)) #f ) ;; definition for method 11 of type enemy-focus ;; WARN: Return type mismatch int vs none. -(defmethod reset-to-collide-spec enemy-focus ((obj enemy-focus) (arg0 collide-spec)) +(defmethod reset-to-collide-spec enemy-focus ((this enemy-focus) (arg0 collide-spec)) (let ((t9-0 (method-of-type focus reset-to-collide-spec))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj aware) (enemy-aware enemy-aware-0)) + (set! (-> this aware) (enemy-aware enemy-aware-0)) 0 (none) ) @@ -1385,24 +1389,24 @@ This commonly includes things such as: ;; definition for method 129 of type enemy ;; WARN: Return type mismatch process vs none. ;; WARN: Function (method 129 enemy) has a return type of none, but the expression builder found a return statement. -(defmethod enemy-method-129 enemy ((obj enemy)) - (let ((gp-0 (-> obj focus))) +(defmethod enemy-method-129 enemy ((this enemy)) + (let ((gp-0 (-> this focus))) (let ((a1-0 (handle->process (-> gp-0 handle)))) (when a1-0 - (let ((v1-4 (-> obj enemy-flags))) + (let ((v1-4 (-> this enemy-flags))) (cond ((and a1-0 (not (logtest? (-> (the-as process-focusable a1-0) focus-status) (focus-status disable dead)))) (when (and (logtest? (enemy-flag trackable) v1-4) (not (logtest? (enemy-flag actor-pause-backup) v1-4)) (not (logtest? (-> gp-0 flags) (enemy-flag lock-focus))) ) - (enemy-method-97 obj) + (enemy-method-97 this) (return #f) ) (let ((v1-14 (enemy-method-61 - obj - (the-as int (update-target-awareness! obj (the-as process-focusable a1-0) (the-as enemy-best-focus #f))) + this + (the-as int (update-target-awareness! this (the-as process-focusable a1-0) (the-as enemy-best-focus #f))) ) ) ) @@ -1424,15 +1428,15 @@ This commonly includes things such as: (clear-focused gp-0) ) ) - (if (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (enemy-method-97 obj) + (if (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) + (enemy-method-97 this) ) (none) ) ;; definition for method 97 of type enemy -(defmethod enemy-method-97 enemy ((obj enemy)) - (let ((s4-0 (-> obj focus collide-with)) +(defmethod enemy-method-97 enemy ((this enemy)) + (let ((s4-0 (-> this focus collide-with)) (gp-0 (new 'stack-no-clear 'enemy-best-focus)) ) (set! (-> gp-0 proc) #f) @@ -1451,8 +1455,8 @@ This commonly includes things such as: ) ) ) - (if (and a1-1 (and a1-1 (not (logtest? (-> a1-1 focus-status) (focus-status disable dead)))) (!= obj a1-1)) - (update-target-awareness! obj a1-1 gp-0) + (if (and a1-1 (and a1-1 (not (logtest? (-> a1-1 focus-status) (focus-status disable dead)))) (!= this a1-1)) + (update-target-awareness! this a1-1 gp-0) ) ) ) @@ -1478,8 +1482,8 @@ This commonly includes things such as: ) ) ) - (if (and a1-3 (and a1-3 (not (logtest? (-> a1-3 focus-status) (focus-status disable dead)))) (!= obj a1-3)) - (update-target-awareness! obj a1-3 gp-0) + (if (and a1-3 (and a1-3 (not (logtest? (-> a1-3 focus-status) (focus-status disable dead)))) (!= this a1-3)) + (update-target-awareness! this a1-3 gp-0) ) ) ) @@ -1504,8 +1508,8 @@ This commonly includes things such as: ) ) ) - (if (and a1-5 (and a1-5 (not (logtest? (-> a1-5 focus-status) (focus-status disable dead)))) (!= obj a1-5)) - (update-target-awareness! obj a1-5 gp-0) + (if (and a1-5 (and a1-5 (not (logtest? (-> a1-5 focus-status) (focus-status disable dead)))) (!= this a1-5)) + (update-target-awareness! this a1-5 gp-0) ) ) ) @@ -1521,9 +1525,9 @@ This commonly includes things such as: (let ((s4-1 (-> gp-0 proc))) (when s4-1 (enemy-method-63 - obj + this (the-as process-focusable s4-1) - (the-as enemy-aware (enemy-method-61 obj (the-as int (-> gp-0 aware)))) + (the-as enemy-aware (enemy-method-61 this (the-as int (-> gp-0 aware)))) ) s4-1 ) @@ -1533,26 +1537,26 @@ This commonly includes things such as: ;; definition for method 57 of type enemy ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! enemy ((obj enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! enemy ((this enemy) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" - (let ((f30-0 (vector-vector-distance (get-trans arg0 0) (-> obj root trans))) + (let ((f30-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans))) (s3-1 #f) (s2-0 #f) ) (cond - ((< f30-0 (-> obj enemy-info proximity-notice-distance)) + ((< f30-0 (-> this enemy-info proximity-notice-distance)) (set! s3-1 #t) - (set! s2-0 (in-aggro-range? obj arg0 (the-as vector #f))) + (set! s2-0 (in-aggro-range? this arg0 (the-as vector #f))) ) (else - (let ((f0-1 (the-as float (-> obj enemy-info notice-distance)))) - (if (< 1 (the-as int (-> obj focus aware))) - (set! f0-1 (+ (the-as meters f0-1) (-> obj enemy-info notice-distance-delta))) + (let ((f0-1 (the-as float (-> this enemy-info notice-distance)))) + (if (< 1 (the-as int (-> this focus aware))) + (set! f0-1 (+ (the-as meters f0-1) (-> this enemy-info notice-distance-delta))) ) - (when (or (< f30-0 f0-1) (not (logtest? (-> obj enemy-flags) (enemy-flag enable-on-notice)))) - (set! s2-0 (in-aggro-range? obj arg0 (the-as vector #f))) + (when (or (< f30-0 f0-1) (not (logtest? (-> this enemy-flags) (enemy-flag enable-on-notice)))) + (set! s2-0 (in-aggro-range? this arg0 (the-as vector #f))) (if s2-0 (set! s3-1 #t) ) @@ -1563,7 +1567,7 @@ This commonly includes things such as: (let ((s3-2 (cond (s3-1 (cond - ((enemy-method-99 obj arg0) + ((enemy-method-99 this arg0) 4 ) (s2-0 @@ -1574,7 +1578,7 @@ This commonly includes things such as: ) ) ) - ((< f30-0 (-> obj fact idle-distance)) + ((< f30-0 (-> this fact idle-distance)) 1 ) (else @@ -1583,15 +1587,15 @@ This commonly includes things such as: ) ) ) - (when (and (> s3-2 0) (logtest? (enemy-flag called-dying) (-> obj enemy-flags))) + (when (and (> s3-2 0) (logtest? (enemy-flag called-dying) (-> this enemy-flags))) (cond - ((logtest? (enemy-option idle-til-trigger) (-> obj fact enemy-options)) - (if (not (enemy-method-130 obj f30-0)) + ((logtest? (enemy-option idle-til-trigger) (-> this fact enemy-options)) + (if (not (enemy-method-130 this f30-0)) (set! s3-2 0) ) ) (else - (if (and (< 1 s3-2) (not (enemy-method-130 obj f30-0))) + (if (and (< 1 s3-2) (not (enemy-method-130 this f30-0))) (set! s3-2 1) ) ) @@ -1610,8 +1614,8 @@ This commonly includes things such as: ) ;; definition for method 130 of type enemy -(defmethod enemy-method-130 enemy ((obj enemy) (arg0 float)) - (let* ((v1-0 (-> obj fact)) +(defmethod enemy-method-130 enemy ((this enemy) (arg0 float)) + (let* ((v1-0 (-> this fact)) (a2-0 (-> v1-0 trig-mask-count)) (a3-0 (-> v1-0 trig-mask)) ) @@ -1634,7 +1638,7 @@ This commonly includes things such as: ) (label cfg-17) (when (zero? t1-1) - (logclear! (-> obj enemy-flags) (enemy-flag called-dying)) + (logclear! (-> this enemy-flags) (enemy-flag called-dying)) (return #t) ) ) @@ -1644,29 +1648,29 @@ This commonly includes things such as: ) ;; definition for method 61 of type enemy -(defmethod enemy-method-61 enemy ((obj enemy) (arg0 int)) +(defmethod enemy-method-61 enemy ((this enemy) (arg0 int)) (let ((v1-1 (< 1 arg0))) (cond (v1-1 - (when (not (logtest? (-> obj enemy-flags) (enemy-flag spawn-gem))) - (logior! (-> obj enemy-flags) (enemy-flag spawn-gem)) - (set! (-> obj notice-time) (current-time)) + (when (not (logtest? (-> this enemy-flags) (enemy-flag spawn-gem))) + (logior! (-> this enemy-flags) (enemy-flag spawn-gem)) + (set-time! (-> this notice-time)) ) - (if (and (not (logtest? (-> obj enemy-flags) (enemy-flag chase-startup))) - (< (- (current-time) (-> obj notice-time)) (-> obj reaction-time)) + (if (and (not (logtest? (-> this enemy-flags) (enemy-flag chase-startup))) + (not (time-elapsed? (-> this notice-time) (-> this reaction-time))) ) (set! v1-1 #f) ) ) (else - (logclear! (-> obj enemy-flags) (enemy-flag spawn-gem)) + (logclear! (-> this enemy-flags) (enemy-flag spawn-gem)) ) ) (cond (v1-1 arg0 ) - ((or (zero? arg0) (>= (- (current-time) (-> obj last-draw-time)) (seconds 2))) + ((or (zero? arg0) (time-elapsed? (-> this last-draw-time) (seconds 2))) 0 ) (else @@ -1678,25 +1682,25 @@ This commonly includes things such as: ;; definition for method 74 of type enemy ;; INFO: Used lq/sq -(defmethod general-event-handler enemy ((obj enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler enemy ((this enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (s5-5 rgbaf) (sv-432 process) (sv-448 event-message-block)) (cond ((= arg2 'track) - (and (nonzero? (-> obj hit-points)) - (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) - (logtest? (enemy-flag check-water-backup) (-> obj enemy-flags)) + (and (nonzero? (-> this hit-points)) + (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) + (logtest? (enemy-flag check-water-backup) (-> this enemy-flags)) ) ) ((= arg2 'combo) - (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) + (and (not (logtest? (enemy-flag multi-focus) (-> this enemy-flags))) (nonzero? (-> this hit-points))) ) ((= arg2 'touch) - (enemy-method-75 obj arg0 arg3) + (enemy-method-75 this arg0 arg3) ) ((= arg2 'touched) - (when (logtest? (-> obj enemy-flags) (enemy-flag attackable-backup)) + (when (logtest? (-> this enemy-flags) (enemy-flag attackable-backup)) (let* ((s3-1 arg0) (v1-20 (if (type? s3-1 process-drawable) (the-as process-drawable s3-1) @@ -1721,39 +1725,39 @@ This commonly includes things such as: ) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s3-3) - (-> obj root) + (-> this root) (collide-action solid) (collide-action) ) ) - (set! (-> obj auto-reset-penetrate-time) (current-time)) + (set-time! (-> this auto-reset-penetrate-time)) ) ) ) ) ) - (enemy-method-76 obj arg0 arg3) + (enemy-method-76 this arg0 arg3) ) ((= arg2 'attack-invinc) (case (-> (the-as attack-info (-> arg3 param 1)) mode) (('endlessfall) - (let ((v1-31 (-> obj root root-prim))) + (let ((v1-31 (-> this root root-prim))) (set! (-> v1-31 prim-core collide-as) (collide-spec)) (set! (-> v1-31 prim-core collide-with) (collide-spec)) ) 0 - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ) ) ((= arg2 'attack) (let ((s2-0 (the-as object (-> arg3 param 1)))) - (when (!= (-> (the-as attack-info s2-0) id) (-> obj incoming attack-id)) + (when (!= (-> (the-as attack-info s2-0) id) (-> this incoming attack-id)) (cond - ((and (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + ((and (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) - (let* ((s1-0 obj) + (let* ((s1-0 this) (s0-0 (method-of-object s1-0 enemy-method-106)) ) (set! sv-432 arg0) @@ -1762,15 +1766,15 @@ This commonly includes things such as: (s0-0 s1-0 sv-432 sv-448 (the-as int a3-3) (the-as attack-info s2-0)) ) ) - (send-event (ppointer->process (-> obj parent)) 'child-hit) + (send-event (ppointer->process (-> this parent)) 'child-hit) 0 (if (not *debug-unkillable*) - (take-damage-from-attack obj arg0 arg3) + (take-damage-from-attack this arg0 arg3) ) - (let ((s2-1 (the-as attack-info (enemy-method-58 obj arg0 arg3)))) + (let ((s2-1 (the-as attack-info (enemy-method-58 this arg0 arg3)))) (when s2-1 - (logclear! (-> obj enemy-flags) (enemy-flag called-dying)) - (enemy-method-108 obj (the-as enemy arg0) arg3) + (logclear! (-> this enemy-flags) (enemy-flag called-dying)) + (enemy-method-108 this (the-as enemy arg0) arg3) (let ((a1-13 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-13 from) (process->ppointer arg0)) (set! (-> a1-13 num-params) arg1) @@ -1781,104 +1785,104 @@ This commonly includes things such as: (set! (-> a1-13 param 3) (-> arg3 param 3)) (set! (-> a1-13 param 4) (-> arg3 param 4)) (set! (-> a1-13 param 5) (-> arg3 param 5)) - (send-event-function obj a1-13) + (send-event-function this a1-13) ) ) ) ) (else - (set! (-> obj incoming attack-id) (-> (the-as attack-info s2-0) id)) - (enemy-method-75 obj arg0 arg3) + (set! (-> this incoming attack-id) (-> (the-as attack-info s2-0) id)) + (enemy-method-75 this arg0 arg3) ) ) ) ) ) ((= arg2 'hit-flinch) - (when (zero? (-> obj hit-points)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (when (zero? (-> this hit-points)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) #t ) ((= arg2 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (when (zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + (when (zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) 0 ) ) ) - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ((= arg2 'hit) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (if (zero? (-> obj hit-points)) - (kill-prefer-falling obj) - (go (method-of-object obj hit)) + (if (zero? (-> this hit-points)) + (kill-prefer-falling this) + (go (method-of-object this hit)) ) ) ((= arg2 'cue-chase) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (when (and (> (-> this hit-points) 0) + (zero? (-> this fated-time)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) - (let ((v1-162 (logtest? (enemy-flag alert) (-> obj enemy-flags)))) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (let ((v1-162 (logtest? (enemy-flag alert) (-> this enemy-flags)))) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) (cond (v1-162 - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (go-hostile obj) + (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (go-ambush this) + (go-hostile this) ) ) - ((and (-> obj next-state) (let ((v1-173 (-> obj next-state name))) - (or (= v1-173 'dormant) (= v1-173 'dormant-aware)) - ) + ((and (-> this next-state) (let ((v1-173 (-> this next-state name))) + (or (= v1-173 'dormant) (= v1-173 'dormant-aware)) + ) ) - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (go (method-of-object obj notice)) + (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (go-ambush this) + (go (method-of-object this notice)) ) ) ) @@ -1887,114 +1891,114 @@ This commonly includes things such as: ) ) ((= arg2 'cue-wake) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (when (and (> (-> this hit-points) 0) + (zero? (-> this fated-time)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) - (logclear! (-> obj enemy-flags) (enemy-flag alert victory called-dying)) - (if (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go-ambush obj) - (react-to-focus obj) + (logclear! (-> this enemy-flags) (enemy-flag alert victory called-dying)) + (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (go-ambush this) + (react-to-focus this) ) #t ) ) ((= arg2 'jump) - (when (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (when (and (> (-> this hit-points) 0) + (zero? (-> this fated-time)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj jump-why) (-> arg3 param 0)) - (set! (-> obj event-param-point quad) (-> (the-as vector (-> arg3 param 1)) quad)) - (go (method-of-object obj jump)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this jump-why) (-> arg3 param 0)) + (set! (-> this event-param-point quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (go (method-of-object this jump)) ) ) ((= arg2 'death-start) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag recover) (-> obj enemy-flags)))) - (send-event (ppointer->process (-> obj parent)) 'child-die) - (drop-pickup (-> obj fact) #t *entity-pool* (-> obj fact) 0) - (let ((s5-1 (-> obj on-death))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag recover) (-> this enemy-flags)))) + (send-event (ppointer->process (-> this parent)) 'child-die) + (drop-pickup (-> this fact) #t *entity-pool* (-> this fact) 0) + (let ((s5-1 (-> this on-death))) (if s5-1 - (script-eval (the-as pair s5-1) :vector (-> obj root trans)) + (script-eval (the-as pair s5-1) :vector (-> this root trans)) ) ) ) ((= arg2 'death-end) - (if (-> obj skel effect) - (logior! (-> obj skel effect flags) (effect-control-flag ecf2)) + (if (-> this skel effect) + (logior! (-> this skel effect flags) (effect-control-flag ecf2)) ) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (set! (-> obj enemy-flags) (logclear (-> obj enemy-flags) (enemy-flag check-water))) + (logior! (-> this draw status) (draw-control-status no-draw)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (set! (-> this enemy-flags) (logclear (-> this enemy-flags) (enemy-flag check-water))) ) ((= arg2 'instant-death) - (when (and (> (-> obj hit-points) 0) (zero? (-> obj fated-time))) - (set! (-> obj hit-points) 0) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) - (let ((s5-2 (enemy-method-50 obj (new 'stack-no-clear 'vector)))) - (vector-z-quaternion! s5-2 (-> obj root quat)) + (when (and (> (-> this hit-points) 0) (zero? (-> this fated-time))) + (set! (-> this hit-points) 0) + (set! (-> this root penetrated-by) (get-penetrate-info this)) + (let ((s5-2 (enemy-method-50 this (new 'stack-no-clear 'vector)))) + (vector-z-quaternion! s5-2 (-> this root quat)) (vector-float*! s5-2 s5-2 -1.0) (vector-normalize! s5-2 1.0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (kill-prefer-falling obj) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (kill-prefer-falling this) ) ) ((= arg2 'die-fast) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (dispose! obj) - (send-event (ppointer->process (-> obj parent)) 'child-die) - (let ((s5-3 (-> obj on-death))) + (logior! (-> this draw status) (draw-control-status no-draw)) + (dispose! this) + (send-event (ppointer->process (-> this parent)) 'child-die) + (let ((s5-3 (-> this on-death))) (if s5-3 - (script-eval (the-as pair s5-3) :vector (-> obj root trans)) + (script-eval (the-as pair s5-3) :vector (-> this root trans)) ) ) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) ((= arg2 'victory) - (if (and (-> obj enemy-info use-victory) - (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) - (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (if (and (-> this enemy-info use-victory) + (not (and (-> this next-state) (= (-> this next-state name) 'victory))) + (> (-> this hit-points) 0) + (zero? (-> this fated-time)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) - (go (method-of-object obj victory)) + (go (method-of-object this victory)) ) ) ((= arg2 'nav-control) - (if (nonzero? (-> obj nav)) - (-> obj nav) + (if (nonzero? (-> this nav)) + (-> this nav) ) ) ((= arg2 'push-trans) - (move-by-vector! (-> obj root) (the-as vector (-> arg3 param 0))) + (move-by-vector! (-> this root) (the-as vector (-> arg3 param 0))) ) ((= arg2 'move-trans) - (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) + (move-to-point! (-> this root) (the-as vector (-> arg3 param 0))) ) ((= arg2 'shadow) (cond ((-> arg3 param 0) - (let ((v1-320 (-> obj draw shadow-ctrl))) + (let ((v1-320 (-> this draw shadow-ctrl))) (logclear! (-> v1-320 settings flags) (shadow-flags disable-draw)) ) 0 ) (else - (let ((v1-323 (-> obj draw shadow-ctrl))) + (let ((v1-323 (-> this draw shadow-ctrl))) (logior! (-> v1-323 settings flags) (shadow-flags disable-draw)) ) 0 @@ -2005,8 +2009,8 @@ This commonly includes things such as: (case (-> arg3 param 0) (('dark) (let ((f30-0 (rand-vu-float-range 0.2 1.0))) - (set-vector! (-> obj draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0) - (set! s5-5 (-> obj draw color-emissive)) + (set-vector! (-> this draw color-mult) (lerp 1.0 1.0 f30-0) (lerp 1.0 0.0 f30-0) (lerp 1.0 1.0 f30-0) 1.0) + (set! s5-5 (-> this draw color-emissive)) (set! (-> s5-5 x) (lerp 0.0 0.3 f30-0)) (set! (-> s5-5 y) (lerp 0.0 0.0 f30-0)) (set! (-> s5-5 z) (lerp 0.0 0.3 f30-0)) @@ -2015,8 +2019,8 @@ This commonly includes things such as: s5-5 ) ((#f) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (set! s5-5 (-> obj draw color-emissive)) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set! s5-5 (-> this draw color-emissive)) (set! (-> s5-5 quad) (the-as uint128 0)) s5-5 ) @@ -2026,24 +2030,24 @@ This commonly includes things such as: ) ;; definition for method 56 of type enemy -(defmethod damage-amount-from-attack enemy ((obj enemy) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack enemy ((this enemy) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let ((v1-0 (the-as attack-info (-> arg1 param 1)))) (if (logtest? (attack-mask damage) (-> v1-0 mask)) (the int (-> v1-0 damage)) - (penetrate-using->damage (the-as penetrate (-> obj incoming penetrate-using))) + (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using))) ) ) ) ;; definition for method 58 of type enemy -(defmethod enemy-method-58 enemy ((obj enemy) (arg0 process) (arg1 event-message-block)) - (let ((v1-0 (-> obj incoming penetrate-using))) +(defmethod enemy-method-58 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) + (let ((v1-0 (-> this incoming penetrate-using))) (cond - ((logtest? (the-as penetrate v1-0) (-> obj penetrated-flinch)) + ((logtest? (the-as penetrate v1-0) (-> this penetrated-flinch)) 'hit-flinch ) - ((logtest? (the-as penetrate v1-0) (-> obj penetrated-knocked)) + ((logtest? (the-as penetrate v1-0) (-> this penetrated-knocked)) 'hit-knocked ) (else @@ -2054,39 +2058,39 @@ This commonly includes things such as: ) ;; definition for method 48 of type enemy -(defmethod take-damage-from-attack enemy ((obj enemy) (arg0 process) (arg1 event-message-block)) - (let* ((v1-1 (damage-amount-from-attack obj arg0 arg1)) - (s5-0 (-> obj hit-points)) +(defmethod take-damage-from-attack enemy ((this enemy) (arg0 process) (arg1 event-message-block)) + (let* ((v1-1 (damage-amount-from-attack this arg0 arg1)) + (s5-0 (-> this hit-points)) (s4-1 (max 0 (- s5-0 v1-1))) ) - (when (and (zero? s4-1) (nonzero? s5-0) (= (-> obj incoming knocked-type) (knocked-type knocked-type-6))) + (when (and (zero? s4-1) (nonzero? s5-0) (= (-> this incoming knocked-type) (knocked-type knocked-type-6))) (cond - ((zero? (-> obj fated-time)) - (set! (-> obj fated-time) (current-time)) + ((zero? (-> this fated-time)) + (set-time! (-> this fated-time)) (set! s4-1 1) ) (else - (if (< (- (current-time) (-> obj fated-time)) (seconds 1)) + (if (not (time-elapsed? (-> this fated-time) (seconds 1))) (set! s4-1 1) ) ) ) ) - (set! (-> obj hit-points) s4-1) - (if (not (logtest? (-> obj enemy-flags) (enemy-flag attackable-backup))) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) + (set! (-> this hit-points) s4-1) + (if (not (logtest? (-> this enemy-flags) (enemy-flag attackable-backup))) + (set! (-> this root penetrated-by) (get-penetrate-info this)) ) (- s5-0 s4-1) ) ) ;; definition for method 134 of type enemy -(defmethod enemy-method-134 enemy ((obj enemy) (arg0 process) (arg1 attack-info)) +(defmethod enemy-method-134 enemy ((this enemy) (arg0 process) (arg1 attack-info)) (find-offending-process-focusable arg0 arg1) ) ;; definition for method 75 of type enemy -(defmethod enemy-method-75 enemy ((obj enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-75 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) (let* ((touch-entry (the-as touching-shapes-entry (-> arg1 param 0))) (s2-0 arg0) (s3-0 (if (type? s2-0 process-focusable) @@ -2096,39 +2100,39 @@ This commonly includes things such as: ) (when (and (the-as uint touch-entry) s3-0) (cond - ((and (focus-test? obj dangerous) + ((and (focus-test? this dangerous) (and s3-0 (not (logtest? (-> s3-0 focus-status) (focus-status disable dead ignore grabbed)))) ((method-of-type touching-shapes-entry prims-touching-action?) touch-entry - (-> obj root) + (-> this root) (collide-action deadly) (collide-action) ) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) touch-entry - (-> obj root) + (-> this root) (collide-action persistent-attack) (collide-action) ) - (-> obj persistent-attack-id) - (-> obj attack-id) + (-> this persistent-attack-id) + (-> this attack-id) ) ) ) - (enemy-method-104 obj arg0 touch-entry a3-2) + (enemy-method-104 this arg0 touch-entry a3-2) ) ) ((and ((method-of-type touching-shapes-entry prims-touching-action?) touch-entry - (-> obj root) + (-> this root) (collide-action no-standon) (collide-action) ) - (not (logtest? (-> obj root penetrated-by) (-> s3-0 root penetrate-using))) + (not (logtest? (-> this root penetrated-by) (-> s3-0 root penetrate-using))) ) - (if (send-shoves (-> obj root) arg0 touch-entry 0.7 6144.0 16384.0) - (send-event obj 'bouncing-off arg0) + (if (send-shoves (-> this root) arg0 touch-entry 0.7 6144.0 16384.0) + (send-event this 'bouncing-off arg0) ) ) ) @@ -2137,34 +2141,34 @@ This commonly includes things such as: ) ;; definition for method 76 of type enemy -(defmethod enemy-method-76 enemy ((obj enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 enemy ((this enemy) (arg0 process) (arg1 event-message-block)) (let ((s4-0 (-> arg1 param 0))) (when s4-0 - (when (or (and (and (-> obj next-state) (= (-> obj next-state name) 'knocked)) + (when (or (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) (logtest? (process-mask crate) (-> arg0 mask)) ) - (and (and (-> obj next-state) (= (-> obj next-state name) 'jump)) + (and (and (-> this next-state) (= (-> this next-state name) 'jump)) (logtest? (process-mask target sidekick crate bot) (-> arg0 mask)) ) ) (when ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s4-0) - (-> obj root) + (-> this root) (collide-action solid semi-solid deadly) (collide-action) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s4-0) - (-> obj root) + (-> this root) (collide-action persistent-attack) (collide-action) ) - (-> obj persistent-attack-id) - (-> obj attack-id) + (-> this persistent-attack-id) + (-> this attack-id) ) ) ) - (enemy-method-104 obj arg0 (the-as touching-shapes-entry s4-0) a3-2) + (enemy-method-104 this arg0 (the-as touching-shapes-entry s4-0) a3-2) ) ) ) @@ -2216,7 +2220,7 @@ This commonly includes things such as: ) ;; definition for method 47 of type enemy -(defmethod enemy-method-47 enemy ((obj enemy) (arg0 vector)) +(defmethod enemy-method-47 enemy ((this enemy) (arg0 vector)) (let* ((f2-0 0.8) (f0-1 (fmax 0.0 (+ 1.0 (* 60.0 (seconds-per-frame) (+ -1.0 f2-0))))) ) @@ -2259,7 +2263,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (stop-looking-at-target! self) (logclear! (-> self enemy-flags) (enemy-flag spawn-gem chase-startup use-notice-distance)) (logior! (-> self enemy-flags) (enemy-flag enable-on-notice)) @@ -2281,9 +2285,7 @@ This commonly includes things such as: ) ) :trans (behavior () - (if (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) - (> (the-as int (-> self focus aware)) 0) - ) + (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (> (the-as int (-> self focus aware)) 0)) (go-virtual active) ) ) @@ -2294,7 +2296,7 @@ This commonly includes things such as: :post (behavior () (idle-control-method-10 (-> self idle-anim-player) self) (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) (ja-post) @@ -2340,9 +2342,7 @@ This commonly includes things such as: :enter (-> (method-of-type enemy dormant) enter) :exit (-> (method-of-type enemy dormant) exit) :trans (behavior () - (when (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) - (> (the-as int (-> self focus aware)) 0) - ) + (when (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (> (the-as int (-> self focus aware)) 0)) (if (logtest? (enemy-option ambush) (-> self fact enemy-options)) (go-ambush self) (go-virtual active) @@ -2352,7 +2352,7 @@ This commonly includes things such as: :code sleep-code :post (behavior () (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) ) @@ -2375,7 +2375,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self enemy-flags) (enemy-flag use-notice-distance)) (when (logtest? (-> self enemy-flags) (enemy-flag jump-check-blocked)) (logclear! (-> self enemy-flags) (enemy-flag jump-check-blocked)) @@ -2393,7 +2393,7 @@ This commonly includes things such as: ) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-3 (-> self focus aware))) (cond ((< (the-as int v1-3) 1) @@ -2421,7 +2421,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-3 (logior (-> self enemy-flags) (enemy-flag use-notice-distance)))) (set! (-> self enemy-flags) (logclear v1-3 (enemy-flag called-dying))) ) @@ -2478,7 +2478,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (look-at-target! self (enemy-flag lock-focus)) (logior! (-> self enemy-flags) (enemy-flag use-notice-distance)) (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) @@ -2497,7 +2497,7 @@ This commonly includes things such as: (go-virtual victory) ) (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((or (>= 2 (the-as int gp-0)) (not (get-enemy-target self))) (go-stare self) @@ -2529,12 +2529,12 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((gp-0 (-> self focus aware))) (cond ((>= 1 (the-as int gp-0)) @@ -2598,13 +2598,13 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (look-at-target! self (enemy-flag lock-focus)) (logclear! (-> self enemy-flags) (enemy-flag dangerous-backup)) (logclear! (-> self mask) (process-mask actor-pause)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (!= (-> self focus aware) (enemy-aware unaware)) (go-stare self) ) @@ -2626,25 +2626,25 @@ This commonly includes things such as: ) ;; definition for method 82 of type enemy -(defmethod enemy-method-82 enemy ((obj enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 enemy ((this enemy) (arg0 enemy-jump-info)) "@abstract" #f ) ;; definition for method 83 of type enemy ;; INFO: Used lq/sq -(defmethod enemy-method-83 enemy ((obj enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-83 enemy ((this enemy) (arg0 enemy-jump-info)) (set! (-> arg0 flags) (the-as uint 1)) - (set! (-> arg0 anim-speed) (get-rand-float-range obj 0.9 1.1)) + (set! (-> arg0 anim-speed) (get-rand-float-range this 0.9 1.1)) (set! (-> arg0 hang-time) 0) - (set! (-> arg0 dest-pos quad) (-> obj event-param-point quad)) - (set! (-> arg0 start-pos quad) (-> obj root trans quad)) + (set! (-> arg0 dest-pos quad) (-> this event-param-point quad)) + (set! (-> arg0 start-pos quad) (-> this root trans quad)) (let ((s4-0 (new 'stack-no-clear 'collide-query))) (if (enemy-above-ground? - obj + this s4-0 (-> arg0 dest-pos) - (the-as collide-spec (-> obj gnd-collide)) + (the-as collide-spec (-> this gnd-collide)) 8192.0 81920.0 1024.0 @@ -2652,14 +2652,14 @@ This commonly includes things such as: (set! (-> arg0 dest-pos y) (-> s4-0 best-other-tri intersect y)) ) ) - (enemy-method-84 obj arg0) + (enemy-method-84 this arg0) (none) ) ;; definition for method 84 of type enemy -(defmethod enemy-method-84 enemy ((obj enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 enemy ((this enemy) (arg0 enemy-jump-info)) (let* ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))) - (f0-2 (fmax (-> obj enemy-info jump-height-min) (* (-> obj enemy-info jump-height-factor) f0-0))) + (f0-2 (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0))) ) (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f0-2 -4.551111) ) @@ -2667,11 +2667,11 @@ This commonly includes things such as: ) ;; definition for method 86 of type enemy -(defmethod enemy-method-86 enemy ((obj enemy)) - (let ((gp-0 (-> obj root))) +(defmethod enemy-method-86 enemy ((this enemy)) + (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (find-ground (-> obj root) a1-0 (the-as collide-spec (-> obj gnd-collide)) 8192.0 81920.0 1024.0) + (find-ground (-> this root) a1-0 (the-as collide-spec (-> this gnd-collide)) 8192.0 81920.0 1024.0) ) (>= (-> gp-0 gspot-pos y) (-> gp-0 trans y)) ) @@ -2679,20 +2679,20 @@ This commonly includes things such as: ) ;; definition for method 85 of type enemy -(defmethod enemy-method-85 enemy ((obj enemy)) - (let* ((v1-0 (-> obj root)) +(defmethod enemy-method-85 enemy ((this enemy)) + (let* ((v1-0 (-> this root)) (f0-0 (-> v1-0 gspot-pos y)) ) (if (< (-> v1-0 trans y) f0-0) (set! (-> v1-0 trans y) f0-0) ) ) - (set! (-> obj root transv y) 0.0) + (set! (-> this root transv y) 0.0) ) ;; definition for method 92 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-92 enemy ((obj enemy) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 enemy ((this enemy) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" 0 @@ -2701,15 +2701,15 @@ This commonly includes things such as: ;; definition for method 91 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-91 enemy ((obj enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-91 enemy ((this enemy) (arg0 int) (arg1 enemy-jump-info)) (case arg0 ((2 3) - (logior! (-> obj enemy-flags) (enemy-flag directed)) + (logior! (-> this enemy-flags) (enemy-flag directed)) (let ((f30-0 (the float (-> arg1 hang-time)))) (let ((a1-3 (compute-trans-at-time (-> arg1 traj) f30-0 (new 'stack-no-clear 'vector)))) - (move-to-point! (-> obj root) a1-3) + (move-to-point! (-> this root) a1-3) ) - (let ((s5-1 (-> obj root transv))) + (let ((s5-1 (-> this root transv))) (compute-transv-at-time (-> arg1 traj) f30-0 s5-1) (vector-float*! s5-1 s5-1 300.0) ) @@ -2721,14 +2721,14 @@ This commonly includes things such as: ) ;; definition for method 89 of type enemy -(defmethod enemy-method-89 enemy ((obj enemy) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-89 enemy ((this enemy) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info jump-wind-up-anim))) - (a0-5 (-> obj skel root-channel 0)) + (let ((a1-3 (-> this draw art-group data (-> this enemy-info jump-wind-up-anim))) + (a0-5 (-> this skel root-channel 0)) ) (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-3)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) @@ -2740,19 +2740,19 @@ This commonly includes things such as: ) ;; definition for method 87 of type enemy -(defmethod enemy-method-87 enemy ((obj enemy) (arg0 enemy-jump-info)) - (let ((s5-0 (-> obj draw art-group data (-> obj enemy-info jump-in-air-anim)))) - (let ((v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) +(defmethod enemy-method-87 enemy ((this enemy) (arg0 enemy-jump-info)) + (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) + (let ((v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-6 (= v1-6 (-> obj draw art-group data (-> obj enemy-info jump-wind-up-anim)))) + ((and v1-6 (= v1-6 (-> this draw art-group data (-> this enemy-info jump-wind-up-anim)))) (ja-channel-push! 1 0) ) (else - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 param 0) 1.0) (joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) @@ -2760,7 +2760,7 @@ This commonly includes things such as: ) ) ) - (let ((a0-12 (-> obj skel root-channel 0))) + (let ((a0-12 (-> this skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim s5-0)) (set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) (set! (-> a0-12 param 1) (-> arg0 anim-speed)) @@ -2772,14 +2772,14 @@ This commonly includes things such as: ) ;; definition for method 88 of type enemy -(defmethod enemy-method-88 enemy ((obj enemy) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-88 enemy ((this enemy) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.075)) - (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info jump-land-anim))) - (a0-5 (-> obj skel root-channel 0)) + (let ((a1-3 (-> this draw art-group data (-> this enemy-info jump-land-anim))) + (a0-5 (-> this skel root-channel 0)) ) (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-3)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) @@ -2791,16 +2791,16 @@ This commonly includes things such as: ) ;; definition for method 90 of type enemy -(defmethod enemy-method-90 enemy ((obj enemy) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 enemy ((this enemy) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (not (enemy-method-89 obj arg1)) + (not (enemy-method-89 this arg1)) ) ((= v1-0 1) (set! s5-0 (ja-done? 0)) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) @@ -2809,12 +2809,12 @@ This commonly includes things such as: s5-0 ) ((= v1-0 2) - (enemy-method-87 obj arg1) + (enemy-method-87 this arg1) #f ) ((= v1-0 3) (set! s5-0 (ja-done? 0)) - (let ((a0-9 (-> obj skel root-channel 0))) + (let ((a0-9 (-> this skel root-channel 0))) (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) (set! (-> a0-9 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) @@ -2823,11 +2823,11 @@ This commonly includes things such as: s5-0 ) ((= v1-0 4) - (not (enemy-method-88 obj arg1)) + (not (enemy-method-88 this arg1)) ) ((= v1-0 5) (set! s5-0 (ja-done? 0)) - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 param 0) (the float (+ (-> a0-14 frame-group frames num-frames) -1))) (set! (-> a0-14 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-14 (the-as art-joint-anim #f) num-func-seek!) @@ -2847,7 +2847,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (logior! (-> self focus-status) (focus-status dangerous)) (let* ((v1-6 *game-info*) @@ -2943,11 +2943,11 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (if (logtest? (enemy-flag alert) (-> self enemy-flags)) (go-virtual jump) (enemy-method-93 self) @@ -3027,45 +3027,45 @@ This commonly includes things such as: ;; definition for method 101 of type enemy ;; WARN: Return type mismatch collide-spec vs none. -(defmethod enemy-method-101 enemy ((obj enemy)) - (when (not (logtest? (enemy-flag use-trigger) (-> obj enemy-flags))) - (logior! (-> obj enemy-flags) (enemy-flag use-trigger)) - (logclear! (-> obj enemy-flags) (enemy-flag directed)) - (enemy-method-124 obj) +(defmethod enemy-method-101 enemy ((this enemy)) + (when (not (logtest? (enemy-flag use-trigger) (-> this enemy-flags))) + (logior! (-> this enemy-flags) (enemy-flag use-trigger)) + (logclear! (-> this enemy-flags) (enemy-flag directed)) + (enemy-method-124 this) ) (none) ) ;; definition for method 103 of type enemy -(defmethod enemy-method-103 enemy ((obj enemy)) - (when (logtest? (enemy-flag use-trigger) (-> obj enemy-flags)) - (logclear! (-> obj enemy-flags) (enemy-flag use-trigger directed)) - (enemy-method-124 obj) +(defmethod enemy-method-103 enemy ((this enemy)) + (when (logtest? (enemy-flag use-trigger) (-> this enemy-flags)) + (logclear! (-> this enemy-flags) (enemy-flag use-trigger directed)) + (enemy-method-124 this) ) ) ;; definition for method 102 of type enemy -(defmethod enemy-method-102 enemy ((obj enemy)) +(defmethod enemy-method-102 enemy ((this enemy)) #f ) ;; definition for method 100 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs symbol. -(defmethod enemy-method-100 enemy ((obj enemy)) +(defmethod enemy-method-100 enemy ((this enemy)) (local-vars (v0-1 vector)) - (when (not (-> obj enemy-info move-to-ground)) - (enemy-method-103 obj) + (when (not (-> this enemy-info move-to-ground)) + (enemy-method-103 this) (return (the-as symbol #f)) ) - (when (not (logtest? (enemy-flag directed) (-> obj enemy-flags))) - (let ((s5-0 (-> obj root))) - (if (focus-test? obj under-water) - (enemy-method-47 obj (-> s5-0 transv)) - (+! (-> s5-0 transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame))) + (when (not (logtest? (enemy-flag directed) (-> this enemy-flags))) + (let ((s5-0 (-> this root))) + (if (focus-test? this under-water) + (enemy-method-47 this (-> s5-0 transv)) + (+! (-> s5-0 transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) - (let ((v1-16 (-> obj enemy-info))) + (let ((v1-16 (-> this enemy-info))) (set! (-> a2-0 gnd-collide-with) (-> v1-16 recover-gnd-collide-with)) (set! (-> a2-0 popup) 8192.0) (set! (-> a2-0 dont-move-if-overlaps?) #t) @@ -3075,15 +3075,15 @@ This commonly includes things such as: ) (set! (-> a2-0 overlaps-params tlist) *touching-list*) (-> a2-0 overlaps-params) - (enemy-method-128 obj (-> s5-0 transv) a2-0) + (enemy-method-128 this (-> s5-0 transv) a2-0) ) ) ) - (logclear! (-> obj enemy-flags) (enemy-flag directed)) - (if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead)))) - (kill-prefer-falling obj) + (logclear! (-> this enemy-flags) (enemy-flag directed)) + (if (and (enemy-method-102 this) (not (logtest? (-> this focus-status) (focus-status dead)))) + (kill-prefer-falling this) ) - (let ((s5-1 (-> obj root)) + (let ((s5-1 (-> this root)) (a1-2 (new 'stack-no-clear 'collide-query)) (s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -3091,10 +3091,10 @@ This commonly includes things such as: (set! (-> s3-0 quad) (-> s5-1 gspot-pos quad)) (set! (-> s4-0 quad) (-> s5-1 gspot-normal quad)) (the-as symbol (cond - ((find-ground s5-1 a1-2 (-> obj enemy-info gnd-collide-with) 8192.0 81920.0 1024.0) + ((find-ground s5-1 a1-2 (-> this enemy-info gnd-collide-with) 8192.0 81920.0 1024.0) (let ((f0-4 (- (-> s5-1 trans y) (-> s5-1 gspot-pos y)))) (when (>= 409.6 (fabs f0-4)) - (enemy-method-103 obj) + (enemy-method-103 this) (return (the-as symbol #f)) v0-1 ) @@ -3113,7 +3113,7 @@ This commonly includes things such as: ;; definition for method 46 of type enemy ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-46 enemy ((obj enemy) (arg0 int)) +(defmethod enemy-method-46 enemy ((this enemy) (arg0 int)) "@abstract" 0 (none) @@ -3122,24 +3122,24 @@ This commonly includes things such as: ;; definition for method 52 of type enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 enemy ((obj enemy) (arg0 vector)) - (enemy-method-50 obj arg0) - (let ((s5-0 (-> obj enemy-info))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-52 enemy ((this enemy) (arg0 vector)) + (enemy-method-50 this arg0) + (let ((s5-0 (-> this enemy-info))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-2)) - (let ((f30-0 (get-rand-float-range obj 0.0 1.0))) + (let ((f30-0 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-hard-vxz-lo) (-> s5-0 knocked-hard-vxz-hi) f30-0)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-hard-vy-lo) (-> s5-0 knocked-hard-vy-hi) f30-0)) ) ) (((knocked-type knocked-type-1)) - (let ((f30-1 (get-rand-float-range obj 0.0 1.0))) + (let ((f30-1 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-medium-vxz-lo) (-> s5-0 knocked-medium-vxz-hi) f30-1)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-medium-vy-lo) (-> s5-0 knocked-medium-vy-hi) f30-1)) ) ) (((knocked-type knocked-type-3)) - (let ((f30-2 (get-rand-float-range obj 0.0 1.0))) + (let ((f30-2 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-huge-vxz-lo) (-> s5-0 knocked-huge-vxz-hi) f30-2)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-huge-vy-lo) (-> s5-0 knocked-huge-vy-hi) f30-2)) ) @@ -3147,44 +3147,44 @@ This commonly includes things such as: (((knocked-type knocked-type-4)) (vector-rotate90-around-y! arg0 arg0) (let ((v1-9 (new 'stack-no-clear 'vector))) - (vector-! v1-9 (-> obj incoming attacker-pos) (-> obj root trans)) + (vector-! v1-9 (-> this incoming attacker-pos) (-> this root trans)) (set! (-> v1-9 y) 0.0) (if (< 0.0 (vector-dot v1-9 arg0)) (vector-negate! arg0 arg0) ) ) - (let ((f30-3 (get-rand-float-range obj 0.0 1.0))) + (let ((f30-3 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-yellow-vxz-lo) (-> s5-0 knocked-yellow-vxz-hi) f30-3)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-yellow-vy-lo) (-> s5-0 knocked-yellow-vy-hi) f30-3)) ) ) (((knocked-type knocked-type-5)) - (let* ((f1-2 (vector-vector-xz-distance-squared (target-pos 0) (-> obj root trans))) + (let* ((f1-2 (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) (f0-26 1.0) (f2-0 61440.0) (f1-3 (fmin f1-2 (* f2-0 f2-0))) (f2-3 61440.0) - (f30-5 (* (- f0-26 (/ f1-3 (* f2-3 f2-3))) (get-rand-float-range obj 0.8 1.0))) + (f30-5 (* (- f0-26 (/ f1-3 (* f2-3 f2-3))) (get-rand-float-range this 0.8 1.0))) ) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-red-vxz-lo) (-> s5-0 knocked-red-vxz-hi) f30-5)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-red-vy-lo) (-> s5-0 knocked-red-vy-hi) f30-5)) ) ) (((knocked-type knocked-type-6)) - (let* ((f1-5 (vector-vector-xz-distance-squared (target-pos 0) (-> obj root trans))) + (let* ((f1-5 (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) (f0-34 1.0) (f2-6 122880.0) (f1-6 (fmin f1-5 (* f2-6 f2-6))) (f2-9 122880.0) - (f30-7 (* (- f0-34 (/ f1-6 (* f2-9 f2-9))) (get-rand-float-range obj 0.8 1.0))) + (f30-7 (* (- f0-34 (/ f1-6 (* f2-9 f2-9))) (get-rand-float-range this 0.8 1.0))) ) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-blue-vxz-lo) (-> s5-0 knocked-blue-vxz-hi) f30-7)) (cond - ((>= (the-as uint 4) (-> obj incoming blue-juggle-count)) + ((>= (the-as uint 4) (-> this incoming blue-juggle-count)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-blue-vy-lo) (-> s5-0 knocked-blue-vy-hi) f30-7)) ) (else - (if (zero? (get-rand-int obj 3)) + (if (zero? (get-rand-int this 3)) (set! (-> arg0 y) 40960.0) ) ) @@ -3192,10 +3192,10 @@ This commonly includes things such as: ) ) (((knocked-type knocked-type-7)) - (set! (-> arg0 quad) (-> obj incoming attack-direction quad)) + (set! (-> arg0 quad) (-> this incoming attack-direction quad)) ) (else - (let ((f30-8 (get-rand-float-range obj 0.0 1.0))) + (let ((f30-8 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-soft-vxz-lo) (-> s5-0 knocked-soft-vxz-hi) f30-8)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-soft-vy-lo) (-> s5-0 knocked-soft-vy-hi) f30-8)) ) @@ -3206,24 +3206,24 @@ This commonly includes things such as: ) ;; definition for method 51 of type enemy -(defmethod enemy-method-51 enemy ((obj enemy)) - (let ((f30-0 (quaternion-y-angle (-> obj root quat)))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-51 enemy ((this enemy)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (let ((a0-5 (handle->process (-> obj focus handle)))) + (let ((a0-5 (handle->process (-> this focus handle)))) (when a0-5 (let ((v1-9 (get-trans (the-as process-focusable a0-5) 0))) - (set! f30-0 (atan (- (-> v1-9 x) (-> obj root trans x)) (- (-> v1-9 z) (-> obj root trans z)))) + (set! f30-0 (atan (- (-> v1-9 x) (-> this root trans x)) (- (-> v1-9 z) (-> this root trans z)))) ) ) ) ) (else - (let* ((v1-13 (-> obj root transv)) + (let* ((v1-13 (-> this root transv)) (f28-0 (atan (-> v1-13 x) (-> v1-13 z))) (f1-2 (deg- f30-0 f28-0)) (f2-0 (fabs f1-2)) - (f0-6 (-> obj enemy-info knocked-seek-ry-clamp)) + (f0-6 (-> this enemy-info knocked-seek-ry-clamp)) ) (when (and (< f0-6 f2-0) (< f2-0 (- 32768.0 f0-6))) (set! f30-0 (+ (cond @@ -3255,10 +3255,10 @@ This commonly includes things such as: ) ;; definition for method 77 of type enemy -(defmethod enemy-method-77 enemy ((obj enemy) (arg0 (pointer float))) +(defmethod enemy-method-77 enemy ((this enemy) (arg0 (pointer float))) (ja-channel-push! 1 0) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info knocked-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -3270,9 +3270,9 @@ This commonly includes things such as: ) ;; definition for method 78 of type enemy -(defmethod enemy-method-78 enemy ((obj enemy) (arg0 (pointer float))) - (let ((v1-4 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-3 (-> obj skel root-channel 0)) +(defmethod enemy-method-78 enemy ((this enemy) (arg0 (pointer float))) + (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-3 (-> this skel root-channel 0)) ) (set! (-> a0-3 frame-group) (the-as art-joint-anim v1-4)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-4) frames num-frames) -1))) @@ -3284,8 +3284,8 @@ This commonly includes things such as: ) ;; definition for method 80 of type enemy -(defmethod enemy-method-80 enemy ((obj enemy) (arg0 enemy-knocked-info)) - (let ((gp-0 (-> obj root))) +(defmethod enemy-method-80 enemy ((this enemy) (arg0 enemy-knocked-info)) + (let ((gp-0 (-> this root))) (or (>= (-> arg0 on-surface-count) 3) (and (logtest? (-> gp-0 status) (collide-status on-ground)) (>= 16384.0 (-> gp-0 transv y))) (and (>= (-> arg0 move-count) 3) @@ -3301,12 +3301,12 @@ This commonly includes things such as: ) ;; definition for method 81 of type enemy -(defmethod enemy-method-81 enemy ((obj enemy)) - (let ((s5-0 (-> obj root)) +(defmethod enemy-method-81 enemy ((this enemy)) + (let ((s5-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) ) - (when (find-ground s5-0 a1-0 (-> obj enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) + (when (find-ground s5-0 a1-0 (-> this enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) (let ((f0-1 (- (-> s5-0 trans y) (-> s5-0 gspot-pos y)))) (if (and (>= f0-1 -1228.8) (>= 6144.0 f0-1)) (set! gp-0 #f) @@ -3318,36 +3318,36 @@ This commonly includes things such as: ) ;; definition for method 79 of type enemy -(defmethod enemy-method-79 enemy ((obj enemy) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 enemy ((this enemy) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (enemy-method-77 obj (the-as (pointer float) arg1)) + (enemy-method-77 this (the-as (pointer float) arg1)) (set! s5-0 #f) ) ((= v1-0 1) (set! s5-0 (ja-done? 0)) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) ) ) ((= v1-0 2) - (set! s5-0 (not (enemy-method-78 obj (the-as (pointer float) arg1)))) - (set! (-> obj incoming blue-juggle-count) (the-as uint 0)) + (set! s5-0 (not (enemy-method-78 this (the-as (pointer float) arg1)))) + (set! (-> this incoming blue-juggle-count) (the-as uint 0)) ) ((= v1-0 3) (set! s5-0 (ja-done? 0)) - (let ((a0-9 (-> obj skel root-channel 0))) + (let ((a0-9 (-> this skel root-channel 0))) (set! (-> a0-9 param 0) (the float (+ (-> a0-9 frame-group frames num-frames) -1))) (set! (-> a0-9 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-9 (the-as art-joint-anim #f) num-func-seek!) ) ) ((= v1-0 4) - (vector-reset! (-> obj root transv)) + (vector-reset! (-> this root transv)) (set! s5-0 #t) ) (else @@ -3363,7 +3363,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (stop-looking-at-target! self) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (logclear! (-> self mask) (process-mask actor-pause)) @@ -3473,7 +3473,7 @@ This commonly includes things such as: (set! (-> gp-0 on-surface-count) 0) (set! (-> gp-0 move-count) 0) (until (enemy-method-80 self gp-0) - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (kill-prefer-falling self) ) (if (logtest? (-> self root status) (collide-status on-surface)) @@ -3486,7 +3486,7 @@ This commonly includes things such as: ) ) (let ((s5-1 2)) - (set! (-> gp-0 land-can-land-time) (current-time)) + (set-time! (-> gp-0 land-can-land-time)) (until #f (if (logtest? (-> self root status) (collide-status on-surface)) (+! (-> gp-0 on-surface-count) 1) @@ -3498,17 +3498,14 @@ This commonly includes things such as: (+! (-> gp-0 move-count) 1) (set! s5-1 3) (if (enemy-method-80 self gp-0) - (set! (-> gp-0 land-can-land-time) (current-time)) + (set-time! (-> gp-0 land-can-land-time)) ) ) ) #f (label cfg-15) (if (and (not (logtest? (enemy-flag recover) (-> self enemy-flags))) - (or (>= (- (current-time) (-> gp-0 land-can-land-time)) (seconds 0.1)) - (enemy-method-81 self) - (enemy-method-102 self) - ) + (or (time-elapsed? (-> gp-0 land-can-land-time) (seconds 0.1)) (enemy-method-81 self) (enemy-method-102 self)) ) (kill-prefer-falling self) ) @@ -3548,46 +3545,48 @@ This commonly includes things such as: ) ;; definition for method 132 of type enemy -(defmethod dispose! enemy ((obj enemy)) +(defmethod dispose! enemy ((this enemy)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) - (set! (-> obj enemy-flags) - (the-as enemy-flag (logior (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) + (set! (-> this enemy-flags) + (the-as enemy-flag (logior (enemy-flag recover-applied-velocity) (-> this enemy-flags))) ) - (enemy-method-135 obj 1) - (when (and (>= (-> obj enemy-info gem-joint) 0) - (not (logtest? (enemy-flag cam-attack-mode) (-> obj enemy-flags))) - (or (and (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status save)))) - (-> obj entity) + (enemy-method-135 this 1) + (when (and (>= (-> this enemy-info gem-joint) 0) + (not (logtest? (enemy-flag cam-attack-mode) (-> this enemy-flags))) + (or (and (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status save)))) + (-> this entity) ) (task-node-closed? (game-task-node city-win-introduction)) (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) ) ) - (logior! (-> obj enemy-flags) (enemy-flag cam-attack-mode)) - (remove-from-process *part-engine* obj) + (logior! (-> this enemy-flags) (enemy-flag cam-attack-mode)) + (remove-from-process *part-engine* this) (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-no-seg)) - (the-as int (-> obj enemy-info gem-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-no-seg)) + (the-as int (-> this enemy-info gem-seg)) ) - (let ((a0-18 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj enemy-info gem-joint)))) + (let ((a0-18 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this enemy-info gem-joint))) + ) ) - (birth-pickup-at-point a0-18 (pickup-type gem) 1.0 #t *entity-pool* (-> obj fact)) + (birth-pickup-at-point a0-18 (pickup-type gem) 1.0 #t *entity-pool* (-> this fact)) ) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (logior! (-> obj focus-status) (focus-status dead)) - (if (-> obj skel effect) - (logior! (-> obj skel effect flags) (effect-control-flag ecf1)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag check-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (logior! (-> this focus-status) (focus-status dead)) + (if (-> this skel effect) + (logior! (-> this skel effect flags) (effect-control-flag ecf1)) ) - (stop-looking-at-target! obj) + (stop-looking-at-target! this) ) (none) ) @@ -3603,7 +3602,7 @@ This commonly includes things such as: (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self hit-points) 0) (enemy-method-103 self) ) @@ -3629,12 +3628,12 @@ This commonly includes things such as: ) ;; definition for method 133 of type enemy -(defmethod enemy-method-133 enemy ((obj enemy)) - (let ((s5-0 (-> obj root)) +(defmethod enemy-method-133 enemy ((this enemy)) + (let ((s5-0 (-> this root)) (a1-0 (new 'stack-no-clear 'collide-query)) (gp-0 #t) ) - (when (find-ground s5-0 a1-0 (-> obj enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) + (when (find-ground s5-0 a1-0 (-> this enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) (if (< (- (-> s5-0 trans y) (-> s5-0 gspot-pos y)) 8192.0) (set! gp-0 #f) ) diff --git a/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc b/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc index cfec1fe00a..23f913a6d7 100644 --- a/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc @@ -30,22 +30,22 @@ ) ;; definition for method 3 of type traffic-danger-info -(defmethod inspect traffic-danger-info ((obj traffic-danger-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-danger-info ((this traffic-danger-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-danger-info) - (format #t "~1Tsphere: #~%" (-> obj sphere)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tnotify-radius: ~f~%" (-> obj notify-radius)) - (format #t "~1Tdanger-level: ~f~%" (-> obj danger-level)) - (format #t "~1Tdecay-rate: ~f~%" (-> obj decay-rate)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tdanger-type: ~D~%" (-> obj danger-type)) + (format #t "[~8x] ~A~%" this 'traffic-danger-info) + (format #t "~1Tsphere: #~%" (-> this sphere)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tnotify-radius: ~f~%" (-> this notify-radius)) + (format #t "~1Tdanger-level: ~f~%" (-> this danger-level)) + (format #t "~1Tdecay-rate: ~f~%" (-> this decay-rate)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tdanger-type: ~D~%" (-> this danger-type)) (label cfg-4) - obj + this ) ;; definition of type traffic-suppression-params @@ -66,23 +66,23 @@ ) ;; definition for method 3 of type traffic-suppression-params -(defmethod inspect traffic-suppression-params ((obj traffic-suppression-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-suppression-params ((this traffic-suppression-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-suppression-params) - (format #t "~1Tbbox: #~%" (-> obj bbox)) - (format #t "~1Tduration: ~D~%" (-> obj duration)) - (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "[~8x] ~A~%" this 'traffic-suppression-params) + (format #t "~1Tbbox: #~%" (-> this bbox)) + (format #t "~1Tduration: ~D~%" (-> this duration)) + (format #t "~1Tid: ~D~%" (-> this id)) (label cfg-4) - obj + this ) ;; definition for method 11 of type traffic-suppression-params ;; WARN: Return type mismatch symbol vs none. -(defmethod has-valid-id? traffic-suppression-params ((obj traffic-suppression-params)) - (!= (-> obj id) -1) +(defmethod has-valid-id? traffic-suppression-params ((this traffic-suppression-params)) + (!= (-> this id) -1) (none) ) @@ -108,27 +108,27 @@ ) ;; definition for method 3 of type traffic-object-spawn-params -(defmethod inspect traffic-object-spawn-params ((obj traffic-object-spawn-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-object-spawn-params ((this traffic-object-spawn-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-object-spawn-params) - (format #t "~1Tobject-type: ~D~%" (-> obj object-type)) - (format #t "~1Tbehavior: ~D~%" (-> obj behavior)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tnav-mesh: ~A~%" (-> obj nav-mesh)) - (format #t "~1Tnav-branch: ~A~%" (-> obj nav-branch)) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Trotation: #~%" (-> obj rotation)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tguard-type: ~D~%" (-> obj guard-type)) - (format #t "~1Tuser-data: ~D~%" (-> obj user-data)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tproc: ~A~%" (-> obj proc)) + (format #t "[~8x] ~A~%" this 'traffic-object-spawn-params) + (format #t "~1Tobject-type: ~D~%" (-> this object-type)) + (format #t "~1Tbehavior: ~D~%" (-> this behavior)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~1Tnav-branch: ~A~%" (-> this nav-branch)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Trotation: #~%" (-> this rotation)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tguard-type: ~D~%" (-> this guard-type)) + (format #t "~1Tuser-data: ~D~%" (-> this user-data)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tproc: ~A~%" (-> this proc)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc index d2bfa14928..6c2f51b47b 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc @@ -28,24 +28,24 @@ ) ;; definition for method 3 of type talker-speech-class -(defmethod inspect talker-speech-class ((obj talker-speech-class)) - (when (not obj) - (set! obj obj) +(defmethod inspect talker-speech-class ((this talker-speech-class)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'talker-speech-class) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tchannel: ~D~%" (-> obj channel)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tspeech: ~D~%" (-> obj speech)) - (format #t "~1Ttext-message: ~D~%" (-> obj text-message)) - (format #t "~1Ttext-duration: ~D~%" (-> obj text-duration)) - (format #t "~1Tdelay: ~D~%" (-> obj delay)) - (format #t "~1Tpos: ~D~%" (-> obj pos)) - (format #t "~1Tneg: ~D~%" (-> obj neg)) - (format #t "~1Ton-close: ~A~%" (-> obj on-close)) + (format #t "[~8x] ~A~%" this 'talker-speech-class) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tchannel: ~D~%" (-> this channel)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tspeech: ~D~%" (-> this speech)) + (format #t "~1Ttext-message: ~D~%" (-> this text-message)) + (format #t "~1Ttext-duration: ~D~%" (-> this text-duration)) + (format #t "~1Tdelay: ~D~%" (-> this delay)) + (format #t "~1Tpos: ~D~%" (-> this pos)) + (format #t "~1Tneg: ~D~%" (-> this neg)) + (format #t "~1Ton-close: ~A~%" (-> this on-close)) (label cfg-4) - obj + this ) ;; definition of type talker @@ -76,28 +76,28 @@ ) ;; definition for method 3 of type talker -(defmethod inspect talker ((obj talker)) - (when (not obj) - (set! obj obj) +(defmethod inspect talker ((this talker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~2Tmessage: #~%" (-> obj message)) - (format #t "~2Ttotal-time: ~D~%" (-> obj total-time)) - (format #t "~2Ttotal-off-time: ~D~%" (-> obj total-off-time)) - (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tvoicebox: ~D~%" (-> obj voicebox)) - (format #t "~2Tvoice-id: ~D~%" (-> obj voice-id)) - (format #t "~2Tmessage-id: ~D~%" (-> obj message-id)) - (format #t "~2Tregion: #~%" (-> obj region)) - (format #t "~2Tinterp: ~f~%" (-> obj interp)) - (format #t "~2Tsave?: ~A~%" (-> obj save?)) + (format #t "~2Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~2Tmessage: #~%" (-> this message)) + (format #t "~2Ttotal-time: ~D~%" (-> this total-time)) + (format #t "~2Ttotal-off-time: ~D~%" (-> this total-off-time)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tvoicebox: ~D~%" (-> this voicebox)) + (format #t "~2Tvoice-id: ~D~%" (-> this voice-id)) + (format #t "~2Tmessage-id: ~D~%" (-> this message-id)) + (format #t "~2Tregion: #~%" (-> this region)) + (format #t "~2Tinterp: ~f~%" (-> this interp)) + (format #t "~2Tsave?: ~A~%" (-> this save?)) (label cfg-4) - obj + this ) ;; definition for symbol *talker-speech*, type (inline-array talker-speech-class) diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc index 0096ab3bed..d2f52b0f9c 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc @@ -113,43 +113,43 @@ ) ;; definition for method 9 of type talker-speech-class -(defmethod talker-speech-class-method-9 talker-speech-class ((obj talker-speech-class)) - (and (>= (-> *game-info* unknown-pad6 (* (-> obj speech) 2)) (-> obj pos)) - (>= (-> obj neg) (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1))) +(defmethod talker-speech-class-method-9 talker-speech-class ((this talker-speech-class)) + (and (>= (-> *game-info* unknown-pad6 (* (-> this speech) 2)) (-> this pos)) + (>= (-> this neg) (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1))) ) ) ;; definition for method 10 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod play-communicator-speech! talker-speech-class ((obj talker-speech-class)) +(defmethod play-communicator-speech! talker-speech-class ((this talker-speech-class)) "Plays the provided [[talker-speech-class]] @TODO - understand the array from [[game-info]] better" - (set! (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1)) (the-as uint #xffff)) + (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint #xffff)) 0 (none) ) ;; definition for method 11 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod talker-speech-class-method-11 talker-speech-class ((obj talker-speech-class)) - (set! (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1)) (the-as uint 0)) +(defmethod talker-speech-class-method-11 talker-speech-class ((this talker-speech-class)) + (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) (the-as uint 0)) 0 (none) ) ;; definition for method 12 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod talker-speech-class-method-12 talker-speech-class ((obj talker-speech-class) (arg0 int)) +(defmethod talker-speech-class-method-12 talker-speech-class ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) - (set! (-> *game-info* unknown-pad6 (* (-> obj speech) 2)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (* (-> obj speech) 2))) #xfff0 arg0)) + (set! (-> *game-info* unknown-pad6 (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (* (-> this speech) 2))) #xfff0 arg0)) ) - (set! (-> *game-info* unknown-pad6 (* (-> obj speech) 2)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (* (-> obj speech) 2))) 0 (- arg0))) + (set! (-> *game-info* unknown-pad6 (* (-> this speech) 2)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (* (-> this speech) 2))) 0 (- arg0))) ) ) - (if (talker-speech-class-method-9 obj) - (talker-spawn-func obj *entity-pool* (target-pos 0) (the-as region #f)) + (if (talker-speech-class-method-9 this) + (talker-spawn-func this *entity-pool* (target-pos 0) (the-as region #f)) ) 0 (none) @@ -157,13 +157,13 @@ ;; definition for method 13 of type talker-speech-class ;; WARN: Return type mismatch int vs none. -(defmethod talker-speech-class-method-13 talker-speech-class ((obj talker-speech-class) (arg0 int)) +(defmethod talker-speech-class-method-13 talker-speech-class ((this talker-speech-class) (arg0 int)) (if (>= arg0 0) - (set! (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1))) #xfff0 arg0)) + (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1))) #xfff0 arg0)) ) - (set! (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1)) - (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (+ (* (-> obj speech) 2) 1))) 0 (- arg0))) + (set! (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1)) + (the-as uint (seekl (the-as int (-> *game-info* unknown-pad6 (+ (* (-> this speech) 2) 1))) 0 (- arg0))) ) ) 0 @@ -257,7 +257,7 @@ (set! (-> self region) arg2) (set! (-> self total-time) 0) (set! (-> self total-off-time) 0) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self voicebox) (the-as handle #f)) (set! (-> self save?) #f) (if (logtest? (-> self message flags) 96) @@ -270,15 +270,15 @@ ) ;; definition for method 10 of type talker -(defmethod deactivate talker ((obj talker)) - (send-event (handle->process (-> obj voicebox)) 'die) - ((the-as (function process none) (find-parent-method talker 10)) obj) +(defmethod deactivate talker ((this talker)) + (send-event (handle->process (-> this voicebox)) 'die) + ((the-as (function process none) (find-parent-method talker 10)) this) (none) ) ;; definition for method 17 of type talker ;; WARN: Return type mismatch int vs none. -(defmethod talker-method-17 talker ((obj talker)) +(defmethod talker-method-17 talker ((this talker)) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 36 310 0.0 (font-color default) (font-flags shadow kerning)) ) @@ -287,10 +287,10 @@ (let ((v1-2 gp-0)) (set! (-> v1-2 scale) 0.75) ) - (case (-> obj message channel) + (case (-> this message channel) (((gui-channel notice)) (cond - ((logtest? (-> obj message flags) 128) + ((logtest? (-> this message flags) 128) (let ((v1-9 gp-0) (a1-1 36) (a0-4 140) @@ -322,14 +322,14 @@ (set! (-> v1-15 height) (the float 140)) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle large)) - (if (logtest? (-> obj message flags) 32) - (set! (-> gp-0 alpha) (-> obj interp)) + (if (logtest? (-> this message flags) 32) + (set! (-> gp-0 alpha) (-> this interp)) (set! (-> gp-0 alpha) 1.0) ) - (when (logtest? (-> obj message flags) 64) + (when (logtest? (-> this message flags) 64) (let ((s4-0 gp-0) (s3-0 36) - (v1-27 (the int (lerp-scale 400.0 f0-0 (-> obj interp) 0.0 1.0))) + (v1-27 (the int (lerp-scale 400.0 f0-0 (-> this interp) 0.0 1.0))) ) (set! (-> s4-0 origin x) (the float s3-0)) (set! (-> s4-0 origin y) (the float v1-27)) @@ -337,10 +337,10 @@ ) ) (let ((s4-1 print-game-text) - (a0-11 (lookup-text! *common-text* (-> obj message text-message) #f)) + (a0-11 (lookup-text! *common-text* (-> this message text-message) #f)) (a2-3 #f) (a3-2 44) - (v1-31 (-> obj message channel)) + (v1-31 (-> this message channel)) ) (s4-1 a0-11 @@ -363,7 +363,7 @@ :virtual #t :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (the-as time-frame (-> self message delay))) + (until (time-elapsed? gp-0 (the-as time-frame (-> self message delay))) (suspend) ) ) @@ -374,7 +374,7 @@ ) ) ) - (while (< (- (current-time) (-> self start-time)) (the-as time-frame (+ (-> self message delay) 300))) + (while (not (time-elapsed? (-> self start-time) (the-as time-frame (+ (-> self message delay) 300)))) (if (and (or (zero? (-> self voice-id)) (= (get-status *gui-control* (-> self voice-id)) (gui-status ready))) (or (zero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active))) ) @@ -390,7 +390,7 @@ (defstate active (talker) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (if (logtest? (-> self message flags) 1) (play-communicator-speech! (-> self message)) ) @@ -488,16 +488,16 @@ ) (set! v1-43 #t) (label cfg-39) - (and v1-43 (< (- (current-time) (-> self state-time)) (seconds 120))) + (and v1-43 (not (time-elapsed? (-> self state-time) (seconds 120)))) ) ) (and (nonzero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active)) - (or (< (- (current-time) (-> self state-time)) (the-as time-frame (-> self message text-duration))) + (or (not (time-elapsed? (-> self state-time) (the-as time-frame (-> self message text-duration)))) (and (logtest? (-> self message flags) 16) (-> self region) (region-method-9 (-> self region) (target-pos 0))) ) ) - (< (- (current-time) (-> self state-time)) (seconds 0.05)) + (not (time-elapsed? (-> self state-time) (seconds 0.05))) ) (when (and (nonzero? (-> self voice-id)) (not gp-1) (zero? (get-status *gui-control* (-> self voice-id)))) (remove-setting! 'music-volume) @@ -530,7 +530,7 @@ ) (when (and (logtest? (-> self message flags) 8) (not (-> self save?))) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 1)) + (until (time-elapsed? gp-2 (seconds 1)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc index 8ad1160bb6..8d49392b86 100644 --- a/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc @@ -27,34 +27,34 @@ ) ;; definition for method 3 of type align-control -(defmethod inspect align-control ((obj align-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect align-control ((this align-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X~%" (-> obj flags)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tframe-group: ~A~%" (-> obj frame-group)) - (format #t "~1Tframe-num: ~f~%" (-> obj frame-num)) - (format #t "~1Tmatrix[2] @ #x~X~%" (-> obj matrix)) - (format #t "~1Ttransform[2] @ #x~X~%" (-> obj transform)) - (format #t "~1Tdelta: #~%" (-> obj delta)) - (format #t "~1Tlast-speed: (meters ~m)~%" (-> obj last-speed)) - (format #t "~1Talign: #~%" (-> obj transform)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X~%" (-> this flags)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tframe-group: ~A~%" (-> this frame-group)) + (format #t "~1Tframe-num: ~f~%" (-> this frame-num)) + (format #t "~1Tmatrix[2] @ #x~X~%" (-> this matrix)) + (format #t "~1Ttransform[2] @ #x~X~%" (-> this transform)) + (format #t "~1Tdelta: #~%" (-> this delta)) + (format #t "~1Tlast-speed: (meters ~m)~%" (-> this last-speed)) + (format #t "~1Talign: #~%" (-> this transform)) (label cfg-4) - obj + this ) ;; definition for method 0 of type align-control ;; WARN: Return type mismatch object vs align-control. (defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process)) - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (when (zero? obj) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? this) (go process-drawable-art-error "memory") (return (the-as align-control 0)) ) - (set! (-> obj process) (the-as process-drawable arg0)) - (the-as align-control obj) + (set! (-> this process) (the-as process-drawable arg0)) + (the-as align-control this) ) ) diff --git a/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc b/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc index 97fc0cd30d..c5f87b393f 100644 --- a/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/aligner_REF.gc @@ -5,7 +5,7 @@ ;; INFO: Used lq/sq ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod compute-alignment! align-control ((obj align-control)) +(defmethod compute-alignment! align-control ((this align-control)) (local-vars (a0-10 symbol) (s7-0 none) (ra-0 int)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -13,10 +13,10 @@ (vf6 :class vf) ) (init-vf0-vector) - (update-anim-data (-> obj process skel)) - (let ((s5-0 (-> obj process skel active-channels))) + (update-anim-data (-> this process skel)) + (let ((s5-0 (-> this process skel active-channels))) (dotimes (s4-0 (the-as int s5-0)) - (let* ((a0-4 (-> obj process skel channel s4-0)) + (let* ((a0-4 (-> this process skel channel s4-0)) (v1-7 (-> a0-4 frame-group)) ) (case (-> a0-4 command) @@ -35,34 +35,34 @@ ) ) ) - (let* ((a0-9 (-> obj process skel root-channel 0)) + (let* ((a0-9 (-> this process skel root-channel 0)) (v1-18 (-> a0-9 frame-group)) (f0-0 (-> a0-9 frame-num)) ) (= (-> a0-9 num-func) num-func-loop!) (cond - ((or (not v1-18) (!= (-> obj frame-group) v1-18)) + ((or (not v1-18) (!= (-> this frame-group) v1-18)) (set! a0-10 #t) ) ((= (-> a0-9 num-func) num-func-loop!) - (set! a0-10 (< (* (-> a0-9 param 0) (- f0-0 (-> obj frame-num))) 0.0)) + (set! a0-10 (< (* (-> a0-9 param 0) (- f0-0 (-> this frame-num))) 0.0)) ) (else (set! a0-10 (= f0-0 0.0)) ) ) (if a0-10 - (logior! (-> obj flags) (align-flags disabled)) - (logclear! (-> obj flags) (align-flags disabled)) + (logior! (-> this flags) (align-flags disabled)) + (logclear! (-> this flags) (align-flags disabled)) ) - (set! (-> obj frame-group) v1-18) - (set! (-> obj frame-num) f0-0) + (set! (-> this frame-group) v1-18) + (set! (-> this frame-num) f0-0) ) - (mem-copy! (the-as pointer (-> obj transform 1)) (the-as pointer (-> obj transform)) 48) - (quaternion-copy! (the-as quaternion (-> obj transform 1 rot)) (-> obj align quat)) - (set! (-> obj transform 1 scale quad) (-> obj align scale quad)) - (let* ((a2-5 (-> obj matrix 1)) - (a3-0 (-> obj matrix)) + (mem-copy! (the-as pointer (-> this transform 1)) (the-as pointer (-> this transform)) 48) + (quaternion-copy! (the-as quaternion (-> this transform 1 rot)) (-> this align quat)) + (set! (-> this transform 1 scale quad) (-> this align scale quad)) + (let* ((a2-5 (-> this matrix 1)) + (a3-0 (-> this matrix)) (v1-21 (-> a3-0 0 quad 0)) (a0-19 (-> a3-0 0 quad 1)) (a1-13 (-> a3-0 0 quad 2)) @@ -73,9 +73,9 @@ (set! (-> a2-5 quad 2) a1-13) (set! (-> a2-5 trans quad) a3-1) ) - (let ((s5-1 (-> obj process node-list data 1))) - (cspace<-matrix-no-push-joint! s5-1 (-> obj process skel)) - (let* ((v1-25 (-> obj matrix)) + (let ((s5-1 (-> this process node-list data 1))) + (cspace<-matrix-no-push-joint! s5-1 (-> this process skel)) + (let* ((v1-25 (-> this matrix)) (a3-2 (-> s5-1 bone transform)) (a0-22 (-> a3-2 quad 0)) (a1-15 (-> a3-2 quad 1)) @@ -87,9 +87,9 @@ (set! (-> v1-25 0 quad 2) a2-6) (set! (-> v1-25 0 trans quad) a3-3) ) - (let ((v1-26 (-> obj transform))) + (let ((v1-26 (-> this transform))) (let ((a0-24 (-> s5-1 bone transform trans)) - (a1-18 (-> obj process root scale)) + (a1-18 (-> this process root scale)) ) (.lvf vf4 (&-> a0-24 quad)) (.lvf vf5 (&-> a1-18 quad)) @@ -100,54 +100,55 @@ ) ) (vector-! - (the-as vector (-> obj delta)) - (the-as vector (-> obj transform)) - (the-as vector (-> obj transform 1)) + (the-as vector (-> this delta)) + (the-as vector (-> this transform)) + (the-as vector (-> this transform 1)) ) (set-vector! - (-> obj align scale) - (vector-length (the-as vector (-> obj matrix))) - (vector-length (-> obj matrix 0 vector 1)) - (vector-length (-> obj matrix 0 vector 2)) + (-> this align scale) + (vector-length (the-as vector (-> this matrix))) + (vector-length (-> this matrix 0 vector 1)) + (vector-length (-> this matrix 0 vector 2)) 1.0 ) - (vector-! (-> obj delta scale) (-> obj align scale) (-> obj transform 1 scale)) - (let ((a2-7 (matrix-inv-scale! (new 'stack-no-clear 'matrix) (-> obj align scale)))) + (vector-! (-> this delta scale) (-> this align scale) (-> this transform 1 scale)) + (let ((a2-7 (matrix-inv-scale! (new 'stack-no-clear 'matrix) (-> this align scale)))) (quaternion-normalize! - (matrix->quaternion (-> obj align quat) (matrix*! a2-7 (the-as matrix (-> obj matrix)) a2-7)) + (matrix->quaternion (-> this align quat) (matrix*! a2-7 (the-as matrix (-> this matrix)) a2-7)) ) ) - (let ((a1-27 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (the-as quaternion (-> obj transform 1 rot))))) - (quaternion-normalize! (quaternion*! (-> obj delta quat) a1-27 (-> obj align quat))) + (let ((a1-27 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (the-as quaternion (-> this transform 1 rot)))) + ) + (quaternion-normalize! (quaternion*! (-> this delta quat) a1-27 (-> this align quat))) ) - (-> obj delta) + (-> this delta) ) ) ;; definition for method 12 of type align-control ;; WARN: Return type mismatch (inline-array transform) vs transform. -(defmethod first-transform align-control ((obj align-control)) +(defmethod first-transform align-control ((this align-control)) "@returns The first of the two [[transforms]] held by the object" - (the-as transform (-> obj transform)) + (the-as transform (-> this transform)) ) ;; definition for method 13 of type align-control -(defmethod second-transform align-control ((obj align-control)) +(defmethod second-transform align-control ((this align-control)) "@returns The second of the two [[transforms]] held by the object" - (-> obj transform 1) + (-> this transform 1) ) ;; definition for method 10 of type align-control -(defmethod align! align-control ((obj align-control) (options align-opts) (x float) (y float) (z float)) +(defmethod align! align-control ((this align-control) (options align-opts) (x float) (y float) (z float)) "As long as [[align-flags::0]] is not set call [[process-drawable::16]] on the process being controlled using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> @returns the `root` of the [[process-drawable]] after the method returns @see [[process-drawable::16]]" - (when (not (logtest? (-> obj flags) (align-flags disabled))) - (let* ((process (-> obj process)) + (when (not (logtest? (-> this flags) (align-flags disabled))) + (let* ((process (-> this process)) (method-call (method-of-object process apply-alignment)) - (transform (-> obj delta)) + (transform (-> this delta)) (data (new 'stack-no-clear 'vector)) ) (set! (-> data x) x) @@ -157,13 +158,13 @@ using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> (method-call process options transform data) ) ) - (-> obj process root) + (-> this process root) ) ;; definition for method 26 of type trsqv -(defmethod set-and-limit-velocity trsqv ((obj trsqv) (unkBitfield int) (limit vector) (arg2 float)) +(defmethod set-and-limit-velocity trsqv ((this trsqv) (unkBitfield int) (limit vector) (arg2 float)) "TODO - arg1 is an bitfield of some sort" - (let ((transv (-> obj transv))) + (let ((transv (-> this transv))) (when (logtest? unkBitfield 4) (set! (-> transv x) (-> limit x)) (set! (-> transv z) (-> limit z)) @@ -179,14 +180,14 @@ using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> ) ) ) - obj + this ) ;; definition for method 11 of type align-control -(defmethod align-vel-and-quat-only! align-control ((obj align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) - (when (not (logtest? (-> obj flags) (align-flags disabled))) - (let ((s5-0 (-> obj delta))) - (let ((a0-1 (-> obj process root transv))) +(defmethod align-vel-and-quat-only! align-control ((this align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float)) + (when (not (logtest? (-> this flags) (align-flags disabled))) + (let ((s5-0 (-> this delta))) + (let ((a0-1 (-> this process root transv))) (if (logtest? arg0 (align-opts adjust-y-vel)) (set! (-> a0-1 y) (* (-> s5-0 trans y) arg3 (-> self clock frames-per-second))) ) @@ -202,15 +203,15 @@ using the arguments passed to construct a [[vector]] - <`x`, `y`, `z`, 1.0> ) (t9-0 vector-xz-normalize!) ) - (set! (-> obj last-speed) f0-11) + (set! (-> this last-speed) f0-11) (t9-0 a0-1 f0-11) ) ) ) (if (logtest? arg0 (align-opts adjust-quat)) - (quaternion-normalize! (quaternion*! (-> obj process root quat) (-> obj process root quat) (-> s5-0 quat))) + (quaternion-normalize! (quaternion*! (-> this process root quat) (-> this process root quat) (-> s5-0 quat))) ) ) ) - (-> obj process root) + (-> this process root) ) diff --git a/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc b/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc index 4d14aa5421..4cb38b250b 100644 --- a/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/fma-sphere_REF.gc @@ -23,34 +23,34 @@ ) ;; definition for method 3 of type fma-sphere -(defmethod inspect fma-sphere ((obj fma-sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect fma-sphere ((this fma-sphere)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfirst-time?: ~A~%" (-> obj first-time?)) - (format #t "~2Tmode: ~D~%" (-> obj mode)) - (format #t "~2Ttrack-handle: ~D~%" (-> obj track-handle)) - (format #t "~2Ttrack-joint: ~D~%" (-> obj track-joint)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tduration: ~D~%" (-> obj duration)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tsphere: #~%" (-> obj sphere)) - (format #t "~2Tdanger: #~%" (-> obj danger)) + (format #t "~2Tfirst-time?: ~A~%" (-> this first-time?)) + (format #t "~2Tmode: ~D~%" (-> this mode)) + (format #t "~2Ttrack-handle: ~D~%" (-> this track-handle)) + (format #t "~2Ttrack-joint: ~D~%" (-> this track-joint)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tduration: ~D~%" (-> this duration)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tsphere: #~%" (-> this sphere)) + (format #t "~2Tdanger: #~%" (-> this danger)) (label cfg-4) - obj + this ) ;; definition for method 12 of type fma-sphere -(defmethod run-logic? fma-sphere ((obj fma-sphere)) +(defmethod run-logic? fma-sphere ((this fma-sphere)) (or (logtest? *display-scene-control* (scene-controls display-controls)) - (and *display-nav-marks* (logtest? (-> obj mode) (fma-sphere-mode nav))) - (logtest? (-> obj mode) (fma-sphere-mode deadly-overlap)) - (>= (-> obj track-joint) 0) - (-> obj first-time?) + (and *display-nav-marks* (logtest? (-> this mode) (fma-sphere-mode nav))) + (logtest? (-> this mode) (fma-sphere-mode deadly-overlap)) + (>= (-> this track-joint) 0) + (-> this first-time?) ) ) @@ -76,7 +76,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self first-time?) #f) (if (logtest? (-> self mode) (fma-sphere-mode kill-once)) (send-event *traffic-manager* 'kill-traffic-sphere (-> self sphere)) @@ -90,7 +90,7 @@ ) (init-vf0-vector) (let ((v1-0 (-> self duration))) - (if (and (nonzero? v1-0) (>= (- (current-time) (-> self state-time)) v1-0)) + (if (and (nonzero? v1-0) (time-elapsed? (-> self state-time) v1-0)) (go empty-state) ) ) diff --git a/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc index e32e0e8b88..5230837280 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-exploder_REF.gc @@ -30,31 +30,31 @@ ) ;; definition for method 3 of type joint-exploder-tuning -(defmethod inspect joint-exploder-tuning ((obj joint-exploder-tuning)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-exploder-tuning ((this joint-exploder-tuning)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'joint-exploder-tuning) - (format #t "~1Texplosion: ~D~%" (-> obj explosion)) - (format #t "~1Tduration: ~D~%" (-> obj duration)) - (format #t "~1Tgravity: ~f~%" (-> obj gravity)) - (format #t "~1Trot-speed: ~f~%" (-> obj rot-speed)) - (format #t "~1Tbounds-inflate: ~f~%" (-> obj bounds-inflate)) - (format #t "~1Tmax-probe-width: ~f~%" (-> obj max-probe-width)) - (format #t "~1Tmax-probe-height: ~f~%" (-> obj max-probe-height)) - (format #t "~1Tmax-probe-depth: ~f~%" (-> obj max-probe-depth)) - (format #t "~1Tfountain-rand-transv-lo: #~%" (-> obj fountain-rand-transv-lo)) - (format #t "~1Tfountain-rand-transv-hi: #~%" (-> obj fountain-rand-transv-hi)) - (format #t "~1Taway-from-focal-pt: #~%" (-> obj fountain-rand-transv-lo)) - (format #t "~1Taway-from-rand-transv-xz-lo: ~f~%" (-> obj fountain-rand-transv-hi x)) - (format #t "~1Taway-from-rand-transv-xz-hi: ~f~%" (-> obj fountain-rand-transv-hi y)) - (format #t "~1Taway-from-rand-transv-y-lo: ~f~%" (-> obj fountain-rand-transv-hi z)) - (format #t "~1Taway-from-rand-transv-y-hi: ~f~%" (-> obj fountain-rand-transv-hi w)) - (format #t "~1Thit-xz-reaction: ~f~%" (-> obj hit-xz-reaction)) - (format #t "~1Thit-y-reaction: ~f~%" (-> obj hit-y-reaction)) + (format #t "[~8x] ~A~%" this 'joint-exploder-tuning) + (format #t "~1Texplosion: ~D~%" (-> this explosion)) + (format #t "~1Tduration: ~D~%" (-> this duration)) + (format #t "~1Tgravity: ~f~%" (-> this gravity)) + (format #t "~1Trot-speed: ~f~%" (-> this rot-speed)) + (format #t "~1Tbounds-inflate: ~f~%" (-> this bounds-inflate)) + (format #t "~1Tmax-probe-width: ~f~%" (-> this max-probe-width)) + (format #t "~1Tmax-probe-height: ~f~%" (-> this max-probe-height)) + (format #t "~1Tmax-probe-depth: ~f~%" (-> this max-probe-depth)) + (format #t "~1Tfountain-rand-transv-lo: #~%" (-> this fountain-rand-transv-lo)) + (format #t "~1Tfountain-rand-transv-hi: #~%" (-> this fountain-rand-transv-hi)) + (format #t "~1Taway-from-focal-pt: #~%" (-> this fountain-rand-transv-lo)) + (format #t "~1Taway-from-rand-transv-xz-lo: ~f~%" (-> this fountain-rand-transv-hi x)) + (format #t "~1Taway-from-rand-transv-xz-hi: ~f~%" (-> this fountain-rand-transv-hi y)) + (format #t "~1Taway-from-rand-transv-y-lo: ~f~%" (-> this fountain-rand-transv-hi z)) + (format #t "~1Taway-from-rand-transv-y-hi: ~f~%" (-> this fountain-rand-transv-hi w)) + (format #t "~1Thit-xz-reaction: ~f~%" (-> this hit-xz-reaction)) + (format #t "~1Thit-y-reaction: ~f~%" (-> this hit-y-reaction)) (label cfg-4) - obj + this ) ;; definition of type joint-exploder-static-joint-params @@ -68,16 +68,16 @@ ) ;; definition for method 3 of type joint-exploder-static-joint-params -(defmethod inspect joint-exploder-static-joint-params ((obj joint-exploder-static-joint-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-exploder-static-joint-params ((this joint-exploder-static-joint-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'joint-exploder-static-joint-params) - (format #t "~1Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~1Tparent-joint-index: ~D~%" (-> obj parent-joint-index)) + (format #t "[~8x] ~A~%" this 'joint-exploder-static-joint-params) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~1Tparent-joint-index: ~D~%" (-> this parent-joint-index)) (label cfg-4) - obj + this ) ;; definition of type joint-exploder-static-params @@ -92,17 +92,17 @@ ) ;; definition for method 3 of type joint-exploder-static-params -(defmethod inspect joint-exploder-static-params ((obj joint-exploder-static-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-exploder-static-params ((this joint-exploder-static-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tjoints: ~A~%" (-> obj joints)) - (format #t "~1Tcollide-spec: ~D~%" (-> obj collide-spec)) - (format #t "~1Tart-level: ~A~%" (-> obj art-level)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tjoints: ~A~%" (-> this joints)) + (format #t "~1Tcollide-spec: ~D~%" (-> this collide-spec)) + (format #t "~1Tart-level: ~A~%" (-> this art-level)) (label cfg-4) - obj + this ) ;; definition of type joint-exploder-joint @@ -122,22 +122,22 @@ ) ;; definition for method 3 of type joint-exploder-joint -(defmethod inspect joint-exploder-joint ((obj joint-exploder-joint)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-exploder-joint ((this joint-exploder-joint)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'joint-exploder-joint) - (format #t "~1Tnext: ~D~%" (-> obj next)) - (format #t "~1Tprev: ~D~%" (-> obj prev)) - (format #t "~1Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~1Tmat: #~%" (-> obj mat)) - (format #t "~1Trmat: #~%" (-> obj rmat)) - (format #t "~1Tupdate-rmat: #~%" (-> obj update-rmat)) - (format #t "~1Ttransv: #~%" (-> obj transv)) - (format #t "~1Tprev-pos: #~%" (-> obj prev-pos)) + (format #t "[~8x] ~A~%" this 'joint-exploder-joint) + (format #t "~1Tnext: ~D~%" (-> this next)) + (format #t "~1Tprev: ~D~%" (-> this prev)) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Trmat: #~%" (-> this rmat)) + (format #t "~1Tupdate-rmat: #~%" (-> this update-rmat)) + (format #t "~1Ttransv: #~%" (-> this transv)) + (format #t "~1Tprev-pos: #~%" (-> this prev-pos)) (label cfg-4) - obj + this ) ;; definition of type joint-exploder-joints @@ -154,16 +154,16 @@ ) ;; definition for method 3 of type joint-exploder-joints -(defmethod inspect joint-exploder-joints ((obj joint-exploder-joints)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-exploder-joints ((this joint-exploder-joints)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~1Tjoint[0] @ #x~X~%" (-> obj joint)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Tjoint[0] @ #x~X~%" (-> this joint)) (label cfg-4) - obj + this ) ;; definition of type joint-exploder-list @@ -180,19 +180,19 @@ ) ;; definition for method 3 of type joint-exploder-list -(defmethod inspect joint-exploder-list ((obj joint-exploder-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-exploder-list ((this joint-exploder-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'joint-exploder-list) - (format #t "~1Thead: ~D~%" (-> obj head)) - (format #t "~1Tpre-moved?: ~A~%" (-> obj pre-moved?)) - (format #t "~1Tbbox-valid?: ~A~%" (-> obj bbox-valid?)) - (format #t "~1Tprobeless?: ~A~%" (-> obj probeless?)) - (format #t "~1Tbbox: #~%" (-> obj bbox)) + (format #t "[~8x] ~A~%" this 'joint-exploder-list) + (format #t "~1Thead: ~D~%" (-> this head)) + (format #t "~1Tpre-moved?: ~A~%" (-> this pre-moved?)) + (format #t "~1Tbbox-valid?: ~A~%" (-> this bbox-valid?)) + (format #t "~1Tprobeless?: ~A~%" (-> this probeless?)) + (format #t "~1Tbbox: #~%" (-> this bbox)) (label cfg-4) - obj + this ) ;; definition of type joint-exploder @@ -228,30 +228,30 @@ ) ;; definition for method 3 of type joint-exploder -(defmethod inspect joint-exploder ((obj joint-exploder)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-exploder ((this joint-exploder)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tdie-if-below-y: ~f~%" (-> obj die-if-below-y)) - (format #t "~2Tdie-if-beyond-xz-dist-sqrd: ~f~%" (-> obj die-if-beyond-xz-dist-sqrd)) - (format #t "~2Tjoints: ~A~%" (-> obj joints)) - (format #t "~2Tstatic-params: ~A~%" (-> obj static-params)) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tscale-vector: #~%" (-> obj scale-vector)) - (format #t "~2Ttuning: #~%" (-> obj tuning)) - (format #t "~2Tlists[5] @ #x~X~%" (-> obj lists)) + (format #t "~2Tdie-if-below-y: ~f~%" (-> this die-if-below-y)) + (format #t "~2Tdie-if-beyond-xz-dist-sqrd: ~f~%" (-> this die-if-beyond-xz-dist-sqrd)) + (format #t "~2Tjoints: ~A~%" (-> this joints)) + (format #t "~2Tstatic-params: ~A~%" (-> this static-params)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tscale-vector: #~%" (-> this scale-vector)) + (format #t "~2Ttuning: #~%" (-> this tuning)) + (format #t "~2Tlists[5] @ #x~X~%" (-> this lists)) (label cfg-4) - obj + this ) ;; definition for method 5 of type joint-exploder-joints ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-exploder-joints ((obj joint-exploder-joints)) - (the-as int (+ (-> obj type size) (* 240 (-> obj num-joints)))) +(defmethod asize-of joint-exploder-joints ((this joint-exploder-joints)) + (the-as int (+ (-> this type size) (* 240 (-> this num-joints)))) ) ;; definition for method 0 of type joint-exploder-joints @@ -300,23 +300,23 @@ ;; definition for method 24 of type joint-exploder ;; INFO: Used lq/sq -(defmethod remove-from-list-and-reset joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let ((v0-0 (remove-joint-from-list obj arg0 arg1))) - (let* ((v1-1 (-> obj joints)) +(defmethod remove-from-list-and-reset joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let ((v0-0 (remove-joint-from-list this arg0 arg1))) + (let* ((v1-1 (-> this joints)) (v1-2 (-> v1-1 joint arg1)) ) (set! (-> v1-2 mat quad 0) (the-as uint128 0)) (set! (-> v1-2 mat vector 1 quad) (the-as uint128 0)) (set! (-> v1-2 mat vector 2 quad) (the-as uint128 0)) - (set! (-> v1-2 mat trans quad) (-> obj root trans quad)) + (set! (-> v1-2 mat trans quad) (-> this root trans quad)) ) v0-0 ) ) ;; definition for method 27 of type joint-exploder -(defmethod remove-joint-from-list joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let* ((v1-0 (-> obj joints)) +(defmethod remove-joint-from-list joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let* ((v1-0 (-> this joints)) (a2-1 (-> v1-0 joint arg1)) (a0-4 (-> a2-1 prev)) (v0-0 (-> a2-1 next)) @@ -347,8 +347,8 @@ ) ;; definition for method 20 of type joint-exploder -(defmethod add-joint-to-list joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) - (let* ((v1-0 (-> obj joints)) +(defmethod add-joint-to-list joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) + (let* ((v1-0 (-> this joints)) (a3-0 (-> v1-0 joint arg1)) (a0-4 (-> arg0 head)) ) @@ -364,7 +364,7 @@ ;; definition for method 21 of type joint-exploder ;; INFO: Used lq/sq -(defmethod update-bbox-for-joint joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) +(defmethod update-bbox-for-joint joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 joint-exploder-joint)) (let ((a1-1 (-> arg1 mat trans))) (cond ((-> arg0 bbox-valid?) @@ -383,7 +383,7 @@ ;; definition for method 28 of type joint-exploder ;; INFO: Used lq/sq -(defmethod adjust-bbox-for-limits-along-axis joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod adjust-bbox-for-limits-along-axis joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-16 int) (sv-32 int) @@ -396,7 +396,7 @@ (let ((s5-0 (the-as joint-exploder-list #f))) (let ((v1-0 1)) (until (= v1-0 5) - (let ((a0-4 (-> obj lists v1-0))) + (let ((a0-4 (-> this lists v1-0))) (when (< (-> a0-4 head) 0) (set! s5-0 a0-4) (goto cfg-6) @@ -412,11 +412,11 @@ (set! (-> s5-0 bbox-valid?) #f) ) (else - (set! s5-0 (the-as joint-exploder-list (-> obj lists))) + (set! s5-0 (the-as joint-exploder-list (-> this lists))) ) ) (set! (-> arg0 bbox-valid?) #f) - (let ((s2-0 (-> obj joints))) + (let ((s2-0 (-> this joints))) (set! sv-32 (-> arg0 head)) (let ((s1-0 0) (s0-0 0) @@ -429,14 +429,14 @@ (set! sv-48 (-> s2-0 joint sv-32)) (cond ((>= (-> sv-48 mat trans x) f30-0) - (set! sv-16 (remove-joint-from-list obj arg0 sv-32)) - (add-joint-to-list obj s5-0 sv-32) + (set! sv-16 (remove-joint-from-list this arg0 sv-32)) + (add-joint-to-list this s5-0 sv-32) (set! sv-32 sv-16) - (update-bbox-for-joint obj s5-0 sv-48) + (update-bbox-for-joint this s5-0 sv-48) (+! s0-0 1) ) (else - (update-bbox-for-joint obj arg0 sv-48) + (update-bbox-for-joint this arg0 sv-48) (set! sv-32 (-> sv-48 next)) (+! s1-0 1) ) @@ -450,14 +450,14 @@ (set! sv-80 (-> s2-0 joint sv-32)) (cond ((>= (-> sv-80 mat trans y) f30-1) - (set! sv-64 (remove-joint-from-list obj arg0 sv-32)) - (add-joint-to-list obj s5-0 sv-32) + (set! sv-64 (remove-joint-from-list this arg0 sv-32)) + (add-joint-to-list this s5-0 sv-32) (set! sv-32 sv-64) - (update-bbox-for-joint obj s5-0 sv-80) + (update-bbox-for-joint this s5-0 sv-80) (+! s0-0 1) ) (else - (update-bbox-for-joint obj arg0 sv-80) + (update-bbox-for-joint this arg0 sv-80) (set! sv-32 (-> sv-80 next)) (+! s1-0 1) ) @@ -471,14 +471,14 @@ (set! sv-112 (-> s2-0 joint sv-32)) (cond ((>= (-> sv-112 mat trans z) f30-2) - (set! sv-96 (remove-joint-from-list obj arg0 sv-32)) - (add-joint-to-list obj s5-0 sv-32) + (set! sv-96 (remove-joint-from-list this arg0 sv-32)) + (add-joint-to-list this s5-0 sv-32) (set! sv-32 sv-96) - (update-bbox-for-joint obj s5-0 sv-112) + (update-bbox-for-joint this s5-0 sv-112) (+! s0-0 1) ) (else - (update-bbox-for-joint obj arg0 sv-112) + (update-bbox-for-joint this arg0 sv-112) (set! sv-32 (-> sv-112 next)) (+! s1-0 1) ) @@ -490,11 +490,11 @@ ) (cond ((zero? s0-0) - (final-adjust obj arg0 arg1) + (final-adjust this arg0 arg1) ) ((zero? s1-0) (if (not (-> s5-0 probeless?)) - (final-adjust obj s5-0 arg1) + (final-adjust this s5-0 arg1) ) ) ) @@ -507,10 +507,10 @@ ;; definition for method 25 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs int. -(defmethod final-adjust joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list) (arg1 int)) +(defmethod final-adjust joint-exploder ((this joint-exploder) (arg0 joint-exploder-list) (arg1 int)) (local-vars (sv-48 int) (sv-64 (inline-array joint-exploder-list)) (sv-80 joint-exploder-joint)) (set! (-> arg0 bbox-valid?) #f) - (let ((s3-0 (-> obj joints)) + (let ((s3-0 (-> this joints)) (s2-0 (-> arg0 head)) ) (while (>= s2-0 0) @@ -520,27 +520,27 @@ ) (set! (-> s1-0 min quad) (-> arg0 bbox min quad)) (set! (-> s1-0 max quad) (-> arg0 bbox max quad)) - (update-bbox-for-joint obj arg0 sv-80) + (update-bbox-for-joint this arg0 sv-80) (let* ((v1-7 arg1) (v1-8 (cond ((zero? v1-7) - (< (-> obj tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x))) + (< (-> this tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x))) ) ((= v1-7 1) - (< (-> obj tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y))) + (< (-> this tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y))) ) ((= v1-7 2) - (< (-> obj tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z))) + (< (-> this tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z))) ) ) ) ) (when v1-8 - (set! sv-48 (remove-joint-from-list obj arg0 s2-0)) - (set! sv-64 (-> obj lists)) - (add-joint-to-list obj (the-as joint-exploder-list sv-64) s2-0) + (set! sv-48 (remove-joint-from-list this arg0 s2-0)) + (set! sv-64 (-> this lists)) + (add-joint-to-list this (the-as joint-exploder-list sv-64) s2-0) (set! s2-0 sv-48) - (update-bbox-for-joint obj (the-as joint-exploder-list sv-64) sv-80) + (update-bbox-for-joint this (the-as joint-exploder-list sv-64) sv-80) (set! (-> arg0 bbox-valid?) s0-0) (set! (-> arg0 bbox min quad) (-> s1-0 min quad)) (set! (-> arg0 bbox max quad) (-> s1-0 max quad)) @@ -554,27 +554,27 @@ ;; definition for method 29 of type joint-exploder ;; WARN: Return type mismatch int vs none. -(defmethod adjust-bbox-for-limits joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod adjust-bbox-for-limits joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (when (and (-> arg0 bbox-valid?) (>= (-> arg0 head) 0) (not (-> arg0 probeless?))) (let ((a2-0 -1)) (cond - ((< (-> obj tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x))) + ((< (-> this tuning max-probe-width) (- (-> arg0 bbox max x) (-> arg0 bbox min x))) (set! a2-0 0) ) - ((< (-> obj tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y))) + ((< (-> this tuning max-probe-height) (- (-> arg0 bbox max y) (-> arg0 bbox min y))) (set! a2-0 1) ) - ((< (-> obj tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z))) + ((< (-> this tuning max-probe-depth) (- (-> arg0 bbox max z) (-> arg0 bbox min z))) (set! a2-0 2) ) ) (when (>= a2-0 0) - (let ((a1-2 (adjust-bbox-for-limits-along-axis obj arg0 a2-0))) + (let ((a1-2 (adjust-bbox-for-limits-along-axis this arg0 a2-0))) (if (not (-> a1-2 probeless?)) - (adjust-bbox-for-limits obj a1-2) + (adjust-bbox-for-limits this a1-2) ) ) - (adjust-bbox-for-limits obj arg0) + (adjust-bbox-for-limits this arg0) ) ) ) @@ -585,11 +585,11 @@ ;; definition for method 26 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod integrate-and-kill joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod integrate-and-kill joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (set! (-> arg0 bbox-valid?) #f) (set! (-> arg0 pre-moved?) #t) - (let ((s4-0 (-> obj joints)) - (f30-0 (* (-> obj tuning gravity) (seconds-per-frame))) + (let ((s4-0 (-> this joints)) + (f30-0 (* (-> this tuning gravity) (seconds-per-frame))) (s3-0 (-> arg0 head)) ) (while (>= s3-0 0) @@ -601,13 +601,13 @@ (vector-v+! s1-0 s1-0 (-> s2-0 transv)) (matrix*! (-> s2-0 rmat) (-> s2-0 rmat) (-> s2-0 update-rmat)) (cond - ((or (< (-> s1-0 y) (-> obj die-if-below-y)) - (< (-> obj die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> obj root trans))) + ((or (< (-> s1-0 y) (-> this die-if-below-y)) + (< (-> this die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> this root trans))) ) - (set! s3-0 (remove-from-list-and-reset obj arg0 s3-0)) + (set! s3-0 (remove-from-list-and-reset this arg0 s3-0)) ) (else - (update-bbox-for-joint obj arg0 s2-0) + (update-bbox-for-joint this arg0 s2-0) (set! s3-0 (-> s2-0 next)) ) ) @@ -621,17 +621,17 @@ ;; definition for method 22 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-collision-response joint-exploder ((obj joint-exploder) (arg0 joint-exploder-list)) +(defmethod do-collision-response joint-exploder ((this joint-exploder) (arg0 joint-exploder-list)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 collide-with) (the-as collide-spec (-> obj static-params collide-spec))) - (set! (-> s5-0 ignore-process0) obj) + (set! (-> s5-0 collide-with) (the-as collide-spec (-> this static-params collide-spec))) + (set! (-> s5-0 ignore-process0) this) (set! (-> s5-0 ignore-process1) #f) (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> s5-0 action-mask) (collide-action solid)) (mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer (-> arg0 bbox)) 32) (fill-using-bounding-box *collide-cache* s5-0) ) - (let ((s5-1 (-> obj joints)) + (let ((s5-1 (-> this joints)) (v1-6 (-> arg0 head)) ) (while (>= v1-6 0) @@ -643,7 +643,7 @@ (set! (-> s2-0 start-pos quad) (-> s4-1 prev-pos quad)) (let ((v1-11 s2-0)) (set! (-> v1-11 radius) 40.96) - (set! (-> v1-11 collide-with) (the-as collide-spec (-> obj static-params collide-spec))) + (set! (-> v1-11 collide-with) (the-as collide-spec (-> this static-params collide-spec))) (set! (-> v1-11 ignore-process0) #f) (set! (-> v1-11 ignore-process1) #f) (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) @@ -657,8 +657,8 @@ (vector-reflect! (-> s4-1 transv) (-> s4-1 transv) (-> s2-0 best-other-tri normal)) (let ((f30-0 (-> s4-1 transv y))) (set! (-> s4-1 transv y) 0.0) - (vector-normalize! (-> s4-1 transv) (* f28-0 (-> obj tuning hit-xz-reaction))) - (set! (-> s4-1 transv y) (* f30-0 (-> obj tuning hit-y-reaction))) + (vector-normalize! (-> s4-1 transv) (* f28-0 (-> this tuning hit-xz-reaction))) + (set! (-> s4-1 transv y) (* f30-0 (-> this tuning hit-y-reaction))) ) ) (+! (-> s3-0 y) (* 40.96 (-> s2-0 best-other-tri normal y))) @@ -677,7 +677,7 @@ ;; failed to figure out what this is: (defstate joint-exploder-shatter (joint-exploder) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let* ((f0-1 (the float (- (current-time) (-> self state-time)))) @@ -727,8 +727,8 @@ 0 ) :code (behavior () - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (-> self tuning duration)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (-> self tuning duration)) (suspend) (ja :num! (loop!)) ) @@ -739,10 +739,10 @@ ;; definition for method 23 of type joint-exploder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-joint-list joint-exploder ((obj joint-exploder)) - (let ((gp-0 (-> obj joints))) +(defmethod init-joint-list joint-exploder ((this joint-exploder)) + (let ((gp-0 (-> this joints))) (dotimes (s4-0 (-> gp-0 num-joints)) - (let ((v1-2 (-> obj static-params joints s4-0)) + (let ((v1-2 (-> this static-params joints s4-0)) (s3-0 (-> gp-0 joint s4-0)) ) (let ((a0-6 (-> v1-2 parent-joint-index))) @@ -754,7 +754,7 @@ (if (zero? a0-6) (set! a0-6 (-> v1-2 joint-index)) ) - (let* ((a3-0 (-> (the-as process-drawable (-> obj parent 0)) node-list data a0-6 bone transform)) + (let* ((a3-0 (-> (the-as process-drawable (-> this parent 0)) node-list data a0-6 bone transform)) (a2-0 (-> s3-0 mat)) (v1-9 (-> a3-0 quad 0)) (a0-8 (-> a3-0 quad 1)) @@ -769,7 +769,7 @@ (matrix-identity! (-> s3-0 rmat)) ) (else - (let* ((a3-2 (-> obj node-list data (-> v1-2 joint-index) bone transform)) + (let* ((a3-2 (-> this node-list data (-> v1-2 joint-index) bone transform)) (a2-1 (-> s3-0 mat)) (v1-15 (-> a3-2 quad 0)) (a0-11 (-> a3-2 quad 1)) @@ -785,21 +785,21 @@ ) ) ) - (case (-> obj tuning explosion) + (case (-> this tuning explosion) ((1) - (vector-! (-> s3-0 transv) (-> s3-0 mat trans) (-> obj tuning fountain-rand-transv-lo)) + (vector-! (-> s3-0 transv) (-> s3-0 mat trans) (-> this tuning fountain-rand-transv-lo)) (vector-normalize! (-> s3-0 transv) - (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi x) (-> obj tuning fountain-rand-transv-hi y)) + (rand-vu-float-range (-> this tuning fountain-rand-transv-hi x) (-> this tuning fountain-rand-transv-hi y)) ) (+! (-> s3-0 transv y) - (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi z) (-> obj tuning fountain-rand-transv-hi w)) + (rand-vu-float-range (-> this tuning fountain-rand-transv-hi z) (-> this tuning fountain-rand-transv-hi w)) ) (set! (-> s3-0 transv w) 1.0) ) (else - (let ((s0-0 (-> obj tuning fountain-rand-transv-lo)) - (s1-1 (-> obj tuning fountain-rand-transv-hi)) + (let ((s0-0 (-> this tuning fountain-rand-transv-lo)) + (s1-1 (-> this tuning fountain-rand-transv-hi)) ) (set-vector! (-> s3-0 transv) @@ -816,7 +816,7 @@ (s1-2 (new 'stack-no-clear 'quaternion)) ) (vector-normalize! s2-4 1.0) - (quaternion-vector-angle! s1-2 s2-4 (* 182.04445 (-> obj tuning rot-speed))) + (quaternion-vector-angle! s1-2 s2-4 (* 182.04445 (-> this tuning rot-speed))) (quaternion->matrix (-> s3-0 update-rmat) s1-2) ) ) @@ -825,7 +825,7 @@ (let ((v1-32 (-> gp-0 joint (+ (-> gp-0 num-joints) -1)))) (set! (-> v1-32 next) -1) ) - (let ((v1-33 (-> obj lists 1))) + (let ((v1-33 (-> this lists 1))) (set! (-> v1-33 head) 0) (let ((s5-1 (-> v1-33 bbox))) (let ((v1-34 (-> gp-0 joint 0 mat trans))) @@ -845,11 +845,11 @@ ;; definition for method 7 of type joint-exploder ;; WARN: Return type mismatch process-drawable vs joint-exploder. -(defmethod relocate joint-exploder ((obj joint-exploder) (arg0 int)) - (if (nonzero? (-> obj joints)) - (&+! (-> obj joints) arg0) +(defmethod relocate joint-exploder ((this joint-exploder) (arg0 int)) + (if (nonzero? (-> this joints)) + (&+! (-> this joints) arg0) ) - (the-as joint-exploder ((method-of-type process-drawable relocate) obj arg0)) + (the-as joint-exploder ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for function joint-exploder-init-by-other diff --git a/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc index 969d0710d1..5b40506750 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc @@ -22,31 +22,31 @@ ) ;; definition for method 3 of type joint-control-channel -(defmethod inspect joint-control-channel ((obj joint-control-channel)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-control-channel ((this joint-control-channel)) + (when (not this) + (set! this this) (goto cfg-23) ) - (format #t "[~8x] ~A~%" obj 'joint-control-channel) - (format #t "~1Tparent: ~A~%" (-> obj parent)) - (format #t "~1Tframe-group: ~A~%" (-> obj frame-group)) - (format #t "~1Tframe-num: ~f~%" (-> obj frame-num)) - (format #t "~1Tdist: (meters ~m)~%" (-> obj dist)) - (format #t "~1Tnum-func: ~A~%" (-> obj num-func)) - (format #t "~1Tparam[3] @ #x~X~%" (-> obj param)) + (format #t "[~8x] ~A~%" this 'joint-control-channel) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Tframe-group: ~A~%" (-> this frame-group)) + (format #t "~1Tframe-num: ~f~%" (-> this frame-num)) + (format #t "~1Tdist: (meters ~m)~%" (-> this dist)) + (format #t "~1Tnum-func: ~A~%" (-> this num-func)) + (format #t "~1Tparam[3] @ #x~X~%" (-> this param)) (dotimes (s5-0 3) - (format #t "~T [~D]~1Tparam: ~`float`P~%" s5-0 (-> obj param s5-0)) + (format #t "~T [~D]~1Tparam: ~`float`P~%" s5-0 (-> this param s5-0)) ) - (format #t "~1Tframe-interp[2] @ #x~X~%" (-> obj frame-interp)) + (format #t "~1Tframe-interp[2] @ #x~X~%" (-> this frame-interp)) (dotimes (s5-1 2) - (format #t "~T [~D]~1Tframe-interp: ~`float`P~%" s5-1 (-> obj frame-interp s5-1)) + (format #t "~T [~D]~1Tframe-interp: ~`float`P~%" s5-1 (-> this frame-interp s5-1)) ) - (format #t "~1Tinspector-amount: ~D~%" (-> obj inspector-amount)) + (format #t "~1Tinspector-amount: ~D~%" (-> this inspector-amount)) (let ((t9-11 format) (a0-12 #t) (a1-11 "~1Tcommand: #x~X : ~S~%") - (a2-11 (-> obj command)) - (v1-10 (-> obj command)) + (a2-11 (-> this command)) + (v1-10 (-> this command)) ) (t9-11 a0-12 a1-11 a2-11 (cond ((= v1-10 (joint-control-command stack1)) @@ -73,11 +73,11 @@ ) ) ) - (format #t "~1Tgroup-sub-index: ~D~%" (-> obj group-sub-index)) - (format #t "~1Tgroup-size: ~D~%" (-> obj group-size)) - (format #t "~1Teval-time: ~D~%" (-> obj eval-time)) + (format #t "~1Tgroup-sub-index: ~D~%" (-> this group-sub-index)) + (format #t "~1Tgroup-size: ~D~%" (-> this group-size)) + (format #t "~1Teval-time: ~D~%" (-> this eval-time)) (label cfg-23) - obj + this ) ;; definition of type top-anim-joint-control @@ -115,33 +115,33 @@ ) ;; definition for method 3 of type top-anim-joint-control -(defmethod inspect top-anim-joint-control ((obj top-anim-joint-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect top-anim-joint-control ((this top-anim-joint-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Tinterp-select[2] @ #x~X~%" (-> obj interp-select)) - (format #t "~1Tbase-anim: ~A~%" (-> obj base-anim)) - (format #t "~1Tbase-anim-speed: ~f~%" (-> obj base-anim-speed)) - (format #t "~1Tbase-anim-blend: ~f~%" (-> obj base-anim-blend)) - (format #t "~1Tinterp: ~f~%" (-> obj interp)) - (format #t "~1Tframe-group: ~A~%" (-> obj frame-group)) - (format #t "~1Tframe-group-push: ~A~%" (-> obj frame-group-push)) - (format #t "~1Tframe-num: ~f~%" (-> obj frame-num)) - (format #t "~1Tframe-targ: ~A~%" (-> obj frame-targ)) - (format #t "~1Tframe-speed: ~f~%" (-> obj frame-speed)) - (format #t "~1Tframe-blend: ~f~%" (-> obj frame-blend)) - (format #t "~1Tframe-cur-blend: ~f~%" (-> obj frame-cur-blend)) - (format #t "~1Tframe-start: ~f~%" (-> obj frame-start)) - (format #t "~1Tframe-post-blend: ~f~%" (-> obj frame-post-blend)) - (format #t "~1Tframe-post-end: ~f~%" (-> obj frame-post-end)) - (format #t "~1Tframe-push-time: ~D~%" (-> obj frame-push-time)) - (format #t "~1Tframe-post-put-away: ~A~%" (-> obj frame-post-put-away)) - (format #t "~1Tupdate-time: ~D~%" (-> obj update-time)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tinterp-select[2] @ #x~X~%" (-> this interp-select)) + (format #t "~1Tbase-anim: ~A~%" (-> this base-anim)) + (format #t "~1Tbase-anim-speed: ~f~%" (-> this base-anim-speed)) + (format #t "~1Tbase-anim-blend: ~f~%" (-> this base-anim-blend)) + (format #t "~1Tinterp: ~f~%" (-> this interp)) + (format #t "~1Tframe-group: ~A~%" (-> this frame-group)) + (format #t "~1Tframe-group-push: ~A~%" (-> this frame-group-push)) + (format #t "~1Tframe-num: ~f~%" (-> this frame-num)) + (format #t "~1Tframe-targ: ~A~%" (-> this frame-targ)) + (format #t "~1Tframe-speed: ~f~%" (-> this frame-speed)) + (format #t "~1Tframe-blend: ~f~%" (-> this frame-blend)) + (format #t "~1Tframe-cur-blend: ~f~%" (-> this frame-cur-blend)) + (format #t "~1Tframe-start: ~f~%" (-> this frame-start)) + (format #t "~1Tframe-post-blend: ~f~%" (-> this frame-post-blend)) + (format #t "~1Tframe-post-end: ~f~%" (-> this frame-post-end)) + (format #t "~1Tframe-push-time: ~D~%" (-> this frame-push-time)) + (format #t "~1Tframe-post-put-away: ~A~%" (-> this frame-post-put-away)) + (format #t "~1Tupdate-time: ~D~%" (-> this update-time)) (label cfg-4) - obj + this ) ;; definition of type joint-control @@ -174,14 +174,14 @@ ) ;; definition for method 3 of type joint-control -(defmethod inspect joint-control ((obj joint-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-control ((this joint-control)) + (when (not this) + (set! this this) (goto cfg-28) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tstatus: #x~X : (joint-control-status " (-> obj status)) - (let ((s5-0 (-> obj status))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tstatus: #x~X : (joint-control-status " (-> this status)) + (let ((s5-0 (-> this status))) (if (= (logand s5-0 (joint-control-status blend-shape)) (joint-control-status blend-shape)) (format #t "blend-shape ") ) @@ -213,28 +213,28 @@ ) ) (format #t ")~%") - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tactive-channels: ~D~%" (-> obj active-channels)) - (format #t "~1Troot-channel: #x~X~%" (-> obj root-channel)) - (format #t "~1Tblend-index: ~D~%" (-> obj blend-index)) - (format #t "~1Tactive-frame-interp: ~D~%" (-> obj active-frame-interp)) - (format #t "~1Tfloat-channels: ~D~%" (-> obj float-channels)) - (format #t "~1Tgenerate-frame-function: ~A~%" (-> obj generate-frame-function)) - (format #t "~1Tprebind-function: ~A~%" (-> obj prebind-function)) - (format #t "~1Tpostbind-function: ~A~%" (-> obj postbind-function)) - (format #t "~1Teffect: ~A~%" (-> obj effect)) - (format #t "~1Tinterp-select[2] @ #x~X~%" (-> obj interp-select)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tactive-channels: ~D~%" (-> this active-channels)) + (format #t "~1Troot-channel: #x~X~%" (-> this root-channel)) + (format #t "~1Tblend-index: ~D~%" (-> this blend-index)) + (format #t "~1Tactive-frame-interp: ~D~%" (-> this active-frame-interp)) + (format #t "~1Tfloat-channels: ~D~%" (-> this float-channels)) + (format #t "~1Tgenerate-frame-function: ~A~%" (-> this generate-frame-function)) + (format #t "~1Tprebind-function: ~A~%" (-> this prebind-function)) + (format #t "~1Tpostbind-function: ~A~%" (-> this postbind-function)) + (format #t "~1Teffect: ~A~%" (-> this effect)) + (format #t "~1Tinterp-select[2] @ #x~X~%" (-> this interp-select)) (dotimes (s5-1 2) - (format #t "~T [~D]~1Tinterp-select: ~D~%" s5-1 (-> obj interp-select s5-1)) + (format #t "~T [~D]~1Tinterp-select: ~D~%" s5-1 (-> this interp-select s5-1)) ) - (format #t "~1Ttop-anim: ~A~%" (-> obj top-anim)) - (format #t "~1Toverride: ~A~%" (-> obj override)) - (format #t "~1Tchannel[0] @ #x~X~%" (-> obj channel)) - (dotimes (s5-2 (the-as int (-> obj active-channels))) - (format #t "~T [~D]~1Tchannel: ~`joint-control-channel`P~%" s5-2 (-> obj channel s5-2)) + (format #t "~1Ttop-anim: ~A~%" (-> this top-anim)) + (format #t "~1Toverride: ~A~%" (-> this override)) + (format #t "~1Tchannel[0] @ #x~X~%" (-> this channel)) + (dotimes (s5-2 (the-as int (-> this active-channels))) + (format #t "~T [~D]~1Tchannel: ~`joint-control-channel`P~%" s5-2 (-> this channel s5-2)) ) (label cfg-28) - obj + this ) ;; definition of type matrix-stack @@ -248,16 +248,16 @@ ) ;; definition for method 3 of type matrix-stack -(defmethod inspect matrix-stack ((obj matrix-stack)) - (when (not obj) - (set! obj obj) +(defmethod inspect matrix-stack ((this matrix-stack)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'matrix-stack) - (format #t "~1Ttop: #~%" (-> obj top)) - (format #t "~1Tdata[24] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'matrix-stack) + (format #t "~1Ttop: #~%" (-> this top)) + (format #t "~1Tdata[24] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type channel-upload-info @@ -276,20 +276,20 @@ ) ;; definition for method 3 of type channel-upload-info -(defmethod inspect channel-upload-info ((obj channel-upload-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect channel-upload-info ((this channel-upload-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'channel-upload-info) - (format #t "~1Tfixed: #~%" (-> obj fixed)) - (format #t "~1Tfixed-qwc: ~D~%" (-> obj fixed-qwc)) - (format #t "~1Tframe: #~%" (-> obj frame)) - (format #t "~1Tframe-qwc: ~D~%" (-> obj frame-qwc)) - (format #t "~1Tamount: ~f~%" (-> obj amount)) - (format #t "~1Tinterp: ~f~%" (-> obj interp)) + (format #t "[~8x] ~A~%" this 'channel-upload-info) + (format #t "~1Tfixed: #~%" (-> this fixed)) + (format #t "~1Tfixed-qwc: ~D~%" (-> this fixed-qwc)) + (format #t "~1Tframe: #~%" (-> this frame)) + (format #t "~1Tframe-qwc: ~D~%" (-> this frame-qwc)) + (format #t "~1Tamount: ~f~%" (-> this amount)) + (format #t "~1Tinterp: ~f~%" (-> this interp)) (label cfg-4) - obj + this ) ;; definition of type joint-work @@ -315,28 +315,28 @@ ) ;; definition for method 3 of type joint-work -(defmethod inspect joint-work ((obj joint-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-work ((this joint-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'joint-work) - (format #t "~1Ttemp-mtx: #~%" (-> obj temp-mtx)) - (format #t "~1Tjoint-stack: #~%" (-> obj joint-stack)) - (format #t "~1Tfix-jmp-table[16] @ #x~X~%" (-> obj fix-jmp-table)) - (format #t "~1Tfrm-jmp-table[16] @ #x~X~%" (-> obj frm-jmp-table)) - (format #t "~1Tpair-jmp-table[16] @ #x~X~%" (-> obj pair-jmp-table)) - (format #t "~1Tuploads[24] @ #x~X~%" (-> obj uploads)) - (format #t "~1Tnum-uploads: ~D~%" (-> obj num-uploads)) - (format #t "~1Tmtx-acc[2] @ #x~X~%" (-> obj mtx-acc)) - (format #t "~1Ttq-acc[100] @ #x~X~%" (-> obj tq-acc)) - (format #t "~1Tjacp-hdr: #~%" (-> obj jacp-hdr)) - (format #t "~1Tfixed-data: #~%" (-> obj fixed-data)) - (format #t "~1Tframe-data[2] @ #x~X~%" (-> obj frame-data)) - (format #t "~1Tflatten-array[576] @ #x~X~%" (-> obj mtx-acc)) - (format #t "~1Tflattened[24] @ #x~X~%" (-> obj mtx-acc)) + (format #t "[~8x] ~A~%" this 'joint-work) + (format #t "~1Ttemp-mtx: #~%" (-> this temp-mtx)) + (format #t "~1Tjoint-stack: #~%" (-> this joint-stack)) + (format #t "~1Tfix-jmp-table[16] @ #x~X~%" (-> this fix-jmp-table)) + (format #t "~1Tfrm-jmp-table[16] @ #x~X~%" (-> this frm-jmp-table)) + (format #t "~1Tpair-jmp-table[16] @ #x~X~%" (-> this pair-jmp-table)) + (format #t "~1Tuploads[24] @ #x~X~%" (-> this uploads)) + (format #t "~1Tnum-uploads: ~D~%" (-> this num-uploads)) + (format #t "~1Tmtx-acc[2] @ #x~X~%" (-> this mtx-acc)) + (format #t "~1Ttq-acc[100] @ #x~X~%" (-> this tq-acc)) + (format #t "~1Tjacp-hdr: #~%" (-> this jacp-hdr)) + (format #t "~1Tfixed-data: #~%" (-> this fixed-data)) + (format #t "~1Tframe-data[2] @ #x~X~%" (-> this frame-data)) + (format #t "~1Tflatten-array[576] @ #x~X~%" (-> this mtx-acc)) + (format #t "~1Tflattened[24] @ #x~X~%" (-> this mtx-acc)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc index 821428301e..9400feef33 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc @@ -57,21 +57,21 @@ ) ;; definition for method 3 of type joint-mod -(defmethod inspect joint-mod ((obj joint-mod)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-mod ((this joint-mod)) + (when (not this) + (set! this this) (goto cfg-18) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmode: ~D~%" (-> obj mode)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tjoint: #~%" (-> obj joint)) - (format #t "~1Ttarget: ~`vector`P~%" (-> obj target)) - (format #t "~1Ttwist: ~`vector`P~%" (-> obj twist)) - (format #t "~1Ttwist-max: ~`vector`P~%" (-> obj twist-max)) - (format #t "~1Textra-twist: (deg ~r)~%" (-> obj twist z)) - (format #t "~1Ttrack-mode: #x~X : (track-mode " (-> obj track-mode)) - (let ((s5-0 (-> obj track-mode))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmode: ~D~%" (-> this mode)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tjoint: #~%" (-> this joint)) + (format #t "~1Ttarget: ~`vector`P~%" (-> this target)) + (format #t "~1Ttwist: ~`vector`P~%" (-> this twist)) + (format #t "~1Ttwist-max: ~`vector`P~%" (-> this twist-max)) + (format #t "~1Textra-twist: (deg ~r)~%" (-> this twist z)) + (format #t "~1Ttrack-mode: #x~X : (track-mode " (-> this track-mode)) + (let ((s5-0 (-> this track-mode))) (if (= (logand s5-0 (track-mode track-on)) (track-mode track-on)) (format #t "track-on ") ) @@ -95,37 +95,37 @@ ) ) (format #t ")~%") - (format #t "~1Tlook-at-count: ~D~%" (-> obj loock-at-count)) - (format #t "~1Ttwist-range-x: (meters ~m)~%" (-> obj twist-max z)) - (format #t "~1Ttwist-range-y: (meters ~m)~%" (-> obj twist-max w)) - (format #t "~1Ttwist-speed-x: ~f~%" (-> obj twist-speed-x)) - (format #t "~1Ttwist-speed-y: ~f~%" (-> obj twist-speed-y)) - (format #t "~1Ttwist-min-x: ~f~%" (-> obj twist-min-x)) - (format #t "~1Ttwist-min-y: ~f~%" (-> obj twist-min-y)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Tsmushy-old: ~f~%" (-> obj trans x)) - (format #t "~1Tsmushy-off: ~f~%" (-> obj trans y)) - (format #t "~1Tsmushyv: ~f~%" (-> obj trans z)) - (format #t "~1Tquat: ~`quaternion`P~%" (-> obj quat)) - (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~1Tnotice-time: ~D~%" (-> obj notice-time)) - (format #t "~1Tflex-blend: ~f~%" (-> obj flex-blend)) - (format #t "~1Tblend: ~f~%" (-> obj blend)) - (format #t "~1Tmax-dist: (meters ~m)~%" (-> obj max-dist)) - (format #t "~1Tignore-angle: (deg ~r)~%" (-> obj ignore-angle)) - (format #t "~1Tup: ~D~%" (-> obj up)) - (format #t "~1Tnose: ~D~%" (-> obj nose)) - (format #t "~1Tear: ~D~%" (-> obj ear)) - (format #t "~1Tbase-joint: ~D~%" (-> obj base-joint)) - (format #t "~1Tbase-nose: ~D~%" (-> obj base-nose)) - (format #t "~1Tshutting-down?: ~A~%" (-> obj shutting-down?)) - (format #t "~1Tparented-scale?: ~A~%" (-> obj parented-scale?)) - (format #t "~1Tpolar-internal-tilt-max: ~f~%" (-> obj polar-internal-tilt-max)) - (format #t "~1Tpolar-internal-radius: ~f~%" (-> obj polar-internal-radius)) - (format #t "~1Tpolar-external-tilt-max: ~f~%" (-> obj polar-external-tilt-max)) - (format #t "~1Tpolar-external-radius: ~f~%" (-> obj polar-external-radius)) + (format #t "~1Tlook-at-count: ~D~%" (-> this loock-at-count)) + (format #t "~1Ttwist-range-x: (meters ~m)~%" (-> this twist-max z)) + (format #t "~1Ttwist-range-y: (meters ~m)~%" (-> this twist-max w)) + (format #t "~1Ttwist-speed-x: ~f~%" (-> this twist-speed-x)) + (format #t "~1Ttwist-speed-y: ~f~%" (-> this twist-speed-y)) + (format #t "~1Ttwist-min-x: ~f~%" (-> this twist-min-x)) + (format #t "~1Ttwist-min-y: ~f~%" (-> this twist-min-y)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tsmushy-old: ~f~%" (-> this trans x)) + (format #t "~1Tsmushy-off: ~f~%" (-> this trans y)) + (format #t "~1Tsmushyv: ~f~%" (-> this trans z)) + (format #t "~1Tquat: ~`quaternion`P~%" (-> this quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~1Tnotice-time: ~D~%" (-> this notice-time)) + (format #t "~1Tflex-blend: ~f~%" (-> this flex-blend)) + (format #t "~1Tblend: ~f~%" (-> this blend)) + (format #t "~1Tmax-dist: (meters ~m)~%" (-> this max-dist)) + (format #t "~1Tignore-angle: (deg ~r)~%" (-> this ignore-angle)) + (format #t "~1Tup: ~D~%" (-> this up)) + (format #t "~1Tnose: ~D~%" (-> this nose)) + (format #t "~1Tear: ~D~%" (-> this ear)) + (format #t "~1Tbase-joint: ~D~%" (-> this base-joint)) + (format #t "~1Tbase-nose: ~D~%" (-> this base-nose)) + (format #t "~1Tshutting-down?: ~A~%" (-> this shutting-down?)) + (format #t "~1Tparented-scale?: ~A~%" (-> this parented-scale?)) + (format #t "~1Tpolar-internal-tilt-max: ~f~%" (-> this polar-internal-tilt-max)) + (format #t "~1Tpolar-internal-radius: ~f~%" (-> this polar-internal-radius)) + (format #t "~1Tpolar-external-tilt-max: ~f~%" (-> this polar-external-tilt-max)) + (format #t "~1Tpolar-external-radius: ~f~%" (-> this polar-external-radius)) (label cfg-18) - obj + this ) ;; definition of type try-to-look-at-info @@ -140,17 +140,17 @@ ) ;; definition for method 3 of type try-to-look-at-info -(defmethod inspect try-to-look-at-info ((obj try-to-look-at-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect try-to-look-at-info ((this try-to-look-at-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twho: ~D~%" (-> obj who)) - (format #t "~1Thorz: ~f~%" (-> obj horz)) - (format #t "~1Tvert: ~f~%" (-> obj vert)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twho: ~D~%" (-> this who)) + (format #t "~1Thorz: ~f~%" (-> this horz)) + (format #t "~1Tvert: ~f~%" (-> this vert)) (label cfg-4) - obj + this ) ;; definition (debug) for function joint-mod-debug-draw @@ -162,9 +162,9 @@ ) ;; definition for method 12 of type joint-mod -(defmethod reset-blend! joint-mod ((obj joint-mod)) - (set! (-> obj blend) 0.0) - obj +(defmethod reset-blend! joint-mod ((this joint-mod)) + (set! (-> this blend) 0.0) + this ) ;; definition for symbol *joint-axis-vectors*, type (inline-array vector) @@ -195,19 +195,19 @@ ) ;; definition for method 3 of type joint-mod-wheel -(defmethod inspect joint-mod-wheel ((obj joint-mod-wheel)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-mod-wheel ((this joint-mod-wheel)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlast-position: #~%" (-> obj last-position)) - (format #t "~1Tangle: ~f~%" (-> obj angle)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Twheel-radius: ~f~%" (-> obj wheel-radius)) - (format #t "~1Twheel-axis: ~D~%" (-> obj wheel-axis)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlast-position: #~%" (-> this last-position)) + (format #t "~1Tangle: ~f~%" (-> this angle)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Twheel-radius: ~f~%" (-> this wheel-radius)) + (format #t "~1Twheel-axis: ~D~%" (-> this wheel-axis)) (label cfg-4) - obj + this ) ;; definition for function joint-mod-wheel-callback @@ -272,19 +272,19 @@ ) ;; definition for method 3 of type joint-mod-set-local -(defmethod inspect joint-mod-set-local ((obj joint-mod-set-local)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-mod-set-local ((this joint-mod-set-local)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttransform: #~%" (-> obj transform)) - (format #t "~1Tset-rotation: ~A~%" (-> obj set-rotation)) - (format #t "~1Tset-scale: ~A~%" (-> obj set-scale)) - (format #t "~1Tset-translation: ~A~%" (-> obj set-translation)) - (format #t "~1Tenable: ~A~%" (-> obj enable)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttransform: #~%" (-> this transform)) + (format #t "~1Tset-rotation: ~A~%" (-> this set-rotation)) + (format #t "~1Tset-scale: ~A~%" (-> this set-scale)) + (format #t "~1Tset-translation: ~A~%" (-> this set-translation)) + (format #t "~1Tenable: ~A~%" (-> this enable)) (label cfg-4) - obj + this ) ;; definition for function joint-mod-set-local-callback @@ -355,19 +355,19 @@ ) ;; definition for method 3 of type joint-mod-add-local -(defmethod inspect joint-mod-add-local ((obj joint-mod-add-local)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-mod-add-local ((this joint-mod-add-local)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttransform: #~%" (-> obj transform)) - (format #t "~1Tadd-rotation: ~A~%" (-> obj add-rotation)) - (format #t "~1Tadd-scale: ~A~%" (-> obj add-scale)) - (format #t "~1Tadd-translation: ~A~%" (-> obj add-translation)) - (format #t "~1Tenable: ~A~%" (-> obj enable)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttransform: #~%" (-> this transform)) + (format #t "~1Tadd-rotation: ~A~%" (-> this add-rotation)) + (format #t "~1Tadd-scale: ~A~%" (-> this add-scale)) + (format #t "~1Tadd-translation: ~A~%" (-> this add-translation)) + (format #t "~1Tenable: ~A~%" (-> this enable)) (label cfg-4) - obj + this ) ;; definition for function joint-mod-add-local-callback @@ -430,20 +430,21 @@ ) ;; definition for method 3 of type joint-mod-set-world -(defmethod inspect joint-mod-set-world ((obj joint-mod-set-world)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-mod-set-world ((this joint-mod-set-world)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttransform: #~%" (-> obj transform)) - (format #t "~1Tnode-index: ~D~%" (-> obj node-index)) - (format #t "~1Tenable: ~A~%" (-> obj enable)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttransform: #~%" (-> this transform)) + (format #t "~1Tnode-index: ~D~%" (-> this node-index)) + (format #t "~1Tenable: ~A~%" (-> this enable)) (label cfg-4) - obj + this ) ;; definition for function joint-mod-set-world-callback +;; WARN: Return type mismatch object vs none. (defun joint-mod-set-world-callback ((arg0 cspace) (arg1 transformq)) (let ((v1-0 (the-as joint-mod-set-world (-> arg0 param1)))) (if (-> v1-0 enable) @@ -488,19 +489,19 @@ ) ;; definition for method 3 of type joint-mod-blend-local -(defmethod inspect joint-mod-blend-local ((obj joint-mod-blend-local)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-mod-blend-local ((this joint-mod-blend-local)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttransform: #~%" (-> obj transform)) - (format #t "~1Tblend-transform: #~%" (-> obj blend-transform)) - (format #t "~1Tnode-index: ~D~%" (-> obj node-index)) - (format #t "~1Tblend: ~f~%" (-> obj blend)) - (format #t "~1Tenable: ~A~%" (-> obj enable)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttransform: #~%" (-> this transform)) + (format #t "~1Tblend-transform: #~%" (-> this blend-transform)) + (format #t "~1Tnode-index: ~D~%" (-> this node-index)) + (format #t "~1Tblend: ~f~%" (-> this blend)) + (format #t "~1Tenable: ~A~%" (-> this enable)) (label cfg-4) - obj + this ) ;; definition for function joint-mod-blend-local-callback @@ -560,18 +561,18 @@ ) ;; definition for method 3 of type joint-mod-spinner -(defmethod inspect joint-mod-spinner ((obj joint-mod-spinner)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-mod-spinner ((this joint-mod-spinner)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tspin-axis: #~%" (-> obj spin-axis)) - (format #t "~1Tangle: ~f~%" (-> obj angle)) - (format #t "~1Tspin-rate: ~f~%" (-> obj spin-rate)) - (format #t "~1Tenable: ~A~%" (-> obj enable)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tspin-axis: #~%" (-> this spin-axis)) + (format #t "~1Tangle: ~f~%" (-> this angle)) + (format #t "~1Tspin-rate: ~f~%" (-> this spin-rate)) + (format #t "~1Tenable: ~A~%" (-> this enable)) (label cfg-4) - obj + this ) ;; definition for function joint-mod-spinner-callback @@ -625,23 +626,24 @@ ) ;; definition for method 3 of type joint-mod-blend-world -(defmethod inspect joint-mod-blend-world ((obj joint-mod-blend-world)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-mod-blend-world ((this joint-mod-blend-world)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttransform: #~%" (-> obj transform)) - (format #t "~1Tblend-transform: #~%" (-> obj blend-transform)) - (format #t "~1Tblend-flags: ~D~%" (-> obj blend-flags)) - (format #t "~1Tnode-index: ~D~%" (-> obj node-index)) - (format #t "~1Tblend: ~f~%" (-> obj blend)) - (format #t "~1Tenable: ~A~%" (-> obj enable)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttransform: #~%" (-> this transform)) + (format #t "~1Tblend-transform: #~%" (-> this blend-transform)) + (format #t "~1Tblend-flags: ~D~%" (-> this blend-flags)) + (format #t "~1Tnode-index: ~D~%" (-> this node-index)) + (format #t "~1Tblend: ~f~%" (-> this blend)) + (format #t "~1Tenable: ~A~%" (-> this enable)) (label cfg-4) - obj + this ) ;; definition for function joint-mod-blend-world-callback +;; WARN: Return type mismatch object vs none. (defun joint-mod-blend-world-callback ((arg0 cspace) (arg1 transformq)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -751,16 +753,16 @@ ) ;; definition for method 3 of type joint-mod-rotate-local -(defmethod inspect joint-mod-rotate-local ((obj joint-mod-rotate-local)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-mod-rotate-local ((this joint-mod-rotate-local)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tenable: ~A~%" (-> obj enable)) - (format #t "~1Trotation: #~%" (-> obj rotation)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tenable: ~A~%" (-> this enable)) + (format #t "~1Trotation: #~%" (-> this rotation)) (label cfg-4) - obj + this ) ;; definition for function joint-mod-rotate-local-callback @@ -817,29 +819,29 @@ ) ;; definition for method 3 of type joint-mod-ik -(defmethod inspect joint-mod-ik ((obj joint-mod-ik)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-mod-ik ((this joint-mod-ik)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Thand-dist: ~f~%" (-> obj hand-dist)) - (format #t "~1Thandle-pos: #~%" (-> obj handle-pos)) - (format #t "~1Telbow-pole-vector-axis: ~D~%" (-> obj elbow-pole-vector-axis)) - (format #t "~1Telbow-rotation-axis: ~D~%" (-> obj elbow-rotation-axis)) - (format #t "~1Tuser-position: #~%" (-> obj user-position)) - (format #t "~1Tuser-normal: #~%" (-> obj user-normal)) - (format #t "~1Tuser-blend: ~f~%" (-> obj user-blend)) - (format #t "~1Tuser-float: ~f~%" (-> obj user-float)) - (format #t "~1Tcallback: ~A~%" (-> obj callback)) - (format #t "~1Tshoulder-matrix-no-ik: #~%" (-> obj shoulder-matrix-no-ik)) - (format #t "~1Telbow-matrix-no-ik: #~%" (-> obj elbow-matrix-no-ik)) - (format #t "~1Tblend: ~f~%" (-> obj blend)) - (format #t "~1Tblend-interp: ~f~%" (-> obj blend-interp)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Thand-dist: ~f~%" (-> this hand-dist)) + (format #t "~1Thandle-pos: #~%" (-> this handle-pos)) + (format #t "~1Telbow-pole-vector-axis: ~D~%" (-> this elbow-pole-vector-axis)) + (format #t "~1Telbow-rotation-axis: ~D~%" (-> this elbow-rotation-axis)) + (format #t "~1Tuser-position: #~%" (-> this user-position)) + (format #t "~1Tuser-normal: #~%" (-> this user-normal)) + (format #t "~1Tuser-blend: ~f~%" (-> this user-blend)) + (format #t "~1Tuser-float: ~f~%" (-> this user-float)) + (format #t "~1Tcallback: ~A~%" (-> this callback)) + (format #t "~1Tshoulder-matrix-no-ik: #~%" (-> this shoulder-matrix-no-ik)) + (format #t "~1Telbow-matrix-no-ik: #~%" (-> this elbow-matrix-no-ik)) + (format #t "~1Tblend: ~f~%" (-> this blend)) + (format #t "~1Tblend-interp: ~f~%" (-> this blend-interp)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc index d4759281c8..36f5414b25 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint-mod_REF.gc @@ -308,18 +308,18 @@ ;; definition for method 9 of type joint-mod-ik ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod handle-copy! joint-mod-ik ((obj joint-mod-ik) (arg0 vector)) - (set! (-> obj handle-pos quad) (-> arg0 quad)) +(defmethod handle-copy! joint-mod-ik ((this joint-mod-ik) (arg0 vector)) + (set! (-> this handle-pos quad) (-> arg0 quad)) 0 (none) ) ;; definition for method 10 of type joint-mod-ik ;; WARN: Return type mismatch int vs none. -(defmethod enable-set! joint-mod-ik ((obj joint-mod-ik) (arg0 symbol)) +(defmethod enable-set! joint-mod-ik ((this joint-mod-ik) (arg0 symbol)) (if arg0 - (logior! (-> obj flags) (joint-mod-ik-flags enable)) - (logclear! (-> obj flags) (joint-mod-ik-flags enable)) + (logior! (-> this flags) (joint-mod-ik-flags enable)) + (logclear! (-> this flags) (joint-mod-ik-flags enable)) ) 0 (none) @@ -584,107 +584,107 @@ ;; definition for method 9 of type joint-mod ;; WARN: Return type mismatch joint-mod vs none. -(defmethod mode-set! joint-mod ((obj joint-mod) (arg0 joint-mod-mode)) - (set! (-> obj mode) arg0) - (let ((v1-0 (-> obj joint))) +(defmethod mode-set! joint-mod ((this joint-mod) (arg0 joint-mod-mode)) + (set! (-> this mode) arg0) + (let ((v1-0 (-> this joint))) (case arg0 (((joint-mod-mode flex-blend)) (set! (-> v1-0 param0) #f) - (set! (-> obj blend) 0.0) - (set! (-> obj flex-blend) 1.0) + (set! (-> this blend) 0.0) + (set! (-> this flex-blend) 1.0) ) (((joint-mod-mode reset)) (set! (-> v1-0 param0) #f) - (set! (-> obj blend) 0.0) - (set! (-> obj shutting-down?) #f) + (set! (-> this blend) 0.0) + (set! (-> this shutting-down?) #f) ) (((joint-mod-mode look-at)) (let ((a0-4 v1-0)) (set! (-> a0-4 param0) joint-mod-look-at-handler) - (set! (-> a0-4 param1) obj) + (set! (-> a0-4 param1) this) ) ) (((joint-mod-mode gun-look-at)) (let ((a0-5 v1-0)) (set! (-> a0-5 param0) joint-mod-gun-look-at-handler) - (set! (-> a0-5 param1) obj) + (set! (-> a0-5 param1) this) ) ) (((joint-mod-mode foot-rot)) - (set-vector! (-> obj twist) 0.0 1.0 0.0 1.0) + (set-vector! (-> this twist) 0.0 1.0 0.0 1.0) (let ((a0-7 v1-0)) (set! (-> a0-7 param0) (lambda ((arg0 cspace) (arg1 transformq)) (joint-mod-foot-rot-handler arg0 arg1) (none)) ) - (set! (-> a0-7 param1) obj) + (set! (-> a0-7 param1) this) ) ) (((joint-mod-mode world-look-at)) (let ((a0-8 v1-0)) (set! (-> a0-8 param0) joint-mod-world-look-at-handler) - (set! (-> a0-8 param1) obj) + (set! (-> a0-8 param1) this) ) ) (((joint-mod-mode polar-look-at)) (let ((a0-9 v1-0)) (set! (-> a0-9 param0) joint-mod-polar-look-at-handler) - (set! (-> a0-9 param1) obj) + (set! (-> a0-9 param1) this) ) - (set! (-> obj polar-internal-tilt-max) 32768.0) - (set! (-> obj polar-internal-radius) 32768.0) - (set! (-> obj polar-external-tilt-max) 32768.0) - (set! (-> obj polar-external-radius) 32768.0) + (set! (-> this polar-internal-tilt-max) 32768.0) + (set! (-> this polar-internal-radius) 32768.0) + (set! (-> this polar-external-tilt-max) 32768.0) + (set! (-> this polar-external-radius) 32768.0) ) (((joint-mod-mode rotate)) (let ((a0-11 v1-0)) (set! (-> a0-11 param0) joint-mod-rotate-handler) - (set! (-> a0-11 param1) obj) + (set! (-> a0-11 param1) this) ) - (set! (-> obj blend) 1.0) + (set! (-> this blend) 1.0) ) (((joint-mod-mode rotate2)) (let ((a0-13 v1-0)) (set! (-> a0-13 param0) joint-mod-rotate-handler) - (set! (-> a0-13 param1) obj) + (set! (-> a0-13 param1) this) ) - (set! (-> obj blend) 1.0) + (set! (-> this blend) 1.0) ) (((joint-mod-mode joint-set)) (let ((a0-15 v1-0)) (set! (-> a0-15 param0) joint-mod-joint-set-handler) - (set! (-> a0-15 param1) obj) + (set! (-> a0-15 param1) this) ) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) ) (((joint-mod-mode joint-set-world)) (let ((a0-18 v1-0)) (set! (-> a0-18 param0) joint-mod-joint-set-world-handler) - (set! (-> a0-18 param1) obj) + (set! (-> a0-18 param1) this) ) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) - (set! (-> obj flex-blend) 1.0) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) + (set! (-> this flex-blend) 1.0) ) (((joint-mod-mode joint-set*)) (let ((a0-25 v1-0)) (set! (-> a0-25 param0) joint-mod-joint-set*-handler) - (set! (-> a0-25 param1) obj) + (set! (-> a0-25 param1) this) ) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) ) (((joint-mod-mode joint-set*-world)) (let ((a0-29 v1-0)) (set! (-> a0-29 param0) joint-mod-joint-set*-world-handler) - (set! (-> a0-29 param1) obj) + (set! (-> a0-29 param1) this) ) - (vector-reset! (-> obj trans)) - (quaternion-identity! (-> obj quat)) - (set-vector! (-> obj scale) 1.0 1.0 1.0 1.0) + (vector-reset! (-> this trans)) + (quaternion-identity! (-> this quat)) + (set-vector! (-> this scale) 1.0 1.0 1.0 1.0) ) ) ) @@ -693,38 +693,38 @@ ;; definition for method 15 of type joint-mod ;; WARN: Return type mismatch joint-mod vs none. -(defmethod shut-down joint-mod ((obj joint-mod)) - (set! (-> obj shutting-down?) #t) - (set! (-> obj blend) 0.0) +(defmethod shut-down joint-mod ((this joint-mod)) + (set! (-> this shutting-down?) #t) + (set! (-> this blend) 0.0) (none) ) ;; definition for method 13 of type joint-mod -(defmethod twist-set! joint-mod ((obj joint-mod) (arg0 float) (arg1 float) (arg2 float)) +(defmethod twist-set! joint-mod ((this joint-mod) (arg0 float) (arg1 float) (arg2 float)) (if arg0 - (set! (-> obj twist x) arg0) + (set! (-> this twist x) arg0) ) (if arg1 - (set! (-> obj twist y) arg1) + (set! (-> this twist y) arg1) ) (if arg2 - (set! (-> obj twist z) arg2) + (set! (-> this twist z) arg2) ) - (-> obj twist) + (-> this twist) ) ;; definition for method 14 of type joint-mod ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod trs-set! joint-mod ((obj joint-mod) (arg0 vector) (arg1 quaternion) (arg2 vector)) +(defmethod trs-set! joint-mod ((this joint-mod) (arg0 vector) (arg1 quaternion) (arg2 vector)) (if arg0 - (set! (-> obj trans quad) (-> arg0 quad)) + (set! (-> this trans quad) (-> arg0 quad)) ) (if arg1 - (quaternion-copy! (-> obj quat) arg1) + (quaternion-copy! (-> this quat) arg1) ) (if arg2 - (set! (-> obj scale quad) (-> arg2 quad)) + (set! (-> this scale quad) (-> arg2 quad)) ) 0 (none) @@ -733,16 +733,16 @@ ;; definition for method 10 of type joint-mod ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod target-set! joint-mod ((obj joint-mod) (arg0 vector)) - (if (= (-> obj mode) (joint-mod-mode reset)) - (mode-set! obj (joint-mod-mode look-at)) +(defmethod target-set! joint-mod ((this joint-mod) (arg0 vector)) + (if (= (-> this mode) (joint-mod-mode reset)) + (mode-set! this (joint-mod-mode look-at)) ) - (let ((f0-0 (vector-vector-distance (-> obj process root trans) arg0))) - (set! (-> obj shutting-down?) #f) - (set! (-> obj target quad) (-> arg0 quad)) - (if (< f0-0 (-> obj max-dist)) - (set! (-> obj blend) 1.0) - (set! (-> obj blend) 0.0) + (let ((f0-0 (vector-vector-distance (-> this process root trans) arg0))) + (set! (-> this shutting-down?) #f) + (set! (-> this target quad) (-> arg0 quad)) + (if (< f0-0 (-> this max-dist)) + (set! (-> this blend) 1.0) + (set! (-> this blend) 0.0) ) ) 0 @@ -755,7 +755,7 @@ ;; definition for method 11 of type joint-mod ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod look-at! joint-mod ((obj joint-mod) (arg0 vector) (arg1 symbol) (arg2 process)) +(defmethod look-at! joint-mod ((this joint-mod) (arg0 vector) (arg1 symbol) (arg2 process)) (when (= arg1 'attacking) (let* ((s2-0 arg2) (s1-0 (if (type? s2-0 process-drawable) @@ -771,8 +771,8 @@ ) ) (when s2-1 - (when (< (vector-vector-distance (-> obj process root trans) (-> s1-0 root trans)) (-> s2-1 cam-notice-dist)) - (set! (-> obj notice-time) (current-time)) + (when (< (vector-vector-distance (-> this process root trans) (-> s1-0 root trans)) (-> s2-1 cam-notice-dist)) + (set-time! (-> this notice-time)) (set! (-> last-try-to-look-at-data who) (process->handle arg2)) (if (< (-> last-try-to-look-at-data vert) (-> s2-1 cam-vert)) (set! (-> last-try-to-look-at-data vert) (-> s2-1 cam-vert)) @@ -786,21 +786,21 @@ ) ) ) - (let ((f30-0 (vector-vector-distance (-> obj process root trans) arg0))) + (let ((f30-0 (vector-vector-distance (-> this process root trans) arg0))) (if (logtest? (process-mask enemy) (-> arg2 mask)) - (+! (-> obj loock-at-count) (the int (lerp-scale 256.0 0.0 f30-0 20480.0 204800.0))) + (+! (-> this loock-at-count) (the int (lerp-scale 256.0 0.0 f30-0 20480.0 204800.0))) ) - (when (and (or (= (-> obj blend) 0.0) - (or (< f30-0 (vector-vector-distance (-> obj process root trans) (-> obj target))) (= arg1 'force)) + (when (and (or (= (-> this blend) 0.0) + (or (< f30-0 (vector-vector-distance (-> this process root trans) (-> this target))) (= arg1 'force)) ) - (< f30-0 (-> obj max-dist)) + (< f30-0 (-> this max-dist)) ) - (if (= (-> obj mode) (joint-mod-mode reset)) - (mode-set! obj (joint-mod-mode look-at)) + (if (= (-> this mode) (joint-mod-mode reset)) + (mode-set! this (joint-mod-mode look-at)) ) - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj blend) 1.0) - (set! (-> obj shutting-down?) #f) + (set! (-> this target quad) (-> arg0 quad)) + (set! (-> this blend) 1.0) + (set! (-> this shutting-down?) #f) ) ) 0 diff --git a/test/decompiler/reference/jak2/engine/anim/joint_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint_REF.gc index 43a5f573c4..fdafe5536d 100644 --- a/test/decompiler/reference/jak2/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/joint_REF.gc @@ -2,50 +2,50 @@ (in-package goal) ;; definition for method 2 of type joint -(defmethod print joint ((obj joint)) - (format #t "#<~A ~S ~D @ #x~X>" (-> obj type) (-> obj name) (-> obj number) obj) - obj +(defmethod print joint ((this joint)) + (format #t "#<~A ~S ~D @ #x~X>" (-> this type) (-> this name) (-> this number) this) + this ) ;; definition for method 8 of type joint -(defmethod mem-usage joint ((obj joint) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage joint ((this joint) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 68 (-> arg0 length))) (set! (-> arg0 data 67 name) "joint") (+! (-> arg0 data 67 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 67 used) v1-6) (+! (-> arg0 data 67 total) (logand -16 (+ v1-6 15))) ) - obj + this ) ;; definition for method 2 of type joint-anim -(defmethod print joint-anim ((obj joint-anim)) - (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> obj type) (-> obj name) (-> obj number) (-> obj length) obj) - obj +(defmethod print joint-anim ((this joint-anim)) + (format #t "#<~A ~S ~D [~D] @ #x~X>" (-> this type) (-> this name) (-> this number) (-> this length) this) + this ) ;; definition for method 4 of type joint-anim -(defmethod length joint-anim ((obj joint-anim)) - (-> obj length) +(defmethod length joint-anim ((this joint-anim)) + (-> this length) ) ;; definition for method 5 of type joint-anim-matrix ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-matrix ((obj joint-anim-matrix)) - (the-as int (+ (-> joint-anim-matrix size) (* (-> obj length) 64))) +(defmethod asize-of joint-anim-matrix ((this joint-anim-matrix)) + (the-as int (+ (-> joint-anim-matrix size) (* (-> this length) 64))) ) ;; definition for method 5 of type joint-anim-transformq ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-transformq ((obj joint-anim-transformq)) - (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> obj length)))) +(defmethod asize-of joint-anim-transformq ((this joint-anim-transformq)) + (the-as int (+ (-> joint-anim-transformq size) (* 48 (-> this length)))) ) ;; definition for method 5 of type joint-anim-drawable ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-anim-drawable ((obj joint-anim-drawable)) - (the-as int (+ (-> joint-anim-drawable size) (* (-> obj length) 4))) +(defmethod asize-of joint-anim-drawable ((this joint-anim-drawable)) + (the-as int (+ (-> joint-anim-drawable size) (* (-> this length) 4))) ) ;; definition for function joint-anim-login @@ -72,18 +72,18 @@ ) ;; definition for method 8 of type joint-anim-drawable -(defmethod mem-usage joint-anim-drawable ((obj joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage joint-anim-drawable ((this joint-anim-drawable) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 80 (-> arg0 length))) (set! (-> arg0 data 79 name) "joint-anim-drawable") (+! (-> arg0 data 79 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 79 used) v1-6) (+! (-> arg0 data 79 total) (logand -16 (+ v1-6 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for function jacc-mem-usage @@ -115,11 +115,11 @@ ) ;; definition for method 2 of type joint-control-channel -(defmethod print joint-control-channel ((obj joint-control-channel)) +(defmethod print joint-control-channel ((this joint-control-channel)) (let ((t9-0 format) (a0-1 #t) (a1-0 "#") - (v1-0 (-> obj command)) + (v1-0 (-> this command)) ) (t9-0 a0-1 @@ -147,18 +147,18 @@ "*unknown*" ) ) - (-> obj frame-group) - (-> obj frame-num) - obj + (-> this frame-group) + (-> this frame-num) + this ) ) - obj + this ) ;; definition for method 5 of type joint-control ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of joint-control ((obj joint-control)) - (the-as int (+ (-> obj type size) (* (-> obj allocated-length) 64))) +(defmethod asize-of joint-control ((this joint-control)) + (the-as int (+ (-> this type size) (* (-> this allocated-length) 64))) ) ;; definition for method 0 of type joint-control @@ -183,10 +183,10 @@ ) ;; definition for method 11 of type joint-control -(defmethod debug-print-channels joint-control ((obj joint-control) (arg0 symbol)) +(defmethod debug-print-channels joint-control ((this joint-control) (arg0 symbol)) (format arg0 "~0K") - (dotimes (s4-0 (the-as int (+ (-> obj active-channels) (-> obj float-channels)))) - (let* ((s3-0 (-> obj channel s4-0)) + (dotimes (s4-0 (the-as int (+ (-> this active-channels) (-> this float-channels)))) + (let* ((s3-0 (-> this channel s4-0)) (s2-0 (if (and (-> s3-0 frame-group) (nonzero? (-> s3-0 frame-group))) (-> s3-0 frame-group) ) @@ -195,7 +195,7 @@ (let* ((t9-1 format) (a0-3 arg0) (a1-2 "~S~2d ~C ~-35S ") - (a2-0 (if (= (-> obj root-channel) s3-0) + (a2-0 (if (= (-> this root-channel) s3-0) "~3Lch:~0L" "ch:" ) @@ -260,7 +260,7 @@ 0.0 ) ) - (-> s3-0 frame-interp (-> obj active-frame-interp)) + (-> s3-0 frame-interp (-> this active-frame-interp)) (* 0.003921569 (the float (-> s3-0 inspector-amount))) ) ) @@ -271,136 +271,136 @@ ) ;; definition for method 12 of type art -(defmethod needs-link? art ((obj art)) +(defmethod needs-link? art ((this art)) #f ) ;; definition for method 10 of type art ;; WARN: Return type mismatch symbol vs basic. -(defmethod get-art-by-name-method art ((obj art) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method art ((this art) (arg0 string) (arg1 type)) (the-as basic #f) ) ;; definition for method 11 of type art ;; WARN: Return type mismatch symbol vs int. -(defmethod get-art-idx-by-name-method art ((obj art) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method art ((this art) (arg0 string) (arg1 type)) (the-as int #f) ) ;; definition for method 2 of type art -(defmethod print art ((obj art)) - (format #t "#<~A ~S :length ~D @ #x~X>" (-> obj type) (-> obj name) (-> obj length) obj) - obj +(defmethod print art ((this art)) + (format #t "#<~A ~S :length ~D @ #x~X>" (-> this type) (-> this name) (-> this length) this) + this ) ;; definition for method 4 of type art -(defmethod length art ((obj art)) - (-> obj length) +(defmethod length art ((this art)) + (-> this length) ) ;; definition for method 9 of type art -(defmethod login art ((obj art)) - (if (and (-> obj extra) (zero? (-> obj extra tag))) - (set! (-> obj extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> obj extra)) 28))) +(defmethod login art ((this art)) + (if (and (-> this extra) (zero? (-> this extra tag))) + (set! (-> this extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> this extra)) 28))) ) - obj + this ) ;; definition for method 8 of type art-mesh-anim -(defmethod mem-usage art-mesh-anim ((obj art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-mesh-anim ((this art-mesh-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 75 (-> arg0 length))) (set! (-> arg0 data 74 name) "art-mesh-anim") (+! (-> arg0 data 74 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 74 used) v1-6) (+! (-> arg0 data 74 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 8 of type art-joint-anim -(defmethod mem-usage art-joint-anim ((obj art-joint-anim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-joint-anim ((this art-joint-anim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 78 (-> arg0 length))) (set! (-> arg0 data 77 name) "art-joint-anim") (+! (-> arg0 data 77 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 77 used) v1-6) (+! (-> arg0 data 77 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (jacc-mem-usage (-> obj frames) arg0 arg1) - (when (and (nonzero? (-> obj eye-anim)) (-> obj eye-anim)) + (jacc-mem-usage (-> this frames) arg0 arg1) + (when (and (nonzero? (-> this eye-anim)) (-> this eye-anim)) (set! (-> arg0 length) (max 112 (-> arg0 length))) (set! (-> arg0 data 111 name) "eye-anim") (+! (-> arg0 data 111 count) 1) - (let ((v1-26 (* (* (+ (-> obj eye-anim max-frame) 1) 2) 8))) + (let ((v1-26 (* (* (+ (-> this eye-anim max-frame) 1) 2) 8))) (+! (-> arg0 data 111 used) v1-26) (+! (-> arg0 data 111 total) (logand -16 (+ v1-26 15))) ) ) - obj + this ) ;; definition for method 5 of type art-joint-anim ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-joint-anim ((obj art-joint-anim)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-joint-anim ((this art-joint-anim)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 3 of type art-group -(defmethod inspect art-group ((obj art-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tinfo: ~A~%" (-> obj info)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (if (-> obj data s5-0) - (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> obj data s5-0) (mem-size (-> obj data s5-0) #f 0)) - (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> obj data s5-0) 0) +(defmethod inspect art-group ((this art-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tinfo: ~A~%" (-> this info)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (if (-> this data s5-0) + (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> this data s5-0) (mem-size (-> this data s5-0) #f 0)) + (format #t "~T [~D] ~A (~D bytes)~%" s5-0 (-> this data s5-0) 0) ) ) - obj + this ) ;; definition for method 12 of type art-group -(defmethod needs-link? art-group ((obj art-group)) - (and (nonzero? (-> obj length)) - (type? (-> obj data 0) art-joint-anim) - (!= (-> obj name) (-> (the-as art-joint-anim (-> obj data 0)) master-art-group-name)) +(defmethod needs-link? art-group ((this art-group)) + (and (nonzero? (-> this length)) + (type? (-> this data 0) art-joint-anim) + (!= (-> this name) (-> (the-as art-joint-anim (-> this data 0)) master-art-group-name)) ) ) ;; definition for method 10 of type art-group ;; WARN: Return type mismatch art-element vs basic. -(defmethod get-art-by-name-method art-group ((obj art-group) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method art-group ((this art-group) (arg0 string) (arg1 type)) (cond (arg1 - (let ((s3-0 (+ (length (-> obj name)) 1))) - (dotimes (s2-0 (-> obj length)) - (if (and (-> obj data s2-0) - (= (-> obj data s2-0 type) arg1) - (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) + (let ((s3-0 (+ (length (-> this name)) 1))) + (dotimes (s2-0 (-> this length)) + (if (and (-> this data s2-0) + (= (-> this data s2-0 type) arg1) + (or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) ) - (return (the-as basic (-> obj data s2-0))) + (return (the-as basic (-> this data s2-0))) ) ) ) (the-as art-element #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (and (-> obj data s4-1) (name= arg0 (-> obj data s4-1 name))) - (return (the-as basic (-> obj data s4-1))) + (dotimes (s4-1 (-> this length)) + (if (and (-> this data s4-1) (name= arg0 (-> this data s4-1 name))) + (return (the-as basic (-> this data s4-1))) ) ) (the-as art-element #f) @@ -409,14 +409,14 @@ ) ;; definition for method 11 of type art-group -(defmethod get-art-idx-by-name-method art-group ((obj art-group) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method art-group ((this art-group) (arg0 string) (arg1 type)) (cond (arg1 - (let ((s3-0 (+ (length (-> obj name)) 1))) - (dotimes (s2-0 (-> obj length)) - (if (and (-> obj data s2-0) - (= (-> obj data s2-0 type) arg1) - (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) + (let ((s3-0 (+ (length (-> this name)) 1))) + (dotimes (s2-0 (-> this length)) + (if (and (-> this data s2-0) + (= (-> this data s2-0 type) arg1) + (or (name= arg0 (-> this data s2-0 name)) (string-charp= arg0 (&-> (-> this data s2-0 name) data s3-0))) ) (return s2-0) ) @@ -425,8 +425,8 @@ (the-as int #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (and (-> obj data s4-1) (name= arg0 (-> obj data s4-1 name))) + (dotimes (s4-1 (-> this length)) + (if (and (-> this data s4-1) (name= arg0 (-> this data s4-1 name))) (return s4-1) ) ) @@ -436,51 +436,51 @@ ) ;; definition for method 9 of type art-group -(defmethod login art-group ((obj art-group)) - (dotimes (s5-0 (-> obj length)) - (if (-> obj data s5-0) - (set! (-> obj data s5-0) (login (-> obj data s5-0))) +(defmethod login art-group ((this art-group)) + (dotimes (s5-0 (-> this length)) + (if (-> this data s5-0) + (set! (-> this data s5-0) (login (-> this data s5-0))) ) ) - obj + this ) ;; definition for method 8 of type art-group -(defmethod mem-usage art-group ((obj art-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-group ((this art-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 74 (-> arg0 length))) (set! (-> arg0 data 73 name) "art-group") (+! (-> arg0 data 73 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 73 used) v1-6) (+! (-> arg0 data 73 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (if (-> obj data s3-0) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (if (-> this data s3-0) + (mem-usage (-> this data s3-0) arg0 arg1) ) ) - obj + this ) ;; definition for method 7 of type art-group ;; WARN: Return type mismatch art-group vs none. -(defmethod relocate art-group ((obj art-group) (arg0 kheap) (arg1 (pointer uint8))) +(defmethod relocate art-group ((this art-group) (arg0 kheap) (arg1 (pointer uint8))) (let ((s4-0 (clear *temp-string*))) (string<-charp s4-0 arg1) - (set! obj + (set! this (cond - ((not obj) + ((not this) (format 0 "ERROR: art-group ~A is not a valid file.~%" s4-0) (the-as art-group #f) ) - ((not (type? obj art-group)) + ((not (type? this art-group)) (format 0 "ERROR: art-group ~A is not a art-group.~%" s4-0) (the-as art-group #f) ) - ((not (file-info-correct-version? (-> obj info) (file-kind art-group) 0)) + ((not (file-info-correct-version? (-> this info) (file-kind art-group) 0)) (the-as art-group #f) ) (else @@ -493,8 +493,8 @@ (format 0 "ERROR: illegal login of art ~A (in level ~A) to level ~A~%" - obj - (get-level-by-heap-ptr-and-status *level* (the-as pointer obj) 'loading) + this + (get-level-by-heap-ptr-and-status *level* (the-as pointer this) 'loading) s5-1 ) (break!) @@ -502,12 +502,12 @@ ) ((or (not s5-1) (= (-> s5-1 name) 'default)) ) - ((!= (get-level-by-heap-ptr-and-status *level* (the-as pointer obj) 'loading) s5-1) + ((!= (get-level-by-heap-ptr-and-status *level* (the-as pointer this) 'loading) s5-1) (format 0 "ERROR: illegal login of art ~A (in level ~A) to level ~A~%" - obj - (get-level-by-heap-ptr-and-status *level* (the-as pointer obj) 'loading) + this + (get-level-by-heap-ptr-and-status *level* (the-as pointer this) 'loading) s5-1 ) (break!) @@ -515,16 +515,16 @@ ) ) (when (or (not s5-1) (= (-> s5-1 name) 'default)) - (login obj) - (if (needs-link? obj) - (link-art! obj) + (login this) + (if (needs-link? this) + (link-art! this) ) ) (if s5-1 - (set-loaded-art (-> s5-1 art-group) obj) + (set-loaded-art (-> s5-1 art-group) this) ) ) - obj + this ) ) ) @@ -534,32 +534,32 @@ ;; definition for method 5 of type art-mesh-geo ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-mesh-geo ((obj art-mesh-geo)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-mesh-geo ((this art-mesh-geo)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 8 of type art-mesh-geo -(defmethod mem-usage art-mesh-geo ((obj art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-mesh-geo ((this art-mesh-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 76 (-> arg0 length))) (set! (-> arg0 data 75 name) "art-mesh-geo") (+! (-> arg0 data 75 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 75 used) v1-6) (+! (-> arg0 data 75 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 9 of type art-mesh-geo -(defmethod login art-mesh-geo ((obj art-mesh-geo)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (the-as object (-> obj data s5-0)))) +(defmethod login art-mesh-geo ((this art-mesh-geo)) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (the-as object (-> this data s5-0)))) (dotimes (s3-0 (-> (the-as (pointer int16) s4-0) 3)) (if (-> (the-as (pointer art) (+ (* s3-0 4) (the-as int s4-0))) 2) (login (the-as drawable (-> (the-as (pointer art) (+ (* s3-0 4) (the-as int s4-0))) 2))) @@ -567,39 +567,39 @@ ) ) ) - obj + this ) ;; definition for method 9 of type art-joint-anim -(defmethod login art-joint-anim ((obj art-joint-anim)) - (if (and (-> obj extra) (zero? (-> obj extra tag))) - (set! (-> obj extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> obj extra)) 28))) +(defmethod login art-joint-anim ((this art-joint-anim)) + (if (and (-> this extra) (zero? (-> this extra tag))) + (set! (-> this extra tag) (the-as (pointer res-tag) (&+ (the-as pointer (-> this extra)) 28))) ) - obj + this ) ;; definition for method 5 of type art-joint-geo ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of art-joint-geo ((obj art-joint-geo)) - (the-as int (+ (-> art size) (* (-> obj length) 4))) +(defmethod asize-of art-joint-geo ((this art-joint-geo)) + (the-as int (+ (-> art size) (* (-> this length) 4))) ) ;; definition for method 10 of type art-joint-geo ;; WARN: Return type mismatch joint vs basic. -(defmethod get-art-by-name-method art-joint-geo ((obj art-joint-geo) (arg0 string) (arg1 type)) +(defmethod get-art-by-name-method art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 - (dotimes (s3-0 (-> obj length)) - (if (and (= (-> obj data s3-0 type) arg1) (name= arg0 (-> obj data s3-0 name))) - (return (the-as basic (-> obj data s3-0))) + (dotimes (s3-0 (-> this length)) + (if (and (= (-> this data s3-0 type) arg1) (name= arg0 (-> this data s3-0 name))) + (return (the-as basic (-> this data s3-0))) ) ) (the-as joint #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (name= arg0 (-> obj data s4-1 name)) - (return (the-as basic (-> obj data s4-1))) + (dotimes (s4-1 (-> this length)) + (if (name= arg0 (-> this data s4-1 name)) + (return (the-as basic (-> this data s4-1))) ) ) (the-as joint #f) @@ -608,19 +608,19 @@ ) ;; definition for method 11 of type art-joint-geo -(defmethod get-art-idx-by-name-method art-joint-geo ((obj art-joint-geo) (arg0 string) (arg1 type)) +(defmethod get-art-idx-by-name-method art-joint-geo ((this art-joint-geo) (arg0 string) (arg1 type)) (cond (arg1 - (dotimes (s3-0 (-> obj length)) - (if (and (= (-> obj data s3-0 type) arg1) (name= arg0 (-> obj data s3-0 name))) + (dotimes (s3-0 (-> this length)) + (if (and (= (-> this data s3-0 type) arg1) (name= arg0 (-> this data s3-0 name))) (return s3-0) ) ) (the-as int #f) ) (else - (dotimes (s4-1 (-> obj length)) - (if (name= arg0 (-> obj data s4-1 name)) + (dotimes (s4-1 (-> this length)) + (if (name= arg0 (-> this data s4-1 name)) (return s4-1) ) ) @@ -630,21 +630,21 @@ ) ;; definition for method 8 of type art-joint-geo -(defmethod mem-usage art-joint-geo ((obj art-joint-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage art-joint-geo ((this art-joint-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 77 (-> arg0 length))) (set! (-> arg0 data 76 name) "art-joint-geo") (+! (-> arg0 data 76 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 76 used) v1-6) (+! (-> arg0 data 76 total) (logand -16 (+ v1-6 15))) ) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 (logior arg1 512)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 (logior arg1 512)) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for function joint-control-channel-eval @@ -725,7 +725,6 @@ ;; definition for function joint-control-remap! ;; INFO: Used lq/sq -;; WARN: Return type mismatch symbol vs object. ;; WARN: Using new Jak 2 rtype-of (defun joint-control-remap! ((arg0 joint-control) (arg1 art-group) (arg2 art-group) (arg3 pair) (arg4 int) (arg5 string)) (local-vars @@ -1186,14 +1185,14 @@ ) ;; definition for method 9 of type cspace -(defmethod reset-and-assign-geo! cspace ((obj cspace) (arg0 drawable)) - (set! (-> obj parent) #f) - (set! (-> obj joint) #f) - (set! (-> obj geo) arg0) - (set! (-> obj param0) #f) - (set! (-> obj param1) #f) - (set! (-> obj param2) #f) - obj +(defmethod reset-and-assign-geo! cspace ((this cspace) (arg0 drawable)) + (set! (-> this parent) #f) + (set! (-> this joint) #f) + (set! (-> this geo) arg0) + (set! (-> this param0) #f) + (set! (-> this param1) #f) + (set! (-> this param2) #f) + this ) ;; definition for method 0 of type cspace @@ -2057,17 +2056,17 @@ ) ;; definition for method 2 of type art-joint-anim-manager-slot -(defmethod print art-joint-anim-manager-slot ((obj art-joint-anim-manager-slot)) +(defmethod print art-joint-anim-manager-slot ((this art-joint-anim-manager-slot)) (let* ((gp-0 format) (s5-0 #t) (s4-0 "#") - (v1-0 (-> obj anim)) + (v1-0 (-> this anim)) (s3-0 (if v1-0 (-> v1-0 name) ) ) - (s1-0 (-> obj comp-data)) - (v1-1 (-> obj anim)) + (s1-0 (-> this comp-data)) + (v1-1 (-> this anim)) ) (gp-0 s5-0 @@ -2078,38 +2077,38 @@ (-> v1-1 frames fixed) 0 ) - (if (-> obj anim) + (if (-> this anim) (sar (used-bytes-for-slot *anim-manager* - (the-as int (/ (the-as int (- (the-as uint obj) (the-as uint (the-as uint (-> *anim-manager* slot))))) 16)) + (the-as int (/ (the-as int (- (the-as uint this) (the-as uint (the-as uint (-> *anim-manager* slot))))) 16)) ) 10 ) 0 ) - (-> obj time-stamp) + (-> this time-stamp) ) ) - obj + this ) ;; definition for method 12 of type art-joint-anim-manager -(defmethod used-bytes-for-slot art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 int)) - (let ((v1-2 (-> obj slot arg0))) - (if (< arg0 (+ (-> obj free-index) -1)) +(defmethod used-bytes-for-slot art-joint-anim-manager ((this art-joint-anim-manager) (arg0 int)) + (let ((v1-2 (-> this slot arg0))) + (if (< arg0 (+ (-> this free-index) -1)) (&- - (the-as pointer (-> obj slot (+ arg0 1) anim frames fixed)) + (the-as pointer (-> this slot (+ arg0 1) anim frames fixed)) (the-as uint (the-as pointer (-> v1-2 anim frames fixed))) ) - (&- (the-as pointer (-> obj kheap current)) (the-as uint (the-as pointer (-> v1-2 anim frames fixed)))) + (&- (the-as pointer (-> this kheap current)) (the-as uint (the-as pointer (-> v1-2 anim frames fixed)))) ) ) ) ;; definition for method 11 of type art-joint-anim-manager -(defmethod unload-from-slot art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 int)) - (let* ((s3-0 (-> obj slot arg0)) +(defmethod unload-from-slot art-joint-anim-manager ((this art-joint-anim-manager) (arg0 int)) + (let* ((s3-0 (-> this slot arg0)) (s5-0 (-> s3-0 anim)) ) (let ((s2-0 (the-as object (-> s5-0 frames fixed)))) @@ -2132,10 +2131,10 @@ (logand! (-> v1-6 flags) -3) ) (cond - ((< arg0 (+ (-> obj free-index) -1)) - (let ((s1-0 (- (the-as uint (-> obj slot (+ arg0 1) anim frames fixed)) (the-as uint s2-0)))) - (let ((s0-0 (+ (- -1 arg0) (-> obj free-index)))) - (let ((a2-6 (&- (-> obj kheap current) (the-as uint (+ (the-as uint s2-0) s1-0))))) + ((< arg0 (+ (-> this free-index) -1)) + (let ((s1-0 (- (the-as uint (-> this slot (+ arg0 1) anim frames fixed)) (the-as uint s2-0)))) + (let ((s0-0 (+ (- -1 arg0) (-> this free-index)))) + (let ((a2-6 (&- (-> this kheap current) (the-as uint (+ (the-as uint s2-0) s1-0))))) (if (< (the-as int a2-6) 2560) (qmem-copy<-! (the-as pointer s2-0) (the-as pointer (+ (the-as uint s2-0) s1-0)) (the-as int a2-6)) (ultimate-memcpy (the-as pointer s2-0) (the-as pointer (+ (the-as uint s2-0) s1-0)) (the-as uint a2-6)) @@ -2143,7 +2142,7 @@ ) (qmem-copy<-! (the-as pointer s3-0) (the-as pointer (&+ s3-0 16)) (* s0-0 16)) (dotimes (v1-20 s0-0) - (let ((a0-21 (-> obj slot (+ arg0 v1-20) anim frames))) + (let ((a0-21 (-> this slot (+ arg0 v1-20) anim frames))) (set! (-> a0-21 fixed) (the-as joint-anim-compressed-fixed (- (the-as uint (-> a0-21 fixed)) s1-0))) (dotimes (a1-9 (the-as int (-> a0-21 num-frames))) (set! (-> a0-21 data a1-9) (the-as joint-anim-compressed-frame (- (the-as uint (-> a0-21 data a1-9)) s1-0))) @@ -2151,16 +2150,16 @@ ) ) ) - (set! s3-0 (-> obj slot (+ (-> obj free-index) -1))) - (set! (-> obj kheap current) (&- (-> obj kheap current) (the-as uint s1-0))) + (set! s3-0 (-> this slot (+ (-> this free-index) -1))) + (set! (-> this kheap current) (&- (-> this kheap current) (the-as uint s1-0))) ) ) (else - (set! (-> obj kheap current) (the-as pointer s2-0)) + (set! (-> this kheap current) (the-as pointer s2-0)) ) ) ) - (+! (-> obj free-index) -1) + (+! (-> this free-index) -1) (set! (-> s3-0 anim) #f) (set! (-> s3-0 time-stamp) (the-as uint 0)) (set! (-> s3-0 comp-data) (the-as uint 0)) @@ -2169,10 +2168,10 @@ ) ;; definition for method 10 of type art-joint-anim-manager -(defmethod update-time-stamp art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 art-joint-anim)) - (countdown (v1-0 (-> obj free-index)) - (when (= arg0 (-> obj slot v1-0 anim)) - (set! (-> obj slot v1-0 time-stamp) (the-as uint (-> *display* base-clock frame-counter))) +(defmethod update-time-stamp art-joint-anim-manager ((this art-joint-anim-manager) (arg0 art-joint-anim)) + (countdown (v1-0 (-> this free-index)) + (when (= arg0 (-> this slot v1-0 anim)) + (set! (-> this slot v1-0 time-stamp) (the-as uint (-> *display* base-clock frame-counter))) (return arg0) ) ) @@ -2180,33 +2179,33 @@ ) ;; definition for method 9 of type art-joint-anim-manager -(defmethod decompress art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 art-joint-anim)) +(defmethod decompress art-joint-anim-manager ((this art-joint-anim-manager) (arg0 art-joint-anim)) (let* ((s5-0 (-> arg0 frames)) (s3-0 (* (+ (-> s5-0 fixed-qwc) (* (-> s5-0 num-frames) (-> s5-0 frame-qwc))) 16)) ) - (while (or (< (the-as uint (&- (-> obj kheap top) (the-as uint (-> obj kheap current)))) (+ s3-0 64)) - (>= (-> obj free-index) 64) + (while (or (< (the-as uint (&- (-> this kheap top) (the-as uint (-> this kheap current)))) (+ s3-0 64)) + (>= (-> this free-index) 64) ) (let ((a1-2 -1)) (let ((a0-3 0)) - (dotimes (v1-2 (-> obj free-index)) - (when (or (< a1-2 0) (< (the-as int (-> obj slot v1-2 time-stamp)) a0-3)) - (set! a0-3 (the-as int (-> obj slot v1-2 time-stamp))) + (dotimes (v1-2 (-> this free-index)) + (when (or (< a1-2 0) (< (the-as int (-> this slot v1-2 time-stamp)) a0-3)) + (set! a0-3 (the-as int (-> this slot v1-2 time-stamp))) (set! a1-2 v1-2) ) ) ) - (unload-from-slot obj a1-2) + (unload-from-slot this a1-2) ) ) - (let ((v1-15 (-> obj slot (-> obj free-index)))) + (let ((v1-15 (-> this slot (-> this free-index)))) 0 - (+! (-> obj free-index) 1) + (+! (-> this free-index) 1) (set! (-> v1-15 anim) arg0) (set! (-> v1-15 time-stamp) (the-as uint (-> *display* base-clock frame-counter))) (set! (-> v1-15 comp-data) (the-as uint (-> s5-0 fixed))) ) - (let ((s4-1 (kmalloc (-> obj kheap) (the-as int s3-0) (kmalloc-flags) "malloc"))) + (let ((s4-1 (kmalloc (-> this kheap) (the-as int s3-0) (kmalloc-flags) "malloc"))) (unpack-comp-lzo (the-as (pointer uint8) s4-1) (the-as (pointer uint8) (-> s5-0 fixed))) (logand! (-> s5-0 flags) -2) (logior! (-> s5-0 flags) 2) @@ -2227,15 +2226,15 @@ ;; definition for method 13 of type art-joint-anim-manager ;; WARN: Return type mismatch int vs none. -(defmethod unload-from-level art-joint-anim-manager ((obj art-joint-anim-manager) (arg0 level)) +(defmethod unload-from-level art-joint-anim-manager ((this art-joint-anim-manager) (arg0 level)) (let ((s5-0 (-> arg0 heap base)) (s4-0 (-> arg0 heap top-base)) ) - (countdown (s3-0 (-> obj free-index)) - (if (and (>= (the-as int (-> obj slot s3-0 anim)) (the-as int s5-0)) - (< (the-as int (-> obj slot s3-0 anim)) (the-as int s4-0)) + (countdown (s3-0 (-> this free-index)) + (if (and (>= (the-as int (-> this slot s3-0 anim)) (the-as int s5-0)) + (< (the-as int (-> this slot s3-0 anim)) (the-as int s4-0)) ) - (unload-from-slot obj s3-0) + (unload-from-slot this s3-0) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc index 22e0465011..3424ae9141 100644 --- a/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type joint -(defmethod inspect joint ((obj joint)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint ((this joint)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tnumber: ~D~%" (-> obj number)) - (format #t "~1Tparent: ~A~%" (-> obj parent)) - (format #t "~1Tbind-pose: #~%" (-> obj bind-pose)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnumber: ~D~%" (-> this number)) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Tbind-pose: #~%" (-> this bind-pose)) (label cfg-4) - obj + this ) ;; definition of type bone-cache @@ -41,18 +41,18 @@ ) ;; definition for method 3 of type bone-cache -(defmethod inspect bone-cache ((obj bone-cache)) - (when (not obj) - (set! obj obj) +(defmethod inspect bone-cache ((this bone-cache)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bone-cache) - (format #t "~1Tbone-matrix: ~D~%" (-> obj bone-matrix)) - (format #t "~1Tparent-matrix: ~D~%" (-> obj parent-matrix)) - (format #t "~1Tdummy: ~D~%" (-> obj dummy)) - (format #t "~1Tframe: ~D~%" (-> obj frame)) + (format #t "[~8x] ~A~%" this 'bone-cache) + (format #t "~1Tbone-matrix: ~D~%" (-> this bone-matrix)) + (format #t "~1Tparent-matrix: ~D~%" (-> this parent-matrix)) + (format #t "~1Tdummy: ~D~%" (-> this dummy)) + (format #t "~1Tframe: ~D~%" (-> this frame)) (label cfg-4) - obj + this ) ;; definition of type bone @@ -67,17 +67,17 @@ ) ;; definition for method 3 of type bone -(defmethod inspect bone ((obj bone)) - (when (not obj) - (set! obj obj) +(defmethod inspect bone ((this bone)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bone) - (format #t "~1Ttransform: #~%" (-> obj transform)) - (format #t "~1Tposition: #~%" (-> obj transform trans)) - (format #t "~1Tscale: #~%" (-> obj scale)) + (format #t "[~8x] ~A~%" this 'bone) + (format #t "~1Ttransform: #~%" (-> this transform)) + (format #t "~1Tposition: #~%" (-> this transform trans)) + (format #t "~1Tscale: #~%" (-> this scale)) (label cfg-4) - obj + this ) ;; definition of type skeleton @@ -90,17 +90,17 @@ ) ;; definition for method 3 of type skeleton -(defmethod inspect skeleton ((obj skeleton)) - (when (not obj) - (set! obj obj) +(defmethod inspect skeleton ((this skeleton)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj bones)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this bones)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -127,22 +127,22 @@ ) ;; definition for method 3 of type cspace -(defmethod inspect cspace ((obj cspace)) - (when (not obj) - (set! obj obj) +(defmethod inspect cspace ((this cspace)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cspace) - (format #t "~1Tparent: #~%" (-> obj parent)) - (format #t "~1Tjoint: ~A~%" (-> obj joint)) - (format #t "~1Tjoint-num: ~D~%" (-> obj joint-num)) - (format #t "~1Tgeo: ~A~%" (-> obj geo)) - (format #t "~1Tbone: #~%" (-> obj bone)) - (format #t "~1Tparam0: ~A~%" (-> obj param0)) - (format #t "~1Tparam1: ~A~%" (-> obj param1)) - (format #t "~1Tparam2: ~A~%" (-> obj param2)) + (format #t "[~8x] ~A~%" this 'cspace) + (format #t "~1Tparent: #~%" (-> this parent)) + (format #t "~1Tjoint: ~A~%" (-> this joint)) + (format #t "~1Tjoint-num: ~D~%" (-> this joint-num)) + (format #t "~1Tgeo: ~A~%" (-> this geo)) + (format #t "~1Tbone: #~%" (-> this bone)) + (format #t "~1Tparam0: ~A~%" (-> this param0)) + (format #t "~1Tparam1: ~A~%" (-> this param1)) + (format #t "~1Tparam2: ~A~%" (-> this param2)) (label cfg-4) - obj + this ) ;; definition of type cspace-array @@ -155,34 +155,34 @@ ) ;; definition for method 3 of type cspace-array -(defmethod inspect cspace-array ((obj cspace-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect cspace-array ((this cspace-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: (set! (-> cspace-array heap-base) (the-as uint 32)) ;; definition for method 2 of type cspace -(defmethod print cspace ((obj cspace)) +(defmethod print cspace ((this cspace)) (format #t "#" - (if (-> obj joint) - (-> obj joint name) + (if (-> this joint) + (-> this joint name) "nojoint" ) - obj + this ) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc index b14d46430d..5572d20bca 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc @@ -59,30 +59,30 @@ ) ;; definition for method 3 of type cam-dbg-scratch -(defmethod inspect cam-dbg-scratch ((obj cam-dbg-scratch)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-dbg-scratch ((this cam-dbg-scratch)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cam-dbg-scratch) - (format #t "~1Tlinevec4w: ~`vector`P~%" (-> obj linevec4w)) - (format #t "~1Tcolor: ~`vector`P~%" (-> obj color)) - (format #t "~1Tplotvec: ~`vector`P~%" (-> obj plotvec)) - (format #t "~1Tlinevec: ~`vector`P~%" (-> obj linevec)) - (format #t "~1Trel-vec: ~`vector`P~%" (-> obj rel-vec)) - (format #t "~1Tsphere-v-start: ~`vector`P~%" (-> obj sphere-v-start)) - (format #t "~1Tsphere-v-end: ~`vector`P~%" (-> obj sphere-v-end)) - (format #t "~1Tsphere-v-down: ~`vector`P~%" (-> obj sphere-v-down)) - (format #t "~1Tsphere-vec: ~`vector`P~%" (-> obj sphere-vec)) - (format #t "~1Tcrossvec: ~`vector`P~%" (-> obj crossvec)) - (format #t "~1Tbboxvec: ~`vector`P~%" (-> obj bboxvec)) - (format #t "~1Tfov-vv: ~`vector`P~%" (-> obj fov-vv)) - (format #t "~1Tfov-src: ~`vector`P~%" (-> obj fov-src)) - (format #t "~1Tfov-dest: ~`vector`P~%" (-> obj fov-dest)) - (format #t "~1Tfov-vert: ~`vector`P~%" (-> obj fov-vert)) - (format #t "~1Tfov-horz: ~`vector`P~%" (-> obj fov-horz)) + (format #t "[~8x] ~A~%" this 'cam-dbg-scratch) + (format #t "~1Tlinevec4w: ~`vector`P~%" (-> this linevec4w)) + (format #t "~1Tcolor: ~`vector`P~%" (-> this color)) + (format #t "~1Tplotvec: ~`vector`P~%" (-> this plotvec)) + (format #t "~1Tlinevec: ~`vector`P~%" (-> this linevec)) + (format #t "~1Trel-vec: ~`vector`P~%" (-> this rel-vec)) + (format #t "~1Tsphere-v-start: ~`vector`P~%" (-> this sphere-v-start)) + (format #t "~1Tsphere-v-end: ~`vector`P~%" (-> this sphere-v-end)) + (format #t "~1Tsphere-v-down: ~`vector`P~%" (-> this sphere-v-down)) + (format #t "~1Tsphere-vec: ~`vector`P~%" (-> this sphere-vec)) + (format #t "~1Tcrossvec: ~`vector`P~%" (-> this crossvec)) + (format #t "~1Tbboxvec: ~`vector`P~%" (-> this bboxvec)) + (format #t "~1Tfov-vv: ~`vector`P~%" (-> this fov-vv)) + (format #t "~1Tfov-src: ~`vector`P~%" (-> this fov-src)) + (format #t "~1Tfov-dest: ~`vector`P~%" (-> this fov-dest)) + (format #t "~1Tfov-vert: ~`vector`P~%" (-> this fov-vert)) + (format #t "~1Tfov-horz: ~`vector`P~%" (-> this fov-horz)) (label cfg-4) - obj + this ) ;; definition for function cam-slave-options->string @@ -630,17 +630,17 @@ ) ;; definition for method 3 of type cam-debug-tri -(defmethod inspect cam-debug-tri ((obj cam-debug-tri)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-debug-tri ((this cam-debug-tri)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cam-debug-tri) - (format #t "~1Tvertex[3] @ #x~X~%" (-> obj vertex)) - (format #t "~1Tintersect: #~%" (-> obj intersect)) - (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "[~8x] ~A~%" this 'cam-debug-tri) + (format #t "~1Tvertex[3] @ #x~X~%" (-> this vertex)) + (format #t "~1Tintersect: #~%" (-> this intersect)) + (format #t "~1Tcolor: #~%" (-> this color)) (label cfg-4) - obj + this ) ;; definition for symbol *cam-debug-los-tri-current*, type int @@ -900,16 +900,16 @@ ;; definition for method 11 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod debug-point-info tracking-spline ((obj tracking-spline) (arg0 int)) - (if (= arg0 (-> obj used-point)) +(defmethod debug-point-info tracking-spline ((this tracking-spline) (arg0 int)) + (if (= arg0 (-> this used-point)) (format 0 "u") (format 0 " ") ) - (if (= arg0 (-> obj next-to-last-point)) + (if (= arg0 (-> this next-to-last-point)) (format 0 "n") (format 0 " ") ) - (if (= arg0 (-> obj end-point)) + (if (= arg0 (-> this end-point)) (format 0 "e") (format 0 " ") ) @@ -919,9 +919,9 @@ 0 " ~D ~M ~M ~M~%" arg0 - (-> obj point arg0 position x) - (-> obj point arg0 position y) - (-> obj point arg0 position z) + (-> this point arg0 position x) + (-> this point arg0 position y) + (-> this point arg0 position z) ) ) 0 @@ -930,13 +930,13 @@ ;; definition for method 12 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod debug-all-points tracking-spline ((obj tracking-spline)) - (let ((s5-0 (-> obj used-point))) +(defmethod debug-all-points tracking-spline ((this tracking-spline)) + (let ((s5-0 (-> this used-point))) (while (!= s5-0 -134250495) - (debug-point-info obj s5-0) - (set! s5-0 (-> obj point s5-0 next)) + (debug-point-info this s5-0) + (set! s5-0 (-> this point s5-0 next)) ) - (debug-point-info obj s5-0) + (debug-point-info this s5-0) ) 0 (none) @@ -944,12 +944,12 @@ ;; definition for method 23 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-spline tracking-spline ((obj tracking-spline)) - (let ((s5-0 (-> obj used-point))) - (let ((s4-0 (-> obj point (-> obj used-point) next))) +(defmethod debug-draw-spline tracking-spline ((this tracking-spline)) + (let ((s5-0 (-> this used-point))) + (let ((s4-0 (-> this point (-> this used-point) next))) (let ((s3-0 (new 'stack-no-clear 'vector))) (when (!= s4-0 -134250495) - (tracking-spline-method-19 obj 0.0 s3-0 (the-as tracking-spline-sampler #f)) + (tracking-spline-method-19 this 0.0 s3-0 (the-as tracking-spline-sampler #f)) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) @@ -957,7 +957,7 @@ (new 'static 'vector4w :x #xff :w #x80) (meters 0.25) ) - (tracking-spline-method-19 obj (-> obj sample-len) s3-0 (the-as tracking-spline-sampler #f)) + (tracking-spline-method-19 this (-> this sample-len) s3-0 (the-as tracking-spline-sampler #f)) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) @@ -969,19 +969,19 @@ ) (while (!= s4-0 -134250495) (camera-line - (the-as vector (-> obj point s5-0)) - (the-as vector (-> obj point s4-0)) + (the-as vector (-> this point s5-0)) + (the-as vector (-> this point s4-0)) (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) ) (set! s5-0 s4-0) - (set! s4-0 (-> obj point s4-0 next)) + (set! s4-0 (-> this point s4-0 next)) ) ) (if (!= s5-0 -134250495) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) - (the-as vector (-> obj point s5-0)) + (the-as vector (-> this point s5-0)) (new 'static 'vector4w :x #xff :w #x80) (meters 0.25) ) @@ -989,13 +989,13 @@ ) (let ((s5-1 (new 'stack-no-clear 'vector))) (camera-line - (-> obj debug-out-position) - (-> obj debug-old-position) + (-> this debug-out-position) + (-> this debug-old-position) (new 'static 'vector4w :x #xff :y #xff :w #x80) ) - (vector-! s5-1 (-> obj debug-out-position) (-> obj debug-old-position)) - (tracking-spline-method-20 obj s5-1 (-> obj debug-last-point)) - (camera-line-rel (-> obj debug-old-position) s5-1 (new 'static 'vector4w :x #xff :z #xff :w #x80)) + (vector-! s5-1 (-> this debug-out-position) (-> this debug-old-position)) + (tracking-spline-method-20 this s5-1 (-> this debug-last-point)) + (camera-line-rel (-> this debug-old-position) s5-1 (new 'static 'vector4w :x #xff :z #xff :w #x80)) ) 0 (none) @@ -1407,29 +1407,29 @@ ) ;; definition for method 3 of type cam-collision-record -(defmethod inspect cam-collision-record ((obj cam-collision-record)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-collision-record ((this cam-collision-record)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cam-collision-record) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tvel: #~%" (-> obj vel)) - (format #t "~1Tdesired-pos: #~%" (-> obj desired-pos)) - (format #t "~1Tcam-tpos-cur: #~%" (-> obj cam-tpos-cur)) - (format #t "~1Tcam-tpos-old: #~%" (-> obj cam-tpos-old)) - (format #t "~1Tview-flat: #~%" (-> obj view-flat)) - (format #t "~1Tstring-min-val: #~%" (-> obj string-min-val)) - (format #t "~1Tstring-max-val: #~%" (-> obj string-max-val)) - (format #t "~1Tview-off: #~%" (-> obj view-off)) - (format #t "~1Tmin-z-override: ~f~%" (-> obj min-z-override)) - (format #t "~1Tstring-push-z: ~f~%" (-> obj string-push-z)) - (format #t "~1Tview-off-param: ~f~%" (-> obj view-off-param)) - (format #t "~1Tframe: ~D~%" (-> obj frame)) - (format #t "~1Titeration: ~D~%" (-> obj iteration)) - (format #t "~1Tmove-type: ~A~%" (-> obj move-type)) + (format #t "[~8x] ~A~%" this 'cam-collision-record) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tvel: #~%" (-> this vel)) + (format #t "~1Tdesired-pos: #~%" (-> this desired-pos)) + (format #t "~1Tcam-tpos-cur: #~%" (-> this cam-tpos-cur)) + (format #t "~1Tcam-tpos-old: #~%" (-> this cam-tpos-old)) + (format #t "~1Tview-flat: #~%" (-> this view-flat)) + (format #t "~1Tstring-min-val: #~%" (-> this string-min-val)) + (format #t "~1Tstring-max-val: #~%" (-> this string-max-val)) + (format #t "~1Tview-off: #~%" (-> this view-off)) + (format #t "~1Tmin-z-override: ~f~%" (-> this min-z-override)) + (format #t "~1Tstring-push-z: ~f~%" (-> this string-push-z)) + (format #t "~1Tview-off-param: ~f~%" (-> this view-off-param)) + (format #t "~1Tframe: ~D~%" (-> this frame)) + (format #t "~1Titeration: ~D~%" (-> this iteration)) + (format #t "~1Tmove-type: ~A~%" (-> this move-type)) (label cfg-4) - obj + this ) ;; definition of type cam-collision-record-array @@ -1442,17 +1442,17 @@ ) ;; definition for method 3 of type cam-collision-record-array -(defmethod inspect cam-collision-record-array ((obj cam-collision-record-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-collision-record-array ((this cam-collision-record-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc index 33f53bbc8d..500d7eb589 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc @@ -22,20 +22,20 @@ ) ;; definition for method 3 of type cam-layout-bank -(defmethod inspect cam-layout-bank ((obj cam-layout-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-layout-bank ((this cam-layout-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tspline-t: ~f~%" (-> obj spline-t)) - (format #t "~1Tspline-step: ~f~%" (-> obj spline-step)) - (format #t "~1Tintro-t: ~f~%" (-> obj intro-t)) - (format #t "~1Tintro-step: ~f~%" (-> obj intro-step)) - (format #t "~1Tdebug-t: ~f~%" (-> obj debug-t)) - (format #t "~1Tdebug-step: ~f~%" (-> obj debug-step)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tspline-t: ~f~%" (-> this spline-t)) + (format #t "~1Tspline-step: ~f~%" (-> this spline-step)) + (format #t "~1Tintro-t: ~f~%" (-> this intro-t)) + (format #t "~1Tintro-step: ~f~%" (-> this intro-step)) + (format #t "~1Tdebug-t: ~f~%" (-> this debug-t)) + (format #t "~1Tdebug-step: ~f~%" (-> this debug-step)) (label cfg-4) - obj + this ) ;; definition for symbol *CAM_LAYOUT-bank*, type cam-layout-bank @@ -61,14 +61,14 @@ ) ;; definition for method 3 of type clm-basic -(defmethod inspect clm-basic ((obj clm-basic)) - (when (not obj) - (set! obj obj) +(defmethod inspect clm-basic ((this clm-basic)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "[~8x] ~A~%" this (-> this type)) (label cfg-4) - obj + this ) ;; definition of type clm-item-action @@ -88,19 +88,19 @@ ) ;; definition for method 3 of type clm-item-action -(defmethod inspect clm-item-action ((obj clm-item-action)) - (when (not obj) - (set! obj obj) +(defmethod inspect clm-item-action ((this clm-item-action)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'clm-item-action) - (format #t "~1Tbutton: ~D~%" (-> obj button)) - (format #t "~1Toptions: ~D~%" (-> obj options)) - (format #t "~1Tfunc: ~A~%" (-> obj func)) - (format #t "~1Tparm0: ~A~%" (-> obj parm0)) - (format #t "~1Tparm1: ~A~%" (-> obj parm1)) + (format #t "[~8x] ~A~%" this 'clm-item-action) + (format #t "~1Tbutton: ~D~%" (-> this button)) + (format #t "~1Toptions: ~D~%" (-> this options)) + (format #t "~1Tfunc: ~A~%" (-> this func)) + (format #t "~1Tparm0: ~A~%" (-> this parm0)) + (format #t "~1Tparm1: ~A~%" (-> this parm1)) (label cfg-4) - obj + this ) ;; definition of type clm-item @@ -115,17 +115,17 @@ ) ;; definition for method 3 of type clm-item -(defmethod inspect clm-item ((obj clm-item)) - (when (not obj) - (set! obj obj) +(defmethod inspect clm-item ((this clm-item)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdescription: ~A~%" (-> obj description)) - (format #t "~1Tbutton-symbol: ~A~%" (-> obj button-symbol)) - (format #t "~1Taction: #~%" (-> obj action)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdescription: ~A~%" (-> this description)) + (format #t "~1Tbutton-symbol: ~A~%" (-> this button-symbol)) + (format #t "~1Taction: #~%" (-> this action)) (label cfg-4) - obj + this ) ;; definition of type clm-list-item @@ -146,20 +146,20 @@ ) ;; definition for method 3 of type clm-list-item -(defmethod inspect clm-list-item ((obj clm-list-item)) - (when (not obj) - (set! obj obj) +(defmethod inspect clm-list-item ((this clm-list-item)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdescription: ~A~%" (-> obj description)) - (format #t "~1Ttrack-val: ~A~%" (-> obj track-val)) - (format #t "~1Tval-func: ~A~%" (-> obj val-func)) - (format #t "~1Tval-parm0: ~A~%" (-> obj val-parm0)) - (format #t "~1Tval-parm1: ~A~%" (-> obj val-parm1)) - (format #t "~1Tactions: ~A~%" (-> obj actions)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdescription: ~A~%" (-> this description)) + (format #t "~1Ttrack-val: ~A~%" (-> this track-val)) + (format #t "~1Tval-func: ~A~%" (-> this val-func)) + (format #t "~1Tval-parm0: ~A~%" (-> this val-parm0)) + (format #t "~1Tval-parm1: ~A~%" (-> this val-parm1)) + (format #t "~1Tactions: ~A~%" (-> this actions)) (label cfg-4) - obj + this ) ;; definition of type clm-list @@ -174,17 +174,17 @@ ) ;; definition for method 3 of type clm-list -(defmethod inspect clm-list ((obj clm-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect clm-list ((this clm-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttracker: ~A~%" (-> obj tracker)) - (format #t "~1Tcur-list-item: ~D~%" (-> obj cur-list-item)) - (format #t "~1Titems: ~A~%" (-> obj items)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttracker: ~A~%" (-> this tracker)) + (format #t "~1Tcur-list-item: ~D~%" (-> this cur-list-item)) + (format #t "~1Titems: ~A~%" (-> this items)) (label cfg-4) - obj + this ) ;; definition of type clm @@ -198,16 +198,16 @@ ) ;; definition for method 3 of type clm -(defmethod inspect clm ((obj clm)) - (when (not obj) - (set! obj obj) +(defmethod inspect clm ((this clm)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttitle: ~A~%" (-> obj title)) - (format #t "~1Titems: ~A~%" (-> obj items)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttitle: ~A~%" (-> this title)) + (format #t "~1Titems: ~A~%" (-> this items)) (label cfg-4) - obj + this ) ;; definition for symbol *volume-point-current*, type int @@ -232,17 +232,17 @@ ) ;; definition for method 3 of type volume-descriptor-array -(defmethod inspect volume-descriptor-array ((obj volume-descriptor-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect volume-descriptor-array ((this volume-descriptor-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -275,24 +275,24 @@ ) ;; definition for method 3 of type cam-layout -(defmethod inspect cam-layout ((obj cam-layout)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-layout ((this cam-layout)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcam-entity: ~A~%" (-> obj cam-entity)) - (format #t "~2Tnum-entities: ~D~%" (-> obj num-entities)) - (format #t "~2Tcur-entity: ~D~%" (-> obj cur-entity)) - (format #t "~2Tnum-volumes: ~D~%" (-> obj num-volumes)) - (format #t "~2Tcur-volume: ~D~%" (-> obj cur-volume)) - (format #t "~2Tfirst-pvol: ~D~%" (-> obj first-pvol)) - (format #t "~2Tfirst-cutoutvol: ~D~%" (-> obj first-cutoutvol)) - (format #t "~2Tres-key: ~f~%" (-> obj res-key)) + (format #t "~2Tcam-entity: ~A~%" (-> this cam-entity)) + (format #t "~2Tnum-entities: ~D~%" (-> this num-entities)) + (format #t "~2Tcur-entity: ~D~%" (-> this cur-entity)) + (format #t "~2Tnum-volumes: ~D~%" (-> this num-volumes)) + (format #t "~2Tcur-volume: ~D~%" (-> this cur-volume)) + (format #t "~2Tfirst-pvol: ~D~%" (-> this first-pvol)) + (format #t "~2Tfirst-cutoutvol: ~D~%" (-> this first-cutoutvol)) + (format #t "~2Tres-key: ~f~%" (-> this res-key)) (label cfg-4) - obj + this ) ;; definition for function cam-layout-print @@ -622,20 +622,20 @@ ) ;; definition for method 3 of type interp-test-info -(defmethod inspect interp-test-info ((obj interp-test-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect interp-test-info ((this interp-test-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'interp-test-info) - (format #t "~1Tfrom: #~%" (-> obj from)) - (format #t "~1Tto: #~%" (-> obj to)) - (format #t "~1Torigin: #~%" (-> obj origin)) - (format #t "~1Tcolor: #~%" (-> obj color)) - (format #t "~1Taxis: #~%" (-> obj axis)) - (format #t "~1Tdisp: ~A~%" (-> obj disp)) + (format #t "[~8x] ~A~%" this 'interp-test-info) + (format #t "~1Tfrom: #~%" (-> this from)) + (format #t "~1Tto: #~%" (-> this to)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tdisp: ~A~%" (-> this disp)) (label cfg-4) - obj + this ) ;; definition for function interp-test @@ -2278,17 +2278,17 @@ ) ;; definition for method 3 of type clmf-cam-flag-toggle-info -(defmethod inspect clmf-cam-flag-toggle-info ((obj clmf-cam-flag-toggle-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect clmf-cam-flag-toggle-info ((this clmf-cam-flag-toggle-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'clmf-cam-flag-toggle-info) - (format #t "~1Tkey: ~f~%" (-> obj key)) - (format #t "~1Tforce-on: ~D~%" (-> obj force-on)) - (format #t "~1Tforce-off: ~D~%" (-> obj force-off)) + (format #t "[~8x] ~A~%" this 'clmf-cam-flag-toggle-info) + (format #t "~1Tkey: ~f~%" (-> this key)) + (format #t "~1Tforce-on: ~D~%" (-> this force-on)) + (format #t "~1Tforce-off: ~D~%" (-> this force-off)) (label cfg-4) - obj + this ) ;; definition for function clmf-cam-flag-toggle diff --git a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc index 1199aedf9f..6a5bb23e1b 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-master_REF.gc @@ -2,8 +2,8 @@ (in-package goal) ;; definition for method 16 of type camera-master -(defmethod camera-master-method-16 camera-master ((obj camera-master) (arg0 symbol)) - (let ((a2-0 (the-as target (handle->process (-> obj focus handle)))) +(defmethod camera-master-method-16 camera-master ((this camera-master) (arg0 symbol)) + (let ((a2-0 (the-as target (handle->process (-> this focus handle)))) (v1-4 0) ) (if a2-0 @@ -59,11 +59,11 @@ (set! (-> self string-max target z) (-> self settings string-max-length)) (set! (-> self string-push-z) (fmax (-> self string-min value z) (-> *CAMERA-bank* default-string-push-z))) (cond - ((>= (- (current-time) (get-notice-time (the-as process-focusable gp-0))) (-> *CAMERA-bank* attack-timeout)) + ((time-elapsed? (get-notice-time (the-as process-focusable gp-0)) (-> *CAMERA-bank* attack-timeout)) (set! (-> self being-attacked) #f) ) (else - (set! (-> self attack-start) (current-time)) + (set-time! (-> self attack-start)) (set! (-> self being-attacked) #t) (when (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) (set! (-> self string-max target y) (fmax (-> self string-max target y) (-> last-try-to-look-at-data vert))) @@ -115,12 +115,12 @@ (gp-0 (logior! (-> self master-options) (cam-master-options-u32 HAVE_TARGET)) (cond - ((>= (- (current-time) (get-notice-time (the-as target gp-0))) (-> *CAMERA-bank* attack-timeout)) + ((time-elapsed? (get-notice-time (the-as target gp-0)) (-> *CAMERA-bank* attack-timeout)) (set! (-> self being-attacked) #f) ) (else (if (not (-> self being-attacked)) - (set! (-> self attack-start) (current-time)) + (set-time! (-> self attack-start)) ) (set! (-> self being-attacked) #t) (when (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) @@ -929,7 +929,7 @@ ) ) (('part-water-drip) - (set! (-> self water-drip-time) (current-time)) + (set-time! (-> self water-drip-time)) (set! (-> self water-drip-mult) (the-as float (-> block param 0))) (set! (-> self water-drip-speed) (the-as float (-> block param 1))) ) @@ -1088,9 +1088,9 @@ ) ;; definition for method 14 of type camera-master -(defmethod camera-master-method-14 camera-master ((obj camera-master) (arg0 vector)) - (if (handle->process (-> obj focus handle)) - (vector-! arg0 (-> obj tpos-curr) (-> obj tpos-old)) +(defmethod camera-master-method-14 camera-master ((this camera-master) (arg0 vector)) + (if (handle->process (-> this focus handle)) + (vector-! arg0 (-> this tpos-curr) (-> this tpos-old)) (vector-reset! arg0) ) arg0 @@ -1098,9 +1098,9 @@ ;; definition for method 15 of type camera-master ;; INFO: Used lq/sq -(defmethod camera-master-method-15 camera-master ((obj camera-master) (arg0 vector)) - (if (and (-> obj slave) (-> obj slave 0 next-state) (= (-> obj slave 0 next-state name) 'cam-string)) - (set! (-> arg0 quad) (-> obj slave 0 view-flat quad)) +(defmethod camera-master-method-15 camera-master ((this camera-master) (arg0 vector)) + (if (and (-> this slave) (-> this slave 0 next-state) (= (-> this slave 0 next-state name) 'cam-string)) + (set! (-> arg0 quad) (-> this slave 0 view-flat quad)) (vector-reset! arg0) ) arg0 diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc index c1565f3830..2d28746d7a 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states-dbg_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type cam-point-watch-bank -(defmethod inspect cam-point-watch-bank ((obj cam-point-watch-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-point-watch-bank ((this cam-point-watch-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tspeed: ~f~%" (-> obj speed)) - (format #t "~1Trot-speed: (deg ~r)~%" (-> obj rot-speed)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Trot-speed: (deg ~r)~%" (-> this rot-speed)) (label cfg-4) - obj + this ) ;; definition for symbol *CAM_POINT_WATCH-bank*, type cam-point-watch-bank @@ -107,16 +107,16 @@ ) ;; definition for method 3 of type cam-free-bank -(defmethod inspect cam-free-bank ((obj cam-free-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-free-bank ((this cam-free-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tspeed: ~f~%" (-> obj speed)) - (format #t "~1Trot-speed: (deg ~r)~%" (-> obj rot-speed)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Trot-speed: (deg ~r)~%" (-> this rot-speed)) (label cfg-4) - obj + this ) ;; definition for symbol *CAM_FREE-bank*, type cam-free-bank @@ -423,18 +423,18 @@ ) ;; definition for method 3 of type camera-free-floating-move-info -(defmethod inspect camera-free-floating-move-info ((obj camera-free-floating-move-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect camera-free-floating-move-info ((this camera-free-floating-move-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'camera-free-floating-move-info) - (format #t "~1Trv: #~%" (-> obj rv)) - (format #t "~1Ttv: #~%" (-> obj tv)) - (format #t "~1Tup: #~%" (-> obj up)) - (format #t "~1Ttm: #~%" (-> obj tm)) + (format #t "[~8x] ~A~%" this 'camera-free-floating-move-info) + (format #t "~1Trv: #~%" (-> this rv)) + (format #t "~1Ttv: #~%" (-> this tv)) + (format #t "~1Tup: #~%" (-> this up)) + (format #t "~1Ttm: #~%" (-> this tm)) (label cfg-4) - obj + this ) ;; definition for function cam-free-floating-move diff --git a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc index bb43f6156b..6cc9d19791 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-states_REF.gc @@ -455,18 +455,18 @@ ) ;; definition for method 3 of type cam-eye-bank -(defmethod inspect cam-eye-bank ((obj cam-eye-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-eye-bank ((this cam-eye-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Trot-speed: ~f~%" (-> obj rot-speed)) - (format #t "~1Tmax-degrees: ~f~%" (-> obj max-degrees)) - (format #t "~1Tmax-fov: ~f~%" (-> obj max-fov)) - (format #t "~1Tmin-fov: ~f~%" (-> obj min-fov)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Trot-speed: ~f~%" (-> this rot-speed)) + (format #t "~1Tmax-degrees: ~f~%" (-> this max-degrees)) + (format #t "~1Tmax-fov: ~f~%" (-> this max-fov)) + (format #t "~1Tmin-fov: ~f~%" (-> this min-fov)) (label cfg-4) - obj + this ) ;; definition for symbol *CAM_EYE-bank*, type cam-eye-bank @@ -1201,16 +1201,16 @@ ) ;; definition for method 3 of type cam-string-bank -(defmethod inspect cam-string-bank ((obj cam-string-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-string-bank ((this cam-string-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlos-coll-rad: (meters ~m)~%" (-> obj los-coll-rad)) - (format #t "~1Tlos-coll-rad2: (meters ~m)~%" (-> obj los-coll-rad2)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlos-coll-rad: (meters ~m)~%" (-> this los-coll-rad)) + (format #t "~1Tlos-coll-rad2: (meters ~m)~%" (-> this los-coll-rad2)) (label cfg-4) - obj + this ) ;; definition for symbol *CAM_STRING-bank*, type cam-string-bank @@ -1324,17 +1324,17 @@ ) ;; definition for method 3 of type los-dist -(defmethod inspect los-dist ((obj los-dist)) - (when (not obj) - (set! obj obj) +(defmethod inspect los-dist ((this los-dist)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'los-dist) - (format #t "~1Tpar-dist: ~f~%" (-> obj par-dist)) - (format #t "~1Tlat-dist: ~f~%" (-> obj lat-dist)) - (format #t "~1Tvert-dist: ~f~%" (-> obj vert-dist)) + (format #t "[~8x] ~A~%" this 'los-dist) + (format #t "~1Tpar-dist: ~f~%" (-> this par-dist)) + (format #t "~1Tlat-dist: ~f~%" (-> this lat-dist)) + (format #t "~1Tvert-dist: ~f~%" (-> this vert-dist)) (label cfg-4) - obj + this ) ;; definition of type collide-los-dist-info @@ -1355,23 +1355,23 @@ ) ;; definition for method 3 of type collide-los-dist-info -(defmethod inspect collide-los-dist-info ((obj collide-los-dist-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-los-dist-info ((this collide-los-dist-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-los-dist-info) - (format #t "~1Tmin-par: ~f~%" (-> obj min-par)) - (format #t "~1Tmax-par: ~f~%" (-> obj max-par)) - (format #t "~1Tmin-lat: ~f~%" (-> obj min-lat)) - (format #t "~1Tmax-lat: ~f~%" (-> obj max-lat)) - (format #t "~1Tmin-vp: ~f~%" (-> obj min-vp)) - (format #t "~1Tmax-vp: ~f~%" (-> obj max-vp)) - (format #t "~1Tmin-vn: ~f~%" (-> obj min-vn)) - (format #t "~1Tmax-vn: ~f~%" (-> obj max-vn)) - (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "[~8x] ~A~%" this 'collide-los-dist-info) + (format #t "~1Tmin-par: ~f~%" (-> this min-par)) + (format #t "~1Tmax-par: ~f~%" (-> this max-par)) + (format #t "~1Tmin-lat: ~f~%" (-> this min-lat)) + (format #t "~1Tmax-lat: ~f~%" (-> this max-lat)) + (format #t "~1Tmin-vp: ~f~%" (-> this min-vp)) + (format #t "~1Tmax-vp: ~f~%" (-> this max-vp)) + (format #t "~1Tmin-vn: ~f~%" (-> this min-vn)) + (format #t "~1Tmax-vn: ~f~%" (-> this max-vn)) + (format #t "~1Tcount: ~D~%" (-> this count)) (label cfg-4) - obj + this ) ;; definition for function dist-info-init @@ -1493,19 +1493,19 @@ ) ;; definition for method 3 of type collide-los-result -(defmethod inspect collide-los-result ((obj collide-los-result)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-los-result ((this collide-los-result)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-los-result) - (format #t "~1Tlateral: ~`vector`P~%" (-> obj lateral)) - (format #t "~1Tcw: #~%" (-> obj cw)) - (format #t "~1Tccw: #~%" (-> obj ccw)) - (format #t "~1Tstraddle: #~%" (-> obj straddle)) - (format #t "~1Tlateral-valid: ~A~%" (-> obj lateral-valid)) + (format #t "[~8x] ~A~%" this 'collide-los-result) + (format #t "~1Tlateral: ~`vector`P~%" (-> this lateral)) + (format #t "~1Tcw: #~%" (-> this cw)) + (format #t "~1Tccw: #~%" (-> this ccw)) + (format #t "~1Tstraddle: #~%" (-> this straddle)) + (format #t "~1Tlateral-valid: ~A~%" (-> this lateral-valid)) (label cfg-4) - obj + this ) ;; definition for function los-cw-ccw @@ -2417,7 +2417,7 @@ (if (-> self have-phony-joystick) (set! f28-0 (* 0.05 (-> self phony-joystick-y))) ) - (if (and (-> *camera* being-attacked) (< (- (current-time) (-> *camera* attack-start)) (seconds 0.25))) + (if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25)))) (set! f28-0 0.05) ) (when (logtest? (cam-slave-options-u32 GUN_CAM) (-> self options)) @@ -3331,18 +3331,18 @@ ) ;; definition for method 3 of type cam-stick-bank -(defmethod inspect cam-stick-bank ((obj cam-stick-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-stick-bank ((this cam-stick-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmax-z: (meters ~m)~%" (-> obj max-z)) - (format #t "~1Tmin-z: (meters ~m)~%" (-> obj min-z)) - (format #t "~1Tmax-y: (meters ~m)~%" (-> obj max-y)) - (format #t "~1Tmin-y: (meters ~m)~%" (-> obj min-y)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmax-z: (meters ~m)~%" (-> this max-z)) + (format #t "~1Tmin-z: (meters ~m)~%" (-> this min-z)) + (format #t "~1Tmax-y: (meters ~m)~%" (-> this max-y)) + (format #t "~1Tmin-y: (meters ~m)~%" (-> this min-y)) (label cfg-4) - obj + this ) ;; definition for symbol *CAM_STICK-bank*, type cam-stick-bank @@ -3561,18 +3561,18 @@ ) ;; definition for method 3 of type cam-bike-bank -(defmethod inspect cam-bike-bank ((obj cam-bike-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-bike-bank ((this cam-bike-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmin-z: (meters ~m)~%" (-> obj max-z)) - (format #t "~1Tmax-z: (meters ~m)~%" (-> obj min-z)) - (format #t "~1Tmin-y: (meters ~m)~%" (-> obj max-y)) - (format #t "~1Tmax-y: (meters ~m)~%" (-> obj min-y)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmin-z: (meters ~m)~%" (-> this max-z)) + (format #t "~1Tmax-z: (meters ~m)~%" (-> this min-z)) + (format #t "~1Tmin-y: (meters ~m)~%" (-> this max-y)) + (format #t "~1Tmax-y: (meters ~m)~%" (-> this min-y)) (label cfg-4) - obj + this ) ;; definition for symbol *CAM_BIKE-bank*, type cam-bike-bank diff --git a/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc index b12a655cd6..a683b665e7 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc @@ -20,24 +20,24 @@ ) ;; definition for method 3 of type camera-bank -(defmethod inspect camera-bank ((obj camera-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect camera-bank ((this camera-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcollide-move-rad: ~f~%" (-> obj collide-move-rad)) - (format #t "~1Tjoypad: ~D~%" (-> obj joypad)) - (format #t "~1Tmin-detectable-velocity: ~f~%" (-> obj min-detectable-velocity)) - (format #t "~1Tattack-timeout: ~D~%" (-> obj attack-timeout)) - (format #t "~1Tdefault-string-max-y: (meters ~m)~%" (-> obj default-string-max-y)) - (format #t "~1Tdefault-string-min-y: (meters ~m)~%" (-> obj default-string-min-y)) - (format #t "~1Tdefault-string-max-z: (meters ~m)~%" (-> obj default-string-max-z)) - (format #t "~1Tdefault-string-min-z: (meters ~m)~%" (-> obj default-string-min-z)) - (format #t "~1Tdefault-string-push-z: (meters ~m)~%" (-> obj default-string-push-z)) - (format #t "~1Tdefault-tilt-adjust: (deg ~r)~%" (-> obj default-tilt-adjust)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcollide-move-rad: ~f~%" (-> this collide-move-rad)) + (format #t "~1Tjoypad: ~D~%" (-> this joypad)) + (format #t "~1Tmin-detectable-velocity: ~f~%" (-> this min-detectable-velocity)) + (format #t "~1Tattack-timeout: ~D~%" (-> this attack-timeout)) + (format #t "~1Tdefault-string-max-y: (meters ~m)~%" (-> this default-string-max-y)) + (format #t "~1Tdefault-string-min-y: (meters ~m)~%" (-> this default-string-min-y)) + (format #t "~1Tdefault-string-max-z: (meters ~m)~%" (-> this default-string-max-z)) + (format #t "~1Tdefault-string-min-z: (meters ~m)~%" (-> this default-string-min-z)) + (format #t "~1Tdefault-string-push-z: (meters ~m)~%" (-> this default-string-push-z)) + (format #t "~1Tdefault-tilt-adjust: (deg ~r)~%" (-> this default-tilt-adjust)) (label cfg-4) - obj + this ) ;; definition for symbol *CAMERA-bank*, type camera-bank @@ -71,22 +71,22 @@ ) ;; definition for method 3 of type camera-master-bank -(defmethod inspect camera-master-bank ((obj camera-master-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect camera-master-bank ((this camera-master-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tonscreen-head-height: (meters ~m)~%" (-> obj onscreen-head-height)) - (format #t "~1Tonscreen-foot-height: (meters ~m)~%" (-> obj onscreen-foot-height)) - (format #t "~1Ttarget-height: (meters ~m)~%" (-> obj target-height)) - (format #t "~1Tup-move-to-pitch-ratio-in-air: ~f~%" (-> obj up-move-to-pitch-ratio-in-air)) - (format #t "~1Tdown-move-to-pitch-ratio-in-air: ~f~%" (-> obj down-move-to-pitch-ratio-in-air)) - (format #t "~1Tup-move-to-pitch-on-ground: ~f~%" (-> obj up-move-to-pitch-on-ground)) - (format #t "~1Tdown-move-to-pitch-on-ground: ~f~%" (-> obj down-move-to-pitch-on-ground)) - (format #t "~1Tpitch-off-blend: ~f~%" (-> obj pitch-off-blend)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tonscreen-head-height: (meters ~m)~%" (-> this onscreen-head-height)) + (format #t "~1Tonscreen-foot-height: (meters ~m)~%" (-> this onscreen-foot-height)) + (format #t "~1Ttarget-height: (meters ~m)~%" (-> this target-height)) + (format #t "~1Tup-move-to-pitch-ratio-in-air: ~f~%" (-> this up-move-to-pitch-ratio-in-air)) + (format #t "~1Tdown-move-to-pitch-ratio-in-air: ~f~%" (-> this down-move-to-pitch-ratio-in-air)) + (format #t "~1Tup-move-to-pitch-on-ground: ~f~%" (-> this up-move-to-pitch-on-ground)) + (format #t "~1Tdown-move-to-pitch-on-ground: ~f~%" (-> this down-move-to-pitch-on-ground)) + (format #t "~1Tpitch-off-blend: ~f~%" (-> this pitch-off-blend)) (label cfg-4) - obj + this ) ;; definition for symbol *CAMERA_MASTER-bank*, type camera-master-bank @@ -104,7 +104,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc index bbe69488c8..94447e32d7 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc @@ -16,16 +16,16 @@ ) ;; definition for method 3 of type cam-index -(defmethod inspect cam-index ((obj cam-index)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-index ((this cam-index)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cam-index) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tvec[2] @ #x~X~%" (-> obj vec)) + (format #t "[~8x] ~A~%" this 'cam-index) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tvec[2] @ #x~X~%" (-> this vec)) (label cfg-4) - obj + this ) ;; definition of type tracking-point @@ -42,19 +42,19 @@ ) ;; definition for method 3 of type tracking-point -(defmethod inspect tracking-point ((obj tracking-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect tracking-point ((this tracking-point)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tracking-point) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tdirection: #~%" (-> obj direction)) - (format #t "~1Ttp-length: ~f~%" (-> obj tp-length)) - (format #t "~1Tnext: ~D~%" (-> obj next)) - (format #t "~1Tincarnation: ~D~%" (-> obj incarnation)) + (format #t "[~8x] ~A~%" this 'tracking-point) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tdirection: #~%" (-> this direction)) + (format #t "~1Ttp-length: ~f~%" (-> this tp-length)) + (format #t "~1Tnext: ~D~%" (-> this next)) + (format #t "~1Tincarnation: ~D~%" (-> this incarnation)) (label cfg-4) - obj + this ) ;; definition of type tracking-spline-sampler @@ -68,16 +68,16 @@ ) ;; definition for method 3 of type tracking-spline-sampler -(defmethod inspect tracking-spline-sampler ((obj tracking-spline-sampler)) - (when (not obj) - (set! obj obj) +(defmethod inspect tracking-spline-sampler ((this tracking-spline-sampler)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tracking-spline-sampler) - (format #t "~1Tcur-pt: ~D~%" (-> obj cur-pt)) - (format #t "~1Tpartial-pt: ~f~%" (-> obj partial-pt)) + (format #t "[~8x] ~A~%" this 'tracking-spline-sampler) + (format #t "~1Tcur-pt: ~D~%" (-> this cur-pt)) + (format #t "~1Tpartial-pt: ~f~%" (-> this partial-pt)) (label cfg-4) - obj + this ) ;; definition of type tracking-spline @@ -120,28 +120,28 @@ ) ;; definition for method 3 of type tracking-spline -(defmethod inspect tracking-spline ((obj tracking-spline)) - (when (not obj) - (set! obj obj) +(defmethod inspect tracking-spline ((this tracking-spline)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tracking-spline) - (format #t "~1Tpoint[32] @ #x~X~%" (-> obj point)) - (format #t "~1Tsummed-len: ~f~%" (-> obj summed-len)) - (format #t "~1Tfree-point: ~D~%" (-> obj free-point)) - (format #t "~1Tused-point: ~D~%" (-> obj used-point)) - (format #t "~1Tpartial-point: ~f~%" (-> obj partial-point)) - (format #t "~1Tend-point: ~D~%" (-> obj end-point)) - (format #t "~1Tnext-to-last-point: ~D~%" (-> obj next-to-last-point)) - (format #t "~1Tmax-move: ~f~%" (-> obj max-move)) - (format #t "~1Tsample-len: ~f~%" (-> obj sample-len)) - (format #t "~1Tused-count: ~D~%" (-> obj used-count)) - (format #t "~1Told-position: #~%" (-> obj old-position)) - (format #t "~1Tdebug-old-position: #~%" (-> obj debug-old-position)) - (format #t "~1Tdebug-out-position: #~%" (-> obj debug-out-position)) - (format #t "~1Tdebug-last-point: ~D~%" (-> obj debug-last-point)) + (format #t "[~8x] ~A~%" this 'tracking-spline) + (format #t "~1Tpoint[32] @ #x~X~%" (-> this point)) + (format #t "~1Tsummed-len: ~f~%" (-> this summed-len)) + (format #t "~1Tfree-point: ~D~%" (-> this free-point)) + (format #t "~1Tused-point: ~D~%" (-> this used-point)) + (format #t "~1Tpartial-point: ~f~%" (-> this partial-point)) + (format #t "~1Tend-point: ~D~%" (-> this end-point)) + (format #t "~1Tnext-to-last-point: ~D~%" (-> this next-to-last-point)) + (format #t "~1Tmax-move: ~f~%" (-> this max-move)) + (format #t "~1Tsample-len: ~f~%" (-> this sample-len)) + (format #t "~1Tused-count: ~D~%" (-> this used-count)) + (format #t "~1Told-position: #~%" (-> this old-position)) + (format #t "~1Tdebug-old-position: #~%" (-> this debug-old-position)) + (format #t "~1Tdebug-out-position: #~%" (-> this debug-out-position)) + (format #t "~1Tdebug-last-point: ~D~%" (-> this debug-last-point)) (label cfg-4) - obj + this ) ;; definition of type cam-float-seeker @@ -166,70 +166,70 @@ ) ;; definition for method 3 of type cam-float-seeker -(defmethod inspect cam-float-seeker ((obj cam-float-seeker)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-float-seeker ((this cam-float-seeker)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cam-float-seeker) - (format #t "~1Ttarget: ~f~%" (-> obj target)) - (format #t "~1Tvalue: ~f~%" (-> obj value)) - (format #t "~1Tvel: ~f~%" (-> obj vel)) - (format #t "~1Taccel: ~f~%" (-> obj accel)) - (format #t "~1Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~1Tmax-partial: ~f~%" (-> obj max-partial)) + (format #t "[~8x] ~A~%" this 'cam-float-seeker) + (format #t "~1Ttarget: ~f~%" (-> this target)) + (format #t "~1Tvalue: ~f~%" (-> this value)) + (format #t "~1Tvel: ~f~%" (-> this vel)) + (format #t "~1Taccel: ~f~%" (-> this accel)) + (format #t "~1Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~1Tmax-partial: ~f~%" (-> this max-partial)) (label cfg-4) - obj + this ) ;; definition for method 9 of type cam-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod init cam-float-seeker ((obj cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (set! (-> obj target) arg0) - (set! (-> obj value) arg0) - (set! (-> obj vel) 0.0) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj max-partial) arg3) +(defmethod init cam-float-seeker ((this cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> this target) arg0) + (set! (-> this value) arg0) + (set! (-> this vel) 0.0) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this max-partial) arg3) 0 (none) ) ;; definition for method 10 of type cam-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod copy-to cam-float-seeker ((obj cam-float-seeker) (arg0 cam-float-seeker)) - (set! (-> obj target) (-> arg0 target)) - (set! (-> obj value) (-> arg0 value)) - (set! (-> obj vel) (-> arg0 vel)) - (set! (-> obj accel) (-> arg0 accel)) - (set! (-> obj max-vel) (-> arg0 max-vel)) - (set! (-> obj max-partial) (-> arg0 max-partial)) +(defmethod copy-to cam-float-seeker ((this cam-float-seeker) (arg0 cam-float-seeker)) + (set! (-> this target) (-> arg0 target)) + (set! (-> this value) (-> arg0 value)) + (set! (-> this vel) (-> arg0 vel)) + (set! (-> this accel) (-> arg0 accel)) + (set! (-> this max-vel) (-> arg0 max-vel)) + (set! (-> this max-partial) (-> arg0 max-partial)) 0 (none) ) ;; definition for method 11 of type cam-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod update! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) +(defmethod update! cam-float-seeker ((this cam-float-seeker) (arg0 float)) (with-pp 0.0 0.0 - (let* ((f1-2 (- (+ (-> obj target) arg0) (-> obj value))) - (f0-5 (* (-> obj max-partial) (fabs f1-2))) + (let* ((f1-2 (- (+ (-> this target) arg0) (-> this value))) + (f0-5 (* (-> this max-partial) (fabs f1-2))) ) - (let ((f1-3 (* f1-2 (* (-> obj accel) (-> pp clock time-adjust-ratio))))) - (+! (-> obj vel) f1-3) + (let ((f1-3 (* f1-2 (* (-> this accel) (-> pp clock time-adjust-ratio))))) + (+! (-> this vel) f1-3) ) - (let ((f1-6 (fabs (-> obj vel))) - (f0-6 (fmin f0-5 (-> obj max-vel))) + (let ((f1-6 (fabs (-> this vel))) + (f0-6 (fmin f0-5 (-> this max-vel))) ) (if (< f0-6 f1-6) - (set! (-> obj vel) (* (-> obj vel) (/ f0-6 f1-6))) + (set! (-> this vel) (* (-> this vel) (/ f0-6 f1-6))) ) ) ) - (let ((f0-10 (* (-> obj vel) (-> pp clock time-adjust-ratio)))) - (+! (-> obj value) f0-10) + (let ((f0-10 (* (-> this vel) (-> pp clock time-adjust-ratio)))) + (+! (-> this value) f0-10) ) 0 (none) @@ -237,9 +237,9 @@ ) ;; definition for method 12 of type cam-float-seeker -(defmethod jump-to-target! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) - (set! (-> obj value) (+ (-> obj target) arg0)) - (set! (-> obj vel) 0.0) +(defmethod jump-to-target! cam-float-seeker ((this cam-float-seeker) (arg0 float)) + (set! (-> this value) (+ (-> this target) arg0)) + (set! (-> this vel) 0.0) 0.0 ) @@ -262,72 +262,72 @@ ) ;; definition for method 3 of type cam-vector-seeker -(defmethod inspect cam-vector-seeker ((obj cam-vector-seeker)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-vector-seeker ((this cam-vector-seeker)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cam-vector-seeker) - (format #t "~1Ttarget: #~%" (-> obj target)) - (format #t "~1Tvalue: #~%" (-> obj value)) - (format #t "~1Tvel: #~%" (-> obj vel)) - (format #t "~1Taccel: ~f~%" (-> obj accel)) - (format #t "~1Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~1Tmax-partial: ~f~%" (-> obj max-partial)) + (format #t "[~8x] ~A~%" this 'cam-vector-seeker) + (format #t "~1Ttarget: #~%" (-> this target)) + (format #t "~1Tvalue: #~%" (-> this value)) + (format #t "~1Tvel: #~%" (-> this vel)) + (format #t "~1Taccel: ~f~%" (-> this accel)) + (format #t "~1Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~1Tmax-partial: ~f~%" (-> this max-partial)) (label cfg-4) - obj + this ) ;; definition for method 9 of type cam-vector-seeker ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init cam-vector-seeker ((this cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj value quad) (-> arg0 quad)) + (set! (-> this target quad) (-> arg0 quad)) + (set! (-> this value quad) (-> arg0 quad)) ) (else - (vector-reset! (-> obj target)) - (vector-reset! (-> obj value)) + (vector-reset! (-> this target)) + (vector-reset! (-> this value)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj max-partial) arg3) + (vector-reset! (-> this vel)) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this max-partial) arg3) 0 (none) ) ;; definition for method 10 of type cam-vector-seeker ;; WARN: Return type mismatch int vs none. -(defmethod update! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector)) +(defmethod update! cam-vector-seeker ((this cam-vector-seeker) (arg0 vector)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vector))) 0.0 (cond (arg0 - (vector+! v1-0 (-> obj target) arg0) - (vector-! v1-0 v1-0 (-> obj value)) + (vector+! v1-0 (-> this target) arg0) + (vector-! v1-0 v1-0 (-> this value)) ) (else - (vector-! v1-0 (-> obj target) (-> obj value)) + (vector-! v1-0 (-> this target) (-> this value)) ) ) - (let ((f0-2 (* (-> obj max-partial) (vector-length v1-0)))) - (vector-float*! v1-0 v1-0 (* (-> obj accel) (-> pp clock time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) v1-0) - (let ((f1-3 (vector-length (-> obj vel))) - (f0-3 (fmin f0-2 (-> obj max-vel))) + (let ((f0-2 (* (-> this max-partial) (vector-length v1-0)))) + (vector-float*! v1-0 v1-0 (* (-> this accel) (-> pp clock time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) v1-0) + (let ((f1-3 (vector-length (-> this vel))) + (f0-3 (fmin f0-2 (-> this max-vel))) ) (if (< f0-3 f1-3) - (vector-float*! (-> obj vel) (-> obj vel) (/ f0-3 f1-3)) + (vector-float*! (-> this vel) (-> this vel) (/ f0-3 f1-3)) ) ) ) - (vector-float*! v1-0 (-> obj vel) (-> pp clock time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) v1-0) + (vector-float*! v1-0 (-> this vel) (-> pp clock time-adjust-ratio)) + (vector+! (-> this value) (-> this value) v1-0) ) 0 (none) @@ -355,26 +355,26 @@ ) ;; definition for method 3 of type cam-rotation-tracker -(defmethod inspect cam-rotation-tracker ((obj cam-rotation-tracker)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-rotation-tracker ((this cam-rotation-tracker)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cam-rotation-tracker) - (format #t "~1Tinv-mat: ~`matrix`P~%" (-> obj inv-mat)) - (format #t "~1Tno-follow: ~A~%" (-> obj no-follow)) - (format #t "~1Tfollow-pt: ~`vector`P~%" (-> obj follow-pt)) - (format #t "~1Tfollow-off: ~`vector`P~%" (-> obj follow-off)) - (format #t "~1Tfollow-blend: ~f~%" (-> obj follow-blend)) - (format #t "~1Ttilt-adjust: #~%" (-> obj tilt-adjust)) - (format #t "~1Tpoint-of-interest-blend: #~%" (-> obj point-of-interest-blend)) - (format #t "~1Tunderwater-blend: #~%" (-> obj underwater-blend)) - (format #t "~1Tlooking-at: ~`vector`P~%" (-> obj looking-at)) - (format #t "~1Tlooking-interesting: ~`vector`P~%" (-> obj looking-interesting)) - (format #t "~1Told-cam-trans: ~`vector`P~%" (-> obj old-cam-trans)) - (format #t "~1Tfollow-height-extra: #~%" (-> obj follow-height-extra)) + (format #t "[~8x] ~A~%" this 'cam-rotation-tracker) + (format #t "~1Tinv-mat: ~`matrix`P~%" (-> this inv-mat)) + (format #t "~1Tno-follow: ~A~%" (-> this no-follow)) + (format #t "~1Tfollow-pt: ~`vector`P~%" (-> this follow-pt)) + (format #t "~1Tfollow-off: ~`vector`P~%" (-> this follow-off)) + (format #t "~1Tfollow-blend: ~f~%" (-> this follow-blend)) + (format #t "~1Ttilt-adjust: #~%" (-> this tilt-adjust)) + (format #t "~1Tpoint-of-interest-blend: #~%" (-> this point-of-interest-blend)) + (format #t "~1Tunderwater-blend: #~%" (-> this underwater-blend)) + (format #t "~1Tlooking-at: ~`vector`P~%" (-> this looking-at)) + (format #t "~1Tlooking-interesting: ~`vector`P~%" (-> this looking-interesting)) + (format #t "~1Told-cam-trans: ~`vector`P~%" (-> this old-cam-trans)) + (format #t "~1Tfollow-height-extra: #~%" (-> this follow-height-extra)) (label cfg-4) - obj + this ) ;; definition of type camera-combiner @@ -403,29 +403,29 @@ ) ;; definition for method 3 of type camera-combiner -(defmethod inspect camera-combiner ((obj camera-combiner)) - (when (not obj) - (set! obj obj) +(defmethod inspect camera-combiner ((this camera-combiner)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~2Tinv-camera-rot: ~`matrix`P~%" (-> obj inv-camera-rot)) - (format #t "~2Tfov: ~f~%" (-> obj fov)) - (format #t "~2Tinterp-val: ~f~%" (-> obj interp-val)) - (format #t "~2Tinterp-step: ~f~%" (-> obj interp-step)) - (format #t "~2Tdist-from-src: ~f~%" (-> obj dist-from-src)) - (format #t "~2Tdist-from-dest: ~f~%" (-> obj dist-from-dest)) - (format #t "~2Tflip-control-axis: #~%" (-> obj flip-control-axis)) - (format #t "~2Tvelocity: #~%" (-> obj velocity)) - (format #t "~2Ttracking-status: ~D~%" (-> obj tracking-status)) - (format #t "~2Ttracking-options: ~D~%" (-> obj tracking-options)) - (format #t "~2Ttracking: #~%" (-> obj tracking)) - (format #t "~2Tfast-rot: ~A~%" (-> obj fast-rot)) + (format #t "~2Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~2Tinv-camera-rot: ~`matrix`P~%" (-> this inv-camera-rot)) + (format #t "~2Tfov: ~f~%" (-> this fov)) + (format #t "~2Tinterp-val: ~f~%" (-> this interp-val)) + (format #t "~2Tinterp-step: ~f~%" (-> this interp-step)) + (format #t "~2Tdist-from-src: ~f~%" (-> this dist-from-src)) + (format #t "~2Tdist-from-dest: ~f~%" (-> this dist-from-dest)) + (format #t "~2Tflip-control-axis: #~%" (-> this flip-control-axis)) + (format #t "~2Tvelocity: #~%" (-> this velocity)) + (format #t "~2Ttracking-status: ~D~%" (-> this tracking-status)) + (format #t "~2Ttracking-options: ~D~%" (-> this tracking-options)) + (format #t "~2Ttracking: #~%" (-> this tracking)) + (format #t "~2Tfast-rot: ~A~%" (-> this fast-rot)) (label cfg-4) - obj + this ) ;; definition of type camera-slave @@ -519,71 +519,71 @@ ) ;; definition for method 3 of type camera-slave -(defmethod inspect camera-slave ((obj camera-slave)) - (when (not obj) - (set! obj obj) +(defmethod inspect camera-slave ((this camera-slave)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~2Tfov: ~f~%" (-> obj fov)) - (format #t "~2Tfov0: ~f~%" (-> obj fov0)) - (format #t "~2Tfov1: ~f~%" (-> obj fov1)) - (format #t "~2Tfov-index: #~%" (-> obj fov-index)) - (format #t "~2Ttracking: #~%" (-> obj tracking)) - (format #t "~2Tview-off-param: ~f~%" (-> obj view-off-param)) - (format #t "~2Tview-off: ~`vector`P~%" (-> obj view-off)) - (format #t "~2Tjoystick-saved-view-off: ~`vector`P~%" (-> obj joystick-saved-view-off)) - (format #t "~2Tmin-z-override: ~f~%" (-> obj min-z-override)) - (format #t "~2Tview-flat: ~`vector`P~%" (-> obj view-flat)) - (format #t "~2Tstring-vel-dir: ~D~%" (-> obj string-vel-dir)) - (format #t "~2Tstring-trans: ~`vector`P~%" (-> obj string-trans)) - (format #t "~2Tposition-spline: #~%" (-> obj position-spline)) - (format #t "~2Tpivot-pt: ~`vector`P~%" (-> obj pivot-pt)) - (format #t "~2Tpivot-rad: ~f~%" (-> obj pivot-rad)) - (format #t "~2Tcircular-follow: #~%" (-> obj circular-follow)) - (format #t "~2Tmax-angle-offset: ~f~%" (-> obj max-angle-offset)) - (format #t "~2Tmax-angle-curr: ~f~%" (-> obj max-angle-curr)) - (format #t "~2Toptions: ~D~%" (-> obj options)) - (format #t "~2Tcam-entity: ~A~%" (-> obj cam-entity)) - (format #t "~2Tbutt-timer: ~D~%" (-> obj butt-timer)) - (format #t "~2Tbutt-seek: ~A~%" (-> obj butt-seek)) - (format #t "~2Tbutt-vector: ~`vector`P~%" (-> obj butt-vector)) - (format #t "~2Tvelocity: ~`vector`P~%" (-> obj velocity)) - (format #t "~2Tdesired-pos: ~`vector`P~%" (-> obj desired-pos)) - (format #t "~2Ttime-dist-too-far: ~D~%" (-> obj time-dist-too-far)) - (format #t "~2Tlos-state: ~D~%" (-> obj los-state)) - (format #t "~2Tgood-point: ~`vector`P~%" (-> obj good-point)) - (format #t "~2Tlos-tgt-spline-pt: ~D~%" (-> obj los-tgt-spline-pt)) - (format #t "~2Tlos-tgt-spline-pt-incarnation: ~D~%" (-> obj los-tgt-spline-pt-incarnation)) - (format #t "~2Tlos-last-pos: ~`vector`P~%" (-> obj los-last-pos)) - (format #t "~2Tintro-curve: #~%" (-> obj intro-curve)) - (format #t "~2Tintro-offset: #~%" (-> obj intro-offset)) - (format #t "~2Tintro-t: ~f~%" (-> obj intro-t)) - (format #t "~2Tintro-t-step: ~f~%" (-> obj intro-t-step)) - (format #t "~2Toutro-exit-value: ~f~%" (-> obj outro-exit-value)) - (format #t "~2Tspline-exists: ~A~%" (-> obj spline-exists)) - (format #t "~2Tspline-curve: #~%" (-> obj spline-curve)) - (format #t "~2Tspline-offset: #~%" (-> obj spline-offset)) - (format #t "~2Tindex: #~%" (-> obj index)) - (format #t "~2Tsaved-pt: #~%" (-> obj saved-pt)) - (format #t "~2Tspline-tt: ~f~%" (-> obj spline-tt)) - (format #t "~2Tspline-follow-dist: ~f~%" (-> obj spline-follow-dist)) - (format #t "~2Tenter-has-run: ~A~%" (-> obj enter-has-run)) - (format #t "~2Tblend-from-type: ~D~%" (-> obj blend-from-type)) - (format #t "~2Tblend-to-type: ~D~%" (-> obj blend-to-type)) - (format #t "~2Thave-phony-joystick: ~A~%" (-> obj have-phony-joystick)) - (format #t "~2Tphony-joystick-x: ~f~%" (-> obj phony-joystick-x)) - (format #t "~2Tphony-joystick-y: ~f~%" (-> obj phony-joystick-y)) - (format #t "~2Tstring-min-val: #~%" (-> obj string-min-val)) - (format #t "~2Tstring-max-val: #~%" (-> obj string-max-val)) - (format #t "~2Tstring-val-locked: ~A~%" (-> obj string-val-locked)) - (format #t "~2Trelative-position: #~%" (-> obj relative-position)) - (format #t "~2Tstring-relative: ~A~%" (-> obj string-relative)) + (format #t "~2Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~2Tfov: ~f~%" (-> this fov)) + (format #t "~2Tfov0: ~f~%" (-> this fov0)) + (format #t "~2Tfov1: ~f~%" (-> this fov1)) + (format #t "~2Tfov-index: #~%" (-> this fov-index)) + (format #t "~2Ttracking: #~%" (-> this tracking)) + (format #t "~2Tview-off-param: ~f~%" (-> this view-off-param)) + (format #t "~2Tview-off: ~`vector`P~%" (-> this view-off)) + (format #t "~2Tjoystick-saved-view-off: ~`vector`P~%" (-> this joystick-saved-view-off)) + (format #t "~2Tmin-z-override: ~f~%" (-> this min-z-override)) + (format #t "~2Tview-flat: ~`vector`P~%" (-> this view-flat)) + (format #t "~2Tstring-vel-dir: ~D~%" (-> this string-vel-dir)) + (format #t "~2Tstring-trans: ~`vector`P~%" (-> this string-trans)) + (format #t "~2Tposition-spline: #~%" (-> this position-spline)) + (format #t "~2Tpivot-pt: ~`vector`P~%" (-> this pivot-pt)) + (format #t "~2Tpivot-rad: ~f~%" (-> this pivot-rad)) + (format #t "~2Tcircular-follow: #~%" (-> this circular-follow)) + (format #t "~2Tmax-angle-offset: ~f~%" (-> this max-angle-offset)) + (format #t "~2Tmax-angle-curr: ~f~%" (-> this max-angle-curr)) + (format #t "~2Toptions: ~D~%" (-> this options)) + (format #t "~2Tcam-entity: ~A~%" (-> this cam-entity)) + (format #t "~2Tbutt-timer: ~D~%" (-> this butt-timer)) + (format #t "~2Tbutt-seek: ~A~%" (-> this butt-seek)) + (format #t "~2Tbutt-vector: ~`vector`P~%" (-> this butt-vector)) + (format #t "~2Tvelocity: ~`vector`P~%" (-> this velocity)) + (format #t "~2Tdesired-pos: ~`vector`P~%" (-> this desired-pos)) + (format #t "~2Ttime-dist-too-far: ~D~%" (-> this time-dist-too-far)) + (format #t "~2Tlos-state: ~D~%" (-> this los-state)) + (format #t "~2Tgood-point: ~`vector`P~%" (-> this good-point)) + (format #t "~2Tlos-tgt-spline-pt: ~D~%" (-> this los-tgt-spline-pt)) + (format #t "~2Tlos-tgt-spline-pt-incarnation: ~D~%" (-> this los-tgt-spline-pt-incarnation)) + (format #t "~2Tlos-last-pos: ~`vector`P~%" (-> this los-last-pos)) + (format #t "~2Tintro-curve: #~%" (-> this intro-curve)) + (format #t "~2Tintro-offset: #~%" (-> this intro-offset)) + (format #t "~2Tintro-t: ~f~%" (-> this intro-t)) + (format #t "~2Tintro-t-step: ~f~%" (-> this intro-t-step)) + (format #t "~2Toutro-exit-value: ~f~%" (-> this outro-exit-value)) + (format #t "~2Tspline-exists: ~A~%" (-> this spline-exists)) + (format #t "~2Tspline-curve: #~%" (-> this spline-curve)) + (format #t "~2Tspline-offset: #~%" (-> this spline-offset)) + (format #t "~2Tindex: #~%" (-> this index)) + (format #t "~2Tsaved-pt: #~%" (-> this saved-pt)) + (format #t "~2Tspline-tt: ~f~%" (-> this spline-tt)) + (format #t "~2Tspline-follow-dist: ~f~%" (-> this spline-follow-dist)) + (format #t "~2Tenter-has-run: ~A~%" (-> this enter-has-run)) + (format #t "~2Tblend-from-type: ~D~%" (-> this blend-from-type)) + (format #t "~2Tblend-to-type: ~D~%" (-> this blend-to-type)) + (format #t "~2Thave-phony-joystick: ~A~%" (-> this have-phony-joystick)) + (format #t "~2Tphony-joystick-x: ~f~%" (-> this phony-joystick-x)) + (format #t "~2Tphony-joystick-y: ~f~%" (-> this phony-joystick-y)) + (format #t "~2Tstring-min-val: #~%" (-> this string-min-val)) + (format #t "~2Tstring-max-val: #~%" (-> this string-max-val)) + (format #t "~2Tstring-val-locked: ~A~%" (-> this string-val-locked)) + (format #t "~2Trelative-position: #~%" (-> this relative-position)) + (format #t "~2Tstring-relative: ~A~%" (-> this string-relative)) (label cfg-4) - obj + this ) ;; definition of type camera-master @@ -643,55 +643,55 @@ ) ;; definition for method 3 of type camera-master -(defmethod inspect camera-master ((obj camera-master)) - (when (not obj) - (set! obj obj) +(defmethod inspect camera-master ((this camera-master)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tmaster-options: ~D~%" (-> obj master-options)) - (format #t "~2Tsettings: #~%" (-> obj settings)) - (format #t "~2Tslave: #x~X~%" (-> obj slave)) - (format #t "~2Tdecel: #x~X~%" (-> obj decel)) - (format #t "~2Tslave-options: ~D~%" (-> obj slave-options)) - (format #t "~2Tview-off-param-save: ~f~%" (-> obj view-off-param-save)) - (format #t "~2Tchanger: #x~X~%" (-> obj changer)) - (format #t "~2Tstring-min: #~%" (-> obj string-min)) - (format #t "~2Tstring-max: #~%" (-> obj string-max)) - (format #t "~2Tstring-push-z: ~f~%" (-> obj string-push-z)) - (format #t "~2Tlocal-down: ~`vector`P~%" (-> obj local-down)) - (format #t "~2Tfocus: #~%" (-> obj focus)) - (format #t "~2Tbeing-attacked: ~A~%" (-> obj being-attacked)) - (format #t "~2Tattack-start: ~D~%" (-> obj attack-start)) - (format #t "~2Ton-ground: ~A~%" (-> obj on-ground)) - (format #t "~2Tunder-water: ~D~%" (-> obj under-water)) - (format #t "~2Ton-pole: ~A~%" (-> obj on-pole)) - (format #t "~2Ttgt-rot-mat: ~`matrix`P~%" (-> obj tgt-rot-mat)) - (format #t "~2Ttgt-face-mat: ~`matrix`P~%" (-> obj tgt-face-mat)) - (format #t "~2Ttpos-old: ~`vector`P~%" (-> obj tpos-old)) - (format #t "~2Ttpos-curr: ~`vector`P~%" (-> obj tpos-curr)) - (format #t "~2Ttpos-old-adj: ~`vector`P~%" (-> obj tpos-old-adj)) - (format #t "~2Ttpos-curr-adj: ~`vector`P~%" (-> obj tpos-curr-adj)) - (format #t "~2Ttpos-tgt: ~`vector`P~%" (-> obj tpos-tgt)) - (format #t "~2Tupspeed: ~f~%" (-> obj upspeed)) - (format #t "~2Tpitch-off: ~`vector`P~%" (-> obj pitch-off)) - (format #t "~2Ttarget-spline: #~%" (-> obj target-spline)) - (format #t "~2Tease-from: #~%" (-> obj ease-from)) - (format #t "~2Tease-t: ~f~%" (-> obj ease-t)) - (format #t "~2Tease-step: ~f~%" (-> obj ease-step)) - (format #t "~2Tease-to: #~%" (-> obj ease-to)) - (format #t "~2Toutro-curve: #~%" (-> obj outro-curve)) - (format #t "~2Toutro-t: ~f~%" (-> obj outro-t)) - (format #t "~2Toutro-t-step: ~f~%" (-> obj outro-t-step)) - (format #t "~2Toutro-exit-value: ~f~%" (-> obj outro-exit-value)) - (format #t "~2Twater-drip-time: ~D~%" (-> obj water-drip-time)) - (format #t "~2Twater-drip: ~A~%" (-> obj water-drip)) - (format #t "~2Twater-drip-mult: ~f~%" (-> obj water-drip-mult)) - (format #t "~2Twater-drip-speed: ~f~%" (-> obj water-drip-speed)) + (format #t "~2Tmaster-options: ~D~%" (-> this master-options)) + (format #t "~2Tsettings: #~%" (-> this settings)) + (format #t "~2Tslave: #x~X~%" (-> this slave)) + (format #t "~2Tdecel: #x~X~%" (-> this decel)) + (format #t "~2Tslave-options: ~D~%" (-> this slave-options)) + (format #t "~2Tview-off-param-save: ~f~%" (-> this view-off-param-save)) + (format #t "~2Tchanger: #x~X~%" (-> this changer)) + (format #t "~2Tstring-min: #~%" (-> this string-min)) + (format #t "~2Tstring-max: #~%" (-> this string-max)) + (format #t "~2Tstring-push-z: ~f~%" (-> this string-push-z)) + (format #t "~2Tlocal-down: ~`vector`P~%" (-> this local-down)) + (format #t "~2Tfocus: #~%" (-> this focus)) + (format #t "~2Tbeing-attacked: ~A~%" (-> this being-attacked)) + (format #t "~2Tattack-start: ~D~%" (-> this attack-start)) + (format #t "~2Ton-ground: ~A~%" (-> this on-ground)) + (format #t "~2Tunder-water: ~D~%" (-> this under-water)) + (format #t "~2Ton-pole: ~A~%" (-> this on-pole)) + (format #t "~2Ttgt-rot-mat: ~`matrix`P~%" (-> this tgt-rot-mat)) + (format #t "~2Ttgt-face-mat: ~`matrix`P~%" (-> this tgt-face-mat)) + (format #t "~2Ttpos-old: ~`vector`P~%" (-> this tpos-old)) + (format #t "~2Ttpos-curr: ~`vector`P~%" (-> this tpos-curr)) + (format #t "~2Ttpos-old-adj: ~`vector`P~%" (-> this tpos-old-adj)) + (format #t "~2Ttpos-curr-adj: ~`vector`P~%" (-> this tpos-curr-adj)) + (format #t "~2Ttpos-tgt: ~`vector`P~%" (-> this tpos-tgt)) + (format #t "~2Tupspeed: ~f~%" (-> this upspeed)) + (format #t "~2Tpitch-off: ~`vector`P~%" (-> this pitch-off)) + (format #t "~2Ttarget-spline: #~%" (-> this target-spline)) + (format #t "~2Tease-from: #~%" (-> this ease-from)) + (format #t "~2Tease-t: ~f~%" (-> this ease-t)) + (format #t "~2Tease-step: ~f~%" (-> this ease-step)) + (format #t "~2Tease-to: #~%" (-> this ease-to)) + (format #t "~2Toutro-curve: #~%" (-> this outro-curve)) + (format #t "~2Toutro-t: ~f~%" (-> this outro-t)) + (format #t "~2Toutro-t-step: ~f~%" (-> this outro-t-step)) + (format #t "~2Toutro-exit-value: ~f~%" (-> this outro-exit-value)) + (format #t "~2Twater-drip-time: ~D~%" (-> this water-drip-time)) + (format #t "~2Twater-drip: ~A~%" (-> this water-drip)) + (format #t "~2Twater-drip-mult: ~f~%" (-> this water-drip-mult)) + (format #t "~2Twater-drip-speed: ~f~%" (-> this water-drip-speed)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc index d819870c6d..c18e478475 100644 --- a/test/decompiler/reference/jak2/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/camera_REF.gc @@ -375,10 +375,10 @@ ;; definition for method 9 of type cam-index ;; INFO: Used lq/sq -(defmethod cam-index-method-9 cam-index ((obj cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) +(defmethod cam-index-method-9 cam-index ((this cam-index) (arg0 symbol) (arg1 entity) (arg2 vector) (arg3 curve)) (local-vars (sv-32 (function _varargs_ object))) (format (clear *cam-res-string*) "~S-flags" arg0) - (set! (-> obj flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *cam-res-string*)))) + (set! (-> this flags) (the-as cam-index-options (cam-slave-get-flags arg1 (string->symbol *cam-res-string*)))) (let ((s3-2 (res-lump-data arg1 arg0 pointer)) (s0-1 (method-of-type res-lump get-property-struct)) ) @@ -404,18 +404,18 @@ (s3-2 (cond (v0-8 - (vector+! (the-as vector (-> obj vec)) (the-as vector (&+ s3-2 0)) (the-as vector v0-8)) - (vector+! (-> obj vec 1) (the-as vector (&+ s3-2 16)) (the-as vector v0-8)) + (vector+! (the-as vector (-> this vec)) (the-as vector (&+ s3-2 0)) (the-as vector v0-8)) + (vector+! (-> this vec 1) (the-as vector (&+ s3-2 16)) (the-as vector v0-8)) ) (else - (set! (-> obj vec 0 quad) (-> (the-as (pointer uint128) (&+ s3-2 0)))) - (set! (-> obj vec 1 quad) (-> (the-as (pointer uint128) (&+ s3-2 16)))) + (set! (-> this vec 0 quad) (-> (the-as (pointer uint128) (&+ s3-2 0)))) + (set! (-> this vec 1 quad) (-> (the-as (pointer uint128) (&+ s3-2 16)))) ) ) ) (arg3 - (set! (-> obj vec 0 quad) (-> arg3 cverts 0 quad)) - (set! (-> obj vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) + (set! (-> this vec 0 quad) (-> arg3 cverts 0 quad)) + (set! (-> this vec 1 quad) (-> arg3 cverts (+ (-> arg3 num-cverts) -1) quad)) ) (else (return #f) @@ -426,25 +426,25 @@ (let ((v1-11 (new-stack-vector0))) 0.0 (cond - ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) - (vector-! v1-11 (-> obj vec 1) arg2) - (set! (-> obj vec 1 w) (vector-length v1-11)) - (vector-! v1-11 (the-as vector (-> obj vec)) arg2) - (set! (-> obj vec 1 x) (vector-length v1-11)) - (set! (-> obj vec 1 w) (- (-> obj vec 1 w) (-> obj vec 1 x))) - (set! (-> obj vec 0 quad) (-> arg2 quad)) + ((logtest? (-> this flags) (cam-index-options SPHERICAL)) + (vector-! v1-11 (-> this vec 1) arg2) + (set! (-> this vec 1 w) (vector-length v1-11)) + (vector-! v1-11 (the-as vector (-> this vec)) arg2) + (set! (-> this vec 1 x) (vector-length v1-11)) + (set! (-> this vec 1 w) (- (-> this vec 1 w) (-> this vec 1 x))) + (set! (-> this vec 0 quad) (-> arg2 quad)) ) - ((logtest? (-> obj flags) (cam-index-options RADIAL)) - (vector-! v1-11 (-> obj vec 1) arg2) - (set! (-> obj vec 1 w) (vector-length v1-11)) - (vector-! v1-11 (the-as vector (-> obj vec)) arg2) - (set! (-> obj vec 1 x) (vector-length v1-11)) - (set! (-> obj vec 1 w) (- (-> obj vec 1 w) (-> obj vec 1 x))) - (set! (-> obj vec 0 quad) (-> arg2 quad)) + ((logtest? (-> this flags) (cam-index-options RADIAL)) + (vector-! v1-11 (-> this vec 1) arg2) + (set! (-> this vec 1 w) (vector-length v1-11)) + (vector-! v1-11 (the-as vector (-> this vec)) arg2) + (set! (-> this vec 1 x) (vector-length v1-11)) + (set! (-> this vec 1 w) (- (-> this vec 1 w) (-> this vec 1 x))) + (set! (-> this vec 0 quad) (-> arg2 quad)) ) (else - (vector-! (-> obj vec 1) (-> obj vec 1) (the-as vector (-> obj vec))) - (set! (-> obj vec 1 w) (vector-normalize-ret-len! (-> obj vec 1) 1.0)) + (vector-! (-> this vec 1) (-> this vec 1) (the-as vector (-> this vec))) + (set! (-> this vec 1 w) (vector-normalize-ret-len! (-> this vec 1) 1.0)) ) ) ) @@ -453,20 +453,20 @@ ;; definition for method 10 of type cam-index ;; INFO: Used lq/sq -(defmethod cam-index-method-10 cam-index ((obj cam-index) (arg0 vector)) +(defmethod cam-index-method-10 cam-index ((this cam-index) (arg0 vector)) (let ((s5-0 (new-stack-vector0))) 0.0 - (vector-! s5-0 arg0 (the-as vector (-> obj vec))) + (vector-! s5-0 arg0 (the-as vector (-> this vec))) (cond - ((logtest? (-> obj flags) (cam-index-options SPHERICAL)) + ((logtest? (-> this flags) (cam-index-options SPHERICAL)) (vector-flatten! s5-0 s5-0 (-> *camera* local-down)) - (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) + (/ (- (vector-length s5-0) (-> this vec 1 x)) (-> this vec 1 w)) ) - ((logtest? (-> obj flags) (cam-index-options RADIAL)) - (/ (- (vector-length s5-0) (-> obj vec 1 x)) (-> obj vec 1 w)) + ((logtest? (-> this flags) (cam-index-options RADIAL)) + (/ (- (vector-length s5-0) (-> this vec 1 x)) (-> this vec 1 w)) ) (else - (/ (vector-dot s5-0 (-> obj vec 1)) (-> obj vec 1 w)) + (/ (vector-dot s5-0 (-> this vec 1)) (-> this vec 1 w)) ) ) ) @@ -475,25 +475,25 @@ ;; definition for method 10 of type tracking-spline ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-10 tracking-spline ((obj tracking-spline) (arg0 vector)) - (set! (-> obj point 0 position quad) (-> arg0 quad)) - (set! (-> obj point 0 next) -134250495) - (set! (-> obj summed-len) 0.0) - (set! (-> obj free-point) 1) - (set! (-> obj used-point) 0) - (set! (-> obj partial-point) 0.0) - (set! (-> obj end-point) 0) - (set! (-> obj next-to-last-point) -134250495) - (set! (-> obj max-move) 0.0) - (set! (-> obj sample-len) 0.0) - (set! (-> obj used-count) 1) - (set! (-> obj old-position quad) (-> arg0 quad)) +(defmethod tracking-spline-method-10 tracking-spline ((this tracking-spline) (arg0 vector)) + (set! (-> this point 0 position quad) (-> arg0 quad)) + (set! (-> this point 0 next) -134250495) + (set! (-> this summed-len) 0.0) + (set! (-> this free-point) 1) + (set! (-> this used-point) 0) + (set! (-> this partial-point) 0.0) + (set! (-> this end-point) 0) + (set! (-> this next-to-last-point) -134250495) + (set! (-> this max-move) 0.0) + (set! (-> this sample-len) 0.0) + (set! (-> this used-count) 1) + (set! (-> this old-position quad) (-> arg0 quad)) (let ((v1-6 1)) (while (!= v1-6 31) - (set! (-> obj point v1-6 next) (+ v1-6 1)) + (set! (-> this point v1-6 next) (+ v1-6 1)) (+! v1-6 1) ) - (set! (-> obj point v1-6 next) -134250495) + (set! (-> this point v1-6 next) -134250495) ) 0 (none) @@ -501,32 +501,32 @@ ;; definition for method 13 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-13 tracking-spline ((obj tracking-spline) (arg0 int)) - (let ((v1-3 (-> obj point arg0 next))) +(defmethod tracking-spline-method-13 tracking-spline ((this tracking-spline) (arg0 int)) + (let ((v1-3 (-> this point arg0 next))) (cond ((= v1-3 -134250495) ) - ((= (-> obj point v1-3 next) -134250495) + ((= (-> this point v1-3 next) -134250495) ) (else - (set! (-> obj point arg0 next) (-> obj point v1-3 next)) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-3 tp-length))) - (set! (-> obj point v1-3 next) (-> obj free-point)) - (set! (-> obj free-point) v1-3) - (+! (-> obj point v1-3 incarnation) 1) - (let ((v1-11 (-> obj point arg0 next))) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point arg0 tp-length))) + (set! (-> this point arg0 next) (-> this point v1-3 next)) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-3 tp-length))) + (set! (-> this point v1-3 next) (-> this free-point)) + (set! (-> this free-point) v1-3) + (+! (-> this point v1-3 incarnation) 1) + (let ((v1-11 (-> this point arg0 next))) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point arg0 tp-length))) (vector-! - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 arg0))) - (the-as vector (-> obj point v1-11)) - (the-as vector (-> obj point arg0)) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 arg0))) + (the-as vector (-> this point v1-11)) + (the-as vector (-> this point arg0)) ) ) - (set! (-> obj point arg0 tp-length) - (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 arg0))) 1.0) + (set! (-> this point arg0 tp-length) + (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 arg0))) 1.0) ) - (+! (-> obj summed-len) (-> obj point arg0 tp-length)) - (+! (-> obj used-count) -1) + (+! (-> this summed-len) (-> this point arg0 tp-length)) + (+! (-> this used-count) -1) ) ) ) @@ -536,35 +536,37 @@ ;; definition for method 14 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-14 tracking-spline ((obj tracking-spline) (arg0 tracking-spline-sampler)) - (let ((v1-0 (-> obj used-point))) - (set! (-> obj partial-point) (-> arg0 partial-pt)) - (when (= (-> obj next-to-last-point) v1-0) - (set! (-> obj summed-len) (-> obj point v1-0 tp-length)) - (if (= (-> arg0 cur-pt) (-> obj end-point)) - (set! (-> obj partial-point) 0.99999) +(defmethod tracking-spline-method-14 tracking-spline ((this tracking-spline) (arg0 tracking-spline-sampler)) + (let ((v1-0 (-> this used-point))) + (set! (-> this partial-point) (-> arg0 partial-pt)) + (when (= (-> this next-to-last-point) v1-0) + (set! (-> this summed-len) (-> this point v1-0 tp-length)) + (if (= (-> arg0 cur-pt) (-> this end-point)) + (set! (-> this partial-point) 0.99999) ) ) (when (!= (-> arg0 cur-pt) v1-0) - (while (and (!= (-> obj point v1-0 next) (-> arg0 cur-pt)) (!= (-> obj point v1-0 next) (-> obj next-to-last-point))) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-0 tp-length))) - (+! (-> obj point v1-0 incarnation) 1) - (+! (-> obj used-count) -1) - (set! v1-0 (-> obj point v1-0 next)) + (while (and (!= (-> this point v1-0 next) (-> arg0 cur-pt)) + (!= (-> this point v1-0 next) (-> this next-to-last-point)) + ) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-0 tp-length))) + (+! (-> this point v1-0 incarnation) 1) + (+! (-> this used-count) -1) + (set! v1-0 (-> this point v1-0 next)) ) - (set! (-> obj summed-len) (- (-> obj summed-len) (-> obj point v1-0 tp-length))) - (+! (-> obj point v1-0 incarnation) 1) - (+! (-> obj used-count) -1) - (set! (-> obj point v1-0 next) (-> obj free-point)) - (set! (-> obj free-point) (-> obj used-point)) - (set! (-> obj used-point) (-> arg0 cur-pt)) + (set! (-> this summed-len) (- (-> this summed-len) (-> this point v1-0 tp-length))) + (+! (-> this point v1-0 incarnation) 1) + (+! (-> this used-count) -1) + (set! (-> this point v1-0 next) (-> this free-point)) + (set! (-> this free-point) (-> this used-point)) + (set! (-> this used-point) (-> arg0 cur-pt)) (cond - ((= (-> arg0 cur-pt) (-> obj end-point)) - (set! (-> obj partial-point) 0.0) - (set! (-> obj summed-len) 0.0) + ((= (-> arg0 cur-pt) (-> this end-point)) + (set! (-> this partial-point) 0.0) + (set! (-> this summed-len) 0.0) ) - ((= (-> arg0 cur-pt) (-> obj next-to-last-point)) - (set! (-> obj summed-len) (-> obj point (-> obj next-to-last-point) tp-length)) + ((= (-> arg0 cur-pt) (-> this next-to-last-point)) + (set! (-> this summed-len) (-> this point (-> this next-to-last-point) tp-length)) ) ) ) @@ -575,30 +577,30 @@ ;; definition for method 15 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-15 tracking-spline ((obj tracking-spline)) +(defmethod tracking-spline-method-15 tracking-spline ((this tracking-spline)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 cur-pt) (-> obj used-point)) - (set! (-> s5-0 partial-pt) (-> obj partial-point)) - (tracking-spline-method-19 obj (-> obj sample-len) a2-0 s5-0) + (set! (-> s5-0 cur-pt) (-> this used-point)) + (set! (-> s5-0 partial-pt) (-> this partial-point)) + (tracking-spline-method-19 this (-> this sample-len) a2-0 s5-0) ) - (if (or (= (-> s5-0 cur-pt) (-> obj end-point)) - (= (-> s5-0 cur-pt) (-> obj next-to-last-point)) - (= (-> obj point (-> s5-0 cur-pt) next) (-> obj next-to-last-point)) + (if (or (= (-> s5-0 cur-pt) (-> this end-point)) + (= (-> s5-0 cur-pt) (-> this next-to-last-point)) + (= (-> this point (-> s5-0 cur-pt) next) (-> this next-to-last-point)) ) - (set! (-> s5-0 cur-pt) (-> obj used-point)) + (set! (-> s5-0 cur-pt) (-> this used-point)) ) - (let ((v1-15 (-> obj point (-> s5-0 cur-pt) next))) + (let ((v1-15 (-> this point (-> s5-0 cur-pt) next))) (when (!= v1-15 -134250495) - (let ((a0-14 (-> obj point v1-15 next)) + (let ((a0-14 (-> this point v1-15 next)) (a1-1 v1-15) (f0-2 -2.0) ) 0.0 - (while (not (or (= a0-14 -134250495) (= a0-14 (-> obj end-point)))) + (while (not (or (= a0-14 -134250495) (= a0-14 (-> this end-point)))) (let ((f1-2 (vector-dot - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 v1-15))) - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 a0-14))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-15))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 a0-14))) ) ) ) @@ -608,10 +610,10 @@ ) ) (set! v1-15 a0-14) - (set! a0-14 (-> obj point v1-15 next)) + (set! a0-14 (-> this point v1-15 next)) ) (if (< -2.0 f0-2) - (tracking-spline-method-13 obj a1-1) + (tracking-spline-method-13 this a1-1) ) ) ) @@ -623,35 +625,35 @@ ;; definition for method 16 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-16 tracking-spline ((obj tracking-spline) (arg0 float)) +(defmethod tracking-spline-method-16 tracking-spline ((this tracking-spline) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 cur-pt) (-> obj used-point)) - (set! (-> s4-0 partial-pt) (-> obj partial-point)) - (tracking-spline-method-19 obj (-> obj sample-len) a2-0 s4-0) + (set! (-> s4-0 cur-pt) (-> this used-point)) + (set! (-> s4-0 partial-pt) (-> this partial-point)) + (tracking-spline-method-19 this (-> this sample-len) a2-0 s4-0) ) - (let ((s4-1 (-> obj point (-> s4-0 cur-pt) next))) + (let ((s4-1 (-> this point (-> s4-0 cur-pt) next))) (when (!= s4-1 -134250495) - (let ((v1-11 (-> obj point s4-1 next))) + (let ((v1-11 (-> this point s4-1 next))) (while (not (or (= v1-11 -134250495) - (= (-> obj point v1-11 next) -134250495) - (= (-> obj point v1-11 next) (-> obj end-point)) - (= (-> obj point v1-11 next) (-> obj next-to-last-point)) + (= (-> this point v1-11 next) -134250495) + (= (-> this point v1-11 next) (-> this end-point)) + (= (-> this point v1-11 next) (-> this next-to-last-point)) ) ) - (if (< (* (-> obj point s4-1 tp-length) + (if (< (* (-> this point s4-1 tp-length) (+ 1.0 (vector-dot - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s4-1))) - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 v1-11))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s4-1))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-11))) ) ) ) arg0 ) - (tracking-spline-method-13 obj s4-1) + (tracking-spline-method-13 this s4-1) (set! s4-1 v1-11) ) - (set! v1-11 (-> obj point s4-1 next)) + (set! v1-11 (-> this point s4-1 next)) ) ) ) @@ -663,40 +665,40 @@ ;; definition for method 17 of type tracking-spline ;; INFO: Used lq/sq -(defmethod tracking-spline-method-17 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) - (let ((s3-0 (-> obj free-point)) - (s2-0 (-> obj end-point)) +(defmethod tracking-spline-method-17 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 symbol)) + (let ((s3-0 (-> this free-point)) + (s2-0 (-> this end-point)) ) (vector-! - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s2-0))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s2-0))) arg0 - (the-as vector (-> obj point s2-0)) + (the-as vector (-> this point s2-0)) ) - (set! (-> obj point s2-0 tp-length) - (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s2-0))) 1.0) + (set! (-> this point s2-0 tp-length) + (vector-normalize-ret-len! (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s2-0))) 1.0) ) - (if (< (-> obj point s2-0 tp-length) arg1) + (if (< (-> this point s2-0 tp-length) arg1) (return 0) ) (when (and arg3 (= s3-0 -134250495)) - (tracking-spline-method-15 obj) - (set! s3-0 (-> obj free-point)) + (tracking-spline-method-15 this) + (set! s3-0 (-> this free-point)) ) (cond ((= s3-0 -134250495) (format 0 "ERROR : pos spline overflow~%") ) (else - (+! (-> obj summed-len) (-> obj point s2-0 tp-length)) - (set! (-> obj free-point) (-> obj point s3-0 next)) - (set! (-> obj point s2-0 next) s3-0) - (set! (-> obj end-point) s3-0) - (set! (-> obj next-to-last-point) s2-0) - (set! (-> obj point s3-0 next) -134250495) - (set! (-> obj point s3-0 position quad) (-> arg0 quad)) - (+! (-> obj used-count) 1) + (+! (-> this summed-len) (-> this point s2-0 tp-length)) + (set! (-> this free-point) (-> this point s3-0 next)) + (set! (-> this point s2-0 next) s3-0) + (set! (-> this end-point) s3-0) + (set! (-> this next-to-last-point) s2-0) + (set! (-> this point s3-0 next) -134250495) + (set! (-> this point s3-0 position quad) (-> arg0 quad)) + (+! (-> this used-count) 1) (if (< 0.0 arg2) - (tracking-spline-method-16 obj arg2) + (tracking-spline-method-16 this arg2) ) ) ) @@ -706,29 +708,29 @@ ;; definition for method 18 of type tracking-spline ;; WARN: new jak 2 until loop case, check carefully -(defmethod tracking-spline-method-18 tracking-spline ((obj tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-18 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (local-vars (f0-4 float)) (when (not arg2) (set! arg2 (new 'stack-no-clear 'tracking-spline-sampler)) - (set! (-> arg2 cur-pt) (-> obj used-point)) - (set! (-> arg2 partial-pt) (-> obj partial-point)) + (set! (-> arg2 cur-pt) (-> this used-point)) + (set! (-> arg2 partial-pt) (-> this partial-point)) ) 0.0 (until #f (cond - ((= (-> arg2 cur-pt) (-> obj end-point)) + ((= (-> arg2 cur-pt) (-> this end-point)) (set! (-> arg2 partial-pt) 0.0) - (vector+! arg1 arg1 (the-as vector (-> obj point (-> arg2 cur-pt)))) + (vector+! arg1 arg1 (the-as vector (-> this point (-> arg2 cur-pt)))) (return arg1) ) - ((begin (set! f0-4 (+ (-> arg2 partial-pt) (/ arg0 (-> obj point (-> arg2 cur-pt) tp-length)))) (< f0-4 1.0)) + ((begin (set! f0-4 (+ (-> arg2 partial-pt) (/ arg0 (-> this point (-> arg2 cur-pt) tp-length)))) (< f0-4 1.0)) (set! (-> arg2 partial-pt) f0-4) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) - (let ((a2-5 (-> obj point (-> arg2 cur-pt) next))) + (let ((a2-5 (-> this point (-> arg2 cur-pt) next))) (vector-lerp! (the-as vector s5-0) - (the-as vector (-> obj point (-> arg2 cur-pt))) - (the-as vector (-> obj point a2-5)) + (the-as vector (-> this point (-> arg2 cur-pt))) + (the-as vector (-> this point a2-5)) f0-4 ) ) @@ -737,11 +739,11 @@ (return arg1) ) (else - (let ((f0-7 (* (- 1.0 (-> arg2 partial-pt)) (-> obj point (-> arg2 cur-pt) tp-length)))) + (let ((f0-7 (* (- 1.0 (-> arg2 partial-pt)) (-> this point (-> arg2 cur-pt) tp-length)))) (set! arg0 (- arg0 f0-7)) ) (set! (-> arg2 partial-pt) 0.0) - (set! (-> arg2 cur-pt) (-> obj point (-> arg2 cur-pt) next)) + (set! (-> arg2 cur-pt) (-> this point (-> arg2 cur-pt) next)) ) ) ) @@ -750,20 +752,20 @@ ) ;; definition for method 19 of type tracking-spline -(defmethod tracking-spline-method-19 tracking-spline ((obj tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) +(defmethod tracking-spline-method-19 tracking-spline ((this tracking-spline) (arg0 float) (arg1 vector) (arg2 tracking-spline-sampler)) (vector-reset! arg1) - (tracking-spline-method-18 obj arg0 arg1 arg2) + (tracking-spline-method-18 this arg0 arg1 arg2) arg1 ) ;; definition for method 20 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-20 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 int)) +(defmethod tracking-spline-method-20 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 int)) (let ((s3-0 (new 'stack-no-clear 'vector))) (vector-! s3-0 - (the-as vector (-> obj point (-> obj used-point))) - (the-as vector (-> obj point (-> obj end-point))) + (the-as vector (-> this point (-> this used-point))) + (the-as vector (-> this point (-> this end-point))) ) (let* ((f0-0 (vector-length s3-0)) (f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0)))) @@ -772,9 +774,9 @@ (let* ((f1-2 (fmax 0.0 f1-1)) (f30-0 (+ 0.3 f1-2)) (f0-1 (cond - ((< (-> *CAMERA-bank* min-detectable-velocity) (-> obj summed-len)) + ((< (-> *CAMERA-bank* min-detectable-velocity) (-> this summed-len)) (vector-float*! s3-0 s3-0 (/ 1.0 f0-0)) - (/ f0-0 (-> obj summed-len)) + (/ f0-0 (-> this summed-len)) ) (else (vector-reset! s3-0) @@ -785,15 +787,15 @@ (f0-2 (+ -0.2 f0-1)) (f0-3 (* 2.0 f0-2)) (f28-0 (fmin 1.0 (fmax 0.05 f0-3))) - (v1-18 (-> obj used-point)) + (v1-18 (-> this used-point)) (s2-0 (new 'stack-no-clear 'vector)) ) - (while (and (!= v1-18 (-> obj end-point)) (!= v1-18 (-> obj next-to-last-point)) (!= v1-18 arg1)) - (let ((s1-0 (-> obj point v1-18 next))) + (while (and (!= v1-18 (-> this end-point)) (!= v1-18 (-> this next-to-last-point)) (!= v1-18 arg1)) + (let ((s1-0 (-> this point v1-18 next))) (vector-! s2-0 - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s1-0))) - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 v1-18))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 s1-0))) + (the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-18))) ) (let* ((f0-5 (vector-normalize-ret-len! s2-0 1.0)) (f0-6 (* 0.5 f0-5)) @@ -812,7 +814,7 @@ ((< f26-0 0.0) (if (and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (the-as vector (-> obj point s1-0)) + (the-as vector (-> this point s1-0)) s2-0 (* -40.96 f26-0) (new 'static 'vector4w :x #xff :y #xff :w #x80) @@ -822,7 +824,7 @@ ) ((and *debug-segment* *display-camera-marks*) (camera-line-rel-len - (the-as vector (-> obj point s1-0)) + (the-as vector (-> this point s1-0)) s2-0 (* 40.96 f26-0) (new 'static 'vector4w :x #x80 :y #x80 :w #x80) @@ -842,66 +844,66 @@ ;; definition for method 21 of type tracking-spline ;; INFO: Used lq/sq -(defmethod tracking-spline-method-21 tracking-spline ((obj tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod tracking-spline-method-21 tracking-spline ((this tracking-spline) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (with-pp - (let ((v1-0 (-> obj used-point)) - (f0-0 (-> obj partial-point)) + (let ((v1-0 (-> this used-point)) + (f0-0 (-> this partial-point)) ) - (let ((f1-0 (-> obj summed-len))) + (let ((f1-0 (-> this summed-len))) 0.0 0.0 - (let* ((f2-5 (* (- f1-0 (* f0-0 (-> obj point v1-0 tp-length))) arg3)) - (f2-8 (* (fmin arg1 (- f2-5 (-> obj max-move))) (-> pp clock time-adjust-ratio))) + (let* ((f2-5 (* (- f1-0 (* f0-0 (-> this point v1-0 tp-length))) arg3)) + (f2-8 (* (fmin arg1 (- f2-5 (-> this max-move))) (-> pp clock time-adjust-ratio))) ) - (set! (-> obj max-move) (fmin arg2 (+ (-> obj max-move) f2-8))) + (set! (-> this max-move) (fmin arg2 (+ (-> this max-move) f2-8))) ) ) - (set! (-> obj max-move) (fmax 0.4096 (-> obj max-move))) - (let ((f1-8 (-> obj summed-len))) + (set! (-> this max-move) (fmax 0.4096 (-> this max-move))) + (let ((f1-8 (-> this summed-len))) 0.0 - (let* ((f1-9 (- f1-8 (* f0-0 (-> obj point v1-0 tp-length)))) - (f1-11 (fmin 204.8 (- f1-9 (-> obj sample-len)))) + (let* ((f1-9 (- f1-8 (* f0-0 (-> this point v1-0 tp-length)))) + (f1-11 (fmin 204.8 (- f1-9 (-> this sample-len)))) ) - (set! (-> obj sample-len) (fmin 16384.0 (+ (-> obj sample-len) f1-11))) + (set! (-> this sample-len) (fmin 16384.0 (+ (-> this sample-len) f1-11))) ) ) (let ((s4-0 (new 'stack-no-clear 'tracking-spline-sampler))) (set! (-> s4-0 cur-pt) v1-0) (set! (-> s4-0 partial-pt) f0-0) - (tracking-spline-method-19 obj (* (-> obj max-move) (-> pp clock time-adjust-ratio)) arg0 s4-0) - (tracking-spline-method-14 obj s4-0) + (tracking-spline-method-19 this (* (-> this max-move) (-> pp clock time-adjust-ratio)) arg0 s4-0) + (tracking-spline-method-14 this s4-0) (dotimes (s3-0 63) - (tracking-spline-method-18 obj (* 0.015625 (-> obj sample-len)) arg0 s4-0) + (tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 s4-0) ) (vector-float*! arg0 arg0 0.015625) (let ((a2-3 (-> s4-0 cur-pt))) - (set! (-> obj debug-last-point) a2-3) + (set! (-> this debug-last-point) a2-3) (let ((s4-1 (new 'stack-no-clear 'vector))) - (set! (-> obj debug-old-position quad) (-> obj old-position quad)) - (set! (-> obj debug-out-position quad) (-> arg0 quad)) - (vector-! s4-1 arg0 (-> obj old-position)) - (tracking-spline-method-20 obj s4-1 a2-3) - (vector+! arg0 (-> obj old-position) s4-1) + (set! (-> this debug-old-position quad) (-> this old-position quad)) + (set! (-> this debug-out-position quad) (-> arg0 quad)) + (vector-! s4-1 arg0 (-> this old-position)) + (tracking-spline-method-20 this s4-1 a2-3) + (vector+! arg0 (-> this old-position) s4-1) ) ) ) ) - (set! (-> obj old-position quad) (-> arg0 quad)) + (set! (-> this old-position quad) (-> arg0 quad)) arg0 ) ) ;; definition for method 22 of type tracking-spline ;; WARN: Return type mismatch int vs symbol. -(defmethod tracking-spline-method-22 tracking-spline ((obj tracking-spline) (arg0 float)) - (when (< arg0 (-> obj summed-len)) +(defmethod tracking-spline-method-22 tracking-spline ((this tracking-spline) (arg0 float)) + (when (< arg0 (-> this summed-len)) (let ((s5-0 (new 'stack-no-clear 'tracking-spline-sampler))) (let ((a2-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 cur-pt) (-> obj used-point)) + (set! (-> s5-0 cur-pt) (-> this used-point)) (set! (-> s5-0 partial-pt) 0.0) - (tracking-spline-method-19 obj (- (-> obj summed-len) arg0) a2-0 s5-0) + (tracking-spline-method-19 this (- (-> this summed-len) arg0) a2-0 s5-0) ) - (tracking-spline-method-14 obj s5-0) + (tracking-spline-method-14 this s5-0) ) ) (the-as symbol 0) @@ -909,38 +911,38 @@ ;; definition for method 9 of type tracking-spline ;; WARN: Return type mismatch int vs none. -(defmethod tracking-spline-method-9 tracking-spline ((obj tracking-spline)) - (let ((v1-0 (-> obj used-point)) +(defmethod tracking-spline-method-9 tracking-spline ((this tracking-spline)) + (let ((v1-0 (-> this used-point)) (s4-0 0) (s5-0 0) ) (while (!= v1-0 -134250495) (set! s5-0 (logior s5-0 (ash 1 v1-0))) (+! s4-0 1) - (set! v1-0 (-> obj point v1-0 next)) + (set! v1-0 (-> this point v1-0 next)) ) - (when (!= s4-0 (-> obj used-count)) + (when (!= s4-0 (-> this used-count)) (if *debug-segment* - (format 0 "ERROR: tracking spline used count ~D actual ~D~%" (-> obj used-count) s4-0) + (format 0 "ERROR: tracking spline used count ~D actual ~D~%" (-> this used-count) s4-0) ) - (set! (-> obj used-count) s4-0) + (set! (-> this used-count) s4-0) ) - (let ((v1-9 (-> obj free-point)) + (let ((v1-9 (-> this free-point)) (a3-1 0) ) (while (!= v1-9 -134250495) (+! a3-1 1) - (set! v1-9 (-> obj point v1-9 next)) + (set! v1-9 (-> this point v1-9 next)) ) - (when (!= a3-1 (- 32 (-> obj used-count))) + (when (!= a3-1 (- 32 (-> this used-count))) (if *debug-segment* - (format 0 "ERROR: tracking spline free count ~D actual ~D~%" (- 32 (-> obj used-count)) a3-1) + (format 0 "ERROR: tracking spline free count ~D actual ~D~%" (- 32 (-> this used-count)) a3-1) ) - (set! (-> obj free-point) -134250495) + (set! (-> this free-point) -134250495) (dotimes (v1-21 32) (when (not (logtest? s5-0 1)) - (set! (-> obj point v1-21 next) (-> obj free-point)) - (set! (-> obj free-point) v1-21) + (set! (-> this point v1-21 next) (-> this free-point)) + (set! (-> this free-point) v1-21) ) (set! s5-0 (shr s5-0 1)) ) @@ -1061,9 +1063,6 @@ ) ;; definition for function cam-standard-event-handler -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 6] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 23] (defbehavior cam-standard-event-handler camera-slave ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('go) @@ -1203,6 +1202,8 @@ ;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 144 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 144 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 (defun cam-calc-follow! ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 symbol)) (local-vars (sv-128 (function float float float float)) (sv-144 float) (sv-160 float)) (with-pp diff --git a/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc index 8a8e29218e..8622f18a6b 100644 --- a/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc @@ -31,24 +31,24 @@ ) ;; definition for method 3 of type pov-camera -(defmethod inspect pov-camera ((obj pov-camera)) - (when (not obj) - (set! obj obj) +(defmethod inspect pov-camera ((this pov-camera)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tdebounce-start-time: ~D~%" (-> obj debounce-start-time)) - (format #t "~2Tnotify-handle: ~D~%" (-> obj notify-handle)) - (format #t "~2Tanim-name: ~A~%" (-> obj anim-name)) - (format #t "~2Tcommand-list: ~A~%" (-> obj command-list)) - (format #t "~2Tmask-to-clear: ~D~%" (-> obj mask-to-clear)) - (format #t "~2Tmusic-volume-movie: ~f~%" (-> obj music-volume-movie)) - (format #t "~2Tsfx-volume-movie: ~f~%" (-> obj sfx-volume-movie)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tdebounce-start-time: ~D~%" (-> this debounce-start-time)) + (format #t "~2Tnotify-handle: ~D~%" (-> this notify-handle)) + (format #t "~2Tanim-name: ~A~%" (-> this anim-name)) + (format #t "~2Tcommand-list: ~A~%" (-> this command-list)) + (format #t "~2Tmask-to-clear: ~D~%" (-> this mask-to-clear)) + (format #t "~2Tmusic-volume-movie: ~f~%" (-> this music-volume-movie)) + (format #t "~2Tsfx-volume-movie: ~f~%" (-> this sfx-volume-movie)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc index c302f62c28..b480310ebb 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type collide-puss-sphere -(defmethod inspect collide-puss-sphere ((obj collide-puss-sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-puss-sphere ((this collide-puss-sphere)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-puss-sphere) - (format #t "~1Tbsphere: #~%" (-> obj bsphere)) - (format #t "~1Tbbox4w: #~%" (-> obj bbox4w)) + (format #t "[~8x] ~A~%" this 'collide-puss-sphere) + (format #t "~1Tbsphere: #~%" (-> this bsphere)) + (format #t "~1Tbbox4w: #~%" (-> this bbox4w)) (label cfg-4) - obj + this ) ;; definition of type collide-puss-work @@ -42,19 +42,19 @@ ) ;; definition for method 3 of type collide-puss-work -(defmethod inspect collide-puss-work ((obj collide-puss-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-puss-work ((this collide-puss-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-puss-work) - (format #t "~1Tclosest-pt: #~%" (-> obj closest-pt)) - (format #t "~1Ttri-normal: #~%" (-> obj tri-normal)) - (format #t "~1Ttri-bbox4w: #~%" (-> obj tri-bbox4w)) - (format #t "~1Tspheres-bbox4w: #~%" (-> obj spheres-bbox4w)) - (format #t "~1Tspheres[64] @ #x~X~%" (-> obj spheres)) + (format #t "[~8x] ~A~%" this 'collide-puss-work) + (format #t "~1Tclosest-pt: #~%" (-> this closest-pt)) + (format #t "~1Ttri-normal: #~%" (-> this tri-normal)) + (format #t "~1Ttri-bbox4w: #~%" (-> this tri-bbox4w)) + (format #t "~1Tspheres-bbox4w: #~%" (-> this spheres-bbox4w)) + (format #t "~1Tspheres[64] @ #x~X~%" (-> this spheres)) (label cfg-4) - obj + this ) ;; definition of type collide-cache-tri @@ -74,21 +74,21 @@ ) ;; definition for method 3 of type collide-cache-tri -(defmethod inspect collide-cache-tri ((obj collide-cache-tri)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-cache-tri ((this collide-cache-tri)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-cache-tri) - (format #t "~1Tvertex[3] @ #x~X~%" (-> obj vertex)) - (format #t "~1Textra-quad[16] @ #x~X~%" (-> obj extra-quad)) - (format #t "~1Tpat: ~D~%" (-> obj pat)) - (format #t "~1Tcollide-ptr: ~A~%" (-> obj collide-ptr)) - (format #t "~1Tprim-index: ~D~%" (-> obj prim-index)) - (format #t "~1Tuser16: ~D~%" (-> obj user16)) - (format #t "~1Tuser32: ~D~%" (-> obj user32)) + (format #t "[~8x] ~A~%" this 'collide-cache-tri) + (format #t "~1Tvertex[3] @ #x~X~%" (-> this vertex)) + (format #t "~1Textra-quad[16] @ #x~X~%" (-> this extra-quad)) + (format #t "~1Tpat: ~D~%" (-> this pat)) + (format #t "~1Tcollide-ptr: ~A~%" (-> this collide-ptr)) + (format #t "~1Tprim-index: ~D~%" (-> this prim-index)) + (format #t "~1Tuser16: ~D~%" (-> this user16)) + (format #t "~1Tuser32: ~D~%" (-> this user32)) (label cfg-4) - obj + this ) ;; definition of type collide-cache-prim @@ -115,25 +115,25 @@ ) ;; definition for method 3 of type collide-cache-prim -(defmethod inspect collide-cache-prim ((obj collide-cache-prim)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-cache-prim ((this collide-cache-prim)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-cache-prim) - (format #t "~1Tprim-core: #~%" (-> obj prim-core)) - (format #t "~1Textra-quad[16] @ #x~X~%" (-> obj extra-quad)) - (format #t "~1Tccache: ~A~%" (-> obj ccache)) - (format #t "~1Tprim: ~A~%" (-> obj prim)) - (format #t "~1Tfirst-tri: ~D~%" (-> obj first-tri)) - (format #t "~1Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~1Tunused[4] @ #x~X~%" (-> obj unused)) - (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) - (format #t "~1Tcollide-as: ~D~%" (-> obj prim-core collide-as)) - (format #t "~1Taction: ~D~%" (-> obj prim-core action)) - (format #t "~1Tprim-type: ~D~%" (-> obj prim-core prim-type)) + (format #t "[~8x] ~A~%" this 'collide-cache-prim) + (format #t "~1Tprim-core: #~%" (-> this prim-core)) + (format #t "~1Textra-quad[16] @ #x~X~%" (-> this extra-quad)) + (format #t "~1Tccache: ~A~%" (-> this ccache)) + (format #t "~1Tprim: ~A~%" (-> this prim)) + (format #t "~1Tfirst-tri: ~D~%" (-> this first-tri)) + (format #t "~1Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~1Tunused[4] @ #x~X~%" (-> this unused)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~1Tcollide-as: ~D~%" (-> this prim-core collide-as)) + (format #t "~1Taction: ~D~%" (-> this prim-core action)) + (format #t "~1Tprim-type: ~D~%" (-> this prim-core prim-type)) (label cfg-4) - obj + this ) ;; definition of type collide-cache @@ -176,24 +176,24 @@ ) ;; definition for method 3 of type collide-cache -(defmethod inspect collide-cache ((obj collide-cache)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-cache ((this collide-cache)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~1Tnum-prims: ~D~%" (-> obj num-prims)) - (format #t "~1Tignore-mask: ~D~%" (-> obj ignore-mask)) - (format #t "~1Tignore-processes[2] @ #x~X~%" (-> obj ignore-processes)) - (format #t "~1Tcollide-box: #~%" (-> obj collide-box)) - (format #t "~1Tcollide-box4w: #~%" (-> obj collide-box4w)) - (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~1Tunused: ~D~%" (-> obj unused)) - (format #t "~1Tprims[100] @ #x~X~%" (-> obj prims)) - (format #t "~1Ttris[461] @ #x~X~%" (-> obj tris)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~1Tnum-prims: ~D~%" (-> this num-prims)) + (format #t "~1Tignore-mask: ~D~%" (-> this ignore-mask)) + (format #t "~1Tignore-processes[2] @ #x~X~%" (-> this ignore-processes)) + (format #t "~1Tcollide-box: #~%" (-> this collide-box)) + (format #t "~1Tcollide-box4w: #~%" (-> this collide-box4w)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~1Tunused: ~D~%" (-> this unused)) + (format #t "~1Tprims[100] @ #x~X~%" (-> this prims)) + (format #t "~1Ttris[461] @ #x~X~%" (-> this tris)) (label cfg-4) - obj + this ) ;; definition of type collide-list-item @@ -208,16 +208,16 @@ ) ;; definition for method 3 of type collide-list-item -(defmethod inspect collide-list-item ((obj collide-list-item)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-list-item ((this collide-list-item)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-list-item) - (format #t "~1Tmesh: ~A~%" (-> obj mesh)) - (format #t "~1Tinst: ~A~%" (-> obj inst)) + (format #t "[~8x] ~A~%" this 'collide-list-item) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tinst: ~A~%" (-> this inst)) (label cfg-4) - obj + this ) ;; definition of type collide-list @@ -231,16 +231,16 @@ ) ;; definition for method 3 of type collide-list -(defmethod inspect collide-list ((obj collide-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-list ((this collide-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-list) - (format #t "~1Tnum-items: ~D~%" (-> obj num-items)) - (format #t "~1Titems[256] @ #x~X~%" (-> obj items)) + (format #t "[~8x] ~A~%" this 'collide-list) + (format #t "~1Tnum-items: ~D~%" (-> this num-items)) + (format #t "~1Titems[256] @ #x~X~%" (-> this items)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc index 09c2d67c86..49882237d1 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-cache_REF.gc @@ -3,11 +3,11 @@ ;; definition for method 15 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod reset collide-cache ((obj collide-cache)) - (set! (-> obj num-tris) 0) - (set! (-> obj num-prims) 0) - (set! (-> obj ignore-processes 0) #f) - (set! (-> obj ignore-processes 1) #f) +(defmethod reset collide-cache ((this collide-cache)) + (set! (-> this num-tris) 0) + (set! (-> this num-prims) 0) + (set! (-> this ignore-processes 0) #f) + (set! (-> this ignore-processes 1) #f) (set! *already-printed-exeeded-max-cache-tris* #f) 0 (none) @@ -16,7 +16,7 @@ ;; definition for method 18 of type collide-cache ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod fill-from-bg collide-cache ((obj collide-cache) +(defmethod fill-from-bg collide-cache ((this collide-cache) (arg0 (function collide-hash int collide-list collide-query int)) (arg1 (function collide-cache collide-list collide-query none)) (arg2 collide-query) @@ -41,16 +41,16 @@ ) (when (> (-> *collide-list* num-items) 0) (arg1 *collide-cache* *collide-list* arg2) - (let ((a0-8 (-> obj num-tris))) + (let ((a0-8 (-> this num-tris))) (when (> a0-8 0) - (let ((v1-16 (-> obj prims)) + (let ((v1-16 (-> this prims)) (a1-6 *collide-shape-prim-backgnd*) ) (set! (-> v1-16 0 num-tris) (the-as uint a0-8)) (set! (-> v1-16 0 prim) a1-6) - (set! (-> obj num-prims) 1) + (set! (-> this num-prims) 1) (set! (-> v1-16 0 first-tri) (the-as uint 0)) - (set! (-> v1-16 0 ccache) obj) + (set! (-> v1-16 0 ccache) this) (set! (-> v1-16 0 prim-core world-sphere quad) (-> a1-6 prim-core world-sphere quad)) (set! (-> v1-16 0 prim-core quad 1) (-> a1-6 prim-core quad 1)) ) @@ -65,7 +65,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 21 collide-cache) has a return type of none, but the expression builder found a return statement. -(defmethod fill-from-water collide-cache ((obj collide-cache) (arg0 water-control)) +(defmethod fill-from-water collide-cache ((this collide-cache) (arg0 water-control)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -74,13 +74,13 @@ (vf5 :class vf) ) (init-vf0-vector) - (when (= (-> obj num-prims) 100) + (when (= (-> this num-prims) 100) (if (= *cheat-mode* 'debug) (format 0 "ERROR: Exceeded max number of collide-cache prims!~%") ) (return #f) ) - (when (< 460 (+ (-> obj num-tris) 2)) + (when (< 460 (+ (-> this num-tris) 2)) (if (= *cheat-mode* 'debug) (print-exceeded-max-cache-tris) ) @@ -96,10 +96,10 @@ (return #f) ) (let ((v1-24 (-> arg0 collide-height))) - (.lvf vf1 (&-> obj collide-box min quad)) - (.lvf vf3 (&-> obj collide-box max quad)) - (let ((a2-6 (-> obj num-prims-u32)) - (a3-4 (the-as (inline-array collide-cache-tri) (-> obj tris (-> obj num-tris)))) + (.lvf vf1 (&-> this collide-box min quad)) + (.lvf vf3 (&-> this collide-box max quad)) + (let ((a2-6 (-> this num-prims-u32)) + (a3-4 (the-as (inline-array collide-cache-tri) (-> this tris (-> this num-tris)))) ) (.mov vf5 v1-24) (.add.x.vf vf1 vf0 vf5 :mask #b10) @@ -125,17 +125,17 @@ ) ) (let ((v1-27 *collide-shape-prim-water*) - (a1-5 (-> obj prims (-> obj num-prims))) + (a1-5 (-> this prims (-> this num-prims))) ) - (set! (-> a1-5 first-tri) (the-as uint (-> obj num-tris))) + (set! (-> a1-5 first-tri) (the-as uint (-> this num-tris))) (set! (-> a1-5 num-tris) (the-as uint 2)) (set! (-> a1-5 prim) v1-27) - (set! (-> a1-5 ccache) obj) + (set! (-> a1-5 ccache) this) (set! (-> a1-5 prim-core world-sphere quad) (-> v1-27 prim-core world-sphere quad)) (set! (-> a1-5 prim-core quad 1) (-> v1-27 prim-core quad 1)) ) - (+! (-> obj num-prims) 1) - (+! (-> obj num-tris) 2) + (+! (-> this num-prims) 1) + (+! (-> this num-tris) 2) 0 (none) ) @@ -143,7 +143,7 @@ ;; definition for method 12 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod fill-using-bounding-box collide-cache ((obj collide-cache) (arg0 collide-query)) +(defmethod fill-using-bounding-box collide-cache ((this collide-cache) (arg0 collide-query)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -167,56 +167,56 @@ (nop!) (.lvf vf2 (&-> arg0 bbox max quad)) (nop!) - (set! (-> obj ignore-processes 0) (the-as process a0-2)) + (set! (-> this ignore-processes 0) (the-as process a0-2)) (nop!) - (set! (-> obj ignore-processes 1) (the-as process a1-1)) + (set! (-> this ignore-processes 1) (the-as process a1-1)) (.mov.vf vf1 vf0 :mask #b1000) (nop!) (.mov.vf vf2 vf0 :mask #b1000) - (set! (-> obj ignore-mask) (the-as pat-surface a2-0)) + (set! (-> this ignore-mask) (the-as pat-surface a2-0)) ) ) ) (.ftoi.vf vf3 vf1) (nop!) (.ftoi.vf vf4 vf2) - (set! (-> obj num-tris) 0) + (set! (-> this num-tris) 0) (nop!) - (.svf (&-> obj collide-box min quad) vf1) + (.svf (&-> this collide-box min quad) vf1) (nop!) - (.svf (&-> obj collide-box max quad) vf2) + (.svf (&-> this collide-box max quad) vf2) (nop!) - (.svf (&-> obj collide-box4w min quad) vf3) + (.svf (&-> this collide-box4w min quad) vf3) (nop!) - (.svf (&-> obj collide-box4w max quad) vf4) + (.svf (&-> this collide-box4w max quad) vf4) (nop!) (.svf (&-> arg0 bbox4w min quad) vf3) (nop!) (.svf (&-> arg0 bbox4w max quad) vf4) (nop!) - (set! (-> obj num-prims) 0) + (set! (-> this num-prims) 0) (nop!) - (set! (-> obj collide-with) (the-as collide-spec v1-4)) + (set! (-> this collide-with) (the-as collide-spec v1-4)) ) 0 (when (logtest? (-> arg0 collide-with) (collide-spec backgnd)) (fill-from-bg - obj + this (method-of-type collide-hash fill-collide-list-from-box) collide-list-fill-bg-using-box arg0 ) - (+! (-> *collide-stats* output) (-> obj num-tris)) + (+! (-> *collide-stats* output) (-> this num-tris)) ) (when (logtest? (-> arg0 collide-with) (collide-spec water)) (let ((v1-18 (-> arg0 ignore-process0))) (if v1-18 - (fill-from-water obj (-> (the-as process-drawable v1-18) water)) + (fill-from-water this (-> (the-as process-drawable v1-18) water)) ) ) ) (if (logtest? (-> arg0 collide-with) (collide-spec hit-by-player-list hit-by-others-list player-list)) - (fill-from-fg-boxes obj) + (fill-from-fg-boxes this) ) 0 (none) @@ -225,7 +225,7 @@ ;; definition for method 13 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod fill-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) +(defmethod fill-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) (local-vars (v1-11 float) (v1-20 float)) (rlet ((acc :class vf) (Q :class vf) @@ -267,7 +267,7 @@ ) (when (< 1 v1-3) (set-from-point-offset-pad! (-> arg0 bbox) (-> arg0 start-pos) (-> arg0 move-dist) (-> arg0 radius)) - (fill-using-bounding-box obj arg0) + (fill-using-bounding-box this arg0) (b! #t cfg-47 :delay (nop!)) (the-as none 0) (nop!) @@ -292,18 +292,18 @@ (.mul.vf vf8 vf3 vf3) (nop!) (.add.vf vf2 vf1 vf3) - (set! (-> obj ignore-mask) (the-as pat-surface v1-10)) + (set! (-> this ignore-mask) (the-as pat-surface v1-10)) (.add.y.vf vf8 vf8 vf8 :mask #b1) - (set! (-> obj num-tris) 0) + (set! (-> this num-tris) 0) (.min.vf vf4 vf1 vf2) - (set! (-> obj num-prims) 0) + (set! (-> this num-prims) 0) (.max.vf vf5 vf1 vf2) - (set! (-> obj collide-with) (the-as collide-spec a2-1)) + (set! (-> this collide-with) (the-as collide-spec a2-1)) ) (.sub.w.vf vf10 vf0 vf9 :mask #b111) - (set! (-> obj ignore-processes 0) (the-as process a0-14)) + (set! (-> this ignore-processes 0) (the-as process a0-14)) (.add.z.vf vf8 vf8 vf8 :mask #b1) - (set! (-> obj ignore-processes 1) (the-as process a1-3)) + (set! (-> this ignore-processes 1) (the-as process a1-3)) ) ) ) @@ -322,17 +322,17 @@ (nop!) (.svf (&-> arg0 local-box4w min quad) vf15) (.ftoi.vf vf6 vf4) - (.svf (&-> obj collide-box min quad) vf4) + (.svf (&-> this collide-box min quad) vf4) (.ftoi.vf vf7 vf5) - (.svf (&-> obj collide-box max quad) vf5) + (.svf (&-> this collide-box max quad) vf5) (nop!) (.svf (&-> arg0 bbox min quad) vf4) (nop!) (.svf (&-> arg0 bbox max quad) vf5) (nop!) - (.svf (&-> obj collide-box4w min quad) vf6) + (.svf (&-> this collide-box4w min quad) vf6) (nop!) - (.svf (&-> obj collide-box4w max quad) vf7) + (.svf (&-> this collide-box4w max quad) vf7) (nop!) (.svf (&-> arg0 bbox4w min quad) vf6) (nop!) @@ -468,22 +468,22 @@ ) (when (logtest? (-> arg0 collide-with) (collide-spec backgnd)) (fill-from-bg - obj + this (method-of-type collide-hash fill-collide-list-from-line-sphere) collide-list-fill-bg-using-line-sphere arg0 ) - (+! (-> *collide-stats* output) (-> obj num-tris)) + (+! (-> *collide-stats* output) (-> this num-tris)) ) (when (logtest? (-> arg0 collide-with) (collide-spec water)) (let ((a1-5 (-> (the-as process-drawable (-> arg0 ignore-process0)) water))) (if (nonzero? a1-5) - (fill-from-water obj a1-5) + (fill-from-water this a1-5) ) ) ) (if (logtest? (-> arg0 collide-with) (collide-spec hit-by-player-list hit-by-others-list player-list)) - (fill-from-fg-line-sphere obj arg0) + (fill-from-fg-line-sphere this arg0) ) 0 (label cfg-47) @@ -493,11 +493,11 @@ ;; definition for method 19 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod fill-from-fg-boxes collide-cache ((obj collide-cache)) - (let ((s5-0 (-> obj collide-with))) +(defmethod fill-from-fg-boxes collide-cache ((this collide-cache)) + (let ((s5-0 (-> this collide-with))) (set! *actor-list-length* 0) (if (logtest? s5-0 (collide-spec hit-by-others-list)) - (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (-> obj collide-box) *actor-list* 256)) + (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (-> this collide-box) *actor-list* 256)) ) (when (logtest? s5-0 (collide-spec player-list)) (let ((a0-2 (-> *collide-player-list* alive-list next0))) @@ -509,12 +509,12 @@ ) (when (logtest? s5-0 (-> a1-1 prim-core collide-as)) (let ((a1-2 (-> a1-1 prim-core))) - (when (and (>= (+ (-> a1-2 world-sphere x) (-> a1-2 world-sphere w)) (-> obj collide-box min x)) - (>= (-> obj collide-box max x) (- (-> a1-2 world-sphere x) (-> a1-2 world-sphere w))) - (>= (+ (-> a1-2 world-sphere y) (-> a1-2 world-sphere w)) (-> obj collide-box min y)) - (>= (-> obj collide-box max y) (- (-> a1-2 world-sphere y) (-> a1-2 world-sphere w))) - (>= (+ (-> a1-2 world-sphere z) (-> a1-2 world-sphere w)) (-> obj collide-box min z)) - (>= (-> obj collide-box max z) (- (-> a1-2 world-sphere z) (-> a1-2 world-sphere w))) + (when (and (>= (+ (-> a1-2 world-sphere x) (-> a1-2 world-sphere w)) (-> this collide-box min x)) + (>= (-> this collide-box max x) (- (-> a1-2 world-sphere x) (-> a1-2 world-sphere w))) + (>= (+ (-> a1-2 world-sphere y) (-> a1-2 world-sphere w)) (-> this collide-box min y)) + (>= (-> this collide-box max y) (- (-> a1-2 world-sphere y) (-> a1-2 world-sphere w))) + (>= (+ (-> a1-2 world-sphere z) (-> a1-2 world-sphere w)) (-> this collide-box min z)) + (>= (-> this collide-box max z) (- (-> a1-2 world-sphere z) (-> a1-2 world-sphere w))) ) (when (< *actor-list-length* 256) (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) @@ -541,12 +541,12 @@ ) (when (logtest? s5-0 (-> a1-13 prim-core collide-as)) (let ((a1-14 (-> a1-13 prim-core))) - (when (and (>= (+ (-> a1-14 world-sphere x) (-> a1-14 world-sphere w)) (-> obj collide-box min x)) - (>= (-> obj collide-box max x) (- (-> a1-14 world-sphere x) (-> a1-14 world-sphere w))) - (>= (+ (-> a1-14 world-sphere y) (-> a1-14 world-sphere w)) (-> obj collide-box min y)) - (>= (-> obj collide-box max y) (- (-> a1-14 world-sphere y) (-> a1-14 world-sphere w))) - (>= (+ (-> a1-14 world-sphere z) (-> a1-14 world-sphere w)) (-> obj collide-box min z)) - (>= (-> obj collide-box max z) (- (-> a1-14 world-sphere z) (-> a1-14 world-sphere w))) + (when (and (>= (+ (-> a1-14 world-sphere x) (-> a1-14 world-sphere w)) (-> this collide-box min x)) + (>= (-> this collide-box max x) (- (-> a1-14 world-sphere x) (-> a1-14 world-sphere w))) + (>= (+ (-> a1-14 world-sphere y) (-> a1-14 world-sphere w)) (-> this collide-box min y)) + (>= (-> this collide-box max y) (- (-> a1-14 world-sphere y) (-> a1-14 world-sphere w))) + (>= (+ (-> a1-14 world-sphere z) (-> a1-14 world-sphere w)) (-> this collide-box min z)) + (>= (-> this collide-box max z) (- (-> a1-14 world-sphere z) (-> a1-14 world-sphere w))) ) (when (< *actor-list-length* 256) (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) @@ -567,8 +567,8 @@ (let ((v1-26 (-> *actor-list* s4-0))) (when (logtest? s5-0 (-> v1-26 root-prim prim-core collide-as)) (let ((a0-13 (-> v1-26 process))) - (if (not (or (= a0-13 (-> obj ignore-processes 0)) (= a0-13 (-> obj ignore-processes 1)))) - (add-fg-prim-using-box (-> v1-26 root-prim) obj) + (if (not (or (= a0-13 (-> this ignore-processes 0)) (= a0-13 (-> this ignore-processes 1)))) + (add-fg-prim-using-box (-> v1-26 root-prim) this) ) ) ) @@ -581,7 +581,7 @@ ;; definition for method 10 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod add-fg-prim-using-box collide-shape-prim ((obj collide-shape-prim) (arg0 collide-cache)) +(defmethod add-fg-prim-using-box collide-shape-prim ((this collide-shape-prim) (arg0 collide-cache)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-box!~%") (none) ) @@ -600,7 +600,7 @@ ;; definition for method 20 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod fill-from-fg-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) +(defmethod fill-from-fg-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) (local-vars (v1-9 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -714,8 +714,8 @@ (let ((v1-58 (-> *actor-list* s3-1))) (when (logtest? s4-0 (-> v1-58 root-prim prim-core collide-as)) (let ((a0-37 (-> v1-58 process))) - (if (not (or (= a0-37 (-> obj ignore-processes 0)) (= a0-37 (-> obj ignore-processes 1)))) - (add-fg-prim-using-line-sphere (-> v1-58 root-prim) obj arg0) + (if (not (or (= a0-37 (-> this ignore-processes 0)) (= a0-37 (-> this ignore-processes 1)))) + (add-fg-prim-using-line-sphere (-> v1-58 root-prim) this arg0) ) ) ) @@ -729,7 +729,7 @@ ;; definition for method 11 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod add-fg-prim-using-line-sphere collide-shape-prim ((obj collide-shape-prim) (arg0 collide-cache) (arg1 object)) +(defmethod add-fg-prim-using-line-sphere collide-shape-prim ((this collide-shape-prim) (arg0 collide-cache) (arg1 object)) (format 0 "ERROR: Illegal collide-shape-prim type passed to collide-shape-prim::add-fg-prim-using-line-sphere!~%" @@ -750,9 +750,9 @@ (defmethod-mips2c "(method 11 collide-shape-prim-group)" 11 collide-shape-prim-group) ;; definition for method 10 of type collide-cache -(defmethod fill-and-probe-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) - (fill-using-line-sphere obj arg0) - (probe-using-line-sphere obj arg0) +(defmethod fill-and-probe-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) + (fill-using-line-sphere this arg0) + (probe-using-line-sphere this arg0) ) ;; definition of type collide-puls-work @@ -767,21 +767,21 @@ ) ;; definition for method 3 of type collide-puls-work -(defmethod inspect collide-puls-work ((obj collide-puls-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-puls-work ((this collide-puls-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-puls-work) - (format #t "~1Tignore-pat: ~D~%" (-> obj ignore-pat)) - (format #t "~1Tbsphere: #~%" (-> obj bsphere)) - (format #t "~1Tmove-dist: #~%" (-> obj move-dist)) + (format #t "[~8x] ~A~%" this 'collide-puls-work) + (format #t "~1Tignore-pat: ~D~%" (-> this ignore-pat)) + (format #t "~1Tbsphere: #~%" (-> this bsphere)) + (format #t "~1Tmove-dist: #~%" (-> this move-dist)) (label cfg-4) - obj + this ) ;; definition for method 16 of type collide-cache -(defmethod probe-using-line-sphere collide-cache ((obj collide-cache) (arg0 collide-query)) +(defmethod probe-using-line-sphere collide-cache ((this collide-cache) (arg0 collide-query)) (rlet ((vf0 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -796,10 +796,10 @@ (.mul.w.vf vf3 vf0 vf4 :mask #b1000) (.svf (&-> s5-0 vertex 2 quad) vf2) (.svf (&-> s5-0 vertex 1 quad) vf3) - (let ((s4-0 (the-as object (-> obj prims))) + (let ((s4-0 (the-as object (-> this prims))) (f30-0 -100000000.0) ) - (countdown (s3-0 (-> obj num-prims)) + (countdown (s3-0 (-> this num-prims)) (when (and (logtest? (-> arg0 collide-with) (-> (the-as collide-cache-prim s4-0) prim-core collide-as)) (logtest? (-> arg0 action-mask) (-> (the-as collide-cache-prim s4-0) prim-core action)) ) @@ -864,18 +864,18 @@ ) ;; definition for method 3 of type lsmi-work -(defmethod inspect lsmi-work ((obj lsmi-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect lsmi-work ((this lsmi-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'lsmi-work) - (format #t "~1Tbest-u: ~f~%" (-> obj best-u)) - (format #t "~1Torig-best-u: ~f~%" (-> obj orig-best-u)) - (format #t "~1Taction: ~D~%" (-> obj action)) - (format #t "~1Tcquery: #~%" (-> obj cquery)) + (format #t "[~8x] ~A~%" this 'lsmi-work) + (format #t "~1Tbest-u: ~f~%" (-> this best-u)) + (format #t "~1Torig-best-u: ~f~%" (-> this orig-best-u)) + (format #t "~1Taction: ~D~%" (-> this action)) + (format #t "~1Tcquery: #~%" (-> this cquery)) (label cfg-4) - obj + this ) ;; definition for method 9 of type collide-cache-prim @@ -887,20 +887,20 @@ (defmethod-mips2c "(method 10 collide-cache-prim)" 10 collide-cache-prim) ;; definition for method 11 of type collide-cache -(defmethod fill-and-probe-using-spheres collide-cache ((obj collide-cache) (arg0 collide-query)) - (fill-using-spheres obj arg0) - (probe-using-spheres obj arg0) +(defmethod fill-and-probe-using-spheres collide-cache ((this collide-cache) (arg0 collide-query)) + (fill-using-spheres this arg0) + (probe-using-spheres this arg0) ) ;; definition for method 14 of type collide-cache -(defmethod fill-using-spheres collide-cache ((obj collide-cache) (arg0 collide-query)) +(defmethod fill-using-spheres collide-cache ((this collide-cache) (arg0 collide-query)) (new 'stack-no-clear 'bounding-box) (set-from-spheres! (-> arg0 bbox) (the-as (inline-array sphere) (-> arg0 best-dist)) (the-as int (-> arg0 num-spheres)) ) - (fill-using-bounding-box obj arg0) + (fill-using-bounding-box this arg0) (none) ) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc index 7ed35063b9..da4b16a64d 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-debug_REF.gc @@ -6,9 +6,9 @@ ;; definition for method 9 of type collide-cache ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-cache ((obj collide-cache)) - (let ((gp-0 (the-as object (-> obj tris)))) - (countdown (s4-0 (-> obj num-tris)) +(defmethod debug-draw collide-cache ((this collide-cache)) + (let ((gp-0 (the-as object (-> this tris)))) + (countdown (s4-0 (-> this num-tris)) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-cache-tri gp-0) pat mode) color) a 64))) (add-debug-flat-triangle #t @@ -22,8 +22,8 @@ (set! gp-0 (&+ (the-as collide-cache-tri gp-0) 64)) ) ) - (let ((gp-1 (the-as object (-> obj prims)))) - (countdown (s5-1 (-> obj num-prims)) + (let ((gp-1 (the-as object (-> this prims)))) + (countdown (s5-1 (-> this num-prims)) (when (= (-> (the-as collide-cache-prim gp-1) prim-core prim-type) (prim-type sphere)) (let ((t0-1 (copy-and-set-field @@ -65,17 +65,17 @@ ) ;; definition for method 3 of type col-rend-filter -(defmethod inspect col-rend-filter ((obj col-rend-filter)) - (when (not obj) - (set! obj obj) +(defmethod inspect col-rend-filter ((this col-rend-filter)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'col-rend-filter) - (format #t "~1Tshow-pat-set: ~D~%" (-> obj show-pat-set)) - (format #t "~1Tshow-pat-clear: ~D~%" (-> obj show-pat-clear)) - (format #t "~1Tevent-mask: ~D~%" (-> obj event-mask)) + (format #t "[~8x] ~A~%" this 'col-rend-filter) + (format #t "~1Tshow-pat-set: ~D~%" (-> this show-pat-set)) + (format #t "~1Tshow-pat-clear: ~D~%" (-> this show-pat-clear)) + (format #t "~1Tevent-mask: ~D~%" (-> this event-mask)) (label cfg-4) - obj + this ) ;; definition for function col-rend-draw @@ -185,31 +185,35 @@ ;; definition for method 9 of type col-rend ;; INFO: Used lq/sq -(defmethod col-rend-method-9 col-rend ((obj col-rend)) +(defmethod col-rend-method-9 col-rend ((this col-rend)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (let ((f30-0 (-> obj bbox-radius))) - (let ((v1-0 (-> obj track))) + (let ((f30-0 (-> this bbox-radius))) + (let ((v1-0 (-> this track))) (cond ((zero? v1-0) - (set! (-> obj bbox-center quad) (-> (target-pos 0) quad)) - (+! (-> obj bbox-center y) (* 0.7 f30-0)) + (set! (-> this bbox-center quad) (-> (target-pos 0) quad)) + (+! (-> this bbox-center y) (* 0.7 f30-0)) ) ((= v1-0 1) - (position-in-front-of-camera! (-> obj bbox-center) (+ (-> obj camera-to-bbox-dist) (-> obj bbox-radius)) 0.0) + (position-in-front-of-camera! + (-> this bbox-center) + (+ (-> this camera-to-bbox-dist) (-> this bbox-radius)) + 0.0 + ) ) ) ) - (set! (-> s5-0 bbox min quad) (-> obj bbox-center quad)) + (set! (-> s5-0 bbox min quad) (-> this bbox-center quad)) (set! (-> s5-0 bbox min x) (- (-> s5-0 bbox min x) f30-0)) (set! (-> s5-0 bbox min y) (- (-> s5-0 bbox min y) f30-0)) (set! (-> s5-0 bbox min z) (- (-> s5-0 bbox min z) f30-0)) - (set! (-> s5-0 bbox max quad) (-> obj bbox-center quad)) + (set! (-> s5-0 bbox max quad) (-> this bbox-center quad)) (+! (-> s5-0 bbox max x) f30-0) (+! (-> s5-0 bbox max y) f30-0) (+! (-> s5-0 bbox max z) f30-0) ) (let ((v1-9 -1)) - (let ((a0-9 (-> obj cspec))) + (let ((a0-9 (-> this cspec))) (if (not (logtest? a0-9 (collide-spec crate))) (set! v1-9 (logxor v1-9 1)) ) @@ -243,7 +247,7 @@ ) (fill-using-bounding-box *collide-cache* s5-0) ) - (let ((s5-1 (-> obj show-only)) + (let ((s5-1 (-> this show-only)) (a1-17 (new 'stack 'col-rend-filter)) ) (when (nonzero? s5-1) @@ -301,7 +305,7 @@ ) ) ) - (col-rend-draw obj a1-17) + (col-rend-draw this a1-17) ) (none) ) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc index 0685712568..8835819352 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type pilot-edge-grab-info -(defmethod inspect pilot-edge-grab-info ((obj pilot-edge-grab-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect pilot-edge-grab-info ((this pilot-edge-grab-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pilot-edge-grab-info) - (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~1Tlocal-dir: #~%" (-> obj local-dir)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "[~8x] ~A~%" this 'pilot-edge-grab-info) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tlocal-dir: #~%" (-> this local-dir)) + (format #t "~1Thandle: ~D~%" (-> this handle)) (label cfg-4) - obj + this ) ;; definition of type edge-grab-info @@ -59,34 +59,34 @@ ) ;; definition for method 3 of type edge-grab-info -(defmethod inspect edge-grab-info ((obj edge-grab-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect edge-grab-info ((this edge-grab-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'edge-grab-info) - (format #t "~1Tworld-vertex[8] @ #x~X~%" (-> obj world-vertex)) - (format #t "~1Tlocal-vertex[8] @ #x~X~%" (-> obj local-vertex)) - (format #t "~1Tstatus: ~D~%" (-> obj status)) - (format #t "~1Tactor-cshape-prim-offset: ~D~%" (-> obj actor-cshape-prim-offset)) - (format #t "~1Tactor-handle: ~D~%" (-> obj actor-handle)) - (format #t "~1Thanging-matrix: #~%" (-> obj hanging-matrix)) - (format #t "~1Tedge-vertex[2] @ #x~X~%" (-> obj world-vertex)) - (format #t "~1Tcenter-hold: ~`vector`P~%" (-> obj center-hold)) - (format #t "~1Ttri-vertex[3] @ #x~X~%" (-> obj tri-vertex)) - (format #t "~1Tadjacent-edge-left-vertex: #~%" (-> obj adjacent-edge-left-vertex)) - (format #t "~1Tadjacent-edge-right-vertex: #~%" (-> obj adjacent-edge-right-vertex)) - (format #t "~1Tleft-hand-hold: #~%" (-> obj left-hand-hold)) - (format #t "~1Tright-hand-hold: #~%" (-> obj right-hand-hold)) - (format #t "~1Tcenter-hold-old: ~`vector`P~%" (-> obj center-hold-old)) - (format #t "~1Tedge-tri-pat: ~D~%" (-> obj edge-tri-pat)) - (format #t "~1Tfound-edge?: ~A~%" (-> obj found-edge?)) - (format #t "~1Tpilot-edge-grab?: ~A~%" (-> obj pilot-edge-grab?)) - (format #t "~1Tpilot-edge-grab: #~%" (-> obj pilot-edge-grab)) - (format #t "~1Tpilot-start-grab-pos: #~%" (-> obj pilot-start-grab-pos)) - (format #t "~1Tpilot-grab-interp: ~f~%" (-> obj pilot-grab-interp)) + (format #t "[~8x] ~A~%" this 'edge-grab-info) + (format #t "~1Tworld-vertex[8] @ #x~X~%" (-> this world-vertex)) + (format #t "~1Tlocal-vertex[8] @ #x~X~%" (-> this local-vertex)) + (format #t "~1Tstatus: ~D~%" (-> this status)) + (format #t "~1Tactor-cshape-prim-offset: ~D~%" (-> this actor-cshape-prim-offset)) + (format #t "~1Tactor-handle: ~D~%" (-> this actor-handle)) + (format #t "~1Thanging-matrix: #~%" (-> this hanging-matrix)) + (format #t "~1Tedge-vertex[2] @ #x~X~%" (-> this world-vertex)) + (format #t "~1Tcenter-hold: ~`vector`P~%" (-> this center-hold)) + (format #t "~1Ttri-vertex[3] @ #x~X~%" (-> this tri-vertex)) + (format #t "~1Tadjacent-edge-left-vertex: #~%" (-> this adjacent-edge-left-vertex)) + (format #t "~1Tadjacent-edge-right-vertex: #~%" (-> this adjacent-edge-right-vertex)) + (format #t "~1Tleft-hand-hold: #~%" (-> this left-hand-hold)) + (format #t "~1Tright-hand-hold: #~%" (-> this right-hand-hold)) + (format #t "~1Tcenter-hold-old: ~`vector`P~%" (-> this center-hold-old)) + (format #t "~1Tedge-tri-pat: ~D~%" (-> this edge-tri-pat)) + (format #t "~1Tfound-edge?: ~A~%" (-> this found-edge?)) + (format #t "~1Tpilot-edge-grab?: ~A~%" (-> this pilot-edge-grab?)) + (format #t "~1Tpilot-edge-grab: #~%" (-> this pilot-edge-grab)) + (format #t "~1Tpilot-start-grab-pos: #~%" (-> this pilot-start-grab-pos)) + (format #t "~1Tpilot-grab-interp: ~f~%" (-> this pilot-grab-interp)) (label cfg-4) - obj + this ) ;; definition of type collide-edge-tri @@ -100,16 +100,16 @@ ) ;; definition for method 3 of type collide-edge-tri -(defmethod inspect collide-edge-tri ((obj collide-edge-tri)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-edge-tri ((this collide-edge-tri)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-edge-tri) - (format #t "~1Tctri: ~A~%" (-> obj ctri)) - (format #t "~1Tnormal: #~%" (-> obj normal)) + (format #t "[~8x] ~A~%" this 'collide-edge-tri) + (format #t "~1Tctri: ~A~%" (-> this ctri)) + (format #t "~1Tnormal: #~%" (-> this normal)) (label cfg-4) - obj + this ) ;; definition of type collide-edge-edge @@ -129,19 +129,19 @@ ) ;; definition for method 3 of type collide-edge-edge -(defmethod inspect collide-edge-edge ((obj collide-edge-edge)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-edge-edge ((this collide-edge-edge)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-edge-edge) - (format #t "~1Tignore: ~A~%" (-> obj ignore)) - (format #t "~1Tetri: #~%" (-> obj etri)) - (format #t "~1Tvertex-ptr[2] @ #x~X~%" (-> obj vertex-ptr)) - (format #t "~1Toutward: #~%" (-> obj outward)) - (format #t "~1Tedge-vec-norm: #~%" (-> obj edge-vec-norm)) + (format #t "[~8x] ~A~%" this 'collide-edge-edge) + (format #t "~1Tignore: ~A~%" (-> this ignore)) + (format #t "~1Tetri: #~%" (-> this etri)) + (format #t "~1Tvertex-ptr[2] @ #x~X~%" (-> this vertex-ptr)) + (format #t "~1Toutward: #~%" (-> this outward)) + (format #t "~1Tedge-vec-norm: #~%" (-> this edge-vec-norm)) (label cfg-4) - obj + this ) ;; definition of type collide-edge-hold-item @@ -159,20 +159,20 @@ ) ;; definition for method 3 of type collide-edge-hold-item -(defmethod inspect collide-edge-hold-item ((obj collide-edge-hold-item)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-edge-hold-item ((this collide-edge-hold-item)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-edge-hold-item) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Trating: ~f~%" (-> obj rating)) - (format #t "~1Tsplit: ~D~%" (-> obj split)) - (format #t "~1Tedge: #~%" (-> obj edge)) - (format #t "~1Tcenter-pt: #~%" (-> obj center-pt)) - (format #t "~1Toutward-pt: #~%" (-> obj outward-pt)) + (format #t "[~8x] ~A~%" this 'collide-edge-hold-item) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Trating: ~f~%" (-> this rating)) + (format #t "~1Tsplit: ~D~%" (-> this split)) + (format #t "~1Tedge: #~%" (-> this edge)) + (format #t "~1Tcenter-pt: #~%" (-> this center-pt)) + (format #t "~1Toutward-pt: #~%" (-> this outward-pt)) (label cfg-4) - obj + this ) ;; definition of type collide-edge-hold-list @@ -193,19 +193,19 @@ ) ;; definition for method 3 of type collide-edge-hold-list -(defmethod inspect collide-edge-hold-list ((obj collide-edge-hold-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-edge-hold-list ((this collide-edge-hold-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-edge-hold-list) - (format #t "~1Tnum-allocs: ~D~%" (-> obj num-allocs)) - (format #t "~1Tnum-attempts: ~D~%" (-> obj num-attempts)) - (format #t "~1Thead: #~%" (-> obj head)) - (format #t "~1Titems[32] @ #x~X~%" (-> obj items)) - (format #t "~1Tattempts[32] @ #x~X~%" (-> obj attempts)) + (format #t "[~8x] ~A~%" this 'collide-edge-hold-list) + (format #t "~1Tnum-allocs: ~D~%" (-> this num-allocs)) + (format #t "~1Tnum-attempts: ~D~%" (-> this num-attempts)) + (format #t "~1Thead: #~%" (-> this head)) + (format #t "~1Titems[32] @ #x~X~%" (-> this items)) + (format #t "~1Tattempts[32] @ #x~X~%" (-> this attempts)) (label cfg-4) - obj + this ) ;; definition of type collide-edge-spec @@ -230,27 +230,27 @@ ) ;; definition for method 3 of type collide-edge-spec -(defmethod inspect collide-edge-spec ((obj collide-edge-spec)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-edge-spec ((this collide-edge-spec)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-edge-spec) - (format #t "~1Tsplit-dists[2] @ #x~X~%" (-> obj split-dists)) - (format #t "~1Toutward-offset: #~%" (-> obj outward-offset)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tignore-pat: ~D~%" (-> obj ignore-pat)) - (format #t "~1Tmax-dist-sqrd-to-outward-pt: ~f~%" (-> obj max-dist-sqrd-to-outward-pt)) - (format #t "~1Tmax-dir-cosa-delta: ~f~%" (-> obj max-dir-cosa-delta)) - (format #t "~1Tmax-dir-cosa-player: ~f~%" (-> obj max-dir-cosa-player)) - (format #t "~1Ttouching-segment: #x~X~%" (-> obj touching-segment)) - (format #t "~1Tlocal-cache-fill-box: #~%" (-> obj local-cache-fill-box)) - (format #t "~1Tlocal-within-reach-box: #~%" (-> obj local-within-reach-box)) - (format #t "~1Tlocal-player-spheres[12] @ #x~X~%" (-> obj local-player-spheres)) - (format #t "~1Tlocal-player-hanging-spheres[6] @ #x~X~%" (-> obj local-player-spheres)) - (format #t "~1Tlocal-player-leap-up-spheres[6] @ #x~X~%" (-> obj local-player-leap-up-spheres)) + (format #t "[~8x] ~A~%" this 'collide-edge-spec) + (format #t "~1Tsplit-dists[2] @ #x~X~%" (-> this split-dists)) + (format #t "~1Toutward-offset: #~%" (-> this outward-offset)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tignore-pat: ~D~%" (-> this ignore-pat)) + (format #t "~1Tmax-dist-sqrd-to-outward-pt: ~f~%" (-> this max-dist-sqrd-to-outward-pt)) + (format #t "~1Tmax-dir-cosa-delta: ~f~%" (-> this max-dir-cosa-delta)) + (format #t "~1Tmax-dir-cosa-player: ~f~%" (-> this max-dir-cosa-player)) + (format #t "~1Ttouching-segment: #x~X~%" (-> this touching-segment)) + (format #t "~1Tlocal-cache-fill-box: #~%" (-> this local-cache-fill-box)) + (format #t "~1Tlocal-within-reach-box: #~%" (-> this local-within-reach-box)) + (format #t "~1Tlocal-player-spheres[12] @ #x~X~%" (-> this local-player-spheres)) + (format #t "~1Tlocal-player-hanging-spheres[6] @ #x~X~%" (-> this local-player-spheres)) + (format #t "~1Tlocal-player-leap-up-spheres[6] @ #x~X~%" (-> this local-player-leap-up-spheres)) (label cfg-4) - obj + this ) ;; definition of type collide-edge-work @@ -295,33 +295,33 @@ ) ;; definition for method 3 of type collide-edge-work -(defmethod inspect collide-edge-work ((obj collide-edge-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-edge-work ((this collide-edge-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-edge-work) - (format #t "~1Tccache: ~A~%" (-> obj ccache)) - (format #t "~1Tcshape: ~A~%" (-> obj cshape)) - (format #t "~1Tnum-verts: ~D~%" (-> obj num-verts)) - (format #t "~1Tnum-edges: ~D~%" (-> obj num-edges)) - (format #t "~1Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~1Tcache-fill-box: #~%" (-> obj cache-fill-box)) - (format #t "~1Twithin-reach-box: #~%" (-> obj within-reach-box)) - (format #t "~1Twithin-reach-box4w: #~%" (-> obj within-reach-box4w)) - (format #t "~1Tsearch-pt: #~%" (-> obj search-pt)) - (format #t "~1Tsearch-dir-vec: #~%" (-> obj search-dir-vec)) - (format #t "~1Tworld-player-spheres[12] @ #x~X~%" (-> obj world-player-spheres)) - (format #t "~1Tworld-player-hanging-spheres[6] @ #x~X~%" (-> obj world-player-spheres)) - (format #t "~1Tworld-player-leap-up-spheres[6] @ #x~X~%" (-> obj world-player-leap-up-spheres)) - (format #t "~1Tspec: #~%" (-> obj spec)) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Tverts[64] @ #x~X~%" (-> obj verts)) - (format #t "~1Tedges[96] @ #x~X~%" (-> obj edges)) - (format #t "~1Ttris[48] @ #x~X~%" (-> obj tris)) - (format #t "~1Thold-list: #~%" (-> obj hold-list)) + (format #t "[~8x] ~A~%" this 'collide-edge-work) + (format #t "~1Tccache: ~A~%" (-> this ccache)) + (format #t "~1Tcshape: ~A~%" (-> this cshape)) + (format #t "~1Tnum-verts: ~D~%" (-> this num-verts)) + (format #t "~1Tnum-edges: ~D~%" (-> this num-edges)) + (format #t "~1Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~1Tcache-fill-box: #~%" (-> this cache-fill-box)) + (format #t "~1Twithin-reach-box: #~%" (-> this within-reach-box)) + (format #t "~1Twithin-reach-box4w: #~%" (-> this within-reach-box4w)) + (format #t "~1Tsearch-pt: #~%" (-> this search-pt)) + (format #t "~1Tsearch-dir-vec: #~%" (-> this search-dir-vec)) + (format #t "~1Tworld-player-spheres[12] @ #x~X~%" (-> this world-player-spheres)) + (format #t "~1Tworld-player-hanging-spheres[6] @ #x~X~%" (-> this world-player-spheres)) + (format #t "~1Tworld-player-leap-up-spheres[6] @ #x~X~%" (-> this world-player-leap-up-spheres)) + (format #t "~1Tspec: #~%" (-> this spec)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tverts[64] @ #x~X~%" (-> this verts)) + (format #t "~1Tedges[96] @ #x~X~%" (-> this edges)) + (format #t "~1Ttris[48] @ #x~X~%" (-> this tris)) + (format #t "~1Thold-list: #~%" (-> this hold-list)) (label cfg-4) - obj + this ) ;; definition for symbol *collide-edge-spec*, type collide-edge-spec diff --git a/test/decompiler/reference/jak2/engine/collide/collide-edge-grab_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab_REF.gc index 6361abee09..75bd095983 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-edge-grab_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab_REF.gc @@ -5,7 +5,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 27 target) has a return type of none, but the expression builder found a return statement. -(defmethod do-edge-grabs target ((obj target) (arg0 collide-cache) (arg1 collide-edge-spec)) +(defmethod do-edge-grabs target ((this target) (arg0 collide-cache) (arg1 collide-edge-spec)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -17,11 +17,11 @@ (set! (-> *edge-grab-info* found-edge?) #f) (mem-copy! (the-as pointer (-> *collide-edge-work* spec)) (the-as pointer arg1) 320) (let ((s5-0 *collide-edge-work*)) - (set! (-> s5-0 process) (the-as (pointer process-drawable) (process->ppointer obj))) + (set! (-> s5-0 process) (the-as (pointer process-drawable) (process->ppointer this))) (set! (-> s5-0 num-verts) (the-as uint 0)) (set! (-> s5-0 num-edges) (the-as uint 0)) (set! (-> s5-0 num-tris) (the-as uint 0)) - (let ((v1-3 (-> obj control))) + (let ((v1-3 (-> this control))) (set! (-> s5-0 ccache) arg0) (.lvf vf1 (&-> s5-0 spec local-cache-fill-box min quad)) (.lvf vf2 (&-> s5-0 spec local-cache-fill-box max quad)) @@ -43,8 +43,8 @@ (.svf (&-> s5-0 within-reach-box4w min quad) vf6) (.svf (&-> s5-0 within-reach-box4w max quad) vf7) (let ((s3-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-0 collide-with) (-> obj control root-prim prim-core collide-with)) - (set! (-> s3-0 ignore-process0) obj) + (set! (-> s3-0 collide-with) (-> this control root-prim prim-core collide-with)) + (set! (-> s3-0 ignore-process0) this) (set! (-> s3-0 ignore-process1) #f) (set! (-> s3-0 ignore-pat) (-> s5-0 spec ignore-pat)) (set! (-> s3-0 action-mask) (collide-action solid)) @@ -55,24 +55,24 @@ (when (nonzero? (-> s5-0 num-tris)) (find-grabbable-edges s5-0) (when (nonzero? (-> s5-0 num-edges)) - (set! (-> s5-0 search-pt quad) (-> obj control midpoint-of-hands quad)) - (when (!= (-> *cpad-list* cpads (-> obj control cpad number) stick0-speed) 0.0) - (set! (-> s5-0 search-dir-vec quad) (-> obj control to-target-pt-xz quad)) + (set! (-> s5-0 search-pt quad) (-> this control midpoint-of-hands quad)) + (when (!= (-> *cpad-list* cpads (-> this control cpad number) stick0-speed) 0.0) + (set! (-> s5-0 search-dir-vec quad) (-> this control to-target-pt-xz quad)) (search-for-edges s5-0 (-> s5-0 hold-list)) (when (find-best-grab! s5-0 (-> s5-0 hold-list) *edge-grab-info*) (set! (-> *edge-grab-info* found-edge?) #t) (if (logtest? (-> s5-0 spec flags) (collide-edge-spec-flags send-event)) - (send-event obj 'edge-grab) + (send-event this 'edge-grab) ) (return #f) ) ) - (vector-z-quaternion! (-> s5-0 search-dir-vec) (-> obj control quat-for-control)) + (vector-z-quaternion! (-> s5-0 search-dir-vec) (-> this control quat-for-control)) (search-for-edges s5-0 (-> s5-0 hold-list)) (when (find-best-grab! s5-0 (-> s5-0 hold-list) *edge-grab-info*) (set! (-> *edge-grab-info* found-edge?) #t) (if (logtest? (-> s5-0 spec flags) (collide-edge-spec-flags send-event)) - (send-event obj 'edge-grab) + (send-event this 'edge-grab) ) ) 0 @@ -87,17 +87,17 @@ ;; definition for method 9 of type collide-edge-work ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 9 collide-edge-work) has a return type of none, but the expression builder found a return statement. -(defmethod search-for-edges collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-list)) +(defmethod search-for-edges collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-list)) (set! (-> arg0 num-allocs) (the-as uint 0)) (set! (-> arg0 num-attempts) (the-as uint 0)) (set! (-> arg0 head) #f) (let ((s4-0 (the-as collide-edge-hold-item (-> arg0 items))) - (s3-0 (the-as collide-edge-edge (-> obj edges))) + (s3-0 (the-as collide-edge-edge (-> this edges))) ) - (countdown (s2-0 (-> obj num-edges)) + (countdown (s2-0 (-> this num-edges)) (when (not (-> s3-0 ignore)) - (compute-center-point! obj s3-0 (-> s4-0 center-pt)) - (when (should-add-to-list? obj s4-0 s3-0) + (compute-center-point! this s3-0 (-> s4-0 center-pt)) + (when (should-add-to-list? this s4-0 s3-0) (add-to-list! arg0 s4-0) (+! (-> arg0 num-allocs) 1) (when (= (-> arg0 num-allocs) 32) @@ -131,18 +131,18 @@ ) ;; definition for method 3 of type pbhp-stack-vars -(defmethod inspect pbhp-stack-vars ((obj pbhp-stack-vars)) - (when (not obj) - (set! obj obj) +(defmethod inspect pbhp-stack-vars ((this pbhp-stack-vars)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pbhp-stack-vars) - (format #t "~1Tedge: #~%" (-> obj edge)) - (format #t "~1Tallocated: ~A~%" (-> obj allocated)) - (format #t "~1Tneg-hold-pt: #~%" (-> obj neg-hold-pt)) - (format #t "~1Tsplit-vec: #~%" (-> obj split-vec)) + (format #t "[~8x] ~A~%" this 'pbhp-stack-vars) + (format #t "~1Tedge: #~%" (-> this edge)) + (format #t "~1Tallocated: ~A~%" (-> this allocated)) + (format #t "~1Tneg-hold-pt: #~%" (-> this neg-hold-pt)) + (format #t "~1Tsplit-vec: #~%" (-> this split-vec)) (label cfg-4) - obj + this ) ;; definition for method 19 of type collide-edge-work @@ -152,7 +152,7 @@ ;; definition for method 20 of type collide-edge-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs symbol. -(defmethod check-grab-for-collisions collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod check-grab-for-collisions collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (local-vars (sv-656 vector) (sv-672 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -182,7 +182,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-1 quad) vf6) ) - (let ((f0-1 (get-best-hand-point obj (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) + (let ((f0-1 (get-best-hand-point this (-> arg1 right-hand-hold) s0-0 (the-as int s4-0)))) (if (< 491.52 f0-1) (return (the-as symbol #f)) ) @@ -200,7 +200,7 @@ (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> sv-672 quad) vf6) - (let ((f0-3 (get-best-hand-point obj (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) + (let ((f0-3 (get-best-hand-point this (-> arg1 left-hand-hold) s0-0 (the-as int s4-0)))) (if (< 491.52 f0-3) (return (the-as symbol #f)) ) @@ -214,7 +214,7 @@ (set! (-> arg1 world-vertex 0 quad) (-> s2-0 vertex-ptr 0 0 quad)) (set! (-> arg1 world-vertex 1 quad) (-> s2-0 vertex-ptr 1 0 quad)) (set! (-> arg1 hanging-matrix vector 1 quad) - (-> (the-as collide-shape-moving (-> obj process 0 root)) dynam gravity-normal quad) + (-> (the-as collide-shape-moving (-> this process 0 root)) dynam gravity-normal quad) ) (vector-normalize! (vector-! (-> arg1 hanging-matrix vector 2) (-> arg1 world-vertex 1) (the-as vector (-> arg1 world-vertex))) @@ -236,30 +236,30 @@ (set! (-> arg1 hanging-matrix trans quad) (-> arg1 center-hold quad)) (transform-vectors! (-> arg1 hanging-matrix) - (-> obj world-player-spheres) - (-> obj spec local-player-spheres) + (-> this world-player-spheres) + (-> this spec local-player-spheres) 12 ) (let ((a1-12 (new 'stack-no-clear 'collide-query))) (let ((v1-28 a1-12)) - (set! (-> v1-28 best-dist) (the-as float (-> obj world-player-spheres))) + (set! (-> v1-28 best-dist) (the-as float (-> this world-player-spheres))) (set! (-> v1-28 num-spheres) (the-as uint 12)) - (set! (-> v1-28 collide-with) (-> obj cshape root-prim prim-core collide-with)) + (set! (-> v1-28 collide-with) (-> this cshape root-prim prim-core collide-with)) (set! (-> v1-28 ignore-process0) #f) (set! (-> v1-28 ignore-process1) #f) (set! (-> v1-28 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-28 best-my-prim) (the-as collide-shape-prim #t)) (set! (-> v1-28 action-mask) (collide-action solid)) ) - (if (probe-using-spheres (-> obj ccache) a1-12) + (if (probe-using-spheres (-> this ccache) a1-12) (return (the-as symbol #f)) ) ) (set! (-> arg1 status) (the-as uint 0)) - (if (logtest? (-> obj spec flags) (collide-edge-spec-flags find-adjacent-edge)) - (find-adjacent-edge obj arg0 arg1) + (if (logtest? (-> this spec flags) (collide-edge-spec-flags find-adjacent-edge)) + (find-adjacent-edge this arg0 arg1) ) - (let* ((v1-41 (the-as object (-> obj ccache prims s4-0 prim))) + (let* ((v1-41 (the-as object (-> this ccache prims s4-0 prim))) (a0-44 (-> (the-as collide-shape-prim v1-41) cshape)) ) (cond @@ -303,25 +303,25 @@ ) ;; definition for method 3 of type faei-stack-vars -(defmethod inspect faei-stack-vars ((obj faei-stack-vars)) - (when (not obj) - (set! obj obj) +(defmethod inspect faei-stack-vars ((this faei-stack-vars)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'faei-stack-vars) - (format #t "~1Thold-edge-vec-norm: #~%" (-> obj hold-edge-vec-norm)) - (format #t "~1Tadj-edge-vec-norm: #~%" (-> obj adj-edge-vec-norm)) - (format #t "~1Tfound-left?: ~A~%" (-> obj found-left?)) - (format #t "~1Tleft-dot: ~f~%" (-> obj left-dot)) - (format #t "~1Tfound-right?: ~A~%" (-> obj found-right?)) - (format #t "~1Tright-dot: ~f~%" (-> obj right-dot)) + (format #t "[~8x] ~A~%" this 'faei-stack-vars) + (format #t "~1Thold-edge-vec-norm: #~%" (-> this hold-edge-vec-norm)) + (format #t "~1Tadj-edge-vec-norm: #~%" (-> this adj-edge-vec-norm)) + (format #t "~1Tfound-left?: ~A~%" (-> this found-left?)) + (format #t "~1Tleft-dot: ~f~%" (-> this left-dot)) + (format #t "~1Tfound-right?: ~A~%" (-> this found-right?)) + (format #t "~1Tright-dot: ~f~%" (-> this right-dot)) (label cfg-4) - obj + this ) ;; definition for method 9 of type collide-edge-edge ;; INFO: Used lq/sq -(defmethod no-collision-at-edge collide-edge-edge ((obj collide-edge-edge) (arg0 collide-edge-work) (arg1 edge-grab-info)) +(defmethod no-collision-at-edge collide-edge-edge ((this collide-edge-edge) (arg0 collide-edge-work) (arg1 edge-grab-info)) (let ((s4-0 (new 'stack-no-clear 'matrix)) (s5-0 (new 'stack-no-clear 'inline-array 'sphere 6)) ) @@ -331,10 +331,10 @@ (set! (-> s4-0 vector 1 quad) (-> (the-as collide-shape-moving (-> arg0 process 0 root)) dynam gravity-normal quad) ) - (vector-normalize! (vector-! (-> s4-0 vector 2) (-> obj vertex-ptr 1 0) (-> obj vertex-ptr 0 0)) 1.0) + (vector-normalize! (vector-! (-> s4-0 vector 2) (-> this vertex-ptr 1 0) (-> this vertex-ptr 0 0)) 1.0) (vector-normalize! (vector-cross! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2) (-> s4-0 vector 1)) 1.0) (vector-cross! (-> s4-0 vector 2) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1)) - (vector-average! (-> s4-0 trans) (-> obj vertex-ptr 1 0) (-> obj vertex-ptr 0 0)) + (vector-average! (-> s4-0 trans) (-> this vertex-ptr 1 0) (-> this vertex-ptr 0 0)) (transform-vectors! s4-0 s5-0 (-> arg0 spec local-player-spheres) 6) (let ((a1-11 (new 'stack-no-clear 'collide-query))) (let ((v1-13 a1-11)) @@ -355,18 +355,18 @@ ;; definition for method 13 of type collide-edge-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod find-adjacent-edge collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) +(defmethod find-adjacent-edge collide-edge-work ((this collide-edge-work) (arg0 collide-edge-hold-item) (arg1 edge-grab-info)) (let ((s5-0 (new 'stack-no-clear 'faei-stack-vars))) (let* ((v1-0 (-> arg0 edge)) (s3-0 (-> v1-0 vertex-ptr 0 0)) (s2-0 (-> v1-0 vertex-ptr 1 0)) - (s1-0 (the-as collide-edge-edge (-> obj edges))) + (s1-0 (the-as collide-edge-edge (-> this edges))) ) (set! (-> s5-0 found-left?) #f) (set! (-> s5-0 found-right?) #f) (vector-! (-> s5-0 hold-edge-vec-norm) s2-0 s3-0) (vector-normalize! (-> s5-0 hold-edge-vec-norm) 1.0) - (countdown (s0-0 (-> obj num-edges)) + (countdown (s0-0 (-> this num-edges)) (when (not (-> s1-0 ignore)) (let ((v1-6 (-> s1-0 vertex-ptr 1 0))) (when (= v1-6 s3-0) @@ -374,7 +374,7 @@ (vector-normalize! (-> s5-0 adj-edge-vec-norm) 1.0) (let ((f30-0 (vector-dot (-> s5-0 adj-edge-vec-norm) (-> s5-0 hold-edge-vec-norm)))) (when (and (or (not (-> s5-0 found-left?)) (< (-> s5-0 left-dot) f30-0) (< -0.7 f30-0)) - (no-collision-at-edge s1-0 obj arg1) + (no-collision-at-edge s1-0 this arg1) ) (set! (-> s5-0 left-dot) f30-0) (set! (-> s5-0 found-left?) #t) @@ -390,7 +390,7 @@ (vector-normalize! (-> s5-0 adj-edge-vec-norm) 1.0) (let ((f30-1 (vector-dot (-> s5-0 adj-edge-vec-norm) (-> s5-0 hold-edge-vec-norm)))) (when (and (or (not (-> s5-0 found-right?)) (< (-> s5-0 right-dot) f30-1) (< -0.7 f30-1)) - (no-collision-at-edge s1-0 obj arg1) + (no-collision-at-edge s1-0 this arg1) ) (set! (-> s5-0 right-dot) f30-1) (set! (-> s5-0 found-right?) #t) @@ -432,11 +432,11 @@ ;; definition for method 15 of type collide-edge-work ;; INFO: Used lq/sq -(defmethod get-best-hand-point collide-edge-work ((obj collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod get-best-hand-point collide-edge-work ((this collide-edge-work) (arg0 vector) (arg1 vector) (arg2 int)) (let ((f30-0 -1.0)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (dotimes (s1-0 (the-as int (-> obj num-edges))) - (let ((v1-4 (-> obj edges s1-0))) + (dotimes (s1-0 (the-as int (-> this num-edges))) + (let ((v1-4 (-> this edges s1-0))) (when (not (-> v1-4 ignore)) (when (= (-> v1-4 etri ctri prim-index) arg2) (let ((f0-0 (vector-segment-distance-point! arg1 (-> v1-4 vertex-ptr 0 0) (-> v1-4 vertex-ptr 1 0) s2-0))) @@ -459,7 +459,7 @@ (defmethod-mips2c "(method 18 collide-edge-work)" 18 collide-edge-work) ;; definition for method 14 of type collide-edge-work -(defmethod compute-center-point! collide-edge-work ((obj collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) +(defmethod compute-center-point! collide-edge-work ((this collide-edge-work) (arg0 collide-edge-edge) (arg1 vector)) (local-vars (v1-1 float) (v1-2 float) (v1-3 float)) (rlet ((Q :class vf) (vf0 :class vf) @@ -477,7 +477,7 @@ ) (init-vf0-vector) (.mov.vf vf7 vf0) - (.lvf vf1 (&-> obj search-pt quad)) + (.lvf vf1 (&-> this search-pt quad)) (let ((f0-0 0.0)) (let ((v1-0 (-> arg0 vertex-ptr 0)) (a0-1 (-> arg0 vertex-ptr 1)) @@ -527,12 +527,12 @@ ;; definition for method 10 of type edge-grab-info ;; WARN: Return type mismatch object vs none. -(defmethod debug-draw edge-grab-info ((obj edge-grab-info)) +(defmethod debug-draw edge-grab-info ((this edge-grab-info)) (add-debug-line #t (bucket-id debug-no-zbuf1) - (the-as vector (-> obj world-vertex)) - (-> obj world-vertex 1) + (the-as vector (-> this world-vertex)) + (-> this world-vertex 1) (new 'static 'rgba :r #xff :a #x60) #f (the-as rgba -1) @@ -540,41 +540,41 @@ (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj center-hold) + (-> this center-hold) (meters 0.05) (new 'static 'rgba :r #xff :g #xff :a #x80) ) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj left-hand-hold) + (-> this left-hand-hold) (meters 0.05) (new 'static 'rgba :r #xff :g #xff :a #x60) ) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj right-hand-hold) + (-> this right-hand-hold) (meters 0.05) (new 'static 'rgba :r #xff :g #xff :a #x60) ) - (if (logtest? (-> obj status) 1) + (if (logtest? (-> this status) 1) (add-debug-line #t (bucket-id debug-no-zbuf1) - (-> obj adjacent-edge-left-vertex) - (the-as vector (-> obj world-vertex)) + (-> this adjacent-edge-left-vertex) + (the-as vector (-> this world-vertex)) (new 'static 'rgba :r #x80 :a #x60) #f (the-as rgba -1) ) ) - (if (logtest? (-> obj status) 2) + (if (logtest? (-> this status) 2) (add-debug-line #t (bucket-id debug-no-zbuf1) - (-> obj world-vertex 1) - (-> obj adjacent-edge-right-vertex) + (-> this world-vertex 1) + (-> this adjacent-edge-right-vertex) (new 'static 'rgba :r #x80 :a #x60) #f (the-as rgba -1) @@ -583,15 +583,15 @@ (add-debug-outline-triangle #t (bucket-id debug-no-zbuf1) - (the-as vector (-> obj tri-vertex)) - (-> obj world-vertex 4) - (-> obj world-vertex 5) + (the-as vector (-> this tri-vertex)) + (-> this world-vertex 4) + (-> this world-vertex 5) (new 'static 'rgba :r #xff :a #x30) ) (cond - ((nonzero? (-> obj actor-cshape-prim-offset)) - (if (handle->process (-> obj actor-handle)) - (format *stdcon* "grab: ~A~%" (-> obj actor-handle process 0 name)) + ((nonzero? (-> this actor-cshape-prim-offset)) + (if (handle->process (-> this actor-handle)) + (format *stdcon* "grab: ~A~%" (-> this actor-handle process 0 name)) (format *stdcon* "grab: invalid handle~%") ) ) @@ -604,11 +604,11 @@ ;; definition for method 10 of type collide-edge-work ;; INFO: Used lq/sq -(defmethod debug-draw-edges collide-edge-work ((obj collide-edge-work)) +(defmethod debug-draw-edges collide-edge-work ((this collide-edge-work)) (local-vars (sv-32 (function _varargs_ object))) (let ((gp-0 0)) - (dotimes (s4-0 (the-as int (-> obj num-edges))) - (let* ((v1-3 (-> obj edges s4-0)) + (dotimes (s4-0 (the-as int (-> this num-edges))) + (let* ((v1-3 (-> this edges s4-0)) (a2-0 (-> v1-3 vertex-ptr 0 0)) (a3-0 (-> v1-3 vertex-ptr 1 0)) (s3-0 (new 'stack-no-clear 'vector)) @@ -655,15 +655,15 @@ ) ) ) - (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> obj num-edges) (the-as uint gp-0)) gp-0) + (format *stdcon* "found ~D edges (and ~D ignored)~%" (- (-> this num-edges) (the-as uint gp-0)) gp-0) ) ) ;; definition for method 12 of type collide-edge-work ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-sphere collide-edge-work ((obj collide-edge-work)) - (dotimes (s5-0 (the-as int (-> obj num-verts))) - (let ((a2-0 (-> obj verts s5-0))) +(defmethod debug-draw-sphere collide-edge-work ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-verts))) + (let ((a2-0 (-> this verts s5-0))) (add-debug-sphere #t (bucket-id debug-no-zbuf1) a2-0 (meters 0.2) (new 'static 'rgba :r #xff :g #xff :a #x80)) ) ) @@ -673,8 +673,8 @@ ;; definition for method 9 of type collide-edge-hold-list ;; INFO: Used lq/sq -(defmethod debug-draw collide-edge-hold-list ((obj collide-edge-hold-list)) - (let ((s4-0 (-> obj head)) +(defmethod debug-draw collide-edge-hold-list ((this collide-edge-hold-list)) + (let ((s4-0 (-> this head)) (s5-0 0) ) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -725,23 +725,23 @@ ) (format *stdcon* "hold list has ~D item(s)~%" s5-0) ) - (dotimes (s5-1 (the-as int (-> obj num-attempts))) + (dotimes (s5-1 (the-as int (-> this num-attempts))) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (the-as vector (-> obj attempts s5-1)) + (the-as vector (-> this attempts s5-1)) (meters 0.1) (new 'static 'rgba :a #x40) ) ) - (format *stdcon* "hold list has ~D attempt(s)~%" (-> obj num-attempts)) + (format *stdcon* "hold list has ~D attempt(s)~%" (-> this num-attempts)) ) ;; definition for method 11 of type collide-edge-work ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-tris collide-edge-work ((obj collide-edge-work)) - (dotimes (s5-0 (the-as int (-> obj num-tris))) - (let* ((v1-3 (-> obj tris s5-0 ctri)) +(defmethod debug-draw-tris collide-edge-work ((this collide-edge-work)) + (dotimes (s5-0 (the-as int (-> this num-tris))) + (let* ((v1-3 (-> this tris s5-0 ctri)) (t1-0 (copy-and-set-field (-> *pat-mode-info* (-> v1-3 pat mode) color) a 64)) ) (add-debug-outline-triangle diff --git a/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc index d3ec62d657..c106480704 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc @@ -11,20 +11,20 @@ ;; definition for method 3 of type collide-frag-vertex ;; INFO: Used lq/sq -(defmethod inspect collide-frag-vertex ((obj collide-frag-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-frag-vertex ((this collide-frag-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-frag-vertex) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'collide-frag-vertex) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type collide-frag-mesh @@ -45,23 +45,23 @@ ) ;; definition for method 3 of type collide-frag-mesh -(defmethod inspect collide-frag-mesh ((obj collide-frag-mesh)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-frag-mesh ((this collide-frag-mesh)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tpacked-data: #x~X~%" (-> obj packed-data)) - (format #t "~1Tpat-array: #x~X~%" (-> obj pat-array)) - (format #t "~1Tstrip-data-len: ~D~%" (-> obj strip-data-len)) - (format #t "~1Tpoly-count: ~D~%" (-> obj poly-count)) - (format #t "~1Tbase-trans: #~%" (-> obj base-trans)) - (format #t "~1Tvertex-count: ~D~%" (-> obj vertex-count)) - (format #t "~1Tvertex-data-qwc: ~D~%" (-> obj vertex-data-qwc)) - (format #t "~1Ttotal-qwc: ~D~%" (-> obj total-qwc)) - (format #t "~1Tunused: ~D~%" (-> obj unused)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tpacked-data: #x~X~%" (-> this packed-data)) + (format #t "~1Tpat-array: #x~X~%" (-> this pat-array)) + (format #t "~1Tstrip-data-len: ~D~%" (-> this strip-data-len)) + (format #t "~1Tpoly-count: ~D~%" (-> this poly-count)) + (format #t "~1Tbase-trans: #~%" (-> this base-trans)) + (format #t "~1Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~1Tvertex-data-qwc: ~D~%" (-> this vertex-data-qwc)) + (format #t "~1Ttotal-qwc: ~D~%" (-> this total-qwc)) + (format #t "~1Tunused: ~D~%" (-> this unused)) (label cfg-4) - obj + this ) ;; definition of type collide-fragment @@ -75,18 +75,18 @@ ) ;; definition for method 3 of type collide-fragment -(defmethod inspect collide-fragment ((obj collide-fragment)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-fragment ((this collide-fragment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tmesh: ~A~%" (-> obj mesh)) - (format #t "~1Tcollide-new: ~A~%" (-> obj collide-new)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tcollide-new: ~A~%" (-> this collide-new)) (label cfg-4) - obj + this ) ;; definition of type drawable-inline-array-collide-fragment @@ -100,18 +100,18 @@ ) ;; definition for method 3 of type drawable-inline-array-collide-fragment -(defmethod inspect drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment)) - (when (not obj) - (set! obj obj) +(defmethod inspect drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[1] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type drawable-tree-collide-fragment @@ -124,7 +124,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/collide/collide-frag_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-frag_REF.gc index aa9e84cb51..21cb9ec47a 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-frag_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-frag_REF.gc @@ -2,16 +2,16 @@ (in-package goal) ;; definition for method 9 of type drawable-tree-collide-fragment -(defmethod login drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment)) - obj +(defmethod login drawable-tree-collide-fragment ((this drawable-tree-collide-fragment)) + this ) ;; definition for method 10 of type drawable-tree-collide-fragment ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) +(defmethod draw drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 drawable-tree-collide-fragment) (arg1 display-frame)) (when *display-render-collision* - (dotimes (s4-0 (-> obj length)) - (draw (-> obj data s4-0) (-> obj data s4-0) arg1) + (dotimes (s4-0 (-> this length)) + (draw (-> this data s4-0) (-> this data s4-0) arg1) ) ) 0 @@ -19,23 +19,23 @@ ) ;; definition for method 15 of type drawable-tree-collide-fragment -(defmethod unpack-vis drawable-tree-collide-fragment ((obj drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree-collide-fragment ((this drawable-tree-collide-fragment) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) ;; definition for method 8 of type collide-fragment ;; WARN: Return type mismatch int vs collide-fragment. -(defmethod mem-usage collide-fragment ((obj collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-fragment ((this collide-fragment) (arg0 memory-usage-block) (arg1 int)) (let ((s5-0 (if (logtest? arg1 1) 54 50 ) ) - (s4-0 (-> obj mesh)) + (s4-0 (-> this mesh)) ) (set! (-> arg0 data s5-0 name) (symbol->string 'collide-fragment)) (+! (-> arg0 data s5-0 count) 1) - (let ((v1-11 (+ (asize-of obj) (asize-of s4-0)))) + (let ((v1-11 (+ (asize-of this) (asize-of s4-0)))) (+! (-> arg0 data s5-0 used) v1-11) (+! (-> arg0 data s5-0 total) (logand -16 (+ v1-11 15))) ) @@ -58,25 +58,25 @@ ) ;; definition for method 9 of type drawable-inline-array-collide-fragment -(defmethod login drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment)) - obj +(defmethod login drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment)) + this ) ;; definition for method 10 of type collide-fragment ;; WARN: Return type mismatch int vs none. -(defmethod draw collide-fragment ((obj collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) +(defmethod draw collide-fragment ((this collide-fragment) (arg0 collide-fragment) (arg1 display-frame)) 0 (none) ) ;; definition for method 10 of type drawable-inline-array-collide-fragment ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) +(defmethod draw drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 drawable-inline-array-collide-fragment) (arg1 display-frame) ) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj data s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this data s4-0))) (if (sphere-cull (-> s3-0 bsphere)) (draw s3-0 s3-0 arg1) ) @@ -87,7 +87,7 @@ ) ;; definition for method 8 of type drawable-inline-array-collide-fragment -(defmethod mem-usage drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-collide-fragment ((this drawable-inline-array-collide-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -95,12 +95,8 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) - - - - diff --git a/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc index 25c973de89..eedec520b0 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc @@ -49,51 +49,51 @@ ) ;; definition for method 3 of type collide-query -(defmethod inspect collide-query ((obj collide-query)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-query ((this collide-query)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-query) - (format #t "~1Tbest-other-tri: #~%" (-> obj best-other-tri)) - (format #t "~1Tbest-my-tri: #~%" (-> obj best-other-tri)) - (format #t "~1Tignore-processes[2] @ #x~X~%" (-> obj ignore-processes)) - (format #t "~1Tignore-process0: ~A~%" (-> obj ignore-process0)) - (format #t "~1Tignore-process1: ~A~%" (-> obj ignore-process1)) - (format #t "~1Tignore-pat: ~D~%" (-> obj ignore-pat)) - (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~1Toverlay-params[3] @ #x~X~%" (&-> obj best-dist)) - (format #t "~1Tbbox: #~%" (-> obj bbox)) - (format #t "~1Tbbox4w: #~%" (-> obj bbox4w)) - (format #t "~1Tbsphere: #~%" (-> obj bsphere)) - (format #t "~1Tstart-pos: #~%" (-> obj start-pos)) - (format #t "~1Tmove-dist: #~%" (-> obj move-dist)) - (format #t "~1Trlength: #~%" (-> obj rlength)) - (format #t "~1Texit-planes[2] @ #x~X~%" (-> obj exit-planes)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) - (format #t "~1Tinv-mat: #~%" (-> obj inv-mat)) - (format #t "~1Tspheres: #x~X~%" (-> obj best-dist)) - (format #t "~1Tnum-spheres: ~D~%" (-> obj num-spheres)) - (format #t "~1Tsolid-only: ~A~%" (-> obj best-my-prim)) - (format #t "~1Tbest-dist: ~f~%" (the-as float (-> obj best-dist))) - (format #t "~1Tbest-other-prim: ~A~%" (-> obj num-spheres)) - (format #t "~1Tbest-my-prim: ~A~%" (-> obj best-my-prim)) - (format #t "~1Tmove-vec: #~%" (-> obj move-dist)) - (format #t "~1Tbest-u: ~f~%" (the-as float (-> obj best-dist))) - (format #t "~1Taction-mask: ~D~%" (-> obj action-mask)) - (format #t "~1Tlocal-box4w: #~%" (-> obj local-box4w)) - (format #t "~1Tsearch-box: #~%" (-> obj search-box)) - (format #t "~1Tsearch-vector: #~%" (-> obj search-vector)) - (format #t "~1Tinstance-mat: #~%" (-> obj instance-mat)) - (format #t "~1Tinstance-ptr: ~A~%" (-> obj instance-ptr)) - (format #t "~1Tx-addr: ~D~%" (-> obj x-addr)) - (format #t "~1Tx-step: ~D~%" (-> obj x-step)) - (format #t "~1Ty-addr: ~D~%" (-> obj y-addr)) - (format #t "~1Ty-step: ~D~%" (-> obj y-step)) - (format #t "~1Tz-addr: ~D~%" (-> obj z-addr)) - (format #t "~1Tz-step: ~D~%" (-> obj z-step)) + (format #t "[~8x] ~A~%" this 'collide-query) + (format #t "~1Tbest-other-tri: #~%" (-> this best-other-tri)) + (format #t "~1Tbest-my-tri: #~%" (-> this best-other-tri)) + (format #t "~1Tignore-processes[2] @ #x~X~%" (-> this ignore-processes)) + (format #t "~1Tignore-process0: ~A~%" (-> this ignore-process0)) + (format #t "~1Tignore-process1: ~A~%" (-> this ignore-process1)) + (format #t "~1Tignore-pat: ~D~%" (-> this ignore-pat)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~1Toverlay-params[3] @ #x~X~%" (&-> this best-dist)) + (format #t "~1Tbbox: #~%" (-> this bbox)) + (format #t "~1Tbbox4w: #~%" (-> this bbox4w)) + (format #t "~1Tbsphere: #~%" (-> this bsphere)) + (format #t "~1Tstart-pos: #~%" (-> this start-pos)) + (format #t "~1Tmove-dist: #~%" (-> this move-dist)) + (format #t "~1Trlength: #~%" (-> this rlength)) + (format #t "~1Texit-planes[2] @ #x~X~%" (-> this exit-planes)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tinv-mat: #~%" (-> this inv-mat)) + (format #t "~1Tspheres: #x~X~%" (-> this best-dist)) + (format #t "~1Tnum-spheres: ~D~%" (-> this num-spheres)) + (format #t "~1Tsolid-only: ~A~%" (-> this best-my-prim)) + (format #t "~1Tbest-dist: ~f~%" (the-as float (-> this best-dist))) + (format #t "~1Tbest-other-prim: ~A~%" (-> this num-spheres)) + (format #t "~1Tbest-my-prim: ~A~%" (-> this best-my-prim)) + (format #t "~1Tmove-vec: #~%" (-> this move-dist)) + (format #t "~1Tbest-u: ~f~%" (the-as float (-> this best-dist))) + (format #t "~1Taction-mask: ~D~%" (-> this action-mask)) + (format #t "~1Tlocal-box4w: #~%" (-> this local-box4w)) + (format #t "~1Tsearch-box: #~%" (-> this search-box)) + (format #t "~1Tsearch-vector: #~%" (-> this search-vector)) + (format #t "~1Tinstance-mat: #~%" (-> this instance-mat)) + (format #t "~1Tinstance-ptr: ~A~%" (-> this instance-ptr)) + (format #t "~1Tx-addr: ~D~%" (-> this x-addr)) + (format #t "~1Tx-step: ~D~%" (-> this x-step)) + (format #t "~1Ty-addr: ~D~%" (-> this y-addr)) + (format #t "~1Ty-step: ~D~%" (-> this y-step)) + (format #t "~1Tz-addr: ~D~%" (-> this z-addr)) + (format #t "~1Tz-step: ~D~%" (-> this z-step)) (label cfg-4) - obj + this ) ;; definition for symbol *collide-test-flag*, type symbol diff --git a/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc index dd7039f838..6d2a4a8d91 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc @@ -15,19 +15,19 @@ ) ;; definition for method 3 of type collide-tri-result -(defmethod inspect collide-tri-result ((obj collide-tri-result)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-tri-result ((this collide-tri-result)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-tri-result) - (format #t "~1Tvertex[3] @ #x~X~%" (-> obj vertex)) - (format #t "~1Tintersect: ~`vector`P~%" (-> obj intersect)) - (format #t "~1Tnormal: ~`vector`P~%" (-> obj normal)) - (format #t "~1Tpat: ~D~%" (-> obj pat)) - (format #t "~1Tcollide-ptr: ~A~%" (-> obj collide-ptr)) + (format #t "[~8x] ~A~%" this 'collide-tri-result) + (format #t "~1Tvertex[3] @ #x~X~%" (-> this vertex)) + (format #t "~1Tintersect: ~`vector`P~%" (-> this intersect)) + (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~1Tpat: ~D~%" (-> this pat)) + (format #t "~1Tcollide-ptr: ~A~%" (-> this collide-ptr)) (label cfg-4) - obj + this ) ;; definition of type collide-mesh-tri @@ -43,17 +43,17 @@ ) ;; definition for method 3 of type collide-mesh-tri -(defmethod inspect collide-mesh-tri ((obj collide-mesh-tri)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-mesh-tri ((this collide-mesh-tri)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-mesh-tri) - (format #t "~1Tvertex-index[3] @ #x~X~%" (-> obj vertex-index)) - (format #t "~1Tunused: ~D~%" (-> obj unused)) - (format #t "~1Tpat: ~D~%" (-> obj pat)) + (format #t "[~8x] ~A~%" this 'collide-mesh-tri) + (format #t "~1Tvertex-index[3] @ #x~X~%" (-> this vertex-index)) + (format #t "~1Tunused: ~D~%" (-> this unused)) + (format #t "~1Tpat: ~D~%" (-> this pat)) (label cfg-4) - obj + this ) ;; definition of type collide-mesh @@ -79,19 +79,19 @@ ) ;; definition for method 3 of type collide-mesh -(defmethod inspect collide-mesh ((obj collide-mesh)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-mesh ((this collide-mesh)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tjoint-id: ~D~%" (-> obj joint-id)) - (format #t "~1Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~1Tnum-verts: ~D~%" (-> obj num-verts)) - (format #t "~1Tvertex-data: #x~X~%" (-> obj vertex-data)) - (format #t "~1Ttris[1] @ #x~X~%" (-> obj tris)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tjoint-id: ~D~%" (-> this joint-id)) + (format #t "~1Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~1Tnum-verts: ~D~%" (-> this num-verts)) + (format #t "~1Tvertex-data: #x~X~%" (-> this vertex-data)) + (format #t "~1Ttris[1] @ #x~X~%" (-> this tris)) (label cfg-4) - obj + this ) ;; definition of type collide-mesh-cache-tri @@ -107,18 +107,18 @@ ) ;; definition for method 3 of type collide-mesh-cache-tri -(defmethod inspect collide-mesh-cache-tri ((obj collide-mesh-cache-tri)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-mesh-cache-tri ((this collide-mesh-cache-tri)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-mesh-cache-tri) - (format #t "~1Tvertex[3] @ #x~X~%" (-> obj vertex)) - (format #t "~1Tnormal: ~`vector`P~%" (-> obj normal)) - (format #t "~1Tbbox4w: #~%" (-> obj bbox4w)) - (format #t "~1Tpat: ~D~%" (-> obj pat)) + (format #t "[~8x] ~A~%" this 'collide-mesh-cache-tri) + (format #t "~1Tvertex[3] @ #x~X~%" (-> this vertex)) + (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~1Tbbox4w: #~%" (-> this bbox4w)) + (format #t "~1Tpat: ~D~%" (-> this pat)) (label cfg-4) - obj + this ) ;; definition of type collide-mesh-cache-entry @@ -132,16 +132,16 @@ ) ;; definition for method 3 of type collide-mesh-cache-entry -(defmethod inspect collide-mesh-cache-entry ((obj collide-mesh-cache-entry)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-mesh-cache-entry ((this collide-mesh-cache-entry)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-mesh-cache-entry) - (format #t "~1Tmat: #~%" (-> obj mat)) - (format #t "~1Ttris[0] @ #x~X~%" (-> obj tris)) + (format #t "[~8x] ~A~%" this 'collide-mesh-cache-entry) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Ttris[0] @ #x~X~%" (-> this tris)) (label cfg-4) - obj + this ) ;; definition of type collide-mesh-cache @@ -163,26 +163,26 @@ ) ;; definition for method 3 of type collide-mesh-cache -(defmethod inspect collide-mesh-cache ((obj collide-mesh-cache)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-mesh-cache ((this collide-mesh-cache)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tused-size: ~D~%" (-> obj used-size)) - (format #t "~1Tmax-size: ~D~%" (-> obj max-size)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tdata[48000] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tused-size: ~D~%" (-> this used-size)) + (format #t "~1Tmax-size: ~D~%" (-> this max-size)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tdata[48000] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for method 11 of type collide-mesh-cache ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for method 10 of type collide-mesh-cache -(defmethod is-id? collide-mesh-cache ((obj collide-mesh-cache) (arg0 int)) - (= (-> obj id) arg0) +(defmethod is-id? collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) + (= (-> this id) arg0) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/collide/collide-mesh_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-mesh_REF.gc index 61664fda96..ce2b5c5acf 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-mesh_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-mesh_REF.gc @@ -3,24 +3,24 @@ ;; definition for method 5 of type collide-mesh ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of collide-mesh ((obj collide-mesh)) - (the-as int (+ (-> collide-mesh size) (* (+ (-> obj num-tris) -1) 8))) +(defmethod asize-of collide-mesh ((this collide-mesh)) + (the-as int (+ (-> collide-mesh size) (* (+ (-> this num-tris) -1) 8))) ) ;; definition for method 8 of type collide-mesh ;; WARN: Return type mismatch int vs collide-mesh. -(defmethod mem-usage collide-mesh ((obj collide-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-mesh ((this collide-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "collide-mesh") (+! (-> arg0 data 81 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 81 used) v1-6) (+! (-> arg0 data 81 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 82 (-> arg0 length))) (set! (-> arg0 data 81 name) "collide-mesh") (+! (-> arg0 data 81 count) 1) - (let ((v1-16 (* (-> obj num-verts) 16))) + (let ((v1-16 (* (-> this num-verts) 16))) (+! (-> arg0 data 81 used) v1-16) (+! (-> arg0 data 81 total) (logand -16 (+ v1-16 15))) ) @@ -29,7 +29,7 @@ ;; definition for method 9 of type collide-mesh ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-tris collide-mesh ((obj collide-mesh) (arg0 process-drawable) (arg1 int)) +(defmethod debug-draw-tris collide-mesh ((this collide-mesh) (arg0 process-drawable) (arg1 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -41,10 +41,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (the-as object (-> obj tris))) + (let ((s5-0 (the-as object (-> this tris))) (s4-0 (-> arg0 node-list data arg1 bone transform)) ) - (countdown (s3-0 (-> obj num-tris)) + (countdown (s3-0 (-> this num-tris)) (let ((a2-1 (new 'stack-no-clear 'vector)) (a3-0 (new 'stack-no-clear 'vector)) (t0-0 (new 'stack-no-clear 'vector)) @@ -53,9 +53,9 @@ (.lvf vf5 (&-> s4-0 quad 1)) (.lvf vf6 (&-> s4-0 quad 2)) (.lvf vf7 (&-> s4-0 trans quad)) - (.lvf vf1 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) - (.lvf vf2 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) - (.lvf vf3 (&-> (-> obj vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 2)) quad)) + (.lvf vf1 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 0)) quad)) + (.lvf vf2 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 1)) quad)) + (.lvf vf3 (&-> (-> this vertex-data (-> (the-as collide-mesh-tri s5-0) vertex-index 2)) quad)) (let ((t1-0 (copy-and-set-field (-> *pat-mode-info* (-> (the-as collide-mesh-tri s5-0) pat mode) color) a 16))) (.mul.w.vf acc vf7 vf0) (.add.mul.x.vf acc vf4 vf1 acc) @@ -94,16 +94,16 @@ ) ;; definition for method 3 of type sopt-work -(defmethod inspect sopt-work ((obj sopt-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect sopt-work ((this sopt-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sopt-work) - (format #t "~1Tintersect: #~%" (-> obj intersect)) - (format #t "~1Tsphere-bbox4w: #~%" (-> obj sphere-bbox4w)) + (format #t "[~8x] ~A~%" this 'sopt-work) + (format #t "~1Tintersect: #~%" (-> this intersect)) + (format #t "~1Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) (label cfg-4) - obj + this ) ;; definition for method 12 of type collide-mesh @@ -121,16 +121,16 @@ ) ;; definition for method 3 of type spat-work -(defmethod inspect spat-work ((obj spat-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect spat-work ((this spat-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'spat-work) - (format #t "~1Tintersect: #~%" (-> obj intersect)) - (format #t "~1Tsphere-bbox4w: #~%" (-> obj sphere-bbox4w)) + (format #t "[~8x] ~A~%" this 'spat-work) + (format #t "~1Tintersect: #~%" (-> this intersect)) + (format #t "~1Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) (label cfg-4) - obj + this ) ;; definition for method 11 of type collide-mesh @@ -151,7 +151,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] ;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] ;; ERROR: Unsupported inline assembly instruction kind - [pxor a0, a0, a1] -(defmethod populate-for-prim-mesh collide-mesh-cache ((obj collide-mesh-cache) (arg0 collide-shape-prim-mesh)) +(defmethod populate-for-prim-mesh collide-mesh-cache ((this collide-mesh-cache) (arg0 collide-shape-prim-mesh)) (local-vars (r0-0 uint128) (v1-7 uint128) @@ -168,7 +168,7 @@ (s4-0 (-> arg0 mesh-cache-entry)) ) (cond - ((= (-> arg0 mesh-cache-id) (-> obj id)) + ((= (-> arg0 mesh-cache-id) (-> this id)) (let ((v1-6 (-> s5-0 quad 0)) (a0-4 (-> s4-0 mat quad 0)) ) @@ -207,11 +207,11 @@ (else (let ((v1-19 (-> arg0 mesh))) (when v1-19 - (set! s4-0 (allocate! obj (+ (* (the-as uint 96) (-> v1-19 num-tris)) 64))) + (set! s4-0 (allocate! this (+ (* (the-as uint 96) (-> v1-19 num-tris)) 64))) (set! (-> arg0 mesh-cache-entry) s4-0) (cond (s4-0 - (set! (-> arg0 mesh-cache-id) (-> obj id)) + (set! (-> arg0 mesh-cache-id) (-> this id)) (set! (-> s4-0 mat quad 0) (-> s5-0 quad 0)) (set! (-> s4-0 mat quad 1) (-> s5-0 quad 1)) (set! (-> s4-0 mat quad 2) (-> s5-0 quad 2)) @@ -233,18 +233,18 @@ ;; definition for method 12 of type collide-mesh-cache ;; WARN: Return type mismatch (pointer uint8) vs collide-mesh-cache-entry. -(defmethod allocate! collide-mesh-cache ((obj collide-mesh-cache) (arg0 int)) +(defmethod allocate! collide-mesh-cache ((this collide-mesh-cache) (arg0 int)) (local-vars (a1-2 int) (a2-2 int)) (let* ((v1-0 (+ arg0 15)) - (a1-1 (-> obj used-size)) + (a1-1 (-> this used-size)) (v1-1 (/ v1-0 16)) - (a3-0 (-> obj data)) - (a2-0 (-> obj max-size)) + (a3-0 (-> this data)) + (a2-0 (-> this max-size)) (v1-2 (* v1-1 16)) (a3-1 (&+ a3-0 a1-1)) ) (let ((t1-0 (- a2-0 (the-as uint v1-2))) - (t0-0 (-> obj id)) + (t0-0 (-> this id)) ) (b! (< (the-as int t1-0) 0) cfg-6 :delay (set! a1-2 (the-as int (+ a1-1 v1-2)))) (b! (>= (the-as int (- a2-0 (the-as uint a1-2))) 0) cfg-5 :delay (set! a2-2 (the-as int (+ t0-0 1)))) @@ -252,10 +252,10 @@ (b! (zero? (the-as uint a2-2)) cfg-4 :likely-delay (set! a2-2 1)) (label cfg-4) (set! a1-2 v1-2) - (set! a3-1 (-> obj data)) - (set! (-> obj id) (the-as uint a2-2)) + (set! a3-1 (-> this data)) + (set! (-> this id) (the-as uint a2-2)) (label cfg-5) - (set! (-> obj used-size) (the-as uint a1-2)) + (set! (-> this used-size) (the-as uint a1-2)) (let ((v0-0 a3-1)) (b! #t cfg-7 :delay (nop!)) (label cfg-6) @@ -269,13 +269,8 @@ ;; definition for method 13 of type collide-mesh ;; WARN: Return type mismatch int vs none. -;; WARN: Failed load: (set! vf6 (l.vf (+ (the-as vector a3-0) 16))) at op 37 -;; WARN: Failed load: (set! vf7 (l.vf (+ (the-as vector a3-0) 32))) at op 45 -;; WARN: Failed load: (set! vf8 (l.vf (+ (the-as vector a3-0) 48))) at op 53 -;; WARN: Failed load: (set! vf1 (l.vf t0-4)) at op 77 -;; WARN: Failed load: (set! vf2 (l.vf t1-1)) at op 79 -;; WARN: Failed load: (set! vf3 (l.vf t2-2)) at op 81 -(defmethod unpack-mesh-to-cache! collide-mesh ((obj collide-mesh) (arg0 (inline-array collide-mesh-cache-tri)) (arg1 matrix)) +;; ERROR: Failed load: (set! vf6 (l.vf (+ (the-as vector a3-0) 16))) at op 37 +(defmethod unpack-mesh-to-cache! collide-mesh ((this collide-mesh) (arg0 (inline-array collide-mesh-cache-tri)) (arg1 matrix)) (local-vars (t0-2 uint)) (rlet ((acc :class vf) (Q :class vf) @@ -296,10 +291,10 @@ (init-vf0-vector) (nop!) (let ((t0-0 #x70000000) - (v1-0 (-> obj num-verts)) + (v1-0 (-> this num-verts)) ) (nop!) - (let ((a3-0 (the-as object (-> obj vertex-data)))) + (let ((a3-0 (the-as object (-> this vertex-data)))) (b! (zero? v1-0) cfg-3 :delay (.lvf vf1 (&-> arg1 quad 0))) (nop!) (.lvf vf2 (&-> arg1 quad 1)) @@ -361,10 +356,10 @@ ) ) (label cfg-3) - (let ((v1-1 (the-as object (-> obj tris)))) + (let ((v1-1 (the-as object (-> this tris)))) (nop!) (let ((a2-1 #x70000000) - (a0-1 (-> obj num-tris)) + (a0-1 (-> this num-tris)) ) (b! (zero? a0-1) cfg-6 :delay (set! t0-2 (-> (the-as (inline-array collide-mesh-tri) v1-1) 0 vertex-index 0))) (let* ((a1-1 (-> arg0 -1)) @@ -454,21 +449,21 @@ ) ;; definition for method 3 of type oot-work -(defmethod inspect oot-work ((obj oot-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect oot-work ((this oot-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'oot-work) - (format #t "~1Tintersect: #~%" (-> obj intersect)) - (format #t "~1Tsphere-bbox4w: #~%" (-> obj sphere-bbox4w)) + (format #t "[~8x] ~A~%" this 'oot-work) + (format #t "~1Tintersect: #~%" (-> this intersect)) + (format #t "~1Tsphere-bbox4w: #~%" (-> this sphere-bbox4w)) (label cfg-4) - obj + this ) ;; definition for method 10 of type collide-mesh ;; INFO: Used lq/sq -(defmethod overlap-test collide-mesh ((obj collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) +(defmethod overlap-test collide-mesh ((this collide-mesh) (arg0 collide-mesh-cache-tri) (arg1 vector)) (local-vars (v1-0 uint128) (a0-1 uint128) @@ -493,7 +488,7 @@ (s4-0 arg0) ) (.lvf vf2 (&-> arg1 quad)) - (let ((s3-0 (-> obj num-tris))) + (let ((s3-0 (-> this num-tris))) (.sub.w.vf vf5 vf2 vf2) (.add.w.vf vf6 vf2 vf2) (.ftoi.vf vf5 vf5) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc index 66c377f0e3..6afd8431b0 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type collide-rider -(defmethod inspect collide-rider ((obj collide-rider)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-rider ((this collide-rider)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-rider) - (format #t "~1Trider-handle: ~D~%" (-> obj rider-handle)) - (format #t "~1Tsticky-prim: ~A~%" (-> obj sticky-prim)) - (format #t "~1Tprim-ry: ~f~%" (-> obj prim-ry)) - (format #t "~1Trider-local-pos: #~%" (-> obj rider-local-pos)) + (format #t "[~8x] ~A~%" this 'collide-rider) + (format #t "~1Trider-handle: ~D~%" (-> this rider-handle)) + (format #t "~1Tsticky-prim: ~A~%" (-> this sticky-prim)) + (format #t "~1Tprim-ry: ~f~%" (-> this prim-ry)) + (format #t "~1Trider-local-pos: #~%" (-> this rider-local-pos)) (label cfg-4) - obj + this ) ;; definition of type collide-rider-pool @@ -43,23 +43,23 @@ ) ;; definition for method 3 of type collide-rider-pool -(defmethod inspect collide-rider-pool ((obj collide-rider-pool)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-rider-pool ((this collide-rider-pool)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Talloc-count: ~D~%" (-> obj alloc-count)) - (format #t "~1Triders[20] @ #x~X~%" (-> obj riders)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Talloc-count: ~D~%" (-> this alloc-count)) + (format #t "~1Triders[20] @ #x~X~%" (-> this riders)) (label cfg-4) - obj + this ) ;; definition for method 10 of type collide-rider-pool ;; WARN: Return type mismatch int vs none. -(defmethod prepare collide-rider-pool ((obj collide-rider-pool)) +(defmethod prepare collide-rider-pool ((this collide-rider-pool)) "Gets this pool ready to be used to allow allocations. This should be called once at the start of every frame." - (set! (-> obj alloc-count) 0) + (set! (-> this alloc-count) 0) 0 (none) ) @@ -77,18 +77,18 @@ ) ;; definition for method 3 of type pull-rider-info -(defmethod inspect pull-rider-info ((obj pull-rider-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect pull-rider-info ((this pull-rider-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pull-rider-info) - (format #t "~1Trider: #~%" (-> obj rider)) - (format #t "~1Trider-cshape: ~A~%" (-> obj rider-cshape)) - (format #t "~1Trider-delta-ry: ~f~%" (-> obj rider-delta-ry)) - (format #t "~1Trider-dest: #~%" (-> obj rider-dest)) + (format #t "[~8x] ~A~%" this 'pull-rider-info) + (format #t "~1Trider: #~%" (-> this rider)) + (format #t "~1Trider-cshape: ~A~%" (-> this rider-cshape)) + (format #t "~1Trider-delta-ry: ~f~%" (-> this rider-delta-ry)) + (format #t "~1Trider-dest: #~%" (-> this rider-dest)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -121,20 +121,20 @@ ) ;; definition for method 3 of type overlaps-others-params -(defmethod inspect overlaps-others-params ((obj overlaps-others-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect overlaps-others-params ((this overlaps-others-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'overlaps-others-params) - (format #t "~1Toptions: ~D~%" (-> obj options)) - (format #t "~1Tcollide-with-filter: ~D~%" (-> obj collide-with-filter)) - (format #t "~1Ttlist: ~A~%" (-> obj tlist)) - (format #t "~1Tfiltered-root-collide-with: ~D~%" (-> obj filtered-root-collide-with)) - (format #t "~1Tfiltered-child-collide-with: ~D~%" (-> obj filtered-child-collide-with)) - (format #t "~1Tfiltered-other-collide-as: ~D~%" (-> obj filtered-other-collide-as)) + (format #t "[~8x] ~A~%" this 'overlaps-others-params) + (format #t "~1Toptions: ~D~%" (-> this options)) + (format #t "~1Tcollide-with-filter: ~D~%" (-> this collide-with-filter)) + (format #t "~1Ttlist: ~A~%" (-> this tlist)) + (format #t "~1Tfiltered-root-collide-with: ~D~%" (-> this filtered-root-collide-with)) + (format #t "~1Tfiltered-child-collide-with: ~D~%" (-> this filtered-child-collide-with)) + (format #t "~1Tfiltered-other-collide-as: ~D~%" (-> this filtered-other-collide-as)) (label cfg-4) - obj + this ) ;; definition of type move-above-ground-params @@ -157,25 +157,25 @@ ) ;; definition for method 3 of type move-above-ground-params -(defmethod inspect move-above-ground-params ((obj move-above-ground-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect move-above-ground-params ((this move-above-ground-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'move-above-ground-params) - (format #t "~1Tgnd-collide-with: ~D~%" (-> obj gnd-collide-with)) - (format #t "~1Tpopup: ~f~%" (-> obj popup)) - (format #t "~1Tdont-move-if-overlaps?: ~A~%" (-> obj dont-move-if-overlaps?)) - (format #t "~1Thover-if-no-ground?: ~A~%" (-> obj hover-if-no-ground?)) - (format #t "~1Toverlaps-params: #~%" (-> obj overlaps-params)) - (format #t "~1Tnew-pos: #~%" (-> obj new-pos)) - (format #t "~1Told-gspot-pos: #~%" (-> obj old-gspot-pos)) - (format #t "~1Told-gspot-normal: #~%" (-> obj old-gspot-normal)) - (format #t "~1Tpat: ~D~%" (-> obj pat)) - (format #t "~1Ton-ground?: ~A~%" (-> obj on-ground?)) - (format #t "~1Tdo-move?: ~A~%" (-> obj do-move?)) + (format #t "[~8x] ~A~%" this 'move-above-ground-params) + (format #t "~1Tgnd-collide-with: ~D~%" (-> this gnd-collide-with)) + (format #t "~1Tpopup: ~f~%" (-> this popup)) + (format #t "~1Tdont-move-if-overlaps?: ~A~%" (-> this dont-move-if-overlaps?)) + (format #t "~1Thover-if-no-ground?: ~A~%" (-> this hover-if-no-ground?)) + (format #t "~1Toverlaps-params: #~%" (-> this overlaps-params)) + (format #t "~1Tnew-pos: #~%" (-> this new-pos)) + (format #t "~1Told-gspot-pos: #~%" (-> this old-gspot-pos)) + (format #t "~1Told-gspot-normal: #~%" (-> this old-gspot-normal)) + (format #t "~1Tpat: ~D~%" (-> this pat)) + (format #t "~1Ton-ground?: ~A~%" (-> this on-ground?)) + (format #t "~1Tdo-move?: ~A~%" (-> this do-move?)) (label cfg-4) - obj + this ) ;; definition of type collide-prim-core @@ -194,21 +194,21 @@ ) ;; definition for method 3 of type collide-prim-core -(defmethod inspect collide-prim-core ((obj collide-prim-core)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-prim-core ((this collide-prim-core)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-prim-core) - (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj world-sphere)) - (format #t "~1Tcollide-as: ~D~%" (-> obj collide-as)) - (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~1Taction: ~D~%" (-> obj action)) - (format #t "~1Tprim-type: ~D~%" (-> obj prim-type)) - (format #t "~1Tunused1[3] @ #x~X~%" (-> obj unused1)) - (format #t "~1Tquad[2] @ #x~X~%" (-> obj world-sphere)) + (format #t "[~8x] ~A~%" this 'collide-prim-core) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> this world-sphere)) + (format #t "~1Tcollide-as: ~D~%" (-> this collide-as)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~1Taction: ~D~%" (-> this action)) + (format #t "~1Tprim-type: ~D~%" (-> this prim-type)) + (format #t "~1Tunused1[3] @ #x~X~%" (-> this unused1)) + (format #t "~1Tquad[2] @ #x~X~%" (-> this world-sphere)) (label cfg-4) - obj + this ) ;; definition of type collide-shape-prim @@ -247,22 +247,22 @@ ) ;; definition for method 3 of type collide-shape-prim -(defmethod inspect collide-shape-prim ((obj collide-shape-prim)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-shape-prim ((this collide-shape-prim)) + (when (not this) + (set! this this) (goto cfg-146) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcshape: ~A~%" (-> obj cshape)) - (format #t "~1Tprim-id: #x~X~%" (-> obj prim-id)) - (format #t "~1Ttransform-index: ~D~%" (-> obj transform-index)) - (format #t "~1Tunused2[3] @ #x~X~%" (-> obj unused2)) - (format #t "~1Tprim-core: #~%" (-> obj prim-core)) - (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) - (format #t "~1Tspecific[16] @ #x~X~%" (-> obj specific)) - (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) - (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> obj prim-core collide-as)) - (let ((s5-0 (-> obj prim-core collide-as))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcshape: ~A~%" (-> this cshape)) + (format #t "~1Tprim-id: #x~X~%" (-> this prim-id)) + (format #t "~1Ttransform-index: ~D~%" (-> this transform-index)) + (format #t "~1Tunused2[3] @ #x~X~%" (-> this unused2)) + (format #t "~1Tprim-core: #~%" (-> this prim-core)) + (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> this local-sphere)) + (format #t "~1Tspecific[16] @ #x~X~%" (-> this specific)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> this prim-core collide-as)) + (let ((s5-0 (-> this prim-core collide-as))) (if (= (logand (collide-spec special-obstacle) s5-0) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) @@ -346,8 +346,8 @@ ) ) (format #t ")~%") - (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) - (let ((s5-1 (-> obj prim-core collide-with))) + (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> this prim-core collide-with)) + (let ((s5-1 (-> this prim-core collide-with))) (if (= (logand (collide-spec special-obstacle) s5-1) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) @@ -431,8 +431,8 @@ ) ) (format #t ")~%") - (format #t "~1Taction: #x~X : (collide-action " (-> obj prim-core action)) - (let ((s5-2 (-> obj prim-core action))) + (format #t "~1Taction: #x~X : (collide-action " (-> this prim-core action)) + (let ((s5-2 (-> this prim-core action))) (if (= (logand s5-2 (collide-action deadly)) (collide-action deadly)) (format #t "deadly ") ) @@ -486,10 +486,10 @@ ) ) (format #t ")~%") - (format #t "~1Tprim-type: ~D~%" (-> obj prim-core prim-type)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj local-sphere w)) + (format #t "~1Tprim-type: ~D~%" (-> this prim-core prim-type)) + (format #t "~1Tradius: (meters ~m)~%" (-> this local-sphere w)) (label cfg-146) - obj + this ) ;; definition of type collide-shape-prim-sphere @@ -506,22 +506,22 @@ ) ;; definition for method 3 of type collide-shape-prim-sphere -(defmethod inspect collide-shape-prim-sphere ((obj collide-shape-prim-sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-shape-prim-sphere ((this collide-shape-prim-sphere)) + (when (not this) + (set! this this) (goto cfg-146) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcshape: ~A~%" (-> obj cshape)) - (format #t "~1Tprim-id: #x~X~%" (-> obj prim-id)) - (format #t "~1Ttransform-index: ~D~%" (-> obj transform-index)) - (format #t "~1Tunused2[3] @ #x~X~%" (-> obj unused2)) - (format #t "~1Tprim-core: #~%" (-> obj prim-core)) - (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) - (format #t "~1Tspecific[16] @ #x~X~%" (&-> obj pat)) - (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) - (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> obj prim-core collide-as)) - (let ((s5-0 (-> obj prim-core collide-as))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcshape: ~A~%" (-> this cshape)) + (format #t "~1Tprim-id: #x~X~%" (-> this prim-id)) + (format #t "~1Ttransform-index: ~D~%" (-> this transform-index)) + (format #t "~1Tunused2[3] @ #x~X~%" (-> this unused2)) + (format #t "~1Tprim-core: #~%" (-> this prim-core)) + (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> this local-sphere)) + (format #t "~1Tspecific[16] @ #x~X~%" (&-> this pat)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> this prim-core collide-as)) + (let ((s5-0 (-> this prim-core collide-as))) (if (= (logand (collide-spec special-obstacle) s5-0) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) @@ -605,8 +605,8 @@ ) ) (format #t ")~%") - (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) - (let ((s5-1 (-> obj prim-core collide-with))) + (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> this prim-core collide-with)) + (let ((s5-1 (-> this prim-core collide-with))) (if (= (logand (collide-spec special-obstacle) s5-1) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) @@ -690,8 +690,8 @@ ) ) (format #t ")~%") - (format #t "~1Taction: #x~X : (collide-action " (-> obj prim-core action)) - (let ((s5-2 (-> obj prim-core action))) + (format #t "~1Taction: #x~X : (collide-action " (-> this prim-core action)) + (let ((s5-2 (-> this prim-core action))) (if (= (logand s5-2 (collide-action deadly)) (collide-action deadly)) (format #t "deadly ") ) @@ -745,12 +745,12 @@ ) ) (format #t ")~%") - (format #t "~1Tprim-type: ~D~%" (-> obj prim-core prim-type)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj local-sphere w)) - (format #t "~1Tpat: ~D~%" (-> obj pat)) - (format #t "~1Tnav-radius: ~f~%" (-> obj nav-radius)) + (format #t "~1Tprim-type: ~D~%" (-> this prim-core prim-type)) + (format #t "~1Tradius: (meters ~m)~%" (-> this local-sphere w)) + (format #t "~1Tpat: ~D~%" (-> this pat)) + (format #t "~1Tnav-radius: ~f~%" (-> this nav-radius)) (label cfg-146) - obj + this ) ;; definition of type collide-shape-prim-mesh @@ -769,22 +769,22 @@ ) ;; definition for method 3 of type collide-shape-prim-mesh -(defmethod inspect collide-shape-prim-mesh ((obj collide-shape-prim-mesh)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-shape-prim-mesh ((this collide-shape-prim-mesh)) + (when (not this) + (set! this this) (goto cfg-146) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcshape: ~A~%" (-> obj cshape)) - (format #t "~1Tprim-id: #x~X~%" (-> obj prim-id)) - (format #t "~1Ttransform-index: ~D~%" (-> obj transform-index)) - (format #t "~1Tunused2[3] @ #x~X~%" (-> obj unused2)) - (format #t "~1Tprim-core: #~%" (-> obj prim-core)) - (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) - (format #t "~1Tspecific[16] @ #x~X~%" (&-> obj mesh)) - (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) - (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> obj prim-core collide-as)) - (let ((s5-0 (-> obj prim-core collide-as))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcshape: ~A~%" (-> this cshape)) + (format #t "~1Tprim-id: #x~X~%" (-> this prim-id)) + (format #t "~1Ttransform-index: ~D~%" (-> this transform-index)) + (format #t "~1Tunused2[3] @ #x~X~%" (-> this unused2)) + (format #t "~1Tprim-core: #~%" (-> this prim-core)) + (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> this local-sphere)) + (format #t "~1Tspecific[16] @ #x~X~%" (&-> this mesh)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> this prim-core collide-as)) + (let ((s5-0 (-> this prim-core collide-as))) (if (= (logand (collide-spec special-obstacle) s5-0) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) @@ -868,8 +868,8 @@ ) ) (format #t ")~%") - (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) - (let ((s5-1 (-> obj prim-core collide-with))) + (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> this prim-core collide-with)) + (let ((s5-1 (-> this prim-core collide-with))) (if (= (logand (collide-spec special-obstacle) s5-1) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) @@ -953,8 +953,8 @@ ) ) (format #t ")~%") - (format #t "~1Taction: #x~X : (collide-action " (-> obj prim-core action)) - (let ((s5-2 (-> obj prim-core action))) + (format #t "~1Taction: #x~X : (collide-action " (-> this prim-core action)) + (let ((s5-2 (-> this prim-core action))) (if (= (logand s5-2 (collide-action deadly)) (collide-action deadly)) (format #t "deadly ") ) @@ -1008,14 +1008,14 @@ ) ) (format #t ")~%") - (format #t "~1Tprim-type: ~D~%" (-> obj prim-core prim-type)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj local-sphere w)) - (format #t "~1Tmesh: ~A~%" (-> obj mesh)) - (format #t "~1Tmesh-id: ~D~%" (-> obj mesh-id)) - (format #t "~1Tmesh-cache-id: ~D~%" (-> obj mesh-cache-id)) - (format #t "~1Tmesh-cache-entry: #~%" (-> obj mesh-cache-entry)) + (format #t "~1Tprim-type: ~D~%" (-> this prim-core prim-type)) + (format #t "~1Tradius: (meters ~m)~%" (-> this local-sphere w)) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tmesh-id: ~D~%" (-> this mesh-id)) + (format #t "~1Tmesh-cache-id: ~D~%" (-> this mesh-cache-id)) + (format #t "~1Tmesh-cache-entry: #~%" (-> this mesh-cache-entry)) (label cfg-146) - obj + this ) ;; definition of type collide-shape-prim-group @@ -1033,22 +1033,22 @@ ) ;; definition for method 3 of type collide-shape-prim-group -(defmethod inspect collide-shape-prim-group ((obj collide-shape-prim-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-shape-prim-group ((this collide-shape-prim-group)) + (when (not this) + (set! this this) (goto cfg-146) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcshape: ~A~%" (-> obj cshape)) - (format #t "~1Tprim-id: #x~X~%" (-> obj prim-id)) - (format #t "~1Ttransform-index: ~D~%" (-> obj transform-index)) - (format #t "~1Tunused2[3] @ #x~X~%" (-> obj unused2)) - (format #t "~1Tprim-core: #~%" (-> obj prim-core)) - (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) - (format #t "~1Tspecific[16] @ #x~X~%" (&-> obj num-children)) - (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) - (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> obj prim-core collide-as)) - (let ((s5-0 (-> obj prim-core collide-as))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcshape: ~A~%" (-> this cshape)) + (format #t "~1Tprim-id: #x~X~%" (-> this prim-id)) + (format #t "~1Ttransform-index: ~D~%" (-> this transform-index)) + (format #t "~1Tunused2[3] @ #x~X~%" (-> this unused2)) + (format #t "~1Tprim-core: #~%" (-> this prim-core)) + (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> this local-sphere)) + (format #t "~1Tspecific[16] @ #x~X~%" (&-> this num-children)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> this prim-core)) + (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> this prim-core collide-as)) + (let ((s5-0 (-> this prim-core collide-as))) (if (= (logand (collide-spec special-obstacle) s5-0) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) @@ -1132,8 +1132,8 @@ ) ) (format #t ")~%") - (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) - (let ((s5-1 (-> obj prim-core collide-with))) + (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> this prim-core collide-with)) + (let ((s5-1 (-> this prim-core collide-with))) (if (= (logand (collide-spec special-obstacle) s5-1) (collide-spec special-obstacle)) (format #t "special-obstacle ") ) @@ -1217,8 +1217,8 @@ ) ) (format #t ")~%") - (format #t "~1Taction: #x~X : (collide-action " (-> obj prim-core action)) - (let ((s5-2 (-> obj prim-core action))) + (format #t "~1Taction: #x~X : (collide-action " (-> this prim-core action)) + (let ((s5-2 (-> this prim-core action))) (if (= (logand s5-2 (collide-action deadly)) (collide-action deadly)) (format #t "deadly ") ) @@ -1272,13 +1272,13 @@ ) ) (format #t ")~%") - (format #t "~1Tprim-type: ~D~%" (-> obj prim-core prim-type)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj local-sphere w)) - (format #t "~1Tnum-children: ~D~%" (-> obj num-children)) - (format #t "~1Tnum-alloc-children: ~D~%" (-> obj num-alloc-children)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) + (format #t "~1Tprim-type: ~D~%" (-> this prim-core prim-type)) + (format #t "~1Tradius: (meters ~m)~%" (-> this local-sphere w)) + (format #t "~1Tnum-children: ~D~%" (-> this num-children)) + (format #t "~1Tnum-alloc-children: ~D~%" (-> this num-alloc-children)) + (format #t "~1Tchild: #x~X~%" (-> this child)) (label cfg-146) - obj + this ) ;; definition of type collide-shape @@ -1337,37 +1337,37 @@ ) ;; definition for method 3 of type collide-shape -(defmethod inspect collide-shape ((obj collide-shape)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-shape ((this collide-shape)) + (when (not this) + (set! this this) (goto cfg-136) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Trot: ~`vector`P~%" (-> obj quat)) - (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance)) - (format #t "~1Tnav-radius: (meters ~m)~%" (-> obj nav-radius)) - (format #t "~1Ttransv: ~`vector`P~%" (-> obj transv)) - (format #t "~1Trotv: ~`vector`P~%" (-> obj rotv)) - (format #t "~1Tscalev: ~`vector`P~%" (-> obj scalev)) - (format #t "~1Tdir-targ: #~%" (-> obj dir-targ)) - (format #t "~1Tangle-change-time: ~D~%" (-> obj angle-change-time)) - (format #t "~1Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff)) - (format #t "~1Tactor-hash-index: ~D~%" (-> obj actor-hash-index)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tmax-iteration-count: ~D~%" (-> obj max-iteration-count)) - (format #t "~1Tnav-flags: ~D~%" (-> obj nav-flags)) - (format #t "~1Ttotal-prims: ~D~%" (-> obj total-prims)) - (format #t "~1Tnum-riders: ~D~%" (-> obj num-riders)) - (format #t "~1Tpat-ignore-mask: ~D~%" (-> obj pat-ignore-mask)) - (format #t "~1Tevent-self: ~A~%" (-> obj event-self)) - (format #t "~1Tevent-other: ~A~%" (-> obj event-other)) - (format #t "~1Troot-prim: ~A~%" (-> obj root-prim)) - (format #t "~1Triders: #x~X~%" (-> obj riders)) - (format #t "~1Tpenetrate-using: #x~X : (penetrate " (-> obj penetrate-using)) - (let ((s5-0 (-> obj penetrate-using))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Trot: ~`vector`P~%" (-> this quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> this pause-adjust-distance)) + (format #t "~1Tnav-radius: (meters ~m)~%" (-> this nav-radius)) + (format #t "~1Ttransv: ~`vector`P~%" (-> this transv)) + (format #t "~1Trotv: ~`vector`P~%" (-> this rotv)) + (format #t "~1Tscalev: ~`vector`P~%" (-> this scalev)) + (format #t "~1Tdir-targ: #~%" (-> this dir-targ)) + (format #t "~1Tangle-change-time: ~D~%" (-> this angle-change-time)) + (format #t "~1Told-y-angle-diff: ~f~%" (-> this old-y-angle-diff)) + (format #t "~1Tactor-hash-index: ~D~%" (-> this actor-hash-index)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tmax-iteration-count: ~D~%" (-> this max-iteration-count)) + (format #t "~1Tnav-flags: ~D~%" (-> this nav-flags)) + (format #t "~1Ttotal-prims: ~D~%" (-> this total-prims)) + (format #t "~1Tnum-riders: ~D~%" (-> this num-riders)) + (format #t "~1Tpat-ignore-mask: ~D~%" (-> this pat-ignore-mask)) + (format #t "~1Tevent-self: ~A~%" (-> this event-self)) + (format #t "~1Tevent-other: ~A~%" (-> this event-other)) + (format #t "~1Troot-prim: ~A~%" (-> this root-prim)) + (format #t "~1Triders: #x~X~%" (-> this riders)) + (format #t "~1Tpenetrate-using: #x~X : (penetrate " (-> this penetrate-using)) + (let ((s5-0 (-> this penetrate-using))) (if (= (logand s5-0 (penetrate mech-bonk)) (penetrate mech-bonk)) (format #t "mech-bonk ") ) @@ -1469,8 +1469,8 @@ ) ) (format #t ")~%") - (format #t "~1Tpenetrated-by: #x~X : (penetrate " (-> obj penetrated-by)) - (let ((s5-1 (-> obj penetrated-by))) + (format #t "~1Tpenetrated-by: #x~X : (penetrate " (-> this penetrated-by)) + (let ((s5-1 (-> this penetrated-by))) (if (= (logand s5-1 (penetrate mech-bonk)) (penetrate mech-bonk)) (format #t "mech-bonk ") ) @@ -1572,12 +1572,12 @@ ) ) (format #t ")~%") - (format #t "~1Tbackup-collide-as: ~D~%" (-> obj backup-collide-as)) - (format #t "~1Tbackup-collide-with: ~D~%" (-> obj backup-collide-with)) - (format #t "~1Tevent-priority: ~D~%" (-> obj event-priority)) - (format #t "~1Trider-max-momentum: ~f~%" (-> obj rider-max-momentum)) + (format #t "~1Tbackup-collide-as: ~D~%" (-> this backup-collide-as)) + (format #t "~1Tbackup-collide-with: ~D~%" (-> this backup-collide-with)) + (format #t "~1Tevent-priority: ~D~%" (-> this event-priority)) + (format #t "~1Trider-max-momentum: ~f~%" (-> this rider-max-momentum)) (label cfg-136) - obj + this ) ;; definition of type collide-shape-moving @@ -1633,37 +1633,37 @@ ) ;; definition for method 3 of type collide-shape-moving -(defmethod inspect collide-shape-moving ((obj collide-shape-moving)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-shape-moving ((this collide-shape-moving)) + (when (not this) + (set! this this) (goto cfg-136) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Trot: ~`vector`P~%" (-> obj quat)) - (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance)) - (format #t "~1Tnav-radius: (meters ~m)~%" (-> obj nav-radius)) - (format #t "~1Ttransv: ~`vector`P~%" (-> obj transv)) - (format #t "~1Trotv: ~`vector`P~%" (-> obj rotv)) - (format #t "~1Tscalev: ~`vector`P~%" (-> obj scalev)) - (format #t "~1Tdir-targ: #~%" (-> obj dir-targ)) - (format #t "~1Tangle-change-time: ~D~%" (-> obj angle-change-time)) - (format #t "~1Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff)) - (format #t "~1Tactor-hash-index: ~D~%" (-> obj actor-hash-index)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tmax-iteration-count: ~D~%" (-> obj max-iteration-count)) - (format #t "~1Tnav-flags: ~D~%" (-> obj nav-flags)) - (format #t "~1Ttotal-prims: ~D~%" (-> obj total-prims)) - (format #t "~1Tnum-riders: ~D~%" (-> obj num-riders)) - (format #t "~1Tpat-ignore-mask: ~D~%" (-> obj pat-ignore-mask)) - (format #t "~1Tevent-self: ~A~%" (-> obj event-self)) - (format #t "~1Tevent-other: ~A~%" (-> obj event-other)) - (format #t "~1Troot-prim: ~A~%" (-> obj root-prim)) - (format #t "~1Triders: #x~X~%" (-> obj riders)) - (format #t "~1Tpenetrate-using: #x~X : (penetrate " (-> obj penetrate-using)) - (let ((s5-0 (-> obj penetrate-using))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Trot: ~`vector`P~%" (-> this quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> this pause-adjust-distance)) + (format #t "~1Tnav-radius: (meters ~m)~%" (-> this nav-radius)) + (format #t "~1Ttransv: ~`vector`P~%" (-> this transv)) + (format #t "~1Trotv: ~`vector`P~%" (-> this rotv)) + (format #t "~1Tscalev: ~`vector`P~%" (-> this scalev)) + (format #t "~1Tdir-targ: #~%" (-> this dir-targ)) + (format #t "~1Tangle-change-time: ~D~%" (-> this angle-change-time)) + (format #t "~1Told-y-angle-diff: ~f~%" (-> this old-y-angle-diff)) + (format #t "~1Tactor-hash-index: ~D~%" (-> this actor-hash-index)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tmax-iteration-count: ~D~%" (-> this max-iteration-count)) + (format #t "~1Tnav-flags: ~D~%" (-> this nav-flags)) + (format #t "~1Ttotal-prims: ~D~%" (-> this total-prims)) + (format #t "~1Tnum-riders: ~D~%" (-> this num-riders)) + (format #t "~1Tpat-ignore-mask: ~D~%" (-> this pat-ignore-mask)) + (format #t "~1Tevent-self: ~A~%" (-> this event-self)) + (format #t "~1Tevent-other: ~A~%" (-> this event-other)) + (format #t "~1Troot-prim: ~A~%" (-> this root-prim)) + (format #t "~1Triders: #x~X~%" (-> this riders)) + (format #t "~1Tpenetrate-using: #x~X : (penetrate " (-> this penetrate-using)) + (let ((s5-0 (-> this penetrate-using))) (if (= (logand s5-0 (penetrate mech-bonk)) (penetrate mech-bonk)) (format #t "mech-bonk ") ) @@ -1765,8 +1765,8 @@ ) ) (format #t ")~%") - (format #t "~1Tpenetrated-by: #x~X : (penetrate " (-> obj penetrated-by)) - (let ((s5-1 (-> obj penetrated-by))) + (format #t "~1Tpenetrated-by: #x~X : (penetrate " (-> this penetrated-by)) + (let ((s5-1 (-> this penetrated-by))) (if (= (logand s5-1 (penetrate mech-bonk)) (penetrate mech-bonk)) (format #t "mech-bonk ") ) @@ -1868,38 +1868,38 @@ ) ) (format #t ")~%") - (format #t "~1Tbackup-collide-as: ~D~%" (-> obj backup-collide-as)) - (format #t "~1Tbackup-collide-with: ~D~%" (-> obj backup-collide-with)) - (format #t "~1Tevent-priority: ~D~%" (-> obj event-priority)) - (format #t "~1Trider-max-momentum: ~f~%" (-> obj rider-max-momentum)) - (format #t "~1Trider-time: ~D~%" (-> obj rider-time)) - (format #t "~1Trider-last-move: ~`vector`P~%" (-> obj rider-last-move)) - (format #t "~1Ttrans-old: ~`vector`P~%" (-> obj trans-old)) - (format #t "~1Tpoly-pat: #x~X~%" (-> obj poly-pat)) - (format #t "~1Tcur-pat: #x~X~%" (-> obj cur-pat)) - (format #t "~1Tground-pat: #x~X~%" (-> obj ground-pat)) - (format #t "~1Tstatus: ~D~%" (-> obj status)) - (format #t "~1Told-status: ~D~%" (-> obj old-status)) - (format #t "~1Tprev-status: ~D~%" (-> obj prev-status)) - (format #t "~1Treaction-flag: ~D~%" (-> obj reaction-flag)) - (format #t "~1Treaction: ~A~%" (-> obj reaction)) - (format #t "~1Tno-reaction: ~A~%" (-> obj no-reaction)) - (format #t "~1Tlocal-normal: ~`vector`P~%" (-> obj local-normal)) - (format #t "~1Tsurface-normal: ~`vector`P~%" (-> obj surface-normal)) - (format #t "~1Tpoly-normal: ~`vector`P~%" (-> obj poly-normal)) - (format #t "~1Tground-poly-normal: ~`vector`P~%" (-> obj ground-poly-normal)) - (format #t "~1Tgspot-pos: ~`vector`P~%" (-> obj gspot-pos)) - (format #t "~1Tgspot-normal: ~`vector`P~%" (-> obj gspot-normal)) - (format #t "~1Tground-touch-point: ~`vector`P~%" (-> obj grount-touch-point)) - (format #t "~1Tground-impact-vel: (meters ~m)~%" (-> obj ground-impact-vel)) - (format #t "~1Tsurface-angle: ~f~%" (-> obj surface-angle)) - (format #t "~1Tpoly-angle: ~f~%" (-> obj poly-angle)) - (format #t "~1Ttouch-angle: ~f~%" (-> obj touch-angle)) - (format #t "~1Tcoverage: ~f~%" (-> obj coverage)) - (format #t "~1Tdynam: ~A~%" (-> obj dynam)) - (format #t "~1Tsurf: ~A~%" (-> obj surf)) + (format #t "~1Tbackup-collide-as: ~D~%" (-> this backup-collide-as)) + (format #t "~1Tbackup-collide-with: ~D~%" (-> this backup-collide-with)) + (format #t "~1Tevent-priority: ~D~%" (-> this event-priority)) + (format #t "~1Trider-max-momentum: ~f~%" (-> this rider-max-momentum)) + (format #t "~1Trider-time: ~D~%" (-> this rider-time)) + (format #t "~1Trider-last-move: ~`vector`P~%" (-> this rider-last-move)) + (format #t "~1Ttrans-old: ~`vector`P~%" (-> this trans-old)) + (format #t "~1Tpoly-pat: #x~X~%" (-> this poly-pat)) + (format #t "~1Tcur-pat: #x~X~%" (-> this cur-pat)) + (format #t "~1Tground-pat: #x~X~%" (-> this ground-pat)) + (format #t "~1Tstatus: ~D~%" (-> this status)) + (format #t "~1Told-status: ~D~%" (-> this old-status)) + (format #t "~1Tprev-status: ~D~%" (-> this prev-status)) + (format #t "~1Treaction-flag: ~D~%" (-> this reaction-flag)) + (format #t "~1Treaction: ~A~%" (-> this reaction)) + (format #t "~1Tno-reaction: ~A~%" (-> this no-reaction)) + (format #t "~1Tlocal-normal: ~`vector`P~%" (-> this local-normal)) + (format #t "~1Tsurface-normal: ~`vector`P~%" (-> this surface-normal)) + (format #t "~1Tpoly-normal: ~`vector`P~%" (-> this poly-normal)) + (format #t "~1Tground-poly-normal: ~`vector`P~%" (-> this ground-poly-normal)) + (format #t "~1Tgspot-pos: ~`vector`P~%" (-> this gspot-pos)) + (format #t "~1Tgspot-normal: ~`vector`P~%" (-> this gspot-normal)) + (format #t "~1Tground-touch-point: ~`vector`P~%" (-> this grount-touch-point)) + (format #t "~1Tground-impact-vel: (meters ~m)~%" (-> this ground-impact-vel)) + (format #t "~1Tsurface-angle: ~f~%" (-> this surface-angle)) + (format #t "~1Tpoly-angle: ~f~%" (-> this poly-angle)) + (format #t "~1Ttouch-angle: ~f~%" (-> this touch-angle)) + (format #t "~1Tcoverage: ~f~%" (-> this coverage)) + (format #t "~1Tdynam: ~A~%" (-> this dynam)) + (format #t "~1Tsurf: ~A~%" (-> this surf)) (label cfg-136) - obj + this ) ;; definition for method 0 of type collide-shape-prim @@ -1956,8 +1956,8 @@ ;; definition for method 4 of type collide-shape-prim-group ;; WARN: Return type mismatch uint vs int. -(defmethod length collide-shape-prim-group ((obj collide-shape-prim-group)) - (the-as int (-> obj num-children)) +(defmethod length collide-shape-prim-group ((this collide-shape-prim-group)) + (the-as int (-> this num-children)) ) ;; definition for method 0 of type collide-shape diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc index eeb627f5bb..49faa01314 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc @@ -2,14 +2,14 @@ (in-package goal) ;; definition for method 39 of type collide-shape -(defmethod on-platform collide-shape ((obj collide-shape) (arg0 collide-shape) (arg1 collide-query)) +(defmethod on-platform collide-shape ((this collide-shape) (arg0 collide-shape) (arg1 collide-query)) (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) (set! (-> v1-0 best-my-prim) #f) (set! (-> v1-0 num-spheres) (the-as uint #f)) ) (set! (-> arg1 best-dist) 122.88) - (let ((s5-0 (-> obj root-prim)) + (let ((s5-0 (-> this root-prim)) (s4-0 (-> arg0 root-prim)) ) (when (and (logtest? (-> s5-0 prim-core collide-with) (-> s4-0 prim-core collide-as)) @@ -34,18 +34,18 @@ ;; definition for method 17 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod on-platform-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") (none) ) ;; definition for method 17 of type collide-shape-prim-group ;; WARN: Return type mismatch int vs none. -(defmethod on-platform-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (let ((s4-0 (-> arg0 prim-core collide-as)) - (s3-0 (-> obj child 0)) + (s3-0 (-> this child 0)) ) - (countdown (s2-0 (-> obj num-children)) + (countdown (s2-0 (-> this num-children)) (when (and (logtest? (-> s3-0 prim-core collide-with) s4-0) (logtest? (-> s3-0 prim-core action) (collide-action rideable)) ) @@ -71,10 +71,10 @@ ;; definition for method 17 of type collide-shape-prim-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch pat-surface vs none. -(defmethod on-platform-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) +(defmethod on-platform-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (case (-> arg0 type) ((collide-shape-prim-group) - (let ((s4-0 (-> obj prim-core collide-with)) + (let ((s4-0 (-> this prim-core collide-with)) (s3-0 (-> (the-as collide-shape-prim-group arg0) child 0)) (s2-1 (the-as object (-> (the-as collide-shape-prim-group arg0) num-children))) ) @@ -83,15 +83,15 @@ (when (and (logtest? s4-0 (-> s3-0 prim-core collide-as)) (logtest? (-> s3-0 prim-core action) (collide-action can-ride)) ) - (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> obj prim-core)) (the-as vector (-> s3-0 prim-core))) - (-> obj prim-core world-sphere w) + (let ((f0-2 (- (- (vector-vector-distance (the-as vector (-> this prim-core)) (the-as vector (-> s3-0 prim-core))) + (-> this prim-core world-sphere w) ) (-> s3-0 prim-core world-sphere w) ) ) ) (if (< f0-2 122.88) - (on-platform-test obj s3-0 arg1 f0-2) + (on-platform-test this s3-0 arg1 f0-2) ) ) ) @@ -100,9 +100,9 @@ ) ) ((collide-shape-prim-sphere) - (let ((s3-1 (-> obj mesh))) + (let ((s3-1 (-> this mesh))) (when s3-1 - (let ((v1-13 (populate-for-prim-mesh *collide-mesh-cache* obj))) + (let ((v1-13 (populate-for-prim-mesh *collide-mesh-cache* this))) (when v1-13 (let* ((s4-1 (new 'stack-no-clear 'collide-tri-result)) (f0-4 (sphere-on-platform-test @@ -116,7 +116,7 @@ ) (when (< f0-4 (-> arg1 best-dist)) (set! (-> arg1 best-dist) f0-4) - (set! (-> arg1 best-my-prim) obj) + (set! (-> arg1 best-my-prim) this) (set! (-> arg1 num-spheres) (the-as uint arg0)) (set! (-> arg1 best-other-tri vertex 0 quad) (-> s4-1 vertex 0 quad)) (set! (-> arg1 best-other-tri vertex 1 quad) (-> s4-1 vertex 1 quad)) @@ -136,12 +136,12 @@ ) ;; definition for method 9 of type collide-rider-pool -(defmethod add-rider collide-rider-pool ((obj collide-rider-pool) (arg0 handle)) - (let ((v1-0 (-> obj alloc-count))) +(defmethod add-rider collide-rider-pool ((this collide-rider-pool) (arg0 handle)) + (let ((v1-0 (-> this alloc-count))) (cond ((< v1-0 20) - (let ((v0-0 (-> obj riders v1-0))) - (set! (-> obj alloc-count) (+ v1-0 1)) + (let ((v0-0 (-> this riders v1-0))) + (set! (-> this alloc-count) (+ v1-0 1)) (set! (-> v0-0 rider-handle) arg0) (set! (-> v0-0 sticky-prim) #f) v0-0 @@ -157,15 +157,15 @@ ;; definition for method 35 of type collide-shape ;; WARN: Return type mismatch joint-control-status vs symbol. -(defmethod detect-riders! collide-shape ((obj collide-shape)) +(defmethod detect-riders! collide-shape ((this collide-shape)) (local-vars (v0-7 joint-control-status) (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) - (set! (-> obj num-riders) (the-as uint 0)) - (set! (-> obj riders) (the-as (inline-array collide-rider) #f)) - (let* ((s4-0 (-> obj root-prim)) + (set! (-> this num-riders) (the-as uint 0)) + (set! (-> this riders) (the-as (inline-array collide-rider) #f)) + (let* ((s4-0 (-> this root-prim)) (s5-0 (-> s4-0 prim-core collide-with)) ) (set! *actor-list-length* 0) @@ -261,18 +261,20 @@ (v1-24 (-> s3-0 root-prim)) ) (when (logtest? s5-0 (-> v1-24 prim-core collide-as)) - (when (and (logtest? (-> v1-24 prim-core action) (collide-action can-ride)) (!= (-> obj process) (-> s3-0 process))) + (when (and (logtest? (-> v1-24 prim-core action) (collide-action can-ride)) + (!= (-> this process) (-> s3-0 process)) + ) (let ((s2-0 (new 'stack-no-clear 'collide-query))) - (when (on-platform obj s3-0 s2-0) + (when (on-platform this s3-0 s2-0) (let ((s5-1 (add-rider *collide-rider-pool* (process->handle (-> s3-0 process))))) (when s5-1 - (+! (-> obj num-riders) 1) - (if (not (-> obj riders)) - (set! (-> obj riders) (the-as (inline-array collide-rider) s5-1)) + (+! (-> this num-riders) 1) + (if (not (-> this riders)) + (set! (-> this riders) (the-as (inline-array collide-rider) s5-1)) ) (let ((a0-15 (-> s2-0 best-my-prim))) (set! (-> s5-1 sticky-prim) a0-15) - (let ((s1-0 (-> obj process node-list data (-> a0-15 transform-index) bone transform))) + (let ((s1-0 (-> this process node-list data (-> a0-15 transform-index) bone transform))) (set! (-> s5-1 prim-ry) (matrix-y-angle s1-0)) (let ((s2-1 (new 'stack-no-clear 'matrix))) (matrix-4x4-inverse! s2-1 s1-0) @@ -281,10 +283,10 @@ ) ) ) - (send-event (-> obj process) 'ridden s5-1) + (send-event (-> this process) 'ridden s5-1) ) ) - (set! s5-0 (-> obj root-prim prim-core collide-with)) + (set! s5-0 (-> this root-prim prim-core collide-with)) ) ) ) @@ -292,12 +294,12 @@ ) ) ) - (let ((v1-58 (-> obj process skel))) + (let ((v1-58 (-> this process skel))) (the-as symbol (when (nonzero? v1-58) (cond - ((or (> (-> obj num-riders) 0) (logtest? (-> obj root-prim prim-core action) (collide-action edge-grabbed))) + ((or (> (-> this num-riders) 0) (logtest? (-> this root-prim prim-core action) (collide-action edge-grabbed))) (set! v0-7 (logior (-> v1-58 status) (joint-control-status sync-math))) (set! (-> v1-58 status) v0-7) ) @@ -315,11 +317,11 @@ ;; definition for method 44 of type collide-shape ;; WARN: Return type mismatch int vs symbol. -(defmethod pull-riders! collide-shape ((obj collide-shape)) - (let ((s5-0 (-> obj riders))) +(defmethod pull-riders! collide-shape ((this collide-shape)) + (let ((s5-0 (-> this riders))) (when s5-0 (let ((s4-0 (new 'stack-no-clear 'pull-rider-info))) - (countdown (s3-0 (-> obj num-riders)) + (countdown (s3-0 (-> this num-riders)) (let* ((v1-2 (-> s5-0 s3-0)) (a0-1 (-> v1-2 rider-handle)) ) @@ -330,14 +332,14 @@ ) (let ((a0-5 (-> v1-2 sticky-prim))) (when a0-5 - (let ((s2-0 (-> obj process node-list data (-> a0-5 transform-index) bone transform))) + (let ((s2-0 (-> this process node-list data (-> a0-5 transform-index) bone transform))) (let ((s1-0 (-> s4-0 rider-dest))) (vector-matrix*! s1-0 (-> v1-2 rider-local-pos) s2-0) (vector-float*! s1-0 s1-0 (/ 1.0 (-> s1-0 w))) ) (set! (-> s4-0 rider-delta-ry) (deg- (matrix-y-angle s2-0) (-> s4-0 rider prim-ry))) ) - (pull-rider! obj s4-0) + (pull-rider! this s4-0) ) ) ) @@ -352,7 +354,7 @@ ;; definition for method 43 of type collide-shape ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod pull-rider! collide-shape ((obj collide-shape) (arg0 pull-rider-info)) +(defmethod pull-rider! collide-shape ((this collide-shape) (arg0 pull-rider-info)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -367,9 +369,9 @@ (set! (-> s3-0 quad) (-> gp-0 trans quad)) (vector-! s2-0 (-> arg0 rider-dest) s3-0) (cond - ((logtest? (-> obj root-prim prim-core action) (collide-action pull-rider-can-collide)) - (let ((s1-0 (-> obj root-prim prim-core collide-as))) - (set! (-> obj root-prim prim-core collide-as) (collide-spec)) + ((logtest? (-> this root-prim prim-core action) (collide-action pull-rider-can-collide)) + (let ((s1-0 (-> this root-prim prim-core collide-as))) + (set! (-> this root-prim prim-core collide-as) (collide-spec)) (let ((a2-0 (new 'stack-no-clear 'collide-query))) (set! (-> a2-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) (set! (-> a2-0 ignore-process0) (-> gp-0 process)) @@ -378,7 +380,7 @@ (set! (-> a2-0 action-mask) (collide-action solid)) (fill-cache-for-shape gp-0 (+ 8192.0 (vector-length s2-0)) a2-0) ) - (set! (-> obj root-prim prim-core collide-as) s1-0) + (set! (-> this root-prim prim-core collide-as) s1-0) ) (let ((s1-1 (new 'stack-no-clear 'vector))) (set! (-> s1-1 quad) (-> s2-0 quad)) @@ -415,8 +417,8 @@ (vector-float*! (-> gp-0 rider-last-move) v1-26 (-> pp clock frames-per-second)) ) (let ((f0-4 (vector-length (-> gp-0 rider-last-move)))) - (if (< (-> obj rider-max-momentum) f0-4) - (vector-normalize! (-> gp-0 rider-last-move) (-> obj rider-max-momentum)) + (if (< (-> this rider-max-momentum) f0-4) + (vector-normalize! (-> gp-0 rider-last-move) (-> this rider-max-momentum)) ) ) (set! (-> gp-0 rider-time) (-> gp-0 process clock frame-counter)) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc index d4ac4f6afb..e3c30aaa28 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc @@ -3,14 +3,14 @@ ;; definition for method 54 of type collide-shape ;; WARN: Return type mismatch collide-shape vs none. -(defmethod pusher-init collide-shape ((obj collide-shape)) - (when (logtest? (collide-spec pusher) (-> obj root-prim prim-core collide-as)) - (let ((proc (the-as process-tree (-> obj process)))) +(defmethod pusher-init collide-shape ((this collide-shape)) + (when (logtest? (collide-spec pusher) (-> this root-prim prim-core collide-as)) + (let ((proc (the-as process-tree (-> this process)))) (while (not (logtest? (-> proc mask) (process-mask process-tree))) (set! proc (ppointer->process (-> proc parent))) ) (if (!= proc *pusher-pool*) - (change-parent (-> obj process) *pusher-pool*) + (change-parent (-> this process) *pusher-pool*) ) ) ) @@ -18,7 +18,7 @@ ) ;; definition for method 42 of type collide-shape -(defmethod should-push-away collide-shape ((obj collide-shape) (other collide-shape) (cquery collide-query)) +(defmethod should-push-away collide-shape ((this collide-shape) (other collide-shape) (cquery collide-query)) (local-vars (v1-2 uint) (v1-3 float) (a2-2 uint) (a3-2 uint)) (rlet ((acc :class vf) (vf0 :class vf) @@ -34,7 +34,7 @@ (set! (-> v1-0 best-my-prim) #f) (set! (-> v1-0 num-spheres) (the-as uint #f)) ) - (let ((a0-1 (-> obj root-prim)) + (let ((a0-1 (-> this root-prim)) (a1-1 (-> other root-prim)) ) (let ((a3-0 (-> a0-1 prim-core collide-with)) @@ -77,14 +77,14 @@ ;; definition for method 18 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod should-push-away-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query)) +(defmethod should-push-away-test collide-shape-prim ((this collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query)) (format 0 "ERROR: collide-shape-prim::should-push-away-test was called illegally!~%") (none) ) ;; definition for method 18 of type collide-shape-prim-group ;; WARN: Return type mismatch int vs none. -(defmethod should-push-away-test collide-shape-prim-group ((obj collide-shape-prim-group) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test collide-shape-prim-group ((this collide-shape-prim-group) (other collide-shape-prim) (cquery collide-query)) (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -95,8 +95,8 @@ ) (init-vf0-vector) (nop!) - (let ((s4-0 (the-as collide-shape-prim obj)) - (s3-0 (-> obj num-children)) + (let ((s4-0 (the-as collide-shape-prim this)) + (s3-0 (-> this num-children)) ) (nop!) (let ((v1-0 (-> other prim-core collide-as))) @@ -142,7 +142,7 @@ ;; definition for method 19 of type collide-shape-prim ;; WARN: Return type mismatch int vs none. -(defmethod should-push-away-a-group-test collide-shape-prim ((obj collide-shape-prim) (other collide-shape-prim-group) (cquery collide-query)) +(defmethod should-push-away-a-group-test collide-shape-prim ((this collide-shape-prim) (other collide-shape-prim-group) (cquery collide-query)) (local-vars (a0-2 collide-action) (a0-3 float) (f0-0 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -157,9 +157,9 @@ (s3-0 (-> other num-children)) ) (nop!) - (let ((v1-0 (-> obj prim-core collide-with))) + (let ((v1-0 (-> this prim-core collide-with))) (nop!) - (.lvf vf2 (&-> obj prim-core world-sphere quad)) + (.lvf vf2 (&-> this prim-core world-sphere quad)) (until (> f0-0 a0-3) (until (nonzero? a0-2) (label cfg-1) @@ -187,11 +187,11 @@ (.add.w.vf vf3 vf0 vf3 :mask #b1) (.mov a0-3 vf3) ) - (should-push-away-test obj (the-as collide-shape-prim s4-0) cquery) - (set! v1-0 (-> obj prim-core collide-with)) + (should-push-away-test this (the-as collide-shape-prim s4-0) cquery) + (set! v1-0 (-> this prim-core collide-with)) ) ) - (b! #t cfg-1 :delay (.lvf vf2 (&-> obj prim-core world-sphere quad))) + (b! #t cfg-1 :delay (.lvf vf2 (&-> this prim-core world-sphere quad))) (label cfg-6) 0 (none) @@ -201,17 +201,17 @@ ;; definition for method 18 of type collide-shape-prim-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod should-push-away-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (other collide-shape-prim) (cquery collide-query)) (let ((v1-0 (-> other prim-core prim-type))) (cond ((= v1-0 (prim-type group)) - (should-push-away-a-group-test obj (the-as collide-shape-prim-group other) cquery) + (should-push-away-a-group-test this (the-as collide-shape-prim-group other) cquery) ) (else (b! (> (the-as int v1-0) 0) cfg-8 :delay (nop!)) - (let ((s2-0 (-> obj mesh))) + (let ((s2-0 (-> this mesh))) (b! (not s2-0) cfg-7 :delay (empty-form)) - (let ((v1-4 (populate-for-prim-mesh *collide-mesh-cache* obj))) + (let ((v1-4 (populate-for-prim-mesh *collide-mesh-cache* this))) (b! (not v1-4) cfg-7 :delay (empty-form)) (let ((s5-0 (new 'stack-no-clear 'collide-tri-result))) (let ((f0-1 (should-push-away-test @@ -226,7 +226,7 @@ (b! (>= f0-1 (-> cquery best-dist)) cfg-7 :delay #f) (set! (-> cquery best-dist) f0-1) ) - (set! (-> cquery best-my-prim) obj) + (set! (-> cquery best-my-prim) this) (set! (-> cquery num-spheres) (the-as uint other)) (set! (-> cquery best-other-tri vertex 0 quad) (-> s5-0 vertex 0 quad)) (set! (-> cquery best-other-tri vertex 1 quad) (-> s5-0 vertex 1 quad)) @@ -252,7 +252,7 @@ ;; definition for method 18 of type collide-shape-prim-sphere ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod should-push-away-test collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (other collide-shape-prim) (cquery collide-query)) +(defmethod should-push-away-test collide-shape-prim-sphere ((this collide-shape-prim-sphere) (other collide-shape-prim) (cquery collide-query)) (local-vars (v1-3 float)) (rlet ((acc :class vf) (Q :class vf) @@ -269,11 +269,11 @@ (let ((v1-0 (-> other prim-core prim-type))) (cond ((= v1-0 (prim-type group)) - (should-push-away-a-group-test obj (the-as collide-shape-prim-group other) cquery) + (should-push-away-a-group-test this (the-as collide-shape-prim-group other) cquery) ) (else (b! (> (the-as int v1-0) 0) cfg-5 :delay (nop!)) - (.lvf vf1 (&-> obj prim-core world-sphere quad)) + (.lvf vf1 (&-> this prim-core world-sphere quad)) (.lvf vf2 (&-> other prim-core world-sphere quad)) (.sub.vf vf3 vf2 vf1 :mask #b111) (.add.w.vf vf5 vf1 vf2 :mask #b1000) @@ -293,9 +293,9 @@ (.mov v1-3 vf6) (let ((f1-0 v1-3)) (b! (<= f2-0 f1-0) cfg-9) - (let ((v1-4 (-> obj pat))) + (let ((v1-4 (-> this pat))) (set! (-> cquery best-dist) f1-0) - (set! (-> cquery best-my-prim) obj) + (set! (-> cquery best-my-prim) this) (set! (-> cquery num-spheres) (the-as uint other)) (.svf (&-> cquery best-other-tri normal quad) vf3) (set! (-> cquery best-other-tri pat) v1-4) @@ -305,8 +305,8 @@ (let ((s3-0 (-> cquery best-other-tri normal)) (s4-1 (-> cquery best-other-tri intersect)) ) - (vector-float*! s4-1 s3-0 (-> obj prim-core world-sphere w)) - (vector+! s4-1 s4-1 (the-as vector (-> obj prim-core))) + (vector-float*! s4-1 s3-0 (-> this prim-core world-sphere w)) + (vector+! s4-1 s4-1 (the-as vector (-> this prim-core))) (set! (-> cquery best-other-tri vertex 0 quad) (-> s4-1 quad)) (point-in-plane-<-point+normal! (-> cquery best-other-tri vertex 1) s4-1 s3-0) (let* ((a0-8 (vector-normalize! @@ -343,21 +343,21 @@ s2-0 (the-as collide-mesh-cache-tri (-> v1-13 tris)) s3-1 - (the-as vector (-> obj prim-core)) + (the-as vector (-> this prim-core)) (-> cquery best-dist) ) ) ) (when (< f0-3 (-> cquery best-dist)) (set! (-> cquery best-dist) f0-3) - (set! (-> cquery best-my-prim) obj) + (set! (-> cquery best-my-prim) this) (set! (-> cquery num-spheres) (the-as uint other)) (let ((s4-2 (-> cquery best-other-tri normal))) - (vector-! s4-2 (-> s3-1 intersect) (the-as vector (-> obj prim-core))) + (vector-! s4-2 (-> s3-1 intersect) (the-as vector (-> this prim-core))) (vector-normalize! s4-2 1.0) (let ((s3-2 (-> cquery best-other-tri intersect))) - (vector-float*! s3-2 s4-2 (-> obj prim-core world-sphere w)) - (vector+! s3-2 s3-2 (the-as vector (-> obj prim-core))) + (vector-float*! s3-2 s4-2 (-> this prim-core world-sphere w)) + (vector+! s3-2 s3-2 (the-as vector (-> this prim-core))) (set! (-> cquery best-other-tri vertex 0 quad) (-> s3-2 quad)) (point-in-plane-<-point+normal! (-> cquery best-other-tri vertex 1) s3-2 s4-2) (let* ((a0-23 (vector-normalize! @@ -384,7 +384,7 @@ ) ) ) - (set! (-> cquery best-other-tri pat) (-> obj pat)) + (set! (-> cquery best-other-tri pat) (-> this pat)) ) ) ) @@ -402,14 +402,14 @@ ;; definition for method 15 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim ((obj collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-mesh!~%") (none) ) ;; definition for method 15 of type collide-shape-prim-sphere ;; WARN: Return type mismatch int vs none. -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -420,20 +420,20 @@ (f0-1 (resolve-moving-sphere-tri arg1 gp-0 - (-> obj prim-core) + (-> this prim-core) (-> arg0 move-dist) (-> arg0 best-dist) - (-> obj prim-core action) + (-> this prim-core action) ) ) ) (when (>= f0-1 0.0) (let ((v1-3 (-> arg1 prim-core action)) - (a0-2 (-> obj prim-core action)) + (a0-2 (-> this prim-core action)) (a2-2 (-> arg1 prim)) ) (let* ((v1-4 (logand a0-2 v1-3)) - (a0-3 (-> obj cshape)) + (a0-3 (-> this cshape)) (a1-2 (logand v1-4 (collide-action solid))) (v1-5 (-> a2-2 cshape)) ) @@ -459,13 +459,13 @@ (set! (-> arg0 best-other-tri collide-ptr) a1-4) ) (set! (-> arg0 num-spheres) (the-as uint a2-2)) - (set! (-> arg0 best-my-prim) obj) + (set! (-> arg0 best-my-prim) this) (label cfg-6) (b! (not v1-5) cfg-8 :delay (empty-form)) ) (add-touching-prims *touching-list* - obj + this a2-2 f0-1 (the-as collide-tri-result #f) @@ -482,18 +482,18 @@ ;; definition for method 15 of type collide-shape-prim-mesh ;; WARN: Return type mismatch object vs none. -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim mesh is not currently supported!~%") (none) ) ;; definition for method 15 of type collide-shape-prim-group ;; WARN: Return type mismatch int vs none. -(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-mesh collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) (let ((s4-0 (-> arg1 prim-core collide-as)) - (s3-0 (-> obj child 0)) + (s3-0 (-> this child 0)) ) - (countdown (s2-0 (-> obj num-children)) + (countdown (s2-0 (-> this num-children)) (if (logtest? (-> s3-0 prim-core collide-with) s4-0) (collide-with-collide-cache-prim-mesh s3-0 arg0 arg1) ) @@ -506,14 +506,14 @@ ;; definition for method 16 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim ((obj collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim ((this collide-shape-prim) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: Unsupported prim type in collide-shape-prim::collide-with-collide-cache-prim-sphere!~%") (none) ) ;; definition for method 16 of type collide-shape-prim-sphere ;; WARN: Return type mismatch int vs none. -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 collide-query) (arg1 collide-cache-prim)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) @@ -524,7 +524,7 @@ (f0-1 (resolve-moving-sphere-sphere arg1 gp-0 - (-> obj prim-core) + (-> this prim-core) (-> arg0 move-dist) (-> arg0 best-dist) (-> arg1 prim-core action) @@ -533,11 +533,11 @@ ) (b! (< f0-1 0.0) cfg-5 :delay #f) (let ((v1-3 (-> arg1 prim-core action)) - (a0-2 (-> obj prim-core action)) + (a0-2 (-> this prim-core action)) (a2-2 (-> arg1 prim)) ) (let* ((a0-3 (logand a0-2 v1-3)) - (v1-4 (-> obj cshape)) + (v1-4 (-> this cshape)) (a1-2 (logand a0-3 (collide-action solid))) (a0-4 (-> a2-2 cshape)) ) @@ -562,11 +562,11 @@ (set! (-> arg0 best-other-tri collide-ptr) a0-6) ) (set! (-> arg0 num-spheres) (the-as uint a2-2)) - (set! (-> arg0 best-my-prim) obj) + (set! (-> arg0 best-my-prim) this) (label cfg-4) (add-touching-prims *touching-list* - obj + this a2-2 f0-1 (the-as collide-tri-result #f) @@ -582,18 +582,18 @@ ;; definition for method 16 of type collide-shape-prim-mesh ;; WARN: Return type mismatch object vs none. -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 collide-query) (arg1 collide-cache-prim)) (format 0 "ERROR: collide-shape-prim-mesh vs. collide-cache-prim sphere is not currently supported!~%") (none) ) ;; definition for method 16 of type collide-shape-prim-group ;; WARN: Return type mismatch int vs none. -(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) +(defmethod collide-with-collide-cache-prim-sphere collide-shape-prim-group ((this collide-shape-prim-group) (arg0 collide-query) (arg1 collide-cache-prim)) (let ((s4-0 (-> arg1 prim-core collide-as)) - (s3-0 (-> obj child 0)) + (s3-0 (-> this child 0)) ) - (countdown (s2-0 (-> obj num-children)) + (countdown (s2-0 (-> this num-children)) (if (logtest? (-> s3-0 prim-core collide-with) s4-0) (collide-with-collide-cache-prim-sphere s3-0 arg0 arg1) ) @@ -768,52 +768,52 @@ ) ;; definition for method 56 of type collide-shape-moving -(defmethod react-to-pat! collide-shape-moving ((obj collide-shape-moving) (arg0 pat-surface)) +(defmethod react-to-pat! collide-shape-moving ((this collide-shape-moving) (arg0 pat-surface)) (let ((set-flags (cshape-reaction-flags))) - (set! (-> obj cur-pat) arg0) - (set! (-> obj poly-pat) arg0) + (set! (-> this cur-pat) arg0) + (set! (-> this poly-pat) arg0) (case (-> arg0 material) (((pat-material ice)) - (set! (-> obj surf) *ice-surface*) + (set! (-> this surf) *ice-surface*) ) (((pat-material gravel)) - (set! (-> obj surf) *gravel-surface*) + (set! (-> this surf) *gravel-surface*) ) (((pat-material quicksand)) - (set! (-> obj surf) *quicksand-surface*) + (set! (-> this surf) *quicksand-surface*) ) (((pat-material tube)) - (set! (-> obj surf) *no-walk-surface*) + (set! (-> this surf) *no-walk-surface*) ) (else - (set! (-> obj surf) *standard-ground-surface*) + (set! (-> this surf) *standard-ground-surface*) ) ) (when (nonzero? (-> arg0 event)) (case (-> arg0 event) (((pat-event slide)) - (set! (-> obj surf) *gravel-surface*) - (send-event (-> obj process) 'slide) + (set! (-> this surf) *gravel-surface*) + (send-event (-> this process) 'slide) ) (((pat-event slippery)) - (set! (-> obj surf) *gravel-surface*) + (set! (-> this surf) *gravel-surface*) ) (((pat-event rail)) - (let* ((s4-0 (-> obj process)) + (let* ((s4-0 (-> this process)) (a0-14 (if (type? s4-0 process-focusable) s4-0 ) ) ) (if (and a0-14 (not (logtest? (focus-status rail) (-> (the-as process-focusable a0-14) focus-status)))) - (set! (-> obj surf) *rail-surface*) + (set! (-> this surf) *rail-surface*) ) ) ) (((pat-event deadly)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) (send-event - (-> obj process) + (-> this process) 'attack #f (static-attack-info ((id (the-as uint 2)) (mode 'deadly) (shove-up (meters 3)))) @@ -822,7 +822,7 @@ (((pat-event burn)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) (send-event - (-> obj process) + (-> this process) 'attack #f (static-attack-info ((id (the-as uint 2)) (mode 'burn) (shove-up (meters 3)))) @@ -830,26 +830,26 @@ ) (((pat-event deadlyup)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) - (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'deadlyup) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'deadlyup) ) (((pat-event shockup)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) - (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'shockup) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'shockup) ) (((pat-event burnup)) - (when (not (focus-test? (the-as process-focusable (-> obj process)) pilot)) + (when (not (focus-test? (the-as process-focusable (-> this process)) pilot)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) - (target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup) + (target-attack-up (the-as target (-> this process)) 'attack-or-shove 'burnup) ) ) (((pat-event melt)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) - (send-event (-> obj process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'melt)))) + (send-event (-> this process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'melt)))) ) (((pat-event endlessfall)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) (send-event - (-> obj process) + (-> this process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'endlessfall))) @@ -857,13 +857,13 @@ ) (((pat-event shock)) (set! set-flags (logior set-flags (cshape-reaction-flags csrf14))) - (send-event (-> obj process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'shock)))) + (send-event (-> this process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'shock)))) ) (((pat-event lip)) - (send-event (-> obj process) 'lip 'lip) + (send-event (-> this process) 'lip 'lip) ) (((pat-event lipramp)) - (send-event (-> obj process) 'lip 'lipramp) + (send-event (-> this process) 'lip 'lipramp) ) ) ) @@ -1020,7 +1020,7 @@ ;; definition for method 66 of type collide-shape-moving ;; INFO: Used lq/sq -(defmethod step-collison! collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) +(defmethod step-collison! collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 float) (arg3 int)) (local-vars (sv-592 int)) (let ((s5-0 (new 'stack 'collide-query)) (s2-0 (new 'stack-no-clear 'vector)) @@ -1030,7 +1030,7 @@ (set! (-> s5-0 best-dist) -100000000.0) (set! (-> s5-0 best-my-prim) #f) (set! (-> s5-0 num-spheres) (the-as uint #f)) - (let* ((s1-1 (-> obj root-prim)) + (let* ((s1-1 (-> this root-prim)) (v1-5 *collide-cache*) (s0-0 (the-as collide-cache-prim (-> v1-5 prims))) ) @@ -1053,7 +1053,7 @@ (if *display-collision-marks* (set! (-> s2-1 quad) (-> arg1 quad)) ) - (set! (-> obj prev-status) ((-> obj reaction) (the-as control-info obj) s5-0 arg0 arg1)) + (set! (-> this prev-status) ((-> this reaction) (the-as control-info this) s5-0 arg0 arg1)) (when *display-collision-marks* (let ((t1-0 (-> *pat-mode-info* (-> s5-0 best-other-tri pat mode) hilite-color))) (add-debug-outline-triangle @@ -1081,14 +1081,14 @@ (meters 0.00007324219) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) - (if (= (-> obj process type) target) + (if (= (-> this process type) target) (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> s5-0 best-other-tri intersect) - (-> obj surface-normal) + (-> this surface-normal) (meters 0.5) - (-> *pat-mode-info* (-> obj cur-pat mode) hilite-color) + (-> *pat-mode-info* (-> this cur-pat mode) hilite-color) ) ) ) @@ -1096,10 +1096,10 @@ f30-0 ) (else - (set! (-> obj reaction-flag) (cshape-reaction-flags)) - ((-> obj no-reaction) obj s5-0 arg0 arg1) - (set! (-> obj prev-status) (collide-status)) - (move-by-vector! obj s2-0) + (set! (-> this reaction-flag) (cshape-reaction-flags)) + ((-> this no-reaction) this s5-0 arg0 arg1) + (set! (-> this prev-status) (collide-status)) + (move-by-vector! this s2-0) (set! (-> arg0 quad) (-> arg1 quad)) 1.0 ) @@ -1111,14 +1111,14 @@ ) ;; definition for method 37 of type collide-shape -(defmethod integrate-and-collide! collide-shape ((obj collide-shape) (arg0 vector)) +(defmethod integrate-and-collide! collide-shape ((this collide-shape) (arg0 vector)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (let ((t9-0 (method-of-object obj move-by-vector!)) + (let ((t9-0 (method-of-object this move-by-vector!)) (v1-1 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> arg0 quad)) @@ -1129,7 +1129,7 @@ (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> v1-1 quad) vf1) - (t9-0 obj v1-1) + (t9-0 this v1-1) ) (none) ) @@ -1138,46 +1138,46 @@ ;; definition for method 37 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod integrate-and-collide! collide-shape-moving ((obj collide-shape-moving) (arg0 vector)) - (update-transforms obj) - (set! (-> obj trans-old-old-old quad) (-> obj trans-old-old quad)) - (set! (-> obj trans-old-old quad) (-> obj trans-old quad)) - (set! (-> obj trans-old quad) (-> obj trans quad)) - (set! (-> obj prev-status) (-> obj status)) - (logclear! (-> obj status) (collide-status - on-surface - on-ground - touch-surface - touch-wall - touch-ceiling - touch-actor - on-special-surface - touch-edge - blocked - on-water - impact-surface - touch-background - stuck - glance - ) +(defmethod integrate-and-collide! collide-shape-moving ((this collide-shape-moving) (arg0 vector)) + (update-transforms this) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) ) - (when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset))) - (let ((v1-13 (-> obj dynam gravity-normal))) - (set! (-> obj local-normal quad) (-> v1-13 quad)) - (set! (-> obj surface-normal quad) (-> v1-13 quad)) - (set! (-> obj poly-normal quad) (-> v1-13 quad)) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) ) - (set! (-> obj coverage) 0.0) - (set! (-> obj touch-angle) 0.0) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) ) (let ((f30-0 1.0) (s4-0 0) ) - (while (and (< 0.05 f30-0) (and (< s4-0 (the-as int (-> obj max-iteration-count))) + (while (and (< 0.05 f30-0) (and (< s4-0 (the-as int (-> this max-iteration-count))) (not (and (= (-> arg0 x) 0.0) (= (-> arg0 y) 0.0) (= (-> arg0 z) 0.0))) ) ) - (let ((f28-0 (step-collison! obj arg0 arg0 f30-0 s4-0))) + (let ((f28-0 (step-collison! this arg0 arg0 f30-0 s4-0))) (update-from-step-size *touching-list* f28-0) (set! f30-0 (- f30-0 (* f28-0 f30-0))) ) @@ -1191,49 +1191,49 @@ ;; definition for method 37 of type control-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod integrate-and-collide! control-info ((obj control-info) (arg0 vector)) +(defmethod integrate-and-collide! control-info ((this control-info) (arg0 vector)) (stopwatch-start (the-as stopwatch (&-> *collide-stats* pad0 1))) (when (< 1638400.0 (vector-length arg0)) (format 0 "WARNING: target vel is ~M m/s, reseting to zero.~%" (vector-length arg0)) (vector-reset! arg0) ) - (set! (-> obj old-anim-collide-offset-world quad) (-> obj anim-collide-offset-world quad)) + (set! (-> this old-anim-collide-offset-world quad) (-> this anim-collide-offset-world quad)) (vector-matrix*! - (-> obj anim-collide-offset-world) - (-> obj anim-collide-offset-local) - (-> obj ctrl-orientation) + (-> this anim-collide-offset-world) + (-> this anim-collide-offset-local) + (-> this ctrl-orientation) ) (vector-! - (-> obj anim-collide-offset-delta-world) - (-> obj anim-collide-offset-world) - (-> obj old-anim-collide-offset-world) + (-> this anim-collide-offset-delta-world) + (-> this anim-collide-offset-world) + (-> this old-anim-collide-offset-world) ) (let ((total-offset - (vector-! (new 'stack-no-clear 'vector) (-> obj draw-offset) (-> obj anim-collide-offset-world)) + (vector-! (new 'stack-no-clear 'vector) (-> this draw-offset) (-> this anim-collide-offset-world)) ) ) - (vector-seek! (-> obj cspace-offset) total-offset (* 16384.0 (seconds-per-frame))) + (vector-seek! (-> this cspace-offset) total-offset (* 16384.0 (seconds-per-frame))) ) (let ((bonus-vel (vector+float*! (new-stack-vector0) - (-> obj collide-extra-velocity) - (-> obj anim-collide-offset-delta-world) + (-> this collide-extra-velocity) + (-> this anim-collide-offset-delta-world) 60.0 ) ) ) (when (< 0.0 (vector-length bonus-vel)) - (let ((old-iter-cnt (-> obj max-iteration-count)) + (let ((old-iter-cnt (-> this max-iteration-count)) (old-in-vel (new 'stack-no-clear 'vector)) ) (set! (-> old-in-vel quad) (-> arg0 quad)) - (let ((old-stat-flg (-> obj status))) + (let ((old-stat-flg (-> this status))) (let ((t9-4 (method-of-type collide-shape-moving integrate-and-collide!))) - (t9-4 obj bonus-vel) + (t9-4 this bonus-vel) ) - (set! (-> obj max-iteration-count) old-iter-cnt) + (set! (-> this max-iteration-count) old-iter-cnt) (set! (-> arg0 quad) (-> old-in-vel quad)) - (logior! (-> obj status) old-stat-flg) + (logior! (-> this status) old-stat-flg) ) ) ) @@ -1243,16 +1243,16 @@ (let ((before-regular-vel (new 'stack-no-clear 'vector))) (set! (-> before-regular-vel quad) (-> arg0 quad)) (let ((t9-5 (method-of-type collide-shape-moving integrate-and-collide!))) - (t9-5 obj regular-vel) + (t9-5 this regular-vel) ) (let ((b1 (new-stack-vector0))) (set! (-> b1 quad) (-> before-regular-vel quad)) (let ((a1 (new-stack-vector0))) (set! (-> a1 quad) (-> regular-vel quad)) (let ((b1-nrm-to-grav (new-stack-vector0))) - (let ((f0-6 (vector-dot (-> obj dynam gravity-normal) b1))) + (let ((f0-6 (vector-dot (-> this dynam gravity-normal) b1))) 0.0 - (vector-! b1-nrm-to-grav b1 (vector-float*! b1-nrm-to-grav (-> obj dynam gravity-normal) f0-6)) + (vector-! b1-nrm-to-grav b1 (vector-float*! b1-nrm-to-grav (-> this dynam gravity-normal) f0-6)) ) (let* ((b1-nrm-to-grav-vel (vector-length b1-nrm-to-grav)) (f1-4 b1-nrm-to-grav-vel) @@ -1260,15 +1260,15 @@ ) (vector+! b1 - (vector-float*! b1 (-> obj dynam gravity-normal) f2-0) + (vector-float*! b1 (-> this dynam gravity-normal) f2-0) (vector-float*! b1-nrm-to-grav b1-nrm-to-grav (/ b1-nrm-to-grav-vel f1-4)) ) ) ) (let ((v1-33 (new-stack-vector0))) - (let ((f0-10 (vector-dot (-> obj dynam gravity-normal) a1))) + (let ((f0-10 (vector-dot (-> this dynam gravity-normal) a1))) 0.0 - (vector-! v1-33 a1 (vector-float*! v1-33 (-> obj dynam gravity-normal) f0-10)) + (vector-! v1-33 a1 (vector-float*! v1-33 (-> this dynam gravity-normal) f0-10)) ) (let* ((f0-11 (vector-length v1-33)) (f1-6 f0-11) @@ -1276,7 +1276,7 @@ ) (vector+! a1 - (vector-float*! a1 (-> obj dynam gravity-normal) f2-1) + (vector-float*! a1 (-> this dynam gravity-normal) f2-1) (vector-float*! v1-33 v1-33 (/ f0-11 f1-6)) ) ) @@ -1285,48 +1285,48 @@ (vector-normalize! a1 1.0) (let ((ba-dot (vector-dot b1 a1))) (cond - ((and (!= (vector-length (-> obj target-transv)) 0.0) - (if (logtest? (-> obj status) (collide-status touch-wall)) + ((and (!= (vector-length (-> this target-transv)) 0.0) + (if (logtest? (-> this status) (collide-status touch-wall)) (< ba-dot 0.9999) (< ba-dot 0.95) ) ) - (seek! (-> obj blocked-factor) 1.0 (* 4.0 (seconds-per-frame))) + (seek! (-> this blocked-factor) 1.0 (* 4.0 (seconds-per-frame))) (seek! - (-> obj blocked-in-air-factor) - (if (= (-> obj mod-surface mode) 'air) + (-> this blocked-in-air-factor) + (if (= (-> this mod-surface mode) 'air) 1.0 0.0 ) (* 4.0 (seconds-per-frame)) ) - (logior! (-> obj status) (collide-status blocked)) + (logior! (-> this status) (collide-status blocked)) ) (else - (seek! (-> obj blocked-factor) 0.0 (* 2.0 (seconds-per-frame))) - (seek! (-> obj blocked-in-air-factor) 0.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this blocked-factor) 0.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this blocked-in-air-factor) 0.0 (* 2.0 (seconds-per-frame))) ) ) ) ) ) (set! (-> arg0 quad) (-> regular-vel quad)) - (if (and (logtest? (-> obj status) (collide-status on-surface)) - (and (not (logtest? (-> obj status) (collide-status touch-wall blocked))) - (< (vector-length (-> obj btransv)) (vector-length before-regular-vel)) + (if (and (logtest? (-> this status) (collide-status on-surface)) + (and (not (logtest? (-> this status) (collide-status touch-wall blocked))) + (< (vector-length (-> this btransv)) (vector-length before-regular-vel)) ) ) - (set! (-> obj btransv quad) (-> before-regular-vel quad)) + (set! (-> this btransv quad) (-> before-regular-vel quad)) ) ) ) - (let ((align-xz-dir (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj align-xz-vel) 1.0)) - (align-xz-speed (vector-length (-> obj align-xz-vel))) + (let ((align-xz-dir (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this align-xz-vel) 1.0)) + (align-xz-speed (vector-length (-> this align-xz-vel))) ) - (set! (-> obj zx-vel-frac) (if (= align-xz-speed 0.0) - 0.0 - (fmax 0.0 (/ (vector-dot (-> obj transv) align-xz-dir) align-xz-speed)) - ) + (set! (-> this zx-vel-frac) (if (= align-xz-speed 0.0) + 0.0 + (fmax 0.0 (/ (vector-dot (-> this transv) align-xz-dir) align-xz-speed)) + ) ) ) (stopwatch-stop (the-as stopwatch (&-> *collide-stats* pad0 1))) @@ -1336,7 +1336,7 @@ ;; definition for method 64 of type collide-shape-moving ;; INFO: Used lq/sq -(defmethod try-snap-to-surface collide-shape-moving ((obj collide-shape-moving) (vel vector) (check-dist float) (amt float) (bounce-dist float)) +(defmethod try-snap-to-surface collide-shape-moving ((this collide-shape-moving) (vel vector) (check-dist float) (amt float) (bounce-dist float)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -1347,10 +1347,10 @@ (let ((initial-trans (new 'stack-no-clear 'vector)) (collide-vel (new 'stack-no-clear 'vector)) ) - (set! (-> initial-trans quad) (-> obj trans quad)) - (vector-normalize-copy! (-> obj trans) vel check-dist) - (vector+! (-> obj trans) (-> obj trans) initial-trans) - (update-transforms obj) + (set! (-> initial-trans quad) (-> this trans quad)) + (vector-normalize-copy! (-> this trans) vel check-dist) + (vector+! (-> this trans) (-> this trans) initial-trans) + (update-transforms this) (vector-normalize-copy! collide-vel vel (- amt check-dist)) (let ((v1-4 collide-vel)) (.lvf vf1 (&-> collide-vel quad)) @@ -1362,34 +1362,34 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> v1-4 quad) vf1) ) - (set! (-> obj prev-status) (-> obj status)) - (logclear! (-> obj status) (collide-status - on-surface - on-ground - touch-surface - touch-wall - touch-ceiling - touch-actor - on-special-surface - touch-edge - blocked - on-water - impact-surface - touch-background - stuck - glance - ) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) ) - (when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset))) - (let ((v1-13 (-> obj dynam gravity-normal))) - (set! (-> obj local-normal quad) (-> v1-13 quad)) - (set! (-> obj surface-normal quad) (-> v1-13 quad)) - (set! (-> obj poly-normal quad) (-> v1-13 quad)) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) ) - (set! (-> obj coverage) 0.0) - (set! (-> obj touch-angle) 0.0) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) ) - (let ((f30-0 (step-collison! obj collide-vel collide-vel 1.0 0))) + (let ((f30-0 (step-collison! this collide-vel collide-vel 1.0 0))) (update-from-step-size *touching-list* f30-0) (cond ((< f30-0 1.0) @@ -1397,17 +1397,17 @@ (s2-1 (new 'stack-no-clear 'vector)) ) (vector-normalize-copy! vel-dir vel 1.0) - (vector-! s2-1 (-> obj trans) initial-trans) + (vector-! s2-1 (-> this trans) initial-trans) (when (< (vector-dot vel-dir s2-1) bounce-dist) (vector-normalize-copy! s2-1 vel bounce-dist) (vector+! s2-1 s2-1 initial-trans) - (move-to-point! obj s2-1) + (move-to-point! this s2-1) ) ) #t ) (else - (move-to-point! obj initial-trans) + (move-to-point! this initial-trans) #f ) ) @@ -1418,27 +1418,27 @@ ) ;; definition for method 65 of type collide-shape-moving -(defmethod fill-and-try-snap-to-surface collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 collide-query)) +(defmethod fill-and-try-snap-to-surface collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 collide-query)) (vector-normalize-copy! (-> arg4 start-pos) arg0 arg1) - (vector+! (-> arg4 start-pos) (-> arg4 start-pos) (-> obj trans)) + (vector+! (-> arg4 start-pos) (-> arg4 start-pos) (-> this trans)) (vector-normalize-copy! (-> arg4 move-dist) arg0 (- arg2 arg1)) (fill-using-line-sphere *collide-cache* arg4) - (try-snap-to-surface obj arg0 arg1 arg2 arg3) + (try-snap-to-surface this arg0 arg1 arg2 arg3) ) ;; definition for method 61 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-to-ground-point collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) - (move-to-point! obj arg0) +(defmethod move-to-ground-point collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 vector) (arg2 vector)) + (move-to-point! this arg0) (set! (-> arg1 y) 0.0) - (set! (-> obj grount-touch-point quad) (-> arg0 quad)) - (set! (-> obj poly-normal quad) (-> arg2 quad)) - (set! (-> obj surface-normal quad) (-> arg2 quad)) - (set! (-> obj local-normal quad) (-> arg2 quad)) - (set! (-> obj ground-poly-normal quad) (-> arg2 quad)) - (logior! (-> obj status) (collide-status on-surface on-ground touch-surface)) - (set! (-> obj ground-impact-vel) (- (vector-dot arg1 (-> obj dynam gravity-normal)))) + (set! (-> this grount-touch-point quad) (-> arg0 quad)) + (set! (-> this poly-normal quad) (-> arg2 quad)) + (set! (-> this surface-normal quad) (-> arg2 quad)) + (set! (-> this local-normal quad) (-> arg2 quad)) + (set! (-> this ground-poly-normal quad) (-> arg2 quad)) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) + (set! (-> this ground-impact-vel) (- (vector-dot arg1 (-> this dynam gravity-normal)))) 0 (none) ) @@ -1446,45 +1446,45 @@ ;; definition for method 57 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod integrate-no-collide! collide-shape-moving ((obj collide-shape-moving) (arg0 vector)) +(defmethod integrate-no-collide! collide-shape-moving ((this collide-shape-moving) (arg0 vector)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (update-transforms obj) - (set! (-> obj trans-old-old-old quad) (-> obj trans-old-old quad)) - (set! (-> obj trans-old-old quad) (-> obj trans-old quad)) - (set! (-> obj trans-old quad) (-> obj trans quad)) - (set! (-> obj prev-status) (-> obj status)) - (logclear! (-> obj status) (collide-status - on-surface - on-ground - touch-surface - touch-wall - touch-ceiling - touch-actor - on-special-surface - touch-edge - blocked - on-water - impact-surface - touch-background - stuck - glance - ) + (update-transforms this) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) ) - (when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset))) - (let ((v1-13 (-> obj dynam gravity-normal))) - (set! (-> obj local-normal quad) (-> v1-13 quad)) - (set! (-> obj surface-normal quad) (-> v1-13 quad)) - (set! (-> obj poly-normal quad) (-> v1-13 quad)) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-13 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-13 quad)) + (set! (-> this surface-normal quad) (-> v1-13 quad)) + (set! (-> this poly-normal quad) (-> v1-13 quad)) ) - (set! (-> obj coverage) 0.0) - (set! (-> obj touch-angle) 0.0) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) ) - (let ((t9-1 (method-of-object obj move-by-vector!)) + (let ((t9-1 (method-of-object this move-by-vector!)) (a1-5 (new 'stack-no-clear 'vector)) ) (.lvf vf1 (&-> arg0 quad)) @@ -1495,7 +1495,7 @@ (.mov.vf vf1 vf0 :mask #b1000) (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> a1-5 quad) vf1) - (t9-1 obj a1-5) + (t9-1 this a1-5) ) 0 (none) @@ -1503,11 +1503,11 @@ ) ;; definition for method 58 of type collide-shape-moving -(defmethod integrate-for-enemy-no-mtg collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 overlaps-others-params)) - (integrate-no-collide! obj arg0) - (let ((s5-1 (find-overlapping-shapes obj arg1))) +(defmethod integrate-for-enemy-no-mtg collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 overlaps-others-params)) + (integrate-no-collide! this arg0) + (let ((s5-1 (find-overlapping-shapes this arg1))) (if s5-1 - (move-to-point! obj (-> obj trans-old)) + (move-to-point! this (-> this trans-old)) ) s5-1 ) @@ -1515,11 +1515,11 @@ ;; definition for method 55 of type collide-shape-moving ;; INFO: Used lq/sq -(defmethod find-ground collide-shape-moving ((obj collide-shape-moving) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) - (set! (-> obj gspot-pos quad) (-> obj trans quad)) - (set! (-> arg0 start-pos quad) (-> obj trans quad)) +(defmethod find-ground collide-shape-moving ((this collide-shape-moving) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) + (set! (-> this gspot-pos quad) (-> this trans quad)) + (set! (-> arg0 start-pos quad) (-> this trans quad)) (vector-reset! (-> arg0 move-dist)) - (let ((f0-0 (-> obj transv y))) + (let ((f0-0 (-> this transv y))) (if (< f0-0 0.0) (set! arg2 (- arg2 (fmax -40960.0 (* f0-0 (seconds-per-frame))))) ) @@ -1529,20 +1529,20 @@ (let ((v1-7 arg0)) (set! (-> v1-7 radius) arg4) (set! (-> v1-7 collide-with) arg1) - (set! (-> v1-7 ignore-process0) (-> obj process)) + (set! (-> v1-7 ignore-process0) (-> this process)) (set! (-> v1-7 ignore-process1) #f) - (set! (-> v1-7 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> obj pat-ignore-mask))) + (set! (-> v1-7 ignore-pat) (logior (new 'static 'pat-surface :noendlessfall #x1) (-> this pat-ignore-mask))) (set! (-> v1-7 action-mask) (collide-action solid)) ) (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* arg0) 0.0) - (set! (-> obj gspot-pos y) (-> arg0 best-other-tri intersect y)) - (set! (-> obj gspot-normal quad) (-> arg0 best-other-tri normal quad)) + (set! (-> this gspot-pos y) (-> arg0 best-other-tri intersect y)) + (set! (-> this gspot-normal quad) (-> arg0 best-other-tri normal quad)) #t ) (else - (set! (-> obj gspot-pos y) -40959590.0) - (set! (-> obj gspot-normal quad) (-> *y-vector* quad)) + (set! (-> this gspot-pos y) -40959590.0) + (set! (-> this gspot-normal quad) (-> *y-vector* quad)) #f ) ) @@ -1550,7 +1550,7 @@ ;; definition for method 51 of type collide-shape ;; INFO: Used lq/sq -(defmethod above-ground? collide-shape ((obj collide-shape) +(defmethod above-ground? collide-shape ((this collide-shape) (arg0 collide-query) (arg1 vector) (arg2 collide-spec) @@ -1566,9 +1566,9 @@ (let ((v1-2 arg0)) (set! (-> v1-2 radius) arg5) (set! (-> v1-2 collide-with) arg2) - (set! (-> v1-2 ignore-process0) (-> obj process)) + (set! (-> v1-2 ignore-process0) (-> this process)) (set! (-> v1-2 ignore-process1) #f) - (set! (-> v1-2 ignore-pat) (-> obj pat-ignore-mask)) + (set! (-> v1-2 ignore-pat) (-> this pat-ignore-mask)) (set! (-> v1-2 action-mask) (collide-action solid)) ) (>= (fill-and-probe-using-line-sphere *collide-cache* arg0) 0.0) @@ -1577,7 +1577,7 @@ ;; definition for method 59 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-above-ground collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 move-above-ground-params)) +(defmethod move-above-ground collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 move-above-ground-params)) (when *debug-segment* (let ((s3-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) (v1-7 'collide) @@ -1602,92 +1602,92 @@ ) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) - (set! (-> arg1 old-gspot-pos quad) (-> obj gspot-pos quad)) - (set! (-> arg1 old-gspot-normal quad) (-> obj gspot-normal quad)) - (set! (-> obj trans-old-old-old quad) (-> obj trans-old-old quad)) - (set! (-> obj trans-old-old quad) (-> obj trans-old quad)) - (set! (-> obj trans-old quad) (-> obj trans quad)) - (set! (-> obj prev-status) (-> obj status)) - (vector-v+! (-> obj trans) (-> obj trans) arg0) - (set! (-> arg1 new-pos quad) (-> obj trans quad)) + (set! (-> arg1 old-gspot-pos quad) (-> this gspot-pos quad)) + (set! (-> arg1 old-gspot-normal quad) (-> this gspot-normal quad)) + (set! (-> this trans-old-old-old quad) (-> this trans-old-old quad)) + (set! (-> this trans-old-old quad) (-> this trans-old quad)) + (set! (-> this trans-old quad) (-> this trans quad)) + (set! (-> this prev-status) (-> this status)) + (vector-v+! (-> this trans) (-> this trans) arg0) + (set! (-> arg1 new-pos quad) (-> this trans quad)) (let ((s3-1 (new 'stack-no-clear 'collide-query))) (cond - ((find-ground obj s3-1 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0) - (when (>= (-> obj gspot-pos y) (-> arg1 new-pos y)) + ((find-ground this s3-1 (-> arg1 gnd-collide-with) (-> arg1 popup) 81920.0 1024.0) + (when (>= (-> this gspot-pos y) (-> arg1 new-pos y)) (set! (-> arg1 on-ground?) #t) (set! (-> arg1 pat) (-> s3-1 best-other-tri pat)) (set! (-> arg1 new-pos y) (-> s3-1 best-other-tri intersect y)) - (set! (-> obj ground-impact-vel) (- (vector-dot arg0 (-> obj dynam gravity-normal)))) + (set! (-> this ground-impact-vel) (- (vector-dot arg0 (-> this dynam gravity-normal)))) (set! (-> arg0 y) 0.0) ) ) (else (if (-> arg1 hover-if-no-ground?) - (set! (-> arg1 new-pos y) (-> obj trans-old y)) + (set! (-> arg1 new-pos y) (-> this trans-old y)) ) ) ) ) - (set! (-> obj trans quad) (-> obj trans-old quad)) - (move-to-point! obj (-> arg1 new-pos)) + (set! (-> this trans quad) (-> this trans-old quad)) + (move-to-point! this (-> arg1 new-pos)) (when (logtest? (logand (-> arg1 overlaps-params collide-with-filter) (collide-spec hit-by-player-list hit-by-others-list player-list) ) - (-> obj root-prim prim-core collide-with) + (-> this root-prim prim-core collide-with) ) - (when (find-overlapping-shapes obj (-> arg1 overlaps-params)) + (when (find-overlapping-shapes this (-> arg1 overlaps-params)) (when (-> arg1 dont-move-if-overlaps?) (set! (-> arg1 do-move?) #f) - (move-to-point! obj (-> obj trans-old)) - (set! (-> obj gspot-pos quad) (-> arg1 old-gspot-pos quad)) - (set! (-> obj gspot-normal quad) (-> arg1 old-gspot-normal quad)) + (move-to-point! this (-> this trans-old)) + (set! (-> this gspot-pos quad) (-> arg1 old-gspot-pos quad)) + (set! (-> this gspot-normal quad) (-> arg1 old-gspot-normal quad)) ) ) ) (when (-> arg1 do-move?) (cond ((-> arg1 on-ground?) - (let ((a1-8 (-> obj gspot-pos)) - (a0-29 (-> obj gspot-normal)) + (let ((a1-8 (-> this gspot-pos)) + (a0-29 (-> this gspot-normal)) (v1-59 (-> arg1 pat)) ) - (set! (-> obj grount-touch-point quad) (-> a1-8 quad)) - (set! (-> obj poly-normal quad) (-> a0-29 quad)) - (set! (-> obj surface-normal quad) (-> a0-29 quad)) - (set! (-> obj local-normal quad) (-> a0-29 quad)) - (set! (-> obj ground-poly-normal quad) (-> a0-29 quad)) - (set! (-> obj poly-pat) v1-59) - (set! (-> obj cur-pat) v1-59) - (set! (-> obj ground-pat) v1-59) + (set! (-> this grount-touch-point quad) (-> a1-8 quad)) + (set! (-> this poly-normal quad) (-> a0-29 quad)) + (set! (-> this surface-normal quad) (-> a0-29 quad)) + (set! (-> this local-normal quad) (-> a0-29 quad)) + (set! (-> this ground-poly-normal quad) (-> a0-29 quad)) + (set! (-> this poly-pat) v1-59) + (set! (-> this cur-pat) v1-59) + (set! (-> this ground-pat) v1-59) ) - (logior! (-> obj status) (collide-status on-surface on-ground touch-surface)) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) ) (else - (logclear! (-> obj status) (collide-status - on-surface - on-ground - touch-surface - touch-wall - touch-ceiling - touch-actor - on-special-surface - touch-edge - blocked - on-water - impact-surface - touch-background - stuck - glance - ) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) ) - (when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset))) - (let ((v1-69 (-> obj dynam gravity-normal))) - (set! (-> obj local-normal quad) (-> v1-69 quad)) - (set! (-> obj surface-normal quad) (-> v1-69 quad)) - (set! (-> obj poly-normal quad) (-> v1-69 quad)) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-69 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-69 quad)) + (set! (-> this surface-normal quad) (-> v1-69 quad)) + (set! (-> this poly-normal quad) (-> v1-69 quad)) ) - (set! (-> obj coverage) 0.0) - (set! (-> obj touch-angle) 0.0) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) ) ) ) @@ -1715,7 +1715,7 @@ ;; definition for method 60 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-to-ground collide-shape-moving ((obj collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) +(defmethod move-to-ground collide-shape-moving ((this collide-shape-moving) (arg0 float) (arg1 float) (arg2 symbol) (arg3 collide-spec)) (local-vars (sv-576 profile-segment) (sv-592 int)) (when *debug-segment* (let ((s1-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) @@ -1741,57 +1741,57 @@ ) (let ((s1-1 (new 'stack-no-clear 'collide-query))) (cond - ((find-ground obj s1-1 arg3 arg0 arg1 1024.0) + ((find-ground this s1-1 arg3 arg0 arg1 1024.0) (let ((a1-4 (new 'stack-no-clear 'vector))) - (set! (-> a1-4 quad) (-> obj trans quad)) + (set! (-> a1-4 quad) (-> this trans quad)) (set! (-> a1-4 y) (-> s1-1 best-other-tri intersect y)) - (move-to-point! obj a1-4) + (move-to-point! this a1-4) ) (let ((a1-5 (-> s1-1 best-other-tri intersect)) (a0-19 (-> s1-1 best-other-tri normal)) (v1-25 (-> s1-1 best-other-tri pat)) ) - (set! (-> obj grount-touch-point quad) (-> a1-5 quad)) - (set! (-> obj poly-normal quad) (-> a0-19 quad)) - (set! (-> obj surface-normal quad) (-> a0-19 quad)) - (set! (-> obj local-normal quad) (-> a0-19 quad)) - (set! (-> obj ground-poly-normal quad) (-> a0-19 quad)) - (set! (-> obj poly-pat) v1-25) - (set! (-> obj cur-pat) v1-25) - (set! (-> obj ground-pat) v1-25) + (set! (-> this grount-touch-point quad) (-> a1-5 quad)) + (set! (-> this poly-normal quad) (-> a0-19 quad)) + (set! (-> this surface-normal quad) (-> a0-19 quad)) + (set! (-> this local-normal quad) (-> a0-19 quad)) + (set! (-> this ground-poly-normal quad) (-> a0-19 quad)) + (set! (-> this poly-pat) v1-25) + (set! (-> this cur-pat) v1-25) + (set! (-> this ground-pat) v1-25) ) - (logior! (-> obj status) (collide-status on-surface on-ground touch-surface)) + (logior! (-> this status) (collide-status on-surface on-ground touch-surface)) #t ) (else - (logclear! (-> obj status) (collide-status - on-surface - on-ground - touch-surface - touch-wall - touch-ceiling - touch-actor - on-special-surface - touch-edge - blocked - on-water - impact-surface - touch-background - stuck - glance - ) + (logclear! (-> this status) (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + blocked + on-water + impact-surface + touch-background + stuck + glance + ) ) - (when (not (logtest? (-> obj root-prim prim-core action) (collide-action no-normal-reset))) - (let ((v1-36 (-> obj dynam gravity-normal))) - (set! (-> obj local-normal quad) (-> v1-36 quad)) - (set! (-> obj surface-normal quad) (-> v1-36 quad)) - (set! (-> obj poly-normal quad) (-> v1-36 quad)) + (when (not (logtest? (-> this root-prim prim-core action) (collide-action no-normal-reset))) + (let ((v1-36 (-> this dynam gravity-normal))) + (set! (-> this local-normal quad) (-> v1-36 quad)) + (set! (-> this surface-normal quad) (-> v1-36 quad)) + (set! (-> this poly-normal quad) (-> v1-36 quad)) ) - (set! (-> obj coverage) 0.0) - (set! (-> obj touch-angle) 0.0) + (set! (-> this coverage) 0.0) + (set! (-> this touch-angle) 0.0) ) (if arg2 - (format 0 "WARNING: move-to-ground: failed to locate ground for ~S!~%" (-> obj process name)) + (format 0 "WARNING: move-to-ground: failed to locate ground for ~S!~%" (-> this process name)) ) ) ) @@ -1817,13 +1817,13 @@ ;; definition for method 62 of type collide-shape-moving ;; INFO: Used lq/sq -(defmethod compute-acc-due-to-gravity collide-shape-moving ((obj collide-shape-moving) (arg0 vector) (arg1 float)) - (let* ((s4-0 (vector-negate! (new 'stack-no-clear 'vector) (-> obj dynam gravity))) - (a2-1 (-> obj local-normal)) +(defmethod compute-acc-due-to-gravity collide-shape-moving ((this collide-shape-moving) (arg0 vector) (arg1 float)) + (let* ((s4-0 (vector-negate! (new 'stack-no-clear 'vector) (-> this dynam gravity))) + (a2-1 (-> this local-normal)) (a2-2 (vector-reflect-flat! (new-stack-vector0) s4-0 a2-1)) ) (vector--float*! arg0 s4-0 a2-2 (cond - ((logtest? (-> obj status) (collide-status on-surface)) + ((logtest? (-> this status) (collide-status on-surface)) (empty) arg1 ) @@ -1837,7 +1837,7 @@ ) ;; definition for method 32 of type collide-shape -(defmethod fill-cache-integrate-and-collide collide-shape ((obj collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters)) +(defmethod fill-cache-integrate-and-collide collide-shape ((this collide-shape) (arg0 vector) (arg1 collide-query) (arg2 meters)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -1855,20 +1855,20 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> a0-1 quad) vf1) ) - (fill-cache-for-shape obj (+ (vector-length v1-0) arg2) arg1) + (fill-cache-for-shape this (+ (vector-length v1-0) arg2) arg1) ) - (integrate-and-collide! obj arg0) + (integrate-and-collide! this arg0) (none) ) ) ;; definition for method 31 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod fill-cache-for-shape collide-shape ((obj collide-shape) (arg0 float) (arg1 collide-query)) +(defmethod fill-cache-for-shape collide-shape ((this collide-shape) (arg0 float) (arg1 collide-query)) (cond - ((build-bounding-box-for-shape obj (-> arg1 bbox) arg0 (-> arg1 collide-with)) + ((build-bounding-box-for-shape this (-> arg1 bbox) arg0 (-> arg1 collide-with)) (fill-using-bounding-box *collide-cache* arg1) - (if (and *display-collide-cache* (or (= (-> obj process type) target) (= (-> obj process) *debug-actor*))) + (if (and *display-collide-cache* (or (= (-> this process type) target) (= (-> this process) *debug-actor*))) (debug-draw *collide-cache*) ) ) @@ -1881,7 +1881,7 @@ ) ;; definition for method 36 of type collide-shape -(defmethod build-bounding-box-for-shape collide-shape ((obj collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-spec)) +(defmethod build-bounding-box-for-shape collide-shape ((this collide-shape) (arg0 bounding-box) (arg1 float) (arg2 collide-spec)) (rlet ((vf0 :class vf) (vf24 :class vf) (vf25 :class vf) @@ -1894,7 +1894,7 @@ ) (init-vf0-vector) (let ((t0-0 (new 'static 'vector :x 4.096)) - (v1-0 (-> obj root-prim)) + (v1-0 (-> this root-prim)) ) (.mov vf31 arg1) (let ((a0-2 (logand (-> v1-0 prim-core collide-with) arg2)) @@ -1947,9 +1947,9 @@ ) ;; definition for method 33 of type collide-shape -(defmethod find-prim-by-id collide-shape ((obj collide-shape) (arg0 uint)) - (let ((v1-0 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) +(defmethod find-prim-by-id collide-shape ((this collide-shape) (arg0 uint)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (if (= (-> v1-0 prim-id) arg0) (return v1-0) ) @@ -1960,9 +1960,9 @@ ) ;; definition for method 34 of type collide-shape -(defmethod find-prim-by-id-logtest collide-shape ((obj collide-shape) (arg0 uint)) - (let ((v1-0 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) +(defmethod find-prim-by-id-logtest collide-shape ((this collide-shape) (arg0 uint)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (if (logtest? (-> v1-0 prim-id) arg0) (return v1-0) ) @@ -2038,9 +2038,9 @@ ;; definition for method 30 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-shape ((obj collide-shape)) - (if (sphere-in-view-frustum? (the-as sphere (-> obj root-prim prim-core))) - (debug-draw (-> obj root-prim)) +(defmethod debug-draw collide-shape ((this collide-shape)) + (if (sphere-in-view-frustum? (the-as sphere (-> this root-prim prim-core))) + (debug-draw (-> this root-prim)) ) 0 (none) @@ -2070,7 +2070,7 @@ ;; definition for method 46 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod update-transforms collide-shape ((obj collide-shape)) +(defmethod update-transforms collide-shape ((this collide-shape)) (local-vars (v1-8 float) (a1-5 float) (a1-7 float)) (rlet ((acc :class vf) (Q :class vf) @@ -2082,12 +2082,12 @@ (vf5 :class vf) ) (init-vf0-vector) - (let ((s5-0 (-> obj root-prim)) - (v1-1 (-> obj process node-list)) + (let ((s5-0 (-> this root-prim)) + (v1-1 (-> this process node-list)) ) (cond ((nonzero? v1-1) - (countdown (a0-1 (-> obj total-prims)) + (countdown (a0-1 (-> this total-prims)) (let ((a1-0 (-> s5-0 transform-index))) (cond ((>= a1-0 0) @@ -2110,7 +2110,7 @@ (else (when (= a1-0 -2) (.lvf vf1 (&-> s5-0 local-sphere quad)) - (.lvf vf2 (&-> obj trans quad)) + (.lvf vf2 (&-> this trans quad)) (.add.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> s5-0 prim-core world-sphere quad) vf1) (.mov a1-7 vf1) @@ -2122,18 +2122,18 @@ ) ) (else - (countdown (s4-0 (-> obj total-prims)) + (countdown (s4-0 (-> this total-prims)) (case (-> s5-0 transform-index) ((-3) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-orient-by-quat! s3-0 (-> s5-0 local-sphere) (-> obj quat)) - (vector+! (the-as vector (-> s5-0 prim-core)) s3-0 (-> obj trans)) + (vector-orient-by-quat! s3-0 (-> s5-0 local-sphere) (-> this quat)) + (vector+! (the-as vector (-> s5-0 prim-core)) s3-0 (-> this trans)) ) (set! (-> s5-0 prim-core world-sphere w) (-> s5-0 local-sphere w)) ) ((-2) (.lvf vf1 (&-> s5-0 local-sphere quad)) - (.lvf vf2 (&-> obj trans quad)) + (.lvf vf2 (&-> this trans quad)) (.add.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> s5-0 prim-core world-sphere quad) vf1) (.mov v1-8 vf1) @@ -2151,10 +2151,10 @@ ;; definition for method 28 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod move-by-vector! collide-shape ((obj collide-shape) (arg0 vector)) - (vector+! (-> obj trans) (-> obj trans) arg0) - (let ((v1-1 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) +(defmethod move-by-vector! collide-shape ((this collide-shape) (arg0 vector)) + (vector+! (-> this trans) (-> this trans) arg0) + (let ((v1-1 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (vector+! (the-as vector (-> v1-1 prim-core)) (the-as vector (-> v1-1 prim-core)) arg0) (set! (-> v1-1 prim-core world-sphere w) (-> v1-1 local-sphere w)) (&+! v1-1 80) @@ -2167,12 +2167,12 @@ ;; definition for method 29 of type collide-shape ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-to-point! collide-shape ((obj collide-shape) (arg0 vector)) +(defmethod move-to-point! collide-shape ((this collide-shape) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj trans)) - (set! (-> obj trans quad) (-> arg0 quad)) - (let ((a1-2 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) + (vector-! v1-0 arg0 (-> this trans)) + (set! (-> this trans quad) (-> arg0 quad)) + (let ((a1-2 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (vector+! (the-as vector (-> a1-2 prim-core)) (the-as vector (-> a1-2 prim-core)) v1-0) (set! (-> a1-2 prim-core world-sphere w) (-> a1-2 local-sphere w)) (&+! a1-2 80) @@ -2185,9 +2185,9 @@ ;; definition for method 47 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod set-collide-with! collide-shape ((obj collide-shape) (arg0 collide-spec)) - (let ((v1-0 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) +(defmethod set-collide-with! collide-shape ((this collide-shape) (arg0 collide-spec)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (set! (-> v1-0 prim-core collide-with) arg0) (nop!) (nop!) @@ -2200,9 +2200,9 @@ ;; definition for method 48 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod set-collide-as! collide-shape ((obj collide-shape) (arg0 collide-spec)) - (let ((v1-0 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) +(defmethod set-collide-as! collide-shape ((this collide-shape) (arg0 collide-spec)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (set! (-> v1-0 prim-core collide-as) arg0) (nop!) (nop!) @@ -2215,9 +2215,9 @@ ;; definition for method 53 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod iterate-prims collide-shape ((obj collide-shape) (arg0 (function collide-shape-prim none))) - (let ((s5-0 (-> obj root-prim))) - (countdown (s4-0 (-> obj total-prims)) +(defmethod iterate-prims collide-shape ((this collide-shape) (arg0 (function collide-shape-prim none))) + (let ((s5-0 (-> this root-prim))) + (countdown (s4-0 (-> this total-prims)) (arg0 s5-0) (&+! s5-0 80) ) @@ -2228,8 +2228,8 @@ ;; definition for method 38 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod find-collision-meshes collide-shape ((obj collide-shape)) - (let ((s5-0 (-> obj root-prim)) +(defmethod find-collision-meshes collide-shape ((this collide-shape)) + (let ((s5-0 (-> this root-prim)) (s4-0 0) ) (case (-> s5-0 prim-core prim-type) @@ -2243,7 +2243,7 @@ ) (when (nonzero? s4-0) (let ((s3-0 0)) - (let ((v1-7 (-> obj process draw)) + (let ((v1-7 (-> this process draw)) (s2-0 (the-as (array collide-mesh) #f)) ) (when (and (nonzero? v1-7) (-> v1-7 jgeo)) @@ -2279,24 +2279,24 @@ ) ) (if (nonzero? s3-0) - (format 0 "ERROR: Failed to find collision meshes for ~D prim(s) in ~A!~%" s3-0 (-> obj process name)) + (format 0 "ERROR: Failed to find collision meshes for ~D prim(s) in ~A!~%" s3-0 (-> this process name)) ) ) ) ) - (update-transforms obj) + (update-transforms this) 0 (none) ) ;; definition for method 9 of type collide-shape-prim ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-shape-prim ((obj collide-shape-prim)) +(defmethod debug-draw collide-shape-prim ((this collide-shape-prim)) (add-debug-sphere #t (bucket-id debug2) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) (new 'static 'rgba :r #xff :g #xff :b #xff :a #x40) ) 0 @@ -2305,17 +2305,17 @@ ;; definition for method 9 of type collide-shape-prim-sphere ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-shape-prim-sphere ((obj collide-shape-prim-sphere)) +(defmethod debug-draw collide-shape-prim-sphere ((this collide-shape-prim-sphere)) (add-debug-sphere #t (bucket-id debug2) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) (cond - ((and (zero? (-> obj prim-core collide-as)) (zero? (-> obj prim-core collide-with))) + ((and (zero? (-> this prim-core collide-as)) (zero? (-> this prim-core collide-with))) (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40) ) - ((logtest? (-> obj prim-core action) (collide-action solid)) + ((logtest? (-> this prim-core action) (collide-action solid)) (new 'static 'rgba :r #xff :g #xff :a #x40) ) (else @@ -2329,12 +2329,12 @@ ;; definition for method 9 of type collide-shape-prim-mesh ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-shape-prim-mesh ((obj collide-shape-prim-mesh)) +(defmethod debug-draw collide-shape-prim-mesh ((this collide-shape-prim-mesh)) (add-debug-sphere #t (bucket-id debug2) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) (new 'static 'rgba :b #xff :a #x40) ) 0 @@ -2343,16 +2343,16 @@ ;; definition for method 9 of type collide-shape-prim-group ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw collide-shape-prim-group ((obj collide-shape-prim-group)) +(defmethod debug-draw collide-shape-prim-group ((this collide-shape-prim-group)) (add-debug-sphere #t (bucket-id debug2) - (the-as vector (-> obj prim-core)) - (-> obj local-sphere w) + (the-as vector (-> this prim-core)) + (-> this local-sphere w) (new 'static 'rgba :g #xff :a #x10) ) - (countdown (s5-0 (-> obj num-children)) - (debug-draw (-> obj child s5-0)) + (countdown (s5-0 (-> this num-children)) + (debug-draw (-> this child s5-0)) ) 0 (none) @@ -2360,7 +2360,7 @@ ;; definition for method 45 of type collide-shape ;; INFO: Used lq/sq -(defmethod do-push-aways collide-shape ((obj collide-shape)) +(defmethod do-push-aways collide-shape ((this collide-shape)) (local-vars (at-0 int) (v1-55 float) (a2-5 float) (a2-12 float)) (with-pp (rlet ((vf0 :class vf) @@ -2373,11 +2373,11 @@ (init-vf0-vector) (let ((gp-0 (new 'stack-no-clear 'do-push-aways-work))) (set! (-> gp-0 cspec) (collide-spec)) - (let ((s4-0 (-> obj root-prim prim-core collide-with))) + (let ((s4-0 (-> this root-prim prim-core collide-with))) (set! *actor-list-length* 0) (if (logtest? s4-0 (collide-spec hit-by-others-list)) (set! *actor-list-length* - (fill-actor-list-for-sphere *actor-hash* (the-as sphere (-> obj root-prim prim-core)) *actor-list* 256) + (fill-actor-list-for-sphere *actor-hash* (the-as sphere (-> this root-prim prim-core)) *actor-list* 256) ) ) (when (logtest? s4-0 (collide-spec player-list)) @@ -2391,7 +2391,7 @@ (when (logtest? s4-0 (-> a1-1 prim-core collide-as)) (let ((a1-2 (-> a1-1 prim-core))) (let ((a2-4 a1-2) - (a3-2 (-> obj root-prim prim-core)) + (a3-2 (-> this root-prim prim-core)) ) (.lvf vf2 (&-> a2-4 world-sphere quad)) (.lvf vf3 (&-> a3-2 world-sphere quad)) @@ -2402,7 +2402,7 @@ (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-5 vf1) (let ((f0-0 a2-5) - (f1-1 (+ (-> a1-2 world-sphere w) (-> obj root-prim prim-core world-sphere w))) + (f1-1 (+ (-> a1-2 world-sphere w) (-> this root-prim prim-core world-sphere w))) ) (when (< f0-0 (* f1-1 f1-1)) (when (< *actor-list-length* 256) @@ -2432,7 +2432,7 @@ (when (logtest? s4-0 (-> a1-14 prim-core collide-as)) (let ((a1-15 (-> a1-14 prim-core))) (let ((a2-11 a1-15) - (a3-4 (-> obj root-prim prim-core)) + (a3-4 (-> this root-prim prim-core)) ) (.lvf vf2 (&-> a2-11 world-sphere quad)) (.lvf vf3 (&-> a3-4 world-sphere quad)) @@ -2443,7 +2443,7 @@ (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-12 vf1) (let ((f0-1 a2-12) - (f1-5 (+ (-> a1-15 world-sphere w) (-> obj root-prim prim-core world-sphere w))) + (f1-5 (+ (-> a1-15 world-sphere w) (-> this root-prim prim-core world-sphere w))) ) (when (< f0-1 (* f1-5 f1-5)) (when (< *actor-list-length* 256) @@ -2467,8 +2467,8 @@ (s2-0 (-> s1-0 root-prim)) ) (when (logtest? s4-0 (-> s2-0 prim-core collide-as)) - (when (!= (-> obj process) (-> s1-0 process)) - (when (and (should-push-away obj s1-0 (-> gp-0 cquery)) (>= -81.92 (-> gp-0 cquery best-dist))) + (when (!= (-> this process) (-> s1-0 process)) + (when (and (should-push-away this s1-0 (-> gp-0 cquery)) (>= -81.92 (-> gp-0 cquery best-dist))) (set! (-> gp-0 cquery collide-with) (-> s1-0 root-prim prim-core collide-with)) (set! (-> gp-0 cquery ignore-process0) (-> s1-0 process)) (set! (-> gp-0 cquery ignore-process1) #f) @@ -2477,7 +2477,7 @@ (-> gp-0 cquery) (fill-cache-for-shape s1-0 8192.0 (-> gp-0 cquery)) (let ((s4-1 3)) - (until (or (<= s4-1 0) (not (should-push-away obj s1-0 (-> gp-0 cquery)))) + (until (or (<= s4-1 0) (not (should-push-away this s1-0 (-> gp-0 cquery)))) (set! (-> gp-0 vec33 quad) (-> s1-0 trans quad)) (let* ((f0-4 (+ 2867.2 (-> gp-0 vec33 y))) (f2-2 (+ 5734.4 f0-4)) @@ -2526,7 +2526,7 @@ (logior! (-> gp-0 cspec) (-> s2-0 prim-core collide-as)) ) ) - (set! s4-0 (-> obj root-prim prim-core collide-with)) + (set! s4-0 (-> this root-prim prim-core collide-with)) ) ) ) @@ -2541,7 +2541,7 @@ ;; definition for method 40 of type collide-shape ;; WARN: Return type mismatch object vs symbol. -(defmethod find-overlapping-shapes collide-shape ((obj collide-shape) (arg0 overlaps-others-params)) +(defmethod find-overlapping-shapes collide-shape ((this collide-shape) (arg0 overlaps-others-params)) (local-vars (a0-10 float) (a0-14 uint) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2552,7 +2552,7 @@ ) (init-vf0-vector) (let ((gp-0 (the-as object #f))) - (let* ((s3-0 (-> obj root-prim)) + (let* ((s3-0 (-> this root-prim)) (s2-0 (the-as uint (logand (-> s3-0 prim-core collide-with) (-> arg0 collide-with-filter)))) ) (set! (-> arg0 filtered-root-collide-with) (the-as collide-spec s2-0)) @@ -2662,7 +2662,7 @@ (.sub.w.vf vf3 vf3 vf4 :mask #b1000) (let ((f0-2 0.0)) (.add.w.vf vf3 vf0 vf3 :mask #b1) - (let ((v1-28 (-> obj process))) + (let ((v1-28 (-> this process))) (.mov a0-10 vf3) (let ((a1-26 (-> s0-0 process))) (b! (< f0-2 a0-10) cfg-28) @@ -2676,7 +2676,7 @@ ) ) (let ((a0-12 (-> (the-as (pointer uint64) arg0) 0)) - (v1-31 (-> obj penetrate-using)) + (v1-31 (-> this penetrate-using)) ) (b! (not (logtest? a0-12 4)) cfg-27 :delay (set! a0-14 (the-as uint (-> arg0 tlist)))) (b! (logtest? (-> s0-0 penetrated-by) v1-31) cfg-28 :delay (nop!)) @@ -2702,14 +2702,14 @@ ) ;; definition for method 12 of type collide-shape-prim -(defmethod overlaps-others-test collide-shape-prim ((obj collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test collide-shape-prim ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (format 0 "ERROR: Unsupported call to collide-shape-prim::overlaps-others-test!~%") #f ) ;; definition for method 12 of type collide-shape-prim-group ;; WARN: Return type mismatch object vs symbol. -(defmethod overlaps-others-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test collide-shape-prim-group ((this collide-shape-prim-group) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (a0-3 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2719,13 +2719,13 @@ (vf4 :class vf) ) (init-vf0-vector) - (let ((s4-0 (the-as collide-shape-prim obj)) + (let ((s4-0 (the-as collide-shape-prim this)) (v1-0 (-> arg1 prim-core collide-as)) (s2-0 (the-as object #f)) ) (let ((a1-1 (-> arg0 collide-with-filter))) (nop!) - (let ((s3-0 (-> obj num-children)) + (let ((s3-0 (-> this num-children)) (v1-1 (logand v1-0 a1-1)) ) (.lvf vf1 (&-> arg1 prim-core world-sphere quad)) @@ -2768,7 +2768,7 @@ ;; definition for method 13 of type collide-shape-prim ;; WARN: Return type mismatch object vs symbol. -(defmethod overlaps-others-group collide-shape-prim ((obj collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) +(defmethod overlaps-others-group collide-shape-prim ((this collide-shape-prim) (arg0 overlaps-others-params) (arg1 collide-shape-prim-group)) (local-vars (a0-4 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2779,7 +2779,7 @@ ) (init-vf0-vector) (let ((s4-0 (the-as collide-shape-prim arg1)) - (v1-0 (-> obj prim-core collide-with)) + (v1-0 (-> this prim-core collide-with)) ) (nop!) (let ((a0-1 (-> arg0 collide-with-filter))) @@ -2787,7 +2787,7 @@ (let ((s3-0 (-> arg1 num-children)) (v1-1 (logand v1-0 a0-1)) ) - (.lvf vf2 (&-> obj prim-core world-sphere quad)) + (.lvf vf2 (&-> this prim-core world-sphere quad)) (let ((s2-0 (the-as object #f))) (set! (-> arg0 filtered-child-collide-with) v1-1) (label cfg-1) @@ -2809,9 +2809,9 @@ (.mov a0-4 vf3) (b! (< f0-0 a0-4) cfg-1) ) - (let ((a0-6 (overlaps-others-test obj arg0 s4-0))) + (let ((a0-6 (overlaps-others-test this arg0 s4-0))) (set! v1-1 (-> arg0 filtered-child-collide-with)) - (b! (= a0-6 #f) cfg-1 :delay (.lvf vf2 (&-> obj prim-core world-sphere quad))) + (b! (= a0-6 #f) cfg-1 :delay (.lvf vf2 (&-> this prim-core world-sphere quad))) ) (b! (!= (-> arg0 tlist) #f) cfg-1 :delay (set! s2-0 0)) (label cfg-6) @@ -2827,11 +2827,11 @@ ) ;; definition for method 12 of type collide-shape-prim-sphere -(defmethod overlaps-others-test collide-shape-prim-sphere ((obj collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test collide-shape-prim-sphere ((this collide-shape-prim-sphere) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (v1-11 uint) (s4-0 uint)) (let ((v1-0 (-> arg1 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) - (let ((v0-1 (overlaps-others-group obj arg0 (the-as collide-shape-prim-group arg1)))) + (let ((v0-1 (overlaps-others-group this arg0 (the-as collide-shape-prim-group arg1)))) (b! #t cfg-17 :delay (nop!)) (label cfg-2) (b! (> (the-as int v1-0) 0) cfg-4 :delay (nop!)) @@ -2842,7 +2842,7 @@ (b! (not s2-0) cfg-10 :delay (empty-form)) (let ((v1-5 (populate-for-prim-mesh *collide-mesh-cache* (the-as collide-shape-prim-mesh arg1)))) (when v1-5 - (when (overlap-test s2-0 (the-as collide-mesh-cache-tri (-> v1-5 tris)) (the-as vector (-> obj prim-core))) + (when (overlap-test s2-0 (the-as collide-mesh-cache-tri (-> v1-5 tris)) (the-as vector (-> this prim-core))) (b! #t cfg-11 :delay (nop!)) (the-as none 0) ) @@ -2855,10 +2855,10 @@ (label cfg-11) (let ((a0-8 (-> arg0 tlist))) (b! (= a0-8 #f) cfg-13 :delay (nop!)) - (add-touching-prims a0-8 obj arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + (add-touching-prims a0-8 this arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) ) (label cfg-13) - (b! (not (logtest? s4-0 1)) cfg-16 :delay (set! v1-11 (the-as uint (-> obj prim-core action)))) + (b! (not (logtest? s4-0 1)) cfg-16 :delay (set! v1-11 (the-as uint (-> this prim-core action)))) (let ((a0-9 (-> arg1 prim-core action))) (b! (logtest? (the-as collide-action (logand v1-11 1)) a0-9) cfg-16 :delay (nop!)) ) @@ -2873,18 +2873,18 @@ ) ;; definition for method 12 of type collide-shape-prim-mesh -(defmethod overlaps-others-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) +(defmethod overlaps-others-test collide-shape-prim-mesh ((this collide-shape-prim-mesh) (arg0 overlaps-others-params) (arg1 collide-shape-prim)) (local-vars (v1-3 uint) (v1-11 uint) (s4-0 uint)) (let ((v1-0 (-> arg1 prim-core prim-type))) (b! (nonzero? v1-0) cfg-2 :delay (set! s4-0 (the-as uint (-> arg0 options)))) - (let ((v0-1 (overlaps-others-group obj arg0 (the-as collide-shape-prim-group arg1)))) + (let ((v0-1 (overlaps-others-group this arg0 (the-as collide-shape-prim-group arg1)))) (b! #t cfg-18 :delay (nop!)) (label cfg-2) (b! (> (the-as int v1-0) 0) cfg-10 :delay (set! v1-3 (logand s4-0 2))) (b! (nonzero? v1-3) cfg-12 :delay (nop!)) - (let ((s2-0 (-> obj mesh))) + (let ((s2-0 (-> this mesh))) (b! (not s2-0) cfg-9 :delay (empty-form)) - (let ((v1-5 (populate-for-prim-mesh *collide-mesh-cache* obj))) + (let ((v1-5 (populate-for-prim-mesh *collide-mesh-cache* this))) (b! (not v1-5) cfg-9 :delay (empty-form)) (b! (not (overlap-test s2-0 (the-as collide-mesh-cache-tri (-> v1-5 tris)) (the-as vector (-> arg1 prim-core)))) @@ -2909,10 +2909,10 @@ (label cfg-12) (let ((a0-9 (-> arg0 tlist))) (b! (= a0-9 #f) cfg-14 :delay (nop!)) - (add-touching-prims a0-9 obj arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) + (add-touching-prims a0-9 this arg1 -1.0 (the-as collide-tri-result #f) (the-as collide-tri-result #f)) ) (label cfg-14) - (b! (not (logtest? s4-0 1)) cfg-17 :delay (set! v1-11 (the-as uint (-> obj prim-core action)))) + (b! (not (logtest? s4-0 1)) cfg-17 :delay (set! v1-11 (the-as uint (-> this prim-core action)))) (let ((a0-10 (-> arg1 prim-core action))) (b! (logtest? (the-as collide-action (logand v1-11 1)) a0-10) cfg-17 :delay (nop!)) ) @@ -2928,9 +2928,9 @@ ;; definition for method 49 of type collide-shape ;; WARN: Return type mismatch int vs none. -(defmethod modify-collide-as! collide-shape ((obj collide-shape) (arg0 int) (arg1 collide-spec) (arg2 collide-spec)) - (let ((v1-0 (-> obj root-prim))) - (countdown (a0-1 (-> obj total-prims)) +(defmethod modify-collide-as! collide-shape ((this collide-shape) (arg0 int) (arg1 collide-spec) (arg2 collide-spec)) + (let ((v1-0 (-> this root-prim))) + (countdown (a0-1 (-> this total-prims)) (if (logtest? (-> v1-0 prim-id) arg0) (set! (-> v1-0 prim-core collide-as) (logior (logclear (-> v1-0 prim-core collide-as) arg1) arg2)) ) @@ -2943,7 +2943,7 @@ ;; definition for method 50 of type collide-shape ;; INFO: Used lq/sq -(defmethod send-shoves collide-shape ((obj collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) +(defmethod send-shoves collide-shape ((this collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float)) (local-vars (sv-144 process) (sv-160 collide-shape-prim) (sv-176 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -2961,7 +2961,7 @@ ) (when (and s0-0 gp-0) (while s0-0 - (set! sv-160 (get-touched-prim s0-0 obj arg1)) + (set! sv-160 (get-touched-prim s0-0 this arg1)) (get-touched-prim s0-0 (-> (the-as process-focusable gp-0) root) arg1) (when (logtest? (-> sv-160 prim-core action) (collide-action no-standon)) (let ((v1-12 (get-middle-of-bsphere-overlap s0-0 (new 'stack-no-clear 'vector)))) @@ -3008,9 +3008,9 @@ ;; definition for method 41 of type collide-shape ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs vector. -(defmethod shove-to-closest-point-on-path collide-shape ((obj collide-shape) (arg0 attack-info) (arg1 float)) +(defmethod shove-to-closest-point-on-path collide-shape ((this collide-shape) (arg0 attack-info) (arg1 float)) (set! (-> arg0 shove-up) arg1) - (let* ((s3-0 (-> obj process path)) + (let* ((s3-0 (-> this process path)) (s2-0 (-> s3-0 curve num-cverts)) (s4-0 (target-pos 0)) (s1-0 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc index 608e56ba75..0797a8e837 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type touching-prim -(defmethod inspect touching-prim ((obj touching-prim)) - (when (not obj) - (set! obj obj) +(defmethod inspect touching-prim ((this touching-prim)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'touching-prim) - (format #t "~1Tcprim: ~A~%" (-> obj cprim)) - (format #t "~1Thas-tri?: ~A~%" (-> obj has-tri?)) - (format #t "~1Ttri: #~%" (-> obj tri)) + (format #t "[~8x] ~A~%" this 'touching-prim) + (format #t "~1Tcprim: ~A~%" (-> this cprim)) + (format #t "~1Thas-tri?: ~A~%" (-> this has-tri?)) + (format #t "~1Ttri: #~%" (-> this tri)) (label cfg-4) - obj + this ) ;; definition of type touching-prims-entry @@ -46,20 +46,20 @@ ) ;; definition for method 3 of type touching-prims-entry -(defmethod inspect touching-prims-entry ((obj touching-prims-entry)) - (when (not obj) - (set! obj obj) +(defmethod inspect touching-prims-entry ((this touching-prims-entry)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'touching-prims-entry) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tprev: #~%" (-> obj prev)) - (format #t "~1Tallocated?: ~A~%" (-> obj allocated?)) - (format #t "~1Tu: ~f~%" (-> obj u)) - (format #t "~1Tprim1: #~%" (-> obj prim1)) - (format #t "~1Tprim2: #~%" (-> obj prim2)) + (format #t "[~8x] ~A~%" this 'touching-prims-entry) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) + (format #t "~1Tallocated?: ~A~%" (-> this allocated?)) + (format #t "~1Tu: ~f~%" (-> this u)) + (format #t "~1Tprim1: #~%" (-> this prim1)) + (format #t "~1Tprim2: #~%" (-> this prim2)) (label cfg-4) - obj + this ) ;; definition of type touching-prims-entry-pool @@ -80,24 +80,24 @@ ) ;; definition for method 3 of type touching-prims-entry-pool -(defmethod inspect touching-prims-entry-pool ((obj touching-prims-entry-pool)) - (when (not obj) - (set! obj obj) +(defmethod inspect touching-prims-entry-pool ((this touching-prims-entry-pool)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'touching-prims-entry-pool) - (format #t "~1Thead: #~%" (-> obj head)) - (format #t "~1Tnodes[64] @ #x~X~%" (-> obj nodes)) + (format #t "[~8x] ~A~%" this 'touching-prims-entry-pool) + (format #t "~1Thead: #~%" (-> this head)) + (format #t "~1Tnodes[64] @ #x~X~%" (-> this nodes)) (label cfg-4) - obj + this ) ;; definition for method 11 of type touching-prims-entry-pool ;; WARN: Return type mismatch int vs none. -(defmethod init-list! touching-prims-entry-pool ((obj touching-prims-entry-pool)) +(defmethod init-list! touching-prims-entry-pool ((this touching-prims-entry-pool)) (let ((v1-0 (the-as touching-prims-entry #f))) - (let ((a1-0 (the-as touching-prims-entry (-> obj nodes)))) - (set! (-> obj head) a1-0) + (let ((a1-0 (the-as touching-prims-entry (-> this nodes)))) + (set! (-> this head) a1-0) (countdown (a0-1 64) (set! (-> a1-0 prev) v1-0) (let ((a2-0 (&+ a1-0 240))) @@ -152,20 +152,20 @@ ) ;; definition for method 3 of type touching-shapes-entry -(defmethod inspect touching-shapes-entry ((obj touching-shapes-entry)) - (when (not obj) - (set! obj obj) +(defmethod inspect touching-shapes-entry ((this touching-shapes-entry)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'touching-shapes-entry) - (format #t "~1Tcshape1: ~A~%" (-> obj cshape1)) - (format #t "~1Tcshape2: ~A~%" (-> obj cshape2)) - (format #t "~1Tresolve-u: ~D~%" (-> obj resolve-u)) - (format #t "~1Thead: #~%" (-> obj head)) - (format #t "~1Thandle1: ~D~%" (-> obj handle1)) - (format #t "~1Thandle2: ~D~%" (-> obj handle2)) + (format #t "[~8x] ~A~%" this 'touching-shapes-entry) + (format #t "~1Tcshape1: ~A~%" (-> this cshape1)) + (format #t "~1Tcshape2: ~A~%" (-> this cshape2)) + (format #t "~1Tresolve-u: ~D~%" (-> this resolve-u)) + (format #t "~1Thead: #~%" (-> this head)) + (format #t "~1Thandle1: ~D~%" (-> this handle1)) + (format #t "~1Thandle2: ~D~%" (-> this handle2)) (label cfg-4) - obj + this ) ;; definition of type touching-list @@ -188,17 +188,17 @@ ) ;; definition for method 3 of type touching-list -(defmethod inspect touching-list ((obj touching-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect touching-list ((this touching-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'touching-list) - (format #t "~1Tnum-touching-shapes: ~D~%" (-> obj num-touching-shapes)) - (format #t "~1Tresolve-u: ~D~%" (-> obj resolve-u)) - (format #t "~1Ttouching-shapes[32] @ #x~X~%" (-> obj touching-shapes)) + (format #t "[~8x] ~A~%" this 'touching-list) + (format #t "~1Tnum-touching-shapes: ~D~%" (-> this num-touching-shapes)) + (format #t "~1Tresolve-u: ~D~%" (-> this resolve-u)) + (format #t "~1Ttouching-shapes[32] @ #x~X~%" (-> this touching-shapes)) (label cfg-4) - obj + this ) ;; definition for method 0 of type touching-list @@ -217,13 +217,13 @@ ) ;; definition for method 9 of type touching-shapes-entry -(defmethod get-head touching-shapes-entry ((obj touching-shapes-entry)) - (-> obj head) +(defmethod get-head touching-shapes-entry ((this touching-shapes-entry)) + (-> this head) ) ;; definition for method 10 of type touching-shapes-entry ;; WARN: Return type mismatch collide-shape vs touching-prims-entry. -(defmethod get-next touching-shapes-entry ((obj touching-shapes-entry) (arg0 touching-shapes-entry)) +(defmethod get-next touching-shapes-entry ((this touching-shapes-entry) (arg0 touching-shapes-entry)) (the-as touching-prims-entry (-> arg0 cshape1)) ) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc index b08b89d2b7..a32ee8523a 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-touch_REF.gc @@ -2,9 +2,9 @@ (in-package goal) ;; definition for method 10 of type touching-prims-entry-pool -(defmethod get-free-node-count touching-prims-entry-pool ((obj touching-prims-entry-pool)) +(defmethod get-free-node-count touching-prims-entry-pool ((this touching-prims-entry-pool)) (let ((v0-0 0)) - (let ((v1-0 (-> obj head))) + (let ((v1-0 (-> this head))) (while v1-0 (+! v0-0 1) (set! v1-0 (-> v1-0 next)) @@ -18,12 +18,12 @@ ) ;; definition for method 9 of type touching-prims-entry-pool -(defmethod alloc-node touching-prims-entry-pool ((obj touching-prims-entry-pool)) - (let ((gp-0 (-> obj head))) +(defmethod alloc-node touching-prims-entry-pool ((this touching-prims-entry-pool)) + (let ((gp-0 (-> this head))) (cond (gp-0 (let ((v1-0 (-> gp-0 next))) - (set! (-> obj head) v1-0) + (set! (-> this head) v1-0) (if v1-0 (set! (-> v1-0 prev) #f) ) @@ -41,13 +41,13 @@ ) ;; definition for method 12 of type touching-prims-entry-pool -(defmethod free-node touching-prims-entry-pool ((obj touching-prims-entry-pool) (arg0 touching-prims-entry)) +(defmethod free-node touching-prims-entry-pool ((this touching-prims-entry-pool) (arg0 touching-prims-entry)) (when (-> arg0 allocated?) (set! (-> arg0 allocated?) #f) - (let ((v1-1 (-> obj head))) + (let ((v1-1 (-> this head))) (set! (-> arg0 next) v1-1) (set! (-> arg0 prev) #f) - (set! (-> obj head) arg0) + (set! (-> this head) arg0) (when v1-1 (set! (-> v1-1 prev) arg0) arg0 @@ -58,12 +58,12 @@ ;; definition for method 14 of type touching-shapes-entry ;; WARN: Return type mismatch int vs none. -(defmethod free-touching-prims-list touching-shapes-entry ((obj touching-shapes-entry)) - (when (-> obj cshape1) - (set! (-> obj cshape1) #f) - (let ((gp-0 (-> obj head))) +(defmethod free-touching-prims-list touching-shapes-entry ((this touching-shapes-entry)) + (when (-> this cshape1) + (set! (-> this cshape1) #f) + (let ((gp-0 (-> this head))) (when gp-0 - (set! (-> obj head) #f) + (set! (-> this head) #f) (let ((s5-0 *touching-prims-entry-pool*)) (while gp-0 (let ((a1-0 gp-0)) @@ -81,25 +81,25 @@ ;; definition for method 10 of type touching-list ;; WARN: Return type mismatch int vs none. -(defmethod free-nodes touching-list ((obj touching-list)) - (let ((s5-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (s4-0 (-> obj num-touching-shapes)) +(defmethod free-nodes touching-list ((this touching-list)) + (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) (free-touching-prims-list s5-0) (&+! s5-0 32) ) ) - (set! (-> obj num-touching-shapes) 0) - (set! (-> obj resolve-u) 0) + (set! (-> this num-touching-shapes) 0) + (set! (-> this resolve-u) 0) 0 (none) ) ;; definition for method 13 of type touching-list ;; WARN: Return type mismatch object vs touching-shapes-entry. -(defmethod get-shapes-entry touching-list ((obj touching-list) (shape1 collide-shape) (shape2 collide-shape)) - (let ((entry (the-as touching-shapes-entry (-> obj touching-shapes)))) +(defmethod get-shapes-entry touching-list ((this touching-list) (shape1 collide-shape) (shape2 collide-shape)) + (let ((entry (the-as touching-shapes-entry (-> this touching-shapes)))) (let ((v1-0 (the-as touching-shapes-entry #f))) - (countdown (a3-0 (-> obj num-touching-shapes)) + (countdown (a3-0 (-> this num-touching-shapes)) (let ((t0-0 (-> entry cshape1))) (set! v1-0 (cond @@ -122,11 +122,11 @@ (set! entry v1-0) ) (else - (when (>= (-> obj num-touching-shapes) 32) + (when (>= (-> this num-touching-shapes) 32) (format 0 "ERROR: touching-list::get-shapes-entry() failed!~%") (return (the-as touching-shapes-entry #f)) ) - (+! (-> obj num-touching-shapes) 1) + (+! (-> this num-touching-shapes) 1) ) ) ) @@ -134,7 +134,7 @@ (set! (-> entry cshape2) shape2) (set! (-> entry head) #f) (set! (-> entry resolve-u) 1) - (set! (-> obj resolve-u) 1) + (set! (-> this resolve-u) 1) (set! (-> entry handle1) (process->handle (-> shape1 process))) (set! (-> entry handle2) (process->handle (-> shape2 process))) (the-as touching-shapes-entry entry) @@ -152,22 +152,22 @@ ) ;; definition for method 3 of type add-prims-touching-work -(defmethod inspect add-prims-touching-work ((obj add-prims-touching-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect add-prims-touching-work ((this add-prims-touching-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'add-prims-touching-work) - (format #t "~1Ttri1: #~%" (-> obj tri1)) - (format #t "~1Ttri2: #~%" (-> obj tri2)) + (format #t "[~8x] ~A~%" this 'add-prims-touching-work) + (format #t "~1Ttri1: #~%" (-> this tri1)) + (format #t "~1Ttri2: #~%" (-> this tri2)) (label cfg-4) - obj + this ) ;; definition for method 9 of type touching-list ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 9 touching-list) has a return type of none, but the expression builder found a return statement. -(defmethod add-touching-prims touching-list ((obj touching-list) +(defmethod add-touching-prims touching-list ((this touching-list) (arg0 collide-shape-prim) (arg1 collide-shape-prim) (arg2 float) @@ -177,7 +177,7 @@ (let ((gp-0 (new 'stack-no-clear 'add-prims-touching-work))) (set! (-> gp-0 tri1) arg3) (set! (-> gp-0 tri2) arg4) - (let ((s2-0 (get-shapes-entry obj (-> arg0 cshape) (-> arg1 cshape)))) + (let ((s2-0 (get-shapes-entry this (-> arg0 cshape) (-> arg1 cshape)))) (when s2-0 (when (= (-> s2-0 cshape1) (-> arg1 cshape)) (let ((v1-4 arg0)) @@ -235,7 +235,7 @@ (set! (-> s0-1 u) arg2) (when (>= arg2 0.0) (set! (-> s2-0 resolve-u) 1) - (set! (-> obj resolve-u) 1) + (set! (-> this resolve-u) 1) ) (let ((v1-26 (-> s0-1 prim1)) (a1-4 (-> gp-0 tri1)) @@ -276,11 +276,11 @@ ;; definition for method 11 of type touching-list ;; WARN: Return type mismatch int vs none. -(defmethod update-from-step-size touching-list ((obj touching-list) (arg0 float)) - (when (nonzero? (-> obj resolve-u)) - (set! (-> obj resolve-u) 0) - (let ((s5-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (s4-0 (-> obj num-touching-shapes)) +(defmethod update-from-step-size touching-list ((this touching-list) (arg0 float)) + (when (nonzero? (-> this resolve-u)) + (set! (-> this resolve-u) 0) + (let ((s5-0 (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (s4-0 (-> this num-touching-shapes)) (when (nonzero? (-> s5-0 resolve-u)) (set! (-> s5-0 resolve-u) 0) (when (-> s5-0 cshape1) @@ -337,9 +337,9 @@ ;; definition for method 12 of type touching-list ;; WARN: Return type mismatch int vs none. -(defmethod send-events-for-touching-shapes touching-list ((obj touching-list)) - (let ((gp-0 (the-as touching-shapes-entry (-> obj touching-shapes)))) - (countdown (s5-0 (-> obj num-touching-shapes)) +(defmethod send-events-for-touching-shapes touching-list ((this touching-list)) + (let ((gp-0 (the-as touching-shapes-entry (-> this touching-shapes)))) + (countdown (s5-0 (-> this num-touching-shapes)) (let ((s3-0 (-> gp-0 cshape1))) (when s3-0 (let ((s4-0 (handle->process (-> gp-0 handle1))) @@ -390,10 +390,10 @@ ) ;; definition for method 12 of type touching-shapes-entry -(defmethod prims-touching? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape) (arg1 uint)) +(defmethod prims-touching? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 uint)) (cond - ((= (-> obj cshape1) arg0) - (let ((v1-1 (-> obj head))) + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) (while v1-1 (if (logtest? (-> v1-1 prim1 cprim prim-id) arg1) (return v1-1) @@ -402,8 +402,8 @@ ) ) ) - ((= (-> obj cshape2) arg0) - (let ((v1-4 (-> obj head))) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) (while v1-4 (if (logtest? (-> v1-4 prim2 cprim prim-id) arg1) (return v1-4) @@ -421,10 +421,10 @@ ;; definition for method 13 of type touching-shapes-entry ;; WARN: Return type mismatch touching-prims-entry vs basic. -(defmethod prims-touching-action? touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) +(defmethod prims-touching-action? touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape) (arg1 collide-action) (arg2 collide-action)) (cond - ((= (-> obj cshape1) arg0) - (let ((v1-1 (-> obj head))) + ((= (-> this cshape1) arg0) + (let ((v1-1 (-> this head))) (while v1-1 (let ((a0-1 (-> v1-1 prim1 cprim))) (if (and (logtest? arg1 (-> a0-1 prim-core action)) (not (logtest? arg2 (-> a0-1 prim-core action)))) @@ -435,8 +435,8 @@ ) ) ) - ((= (-> obj cshape2) arg0) - (let ((v1-4 (-> obj head))) + ((= (-> this cshape2) arg0) + (let ((v1-4 (-> this head))) (while v1-4 (let ((a0-5 (-> v1-4 prim2 cprim))) (if (and (logtest? arg1 (-> a0-5 prim-core action)) (not (logtest? arg2 (-> a0-5 prim-core action)))) @@ -455,46 +455,46 @@ ) ;; definition for method 11 of type touching-shapes-entry -(defmethod get-touched-shape touching-shapes-entry ((obj touching-shapes-entry) (arg0 collide-shape)) +(defmethod get-touched-shape touching-shapes-entry ((this touching-shapes-entry) (arg0 collide-shape)) (cond - ((= (-> obj cshape1) arg0) - (return (-> obj cshape2)) + ((= (-> this cshape1) arg0) + (return (-> this cshape2)) ) - ((= (-> obj cshape2) arg0) - (return (-> obj cshape1)) + ((= (-> this cshape2) arg0) + (return (-> this cshape1)) ) ) (the-as collide-shape #f) ) ;; definition for method 10 of type touching-prims-entry -(defmethod get-touched-prim touching-prims-entry ((obj touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-prim touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) (cond ((= (-> arg1 cshape1) arg0) - (return (-> obj prim1 cprim)) + (return (-> this prim1 cprim)) ) ((= (-> arg1 cshape2) arg0) - (return (-> obj prim2 cprim)) + (return (-> this prim2 cprim)) ) ) (the-as collide-shape-prim #f) ) ;; definition for method 11 of type touching-prims-entry -(defmethod get-touched-tri touching-prims-entry ((obj touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) +(defmethod get-touched-tri touching-prims-entry ((this touching-prims-entry) (arg0 collide-shape) (arg1 touching-shapes-entry)) (let ((v0-0 (the-as collide-tri-result #f))) (cond - ((not obj) + ((not this) ) ((= (-> arg1 cshape1) arg0) - (let ((v1-4 (-> obj prim1))) + (let ((v1-4 (-> this prim1))) (if (-> v1-4 has-tri?) (set! v0-0 (-> v1-4 tri)) ) ) ) ((= (-> arg1 cshape2) arg0) - (let ((v1-7 (-> obj prim2))) + (let ((v1-7 (-> this prim2))) (if (-> v1-7 has-tri?) (set! v0-0 (-> v1-7 tri)) ) @@ -506,9 +506,9 @@ ) ;; definition for method 9 of type touching-prims-entry -(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((obj touching-prims-entry) (arg0 vector)) - (let* ((s4-0 (-> obj prim1 cprim)) - (v1-0 (-> obj prim2 cprim)) +(defmethod get-middle-of-bsphere-overlap touching-prims-entry ((this touching-prims-entry) (arg0 vector)) + (let* ((s4-0 (-> this prim1 cprim)) + (v1-0 (-> this prim2 cprim)) (gp-1 (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> v1-0 prim-core)) diff --git a/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc b/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc index 51fd7c531a..825b9f2d97 100644 --- a/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/find-nearest_REF.gc @@ -22,20 +22,20 @@ ) ;; definition for method 3 of type search-info -(defmethod inspect search-info ((obj search-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect search-info ((this search-info)) + (when (not this) + (set! this this) (goto cfg-88) ) - (format #t "[~8x] ~A~%" obj 'search-info) - (format #t "~1Tpoint: ~`vector`P~%" (-> obj point)) - (format #t "~1Tbest-point: ~`vector`P~%" (-> obj best-point)) - (format #t "~1Tmatch-handle: ~D~%" (-> obj match-handle)) - (format #t "~1Tmatch: ~A~%" (-> obj match)) - (format #t "~1Tbest: ~f~%" (-> obj best)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) - (format #t "~1Trating: #x~X : (search-info-flag " (-> obj rating)) - (let ((s5-0 (-> obj rating))) + (format #t "[~8x] ~A~%" this 'search-info) + (format #t "~1Tpoint: ~`vector`P~%" (-> this point)) + (format #t "~1Tbest-point: ~`vector`P~%" (-> this best-point)) + (format #t "~1Tmatch-handle: ~D~%" (-> this match-handle)) + (format #t "~1Tmatch: ~A~%" (-> this match)) + (format #t "~1Tbest: ~f~%" (-> this best)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Trating: #x~X : (search-info-flag " (-> this rating)) + (let ((s5-0 (-> this rating))) (if (= (logand s5-0 (search-info-flag prefer-xz)) (search-info-flag prefer-xz)) (format #t "prefer-xz ") ) @@ -80,8 +80,8 @@ ) ) (format #t ")~%") - (format #t "~1Trequire: #x~X : (search-info-flag " (-> obj require)) - (let ((s5-1 (-> obj require))) + (format #t "~1Trequire: #x~X : (search-info-flag " (-> this require)) + (let ((s5-1 (-> this require))) (if (= (logand s5-1 (search-info-flag prefer-xz)) (search-info-flag prefer-xz)) (format #t "prefer-xz ") ) @@ -126,8 +126,8 @@ ) ) (format #t ")~%") - (format #t "~1Tmask: #x~X : (search-info-flag " (-> obj mask)) - (let ((s5-2 (-> obj mask))) + (format #t "~1Tmask: #x~X : (search-info-flag " (-> this mask)) + (let ((s5-2 (-> this mask))) (if (= (logand s5-2 (search-info-flag prefer-xz)) (search-info-flag prefer-xz)) (format #t "prefer-xz ") ) @@ -172,11 +172,11 @@ ) ) (format #t ")~%") - (format #t "~1Trot-base: ~`vector`P~%" (-> obj rot-base)) - (format #t "~1Tback-point: ~`vector`P~%" (-> obj ack-point)) - (format #t "~1Trot-range: ~f~%" (-> obj rot-range)) + (format #t "~1Trot-base: ~`vector`P~%" (-> this rot-base)) + (format #t "~1Tback-point: ~`vector`P~%" (-> this ack-point)) + (format #t "~1Trot-range: ~f~%" (-> this rot-range)) (label cfg-88) - obj + this ) ;; definition for symbol *search-info*, type search-info @@ -552,7 +552,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/collide/los-control-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/los-control-h_REF.gc index a8c00777bd..8cca793840 100644 --- a/test/decompiler/reference/jak2/engine/collide/los-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/los-control-h_REF.gc @@ -25,22 +25,22 @@ ) ;; definition for method 3 of type los-control -(defmethod inspect los-control ((obj los-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect los-control ((this los-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'los-control) - (format #t "~1Tsrc-proc: ~D~%" (-> obj src-proc)) - (format #t "~1Tdst-proc: ~D~%" (-> obj dst-proc)) - (format #t "~1Thave-los: ~D~%" (-> obj have-los)) - (format #t "~1Thave-no-los: ~D~%" (-> obj have-no-los)) - (format #t "~1Tcheck-interval: ~D~%" (-> obj check-interval)) - (format #t "~1Tlast-check-time: ~D~%" (-> obj last-check-time)) - (format #t "~1Tlast-collide-result: #~%" (-> obj last-collide-result)) - (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) + (format #t "[~8x] ~A~%" this 'los-control) + (format #t "~1Tsrc-proc: ~D~%" (-> this src-proc)) + (format #t "~1Tdst-proc: ~D~%" (-> this dst-proc)) + (format #t "~1Thave-los: ~D~%" (-> this have-los)) + (format #t "~1Thave-no-los: ~D~%" (-> this have-no-los)) + (format #t "~1Tcheck-interval: ~D~%" (-> this check-interval)) + (format #t "~1Tlast-check-time: ~D~%" (-> this last-check-time)) + (format #t "~1Tlast-collide-result: #~%" (-> this last-collide-result)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/collide/los-control_REF.gc b/test/decompiler/reference/jak2/engine/collide/los-control_REF.gc index 44db1945fb..01c4360e9b 100644 --- a/test/decompiler/reference/jak2/engine/collide/los-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/los-control_REF.gc @@ -7,12 +7,12 @@ ;; definition for method 9 of type los-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch time-frame vs none. -(defmethod los-control-method-9 los-control ((obj los-control) (process process-focusable) (trans-vec vector) (radius float)) - (when (and (>= (- (current-time) (-> obj last-check-time)) (-> obj check-interval)) - (-> obj src-proc) - (or process (-> obj dst-proc)) +(defmethod los-control-method-9 los-control ((this los-control) (process process-focusable) (trans-vec vector) (radius float)) + (when (and (time-elapsed? (-> this last-check-time) (-> this check-interval)) + (-> this src-proc) + (or process (-> this dst-proc)) ) - (let* ((process-source (handle->process (-> obj src-proc))) + (let* ((process-source (handle->process (-> this src-proc))) (process-focus (if (type? process-source process-focusable) (the-as process-focusable process-source) ) @@ -20,7 +20,7 @@ ) (when process-focus (when (not process) - (let ((process-dest (handle->process (-> obj dst-proc)))) + (let ((process-dest (handle->process (-> this dst-proc)))) (set! process (if (type? process-dest process-focusable) (the-as process-focusable process-dest) ) @@ -40,7 +40,7 @@ (set! (-> cquery move-dist quad) (-> distance quad)) (let ((query cquery)) (set! (-> query radius) radius) - (set! (-> query collide-with) (-> obj collide-with)) + (set! (-> query collide-with) (-> this collide-with)) (set! (-> query ignore-process0) process-focus) (set! (-> query ignore-process1) process) (set! (-> query ignore-pat) (-> process-focus root pat-ignore-mask)) @@ -48,15 +48,15 @@ ) (fill-using-line-sphere *collide-cache* cquery) (let ((f30-0 (probe-using-line-sphere *collide-cache* cquery))) - (quad-copy! (the-as pointer (-> obj last-collide-result)) (the-as pointer (-> cquery best-other-tri)) 6) + (quad-copy! (the-as pointer (-> this last-collide-result)) (the-as pointer (-> cquery best-other-tri)) 6) (if (>= 0.0 f30-0) - (set! (-> obj have-no-los) (current-time)) - (set! (-> obj have-los) (current-time)) + (set-time! (-> this have-no-los)) + (set-time! (-> this have-los)) ) ) ) ) - (set! (-> obj last-check-time) (current-time)) + (set-time! (-> this last-check-time)) ) ) ) @@ -65,37 +65,37 @@ ) ;; definition for method 10 of type los-control -(defmethod check-los? los-control ((obj los-control) (arg0 time-frame)) - (and (>= (- (current-time) (-> obj have-los)) (+ (-> obj check-interval) arg0)) - (< (- (current-time) (-> obj have-no-los)) (-> obj check-interval)) +(defmethod check-los? los-control ((this los-control) (arg0 time-frame)) + (and (time-elapsed? (-> this have-los) (+ (-> this check-interval) arg0)) + (not (time-elapsed? (-> this have-no-los) (-> this check-interval))) ) ) ;; definition for method 11 of type los-control -(defmethod skip-check-los? los-control ((obj los-control) (arg0 int)) - (and (>= (- (current-time) (-> obj have-no-los)) (+ (-> obj check-interval) arg0)) - (< (- (current-time) (-> obj have-los)) (-> obj check-interval)) +(defmethod skip-check-los? los-control ((this los-control) (arg0 int)) + (and (time-elapsed? (-> this have-no-los) (+ (-> this check-interval) arg0)) + (not (time-elapsed? (-> this have-los) (-> this check-interval))) ) ) ;; definition for method 12 of type los-control ;; WARN: Return type mismatch int vs none. -(defmethod set-dst-proc! los-control ((obj los-control) (dst handle)) - (set! (-> obj dst-proc) dst) +(defmethod set-dst-proc! los-control ((this los-control) (dst handle)) + (set! (-> this dst-proc) dst) 0 (none) ) ;; definition for method 13 of type los-control ;; WARN: Return type mismatch int vs none. -(defmethod new-source! los-control ((obj los-control) (proc process) (check-interval time-frame) (c-spec collide-spec)) - (set! (-> obj src-proc) (process->handle proc)) - (set! (-> obj dst-proc) (the-as handle #f)) - (set! (-> obj have-los) 0) - (set! (-> obj have-no-los) 0) - (set! (-> obj last-check-time) *los-time-offset*) - (set! (-> obj check-interval) check-interval) - (set! (-> obj collide-with) c-spec) +(defmethod new-source! los-control ((this los-control) (proc process) (check-interval time-frame) (c-spec collide-spec)) + (set! (-> this src-proc) (process->handle proc)) + (set! (-> this dst-proc) (the-as handle #f)) + (set! (-> this have-los) 0) + (set! (-> this have-no-los) 0) + (set! (-> this last-check-time) *los-time-offset*) + (set! (-> this check-interval) check-interval) + (set! (-> this collide-with) c-spec) (set! *los-time-offset* (+ *los-time-offset* 1)) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc index 782e24ea71..ecb31174b4 100644 --- a/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc @@ -29,34 +29,34 @@ ) ;; definition for method 3 of type pat-surface -(defmethod inspect pat-surface ((obj pat-surface)) - (when (not obj) - (set! obj obj) +(defmethod inspect pat-surface ((this pat-surface)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pat-surface) - (format #t "~1Tskip: ~D~%" (-> obj skip)) - (format #t "~1Tmode: ~D~%" (-> obj mode)) - (format #t "~1Tmaterial: ~D~%" (-> obj material)) - (format #t "~1Tcamera: ~D~%" (-> obj camera)) - (format #t "~1Tevent: ~D~%" (-> obj event)) - (format #t "~1Tskip2: ~D~%" (-> obj skip2)) - (format #t "~1Tnoentity: ~D~%" (-> obj noentity)) - (format #t "~1Tnocamera: ~D~%" (-> obj nocamera)) - (format #t "~1Tnoedge: ~D~%" (-> obj noedge)) - (format #t "~1Tnogrind: ~D~%" (-> obj nogrind)) - (format #t "~1Tnojak: ~D~%" (-> obj nojak)) - (format #t "~1Tnoboard: ~D~%" (-> obj noboard)) - (format #t "~1Tnopilot: ~D~%" (-> obj nopilot)) - (format #t "~1Tprobe: ~D~%" (-> obj probe)) - (format #t "~1Tnomech: ~D~%" (-> obj nomech)) - (format #t "~1Tnoproj: ~D~%" (-> obj noproj)) - (format #t "~1Tnoendlessfall: ~D~%" (-> obj noendlessfall)) - (format #t "~1Tnoprobe: ~D~%" (-> obj noprobe)) - (format #t "~1Tnolineofsight: ~D~%" (-> obj camera)) - (format #t "~1Tboard: ~D~%" (-> obj nojak)) + (format #t "[~8x] ~A~%" this 'pat-surface) + (format #t "~1Tskip: ~D~%" (-> this skip)) + (format #t "~1Tmode: ~D~%" (-> this mode)) + (format #t "~1Tmaterial: ~D~%" (-> this material)) + (format #t "~1Tcamera: ~D~%" (-> this camera)) + (format #t "~1Tevent: ~D~%" (-> this event)) + (format #t "~1Tskip2: ~D~%" (-> this skip2)) + (format #t "~1Tnoentity: ~D~%" (-> this noentity)) + (format #t "~1Tnocamera: ~D~%" (-> this nocamera)) + (format #t "~1Tnoedge: ~D~%" (-> this noedge)) + (format #t "~1Tnogrind: ~D~%" (-> this nogrind)) + (format #t "~1Tnojak: ~D~%" (-> this nojak)) + (format #t "~1Tnoboard: ~D~%" (-> this noboard)) + (format #t "~1Tnopilot: ~D~%" (-> this nopilot)) + (format #t "~1Tprobe: ~D~%" (-> this probe)) + (format #t "~1Tnomech: ~D~%" (-> this nomech)) + (format #t "~1Tnoproj: ~D~%" (-> this noproj)) + (format #t "~1Tnoendlessfall: ~D~%" (-> this noendlessfall)) + (format #t "~1Tnoprobe: ~D~%" (-> this noprobe)) + (format #t "~1Tnolineofsight: ~D~%" (-> this camera)) + (format #t "~1Tboard: ~D~%" (-> this nojak)) (label cfg-4) - obj + this ) ;; definition (debug) for function pat-material->string @@ -243,18 +243,18 @@ ) ;; definition for method 3 of type pat-mode-info -(defmethod inspect pat-mode-info ((obj pat-mode-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect pat-mode-info ((this pat-mode-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pat-mode-info) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Twall-angle: ~f~%" (-> obj wall-angle)) - (format #t "~1Tcolor: ~D~%" (-> obj color)) - (format #t "~1Thilite-color: ~D~%" (-> obj hilite-color)) + (format #t "[~8x] ~A~%" this 'pat-mode-info) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Twall-angle: ~f~%" (-> this wall-angle)) + (format #t "~1Tcolor: ~D~%" (-> this color)) + (format #t "~1Thilite-color: ~D~%" (-> this hilite-color)) (label cfg-4) - obj + this ) ;; definition for symbol *pat-mode-info*, type (inline-array pat-mode-info) diff --git a/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc index bc2582ce9a..3e73d87cb9 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/base-plat_REF.gc @@ -26,26 +26,26 @@ ) ;; definition for method 3 of type base-plat -(defmethod inspect base-plat ((obj base-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect base-plat ((this base-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsmush: #~%" (-> obj smush)) - (format #t "~2Tbasetrans: #~%" (-> obj basetrans)) - (format #t "~2Tbounce-time: ~D~%" (-> obj bounce-time)) - (format #t "~2Tbouncing: ~A~%" (-> obj bouncing)) - (format #t "~2Tbounce-scale: (meters ~m)~%" (-> obj bounce-scale)) + (format #t "~2Tsmush: #~%" (-> this smush)) + (format #t "~2Tbasetrans: #~%" (-> this basetrans)) + (format #t "~2Tbounce-time: ~D~%" (-> this bounce-time)) + (format #t "~2Tbouncing: ~A~%" (-> this bouncing)) + (format #t "~2Tbounce-scale: (meters ~m)~%" (-> this bounce-scale)) (label cfg-4) - obj + this ) ;; definition for method 33 of type base-plat ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! base-plat ((obj base-plat)) +(defmethod init-plat! base-plat ((this base-plat)) "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." 0 @@ -55,27 +55,27 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 28 of type base-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod stop-bouncing! base-plat ((obj base-plat)) +(defmethod stop-bouncing! base-plat ((this base-plat)) "Sets `bouncing` to false and resets related settings to their defaults" - (set! (-> obj basetrans quad) (-> obj root trans quad)) - (set! (-> obj bouncing) #f) - (set! (-> obj bounce-scale) 819.2) + (set! (-> this basetrans quad) (-> this root trans quad)) + (set! (-> this bouncing) #f) + (set! (-> this bounce-scale) 819.2) 0 (none) ) ;; definition for method 29 of type base-plat ;; WARN: Return type mismatch int vs none. -(defmethod start-bouncing! base-plat ((obj base-plat)) +(defmethod start-bouncing! base-plat ((this base-plat)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (activate! (-> obj smush) -1.0 60 150 1.0 1.0 (-> self clock)) - (set! (-> obj bounce-time) (current-time)) - (set! (-> obj bouncing) #t) - (sound-play "plat-bounce" :position (-> obj root trans)) - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) + (activate! (-> this smush) -1.0 60 150 1.0 1.0 (-> self clock)) + (set-time! (-> this bounce-time)) + (set! (-> this bouncing) #t) + (sound-play "plat-bounce" :position (-> this root trans)) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -140,7 +140,7 @@ If we aren't bouncing however, TODO - CSHAPE" ;; definition for method 32 of type base-plat ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 base-plat ((obj base-plat)) +(defmethod base-plat-method-32 base-plat ((this base-plat)) 0 (none) ) @@ -148,14 +148,14 @@ If we aren't bouncing however, TODO - CSHAPE" ;; definition for method 27 of type base-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod execute-effects base-plat ((obj base-plat)) +(defmethod execute-effects base-plat ((this base-plat)) "Executes various ancillary tasks with the platform, such as spawning particles or playing the associated sound" - (if (nonzero? (-> obj part)) - (spawn (-> obj part) (-> obj root trans)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) ) - (when (nonzero? (-> obj sound)) - (set! (-> obj sound trans quad) (-> obj root trans quad)) - (update! (-> obj sound)) + (when (nonzero? (-> this sound)) + (set! (-> this sound trans quad) (-> this root trans quad)) + (update! (-> this sound)) ) (none) ) @@ -205,27 +205,27 @@ If we aren't bouncing however, TODO - CSHAPE" ;; definition for method 3 of type eco-door ;; INFO: Used lq/sq -(defmethod inspect eco-door ((obj eco-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect eco-door ((this eco-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspeed: ~f~%" (-> obj speed)) - (format #t "~2Topen-distance: ~f~%" (-> obj open-distance)) - (format #t "~2Tclose-distance: ~f~%" (-> obj close-distance)) - (format #t "~2Tout-dir: #~%" (-> obj out-dir)) - (format #t "~2Topen-sound: ~D~%" (-> obj open-sound)) - (format #t "~2Tclose-sound: ~D~%" (-> obj close-sound)) - (format #t "~2Tstate-actor: ~A~%" (-> obj state-actor)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tlocked: ~A~%" (-> obj locked)) - (format #t "~2Tauto-close: ~A~%" (-> obj auto-close)) - (format #t "~2Tone-way: ~A~%" (-> obj one-way)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Topen-distance: ~f~%" (-> this open-distance)) + (format #t "~2Tclose-distance: ~f~%" (-> this close-distance)) + (format #t "~2Tout-dir: #~%" (-> this out-dir)) + (format #t "~2Topen-sound: ~D~%" (-> this open-sound)) + (format #t "~2Tclose-sound: ~D~%" (-> this close-sound)) + (format #t "~2Tstate-actor: ~A~%" (-> this state-actor)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tlocked: ~A~%" (-> this locked)) + (format #t "~2Tauto-close: ~A~%" (-> this auto-close)) + (format #t "~2Tone-way: ~A~%" (-> this one-way)) (label cfg-4) - obj + this ) ;; definition for function eco-door-event-handler @@ -318,7 +318,7 @@ eco-door-event-handler :virtual #t :event eco-door-event-handler :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status subtask-complete) #t) (let ((prim (-> self root root-prim))) (set! (-> prim prim-core collide-as) (collide-spec)) @@ -384,13 +384,13 @@ eco-door-event-handler ;; definition for method 24 of type eco-door ;; WARN: Return type mismatch int vs none. -(defmethod lock-according-to-task! eco-door ((obj eco-door)) +(defmethod lock-according-to-task! eco-door ((this eco-door)) "If the associated subtask is completed, lock the door if [[eco-door-flags:0]] is set otherwise, lock it if [[eco-door-flags:0]] is set" - (when (-> obj state-actor) - (if (logtest? (-> obj state-actor extra perm status) (entity-perm-status subtask-complete)) - (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf01))) - (set! (-> obj locked) (logtest? (-> obj flags) (eco-door-flags ecdf00))) + (when (-> this state-actor) + (if (logtest? (-> this state-actor extra perm status) (entity-perm-status subtask-complete)) + (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf01))) + (set! (-> this locked) (logtest? (-> this flags) (eco-door-flags ecdf00))) ) ) 0 @@ -399,8 +399,8 @@ otherwise, lock it if [[eco-door-flags:0]] is set" ;; definition for method 25 of type eco-door ;; WARN: Return type mismatch int vs none. -(defmethod eco-door-method-25 eco-door ((obj eco-door)) - (let ((collision-shape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod eco-door-method-25 eco-door ((this eco-door)) + (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) (set! (-> collision-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> collision-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -415,7 +415,7 @@ otherwise, lock it if [[eco-door-flags:0]] is set" (set! (-> collision-shape backup-collide-as) (-> prim prim-core collide-as)) (set! (-> collision-shape backup-collide-with) (-> prim prim-core collide-with)) ) - (set! (-> obj root) collision-shape) + (set! (-> this root) collision-shape) ) 0 (none) @@ -423,7 +423,7 @@ otherwise, lock it if [[eco-door-flags:0]] is set" ;; definition for method 26 of type eco-door ;; WARN: Return type mismatch int vs none. -(defmethod stub eco-door ((obj eco-door)) +(defmethod stub eco-door ((this eco-door)) "@unused - Stub with no overrides" 0 (none) @@ -431,42 +431,42 @@ otherwise, lock it if [[eco-door-flags:0]] is set" ;; definition for method 11 of type eco-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! eco-door ((obj eco-door) (arg0 entity-actor)) +(defmethod init-from-entity! eco-door ((this eco-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (eco-door-method-25 obj) - (process-drawable-from-entity! obj arg0) - (let ((door-scale (res-lump-float (-> obj entity) 'scale :default 1.0))) - (set-vector! (-> obj root scale) door-scale door-scale door-scale 1.0) + (eco-door-method-25 this) + (process-drawable-from-entity! this arg0) + (let ((door-scale (res-lump-float (-> this entity) 'scale :default 1.0))) + (set-vector! (-> this root scale) door-scale door-scale door-scale 1.0) ) - (set! (-> obj open-distance) 32768.0) - (set! (-> obj close-distance) 49152.0) - (set! (-> obj speed) 1.0) - (set! (-> obj state-actor) #f) + (set! (-> this open-distance) 32768.0) + (set! (-> this close-distance) 49152.0) + (set! (-> this speed) 1.0) + (set! (-> this state-actor) #f) (let ((state-actor (entity-actor-lookup arg0 'state-actor 0))) (if state-actor - (set! (-> obj state-actor) state-actor) + (set! (-> this state-actor) state-actor) ) ) - (set! (-> obj locked) #f) - (set! (-> obj flags) (res-lump-value arg0 'flags eco-door-flags :time -1000000000.0)) - (lock-according-to-task! obj) - (set! (-> obj auto-close) (logtest? (-> obj flags) (eco-door-flags auto-close))) - (set! (-> obj one-way) (logtest? (-> obj flags) (eco-door-flags one-way))) - (vector-z-quaternion! (-> obj out-dir) (-> obj root quat)) - (set! (-> obj out-dir w) (- (vector-dot (-> obj out-dir) (-> obj root trans)))) - (update-transforms (-> obj root)) - (stub obj) - (if (and (not (-> obj auto-close)) - (-> obj entity) - (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) + (set! (-> this locked) #f) + (set! (-> this flags) (res-lump-value arg0 'flags eco-door-flags :time -1000000000.0)) + (lock-according-to-task! this) + (set! (-> this auto-close) (logtest? (-> this flags) (eco-door-flags auto-close))) + (set! (-> this one-way) (logtest? (-> this flags) (eco-door-flags one-way))) + (vector-z-quaternion! (-> this out-dir) (-> this root quat)) + (set! (-> this out-dir w) (- (vector-dot (-> this out-dir) (-> this root trans)))) + (update-transforms (-> this root)) + (stub this) + (if (and (not (-> this auto-close)) + (-> this entity) + (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) ) - (go (method-of-object obj door-open)) - (go (method-of-object obj door-closed)) + (go (method-of-object this door-open)) + (go (method-of-object this door-closed)) ) (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc index 2f62a7dc50..6a35df6fe3 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/basebutton_REF.gc @@ -38,32 +38,32 @@ ) ;; definition for method 3 of type basebutton -(defmethod inspect basebutton ((obj basebutton)) - (when (not obj) - (set! obj obj) +(defmethod inspect basebutton ((this basebutton)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbutton-status: ~D~%" (-> obj button-status)) - (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tbutton-status: ~D~%" (-> this button-status)) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Ttimeout: ~f~%" (-> obj timeout)) - (format #t "~2Tbutton-id: ~D~%" (-> obj button-id)) - (format #t "~2Tevent-going-down: ~A~%" (-> obj event-going-down)) - (format #t "~2Tevent-down: ~A~%" (-> obj event-down)) - (format #t "~2Tevent-going-up: ~A~%" (-> obj event-going-up)) - (format #t "~2Tevent-up: ~A~%" (-> obj event-up)) - (format #t "~2Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~2Tmove-to-pos: #~%" (-> obj move-to-pos)) - (format #t "~2Tmove-to-quat: #~%" (-> obj move-to-quat)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Ttimeout: ~f~%" (-> this timeout)) + (format #t "~2Tbutton-id: ~D~%" (-> this button-id)) + (format #t "~2Tevent-going-down: ~A~%" (-> this event-going-down)) + (format #t "~2Tevent-down: ~A~%" (-> this event-down)) + (format #t "~2Tevent-going-up: ~A~%" (-> this event-going-up)) + (format #t "~2Tevent-up: ~A~%" (-> this event-up)) + (format #t "~2Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~2Tmove-to-pos: #~%" (-> this move-to-pos)) + (format #t "~2Tmove-to-quat: #~%" (-> this move-to-quat)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -75,26 +75,26 @@ ;; definition for method 37 of type basebutton ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-to! basebutton ((obj basebutton) (vec vector) (quat quaternion)) - (logclear! (-> obj button-status) (button-status button-status-2)) +(defmethod move-to! basebutton ((this basebutton) (vec vector) (quat quaternion)) + (logclear! (-> this button-status) (button-status button-status-2)) (if vec - (set! (-> obj move-to-pos quad) (-> vec quad)) - (set! (-> obj move-to-pos quad) (-> obj root trans quad)) + (set! (-> this move-to-pos quad) (-> vec quad)) + (set! (-> this move-to-pos quad) (-> this root trans quad)) ) (if quat - (quaternion-copy! (-> obj move-to-quat) quat) - (quaternion-copy! (-> obj move-to-quat) (-> obj root quat)) + (quaternion-copy! (-> this move-to-quat) quat) + (quaternion-copy! (-> this move-to-quat) (-> this root quat)) ) 0 (none) ) ;; definition for method 32 of type basebutton -(defmethod idle-state-transition basebutton ((obj basebutton)) +(defmethod idle-state-transition basebutton ((this basebutton)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" - (if (logtest? (-> obj button-status) (button-status pressed)) - (go (method-of-object obj down-idle)) - (go (method-of-object obj up-idle)) + (if (logtest? (-> this button-status) (button-status pressed)) + (go (method-of-object this down-idle)) + (go (method-of-object this up-idle)) ) ) @@ -207,7 +207,7 @@ ) :enter (behavior () (press! self #t) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (logtest? (-> self button-status) (button-status button-status-2)) @@ -220,7 +220,7 @@ (sleep-code) ) (else - (until (>= (- (current-time) (-> self state-time)) (the int (* 300.0 (-> self timeout)))) + (until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout)))) (suspend) ) (send-event! self (-> self event-going-up)) @@ -276,22 +276,22 @@ ) ;; definition for method 38 of type basebutton -(defmethod press! basebutton ((obj basebutton) (pressed? symbol)) +(defmethod press! basebutton ((this basebutton) (pressed? symbol)) (if pressed? - (logior! (-> obj button-status) (button-status pressed)) - (logclear! (-> obj button-status) (button-status pressed)) + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) ) - (when (not (logtest? (-> obj button-status) (button-status button-status-1))) + (when (not (logtest? (-> this button-status) (button-status button-status-1))) (if pressed? - (process-entity-status! obj (entity-perm-status subtask-complete) #t) - (process-entity-status! obj (entity-perm-status subtask-complete) #f) + (process-entity-status! this (entity-perm-status subtask-complete) #t) + (process-entity-status! this (entity-perm-status subtask-complete) #f) ) ) ) ;; definition for method 36 of type basebutton ;; WARN: Return type mismatch int vs none. -(defmethod send-event! basebutton ((obj basebutton) (event-type symbol)) +(defmethod send-event! basebutton ((this basebutton) (event-type symbol)) "Prepares an [[event-message-block]] using the provided type to send an event to: - the `notify-actor` - every [[entity-actor]] in the `actor-group` array @@ -302,7 +302,7 @@ (set! (-> event num-params) 0) (set! (-> event message) event-type) (let ((func send-event-function) - (actor (-> obj notify-actor)) + (actor (-> this notify-actor)) ) (func (if actor @@ -310,8 +310,8 @@ ) event ) - (dotimes (actor-group-idx (-> obj actor-group-count)) - (let ((actor-group (-> obj actor-group actor-group-idx))) + (dotimes (actor-group-idx (-> this actor-group-count)) + (let ((actor-group (-> this actor-group actor-group-idx))) (dotimes (actor-idx (-> actor-group length)) (set! event (new 'stack-no-clear 'event-message-block)) (set! (-> event from) (process->ppointer self)) @@ -337,72 +337,72 @@ ;; definition for method 31 of type basebutton ;; WARN: Return type mismatch int vs none. -(defmethod reset! basebutton ((obj basebutton)) - (set! (-> obj button-status) (button-status)) - (set! (-> obj notify-actor) #f) - (set! (-> obj timeout) 0.0) - (set! (-> obj event-going-down) #f) - (set! (-> obj event-down) #f) - (set! (-> obj event-going-up) #f) - (set! (-> obj event-up) #f) - (set! (-> obj anim-speed) 1.0) +(defmethod reset! basebutton ((this basebutton)) + (set! (-> this button-status) (button-status)) + (set! (-> this notify-actor) #f) + (set! (-> this timeout) 0.0) + (set! (-> this event-going-down) #f) + (set! (-> this event-down) #f) + (set! (-> this event-going-up) #f) + (set! (-> this event-up) #f) + (set! (-> this anim-speed) 1.0) 0 (none) ) ;; definition for method 35 of type basebutton ;; WARN: Return type mismatch int vs none. -(defmethod prepare-trigger-event! basebutton ((obj basebutton)) +(defmethod prepare-trigger-event! basebutton ((this basebutton)) "Sets `event-going-down` to `'trigger`" - (set! (-> obj event-going-down) 'trigger) + (set! (-> this event-going-down) 'trigger) 0 (none) ) ;; definition for method 33 of type basebutton ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 basebutton ((obj basebutton)) +(defmethod basebutton-method-33 basebutton ((this basebutton)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-generic-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) - (let ((channel-0 (-> obj skel root-channel 0))) + ((logtest? (-> this button-status) (button-status pressed)) + (let ((channel-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! channel-0 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> channel-0 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) ) ) (else - (let ((channel-1 (-> obj skel root-channel 0))) + (let ((channel-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! channel-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> channel-1 frame-num) 0.0) ) ) ) - (set! (-> obj anim-speed) 2.0) + (set! (-> this anim-speed) 2.0) (transform-post) (none) ) ;; definition for method 34 of type basebutton ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-34 basebutton ((obj basebutton)) +(defmethod basebutton-method-34 basebutton ((this basebutton)) "TODO - collision stuff" - (let ((collision-shape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) (set! (-> collision-mesh prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> collision-mesh prim-core collide-with) (collide-spec jak bot player-list)) @@ -418,7 +418,7 @@ (set! (-> collision-shape backup-collide-as) (-> prim prim-core collide-as)) (set! (-> collision-shape backup-collide-with) (-> prim prim-core collide-with)) ) - (set! (-> obj root) collision-shape) + (set! (-> this root) collision-shape) ) 0 (none) @@ -427,7 +427,7 @@ ;; definition for method 11 of type basebutton ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! basebutton ((obj basebutton) (arg0 entity-actor)) +(defmethod init-from-entity! basebutton ((this basebutton) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -435,41 +435,41 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (reset! obj) - (set! (-> obj button-id) -1) - (let ((v1-4 (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (reset! this) + (set! (-> this button-id) -1) + (let ((v1-4 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) (if (>= (the-as int v1-4) 0) - (set! (-> obj button-id) (the-as int v1-4)) + (set! (-> this button-id) (the-as int v1-4)) ) ) - (basebutton-method-34 obj) - (process-drawable-from-entity! obj arg0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (logior! (-> obj button-status) (button-status pressed)) - (logclear! (-> obj button-status) (button-status pressed)) + (basebutton-method-34 this) + (process-drawable-from-entity! this arg0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-15 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-15 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-15 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-15)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-15)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj timeout) (res-lump-float arg0 'timeout)) - (if (not (logtest? (-> obj button-status) (button-status button-status-1))) - (nav-mesh-connect-from-ent obj) + (set! (-> this timeout) (res-lump-float arg0 'timeout)) + (if (not (logtest? (-> this button-status) (button-status button-status-1))) + (nav-mesh-connect-from-ent this) ) - (prepare-trigger-event! obj) - (basebutton-method-33 obj) - (idle-state-transition obj) + (prepare-trigger-event! this) + (basebutton-method-33 this) + (idle-state-transition this) (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc index d98ab7fd5d..7cf10c1891 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/blocking-plane_REF.gc @@ -16,16 +16,16 @@ ) ;; definition for method 3 of type blocking-plane -(defmethod inspect blocking-plane ((obj blocking-plane)) - (when (not obj) - (set! obj obj) +(defmethod inspect blocking-plane ((this blocking-plane)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -98,14 +98,14 @@ ;; definition for method 21 of type blocking-plane ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init! blocking-plane ((obj blocking-plane) (vec-pair (inline-array vector)) (height float)) +(defmethod init! blocking-plane ((this blocking-plane) (vec-pair (inline-array vector)) (height float)) "TODO - but sets up the plane given 2 vectors and a height" (let ((s3-0 (-> vec-pair 0)) (s4-0 (-> vec-pair 1)) ) 0.0 (* 0.5 (vector-vector-distance s3-0 s4-0)) - (let ((s2-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s2-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-3 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-3 prim-core collide-as) (collide-spec blocking-plane)) (set! (-> v1-3 prim-core collide-with) (collide-spec jak player-list)) @@ -119,10 +119,10 @@ (set! (-> s2-0 backup-collide-as) (-> v1-6 prim-core collide-as)) (set! (-> s2-0 backup-collide-with) (-> v1-6 prim-core collide-with)) ) - (set! (-> obj root) s2-0) + (set! (-> this root) s2-0) ) (let ((s1-0 (new 'stack-no-clear 'matrix)) - (s2-1 (-> obj root)) + (s2-1 (-> this root)) ) (vector+! (-> s2-1 trans) s3-0 s4-0) (vector-float*! (-> s2-1 trans) (-> s2-1 trans) 0.5) @@ -136,7 +136,7 @@ (vector-cross! (-> s1-0 vector 2) (the-as vector (-> s1-0 vector)) (-> s1-0 vector 1)) (vector-normalize! (-> s1-0 vector 2) 1.0) (matrix->quaternion (-> s2-1 quat) s1-0) - (let ((v1-20 (-> obj root root-prim local-sphere))) + (let ((v1-20 (-> this root root-prim local-sphere))) (set! (-> v1-20 x) 0.0) (set! (-> v1-20 y) (* 0.00024414062 (* 0.5 height))) (set! (-> v1-20 z) 0.0) @@ -151,11 +151,11 @@ ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-blocking-plane" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) (transform-post) (none) ) @@ -175,17 +175,17 @@ ;; definition for method 11 of type blocking-plane ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! blocking-plane ((obj blocking-plane) (arg0 entity-actor)) +(defmethod init-from-entity! blocking-plane ((this blocking-plane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (f30-0 (res-lump-float (-> obj entity) 'height :default 122880.0)) + (let ((s5-0 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (f30-0 (res-lump-float (-> this entity) 'height :default 122880.0)) ) - (set! (-> obj path) s5-0) + (set! (-> this path) s5-0) (if (or (not s5-0) (< (-> s5-0 curve num-cverts) 2)) (go process-drawable-art-error "bad path") ) @@ -199,11 +199,11 @@ This commonly includes things such as: (dotimes (s2-0 s4-0) (get-point-in-path! s5-0 (-> s3-0 0) (the float s2-0) 'interp) (get-point-in-path! s5-0 (-> s3-0 1) (the float (+ s2-0 1)) 'interp) - (process-spawn blocking-plane s3-0 f30-0 :to obj) + (process-spawn blocking-plane s3-0 f30-0 :to this) ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (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 5b71993b23..b3a893d602 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/collectables_REF.gc @@ -92,23 +92,23 @@ ) ;; definition for method 3 of type collectable -(defmethod inspect collectable ((obj collectable)) - (when (not obj) - (set! obj obj) +(defmethod inspect collectable ((this collectable)) + (when (not this) + (set! this this) (goto cfg-20) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpickup-type: ~D~%" (-> obj pickup-type)) - (format #t "~2Tpickup-amount: ~f~%" (-> obj pickup-amount)) - (format #t "~2Tnotify: ~D~%" (-> obj notify)) - (format #t "~2Told-base: ~`vector`P~%" (-> obj old-base)) - (format #t "~2Tbase: ~`vector`P~%" (-> obj base)) - (format #t "~2Textra-trans: ~`vector`P~%" (-> obj extra-trans)) - (format #t "~2Tjump-pos: ~`vector`P~%" (-> obj jump-pos)) - (format #t "~2Tflags: #x~X : (collectable-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "~2Tpickup-type: ~D~%" (-> this pickup-type)) + (format #t "~2Tpickup-amount: ~f~%" (-> this pickup-amount)) + (format #t "~2Tnotify: ~D~%" (-> this notify)) + (format #t "~2Told-base: ~`vector`P~%" (-> this old-base)) + (format #t "~2Tbase: ~`vector`P~%" (-> this base)) + (format #t "~2Textra-trans: ~`vector`P~%" (-> this extra-trans)) + (format #t "~2Tjump-pos: ~`vector`P~%" (-> this jump-pos)) + (format #t "~2Tflags: #x~X : (collectable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (collectable-flag no-eco-blue)) (collectable-flag no-eco-blue)) (format #t "no-eco-blue ") ) @@ -135,36 +135,36 @@ ) ) (format #t ")~%") - (format #t "~2Tbirth-time: ~D~%" (-> obj birth-time)) - (format #t "~2Tcollect-timeout: ~D~%" (-> obj collect-timeout)) - (format #t "~2Tfadeout-timeout: ~D~%" (-> obj fadeout-timeout)) - (format #t "~2Tbob-offset: ~D~%" (-> obj bob-offset)) - (format #t "~2Tbob-amount: ~f~%" (-> obj bob-amount)) - (format #t "~2Tpickup-handle: ~D~%" (-> obj pickup-handle)) - (format #t "~2Tactor-pause: ~A~%" (-> obj actor-pause)) - (format #t "~2Tcollect-effect: ~A~%" (-> obj collect-effect)) - (format #t "~2Tcollect-effect2: ~A~%" (-> obj collect-effect2)) - (format #t "~2Ttarget: ~D~%" (-> obj target)) - (format #t "~2Tsuck-time: ~D~%" (-> obj suck-time)) - (format #t "~2Tsuck-y-offset: ~f~%" (-> obj suck-y-offset)) - (format #t "~2Tspeed: ~`vector`P~%" (-> obj speed)) - (format #t "~2Tmovie-pos-index: ~D~%" (-> obj movie-pos-index)) + (format #t "~2Tbirth-time: ~D~%" (-> this birth-time)) + (format #t "~2Tcollect-timeout: ~D~%" (-> this collect-timeout)) + (format #t "~2Tfadeout-timeout: ~D~%" (-> this fadeout-timeout)) + (format #t "~2Tbob-offset: ~D~%" (-> this bob-offset)) + (format #t "~2Tbob-amount: ~f~%" (-> this bob-amount)) + (format #t "~2Tpickup-handle: ~D~%" (-> this pickup-handle)) + (format #t "~2Tactor-pause: ~A~%" (-> this actor-pause)) + (format #t "~2Tcollect-effect: ~A~%" (-> this collect-effect)) + (format #t "~2Tcollect-effect2: ~A~%" (-> this collect-effect2)) + (format #t "~2Ttarget: ~D~%" (-> this target)) + (format #t "~2Tsuck-time: ~D~%" (-> this suck-time)) + (format #t "~2Tsuck-y-offset: ~f~%" (-> this suck-y-offset)) + (format #t "~2Tspeed: ~`vector`P~%" (-> this speed)) + (format #t "~2Tmovie-pos-index: ~D~%" (-> this movie-pos-index)) (label cfg-20) - obj + this ) ;; definition for method 31 of type collectable ;; WARN: Return type mismatch object vs none. -(defmethod go-to-initial-state collectable ((obj collectable)) +(defmethod go-to-initial-state collectable ((this collectable)) (cond - ((logtest? (-> obj fact options) (actor-option wait-for-task-complete)) - (go (method-of-object obj blocked)) + ((logtest? (-> this fact options) (actor-option wait-for-task-complete)) + (go (method-of-object this blocked)) ) - ((logtest? (-> obj flags) (collectable-flag bounce)) - (go (method-of-object obj deploy)) + ((logtest? (-> this flags) (collectable-flag bounce)) + (go (method-of-object this deploy)) ) (else - (go (method-of-object obj wait)) + (go (method-of-object this wait)) ) ) (none) @@ -172,41 +172,43 @@ ;; definition for method 32 of type collectable ;; INFO: Used lq/sq -(defmethod initialize-options collectable ((obj collectable) (arg0 int) (arg1 float) (arg2 fact-info)) - (logclear! (-> obj mask) (process-mask crate enemy platform ambient)) - (logior! (-> obj mask) (process-mask bit18)) - (set! (-> obj flags) (collectable-flag pickup no-eco-blue)) - (set! (-> obj bob-amount) arg1) - (set! (-> obj bob-offset) - (the-as - seconds - (+ (the-as int (-> obj root trans x)) (the-as int (-> obj root trans y)) (the-as int (-> obj root trans z))) - ) +(defmethod initialize-options collectable ((this collectable) (arg0 int) (arg1 float) (arg2 fact-info)) + (logclear! (-> this mask) (process-mask crate enemy platform ambient)) + (logior! (-> this mask) (process-mask bit18)) + (set! (-> this flags) (collectable-flag pickup no-eco-blue)) + (set! (-> this bob-amount) arg1) + (set! (-> this bob-offset) (the-as seconds (+ (the-as int (-> this root trans x)) + (the-as int (-> this root trans y)) + (the-as int (-> this root trans z)) + ) + ) ) (cond - ((or (= (vector-length (-> obj root transv)) 0.0) (logtest? (-> obj fact options) (actor-option auto-pickup))) - (vector-reset! (-> obj root transv)) + ((or (= (vector-length (-> this root transv)) 0.0) + (logtest? (-> this fact options) (actor-option auto-pickup)) + ) + (vector-reset! (-> this root transv)) ) (else - (logior! (-> obj flags) (collectable-flag bounce)) - (logclear! (-> obj flags) (collectable-flag pickup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj bob-amount) 0.0) + (logior! (-> this flags) (collectable-flag bounce)) + (logclear! (-> this flags) (collectable-flag pickup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this bob-amount) 0.0) ) ) (when (> arg0 0) - (logior! (-> obj flags) (collectable-flag fadeout)) - (set! (-> obj fadeout-timeout) (the-as seconds arg0)) + (logior! (-> this flags) (collectable-flag fadeout)) + (set! (-> this fadeout-timeout) (the-as seconds arg0)) (if (logtest? (actor-option no-distance-check-fadeout) (-> arg2 options)) - (logior! (-> obj flags) (collectable-flag no-distance-check-fadeout)) + (logior! (-> this flags) (collectable-flag no-distance-check-fadeout)) ) ) - (set! (-> obj collect-timeout) (the-as seconds 99)) - (set! (-> obj birth-time) (current-time)) - (set! (-> obj base quad) (-> obj root trans quad)) - (set! (-> obj old-base quad) (-> obj root trans quad)) - (set! (-> obj pickup-handle) (the-as handle #f)) - (case (-> obj fact pickup-type) + (set! (-> this collect-timeout) (the-as seconds 99)) + (set-time! (-> this birth-time)) + (set! (-> this base quad) (-> this root trans quad)) + (set! (-> this old-base quad) (-> this root trans quad)) + (set! (-> this pickup-handle) (the-as handle #f)) + (case (-> this fact pickup-type) (((pickup-type eco-pill-green) (pickup-type eco-pill-dark) (pickup-type eco-green) @@ -217,13 +219,13 @@ (pickup-type health) (pickup-type trick-point) ) - (logclear! (-> obj flags) (collectable-flag no-eco-blue)) + (logclear! (-> this flags) (collectable-flag no-eco-blue)) ) ) - (if (logtest? (-> obj fact options) (actor-option big-collision)) - (set! (-> obj root root-prim local-sphere w) (* 2.5 (-> obj root root-prim local-sphere w))) + (if (logtest? (-> this fact options) (actor-option big-collision)) + (set! (-> this root root-prim local-sphere w) (* 2.5 (-> this root root-prim local-sphere w))) ) - (when (and arg2 (nonzero? (-> obj draw))) + (when (and arg2 (nonzero? (-> this draw))) (let* ((s5-0 (-> arg2 process)) (v1-56 (if (type? s5-0 process-drawable) s5-0 @@ -231,21 +233,21 @@ ) ) (if v1-56 - (set! (-> obj draw light-index) (-> (the-as process-drawable v1-56) draw light-index)) + (set! (-> this draw light-index) (-> (the-as process-drawable v1-56) draw light-index)) ) ) ) - obj + this ) ;; definition for method 33 of type collectable ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations collectable ((obj collectable)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify) (the-as handle #f)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-allocations collectable ((this collectable)) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -263,21 +265,21 @@ (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) 0 (none) ) ;; definition for method 30 of type collectable ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod initialize-effects collectable ((obj collectable) (arg0 pickup-type)) +(defmethod initialize-effects collectable ((this collectable) (arg0 pickup-type)) (let ((s5-0 (the-as sparticle-launch-group #f)) (s4-0 (the-as sound-spec #f)) ) - (set! (-> obj fact pickup-type) arg0) - (case (-> obj fact pickup-type) + (set! (-> this fact pickup-type) arg0) + (case (-> this fact pickup-type) (((pickup-type eco-blue) (pickup-type eco-red) (pickup-type eco-green) @@ -286,62 +288,62 @@ (pickup-type eco-pill-dark) (pickup-type trick-point) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) ) ) (case arg0 (((pickup-type eco-yellow)) (set! s5-0 (-> *part-group-id-table* 108)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 115)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 109)) + (set! (-> this collect-effect) (-> *part-group-id-table* 115)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 109)) (set! s4-0 (static-sound-spec "yel-eco-idle" :fo-max 15)) ) (((pickup-type eco-red)) (set! s5-0 (-> *part-group-id-table* 102)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 116)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 103)) + (set! (-> this collect-effect) (-> *part-group-id-table* 116)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 103)) (set! s4-0 (static-sound-spec "red-eco-idle" :fo-max 15)) ) (((pickup-type eco-blue)) (set! s5-0 (-> *part-group-id-table* 98)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 114)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 99)) + (set! (-> this collect-effect) (-> *part-group-id-table* 114)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 99)) (set! s4-0 (static-sound-spec "blue-eco-idle" :fo-max 15)) ) (((pickup-type eco-green)) (set! s5-0 (-> *part-group-id-table* 83)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 93)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 79)) + (set! (-> this collect-effect) (-> *part-group-id-table* 93)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 79)) (set! s4-0 (static-sound-spec "green-eco-idle" :fo-max 15)) ) (((pickup-type health)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-health" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-37 (-> (the-as collide-shape (-> obj root)) root-prim local-sphere))) + (let ((v1-37 (-> (the-as collide-shape (-> this root)) root-prim local-sphere))) (set! (-> v1-37 y) 2457.6) (set! (-> v1-37 w) 4096.0) ) - (set! (-> obj collect-effect) (-> *part-group-id-table* 93)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 79)) + (set! (-> this collect-effect) (-> *part-group-id-table* 93)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 79)) (set! s4-0 (static-sound-spec "green-eco-idle" :fo-max 15)) ) (((pickup-type eco-pill-green)) (set! s5-0 (-> *part-group-id-table* 80)) - (set! (-> obj collect-effect2) (-> *part-group-id-table* 81)) + (set! (-> this collect-effect2) (-> *part-group-id-table* 81)) ) (((pickup-type eco-pill-dark)) (set! s5-0 (-> *part-group-id-table* 82)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 92)) + (set! (-> this collect-effect) (-> *part-group-id-table* 92)) ) ) (if s5-0 - (set! (-> obj part) (create-launch-control s5-0 obj)) + (set! (-> this part) (create-launch-control s5-0 this)) ) (if s4-0 - (set! (-> obj sound) (new 'process 'ambient-sound s4-0 (-> obj root trans))) + (set! (-> this sound) (new 'process 'ambient-sound s4-0 (-> this root trans))) ) ) (none) @@ -396,36 +398,36 @@ ;; definition for method 29 of type collectable ;; INFO: Used lq/sq -(defmethod init-common collectable ((obj collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) - (set! (-> obj pickup-amount) arg2) - (set! (-> obj pickup-type) arg1) - (initialize-allocations obj) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (initialize-effects obj (-> obj fact pickup-type)) - (initialize-options obj 0 1024.0 (the-as fact-info #f)) - (update-transforms (-> obj root)) - (if (logtest? (-> obj fact options) (actor-option wait-for-task-complete)) - (go (method-of-object obj blocked)) +(defmethod init-common collectable ((this collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> this pickup-amount) arg2) + (set! (-> this pickup-type) arg1) + (initialize-allocations this) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (initialize-effects this (-> this fact pickup-type)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (if (logtest? (-> this fact options) (actor-option wait-for-task-complete)) + (go (method-of-object this blocked)) ) - (go-to-initial-state obj) + (go-to-initial-state this) (none) ) ;; definition for method 34 of type collectable ;; WARN: Return type mismatch int vs none. -(defmethod common-post collectable ((obj collectable)) - (let ((s5-0 (-> obj part)) - (s4-0 (-> obj root root-prim prim-core)) +(defmethod common-post collectable ((this collectable)) + (let ((s5-0 (-> this part)) + (s4-0 (-> this root root-prim prim-core)) ) - (if (nonzero? (-> obj draw)) + (if (nonzero? (-> this draw)) (ja-post) ) (if (nonzero? s5-0) (spawn s5-0 (the-as vector s4-0)) ) ) - (if (nonzero? (-> obj sound)) - (update! (-> obj sound)) + (if (nonzero? (-> this sound)) + (update! (-> this sound)) ) 0 (none) @@ -434,24 +436,24 @@ ;; definition for method 35 of type collectable ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-pickup collectable ((obj collectable) (arg0 handle)) - (set! (-> obj pickup-handle) arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (let ((v1-3 (-> obj root root-prim))) +(defmethod do-pickup collectable ((this collectable) (arg0 handle)) + (set! (-> this pickup-handle) arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) 0 - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - (if (nonzero? (-> obj draw)) - (logior! (-> obj draw status) (draw-control-status no-draw)) + (if (nonzero? (-> this draw)) + (logior! (-> this draw status) (draw-control-status no-draw)) ) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - (case (-> obj fact pickup-type) + (case (-> this fact pickup-type) (((pickup-type eco-yellow)) (sound-play "y-eco-pickup") ) @@ -470,8 +472,8 @@ (((pickup-type eco-pill-dark)) (sound-play "pill-pickup") (when (>= (-> *game-info* eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) - (set! (-> obj collect-effect) (the-as basic 0)) - (set! (-> obj collect-effect2) (the-as basic 0)) + (set! (-> this collect-effect) (the-as basic 0)) + (set! (-> this collect-effect2) (the-as basic 0)) 0 ) ) @@ -495,7 +497,7 @@ ) ) (let ((s4-9 (handle->process arg0))) - (when (nonzero? (-> obj collect-effect)) + (when (nonzero? (-> this collect-effect)) (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s5-1 (let ((t9-21 (method-of-type part-tracker activate))) @@ -504,14 +506,14 @@ (let ((t9-22 run-function-in-process) (a0-60 s5-1) (a1-26 part-tracker-init) - (a2-11 (-> obj collect-effect)) + (a2-11 (-> this collect-effect)) (a3-10 0) (t0-8 part-tracker-track-target) (t1-8 #f) (t2-8 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root root-prim prim-core world-sphere quad)) + (set! (-> t3-0 trans quad) (-> this root root-prim prim-core world-sphere quad)) ((the-as (function object object object object object object object object none) t9-22) a0-60 a1-26 @@ -528,16 +530,16 @@ ) ) ) - (when (nonzero? (-> obj collect-effect2)) + (when (nonzero? (-> this collect-effect2)) (let ((s5-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s5-2 (let ((t9-24 (method-of-type part-tracker activate))) - (t9-24 (the-as part-tracker s5-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-24 (the-as part-tracker s5-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-25 run-function-in-process) (a0-63 s5-2) (a1-29 part-tracker-init) - (a2-16 (-> obj collect-effect2)) + (a2-16 (-> this collect-effect2)) (a3-12 0) (t0-9 (lambda ((arg0 part-tracker)) @@ -565,11 +567,11 @@ ) ) ) - (t1-13 (process->handle obj)) + (t1-13 (process->handle this)) (t2-9 #f) (t3-1 *launch-matrix*) ) - (set! (-> t3-1 trans quad) (-> obj root root-prim prim-core world-sphere quad)) + (set! (-> t3-1 trans quad) (-> this root root-prim prim-core world-sphere quad)) ((the-as (function object object object object object object object object none) t9-25) a0-63 a1-29 @@ -585,7 +587,7 @@ ) ) ) - (send-event (handle->process (-> obj notify)) 'notify 'pickup) + (send-event (handle->process (-> this notify)) 'notify 'pickup) 0 (none) ) @@ -669,7 +671,7 @@ ) (logior! (-> self flags) (collectable-flag suck-in)) (when (= (-> self speed w) 0.0) - (set! (-> self suck-time) (current-time)) + (set-time! (-> self suck-time)) (set! (-> self speed x) (rand-vu-float-range 327680.0 819200.0)) ) (+! (-> self speed w) (* (lerp-scale @@ -720,7 +722,7 @@ (local-vars (v0-4 object)) (when (and (or (= arg2 'touch) (= arg2 'attack)) (and (logtest? (-> self flags) (collectable-flag pickup)) - (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self collect-timeout))) + (time-elapsed? (the-as int (-> self birth-time)) (the-as time-frame (-> self collect-timeout))) (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) (send-event arg0 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) ) @@ -880,8 +882,8 @@ (let ((gp-0 (new 'stack 'trajectory))) (set! (-> self base y) (-> self jump-pos y)) (setup-from-to-duration! gp-0 (-> self root trans) (-> self jump-pos) 300.0 -2.2755556) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (let ((f0-2 (the float (- (current-time) (-> self state-time))))) (compute-trans-at-time gp-0 f0-2 (-> self root trans)) ) @@ -911,7 +913,7 @@ :virtual #t :event collectable-standard-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (case (-> self pickup-type) (((pickup-type gem)) (sound-play "gem-spawn") @@ -1017,7 +1019,7 @@ (go-virtual suck (process->handle proc)) ) (logtest? (-> self flags) (collectable-flag pickup)) - (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self collect-timeout))) + (time-elapsed? (the-as int (-> self birth-time)) (the-as time-frame (-> self collect-timeout))) ) ) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1044,9 +1046,9 @@ (if (and (logtest? (-> self flags) (collectable-flag fadeout)) (begin (if (movie?) - (set! (-> self birth-time) (current-time)) + (set-time! (-> self birth-time)) ) - (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self fadeout-timeout))) + (time-elapsed? (the-as int (-> self birth-time)) (the-as time-frame (-> self fadeout-timeout))) ) (or (or (not *target*) (or (< 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (focus-test? *target* teleporting) @@ -1107,7 +1109,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (and (or (= message 'touch) (= message 'attack)) (and (logtest? (-> self flags) (collectable-flag pickup)) - (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self collect-timeout))) + (time-elapsed? (the-as int (-> self birth-time)) (the-as time-frame (-> self collect-timeout))) (not (and (-> self next-state) (= (-> self next-state name) 'pickup))) (send-event proc 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) ) @@ -1229,27 +1231,27 @@ ) ;; definition for method 3 of type eco -(defmethod inspect eco ((obj eco)) - (when (not obj) - (set! obj obj) +(defmethod inspect eco ((this eco)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type collectable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trespawn-delay: ~D~%" (-> obj respan-delay)) + (format #t "~2Trespawn-delay: ~D~%" (-> this respan-delay)) (label cfg-4) - obj + this ) ;; definition for method 33 of type eco ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations eco ((obj eco)) +(defmethod initialize-allocations eco ((this eco)) (let ((t9-0 (method-of-type collectable initialize-allocations))) - (t9-0 obj) + (t9-0 this) ) - (if (logtest? (-> obj fact options) (actor-option respawn-delay)) - (set! (-> obj respan-delay) (-> obj fact fade-time)) + (if (logtest? (-> this fact options) (actor-option respawn-delay)) + (set! (-> this respan-delay) (-> this fact fade-time)) ) 0 (none) @@ -1286,7 +1288,7 @@ (cond ((nonzero? (-> self respan-delay)) (let ((gp-0 (current-time))) - (while (< (- (current-time) gp-0) (the-as time-frame (-> self respan-delay))) + (while (not (time-elapsed? gp-0 (the-as time-frame (-> self respan-delay)))) (suspend) ) ) @@ -1338,27 +1340,27 @@ ) ;; definition for method 3 of type eco-yellow -(defmethod inspect eco-yellow ((obj eco-yellow)) - (when (not obj) - (set! obj obj) +(defmethod inspect eco-yellow ((this eco-yellow)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type eco inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type eco-yellow -(defmethod init-from-entity! eco-yellow ((obj eco-yellow) (arg0 entity-actor)) +(defmethod init-from-entity! eco-yellow ((this eco-yellow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) + (init-common this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1372,27 +1374,27 @@ This commonly includes things such as: ) ;; definition for method 3 of type eco-red -(defmethod inspect eco-red ((obj eco-red)) - (when (not obj) - (set! obj obj) +(defmethod inspect eco-red ((this eco-red)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type eco inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type eco-red -(defmethod init-from-entity! eco-red ((obj eco-red) (arg0 entity-actor)) +(defmethod init-from-entity! eco-red ((this eco-red) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) + (init-common this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1406,27 +1408,27 @@ This commonly includes things such as: ) ;; definition for method 3 of type eco-blue -(defmethod inspect eco-blue ((obj eco-blue)) - (when (not obj) - (set! obj obj) +(defmethod inspect eco-blue ((this eco-blue)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type eco inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type eco-blue -(defmethod init-from-entity! eco-blue ((obj eco-blue) (arg0 entity-actor)) +(defmethod init-from-entity! eco-blue ((this eco-blue) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) + (init-common this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1440,27 +1442,27 @@ This commonly includes things such as: ) ;; definition for method 3 of type eco-green -(defmethod inspect eco-green ((obj eco-green)) - (when (not obj) - (set! obj obj) +(defmethod inspect eco-green ((this eco-green)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type eco inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type eco-green -(defmethod init-from-entity! eco-green ((obj eco-green) (arg0 entity-actor)) +(defmethod init-from-entity! eco-green ((this eco-green) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) + (init-common this arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc)) (none) ) @@ -1474,27 +1476,27 @@ This commonly includes things such as: ) ;; definition for method 3 of type health -(defmethod inspect health ((obj health)) - (when (not obj) - (set! obj obj) +(defmethod inspect health ((this health)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type collectable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type health -(defmethod init-from-entity! health ((obj health) (arg0 entity-actor)) +(defmethod init-from-entity! health ((this health) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) + (init-common this arg0 (pickup-type health) (-> *FACT-bank* health-default-inc)) (none) ) @@ -1508,16 +1510,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type eco-pill -(defmethod inspect eco-pill ((obj eco-pill)) - (when (not obj) - (set! obj obj) +(defmethod inspect eco-pill ((this eco-pill)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type collectable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1546,33 +1548,33 @@ This commonly includes things such as: ) ;; definition for method 11 of type eco-pill -(defmethod init-from-entity! eco-pill ((obj eco-pill) (arg0 entity-actor)) +(defmethod init-from-entity! eco-pill ((this eco-pill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-common obj arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) + (init-common this arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc)) (none) ) ;; definition for method 10 of type eco-pill -(defmethod deactivate eco-pill ((obj eco-pill)) +(defmethod deactivate eco-pill ((this eco-pill)) (+! (-> *game-info* live-eco-pill-count) -1) - ((method-of-type collectable deactivate) obj) + ((method-of-type collectable deactivate) this) (none) ) ;; definition for method 33 of type eco-pill ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations eco-pill ((obj eco-pill)) +(defmethod initialize-allocations eco-pill ((this eco-pill)) (+! (-> *game-info* live-eco-pill-count) 1) - (stack-size-set! (-> obj main-thread) 128) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #f) - (set! (-> obj notify) (the-as handle #f)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1590,9 +1592,9 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) 0 (none) ) @@ -1607,74 +1609,74 @@ This commonly includes things such as: ) ;; definition for method 3 of type money -(defmethod inspect money ((obj money)) - (when (not obj) - (set! obj obj) +(defmethod inspect money ((this money)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type collectable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 12 of type money -(defmethod run-logic? money ((obj money)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) +(defmethod run-logic? money ((this money)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-control-status uninited))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) ) ) ) ;; definition for method 10 of type money -(defmethod deactivate money ((obj money)) - (when (and (-> obj next-state) (= (-> obj next-state name) 'pickup)) - (case (-> obj pickup-type) +(defmethod deactivate money ((this money)) + (when (and (-> this next-state) (= (-> this next-state name) 'pickup)) + (case (-> this pickup-type) (((pickup-type gem)) - (if (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status save)))) - (format #t "~A ~A was killed in pickup~%" (-> obj type) (-> obj name)) + (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status save)))) + (format #t "~A ~A was killed in pickup~%" (-> this type) (-> this name)) ) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) ) (else - (if (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status dead)))) - (format #t "~A ~A was killed in pickup~%" (-> obj type) (-> obj name)) + (if (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status dead)))) + (format #t "~A ~A was killed in pickup~%" (-> this type) (-> this name)) ) ) ) ) - ((method-of-type collectable deactivate) obj) + ((method-of-type collectable deactivate) this) (none) ) ;; definition for method 34 of type money -(defmethod common-post money ((obj money)) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* 40049.777 (seconds-per-frame))) - (let ((f30-0 (-> obj bob-amount))) +(defmethod common-post money ((this money)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) + (let ((f30-0 (-> this bob-amount))) (when (< 0.0 f30-0) - (set! (-> obj root trans y) - (+ (-> obj base y) - (-> obj suck-y-offset) + (set! (-> this root trans y) + (+ (-> this base y) + (-> this suck-y-offset) (* f30-0 (sin (* 109.22667 (the float - (mod (+ (- (current-time) (the-as int (-> obj birth-time))) (the-as time-frame (-> obj bob-offset))) 600) + (mod (+ (- (current-time) (the-as int (-> this birth-time))) (the-as time-frame (-> this bob-offset))) 600) ) ) ) ) ) ) - (update-transforms (-> obj root)) + (update-transforms (-> this root)) ) ) (ja-post) @@ -1724,9 +1726,9 @@ This commonly includes things such as: ;; definition for method 33 of type money ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations money ((obj money)) - (stack-size-set! (-> obj main-thread) 128) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-allocations money ((this money)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1744,13 +1746,13 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify) (the-as handle #f)) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type money) 1.0)) - (let ((a0-11 (-> obj entity))) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type money) 1.0)) + (let ((a0-11 (-> this entity))) (if (when a0-11 (let ((a0-12 (-> a0-11 extra perm task))) (if a0-12 @@ -1758,36 +1760,36 @@ This commonly includes things such as: ) ) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (if (-> obj entity) - (nav-mesh-connect-from-ent obj) + (if (-> this entity) + (nav-mesh-connect-from-ent this) ) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) 0 (none) ) ;; definition for method 11 of type money -(defmethod init-from-entity! money ((obj money) (arg0 entity-actor)) +(defmethod init-from-entity! money ((this money) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (initialize-allocations obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-options obj 0 1024.0 (the-as fact-info #f)) - (update-transforms (-> obj root)) - (go-to-initial-state obj) + (initialize-allocations this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) (none) ) @@ -1869,36 +1871,36 @@ This commonly includes things such as: ) ;; definition for method 3 of type gem -(defmethod inspect gem ((obj gem)) - (when (not obj) - (set! obj obj) +(defmethod inspect gem ((this gem)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type money inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Troty-speed: (deg ~r)~%" (-> obj roty-speed)) - (format #t "~2Tbounce-time: ~D~%" (-> obj bounce-time)) + (format #t "~2Troty-speed: (deg ~r)~%" (-> this roty-speed)) + (format #t "~2Tbounce-time: ~D~%" (-> this bounce-time)) (label cfg-4) - obj + this ) ;; definition for method 10 of type gem -(defmethod deactivate gem ((obj gem)) +(defmethod deactivate gem ((this gem)) (+! (-> *game-info* live-gem-count) -1) - ((the-as (function gem none) (find-parent-method gem 10)) obj) + ((the-as (function gem none) (find-parent-method gem 10)) this) (none) ) ;; definition for method 34 of type gem ;; WARN: Return type mismatch int vs none. -(defmethod common-post gem ((obj gem)) - (seek! (-> obj roty-speed) 20024.889 (* 65536.0 (seconds-per-frame))) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* (-> obj roty-speed) (seconds-per-frame))) - (logclear! (-> obj draw status) (draw-control-status no-draw-temp uninited)) - (do-joint-math (-> obj draw) (-> obj node-list) (-> obj skel)) - (let ((a0-7 (-> obj part)) - (a1-3 (-> obj draw skeleton bones 3)) +(defmethod common-post gem ((this gem)) + (seek! (-> this roty-speed) 20024.889 (* 65536.0 (seconds-per-frame))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* (-> this roty-speed) (seconds-per-frame))) + (logclear! (-> this draw status) (draw-control-status no-draw-temp uninited)) + (do-joint-math (-> this draw) (-> this node-list) (-> this skel)) + (let ((a0-7 (-> this part)) + (a1-3 (-> this draw skeleton bones 3)) ) (if (nonzero? a0-7) (spawn-with-matrix a0-7 (the-as matrix a1-3)) @@ -2011,12 +2013,12 @@ This commonly includes things such as: ) ) (if (or (and (logtest? s5-2 (collide-status on-surface)) (< (vector-length (-> gp-1 transv)) 1228.8)) - (>= (- (current-time) (-> self state-time)) (seconds 10)) + (time-elapsed? (-> self state-time) (seconds 10)) ) (go-virtual wait) ) - (when (>= (- (current-time) (the-as int (-> self bounce-time))) (seconds 0.1)) - (set! (-> self bounce-time) (current-time)) + (when (time-elapsed? (the-as int (-> self bounce-time)) (seconds 0.1)) + (set-time! (-> self bounce-time)) (sound-play-by-name (static-sound-name "gem-bounce") (new-sound-id) @@ -2028,7 +2030,7 @@ This commonly includes things such as: ) ) ) - ((>= (- (current-time) (-> self state-time)) (seconds 15)) + ((time-elapsed? (-> self state-time) (seconds 15)) (go-virtual wait) ) ) @@ -2040,10 +2042,10 @@ This commonly includes things such as: ;; definition for method 33 of type gem ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations gem ((obj gem)) +(defmethod initialize-allocations gem ((this gem)) (+! (-> *game-info* live-gem-count) 1) - (stack-size-set! (-> obj main-thread) 128) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2061,36 +2063,36 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj roty-speed) 40049.777) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (rand-vu-float-range 0.0 65536.0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #f) - (set! (-> obj notify) (the-as handle #f)) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type gem) 1.0)) - (let ((v1-22 (-> obj entity))) - (if (and (-> obj entity) + (set! (-> this roty-speed) 40049.777) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (rand-vu-float-range 0.0 65536.0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type gem) 1.0)) + (let ((v1-22 (-> this entity))) + (if (and (-> this entity) (-> v1-22 extra perm task) (= (-> v1-22 extra perm task) (game-task none)) (type-type? (-> v1-22 etype) crate) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) - (if (-> obj entity) - (nav-mesh-connect-from-ent obj) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (if (-> this entity) + (nav-mesh-connect-from-ent this) ) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 86) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 87)) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 86) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 87)) 0 (none) ) @@ -2116,16 +2118,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type skill -(defmethod inspect skill ((obj skill)) - (when (not obj) - (set! obj obj) +(defmethod inspect skill ((this skill)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type money inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2136,9 +2138,9 @@ This commonly includes things such as: (if (and (logtest? (-> self flags) (collectable-flag fadeout)) (begin (if (movie?) - (set! (-> self birth-time) (current-time)) + (set-time! (-> self birth-time)) ) - (>= (- (current-time) (the-as int (-> self birth-time))) (the-as time-frame (-> self fadeout-timeout))) + (time-elapsed? (the-as int (-> self birth-time)) (the-as time-frame (-> self fadeout-timeout))) ) ) (go-virtual fade) @@ -2152,9 +2154,9 @@ This commonly includes things such as: ;; definition for method 33 of type skill ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations skill ((obj skill)) - (stack-size-set! (-> obj main-thread) 128) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-allocations skill ((this skill)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2172,13 +2174,13 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify) (the-as handle #f)) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type skill) 1.0)) - (let ((a0-11 (-> obj entity))) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type skill) 1.0)) + (let ((a0-11 (-> this entity))) (if (when a0-11 (let ((a0-12 (-> a0-11 extra perm task))) (if a0-12 @@ -2186,26 +2188,26 @@ This commonly includes things such as: ) ) ) - (set! (-> obj entity extra perm task) (game-task complete)) + (set! (-> this entity extra perm task) (game-task complete)) ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-skill" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw shadow-ctrl) *collectable-dummy-shadow-control*) - (if (-> obj entity) - (nav-mesh-connect-from-ent obj) + (set! (-> this draw shadow-ctrl) *collectable-dummy-shadow-control*) + (if (-> this entity) + (nav-mesh-connect-from-ent this) ) (cond - ((>= (-> obj pickup-amount) (-> *FACT-bank* super-skill-inc)) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.0 1.0) - (set-vector! (-> obj draw color-emissive) 0.0 1.0 0.2 1.0) + ((>= (-> this pickup-amount) (-> *FACT-bank* super-skill-inc)) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 1.0 0.2 1.0) ) (else - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) ) ) 0 @@ -2221,15 +2223,15 @@ This commonly includes things such as: ) ;; definition for method 3 of type fuel-cell -(defmethod inspect fuel-cell ((obj fuel-cell)) - (when (not obj) - (set! obj obj) +(defmethod inspect fuel-cell ((this fuel-cell)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) (format #t "process-tree ") ) @@ -2328,34 +2330,34 @@ This commonly includes things such as: ) ) (format #t ")~%") - (format #t "~1Tclock: ~A~%" (-> obj clock)) - (format #t "~1Tparent: #x~X~%" (-> obj parent)) - (format #t "~1Tbrother: #x~X~%" (-> obj brother)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) - (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tstatus: ~A~%" (-> obj status)) - (format #t "~1Tpid: ~D~%" (-> obj pid)) - (format #t "~1Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~1Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tstate: ~A~%" (-> obj state)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~1Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~1Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~1Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~1Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~1Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~1Theap: #~%" (&-> obj heap-base)) - (format #t "~1Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) (label cfg-68) - obj + this ) ;; definition of type trick-point @@ -2368,16 +2370,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type trick-point -(defmethod inspect trick-point ((obj trick-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect trick-point ((this trick-point)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type collectable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type skate-point @@ -2390,23 +2392,23 @@ This commonly includes things such as: ) ;; definition for method 3 of type skate-point -(defmethod inspect skate-point ((obj skate-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect skate-point ((this skate-point)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type trick-point inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type trick-point ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations trick-point ((obj trick-point)) - (stack-size-set! (-> obj main-thread) 128) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-allocations trick-point ((this trick-point)) + (stack-size-set! (-> this main-thread) 128) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2424,32 +2426,32 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #t) - (set! (-> obj notify) (the-as handle #f)) - (set! (-> obj root pause-adjust-distance) 204800.0) - (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type trick-point) 100.0)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 94) obj)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 95)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #t) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this root pause-adjust-distance) 204800.0) + (set! (-> this fact) (new 'process 'fact-info this (pickup-type trick-point) 100.0)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 94) this)) + (set! (-> this collect-effect) (-> *part-group-id-table* 95)) 0 (none) ) ;; definition for method 11 of type trick-point -(defmethod init-from-entity! trick-point ((obj trick-point) (arg0 entity-actor)) +(defmethod init-from-entity! trick-point ((this trick-point) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (initialize-allocations obj) - (process-drawable-from-entity! obj (-> obj entity)) - (initialize-options obj 0 1024.0 (the-as fact-info #f)) - (update-transforms (-> obj root)) - (go-to-initial-state obj) + (initialize-allocations this) + (process-drawable-from-entity! this (-> this entity)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) (none) ) @@ -2464,27 +2466,27 @@ This commonly includes things such as: ) ;; definition for method 3 of type ammo-collectable -(defmethod inspect ammo-collectable ((obj ammo-collectable)) - (when (not obj) - (set! obj obj) +(defmethod inspect ammo-collectable ((this ammo-collectable)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type collectable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tammo-effect: ~A~%" (-> obj ammo-effect)) + (format #t "~2Tammo-effect: ~A~%" (-> this ammo-effect)) (label cfg-4) - obj + this ) ;; definition for method 33 of type ammo-collectable ;; WARN: Return type mismatch int vs none. -(defmethod initialize-allocations ammo-collectable ((obj ammo-collectable)) - (stack-size-set! (-> obj main-thread) 128) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj actor-pause) #f) - (set! (-> obj notify) (the-as handle #f)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod initialize-allocations ammo-collectable ((this ammo-collectable)) + (stack-size-set! (-> this main-thread) 128) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this actor-pause) #f) + (set! (-> this notify) (the-as handle #f)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2502,22 +2504,22 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (rand-vu-float-range 0.0 65536.0)) - (set! (-> obj fact) (new 'process 'fact-info obj (-> obj pickup-type) (-> obj pickup-amount))) - (case (-> obj pickup-type) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (rand-vu-float-range 0.0 65536.0)) + (set! (-> this fact) (new 'process 'fact-info this (-> this pickup-type) (-> this pickup-amount))) + (case (-> this pickup-type) (((pickup-type ammo-yellow)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 88)) + (set! (-> this collect-effect) (-> *part-group-id-table* 88)) ) (((pickup-type ammo-red)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 89)) + (set! (-> this collect-effect) (-> *part-group-id-table* 89)) ) (((pickup-type ammo-blue)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 90)) + (set! (-> this collect-effect) (-> *part-group-id-table* 90)) ) (((pickup-type ammo-dark)) - (set! (-> obj collect-effect) (-> *part-group-id-table* 91)) + (set! (-> this collect-effect) (-> *part-group-id-table* 91)) ) ) 0 @@ -2526,91 +2528,91 @@ This commonly includes things such as: ;; definition for method 30 of type ammo-collectable ;; WARN: Return type mismatch object vs none. -(defmethod initialize-effects ammo-collectable ((obj ammo-collectable) (arg0 pickup-type)) - (set! (-> obj fact pickup-type) arg0) +(defmethod initialize-effects ammo-collectable ((this ammo-collectable) (arg0 pickup-type)) + (set! (-> this fact pickup-type) arg0) (case arg0 (((pickup-type ammo-yellow)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 2.5 2.5 2.5 1.0) - (set! (-> obj ammo-effect) (-> *part-group-id-table* 108)) + (set-vector! (-> this root scale) 2.5 2.5 2.5 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 108)) ) (((pickup-type ammo-red)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 4.0 4.0 4.0 1.0) - (set! (-> obj ammo-effect) (-> *part-group-id-table* 102)) + (set-vector! (-> this root scale) 4.0 4.0 4.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 102)) ) (((pickup-type ammo-blue)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 4.0 4.0 4.0 1.0) - (set! (-> obj ammo-effect) (-> *part-group-id-table* 98)) + (set-vector! (-> this root scale) 4.0 4.0 4.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 98)) ) (((pickup-type ammo-dark)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 3.0 3.0 3.0 1.0) - (set! (-> obj ammo-effect) (-> *part-group-id-table* 83)) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (set! (-> this ammo-effect) (-> *part-group-id-table* 83)) ) (((pickup-type gun-yellow)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-yellow-up" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 3.0 3.0 3.0 1.0) - (logclear! (-> obj flags) (collectable-flag fadeout)) - (let ((v1-34 (-> obj node-list data))) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) + (let ((v1-34 (-> this node-list data))) (set! (-> v1-34 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) - (set! (-> v1-34 0 param1) (the-as basic (-> obj root trans))) - (set! (-> v1-34 0 param2) (the-as basic (-> obj extra-trans))) + (set! (-> v1-34 0 param1) (the-as basic (-> this root trans))) + (set! (-> v1-34 0 param2) (the-as basic (-> this extra-trans))) ) - (set-vector! (-> obj extra-trans) 0.0 1638.4 0.0 1.0) + (set-vector! (-> this extra-trans) 0.0 1638.4 0.0 1.0) ) (((pickup-type gun-dark)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-dark-up" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj root scale) 3.0 3.0 3.0 1.0) - (logclear! (-> obj flags) (collectable-flag fadeout)) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) ) (((pickup-type board)) - (process-entity-set! obj (the-as entity #f)) + (process-entity-set! this (the-as entity #f)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-board" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) - (let ((v1-48 (-> obj skel root-channel 0))) - (set! (-> v1-48 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((v1-48 (-> this skel root-channel 0))) + (set! (-> v1-48 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) ) - (set-vector! (-> obj root scale) 2.0 2.0 2.0 1.0) - (let ((v1-52 (-> obj node-list data))) + (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) + (let ((v1-52 (-> this node-list data))) (set! (-> v1-52 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) - (set! (-> v1-52 0 param1) (the-as basic (-> obj root trans))) - (set! (-> v1-52 0 param2) (the-as basic (-> obj extra-trans))) + (set! (-> v1-52 0 param1) (the-as basic (-> this root trans))) + (set! (-> v1-52 0 param2) (the-as basic (-> this extra-trans))) ) - (set-vector! (-> obj extra-trans) 0.0 2048.0 0.0 1.0) - (logclear! (-> obj flags) (collectable-flag fadeout)) + (set-vector! (-> this extra-trans) 0.0 2048.0 0.0 1.0) + (logclear! (-> this flags) (collectable-flag fadeout)) ) (((pickup-type shield)) - (set! (-> obj ammo-effect) (-> *part-group-id-table* 80)) + (set! (-> this ammo-effect) (-> *part-group-id-table* 80)) ) (((pickup-type trick-point)) ) @@ -2644,23 +2646,23 @@ This commonly includes things such as: ;; definition for method 29 of type ammo-collectable ;; INFO: Used lq/sq -(defmethod init-common ammo-collectable ((obj ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) - (set! (-> obj pickup-amount) arg2) - (set! (-> obj pickup-type) arg1) - (initialize-allocations obj) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (initialize-effects obj (-> obj fact pickup-type)) - (initialize-options obj 0 1024.0 (the-as fact-info #f)) - (update-transforms (-> obj root)) - (go-to-initial-state obj) +(defmethod init-common ammo-collectable ((this ammo-collectable) (arg0 entity-actor) (arg1 pickup-type) (arg2 float)) + (set! (-> this pickup-amount) arg2) + (set! (-> this pickup-type) arg1) + (initialize-allocations this) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (initialize-effects this (-> this fact pickup-type)) + (initialize-options this 0 1024.0 (the-as fact-info #f)) + (update-transforms (-> this root)) + (go-to-initial-state this) (none) ) ;; definition for method 34 of type ammo-collectable ;; WARN: Return type mismatch int vs none. -(defmethod common-post ammo-collectable ((obj ammo-collectable)) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) (* 40049.777 (seconds-per-frame))) - ((method-of-type collectable common-post) obj) +(defmethod common-post ammo-collectable ((this ammo-collectable)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) (* 40049.777 (seconds-per-frame))) + ((method-of-type collectable common-post) this) 0 (none) ) @@ -2683,16 +2685,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type ammo -(defmethod inspect ammo ((obj ammo)) - (when (not obj) - (set! obj obj) +(defmethod inspect ammo ((this ammo)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type ammo-collectable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type shield @@ -2705,16 +2707,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type shield -(defmethod inspect shield ((obj shield)) - (when (not obj) - (set! obj obj) +(defmethod inspect shield ((this shield)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type ammo-collectable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type upgrade-collectable @@ -2727,16 +2729,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type upgrade-collectable -(defmethod inspect upgrade-collectable ((obj upgrade-collectable)) - (when (not obj) - (set! obj obj) +(defmethod inspect upgrade-collectable ((this upgrade-collectable)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type ammo-collectable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for function initialize-upgrade-by-other @@ -2774,52 +2776,52 @@ This commonly includes things such as: ) ;; definition for method 11 of type eco -(defmethod init-from-entity! eco ((obj eco) (arg0 entity-actor)) +(defmethod init-from-entity! eco ((this eco) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((v1-1 (res-lump-value (-> obj entity) 'eco-info uint128 :time -1000000000.0))) - (set! (-> obj type) (cond - ((= (the-as uint v1-1) 3) - eco-blue - ) - ((= (the-as uint v1-1) 2) - eco-red - ) - ((= (the-as uint v1-1) 1) - eco-yellow - ) - ((= (the-as uint v1-1) 5) - eco-green - ) - ((= (the-as uint v1-1) 18) - health - ) - ((= (the-as uint v1-1) 9) - money - ) - ((= (the-as uint v1-1) 19) - trick-point - ) - ((= (the-as uint v1-1) 21) - gem - ) - ((= (the-as uint v1-1) 22) - skill - ) - ((= (the-as uint v1-1) 10) - fuel-cell - ) - (else - eco-pill + (let ((v1-1 (res-lump-value (-> this entity) 'eco-info uint128 :time -1000000000.0))) + (set! (-> this type) (cond + ((= (the-as uint v1-1) 3) + eco-blue ) - ) + ((= (the-as uint v1-1) 2) + eco-red + ) + ((= (the-as uint v1-1) 1) + eco-yellow + ) + ((= (the-as uint v1-1) 5) + eco-green + ) + ((= (the-as uint v1-1) 18) + health + ) + ((= (the-as uint v1-1) 9) + money + ) + ((= (the-as uint v1-1) 19) + trick-point + ) + ((= (the-as uint v1-1) 21) + gem + ) + ((= (the-as uint v1-1) 22) + skill + ) + ((= (the-as uint v1-1) 10) + fuel-cell + ) + (else + eco-pill + ) + ) ) ) - (init-from-entity! obj arg0) + (init-from-entity! this arg0) (none) ) @@ -3012,9 +3014,9 @@ This commonly includes things such as: ;; definition for method 9 of type fact-info ;; INFO: Used lq/sq -(defmethod drop-pickup fact-info ((obj fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) - (let ((s2-0 (-> obj pickup-type)) - (f30-0 (-> obj pickup-amount)) +(defmethod drop-pickup fact-info ((this fact-info) (arg0 symbol) (arg1 process-tree) (arg2 fact-info) (arg3 int)) + (let ((s2-0 (-> this pickup-type)) + (f30-0 (-> this pickup-amount)) ) (when (= s2-0 (pickup-type ammo-random)) (let ((s2-1 (-> *game-info* features))) @@ -3136,7 +3138,7 @@ This commonly includes things such as: ((< 10 (-> *game-info* live-eco-pill-count)) 1.0 ) - ((type? obj fact-info-enemy) + ((type? this fact-info-enemy) (+ (rand-vu-float-range 3.0 (+ 5.0 f30-0)) (the float arg3)) ) (else @@ -3146,7 +3148,7 @@ This commonly includes things such as: ) ) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> obj process)) root trans quad)) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) (set-vector! (-> s3-1 move-dist) 0.0 -81920.0 0.0 1.0) (+! (-> s3-1 start-pos y) 12288.0) (let ((v1-75 s3-1)) @@ -3159,12 +3161,12 @@ This commonly includes things such as: ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s3-1) 0.0) (set! (-> s3-1 start-pos quad) (-> s3-1 best-other-tri intersect quad)) - (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> obj process)) root trans quad)) + (set! (-> s3-1 start-pos quad) (-> (the-as process-drawable (-> this process)) root trans quad)) ) (if (= s2-0 (pickup-type fuel-cell)) (+! (-> s3-1 start-pos y) 6144.0) ) - (birth-pickup-at-point (-> s3-1 start-pos) s2-0 f30-0 arg0 arg1 obj) + (birth-pickup-at-point (-> s3-1 start-pos) s2-0 f30-0 arg0 arg1 this) ) ) ) @@ -3178,15 +3180,15 @@ This commonly includes things such as: ) ;; definition for method 3 of type ecovent -(defmethod inspect ecovent ((obj ecovent)) - (when (not obj) - (set! obj obj) +(defmethod inspect ecovent ((this ecovent)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) (format #t "process-tree ") ) @@ -3285,34 +3287,34 @@ This commonly includes things such as: ) ) (format #t ")~%") - (format #t "~1Tclock: ~A~%" (-> obj clock)) - (format #t "~1Tparent: #x~X~%" (-> obj parent)) - (format #t "~1Tbrother: #x~X~%" (-> obj brother)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) - (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tstatus: ~A~%" (-> obj status)) - (format #t "~1Tpid: ~D~%" (-> obj pid)) - (format #t "~1Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~1Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tstate: ~A~%" (-> obj state)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~1Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~1Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~1Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~1Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~1Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~1Theap: #~%" (&-> obj heap-base)) - (format #t "~1Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) (label cfg-68) - obj + this ) ;; failed to figure out what this is: 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 05f2bbfaa9..abea432fe2 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/conveyor_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type conveyor-section -(defmethod inspect conveyor-section ((obj conveyor-section)) - (when (not obj) - (set! obj obj) +(defmethod inspect conveyor-section ((this conveyor-section)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'conveyor-section) - (format #t "~1Tstart: #~%" (-> obj start)) - (format #t "~1Ttrailing: #~%" (-> obj trailing)) - (format #t "~1Tpull-dir: #~%" (-> obj pull-dir)) - (format #t "~1Tradial-dir: #~%" (-> obj radial-dir)) + (format #t "[~8x] ~A~%" this 'conveyor-section) + (format #t "~1Tstart: #~%" (-> this start)) + (format #t "~1Ttrailing: #~%" (-> this trailing)) + (format #t "~1Tpull-dir: #~%" (-> this pull-dir)) + (format #t "~1Tradial-dir: #~%" (-> this radial-dir)) (label cfg-4) - obj + this ) ;; definition of type conveyor-section-array @@ -38,17 +38,17 @@ ) ;; definition for method 3 of type conveyor-section-array -(defmethod inspect conveyor-section-array ((obj conveyor-section-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect conveyor-section-array ((this conveyor-section-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -82,39 +82,39 @@ ) ;; definition for method 3 of type conveyor -(defmethod inspect conveyor ((obj conveyor)) - (when (not obj) - (set! obj obj) +(defmethod inspect conveyor ((this conveyor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspeed: ~f~%" (-> obj speed)) - (format #t "~2Tbelt-radius: ~f~%" (-> obj belt-radius)) - (format #t "~2Tpull-y-threshold: ~f~%" (-> obj pull-y-threshold)) - (format #t "~2Tspeed-mult-array: #x~X~%" (-> obj speed-mult-array)) - (format #t "~2Tspeed-mult-array-len: ~D~%" (-> obj speed-mult-array-len)) - (format #t "~2Tsections: ~A~%" (-> obj sections)) - (format #t "~2Tleading: #~%" (-> obj leading)) - (format #t "~2Tcollide-bounds: #~%" (-> obj collide-bounds)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Tbelt-radius: ~f~%" (-> this belt-radius)) + (format #t "~2Tpull-y-threshold: ~f~%" (-> this pull-y-threshold)) + (format #t "~2Tspeed-mult-array: #x~X~%" (-> this speed-mult-array)) + (format #t "~2Tspeed-mult-array-len: ~D~%" (-> this speed-mult-array-len)) + (format #t "~2Tsections: ~A~%" (-> this sections)) + (format #t "~2Tleading: #~%" (-> this leading)) + (format #t "~2Tcollide-bounds: #~%" (-> this collide-bounds)) (label cfg-4) - obj + this ) ;; definition for method 7 of type conveyor ;; WARN: Return type mismatch process-drawable vs conveyor. -(defmethod relocate conveyor ((obj conveyor) (new-addr int)) - (&+! (-> obj sections) new-addr) +(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)) obj new-addr) + ((the-as (function process-drawable int process-drawable) (find-parent-method conveyor 7)) this new-addr) ) ) ;; definition for method 22 of type conveyor ;; WARN: Return type mismatch symbol vs art-group. -(defmethod get-art-group conveyor ((obj conveyor)) +(defmethod get-art-group conveyor ((this conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (go process-drawable-art-error "invalid type") (the-as art-group #f) @@ -122,9 +122,9 @@ ;; definition for method 23 of type conveyor ;; WARN: Return type mismatch int vs none. -(defmethod reset-root! conveyor ((obj conveyor)) +(defmethod reset-root! conveyor ((this conveyor)) "Re-initializes the `root` [[trsqv]]" - (set! (-> obj root) (new 'process 'trsqv)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) @@ -132,20 +132,20 @@ ;; definition for method 24 of type conveyor ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init! conveyor ((obj conveyor)) +(defmethod init! conveyor ((this conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (local-vars (tag res-tag)) - (set! (-> obj speed) 24576.0) - (set! (-> obj belt-radius) 11878.4) - (set! (-> obj pull-y-threshold) 10240.0) - (set! (-> obj speed-mult-array) #f) - (set! (-> obj speed-mult-array-len) 0) - (let ((entity (-> obj entity))) + (set! (-> this speed) 24576.0) + (set! (-> this belt-radius) 11878.4) + (set! (-> this pull-y-threshold) 10240.0) + (set! (-> this speed-mult-array) #f) + (set! (-> this speed-mult-array-len) 0) + (let ((entity (-> this entity))) (set! tag (new 'static 'res-tag)) (let ((scale-factor (res-lump-data entity 'scale-factor pointer :tag-ptr (& tag)))) (when scale-factor - (set! (-> obj speed-mult-array) (the-as (array float) scale-factor)) - (set! (-> obj speed-mult-array-len) (the-as int (-> tag elt-count))) + (set! (-> this speed-mult-array) (the-as (array float) scale-factor)) + (set! (-> this speed-mult-array-len) (the-as int (-> tag elt-count))) ) ) ) @@ -155,24 +155,24 @@ ;; definition for method 25 of type conveyor ;; WARN: Return type mismatch object vs ambient-sound. -(defmethod set-and-get-ambient-sound! conveyor ((obj conveyor)) +(defmethod set-and-get-ambient-sound! conveyor ((this conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" - (let ((actor-options (res-lump-value (-> obj entity) 'options actor-option :time -1000000000.0))) + (let ((actor-options (res-lump-value (-> this entity) 'options actor-option :time -1000000000.0))) (the-as ambient-sound (cond ((not (logtest? (actor-option no-amb-sound) actor-options)) (let ((sound - (the-as object (new 'process 'ambient-sound (static-sound-spec "conveyor" :fo-max 80) (-> obj root trans))) + (the-as object (new 'process 'ambient-sound (static-sound-spec "conveyor" :fo-max 80) (-> this root trans))) ) ) - (set! (-> obj sound) (the-as ambient-sound sound)) + (set! (-> this sound) (the-as ambient-sound sound)) sound ) ) (else - (set! (-> obj sound) (the-as ambient-sound 0)) + (set! (-> this sound) (the-as ambient-sound 0)) 0 ) ) @@ -182,13 +182,13 @@ and return it as well. Otherwise, set it to `0`" ;; definition for method 26 of type conveyor ;; INFO: Used lq/sq -(defmethod conveyor-method-26 conveyor ((obj conveyor) (proc-focus process-focusable)) +(defmethod conveyor-method-26 conveyor ((this conveyor) (proc-focus process-focusable)) "TODO - conveyor section related, perhaps related to moving the process along the belt?" (let ((vec (new 'stack-no-clear 'vector))) (set! (-> vec quad) (-> (get-trans proc-focus 0) quad)) (set! (-> vec w) 1.0) - (when (>= (vector4-dot vec (the-as vector (-> obj leading))) 0.0) - (let* ((sections (-> obj sections)) + (when (>= (vector4-dot vec (the-as vector (-> this leading))) 0.0) + (let* ((sections (-> this sections)) (section-count (-> sections length)) ) (dotimes (section-idx section-count) @@ -196,16 +196,16 @@ and return it as well. Otherwise, set it to `0`" (when (< (vector4-dot vec (the-as vector (-> section trailing))) 0.0) (let ((vec-temp (new 'stack-no-clear 'vector))) (vector-! vec-temp vec (-> section start)) - (when (>= (-> obj belt-radius) (fabs (vector-dot vec-temp (-> section radial-dir)))) + (when (>= (-> this belt-radius) (fabs (vector-dot vec-temp (-> section radial-dir)))) (let* ((f0-7 (vector-dot vec-temp (-> section pull-dir))) (f1-6 (- (-> vec-temp y) (* (-> section pull-dir y) f0-7))) ) - (when (>= (-> obj pull-y-threshold) (fabs f1-6)) + (when (>= (-> this pull-y-threshold) (fabs f1-6)) (let ((a2-8 (new 'stack-no-clear 'vector))) - (let ((f0-10 (-> obj speed))) - (if (< section-idx (-> obj speed-mult-array-len)) + (let ((f0-10 (-> this speed))) + (if (< section-idx (-> this speed-mult-array-len)) (set! f0-10 - (* f0-10 (-> (the-as (pointer float) (+ (the-as uint (-> obj speed-mult-array)) (* section-idx 4))))) + (* f0-10 (-> (the-as (pointer float) (+ (the-as uint (-> this speed-mult-array)) (* section-idx 4))))) ) ) (vector-float*! a2-8 (-> section pull-dir) (* f0-10 (seconds-per-frame))) @@ -227,7 +227,7 @@ and return it as well. Otherwise, set it to `0`" ) ;; definition for method 27 of type conveyor -(defmethod conveyor-method-27 conveyor ((obj conveyor)) +(defmethod conveyor-method-27 conveyor ((this conveyor)) "TODO - collision related, has some dead code as well (previous iteration?)" (local-vars (a0-10 float) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) @@ -240,7 +240,7 @@ and return it as well. Otherwise, set it to `0`" (init-vf0-vector) (set! *actor-list-length* 0) (if #t - (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* (-> obj collide-bounds) *actor-list* 256)) + (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* (-> this collide-bounds) *actor-list* 256)) ) (when #t (let ((a0-2 (-> *collide-player-list* alive-list next0))) @@ -253,7 +253,7 @@ and return it as well. Otherwise, set it to `0`" (when (logtest? (-> a1-1 prim-core collide-as) (collide-spec jak bot enemy hit-by-others-list player-list)) (let ((a1-2 (-> a1-1 prim-core))) (let ((a2-4 a1-2) - (a3-1 (-> obj collide-bounds)) + (a3-1 (-> this collide-bounds)) ) (.lvf vf2 (&-> a2-4 world-sphere quad)) (.lvf vf3 (&-> a3-1 quad)) @@ -264,7 +264,7 @@ and return it as well. Otherwise, set it to `0`" (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-5 vf1) (let ((f0-0 a2-5) - (f1-1 (+ (-> a1-2 world-sphere w) (-> obj collide-bounds r))) + (f1-1 (+ (-> a1-2 world-sphere w) (-> this collide-bounds r))) ) (b! (>= f0-0 (* f1-1 f1-1)) cfg-8 :delay #f) ) @@ -294,7 +294,7 @@ and return it as well. Otherwise, set it to `0`" (when (logtest? (-> a1-13 prim-core collide-as) (collide-spec jak bot enemy hit-by-others-list player-list)) (let ((a1-14 (-> a1-13 prim-core))) (let ((a2-11 a1-14) - (a3-2 (-> obj collide-bounds)) + (a3-2 (-> this collide-bounds)) ) (.lvf vf2 (&-> a2-11 world-sphere quad)) (.lvf vf3 (&-> a3-2 quad)) @@ -305,7 +305,7 @@ and return it as well. Otherwise, set it to `0`" (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-12 vf1) (let ((f0-1 a2-12) - (f1-5 (+ (-> a1-14 world-sphere w) (-> obj collide-bounds r))) + (f1-5 (+ (-> a1-14 world-sphere w) (-> this collide-bounds r))) ) (b! (>= f0-1 (* f1-5 f1-5)) cfg-17 :delay #f) ) @@ -329,7 +329,7 @@ and return it as well. Otherwise, set it to `0`" (a0-9 (-> v1-23 root-prim)) ) (when (logtest? (-> a0-9 prim-core collide-as) (collide-spec jak bot enemy hit-by-others-list player-list)) - (.lvf vf1 (&-> obj collide-bounds quad)) + (.lvf vf1 (&-> this collide-bounds quad)) (.lvf vf2 (&-> a0-9 prim-core world-sphere quad)) (.sub.vf vf3 vf1 vf2) (.add.w.vf vf4 vf1 vf2 :mask #b1000) @@ -350,7 +350,7 @@ and return it as well. Otherwise, set it to `0`" ) ) (if a1-29 - (conveyor-method-26 obj a1-29) + (conveyor-method-26 this a1-29) ) ) ) @@ -366,25 +366,25 @@ and return it as well. Otherwise, set it to `0`" ;; definition for method 21 of type conveyor ;; INFO: Used lq/sq -(defmethod conveyor-method-21 conveyor ((obj conveyor)) +(defmethod conveyor-method-21 conveyor ((this conveyor)) "TODO - quite dense, has to do with the conveyor sections and the path they are associated with" (local-vars (sv-32 conveyor-section) (sv-48 conveyor-section)) - (let* ((s5-0 (-> obj path)) + (let* ((s5-0 (-> this path)) (s4-0 (-> s5-0 curve num-cverts)) (s3-0 (new 'stack-no-clear 'vector)) ) (let ((s2-0 (new 'process 'conveyor-section-array (+ s4-0 -1)))) - (set! (-> obj sections) s2-0) - (set! (-> obj collide-bounds quad) (the-as uint128 0)) + (set! (-> this sections) s2-0) + (set! (-> this collide-bounds quad) (the-as uint128 0)) (get-point-in-path! s5-0 s3-0 0.0 'exact) - (vector+! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) s3-0) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (let ((s1-0 (+ s4-0 -1))) (set! sv-32 (the-as conveyor-section #f)) (dotimes (s0-0 s1-0) (set! sv-48 (-> s2-0 data s0-0)) (set! (-> sv-48 start quad) (-> s3-0 quad)) (get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'exact) - (vector+! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) s3-0) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start)) (vector-normalize! (-> sv-48 pull-dir) 1.0) (set! (-> sv-48 trailing quad) (-> sv-48 pull-dir quad)) @@ -402,25 +402,25 @@ and return it as well. Otherwise, set it to `0`" ) ) ) - (let ((s2-1 (-> obj sections data))) - (set! (-> obj leading quad) (-> s2-1 0 pull-dir quad)) - (set! (-> obj leading y) 0.0) - (vector-normalize! (-> obj leading) 1.0) - (set! (-> obj leading w) (- (vector-dot (the-as vector (-> s2-1 0)) (the-as vector (-> obj leading))))) + (let ((s2-1 (-> this sections data))) + (set! (-> this leading quad) (-> s2-1 0 pull-dir quad)) + (set! (-> this leading y) 0.0) + (vector-normalize! (-> this leading) 1.0) + (set! (-> this leading w) (- (vector-dot (the-as vector (-> s2-1 0)) (the-as vector (-> this leading))))) ) (let ((f0-19 (/ 1.0 (the float s4-0))) (f30-0 0.0) ) - (vector-float*! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) f0-19) + (vector-float*! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) f0-19) (dotimes (s2-2 s4-0) (get-point-in-path! s5-0 s3-0 (the float s2-2) 'exact) - (let ((f0-22 (vector-vector-distance-squared s3-0 (-> obj collide-bounds)))) + (let ((f0-22 (vector-vector-distance-squared s3-0 (-> this collide-bounds)))) (if (< f30-0 f0-22) (set! f30-0 f0-22) ) ) ) - (set! (-> obj collide-bounds r) (+ (sqrtf f30-0) (-> obj belt-radius))) + (set! (-> this collide-bounds r) (+ (sqrtf f30-0) (-> this belt-radius))) ) ) ) @@ -439,26 +439,26 @@ and return it as well. Otherwise, set it to `0`" ;; definition for method 11 of type conveyor ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! conveyor ((obj conveyor) (arg0 entity-actor)) +(defmethod init-from-entity! conveyor ((this conveyor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (reset-root! obj) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group (get-art-group obj)) (the-as pair 0)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (if (< (-> obj path curve num-cverts) 2) + (reset-root! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-art-group this)) (the-as pair 0)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) - (init! obj) - (set-and-get-ambient-sound! obj) - (conveyor-method-21 obj) + (init! this) + (set-and-get-ambient-sound! this) + (conveyor-method-21 this) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -472,16 +472,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type strip-conveyor -(defmethod inspect strip-conveyor ((obj strip-conveyor)) - (when (not obj) - (set! obj obj) +(defmethod inspect strip-conveyor ((this strip-conveyor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type conveyor inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -491,7 +491,7 @@ This commonly includes things such as: ) ;; definition for method 22 of type strip-conveyor -(defmethod get-art-group strip-conveyor ((obj strip-conveyor)) +(defmethod get-art-group strip-conveyor ((this strip-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-strip-conveyor" (the-as (pointer uint32) #f)) ) @@ -506,16 +506,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type lgconveyor -(defmethod inspect lgconveyor ((obj lgconveyor)) - (when (not obj) - (set! obj obj) +(defmethod inspect lgconveyor ((this lgconveyor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type conveyor inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -527,18 +527,18 @@ This commonly includes things such as: ) ;; definition for method 22 of type lgconveyor -(defmethod get-art-group lgconveyor ((obj lgconveyor)) +(defmethod get-art-group lgconveyor ((this lgconveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-lgconveyor" (the-as (pointer uint32) #f)) ) ;; definition for method 24 of type lgconveyor ;; WARN: Return type mismatch float vs none. -(defmethod init! lgconveyor ((obj lgconveyor)) +(defmethod init! lgconveyor ((this lgconveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj speed) 30720.0) - (set! (-> obj belt-radius) 11878.4) - (set! (-> obj pull-y-threshold) 10240.0) + (set! (-> this speed) 30720.0) + (set! (-> this belt-radius) 11878.4) + (set! (-> this pull-y-threshold) 10240.0) (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc index 11f89c95c9..2cc4d6bb50 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/crates_REF.gc @@ -20,17 +20,17 @@ ) ;; definition for method 3 of type crate-bank -(defmethod inspect crate-bank ((obj crate-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect crate-bank ((this crate-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1TCOLLIDE_YOFF: ~f~%" (-> obj COLLIDE_YOFF)) - (format #t "~1TCOLLIDE_RADIUS: ~f~%" (-> obj COLLIDE_RADIUS)) - (format #t "~1TDARKECO_EXPLODE_RADIUS: ~f~%" (-> obj DARKECO_EXPLODE_RADIUS)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1TCOLLIDE_YOFF: ~f~%" (-> this COLLIDE_YOFF)) + (format #t "~1TCOLLIDE_RADIUS: ~f~%" (-> this COLLIDE_RADIUS)) + (format #t "~1TDARKECO_EXPLODE_RADIUS: ~f~%" (-> this DARKECO_EXPLODE_RADIUS)) (label cfg-4) - obj + this ) ;; definition for symbol *CRATE-bank*, type crate-bank @@ -73,24 +73,24 @@ ) ;; definition for method 3 of type crate -(defmethod inspect crate ((obj crate)) - (when (not obj) - (set! obj obj) +(defmethod inspect crate ((this crate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsmush: #~%" (-> obj smush)) - (format #t "~2Tbase: ~`vector`P~%" (-> obj base)) - (format #t "~2Tlook: ~A~%" (-> obj look)) - (format #t "~2Tdefense: ~A~%" (-> obj defense)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Ttarget: ~D~%" (-> obj target)) - (format #t "~2Tchild-count: ~D~%" (-> obj child-count)) - (format #t "~2Tvictory-anim: ~A~%" (-> obj victory-anim)) + (format #t "~2Tsmush: #~%" (-> this smush)) + (format #t "~2Tbase: ~`vector`P~%" (-> this base)) + (format #t "~2Tlook: ~A~%" (-> this look)) + (format #t "~2Tdefense: ~A~%" (-> this defense)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Ttarget: ~D~%" (-> this target)) + (format #t "~2Tchild-count: ~D~%" (-> this child-count)) + (format #t "~2Tvictory-anim: ~A~%" (-> this victory-anim)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -907,7 +907,7 @@ ) (when (not arg0) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) (seconds 0.04)) + (until (time-elapsed? s5-1 (seconds 0.04)) (suspend) ) ) @@ -1062,13 +1062,13 @@ (process-entity-status! self (entity-perm-status dead) #t) (process-entity-status! self (entity-perm-status subtask-complete) #t) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 5)) + (until (time-elapsed? gp-1 (seconds 5)) (suspend) ) ) (when (logtest? (actor-option cond-respawn) (-> self fact options)) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 15)) + (until (time-elapsed? gp-2 (seconds 15)) (suspend) ) ) @@ -1171,26 +1171,26 @@ ) ;; definition for method 11 of type crate -(defmethod init-from-entity! crate ((obj crate) (arg0 entity-actor)) +(defmethod init-from-entity! crate ((this crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (crate-init! obj arg0) - (skel-init! obj) - (crate-method-38 obj) + (crate-init! this arg0) + (skel-init! this) + (crate-method-38 this) (none) ) ;; definition for method 35 of type crate ;; WARN: Return type mismatch crate vs none. -(defmethod crate-init! crate ((obj crate) (arg0 entity-actor)) +(defmethod crate-init! crate ((this crate) (arg0 entity-actor)) "Initialize the [[crate]] with the specified [[entity-actor]]." - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask crate)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask crate)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1232,29 +1232,29 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj fact) - (new 'process 'fact-info-crate obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this fact) + (new 'process 'fact-info-crate this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (when (-> obj entity) - (let ((v1-22 (-> obj entity extra perm))) - (set! (-> obj fact pickup-amount) - (fmax 0.0 (- (-> obj fact pickup-amount) (the float (-> v1-22 user-int8 1)))) + (when (-> this entity) + (let ((v1-22 (-> this entity extra perm))) + (set! (-> this fact pickup-amount) + (fmax 0.0 (- (-> this fact pickup-amount) (the float (-> v1-22 user-int8 1)))) ) ) ) - (when (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (set! (-> obj fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> obj fact pickup-amount) 0.0) + (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (set! (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-amount) 0.0) ) (when arg0 - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) ) (let ((v1-37 ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'crate-type 'interp -1000000000.0 @@ -1264,109 +1264,109 @@ This commonly includes things such as: ) ) ) - (set! (-> obj look) (the-as symbol v1-37)) - (set! (-> obj defense) (the-as symbol v1-37)) + (set! (-> this look) (the-as symbol v1-37)) + (set! (-> this defense) (the-as symbol v1-37)) ) - (set! (-> obj carry) - (new 'process 'carry-info obj 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0) + (set! (-> this carry) + (new 'process 'carry-info this 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0) ) - (set! (-> obj carry max-pull) 3686.4) - (set! (-> obj carry carry-radius) 3276.8) - (set! (-> obj target) (the-as handle #f)) + (set! (-> this carry max-pull) 3686.4) + (set! (-> this carry carry-radius) 3276.8) + (set! (-> this target) (the-as handle #f)) (none) ) ;; definition for method 36 of type crate ;; INFO: Used lq/sq ;; WARN: Return type mismatch crate vs none. -(defmethod skel-init! crate ((obj crate)) +(defmethod skel-init! crate ((this crate)) "Initialize the [[crate]]'s skeleton and other parameters based on the crate type." - (case (-> obj look) + (case (-> this look) (('iron) - (set! (-> (the-as collide-shape-moving (-> obj root)) penetrated-by) + (set! (-> (the-as collide-shape-moving (-> this root)) penetrated-by) (penetrate flop uppercut tube vehicle flut-attack board dark-skin explode) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) (('steel) - (set! (-> (the-as collide-shape-moving (-> obj root)) penetrated-by) + (set! (-> (the-as collide-shape-moving (-> this root)) penetrated-by) (penetrate tube vehicle flut-attack board dark-skin explode) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) (('darkeco) - (when (= (-> obj fact pickup-type) (pickup-type eco-pill-random)) - (set! (-> obj fact pickup-type) (pickup-type none)) - (set! (-> obj fact pickup-amount) 0.0) + (when (= (-> this fact pickup-type) (pickup-type eco-pill-random)) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj draw color-mult) 0.8 0.8 0.8 1.0) - (set-vector! (-> obj draw color-emissive) 0.2 0.2 0.2 1.0) + (set-vector! (-> this draw color-mult) 0.8 0.8 0.8 1.0) + (set-vector! (-> this draw color-emissive) 0.2 0.2 0.2 1.0) ) (('none) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw)) + (logior! (-> this draw status) (draw-control-status no-draw)) ) (else (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crate-krimson" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) ) - (set! (-> obj base quad) (-> obj root trans quad)) + (set! (-> this base quad) (-> this root trans quad)) (crate-post) - (nav-mesh-connect-from-ent obj) + (nav-mesh-connect-from-ent this) (none) ) ;; definition for method 37 of type crate ;; WARN: Return type mismatch crate vs none. -(defmethod params-set! crate ((obj crate) (arg0 symbol) (arg1 symbol)) +(defmethod params-set! crate ((this crate) (arg0 symbol) (arg1 symbol)) "Set [[crate]] params based on the arguments." (if arg0 - (set! (-> obj look) arg0) + (set! (-> this look) arg0) ) (if arg1 - (set! (-> obj defense) arg1) + (set! (-> this defense) arg1) ) (none) ) ;; definition for method 38 of type crate ;; WARN: Return type mismatch int vs none. -(defmethod crate-method-38 crate ((obj crate)) - (when (-> obj entity) - (if (>= (-> obj entity extra perm user-int8 0) 1) - (go (method-of-object obj die) #t 0) +(defmethod crate-method-38 crate ((this crate)) + (when (-> this entity) + (if (>= (-> this entity extra perm user-int8 0) 1) + (go (method-of-object this die) #t 0) ) ) (cond - ((logtest? (actor-option cond-hide) (-> obj fact options)) - (go (method-of-object obj hide)) + ((logtest? (actor-option cond-hide) (-> this fact options)) + (go (method-of-object this hide)) ) - ((logtest? (actor-option fall) (-> obj fact options)) - (go (method-of-object obj fall)) + ((logtest? (actor-option fall) (-> this fact options)) + (go (method-of-object this fall)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) 0 @@ -1375,11 +1375,11 @@ This commonly includes things such as: ;; definition for method 39 of type crate ;; WARN: Return type mismatch int vs none. -(defmethod smush-update! crate ((obj crate)) - (let ((f0-0 (update! (-> obj smush)))) - (set! (-> obj root scale x) (+ 1.0 (* -0.5 f0-0))) - (set! (-> obj root scale y) (+ 1.0 f0-0)) - (set! (-> obj root scale z) (+ 1.0 (* -0.5 f0-0))) +(defmethod smush-update! crate ((this crate)) + (let ((f0-0 (update! (-> this smush)))) + (set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0))) + (set! (-> this root scale y) (+ 1.0 f0-0)) + (set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0))) ) 0 (none) @@ -1387,21 +1387,21 @@ This commonly includes things such as: ;; definition for method 40 of type crate ;; WARN: disable def twice: 57. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod crate-method-40 crate ((obj crate)) +(defmethod crate-method-40 crate ((this crate)) (cond - ((and (> (-> (the-as fact-info-crate (-> obj fact)) suck-count) 0) - (< (you-suck-stage *game-info* #f) (-> (the-as fact-info-crate (-> obj fact)) suck-count)) + ((and (> (-> (the-as fact-info-crate (-> this fact)) suck-count) 0) + (< (you-suck-stage *game-info* #f) (-> (the-as fact-info-crate (-> this fact)) suck-count)) ) #t ) - ((logtest? (actor-option cond-low-ammo) (-> obj fact options)) - (case (-> obj fact pickup-type) + ((logtest? (actor-option cond-low-ammo) (-> this fact options)) + (case (-> this fact pickup-type) (((pickup-type ammo-yellow) (pickup-type ammo-red) (pickup-type ammo-blue) (pickup-type ammo-dark)) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer self)) (set! (-> a1-4 num-params) 1) (set! (-> a1-4 message) 'test-pickup) - (set! (-> a1-4 param 0) (the-as uint (-> obj fact pickup-type))) + (set! (-> a1-4 param 0) (the-as uint (-> this fact pickup-type))) (let ((v1-15 (the-as float (send-event-function *target* a1-4)))) (or (not v1-15) (< 10.0 v1-15)) ) @@ -1429,38 +1429,38 @@ This commonly includes things such as: ) ;; definition for method 3 of type pickup-spawner -(defmethod inspect pickup-spawner ((obj pickup-spawner)) - (when (not obj) - (set! obj obj) +(defmethod inspect pickup-spawner ((this pickup-spawner)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type crate inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tblocker: ~A~%" (-> obj blocker)) + (format #t "~2Tblocker: ~A~%" (-> this blocker)) (label cfg-4) - obj + this ) ;; definition for method 35 of type pickup-spawner ;; WARN: Return type mismatch pickup-spawner vs none. -(defmethod crate-init! pickup-spawner ((obj pickup-spawner) (arg0 entity-actor)) +(defmethod crate-init! pickup-spawner ((this pickup-spawner) (arg0 entity-actor)) "Initialize the [[crate]] with the specified [[entity-actor]]." (let ((t9-0 (method-of-type crate crate-init!))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj look) 'none) - (set! (-> obj blocker) #f) - (if (logtest? (-> obj fact options) (actor-option blocked)) - (set! (-> obj blocker) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (set! (-> this look) 'none) + (set! (-> this blocker) #f) + (if (logtest? (-> this fact options) (actor-option blocked)) + (set! (-> this blocker) (entity-actor-lookup (-> this entity) 'alt-actor 0)) ) (none) ) ;; definition for method 38 of type pickup-spawner ;; WARN: Return type mismatch int vs none. -(defmethod crate-method-38 pickup-spawner ((obj pickup-spawner)) - (go (method-of-object obj idle)) +(defmethod crate-method-38 pickup-spawner ((this pickup-spawner)) + (go (method-of-object this idle)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc index bf73d3fa77..d755ff05c5 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/dark-eco-pool_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type dark-eco-pool -(defmethod inspect dark-eco-pool ((obj dark-eco-pool)) - (when (not obj) - (set! obj obj) +(defmethod inspect dark-eco-pool ((this dark-eco-pool)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol *ripple-for-dark-eco-pool*, type ripple-wave-set @@ -54,18 +54,18 @@ ;; definition for method 28 of type dark-eco-pool ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod offset! dark-eco-pool ((obj dark-eco-pool)) +(defmethod offset! dark-eco-pool ((this dark-eco-pool)) "Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`." (let ((t9-0 (method-of-type water-anim offset!))) - (t9-0 obj) + (t9-0 this) ) - (logclear! (-> obj flags) (water-flags part-water)) - (logior! (-> obj flags) (water-flags dark-eco)) - (set! (-> obj attack-event) + (logclear! (-> this flags) (water-flags part-water)) + (logior! (-> this flags) (water-flags dark-eco)) + (set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'attack-event 'interp -1000000000.0 @@ -75,27 +75,27 @@ ) ) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "eco-pool" :fo-min 30 :fo-max 50) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "eco-pool" :fo-min 30 :fo-max 50) (-> this root trans)) ) (none) ) ;; definition for method 24 of type dark-eco-pool ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! dark-eco-pool ((obj dark-eco-pool)) +(defmethod init-water! dark-eco-pool ((this dark-eco-pool)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((s5-0 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) s5-0) + (set! (-> this draw ripple) s5-0) (set! (-> s5-0 global-scale) 3072.0) (set! (-> s5-0 close-fade-dist) 163840.0) (set! (-> s5-0 far-fade-dist) 245760.0) (set! (-> s5-0 waveform) *ripple-for-dark-eco-pool*) (set! (-> s5-0 query) (new 'process 'ripple-merc-query 100)) - (case (-> obj look) + (case (-> this look) ((5) (set! (-> s5-0 waveform) *ripple-strip-dark-eco-near-lift*) ) 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 7eea1e3efa..ee49840548 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/elevator_REF.gc @@ -15,19 +15,19 @@ ) ;; definition for method 3 of type elevator-params -(defmethod inspect elevator-params ((obj elevator-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect elevator-params ((this elevator-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'elevator-params) - (format #t "~1Txz-threshold: ~f~%" (-> obj xz-threshold)) - (format #t "~1Ty-threshold: ~f~%" (-> obj y-threshold)) - (format #t "~1Tstart-pos: ~f~%" (-> obj start-pos)) - (format #t "~1Tmove-rate: ~f~%" (-> obj move-rate)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "[~8x] ~A~%" this 'elevator-params) + (format #t "~1Txz-threshold: ~f~%" (-> this xz-threshold)) + (format #t "~1Ty-threshold: ~f~%" (-> this y-threshold)) + (format #t "~1Tstart-pos: ~f~%" (-> this start-pos)) + (format #t "~1Tmove-rate: ~f~%" (-> this move-rate)) + (format #t "~1Tflags: ~D~%" (-> this flags)) (label cfg-4) - obj + this ) ;; definition of type path-step @@ -41,16 +41,16 @@ ) ;; definition for method 3 of type path-step -(defmethod inspect path-step ((obj path-step)) - (when (not obj) - (set! obj obj) +(defmethod inspect path-step ((this path-step)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'path-step) - (format #t "~1Tnext-pos: ~f~%" (-> obj next-pos)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) + (format #t "[~8x] ~A~%" this 'path-step) + (format #t "~1Tnext-pos: ~f~%" (-> this next-pos)) + (format #t "~1Tdist: ~f~%" (-> this dist)) (label cfg-4) - obj + this ) ;; definition of type path-step-inline-array @@ -63,17 +63,17 @@ ) ;; definition for method 3 of type path-step-inline-array -(defmethod inspect path-step-inline-array ((obj path-step-inline-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect path-step-inline-array ((this path-step-inline-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -119,33 +119,33 @@ ) ;; definition for method 3 of type elevator -(defmethod inspect elevator ((obj elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect elevator ((this elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tparams: #~%" (-> obj params)) - (format #t "~2Tpath-seq: ~A~%" (-> obj path-seq)) - (format #t "~2Tpath-dest: ~f~%" (-> obj path-dest)) - (format #t "~2Tbottom-top[2] @ #x~X~%" (-> obj bottom-top)) - (format #t "~2Tmove-pos[2] @ #x~X~%" (-> obj move-pos)) - (format #t "~2Tmove-dist: ~f~%" (-> obj move-dist)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tpath-eased-pos: ~f~%" (-> obj path-eased-pos)) - (format #t "~2Tride-timer: ~D~%" (-> obj ride-timer)) - (format #t "~2Tsticky-player-last-ride-time: ~D~%" (-> obj sticky-player-last-ride-time)) - (format #t "~2Televator-status: ~D~%" (-> obj elevator-status)) - (format #t "~2Ton-activate: ~A~%" (-> obj on-activate)) - (format #t "~2Ton-deactivate: ~A~%" (-> obj on-deactivate)) + (format #t "~2Tparams: #~%" (-> this params)) + (format #t "~2Tpath-seq: ~A~%" (-> this path-seq)) + (format #t "~2Tpath-dest: ~f~%" (-> this path-dest)) + (format #t "~2Tbottom-top[2] @ #x~X~%" (-> this bottom-top)) + (format #t "~2Tmove-pos[2] @ #x~X~%" (-> this move-pos)) + (format #t "~2Tmove-dist: ~f~%" (-> this move-dist)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tpath-eased-pos: ~f~%" (-> this path-eased-pos)) + (format #t "~2Tride-timer: ~D~%" (-> this ride-timer)) + (format #t "~2Tsticky-player-last-ride-time: ~D~%" (-> this sticky-player-last-ride-time)) + (format #t "~2Televator-status: ~D~%" (-> this elevator-status)) + (format #t "~2Ton-activate: ~A~%" (-> this on-activate)) + (format #t "~2Ton-deactivate: ~A~%" (-> this on-deactivate)) (label cfg-4) - obj + this ) ;; definition for method 43 of type elevator -(defmethod move-between-points elevator ((obj elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points elevator ((this elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @@ -156,7 +156,7 @@ ;; definition for method 48 of type elevator ;; INFO: Used lq/sq -(defmethod elevator-method-48 elevator ((obj elevator)) +(defmethod elevator-method-48 elevator ((this elevator)) "TODO - collision related" (let ((target *target*)) (when target @@ -192,68 +192,68 @@ ;; definition for method 41 of type elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-defaults! elevator ((obj elevator)) +(defmethod init-defaults! elevator ((this elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` - `elevator-start-pos` - `elevator-move-rate` - `elevator-flags`" - (let ((entity (-> obj entity))) - (set! (-> obj params xz-threshold) ((method-of-object entity get-property-value-float) + (let ((entity (-> this entity))) + (set! (-> this params xz-threshold) ((method-of-object entity get-property-value-float) + entity + 'elevator-xz-threshold + 'interp + -1000000000.0 + 81920.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (set! entity (-> this entity)) + (set! (-> this params y-threshold) ((method-of-object entity get-property-value-float) entity - 'elevator-xz-threshold + 'elevator-y-threshold 'interp -1000000000.0 - 81920.0 + 20480.0 (the-as (pointer res-tag) #f) *res-static-buf* ) ) - (set! entity (-> obj entity)) - (set! (-> obj params y-threshold) ((method-of-object entity get-property-value-float) - entity - 'elevator-y-threshold - 'interp - -1000000000.0 - 20480.0 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) + (set! entity (-> this entity)) + (set! (-> this params start-pos) ((method-of-object entity get-property-value-float) + entity + 'elevator-start-pos + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) ) - (set! entity (-> obj entity)) - (set! (-> obj params start-pos) ((method-of-object entity get-property-value-float) - entity - 'elevator-start-pos - 'interp - -1000000000.0 - 0.0 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) + (set! entity (-> this entity)) + (set! (-> this params move-rate) ((method-of-object entity get-property-value-float) + entity + 'elevator-move-rate + 'interp + -1000000000.0 + 25600.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) ) - (set! entity (-> obj entity)) - (set! (-> obj params move-rate) ((method-of-object entity get-property-value-float) - entity - 'elevator-move-rate - 'interp - -1000000000.0 - 25600.0 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - (set! entity (-> obj entity)) - (set! (-> obj params flags) (the-as elevator-flags ((method-of-object entity get-property-value) - entity - 'elevator-flags - 'interp - -1000000000.0 - (the-as uint128 1) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (set! entity (-> this entity)) + (set! (-> this params flags) (the-as elevator-flags ((method-of-object entity get-property-value) + entity + 'elevator-flags + 'interp + -1000000000.0 + (the-as uint128 1) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) ) 0 @@ -302,7 +302,7 @@ which is obviously useful for an elevator." (('ridden) (let ((proc-focus (handle->process (-> (the-as focus (-> event param 0)) handle)))) (if (= (-> proc-focus type) target) - (set! (-> self sticky-player-last-ride-time) (current-time)) + (set-time! (-> self sticky-player-last-ride-time)) ) ) #t @@ -430,7 +430,7 @@ which is obviously useful for an elevator." ;; definition for method 47 of type elevator ;; INFO: Used lq/sq -(defmethod find-closest-point-in-path! elevator ((obj elevator) (arg0 vector) (arg1 (pointer float)) (arg2 symbol) (arg3 symbol)) +(defmethod find-closest-point-in-path! elevator ((this elevator) (arg0 vector) (arg1 (pointer float)) (arg2 symbol) (arg3 symbol)) "Finds and sets the provided [[path-step]]'s `next-pos` field to the vertex index in the path which is closest to the provided [[vector]] @@ -440,19 +440,19 @@ the provided [[vector]] @param arg3 TODO @returns [[#t]] if a point in the path was found" (local-vars (path-point vector)) - (let ((elev-params (-> obj params)) + (let ((elev-params (-> this params)) (smallest-dist 0.0) (point-idx-tracker -1.0) ) - (dotimes (path-vertex-idx (-> obj path curve num-cverts)) + (dotimes (path-vertex-idx (-> this path curve num-cverts)) (set! path-point - (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float path-vertex-idx) 'interp) + (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-vertex-idx) 'interp) ) (when (and (or (not arg2) (< (vector-vector-xz-distance path-point arg0) (-> elev-params xz-threshold))) (or (not arg3) (< (fabs (- (-> path-point y) (-> arg0 y))) (-> elev-params y-threshold)) - (and (= path-vertex-idx (the int (-> obj bottom-top 0))) (< (-> arg0 y) (-> path-point y))) - (and (= path-vertex-idx (the int (-> obj bottom-top 1))) (< (-> path-point y) (-> arg0 y))) + (and (= path-vertex-idx (the int (-> this bottom-top 0))) (< (-> arg0 y) (-> path-point y))) + (and (= path-vertex-idx (the int (-> this bottom-top 1))) (< (-> path-point y) (-> arg0 y))) ) ) (let* ((t9-2 vector-vector-distance) @@ -475,7 +475,7 @@ the provided [[vector]] ;; definition for method 44 of type elevator ;; WARN: Return type mismatch object vs symbol. -(defmethod elevator-method-44 elevator ((obj elevator)) +(defmethod elevator-method-44 elevator ((this elevator)) (let* ((target-temp *target*) (target (if (type? target-temp process-focusable) target-temp @@ -484,13 +484,13 @@ the provided [[vector]] ) (the-as symbol - (and target (move-between-points obj (get-trans target 0) (-> obj move-pos 0) (-> obj move-pos 1))) + (and target (move-between-points this (get-trans target 0) (-> this move-pos 0) (-> this move-pos 1))) ) ) ) ;; definition for method 45 of type elevator -(defmethod commited-to-ride? elevator ((obj elevator)) +(defmethod commited-to-ride? elevator ((this elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" #t ) @@ -503,7 +503,7 @@ the provided [[vector]] ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod move-to-next-point! elevator ((obj elevator)) +(defmethod move-to-next-point! elevator ((this elevator)) "If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path do so. @see [[elevator::47]]" @@ -516,11 +516,11 @@ do so. ) ) (set! zero (the-as float 0.0)) - (when (and (find-closest-point-in-path! obj (get-trans target 0) (& zero) #t #t) (!= (-> obj move-pos 1) zero)) - (set! (-> obj move-pos 0) (-> obj move-pos 1)) - (set! (-> obj move-pos 1) zero) - (logior! (-> obj elevator-status) (elevator-status moving)) - (go (method-of-object obj running)) + (when (and (find-closest-point-in-path! this (get-trans target 0) (& zero) #t #t) (!= (-> this move-pos 1) zero)) + (set! (-> this move-pos 0) (-> this move-pos 1)) + (set! (-> this move-pos 1) zero) + (logior! (-> this elevator-status) (elevator-status moving)) + (go (method-of-object this running)) ) ) ) @@ -579,7 +579,7 @@ do so. ) ) :enter (behavior () - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (logclear! (-> self elevator-status) (elevator-status waiting-to-descend moving)) (logior! (-> self mask) (process-mask actor-pause)) (if (nonzero? (-> self sound)) @@ -589,7 +589,7 @@ do so. :trans (behavior () (plat-trans) (when (not (logtest? (-> self elevator-status) (elevator-status waiting-to-descend))) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (-> self params) (if (and (logtest? (-> self params flags) (elevator-flags elevator-flags-0)) (not (logtest? (-> self params flags) (elevator-flags elevator-flags-3))) @@ -598,7 +598,7 @@ do so. ) ) (when (and (not (logtest? (-> self params flags) (elevator-flags elevator-flags-3))) - (>= (- (current-time) (-> self ride-timer)) (seconds 1)) + (time-elapsed? (-> self ride-timer) (seconds 1)) ) (set! (-> self move-pos 0) (-> self move-pos 1)) (set! (-> self move-pos 1) (-> self path-seq data (the int (-> self move-pos 1)) next-pos)) @@ -724,7 +724,7 @@ do so. :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('ridden) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (elevator-event proc argc message block) ) (else @@ -733,7 +733,7 @@ do so. ) ) :enter (behavior () - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (if (not (-> *setting-control* user-current jump)) (remove-setting! 'jump) ) @@ -748,10 +748,10 @@ do so. (begin *target* *target*) (focus-test? *target* in-air) ) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) ) (when (or (logtest? (-> self elevator-status) (elevator-status moving)) - (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) + (time-elapsed? (-> self ride-timer) (seconds 0.5)) ) (cond ((and (logtest? (-> self params flags) (elevator-flags elevator-flags-1)) @@ -774,16 +774,16 @@ do so. ;; definition for method 39 of type elevator ;; WARN: Return type mismatch int vs none. -(defmethod calc-dist-between-points! elevator ((obj elevator) (path-point-x int) (path-point-y int)) +(defmethod calc-dist-between-points! elevator ((this elevator) (path-point-x int) (path-point-y int)) "Calculates the distance between two points in the elevator's path. @param path-point-x The index of the first point in the distance calculation, and where `next-pos` and `dist` are stored in the `path-seq` array @param path-point-y The second point in the distance calculation" - (set! (-> obj path-seq data path-point-x next-pos) (the float path-point-y)) - (let ((point-x (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float path-point-x) 'interp)) - (point-y (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float path-point-y) 'interp)) + (set! (-> this path-seq data path-point-x next-pos) (the float path-point-y)) + (let ((point-x (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-point-x) 'interp)) + (point-y (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-point-y) 'interp)) ) - (set! (-> obj path-seq data path-point-x dist) (vector-vector-distance point-x point-y)) + (set! (-> this path-seq data path-point-x dist) (vector-vector-distance point-x point-y)) ) 0 (none) @@ -791,16 +791,16 @@ do so. ;; definition for method 42 of type elevator ;; WARN: Return type mismatch int vs none. -(defmethod set-ambient-sound! elevator ((obj elevator)) +(defmethod set-ambient-sound! elevator ((this elevator)) "Sets the elevator's [[ambient-sound]] up" - (set! (-> obj sound) (the-as ambient-sound 0)) + (set! (-> this sound) (the-as ambient-sound 0)) 0 (none) ) ;; definition for method 33 of type elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! elevator ((obj elevator)) +(defmethod init-plat! elevator ((this 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." 0 @@ -809,19 +809,19 @@ 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 ((obj elevator) (arg0 int)) - (if (nonzero? (-> obj path-seq)) - (&+! (-> obj path-seq) arg0) +(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)) obj arg0)) + (the-as elevator ((the-as (function base-plat int base-plat) (find-parent-method elevator 7)) this arg0)) ) ;; definition for method 40 of type elevator -(defmethod activate-elevator elevator ((obj elevator)) +(defmethod activate-elevator elevator ((this elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" - (if (logtest? (-> obj params flags) (elevator-flags elevator-flags-6)) - (go (method-of-object obj arrived)) - (go (method-of-object obj waiting)) + (if (logtest? (-> this params flags) (elevator-flags elevator-flags-6)) + (go (method-of-object this arrived)) + (go (method-of-object this waiting)) ) ) @@ -842,7 +842,7 @@ For example for an elevator pre-compute the distance between the first and last ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! elevator ((obj elevator) (entity entity-actor)) +(defmethod init-from-entity! elevator ((this elevator) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -850,37 +850,37 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-32 float) (sv-36 path-control) (sv-40 target)) - (init-plat-collision! obj) - (process-drawable-from-entity! obj entity) - (initialize-skeleton obj (the-as skeleton-group (get-art-group obj)) (the-as pair 0)) - (stop-bouncing! obj) - (set! (-> obj elevator-status) (elevator-status)) - (update-transforms (-> obj root)) - (base-plat-method-32 obj) - (init-defaults! obj) - (set! (-> obj on-activate) (res-lump-struct (-> obj entity) 'on-activate pair)) - (set! (-> obj on-deactivate) (res-lump-struct (-> obj entity) 'on-deactivate pair)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 entity #f)) - (if (logtest? (-> obj path flags) (path-control-flag not-found)) + (init-plat-collision! this) + (process-drawable-from-entity! this entity) + (initialize-skeleton this (the-as skeleton-group (get-art-group this)) (the-as pair 0)) + (stop-bouncing! this) + (set! (-> this elevator-status) (elevator-status)) + (update-transforms (-> this root)) + (base-plat-method-32 this) + (init-defaults! this) + (set! (-> this on-activate) (res-lump-struct (-> this entity) 'on-activate pair)) + (set! (-> this on-deactivate) (res-lump-struct (-> this entity) 'on-deactivate pair)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 entity #f)) + (if (logtest? (-> this path flags) (path-control-flag not-found)) (go process-drawable-art-error "error in path") ) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (let ((num-path-points (-> obj path curve num-cverts)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((num-path-points (-> this path curve num-cverts)) (s4-1 0) (f30-0 0.0) (f28-0 0.0) ) - (set! (-> obj path-seq) (new 'process 'path-step-inline-array num-path-points)) + (set! (-> this path-seq) (new 'process 'path-step-inline-array num-path-points)) (dotimes (path-point-idx num-path-points) - (calc-dist-between-points! obj path-point-idx (mod (+ path-point-idx 1) num-path-points)) - (let ((v1-31 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float path-point-idx) 'interp))) + (calc-dist-between-points! this path-point-idx (mod (+ path-point-idx 1) num-path-points)) + (let ((v1-31 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float path-point-idx) 'interp))) (when (or (not (logtest? s4-1 1)) (< (-> v1-31 y) f28-0)) - (set! (-> obj bottom-top 0) (the float path-point-idx)) + (set! (-> this bottom-top 0) (the float path-point-idx)) (set! f28-0 (-> v1-31 y)) (set! s4-1 (logior s4-1 1)) ) (when (or (not (logtest? s4-1 2)) (< f30-0 (-> v1-31 y))) - (set! (-> obj bottom-top 1) (the float path-point-idx)) + (set! (-> this bottom-top 1) (the float path-point-idx)) (set! f30-0 (-> v1-31 y)) (set! s4-1 (logior s4-1 2)) ) @@ -888,7 +888,7 @@ This commonly includes things such as: ) ) (set! sv-32 (the-as float 0.0)) - (set! sv-36 (-> obj path)) + (set! sv-36 (-> this path)) (let ((s5-2 *target*)) (set! sv-40 (if (type? s5-2 process-focusable) s5-2 @@ -896,20 +896,20 @@ This commonly includes things such as: ) ) (if (not (and sv-40 - (logtest? (-> obj params flags) (elevator-flags elevator-flags-4)) - (find-closest-point-in-path! obj (get-trans sv-40 0) (& sv-32) #f #t) + (logtest? (-> this params flags) (elevator-flags elevator-flags-4)) + (find-closest-point-in-path! this (get-trans sv-40 0) (& sv-32) #f #t) ) ) - (set! sv-32 (-> obj params start-pos)) + (set! sv-32 (-> this params start-pos)) ) - (set! (-> obj move-pos 0) sv-32) - (set! (-> obj move-pos 1) sv-32) - (get-point-in-path! sv-36 (-> obj basetrans) sv-32 'interp) - (set! (-> obj root pause-adjust-distance) - (+ 122880.0 (-> obj params xz-threshold) (total-distance (-> obj path))) + (set! (-> this move-pos 0) sv-32) + (set! (-> this move-pos 1) sv-32) + (get-point-in-path! sv-36 (-> this basetrans) sv-32 'interp) + (set! (-> this root pause-adjust-distance) + (+ 122880.0 (-> this params xz-threshold) (total-distance (-> this path))) ) - (set-ambient-sound! obj) - (init-plat! obj) - (activate-elevator obj) + (set-ambient-sound! this) + (init-plat! this) + (activate-elevator this) (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc index 7180a4e70d..a8326d9ca8 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc @@ -36,37 +36,37 @@ ) ;; definition for method 3 of type manipy -(defmethod inspect manipy ((obj manipy)) - (when (not obj) - (set! obj obj) +(defmethod inspect manipy ((this manipy)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnew-trans-hook: ~A~%" (-> obj new-trans-hook)) - (format #t "~2Tcur-trans-hook: ~A~%" (-> obj cur-trans-hook)) - (format #t "~2Tcur-event-hook: ~A~%" (-> obj cur-event-hook)) - (format #t "~2Tnew-joint-anim: ~A~%" (-> obj new-joint-anim)) - (format #t "~2Tnew-joint-anim-blend: ~D~%" (-> obj new-joint-anim-blend)) - (format #t "~2Tanim-mode: ~A~%" (-> obj anim-mode)) - (format #t "~2Tcur-grab-handle: ~D~%" (-> obj cur-grab-handle)) - (format #t "~2Tcur-target-handle: ~D~%" (-> obj cur-target-handle)) - (format #t "~2Told-grab-pos: ~`vector`P~%" (-> obj old-grab-pos)) - (format #t "~2Tjoint[4] @ #x~X~%" (-> obj joint)) - (format #t "~2Tnew-post-hook: ~A~%" (-> obj new-post-hook)) - (format #t "~2Tcur-post-hook: ~A~%" (-> obj cur-post-hook)) - (format #t "~2Tclone-copy-trans: ~A~%" (-> obj clone-copy-trans)) - (format #t "~2Tshadow-backup: ~A~%" (-> obj shadow-backup)) - (format #t "~2Tdraw?: ~A~%" (-> obj draw?)) - (format #t "~2Tuserdata: ~A~%" (-> obj userdata)) - (format #t "~2Tprefix: ~A~%" (-> obj prefix)) - (format #t "~2Tshadow-volume-joint: ~D~%" (-> obj shadow-volume-joint)) - (format #t "~2Tspeed: ~f~%" (-> obj speed)) - (format #t "~2Tuser-uint64[4] @ #x~X~%" (-> obj user-uint64)) - (format #t "~2Toptions: ~D~%" (-> obj options)) + (format #t "~2Tnew-trans-hook: ~A~%" (-> this new-trans-hook)) + (format #t "~2Tcur-trans-hook: ~A~%" (-> this cur-trans-hook)) + (format #t "~2Tcur-event-hook: ~A~%" (-> this cur-event-hook)) + (format #t "~2Tnew-joint-anim: ~A~%" (-> this new-joint-anim)) + (format #t "~2Tnew-joint-anim-blend: ~D~%" (-> this new-joint-anim-blend)) + (format #t "~2Tanim-mode: ~A~%" (-> this anim-mode)) + (format #t "~2Tcur-grab-handle: ~D~%" (-> this cur-grab-handle)) + (format #t "~2Tcur-target-handle: ~D~%" (-> this cur-target-handle)) + (format #t "~2Told-grab-pos: ~`vector`P~%" (-> this old-grab-pos)) + (format #t "~2Tjoint[4] @ #x~X~%" (-> this joint)) + (format #t "~2Tnew-post-hook: ~A~%" (-> this new-post-hook)) + (format #t "~2Tcur-post-hook: ~A~%" (-> this cur-post-hook)) + (format #t "~2Tclone-copy-trans: ~A~%" (-> this clone-copy-trans)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Tdraw?: ~A~%" (-> this draw?)) + (format #t "~2Tuserdata: ~A~%" (-> this userdata)) + (format #t "~2Tprefix: ~A~%" (-> this prefix)) + (format #t "~2Tshadow-volume-joint: ~D~%" (-> this shadow-volume-joint)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Tuser-uint64[4] @ #x~X~%" (-> this user-uint64)) + (format #t "~2Toptions: ~D~%" (-> this options)) (label cfg-4) - obj + this ) ;; definition of type part-spawner @@ -90,23 +90,23 @@ ) ;; definition for method 3 of type part-spawner -(defmethod inspect part-spawner ((obj part-spawner)) - (when (not obj) - (set! obj obj) +(defmethod inspect part-spawner ((this part-spawner)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Troot: ~A~%" (-> obj root)) - (format #t "~2Tpart: ~A~%" (-> obj part)) - (format #t "~2Tsound: ~A~%" (-> obj sound)) - (format #t "~2Tmode: #x~X~%" (-> obj mode)) - (format #t "~2Tenable: ~A~%" (-> obj enable)) - (format #t "~2Tradius: (meters ~m)~%" (-> obj radius)) - (format #t "~2Tworld-sphere: #~%" (-> obj world-sphere)) + (format #t "~2Troot: ~A~%" (-> this root)) + (format #t "~2Tpart: ~A~%" (-> this part)) + (format #t "~2Tsound: ~A~%" (-> this sound)) + (format #t "~2Tmode: #x~X~%" (-> this mode)) + (format #t "~2Tenable: ~A~%" (-> this enable)) + (format #t "~2Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~2Tworld-sphere: #~%" (-> this world-sphere)) (label cfg-4) - obj + this ) ;; definition of type part-tracker @@ -138,31 +138,31 @@ ) ;; definition for method 3 of type part-tracker -(defmethod inspect part-tracker ((obj part-tracker)) - (when (not obj) - (set! obj obj) +(defmethod inspect part-tracker ((this part-tracker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Troot: ~A~%" (-> obj root)) - (format #t "~2Tmat: #~%" (-> obj mat)) - (format #t "~2Tpart: ~A~%" (-> obj part)) - (format #t "~2Tcallback: ~A~%" (-> obj callback)) - (format #t "~2Tlinger-callback: ~A~%" (-> obj linger-callback)) - (format #t "~2Tduration: ~D~%" (-> obj duration)) - (format #t "~2Tlinger-duration: ~D~%" (-> obj linger-duration)) - (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~2Ttarget: ~D~%" (-> obj target)) - (format #t "~2Ttarget-joint: ~D~%" (-> obj target-joint)) - (format #t "~2Toffset: ~`vector`P~%" (-> obj offset)) - (format #t "~2Tuserdata: ~A~%" (-> obj userdata)) - (format #t "~2Tuser-time[2] @ #x~X~%" (-> obj user-time)) - (format #t "~2Tuser-vector: ~`vector`P~%" (-> obj user-vector)) - (format #t "~2Tuser-handle[2] @ #x~X~%" (-> obj user-handle)) + (format #t "~2Troot: ~A~%" (-> this root)) + (format #t "~2Tmat: #~%" (-> this mat)) + (format #t "~2Tpart: ~A~%" (-> this part)) + (format #t "~2Tcallback: ~A~%" (-> this callback)) + (format #t "~2Tlinger-callback: ~A~%" (-> this linger-callback)) + (format #t "~2Tduration: ~D~%" (-> this duration)) + (format #t "~2Tlinger-duration: ~D~%" (-> this linger-duration)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Ttarget: ~D~%" (-> this target)) + (format #t "~2Ttarget-joint: ~D~%" (-> this target-joint)) + (format #t "~2Toffset: ~`vector`P~%" (-> this offset)) + (format #t "~2Tuserdata: ~A~%" (-> this userdata)) + (format #t "~2Tuser-time[2] @ #x~X~%" (-> this user-time)) + (format #t "~2Tuser-vector: ~`vector`P~%" (-> this user-vector)) + (format #t "~2Tuser-handle[2] @ #x~X~%" (-> this user-handle)) (label cfg-4) - obj + this ) ;; definition of type lightning-tracker @@ -197,32 +197,32 @@ ) ;; definition for method 3 of type lightning-tracker -(defmethod inspect lightning-tracker ((obj lightning-tracker)) - (when (not obj) - (set! obj obj) +(defmethod inspect lightning-tracker ((this lightning-tracker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Troot: ~A~%" (-> obj root)) - (format #t "~2Tlightning: ~A~%" (-> obj lightning)) - (format #t "~2Tcallback: ~A~%" (-> obj callback)) - (format #t "~2Tduration: ~D~%" (-> obj duration)) - (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~2Toffset0: ~`vector`P~%" (-> obj offset0)) - (format #t "~2Toffset1: ~`vector`P~%" (-> obj offset1)) - (format #t "~2Ttarget0: ~D~%" (-> obj target0)) - (format #t "~2Ttarget1: ~D~%" (-> obj target1)) - (format #t "~2Ttarget-joint0: ~D~%" (-> obj target-joint0)) - (format #t "~2Ttarget-joint1: ~D~%" (-> obj target-joint1)) - (format #t "~2Tsound: ~D~%" (-> obj sound)) - (format #t "~2Tuserdata: ~A~%" (-> obj userdata)) - (format #t "~2Tuser-time[2] @ #x~X~%" (-> obj user-time)) - (format #t "~2Tuser-vector: ~`vector`P~%" (-> obj user-vector)) - (format #t "~2Tuser-handle[2] @ #x~X~%" (-> obj user-handle)) + (format #t "~2Troot: ~A~%" (-> this root)) + (format #t "~2Tlightning: ~A~%" (-> this lightning)) + (format #t "~2Tcallback: ~A~%" (-> this callback)) + (format #t "~2Tduration: ~D~%" (-> this duration)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Toffset0: ~`vector`P~%" (-> this offset0)) + (format #t "~2Toffset1: ~`vector`P~%" (-> this offset1)) + (format #t "~2Ttarget0: ~D~%" (-> this target0)) + (format #t "~2Ttarget1: ~D~%" (-> this target1)) + (format #t "~2Ttarget-joint0: ~D~%" (-> this target-joint0)) + (format #t "~2Ttarget-joint1: ~D~%" (-> this target-joint1)) + (format #t "~2Tsound: ~D~%" (-> this sound)) + (format #t "~2Tuserdata: ~A~%" (-> this userdata)) + (format #t "~2Tuser-time[2] @ #x~X~%" (-> this user-time)) + (format #t "~2Tuser-vector: ~`vector`P~%" (-> this user-vector)) + (format #t "~2Tuser-handle[2] @ #x~X~%" (-> this user-handle)) (label cfg-4) - obj + this ) ;; definition of type touch-tracker @@ -245,22 +245,22 @@ ) ;; definition for method 3 of type touch-tracker -(defmethod inspect touch-tracker ((obj touch-tracker)) - (when (not obj) - (set! obj obj) +(defmethod inspect touch-tracker ((this touch-tracker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tduration: ~D~%" (-> obj duration)) - (format #t "~2Ttarget: ~D~%" (-> obj target)) - (format #t "~2Tevent: ~A~%" (-> obj event)) - (format #t "~2Trun-function: ~A~%" (-> obj run-function)) - (format #t "~2Tcallback: ~A~%" (-> obj callback)) - (format #t "~2Tevent-mode: ~A~%" (-> obj event-mode)) + (format #t "~2Tduration: ~D~%" (-> this duration)) + (format #t "~2Ttarget: ~D~%" (-> this target)) + (format #t "~2Tevent: ~A~%" (-> this event)) + (format #t "~2Trun-function: ~A~%" (-> this run-function)) + (format #t "~2Tcallback: ~A~%" (-> this callback)) + (format #t "~2Tevent-mode: ~A~%" (-> this event-mode)) (label cfg-4) - obj + this ) ;; definition of type swingpole @@ -285,22 +285,22 @@ ) ;; definition for method 3 of type swingpole -(defmethod inspect swingpole ((obj swingpole)) - (when (not obj) - (set! obj obj) +(defmethod inspect swingpole ((this swingpole)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tedge-length: (meters ~m)~%" (-> obj edge-length)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tjoint-track: ~D~%" (-> obj joint-track)) - (format #t "~2Tspeed: (meters ~m)~%" (-> obj speed)) - (format #t "~2Tdir: ~`vector`P~%" (-> obj dir)) - (format #t "~2Tsync: #~%" (-> obj sync)) + (format #t "~2Tedge-length: (meters ~m)~%" (-> this edge-length)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tjoint-track: ~D~%" (-> this joint-track)) + (format #t "~2Tspeed: (meters ~m)~%" (-> this speed)) + (format #t "~2Tdir: ~`vector`P~%" (-> this dir)) + (format #t "~2Tsync: #~%" (-> this sync)) (label cfg-4) - obj + this ) ;; definition of type gui-query @@ -323,21 +323,21 @@ ) ;; definition for method 3 of type gui-query -(defmethod inspect gui-query ((obj gui-query)) - (when (not obj) - (set! obj obj) +(defmethod inspect gui-query ((this gui-query)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gui-query) - (format #t "~1Tx-position: ~D~%" (-> obj x-position)) - (format #t "~1Ty-position: ~D~%" (-> obj y-position)) - (format #t "~1Tmessage: ~A~%" (-> obj message)) - (format #t "~1Tdecision: ~A~%" (-> obj decision)) - (format #t "~1Tonly-allow-cancel: ~A~%" (-> obj only-allow-cancel)) - (format #t "~1Tno-msg: ~A~%" (-> obj no-msg)) - (format #t "~1Tmessage-space: ~D~%" (-> obj message-space)) + (format #t "[~8x] ~A~%" this 'gui-query) + (format #t "~1Tx-position: ~D~%" (-> this x-position)) + (format #t "~1Ty-position: ~D~%" (-> this y-position)) + (format #t "~1Tmessage: ~A~%" (-> this message)) + (format #t "~1Tdecision: ~A~%" (-> this decision)) + (format #t "~1Tonly-allow-cancel: ~A~%" (-> this only-allow-cancel)) + (format #t "~1Tno-msg: ~A~%" (-> this no-msg)) + (format #t "~1Tmessage-space: ~D~%" (-> this message-space)) (label cfg-4) - obj + this ) ;; definition of type othercam @@ -365,28 +365,28 @@ ) ;; definition for method 3 of type othercam -(defmethod inspect othercam ((obj othercam)) - (when (not obj) - (set! obj obj) +(defmethod inspect othercam ((this othercam)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thand: ~D~%" (-> obj hand)) - (format #t "~2Told-global-mask: ~D~%" (-> obj old-global-mask)) - (format #t "~2Tmask-to-clear: ~D~%" (-> obj mask-to-clear)) - (format #t "~2Tcam-joint-index: ~D~%" (-> obj cam-joint-index)) - (format #t "~2Told-pos: #~%" (-> obj old-pos)) - (format #t "~2Told-mat-z: #~%" (-> obj old-mat-z)) - (format #t "~2Thad-valid-frame: ~A~%" (-> obj had-valid-frame)) - (format #t "~2Tborder-value: ~A~%" (-> obj border-value)) - (format #t "~2Tdie?: ~A~%" (-> obj die?)) - (format #t "~2Tsurvive-anim-end?: ~A~%" (-> obj survive-anim-end?)) - (format #t "~2Tspooling?: ~A~%" (-> obj spooling?)) - (format #t "~2Tfov: ~f~%" (-> obj fov)) + (format #t "~2Thand: ~D~%" (-> this hand)) + (format #t "~2Told-global-mask: ~D~%" (-> this old-global-mask)) + (format #t "~2Tmask-to-clear: ~D~%" (-> this mask-to-clear)) + (format #t "~2Tcam-joint-index: ~D~%" (-> this cam-joint-index)) + (format #t "~2Told-pos: #~%" (-> this old-pos)) + (format #t "~2Told-mat-z: #~%" (-> this old-mat-z)) + (format #t "~2Thad-valid-frame: ~A~%" (-> this had-valid-frame)) + (format #t "~2Tborder-value: ~A~%" (-> this border-value)) + (format #t "~2Tdie?: ~A~%" (-> this die?)) + (format #t "~2Tsurvive-anim-end?: ~A~%" (-> this survive-anim-end?)) + (format #t "~2Tspooling?: ~A~%" (-> this spooling?)) + (format #t "~2Tfov: ~f~%" (-> this fov)) (label cfg-4) - obj + this ) ;; definition of type explosion @@ -409,20 +409,20 @@ ) ;; definition for method 3 of type explosion -(defmethod inspect explosion ((obj explosion)) - (when (not obj) - (set! obj obj) +(defmethod inspect explosion ((this explosion)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~2Tduration: ~D~%" (-> obj duration)) - (format #t "~2Tlinger-duration: ~D~%" (-> obj linger-duration)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Tduration: ~D~%" (-> this duration)) + (format #t "~2Tlinger-duration: ~D~%" (-> this linger-duration)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) (label cfg-4) - obj + this ) ;; definition of type explosion-init-params @@ -440,20 +440,20 @@ ) ;; definition for method 3 of type explosion-init-params -(defmethod inspect explosion-init-params ((obj explosion-init-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect explosion-init-params ((this explosion-init-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'explosion-init-params) - (format #t "~1Tspawn-point: #~%" (-> obj spawn-point)) - (format #t "~1Tspawn-quat: #~%" (-> obj spawn-quat)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) - (format #t "~1Tgroup: ~A~%" (-> obj group)) - (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~1Tpenetrate-using: ~D~%" (-> obj penetrate-using)) + (format #t "[~8x] ~A~%" this 'explosion-init-params) + (format #t "~1Tspawn-point: #~%" (-> this spawn-point)) + (format #t "~1Tspawn-quat: #~%" (-> this spawn-quat)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tgroup: ~A~%" (-> this group)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~1Tpenetrate-using: ~D~%" (-> this penetrate-using)) (label cfg-4) - obj + this ) ;; definition of type process-hidden @@ -468,15 +468,15 @@ ) ;; definition for method 3 of type process-hidden -(defmethod inspect process-hidden ((obj process-hidden)) - (when (not obj) - (set! obj obj) +(defmethod inspect process-hidden ((this process-hidden)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) (format #t "process-tree ") ) @@ -575,34 +575,34 @@ ) ) (format #t ")~%") - (format #t "~1Tclock: ~A~%" (-> obj clock)) - (format #t "~1Tparent: #x~X~%" (-> obj parent)) - (format #t "~1Tbrother: #x~X~%" (-> obj brother)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) - (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tstatus: ~A~%" (-> obj status)) - (format #t "~1Tpid: ~D~%" (-> obj pid)) - (format #t "~1Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~1Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tstate: ~A~%" (-> obj state)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~1Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~1Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~1Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~1Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~1Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~1Theap: #~%" (&-> obj heap-base)) - (format #t "~1Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) (label cfg-68) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc index f6710a9107..f9b2607f28 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/generic-obs_REF.gc @@ -134,41 +134,41 @@ ;; definition for method 22 of type swingpole ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-along-path swingpole ((obj swingpole)) +(defmethod move-along-path swingpole ((this swingpole)) (with-pp - (if (nonzero? (-> obj draw)) + (if (nonzero? (-> this draw)) (ja-post) ) (cond - ((nonzero? (-> obj path)) - (set! (-> obj path-pos) (get-norm! (-> obj sync) 0)) + ((nonzero? (-> this path)) + (set! (-> this path-pos) (get-norm! (-> this sync) 0)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (get-point-at-percent-along-path! (-> obj path) s5-0 (-> obj path-pos) 'interp) - (set! (-> obj speed) (* (vector-vector-distance s5-0 (-> obj root trans)) (-> pp clock frames-per-second))) - (move-to-point! (-> obj root) s5-0) + (get-point-at-percent-along-path! (-> this path) s5-0 (-> this path-pos) 'interp) + (set! (-> this speed) (* (vector-vector-distance s5-0 (-> this root trans)) (-> pp clock frames-per-second))) + (move-to-point! (-> this root) s5-0) ) ) - ((>= (-> obj joint-track) 0) - (let ((v1-15 (ppointer->process (-> obj parent))) + ((>= (-> this joint-track) 0) + (let ((v1-15 (ppointer->process (-> this parent))) (s5-1 (new 'stack-no-clear 'vector)) ) - (let ((s4-0 (-> (the-as process-drawable v1-15) node-list data (-> obj joint-track)))) + (let ((s4-0 (-> (the-as process-drawable v1-15) node-list data (-> this joint-track)))) (vector<-cspace! s5-1 s4-0) - (vector-normalize-copy! (-> obj dir) (the-as vector (-> s4-0 bone transform)) 1.0) + (vector-normalize-copy! (-> this dir) (the-as vector (-> s4-0 bone transform)) 1.0) ) - (move-to-point! (-> obj root) s5-1) + (move-to-point! (-> this root) s5-1) ) ) ) - (when (nonzero? (-> obj sound)) - (set! (-> obj sound trans quad) (-> obj root trans quad)) - (let ((f30-0 (lerp-scale -0.1 -0.05 (-> obj speed) 8192.0 20480.0)) - (f0-6 (lerp-scale 0.7 1.0 (-> obj speed) 8192.0 20480.0)) + (when (nonzero? (-> this sound)) + (set! (-> this sound trans quad) (-> this root trans quad)) + (let ((f30-0 (lerp-scale -0.1 -0.05 (-> this speed) 8192.0 20480.0)) + (f0-6 (lerp-scale 0.7 1.0 (-> this speed) 8192.0 20480.0)) ) - (set! (-> obj sound pitch) (the int (* 1524.0 f30-0))) - (set! (-> obj sound volume) (the int (* 1024.0 f0-6))) + (set! (-> this sound pitch) (the int (* 1524.0 f30-0))) + (set! (-> this sound volume) (the int (* 1024.0 f0-6))) ) - (update! (-> obj sound)) + (update! (-> this sound)) ) 0 (none) @@ -228,7 +228,7 @@ (suspend) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (move-along-path self) (suspend) ) @@ -240,7 +240,7 @@ ;; definition for method 11 of type swingpole ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! swingpole ((obj swingpole) (arg0 entity-actor)) +(defmethod init-from-entity! swingpole ((this swingpole) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -248,8 +248,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" "Copy defaults from the entity." - (stack-size-set! (-> obj main-thread) 128) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-5 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-5 prim-core collide-as) (collide-spec collectable)) (set! (-> v1-5 prim-core collide-with) (collide-spec jak player-list tobot)) @@ -262,21 +262,21 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-8 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-8 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 quat)) - (vector-identity! (-> obj root scale)) - (vector-y-quaternion! (-> obj dir) (-> obj root quat)) - (set! (-> obj joint-track) -1) - (let ((a1-8 (res-lump-struct (-> obj entity) 'art-name structure))) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (vector-y-quaternion! (-> this dir) (-> this root quat)) + (set! (-> this joint-track) -1) + (let ((a1-8 (res-lump-struct (-> this entity) 'art-name structure))) (if a1-8 - (initialize-skeleton-by-name obj (the-as string a1-8)) + (initialize-skeleton-by-name this (the-as string a1-8)) ) ) - (set! (-> obj dir y) 0.0) - (vector-normalize! (-> obj dir) 1.0) - (set! (-> obj edge-length) 8192.0) + (set! (-> this dir y) 0.0) + (vector-normalize! (-> this dir) 1.0) + (set! (-> this edge-length) 8192.0) (let ((s4-1 (new 'stack-no-clear 'sync-info-params))) (let ((a0-19 (res-lump-value arg0 'options uint128 :time -1000000000.0)) (v1-22 0) @@ -294,14 +294,14 @@ This commonly includes things such as: (set! (-> s4-1 ease-out) 0.2) (set! (-> s4-1 pause-in) 0.0) (set! (-> s4-1 pause-out) 0.0) - (initialize! (-> obj sync) s4-1) + (initialize! (-> this sync) s4-1) ) - (when (nonzero? (-> obj sync period)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (when (nonzero? (-> this sync period)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) ) - (set! (-> obj sound) (new 'process 'ambient-sound (-> obj entity) (-> obj root trans))) - (go (method-of-object obj idle)) + (set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans))) + (go (method-of-object this idle)) (none) ) @@ -341,7 +341,7 @@ This commonly includes things such as: ;; definition for method 11 of type process-hidden ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! process-hidden ((obj process-hidden) (arg0 entity-actor)) +(defmethod init-from-entity! process-hidden ((this process-hidden) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -349,8 +349,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" "Copy defaults from the entity." - (process-entity-status! obj (entity-perm-status dead) #t) - (go (method-of-object obj die)) + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die)) (none) ) @@ -363,15 +363,15 @@ This commonly includes things such as: ) ;; definition for method 3 of type target-start -(defmethod inspect target-start ((obj target-start)) - (when (not obj) - (set! obj obj) +(defmethod inspect target-start ((this target-start)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) (format #t "process-tree ") ) @@ -470,34 +470,34 @@ This commonly includes things such as: ) ) (format #t ")~%") - (format #t "~1Tclock: ~A~%" (-> obj clock)) - (format #t "~1Tparent: #x~X~%" (-> obj parent)) - (format #t "~1Tbrother: #x~X~%" (-> obj brother)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) - (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tstatus: ~A~%" (-> obj status)) - (format #t "~1Tpid: ~D~%" (-> obj pid)) - (format #t "~1Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~1Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tstate: ~A~%" (-> obj state)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~1Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~1Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~1Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~1Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~1Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~1Theap: #~%" (&-> obj heap-base)) - (format #t "~1Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) (label cfg-68) - obj + this ) ;; definition of type camera-start @@ -509,15 +509,15 @@ This commonly includes things such as: ) ;; definition for method 3 of type camera-start -(defmethod inspect camera-start ((obj camera-start)) - (when (not obj) - (set! obj obj) +(defmethod inspect camera-start ((this camera-start)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) (format #t "process-tree ") ) @@ -616,34 +616,34 @@ This commonly includes things such as: ) ) (format #t ")~%") - (format #t "~1Tclock: ~A~%" (-> obj clock)) - (format #t "~1Tparent: #x~X~%" (-> obj parent)) - (format #t "~1Tbrother: #x~X~%" (-> obj brother)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) - (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tstatus: ~A~%" (-> obj status)) - (format #t "~1Tpid: ~D~%" (-> obj pid)) - (format #t "~1Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~1Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tstate: ~A~%" (-> obj state)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~1Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~1Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~1Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~1Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~1Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~1Theap: #~%" (&-> obj heap-base)) - (format #t "~1Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) (label cfg-68) - obj + this ) ;; definition for function manipy-post @@ -1311,17 +1311,17 @@ This commonly includes things such as: ) ;; definition for method 10 of type part-tracker -(defmethod deactivate part-tracker ((obj part-tracker)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate part-tracker ((this part-tracker)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; definition for method 15 of type part-tracker ;; WARN: Return type mismatch object vs none. -(defmethod notify-parent-of-death part-tracker ((obj part-tracker)) +(defmethod notify-parent-of-death part-tracker ((this part-tracker)) (with-pp (let ((gp-0 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-0 from) (process->ppointer pp)) @@ -1329,7 +1329,7 @@ This commonly includes things such as: (set! (-> gp-0 message) 'notify) (set! (-> gp-0 param 0) (the-as uint 'die)) (let ((s5-0 send-event-function) - (s4-0 (ppointer->process (-> obj parent))) + (s4-0 (ppointer->process (-> this parent))) ) (s5-0 (if (type? s4-0 process) @@ -1354,9 +1354,9 @@ This commonly includes things such as: ) ) :code (behavior () - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (while (or (zero? (-> self duration)) - (< (- (current-time) (-> self start-time)) (the-as time-frame (-> self duration))) + (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self duration)))) ) (if (-> self callback) ((-> self callback) self) @@ -1386,7 +1386,7 @@ This commonly includes things such as: (suspend) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (the-as time-frame (-> self linger-duration))) + (until (time-elapsed? gp-1 (the-as time-frame (-> self linger-duration))) (if (-> self linger-callback) ((-> self linger-callback) self) ) @@ -1546,7 +1546,7 @@ This commonly includes things such as: ;; definition for method 15 of type lightning-tracker ;; WARN: Return type mismatch object vs none. -(defmethod notify-parent-of-death lightning-tracker ((obj lightning-tracker)) +(defmethod notify-parent-of-death lightning-tracker ((this lightning-tracker)) (with-pp (let ((gp-0 (new 'stack-no-clear 'event-message-block))) (set! (-> gp-0 from) (process->ppointer pp)) @@ -1554,7 +1554,7 @@ This commonly includes things such as: (set! (-> gp-0 message) 'notify) (set! (-> gp-0 param 0) (the-as uint 'die)) (let ((s5-0 send-event-function) - (s4-0 (ppointer->process (-> obj parent))) + (s4-0 (ppointer->process (-> this parent))) ) (s5-0 (if (type? s4-0 process) @@ -1571,13 +1571,13 @@ This commonly includes things such as: ;; definition for method 16 of type lightning-tracker ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update lightning-tracker ((obj lightning-tracker)) - (if (-> obj callback) - ((-> obj callback) obj) +(defmethod update lightning-tracker ((this lightning-tracker)) + (if (-> this callback) + ((-> this callback) this) ) (let ((a0-6 (cond - ((>= (-> obj target-joint0) 0) - (let ((s5-0 (handle->process (-> obj target0)))) + ((>= (-> this target-joint0) 0) + (let ((s5-0 (handle->process (-> this target0)))) (if (type? s5-0 process-drawable) s5-0 ) @@ -1590,30 +1590,30 @@ This commonly includes things such as: ) ) (cond - ((< (-> obj target-joint0) 0) - (when (and (!= (-> obj lightning spec rand-func) 3) (!= (-> obj lightning spec rand-func) 2)) - (let ((v1-17 (-> obj lightning)) - (a0-9 (-> obj offset0)) + ((< (-> this target-joint0) 0) + (when (and (!= (-> this lightning spec rand-func) 3) (!= (-> this lightning spec rand-func) 2)) + (let ((v1-17 (-> this lightning)) + (a0-9 (-> this offset0)) ) (set! (-> v1-17 state meet data 0 quad) (-> a0-9 quad)) ) ) ) ((or (not a0-6) (zero? (-> (the-as process-focusable a0-6) root))) - (deactivate obj) + (deactivate this) ) - ((= (-> obj target-joint0) 256) - (let ((s5-1 (-> obj lightning)) + ((= (-> this target-joint0) 256) + (let ((s5-1 (-> this lightning)) (a0-12 (get-trans (the-as process-focusable a0-6) 3)) ) (set! (-> s5-1 state meet data 0 quad) (-> a0-12 quad)) ) ) (else - (let ((s5-2 (-> obj lightning)) + (let ((s5-2 (-> this lightning)) (a0-16 (vector<-cspace! (new 'stack-no-clear 'vector) - (-> (the-as process-focusable a0-6) node-list data (-> obj target-joint0)) + (-> (the-as process-focusable a0-6) node-list data (-> this target-joint0)) ) ) ) @@ -1623,8 +1623,8 @@ This commonly includes things such as: ) ) (let ((a0-22 (cond - ((>= (-> obj target-joint1) 0) - (let ((s5-3 (handle->process (-> obj target1)))) + ((>= (-> this target-joint1) 0) + (let ((s5-3 (handle->process (-> this target1)))) (if (type? s5-3 process-drawable) s5-3 ) @@ -1637,30 +1637,30 @@ This commonly includes things such as: ) ) (cond - ((< (-> obj target-joint1) 0) - (when (and (!= (-> obj lightning spec rand-func) 3) (!= (-> obj lightning spec rand-func) 2)) - (let ((a0-26 (-> obj lightning)) - (v1-44 (-> obj offset1)) + ((< (-> this target-joint1) 0) + (when (and (!= (-> this lightning spec rand-func) 3) (!= (-> this lightning spec rand-func) 2)) + (let ((a0-26 (-> this lightning)) + (v1-44 (-> this offset1)) ) (set! (-> a0-26 state meet data (+ (-> a0-26 state points-to-draw) -1) quad) (-> v1-44 quad)) ) ) ) ((or (not a0-22) (zero? (-> (the-as process-focusable a0-22) root))) - (deactivate obj) + (deactivate this) ) - ((= (-> obj target-joint1) 256) - (let ((gp-1 (-> obj lightning)) + ((= (-> this target-joint1) 256) + (let ((gp-1 (-> this lightning)) (v1-51 (get-trans (the-as process-focusable a0-22) 3)) ) (set! (-> gp-1 state meet data (+ (-> gp-1 state points-to-draw) -1) quad) (-> v1-51 quad)) ) ) (else - (let ((s5-4 (-> obj lightning)) + (let ((s5-4 (-> this lightning)) (v1-54 (vector<-cspace! (new 'stack-no-clear 'vector) - (-> (the-as process-drawable a0-22) node-list data (-> obj target-joint1)) + (-> (the-as process-drawable a0-22) node-list data (-> this target-joint1)) ) ) ) @@ -1707,7 +1707,7 @@ This commonly includes things such as: ) ) ) - (while (< (- (current-time) gp-0) s5-0) + (while (not (time-elapsed? gp-0 s5-0)) (suspend) ) ) @@ -1756,9 +1756,9 @@ This commonly includes things such as: ) (set! (-> v1-33 state mode) (the-as lightning-mode a0-10)) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (while (or (zero? (-> self duration)) - (< (- (current-time) (-> self start-time)) (the-as time-frame (-> self duration))) + (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self duration)))) ) (update self) (suspend) @@ -1783,8 +1783,8 @@ This commonly includes things such as: ) (set! (-> v1-47 state mode) (the-as lightning-mode a0-14)) ) - (set! (-> self start-time) (current-time)) - (while (< (- (current-time) (-> self start-time)) (the int f30-0)) + (set-time! (-> self start-time)) + (while (not (time-elapsed? (-> self start-time) (the int f30-0))) (suspend) ) ) @@ -2009,19 +2009,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type med-res-level -(defmethod inspect med-res-level ((obj med-res-level)) - (when (not obj) - (set! obj obj) +(defmethod inspect med-res-level ((this med-res-level)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlevel-name: ~A~%" (-> obj level-name)) - (format #t "~2Tpart-mode: ~A~%" (-> obj part-mode)) - (format #t "~2Tindex: ~D~%" (-> obj index)) + (format #t "~2Tlevel-name: ~A~%" (-> this level-name)) + (format #t "~2Tpart-mode: ~A~%" (-> this part-mode)) + (format #t "~2Tindex: ~D~%" (-> this index)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2057,28 +2057,28 @@ This commonly includes things such as: ;; definition for method 11 of type med-res-level ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! med-res-level ((obj med-res-level) (arg0 entity-actor)) +(defmethod init-from-entity! med-res-level ((this med-res-level) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 128) + (stack-size-set! (-> this main-thread) 128) (let ((s4-0 (res-lump-struct arg0 'art-name structure)) - (s3-0 (res-lump-struct (-> obj entity) 'level structure)) - (v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0)) + (s3-0 (res-lump-struct (-> this entity) 'level structure)) + (v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0)) ) (when s3-0 - (set! (-> obj level-name) (the-as basic s3-0)) - (set! (-> obj index) (the-as int v1-5)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (initialize-skeleton-by-name obj (the-as string s4-0)) - (logior! (-> obj draw status) (draw-control-status no-closest-distance)) - (if (nonzero? (-> obj draw)) - (go (method-of-object obj idle)) + (set! (-> this level-name) (the-as basic s3-0)) + (set! (-> this index) (the-as int v1-5)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (initialize-skeleton-by-name this (the-as string s4-0)) + (logior! (-> this draw status) (draw-control-status no-closest-distance)) + (if (nonzero? (-> this draw)) + (go (method-of-object this idle)) ) ) ) @@ -2086,21 +2086,21 @@ This commonly includes things such as: ) ;; definition for method 10 of type part-spawner -(defmethod deactivate part-spawner ((obj part-spawner)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate part-spawner ((this part-spawner)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; definition for method 15 of type part-spawner -(defmethod is-in-view? part-spawner ((obj part-spawner)) - (sphere<-vector+r! (-> obj world-sphere) (-> obj root trans) (-> obj radius)) - (sphere-in-view-frustum? (-> obj world-sphere)) +(defmethod is-in-view? part-spawner ((this part-spawner)) + (sphere<-vector+r! (-> this world-sphere) (-> this root trans) (-> this radius)) + (sphere-in-view-frustum? (-> this world-sphere)) ) ;; failed to figure out what this is: @@ -2143,7 +2143,7 @@ This commonly includes things such as: ;; definition for method 11 of type part-spawner ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! part-spawner ((obj part-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! part-spawner ((this part-spawner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2151,22 +2151,23 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 string)) - (stack-size-set! (-> obj main-thread) 128) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj clock) (-> *display* part-clock)) - (set! (-> obj root) (new 'process 'trsqv)) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 quat)) - (vector-identity! (-> obj root scale)) - (set! (-> obj radius) 12288.0) - (set! (-> obj enable) - (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)))) + (stack-size-set! (-> this main-thread) 128) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this clock) (-> *display* part-clock)) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (set! (-> this radius) 12288.0) + (set! (-> this enable) + (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) ) - (set! (-> obj sound) (new 'process 'ambient-sound (-> obj entity) (-> obj root trans))) + (set! (-> this sound) (new 'process 'ambient-sound (-> this entity) (-> this root trans))) (set! sv-16 "#f") - (set! (-> obj mode) (entity-lookup-part-group arg0 (& sv-16) 'art-name)) - (when (-> obj mode) - (let ((a0-15 (-> obj mode 0))) + (set! (-> this mode) (entity-lookup-part-group arg0 (& sv-16) 'art-name)) + (when (-> this mode) + (let ((a0-15 (-> this mode 0))) (when (and (nonzero? a0-15) (= (-> a0-15 type) sparticle-launch-group)) (cond ((logtest? (-> a0-15 flags) (sp-group-flag unk-8)) @@ -2175,12 +2176,12 @@ This commonly includes things such as: (a3-2 (-> *part-id-table* (-> a1-8 launcher))) ) (when (nonzero? a3-2) - (let ((a2-7 (-> obj level part-engine))) + (let ((a2-7 (-> this level part-engine))) (when (and a2-7 (< (-> a2-7 length) (-> a2-7 allocated-length))) (let ((t0-7 (-> a2-7 data (-> a2-7 length)))) (set! (-> t0-7 next1) (the-as connectable a3-2)) (set! (-> t0-7 prev1) (the-as connectable (-> a1-8 hour-mask))) - (set! (-> (the-as vector (&-> t0-7 param0)) quad) (-> obj root trans quad)) + (set! (-> (the-as vector (&-> t0-7 param0)) quad) (-> this root trans quad)) (set! (-> t0-7 param3) (the-as int (-> a1-8 fade-after))) ) (+! (-> a2-7 length) 1) @@ -2189,12 +2190,12 @@ This commonly includes things such as: ) ) ) - (process-entity-status! obj (entity-perm-status dead) #t) - (deactivate obj) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) ) (else - (set! (-> obj part) (create-launch-control a0-15 obj)) - (go (method-of-object obj active)) + (set! (-> this part) (create-launch-control a0-15 this)) + (go (method-of-object this active)) ) ) ) @@ -2226,22 +2227,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type launcher -(defmethod inspect launcher ((obj launcher)) - (when (not obj) - (set! obj obj) +(defmethod inspect launcher ((this launcher)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspring-height: (meters ~m)~%" (-> obj spring-height)) - (format #t "~2Tcamera: ~A~%" (-> obj camera)) - (format #t "~2Tactive-distance: ~f~%" (-> obj active-distance)) - (format #t "~2Tseek-time: ~D~%" (-> obj seek-time)) - (format #t "~2Tdest: ~`vector`P~%" (-> obj dest)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tspring-height: (meters ~m)~%" (-> this spring-height)) + (format #t "~2Tcamera: ~A~%" (-> this camera)) + (format #t "~2Tactive-distance: ~f~%" (-> this active-distance)) + (format #t "~2Tseek-time: ~D~%" (-> this seek-time)) + (format #t "~2Tdest: ~`vector`P~%" (-> this dest)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2559,7 +2560,7 @@ This commonly includes things such as: (when (not (paused?)) (vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) 28672.0) (send-event *camera* 'teleport) - (if (and (-> *camera* on-ground) (>= (- (current-time) gp-0) (seconds 1))) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) (send-event *camera* 'change-state cam-string (seconds 0.5)) ) ) @@ -2661,7 +2662,7 @@ This commonly includes things such as: (set! (-> self trans x) (-> *camera* tpos-curr x)) (set! (-> self trans z) (-> *camera* tpos-curr z)) (vector+! (-> self trans) (-> self trans) (-> self view-flat)) - (if (and (-> *camera* on-ground) (>= (- (current-time) gp-0) (seconds 1))) + (if (and (-> *camera* on-ground) (time-elapsed? gp-0 (seconds 1))) (send-event *camera* 'change-state cam-string (seconds 0.5)) ) ) @@ -2731,7 +2732,7 @@ This commonly includes things such as: :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (when (or (= message 'touch) (= message 'attack)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) (cond @@ -2773,7 +2774,7 @@ This commonly includes things such as: (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) - (< (- (current-time) (-> self state-time)) (seconds 0.5)) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) ) (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) @@ -2792,15 +2793,15 @@ This commonly includes things such as: ;; definition for method 11 of type launcher ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! launcher ((obj launcher) (arg0 entity-actor)) +(defmethod init-from-entity! launcher ((this launcher) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 128) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 128) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-4 prim-core collide-as) (collide-spec enemy)) (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list)) @@ -2813,53 +2814,53 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-6 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-6 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (update-transforms (-> obj root)) - (set! (-> obj active-distance) 409600.0) - (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) + (process-drawable-from-entity! this arg0) + (update-transforms (-> this root)) + (set! (-> this active-distance) 409600.0) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 163840.0)) (let ((s4-1 (res-lump-value arg0 'mode uint128 :time -1000000000.0))) - (let ((v1-14 (-> obj level name))) - (set! (-> obj part) (create-launch-control - (cond - ((= v1-14 'beach) - (-> *part-group-id-table* 6) - ) - ((= v1-14 'swamp) - (-> *part-group-id-table* 8) - ) - (else - (-> *part-group-id-table* 7) + (let ((v1-14 (-> this level name))) + (set! (-> this part) (create-launch-control + (cond + ((= v1-14 'beach) + (-> *part-group-id-table* 6) ) - ) - obj - ) + ((= v1-14 'swamp) + (-> *part-group-id-table* 8) + ) + (else + (-> *part-group-id-table* 7) + ) + ) + this + ) ) ) (let ((v1-20 (logand (the-as int s4-1) 255))) (cond ((= (the-as uint v1-20) 1) - (set! (-> obj camera) cam-launcher-longfall) + (set! (-> this camera) cam-launcher-longfall) ) ((= (the-as uint v1-20) 2) - (set! (-> obj camera) #f) + (set! (-> this camera) #f) ) (else - (set! (-> obj camera) cam-launcher-shortfall) + (set! (-> this camera) cam-launcher-shortfall) ) ) ) ) (let ((v1-25 (res-lump-struct arg0 'alt-vector vector))) (when v1-25 - (set-vector! (-> obj dest) (-> v1-25 x) (-> v1-25 y) (-> v1-25 z) 1.0) - (set! (-> obj seek-time) (the-as time-frame (the int (* 300.0 (-> v1-25 w))))) + (set-vector! (-> this dest) (-> v1-25 x) (-> v1-25 y) (-> v1-25 z) 1.0) + (set! (-> this seek-time) (the-as time-frame (the int (* 300.0 (-> v1-25 w))))) ) ) - (set! (-> obj sound-id) (new-sound-id)) - (nav-mesh-connect-from-ent obj) - (go (method-of-object obj idle)) + (set! (-> this sound-id) (new-sound-id)) + (nav-mesh-connect-from-ent this) + (go (method-of-object this idle)) (none) ) @@ -2995,7 +2996,7 @@ This commonly includes things such as: ) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while ((-> self run-function)) (let* ((gp-0 (handle->process (-> self target))) (a0-4 (if (type? gp-0 process-drawable) @@ -3081,7 +3082,7 @@ This commonly includes things such as: (set! (-> self event) #f) (set! (-> self callback) #f) (set! (-> self run-function) - (lambda :behavior touch-tracker () (< (- (current-time) (-> self state-time)) (-> self duration))) + (lambda :behavior touch-tracker () (not (time-elapsed? (-> self state-time) (-> self duration)))) ) (set! (-> self event-hook) (-> (method-of-object self active) event)) (go-virtual active) @@ -3090,8 +3091,8 @@ This commonly includes things such as: ;; definition for method 21 of type explosion ;; WARN: Return type mismatch int vs none. -(defmethod setup-explosion-collision explosion ((obj explosion)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod setup-explosion-collision explosion ((this explosion)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (set! (-> s5-0 penetrate-using) (penetrate explode)) (let ((v1-3 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> v1-3 prim-core action) (collide-action solid)) @@ -3104,16 +3105,16 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-6 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-6 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root event-self) 'touched) + (set! (-> this root event-self) 'touched) 0 (none) ) ;; definition for method 22 of type explosion ;; WARN: Return type mismatch int vs none. -(defmethod explosion-method-22 explosion ((obj explosion)) +(defmethod explosion-method-22 explosion ((this explosion)) 0 (none) ) @@ -3215,7 +3216,7 @@ This commonly includes things such as: ) ) :code (behavior () - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (update-transforms (-> self root)) (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-0 options) (overlaps-others-options)) @@ -3228,14 +3229,14 @@ This commonly includes things such as: (set! (-> v1-9 prim-core collide-with) (collide-spec)) ) 0 - (while (< (- (current-time) (-> self start-time)) (the-as time-frame (-> self duration))) + (while (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self duration)))) (let ((a1-1 (-> self root trans))) (spawn (-> self part) a1-1) ) (suspend) ) - (set! (-> self start-time) (current-time)) - (while (< (- (current-time) (-> self start-time)) (the-as time-frame (-> self linger-duration))) + (set-time! (-> self start-time)) + (while (not (time-elapsed? (-> self start-time) (the-as time-frame (-> self linger-duration)))) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc index cb516752c0..8e20ad1b63 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc @@ -19,19 +19,19 @@ ) ;; definition for method 3 of type plat -(defmethod inspect plat ((obj plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect plat ((this plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tsync: #~%" (-> obj sync)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tsync: #~%" (-> this sync)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -41,16 +41,16 @@ ) ;; definition for method 30 of type plat -(defmethod get-art-group plat ((obj plat)) +(defmethod get-art-group plat ((this plat)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-plat" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type plat ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! plat ((obj plat)) +(defmethod init-plat-collision! plat ((this plat)) "TODO - collision stuff for setting up the platform" - (let ((collision-shape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) (set! (-> collision-mesh prim-core collide-as) (collide-spec pusher)) (set! (-> collision-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -66,7 +66,7 @@ (set! (-> collision-shape backup-collide-as) (-> prim prim-core collide-as)) (set! (-> collision-shape backup-collide-with) (-> prim prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving collision-shape)) + (set! (-> this root) (the-as collide-shape-moving collision-shape)) ) 0 (none) @@ -74,7 +74,7 @@ ;; definition for method 33 of type plat ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! plat ((obj plat)) +(defmethod init-plat! plat ((this plat)) "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." 0 @@ -83,26 +83,26 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 32 of type plat ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 plat ((obj plat)) +(defmethod base-plat-method-32 plat ((this plat)) 0 (none) ) ;; definition for method 36 of type plat -(defmethod plat-path-sync plat ((obj plat)) +(defmethod plat-path-sync plat ((this plat)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @see [[sync-eased]]" (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) - (go (method-of-object obj plat-idle)) + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this plat-idle)) ) - ((> (-> obj sync period) 0) - (go (method-of-object obj plat-path-active)) + ((> (-> this sync period) 0) + (go (method-of-object this plat-path-active)) ) (else - (go (method-of-object obj plat-idle)) + (go (method-of-object this plat-idle)) ) ) ) @@ -166,26 +166,26 @@ otherwise, [[plat::34]] ;; definition for method 11 of type plat ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! plat ((obj plat) (entity entity-actor)) +(defmethod init-from-entity! plat ((this plat) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask platform)) - (init-plat-collision! obj) - (process-drawable-from-entity! obj entity) - (initialize-skeleton obj (the-as skeleton-group (get-art-group obj)) (the-as pair 0)) - (update-transforms (-> obj root)) - (stop-bouncing! obj) - (base-plat-method-32 obj) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logior! (-> this mask) (process-mask platform)) + (init-plat-collision! this) + (process-drawable-from-entity! this entity) + (initialize-skeleton this (the-as skeleton-group (get-art-group this)) (the-as pair 0)) + (update-transforms (-> this root)) + (stop-bouncing! this) + (base-plat-method-32 this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((params (new 'stack-no-clear 'sync-info-params))) (let ((v1-15 0)) - (if (not (logtest? (-> obj fact options) (actor-option loop))) + (if (not (logtest? (-> this fact options) (actor-option loop))) (set! v1-15 (logior v1-15 1)) ) (set! (-> params sync-type) 'sync-eased) @@ -198,28 +198,28 @@ This commonly includes things such as: (set! (-> params ease-out) 0.15) (set! (-> params pause-in) 0.0) (set! (-> params pause-out) 0.0) - (initialize! (-> obj sync) params) + (initialize! (-> this sync) params) ) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this sound-id) (new-sound-id)) (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) - (set! (-> obj path-pos) 0.0) - (init-plat! obj) - (plat-path-sync obj) + ((logtest? (-> this path flags) (path-control-flag not-found)) + (set! (-> this path-pos) 0.0) + (init-plat! this) + (plat-path-sync this) ) - ((> (-> obj sync period) 0) - (set! (-> obj path-pos) (get-norm! (-> obj sync) 0)) - (get-point-at-percent-along-path! (-> obj path) (-> obj root trans) (-> obj path-pos) 'interp) - (init-plat! obj) - (plat-path-sync obj) + ((> (-> this sync period) 0) + (set! (-> this path-pos) (get-norm! (-> this sync) 0)) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + (init-plat! this) + (plat-path-sync this) ) (else - (set! (-> obj path-pos) 0.0) - (get-point-at-percent-along-path! (-> obj path) (-> obj root trans) (-> obj path-pos) 'interp) - (init-plat! obj) - (plat-path-sync obj) + (set! (-> this path-pos) 0.0) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + (init-plat! this) + (plat-path-sync this) ) ) (none) @@ -244,37 +244,37 @@ This commonly includes things such as: ) ;; definition for method 3 of type drop-plat -(defmethod inspect drop-plat ((obj drop-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect drop-plat ((this drop-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tart-name: ~A~%" (-> obj art-name)) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tbreak-anim-name: ~A~%" (-> obj break-anim-name)) - (format #t "~2Tsafe-time: ~D~%" (-> obj safe-time)) - (format #t "~2Thit-point: ~`vector`P~%" (-> obj hit-point)) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tbreak-anim-name: ~A~%" (-> this break-anim-name)) + (format #t "~2Tsafe-time: ~D~%" (-> this safe-time)) + (format #t "~2Thit-point: ~`vector`P~%" (-> this hit-point)) (label cfg-4) - obj + this ) ;; definition for method 7 of type drop-plat ;; WARN: Return type mismatch base-plat vs drop-plat. -(defmethod relocate drop-plat ((obj drop-plat) (arg0 int)) - (if (nonzero? (-> obj break-anim-name)) - (&+! (-> obj break-anim-name) arg0) +(defmethod relocate drop-plat ((this drop-plat) (arg0 int)) + (if (nonzero? (-> this break-anim-name)) + (&+! (-> this break-anim-name) arg0) ) - (let ((v1-5 (-> obj anim anim-name))) + (let ((v1-5 (-> this anim anim-name))) (if (and (>= (the-as int v1-5) (-> *kernel-context* relocating-min)) (< (the-as int v1-5) (-> *kernel-context* relocating-max)) ) - (set! (-> obj anim anim-name) (&+ (the-as external-art-buffer (-> obj anim anim-name)) arg0)) + (set! (-> this anim anim-name) (&+ (the-as external-art-buffer (-> this anim anim-name)) arg0)) ) ) - (the-as drop-plat ((method-of-type base-plat relocate) obj arg0)) + (the-as drop-plat ((method-of-type base-plat relocate) this arg0)) ) ;; failed to figure out what this is: @@ -294,7 +294,7 @@ This commonly includes things such as: (set! (-> self safe-time) (+ (current-time) (seconds 0.2))) (return (the-as object #f)) ) - ((< (- (current-time) (-> self safe-time)) (seconds 0.05)) + ((not (time-elapsed? (-> self safe-time) (seconds 0.05))) (return (the-as object #f)) ) ) @@ -337,7 +337,7 @@ This commonly includes things such as: :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('edge-grabbed) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (send-event proc 'end-mode) ) ) @@ -347,7 +347,7 @@ This commonly includes things such as: ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) diff --git a/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc index 00ec56a9f8..824ac4fff8 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/powerups_REF.gc @@ -17,7 +17,7 @@ (s2-1 (process->handle arg1)) ) (let ((s0-0 (current-time))) - (until (>= (- (current-time) s0-0) (+ arg3 arg4)) + (until (time-elapsed? s0-0 (+ arg3 arg4)) (let ((v1-8 (or (not (handle->process s1-1)) (not (handle->process s2-1))))) (if v1-8 (deactivate self) @@ -46,7 +46,7 @@ ) (else (let ((s4-1 (current-time))) - (until (>= (- (current-time) s4-1) arg5) + (until (time-elapsed? s4-1 arg5) (let ((a0-21 (process-drawable-random-point! (the-as process-drawable (-> s2-1 process 0)) (new-stack-vector0)))) (arg2 a0-21) ) @@ -732,7 +732,7 @@ ;; WARN: Return type mismatch int vs none. (defbehavior target-color-effect-process target () (when (and (-> self color-effect) - (>= (- (current-time) (-> self color-effect-start-time)) (the-as time-frame (-> self color-effect-duration))) + (time-elapsed? (-> self color-effect-start-time) (the-as time-frame (-> self color-effect-duration))) ) (set! (-> self color-effect) #f) (set-vector! (-> self draw color-mult) 1.0 1.0 1.0 1.0) @@ -847,13 +847,13 @@ (if (and (logtest? (-> self water flags) (water-flags under-water)) (not (logtest? (-> self water flags) (water-flags swim-ground))) ) - (set! (-> self control unknown-time-frame26) (current-time)) - (set! (-> self control unknown-time-frame27) (current-time)) + (set-time! (-> self control unknown-time-frame26)) + (set-time! (-> self control unknown-time-frame27)) ) (cond ((and (= (-> self control ground-pat material) (pat-material ice)) (and (>= (-> self control ctrl-xz-vel) 204.8) - (< (- (current-time) (-> self control last-time-on-surface)) (seconds 0.05)) + (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.05))) ) ) (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 38)))) @@ -1061,7 +1061,7 @@ ((or (and (logtest? (-> self control mod-surface flags) (surface-flag air)) (not (logtest? (-> self control status) (collide-status on-surface))) ) - (and (focus-test? self board) (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1))) + (and (focus-test? self board) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)))) ) (logior! (-> self focus-status) (focus-status in-air)) (if (logtest? (surface-flag super) (-> self control current-surface flags)) @@ -1096,7 +1096,7 @@ (logior! (-> self focus-status) (focus-status ice)) (logclear! (-> self focus-status) (focus-status ice)) ) - (if (< (- (current-time) (-> self gun fire-time)) (seconds 0.1)) + (if (not (time-elapsed? (-> self gun fire-time) (seconds 0.1))) (logior! (-> self focus-status) (focus-status shooting)) (logclear! (-> self focus-status) (focus-status shooting)) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc index af4679fc7e..f4087b2cbc 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc @@ -62,44 +62,44 @@ ) ;; definition for method 3 of type projectile -(defmethod inspect projectile ((obj projectile)) - (when (not obj) - (set! obj obj) +(defmethod inspect projectile ((this projectile)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tstarting-pos: ~`vector`P~%" (-> obj starting-pos)) - (format #t "~2Tstarting-dir: ~`vector`P~%" (-> obj starting-dir)) - (format #t "~2Ttarget-pos: ~`vector`P~%" (-> obj target-pos)) - (format #t "~2Tbase-target-pos: ~`vector`P~%" (-> obj base-target-pos)) - (format #t "~2Tpre-move-transv: ~`vector`P~%" (-> obj pre-move-transv)) - (format #t "~2Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~2Tspawn-time: ~D~%" (-> obj spawn-time)) - (format #t "~2Toptions: ~D~%" (-> obj options)) - (format #t "~2Tlast-target: ~D~%" (-> obj last-target)) - (format #t "~2Tnotify-handle: ~D~%" (-> obj notify-handle)) - (format #t "~2Towner-handle: ~D~%" (-> obj owner-handle)) - (format #t "~2Tignore-handle: ~D~%" (-> obj ignore-handle)) - (format #t "~2Tupdate-velocity: ~A~%" (-> obj update-velocity)) - (format #t "~2Tmove: ~A~%" (-> obj move)) - (format #t "~2Tpick-target: ~A~%" (-> obj pick-target)) - (format #t "~2Tmax-speed: ~f~%" (-> obj max-speed)) - (format #t "~2Told-dist[16] @ #x~X~%" (-> obj old-dist)) - (format #t "~2Told-dist-count: ~D~%" (-> obj old-dist-count)) - (format #t "~2Thits: ~D~%" (-> obj hits)) - (format #t "~2Tmax-hits: ~D~%" (-> obj max-hits)) - (format #t "~2Ttween: ~f~%" (-> obj tween)) - (format #t "~2Tattack-mode: ~A~%" (-> obj attack-mode)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tdamage: ~f~%" (-> obj damage)) - (format #t "~2Tcharge-level: ~f~%" (-> obj charge-level)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tstop-speed: (meters ~m)~%" (-> obj stop-speed)) - (format #t "~2Tinvinc-time: ~D~%" (-> obj invinc-time)) + (format #t "~2Tstarting-pos: ~`vector`P~%" (-> this starting-pos)) + (format #t "~2Tstarting-dir: ~`vector`P~%" (-> this starting-dir)) + (format #t "~2Ttarget-pos: ~`vector`P~%" (-> this target-pos)) + (format #t "~2Tbase-target-pos: ~`vector`P~%" (-> this base-target-pos)) + (format #t "~2Tpre-move-transv: ~`vector`P~%" (-> this pre-move-transv)) + (format #t "~2Ttimeout: ~D~%" (-> this timeout)) + (format #t "~2Tspawn-time: ~D~%" (-> this spawn-time)) + (format #t "~2Toptions: ~D~%" (-> this options)) + (format #t "~2Tlast-target: ~D~%" (-> this last-target)) + (format #t "~2Tnotify-handle: ~D~%" (-> this notify-handle)) + (format #t "~2Towner-handle: ~D~%" (-> this owner-handle)) + (format #t "~2Tignore-handle: ~D~%" (-> this ignore-handle)) + (format #t "~2Tupdate-velocity: ~A~%" (-> this update-velocity)) + (format #t "~2Tmove: ~A~%" (-> this move)) + (format #t "~2Tpick-target: ~A~%" (-> this pick-target)) + (format #t "~2Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~2Told-dist[16] @ #x~X~%" (-> this old-dist)) + (format #t "~2Told-dist-count: ~D~%" (-> this old-dist-count)) + (format #t "~2Thits: ~D~%" (-> this hits)) + (format #t "~2Tmax-hits: ~D~%" (-> this max-hits)) + (format #t "~2Ttween: ~f~%" (-> this tween)) + (format #t "~2Tattack-mode: ~A~%" (-> this attack-mode)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tdamage: ~f~%" (-> this damage)) + (format #t "~2Tcharge-level: ~f~%" (-> this charge-level)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tstop-speed: (meters ~m)~%" (-> this stop-speed)) + (format #t "~2Tinvinc-time: ~D~%" (-> this invinc-time)) (label cfg-4) - obj + this ) ;; definition of type projectile-init-by-other-params @@ -121,24 +121,24 @@ ) ;; definition for method 3 of type projectile-init-by-other-params -(defmethod inspect projectile-init-by-other-params ((obj projectile-init-by-other-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect projectile-init-by-other-params ((this projectile-init-by-other-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'projectile-init-by-other-params) - (format #t "~1Tent: ~A~%" (-> obj ent)) - (format #t "~1Tcharge: ~f~%" (-> obj charge)) - (format #t "~1Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~1Toptions: ~D~%" (-> obj options)) - (format #t "~1Tnotify-handle: ~D~%" (-> obj notify-handle)) - (format #t "~1Towner-handle: ~D~%" (-> obj owner-handle)) - (format #t "~1Tignore-handle: ~D~%" (-> obj ignore-handle)) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tvel: #~%" (-> obj vel)) - (format #t "~1Ttimeout: ~D~%" (-> obj timeout)) + (format #t "[~8x] ~A~%" this 'projectile-init-by-other-params) + (format #t "~1Tent: ~A~%" (-> this ent)) + (format #t "~1Tcharge: ~f~%" (-> this charge)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Toptions: ~D~%" (-> this options)) + (format #t "~1Tnotify-handle: ~D~%" (-> this notify-handle)) + (format #t "~1Towner-handle: ~D~%" (-> this owner-handle)) + (format #t "~1Tignore-handle: ~D~%" (-> this ignore-handle)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tvel: #~%" (-> this vel)) + (format #t "~1Ttimeout: ~D~%" (-> this timeout)) (label cfg-4) - obj + this ) ;; definition for function spawn-projectile @@ -171,18 +171,18 @@ ) ;; definition for method 3 of type projectile-bounce -(defmethod inspect projectile-bounce ((obj projectile-bounce)) - (when (not obj) - (set! obj obj) +(defmethod inspect projectile-bounce ((this projectile-bounce)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tplayed-bounce-time: ~D~%" (-> obj played-bounce-time)) - (format #t "~2Ttumble-quat: #~%" (-> obj tumble-quat)) + (format #t "~2Tplayed-bounce-time: ~D~%" (-> this played-bounce-time)) + (format #t "~2Ttumble-quat: #~%" (-> this tumble-quat)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc index 61da09a06a..c575b164aa 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/projectile_REF.gc @@ -16,27 +16,27 @@ ;; definition for method 39 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound! projectile ((obj projectile)) +(defmethod play-impact-sound! projectile ((this projectile)) "Plays impact sound" 0 (none) ) ;; definition for method 35 of type projectile -(defmethod event-handler! projectile ((obj projectile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-handler! projectile ((this projectile) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Multiplex the projectile's event processing, called by [[projectile-event-handler]]" (case arg2 (('track) (let ((v0-0 (the-as object (process->handle (the-as process (-> arg3 param 0)))))) - (set! (-> obj last-target) (the-as handle v0-0)) + (set! (-> this last-target) (the-as handle v0-0)) v0-0 ) ) (('touched 'touch) - (handle-proj-hit! obj arg0 arg3) + (handle-proj-hit! this arg0 arg3) ) (('die) - (kill-projectile! obj) + (kill-projectile! this) ) ) ) @@ -50,33 +50,33 @@ ;; definition for method 37 of type projectile ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs symbol. -(defmethod deal-damage! projectile ((obj projectile) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! projectile ((this projectile) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((v1-1 (new 'stack 'attack-info))) (let ((a0-2 v1-1)) - (set! (-> a0-2 mode) (-> obj attack-mode)) - (set! (-> a0-2 id) (-> obj attack-id)) + (set! (-> a0-2 mode) (-> this attack-mode)) + (set! (-> a0-2 id) (-> this attack-id)) (set! (-> a0-2 mask) (attack-mask mode id)) ) - (when (!= (-> obj owner-handle) #f) - (set! (-> v1-1 attacker) (-> obj owner-handle)) + (when (!= (-> this owner-handle) #f) + (set! (-> v1-1 attacker) (-> this owner-handle)) (logior! (-> v1-1 mask) (attack-mask attacker)) ) - (when (logtest? (-> obj options) (projectile-options account-for-target-velocity)) - (set! (-> v1-1 attacker-velocity quad) (-> obj pre-move-transv quad)) + (when (logtest? (-> this options) (projectile-options account-for-target-velocity)) + (set! (-> v1-1 attacker-velocity quad) (-> this pre-move-transv quad)) (logior! (-> v1-1 mask) (attack-mask attacker-velocity)) ) - (when (logtest? (-> obj options) (projectile-options deal-damage)) - (set! (-> v1-1 damage) (-> obj damage)) + (when (logtest? (-> this options) (projectile-options deal-damage)) + (set! (-> v1-1 damage) (-> this damage)) (logior! (-> v1-1 mask) (attack-mask damage)) ) - (when (logtest? (projectile-options respect-invinc-time) (-> obj options)) - (set! (-> v1-1 invinc-time) (-> obj invinc-time)) + (when (logtest? (projectile-options respect-invinc-time) (-> this options)) + (set! (-> v1-1 invinc-time) (-> this invinc-time)) (logior! (-> v1-1 mask) (attack-mask invinc-time)) ) (the-as symbol (send-event arg0 - (if (logtest? (projectile-options ignore-impact) (-> obj options)) + (if (logtest? (projectile-options ignore-impact) (-> this options)) 'attack-invinc 'attack ) @@ -88,22 +88,22 @@ ) ;; definition for method 36 of type projectile -(defmethod handle-proj-hit! projectile ((obj projectile) (arg0 process) (arg1 event-message-block)) +(defmethod handle-proj-hit! projectile ((this projectile) (arg0 process) (arg1 event-message-block)) "When a projectile hits something, first deal damage via [[projectile::37]] and increment the projectiles hit count. If we've met or exceeded the projectiles maximum allowed hits, switch to the [[projectile::impact]] state" - (when (-> obj attack-mode) + (when (-> this attack-mode) (let ((a2-1 (-> arg1 param 0))) - (when (deal-damage! obj arg0 (the-as event-message-block a2-1)) - (let ((v1-3 (-> obj notify-handle))) + (when (deal-damage! this arg0 (the-as event-message-block a2-1)) + (let ((v1-3 (-> this notify-handle))) (send-event (handle->process v1-3) 'notify 'attack arg0) ) - (+! (-> obj hits) 1) - (if (and (>= (-> obj hits) (-> obj max-hits)) - (not (and (-> obj next-state) (= (-> obj next-state name) 'impact))) + (+! (-> this hits) 1) + (if (and (>= (-> this hits) (-> this max-hits)) + (not (and (-> this next-state) (= (-> this next-state name) 'impact))) ) - (go (method-of-object obj impact)) + (go (method-of-object this impact)) ) ) ) @@ -111,17 +111,17 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ;; definition for method 34 of type projectile -(defmethod kill-projectile! projectile ((obj projectile)) +(defmethod kill-projectile! projectile ((this projectile)) "Transition to the [[projectile::impact]] state, always return [[#t]]" - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'impact))) - (go (method-of-object obj impact)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) + (go (method-of-object this impact)) ) #t ) ;; definition for method 24 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight projectile ((obj projectile)) +(defmethod draw-laser-sight projectile ((this projectile)) "TODO - confirm If applicable, draw the laser sight particles" 0 (none) @@ -129,10 +129,10 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 25 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles projectile ((obj projectile)) +(defmethod spawn-impact-particles projectile ((this projectile)) "Spawns associated particles with the projectile if applicable" - (if (nonzero? (-> obj part)) - (spawn (-> obj part) (-> obj root trans)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) ) 0 (none) @@ -140,7 +140,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 26 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles projectile ((obj projectile)) +(defmethod spawn-shell-particles projectile ((this projectile)) "TODO - confirm" 0 (none) @@ -148,7 +148,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 27 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod unknown-particles projectile ((obj projectile)) +(defmethod unknown-particles projectile ((this projectile)) "TODO - confirm" 0 (none) @@ -156,18 +156,18 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 28 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound projectile ((obj projectile) (arg0 projectile-options)) +(defmethod play-impact-sound projectile ((this projectile) (arg0 projectile-options)) 0 (none) ) ;; definition for method 29 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod stop-sound! projectile ((obj projectile)) +(defmethod stop-sound! projectile ((this projectile)) "Stops the current `sound-id` if set, re-init the `sound-id` after being stopped" - (when (nonzero? (-> obj sound-id)) - (sound-stop (-> obj sound-id)) - (set! (-> obj sound-id) (new 'static 'sound-id)) + (when (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) + (set! (-> this sound-id) (new 'static 'sound-id)) 0 ) 0 @@ -175,16 +175,16 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) ;; definition for method 38 of type projectile -(defmethod made-impact? projectile ((obj projectile)) +(defmethod made-impact? projectile ((this projectile)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a1-0 t1-0)) (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a1-0 ignore-process0) obj) - (set! (-> a1-0 ignore-process1) (handle->process (-> obj ignore-handle))) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (handle->process (-> this ignore-handle))) (set! (-> a1-0 ignore-pat) (-> v1-0 pat-ignore-mask)) (set! (-> a1-0 action-mask) (collide-action solid)) ) @@ -309,7 +309,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (stop-sound! self) ) :trans (behavior () - (if (>= (- (current-time) (-> self spawn-time)) (-> self timeout)) + (if (time-elapsed? (-> self spawn-time) (-> self timeout)) (go-virtual dissipate) ) (let ((t9-1 (-> self pick-target))) @@ -409,7 +409,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 31 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! projectile ((obj projectile)) +(defmethod init-proj-settings! projectile ((this projectile)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" 0 (none) @@ -417,9 +417,9 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 30 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! projectile ((obj projectile)) +(defmethod init-proj-collision! projectile ((this projectile)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-projectile) (set! (-> s5-0 no-reaction) @@ -442,9 +442,9 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 @@ -453,25 +453,25 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 32 of type projectile ;; WARN: Return type mismatch int vs none. -(defmethod go-moving! projectile ((obj projectile)) - (go (method-of-object obj moving)) +(defmethod go-moving! projectile ((this projectile)) + (go (method-of-object this moving)) 0 (none) ) ;; definition for method 33 of type projectile ;; WARN: Return type mismatch object vs none. -(defmethod go-sitting! projectile ((obj projectile)) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'impact))) - (go (method-of-object obj impact)) +(defmethod go-sitting! projectile ((this projectile)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'impact))) + (go (method-of-object this impact)) ) (none) ) ;; definition for method 10 of type projectile -(defmethod deactivate projectile ((obj projectile)) - (stop-sound! obj) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate projectile ((this projectile)) + (stop-sound! this) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -494,7 +494,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p (set! (-> self last-target) (the-as handle #f)) (set! (-> self timeout) (-> arg0 timeout)) (set! (-> self max-hits) 1) - (set! (-> self spawn-time) (current-time)) + (set-time! (-> self spawn-time)) (set! (-> self update-velocity) #f) (set! (-> self move) projectile-move-fill-line-sphere) (set! (-> self pick-target) #f) @@ -577,7 +577,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p :event projectile-event-handler :trans (behavior () (noop self) - (if (>= (- (current-time) (-> self spawn-time)) (-> self timeout)) + (if (time-elapsed? (-> self spawn-time) (-> self timeout)) (go-virtual impact) ) ) @@ -587,7 +587,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 41 of type projectile-bounce ;; WARN: Return type mismatch int vs none. -(defmethod noop projectile-bounce ((obj projectile-bounce)) +(defmethod noop projectile-bounce ((this projectile-bounce)) "Does nothing" 0 (none) @@ -603,14 +603,14 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 33 of type projectile-bounce ;; WARN: Return type mismatch object vs none. -(defmethod go-sitting! projectile-bounce ((obj projectile-bounce)) - (go (method-of-object obj sitting)) +(defmethod go-sitting! projectile-bounce ((this projectile-bounce)) + (go (method-of-object this sitting)) (none) ) ;; definition for method 25 of type projectile-bounce ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles projectile-bounce ((obj projectile-bounce)) +(defmethod spawn-impact-particles projectile-bounce ((this projectile-bounce)) "Spawns associated particles with the projectile if applicable" (ja-post) 0 @@ -639,18 +639,18 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 39 of type projectile-bounce ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound! projectile-bounce ((obj projectile-bounce)) +(defmethod play-impact-sound! projectile-bounce ((this projectile-bounce)) "Plays impact sound" - (let* ((a2-0 (-> obj root)) + (let* ((a2-0 (-> this root)) (v1-0 (-> a2-0 status)) ) (if (logtest? v1-0 (collide-status touch-surface)) (vector-float*! (-> a2-0 transv) (-> a2-0 transv) 0.6) ) (when (and (logtest? v1-0 (collide-status impact-surface)) - (>= (- (current-time) (-> obj played-bounce-time)) (seconds 0.3)) + (time-elapsed? (-> this played-bounce-time) (seconds 0.3)) ) - (set! (-> obj played-bounce-time) (current-time)) + (set-time! (-> this played-bounce-time)) (sound-play "dark-shot-bounc") ) ) @@ -659,9 +659,9 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 30 of type projectile-bounce ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! projectile-bounce ((obj projectile-bounce)) +(defmethod init-proj-collision! projectile-bounce ((this projectile-bounce)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-bounce-reaction) (set! (-> s5-0 no-reaction) @@ -681,14 +681,14 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (set-collide-with! - (-> obj root) + (-> this root) (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) ) - (set-collide-as! (-> obj root) (collide-spec projectile)) - (set! (-> obj root pat-ignore-mask) + (set-collide-as! (-> this root) (collide-spec projectile)) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) @@ -696,17 +696,17 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p ;; definition for method 31 of type projectile-bounce ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! projectile-bounce ((obj projectile-bounce)) +(defmethod init-proj-settings! projectile-bounce ((this projectile-bounce)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj max-speed) 450560.0) - (set! (-> obj timeout) (seconds 1.6)) - (set! (-> obj update-velocity) projectile-bounce-update-velocity) - (set! (-> obj move) projectile-bounce-move) - (set! (-> obj root dynam gravity y) 184320.0) - (set! (-> obj root dynam gravity-length) 184320.0) - (set! (-> obj root dynam gravity-max) 184320.0) + (set! (-> this max-speed) 450560.0) + (set! (-> this timeout) (seconds 1.6)) + (set! (-> this update-velocity) projectile-bounce-update-velocity) + (set! (-> this move) projectile-bounce-move) + (set! (-> this root dynam gravity y) 184320.0) + (set! (-> this root dynam gravity-length) 184320.0) + (set! (-> this root dynam gravity-max) 184320.0) (let ((f0-4 1092.2667)) - (quaternion-axis-angle! (-> obj tumble-quat) 1.0 0.0 0.0 f0-4) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-4) ) 0 (none) 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 317e75d7e4..e2fa850137 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 @@ -23,46 +23,46 @@ ) ;; definition for method 3 of type rigid-body-platform-constants -(defmethod inspect rigid-body-platform-constants ((obj rigid-body-platform-constants)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-platform-constants ((this rigid-body-platform-constants)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rigid-body-platform-constants) - (format #t "~1Tinfo: #~%" (-> obj info)) - (format #t "~1Tmass: ~f~%" (-> obj info mass)) - (format #t "~1Tinv-mass: ~f~%" (-> obj info inv-mass)) - (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> obj info cm-offset-joint x)) - (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> obj info cm-offset-joint y)) - (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> obj info cm-offset-joint z)) - (format #t "~1Tlinear-damping: ~f~%" (-> obj info linear-damping)) - (format #t "~1Tangular-damping: ~f~%" (-> obj info angular-damping)) - (format #t "~1Tbounce-factor: ~f~%" (-> obj info bounce-factor)) - (format #t "~1Tfriction-factor: ~f~%" (-> obj info friction-factor)) - (format #t "~1Tinertial-tensor-x: (meters ~m)~%" (-> obj inertial-tensor-x)) - (format #t "~1Tinertial-tensor-y: (meters ~m)~%" (-> obj inertial-tensor-y)) - (format #t "~1Tinertial-tensor-z: (meters ~m)~%" (-> obj inertial-tensor-z)) - (format #t "~1Textra: #~%" (-> obj extra)) - (format #t "~1Tmax-time-step: ~f~%" (-> obj extra max-time-step)) - (format #t "~1Tgravity: (meters ~m)~%" (-> obj extra gravity)) - (format #t "~1Tidle-distance: (meters ~m)~%" (-> obj extra idle-distance)) - (format #t "~1Tattack-force-scale: ~f~%" (-> obj extra attack-force-scale)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tdrag-factor: ~f~%" (-> obj drag-factor)) - (format #t "~1Tbuoyancy-factor: ~f~%" (-> obj buoyancy-factor)) - (format #t "~1Tmax-buoyancy-depth: (meters ~m)~%" (-> obj max-buoyancy-depth)) - (format #t "~1Tplayer-weight: (meters ~m)~%" (-> obj player-weight)) - (format #t "~1Tplayer-bonk-factor: ~f~%" (-> obj player-bonk-factor)) - (format #t "~1Tplayer-dive-factor: ~f~%" (-> obj player-dive-factor)) - (format #t "~1Tplayer-force-distance: (meters ~m)~%" (-> obj player-force-distance)) - (format #t "~1Tplayer-force-clamp: (meters ~m)~%" (-> obj player-force-clamp)) - (format #t "~1Tplayer-force-timeout: ~D~%" (-> obj player-force-timeout)) - (format #t "~1Texplosion-force: (meters ~m)~%" (-> obj explosion-force)) - (format #t "~1Tcontrol-point-count: ~D~%" (-> obj control-point-count)) - (format #t "~1Tplatform: ~A~%" (-> obj platform)) - (format #t "~1Tsound-name: ~A~%" (-> obj sound-name)) + (format #t "[~8x] ~A~%" this 'rigid-body-platform-constants) + (format #t "~1Tinfo: #~%" (-> this info)) + (format #t "~1Tmass: ~f~%" (-> this info mass)) + (format #t "~1Tinv-mass: ~f~%" (-> this info inv-mass)) + (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> this info cm-offset-joint x)) + (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> this info cm-offset-joint y)) + (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> this info cm-offset-joint z)) + (format #t "~1Tlinear-damping: ~f~%" (-> this info linear-damping)) + (format #t "~1Tangular-damping: ~f~%" (-> this info angular-damping)) + (format #t "~1Tbounce-factor: ~f~%" (-> this info bounce-factor)) + (format #t "~1Tfriction-factor: ~f~%" (-> this info friction-factor)) + (format #t "~1Tinertial-tensor-x: (meters ~m)~%" (-> this inertial-tensor-x)) + (format #t "~1Tinertial-tensor-y: (meters ~m)~%" (-> this inertial-tensor-y)) + (format #t "~1Tinertial-tensor-z: (meters ~m)~%" (-> this inertial-tensor-z)) + (format #t "~1Textra: #~%" (-> this extra)) + (format #t "~1Tmax-time-step: ~f~%" (-> this extra max-time-step)) + (format #t "~1Tgravity: (meters ~m)~%" (-> this extra gravity)) + (format #t "~1Tidle-distance: (meters ~m)~%" (-> this extra idle-distance)) + (format #t "~1Tattack-force-scale: ~f~%" (-> this extra attack-force-scale)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tdrag-factor: ~f~%" (-> this drag-factor)) + (format #t "~1Tbuoyancy-factor: ~f~%" (-> this buoyancy-factor)) + (format #t "~1Tmax-buoyancy-depth: (meters ~m)~%" (-> this max-buoyancy-depth)) + (format #t "~1Tplayer-weight: (meters ~m)~%" (-> this player-weight)) + (format #t "~1Tplayer-bonk-factor: ~f~%" (-> this player-bonk-factor)) + (format #t "~1Tplayer-dive-factor: ~f~%" (-> this player-dive-factor)) + (format #t "~1Tplayer-force-distance: (meters ~m)~%" (-> this player-force-distance)) + (format #t "~1Tplayer-force-clamp: (meters ~m)~%" (-> this player-force-clamp)) + (format #t "~1Tplayer-force-timeout: ~D~%" (-> this player-force-timeout)) + (format #t "~1Texplosion-force: (meters ~m)~%" (-> this explosion-force)) + (format #t "~1Tcontrol-point-count: ~D~%" (-> this control-point-count)) + (format #t "~1Tplatform: ~A~%" (-> this platform)) + (format #t "~1Tsound-name: ~A~%" (-> this sound-name)) (label cfg-4) - obj + this ) ;; definition of type rigid-body-control-point @@ -77,17 +77,17 @@ ) ;; definition for method 3 of type rigid-body-control-point -(defmethod inspect rigid-body-control-point ((obj rigid-body-control-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-control-point ((this rigid-body-control-point)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rigid-body-control-point) - (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~1Tworld-pos: #~%" (-> obj world-pos)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) + (format #t "[~8x] ~A~%" this 'rigid-body-control-point) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tworld-pos: #~%" (-> this world-pos)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) (label cfg-4) - obj + this ) ;; definition of type rigid-body-control-point-inline-array @@ -100,17 +100,17 @@ ) ;; definition for method 3 of type rigid-body-control-point-inline-array -(defmethod inspect rigid-body-control-point-inline-array ((obj rigid-body-control-point-inline-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-control-point-inline-array ((this rigid-body-control-point-inline-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -140,45 +140,45 @@ ) ;; definition for method 3 of type rigid-body-platform -(defmethod inspect rigid-body-platform ((obj rigid-body-platform)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-platform ((this rigid-body-platform)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type rigid-body-object inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcontrol-point-array: ~A~%" (-> obj control-point-array)) - (format #t "~2Tplayer-velocity: #~%" (-> obj player-velocity)) - (format #t "~2Tplayer-velocity-prev: #~%" (-> obj player-velocity-prev)) - (format #t "~2Tplayer-force-position: #~%" (-> obj player-force-position)) - (format #t "~2Tplayer-force: #~%" (-> obj player-force)) - (format #t "~2Tfloat-height-offset: ~f~%" (-> obj float-height-offset)) - (format #t "~2Tplayer-bonk-timeout: ~D~%" (-> obj player-bonk-timeout)) - (format #t "~2Twater-anim: ~A~%" (-> obj water-anim)) + (format #t "~2Tcontrol-point-array: ~A~%" (-> this control-point-array)) + (format #t "~2Tplayer-velocity: #~%" (-> this player-velocity)) + (format #t "~2Tplayer-velocity-prev: #~%" (-> this player-velocity-prev)) + (format #t "~2Tplayer-force-position: #~%" (-> this player-force-position)) + (format #t "~2Tplayer-force: #~%" (-> this player-force)) + (format #t "~2Tfloat-height-offset: ~f~%" (-> this float-height-offset)) + (format #t "~2Tplayer-bonk-timeout: ~D~%" (-> this player-bonk-timeout)) + (format #t "~2Twater-anim: ~A~%" (-> this water-anim)) (label cfg-4) - obj + this ) ;; 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 ((obj rigid-body-platform) (new-addr int)) - (if (nonzero? (-> obj control-point-array)) - (&+! (-> obj control-point-array) new-addr) +(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)) - obj + this new-addr ) ) ) ;; definition for method 53 of type rigid-body-platform -(defmethod rigid-body-platform-method-53 rigid-body-platform ((obj rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-53 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) (local-vars (f0-1 object)) - (let ((v1-0 (-> obj water-anim))) + (let ((v1-0 (-> this water-anim))) 0.0 (set! f0-1 (cond (v1-0 @@ -203,32 +203,32 @@ ;; definition for method 54 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-54 rigid-body-platform ((obj rigid-body-platform) (ctrl-point rigid-body-control-point)) +(defmethod rigid-body-platform-method-54 rigid-body-platform ((this rigid-body-platform) (ctrl-point rigid-body-control-point)) (set! (-> ctrl-point world-pos w) - (+ (rigid-body-platform-method-53 obj (-> ctrl-point world-pos)) (-> obj float-height-offset)) + (+ (rigid-body-platform-method-53 this (-> ctrl-point world-pos)) (-> this float-height-offset)) ) (let* ((s4-0 (new 'stack-no-clear 'vector)) (f0-3 (- (-> ctrl-point world-pos w) (-> ctrl-point world-pos y))) - (f30-0 (/ f0-3 (-> obj info max-buoyancy-depth))) + (f30-0 (/ f0-3 (-> this info max-buoyancy-depth))) ) (when (< 0.0 f0-3) (vector-float*! s4-0 *y-vector* - (* (-> obj rbody state info mass) + (* (-> this rbody state info mass) (fmin 1.0 f30-0) - (/ (-> obj info extra gravity) (the float (-> obj info control-point-count))) - (-> obj info buoyancy-factor) + (/ (-> this info extra gravity) (the float (-> this info control-point-count))) + (-> this info buoyancy-factor) ) ) - (let ((v1-6 (-> obj rbody)) + (let ((v1-6 (-> this rbody)) (a1-9 (-> ctrl-point world-pos)) (a2-0 s4-0) ) (rigid-body-method-18 (-> v1-6 state) a1-9 a2-0) ) - (vector-float*! s4-0 (-> ctrl-point velocity) (* -1.0 (-> obj info drag-factor) (fmin 1.0 f30-0))) - (let ((v1-11 (-> obj rbody)) + (vector-float*! s4-0 (-> ctrl-point velocity) (* -1.0 (-> this info drag-factor) (fmin 1.0 f30-0))) + (let ((v1-11 (-> this rbody)) (a1-13 (-> ctrl-point world-pos)) ) (rigid-body-method-18 (-> v1-11 state) a1-13 s4-0) @@ -242,15 +242,15 @@ ;; definition for method 50 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-50 rigid-body-platform ((obj rigid-body-platform) (arg0 float)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force)) - (logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force)) +(defmethod rigid-body-object-method-50 rigid-body-platform ((this rigid-body-platform) (arg0 float)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) + (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force)) ) - (let ((rigid-body (-> obj rbody)) - (force-pos (-> obj player-force-position)) - (force (-> obj player-force)) - (force-dist (-> obj info player-force-distance)) + (let ((rigid-body (-> this rbody)) + (force-pos (-> this player-force-position)) + (force (-> this player-force)) + (force-dist (-> this info player-force-distance)) ) (rigid-body-method-21 (-> rigid-body state) force-pos force force-dist) ) @@ -261,10 +261,10 @@ ;; definition for method 55 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-55 rigid-body-platform ((obj rigid-body-platform)) +(defmethod rigid-body-platform-method-55 rigid-body-platform ((this rigid-body-platform)) (let ((a1-0 (new 'stack-no-clear 'vector))) - (vector-float*! a1-0 *y-vector* (* -1.0 (-> obj info extra gravity) (-> obj rbody state info mass))) - (rigid-body-method-20 (-> obj rbody state) a1-0) + (vector-float*! a1-0 *y-vector* (* -1.0 (-> this info extra gravity) (-> this rbody state info mass))) + (rigid-body-method-20 (-> this rbody state) a1-0) ) 0 (none) @@ -272,16 +272,16 @@ ;; definition for method 56 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-56 rigid-body-platform ((obj rigid-body-platform) (arg0 vector)) +(defmethod rigid-body-platform-method-56 rigid-body-platform ((this rigid-body-platform) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj rbody state position)) + (vector-! v1-0 arg0 (-> this rbody state position)) (set! (-> v1-0 y) 0.0) (let* ((f0-1 (vector-length v1-0)) (f1-1 (* 10.0 (fmax 0.0 (fmin 4096.0 (+ -4096.0 f0-1))))) ) (when (< 0.0 f1-1) (vector-float*! v1-0 v1-0 (/ f1-1 f0-1)) - (rigid-body-method-20 (-> obj rbody state) v1-0) + (rigid-body-method-20 (-> this rbody state) v1-0) ) ) ) @@ -291,23 +291,23 @@ ;; definition for method 29 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 rigid-body-platform ((obj rigid-body-platform) (arg0 float)) - (let ((s4-0 (-> obj rbody state matrix))) - (dotimes (s3-0 (-> obj info control-point-count)) - (let ((s2-0 (-> obj control-point-array data s3-0))) +(defmethod rigid-body-object-method-29 rigid-body-platform ((this rigid-body-platform) (arg0 float)) + (let ((s4-0 (-> this rbody state matrix))) + (dotimes (s3-0 (-> this info control-point-count)) + (let ((s2-0 (-> this control-point-array data s3-0))) (vector-matrix*! (-> s2-0 world-pos) (-> s2-0 local-pos) s4-0) - (let ((v1-4 (-> obj rbody)) + (let ((v1-4 (-> this rbody)) (a1-2 (-> s2-0 world-pos)) (a2-1 (-> s2-0 velocity)) ) (rigid-body-method-22 (-> v1-4 state) a1-2 a2-1) ) - (rigid-body-platform-method-54 obj s2-0) + (rigid-body-platform-method-54 this s2-0) ) ) ) - (rigid-body-platform-method-55 obj) - (rigid-body-object-method-50 obj arg0) + (rigid-body-platform-method-55 this) + (rigid-body-object-method-50 this arg0) 0 (none) ) @@ -315,45 +315,45 @@ ;; definition for method 30 of type rigid-body-platform ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-30 rigid-body-platform ((obj rigid-body-platform)) - (if (-> obj info platform) - (detect-riders! (-> obj root)) +(defmethod rigid-body-object-method-30 rigid-body-platform ((this rigid-body-platform)) + (if (-> this info platform) + (detect-riders! (-> this root)) ) - (set! (-> obj player-velocity-prev quad) (-> obj player-velocity quad)) + (set! (-> this player-velocity-prev quad) (-> this player-velocity quad)) (if *target* - (set! (-> obj player-velocity quad) (-> *target* control transv quad)) - (set! (-> obj player-velocity quad) (-> *null-vector* quad)) + (set! (-> this player-velocity quad) (-> *target* control transv quad)) + (set! (-> this player-velocity quad) (-> *null-vector* quad)) ) (let ((t9-1 (method-of-type rigid-body-object rigid-body-object-method-30))) - (t9-1 obj) + (t9-1 this) ) - (logclear! (-> obj flags) (rigid-body-object-flag player-contact-force)) + (logclear! (-> this flags) (rigid-body-object-flag player-contact-force)) 0 (none) ) ;; definition for method 47 of type rigid-body-platform -(defmethod rigid-body-object-method-47 rigid-body-platform ((obj rigid-body-platform) +(defmethod rigid-body-object-method-47 rigid-body-platform ((this rigid-body-platform) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate) ) - ((method-of-type rigid-body-object rigid-body-object-method-47) obj arg0 arg1 arg2 arg3) + ((method-of-type rigid-body-object rigid-body-object-method-47) this arg0 arg1 arg2 arg3) #f ) ;; definition for method 46 of type rigid-body-platform ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-46 rigid-body-platform ((obj rigid-body-platform) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 rigid-body-platform ((this rigid-body-platform) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('edge-grabbed) (let ((v1-1 (the-as object (-> arg3 param 0)))) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) - (logior! (-> obj flags) (rigid-body-object-flag player-contact-force)) - (set! (-> obj player-force-position quad) (-> (the-as rigid-body-control-point v1-1) velocity quad)) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (* -1.0 (-> obj info player-weight))) + (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) + (logior! (-> this flags) (rigid-body-object-flag player-contact-force)) + (set! (-> this player-force-position quad) (-> (the-as rigid-body-control-point v1-1) velocity quad)) + (vector-reset! (-> this player-force)) + (set! (-> this player-force y) (* -1.0 (-> this info player-weight))) ) ) ) @@ -370,19 +370,19 @@ (logtest? (-> v1-11 mask) (process-mask target)) (not (logtest? (-> v1-11 focus-status) (focus-status on-water under-water))) ) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) - (logior! (-> obj flags) (rigid-body-object-flag player-contact-force)) - (set! (-> obj player-force-position quad) (-> v1-11 root trans quad)) - (vector-reset! (-> obj player-force)) - (let* ((a1-5 (-> obj player-force-position)) + (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) + (logior! (-> this flags) (rigid-body-object-flag player-contact-force)) + (set! (-> this player-force-position quad) (-> v1-11 root trans quad)) + (vector-reset! (-> this player-force)) + (let* ((a1-5 (-> this player-force-position)) (f30-0 0.0) (f28-0 1.0) (f26-0 1.0) - (f0-4 (+ (- -4096.0 (-> a1-5 y)) (rigid-body-platform-method-53 obj a1-5))) + (f0-4 (+ (- -4096.0 (-> a1-5 y)) (rigid-body-platform-method-53 this a1-5))) (f1-2 12288.0) (f0-8 (fmax f30-0 (fmin f28-0 (- f26-0 (* f0-4 (/ 1.0 f1-2)))))) ) - (set! (-> obj player-force y) (* -1.0 (-> obj info player-weight) f0-8)) + (set! (-> this player-force y) (* -1.0 (-> this info player-weight) f0-8)) ) ) ) @@ -391,10 +391,11 @@ ) ) (('bonk) - (when (>= (- (current-time) (the-as int (-> obj player-bonk-timeout))) - (the-as time-frame (-> obj info player-force-timeout)) - ) - (set! (-> obj player-bonk-timeout) (the-as uint (current-time))) + (when (time-elapsed? + (the-as int (-> this player-bonk-timeout)) + (the-as time-frame (-> this info player-force-timeout)) + ) + (set! (-> this player-bonk-timeout) (the-as uint (current-time))) (let* ((s4-0 arg0) (v1-31 (if (type? s4-0 process-drawable) s4-0 @@ -402,36 +403,36 @@ ) ) (when v1-31 - (logior! (-> obj flags) (rigid-body-object-flag player-impulse-force)) - (set! (-> obj player-force-position quad) (-> v1-31 root trans quad)) + (logior! (-> this flags) (rigid-body-object-flag player-impulse-force)) + (set! (-> this player-force-position quad) (-> v1-31 root trans quad)) (let ((f0-14 (fmin (* 0.00012207031 (the-as float (-> arg3 param 1)) - (-> obj info player-bonk-factor) - (-> obj info player-weight) + (-> this info player-bonk-factor) + (-> this info player-weight) ) - (-> obj info player-force-clamp) + (-> this info player-force-clamp) ) ) ) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (- f0-14)) + (vector-reset! (-> this player-force)) + (set! (-> this player-force y) (- f0-14)) ) ) ) ) ) (else - ((method-of-type rigid-body-object rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) + ((method-of-type rigid-body-object rigid-body-object-method-46) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 37 of type rigid-body-platform -(defmethod rigid-body-object-method-37 rigid-body-platform ((obj rigid-body-platform)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force)) +(defmethod rigid-body-object-method-37 rigid-body-platform ((this rigid-body-platform)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) (sound-play-by-name - (string->sound-name (-> obj info sound-name)) + (string->sound-name (-> this info sound-name)) (new-sound-id) 1024 0 @@ -440,10 +441,10 @@ #t ) ) - (rigid-body-object-method-30 obj) - (quaternion-copy! (-> obj root quat) (-> obj rbody state rotation)) - (let ((v1-9 (-> obj rbody)) - (a1-2 (-> obj root trans)) + (rigid-body-object-method-30 this) + (quaternion-copy! (-> this root quat) (-> this rbody state rotation)) + (let ((v1-9 (-> this rbody)) + (a1-2 (-> this root trans)) ) (rigid-body-method-23 (-> v1-9 state) a1-2) ) @@ -454,36 +455,36 @@ ;; definition for method 31 of type rigid-body-platform ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod alloc-and-init-rigid-body-control rigid-body-platform ((obj rigid-body-platform) (arg0 rigid-body-object-constants)) - (set! (-> obj info) (the-as rigid-body-platform-constants arg0)) - (set! (-> obj rbody) (new 'process 'rigid-body-control obj)) - (set! (-> obj control-point-array) - (new 'process 'rigid-body-control-point-inline-array (-> obj info control-point-count)) +(defmethod alloc-and-init-rigid-body-control rigid-body-platform ((this rigid-body-platform) (arg0 rigid-body-object-constants)) + (set! (-> this info) (the-as rigid-body-platform-constants arg0)) + (set! (-> this rbody) (new 'process 'rigid-body-control this)) + (set! (-> this control-point-array) + (new 'process 'rigid-body-control-point-inline-array (-> this info control-point-count)) ) - (update-transforms (-> obj root)) - (let ((v1-5 (-> obj rbody)) - (a1-3 (-> obj info info)) - (a2-2 (-> obj root trans)) - (a3-0 (-> obj root quat)) - (t0-0 (method-of-object obj rigid-body-object-method-29)) + (update-transforms (-> this root)) + (let ((v1-5 (-> this rbody)) + (a1-3 (-> this info info)) + (a2-2 (-> this root trans)) + (a3-0 (-> this root quat)) + (t0-0 (method-of-object this rigid-body-object-method-29)) ) (rigid-body-method-25 (-> v1-5 state) a1-3 a2-2 a3-0 t0-0) ) - (set! (-> obj player-bonk-timeout) (the-as uint (current-time))) - (set! (-> obj player-force quad) (-> *null-vector* quad)) - (set! (-> obj player-velocity quad) (-> *null-vector* quad)) - (set! (-> obj player-velocity-prev quad) (-> *null-vector* quad)) - (set! (-> obj root max-iteration-count) (the-as uint 4)) - (set! (-> obj max-time-step) (-> arg0 extra max-time-step)) - (set! (-> obj water-anim) (the-as water-anim (entity-actor-lookup (-> obj entity) 'water-actor 0))) + (set! (-> this player-bonk-timeout) (the-as uint (current-time))) + (set! (-> this player-force quad) (-> *null-vector* quad)) + (set! (-> this player-velocity quad) (-> *null-vector* quad)) + (set! (-> this player-velocity-prev quad) (-> *null-vector* quad)) + (set! (-> this root max-iteration-count) (the-as uint 4)) + (set! (-> this max-time-step) (-> arg0 extra max-time-step)) + (set! (-> this water-anim) (the-as water-anim (entity-actor-lookup (-> this entity) 'water-actor 0))) 0 (none) ) ;; definition for method 32 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape rigid-body-platform ((obj rigid-body-platform)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod allocate-and-init-cshape rigid-body-platform ((this rigid-body-platform)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -504,7 +505,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -547,12 +548,12 @@ ;; definition for method 33 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body rigid-body-platform ((obj rigid-body-platform)) - (set! (-> obj float-height-offset) 0.0) - (alloc-and-init-rigid-body-control obj *rigid-body-platform-constants*) - (let ((s5-0 (-> obj info control-point-count))) +(defmethod init-skel-and-rigid-body rigid-body-platform ((this rigid-body-platform)) + (set! (-> this float-height-offset) 0.0) + (alloc-and-init-rigid-body-control this *rigid-body-platform-constants*) + (let ((s5-0 (-> this info control-point-count))) (dotimes (s4-0 s5-0) - (let ((s3-0 (-> obj control-point-array data s4-0))) + (let ((s3-0 (-> this control-point-array data s4-0))) (let ((f30-0 (* 65536.0 (/ (the float s4-0) (the float s5-0))))) (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) (set! (-> s3-0 local-pos y) -10240.0) @@ -568,18 +569,18 @@ ;; definition for method 11 of type rigid-body-platform ;; WARN: Return type mismatch int vs none. -(defmethod init-from-entity! rigid-body-platform ((obj rigid-body-platform) (arg0 entity-actor)) +(defmethod init-from-entity! rigid-body-platform ((this rigid-body-platform) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask platform)) - (allocate-and-init-cshape obj) - (process-drawable-from-entity! obj arg0) - (init-skel-and-rigid-body obj) - (rigid-body-object-method-34 obj) + (logior! (-> this mask) (process-mask platform)) + (allocate-and-init-cshape this) + (process-drawable-from-entity! this arg0) + (init-skel-and-rigid-body this) + (rigid-body-object-method-34 this) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc index 4d489fc9db..02c800f7a0 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/voicebox_REF.gc @@ -55,16 +55,16 @@ ) ;; definition for method 3 of type camera-remote -(defmethod inspect camera-remote ((obj camera-remote)) - (when (not obj) - (set! obj obj) +(defmethod inspect camera-remote ((this camera-remote)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type camera-slave inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type remote @@ -93,23 +93,23 @@ ) ;; definition for method 3 of type remote -(defmethod inspect remote ((obj remote)) - (when (not obj) - (set! obj obj) +(defmethod inspect remote ((this remote)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbase-trans: ~`vector`P~%" (-> obj base-trans)) - (format #t "~2Tfocus: #~%" (-> obj focus)) - (format #t "~2Tseeker: #~%" (-> obj seeker)) - (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~2Tblend: ~f~%" (-> obj blend)) - (format #t "~2Ttwist: ~f~%" (-> obj twist)) - (format #t "~2Tspeak-effect?: ~A~%" (-> obj speak-effect?)) + (format #t "~2Tbase-trans: ~`vector`P~%" (-> this base-trans)) + (format #t "~2Tfocus: #~%" (-> this focus)) + (format #t "~2Tseeker: #~%" (-> this seeker)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Tblend: ~f~%" (-> this blend)) + (format #t "~2Ttwist: ~f~%" (-> this twist)) + (format #t "~2Tspeak-effect?: ~A~%" (-> this speak-effect?)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -122,21 +122,21 @@ ;; definition for method 24 of type remote ;; INFO: Used lq/sq -(defmethod get-track-pt-and-scale remote ((obj remote) (arg0 vector)) - (let ((s4-0 (handle->process (-> obj focus handle)))) +(defmethod get-track-pt-and-scale remote ((this remote) (arg0 vector)) + (let ((s4-0 (handle->process (-> this focus handle)))) (when s4-0 (set! (-> arg0 quad) (-> (get-trans (the-as process-focusable s4-0) 3) quad)) (let ((a0-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s4-0) 0)))) - (vector+float*! arg0 arg0 a0-7 (* -16384.0 (- 1.0 (-> obj blend)))) + (vector+float*! arg0 arg0 a0-7 (* -16384.0 (- 1.0 (-> this blend)))) ) ) ) - (lerp-scale 1.0 0.0 (-> obj blend) 0.8 1.0) + (lerp-scale 1.0 0.0 (-> this blend) 0.8 1.0) ) ;; definition for method 25 of type remote ;; WARN: Return type mismatch int vs none. -(defmethod post-common remote ((obj remote)) +(defmethod post-common remote ((this remote)) (with-pp (rlet ((acc :class vf) (vf0 :class vf) @@ -147,21 +147,21 @@ ) (init-vf0-vector) (ja-post) - (if (type? (-> obj root) collide-shape) - (update-transforms (the-as collide-shape (-> obj root))) + (if (type? (-> this root) collide-shape) + (update-transforms (the-as collide-shape (-> this root))) ) - (when (and (nonzero? (-> obj part)) (and (or (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (and (-> obj next-state) (= (-> obj next-state name) 'enter)) - ) - (-> obj speak-effect?) - ) + (when (and (nonzero? (-> this part)) (and (or (and (-> this next-state) (= (-> this next-state name) 'idle)) + (and (-> this next-state) (= (-> this next-state name) 'enter)) + ) + (-> this speak-effect?) + ) ) (let ((v1-15 - (vector-float*! (new 'stack-no-clear 'vector) (-> obj parent 0 velocity) (-> pp clock frames-per-second)) + (vector-float*! (new 'stack-no-clear 'vector) (-> this parent 0 velocity) (-> pp clock frames-per-second)) ) (a0-8 *particle-vel*) ) - (let ((a1-4 (-> obj node-list data 3 bone transform vector 2))) + (let ((a1-4 (-> this node-list data 3 bone transform vector 2))) (let ((a2-1 20480.0)) (.mov vf7 a2-1) ) @@ -179,7 +179,7 @@ ) (vector-float*! v1-16 a0-9 (/ 1.0 f0-2)) ) - (spawn-with-cspace (-> obj part) (-> obj node-list data 3)) + (spawn-with-cspace (-> this part) (-> this node-list data 3)) ) 0 (none) @@ -352,17 +352,17 @@ ;; definition for method 23 of type remote ;; WARN: Return type mismatch remote vs none. -(defmethod init remote ((obj remote)) - (reset-to-collide-spec (-> obj focus) (collide-spec jak player-list)) +(defmethod init remote ((this remote)) + (reset-to-collide-spec (-> this focus) (collide-spec jak player-list)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-voicebox" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj blend) 1.0) - (set! (-> obj draw light-index) (the-as uint 30)) - (set! (-> obj speak-effect?) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 77) obj)) + (set! (-> this blend) 1.0) + (set! (-> this draw light-index) (the-as uint 30)) + (set! (-> this speak-effect?) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 77) this)) (none) ) @@ -392,17 +392,17 @@ ) ;; definition for method 3 of type voicebox -(defmethod inspect voicebox ((obj voicebox)) - (when (not obj) - (set! obj obj) +(defmethod inspect voicebox ((this voicebox)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type remote inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thint: ~D~%" (-> obj hint)) + (format #t "~2Thint: ~D~%" (-> this hint)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -410,10 +410,10 @@ :virtual #t :code (behavior () (remove-setting! 'sound-flava) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self seeker target) 1.0) (while (and (< (-> self blend) 0.9999) (not (and (not (handle->process (-> self hint))) - (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) (-> *setting-control* user-current hint) ) ) @@ -474,44 +474,45 @@ ) ;; definition for method 3 of type judge -(defmethod inspect judge ((obj judge)) - (when (not obj) - (set! obj obj) +(defmethod inspect judge ((this judge)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type remote inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttotal-time: ~D~%" (-> obj total-time)) - (format #t "~2Tbeep-time: ~D~%" (-> obj beep-time)) - (format #t "~2Thud-timer: ~D~%" (-> obj hud-timer)) - (format #t "~2Tscore: ~D~%" (-> obj score)) + (format #t "~2Ttotal-time: ~D~%" (-> this total-time)) + (format #t "~2Tbeep-time: ~D~%" (-> this beep-time)) + (format #t "~2Thud-timer: ~D~%" (-> this hud-timer)) + (format #t "~2Tscore: ~D~%" (-> this score)) (label cfg-4) - obj + this ) ;; definition for method 24 of type judge ;; INFO: Used lq/sq -(defmethod get-track-pt-and-scale judge ((obj judge) (arg0 vector)) - (set! (-> arg0 quad) (-> obj base-trans quad)) +(defmethod get-track-pt-and-scale judge ((this judge) (arg0 vector)) + (set! (-> arg0 quad) (-> this base-trans quad)) 1.0 ) ;; definition for method 25 of type judge ;; WARN: Return type mismatch int vs none. -(defmethod post-common judge ((obj judge)) +(defmethod post-common judge ((this judge)) (ja-post) - (if (type? (-> obj root) collide-shape) - (update-transforms (the-as collide-shape (-> obj root))) + (if (type? (-> this root) collide-shape) + (update-transforms (the-as collide-shape (-> this root))) ) - (when (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) - (or (= v1-6 'idle) (= v1-6 'enter)) - ) + (when (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'idle) (= v1-6 'enter)) + ) ) (if *target* (set! (-> *game-info* score) (-> *target* fact trick-point)) ) - (let ((v1-15 (the-as int (- (-> obj total-time) (- (-> *display* game-clock frame-counter) (-> obj start-time)))))) + (let ((v1-15 (the-as int (- (-> this total-time) (- (-> *display* game-clock frame-counter) (-> this start-time))))) + ) (if (< (the-as time-frame v1-15) 0) (set! v1-15 0) ) @@ -594,8 +595,8 @@ ;; definition for method 27 of type judge ;; WARN: Return type mismatch int vs none. -(defmethod setup-collision judge ((obj judge)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod setup-collision judge ((this judge)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec collectable)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list tobot)) @@ -608,7 +609,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -617,20 +618,20 @@ ;; definition for method 11 of type judge ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! judge ((obj judge) (arg0 entity-actor)) +(defmethod init-from-entity! judge ((this judge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (setup-collision obj) - (init obj) - (process-drawable-from-entity! obj arg0) - (+! (-> obj root trans y) 4096.0) - (set! (-> obj base-trans quad) (-> obj root trans quad)) - (set! (-> obj total-time) (seconds 90)) - (go (method-of-object obj wait)) + (setup-collision this) + (init this) + (process-drawable-from-entity! this arg0) + (+! (-> this root trans y) 4096.0) + (set! (-> this base-trans quad) (-> this root trans quad)) + (set! (-> this total-time) (seconds 90)) + (go (method-of-object this wait)) (none) ) 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 b2081447c2..0191e33767 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 @@ -34,36 +34,36 @@ ) ;; definition for method 3 of type water-anim -(defmethod inspect water-anim ((obj water-anim)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-anim ((this water-anim)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Twater-height: (meters ~m)~%" (-> obj water-height)) - (format #t "~2Twade-height: (meters ~m)~%" (-> obj wade-height)) - (format #t "~2Tswim-height: (meters ~m)~%" (-> obj swim-height)) - (format #t "~2Tbottom-height: (meters ~m)~%" (-> obj bottom-height)) - (format #t "~2Tattack-event: ~A~%" (-> obj attack-event)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tflow: ~A~%" (-> obj flow)) - (format #t "~2Ttarget: ~D~%" (-> obj target)) - (format #t "~2Tflags: #x~X~%" (-> obj flags)) - (format #t "~2Tlook: ~D~%" (-> obj look)) - (format #t "~2Tplay-ambient-sound?: ~A~%" (-> obj play-ambient-sound?)) - (format #t "~2Tvisible: ~A~%" (-> obj visible)) + (format #t "~2Twater-height: (meters ~m)~%" (-> this water-height)) + (format #t "~2Twade-height: (meters ~m)~%" (-> this wade-height)) + (format #t "~2Tswim-height: (meters ~m)~%" (-> this swim-height)) + (format #t "~2Tbottom-height: (meters ~m)~%" (-> this bottom-height)) + (format #t "~2Tattack-event: ~A~%" (-> this attack-event)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tflow: ~A~%" (-> this flow)) + (format #t "~2Ttarget: ~D~%" (-> this target)) + (format #t "~2Tflags: #x~X~%" (-> this flags)) + (format #t "~2Tlook: ~D~%" (-> this look)) + (format #t "~2Tplay-ambient-sound?: ~A~%" (-> this play-ambient-sound?)) + (format #t "~2Tvisible: ~A~%" (-> this visible)) (label cfg-4) - obj + this ) ;; definition for method 7 of type water-anim -(defmethod relocate water-anim ((obj water-anim) (arg0 int)) - (if (nonzero? (-> obj flow)) - (&+! (-> obj flow) arg0) +(defmethod relocate water-anim ((this water-anim) (arg0 int)) + (if (nonzero? (-> this flow)) + (&+! (-> this flow) arg0) ) - ((the-as (function water-anim int water-anim) (find-parent-method water-anim 7)) obj arg0) + ((the-as (function water-anim int water-anim) (find-parent-method water-anim 7)) this arg0) ) ;; failed to figure out what this is: @@ -288,17 +288,17 @@ ) ;; definition for method 3 of type water-anim-look -(defmethod inspect water-anim-look ((obj water-anim-look)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-anim-look ((this water-anim-look)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'water-anim-look) - (format #t "~1Tskel-group: ~A~%" (-> obj skel-group)) - (format #t "~1Tanim: ~D~%" (-> obj anim)) - (format #t "~1Tambient-sound-spec: ~A~%" (-> obj ambient-sound-spec)) + (format #t "[~8x] ~A~%" this 'water-anim-look) + (format #t "~1Tskel-group: ~A~%" (-> this skel-group)) + (format #t "~1Tanim: ~D~%" (-> this anim)) + (format #t "~1Tambient-sound-spec: ~A~%" (-> this ambient-sound-spec)) (label cfg-4) - obj + this ) ;; definition for symbol *water-anim-look*, type (array water-anim-look) @@ -380,7 +380,6 @@ ;; definition for function water-anim-event-handler ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. (defbehavior water-anim-event-handler water-anim ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-1 object)) (case arg2 @@ -509,23 +508,23 @@ ;; definition for method 22 of type water-anim ;; INFO: Used lq/sq -(defmethod move-to-point! water-anim ((obj water-anim) (arg0 vector)) +(defmethod move-to-point! water-anim ((this water-anim) (arg0 vector)) "Set a [[water-anim]]'s `trans` as specified by the [[vector]] and update `water-height`." - (set! (-> obj root trans quad) (-> arg0 quad)) - (set! (-> obj water-height) (-> obj root trans y)) - (if (nonzero? (-> obj sound)) - (update-trans! (-> obj sound) (-> obj root trans)) + (set! (-> this root trans quad) (-> arg0 quad)) + (set! (-> this water-height) (-> this root trans y)) + (if (nonzero? (-> this sound)) + (update-trans! (-> this sound) (-> this root trans)) ) ) ;; definition for method 23 of type water-anim -(defmethod get-ripple-height water-anim ((obj water-anim) (arg0 vector)) - (ripple-find-height obj 0 arg0) +(defmethod get-ripple-height water-anim ((this water-anim) (arg0 vector)) + (ripple-find-height this 0 arg0) ) ;; definition for method 27 of type water-anim ;; WARN: Return type mismatch symbol vs none. -(defmethod water-anim-method-27 water-anim ((obj water-anim)) +(defmethod water-anim-method-27 water-anim ((this water-anim)) "Empty." (none) ) @@ -533,44 +532,44 @@ ;; definition for method 28 of type water-anim ;; INFO: Used lq/sq ;; WARN: Return type mismatch quaternion vs none. -(defmethod offset! water-anim ((obj water-anim)) +(defmethod offset! water-anim ((this water-anim)) "Offset a [[water-anim]]'s `trans` and `quat` by the lump data in `entity`." (local-vars (sv-16 res-tag)) - (set! (-> obj play-ambient-sound?) #t) - (set! (-> obj visible) #t) - (set! (-> obj look) - (res-lump-value (-> obj entity) 'look int :default (the-as uint128 -1) :time -1000000000.0) + (set! (-> this play-ambient-sound?) #t) + (set! (-> this visible) #t) + (set! (-> this look) + (res-lump-value (-> this entity) 'look int :default (the-as uint128 -1) :time -1000000000.0) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-4 (res-lump-data (-> obj entity) 'trans-offset vector :tag-ptr (& sv-16)))) + (let ((v1-4 (res-lump-data (-> this entity) 'trans-offset vector :tag-ptr (& sv-16)))) (when v1-4 - (+! (-> obj root trans x) (-> v1-4 x)) - (+! (-> obj root trans y) (-> v1-4 y)) - (+! (-> obj root trans z) (-> v1-4 z)) + (+! (-> this root trans x) (-> v1-4 x)) + (+! (-> this root trans y) (-> v1-4 y)) + (+! (-> this root trans z) (-> v1-4 z)) ) ) - (let ((f0-6 (res-lump-float (-> obj entity) 'rotoffset))) + (let ((f0-6 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-6 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-6) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-6) ) ) (none) ) ;; definition for method 24 of type water-anim -(defmethod init-water! water-anim ((obj water-anim)) +(defmethod init-water! water-anim ((this water-anim)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" - (let ((s5-0 (-> obj look))) + (let ((s5-0 (-> this look))) (if (or (< s5-0 0) (>= s5-0 (-> *water-anim-look* length))) (go process-drawable-art-error "skel group") ) (let ((s5-1 (-> *water-anim-look* s5-0))) - (initialize-skeleton-by-name obj (-> s5-1 skel-group)) + (initialize-skeleton-by-name this (-> s5-1 skel-group)) (ja-channel-set! 1) - (let ((s4-0 (-> obj skel root-channel 0))) + (let ((s4-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-0 - (the-as art-joint-anim (-> obj draw art-group data (-> s5-1 anim))) + (the-as art-joint-anim (-> this draw art-group data (-> s5-1 anim))) num-func-identity ) (set! (-> s4-0 frame-num) 0.0) @@ -578,8 +577,8 @@ (let ((a2-1 (-> s5-1 ambient-sound-spec))) (when a2-1 (let ((a3-0 (new 'stack-no-clear 'vector))) - (vector+! a3-0 (-> obj root trans) (-> obj draw bounds)) - (set! (-> obj sound) (new 'process 'ambient-sound a2-1 a3-0)) + (vector+! a3-0 (-> this root trans) (-> this draw bounds)) + (set! (-> this sound) (new 'process 'ambient-sound a2-1 a3-0)) ) ) ) @@ -590,10 +589,10 @@ ) ;; definition for method 25 of type water-anim -(defmethod reset-root! water-anim ((obj water-anim)) +(defmethod reset-root! water-anim ((this water-anim)) "Reset a [[water-anim]]'s `root`." (let ((v0-0 (new 'process 'trsqv))) - (set! (-> obj root) v0-0) + (set! (-> this root) v0-0) v0-0 ) ) @@ -601,35 +600,35 @@ ;; definition for method 26 of type water-anim ;; INFO: Used lq/sq ;; WARN: Return type mismatch water-flags vs none. -(defmethod water-anim-init! water-anim ((obj water-anim)) +(defmethod water-anim-init! water-anim ((this water-anim)) "Initialize a [[water-anim]]." (local-vars (sv-16 res-tag)) - (set! (-> obj attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) - (-> obj entity) - 'attack-event - 'interp - -1000000000.0 - (the-as structure 'drown) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (set! (-> this attack-event) (the-as symbol ((method-of-type res-lump get-property-struct) + (-> this entity) + 'attack-event + 'interp + -1000000000.0 + (the-as structure 'drown) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) - (process-drawable-from-entity! obj (-> obj entity)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj vol) (new 'process 'vol-control obj)) - (logior! (-> obj vol flags) (vol-flags display? vol-flags-1)) - (set! (-> obj bottom-height) 32768.0) + (process-drawable-from-entity! this (-> this entity)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this vol) (new 'process 'vol-control this)) + (logior! (-> this vol flags) (vol-flags display? vol-flags-1)) + (set! (-> this bottom-height) 32768.0) (let* ((v1-8 *game-info*) (a0-7 (+ (-> v1-8 attack-id) 1)) ) (set! (-> v1-8 attack-id) a0-7) - (set! (-> obj attack-id) a0-7) + (set! (-> this attack-id) a0-7) ) - (set! (-> obj target) (the-as handle #f)) + (set! (-> this target) (the-as handle #f)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-10 (the-as (pointer float) ((method-of-type res-lump get-property-data) - (-> obj entity) + (-> this entity) 'water-height 'exact -1000000000.0 @@ -641,28 +640,28 @@ ) ) (when v1-10 - (set! (-> obj water-height) (-> v1-10 0)) - (set! (-> obj wade-height) (-> v1-10 1)) - (set! (-> obj swim-height) (-> v1-10 2)) + (set! (-> this water-height) (-> v1-10 0)) + (set! (-> this wade-height) (-> v1-10 1)) + (set! (-> this swim-height) (-> v1-10 2)) (if (>= (-> sv-16 elt-count) (the-as uint 4)) - (set! (-> obj flags) (the-as water-flags (the int (-> v1-10 3)))) + (set! (-> this flags) (the-as water-flags (the int (-> v1-10 3)))) ) (if (>= (-> sv-16 elt-count) (the-as uint 5)) - (set! (-> obj bottom-height) (-> v1-10 4)) + (set! (-> this bottom-height) (-> v1-10 4)) ) ) ) - (logior! (-> obj flags) (water-flags part-water)) - (if (logtest? (-> obj flags) (water-flags flow)) - (set! (-> obj flow) (new 'process 'flow-control obj (the-as res-lump #f))) + (logior! (-> this flags) (water-flags part-water)) + (if (logtest? (-> this flags) (water-flags flow)) + (set! (-> this flow) (new 'process 'flow-control this (the-as res-lump #f))) ) (cond - ((zero? (-> obj flags)) - (if (< 0.0 (-> obj wade-height)) - (logior! (-> obj flags) (water-flags can-wade)) + ((zero? (-> this flags)) + (if (< 0.0 (-> this wade-height)) + (logior! (-> this flags) (water-flags can-wade)) ) - (if (< 0.0 (-> obj swim-height)) - (logior! (-> obj flags) (water-flags can-swim)) + (if (< 0.0 (-> this swim-height)) + (logior! (-> this flags) (water-flags can-swim)) ) ) (else @@ -686,18 +685,18 @@ ;; definition for method 11 of type water-anim ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! water-anim ((obj water-anim) (arg0 entity-actor)) +(defmethod init-from-entity! water-anim ((this water-anim) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (water-anim-method-27 obj) - (reset-root! obj) - (water-anim-init! obj) - (offset! obj) - (init-water! obj) - (go (method-of-object obj idle)) + (water-anim-method-27 this) + (reset-root! this) + (water-anim-init! this) + (offset! this) + (init-water! this) + (go (method-of-object this idle)) (none) ) 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 690fbfad90..01f39d9275 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 @@ -25,18 +25,18 @@ ) ;; definition for method 3 of type flow-section -(defmethod inspect flow-section ((obj flow-section)) - (when (not obj) - (set! obj obj) +(defmethod inspect flow-section ((this flow-section)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'flow-section) - (format #t "~1Tstart: #~%" (-> obj start)) - (format #t "~1Ttrailing: #~%" (-> obj trailing)) - (format #t "~1Tpull-dir: #~%" (-> obj pull-dir)) - (format #t "~1Tradial-dir: #~%" (-> obj radial-dir)) + (format #t "[~8x] ~A~%" this 'flow-section) + (format #t "~1Tstart: #~%" (-> this start)) + (format #t "~1Ttrailing: #~%" (-> this trailing)) + (format #t "~1Tpull-dir: #~%" (-> this pull-dir)) + (format #t "~1Tradial-dir: #~%" (-> this radial-dir)) (label cfg-4) - obj + this ) ;; definition of type flow-section-array @@ -49,17 +49,17 @@ ) ;; definition for method 3 of type flow-section-array -(defmethod inspect flow-section-array ((obj flow-section-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect flow-section-array ((this flow-section-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -87,37 +87,37 @@ ) ;; definition for method 3 of type flow-control -(defmethod inspect flow-control ((obj flow-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect flow-control ((this flow-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tpath: ~A~%" (-> obj path)) - (format #t "~1Tspeed: ~f~%" (-> obj speed)) - (format #t "~1Tbelt-radius: ~f~%" (-> obj belt-radius)) - (format #t "~1Tsections: ~A~%" (-> obj sections)) - (format #t "~1Tleading: #~%" (-> obj leading)) - (format #t "~1Tcollide-bounds: #~%" (-> obj collide-bounds)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tpath: ~A~%" (-> this path)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Tbelt-radius: ~f~%" (-> this belt-radius)) + (format #t "~1Tsections: ~A~%" (-> this sections)) + (format #t "~1Tleading: #~%" (-> this leading)) + (format #t "~1Tcollide-bounds: #~%" (-> this collide-bounds)) (label cfg-4) - obj + this ) ;; definition for method 7 of type flow-control -(defmethod relocate flow-control ((obj flow-control) (arg0 int)) - (if (nonzero? (-> obj sections)) - (&+! (-> obj sections) arg0) +(defmethod relocate flow-control ((this flow-control) (arg0 int)) + (if (nonzero? (-> this sections)) + (&+! (-> this sections) arg0) ) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - ((the-as (function flow-control int flow-control) (find-parent-method flow-control 7)) obj arg0) + ((the-as (function flow-control int flow-control) (find-parent-method flow-control 7)) this arg0) ) ;; definition for method 9 of type flow-control ;; WARN: Return type mismatch int vs none. -(defmethod draw-path flow-control ((obj flow-control)) - (let ((a0-1 (-> obj path))) +(defmethod draw-path flow-control ((this flow-control)) + (let ((a0-1 (-> this path))) (if (nonzero? a0-1) (debug-draw a0-1) ) @@ -130,7 +130,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 11 flow-control) has a return type of none, but the expression builder found a return statement. -(defmethod push-process flow-control ((obj flow-control) (arg0 process-focusable)) +(defmethod push-process flow-control ((this flow-control) (arg0 process-focusable)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -142,17 +142,17 @@ (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans arg0 0) quad)) (set! (-> s5-0 w) 1.0) - (when (>= (vector4-dot s5-0 (the-as vector (-> obj leading))) 0.0) - (let* ((v1-7 (-> obj sections)) + (when (>= (vector4-dot s5-0 (the-as vector (-> this leading))) 0.0) + (let* ((v1-7 (-> this sections)) (a0-3 (-> v1-7 length)) - (a3-0 (the-as object (-> obj leading))) + (a3-0 (the-as object (-> this leading))) ) (dotimes (s3-1 a0-3) (let ((s2-0 (-> v1-7 data s3-1))) (when (< (vector4-dot s5-0 (the-as vector (-> s2-0 trailing))) 0.0) (let ((v1-8 (new 'stack-no-clear 'vector))) (vector-! v1-8 s5-0 (-> s2-0 start)) - (when (>= (-> obj belt-radius) (fabs (vector-dot v1-8 (-> s2-0 radial-dir)))) + (when (>= (-> this belt-radius) (fabs (vector-dot v1-8 (-> s2-0 radial-dir)))) (let* ((f0-7 (vector-dot v1-8 (-> s2-0 pull-dir))) (f0-9 (- (-> v1-8 y) (* (-> s2-0 pull-dir y) f0-7))) ) @@ -181,9 +181,9 @@ (let ((f0-12 (/ f30-0 (- f30-0 f0-10))) (s2-1 (new 'stack-no-clear 'vector)) ) - (displacement-between-two-points-normalized! (-> obj path) s2-1 (+ (the float s3-1) f0-12)) + (displacement-between-two-points-normalized! (-> this path) s2-1 (+ (the float s3-1) f0-12)) (let ((v1-17 (new 'stack-no-clear 'vector))) - (vector-float*! v1-17 s2-1 (* (-> obj speed) (seconds-per-frame))) + (vector-float*! v1-17 s2-1 (* (-> this speed) (seconds-per-frame))) (let ((a1-15 (new 'stack-no-clear 'vector))) (let ((a0-17 v1-17)) (let ((a2-9 2048.0)) @@ -221,7 +221,7 @@ ;; definition for method 12 of type flow-control ;; WARN: Return type mismatch int vs none. -(defmethod find-and-push-things flow-control ((obj flow-control)) +(defmethod find-and-push-things flow-control ((this flow-control)) (local-vars (a0-10 float) (a2-5 float) (a2-12 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -233,7 +233,7 @@ (init-vf0-vector) (set! *actor-list-length* 0) (if #t - (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* (-> obj collide-bounds) *actor-list* 256)) + (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* (-> this collide-bounds) *actor-list* 256)) ) (when #t (let ((a0-2 (-> *collide-player-list* alive-list next0))) @@ -246,7 +246,7 @@ (when (logtest? (-> a1-1 prim-core collide-as) (collide-spec jak bot enemy hit-by-others-list player-list)) (let ((a1-2 (-> a1-1 prim-core))) (let ((a2-4 a1-2) - (a3-1 (-> obj collide-bounds)) + (a3-1 (-> this collide-bounds)) ) (.lvf vf2 (&-> a2-4 world-sphere quad)) (.lvf vf3 (&-> a3-1 quad)) @@ -257,7 +257,7 @@ (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-5 vf1) (let ((f0-0 a2-5) - (f1-1 (+ (-> a1-2 world-sphere w) (-> obj collide-bounds r))) + (f1-1 (+ (-> a1-2 world-sphere w) (-> this collide-bounds r))) ) (when (< f0-0 (* f1-1 f1-1)) (when (< *actor-list-length* 256) @@ -291,7 +291,7 @@ ) (let ((a1-14 (-> a1-13 prim-core))) (let ((a2-11 a1-14) - (a3-2 (-> obj collide-bounds)) + (a3-2 (-> this collide-bounds)) ) (.lvf vf2 (&-> a2-11 world-sphere quad)) (.lvf vf3 (&-> a3-2 quad)) @@ -302,7 +302,7 @@ (.add.z.vf vf1 vf1 vf1 :mask #b1) (.mov a2-12 vf1) (let ((f0-1 a2-12) - (f1-5 (+ (-> a1-14 world-sphere w) (-> obj collide-bounds r))) + (f1-5 (+ (-> a1-14 world-sphere w) (-> this collide-bounds r))) ) (b! (>= f0-1 (* f1-5 f1-5)) cfg-17 :delay #f) ) @@ -328,7 +328,7 @@ (a0-9 (-> v1-23 root-prim)) ) (when (logtest? (-> a0-9 prim-core collide-as) (collide-spec jak bot enemy hit-by-others-list player-list)) - (.lvf vf1 (&-> obj collide-bounds quad)) + (.lvf vf1 (&-> this collide-bounds quad)) (.lvf vf2 (&-> a0-9 prim-core world-sphere quad)) (.sub.vf vf3 vf1 vf2) (.add.w.vf vf4 vf1 vf2 :mask #b1000) @@ -349,7 +349,7 @@ ) ) (if a1-29 - (push-process obj (the-as process-focusable a1-29)) + (push-process this (the-as process-focusable a1-29)) ) ) ) @@ -370,24 +370,24 @@ ;; definition for method 10 of type flow-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod setup flow-control ((obj flow-control)) +(defmethod setup flow-control ((this flow-control)) (local-vars (sv-32 flow-section) (sv-48 flow-section)) - (let* ((s5-0 (-> obj path)) + (let* ((s5-0 (-> this path)) (s4-0 (-> s5-0 curve num-cverts)) (s3-0 (new 'stack-no-clear 'vector)) ) (let ((s2-0 (new 'process 'flow-section-array (+ s4-0 -1)))) - (set! (-> obj sections) s2-0) - (set! (-> obj collide-bounds quad) (the-as uint128 0)) + (set! (-> this sections) s2-0) + (set! (-> this collide-bounds quad) (the-as uint128 0)) (get-point-in-path! s5-0 s3-0 0.0 'interp) - (vector+! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) s3-0) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (let ((s1-0 (+ s4-0 -1))) (set! sv-32 (the-as flow-section #f)) (dotimes (s0-0 s1-0) (set! sv-48 (-> s2-0 data s0-0)) (set! (-> sv-48 start quad) (-> s3-0 quad)) (get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'interp) - (vector+! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) s3-0) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) (vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start)) (vector-normalize! (-> sv-48 pull-dir) 1.0) (set! (-> sv-48 trailing quad) (-> sv-48 pull-dir quad)) @@ -409,25 +409,25 @@ ) ) ) - (let ((s2-1 (-> obj sections data))) - (set! (-> obj leading quad) (-> s2-1 0 pull-dir quad)) - (set! (-> obj leading y) 0.0) - (vector-normalize! (-> obj leading) 1.0) - (set! (-> obj leading w) (- (vector-dot (the-as vector (-> s2-1 0)) (the-as vector (-> obj leading))))) + (let ((s2-1 (-> this sections data))) + (set! (-> this leading quad) (-> s2-1 0 pull-dir quad)) + (set! (-> this leading y) 0.0) + (vector-normalize! (-> this leading) 1.0) + (set! (-> this leading w) (- (vector-dot (the-as vector (-> s2-1 0)) (the-as vector (-> this leading))))) ) (let ((f0-19 (/ 1.0 (the float s4-0))) (f30-0 0.0) ) - (vector-float*! (the-as vector (-> obj collide-bounds)) (the-as vector (-> obj collide-bounds)) f0-19) + (vector-float*! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) f0-19) (dotimes (s2-2 s4-0) (get-point-in-path! s5-0 s3-0 (the float s2-2) 'interp) - (let ((f0-22 (vector-vector-distance-squared s3-0 (-> obj collide-bounds)))) + (let ((f0-22 (vector-vector-distance-squared s3-0 (-> this collide-bounds)))) (if (< f30-0 f0-22) (set! f30-0 f0-22) ) ) ) - (set! (-> obj collide-bounds r) (+ (sqrtf f30-0) (-> obj belt-radius))) + (set! (-> this collide-bounds r) (+ (sqrtf f30-0) (-> this belt-radius))) ) ) 0 diff --git a/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc index 23f31f1f60..d68b57b27c 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water-h_REF.gc @@ -18,19 +18,19 @@ ) ;; definition for method 3 of type water-info -(defmethod inspect water-info ((obj water-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-info ((this water-info)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj 'water-info) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Tnormal: ~`vector`P~%" (-> obj normal)) - (format #t "~1Tbase-height: (meters ~m)~%" (-> obj base-height)) - (format #t "~1Tdepth: (meters ~m)~%" (-> obj depth)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tflags: #x~X : (water-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'water-info) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~1Tbase-height: (meters ~m)~%" (-> this base-height)) + (format #t "~1Tdepth: (meters ~m)~%" (-> this depth)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tflags: #x~X : (water-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (water-flags active)) (water-flags active)) (format #t "active ") ) @@ -129,10 +129,10 @@ ) ) (format #t ")~%") - (format #t "~1Tprim: ~A~%" (-> obj prim)) - (format #t "~1Textra-flags: ~D~%" (-> obj extra-flags)) + (format #t "~1Tprim: ~A~%" (-> this prim)) + (format #t "~1Textra-flags: ~D~%" (-> this extra-flags)) (label cfg-68) - obj + this ) ;; definition of type water-control @@ -194,14 +194,14 @@ ) ;; definition for method 3 of type water-control -(defmethod inspect water-control ((obj water-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-control ((this water-control)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X : (water-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (water-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (water-flags active)) (water-flags active)) (format #t "active ") ) @@ -300,50 +300,50 @@ ) ) (format #t ")~%") - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~1Ttop-y-offset: ~f~%" (-> obj top-y-offset)) - (format #t "~1Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~1Tenter-water-time: ~D~%" (-> obj enter-water-time)) - (format #t "~1Twade-time: ~D~%" (-> obj wade-time)) - (format #t "~1Ton-water-time: ~D~%" (-> obj on-water-time)) - (format #t "~1Tenter-swim-time: ~D~%" (-> obj enter-swim-time)) - (format #t "~1Tswim-time: ~D~%" (-> obj swim-time)) - (format #t "~1Tbase-height: (meters ~m)~%" (-> obj base-height)) - (format #t "~1Twade-height: (meters ~m)~%" (-> obj wade-height)) - (format #t "~1Tswim-height: (meters ~m)~%" (-> obj swim-height)) - (format #t "~1Tsurface-height: (meters ~m)~%" (-> obj surface-height)) - (format #t "~1Tbottom-height: (meters ~m)~%" (-> obj bottom-height)) - (format #t "~1Tcollide-height: (meters ~m)~%" (-> obj collide-height)) - (format #t "~1Theight: (meters ~m)~%" (-> obj height)) - (format #t "~1Theight-offset[4] @ #x~X~%" (&-> obj base-ocean-offset)) - (format #t "~1Tbase-ocean-offset: (meters ~m)~%" (-> obj base-ocean-offset)) - (format #t "~1Treal-ocean-offset: (meters ~m)~%" (-> obj base-ocean-offset)) - (format #t "~1Tocean-offset: (meters ~m)~%" (-> obj ocean-offset)) - (format #t "~1Tbob-offset: (meters ~m)~%" (-> obj bob-offset)) - (format #t "~1Talign-offset: (meters ~m)~%" (-> obj align-offset)) - (format #t "~1Tswim-depth: (meters ~m)~%" (-> obj swim-depth)) - (format #t "~1Tbob: #~%" (-> obj bob)) - (format #t "~1Tripple: ~D~%" (-> obj ripple)) - (format #t "~1Tripple-size: (meters ~m)~%" (-> obj ripple-size)) - (format #t "~1Twake-size: (meters ~m)~%" (-> obj wake-size)) - (format #t "~1Tbottom[2] @ #x~X~%" (-> obj bottom)) - (format #t "~1Ttop[2] @ #x~X~%" (-> obj top)) - (format #t "~1Tenter-water-pos: ~`vector`P~%" (-> obj enter-water-pos)) - (format #t "~1Tdrip-old-pos: ~`vector`P~%" (-> obj drip-old-pos)) - (format #t "~1Tdrip-joint-index: ~D~%" (-> obj drip-joint-index)) - (format #t "~1Tdrip-wetness: ~f~%" (-> obj drip-wetness)) - (format #t "~1Tdrip-time: ~D~%" (-> obj drip-time)) - (format #t "~1Tdrip-speed: ~f~%" (-> obj drip-speed)) - (format #t "~1Tdrip-height: (meters ~m)~%" (-> obj drip-height)) - (format #t "~1Tdrip-mult: ~f~%" (-> obj drip-mult)) - (format #t "~1Tdistort-time: ~D~%" (-> obj distort-time)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~1Ttop-y-offset: ~f~%" (-> this top-y-offset)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tenter-water-time: ~D~%" (-> this enter-water-time)) + (format #t "~1Twade-time: ~D~%" (-> this wade-time)) + (format #t "~1Ton-water-time: ~D~%" (-> this on-water-time)) + (format #t "~1Tenter-swim-time: ~D~%" (-> this enter-swim-time)) + (format #t "~1Tswim-time: ~D~%" (-> this swim-time)) + (format #t "~1Tbase-height: (meters ~m)~%" (-> this base-height)) + (format #t "~1Twade-height: (meters ~m)~%" (-> this wade-height)) + (format #t "~1Tswim-height: (meters ~m)~%" (-> this swim-height)) + (format #t "~1Tsurface-height: (meters ~m)~%" (-> this surface-height)) + (format #t "~1Tbottom-height: (meters ~m)~%" (-> this bottom-height)) + (format #t "~1Tcollide-height: (meters ~m)~%" (-> this collide-height)) + (format #t "~1Theight: (meters ~m)~%" (-> this height)) + (format #t "~1Theight-offset[4] @ #x~X~%" (&-> this base-ocean-offset)) + (format #t "~1Tbase-ocean-offset: (meters ~m)~%" (-> this base-ocean-offset)) + (format #t "~1Treal-ocean-offset: (meters ~m)~%" (-> this base-ocean-offset)) + (format #t "~1Tocean-offset: (meters ~m)~%" (-> this ocean-offset)) + (format #t "~1Tbob-offset: (meters ~m)~%" (-> this bob-offset)) + (format #t "~1Talign-offset: (meters ~m)~%" (-> this align-offset)) + (format #t "~1Tswim-depth: (meters ~m)~%" (-> this swim-depth)) + (format #t "~1Tbob: #~%" (-> this bob)) + (format #t "~1Tripple: ~D~%" (-> this ripple)) + (format #t "~1Tripple-size: (meters ~m)~%" (-> this ripple-size)) + (format #t "~1Twake-size: (meters ~m)~%" (-> this wake-size)) + (format #t "~1Tbottom[2] @ #x~X~%" (-> this bottom)) + (format #t "~1Ttop[2] @ #x~X~%" (-> this top)) + (format #t "~1Tenter-water-pos: ~`vector`P~%" (-> this enter-water-pos)) + (format #t "~1Tdrip-old-pos: ~`vector`P~%" (-> this drip-old-pos)) + (format #t "~1Tdrip-joint-index: ~D~%" (-> this drip-joint-index)) + (format #t "~1Tdrip-wetness: ~f~%" (-> this drip-wetness)) + (format #t "~1Tdrip-time: ~D~%" (-> this drip-time)) + (format #t "~1Tdrip-speed: ~f~%" (-> this drip-speed)) + (format #t "~1Tdrip-height: (meters ~m)~%" (-> this drip-height)) + (format #t "~1Tdrip-mult: ~f~%" (-> this drip-mult)) + (format #t "~1Tdistort-time: ~D~%" (-> this distort-time)) (label cfg-68) - obj + this ) ;; definition for method 14 of type water-control -(defmethod display-water-marks? water-control ((obj water-control)) +(defmethod display-water-marks? water-control ((this water-control)) *display-water-marks* ) @@ -371,8 +371,8 @@ ) ;; definition for method 12 of type water-control -(defmethod distance-from-surface water-control ((obj water-control)) - (- (-> obj top 0 y) (-> obj height)) +(defmethod distance-from-surface water-control ((this water-control)) + (- (-> this top 0 y) (-> this height)) ) ;; definition of type water-vol @@ -384,15 +384,15 @@ ) ;; definition for method 3 of type water-vol -(defmethod inspect water-vol ((obj water-vol)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-vol ((this water-vol)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) (format #t "process-tree ") ) @@ -491,34 +491,34 @@ ) ) (format #t ")~%") - (format #t "~1Tclock: ~A~%" (-> obj clock)) - (format #t "~1Tparent: #x~X~%" (-> obj parent)) - (format #t "~1Tbrother: #x~X~%" (-> obj brother)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) - (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tstatus: ~A~%" (-> obj status)) - (format #t "~1Tpid: ~D~%" (-> obj pid)) - (format #t "~1Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~1Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tstate: ~A~%" (-> obj state)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~1Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~1Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~1Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~1Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~1Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~1Theap: #~%" (&-> obj heap-base)) - (format #t "~1Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) (label cfg-68) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc index aad6fa0da3..ae5237bb88 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/water_REF.gc @@ -690,7 +690,7 @@ ;; definition for method 9 of type water-control ;; WARN: Return type mismatch int vs none. -(defmethod water-control-method-9 water-control ((obj water-control)) +(defmethod water-control-method-9 water-control ((this water-control)) 0 (none) ) @@ -698,121 +698,125 @@ ;; definition for method 10 of type water-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod water-control-method-10 water-control ((obj water-control)) +(defmethod water-control-method-10 water-control ((this water-control)) (local-vars (sv-272 (function vector entity-actor skeleton-group vector object none :behavior manipy)) (sv-288 vector) (sv-304 entity-actor) ) (with-pp - (let ((s4-0 (-> obj flags)) + (let ((s4-0 (-> this flags)) (s5-0 (new 'stack-no-clear 'water-info)) ) - (when (logtest? (water-flags find-water) (-> obj flags)) - (water-info-init! (the-as collide-shape (-> obj process control)) s5-0 (collide-action solid semi-solid)) - (set! (-> obj flags) + (when (logtest? (water-flags find-water) (-> this flags)) + (water-info-init! (the-as collide-shape (-> this process control)) s5-0 (collide-action solid semi-solid)) + (set! (-> this flags) (logior (logclear - (-> obj flags) + (-> this flags) (water-flags active can-wade can-swim can-ground use-ocean tar mud use-water-anim swamp over-water) ) (logclear (-> s5-0 flags) (water-flags touch-water)) ) ) - (set! (-> obj base-height) (-> s5-0 base-height)) - (set! (-> obj base-ocean-offset) (- (-> s5-0 trans y) (-> s5-0 base-height))) + (set! (-> this base-height) (-> s5-0 base-height)) + (set! (-> this base-ocean-offset) (- (-> s5-0 trans y) (-> s5-0 base-height))) ) (cond - ((not (logtest? (-> obj flags) (water-flags active))) + ((not (logtest? (-> this flags) (water-flags active))) (logclear! - (-> obj flags) + (-> this flags) (water-flags under-water head-under-water bouncing wading swimming touch-water jump-out break-surface) ) ) - ((and (logtest? (-> obj flags) (water-flags no-grab-ground)) - (logtest? (-> obj process focus-status) (focus-status grabbed)) + ((and (logtest? (-> this flags) (water-flags no-grab-ground)) + (logtest? (-> this process focus-status) (focus-status grabbed)) ) - (logior! (-> obj flags) (water-flags jump-out)) - (logclear! (-> obj flags) (water-flags break-surface)) + (logior! (-> this flags) (water-flags jump-out)) + (logclear! (-> this flags) (water-flags break-surface)) ) ((begin - (set! (-> obj top 1 quad) (-> obj top 0 quad)) - (vector<-cspace! (the-as vector (-> obj top)) (-> obj process node-list data (-> obj joint-index))) - (+! (-> obj top 0 y) (-> obj top-y-offset)) - (set! (-> obj bottom 1 quad) (-> obj bottom 0 quad)) - (set! (-> obj bottom 0 quad) (-> obj process control trans quad)) - (logclear! (-> obj flags) (water-flags under-water head-under-water bouncing wading swimming break-surface)) - (set! (-> obj bob-offset) (update! (-> obj bob))) + (set! (-> this top 1 quad) (-> this top 0 quad)) + (vector<-cspace! (the-as vector (-> this top)) (-> this process node-list data (-> this joint-index))) + (+! (-> this top 0 y) (-> this top-y-offset)) + (set! (-> this bottom 1 quad) (-> this bottom 0 quad)) + (set! (-> this bottom 0 quad) (-> this process control trans quad)) + (logclear! (-> this flags) (water-flags under-water head-under-water bouncing wading swimming break-surface)) + (set! (-> this bob-offset) (update! (-> this bob))) (cond - ((logtest? (-> obj flags) (water-flags use-ocean use-water-anim)) - (if (not (logtest? (water-flags touch-water) (-> obj flags))) - (set! (-> obj ocean-offset) (-> obj base-ocean-offset)) - (set! (-> obj ocean-offset) (lerp (-> obj ocean-offset) (-> obj base-ocean-offset) 0.2)) + ((logtest? (-> this flags) (water-flags use-ocean use-water-anim)) + (if (not (logtest? (water-flags touch-water) (-> this flags))) + (set! (-> this ocean-offset) (-> this base-ocean-offset)) + (set! (-> this ocean-offset) (lerp (-> this ocean-offset) (-> this base-ocean-offset) 0.2)) ) - (set! (-> obj base-ocean-offset) 0.0) + (set! (-> this base-ocean-offset) 0.0) ) (else - (set! (-> obj base-ocean-offset) 0.0) - (set! (-> obj base-ocean-offset) 0.0) - (set! (-> obj ocean-offset) 0.0) + (set! (-> this base-ocean-offset) 0.0) + (set! (-> this base-ocean-offset) 0.0) + (set! (-> this ocean-offset) 0.0) ) ) - (if (logtest? (focus-status board pilot) (-> obj process focus-status)) - (set! (-> obj bob-offset) 0.0) + (if (logtest? (focus-status board pilot) (-> this process focus-status)) + (set! (-> this bob-offset) 0.0) ) - (set! (-> obj height) - (+ (-> obj base-height) (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)) + (set! (-> this height) + (+ (-> this base-height) (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)) ) - (set! (-> obj surface-height) (+ (-> obj base-height) (-> obj base-ocean-offset))) + (set! (-> this surface-height) (+ (-> this base-height) (-> this base-ocean-offset))) (cond - ((logtest? (focus-status board pilot) (-> obj process focus-status)) - (set! (-> obj collide-height) (+ -819.2 (-> obj base-ocean-offset) (-> obj base-height))) + ((logtest? (focus-status board pilot) (-> this process focus-status)) + (set! (-> this collide-height) (+ -819.2 (-> this base-ocean-offset) (-> this base-height))) ) - ((logtest? (-> obj flags) (water-flags swim-ground)) - (set! (-> obj collide-height) (- (-> obj height) (-> obj swim-height))) + ((logtest? (-> this flags) (water-flags swim-ground)) + (set! (-> this collide-height) (- (-> this height) (-> this swim-height))) ) (else - (set! (-> obj collide-height) (- (-> obj height) (-> obj bottom-height))) + (set! (-> this collide-height) (- (-> this height) (-> this bottom-height))) ) ) - (set! (-> obj swim-depth) (fmax 0.0 (- (- (-> obj surface-height) (-> obj swim-height)) (-> obj bottom 0 y)))) - (and (>= (-> obj height) (-> obj bottom 0 y)) (logtest? (water-flags touch-water) (-> s5-0 flags))) + (set! (-> this swim-depth) + (fmax 0.0 (- (- (-> this surface-height) (-> this swim-height)) (-> this bottom 0 y))) + ) + (and (>= (-> this height) (-> this bottom 0 y)) (logtest? (water-flags touch-water) (-> s5-0 flags))) ) - (if (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-water)) - (set! (-> obj on-water-time) (current-time)) + (if (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-water)) + (set-time! (-> this on-water-time)) ) - (when (not (logtest? (-> obj flags) (water-flags dark-eco lava))) - (set! (-> obj drip-wetness) 1.0) - (set! (-> obj drip-height) (fmax (- (-> obj surface-height) (-> obj bottom 0 y)) (-> obj drip-height))) - (set! (-> obj drip-speed) 15.0) + (when (not (logtest? (-> this flags) (water-flags dark-eco lava))) + (set! (-> this drip-wetness) 1.0) + (set! (-> this drip-height) (fmax (- (-> this surface-height) (-> this bottom 0 y)) (-> this drip-height))) + (set! (-> this drip-speed) 15.0) ) - (if (and (not (logtest? (water-flags touch-water) (-> obj flags))) - (not (logtest? (-> obj process focus-status) (focus-status touch-water))) + (if (and (not (logtest? (water-flags touch-water) (-> this flags))) + (not (logtest? (-> this process focus-status) (focus-status touch-water))) ) - (enter-water obj) + (enter-water this) ) - (logior! (-> obj flags) (water-flags touch-water)) + (logior! (-> this flags) (water-flags touch-water)) (cond - ((>= (-> obj top 0 y) (-> obj height)) + ((>= (-> this top 0 y) (-> this height)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> obj bottom 0 quad)) - (let ((v1-79 (-> obj process control transv))) + (set! (-> s3-0 quad) (-> this bottom 0 quad)) + (let ((v1-79 (-> this process control transv))) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z)))) ) - (logior! (-> obj flags) (water-flags break-surface)) - (set! (-> s3-0 y) (+ 40.96 (-> obj surface-height))) - (when (and (not (handle->process (-> obj ripple))) (>= (+ (current-time) (seconds -1.5)) (-> obj enter-water-time))) + (logior! (-> this flags) (water-flags break-surface)) + (set! (-> s3-0 y) (+ 40.96 (-> this surface-height))) + (when (and (not (handle->process (-> this ripple))) + (>= (+ (current-time) (seconds -1.5)) (-> this enter-water-time)) + ) (let* ((s1-0 (get-process *default-dead-pool* manipy #x4000)) (s2-0 (when s1-0 (let ((t9-6 (method-of-type manipy activate))) - (t9-6 (the-as manipy s1-0) (-> obj process) (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) + (t9-6 (the-as manipy s1-0) (-> this process) (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) ) (let ((s2-1 run-function-in-process) (s0-0 s1-0) ) (set! sv-272 manipy-init) (set! sv-288 s3-0) - (set! sv-304 (-> obj process entity)) + (set! sv-304 (-> this process entity)) (let ((t0-0 (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f))) (t1-0 #f) (t2-0 0) @@ -832,7 +836,7 @@ ) ) ) - (set! (-> obj ripple) (ppointer->handle s2-0)) + (set! (-> this ripple) (ppointer->handle s2-0)) (when s2-0 (send-event (ppointer->process s2-0) 'anim-mode 'loop) (send-event (ppointer->process s2-0) 'art-joint-anim "generic-ripples-cycle" 0) @@ -859,13 +863,13 @@ ) ) ) - (when (and (logtest? (-> obj process draw status) (draw-control-status on-screen)) - (zero? (-> obj process draw cur-lod)) - (logtest? (water-flags part-rings) (-> obj flags)) - (logtest? (water-flags part-water) (-> obj flags)) + (when (and (logtest? (-> this process draw status) (draw-control-status on-screen)) + (zero? (-> this process draw cur-lod)) + (logtest? (water-flags part-rings) (-> this flags)) + (logtest? (water-flags part-water) (-> this flags)) ) - (let* ((f30-0 (y-angle (-> obj process control))) - (v1-141 (-> obj process control transv)) + (let* ((f30-0 (y-angle (-> this process control))) + (v1-141 (-> this process control transv)) (f28-0 (sqrtf (+ (* (-> v1-141 x) (-> v1-141 x)) (* (-> v1-141 z) (-> v1-141 z))))) ) (set! (-> *part-id-table* 506 init-specs 4 initial-valuef) (+ 24576.0 f30-0)) @@ -873,119 +877,119 @@ (set! (-> *part-id-table* 506 init-specs 1 initial-valuef) (* 0.0000036621095 f28-0)) (set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (* 0.1 f28-0)) (set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111) - (set! (-> *part-id-table* 506 init-specs 3 initial-valuef) (-> obj wake-size)) - (set! (-> *part-id-table* 506 init-specs 5 initial-valuef) (-> obj wake-size)) + (set! (-> *part-id-table* 506 init-specs 3 initial-valuef) (-> this wake-size)) + (set! (-> *part-id-table* 506 init-specs 5 initial-valuef) (-> this wake-size)) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 506) s3-0) (set! (-> *part-id-table* 509 init-specs 1 initial-valuef) (* 0.000004150391 f28-0)) (set! (-> *part-id-table* 509 init-specs 18 initial-valuef) f30-0) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 509) s3-0) (when (< f28-0 4096.0) - (set! (-> *part-id-table* 504 init-specs 2 random-rangef) (-> obj ripple-size)) + (set! (-> *part-id-table* 504 init-specs 2 random-rangef) (-> this ripple-size)) (launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 504) s3-0) ) ) ) - (if (< (-> obj top 1 y) (-> obj height)) - (spawn-ripples obj 0.2 s3-0 1 (-> obj process control transv) #t) + (if (< (-> this top 1 y) (-> this height)) + (spawn-ripples this 0.2 s3-0 1 (-> this process control transv) #t) ) ) ) (else - (logior! (-> obj flags) (water-flags head-under-water)) + (logior! (-> this flags) (water-flags head-under-water)) ) ) - (when (and (logtest? (water-flags part-splash) (-> obj flags)) (logtest? (water-flags part-water) (-> obj flags))) + (when (and (logtest? (water-flags part-splash) (-> this flags)) (logtest? (water-flags part-water) (-> this flags))) (cond - ((logtest? (-> obj flags) (water-flags lava)) + ((logtest? (-> this flags) (water-flags lava)) ) - ((logtest? (-> obj flags) (water-flags dark-eco)) + ((logtest? (-> this flags) (water-flags dark-eco)) ) - ((logtest? (focus-status mech) (-> obj process focus-status)) + ((logtest? (focus-status mech) (-> this process focus-status)) ) (else - (let* ((v0-17 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) - (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data v0-17))) + (let* ((v0-17 (rand-vu-int-range 3 (+ (-> this process node-list length) -1))) + (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data v0-17))) ) - (when (< (-> s3-1 y) (-> obj surface-height)) - (set! (-> *part-id-table* 502 init-specs 16 initial-valuef) (-> obj surface-height)) - (let ((f0-72 (lerp-scale 12.0 0.4 (the float (- (current-time) (-> obj enter-water-time))) 0.0 600.0)) + (when (< (-> s3-1 y) (-> this surface-height)) + (set! (-> *part-id-table* 502 init-specs 16 initial-valuef) (-> this surface-height)) + (let ((f0-72 (lerp-scale 12.0 0.4 (the float (- (current-time) (-> this enter-water-time))) 0.0 600.0)) (f1-26 0.00012207031) - (v1-222 (-> obj process control transv)) + (v1-222 (-> this process control transv)) ) (set! (-> *part-id-table* 502 init-specs 1 initial-valuef) (+ f0-72 (* f1-26 (sqrtf (+ (* (-> v1-222 x) (-> v1-222 x)) (* (-> v1-222 z) (-> v1-222 z)))))) ) ) (launch-particles (-> *part-id-table* 502) s3-1) - (set! (-> *part-id-table* 503 init-specs 16 initial-valuef) (-> obj surface-height)) + (set! (-> *part-id-table* 503 init-specs 16 initial-valuef) (-> this surface-height)) (launch-particles (-> *part-id-table* 503) s3-1) ) ) ) ) ) - (let ((f30-1 (- (+ (-> obj base-height) (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)) - (-> obj swim-height) + (let ((f30-1 (- (+ (-> this base-height) (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)) + (-> this swim-height) ) ) ) - (let* ((s3-2 (-> obj process control)) + (let* ((s3-2 (-> this process control)) (v1-236 (if (type? s3-2 control-info) s3-2 ) ) - (v1-237 (and v1-236 (< (- (current-time) (-> v1-236 last-time-on-surface)) (seconds 0.5)))) + (v1-237 (and v1-236 (not (time-elapsed? (-> v1-236 last-time-on-surface) (seconds 0.5))))) ) - (if (and (logtest? (-> obj flags) (water-flags swim-ground)) + (if (and (logtest? (-> this flags) (water-flags swim-ground)) (and v1-237 - (not (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-water))) + (not (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-water))) ) ) - (set! (-> obj bob amp) (* 0.8 (-> obj bob amp))) + (set! (-> this bob amp) (* 0.8 (-> this bob amp))) ) (cond - ((and (logtest? (-> obj flags) (water-flags can-swim)) - (or (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-water)) - (>= f30-1 (-> obj bottom 0 y)) + ((and (logtest? (-> this flags) (water-flags can-swim)) + (or (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-water)) + (>= f30-1 (-> this bottom 0 y)) (and (logtest? (water-flags swimming) s4-0) - (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status touch-surface)) - (not (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status on-surface)) + (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status touch-surface)) + (not (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-surface)) ) - (>= (+ 204.8 f30-1) (-> obj bottom 0 y)) + (>= (+ 204.8 f30-1) (-> this bottom 0 y)) ) ) (or (logtest? (water-flags swimming) s4-0) (let ((f0-84 12288.0) - (a0-112 (-> obj process control transv)) + (a0-112 (-> this process control transv)) ) (< f0-84 (sqrtf (+ (* (-> a0-112 x) (-> a0-112 x)) (* (-> a0-112 z) (-> a0-112 z))))) ) - (< (+ (current-time) (seconds -0.2)) (-> obj enter-water-time)) - (or (>= (+ (- 204.8 (fmin 6144.0 (+ (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)))) f30-1) - (-> obj bottom 0 y) + (< (+ (current-time) (seconds -0.2)) (-> this enter-water-time)) + (or (>= (+ (- 204.8 (fmin 6144.0 (+ (-> this ocean-offset) (-> this bob-offset) (-> this align-offset)))) f30-1) + (-> this bottom 0 y) ) - (and (-> obj process next-state) (= (-> obj process next-state name) 'target-hit-ground)) + (and (-> this process next-state) (= (-> this process next-state name) 'target-hit-ground)) ) ) ) - (set! (-> obj swim-time) (current-time)) - (send-event (-> obj process) 'swim) - (logior! (-> obj flags) (water-flags swimming)) + (set-time! (-> this swim-time)) + (send-event (-> this process) 'swim) + (logior! (-> this flags) (water-flags swimming)) (if (not (logtest? (water-flags swimming) s4-0)) - (set! (-> obj enter-swim-time) (current-time)) + (set-time! (-> this enter-swim-time)) ) (cond - ((and (logtest? (-> obj flags) (water-flags swim-ground)) - (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) (collide-status touch-surface)) - (not (logtest? (water-flags jump-out) (-> obj flags))) + ((and (logtest? (-> this flags) (water-flags swim-ground)) + (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status touch-surface)) + (not (logtest? (water-flags jump-out) (-> this flags))) ) (let ((v1-260 (new 'stack-no-clear 'vector))) - (set! (-> v1-260 quad) (-> obj bottom 0 quad)) - (set! (-> v1-260 y) (- (-> obj height) (-> obj swim-height))) - (let ((s3-3 (the-as collide-shape-moving (-> obj process control)))) + (set! (-> v1-260 quad) (-> this bottom 0 quad)) + (set! (-> v1-260 y) (- (-> this height) (-> this swim-height))) + (let ((s3-3 (the-as collide-shape-moving (-> this process control)))) (when (and (not (logtest? (-> s3-3 status) (collide-status touch-background))) - (logtest? (water-flags swimming) (-> obj flags)) - (not (logtest? (focus-status board pilot) (-> obj process focus-status))) + (logtest? (water-flags swimming) (-> this flags)) + (not (logtest? (focus-status board pilot) (-> this process focus-status))) ) (let ((a1-42 (vector-! (new 'stack-no-clear 'vector) v1-260 (-> (the-as control-info s3-3) trans)))) (vector-float*! a1-42 a1-42 (-> pp clock frames-per-second)) @@ -998,39 +1002,38 @@ ) ) ) - ((and (< (-> obj bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> obj flags)))) - (logior! (-> obj flags) (water-flags under-water)) + ((and (< (-> this bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> this flags)))) + (logior! (-> this flags) (water-flags under-water)) ) ) ) ((begin - (set! v1-237 - (and (logtest? (-> obj flags) (water-flags can-wade)) - (or (not (!= (-> obj bob amp) 0.0)) (>= (- (current-time) (-> obj swim-time)) (seconds 0.05))) - (and (>= (- (-> obj height) (-> obj wade-height)) (-> obj bottom 0 y)) v1-237) - ) + (set! v1-237 (and (logtest? (-> this flags) (water-flags can-wade)) + (or (not (!= (-> this bob amp) 0.0)) (time-elapsed? (-> this swim-time) (seconds 0.05))) + (and (>= (- (-> this height) (-> this wade-height)) (-> this bottom 0 y)) v1-237) + ) ) v1-237 ) - (set! (-> obj wade-time) (current-time)) - (send-event (-> obj process) 'wade) - (logior! (-> obj flags) (water-flags wading)) + (set-time! (-> this wade-time)) + (send-event (-> this process) 'wade) + (logior! (-> this flags) (water-flags wading)) ) - ((and (< (-> obj bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> obj flags)))) - (logior! (-> obj flags) (water-flags under-water)) + ((and (< (-> this bottom 0 y) f30-1) (not (logtest? (water-flags jump-out) (-> this flags)))) + (logior! (-> this flags) (water-flags under-water)) ) ) ) - (when (and (logtest? (-> obj flags) (water-flags can-swim)) - (< (-> obj bottom 1 y) f30-1) - (and (< f30-1 (-> obj bottom 0 y)) (logtest? s4-0 (water-flags under-water))) + (when (and (logtest? (-> this flags) (water-flags can-swim)) + (< (-> this bottom 1 y) f30-1) + (and (< f30-1 (-> this bottom 0 y)) (logtest? s4-0 (water-flags under-water))) ) - (logior! (-> obj flags) (water-flags swimming)) + (logior! (-> this flags) (water-flags swimming)) (let ((a1-47 (new 'stack-no-clear 'vector))) - (set! (-> a1-47 quad) (-> obj bottom 0 quad)) - (let ((s4-1 (the-as collide-shape-moving (-> obj process control)))) + (set! (-> a1-47 quad) (-> this bottom 0 quad)) + (let ((s4-1 (the-as collide-shape-moving (-> this process control)))) (set! (-> a1-47 y) f30-1) - (when (not (logtest? (focus-status board pilot) (-> obj process focus-status))) + (when (not (logtest? (focus-status board pilot) (-> this process focus-status))) (let ((f30-2 (-> s4-1 ground-impact-vel))) (move-to-ground-point s4-1 a1-47 (-> (the-as control-info s4-1) transv) *up-vector*) (set! (-> (the-as control-info s4-1) status) (logior (-> s4-1 status) (collide-status on-water))) @@ -1041,115 +1044,122 @@ ) ) ) - (when (= (-> obj process type) target) + (when (= (-> this process type) target) (cond - ((logtest? (-> obj flags) (water-flags tar)) - (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) + ((logtest? (-> this flags) (water-flags tar)) + (when (and (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-surface on-water) ) - (not (logtest? (focus-status board pilot) (-> obj process focus-status))) + (not (logtest? (focus-status board pilot) (-> this process focus-status))) ) - (when (< (-> obj process control trans y) (+ -1228.8 (-> obj base-height))) - (send-event (-> obj process) 'no-look-around (seconds 1.5)) - (if (not (logtest? (-> obj process focus-status) (focus-status flut))) + (when (< (-> this process control trans y) (+ -1228.8 (-> this base-height))) + (send-event (-> this process) 'no-look-around (seconds 1.5)) + (if (not (logtest? (-> this process focus-status) (focus-status flut))) (send-event - (-> obj process) + (-> this process) 'attack #f - (static-attack-info ((id (-> obj attack-id)) (shove-up (meters 0.5)) (shove-back (meters 0)) (mode 'tar))) + (static-attack-info ((id (-> this attack-id)) (shove-up (meters 0.5)) (shove-back (meters 0)) (mode 'tar))) ) ) - (let ((v1-329 (-> obj process))) + (let ((v1-329 (-> this process))) (set! (-> v1-329 control surf) *tar-surface*) (set! (-> v1-329 control ground-pat) (copy-and-set-field (-> (the-as collide-shape-moving (-> v1-329 control)) ground-pat) material 4) ) ) ) - (set! (-> obj swim-height) (lerp (-> obj swim-height) 7372.8 0.05)) + (set! (-> this swim-height) (lerp (-> this swim-height) 7372.8 0.05)) ) ) - ((logtest? (-> obj flags) (water-flags lava)) - (when (logtest? (-> (the-as collide-shape-moving (-> obj process control)) status) + ((logtest? (-> this flags) (water-flags lava)) + (when (logtest? (-> (the-as collide-shape-moving (-> this process control)) status) (collide-status on-surface on-water) ) - (when (< (-> obj process control trans y) (+ -204.8 (-> obj base-height))) - (send-event (-> obj process) 'no-look-around (seconds 1.5)) - (send-event (-> obj process) 'attack #f (static-attack-info ((id (the-as uint 2)) - (shove-up (meters 0.5)) - (shove-back (meters 0)) - (mode 'melt) - (intersection (-> s5-0 trans)) + (when (< (-> this process control trans y) (+ -204.8 (-> this base-height))) + (send-event (-> this process) 'no-look-around (seconds 1.5)) + (send-event (-> this process) 'attack #f (static-attack-info ((id (the-as uint 2)) + (shove-up (meters 0.5)) + (shove-back (meters 0)) + (mode 'melt) + (intersection (-> s5-0 trans)) + ) ) - ) ) ) - (set! (-> obj swim-height) (lerp (-> obj swim-height) 7372.8 0.05)) + (set! (-> this swim-height) (lerp (-> this swim-height) 7372.8 0.05)) ) ) - ((and (logtest? (focus-status dark) (-> obj process focus-status)) - (nonzero? (-> obj process darkjak)) - (logtest? (-> obj process darkjak stage) (darkjak-stage giant)) + ((and (logtest? (focus-status dark) (-> this process focus-status)) + (nonzero? (-> this process darkjak)) + (logtest? (-> this process darkjak stage) (darkjak-stage giant)) ) - (set! (-> obj swim-height) 16384.0) + (set! (-> this swim-height) 16384.0) ) (else - (set! (-> obj swim-height) 8192.0) + (set! (-> this swim-height) 8192.0) ) ) ) ) (else - (if (logtest? (water-flags touch-water) (-> obj flags)) - (water-control-method-16 obj) + (if (logtest? (water-flags touch-water) (-> this flags)) + (water-control-method-16 this) ) ) ) ) - (when (not (or (not (logtest? (water-flags part-drip) (-> obj flags))) - (not (logtest? (water-flags part-water) (-> obj flags))) - (= (-> obj drip-wetness) 0.0) + (when (not (or (not (logtest? (water-flags part-drip) (-> this flags))) + (not (logtest? (water-flags part-water) (-> this flags))) + (= (-> this drip-wetness) 0.0) ) ) (cond - ((logtest? (water-flags spawn-drip) (-> obj flags)) + ((logtest? (water-flags spawn-drip) (-> this flags)) (let ((v0-34 - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data (-> obj drip-joint-index))) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data (-> this drip-joint-index))) ) ) - (set! (-> *part-id-table* 537 init-specs 18 initial-valuef) (-> obj surface-height)) - (set! (-> *part-id-table* 537 init-specs 10 initial-valuef) (* 0.05 (- (-> v0-34 x) (-> obj drip-old-pos x)))) - (set! (-> *part-id-table* 537 init-specs 11 initial-valuef) (* 0.05 (- (-> v0-34 y) (-> obj drip-old-pos y)))) - (set! (-> *part-id-table* 537 init-specs 12 initial-valuef) (* 0.05 (- (-> v0-34 z) (-> obj drip-old-pos z)))) + (set! (-> *part-id-table* 537 init-specs 18 initial-valuef) (-> this surface-height)) + (set! (-> *part-id-table* 537 init-specs 10 initial-valuef) + (* 0.05 (- (-> v0-34 x) (-> this drip-old-pos x))) + ) + (set! (-> *part-id-table* 537 init-specs 11 initial-valuef) + (* 0.05 (- (-> v0-34 y) (-> this drip-old-pos y))) + ) + (set! (-> *part-id-table* 537 init-specs 12 initial-valuef) + (* 0.05 (- (-> v0-34 z) (-> this drip-old-pos z))) + ) (launch-particles (-> *part-id-table* 537) v0-34) ) - (set! (-> obj drip-time) (current-time)) - (logclear! (-> obj flags) (water-flags spawn-drip)) - (seek! (-> obj drip-wetness) 0.0 (* 0.001 (-> obj drip-speed))) - (set! (-> obj drip-speed) (* 1.05 (-> obj drip-speed))) - (if (= (-> obj drip-wetness) 0.0) - (set! (-> obj drip-height) 0.0) + (set-time! (-> this drip-time)) + (logclear! (-> this flags) (water-flags spawn-drip)) + (seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed))) + (set! (-> this drip-speed) (* 1.05 (-> this drip-speed))) + (if (= (-> this drip-wetness) 0.0) + (set! (-> this drip-height) 0.0) ) ) - ((>= (- (current-time) (the-as time-frame (the int (/ (the float (-> obj drip-time)) (-> obj drip-mult))))) - (the int (-> obj drip-speed)) - ) - (let* ((s5-1 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) - (v0-38 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-1))) + ((time-elapsed? + (the-as time-frame (the int (/ (the float (-> this drip-time)) (-> this drip-mult)))) + (the int (-> this drip-speed)) + ) + (let* ((s5-1 (rand-vu-int-range 3 (+ (-> this process node-list length) -1))) + (v0-38 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-1))) ) - (when (and (< (- (-> v0-38 y) (-> obj process control trans y)) (-> obj drip-height)) - (< (-> obj height) (-> v0-38 y)) + (when (and (< (- (-> v0-38 y) (-> this process control trans y)) (-> this drip-height)) + (< (-> this height) (-> v0-38 y)) ) - (set! (-> obj drip-joint-index) s5-1) - (set! (-> obj drip-old-pos quad) (-> v0-38 quad)) - (logior! (-> obj flags) (water-flags spawn-drip)) + (set! (-> this drip-joint-index) s5-1) + (set! (-> this drip-old-pos quad) (-> v0-38 quad)) + (logior! (-> this flags) (water-flags spawn-drip)) ) ) ) ) ) - (if (and (not (logtest? (water-flags break-surface) (-> obj flags))) (handle->process (-> obj ripple))) - (send-event (handle->process (-> obj ripple)) 'die) + (if (and (not (logtest? (water-flags break-surface) (-> this flags))) (handle->process (-> this ripple))) + (send-event (handle->process (-> this ripple)) 'die) ) 0 (none) @@ -1158,9 +1168,9 @@ ;; definition for method 11 of type water-control ;; WARN: Return type mismatch int vs none. -(defmethod start-bobbing! water-control ((obj water-control) (arg0 float) (arg1 int) (arg2 int)) +(defmethod start-bobbing! water-control ((this water-control) (arg0 float) (arg1 int) (arg2 int)) (with-pp - (activate! (-> obj bob) (- arg0) arg1 arg2 0.9 1.0 (-> pp clock)) + (activate! (-> this bob) (- arg0) arg1 arg2 0.9 1.0 (-> pp clock)) 0 (none) ) @@ -1251,32 +1261,32 @@ ;; definition for method 15 of type water-control ;; WARN: Return type mismatch int vs none. -(defmethod enter-water water-control ((obj water-control)) +(defmethod enter-water water-control ((this water-control)) (with-pp - (logior! (-> obj flags) (water-flags touch-water)) - (logclear! (-> obj flags) (water-flags jump-out)) - (set! (-> obj enter-water-time) (current-time)) - (set-vector! (-> obj enter-water-pos) (-> obj bottom 0 x) (-> obj surface-height) (-> obj bottom 0 z) 1.0) - (when (and (logtest? (water-flags part-splash) (-> obj flags)) (logtest? (water-flags part-water) (-> obj flags))) + (logior! (-> this flags) (water-flags touch-water)) + (logclear! (-> this flags) (water-flags jump-out)) + (set-time! (-> this enter-water-time)) + (set-vector! (-> this enter-water-pos) (-> this bottom 0 x) (-> this surface-height) (-> this bottom 0 z) 1.0) + (when (and (logtest? (water-flags part-splash) (-> this flags)) (logtest? (water-flags part-water) (-> this flags))) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 1) (set! (-> a1-1 message) 'query) (set! (-> a1-1 param 0) (the-as uint 'ground-height)) - (let* ((f0-4 (the-as float (send-event-function (-> obj process) a1-1))) + (let* ((f0-4 (the-as float (send-event-function (-> this process) a1-1))) (f30-0 (lerp-scale 0.3 1.0 f0-4 2048.0 24576.0)) ) - (when (not (logtest? (-> obj flags) (water-flags dark-eco lava))) - (if (nonzero? (-> obj process skel effect)) + (when (not (logtest? (-> this flags) (water-flags dark-eco lava))) + (if (nonzero? (-> this process skel effect)) (sound-play "swim-enter") ) - (spawn-ripples obj f30-0 (-> obj enter-water-pos) 1 (-> obj process control transv) #t) + (spawn-ripples this f30-0 (-> this enter-water-pos) 1 (-> this process control transv) #t) ) ) ) ) - (if (logtest? (-> obj flags) (water-flags tar lava)) - (set! (-> obj swim-height) 2867.2) + (if (logtest? (-> this flags) (water-flags tar lava)) + (set! (-> this swim-height) 2867.2) ) 0 (none) @@ -1285,11 +1295,11 @@ ;; definition for method 16 of type water-control ;; WARN: Return type mismatch int vs none. -(defmethod water-control-method-16 water-control ((obj water-control)) - (logclear! (-> obj flags) (water-flags touch-water)) - (set-zero! (-> obj bob)) - (if (logtest? (-> obj flags) (water-flags tar lava)) - (set! (-> obj swim-height) 2867.2) +(defmethod water-control-method-16 water-control ((this water-control)) + (logclear! (-> this flags) (water-flags touch-water)) + (set-zero! (-> this bob)) + (if (logtest? (-> this flags) (water-flags tar lava)) + (set! (-> this swim-height) 2867.2) ) 0 (none) @@ -1370,24 +1380,24 @@ ;; definition for method 13 of type water-control ;; WARN: Return type mismatch int vs none. -(defmethod spawn-ripples water-control ((obj water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector) (arg4 symbol)) - (when (and (logtest? (water-flags part-splash) (-> obj flags)) (logtest? (water-flags part-water) (-> obj flags))) +(defmethod spawn-ripples water-control ((this water-control) (arg0 float) (arg1 vector) (arg2 int) (arg3 vector) (arg4 symbol)) + (when (and (logtest? (water-flags part-splash) (-> this flags)) (logtest? (water-flags part-water) (-> this flags))) (let ((s4-1 (vector+float*! (new 'stack-no-clear 'vector) arg1 arg3 0.05))) - (set! (-> s4-1 y) (+ 40.96 (-> obj surface-height))) - (if (>= (- (current-time) (-> obj distort-time)) (seconds 0.1)) + (set! (-> s4-1 y) (+ 40.96 (-> this surface-height))) + (if (time-elapsed? (-> this distort-time) (seconds 0.1)) (splash-spawn arg0 s4-1 arg2) ) - (when (and arg4 (>= (- (current-time) (-> obj distort-time)) (seconds 0.3))) - (set! (-> obj distort-time) (current-time)) + (when (and arg4 (time-elapsed? (-> this distort-time) (seconds 0.3))) + (set-time! (-> this distort-time)) (let ((s3-1 (process-spawn manipy :init manipy-init s4-1 - (-> obj process entity) + (-> this process entity) (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f)) #f 0 - :to (-> obj process) + :to (-> this process) ) ) ) @@ -1545,7 +1555,7 @@ ;; definition for method 52 of type collide-shape ;; INFO: Used lq/sq -(defmethod water-info-init! collide-shape ((obj collide-shape) (arg0 water-info) (arg1 collide-action)) +(defmethod water-info-init! collide-shape ((this collide-shape) (arg0 water-info) (arg1 collide-action)) "Initialize a [[water-info]] with the currently loaded regions." (local-vars (sv-80 int)) (let ((s3-0 (new 'stack 'water-info))) @@ -1556,7 +1566,7 @@ (set! (-> s3-0 extra-flags) (the-as uint 0)) (set! (-> (the-as region-prim-area #x70000000) region-prim-list num-items) 0) (set! (-> (the-as region-prim-area #x70000000) region-inside-count) 0) - (set! (-> (the-as region-prim-area #x70000000) pos quad) (-> obj root-prim prim-core world-sphere quad)) + (set! (-> (the-as region-prim-area #x70000000) pos quad) (-> this root-prim prim-core world-sphere quad)) (dotimes (s2-0 (-> *level* length)) (let ((v1-8 (-> *level* level s2-0))) (when (= (-> v1-8 status) 'active) @@ -1585,7 +1595,7 @@ ) ) (countdown (s2-1 (-> (the-as region-prim-area #x70000000) region-prim-list num-items)) - (water-info<-region s3-0 (-> (the-as region-prim-area #x70000000) region-prim-list items s2-1) obj arg1) + (water-info<-region s3-0 (-> (the-as region-prim-area #x70000000) region-prim-list items s2-1) this arg1) (when (and (logtest? (-> s3-0 flags) (water-flags active)) (logtest? (water-flags touch-water) (-> s3-0 flags)) (not (logtest? (-> s3-0 extra-flags) 1)) diff --git a/test/decompiler/reference/jak2/engine/data/art-h_REF.gc b/test/decompiler/reference/jak2/engine/data/art-h_REF.gc index 490abec631..585a93b576 100644 --- a/test/decompiler/reference/jak2/engine/data/art-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/data/art-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type joint-anim -(defmethod inspect joint-anim ((obj joint-anim)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-anim ((this joint-anim)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tnumber: ~D~%" (-> obj number)) - (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnumber: ~D~%" (-> this number)) + (format #t "~1Tlength: ~D~%" (-> this length)) (label cfg-4) - obj + this ) ;; definition of type joint-anim-matrix @@ -45,21 +45,21 @@ ) ;; definition for method 3 of type joint-anim-transformq -(defmethod inspect joint-anim-transformq ((obj joint-anim-transformq)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-anim-transformq ((this joint-anim-transformq)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tnumber: ~D~%" (-> obj number)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D]~1Tdata: ~`transformq`P~%" s5-0 (-> obj data s5-0)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnumber: ~D~%" (-> this number)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D]~1Tdata: ~`transformq`P~%" s5-0 (-> this data s5-0)) ) (label cfg-7) - obj + this ) ;; definition of type joint-anim-drawable @@ -72,18 +72,18 @@ ) ;; definition for method 3 of type joint-anim-drawable -(defmethod inspect joint-anim-drawable ((obj joint-anim-drawable)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-anim-drawable ((this joint-anim-drawable)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tnumber: ~D~%" (-> obj number)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnumber: ~D~%" (-> this number)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type joint-anim-frame @@ -100,16 +100,16 @@ ) ;; definition for method 3 of type joint-anim-frame -(defmethod inspect joint-anim-frame ((obj joint-anim-frame)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-anim-frame ((this joint-anim-frame)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'joint-anim-frame) - (format #t "~1Tmatrices[2] @ #x~X~%" (-> obj matrices)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'joint-anim-frame) + (format #t "~1Tmatrices[2] @ #x~X~%" (-> this matrices)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for method 0 of type joint-anim-frame @@ -135,17 +135,17 @@ ) ;; definition for method 3 of type joint-anim-compressed-hdr -(defmethod inspect joint-anim-compressed-hdr ((obj joint-anim-compressed-hdr)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-anim-compressed-hdr ((this joint-anim-compressed-hdr)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-hdr) - (format #t "~1Tcontrol-bits[14] @ #x~X~%" (-> obj control-bits)) - (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~1Tmatrix-bits: ~D~%" (-> obj matrix-bits)) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-hdr) + (format #t "~1Tcontrol-bits[14] @ #x~X~%" (-> this control-bits)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Tmatrix-bits: ~D~%" (-> this matrix-bits)) (label cfg-4) - obj + this ) ;; definition of type joint-anim-compressed-fixed @@ -163,20 +163,20 @@ ) ;; definition for method 3 of type joint-anim-compressed-fixed -(defmethod inspect joint-anim-compressed-fixed ((obj joint-anim-compressed-fixed)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-anim-compressed-fixed ((this joint-anim-compressed-fixed)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-fixed) - (format #t "~1Thdr: #~%" (-> obj hdr)) - (format #t "~1Toffset-64: ~D~%" (-> obj offset-64)) - (format #t "~1Toffset-32: ~D~%" (-> obj offset-32)) - (format #t "~1Toffset-16: ~D~%" (-> obj offset-16)) - (format #t "~1Treserved: ~D~%" (-> obj reserved)) - (format #t "~1Tdata[133] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-fixed) + (format #t "~1Thdr: #~%" (-> this hdr)) + (format #t "~1Toffset-64: ~D~%" (-> this offset-64)) + (format #t "~1Toffset-32: ~D~%" (-> this offset-32)) + (format #t "~1Toffset-16: ~D~%" (-> this offset-16)) + (format #t "~1Treserved: ~D~%" (-> this reserved)) + (format #t "~1Tdata[133] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type joint-anim-compressed-frame @@ -193,19 +193,19 @@ ) ;; definition for method 3 of type joint-anim-compressed-frame -(defmethod inspect joint-anim-compressed-frame ((obj joint-anim-compressed-frame)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-anim-compressed-frame ((this joint-anim-compressed-frame)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-frame) - (format #t "~1Toffset-64: ~D~%" (-> obj offset-64)) - (format #t "~1Toffset-32: ~D~%" (-> obj offset-32)) - (format #t "~1Toffset-16: ~D~%" (-> obj offset-16)) - (format #t "~1Treserved: ~D~%" (-> obj reserved)) - (format #t "~1Tdata[133] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-frame) + (format #t "~1Toffset-64: ~D~%" (-> this offset-64)) + (format #t "~1Toffset-32: ~D~%" (-> this offset-32)) + (format #t "~1Toffset-16: ~D~%" (-> this offset-16)) + (format #t "~1Treserved: ~D~%" (-> this reserved)) + (format #t "~1Tdata[133] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type joint-anim-compressed-control @@ -223,20 +223,20 @@ ) ;; definition for method 3 of type joint-anim-compressed-control -(defmethod inspect joint-anim-compressed-control ((obj joint-anim-compressed-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect joint-anim-compressed-control ((this joint-anim-compressed-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-control) - (format #t "~1Tnum-frames: ~D~%" (-> obj num-frames)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tfixed-qwc: ~D~%" (-> obj fixed-qwc)) - (format #t "~1Tframe-qwc: ~D~%" (-> obj frame-qwc)) - (format #t "~1Tfixed: #~%" (-> obj fixed)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'joint-anim-compressed-control) + (format #t "~1Tnum-frames: ~D~%" (-> this num-frames)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tfixed-qwc: ~D~%" (-> this fixed-qwc)) + (format #t "~1Tframe-qwc: ~D~%" (-> this frame-qwc)) + (format #t "~1Tfixed: #~%" (-> this fixed)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type art @@ -257,17 +257,17 @@ ) ;; definition for method 3 of type art -(defmethod inspect art ((obj art)) - (when (not obj) - (set! obj obj) +(defmethod inspect art ((this art)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Textra: ~A~%" (-> obj extra)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) (label cfg-4) - obj + this ) ;; definition of type art-element @@ -280,17 +280,17 @@ ) ;; definition for method 3 of type art-element -(defmethod inspect art-element ((obj art-element)) - (when (not obj) - (set! obj obj) +(defmethod inspect art-element ((this art-element)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Textra: ~A~%" (-> obj extra)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) (label cfg-4) - obj + this ) ;; definition of type art-mesh-anim @@ -319,25 +319,25 @@ ) ;; definition for method 3 of type art-joint-anim -(defmethod inspect art-joint-anim ((obj art-joint-anim)) - (when (not obj) - (set! obj obj) +(defmethod inspect art-joint-anim ((this art-joint-anim)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Textra: ~A~%" (-> obj extra)) - (format #t "~1Tspeed: ~f~%" (-> obj speed)) - (format #t "~1Tartist-base: ~f~%" (-> obj artist-base)) - (format #t "~1Tartist-step: ~f~%" (-> obj artist-step)) - (format #t "~1Teye-anim: ~A~%" (-> obj eye-anim)) - (format #t "~1Tmaster-art-group-name: ~A~%" (-> obj master-art-group-name)) - (format #t "~1Tmaster-art-group-index: ~D~%" (-> obj master-art-group-index)) - (format #t "~1Tblend-shape-anim: ~A~%" (-> obj blend-shape-anim)) - (format #t "~1Tframes: #~%" (-> obj frames)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Tartist-base: ~f~%" (-> this artist-base)) + (format #t "~1Tartist-step: ~f~%" (-> this artist-step)) + (format #t "~1Teye-anim: ~A~%" (-> this eye-anim)) + (format #t "~1Tmaster-art-group-name: ~A~%" (-> this master-art-group-name)) + (format #t "~1Tmaster-art-group-index: ~D~%" (-> this master-art-group-index)) + (format #t "~1Tblend-shape-anim: ~A~%" (-> this blend-shape-anim)) + (format #t "~1Tframes: #~%" (-> this frames)) (label cfg-4) - obj + this ) ;; definition of type art-group @@ -385,17 +385,17 @@ ) ;; definition for method 3 of type art-joint-anim-manager-slot -(defmethod inspect art-joint-anim-manager-slot ((obj art-joint-anim-manager-slot)) - (when (not obj) - (set! obj obj) +(defmethod inspect art-joint-anim-manager-slot ((this art-joint-anim-manager-slot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'art-joint-anim-manager-slot) - (format #t "~1Tanim: ~A~%" (-> obj anim)) - (format #t "~1Tcomp-data: #x~X~%" (-> obj comp-data)) - (format #t "~1Ttime-stamp: ~D~%" (-> obj time-stamp)) + (format #t "[~8x] ~A~%" this 'art-joint-anim-manager-slot) + (format #t "~1Tanim: ~A~%" (-> this anim)) + (format #t "~1Tcomp-data: #x~X~%" (-> this comp-data)) + (format #t "~1Ttime-stamp: ~D~%" (-> this time-stamp)) (label cfg-4) - obj + this ) ;; definition of type art-joint-anim-manager @@ -418,20 +418,20 @@ ) ;; definition for method 3 of type art-joint-anim-manager -(defmethod inspect art-joint-anim-manager ((obj art-joint-anim-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect art-joint-anim-manager ((this art-joint-anim-manager)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Theap: #~%" (-> obj kheap)) - (format #t "~1Tfree-index: ~D~%" (-> obj free-index)) - (format #t "~1Tslot[64] @ #x~X~%" (-> obj slot)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Theap: #~%" (-> this kheap)) + (format #t "~1Tfree-index: ~D~%" (-> this free-index)) + (format #t "~1Tslot[64] @ #x~X~%" (-> this slot)) (dotimes (s5-0 64) - (format #t "~T [~D]~1Tslot: ~`art-joint-anim-manager-slot`P~%" s5-0 (-> obj slot s5-0)) + (format #t "~T [~D]~1Tslot: ~`art-joint-anim-manager-slot`P~%" s5-0 (-> this slot s5-0)) ) (label cfg-7) - obj + this ) ;; definition for method 0 of type art-joint-anim-manager @@ -480,35 +480,35 @@ ) ;; definition for method 3 of type skeleton-group -(defmethod inspect skeleton-group ((obj skeleton-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect skeleton-group ((this skeleton-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Textra: ~A~%" (-> obj extra)) - (format #t "~1Tinfo: ~A~%" (-> obj info)) - (format #t "~1Tdata[0] @ #x~X~%" (&-> obj art-group-name)) - (format #t "~1Tart-group-name: ~A~%" (-> obj art-group-name)) - (format #t "~1Tjgeo: ~D~%" (-> obj jgeo)) - (format #t "~1Tjanim: ~D~%" (-> obj janim)) - (format #t "~1Tbounds: ~`vector`P~%" (-> obj bounds)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj bounds w)) - (format #t "~1Tmgeo[6] @ #x~X~%" (-> obj mgeo)) - (format #t "~1Tmax-lod: ~D~%" (-> obj max-lod)) - (format #t "~1Tlod-dist[6] @ #x~X~%" (-> obj lod-dist)) - (format #t "~1Tlongest-edge: (meters ~m)~%" (-> obj longest-edge)) - (format #t "~1Ttexture-level: ~D~%" (-> obj texture-level)) - (format #t "~1Tversion: ~D~%" (-> obj version)) - (format #t "~1Tshadow: ~D~%" (-> obj shadow)) - (format #t "~1Tsort: ~D~%" (-> obj sort)) - (format #t "~1Torigin-joint-index: ~D~%" (-> obj origin-joint-index)) - (format #t "~1Tshadow-joint-index: ~D~%" (-> obj shadow-joint-index)) - (format #t "~1Tlight-index: ~D~%" (-> obj light-index)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (format #t "~1Tdata[0] @ #x~X~%" (&-> this art-group-name)) + (format #t "~1Tart-group-name: ~A~%" (-> this art-group-name)) + (format #t "~1Tjgeo: ~D~%" (-> this jgeo)) + (format #t "~1Tjanim: ~D~%" (-> this janim)) + (format #t "~1Tbounds: ~`vector`P~%" (-> this bounds)) + (format #t "~1Tradius: (meters ~m)~%" (-> this bounds w)) + (format #t "~1Tmgeo[6] @ #x~X~%" (-> this mgeo)) + (format #t "~1Tmax-lod: ~D~%" (-> this max-lod)) + (format #t "~1Tlod-dist[6] @ #x~X~%" (-> this lod-dist)) + (format #t "~1Tlongest-edge: (meters ~m)~%" (-> this longest-edge)) + (format #t "~1Ttexture-level: ~D~%" (-> this texture-level)) + (format #t "~1Tversion: ~D~%" (-> this version)) + (format #t "~1Tshadow: ~D~%" (-> this shadow)) + (format #t "~1Tsort: ~D~%" (-> this sort)) + (format #t "~1Torigin-joint-index: ~D~%" (-> this origin-joint-index)) + (format #t "~1Tshadow-joint-index: ~D~%" (-> this shadow-joint-index)) + (format #t "~1Tlight-index: ~D~%" (-> this light-index)) (label cfg-4) - obj + this ) ;; definition of type lod-group @@ -523,16 +523,16 @@ ) ;; definition for method 3 of type lod-group -(defmethod inspect lod-group ((obj lod-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect lod-group ((this lod-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'lod-group) - (format #t "~1Tgeo: ~A~%" (-> obj geo)) - (format #t "~1Tdist: (meters ~m)~%" (-> obj dist)) + (format #t "[~8x] ~A~%" this 'lod-group) + (format #t "~1Tgeo: ~A~%" (-> this geo)) + (format #t "~1Tdist: (meters ~m)~%" (-> this dist)) (label cfg-4) - obj + this ) ;; definition of type lod-set @@ -549,16 +549,16 @@ ) ;; definition for method 3 of type lod-set -(defmethod inspect lod-set ((obj lod-set)) - (when (not obj) - (set! obj obj) +(defmethod inspect lod-set ((this lod-set)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'lod-set) - (format #t "~1Tlod[6] @ #x~X~%" (-> obj lod)) - (format #t "~1Tmax-lod: ~D~%" (-> obj max-lod)) + (format #t "[~8x] ~A~%" this 'lod-set) + (format #t "~1Tlod[6] @ #x~X~%" (-> this lod)) + (format #t "~1Tmax-lod: ~D~%" (-> this max-lod)) (label cfg-4) - obj + this ) ;; definition of type draw-control @@ -619,15 +619,15 @@ ) ;; definition for method 3 of type draw-control -(defmethod inspect draw-control ((obj draw-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect draw-control ((this draw-control)) + (when (not this) + (set! this this) (goto cfg-47) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tstatus: #x~X : (draw-control-status " (-> obj status)) - (let ((s5-0 (-> obj status))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tstatus: #x~X : (draw-control-status " (-> this status)) + (let ((s5-0 (-> this status))) (if (= (logand s5-0 (draw-control-status no-draw-temp)) (draw-control-status no-draw-temp)) (format #t "no-draw-temp ") ) @@ -678,8 +678,8 @@ (let ((t9-19 format) (a0-35 #t) (a1-19 "~1Tdata-format: #x~X : ~S~%") - (a2-3 (-> obj data-format)) - (v1-47 (-> obj data-format)) + (a2-3 (-> this data-format)) + (v1-47 (-> this data-format)) ) (t9-19 a0-35 a1-19 a2-3 (cond ((= v1-47 (draw-control-data-format merc)) @@ -694,8 +694,8 @@ ) ) ) - (format #t "~1Tglobal-effect: #x~X : (draw-control-global-effect " (-> obj global-effect)) - (let ((s5-1 (-> obj global-effect))) + (format #t "~1Tglobal-effect: #x~X : (draw-control-global-effect " (-> this global-effect)) + (let ((s5-1 (-> this global-effect))) (if (= (logand s5-1 (draw-control-global-effect title-light)) (draw-control-global-effect title-light)) (format #t "title-light ") ) @@ -710,50 +710,50 @@ ) ) (format #t ")~%") - (format #t "~1Tart-group: ~A~%" (-> obj art-group)) - (format #t "~1Tjgeo: ~A~%" (-> obj jgeo)) - (format #t "~1Tmgeo: ~A~%" (-> obj mgeo)) - (format #t "~1Tdma-add-func: ~A~%" (-> obj dma-add-func)) - (format #t "~1Tskeleton: ~A~%" (-> obj skeleton)) - (format #t "~1Tlod-set: #~%" (-> obj lod-set)) - (format #t "~1Tlod[6] @ #x~X~%" (-> obj lod-set)) - (format #t "~1Tmax-lod: ~D~%" (-> obj lod-set max-lod)) - (format #t "~1Tforce-lod: ~D~%" (-> obj force-lod)) - (format #t "~1Tcur-lod: ~D~%" (-> obj cur-lod)) - (format #t "~1Tdesired-lod: ~D~%" (-> obj desired-lod)) - (format #t "~1Tripple: ~A~%" (-> obj ripple)) - (format #t "~1Tlongest-edge: (meters ~m)~%" (-> obj longest-edge)) - (format #t "~1Tlongest-edge?: ~D~%" (-> obj longest-edge)) - (format #t "~1Tlight-index: ~D~%" (-> obj light-index)) - (format #t "~1Tshadow-mask: ~D~%" (-> obj shadow-mask)) - (format #t "~1Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~1Tdeath-draw-overlap: ~D~%" (-> obj death-draw-overlap)) - (format #t "~1Tdeath-timer: ~D~%" (-> obj death-timer)) - (format #t "~1Tdeath-timer-org: ~D~%" (-> obj death-timer-org)) - (format #t "~1Tdeath-vertex-skip: ~D~%" (-> obj death-vertex-skip)) - (format #t "~1Tdeath-effect: ~D~%" (-> obj death-effect)) - (format #t "~1Tshadow: ~A~%" (-> obj shadow)) - (format #t "~1Tshadow-ctrl: ~A~%" (-> obj shadow-ctrl)) - (format #t "~1Tdistance: (meters ~m)~%" (-> obj distance)) - (format #t "~1Torigin: ~`vector`P~%" (-> obj origin)) - (format #t "~1Tbounds: ~`vector`P~%" (-> obj bounds)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj bounds w)) - (format #t "~1Tcolor-mult: #~%" (-> obj color-mult)) - (format #t "~1Tcolor-emissive: #~%" (-> obj color-emissive)) - (format #t "~1Teffect-mask: #x~X~%" (-> obj effect-mask)) - (format #t "~1Tseg-mask: #x~X~%" (-> obj seg-mask)) - (format #t "~1Torigin-joint-index: ~D~%" (-> obj origin-joint-index)) - (format #t "~1Tshadow-joint-index: ~D~%" (-> obj shadow-joint-index)) - (format #t "~1Tforce-fade: ~D~%" (-> obj force-fade)) - (format #t "~1Tdefault-texture-page: ~D~%" (-> obj default-texture-page)) - (format #t "~1Tshadow-values: ~D~%" (-> obj shadow-values)) + (format #t "~1Tart-group: ~A~%" (-> this art-group)) + (format #t "~1Tjgeo: ~A~%" (-> this jgeo)) + (format #t "~1Tmgeo: ~A~%" (-> this mgeo)) + (format #t "~1Tdma-add-func: ~A~%" (-> this dma-add-func)) + (format #t "~1Tskeleton: ~A~%" (-> this skeleton)) + (format #t "~1Tlod-set: #~%" (-> this lod-set)) + (format #t "~1Tlod[6] @ #x~X~%" (-> this lod-set)) + (format #t "~1Tmax-lod: ~D~%" (-> this lod-set max-lod)) + (format #t "~1Tforce-lod: ~D~%" (-> this force-lod)) + (format #t "~1Tcur-lod: ~D~%" (-> this cur-lod)) + (format #t "~1Tdesired-lod: ~D~%" (-> this desired-lod)) + (format #t "~1Tripple: ~A~%" (-> this ripple)) + (format #t "~1Tlongest-edge: (meters ~m)~%" (-> this longest-edge)) + (format #t "~1Tlongest-edge?: ~D~%" (-> this longest-edge)) + (format #t "~1Tlight-index: ~D~%" (-> this light-index)) + (format #t "~1Tshadow-mask: ~D~%" (-> this shadow-mask)) + (format #t "~1Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~1Tdeath-draw-overlap: ~D~%" (-> this death-draw-overlap)) + (format #t "~1Tdeath-timer: ~D~%" (-> this death-timer)) + (format #t "~1Tdeath-timer-org: ~D~%" (-> this death-timer-org)) + (format #t "~1Tdeath-vertex-skip: ~D~%" (-> this death-vertex-skip)) + (format #t "~1Tdeath-effect: ~D~%" (-> this death-effect)) + (format #t "~1Tshadow: ~A~%" (-> this shadow)) + (format #t "~1Tshadow-ctrl: ~A~%" (-> this shadow-ctrl)) + (format #t "~1Tdistance: (meters ~m)~%" (-> this distance)) + (format #t "~1Torigin: ~`vector`P~%" (-> this origin)) + (format #t "~1Tbounds: ~`vector`P~%" (-> this bounds)) + (format #t "~1Tradius: (meters ~m)~%" (-> this bounds w)) + (format #t "~1Tcolor-mult: #~%" (-> this color-mult)) + (format #t "~1Tcolor-emissive: #~%" (-> this color-emissive)) + (format #t "~1Teffect-mask: #x~X~%" (-> this effect-mask)) + (format #t "~1Tseg-mask: #x~X~%" (-> this seg-mask)) + (format #t "~1Torigin-joint-index: ~D~%" (-> this origin-joint-index)) + (format #t "~1Tshadow-joint-index: ~D~%" (-> this shadow-joint-index)) + (format #t "~1Tforce-fade: ~D~%" (-> this force-fade)) + (format #t "~1Tdefault-texture-page: ~D~%" (-> this default-texture-page)) + (format #t "~1Tshadow-values: ~D~%" (-> this shadow-values)) (label cfg-47) - obj + this ) ;; definition for method 9 of type draw-control -(defmethod get-skeleton-origin draw-control ((obj draw-control)) - (-> obj skeleton bones 0 transform trans) +(defmethod get-skeleton-origin draw-control ((this draw-control)) + (-> this skeleton bones 0 transform trans) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc index 5f159ed663..400cf82018 100644 --- a/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type pos-history -(defmethod inspect pos-history ((obj pos-history)) - (when (not obj) - (set! obj obj) +(defmethod inspect pos-history ((this pos-history)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pos-history) - (format #t "~1Tpoints: #x~X~%" (-> obj points)) - (format #t "~1Tnum-points: ~D~%" (-> obj num-points)) - (format #t "~1Th-first: ~D~%" (-> obj h-first)) - (format #t "~1Th-last: ~D~%" (-> obj h-last)) + (format #t "[~8x] ~A~%" this 'pos-history) + (format #t "~1Tpoints: #x~X~%" (-> this points)) + (format #t "~1Tnum-points: ~D~%" (-> this num-points)) + (format #t "~1Th-first: ~D~%" (-> this h-first)) + (format #t "~1Th-last: ~D~%" (-> this h-last)) (label cfg-4) - obj + this ) ;; definition of type debug-vertex @@ -41,18 +41,18 @@ ) ;; definition for method 3 of type debug-vertex -(defmethod inspect debug-vertex ((obj debug-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-vertex ((this debug-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'debug-vertex) - (format #t "~1Ttrans: ~`vector4w`P~%" (-> obj trans)) - (format #t "~1Tnormal: ~`vector3h`P~%" (-> obj normal)) - (format #t "~1Tst: ~`vector2h`P~%" (-> obj st)) - (format #t "~1Tcolor: #x~X~%" (-> obj color)) + (format #t "[~8x] ~A~%" this 'debug-vertex) + (format #t "~1Ttrans: ~`vector4w`P~%" (-> this trans)) + (format #t "~1Tnormal: ~`vector3h`P~%" (-> this normal)) + (format #t "~1Tst: ~`vector2h`P~%" (-> this st)) + (format #t "~1Tcolor: #x~X~%" (-> this color)) (label cfg-4) - obj + this ) ;; definition of type debug-vertex-stats @@ -67,18 +67,17 @@ ) ;; definition for method 3 of type debug-vertex-stats -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect debug-vertex-stats ((obj debug-vertex-stats)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-vertex-stats ((this debug-vertex-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tpos-count: ~D~%" (-> obj pos-count)) - (format #t "~1Tvertex[600] @ #x~X~%" (-> obj vertex)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tpos-count: ~D~%" (-> this pos-count)) + (format #t "~1Tvertex[600] @ #x~X~%" (-> this vertex)) (label cfg-4) - obj + this ) ;; definition for symbol *color-black*, type rgba @@ -149,7 +148,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc index 5ab7d71a8c..1d59354aff 100644 --- a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc @@ -461,21 +461,21 @@ ) ;; definition for method 3 of type debug-line -(defmethod inspect debug-line ((obj debug-line)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-line ((this debug-line)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'debug-line) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tbucket: ~D~%" (-> obj bucket)) - (format #t "~1Tv1: #~%" (-> obj v1)) - (format #t "~1Tv2: #~%" (-> obj v2)) - (format #t "~1Tcolor: ~D~%" (-> obj color)) - (format #t "~1Tmode: ~A~%" (-> obj mode)) - (format #t "~1Tcolor2: ~D~%" (-> obj color2)) + (format #t "[~8x] ~A~%" this 'debug-line) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tbucket: ~D~%" (-> this bucket)) + (format #t "~1Tv1: #~%" (-> this v1)) + (format #t "~1Tv2: #~%" (-> this v2)) + (format #t "~1Tcolor: ~D~%" (-> this color)) + (format #t "~1Tmode: ~A~%" (-> this mode)) + (format #t "~1Tcolor2: ~D~%" (-> this color2)) (label cfg-4) - obj + this ) ;; definition of type debug-text-3d @@ -493,20 +493,20 @@ ) ;; definition for method 3 of type debug-text-3d -(defmethod inspect debug-text-3d ((obj debug-text-3d)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-text-3d ((this debug-text-3d)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'debug-text-3d) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tbucket: ~D~%" (-> obj bucket)) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tcolor: ~D~%" (-> obj color)) - (format #t "~1Toffset: #~%" (-> obj offset)) - (format #t "~1Tstr: ~A~%" (-> obj str)) + (format #t "[~8x] ~A~%" this 'debug-text-3d) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tbucket: ~D~%" (-> this bucket)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tcolor: ~D~%" (-> this color)) + (format #t "~1Toffset: #~%" (-> this offset)) + (format #t "~1Tstr: ~A~%" (-> this str)) (label cfg-4) - obj + this ) ;; definition of type debug-tracking-thang @@ -520,16 +520,16 @@ ) ;; definition for method 3 of type debug-tracking-thang -(defmethod inspect debug-tracking-thang ((obj debug-tracking-thang)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-tracking-thang ((this debug-tracking-thang)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) (label cfg-4) - obj + this ) ;; definition for symbol *debug-lines*, type (inline-array debug-line) @@ -1605,14 +1605,13 @@ ) ;; definition for method 3 of type debug-vertex-stats -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect debug-vertex-stats ((obj debug-vertex-stats)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tpos-count: ~D~%" (-> obj pos-count)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj vertex)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj vertex s5-0))) +(defmethod inspect debug-vertex-stats ((this debug-vertex-stats)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tpos-count: ~D~%" (-> this pos-count)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this vertex)) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this vertex s5-0))) (format #t " ~D : trans: ~D ~D ~D ~D" @@ -1633,7 +1632,7 @@ ) ) ) - obj + this ) ;; definition (debug) for function history-init diff --git a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc index 49d52ca3b0..c52a8ecc15 100644 --- a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc @@ -4370,7 +4370,7 @@ (let ((v1-1 (process-spawn-function process (lambda () (set-master-mode 'game) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.3)) + (until (time-elapsed? gp-0 (seconds 0.3)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/engine/debug/editable-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable-h_REF.gc index 41fed59ba3..e045557ba6 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable-h_REF.gc @@ -269,23 +269,23 @@ ) ;; definition for method 3 of type editable-region -(defmethod inspect editable-region ((obj editable-region)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-region ((this editable-region)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tchanged: ~A~%" (-> obj changed)) - (format #t "~1Tlocked: ~A~%" (-> obj locked)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tfilter: ~D~%" (-> obj filter)) - (format #t "~1Ttree: ~A~%" (-> obj tree)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Ton-enter: ~A~%" (-> obj on-enter)) - (format #t "~1Ton-inside: ~A~%" (-> obj on-inside)) - (format #t "~1Ton-exit: ~A~%" (-> obj on-exit)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tchanged: ~A~%" (-> this changed)) + (format #t "~1Tlocked: ~A~%" (-> this locked)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tfilter: ~D~%" (-> this filter)) + (format #t "~1Ttree: ~A~%" (-> this tree)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Ton-enter: ~A~%" (-> this on-enter)) + (format #t "~1Ton-inside: ~A~%" (-> this on-inside)) + (format #t "~1Ton-exit: ~A~%" (-> this on-exit)) (label cfg-4) - obj + this ) ;; definition of type editable @@ -325,14 +325,14 @@ ) ;; definition for method 3 of type editable -(defmethod inspect editable ((obj editable)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable ((this editable)) + (when (not this) + (set! this this) (goto cfg-28) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X : (editable-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) (format #t "no-save ") ) @@ -371,12 +371,12 @@ ) ) (format #t ")~%") - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tregion: ~A~%" (-> obj region)) - (format #t "~1Towner: ~A~%" (-> obj owner)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) (label cfg-28) - obj + this ) ;; definition of type editable-array @@ -421,38 +421,38 @@ ) ;; definition for method 3 of type editable-array -(defmethod inspect editable-array ((obj editable-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-array ((this editable-array)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tregion: ~A~%" (-> obj region)) - (format #t "~1Tbackup-region: ~A~%" (-> obj backup-region)) - (format #t "~1Tregion-lock?: ~A~%" (-> obj region-lock?)) - (format #t "~1Tmove-lock?: ~A~%" (-> obj move-lock?)) - (format #t "~1Tmove-speed: ~f~%" (-> obj move-speed)) - (format #t "~1Tselection: ~`basic`P~%" (-> obj selection)) - (format #t "~1Tfilter[2] @ #x~X~%" (-> obj filter)) - (format #t "~1Ttarget: ~A~%" (-> obj target)) - (format #t "~1Ttarget-mode: ~D~%" (-> obj target-mode)) - (format #t "~1Ttarget-command: ~D~%" (-> obj target-command)) - (format #t "~1Ttarget-message: ~A~%" (-> obj target-message)) - (format #t "~1Tedit-plane: ~A~%" (-> obj edit-plane)) - (format #t "~1Tedit-plane-center: ~`vector`P~%" (-> obj edit-plane-center)) - (format #t "~1Tedit-plane-normal: ~`vector`P~%" (-> obj edit-plane-normal)) - (format #t "~1Tlevel-offset: ~`vector`P~%" (-> obj level-offset)) - (format #t "~1Tlevel-info-id: ~D~%" (-> obj level-info-id)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tedit-param0: ~f~%" (-> obj edit-param0)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> obj data s5-0)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Tbackup-region: ~A~%" (-> this backup-region)) + (format #t "~1Tregion-lock?: ~A~%" (-> this region-lock?)) + (format #t "~1Tmove-lock?: ~A~%" (-> this move-lock?)) + (format #t "~1Tmove-speed: ~f~%" (-> this move-speed)) + (format #t "~1Tselection: ~`basic`P~%" (-> this selection)) + (format #t "~1Tfilter[2] @ #x~X~%" (-> this filter)) + (format #t "~1Ttarget: ~A~%" (-> this target)) + (format #t "~1Ttarget-mode: ~D~%" (-> this target-mode)) + (format #t "~1Ttarget-command: ~D~%" (-> this target-command)) + (format #t "~1Ttarget-message: ~A~%" (-> this target-message)) + (format #t "~1Tedit-plane: ~A~%" (-> this edit-plane)) + (format #t "~1Tedit-plane-center: ~`vector`P~%" (-> this edit-plane-center)) + (format #t "~1Tedit-plane-normal: ~`vector`P~%" (-> this edit-plane-normal)) + (format #t "~1Tlevel-offset: ~`vector`P~%" (-> this level-offset)) + (format #t "~1Tlevel-info-id: ~D~%" (-> this level-info-id)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tedit-param0: ~f~%" (-> this edit-param0)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> this data s5-0)) ) (label cfg-7) - obj + this ) ;; definition for method 0 of type editable-array @@ -509,14 +509,14 @@ ) ;; definition for method 3 of type editable-point -(defmethod inspect editable-point ((obj editable-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-point ((this editable-point)) + (when (not this) + (set! this this) (goto cfg-28) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X : (editable-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) (format #t "no-save ") ) @@ -555,14 +555,14 @@ ) ) (format #t ")~%") - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tregion: ~A~%" (-> obj region)) - (format #t "~1Towner: ~A~%" (-> obj owner)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj radius)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) (label cfg-28) - obj + this ) ;; definition for method 0 of type editable-point @@ -600,14 +600,14 @@ ) ;; definition for method 3 of type editable-sphere -(defmethod inspect editable-sphere ((obj editable-sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-sphere ((this editable-sphere)) + (when (not this) + (set! this this) (goto cfg-28) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X : (editable-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) (format #t "no-save ") ) @@ -646,14 +646,14 @@ ) ) (format #t ")~%") - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tregion: ~A~%" (-> obj region)) - (format #t "~1Towner: ~A~%" (-> obj owner)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj radius)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) (label cfg-28) - obj + this ) ;; definition for method 0 of type editable-sphere @@ -688,14 +688,14 @@ ) ;; definition for method 3 of type editable-sample -(defmethod inspect editable-sample ((obj editable-sample)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-sample ((this editable-sample)) + (when (not this) + (set! this this) (goto cfg-28) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X : (editable-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) (format #t "no-save ") ) @@ -734,14 +734,14 @@ ) ) (format #t ")~%") - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tregion: ~A~%" (-> obj region)) - (format #t "~1Towner: ~A~%" (-> obj owner)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj radius)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) (label cfg-28) - obj + this ) ;; definition of type editable-light @@ -761,14 +761,14 @@ ) ;; definition for method 3 of type editable-light -(defmethod inspect editable-light ((obj editable-light)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-light ((this editable-light)) + (when (not this) + (set! this this) (goto cfg-28) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X : (editable-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) (format #t "no-save ") ) @@ -807,19 +807,19 @@ ) ) (format #t ")~%") - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tregion: ~A~%" (-> obj region)) - (format #t "~1Towner: ~A~%" (-> obj owner)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj radius)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Tdirection: ~`vector`P~%" (-> obj direction)) - (format #t "~1Tcolor: ~`vector`P~%" (-> obj color)) - (format #t "~1Tdecay-start: ~f~%" (-> obj decay-start)) - (format #t "~1Tambient-point-ratio: ~f~%" (-> obj ambient-point-ratio)) - (format #t "~1Tbrightness: ~f~%" (-> obj brightness)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tdirection: ~`vector`P~%" (-> this direction)) + (format #t "~1Tcolor: ~`vector`P~%" (-> this color)) + (format #t "~1Tdecay-start: ~f~%" (-> this decay-start)) + (format #t "~1Tambient-point-ratio: ~f~%" (-> this ambient-point-ratio)) + (format #t "~1Tbrightness: ~f~%" (-> this brightness)) (label cfg-28) - obj + this ) ;; definition for method 0 of type editable-light @@ -863,14 +863,14 @@ ) ;; definition for method 3 of type editable-entity -(defmethod inspect editable-entity ((obj editable-entity)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-entity ((this editable-entity)) + (when (not this) + (set! this this) (goto cfg-28) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X : (editable-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) (format #t "no-save ") ) @@ -909,14 +909,14 @@ ) ) (format #t ")~%") - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tregion: ~A~%" (-> obj region)) - (format #t "~1Towner: ~A~%" (-> obj owner)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj radius)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) (label cfg-28) - obj + this ) ;; definition of type editable-face @@ -937,14 +937,14 @@ ) ;; definition for method 3 of type editable-face -(defmethod inspect editable-face ((obj editable-face)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-face ((this editable-face)) + (when (not this) + (set! this this) (goto cfg-31) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X : (editable-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) (format #t "no-save ") ) @@ -983,19 +983,19 @@ ) ) (format #t ")~%") - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tregion: ~A~%" (-> obj region)) - (format #t "~1Towner: ~A~%" (-> obj owner)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tnormal: ~`vector`P~%" (-> obj normal)) - (format #t "~1Tcenter: ~`vector`P~%" (-> obj center)) - (format #t "~1Tvertex[6] @ #x~X~%" (-> obj vertex)) - (dotimes (s5-1 (-> obj length)) - (format #t "~T [~D]~1Tvertex: ~A~%" s5-1 (-> obj vertex s5-1)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~1Tcenter: ~`vector`P~%" (-> this center)) + (format #t "~1Tvertex[6] @ #x~X~%" (-> this vertex)) + (dotimes (s5-1 (-> this length)) + (format #t "~T [~D]~1Tvertex: ~A~%" s5-1 (-> this vertex s5-1)) ) (label cfg-31) - obj + this ) ;; definition for method 0 of type editable-face @@ -1035,14 +1035,14 @@ ) ;; definition for method 3 of type editable-plane -(defmethod inspect editable-plane ((obj editable-plane)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-plane ((this editable-plane)) + (when (not this) + (set! this this) (goto cfg-31) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X : (editable-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X : (editable-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (editable-flag no-save)) (editable-flag no-save)) (format #t "no-save ") ) @@ -1081,18 +1081,18 @@ ) ) (format #t ")~%") - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tregion: ~A~%" (-> obj region)) - (format #t "~1Towner: ~A~%" (-> obj owner)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj radius)) - (format #t "~1Tvertex[2] @ #x~X~%" (-> obj vertex)) - (dotimes (s5-1 (-> obj length)) - (format #t "~T [~D]~1Tvertex: ~A~%" s5-1 (-> obj vertex s5-1)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tregion: ~A~%" (-> this region)) + (format #t "~1Towner: ~A~%" (-> this owner)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Tvertex[2] @ #x~X~%" (-> this vertex)) + (dotimes (s5-1 (-> this length)) + (format #t "~T [~D]~1Tvertex: ~A~%" s5-1 (-> this vertex s5-1)) ) (label cfg-31) - obj + this ) ;; definition for method 0 of type editable-plane @@ -1139,25 +1139,25 @@ ) ;; definition for method 3 of type editable-player -(defmethod inspect editable-player ((obj editable-player)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-player ((this editable-player)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcurrent: ~A~%" (-> obj current)) - (format #t "~2Tselect-command: ~D~%" (-> obj select-command)) - (format #t "~2Tmove-command: ~D~%" (-> obj move-command)) - (format #t "~2Textra-command: ~D~%" (-> obj extra-command)) - (format #t "~2Tleft-handed: ~A~%" (-> obj left-handed)) - (format #t "~2Tlight-names: ~A~%" (-> obj light-names)) - (format #t "~2Texternal-cam-mode: ~A~%" (-> obj external-cam-mode)) - (format #t "~2Tcommand[6] @ #x~X~%" (-> obj command)) - (format #t "~2Tclose-menu-time: ~D~%" (-> obj close-menu-time)) + (format #t "~2Tcurrent: ~A~%" (-> this current)) + (format #t "~2Tselect-command: ~D~%" (-> this select-command)) + (format #t "~2Tmove-command: ~D~%" (-> this move-command)) + (format #t "~2Textra-command: ~D~%" (-> this extra-command)) + (format #t "~2Tleft-handed: ~A~%" (-> this left-handed)) + (format #t "~2Tlight-names: ~A~%" (-> this light-names)) + (format #t "~2Texternal-cam-mode: ~A~%" (-> this external-cam-mode)) + (format #t "~2Tcommand[6] @ #x~X~%" (-> this command)) + (format #t "~2Tclose-menu-time: ~D~%" (-> this close-menu-time)) (label cfg-4) - obj + this ) ;; definition of type editable-work @@ -1175,20 +1175,20 @@ ) ;; definition for method 3 of type editable-work -(defmethod inspect editable-work ((obj editable-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect editable-work ((this editable-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnum-found: ~D~%" (-> obj num-found)) - (format #t "~1Tlast-found: ~D~%" (-> obj last-found)) - (format #t "~1Tlast-x: ~f~%" (-> obj last-x)) - (format #t "~1Tlast-y: ~f~%" (-> obj last-y)) - (format #t "~1Tfound[256] @ #x~X~%" (-> obj found)) - (format #t "~1Tdists[256] @ #x~X~%" (-> obj dists)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-found: ~D~%" (-> this num-found)) + (format #t "~1Tlast-found: ~D~%" (-> this last-found)) + (format #t "~1Tlast-x: ~f~%" (-> this last-x)) + (format #t "~1Tlast-y: ~f~%" (-> this last-y)) + (format #t "~1Tfound[256] @ #x~X~%" (-> this found)) + (format #t "~1Tdists[256] @ #x~X~%" (-> this dists)) (label cfg-4) - obj + this ) ;; definition for symbol *editable-work*, type editable-work diff --git a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc index f59fae1b42..83d48e6e8b 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable-player_REF.gc @@ -1110,101 +1110,101 @@ ) ;; definition for method 9 of type editable-array -(defmethod editable-array-method-9 editable-array ((obj editable-array) (arg0 editable-command) (arg1 mouse-info)) - (if (execute-select obj arg0 arg1) +(defmethod editable-array-method-9 editable-array ((this editable-array) (arg0 editable-command) (arg1 mouse-info)) + (if (execute-select this arg0 arg1) (return #f) ) - (if (execute-move obj arg0 arg1) + (if (execute-move this arg0 arg1) (return #f) ) - (if (execute-mouse-move obj arg0 arg1) + (if (execute-mouse-move this arg0 arg1) (return #f) ) (cond ((= arg0 (editable-command copy)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (set! (-> obj selection length) 0) - (let* ((s4-2 (-> obj length)) + (set! (-> this selection length) 0) + (let* ((s4-2 (-> this length)) (s3-1 0) - (s2-0 (-> obj data s3-1)) + (s2-0 (-> this data s3-1)) ) (while (< s3-1 s4-2) (when (and s2-0 (logtest? (-> s2-0 flags) (editable-flag selected))) - (editable-method-27 s2-0 obj) + (editable-method-27 s2-0 this) (when (= (-> s2-0 type) editable-light) (editable-method-23 s2-0) (update-light-hash *light-hash*) ) ) (+! s3-1 1) - (set! s2-0 (-> obj data s3-1)) + (set! s2-0 (-> this data s3-1)) ) ) - (editable-array-method-9 obj (editable-command select-none) arg1) + (editable-array-method-9 this (editable-command select-none) arg1) (let ((s5-1 (the-as editable-region #f))) - (dotimes (s4-3 (-> obj selection length)) - (let ((a0-13 (-> obj selection s4-3))) + (dotimes (s4-3 (-> this selection length)) + (let ((a0-13 (-> this selection s4-3))) (when (and a0-13 (logtest? s4-3 1)) (set! s5-1 (-> a0-13 region)) (select-editable! a0-13 #t) ) ) ) - (if (not (-> obj region-lock?)) - (set! (-> obj region) s5-1) + (if (not (-> this region-lock?)) + (set! (-> this region) s5-1) ) ) ) ((= arg0 (editable-command copy-region)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (when (and (-> obj region) (not (-> obj region locked))) - (editable-array-method-9 obj (editable-command select-current-region) arg1) - (let ((v1-52 (copy (-> obj region) 'debug))) + (when (and (-> this region) (not (-> this region locked))) + (editable-array-method-9 this (editable-command select-current-region) arg1) + (let ((v1-52 (copy (-> this region) 'debug))) (set! (-> v1-52 id) (the-as uint 0)) (set! (-> v1-52 changed) #t) - (set! (-> obj region) v1-52) + (set! (-> this region) v1-52) ) - (editable-array-method-9 obj (editable-command copy) arg1) + (editable-array-method-9 this (editable-command copy) arg1) ) ) ((= arg0 (editable-command delete)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (let* ((s5-3 (-> obj length)) + (let* ((s5-3 (-> this length)) (s4-6 0) - (s3-3 (-> obj data s4-6)) + (s3-3 (-> this data s4-6)) ) (while (< s4-6 s5-3) (when (and s3-3 (logtest? (-> s3-3 flags) (editable-flag selected))) - (editable-array-method-15 obj s3-3) + (editable-array-method-15 this s3-3) (when (= (-> s3-3 type) editable-light) (editable-method-23 s3-3) (update-light-hash *light-hash*) ) ) (+! s4-6 1) - (set! s3-3 (-> obj data s4-6)) + (set! s3-3 (-> this data s4-6)) ) ) - (if (not (-> obj region-lock?)) - (set! (-> obj region) #f) + (if (not (-> this region-lock?)) + (set! (-> this region) #f) ) ) ((= arg0 (editable-command delete-region)) - (when (-> obj region) + (when (-> this region) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (when (!= (-> obj region) *editable-light-region*) - (editable-array-method-9 obj (editable-command select-current-region) arg1) - (editable-array-method-9 obj (editable-command delete) arg1) - (set! (-> obj region) #f) + (when (!= (-> this region) *editable-light-region*) + (editable-array-method-9 this (editable-command select-current-region) arg1) + (editable-array-method-9 this (editable-command delete) arg1) + (set! (-> this region) #f) ) ) ) ((= arg0 (editable-command snap-to-ground)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (let* ((s5-5 (new 'stack-no-clear 'vector)) - (s4-9 (-> obj length)) + (s4-9 (-> this length)) (s3-5 0) - (s2-1 (-> obj data s3-5)) + (s2-1 (-> this data s3-5)) ) (while (< s3-5 s4-9) (when (and s2-1 (logtest? (-> s2-1 flags) (editable-flag selected))) @@ -1213,31 +1213,31 @@ ) ) (+! s3-5 1) - (set! s2-1 (-> obj data s3-5)) + (set! s2-1 (-> this data s3-5)) ) ) ) ((= arg0 (editable-command snap-y)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (cond - ((-> obj target) - (let* ((s5-7 (edit-get-trans (-> obj target))) - (s4-11 (-> obj length)) + ((-> this target) + (let* ((s5-7 (edit-get-trans (-> this target))) + (s4-11 (-> this length)) (s3-6 0) - (a0-37 (-> obj data s3-6)) + (a0-37 (-> this data s3-6)) ) (while (< s3-6 s4-11) (if (and a0-37 (logtest? (-> a0-37 flags) (editable-flag selected))) (edit-coord! a0-37 s5-7 (editable-flag y no-plane-snap)) ) (+! s3-6 1) - (set! a0-37 (-> obj data s3-6)) + (set! a0-37 (-> this data s3-6)) ) ) ) (else (editable-array-method-13 - obj + this (editable-command pick-target) (editable-command snap-y) "pick the editable to use the y from" @@ -1248,24 +1248,24 @@ ((= arg0 (editable-command snap-xz)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) (cond - ((-> obj target) - (let* ((s5-9 (edit-get-trans (-> obj target))) - (s4-13 (-> obj length)) + ((-> this target) + (let* ((s5-9 (edit-get-trans (-> this target))) + (s4-13 (-> this length)) (s3-7 0) - (a0-41 (-> obj data s3-7)) + (a0-41 (-> this data s3-7)) ) (while (< s3-7 s4-13) (if (and a0-41 (logtest? (-> a0-41 flags) (editable-flag selected))) (edit-coord! a0-41 s5-9 (editable-flag x z no-plane-snap)) ) (+! s3-7 1) - (set! a0-41 (-> obj data s3-7)) + (set! a0-41 (-> this data s3-7)) ) ) ) (else (editable-array-method-13 - obj + this (editable-command pick-target) (editable-command snap-xz) "pick the editable to use the xz from" @@ -1274,29 +1274,29 @@ ) ) ((= arg0 (editable-command region-set)) - (when (and (-> obj region) (not (-> obj region locked))) + (when (and (-> this region) (not (-> this region locked))) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (let* ((s5-11 (-> obj length)) + (let* ((s5-11 (-> this length)) (s4-15 0) - (a0-44 (-> obj data s4-15)) + (a0-44 (-> this data s4-15)) ) (while (< s4-15 s5-11) (if (and a0-44 (logtest? (-> a0-44 flags) (editable-flag selected))) - (editable-method-21 a0-44 (-> obj region)) + (editable-method-21 a0-44 (-> this region)) ) (+! s4-15 1) - (set! a0-44 (-> obj data s4-15)) + (set! a0-44 (-> this data s4-15)) ) ) ) ) ((= arg0 (editable-command region-add)) - (when (and (-> obj region) (not (-> obj region locked))) + (when (and (-> this region) (not (-> this region locked))) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (if (-> obj target) - (editable-method-21 (-> obj target) (-> obj region)) + (if (-> this target) + (editable-method-21 (-> this target) (-> this region)) (editable-array-method-13 - obj + this (editable-command pick-target) (editable-command region-add) "pick the editable to add to current region" @@ -1306,88 +1306,88 @@ ) ((= arg0 (editable-command region-new)) (let ((v1-175 (new 'debug 'editable-region))) - (if (and (-> obj region) (not (-> obj region locked))) - (set! (-> v1-175 tree) (-> obj region tree)) + (if (and (-> this region) (not (-> this region locked))) + (set! (-> v1-175 tree) (-> this region tree)) ) - (set! (-> obj region) v1-175) + (set! (-> this region) v1-175) ) - (editable-array-method-9 obj (editable-command region-set) arg1) + (editable-array-method-9 this (editable-command region-set) arg1) ) ((= arg0 (editable-command flip-side)) (sound-play-by-spec (static-sound-spec "beep" :fo-curve 1) (new-sound-id) (the-as vector #t)) - (let* ((s5-14 (-> obj length)) + (let* ((s5-14 (-> this length)) (s4-18 0) - (a0-58 (-> obj data s4-18)) + (a0-58 (-> this data s4-18)) ) (while (< s4-18 s5-14) (if (and a0-58 (logtest? (-> a0-58 flags) (editable-flag selected))) (editable-method-24 a0-58) ) (+! s4-18 1) - (set! a0-58 (-> obj data s4-18)) + (set! a0-58 (-> this data s4-18)) ) ) ) ((= arg0 (editable-command rotate-level)) - (let* ((f0-1 (* 182.04445 (-> obj edit-param0))) + (let* ((f0-1 (* 182.04445 (-> this edit-param0))) (s5-15 (matrix-rotate-y! (new 'stack-no-clear 'matrix) f0-1)) - (s4-19 (-> obj length)) + (s4-19 (-> this length)) (s3-8 0) - (a0-60 (-> obj data s3-8)) + (a0-60 (-> this data s3-8)) ) (while (< s3-8 s4-19) - (if (and a0-60 region (= (-> a0-60 region level) (-> obj level))) - (editable-method-18 a0-60 (-> obj level-offset) s5-15) + (if (and a0-60 region (= (-> a0-60 region level) (-> this level))) + (editable-method-18 a0-60 (-> this level-offset) s5-15) ) (+! s3-8 1) - (set! a0-60 (-> obj data s3-8)) + (set! a0-60 (-> this data s3-8)) ) ) ) ((= arg0 (editable-command translate-y-level)) (let ((s5-16 (new 'stack-no-clear 'vector))) (set! (-> s5-16 x) 0.0) - (set! (-> s5-16 y) (* 4096.0 (-> obj edit-param0))) + (set! (-> s5-16 y) (* 4096.0 (-> this edit-param0))) (set! (-> s5-16 z) 0.0) (set! (-> s5-16 w) 1.0) - (let* ((s4-20 (-> obj length)) + (let* ((s4-20 (-> this length)) (s3-9 0) - (a0-61 (-> obj data s3-9)) + (a0-61 (-> this data s3-9)) ) (while (< s3-9 s4-20) - (if (and a0-61 region (= (-> a0-61 region level) (-> obj level))) + (if (and a0-61 region (= (-> a0-61 region level) (-> this level))) (editable-method-15 a0-61 s5-16 56) ) (+! s3-9 1) - (set! a0-61 (-> obj data s3-9)) + (set! a0-61 (-> this data s3-9)) ) ) ) ) ((= arg0 (editable-command save)) - (let* ((s5-17 (-> obj length)) + (let* ((s5-17 (-> this length)) (s4-21 0) - (v1-231 (-> obj data s4-21)) + (v1-231 (-> this data s4-21)) ) (while (< s4-21 s5-17) (if (and v1-231 (-> v1-231 region)) - (editable-region-method-9 (-> v1-231 region) obj 0 0) + (editable-region-method-9 (-> v1-231 region) this 0 0) ) (+! s4-21 1) - (set! v1-231 (-> obj data s4-21)) + (set! v1-231 (-> this data s4-21)) ) ) - (editable-region-method-9 *editable-sample-region* obj 0 0) - (editable-region-method-9 *editable-light-region* obj 0 0) - (editable-region-method-9 *editable-entity-region* obj 0 0) + (editable-region-method-9 *editable-sample-region* this 0 0) + (editable-region-method-9 *editable-light-region* this 0 0) + (editable-region-method-9 *editable-entity-region* this 0 0) ) ((= arg0 (editable-command load)) - (editable-array-method-9 obj (editable-command select-none) arg1) - (dotimes (v1-248 (-> obj length)) - (set! (-> obj data v1-248) #f) + (editable-array-method-9 this (editable-command select-none) arg1) + (dotimes (v1-248 (-> this length)) + (set! (-> this data v1-248) #f) ) - (set! (-> obj length) 0) - (let* ((s5-18 obj) + (set! (-> this length) 0) + (let* ((s5-18 this) (s4-22 (method-of-object s5-18 editable-array-method-12)) (v1-253 (level-get-target-inside *level*)) ) @@ -1398,20 +1398,20 @@ ) ) ) - (editable-array-method-9 obj (editable-command update-game) (the-as mouse-info #f)) + (editable-array-method-9 this (editable-command update-game) (the-as mouse-info #f)) ) ((= arg0 (editable-command update-game)) (reset-light-hash *light-hash*) - (let* ((s5-19 (-> obj length)) + (let* ((s5-19 (-> this length)) (s4-23 0) - (a0-76 (-> obj data s4-23)) + (a0-76 (-> this data s4-23)) ) (while (< s4-23 s5-19) (if a0-76 (editable-method-23 a0-76) ) (+! s4-23 1) - (set! a0-76 (-> obj data s4-23)) + (set! a0-76 (-> this data s4-23)) ) ) (update-light-hash *light-hash*) @@ -1424,7 +1424,7 @@ ) ;; definition for method 10 of type editable-player -(defmethod deactivate editable-player ((obj editable-player)) +(defmethod deactivate editable-player ((this editable-player)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) (if (= (-> a1-3 status) 'active) @@ -1433,43 +1433,43 @@ ) ) (set! *editable* (the-as (pointer editable-player) #f)) - (set! *external-cam-mode* (-> obj external-cam-mode)) - ((method-of-type process-drawable deactivate) obj) + (set! *external-cam-mode* (-> this external-cam-mode)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type editable-player ;; WARN: Return type mismatch process-drawable vs editable-player. -(defmethod relocate editable-player ((obj editable-player) (arg0 int)) +(defmethod relocate editable-player ((this editable-player) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (let ((v1-2 (-> obj current))) + (let ((v1-2 (-> this current))) (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) (< (the-as int v1-2) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj current) arg0) + (&+! (-> this current) arg0) ) ) - (the-as editable-player ((method-of-type process-drawable relocate) obj arg0)) + (the-as editable-player ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 21 of type editable-player ;; WARN: Return type mismatch int vs none. -(defmethod editable-player-method-21 editable-player ((obj editable-player)) +(defmethod editable-player-method-21 editable-player ((this editable-player)) (set! *display-region-marks* #f) - (let* ((s5-0 (-> obj current length)) + (let* ((s5-0 (-> this current length)) (s4-0 0) - (a0-2 (-> obj current data s4-0)) + (a0-2 (-> this current data s4-0)) ) (while (< s4-0 s5-0) - (if (and a0-2 (or (and (logtest? (-> a0-2 region filter) (-> obj current filter 0)) - (logtest? (-> a0-2 region filter) (-> obj current filter 1)) + (if (and a0-2 (or (and (logtest? (-> a0-2 region filter) (-> this current filter 0)) + (logtest? (-> a0-2 region filter) (-> this current filter 1)) ) (logtest? (-> a0-2 flags) (editable-flag selected)) ) @@ -1477,7 +1477,7 @@ (editable-method-10 a0-2) ) (+! s4-0 1) - (set! a0-2 (-> obj current data s4-0)) + (set! a0-2 (-> this current data s4-0)) ) ) (when #t @@ -1487,27 +1487,27 @@ *stdcon* "~16S~16S~16S~%" (editable-command->string - (if (and (nonzero? (-> obj command 1)) (or (= (-> obj command 0) (editable-command none)) (mouse-hold? left))) - (-> obj command 1) - (-> obj command 0) + (if (and (nonzero? (-> this command 1)) (or (= (-> this command 0) (editable-command none)) (mouse-hold? left))) + (-> this command 1) + (-> this command 0) ) ) (editable-command->string - (if (and (nonzero? (-> obj command 5)) (or (= (-> obj command 4) (editable-command none)) (mouse-hold? middle))) - (-> obj command 5) - (-> obj command 4) + (if (and (nonzero? (-> this command 5)) (or (= (-> this command 4) (editable-command none)) (mouse-hold? middle))) + (-> this command 5) + (-> this command 4) ) ) (editable-command->string - (if (and (nonzero? (-> obj command 3)) (or (= (-> obj command 2) (editable-command none)) (mouse-hold? right))) - (-> obj command 3) - (-> obj command 2) + (if (and (nonzero? (-> this command 3)) (or (= (-> this command 2) (editable-command none)) (mouse-hold? right))) + (-> this command 3) + (-> this command 2) ) ) ) - (let* ((s5-2 (-> obj current length)) + (let* ((s5-2 (-> this current length)) (s4-2 0) - (v1-35 (-> obj current data s4-2)) + (v1-35 (-> this current data s4-2)) ) (while (< s4-2 s5-2) (when (and v1-35 (logtest? (-> v1-35 flags) (editable-flag selected))) @@ -1518,23 +1518,23 @@ ) ) (+! s4-2 1) - (set! v1-35 (-> obj current data s4-2)) + (set! v1-35 (-> this current data s4-2)) ) ) (when (!= *master-mode* 'menu) - (let ((a2-5 (-> obj current target-message))) + (let ((a2-5 (-> this current target-message))) (if a2-5 (format *stdcon* "~%~3L~S~0L~%" a2-5) ) ) (when (cpad-hold? 1 triangle) - (let* ((s5-3 (-> obj current length)) + (let* ((s5-3 (-> this current length)) (s4-3 0) - (a0-29 (-> obj current data s4-3)) + (a0-29 (-> this current data s4-3)) ) (while (< s4-3 s5-3) - (when (and a0-29 (or (and (logtest? (-> a0-29 region filter) (-> obj current filter 0)) - (logtest? (-> a0-29 region filter) (-> obj current filter 1)) + (when (and a0-29 (or (and (logtest? (-> a0-29 region filter) (-> this current filter 0)) + (logtest? (-> a0-29 region filter) (-> this current filter 1)) ) (logtest? (-> a0-29 flags) (editable-flag selected)) ) @@ -1548,13 +1548,13 @@ ) ) (+! s4-3 1) - (set! a0-29 (-> obj current data s4-3)) + (set! a0-29 (-> this current data s4-3)) ) ) (format *stdcon* "~%") (cond - ((-> obj current region) - (let ((s5-4 (-> obj current region))) + ((-> this current region) + (let ((s5-4 (-> this current region))) (format *stdcon* "~%region: region-~D ~S ~S~S~%" @@ -1575,22 +1575,22 @@ (format *stdcon* "no region~%") ) ) - (when (-> obj current edit-plane) - (let ((a2-13 (-> obj current edit-plane))) + (when (-> this current edit-plane) + (let ((a2-13 (-> this current edit-plane))) (format *stdcon* "~%edit-plane: ~A~%" a2-13) ) ) (format *stdcon* "~%selected:~%") - (let* ((s5-5 (-> obj current length)) + (let* ((s5-5 (-> this current length)) (s4-4 0) - (a2-14 (-> obj current data s4-4)) + (a2-14 (-> this current data s4-4)) ) (while (< s4-4 s5-5) (if (and a2-14 (logtest? (-> a2-14 flags) (editable-flag selected))) (format *stdcon* " ~A~%" a2-14) ) (+! s4-4 1) - (set! a2-14 (-> obj current data s4-4)) + (set! a2-14 (-> this current data s4-4)) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc index 0c5fbb7b0c..5b54c89393 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc @@ -26,29 +26,29 @@ ) ;; definition for method 2 of type editable-region -(defmethod print editable-region ((obj editable-region)) - (format #t "#<~A region-~D ~A ~A @ #x~X>" (-> obj type) (-> obj id) (-> obj level) (-> obj tree) obj) - obj +(defmethod print editable-region ((this editable-region)) + (format #t "#<~A region-~D ~A ~A @ #x~X>" (-> this type) (-> this id) (-> this level) (-> this tree) this) + this ) ;; definition for method 10 of type editable-region ;; INFO: Used lq/sq -(defmethod editable-region-method-10 editable-region ((obj editable-region) (arg0 int)) +(defmethod editable-region-method-10 editable-region ((this editable-region) (arg0 int)) (local-vars (sv-16 string) (sv-32 string)) - (when (nonzero? (-> obj id)) + (when (nonzero? (-> this id)) (let ((s5-0 (clear *temp-string*))) - (format s5-0 "delete from region_sphere where region_id=~D" (-> obj id)) + (format s5-0 "delete from region_sphere where region_id=~D" (-> this id)) (let ((a2-1 (sql-query s5-0))) (when (!= (-> a2-1 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-1 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-1 this) (return #t) ) ) (clear s5-0) - (format s5-0 "select region_face_id from region_face where region_id=~D" (-> obj id)) + (format s5-0 "select region_face_id from region_face where region_id=~D" (-> this id)) (let ((s3-0 (sql-query s5-0))) (when (!= (-> s3-0 error) 'select) - (format 0 "ERROR: sql: face select error ~A for ~A~%" s3-0 obj) + (format 0 "ERROR: sql: face select error ~A for ~A~%" s3-0 this) (return #t) ) (when (> (-> s3-0 len) 0) @@ -81,26 +81,26 @@ (format s5-0 ")") (let ((a2-6 (sql-query s5-0))) (when (!= (-> a2-6 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-6 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-6 this) (return #t) ) ) ) ) (clear s5-0) - (format s5-0 "delete from region_face where region_id=~D" (-> obj id)) + (format s5-0 "delete from region_face where region_id=~D" (-> this id)) (let ((a2-8 (sql-query s5-0))) (when (!= (-> a2-8 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-8 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-8 this) (return #t) ) ) (when (zero? arg0) (clear s5-0) - (format s5-0 "delete from region where region_id=~D" (-> obj id)) + (format s5-0 "delete from region where region_id=~D" (-> this id)) (let ((a2-10 (sql-query s5-0))) (when (!= (-> a2-10 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-10 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-10 this) (return #t) ) ) @@ -111,14 +111,14 @@ ) ;; definition for method 9 of type editable-region -(defmethod editable-region-method-9 editable-region ((obj editable-region) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-region-method-9 editable-region ((this editable-region) (arg0 editable-array) (arg1 int) (arg2 int)) (local-vars (v0-0 symbol) (v1-5 object) (v1-28 object)) (set! v0-0 - (when (-> obj changed) - (format 0 "NOTICE: saving ~A~%" obj) + (when (-> this changed) + (format 0 "NOTICE: saving ~A~%" this) (let ((s5-0 *collapse-quote*)) (set! *collapse-quote* #f) - (let ((v1-1 (-> obj tree))) + (let ((v1-1 (-> this tree))) (b! (!= v1-1 'entity) cfg-3 :delay (nop!)) (b! #t cfg-78 :delay (nop!)) (label cfg-3) @@ -130,7 +130,7 @@ (b! #t cfg-15 :delay (nop!)) (label cfg-5) (b! (not s1-0) cfg-10 :likely-delay (set! v1-5 s1-0)) - (set! v1-5 (and (= (-> s1-0 region) obj) (not (logtest? (-> s1-0 flags) (editable-flag no-save))))) + (set! v1-5 (and (= (-> s1-0 region) this) (not (logtest? (-> s1-0 flags) (editable-flag no-save))))) (label cfg-10) (b! (not v1-5) cfg-14 :delay (empty-form)) (b! (editable-method-22 s1-0 arg0 1 0) cfg-14 :delay (empty-form)) @@ -153,7 +153,7 @@ (let ((v1-18 'modify)) (b! (= (-> a2-5 error) v1-18) cfg-21 :delay (empty-form)) ) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-5 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-5 this) ) (return #t) (label cfg-21) @@ -166,7 +166,7 @@ (let ((v1-22 'modify)) (b! (= (-> a2-7 error) v1-22) cfg-24 :delay (empty-form)) ) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-7 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-7 this) ) ) (return #t) @@ -178,7 +178,7 @@ (b! #t cfg-35 :delay (nop!)) (label cfg-25) (b! (not s1-1) cfg-30 :likely-delay (set! v1-28 s1-1)) - (set! v1-28 (and (= (-> s1-1 region) obj) (not (logtest? (-> s1-1 flags) (editable-flag no-save))))) + (set! v1-28 (and (= (-> s1-1 region) this) (not (logtest? (-> s1-1 flags) (editable-flag no-save))))) (label cfg-30) (b! (not v1-28) cfg-34 :delay (empty-form)) (b! (editable-method-22 s1-1 arg0 1 0) cfg-34 :delay (empty-form)) @@ -193,10 +193,10 @@ ) (b! #t cfg-78 :delay (nop!)) (label cfg-37) - (b! (nonzero? (-> obj id)) cfg-53 :delay (nop!)) + (b! (nonzero? (-> this id)) cfg-53 :delay (nop!)) (let ((s3-3 (clear *temp-string*))) - (format s3-3 "insert into region set level_name='~S',tree='~S'" (-> obj level) (-> obj tree)) - (let ((a2-11 (-> obj on-enter))) + (format s3-3 "insert into region set level_name='~S',tree='~S'" (-> this level) (-> this tree)) + (let ((a2-11 (-> this on-enter))) (b! (not a2-11) cfg-40 :delay (nop!)) (format s3-3 ",on_enter='~S'" a2-11) ) @@ -204,7 +204,7 @@ (label cfg-40) (format s3-3 ",on_enter=''") (label cfg-41) - (let ((a2-12 (-> obj on-exit))) + (let ((a2-12 (-> this on-exit))) (b! (not a2-12) cfg-43 :delay (nop!)) (format s3-3 ",on_exit='~S'" a2-12) ) @@ -212,7 +212,7 @@ (label cfg-43) (format s3-3 ",on_exit=''") (label cfg-44) - (let ((a2-13 (-> obj on-inside))) + (let ((a2-13 (-> this on-inside))) (b! (not a2-13) cfg-46 :delay (nop!)) (format s3-3 ",on_inside='~S'" a2-13) ) @@ -228,12 +228,12 @@ (let ((a0-36 'select)) (b! (!= (-> v1-50 error) a0-36) cfg-51 :delay (empty-form)) ) - (set! (-> obj id) (the-as uint (string->int (-> v1-50 data 0)))) + (set! (-> this id) (the-as uint (string->int (-> v1-50 data 0)))) ) (b! #t cfg-65 :delay (nop!)) (the-as none 0) (label cfg-51) - (format 0 "ERROR: sql: insert error ~A for ~A~%" s3-4 obj) + (format 0 "ERROR: sql: insert error ~A for ~A~%" s3-4 this) ) ) (set! v0-0 #f) @@ -242,8 +242,8 @@ (b! #t cfg-65 :delay (nop!)) (label cfg-53) (let ((s3-5 (clear *temp-string*))) - (format s3-5 "update region set level_name='~S',tree='~S'" (-> obj level) (-> obj tree)) - (let ((a2-16 (-> obj on-enter))) + (format s3-5 "update region set level_name='~S',tree='~S'" (-> this level) (-> this tree)) + (let ((a2-16 (-> this on-enter))) (b! (not a2-16) cfg-55 :delay (nop!)) (format s3-5 ",on_enter='~S'" a2-16) ) @@ -251,34 +251,34 @@ (label cfg-55) (format s3-5 ",on_enter=NULL") (label cfg-56) - (let ((a2-17 (-> obj on-exit))) + (let ((a2-17 (-> this on-exit))) (if a2-17 (format s3-5 ",on_exit='~S'" a2-17) (format s3-5 ",on_exit=NULL") ) ) - (let ((a2-18 (-> obj on-inside))) + (let ((a2-18 (-> this on-inside))) (if a2-18 (format s3-5 ",on_inside='~S'" a2-18) (format s3-5 ",on_inside=NULL") ) ) - (format s3-5 " where region_id=~D" (-> obj id)) + (format s3-5 " where region_id=~D" (-> this id)) (let ((a2-20 (sql-query s3-5))) (when (!= (-> a2-20 error) 'modify) - (format 0 "ERROR: sql: update error ~A for ~A~%" a2-20 obj) + (format 0 "ERROR: sql: update error ~A for ~A~%" a2-20 this) (return #f) ) ) ) (label cfg-65) - (editable-region-method-10 obj 1) + (editable-region-method-10 this 1) (let* ((s3-6 (-> arg0 length)) (s2-3 0) (s1-2 (-> arg0 data s2-3)) ) (while (< s2-3 s3-6) - (when (and s1-2 (= (-> s1-2 region) obj) (not (logtest? (-> s1-2 flags) (editable-flag no-save)))) + (when (and s1-2 (= (-> s1-2 region) this) (not (logtest? (-> s1-2 flags) (editable-flag no-save)))) (when (not (editable-method-22 s1-2 arg0 1 0)) (format 0 "ERROR: sql: insert error for ~A~%" s1-2) (return #f) @@ -289,7 +289,7 @@ ) ) (label cfg-78) - (set! (-> obj changed) #f) + (set! (-> this changed) #f) (set! v0-0 #t) (set! *collapse-quote* s5-0) ) @@ -302,7 +302,7 @@ ;; definition for method 11 of type editable-region ;; WARN: Return type mismatch int vs none. -(defmethod editable-region-method-11 editable-region ((obj editable-region) (arg0 vector) (arg1 int)) +(defmethod editable-region-method-11 editable-region ((this editable-region) (arg0 vector) (arg1 int)) (local-vars (sv-32 vector2h)) (set! sv-32 (new 'stack 'vector2h)) (add-debug-x #t (bucket-id debug-no-zbuf1) arg0 (new 'static 'rgba :r #xff :g #xff :a #x80)) @@ -310,12 +310,12 @@ (s2-0 #t) (s1-0 318) ) - (format (clear *temp-string*) "region-~D~%" (-> obj id)) + (format (clear *temp-string*) "region-~D~%" (-> this id)) (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* arg0 (font-color white) sv-32) ) (+! (-> sv-32 y) 8) (when (>= arg1 1) - (let ((s4-1 (-> obj on-enter))) + (let ((s4-1 (-> this on-enter))) (when s4-1 (let ((s3-1 add-debug-text-3d) (s2-1 #t) @@ -327,7 +327,7 @@ (+! (-> sv-32 y) 8) ) ) - (let ((s4-2 (-> obj on-inside))) + (let ((s4-2 (-> this on-inside))) (when s4-2 (let ((s3-2 add-debug-text-3d) (s2-2 #t) @@ -339,7 +339,7 @@ (+! (-> sv-32 y) 8) ) ) - (let ((s5-1 (-> obj on-exit))) + (let ((s5-1 (-> this on-exit))) (when s5-1 (let ((s4-3 add-debug-text-3d) (s3-3 #t) @@ -358,7 +358,7 @@ ;; definition for method 12 of type editable-region ;; WARN: Return type mismatch int vs editable-filter. -(defmethod editable-region-method-12 editable-region ((obj editable-region)) +(defmethod editable-region-method-12 editable-region ((this editable-region)) (let* ((s5-0 0) (s4-0 (lambda ((arg0 string)) (let ((gp-0 0)) (when (not (type? arg0 string)) @@ -385,16 +385,16 @@ ) ) (v0-3 - (logior (logior (logior s5-0 (s4-0 (-> obj on-inside))) (s4-0 (-> obj on-enter))) (s4-0 (-> obj on-exit))) + (logior (logior (logior s5-0 (s4-0 (-> this on-inside))) (s4-0 (-> this on-enter))) (s4-0 (-> this on-exit))) ) ) (when (zero? v0-3) - (if (and (not (-> obj on-inside)) (not (-> obj on-enter)) (not (-> obj on-exit))) + (if (and (not (-> this on-inside)) (not (-> this on-enter)) (not (-> this on-exit))) (set! v0-3 1) (set! v0-3 2) ) ) - (case (-> obj tree) + (case (-> this tree) (('target) (set! v0-3 (logior v0-3 512)) ) @@ -425,14 +425,14 @@ ) ;; definition for method 23 of type editable -(defmethod editable-method-23 editable ((obj editable)) +(defmethod editable-method-23 editable ((this editable)) #t ) ;; definition for method 28 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-28 editable ((obj editable) (arg0 editable-filter)) - (let* ((s5-0 (-> obj owner)) +(defmethod editable-method-28 editable ((this editable) (arg0 editable-filter)) + (let* ((s5-0 (-> this owner)) (a0-1 (car s5-0)) ) (while (not (null? s5-0)) @@ -447,8 +447,8 @@ ;; definition for method 29 of type editable ;; WARN: Return type mismatch int vs symbol. -(defmethod editable-method-29 editable ((obj editable) (arg0 editable-filter)) - (let* ((s5-0 (-> obj owner)) +(defmethod editable-method-29 editable ((this editable) (arg0 editable-filter)) + (let* ((s5-0 (-> this owner)) (a0-1 (car s5-0)) ) (while (not (null? s5-0)) @@ -462,16 +462,16 @@ ;; definition for method 21 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-21 editable ((obj editable) (arg0 editable-region)) - (when (not (and (-> obj region) (-> obj region locked))) +(defmethod editable-method-21 editable ((this editable) (arg0 editable-region)) + (when (not (and (-> this region) (-> this region locked))) (if arg0 (set! (-> arg0 changed) #t) ) - (if (-> obj region) - (set! (-> obj region changed) #t) + (if (-> this region) + (set! (-> this region changed) #t) ) - (logior! (-> obj flags) (editable-flag changed)) - (set! (-> obj region) arg0) + (logior! (-> this flags) (editable-flag changed)) + (set! (-> this region) arg0) ) 0 (none) @@ -479,27 +479,27 @@ ;; definition for method 9 of type editable ;; WARN: Return type mismatch int vs rgba. -(defmethod get-color editable ((obj editable) (arg0 int)) +(defmethod get-color editable ((this editable) (arg0 int)) "Returns the [[rgba]] that corresponds to the type of [[editable]] TODO - document the colors" (the-as rgba (cond - ((and (logtest? (-> obj flags) (editable-flag selected)) + ((and (logtest? (-> this flags) (editable-flag selected)) (< (mod (-> *display* real-clock frame-counter) 60) 30) ) (the-as int (the-as uint #x80ffffff)) ) - ((logtest? (-> obj flags) (editable-flag no-save)) + ((logtest? (-> this flags) (editable-flag no-save)) (shl #x80ff 16) ) - ((= (-> obj type) editable-point) + ((= (-> this type) editable-point) (the-as int (the-as uint #x800080ff)) ) - ((= (-> obj type) editable-sample) + ((= (-> this type) editable-sample) (the-as int (the-as uint #x80ff8000)) ) - ((= (-> obj type) editable-light) + ((= (-> this type) editable-light) (the-as int (the-as uint #x80ff0080)) ) - ((= (-> obj type) editable-entity) + ((= (-> this type) editable-entity) (the-as int (the-as uint #x80ff00ff)) ) (else @@ -511,15 +511,15 @@ ;; definition for method 10 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-10 editable ((obj editable)) - (when (logtest? (-> obj flags) (editable-flag selected)) +(defmethod editable-method-10 editable ((this editable)) + (when (logtest? (-> this flags) (editable-flag selected)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (editable-method-11 obj s5-0) + (when (editable-method-11 this s5-0) (set! (-> s5-0 y) (-> s5-0 y)) (add-debug-x #t (bucket-id debug-no-zbuf1) s5-0 (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) ) ) - (add-debug-x #t (bucket-id debug-no-zbuf1) (edit-get-trans obj) (new 'static 'rgba :r #xff :g #xff :a #x80)) + (add-debug-x #t (bucket-id debug-no-zbuf1) (edit-get-trans this) (new 'static 'rgba :r #xff :g #xff :a #x80)) ) 0 (none) @@ -527,16 +527,16 @@ ;; definition for method 12 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod select-editable! editable ((obj editable) (arg0 symbol)) +(defmethod select-editable! editable ((this editable) (arg0 symbol)) (case arg0 (('toggle) - (logxor! (-> obj flags) (editable-flag selected)) + (logxor! (-> this flags) (editable-flag selected)) ) ((#f) - (logclear! (-> obj flags) (editable-flag selected)) + (logclear! (-> this flags) (editable-flag selected)) ) (else - (logior! (-> obj flags) (editable-flag selected)) + (logior! (-> this flags) (editable-flag selected)) ) ) 0 @@ -544,18 +544,18 @@ ) ;; definition for method 13 of type editable -(defmethod edit-get-distance editable ((obj editable) (arg0 vector)) +(defmethod edit-get-distance editable ((this editable) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" -1.0 ) ;; definition for method 20 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-20 editable ((obj editable) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod editable-method-20 editable ((this editable) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (local-vars (sv-48 vector) (sv-52 vector)) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) - (let ((s4-0 (edit-get-trans obj))) + (let ((s4-0 (edit-get-trans this))) (reverse-transform-point! sv-48 s4-0 arg2 arg0) (reverse-transform-point! sv-52 s4-0 arg2 arg1) (vector-! arg3 sv-52 sv-48) @@ -564,17 +564,17 @@ (if (< 20480.0 (vector-length arg3)) (vector-normalize! arg3 20480.0) ) - (editable-method-15 obj arg3 56) + (editable-method-15 this arg3 56) 0 (none) ) ;; definition for method 11 of type editable ;; INFO: Used lq/sq -(defmethod editable-method-11 editable ((obj editable) (arg0 vector)) +(defmethod editable-method-11 editable ((this editable) (arg0 vector)) (with-pp (let ((s5-0 (new 'stack 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> (edit-get-trans obj) quad)) + (set! (-> s5-0 start-pos quad) (-> (edit-get-trans this) quad)) (set-vector! (-> s5-0 move-dist) 0.0 -204800.0 0.0 1.0) (let ((v1-5 s5-0)) (set! (-> v1-5 radius) 40.96) @@ -596,78 +596,78 @@ ;; definition for method 24 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-24 editable ((obj editable)) +(defmethod editable-method-24 editable ((this editable)) 0 (none) ) ;; definition for method 17 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-17 editable ((obj editable) (arg0 vector)) +(defmethod editable-method-17 editable ((this editable) (arg0 vector)) 0 (none) ) ;; definition for method 22 of type editable -(defmethod editable-method-22 editable ((obj editable) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable ((this editable) (arg0 editable-array) (arg1 int) (arg2 int)) #t ) ;; definition for method 15 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-15 editable ((obj editable) (arg0 vector) (arg1 int)) +(defmethod editable-method-15 editable ((this editable) (arg0 vector) (arg1 int)) 0 (none) ) ;; definition for method 16 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod edit-coord! editable ((obj editable) (arg0 vector) (arg1 editable-flag)) +(defmethod edit-coord! editable ((this editable) (arg0 vector) (arg1 editable-flag)) 0 (none) ) ;; definition for method 18 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-18 editable ((obj editable) (arg0 vector) (arg1 matrix)) +(defmethod editable-method-18 editable ((this editable) (arg0 vector) (arg1 matrix)) 0 (none) ) ;; definition for method 14 of type editable -(defmethod edit-get-trans editable ((obj editable)) +(defmethod edit-get-trans editable ((this editable)) "Returns the `trans` [[vector]] or [[*null-vector*]]" *null-vector* ) ;; definition for method 19 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-19 editable ((obj editable) (arg0 vector)) +(defmethod editable-method-19 editable ((this editable) (arg0 vector)) 0 (none) ) ;; definition for method 26 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-26 editable ((obj editable) (arg0 editable) (arg1 editable-array)) +(defmethod editable-method-26 editable ((this editable) (arg0 editable) (arg1 editable-array)) 0 (none) ) ;; definition for method 25 of type editable ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-25 editable ((obj editable) (arg0 editable-array)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-25 editable ((this editable) (arg0 editable-array)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) - (let* ((s4-0 (-> obj owner)) + (logior! (-> this flags) (editable-flag changed)) + (let* ((s4-0 (-> this owner)) (a0-3 (car s4-0)) ) (while (not (null? s4-0)) - (editable-method-26 (the-as editable a0-3) obj arg0) + (editable-method-26 (the-as editable a0-3) this arg0) (set! s4-0 (cdr s4-0)) (set! a0-3 (car s4-0)) ) @@ -677,11 +677,11 @@ ) ;; definition for method 27 of type editable -(defmethod editable-method-27 editable ((obj editable) (arg0 editable-array)) +(defmethod editable-method-27 editable ((this editable) (arg0 editable-array)) (local-vars (s4-0 editable)) (let ((v1-0 0)) (while (< v1-0 (-> arg0 selection length)) - (when (= obj (-> arg0 selection v1-0)) + (when (= this (-> arg0 selection v1-0)) (set! s4-0 (-> arg0 selection (+ v1-0 1))) (goto cfg-10) ) @@ -690,14 +690,14 @@ ) (let ((s3-0 (editable-array-method-11 arg0))) (set! s4-0 (when (>= s3-0 0) - (set! s4-0 (copy obj 'debug)) + (set! s4-0 (copy this 'debug)) (let ((v1-9 (-> arg0 region))) (if v1-9 (set! (-> s4-0 region) v1-9) ) ) (set! (-> s4-0 region changed) #t) - (logior! (-> obj flags) (editable-flag changed)) + (logior! (-> this flags) (editable-flag changed)) (set! (-> s4-0 id) (the-as uint 0)) (set! (-> s4-0 owner) '()) (select-editable! s4-0 #f) @@ -707,7 +707,7 @@ ) (set! *editable-temp-id* (+ *editable-temp-id* 1)) (set! (-> arg0 data s3-0) s4-0) - (set! (-> arg0 selection (-> arg0 selection length)) obj) + (set! (-> arg0 selection (-> arg0 selection length)) this) (set! (-> arg0 selection (+ (-> arg0 selection length) 1)) s4-0) (+! (-> arg0 selection length) 2) s4-0 @@ -719,55 +719,55 @@ ) ;; definition for method 2 of type editable-point -(defmethod print editable-point ((obj editable-point)) +(defmethod print editable-point ((this editable-point)) (format #t "#<~A~S~m ~m ~m :r ~m" - (-> obj type) - (if (logtest? (-> obj flags) (editable-flag changed)) + (-> this type) + (if (logtest? (-> this flags) (editable-flag changed)) " (m)" "" ) - (-> obj trans x) - (-> obj trans y) - (-> obj trans z) - (-> obj radius) + (-> this trans x) + (-> this trans y) + (-> this trans z) + (-> this radius) ) - (format #t " @ #x~X>" obj) - obj + (format #t " @ #x~X>" this) + this ) ;; definition for method 28 of type editable-point ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 28 editable-point) has a return type of none, but the expression builder found a return statement. -(defmethod editable-method-28 editable-point ((obj editable-point) (arg0 editable-filter)) +(defmethod editable-method-28 editable-point ((this editable-point) (arg0 editable-filter)) (if (logtest? arg0 (editable-filter water-command)) (return #f) ) (let ((s4-0 (-> *editable* 0 current))) (cond - ((logtest? (-> obj flags) (editable-flag top-set)) + ((logtest? (-> this flags) (editable-flag top-set)) (let* ((s3-0 (-> s4-0 length)) (s2-0 0) (a0-1 (-> s4-0 data s2-0)) ) (while (< s2-0 s3-0) - (if (and a0-1 (= (-> a0-1 region) (-> obj region)) (logtest? (-> a0-1 flags) (editable-flag top-set))) - (edit-coord! a0-1 (-> obj trans) (editable-flag y no-update)) + (if (and a0-1 (= (-> a0-1 region) (-> this region)) (logtest? (-> a0-1 flags) (editable-flag top-set))) + (edit-coord! a0-1 (-> this trans) (editable-flag y no-update)) ) (+! s2-0 1) (set! a0-1 (-> s4-0 data s2-0)) ) ) ) - ((logtest? (-> obj flags) (editable-flag bot-set)) + ((logtest? (-> this flags) (editable-flag bot-set)) (let* ((s3-1 (-> s4-0 length)) (s2-1 0) (a0-2 (-> s4-0 data s2-1)) ) (while (< s2-1 s3-1) - (if (and a0-2 (= (-> a0-2 region) (-> obj region)) (logtest? (-> a0-2 flags) (editable-flag bot-set))) - (edit-coord! a0-2 (-> obj trans) (editable-flag y no-update)) + (if (and a0-2 (= (-> a0-2 region) (-> this region)) (logtest? (-> a0-2 flags) (editable-flag bot-set))) + (edit-coord! a0-2 (-> this trans) (editable-flag y no-update)) ) (+! s2-1 1) (set! a0-2 (-> s4-0 data s2-1)) @@ -777,7 +777,7 @@ ) ) ((the-as (function editable-point editable-command none) (find-parent-method editable-point 28)) - obj + this (the-as editable-command arg0) ) 0 @@ -786,73 +786,73 @@ ;; definition for method 15 of type editable-point ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-15 editable-point ((obj editable-point) (arg0 vector) (arg1 int)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-15 editable-point ((this editable-point) (arg0 vector) (arg1 int)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) - (vector+! (-> obj trans) (-> obj trans) arg0) - (editable-method-28 obj (the-as editable-filter arg1)) + (logior! (-> this flags) (editable-flag changed)) + (vector+! (-> this trans) (-> this trans) arg0) + (editable-method-28 this (the-as editable-filter arg1)) 0 (none) ) ;; definition for method 16 of type editable-point ;; WARN: Return type mismatch int vs none. -(defmethod edit-coord! editable-point ((obj editable-point) (arg0 vector) (arg1 editable-flag)) - (let ((v1-0 (-> obj region))) +(defmethod edit-coord! editable-point ((this editable-point) (arg0 vector) (arg1 editable-flag)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) + (logior! (-> this flags) (editable-flag changed)) (if (logtest? arg1 (editable-flag x)) - (set! (-> obj trans x) (-> arg0 x)) + (set! (-> this trans x) (-> arg0 x)) ) (if (logtest? arg1 (editable-flag y)) - (set! (-> obj trans y) (-> arg0 y)) + (set! (-> this trans y) (-> arg0 y)) ) (if (logtest? arg1 (editable-flag z)) - (set! (-> obj trans z) (-> arg0 z)) + (set! (-> this trans z) (-> arg0 z)) ) - (editable-method-28 obj (the-as editable-filter arg1)) + (editable-method-28 this (the-as editable-filter arg1)) 0 (none) ) ;; definition for method 14 of type editable-point -(defmethod edit-get-trans editable-point ((obj editable-point)) +(defmethod edit-get-trans editable-point ((this editable-point)) "Returns the `trans` [[vector]] or [[*null-vector*]]" - (-> obj trans) + (-> this trans) ) ;; definition for method 18 of type editable-point ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-18 editable-point ((obj editable-point) (arg0 vector) (arg1 matrix)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-18 editable-point ((this editable-point) (arg0 vector) (arg1 matrix)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) - (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> obj trans) arg0))) + (logior! (-> this flags) (editable-flag changed)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this trans) arg0))) (vector-matrix*! s4-1 s4-1 arg1) - (vector+! (-> obj trans) s4-1 arg0) + (vector+! (-> this trans) s4-1 arg0) ) 0 (none) ) ;; definition for method 10 of type editable-point -(defmethod editable-method-10 editable-point ((obj editable-point)) +(defmethod editable-method-10 editable-point ((this editable-point)) (let* ((s5-0 vector-vector-distance) (a0-1 (math-camera-pos)) - (a1-0 (-> obj trans)) - (f0-1 (- (s5-0 a0-1 a1-0) (-> obj radius))) + (a1-0 (-> this trans)) + (f0-1 (- (s5-0 a0-1 a1-0) (-> this radius))) (s2-0 (cond - ((logtest? (-> obj flags) (editable-flag selected)) + ((logtest? (-> this flags) (editable-flag selected)) 6 ) ((>= f0-1 983040.0) @@ -872,29 +872,29 @@ ) (add-debug-sphere-from-table (bucket-id debug2) - (-> obj trans) - (-> obj radius) - (get-color obj (the-as int a1-0)) + (-> this trans) + (-> this radius) + (get-color this (the-as int a1-0)) s2-0 ) ) - ((method-of-type editable editable-method-10) obj) + ((method-of-type editable editable-method-10) this) (none) ) ;; definition for method 13 of type editable-point ;; INFO: Used lq/sq -(defmethod edit-get-distance editable-point ((obj editable-point) (arg0 vector)) +(defmethod edit-get-distance editable-point ((this editable-point) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((a0-1 (new 'stack-no-clear 'sphere)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-1 quad) (-> obj trans quad)) - (set! (-> a0-1 r) (-> obj radius)) + (set! (-> a0-1 quad) (-> this trans quad)) + (set! (-> a0-1 r) (-> this radius)) (when (sphere-in-view-frustum? a0-1) - (reverse-transform-point! s5-0 (-> obj trans) (-> *math-camera* inv-camera-rot vector 2) arg0) - (let ((f0-1 (vector-vector-distance (edit-get-trans obj) s5-0))) - (if (>= (-> obj radius) f0-1) + (reverse-transform-point! s5-0 (-> this trans) (-> *math-camera* inv-camera-rot vector 2) arg0) + (let ((f0-1 (vector-vector-distance (edit-get-trans this) s5-0))) + (if (>= (-> this radius) f0-1) (return f0-1) ) ) @@ -905,23 +905,23 @@ ;; definition for method 19 of type editable-point ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-19 editable-point ((obj editable-point) (arg0 vector)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-19 editable-point ((this editable-point) (arg0 vector)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)))) - (vector-normalize! s4-1 (-> obj radius)) - (vector-! (-> obj trans) arg0 s4-1) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))) + (vector-normalize! s4-1 (-> this radius)) + (vector-! (-> this trans) arg0 s4-1) ) - (editable-method-28 obj (editable-filter load)) + (editable-method-28 this (editable-filter load)) 0 (none) ) ;; definition for method 22 of type editable-point -(defmethod editable-method-22 editable-point ((obj editable-point) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-point ((this editable-point) (arg0 editable-array) (arg1 int) (arg2 int)) (case arg1 ((2) (let ((s3-0 (clear *temp-string*))) @@ -929,13 +929,13 @@ s3-0 "insert into region_point set region_face_id=LAST_INSERT_ID(),idx=~D,x=~f,y=~f,z=~f" arg2 - (- (-> obj trans x) (-> arg0 level-offset x)) - (- (-> obj trans y) (-> arg0 level-offset y)) - (- (-> obj trans z) (-> arg0 level-offset z)) + (- (-> this trans x) (-> arg0 level-offset x)) + (- (-> this trans y) (-> arg0 level-offset y)) + (- (-> this trans z) (-> arg0 level-offset z)) ) (let ((a0-5 (sql-query s3-0))) (when (= (-> a0-5 error) 'modify) - (logclear! (-> obj flags) (editable-flag changed)) + (logclear! (-> this flags) (editable-flag changed)) #t ) ) @@ -949,55 +949,55 @@ ;; definition for method 17 of type editable-sphere ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-17 editable-sphere ((obj editable-sphere) (arg0 vector)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-17 editable-sphere ((this editable-sphere) (arg0 vector)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) + (logior! (-> this flags) (editable-flag changed)) (if (= (-> arg0 y) 0.0) - (+! (-> obj radius) (-> arg0 x)) - (set! (-> obj radius) (-> arg0 y)) + (+! (-> this radius) (-> arg0 x)) + (set! (-> this radius) (-> arg0 y)) ) - (if (< (-> obj radius) 0.0) - (set! (-> obj radius) 0.0) + (if (< (-> this radius) 0.0) + (set! (-> this radius) 0.0) ) - (editable-method-28 obj (editable-filter load)) + (editable-method-28 this (editable-filter load)) 0 (none) ) ;; definition for method 22 of type editable-sphere -(defmethod editable-method-22 editable-sphere ((obj editable-sphere) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-sphere ((this editable-sphere) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((gp-0 (clear *temp-string*))) (format gp-0 "insert into region_sphere set region_id=~D,x=~f,y=~f,z=~f,r=~f" - (-> obj region id) - (- (-> obj trans x) (-> arg0 level-offset x)) - (- (-> obj trans y) (-> arg0 level-offset y)) - (- (-> obj trans z) (-> arg0 level-offset z)) - (-> obj radius) + (-> this region id) + (- (-> this trans x) (-> arg0 level-offset x)) + (- (-> this trans y) (-> arg0 level-offset y)) + (- (-> this trans z) (-> arg0 level-offset z)) + (-> this radius) ) (= (-> (sql-query gp-0) error) 'modify) ) ) ;; definition for method 22 of type editable-sample -(defmethod editable-method-22 editable-sample ((obj editable-sample) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-sample ((this editable-sample) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((s5-0 (clear *temp-string*))) (format s5-0 "insert into sample_point set level_info_id=~D,x=~f,y=~f,z=~f,source='manual'" (-> arg0 level-info-id) - (* 0.00024414062 (- (-> obj trans x) (-> arg0 level-offset x))) - (* 0.00024414062 (- (-> obj trans y) (-> arg0 level-offset y))) - (* 0.00024414062 (- (-> obj trans z) (-> arg0 level-offset z))) + (* 0.00024414062 (- (-> this trans x) (-> arg0 level-offset x))) + (* 0.00024414062 (- (-> this trans y) (-> arg0 level-offset y))) + (* 0.00024414062 (- (-> this trans z) (-> arg0 level-offset z))) ) (let ((a0-4 (sql-query s5-0))) (when (= (-> a0-4 error) 'modify) - (logclear! (-> obj flags) (editable-flag changed)) + (logclear! (-> this flags) (editable-flag changed)) #t ) ) @@ -1005,40 +1005,40 @@ ) ;; definition for method 2 of type editable-light -(defmethod print editable-light ((obj editable-light)) +(defmethod print editable-light ((this editable-light)) (format #t "#<~A~S ~S ~m ~m ~m" - (-> obj type) - (if (logtest? (-> obj flags) (editable-flag changed)) + (-> this type) + (if (logtest? (-> this flags) (editable-flag changed)) " (m)" "" ) - (-> obj name) - (-> obj trans x) - (-> obj trans y) - (-> obj trans z) + (-> this name) + (-> this trans x) + (-> this trans y) + (-> this trans z) ) - (format #t " :r ~m @ #x~X>" (-> obj radius) obj) - obj + (format #t " :r ~m @ #x~X>" (-> this radius) this) + this ) ;; definition for method 23 of type editable-light ;; INFO: Used lq/sq -(defmethod editable-method-23 editable-light ((obj editable-light)) +(defmethod editable-method-23 editable-light ((this editable-light)) (let ((v1-0 *light-hash*)) (let* ((a2-0 (-> v1-0 num-lights)) (a1-1 (-> v1-0 light-sphere-array a2-0)) ) - (set! (-> a1-1 name) (-> obj name)) - (set! (-> a1-1 decay-start) (-> obj decay-start)) - (set! (-> a1-1 ambient-point-ratio) (-> obj ambient-point-ratio)) - (set! (-> a1-1 brightness) (-> obj brightness)) - (set! (-> a1-1 bsphere quad) (-> obj trans quad)) - (set! (-> a1-1 bsphere w) (-> obj radius)) - (set! (-> a1-1 direction quad) (-> obj direction quad)) - (set! (-> a1-1 color quad) (-> obj color quad)) - (set! (-> a1-1 palette-index) (the int (-> obj color w))) + (set! (-> a1-1 name) (-> this name)) + (set! (-> a1-1 decay-start) (-> this decay-start)) + (set! (-> a1-1 ambient-point-ratio) (-> this ambient-point-ratio)) + (set! (-> a1-1 brightness) (-> this brightness)) + (set! (-> a1-1 bsphere quad) (-> this trans quad)) + (set! (-> a1-1 bsphere w) (-> this radius)) + (set! (-> a1-1 direction quad) (-> this direction quad)) + (set! (-> a1-1 color quad) (-> this color quad)) + (set! (-> a1-1 palette-index) (the int (-> this color w))) ) (+! (-> v1-0 num-lights) 1) ) @@ -1067,38 +1067,38 @@ ;; definition for method 17 of type editable-light ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-17 editable-light ((obj editable-light) (arg0 vector)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-17 editable-light ((this editable-light) (arg0 vector)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) + (logior! (-> this flags) (editable-flag changed)) (if (= (-> arg0 y) 0.0) - (+! (-> obj radius) (-> arg0 x)) - (set! (-> obj radius) (-> arg0 y)) + (+! (-> this radius) (-> arg0 x)) + (set! (-> this radius) (-> arg0 y)) ) - (if (< (-> obj radius) 0.0) - (set! (-> obj radius) 0.0) + (if (< (-> this radius) 0.0) + (set! (-> this radius) 0.0) ) - (update-light-sphere-from-editable-light obj) - (editable-method-28 obj (editable-filter load)) + (update-light-sphere-from-editable-light this) + (editable-method-28 this (editable-filter load)) 0 (none) ) ;; definition for method 15 of type editable-light ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-15 editable-light ((obj editable-light) (arg0 vector) (arg1 int)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-15 editable-light ((this editable-light) (arg0 vector) (arg1 int)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) - (vector+! (-> obj trans) (-> obj trans) arg0) - (update-light-sphere-from-editable-light obj) - (editable-method-28 obj (the-as editable-filter arg1)) + (logior! (-> this flags) (editable-flag changed)) + (vector+! (-> this trans) (-> this trans) arg0) + (update-light-sphere-from-editable-light this) + (editable-method-28 this (the-as editable-filter arg1)) 0 (none) ) @@ -1106,14 +1106,14 @@ ;; definition for method 25 of type editable-light ;; 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 ((obj editable-light) (arg0 editable-array)) - ((the-as (function editable-light editable-array none) (find-parent-method editable-light 25)) obj arg0) - (when (nonzero? (-> obj id)) +(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) + (when (nonzero? (-> this id)) (let ((s5-1 (clear *temp-string*))) - (format s5-1 "delete from light where light_id=~D" (-> obj id)) + (format s5-1 "delete from light where light_id=~D" (-> this id)) (let ((a2-1 (sql-query s5-1))) (when (!= (-> a2-1 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-1 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-1 this) (return 0) ) ) @@ -1124,62 +1124,68 @@ ) ;; definition for method 22 of type editable-light -(defmethod editable-method-22 editable-light ((obj editable-light) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-light ((this editable-light) (arg0 editable-array) (arg1 int) (arg2 int)) (cond - ((logtest? (-> obj flags) (editable-flag changed)) + ((logtest? (-> this flags) (editable-flag changed)) (let ((s5-0 (clear *temp-string*))) - (when (zero? (-> obj id)) - (format s5-0 "insert into light set level_name='~S'" (-> obj region level)) + (when (zero? (-> this id)) + (format s5-0 "insert into light set level_name='~S'" (-> this region level)) (let ((s3-0 (sql-query s5-0))) (when (= (-> s3-0 error) 'modify) (let ((v1-7 (sql-query "select LAST_INSERT_ID()"))) (when (= (-> v1-7 error) 'select) - (set! (-> obj id) (the-as uint (string->int (-> v1-7 data 0)))) + (set! (-> this id) (the-as uint (string->int (-> v1-7 data 0)))) (goto cfg-8) ) ) ) - (format 0 "ERROR: sql: id insert error ~A for ~A~%" s3-0 obj) + (format 0 "ERROR: sql: id insert error ~A for ~A~%" s3-0 this) ) (return #f) (label cfg-8) (let ((s3-1 (new 'debug 'string 32 (the-as string #f)))) - (format s3-1 "light-~d" (-> obj id)) - (set! (-> obj name) s3-1) + (format s3-1 "light-~d" (-> this id)) + (set! (-> this name) s3-1) ) ) - (format (clear s5-0) "update light set level_name='~S', name='~S'" (-> obj region level) (-> obj name)) + (format (clear s5-0) "update light set level_name='~S', name='~S'" (-> this region level) (-> this name)) (format s5-0 ", pos_x=~f, pos_y=~f, pos_z=~f, r=~f" - (* 0.00024414062 (- (-> obj trans x) (-> arg0 level-offset x))) - (* 0.00024414062 (- (-> obj trans y) (-> arg0 level-offset y))) - (* 0.00024414062 (- (-> obj trans z) (-> arg0 level-offset z))) - (* 0.00024414062 (-> obj radius)) + (* 0.00024414062 (- (-> this trans x) (-> arg0 level-offset x))) + (* 0.00024414062 (- (-> this trans y) (-> arg0 level-offset y))) + (* 0.00024414062 (- (-> this trans z) (-> arg0 level-offset z))) + (* 0.00024414062 (-> this radius)) ) - (if (= (-> obj direction w) 0.0) + (if (= (-> this direction w) 0.0) (format s5-0 ", dir_x=0.0, dir_y=0.0, dir_z=0.0") - (format s5-0 ", dir_x=~f, dir_y=~f, dir_z=~f" (-> obj direction x) (-> obj direction y) (-> obj direction z)) + (format + s5-0 + ", dir_x=~f, dir_y=~f, dir_z=~f" + (-> this direction x) + (-> this direction y) + (-> this direction z) + ) ) (format s5-0 ", color0_r=~f, color0_g=~f, color0_b=~f, color0_a=~f" - (-> obj color x) - (-> obj color y) - (-> obj color z) - (-> obj color w) + (-> this color x) + (-> this color y) + (-> this color z) + (-> this color w) ) (format s5-0 ", decay_start=~f, ambient_point_ratio=~f, brightness=~f" - (-> obj decay-start) - (-> obj ambient-point-ratio) - (-> obj brightness) + (-> this decay-start) + (-> this ambient-point-ratio) + (-> this brightness) ) - (format s5-0 " where light_id=~D" (-> obj id)) + (format s5-0 " where light_id=~D" (-> this id)) (let ((a0-21 (sql-query s5-0))) (when (= (-> a0-21 error) 'modify) - (logclear! (-> obj flags) (editable-flag changed)) + (logclear! (-> this flags) (editable-flag changed)) #t ) ) @@ -1192,14 +1198,14 @@ ) ;; definition for method 10 of type editable-light -(defmethod editable-method-10 editable-light ((obj editable-light)) - (if (!= (-> obj direction w) 0.0) +(defmethod editable-method-10 editable-light ((this editable-light)) + (if (!= (-> this direction w) 0.0) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (edit-get-trans obj) - (-> obj direction) - (* -1.2 (-> obj radius)) + (edit-get-trans this) + (-> this direction) + (* -1.2 (-> this radius)) (new 'static 'rgba :r #xff :b #xff :a #x80) ) ) @@ -1208,34 +1214,34 @@ (s4-1 #t) (s3-1 318) ) - (format (clear *temp-string*) "~S~%" (-> obj name)) - (s5-1 s4-1 (the-as bucket-id s3-1) *temp-string* (-> obj trans) (font-color white) (the-as vector2h #f)) + (format (clear *temp-string*) "~S~%" (-> this name)) + (s5-1 s4-1 (the-as bucket-id s3-1) *temp-string* (-> this trans) (font-color white) (the-as vector2h #f)) ) ) - ((method-of-type editable-sphere editable-method-10) obj) + ((method-of-type editable-sphere editable-method-10) this) (none) ) ;; definition for method 14 of type editable-face ;; INFO: Used lq/sq -(defmethod edit-get-trans editable-face ((obj editable-face)) +(defmethod edit-get-trans editable-face ((this editable-face)) "Returns the `trans` [[vector]] or [[*null-vector*]]" "The center of the obj." (cond - ((>= (-> obj length) 3) + ((>= (-> this length) 3) (let ((s5-0 (new 'static 'vector))) (set! (-> s5-0 quad) (the-as uint128 0)) - (vector+! s5-0 s5-0 (edit-get-trans (-> obj vertex 0))) - (vector+! s5-0 s5-0 (edit-get-trans (-> obj vertex 1))) - (vector+! s5-0 s5-0 (edit-get-trans (-> obj vertex 2))) + (vector+! s5-0 s5-0 (edit-get-trans (-> this vertex 0))) + (vector+! s5-0 s5-0 (edit-get-trans (-> this vertex 1))) + (vector+! s5-0 s5-0 (edit-get-trans (-> this vertex 2))) (vector-float*! s5-0 s5-0 0.33333334) ) ) - ((>= (-> obj length) 2) + ((>= (-> this length) 2) (let ((s5-1 (new 'static 'vector))) (set! (-> s5-1 quad) (the-as uint128 0)) - (vector+! s5-1 s5-1 (edit-get-trans (-> obj vertex 0))) - (vector+! s5-1 s5-1 (edit-get-trans (-> obj vertex 1))) + (vector+! s5-1 s5-1 (edit-get-trans (-> this vertex 0))) + (vector+! s5-1 s5-1 (edit-get-trans (-> this vertex 1))) (vector-float*! s5-1 s5-1 0.5) ) ) @@ -1246,10 +1252,10 @@ ) ;; definition for method 22 of type editable-face -(defmethod editable-method-22 editable-face ((obj editable-face) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-face ((this editable-face) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((s4-0 (clear *temp-string*))) - (format s4-0 "insert into region_face set kind='face',region_id=~D" (-> obj region id)) - (if (logtest? (-> obj flags) (editable-flag orient)) + (format s4-0 "insert into region_face set kind='face',region_id=~D" (-> this region id)) + (if (logtest? (-> this flags) (editable-flag orient)) (format s4-0 ",flags='orient'") ) (let ((a0-5 (sql-query s4-0))) @@ -1258,54 +1264,54 @@ ) ) ) - (dotimes (s4-1 (-> obj length)) - (editable-method-22 (-> obj vertex s4-1) arg0 2 s4-1) + (dotimes (s4-1 (-> this length)) + (editable-method-22 (-> this vertex s4-1) arg0 2 s4-1) ) - (logclear! (-> obj flags) (editable-flag changed)) + (logclear! (-> this flags) (editable-flag changed)) #t ) ;; definition for method 25 of type editable-face -(defmethod editable-method-25 editable-face ((obj editable-face) (arg0 editable-array)) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj vertex s4-0))) - (set! (-> s3-0 owner) (delete! obj (-> s3-0 owner))) +(defmethod editable-method-25 editable-face ((this editable-face) (arg0 editable-array)) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this vertex s4-0))) + (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) ) ) - ((the-as (function editable-face editable-array none) (find-parent-method editable-face 25)) obj arg0) + ((the-as (function editable-face editable-array none) (find-parent-method editable-face 25)) this arg0) (none) ) ;; definition for method 26 of type editable-face -(defmethod editable-method-26 editable-face ((obj editable-face) (arg0 editable) (arg1 editable-array)) - (-> obj length) - (countdown (v1-1 (-> obj length)) - (when (= (-> obj vertex v1-1) arg0) +(defmethod editable-method-26 editable-face ((this editable-face) (arg0 editable) (arg1 editable-array)) + (-> this length) + (countdown (v1-1 (-> this length)) + (when (= (-> this vertex v1-1) arg0) (let ((a0-5 v1-1) - (a1-2 (+ (-> obj length) -2)) + (a1-2 (+ (-> this length) -2)) ) (while (>= a1-2 a0-5) - (set! (-> obj vertex a0-5) (-> obj vertex (+ a0-5 1))) + (set! (-> this vertex a0-5) (-> this vertex (+ a0-5 1))) (+! a0-5 1) ) ) - (+! (-> obj length) -1) + (+! (-> this length) -1) ) ) - (if (< (-> obj length) 3) - (editable-array-method-15 arg1 obj) + (if (< (-> this length) 3) + (editable-array-method-15 arg1 this) ) - ((method-of-type editable editable-method-26) obj arg0 arg1) + ((method-of-type editable editable-method-26) this arg0 arg1) (none) ) ;; definition for method 27 of type editable-face ;; WARN: Return type mismatch editable-face vs editable. -(defmethod editable-method-27 editable-face ((obj editable-face) (arg0 editable-array)) +(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)) obj arg0) + ((the-as (function editable-face editable-array editable) (find-parent-method editable-face 27)) this arg0) ) ) ) @@ -1319,26 +1325,26 @@ ;; definition for method 24 of type editable-face ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-24 editable-face ((obj editable-face)) - (logxor! (-> obj flags) (editable-flag orient)) - (editable-face-method-31 obj (-> obj normal)) - (logior! (-> obj flags) (editable-flag changed)) - (set! (-> obj region changed) #t) +(defmethod editable-method-24 editable-face ((this editable-face)) + (logxor! (-> this flags) (editable-flag orient)) + (editable-face-method-31 this (-> this normal)) + (logior! (-> this flags) (editable-flag changed)) + (set! (-> this region changed) #t) 0 (none) ) ;; definition for method 30 of type editable-face ;; INFO: Used lq/sq -(defmethod editable-face-method-30 editable-face ((obj editable-face) (arg0 (inline-array vector))) - (let ((v1-0 (-> obj length))) +(defmethod editable-face-method-30 editable-face ((this editable-face) (arg0 (inline-array vector))) + (let ((v1-0 (-> this length))) (cond ((or (zero? v1-0) (= v1-0 1)) 0 ) ((= v1-0 2) - (let ((s4-0 (edit-get-trans (-> obj vertex 0))) - (v1-3 (edit-get-trans (-> obj vertex 1))) + (let ((s4-0 (edit-get-trans (-> this vertex 0))) + (v1-3 (edit-get-trans (-> this vertex 1))) ) (set! (-> arg0 0 quad) (-> s4-0 quad)) (set! (-> arg0 1 quad) (-> s4-0 quad)) @@ -1350,10 +1356,10 @@ 4 ) (else - (dotimes (s4-1 (-> obj length)) - (set! (-> arg0 s4-1 quad) (-> (edit-get-trans (-> obj vertex s4-1)) quad)) + (dotimes (s4-1 (-> this length)) + (set! (-> arg0 s4-1 quad) (-> (edit-get-trans (-> this vertex s4-1)) quad)) ) - (-> obj length) + (-> this length) ) ) ) @@ -1361,16 +1367,16 @@ ;; definition for method 31 of type editable-face ;; INFO: Used lq/sq -(defmethod editable-face-method-31 editable-face ((obj editable-face) (arg0 vector)) +(defmethod editable-face-method-31 editable-face ((this editable-face) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'matrix))) (dotimes (v1-0 6) (set! (-> s4-0 quad v1-0) (the-as uint128 0)) ) - (if (>= (editable-face-method-30 obj (the-as (inline-array vector) s4-0)) 3) + (if (>= (editable-face-method-30 this (the-as (inline-array vector) s4-0)) 3) (normal-of-plane arg0 (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) (-> s4-0 vector 2)) ) ) - (if (logtest? (-> obj flags) (editable-flag orient)) + (if (logtest? (-> this flags) (editable-flag orient)) (vector-negate! arg0 arg0) ) arg0 @@ -1378,13 +1384,13 @@ ;; definition for method 13 of type editable-face ;; INFO: Used lq/sq -(defmethod edit-get-distance editable-face ((obj editable-face) (arg0 vector)) +(defmethod edit-get-distance editable-face ((this editable-face) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((gp-0 (new 'stack-no-clear 'vector)) - (s5-0 (editable-face-method-31 obj (new 'stack-no-clear 'vector))) + (s5-0 (editable-face-method-31 this (new 'stack-no-clear 'vector))) (s2-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s2-0 quad) (-> (edit-get-trans (-> obj vertex 0)) quad)) + (set! (-> s2-0 quad) (-> (edit-get-trans (-> this vertex 0)) quad)) (transform-point-vector! gp-0 s2-0) (when (< 0.0 (-> gp-0 z)) (reverse-transform-point! gp-0 s2-0 s5-0 arg0) @@ -1392,7 +1398,7 @@ (dotimes (v1-5 6) (set! (-> points v1-5 quad) (the-as uint128 0)) ) - (let ((s4-1 (editable-face-method-30 obj points)) + (let ((s4-1 (editable-face-method-30 this points)) (s2-1 0) (s1-1 (vector-negate! (new 'stack-no-clear 'vector) s5-0)) ) @@ -1471,7 +1477,7 @@ ;; WARN: Stack slot offset 400 signed mismatch ;; WARN: Stack slot offset 292 signed mismatch ;; WARN: Return type mismatch int vs symbol. -(defmethod editable-method-29 editable-face ((obj editable-face) (arg0 editable-filter)) +(defmethod editable-method-29 editable-face ((this editable-face) (arg0 editable-filter)) (local-vars (sv-208 (inline-array vector)) (sv-216 int) @@ -1484,19 +1490,19 @@ (sv-380 symbol) (sv-400 float) ) - (if (or (logtest? arg0 (editable-filter water-command)) (logtest? (-> obj flags) (editable-flag mark))) + (if (or (logtest? arg0 (editable-filter water-command)) (logtest? (-> this flags) (editable-flag mark))) (return (the-as symbol #f)) ) - (logior! (-> obj flags) (editable-flag mark)) + (logior! (-> this flags) (editable-flag mark)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 6))) (dotimes (v1-7 6) (set! (-> s5-0 v1-7 quad) (the-as uint128 0)) ) - (let ((s4-0 (editable-face-method-30 obj s5-0))) - (when (and (>= s4-0 4) (>= (-> obj length) 3)) + (let ((s4-0 (editable-face-method-30 this s5-0))) + (when (and (>= s4-0 4) (>= (-> this length) 3)) (let ((v1-14 0)) (dotimes (a0-7 s4-0) - (if (logtest? (-> obj vertex a0-7 flags) (editable-flag selected)) + (if (logtest? (-> this vertex a0-7 flags) (editable-flag selected)) (+! v1-14 1) ) ) @@ -1513,38 +1519,38 @@ ) (set! sv-216 0) (dotimes (s2-2 s4-0) - (when (not (logtest? (-> obj vertex s2-2 flags) (editable-flag selected))) - (set! (-> sv-208 sv-216 quad) (-> (edit-get-trans (-> obj vertex s2-2)) quad)) + (when (not (logtest? (-> this vertex s2-2 flags) (editable-flag selected))) + (set! (-> sv-208 sv-216 quad) (-> (edit-get-trans (-> this vertex s2-2)) quad)) (set! sv-216 (+ sv-216 1)) ) ) (dotimes (s2-3 s4-0) - (when (logtest? (-> obj vertex s2-3 flags) (editable-flag selected)) - (set! (-> sv-208 sv-216 quad) (-> (edit-get-trans (-> obj vertex s2-3)) quad)) + (when (logtest? (-> this vertex s2-3 flags) (editable-flag selected)) + (set! (-> sv-208 sv-216 quad) (-> (edit-get-trans (-> this vertex s2-3)) quad)) (set! sv-216 (+ sv-216 1)) ) ) - (normal-of-plane (-> obj normal) (-> sv-208 0) (-> sv-208 1) (-> sv-208 2)) - (set! (-> obj center quad) (-> (edit-get-trans obj) quad)) + (normal-of-plane (-> this normal) (-> sv-208 0) (-> sv-208 1) (-> sv-208 2)) + (set! (-> this center quad) (-> (edit-get-trans this) quad)) ) ) ) (when (not (logtest? arg0 (editable-filter load))) - (when (= (-> obj normal w) 0.0) - (editable-face-method-31 obj (-> obj normal)) - (set! (-> obj center quad) (-> (edit-get-trans obj) quad)) + (when (= (-> this normal w) 0.0) + (editable-face-method-31 this (-> this normal)) + (set! (-> this center quad) (-> (edit-get-trans this) quad)) ) (let ((s3-2 0) - (s2-5 (-> obj normal)) - (s1-2 (-> obj center)) + (s2-5 (-> this normal)) + (s1-2 (-> this center)) ) (while (< s3-2 s4-0) - (when (logtest? (-> obj vertex s3-2 flags) (editable-flag selected)) + (when (logtest? (-> this vertex s3-2 flags) (editable-flag selected)) (let* ((a1-14 (vector-! (new 'stack-no-clear 'vector) (-> s5-0 s3-2) s1-2)) (f0-2 (vector-dot a1-14 s2-5)) ) (edit-coord! - (-> obj vertex s3-2) + (-> this vertex s3-2) (vector+float*! a1-14 (-> s5-0 s3-2) s2-5 (- f0-2)) (editable-flag x y z no-plane-snap) ) @@ -1562,29 +1568,29 @@ 6 ) ) - (set! sv-292 (+ (-> obj length) -1)) + (set! sv-292 (+ (-> this length) -1)) (set! sv-296 1) - (editable-face-method-31 obj (-> obj normal)) + (editable-face-method-31 this (-> this normal)) (dotimes (v1-85 sv-292) - (set! (-> (the-as (array editable-point) sv-288) v1-85) (-> obj vertex (+ v1-85 1))) + (set! (-> (the-as (array editable-point) sv-288) v1-85) (-> this vertex (+ v1-85 1))) ) (set! sv-368 (new-stack-matrix0)) (set! sv-372 (the-as editable-point #f)) (set! sv-376 (the-as float 0.0)) (set! sv-380 #t) (vector-normalize! - (vector-! (-> sv-368 vector 2) (edit-get-trans obj) (edit-get-trans (-> obj vertex 0))) + (vector-! (-> sv-368 vector 2) (edit-get-trans this) (edit-get-trans (-> this vertex 0))) 1.0 ) - (vector-normalize! (editable-face-method-31 obj (-> sv-368 vector 1)) 1.0) + (vector-normalize! (editable-face-method-31 this (-> sv-368 vector 1)) 1.0) (vector-normalize! (vector-cross! (the-as vector (-> sv-368 vector)) (-> sv-368 vector 2) (-> sv-368 vector 1)) 1.0 ) - (set! (-> sv-368 trans quad) (-> (edit-get-trans (-> obj vertex 0)) quad)) + (set! (-> sv-368 trans quad) (-> (edit-get-trans (-> this vertex 0)) quad)) (set! (-> sv-368 trans w) 1.0) (matrix-4x4-inverse! sv-368 sv-368) - (while (< sv-296 (-> obj length)) + (while (< sv-296 (-> this length)) (set! sv-372 (the-as editable-point #f)) (dotimes (s5-4 sv-292) (when (-> (the-as (array editable-point) sv-288) s5-4) @@ -1609,7 +1615,7 @@ ) ) ) - (set! (-> obj vertex sv-296) sv-372) + (set! (-> this vertex sv-296) sv-372) (dotimes (v1-137 sv-292) (if (= sv-372 (-> (the-as (array editable-point) sv-288) v1-137)) (set! (-> (the-as (array editable-point) sv-288) v1-137) #f) @@ -1618,39 +1624,39 @@ (set! sv-296 (+ sv-296 1)) (set! sv-380 (not sv-380)) ) - (if (< (vector-dot (-> obj normal) (editable-face-method-31 obj (new 'stack-no-clear 'vector))) 0.0) - (logxor! (-> obj flags) (editable-flag orient)) + (if (< (vector-dot (-> this normal) (editable-face-method-31 this (new 'stack-no-clear 'vector))) 0.0) + (logxor! (-> this flags) (editable-flag orient)) ) ) ) ) - (editable-face-method-31 obj (-> obj normal)) - (set! (-> obj center quad) (-> (edit-get-trans obj) quad)) + (editable-face-method-31 this (-> this normal)) + (set! (-> this center quad) (-> (edit-get-trans this) quad)) (the-as symbol 0) ) ;; definition for method 10 of type editable-face ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-10 editable-face ((obj editable-face)) +(defmethod editable-method-10 editable-face ((this editable-face)) (local-vars (sv-112 int)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 6))) (dotimes (v1-0 6) (set! (-> gp-0 v1-0 quad) (the-as uint128 0)) ) - (set! sv-112 (editable-face-method-30 obj gp-0)) + (set! sv-112 (editable-face-method-30 this gp-0)) (when (>= sv-112 3) - (let ((s1-0 (editable-face-method-31 obj (new 'stack-no-clear 'vector)))) + (let ((s1-0 (editable-face-method-31 this (new 'stack-no-clear 'vector)))) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (edit-get-trans obj) + (edit-get-trans this) s1-0 (meters 2) (new 'static 'rgba :r #xff :g #xff :a #x80) ) ) - (when (logtest? (-> obj flags) (editable-flag selected)) + (when (logtest? (-> this flags) (editable-flag selected)) (dotimes (s4-1 sv-112) (let ((s3-1 add-debug-text-3d) (s2-1 #t) @@ -1662,7 +1668,7 @@ (the-as bucket-id s1-1) *temp-string* (-> gp-0 s4-1) - (if (logtest? (-> obj flags) (editable-flag orient)) + (if (logtest? (-> this flags) (editable-flag orient)) (font-color yellow) (font-color white) ) @@ -1675,15 +1681,15 @@ (bucket-id debug2) gp-0 sv-112 - (if (logtest? (-> obj flags) (editable-flag orient)) + (if (logtest? (-> this flags) (editable-flag orient)) (new 'static 'rgba :r #xff :a #x80) (new 'static 'rgba :r #xff :g #xff :a #x80) ) - (if (not (logtest? (-> obj flags) (editable-flag orient))) + (if (not (logtest? (-> this flags) (editable-flag orient))) (new 'static 'rgba :r #xff :a #x80) (new 'static 'rgba :r #xff :g #xff :a #x80) ) - (if (logtest? (-> obj flags) (editable-flag selected)) + (if (logtest? (-> this flags) (editable-flag selected)) 1 0 ) @@ -1695,22 +1701,22 @@ ) ;; definition for method 14 of type editable-plane -(defmethod edit-get-trans editable-plane ((obj editable-plane)) +(defmethod edit-get-trans editable-plane ((this editable-plane)) "Returns the `trans` [[vector]] or [[*null-vector*]]" - (if (>= (-> obj length) 1) - (edit-get-trans (-> obj vertex 0)) + (if (>= (-> this length) 1) + (edit-get-trans (-> this vertex 0)) *null-vector* ) ) ;; definition for method 22 of type editable-plane -(defmethod editable-method-22 editable-plane ((obj editable-plane) (arg0 editable-array) (arg1 int) (arg2 int)) +(defmethod editable-method-22 editable-plane ((this editable-plane) (arg0 editable-array) (arg1 int) (arg2 int)) (let ((s4-0 (clear *temp-string*))) (format s4-0 "insert into region_face set kind='plane',region_id=~D,radius=~f" - (-> obj region id) - (-> obj radius) + (-> this region id) + (-> this radius) ) (let ((a0-4 (sql-query s4-0))) (if (!= (-> a0-4 error) 'modify) @@ -1718,38 +1724,38 @@ ) ) ) - (dotimes (s4-1 (-> obj length)) - (editable-method-22 (-> obj vertex s4-1) arg0 2 s4-1) + (dotimes (s4-1 (-> this length)) + (editable-method-22 (-> this vertex s4-1) arg0 2 s4-1) ) - (logclear! (-> obj flags) (editable-flag changed)) + (logclear! (-> this flags) (editable-flag changed)) #t ) ;; definition for method 25 of type editable-plane -(defmethod editable-method-25 editable-plane ((obj editable-plane) (arg0 editable-array)) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj vertex s4-0))) - (set! (-> s3-0 owner) (delete! obj (-> s3-0 owner))) +(defmethod editable-method-25 editable-plane ((this editable-plane) (arg0 editable-array)) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this vertex s4-0))) + (set! (-> s3-0 owner) (delete! this (-> s3-0 owner))) ) ) - ((the-as (function editable-plane editable-array none) (find-parent-method editable-plane 25)) obj arg0) + ((the-as (function editable-plane editable-array none) (find-parent-method editable-plane 25)) this arg0) (none) ) ;; definition for method 26 of type editable-plane -(defmethod editable-method-26 editable-plane ((obj editable-plane) (arg0 editable) (arg1 editable-array)) - (editable-array-method-15 arg1 obj) - ((method-of-type editable editable-method-26) obj arg0 arg1) +(defmethod editable-method-26 editable-plane ((this editable-plane) (arg0 editable) (arg1 editable-array)) + (editable-array-method-15 arg1 this) + ((method-of-type editable editable-method-26) this arg0 arg1) (none) ) ;; definition for method 27 of type editable-plane ;; WARN: Return type mismatch editable-plane vs editable. -(defmethod editable-method-27 editable-plane ((obj editable-plane) (arg0 editable-array)) +(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)) obj arg0) + ((the-as (function editable-plane editable-array editable) (find-parent-method editable-plane 27)) this arg0) ) ) ) @@ -1763,24 +1769,32 @@ ;; definition for method 24 of type editable-plane ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-24 editable-plane ((obj editable-plane)) +(defmethod editable-method-24 editable-plane ((this editable-plane)) (let ((s5-1 - (vector-! (new 'stack-no-clear 'vector) (edit-get-trans (-> obj vertex 1)) (edit-get-trans (-> obj vertex 0))) + (vector-! + (new 'stack-no-clear 'vector) + (edit-get-trans (-> this vertex 1)) + (edit-get-trans (-> this vertex 0)) + ) ) ) - (edit-coord! (-> obj vertex 1) (vector-! s5-1 (edit-get-trans (-> obj vertex 0)) s5-1) (editable-flag x y z)) + (edit-coord! + (-> this vertex 1) + (vector-! s5-1 (edit-get-trans (-> this vertex 0)) s5-1) + (editable-flag x y z) + ) ) - (set! (-> obj region changed) #t) - (logior! (-> obj flags) (editable-flag changed)) + (set! (-> this region changed) #t) + (logior! (-> this flags) (editable-flag changed)) 0 (none) ) ;; definition for method 30 of type editable-plane -(defmethod editable-plane-method-30 editable-plane ((obj editable-plane) (arg0 (inline-array vector))) - (case (-> obj length) +(defmethod editable-plane-method-30 editable-plane ((this editable-plane) (arg0 (inline-array vector))) + (case (-> this length) ((2) - (let* ((v1-2 (editable-plane-method-31 obj (new 'stack-no-clear 'vector))) + (let* ((v1-2 (editable-plane-method-31 this (new 'stack-no-clear 'vector))) (s5-1 (vector-cross! (new 'stack-no-clear 'vector) v1-2 @@ -1791,9 +1805,9 @@ ) ) (s4-1 (vector-cross! (new 'stack-no-clear 'vector) s5-1 v1-2)) - (f30-0 (-> obj radius)) + (f30-0 (-> this radius)) ) - (let ((v1-4 (edit-get-trans (-> obj vertex 0)))) + (let ((v1-4 (edit-get-trans (-> this vertex 0)))) (vector+float*! (-> arg0 0) v1-4 s5-1 f30-0) (vector+float*! (-> arg0 0) (-> arg0 0) s4-1 (- f30-0)) (vector+float*! (-> arg0 1) v1-4 s5-1 (- f30-0)) @@ -1813,11 +1827,11 @@ ) ;; definition for method 31 of type editable-plane -(defmethod editable-plane-method-31 editable-plane ((obj editable-plane) (arg0 vector)) - (case (-> obj length) +(defmethod editable-plane-method-31 editable-plane ((this editable-plane) (arg0 vector)) + (case (-> this length) ((2) - (let ((s3-0 (-> obj vertex 0)) - (a0-1 (-> obj vertex 1)) + (let ((s3-0 (-> this vertex 0)) + (a0-1 (-> this vertex 1)) ) (vector-! arg0 (edit-get-trans a0-1) (edit-get-trans s3-0)) ) @@ -1829,22 +1843,22 @@ ;; definition for method 13 of type editable-plane ;; INFO: Used lq/sq -(defmethod edit-get-distance editable-plane ((obj editable-plane) (arg0 vector)) +(defmethod edit-get-distance editable-plane ((this editable-plane) (arg0 vector)) "Returns the distance from the camera to the [[editable]], or -1.0" (let ((gp-0 (new 'stack-no-clear 'vector)) - (s5-0 (editable-plane-method-31 obj (new 'stack-no-clear 'vector))) + (s5-0 (editable-plane-method-31 this (new 'stack-no-clear 'vector))) ) (let ((s1-0 (new 'stack-no-clear 'vector))) - (set! (-> s1-0 quad) (-> (edit-get-trans (-> obj vertex 0)) quad)) + (set! (-> s1-0 quad) (-> (edit-get-trans (-> this vertex 0)) quad)) (transform-point-vector! gp-0 s1-0) ) (when (< 0.0 (-> gp-0 z)) - (reverse-transform-point! gp-0 (edit-get-trans (-> obj vertex 0)) s5-0 arg0) + (reverse-transform-point! gp-0 (edit-get-trans (-> this vertex 0)) s5-0 arg0) (let ((points (new 'stack-no-clear 'inline-array 'vector 4))) (dotimes (v1-6 4) (set! (-> points v1-6 quad) (the-as uint128 0)) ) - (let ((s4-1 (editable-plane-method-30 obj points)) + (let ((s4-1 (editable-plane-method-30 this points)) (s2-2 0) (s1-2 (vector-negate! (new 'stack-no-clear 'vector) s5-0)) ) @@ -1867,18 +1881,18 @@ ;; definition for method 10 of type editable-plane ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-10 editable-plane ((obj editable-plane)) +(defmethod editable-method-10 editable-plane ((this editable-plane)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 4))) (dotimes (v1-0 4) (set! (-> gp-0 v1-0 quad) (the-as uint128 0)) ) - (let ((s4-0 (editable-plane-method-30 obj gp-0))) + (let ((s4-0 (editable-plane-method-30 this gp-0))) (when (>= s4-0 3) (add-debug-line #t (bucket-id debug-no-zbuf1) - (edit-get-trans (-> obj vertex 0)) - (edit-get-trans (-> obj vertex 1)) + (edit-get-trans (-> this vertex 0)) + (edit-get-trans (-> this vertex 1)) (new 'static 'rgba :r #xff :g #xff :a #x80) #f (the-as rgba -1) @@ -1887,15 +1901,15 @@ (bucket-id debug2) gp-0 s4-0 - (if (logtest? (-> obj flags) (editable-flag orient)) + (if (logtest? (-> this flags) (editable-flag orient)) (new 'static 'rgba :r #xff :a #x80) (new 'static 'rgba :r #xff :g #xff :a #x80) ) - (if (not (logtest? (-> obj flags) (editable-flag orient))) + (if (not (logtest? (-> this flags) (editable-flag orient))) (new 'static 'rgba :r #xff :a #x80) (new 'static 'rgba :r #xff :g #xff :a #x80) ) - (if (logtest? (-> obj flags) (editable-flag selected)) + (if (logtest? (-> this flags) (editable-flag selected)) 1 0 ) @@ -1909,31 +1923,31 @@ ;; definition for method 17 of type editable-plane ;; WARN: Return type mismatch int vs none. -(defmethod editable-method-17 editable-plane ((obj editable-plane) (arg0 vector)) - (let ((v1-0 (-> obj region))) +(defmethod editable-method-17 editable-plane ((this editable-plane) (arg0 vector)) + (let ((v1-0 (-> this region))) (if v1-0 (set! (-> v1-0 changed) #t) ) ) - (logior! (-> obj flags) (editable-flag changed)) + (logior! (-> this flags) (editable-flag changed)) (if (= (-> arg0 y) 0.0) - (+! (-> obj radius) (-> arg0 x)) - (set! (-> obj radius) (-> arg0 y)) + (+! (-> this radius) (-> arg0 x)) + (set! (-> this radius) (-> arg0 y)) ) - (if (< (-> obj radius) 0.0) - (set! (-> obj radius) 0.0) + (if (< (-> this radius) 0.0) + (set! (-> this radius) 0.0) ) - (editable-method-28 obj (editable-filter load)) + (editable-method-28 this (editable-filter load)) 0 (none) ) ;; definition for method 7 of type editable-array ;; WARN: Return type mismatch (array editable) vs editable-array. -(defmethod relocate editable-array ((obj editable-array) (arg0 int)) - (the-as editable-array (when (nonzero? (-> obj selection)) - (let ((v0-0 (&+ (-> obj selection) arg0))) - (set! (-> obj selection) v0-0) +(defmethod relocate editable-array ((this editable-array) (arg0 int)) + (the-as editable-array (when (nonzero? (-> this selection)) + (let ((v0-0 (&+ (-> this selection) arg0))) + (set! (-> this selection) v0-0) v0-0 ) ) @@ -1941,32 +1955,32 @@ ) ;; definition for method 4 of type editable-array -(defmethod length editable-array ((obj editable-array)) - (-> obj length) +(defmethod length editable-array ((this editable-array)) + (-> this length) ) ;; definition for method 5 of type editable-array ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of editable-array ((obj editable-array)) - (the-as int (+ (-> obj type size) (* (-> obj allocated-length) 4))) +(defmethod asize-of editable-array ((this editable-array)) + (the-as int (+ (-> this type size) (* (-> this allocated-length) 4))) ) ;; definition for method 11 of type editable-array -(defmethod editable-array-method-11 editable-array ((obj editable-array)) - (dotimes (v1-0 (-> obj length)) - (if (not (-> obj data v1-0)) +(defmethod editable-array-method-11 editable-array ((this editable-array)) + (dotimes (v1-0 (-> this length)) + (if (not (-> this data v1-0)) (return v1-0) ) ) - (when (< (-> obj length) (-> obj allocated-length)) - (+! (-> obj length) 1) - (return (+ (-> obj length) -1)) + (when (< (-> this length) (-> this allocated-length)) + (+! (-> this length) 1) + (return (+ (-> this length) -1)) ) -1 ) ;; definition for method 10 of type editable-array -(defmethod editable-array-method-10 editable-array ((obj editable-array) (arg0 vector) (arg1 int)) +(defmethod editable-array-method-10 editable-array ((this editable-array) (arg0 vector) (arg1 int)) (when (or (!= (-> arg0 x) (-> *editable-work* last-x)) (!= (-> arg0 y) (-> *editable-work* last-y))) (set! (-> *editable-work* last-found) 0) (set! (-> *editable-work* last-x) (-> arg0 x)) @@ -1975,13 +1989,13 @@ 4095996000.0 (let ((s5-0 (the-as editable #f))) (set! (-> *editable-work* num-found) 0) - (let* ((s2-0 (-> obj length)) + (let* ((s2-0 (-> this length)) (s1-0 0) - (s0-0 (-> obj data s1-0)) + (s0-0 (-> this data s1-0)) ) (while (< s1-0 s2-0) - (when (and s0-0 (or (and (logtest? (-> s0-0 region filter) (-> obj filter 0)) - (logtest? (-> s0-0 region filter) (-> obj filter 1)) + (when (and s0-0 (or (and (logtest? (-> s0-0 region filter) (-> this filter 0)) + (logtest? (-> s0-0 region filter) (-> this filter 1)) ) (logtest? (-> s0-0 flags) (editable-flag selected)) ) @@ -1997,7 +2011,7 @@ ) ) (+! s1-0 1) - (set! s0-0 (-> obj data s1-0)) + (set! s0-0 (-> this data s1-0)) ) ) (countdown (v1-43 (-> *editable-work* num-found)) @@ -2038,12 +2052,12 @@ ) ;; definition for method 14 of type editable-array -(defmethod editable-array-method-14 editable-array ((obj editable-array) (arg0 (function editable editable-region symbol)) (arg1 editable-region)) - (let ((gp-0 (-> obj selection))) +(defmethod editable-array-method-14 editable-array ((this editable-array) (arg0 (function editable editable-region symbol)) (arg1 editable-region)) + (let ((gp-0 (-> this selection))) (set! (-> gp-0 length) 0) - (let* ((s2-0 (-> obj length)) + (let* ((s2-0 (-> this length)) (s1-0 0) - (s0-0 (-> obj data s1-0)) + (s0-0 (-> this data s1-0)) ) (while (< s1-0 s2-0) (when (and s0-0 (logtest? (-> s0-0 flags) (editable-flag selected))) @@ -2053,7 +2067,7 @@ ) ) (+! s1-0 1) - (set! s0-0 (-> obj data s1-0)) + (set! s0-0 (-> this data s1-0)) ) ) gp-0 @@ -2062,32 +2076,32 @@ ;; definition for method 15 of type editable-array ;; WARN: Return type mismatch int vs none. -(defmethod editable-array-method-15 editable-array ((obj editable-array) (arg0 editable)) +(defmethod editable-array-method-15 editable-array ((this editable-array) (arg0 editable)) (let ((gp-0 (-> arg0 region))) (when gp-0 - (editable-method-25 arg0 obj) - (let* ((v1-3 (-> obj length)) + (editable-method-25 arg0 this) + (let* ((v1-3 (-> this length)) (a0-2 0) - (a1-4 (-> obj data a0-2)) + (a1-4 (-> this data a0-2)) ) (while (< a0-2 v1-3) (if (and a1-4 (= arg0 a1-4)) - (set! (-> obj data a0-2) #f) + (set! (-> this data a0-2) #f) ) (+! a0-2 1) - (set! a1-4 (-> obj data a0-2)) + (set! a1-4 (-> this data a0-2)) ) ) - (let* ((v1-6 (-> obj length)) + (let* ((v1-6 (-> this length)) (a0-3 0) - (a1-14 (-> obj data a0-3)) + (a1-14 (-> this data a0-3)) ) (while (< a0-3 v1-6) (if (and a1-14 (= (-> a1-14 region) gp-0) (!= a1-14 arg0)) (goto cfg-21) ) (+! a0-3 1) - (set! a1-14 (-> obj data a0-3)) + (set! a1-14 (-> this data a0-3)) ) ) (editable-region-method-10 gp-0 0) @@ -2125,7 +2139,7 @@ ;; WARN: Stack slot offset 44 signed mismatch ;; WARN: Return type mismatch symbol vs none. ;; WARN: Function (method 12 editable-array) has a return type of none, but the expression builder found a return statement. -(defmethod editable-array-method-12 editable-array ((obj editable-array) (arg0 editable-array)) +(defmethod editable-array-method-12 editable-array ((this editable-array) (arg0 editable-array)) (local-vars (sv-16 sql-result) (sv-20 sql-result) @@ -2159,9 +2173,9 @@ (set! (-> *editable-sample-region* level) (the-as string arg0)) (set! (-> *editable-light-region* level) (the-as string arg0)) (set! (-> *editable-entity-region* level) (the-as string arg0)) - (vector-reset! (-> obj level-offset)) - (set! (-> obj level-info-id) (the-as uint -1)) - (set! (-> obj level) (the-as uint arg0)) + (vector-reset! (-> this level-offset)) + (set! (-> this level-info-id) (the-as uint -1)) + (set! (-> this level) (the-as uint arg0)) (let ((s4-0 sql-query)) (format (clear *temp-string*) @@ -2172,13 +2186,13 @@ ) (when (and (= (-> sv-16 error) 'select) (>= (-> sv-16 len) 3)) (set-vector! - (-> obj level-offset) + (-> this level-offset) (* 4096.0 (string->float (-> sv-16 data 0))) (* 4096.0 (string->float (-> sv-16 data 1))) (* 4096.0 (string->float (-> sv-16 data 2))) 1.0 ) - (set! (-> obj level-info-id) (the-as uint (string->int (-> sv-16 data 3)))) + (set! (-> this level-info-id) (the-as uint (string->int (-> sv-16 data 3)))) ) (let ((s4-2 sql-query)) (format @@ -2251,32 +2265,32 @@ (-> sv-20 data (+ s5-1 5)) ) ) - (let* ((v1-75 (-> obj length)) + (let* ((v1-75 (-> this length)) (a0-54 0) - (a1-17 (-> obj data a0-54)) + (a1-17 (-> this data a0-54)) ) (while (< a0-54 v1-75) (if (and a1-17 (-> a1-17 region) (= (-> a1-17 region id) (-> sv-36 id))) - (set! (-> obj data a0-54) #f) + (set! (-> this data a0-54) #f) ) (+! a0-54 1) - (set! a1-17 (-> obj data a0-54)) + (set! a1-17 (-> this data a0-54)) ) ) (let ((s4-6 0)) (while (< s4-6 (-> sv-32 len)) (when (= (-> sv-36 id) (string->int (-> sv-32 data s4-6))) - (let ((s3-5 (editable-array-method-11 obj))) + (let ((s3-5 (editable-array-method-11 this))) (when (>= s3-5 0) (let ((s2-1 (new 'stack-no-clear 'vector))) (set! (-> s2-1 x) (string->float (-> sv-32 data (+ s4-6 1)))) (set! (-> s2-1 y) (string->float (-> sv-32 data (+ s4-6 2)))) (set! (-> s2-1 z) (string->float (-> sv-32 data (+ s4-6 3)))) (set! (-> s2-1 w) 1.0) - (vector+! s2-1 s2-1 (-> obj level-offset)) + (vector+! s2-1 s2-1 (-> this level-offset)) (let ((s2-2 (new 'debug 'editable-sphere s2-1 2048.0 sv-36))) (set! (-> s2-2 radius) (string->float (-> sv-32 data (+ s4-6 4)))) - (set! (-> obj data s3-5) s2-2) + (set! (-> this data s3-5) s2-2) ) ) ) @@ -2290,11 +2304,11 @@ (when (= (-> sv-36 id) (string->int (-> sv-24 data sv-64))) (cond ((string= (-> sv-24 data (+ sv-64 2)) "plane") - (set! sv-72 (editable-array-method-11 obj)) + (set! sv-72 (editable-array-method-11 this)) (set! sv-80 (new 'debug 'editable-plane sv-36)) (set! sv-84 (-> sv-24 data (+ sv-64 1))) (when (>= sv-72 0) - (set! (-> obj data sv-72) sv-80) + (set! (-> this data sv-72) sv-80) (set! (-> sv-80 radius) (string->float (-> sv-24 data (+ sv-64 4)))) (countdown (s4-7 (/ (-> sv-28 len) 5)) (when (string= (-> (the-as sql-result (+ (* 20 s4-7) (the-as int sv-28))) data 0) sv-84) @@ -2305,12 +2319,12 @@ (set! (-> s3-6 w) 1.0) (set! sv-112 s3-6) ) - (vector+! sv-112 sv-112 (-> obj level-offset)) - (set! sv-120 (editable-array-method-11 obj)) + (vector+! sv-112 sv-112 (-> this level-offset)) + (set! sv-120 (editable-array-method-11 this)) (when (>= sv-120 0) (set! sv-128 (new 'debug 'editable-point sv-112 sv-36)) (set! sv-136 (string->int (-> sv-28 data (+ (* 5 s4-7) 1)))) - (set! (-> obj data sv-120) sv-128) + (set! (-> this data sv-120) sv-128) (set! (-> sv-80 vertex sv-136) sv-128) (set! (-> sv-80 length) (max (-> sv-80 length) (+ sv-136 1))) (set! (-> sv-128 owner) (cons sv-80 (-> sv-128 owner))) @@ -2322,11 +2336,11 @@ ) ) ((string= (-> sv-24 data (+ sv-64 2)) "face") - (set! sv-144 (editable-array-method-11 obj)) + (set! sv-144 (editable-array-method-11 this)) (set! sv-152 (new 'debug 'editable-face sv-36)) (set! sv-156 (-> sv-24 data (+ sv-64 1))) (when (>= sv-144 0) - (set! (-> obj data sv-144) sv-152) + (set! (-> this data sv-144) sv-152) (if (string= (-> sv-24 data (+ sv-64 3)) "orient") (logior! (-> sv-152 flags) (editable-flag orient)) ) @@ -2341,10 +2355,10 @@ (set! (-> s3-7 w) 1.0) (set! sv-176 s3-7) ) - (vector+! sv-176 sv-176 (-> obj level-offset)) - (let* ((s3-8 (-> obj length)) + (vector+! sv-176 sv-176 (-> this level-offset)) + (let* ((s3-8 (-> this length)) (s2-3 0) - (s1-0 (-> obj data s2-3)) + (s1-0 (-> this data s2-3)) ) (while (< s2-3 s3-8) (when (and s1-0 (= (-> s1-0 region) sv-36) (type? s1-0 editable-point)) @@ -2358,7 +2372,7 @@ ) ) (+! s2-3 1) - (set! s1-0 (-> obj data s2-3)) + (set! s1-0 (-> this data s2-3)) ) ) (if (< (-> sv-176 y) sv-40) @@ -2367,11 +2381,11 @@ (if (< sv-44 (-> sv-176 y)) (set! sv-44 (the-as float (-> sv-176 y))) ) - (set! sv-192 (editable-array-method-11 obj)) + (set! sv-192 (editable-array-method-11 this)) (when (>= sv-192 0) (set! sv-200 (new 'debug 'editable-point sv-176 sv-36)) (set! sv-208 (string->int (-> sv-28 data (+ (* 5 s4-8) 1)))) - (set! (-> obj data sv-192) sv-200) + (set! (-> this data sv-192) sv-200) (set! (-> sv-152 vertex sv-208) sv-200) (set! (-> sv-152 length) (max (-> sv-152 length) (+ sv-208 1))) (set! (-> sv-200 owner) (cons sv-152 (-> sv-200 owner))) @@ -2387,9 +2401,9 @@ ) (set! sv-64 (+ sv-64 5)) ) - (let* ((v1-293 (-> obj length)) + (let* ((v1-293 (-> this length)) (a0-158 0) - (a1-57 (-> obj data a0-158)) + (a1-57 (-> this data a0-158)) ) (while (< a0-158 v1-293) (when (and a1-57 (= (-> a1-57 region) sv-36) (= (-> a1-57 type) editable-point)) @@ -2403,7 +2417,7 @@ ) ) (+! a0-158 1) - (set! a1-57 (-> obj data a0-158)) + (set! a1-57 (-> this data a0-158)) ) ) (set! (-> sv-36 changed) #f) @@ -2414,7 +2428,7 @@ (format (clear *temp-string*) "select x,y,z from sample_point where level_info_id='~D' and source='manual'" - (-> obj level-info-id) + (-> this level-info-id) ) (set! sv-216 (s5-2 *temp-string*)) ) @@ -2423,15 +2437,15 @@ ) (let ((s5-3 0)) (while (< s5-3 (-> sv-216 len)) - (let ((s4-10 (editable-array-method-11 obj))) + (let ((s4-10 (editable-array-method-11 this))) (when (>= s4-10 0) (let ((s3-9 (new 'stack-no-clear 'vector))) (set! (-> s3-9 x) (* 4096.0 (string->float (-> sv-216 data s5-3)))) (set! (-> s3-9 y) (* 4096.0 (string->float (-> sv-216 data (+ s5-3 1))))) (set! (-> s3-9 z) (* 4096.0 (string->float (-> sv-216 data (+ s5-3 2))))) (set! (-> s3-9 w) 1.0) - (vector+! s3-9 s3-9 (-> obj level-offset)) - (set! (-> obj data s4-10) (new 'debug 'editable-sample s3-9 *editable-sample-region*)) + (vector+! s3-9 s3-9 (-> this level-offset)) + (set! (-> this data s4-10) (new 'debug 'editable-sample s3-9 *editable-sample-region*)) ) ) ) @@ -2443,7 +2457,7 @@ (format (clear *temp-string*) "select light_id,name,pos_x,pos_y,pos_z,r,dir_x,dir_y,dir_z,color0_r,color0_g,color0_b,color0_a,decay_start,ambient_point_ratio,brightness from light where level_name='~S'" - (-> obj level) + (-> this level) ) (set! sv-240 (s5-4 *temp-string*)) ) @@ -2453,16 +2467,16 @@ ) (let ((s5-5 0)) (while (< s5-5 (-> sv-240 len)) - (let ((s3-10 (editable-array-method-11 obj))) + (let ((s3-10 (editable-array-method-11 this))) (when (>= s3-10 0) (let ((s4-12 (new 'stack-no-clear 'vector))) (set! (-> s4-12 x) (* 4096.0 (string->float (-> sv-240 data (+ s5-5 2))))) (set! (-> s4-12 y) (* 4096.0 (string->float (-> sv-240 data (+ s5-5 3))))) (set! (-> s4-12 z) (* 4096.0 (string->float (-> sv-240 data (+ s5-5 4))))) (set! (-> s4-12 w) 1.0) - (vector+! s4-12 s4-12 (-> obj level-offset)) + (vector+! s4-12 s4-12 (-> this level-offset)) (let ((s4-13 (new 'debug 'editable-light s4-12 2048.0 *editable-light-region*))) - (set! (-> obj data s3-10) s4-13) + (set! (-> this data s3-10) s4-13) (set! (-> s4-13 id) (the-as uint (string->int (-> sv-240 data s5-5)))) (set! (-> s4-13 name) (-> sv-240 data (+ s5-5 1))) (set! (-> s4-13 radius) (* 4096.0 (string->float (-> sv-240 data (+ s5-5 5))))) @@ -2494,18 +2508,18 @@ ) ) (set! (-> *editable-light-region* changed) #f) - (editable-array-method-9 obj (editable-command refresh-filter) (the-as mouse-info #f)) + (editable-array-method-9 this (editable-command refresh-filter) (the-as mouse-info #f)) #t (none) ) ;; definition for method 13 of type editable-array ;; WARN: Return type mismatch int vs none. -(defmethod editable-array-method-13 editable-array ((obj editable-array) (arg0 editable-command) (arg1 editable-command) (arg2 string)) - (set! (-> obj target) #f) - (set! (-> obj target-mode) arg0) - (set! (-> obj target-command) arg1) - (set! (-> obj target-message) arg2) +(defmethod editable-array-method-13 editable-array ((this editable-array) (arg0 editable-command) (arg1 editable-command) (arg2 string)) + (set! (-> this target) #f) + (set! (-> this target-mode) arg0) + (set! (-> this target-command) arg1) + (set! (-> this target-message) arg2) 0 (none) ) @@ -2513,15 +2527,15 @@ ;; definition for method 16 of type editable-array ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod editable-array-method-16 editable-array ((obj editable-array)) +(defmethod editable-array-method-16 editable-array ((this editable-array)) (cond - ((-> obj edit-plane) - (editable-plane-method-31 (-> obj edit-plane) (-> obj edit-plane-normal)) - (set! (-> obj edit-plane-center quad) (-> (edit-get-trans (-> obj edit-plane vertex 0)) quad)) + ((-> this edit-plane) + (editable-plane-method-31 (-> this edit-plane) (-> this edit-plane-normal)) + (set! (-> this edit-plane-center quad) (-> (edit-get-trans (-> this edit-plane vertex 0)) quad)) ) (else - (vector-negate! (-> obj edit-plane-normal) (-> *math-camera* inv-camera-rot vector 2)) - (let ((v1-9 (vector-float*! (-> obj edit-plane-center) (-> *math-camera* inv-camera-rot vector 2) 24576.0))) + (vector-negate! (-> this edit-plane-normal) (-> *math-camera* inv-camera-rot vector 2)) + (let ((v1-9 (vector-float*! (-> this edit-plane-center) (-> *math-camera* inv-camera-rot vector 2) 24576.0))) (vector+! v1-9 v1-9 (-> *math-camera* trans)) ) ) @@ -2532,7 +2546,7 @@ ;; definition for method 17 of type editable-array ;; INFO: Used lq/sq -(defmethod editable-array-method-17 editable-array ((obj editable-array) (arg0 vector) (arg1 vector)) +(defmethod editable-array-method-17 editable-array ((this editable-array) (arg0 vector) (arg1 vector)) (cond ((and (cpad-hold? 0 up) *target*) (set! (-> arg0 quad) (-> (get-trans *target* 0) quad)) @@ -2541,8 +2555,8 @@ (set! (-> arg0 quad) (-> (math-camera-pos) quad)) ) (else - (editable-array-method-16 obj) - (reverse-transform-point! arg0 (-> obj edit-plane-center) (-> obj edit-plane-normal) arg1) + (editable-array-method-16 this) + (reverse-transform-point! arg0 (-> this edit-plane-center) (-> this edit-plane-normal) arg1) ) ) arg0 diff --git a/test/decompiler/reference/jak2/engine/debug/history_REF.gc b/test/decompiler/reference/jak2/engine/debug/history_REF.gc index b719c1c54e..2af436ae30 100644 --- a/test/decompiler/reference/jak2/engine/debug/history_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/history_REF.gc @@ -68,27 +68,27 @@ ) ;; definition for method 3 of type history-elt -(defmethod inspect history-elt ((obj history-elt)) - (when (not obj) - (set! obj obj) +(defmethod inspect history-elt ((this history-elt)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'history-elt) - (format #t "~1Trecord-tag-bytes[4] @ #x~X~%" (-> obj record-tag-bytes)) - (format #t "~1Trecord-tag: ~D~%" (-> obj record-tag)) - (format #t "~1Trecord-id: ~D~%" (-> obj record-id)) - (format #t "~1Towner: ~D~%" (-> obj owner)) - (format #t "~1Tchannel: ~D~%" (-> obj channel)) - (format #t "~1Ttimestamp: ~D~%" (-> obj timestamp)) - (format #t "~1Torigin: #~%" (-> obj origin)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj vector)) - (format #t "~1Tvector: #~%" (-> obj vector)) - (format #t "~1Tfloat: ~f~%" (-> obj vector x)) - (format #t "~1Tcollide-status: ~D~%" (-> obj collide-status)) - (format #t "~1Tcollide-reaction-flag: ~D~%" (-> obj vector z)) - (format #t "~1Tpat: ~D~%" (-> obj vector x)) + (format #t "[~8x] ~A~%" this 'history-elt) + (format #t "~1Trecord-tag-bytes[4] @ #x~X~%" (-> this record-tag-bytes)) + (format #t "~1Trecord-tag: ~D~%" (-> this record-tag)) + (format #t "~1Trecord-id: ~D~%" (-> this record-id)) + (format #t "~1Towner: ~D~%" (-> this owner)) + (format #t "~1Tchannel: ~D~%" (-> this channel)) + (format #t "~1Ttimestamp: ~D~%" (-> this timestamp)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this vector)) + (format #t "~1Tvector: #~%" (-> this vector)) + (format #t "~1Tfloat: ~f~%" (-> this vector x)) + (format #t "~1Tcollide-status: ~D~%" (-> this collide-status)) + (format #t "~1Tcollide-reaction-flag: ~D~%" (-> this vector z)) + (format #t "~1Tpat: ~D~%" (-> this vector x)) (label cfg-4) - obj + this ) ;; definition of type history-iterator @@ -113,21 +113,21 @@ ) ;; definition for method 3 of type history-iterator -(defmethod inspect history-iterator ((obj history-iterator)) - (when (not obj) - (set! obj obj) +(defmethod inspect history-iterator ((this history-iterator)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmax-age: ~D~%" (-> obj max-age)) - (format #t "~1Towner: ~D~%" (-> obj owner)) - (format #t "~1Tproc: ~A~%" (-> obj proc)) - (format #t "~1Tout: ~A~%" (-> obj out)) - (format #t "~1Tchannel-mask: ~D~%" (-> obj channel-mask)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tdone?: ~A~%" (-> obj done?)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmax-age: ~D~%" (-> this max-age)) + (format #t "~1Towner: ~D~%" (-> this owner)) + (format #t "~1Tproc: ~A~%" (-> this proc)) + (format #t "~1Tout: ~A~%" (-> this out)) + (format #t "~1Tchannel-mask: ~D~%" (-> this channel-mask)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tdone?: ~A~%" (-> this done?)) (label cfg-4) - obj + this ) ;; definition of type history @@ -147,28 +147,28 @@ ) ;; definition for method 3 of type history -(defmethod inspect history ((obj history)) - (when (not obj) - (set! obj obj) +(defmethod inspect history ((this history)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Talloc-index: ~D~%" (-> obj alloc-index)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Telts[0] @ #x~X~%" (-> obj elts)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Talloc-index: ~D~%" (-> this alloc-index)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Telts[0] @ #x~X~%" (-> this elts)) (label cfg-4) - obj + this ) ;; definition for method 4 of type history -(defmethod length history ((obj history)) - (-> obj allocated-length) +(defmethod length history ((this history)) + (-> this allocated-length) ) ;; definition for method 5 of type history ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of history ((obj history)) - (the-as int (+ (-> obj type size) (* 48 (-> obj allocated-length)))) +(defmethod asize-of history ((this history)) + (the-as int (+ (-> this type size) (* 48 (-> this allocated-length)))) ) ;; definition for method 0 of type history @@ -181,14 +181,14 @@ ;; definition for method 10 of type history ;; WARN: Return type mismatch int vs none. -(defmethod clear-history-entries! history ((obj history)) +(defmethod clear-history-entries! history ((this history)) "Iterates through each [[history-elt]] in the `elt` dynamic array For each entry: - clear `timestamp` - clear `record-tag`" - (set! (-> obj alloc-index) 0) - (countdown (v1-0 (-> obj allocated-length)) - (let ((a1-3 (-> obj elts v1-0))) + (set! (-> this alloc-index) 0) + (countdown (v1-0 (-> this allocated-length)) + (let ((a1-3 (-> this elts v1-0))) (set! (-> a1-3 record-tag) (the-as uint 0)) (set! (-> a1-3 timestamp) 0) ) @@ -206,14 +206,14 @@ For each entry: ;; definition for method 9 of type history ;; WARN: new jak 2 until loop case, check carefully -(defmethod clear-record-tags! history ((obj history) (arg0 history-channel) (arg1 uint) (arg2 uint)) +(defmethod clear-record-tags! history ((this history) (arg0 history-channel) (arg1 uint) (arg2 uint)) "First grab the latest [[history-elt]] at `alloc-index` 1. update it's `channel`, `record-id` and `owner` from the provided args 2. - if it's `record-tag` is zero -- return it - otherwise, iterate through all `elts` until one is found that does not match it's `timestamp` - if not `0` out the `record-tag` for that elt and continue iteration" - (let* ((t1-0 (-> obj alloc-index)) - (v1-0 (-> obj elts)) + (let* ((t1-0 (-> this alloc-index)) + (v1-0 (-> this elts)) (v0-0 (-> v1-0 t1-0)) ) (let ((t2-0 (-> v0-0 record-tag)) @@ -223,10 +223,10 @@ For each entry: (set! (-> v0-0 record-id) arg1) (set! (-> v0-0 owner) arg2) (set! (-> v0-0 timestamp) (-> *display* base-clock frame-counter)) - (let* ((a1-4 (-> obj allocated-length)) + (let* ((a1-4 (-> this allocated-length)) (a2-2 (mod (+ t1-0 1) a1-4)) ) - (set! (-> obj alloc-index) a2-2) + (set! (-> this alloc-index) a2-2) (when (nonzero? t2-0) (until #f (let ((a0-4 (-> v1-0 a2-2))) @@ -260,7 +260,7 @@ For each entry: ) ;; definition for method 10 of type history-iterator -(defmethod update-entries! history-iterator ((obj history-iterator)) +(defmethod update-entries! history-iterator ((this history-iterator)) "Iterate through each [[history-elt]] in [[*history*]] - If we hit the end set `done?` to true - If the `timestamp` on the elt, minus the current framecounter exceeds `max-age`, we are also done, return #f @@ -268,22 +268,22 @@ For each entry: (let ((v1-0 *history*) (a1-2 (-> *display* base-clock frame-counter)) ) - (while (not (-> obj done?)) - (let ((a2-1 (+ (-> obj index) -1))) + (while (not (-> this done?)) + (let ((a2-1 (+ (-> this index) -1))) (if (< a2-1 0) (set! a2-1 (+ (-> v1-0 allocated-length) -1)) ) - (set! (-> obj index) a2-1) + (set! (-> this index) a2-1) (if (= a2-1 (-> v1-0 alloc-index)) - (set! (-> obj done?) #t) + (set! (-> this done?) #t) ) (let ((a2-5 (-> v1-0 elts a2-1))) (when (nonzero? (-> a2-5 record-tag)) - (when (< (the-as time-frame (-> obj max-age)) (- a1-2 (-> a2-5 timestamp))) - (set! (-> obj done?) #t) + (when (< (the-as time-frame (-> this max-age)) (- a1-2 (-> a2-5 timestamp))) + (set! (-> this done?) #t) (return (the-as history-elt #f)) ) - (if (= (-> a2-5 owner) (-> obj owner)) + (if (= (-> a2-5 owner) (-> this owner)) (return a2-5) ) ) @@ -295,17 +295,17 @@ For each entry: ) ;; definition for method 11 of type history-iterator -(defmethod get-age history-iterator ((obj history-iterator) (arg0 history-elt)) +(defmethod get-age history-iterator ((this history-iterator) (arg0 history-elt)) "Get the age of a history element" (- 1.0 (fmin 1.0 (/ (the float (+ (- 1 (-> arg0 timestamp)) (-> *display* base-clock frame-counter))) - (the float (+ (-> obj max-age) 1)) + (the float (+ (-> this max-age) 1)) ) ) ) ) ;; definition for method 9 of type history-iterator -(defmethod frame-counter-delta history-iterator ((obj history-iterator) (arg0 history-elt)) +(defmethod frame-counter-delta history-iterator ((this history-iterator) (arg0 history-elt)) "Returns the difference between [[*display*]]'s `base-clock.frame-counter` and the elt's `timestamp`" (- (-> *display* base-clock frame-counter) (-> arg0 timestamp)) ) diff --git a/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc index 79bbf1fe48..9d41a68cb2 100644 --- a/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc @@ -17,18 +17,18 @@ ) ;; definition for method 3 of type memory-usage-info -(defmethod inspect memory-usage-info ((obj memory-usage-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect memory-usage-info ((this memory-usage-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'memory-usage-info) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tused: ~D~%" (-> obj used)) - (format #t "~1Ttotal: ~D~%" (-> obj total)) + (format #t "[~8x] ~A~%" this 'memory-usage-info) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tused: ~D~%" (-> this used)) + (format #t "~1Ttotal: ~D~%" (-> this total)) (label cfg-4) - obj + this ) ;; definition of type memory-usage-block @@ -48,18 +48,17 @@ ) ;; definition for method 3 of type memory-usage-block -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect memory-usage-block ((obj memory-usage-block)) - (when (not obj) - (set! obj obj) +(defmethod inspect memory-usage-block ((this memory-usage-block)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twork-bsp: ~A~%" (-> obj work-bsp)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tdata[112] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twork-bsp: ~A~%" (-> this work-bsp)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[112] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for symbol *mem-usage*, type memory-usage-block diff --git a/test/decompiler/reference/jak2/engine/debug/memory-usage_REF.gc b/test/decompiler/reference/jak2/engine/debug/memory-usage_REF.gc index b2df91267d..87d277a78f 100644 --- a/test/decompiler/reference/jak2/engine/debug/memory-usage_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/memory-usage_REF.gc @@ -5,16 +5,15 @@ (declare-file (debug)) ;; definition for method 3 of type memory-usage-block -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect memory-usage-block ((obj memory-usage-block)) +(defmethod inspect memory-usage-block ((this memory-usage-block)) (format #t "-------------------------------------------------------------~%") (format #t " # name count bytes used aligned bytes~%") (format #t "-------------------------------------------------------------~%") (let ((s5-0 0) (s4-0 0) ) - (dotimes (s3-0 (-> obj length)) - (let ((v1-2 (-> obj data s3-0))) + (dotimes (s3-0 (-> this length)) + (let ((v1-2 (-> this data s3-0))) (+! s5-0 (-> v1-2 used)) (+! s4-0 (-> v1-2 total)) (format @@ -31,35 +30,35 @@ (format #t "total: ~8D ~8D~%" s5-0 s4-0) ) (format #t "-------------------------------------------------------------~%") - obj + this ) ;; definition for method 8 of type object -(defmethod mem-usage object ((obj object) (arg0 memory-usage-block) (arg1 int)) - obj +(defmethod mem-usage object ((this object) (arg0 memory-usage-block) (arg1 int)) + this ) ;; definition for method 10 of type memory-usage-block -(defmethod calculate-total memory-usage-block ((obj memory-usage-block)) +(defmethod calculate-total memory-usage-block ((this memory-usage-block)) "@returns The total sum of all [[memory-usage-info]] `total`s" (let ((sum 0)) - (dotimes (idx (-> obj length)) - (+! sum (-> obj data idx total)) + (dotimes (idx (-> this length)) + (+! sum (-> this data idx total)) ) sum ) ) ;; definition for method 9 of type memory-usage-block -(defmethod reset! memory-usage-block ((obj memory-usage-block)) +(defmethod reset! memory-usage-block ((this memory-usage-block)) "Sets `length` to 0 as well as resets all fields except `name` in the associated [[memory-usage-info]]" - (set! (-> obj length) 0) + (set! (-> this length) 0) (dotimes (idx 112) - (set! (-> obj data idx used) 0) - (set! (-> obj data idx total) 0) - (set! (-> obj data idx count) 0) + (set! (-> this data idx used) 0) + (set! (-> this data idx total) 0) + (set! (-> this data idx count) 0) ) - obj + this ) ;; definition for function mem-size @@ -78,27 +77,27 @@ ) ;; definition for method 14 of type level -(defmethod compute-memory-usage! level ((obj level) (force? symbol)) +(defmethod compute-memory-usage! level ((this level) (force? symbol)) "Calculates the memory usage of the level, returns and stores the [[memory-usage-block]] in `mem-usage-block` as well as the total size in `mem-usage` @param force? - Will re-compute the usage if set to [[#t]], even if `mem-usage` has been set to a non-zero value @returns The [[memory-usage-block]] representing the footprint of the level @see [[memory-usage-block::10]]" - (if (zero? (-> obj mem-usage-block)) - (set! (-> obj mem-usage-block) (new 'debug 'memory-usage-block)) + (if (zero? (-> this mem-usage-block)) + (set! (-> this mem-usage-block) (new 'debug 'memory-usage-block)) ) - (set! force? (or (zero? (-> obj mem-usage-block length)) force?)) + (set! force? (or (zero? (-> this mem-usage-block length)) force?)) (when force? - (mem-usage obj (reset! (-> obj mem-usage-block)) 0) - (set! (-> obj mem-usage) (calculate-total (-> obj mem-usage-block))) + (mem-usage this (reset! (-> this mem-usage-block)) 0) + (set! (-> this mem-usage) (calculate-total (-> this mem-usage-block))) 0 ) - (-> obj mem-usage-block) + (-> this mem-usage-block) ) ;; definition for method 8 of type process-tree -(defmethod mem-usage process-tree ((obj process-tree) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage process-tree ((this process-tree) (arg0 memory-usage-block) (arg1 int)) (let ((v1-0 90)) (let* ((a0-1 *dead-pool-list*) (a3-0 (car a0-1)) @@ -143,7 +142,7 @@ in `mem-usage-block` as well as the total size in `mem-usage` ) ) (iterate-process-tree - obj + this (lambda ((arg0 process-drawable)) (let ((gp-0 *temp-mem-usage*)) (let ((s4-0 (cond @@ -306,7 +305,7 @@ in `mem-usage-block` as well as the total size in `mem-usage` ) *null-kernel-context* ) - obj + this ) ;; definition for symbol *max-dma*, type int @@ -314,10 +313,10 @@ in `mem-usage-block` as well as the total size in `mem-usage` ;; definition for method 11 of type memory-usage-block ;; INFO: Used lq/sq -(defmethod print-mem-usage memory-usage-block ((obj memory-usage-block) (level level) (fmt-dest object)) +(defmethod print-mem-usage memory-usage-block ((this memory-usage-block) (level level) (fmt-dest object)) (local-vars (sv-16 object) (sv-32 string) (sv-48 int)) (let ((s3-0 (&- (-> level heap current) (the-as uint (-> level heap base))))) - (let ((v1-2 (+ (-> obj data 61 total) (-> obj data 62 total)))) + (let ((v1-2 (+ (-> this data 61 total) (-> this data 62 total)))) (< #x10000 v1-2) ) (let* ((v1-5 @@ -395,30 +394,30 @@ in `mem-usage-block` as well as the total size in `mem-usage` (let ((t9-11 format) (a0-31 fmt-dest) (a1-11 " bsp ~192H~5DK ~280Hdebug~456H~5DK~%") - (a2-6 (sar (+ (-> obj data 58 total) (-> obj data 59 total) (-> obj data 60 total)) 10)) + (a2-6 (sar (+ (-> this data 58 total) (-> this data 59 total) (-> this data 60 total)) 10)) (a3-3 (sar (-> *dma-mem-usage* data 87 total) 10)) ) (t9-11 a0-31 a1-11 a2-6 a3-3 (the-as none t0-0) (the-as none t1-0) (the-as none t2-0)) (format fmt-dest " bsp-leaf-vis ~192H~5DK~%" - (sar (+ (-> obj data 61 total) (-> obj data 62 total)) 10) + (sar (+ (-> this data 61 total) (-> this data 62 total)) 10) (the-as none a3-3) ) - (format fmt-dest " level-code ~192H~5DK~%" (sar (-> obj data 65 total) 10) (the-as none a3-3)) + (format fmt-dest " level-code ~192H~5DK~%" (sar (-> this data 65 total) 10) (the-as none a3-3)) ) (format fmt-dest " tfrag ~192H~5DK ~280Htfragment~456H~5DK~%" (sar - (+ (-> obj data 1 total) - (-> obj data 2 total) - (-> obj data 3 total) - (-> obj data 4 total) - (-> obj data 5 total) - (-> obj data 6 total) - (-> obj data 7 total) - (-> obj data 8 total) + (+ (-> this data 1 total) + (-> this data 2 total) + (-> this data 3 total) + (-> this data 4 total) + (-> this data 5 total) + (-> this data 6 total) + (-> this data 7 total) + (-> this data 8 total) ) 10 ) @@ -428,14 +427,14 @@ in `mem-usage-block` as well as the total size in `mem-usage` fmt-dest " tie-proto ~192H~5DK ~280Hsky~456H~5DK~%" (sar - (+ (-> obj data 9 total) - (-> obj data 10 total) - (-> obj data 11 total) - (-> obj data 12 total) - (-> obj data 13 total) - (-> obj data 14 total) - (-> obj data 16 total) - (-> obj data 17 total) + (+ (-> this data 9 total) + (-> this data 10 total) + (-> this data 11 total) + (-> this data 12 total) + (-> this data 13 total) + (-> this data 14 total) + (-> this data 16 total) + (-> this data 17 total) ) 10 ) @@ -444,22 +443,22 @@ in `mem-usage-block` as well as the total size in `mem-usage` (format fmt-dest " tie-instance ~192H~5DK ~280Htie-fragment~456H~5DK~%" - (sar (+ (-> obj data 18 total) (-> obj data 20 total) (-> obj data 21 total) (-> obj data 22 total)) 10) + (sar (+ (-> this data 18 total) (-> this data 20 total) (-> this data 21 total) (-> this data 22 total)) 10) (sar (-> *dma-mem-usage* data 9 total) 10) ) (format fmt-dest " shrub-proto ~192H~5DK ~280Htie-scissor~456H~5DK~%" (sar - (+ (-> obj data 25 total) - (-> obj data 26 total) - (-> obj data 27 total) - (-> obj data 28 total) - (-> obj data 29 total) - (-> obj data 30 total) - (-> obj data 31 total) - (-> obj data 32 total) - (-> obj data 33 total) + (+ (-> this data 25 total) + (-> this data 26 total) + (-> this data 27 total) + (-> this data 28 total) + (-> this data 29 total) + (-> this data 30 total) + (-> this data 31 total) + (-> this data 32 total) + (-> this data 33 total) ) 10 ) @@ -468,21 +467,21 @@ in `mem-usage-block` as well as the total size in `mem-usage` (format fmt-dest " shrub-instance ~192H~5DK ~280Hshrubbery~456H~5DK~%" - (sar (-> obj data 34 total) 10) + (sar (-> this data 34 total) 10) (sar (-> *dma-mem-usage* data 27 total) 10) ) (format fmt-dest " collision ~192H~5DK ~280Htie-generic~456H~5DK~%" (sar - (+ (-> obj data 50 total) - (-> obj data 51 total) - (-> obj data 52 total) - (-> obj data 53 total) - (-> obj data 54 total) - (-> obj data 55 total) - (-> obj data 56 total) - (-> obj data 57 total) + (+ (-> this data 50 total) + (-> this data 51 total) + (-> this data 52 total) + (-> this data 53 total) + (-> this data 54 total) + (-> this data 55 total) + (-> this data 56 total) + (-> this data 57 total) ) 10 ) @@ -492,22 +491,22 @@ in `mem-usage-block` as well as the total size in `mem-usage` fmt-dest " pris-geo ~192H~5DK ~280Hpris-fragment~456H~5DK~%" (sar - (+ (-> obj data 35 total) - (-> obj data 36 total) - (-> obj data 37 total) - (-> obj data 38 total) - (-> obj data 39 total) - (-> obj data 40 total) - (-> obj data 41 total) - (-> obj data 42 total) - (-> obj data 73 total) - (-> obj data 74 total) - (-> obj data 75 total) - (-> obj data 76 total) - (-> obj data 78 total) - (-> obj data 81 total) - (-> obj data 80 total) - (-> obj data 111 total) + (+ (-> this data 35 total) + (-> this data 36 total) + (-> this data 37 total) + (-> this data 38 total) + (-> this data 39 total) + (-> this data 40 total) + (-> this data 41 total) + (-> this data 42 total) + (-> this data 73 total) + (-> this data 74 total) + (-> this data 75 total) + (-> this data 76 total) + (-> this data 78 total) + (-> this data 81 total) + (-> this data 80 total) + (-> this data 111 total) ) 10 ) @@ -517,14 +516,14 @@ in `mem-usage-block` as well as the total size in `mem-usage` fmt-dest " pris-anim ~192H~5DK ~280Hpris-generic~456H~5DK~%" (sar - (+ (-> obj data 67 total) - (-> obj data 68 total) - (-> obj data 69 total) - (-> obj data 70 total) - (-> obj data 71 total) - (-> obj data 77 total) - (-> obj data 79 total) - (-> obj data 72 total) + (+ (-> this data 67 total) + (-> this data 68 total) + (-> this data 69 total) + (-> this data 70 total) + (-> this data 71 total) + (-> this data 77 total) + (-> this data 79 total) + (-> this data 72 total) ) 10 ) @@ -533,18 +532,18 @@ in `mem-usage-block` as well as the total size in `mem-usage` (format fmt-dest " textures ~192H~5DK ~280Htextures~456H~5DK~%" - (sar (-> obj data 82 total) 10) + (sar (-> this data 82 total) 10) (sar (-> *dma-mem-usage* data 82 total) 10) ) (format fmt-dest " entity ~192H~5DK~%" (sar - (+ (-> obj data 66 total) - (-> obj data 43 total) - (-> obj data 44 total) - (-> obj data 45 total) - (-> obj data 49 total) - (-> obj data 48 total) - (-> obj data 46 total) - (-> obj data 47 total) + (+ (-> this data 66 total) + (-> this data 43 total) + (-> this data 44 total) + (-> this data 45 total) + (-> this data 49 total) + (-> this data 48 total) + (-> this data 46 total) + (-> this data 47 total) ) 10 ) @@ -553,11 +552,11 @@ in `mem-usage-block` as well as the total size in `mem-usage` fmt-dest " misc ~192H~5DK ~280Hsprite~456H~5DK~%" (sar - (+ (-> obj data 0 total) - (-> obj data 63 total) - (-> obj data 64 total) - (-> obj data 83 total) - (-> obj data 84 total) + (+ (-> this data 0 total) + (-> this data 63 total) + (-> this data 64 total) + (-> this data 83 total) + (-> this data 84 total) ) 10 ) @@ -570,7 +569,7 @@ in `mem-usage-block` as well as the total size in `mem-usage` ) ) (format fmt-dest "~1K~0L") - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/debug/menu_REF.gc b/test/decompiler/reference/jak2/engine/debug/menu_REF.gc index fde7c2f642..7a2883adbf 100644 --- a/test/decompiler/reference/jak2/engine/debug/menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/menu_REF.gc @@ -25,23 +25,23 @@ ) ;; definition for method 3 of type debug-menu-context -(defmethod inspect debug-menu-context ((obj debug-menu-context)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-menu-context ((this debug-menu-context)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tis-active: ~A~%" (-> obj is-active)) - (format #t "~1Tsel-length: ~D~%" (-> obj sel-length)) - (format #t "~1Tsel-menu[8] @ #x~X~%" (-> obj sel-menu)) - (format #t "~1Troot-menu: ~A~%" (-> obj root-menu)) - (format #t "~1Tjoypad-func: ~A~%" (-> obj joypad-func)) - (format #t "~1Tjoypad-item: ~A~%" (-> obj joypad-item)) - (format #t "~1Tfont: ~A~%" (-> obj font)) - (format #t "~1Tis-hidden: ~A~%" (-> obj is-hidden)) - (format #t "~1Tjoypad-number: ~D~%" (-> obj joypad-number)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tis-active: ~A~%" (-> this is-active)) + (format #t "~1Tsel-length: ~D~%" (-> this sel-length)) + (format #t "~1Tsel-menu[8] @ #x~X~%" (-> this sel-menu)) + (format #t "~1Troot-menu: ~A~%" (-> this root-menu)) + (format #t "~1Tjoypad-func: ~A~%" (-> this joypad-func)) + (format #t "~1Tjoypad-item: ~A~%" (-> this joypad-item)) + (format #t "~1Tfont: ~A~%" (-> this font)) + (format #t "~1Tis-hidden: ~A~%" (-> this is-hidden)) + (format #t "~1Tjoypad-number: ~D~%" (-> this joypad-number)) (label cfg-4) - obj + this ) ;; definition for method 0 of type debug-menu-context @@ -74,24 +74,24 @@ ) ;; definition for method 3 of type debug-menu-node -(defmethod inspect debug-menu-node ((obj debug-menu-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-menu-node ((this debug-menu-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tparent: ~A~%" (-> obj parent)) - (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> this refresh-ctr)) (label cfg-4) - obj + this ) ;; definition for method 2 of type debug-menu-node -(defmethod print debug-menu-node ((obj debug-menu-node)) - (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print debug-menu-node ((this debug-menu-node)) + (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) + this ) ;; definition of type debug-menu @@ -111,23 +111,23 @@ ) ;; definition for method 3 of type debug-menu -(defmethod inspect debug-menu ((obj debug-menu)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-menu ((this debug-menu)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tparent: ~A~%" (-> obj parent)) - (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~1Tcontext: ~A~%" (-> obj context)) - (format #t "~1Tselected-item: ~A~%" (-> obj selected-item)) - (format #t "~1Tpix-width: ~D~%" (-> obj pix-width)) - (format #t "~1Tpix-height: ~D~%" (-> obj pix-height)) - (format #t "~1Titems: ~A~%" (-> obj items)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~1Tcontext: ~A~%" (-> this context)) + (format #t "~1Tselected-item: ~A~%" (-> this selected-item)) + (format #t "~1Tpix-width: ~D~%" (-> this pix-width)) + (format #t "~1Tpix-height: ~D~%" (-> this pix-height)) + (format #t "~1Titems: ~A~%" (-> this items)) (label cfg-4) - obj + this ) ;; definition for method 0 of type debug-menu @@ -152,19 +152,19 @@ ) ;; definition for method 3 of type debug-menu-item -(defmethod inspect debug-menu-item ((obj debug-menu-item)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-menu-item ((this debug-menu-item)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tparent: ~A~%" (-> obj parent)) - (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~1Tid: #x~X~%" (-> obj id)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> this id)) (label cfg-4) - obj + this ) ;; definition of type debug-menu-item-submenu @@ -180,20 +180,20 @@ ) ;; definition for method 3 of type debug-menu-item-submenu -(defmethod inspect debug-menu-item-submenu ((obj debug-menu-item-submenu)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-menu-item-submenu ((this debug-menu-item-submenu)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tparent: ~A~%" (-> obj parent)) - (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~1Tid: #x~X~%" (-> obj id)) - (format #t "~1Tsubmenu: ~A~%" (-> obj submenu)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> this id)) + (format #t "~1Tsubmenu: ~A~%" (-> this submenu)) (label cfg-4) - obj + this ) ;; definition for method 0 of type debug-menu-item-submenu @@ -223,21 +223,21 @@ ) ;; definition for method 3 of type debug-menu-item-function -(defmethod inspect debug-menu-item-function ((obj debug-menu-item-function)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-menu-item-function ((this debug-menu-item-function)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tparent: ~A~%" (-> obj parent)) - (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~1Tid: #x~X~%" (-> obj id)) - (format #t "~1Tactivate-func: ~A~%" (-> obj activate-func)) - (format #t "~1Thilite-timer: ~D~%" (-> obj hilite-timer)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> this id)) + (format #t "~1Tactivate-func: ~A~%" (-> this activate-func)) + (format #t "~1Thilite-timer: ~D~%" (-> this hilite-timer)) (label cfg-4) - obj + this ) ;; definition for method 0 of type debug-menu-item-function @@ -268,21 +268,21 @@ ) ;; definition for method 3 of type debug-menu-item-flag -(defmethod inspect debug-menu-item-flag ((obj debug-menu-item-flag)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-menu-item-flag ((this debug-menu-item-flag)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tparent: ~A~%" (-> obj parent)) - (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~1Tid: #x~X~%" (-> obj id)) - (format #t "~1Tactivate-func: ~A~%" (-> obj activate-func)) - (format #t "~1Tis-on: ~A~%" (-> obj is-on)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> this id)) + (format #t "~1Tactivate-func: ~A~%" (-> this activate-func)) + (format #t "~1Tis-on: ~A~%" (-> this is-on)) (label cfg-4) - obj + this ) ;; definition for method 0 of type debug-menu-item-flag @@ -342,45 +342,45 @@ ) ;; definition for method 3 of type debug-menu-item-var -(defmethod inspect debug-menu-item-var ((obj debug-menu-item-var)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-menu-item-var ((this debug-menu-item-var)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tparent: ~A~%" (-> obj parent)) - (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) - (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) - (format #t "~1Tid: #x~X~%" (-> obj id)) - (format #t "~1Tdisplay-str: ~A~%" (-> obj display-str)) - (format #t "~1Tgrabbed-joypad-p: ~A~%" (-> obj grabbed-joypad-p)) - (format #t "~1Tfloat-p: ~A~%" (-> obj float-p)) - (format #t "~1Trange-p: ~A~%" (-> obj range-p)) - (format #t "~1Tshow-len: ~D~%" (-> obj show-len)) - (format #t "~1Tinc-delay: ~D~%" (-> obj inc-delay)) - (format #t "~1Tinc-delay-ctr: ~D~%" (-> obj inc-delay-ctr)) - (format #t "~1Tstep-delay-ctr: ~D~%" (-> obj step-delay-ctr)) - (format #t "~1Tinc-dir: ~D~%" (-> obj inc-dir)) - (format #t "~1Tfval: ~f~%" (-> obj fval)) - (format #t "~1Tfundo-val: ~f~%" (-> obj fundo-val)) - (format #t "~1Tfrange-min: ~f~%" (-> obj frange-min)) - (format #t "~1Tfrange-max: ~f~%" (-> obj frange-max)) - (format #t "~1Tfstart-inc: ~f~%" (-> obj fstart-inc)) - (format #t "~1Tfstep: ~f~%" (-> obj fstep)) - (format #t "~1Tfprecision: ~D~%" (-> obj fprecision)) - (format #t "~1Tfactivate-func: ~A~%" (-> obj factivate-func)) - (format #t "~1Tival: ~D~%" (-> obj fval)) - (format #t "~1Tiundo-val: ~D~%" (-> obj fundo-val)) - (format #t "~1Tirange-min: ~D~%" (-> obj frange-min)) - (format #t "~1Tirange-max: ~D~%" (-> obj frange-max)) - (format #t "~1Tistart-inc: ~D~%" (-> obj fstart-inc)) - (format #t "~1Tistep: ~D~%" (-> obj fstep)) - (format #t "~1Tihex-p: ~A~%" (-> obj ihex-p)) - (format #t "~1Tiactivate-func: ~A~%" (-> obj factivate-func)) - (format #t "~1Tifloat-p: ~A~%" (-> obj ifloat-p)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tparent: ~A~%" (-> this parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> this refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> this refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> this id)) + (format #t "~1Tdisplay-str: ~A~%" (-> this display-str)) + (format #t "~1Tgrabbed-joypad-p: ~A~%" (-> this grabbed-joypad-p)) + (format #t "~1Tfloat-p: ~A~%" (-> this float-p)) + (format #t "~1Trange-p: ~A~%" (-> this range-p)) + (format #t "~1Tshow-len: ~D~%" (-> this show-len)) + (format #t "~1Tinc-delay: ~D~%" (-> this inc-delay)) + (format #t "~1Tinc-delay-ctr: ~D~%" (-> this inc-delay-ctr)) + (format #t "~1Tstep-delay-ctr: ~D~%" (-> this step-delay-ctr)) + (format #t "~1Tinc-dir: ~D~%" (-> this inc-dir)) + (format #t "~1Tfval: ~f~%" (-> this fval)) + (format #t "~1Tfundo-val: ~f~%" (-> this fundo-val)) + (format #t "~1Tfrange-min: ~f~%" (-> this frange-min)) + (format #t "~1Tfrange-max: ~f~%" (-> this frange-max)) + (format #t "~1Tfstart-inc: ~f~%" (-> this fstart-inc)) + (format #t "~1Tfstep: ~f~%" (-> this fstep)) + (format #t "~1Tfprecision: ~D~%" (-> this fprecision)) + (format #t "~1Tfactivate-func: ~A~%" (-> this factivate-func)) + (format #t "~1Tival: ~D~%" (-> this fval)) + (format #t "~1Tiundo-val: ~D~%" (-> this fundo-val)) + (format #t "~1Tirange-min: ~D~%" (-> this frange-min)) + (format #t "~1Tirange-max: ~D~%" (-> this frange-max)) + (format #t "~1Tistart-inc: ~D~%" (-> this fstart-inc)) + (format #t "~1Tistep: ~D~%" (-> this fstep)) + (format #t "~1Tihex-p: ~A~%" (-> this ihex-p)) + (format #t "~1Tiactivate-func: ~A~%" (-> this factivate-func)) + (format #t "~1Tifloat-p: ~A~%" (-> this ifloat-p)) (label cfg-4) - obj + this ) ;; definition for function debug-menu-item-var-update-display-str diff --git a/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc b/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc index e3349d2c57..955bccb04a 100644 --- a/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/nav/mysql-nav-graph_REF.gc @@ -32,28 +32,28 @@ ) ;; definition for method 3 of type mysql-nav-node -(defmethod inspect mysql-nav-node ((obj mysql-nav-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect mysql-nav-node ((this mysql-nav-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mysql-nav-node) - (format #t "~1Tmysql-save-flag: ~D~%" (-> obj mysql-save-flag)) - (format #t "~1Truntime-id: ~D~%" (-> obj runtime-id)) - (format #t "~1Ttemp-edge-list: ~A~%" (-> obj temp-edge-list)) - (format #t "~1Tlevel-node-index: ~D~%" (-> obj level-node-index)) - (format #t "~1Tcam-dist: ~f~%" (-> obj cam-dist)) - (format #t "~1Tvisible: ~A~%" (-> obj visible)) - (format #t "~1Tnav_node_id: ~D~%" (-> obj nav_node_id)) - (format #t "~1Tnav_graph_id: ~D~%" (-> obj nav_graph_id)) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tlevel_name: ~A~%" (-> obj level_name)) - (format #t "~1Tangle: ~f~%" (-> obj angle)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) - (format #t "~1Tnav_node_flag: ~D~%" (-> obj nav_node_flag)) - (format #t "~1Tnav_mesh_id: ~D~%" (-> obj nav_mesh_id)) + (format #t "[~8x] ~A~%" this 'mysql-nav-node) + (format #t "~1Tmysql-save-flag: ~D~%" (-> this mysql-save-flag)) + (format #t "~1Truntime-id: ~D~%" (-> this runtime-id)) + (format #t "~1Ttemp-edge-list: ~A~%" (-> this temp-edge-list)) + (format #t "~1Tlevel-node-index: ~D~%" (-> this level-node-index)) + (format #t "~1Tcam-dist: ~f~%" (-> this cam-dist)) + (format #t "~1Tvisible: ~A~%" (-> this visible)) + (format #t "~1Tnav_node_id: ~D~%" (-> this nav_node_id)) + (format #t "~1Tnav_graph_id: ~D~%" (-> this nav_graph_id)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tlevel_name: ~A~%" (-> this level_name)) + (format #t "~1Tangle: ~f~%" (-> this angle)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tnav_node_flag: ~D~%" (-> this nav_node_flag)) + (format #t "~1Tnav_mesh_id: ~D~%" (-> this nav_mesh_id)) (label cfg-4) - obj + this ) ;; definition of type mysql-nav-node-array @@ -66,17 +66,17 @@ ) ;; definition for method 3 of type mysql-nav-node-array -(defmethod inspect mysql-nav-node-array ((obj mysql-nav-node-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect mysql-nav-node-array ((this mysql-nav-node-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -112,31 +112,31 @@ ) ;; definition for method 3 of type mysql-nav-edge -(defmethod inspect mysql-nav-edge ((obj mysql-nav-edge)) - (when (not obj) - (set! obj obj) +(defmethod inspect mysql-nav-edge ((this mysql-nav-edge)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mysql-nav-edge) - (format #t "~1Tmysql-save-flag: ~D~%" (-> obj mysql-save-flag)) - (format #t "~1Truntime-id: ~D~%" (-> obj runtime-id)) - (format #t "~1Truntime-node-id-1: ~D~%" (-> obj runtime-node-id-1)) - (format #t "~1Truntime-node-id-2: ~D~%" (-> obj runtime-node-id-2)) - (format #t "~1Ttemp-next-edge: #~%" (-> obj temp-next-edge)) - (format #t "~1Tnav_edge_id: ~D~%" (-> obj nav_edge_id)) - (format #t "~1Tnav_graph_id: ~D~%" (-> obj nav_graph_id)) - (format #t "~1Tnav_node_id_1: ~D~%" (-> obj nav_node_id_1)) - (format #t "~1Tnav_node_id_2: ~D~%" (-> obj nav_node_id_2)) - (format #t "~1Tdirectionality: ~D~%" (-> obj directionality)) - (format #t "~1Tspeed_limit: ~f~%" (-> obj speed_limit)) - (format #t "~1Tdensity: ~f~%" (-> obj density)) - (format #t "~1Ttraffic_edge_flag: ~D~%" (-> obj traffic_edge_flag)) - (format #t "~1Tnav_clock_mask: ~D~%" (-> obj nav_clock_mask)) - (format #t "~1Tnav_clock_type: ~D~%" (-> obj nav_clock_type)) - (format #t "~1Twidth: ~f~%" (-> obj width)) - (format #t "~1Tminimap_edge_flag: ~D~%" (-> obj minimap_edge_flag)) + (format #t "[~8x] ~A~%" this 'mysql-nav-edge) + (format #t "~1Tmysql-save-flag: ~D~%" (-> this mysql-save-flag)) + (format #t "~1Truntime-id: ~D~%" (-> this runtime-id)) + (format #t "~1Truntime-node-id-1: ~D~%" (-> this runtime-node-id-1)) + (format #t "~1Truntime-node-id-2: ~D~%" (-> this runtime-node-id-2)) + (format #t "~1Ttemp-next-edge: #~%" (-> this temp-next-edge)) + (format #t "~1Tnav_edge_id: ~D~%" (-> this nav_edge_id)) + (format #t "~1Tnav_graph_id: ~D~%" (-> this nav_graph_id)) + (format #t "~1Tnav_node_id_1: ~D~%" (-> this nav_node_id_1)) + (format #t "~1Tnav_node_id_2: ~D~%" (-> this nav_node_id_2)) + (format #t "~1Tdirectionality: ~D~%" (-> this directionality)) + (format #t "~1Tspeed_limit: ~f~%" (-> this speed_limit)) + (format #t "~1Tdensity: ~f~%" (-> this density)) + (format #t "~1Ttraffic_edge_flag: ~D~%" (-> this traffic_edge_flag)) + (format #t "~1Tnav_clock_mask: ~D~%" (-> this nav_clock_mask)) + (format #t "~1Tnav_clock_type: ~D~%" (-> this nav_clock_type)) + (format #t "~1Twidth: ~f~%" (-> this width)) + (format #t "~1Tminimap_edge_flag: ~D~%" (-> this minimap_edge_flag)) (label cfg-4) - obj + this ) ;; definition of type mysql-nav-edge-array @@ -149,17 +149,17 @@ ) ;; definition for method 3 of type mysql-nav-edge-array -(defmethod inspect mysql-nav-edge-array ((obj mysql-nav-edge-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect mysql-nav-edge-array ((this mysql-nav-edge-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -184,21 +184,21 @@ ) ;; definition for method 3 of type mysql-nav-visnode -(defmethod inspect mysql-nav-visnode ((obj mysql-nav-visnode)) - (when (not obj) - (set! obj obj) +(defmethod inspect mysql-nav-visnode ((this mysql-nav-visnode)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mysql-nav-visnode) - (format #t "~1Tmysql-save-flag: ~D~%" (-> obj mysql-save-flag)) - (format #t "~1Truntime-node-id: ~D~%" (-> obj runtime-node-id)) - (format #t "~1Truntime-edge-id: ~D~%" (-> obj runtime-edge-id)) - (format #t "~1Tnav_visnode_id: ~D~%" (-> obj nav_visnode_id)) - (format #t "~1Tnav_graph_id: ~D~%" (-> obj nav_graph_id)) - (format #t "~1Tnav_node_id: ~D~%" (-> obj nav_node_id)) - (format #t "~1Tnav_edge_id: ~D~%" (-> obj nav_edge_id)) + (format #t "[~8x] ~A~%" this 'mysql-nav-visnode) + (format #t "~1Tmysql-save-flag: ~D~%" (-> this mysql-save-flag)) + (format #t "~1Truntime-node-id: ~D~%" (-> this runtime-node-id)) + (format #t "~1Truntime-edge-id: ~D~%" (-> this runtime-edge-id)) + (format #t "~1Tnav_visnode_id: ~D~%" (-> this nav_visnode_id)) + (format #t "~1Tnav_graph_id: ~D~%" (-> this nav_graph_id)) + (format #t "~1Tnav_node_id: ~D~%" (-> this nav_node_id)) + (format #t "~1Tnav_edge_id: ~D~%" (-> this nav_edge_id)) (label cfg-4) - obj + this ) ;; definition of type mysql-nav-visnode-array @@ -211,17 +211,17 @@ ) ;; definition for method 3 of type mysql-nav-visnode-array -(defmethod inspect mysql-nav-visnode-array ((obj mysql-nav-visnode-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect mysql-nav-visnode-array ((this mysql-nav-visnode-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -242,19 +242,19 @@ ) ;; definition for method 3 of type mysql-nav-graph-level-info -(defmethod inspect mysql-nav-graph-level-info ((obj mysql-nav-graph-level-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect mysql-nav-graph-level-info ((this mysql-nav-graph-level-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mysql-nav-graph-level-info) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tlevel-id: ~D~%" (-> obj level-id)) - (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) - (format #t "~1Tbranch-count: ~D~%" (-> obj branch-count)) - (format #t "~1Tto-link-count: ~D~%" (-> obj to-link-count)) + (format #t "[~8x] ~A~%" this 'mysql-nav-graph-level-info) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tlevel-id: ~D~%" (-> this level-id)) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tbranch-count: ~D~%" (-> this branch-count)) + (format #t "~1Tto-link-count: ~D~%" (-> this to-link-count)) (label cfg-4) - obj + this ) ;; definition of type mysql-nav-graph @@ -288,21 +288,21 @@ ) ;; definition for method 3 of type mysql-nav-graph -(defmethod inspect mysql-nav-graph ((obj mysql-nav-graph)) - (when (not obj) - (set! obj obj) +(defmethod inspect mysql-nav-graph ((this mysql-nav-graph)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnav_graph_id: ~D~%" (-> obj nav_graph_id)) - (format #t "~1Tnode-array: ~A~%" (-> obj node-array)) - (format #t "~1Tedge-array: ~A~%" (-> obj edge-array)) - (format #t "~1Tvisnode-array: ~A~%" (-> obj visnode-array)) - (format #t "~1Tlevel-info-array-length: ~D~%" (-> obj level-info-array-length)) - (format #t "~1Tlevel-info-last-lookup: ~D~%" (-> obj level-info-last-lookup)) - (format #t "~1Tlevel-info-array[32] @ #x~X~%" (-> obj level-info-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnav_graph_id: ~D~%" (-> this nav_graph_id)) + (format #t "~1Tnode-array: ~A~%" (-> this node-array)) + (format #t "~1Tedge-array: ~A~%" (-> this edge-array)) + (format #t "~1Tvisnode-array: ~A~%" (-> this visnode-array)) + (format #t "~1Tlevel-info-array-length: ~D~%" (-> this level-info-array-length)) + (format #t "~1Tlevel-info-last-lookup: ~D~%" (-> this level-info-last-lookup)) + (format #t "~1Tlevel-info-array[32] @ #x~X~%" (-> this level-info-array)) (label cfg-4) - obj + this ) ;; definition for method 0 of type mysql-nav-graph @@ -333,23 +333,23 @@ ) ;; definition for method 13 of type mysql-nav-graph -(defmethod alloc-new-node! mysql-nav-graph ((obj mysql-nav-graph)) +(defmethod alloc-new-node! mysql-nav-graph ((this mysql-nav-graph)) "Allocates a new `[[mysql-nav-node]]`, if `node-array`'s `length` exceeds `3000` return `-1` otherwise, return the new size of the array" (cond - ((>= (-> obj node-array length) 3000) + ((>= (-> this node-array length) 3000) (format #t "mysql-nav-graph : nodes buffer too small, increase NAV_GRAPH_EDITOR_NODE_COUNT~%") -1 ) (else - (let ((gp-0 (-> obj node-array data (-> obj node-array length))) - (s5-0 (-> obj node-array length)) + (let ((gp-0 (-> this node-array data (-> this node-array length))) + (s5-0 (-> this node-array length)) ) - (+! (-> obj node-array length) 1) + (+! (-> this node-array length) 1) (set! (-> gp-0 mysql-save-flag) (mysql-save-flag)) (logior! (-> gp-0 mysql-save-flag) (mysql-save-flag insert)) (set! (-> gp-0 runtime-id) (the-as uint s5-0)) - (set! (-> gp-0 nav_graph_id) (-> obj nav_graph_id)) + (set! (-> gp-0 nav_graph_id) (-> this nav_graph_id)) (set! (-> gp-0 level_name) (-> (level-get-target-inside *level*) name)) s5-0 ) @@ -358,23 +358,23 @@ otherwise, return the new size of the array" ) ;; definition for method 14 of type mysql-nav-graph -(defmethod alloc-new-edge! mysql-nav-graph ((obj mysql-nav-graph)) +(defmethod alloc-new-edge! mysql-nav-graph ((this mysql-nav-graph)) "Allocates a new `[[mysql-nav-edge]]`, if `edge-array`'s `length` exceeds `5000` return `-1` otherwise, return the new size of the array" (cond - ((>= (-> obj edge-array length) 5000) + ((>= (-> this edge-array length) 5000) (format #t "mysql-nav-graph : edges buffer too small, increase NAV_GRAPH_EDITOR_EDGE_COUNT~%") -1 ) (else - (let ((v1-5 (-> obj edge-array data (-> obj edge-array length))) - (v0-1 (-> obj edge-array length)) + (let ((v1-5 (-> this edge-array data (-> this edge-array length))) + (v0-1 (-> this edge-array length)) ) - (+! (-> obj edge-array length) 1) + (+! (-> this edge-array length) 1) (set! (-> v1-5 mysql-save-flag) (mysql-save-flag)) (logior! (-> v1-5 mysql-save-flag) (mysql-save-flag insert)) (set! (-> v1-5 runtime-id) (the-as uint v0-1)) - (set! (-> v1-5 nav_graph_id) (-> obj nav_graph_id)) + (set! (-> v1-5 nav_graph_id) (-> this nav_graph_id)) (set! (-> v1-5 directionality) (nav-directionality default)) v0-1 ) @@ -383,11 +383,11 @@ otherwise, return the new size of the array" ) ;; definition for method 15 of type mysql-nav-graph -(defmethod indexof-visnode mysql-nav-graph ((obj mysql-nav-graph) (edge-id int) (node-id int)) +(defmethod indexof-visnode mysql-nav-graph ((this mysql-nav-graph) (edge-id int) (node-id int)) "Returns the index in the `visnode-array` whom's [[mysql-nav-visnode]] has the provided `runtime-edge-id` and `runtime-node-id` if none exist, return `-1`" - (dotimes (v1-0 (-> obj visnode-array length)) - (let ((a3-2 (-> obj visnode-array data v1-0))) + (dotimes (v1-0 (-> this visnode-array length)) + (let ((a3-2 (-> this visnode-array data v1-0))) (if (and (= (-> a3-2 runtime-edge-id) edge-id) (= (-> a3-2 runtime-node-id) node-id)) (return v1-0) ) @@ -397,35 +397,35 @@ if none exist, return `-1`" ) ;; definition for method 16 of type mysql-nav-graph -(defmethod alloc-new-visnode! mysql-nav-graph ((obj mysql-nav-graph) (edge-id int) (node-id int)) +(defmethod alloc-new-visnode! mysql-nav-graph ((this mysql-nav-graph) (edge-id int) (node-id int)) "Potentially allocates a new `[[mysql-nav-visnode]]`: - if `visnode-array`'s `length` exceeds `3000` return `-1` - otherwise, if the node already exists, TODO - if the node does not already exist, create it!" (cond - ((>= (-> obj visnode-array length) 3000) + ((>= (-> this visnode-array length) 3000) (format #t "mysql-nav-graph : visnodes buffer too small, increase NAV_GRAPH_EDITOR_VISNODE_COUNT~%") -1 ) (else - (let ((v1-3 (indexof-visnode obj edge-id node-id))) + (let ((v1-3 (indexof-visnode this edge-id node-id))) (when (>= v1-3 0) (logand! - (-> (the-as mysql-nav-visnode (+ (the-as uint (-> obj visnode-array)) (* v1-3 32))) nav_visnode_id) + (-> (the-as mysql-nav-visnode (+ (the-as uint (-> this visnode-array)) (* v1-3 32))) nav_visnode_id) -3 ) (return v1-3) ) ) - (let ((v1-9 (-> obj visnode-array data (-> obj visnode-array length))) - (v0-1 (-> obj visnode-array length)) + (let ((v1-9 (-> this visnode-array data (-> this visnode-array length))) + (v0-1 (-> this visnode-array length)) ) - (+! (-> obj visnode-array length) 1) + (+! (-> this visnode-array length) 1) (set! (-> v1-9 mysql-save-flag) (mysql-save-flag)) (logior! (-> v1-9 mysql-save-flag) (mysql-save-flag insert)) (set! (-> v1-9 runtime-edge-id) edge-id) (set! (-> v1-9 runtime-node-id) node-id) - (set! (-> v1-9 nav_graph_id) (-> obj nav_graph_id)) + (set! (-> v1-9 nav_graph_id) (-> this nav_graph_id)) v0-1 ) ) @@ -433,20 +433,20 @@ if none exist, return `-1`" ) ;; definition for method 9 of type mysql-nav-node -(defmethod exec-sql! mysql-nav-node ((obj mysql-nav-node)) +(defmethod exec-sql! mysql-nav-node ((this mysql-nav-node)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag delete)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) ) (return #t) ) - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag update)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag update)) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) ) (let ((s5-0 (clear *temp-string*))) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) (((mysql-save-flag insert)) (format s5-0 "insert nav_node set ") ) @@ -457,46 +457,46 @@ if none exist, return `-1`" (format s5-0 "delete from nav_node where ") ) ) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) ((8 4) - (format s5-0 "nav_graph_id=~D," (-> obj nav_graph_id)) - (format s5-0 "x=~M," (-> obj position x)) - (format s5-0 "y=~M," (-> obj position y)) - (format s5-0 "z=~M," (-> obj position z)) - (format s5-0 "level_name='~S'," (-> obj level_name)) - (format s5-0 "angle=~R," (-> obj angle)) - (format s5-0 "radius=~M," (-> obj radius)) + (format s5-0 "nav_graph_id=~D," (-> this nav_graph_id)) + (format s5-0 "x=~M," (-> this position x)) + (format s5-0 "y=~M," (-> this position y)) + (format s5-0 "z=~M," (-> this position z)) + (format s5-0 "level_name='~S'," (-> this level_name)) + (format s5-0 "angle=~R," (-> this angle)) + (format s5-0 "radius=~M," (-> this radius)) (format s5-0 "nav_node_flag='") (let ((v1-20 #t)) - (when (logtest? (-> obj nav_node_flag) (nav-node-flag visited)) + (when (logtest? (-> this nav_node_flag) (nav-node-flag visited)) (if (not v1-20) (format s5-0 ",") ) (format s5-0 "visited") (set! v1-20 #f) ) - (when (logtest? (-> obj nav_node_flag) (nav-node-flag blocked)) + (when (logtest? (-> this nav_node_flag) (nav-node-flag blocked)) (if (not v1-20) (format s5-0 ",") ) (format s5-0 "blocked") (set! v1-20 #f) ) - (when (logtest? (-> obj nav_node_flag) (nav-node-flag pedestrian)) + (when (logtest? (-> this nav_node_flag) (nav-node-flag pedestrian)) (if (not v1-20) (format s5-0 ",") ) (format s5-0 "pedestrian") (set! v1-20 #f) ) - (when (logtest? (-> obj nav_node_flag) (nav-node-flag selected)) + (when (logtest? (-> this nav_node_flag) (nav-node-flag selected)) (if (not v1-20) (format s5-0 ",") ) (format s5-0 "selected") (set! v1-20 #f) ) - (when (logtest? (-> obj nav_node_flag) (nav-node-flag hidden)) + (when (logtest? (-> this nav_node_flag) (nav-node-flag hidden)) (if (not v1-20) (format s5-0 ",") ) @@ -504,55 +504,55 @@ if none exist, return `-1`" ) ) (format s5-0 "',") - (format s5-0 "nav_mesh_id=~D" (-> obj nav_mesh_id)) - (if (logtest? (-> obj mysql-save-flag) (mysql-save-flag update)) - (format s5-0 " where nav_node_id=~D" (-> obj nav_node_id)) + (format s5-0 "nav_mesh_id=~D" (-> this nav_mesh_id)) + (if (logtest? (-> this mysql-save-flag) (mysql-save-flag update)) + (format s5-0 " where nav_node_id=~D" (-> this nav_node_id)) ) (let ((a2-9 (sql-query s5-0))) (when (!= (-> a2-9 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-9 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-9 this) (return #f) ) ) - (when (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) + (when (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) (let ((v1-40 (sql-query "select LAST_INSERT_ID()"))) (if (= (-> v1-40 error) 'select) - (set! (-> obj nav_node_id) (the-as uint (string->int (-> v1-40 data 0)))) + (set! (-> this nav_node_id) (the-as uint (string->int (-> v1-40 data 0)))) ) ) ) ) (((mysql-save-flag delete)) - (format s5-0 "nav_node_id=~D" (-> obj nav_node_id)) + (format s5-0 "nav_node_id=~D" (-> this nav_node_id)) (let ((a2-11 (sql-query s5-0))) (when (!= (-> a2-11 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-11 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-11 this) (return #f) ) ) ) ) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag insert)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) #t ) ;; definition for method 9 of type mysql-nav-edge -(defmethod exec-sql! mysql-nav-edge ((obj mysql-nav-edge)) +(defmethod exec-sql! mysql-nav-edge ((this mysql-nav-edge)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag delete)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) ) (return #t) ) - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag update)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag update)) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) ) (let ((s5-0 (clear *temp-string*))) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) (((mysql-save-flag insert)) (format s5-0 "insert nav_edge set ") ) @@ -563,15 +563,15 @@ if none exist, return `-1`" (format s5-0 "delete from nav_edge where ") ) ) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) ((8 4) - (format s5-0 "nav_graph_id=~D," (-> obj nav_graph_id)) - (format s5-0 "nav_node_id_1=~D," (-> obj nav_node_id_1)) - (format s5-0 "nav_node_id_2=~D," (-> obj nav_node_id_2)) + (format s5-0 "nav_graph_id=~D," (-> this nav_graph_id)) + (format s5-0 "nav_node_id_1=~D," (-> this nav_node_id_1)) + (format s5-0 "nav_node_id_2=~D," (-> this nav_node_id_2)) (let ((t9-7 format) (a0-21 s5-0) (a1-8 "directionality='~S',") - (v1-20 (-> obj directionality)) + (v1-20 (-> this directionality)) ) (t9-7 a0-21 a1-8 (cond ((= v1-20 (nav-directionality directed)) @@ -586,11 +586,11 @@ if none exist, return `-1`" ) ) ) - (format s5-0 "speed_limit=~M," (-> obj speed_limit)) - (format s5-0 "density=~F," (-> obj density)) + (format s5-0 "speed_limit=~M," (-> this speed_limit)) + (format s5-0 "density=~F," (-> this density)) (format s5-0 "traffic_edge_flag='") (let ((v1-21 #t)) - (when (logtest? (-> obj traffic_edge_flag) 1) + (when (logtest? (-> this traffic_edge_flag) 1) (if (not v1-21) (format s5-0 ",") ) @@ -600,56 +600,56 @@ if none exist, return `-1`" (format s5-0 "',") (format s5-0 "nav_clock_mask='") (let ((v1-24 #t)) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-1)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-1)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-1") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-1a)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-1a)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-1a") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-2)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-2)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-2") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-2a)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-2a)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-2a") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-3)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-3)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-3") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-3a)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-3a)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-3a") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-4)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-4)) (if (not v1-24) (format s5-0 ",") ) (format s5-0 "phase-4") (set! v1-24 #f) ) - (when (logtest? (-> obj nav_clock_mask) (nav-clock-mask phase-4a)) + (when (logtest? (-> this nav_clock_mask) (nav-clock-mask phase-4a)) (if (not v1-24) (format s5-0 ",") ) @@ -660,7 +660,7 @@ if none exist, return `-1`" (let ((t9-32 format) (a0-82 s5-0) (a1-33 "nav_clock_type='~S',") - (v1-41 (-> obj nav_clock_type)) + (v1-41 (-> this nav_clock_type)) ) (t9-32 a0-82 a1-33 (cond ((= v1-41 (nav-clock-type clock2)) @@ -678,31 +678,31 @@ if none exist, return `-1`" ) ) ) - (format s5-0 "width=~M," (-> obj width)) + (format s5-0 "width=~M," (-> this width)) (format s5-0 "minimap_edge_flag='") (let ((v1-42 #t)) - (when (logtest? (-> obj minimap_edge_flag) (nav-minimap-edge-flag pass-red)) + (when (logtest? (-> this minimap_edge_flag) (nav-minimap-edge-flag pass-red)) (if (not v1-42) (format s5-0 ",") ) (format s5-0 "pass-red") (set! v1-42 #f) ) - (when (logtest? (-> obj minimap_edge_flag) (nav-minimap-edge-flag pass-green)) + (when (logtest? (-> this minimap_edge_flag) (nav-minimap-edge-flag pass-green)) (if (not v1-42) (format s5-0 ",") ) (format s5-0 "pass-green") (set! v1-42 #f) ) - (when (logtest? (-> obj minimap_edge_flag) (nav-minimap-edge-flag pass-yellow)) + (when (logtest? (-> this minimap_edge_flag) (nav-minimap-edge-flag pass-yellow)) (if (not v1-42) (format s5-0 ",") ) (format s5-0 "pass-yellow") (set! v1-42 #f) ) - (when (logtest? (-> obj minimap_edge_flag) (nav-minimap-edge-flag pass-blue)) + (when (logtest? (-> this minimap_edge_flag) (nav-minimap-edge-flag pass-blue)) (if (not v1-42) (format s5-0 ",") ) @@ -710,54 +710,54 @@ if none exist, return `-1`" ) ) (format s5-0 "'") - (if (logtest? (-> obj mysql-save-flag) (mysql-save-flag update)) - (format s5-0 " where nav_edge_id=~D" (-> obj nav_edge_id)) + (if (logtest? (-> this mysql-save-flag) (mysql-save-flag update)) + (format s5-0 " where nav_edge_id=~D" (-> this nav_edge_id)) ) (let ((a2-14 (sql-query s5-0))) (when (!= (-> a2-14 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-14 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-14 this) (return #f) ) ) - (when (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) + (when (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) (let ((v1-60 (sql-query "select LAST_INSERT_ID()"))) (if (= (-> v1-60 error) 'select) - (set! (-> obj nav_edge_id) (the-as uint (string->int (-> v1-60 data 0)))) + (set! (-> this nav_edge_id) (the-as uint (string->int (-> v1-60 data 0)))) ) ) ) ) (((mysql-save-flag delete)) - (format s5-0 "nav_edge_id=~D" (-> obj nav_edge_id)) + (format s5-0 "nav_edge_id=~D" (-> this nav_edge_id)) (let ((a2-16 (sql-query s5-0))) (when (!= (-> a2-16 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-16 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-16 this) (return #f) ) ) ) ) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag insert)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) #t ) ;; definition for method 9 of type mysql-nav-visnode -(defmethod exec-sql! mysql-nav-visnode ((obj mysql-nav-visnode)) +(defmethod exec-sql! mysql-nav-visnode ((this mysql-nav-visnode)) "Executes the respective SQL operation specified by `mysql-save-flag`, return value indicates success" - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag delete)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag delete)) ) (return #t) ) - (if (and (logtest? (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logtest? (-> obj mysql-save-flag) (mysql-save-flag update)) + (if (and (logtest? (-> this mysql-save-flag) (mysql-save-flag insert)) + (logtest? (-> this mysql-save-flag) (mysql-save-flag update)) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) ) (let ((s5-0 (clear *temp-string*))) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) (((mysql-save-flag insert)) (format s5-0 "insert nav_visible_nodes set ") ) @@ -768,42 +768,42 @@ if none exist, return `-1`" (format s5-0 "delete from nav_visible_nodes where ") ) ) - (case (-> obj mysql-save-flag) + (case (-> this mysql-save-flag) ((8 4) - (format s5-0 "nav_graph_id=~D," (-> obj nav_graph_id)) - (format s5-0 "nav_edge_id=~D," (-> obj nav_edge_id)) - (format s5-0 "nav_node_id=~D" (-> obj nav_node_id)) + (format s5-0 "nav_graph_id=~D," (-> this nav_graph_id)) + (format s5-0 "nav_edge_id=~D," (-> this nav_edge_id)) + (format s5-0 "nav_node_id=~D" (-> this nav_node_id)) (let ((a2-3 (sql-query s5-0))) (when (!= (-> a2-3 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-3 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-3 this) (return #f) ) ) ) (((mysql-save-flag delete)) - (format s5-0 "nav_graph_id=~D and " (-> obj nav_graph_id)) - (format s5-0 "nav_edge_id=~D and " (-> obj nav_edge_id)) - (format s5-0 "nav_node_id=~D" (-> obj nav_node_id)) + (format s5-0 "nav_graph_id=~D and " (-> this nav_graph_id)) + (format s5-0 "nav_edge_id=~D and " (-> this nav_edge_id)) + (format s5-0 "nav_node_id=~D" (-> this nav_node_id)) (let ((a2-7 (sql-query s5-0))) (when (!= (-> a2-7 error) 'modify) - (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-7 obj) + (format 0 "ERROR: sql: modify error ~A for ~A~%" a2-7 this) (return #f) ) ) ) ) ) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag insert)) - (logclear! (-> obj mysql-save-flag) (mysql-save-flag update)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag insert)) + (logclear! (-> this mysql-save-flag) (mysql-save-flag update)) #t ) ;; definition for method 11 of type mysql-nav-graph -(defmethod indexof-nav-node mysql-nav-graph ((obj mysql-nav-graph) (node-id int)) +(defmethod indexof-nav-node mysql-nav-graph ((this mysql-nav-graph) (node-id int)) "Iterate through the `node-array` and return the index for the first [[mysql-nav-node]] whom's `nav_node_id` matches the provided id returns `-1` if none is found" - (dotimes (v1-0 (-> obj node-array length)) - (if (= node-id (-> (the-as mysql-nav-node (-> obj node-array data v1-0)) nav_node_id)) + (dotimes (v1-0 (-> this node-array length)) + (if (= node-id (-> (the-as mysql-nav-node (-> this node-array data v1-0)) nav_node_id)) (return v1-0) ) ) @@ -811,11 +811,11 @@ returns `-1` if none is found" ) ;; definition for method 12 of type mysql-nav-graph -(defmethod indexof-nav-edge mysql-nav-graph ((obj mysql-nav-graph) (edge-id int)) +(defmethod indexof-nav-edge mysql-nav-graph ((this mysql-nav-graph) (edge-id int)) "Iterate through the `edge-array` and return the index for the first [[mysql-nav-edge]] whom's `nav_edge_id` matches the provided id returns `-1` if none is found" - (dotimes (v1-0 (-> obj edge-array length)) - (if (= edge-id (-> (the-as mysql-nav-edge (-> obj edge-array data v1-0)) nav_edge_id)) + (dotimes (v1-0 (-> this edge-array length)) + (if (= edge-id (-> (the-as mysql-nav-edge (-> this edge-array data v1-0)) nav_edge_id)) (return v1-0) ) ) @@ -831,20 +831,20 @@ returns `-1` if none is found" ;; WARN: new jak 2 until loop case, check carefully ;; WARN: new jak 2 until loop case, check carefully ;; WARN: new jak 2 until loop case, check carefully -(defmethod init-from-sql! mysql-nav-graph ((obj mysql-nav-graph) (arg0 string) (arg1 string)) +(defmethod init-from-sql! mysql-nav-graph ((this mysql-nav-graph) (arg0 string) (arg1 string)) "Query the database and initialize the [[mysql-nav-graph]] and all it's related components" (local-vars (sv-16 string) (sv-32 int) (sv-48 int) (sv-64 int)) - (set! (-> obj node-array length) 0) - (set! (-> obj edge-array length) 0) - (set! (-> obj visnode-array length) 0) + (set! (-> this node-array length) 0) + (set! (-> this edge-array length) 0) + (set! (-> this visnode-array length) 0) (let ((s3-0 (clear *temp-string*))) (format s3-0 "select nav_graph_id from nav_graph where name='~S'" arg0) (let ((a2-2 (sql-query s3-0))) (when (!= (-> a2-2 error) 'select) - (format 0 "ERROR: sql: select error ~A for ~A~%" a2-2 obj) + (format 0 "ERROR: sql: select error ~A for ~A~%" a2-2 this) (return #f) ) - (set! (-> obj nav_graph_id) (the-as uint (string->int (-> a2-2 data 0)))) + (set! (-> this nav_graph_id) (the-as uint (string->int (-> a2-2 data 0)))) ) ) (format #t "Loading nodes ...~%") @@ -863,16 +863,16 @@ returns `-1` if none is found" (format s2-0 " limit ~D,~D" s4-1 s3-1) (let ((s2-1 (sql-query s2-0))) (when (!= (-> s2-1 error) 'select) - (format 0 "ERROR: sql: select error ~A for ~A~%" s2-1 obj) + (format 0 "ERROR: sql: select error ~A for ~A~%" s2-1 this) (return #f) ) (let ((s1-0 0)) (while (< s1-0 (-> s2-1 len)) - (when (= (string->int (-> s2-1 data (+ s1-0 9))) (-> obj nav_graph_id)) - (let ((nav-node (-> obj node-array data (-> obj node-array length)))) + (when (= (string->int (-> s2-1 data (+ s1-0 9))) (-> this nav_graph_id)) + (let ((nav-node (-> this node-array data (-> this node-array length)))) (set! (-> nav-node mysql-save-flag) (mysql-save-flag)) - (set! (-> nav-node runtime-id) (the-as uint (-> obj node-array length))) - (set! (-> nav-node nav_graph_id) (-> obj nav_graph_id)) + (set! (-> nav-node runtime-id) (the-as uint (-> this node-array length))) + (set! (-> nav-node nav_graph_id) (-> this nav_graph_id)) (set! (-> nav-node nav_node_id) (the-as uint (string->int (-> s2-1 data s1-0)))) (set! (-> nav-node position x) (* 4096.0 (string->float (-> s2-1 data (+ s1-0 1))))) (set! (-> nav-node position y) (* 4096.0 (string->float (-> s2-1 data (+ s1-0 2))))) @@ -916,7 +916,7 @@ returns `-1` if none is found" (label cfg-27) (set! (-> nav-node nav_mesh_id) (the-as uint (string->int (-> s2-1 data (+ s1-0 8))))) ) - (+! (-> obj node-array length) 1) + (+! (-> this node-array length) 1) ) (+! s1-0 10) ) @@ -932,7 +932,7 @@ returns `-1` if none is found" ) #f (label cfg-34) - (format #t "~D nodes.~%" (-> obj node-array length)) + (format #t "~D nodes.~%" (-> this node-array length)) (format #t "Loading edges ...~%") (let ((s5-1 0) (s4-2 256) @@ -947,24 +947,24 @@ returns `-1` if none is found" ) (let ((s3-3 (sql-query s3-2))) (when (!= (-> s3-3 error) 'select) - (format 0 "ERROR: sql: select error ~A for ~A~%" s3-3 obj) + (format 0 "ERROR: sql: select error ~A for ~A~%" s3-3 this) (return #f) ) (let ((s2-2 0)) (while (< s2-2 (-> s3-3 len)) - (when (= (string->int (-> s3-3 data (+ s2-2 11))) (-> obj nav_graph_id)) + (when (= (string->int (-> s3-3 data (+ s2-2 11))) (-> this nav_graph_id)) (let ((s0-2 (string->int (-> s3-3 data (+ s2-2 1))))) (set! sv-32 (string->int (-> s3-3 data (+ s2-2 2)))) - (set! sv-48 (indexof-nav-node obj s0-2)) - (set! sv-64 (indexof-nav-node obj sv-32)) - (let ((nav-edge (-> obj edge-array data (-> obj edge-array length)))) + (set! sv-48 (indexof-nav-node this s0-2)) + (set! sv-64 (indexof-nav-node this sv-32)) + (let ((nav-edge (-> this edge-array data (-> this edge-array length)))) (when (and (!= sv-48 -1) (!= sv-64 -1)) - (set! (-> nav-edge nav_graph_id) (-> obj nav_graph_id)) + (set! (-> nav-edge nav_graph_id) (-> this nav_graph_id)) (set! (-> nav-edge nav_edge_id) (the-as uint (string->int (-> s3-3 data s2-2)))) (set! (-> nav-edge nav_node_id_1) (the-as uint s0-2)) (set! (-> nav-edge nav_node_id_2) (the-as uint sv-32)) (set! (-> nav-edge mysql-save-flag) (mysql-save-flag)) - (set! (-> nav-edge runtime-id) (the-as uint (-> obj edge-array length))) + (set! (-> nav-edge runtime-id) (the-as uint (-> this edge-array length))) (set! (-> nav-edge runtime-node-id-1) sv-48) (set! (-> nav-edge runtime-node-id-2) sv-64) (let ((s0-3 (-> s3-3 data (+ s2-2 3)))) @@ -1100,7 +1100,7 @@ returns `-1` if none is found" ) #f (label cfg-102) - (+! (-> obj edge-array length) 1) + (+! (-> this edge-array length) 1) ) ) ) @@ -1119,7 +1119,7 @@ returns `-1` if none is found" ) #f (label cfg-109) - (format #t "~D edges.~%" (-> obj edge-array length)) + (format #t "~D edges.~%" (-> this edge-array length)) (format #t "Loading visnodes ...~%") (let ((s5-2 0) (s4-3 256) @@ -1129,21 +1129,21 @@ returns `-1` if none is found" (format s3-4 "select nav_edge_id,nav_node_id,nav_graph_id from nav_visible_nodes limit ~D,~D" s5-2 s4-3) (let ((s3-5 (sql-query s3-4))) (when (!= (-> s3-5 error) 'select) - (format 0 "ERROR: sql: select error ~A for ~A~%" s3-5 obj) + (format 0 "ERROR: sql: select error ~A for ~A~%" s3-5 this) (return #f) ) (let ((s2-3 0)) (while (< s2-3 (-> s3-5 len)) - (when (= (string->int (-> s3-5 data (+ s2-3 2))) (-> obj nav_graph_id)) - (let ((nav-visnode (-> obj visnode-array data (-> obj visnode-array length)))) + (when (= (string->int (-> s3-5 data (+ s2-3 2))) (-> this nav_graph_id)) + (let ((nav-visnode (-> this visnode-array data (-> this visnode-array length)))) (set! (-> nav-visnode mysql-save-flag) (mysql-save-flag)) - (set! (-> nav-visnode nav_graph_id) (-> obj nav_graph_id)) + (set! (-> nav-visnode nav_graph_id) (-> this nav_graph_id)) (set! (-> nav-visnode nav_edge_id) (the-as uint (string->int (-> s3-5 data s2-3)))) (set! (-> nav-visnode nav_node_id) (the-as uint (string->int (-> s3-5 data (+ s2-3 1))))) - (set! (-> nav-visnode runtime-edge-id) (indexof-nav-edge obj (the-as int (-> nav-visnode nav_edge_id)))) - (set! (-> nav-visnode runtime-node-id) (indexof-nav-node obj (the-as int (-> nav-visnode nav_node_id)))) + (set! (-> nav-visnode runtime-edge-id) (indexof-nav-edge this (the-as int (-> nav-visnode nav_edge_id)))) + (set! (-> nav-visnode runtime-node-id) (indexof-nav-node this (the-as int (-> nav-visnode nav_node_id)))) ) - (+! (-> obj visnode-array length) 1) + (+! (-> this visnode-array length) 1) ) (+! s2-3 3) ) @@ -1159,15 +1159,15 @@ returns `-1` if none is found" ) #f (label cfg-122) - (format #t "~D visnodes.~%" (-> obj visnode-array length)) + (format #t "~D visnodes.~%" (-> this visnode-array length)) #t ) ;; definition for method 10 of type mysql-nav-node -(defmethod temp-edge-size mysql-nav-node ((obj mysql-nav-node)) +(defmethod temp-edge-size mysql-nav-node ((this mysql-nav-node)) "Returns the number of [[mysql-nav-edge]] stored in the `temp-edge-list`" (let ((v0-0 0)) - (let ((v1-0 (the-as object (-> obj temp-edge-list)))) + (let ((v1-0 (the-as object (-> this temp-edge-list)))) (while v1-0 (+! v0-0 1) (set! v1-0 (-> (the-as mysql-nav-edge v1-0) temp-next-edge)) @@ -1179,19 +1179,19 @@ returns `-1` if none is found" ;; definition for method 17 of type mysql-nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod mysql-nav-graph-method-17 mysql-nav-graph ((obj mysql-nav-graph)) - (dotimes (v1-0 (-> obj node-array length)) - (set! (-> (the-as mysql-nav-node (-> obj node-array data v1-0)) temp-edge-list) +(defmethod mysql-nav-graph-method-17 mysql-nav-graph ((this mysql-nav-graph)) + (dotimes (v1-0 (-> this node-array length)) + (set! (-> (the-as mysql-nav-node (-> this node-array data v1-0)) temp-edge-list) (the-as (inline-array mysql-nav-edge) #f) ) ) - (dotimes (v1-3 (-> obj edge-array length)) - (set! (-> (the-as mysql-nav-edge (-> obj edge-array data v1-3)) temp-next-edge) #f) + (dotimes (v1-3 (-> this edge-array length)) + (set! (-> (the-as mysql-nav-edge (-> this edge-array data v1-3)) temp-next-edge) #f) ) - (countdown (v1-7 (-> obj edge-array length)) - (let ((a1-17 (-> obj edge-array data v1-7))) + (countdown (v1-7 (-> this edge-array length)) + (let ((a1-17 (-> this edge-array data v1-7))) (when (not (logtest? (-> a1-17 mysql-save-flag) (mysql-save-flag delete))) - (let ((a2-8 (-> obj node-array data (-> a1-17 runtime-node-id-1)))) + (let ((a2-8 (-> this node-array data (-> a1-17 runtime-node-id-1)))) (when (not (logtest? (-> a2-8 mysql-save-flag) (mysql-save-flag delete))) (cond ((-> a2-8 temp-edge-list) @@ -1212,11 +1212,11 @@ returns `-1` if none is found" ) ;; definition for method 18 of type mysql-nav-graph -(defmethod lookup-level-info2 mysql-nav-graph ((obj mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol)) +(defmethod lookup-level-info2 mysql-nav-graph ((this mysql-nav-graph) (arg0 mysql-nav-node) (arg1 symbol)) "TODO - this was originally called `lookup-level-info` but it clashes with the function defined in `level`" (let ((s5-0 (the-as mysql-nav-graph-level-info #f))) - (b! (>= (-> obj level-info-last-lookup) (-> obj level-info-array-length)) cfg-3 :delay #f) - (let ((v1-5 (-> obj level-info-array (-> obj level-info-last-lookup)))) + (b! (>= (-> this level-info-last-lookup) (-> this level-info-array-length)) cfg-3 :delay #f) + (let ((v1-5 (-> this level-info-array (-> this level-info-last-lookup)))) (let ((a0-2 (-> v1-5 level))) (b! (!= (-> arg0 level_name) a0-2) cfg-3 :delay (empty-form)) ) @@ -1227,12 +1227,12 @@ returns `-1` if none is found" (let ((v1-6 0)) (b! #t cfg-9 :delay (nop!)) (label cfg-4) - (let ((a0-6 (-> obj level-info-array v1-6))) + (let ((a0-6 (-> this level-info-array v1-6))) (let ((a3-1 (-> a0-6 level))) (b! (!= (-> arg0 level_name) a3-1) cfg-8 :delay (empty-form)) ) (if arg1 - (set! (-> obj level-info-last-lookup) v1-6) + (set! (-> this level-info-last-lookup) v1-6) ) (set! s5-0 a0-6) ) @@ -1240,18 +1240,18 @@ returns `-1` if none is found" (label cfg-8) (+! v1-6 1) (label cfg-9) - (b! (< v1-6 (-> obj level-info-array-length)) cfg-4) + (b! (< v1-6 (-> this level-info-array-length)) cfg-4) ) - (let ((v1-9 (-> obj level-info-array-length))) + (let ((v1-9 (-> this level-info-array-length))) (cond ((< v1-9 32) (if arg1 - (set! (-> obj level-info-last-lookup) v1-9) + (set! (-> this level-info-last-lookup) v1-9) ) - (set! s5-0 (-> obj level-info-array v1-9)) + (set! s5-0 (-> this level-info-array v1-9)) (set! (-> s5-0 level) (-> arg0 level_name)) (set! (-> s5-0 node-count) 0) - (+! (-> obj level-info-array-length) 1) + (+! (-> this level-info-array-length) 1) ) (else (format @@ -1262,12 +1262,12 @@ returns `-1` if none is found" (let ((s4-0 0)) (b! #t cfg-16 :delay (nop!)) (label cfg-15) - (let ((v1-17 (-> obj level-info-array s4-0))) + (let ((v1-17 (-> this level-info-array s4-0))) (format 0 "~d ~s~%" s4-0 (-> v1-17 level)) ) (+! s4-0 1) (label cfg-16) - (b! (< s4-0 (-> obj level-info-array-length)) cfg-15) + (b! (< s4-0 (-> this level-info-array-length)) cfg-15) ) (break!) 0 @@ -1281,11 +1281,11 @@ returns `-1` if none is found" ;; definition for method 19 of type mysql-nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod mysql-nav-graph-method-19 mysql-nav-graph ((obj mysql-nav-graph)) - (set! (-> obj level-info-array-length) 0) - (set! (-> obj level-info-last-lookup) 0) +(defmethod mysql-nav-graph-method-19 mysql-nav-graph ((this mysql-nav-graph)) + (set! (-> this level-info-array-length) 0) + (set! (-> this level-info-last-lookup) 0) (dotimes (v1-0 32) - (let ((a0-3 (-> obj level-info-array v1-0))) + (let ((a0-3 (-> this level-info-array v1-0))) (set! (-> a0-3 level) #f) (set! (-> a0-3 level-id) (the-as uint v1-0)) (set! (-> a0-3 node-count) 0) @@ -1294,16 +1294,16 @@ returns `-1` if none is found" ) 0 ) - (dotimes (s5-0 (-> obj node-array length)) - (let ((s4-0 (-> obj node-array data s5-0))) + (dotimes (s5-0 (-> this node-array length)) + (let ((s4-0 (-> this node-array data s5-0))) (when (not (logtest? (-> s4-0 mysql-save-flag) (mysql-save-flag delete))) - (let ((v1-10 (lookup-level-info2 obj s4-0 #t))) + (let ((v1-10 (lookup-level-info2 this s4-0 #t))) (set! (-> s4-0 level-node-index) (-> v1-10 node-count)) (+! (-> v1-10 node-count) 1) (let ((a0-10 (the-as mysql-nav-edge (-> s4-0 temp-edge-list)))) (while a0-10 (when (not (logtest? (-> a0-10 mysql-save-flag) (mysql-save-flag delete))) - (if (!= (-> v1-10 level) (-> obj node-array data (-> a0-10 runtime-node-id-2) level_name)) + (if (!= (-> v1-10 level) (-> this node-array data (-> a0-10 runtime-node-id-2) level_name)) (+! (-> v1-10 to-link-count) 1) ) (+! (-> v1-10 branch-count) 1) @@ -1321,19 +1321,19 @@ returns `-1` if none is found" ;; definition for method 20 of type mysql-nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod mysql-nav-graph-method-20 mysql-nav-graph ((obj mysql-nav-graph)) - (mysql-nav-graph-method-17 obj) - (mysql-nav-graph-method-19 obj) +(defmethod mysql-nav-graph-method-20 mysql-nav-graph ((this mysql-nav-graph)) + (mysql-nav-graph-method-17 this) + (mysql-nav-graph-method-19 this) 0 (none) ) ;; definition for method 10 of type mysql-nav-graph -(defmethod exec-sql! mysql-nav-graph ((obj mysql-nav-graph)) +(defmethod exec-sql! mysql-nav-graph ((this mysql-nav-graph)) (format #t "Saving nodes ...~%") - (dotimes (s5-0 (-> obj node-array length)) - (let ((a0-3 (-> obj node-array data s5-0))) - (set! (-> a0-3 nav_graph_id) (-> obj nav_graph_id)) + (dotimes (s5-0 (-> this node-array length)) + (let ((a0-3 (-> this node-array data s5-0))) + (set! (-> a0-3 nav_graph_id) (-> this nav_graph_id)) (if (not (exec-sql! a0-3)) (return #f) ) @@ -1341,22 +1341,22 @@ returns `-1` if none is found" ) (format #t "Done.~%") (format #t "Saving edges ...~%") - (dotimes (s5-1 (-> obj edge-array length)) - (let ((a0-7 (-> obj edge-array data s5-1))) - (set! (-> a0-7 nav_graph_id) (-> obj nav_graph_id)) - (set! (-> a0-7 nav_node_id_1) (-> obj node-array data (-> a0-7 runtime-node-id-1) nav_node_id)) - (set! (-> a0-7 nav_node_id_2) (-> obj node-array data (-> a0-7 runtime-node-id-2) nav_node_id)) + (dotimes (s5-1 (-> this edge-array length)) + (let ((a0-7 (-> this edge-array data s5-1))) + (set! (-> a0-7 nav_graph_id) (-> this nav_graph_id)) + (set! (-> a0-7 nav_node_id_1) (-> this node-array data (-> a0-7 runtime-node-id-1) nav_node_id)) + (set! (-> a0-7 nav_node_id_2) (-> this node-array data (-> a0-7 runtime-node-id-2) nav_node_id)) (exec-sql! a0-7) ) ) (format #t "Done.~%") (format #t "Saving visible nodes ...~%") - (dotimes (s5-2 (-> obj visnode-array length)) - (let ((a0-11 (-> obj visnode-array data s5-2))) - (set! (-> a0-11 nav_graph_id) (-> obj nav_graph_id)) - (set! (-> a0-11 nav_node_id) (-> obj node-array data (-> a0-11 runtime-node-id) nav_node_id)) + (dotimes (s5-2 (-> this visnode-array length)) + (let ((a0-11 (-> this visnode-array data s5-2))) + (set! (-> a0-11 nav_graph_id) (-> this nav_graph_id)) + (set! (-> a0-11 nav_node_id) (-> this node-array data (-> a0-11 runtime-node-id) nav_node_id)) (set! (-> a0-11 nav_edge_id) - (-> (the-as mysql-nav-edge (+ (the-as uint (-> obj edge-array)) (* 80 (-> a0-11 runtime-edge-id)))) + (-> (the-as mysql-nav-edge (+ (the-as uint (-> this edge-array)) (* 80 (-> a0-11 runtime-edge-id)))) nav_node_id_2 ) ) 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 1d5c1467e0..7cd8b0aa0d 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 @@ -17,18 +17,18 @@ ) ;; definition for method 3 of type nav-graph-command -(defmethod inspect nav-graph-command ((obj nav-graph-command)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-graph-command ((this nav-graph-command)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-graph-command) - (format #t "~1Tcom-type: ~D~%" (-> obj com-type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tmove-vec: #~%" (-> obj move-vec)) + (format #t "[~8x] ~A~%" this 'nav-graph-command) + (format #t "~1Tcom-type: ~D~%" (-> this com-type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tmove-vec: #~%" (-> this move-vec)) (label cfg-4) - obj + this ) ;; definition of type nav-graph-command-array @@ -41,17 +41,17 @@ ) ;; definition for method 3 of type nav-graph-command-array -(defmethod inspect nav-graph-command-array ((obj nav-graph-command-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-graph-command-array ((this nav-graph-command-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -147,43 +147,43 @@ ) ;; definition for method 3 of type nav-graph-editor -(defmethod inspect nav-graph-editor ((obj nav-graph-editor)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-graph-editor ((this nav-graph-editor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnav-graph: ~A~%" (-> obj nav-graph)) - (format #t "~2Tmode: ~D~%" (-> obj mode)) - (format #t "~2Tcommand-id: ~D~%" (-> obj command-id)) - (format #t "~2Tmax-command: ~D~%" (-> obj max-command)) - (format #t "~2Tselected-index: ~D~%" (-> obj selected-index)) - (format #t "~2Tselected-dist: ~f~%" (-> obj selected-dist)) - (format #t "~2Tselected-node-edge?: ~A~%" (-> obj selected-node-edge?)) - (format #t "~2Tclosest-node: ~D~%" (-> obj closest-node)) - (format #t "~2Tdist-closest-node: ~f~%" (-> obj dist-closest-node)) - (format #t "~2Tclosest-edge: ~D~%" (-> obj closest-edge)) - (format #t "~2Tdist-closest-edge: ~f~%" (-> obj dist-closest-edge)) - (format #t "~2Tmouse-pos: #~%" (-> obj mouse-pos)) - (format #t "~2Tmouse-hit: #~%" (-> obj mouse-hit)) - (format #t "~2Tmouse-hit-pick: #~%" (-> obj mouse-hit-pick)) - (format #t "~2Tmouse-normal: #~%" (-> obj mouse-normal)) - (format #t "~2Tmouse-spos-hold: #~%" (-> obj mouse-spos-hold)) - (format #t "~2Tedge-src: ~D~%" (-> obj edge-src)) - (format #t "~2Tedge-dst: ~D~%" (-> obj edge-dst)) - (format #t "~2Tedge-visibility: ~D~%" (-> obj edge-visibility)) - (format #t "~2Tvehicle-edit-mode: ~A~%" (-> obj vehicle-edit-mode)) - (format #t "~2Thover-edit-mode: ~A~%" (-> obj hover-edit-mode)) - (format #t "~2Tclipping-dist: ~f~%" (-> obj clipping-dist)) - (format #t "~2Tplane-height: ~f~%" (-> obj plane-height)) - (format #t "~2Tplane-height-hold: ~f~%" (-> obj plane-height-hold)) - (format #t "~2Tdefault-node: #~%" (-> obj default-node)) - (format #t "~2Tdefault-edge: #~%" (-> obj default-edge)) - (format #t "~2Tcommand-array: ~A~%" (-> obj command-array)) + (format #t "~2Tnav-graph: ~A~%" (-> this nav-graph)) + (format #t "~2Tmode: ~D~%" (-> this mode)) + (format #t "~2Tcommand-id: ~D~%" (-> this command-id)) + (format #t "~2Tmax-command: ~D~%" (-> this max-command)) + (format #t "~2Tselected-index: ~D~%" (-> this selected-index)) + (format #t "~2Tselected-dist: ~f~%" (-> this selected-dist)) + (format #t "~2Tselected-node-edge?: ~A~%" (-> this selected-node-edge?)) + (format #t "~2Tclosest-node: ~D~%" (-> this closest-node)) + (format #t "~2Tdist-closest-node: ~f~%" (-> this dist-closest-node)) + (format #t "~2Tclosest-edge: ~D~%" (-> this closest-edge)) + (format #t "~2Tdist-closest-edge: ~f~%" (-> this dist-closest-edge)) + (format #t "~2Tmouse-pos: #~%" (-> this mouse-pos)) + (format #t "~2Tmouse-hit: #~%" (-> this mouse-hit)) + (format #t "~2Tmouse-hit-pick: #~%" (-> this mouse-hit-pick)) + (format #t "~2Tmouse-normal: #~%" (-> this mouse-normal)) + (format #t "~2Tmouse-spos-hold: #~%" (-> this mouse-spos-hold)) + (format #t "~2Tedge-src: ~D~%" (-> this edge-src)) + (format #t "~2Tedge-dst: ~D~%" (-> this edge-dst)) + (format #t "~2Tedge-visibility: ~D~%" (-> this edge-visibility)) + (format #t "~2Tvehicle-edit-mode: ~A~%" (-> this vehicle-edit-mode)) + (format #t "~2Thover-edit-mode: ~A~%" (-> this hover-edit-mode)) + (format #t "~2Tclipping-dist: ~f~%" (-> this clipping-dist)) + (format #t "~2Tplane-height: ~f~%" (-> this plane-height)) + (format #t "~2Tplane-height-hold: ~f~%" (-> this plane-height-hold)) + (format #t "~2Tdefault-node: #~%" (-> this default-node)) + (format #t "~2Tdefault-edge: #~%" (-> this default-edge)) + (format #t "~2Tcommand-array: ~A~%" (-> this command-array)) (label cfg-4) - obj + this ) ;; definition for symbol *nav-graph-editor*, type (pointer nav-graph-editor) @@ -191,57 +191,57 @@ ;; definition for method 62 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-62 nav-graph-editor ((obj nav-graph-editor) (arg0 symbol) (arg1 symbol)) +(defmethod nav-graph-editor-method-62 nav-graph-editor ((this nav-graph-editor) (arg0 symbol) (arg1 symbol)) (case arg0 (('minimap) - (set! (-> obj vehicle-edit-mode) #t) - (set! (-> obj default-node nav_node_flag) (nav-node-flag)) - (set! (-> obj clipping-dist) 3276800.0) + (set! (-> this vehicle-edit-mode) #t) + (set! (-> this default-node nav_node_flag) (nav-node-flag)) + (set! (-> this clipping-dist) 3276800.0) ) (('hover) - (set! (-> obj hover-edit-mode) #t) + (set! (-> this hover-edit-mode) #t) ) ) - (set! (-> obj command-array length) 0) - (init-from-sql! (-> obj nav-graph) (the-as string arg0) (the-as string arg1)) - (set! (-> obj default-node nav_graph_id) (-> obj nav-graph nav_graph_id)) - (set! (-> obj default-edge nav_graph_id) (-> obj nav-graph nav_graph_id)) + (set! (-> this command-array length) 0) + (init-from-sql! (-> this nav-graph) (the-as string arg0) (the-as string arg1)) + (set! (-> this default-node nav_graph_id) (-> this nav-graph nav_graph_id)) + (set! (-> this default-edge nav_graph_id) (-> this nav-graph nav_graph_id)) (none) ) ;; definition for method 63 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-63 nav-graph-editor ((obj nav-graph-editor)) - (set! (-> obj command-array length) 0) - (exec-sql! (-> obj nav-graph)) +(defmethod nav-graph-editor-method-63 nav-graph-editor ((this nav-graph-editor)) + (set! (-> this command-array length) 0) + (exec-sql! (-> this nav-graph)) (none) ) ;; definition for method 10 of type nav-graph-editor -(defmethod deactivate nav-graph-editor ((obj nav-graph-editor)) +(defmethod deactivate nav-graph-editor ((this nav-graph-editor)) (set! *nav-graph-editor* (the-as (pointer nav-graph-editor) #f)) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; definition for method 7 of type nav-graph-editor ;; WARN: Return type mismatch none vs nav-graph-editor. -(defmethod relocate nav-graph-editor ((obj nav-graph-editor) (arg0 int)) +(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)) obj arg0) + ((the-as (function process int none) (find-parent-method nav-graph-editor 7)) this arg0) ) ) ;; definition for method 60 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-60 nav-graph-editor ((obj nav-graph-editor)) - (let ((v0-0 (not (-> obj vehicle-edit-mode)))) - (set! (-> obj vehicle-edit-mode) v0-0) - (set! (-> obj default-node nav_node_flag) (if v0-0 - (nav-node-flag) - (nav-node-flag pedestrian) - ) +(defmethod nav-graph-editor-method-60 nav-graph-editor ((this nav-graph-editor)) + (let ((v0-0 (not (-> this vehicle-edit-mode)))) + (set! (-> this vehicle-edit-mode) v0-0) + (set! (-> this default-node nav_node_flag) (if v0-0 + (nav-node-flag) + (nav-node-flag pedestrian) + ) ) ) (none) @@ -249,17 +249,17 @@ ;; definition for method 61 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-61 nav-graph-editor ((obj nav-graph-editor)) - (set! (-> obj hover-edit-mode) (not (-> obj hover-edit-mode))) +(defmethod nav-graph-editor-method-61 nav-graph-editor ((this nav-graph-editor)) + (set! (-> this hover-edit-mode) (not (-> this hover-edit-mode))) (none) ) ;; definition for method 54 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. ;; WARN: Function (method 54 nav-graph-editor) has a return type of none, but the expression builder found a return statement. -(defmethod nav-graph-editor-method-54 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (when (not (-> obj hover-edit-mode)) - (let ((gp-0 (-> obj nav-graph node-array data arg0))) +(defmethod nav-graph-editor-method-54 nav-graph-editor ((this nav-graph-editor) (arg0 int)) + (when (not (-> this hover-edit-mode)) + (let ((gp-0 (-> this nav-graph node-array data arg0))) (dotimes (s5-0 (-> *level* length)) (let ((s4-0 (-> *level* level s5-0))) (when (= (-> s4-0 status) 'active) @@ -304,8 +304,8 @@ ) ;; definition for method 30 of type nav-graph-editor -(defmethod nav-graph-editor-method-30 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (let ((s3-0 (-> obj nav-graph edge-array data arg0)) +(defmethod nav-graph-editor-method-30 nav-graph-editor ((this nav-graph-editor) (arg0 int)) + (let ((s3-0 (-> this nav-graph edge-array data arg0)) (s4-0 (new 'stack-no-clear 'matrix)) ) (format *stdcon* "flags ( ") @@ -328,21 +328,21 @@ (-> s4-0 trans) (the-as vector - (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> s3-0 runtime-node-id-1))) + (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> s3-0 runtime-node-id-1))) ) (the-as vector - (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> s3-0 runtime-node-id-2))) + (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> s3-0 runtime-node-id-2))) ) ) - (dotimes (s3-1 (-> obj nav-graph visnode-array length)) - (let ((v1-23 (-> obj nav-graph visnode-array data s3-1))) + (dotimes (s3-1 (-> this nav-graph visnode-array length)) + (let ((v1-23 (-> this nav-graph visnode-array data s3-1))) (when (and (= (-> v1-23 runtime-edge-id) arg0) (not (logtest? (-> v1-23 mysql-save-flag) (mysql-save-flag delete)))) (vector-! (the-as vector (-> s4-0 vector)) (the-as vector - (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> v1-23 runtime-node-id))) + (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> v1-23 runtime-node-id))) ) (-> s4-0 trans) ) @@ -403,10 +403,10 @@ ;; definition for method 33 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-33 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (let* ((gp-0 (-> obj nav-graph edge-array data arg0)) - (s5-0 (-> obj nav-graph node-array data (-> gp-0 runtime-node-id-1))) - (s3-0 (-> obj nav-graph node-array data (-> gp-0 runtime-node-id-2))) +(defmethod nav-graph-editor-method-33 nav-graph-editor ((this nav-graph-editor) (arg0 int)) + (let* ((gp-0 (-> this nav-graph edge-array data arg0)) + (s5-0 (-> this nav-graph node-array data (-> gp-0 runtime-node-id-1))) + (s3-0 (-> this nav-graph node-array data (-> gp-0 runtime-node-id-2))) (s4-0 (new 'stack-no-clear 'vector)) ) (vector-! s4-0 (-> s5-0 position) (-> s3-0 position)) @@ -437,7 +437,7 @@ ) ;; definition for method 31 of type nav-graph-editor -(defmethod nav-graph-editor-method-31 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) +(defmethod nav-graph-editor-method-31 nav-graph-editor ((this nav-graph-editor) (arg0 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -446,10 +446,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((gp-0 (-> obj nav-graph node-array data arg0))) + (let ((gp-0 (-> this nav-graph node-array data arg0))) (format *stdcon* "Radius = ~M~%" (-> gp-0 radius)) (cond - ((= (-> obj nav-graph nav_graph_id) 4) + ((= (-> this nav-graph nav_graph_id) 4) (add-debug-sphere #t (bucket-id debug2) (-> gp-0 position) (-> gp-0 radius) *color-green*) ) (else @@ -506,7 +506,7 @@ ;; definition for method 29 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-29 nav-graph-editor ((obj nav-graph-editor) (arg0 string) (arg1 string) (arg2 string)) +(defmethod nav-graph-editor-method-29 nav-graph-editor ((this nav-graph-editor) (arg0 string) (arg1 string) (arg2 string)) (format *stdcon* "~0K") (format *stdcon* "~3L~18S~18S~18S~%~0L" "Left button" "Middle button" "Right button") (format *stdcon* "~18S~18S~18S~%" arg0 arg1 arg2) @@ -517,7 +517,7 @@ ;; definition for method 28 of type nav-graph-editor ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-28 nav-graph-editor ((obj nav-graph-editor)) +(defmethod nav-graph-editor-method-28 nav-graph-editor ((this nav-graph-editor)) (local-vars (sv-144 int) (sv-160 (function _varargs_ object))) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -525,7 +525,7 @@ (vf6 :class vf) ) (init-vf0-vector) - (let ((gp-0 (-> obj nav-graph))) + (let ((gp-0 (-> this nav-graph))) (dotimes (s4-0 (-> gp-0 node-array length)) (let ((s2-0 (-> gp-0 node-array data s4-0))) (set! (-> s2-0 visible) #f) @@ -540,12 +540,12 @@ ) (set! (-> s2-0 cam-dist) (vector-vector-distance-squared s3-0 (camera-pos))) (let ((f0-6 (-> s2-0 cam-dist)) - (f1-0 (-> obj clipping-dist)) + (f1-0 (-> this clipping-dist)) ) (set! (-> s2-0 visible) (< f0-6 (* f1-0 f1-0))) ) - (if (or (and (-> obj vehicle-edit-mode) (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian))) - (and (not (-> obj vehicle-edit-mode)) (not (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian)))) + (if (or (and (-> this vehicle-edit-mode) (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian))) + (and (not (-> this vehicle-edit-mode)) (not (logtest? (-> s2-0 nav_node_flag) (nav-node-flag pedestrian)))) ) (set! (-> s2-0 visible) #f) ) @@ -687,7 +687,7 @@ ;; definition for method 34 of type nav-graph-editor ;; INFO: Used lq/sq -(defmethod nav-graph-editor-method-34 nav-graph-editor ((obj nav-graph-editor)) +(defmethod nav-graph-editor-method-34 nav-graph-editor ((this nav-graph-editor)) (with-pp (rlet ((acc :class vf) (vf0 :class vf) @@ -697,7 +697,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (set! (-> obj mouse-pos quad) (-> (camera-pos) quad)) + (set! (-> this mouse-pos quad) (-> (camera-pos) quad)) (let ((s5-1 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -707,12 +707,12 @@ (set! (-> s4-0 quad) (-> *up-vector* quad)) (set-vector! s1-0 (-> *mouse* posx) (-> *mouse* posy) 0.0 1.0) (cond - ((not (-> obj vehicle-edit-mode)) + ((not (-> this vehicle-edit-mode)) (set! (-> s3-0 quad) (-> (camera-matrix) vector 2 quad)) (let ((s0-0 s2-0)) - (let ((s4-2 (-> obj mouse-pos))) + (let ((s4-2 (-> this mouse-pos))) (let ((v1-8 (-> (camera-matrix) vector 2))) - (let ((a0-4 (-> obj clipping-dist))) + (let ((a0-4 (-> this clipping-dist))) (.mov vf7 a0-4) ) (.lvf vf5 (&-> v1-8 quad)) @@ -726,8 +726,8 @@ ) (reverse-transform-point! s5-1 s2-0 s3-0 s1-0) (let ((s4-3 (new 'stack 'collide-query))) - (set! (-> s4-3 start-pos quad) (-> obj mouse-pos quad)) - (vector-! (-> s4-3 move-dist) s5-1 (-> obj mouse-pos)) + (set! (-> s4-3 start-pos quad) (-> this mouse-pos quad)) + (vector-! (-> s4-3 move-dist) s5-1 (-> this mouse-pos)) (let ((v1-12 s4-3)) (set! (-> v1-12 radius) 4096.0) (set! (-> v1-12 collide-with) (collide-spec backgnd obstacle hit-by-player-list hit-by-others-list)) @@ -738,7 +738,7 @@ ) (let ((f0-6 (fill-and-probe-using-line-sphere *collide-cache* s4-3))) (when (>= f0-6 0.0) - (let ((a1-3 (-> obj mouse-hit))) + (let ((a1-3 (-> this mouse-hit))) (let ((v1-16 (-> s4-3 start-pos))) (let ((a0-16 (-> s4-3 move-dist))) (let ((a2-1 f0-6)) @@ -754,11 +754,11 @@ (.svf (&-> a1-3 quad) vf6) ) (vector+! - (-> obj mouse-hit-pick) - (-> obj mouse-hit) + (-> this mouse-hit-pick) + (-> this mouse-hit) (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-3 move-dist) 4096.0) ) - (set! (-> obj mouse-normal quad) (-> s4-3 best-other-tri normal quad)) + (set! (-> this mouse-normal quad) (-> s4-3 best-other-tri normal quad)) (dotimes (s5-3 (-> *level* length)) (let ((s4-4 (-> *level* level s5-3))) (when (= (-> s4-4 status) 'active) @@ -776,7 +776,7 @@ (let ((a0-24 (-> v1-28 nav-mesh)) (a1-6 (new 'stack-no-clear 'nav-find-poly-parms)) ) - (vector-! (-> a1-6 point) (-> obj mouse-hit) (-> a0-24 bounds)) + (vector-! (-> a1-6 point) (-> this mouse-hit) (-> a0-24 bounds)) (set! (-> a1-6 y-threshold) 40960.0) (set! (-> a1-6 ignore) (the-as uint 2)) (if (find-poly-containing-point-local a0-24 a1-6) @@ -795,8 +795,8 @@ ) ) (let ((s5-4 (new 'stack-no-clear 'vector))) - (set! (-> s5-4 quad) (-> obj mouse-hit quad)) - (let ((s4-5 (quaternion-from-two-vectors! (new 'stack-no-clear 'quaternion) *up-vector* (-> obj mouse-normal)))) + (set! (-> s5-4 quad) (-> this mouse-hit quad)) + (let ((s4-5 (quaternion-from-two-vectors! (new 'stack-no-clear 'quaternion) *up-vector* (-> this mouse-normal)))) (add-debug-vector #t (bucket-id debug2) @@ -834,20 +834,20 @@ (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj mouse-hit) - (-> obj mouse-normal) + (-> this mouse-hit) + (-> this mouse-normal) (meters 5) *color-red* ) ) - ((and (-> obj next-state) (= (-> obj next-state name) 'move-plane)) + ((and (-> this next-state) (= (-> this next-state name) 'move-plane)) (vector-cross! s3-0 *up-vector* (the-as vector (-> (camera-matrix) vector))) (vector-normalize! s3-0 1.0) - (set! (-> s2-0 quad) (-> obj mouse-hit quad)) + (set! (-> s2-0 quad) (-> this mouse-hit quad)) (reverse-transform-point! s5-1 s2-0 s3-0 s1-0) - (set! (-> obj plane-height) (-> s5-1 y)) + (set! (-> this plane-height) (-> s5-1 y)) (let ((s5-5 (new 'stack-no-clear 'vector))) - (set-vector! s5-5 (-> obj mouse-hit x) (-> obj plane-height) (-> obj mouse-hit z) 1.0) + (set-vector! s5-5 (-> this mouse-hit x) (-> this plane-height) (-> this mouse-hit z) 1.0) (add-debug-vector #t (bucket-id debug2) @@ -910,8 +910,8 @@ ) (else (set! (-> s3-0 quad) (-> *up-vector* quad)) - (set! (-> s2-0 quad) (-> obj mouse-pos quad)) - (set! (-> s2-0 y) (-> obj plane-height)) + (set! (-> s2-0 quad) (-> this mouse-pos quad)) + (set! (-> s2-0 y) (-> this plane-height)) (reverse-transform-point! s5-1 s2-0 s3-0 s1-0) (set! (-> s4-0 quad) (-> s3-0 quad)) (let ((v1-57 (new 'stack-no-clear 'matrix))) @@ -924,7 +924,7 @@ (vector+! (-> v1-57 trans) s5-1 (new 'static 'vector :x -8192.0 :z 8192.0 :w 1.0)) ) (let ((f30-0 50.0)) - (if (= (-> obj nav-graph nav_graph_id) 2) + (if (= (-> this nav-graph nav_graph_id) 2) (set! f30-0 4.0) ) (add-debug-vector @@ -976,9 +976,9 @@ *color-green* ) ) - (set! (-> obj mouse-hit quad) (-> s5-1 quad)) - (set! (-> obj mouse-hit-pick quad) (-> s5-1 quad)) - (let ((v0-19 (the-as object (-> obj mouse-normal)))) + (set! (-> this mouse-hit quad) (-> s5-1 quad)) + (set! (-> this mouse-hit-pick quad) (-> s5-1 quad)) + (let ((v0-19 (the-as object (-> this mouse-normal)))) (set! (-> (the-as vector v0-19) quad) (-> s4-0 quad)) v0-19 ) @@ -991,15 +991,15 @@ ;; definition for method 41 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-41 nav-graph-editor ((obj nav-graph-editor)) - (set! (-> obj selected-index) -1) +(defmethod nav-graph-editor-method-41 nav-graph-editor ((this nav-graph-editor)) + (set! (-> this selected-index) -1) (none) ) ;; definition for method 42 of type nav-graph-editor ;; INFO: Used lq/sq -(defmethod nav-graph-editor-method-42 nav-graph-editor ((obj nav-graph-editor)) - (let ((s5-0 (-> obj nav-graph))) +(defmethod nav-graph-editor-method-42 nav-graph-editor ((this nav-graph-editor)) + (let ((s5-0 (-> this nav-graph))) (dotimes (s4-0 (-> s5-0 node-array length)) (let ((s3-0 (-> s5-0 node-array data s4-0))) (when (and (-> s3-0 visible) @@ -1013,17 +1013,17 @@ (set! (-> v1-9 quad) (-> a0-4 quad)) (set! (-> v1-9 w) 11468.8) (when (< 0.0 (ray-sphere-intersect - (-> obj mouse-pos) - (vector-! (new 'stack-no-clear 'vector) (-> obj mouse-hit-pick) (-> obj mouse-pos)) + (-> this mouse-pos) + (vector-! (new 'stack-no-clear 'vector) (-> this mouse-hit-pick) (-> this mouse-pos)) v1-9 (-> v1-9 w) ) ) (let ((f0-8 (+ -8192.0 (-> s3-0 cam-dist)))) - (when (or (= (-> obj selected-index) -1) (< f0-8 (-> obj selected-dist))) - (set! (-> obj selected-index) s4-0) - (set! (-> obj selected-dist) f0-8) - (set! (-> obj selected-node-edge?) #t) + (when (or (= (-> this selected-index) -1) (< f0-8 (-> this selected-dist))) + (set! (-> this selected-index) s4-0) + (set! (-> this selected-dist) f0-8) + (set! (-> this selected-node-edge?) #t) ) ) ) @@ -1036,20 +1036,20 @@ ) ;; definition for method 44 of type nav-graph-editor -(defmethod nav-graph-editor-method-44 nav-graph-editor ((obj nav-graph-editor)) - (set! (-> obj closest-node) -1) - (set! (-> obj dist-closest-node) 0.0) - (let ((s5-0 (-> obj nav-graph))) +(defmethod nav-graph-editor-method-44 nav-graph-editor ((this nav-graph-editor)) + (set! (-> this closest-node) -1) + (set! (-> this dist-closest-node) 0.0) + (let ((s5-0 (-> this nav-graph))) (dotimes (s4-0 (-> s5-0 node-array length)) (let ((v1-4 (-> s5-0 node-array data s4-0))) (when (and (-> v1-4 visible) (not (logtest? (-> v1-4 nav_node_flag) (nav-node-flag hidden))) (not (logtest? (-> v1-4 mysql-save-flag) (mysql-save-flag delete))) ) - (let ((f0-1 (vector-vector-distance (-> v1-4 position) (-> obj mouse-hit)))) - (when (or (< (-> obj closest-node) 0) (< f0-1 (-> obj dist-closest-node))) - (set! (-> obj closest-node) s4-0) - (set! (-> obj dist-closest-node) f0-1) + (let ((f0-1 (vector-vector-distance (-> v1-4 position) (-> this mouse-hit)))) + (when (or (< (-> this closest-node) 0) (< f0-1 (-> this dist-closest-node))) + (set! (-> this closest-node) s4-0) + (set! (-> this dist-closest-node) f0-1) ) ) ) @@ -1061,10 +1061,10 @@ ;; definition for method 45 of type nav-graph-editor ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-45 nav-graph-editor ((obj nav-graph-editor)) - (set! (-> obj closest-edge) -1) - (set! (-> obj dist-closest-edge) 0.0) - (let ((s5-0 (-> obj nav-graph))) +(defmethod nav-graph-editor-method-45 nav-graph-editor ((this nav-graph-editor)) + (set! (-> this closest-edge) -1) + (set! (-> this dist-closest-edge) 0.0) + (let ((s5-0 (-> this nav-graph))) 0.0 (dotimes (s4-0 (-> s5-0 edge-array length)) (let ((a0-2 (-> s5-0 edge-array data s4-0))) @@ -1079,10 +1079,10 @@ (-> v1-9 visible) (-> a1-5 visible) ) - (let ((f0-2 (vector-segment-distance-point! (-> obj mouse-hit) (-> a1-5 position) (-> v1-9 position) a3-0))) - (when (or (< (-> obj closest-edge) 0) (< f0-2 (-> obj dist-closest-edge))) - (set! (-> obj closest-edge) s4-0) - (set! (-> obj dist-closest-edge) f0-2) + (let ((f0-2 (vector-segment-distance-point! (-> this mouse-hit) (-> a1-5 position) (-> v1-9 position) a3-0))) + (when (or (< (-> this closest-edge) 0) (< f0-2 (-> this dist-closest-edge))) + (set! (-> this closest-edge) s4-0) + (set! (-> this dist-closest-edge) f0-2) ) ) ) @@ -1098,7 +1098,7 @@ ;; definition for method 43 of type nav-graph-editor ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod nav-graph-editor-method-43 nav-graph-editor ((obj nav-graph-editor)) +(defmethod nav-graph-editor-method-43 nav-graph-editor ((this nav-graph-editor)) (local-vars (sv-128 vector) (sv-144 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1106,7 +1106,7 @@ (vf6 :class vf) ) (init-vf0-vector) - (let ((s5-0 (-> obj nav-graph))) + (let ((s5-0 (-> this nav-graph))) (dotimes (s4-0 (-> s5-0 edge-array length)) (let ((a0-2 (-> s5-0 edge-array data s4-0))) (when (not (logtest? (-> a0-2 mysql-save-flag) (mysql-save-flag delete))) @@ -1134,10 +1134,10 @@ (let ((f30-0 0.0) (s0-1 ray-cylinder-intersect) ) - (set! sv-128 (-> obj mouse-pos)) + (set! sv-128 (-> this mouse-pos)) (set! sv-144 (new 'stack-no-clear 'vector)) - (let ((v1-18 (-> obj mouse-hit-pick)) - (a0-13 (-> obj mouse-pos)) + (let ((v1-18 (-> this mouse-hit-pick)) + (a0-13 (-> this mouse-pos)) ) (.lvf vf4 (&-> v1-18 quad)) (.lvf vf5 (&-> a0-13 quad)) @@ -1151,11 +1151,11 @@ (t2-0 s3-0) ) (when (< f30-0 (s0-1 sv-128 sv-144 s1-0 a3-3 t0-0 t1-0 t2-0)) - (let ((f0-1 (vector-vector-distance s3-0 (-> obj mouse-pos)))) - (when (or (= (-> obj selected-index) -1) (< f0-1 (-> obj selected-dist))) - (set! (-> obj selected-index) s4-0) - (set! (-> obj selected-dist) f0-1) - (set! (-> obj selected-node-edge?) #f) + (let ((f0-1 (vector-vector-distance s3-0 (-> this mouse-pos)))) + (when (or (= (-> this selected-index) -1) (< f0-1 (-> this selected-dist))) + (set! (-> this selected-index) s4-0) + (set! (-> this selected-dist) f0-1) + (set! (-> this selected-node-edge?) #f) ) ) ) @@ -1174,14 +1174,14 @@ ;; definition for method 32 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-32 nav-graph-editor ((obj nav-graph-editor) (arg0 symbol) (arg1 int)) +(defmethod nav-graph-editor-method-32 nav-graph-editor ((this nav-graph-editor) (arg0 symbol) (arg1 int)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) (vf6 :class vf) ) (init-vf0-vector) - (let ((v1-0 (-> obj nav-graph))) + (let ((v1-0 (-> this nav-graph))) (when (>= arg1 0) (cond (arg0 @@ -1245,51 +1245,51 @@ ;; definition for method 47 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-47 nav-graph-editor ((obj nav-graph-editor)) - (+! (-> obj command-id) 1) - (-> obj command-id) +(defmethod nav-graph-editor-method-47 nav-graph-editor ((this nav-graph-editor)) + (+! (-> this command-id) 1) + (-> this command-id) (none) ) ;; definition for method 48 of type nav-graph-editor -(defmethod nav-graph-editor-method-48 nav-graph-editor ((obj nav-graph-editor) (arg0 uint)) +(defmethod nav-graph-editor-method-48 nav-graph-editor ((this nav-graph-editor) (arg0 uint)) "TODO - enum / com-type" - (let* ((v1-1 (-> obj command-array length)) - (v0-0 (-> obj command-array data v1-1)) + (let* ((v1-1 (-> this command-array length)) + (v0-0 (-> this command-array data v1-1)) ) - (+! (-> obj command-array length) 1) - (set! (-> obj max-command) v1-1) + (+! (-> this command-array length) 1) + (set! (-> this max-command) v1-1) (set! (-> v0-0 com-type) arg0) - (set! (-> v0-0 id) (-> obj command-id)) + (set! (-> v0-0 id) (-> this command-id)) v0-0 ) ) ;; definition for method 49 of type nav-graph-editor -(defmethod nav-graph-editor-method-49 nav-graph-editor ((obj nav-graph-editor)) - (-> obj command-array data (+ (-> obj command-array length) -1)) +(defmethod nav-graph-editor-method-49 nav-graph-editor ((this nav-graph-editor)) + (-> this command-array data (+ (-> this command-array length) -1)) ) ;; definition for method 50 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-50 nav-graph-editor ((obj nav-graph-editor)) - (+! (-> obj command-array length) -1) - (set! (-> obj max-command) (-> obj command-array length)) +(defmethod nav-graph-editor-method-50 nav-graph-editor ((this nav-graph-editor)) + (+! (-> this command-array length) -1) + (set! (-> this max-command) (-> this command-array length)) (none) ) ;; definition for method 58 of type nav-graph-editor ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-graph-editor-method-58 nav-graph-editor ((obj nav-graph-editor)) - (if (zero? (-> obj command-array length)) +(defmethod nav-graph-editor-method-58 nav-graph-editor ((this nav-graph-editor)) + (if (zero? (-> this command-array length)) (return #f) ) - (let ((s5-0 (-> obj command-array data (+ (-> obj command-array length) -1) id))) + (let ((s5-0 (-> this command-array data (+ (-> this command-array length) -1) id))) (until #f - (if (zero? (-> obj command-array length)) + (if (zero? (-> this command-array length)) (return #t) ) - (let ((s4-0 (-> obj command-array data (+ (-> obj command-array length) -1)))) + (let ((s4-0 (-> this command-array data (+ (-> this command-array length) -1)))) (if (!= s5-0 (-> s4-0 id)) (return #t) ) @@ -1298,40 +1298,40 @@ ((zero? v1-20) (format #t "Undo move-node ~D~%" (-> s4-0 id)) (vector-! - (the-as vector (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> s4-0 index)))) - (the-as vector (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> s4-0 index)))) + (the-as vector (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> s4-0 index)))) + (the-as vector (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> s4-0 index)))) (-> s4-0 move-vec) ) - (nav-graph-editor-method-54 obj (-> s4-0 index)) + (nav-graph-editor-method-54 this (-> s4-0 index)) ) ((= v1-20 1) (format #t "Undo delete-edge ~D~%" (-> s4-0 id)) - (logclear! (-> obj nav-graph edge-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logclear! (-> this nav-graph edge-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ((= v1-20 2) (format #t "Undo delete-node ~D~%" (-> s4-0 id)) - (logclear! (-> obj nav-graph node-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logclear! (-> this nav-graph node-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ((= v1-20 5) (format #t "Undo delete-visnode ~D~%" (-> s4-0 id)) - (logclear! (-> obj nav-graph visnode-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logclear! (-> this nav-graph visnode-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ((= v1-20 3) (format #t "Undo new-node ~D~%" (-> s4-0 id)) - (logior! (-> obj nav-graph node-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logior! (-> this nav-graph node-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ((= v1-20 6) (format #t "Undo new-visnode ~D~%" (-> s4-0 id)) - (logior! (-> obj nav-graph visnode-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logior! (-> this nav-graph visnode-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ((= v1-20 4) (format #t "Undo new-edge ~D~%" (-> s4-0 id)) - (logior! (-> obj nav-graph edge-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) + (logior! (-> this nav-graph edge-array data (-> s4-0 index) mysql-save-flag) (mysql-save-flag delete)) ) ) ) ) - (+! (-> obj command-array length) -1) + (+! (-> this command-array length) -1) ) ) #f @@ -1340,20 +1340,20 @@ ;; definition for method 51 of type nav-graph-editor ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-51 nav-graph-editor ((obj nav-graph-editor)) - (let ((gp-0 (alloc-new-node! (-> obj nav-graph)))) +(defmethod nav-graph-editor-method-51 nav-graph-editor ((this nav-graph-editor)) + (let ((gp-0 (alloc-new-node! (-> this nav-graph)))) (when (!= gp-0 -1) - (let ((v1-6 (-> obj nav-graph node-array data gp-0)) - (a0-4 (-> obj default-node)) + (let ((v1-6 (-> this nav-graph node-array data gp-0)) + (a0-4 (-> this default-node)) ) - (set! (-> v1-6 position quad) (-> obj mouse-hit quad)) + (set! (-> v1-6 position quad) (-> this mouse-hit quad)) (set! (-> v1-6 angle) (-> a0-4 angle)) (set! (-> v1-6 radius) (-> a0-4 radius)) (set! (-> v1-6 nav_mesh_id) (-> a0-4 nav_mesh_id)) (set! (-> v1-6 nav_node_flag) (-> a0-4 nav_node_flag)) ) - (nav-graph-editor-method-54 obj gp-0) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 3)) index) gp-0) + (nav-graph-editor-method-54 this gp-0) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 3)) index) gp-0) ) ) (none) @@ -1361,14 +1361,14 @@ ;; definition for method 53 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-53 nav-graph-editor ((obj nav-graph-editor) (arg0 int) (arg1 int)) - (let ((s5-0 (indexof-visnode (-> obj nav-graph) arg0 arg1))) +(defmethod nav-graph-editor-method-53 nav-graph-editor ((this nav-graph-editor) (arg0 int) (arg1 int)) + (let ((s5-0 (indexof-visnode (-> this nav-graph) arg0 arg1))) (if (= s5-0 -1) - (set! s5-0 (alloc-new-visnode! (-> obj nav-graph) arg0 arg1)) + (set! s5-0 (alloc-new-visnode! (-> this nav-graph) arg0 arg1)) ) (when (!= s5-0 -1) - (logclear! (-> obj nav-graph visnode-array data s5-0 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 6)) index) s5-0) + (logclear! (-> this nav-graph visnode-array data s5-0 mysql-save-flag) (mysql-save-flag delete)) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 6)) index) s5-0) ) ) (none) @@ -1376,14 +1376,14 @@ ;; definition for method 52 of type nav-graph-editor ;; WARN: Return type mismatch int vs uint. -(defmethod nav-graph-editor-method-52 nav-graph-editor ((obj nav-graph-editor)) - (let ((gp-0 (alloc-new-edge! (-> obj nav-graph)))) +(defmethod nav-graph-editor-method-52 nav-graph-editor ((this nav-graph-editor)) + (let ((gp-0 (alloc-new-edge! (-> this nav-graph)))) (when (!= gp-0 -1) - (let ((v1-6 (-> obj nav-graph edge-array data gp-0)) - (a0-4 (-> obj default-edge)) + (let ((v1-6 (-> this nav-graph edge-array data gp-0)) + (a0-4 (-> this default-edge)) ) - (set! (-> v1-6 runtime-node-id-1) (-> obj edge-src)) - (set! (-> v1-6 runtime-node-id-2) (-> obj edge-dst)) + (set! (-> v1-6 runtime-node-id-1) (-> this edge-src)) + (set! (-> v1-6 runtime-node-id-2) (-> this edge-dst)) (set! (-> v1-6 directionality) (nav-directionality bi_directional)) (set! (-> v1-6 speed_limit) (-> a0-4 speed_limit)) (set! (-> v1-6 density) (-> a0-4 density)) @@ -1393,24 +1393,24 @@ (set! (-> v1-6 width) (-> a0-4 width)) (set! (-> v1-6 minimap_edge_flag) (-> a0-4 minimap_edge_flag)) ) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 4)) index) gp-0) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 4)) index) gp-0) ) (the-as uint gp-0) ) ) ;; definition for method 57 of type nav-graph-editor -(defmethod nav-graph-editor-method-57 nav-graph-editor ((obj nav-graph-editor) (arg0 int) (arg1 int)) - (case (indexof-visnode (-> obj nav-graph) arg0 arg1) +(defmethod nav-graph-editor-method-57 nav-graph-editor ((this nav-graph-editor) (arg0 int) (arg1 int)) + (case (indexof-visnode (-> this nav-graph) arg0 arg1) ((-1) (return (the-as int #f)) ) ) - (let ((s5-1 (alloc-new-visnode! (-> obj nav-graph) arg0 arg1))) + (let ((s5-1 (alloc-new-visnode! (-> this nav-graph) arg0 arg1))) (when (!= s5-1 -1) - (nav-graph-editor-method-47 obj) - (logior! (-> obj nav-graph visnode-array data s5-1 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 5)) index) s5-1) + (nav-graph-editor-method-47 this) + (logior! (-> this nav-graph visnode-array data s5-1 mysql-save-flag) (mysql-save-flag delete)) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 5)) index) s5-1) ) ) 0 @@ -1418,28 +1418,28 @@ ;; definition for method 55 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-55 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (nav-graph-editor-method-47 obj) - (let ((s5-0 (-> obj nav-graph node-array data arg0))) +(defmethod nav-graph-editor-method-55 nav-graph-editor ((this nav-graph-editor) (arg0 int)) + (nav-graph-editor-method-47 this) + (let ((s5-0 (-> this nav-graph node-array data arg0))) (logior! (-> s5-0 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 2)) index) arg0) - (dotimes (s3-0 (-> obj nav-graph edge-array length)) - (let ((v1-13 (-> obj nav-graph edge-array data s3-0))) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 2)) index) arg0) + (dotimes (s3-0 (-> this nav-graph edge-array length)) + (let ((v1-13 (-> this nav-graph edge-array data s3-0))) (when (and (not (logtest? (-> v1-13 mysql-save-flag) (mysql-save-flag delete))) (or (= (-> v1-13 runtime-node-id-1) arg0) (= (-> v1-13 runtime-node-id-2) arg0)) ) (logior! (-> v1-13 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 1)) index) s3-0) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 1)) index) s3-0) ) ) ) - (dotimes (s4-1 (-> obj nav-graph visnode-array length)) - (let ((v1-23 (-> obj nav-graph visnode-array data s4-1))) + (dotimes (s4-1 (-> this nav-graph visnode-array length)) + (let ((v1-23 (-> this nav-graph visnode-array data s4-1))) (when (and (not (logtest? (-> v1-23 mysql-save-flag) (mysql-save-flag delete))) (= (-> v1-23 runtime-node-id) (-> s5-0 runtime-id)) ) (logior! (-> v1-23 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 5)) index) s4-1) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 5)) index) s4-1) ) ) ) @@ -1450,18 +1450,18 @@ ;; definition for method 56 of type nav-graph-editor ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-editor-method-56 nav-graph-editor ((obj nav-graph-editor) (arg0 int)) - (nav-graph-editor-method-47 obj) - (let ((s5-0 (-> obj nav-graph edge-array data arg0))) +(defmethod nav-graph-editor-method-56 nav-graph-editor ((this nav-graph-editor) (arg0 int)) + (nav-graph-editor-method-47 this) + (let ((s5-0 (-> this nav-graph edge-array data arg0))) (logior! (-> s5-0 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 1)) index) arg0) - (dotimes (s4-1 (-> obj nav-graph visnode-array length)) - (let ((v1-11 (-> obj nav-graph visnode-array data s4-1))) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 1)) index) arg0) + (dotimes (s4-1 (-> this nav-graph visnode-array length)) + (let ((v1-11 (-> this nav-graph visnode-array data s4-1))) (when (and (not (logtest? (-> v1-11 mysql-save-flag) (mysql-save-flag delete))) (= (-> v1-11 runtime-edge-id) (-> s5-0 runtime-id)) ) (logior! (-> v1-11 mysql-save-flag) (mysql-save-flag delete)) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 5)) index) s4-1) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 5)) index) s4-1) ) ) ) @@ -1473,8 +1473,8 @@ ) (v1-19 #f) ) - (dotimes (a0-16 (-> obj nav-graph edge-array length)) - (let ((a1-7 (-> obj nav-graph edge-array data a0-16))) + (dotimes (a0-16 (-> this nav-graph edge-array length)) + (let ((a1-7 (-> this nav-graph edge-array data a0-16))) (if (and (not (logtest? (-> a1-7 mysql-save-flag) (mysql-save-flag delete))) (or (= (-> a1-7 runtime-node-id-1) s3-0) (= (-> a1-7 runtime-node-id-2) s3-0)) ) @@ -1483,10 +1483,10 @@ ) ) (when (not v1-19) - (let ((v1-24 (-> obj nav-graph node-array data s3-0))) + (let ((v1-24 (-> this nav-graph node-array data s3-0))) (logior! (-> v1-24 mysql-save-flag) (mysql-save-flag delete)) ) - (set! (-> (nav-graph-editor-method-48 obj (the-as uint 2)) index) s3-0) + (set! (-> (nav-graph-editor-method-48 this (the-as uint 2)) index) s3-0) ) ) ) @@ -1496,9 +1496,9 @@ ) ;; definition for method 59 of type nav-graph-editor -(defmethod nav-graph-editor-method-59 nav-graph-editor ((obj nav-graph-editor)) +(defmethod nav-graph-editor-method-59 nav-graph-editor ((this nav-graph-editor)) (if (cpad-pressed? 0 triangle) - (nav-graph-editor-method-58 obj) + (nav-graph-editor-method-58 this) ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (let ((v0-1 (logclear (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)))) @@ -1508,18 +1508,18 @@ ) ;; definition for method 46 of type nav-graph-editor -(defmethod nav-graph-editor-method-46 nav-graph-editor ((obj nav-graph-editor)) +(defmethod nav-graph-editor-method-46 nav-graph-editor ((this nav-graph-editor)) (if (cpad-pressed? 0 up) - (go (method-of-object obj create)) + (go (method-of-object this create)) ) (if (cpad-pressed? 0 down) - (go (method-of-object obj adjust-it)) + (go (method-of-object this adjust-it)) ) (if (cpad-pressed? 0 left) - (go (method-of-object obj adjust-minimap)) + (go (method-of-object this adjust-minimap)) ) (if (cpad-pressed? 0 right) - (go (method-of-object obj adjust-plane)) + (go (method-of-object this adjust-plane)) ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons up)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up)) @@ -1537,23 +1537,26 @@ ;; definition for method 35 of type nav-graph-editor ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-35 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) +(defmethod nav-graph-editor-method-35 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) (cond ((not (mouse-hold? left)) - (let ((a0-4 (nav-graph-editor-method-49 obj))) + (let ((a0-4 (nav-graph-editor-method-49 this))) (vector-! (-> a0-4 move-vec) - (the-as vector (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> obj selected-index)))) + (the-as + vector + (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> this selected-index))) + ) (-> a0-4 move-vec) ) ) - (go (method-of-object obj create)) + (go (method-of-object this create)) ) (else - (set! (-> obj nav-graph node-array data (-> obj selected-index) position quad) (-> obj mouse-hit quad)) - (nav-graph-editor-method-54 obj (-> obj selected-index)) + (set! (-> this nav-graph node-array data (-> this selected-index) position quad) (-> this mouse-hit quad)) + (nav-graph-editor-method-54 this (-> this selected-index)) ) ) (none) @@ -1642,22 +1645,22 @@ ;; definition for method 38 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-38 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-41 obj) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-42 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) +(defmethod nav-graph-editor-method-38 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-41 this) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-42 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) (add-debug-line-sphere #t (bucket-id debug2) - (the-as vector (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> obj edge-src)))) + (the-as vector (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> this edge-src)))) (vector-! (new 'stack-no-clear 'vector) - (-> obj mouse-hit) - (the-as vector (+ (the-as uint (-> obj nav-graph node-array data 0 position)) (* 80 (-> obj edge-src)))) + (-> this mouse-hit) + (the-as vector (+ (the-as uint (-> this nav-graph node-array data 0 position)) (* 80 (-> this edge-src)))) ) 1024.0 - (if (>= (-> obj selected-index) 0) + (if (>= (-> this selected-index) 0) *color-green* *color-red* ) @@ -1667,34 +1670,34 @@ (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (let ((v1-20 (logclear (-> *mouse* button0-rel 0) (mouse-buttons left)))) (set! (-> *mouse* button0-rel 0) v1-20) - (and v1-20 (!= (-> obj selected-index) (-> obj edge-src))) + (and v1-20 (!= (-> this selected-index) (-> this edge-src))) ) ) ) (cond - ((>= (-> obj selected-index) 0) - (set! (-> obj edge-dst) (-> obj selected-index)) + ((>= (-> this selected-index) 0) + (set! (-> this edge-dst) (-> this selected-index)) ) (else - (set! (-> obj edge-dst) (the-as int (nav-graph-editor-method-51 obj))) - (if (= (-> obj edge-dst) -1) - (go (method-of-object obj create)) + (set! (-> this edge-dst) (the-as int (nav-graph-editor-method-51 this))) + (if (= (-> this edge-dst) -1) + (go (method-of-object this create)) ) ) ) - (if (= (nav-graph-editor-method-52 obj) -1) - (go (method-of-object obj create)) + (if (= (nav-graph-editor-method-52 this) -1) + (go (method-of-object this create)) ) - (nav-graph-editor-method-47 obj) - (set! (-> obj edge-src) (-> obj edge-dst)) + (nav-graph-editor-method-47 this) + (set! (-> this edge-src) (-> this edge-dst)) ) ((mouse-pressed? right) - (if (= (-> obj edge-dst) -2) - (nav-graph-editor-method-58 obj) + (if (= (-> this edge-dst) -2) + (nav-graph-editor-method-58 this) ) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) - (go (method-of-object obj create)) + (go (method-of-object this create)) ) ) (none) @@ -1729,23 +1732,23 @@ ;; definition for method 37 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-37 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-41 obj) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-42 obj) - (nav-graph-editor-method-43 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) +(defmethod nav-graph-editor-method-37 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-41 this) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-42 this) + (nav-graph-editor-method-43 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) (cond ((mouse-pressed? left) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) - (go (method-of-object obj create-edge)) + (go (method-of-object this create-edge)) ) - ((and (mouse-pressed? right) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?))) + ((and (mouse-pressed? right) (>= (-> this selected-index) 0) (not (-> this selected-node-edge?))) ) (else - (nav-graph-editor-method-59 obj) - (nav-graph-editor-method-46 obj) + (nav-graph-editor-method-59 this) + (nav-graph-editor-method-46 this) ) ) (none) @@ -1919,36 +1922,36 @@ ;; definition for method 39 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-39 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-41 obj) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-42 obj) - (nav-graph-editor-method-43 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) - (when (>= (-> obj selected-index) 0) - (if (-> obj selected-node-edge?) - (nav-graph-editor-method-31 obj (-> obj selected-index)) - (nav-graph-editor-method-30 obj (-> obj selected-index)) +(defmethod nav-graph-editor-method-39 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-41 this) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-42 this) + (nav-graph-editor-method-43 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) + (when (>= (-> this selected-index) 0) + (if (-> this selected-node-edge?) + (nav-graph-editor-method-31 this (-> this selected-index)) + (nav-graph-editor-method-30 this (-> this selected-index)) ) ) (cond - ((and (mouse-hold? left) (>= (-> obj selected-index) 0)) - (if (-> obj selected-node-edge?) - (go (method-of-object obj adjust-node-angle)) + ((and (mouse-hold? left) (>= (-> this selected-index) 0)) + (if (-> this selected-node-edge?) + (go (method-of-object this adjust-node-angle)) ) ) - ((and (mouse-hold? right) (>= (-> obj selected-index) 0)) - (if (-> obj selected-node-edge?) - (go (method-of-object obj adjust-node-radius)) - (go (method-of-object obj adjust-edge-width)) + ((and (mouse-hold? right) (>= (-> this selected-index) 0)) + (if (-> this selected-node-edge?) + (go (method-of-object this adjust-node-radius)) + (go (method-of-object this adjust-edge-width)) ) ) - ((and (mouse-hold? middle) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?))) - (go (method-of-object obj adjust-edge-density)) + ((and (mouse-hold? middle) (>= (-> this selected-index) 0) (not (-> this selected-node-edge?))) + (go (method-of-object this adjust-edge-density)) ) (else - (nav-graph-editor-method-59 obj) - (nav-graph-editor-method-46 obj) + (nav-graph-editor-method-59 this) + (nav-graph-editor-method-46 this) ) ) (none) @@ -1980,28 +1983,28 @@ ;; definition for method 40 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-40 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-41 obj) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-43 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) - (if (and (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?))) - (nav-graph-editor-method-30 obj (-> obj selected-index)) +(defmethod nav-graph-editor-method-40 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-41 this) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-43 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) + (if (and (>= (-> this selected-index) 0) (not (-> this selected-node-edge?))) + (nav-graph-editor-method-30 this (-> this selected-index)) ) (cond - ((and (mouse-hold? left) (>= (-> obj selected-index) 0)) + ((and (mouse-hold? left) (>= (-> this selected-index) 0)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) - (go (method-of-object obj adjust-edge-visibility)) + (go (method-of-object this adjust-edge-visibility)) ) ((mouse-hold? right) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) - (go (method-of-object obj draw-closest-minimap)) + (go (method-of-object this draw-closest-minimap)) ) (else - (nav-graph-editor-method-59 obj) - (nav-graph-editor-method-46 obj) + (nav-graph-editor-method-59 this) + (nav-graph-editor-method-46 this) ) ) (none) @@ -2081,34 +2084,34 @@ ;; definition for method 36 of type nav-graph-editor ;; WARN: Return type mismatch object vs none. -(defmethod nav-graph-editor-method-36 nav-graph-editor ((obj nav-graph-editor)) - (nav-graph-editor-method-41 obj) - (nav-graph-editor-method-34 obj) - (nav-graph-editor-method-42 obj) - (nav-graph-editor-method-43 obj) - (nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index)) +(defmethod nav-graph-editor-method-36 nav-graph-editor ((this nav-graph-editor)) + (nav-graph-editor-method-41 this) + (nav-graph-editor-method-34 this) + (nav-graph-editor-method-42 this) + (nav-graph-editor-method-43 this) + (nav-graph-editor-method-32 this (-> this selected-node-edge?) (-> this selected-index)) (cond - ((and (mouse-hold? left) (>= (-> obj selected-index) 0) (-> obj selected-node-edge?)) + ((and (mouse-hold? left) (>= (-> this selected-index) 0) (-> this selected-node-edge?)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons left)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons left)) - (go (method-of-object obj move-node)) + (go (method-of-object this move-node)) ) ((mouse-hold? right) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons right)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons right)) - (go (method-of-object obj create-edge)) + (go (method-of-object this create-edge)) ) - ((and (mouse-hold? middle) (>= (-> obj selected-index) 0)) + ((and (mouse-hold? middle) (>= (-> this selected-index) 0)) (logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle)) (logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle)) - (if (-> obj selected-node-edge?) - (nav-graph-editor-method-55 obj (-> obj selected-index)) - (nav-graph-editor-method-56 obj (-> obj selected-index)) + (if (-> this selected-node-edge?) + (nav-graph-editor-method-55 this (-> this selected-index)) + (nav-graph-editor-method-56 this (-> this selected-index)) ) ) (else - (nav-graph-editor-method-59 obj) - (nav-graph-editor-method-46 obj) + (nav-graph-editor-method-59 this) + (nav-graph-editor-method-46 this) ) ) (none) diff --git a/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc b/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc index db44f8da93..9e46c857b9 100644 --- a/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/part-tester_REF.gc @@ -29,30 +29,30 @@ ) ;; definition for method 3 of type part-tester -(defmethod inspect part-tester ((obj part-tester)) - (when (not obj) - (set! obj obj) +(defmethod inspect part-tester ((this part-tester)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Troot: ~A~%" (-> obj root)) - (format #t "~2Tpart: ~A~%" (-> obj part)) - (format #t "~2Told-group: ~A~%" (-> obj old-group)) + (format #t "~2Troot: ~A~%" (-> this root)) + (format #t "~2Tpart: ~A~%" (-> this part)) + (format #t "~2Told-group: ~A~%" (-> this old-group)) (label cfg-4) - obj + this ) ;; definition for symbol *part-tester-name*, type string (define *part-tester-name* (the-as string #f)) ;; definition for method 10 of type part-tester -(defmethod deactivate part-tester ((obj part-tester)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate part-tester ((this part-tester)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) diff --git a/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc index 55e4c281d1..7b85f58773 100644 --- a/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc @@ -1,5 +1,7 @@ +;;-*-Lisp-*- (in-package goal) +;; definition of type tr-stat (deftype tr-stat (structure) ((groups uint16 :offset-assert 0) (fragments uint16 :offset-assert 2) @@ -13,22 +15,24 @@ :flag-assert #x900000010 ) -(defmethod inspect tr-stat ((obj tr-stat)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type tr-stat +(defmethod inspect tr-stat ((this tr-stat)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tr-stat) - (format #t "~1Tgroups: ~D~%" (-> obj groups)) - (format #t "~1Tfragments: ~D~%" (-> obj fragments)) - (format #t "~1Ttris: ~D~%" (-> obj tris)) - (format #t "~1Tdverts: ~D~%" (-> obj dverts)) - (format #t "~1Tinstances: ~D~%" (-> obj instances)) - (format #t "~1Tpad: ~D~%" (-> obj pad)) + (format #t "[~8x] ~A~%" this 'tr-stat) + (format #t "~1Tgroups: ~D~%" (-> this groups)) + (format #t "~1Tfragments: ~D~%" (-> this fragments)) + (format #t "~1Ttris: ~D~%" (-> this tris)) + (format #t "~1Tdverts: ~D~%" (-> this dverts)) + (format #t "~1Tinstances: ~D~%" (-> this instances)) + (format #t "~1Tpad: ~D~%" (-> this pad)) (label cfg-4) - obj + this ) +;; definition of type merc-global-stats (deftype merc-global-stats (structure) ((merc tr-stat :inline :offset-assert 0) (emerc tr-stat :inline :offset-assert 16) @@ -39,19 +43,21 @@ :flag-assert #x900000030 ) -(defmethod inspect merc-global-stats ((obj merc-global-stats)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type merc-global-stats +(defmethod inspect merc-global-stats ((this merc-global-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-global-stats) - (format #t "~1Tmerc: #~%" (-> obj merc)) - (format #t "~1Temerc: #~%" (-> obj emerc)) - (format #t "~1Tmercneric: #~%" (-> obj mercneric)) + (format #t "[~8x] ~A~%" this 'merc-global-stats) + (format #t "~1Tmerc: #~%" (-> this merc)) + (format #t "~1Temerc: #~%" (-> this emerc)) + (format #t "~1Tmercneric: #~%" (-> this mercneric)) (label cfg-4) - obj + this ) +;; definition of type perf-stat (deftype perf-stat (structure) ((frame-number uint32 :offset-assert 0) (count uint32 :offset-assert 4) @@ -80,29 +86,31 @@ ) ) -(defmethod inspect perf-stat ((obj perf-stat)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type perf-stat +(defmethod inspect perf-stat ((this perf-stat)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'perf-stat) - (format #t "~1Tframe-number: ~D~%" (-> obj frame-number)) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tcycles: ~D~%" (-> obj cycles)) - (format #t "~1Tinstructions: ~D~%" (-> obj instructions)) - (format #t "~1Ticache: ~D~%" (-> obj icache)) - (format #t "~1Tdcache: ~D~%" (-> obj dcache)) - (format #t "~1Tselect: ~D~%" (-> obj select)) - (format #t "~1Tctrl: ~D~%" (-> obj ctrl)) - (format #t "~1Taccum0: ~D~%" (-> obj accum0)) - (format #t "~1Taccum1: ~D~%" (-> obj accum1)) - (format #t "~1Tto-vu0-waits: ~D~%" (-> obj to-vu0-waits)) - (format #t "~1Tto-spr-waits: ~D~%" (-> obj to-spr-waits)) - (format #t "~1Tfrom-spr-waits: ~D~%" (-> obj from-spr-waits)) + (format #t "[~8x] ~A~%" this 'perf-stat) + (format #t "~1Tframe-number: ~D~%" (-> this frame-number)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tcycles: ~D~%" (-> this cycles)) + (format #t "~1Tinstructions: ~D~%" (-> this instructions)) + (format #t "~1Ticache: ~D~%" (-> this icache)) + (format #t "~1Tdcache: ~D~%" (-> this dcache)) + (format #t "~1Tselect: ~D~%" (-> this select)) + (format #t "~1Tctrl: ~D~%" (-> this ctrl)) + (format #t "~1Taccum0: ~D~%" (-> this accum0)) + (format #t "~1Taccum1: ~D~%" (-> this accum1)) + (format #t "~1Tto-vu0-waits: ~D~%" (-> this to-vu0-waits)) + (format #t "~1Tto-spr-waits: ~D~%" (-> this to-spr-waits)) + (format #t "~1Tfrom-spr-waits: ~D~%" (-> this from-spr-waits)) (label cfg-4) - obj + this ) +;; definition (debug) for function perf-stat-bucket->string (defun-debug perf-stat-bucket->string ((arg0 perf-stat-bucket)) (case arg0 (((perf-stat-bucket collide-fill)) @@ -264,6 +272,7 @@ ) ) +;; definition of type perf-stat-array (deftype perf-stat-array (inline-array-class) ((data perf-stat :inline :dynamic :offset-assert 16) ) @@ -272,24 +281,28 @@ :flag-assert #x900000010 ) -(defmethod inspect perf-stat-array ((obj perf-stat-array)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type perf-stat-array +(defmethod inspect perf-stat-array ((this perf-stat-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) +;; failed to figure out what this is: (set! (-> perf-stat-array heap-base) (the-as uint 52)) -(defmethod reset! perf-stat ((obj perf-stat)) - (let ((v1-0 (-> obj ctrl))) - (+! (-> obj count) 1) +;; definition for method 11 of type perf-stat +;; WARN: Return type mismatch int vs none. +(defmethod reset! perf-stat ((this perf-stat)) + (let ((v1-0 (-> this ctrl))) + (+! (-> this count) 1) (b! (zero? v1-0) cfg-2 :delay (nop!)) (.mtc0 Perf 0) (.sync.l) @@ -307,31 +320,36 @@ (none) ) -(defmethod read! perf-stat ((obj perf-stat)) +;; definition for method 12 of type perf-stat +;; WARN: Return type mismatch int vs none. +(defmethod read! perf-stat ((this perf-stat)) (local-vars (v1-1 int) (v1-3 int)) - (b! (zero? (-> obj ctrl)) cfg-2 :delay (nop!)) + (b! (zero? (-> this ctrl)) cfg-2 :delay (nop!)) (.mtc0 Perf 0) (.sync.l) (.sync.p) (.mfpc v1-1 pcr0) - (+! (-> obj accum0) v1-1) + (+! (-> this accum0) v1-1) (.mfpc v1-3 pcr1) - (+! (-> obj accum1) v1-3) + (+! (-> this accum1) v1-3) (label cfg-2) 0 (none) ) -(defmethod update-wait-stats perf-stat ((obj perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) - (when (nonzero? (-> obj ctrl)) - (+! (-> obj to-vu0-waits) arg0) - (+! (-> obj to-spr-waits) arg1) - (+! (-> obj from-spr-waits) arg2) +;; definition for method 13 of type perf-stat +;; WARN: Return type mismatch int vs none. +(defmethod update-wait-stats perf-stat ((this perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) + (when (nonzero? (-> this ctrl)) + (+! (-> this to-vu0-waits) arg0) + (+! (-> this to-spr-waits) arg1) + (+! (-> this from-spr-waits) arg2) ) 0 (none) ) +;; failed to figure out what this is: (when (not *debug-segment*) (set! (-> perf-stat method-table 11) nothing) (set! (-> perf-stat method-table 12) nothing) diff --git a/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc b/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc index b47a05833a..f81ac679d7 100644 --- a/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/viewer_REF.gc @@ -22,17 +22,17 @@ ) ;; definition for method 3 of type viewer -(defmethod inspect viewer ((obj viewer)) - (when (not obj) - (set! obj obj) +(defmethod inspect viewer ((this viewer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tjanim: ~A~%" (-> obj janim)) + (format #t "~2Tjanim: ~A~%" (-> this janim)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -220,16 +220,16 @@ ;; definition for method 11 of type viewer ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! viewer ((obj viewer) (arg0 entity-actor)) +(defmethod init-from-entity! viewer ((this viewer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! *viewer* obj) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! *viewer* this) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (let ((s4-0 (-> arg0 etype))) (if (valid? s4-0 type (the-as string #f) #f 0) (init-viewer (symbol->string (-> s4-0 symbol)) (res-lump-struct arg0 'name string)) diff --git a/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc index 06cfe89b2d..3346a7eb39 100644 --- a/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc +++ b/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc @@ -15,18 +15,18 @@ ;; definition for method 3 of type dma-packet ;; INFO: Used lq/sq -(defmethod inspect dma-packet ((obj dma-packet)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-packet ((this dma-packet)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-packet) - (format #t "~1Tdma: #x~X~%" (-> obj dma)) - (format #t "~1Tvif0: #x~X~%" (-> obj vif0)) - (format #t "~1Tvif1: #x~X~%" (-> obj vif1)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'dma-packet) + (format #t "~1Tdma: #x~X~%" (-> this dma)) + (format #t "~1Tvif0: #x~X~%" (-> this vif0)) + (format #t "~1Tvif1: #x~X~%" (-> this vif1)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type dma-packet-array @@ -39,17 +39,17 @@ ) ;; definition for method 3 of type dma-packet-array -(defmethod inspect dma-packet-array ((obj dma-packet-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-packet-array ((this dma-packet-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -69,16 +69,16 @@ ;; definition for method 3 of type dma-gif ;; INFO: Used lq/sq -(defmethod inspect dma-gif ((obj dma-gif)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-gif ((this dma-gif)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-gif) - (format #t "~1Tgif[2] @ #x~X~%" (&-> obj gif0)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'dma-gif) + (format #t "~1Tgif[2] @ #x~X~%" (&-> this gif0)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type dma-gif-packet @@ -95,17 +95,17 @@ ) ;; definition for method 3 of type dma-gif-packet -(defmethod inspect dma-gif-packet ((obj dma-gif-packet)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-gif-packet ((this dma-gif-packet)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-gif-packet) - (format #t "~1Tdma-vif: #~%" (-> obj dma-vif)) - (format #t "~1Tgif[2] @ #x~X~%" (&-> obj gif0)) - (format #t "~1Tquad[2] @ #x~X~%" (-> obj dma-vif)) + (format #t "[~8x] ~A~%" this 'dma-gif-packet) + (format #t "~1Tdma-vif: #~%" (-> this dma-vif)) + (format #t "~1Tgif[2] @ #x~X~%" (&-> this gif0)) + (format #t "~1Tquad[2] @ #x~X~%" (-> this dma-vif)) (label cfg-4) - obj + this ) ;; definition of type dma-buffer @@ -125,18 +125,18 @@ ) ;; definition for method 3 of type dma-buffer -(defmethod inspect dma-buffer ((obj dma-buffer)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-buffer ((this dma-buffer)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tbase: #x~X~%" (-> obj base)) - (format #t "~1Tend: #x~X~%" (-> obj end)) - (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tbase: #x~X~%" (-> this base)) + (format #t "~1Tend: #x~X~%" (-> this end)) + (format #t "~1Tdata[1] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for method 0 of type dma-buffer @@ -156,13 +156,13 @@ ) ;; definition for method 4 of type dma-buffer -(defmethod length dma-buffer ((obj dma-buffer)) - (-> obj allocated-length) +(defmethod length dma-buffer ((this dma-buffer)) + (-> this allocated-length) ) ;; definition for method 5 of type dma-buffer -(defmethod asize-of dma-buffer ((obj dma-buffer)) - (+ (-> obj allocated-length) -4 (-> dma-buffer size)) +(defmethod asize-of dma-buffer ((this dma-buffer)) + (+ (-> this allocated-length) -4 (-> dma-buffer size)) ) ;; definition for function dma-buffer-length diff --git a/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc index 0fcb044183..49ab02c88b 100644 --- a/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc +++ b/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc @@ -19,20 +19,20 @@ ) ;; definition for method 3 of type vif-disasm-element -(defmethod inspect vif-disasm-element ((obj vif-disasm-element)) - (when (not obj) - (set! obj obj) +(defmethod inspect vif-disasm-element ((this vif-disasm-element)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vif-disasm-element) - (format #t "~1Tmask: ~D~%" (-> obj mask)) - (format #t "~1Ttag: ~D~%" (-> obj tag)) - (format #t "~1Tval: ~D~%" (-> obj val)) - (format #t "~1Tprint: ~D~%" (-> obj print)) - (format #t "~1Tstring1: ~A~%" (-> obj string1)) - (format #t "~1Tstring2: ~A~%" (-> obj string2)) + (format #t "[~8x] ~A~%" this 'vif-disasm-element) + (format #t "~1Tmask: ~D~%" (-> this mask)) + (format #t "~1Ttag: ~D~%" (-> this tag)) + (format #t "~1Tval: ~D~%" (-> this val)) + (format #t "~1Tprint: ~D~%" (-> this print)) + (format #t "~1Tstring1: ~A~%" (-> this string1)) + (format #t "~1Tstring2: ~A~%" (-> this string2)) (label cfg-4) - obj + this ) ;; definition for symbol *vif-disasm-table*, type (array vif-disasm-element) diff --git a/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc index 1d51b6c4ea..ec0764a8c8 100644 --- a/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc @@ -17,21 +17,21 @@ ) ;; definition for method 3 of type dma-chcr -(defmethod inspect dma-chcr ((obj dma-chcr)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-chcr ((this dma-chcr)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-chcr) - (format #t "~1Tdir: ~D~%" (-> obj dir)) - (format #t "~1Tmod: ~D~%" (-> obj mod)) - (format #t "~1Tasp: ~D~%" (-> obj asp)) - (format #t "~1Ttte: ~D~%" (-> obj tte)) - (format #t "~1Ttie: ~D~%" (-> obj tie)) - (format #t "~1Tstr: ~D~%" (-> obj str)) - (format #t "~1Ttag: #x~X~%" (-> obj tag)) + (format #t "[~8x] ~A~%" this 'dma-chcr) + (format #t "~1Tdir: ~D~%" (-> this dir)) + (format #t "~1Tmod: ~D~%" (-> this mod)) + (format #t "~1Tasp: ~D~%" (-> this asp)) + (format #t "~1Ttte: ~D~%" (-> this tte)) + (format #t "~1Ttie: ~D~%" (-> this tie)) + (format #t "~1Tstr: ~D~%" (-> this str)) + (format #t "~1Ttag: #x~X~%" (-> this tag)) (label cfg-4) - obj + this ) ;; definition of type dma-bank @@ -46,17 +46,17 @@ ) ;; definition for method 3 of type dma-bank -(defmethod inspect dma-bank ((obj dma-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-bank ((this dma-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-bank) - (format #t "~1Tchcr: #x~X~%" (-> obj chcr)) - (format #t "~1Tmadr: #x~X~%" (-> obj madr)) - (format #t "~1Tqwc: #x~X~%" (-> obj qwc)) + (format #t "[~8x] ~A~%" this 'dma-bank) + (format #t "~1Tchcr: #x~X~%" (-> this chcr)) + (format #t "~1Tmadr: #x~X~%" (-> this madr)) + (format #t "~1Tqwc: #x~X~%" (-> this qwc)) (label cfg-4) - obj + this ) ;; definition of type dma-bank-source @@ -69,18 +69,18 @@ ) ;; definition for method 3 of type dma-bank-source -(defmethod inspect dma-bank-source ((obj dma-bank-source)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-bank-source ((this dma-bank-source)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-bank-source) - (format #t "~1Tchcr: #x~X~%" (-> obj chcr)) - (format #t "~1Tmadr: #x~X~%" (-> obj madr)) - (format #t "~1Tqwc: #x~X~%" (-> obj qwc)) - (format #t "~1Ttadr: #x~X~%" (-> obj tadr)) + (format #t "[~8x] ~A~%" this 'dma-bank-source) + (format #t "~1Tchcr: #x~X~%" (-> this chcr)) + (format #t "~1Tmadr: #x~X~%" (-> this madr)) + (format #t "~1Tqwc: #x~X~%" (-> this qwc)) + (format #t "~1Ttadr: #x~X~%" (-> this tadr)) (label cfg-4) - obj + this ) ;; definition of type dma-bank-vif @@ -94,20 +94,20 @@ ) ;; definition for method 3 of type dma-bank-vif -(defmethod inspect dma-bank-vif ((obj dma-bank-vif)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-bank-vif ((this dma-bank-vif)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-bank-vif) - (format #t "~1Tchcr: #x~X~%" (-> obj chcr)) - (format #t "~1Tmadr: #x~X~%" (-> obj madr)) - (format #t "~1Tqwc: #x~X~%" (-> obj qwc)) - (format #t "~1Ttadr: #x~X~%" (-> obj tadr)) - (format #t "~1Tas0: #x~X~%" (-> obj as0)) - (format #t "~1Tas1: #x~X~%" (-> obj as1)) + (format #t "[~8x] ~A~%" this 'dma-bank-vif) + (format #t "~1Tchcr: #x~X~%" (-> this chcr)) + (format #t "~1Tmadr: #x~X~%" (-> this madr)) + (format #t "~1Tqwc: #x~X~%" (-> this qwc)) + (format #t "~1Ttadr: #x~X~%" (-> this tadr)) + (format #t "~1Tas0: #x~X~%" (-> this as0)) + (format #t "~1Tas1: #x~X~%" (-> this as1)) (label cfg-4) - obj + this ) ;; definition of type dma-bank-spr @@ -120,19 +120,19 @@ ) ;; definition for method 3 of type dma-bank-spr -(defmethod inspect dma-bank-spr ((obj dma-bank-spr)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-bank-spr ((this dma-bank-spr)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-bank-spr) - (format #t "~1Tchcr: #x~X~%" (-> obj chcr)) - (format #t "~1Tmadr: #x~X~%" (-> obj madr)) - (format #t "~1Tqwc: #x~X~%" (-> obj qwc)) - (format #t "~1Ttadr: #x~X~%" (-> obj tadr)) - (format #t "~1Tsadr: #x~X~%" (-> obj sadr)) + (format #t "[~8x] ~A~%" this 'dma-bank-spr) + (format #t "~1Tchcr: #x~X~%" (-> this chcr)) + (format #t "~1Tmadr: #x~X~%" (-> this madr)) + (format #t "~1Tqwc: #x~X~%" (-> this qwc)) + (format #t "~1Ttadr: #x~X~%" (-> this tadr)) + (format #t "~1Tsadr: #x~X~%" (-> this sadr)) (label cfg-4) - obj + this ) ;; definition of type dma-ctrl @@ -186,23 +186,23 @@ ) ;; definition for method 3 of type dma-bank-control -(defmethod inspect dma-bank-control ((obj dma-bank-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-bank-control ((this dma-bank-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-bank-control) - (format #t "~1Tctrl: #x~X~%" (-> obj ctrl)) - (format #t "~1Tstat: #x~X~%" (-> obj stat)) - (format #t "~1Tpcr: #x~X~%" (-> obj pcr)) - (format #t "~1Tsqwc: #x~X~%" (-> obj sqwc)) - (format #t "~1Trbsr: #x~X~%" (-> obj rbsr)) - (format #t "~1Trbor: #x~X~%" (-> obj rbor)) - (format #t "~1Tstadr: #x~X~%" (-> obj stadr)) - (format #t "~1Tenabler: ~D~%" (-> obj enabler)) - (format #t "~1Tenablew: ~D~%" (-> obj enablew)) + (format #t "[~8x] ~A~%" this 'dma-bank-control) + (format #t "~1Tctrl: #x~X~%" (-> this ctrl)) + (format #t "~1Tstat: #x~X~%" (-> this stat)) + (format #t "~1Tpcr: #x~X~%" (-> this pcr)) + (format #t "~1Tsqwc: #x~X~%" (-> this sqwc)) + (format #t "~1Trbsr: #x~X~%" (-> this rbsr)) + (format #t "~1Trbor: #x~X~%" (-> this rbor)) + (format #t "~1Tstadr: #x~X~%" (-> this stadr)) + (format #t "~1Tenabler: ~D~%" (-> this enabler)) + (format #t "~1Tenablew: ~D~%" (-> this enablew)) (label cfg-4) - obj + this ) ;; definition of type vu-code-block @@ -218,18 +218,18 @@ ) ;; definition for method 3 of type vu-code-block -(defmethod inspect vu-code-block ((obj vu-code-block)) - (when (not obj) - (set! obj obj) +(defmethod inspect vu-code-block ((this vu-code-block)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tcode: #x~X~%" (-> obj code)) - (format #t "~1Tsize: ~D~%" (-> obj size)) - (format #t "~1Tdest-address: ~D~%" (-> obj dest-address)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tcode: #x~X~%" (-> this code)) + (format #t "~1Tsize: ~D~%" (-> this size)) + (format #t "~1Tdest-address: ~D~%" (-> this dest-address)) (label cfg-4) - obj + this ) ;; definition of type vu-stat @@ -255,20 +255,20 @@ ) ;; definition for method 3 of type dma-tag -(defmethod inspect dma-tag ((obj dma-tag)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-tag ((this dma-tag)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-tag) - (format #t "~1Tqwc: ~D~%" (-> obj qwc)) - (format #t "~1Tpce: ~D~%" (-> obj pce)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tirq: ~D~%" (-> obj irq)) - (format #t "~1Taddr: #x~X~%" (-> obj addr)) - (format #t "~1Tspr: ~D~%" (-> obj spr)) + (format #t "[~8x] ~A~%" this 'dma-tag) + (format #t "~1Tqwc: ~D~%" (-> this qwc)) + (format #t "~1Tpce: ~D~%" (-> this pce)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tirq: ~D~%" (-> this irq)) + (format #t "~1Taddr: #x~X~%" (-> this addr)) + (format #t "~1Tspr: ~D~%" (-> this spr)) (label cfg-4) - obj + this ) ;; definition of type dma-bucket @@ -287,21 +287,21 @@ ) ;; definition for method 3 of type dma-bucket -(defmethod inspect dma-bucket ((obj dma-bucket)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-bucket ((this dma-bucket)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-bucket) - (format #t "~1Ttag: ~D~%" (-> obj tag)) - (format #t "~1Tlast: #x~X~%" (-> obj last)) - (format #t "~1Tdummy: ~D~%" (-> obj dummy)) - (format #t "~1Tnext: #x~X~%" (-> obj next)) - (format #t "~1Tclear: ~D~%" (-> obj clear)) - (format #t "~1Tvif0: ~D~%" (-> obj last)) - (format #t "~1Tvif1: ~D~%" (-> obj dummy)) + (format #t "[~8x] ~A~%" this 'dma-bucket) + (format #t "~1Ttag: ~D~%" (-> this tag)) + (format #t "~1Tlast: #x~X~%" (-> this last)) + (format #t "~1Tdummy: ~D~%" (-> this dummy)) + (format #t "~1Tnext: #x~X~%" (-> this next)) + (format #t "~1Tclear: ~D~%" (-> this clear)) + (format #t "~1Tvif0: ~D~%" (-> this last)) + (format #t "~1Tvif1: ~D~%" (-> this dummy)) (label cfg-4) - obj + this ) ;; definition of type vif-mask @@ -363,19 +363,19 @@ ) ;; definition for method 3 of type vif-tag -(defmethod inspect vif-tag ((obj vif-tag)) - (when (not obj) - (set! obj obj) +(defmethod inspect vif-tag ((this vif-tag)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vif-tag) - (format #t "~1Timm: #x~X~%" (-> obj imm)) - (format #t "~1Tnum: ~D~%" (-> obj num)) - (format #t "~1Tcmd: #x~X~%" (-> obj cmd)) - (format #t "~1Tmsk: ~D~%" (-> obj msk)) - (format #t "~1Tirq: ~D~%" (-> obj irq)) + (format #t "[~8x] ~A~%" this 'vif-tag) + (format #t "~1Timm: #x~X~%" (-> this imm)) + (format #t "~1Tnum: ~D~%" (-> this num)) + (format #t "~1Tcmd: #x~X~%" (-> this cmd)) + (format #t "~1Tmsk: ~D~%" (-> this msk)) + (format #t "~1Tirq: ~D~%" (-> this irq)) (label cfg-4) - obj + this ) ;; definition for function dma-sync-fast @@ -389,7 +389,3 @@ ;; definition for function dma-count-until-done ;; ERROR: function was not converted to expressions. Cannot decompile. - - - - diff --git a/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc index c7d249a2c1..87afc81468 100644 --- a/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc @@ -14,20 +14,20 @@ ) ;; definition for method 3 of type draw-node -(defmethod inspect draw-node ((obj draw-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect draw-node ((this draw-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tchild-count: ~D~%" (-> obj child-count)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) - (format #t "~1Tdistance: #x~X~%" (-> obj distance)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tchild-count: ~D~%" (-> this child-count)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tdistance: #x~X~%" (-> this distance)) (label cfg-4) - obj + this ) ;; definition of type drawable-inline-array-node @@ -51,21 +51,17 @@ ) ;; definition for method 3 of type draw-node-dma -(defmethod inspect draw-node-dma ((obj draw-node-dma)) - (when (not obj) - (set! obj obj) +(defmethod inspect draw-node-dma ((this draw-node-dma)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'draw-node-dma) - (format #t "~1Tbanka[32] @ #x~X~%" (-> obj banka)) - (format #t "~1Tbankb[32] @ #x~X~%" (-> obj bankb)) + (format #t "[~8x] ~A~%" this 'draw-node-dma) + (format #t "~1Tbanka[32] @ #x~X~%" (-> this banka)) + (format #t "~1Tbankb[32] @ #x~X~%" (-> this bankb)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc index 60ebab34b0..198bb60a88 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc @@ -11,17 +11,17 @@ ) ;; definition for method 3 of type drawable-actor -(defmethod inspect drawable-actor ((obj drawable-actor)) - (when (not obj) - (set! obj obj) +(defmethod inspect drawable-actor ((this drawable-actor)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tactor: ~A~%" (-> obj actor)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tactor: ~A~%" (-> this actor)) (label cfg-4) - obj + this ) ;; definition of type drawable-tree-actor @@ -44,7 +44,7 @@ ;; definition for method 10 of type drawable-tree-actor ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-actor ((obj drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) +(defmethod draw drawable-tree-actor ((this drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc index b9295548bb..4b883edad0 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc @@ -15,21 +15,21 @@ ) ;; definition for method 3 of type drawable-group -(defmethod inspect drawable-group ((obj drawable-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect drawable-group ((this drawable-group)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> obj data s5-0)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> this data s5-0)) ) (label cfg-7) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-group_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-group_REF.gc index 51b2c5ba7a..1db9800792 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-group_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-group_REF.gc @@ -11,56 +11,56 @@ ) ;; definition for method 2 of type drawable-group -(defmethod print drawable-group ((obj drawable-group)) - (format #t "#<~A @ #x~X [~D]" (-> obj type) obj (-> obj length)) - (dotimes (idx (-> obj length)) - (format #t " ~A" (-> obj data idx)) +(defmethod print drawable-group ((this drawable-group)) + (format #t "#<~A @ #x~X [~D]" (-> this type) this (-> this length)) + (dotimes (idx (-> this length)) + (format #t " ~A" (-> this data idx)) ) (format #t ">") - obj + this ) ;; definition for method 4 of type drawable-group -(defmethod length drawable-group ((obj drawable-group)) - (-> obj length) +(defmethod length drawable-group ((this drawable-group)) + (-> this length) ) ;; definition for method 5 of type drawable-group ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of drawable-group ((obj drawable-group)) - (the-as int (+ (-> drawable-group size) (* (-> obj length) 4))) +(defmethod asize-of drawable-group ((this drawable-group)) + (the-as int (+ (-> drawable-group size) (* (-> this length) 4))) ) ;; definition for method 8 of type drawable-group -(defmethod mem-usage drawable-group ((obj drawable-group) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-group ((this drawable-group) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) "drawable-group") (+! (-> arg0 data 0 count) 1) - (let ((obj-size (asize-of obj))) + (let ((obj-size (asize-of this))) (+! (-> arg0 data 0 used) obj-size) (+! (-> arg0 data 0 total) (logand -16 (+ obj-size 15))) ) - (dotimes (idx (-> obj length)) - (mem-usage (-> obj data idx) arg0 arg1) + (dotimes (idx (-> this length)) + (mem-usage (-> this data idx) arg0 arg1) ) - obj + this ) ;; definition for method 9 of type drawable-group -(defmethod login drawable-group ((obj drawable-group)) - (dotimes (idx (-> obj length)) - (login (-> obj data idx)) +(defmethod login drawable-group ((this drawable-group)) + (dotimes (idx (-> this length)) + (login (-> this data idx)) ) - obj + this ) ;; definition for method 10 of type drawable-group ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-group ((obj drawable-group) (arg0 drawable-group) (arg1 display-frame)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (idx (-> obj length)) - (draw (-> obj data idx) (-> arg0 data idx) arg1) +(defmethod draw drawable-group ((this drawable-group) (arg0 drawable-group) (arg1 display-frame)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (idx (-> this length)) + (draw (-> this data idx) (-> arg0 data idx) arg1) ) ) ) @@ -70,11 +70,11 @@ ;; definition for method 13 of type drawable-group ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-group ((obj drawable-group)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (idx (-> obj length)) - (collect-stats (-> obj data idx)) +(defmethod collect-stats drawable-group ((this drawable-group)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (idx (-> this length)) + (collect-stats (-> this data idx)) ) ) ) @@ -84,11 +84,11 @@ ;; definition for method 14 of type drawable-group ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-group ((obj drawable-group) (arg0 drawable) (arg1 display-frame)) - (when (vis-cull (-> obj id)) - (when (sphere-cull (-> obj bsphere)) - (dotimes (idx (-> obj length)) - (debug-draw (-> obj data idx) (-> (the-as drawable-group arg0) data idx) arg1) +(defmethod debug-draw drawable-group ((this drawable-group) (arg0 drawable) (arg1 display-frame)) + (when (vis-cull (-> this id)) + (when (sphere-cull (-> this bsphere)) + (dotimes (idx (-> this length)) + (debug-draw (-> this data idx) (-> (the-as drawable-group arg0) data idx) arg1) ) ) ) @@ -97,9 +97,9 @@ ) ;; definition for method 15 of type drawable-group -(defmethod unpack-vis drawable-group ((obj drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) - (dotimes (idx (-> obj length)) - (set! arg1 (unpack-vis (-> obj data idx) arg0 arg1)) +(defmethod unpack-vis drawable-group ((this drawable-group) (arg0 (pointer int8)) (arg1 (pointer int8))) + (dotimes (idx (-> this length)) + (set! arg1 (unpack-vis (-> this data idx) arg0 arg1)) ) arg1 ) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc index 2bfa6ba74d..9be1f7e4e5 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc @@ -1,5 +1,7 @@ +;;-*-Lisp-*- (in-package goal) +;; definition of type drawable (deftype drawable (basic) ((id int16 :offset-assert 4) (bsphere vector :inline :offset-assert 16) @@ -19,18 +21,20 @@ ) ) -(defmethod inspect drawable ((obj drawable)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type drawable +(defmethod inspect drawable ((this drawable)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) (label cfg-4) - obj + this ) +;; definition of type drawable-error (deftype drawable-error (drawable) ((name string :offset-assert 32) ) @@ -39,17 +43,19 @@ :flag-assert #x1100000024 ) -(defmethod inspect drawable-error ((obj drawable-error)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type drawable-error +(defmethod inspect drawable-error ((this drawable-error)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tname: ~A~%" (-> this name)) (label cfg-4) - obj + this ) +;; failed to figure out what this is: 0 diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc index c3b0832cfb..c22a990b69 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc @@ -11,22 +11,18 @@ ) ;; definition for method 3 of type drawable-inline-array -(defmethod inspect drawable-inline-array ((obj drawable-inline-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect drawable-inline-array ((this drawable-inline-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tlength: ~D~%" (-> this length)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-inline-array_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-inline-array_REF.gc index 9dad167a8c..7f769aefae 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-inline-array_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-inline-array_REF.gc @@ -2,36 +2,32 @@ (in-package goal) ;; definition for method 4 of type drawable-inline-array -(defmethod length drawable-inline-array ((obj drawable-inline-array)) - (-> obj length) +(defmethod length drawable-inline-array ((this drawable-inline-array)) + (-> this length) ) ;; definition for method 9 of type drawable-inline-array -(defmethod login drawable-inline-array ((obj drawable-inline-array)) - obj +(defmethod login drawable-inline-array ((this drawable-inline-array)) + this ) ;; definition for method 10 of type drawable-inline-array ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-inline-array ((obj drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) +(defmethod draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable-inline-array) (arg1 display-frame)) 0 (none) ) ;; definition for method 13 of type drawable-inline-array ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-inline-array ((obj drawable-inline-array)) +(defmethod collect-stats drawable-inline-array ((this drawable-inline-array)) 0 (none) ) ;; definition for method 14 of type drawable-inline-array ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-inline-array ((obj drawable-inline-array) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-inline-array ((this drawable-inline-array) (arg0 drawable) (arg1 display-frame)) 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc index 741d1f8a73..cb60f58e51 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable-tree_REF.gc @@ -3,13 +3,13 @@ ;; definition for method 10 of type drawable-tree-array ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-array ((obj drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) +(defmethod draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable-tree-array) (arg1 display-frame)) (case (-> *level* draw-level *draw-index* display?) (('special #f) ) (else - (dotimes (idx (-> obj length)) - (draw (-> obj trees idx) (-> arg0 trees idx) arg1) + (dotimes (idx (-> this length)) + (draw (-> this trees idx) (-> arg0 trees idx) arg1) ) ) ) @@ -19,9 +19,9 @@ ;; definition for method 13 of type drawable-tree-array ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-array ((obj drawable-tree-array)) - (dotimes (idx (-> obj length)) - (collect-stats (-> obj trees idx)) +(defmethod collect-stats drawable-tree-array ((this drawable-tree-array)) + (dotimes (idx (-> this length)) + (collect-stats (-> this trees idx)) ) 0 (none) @@ -29,18 +29,18 @@ ;; definition for method 14 of type drawable-tree-array ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-tree-array ((obj drawable-tree-array) (arg0 drawable) (arg1 display-frame)) - (dotimes (idx (-> obj length)) - (debug-draw (-> obj trees idx) (-> (the-as drawable-tree-array arg0) trees idx) arg1) +(defmethod debug-draw drawable-tree-array ((this drawable-tree-array) (arg0 drawable) (arg1 display-frame)) + (dotimes (idx (-> this length)) + (debug-draw (-> this trees idx) (-> (the-as drawable-tree-array arg0) trees idx) arg1) ) 0 (none) ) ;; definition for method 15 of type drawable-tree -(defmethod unpack-vis drawable-tree ((obj drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree ((this drawable-tree) (arg0 (pointer int8)) (arg1 (pointer int8))) (local-vars (t5-1 uint)) - (let* ((v1-0 (the-as drawable-inline-array-node (-> obj data 0))) + (let* ((v1-0 (the-as drawable-inline-array-node (-> this data 0))) (a3-1 (/ (-> v1-0 data 0 id) 8)) (t0-0 (-> v1-0 length)) (v1-1 (&+ arg0 a3-1)) @@ -54,11 +54,11 @@ (set! v1-1 (&-> v1-1 1)) ) ) - (let ((v1-5 (+ (-> obj length) -1))) + (let ((v1-5 (+ (-> this length) -1))) (when (nonzero? v1-5) (dotimes (a3-5 v1-5) - (let* ((t0-4 (-> obj data a3-5)) - (t2-0 (the-as drawable-inline-array-node (-> obj data (+ a3-5 1)))) + (let* ((t0-4 (-> this data a3-5)) + (t2-0 (the-as drawable-inline-array-node (-> this data (+ a3-5 1)))) (t1-5 (/ (-> (the-as drawable-inline-array-node t0-4) data 0 id) 8)) (t2-2 (/ (-> t2-0 data 0 id) 8)) (t0-5 (-> (the-as drawable-inline-array-node t0-4) length)) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc index 1e7edc11b2..85a53a11b9 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc @@ -192,30 +192,30 @@ ) ;; definition for method 9 of type drawable -(defmethod login drawable ((obj drawable)) - obj +(defmethod login drawable ((this drawable)) + this ) ;; definition for method 10 of type drawable ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable ((obj drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) ;; definition for method 11 of type drawable -(defmethod fill-collide-list-from-box drawable ((obj drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) +(defmethod fill-collide-list-from-box drawable ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) 0 ) ;; definition for method 12 of type drawable -(defmethod fill-collide-list-from-line-sphere drawable ((obj drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) +(defmethod fill-collide-list-from-line-sphere drawable ((this drawable) (arg0 int) (arg1 collide-list) (arg2 collide-query)) 0 ) ;; definition for method 16 of type drawable ;; WARN: Return type mismatch int vs none. -(defmethod collect-regions drawable ((obj drawable) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions drawable ((this drawable) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @@ -227,28 +227,28 @@ ;; definition for method 13 of type drawable ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable ((obj drawable)) +(defmethod collect-stats drawable ((this drawable)) 0 (none) ) ;; definition for method 14 of type drawable ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable ((obj drawable) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable ((this drawable) (arg0 drawable) (arg1 display-frame)) 0 (none) ) ;; definition for method 10 of type drawable-error ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-error ((obj drawable-error) (arg0 drawable-error) (arg1 display-frame)) +(defmethod draw drawable-error ((this drawable-error) (arg0 drawable-error) (arg1 display-frame)) (error-sphere arg0 (-> arg0 name)) 0 (none) ) ;; definition for method 15 of type drawable -(defmethod unpack-vis drawable ((obj drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable ((this drawable) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) diff --git a/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc index fdc0a1b9b9..fc35bc3f16 100644 --- a/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc @@ -64,27 +64,27 @@ ) ;; definition for method 3 of type actor-link-info -(defmethod inspect actor-link-info ((obj actor-link-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect actor-link-info ((this actor-link-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) (label cfg-4) - obj + this ) ;; definition for method 27 of type entity-actor -(defmethod next-actor entity-actor ((obj entity-actor)) - (entity-actor-lookup obj 'next-actor 0) +(defmethod next-actor entity-actor ((this entity-actor)) + (entity-actor-lookup this 'next-actor 0) ) ;; definition for method 28 of type entity-actor -(defmethod prev-actor entity-actor ((obj entity-actor)) - (entity-actor-lookup obj 'prev-actor 0) +(defmethod prev-actor entity-actor ((this entity-actor)) + (entity-actor-lookup this 'prev-actor 0) ) ;; definition for method 0 of type actor-link-info @@ -106,41 +106,41 @@ ) ;; definition for method 12 of type actor-link-info -(defmethod get-next actor-link-info ((obj actor-link-info)) - (-> obj next) +(defmethod get-next actor-link-info ((this actor-link-info)) + (-> this next) ) ;; definition for method 13 of type actor-link-info -(defmethod get-prev actor-link-info ((obj actor-link-info)) - (-> obj prev) +(defmethod get-prev actor-link-info ((this actor-link-info)) + (-> this prev) ) ;; definition for method 14 of type actor-link-info ;; WARN: Return type mismatch basic vs process. -(defmethod get-next-process actor-link-info ((obj actor-link-info)) - (the-as process (and (-> obj next) (-> obj next extra process))) +(defmethod get-next-process actor-link-info ((this actor-link-info)) + (the-as process (and (-> this next) (-> this next extra process))) ) ;; definition for method 15 of type actor-link-info ;; WARN: Return type mismatch basic vs process. -(defmethod get-prev-process actor-link-info ((obj actor-link-info)) - (the-as process (and (-> obj prev) (-> obj prev extra process))) +(defmethod get-prev-process actor-link-info ((this actor-link-info)) + (the-as process (and (-> this prev) (-> this prev extra process))) ) ;; definition for method 11 of type actor-link-info -(defmethod link-to-next-and-prev-actor actor-link-info ((obj actor-link-info)) - (let ((a0-1 (-> obj process entity))) - (set! (-> obj next) (entity-actor-lookup a0-1 'next-actor 0)) +(defmethod link-to-next-and-prev-actor actor-link-info ((this actor-link-info)) + (let ((a0-1 (-> this process entity))) + (set! (-> this next) (entity-actor-lookup a0-1 'next-actor 0)) ) - (let ((a0-2 (-> obj process entity))) - (set! (-> obj prev) (entity-actor-lookup a0-2 'prev-actor 0)) + (let ((a0-2 (-> this process entity))) + (set! (-> this prev) (entity-actor-lookup a0-2 'prev-actor 0)) ) - obj + this ) ;; definition for method 16 of type actor-link-info -(defmethod apply-function-forward actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) - (let ((s3-0 (-> obj next))) +(defmethod apply-function-forward actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s3-0 (-> this next))) (while s3-0 (if (arg0 s3-0 arg1) (return (the-as int #f)) @@ -152,8 +152,8 @@ ) ;; definition for method 17 of type actor-link-info -(defmethod apply-function-reverse actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) - (let ((s3-0 (-> obj prev))) +(defmethod apply-function-reverse actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s3-0 (-> this prev))) (while s3-0 (if (arg0 s3-0 arg1) (return (the-as int #f)) @@ -165,8 +165,8 @@ ) ;; definition for method 18 of type actor-link-info -(defmethod apply-all actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) - (let ((s4-0 (-> obj process entity))) +(defmethod apply-all actor-link-info ((this actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s4-0 (-> this process entity))) (while (let ((a0-2 s4-0)) (entity-actor-lookup a0-2 'prev-actor 0) ) @@ -185,9 +185,9 @@ ) ;; definition for method 20 of type actor-link-info -(defmethod send-to-all-after actor-link-info ((obj actor-link-info) (arg0 symbol)) +(defmethod send-to-all-after actor-link-info ((this actor-link-info) (arg0 symbol)) (with-pp - (let ((s4-0 (-> obj next)) + (let ((s4-0 (-> this next)) (s5-0 (the-as object #f)) ) (while s4-0 @@ -209,9 +209,9 @@ ) ;; definition for method 21 of type actor-link-info -(defmethod send-to-all-before actor-link-info ((obj actor-link-info) (arg0 symbol)) +(defmethod send-to-all-before actor-link-info ((this actor-link-info) (arg0 symbol)) (with-pp - (let ((s4-0 (-> obj prev)) + (let ((s4-0 (-> this prev)) (s5-0 (the-as object #f)) ) (while s4-0 @@ -234,8 +234,8 @@ ;; definition for method 23 of type actor-link-info ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-next actor-link-info ((obj actor-link-info) (arg0 symbol)) - (let ((a0-1 (-> obj next))) +(defmethod send-to-next actor-link-info ((this actor-link-info) (arg0 symbol)) + (let ((a0-1 (-> this next))) (when a0-1 (let ((a0-2 (-> a0-1 extra process))) (if a0-2 @@ -249,8 +249,8 @@ ;; definition for method 24 of type actor-link-info ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) - (let ((a0-1 (-> obj prev))) +(defmethod send-to-prev actor-link-info ((this actor-link-info) (arg0 symbol)) + (let ((a0-1 (-> this prev))) (when a0-1 (let ((a0-2 (-> a0-1 extra process))) (if a0-2 @@ -264,23 +264,23 @@ ;; definition for method 22 of type actor-link-info ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-next-and-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) - (send-to-next obj arg0) - (send-to-prev obj arg0) +(defmethod send-to-next-and-prev actor-link-info ((this actor-link-info) (arg0 symbol)) + (send-to-next this arg0) + (send-to-prev this arg0) (none) ) ;; definition for method 19 of type actor-link-info ;; WARN: Return type mismatch symbol vs none. -(defmethod send-to-all actor-link-info ((obj actor-link-info) (arg0 symbol)) - (send-to-all-after obj arg0) - (send-to-all-before obj arg0) +(defmethod send-to-all actor-link-info ((this actor-link-info) (arg0 symbol)) + (send-to-all-after this arg0) + (send-to-all-before this arg0) (none) ) ;; definition for method 25 of type actor-link-info -(defmethod actor-count actor-link-info ((obj actor-link-info)) - (let ((s5-0 (-> obj process entity)) +(defmethod actor-count actor-link-info ((this actor-link-info)) + (let ((s5-0 (-> this process entity)) (gp-0 0) ) (while (let ((a0-2 s5-0)) @@ -299,8 +299,8 @@ ) ;; definition for method 9 of type actor-link-info -(defmethod get-matching-actor-type-mask actor-link-info ((obj actor-link-info) (arg0 type)) - (let ((s3-0 (-> obj process entity)) +(defmethod get-matching-actor-type-mask actor-link-info ((this actor-link-info) (arg0 type)) + (let ((s3-0 (-> this process entity)) (s5-0 0) ) (let ((s4-0 1)) @@ -324,8 +324,8 @@ ) ;; definition for method 10 of type actor-link-info -(defmethod actor-count-before actor-link-info ((obj actor-link-info)) - (let* ((s5-0 (-> obj process entity)) +(defmethod actor-count-before actor-link-info ((this actor-link-info)) + (let* ((s5-0 (-> this process entity)) (s4-0 s5-0) (gp-0 0) ) diff --git a/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc index 04d7e3771c..f01cfc69e7 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc @@ -37,28 +37,28 @@ ;; definition for method 3 of type entity-perm ;; INFO: Used lq/sq -(defmethod inspect entity-perm ((obj entity-perm)) - (when (not obj) - (set! obj obj) +(defmethod inspect entity-perm ((this entity-perm)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'entity-perm) - (format #t "~1Tuser-object[2] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-uint64: ~D~%" (-> obj user-uint64)) - (format #t "~1Tuser-float[2] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-int32[2] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-uint32[2] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-int16[4] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-uint16[4] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-int8[8] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-uint8[8] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tstatus: ~D~%" (-> obj status)) - (format #t "~1Tdummy[1] @ #x~X~%" (-> obj dummy)) - (format #t "~1Ttask: ~D~%" (-> obj task)) - (format #t "~1Taid: ~D~%" (-> obj aid)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'entity-perm) + (format #t "~1Tuser-object[2] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-uint64: ~D~%" (-> this user-uint64)) + (format #t "~1Tuser-float[2] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-int32[2] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-uint32[2] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-int16[4] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-uint16[4] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-int8[8] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-uint8[8] @ #x~X~%" (-> this user-object)) + (format #t "~1Tstatus: ~D~%" (-> this status)) + (format #t "~1Tdummy[1] @ #x~X~%" (-> this dummy)) + (format #t "~1Ttask: ~D~%" (-> this task)) + (format #t "~1Taid: ~D~%" (-> this aid)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type entity-links @@ -86,20 +86,20 @@ ) ;; definition for method 3 of type entity-links -(defmethod inspect entity-links ((obj entity-links)) - (when (not obj) - (set! obj obj) +(defmethod inspect entity-links ((this entity-links)) + (when (not this) + (set! this this) (goto cfg-42) ) - (format #t "[~8x] ~A~%" obj 'entity-links) - (format #t "~1Tprev-link: #~%" (-> obj prev-link)) - (format #t "~1Tnext-link: #~%" (-> obj next-link)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tvis-id: ~D~%" (-> obj vis-id)) - (format #t "~1Tkill-mask: #x~X : (task-mask " (-> obj kill-mask)) - (let ((s5-0 (-> obj kill-mask))) + (format #t "[~8x] ~A~%" this 'entity-links) + (format #t "~1Tprev-link: #~%" (-> this prev-link)) + (format #t "~1Tnext-link: #~%" (-> this next-link)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tvis-id: ~D~%" (-> this vis-id)) + (format #t "~1Tkill-mask: #x~X : (task-mask " (-> this kill-mask)) + (let ((s5-0 (-> this kill-mask))) (if (= (logand s5-0 (task-mask task0)) (task-mask task0)) (format #t "task0 ") ) @@ -159,14 +159,14 @@ ) ) (format #t ")~%") - (format #t "~1Tvis-dist: (meters ~m)~%" (-> obj vis-dist)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Tperm: ~`entity-perm`P~%" (-> obj perm)) - (format #t "~1Tstatus: ~D~%" (-> obj perm status)) - (format #t "~1Taid: ~D~%" (-> obj perm aid)) - (format #t "~1Ttask: ~D~%" (-> obj perm task)) + (format #t "~1Tvis-dist: (meters ~m)~%" (-> this vis-dist)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tperm: ~`entity-perm`P~%" (-> this perm)) + (format #t "~1Tstatus: ~D~%" (-> this perm status)) + (format #t "~1Taid: ~D~%" (-> this perm aid)) + (format #t "~1Ttask: ~D~%" (-> this perm task)) (label cfg-42) - obj + this ) ;; definition of type entity-perm-array @@ -179,17 +179,17 @@ ) ;; definition for method 3 of type entity-perm-array -(defmethod inspect entity-perm-array ((obj entity-perm-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect entity-perm-array ((this entity-perm-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -205,17 +205,17 @@ ) ;; definition for method 3 of type entity-links-array -(defmethod inspect entity-links-array ((obj entity-links-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect entity-links-array ((this entity-links-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -306,16 +306,16 @@ ) ;; definition for method 3 of type actor-reference -(defmethod inspect actor-reference ((obj actor-reference)) - (when (not obj) - (set! obj obj) +(defmethod inspect actor-reference ((this actor-reference)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'actor-reference) - (format #t "~1Tactor: ~A~%" (-> obj actor)) - (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "[~8x] ~A~%" this 'actor-reference) + (format #t "~1Tactor: ~A~%" (-> this actor)) + (format #t "~1Tid: ~D~%" (-> this id)) (label cfg-4) - obj + this ) ;; definition of type actor-group @@ -328,18 +328,17 @@ ) ;; definition for method 3 of type actor-group -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect actor-group ((obj actor-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect actor-group ((this actor-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -359,19 +358,19 @@ ) ;; definition for method 3 of type entity-info -(defmethod inspect entity-info ((obj entity-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect entity-info ((this entity-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tptype: ~A~%" (-> obj ptype)) - (format #t "~1Tpackage: ~A~%" (-> obj package)) - (format #t "~1Tart-group: ~A~%" (-> obj art-group)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Theap-size: ~D~%" (-> obj heap-size)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tptype: ~A~%" (-> this ptype)) + (format #t "~1Tpackage: ~A~%" (-> this package)) + (format #t "~1Tart-group: ~A~%" (-> this art-group)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Theap-size: ~D~%" (-> this heap-size)) (label cfg-4) - obj + this ) ;; definition of type actor-bank @@ -386,17 +385,17 @@ ) ;; definition for method 3 of type actor-bank -(defmethod inspect actor-bank ((obj actor-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect actor-bank ((this actor-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tpause-dist: ~f~%" (-> obj pause-dist)) - (format #t "~1Tbirth-dist: ~f~%" (-> obj birth-dist)) - (format #t "~1Tbirth-max: ~D~%" (-> obj birth-max)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tpause-dist: ~f~%" (-> this pause-dist)) + (format #t "~1Tbirth-dist: ~f~%" (-> this birth-dist)) + (format #t "~1Tbirth-max: ~D~%" (-> this birth-max)) (label cfg-4) - obj + this ) ;; definition for symbol *ACTOR-bank*, type actor-bank diff --git a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc index 045bbb1f1d..b9e9f8948f 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity_REF.gc @@ -12,21 +12,21 @@ ;; definition for method 8 of type drawable-actor ;; WARN: Return type mismatch int vs drawable-actor. -(defmethod mem-usage drawable-actor ((obj drawable-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-actor ((this drawable-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 44 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") (+! (-> arg0 data 43 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 43 used) v1-6) (+! (-> arg0 data 43 total) (logand -16 (+ v1-6 15))) ) - (mem-usage (-> obj actor) arg0 (logior arg1 64)) + (mem-usage (-> this actor) arg0 (logior arg1 64)) (the-as drawable-actor 0) ) ;; definition for method 8 of type drawable-inline-array-actor ;; WARN: Return type mismatch int vs drawable-inline-array-actor. -(defmethod mem-usage drawable-inline-array-actor ((obj drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-actor ((this drawable-inline-array-actor) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -34,80 +34,79 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) (the-as drawable-inline-array-actor 0) ) ;; definition for method 2 of type entity-links -(defmethod print entity-links ((obj entity-links)) - (format #t "#" (-> obj process) obj) - obj +(defmethod print entity-links ((this entity-links)) + (format #t "#" (-> this process) this) + this ) ;; definition for method 2 of type entity-perm -(defmethod print entity-perm ((obj entity-perm)) +(defmethod print entity-perm ((this entity-perm)) (format #t "#" - (-> obj aid) - (-> obj task) - (-> obj status) - (-> obj user-uint64) - obj + (-> this aid) + (-> this task) + (-> this status) + (-> this user-uint64) + this ) - obj + this ) ;; definition for method 2 of type actor-group -(defmethod print actor-group ((obj actor-group)) +(defmethod print actor-group ((this actor-group)) (format #t "# obj length)) - (format #t " ~A" (-> obj data s5-0 actor)) + (dotimes (s5-0 (-> this length)) + (format #t " ~A" (-> this data s5-0 actor)) ) - (format #t " @ #x~X>" obj) - obj + (format #t " @ #x~X>" this) + this ) ;; definition for method 3 of type actor-group -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect actor-group ((obj actor-group)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A / ~D~%" s5-0 (-> obj data s5-0 actor) (-> obj data s5-0 id)) +(defmethod inspect actor-group ((this actor-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A / ~D~%" s5-0 (-> this data s5-0 actor) (-> this data s5-0 id)) ) - obj + this ) ;; definition for method 22 of type entity -(defmethod birth! entity ((obj entity)) - (format #t "birth ~A~%" obj) - obj +(defmethod birth! entity ((this entity)) + (format #t "birth ~A~%" this) + this ) ;; definition for method 23 of type entity -(defmethod kill! entity ((obj entity)) - (format #t "kill ~A~%" obj) - obj +(defmethod kill! entity ((this entity)) + (format #t "kill ~A~%" this) + this ) ;; definition for method 2 of type entity -(defmethod print entity ((obj entity)) - (format #t "#<~A :name ~S @ #x~X>" (-> obj type) (res-lump-struct obj 'name structure) obj) - obj +(defmethod print entity ((this entity)) + (format #t "#<~A :name ~S @ #x~X>" (-> this type) (res-lump-struct this 'name structure) this) + this ) ;; definition for method 26 of type entity -(defmethod get-level entity ((obj entity)) +(defmethod get-level entity ((this entity)) (dotimes (v1-0 (-> *level* length)) (let ((a1-3 (-> *level* level v1-0))) (when (= (-> a1-3 status) 'active) - (if (and (>= (the-as int obj) (the-as int (-> a1-3 heap base))) - (< (the-as int obj) (the-as int (-> a1-3 heap top-base))) + (if (and (>= (the-as int this) (the-as int (-> a1-3 heap base))) + (< (the-as int this) (the-as int (-> a1-3 heap top-base))) ) (return a1-3) ) @@ -258,11 +257,11 @@ ;; definition for method 18 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod update-nav-meshes-method level-group ((obj level-group)) +(defmethod update-nav-meshes-method level-group ((this level-group)) "Clashes with a function name" (when (not (paused?)) - (dotimes (s5-0 (-> obj length)) - (let ((v1-4 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-4 (-> this level s5-0))) (when (= (-> v1-4 status) 'active) (let ((s4-0 (-> v1-4 bsp nav-meshes))) (when (nonzero? s4-0) @@ -531,67 +530,72 @@ ) ;; definition for method 2 of type process -;; INFO: this function exists in multiple non-identical object files -(defmethod print process ((obj process)) +(defmethod print process ((this process)) (cond - ((and (-> obj top-thread) (!= (-> obj status) 'dead)) - (format #t "#<~A ~S ~A :state ~S :flags " (-> obj type) (-> obj name) (-> obj status) (if (-> obj state) - (-> obj state name) - ) - ) - (process-status-bits obj #t) + ((and (-> this top-thread) (!= (-> this status) 'dead)) + (format + #t + "#<~A ~S ~A :state ~S :flags " + (-> this type) + (-> this name) + (-> this status) + (if (-> this state) + (-> this state name) + ) + ) + (process-status-bits this #t) (format #t " :stack ~D/~D :heap ~D/~D @ #x~X>" - (&- (-> obj top-thread stack-top) (the-as uint (-> obj top-thread sp))) - (-> obj main-thread stack-size) - (- (-> obj allocated-length) (&- (-> obj heap-top) (the-as uint (-> obj heap-cur)))) - (-> obj allocated-length) - obj + (&- (-> this top-thread stack-top) (the-as uint (-> this top-thread sp))) + (-> this main-thread stack-size) + (- (-> this allocated-length) (&- (-> this heap-top) (the-as uint (-> this heap-cur)))) + (-> this allocated-length) + this ) ) (else (format #t "#<~A ~S ~A :state ~S @ #x~X" - (-> obj type) - (-> obj name) - (-> obj status) - (if (-> obj state) - (-> obj state name) + (-> this type) + (-> this name) + (-> this status) + (if (-> this state) + (-> this state name) ) - obj + this ) ) ) - obj + this ) ;; definition for method 3 of type entity -(defmethod inspect entity ((obj entity)) - ((the-as (function entity entity) (find-parent-method entity 3)) obj) - (format #t "~Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~Taid: ~D~%" (-> obj aid)) - obj +(defmethod inspect entity ((this entity)) + ((the-as (function entity entity) (find-parent-method entity 3)) this) + (format #t "~Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~Taid: ~D~%" (-> this aid)) + this ) ;; definition for method 3 of type entity-nav-mesh -(defmethod inspect entity-nav-mesh ((obj entity-nav-mesh)) - ((the-as (function object object) (find-parent-method entity-nav-mesh 3)) obj) - (format #t "~Tnav-mesh ~A~%" (-> obj nav-mesh)) - (if (and (-> obj nav-mesh) (nonzero? (-> obj nav-mesh))) - (inspect (-> obj nav-mesh)) +(defmethod inspect entity-nav-mesh ((this entity-nav-mesh)) + ((the-as (function object object) (find-parent-method entity-nav-mesh 3)) this) + (format #t "~Tnav-mesh ~A~%" (-> this nav-mesh)) + (if (and (-> this nav-mesh) (nonzero? (-> this nav-mesh))) + (inspect (-> this nav-mesh)) ) - obj + this ) ;; definition for method 3 of type entity-actor -(defmethod inspect entity-actor ((obj entity-actor)) - ((the-as (function entity entity) (find-parent-method entity-actor 3)) obj) - (format #t "~Tetype: ~A~%" (-> obj etype)) - (format #t "~Ttask: ~d~%" (-> obj task)) - (format #t "~Tkill-mask: #x~X : (" (-> obj kill-mask)) - (let ((s5-0 (-> obj kill-mask))) +(defmethod inspect entity-actor ((this entity-actor)) + ((the-as (function entity entity) (find-parent-method entity-actor 3)) this) + (format #t "~Tetype: ~A~%" (-> this etype)) + (format #t "~Ttask: ~d~%" (-> this task)) + (format #t "~Tkill-mask: #x~X : (" (-> this kill-mask)) + (let ((s5-0 (-> this kill-mask))) (if (= (logand s5-0 (task-mask task0)) (task-mask task0)) (format #t "task0 ") ) @@ -651,23 +655,23 @@ ) ) (format #t ")~%") - (format #t "~Tvis-id: ~d~%" (-> obj vis-id)) - (format #t "~Tquat: ~`vector`P~%" (-> obj quat)) - obj + (format #t "~Tvis-id: ~d~%" (-> this vis-id)) + (format #t "~Tquat: ~`vector`P~%" (-> this quat)) + this ) ;; definition for method 29 of type entity-actor ;; WARN: Return type mismatch entity-actor vs none. -(defmethod debug-print entity-actor ((obj entity-actor) (arg0 symbol) (arg1 type)) - (let ((s4-0 (-> obj etype))) +(defmethod debug-print entity-actor ((this entity-actor) (arg0 symbol) (arg1 type)) + (let ((s4-0 (-> this etype))) (when (or (not arg1) (and s4-0 (valid? s4-0 type (the-as string #f) #f 0) (type-type? s4-0 arg1))) - (format #t "~5D #x~8X ~-26S" (-> obj extra vis-id) obj (res-lump-struct obj 'name structure)) + (format #t "~5D #x~8X ~-26S" (-> this extra vis-id) this (res-lump-struct this 'name structure)) (let ((t9-4 format) (a0-5 #t) (a1-5 "~8D ~3D ~-8S #x~4X") - (a2-4 (-> obj extra perm aid)) - (a3-3 (-> obj extra perm task)) - (t0-3 (-> obj extra level nickname)) + (a2-4 (-> this extra perm aid)) + (a3-3 (-> this extra perm task)) + (t0-3 (-> this extra level nickname)) ) (set! t0-3 (cond (t0-3 @@ -675,17 +679,17 @@ t0-3 ) (else - (-> obj extra level name) + (-> this extra level name) ) ) ) - (t9-4 a0-5 a1-5 a2-4 a3-3 t0-3 (-> obj extra perm status)) + (t9-4 a0-5 a1-5 a2-4 a3-3 t0-3 (-> this extra perm status)) ) (if (= arg0 'entity-meters) - (format #t " :trans ~14m ~14m ~14m " (-> obj extra trans x) (-> obj extra trans y) (-> obj extra trans z)) - (format #t " :trans ~14f ~14f ~14f " (-> obj extra trans x) (-> obj extra trans y) (-> obj extra trans z)) + (format #t " :trans ~14m ~14m ~14m " (-> this extra trans x) (-> this extra trans y) (-> this extra trans z)) + (format #t " :trans ~14f ~14f ~14f " (-> this extra trans x) (-> this extra trans y) (-> this extra trans z)) ) - (let* ((s3-2 (-> obj extra process)) + (let* ((s3-2 (-> this extra process)) (s4-2 (if (type? s3-2 process-drawable) s3-2 ) @@ -694,28 +698,28 @@ (format #t ":pr #x~8X ~-12S ~-21S ~-5S/~-5S " - (if (-> obj extra process) - (-> obj extra process) + (if (-> this extra process) + (-> this extra process) 0 ) - (if (-> obj extra process) - (-> obj extra process name) + (if (-> this extra process) + (-> this extra process name) "" ) - (if (and (-> obj extra process) (-> obj extra process state)) - (-> obj extra process state name) + (if (and (-> this extra process) (-> this extra process state)) + (-> this extra process state name) "" ) - (if (-> obj extra process) - (* (- (-> obj extra process allocated-length) - (&- (-> obj extra process heap-top) (the-as uint (-> obj extra process heap-cur))) + (if (-> this extra process) + (* (- (-> this extra process allocated-length) + (&- (-> this extra process heap-top) (the-as uint (-> this extra process heap-cur))) ) 8 ) "" ) - (if (-> obj extra process) - (* (-> obj extra process allocated-length) 8) + (if (-> this extra process) + (* (-> this extra process allocated-length) 8) "" ) ) @@ -723,7 +727,7 @@ ) (format #t "~%") (if (= arg0 'entity-perm) - (format #t " ~`entity-perm`P~%" (-> obj extra perm)) + (format #t " ~`entity-perm`P~%" (-> this extra perm)) ) ) ) @@ -732,7 +736,7 @@ ;; definition for method 14 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod debug-print-entities level-group ((obj level-group) (arg0 symbol) (arg1 type)) +(defmethod debug-print-entities level-group ((this level-group) (arg0 symbol) (arg1 type)) (let ((t9-0 format) (a0-1 #t) (a1-1 @@ -744,8 +748,8 @@ 0 (t9-0 a0-1 a1-1) ) - (dotimes (s3-0 (-> obj length)) - (let ((s2-0 (-> obj level s3-0))) + (dotimes (s3-0 (-> this length)) + (let ((s2-0 (-> this level s3-0))) (when (= (-> s2-0 status) 'active) (case arg0 (('art-group) @@ -772,12 +776,12 @@ ;; definition for method 24 of type entity-actor ;; INFO: Used lq/sq ;; WARN: Return type mismatch entity-actor vs none. -(defmethod add-to-level! entity-actor ((obj entity-actor) (arg0 level-group) (arg1 level) (arg2 actor-id)) +(defmethod add-to-level! entity-actor ((this entity-actor) (arg0 level-group) (arg1 level) (arg2 actor-id)) (let ((v1-4 (-> arg1 entity data (-> arg1 entity length)))) (+! (-> arg1 entity length) 1) (set! (-> v1-4 process) #f) - (set! (-> v1-4 entity) obj) - (set! (-> obj extra) v1-4) + (set! (-> v1-4 entity) this) + (set! (-> this extra) v1-4) (cond ((-> arg0 entity-link) (let* ((a0-6 (-> arg0 entity-link)) @@ -795,12 +799,12 @@ ) ) (set! (-> arg0 entity-link) v1-4) - (set! (-> v1-4 trans quad) (-> obj trans quad)) + (set! (-> v1-4 trans quad) (-> this trans quad)) ) - (set! (-> obj extra perm aid) arg2) - (set! (-> obj extra level) arg1) - (set! (-> obj extra kill-mask) - (logior (logand (-> obj kill-mask) + (set! (-> this extra perm aid) arg2) + (set! (-> this extra level) arg1) + (set! (-> this extra kill-mask) + (logior (logand (-> this kill-mask) (task-mask task0 task1 @@ -822,21 +826,21 @@ ) (logclear (task-mask movie0 movie1 movie2 tm19 tm20 tm21 tm22 tm23 tm24 tm25 tm26 tm27 tm28 tm29 tm30 tm31) - (-> obj kill-mask) + (-> this kill-mask) ) ) ) (if (not (-> arg1 vis-info 0)) - (set! (-> obj extra vis-dist) (res-lump-float obj 'vis-dist :default 40960000.0)) + (set! (-> this extra vis-dist) (res-lump-float this 'vis-dist :default 40960000.0)) ) (cond - ((= (-> obj type) entity-actor) - (set! (-> obj extra perm task) (-> obj task)) - (set! (-> obj extra vis-id) (-> obj vis-id)) + ((= (-> this type) entity-actor) + (set! (-> this extra perm task) (-> this task)) + (set! (-> this extra vis-id) (-> this vis-id)) ) (else - (set! (-> obj extra perm task) (game-task none)) - (set! (-> obj extra vis-id) 0) + (set! (-> this extra perm task) (game-task none)) + (set! (-> this extra vis-id) 0) 0 ) ) @@ -844,8 +848,8 @@ ) ;; definition for method 25 of type entity -(defmethod remove-from-level! entity ((obj entity) (arg0 level-group)) - (let ((v1-0 (-> obj extra))) +(defmethod remove-from-level! entity ((this entity) (arg0 level-group)) + (let ((v1-0 (-> this extra))) (cond ((= (-> v1-0 next-link) v1-0) (set! (-> arg0 entity-link) #f) @@ -859,7 +863,7 @@ ) ) ) - obj + this ) ;; definition for function update-actor-vis-box @@ -883,10 +887,10 @@ ;; definition for method 25 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod update-vis-volumes level-group ((obj level-group)) +(defmethod update-vis-volumes level-group ((this level-group)) (local-vars (sv-16 pointer) (sv-20 pointer) (sv-24 pointer) (sv-28 process)) - (dotimes (s5-0 (-> obj length)) - (let ((v1-3 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-3 (-> this level s5-0))) (when (= (-> v1-3 status) 'active) (let ((s4-0 (-> v1-3 bsp level entity))) (dotimes (s3-0 (-> s4-0 length)) @@ -982,7 +986,7 @@ ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod update-vis-volumes-from-nav-mesh level-group ((obj level-group)) +(defmethod update-vis-volumes-from-nav-mesh level-group ((this level-group)) (local-vars (sv-16 pointer) (sv-20 vector) @@ -995,8 +999,8 @@ (sv-96 vector) (sv-112 vector) ) - (dotimes (s5-0 (-> obj length)) - (let ((v1-3 (-> obj level s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((v1-3 (-> this level s5-0))) (when (= (-> v1-3 status) 'active) (let ((s4-0 (-> v1-3 bsp level entity))) (dotimes (s3-0 (-> s4-0 length)) @@ -1088,7 +1092,7 @@ ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod print-volume-sizes level-group ((obj level-group)) +(defmethod print-volume-sizes level-group ((this level-group)) (local-vars (sv-16 pointer) (sv-20 float) @@ -1101,8 +1105,8 @@ (sv-80 structure) ) (let ((s5-0 0)) - (dotimes (v1-0 (-> obj length)) - (let ((a0-4 (-> obj level v1-0))) + (dotimes (v1-0 (-> this length)) + (let ((a0-4 (-> this level v1-0))) (if (= (-> a0-4 status) 'active) (+! s5-0 (-> a0-4 entity length)) ) @@ -1114,8 +1118,8 @@ (let ((s2-0 (the-as structure #f)) (s3-0 (the-as entity #f)) ) - (dotimes (s1-0 (-> obj length)) - (let ((v1-7 (-> obj level s1-0))) + (dotimes (s1-0 (-> this length)) + (let ((v1-7 (-> this level s1-0))) (when (= (-> v1-7 status) 'active) (let ((s0-0 (-> v1-7 entity))) (set! sv-48 (-> s0-0 length)) @@ -1202,18 +1206,18 @@ ) ;; definition for method 3 of type debug-actor-info -(defmethod inspect debug-actor-info ((obj debug-actor-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-actor-info ((this debug-actor-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tpid: ~D~%" (-> obj pid)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tpid: ~D~%" (-> this pid)) (label cfg-4) - obj + this ) ;; definition for symbol *debug-actor-info*, type debug-actor-info @@ -1399,7 +1403,7 @@ ;; definition for method 15 of type level-group ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-actors level-group ((obj level-group) (arg0 symbol)) +(defmethod debug-draw-actors level-group ((this level-group) (arg0 symbol)) (local-vars (sv-16 symbol) (sv-20 vector) @@ -1438,8 +1442,8 @@ ) ) (else - (dotimes (s5-2 (-> obj length)) - (let ((v1-25 (-> obj level s5-2))) + (dotimes (s5-2 (-> this length)) + (let ((v1-25 (-> this level s5-2))) (when (= (-> v1-25 status) 'active) (let ((s4-1 (-> v1-25 bsp level entity))) (dotimes (s3-0 (-> s4-1 length)) @@ -1479,8 +1483,8 @@ ) (when (and *display-actor-vis* (not *debug-actor*)) (let ((s5-3 *display-actor-vis*)) - (dotimes (s4-2 (-> obj length)) - (let ((s3-1 (-> obj level s4-2))) + (dotimes (s4-2 (-> this length)) + (let ((s3-1 (-> this level s4-2))) (when (= (-> s3-1 status) 'active) (let ((s2-1 (-> s3-1 bsp level entity))) (dotimes (s1-1 (-> s2-1 length)) @@ -1534,7 +1538,7 @@ ) ) (if *generate-actor-vis* - (update-vis-volumes obj) + (update-vis-volumes this) ) (cond (*debug-actor* @@ -1613,8 +1617,8 @@ ) ) (*display-nav-mesh* - (dotimes (s5-5 (-> obj length)) - (let ((v1-145 (-> obj level s5-5))) + (dotimes (s5-5 (-> this length)) + (let ((v1-145 (-> this level s5-5))) (when (= (-> v1-145 status) 'active) (let ((s4-5 (-> v1-145 bsp nav-meshes))) (when (nonzero? s4-5) @@ -1633,8 +1637,8 @@ ) (else (when *display-nav-marks* - (dotimes (s5-6 (-> obj length)) - (let ((v1-163 (-> obj level s5-6))) + (dotimes (s5-6 (-> this length)) + (let ((v1-163 (-> this level s5-6))) (when (= (-> v1-163 status) 'active) (let ((s4-6 (-> v1-163 bsp nav-meshes))) (when (nonzero? s4-6) @@ -1714,8 +1718,8 @@ ) ) (when *display-split-boxes* - (dotimes (s5-7 (-> obj length)) - (let ((v1-193 (-> obj level s5-7))) + (dotimes (s5-7 (-> this length)) + (let ((v1-193 (-> this level s5-7))) (when (= (-> v1-193 status) 'active) (let ((s4-7 (-> v1-193 bsp region-tree))) (when (nonzero? s4-7) @@ -1738,8 +1742,8 @@ ) ) (when *display-region-marks* - (dotimes (s5-8 (-> obj length)) - (let ((s4-8 (-> obj level s5-8))) + (dotimes (s5-8 (-> this length)) + (let ((s4-8 (-> this level s5-8))) (when (= (-> s4-8 status) 'active) (when (nonzero? (-> s4-8 bsp region-trees)) (let* ((s3-5 (-> s4-8 bsp region-trees length)) @@ -1773,15 +1777,15 @@ ) ;; definition for method 22 of type entity-camera -(defmethod birth! entity-camera ((obj entity-camera)) - (add-connection *camera-engine* *camera* nothing obj #f #f) - obj +(defmethod birth! entity-camera ((this entity-camera)) + (add-connection *camera-engine* *camera* nothing this #f #f) + this ) ;; definition for method 23 of type entity-camera -(defmethod kill! entity-camera ((obj entity-camera)) - (remove-by-param1 *camera-engine* (the-as int obj)) - obj +(defmethod kill! entity-camera ((this entity-camera)) + (remove-by-param1 *camera-engine* (the-as int this)) + this ) ;; definition for function init-entity @@ -1796,8 +1800,8 @@ ) ;; definition for method 22 of type entity-actor -(defmethod birth! entity-actor ((obj entity-actor)) - (let* ((s5-0 (-> obj etype)) +(defmethod birth! entity-actor ((this entity-actor)) + (let* ((s5-0 (-> this etype)) (v1-0 (entity-info-lookup s5-0)) (s4-0 (get-process *default-dead-pool* s5-0 (if v1-0 (-> v1-0 heap-size) @@ -1816,17 +1820,17 @@ (valid? (method-of-object s4-0 init-from-entity!) function (the-as string #f) #f 0) ) ) - (init-entity s4-0 obj s5-0) + (init-entity s4-0 this s5-0) ) (else - (when (not (birth-viewer s4-0 obj)) - (format 0 "ERROR: no proper process type named ~A exists in the code, could not start ~A~%" s5-0 obj) - (logior! (-> obj extra perm status) (entity-perm-status bit-0)) + (when (not (birth-viewer s4-0 this)) + (format 0 "ERROR: no proper process type named ~A exists in the code, could not start ~A~%" s5-0 this) + (logior! (-> this extra perm status) (entity-perm-status bit-0)) ) ) ) ) - obj + this ) ;; definition for function entity-deactivate-handler @@ -1840,14 +1844,14 @@ ) ;; definition for method 23 of type entity-actor -(defmethod kill! entity-actor ((obj entity-actor)) - (let ((a0-1 (-> obj extra process))) +(defmethod kill! entity-actor ((this entity-actor)) + (let ((a0-1 (-> this extra process))) (if a0-1 (deactivate a0-1) - (entity-deactivate-handler a0-1 obj) + (entity-deactivate-handler a0-1 this) ) ) - obj + this ) ;; definition for method 17 of type bsp-header @@ -1855,50 +1859,50 @@ ;; WARN: Return type mismatch bsp-header vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 s5, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod birth bsp-header ((obj bsp-header)) +(defmethod birth bsp-header ((this bsp-header)) (local-vars (v1-74 int) (s5-0 int) (sv-16 int)) (.mfc0 s5-0 Count) - (let ((a2-0 (if (nonzero? (-> obj actors)) - (-> obj actors length) + (let ((a2-0 (if (nonzero? (-> this actors)) + (-> this actors length) 0 ) ) ) (cond - ((not (-> obj level entity)) - (set! (-> obj level entity) (new 'loading-level 'entity-links-array a2-0)) + ((not (-> this level entity)) + (set! (-> this level entity) (new 'loading-level 'entity-links-array a2-0)) ) - ((< (-> obj level entity allocated-length) a2-0) + ((< (-> this level entity allocated-length) a2-0) (format 0 "ERROR: Attempting to rebirth level ~A with incorrect entity table size ~D/~D~%" - (-> obj level) + (-> this level) a2-0 - (-> obj level entity allocated-length) + (-> this level entity allocated-length) ) ) ) ) - (set! (-> obj level entity length) 0) + (set! (-> this level entity length) 0) 0 - (when (nonzero? (-> obj actors)) - (dotimes (s4-0 (-> obj actors length)) - (let* ((a0-4 (-> obj actor-birth-order s4-0)) - (v1-23 (-> obj actors data (logand a0-4 #xffff) actor)) + (when (nonzero? (-> this actors)) + (dotimes (s4-0 (-> this actors length)) + (let* ((a0-4 (-> this actor-birth-order s4-0)) + (v1-23 (-> this actors data (logand a0-4 #xffff) actor)) ) - (add-to-level! v1-23 *level* (-> obj level) (the-as actor-id (-> v1-23 aid))) + (add-to-level! v1-23 *level* (-> this level) (the-as actor-id (-> v1-23 aid))) ) ) ) - (let ((s4-1 (-> obj cameras))) + (let ((s4-1 (-> this cameras))) (when (nonzero? s4-1) (dotimes (s3-0 (-> s4-1 length)) (birth! (-> s4-1 s3-0)) ) ) ) - (let ((s4-2 (-> obj level status))) - (set! (-> obj level status) 'active) + (let ((s4-2 (-> this level status))) + (set! (-> this level status) 'active) (dotimes (s3-1 (-> *level* length)) (let ((s2-0 (-> *level* level s3-1))) (when (= (-> s2-0 status) 'active) @@ -1918,7 +1922,7 @@ ) ) ) - (set! (-> obj level status) s4-2) + (set! (-> this level status) s4-2) ) (.mfc0 v1-74 Count) (let ((a3-2 (- v1-74 s5-0))) @@ -2035,13 +2039,13 @@ ;; definition for method 18 of type bsp-header ;; WARN: Return type mismatch bsp-header vs none. -(defmethod deactivate-entities bsp-header ((obj bsp-header)) - (let ((v1-1 (-> obj level heap base)) - (a0-2 (-> obj level heap top-base)) +(defmethod deactivate-entities bsp-header ((this bsp-header)) + (let ((v1-1 (-> this level heap base)) + (a0-2 (-> this level heap top-base)) ) - (when (nonzero? (-> obj actor-groups)) - (dotimes (a1-2 (-> obj actor-groups length)) - (let ((a2-2 (-> obj actor-groups a1-2))) + (when (nonzero? (-> this actor-groups)) + (dotimes (a1-2 (-> this actor-groups length)) + (let ((a2-2 (-> this actor-groups a1-2))) (dotimes (a3-1 (-> a2-2 length)) (let ((t0-2 (-> a2-2 data a3-1 actor))) (if (and t0-2 (not (and (>= (the-as int t0-2) (the-as int v1-1)) (< (the-as int t0-2) (the-as int a0-2))))) @@ -2055,7 +2059,7 @@ (dotimes (a1-5 (-> *level* length)) (let ((a2-10 (-> *level* level a1-5))) (when (= (-> a2-10 status) 'active) - (when (!= a2-10 (-> obj level)) + (when (!= a2-10 (-> this level)) (when (nonzero? (-> a2-10 bsp actor-groups)) (dotimes (a3-10 (-> a2-10 bsp actor-groups length)) (let ((t0-13 (-> a2-10 bsp actor-groups a3-10))) @@ -2074,7 +2078,7 @@ ) ) ) - (let ((s5-0 (-> obj actors))) + (let ((s5-0 (-> this actors))) (when (nonzero? s5-0) (dotimes (s4-0 (-> s5-0 length)) (let ((s3-0 (-> s5-0 data s4-0 actor))) @@ -2084,15 +2088,15 @@ ) ) ) - (let ((s5-1 (-> obj cameras))) + (let ((s5-1 (-> this cameras))) (when (nonzero? s5-1) (dotimes (s4-1 (-> s5-1 length)) (kill! (-> s5-1 s4-1)) ) ) ) - (let ((v1-23 (-> obj level heap base)) - (a0-7 (-> obj level heap top-base)) + (let ((v1-23 (-> this level heap base)) + (a0-7 (-> this level heap top-base)) (s5-2 (lambda ((arg0 process)) (check-for-rougue-process arg0 (-> *kernel-context* relocating-min) @@ -2104,12 +2108,12 @@ ) (set! (-> *kernel-context* relocating-min) (the-as int v1-23)) (set! (-> *kernel-context* relocating-max) (the-as int a0-7)) - (set! (-> *kernel-context* relocating-level) (-> obj level)) + (set! (-> *kernel-context* relocating-level) (-> this level)) (iterate-process-tree *pusher-pool* s5-2 *null-kernel-context*) (iterate-process-tree *entity-pool* s5-2 *null-kernel-context*) (iterate-process-tree *default-pool* s5-2 *null-kernel-context*) ) - (let ((s5-3 (-> obj nav-meshes))) + (let ((s5-3 (-> this nav-meshes))) (when (nonzero? s5-3) (dotimes (s4-2 (-> s5-3 length)) (kill! (-> s5-3 s4-2)) @@ -2145,34 +2149,34 @@ ) ;; definition for method 9 of type entity-perm -(defmethod update entity-perm ((obj entity-perm) (arg0 symbol) (arg1 entity-perm-status)) +(defmethod update entity-perm ((this entity-perm) (arg0 symbol) (arg1 entity-perm-status)) (cond ((= arg0 'game) - (logclear! (-> obj status) arg1) + (logclear! (-> this status) arg1) ) - ((task-complete? *game-info* (-> obj task)) - (logclear! (-> obj status) (logior (if (logtest? (-> obj status) (entity-perm-status bit-4)) - 524 - 0 - ) - 515 - ) + ((task-complete? *game-info* (-> this task)) + (logclear! (-> this status) (logior (if (logtest? (-> this status) (entity-perm-status bit-4)) + 524 + 0 + ) + 515 + ) ) ) (else - (logclear! (-> obj status) (logior arg1 (if (logtest? (-> obj status) (entity-perm-status bit-4)) - 524 - 0 - ) - ) + (logclear! (-> this status) (logior arg1 (if (logtest? (-> this status) (entity-perm-status bit-4)) + 524 + 0 + ) + ) ) ) ) - (when (not (logtest? (-> obj status) (entity-perm-status bit-5))) - (set! (-> obj user-uint64) (the-as uint 0)) + (when (not (logtest? (-> this status) (entity-perm-status bit-5))) + (set! (-> this user-uint64) (the-as uint 0)) 0 ) - obj + this ) ;; definition for function reset-actors @@ -2281,21 +2285,21 @@ ) ;; definition for method 12 of type process-drawable -(defmethod run-logic? process-drawable ((obj process-drawable)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) +(defmethod run-logic? process-drawable ((this process-drawable)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-control-status uninited))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) ) ) ) ;; definition for method 9 of type entity-links -(defmethod birth? entity-links ((obj entity-links) (arg0 vector)) - (and (not (logtest? (-> obj perm status) (entity-perm-status bit-0 dead))) - (< (vector-vector-distance (-> obj trans) arg0) (-> *ACTOR-bank* birth-dist)) +(defmethod birth? entity-links ((this entity-links) (arg0 vector)) + (and (not (logtest? (-> this perm status) (entity-perm-status bit-0 dead))) + (< (vector-vector-distance (-> this trans) arg0) (-> *ACTOR-bank* birth-dist)) ) ) @@ -2307,7 +2311,7 @@ ;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 17 level-group) has a return type of none, but the expression builder found a return statement. -(defmethod actors-update level-group ((obj level-group)) +(defmethod actors-update level-group ((this level-group)) (local-vars (sv-16 vector) (sv-24 int) @@ -2353,8 +2357,8 @@ ) ) (set! sv-24 0) - (dotimes (s5-2 (-> obj length)) - (let ((s4-1 (-> obj level s5-2))) + (dotimes (s5-2 (-> this length)) + (let ((s4-1 (-> this level s5-2))) (when (= (-> s4-1 status) 'active) (set! sv-32 (-> s4-1 task-mask)) (cond @@ -2543,8 +2547,8 @@ ;; definition for method 30 of type entity-actor ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod toggle-status entity-actor ((obj entity-actor) (arg0 entity-perm-status) (arg1 symbol)) - (let ((v1-0 (-> obj extra))) +(defmethod toggle-status entity-actor ((this entity-actor) (arg0 entity-perm-status) (arg1 symbol)) + (let ((v1-0 (-> this extra))) (if arg1 (logior! (-> v1-0 perm status) arg0) (logclear! (-> v1-0 perm status) arg0) diff --git a/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc b/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc index ff64be601e..1587e9d3b3 100644 --- a/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/relocate_REF.gc @@ -2,22 +2,22 @@ (in-package goal) ;; definition for method 7 of type process -(defmethod relocate process ((obj process) (arg0 int)) +(defmethod relocate process ((this process) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (&+! (-> obj ppointer 0) arg0) - (let ((v1-5 (-> obj entity))) - (if (and v1-5 (= (-> v1-5 extra process) obj)) + (&+! (-> this ppointer 0) arg0) + (let ((v1-5 (-> this entity))) + (if (and v1-5 (= (-> v1-5 extra process) this)) (&+! (-> v1-5 extra process) arg0) ) ) - (let ((v1-7 (-> obj connection-list next1))) + (let ((v1-7 (-> this connection-list next1))) (while (the-as connection v1-7) (let ((a0-14 (-> v1-7 prev1))) (if (and (>= (the-as int a0-14) (-> *kernel-context* relocating-min)) @@ -46,33 +46,33 @@ (set! v1-7 (-> (the-as connection v1-7) next1)) ) ) - (let ((v1-10 (-> obj self))) + (let ((v1-10 (-> this self))) (if (and (>= (the-as int v1-10) (-> *kernel-context* relocating-min)) (< (the-as int v1-10) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj self) arg0) + (&+! (-> this self) arg0) ) ) - (let ((v1-15 (-> obj ppointer))) + (let ((v1-15 (-> this ppointer))) (if (and (>= (the-as int v1-15) (-> *kernel-context* relocating-min)) (< (the-as int v1-15) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj ppointer) arg0) + (&+! (-> this ppointer) arg0) ) ) - (let ((s4-0 (&+ (-> obj heap-base) 4))) - (while (< (the-as int s4-0) (the-as int (-> obj heap-cur))) + (let ((s4-0 (&+ (-> this heap-base) 4))) + (while (< (the-as int s4-0) (the-as int (-> this heap-cur))) (relocate s4-0 arg0) (&+! s4-0 (logand -16 (+ (asize-of s4-0) 15))) ) ) - (&+! (-> obj main-thread) arg0) - (&+! (-> obj top-thread) arg0) - (&+! (-> obj heap-base) arg0) - (&+! (-> obj heap-cur) arg0) - (&+! (-> obj heap-top) arg0) - (let ((a2-4 (asize-of obj)) - (a1-22 (&-> obj type)) + (&+! (-> this main-thread) arg0) + (&+! (-> this top-thread) arg0) + (&+! (-> this heap-base) arg0) + (&+! (-> this heap-cur) arg0) + (&+! (-> this heap-top) arg0) + (let ((a2-4 (asize-of this)) + (a1-22 (&-> this type)) ) (cond ((>= arg0 0) @@ -87,150 +87,150 @@ ) ) (set! (-> *kernel-context* relocating-process) #f) - (&+ obj arg0) + (&+ this arg0) ) ;; definition for method 7 of type cpu-thread -(defmethod relocate cpu-thread ((obj cpu-thread) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate cpu-thread ((this cpu-thread) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type process-drawable ;; WARN: Return type mismatch process vs process-drawable. -(defmethod relocate process-drawable ((obj process-drawable) (arg0 int)) +(defmethod relocate process-drawable ((this process-drawable) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (let ((a0-6 (-> obj nav))) + (let ((a0-6 (-> this nav))) (if (and (nonzero? a0-6) a0-6) (relocate a0-6 arg0) ) ) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj node-list)) - (&+! (-> obj node-list) arg0) + (if (nonzero? (-> this node-list)) + (&+! (-> this node-list) arg0) ) - (if (nonzero? (-> obj draw)) - (&+! (-> obj draw) arg0) + (if (nonzero? (-> this draw)) + (&+! (-> this draw) arg0) ) - (if (nonzero? (-> obj skel)) - (&+! (-> obj skel) arg0) + (if (nonzero? (-> this skel)) + (&+! (-> this skel) arg0) ) - (if (nonzero? (-> obj align)) - (&+! (-> obj align) arg0) + (if (nonzero? (-> this align)) + (&+! (-> this align) arg0) ) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - (if (nonzero? (-> obj vol)) - (&+! (-> obj vol) arg0) + (if (nonzero? (-> this vol)) + (&+! (-> this vol) arg0) ) - (if (nonzero? (-> obj fact)) - (&+! (-> obj fact) arg0) + (if (nonzero? (-> this fact)) + (&+! (-> this fact) arg0) ) - (if (nonzero? (-> obj link)) - (&+! (-> obj link) arg0) + (if (nonzero? (-> this link)) + (&+! (-> this link) arg0) ) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (if (nonzero? (-> obj water)) - (&+! (-> obj water) arg0) + (if (nonzero? (-> this water)) + (&+! (-> this water) arg0) ) - (if (nonzero? (-> obj sound)) - (&+! (-> obj sound) arg0) + (if (nonzero? (-> this sound)) + (&+! (-> this sound) arg0) ) - (if (nonzero? (-> obj carry)) - (&+! (-> obj carry) arg0) + (if (nonzero? (-> this carry)) + (&+! (-> this carry) arg0) ) - (if (nonzero? (-> obj rbody)) - (&+! (-> obj rbody) arg0) + (if (nonzero? (-> this rbody)) + (&+! (-> this rbody) arg0) ) - (the-as process-drawable ((method-of-type process relocate) obj arg0)) + (the-as process-drawable ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type collide-shape -(defmethod relocate collide-shape ((obj collide-shape) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj root-prim) arg0) - obj +(defmethod relocate collide-shape ((this collide-shape) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this root-prim) arg0) + this ) ;; definition for method 7 of type collide-shape-moving ;; WARN: Return type mismatch collide-shape vs collide-shape-moving. -(defmethod relocate collide-shape-moving ((obj collide-shape-moving) (arg0 int)) - (if (-> obj dynam) - (&+! (-> obj dynam) arg0) +(defmethod relocate collide-shape-moving ((this collide-shape-moving) (arg0 int)) + (if (-> this dynam) + (&+! (-> this dynam) arg0) ) - (the-as collide-shape-moving ((method-of-type collide-shape relocate) obj arg0)) + (the-as collide-shape-moving ((method-of-type collide-shape relocate) this arg0)) ) ;; definition for method 7 of type collide-shape-prim -(defmethod relocate collide-shape-prim ((obj collide-shape-prim) (arg0 int)) - (&+! (-> obj cshape) arg0) - obj +(defmethod relocate collide-shape-prim ((this collide-shape-prim) (arg0 int)) + (&+! (-> this cshape) arg0) + this ) ;; definition for method 7 of type collide-shape-prim-group -(defmethod relocate collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 int)) - (&+! (-> obj cshape) arg0) - (set! (-> obj child) (the-as (inline-array collide-shape-prim) (&+ (the-as pointer (-> obj child)) arg0))) - obj +(defmethod relocate collide-shape-prim-group ((this collide-shape-prim-group) (arg0 int)) + (&+! (-> this cshape) arg0) + (set! (-> this child) (the-as (inline-array collide-shape-prim) (&+ (the-as pointer (-> this child)) arg0))) + this ) ;; definition for method 7 of type fact-info -(defmethod relocate fact-info ((obj fact-info) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate fact-info ((this fact-info) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type draw-control -(defmethod relocate draw-control ((obj draw-control) (arg0 int)) - (&+! (-> obj skeleton) arg0) - (&+! (-> obj process) arg0) - (when (-> obj ripple) - (if (-> obj ripple query) - (&+! (-> obj ripple query) arg0) +(defmethod relocate draw-control ((this draw-control) (arg0 int)) + (&+! (-> this skeleton) arg0) + (&+! (-> this process) arg0) + (when (-> this ripple) + (if (-> this ripple query) + (&+! (-> this ripple query) arg0) ) - (&+! (-> obj ripple) arg0) + (&+! (-> this ripple) arg0) ) - (let ((v1-14 (-> obj shadow-ctrl))) + (let ((v1-14 (-> this shadow-ctrl))) (if (and (>= (the-as int v1-14) (-> *kernel-context* relocating-min)) (< (the-as int v1-14) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj shadow-ctrl) arg0) + (&+! (-> this shadow-ctrl) arg0) ) ) - obj + this ) ;; definition for method 7 of type joint-control -(defmethod relocate joint-control ((obj joint-control) (arg0 int)) - (if (-> obj effect) - (&+! (-> obj effect) arg0) +(defmethod relocate joint-control ((this joint-control) (arg0 int)) + (if (-> this effect) + (&+! (-> this effect) arg0) ) - (if (-> obj top-anim) - (&+! (-> obj top-anim) arg0) + (if (-> this top-anim) + (&+! (-> this top-anim) arg0) ) - (&+! (-> obj root-channel) arg0) - (countdown (v1-10 (-> obj allocated-length)) - (&+! (-> obj channel v1-10 parent) arg0) + (&+! (-> this root-channel) arg0) + (countdown (v1-10 (-> this allocated-length)) + (&+! (-> this channel v1-10 parent) arg0) ) - obj + this ) ;; definition for method 7 of type cspace-array -(defmethod relocate cspace-array ((obj cspace-array) (arg0 int)) - (countdown (v1-0 (-> obj length)) - (let ((a2-2 (-> obj data v1-0))) +(defmethod relocate cspace-array ((this cspace-array) (arg0 int)) + (countdown (v1-0 (-> this length)) + (let ((a2-2 (-> this data v1-0))) (if (-> a2-2 parent) (&+! (-> a2-2 parent) arg0) ) @@ -251,69 +251,69 @@ ) ) ) - obj + this ) ;; definition for method 7 of type path-control -(defmethod relocate path-control ((obj path-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate path-control ((this path-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type vol-control -(defmethod relocate vol-control ((obj vol-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate vol-control ((this vol-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type water-control -(defmethod relocate water-control ((obj water-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate water-control ((this water-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type actor-link-info -(defmethod relocate actor-link-info ((obj actor-link-info) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate actor-link-info ((this actor-link-info) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type align-control -(defmethod relocate align-control ((obj align-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate align-control ((this align-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type joint-mod -(defmethod relocate joint-mod ((obj joint-mod) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj joint) arg0) - obj +(defmethod relocate joint-mod ((this joint-mod) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this joint) arg0) + this ) ;; definition for method 7 of type joint-mod-wheel -(defmethod relocate joint-mod-wheel ((obj joint-mod-wheel) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate joint-mod-wheel ((this joint-mod-wheel) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type joint-mod-ik -(defmethod relocate joint-mod-ik ((obj joint-mod-ik) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate joint-mod-ik ((this joint-mod-ik) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type effect-control -(defmethod relocate effect-control ((obj effect-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate effect-control ((this effect-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 7 of type sparticle-launch-control -(defmethod relocate sparticle-launch-control ((obj sparticle-launch-control) (arg0 int)) - (&+! (-> obj proc) arg0) - (countdown (v1-2 (-> obj length)) - (let* ((a0-4 (-> obj data v1-2)) +(defmethod relocate sparticle-launch-control ((this sparticle-launch-control) (arg0 int)) + (&+! (-> this proc) arg0) + (countdown (v1-2 (-> this length)) + (let* ((a0-4 (-> this data v1-2)) (a2-0 (-> a0-4 center)) ) (if (and (>= (the-as int a2-0) (-> *kernel-context* relocating-min)) @@ -324,7 +324,7 @@ ) ) (forall-particles-with-key - obj + this (lambda ((arg0 sparticle-system) (arg1 sparticle-cpuinfo)) (let ((v1-1 (-> *kernel-context* relocating-offset))) (set! (-> arg1 key) (the-as sparticle-launch-control (+ (the-as int (-> arg1 key)) v1-1))) @@ -338,86 +338,86 @@ #t #t ) - obj + this ) ;; definition for method 7 of type camera-master ;; WARN: Return type mismatch process vs camera-master. -(defmethod relocate camera-master ((obj camera-master) (arg0 int)) - (if (nonzero? (-> obj water-drip)) - (&+! (-> obj water-drip) arg0) +(defmethod relocate camera-master ((this camera-master) (arg0 int)) + (if (nonzero? (-> this water-drip)) + (&+! (-> this water-drip) arg0) ) - (the-as camera-master ((method-of-type process relocate) obj arg0)) + (the-as camera-master ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type time-of-day-proc ;; WARN: Return type mismatch process vs time-of-day-proc. -(defmethod relocate time-of-day-proc ((obj time-of-day-proc) (arg0 int)) - (if (nonzero? (-> obj sun)) - (&+! (-> obj sun) arg0) +(defmethod relocate time-of-day-proc ((this time-of-day-proc) (arg0 int)) + (if (nonzero? (-> this sun)) + (&+! (-> this sun) arg0) ) - (if (nonzero? (-> obj green-sun)) - (&+! (-> obj green-sun) arg0) + (if (nonzero? (-> this green-sun)) + (&+! (-> this green-sun) arg0) ) - (if (nonzero? (-> obj moon)) - (&+! (-> obj moon) arg0) + (if (nonzero? (-> this moon)) + (&+! (-> this moon) arg0) ) - (the-as time-of-day-proc ((method-of-type process relocate) obj arg0)) + (the-as time-of-day-proc ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type part-tracker ;; WARN: Return type mismatch process vs part-tracker. -(defmethod relocate part-tracker ((obj part-tracker) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate part-tracker ((this part-tracker) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (the-as part-tracker ((method-of-type process relocate) obj arg0)) + (the-as part-tracker ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type part-spawner ;; WARN: Return type mismatch process vs part-spawner. -(defmethod relocate part-spawner ((obj part-spawner) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate part-spawner ((this part-spawner) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj part)) - (&+! (-> obj part) arg0) + (if (nonzero? (-> this part)) + (&+! (-> this part) arg0) ) - (if (nonzero? (-> obj sound)) - (&+! (-> obj sound) arg0) + (if (nonzero? (-> this sound)) + (&+! (-> this sound) arg0) ) - (the-as part-spawner ((method-of-type process relocate) obj arg0)) + (the-as part-spawner ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type lightning-tracker ;; WARN: Return type mismatch process vs lightning-tracker. -(defmethod relocate lightning-tracker ((obj lightning-tracker) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate lightning-tracker ((this lightning-tracker) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - (if (nonzero? (-> obj lightning)) - (&+! (-> obj lightning) arg0) + (if (nonzero? (-> this lightning)) + (&+! (-> this lightning) arg0) ) - (the-as lightning-tracker ((method-of-type process relocate) obj arg0)) + (the-as lightning-tracker ((method-of-type process relocate) this arg0)) ) ;; definition for method 7 of type manipy ;; WARN: Return type mismatch process-drawable vs manipy. -(defmethod relocate manipy ((obj manipy) (arg0 int)) - (if (nonzero? (-> obj joint 0)) - (&+! (-> obj joint 0) arg0) +(defmethod relocate manipy ((this manipy) (arg0 int)) + (if (nonzero? (-> this joint 0)) + (&+! (-> this joint 0) arg0) ) - (if (nonzero? (-> obj joint 1)) - (&+! (-> obj joint 1) arg0) + (if (nonzero? (-> this joint 1)) + (&+! (-> this joint 1) arg0) ) - (if (nonzero? (-> obj joint 2)) - (&+! (-> obj joint 2) arg0) + (if (nonzero? (-> this joint 2)) + (&+! (-> this joint 2) arg0) ) - (if (nonzero? (-> obj joint 3)) - (&+! (-> obj joint 3) arg0) + (if (nonzero? (-> this joint 3)) + (&+! (-> this joint 3) arg0) ) - (the-as manipy ((method-of-type process-drawable relocate) obj arg0)) + (the-as manipy ((method-of-type process-drawable relocate) this arg0)) ) diff --git a/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc index 78b8a5dd75..b340aec78c 100644 --- a/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc @@ -48,21 +48,21 @@ ;; definition for method 3 of type res-lump ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect res-lump ((obj res-lump)) - (when (not obj) - (set! obj obj) +(defmethod inspect res-lump ((this res-lump)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata-base: #x~X~%" (-> obj data-base)) - (format #t "~1Tdata-top: #x~X~%" (-> obj data-top)) - (format #t "~1Tdata-size: ~D~%" (-> obj data-size)) - (format #t "~1Textra: ~A~%" (-> obj extra)) - (format #t "~1Ttag: #x~X~%" (-> obj tag)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata-base: #x~X~%" (-> this data-base)) + (format #t "~1Tdata-top: #x~X~%" (-> this data-top)) + (format #t "~1Tdata-size: ~D~%" (-> this data-size)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (format #t "~1Ttag: #x~X~%" (-> this tag)) (label cfg-4) - obj + this ) ;; definition for symbol *res-key-string*, type string diff --git a/test/decompiler/reference/jak2/engine/entity/res_REF.gc b/test/decompiler/reference/jak2/engine/entity/res_REF.gc index 6556db1b6b..958968259e 100644 --- a/test/decompiler/reference/jak2/engine/entity/res_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/res_REF.gc @@ -2,47 +2,47 @@ (in-package goal) ;; definition for method 2 of type res-tag -(defmethod print res-tag ((obj res-tag)) - (if (zero? (-> obj inlined?)) +(defmethod print res-tag ((this res-tag)) + (if (zero? (-> this inlined?)) (format #t "#" - (-> obj name) - (-> obj key-frame) - (-> obj elt-type) - (-> obj elt-count) + (-> this name) + (-> this key-frame) + (-> this elt-type) + (-> this elt-count) ) (format #t "#" - (-> obj name) - (-> obj key-frame) - (-> obj elt-type) - (-> obj elt-count) + (-> this name) + (-> this key-frame) + (-> this elt-type) + (-> this elt-count) ) ) - obj + this ) ;; definition for method 4 of type res-tag ;; WARN: Return type mismatch uint vs int. -(defmethod length res-tag ((obj res-tag)) - (the-as int (if (zero? (-> obj inlined?)) - (* (-> obj elt-count) 4) - (* (-> obj elt-count) (-> obj elt-type size)) +(defmethod length res-tag ((this res-tag)) + (the-as int (if (zero? (-> this inlined?)) + (* (-> this elt-count) 4) + (* (-> this elt-count) (-> this elt-type size)) ) ) ) ;; definition for method 13 of type res-lump ;; INFO: Used lq/sq -(defmethod get-tag-index-data res-lump ((obj res-lump) (arg0 int)) - (&+ (-> obj data-base) (-> obj tag arg0 data-offset)) +(defmethod get-tag-index-data res-lump ((this res-lump) (arg0 int)) + (&+ (-> this data-base) (-> this tag arg0 data-offset)) ) ;; definition for method 14 of type res-lump -(defmethod get-tag-data res-lump ((obj res-lump) (arg0 res-tag)) - (&+ (-> obj data-base) (-> arg0 data-offset)) +(defmethod get-tag-data res-lump ((this res-lump) (arg0 res-tag)) + (&+ (-> this data-base) (-> arg0 data-offset)) ) ;; definition for method 0 of type res-lump @@ -58,45 +58,45 @@ ) ;; definition for method 4 of type res-lump -(defmethod length res-lump ((obj res-lump)) - (-> obj length) +(defmethod length res-lump ((this res-lump)) + (-> this length) ) ;; definition for method 5 of type res-lump ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of res-lump ((obj res-lump)) - (the-as int (+ (-> obj type psize) (* (-> obj allocated-length) 16) (-> obj data-size))) +(defmethod asize-of res-lump ((this res-lump)) + (the-as int (+ (-> this type psize) (* (-> this allocated-length) 16) (-> this data-size))) ) ;; definition for method 3 of type res-lump ;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect res-lump ((obj res-lump)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata-base: #x~X~%" (-> obj data-base)) - (format #t "~Tdata-top: #x~X~%" (-> obj data-top)) - (format #t "~Tdata-size: #x~X~%" (-> obj data-size)) - (format #t "~Ttag[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj tag)) - (dotimes (s5-0 (-> obj length)) +(defmethod inspect res-lump ((this res-lump)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata-base: #x~X~%" (-> this data-base)) + (format #t "~Tdata-top: #x~X~%" (-> this data-top)) + (format #t "~Tdata-size: #x~X~%" (-> this data-size)) + (format #t "~Ttag[~D]: @ #x~X~%" (-> this allocated-length) (-> this tag)) + (dotimes (s5-0 (-> this length)) (format #t "~T [~D] " s5-0) - (print (-> obj tag s5-0)) + (print (-> this tag s5-0)) (let ((t9-10 format) (a0-12 #t) (a1-9 " @ #x~X") - (a3-2 obj) + (a3-2 this) (a2-9 s5-0) ) (t9-10 a0-12 a1-9 (&+ (-> a3-2 data-base) (-> a3-2 tag a2-9 data-offset))) ) (cond - ((zero? (-> obj tag s5-0 inlined?)) + ((zero? (-> this tag s5-0 inlined?)) (let ((t9-11 format) (a0-14 #t) (a1-10 " = ~A~%") - (a3-4 obj) + (a3-4 this) (a2-17 s5-0) ) (t9-11 a0-14 a1-10 (-> (the-as (pointer uint32) (&+ (-> a3-4 data-base) (-> a3-4 tag a2-17 data-offset))))) @@ -107,13 +107,13 @@ ) ) ) - obj + this ) ;; definition for method 19 of type res-lump ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs res-tag-pair. -(defmethod lookup-tag-idx res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) +(defmethod lookup-tag-idx res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) (local-vars (t4-1 int)) (when (or (= arg0 'id) (= arg0 'aid) @@ -126,7 +126,7 @@ (crash!) 0 ) - (if (or (not obj) (zero? obj) (<= (-> obj length) 0)) + (if (or (not this) (zero? this) (<= (-> this length) 0)) (return (new 'static 'res-tag-pair :lo #xffffffff :hi #xffffffff)) ) (let ((v1-14 -1) @@ -135,12 +135,12 @@ (let ((t1-0 -1) (t2-4 (-> (the-as (pointer uint64) (-> (symbol->string arg0) data)) 0)) ) - (let ((t3-1 (+ (-> obj length) -1)) + (let ((t3-1 (+ (-> this length) -1)) (t4-0 0) ) (while (>= t3-1 t4-0) (let* ((t5-2 (+ t4-0 (/ (- t3-1 t4-0) 2))) - (t6-5 (- t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag t5-2 name)) data)) 0))) + (t6-5 (- t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> this tag t5-2 name)) data)) 0))) ) (cond ((zero? t6-5) @@ -163,7 +163,7 @@ (return (the-as res-tag-pair t4-1)) ) (while (and (> t4-1 0) - (= t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag (+ t4-1 -1) name)) data)) 0)) + (= t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> this tag (+ t4-1 -1) name)) data)) 0)) ) (+! t4-1 -1) ) @@ -173,9 +173,9 @@ (goto cfg-73) ) (let ((t3-13 t4-1) - (t4-4 (&-> (-> obj tag) t4-1)) + (t4-4 (&-> (-> this tag) t4-1)) ) - (while (not (or (>= t3-13 (-> obj length)) + (while (not (or (>= t3-13 (-> this length)) (< t2-4 (-> (&+ (the-as (pointer uint64) (symbol->string (-> t4-4 0 name))) 4) 0)) ) ) @@ -213,19 +213,19 @@ ;; definition for method 20 of type res-lump ;; INFO: Used lq/sq -(defmethod make-property-data res-lump ((obj res-lump) (arg0 float) (arg1 res-tag-pair) (arg2 pointer)) +(defmethod make-property-data res-lump ((this res-lump) (arg0 float) (arg1 res-tag-pair) (arg2 pointer)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) ) - (let* ((t0-2 (-> obj tag (-> arg1 lo))) - (t1-2 (-> obj tag (-> arg1 hi))) + (let* ((t0-2 (-> this tag (-> arg1 lo))) + (t1-2 (-> this tag (-> arg1 hi))) (v1-6 (-> t0-2 elt-count)) ) (cond ((zero? (-> t0-2 inlined?)) - (&+ (-> obj data-base) (-> t0-2 data-offset)) + (&+ (-> this data-base) (-> t0-2 data-offset)) ) ((or (not arg2) (= (-> arg1 lo) (-> arg1 hi)) @@ -233,15 +233,15 @@ (!= (-> t0-2 elt-type) (-> t1-2 elt-type)) ) (let ((a0-4 t0-2)) - (&+ (-> obj data-base) (-> a0-4 data-offset)) + (&+ (-> this data-base) (-> a0-4 data-offset)) ) ) (else (let* ((f0-2 (/ (- arg0 (-> t0-2 key-frame)) (- (-> t1-2 key-frame) (-> t0-2 key-frame)))) - (a1-4 obj) + (a1-4 this) (a2-7 t0-2) (a1-6 (&+ (-> a1-4 data-base) (-> a2-7 data-offset))) - (a2-13 (&+ (-> obj data-base) (-> t1-2 data-offset))) + (a2-13 (&+ (-> this data-base) (-> t1-2 data-offset))) ) (case (-> t0-2 elt-type symbol) (('float) @@ -382,7 +382,7 @@ ) (else (let ((a0-27 t0-2)) - (&+ (-> obj data-base) (-> a0-27 data-offset)) + (&+ (-> this data-base) (-> a0-27 data-offset)) ) ) ) @@ -395,7 +395,7 @@ ;; definition for method 9 of type res-lump ;; INFO: Used lq/sq -(defmethod get-property-data res-lump ((obj res-lump) +(defmethod get-property-data res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) @@ -403,15 +403,15 @@ (arg4 (pointer res-tag)) (arg5 pointer) ) - (let ((s3-0 (lookup-tag-idx obj arg0 arg1 arg2))) + (let ((s3-0 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int s3-0) 0) (empty) ) (else - (set! arg3 (make-property-data obj arg2 s3-0 arg5)) + (set! arg3 (make-property-data this arg2 s3-0 arg5)) (if arg4 - (set! (-> arg4 0) (-> obj tag (-> s3-0 lo))) + (set! (-> arg4 0) (-> this tag (-> s3-0 lo))) ) ) ) @@ -422,7 +422,7 @@ ;; definition for method 10 of type res-lump ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs structure. -(defmethod get-property-struct res-lump ((obj res-lump) +(defmethod get-property-struct res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) @@ -430,14 +430,14 @@ (arg4 (pointer res-tag)) (arg5 pointer) ) - (let ((s3-0 (lookup-tag-idx obj arg0 arg1 arg2))) + (let ((s3-0 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int s3-0) 0) (empty) ) (else - (set! arg3 (the-as structure (make-property-data obj arg2 s3-0 arg5))) - (let ((v1-4 (-> obj tag (-> s3-0 lo)))) + (set! arg3 (the-as structure (make-property-data this arg2 s3-0 arg5))) + (let ((v1-4 (-> this tag (-> s3-0 lo)))) (if arg4 (set! (-> arg4 0) v1-4) ) @@ -455,7 +455,7 @@ ;; definition for method 11 of type res-lump ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs uint128. -(defmethod get-property-value res-lump ((obj res-lump) +(defmethod get-property-value res-lump ((this res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) @@ -463,16 +463,16 @@ (arg4 (pointer res-tag)) (arg5 pointer) ) - (let ((a2-1 (lookup-tag-idx obj arg0 arg1 arg2))) + (let ((a2-1 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int a2-1) 0) (empty) ) (else (let* ((a0-2 (-> a2-1 lo)) - (s1-0 (-> obj tag a0-2)) + (s1-0 (-> this tag a0-2)) (s0-0 (-> s1-0 elt-type)) - (gp-1 (make-property-data obj arg2 a2-1 arg5)) + (gp-1 (make-property-data this arg2 a2-1 arg5)) ) (if arg4 (set! (-> arg4 0) s1-0) @@ -532,18 +532,25 @@ ;; definition for method 12 of type res-lump ;; INFO: Used lq/sq -(defmethod get-property-value-float res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) (arg3 float) (arg4 (pointer res-tag)) (arg5 pointer)) +(defmethod get-property-value-float res-lump ((this res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 float) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) (local-vars (v1-8 uint) (v1-11 int)) - (let ((a2-1 (lookup-tag-idx obj arg0 arg1 arg2))) + (let ((a2-1 (lookup-tag-idx this arg0 arg1 arg2))) (cond ((< (the-as int a2-1) 0) (empty) ) (else (let* ((a0-2 (-> a2-1 lo)) - (s1-0 (-> obj tag a0-2)) + (s1-0 (-> this tag a0-2)) (s0-0 (-> s1-0 elt-type)) - (gp-1 (make-property-data obj arg2 a2-1 arg5)) + (gp-1 (make-property-data this arg2 a2-1 arg5)) ) (if arg4 (set! (-> arg4 0) s1-0) @@ -605,23 +612,23 @@ ;; definition for method 16 of type res-lump ;; INFO: Used lq/sq -(defmethod sort! res-lump ((obj res-lump)) +(defmethod sort! res-lump ((this res-lump)) (let ((v1-0 -1)) (while (nonzero? v1-0) (set! v1-0 0) (let ((a1-0 0) - (a2-1 (+ (-> obj length) -2)) + (a2-1 (+ (-> this length) -2)) ) (while (>= a2-1 a1-0) - (let* ((a3-2 (-> obj tag a1-0)) - (t0-3 (-> obj tag (+ a1-0 1))) + (let* ((a3-2 (-> this tag a1-0)) + (t0-3 (-> this tag (+ a1-0 1))) (t1-6 (-> (the-as (pointer uint64) (-> (symbol->string (-> a3-2 name)) data)) 0)) (t2-6 (-> (the-as (pointer uint64) (-> (symbol->string (-> t0-3 name)) data)) 0)) ) (when (or (< t2-6 t1-6) (and (= t1-6 t2-6) (< (-> t0-3 key-frame) (-> a3-2 key-frame)))) (+! v1-0 1) - (set! (-> obj tag a1-0) t0-3) - (set! (-> obj tag (+ a1-0 1)) a3-2) + (set! (-> this tag a1-0) t0-3) + (set! (-> this tag (+ a1-0 1)) a3-2) ) ) (+! a1-0 1) @@ -629,15 +636,15 @@ ) ) ) - obj + this ) ;; definition for method 15 of type res-lump ;; INFO: Used lq/sq -(defmethod allocate-data-memory-for-tag! res-lump ((obj res-lump) (arg0 res-tag)) +(defmethod allocate-data-memory-for-tag! res-lump ((this res-lump) (arg0 res-tag)) (local-vars (resource-mem pointer)) - (let* ((tag-pair (lookup-tag-idx obj (-> arg0 name) 'exact (-> arg0 key-frame))) - (existing-tag (-> obj tag (-> tag-pair lo))) + (let* ((tag-pair (lookup-tag-idx this (-> arg0 name) 'exact (-> arg0 key-frame))) + (existing-tag (-> this tag (-> tag-pair lo))) ) 0 (if (and (>= (the-as int tag-pair) 0) (!= (-> arg0 key-frame) (-> arg0 key-frame))) @@ -649,46 +656,46 @@ (let ((data-size (length arg0))) (cond ((and (>= (the-as int tag-pair) 0) (>= (length existing-tag) data-size)) - (set! resource-mem (&+ (-> obj data-base) (-> existing-tag data-offset))) + (set! resource-mem (&+ (-> this data-base) (-> existing-tag data-offset))) (when (logtest? (the-as int resource-mem) 7) - (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) - (set! (-> obj data-top) (&+ resource-mem data-size)) + (set! resource-mem (logand -16 (&+ (-> this data-top) 15))) + (set! (-> this data-top) (&+ resource-mem data-size)) ) ) (else - (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) - (set! (-> obj data-top) (&+ resource-mem data-size)) + (set! resource-mem (logand -16 (&+ (-> this data-top) 15))) + (set! (-> this data-top) (&+ resource-mem data-size)) ) ) (let* ((a0-22 arg0) - (s4-1 (copy-and-set-field a0-22 data-offset (&- resource-mem (the-as uint (-> obj data-base))))) + (s4-1 (copy-and-set-field a0-22 data-offset (&- resource-mem (the-as uint (-> this data-base))))) ) - (when (>= (the-as int (&+ resource-mem data-size)) (the-as int (&+ (-> obj data-base) (-> obj data-size)))) + (when (>= (the-as int (&+ resource-mem data-size)) (the-as int (&+ (-> this data-base) (-> this data-size)))) (format 0 "ERROR: attempting to a new tag ~`res-tag`P data of #x~X bytes to ~A, but data memory is full.~%" s4-1 data-size - obj + this ) (return (the-as res-tag #f)) ) (cond ((< (the-as int tag-pair) 0) (cond - ((>= (-> obj length) (-> obj allocated-length)) - (format 0 "ERROR: attempting to a new tag ~`res-tag`P to ~A, but tag memory is full.~%" s4-1 obj) + ((>= (-> this length) (-> this allocated-length)) + (format 0 "ERROR: attempting to a new tag ~`res-tag`P to ~A, but tag memory is full.~%" s4-1 this) (return (the-as res-tag #f)) ) (else - (set! (-> obj tag (-> obj length)) s4-1) - (+! (-> obj length) 1) - (sort! obj) + (set! (-> this tag (-> this length)) s4-1) + (+! (-> this length) 1) + (sort! this) ) ) ) (else - (set! (-> obj tag (-> tag-pair lo)) s4-1) + (set! (-> this tag (-> tag-pair lo)) s4-1) ) ) s4-1 @@ -698,10 +705,10 @@ ) ;; definition for method 17 of type res-lump -(defmethod add-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 pointer)) - (let ((a0-2 (allocate-data-memory-for-tag! obj arg0))) +(defmethod add-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 pointer)) + (let ((a0-2 (allocate-data-memory-for-tag! this arg0))) (when a0-2 - (let* ((v1-2 obj) + (let* ((v1-2 this) (a1-1 a0-2) (s4-0 (&+ (-> v1-2 data-base) (-> a1-1 data-offset))) ) @@ -719,29 +726,36 @@ ) ) ) - obj + this ) ;; definition for method 18 of type res-lump -(defmethod add-32bit-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 object)) +(defmethod add-32bit-data! res-lump ((this res-lump) (arg0 res-tag) (arg1 object)) (local-vars (sv-16 object)) (set! sv-16 arg1) (let* ((v1-0 arg0) (a1-4 (copy-and-set-field v1-0 inlined? 1)) ) - (add-data! obj a1-4 (& sv-16)) + (add-data! this a1-4 (& sv-16)) ) ) ;; definition for method 21 of type res-lump ;; INFO: Used lq/sq -(defmethod get-curve-data! res-lump ((obj res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) +(defmethod get-curve-data! res-lump ((this res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s5-0 #f)) (set! sv-16 (new 'static 'res-tag)) - (let ((a0-2 - ((method-of-object obj get-property-data) obj arg1 'exact arg3 (the-as pointer #f) (& sv-16) *res-static-buf*) - ) + (let ((a0-2 ((method-of-object this get-property-data) + this + arg1 + 'exact + arg3 + (the-as pointer #f) + (& sv-16) + *res-static-buf* + ) + ) ) (when a0-2 (set! (-> arg0 cverts) (the-as (inline-array vector) a0-2)) @@ -756,9 +770,16 @@ (set! (-> arg0 num-cverts) 256) ) (set! sv-32 (new 'static 'res-tag)) - (let ((a0-6 - ((method-of-object obj get-property-data) obj arg2 'exact arg3 (the-as pointer #f) (& sv-32) *res-static-buf*) - ) + (let ((a0-6 ((method-of-object this get-property-data) + this + arg2 + 'exact + arg3 + (the-as pointer #f) + (& sv-32) + *res-static-buf* + ) + ) ) (when a0-6 (set! (-> arg0 knots) (the-as (pointer float) a0-6)) @@ -781,7 +802,7 @@ ;; WARN: Using new Jak 2 rtype-of ;; WARN: Using new Jak 2 rtype-of ;; WARN: Using new Jak 2 rtype-of -(defmethod mem-usage res-lump ((obj res-lump) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage res-lump ((this res-lump) (arg0 memory-usage-block) (arg1 int)) (local-vars (sv-16 int)) (let ((s3-0 48) (s2-0 "res") @@ -803,13 +824,13 @@ (set! (-> arg0 length) (max (-> arg0 length) (+ s3-0 1))) (set! (-> arg0 data s3-0 name) s2-0) (+! (-> arg0 data s3-0 count) 1) - (let ((v1-19 (asize-of obj))) + (let ((v1-19 (asize-of this))) (+! (-> arg0 data s3-0 used) v1-19) (+! (-> arg0 data s3-0 total) (logand -16 (+ v1-19 15))) ) - (dotimes (s1-0 (-> obj length)) - (when (zero? (-> obj tag s1-0 inlined?)) - (let* ((a1-4 obj) + (dotimes (s1-0 (-> this length)) + (when (zero? (-> this tag s1-0 inlined?)) + (let* ((a1-4 this) (a0-15 s1-0) (s0-0 (the-as object (-> (the-as (pointer int32) (&+ (-> a1-4 data-base) (-> a1-4 tag a0-15 data-offset)))))) ) diff --git a/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc b/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc index 05665ba37a..4df32aa2de 100644 --- a/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc @@ -27,22 +27,22 @@ ) ;; definition for method 3 of type effect-control -(defmethod inspect effect-control ((obj effect-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect effect-control ((this effect-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tflags: #x~X~%" (-> obj flags)) - (format #t "~1Tlast-frame-group: ~A~%" (-> obj last-frame-group)) - (format #t "~1Tlast-frame-num: ~f~%" (-> obj last-frame-num)) - (format #t "~1Tchannel-offset: ~D~%" (-> obj channel-offset)) - (format #t "~1Tres: ~A~%" (-> obj res)) - (format #t "~1Tname: #x~X~%" (-> obj name)) - (format #t "~1Tparam: #x~X~%" (-> obj param)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tflags: #x~X~%" (-> this flags)) + (format #t "~1Tlast-frame-group: ~A~%" (-> this last-frame-group)) + (format #t "~1Tlast-frame-num: ~f~%" (-> this last-frame-num)) + (format #t "~1Tchannel-offset: ~D~%" (-> this channel-offset)) + (format #t "~1Tres: ~A~%" (-> this res)) + (format #t "~1Tname: #x~X~%" (-> this name)) + (format #t "~1Tparam: #x~X~%" (-> this param)) (label cfg-4) - obj + this ) ;; definition for method 0 of type effect-control @@ -63,8 +63,8 @@ ;; definition for method 13 of type effect-control ;; WARN: Return type mismatch int vs none. -(defmethod set-channel-offset! effect-control ((obj effect-control) (arg0 int)) - (set! (-> obj channel-offset) arg0) +(defmethod set-channel-offset! effect-control ((this effect-control) (arg0 int)) + (set! (-> this channel-offset) arg0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc b/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc index 7d757dfa12..398cfdfe62 100644 --- a/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/effect-control_REF.gc @@ -149,10 +149,10 @@ ;; definition for method 9 of type effect-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-effects effect-control ((obj effect-control)) - (let* ((a0-1 (-> obj process skel)) - (v1-3 (if (< (the-as uint (-> obj channel-offset)) (-> a0-1 active-channels)) - (-> a0-1 root-channel (-> obj channel-offset)) +(defmethod update-effects effect-control ((this effect-control)) + (let* ((a0-1 (-> this process skel)) + (v1-3 (if (< (the-as uint (-> this channel-offset)) (-> a0-1 active-channels)) + (-> a0-1 root-channel (-> this channel-offset)) (the-as joint-control-channel #f) ) ) @@ -164,24 +164,24 @@ ) (let ((a0-3 (-> a0-1 root-channel 0 num-func))) (cond - ((!= s5-0 (-> obj last-frame-group)) - (set! (-> obj res) (-> s5-0 extra)) + ((!= s5-0 (-> this last-frame-group)) + (set! (-> this res) (-> s5-0 extra)) (let ((v1-6 (-> (lookup-tag-idx (-> s5-0 extra) 'effect-name 'base -1000000000.0) lo))) - (set! (-> obj name) (if (>= (the-as int v1-6) 0) - (&-> (-> s5-0 extra tag) v1-6) - (the-as (pointer res-tag) #f) - ) + (set! (-> this name) (if (>= (the-as int v1-6) 0) + (&-> (-> s5-0 extra tag) v1-6) + (the-as (pointer res-tag) #f) + ) ) ) - (if (and (-> obj name) (= (-> obj name 0 key-frame) -1000000000.0)) - (set! (-> obj name) (&-> (-> obj name) 1)) + (if (and (-> this name) (= (-> this name 0 key-frame) -1000000000.0)) + (set! (-> this name) (&-> (-> this name) 1)) ) - (play-effects-from-res-lump obj f30-0 f30-0 f30-0) + (play-effects-from-res-lump this f30-0 f30-0 f30-0) ) - ((or (not (-> obj name)) (= f30-0 (-> obj last-frame-num))) + ((or (not (-> this name)) (= f30-0 (-> this last-frame-num))) ) (else - (let ((f28-0 (-> obj last-frame-num)) + (let ((f28-0 (-> this last-frame-num)) (f26-0 f30-0) ) (cond @@ -190,12 +190,12 @@ (cond ((< f26-0 f28-0) (if (>= f28-0 f0-6) - (play-effects-from-res-lump obj f26-0 f28-0 f30-0) + (play-effects-from-res-lump this f26-0 f28-0 f30-0) ) ) (else (if (>= f0-6 f28-0) - (play-effects-from-res-lump obj f28-0 f26-0 f30-0) + (play-effects-from-res-lump this f28-0 f26-0 f30-0) ) ) ) @@ -206,43 +206,43 @@ ((>= (-> v1-3 param 0) 0.0) (cond ((< f26-0 f28-0) - (play-effects-from-res-lump obj f28-0 9999999.0 f30-0) - (play-effects-from-res-lump obj -100000000.0 f26-0 9999999.0) + (play-effects-from-res-lump this f28-0 9999999.0 f30-0) + (play-effects-from-res-lump this -100000000.0 f26-0 9999999.0) ) (else - (play-effects-from-res-lump obj f28-0 f26-0 f30-0) + (play-effects-from-res-lump this f28-0 f26-0 f30-0) ) ) ) ((< f28-0 f26-0) - (play-effects-from-res-lump obj f26-0 9999999.0 f30-0) - (play-effects-from-res-lump obj -100000000.0 f28-0 9999999.0) + (play-effects-from-res-lump this f26-0 9999999.0 f30-0) + (play-effects-from-res-lump this -100000000.0 f28-0 9999999.0) ) (else - (play-effects-from-res-lump obj f26-0 f28-0 f30-0) + (play-effects-from-res-lump this f26-0 f28-0 f30-0) ) ) ) ((= a0-3 num-func-+!) (if (>= (-> v1-3 param 0) 0.0) - (play-effects-from-res-lump obj f28-0 f26-0 f30-0) - (play-effects-from-res-lump obj f26-0 f28-0 f30-0) + (play-effects-from-res-lump this f28-0 f26-0 f30-0) + (play-effects-from-res-lump this f26-0 f28-0 f30-0) ) ) ((= a0-3 num-func-identity) - (play-effects-from-res-lump obj f30-0 f30-0 f30-0) + (play-effects-from-res-lump this f30-0 f30-0 f30-0) ) ) ) ) ) ) - (set! (-> obj last-frame-group) s5-0) - (set! (-> obj last-frame-num) f30-0) + (set! (-> this last-frame-group) s5-0) + (set! (-> this last-frame-num) f30-0) ) ) (else - (set! (-> obj last-frame-group) #f) + (set! (-> this last-frame-group) #f) ) ) ) @@ -253,14 +253,14 @@ ;; definition for method 14 of type effect-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod play-effects-from-res-lump effect-control ((obj effect-control) (arg0 float) (arg1 float) (arg2 float)) - (let ((s2-0 (-> obj name))) +(defmethod play-effects-from-res-lump effect-control ((this effect-control) (arg0 float) (arg1 float) (arg2 float)) + (let ((s2-0 (-> this name))) (while (= (-> s2-0 0 name) 'effect-name) (let ((f0-0 (-> s2-0 0 key-frame))) (when (or (and (< f0-0 arg1) (< arg0 f0-0)) (= f0-0 arg2)) - (let* ((a0-1 obj) + (let* ((a0-1 this) (t9-0 (method-of-object a0-1 do-effect)) - (v1-7 (-> obj res)) + (v1-7 (-> this res)) (a1-1 (-> s2-0 0)) ) (t9-0 @@ -282,16 +282,8 @@ ;; definition for method 10 of type effect-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 257] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 317] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 337] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 459] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 480] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 579] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 598] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 303] ;; WARN: Function (method 10 effect-control) has a return type of none, but the expression builder found a return statement. -(defmethod do-effect effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int)) +(defmethod do-effect effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int)) (local-vars (sv-320 int) (sv-336 symbol) @@ -308,12 +300,12 @@ (sv-512 res-lump) ) (cond - ((logtest? (-> obj flags) (effect-control-flag ecf2)) + ((logtest? (-> this flags) (effect-control-flag ecf2)) (return #f) ) ((= arg0 'script) (let ((gp-1 (get-property-struct - (-> obj res) + (-> this res) 'effect-script 'exact arg1 @@ -332,7 +324,7 @@ (s5-0 (cond ((< arg2 0) (let ((v0-5 (get-property-value - (-> obj res) + (-> this res) 'effect-joint 'exact arg1 @@ -355,8 +347,8 @@ ) ) ) - (when (logtest? (-> obj flags) (effect-control-flag ecf0)) - (if (send-event (-> obj process) 'effect-control arg0 arg1 s5-0) + (when (logtest? (-> this flags) (effect-control-flag ecf0)) + (if (send-event (-> this process) 'effect-control arg0 arg1 s5-0) (return 0) ) ) @@ -370,7 +362,7 @@ (= (-> v1-23 data 5) 116) (= (-> v1-23 data 6) 45) ) - (let* ((s3-1 (-> obj process root)) + (let* ((s3-1 (-> this process root)) (v1-27 (if (type? s3-1 collide-shape-moving) s3-1 ) @@ -381,7 +373,7 @@ ) ) ) - (do-effect-for-surface obj arg0 arg1 s5-0 (-> obj res) t1-2) + (do-effect-for-surface this arg0 arg1 s5-0 (-> this res) t1-2) ) ) ((let ((v1-31 (symbol->string arg0))) @@ -410,14 +402,22 @@ ) (when (and (nonzero? s3-0) (= (-> (the-as basic s3-0) type) sparticle-launch-group)) (if *debug-effect-control* - (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" (current-time) (-> obj process name) arg0 arg1 s5-0) + (format + #t + "(~5D) effect group ~A ~A frame ~F joint ~D~%" + (current-time) + (-> this process name) + arg0 + arg1 + s5-0 + ) ) (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-1 (let ((t9-10 (method-of-type part-tracker activate))) (t9-10 (the-as part-tracker s4-1) - (-> obj process) + (-> this process) (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000) ) @@ -432,7 +432,7 @@ (set! sv-368 (the-as symbol #f)) (set! sv-400 *launch-matrix*) (set! sv-384 (-> sv-400 trans)) - (let ((v1-55 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) quad))) + (let ((v1-55 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) quad))) (set! (-> sv-384 quad) v1-55) ) ((the-as (function object object object object object object object object none) s2-1) @@ -460,23 +460,31 @@ (= (-> v1-58 data 5) 45) ) ) - (send-event (-> obj process) arg0 arg1 s5-0) + (send-event (-> this process) arg0 arg1 s5-0) ) ((= arg0 'camera-shake) (activate! *camera-smush-control* 819.2 15 75 1.0 0.9 (-> *display* camera-clock)) ) ((zero? s3-0) - (play-effect-sound obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) + (play-effect-sound this arg0 arg1 s5-0 (-> this res) (string->sound-name (symbol->string arg0))) ) ((= (-> (the-as basic s3-0) type) sparticle-launcher) (if *debug-effect-control* - (format #t "(~5D) effect part ~A ~A frame ~F joint ~D~%" (current-time) (-> obj process name) arg0 arg1 s5-0) + (format + #t + "(~5D) effect part ~A ~A frame ~F joint ~D~%" + (current-time) + (-> this process name) + arg0 + arg1 + s5-0 + ) ) (format #t "-----> (~5D) effect part ~A ~A frame ~F joint ~D~%" (current-time) - (-> obj process name) + (-> this process name) arg0 arg1 s5-0 @@ -486,7 +494,7 @@ (s0-2 *launch-matrix*) ) (set! (-> s0-2 trans quad) - (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) quad) + (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) quad) ) (s4-2 s2-2 @@ -500,14 +508,22 @@ ) ((= (-> (the-as basic s3-0) type) sparticle-launch-group) (if *debug-effect-control* - (format #t "(~5D) effect group ~A ~A frame ~F joint ~D~%" (current-time) (-> obj process name) arg0 arg1 s5-0) + (format + #t + "(~5D) effect group ~A ~A frame ~F joint ~D~%" + (current-time) + (-> this process name) + arg0 + arg1 + s5-0 + ) ) (let ((s4-3 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-3 (let ((t9-23 (method-of-type part-tracker activate))) (t9-23 (the-as part-tracker s4-3) - (-> obj process) + (-> this process) (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000) ) @@ -522,7 +538,7 @@ (set! sv-464 (the-as symbol #f)) (set! sv-496 *launch-matrix*) (set! sv-480 (-> sv-496 trans)) - (let ((v1-95 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) quad))) + (let ((v1-95 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) quad))) (set! (-> sv-480 quad) v1-95) ) ((the-as (function object object object object object object object object none) s2-3) @@ -544,12 +560,12 @@ (sound-play-by-spec (the-as sound-spec s3-0) (new-sound-id) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-0)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data s5-0)) ) ) ((= (-> (the-as basic s3-0) type) death-info) - (when (and (logtest? (-> obj flags) (effect-control-flag ecf1)) (zero? (-> obj process draw death-timer))) - (let ((v1-106 (-> obj process draw))) + (when (and (logtest? (-> this flags) (effect-control-flag ecf1)) (zero? (-> this process draw death-timer))) + (let ((v1-106 (-> this process draw))) (let ((a1-51 (-> (the-as death-info s3-0) vertex-skip)) (a0-77 (max @@ -581,21 +597,21 @@ (set! (-> v1-106 death-draw-overlap) (-> (the-as death-info s3-0) overlap)) ) (when (-> (the-as death-info s3-0) sound) - (let* ((s2-5 obj) + (let* ((s2-5 this) (s1-4 (method-of-object s2-5 play-effect-sound)) (s0-4 (-> (the-as death-info s3-0) sound)) ) - (set! sv-512 (-> obj res)) + (set! sv-512 (-> this res)) (let ((t1-12 (string->sound-name (symbol->string (-> (the-as death-info s3-0) sound))))) (s1-4 s2-5 s0-4 arg1 s5-0 sv-512 t1-12) ) ) ) - (send-event (-> obj process) 'death-start (the-as death-info s3-0)) + (send-event (-> this process) 'death-start (the-as death-info s3-0)) ) ) (else - (play-effect-sound obj arg0 arg1 s5-0 (-> obj res) (string->sound-name (symbol->string arg0))) + (play-effect-sound this arg0 arg1 s5-0 (-> this res) (string->sound-name (symbol->string arg0))) ) ) ) @@ -607,7 +623,7 @@ ;; definition for method 11 of type effect-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-effect-for-surface effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) +(defmethod do-effect-for-surface effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 pat-surface)) (local-vars (sv-64 (function sparticle-system sparticle-launcher matrix sparticle-launch-state sparticle-launch-control float none) @@ -669,7 +685,7 @@ ) (('effect-land-poof) (do-effect - obj + this (-> (new 'static 'boxed-array :type symbol 'group-land-poof-unk 'group-land-poof-ice @@ -709,7 +725,7 @@ ) (('effect-run-poof) (do-effect - obj + this (-> (new 'static 'boxed-array :type symbol 'group-run-poof-unk 'group-run-poof-ice @@ -749,7 +765,7 @@ ) (('effect-just-footprint) (do-effect - obj + this (-> (new 'static 'boxed-array :type symbol 'group-just-footprint-unk 'group-just-footprint-ice @@ -789,7 +805,7 @@ ) (('effect-just-poof) (do-effect - obj + this (-> (new 'static 'boxed-array :type symbol 'group-just-poof-unk 'group-just-poof-ice @@ -829,7 +845,7 @@ ) (('effect-slide-poof) (do-effect - obj + this (-> (new 'static 'boxed-array :type symbol 'group-slide-poof-unk 'group-slide-poof-ice @@ -909,7 +925,7 @@ (set! sv-80 *sp-particle-system-2d*) (set! sv-112 *launch-matrix*) (set! sv-96 (-> sv-112 trans)) - (let ((v1-63 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2)) quad))) + (let ((v1-63 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad))) (set! (-> sv-96 quad) v1-63) ) (let ((a3-6 #f) @@ -963,7 +979,7 @@ (set! sv-144 *sp-particle-system-2d*) (set! sv-176 *launch-matrix*) (set! sv-160 (-> sv-176 trans)) - (let ((v1-79 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2)) quad))) + (let ((v1-79 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad))) (set! (-> sv-160 quad) v1-79) ) (let ((a3-7 #f) @@ -1017,7 +1033,7 @@ (set! sv-208 *sp-particle-system-2d*) (set! sv-240 *launch-matrix*) (set! sv-224 (-> sv-240 trans)) - (let ((v1-96 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2)) quad))) + (let ((v1-96 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) quad))) (set! (-> sv-224 quad) v1-96) ) (let ((a3-8 #f) @@ -1031,7 +1047,7 @@ ) ) (if s1-0 - (play-effect-sound obj arg0 arg1 arg2 arg3 s1-0) + (play-effect-sound this arg0 arg1 arg2 arg3 s1-0) ) ) 0 @@ -1040,14 +1056,14 @@ ;; definition for method 12 of type effect-control ;; INFO: Used lq/sq -(defmethod play-effect-sound effect-control ((obj effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) +(defmethod play-effect-sound effect-control ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int) (arg3 basic) (arg4 sound-name)) (local-vars (sv-112 res-tag) (sv-128 sound-name) (sv-144 basic) (sv-160 (function vector vector float))) (set! sv-144 arg3) (let ((s0-0 arg4) (gp-0 (the-as object (new 'stack 'sound-spec))) (s5-0 (if (< arg2 0) (the-as vector #f) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data arg2)) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this process node-list data arg2)) ) ) ) @@ -1070,7 +1086,7 @@ (the-as sound-spec gp-0) (the-as (pointer float) a1-6) (the-as int (-> sv-112 elt-count)) - (the-as process-focusable (-> obj process)) + (the-as process-focusable (-> this process)) ) (if (logtest? (-> (the-as sound-spec gp-0) mask) (sound-mask unk)) (return 0) @@ -1108,7 +1124,7 @@ #t "(~5D) effect sound ~A ~A (~S) frame ~F joint ~D " (current-time) - (-> obj process name) + (-> this process name) arg0 *temp-string* arg1 diff --git a/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc b/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc index 436d0ab885..ecfbfd663b 100644 --- a/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc @@ -44,48 +44,48 @@ ) ;; definition for method 3 of type fact-bank -(defmethod inspect fact-bank ((obj fact-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect fact-bank ((this fact-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Teco-level-max: ~f~%" (-> obj eco-level-max)) - (format #t "~1Teco-single-inc: ~f~%" (-> obj eco-single-inc)) - (format #t "~1Teco-full-inc: ~f~%" (-> obj eco-full-inc)) - (format #t "~1Teco-single-timeout: (seconds ~e)~%" (-> obj eco-single-timeout)) - (format #t "~1Teco-full-timeout: (seconds ~e)~%" (-> obj eco-full-timeout)) - (format #t "~1Tdummy: (seconds ~e)~%" (-> obj dummy)) - (format #t "~1Thealth-max-default: ~f~%" (-> obj health-max-default)) - (format #t "~1Thealth-single-inc: ~f~%" (-> obj health-single-inc)) - (format #t "~1Thealth-default-inc: ~f~%" (-> obj health-default-inc)) - (format #t "~1Thealth-darkjak-inc: ~f~%" (-> obj health-darkjak-inc)) - (format #t "~1Thealth-darkjak-min: ~f~%" (-> obj health-darkjak-min)) - (format #t "~1Thealth-darkjak-error: ~f~%" (-> obj health-darkjak-error)) - (format #t "~1Teco-pill-green-max-default: ~f~%" (-> obj eco-pill-green-max-default)) - (format #t "~1Teco-pill-dark-max-default: ~f~%" (-> obj eco-pill-dark-max-default)) - (format #t "~1Thealth-small-inc: ~f~%" (-> obj health-small-inc)) - (format #t "~1Tbuzzer-max-default: ~f~%" (-> obj buzzer-max-default)) - (format #t "~1Tbuzzer-single-inc: ~f~%" (-> obj buzzer-single-inc)) - (format #t "~1Tsuck-bounce-dist: (meters ~m)~%" (-> obj suck-bounce-dist)) - (format #t "~1Tsuck-suck-dist: (meters ~m)~%" (-> obj suck-suck-dist)) - (format #t "~1Tdefault-eco-pill-green-inc: ~f~%" (-> obj default-eco-pill-green-inc)) - (format #t "~1Tdefault-eco-pill-dark-inc: ~f~%" (-> obj default-eco-pill-dark-inc)) - (format #t "~1Tammo-yellow-max: ~f~%" (-> obj ammo-yellow-max)) - (format #t "~1Tammo-red-max: ~f~%" (-> obj ammo-red-max)) - (format #t "~1Tammo-blue-max: ~f~%" (-> obj ammo-blue-max)) - (format #t "~1Tammo-dark-max: ~f~%" (-> obj ammo-dark-max)) - (format #t "~1Tammo-yellow-start: ~f~%" (-> obj ammo-yellow-start)) - (format #t "~1Tammo-red-start: ~f~%" (-> obj ammo-red-start)) - (format #t "~1Tammo-blue-start: ~f~%" (-> obj ammo-blue-start)) - (format #t "~1Tammo-dark-start: ~f~%" (-> obj ammo-dark-start)) - (format #t "~1Tshield-max: ~f~%" (-> obj shield-max)) - (format #t "~1Tshield-use-speed: ~f~%" (-> obj shield-use-speed)) - (format #t "~1Tshield-time-min: (seconds ~e)~%" (-> obj shield-time-min)) - (format #t "~1Ttrick-point-max: ~f~%" (-> obj trick-point-max)) - (format #t "~1Tsuper-skill-inc: ~f~%" (-> obj super-skill-inc)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Teco-level-max: ~f~%" (-> this eco-level-max)) + (format #t "~1Teco-single-inc: ~f~%" (-> this eco-single-inc)) + (format #t "~1Teco-full-inc: ~f~%" (-> this eco-full-inc)) + (format #t "~1Teco-single-timeout: (seconds ~e)~%" (-> this eco-single-timeout)) + (format #t "~1Teco-full-timeout: (seconds ~e)~%" (-> this eco-full-timeout)) + (format #t "~1Tdummy: (seconds ~e)~%" (-> this dummy)) + (format #t "~1Thealth-max-default: ~f~%" (-> this health-max-default)) + (format #t "~1Thealth-single-inc: ~f~%" (-> this health-single-inc)) + (format #t "~1Thealth-default-inc: ~f~%" (-> this health-default-inc)) + (format #t "~1Thealth-darkjak-inc: ~f~%" (-> this health-darkjak-inc)) + (format #t "~1Thealth-darkjak-min: ~f~%" (-> this health-darkjak-min)) + (format #t "~1Thealth-darkjak-error: ~f~%" (-> this health-darkjak-error)) + (format #t "~1Teco-pill-green-max-default: ~f~%" (-> this eco-pill-green-max-default)) + (format #t "~1Teco-pill-dark-max-default: ~f~%" (-> this eco-pill-dark-max-default)) + (format #t "~1Thealth-small-inc: ~f~%" (-> this health-small-inc)) + (format #t "~1Tbuzzer-max-default: ~f~%" (-> this buzzer-max-default)) + (format #t "~1Tbuzzer-single-inc: ~f~%" (-> this buzzer-single-inc)) + (format #t "~1Tsuck-bounce-dist: (meters ~m)~%" (-> this suck-bounce-dist)) + (format #t "~1Tsuck-suck-dist: (meters ~m)~%" (-> this suck-suck-dist)) + (format #t "~1Tdefault-eco-pill-green-inc: ~f~%" (-> this default-eco-pill-green-inc)) + (format #t "~1Tdefault-eco-pill-dark-inc: ~f~%" (-> this default-eco-pill-dark-inc)) + (format #t "~1Tammo-yellow-max: ~f~%" (-> this ammo-yellow-max)) + (format #t "~1Tammo-red-max: ~f~%" (-> this ammo-red-max)) + (format #t "~1Tammo-blue-max: ~f~%" (-> this ammo-blue-max)) + (format #t "~1Tammo-dark-max: ~f~%" (-> this ammo-dark-max)) + (format #t "~1Tammo-yellow-start: ~f~%" (-> this ammo-yellow-start)) + (format #t "~1Tammo-red-start: ~f~%" (-> this ammo-red-start)) + (format #t "~1Tammo-blue-start: ~f~%" (-> this ammo-blue-start)) + (format #t "~1Tammo-dark-start: ~f~%" (-> this ammo-dark-start)) + (format #t "~1Tshield-max: ~f~%" (-> this shield-max)) + (format #t "~1Tshield-use-speed: ~f~%" (-> this shield-use-speed)) + (format #t "~1Tshield-time-min: (seconds ~e)~%" (-> this shield-time-min)) + (format #t "~1Ttrick-point-max: ~f~%" (-> this trick-point-max)) + (format #t "~1Tsuper-skill-inc: ~f~%" (-> this super-skill-inc)) (label cfg-4) - obj + this ) ;; definition for symbol *FACT-bank*, type fact-bank @@ -257,18 +257,18 @@ ) ;; definition for method 3 of type fact-info -(defmethod inspect fact-info ((obj fact-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect fact-info ((this fact-info)) + (when (not this) + (set! this this) (goto cfg-129) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~A~%" (-> this process)) (let ((t9-2 format) (a0-3 #t) (a1-2 "~1Tpickup-type: #x~X : ~S~%") - (a2-2 (-> obj pickup-type)) - (v1-2 (-> obj pickup-type)) + (a2-2 (-> this pickup-type)) + (v1-2 (-> this pickup-type)) ) (t9-2 a0-3 a1-2 a2-2 (cond ((= v1-2 (pickup-type eco-pill-dark)) @@ -379,10 +379,10 @@ ) ) ) - (format #t "~1Tpickup-amount: ~f~%" (-> obj pickup-amount)) - (format #t "~1Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) - (format #t "~1Toptions: #x~X : (actor-option " (-> obj options)) - (let ((s5-0 (-> obj options))) + (format #t "~1Tpickup-amount: ~f~%" (-> this pickup-amount)) + (format #t "~1Tpickup-spawn-amount: ~f~%" (-> this pickup-spawn-amount)) + (format #t "~1Toptions: #x~X : (actor-option " (-> this options)) + (let ((s5-0 (-> this options))) (if (= (logand s5-0 (actor-option respawn-delay)) (actor-option respawn-delay)) (format #t "respawn-delay ") ) @@ -469,9 +469,9 @@ ) ) (format #t ")~%") - (format #t "~1Tfade-time: ~D~%" (-> obj fade-time)) + (format #t "~1Tfade-time: ~D~%" (-> this fade-time)) (label cfg-129) - obj + this ) ;; definition of type fact-info-target @@ -521,18 +521,18 @@ ) ;; definition for method 3 of type fact-info-target -(defmethod inspect fact-info-target ((obj fact-info-target)) - (when (not obj) - (set! obj obj) +(defmethod inspect fact-info-target ((this fact-info-target)) + (when (not this) + (set! this this) (goto cfg-129) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~A~%" (-> this process)) (let ((t9-2 format) (a0-3 #t) (a1-2 "~1Tpickup-type: #x~X : ~S~%") - (a2-2 (-> obj pickup-type)) - (v1-2 (-> obj pickup-type)) + (a2-2 (-> this pickup-type)) + (v1-2 (-> this pickup-type)) ) (t9-2 a0-3 a1-2 a2-2 (cond ((= v1-2 (pickup-type eco-pill-dark)) @@ -643,10 +643,10 @@ ) ) ) - (format #t "~1Tpickup-amount: ~f~%" (-> obj pickup-amount)) - (format #t "~1Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) - (format #t "~1Toptions: #x~X : (actor-option " (-> obj options)) - (let ((s5-0 (-> obj options))) + (format #t "~1Tpickup-amount: ~f~%" (-> this pickup-amount)) + (format #t "~1Tpickup-spawn-amount: ~f~%" (-> this pickup-spawn-amount)) + (format #t "~1Toptions: #x~X : (actor-option " (-> this options)) + (let ((s5-0 (-> this options))) (if (= (logand s5-0 (actor-option respawn-delay)) (actor-option respawn-delay)) (format #t "respawn-delay ") ) @@ -733,43 +733,43 @@ ) ) (format #t ")~%") - (format #t "~1Tfade-time: ~D~%" (-> obj fade-time)) - (format #t "~1Teco-type: ~D~%" (-> obj eco-type)) - (format #t "~1Teco-level: ~f~%" (-> obj eco-level)) - (format #t "~1Teco-pickup-time: ~D~%" (-> obj eco-pickup-time)) - (format #t "~1Teco-timeout: (seconds ~e)~%" (-> obj eco-timeout)) - (format #t "~1Teco-source: ~D~%" (-> obj eco-source)) - (format #t "~1Teco-source-time: ~D~%" (-> obj eco-source-time)) - (format #t "~1Thealth: ~f~%" (-> obj health)) - (format #t "~1Thealth-max: ~f~%" (-> obj health-max)) - (format #t "~1Thealth-pickup-time: ~D~%" (-> obj health-pickup-time)) - (format #t "~1Tbuzzer: ~f~%" (-> obj buzzer)) - (format #t "~1Tbuzzer-max: ~f~%" (-> obj buzzer-max)) - (format #t "~1Teco-pill-green: ~f~%" (-> obj eco-pill-green)) - (format #t "~1Teco-pill-green-max: ~f~%" (-> obj eco-pill-green-max)) - (format #t "~1Teco-pill-green-pickup-time: ~D~%" (-> obj eco-pill-green-pickup-time)) - (format #t "~1Teco-pill-dark-pickup-time: ~D~%" (-> obj eco-pill-dark-pickup-time)) - (format #t "~1Tmoney-pickup-time: ~D~%" (-> obj money-pickup-time)) - (format #t "~1Tbuzzer-pickup-time: ~D~%" (-> obj buzzer-pickup-time)) - (format #t "~1Ttask-pickup-time: ~D~%" (-> obj task-pickup-time)) - (format #t "~1Tstop-time-timeout: ~D~%" (-> obj stop-time-timeout)) - (format #t "~1Tdarkjak-start-time: ~D~%" (-> obj darkjak-start-time)) - (format #t "~1Tdarkjak-effect-time: ~D~%" (-> obj darkjak-effect-time)) - (format #t "~1Tammo-pickup-time: ~D~%" (-> obj ammo-pickup-time)) - (format #t "~1Tshield-pickup-time: ~D~%" (-> obj shield-pickup-time)) - (format #t "~1Tshield-start-time: ~D~%" (-> obj shield-start-time)) - (format #t "~1Tshield-use-time: ~D~%" (-> obj shield-use-time)) - (format #t "~1Tshield-level: ~f~%" (-> obj shield-level)) - (format #t "~1Tshield-attack-id: ~D~%" (-> obj shield-attack-id)) - (format #t "~1Ttrick-point: ~f~%" (-> obj trick-point)) - (format #t "~1Ttrick-point-pickup-time: ~D~%" (-> obj trick-point-pickup-time)) - (format #t "~1Ttrick-point-start-time: ~D~%" (-> obj trick-point-start-time)) - (format #t "~1Ttrick-point-duration: ~D~%" (-> obj trick-point-duration)) - (format #t "~1Tgem-pickup-time: ~D~%" (-> obj gem-pickup-time)) - (format #t "~1Tskill-pickup-time: ~D~%" (-> obj skill-pickup-time)) - (format #t "~1Tkarma-pickup-time: ~D~%" (-> obj karma-pickup-time)) + (format #t "~1Tfade-time: ~D~%" (-> this fade-time)) + (format #t "~1Teco-type: ~D~%" (-> this eco-type)) + (format #t "~1Teco-level: ~f~%" (-> this eco-level)) + (format #t "~1Teco-pickup-time: ~D~%" (-> this eco-pickup-time)) + (format #t "~1Teco-timeout: (seconds ~e)~%" (-> this eco-timeout)) + (format #t "~1Teco-source: ~D~%" (-> this eco-source)) + (format #t "~1Teco-source-time: ~D~%" (-> this eco-source-time)) + (format #t "~1Thealth: ~f~%" (-> this health)) + (format #t "~1Thealth-max: ~f~%" (-> this health-max)) + (format #t "~1Thealth-pickup-time: ~D~%" (-> this health-pickup-time)) + (format #t "~1Tbuzzer: ~f~%" (-> this buzzer)) + (format #t "~1Tbuzzer-max: ~f~%" (-> this buzzer-max)) + (format #t "~1Teco-pill-green: ~f~%" (-> this eco-pill-green)) + (format #t "~1Teco-pill-green-max: ~f~%" (-> this eco-pill-green-max)) + (format #t "~1Teco-pill-green-pickup-time: ~D~%" (-> this eco-pill-green-pickup-time)) + (format #t "~1Teco-pill-dark-pickup-time: ~D~%" (-> this eco-pill-dark-pickup-time)) + (format #t "~1Tmoney-pickup-time: ~D~%" (-> this money-pickup-time)) + (format #t "~1Tbuzzer-pickup-time: ~D~%" (-> this buzzer-pickup-time)) + (format #t "~1Ttask-pickup-time: ~D~%" (-> this task-pickup-time)) + (format #t "~1Tstop-time-timeout: ~D~%" (-> this stop-time-timeout)) + (format #t "~1Tdarkjak-start-time: ~D~%" (-> this darkjak-start-time)) + (format #t "~1Tdarkjak-effect-time: ~D~%" (-> this darkjak-effect-time)) + (format #t "~1Tammo-pickup-time: ~D~%" (-> this ammo-pickup-time)) + (format #t "~1Tshield-pickup-time: ~D~%" (-> this shield-pickup-time)) + (format #t "~1Tshield-start-time: ~D~%" (-> this shield-start-time)) + (format #t "~1Tshield-use-time: ~D~%" (-> this shield-use-time)) + (format #t "~1Tshield-level: ~f~%" (-> this shield-level)) + (format #t "~1Tshield-attack-id: ~D~%" (-> this shield-attack-id)) + (format #t "~1Ttrick-point: ~f~%" (-> this trick-point)) + (format #t "~1Ttrick-point-pickup-time: ~D~%" (-> this trick-point-pickup-time)) + (format #t "~1Ttrick-point-start-time: ~D~%" (-> this trick-point-start-time)) + (format #t "~1Ttrick-point-duration: ~D~%" (-> this trick-point-duration)) + (format #t "~1Tgem-pickup-time: ~D~%" (-> this gem-pickup-time)) + (format #t "~1Tskill-pickup-time: ~D~%" (-> this skill-pickup-time)) + (format #t "~1Tkarma-pickup-time: ~D~%" (-> this karma-pickup-time)) (label cfg-129) - obj + this ) ;; definition of type fact-info-enemy @@ -797,18 +797,18 @@ ) ;; definition for method 3 of type fact-info-enemy -(defmethod inspect fact-info-enemy ((obj fact-info-enemy)) - (when (not obj) - (set! obj obj) +(defmethod inspect fact-info-enemy ((this fact-info-enemy)) + (when (not this) + (set! this this) (goto cfg-181) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~A~%" (-> this process)) (let ((t9-2 format) (a0-3 #t) (a1-2 "~1Tpickup-type: #x~X : ~S~%") - (a2-2 (-> obj pickup-type)) - (v1-2 (-> obj pickup-type)) + (a2-2 (-> this pickup-type)) + (v1-2 (-> this pickup-type)) ) (t9-2 a0-3 a1-2 a2-2 (cond ((= v1-2 (pickup-type eco-pill-dark)) @@ -919,10 +919,10 @@ ) ) ) - (format #t "~1Tpickup-amount: ~f~%" (-> obj pickup-amount)) - (format #t "~1Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) - (format #t "~1Toptions: #x~X : (actor-option " (-> obj options)) - (let ((s5-0 (-> obj options))) + (format #t "~1Tpickup-amount: ~f~%" (-> this pickup-amount)) + (format #t "~1Tpickup-spawn-amount: ~f~%" (-> this pickup-spawn-amount)) + (format #t "~1Toptions: #x~X : (actor-option " (-> this options)) + (let ((s5-0 (-> this options))) (if (= (logand s5-0 (actor-option respawn-delay)) (actor-option respawn-delay)) (format #t "respawn-delay ") ) @@ -1009,16 +1009,16 @@ ) ) (format #t ")~%") - (format #t "~1Tfade-time: ~D~%" (-> obj fade-time)) - (format #t "~1Tspeed: ~f~%" (-> obj speed)) - (format #t "~1Tidle-distance: (meters ~m)~%" (-> obj idle-distance)) - (format #t "~1Tnotice-top: (meters ~m)~%" (-> obj notice-top)) - (format #t "~1Tnotice-bottom: (meters ~m)~%" (-> obj notice-bottom)) - (format #t "~1Tcam-horz: (meters ~m)~%" (-> obj cam-horz)) - (format #t "~1Tcam-vert: (meters ~m)~%" (-> obj cam-vert)) - (format #t "~1Tcam-notice-dist: (meters ~m)~%" (-> obj cam-notice-dist)) - (format #t "~1Tenemy-options: #x~X : (enemy-option " (-> obj enemy-options)) - (let ((s5-1 (-> obj enemy-options))) + (format #t "~1Tfade-time: ~D~%" (-> this fade-time)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Tidle-distance: (meters ~m)~%" (-> this idle-distance)) + (format #t "~1Tnotice-top: (meters ~m)~%" (-> this notice-top)) + (format #t "~1Tnotice-bottom: (meters ~m)~%" (-> this notice-bottom)) + (format #t "~1Tcam-horz: (meters ~m)~%" (-> this cam-horz)) + (format #t "~1Tcam-vert: (meters ~m)~%" (-> this cam-vert)) + (format #t "~1Tcam-notice-dist: (meters ~m)~%" (-> this cam-notice-dist)) + (format #t "~1Tenemy-options: #x~X : (enemy-option " (-> this enemy-options)) + (let ((s5-1 (-> this enemy-options))) (if (= (logand s5-1 (enemy-option user11)) (enemy-option user11)) (format #t "user11 ") ) @@ -1099,12 +1099,12 @@ ) ) (format #t ")~%") - (format #t "~1Ttrig-dist: (meters ~m)~%" (-> obj trig-dist)) - (format #t "~1Ttrig-actor-group: #x~X~%" (-> obj trig-actor-group)) - (format #t "~1Ttrig-mask-count: ~D~%" (-> obj trig-mask-count)) - (format #t "~1Ttrig-mask[2] @ #x~X~%" (-> obj trig-mask)) + (format #t "~1Ttrig-dist: (meters ~m)~%" (-> this trig-dist)) + (format #t "~1Ttrig-actor-group: #x~X~%" (-> this trig-actor-group)) + (format #t "~1Ttrig-mask-count: ~D~%" (-> this trig-mask-count)) + (format #t "~1Ttrig-mask[2] @ #x~X~%" (-> this trig-mask)) (label cfg-181) - obj + this ) ;; definition of type fact-info-crate @@ -1120,18 +1120,18 @@ ) ;; definition for method 3 of type fact-info-crate -(defmethod inspect fact-info-crate ((obj fact-info-crate)) - (when (not obj) - (set! obj obj) +(defmethod inspect fact-info-crate ((this fact-info-crate)) + (when (not this) + (set! this this) (goto cfg-129) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~A~%" (-> this process)) (let ((t9-2 format) (a0-3 #t) (a1-2 "~1Tpickup-type: #x~X : ~S~%") - (a2-2 (-> obj pickup-type)) - (v1-2 (-> obj pickup-type)) + (a2-2 (-> this pickup-type)) + (v1-2 (-> this pickup-type)) ) (t9-2 a0-3 a1-2 a2-2 (cond ((= v1-2 (pickup-type eco-pill-dark)) @@ -1242,10 +1242,10 @@ ) ) ) - (format #t "~1Tpickup-amount: ~f~%" (-> obj pickup-amount)) - (format #t "~1Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) - (format #t "~1Toptions: #x~X : (actor-option " (-> obj options)) - (let ((s5-0 (-> obj options))) + (format #t "~1Tpickup-amount: ~f~%" (-> this pickup-amount)) + (format #t "~1Tpickup-spawn-amount: ~f~%" (-> this pickup-spawn-amount)) + (format #t "~1Toptions: #x~X : (actor-option " (-> this options)) + (let ((s5-0 (-> this options))) (if (= (logand s5-0 (actor-option respawn-delay)) (actor-option respawn-delay)) (format #t "respawn-delay ") ) @@ -1332,10 +1332,10 @@ ) ) (format #t ")~%") - (format #t "~1Tfade-time: ~D~%" (-> obj fade-time)) - (format #t "~1Tsuck-count: ~D~%" (-> obj suck-count)) + (format #t "~1Tfade-time: ~D~%" (-> this fade-time)) + (format #t "~1Tsuck-count: ~D~%" (-> this suck-count)) (label cfg-129) - obj + this ) ;; definition for method 0 of type fact-info @@ -1390,7 +1390,7 @@ ) ;; definition for method 11 of type fact-info -(defmethod pickup-collectable! fact-info ((obj fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! fact-info ((this fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) 0.0 ) @@ -1404,15 +1404,15 @@ ) ;; definition for method 3 of type fact-info-enemy-defaults -(defmethod inspect fact-info-enemy-defaults ((obj fact-info-enemy-defaults)) - (when (not obj) - (set! obj obj) +(defmethod inspect fact-info-enemy-defaults ((this fact-info-enemy-defaults)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tidle-distance: (meters ~m)~%" (-> obj idle-distance)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tidle-distance: (meters ~m)~%" (-> this idle-distance)) (label cfg-4) - obj + this ) ;; definition for symbol *fact-info-enemy-defaults*, type fact-info-enemy-defaults @@ -1479,10 +1479,10 @@ ;; definition for method 12 of type fact-info-enemy ;; WARN: Return type mismatch int vs none. -(defmethod clear-mask-bits fact-info-enemy ((obj fact-info-enemy) (arg0 int)) +(defmethod clear-mask-bits fact-info-enemy ((this fact-info-enemy) (arg0 int)) (let ((v1-0 (lognot arg0))) - (dotimes (a1-1 (-> obj trig-mask-count)) - (logand! (-> obj trig-mask a1-1) v1-0) + (dotimes (a1-1 (-> this trig-mask-count)) + (logand! (-> this trig-mask a1-1) v1-0) ) ) 0 diff --git a/test/decompiler/reference/jak2/engine/game/game-h_REF.gc b/test/decompiler/reference/jak2/engine/game/game-h_REF.gc index be5f636abd..8ac2a72882 100644 --- a/test/decompiler/reference/jak2/engine/game/game-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-h_REF.gc @@ -40,33 +40,33 @@ ) ;; definition for method 3 of type process-drawable -(defmethod inspect process-drawable ((obj process-drawable)) - (when (not obj) - (set! obj obj) +(defmethod inspect process-drawable ((this process-drawable)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Troot: ~A~%" (-> obj root)) - (format #t "~2Tnode-list: ~A~%" (-> obj node-list)) - (format #t "~2Tdraw: ~A~%" (-> obj draw)) - (format #t "~2Tskel: ~A~%" (-> obj skel)) - (format #t "~2Tnav: ~A~%" (-> obj nav)) - (format #t "~2Talign: ~A~%" (-> obj align)) - (format #t "~2Tpath: ~A~%" (-> obj path)) - (format #t "~2Tvol: ~A~%" (-> obj vol)) - (format #t "~2Tfact: ~A~%" (-> obj fact)) - (format #t "~2Tlink: ~A~%" (-> obj link)) - (format #t "~2Tpart: ~A~%" (-> obj part)) - (format #t "~2Twater: ~A~%" (-> obj water)) - (format #t "~2Tsound: ~A~%" (-> obj sound)) - (format #t "~2Tcarry: ~A~%" (-> obj carry)) - (format #t "~2Trbody: ~A~%" (-> obj rbody)) - (format #t "~2Tstate-flags: ~D~%" (-> obj state-flags)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) + (format #t "~2Troot: ~A~%" (-> this root)) + (format #t "~2Tnode-list: ~A~%" (-> this node-list)) + (format #t "~2Tdraw: ~A~%" (-> this draw)) + (format #t "~2Tskel: ~A~%" (-> this skel)) + (format #t "~2Tnav: ~A~%" (-> this nav)) + (format #t "~2Talign: ~A~%" (-> this align)) + (format #t "~2Tpath: ~A~%" (-> this path)) + (format #t "~2Tvol: ~A~%" (-> this vol)) + (format #t "~2Tfact: ~A~%" (-> this fact)) + (format #t "~2Tlink: ~A~%" (-> this link)) + (format #t "~2Tpart: ~A~%" (-> this part)) + (format #t "~2Twater: ~A~%" (-> this water)) + (format #t "~2Tsound: ~A~%" (-> this sound)) + (format #t "~2Tcarry: ~A~%" (-> this carry)) + (format #t "~2Trbody: ~A~%" (-> this rbody)) + (format #t "~2Tstate-flags: ~D~%" (-> this state-flags)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) (label cfg-4) - obj + this ) ;; definition of type process-drawable-reserved @@ -239,16 +239,16 @@ ) ;; definition for method 3 of type process-drawable-reserved -(defmethod inspect process-drawable-reserved ((obj process-drawable-reserved)) - (when (not obj) - (set! obj obj) +(defmethod inspect process-drawable-reserved ((this process-drawable-reserved)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type attack-dir-info @@ -264,18 +264,18 @@ ) ;; definition for method 3 of type attack-dir-info -(defmethod inspect attack-dir-info ((obj attack-dir-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect attack-dir-info ((this attack-dir-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'attack-dir-info) - (format #t "~1Tdir: #~%" (-> obj dir)) - (format #t "~1Txz-dir: #~%" (-> obj xz-dir)) - (format #t "~1Tattacker-velocity: #~%" (-> obj attacker-velocity)) - (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this 'attack-dir-info) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Txz-dir: #~%" (-> this xz-dir)) + (format #t "~1Tattacker-velocity: #~%" (-> this attacker-velocity)) + (format #t "~1Tpos: #~%" (-> this pos)) (label cfg-4) - obj + this ) ;; definition of type attack-info @@ -316,21 +316,21 @@ ) ;; definition for method 3 of type attack-info -(defmethod inspect attack-info ((obj attack-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect attack-info ((this attack-info)) + (when (not this) + (set! this this) (goto cfg-50) ) - (format #t "[~8x] ~A~%" obj 'attack-info) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Tvector: ~`vector`P~%" (-> obj vector)) - (format #t "~1Tattacker-velocity: ~`vector`P~%" (-> obj attacker-velocity)) - (format #t "~1Tintersection: ~`vector`P~%" (-> obj intersection)) - (format #t "~1Tattacker: ~`handle`P~%" (-> obj attacker)) - (format #t "~1Tattack-time: ~D~%" (-> obj attack-time)) - (format #t "~1Tinvinc-time: ~D~%" (-> obj invinc-time)) - (format #t "~1Tmask: #x~X : (attack-info-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this 'attack-info) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tvector: ~`vector`P~%" (-> this vector)) + (format #t "~1Tattacker-velocity: ~`vector`P~%" (-> this attacker-velocity)) + (format #t "~1Tintersection: ~`vector`P~%" (-> this intersection)) + (format #t "~1Tattacker: ~`handle`P~%" (-> this attacker)) + (format #t "~1Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~1Tinvinc-time: ~D~%" (-> this invinc-time)) + (format #t "~1Tmask: #x~X : (attack-info-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (attack-mask vector)) (attack-mask vector)) (format #t "vector ") ) @@ -402,24 +402,24 @@ ) ) (format #t ")~%") - (format #t "~1Tmode: ~A~%" (-> obj mode)) - (format #t "~1Tshove-back: (meters ~m)~%" (-> obj shove-back)) - (format #t "~1Tshove-up: (meters ~m)~%" (-> obj shove-up)) - (format #t "~1Tspeed: (meters ~m)~%" (-> obj speed)) - (format #t "~1Tdist: (meters ~m)~%" (-> obj dist)) - (format #t "~1Tcontrol: ~f~%" (-> obj control)) - (format #t "~1Tangle: ~A~%" (-> obj angle)) - (format #t "~1Trotate-to: (deg ~r)~%" (-> obj rotate-to)) - (format #t "~1Tprev-state: ~A~%" (-> obj prev-state)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tpenetrate-using: ~D~%" (-> obj penetrate-using)) - (format #t "~1Tdamage: ~f~%" (-> obj damage)) - (format #t "~1Tshield-damage: ~f~%" (-> obj shield-damage)) - (format #t "~1Tknock: ~D~%" (-> obj knock)) - (format #t "~1Ttest: ~A~%" (-> obj test)) + (format #t "~1Tmode: ~A~%" (-> this mode)) + (format #t "~1Tshove-back: (meters ~m)~%" (-> this shove-back)) + (format #t "~1Tshove-up: (meters ~m)~%" (-> this shove-up)) + (format #t "~1Tspeed: (meters ~m)~%" (-> this speed)) + (format #t "~1Tdist: (meters ~m)~%" (-> this dist)) + (format #t "~1Tcontrol: ~f~%" (-> this control)) + (format #t "~1Tangle: ~A~%" (-> this angle)) + (format #t "~1Trotate-to: (deg ~r)~%" (-> this rotate-to)) + (format #t "~1Tprev-state: ~A~%" (-> this prev-state)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tpenetrate-using: ~D~%" (-> this penetrate-using)) + (format #t "~1Tdamage: ~f~%" (-> this damage)) + (format #t "~1Tshield-damage: ~f~%" (-> this shield-damage)) + (format #t "~1Tknock: ~D~%" (-> this knock)) + (format #t "~1Ttest: ~A~%" (-> this test)) (label cfg-50) - obj + this ) ;; definition of type ground-tween-info @@ -435,17 +435,17 @@ ) ;; definition for method 3 of type ground-tween-info -(defmethod inspect ground-tween-info ((obj ground-tween-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect ground-tween-info ((this ground-tween-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ground-tween-info) - (format #t "~1Tchan[3] @ #x~X~%" (-> obj chan)) - (format #t "~1Tblend[3] @ #x~X~%" (-> obj blend)) - (format #t "~1Tgroup[5] @ #x~X~%" (-> obj group)) + (format #t "[~8x] ~A~%" this 'ground-tween-info) + (format #t "~1Tchan[3] @ #x~X~%" (-> this chan)) + (format #t "~1Tblend[3] @ #x~X~%" (-> this blend)) + (format #t "~1Tgroup[5] @ #x~X~%" (-> this group)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc index e36ab94839..2adb16674f 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc @@ -17,19 +17,19 @@ ) ;; definition for method 3 of type game-bank -(defmethod inspect game-bank ((obj game-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-bank ((this game-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlife-max-default: ~f~%" (-> obj life-max-default)) - (format #t "~1Tlife-start-default: ~f~%" (-> obj life-start-default)) - (format #t "~1Tlife-single-inc: ~f~%" (-> obj life-single-inc)) - (format #t "~1Tmoney-task-inc: ~f~%" (-> obj money-task-inc)) - (format #t "~1Tmoney-oracle-inc: ~f~%" (-> obj money-oracle-inc)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlife-max-default: ~f~%" (-> this life-max-default)) + (format #t "~1Tlife-start-default: ~f~%" (-> this life-start-default)) + (format #t "~1Tlife-single-inc: ~f~%" (-> this life-single-inc)) + (format #t "~1Tmoney-task-inc: ~f~%" (-> this money-task-inc)) + (format #t "~1Tmoney-oracle-inc: ~f~%" (-> this money-oracle-inc)) (label cfg-4) - obj + this ) ;; definition for symbol *GAME-bank*, type game-bank @@ -67,19 +67,19 @@ ) ;; definition for method 3 of type highscore-info -(defmethod inspect highscore-info ((obj highscore-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect highscore-info ((this highscore-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'highscore-info) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Taward-scores[3] @ #x~X~%" (-> obj award-scores)) - (format #t "~1Tbronze-score: ~f~%" (-> obj bronze-score)) - (format #t "~1Tsilver-score: ~f~%" (-> obj silver-score)) - (format #t "~1Tgold-score: ~f~%" (-> obj gold-score)) + (format #t "[~8x] ~A~%" this 'highscore-info) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Taward-scores[3] @ #x~X~%" (-> this award-scores)) + (format #t "~1Tbronze-score: ~f~%" (-> this bronze-score)) + (format #t "~1Tsilver-score: ~f~%" (-> this silver-score)) + (format #t "~1Tgold-score: ~f~%" (-> this gold-score)) (label cfg-4) - obj + this ) ;; definition of type level-buffer-state @@ -96,18 +96,18 @@ ) ;; definition for method 3 of type level-buffer-state -(defmethod inspect level-buffer-state ((obj level-buffer-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect level-buffer-state ((this level-buffer-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'level-buffer-state) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tdisplay?: ~A~%" (-> obj display?)) - (format #t "~1Tforce-vis?: ~A~%" (-> obj force-vis?)) - (format #t "~1Tforce-inside?: ~A~%" (-> obj force-inside?)) + (format #t "[~8x] ~A~%" this 'level-buffer-state) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tdisplay?: ~A~%" (-> this display?)) + (format #t "~1Tforce-vis?: ~A~%" (-> this force-vis?)) + (format #t "~1Tforce-inside?: ~A~%" (-> this force-inside?)) (label cfg-4) - obj + this ) ;; definition of type load-state @@ -141,26 +141,26 @@ ) ;; definition for method 3 of type load-state -(defmethod inspect load-state ((obj load-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect load-state ((this load-state)) + (when (not this) + (set! this this) (goto cfg-10) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twant[6] @ #x~X~%" (-> obj want)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twant[6] @ #x~X~%" (-> this want)) (dotimes (s5-0 6) - (format #t "~T [~D]~1Twant: ~`level-buffer-state`P~%" s5-0 (-> obj want s5-0)) + (format #t "~T [~D]~1Twant: ~`level-buffer-state`P~%" s5-0 (-> this want s5-0)) ) - (format #t "~1Twant-sound[3] @ #x~X~%" (-> obj want-sound)) + (format #t "~1Twant-sound[3] @ #x~X~%" (-> this want-sound)) (dotimes (s5-1 3) - (format #t "~T [~D]~1Twant-sound: ~`symbol`P~%" s5-1 (-> obj want-sound s5-1)) + (format #t "~T [~D]~1Twant-sound: ~`symbol`P~%" s5-1 (-> this want-sound s5-1)) ) - (format #t "~1Tvis-nick: ~A~%" (-> obj vis-nick)) - (format #t "~1Tcommand-list: ~A~%" (-> obj command-list)) - (format #t "~1Tobject-name[256] @ #x~X~%" (-> obj object-name)) - (format #t "~1Tobject-status[256] @ #x~X~%" (-> obj object-status)) + (format #t "~1Tvis-nick: ~A~%" (-> this vis-nick)) + (format #t "~1Tcommand-list: ~A~%" (-> this command-list)) + (format #t "~1Tobject-name[256] @ #x~X~%" (-> this object-name)) + (format #t "~1Tobject-status[256] @ #x~X~%" (-> this object-status)) (label cfg-10) - obj + this ) ;; definition for method 0 of type load-state @@ -193,31 +193,31 @@ ) ;; definition for method 3 of type continue-point -(defmethod inspect continue-point ((obj continue-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect continue-point ((this continue-point)) + (when (not this) + (set! this this) (goto cfg-10) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Tquat: ~`vector`P~%" (-> obj quat)) - (format #t "~1Tcamera-trans: ~`vector`P~%" (-> obj camera-trans)) - (format #t "~1Tcamera-rot[9] @ #x~X~%" (-> obj camera-rot)) - (format #t "~1Ton-goto: ~A~%" (-> obj on-goto)) - (format #t "~1Tvis-nick: ~A~%" (-> obj vis-nick)) - (format #t "~1Twant[6] @ #x~X~%" (-> obj want)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tquat: ~`vector`P~%" (-> this quat)) + (format #t "~1Tcamera-trans: ~`vector`P~%" (-> this camera-trans)) + (format #t "~1Tcamera-rot[9] @ #x~X~%" (-> this camera-rot)) + (format #t "~1Ton-goto: ~A~%" (-> this on-goto)) + (format #t "~1Tvis-nick: ~A~%" (-> this vis-nick)) + (format #t "~1Twant[6] @ #x~X~%" (-> this want)) (dotimes (s5-0 6) - (format #t "~T [~D]~1Twant: ~`level-buffer-state`P~%" s5-0 (-> obj want s5-0)) + (format #t "~T [~D]~1Twant: ~`level-buffer-state`P~%" s5-0 (-> this want s5-0)) ) - (format #t "~1Twant-sound[3] @ #x~X~%" (-> obj want-sound)) + (format #t "~1Twant-sound[3] @ #x~X~%" (-> this want-sound)) (dotimes (s5-1 3) - (format #t "~T [~D]~1Twant-sound: ~`symbol`P~%" s5-1 (-> obj want-sound s5-1)) + (format #t "~T [~D]~1Twant-sound: ~`symbol`P~%" s5-1 (-> this want-sound s5-1)) ) (label cfg-10) - obj + this ) ;; definition of type game-info @@ -349,106 +349,106 @@ ) ;; definition for method 3 of type game-info -(defmethod inspect game-info ((obj game-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-info ((this game-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmode: ~A~%" (-> obj mode)) - (format #t "~1Tsave-name: ~A~%" (-> obj save-name)) - (format #t "~1Tlife: ~f~%" (-> obj life)) - (format #t "~1Tlife-max: ~f~%" (-> obj life-max)) - (format #t "~1Tmoney: ~f~%" (-> obj money)) - (format #t "~1Tmoney-total: ~f~%" (-> obj money-total)) - (format #t "~1Tmoney-per-level[32] @ #x~X~%" (-> obj money-per-level)) - (format #t "~1Tdeaths-per-level[32] @ #x~X~%" (-> obj deaths-per-level)) - (format #t "~1Tbuzzer-total: ~f~%" (-> obj buzzer-total)) - (format #t "~1Tfuel: ~f~%" (-> obj fuel)) - (format #t "~1Tgem: ~f~%" (-> obj gem)) - (format #t "~1Tgem-total: ~f~%" (-> obj gem-total)) - (format #t "~1Tskill: ~f~%" (-> obj skill)) - (format #t "~1Tskill-total: ~f~%" (-> obj skill-total)) - (format #t "~1Tkarma: ~f~%" (-> obj karma)) - (format #t "~1Teco-pill-dark: ~f~%" (-> obj eco-pill-dark)) - (format #t "~1Teco-pill-dark-total: ~f~%" (-> obj eco-pill-dark-total)) - (format #t "~1Tfeatures: ~D~%" (-> obj features)) - (format #t "~1Tdebug-features: ~D~%" (-> obj debug-features)) - (format #t "~1Tsecrets: ~D~%" (-> obj secrets)) - (format #t "~1Tpurchase-secrets: ~D~%" (-> obj purchase-secrets)) - (format #t "~1Tgun-type: ~D~%" (-> obj gun-type)) - (format #t "~1Tgun-ammo[4] @ #x~X~%" (-> obj gun-ammo)) - (format #t "~1Tshield: ~f~%" (-> obj shield)) - (format #t "~1Tscore: ~f~%" (-> obj score)) - (format #t "~1Tscore-owner: ~D~%" (-> obj score-owner)) - (format #t "~1Ttimer: ~D~%" (-> obj timer)) - (format #t "~1Ttimer-owner: ~D~%" (-> obj timer-owner)) - (format #t "~1Ttimer-flash: ~A~%" (-> obj timer-flash)) - (format #t "~1Tcounter: ~f~%" (-> obj counter)) - (format #t "~1Tcounter-flash: ~A~%" (-> obj counter-flash)) - (format #t "~1Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~1Tperm-list: ~A~%" (-> obj perm-list)) - (format #t "~1Ttask-perm-list: ~A~%" (-> obj task-perm-list)) - (format #t "~1Tcurrent-continue: ~A~%" (-> obj current-continue)) - (format #t "~1Tlast-continue: ~A~%" (-> obj last-continue)) - (format #t "~1Ttask-counter: ~D~%" (-> obj task-counter)) - (format #t "~1Tlevel-opened[32] @ #x~X~%" (-> obj level-opened)) - (format #t "~1Ttotal-deaths: ~D~%" (-> obj total-deaths)) - (format #t "~1Tcontinue-deaths: ~D~%" (-> obj continue-deaths)) - (format #t "~1Ttask-deaths: ~D~%" (-> obj task-deaths)) - (format #t "~1Ttotal-trys: ~D~%" (-> obj total-trys)) - (format #t "~1Tgame-start-time: ~D~%" (-> obj game-start-time)) - (format #t "~1Tcontinue-time: ~D~%" (-> obj continue-time)) - (format #t "~1Tdeath-time: ~D~%" (-> obj death-time)) - (format #t "~1Thit-time: ~D~%" (-> obj hit-time)) - (format #t "~1Ttask-pickup-time: ~D~%" (-> obj task-pickup-time)) - (format #t "~1Tdeath-pos: ~A~%" (-> obj death-pos)) - (format #t "~1Tstop-watch-start: ~D~%" (-> obj stop-watch-start)) - (format #t "~1Tstop-watch-stop: ~D~%" (-> obj stop-watch-stop)) - (format #t "~1Tblackout-time: ~D~%" (-> obj blackout-time)) - (format #t "~1Tletterbox-time: ~D~%" (-> obj letterbox-time)) - (format #t "~1Thint-play-time: ~D~%" (-> obj hint-play-time)) - (format #t "~1Tdisplay-text-time: ~D~%" (-> obj display-text-time)) - (format #t "~1Tdisplay-text-handle: ~D~%" (-> obj display-text-handle)) - (format #t "~1Tdeath-movie-tick: ~D~%" (-> obj death-movie-tick)) - (format #t "~1Twant-auto-save: ~A~%" (-> obj want-auto-save)) - (format #t "~1Tauto-save-proc: ~D~%" (-> obj auto-save-proc)) - (format #t "~1Tauto-save-status: ~D~%" (-> obj auto-save-status)) - (format #t "~1Tauto-save-card: ~D~%" (-> obj auto-save-card)) - (format #t "~1Tauto-save-which: ~D~%" (-> obj auto-save-which)) - (format #t "~1Tauto-save-count: ~D~%" (-> obj auto-save-count)) - (format #t "~1Tpov-camera-handle: ~D~%" (-> obj pov-camera-handle)) - (format #t "~1Tother-camera-handle: ~D~%" (-> obj other-camera-handle)) - (format #t "~1Tcontroller[2] @ #x~X~%" (-> obj controller)) - (format #t "~1Trace-timer: ~D~%" (-> obj race-timer)) - (format #t "~1Trace-current-lap-count: ~D~%" (-> obj race-current-lap-count)) - (format #t "~1Trace-total-lap-count: ~D~%" (-> obj race-total-lap-count)) - (format #t "~1Trace-position: ~D~%" (-> obj race-position)) - (format #t "~1Trace-number-turbos: ~D~%" (-> obj race-number-turbos)) - (format #t "~1Tbot-health[3] @ #x~X~%" (-> obj bot-health)) - (format #t "~1Tdemo-state: ~D~%" (-> obj demo-state)) - (format #t "~1Twanted-flash: ~A~%" (-> obj wanted-flash)) - (format #t "~1Tdistance: ~f~%" (-> obj distance)) - (format #t "~1Tkiosk-timeout: ~D~%" (-> obj kiosk-timeout)) - (format #t "~1Tpause-start-time: ~D~%" (-> obj pause-start-time)) - (format #t "~1Tgame-score: ~A~%" (-> obj game-score)) - (format #t "~1Tgoal: ~f~%" (-> obj goal)) - (format #t "~1Tmiss: ~f~%" (-> obj miss)) - (format #t "~1Tmiss-max: ~f~%" (-> obj miss-max)) - (format #t "~1Tlive-eco-pill-count: ~D~%" (-> obj live-eco-pill-count)) - (format #t "~1Tlive-gem-count: ~D~%" (-> obj live-gem-count)) - (format #t "~1Tair-supply: ~f~%" (-> obj air-supply)) - (format #t "~1Thoming-beacon: ~D~%" (-> obj homing-beacon)) - (format #t "~1Tdark-eco-pickup: ~D~%" (-> obj dark-eco-pickup)) - (format #t "~1Tgreen-eco-pickup: ~D~%" (-> obj green-eco-pickup)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmode: ~A~%" (-> this mode)) + (format #t "~1Tsave-name: ~A~%" (-> this save-name)) + (format #t "~1Tlife: ~f~%" (-> this life)) + (format #t "~1Tlife-max: ~f~%" (-> this life-max)) + (format #t "~1Tmoney: ~f~%" (-> this money)) + (format #t "~1Tmoney-total: ~f~%" (-> this money-total)) + (format #t "~1Tmoney-per-level[32] @ #x~X~%" (-> this money-per-level)) + (format #t "~1Tdeaths-per-level[32] @ #x~X~%" (-> this deaths-per-level)) + (format #t "~1Tbuzzer-total: ~f~%" (-> this buzzer-total)) + (format #t "~1Tfuel: ~f~%" (-> this fuel)) + (format #t "~1Tgem: ~f~%" (-> this gem)) + (format #t "~1Tgem-total: ~f~%" (-> this gem-total)) + (format #t "~1Tskill: ~f~%" (-> this skill)) + (format #t "~1Tskill-total: ~f~%" (-> this skill-total)) + (format #t "~1Tkarma: ~f~%" (-> this karma)) + (format #t "~1Teco-pill-dark: ~f~%" (-> this eco-pill-dark)) + (format #t "~1Teco-pill-dark-total: ~f~%" (-> this eco-pill-dark-total)) + (format #t "~1Tfeatures: ~D~%" (-> this features)) + (format #t "~1Tdebug-features: ~D~%" (-> this debug-features)) + (format #t "~1Tsecrets: ~D~%" (-> this secrets)) + (format #t "~1Tpurchase-secrets: ~D~%" (-> this purchase-secrets)) + (format #t "~1Tgun-type: ~D~%" (-> this gun-type)) + (format #t "~1Tgun-ammo[4] @ #x~X~%" (-> this gun-ammo)) + (format #t "~1Tshield: ~f~%" (-> this shield)) + (format #t "~1Tscore: ~f~%" (-> this score)) + (format #t "~1Tscore-owner: ~D~%" (-> this score-owner)) + (format #t "~1Ttimer: ~D~%" (-> this timer)) + (format #t "~1Ttimer-owner: ~D~%" (-> this timer-owner)) + (format #t "~1Ttimer-flash: ~A~%" (-> this timer-flash)) + (format #t "~1Tcounter: ~f~%" (-> this counter)) + (format #t "~1Tcounter-flash: ~A~%" (-> this counter-flash)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tperm-list: ~A~%" (-> this perm-list)) + (format #t "~1Ttask-perm-list: ~A~%" (-> this task-perm-list)) + (format #t "~1Tcurrent-continue: ~A~%" (-> this current-continue)) + (format #t "~1Tlast-continue: ~A~%" (-> this last-continue)) + (format #t "~1Ttask-counter: ~D~%" (-> this task-counter)) + (format #t "~1Tlevel-opened[32] @ #x~X~%" (-> this level-opened)) + (format #t "~1Ttotal-deaths: ~D~%" (-> this total-deaths)) + (format #t "~1Tcontinue-deaths: ~D~%" (-> this continue-deaths)) + (format #t "~1Ttask-deaths: ~D~%" (-> this task-deaths)) + (format #t "~1Ttotal-trys: ~D~%" (-> this total-trys)) + (format #t "~1Tgame-start-time: ~D~%" (-> this game-start-time)) + (format #t "~1Tcontinue-time: ~D~%" (-> this continue-time)) + (format #t "~1Tdeath-time: ~D~%" (-> this death-time)) + (format #t "~1Thit-time: ~D~%" (-> this hit-time)) + (format #t "~1Ttask-pickup-time: ~D~%" (-> this task-pickup-time)) + (format #t "~1Tdeath-pos: ~A~%" (-> this death-pos)) + (format #t "~1Tstop-watch-start: ~D~%" (-> this stop-watch-start)) + (format #t "~1Tstop-watch-stop: ~D~%" (-> this stop-watch-stop)) + (format #t "~1Tblackout-time: ~D~%" (-> this blackout-time)) + (format #t "~1Tletterbox-time: ~D~%" (-> this letterbox-time)) + (format #t "~1Thint-play-time: ~D~%" (-> this hint-play-time)) + (format #t "~1Tdisplay-text-time: ~D~%" (-> this display-text-time)) + (format #t "~1Tdisplay-text-handle: ~D~%" (-> this display-text-handle)) + (format #t "~1Tdeath-movie-tick: ~D~%" (-> this death-movie-tick)) + (format #t "~1Twant-auto-save: ~A~%" (-> this want-auto-save)) + (format #t "~1Tauto-save-proc: ~D~%" (-> this auto-save-proc)) + (format #t "~1Tauto-save-status: ~D~%" (-> this auto-save-status)) + (format #t "~1Tauto-save-card: ~D~%" (-> this auto-save-card)) + (format #t "~1Tauto-save-which: ~D~%" (-> this auto-save-which)) + (format #t "~1Tauto-save-count: ~D~%" (-> this auto-save-count)) + (format #t "~1Tpov-camera-handle: ~D~%" (-> this pov-camera-handle)) + (format #t "~1Tother-camera-handle: ~D~%" (-> this other-camera-handle)) + (format #t "~1Tcontroller[2] @ #x~X~%" (-> this controller)) + (format #t "~1Trace-timer: ~D~%" (-> this race-timer)) + (format #t "~1Trace-current-lap-count: ~D~%" (-> this race-current-lap-count)) + (format #t "~1Trace-total-lap-count: ~D~%" (-> this race-total-lap-count)) + (format #t "~1Trace-position: ~D~%" (-> this race-position)) + (format #t "~1Trace-number-turbos: ~D~%" (-> this race-number-turbos)) + (format #t "~1Tbot-health[3] @ #x~X~%" (-> this bot-health)) + (format #t "~1Tdemo-state: ~D~%" (-> this demo-state)) + (format #t "~1Twanted-flash: ~A~%" (-> this wanted-flash)) + (format #t "~1Tdistance: ~f~%" (-> this distance)) + (format #t "~1Tkiosk-timeout: ~D~%" (-> this kiosk-timeout)) + (format #t "~1Tpause-start-time: ~D~%" (-> this pause-start-time)) + (format #t "~1Tgame-score: ~A~%" (-> this game-score)) + (format #t "~1Tgoal: ~f~%" (-> this goal)) + (format #t "~1Tmiss: ~f~%" (-> this miss)) + (format #t "~1Tmiss-max: ~f~%" (-> this miss-max)) + (format #t "~1Tlive-eco-pill-count: ~D~%" (-> this live-eco-pill-count)) + (format #t "~1Tlive-gem-count: ~D~%" (-> this live-gem-count)) + (format #t "~1Tair-supply: ~f~%" (-> this air-supply)) + (format #t "~1Thoming-beacon: ~D~%" (-> this homing-beacon)) + (format #t "~1Tdark-eco-pickup: ~D~%" (-> this dark-eco-pickup)) + (format #t "~1Tgreen-eco-pickup: ~D~%" (-> this green-eco-pickup)) (label cfg-4) - obj + this ) ;; definition for method 27 of type game-info -(defmethod get-next-attack-id game-info ((obj game-info)) - (let ((v0-0 (+ (-> obj attack-id) 1))) - (set! (-> obj attack-id) v0-0) +(defmethod get-next-attack-id game-info ((this game-info)) + (let ((v0-0 (+ (-> this attack-id) 1))) + (set! (-> this attack-id) v0-0) v0-0 ) ) diff --git a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc index e5d80795ab..df15806503 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc @@ -2,8 +2,8 @@ (in-package goal) ;; definition for method 9 of type border-plane -(defmethod debug-draw border-plane ((obj border-plane)) - (let* ((v1-0 (-> obj action)) +(defmethod debug-draw border-plane ((this border-plane)) + (let* ((v1-0 (-> this action)) (plane-color (if (= v1-0 'load) (the-as uint #x8000ff00) (the-as uint #x800000ff) @@ -13,16 +13,16 @@ (add-debug-text-sphere #t (bucket-id debug-no-zbuf1) - (-> obj trans) + (-> this trans) (meters 0.2) - (symbol->string (-> obj name)) + (symbol->string (-> this name)) (the-as rgba plane-color) ) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj trans) - (-> obj normal) + (-> this trans) + (-> this normal) (meters 2) (the-as rgba plane-color) ) @@ -31,17 +31,17 @@ ) ;; definition for method 10 of type border-plane -(defmethod point-past-plane? border-plane ((obj border-plane) (arg0 vector)) - (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) (-> obj normal)) 0.0) +(defmethod point-past-plane? border-plane ((this border-plane) (arg0 vector)) + (>= (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) (-> this normal)) 0.0) ) ;; definition for method 11 of type game-info -(defmethod task-complete? game-info ((obj game-info) (arg0 game-task)) - (logtest? (-> obj task-perm-list data arg0 status) (entity-perm-status complete)) +(defmethod task-complete? game-info ((this game-info) (arg0 game-task)) + (logtest? (-> this task-perm-list data arg0 status) (entity-perm-status complete)) ) ;; definition for method 12 of type game-info -(defmethod subtask-index-by-name game-info ((obj game-info) (arg0 string)) +(defmethod subtask-index-by-name game-info ((this game-info) (arg0 string)) (let ((subtasks (-> *game-info* sub-task-list))) (dotimes (i (-> subtasks length)) (when (nonzero? i) @@ -57,8 +57,8 @@ ) ;; definition for method 13 of type game-info -(defmethod set-subtask-hook! game-info ((obj game-info) (arg0 game-task-node) (arg1 int) (arg2 function)) - (let ((subtask (-> obj sub-task-list arg0))) +(defmethod set-subtask-hook! game-info ((this game-info) (arg0 game-task-node) (arg1 int) (arg2 function)) + (let ((subtask (-> this sub-task-list arg0))) (if (and subtask (-> subtask info)) (set! (-> subtask info hooks arg1) arg2) ) @@ -91,23 +91,23 @@ ;; definition for method 10 of type continue-point ;; INFO: Used lq/sq -(defmethod continue-point-method-10 continue-point ((obj continue-point) (arg0 load-state)) - (let ((v1-0 (lookup-level-info (-> obj vis-nick)))) - (set! (-> obj vis-nick) (if v1-0 - (-> v1-0 name) - ) +(defmethod continue-point-method-10 continue-point ((this continue-point) (arg0 load-state)) + (let ((v1-0 (lookup-level-info (-> this vis-nick)))) + (set! (-> this vis-nick) (if v1-0 + (-> v1-0 name) + ) ) ) (dotimes (s4-0 6) - (mem-copy! (the-as pointer (-> obj want s4-0)) (the-as pointer (-> arg0 want s4-0)) 16) + (mem-copy! (the-as pointer (-> this want s4-0)) (the-as pointer (-> arg0 want s4-0)) 16) ) (dotimes (v1-7 3) - (set! (-> obj want-sound v1-7) (-> arg0 want-sound v1-7)) + (set! (-> this want-sound v1-7) (-> arg0 want-sound v1-7)) ) - (set! (-> obj camera-trans quad) (-> *camera-combiner* trans quad)) + (set! (-> this camera-trans quad) (-> *camera-combiner* trans quad)) (when *camera-combiner* (let ((a0-10 (-> *camera-combiner* inv-camera-rot)) - (v1-14 (-> obj camera-rot)) + (v1-14 (-> this camera-rot)) ) (set! (-> v1-14 0 x) (-> a0-10 vector 0 x)) (set! (-> v1-14 0 y) (-> a0-10 vector 0 y)) @@ -121,16 +121,16 @@ ) ) (add-borrow-levels arg0) - obj + this ) ;; definition for method 11 of type continue-point ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-camera! continue-point ((obj continue-point)) - (set! (-> *camera-combiner* trans quad) (-> obj camera-trans quad)) +(defmethod move-camera! continue-point ((this continue-point)) + (set! (-> *camera-combiner* trans quad) (-> this camera-trans quad)) (let ((gp-0 (-> *camera-combiner* inv-camera-rot)) - (s5-0 (-> obj camera-rot)) + (s5-0 (-> this camera-rot)) ) (matrix-identity! gp-0) (set! (-> gp-0 vector 0 x) (-> s5-0 0 x)) @@ -150,10 +150,10 @@ ) ;; definition for method 19 of type game-info -(defmethod get-current-continue-forced game-info ((obj game-info)) +(defmethod get-current-continue-forced game-info ((this game-info)) (cond - ((and (= (-> obj mode) 'play) (-> obj current-continue)) - (-> obj current-continue) + ((and (= (-> this mode) 'play) (-> this current-continue)) + (-> this current-continue) ) (else (let ((dfault *default-continue*)) @@ -167,7 +167,7 @@ ) ;; definition for method 20 of type game-info -(defmethod get-continue-by-name game-info ((obj game-info) (arg0 string)) +(defmethod get-continue-by-name game-info ((this game-info) (arg0 string)) (if (not arg0) (return (the-as continue-point #f)) ) @@ -191,21 +191,21 @@ ;; definition for method 21 of type game-info ;; WARN: Using new Jak 2 rtype-of -(defmethod set-continue! game-info ((obj game-info) (arg0 basic) (arg1 symbol)) - (let ((s5-0 (-> obj current-continue))) +(defmethod set-continue! game-info ((this game-info) (arg0 basic) (arg1 symbol)) + (let ((s5-0 (-> this current-continue))) (if (null? arg0) (set! arg0 (the-as basic #f)) ) (case (rtype-of arg0) ((string) - (let ((v1-7 (get-continue-by-name obj (the-as string arg0)))) + (let ((v1-7 (get-continue-by-name this (the-as string arg0)))) (if v1-7 - (set! (-> obj current-continue) v1-7) + (set! (-> this current-continue) v1-7) ) ) ) ((continue-point) - (set! (-> obj current-continue) (the-as continue-point arg0)) + (set! (-> this current-continue) (the-as continue-point arg0)) ) (else (let ((dfault *default-continue*)) @@ -223,30 +223,30 @@ (dotimes (v1-16 3) (set! (-> dfault want-sound v1-16) (-> *load-state* want-sound v1-16)) ) - (set! (-> obj current-continue) dfault) + (set! (-> this current-continue) dfault) ) ) ) - (if (and (logtest? (-> obj current-continue flags) (continue-flags change-continue)) - (and (!= (-> obj current-continue) *default-continue*) (not arg1)) + (if (and (logtest? (-> this current-continue flags) (continue-flags change-continue)) + (and (!= (-> this current-continue) *default-continue*) (not arg1)) ) - (set! (-> obj current-continue) s5-0) + (set! (-> this current-continue) s5-0) ) - (when (!= s5-0 (-> obj current-continue)) - (set! (-> obj continue-deaths) 0) - (set! (-> obj continue-time) (-> *display* game-clock frame-counter)) + (when (!= s5-0 (-> this current-continue)) + (set! (-> this continue-deaths) 0) + (set! (-> this continue-time) (-> *display* game-clock frame-counter)) ) ) - (-> obj current-continue) + (-> this current-continue) ) ;; definition for method 15 of type game-info -(defmethod task-perm-by-index game-info ((obj game-info) (arg0 int)) - (-> obj task-perm-list data arg0) +(defmethod task-perm-by-index game-info ((this game-info) (arg0 int)) + (-> this task-perm-list data arg0) ) ;; definition for method 30 of type game-info -(defmethod calculate-percentage game-info ((obj game-info)) +(defmethod calculate-percentage game-info ((this game-info)) (let ((story-total 0) (story-complete 0) ) @@ -257,7 +257,7 @@ (while (>= (the-as uint story-max) (the-as uint story-min)) (when (not (or (= story-min (game-task city-blue-gun-training)) (= story-min (game-task city-dark-gun-training)))) (+! story-total 1) - (if (task-complete? obj story-min) + (if (task-complete? this story-min) (+! story-complete 1) ) ) @@ -270,7 +270,7 @@ (bbush-max (game-task stadium-burning-bush-race-class1-r)) ) (while (>= (the-as uint bbush-max) (the-as uint bbush-min)) - (if (task-complete? obj bbush-min) + (if (task-complete? this bbush-min) (set! percent (+ 1.0 percent)) ) (+! bbush-min 1) @@ -300,7 +300,7 @@ ;; definition for method 9 of type game-info ;; INFO: Used lq/sq ;; ERROR: Expression building failed: In (method 9 game-info): Expression pass could not find the set-to-run function. Found t9-31 instead. Make sure there are no casts on this function. -(defmethod initialize! game-info ((obj game-info) (arg0 symbol) (arg1 game-save) (arg2 string)) +(defmethod initialize! game-info ((this game-info) (arg0 symbol) (arg1 game-save) (arg2 string)) (local-vars (v0-17 object) (v0-29 process-tree) @@ -347,28 +347,28 @@ ) (cond ((or (= v1-0 'dead) (= v1-0 'life)) - (+! (-> obj total-deaths) 1) - (+! (-> obj continue-deaths) 1) - (+! (-> obj task-deaths) 1) + (+! (-> this total-deaths) 1) + (+! (-> this continue-deaths) 1) + (+! (-> this task-deaths) 1) (when *target* (set! s4-1 (-> *target* current-level info)) - (set! (-> obj deaths-per-level (-> s4-1 task-level)) - (the-as uint (seekl (the-as int (-> obj deaths-per-level (-> s4-1 task-level))) 255 1)) + (set! (-> this deaths-per-level (-> s4-1 task-level)) + (the-as uint (seekl (the-as int (-> this deaths-per-level (-> s4-1 task-level))) 255 1)) ) ) - (set! v1-16 (-> obj mode)) + (set! v1-16 (-> this mode)) (cond ((= v1-16 'play) (set! arg0 'life) ) (else - (set! obj obj) + (set! this this) (goto cfg-131) ) ) ) ((= v1-0 'try) - (+! (-> obj total-trys) 1) + (+! (-> this total-trys) 1) ) ) (cond @@ -379,7 +379,7 @@ ((= v1-135 'debug) (reset-actors arg0) (if arg1 - (load-game obj arg1) + (load-game this arg1) ) ) ((= v1-135 'play) @@ -419,12 +419,12 @@ (none) ) ) - (set! v1-161 (-> obj mode)) + (set! v1-161 (-> this mode)) (set! sv-112 v1-161) - (set! a0-96 obj) + (set! a0-96 this) (set! v1-162 (-> a0-96 type)) (set! t9-30 (method-of-object a0-96 get-current-continue-forced)) - (set! v0-30 (get-current-continue-forced obj)) + (set! v0-30 (get-current-continue-forced this)) (set! t0-3 v0-30) (set! t1-3 arg1) (set! t9-31 s2-2) @@ -448,75 +448,75 @@ ) (set! v1-164 v0-17) (label cfg-131) - (set! v0-32 obj) + (set! v0-32 this) (ret-value v0-32) ) ;; definition for method 10 of type game-info -(defmethod give game-info ((obj game-info) (arg0 symbol) (arg1 float) (arg2 handle)) +(defmethod give game-info ((this game-info) (arg0 symbol) (arg1 float) (arg2 handle)) (local-vars (ammo-max float)) (with-pp (case arg0 (('life) (if (>= arg1 0.0) - (seek! (-> obj life) (-> obj life-max) arg1) - (seek! (-> obj life) 0.0 (- arg1)) + (seek! (-> this life) (-> this life-max) arg1) + (seek! (-> this life) 0.0 (- arg1)) ) - (-> obj life) + (-> this life) ) (('money) (if (< 0.0 arg1) - (+! (-> obj money-total) arg1) + (+! (-> this money-total) arg1) ) - (set! (-> obj money) (+ (-> obj money) arg1)) + (set! (-> this money) (+ (-> this money) arg1)) ) (('gem) (when (< 0.0 arg1) - (+! (-> obj gem-total) arg1) + (+! (-> this gem-total) arg1) (let ((v1-7 (handle->process arg2))) (if (and v1-7 (-> v1-7 entity)) (toggle-status (-> v1-7 entity) (entity-perm-status save) #t) ) ) ) - (set! (-> obj gem) (+ (-> obj gem) arg1)) + (set! (-> this gem) (+ (-> this gem) arg1)) ) (('skill) (if (< 0.0 arg1) - (+! (-> obj skill-total) arg1) + (+! (-> this skill-total) arg1) ) - (set! (-> obj skill) (+ (-> obj skill) arg1)) + (set! (-> this skill) (+ (-> this skill) arg1)) ) (('karma) - (set! (-> obj karma) (+ (-> obj karma) arg1)) + (set! (-> this karma) (+ (-> this karma) arg1)) ) (('eco-pill-dark) (cond ((< 0.0 arg1) - (seek! (-> obj eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default) arg1) - (if (and (demo?) (= (-> obj eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default))) + (seek! (-> this eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default) arg1) + (if (and (demo?) (= (-> this eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default))) (talker-spawn-func (-> *talker-speech* 79) *entity-pool* (target-pos 0) (the-as region #f)) ) - (+! (-> obj eco-pill-dark-total) arg1) + (+! (-> this eco-pill-dark-total) arg1) ) (else - (seek! (-> obj eco-pill-dark) 0.0 (- arg1)) + (seek! (-> this eco-pill-dark) 0.0 (- arg1)) ) ) - (-> obj eco-pill-dark) + (-> this eco-pill-dark) ) (('fuel-cell) (let ((task (the int arg1))) - (when (not (or (task-complete? obj (the-as game-task task)) (>= (the-as uint 1) (the-as uint task)))) - (set! (-> obj task-deaths) 0) - (set! (-> obj task-pickup-time) (-> *display* game-clock frame-counter)) - (set! (-> obj unknown-array1 task) (-> *display* game-clock frame-counter)) - (+! (-> obj fuel) 1.0) - (logior! (-> obj task-perm-list data task status) (entity-perm-status complete)) + (when (not (or (task-complete? this (the-as game-task task)) (>= (the-as uint 1) (the-as uint task)))) + (set! (-> this task-deaths) 0) + (set! (-> this task-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this unknown-array1 task) (-> *display* game-clock frame-counter)) + (+! (-> this fuel) 1.0) + (logior! (-> this task-perm-list data task status) (entity-perm-status complete)) (task-resolution-close! (the-as game-task task)) ) ) - (-> obj fuel) + (-> this fuel) ) (('buzzer) (logand (the int arg1) #xffff) @@ -546,15 +546,15 @@ ) ) ) - (if (logtest? (-> obj features) (game-feature gun-upgrade-ammo)) + (if (logtest? (-> this features) (game-feature gun-upgrade-ammo)) (set! ammo-max (* 2.0 ammo-max)) ) (if (>= arg1 0.0) - (seek! (-> obj gun-ammo ammo-kind) ammo-max arg1) - (seek! (-> obj gun-ammo ammo-kind) 0.0 (fabs arg1)) + (seek! (-> this gun-ammo ammo-kind) ammo-max arg1) + (seek! (-> this gun-ammo ammo-kind) 0.0 (fabs arg1)) ) - (set! (-> obj gun-ammo ammo-kind) (fmin (-> obj gun-ammo ammo-kind) ammo-max)) - (-> obj gun-ammo ammo-kind) + (set! (-> this gun-ammo ammo-kind) (fmin (-> this gun-ammo ammo-kind) ammo-max)) + (-> this gun-ammo ammo-kind) ) ) (('gun-yellow) @@ -575,7 +575,7 @@ ) ) ) - (if (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow)) (-> obj features)) + (if (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow)) (-> this features)) 1.0 0.0 ) @@ -598,7 +598,7 @@ ) ) ) - (if (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark)) (-> obj features)) + (if (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark)) (-> this features)) 1.0 0.0 ) @@ -606,132 +606,132 @@ (('board) (cond ((< 0.0 arg1) - (logior! (-> obj features) (game-feature board)) + (logior! (-> this features) (game-feature board)) ) ((< arg1 0.0) - (logclear! (-> obj features) (game-feature board)) + (logclear! (-> this features) (game-feature board)) ) ) - (if (logtest? (-> obj features) (game-feature board)) + (if (logtest? (-> this features) (game-feature board)) 1.0 0.0 ) ) (('shield) (if (>= arg1 0.0) - (seek! (-> obj shield) (-> *FACT-bank* shield-max) arg1) - (seek! (-> obj shield) 0.0 (fabs arg1)) + (seek! (-> this shield) (-> *FACT-bank* shield-max) arg1) + (seek! (-> this shield) 0.0 (fabs arg1)) ) - (-> obj shield) + (-> this shield) ) ) ) ) ;; definition for method 22 of type game-info -(defmethod game-info-method-22 game-info ((obj game-info)) +(defmethod game-info-method-22 game-info ((this game-info)) 0 ) ;; definition for method 10 of type fact-info-target ;; WARN: Return type mismatch float vs none. -(defmethod reset! fact-info-target ((obj fact-info-target) (arg0 symbol)) +(defmethod reset! fact-info-target ((this fact-info-target) (arg0 symbol)) (when (or (not arg0) (= arg0 'eco)) - (set! (-> obj eco-timeout) 0) - (set! (-> obj eco-level) 0.0) - (set! (-> obj eco-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this eco-timeout) 0) + (set! (-> this eco-level) 0.0) + (set! (-> this eco-pickup-time) (-> *display* game-clock frame-counter)) ) (when (or (not arg0) (= arg0 'health) (= arg0 'eco-green)) - (set! (-> obj health-max) (-> *FACT-bank* health-max-default)) - (set! (-> obj health) (-> obj health-max)) - (set! (-> obj health-pickup-time) (seconds -100)) + (set! (-> this health-max) (-> *FACT-bank* health-max-default)) + (set! (-> this health) (-> this health-max)) + (set! (-> this health-pickup-time) (seconds -100)) ) (when (or (not arg0) (= arg0 'buzzer)) - (set! (-> obj buzzer-max) (-> *FACT-bank* buzzer-max-default)) - (set! (-> obj buzzer) 0.0) + (set! (-> this buzzer-max) (-> *FACT-bank* buzzer-max-default)) + (set! (-> this buzzer) 0.0) ) (when (or (not arg0) (= arg0 'eco-pill-green)) - (set! (-> obj eco-pill-green-max) (-> *FACT-bank* eco-pill-green-max-default)) - (set! (-> obj eco-pill-green) 0.0) + (set! (-> this eco-pill-green-max) (-> *FACT-bank* eco-pill-green-max-default)) + (set! (-> this eco-pill-green) 0.0) ) (when (or (not arg0) (= arg0 'trick-judge)) - (set! (-> obj trick-point-start-time) 0) - (set! (-> obj trick-point-duration) 0) + (set! (-> this trick-point-start-time) 0) + (set! (-> this trick-point-duration) 0) 0 ) (when (or (not arg0) (= arg0 'trick-point)) - (set! (-> obj trick-point) 0.0) - (set! (-> (the-as target (-> obj process)) game score) 0.0) + (set! (-> this trick-point) 0.0) + (set! (-> (the-as target (-> this process)) game score) 0.0) ) (none) ) ;; definition for method 11 of type fact-info-target -(defmethod pickup-collectable! fact-info-target ((obj fact-info-target) (arg0 pickup-type) (arg1 float) (arg2 handle)) +(defmethod pickup-collectable! fact-info-target ((this fact-info-target) (arg0 pickup-type) (arg1 float) (arg2 handle)) (case arg0 (((pickup-type health) (pickup-type eco-green)) (cond ((>= arg1 0.0) (when (< 0.0 arg1) - (if (or (!= (handle->process arg2) (handle->process (-> obj eco-source))) - (>= (- (-> *display* game-clock frame-counter) (-> obj eco-source-time)) (seconds 0.5)) + (if (or (!= (handle->process arg2) (handle->process (-> this eco-source))) + (>= (- (-> *display* game-clock frame-counter) (-> this eco-source-time)) (seconds 0.5)) ) (sound-play "get-green-eco") ) - (send-event (-> obj process) 'color-effect 'health (seconds 0.2)) + (send-event (-> this process) 'color-effect 'health (seconds 0.2)) (when (handle->process arg2) - (set! (-> obj eco-source) arg2) - (set! (-> obj eco-source-time) (-> *display* game-clock frame-counter)) + (set! (-> this eco-source) arg2) + (set! (-> this eco-source-time) (-> *display* game-clock frame-counter)) ) ) - (set! (-> obj health-pickup-time) (-> *display* game-clock frame-counter)) - (seek! (-> obj health) (-> obj health-max) arg1) + (set! (-> this health-pickup-time) (-> *display* game-clock frame-counter)) + (seek! (-> this health) (-> this health-max) arg1) ) (else - (seek! (-> obj health) 0.0 (- arg1)) + (seek! (-> this health) 0.0 (- arg1)) (if (>= arg1 -10.0) - (pickup-collectable! obj (pickup-type eco-pill-green) 0.0 arg2) + (pickup-collectable! this (pickup-type eco-pill-green) 0.0 arg2) ) - (if (= (-> obj health) 0.0) - (give (-> (the-as target (-> obj process)) game) 'life (- (-> *GAME-bank* life-single-inc)) arg2) + (if (= (-> this health) 0.0) + (give (-> (the-as target (-> this process)) game) 'life (- (-> *GAME-bank* life-single-inc)) arg2) ) ) ) - (-> obj health) + (-> this health) ) (((pickup-type eco-pill-green)) (when (>= arg1 0.0) - (set! (-> obj eco-pill-green-pickup-time) (-> *display* game-clock frame-counter)) - (seek! (-> obj eco-pill-green) (-> obj eco-pill-green-max) arg1) - (when (and (>= (-> obj eco-pill-green) (-> *FACT-bank* eco-pill-green-max-default)) - (< (-> obj health) (-> obj health-max)) + (set! (-> this eco-pill-green-pickup-time) (-> *display* game-clock frame-counter)) + (seek! (-> this eco-pill-green) (-> this eco-pill-green-max) arg1) + (when (and (>= (-> this eco-pill-green) (-> *FACT-bank* eco-pill-green-max-default)) + (< (-> this health) (-> this health-max)) ) - (set! (-> obj eco-pill-green) (- (-> obj eco-pill-green) (-> *FACT-bank* eco-pill-green-max-default))) + (set! (-> this eco-pill-green) (- (-> this eco-pill-green) (-> *FACT-bank* eco-pill-green-max-default))) (pickup-collectable! - obj + this (pickup-type health) (-> *FACT-bank* health-small-inc) - (process->handle (-> obj process)) + (process->handle (-> this process)) ) ) ) - (-> obj eco-pill-green) + (-> this eco-pill-green) ) (((pickup-type eco-pill-dark)) (when (< 0.0 arg1) - (if (>= (- (-> *display* game-clock frame-counter) (-> obj eco-pill-dark-pickup-time)) (seconds 0.05)) + (if (>= (- (-> *display* game-clock frame-counter) (-> this eco-pill-dark-pickup-time)) (seconds 0.05)) (sound-play "get-dark-eco") ) - (send-event (-> obj process) 'color-effect 'eco-pill-dark (seconds 0.2)) + (send-event (-> this process) 'color-effect 'eco-pill-dark (seconds 0.2)) (cond - ((>= (- (-> *display* game-clock frame-counter) (-> (the-as target (-> obj process)) shock-effect-time)) + ((>= (- (-> *display* game-clock frame-counter) (-> (the-as target (-> this process)) shock-effect-time)) (seconds 0.1) ) - (set! (-> (the-as target (-> obj process)) shock-effect-time) (-> *display* game-clock frame-counter)) + (set! (-> (the-as target (-> this process)) shock-effect-time) (-> *display* game-clock frame-counter)) (let ((s3-3 (rand-vu-int-range 0 2))) (dotimes (s2-2 s3-3) (process-drawable-shock-effect - (the-as process-drawable (-> obj process)) + (the-as process-drawable (-> this process)) *lightning-darkjak-pill* lightning-probe-callback (the-as sparticle-launcher #f) @@ -746,22 +746,22 @@ (send-event (handle->process arg2) 'effect #f) ) ) - (set! (-> obj eco-pill-dark-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this eco-pill-dark-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'eco-pill-dark arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'eco-pill-dark arg1 arg2) ) (((pickup-type trick-judge)) (when (< 0.0 arg1) - (set! (-> obj trick-point) 0.0) - (set! (-> obj trick-point-start-time) (-> *display* game-clock frame-counter)) - (set! (-> obj trick-point-duration) (the-as time-frame (the int arg1))) + (set! (-> this trick-point) 0.0) + (set! (-> this trick-point-start-time) (-> *display* game-clock frame-counter)) + (set! (-> this trick-point-duration) (the-as time-frame (the int arg1))) ) - (the float (-> obj trick-point-duration)) + (the float (-> this trick-point-duration)) ) (((pickup-type trick-point)) - (when (nonzero? (-> obj trick-point-duration)) - (set! (-> obj trick-point-pickup-time) (-> *display* game-clock frame-counter)) - (set! (-> obj trick-point) (fmax 0.0 (fmin (+ (-> obj trick-point) arg1) (-> *FACT-bank* trick-point-max)))) + (when (nonzero? (-> this trick-point-duration)) + (set! (-> this trick-point-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this trick-point) (fmax 0.0 (fmin (+ (-> this trick-point) arg1) (-> *FACT-bank* trick-point-max)))) (when (!= arg1 0.0) (sound-play "get-trick-point") (process-spawn-function @@ -789,7 +789,7 @@ ) (set! (-> s5-0 flags) (font-flags shadow kerning large)) (let ((s3-1 (current-time))) - (until (>= (- (current-time) s3-1) (+ arg2 -75)) + (until (time-elapsed? s3-1 (+ arg2 -75)) (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) (let ((s2-0 print-game-text)) (format (clear *temp-string*) "~4,,0f" arg1) @@ -799,7 +799,7 @@ ) ) (let ((s4-1 (current-time))) - (until (>= (- (current-time) s4-1) (seconds 0.25)) + (until (time-elapsed? s4-1 (seconds 0.25)) (set! (-> s5-0 alpha) (lerp-scale 1.0 0.0 (the float (- (current-time) s4-1)) 0.0 150.0)) (+! (-> s5-0 origin y) (* -120.0 (seconds-per-frame))) (let ((s3-2 print-game-text)) @@ -814,71 +814,71 @@ ) (none) ) - (get-trans (the-as target (-> obj process)) 3) + (get-trans (the-as target (-> this process)) 3) arg1 510 - :to (-> obj process) + :to (-> this process) ) ) ) - (-> obj trick-point) + (-> this trick-point) ) (((pickup-type money)) (when (< 0.0 arg1) - (if (>= (- (-> *display* game-clock frame-counter) (-> obj money-pickup-time)) (seconds 0.05)) + (if (>= (- (-> *display* game-clock frame-counter) (-> this money-pickup-time)) (seconds 0.05)) (sound-play "money-pickup") ) - (set! (-> obj money-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this money-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'money arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'money arg1 arg2) ) (((pickup-type gem)) (when (< 0.0 arg1) - (if (>= (- (-> *display* game-clock frame-counter) (-> obj gem-pickup-time)) (seconds 0.05)) + (if (>= (- (-> *display* game-clock frame-counter) (-> this gem-pickup-time)) (seconds 0.05)) (sound-play "gem-pickup") ) - (set! (-> obj gem-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this gem-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'gem arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'gem arg1 arg2) ) (((pickup-type skill)) (when (< 0.0 arg1) - (if (>= (- (-> *display* game-clock frame-counter) (-> obj skill-pickup-time)) (seconds 0.05)) + (if (>= (- (-> *display* game-clock frame-counter) (-> this skill-pickup-time)) (seconds 0.05)) (sound-play "skill-pickup") ) - (set! (-> obj skill-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this skill-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'skill arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'skill arg1 arg2) ) (((pickup-type karma)) (if (!= arg1 0.0) - (set! (-> obj karma-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this karma-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'karma arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'karma arg1 arg2) ) (((pickup-type fuel-cell)) (let ((s3-9 (the int arg1))) - (if (not (or (task-complete? (-> (the-as target (-> obj process)) game) (the-as game-task s3-9)) + (if (not (or (task-complete? (-> (the-as target (-> this process)) game) (the-as game-task s3-9)) (>= (the-as uint 1) (the-as uint s3-9)) ) ) - (set! (-> obj task-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this task-pickup-time) (-> *display* game-clock frame-counter)) ) ) - (give (-> (the-as target (-> obj process)) game) 'fuel-cell arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'fuel-cell arg1 arg2) ) (((pickup-type buzzer)) - (let ((f0-41 (give (-> (the-as target (-> obj process)) game) 'buzzer arg1 arg2))) - (if (!= f0-41 (-> obj buzzer)) - (set! (-> obj buzzer-pickup-time) (-> *display* game-clock frame-counter)) + (let ((f0-41 (give (-> (the-as target (-> this process)) game) 'buzzer arg1 arg2))) + (if (!= f0-41 (-> this buzzer)) + (set! (-> this buzzer-pickup-time) (-> *display* game-clock frame-counter)) ) - (set! (-> obj buzzer) f0-41) + (set! (-> this buzzer) f0-41) ) - (-> obj buzzer) + (-> this buzzer) ) (((pickup-type ammo-yellow) (pickup-type ammo-red) (pickup-type ammo-blue) (pickup-type ammo-dark)) (if (< 0.0 arg1) - (set! (-> obj ammo-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this ammo-pickup-time) (-> *display* game-clock frame-counter)) ) (let ((ammo-kind (cond ((= arg0 (pickup-type ammo-yellow)) @@ -897,9 +897,9 @@ ) ) (if (< 0.0 arg1) - (send-event (-> obj process) 'color-effect ammo-kind (seconds 0.2)) + (send-event (-> this process) 'color-effect ammo-kind (seconds 0.2)) ) - (give (-> (the-as target (-> obj process)) game) ammo-kind arg1 arg2) + (give (-> (the-as target (-> this process)) game) ammo-kind arg1 arg2) ) ) (((pickup-type gun-yellow) @@ -910,7 +910,7 @@ ) (let ((v1-192 arg0)) (give - (-> (the-as target (-> obj process)) game) + (-> (the-as target (-> this process)) game) (cond ((= v1-192 (pickup-type gun-yellow)) 'gun-yellow @@ -935,50 +935,50 @@ ) (((pickup-type shield)) (if (< 0.0 arg1) - (set! (-> obj shield-pickup-time) (-> *display* game-clock frame-counter)) + (set! (-> this shield-pickup-time) (-> *display* game-clock frame-counter)) ) - (give (-> (the-as target (-> obj process)) game) 'shield arg1 arg2) + (give (-> (the-as target (-> this process)) game) 'shield arg1 arg2) ) (((pickup-type eco-red) (pickup-type eco-blue) (pickup-type eco-yellow)) (if (= arg1 0.0) - (return (if (= (-> obj eco-type) arg0) - (-> obj eco-level) + (return (if (= (-> this eco-type) arg0) + (-> this eco-level) 0.0 ) ) ) - (when (!= (-> obj eco-type) arg0) - (set! (-> obj eco-level) 0.0) - (set! (-> obj eco-timeout) 0) + (when (!= (-> this eco-type) arg0) + (set! (-> this eco-level) 0.0) + (set! (-> this eco-timeout) 0) 0 ) - (set! (-> obj eco-type) (the-as int arg0)) - (let ((f0-49 (-> obj eco-level))) - (set! (-> obj eco-level) 1.0) - (when (and (= f0-49 0.0) (< 0.0 (-> obj eco-level))) - (set! (-> obj eco-pickup-time) (-> *display* game-clock frame-counter)) - (send-event (-> obj process) 'reset-collide) + (set! (-> this eco-type) (the-as int arg0)) + (let ((f0-49 (-> this eco-level))) + (set! (-> this eco-level) 1.0) + (when (and (= f0-49 0.0) (< 0.0 (-> this eco-level))) + (set! (-> this eco-pickup-time) (-> *display* game-clock frame-counter)) + (send-event (-> this process) 'reset-collide) ) ) - (set! (-> obj eco-timeout) + (set! (-> this eco-timeout) (the-as time-frame (min - (+ (-> obj eco-timeout) (* (the-as int (-> *FACT-bank* eco-single-timeout)) (the int arg1))) + (+ (-> this eco-timeout) (* (the-as int (-> *FACT-bank* eco-single-timeout)) (the int arg1))) (the-as time-frame - (+ (-> *FACT-bank* eco-full-timeout) (- (-> *display* game-clock frame-counter) (-> obj eco-pickup-time))) + (+ (-> *FACT-bank* eco-full-timeout) (- (-> *display* game-clock frame-counter) (-> this eco-pickup-time))) ) ) ) ) - (if (>= (- (-> obj eco-timeout) (- (-> *display* game-clock frame-counter) (-> obj eco-pickup-time))) + (if (>= (- (-> this eco-timeout) (- (-> *display* game-clock frame-counter) (-> this eco-pickup-time))) (the-as time-frame (-> *FACT-bank* eco-full-timeout)) ) - (set! (-> obj eco-level) 2.0) + (set! (-> this eco-level) 2.0) ) - (when (not (and (= (handle->process arg2) (handle->process (-> obj eco-source))) - (< (- (-> *display* game-clock frame-counter) (-> obj eco-source-time)) (seconds 0.5)) + (when (not (and (= (handle->process arg2) (handle->process (-> this eco-source))) + (< (- (-> *display* game-clock frame-counter) (-> this eco-source-time)) (seconds 0.5)) ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 (seconds 0.2)) @@ -998,19 +998,19 @@ ) ) ) - (set! (-> obj eco-source) arg2) - (set! (-> obj eco-source-time) (-> *display* game-clock frame-counter)) - (-> obj eco-level) + (set! (-> this eco-source) arg2) + (set! (-> this eco-source-time) (-> *display* game-clock frame-counter)) + (-> this eco-level) ) (else - ((method-of-type fact-info pickup-collectable!) obj arg0 arg1 arg2) + ((method-of-type fact-info pickup-collectable!) this arg0 arg1 arg2) ) ) ) ;; definition for method 14 of type game-info -(defmethod actor-perm game-info ((obj game-info) (arg0 actor-id)) - (let ((game-perms (-> obj perm-list))) +(defmethod actor-perm game-info ((this game-info) (arg0 actor-id)) + (let ((game-perms (-> this perm-list))) (countdown (i (-> game-perms length)) (if (= arg0 (-> game-perms data i aid)) (return (-> game-perms data i)) @@ -1022,14 +1022,14 @@ ;; definition for method 16 of type game-info ;; INFO: Used lq/sq -(defmethod copy-perms-from-level! game-info ((obj game-info) (arg0 level)) - (let ((game-perms (-> obj perm-list)) +(defmethod copy-perms-from-level! game-info ((this game-info) (arg0 level)) + (let ((game-perms (-> this perm-list)) (level-entities (-> arg0 bsp level entity)) ) (dotimes (i (-> level-entities length)) (let ((entity-perm (-> level-entities data i entity extra perm))) (when (or (nonzero? (-> entity-perm task)) (logtest? (-> entity-perm status) (entity-perm-status save))) - (let ((actor-perm (actor-perm obj (-> entity-perm aid)))) + (let ((actor-perm (actor-perm this (-> entity-perm aid)))) (cond (actor-perm (set! (-> actor-perm quad) (-> entity-perm quad)) @@ -1049,11 +1049,11 @@ ;; definition for method 17 of type game-info ;; INFO: Used lq/sq -(defmethod copy-perms-to-level! game-info ((obj game-info) (arg0 level)) +(defmethod copy-perms-to-level! game-info ((this game-info) (arg0 level)) (let ((level-entities (-> arg0 bsp level entity))) (dotimes (i (-> level-entities length)) (let* ((entity-perm (-> level-entities data i entity extra perm)) - (actor-perm (actor-perm obj (-> entity-perm aid))) + (actor-perm (actor-perm this (-> entity-perm aid))) ) (when actor-perm (set! (-> entity-perm quad) (-> actor-perm quad)) @@ -1066,28 +1066,28 @@ ) ;; definition for method 2 of type continue-point -(defmethod print continue-point ((obj continue-point)) - (format #t "#<~A ~S @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print continue-point ((this continue-point)) + (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) + this ) ;; definition for method 9 of type continue-point ;; INFO: Used lq/sq -(defmethod debug-draw continue-point ((obj continue-point)) - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj trans) (new 'static 'rgba :r #xff :a #x80)) +(defmethod debug-draw continue-point ((this continue-point)) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this trans) (new 'static 'rgba :r #xff :a #x80)) (add-debug-text-3d #t (bucket-id debug-no-zbuf1) - (-> obj name) - (-> obj trans) + (-> this name) + (-> this trans) (font-color white) (new 'static 'vector2h :data (new 'static 'array int16 2 0 8)) ) - (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (the-as quaternion (-> obj quat))))) + (let ((a3-2 (vector-z-quaternion! (new-stack-vector0) (the-as quaternion (-> this quat))))) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj trans) + (-> this trans) a3-2 (meters 2) (new 'static 'rgba :r #xff :g #x80 :a #x80) @@ -1238,7 +1238,7 @@ (lambda :behavior process ((arg0 string)) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 10)) + (until (time-elapsed? s5-0 (seconds 10)) (format *stdcon* "~S~%" arg0) (suspend) ) @@ -1286,14 +1286,14 @@ ) ;; definition for method 2 of type game-task-info -(defmethod print game-task-info ((obj game-task-info)) - (format #t "#" (-> obj name) obj) - obj +(defmethod print game-task-info ((this game-task-info)) + (format #t "#" (-> this name) this) + this ) ;; definition for method 18 of type game-info ;; INFO: Used lq/sq -(defmethod debug-inspect game-info ((obj game-info) (arg0 symbol)) +(defmethod debug-inspect game-info ((this game-info) (arg0 symbol)) (local-vars (sv-16 int) (sv-24 int) @@ -1306,7 +1306,7 @@ (sv-96 string) (sv-112 string) ) - (inspect obj) + (inspect this) (when (or (not arg0) (= arg0 'game-task)) (format #t "~Tgame-task:~%") (format #t "~T~T~-32S intro play death gem skill~%" "task") @@ -1315,7 +1315,7 @@ (s3-0 109) ) (while (>= (the-as uint s3-0) (the-as uint s4-0)) - (when (task-complete? obj (the-as game-task s4-0)) + (when (task-complete? this (the-as game-task s4-0)) (set! sv-16 0) (set! sv-24 0) (set! sv-32 0) @@ -1346,8 +1346,8 @@ ) ) (label cfg-19) - (if (nonzero? (-> obj task-close-times s4-0)) - (set! sv-24 (max sv-24 (-> obj task-close-times s4-0))) + (if (nonzero? (-> this task-close-times s4-0)) + (set! sv-24 (max sv-24 (-> this task-close-times s4-0))) ) (format #t @@ -1406,9 +1406,9 @@ #t "~T~T~-32S ~3d ~6,,1f min ~6,,1f min~%" (-> *task-level* s4-2) - (-> obj deaths-per-level s4-2) - (* 0.000055555556 (the float (-> obj task-in-times s4-2))) - (* 0.000055555556 (the float (-> obj task-enter-times s4-2))) + (-> this deaths-per-level s4-2) + (* 0.000055555556 (the float (-> this task-in-times s4-2))) + (* 0.000055555556 (the float (-> this task-enter-times s4-2))) ) ) ) @@ -1416,7 +1416,7 @@ (format #t "~Tscore:~%") (format #t "~T~T--------------------~%") (dotimes (s4-3 19) - (let ((v1-71 (get-game-score-ref obj s4-3)) + (let ((v1-71 (get-game-score-ref this s4-3)) (t9-18 format) (a0-26 #t) (a1-24 "~T~T~-32S ~8,,0f ~8,,0f ~8,,0f~%") @@ -1496,17 +1496,17 @@ ) (when (= arg0 'entity-perm) (format #t "~Tentity-perm:~%") - (let ((game-perms (-> obj perm-list))) + (let ((game-perms (-> this perm-list))) (dotimes (s4-4 (-> game-perms length)) (format #t "~T~T~`entity-perm`P~%" (-> game-perms data s4-4)) ) ) ) - obj + this ) ;; definition for method 25 of type game-info -(defmethod you-suck-stage game-info ((obj game-info) (arg0 symbol)) +(defmethod you-suck-stage game-info ((this game-info) (arg0 symbol)) (cond ((logtest? (-> *game-info* secrets) (game-secrets hero-mode)) 0 @@ -1541,23 +1541,23 @@ ) ;; definition for method 26 of type game-info -(defmethod you-suck-scale game-info ((obj game-info) (arg0 object)) - (* 0.25 (the float (you-suck-stage obj #f))) +(defmethod you-suck-scale game-info ((this game-info) (arg0 object)) + (* 0.25 (the float (you-suck-stage this #f))) ) ;; definition for method 9 of type cpad-info -(defmethod adjust-to-screen-flip cpad-info ((obj cpad-info)) +(defmethod adjust-to-screen-flip cpad-info ((this cpad-info)) (when (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) - (set! (-> obj leftx) (- 255 (the-as int (-> obj leftx)))) - (set! (-> obj rightx) (- 255 (the-as int (-> obj rightx)))) + (set! (-> this leftx) (- 255 (the-as int (-> this leftx)))) + (set! (-> this rightx) (- 255 (the-as int (-> this rightx)))) ) 0 ) ;; definition for method 28 of type game-info -(defmethod game-info-method-28 game-info ((obj game-info) (arg0 game-score) (arg1 float)) +(defmethod game-info-method-28 game-info ((this game-info) (arg0 game-score) (arg1 float)) (when (!= arg1 0.0) - (let ((v1-3 (&+ (-> obj game-score data) (* (* arg0 8) 4)))) + (let ((v1-3 (&+ (-> this game-score data) (* (* arg0 8) 4)))) (case arg0 (((game-score race-1) (game-score race-2) @@ -1605,38 +1605,38 @@ ) ;; definition for method 29 of type game-info -(defmethod get-game-score-ref game-info ((obj game-info) (arg0 int)) - (&+ (-> obj game-score data) (* (* arg0 8) 4)) +(defmethod get-game-score-ref game-info ((this game-info) (arg0 int)) + (&+ (-> this game-score data) (* (* arg0 8) 4)) ) ;; definition for method 9 of type highscore-info -(defmethod get-rank highscore-info ((obj highscore-info) (arg0 float)) +(defmethod get-rank highscore-info ((this highscore-info) (arg0 float)) (let ((v0-0 0)) (cond - ((logtest? (-> obj flags) (highscore-flags time)) + ((logtest? (-> this flags) (highscore-flags time)) (cond ((= arg0 0.0) ) - ((>= (-> obj gold-score) arg0) + ((>= (-> this gold-score) arg0) (set! v0-0 3) ) - ((>= (-> obj silver-score) arg0) + ((>= (-> this silver-score) arg0) (set! v0-0 2) ) - ((>= (-> obj bronze-score) arg0) + ((>= (-> this bronze-score) arg0) (set! v0-0 1) ) ) ) (else (cond - ((>= arg0 (-> obj gold-score)) + ((>= arg0 (-> this gold-score)) (set! v0-0 3) ) - ((>= arg0 (-> obj silver-score)) + ((>= arg0 (-> this silver-score)) (set! v0-0 2) ) - ((>= arg0 (-> obj bronze-score)) + ((>= arg0 (-> this bronze-score)) (set! v0-0 1) ) ) diff --git a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc index 0515d5dffb..6747454561 100644 --- a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc @@ -256,29 +256,29 @@ ) ;; definition for method 3 of type game-save-tag -(defmethod inspect game-save-tag ((obj game-save-tag)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-save-tag ((this game-save-tag)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'game-save-tag) - (format #t "~1Tuser-object[2] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-uint64: ~D~%" (-> obj user-uint64)) - (format #t "~1Tuser-float0: ~f~%" (-> obj user-float0)) - (format #t "~1Tuser-float[2] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-int32[2] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-uint32[2] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-int16[4] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-uint16[4] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-int8[8] @ #x~X~%" (-> obj user-object)) - (format #t "~1Tuser-int80: ~D~%" (-> obj user-int80)) - (format #t "~1Tuser-int81: ~D~%" (-> obj user-int81)) - (format #t "~1Tuser-uint8[8] @ #x~X~%" (-> obj user-object)) - (format #t "~1Telt-count: ~D~%" (-> obj elt-count)) - (format #t "~1Telt-size: ~D~%" (-> obj elt-size)) - (format #t "~1Telt-type: ~D~%" (-> obj elt-type)) + (format #t "[~8x] ~A~%" this 'game-save-tag) + (format #t "~1Tuser-object[2] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-uint64: ~D~%" (-> this user-uint64)) + (format #t "~1Tuser-float0: ~f~%" (-> this user-float0)) + (format #t "~1Tuser-float[2] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-int32[2] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-uint32[2] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-int16[4] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-uint16[4] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-int8[8] @ #x~X~%" (-> this user-object)) + (format #t "~1Tuser-int80: ~D~%" (-> this user-int80)) + (format #t "~1Tuser-int81: ~D~%" (-> this user-int81)) + (format #t "~1Tuser-uint8[8] @ #x~X~%" (-> this user-object)) + (format #t "~1Telt-count: ~D~%" (-> this elt-count)) + (format #t "~1Telt-size: ~D~%" (-> this elt-size)) + (format #t "~1Telt-type: ~D~%" (-> this elt-type)) (label cfg-4) - obj + this ) ;; definition of type game-save @@ -317,40 +317,40 @@ ;; definition for method 3 of type game-save ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-save ((obj game-save)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-save ((this game-save)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tversion: ~D~%" (-> obj version)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tinfo-int32[16] @ #x~X~%" (-> obj info-int32)) - (format #t "~1Tinfo-int8[64] @ #x~X~%" (-> obj info-int32)) - (format #t "~1Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~1Tgem-count: ~f~%" (-> obj gem-count)) - (format #t "~1Tskill-count: ~f~%" (-> obj skill-count)) - (format #t "~1Tcompletion-percentage: ~f~%" (-> obj completion-percentage)) - (format #t "~1Tminute: #x~X~%" (-> obj minute)) - (format #t "~1Thour: #x~X~%" (-> obj hour)) - (format #t "~1Tweek: #x~X~%" (-> obj week)) - (format #t "~1Tday: #x~X~%" (-> obj day)) - (format #t "~1Tmonth: #x~X~%" (-> obj month)) - (format #t "~1Tyear: #x~X~%" (-> obj year)) - (format #t "~1Tnew-game: ~D~%" (-> obj new-game)) - (format #t "~1Tgame-time: ~D~%" (-> obj game-time)) - (format #t "~1Tsecrets: ~D~%" (-> obj secrets)) - (format #t "~1Tfeatures: ~D~%" (-> obj features)) - (format #t "~1Ttag[0] @ #x~X~%" (-> obj tag)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tversion: ~D~%" (-> this version)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tinfo-int32[16] @ #x~X~%" (-> this info-int32)) + (format #t "~1Tinfo-int8[64] @ #x~X~%" (-> this info-int32)) + (format #t "~1Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~1Tgem-count: ~f~%" (-> this gem-count)) + (format #t "~1Tskill-count: ~f~%" (-> this skill-count)) + (format #t "~1Tcompletion-percentage: ~f~%" (-> this completion-percentage)) + (format #t "~1Tminute: #x~X~%" (-> this minute)) + (format #t "~1Thour: #x~X~%" (-> this hour)) + (format #t "~1Tweek: #x~X~%" (-> this week)) + (format #t "~1Tday: #x~X~%" (-> this day)) + (format #t "~1Tmonth: #x~X~%" (-> this month)) + (format #t "~1Tyear: #x~X~%" (-> this year)) + (format #t "~1Tnew-game: ~D~%" (-> this new-game)) + (format #t "~1Tgame-time: ~D~%" (-> this game-time)) + (format #t "~1Tsecrets: ~D~%" (-> this secrets)) + (format #t "~1Tfeatures: ~D~%" (-> this features)) + (format #t "~1Ttag[0] @ #x~X~%" (-> this tag)) (label cfg-4) - obj + this ) ;; definition for method 5 of type game-save ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of game-save ((obj game-save)) - (the-as int (+ (-> game-save size) (-> obj allocated-length))) +(defmethod asize-of game-save ((this game-save)) + (the-as int (+ (-> game-save size) (-> this allocated-length))) ) ;; definition for method 0 of type game-save @@ -364,33 +364,33 @@ ;; definition for method 11 of type game-save ;; INFO: Used lq/sq -(defmethod debug-inspect game-save ((obj game-save) (arg0 symbol)) +(defmethod debug-inspect game-save ((this game-save) (arg0 symbol)) (local-vars (sv-16 int) (sv-32 string) (sv-48 string)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tversion: ~D~%" (-> obj version)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~Tgem-count: ~f~%" (-> obj gem-count)) - (format #t "~Tskill-count: ~f~%" (-> obj skill-count)) - (format #t "~Tcompletion-percentage: ~f~%" (-> obj completion-percentage)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tversion: ~D~%" (-> this version)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~Tgem-count: ~f~%" (-> this gem-count)) + (format #t "~Tskill-count: ~f~%" (-> this skill-count)) + (format #t "~Tcompletion-percentage: ~f~%" (-> this completion-percentage)) (format #t "~Tsave-time: ~x:~x ~x/~x/~x~%" - (-> obj hour) - (-> obj minute) - (-> obj day) - (-> obj month) - (-> obj year) + (-> this hour) + (-> this minute) + (-> this day) + (-> this month) + (-> this year) ) - (format #t "~Tgame-time: ~E~%" (-> obj game-time)) - (format #t "~Tsecrets: #x~x~%" (-> obj secrets)) - (format #t "~Tfeatures: #x~x~%" (-> obj features)) - (format #t "~Ttag[]: @ #x~X~%" (-> obj tag)) - (let ((s4-0 (the-as object (-> obj tag))) + (format #t "~Tgame-time: ~E~%" (-> this game-time)) + (format #t "~Tsecrets: #x~x~%" (-> this secrets)) + (format #t "~Tfeatures: #x~x~%" (-> this features)) + (format #t "~Ttag[]: @ #x~X~%" (-> this tag)) + (let ((s4-0 (the-as object (-> this tag))) (s3-0 0) ) - (while (< (the-as int s4-0) (the-as int (&-> obj tag 0 user-int8 (-> obj length)))) + (while (< (the-as int s4-0) (the-as int (&-> this tag 0 user-int8 (-> this length)))) (let ((s2-0 format) (s1-0 #t) (s0-0 "~T [~3D] ~-32S [~3D/~3D] ~12D ~8f ") @@ -507,35 +507,35 @@ (+! s3-0 1) ) ) - obj + this ) ;; definition for method 3 of type game-save ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-save ((obj game-save)) - (debug-inspect obj #f) +(defmethod inspect game-save ((this game-save)) + (debug-inspect this #f) ) ;; definition for method 23 of type game-info -(defmethod save-game game-info ((obj game-info) (arg0 game-save) (arg1 string)) +(defmethod save-game game-info ((this game-info) (arg0 game-save) (arg1 string)) (with-pp (dotimes (s4-0 (-> *level* length)) (let ((a1-1 (-> *level* level s4-0))) (if (= (-> a1-1 status) 'active) - (copy-perms-from-level! obj a1-1) + (copy-perms-from-level! this a1-1) ) ) ) (set! (-> arg0 length) 0) (set! (-> arg0 version) 3) - (let ((s4-1 (get-continue-by-name obj (-> obj current-continue name)))) + (let ((s4-1 (get-continue-by-name this (-> this current-continue name)))) (when (not s4-1) (format 0 "ERROR: SAVE: attempting to save continue ~A which is not in level-info~%" - (-> obj current-continue name) + (-> this current-continue name) ) - (set! s4-1 (get-continue-by-name obj "title-start")) + (set! s4-1 (get-continue-by-name this "title-start")) ) (let ((v1-19 (-> *task-manager-engine* alive-list next0))) *task-manager-engine* @@ -547,7 +547,7 @@ (set! (-> a1-5 message) 'fail-continue) (let ((a1-6 (send-event-function (the-as process-tree (-> (the-as connection v1-19) param1)) a1-5))) (when a1-6 - (let ((a0-13 (get-continue-by-name obj (the-as string a1-6)))) + (let ((a0-13 (get-continue-by-name this (the-as string a1-6)))) (if a0-13 (set! s4-1 a0-13) ) @@ -562,12 +562,12 @@ ) ) (set! (-> arg0 level-index) (the-as int (-> (lookup-level-info (-> s4-1 level)) task-level))) - (set! (-> arg0 gem-count) (-> obj gem)) - (set! (-> arg0 skill-count) (-> obj skill)) - (set! (-> arg0 completion-percentage) (calculate-percentage obj)) + (set! (-> arg0 gem-count) (-> this gem)) + (set! (-> arg0 skill-count) (-> this skill)) + (set! (-> arg0 completion-percentage) (calculate-percentage this)) (set! (-> arg0 game-time) (+ -300000 (-> *display* total-game-clock frame-counter))) - (set! (-> arg0 secrets) (the-as uint (-> obj purchase-secrets))) - (set! (-> arg0 features) (the-as uint (-> obj features))) + (set! (-> arg0 secrets) (the-as uint (-> this purchase-secrets))) + (set! (-> arg0 features) (the-as uint (-> this features))) (when (string= (-> s4-1 name) "title-start") (set! (-> arg0 new-game) 1) (set! (-> arg0 level-index) 0) @@ -693,109 +693,109 @@ (let ((a0-52 (-> (the-as (inline-array game-save-tag) v1-99) 0))) (set! (-> a0-52 elt-type) (game-save-elt life)) (set! (-> a0-52 elt-count) 0) - (set! (-> a0-52 user-float0) (-> obj life)) + (set! (-> a0-52 user-float0) (-> this life)) ) (let ((v1-100 (the-as (inline-array game-save-tag) (&+ (the-as pointer v1-99) 16)))) (let ((a0-53 (-> v1-100 0))) (set! (-> a0-53 elt-type) (game-save-elt buzzer-total)) (set! (-> a0-53 elt-count) 0) - (set! (-> a0-53 user-float0) (-> obj buzzer-total)) + (set! (-> a0-53 user-float0) (-> this buzzer-total)) ) (let ((v1-101 (the-as object (-> v1-100 1)))) (let ((a0-54 (-> (the-as (inline-array game-save-tag) v1-101) 0))) (set! (-> a0-54 elt-type) (game-save-elt fuel-cell)) (set! (-> a0-54 elt-count) 0) - (set! (-> a0-54 user-float0) (-> obj fuel)) + (set! (-> a0-54 user-float0) (-> this fuel)) ) (let ((v1-102 (the-as object (&+ (the-as game-save-tag v1-101) 16)))) (let ((a0-55 (-> (the-as (inline-array game-save-tag) v1-102) 0))) (set! (-> a0-55 elt-type) (game-save-elt death-movie-tick)) (set! (-> a0-55 elt-count) 0) - (set! (-> a0-55 user-uint64) (the-as uint (-> obj death-movie-tick))) + (set! (-> a0-55 user-uint64) (the-as uint (-> this death-movie-tick))) ) (let ((v1-103 (the-as object (&+ (the-as game-save-tag v1-102) 16)))) (let ((a0-56 (-> (the-as (inline-array game-save-tag) v1-103) 0))) (set! (-> a0-56 elt-type) (game-save-elt money)) (set! (-> a0-56 elt-count) 0) - (set! (-> a0-56 user-float0) (-> obj money)) + (set! (-> a0-56 user-float0) (-> this money)) ) (let ((v1-104 (the-as (inline-array game-save-tag) (&+ (the-as game-save-tag v1-103) 16)))) (let ((a0-57 (-> v1-104 0))) (set! (-> a0-57 elt-type) (game-save-elt money-total)) (set! (-> a0-57 elt-count) 0) - (set! (-> a0-57 user-float0) (-> obj money-total)) + (set! (-> a0-57 user-float0) (-> this money-total)) ) (let ((v1-106 (the-as object (-> (the-as (inline-array game-save-tag) (-> v1-104 1)) 2)))) (let ((a0-58 (-> (the-as (inline-array game-save-tag) v1-106) 0))) (set! (-> a0-58 elt-type) (game-save-elt skill)) (set! (-> a0-58 elt-count) 0) - (set! (-> a0-58 user-float0) (-> obj skill)) + (set! (-> a0-58 user-float0) (-> this skill)) ) (let ((v1-107 (the-as object (&+ (the-as game-save-tag v1-106) 16)))) (let ((a0-59 (-> (the-as (inline-array game-save-tag) v1-107) 0))) (set! (-> a0-59 elt-type) (game-save-elt skill-total)) (set! (-> a0-59 elt-count) 0) - (set! (-> a0-59 user-float0) (-> obj skill-total)) + (set! (-> a0-59 user-float0) (-> this skill-total)) ) (let ((v1-108 (the-as object (&+ (the-as game-save-tag v1-107) 16)))) (let ((a0-60 (-> (the-as (inline-array game-save-tag) v1-108) 0))) (set! (-> a0-60 elt-type) (game-save-elt gem)) (set! (-> a0-60 elt-count) 0) - (set! (-> a0-60 user-float0) (-> obj gem)) + (set! (-> a0-60 user-float0) (-> this gem)) ) (let ((v1-109 (the-as object (&+ (the-as game-save-tag v1-108) 16)))) (let ((a0-61 (-> (the-as (inline-array game-save-tag) v1-109) 0))) (set! (-> a0-61 elt-type) (game-save-elt gem-total)) (set! (-> a0-61 elt-count) 0) - (set! (-> a0-61 user-float0) (-> obj gem-total)) + (set! (-> a0-61 user-float0) (-> this gem-total)) ) (let ((v1-110 (the-as object (&+ (the-as game-save-tag v1-109) 16)))) (let ((a0-62 (-> (the-as (inline-array game-save-tag) v1-110) 0))) (set! (-> a0-62 elt-type) (game-save-elt karma)) (set! (-> a0-62 elt-count) 0) - (set! (-> a0-62 user-float0) (-> obj karma)) + (set! (-> a0-62 user-float0) (-> this karma)) ) (let ((v1-111 (the-as object (&+ (the-as game-save-tag v1-110) 16)))) (let ((a0-63 (-> (the-as (inline-array game-save-tag) v1-111) 0))) (set! (-> a0-63 elt-type) (game-save-elt eco-pill-dark)) (set! (-> a0-63 elt-count) 0) - (set! (-> a0-63 user-float0) (-> obj eco-pill-dark)) + (set! (-> a0-63 user-float0) (-> this eco-pill-dark)) ) (let ((v1-112 (the-as object (&+ (the-as game-save-tag v1-111) 16)))) (let ((a0-64 (-> (the-as (inline-array game-save-tag) v1-112) 0))) (set! (-> a0-64 elt-type) (game-save-elt eco-pill-dark-total)) (set! (-> a0-64 elt-count) 0) - (set! (-> a0-64 user-float0) (-> obj eco-pill-dark-total)) + (set! (-> a0-64 user-float0) (-> this eco-pill-dark-total)) ) (let ((v1-113 (the-as object (&+ (the-as game-save-tag v1-112) 16)))) (let ((a0-65 (-> (the-as (inline-array game-save-tag) v1-113) 0))) (set! (-> a0-65 elt-type) (game-save-elt shield)) (set! (-> a0-65 elt-count) 0) - (set! (-> a0-65 user-float0) (-> obj shield)) + (set! (-> a0-65 user-float0) (-> this shield)) ) (let ((v1-114 (the-as object (&+ (the-as game-save-tag v1-113) 16)))) (let ((a0-66 (-> (the-as (inline-array game-save-tag) v1-114) 0))) (set! (-> a0-66 elt-type) (game-save-elt features)) (set! (-> a0-66 elt-count) 0) - (set! (-> a0-66 user-uint64) (the-as uint (-> obj features))) + (set! (-> a0-66 user-uint64) (the-as uint (-> this features))) ) (let ((v1-115 (the-as object (&+ (the-as game-save-tag v1-114) 16)))) (let ((a0-67 (-> (the-as (inline-array game-save-tag) v1-115) 0))) (set! (-> a0-67 elt-type) (game-save-elt secrets)) (set! (-> a0-67 elt-count) 0) - (set! (-> a0-67 user-uint64) (the-as uint (-> obj secrets))) + (set! (-> a0-67 user-uint64) (the-as uint (-> this secrets))) ) (let ((v1-116 (the-as object (&+ (the-as game-save-tag v1-115) 16)))) (let ((a0-68 (-> (the-as (inline-array game-save-tag) v1-116) 0))) (set! (-> a0-68 elt-type) (game-save-elt purchase-secrets)) (set! (-> a0-68 elt-count) 0) - (set! (-> a0-68 user-uint64) (the-as uint (-> obj purchase-secrets))) + (set! (-> a0-68 user-uint64) (the-as uint (-> this purchase-secrets))) ) (let ((v1-117 (the-as object (&+ (the-as game-save-tag v1-116) 16)))) (let ((a0-69 (-> (the-as (inline-array game-save-tag) v1-117) 0))) (set! (-> a0-69 elt-type) (game-save-elt gun-type)) (set! (-> a0-69 elt-count) 0) - (set! (-> a0-69 user-uint64) (the-as uint (-> obj gun-type))) + (set! (-> a0-69 user-uint64) (the-as uint (-> this gun-type))) ) (let ((v1-118 (the-as object (&+ (the-as game-save-tag v1-117) 16)))) (let ((a0-70 (-> (the-as (inline-array game-save-tag) v1-118) 0))) @@ -805,7 +805,7 @@ ) (let ((v1-119 (&+ (the-as game-save-tag v1-118) 16))) (dotimes (a0-71 4) - (set! (-> v1-119 user-object a0-71) (-> obj gun-ammo a0-71)) + (set! (-> v1-119 user-object a0-71) (-> this gun-ammo a0-71)) ) (let ((v1-120 (the-as object (&+ v1-119 16)))) (let ((a0-74 (-> (the-as (inline-array game-save-tag) v1-120) 0))) @@ -815,10 +815,10 @@ ) (let ((v1-121 (the-as object (&+ (the-as game-save-tag v1-120) 16)))) (dotimes (a0-75 32) - (set! (-> (the-as (pointer uint8) (&+ (the-as pointer v1-121) a0-75))) (-> obj level-opened a0-75)) + (set! (-> (the-as (pointer uint8) (&+ (the-as pointer v1-121) a0-75))) (-> this level-opened a0-75)) ) (let ((v1-122 (the-as object (-> (the-as (inline-array game-save-tag) v1-121) 2))) - (s3-10 (-> obj sub-task-list length)) + (s3-10 (-> this sub-task-list length)) ) (let ((a0-79 (-> (the-as (inline-array game-save-tag) v1-122) 0))) (set! (-> a0-79 elt-type) (game-save-elt node-name)) @@ -827,10 +827,10 @@ ) (let ((s4-3 (the-as object (&+ (the-as game-save-tag v1-122) 16)))) (dotimes (s2-4 s3-10) - (copyn-charp<-string (the-as (pointer uint8) s4-3) (-> obj sub-task-list s2-4 name) 64) + (copyn-charp<-string (the-as (pointer uint8) s4-3) (-> this sub-task-list s2-4 name) 64) (set! s4-3 (&+ (the-as pointer s4-3) 64)) ) - (let ((s3-11 (-> obj perm-list length))) + (let ((s3-11 (-> this perm-list length))) (let ((v1-129 (-> (the-as (inline-array game-save-tag) s4-3) 0))) (set! (-> v1-129 elt-type) (game-save-elt perm-list)) (set! (-> v1-129 elt-count) s3-11) @@ -838,10 +838,10 @@ ) (let ((s4-4 (the-as object (&+ (the-as pointer s4-3) 16)))) (dotimes (s2-5 s3-11) - (mem-copy! (&+ (the-as pointer s4-4) (* s2-5 16)) (the-as pointer (-> obj perm-list data s2-5)) 16) + (mem-copy! (&+ (the-as pointer s4-4) (* s2-5 16)) (the-as pointer (-> this perm-list data s2-5)) 16) ) (let ((v1-137 (the-as object (+ (the-as int s4-4) (logand -16 (+ (* s3-11 16) 15))))) - (s4-5 (-> obj task-perm-list length)) + (s4-5 (-> this task-perm-list length)) ) (let ((a0-88 (-> (the-as (inline-array game-save-tag) v1-137) 0))) (set! (-> a0-88 elt-type) (game-save-elt task-list)) @@ -850,10 +850,10 @@ ) (let ((s3-12 (+ (the-as int v1-137) 16))) (dotimes (s2-6 s4-5) - (mem-copy! (the-as pointer (+ s3-12 (* s2-6 16))) (the-as pointer (-> obj task-perm-list data s2-6)) 16) + (mem-copy! (the-as pointer (+ s3-12 (* s2-6 16))) (the-as pointer (-> this task-perm-list data s2-6)) 16) ) (let ((a0-92 (the-as object (+ s3-12 (logand -16 (+ (* s4-5 16) 15))))) - (v1-147 (-> obj unknown-pad6 allocated-length)) + (v1-147 (-> this unknown-pad6 allocated-length)) ) (let ((a1-88 (-> (the-as (inline-array game-save-tag) a0-92) 0))) (set! (-> a1-88 elt-type) (game-save-elt talker-state)) @@ -862,10 +862,10 @@ ) (let ((a0-93 (+ (the-as int a0-92) 16))) (dotimes (a1-89 v1-147) - (set! (-> (the-as (pointer uint16) (+ a0-93 (* a1-89 2))) 0) (-> obj unknown-pad6 a1-89)) + (set! (-> (the-as (pointer uint16) (+ a0-93 (* a1-89 2))) 0) (-> this unknown-pad6 a1-89)) ) (let ((a0-94 (the-as object (+ a0-93 (logand -16 (+ (* v1-147 2) 15))))) - (v1-153 (-> obj game-score allocated-length)) + (v1-153 (-> this game-score allocated-length)) ) (let ((a1-93 (-> (the-as (inline-array game-save-tag) a0-94) 0))) (set! (-> a1-93 elt-type) (game-save-elt scores)) @@ -874,7 +874,7 @@ ) (let ((a0-95 (+ (the-as int a0-94) 16))) (dotimes (a1-94 v1-153) - (set! (-> (the-as (pointer float) (+ a0-95 (* a1-94 4))) 0) (-> obj game-score a1-94)) + (set! (-> (the-as (pointer float) (+ a0-95 (* a1-94 4))) 0) (-> this game-score a1-94)) ) (let ((s4-6 (the-as object (+ a0-95 (logand -16 (+ (* v1-153 4) 15)))))) (compress-all *bigmap*) @@ -911,61 +911,61 @@ (let ((a0-102 (-> (the-as (inline-array game-save-tag) v1-169) 0))) (set! (-> a0-102 elt-type) (game-save-elt auto-save-count)) (set! (-> a0-102 elt-count) 0) - (set! (-> a0-102 user-uint64) (the-as uint (-> obj auto-save-count))) + (set! (-> a0-102 user-uint64) (the-as uint (-> this auto-save-count))) ) (let ((v1-170 (the-as object (+ (the-as int v1-169) 16)))) (let ((a0-103 (-> (the-as (inline-array game-save-tag) v1-170) 0))) (set! (-> a0-103 elt-type) (game-save-elt total-deaths)) (set! (-> a0-103 elt-count) 0) - (set! (-> a0-103 user-uint64) (the-as uint (-> obj total-deaths))) + (set! (-> a0-103 user-uint64) (the-as uint (-> this total-deaths))) ) (let ((v1-171 (the-as object (+ (the-as int v1-170) 16)))) (let ((a0-104 (-> (the-as (inline-array game-save-tag) v1-171) 0))) (set! (-> a0-104 elt-type) (game-save-elt total-trys)) (set! (-> a0-104 elt-count) 0) - (set! (-> a0-104 user-uint64) (the-as uint (-> obj total-trys))) + (set! (-> a0-104 user-uint64) (the-as uint (-> this total-trys))) ) (let ((v1-172 (the-as object (+ (the-as int v1-171) 16)))) (let ((a0-105 (-> (the-as (inline-array game-save-tag) v1-172) 0))) (set! (-> a0-105 elt-type) (game-save-elt continue-deaths)) (set! (-> a0-105 elt-count) 0) - (set! (-> a0-105 user-uint64) (the-as uint (-> obj continue-deaths))) + (set! (-> a0-105 user-uint64) (the-as uint (-> this continue-deaths))) ) (let ((v1-173 (the-as object (+ (the-as int v1-172) 16)))) (let ((a0-106 (-> (the-as (inline-array game-save-tag) v1-173) 0))) (set! (-> a0-106 elt-type) (game-save-elt task-deaths)) (set! (-> a0-106 elt-count) 0) - (set! (-> a0-106 user-uint64) (the-as uint (-> obj task-deaths))) + (set! (-> a0-106 user-uint64) (the-as uint (-> this task-deaths))) ) (let ((v1-174 (the-as object (+ (the-as int v1-173) 16)))) (let ((a0-107 (-> (the-as (inline-array game-save-tag) v1-174) 0))) (set! (-> a0-107 elt-type) (game-save-elt game-start-time)) (set! (-> a0-107 elt-count) 0) - (set! (-> a0-107 user-uint64) (the-as uint (-> obj game-start-time))) + (set! (-> a0-107 user-uint64) (the-as uint (-> this game-start-time))) ) (let ((v1-175 (the-as object (+ (the-as int v1-174) 16)))) (let ((a0-108 (-> (the-as (inline-array game-save-tag) v1-175) 0))) (set! (-> a0-108 elt-type) (game-save-elt continue-time)) (set! (-> a0-108 elt-count) 0) - (set! (-> a0-108 user-uint64) (the-as uint (-> obj continue-time))) + (set! (-> a0-108 user-uint64) (the-as uint (-> this continue-time))) ) (let ((v1-176 (the-as object (+ (the-as int v1-175) 16)))) (let ((a0-109 (-> (the-as (inline-array game-save-tag) v1-176) 0))) (set! (-> a0-109 elt-type) (game-save-elt death-time)) (set! (-> a0-109 elt-count) 0) - (set! (-> a0-109 user-uint64) (the-as uint (-> obj death-time))) + (set! (-> a0-109 user-uint64) (the-as uint (-> this death-time))) ) (let ((v1-177 (the-as object (+ (the-as int v1-176) 16)))) (let ((a0-110 (-> (the-as (inline-array game-save-tag) v1-177) 0))) (set! (-> a0-110 elt-type) (game-save-elt hit-time)) (set! (-> a0-110 elt-count) 0) - (set! (-> a0-110 user-uint64) (the-as uint (-> obj hit-time))) + (set! (-> a0-110 user-uint64) (the-as uint (-> this hit-time))) ) (let ((v1-178 (the-as object (+ (the-as int v1-177) 16)))) (let ((a0-111 (-> (the-as (inline-array game-save-tag) v1-178) 0))) (set! (-> a0-111 elt-type) (game-save-elt task-pickup-time)) (set! (-> a0-111 elt-count) 0) - (set! (-> a0-111 user-uint64) (the-as uint (-> obj task-pickup-time))) + (set! (-> a0-111 user-uint64) (the-as uint (-> this task-pickup-time))) ) (let ((v1-179 (the-as object (+ (the-as int v1-178) 16)))) (let ((a0-112 (-> (the-as (inline-array game-save-tag) v1-179) 0))) @@ -975,7 +975,7 @@ ) (let ((v1-180 (+ (the-as int v1-179) 16))) (dotimes (a0-113 110) - (set! (-> (the-as (pointer time-frame) (+ v1-180 (* a0-113 8))) 0) (-> obj unknown-array1 a0-113)) + (set! (-> (the-as (pointer time-frame) (+ v1-180 (* a0-113 8))) 0) (-> this unknown-array1 a0-113)) ) (let ((v1-181 (the-as object (+ v1-180 880)))) (let ((a0-116 (-> (the-as (inline-array game-save-tag) v1-181) 0))) @@ -985,7 +985,7 @@ ) (let ((v1-182 (+ (the-as int v1-181) 16))) (dotimes (a0-117 110) - (set! (-> (the-as (pointer time-frame) (+ v1-182 (* a0-117 8))) 0) (-> obj task-close-times a0-117)) + (set! (-> (the-as (pointer time-frame) (+ v1-182 (* a0-117 8))) 0) (-> this task-close-times a0-117)) ) (let ((v1-183 (the-as object (+ v1-182 880)))) (let ((a0-120 (-> (the-as (inline-array game-save-tag) v1-183) 0))) @@ -995,7 +995,7 @@ ) (let ((v1-184 (+ (the-as int v1-183) 16))) (dotimes (a0-121 32) - (set! (-> (the-as (pointer time-frame) (+ v1-184 (* a0-121 8))) 0) (-> obj task-enter-times a0-121)) + (set! (-> (the-as (pointer time-frame) (+ v1-184 (* a0-121 8))) 0) (-> this task-enter-times a0-121)) ) (let ((v1-185 (the-as object (+ v1-184 256)))) (let ((a0-124 (-> (the-as (inline-array game-save-tag) v1-185) 0))) @@ -1005,10 +1005,10 @@ ) (let ((v1-186 (+ (the-as int v1-185) 16))) (dotimes (a0-125 32) - (set! (-> (the-as (pointer time-frame) (+ v1-186 (* a0-125 8))) 0) (-> obj task-in-times a0-125)) + (set! (-> (the-as (pointer time-frame) (+ v1-186 (* a0-125 8))) 0) (-> this task-in-times a0-125)) ) (let ((a0-128 (the-as object (+ v1-186 256))) - (v1-188 (-> obj sub-task-list length)) + (v1-188 (-> this sub-task-list length)) ) (let ((a1-153 (-> (the-as (inline-array game-save-tag) a0-128) 0))) (set! (-> a1-153 elt-type) (game-save-elt node-death-count)) @@ -1017,7 +1017,7 @@ ) (let ((a0-129 (+ (the-as int a0-128) 16))) (dotimes (a1-154 v1-188) - (set! (-> (the-as (pointer uint16) (+ a0-129 (* a1-154 2))) 0) (-> obj sub-task-list a1-154 death-count)) + (set! (-> (the-as (pointer uint16) (+ a0-129 (* a1-154 2))) 0) (-> this sub-task-list a1-154 death-count)) ) (let ((a0-130 (the-as object (+ a0-129 (logand -16 (+ (* v1-188 2) 15)))))) (let ((a1-159 (-> (the-as (inline-array game-save-tag) a0-130) 0))) @@ -1027,7 +1027,7 @@ ) (let ((a0-131 (+ (the-as int a0-130) 16))) (dotimes (a1-160 v1-188) - (set! (-> (the-as (pointer uint16) (+ a0-131 (* a1-160 2))) 0) (-> obj sub-task-list a1-160 gem-count)) + (set! (-> (the-as (pointer uint16) (+ a0-131 (* a1-160 2))) 0) (-> this sub-task-list a1-160 gem-count)) ) (let ((a0-132 (the-as object (+ a0-131 (logand -16 (+ (* v1-188 2) 15)))))) (let ((a1-165 (-> (the-as (inline-array game-save-tag) a0-132) 0))) @@ -1037,7 +1037,7 @@ ) (let ((a0-133 (+ (the-as int a0-132) 16))) (dotimes (a1-166 v1-188) - (set! (-> (the-as (pointer uint16) (+ a0-133 (* a1-166 2))) 0) (-> obj sub-task-list a1-166 skill-count)) + (set! (-> (the-as (pointer uint16) (+ a0-133 (* a1-166 2))) 0) (-> this sub-task-list a1-166 skill-count)) ) (let ((a0-134 (the-as object (+ a0-133 (logand -16 (+ (* v1-188 2) 15)))))) (let ((a1-171 (-> (the-as (inline-array game-save-tag) a0-134) 0))) @@ -1047,10 +1047,10 @@ ) (let ((a0-135 (+ (the-as int a0-134) 16))) (dotimes (a1-172 v1-188) - (set! (-> (the-as (pointer time-frame) (+ a0-135 (* a1-172 8))) 0) (-> obj sub-task-list a1-172 close-time)) + (set! (-> (the-as (pointer time-frame) (+ a0-135 (* a1-172 8))) 0) (-> this sub-task-list a1-172 close-time)) ) (let ((a0-136 (the-as object (+ a0-135 (logand -16 (+ (* v1-188 8) 15))))) - (v1-194 (-> obj sub-task-list length)) + (v1-194 (-> this sub-task-list length)) ) (let ((a1-176 (-> (the-as (inline-array game-save-tag) a0-136) 0))) (set! (-> a1-176 elt-type) (game-save-elt task-node-list)) @@ -1060,7 +1060,7 @@ (let ((a0-137 (+ (the-as int a0-136) 16))) (dotimes (a1-177 v1-194) (set! (-> (the-as (pointer int8) (+ a0-137 a1-177)) 0) - (if (logtest? (-> obj sub-task-list a1-177 flags) (game-task-node-flag closed)) + (if (logtest? (-> this sub-task-list a1-177 flags) (game-task-node-flag closed)) 1 0 ) @@ -1310,7 +1310,7 @@ ) ;; definition for method 24 of type game-info -(defmethod load-game game-info ((obj game-info) (arg0 game-save)) +(defmethod load-game game-info ((this game-info) (arg0 game-save)) (let ((v1-0 (the-as object (-> arg0 tag)))) (while (< (the-as int v1-0) (the-as int (&-> arg0 tag 0 user-int8 (-> arg0 length)))) (case (-> (the-as (inline-array game-save-tag) v1-0) 0 elt-type) @@ -1394,7 +1394,7 @@ (logior! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) ) ) - (set-continue! obj "game-start" #f) + (set-continue! this "game-start" #f) (set! arg0 arg0) (goto cfg-230) ) @@ -1408,8 +1408,8 @@ (case (-> (the-as game-save-tag s4-0) elt-type) (((game-save-elt node-name)) (dotimes (s2-0 (-> (the-as game-save-tag s4-0) elt-count)) - (dotimes (s1-0 (-> obj sub-task-list length)) - (let ((v1-20 (-> obj sub-task-list s1-0))) + (dotimes (s1-0 (-> this sub-task-list length)) + (let ((v1-20 (-> this sub-task-list s1-0))) (when (string-charp= (-> v1-20 name) (the-as (pointer uint8) (+ (+ (* s2-0 64) 16) (the-as int s4-0)))) (set! (-> s3-0 s2-0) (the-as uint s1-0)) (goto cfg-45) @@ -1434,88 +1434,89 @@ ) (((game-save-elt continue)) (format (clear *temp-string*) "~G" (-> (the-as (inline-array game-save-tag) s4-0) 1)) - (set-continue! obj *temp-string* #f) + (set-continue! this *temp-string* #f) ) (((game-save-elt life)) - (set! (-> obj life) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this life) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt buzzer-total)) - (set! (-> obj buzzer-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this buzzer-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt fuel-cell)) - (set! (-> obj fuel) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this fuel) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt death-movie-tick)) - (set! (-> obj death-movie-tick) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this death-movie-tick) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt skill)) - (set! (-> obj skill) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this skill) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt skill-total)) - (set! (-> obj skill-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this skill-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt gem)) - (set! (-> obj gem) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this gem) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt gem-total)) - (set! (-> obj gem-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this gem-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt karma)) - (set! (-> obj karma) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this karma) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt eco-pill-dark)) - (set! (-> obj eco-pill-dark) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this eco-pill-dark) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt eco-pill-dark-total)) - (set! (-> obj eco-pill-dark-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this eco-pill-dark-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt shield)) - (set! (-> obj shield) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this shield) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt features)) - (set! (-> obj features) (the-as game-feature (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this features) (the-as game-feature (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt secrets)) - (set! (-> obj secrets) (the-as game-secrets (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this secrets) (the-as game-secrets (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt purchase-secrets)) - (set! (-> obj purchase-secrets) + (set! (-> this purchase-secrets) (the-as game-secrets (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64)) ) ) (((game-save-elt gun-type)) - (set! (-> obj gun-type) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this gun-type) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt gun-ammo)) (let ((v1-67 (min 4 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-89 v1-67) - (set! (-> obj gun-ammo a0-89) + (set! (-> this gun-ammo a0-89) (the-as float (-> (the-as (inline-array game-save-tag) s4-0) 1 user-object a0-89)) ) ) ) ) (((game-save-elt money)) - (set! (-> obj money) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this money) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt money-total)) - (set! (-> obj money-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) + (set! (-> this money-total) (-> (the-as (inline-array game-save-tag) s4-0) 0 user-float0)) ) (((game-save-elt level-open-list)) (let ((v1-73 (min 32 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-97 v1-73) - (set! (-> obj level-opened a0-97) + (set! (-> this level-opened a0-97) (-> (the-as (pointer uint8) (&+ (the-as pointer (-> (the-as (inline-array game-save-tag) s4-0) 1)) a0-97))) ) ) ) ) (((game-save-elt perm-list)) - (let ((s2-3 (min (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count) (-> obj perm-list allocated-length)))) - (set! (-> obj perm-list length) s2-3) + (let ((s2-3 (min (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count) (-> this perm-list allocated-length))) + ) + (set! (-> this perm-list length) s2-3) (dotimes (s1-1 s2-3) (mem-copy! - (the-as pointer (-> obj perm-list data s1-1)) + (the-as pointer (-> this perm-list data s1-1)) (the-as pointer (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* s1-1 16))) 16 ) @@ -1524,13 +1525,13 @@ ) (((game-save-elt task-list)) (let ((s2-5 - (min (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count) (-> obj task-perm-list allocated-length)) + (min (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count) (-> this task-perm-list allocated-length)) ) ) - (set! (-> obj task-perm-list length) s2-5) + (set! (-> this task-perm-list length) s2-5) (dotimes (s1-2 s2-5) (mem-copy! - (the-as pointer (-> obj task-perm-list data s1-2)) + (the-as pointer (-> this task-perm-list data s1-2)) (the-as pointer (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* s1-2 16))) 16 ) @@ -1538,30 +1539,30 @@ ) ) (((game-save-elt talker-state)) - (let ((v1-95 (-> obj unknown-pad6 allocated-length)) + (let ((v1-95 (-> this unknown-pad6 allocated-length)) (a0-108 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)) ) (dotimes (a1-57 v1-95) (cond ((>= a1-57 a0-108) - (set! (-> obj unknown-pad6 a1-57) (the-as uint 0)) + (set! (-> this unknown-pad6 a1-57) (the-as uint 0)) 0 ) (else - (set! (-> obj unknown-pad6 a1-57) (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 a1-57)) + (set! (-> this unknown-pad6 a1-57) (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 a1-57)) ) ) ) ) ) (((game-save-elt scores)) - (let ((v1-99 (-> obj game-score allocated-length)) + (let ((v1-99 (-> this game-score allocated-length)) (a0-111 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)) ) (dotimes (a1-58 v1-99) (if (>= a1-58 a0-111) - (set! (-> obj game-score a1-58) 0.0) - (set! (-> obj game-score a1-58) + (set! (-> this game-score a1-58) 0.0) + (set! (-> this game-score a1-58) (the-as float (-> (the-as (inline-array game-save-tag) s4-0) 1 user-object a1-58)) ) ) @@ -1602,45 +1603,45 @@ ) ) (((game-save-elt auto-save-count)) - (set! (-> obj auto-save-count) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this auto-save-count) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt total-deaths)) - (set! (-> obj total-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this total-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt total-trys)) - (set! (-> obj total-trys) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this total-trys) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt continue-deaths)) - (set! (-> obj continue-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this continue-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt task-deaths)) - (set! (-> obj task-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this task-deaths) (the-as int (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt game-start-time)) - (set! (-> obj game-start-time) + (set! (-> this game-start-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64)) ) ) (((game-save-elt continue-time)) - (set! (-> obj continue-time) + (set! (-> this continue-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64)) ) ) (((game-save-elt death-time)) - (set! (-> obj death-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this death-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt hit-time)) - (set! (-> obj hit-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) + (set! (-> this hit-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64))) ) (((game-save-elt task-pickup-time)) - (set! (-> obj task-pickup-time) + (set! (-> this task-pickup-time) (the-as time-frame (-> (the-as (inline-array game-save-tag) s4-0) 0 user-uint64)) ) ) (((game-save-elt enter-level-time)) (let ((v1-123 (min 32 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-145 v1-123) - (set! (-> obj task-enter-times a0-145) + (set! (-> this task-enter-times a0-145) (the-as time-frame (-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* a0-145 8))) @@ -1653,7 +1654,7 @@ (((game-save-elt in-level-time)) (let ((v1-127 (min 32 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-149 v1-127) - (set! (-> obj task-in-times a0-149) + (set! (-> this task-in-times a0-149) (the-as time-frame (-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* a0-149 8))) @@ -1666,7 +1667,7 @@ (((game-save-elt task-complete-time)) (let ((v1-131 (min 32 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-153 v1-131) - (set! (-> obj unknown-array1 a0-153) + (set! (-> this unknown-array1 a0-153) (the-as time-frame (-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* a0-153 8))) @@ -1679,7 +1680,7 @@ (((game-save-elt task-start-time)) (let ((v1-135 (min 32 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count)))) (dotimes (a0-157 v1-135) - (set! (-> obj task-close-times a0-157) + (set! (-> this task-close-times a0-157) (the-as time-frame (-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* a0-157 8))) @@ -1696,7 +1697,7 @@ ) (>= (-> (the-as (pointer int16) (&+ s3-0 (* s1-3 2)))) 0) ) - (close! (-> obj sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* s1-3 2))))) 'event) + (close! (-> this sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* s1-3 2))))) 'event) ) ) ) @@ -1705,7 +1706,7 @@ (let ((v1-155 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))) (dotimes (a0-164 v1-155) (if (>= (-> (the-as (pointer int16) (&+ s3-0 (* a0-164 2)))) 0) - (set! (-> obj sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-164 2)))) death-count) + (set! (-> this sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-164 2)))) death-count) (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 a0-164) ) ) @@ -1716,7 +1717,7 @@ (let ((v1-158 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))) (dotimes (a0-167 v1-158) (if (>= (-> (the-as (pointer int16) (&+ s3-0 (* a0-167 2)))) 0) - (set! (-> obj sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-167 2)))) gem-count) + (set! (-> this sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-167 2)))) gem-count) (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 a0-167) ) ) @@ -1727,7 +1728,7 @@ (let ((v1-161 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))) (dotimes (a0-170 v1-161) (if (>= (-> (the-as (pointer int16) (&+ s3-0 (* a0-170 2)))) 0) - (set! (-> obj sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-170 2)))) skill-count) + (set! (-> this sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-170 2)))) skill-count) (-> (the-as (inline-array game-save-tag) s4-0) 1 user-uint16 a0-170) ) ) @@ -1738,7 +1739,7 @@ (let ((v1-165 (-> (the-as (inline-array game-save-tag) s4-0) 0 elt-count))) (dotimes (a0-172 v1-165) (if (>= (-> (the-as (pointer int16) (&+ s3-0 (* a0-172 2)))) 0) - (set! (-> obj sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-172 2)))) close-time) + (set! (-> this sub-task-list (-> (the-as (pointer int16) (&+ s3-0 (* a0-172 2)))) close-time) (the-as time-frame (-> (the-as (pointer uint64) (+ (the-as uint (-> (the-as (inline-array game-save-tag) s4-0) 1)) (* a0-172 8))) @@ -1765,7 +1766,7 @@ (dotimes (s4-1 (-> *level* length)) (let ((a1-106 (-> *level* level s4-1))) (if (= (-> a1-106 status) 'active) - (copy-perms-to-level! obj a1-106) + (copy-perms-to-level! this a1-106) ) ) ) @@ -1774,29 +1775,29 @@ ) ;; definition for method 9 of type game-save -(defmethod save-to-file game-save ((obj game-save) (arg0 string)) +(defmethod save-to-file game-save ((this game-save) (arg0 string)) (let ((s5-0 (new 'stack 'file-stream arg0 'write))) - (file-stream-write s5-0 (&-> obj type) (+ (-> obj type size) (-> obj length))) + (file-stream-write s5-0 (&-> this type) (+ (-> this type size) (-> this length))) (file-stream-close s5-0) ) - obj + this ) ;; definition for method 10 of type game-save -(defmethod load-from-file game-save ((obj game-save) (arg0 string)) +(defmethod load-from-file game-save ((this game-save) (arg0 string)) (let ((s5-0 (new 'stack 'file-stream arg0 'read))) (let ((s3-0 (file-stream-length s5-0)) - (s4-0 (-> obj allocated-length)) + (s4-0 (-> this allocated-length)) ) (cond - ((>= (asize-of obj) s3-0) + ((>= (asize-of this) s3-0) (cond - ((= (file-stream-read s5-0 (&-> obj type) s3-0) s3-0) - (set! (-> obj type) game-save) + ((= (file-stream-read s5-0 (&-> this type) s3-0) s3-0) + (set! (-> this type) game-save) ) (else (format 0 "ERROR: SAVEGAME: save file ~A did not read correctly.~%" s5-0) - (set! (-> obj length) 0) + (set! (-> this length) 0) 0 ) ) @@ -1805,16 +1806,22 @@ (format 0 "ERROR: SAVEGAME: save file ~A is too big~%" s5-0) ) ) - (set! (-> obj allocated-length) s4-0) + (set! (-> this allocated-length) s4-0) ) - (when (!= (-> obj version) 3) - (format 0 "ERROR: SAVEGAME: save file ~A was version ~d, but only ~d is supported.~%" s5-0 (-> obj version) 3) - (set! (-> obj length) 0) + (when (!= (-> this version) 3) + (format + 0 + "ERROR: SAVEGAME: save file ~A was version ~d, but only ~d is supported.~%" + s5-0 + (-> this version) + 3 + ) + (set! (-> this length) 0) 0 ) (file-stream-close s5-0) ) - obj + this ) ;; definition for symbol *auto-save-info*, type mc-slot-info @@ -1853,28 +1860,28 @@ ) ;; definition for method 3 of type auto-save -(defmethod inspect auto-save ((obj auto-save)) - (when (not obj) - (set! obj obj) +(defmethod inspect auto-save ((this auto-save)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcard: ~D~%" (-> obj card)) - (format #t "~2Tslot: ~D~%" (-> obj slot)) - (format #t "~2Twhich: ~D~%" (-> obj which)) - (format #t "~2Tbuffer: #~%" (-> obj buffer)) - (format #t "~2Tmode: ~A~%" (-> obj mode)) - (format #t "~2Tresult: ~D~%" (-> obj result)) - (format #t "~2Tsave: ~A~%" (-> obj save)) - (format #t "~2Tinfo: #~%" (-> obj info)) - (format #t "~2Tnotify: ~D~%" (-> obj notify)) - (format #t "~2Tforce: ~A~%" (-> obj force)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Ticon: #~%" (-> obj icon)) + (format #t "~2Tcard: ~D~%" (-> this card)) + (format #t "~2Tslot: ~D~%" (-> this slot)) + (format #t "~2Twhich: ~D~%" (-> this which)) + (format #t "~2Tbuffer: #~%" (-> this buffer)) + (format #t "~2Tmode: ~A~%" (-> this mode)) + (format #t "~2Tresult: ~D~%" (-> this result)) + (format #t "~2Tsave: ~A~%" (-> this save)) + (format #t "~2Tinfo: #~%" (-> this info)) + (format #t "~2Tnotify: ~D~%" (-> this notify)) + (format #t "~2Tforce: ~A~%" (-> this force)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Ticon: #~%" (-> this icon)) (label cfg-4) - obj + this ) ;; definition for function auto-save-post diff --git a/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc b/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc index 7181c80483..9e6cd7b206 100644 --- a/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/idle-control_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type idle-control-frame -(defmethod inspect idle-control-frame ((obj idle-control-frame)) +(defmethod inspect idle-control-frame ((this idle-control-frame)) (local-vars (a2-4 int)) - (when (not obj) - (set! obj obj) + (when (not this) + (set! this this) (goto cfg-11) ) - (format #t "[~8x] ~A~%" obj 'idle-control-frame) + (format #t "[~8x] ~A~%" this 'idle-control-frame) (let ((t9-1 format) (a0-2 #t) (a1-1 "~1Tcommand: #x~X : ~S~%") - (a2-1 (-> obj command)) - (v1-4 (-> obj command)) + (a2-1 (-> this command)) + (v1-4 (-> this command)) ) (t9-1 a0-2 a1-1 a2-1 (cond ((= v1-4 (ic-cmd play)) @@ -43,17 +43,17 @@ ) ) ) - (format #t "~1Tanim: ~D~%" (-> obj anim)) - (format #t "~1Tparam0: ~D~%" (-> obj param0)) + (format #t "~1Tanim: ~D~%" (-> this anim)) + (format #t "~1Tparam0: ~D~%" (-> this param0)) (let ((t9-4 format) (a0-5 #t) (a1-4 "~1Tparam1: ~D~%") ) - (shift-arith-right-32 a2-4 obj 24) + (shift-arith-right-32 a2-4 this 24) (t9-4 a0-5 a1-4 a2-4) ) (label cfg-11) - obj + this ) ;; definition of type idle-control @@ -73,51 +73,51 @@ ) ;; definition for method 3 of type idle-control -(defmethod inspect idle-control ((obj idle-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect idle-control ((this idle-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'idle-control) - (format #t "~1Tanim: #x~X~%" (-> obj anim)) - (format #t "~1Tcurrent: #x~X~%" (-> obj current)) - (format #t "~1Tcounter: ~D~%" (-> obj counter)) - (format #t "~1Ttarget: ~D~%" (-> obj target)) + (format #t "[~8x] ~A~%" this 'idle-control) + (format #t "~1Tanim: #x~X~%" (-> this anim)) + (format #t "~1Tcurrent: #x~X~%" (-> this current)) + (format #t "~1Tcounter: ~D~%" (-> this counter)) + (format #t "~1Ttarget: ~D~%" (-> this target)) (label cfg-4) - obj + this ) ;; definition for method 9 of type idle-control ;; WARN: Return type mismatch idle-control vs none. -(defmethod idle-control-method-9 idle-control ((obj idle-control) (arg0 (pointer idle-control-frame))) - (set! (-> obj anim) arg0) - (set! (-> obj current) arg0) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) +(defmethod idle-control-method-9 idle-control ((this idle-control) (arg0 (pointer idle-control-frame))) + (set! (-> this anim) arg0) + (set! (-> this current) arg0) + (set! (-> this counter) 0) + (set! (-> this target) 0) (none) ) ;; definition for method 10 of type idle-control ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 10 idle-control) has a return type of none, but the expression builder found a return statement. -(defmethod idle-control-method-10 idle-control ((obj idle-control) (arg0 process-drawable)) +(defmethod idle-control-method-10 idle-control ((this idle-control) (arg0 process-drawable)) (local-vars (a1-1 int)) - (when (nonzero? (-> obj anim)) + (when (nonzero? (-> this anim)) (let ((s5-0 self)) (set! self arg0) (loop - (let ((s4-0 (-> obj current 0))) + (let ((s4-0 (-> this current 0))) (case (-> s4-0 command) (((ic-cmd play)) (if (< (-> s4-0 anim) 0) (return #f) ) - (when (zero? (-> obj target)) + (when (zero? (-> this target)) (let ((t9-0 rand-vu-int-range) (a0-3 (-> s4-0 param0)) ) (shift-arith-right-32 a1-1 s4-0 24) - (set! (-> obj target) (t9-0 (the-as int a0-3) a1-1)) + (set! (-> this target) (t9-0 (the-as int a0-3) a1-1)) ) (ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)) :num! min) (return #f) @@ -125,12 +125,12 @@ (ja :group! (-> (the-as process-drawable self) draw art-group data (-> s4-0 anim)) :num! (seek!)) (cond ((ja-done? 0) - (+! (-> obj counter) 1) + (+! (-> this counter) 1) (cond - ((>= (-> obj counter) (-> obj target)) - (set! (-> obj current) (&-> (-> obj current) 1)) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) + ((>= (-> this counter) (-> this target)) + (set! (-> this current) (&-> (-> this current) 1)) + (set! (-> this counter) 0) + (set! (-> this target) 0) 0 ) (else @@ -146,15 +146,15 @@ ) (((ic-cmd push)) (ja-channel-push! 1 (the-as time-frame (-> s4-0 param0))) - (set! (-> obj current) (&-> (-> obj current) 1)) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) + (set! (-> this current) (&-> (-> this current) 1)) + (set! (-> this counter) 0) + (set! (-> this target) 0) 0 ) (((ic-cmd restart)) - (set! (-> obj current) (-> obj anim)) - (set! (-> obj counter) 0) - (set! (-> obj target) 0) + (set! (-> this current) (-> this anim)) + (set! (-> this counter) 0) + (set! (-> this target) 0) 0 ) ) diff --git a/test/decompiler/reference/jak2/engine/game/main-h_REF.gc b/test/decompiler/reference/jak2/engine/game/main-h_REF.gc index 2282b870c3..a79ca61cc4 100644 --- a/test/decompiler/reference/jak2/engine/game/main-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/main-h_REF.gc @@ -349,16 +349,16 @@ ) ;; definition for method 3 of type frame-stats -(defmethod inspect frame-stats ((obj frame-stats)) - (when (not obj) - (set! obj obj) +(defmethod inspect frame-stats ((this frame-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'frame-stats) - (format #t "~1Tfield-time[2] @ #x~X~%" (-> obj field-time)) - (format #t "~1Tfield: ~D~%" (-> obj field)) + (format #t "[~8x] ~A~%" this 'frame-stats) + (format #t "~1Tfield-time[2] @ #x~X~%" (-> this field-time)) + (format #t "~1Tfield: ~D~%" (-> this field)) (label cfg-4) - obj + this ) ;; definition for symbol *frame-stats*, type frame-stats @@ -386,22 +386,22 @@ ) ;; definition for method 3 of type screen-filter -(defmethod inspect screen-filter ((obj screen-filter)) - (when (not obj) - (set! obj obj) +(defmethod inspect screen-filter ((this screen-filter)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdraw?: ~A~%" (-> obj draw?)) - (format #t "~1Tbucket: ~D~%" (-> obj bucket)) - (format #t "~1Tcolor: #~%" (-> obj color)) - (format #t "~1Tcolor-src: #~%" (-> obj color-src)) - (format #t "~1Tcolor-dest: #~%" (-> obj color-dest)) - (format #t "~1Textra: #~%" (-> obj extra)) - (format #t "~1Tspeed: ~f~%" (-> obj extra x)) - (format #t "~1Tcurrent-interp: ~f~%" (-> obj extra y)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdraw?: ~A~%" (-> this draw?)) + (format #t "~1Tbucket: ~D~%" (-> this bucket)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Tcolor-src: #~%" (-> this color-src)) + (format #t "~1Tcolor-dest: #~%" (-> this color-dest)) + (format #t "~1Textra: #~%" (-> this extra)) + (format #t "~1Tspeed: ~f~%" (-> this extra x)) + (format #t "~1Tcurrent-interp: ~f~%" (-> this extra y)) (label cfg-4) - obj + this ) ;; definition of type col-rend @@ -427,25 +427,25 @@ ) ;; definition for method 3 of type col-rend -(defmethod inspect col-rend ((obj col-rend)) - (when (not obj) - (set! obj obj) +(defmethod inspect col-rend ((this col-rend)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdraw?: ~A~%" (-> obj draw?)) - (format #t "~1Toutline?: ~A~%" (-> obj outline?)) - (format #t "~1Tshow-back-faces?: ~A~%" (-> obj show-back-faces?)) - (format #t "~1Tshow-normals?: ~A~%" (-> obj show-normals?)) - (format #t "~1Tghost-hidden?: ~A~%" (-> obj ghost-hidden?)) - (format #t "~1Tshow-only: ~D~%" (-> obj show-only)) - (format #t "~1Tcspec: ~D~%" (-> obj cspec)) - (format #t "~1Ttrack: ~D~%" (-> obj track)) - (format #t "~1Tbbox-radius: ~f~%" (-> obj bbox-radius)) - (format #t "~1Tbbox-center: #~%" (-> obj bbox-center)) - (format #t "~1Tcamera-to-bbox-dist: ~f~%" (-> obj camera-to-bbox-dist)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdraw?: ~A~%" (-> this draw?)) + (format #t "~1Toutline?: ~A~%" (-> this outline?)) + (format #t "~1Tshow-back-faces?: ~A~%" (-> this show-back-faces?)) + (format #t "~1Tshow-normals?: ~A~%" (-> this show-normals?)) + (format #t "~1Tghost-hidden?: ~A~%" (-> this ghost-hidden?)) + (format #t "~1Tshow-only: ~D~%" (-> this show-only)) + (format #t "~1Tcspec: ~D~%" (-> this cspec)) + (format #t "~1Ttrack: ~D~%" (-> this track)) + (format #t "~1Tbbox-radius: ~f~%" (-> this bbox-radius)) + (format #t "~1Tbbox-center: #~%" (-> this bbox-center)) + (format #t "~1Tcamera-to-bbox-dist: ~f~%" (-> this camera-to-bbox-dist)) (label cfg-4) - obj + this ) ;; definition for symbol *col-rend*, type col-rend diff --git a/test/decompiler/reference/jak2/engine/game/main_REF.gc b/test/decompiler/reference/jak2/engine/game/main_REF.gc index ba2a08851e..a61be7c296 100644 --- a/test/decompiler/reference/jak2/engine/game/main_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/main_REF.gc @@ -259,7 +259,7 @@ ;; definition for method 9 of type screen-filter ;; WARN: Return type mismatch int vs none. -(defmethod draw screen-filter ((obj screen-filter)) +(defmethod draw screen-filter ((this screen-filter)) (local-vars (v1-1 float)) (rlet ((vf0 :class vf) (vf1 :class vf) @@ -269,30 +269,30 @@ ) (init-vf0-vector) (when (not (paused?)) - (.lvf vf4 (&-> obj extra quad)) - (.lvf vf1 (&-> obj color-dest quad)) - (.lvf vf2 (&-> obj color quad)) + (.lvf vf4 (&-> this extra quad)) + (.lvf vf1 (&-> this color-dest quad)) + (.lvf vf2 (&-> this color quad)) (.sub.vf vf3 vf1 vf2) (.add.x.vf vf4 vf4 vf4 :mask #b10) (.min.w.vf vf4 vf4 vf0 :mask #b10) (.max.y.vf vf4 vf4 vf0 :mask #b10) (.mul.y.vf vf3 vf3 vf4) (.add.vf vf1 vf2 vf3) - (.svf (&-> obj extra quad) vf4) - (.svf (&-> obj color quad) vf1) + (.svf (&-> this extra quad) vf4) + (.svf (&-> this color quad) vf1) (.mov v1-1 vf1) ) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) - (-> obj bucket) + (-> this bucket) ) (dma-buffer-add-gs-set s4-0 (test-1 (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always))) ) (let ((t1-0 (new 'static 'rgba - :r (the int (-> obj color x)) - :g (the int (-> obj color y)) - :b (the int (-> obj color z)) - :a (the int (-> obj color w)) + :r (the int (-> this color x)) + :g (the int (-> this color y)) + :b (the int (-> this color z)) + :a (the int (-> this color w)) ) ) ) @@ -307,22 +307,22 @@ ;; definition for method 10 of type screen-filter ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod setup screen-filter ((obj screen-filter) (arg0 vector) (arg1 vector) (arg2 float) (arg3 bucket-id)) - (set! (-> obj draw?) #t) - (set! (-> obj color quad) (-> arg0 quad)) - (set! (-> obj color-src quad) (-> arg0 quad)) - (set! (-> obj color-dest quad) (-> arg1 quad)) - (set! (-> obj extra x) arg2) - (set! (-> obj extra y) 0.0) - (set! (-> obj bucket) arg3) +(defmethod setup screen-filter ((this screen-filter) (arg0 vector) (arg1 vector) (arg2 float) (arg3 bucket-id)) + (set! (-> this draw?) #t) + (set! (-> this color quad) (-> arg0 quad)) + (set! (-> this color-src quad) (-> arg0 quad)) + (set! (-> this color-dest quad) (-> arg1 quad)) + (set! (-> this extra x) arg2) + (set! (-> this extra y) 0.0) + (set! (-> this bucket) arg3) 0 (none) ) ;; definition for method 11 of type screen-filter ;; WARN: Return type mismatch int vs none. -(defmethod disable screen-filter ((obj screen-filter)) - (set! (-> obj draw?) #f) +(defmethod disable screen-filter ((this screen-filter)) + (set! (-> this draw?) #f) 0 (none) ) @@ -1174,7 +1174,7 @@ (set! (-> *setting-control* user-default dialog-volume) 0.0) (set! (-> *setting-control* user-default ambient-volume) 0.0) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 0.1)) + (until (time-elapsed? s5-0 (seconds 0.1)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/engine/game/pilot-h_REF.gc b/test/decompiler/reference/jak2/engine/game/pilot-h_REF.gc index 9795d8105c..6fea883c29 100644 --- a/test/decompiler/reference/jak2/engine/game/pilot-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/pilot-h_REF.gc @@ -15,18 +15,18 @@ ) ;; definition for method 3 of type vehicle-controls -(defmethod inspect vehicle-controls ((obj vehicle-controls)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-controls ((this vehicle-controls)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-controls) - (format #t "~1Tsteering: ~f~%" (-> obj steering)) - (format #t "~1Tthrottle: ~f~%" (-> obj throttle)) - (format #t "~1Tbrake: ~f~%" (-> obj brake)) - (format #t "~1Tlean-z: ~f~%" (-> obj lean-z)) + (format #t "[~8x] ~A~%" this 'vehicle-controls) + (format #t "~1Tsteering: ~f~%" (-> this steering)) + (format #t "~1Tthrottle: ~f~%" (-> this throttle)) + (format #t "~1Tbrake: ~f~%" (-> this brake)) + (format #t "~1Tlean-z: ~f~%" (-> this lean-z)) (label cfg-4) - obj + this ) ;; definition of type pilot-info @@ -61,37 +61,37 @@ ) ;; definition for method 3 of type pilot-info -(defmethod inspect pilot-info ((obj pilot-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect pilot-info ((this pilot-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tvehicle: #x~X~%" (-> obj vehicle)) - (format #t "~1Tleft-right-interp: ~f~%" (-> obj left-right-interp)) - (format #t "~1Tfront-back-interp: ~f~%" (-> obj front-back-interp)) - (format #t "~1Tup-down-interp: ~f~%" (-> obj up-down-interp)) - (format #t "~1Tup-down-accel-factor: ~f~%" (-> obj up-down-accel-factor)) - (format #t "~1Tfront-back-accel-factor: ~f~%" (-> obj front-back-accel-factor)) - (format #t "~1Tleft-right-accel-factor: ~f~%" (-> obj left-right-accel-factor)) - (format #t "~1Tstance: ~D~%" (-> obj stance)) - (format #t "~1Tseat-index: ~D~%" (-> obj seat-index)) - (format #t "~1Tbackup-nav-radius: ~f~%" (-> obj backup-nav-radius)) - (format #t "~1Tcam-side-shift: ~f~%" (-> obj cam-side-shift)) - (format #t "~1Tenable-cam-side-shift: ~A~%" (-> obj enable-cam-side-shift)) - (format #t "~1Tgun?: ~A~%" (-> obj gun?)) - (format #t "~1Tcontrols: #~%" (-> obj controls)) - (format #t "~1Taccel-array: ~`vector`P~%" (-> obj accel-array)) - (format #t "~1Tlocal-accel: ~`vector`P~%" (-> obj local-accel)) - (format #t "~1Tpilot-trans: ~`vector`P~%" (-> obj pilot-trans)) - (format #t "~1Tpilot-quat: ~`vector`P~%" (-> obj pilot-quat)) - (format #t "~1Tpilot-scale: ~`vector`P~%" (-> obj pilot-scale)) - (format #t "~1Tpilot-time: ~D~%" (-> obj pilot-time)) - (format #t "~1Tas-daxter?: ~A~%" (-> obj as-daxter?)) - (format #t "~1Tart-group-backup: ~A~%" (-> obj art-group-backup)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tvehicle: #x~X~%" (-> this vehicle)) + (format #t "~1Tleft-right-interp: ~f~%" (-> this left-right-interp)) + (format #t "~1Tfront-back-interp: ~f~%" (-> this front-back-interp)) + (format #t "~1Tup-down-interp: ~f~%" (-> this up-down-interp)) + (format #t "~1Tup-down-accel-factor: ~f~%" (-> this up-down-accel-factor)) + (format #t "~1Tfront-back-accel-factor: ~f~%" (-> this front-back-accel-factor)) + (format #t "~1Tleft-right-accel-factor: ~f~%" (-> this left-right-accel-factor)) + (format #t "~1Tstance: ~D~%" (-> this stance)) + (format #t "~1Tseat-index: ~D~%" (-> this seat-index)) + (format #t "~1Tbackup-nav-radius: ~f~%" (-> this backup-nav-radius)) + (format #t "~1Tcam-side-shift: ~f~%" (-> this cam-side-shift)) + (format #t "~1Tenable-cam-side-shift: ~A~%" (-> this enable-cam-side-shift)) + (format #t "~1Tgun?: ~A~%" (-> this gun?)) + (format #t "~1Tcontrols: #~%" (-> this controls)) + (format #t "~1Taccel-array: ~`vector`P~%" (-> this accel-array)) + (format #t "~1Tlocal-accel: ~`vector`P~%" (-> this local-accel)) + (format #t "~1Tpilot-trans: ~`vector`P~%" (-> this pilot-trans)) + (format #t "~1Tpilot-quat: ~`vector`P~%" (-> this pilot-quat)) + (format #t "~1Tpilot-scale: ~`vector`P~%" (-> this pilot-scale)) + (format #t "~1Tpilot-time: ~D~%" (-> this pilot-time)) + (format #t "~1Tas-daxter?: ~A~%" (-> this as-daxter?)) + (format #t "~1Tart-group-backup: ~A~%" (-> this art-group-backup)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc b/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc index cdc8894368..935da91de5 100644 --- a/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc @@ -111,19 +111,19 @@ ) ;; definition for method 3 of type user-setting-data -(defmethod inspect user-setting-data ((obj user-setting-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect user-setting-data ((this user-setting-data)) + (when (not this) + (set! this this) (goto cfg-71) ) - (format #t "[~8x] ~A~%" obj 'user-setting-data) - (format #t "~1Tborder-mode: ~A~%" (-> obj border-mode)) - (format #t "~1Tprocess-mask: #x~X~%" (-> obj process-mask)) + (format #t "[~8x] ~A~%" this 'user-setting-data) + (format #t "~1Tborder-mode: ~A~%" (-> this border-mode)) + (format #t "~1Tprocess-mask: #x~X~%" (-> this process-mask)) (let ((t9-3 format) (a0-4 #t) (a1-3 "~1Tlanguage: #x~X : ~S~%") - (a2-3 (-> obj language)) - (v1-2 (-> obj language)) + (a2-3 (-> this language)) + (v1-2 (-> this language)) ) (t9-3 a0-4 a1-3 a2-3 (cond ((= v1-2 (language-enum english)) @@ -156,26 +156,26 @@ ) ) ) - (format #t "~1Tmovie: ~A~%" (ppointer->process (-> obj movie))) - (format #t "~1Ttalking: ~A~%" (ppointer->process (-> obj talking))) - (format #t "~1Tspooling: ~A~%" (ppointer->process (-> obj spooling))) - (format #t "~1Thint: ~A~%" (ppointer->process (-> obj hint))) - (format #t "~1Tambient: ~A~%" (ppointer->process (-> obj ambient))) - (format #t "~1Tvideo-mode: ~A~%" (-> obj video-mode)) - (format #t "~1Taspect-ratio: ~A~%" (-> obj aspect-ratio)) - (format #t "~1Tauto-save: ~A~%" (-> obj auto-save)) - (format #t "~1Tbg-r: ~f~%" (-> obj bg-r)) - (format #t "~1Tbg-g: ~f~%" (-> obj bg-g)) - (format #t "~1Tbg-b: ~f~%" (-> obj bg-b)) - (format #t "~1Tbg-a: ~f~%" (-> obj bg-a)) - (format #t "~1Tbg-a-speed: ~f~%" (-> obj bg-a-speed)) - (format #t "~1Tbg-a-force: ~f~%" (-> obj bg-a-force)) - (format #t "~1Tallow-progress: ~A~%" (-> obj allow-progress)) - (format #t "~1Tallow-pause: ~A~%" (-> obj allow-pause)) - (format #t "~1Tmovie-name: ~A~%" (-> obj movie-name)) - (format #t "~1Tweather: ~A~%" (-> obj weather)) - (format #t "~1Ttask-mask: #x~X : (task-mask " (-> obj task-mask)) - (let ((s5-0 (-> obj task-mask))) + (format #t "~1Tmovie: ~A~%" (ppointer->process (-> this movie))) + (format #t "~1Ttalking: ~A~%" (ppointer->process (-> this talking))) + (format #t "~1Tspooling: ~A~%" (ppointer->process (-> this spooling))) + (format #t "~1Thint: ~A~%" (ppointer->process (-> this hint))) + (format #t "~1Tambient: ~A~%" (ppointer->process (-> this ambient))) + (format #t "~1Tvideo-mode: ~A~%" (-> this video-mode)) + (format #t "~1Taspect-ratio: ~A~%" (-> this aspect-ratio)) + (format #t "~1Tauto-save: ~A~%" (-> this auto-save)) + (format #t "~1Tbg-r: ~f~%" (-> this bg-r)) + (format #t "~1Tbg-g: ~f~%" (-> this bg-g)) + (format #t "~1Tbg-b: ~f~%" (-> this bg-b)) + (format #t "~1Tbg-a: ~f~%" (-> this bg-a)) + (format #t "~1Tbg-a-speed: ~f~%" (-> this bg-a-speed)) + (format #t "~1Tbg-a-force: ~f~%" (-> this bg-a-force)) + (format #t "~1Tallow-progress: ~A~%" (-> this allow-progress)) + (format #t "~1Tallow-pause: ~A~%" (-> this allow-pause)) + (format #t "~1Tmovie-name: ~A~%" (-> this movie-name)) + (format #t "~1Tweather: ~A~%" (-> this weather)) + (format #t "~1Ttask-mask: #x~X : (task-mask " (-> this task-mask)) + (let ((s5-0 (-> this task-mask))) (if (= (logand s5-0 (task-mask task0)) (task-mask task0)) (format #t "task0 ") ) @@ -235,71 +235,71 @@ ) ) (format #t ")~%") - (format #t "~1Tduck: ~A~%" (-> obj duck)) - (format #t "~1Tattack: ~A~%" (-> obj attack)) - (format #t "~1Tgun: ~A~%" (-> obj gun)) - (format #t "~1Tboard: ~A~%" (-> obj board)) - (format #t "~1Tjump: ~A~%" (-> obj jump)) - (format #t "~1Tspeed-mult: ~f~%" (-> obj speed-mult)) - (format #t "~1Tfeatures: ~D~%" (-> obj features)) - (format #t "~1Tsfx-volume: ~f~%" (-> obj sfx-volume)) - (format #t "~1Tsfx-volume-movie: ~f~%" (-> obj sfx-movie-volume)) - (format #t "~1Tmusic-volume: ~f~%" (-> obj music-volume)) - (format #t "~1Tmusic-volume-movie: ~f~%" (-> obj music-volume-movie)) - (format #t "~1Tdialog-volume: ~f~%" (-> obj dialog-volume)) - (format #t "~1Tdialog-volume-hint: ~f~%" (-> obj dialog-volume-hint)) - (format #t "~1Tambient-volume: ~f~%" (-> obj ambient-volume)) - (format #t "~1Tambient-volume-movie: ~f~%" (-> obj ambient-volume-move)) - (format #t "~1Tsound-flava: ~D~%" (-> obj sound-flava)) - (format #t "~1Tsound-flava-priority: ~f~%" (-> obj sound-flava-priority)) - (format #t "~1Tmode-sound-bank: ~A~%" (-> obj mode-sound-bank)) - (format #t "~1Tsound-excitement: ~f~%" (-> obj sound-excitement)) - (format #t "~1Tsound-reverb: ~f~%" (-> obj sound-reverb)) - (format #t "~1Tstereo-mode: ~D~%" (-> obj stereo-mode)) - (format #t "~1Tmusic: ~A~%" (-> obj music)) - (format #t "~1Tsound-stinger: ~D~%" (-> obj sound-stinger)) - (format #t "~1Tspool-anim: ~A~%" (-> obj spool-anim)) - (format #t "~1Tsound-mode: ~D~%" (-> obj sound-mode)) - (format #t "~1Ttask-manager: ~A~%" (ppointer->process (-> obj task-manager))) - (format #t "~1Ttask: ~A~%" (-> obj task)) - (format #t "~1Tairlock: ~A~%" (-> obj airlock)) - (format #t "~1Tminimap: ~D~%" (-> obj minimap)) - (format #t "~1Tsound-tune: ~D~%" (-> obj sound-tune)) - (format #t "~1Tallow-continue: ~A~%" (-> obj allow-continue)) - (format #t "~1Tspotlight-color: ~D~%" (-> obj spotlight-color)) - (format #t "~1Tsubtitle: ~A~%" (-> obj subtitle)) - (format #t "~1Tborrow: ~A~%" (-> obj borrow)) - (format #t "~1Tdoorway: ~A~%" (-> obj doorway)) - (format #t "~1Tgem: ~A~%" (-> obj gem)) - (format #t "~1Thalf-speed: ~A~%" (-> obj half-speed)) - (format #t "~1Tgun-buoy: ~A~%" (-> obj gun-buoy)) - (format #t "~1Tdouble-jump: ~A~%" (-> obj double-jump)) - (format #t "~1Tpilot: ~A~%" (-> obj pilot)) - (format #t "~1Tpilot-exit: ~A~%" (-> obj pilot-exit)) - (format #t "~1Texclusive-task: ~D~%" (-> obj exclusive-task)) - (format #t "~1Tspeech-control: ~A~%" (-> obj speech-control)) - (format #t "~1Tvehicle-hijacking: ~A~%" (-> obj vehicle-hijacking)) - (format #t "~1Tdarkjak: ~A~%" (-> obj darkjak)) - (format #t "~1Tendlessfall: ~A~%" (-> obj endlessfall)) - (format #t "~1Train: ~f~%" (-> obj rain)) - (format #t "~1Tsnow: ~f~%" (-> obj snow)) - (format #t "~1Texclusive-load: ~A~%" (-> obj exclusive-load)) - (format #t "~1Trender: ~A~%" (-> obj render)) - (format #t "~1Tallow-timeout: ~A~%" (-> obj allow-timeout)) - (format #t "~1Tmirror: ~A~%" (-> obj mirror)) - (format #t "~1Tmovie-skip-frame: ~f~%" (-> obj movie-skip-frame)) - (format #t "~1Tallow-blackout: ~A~%" (-> obj allow-blackout)) - (format #t "~1Trace-minimap: ~D~%" (-> obj race-minimap)) - (format #t "~1Textra-bank: ~A~%" (-> obj extra-bank)) - (format #t "~1Tbeard: ~A~%" (-> obj beard)) - (format #t "~1Tignore-target: ~A~%" (-> obj ignore-target)) - (format #t "~1Tsubtitle-language: ~D~%" (-> obj subtitle-language)) - (format #t "~1Tsound-bank-load: ~A~%" (-> obj sound-bank-load)) - (format #t "~1Tallow-error: ~A~%" (-> obj allow-error)) - (format #t "~1Tunder-water-pitch-mod: ~f~%" (-> obj under-water-pitch-mod)) - (format #t "~1Tdummy[31] @ #x~X~%" (-> obj dummy)) + (format #t "~1Tduck: ~A~%" (-> this duck)) + (format #t "~1Tattack: ~A~%" (-> this attack)) + (format #t "~1Tgun: ~A~%" (-> this gun)) + (format #t "~1Tboard: ~A~%" (-> this board)) + (format #t "~1Tjump: ~A~%" (-> this jump)) + (format #t "~1Tspeed-mult: ~f~%" (-> this speed-mult)) + (format #t "~1Tfeatures: ~D~%" (-> this features)) + (format #t "~1Tsfx-volume: ~f~%" (-> this sfx-volume)) + (format #t "~1Tsfx-volume-movie: ~f~%" (-> this sfx-movie-volume)) + (format #t "~1Tmusic-volume: ~f~%" (-> this music-volume)) + (format #t "~1Tmusic-volume-movie: ~f~%" (-> this music-volume-movie)) + (format #t "~1Tdialog-volume: ~f~%" (-> this dialog-volume)) + (format #t "~1Tdialog-volume-hint: ~f~%" (-> this dialog-volume-hint)) + (format #t "~1Tambient-volume: ~f~%" (-> this ambient-volume)) + (format #t "~1Tambient-volume-movie: ~f~%" (-> this ambient-volume-move)) + (format #t "~1Tsound-flava: ~D~%" (-> this sound-flava)) + (format #t "~1Tsound-flava-priority: ~f~%" (-> this sound-flava-priority)) + (format #t "~1Tmode-sound-bank: ~A~%" (-> this mode-sound-bank)) + (format #t "~1Tsound-excitement: ~f~%" (-> this sound-excitement)) + (format #t "~1Tsound-reverb: ~f~%" (-> this sound-reverb)) + (format #t "~1Tstereo-mode: ~D~%" (-> this stereo-mode)) + (format #t "~1Tmusic: ~A~%" (-> this music)) + (format #t "~1Tsound-stinger: ~D~%" (-> this sound-stinger)) + (format #t "~1Tspool-anim: ~A~%" (-> this spool-anim)) + (format #t "~1Tsound-mode: ~D~%" (-> this sound-mode)) + (format #t "~1Ttask-manager: ~A~%" (ppointer->process (-> this task-manager))) + (format #t "~1Ttask: ~A~%" (-> this task)) + (format #t "~1Tairlock: ~A~%" (-> this airlock)) + (format #t "~1Tminimap: ~D~%" (-> this minimap)) + (format #t "~1Tsound-tune: ~D~%" (-> this sound-tune)) + (format #t "~1Tallow-continue: ~A~%" (-> this allow-continue)) + (format #t "~1Tspotlight-color: ~D~%" (-> this spotlight-color)) + (format #t "~1Tsubtitle: ~A~%" (-> this subtitle)) + (format #t "~1Tborrow: ~A~%" (-> this borrow)) + (format #t "~1Tdoorway: ~A~%" (-> this doorway)) + (format #t "~1Tgem: ~A~%" (-> this gem)) + (format #t "~1Thalf-speed: ~A~%" (-> this half-speed)) + (format #t "~1Tgun-buoy: ~A~%" (-> this gun-buoy)) + (format #t "~1Tdouble-jump: ~A~%" (-> this double-jump)) + (format #t "~1Tpilot: ~A~%" (-> this pilot)) + (format #t "~1Tpilot-exit: ~A~%" (-> this pilot-exit)) + (format #t "~1Texclusive-task: ~D~%" (-> this exclusive-task)) + (format #t "~1Tspeech-control: ~A~%" (-> this speech-control)) + (format #t "~1Tvehicle-hijacking: ~A~%" (-> this vehicle-hijacking)) + (format #t "~1Tdarkjak: ~A~%" (-> this darkjak)) + (format #t "~1Tendlessfall: ~A~%" (-> this endlessfall)) + (format #t "~1Train: ~f~%" (-> this rain)) + (format #t "~1Tsnow: ~f~%" (-> this snow)) + (format #t "~1Texclusive-load: ~A~%" (-> this exclusive-load)) + (format #t "~1Trender: ~A~%" (-> this render)) + (format #t "~1Tallow-timeout: ~A~%" (-> this allow-timeout)) + (format #t "~1Tmirror: ~A~%" (-> this mirror)) + (format #t "~1Tmovie-skip-frame: ~f~%" (-> this movie-skip-frame)) + (format #t "~1Tallow-blackout: ~A~%" (-> this allow-blackout)) + (format #t "~1Trace-minimap: ~D~%" (-> this race-minimap)) + (format #t "~1Textra-bank: ~A~%" (-> this extra-bank)) + (format #t "~1Tbeard: ~A~%" (-> this beard)) + (format #t "~1Tignore-target: ~A~%" (-> this ignore-target)) + (format #t "~1Tsubtitle-language: ~D~%" (-> this subtitle-language)) + (format #t "~1Tsound-bank-load: ~A~%" (-> this sound-bank-load)) + (format #t "~1Tallow-error: ~A~%" (-> this allow-error)) + (format #t "~1Tunder-water-pitch-mod: ~f~%" (-> this under-water-pitch-mod)) + (format #t "~1Tdummy[31] @ #x~X~%" (-> this dummy)) (label cfg-71) - obj + this ) ;; definition of type cam-setting-data @@ -369,28 +369,28 @@ ) ;; definition for method 3 of type cam-setting-data -(defmethod inspect cam-setting-data ((obj cam-setting-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect cam-setting-data ((this cam-setting-data)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj 'cam-setting-data) - (format #t "~1Tfov: (deg ~r)~%" (-> obj fov)) - (format #t "~1Tpov-handle: ~D~%" (-> obj pov-handle)) - (format #t "~1Tpov-bone: ~D~%" (-> obj pov-bone)) - (format #t "~1Tpov-offset: ~`vector`P~%" (-> obj pov-offset)) - (format #t "~1Tstring-default: ~`boolean`P~%" (-> obj string-default)) - (format #t "~1Tstring-max-length: (meters ~m)~%" (-> obj string-max-length)) - (format #t "~1Tstring-min-length: (meters ~m)~%" (-> obj string-min-length)) - (format #t "~1Tstring-max-height: (meters ~m)~%" (-> obj string-max-height)) - (format #t "~1Tstring-min-height: (meters ~m)~%" (-> obj string-min-height)) - (format #t "~1Tstring-cliff-height: (meters ~m)~%" (-> obj string-cliff-height)) - (format #t "~1Tstring-camera-ceiling: (meters ~m)~%" (-> obj string-camera-ceiling)) - (format #t "~1Tgun-max-height: (meters ~m)~%" (-> obj gun-max-height)) - (format #t "~1Tgun-min-height: (meters ~m)~%" (-> obj gun-min-height)) - (format #t "~1Tstring-local-down: ~`vector`P~%" (-> obj string-local-down)) - (format #t "~1Tslave-options: #x~X : (cam-slave-options " (-> obj slave-options)) - (let ((s5-0 (-> obj slave-options))) + (format #t "[~8x] ~A~%" this 'cam-setting-data) + (format #t "~1Tfov: (deg ~r)~%" (-> this fov)) + (format #t "~1Tpov-handle: ~D~%" (-> this pov-handle)) + (format #t "~1Tpov-bone: ~D~%" (-> this pov-bone)) + (format #t "~1Tpov-offset: ~`vector`P~%" (-> this pov-offset)) + (format #t "~1Tstring-default: ~`boolean`P~%" (-> this string-default)) + (format #t "~1Tstring-max-length: (meters ~m)~%" (-> this string-max-length)) + (format #t "~1Tstring-min-length: (meters ~m)~%" (-> this string-min-length)) + (format #t "~1Tstring-max-height: (meters ~m)~%" (-> this string-max-height)) + (format #t "~1Tstring-min-height: (meters ~m)~%" (-> this string-min-height)) + (format #t "~1Tstring-cliff-height: (meters ~m)~%" (-> this string-cliff-height)) + (format #t "~1Tstring-camera-ceiling: (meters ~m)~%" (-> this string-camera-ceiling)) + (format #t "~1Tgun-max-height: (meters ~m)~%" (-> this gun-max-height)) + (format #t "~1Tgun-min-height: (meters ~m)~%" (-> this gun-min-height)) + (format #t "~1Tstring-local-down: ~`vector`P~%" (-> this string-local-down)) + (format #t "~1Tslave-options: #x~X : (cam-slave-options " (-> this slave-options)) + (let ((s5-0 (-> this slave-options))) (if (= (logand s5-0 (cam-slave-options SAME_SIDE)) (cam-slave-options SAME_SIDE)) (format #t "SAME_SIDE ") ) @@ -467,24 +467,24 @@ ) ) (format #t ")~%") - (format #t "~1Tmatrix-blend-max-angle: (deg ~r)~%" (-> obj matrix-blend-max-angle)) - (format #t "~1Tmatrix-blend-max-partial: ~f~%" (-> obj matrix-blend-max-partial)) - (format #t "~1Tstring-spline-max-move: (meters ~m)~%" (-> obj string-spline-max-move)) - (format #t "~1Tstring-spline-accel: (meters ~m)~%" (-> obj string-spline-accel)) - (format #t "~1Tstring-spline-max-move-player: (meters ~m)~%" (-> obj string-spline-max-move-player)) - (format #t "~1Tstring-spline-accel-player: (meters ~m)~%" (-> obj string-spline-accel-player)) - (format #t "~1Tstring-startup-vector: ~`vector`P~%" (-> obj string-startup-vector)) - (format #t "~1Tuse-string-startup-vector: ~A~%" (-> obj string-use-startup-vector)) - (format #t "~1Tlook-at-point: ~`vector`P~%" (-> obj look-at-point)) - (format #t "~1Tuse-look-at-point: ~A~%" (-> obj use-look-at-point)) - (format #t "~1Ttarget-height: (meters ~m)~%" (-> obj target-height)) - (format #t "~1Tfoot-offset: (meters ~m)~%" (-> obj foot-offset)) - (format #t "~1Thead-offset: (meters ~m)~%" (-> obj head-offset)) - (format #t "~1Tteleport-on-entity-change: ~`boolean`P~%" (-> obj teleport-on-entity-change)) - (format #t "~1Tentity-name: ~`string`P~%" (-> obj entity-name)) - (format #t "~1Tentity-or-mode-changed: ~`boolean`P~%" (-> obj entity-or-mode-changed)) - (format #t "~1Tmaster-options: #x~X : (cam-master-options " (-> obj master-options)) - (let ((s5-1 (-> obj master-options))) + (format #t "~1Tmatrix-blend-max-angle: (deg ~r)~%" (-> this matrix-blend-max-angle)) + (format #t "~1Tmatrix-blend-max-partial: ~f~%" (-> this matrix-blend-max-partial)) + (format #t "~1Tstring-spline-max-move: (meters ~m)~%" (-> this string-spline-max-move)) + (format #t "~1Tstring-spline-accel: (meters ~m)~%" (-> this string-spline-accel)) + (format #t "~1Tstring-spline-max-move-player: (meters ~m)~%" (-> this string-spline-max-move-player)) + (format #t "~1Tstring-spline-accel-player: (meters ~m)~%" (-> this string-spline-accel-player)) + (format #t "~1Tstring-startup-vector: ~`vector`P~%" (-> this string-startup-vector)) + (format #t "~1Tuse-string-startup-vector: ~A~%" (-> this string-use-startup-vector)) + (format #t "~1Tlook-at-point: ~`vector`P~%" (-> this look-at-point)) + (format #t "~1Tuse-look-at-point: ~A~%" (-> this use-look-at-point)) + (format #t "~1Ttarget-height: (meters ~m)~%" (-> this target-height)) + (format #t "~1Tfoot-offset: (meters ~m)~%" (-> this foot-offset)) + (format #t "~1Thead-offset: (meters ~m)~%" (-> this head-offset)) + (format #t "~1Tteleport-on-entity-change: ~`boolean`P~%" (-> this teleport-on-entity-change)) + (format #t "~1Tentity-name: ~`string`P~%" (-> this entity-name)) + (format #t "~1Tentity-or-mode-changed: ~`boolean`P~%" (-> this entity-or-mode-changed)) + (format #t "~1Tmaster-options: #x~X : (cam-master-options " (-> this master-options)) + (let ((s5-1 (-> this master-options))) (if (= (logand s5-1 (cam-master-options IMMEDIATE_STRING_MIN_MAX)) (cam-master-options IMMEDIATE_STRING_MIN_MAX)) (format #t "IMMEDIATE_STRING_MIN_MAX ") ) @@ -511,30 +511,30 @@ ) ) (format #t ")~%") - (format #t "~1Tentity-mask: ~D~%" (-> obj entity-mask)) - (format #t "~1Tmode-name: ~A~%" (-> obj mode-name)) - (format #t "~1Treal-entity-name: ~`string`P~%" (-> obj real-entity-name)) - (format #t "~1Tcam-mode: ~A~%" (-> obj cam-mode)) - (format #t "~1Tinterp-time: ~D~%" (-> obj interp-time)) - (format #t "~1Tno-intro: ~A~%" (-> obj no-intro)) - (format #t "~1Tuse-point-of-interest: ~A~%" (-> obj use-point-of-interest)) - (format #t "~1Tpoint-of-interest: ~`vector`P~%" (-> obj point-of-interest)) - (format #t "~1Thandle-of-interest: ~D~%" (-> obj handle-of-interest)) - (format #t "~1Tmouse-tumble-point: ~`vector`P~%" (-> obj mouse-tumble-point)) - (format #t "~1Tuse-mouse-tumble-point: ~A~%" (-> obj use-mouse-tumble-point)) - (format #t "~1Tmouse-input: ~A~%" (-> obj mouse-input)) - (format #t "~1Tcpad1-skip-buttons: ~A~%" (-> obj cpad1-skip-buttons)) - (format #t "~1Tbutt-handle: ~D~%" (-> obj butt-handle)) - (format #t "~1Tbutt-angle: ~f~%" (-> obj butt-angle)) - (format #t "~1Textra-follow-height: ~f~%" (-> obj extra-follow-height)) - (format #t "~1Tinterp-time-priority: ~D~%" (-> obj interp-time-priority)) - (format #t "~1Tstring-max-length-default: ~A~%" (-> obj string-max-length-default)) - (format #t "~1Tstring-min-length-default: ~A~%" (-> obj string-min-length-default)) - (format #t "~1Tstring-max-height-default: ~A~%" (-> obj string-max-height-default)) - (format #t "~1Tstring-min-height-default: ~A~%" (-> obj string-min-height-default)) - (format #t "~1Tdummy[102] @ #x~X~%" (-> obj dummy)) + (format #t "~1Tentity-mask: ~D~%" (-> this entity-mask)) + (format #t "~1Tmode-name: ~A~%" (-> this mode-name)) + (format #t "~1Treal-entity-name: ~`string`P~%" (-> this real-entity-name)) + (format #t "~1Tcam-mode: ~A~%" (-> this cam-mode)) + (format #t "~1Tinterp-time: ~D~%" (-> this interp-time)) + (format #t "~1Tno-intro: ~A~%" (-> this no-intro)) + (format #t "~1Tuse-point-of-interest: ~A~%" (-> this use-point-of-interest)) + (format #t "~1Tpoint-of-interest: ~`vector`P~%" (-> this point-of-interest)) + (format #t "~1Thandle-of-interest: ~D~%" (-> this handle-of-interest)) + (format #t "~1Tmouse-tumble-point: ~`vector`P~%" (-> this mouse-tumble-point)) + (format #t "~1Tuse-mouse-tumble-point: ~A~%" (-> this use-mouse-tumble-point)) + (format #t "~1Tmouse-input: ~A~%" (-> this mouse-input)) + (format #t "~1Tcpad1-skip-buttons: ~A~%" (-> this cpad1-skip-buttons)) + (format #t "~1Tbutt-handle: ~D~%" (-> this butt-handle)) + (format #t "~1Tbutt-angle: ~f~%" (-> this butt-angle)) + (format #t "~1Textra-follow-height: ~f~%" (-> this extra-follow-height)) + (format #t "~1Tinterp-time-priority: ~D~%" (-> this interp-time-priority)) + (format #t "~1Tstring-max-length-default: ~A~%" (-> this string-max-length-default)) + (format #t "~1Tstring-min-length-default: ~A~%" (-> this string-min-length-default)) + (format #t "~1Tstring-max-height-default: ~A~%" (-> this string-max-height-default)) + (format #t "~1Tstring-min-height-default: ~A~%" (-> this string-min-height-default)) + (format #t "~1Tdummy[102] @ #x~X~%" (-> this dummy)) (label cfg-68) - obj + this ) ;; definition of type setting-control @@ -573,28 +573,28 @@ ) ;; definition for method 3 of type setting-control -(defmethod inspect setting-control ((obj setting-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect setting-control ((this setting-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tuser-current: #~%" (-> obj user-current)) - (format #t "~1Tuser-target: #~%" (-> obj user-target)) - (format #t "~1Tuser-default: #~%" (-> obj user-default)) - (format #t "~1Tcam-current: #~%" (-> obj cam-current)) - (format #t "~1Tcam-target: #~%" (-> obj cam-target)) - (format #t "~1Tcam-default: #~%" (-> obj cam-default)) - (format #t "~1Tengine: ~A~%" (-> obj engine)) - (format #t "~1Tengine-pers: ~A~%" (-> obj engine-pers)) - (format #t "~1Tengine-hi: ~A~%" (-> obj engine-hi)) - (format #t "~1Tsound-stinger-time: ~D~%" (-> obj sound-stinger-time)) - (format #t "~1Tsound-stinger-change-time[4] @ #x~X~%" (-> obj sound-stinger-change-time)) - (format #t "~1Tsound-excitement-change-time: ~D~%" (-> obj sound-excitement-change-time)) - (format #t "~1Tsound-excitement-targ: ~f~%" (-> obj sound-excitement-targ)) - (format #t "~1Tsound-excitement-level: ~D~%" (-> obj sound-excitement-level)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tuser-current: #~%" (-> this user-current)) + (format #t "~1Tuser-target: #~%" (-> this user-target)) + (format #t "~1Tuser-default: #~%" (-> this user-default)) + (format #t "~1Tcam-current: #~%" (-> this cam-current)) + (format #t "~1Tcam-target: #~%" (-> this cam-target)) + (format #t "~1Tcam-default: #~%" (-> this cam-default)) + (format #t "~1Tengine: ~A~%" (-> this engine)) + (format #t "~1Tengine-pers: ~A~%" (-> this engine-pers)) + (format #t "~1Tengine-hi: ~A~%" (-> this engine-hi)) + (format #t "~1Tsound-stinger-time: ~D~%" (-> this sound-stinger-time)) + (format #t "~1Tsound-stinger-change-time[4] @ #x~X~%" (-> this sound-stinger-change-time)) + (format #t "~1Tsound-excitement-change-time: ~D~%" (-> this sound-excitement-change-time)) + (format #t "~1Tsound-excitement-targ: ~f~%" (-> this sound-excitement-targ)) + (format #t "~1Tsound-excitement-level: ~D~%" (-> this sound-excitement-level)) (label cfg-4) - obj + this ) ;; definition for method 0 of type setting-control diff --git a/test/decompiler/reference/jak2/engine/game/settings_REF.gc b/test/decompiler/reference/jak2/engine/game/settings_REF.gc index 0f990e5fff..80787ca38b 100644 --- a/test/decompiler/reference/jak2/engine/game/settings_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/settings_REF.gc @@ -8,11 +8,11 @@ ) ;; definition for method 9 of type user-setting-data -(defmethod user-setting-data-method-9 user-setting-data ((obj user-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) +(defmethod user-setting-data-method-9 user-setting-data ((this user-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) (let ((s3-0 (-> arg1 alive-list))) (while s3-0 (user-setting-data-method-10 - obj + this (-> s3-0 param 0) (the-as symbol (-> s3-0 param 1)) (the-as float (-> s3-0 param 2)) @@ -32,7 +32,7 @@ (= ((method-of-type connection get-process) (the-as connection s3-1)) (ppointer->process *progress-process*)) ) (user-setting-data-method-10 - obj + this s1-0 (the-as symbol (-> (the-as connection s3-1) param1)) (the-as float (-> (the-as connection s3-1) param2)) @@ -42,7 +42,7 @@ ) (else (user-setting-data-method-10 - obj + this s1-0 (the-as symbol (-> (the-as connection s3-1) param1)) (the-as float (-> (the-as connection s3-1) param2)) @@ -60,7 +60,7 @@ ) (while (!= v1-21 (-> arg2 alive-list-end)) (user-setting-data-method-10 - obj + this (-> (the-as connection v1-21) param0) (the-as symbol (-> (the-as connection v1-21) param1)) (the-as float (-> (the-as connection v1-21) param2)) @@ -70,418 +70,418 @@ (set! s4-1 (-> s4-1 next0)) ) ) - obj + this ) ;; definition for method 10 of type user-setting-data -(defmethod user-setting-data-method-10 user-setting-data ((obj user-setting-data) (arg0 object) (arg1 symbol) (arg2 float) (arg3 uint)) +(defmethod user-setting-data-method-10 user-setting-data ((this user-setting-data) (arg0 object) (arg1 symbol) (arg2 float) (arg3 uint)) "set-defaults! perhaps?" (case arg0 (('border-mode) - (set! (-> obj border-mode) arg1) + (set! (-> this border-mode) arg1) ) (('region-mode) - (set! (-> obj region-mode) arg1) + (set! (-> this region-mode) arg1) ) (('allow-look-around) - (set! (-> obj allow-look-around) arg1) + (set! (-> this allow-look-around) arg1) ) (('ocean-off) - (set! (-> obj ocean-off) arg1) + (set! (-> this ocean-off) arg1) ) (('weather) - (set! (-> obj weather) arg1) + (set! (-> this weather) arg1) ) (('mouse) - (set! (-> obj mouse) arg1) + (set! (-> this mouse) arg1) ) (('cursor) - (set! (-> obj cursor) arg1) + (set! (-> this cursor) arg1) ) (('music) - (set! (-> obj music) arg1) + (set! (-> this music) arg1) ) (('extra-bank) - (set! (-> obj extra-bank) (the-as pair arg1)) + (set! (-> this extra-bank) (the-as pair arg1)) ) (('process-mask) (case arg1 (('set) - (logior! (-> obj process-mask) arg3) + (logior! (-> this process-mask) arg3) ) (('clear) - (logclear! (-> obj process-mask) arg3) + (logclear! (-> this process-mask) arg3) ) (('abs) - (set! (-> obj process-mask) (the-as process-mask arg3)) + (set! (-> this process-mask) (the-as process-mask arg3)) ) ) ) (('task-mask) (case arg1 (('set) - (logior! (-> obj task-mask) arg3) + (logior! (-> this task-mask) arg3) ) (('clear) - (logclear! (-> obj task-mask) arg3) + (logclear! (-> this task-mask) arg3) ) (('abs) - (set! (-> obj task-mask) (the-as task-mask arg3)) + (set! (-> this task-mask) (the-as task-mask arg3)) ) ) ) (('task-manager) - (set! (-> obj task-manager) (the-as (pointer process) arg1)) + (set! (-> this task-manager) (the-as (pointer process) arg1)) ) (('task) - (set! (-> obj task) arg1) + (set! (-> this task) arg1) ) (('exclusive-task) - (set! (-> obj exclusive-task) (the-as int arg3)) + (set! (-> this exclusive-task) (the-as int arg3)) ) (('exclusive-load) - (set! (-> obj exclusive-load) arg1) + (set! (-> this exclusive-load) arg1) ) (('sfx-volume) (case arg1 (('rel) - (set! (-> obj sfx-volume) (* (-> obj sfx-volume) arg2)) + (set! (-> this sfx-volume) (* (-> this sfx-volume) arg2)) ) (else - (set! (-> obj sfx-volume) arg2) + (set! (-> this sfx-volume) arg2) ) ) ) (('music-volume) (case arg1 (('rel) - (set! (-> obj music-volume) (* (-> obj music-volume) arg2)) + (set! (-> this music-volume) (* (-> this music-volume) arg2)) ) (else - (set! (-> obj music-volume) arg2) + (set! (-> this music-volume) arg2) ) ) ) (('ambient-volume) (case arg1 (('rel) - (set! (-> obj ambient-volume) (* (-> obj ambient-volume) arg2)) + (set! (-> this ambient-volume) (* (-> this ambient-volume) arg2)) ) (else - (set! (-> obj ambient-volume) arg2) + (set! (-> this ambient-volume) arg2) ) ) ) (('dialog-volume) (case arg1 (('rel) - (set! (-> obj dialog-volume) (* (-> obj dialog-volume) arg2)) + (set! (-> this dialog-volume) (* (-> this dialog-volume) arg2)) ) (else - (set! (-> obj dialog-volume) arg2) + (set! (-> this dialog-volume) arg2) ) ) ) (('sfx-volume-movie) (case arg1 (('rel) - (set! (-> obj sfx-movie-volume) (* (-> obj sfx-movie-volume) arg2)) + (set! (-> this sfx-movie-volume) (* (-> this sfx-movie-volume) arg2)) ) (else - (set! (-> obj sfx-movie-volume) arg2) + (set! (-> this sfx-movie-volume) arg2) ) ) ) (('music-volume-movie) (case arg1 (('rel) - (set! (-> obj music-volume-movie) (* (-> obj music-volume-movie) arg2)) + (set! (-> this music-volume-movie) (* (-> this music-volume-movie) arg2)) ) (else - (set! (-> obj music-volume-movie) arg2) + (set! (-> this music-volume-movie) arg2) ) ) ) (('ambient-volume-movie) (case arg1 (('rel) - (set! (-> obj ambient-volume-move) (* (-> obj ambient-volume-move) arg2)) + (set! (-> this ambient-volume-move) (* (-> this ambient-volume-move) arg2)) ) (else - (set! (-> obj ambient-volume-move) arg2) + (set! (-> this ambient-volume-move) arg2) ) ) ) (('dialog-volume-hint) (case arg1 (('rel) - (set! (-> obj dialog-volume-hint) (* (-> obj dialog-volume-hint) arg2)) + (set! (-> this dialog-volume-hint) (* (-> this dialog-volume-hint) arg2)) ) (else - (set! (-> obj dialog-volume-hint) arg2) + (set! (-> this dialog-volume-hint) arg2) ) ) ) (('sound-flava) - (when (>= arg2 (-> obj sound-flava-priority)) - (set! (-> obj sound-flava) arg3) - (set! (-> obj sound-flava-priority) arg2) + (when (>= arg2 (-> this sound-flava-priority)) + (set! (-> this sound-flava) arg3) + (set! (-> this sound-flava-priority) arg2) ) ) (('sound-mode) - (set! (-> obj sound-mode) arg3) + (set! (-> this sound-mode) arg3) ) (('sound-tune) - (set! (-> obj sound-tune) arg3) + (set! (-> this sound-tune) arg3) ) (('sound-excitement) (case arg1 (('rel) - (set! (-> obj sound-excitement) (* (-> obj sound-excitement) arg2)) + (set! (-> this sound-excitement) (* (-> this sound-excitement) arg2)) ) (('add) - (+! (-> obj sound-excitement) arg2) + (+! (-> this sound-excitement) arg2) ) (else - (set! (-> obj sound-excitement) arg2) + (set! (-> this sound-excitement) arg2) ) ) ) (('sound-reverb) (case arg1 (('rel) - (set! (-> obj sound-reverb) (* (-> obj sound-reverb) arg2)) + (set! (-> this sound-reverb) (* (-> this sound-reverb) arg2)) ) (('add) - (+! (-> obj sound-reverb) arg2) + (+! (-> this sound-reverb) arg2) ) (else - (set! (-> obj sound-reverb) arg2) + (set! (-> this sound-reverb) arg2) ) ) ) (('mode-sound-bank) - (set! (-> obj mode-sound-bank) (the-as uint arg1)) + (set! (-> this mode-sound-bank) (the-as uint arg1)) ) (('spotlight-color) - (set! (-> obj spotlight-color) (the-as rgba arg3)) + (set! (-> this spotlight-color) (the-as rgba arg3)) ) (('bg-r) - (set! (-> obj bg-r) arg2) + (set! (-> this bg-r) arg2) ) (('bg-g) - (set! (-> obj bg-g) arg2) + (set! (-> this bg-g) arg2) ) (('bg-b) - (set! (-> obj bg-b) arg2) + (set! (-> this bg-b) arg2) ) (('bg-a) - (set! (-> obj bg-a) arg2) + (set! (-> this bg-a) arg2) ) (('bg-a-speed) - (set! (-> obj bg-a-speed) arg2) + (set! (-> this bg-a-speed) arg2) ) (('bg-a-force) - (set! (-> obj bg-a-force) arg2) + (set! (-> this bg-a-force) arg2) ) (('allow-blackout) - (set! (-> obj allow-blackout) arg1) + (set! (-> this allow-blackout) arg1) ) (('rain) - (set! (-> obj rain) arg2) + (set! (-> this rain) arg2) ) (('snow) - (set! (-> obj snow) arg2) + (set! (-> this snow) arg2) ) (('language) - (set! (-> obj language) (the-as language-enum arg3)) + (set! (-> this language) (the-as language-enum arg3)) ) (('subtitle-language) - (set! (-> obj subtitle-language) (the-as language-enum arg3)) + (set! (-> this subtitle-language) (the-as language-enum arg3)) ) (('vibration) - (set! (-> obj vibration) arg1) + (set! (-> this vibration) arg1) ) (('auto-save) - (set! (-> obj auto-save) arg1) + (set! (-> this auto-save) arg1) ) (('allow-pause) - (set! (-> obj allow-pause) arg1) + (set! (-> this allow-pause) arg1) ) (('allow-progress) - (set! (-> obj allow-progress) arg1) + (set! (-> this allow-progress) arg1) ) (('allow-continue) - (set! (-> obj allow-continue) arg1) + (set! (-> this allow-continue) arg1) ) (('allow-timeout) - (set! (-> obj allow-timeout) arg1) + (set! (-> this allow-timeout) arg1) ) (('allow-error) - (set! (-> obj allow-error) arg1) + (set! (-> this allow-error) arg1) ) (('under-water-pitch-mod) - (set! (-> obj under-water-pitch-mod) arg2) + (set! (-> this under-water-pitch-mod) arg2) ) (('sound-bank-load) - (set! (-> obj sound-bank-load) arg1) + (set! (-> this sound-bank-load) arg1) ) (('play-hints) - (set! (-> obj play-hints) arg1) + (set! (-> this play-hints) arg1) ) (('subtitle) - (set! (-> obj subtitle) arg1) + (set! (-> this subtitle) arg1) ) (('mirror) - (set! (-> obj mirror) arg1) + (set! (-> this mirror) arg1) ) (('movie) - (set! (-> obj movie) (the-as (pointer process) arg1)) + (set! (-> this movie) (the-as (pointer process) arg1)) ) (('movie-name) - (set! (-> obj movie-name) arg1) + (set! (-> this movie-name) arg1) ) (('movie-skip-frame) - (set! (-> obj movie-skip-frame) arg2) + (set! (-> this movie-skip-frame) arg2) ) (('talking) - (set! (-> obj talking) (the-as (pointer process) arg1)) + (set! (-> this talking) (the-as (pointer process) arg1)) ) (('spooling) - (set! (-> obj spooling) (the-as (pointer process) arg1)) + (set! (-> this spooling) (the-as (pointer process) arg1)) ) (('spool-anim) - (set! (-> obj spool-anim) (the-as spool-anim arg1)) + (set! (-> this spool-anim) (the-as spool-anim arg1)) ) (('hint) - (set! (-> obj hint) (the-as (pointer process) arg1)) + (set! (-> this hint) (the-as (pointer process) arg1)) ) (('ambient) - (set! (-> obj ambient) (the-as (pointer process) arg1)) + (set! (-> this ambient) (the-as (pointer process) arg1)) ) (('common-page) (case arg1 (('set) - (logior! (-> obj unknown-int32-00) arg3) + (logior! (-> this unknown-int32-00) arg3) ) (('clear) - (logclear! (-> obj unknown-int32-00) arg3) + (logclear! (-> this unknown-int32-00) arg3) ) ) ) (('duck) - (set! (-> obj duck) arg1) + (set! (-> this duck) arg1) ) (('jump) - (set! (-> obj jump) arg1) + (set! (-> this jump) arg1) ) (('double-jump) - (set! (-> obj double-jump) arg1) + (set! (-> this double-jump) arg1) ) (('darkjak) - (set! (-> obj darkjak) arg1) + (set! (-> this darkjak) arg1) ) (('endlessfall) - (set! (-> obj endlessfall) arg1) + (set! (-> this endlessfall) arg1) ) (('pilot) - (set! (-> obj pilot) arg1) + (set! (-> this pilot) arg1) ) (('pilot-exit) - (set! (-> obj pilot-exit) arg1) + (set! (-> this pilot-exit) arg1) ) (('attack) - (set! (-> obj attack) arg1) + (set! (-> this attack) arg1) ) (('board) - (set! (-> obj board) arg1) + (set! (-> this board) arg1) ) (('gun) - (set! (-> obj gun) arg1) + (set! (-> this gun) arg1) ) (('doorway) - (set! (-> obj doorway) arg1) + (set! (-> this doorway) arg1) ) (('calm) - (set! (-> obj attack) (not arg1)) - (set! (-> obj gun) (not arg1)) - (set! (-> obj board) (not arg1)) - (set! (-> obj jump) (not arg1)) - (set! (-> obj double-jump) (not arg1)) - (set! (-> obj darkjak) (not arg1)) - (set! (-> obj pilot) (not arg1)) + (set! (-> this attack) (not arg1)) + (set! (-> this gun) (not arg1)) + (set! (-> this board) (not arg1)) + (set! (-> this jump) (not arg1)) + (set! (-> this double-jump) (not arg1)) + (set! (-> this darkjak) (not arg1)) + (set! (-> this pilot) (not arg1)) (case arg1 ((#t) - (set! (-> obj speed-mult) 0.5) + (set! (-> this speed-mult) 0.5) ) ) ) (('airlock) - (set! (-> obj airlock) arg1) + (set! (-> this airlock) arg1) ) (('gun-buoy) - (set! (-> obj gun-buoy) arg1) + (set! (-> this gun-buoy) arg1) ) (('ignore-target) - (set! (-> obj ignore-target) arg1) + (set! (-> this ignore-target) arg1) ) (('speech-control) - (set! (-> obj speech-control) arg1) + (set! (-> this speech-control) arg1) ) (('vehicle-hijacking) - (set! (-> obj vehicle-hijacking) arg1) + (set! (-> this vehicle-hijacking) arg1) ) (('features) (case arg1 (('set) - (logior! (-> obj features) arg3) + (logior! (-> this features) arg3) ) (('clear) - (logclear! (-> obj features) arg3) + (logclear! (-> this features) arg3) ) (('abs) - (set! (-> obj features) (the-as game-feature arg3)) + (set! (-> this features) (the-as game-feature arg3)) ) ) ) (('gem) - (set! (-> obj gem) arg1) + (set! (-> this gem) arg1) ) (('minimap) (case arg1 (('set) - (logior! (-> obj minimap) arg3) + (logior! (-> this minimap) arg3) ) (('clear) - (logclear! (-> obj minimap) arg3) + (logclear! (-> this minimap) arg3) ) (('abs) - (set! (-> obj minimap) arg3) + (set! (-> this minimap) arg3) ) ) ) (('race-minimap) - (set! (-> obj race-minimap) (the-as int arg3)) + (set! (-> this race-minimap) (the-as int arg3)) ) (('borrow) - (set! (-> obj borrow) (the-as pair arg1)) + (set! (-> this borrow) (the-as pair arg1)) ) (('half-speed) - (set! (-> obj half-speed) arg1) + (set! (-> this half-speed) arg1) ) (('render) - (set! (-> obj render) arg1) + (set! (-> this render) arg1) ) ) - obj + this ) ;; definition for method 9 of type cam-setting-data -(defmethod cam-setting-data-method-9 cam-setting-data ((obj cam-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) +(defmethod cam-setting-data-method-9 cam-setting-data ((this cam-setting-data) (arg0 engine) (arg1 engine-pers) (arg2 engine)) (let ((s3-0 (-> arg1 alive-list))) (while s3-0 (cam-setting-data-method-10 - obj + this (-> s3-0 param 0) (the-as (pointer process) (-> s3-0 param 1)) (the-as float (-> s3-0 param 2)) @@ -501,7 +501,7 @@ (= ((method-of-type connection get-process) (the-as connection s3-1)) (ppointer->process *progress-process*)) ) (cam-setting-data-method-10 - obj + this s1-0 (the-as (pointer process) (-> (the-as connection s3-1) param1)) (the-as float (-> (the-as connection s3-1) param2)) @@ -511,7 +511,7 @@ ) (else (cam-setting-data-method-10 - obj + this s1-0 (the-as (pointer process) (-> (the-as connection s3-1) param1)) (the-as float (-> (the-as connection s3-1) param2)) @@ -529,7 +529,7 @@ ) (while (!= v1-21 (-> arg2 alive-list-end)) (cam-setting-data-method-10 - obj + this (-> (the-as connection v1-21) param0) (the-as (pointer process) (-> (the-as connection v1-21) param1)) (the-as float (-> (the-as connection v1-21) param2)) @@ -539,170 +539,170 @@ (set! s4-1 (-> s4-1 next0)) ) ) - obj + this ) ;; definition for method 10 of type cam-setting-data ;; INFO: Used lq/sq -(defmethod cam-setting-data-method-10 cam-setting-data ((obj cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int)) +(defmethod cam-setting-data-method-10 cam-setting-data ((this cam-setting-data) (arg0 object) (arg1 (pointer process)) (arg2 float) (arg3 int)) (case arg0 (('fov) (if (= arg1 'rel) - (set! (-> obj fov) (* (-> obj fov) arg2)) - (set! (-> obj fov) arg2) + (set! (-> this fov) (* (-> this fov) arg2)) + (set! (-> this fov) arg2) ) ) (('pov-handle) (let ((a0-6 (new 'static 'handle :process arg1 :pid arg3))) (when (handle->process a0-6) - (set! (-> obj pov-handle) a0-6) - (set! (-> obj pov-bone) (the int arg2)) + (set! (-> this pov-handle) a0-6) + (set! (-> this pov-bone) (the int arg2)) ) ) ) (('pov-offset) - (set! (-> obj pov-offset quad) (-> (the-as vector arg2) quad)) + (set! (-> this pov-offset quad) (-> (the-as vector arg2) quad)) ) (('string-max-length) (case arg1 (('low) - (if (-> obj string-max-length-default) - (set! (-> obj string-max-length) arg2) + (if (-> this string-max-length-default) + (set! (-> this string-max-length) arg2) ) ) (('rel) - (set! (-> obj string-max-length) (* (-> obj string-max-length) arg2)) + (set! (-> this string-max-length) (* (-> this string-max-length) arg2)) ) (else - (set! (-> obj string-max-length) arg2) + (set! (-> this string-max-length) arg2) ) ) - (set! (-> obj string-default) #f) - (set! (-> obj string-max-length-default) #f) + (set! (-> this string-default) #f) + (set! (-> this string-max-length-default) #f) ) (('string-min-length) (case arg1 (('low) - (if (-> obj string-min-length-default) - (set! (-> obj string-min-length) arg2) + (if (-> this string-min-length-default) + (set! (-> this string-min-length) arg2) ) ) (('rel) - (set! (-> obj string-min-length) (* (-> obj string-min-length) arg2)) + (set! (-> this string-min-length) (* (-> this string-min-length) arg2)) ) (else - (set! (-> obj string-min-length) arg2) + (set! (-> this string-min-length) arg2) ) ) - (set! (-> obj string-default) #f) - (set! (-> obj string-min-length-default) #f) + (set! (-> this string-default) #f) + (set! (-> this string-min-length-default) #f) ) (('string-max-height) (case arg1 (('low) - (if (-> obj string-max-height-default) - (set! (-> obj string-max-height) arg2) + (if (-> this string-max-height-default) + (set! (-> this string-max-height) arg2) ) ) (('rel) - (set! (-> obj string-max-height) (* (-> obj string-max-height) arg2)) + (set! (-> this string-max-height) (* (-> this string-max-height) arg2)) ) (else - (set! (-> obj string-max-height) arg2) + (set! (-> this string-max-height) arg2) ) ) - (set! (-> obj string-default) #f) - (set! (-> obj string-max-height-default) #f) + (set! (-> this string-default) #f) + (set! (-> this string-max-height-default) #f) ) (('string-min-height) (case arg1 (('low) - (if (-> obj string-min-height-default) - (set! (-> obj string-min-height) arg2) + (if (-> this string-min-height-default) + (set! (-> this string-min-height) arg2) ) ) (('rel) - (set! (-> obj string-min-height) (* (-> obj string-min-height) arg2)) + (set! (-> this string-min-height) (* (-> this string-min-height) arg2)) ) (else - (set! (-> obj string-min-height) arg2) + (set! (-> this string-min-height) arg2) ) ) - (set! (-> obj string-default) #f) - (set! (-> obj string-min-height-default) #f) + (set! (-> this string-default) #f) + (set! (-> this string-min-height-default) #f) ) (('string-cliff-height) - (set! (-> obj string-cliff-height) arg2) - (set! (-> obj string-default) #f) + (set! (-> this string-cliff-height) arg2) + (set! (-> this string-default) #f) ) (('string-camera-ceiling) - (set! (-> obj string-camera-ceiling) arg2) - (set! (-> obj string-default) #f) + (set! (-> this string-camera-ceiling) arg2) + (set! (-> this string-default) #f) ) (('gun-max-height) - (set! (-> obj gun-max-height) arg2) + (set! (-> this gun-max-height) arg2) ) (('gun-min-height) - (set! (-> obj gun-min-height) arg2) + (set! (-> this gun-min-height) arg2) ) (('string-local-down) - (vector-normalize-copy! (-> obj string-local-down) (the-as vector arg2) 1.0) + (vector-normalize-copy! (-> this string-local-down) (the-as vector arg2) 1.0) ) (('slave-options) (case arg1 (('set) - (logior! (-> obj slave-options) arg3) + (logior! (-> this slave-options) arg3) ) (('clear) - (logclear! (-> obj slave-options) arg3) + (logclear! (-> this slave-options) arg3) ) (('abs) - (set! (-> obj slave-options) (the-as cam-slave-options arg3)) + (set! (-> this slave-options) (the-as cam-slave-options arg3)) ) ) ) (('rapid-tracking) - (logior! (-> obj slave-options) (cam-slave-options RAPID_TRACKING)) + (logior! (-> this slave-options) (cam-slave-options RAPID_TRACKING)) ) (('bike-mode) - (logior! (-> obj slave-options) (cam-slave-options BIKE_MODE)) + (logior! (-> this slave-options) (cam-slave-options BIKE_MODE)) ) (('vertical-follow-matches-camera) - (logior! (-> obj slave-options) (cam-slave-options VERTICAL_FOLLOW_MATCHES_CAMERA)) + (logior! (-> this slave-options) (cam-slave-options VERTICAL_FOLLOW_MATCHES_CAMERA)) ) (('matrix-blend-max-angle) - (set! (-> obj matrix-blend-max-angle) arg2) + (set! (-> this matrix-blend-max-angle) arg2) ) (('matrix-blend-max-partial) - (set! (-> obj matrix-blend-max-partial) arg2) + (set! (-> this matrix-blend-max-partial) arg2) ) (('string-spline-max-move-player) - (set! (-> obj string-spline-max-move-player) arg2) + (set! (-> this string-spline-max-move-player) arg2) ) (('string-spline-accel) - (set! (-> obj string-spline-accel) arg2) + (set! (-> this string-spline-accel) arg2) ) (('string-spline-max-move-player) - (set! (-> obj string-spline-max-move-player) arg2) + (set! (-> this string-spline-max-move-player) arg2) ) (('string-spline-accel-player) - (set! (-> obj string-spline-accel-player) arg2) + (set! (-> this string-spline-accel-player) arg2) ) (('target-height) - (set! (-> obj target-height) arg2) + (set! (-> this target-height) arg2) ) (('head-offset) - (set! (-> obj head-offset) arg2) + (set! (-> this head-offset) arg2) ) (('foot-offset) - (set! (-> obj foot-offset) arg2) + (set! (-> this foot-offset) arg2) ) (('teleport-on-entity-change) - (set! (-> obj teleport-on-entity-change) (the-as symbol arg2)) + (set! (-> this teleport-on-entity-change) (the-as symbol arg2)) ) (('entity-name) (when (or *target* (and *camera* (not (send-event *camera* 'query-state cam-free-floating)))) - (set! (-> obj entity-name) (the-as string arg1)) + (set! (-> this entity-name) (the-as string arg1)) (set! arg3 (cond ((= arg3 -1) 0 @@ -713,38 +713,38 @@ ) ) ) - (set! (-> obj entity-mask) (the-as uint arg3)) - (set! (-> obj mode-name) #f) + (set! (-> this entity-mask) (the-as uint arg3)) + (set! (-> this mode-name) #f) ) ) (('mode-name) - (set! (-> obj mode-name) (the-as symbol arg1)) - (set! (-> obj entity-name) #f) + (set! (-> this mode-name) (the-as symbol arg1)) + (set! (-> this entity-name) #f) ) (('master-options) (case arg1 (('set) - (logior! (-> obj master-options) arg3) + (logior! (-> this master-options) arg3) ) (('clear) - (logclear! (-> obj master-options) arg3) + (logclear! (-> this master-options) arg3) ) (('abs) - (set! (-> obj master-options) (the-as cam-master-options arg3)) + (set! (-> this master-options) (the-as cam-master-options arg3)) ) ) ) (('immediate-string-min-max) - (logior! (-> obj master-options) (cam-master-options IMMEDIATE_STRING_MIN_MAX)) + (logior! (-> this master-options) (cam-master-options IMMEDIATE_STRING_MIN_MAX)) ) (('no-intro) - (set! (-> obj no-intro) (the-as symbol arg2)) + (set! (-> this no-intro) (the-as symbol arg2)) ) (('mouse-input) - (set! (-> obj mouse-input) (the-as symbol arg2)) + (set! (-> this mouse-input) (the-as symbol arg2)) ) (('cpad1-skip-buttons) - (set! (-> obj cpad1-skip-buttons) (the-as symbol arg2)) + (set! (-> this cpad1-skip-buttons) (the-as symbol arg2)) ) (('interp-time) (let* ((v1-91 arg1) @@ -754,75 +754,75 @@ ) ) ) - (when (>= f0-34 (the float (-> obj interp-time-priority))) - (set! (-> obj interp-time) (the-as uint (the int arg2))) - (set! (-> obj interp-time-priority) (the-as uint (the int f0-34))) + (when (>= f0-34 (the float (-> this interp-time-priority))) + (set! (-> this interp-time) (the-as uint (the int arg2))) + (set! (-> this interp-time-priority) (the-as uint (the int f0-34))) ) ) ) (('string-startup-vector) - (set! (-> obj string-use-startup-vector) #t) - (set! (-> obj string-startup-vector quad) (-> (the-as vector arg2) quad)) + (set! (-> this string-use-startup-vector) #t) + (set! (-> this string-startup-vector quad) (-> (the-as vector arg2) quad)) ) (('look-at-point) - (set! (-> obj use-look-at-point) #t) - (set! (-> obj look-at-point quad) (-> (the-as vector arg2) quad)) + (set! (-> this use-look-at-point) #t) + (set! (-> this look-at-point quad) (-> (the-as vector arg2) quad)) ) (('point-of-interest) - (set! (-> obj use-point-of-interest) #t) - (set! (-> obj point-of-interest quad) (-> (the-as vector arg2) quad)) - (set! (-> obj handle-of-interest) (the-as handle #f)) + (set! (-> this use-point-of-interest) #t) + (set! (-> this point-of-interest quad) (-> (the-as vector arg2) quad)) + (set! (-> this handle-of-interest) (the-as handle #f)) ) (('mouse-tumble-point) - (set! (-> obj use-mouse-tumble-point) #t) - (set! (-> obj mouse-tumble-point quad) (-> (the-as vector arg2) quad)) + (set! (-> this use-mouse-tumble-point) #t) + (set! (-> this mouse-tumble-point quad) (-> (the-as vector arg2) quad)) ) (('handle-of-interest) (let ((a0-118 (new 'static 'handle :process arg1 :pid arg3))) (when (handle->process a0-118) - (set! (-> obj use-point-of-interest) #f) - (set! (-> obj handle-of-interest) a0-118) + (set! (-> this use-point-of-interest) #f) + (set! (-> this handle-of-interest) a0-118) ) ) ) (('butt-handle) (let ((a0-122 (new 'static 'handle :process arg1 :pid arg3))) (when (handle->process a0-122) - (set! (-> obj butt-handle) a0-122) - (set! (-> obj butt-angle) arg2) + (set! (-> this butt-handle) a0-122) + (set! (-> this butt-angle) arg2) ) ) ) (('extra-follow-height) - (set! (-> obj extra-follow-height) arg2) + (set! (-> this extra-follow-height) arg2) ) ) - obj + this ) ;; definition for method 9 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod add-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) +(defmethod add-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) "Originally called `setting-set` see (anon-function 48 script)" - (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) + (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) ;; definition for method 11 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod set-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) - (remove-setting obj arg0 arg1) - (add-connection (-> obj engine) arg0 arg1 arg2 arg3 arg4) +(defmethod set-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol) (arg2 object) (arg3 object) (arg4 object)) + (remove-setting this arg0 arg1) + (add-connection (-> this engine) arg0 arg1 arg2 arg3 arg4) 0 (none) ) ;; definition for method 10 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod persist-with-delay setting-control ((obj setting-control) (arg0 symbol) (arg1 time-frame) (arg2 symbol) (arg3 symbol) (arg4 float) (arg5 int)) +(defmethod persist-with-delay setting-control ((this setting-control) (arg0 symbol) (arg1 time-frame) (arg2 symbol) (arg3 symbol) (arg4 float) (arg5 int)) "Originally called `setting-pers` see (anon-function 46 script)" - (let ((v1-1 (schedule-callback (-> obj engine-pers) arg0 arg1))) + (let ((v1-1 (schedule-callback (-> this engine-pers) arg0 arg1))) (when v1-1 (set! (-> v1-1 param 0) arg2) (set! (-> v1-1 param 1) arg3) @@ -836,9 +836,9 @@ ;; definition for method 12 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod remove-setting setting-control ((obj setting-control) (arg0 process) (arg1 symbol)) +(defmethod remove-setting setting-control ((this setting-control) (arg0 process) (arg1 symbol)) (when arg0 - (let ((s5-0 (-> obj engine)) + (let ((s5-0 (-> this engine)) (s4-0 (-> arg0 connection-list next1)) ) (while s4-0 @@ -857,10 +857,10 @@ ;; definition for method 13 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod kill-persister setting-control ((obj setting-control) (arg0 engine-pers) (arg1 object)) +(defmethod kill-persister setting-control ((this setting-control) (arg0 engine-pers) (arg1 object)) "Calls [[engine-pers::kill-matching]]" (kill-matching - (-> obj engine-pers) + (-> this engine-pers) (lambda ((arg0 engine-pers) (arg1 connection-pers) (arg2 object) (arg3 object)) (and (= (-> arg1 key) arg2) (= (-> arg1 param 0) arg3)) ) @@ -872,16 +872,16 @@ ) ;; definition for method 14 of type setting-control -(defmethod setting-control-method-14 setting-control ((obj setting-control) (arg0 object)) - (let ((v1-1 (-> obj engine-hi alive-list next0))) - (-> obj engine-hi) +(defmethod setting-control-method-14 setting-control ((this setting-control) (arg0 object)) + (let ((v1-1 (-> this engine-hi alive-list next0))) + (-> this engine-hi) (let ((a2-2 (-> v1-1 next0))) - (while (!= v1-1 (-> obj engine-hi alive-list-end)) + (while (!= v1-1 (-> this engine-hi alive-list-end)) (if (= (-> (the-as connection v1-1) param0) arg0) (return v1-1) ) (set! v1-1 a2-2) - (-> obj engine-hi) + (-> this engine-hi) (set! a2-2 (-> a2-2 next0)) ) ) @@ -891,28 +891,28 @@ ;; definition for method 15 of type setting-control ;; WARN: Return type mismatch int vs none. -(defmethod remove-setting-by-arg0 setting-control ((obj setting-control) (arg0 object)) +(defmethod remove-setting-by-arg0 setting-control ((this setting-control) (arg0 object)) "Calls [[engine::remove-by-param0]] on `engine-hi`" - (remove-by-param0 (-> obj engine-hi) arg0) + (remove-by-param0 (-> this engine-hi) arg0) 0 (none) ) ;; definition for method 16 of type setting-control -(defmethod set-setting-by-param setting-control ((obj setting-control) (arg0 symbol) (arg1 object) (arg2 object) (arg3 object)) +(defmethod set-setting-by-param setting-control ((this setting-control) (arg0 symbol) (arg1 object) (arg2 object) (arg3 object)) "Same as [[setting-control::set-setting]] but will [[engine::remove-by-param0]] using the symbol provided" - (remove-by-param0 (-> obj engine-hi) arg0) - (add-connection (-> obj engine-hi) *dproc* arg0 arg1 arg2 arg3) + (remove-by-param0 (-> this engine-hi) arg0) + (add-connection (-> this engine-hi) *dproc* arg0 arg1 arg2 arg3) ) ;; definition for method 17 of type setting-control -(defmethod apply-settings setting-control ((obj setting-control)) +(defmethod apply-settings setting-control ((this setting-control)) (speech-control-method-11 *speech-control*) - (let ((s5-0 (-> obj user-current))) - (let ((s4-0 (-> obj user-target))) - (mem-copy! (the-as pointer s4-0) (the-as pointer (-> obj user-default)) 528) - (set! (-> s4-0 ambient-volume) (* (-> obj user-default sfx-volume) (-> obj user-default ambient-volume))) - (user-setting-data-method-9 s4-0 (-> obj engine) (-> obj engine-pers) (-> obj engine-hi)) + (let ((s5-0 (-> this user-current))) + (let ((s4-0 (-> this user-target))) + (mem-copy! (the-as pointer s4-0) (the-as pointer (-> this user-default)) 528) + (set! (-> s4-0 ambient-volume) (* (-> this user-default sfx-volume) (-> this user-default ambient-volume))) + (user-setting-data-method-9 s4-0 (-> this engine) (-> this engine-pers) (-> this engine-hi)) (when (= (-> s5-0 sound-mode) 1) (case (-> s5-0 music) (('sewer) @@ -1056,22 +1056,22 @@ ) ) ) - (-> obj cam-current) - (let ((s4-1 (-> obj cam-target))) - (mem-copy! (the-as pointer s4-1) (the-as pointer (-> obj cam-default)) 780) - (cam-setting-data-method-9 s4-1 (-> obj engine) (-> obj engine-pers) (-> obj engine-hi)) + (-> this cam-current) + (let ((s4-1 (-> this cam-target))) + (mem-copy! (the-as pointer s4-1) (the-as pointer (-> this cam-default)) 780) + (cam-setting-data-method-9 s4-1 (-> this engine) (-> this engine-pers) (-> this engine-hi)) ) - (-> obj user-current) + (-> this user-current) ) ;; definition for method 18 of type setting-control ;; INFO: Used lq/sq -(defmethod update setting-control ((obj setting-control)) +(defmethod update setting-control ((this setting-control)) (local-vars (v1-41 symbol)) - (run-pending-updates! (-> obj engine-pers) (-> *display* base-clock frame-counter)) - (apply-settings obj) - (let ((s5-0 (-> obj user-current))) - (let ((s4-0 (-> obj user-target))) + (run-pending-updates! (-> this engine-pers) (-> *display* base-clock frame-counter)) + (apply-settings this) + (let ((s5-0 (-> this user-current))) + (let ((s4-0 (-> this user-target))) (when *sound-player-enable* (when (!= (-> s5-0 sfx-volume) (-> s4-0 sfx-volume)) (seek! (-> s5-0 sfx-volume) (-> s4-0 sfx-volume) (seconds-per-frame)) @@ -1139,10 +1139,10 @@ ) (set! (-> s4-0 sound-excitement) (fmax 0.0 (fmin 0.99 (-> s4-0 sound-excitement)))) (set! (-> s4-0 sound-reverb) (fmax 0.0 (fmin 1.0 (-> s4-0 sound-reverb)))) - (when (and (nonzero? (-> obj user-default sound-stinger)) - (>= (- (-> *display* base-clock frame-counter) (-> obj sound-stinger-time)) (seconds 0.5)) + (when (and (nonzero? (-> this user-default sound-stinger)) + (>= (- (-> *display* base-clock frame-counter) (-> this sound-stinger-time)) (seconds 0.5)) ) - (set! (-> obj user-default sound-stinger) 0) + (set! (-> this user-default sound-stinger) 0) 0 ) (when *sound-player-enable* @@ -1166,39 +1166,39 @@ ((!= (-> s5-0 sound-stinger) (-> s4-0 sound-stinger)) (set! (-> s5-0 sound-stinger) (-> s4-0 sound-stinger)) (sound-set-midi-reg 0 (-> s5-0 sound-stinger)) - (set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter)) + (set! (-> this sound-stinger-time) (-> *display* base-clock frame-counter)) ) - ((!= (the int (* 4.0 (-> s4-0 sound-excitement))) (the int (* 4.0 (-> obj sound-excitement-targ)))) + ((!= (the int (* 4.0 (-> s4-0 sound-excitement))) (the int (* 4.0 (-> this sound-excitement-targ)))) (let ((v1-87 (max 0 (min 3 (the int (* 4.0 (-> s4-0 sound-excitement))))))) - (when (and (< (-> obj sound-excitement-targ) (-> s4-0 sound-excitement)) - (< (the-as int (-> obj sound-excitement-level)) v1-87) - (zero? (-> obj user-default sound-stinger)) + (when (and (< (-> this sound-excitement-targ) (-> s4-0 sound-excitement)) + (< (the-as int (-> this sound-excitement-level)) v1-87) + (zero? (-> this user-default sound-stinger)) ) - (set! (-> obj sound-stinger-time) (-> *display* base-clock frame-counter)) - (set! (-> obj sound-stinger-change-time v1-87) (-> *display* base-clock frame-counter)) - (set! (-> obj user-default sound-stinger) (+ v1-87 9)) + (set! (-> this sound-stinger-time) (-> *display* base-clock frame-counter)) + (set! (-> this sound-stinger-change-time v1-87) (-> *display* base-clock frame-counter)) + (set! (-> this user-default sound-stinger) (+ v1-87 9)) ) (cond - ((< (the-as int (-> obj sound-excitement-level)) v1-87) - (set! (-> obj sound-excitement-level) (the-as uint v1-87)) + ((< (the-as int (-> this sound-excitement-level)) v1-87) + (set! (-> this sound-excitement-level) (the-as uint v1-87)) ) - ((< v1-87 (the-as int (+ (-> obj sound-excitement-level) -1))) - (set! (-> obj sound-excitement-level) (the-as uint (+ v1-87 1))) + ((< v1-87 (the-as int (+ (-> this sound-excitement-level) -1))) + (set! (-> this sound-excitement-level) (the-as uint (+ v1-87 1))) ) ((zero? v1-87) - (set! (-> obj sound-excitement-level) (the-as uint v1-87)) + (set! (-> this sound-excitement-level) (the-as uint v1-87)) ) ) ) - (set! (-> obj sound-excitement-change-time) (-> *display* base-clock frame-counter)) - (set! (-> obj sound-excitement-targ) (-> s4-0 sound-excitement)) + (set! (-> this sound-excitement-change-time) (-> *display* base-clock frame-counter)) + (set! (-> this sound-excitement-targ) (-> s4-0 sound-excitement)) ) - ((and (!= (the int (* 4.0 (-> s5-0 sound-excitement))) (the int (* 4.0 (-> obj sound-excitement-targ)))) - (>= (- (-> *display* base-clock frame-counter) (-> obj sound-excitement-change-time)) (seconds 0.8)) + ((and (!= (the int (* 4.0 (-> s5-0 sound-excitement))) (the int (* 4.0 (-> this sound-excitement-targ)))) + (>= (- (-> *display* base-clock frame-counter) (-> this sound-excitement-change-time)) (seconds 0.8)) ) - (max 0 (min 3 (the int (* 4.0 (-> obj sound-excitement-targ))))) + (max 0 (min 3 (the int (* 4.0 (-> this sound-excitement-targ))))) (sound-set-midi-reg 2 (the int (* 100.0 (-> s5-0 sound-excitement)))) - (set! (-> s5-0 sound-excitement) (-> obj sound-excitement-targ)) + (set! (-> s5-0 sound-excitement) (-> this sound-excitement-targ)) (sound-set-midi-reg 16 (the int (* 100.0 (-> s5-0 sound-excitement)))) ) ) @@ -1269,8 +1269,8 @@ (set! (-> *mouse* active) (-> s5-0 mouse)) (set! (-> *mouse* cursor) (the-as basic (and (-> s5-0 mouse) (-> s5-0 cursor)))) ) - (let ((s5-1 (-> obj cam-current))) - (let ((s4-1 (-> obj cam-target))) + (let ((s5-1 (-> this cam-current))) + (let ((s4-1 (-> this cam-target))) (set! (-> s5-1 entity-or-mode-changed) #f) (if (and (not (name= (-> s5-1 entity-name) (-> s4-1 entity-name))) (or (not *target*) (not (logtest? (-> *target* focus-status) (-> s4-1 entity-mask)))) @@ -1373,7 +1373,7 @@ (set! (-> s5-1 point-of-interest quad) (-> (get-trans a0-147 4) quad)) ) ) - (set! (-> obj cam-default point-of-interest quad) (-> s5-1 point-of-interest quad)) + (set! (-> this cam-default point-of-interest quad) (-> s5-1 point-of-interest quad)) (set! (-> s5-1 butt-handle) (-> s4-1 butt-handle)) (set! (-> s5-1 butt-angle) (-> s4-1 butt-angle)) (set! (-> s5-1 extra-follow-height) (-> s4-1 extra-follow-height)) @@ -1382,7 +1382,7 @@ (cam-master-activate-slave #f) ) ) - (-> obj user-current) + (-> this user-current) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc index 848a6a8be1..9e0f1fb1d8 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-arrow_REF.gc @@ -21,18 +21,18 @@ ) ;; definition for method 3 of type task-arrow-params -(defmethod inspect task-arrow-params ((obj task-arrow-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect task-arrow-params ((this task-arrow-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'task-arrow-params) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tmap-icon: ~D~%" (-> obj map-icon)) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tquat: #~%" (-> obj quat)) + (format #t "[~8x] ~A~%" this 'task-arrow-params) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tmap-icon: ~D~%" (-> this map-icon)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tquat: #~%" (-> this quat)) (label cfg-4) - obj + this ) ;; definition of type task-arrow @@ -68,36 +68,36 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ) ;; definition for method 3 of type task-arrow -(defmethod inspect task-arrow ((obj task-arrow)) - (when (not obj) - (set! obj obj) +(defmethod inspect task-arrow ((this task-arrow)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpos: #~%" (-> obj pos)) - (format #t "~2Ttheta: ~f~%" (-> obj theta)) - (format #t "~2Tphi: ~f~%" (-> obj phi)) - (format #t "~2Tdist: ~f~%" (-> obj dist)) - (format #t "~2Tsmoothed-dist: ~f~%" (-> obj smoothed-dist)) - (format #t "~2Tmax-dist: ~f~%" (-> obj max-dist)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tmap-icon: ~D~%" (-> obj map-icon)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) - (format #t "~2Thud-dist: ~D~%" (-> obj hud-dist)) - (format #t "~2Tbase-quat: #~%" (-> obj base-quat)) - (format #t "~2Trod-of-god-scale: ~f~%" (-> obj rod-of-god-scale)) - (format #t "~2Tmoving: ~A~%" (-> obj moving)) + (format #t "~2Tpos: #~%" (-> this pos)) + (format #t "~2Ttheta: ~f~%" (-> this theta)) + (format #t "~2Tphi: ~f~%" (-> this phi)) + (format #t "~2Tdist: ~f~%" (-> this dist)) + (format #t "~2Tsmoothed-dist: ~f~%" (-> this smoothed-dist)) + (format #t "~2Tmax-dist: ~f~%" (-> this max-dist)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tmap-icon: ~D~%" (-> this map-icon)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Thud-dist: ~D~%" (-> this hud-dist)) + (format #t "~2Tbase-quat: #~%" (-> this base-quat)) + (format #t "~2Trod-of-god-scale: ~f~%" (-> this rod-of-god-scale)) + (format #t "~2Tmoving: ~A~%" (-> this moving)) (label cfg-4) - obj + this ) ;; definition for method 10 of type task-arrow ;; WARN: Return type mismatch int vs none. -(defmethod deactivate task-arrow ((obj task-arrow)) - (send-event (handle->process (-> obj hud-dist)) 'hide-and-die) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate task-arrow ((this task-arrow)) + (send-event (handle->process (-> this hud-dist)) 'hide-and-die) + ((method-of-type process-drawable deactivate) this) 0 (none) ) @@ -105,7 +105,7 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ;; definition for method 23 of type task-arrow ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod task-arrow-method-23 task-arrow ((obj task-arrow) (arg0 vector)) +(defmethod task-arrow-method-23 task-arrow ((this task-arrow) (arg0 vector)) "Some weird debugging code left here, but checks for collisions on the arrow" (let ((s5-0 (new 'stack-no-clear 'collide-query-with-vec))) (set! (-> s5-0 vec quad) (-> arg0 quad)) @@ -134,84 +134,84 @@ or collectable items on the ground (jetboard / weapon upgrades / etc)" ;; definition for method 24 of type task-arrow ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-arrow task-arrow ((obj task-arrow)) +(defmethod draw-arrow task-arrow ((this task-arrow)) (cond - ((logtest? (-> obj flags) (task-arrow-flags task-arrow-flag-00)) - (if (and (not (handle->process (-> obj hud-dist))) *target*) - (set! (-> obj hud-dist) (ppointer->handle (process-spawn hud-progress :init hud-init-by-other :to *target*))) + ((logtest? (-> this flags) (task-arrow-flags task-arrow-flag-00)) + (if (and (not (handle->process (-> this hud-dist))) *target*) + (set! (-> this hud-dist) (ppointer->handle (process-spawn hud-progress :init hud-init-by-other :to *target*))) ) - (let ((s5-1 (get-trail-for-connection *minimap* (-> obj minimap) #f))) + (let ((s5-1 (get-trail-for-connection *minimap* (-> this minimap) #f))) (if (and s5-1 (nonzero? (-> s5-1 last-updated))) - (set! (-> obj dist) (get-distance-with-path s5-1 (target-pos 0) (-> obj pos))) + (set! (-> this dist) (get-distance-with-path s5-1 (target-pos 0) (-> this pos))) ) ) - (if (= (-> obj max-dist) 0.0) - (set! (-> obj max-dist) (-> obj dist)) + (if (= (-> this max-dist) 0.0) + (set! (-> this max-dist) (-> this dist)) ) - (let ((f0-4 (- (-> obj dist) (-> obj smoothed-dist)))) + (let ((f0-4 (- (-> this dist) (-> this smoothed-dist)))) (if (< (fabs f0-4) 40960.0) - (+! (-> obj smoothed-dist) (* 10.0 (seconds-per-frame) f0-4)) - (set! (-> obj smoothed-dist) (-> obj dist)) + (+! (-> this smoothed-dist) (* 10.0 (seconds-per-frame) f0-4)) + (set! (-> this smoothed-dist) (-> this dist)) ) ) - (let ((f1-5 (/ (-> obj smoothed-dist) (-> obj max-dist)))) + (let ((f1-5 (/ (-> this smoothed-dist) (-> this max-dist)))) (set! (-> *game-info* distance) (- 1.0 (fmax 0.0 (fmin 1.0 f1-5)))) ) ) (else - (let ((a0-16 (handle->process (-> obj hud-dist)))) + (let ((a0-16 (handle->process (-> this hud-dist)))) (when a0-16 (send-event a0-16 'hide-and-die) - (set! (-> obj hud-dist) (the-as handle #f)) + (set! (-> this hud-dist) (the-as handle #f)) ) ) ) ) (cond - ((-> obj moving) - (set! (-> obj rod-of-god-scale) (- (-> obj rod-of-god-scale) (* 8.0 (seconds-per-frame)))) - (when (< (-> obj rod-of-god-scale) 0.0) - (set! (-> obj rod-of-god-scale) 0.0) - (set! (-> obj moving) #f) + ((-> this moving) + (set! (-> this rod-of-god-scale) (- (-> this rod-of-god-scale) (* 8.0 (seconds-per-frame)))) + (when (< (-> this rod-of-god-scale) 0.0) + (set! (-> this rod-of-god-scale) 0.0) + (set! (-> this moving) #f) (let ((f0-15 81920.0)) (cond - ((< (* f0-15 f0-15) (vector-vector-xz-distance-squared (-> obj pos) (-> obj root trans))) - (kill-callback (-> *minimap* engine) (-> obj minimap)) - (set! (-> obj root trans quad) (-> obj pos quad)) - (set! (-> obj minimap) (add-icon! *minimap* obj (-> obj map-icon) (the-as int #f) (the-as vector #t) 0)) + ((< (* f0-15 f0-15) (vector-vector-xz-distance-squared (-> this pos) (-> this root trans))) + (kill-callback (-> *minimap* engine) (-> this minimap)) + (set! (-> this root trans quad) (-> this pos quad)) + (set! (-> this minimap) (add-icon! *minimap* this (-> this map-icon) (the-as int #f) (the-as vector #t) 0)) ) (else - (set! (-> obj root trans quad) (-> obj pos quad)) + (set! (-> this root trans quad) (-> this pos quad)) ) ) ) ) ) (else - (set! (-> obj pos quad) (-> obj root trans quad)) - (+! (-> obj rod-of-god-scale) (* 8.0 (seconds-per-frame))) - (if (< 1.0 (-> obj rod-of-god-scale)) - (set! (-> obj rod-of-god-scale) 1.0) + (set! (-> this pos quad) (-> this root trans quad)) + (+! (-> this rod-of-god-scale) (* 8.0 (seconds-per-frame))) + (if (< 1.0 (-> this rod-of-god-scale)) + (set! (-> this rod-of-god-scale) 1.0) ) ) ) (cond - ((not (logtest? (-> obj flags) (task-arrow-flags task-arrow-flag-02))) - (set! (-> *part-id-table* 267 init-specs 4 initial-valuef) (* 24576.0 (-> obj rod-of-god-scale))) - (set! (-> *part-id-table* 270 init-specs 3 initial-valuef) (* 65536.0 (-> obj rod-of-god-scale))) - (set! (-> *part-id-table* 268 init-specs 9 initial-valuef) (* 20.0 (-> obj rod-of-god-scale))) - (spawn (-> obj part) (-> obj root trans)) + ((not (logtest? (-> this flags) (task-arrow-flags task-arrow-flag-02))) + (set! (-> *part-id-table* 267 init-specs 4 initial-valuef) (* 24576.0 (-> this rod-of-god-scale))) + (set! (-> *part-id-table* 270 init-specs 3 initial-valuef) (* 65536.0 (-> this rod-of-god-scale))) + (set! (-> *part-id-table* 268 init-specs 9 initial-valuef) (* 20.0 (-> this rod-of-god-scale))) + (spawn (-> this part) (-> this root trans)) ) (else - (+! (-> obj theta) (* 32768.0 (seconds-per-frame))) - (+! (-> obj phi) (* 9102.223 (seconds-per-frame))) - (set! (-> obj root trans quad) (-> obj pos quad)) - (set! (-> obj root trans y) (+ 28672.0 (* 4096.0 (cos (-> obj theta))) (-> obj pos y))) + (+! (-> this theta) (* 32768.0 (seconds-per-frame))) + (+! (-> this phi) (* 9102.223 (seconds-per-frame))) + (set! (-> this root trans quad) (-> this pos quad)) + (set! (-> this root trans y) (+ 28672.0 (* 4096.0 (cos (-> this theta))) (-> this pos y))) ) ) - (when (logtest? (-> obj flags) (task-arrow-flags task-arrow-flag-01)) - (quaternion-axis-angle! (-> obj root quat) 0.0 1.0 0.0 (-> obj phi)) - (quaternion-normalize! (quaternion*! (-> obj root quat) (-> obj base-quat) (-> obj root quat))) + (when (logtest? (-> this flags) (task-arrow-flags task-arrow-flag-01)) + (quaternion-axis-angle! (-> this root quat) 0.0 1.0 0.0 (-> this phi)) + (quaternion-normalize! (quaternion*! (-> this root quat) (-> this base-quat) (-> this root quat))) ) (ja-post) 0 diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc index 3a51b36dd4..3978b9fd93 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control-h_REF.gc @@ -949,20 +949,20 @@ ) ;; definition for method 3 of type game-task-event -(defmethod inspect game-task-event ((obj game-task-event)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-task-event ((this game-task-event)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tactor: #x~X : ~S~%" (-> obj actor) (game-task-actor->string (-> obj actor))) - (format #t "~1Taction: #x~X : ~S~%" (-> obj action) (game-task-action->string (-> obj action))) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Ticon: ~D~%" (-> obj icon)) - (format #t "~1Tscene: ~A~%" (-> obj scene)) - (format #t "~1Tdistance: (meters ~m)~%" (-> obj distance)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tactor: #x~X : ~S~%" (-> this actor) (game-task-actor->string (-> this actor))) + (format #t "~1Taction: #x~X : ~S~%" (-> this action) (game-task-action->string (-> this action))) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Ticon: ~D~%" (-> this icon)) + (format #t "~1Tscene: ~A~%" (-> this scene)) + (format #t "~1Tdistance: (meters ~m)~%" (-> this distance)) (label cfg-4) - obj + this ) ;; definition of type task-manager-info @@ -1002,14 +1002,14 @@ ) ;; definition for method 3 of type task-manager-info -(defmethod inspect task-manager-info ((obj task-manager-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect task-manager-info ((this task-manager-info)) + (when (not this) + (set! this this) (goto cfg-16) ) - (format #t "[~8x] ~A~%" obj 'task-manager-info) - (format #t "~1Tmask: #x~X : (task-manager-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this 'task-manager-info) + (format #t "~1Tmask: #x~X : (task-manager-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (task-manager-mask intro-scene)) (task-manager-mask intro-scene)) (format #t "intro-scene ") ) @@ -1030,34 +1030,34 @@ ) ) (format #t ")~%") - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tmanager: ~`handle`P~%" (-> obj manager)) - (format #t "~1Tfail-message: ~D~%" (-> obj fail-message)) - (format #t "~1Tretry-message: ~D~%" (-> obj retry-message)) - (format #t "~1Tintro-scene: ~A~%" (-> obj intro-scene)) - (format #t "~1Tresolution-scene: ~A~%" (-> obj resolution-scene)) - (format #t "~1Tresolution-scene-continue: ~A~%" (-> obj resolution-scene-continue)) - (format #t "~1Tretry-continue: ~A~%" (-> obj retry-continue)) - (format #t "~1Tfail-continue: ~A~%" (-> obj fail-continue)) - (format #t "~1Tinit-hook: ~A~%" (-> obj init-hook)) - (format #t "~1Tcleanup-hook: ~A~%" (-> obj cleanup-hook)) - (format #t "~1Tupdate-hook: ~A~%" (-> obj update-hook)) - (format #t "~1Tcode-hook: ~A~%" (-> obj code-hook)) - (format #t "~1Tcomplete-hook: ~A~%" (-> obj complete-hook)) - (format #t "~1Tfail-hook: ~A~%" (-> obj fail-hook)) - (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~1Tfinal-node: ~D~%" (-> obj final-node)) - (format #t "~1Ttime-limit: ~D~%" (-> obj time-limit)) - (format #t "~1Tsphere-count: ~D~%" (-> obj sphere-count)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tintro-delay: ~D~%" (-> obj intro-delay)) - (format #t "~1Tsphere-array: #x~X~%" (-> obj sphere-array)) - (format #t "~1Ton-complete: ~A~%" (-> obj on-complete)) - (format #t "~1Ton-fail: ~A~%" (-> obj on-fail)) - (format #t "~1Tbegin-sphere: #~%" (-> obj begin-sphere)) - (format #t "~1Tend-sphere: #~%" (-> obj end-sphere)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tmanager: ~`handle`P~%" (-> this manager)) + (format #t "~1Tfail-message: ~D~%" (-> this fail-message)) + (format #t "~1Tretry-message: ~D~%" (-> this retry-message)) + (format #t "~1Tintro-scene: ~A~%" (-> this intro-scene)) + (format #t "~1Tresolution-scene: ~A~%" (-> this resolution-scene)) + (format #t "~1Tresolution-scene-continue: ~A~%" (-> this resolution-scene-continue)) + (format #t "~1Tretry-continue: ~A~%" (-> this retry-continue)) + (format #t "~1Tfail-continue: ~A~%" (-> this fail-continue)) + (format #t "~1Tinit-hook: ~A~%" (-> this init-hook)) + (format #t "~1Tcleanup-hook: ~A~%" (-> this cleanup-hook)) + (format #t "~1Tupdate-hook: ~A~%" (-> this update-hook)) + (format #t "~1Tcode-hook: ~A~%" (-> this code-hook)) + (format #t "~1Tcomplete-hook: ~A~%" (-> this complete-hook)) + (format #t "~1Tfail-hook: ~A~%" (-> this fail-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tfinal-node: ~D~%" (-> this final-node)) + (format #t "~1Ttime-limit: ~D~%" (-> this time-limit)) + (format #t "~1Tsphere-count: ~D~%" (-> this sphere-count)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tintro-delay: ~D~%" (-> this intro-delay)) + (format #t "~1Tsphere-array: #x~X~%" (-> this sphere-array)) + (format #t "~1Ton-complete: ~A~%" (-> this on-complete)) + (format #t "~1Ton-fail: ~A~%" (-> this on-fail)) + (format #t "~1Tbegin-sphere: #~%" (-> this begin-sphere)) + (format #t "~1Tend-sphere: #~%" (-> this end-sphere)) (label cfg-16) - obj + this ) ;; definition (debug) for function game-task-node-flag->string @@ -1237,25 +1237,25 @@ ) ;; definition for method 3 of type game-task-node-info -(defmethod inspect game-task-node-info ((obj game-task-node-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-task-node-info ((this game-task-node-info)) + (when (not this) + (set! this this) (goto cfg-45) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Ttask: #x~X : ~S~%" (-> obj task) (game-task->string (-> obj task))) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Twhen-open: ~A~%" (-> obj when-open)) - (format #t "~1Tflags: #x~X : (game-task-node-flag " (-> obj flags)) - (game-task-node-flag->string (-> obj flags)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Ttask: #x~X : ~S~%" (-> this task) (game-task->string (-> this task))) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Twhen-open: ~A~%" (-> this when-open)) + (format #t "~1Tflags: #x~X : (game-task-node-flag " (-> this flags)) + (game-task-node-flag->string (-> this flags)) (format #t ")~%") - (format #t "~1Tparent-node[4] @ #x~X~%" (-> obj parent-node)) + (format #t "~1Tparent-node[4] @ #x~X~%" (-> this parent-node)) (dotimes (s5-1 4) - (format #t "~T [~D]~1Tparent-node: ~D~%" s5-1 (-> obj parent-node s5-1)) + (format #t "~T [~D]~1Tparent-node: ~D~%" s5-1 (-> this parent-node s5-1)) ) - (format #t "~1Ttask-mask: #x~X : (task-mask " (-> obj task-mask)) - (let ((s5-2 (-> obj task-mask))) + (format #t "~1Ttask-mask: #x~X : (task-mask " (-> this task-mask)) + (let ((s5-2 (-> this task-mask))) (if (= (logand s5-2 (task-mask task0)) (task-mask task0)) (format #t "task0 ") ) @@ -1315,20 +1315,20 @@ ) ) (format #t ")~%") - (format #t "~1Ton-open: ~A~%" (-> obj on-open)) - (format #t "~1Tinfo: #~%" (-> obj info)) - (format #t "~1Tborrow: ~A~%" (-> obj borrow)) - (format #t "~1Topen?: ~A~%" (-> obj open?)) - (format #t "~1Ton-close: ~A~%" (-> obj on-close)) - (format #t "~1Tclose-time: ~D~%" (-> obj close-time)) - (format #t "~1Tdeath-count: ~D~%" (-> obj death-count)) - (format #t "~1Tgem-count: ~D~%" (-> obj gem-count)) - (format #t "~1Tskill-count: ~D~%" (-> obj skill-count)) - (format #t "~1Tsuck-death-count: ~D~%" (-> obj suck-death-count)) - (format #t "~1Tadd: #x~X : ~S~%" (-> obj add) (game-task-node-command->string (-> obj add))) - (format #t "~1Tdescription: ~D~%" (-> obj description)) + (format #t "~1Ton-open: ~A~%" (-> this on-open)) + (format #t "~1Tinfo: #~%" (-> this info)) + (format #t "~1Tborrow: ~A~%" (-> this borrow)) + (format #t "~1Topen?: ~A~%" (-> this open?)) + (format #t "~1Ton-close: ~A~%" (-> this on-close)) + (format #t "~1Tclose-time: ~D~%" (-> this close-time)) + (format #t "~1Tdeath-count: ~D~%" (-> this death-count)) + (format #t "~1Tgem-count: ~D~%" (-> this gem-count)) + (format #t "~1Tskill-count: ~D~%" (-> this skill-count)) + (format #t "~1Tsuck-death-count: ~D~%" (-> this suck-death-count)) + (format #t "~1Tadd: #x~X : ~S~%" (-> this add) (game-task-node-command->string (-> this add))) + (format #t "~1Tdescription: ~D~%" (-> this description)) (label cfg-45) - obj + this ) ;; definition of type game-task-info @@ -1348,22 +1348,22 @@ ) ;; definition for method 3 of type game-task-info -(defmethod inspect game-task-info ((obj game-task-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-task-info ((this game-task-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Ttext-name: ~D~%" (-> obj text-name)) - (format #t "~1Tpre-play-node: ~D~%" (-> obj pre-play-node)) - (format #t "~1Tkiosk-play-node: ~D~%" (-> obj kiosk-play-node)) - (format #t "~1Tpre-play-continue: ~A~%" (-> obj pre-play-continue)) - (format #t "~1Tplay-node: ~D~%" (-> obj play-node)) - (format #t "~1Tplay-continue: ~A~%" (-> obj play-continue)) - (format #t "~1Tkiosk-play-continue: ~A~%" (-> obj kiosk-play-continue)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Ttext-name: ~D~%" (-> this text-name)) + (format #t "~1Tpre-play-node: ~D~%" (-> this pre-play-node)) + (format #t "~1Tkiosk-play-node: ~D~%" (-> this kiosk-play-node)) + (format #t "~1Tpre-play-continue: ~A~%" (-> this pre-play-continue)) + (format #t "~1Tplay-node: ~D~%" (-> this play-node)) + (format #t "~1Tplay-continue: ~A~%" (-> this play-continue)) + (format #t "~1Tkiosk-play-continue: ~A~%" (-> this kiosk-play-continue)) (label cfg-4) - obj + this ) ;; definition of type game-task-control @@ -1383,18 +1383,18 @@ ) ;; definition for method 3 of type game-task-control -(defmethod inspect game-task-control ((obj game-task-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-task-control ((this game-task-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcounter: ~D~%" (-> obj counter)) - (format #t "~1Tactor: #x~X : ~S~%" (-> obj actor) (game-task-actor->string (-> obj actor))) - (format #t "~1Tcurrent-node: ~D~%" (-> obj current-node)) - (format #t "~1Tcurrent-event: ~A~%" (-> obj current-event)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcounter: ~D~%" (-> this counter)) + (format #t "~1Tactor: #x~X : ~S~%" (-> this actor) (game-task-actor->string (-> this actor))) + (format #t "~1Tcurrent-node: ~D~%" (-> this current-node)) + (format #t "~1Tcurrent-event: ~A~%" (-> this current-event)) (label cfg-4) - obj + this ) ;; definition of type task-manager @@ -1449,47 +1449,47 @@ ) ;; definition for method 3 of type task-manager -(defmethod inspect task-manager ((obj task-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect task-manager ((this task-manager)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnode-info: ~A~%" (-> obj node-info)) - (format #t "~2Tinfo: #~%" (-> obj info)) - (format #t "~2Tlev-name: ~A~%" (-> obj lev-name)) - (format #t "~2Tfail-on-death?: ~A~%" (-> obj fail-on-death?)) - (format #t "~2Tfail-now: ~A~%" (-> obj fail-now)) - (format #t "~2Tretry-now: ~A~%" (-> obj retry-now)) - (format #t "~2Tallow-fail: ~A~%" (-> obj allow-fail)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tcount: ~D~%" (-> obj count)) - (format #t "~2Tmax-count: ~D~%" (-> obj max-count)) - (format #t "~2Tsub-state: ~D~%" (-> obj sub-state)) - (format #t "~2Tslave[32] @ #x~X~%" (-> obj slave)) - (format #t "~2Tarrow: ~D~%" (-> obj arrow)) - (format #t "~2Tlink: ~A~%" (-> obj link)) - (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~2Ttotal-time: ~D~%" (-> obj total-time)) - (format #t "~2Tbeep-time: ~D~%" (-> obj beep-time)) - (format #t "~2Ttime-limit: ~D~%" (-> obj time-limit)) - (format #t "~2Tbegin-pos: #~%" (-> obj begin-pos)) - (format #t "~2Tend-pos: #~%" (-> obj end-pos)) - (format #t "~2Tdata-int8[32] @ #x~X~%" (-> obj data-int8)) - (format #t "~2Tdata-int32[32] @ #x~X~%" (-> obj data-int32)) - (format #t "~2Tdata-float[32] @ #x~X~%" (-> obj data-float)) - (format #t "~2Tdata-vector[32] @ #x~X~%" (-> obj data-vector)) - (format #t "~2Tactor-group[4] @ #x~X~%" (-> obj actor-group)) - (format #t "~2Tminimap[8] @ #x~X~%" (-> obj minimap)) - (format #t "~2Thud[4] @ #x~X~%" (-> obj hud)) - (format #t "~2Thud-timer: ~D~%" (-> obj hud-timer)) - (format #t "~2Thud-counter: ~D~%" (-> obj hud-counter)) - (format #t "~2Tsound-id[4] @ #x~X~%" (-> obj sound-id)) - (format #t "~2Tintro-time: ~D~%" (-> obj intro-time)) + (format #t "~2Tnode-info: ~A~%" (-> this node-info)) + (format #t "~2Tinfo: #~%" (-> this info)) + (format #t "~2Tlev-name: ~A~%" (-> this lev-name)) + (format #t "~2Tfail-on-death?: ~A~%" (-> this fail-on-death?)) + (format #t "~2Tfail-now: ~A~%" (-> this fail-now)) + (format #t "~2Tretry-now: ~A~%" (-> this retry-now)) + (format #t "~2Tallow-fail: ~A~%" (-> this allow-fail)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tcount: ~D~%" (-> this count)) + (format #t "~2Tmax-count: ~D~%" (-> this max-count)) + (format #t "~2Tsub-state: ~D~%" (-> this sub-state)) + (format #t "~2Tslave[32] @ #x~X~%" (-> this slave)) + (format #t "~2Tarrow: ~D~%" (-> this arrow)) + (format #t "~2Tlink: ~A~%" (-> this link)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Ttotal-time: ~D~%" (-> this total-time)) + (format #t "~2Tbeep-time: ~D~%" (-> this beep-time)) + (format #t "~2Ttime-limit: ~D~%" (-> this time-limit)) + (format #t "~2Tbegin-pos: #~%" (-> this begin-pos)) + (format #t "~2Tend-pos: #~%" (-> this end-pos)) + (format #t "~2Tdata-int8[32] @ #x~X~%" (-> this data-int8)) + (format #t "~2Tdata-int32[32] @ #x~X~%" (-> this data-int32)) + (format #t "~2Tdata-float[32] @ #x~X~%" (-> this data-float)) + (format #t "~2Tdata-vector[32] @ #x~X~%" (-> this data-vector)) + (format #t "~2Tactor-group[4] @ #x~X~%" (-> this actor-group)) + (format #t "~2Tminimap[8] @ #x~X~%" (-> this minimap)) + (format #t "~2Thud[4] @ #x~X~%" (-> this hud)) + (format #t "~2Thud-timer: ~D~%" (-> this hud-timer)) + (format #t "~2Thud-counter: ~D~%" (-> this hud-counter)) + (format #t "~2Tsound-id[4] @ #x~X~%" (-> this sound-id)) + (format #t "~2Tintro-time: ~D~%" (-> this intro-time)) (label cfg-4) - obj + this ) ;; definition of type ambient-control @@ -1509,17 +1509,17 @@ ) ;; definition for method 3 of type ambient-control -(defmethod inspect ambient-control ((obj ambient-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect ambient-control ((this ambient-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ambient-control) - (format #t "~1Tlast-ambient-time: ~D~%" (-> obj last-ambient-time)) - (format #t "~1Tlast-ambient: ~A~%" (-> obj last-ambient)) - (format #t "~1Tlast-ambient-id: ~D~%" (-> obj last-ambient-id)) + (format #t "[~8x] ~A~%" this 'ambient-control) + (format #t "~1Tlast-ambient-time: ~D~%" (-> this last-ambient-time)) + (format #t "~1Tlast-ambient: ~A~%" (-> this last-ambient)) + (format #t "~1Tlast-ambient-id: ~D~%" (-> this last-ambient-id)) (label cfg-4) - obj + this ) ;; definition for symbol *traffic-engine*, type traffic-engine 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 e9df9fd91e..1453856a8f 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 @@ -17,21 +17,21 @@ ) ;; definition for method 3 of type fail-mission-params -(defmethod inspect fail-mission-params ((obj fail-mission-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect fail-mission-params ((this fail-mission-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fail-mission-params) - (format #t "~1Tmessage: ~D~%" (-> obj message)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tretry-continue: ~A~%" (-> obj retry-continue)) - (format #t "~1Tfail-continue: ~A~%" (-> obj fail-continue)) - (format #t "~1Treset-delay: ~D~%" (-> obj reset-delay)) - (format #t "~1Ttask: ~D~%" (-> obj task)) - (format #t "~1Tfail-message: ~D~%" (-> obj fail-message)) + (format #t "[~8x] ~A~%" this 'fail-mission-params) + (format #t "~1Tmessage: ~D~%" (-> this message)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tretry-continue: ~A~%" (-> this retry-continue)) + (format #t "~1Tfail-continue: ~A~%" (-> this fail-continue)) + (format #t "~1Treset-delay: ~D~%" (-> this reset-delay)) + (format #t "~1Ttask: ~D~%" (-> this task)) + (format #t "~1Tfail-message: ~D~%" (-> this fail-message)) (label cfg-4) - obj + this ) ;; definition of type fail-mission-control @@ -51,16 +51,16 @@ ) ;; definition for method 3 of type fail-mission-control -(defmethod inspect fail-mission-control ((obj fail-mission-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect fail-mission-control ((this fail-mission-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: ~D~%" (-> obj process)) - (format #t "~1Thandle-init-hack: ~A~%" (-> obj handle-init-hack)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~D~%" (-> this process)) + (format #t "~1Thandle-init-hack: ~A~%" (-> this handle-init-hack)) (label cfg-4) - obj + this ) ;; definition for symbol *fail-mission-control*, type fail-mission-control @@ -193,14 +193,14 @@ ) ;; definition for method 22 of type level -(defmethod level-method-22 level ((obj level) (arg0 symbol)) +(defmethod level-method-22 level ((this level) (arg0 symbol)) (if (= arg0 'none) (return 0) ) - (set! (-> obj task-mask) - (logand (-> obj info base-task-mask) (task-mask task0 task1 task2 task3 task4 task5 task6 task7 done)) + (set! (-> this task-mask) + (logand (-> this info base-task-mask) (task-mask task0 task1 task2 task3 task4 task5 task6 task7 done)) ) - (let ((name (-> obj info taskname)) + (let ((name (-> this info taskname)) (game-subtasks (-> *game-info* sub-task-list)) ) (dotimes (i (-> game-subtasks length)) @@ -209,13 +209,13 @@ (when (and (logtest? (-> subtask flags) (game-task-node-flag closed)) (= (-> subtask level) name)) (cond ((logtest? (-> subtask flags) (game-task-node-flag abs-task-mask)) - (set! (-> obj task-mask) (-> subtask task-mask)) + (set! (-> this task-mask) (-> subtask task-mask)) ) ((logtest? (-> subtask flags) (game-task-node-flag set-task-mask)) - (logior! (-> obj task-mask) (-> subtask task-mask)) + (logior! (-> this task-mask) (-> subtask task-mask)) ) ((logtest? (-> subtask flags) (game-task-node-flag clear-task-mask)) - (logclear! (-> obj task-mask) (-> subtask task-mask)) + (logclear! (-> this task-mask) (-> subtask task-mask)) ) ) ) @@ -223,7 +223,7 @@ ) ) ) - (case (-> obj name) + (case (-> this name) (('strip) (prototypes-game-visible-set! '("strip-ev-base-ring.mb" @@ -465,7 +465,7 @@ ) ) ) - (logior! (-> obj task-mask) (-> *setting-control* user-current task-mask)) + (logior! (-> this task-mask) (-> *setting-control* user-current task-mask)) 0 ) @@ -692,30 +692,30 @@ ) ;; definition for method 2 of type game-task-node-info -(defmethod print game-task-node-info ((obj game-task-node-info)) +(defmethod print game-task-node-info ((this game-task-node-info)) (format #t "#" - (-> obj name) + (-> this name) (cond - ((logtest? (-> obj flags) (game-task-node-flag closed)) + ((logtest? (-> this flags) (game-task-node-flag closed)) "closed" ) - ((open? obj) + ((open? this) "open" ) (else "inactive" ) ) - obj + this ) - obj + this ) ;; definition for method 9 of type game-task-node-info -(defmethod close! game-task-node-info ((obj game-task-node-info) (arg0 symbol)) - (when (not (logtest? (-> obj flags) (game-task-node-flag closed))) +(defmethod close! game-task-node-info ((this game-task-node-info) (arg0 symbol)) + (when (not (logtest? (-> this flags) (game-task-node-flag closed))) (let ((task-node-close-func (lambda ((arg0 game-task-node-info)) (logior! (-> arg0 flags) (game-task-node-flag closed)) @@ -744,7 +744,7 @@ (let ((p-node-count 0) (s3-0 (new 'stack-no-clear 'inline-array 'qword 8)) ) - (let ((s1-0 obj)) + (let ((s1-0 this)) (loop (cond ((= (-> s1-0 parent-node 0) (game-task-node none)) @@ -787,7 +787,7 @@ (task-node-close-func (-> *game-info* sub-task-list (-> (&-> s3-0 0 hword p-node-count) 0))) ) ) - (task-node-close-func obj) + (task-node-close-func this) ) (let ((game-nodes (-> *game-info* sub-task-list))) (dotimes (i (-> game-nodes length)) @@ -819,13 +819,13 @@ ) ;; definition for method 10 of type game-task-node-info -(defmethod open! game-task-node-info ((obj game-task-node-info) (arg0 symbol)) +(defmethod open! game-task-node-info ((this game-task-node-info) (arg0 symbol)) (local-vars (v1-19 symbol)) - (when (logtest? (-> obj flags) (game-task-node-flag closed)) - (logclear! (-> obj flags) (game-task-node-flag closed)) + (when (logtest? (-> this flags) (game-task-node-flag closed)) + (logclear! (-> this flags) (game-task-node-flag closed)) (+! (-> *game-info* task-counter) 1) - (if (logtest? (-> obj flags) (game-task-node-flag close-task)) - (logclear! (-> *game-info* task-perm-list data (-> obj task) status) (entity-perm-status complete)) + (if (logtest? (-> this flags) (game-task-node-flag close-task)) + (logclear! (-> *game-info* task-perm-list data (-> this task) status) (entity-perm-status complete)) ) (let ((game-nodes (-> *game-info* sub-task-list))) (dotimes (i (-> game-nodes length)) @@ -867,10 +867,10 @@ ) ;; definition for method 11 of type game-task-node-info -(defmethod open? game-task-node-info ((obj game-task-node-info)) +(defmethod open? game-task-node-info ((this game-task-node-info)) (local-vars (a1-1 symbol)) (let ((game-nodes (-> *game-info* sub-task-list)) - (node-info obj) + (node-info this) ) (and (not (logtest? (-> node-info flags) (game-task-node-flag closed))) (begin @@ -886,7 +886,7 @@ (label cfg-12) (and a1-1 (or (zero? (-> *setting-control* user-current exclusive-task)) - (= (-> *setting-control* user-current exclusive-task) (-> obj task)) + (= (-> *setting-control* user-current exclusive-task) (-> this task)) (logtest? (-> node-info flags) (game-task-node-flag auto-close)) ) (or (not (-> node-info open?)) ((-> node-info open?) node-info)) @@ -910,8 +910,8 @@ ) ;; definition for method 13 of type game-task-node-info -(defmethod eval-add game-task-node-info ((obj game-task-node-info)) - (case (-> obj add) +(defmethod eval-add game-task-node-info ((this game-task-node-info)) + (case (-> this add) (((game-task-node-command none)) ) (((game-task-node-command add-sidekick)) @@ -1063,11 +1063,11 @@ ) ;; definition for method 2 of type game-task-event -(defmethod print game-task-event ((obj game-task-event)) +(defmethod print game-task-event ((this game-task-event)) (let* ((t9-0 format) (a0-1 #t) (a1-0 "#") - (v1-0 (-> obj actor)) + (v1-0 (-> this actor)) (a2-1 (cond ((= v1-0 (game-task-actor burning-bush-genc)) "burning-bush-genc" @@ -1278,7 +1278,7 @@ ) ) ) - (v1-1 (-> obj action)) + (v1-1 (-> this action)) ) (t9-0 a0-1 @@ -1313,11 +1313,11 @@ "*unknown*" ) ) - (-> obj scene) - obj + (-> this scene) + this ) ) - obj + this ) ;; definition for method 0 of type game-task-control @@ -1329,14 +1329,14 @@ ) ;; definition for method 9 of type game-task-control -(defmethod get-current-task-event game-task-control ((obj game-task-control)) +(defmethod get-current-task-event game-task-control ((this game-task-control)) (with-pp (let ((gp-0 (new 'static 'game-task-event :scene #f))) (let ((s5-0 #f)) - (when (!= (-> obj counter) (-> *game-info* task-counter)) - (set! (-> obj counter) (-> *game-info* task-counter)) - (set! (-> obj current-node) (game-task-node none)) - (set! (-> obj current-event) #f) + (when (!= (-> this counter) (-> *game-info* task-counter)) + (set! (-> this counter) (-> *game-info* task-counter)) + (set! (-> this current-node) (game-task-node none)) + (set! (-> this current-event) #f) (set! s5-0 #t) (let ((game-nodes (-> *game-info* sub-task-list))) (dotimes (i (-> game-nodes length)) @@ -1346,9 +1346,9 @@ (-> node when-open) (begin (countdown (v1-12 (-> node when-open length)) - (when (= (-> obj actor) (-> node when-open v1-12 actor)) - (set! (-> obj current-event) (-> node when-open v1-12)) - (set! (-> obj current-node) (the-as game-task-node i)) + (when (= (-> this actor) (-> node when-open v1-12 actor)) + (set! (-> this current-event) (-> node when-open v1-12)) + (set! (-> this current-node) (the-as game-task-node i)) #t (goto cfg-18) ) @@ -1364,11 +1364,11 @@ ) (label cfg-18) (cond - ((= (-> obj current-node) (game-task-node none)) - (set! (-> gp-0 actor) (-> obj actor)) + ((= (-> this current-node) (game-task-node none)) + (set! (-> gp-0 actor) (-> this actor)) ) (else - (set! gp-0 (-> obj current-event)) + (set! gp-0 (-> this current-event)) (cond ((and (logtest? (-> gp-0 flags) (game-task-flags gatflag-00)) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1425,38 +1425,38 @@ ) ;; definition for method 3 of type fail-mission -(defmethod inspect fail-mission ((obj fail-mission)) - (when (not obj) - (set! obj obj) +(defmethod inspect fail-mission ((this fail-mission)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tmessage: ~D~%" (-> obj message)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tretry-continue: ~A~%" (-> obj retry-continue)) - (format #t "~2Tfail-continue: ~A~%" (-> obj fail-continue)) - (format #t "~2Treset-delay: ~D~%" (-> obj reset-delay)) - (format #t "~2Tgrabbed-time: ~D~%" (-> obj grabbed-time)) - (format #t "~2Tretry: ~A~%" (-> obj retry)) - (format #t "~2Ttask: ~D~%" (-> obj task)) - (format #t "~2Tmessage-id: ~D~%" (-> obj message-id)) - (format #t "~2Tfail-message: ~D~%" (-> obj fail-message)) - (format #t "~2Tstinger: ~D~%" (-> obj stinger)) + (format #t "~2Tmessage: ~D~%" (-> this message)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tretry-continue: ~A~%" (-> this retry-continue)) + (format #t "~2Tfail-continue: ~A~%" (-> this fail-continue)) + (format #t "~2Treset-delay: ~D~%" (-> this reset-delay)) + (format #t "~2Tgrabbed-time: ~D~%" (-> this grabbed-time)) + (format #t "~2Tretry: ~A~%" (-> this retry)) + (format #t "~2Ttask: ~D~%" (-> this task)) + (format #t "~2Tmessage-id: ~D~%" (-> this message-id)) + (format #t "~2Tfail-message: ~D~%" (-> this fail-message)) + (format #t "~2Tstinger: ~D~%" (-> this stinger)) (label cfg-4) - obj + this ) ;; definition for method 12 of type fail-mission -(defmethod run-logic? fail-mission ((obj fail-mission)) +(defmethod run-logic? fail-mission ((this fail-mission)) #t ) ;; definition for method 16 of type fail-mission -(defmethod print-text fail-mission ((obj fail-mission)) - (when (and (not (logtest? (-> obj flags) (fail-mission-flags famflags-6))) - (= (get-status *gui-control* (-> obj message-id)) (gui-status active)) +(defmethod print-text fail-mission ((this fail-mission)) + (when (and (not (logtest? (-> this flags) (fail-mission-flags famflags-6))) + (= (get-status *gui-control* (-> this message-id)) (gui-status active)) ) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) @@ -1473,8 +1473,8 @@ (set! (-> v1-9 height) (the float 35)) ) (set! (-> gp-0 flags) (font-flags shadow kerning middle middle-vert large)) - (let ((s4-0 (if (logtest? (-> obj flags) (fail-mission-flags famflags-2)) - (the-as int (-> obj fail-message)) + (let ((s4-0 (if (logtest? (-> this flags) (fail-mission-flags famflags-2)) + (the-as int (-> this fail-message)) 393 ) ) @@ -1486,7 +1486,7 @@ ) ) ) - (when (= (-> obj message) (fail-mission-message fammsg-1)) + (when (= (-> this message) (fail-mission-message fammsg-1)) (let ((v1-17 gp-0)) (set! (-> v1-17 height) (the float 95)) ) @@ -1573,10 +1573,10 @@ ) ) (logior! (-> self flags) (fail-mission-flags famflags-1)) - (set! (-> self grabbed-time) (current-time)) + (set-time! (-> self grabbed-time)) (when (not (logtest? (-> self flags) (fail-mission-flags famflags-3))) (when (not (logtest? (-> self flags) (fail-mission-flags famflags-5))) - (while (< (- (current-time) (-> self grabbed-time)) (seconds 1.5)) + (while (not (time-elapsed? (-> self grabbed-time) (seconds 1.5))) (let ((f30-0 (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self grabbed-time))) 0.0 450.0))) (set-filter-color! (lerp-scale 1.0 1.25 f30-0 0.0 1.0) @@ -1600,7 +1600,7 @@ (((fail-mission-message fammsg-0)) (until #f (when (or (and (logtest? (-> self flags) (fail-mission-flags famflags-0)) - (>= (- (current-time) (-> self grabbed-time)) (the-as time-frame (-> self reset-delay))) + (time-elapsed? (-> self grabbed-time) (the-as time-frame (-> self reset-delay))) ) (or (cpad-pressed? 0 confirm) (logtest? (-> self flags) (fail-mission-flags famflags-3))) ) @@ -1648,14 +1648,14 @@ ;; definition for method 10 of type fail-mission ;; WARN: Return type mismatch process vs none. -(defmethod deactivate fail-mission ((obj fail-mission)) +(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)) (update-rates! (-> *display* bg-clock) 1.0) (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)) obj) + ((the-as (function process process) (find-parent-method fail-mission 10)) this) (none) ) @@ -1688,7 +1688,7 @@ :code (behavior () (local-vars (a1-10 string)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (let ((f30-0 (lerp-scale 1.0 0.0 (the float (- (current-time) gp-0)) 0.0 270.0))) (when *sound-player-enable* (let ((v1-6 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) @@ -1807,11 +1807,11 @@ ) ;; definition for method 11 of type fail-mission-control -(defmethod start! fail-mission-control ((obj fail-mission-control) (arg0 fail-mission-params)) - (when (not (handle->process (-> obj process))) +(defmethod start! fail-mission-control ((this fail-mission-control) (arg0 fail-mission-params)) + (when (not (handle->process (-> this process))) (let ((v1-4 (process-spawn fail-mission arg0 :to *entity-pool*))) (when v1-4 - (set! (-> obj process) (process->handle (-> v1-4 0))) + (set! (-> this process) (process->handle (-> v1-4 0))) #t ) ) @@ -1819,39 +1819,39 @@ ) ;; definition for method 12 of type fail-mission-control -(defmethod reset! fail-mission-control ((obj fail-mission-control)) - (send-event (handle->process (-> obj process)) 'reset) +(defmethod reset! fail-mission-control ((this fail-mission-control)) + (send-event (handle->process (-> this process)) 'reset) ) ;; definition for method 9 of type fail-mission-control ;; WARN: Return type mismatch object vs symbol. -(defmethod reset? fail-mission-control ((obj fail-mission-control)) - (the-as symbol (send-event (handle->process (-> obj process)) 'query 'reset)) +(defmethod reset? fail-mission-control ((this fail-mission-control)) + (the-as symbol (send-event (handle->process (-> this process)) 'query 'reset)) ) ;; definition for method 10 of type fail-mission-control ;; WARN: Return type mismatch process vs fail-mission. -(defmethod get-proc fail-mission-control ((obj fail-mission-control)) - (the-as fail-mission (handle->process (-> obj process))) +(defmethod get-proc fail-mission-control ((this fail-mission-control)) + (the-as fail-mission (handle->process (-> this process))) ) ;; definition for method 12 of type game-task-node-info -(defmethod copy-hooks! game-task-node-info ((obj game-task-node-info) (arg0 game-task-node-info)) - (when (and (-> obj info) (-> arg0 info)) +(defmethod copy-hooks! game-task-node-info ((this game-task-node-info) (arg0 game-task-node-info)) + (when (and (-> this info) (-> arg0 info)) (countdown (v1-3 7) - (set! (-> obj info hooks v1-3) (-> arg0 info hooks v1-3)) + (set! (-> this info hooks v1-3) (-> arg0 info hooks v1-3)) ) ) - obj + this ) ;; definition for method 7 of type task-manager ;; WARN: Return type mismatch process vs task-manager. -(defmethod relocate task-manager ((obj task-manager) (arg0 int)) - (if (nonzero? (-> obj link)) - (+! (-> obj link) arg0) +(defmethod relocate task-manager ((this task-manager) (arg0 int)) + (if (nonzero? (-> this link)) + (+! (-> this link) arg0) ) - (the-as task-manager ((method-of-type process relocate) obj arg0)) + (the-as task-manager ((method-of-type process relocate) this arg0)) ) ;; definition for function task-manager-init-by-other @@ -1862,7 +1862,7 @@ (set! (-> self lev-name) arg1) (add-setting! 'task arg0 0.0 0) (add-setting! 'task-manager (process->ppointer self) 0.0 0) - (set! (-> self intro-time) (current-time)) + (set-time! (-> self intro-time)) (set! (-> self fail-on-death?) (not (logtest? (-> arg0 flags) (game-task-node-flag no-fail-on-death)))) (when arg1 (let* ((v1-15 (level-get *level* arg1)) @@ -1881,22 +1881,22 @@ ) ;; definition for method 20 of type task-manager -(defmethod kill-all-children task-manager ((obj task-manager)) - (while (-> obj child) - (deactivate (ppointer->process (-> obj child))) +(defmethod kill-all-children task-manager ((this task-manager)) + (while (-> this child) + (deactivate (ppointer->process (-> this child))) ) 0 ) ;; definition for method 21 of type task-manager -(defmethod check-time task-manager ((obj task-manager)) - (when (nonzero? (-> obj start-time)) - (let ((v1-3 (handle->process (-> obj hud-timer)))) +(defmethod check-time task-manager ((this task-manager)) + (when (nonzero? (-> this start-time)) + (let ((v1-3 (handle->process (-> this hud-timer)))) (if (and *target* (not v1-3)) - (set! (-> obj hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) + (set! (-> this hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) ) ) - (let ((v1-15 (- (-> obj time-limit) (- (current-time) (-> obj start-time))))) + (let ((v1-15 (- (-> this time-limit) (- (current-time) (-> this start-time))))) (let ((a0-15 *game-info*)) (set! (-> a0-15 timer) v1-15) (set! (-> a0-15 timer-flash) (< v1-15 (seconds 10))) @@ -1905,8 +1905,8 @@ (if *debug-segment* (format #t "task failed: ran out of time~%") ) - (send-event (handle->process (-> obj hud-timer)) 'hide-and-die) - (go (method-of-object obj fail)) + (send-event (handle->process (-> this hud-timer)) 'hide-and-die) + (go (method-of-object this fail)) ) ) ) @@ -1914,33 +1914,33 @@ ) ;; definition for method 19 of type task-manager -(defmethod initialize! task-manager ((obj task-manager)) - (set! (-> obj info) (-> obj node-info info)) +(defmethod initialize! task-manager ((this task-manager)) + (set! (-> this info) (-> this node-info info)) (countdown (v1-2 32) - (set! (-> obj slave v1-2) (the-as handle #f)) + (set! (-> this slave v1-2) (the-as handle #f)) ) (countdown (v1-5 4) - (set! (-> obj hud v1-5) (the-as handle #f)) + (set! (-> this hud v1-5) (the-as handle #f)) ) - (set! (-> obj arrow) (the-as handle #f)) + (set! (-> this arrow) (the-as handle #f)) (countdown (v1-8 4) - (set! (-> obj minimap v1-8) #f) + (set! (-> this minimap v1-8) #f) ) (countdown (v1-11 4) - (set! (-> obj actor-group v1-11) (the-as (pointer entity-actor) #f)) + (set! (-> this actor-group v1-11) (the-as (pointer entity-actor) #f)) ) - (set! (-> obj fail-now) #f) - (set! (-> obj retry-now) #f) - (set! (-> obj allow-fail) #t) + (set! (-> this fail-now) #f) + (set! (-> this retry-now) #f) + (set! (-> this allow-fail) #t) 0 ) ;; definition for method 10 of type task-manager -(defmethod deactivate task-manager ((obj task-manager)) +(defmethod deactivate task-manager ((this task-manager)) (with-pp (let ((s5-0 pp)) - (set! pp obj) - (let ((t9-0 (-> obj info cleanup-hook))) + (set! pp this) + (let ((t9-0 (-> this info cleanup-hook))) (if t9-0 (t9-0) ) @@ -1948,9 +1948,9 @@ (set! pp s5-0) ) (countdown (s5-1 4) - (send-event (handle->process (-> obj hud s5-1)) 'hide-and-die) + (send-event (handle->process (-> this hud s5-1)) 'hide-and-die) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ) @@ -2072,14 +2072,14 @@ ;; definition for method 22 of type task-manager ;; WARN: Return type mismatch object vs symbol. -(defmethod task-manager-method-22 task-manager ((obj task-manager)) +(defmethod task-manager-method-22 task-manager ((this task-manager)) (the-as symbol - (and (or (not (logtest? (-> obj node-info flags) (game-task-node-flag city-wait))) + (and (or (not (logtest? (-> this node-info flags) (game-task-node-flag city-wait))) (let ((a0-2 (level-get-target-inside *level*))) (cond ((not (and a0-2 (logtest? (-> a0-2 info level-flags) 1))) - (set! (-> obj intro-time) (current-time)) + (set-time! (-> this intro-time)) #f ) (else @@ -2088,8 +2088,8 @@ ) ) ) - (or (zero? (-> obj info intro-delay)) - (>= (- (current-time) (-> obj intro-time)) (the-as time-frame (-> obj info intro-delay))) + (or (zero? (-> this info intro-delay)) + (time-elapsed? (-> this intro-time) (the-as time-frame (-> this info intro-delay))) ) (and *target* (not (logtest? (focus-status dead teleporting) (-> *target* focus-status)))) ) @@ -2182,7 +2182,7 @@ (t9-3) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) (let ((gp-2 (ppointer->handle (process-spawn scene-player diff --git a/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc index 8e914e9a83..c9c9f24942 100644 --- a/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc @@ -26,16 +26,16 @@ ) ;; definition for method 3 of type bounding-box -(defmethod inspect bounding-box ((obj bounding-box)) - (when (not obj) - (set! obj obj) +(defmethod inspect bounding-box ((this bounding-box)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bounding-box) - (format #t "~1Tmin: ~`vector`P~%" (-> obj min)) - (format #t "~1Tmax: ~`vector`P~%" (-> obj max)) + (format #t "[~8x] ~A~%" this 'bounding-box) + (format #t "~1Tmin: ~`vector`P~%" (-> this min)) + (format #t "~1Tmax: ~`vector`P~%" (-> this max)) (label cfg-4) - obj + this ) ;; definition of type bounding-box4w @@ -49,16 +49,16 @@ ) ;; definition for method 3 of type bounding-box4w -(defmethod inspect bounding-box4w ((obj bounding-box4w)) - (when (not obj) - (set! obj obj) +(defmethod inspect bounding-box4w ((this bounding-box4w)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bounding-box4w) - (format #t "~1Tmin: ~`vector4w`P~%" (-> obj min)) - (format #t "~1Tmax: ~`vector4w`P~%" (-> obj max)) + (format #t "[~8x] ~A~%" this 'bounding-box4w) + (format #t "~1Tmin: ~`vector4w`P~%" (-> this min)) + (format #t "~1Tmax: ~`vector4w`P~%" (-> this max)) (label cfg-4) - obj + this ) ;; definition of type bounding-box-both @@ -72,16 +72,16 @@ ) ;; definition for method 3 of type bounding-box-both -(defmethod inspect bounding-box-both ((obj bounding-box-both)) - (when (not obj) - (set! obj obj) +(defmethod inspect bounding-box-both ((this bounding-box-both)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bounding-box-both) - (format #t "~1Tbox: #~%" (-> obj box)) - (format #t "~1Tbox4w: #~%" (-> obj box4w)) + (format #t "[~8x] ~A~%" this 'bounding-box-both) + (format #t "~1Tbox: #~%" (-> this box)) + (format #t "~1Tbox4w: #~%" (-> this box4w)) (label cfg-4) - obj + this ) ;; definition of type bounding-box-array @@ -94,22 +94,18 @@ ) ;; definition for method 3 of type bounding-box-array -(defmethod inspect bounding-box-array ((obj bounding-box-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect bounding-box-array ((this bounding-box-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: (set! (-> bounding-box-array heap-base) (the-as uint 32)) - - - - diff --git a/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc b/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc index cc9c8ac1c2..871ddd66c5 100644 --- a/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc @@ -2,22 +2,22 @@ (in-package goal) ;; definition for method 19 of type bounding-box -(defmethod inside-xyz? bounding-box ((obj bounding-box) (arg0 vector)) - (and (< (-> obj min x) (-> arg0 x)) - (< (-> obj min y) (-> arg0 y)) - (< (-> obj min z) (-> arg0 z)) - (< (-> arg0 x) (-> obj max x)) - (< (-> arg0 y) (-> obj max y)) - (< (-> arg0 z) (-> obj max z)) +(defmethod inside-xyz? bounding-box ((this bounding-box) (arg0 vector)) + (and (< (-> this min x) (-> arg0 x)) + (< (-> this min y) (-> arg0 y)) + (< (-> this min z) (-> arg0 z)) + (< (-> arg0 x) (-> this max x)) + (< (-> arg0 y) (-> this max y)) + (< (-> arg0 z) (-> this max z)) ) ) ;; definition for method 20 of type bounding-box -(defmethod inside-xz? bounding-box ((obj bounding-box) (arg0 vector)) - (and (< (-> obj min x) (-> arg0 x)) - (< (-> obj min z) (-> arg0 z)) - (< (-> arg0 x) (-> obj max x)) - (< (-> arg0 z) (-> obj max z)) +(defmethod inside-xz? bounding-box ((this bounding-box) (arg0 vector)) + (and (< (-> this min x) (-> arg0 x)) + (< (-> this min z) (-> arg0 z)) + (< (-> arg0 x) (-> this max x)) + (< (-> arg0 z) (-> this max z)) ) ) @@ -45,7 +45,7 @@ ;; definition for method 13 of type bounding-box ;; WARN: Return type mismatch int vs none. -(defmethod set-from-point-offset! bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector)) +(defmethod set-from-point-offset! bounding-box ((this bounding-box) (arg0 vector) (arg1 vector)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -61,8 +61,8 @@ (.max.vf vf2 vf4 vf5) (.mov.vf vf1 vf0 :mask #b1000) (.mov.vf vf2 vf0 :mask #b1000) - (.svf (&-> obj min quad) vf1) - (.svf (&-> obj max quad) vf2) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) 0 (none) ) @@ -70,38 +70,38 @@ ;; definition for method 11 of type bounding-box ;; WARN: Return type mismatch int vs none. -(defmethod add-point! bounding-box ((obj bounding-box) (arg0 vector)) +(defmethod add-point! bounding-box ((this bounding-box) (arg0 vector)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) - (.lvf vf1 (&-> obj min quad)) - (.lvf vf2 (&-> obj max quad)) + (.lvf vf1 (&-> this min quad)) + (.lvf vf2 (&-> this max quad)) (.lvf vf3 (&-> arg0 quad)) (.min.vf vf1 vf1 vf3) (.max.vf vf2 vf2 vf3) - (.svf (&-> obj min quad) vf1) - (.svf (&-> obj max quad) vf2) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) 0 (none) ) ) ;; definition for method 10 of type bounding-box -(defmethod add-box! bounding-box ((obj bounding-box) (arg0 bounding-box)) +(defmethod add-box! bounding-box ((this bounding-box) (arg0 bounding-box)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) (vf4 :class vf) ) - (.lvf vf1 (&-> obj min quad)) - (.lvf vf2 (&-> obj max quad)) + (.lvf vf1 (&-> this min quad)) + (.lvf vf2 (&-> this max quad)) (.lvf vf3 (&-> arg0 min quad)) (.lvf vf4 (&-> arg0 max quad)) (.min.vf vf1 vf1 vf3) (.max.vf vf2 vf2 vf4) - (.svf (&-> obj min quad) vf1) - (.svf (&-> obj max quad) vf2) + (.svf (&-> this min quad) vf1) + (.svf (&-> this max quad) vf2) 0 ) ) @@ -109,15 +109,15 @@ ;; definition for method 15 of type bounding-box ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-to-point! bounding-box ((obj bounding-box) (arg0 vector)) - (set! (-> obj min quad) (-> arg0 quad)) - (set! (-> obj max quad) (-> arg0 quad)) +(defmethod set-to-point! bounding-box ((this bounding-box) (arg0 vector)) + (set! (-> this min quad) (-> arg0 quad)) + (set! (-> this max quad) (-> arg0 quad)) 0 (none) ) ;; definition for method 14 of type bounding-box -(defmethod set-from-point-offset-pad! bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod set-from-point-offset-pad! bounding-box ((this bounding-box) (arg0 vector) (arg1 vector) (arg2 float)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -137,15 +137,15 @@ (.sub.x.vf vf2 vf2 vf1 :mask #b111) (.mov.vf vf2 vf0 :mask #b1000) (.mov.vf vf3 vf0 :mask #b1000) - (.svf (&-> obj min quad) vf2) - (.svf (&-> obj max quad) vf3) + (.svf (&-> this min quad) vf2) + (.svf (&-> this max quad) vf3) 0 ) ) ;; definition for method 16 of type bounding-box ;; WARN: Return type mismatch int vs none. -(defmethod set-from-sphere! bounding-box ((obj bounding-box) (arg0 sphere)) +(defmethod set-from-sphere! bounding-box ((this bounding-box) (arg0 sphere)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -157,8 +157,8 @@ (.add.w.vf vf3 vf1 vf1 :mask #b111) (.mov.vf vf2 vf0 :mask #b1000) (.mov.vf vf3 vf0 :mask #b1000) - (.svf (&-> obj min quad) vf2) - (.svf (&-> obj max quad) vf3) + (.svf (&-> this min quad) vf2) + (.svf (&-> this max quad) vf3) 0 (none) ) @@ -171,11 +171,11 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for method 18 of type bounding-box -(defmethod get-bounding-sphere bounding-box ((obj bounding-box) (arg0 vector)) - (let* ((a1-2 (vector-! (new 'stack-no-clear 'vector) (-> obj max) (-> obj min))) +(defmethod get-bounding-sphere bounding-box ((this bounding-box) (arg0 vector)) + (let* ((a1-2 (vector-! (new 'stack-no-clear 'vector) (-> this max) (-> this min))) (a0-3 (vector-float*! (new 'stack-no-clear 'vector) a1-2 0.5)) ) - (vector+! arg0 (-> obj min) a0-3) + (vector+! arg0 (-> this min) a0-3) (set! (-> arg0 w) (vector-length a0-3)) ) arg0 @@ -192,16 +192,16 @@ ) ;; definition for method 3 of type liang-barsky-line-clip-params -(defmethod inspect liang-barsky-line-clip-params ((obj liang-barsky-line-clip-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect liang-barsky-line-clip-params ((this liang-barsky-line-clip-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'liang-barsky-line-clip-params) - (format #t "~1Tte: ~f~%" (-> obj te)) - (format #t "~1Ttl: ~f~%" (-> obj tl)) + (format #t "[~8x] ~A~%" this 'liang-barsky-line-clip-params) + (format #t "~1Tte: ~f~%" (-> this te)) + (format #t "~1Ttl: ~f~%" (-> this tl)) (label cfg-4) - obj + this ) ;; definition for function liang-barsky-line-clipt @@ -238,7 +238,7 @@ ;; definition for method 12 of type bounding-box ;; WARN: disable def twice: 23. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod intersects-line-segment? bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector)) +(defmethod intersects-line-segment? bounding-box ((this bounding-box) (arg0 vector) (arg1 vector)) (let ((f28-0 (- (-> arg1 x) (-> arg0 x))) (f30-0 (- (-> arg1 z) (-> arg0 z))) ) @@ -247,17 +247,17 @@ (let ((f1-2 (-> arg0 x)) (f0-4 (-> arg0 z)) ) - (and (>= f1-2 (-> obj min x)) (>= (-> obj max x) f1-2) (>= f0-4 (-> obj min z)) (>= (-> obj max z) f0-4)) + (and (>= f1-2 (-> this min x)) (>= (-> this max x) f1-2) (>= f0-4 (-> this min z)) (>= (-> this max z) f0-4)) ) ) (else (let ((s4-0 (new 'stack-no-clear 'liang-barsky-line-clip-params))) (set! (-> s4-0 te) 0.0) (set! (-> s4-0 tl) 1.0) - (and (liang-barsky-line-clipt s4-0 f28-0 (- (-> obj min x) (-> arg0 x))) - (liang-barsky-line-clipt s4-0 (- f28-0) (- (-> arg0 x) (-> obj max x))) - (liang-barsky-line-clipt s4-0 f30-0 (- (-> obj min z) (-> arg0 z))) - (liang-barsky-line-clipt s4-0 (- f30-0) (- (-> arg0 z) (-> obj max z))) + (and (liang-barsky-line-clipt s4-0 f28-0 (- (-> this min x) (-> arg0 x))) + (liang-barsky-line-clipt s4-0 (- f28-0) (- (-> arg0 x) (-> this max x))) + (liang-barsky-line-clipt s4-0 f30-0 (- (-> this min z) (-> arg0 z))) + (liang-barsky-line-clipt s4-0 (- f30-0) (- (-> arg0 z) (-> this max z))) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc b/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc index 3474cab39c..9f665f9a10 100644 --- a/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/cylinder_REF.gc @@ -2,21 +2,23 @@ (in-package goal) ;; definition for method 10 of type cylinder -(defmethod ray-capsule-intersect cylinder ((obj cylinder) (ray1 vector) (ray2 vector)) +(defmethod ray-capsule-intersect cylinder ((this cylinder) (ray1 vector) (ray2 vector)) (let ((t2-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (let ((f30-0 (ray-cylinder-intersect ray1 ray2 (-> obj origin) (-> obj axis) (-> obj radius) (-> obj length) t2-0)) + (let ((f30-0 + (ray-cylinder-intersect ray1 ray2 (-> this origin) (-> this axis) (-> this radius) (-> this length) t2-0) + ) ) - (let ((f0-5 (ray-sphere-intersect ray1 ray2 (-> obj origin) (-> obj radius)))) + (let ((f0-5 (ray-sphere-intersect ray1 ray2 (-> this origin) (-> this radius)))) (if (and (>= f0-5 0.0) (or (< f30-0 0.0) (< f0-5 f30-0))) (set! f30-0 f0-5) ) ) - (vector+float*! s4-0 (-> obj origin) (-> obj axis) (-> obj length)) - (let ((f0-8 (ray-sphere-intersect ray1 ray2 s4-0 (-> obj radius)))) + (vector+float*! s4-0 (-> this origin) (-> this axis) (-> this length)) + (let ((f0-8 (ray-sphere-intersect ray1 ray2 s4-0 (-> this radius)))) (if (and (>= f0-8 0.0) (or (< f30-0 0.0) (< f0-8 f30-0))) (set! f30-0 f0-8) ) @@ -36,21 +38,21 @@ ) ;; definition for method 3 of type cylinder-verts -(defmethod inspect cylinder-verts ((obj cylinder-verts)) - (when (not obj) - (set! obj obj) +(defmethod inspect cylinder-verts ((this cylinder-verts)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cylinder-verts) - (format #t "~1Tvert[24] @ #x~X~%" (-> obj vert)) + (format #t "[~8x] ~A~%" this 'cylinder-verts) + (format #t "~1Tvert[24] @ #x~X~%" (-> this vert)) (label cfg-4) - obj + this ) ;; definition for method 9 of type cylinder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw cylinder ((obj cylinder) (arg0 vector4w)) +(defmethod debug-draw cylinder ((this cylinder) (arg0 vector4w)) (local-vars (sv-896 matrix) (sv-912 vector) @@ -79,33 +81,33 @@ (let ((s1-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'vector)) ) - (if (< 0.999 (fabs (-> obj axis y))) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :z 1.0)) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :y 1.0)) + (if (< 0.999 (fabs (-> this axis y))) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) - (vector-normalize! s1-0 (-> obj radius)) - (vector-float*! s0-0 (-> obj axis) (* 0.125 (-> obj length))) + (vector-normalize! s1-0 (-> this radius)) + (vector-float*! s0-0 (-> this axis) (* 0.125 (-> this length))) (let ((s5-0 (new 'stack-no-clear 'cylinder-verts)) (s4-0 (new 'stack-no-clear 'cylinder-verts)) (s3-0 (new 'stack-no-clear 'matrix)) ) - (matrix-axis-angle! s3-0 (-> obj axis) 4096.0) + (matrix-axis-angle! s3-0 (-> this axis) 4096.0) (set! sv-896 (new 'stack-no-clear 'matrix)) - (vector-matrix*! (the-as vector sv-896) (-> obj origin) s3-0) + (vector-matrix*! (the-as vector sv-896) (-> this origin) s3-0) (let ((v1-6 (-> s3-0 trans))) - (.lvf vf4 (&-> (-> obj origin) quad)) + (.lvf vf4 (&-> (-> this origin) quad)) (.lvf vf5 (&-> sv-896 quad 0)) (.mov.vf vf6 vf0 :mask #b1000) (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> v1-6 quad) vf6) ) (dotimes (v1-7 8) - (vector+! (-> s5-0 vert (+ v1-7 8)) (-> obj origin) s1-0) + (vector+! (-> s5-0 vert (+ v1-7 8)) (-> this origin) s1-0) (vector+float*! (-> s5-0 vert (+ v1-7 8)) (-> s5-0 vert (+ v1-7 8)) s0-0 (the float v1-7)) ) (dotimes (s0-1 8) (set! sv-944 (-> s5-0 vert s0-1)) - (set! sv-912 (-> obj origin)) + (set! sv-912 (-> this origin)) (set! sv-928 s1-0) (let ((f0-8 (cos (* 2048.0 (the float (- 7 s0-1)))))) (.lvf vf2 (&-> sv-928 quad)) @@ -120,8 +122,8 @@ (.svf (&-> sv-944 quad) vf4) (set! sv-992 (-> s5-0 vert s0-1)) (set! sv-960 (-> s5-0 vert s0-1)) - (set! sv-976 (-> obj axis)) - (let ((f0-13 (* (- (-> obj radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))) + (set! sv-976 (-> this axis)) + (let ((f0-13 (* (- (-> this radius)) (sin (* 2048.0 (the float (- 7 s0-1))))))) (.lvf vf2 (&-> sv-976 quad)) (.lvf vf1 (&-> sv-960 quad)) (let ((v1-33 f0-13)) @@ -133,7 +135,7 @@ (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) (.svf (&-> sv-992 quad) vf4) (set! sv-1040 (-> s5-0 vert (+ s0-1 16))) - (set! sv-1008 (-> obj origin)) + (set! sv-1008 (-> this origin)) (set! sv-1024 s1-0) (let ((f0-16 (cos (* 2048.0 (the float s0-1))))) (.lvf vf2 (&-> sv-1024 quad)) @@ -148,8 +150,8 @@ (.svf (&-> sv-1040 quad) vf4) (set! sv-1088 (-> s5-0 vert (+ s0-1 16))) (set! sv-1056 (-> s5-0 vert (+ s0-1 16))) - (set! sv-1072 (-> obj axis)) - (let ((f0-21 (+ (-> obj length) (* (-> obj radius) (sin (* 2048.0 (the float s0-1))))))) + (set! sv-1072 (-> this axis)) + (let ((f0-21 (+ (-> this length) (* (-> this radius) (sin (* 2048.0 (the float s0-1))))))) (.lvf vf2 (&-> sv-1072 quad)) (.lvf vf1 (&-> sv-1056 quad)) (let ((v1-57 f0-21)) @@ -206,22 +208,24 @@ ;; definition for method 10 of type cylinder-flat ;; INFO: Used lq/sq -(defmethod ray-flat-cyl-intersect cylinder-flat ((obj cylinder-flat) (arg0 vector) (arg1 vector)) +(defmethod ray-flat-cyl-intersect cylinder-flat ((this cylinder-flat) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (let ((f30-0 (ray-cylinder-intersect arg0 arg1 (-> obj origin) (-> obj axis) (-> obj radius) (-> obj length) gp-0)) + (let ((f30-0 + (ray-cylinder-intersect arg0 arg1 (-> this origin) (-> this axis) (-> this radius) (-> this length) gp-0) + ) ) - (let ((f0-5 (ray-arbitrary-circle-intersect arg0 arg1 (-> obj origin) (-> obj axis) (-> obj radius)))) + (let ((f0-5 (ray-arbitrary-circle-intersect arg0 arg1 (-> this origin) (-> this axis) (-> this radius)))) (when (and (>= f0-5 0.0) (or (< f30-0 0.0) (< f0-5 f30-0))) (set! f30-0 f0-5) - (set! (-> gp-0 quad) (-> obj origin quad)) + (set! (-> gp-0 quad) (-> this origin quad)) ) ) - (vector+float*! s5-0 (-> obj origin) (-> obj axis) (-> obj length)) - (let ((f0-8 (ray-arbitrary-circle-intersect arg0 arg1 s5-0 (-> obj axis) (-> obj radius)))) + (vector+float*! s5-0 (-> this origin) (-> this axis) (-> this length)) + (let ((f0-8 (ray-arbitrary-circle-intersect arg0 arg1 s5-0 (-> this axis) (-> this radius)))) (when (and (>= f0-8 0.0) (or (< f30-0 0.0) (< f0-8 f30-0))) (set! f30-0 f0-8) (set! (-> gp-0 quad) (-> s5-0 quad)) @@ -242,21 +246,21 @@ ) ;; definition for method 3 of type cylinder-flat-verts -(defmethod inspect cylinder-flat-verts ((obj cylinder-flat-verts)) - (when (not obj) - (set! obj obj) +(defmethod inspect cylinder-flat-verts ((this cylinder-flat-verts)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cylinder-flat-verts) - (format #t "~1Tvert[10] @ #x~X~%" (-> obj vert)) + (format #t "[~8x] ~A~%" this 'cylinder-flat-verts) + (format #t "~1Tvert[10] @ #x~X~%" (-> this vert)) (label cfg-4) - obj + this ) ;; definition for method 9 of type cylinder-flat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw cylinder-flat ((obj cylinder-flat) (arg0 vector4w)) +(defmethod debug-draw cylinder-flat ((this cylinder-flat) (arg0 vector4w)) (local-vars (sv-448 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -267,32 +271,32 @@ (let ((s1-0 (new 'stack-no-clear 'vector)) (s0-0 (new 'stack-no-clear 'vector)) ) - (if (< 0.999 (fabs (-> obj axis y))) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :z 1.0)) - (vector-cross! s1-0 (-> obj axis) (new 'static 'vector :y 1.0)) + (if (< 0.999 (fabs (-> this axis y))) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :z 1.0)) + (vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0)) ) - (vector-normalize! s1-0 (-> obj radius)) - (vector-float*! s0-0 (-> obj axis) (* 0.14285715 (-> obj length))) + (vector-normalize! s1-0 (-> this radius)) + (vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length))) (let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s4-0 (new 'stack-no-clear 'cylinder-flat-verts)) (s3-0 (new 'stack-no-clear 'matrix)) ) - (matrix-axis-angle! s3-0 (-> obj axis) 4096.0) + (matrix-axis-angle! s3-0 (-> this axis) 4096.0) (set! sv-448 (new 'stack-no-clear 'vector)) - (vector-matrix*! sv-448 (-> obj origin) s3-0) + (vector-matrix*! sv-448 (-> this origin) s3-0) (let ((v1-6 (-> s3-0 trans))) - (.lvf vf4 (&-> (-> obj origin) quad)) + (.lvf vf4 (&-> (-> this origin) quad)) (.lvf vf5 (&-> sv-448 quad)) (.mov.vf vf6 vf0 :mask #b1000) (.sub.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> v1-6 quad) vf6) ) (dotimes (v1-7 8) - (vector+! (-> s5-0 vert (+ v1-7 1)) (-> obj origin) s1-0) + (vector+! (-> s5-0 vert (+ v1-7 1)) (-> this origin) s1-0) (vector+float*! (-> s5-0 vert (+ v1-7 1)) (-> s5-0 vert (+ v1-7 1)) s0-0 (the float v1-7)) ) - (set! (-> s5-0 vert 0 quad) (-> obj origin quad)) - (vector+float*! (-> s5-0 vert 9) (-> obj origin) (-> obj axis) (-> obj length)) + (set! (-> s5-0 vert 0 quad) (-> this origin quad)) + (vector+float*! (-> s5-0 vert 9) (-> this origin) (-> this axis) (-> this length)) (dotimes (s2-1 16) (dotimes (s1-1 10) (vector-matrix*! (-> s4-0 vert s1-1) (-> s5-0 vert s1-1) s3-0) diff --git a/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc index 43ab6d101a..e2c593b442 100644 --- a/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc @@ -15,19 +15,19 @@ ) ;; definition for method 3 of type curve -(defmethod inspect curve ((obj curve)) - (when (not obj) - (set! obj obj) +(defmethod inspect curve ((this curve)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'curve) - (format #t "~1Tcverts: #x~X~%" (-> obj cverts)) - (format #t "~1Tnum-cverts: ~D~%" (-> obj num-cverts)) - (format #t "~1Tknots: #x~X~%" (-> obj knots)) - (format #t "~1Tnum-knots: ~D~%" (-> obj num-knots)) - (format #t "~1Tlength: ~f~%" (-> obj length)) + (format #t "[~8x] ~A~%" this 'curve) + (format #t "~1Tcverts: #x~X~%" (-> this cverts)) + (format #t "~1Tnum-cverts: ~D~%" (-> this num-cverts)) + (format #t "~1Tknots: #x~X~%" (-> this knots)) + (format #t "~1Tnum-knots: ~D~%" (-> this num-knots)) + (format #t "~1Tlength: ~f~%" (-> this length)) (label cfg-4) - obj + this ) ;; definition of type border-plane @@ -48,19 +48,19 @@ ) ;; definition for method 3 of type border-plane -(defmethod inspect border-plane ((obj border-plane)) - (when (not obj) - (set! obj obj) +(defmethod inspect border-plane ((this border-plane)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Taction: ~A~%" (-> obj action)) - (format #t "~1Tslot: ~D~%" (-> obj slot)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Tnormal: ~`vector`P~%" (-> obj normal)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Taction: ~A~%" (-> this action)) + (format #t "~1Tslot: ~D~%" (-> this slot)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc index 3655c86c54..4b61a6f7a7 100644 --- a/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc @@ -39,20 +39,20 @@ ) ;; definition for method 3 of type path-control -(defmethod inspect path-control ((obj path-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect path-control ((this path-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X~%" (-> obj flags)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tcurve: #~%" (-> obj curve)) - (format #t "~1Tnum-cverts: ~D~%" (-> obj curve num-cverts)) - (format #t "~1Tcverts: #x~X~%" (-> obj curve cverts)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X~%" (-> this flags)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tcurve: #~%" (-> this curve)) + (format #t "~1Tnum-cverts: ~D~%" (-> this curve num-cverts)) + (format #t "~1Tcverts: #x~X~%" (-> this curve cverts)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -71,20 +71,20 @@ ) ;; definition for method 3 of type curve-control -(defmethod inspect curve-control ((obj curve-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect curve-control ((this curve-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X~%" (-> obj flags)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tcurve: #~%" (-> obj curve)) - (format #t "~1Tnum-cverts: ~D~%" (-> obj curve num-cverts)) - (format #t "~1Tcverts: #x~X~%" (-> obj curve cverts)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X~%" (-> this flags)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tcurve: #~%" (-> this curve)) + (format #t "~1Tnum-cverts: ~D~%" (-> this curve num-cverts)) + (format #t "~1Tcverts: #x~X~%" (-> this curve cverts)) (label cfg-4) - obj + this ) ;; definition for method 0 of type path-control @@ -169,28 +169,28 @@ ) ;; definition for method 25 of type path-control -(defmethod should-display-marks? path-control ((obj path-control)) - (and *display-path-marks* (logtest? (-> obj flags) (path-control-flag display))) +(defmethod should-display-marks? path-control ((this path-control)) + (and *display-path-marks* (logtest? (-> this flags) (path-control-flag display))) ) ;; definition for method 17 of type path-control -(defmethod get-num-segments path-control ((obj path-control)) - (the float (+ (-> obj curve num-cverts) -1)) +(defmethod get-num-segments path-control ((this path-control)) + (the float (+ (-> this curve num-cverts) -1)) ) ;; definition for method 19 of type path-control -(defmethod get-num-verts path-control ((obj path-control)) - (-> obj curve num-cverts) +(defmethod get-num-verts path-control ((this path-control)) + (-> this curve num-cverts) ) ;; definition for method 20 of type path-control -(defmethod path-distance-equal-spacing path-control ((obj path-control) (arg0 float)) - (* arg0 (get-num-segments obj)) +(defmethod path-distance-equal-spacing path-control ((this path-control) (arg0 float)) + (* arg0 (get-num-segments this)) ) ;; definition for method 21 of type path-control -(defmethod average-segment-length path-control ((obj path-control) (arg0 float)) - (/ arg0 (get-num-segments obj)) +(defmethod average-segment-length path-control ((this path-control) (arg0 float)) + (/ arg0 (get-num-segments this)) ) ;; definition for method 0 of type curve-control diff --git a/test/decompiler/reference/jak2/engine/geometry/path_REF.gc b/test/decompiler/reference/jak2/engine/geometry/path_REF.gc index 7bb591968e..ed0ed49ce4 100644 --- a/test/decompiler/reference/jak2/engine/geometry/path_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/path_REF.gc @@ -3,46 +3,46 @@ ;; definition for method 9 of type path-control ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw path-control ((obj path-control)) +(defmethod debug-draw path-control ((this path-control)) (cond - ((logtest? (-> obj flags) (path-control-flag not-found)) - (when (and (type? (-> obj process) process-drawable) *display-entity-errors*) + ((logtest? (-> this flags) (path-control-flag not-found)) + (when (and (type? (-> this process) process-drawable) *display-entity-errors*) (let ((s5-0 add-debug-text-3d) (s4-0 #t) (s3-0 318) ) - (format (clear *temp-string*) "path data error in ~S" (-> obj process name)) + (format (clear *temp-string*) "path data error in ~S" (-> this process name)) (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* - (-> obj process root trans) + (-> this process root trans) (font-color red) (the-as vector2h #f) ) ) ) ) - ((let ((a0-5 obj)) + ((let ((a0-5 this)) (and *display-path-marks* (logtest? (-> a0-5 flags) (path-control-flag display))) ) - (dotimes (s5-1 (-> obj curve num-cverts)) - (let ((s4-1 (-> obj curve cverts s5-1))) - (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (< s5-1 (+ (-> obj curve num-cverts) -1))) + (dotimes (s5-1 (-> this curve num-cverts)) + (let ((s4-1 (-> this curve cverts s5-1))) + (if (and (logtest? (-> this flags) (path-control-flag draw-line)) (< s5-1 (+ (-> this curve num-cverts) -1))) (add-debug-line #t (bucket-id debug-no-zbuf1) s4-1 - (-> obj curve cverts (+ s5-1 1)) + (-> this curve cverts (+ s5-1 1)) (new 'static 'rgba :r #xff :g #x80 :a #x80) #f (the-as rgba -1) ) ) - (if (logtest? (-> obj flags) (path-control-flag draw-point)) + (if (logtest? (-> this flags) (path-control-flag draw-point)) (add-debug-x #t (bucket-id debug-no-zbuf1) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) - (when (logtest? (-> obj flags) (path-control-flag draw-text)) + (when (logtest? (-> this flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) (s2-1 #t) (s1-0 318) @@ -60,25 +60,25 @@ ) ;; definition for method 18 of type path-control -(defmethod total-distance path-control ((obj path-control)) +(defmethod total-distance path-control ((this path-control)) "Calcuate the total path length by summing the distance between each adjacent [[curve]] vertex" (let ((f30-0 0.0)) - (dotimes (s5-0 (+ (-> obj curve num-cverts) -1)) - (+! f30-0 (vector-vector-distance (-> obj curve cverts s5-0) (-> obj curve cverts (+ s5-0 1)))) + (dotimes (s5-0 (+ (-> this curve num-cverts) -1)) + (+! f30-0 (vector-vector-distance (-> this curve cverts s5-0) (-> this curve cverts (+ s5-0 1)))) ) f30-0 ) ) ;; definition for method 18 of type curve-control -(defmethod total-distance curve-control ((obj curve-control)) +(defmethod total-distance curve-control ((this curve-control)) "Will lazily calculate and set the [[curve]]'s `length` @returns total path length of the [[curve]] @see [[curve-length]]" - (let ((f0-0 (-> obj curve length))) + (let ((f0-0 (-> this curve length))) (when (= f0-0 0.0) - (set! f0-0 (curve-length (-> obj curve))) - (set! (-> obj curve length) f0-0) + (set! f0-0 (curve-length (-> this curve))) + (set! (-> this curve length) f0-0) ) f0-0 ) @@ -86,7 +86,7 @@ ;; definition for method 10 of type path-control ;; INFO: Used lq/sq -(defmethod get-point-in-path! path-control ((obj path-control) (ret vector) (idx float) (search-type symbol)) +(defmethod get-point-in-path! path-control ((this path-control) (ret vector) (idx float) (search-type symbol)) "Depending on the value of `idx`, the result can be quite different: - if `idx` is less than `0.0` - return the first vertex in the path - if `idx` is greater than the number of vertices in the path, return the last vertex @@ -98,24 +98,24 @@ using the fractional component of `idx` as the interpolant, return this result @param idx Either the vertex index or also partially the interpolant in a LERP @param search-type The only recognized value is `exact` @returns Either a distinct vertex along the path, or some fractional point between two vertices" - (let ((num-vertices (-> obj curve num-cverts)) + (let ((num-vertices (-> this curve num-cverts)) (vert-idx (the float (the int idx))) ) (cond ((< idx 0.0) - (set! (-> ret quad) (-> obj curve cverts 0 quad)) + (set! (-> ret quad) (-> this curve cverts 0 quad)) ) ((>= vert-idx (the float (+ num-vertices -1))) - (set! (-> ret quad) (-> obj curve cverts (+ num-vertices -1) quad)) + (set! (-> ret quad) (-> this curve cverts (+ num-vertices -1) quad)) ) ((or (= search-type 'exact) (= vert-idx idx)) - (set! (-> ret quad) (-> obj curve cverts (the int vert-idx) quad)) + (set! (-> ret quad) (-> this curve cverts (the int vert-idx) quad)) ) (else (vector-lerp! ret - (-> obj curve cverts (the int vert-idx)) - (-> obj curve cverts (the int (+ 1.0 vert-idx))) + (-> this curve cverts (the int vert-idx)) + (-> this curve cverts (the int (+ 1.0 vert-idx))) (- idx vert-idx) ) ) @@ -126,12 +126,12 @@ using the fractional component of `idx` as the interpolant, return this result ;; definition for method 11 of type path-control ;; INFO: Used lq/sq -(defmethod get-random-point path-control ((obj path-control) (arg0 vector)) +(defmethod get-random-point path-control ((this path-control) (arg0 vector)) "Attempts to retrieve a random point along the path, returns the [[*null-vector*]] if no vertices are defined" (cond - ((> (-> obj curve num-cverts) 0) - (let ((a0-2 (rand-vu-int-count (-> obj curve num-cverts)))) - (set! (-> arg0 quad) (-> obj curve cverts a0-2 quad)) + ((> (-> this curve num-cverts) 0) + (let ((a0-2 (rand-vu-int-count (-> this curve num-cverts)))) + (set! (-> arg0 quad) (-> this curve cverts a0-2 quad)) ) ) (else @@ -146,37 +146,37 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 14 of type path-control -(defmethod get-point-at-percent-along-path! path-control ((obj path-control) (ret vector) (percent float) (search-type symbol)) +(defmethod get-point-at-percent-along-path! path-control ((this path-control) (ret vector) (percent float) (search-type symbol)) "@param! ret The [[vector]] that is used to hold the return value @param percent The percentage along the path @param search-type The only recognized value is `exact` @returns the point closest to some arbitrary percentage along the path @see [[path-control::10]]" - (get-point-in-path! obj ret (* percent (the float (+ (-> obj curve num-cverts) -1))) search-type) + (get-point-in-path! this ret (* percent (the float (+ (-> this curve num-cverts) -1))) search-type) ) ;; definition for method 14 of type curve-control -(defmethod get-point-at-percent-along-path! curve-control ((obj curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod get-point-at-percent-along-path! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) "@param! ret The [[vector]] that is used to hold the return value @param percent The percentage along the path @param search-type The only recognized value is `exact` @returns the point closest to some arbitrary percentage along the path @see [[path-control::10]]" - (if (not (logtest? (-> obj flags) (path-control-flag not-found))) + (if (not (logtest? (-> this flags) (path-control-flag not-found))) (curve-evaluate! arg0 arg1 - (-> obj curve cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) ) arg0 ) ;; definition for method 10 of type curve-control -(defmethod get-point-in-path! curve-control ((obj curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) +(defmethod get-point-in-path! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 symbol)) "Depending on the value of `idx`, the result can be quite different: - if `idx` is less than `0.0` - return the first vertex in the path - if `idx` is greater than the number of vertices in the path, return the last vertex @@ -188,21 +188,21 @@ using the fractional component of `idx` as the interpolant, return this result @param idx Either the vertex index or also partially the interpolant in a LERP @param search-type The only recognized value is `exact` @returns Either a distinct vertex along the path, or some fractional point between two vertices" - (if (not (logtest? (-> obj flags) (path-control-flag not-found))) + (if (not (logtest? (-> this flags) (path-control-flag not-found))) (curve-evaluate! arg0 - (/ arg1 (the float (+ (-> obj curve num-cverts) -1))) - (-> obj curve cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (/ arg1 (the float (+ (-> this curve num-cverts) -1))) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) ) arg0 ) ;; definition for method 26 of type path-control -(defmethod displacement-between-two-points! path-control ((obj path-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-two-points! path-control ((this path-control) (ret vector) (idx float) (mag float)) "Return value can differ quite a bit: - If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]] - Otherwise, find the scaled (by `mag`) displacement vector between two points in the path: @@ -213,16 +213,16 @@ using the fractional component of `idx` as the interpolant, return this result @param idx The vertex index @param mag The magnitude to scale the resulting displacement vector by @returns The displacement [[vector]] between two points in the path, the last 2, or the [[*null-vector*]]" - (let ((num-vertices (-> obj curve num-cverts)) + (let ((num-vertices (-> this curve num-cverts)) (vert-idx (the float (the int idx))) ) (cond - ((or (logtest? (-> obj flags) (path-control-flag not-found)) (< num-vertices 2) (< idx 0.0)) + ((or (logtest? (-> this flags) (path-control-flag not-found)) (< num-vertices 2) (< idx 0.0)) (vector-reset! ret) ) (else (let ((capped-idx (fmin vert-idx (the float (+ num-vertices -2))))) - (vector-! ret (-> obj curve cverts (the int (+ 1.0 capped-idx))) (-> obj curve cverts (the int capped-idx))) + (vector-! ret (-> this curve cverts (the int (+ 1.0 capped-idx))) (-> this curve cverts (the int capped-idx))) ) (vector-float*! ret ret mag) ) @@ -232,51 +232,55 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 12 of type path-control -(defmethod displacement-between-two-points-copy! path-control ((obj path-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-two-points-copy! path-control ((this path-control) (ret vector) (idx float) (mag float)) "Calls [[path-control::26]] with the provided args @see [[path-control::26]]" - (displacement-between-two-points! obj ret idx mag) + (displacement-between-two-points! this ret idx mag) ) ;; definition for method 15 of type path-control -(defmethod displacement-between-points-at-percent-scaled! path-control ((obj path-control) (ret vector) (percent float) (mag float)) +(defmethod displacement-between-points-at-percent-scaled! path-control ((this path-control) (ret vector) (percent float) (mag float)) "Calls [[path-control::12], with the `idx` at a given percent along the path @param ret The [[vector]] that is used to hold the return value @param percent The percentage along the path to find the first index @param mag Multiplied by the number of points in the path and scales the resulting vector @returns The displacement between the last two points of the path scaled to the magnitude equal to the number of points in the path" (displacement-between-two-points-copy! - obj + this ret - (* percent (the float (+ (-> obj curve num-cverts) -1))) - (* mag (the float (+ (-> obj curve num-cverts) -1))) + (* percent (the float (+ (-> this curve num-cverts) -1))) + (* mag (the float (+ (-> this curve num-cverts) -1))) ) ) ;; definition for method 13 of type path-control -(defmethod displacement-between-two-points-normalized! path-control ((obj path-control) (ret vector) (idx float)) +(defmethod displacement-between-two-points-normalized! path-control ((this path-control) (ret vector) (idx float)) "Calls [[path-control::26], with the provided `idx` @param! ret The [[vector]] the result is stored within @param idx The vertex index @returns The resulting displacement vector, normalized @see [[path-control::26]]" - (displacement-between-two-points! obj ret idx 1.0) + (displacement-between-two-points! this ret idx 1.0) (vector-normalize! ret 1.0) ) ;; definition for method 16 of type path-control -(defmethod displacement-between-points-at-percent-normalized! path-control ((obj path-control) (ret vector) (percent float)) +(defmethod displacement-between-points-at-percent-normalized! path-control ((this path-control) (ret vector) (percent float)) "Calls [[path-control::13], with the `idx` at a given percent along the path @param! ret The [[vector]] the result is stored within @param percent The percentage along the path @returns The resulting displacement vector, normalized @see [[path-control::13]] @see [[path-control::14]]" - (displacement-between-two-points-normalized! obj ret (* percent (the float (+ (-> obj curve num-cverts) -1)))) + (displacement-between-two-points-normalized! + this + ret + (* percent (the float (+ (-> this curve num-cverts) -1))) + ) ) ;; definition for method 26 of type curve-control -(defmethod displacement-between-two-points! curve-control ((obj curve-control) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod displacement-between-two-points! curve-control ((this curve-control) (arg0 vector) (arg1 float) (arg2 float)) "Return value can differ quite a bit: - If [[path-control-flag::4]] is set OR there are less than 2 vertices OR `idx` is less than `0.0` - return [[*null-vector*]] - Otherwise, find the scaled (by `mag`) displacement vector between two points in the path: @@ -287,25 +291,25 @@ using the fractional component of `idx` as the interpolant, return this result @param idx The vertex index @param mag The magnitude to scale the resulting displacement vector by @returns The displacement [[vector]] between two points in the path, the last 2, or the [[*null-vector*]]" - (when (not (logtest? (-> obj flags) (path-control-flag not-found))) + (when (not (logtest? (-> this flags) (path-control-flag not-found))) (let ((s4-0 (new 'stack-no-clear 'vector))) (curve-evaluate! arg0 arg1 - (-> obj curve cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) (cond ((< arg1 (- 1.0 arg2)) (curve-evaluate! s4-0 (+ arg1 arg2) - (-> obj curve cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) (vector-! arg0 s4-0 arg0) ) @@ -313,10 +317,10 @@ using the fractional component of `idx` as the interpolant, return this result (curve-evaluate! s4-0 (- arg1 arg2) - (-> obj curve cverts) - (-> obj curve num-cverts) - (-> obj curve knots) - (-> obj curve num-knots) + (-> this curve cverts) + (-> this curve num-cverts) + (-> this curve knots) + (-> this curve num-knots) ) (vector-! arg0 arg0 s4-0) ) @@ -326,46 +330,46 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 12 of type curve-control -(defmethod displacement-between-two-points-copy! curve-control ((obj curve-control) (ret vector) (percent float) (mag float)) +(defmethod displacement-between-two-points-copy! curve-control ((this curve-control) (ret vector) (percent float) (mag float)) "Calls [[path-control::26]] with the `idx` at a given percent along the path @see [[path-control::26]]" - (displacement-between-two-points! obj ret (/ percent (the float (+ (-> obj curve num-cverts) -1))) mag) + (displacement-between-two-points! this ret (/ percent (the float (+ (-> this curve num-cverts) -1))) mag) ) ;; definition for method 15 of type curve-control -(defmethod displacement-between-points-at-percent-scaled! curve-control ((obj curve-control) (ret vector) (idx float) (mag float)) +(defmethod displacement-between-points-at-percent-scaled! curve-control ((this curve-control) (ret vector) (idx float) (mag float)) "Calls [[path-control::12], with the `idx` at a given percent along the path @param ret The [[vector]] that is used to hold the return value @param percent The percentage along the path to find the first index @param mag Multiplied by the number of points in the path and scales the resulting vector @returns The displacement between the last two points of the path scaled to the magnitude equal to the number of points in the path" - (displacement-between-two-points! obj ret idx mag) + (displacement-between-two-points! this ret idx mag) ) ;; definition for method 16 of type curve-control -(defmethod displacement-between-points-at-percent-normalized! curve-control ((obj curve-control) (ret vector) (percent float)) +(defmethod displacement-between-points-at-percent-normalized! curve-control ((this curve-control) (ret vector) (percent float)) "Calls [[path-control::13], with the `idx` at a given percent along the path @param! ret The [[vector]] the result is stored within @param percent The percentage along the path @returns The resulting displacement vector, normalized @see [[path-control::13]] @see [[path-control::14]]" - (displacement-between-two-points! obj ret percent 0.01) + (displacement-between-two-points! this ret percent 0.01) (vector-normalize! ret 1.0) ) ;; definition for method 13 of type curve-control -(defmethod displacement-between-two-points-normalized! curve-control ((obj curve-control) (ret vector) (idx float)) +(defmethod displacement-between-two-points-normalized! curve-control ((this curve-control) (ret vector) (idx float)) "@see [[curve-control::12]]" (displacement-between-points-at-percent-normalized! - obj + this ret - (/ idx (the float (+ (-> obj curve num-cverts) -1))) + (/ idx (the float (+ (-> this curve num-cverts) -1))) ) ) ;; definition for method 22 of type path-control ;; INFO: Used lq/sq -(defmethod get-furthest-point-on-path path-control ((obj path-control) (point vector)) +(defmethod get-furthest-point-on-path path-control ((this path-control) (point vector)) "@param point The point to calculate distance from @returns the `vertex-idx.interpolant` value to the point on the path furthest away from the `point` @see [[path-control::10]]" @@ -378,11 +382,11 @@ using the fractional component of `idx` as the interpolant, return this result (let ((closest-point (new 'stack-no-clear 'vector))) (set! (-> given-point quad) (-> point quad)) (set! (-> given-point y) 0.0) - (get-point-in-path! obj next-point 0.0 'interp) + (get-point-in-path! this next-point 0.0 'interp) (set! (-> next-point y) 0.0) - (dotimes (idx (+ (-> obj curve num-cverts) -1)) + (dotimes (idx (+ (-> this curve num-cverts) -1)) (set! (-> curr-point quad) (-> next-point quad)) - (get-point-in-path! obj next-point (the float (+ idx 1)) 'interp) + (get-point-in-path! this next-point (the float (+ idx 1)) 'interp) (set! (-> next-point y) 0.0) (let ((dist-to-point (vector-segment-distance-point! given-point curr-point next-point closest-point))) (when (< dist-to-point furthest-dist) @@ -401,47 +405,53 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 23 of type path-control -(defmethod get-path-percentage-at-furthest-point path-control ((obj path-control) (point vector)) +(defmethod get-path-percentage-at-furthest-point path-control ((this path-control) (point vector)) "@param point The point to calculate distance from @returns the percentage of path completion from the point on the path furthest away from the `point` @see [[path-control::14]]" - (/ (get-furthest-point-on-path obj point) (the float (+ (-> obj curve num-cverts) -1))) + (/ (get-furthest-point-on-path this point) (the float (+ (-> this curve num-cverts) -1))) ) ;; definition for method 9 of type curve-control ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw curve-control ((obj curve-control)) +(defmethod debug-draw curve-control ((this curve-control)) (cond - ((logtest? (-> obj flags) (path-control-flag not-found)) - (when (and (type? (-> obj process) process-drawable) *display-entity-errors*) + ((logtest? (-> this flags) (path-control-flag not-found)) + (when (and (type? (-> this process) process-drawable) *display-entity-errors*) (let ((s5-0 add-debug-text-3d) (s4-0 #t) (s3-0 318) ) - (format (clear *temp-string*) "curve data error in ~S" (-> obj process name)) + (format (clear *temp-string*) "curve data error in ~S" (-> this process name)) (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* - (-> obj process root trans) + (-> this process root trans) (font-color red) (the-as vector2h #f) ) ) ) ) - ((let ((a0-5 obj)) + ((let ((a0-5 this)) (and *display-path-marks* (logtest? (-> a0-5 flags) (path-control-flag display))) ) - (if (and (logtest? (-> obj flags) (path-control-flag draw-line)) (> (-> obj curve num-cverts) 0)) - (add-debug-curve2 #t (bucket-id debug-no-zbuf1) (-> obj curve) (new 'static 'rgba :r #xff :g #x80 :a #x80) #f) + (if (and (logtest? (-> this flags) (path-control-flag draw-line)) (> (-> this curve num-cverts) 0)) + (add-debug-curve2 + #t + (bucket-id debug-no-zbuf1) + (-> this curve) + (new 'static 'rgba :r #xff :g #x80 :a #x80) + #f + ) ) - (dotimes (s5-1 (-> obj curve num-cverts)) - (let ((s4-1 (-> obj curve cverts s5-1))) - (if (logtest? (-> obj flags) (path-control-flag draw-point)) + (dotimes (s5-1 (-> this curve num-cverts)) + (let ((s4-1 (-> this curve cverts s5-1))) + (if (logtest? (-> this flags) (path-control-flag draw-point)) (add-debug-x #t (bucket-id debug-no-zbuf1) s4-1 (new 'static 'rgba :r #xff :a #x80)) ) - (when (logtest? (-> obj flags) (path-control-flag draw-text)) + (when (logtest? (-> this flags) (path-control-flag draw-text)) (let ((s3-1 add-debug-text-3d) (s2-1 #t) (s1-0 318) @@ -459,23 +469,23 @@ using the fractional component of `idx` as the interpolant, return this result ) ;; definition for method 24 of type path-control -(defmethod path-control-method-24 path-control ((obj path-control) (arg0 vector)) +(defmethod path-control-method-24 path-control ((this path-control) (arg0 vector)) "TODO" - (let ((s4-0 (-> obj curve num-cverts))) + (let ((s4-0 (-> this curve num-cverts))) (let ((f30-0 (/ 1.0 (the float s4-0)))) (set-vector! arg0 0.0 0.0 0.0 0.0) (dotimes (s3-0 s4-0) (vector+float*! arg0 arg0 - (get-point-in-path! obj (new 'stack-no-clear 'vector) (the float s3-0) 'interp) + (get-point-in-path! this (new 'stack-no-clear 'vector) (the float s3-0) 'interp) f30-0 ) ) ) (dotimes (s3-1 s4-0) (let ((f0-10 - (vector-vector-distance arg0 (get-point-in-path! obj (new 'stack-no-clear 'vector) (the float s3-1) 'interp)) + (vector-vector-distance arg0 (get-point-in-path! this (new 'stack-no-clear 'vector) (the float s3-1) 'interp)) ) ) (if (< (-> arg0 w) f0-10) diff --git a/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc index 4fbef45ecb..da1ef2d1dd 100644 --- a/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc @@ -23,21 +23,21 @@ ) ;; definition for method 3 of type plane-volume -(defmethod inspect plane-volume ((obj plane-volume)) - (when (not obj) - (set! obj obj) +(defmethod inspect plane-volume ((this plane-volume)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'plane-volume) - (format #t "~1Tvolume-type: ~A~%" (-> obj volume-type)) - (format #t "~1Tpoint-count: ~D~%" (-> obj point-count)) - (format #t "~1Tnormal-count: ~D~%" (-> obj normal-count)) - (format #t "~1Tfirst-point: #~%" (-> obj first-point)) - (format #t "~1Tfirst-normal: #~%" (-> obj first-normal)) - (format #t "~1Tnum-planes: ~D~%" (-> obj num-planes)) - (format #t "~1Tplane: #x~X~%" (-> obj plane)) + (format #t "[~8x] ~A~%" this 'plane-volume) + (format #t "~1Tvolume-type: ~A~%" (-> this volume-type)) + (format #t "~1Tpoint-count: ~D~%" (-> this point-count)) + (format #t "~1Tnormal-count: ~D~%" (-> this normal-count)) + (format #t "~1Tfirst-point: #~%" (-> this first-point)) + (format #t "~1Tfirst-normal: #~%" (-> this first-normal)) + (format #t "~1Tnum-planes: ~D~%" (-> this num-planes)) + (format #t "~1Tplane: #x~X~%" (-> this plane)) (label cfg-4) - obj + this ) ;; definition of type vol-control @@ -63,22 +63,22 @@ ) ;; definition for method 3 of type vol-control -(defmethod inspect vol-control ((obj vol-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect vol-control ((this vol-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X~%" (-> obj flags)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tpos-vol-count: ~D~%" (-> obj pos-vol-count)) - (format #t "~1Tpos-vol[32] @ #x~X~%" (-> obj pos-vol)) - (format #t "~1Tneg-vol-count: ~D~%" (-> obj neg-vol-count)) - (format #t "~1Tneg-vol[32] @ #x~X~%" (-> obj neg-vol)) - (format #t "~1Tdebug-point: ~A~%" (-> obj debug-point)) - (format #t "~1Tdebug-normal: ~A~%" (-> obj debug-normal)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X~%" (-> this flags)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tpos-vol-count: ~D~%" (-> this pos-vol-count)) + (format #t "~1Tpos-vol[32] @ #x~X~%" (-> this pos-vol)) + (format #t "~1Tneg-vol-count: ~D~%" (-> this neg-vol-count)) + (format #t "~1Tneg-vol[32] @ #x~X~%" (-> this neg-vol)) + (format #t "~1Tdebug-point: ~A~%" (-> this debug-point)) + (format #t "~1Tdebug-normal: ~A~%" (-> this debug-normal)) (label cfg-4) - obj + this ) ;; definition for method 0 of type vol-control @@ -142,7 +142,7 @@ ) ;; definition for method 11 of type vol-control -(defmethod should-display? vol-control ((obj vol-control)) +(defmethod should-display? vol-control ((this vol-control)) "Returns true/false if the volume's marks should be displayed" - (and *display-vol-marks* (logtest? (-> obj flags) (vol-flags display?))) + (and *display-vol-marks* (logtest? (-> this flags) (vol-flags display?))) ) diff --git a/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc b/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc index 1ced9a7e46..8377f3fc8d 100644 --- a/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc @@ -44,7 +44,7 @@ ;; WARN: Stack slot offset 148 signed mismatch ;; WARN: Stack slot offset 148 signed mismatch ;; WARN: Stack slot offset 148 signed mismatch -(defmethod plane-volume-method-9 plane-volume ((obj plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) +(defmethod plane-volume-method-9 plane-volume ((this plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) (local-vars (sv-144 vector) (sv-148 number) @@ -57,12 +57,12 @@ (sv-240 int) (sv-256 int) ) - (set! (-> obj volume-type) arg0) - (set! (-> obj point-count) 0) - (set! (-> obj first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) - (set! (-> obj normal-count) 0) - (set! (-> obj first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) - (dotimes (s3-0 (-> obj num-planes)) + (set! (-> this volume-type) arg0) + (set! (-> this point-count) 0) + (set! (-> this first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) + (set! (-> this normal-count) 0) + (set! (-> this first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) + (dotimes (s3-0 (-> this num-planes)) (set! sv-176 (new 'stack-no-clear 'vector)) (set! (-> sv-176 quad) (the-as uint128 0)) (set! sv-192 (new 'stack-no-clear 'vector)) @@ -77,10 +77,10 @@ (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) (let ((s1-0 (new-stack-vector0)) (s0-0 0) - (s2-0 (-> obj plane)) + (s2-0 (-> this plane)) ) (set! sv-240 0) - (while (< sv-240 (-> obj num-planes)) + (while (< sv-240 (-> this num-planes)) (when (!= s3-0 sv-240) (vector-float*! sv-176 (the-as vector (-> s2-0 sv-240)) (-> s2-0 sv-240 w)) (vector-cross! sv-192 (the-as vector (-> s2-0 sv-240)) (the-as vector (-> s2-0 s3-0))) @@ -96,7 +96,7 @@ (set! sv-160 (new-stack-vector0)) (set! (-> sv-144 quad) (-> sv-224 quad)) (set! sv-256 0) - (while (< sv-256 (-> obj num-planes)) + (while (< sv-256 (-> this num-planes)) (when (and (!= sv-256 s3-0) (!= sv-256 sv-240)) (let ((f0-6 (plane-volume-intersect-dist (-> s2-0 sv-256) sv-144 sv-192))) (cond @@ -136,7 +136,7 @@ ((= (the-as float sv-148) 0.0) ) (else - (dotimes (v1-79 (-> obj num-planes)) + (dotimes (v1-79 (-> this num-planes)) (when (and (!= v1-79 s3-0) (!= v1-79 sv-240)) (if (< 4096.0 (- (vector-dot sv-144 (the-as vector (-> s2-0 v1-79))) (-> s2-0 v1-79 w))) (goto cfg-42) @@ -146,13 +146,13 @@ (vector+float*! sv-224 sv-144 sv-192 (the-as float sv-148)) (cond ((< (-> arg1 allocated-length) (+ (-> arg1 length) 2)) - (format 0 "ERROR : vol-control #x~X out of volume points~%" obj) + (format 0 "ERROR : vol-control #x~X out of volume points~%" this) ) (else (set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad)) (set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad)) (+! (-> arg1 length) 2) - (+! (-> obj point-count) 2) + (+! (-> this point-count) 2) ) ) (vector+! s1-0 s1-0 sv-144) @@ -170,25 +170,25 @@ (vector-float*! s1-0 s1-0 (/ 1.0 (the float s0-0))) (cond ((< (-> arg2 allocated-length) (+ (-> arg2 length) 2)) - (format 0 "ERROR : vol-control #x~X out of volume normals~%" obj) + (format 0 "ERROR : vol-control #x~X out of volume normals~%" this) ) (else (set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad)) (set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad)) (+! (-> arg2 length) 2) - (set! (-> obj normal-count) (+ (-> obj normal-count) 2)) + (set! (-> this normal-count) (+ (-> this normal-count) 2)) ) ) ) ) ) - obj + this ) ;; definition for method 10 of type plane-volume ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw plane-volume ((obj plane-volume)) - (let* ((v1-0 (-> obj volume-type)) +(defmethod debug-draw plane-volume ((this plane-volume)) + (let* ((v1-0 (-> this volume-type)) (s5-0 (cond ((= v1-0 'vol) (the-as uint #x8000c000) @@ -201,9 +201,9 @@ ) ) ) - (s4-0 (-> obj first-point)) + (s4-0 (-> this first-point)) ) - (dotimes (s3-0 (/ (-> obj point-count) 2)) + (dotimes (s3-0 (/ (-> this point-count) 2)) (add-debug-line #t (bucket-id debug-no-zbuf1) @@ -221,10 +221,10 @@ ) ;; definition for method 11 of type plane-volume -(defmethod point-in-vol? plane-volume ((obj plane-volume) (arg0 vector) (arg1 float)) +(defmethod point-in-vol? plane-volume ((this plane-volume) (arg0 vector) (arg1 float)) "TODO - Checks if the given [[vector]] point is inside the volume defined by 6 [[plane]]s by atleast the padding value provided" - (dotimes (v1-0 (-> obj num-planes)) - (if (< arg1 (- (vector-dot arg0 (the-as vector (-> obj plane v1-0))) (-> obj plane v1-0 w))) + (dotimes (v1-0 (-> this num-planes)) + (if (< arg1 (- (vector-dot arg0 (the-as vector (-> this plane v1-0))) (-> this plane v1-0 w))) (return #f) ) ) @@ -233,41 +233,41 @@ ;; definition for method 9 of type vol-control ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw vol-control ((obj vol-control)) +(defmethod debug-draw vol-control ((this vol-control)) (with-pp - (let ((a0-1 obj)) + (let ((a0-1 this)) (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) (vol-flags display?))) - (logtest? (-> obj flags) (vol-flags vol-flags-1)) + (logtest? (-> this flags) (vol-flags vol-flags-1)) ) - (when (zero? (-> obj debug-point)) + (when (zero? (-> this debug-point)) (let ((s5-0 pp)) - (set! pp (-> obj process)) + (set! pp (-> this process)) (let ((s4-0 0)) - (dotimes (v1-8 (-> obj pos-vol-count)) - (+! s4-0 (-> obj pos-vol v1-8 num-planes)) + (dotimes (v1-8 (-> this pos-vol-count)) + (+! s4-0 (-> this pos-vol v1-8 num-planes)) ) - (dotimes (v1-11 (-> obj neg-vol-count)) - (+! s4-0 (-> obj neg-vol v1-11 num-planes)) + (dotimes (v1-11 (-> this neg-vol-count)) + (+! s4-0 (-> this neg-vol v1-11 num-planes)) ) - (set! (-> obj debug-point) (new 'debug 'vector-array (* 10 s4-0))) - (set! (-> obj debug-normal) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> this debug-point) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> this debug-normal) (new 'debug 'vector-array (* 10 s4-0))) ) (set! pp s5-0) ) - (set! (-> obj debug-point length) 0) - (set! (-> obj debug-normal length) 0) - (dotimes (s5-1 (-> obj pos-vol-count)) - (plane-volume-method-9 (-> obj pos-vol s5-1) 'vol (-> obj debug-point) (-> obj debug-normal)) + (set! (-> this debug-point length) 0) + (set! (-> this debug-normal length) 0) + (dotimes (s5-1 (-> this pos-vol-count)) + (plane-volume-method-9 (-> this pos-vol s5-1) 'vol (-> this debug-point) (-> this debug-normal)) ) - (dotimes (s5-2 (-> obj neg-vol-count)) - (plane-volume-method-9 (-> obj neg-vol s5-2) 'vol (-> obj debug-point) (-> obj debug-normal)) + (dotimes (s5-2 (-> this neg-vol-count)) + (plane-volume-method-9 (-> this neg-vol s5-2) 'vol (-> this debug-point) (-> this debug-normal)) ) ) - (dotimes (s5-3 (-> obj pos-vol-count)) - (debug-draw (-> obj pos-vol s5-3)) + (dotimes (s5-3 (-> this pos-vol-count)) + (debug-draw (-> this pos-vol s5-3)) ) - (dotimes (s5-4 (-> obj neg-vol-count)) - (debug-draw (-> obj neg-vol s5-4)) + (dotimes (s5-4 (-> this neg-vol-count)) + (debug-draw (-> this neg-vol s5-4)) ) ) ) @@ -277,14 +277,14 @@ ) ;; definition for method 10 of type vol-control -(defmethod vol-control-method-10 vol-control ((obj vol-control) (arg0 plane)) - (dotimes (s4-0 (-> obj neg-vol-count)) - (if (point-in-vol? (-> obj neg-vol s4-0) arg0 0.0) +(defmethod vol-control-method-10 vol-control ((this vol-control) (arg0 plane)) + (dotimes (s4-0 (-> this neg-vol-count)) + (if (point-in-vol? (-> this neg-vol s4-0) arg0 0.0) (return #f) ) ) - (dotimes (s4-1 (-> obj pos-vol-count)) - (if (point-in-vol? (-> obj pos-vol s4-1) arg0 0.0) + (dotimes (s4-1 (-> this pos-vol-count)) + (if (point-in-vol? (-> this pos-vol s4-1) arg0 0.0) (return #t) ) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc index 2ba5eee2e1..0e5ea64bb2 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc @@ -28,37 +28,33 @@ ) ;; definition for method 3 of type background-work -(defmethod inspect background-work ((obj background-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect background-work ((this background-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttfrag-tree-count: ~D~%" (-> obj tfrag-tree-count)) - (format #t "~1Ttfrag-trees[8] @ #x~X~%" (-> obj tfrag-trees)) - (format #t "~1Ttfrag-levels[8] @ #x~X~%" (-> obj tfrag-levels)) - (format #t "~1Ttfrag-trans-tree-count: ~D~%" (-> obj tfrag-trans-tree-count)) - (format #t "~1Ttfrag-trans-trees[8] @ #x~X~%" (-> obj tfrag-trans-trees)) - (format #t "~1Ttfrag-trans-levels[8] @ #x~X~%" (-> obj tfrag-trans-levels)) - (format #t "~1Ttfrag-water-tree-count: ~D~%" (-> obj tfrag-water-tree-count)) - (format #t "~1Ttfrag-water-trees[8] @ #x~X~%" (-> obj tfrag-water-trees)) - (format #t "~1Ttfrag-water-levels[8] @ #x~X~%" (-> obj tfrag-water-levels)) - (format #t "~1Tshrub-tree-count: ~D~%" (-> obj shrub-tree-count)) - (format #t "~1Tshrub-trees[8] @ #x~X~%" (-> obj shrub-trees)) - (format #t "~1Tshrub-levels[8] @ #x~X~%" (-> obj shrub-levels)) - (format #t "~1Ttie-tree-count: ~D~%" (-> obj tie-tree-count)) - (format #t "~1Ttie-trees[8] @ #x~X~%" (-> obj tie-trees)) - (format #t "~1Ttie-levels[8] @ #x~X~%" (-> obj tie-levels)) - (format #t "~1Ttie-generic[8] @ #x~X~%" (-> obj tie-generic)) - (format #t "~1Ttie-generic-trans[8] @ #x~X~%" (-> obj tie-generic-trans)) - (format #t "~1Twait-to-vu0: ~D~%" (-> obj wait-to-vu0)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttfrag-tree-count: ~D~%" (-> this tfrag-tree-count)) + (format #t "~1Ttfrag-trees[8] @ #x~X~%" (-> this tfrag-trees)) + (format #t "~1Ttfrag-levels[8] @ #x~X~%" (-> this tfrag-levels)) + (format #t "~1Ttfrag-trans-tree-count: ~D~%" (-> this tfrag-trans-tree-count)) + (format #t "~1Ttfrag-trans-trees[8] @ #x~X~%" (-> this tfrag-trans-trees)) + (format #t "~1Ttfrag-trans-levels[8] @ #x~X~%" (-> this tfrag-trans-levels)) + (format #t "~1Ttfrag-water-tree-count: ~D~%" (-> this tfrag-water-tree-count)) + (format #t "~1Ttfrag-water-trees[8] @ #x~X~%" (-> this tfrag-water-trees)) + (format #t "~1Ttfrag-water-levels[8] @ #x~X~%" (-> this tfrag-water-levels)) + (format #t "~1Tshrub-tree-count: ~D~%" (-> this shrub-tree-count)) + (format #t "~1Tshrub-trees[8] @ #x~X~%" (-> this shrub-trees)) + (format #t "~1Tshrub-levels[8] @ #x~X~%" (-> this shrub-levels)) + (format #t "~1Ttie-tree-count: ~D~%" (-> this tie-tree-count)) + (format #t "~1Ttie-trees[8] @ #x~X~%" (-> this tie-trees)) + (format #t "~1Ttie-levels[8] @ #x~X~%" (-> this tie-levels)) + (format #t "~1Ttie-generic[8] @ #x~X~%" (-> this tie-generic)) + (format #t "~1Ttie-generic-trans[8] @ #x~X~%" (-> this tie-generic-trans)) + (format #t "~1Twait-to-vu0: ~D~%" (-> this wait-to-vu0)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc index 510315b7b5..32275fd645 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc @@ -1,5 +1,7 @@ +;;-*-Lisp-*- (in-package goal) +;; definition of type prototype-bucket (deftype prototype-bucket (basic) ((name string :offset-assert 4) (flags prototype-flags :offset-assert 8) @@ -23,32 +25,34 @@ :flag-assert #x900000040 ) -(defmethod inspect prototype-bucket ((obj prototype-bucket)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type prototype-bucket +(defmethod inspect prototype-bucket ((this prototype-bucket)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Ttexture-masks-index: ~D~%" (-> obj texture-masks-index)) - (format #t "~1Tin-level: ~D~%" (-> obj in-level)) - (format #t "~1Tutextures: ~D~%" (-> obj utextures)) - (format #t "~1Tgeometry[4] @ #x~X~%" (-> obj geometry)) - (format #t "~1Tdists: #~%" (-> obj dists)) - (format #t "~1Trdists: #~%" (-> obj rdists)) - (format #t "~1Tnear-plane: (meters ~m)~%" (-> obj dists x)) - (format #t "~1Tnear-stiff: (meters ~m)~%" (-> obj dists y)) - (format #t "~1Tmid-plane: (meters ~m)~%" (-> obj dists z)) - (format #t "~1Tfar-plane: (meters ~m)~%" (-> obj dists w)) - (format #t "~1Trlength-near: ~f~%" (-> obj rdists x)) - (format #t "~1Trlength-stiff: ~f~%" (-> obj rdists y)) - (format #t "~1Trlength-mid: ~f~%" (-> obj rdists z)) - (format #t "~1Tstiffness: ~f~%" (-> obj rdists w)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Ttexture-masks-index: ~D~%" (-> this texture-masks-index)) + (format #t "~1Tin-level: ~D~%" (-> this in-level)) + (format #t "~1Tutextures: ~D~%" (-> this utextures)) + (format #t "~1Tgeometry[4] @ #x~X~%" (-> this geometry)) + (format #t "~1Tdists: #~%" (-> this dists)) + (format #t "~1Trdists: #~%" (-> this rdists)) + (format #t "~1Tnear-plane: (meters ~m)~%" (-> this dists x)) + (format #t "~1Tnear-stiff: (meters ~m)~%" (-> this dists y)) + (format #t "~1Tmid-plane: (meters ~m)~%" (-> this dists z)) + (format #t "~1Tfar-plane: (meters ~m)~%" (-> this dists w)) + (format #t "~1Trlength-near: ~f~%" (-> this rdists x)) + (format #t "~1Trlength-stiff: ~f~%" (-> this rdists y)) + (format #t "~1Trlength-mid: ~f~%" (-> this rdists z)) + (format #t "~1Tstiffness: ~f~%" (-> this rdists w)) (label cfg-4) - obj + this ) +;; definition of type prototype-bucket-shrub (deftype prototype-bucket-shrub (prototype-bucket) ((next uint32 4 :offset-assert 64) (count uint16 4 :offset-assert 80) @@ -64,39 +68,42 @@ :flag-assert #x900000070 ) -(defmethod inspect prototype-bucket-shrub ((obj prototype-bucket-shrub)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type prototype-bucket-shrub +;; INFO: Used lq/sq +(defmethod inspect prototype-bucket-shrub ((this prototype-bucket-shrub)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Ttexture-masks-index: ~D~%" (-> obj texture-masks-index)) - (format #t "~1Tin-level: ~D~%" (-> obj in-level)) - (format #t "~1Tutextures: ~D~%" (-> obj utextures)) - (format #t "~1Tgeometry[4] @ #x~X~%" (-> obj geometry)) - (format #t "~1Tdists: #~%" (-> obj dists)) - (format #t "~1Trdists: #~%" (-> obj rdists)) - (format #t "~1Tnear-plane: (meters ~m)~%" (-> obj dists x)) - (format #t "~1Tnear-stiff: (meters ~m)~%" (-> obj dists y)) - (format #t "~1Tmid-plane: (meters ~m)~%" (-> obj dists z)) - (format #t "~1Tfar-plane: (meters ~m)~%" (-> obj dists w)) - (format #t "~1Trlength-near: ~f~%" (-> obj rdists x)) - (format #t "~1Trlength-stiff: ~f~%" (-> obj rdists y)) - (format #t "~1Trlength-mid: ~f~%" (-> obj rdists z)) - (format #t "~1Tstiffness: ~f~%" (-> obj rdists w)) - (format #t "~1Tnext[4] @ #x~X~%" (-> obj next)) - (format #t "~1Tcount[4] @ #x~X~%" (-> obj count)) - (format #t "~1Tmod-count[4] @ #x~X~%" (-> obj mod-count)) - (format #t "~1Tlast[4] @ #x~X~%" (-> obj last)) - (format #t "~1Tnext-clear: ~D~%" (-> obj next-clear)) - (format #t "~1Tcount-clear: ~D~%" (-> obj count-clear)) - (format #t "~1Tlast-clear: ~D~%" (-> obj last-clear)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Ttexture-masks-index: ~D~%" (-> this texture-masks-index)) + (format #t "~1Tin-level: ~D~%" (-> this in-level)) + (format #t "~1Tutextures: ~D~%" (-> this utextures)) + (format #t "~1Tgeometry[4] @ #x~X~%" (-> this geometry)) + (format #t "~1Tdists: #~%" (-> this dists)) + (format #t "~1Trdists: #~%" (-> this rdists)) + (format #t "~1Tnear-plane: (meters ~m)~%" (-> this dists x)) + (format #t "~1Tnear-stiff: (meters ~m)~%" (-> this dists y)) + (format #t "~1Tmid-plane: (meters ~m)~%" (-> this dists z)) + (format #t "~1Tfar-plane: (meters ~m)~%" (-> this dists w)) + (format #t "~1Trlength-near: ~f~%" (-> this rdists x)) + (format #t "~1Trlength-stiff: ~f~%" (-> this rdists y)) + (format #t "~1Trlength-mid: ~f~%" (-> this rdists z)) + (format #t "~1Tstiffness: ~f~%" (-> this rdists w)) + (format #t "~1Tnext[4] @ #x~X~%" (-> this next)) + (format #t "~1Tcount[4] @ #x~X~%" (-> this count)) + (format #t "~1Tmod-count[4] @ #x~X~%" (-> this mod-count)) + (format #t "~1Tlast[4] @ #x~X~%" (-> this last)) + (format #t "~1Tnext-clear: ~D~%" (-> this next-clear)) + (format #t "~1Tcount-clear: ~D~%" (-> this count-clear)) + (format #t "~1Tlast-clear: ~D~%" (-> this last-clear)) (label cfg-4) - obj + this ) +;; definition of type prototype-inline-array-shrub (deftype prototype-inline-array-shrub (drawable) ((length int16 :offset 6) (data prototype-bucket-shrub 1 :inline :offset 32) @@ -107,20 +114,22 @@ :flag-assert #x1100000094 ) -(defmethod inspect prototype-inline-array-shrub ((obj prototype-inline-array-shrub)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type prototype-inline-array-shrub +(defmethod inspect prototype-inline-array-shrub ((this prototype-inline-array-shrub)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[1] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) +;; definition of type prototype-array-shrub-info (deftype prototype-array-shrub-info (basic) ((prototype-inline-array-shrub prototype-inline-array-shrub :offset-assert 4) (wind-vectors uint32 :offset-assert 8) @@ -131,19 +140,21 @@ :flag-assert #x900000010 ) -(defmethod inspect prototype-array-shrub-info ((obj prototype-array-shrub-info)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type prototype-array-shrub-info +(defmethod inspect prototype-array-shrub-info ((this prototype-array-shrub-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprototype-inline-array-shrub: ~A~%" (-> obj prototype-inline-array-shrub)) - (format #t "~1Twind-vectors: #x~X~%" (-> obj wind-vectors)) - (format #t "~1Twind-count: ~D~%" (-> obj wind-count)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprototype-inline-array-shrub: ~A~%" (-> this prototype-inline-array-shrub)) + (format #t "~1Twind-vectors: #x~X~%" (-> this wind-vectors)) + (format #t "~1Twind-count: ~D~%" (-> this wind-count)) (label cfg-4) - obj + this ) +;; definition of type prototype-bucket-tie (deftype prototype-bucket-tie (prototype-bucket) ((next uint32 12 :offset-assert 64) (count uint16 12 :offset-assert 112) @@ -231,111 +242,113 @@ :flag-assert #x9000000b8 ) -(defmethod inspect prototype-bucket-tie ((obj prototype-bucket-tie)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type prototype-bucket-tie +(defmethod inspect prototype-bucket-tie ((this prototype-bucket-tie)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Ttexture-masks-index: ~D~%" (-> obj texture-masks-index)) - (format #t "~1Tin-level: ~D~%" (-> obj in-level)) - (format #t "~1Tutextures: ~D~%" (-> obj utextures)) - (format #t "~1Tgeometry[4] @ #x~X~%" (-> obj tie-geom)) - (format #t "~1Tdists: #~%" (-> obj dists)) - (format #t "~1Trdists: #~%" (-> obj rdists)) - (format #t "~1Tnear-plane: (meters ~m)~%" (-> obj dists x)) - (format #t "~1Tnear-stiff: (meters ~m)~%" (-> obj dists y)) - (format #t "~1Tmid-plane: (meters ~m)~%" (-> obj dists z)) - (format #t "~1Tfar-plane: (meters ~m)~%" (-> obj dists w)) - (format #t "~1Trlength-near: ~f~%" (-> obj rdists x)) - (format #t "~1Trlength-stiff: ~f~%" (-> obj rdists y)) - (format #t "~1Trlength-mid: ~f~%" (-> obj rdists z)) - (format #t "~1Tstiffness: ~f~%" (-> obj rdists w)) - (format #t "~1Tnext[12] @ #x~X~%" (-> obj next)) - (format #t "~1Tcount[12] @ #x~X~%" (-> obj count)) - (format #t "~1Tfrag-count[4] @ #x~X~%" (-> obj frag-count)) - (format #t "~1Tindex-start[4] @ #x~X~%" (-> obj index-start)) - (format #t "~1Tbase-qw[4] @ #x~X~%" (-> obj base-qw)) - (format #t "~1Ttie-rvanish: ~f~%" (-> obj tie-rvanish)) - (format #t "~1Ttie-vanish-far: ~f~%" (-> obj tie-vanish-far)) - (format #t "~1Tenvmap-rfade: ~f~%" (-> obj envmap-rfade)) - (format #t "~1Tenvmap-fade-far: ~f~%" (-> obj envmap-fade-far)) - (format #t "~1Tenvmap-shader: #~%" (-> obj envmap-shader)) - (format #t "~1Ttint-color: ~D~%" (-> obj tint-color)) - (format #t "~1Tcollide-hash-fragment-array: ~A~%" (-> obj collide-hash-fragment-array)) - (format #t "~1Ttie-colors: ~A~%" (-> obj tie-colors)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) - (format #t "~1Tcolor-index-qwc[0] @ #x~X~%" (-> obj data)) - (format #t "~1Tscissor-frag-count: ~D~%" (-> obj scissor-frag-count)) - (format #t "~1Tnear-frag-count: ~D~%" (-> obj near-frag-count)) - (format #t "~1Tmid-frag-count: ~D~%" (-> obj mid-frag-count)) - (format #t "~1Tfar-frag-count: ~D~%" (-> obj far-frag-count)) - (format #t "~1Tscissor-index-start: ~D~%" (-> obj scissor-index-start)) - (format #t "~1Tnear-index-start: ~D~%" (-> obj near-index-start)) - (format #t "~1Tmid-index-start: ~D~%" (-> obj mid-index-start)) - (format #t "~1Tfar-index-start: ~D~%" (-> obj far-index-start)) - (format #t "~1Tscissor-base-qw: ~D~%" (-> obj scissor-base-qw)) - (format #t "~1Tnear-base-qw: ~D~%" (-> obj near-base-qw)) - (format #t "~1Tmid-base-qw: ~D~%" (-> obj mid-base-qw)) - (format #t "~1Tfar-base-qw: ~D~%" (-> obj far-base-qw)) - (format #t "~1Ttie-next[4] @ #x~X~%" (-> obj next)) - (format #t "~1Ttie-scissor-next: #x~X~%" (-> obj tie-scissor-next)) - (format #t "~1Ttie-near-next: #x~X~%" (-> obj tie-near-next)) - (format #t "~1Ttie-mid-next: #x~X~%" (-> obj tie-mid-next)) - (format #t "~1Ttie-far-next: #x~X~%" (-> obj tie-far-next)) - (format #t "~1Ttrans-next[4] @ #x~X~%" (-> obj next)) - (format #t "~1Ttrans-scissor-next[4] @ #x~X~%" (-> obj next)) - (format #t "~1Ttrans-near-next: #x~X~%" (-> obj tie-near-next)) - (format #t "~1Ttrans-mid-next: #x~X~%" (-> obj tie-mid-next)) - (format #t "~1Ttrans-far-next: #x~X~%" (-> obj tie-far-next)) - (format #t "~1Twater-next[4] @ #x~X~%" (-> obj next)) - (format #t "~1Twater-scissor-next[4] @ #x~X~%" (-> obj next)) - (format #t "~1Twater-near-next: #x~X~%" (-> obj tie-near-next)) - (format #t "~1Twater-mid-next: #x~X~%" (-> obj tie-mid-next)) - (format #t "~1Twater-far-next: #x~X~%" (-> obj tie-far-next)) - (format #t "~1Tenvmap-next[4] @ #x~X~%" (-> obj envmap-next)) - (format #t "~1Tenvmap-scissor-next[4] @ #x~X~%" (-> obj envmap-next)) - (format #t "~1Tenvmap-near-next: #x~X~%" (-> obj envmap-near-next)) - (format #t "~1Tenvmap-mid-next: #x~X~%" (-> obj envmap-mid-next)) - (format #t "~1Tenvmap-far-next: #x~X~%" (-> obj envmap-far-next)) - (format #t "~1Tgeneric-next[3] @ #x~X~%" (-> obj generic-next)) - (format #t "~1Tgeneric-near-next: #x~X~%" (-> obj generic-near-next)) - (format #t "~1Tgeneric-mid-next: #x~X~%" (-> obj generic-mid-next)) - (format #t "~1Tgeneric-far-next: #x~X~%" (-> obj generic-far-next)) - (format #t "~1Tvanish-next: #x~X~%" (-> obj vanish-next)) - (format #t "~1Ttie-count[4] @ #x~X~%" (-> obj count)) - (format #t "~1Ttie-scissor-count: ~D~%" (-> obj tie-scissor-count)) - (format #t "~1Ttie-near-count: ~D~%" (-> obj tie-near-count)) - (format #t "~1Ttie-mid-count: ~D~%" (-> obj tie-mid-count)) - (format #t "~1Ttie-far-count: ~D~%" (-> obj tie-far-count)) - (format #t "~1Ttrans-count[4] @ #x~X~%" (-> obj count)) - (format #t "~1Ttrans-scissor-count: ~D~%" (-> obj tie-scissor-count)) - (format #t "~1Ttrans-near-count: ~D~%" (-> obj tie-near-count)) - (format #t "~1Ttrans-mid-count: ~D~%" (-> obj tie-mid-count)) - (format #t "~1Ttrans-far-count: ~D~%" (-> obj tie-far-count)) - (format #t "~1Twater-count[4] @ #x~X~%" (-> obj count)) - (format #t "~1Twater-scissor-count: ~D~%" (-> obj tie-scissor-count)) - (format #t "~1Twater-near-count: ~D~%" (-> obj tie-near-count)) - (format #t "~1Twater-mid-count: ~D~%" (-> obj tie-mid-count)) - (format #t "~1Twater-far-count: ~D~%" (-> obj tie-far-count)) - (format #t "~1Tenvmap-count[4] @ #x~X~%" (-> obj envmap-count)) - (format #t "~1Tenvmap-scissor-count: ~D~%" (-> obj envmap-scissor-count)) - (format #t "~1Tenvmap-near-count: ~D~%" (-> obj envmap-near-count)) - (format #t "~1Tenvmap-mid-count: ~D~%" (-> obj envmap-mid-count)) - (format #t "~1Tenvmap-far-count: ~D~%" (-> obj envmap-far-count)) - (format #t "~1Tgeneric-count[3] @ #x~X~%" (-> obj generic-count)) - (format #t "~1Tgeneric-near-count: ~D~%" (-> obj generic-near-count)) - (format #t "~1Tgeneric-mid-count: ~D~%" (-> obj generic-mid-count)) - (format #t "~1Tgeneric-far-count: ~D~%" (-> obj generic-far-count)) - (format #t "~1Tvanish-count: ~D~%" (-> obj vanish-count)) - (format #t "~1Tnext-clear[3] @ #x~X~%" (-> obj next)) - (format #t "~1Tcount-clear[3] @ #x~X~%" (-> obj count)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Ttexture-masks-index: ~D~%" (-> this texture-masks-index)) + (format #t "~1Tin-level: ~D~%" (-> this in-level)) + (format #t "~1Tutextures: ~D~%" (-> this utextures)) + (format #t "~1Tgeometry[4] @ #x~X~%" (-> this tie-geom)) + (format #t "~1Tdists: #~%" (-> this dists)) + (format #t "~1Trdists: #~%" (-> this rdists)) + (format #t "~1Tnear-plane: (meters ~m)~%" (-> this dists x)) + (format #t "~1Tnear-stiff: (meters ~m)~%" (-> this dists y)) + (format #t "~1Tmid-plane: (meters ~m)~%" (-> this dists z)) + (format #t "~1Tfar-plane: (meters ~m)~%" (-> this dists w)) + (format #t "~1Trlength-near: ~f~%" (-> this rdists x)) + (format #t "~1Trlength-stiff: ~f~%" (-> this rdists y)) + (format #t "~1Trlength-mid: ~f~%" (-> this rdists z)) + (format #t "~1Tstiffness: ~f~%" (-> this rdists w)) + (format #t "~1Tnext[12] @ #x~X~%" (-> this next)) + (format #t "~1Tcount[12] @ #x~X~%" (-> this count)) + (format #t "~1Tfrag-count[4] @ #x~X~%" (-> this frag-count)) + (format #t "~1Tindex-start[4] @ #x~X~%" (-> this index-start)) + (format #t "~1Tbase-qw[4] @ #x~X~%" (-> this base-qw)) + (format #t "~1Ttie-rvanish: ~f~%" (-> this tie-rvanish)) + (format #t "~1Ttie-vanish-far: ~f~%" (-> this tie-vanish-far)) + (format #t "~1Tenvmap-rfade: ~f~%" (-> this envmap-rfade)) + (format #t "~1Tenvmap-fade-far: ~f~%" (-> this envmap-fade-far)) + (format #t "~1Tenvmap-shader: #~%" (-> this envmap-shader)) + (format #t "~1Ttint-color: ~D~%" (-> this tint-color)) + (format #t "~1Tcollide-hash-fragment-array: ~A~%" (-> this collide-hash-fragment-array)) + (format #t "~1Ttie-colors: ~A~%" (-> this tie-colors)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (format #t "~1Tcolor-index-qwc[0] @ #x~X~%" (-> this data)) + (format #t "~1Tscissor-frag-count: ~D~%" (-> this scissor-frag-count)) + (format #t "~1Tnear-frag-count: ~D~%" (-> this near-frag-count)) + (format #t "~1Tmid-frag-count: ~D~%" (-> this mid-frag-count)) + (format #t "~1Tfar-frag-count: ~D~%" (-> this far-frag-count)) + (format #t "~1Tscissor-index-start: ~D~%" (-> this scissor-index-start)) + (format #t "~1Tnear-index-start: ~D~%" (-> this near-index-start)) + (format #t "~1Tmid-index-start: ~D~%" (-> this mid-index-start)) + (format #t "~1Tfar-index-start: ~D~%" (-> this far-index-start)) + (format #t "~1Tscissor-base-qw: ~D~%" (-> this scissor-base-qw)) + (format #t "~1Tnear-base-qw: ~D~%" (-> this near-base-qw)) + (format #t "~1Tmid-base-qw: ~D~%" (-> this mid-base-qw)) + (format #t "~1Tfar-base-qw: ~D~%" (-> this far-base-qw)) + (format #t "~1Ttie-next[4] @ #x~X~%" (-> this next)) + (format #t "~1Ttie-scissor-next: #x~X~%" (-> this tie-scissor-next)) + (format #t "~1Ttie-near-next: #x~X~%" (-> this tie-near-next)) + (format #t "~1Ttie-mid-next: #x~X~%" (-> this tie-mid-next)) + (format #t "~1Ttie-far-next: #x~X~%" (-> this tie-far-next)) + (format #t "~1Ttrans-next[4] @ #x~X~%" (-> this next)) + (format #t "~1Ttrans-scissor-next[4] @ #x~X~%" (-> this next)) + (format #t "~1Ttrans-near-next: #x~X~%" (-> this tie-near-next)) + (format #t "~1Ttrans-mid-next: #x~X~%" (-> this tie-mid-next)) + (format #t "~1Ttrans-far-next: #x~X~%" (-> this tie-far-next)) + (format #t "~1Twater-next[4] @ #x~X~%" (-> this next)) + (format #t "~1Twater-scissor-next[4] @ #x~X~%" (-> this next)) + (format #t "~1Twater-near-next: #x~X~%" (-> this tie-near-next)) + (format #t "~1Twater-mid-next: #x~X~%" (-> this tie-mid-next)) + (format #t "~1Twater-far-next: #x~X~%" (-> this tie-far-next)) + (format #t "~1Tenvmap-next[4] @ #x~X~%" (-> this envmap-next)) + (format #t "~1Tenvmap-scissor-next[4] @ #x~X~%" (-> this envmap-next)) + (format #t "~1Tenvmap-near-next: #x~X~%" (-> this envmap-near-next)) + (format #t "~1Tenvmap-mid-next: #x~X~%" (-> this envmap-mid-next)) + (format #t "~1Tenvmap-far-next: #x~X~%" (-> this envmap-far-next)) + (format #t "~1Tgeneric-next[3] @ #x~X~%" (-> this generic-next)) + (format #t "~1Tgeneric-near-next: #x~X~%" (-> this generic-near-next)) + (format #t "~1Tgeneric-mid-next: #x~X~%" (-> this generic-mid-next)) + (format #t "~1Tgeneric-far-next: #x~X~%" (-> this generic-far-next)) + (format #t "~1Tvanish-next: #x~X~%" (-> this vanish-next)) + (format #t "~1Ttie-count[4] @ #x~X~%" (-> this count)) + (format #t "~1Ttie-scissor-count: ~D~%" (-> this tie-scissor-count)) + (format #t "~1Ttie-near-count: ~D~%" (-> this tie-near-count)) + (format #t "~1Ttie-mid-count: ~D~%" (-> this tie-mid-count)) + (format #t "~1Ttie-far-count: ~D~%" (-> this tie-far-count)) + (format #t "~1Ttrans-count[4] @ #x~X~%" (-> this count)) + (format #t "~1Ttrans-scissor-count: ~D~%" (-> this tie-scissor-count)) + (format #t "~1Ttrans-near-count: ~D~%" (-> this tie-near-count)) + (format #t "~1Ttrans-mid-count: ~D~%" (-> this tie-mid-count)) + (format #t "~1Ttrans-far-count: ~D~%" (-> this tie-far-count)) + (format #t "~1Twater-count[4] @ #x~X~%" (-> this count)) + (format #t "~1Twater-scissor-count: ~D~%" (-> this tie-scissor-count)) + (format #t "~1Twater-near-count: ~D~%" (-> this tie-near-count)) + (format #t "~1Twater-mid-count: ~D~%" (-> this tie-mid-count)) + (format #t "~1Twater-far-count: ~D~%" (-> this tie-far-count)) + (format #t "~1Tenvmap-count[4] @ #x~X~%" (-> this envmap-count)) + (format #t "~1Tenvmap-scissor-count: ~D~%" (-> this envmap-scissor-count)) + (format #t "~1Tenvmap-near-count: ~D~%" (-> this envmap-near-count)) + (format #t "~1Tenvmap-mid-count: ~D~%" (-> this envmap-mid-count)) + (format #t "~1Tenvmap-far-count: ~D~%" (-> this envmap-far-count)) + (format #t "~1Tgeneric-count[3] @ #x~X~%" (-> this generic-count)) + (format #t "~1Tgeneric-near-count: ~D~%" (-> this generic-near-count)) + (format #t "~1Tgeneric-mid-count: ~D~%" (-> this generic-mid-count)) + (format #t "~1Tgeneric-far-count: ~D~%" (-> this generic-far-count)) + (format #t "~1Tvanish-count: ~D~%" (-> this vanish-count)) + (format #t "~1Tnext-clear[3] @ #x~X~%" (-> this next)) + (format #t "~1Tcount-clear[3] @ #x~X~%" (-> this count)) (label cfg-4) - obj + this ) +;; definition of type prototype-array-tie (deftype prototype-array-tie (array) ((array-data prototype-bucket-tie :dynamic :offset 16) ) @@ -347,20 +360,22 @@ ) ) -(defmethod inspect prototype-array-tie ((obj prototype-array-tie)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type prototype-array-tie +(defmethod inspect prototype-array-tie ((this prototype-array-tie)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttype: ~A~%" (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tcontent-type: ~A~%" (-> obj content-type)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttype: ~A~%" (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tcontent-type: ~A~%" (-> this content-type)) (label cfg-4) - obj + this ) +;; definition of type proxy-prototype-array-tie (deftype proxy-prototype-array-tie (basic) ((prototype-array-tie prototype-array-tie :offset-assert 4) (wind-vectors uint32 :offset-assert 8) @@ -372,20 +387,22 @@ :flag-assert #x900000010 ) -(defmethod inspect proxy-prototype-array-tie ((obj proxy-prototype-array-tie)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type proxy-prototype-array-tie +(defmethod inspect proxy-prototype-array-tie ((this proxy-prototype-array-tie)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprototype-array-tie: ~A~%" (-> obj prototype-array-tie)) - (format #t "~1Twind-vectors: #x~X~%" (-> obj wind-vectors)) - (format #t "~1Twind-count: ~D~%" (-> obj wind-count)) - (format #t "~1Tprototype-max-qwc: ~D~%" (-> obj prototype-max-qwc)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprototype-array-tie: ~A~%" (-> this prototype-array-tie)) + (format #t "~1Twind-vectors: #x~X~%" (-> this wind-vectors)) + (format #t "~1Twind-count: ~D~%" (-> this wind-count)) + (format #t "~1Tprototype-max-qwc: ~D~%" (-> this prototype-max-qwc)) (label cfg-4) - obj + this ) +;; definition of type instance (deftype instance (drawable) ((bucket-index uint16 :offset 6) (origin matrix4h :inline :offset-assert 32) @@ -397,20 +414,22 @@ :flag-assert #x1100000040 ) -(defmethod inspect instance ((obj instance)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type instance +(defmethod inspect instance ((this instance)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tbucket-index: ~D~%" (-> obj bucket-index)) - (format #t "~1Torigin: #~%" (-> obj origin)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Twind-index: ~D~%" (-> obj wind-index)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tbucket-index: ~D~%" (-> this bucket-index)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Twind-index: ~D~%" (-> this wind-index)) (label cfg-4) - obj + this ) +;; failed to figure out what this is: 0 diff --git a/test/decompiler/reference/jak2/engine/gfx/background/prototype_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/prototype_REF.gc index 530bc92d30..a8a5e9edc8 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/prototype_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/prototype_REF.gc @@ -2,10 +2,10 @@ (in-package goal) ;; definition for method 9 of type prototype-inline-array-shrub -(defmethod login prototype-inline-array-shrub ((obj prototype-inline-array-shrub)) +(defmethod login prototype-inline-array-shrub ((this prototype-inline-array-shrub)) (let ((bsp-header (-> *level* level *level-index* bsp))) - (dotimes (shrub-idx (-> obj length)) - (let ((shrub (-> obj data shrub-idx))) + (dotimes (shrub-idx (-> this length)) + (let ((shrub (-> this data shrub-idx))) (when (and *debug-segment* (-> *screen-shot-work* highres-enable)) (dotimes (shrub-i 4) (+! (-> shrub dists data shrub-i) 40960000.0) @@ -23,28 +23,28 @@ ) ) ) - obj + this ) ;; definition for method 8 of type prototype-array-tie -(defmethod mem-usage prototype-array-tie ((obj prototype-array-tie) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage prototype-array-tie ((this prototype-array-tie) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 1 (-> usage length))) (set! (-> usage data 0 name) (symbol->string 'drawable-group)) (+! (-> usage data 0 count) 1) - (let ((size-of-tie (asize-of obj))) + (let ((size-of-tie (asize-of this))) (+! (-> usage data 0 used) size-of-tie) (+! (-> usage data 0 total) (logand -16 (+ size-of-tie 15))) ) - (dotimes (tie-idx (-> obj length)) - (mem-usage (-> obj array-data tie-idx) usage arg2) + (dotimes (tie-idx (-> this length)) + (mem-usage (-> this array-data tie-idx) usage arg2) ) - obj + this ) ;; definition for method 8 of type prototype-bucket-tie -(defmethod mem-usage prototype-bucket-tie ((obj prototype-bucket-tie) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage prototype-bucket-tie ((this prototype-bucket-tie) (usage memory-usage-block) (arg2 int)) (dotimes (idx 4) - (let ((tie-geom (-> obj tie-geom idx))) + (let ((tie-geom (-> this tie-geom idx))) (if (nonzero? tie-geom) (mem-usage tie-geom usage (logior arg2 1)) ) @@ -53,42 +53,42 @@ (set! (-> usage length) (max 84 (-> usage length))) (set! (-> usage data 83 name) "string") (+! (-> usage data 83 count) 1) - (let ((name-size (asize-of (-> obj name)))) + (let ((name-size (asize-of (-> this name)))) (+! (-> usage data 83 used) name-size) (+! (-> usage data 83 total) (logand -16 (+ name-size 15))) ) - (when (nonzero? (-> obj tie-colors)) + (when (nonzero? (-> this tie-colors)) (set! (-> usage length) (max 17 (-> usage length))) (set! (-> usage data 16 name) "tie-pal") (+! (-> usage data 16 count) 1) - (let ((color-size (asize-of (-> obj tie-colors)))) + (let ((color-size (asize-of (-> this tie-colors)))) (+! (-> usage data 16 used) color-size) (+! (-> usage data 16 total) (logand -16 (+ color-size 15))) ) ) - (if (nonzero? (-> obj collide-hash-fragment-array)) - (mem-usage (-> obj collide-hash-fragment-array) usage (logior arg2 1)) + (if (nonzero? (-> this collide-hash-fragment-array)) + (mem-usage (-> this collide-hash-fragment-array) usage (logior arg2 1)) ) - obj + this ) ;; definition for method 8 of type prototype-inline-array-shrub -(defmethod mem-usage prototype-inline-array-shrub ((obj prototype-inline-array-shrub) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage prototype-inline-array-shrub ((this prototype-inline-array-shrub) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 1 (-> usage length))) (set! (-> usage data 0 name) (symbol->string 'drawable-group)) (+! (-> usage data 0 count) 1) - (let ((shrub-size (asize-of obj))) + (let ((shrub-size (asize-of this))) (+! (-> usage data 0 used) shrub-size) (+! (-> usage data 0 total) (logand -16 (+ shrub-size 15))) ) - (dotimes (idx (-> obj length)) - (mem-usage (-> obj data idx) usage arg2) + (dotimes (idx (-> this length)) + (mem-usage (-> this data idx) usage arg2) ) - obj + this ) ;; definition for method 8 of type prototype-bucket-shrub -(defmethod mem-usage prototype-bucket-shrub ((obj prototype-bucket-shrub) (usage memory-usage-block) (arg2 int)) +(defmethod mem-usage prototype-bucket-shrub ((this prototype-bucket-shrub) (usage memory-usage-block) (arg2 int)) (set! (-> usage length) (max 25 (-> usage length))) (set! (-> usage data 24 name) "prototype-bucket-shrub") (+! (-> usage data 24 count) 1) @@ -97,7 +97,7 @@ (+! (-> usage data 24 total) (logand -16 (+ proto-shrub-size 15))) ) (dotimes (idx 4) - (let ((geo (-> obj geometry idx))) + (let ((geo (-> this geometry idx))) (if (nonzero? geo) (mem-usage geo usage (logior arg2 1)) ) @@ -106,9 +106,9 @@ (set! (-> usage length) (max 84 (-> usage length))) (set! (-> usage data 83 name) "string") (+! (-> usage data 83 count) 1) - (let ((name-size (asize-of (-> obj name)))) + (let ((name-size (asize-of (-> this name)))) (+! (-> usage data 83 used) name-size) (+! (-> usage data 83 total) (logand -16 (+ name-size 15))) ) - obj + this ) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc index c5c400dc4a..73a416e3c7 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc @@ -17,18 +17,18 @@ ) ;; definition for method 3 of type subdivide-settings -(defmethod inspect subdivide-settings ((obj subdivide-settings)) - (when (not obj) - (set! obj obj) +(defmethod inspect subdivide-settings ((this subdivide-settings)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdist[5] @ #x~X~%" (-> obj dist)) - (format #t "~1Tmeters[5] @ #x~X~%" (-> obj meters)) - (format #t "~1Tclose[8] @ #x~X~%" (-> obj close)) - (format #t "~1Tfar[8] @ #x~X~%" (-> obj far)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdist[5] @ #x~X~%" (-> this dist)) + (format #t "~1Tmeters[5] @ #x~X~%" (-> this meters)) + (format #t "~1Tclose[8] @ #x~X~%" (-> this close)) + (format #t "~1Tfar[8] @ #x~X~%" (-> this far)) (label cfg-4) - obj + this ) ;; definition for method 0 of type subdivide-settings @@ -55,18 +55,18 @@ ) ;; definition for method 3 of type subdivide-dists -(defmethod inspect subdivide-dists ((obj subdivide-dists)) - (when (not obj) - (set! obj obj) +(defmethod inspect subdivide-dists ((this subdivide-dists)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'subdivide-dists) - (format #t "~1Tdata[32] @ #x~X~%" (-> obj data)) - (format #t "~1Tvector[8] @ #x~X~%" (-> obj data)) - (format #t "~1Tk0s[4] @ #x~X~%" (-> obj data)) - (format #t "~1Tk1s[4] @ #x~X~%" (-> obj k1s)) + (format #t "[~8x] ~A~%" this 'subdivide-dists) + (format #t "~1Tdata[32] @ #x~X~%" (-> this data)) + (format #t "~1Tvector[8] @ #x~X~%" (-> this data)) + (format #t "~1Tk0s[4] @ #x~X~%" (-> this data)) + (format #t "~1Tk1s[4] @ #x~X~%" (-> this k1s)) (label cfg-4) - obj + this ) ;; definition of type terrain-stats @@ -108,44 +108,44 @@ ) ;; definition for method 3 of type terrain-stats -(defmethod inspect terrain-stats ((obj terrain-stats)) - (when (not obj) - (set! obj obj) +(defmethod inspect terrain-stats ((this terrain-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'terrain-stats) - (format #t "~1Tpris: #~%" (-> obj pris)) - (format #t "~1Ttie-generic: #~%" (-> obj tie-generic)) - (format #t "~1Ttie-vanish: #~%" (-> obj tie-vanish)) - (format #t "~1Ttie: #~%" (-> obj tie)) - (format #t "~1Ttie-scissor: #~%" (-> obj tie-scissor)) - (format #t "~1Ttie-envmap: #~%" (-> obj tie-envmap)) - (format #t "~1Ttie-envmap-scissor: #~%" (-> obj tie-envmap-scissor)) - (format #t "~1Ttie-trans: #~%" (-> obj tie-trans)) - (format #t "~1Ttie-scissor-trans: #~%" (-> obj tie-scissor-trans)) - (format #t "~1Ttie-envmap-trans: #~%" (-> obj tie-envmap-trans)) - (format #t "~1Ttie-envmap-scissor-trans: #~%" (-> obj tie-envmap-scissor-trans)) - (format #t "~1Ttie-water: #~%" (-> obj tie-water)) - (format #t "~1Ttie-scissor-water: #~%" (-> obj tie-scissor-water)) - (format #t "~1Ttie-envmap-water: #~%" (-> obj tie-envmap-water)) - (format #t "~1Ttie-envmap-scissor-water: #~%" (-> obj tie-envmap-scissor-water)) - (format #t "~1Tshrub-near: #~%" (-> obj shrub-near)) - (format #t "~1Tshrub: #~%" (-> obj shrub)) - (format #t "~1Ttfrag-scissor: #~%" (-> obj tfrag-scissor)) - (format #t "~1Ttfrag: #~%" (-> obj tfrag)) - (format #t "~1Tbillboard: #~%" (-> obj billboard)) - (format #t "~1Ttfrag-trans: #~%" (-> obj tfrag-trans)) - (format #t "~1Ttfrag-scissor-trans: #~%" (-> obj tfrag-scissor-trans)) - (format #t "~1Ttfrag-water: #~%" (-> obj tfrag-water)) - (format #t "~1Ttfrag-scissor-water: #~%" (-> obj tfrag-scissor-water)) - (format #t "~1Ttrans-pris: #~%" (-> obj trans-pris)) - (format #t "~1Ttrans-shrub: #~%" (-> obj trans-shrub)) - (format #t "~1Tocean-mid: #~%" (-> obj ocean-mid)) - (format #t "~1Tocean-near: #~%" (-> obj ocean-near)) - (format #t "~1Tshadow: #~%" (-> obj shadow)) - (format #t "~1Ttotal: #~%" (-> obj total)) + (format #t "[~8x] ~A~%" this 'terrain-stats) + (format #t "~1Tpris: #~%" (-> this pris)) + (format #t "~1Ttie-generic: #~%" (-> this tie-generic)) + (format #t "~1Ttie-vanish: #~%" (-> this tie-vanish)) + (format #t "~1Ttie: #~%" (-> this tie)) + (format #t "~1Ttie-scissor: #~%" (-> this tie-scissor)) + (format #t "~1Ttie-envmap: #~%" (-> this tie-envmap)) + (format #t "~1Ttie-envmap-scissor: #~%" (-> this tie-envmap-scissor)) + (format #t "~1Ttie-trans: #~%" (-> this tie-trans)) + (format #t "~1Ttie-scissor-trans: #~%" (-> this tie-scissor-trans)) + (format #t "~1Ttie-envmap-trans: #~%" (-> this tie-envmap-trans)) + (format #t "~1Ttie-envmap-scissor-trans: #~%" (-> this tie-envmap-scissor-trans)) + (format #t "~1Ttie-water: #~%" (-> this tie-water)) + (format #t "~1Ttie-scissor-water: #~%" (-> this tie-scissor-water)) + (format #t "~1Ttie-envmap-water: #~%" (-> this tie-envmap-water)) + (format #t "~1Ttie-envmap-scissor-water: #~%" (-> this tie-envmap-scissor-water)) + (format #t "~1Tshrub-near: #~%" (-> this shrub-near)) + (format #t "~1Tshrub: #~%" (-> this shrub)) + (format #t "~1Ttfrag-scissor: #~%" (-> this tfrag-scissor)) + (format #t "~1Ttfrag: #~%" (-> this tfrag)) + (format #t "~1Tbillboard: #~%" (-> this billboard)) + (format #t "~1Ttfrag-trans: #~%" (-> this tfrag-trans)) + (format #t "~1Ttfrag-scissor-trans: #~%" (-> this tfrag-scissor-trans)) + (format #t "~1Ttfrag-water: #~%" (-> this tfrag-water)) + (format #t "~1Ttfrag-scissor-water: #~%" (-> this tfrag-scissor-water)) + (format #t "~1Ttrans-pris: #~%" (-> this trans-pris)) + (format #t "~1Ttrans-shrub: #~%" (-> this trans-shrub)) + (format #t "~1Tocean-mid: #~%" (-> this ocean-mid)) + (format #t "~1Tocean-near: #~%" (-> this ocean-near)) + (format #t "~1Tshadow: #~%" (-> this shadow)) + (format #t "~1Ttotal: #~%" (-> this total)) (label cfg-4) - obj + this ) ;; definition of type dma-area @@ -166,23 +166,23 @@ ) ;; definition for method 3 of type dma-area -(defmethod inspect dma-area ((obj dma-area)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-area ((this dma-area)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-area) - (format #t "~1Tinstance-shrub-dma: #~%" (-> obj instance-shrub-dma)) - (format #t "~1Tdraw-node-dma: #~%" (-> obj instance-shrub-dma)) - (format #t "~1Ttfrag-dma: #~%" (-> obj instance-shrub-dma)) - (format #t "~1Tinstance-tie-dma: #~%" (-> obj instance-shrub-dma)) - (format #t "~1Tprototype-tie-dma: #~%" (-> obj instance-shrub-dma)) - (format #t "~1Twind-dma: #~%" (-> obj instance-shrub-dma)) - (format #t "~1Ttime-of-day-dma: #~%" (-> obj instance-shrub-dma)) - (format #t "~1Tdecomp-work: #~%" (-> obj instance-shrub-dma)) - (format #t "~1Tocean-vertex[4] @ #x~X~%" (-> obj instance-shrub-dma)) + (format #t "[~8x] ~A~%" this 'dma-area) + (format #t "~1Tinstance-shrub-dma: #~%" (-> this instance-shrub-dma)) + (format #t "~1Tdraw-node-dma: #~%" (-> this instance-shrub-dma)) + (format #t "~1Ttfrag-dma: #~%" (-> this instance-shrub-dma)) + (format #t "~1Tinstance-tie-dma: #~%" (-> this instance-shrub-dma)) + (format #t "~1Tprototype-tie-dma: #~%" (-> this instance-shrub-dma)) + (format #t "~1Twind-dma: #~%" (-> this instance-shrub-dma)) + (format #t "~1Ttime-of-day-dma: #~%" (-> this instance-shrub-dma)) + (format #t "~1Tdecomp-work: #~%" (-> this instance-shrub-dma)) + (format #t "~1Tocean-vertex[4] @ #x~X~%" (-> this instance-shrub-dma)) (label cfg-4) - obj + this ) ;; definition of type background-area @@ -196,16 +196,16 @@ ) ;; definition for method 3 of type background-area -(defmethod inspect background-area ((obj background-area)) - (when (not obj) - (set! obj obj) +(defmethod inspect background-area ((this background-area)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'background-area) - (format #t "~1Tdma-area: #~%" (-> obj dma-area)) - (format #t "~1Tvis-list[2048] @ #x~X~%" (-> obj vis-list)) + (format #t "[~8x] ~A~%" this 'background-area) + (format #t "~1Tdma-area: #~%" (-> this dma-area)) + (format #t "~1Tvis-list[2048] @ #x~X~%" (-> this vis-list)) (label cfg-4) - obj + this ) ;; definition of type foreground-area @@ -222,19 +222,19 @@ ) ;; definition for method 3 of type foreground-area -(defmethod inspect foreground-area ((obj foreground-area)) - (when (not obj) - (set! obj obj) +(defmethod inspect foreground-area ((this foreground-area)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'foreground-area) - (format #t "~1Tgeneric-work: #~%" (-> obj generic-work)) - (format #t "~1Tforeground-work: #~%" (-> obj generic-work)) - (format #t "~1Tjoint-work: #~%" (-> obj generic-work)) - (format #t "~1Tbone-mem: #~%" (-> obj generic-work)) - (format #t "~1Tshadow-work: #~%" (-> obj generic-work)) + (format #t "[~8x] ~A~%" this 'foreground-area) + (format #t "~1Tgeneric-work: #~%" (-> this generic-work)) + (format #t "~1Tforeground-work: #~%" (-> this generic-work)) + (format #t "~1Tjoint-work: #~%" (-> this generic-work)) + (format #t "~1Tbone-mem: #~%" (-> this generic-work)) + (format #t "~1Tshadow-work: #~%" (-> this generic-work)) (label cfg-4) - obj + this ) ;; definition of type region-prim-area @@ -269,29 +269,29 @@ ) ;; definition for method 3 of type region-prim-area -(defmethod inspect region-prim-area ((obj region-prim-area)) - (when (not obj) - (set! obj obj) +(defmethod inspect region-prim-area ((this region-prim-area)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'region-prim-area) - (format #t "~1Tregion-prim-list: #~%" (-> obj region-prim-list)) - (format #t "~1Tpos: ~`vector`P~%" (-> obj pos)) - (format #t "~1Tray: ~`vector`P~%" (-> obj ray)) - (format #t "~1Tregion-enter-count: ~D~%" (-> obj region-enter-count)) - (format #t "~1Tregion-enter-list[320] @ #x~X~%" (-> obj region-enter-list)) - (format #t "~1Tregion-enter-prim-list[320] @ #x~X~%" (-> obj region-enter-prim-list)) - (format #t "~1Tregion-exit-count: ~D~%" (-> obj region-exit-count)) - (format #t "~1Tregion-exit-list[320] @ #x~X~%" (-> obj region-exit-list)) - (format #t "~1Tregion-exit-prim-list[320] @ #x~X~%" (-> obj region-exit-prim-list)) - (format #t "~1Tregion-inside-count: ~D~%" (-> obj region-inside-count)) - (format #t "~1Tregion-inside-list[320] @ #x~X~%" (-> obj region-inside-list)) - (format #t "~1Tregion-inside-prim-list[320] @ #x~X~%" (-> obj region-inside-prim-list)) - (format #t "~1Tregion-start-count: ~D~%" (-> obj region-start-count)) - (format #t "~1Tregion-start-list[320] @ #x~X~%" (-> obj region-start-list)) - (format #t "~1Tregion-start-prim-list[320] @ #x~X~%" (-> obj region-start-prim-list)) + (format #t "[~8x] ~A~%" this 'region-prim-area) + (format #t "~1Tregion-prim-list: #~%" (-> this region-prim-list)) + (format #t "~1Tpos: ~`vector`P~%" (-> this pos)) + (format #t "~1Tray: ~`vector`P~%" (-> this ray)) + (format #t "~1Tregion-enter-count: ~D~%" (-> this region-enter-count)) + (format #t "~1Tregion-enter-list[320] @ #x~X~%" (-> this region-enter-list)) + (format #t "~1Tregion-enter-prim-list[320] @ #x~X~%" (-> this region-enter-prim-list)) + (format #t "~1Tregion-exit-count: ~D~%" (-> this region-exit-count)) + (format #t "~1Tregion-exit-list[320] @ #x~X~%" (-> this region-exit-list)) + (format #t "~1Tregion-exit-prim-list[320] @ #x~X~%" (-> this region-exit-prim-list)) + (format #t "~1Tregion-inside-count: ~D~%" (-> this region-inside-count)) + (format #t "~1Tregion-inside-list[320] @ #x~X~%" (-> this region-inside-list)) + (format #t "~1Tregion-inside-prim-list[320] @ #x~X~%" (-> this region-inside-prim-list)) + (format #t "~1Tregion-start-count: ~D~%" (-> this region-start-count)) + (format #t "~1Tregion-start-list[320] @ #x~X~%" (-> this region-start-list)) + (format #t "~1Tregion-start-prim-list[320] @ #x~X~%" (-> this region-start-prim-list)) (label cfg-4) - obj + this ) ;; definition of type sprite-area @@ -305,16 +305,16 @@ ) ;; definition for method 3 of type sprite-area -(defmethod inspect sprite-area ((obj sprite-area)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-area ((this sprite-area)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-area) - (format #t "~1Tclock-data[13] @ #x~X~%" (-> obj clock-data)) - (format #t "~1Tbuffer[0] @ #x~X~%" (-> obj buffer)) + (format #t "[~8x] ~A~%" this 'sprite-area) + (format #t "~1Tclock-data[13] @ #x~X~%" (-> this clock-data)) + (format #t "~1Tbuffer[0] @ #x~X~%" (-> this buffer)) (label cfg-4) - obj + this ) ;; definition of type work-area @@ -330,18 +330,18 @@ ) ;; definition for method 3 of type work-area -(defmethod inspect work-area ((obj work-area)) - (when (not obj) - (set! obj obj) +(defmethod inspect work-area ((this work-area)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'work-area) - (format #t "~1Tbackground: #~%" (-> obj background)) - (format #t "~1Tforeground: #~%" (-> obj background)) - (format #t "~1Tregion-prim: #~%" (-> obj background)) - (format #t "~1Tsprite: #~%" (-> obj background)) + (format #t "[~8x] ~A~%" this 'work-area) + (format #t "~1Tbackground: #~%" (-> this background)) + (format #t "~1Tforeground: #~%" (-> this background)) + (format #t "~1Tregion-prim: #~%" (-> this background)) + (format #t "~1Tsprite: #~%" (-> this background)) (label cfg-4) - obj + this ) ;; definition of type terrain-context @@ -354,15 +354,15 @@ ) ;; definition for method 3 of type terrain-context -(defmethod inspect terrain-context ((obj terrain-context)) - (when (not obj) - (set! obj obj) +(defmethod inspect terrain-context ((this terrain-context)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'terrain-context) - (format #t "~1Twork: #~%" (-> obj work)) + (format #t "[~8x] ~A~%" this 'terrain-context) + (format #t "~1Twork: #~%" (-> this work)) (label cfg-4) - obj + this ) ;; definition for symbol *terrain-stats*, type terrain-stats diff --git a/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-h_REF.gc index 066bc32e01..2661f1ac80 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-h_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type tfragment-stats -(defmethod inspect tfragment-stats ((obj tfragment-stats)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfragment-stats ((this tfragment-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tfragment-stats) - (format #t "~1Tnum-tris[4] @ #x~X~%" (-> obj num-tris)) - (format #t "~1Tnum-dverts[4] @ #x~X~%" (-> obj num-dverts)) + (format #t "[~8x] ~A~%" this 'tfragment-stats) + (format #t "~1Tnum-tris[4] @ #x~X~%" (-> this num-tris)) + (format #t "~1Tnum-dverts[4] @ #x~X~%" (-> this num-dverts)) (label cfg-4) - obj + this ) ;; definition of type tfragment-debug-data @@ -35,16 +35,16 @@ ) ;; definition for method 3 of type tfragment-debug-data -(defmethod inspect tfragment-debug-data ((obj tfragment-debug-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfragment-debug-data ((this tfragment-debug-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tfragment-debug-data) - (format #t "~1Tstats: #~%" (-> obj stats)) - (format #t "~1Tdebug-lines: ~A~%" (-> obj debug-lines)) + (format #t "[~8x] ~A~%" this 'tfragment-debug-data) + (format #t "~1Tstats: #~%" (-> this stats)) + (format #t "~1Tdebug-lines: ~A~%" (-> this debug-lines)) (label cfg-4) - obj + this ) ;; definition of type generic-tfragment @@ -57,15 +57,15 @@ ) ;; definition for method 3 of type generic-tfragment -(defmethod inspect generic-tfragment ((obj generic-tfragment)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tfragment ((this generic-tfragment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tfragment) - (format #t "~1Tdummy: ~D~%" (-> obj dummy)) + (format #t "[~8x] ~A~%" this 'generic-tfragment) + (format #t "~1Tdummy: ~D~%" (-> this dummy)) (label cfg-4) - obj + this ) ;; definition of type tfragment @@ -98,35 +98,35 @@ ) ;; definition for method 3 of type tfragment -(defmethod inspect tfragment ((obj tfragment)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfragment ((this tfragment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tcolor-index: ~D~%" (-> obj color-index)) - (format #t "~1Tdebug-data: #~%" (-> obj debug-data)) - (format #t "~1Tcolor-indices: #x~X~%" (-> obj color-indices)) - (format #t "~1Tcolors: #x~X~%" (-> obj color-indices)) - (format #t "~1Tdma-chain[3] @ #x~X~%" (-> obj dma-chain)) - (format #t "~1Tdma-common: #x~X~%" (-> obj dma-common)) - (format #t "~1Tdma-level-0: #x~X~%" (-> obj dma-common)) - (format #t "~1Tdma-base: #x~X~%" (-> obj dma-base)) - (format #t "~1Tdma-level-1: #x~X~%" (-> obj dma-level-1)) - (format #t "~1Tdma-qwc[4] @ #x~X~%" (-> obj dma-qwc)) - (format #t "~1Tshader: #x~X~%" (-> obj shader)) - (format #t "~1Tnum-shaders: ~D~%" (-> obj num-shaders)) - (format #t "~1Tnum-base-colors: ~D~%" (-> obj num-base-colors)) - (format #t "~1Tnum-level0-colors: ~D~%" (-> obj num-level0-colors)) - (format #t "~1Tnum-level1-colors: ~D~%" (-> obj num-level1-colors)) - (format #t "~1Tcolor-offset: ~D~%" (-> obj color-offset)) - (format #t "~1Tcolor-count: ~D~%" (-> obj color-count)) - (format #t "~1Ttexture-masks-index: ~D~%" (-> obj texture-masks-index)) - (format #t "~1Tgeneric: #~%" (-> obj generic)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tcolor-index: ~D~%" (-> this color-index)) + (format #t "~1Tdebug-data: #~%" (-> this debug-data)) + (format #t "~1Tcolor-indices: #x~X~%" (-> this color-indices)) + (format #t "~1Tcolors: #x~X~%" (-> this color-indices)) + (format #t "~1Tdma-chain[3] @ #x~X~%" (-> this dma-chain)) + (format #t "~1Tdma-common: #x~X~%" (-> this dma-common)) + (format #t "~1Tdma-level-0: #x~X~%" (-> this dma-common)) + (format #t "~1Tdma-base: #x~X~%" (-> this dma-base)) + (format #t "~1Tdma-level-1: #x~X~%" (-> this dma-level-1)) + (format #t "~1Tdma-qwc[4] @ #x~X~%" (-> this dma-qwc)) + (format #t "~1Tshader: #x~X~%" (-> this shader)) + (format #t "~1Tnum-shaders: ~D~%" (-> this num-shaders)) + (format #t "~1Tnum-base-colors: ~D~%" (-> this num-base-colors)) + (format #t "~1Tnum-level0-colors: ~D~%" (-> this num-level0-colors)) + (format #t "~1Tnum-level1-colors: ~D~%" (-> this num-level1-colors)) + (format #t "~1Tcolor-offset: ~D~%" (-> this color-offset)) + (format #t "~1Tcolor-count: ~D~%" (-> this color-count)) + (format #t "~1Ttexture-masks-index: ~D~%" (-> this texture-masks-index)) + (format #t "~1Tgeneric: #~%" (-> this generic)) (label cfg-4) - obj + this ) ;; definition of type drawable-inline-array-tfrag @@ -198,18 +198,18 @@ ) ;; definition for method 3 of type tfrag-dists -(defmethod inspect tfrag-dists ((obj tfrag-dists)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfrag-dists ((this tfrag-dists)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tfrag-dists) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj k0s)) - (format #t "~1Tvector[4] @ #x~X~%" (-> obj k0s)) - (format #t "~1Tk0s[2] @ #x~X~%" (-> obj k0s)) - (format #t "~1Tk1s[2] @ #x~X~%" (-> obj k1s)) + (format #t "[~8x] ~A~%" this 'tfrag-dists) + (format #t "~1Tdata[16] @ #x~X~%" (-> this k0s)) + (format #t "~1Tvector[4] @ #x~X~%" (-> this k0s)) + (format #t "~1Tk0s[2] @ #x~X~%" (-> this k0s)) + (format #t "~1Tk1s[2] @ #x~X~%" (-> this k1s)) (label cfg-4) - obj + this ) ;; definition of type tfrag-data @@ -236,29 +236,29 @@ ) ;; definition for method 3 of type tfrag-data -(defmethod inspect tfrag-data ((obj tfrag-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfrag-data ((this tfrag-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tfrag-data) - (format #t "~1Tdata[56] @ #x~X~%" (-> obj fog)) - (format #t "~1Tvector[14] @ #x~X~%" (-> obj fog)) - (format #t "~1Tfog: #~%" (-> obj fog)) - (format #t "~1Tval: #~%" (-> obj val)) - (format #t "~1Tstrgif: #~%" (-> obj strgif)) - (format #t "~1Tfangif: #~%" (-> obj fangif)) - (format #t "~1Tadgif: #~%" (-> obj adgif)) - (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~1Tinvh-scale: #~%" (-> obj invh-scale)) - (format #t "~1Tambient: #~%" (-> obj ambient)) - (format #t "~1Tguard: #~%" (-> obj guard)) - (format #t "~1Tdists: #~%" (-> obj dists)) - (format #t "~1Tk0s[2] @ #x~X~%" (-> obj dists)) - (format #t "~1Tk1s[2] @ #x~X~%" (-> obj dists k1s)) + (format #t "[~8x] ~A~%" this 'tfrag-data) + (format #t "~1Tdata[56] @ #x~X~%" (-> this fog)) + (format #t "~1Tvector[14] @ #x~X~%" (-> this fog)) + (format #t "~1Tfog: #~%" (-> this fog)) + (format #t "~1Tval: #~%" (-> this val)) + (format #t "~1Tstrgif: #~%" (-> this strgif)) + (format #t "~1Tfangif: #~%" (-> this fangif)) + (format #t "~1Tadgif: #~%" (-> this adgif)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~1Tinvh-scale: #~%" (-> this invh-scale)) + (format #t "~1Tambient: #~%" (-> this ambient)) + (format #t "~1Tguard: #~%" (-> this guard)) + (format #t "~1Tdists: #~%" (-> this dists)) + (format #t "~1Tk0s[2] @ #x~X~%" (-> this dists)) + (format #t "~1Tk1s[2] @ #x~X~%" (-> this dists k1s)) (label cfg-4) - obj + this ) ;; definition of type tfrag-control @@ -290,34 +290,34 @@ ) ;; definition for method 3 of type tfrag-control -(defmethod inspect tfrag-control ((obj tfrag-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfrag-control ((this tfrag-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tfrag-control) - (format #t "~1Tnum-base-points: ~D~%" (-> obj num-base-points)) - (format #t "~1Tnum-shared-base-points: ~D~%" (-> obj num-shared-base-points)) - (format #t "~1Tnum-level0-points: ~D~%" (-> obj num-level0-points)) - (format #t "~1Tnum-shared-level0-points: ~D~%" (-> obj num-shared-level0-points)) - (format #t "~1Tnum-level1-points: ~D~%" (-> obj num-level1-points)) - (format #t "~1Tnum-shared-level1-points: ~D~%" (-> obj num-shared-level1-points)) - (format #t "~1Tptr-vtxdata: ~D~%" (-> obj ptr-vtxdata)) - (format #t "~1Tptr-base-points: ~D~%" (-> obj ptr-base-points)) - (format #t "~1Tptr-shared-base-points: ~D~%" (-> obj ptr-shared-base-points)) - (format #t "~1Tptr-level0-points: ~D~%" (-> obj ptr-level0-points)) - (format #t "~1Tptr-shared-level0-points: ~D~%" (-> obj ptr-shared-level0-points)) - (format #t "~1Tptr-level1-points: ~D~%" (-> obj ptr-level1-points)) - (format #t "~1Tptr-shared-level1-points: ~D~%" (-> obj ptr-shared-level1-points)) - (format #t "~1Tptr-draw-points: ~D~%" (-> obj ptr-draw-points)) - (format #t "~1Tptr-interpolated-0: ~D~%" (-> obj ptr-interpolated-0)) - (format #t "~1Tptr-shared-interpolated-0: ~D~%" (-> obj ptr-shared-interpolated-0)) - (format #t "~1Tptr-interpolated1: ~D~%" (-> obj ptr-interpolated1)) - (format #t "~1Tptr-shared-interpolated1: ~D~%" (-> obj ptr-shared-interpolated1)) - (format #t "~1Tptr-strip-data: ~D~%" (-> obj ptr-strip-data)) - (format #t "~1Tptr-texture-data: ~D~%" (-> obj ptr-texture-data)) + (format #t "[~8x] ~A~%" this 'tfrag-control) + (format #t "~1Tnum-base-points: ~D~%" (-> this num-base-points)) + (format #t "~1Tnum-shared-base-points: ~D~%" (-> this num-shared-base-points)) + (format #t "~1Tnum-level0-points: ~D~%" (-> this num-level0-points)) + (format #t "~1Tnum-shared-level0-points: ~D~%" (-> this num-shared-level0-points)) + (format #t "~1Tnum-level1-points: ~D~%" (-> this num-level1-points)) + (format #t "~1Tnum-shared-level1-points: ~D~%" (-> this num-shared-level1-points)) + (format #t "~1Tptr-vtxdata: ~D~%" (-> this ptr-vtxdata)) + (format #t "~1Tptr-base-points: ~D~%" (-> this ptr-base-points)) + (format #t "~1Tptr-shared-base-points: ~D~%" (-> this ptr-shared-base-points)) + (format #t "~1Tptr-level0-points: ~D~%" (-> this ptr-level0-points)) + (format #t "~1Tptr-shared-level0-points: ~D~%" (-> this ptr-shared-level0-points)) + (format #t "~1Tptr-level1-points: ~D~%" (-> this ptr-level1-points)) + (format #t "~1Tptr-shared-level1-points: ~D~%" (-> this ptr-shared-level1-points)) + (format #t "~1Tptr-draw-points: ~D~%" (-> this ptr-draw-points)) + (format #t "~1Tptr-interpolated-0: ~D~%" (-> this ptr-interpolated-0)) + (format #t "~1Tptr-shared-interpolated-0: ~D~%" (-> this ptr-shared-interpolated-0)) + (format #t "~1Tptr-interpolated1: ~D~%" (-> this ptr-interpolated1)) + (format #t "~1Tptr-shared-interpolated1: ~D~%" (-> this ptr-shared-interpolated1)) + (format #t "~1Tptr-strip-data: ~D~%" (-> this ptr-strip-data)) + (format #t "~1Tptr-texture-data: ~D~%" (-> this ptr-texture-data)) (label cfg-4) - obj + this ) ;; definition of type tfrag-stats @@ -345,30 +345,30 @@ ) ;; definition for method 3 of type tfrag-stats -(defmethod inspect tfrag-stats ((obj tfrag-stats)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfrag-stats ((this tfrag-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tfrag-stats) - (format #t "~1Tfrom: ~D~%" (-> obj from)) - (format #t "~1Tto: ~D~%" (-> obj to)) - (format #t "~1Tcnt: ~D~%" (-> obj cnt)) - (format #t "~1Ttris: ~D~%" (-> obj tris)) - (format #t "~1Ttfaces: ~D~%" (-> obj tfaces)) - (format #t "~1Ttfrags: ~D~%" (-> obj tfrags)) - (format #t "~1Tdtris: ~D~%" (-> obj dtris)) - (format #t "~1Tbase-verts: ~D~%" (-> obj base-verts)) - (format #t "~1Tlevel0-verts: ~D~%" (-> obj level0-verts)) - (format #t "~1Tlevel1-verts: ~D~%" (-> obj level1-verts)) - (format #t "~1Tdma-cnt: ~D~%" (-> obj dma-cnt)) - (format #t "~1Tdma-dta: ~D~%" (-> obj dma-dta)) - (format #t "~1Tdma-tex: ~D~%" (-> obj dma-tex)) - (format #t "~1Tstrips: ~D~%" (-> obj strips)) - (format #t "~1Tdrawpoints: ~D~%" (-> obj drawpoints)) - (format #t "~1Tvif: ~D~%" (-> obj vif)) + (format #t "[~8x] ~A~%" this 'tfrag-stats) + (format #t "~1Tfrom: ~D~%" (-> this from)) + (format #t "~1Tto: ~D~%" (-> this to)) + (format #t "~1Tcnt: ~D~%" (-> this cnt)) + (format #t "~1Ttris: ~D~%" (-> this tris)) + (format #t "~1Ttfaces: ~D~%" (-> this tfaces)) + (format #t "~1Ttfrags: ~D~%" (-> this tfrags)) + (format #t "~1Tdtris: ~D~%" (-> this dtris)) + (format #t "~1Tbase-verts: ~D~%" (-> this base-verts)) + (format #t "~1Tlevel0-verts: ~D~%" (-> this level0-verts)) + (format #t "~1Tlevel1-verts: ~D~%" (-> this level1-verts)) + (format #t "~1Tdma-cnt: ~D~%" (-> this dma-cnt)) + (format #t "~1Tdma-dta: ~D~%" (-> this dma-dta)) + (format #t "~1Tdma-tex: ~D~%" (-> this dma-tex)) + (format #t "~1Tstrips: ~D~%" (-> this strips)) + (format #t "~1Tdrawpoints: ~D~%" (-> this drawpoints)) + (format #t "~1Tvif: ~D~%" (-> this vif)) (label cfg-4) - obj + this ) ;; definition of type tfrag-packet @@ -381,15 +381,15 @@ ) ;; definition for method 3 of type tfrag-packet -(defmethod inspect tfrag-packet ((obj tfrag-packet)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfrag-packet ((this tfrag-packet)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tfrag-packet) - (format #t "~1Ttag[2] @ #x~X~%" (-> obj tag)) + (format #t "[~8x] ~A~%" this 'tfrag-packet) + (format #t "~1Ttag[2] @ #x~X~%" (-> this tag)) (label cfg-4) - obj + this ) ;; definition of type tfrag-work @@ -426,39 +426,39 @@ ) ;; definition for method 3 of type tfrag-work -(defmethod inspect tfrag-work ((obj tfrag-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfrag-work ((this tfrag-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tfrag-work) - (format #t "~1Tbase-tmpl: #~%" (-> obj base-tmpl)) - (format #t "~1Tlevel-0-tmpl: #~%" (-> obj level-0-tmpl)) - (format #t "~1Tcommon-tmpl: #~%" (-> obj common-tmpl)) - (format #t "~1Tlevel-1-tmpl: #~%" (-> obj level-1-tmpl)) - (format #t "~1Tcolor-tmpl: #~%" (-> obj color-tmpl)) - (format #t "~1Tfrag-dists: #~%" (-> obj frag-dists)) - (format #t "~1Tmin-dist: #~%" (-> obj min-dist)) - (format #t "~1Tcolor-ptr: #~%" (-> obj color-ptr)) - (format #t "~1Ttr-stat-tfrag: #~%" (-> obj tr-stat-tfrag)) - (format #t "~1Ttr-stat-tfrag-scissor: #~%" (-> obj tr-stat-tfrag-scissor)) - (format #t "~1Tvu1-enable-tfrag: ~D~%" (-> obj vu1-enable-tfrag)) - (format #t "~1Tvu1-enable-tfrag-scissor: ~D~%" (-> obj vu1-enable-tfrag-scissor)) - (format #t "~1Tcur-vis-bits: ~D~%" (-> obj cur-vis-bits)) - (format #t "~1Tend-vis-bits: ~D~%" (-> obj end-vis-bits)) - (format #t "~1Tsrc-ptr: ~D~%" (-> obj src-ptr)) - (format #t "~1Tlast-call: ~D~%" (-> obj last-call)) - (format #t "~1Tdma-buffer: ~A~%" (-> obj dma-buffer)) - (format #t "~1Ttest-id: ~D~%" (-> obj test-id)) - (format #t "~1Twait-from-spr: ~D~%" (-> obj wait-from-spr)) - (format #t "~1Twait-to-spr: ~D~%" (-> obj wait-to-spr)) - (format #t "~1Tnear-wait-from-spr: ~D~%" (-> obj near-wait-from-spr)) - (format #t "~1Tnear-wait-to-spr: ~D~%" (-> obj near-wait-to-spr)) - (format #t "~1Tmax-fragment: ~D~%" (-> obj max-fragment)) - (format #t "~1Tmin-fragment: ~D~%" (-> obj min-fragment)) - (format #t "~1Ttexture-dists: #x~X~%" (-> obj texture-dists)) + (format #t "[~8x] ~A~%" this 'tfrag-work) + (format #t "~1Tbase-tmpl: #~%" (-> this base-tmpl)) + (format #t "~1Tlevel-0-tmpl: #~%" (-> this level-0-tmpl)) + (format #t "~1Tcommon-tmpl: #~%" (-> this common-tmpl)) + (format #t "~1Tlevel-1-tmpl: #~%" (-> this level-1-tmpl)) + (format #t "~1Tcolor-tmpl: #~%" (-> this color-tmpl)) + (format #t "~1Tfrag-dists: #~%" (-> this frag-dists)) + (format #t "~1Tmin-dist: #~%" (-> this min-dist)) + (format #t "~1Tcolor-ptr: #~%" (-> this color-ptr)) + (format #t "~1Ttr-stat-tfrag: #~%" (-> this tr-stat-tfrag)) + (format #t "~1Ttr-stat-tfrag-scissor: #~%" (-> this tr-stat-tfrag-scissor)) + (format #t "~1Tvu1-enable-tfrag: ~D~%" (-> this vu1-enable-tfrag)) + (format #t "~1Tvu1-enable-tfrag-scissor: ~D~%" (-> this vu1-enable-tfrag-scissor)) + (format #t "~1Tcur-vis-bits: ~D~%" (-> this cur-vis-bits)) + (format #t "~1Tend-vis-bits: ~D~%" (-> this end-vis-bits)) + (format #t "~1Tsrc-ptr: ~D~%" (-> this src-ptr)) + (format #t "~1Tlast-call: ~D~%" (-> this last-call)) + (format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~1Ttest-id: ~D~%" (-> this test-id)) + (format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~1Tnear-wait-from-spr: ~D~%" (-> this near-wait-from-spr)) + (format #t "~1Tnear-wait-to-spr: ~D~%" (-> this near-wait-to-spr)) + (format #t "~1Tmax-fragment: ~D~%" (-> this max-fragment)) + (format #t "~1Tmin-fragment: ~D~%" (-> this min-fragment)) + (format #t "~1Ttexture-dists: #x~X~%" (-> this texture-dists)) (label cfg-4) - obj + this ) ;; definition of type tfrag-dma @@ -475,19 +475,19 @@ ) ;; definition for method 3 of type tfrag-dma -(defmethod inspect tfrag-dma ((obj tfrag-dma)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfrag-dma ((this tfrag-dma)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tfrag-dma) - (format #t "~1Tbanka[16] @ #x~X~%" (-> obj banka)) - (format #t "~1Tbankb[16] @ #x~X~%" (-> obj bankb)) - (format #t "~1Touta[128] @ #x~X~%" (-> obj outa)) - (format #t "~1Toutb[128] @ #x~X~%" (-> obj outb)) - (format #t "~1Tcolors[2048] @ #x~X~%" (-> obj colors)) + (format #t "[~8x] ~A~%" this 'tfrag-dma) + (format #t "~1Tbanka[16] @ #x~X~%" (-> this banka)) + (format #t "~1Tbankb[16] @ #x~X~%" (-> this bankb)) + (format #t "~1Touta[128] @ #x~X~%" (-> this outa)) + (format #t "~1Toutb[128] @ #x~X~%" (-> this outb)) + (format #t "~1Tcolors[2048] @ #x~X~%" (-> this colors)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-methods_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-methods_REF.gc index bad7d3ad7a..08d31cfce3 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-methods_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/tfrag/tfrag-methods_REF.gc @@ -562,20 +562,20 @@ ) ;; definition for method 3 of type tfrag-init-data -(defmethod inspect tfrag-init-data ((obj tfrag-init-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect tfrag-init-data ((this tfrag-init-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tfrag-init-data) - (format #t "~1Ttfrag-bucket: ~D~%" (-> obj tfrag-bucket)) - (format #t "~1Ttfrag-scissor-bucket: ~D~%" (-> obj tfrag-scissor-bucket)) - (format #t "~1Ttfrag-trans-bucket: ~D~%" (-> obj tfrag-trans-bucket)) - (format #t "~1Ttfrag-scissor-trans-bucket: ~D~%" (-> obj tfrag-scissor-trans-bucket)) - (format #t "~1Ttfrag-water-bucket: ~D~%" (-> obj tfrag-water-bucket)) - (format #t "~1Ttfrag-water-scissor-bucket: ~D~%" (-> obj tfrag-water-scissor-bucket)) + (format #t "[~8x] ~A~%" this 'tfrag-init-data) + (format #t "~1Ttfrag-bucket: ~D~%" (-> this tfrag-bucket)) + (format #t "~1Ttfrag-scissor-bucket: ~D~%" (-> this tfrag-scissor-bucket)) + (format #t "~1Ttfrag-trans-bucket: ~D~%" (-> this tfrag-trans-bucket)) + (format #t "~1Ttfrag-scissor-trans-bucket: ~D~%" (-> this tfrag-scissor-trans-bucket)) + (format #t "~1Ttfrag-water-bucket: ~D~%" (-> this tfrag-water-bucket)) + (format #t "~1Ttfrag-water-scissor-bucket: ~D~%" (-> this tfrag-water-scissor-bucket)) (label cfg-4) - obj + this ) ;; definition for symbol *tfrag-init-table*, type (inline-array tfrag-init-data) @@ -705,11 +705,11 @@ ;; definition for method 10 of type drawable-tree-tfrag ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) +(defmethod draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable-tree-tfrag) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) - (set! (-> *background-work* tfrag-trees v1-1) obj) + (set! (-> *background-work* tfrag-trees v1-1) this) (set! (-> *background-work* tfrag-levels v1-1) a1-4) ) (+! (-> *background-work* tfrag-tree-count) 1) @@ -719,11 +719,11 @@ ;; definition for method 10 of type drawable-tree-tfrag-trans ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-tfrag-trans ((obj drawable-tree-tfrag-trans) (arg0 drawable-tree-tfrag-trans) (arg1 display-frame)) +(defmethod draw drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans) (arg0 drawable-tree-tfrag-trans) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-trans-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) - (set! (-> *background-work* tfrag-trans-trees v1-1) obj) + (set! (-> *background-work* tfrag-trans-trees v1-1) this) (set! (-> *background-work* tfrag-trans-levels v1-1) a1-4) ) (+! (-> *background-work* tfrag-trans-tree-count) 1) @@ -733,11 +733,11 @@ ;; definition for method 10 of type drawable-tree-tfrag-water ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-tfrag-water ((obj drawable-tree-tfrag-water) (arg0 drawable-tree-tfrag-water) (arg1 display-frame)) +(defmethod draw drawable-tree-tfrag-water ((this drawable-tree-tfrag-water) (arg0 drawable-tree-tfrag-water) (arg1 display-frame)) (let ((v1-1 (-> *background-work* tfrag-water-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) - (set! (-> *background-work* tfrag-water-trees v1-1) obj) + (set! (-> *background-work* tfrag-water-trees v1-1) this) (set! (-> *background-work* tfrag-water-levels v1-1) a1-4) ) (+! (-> *background-work* tfrag-water-tree-count) 1) @@ -747,8 +747,8 @@ ;; definition for method 13 of type tfragment ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats tfragment ((obj tfragment)) - (stats-tfrag-asm obj) +(defmethod collect-stats tfragment ((this tfragment)) + (stats-tfrag-asm this) 0 (none) ) @@ -756,7 +756,7 @@ ;; definition for method 13 of type drawable-tree-tfrag ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-tfrag ((obj drawable-tree-tfrag)) +(defmethod collect-stats drawable-tree-tfrag ((this drawable-tree-tfrag)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))) @@ -769,8 +769,8 @@ (let ((v1-15 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-15) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) 0 @@ -780,7 +780,7 @@ ;; definition for method 13 of type drawable-tree-tfrag-trans ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-tfrag-trans ((obj drawable-tree-tfrag-trans)) +(defmethod collect-stats drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))) @@ -793,8 +793,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) 0 @@ -804,7 +804,7 @@ ;; definition for method 13 of type drawable-tree-tfrag-water ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-tfrag-water ((obj drawable-tree-tfrag-water)) +(defmethod collect-stats drawable-tree-tfrag-water ((this drawable-tree-tfrag-water)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) (set! (-> *tfrag-work* vu1-enable-tfrag) (the-as int (logand (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))) @@ -817,8 +817,8 @@ (let ((v1-12 (-> *tfrag-work* frag-dists quad))) (set! (-> *tfrag-work* frag-dists quad) v1-12) ) - (dotimes (s5-0 (-> obj length)) - (collect-stats (-> obj arrays s5-0)) + (dotimes (s5-0 (-> this length)) + (collect-stats (-> this arrays s5-0)) ) ) 0 @@ -827,10 +827,10 @@ ;; definition for method 13 of type drawable-inline-array-tfrag ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag)) +(defmethod collect-stats drawable-inline-array-tfrag ((this drawable-inline-array-tfrag)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (if (vis-cull (-> s4-0 id)) (collect-stats s4-0) ) @@ -843,10 +843,10 @@ ;; definition for method 13 of type drawable-inline-array-tfrag-trans ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-inline-array-tfrag-trans ((obj drawable-inline-array-tfrag-trans)) +(defmethod collect-stats drawable-inline-array-tfrag-trans ((this drawable-inline-array-tfrag-trans)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (if (vis-cull (-> s4-0 id)) (collect-stats s4-0) ) @@ -859,10 +859,10 @@ ;; definition for method 13 of type drawable-inline-array-tfrag-water ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-inline-array-tfrag-water ((obj drawable-inline-array-tfrag-water)) +(defmethod collect-stats drawable-inline-array-tfrag-water ((this drawable-inline-array-tfrag-water)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) - (dotimes (s5-0 (-> obj length)) - (let ((s4-0 (-> obj data s5-0))) + (dotimes (s5-0 (-> this length)) + (let ((s4-0 (-> this data s5-0))) (if (vis-cull (-> s4-0 id)) (collect-stats s4-0) ) @@ -875,10 +875,10 @@ ;; definition for method 14 of type drawable-tree-tfrag ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-tree-tfrag ((obj drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-tree-tfrag ((this drawable-tree-tfrag) (arg0 drawable) (arg1 display-frame)) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)) - (dotimes (s4-0 (-> obj length)) - (let ((a1-1 (-> obj arrays s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((a1-1 (-> this arrays s4-0))) (debug-draw a1-1 a1-1 arg1) ) ) @@ -889,10 +889,10 @@ ;; definition for method 14 of type drawable-tree-tfrag-trans ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-tree-tfrag-trans ((obj drawable-tree-tfrag-trans) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-tree-tfrag-trans ((this drawable-tree-tfrag-trans) (arg0 drawable) (arg1 display-frame)) (when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)) - (dotimes (s4-0 (-> obj length)) - (let ((a1-1 (-> obj arrays s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((a1-1 (-> this arrays s4-0))) (debug-draw a1-1 a1-1 arg1) ) ) @@ -903,10 +903,10 @@ ;; definition for method 14 of type drawable-tree-tfrag-water ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-tree-tfrag-water ((obj drawable-tree-tfrag-water) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw drawable-tree-tfrag-water ((this drawable-tree-tfrag-water) (arg0 drawable) (arg1 display-frame)) (when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)) - (dotimes (s4-0 (-> obj length)) - (let ((a1-1 (-> obj arrays s4-0))) + (dotimes (s4-0 (-> this length)) + (let ((a1-1 (-> this arrays s4-0))) (debug-draw a1-1 a1-1 arg1) ) ) @@ -917,9 +917,9 @@ ;; definition for method 14 of type drawable-inline-array-tfrag ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw drawable-inline-array-tfrag ((obj drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) - (dotimes (s4-0 (-> obj length)) - (let ((s3-0 (-> obj data s4-0))) +(defmethod debug-draw drawable-inline-array-tfrag ((this drawable-inline-array-tfrag) (arg0 drawable) (arg1 display-frame)) + (dotimes (s4-0 (-> this length)) + (let ((s3-0 (-> this data s4-0))) (if (vis-cull (-> s3-0 id)) (debug-draw s3-0 s3-0 arg1) ) @@ -931,13 +931,9 @@ ;; definition for method 14 of type tfragment ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw tfragment ((obj tfragment) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw tfragment ((this tfragment) (arg0 drawable) (arg1 display-frame)) (-> arg1 global-buf) - (edge-debug-lines (-> obj debug-data debug-lines)) + (edge-debug-lines (-> this debug-data debug-lines)) 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/background/tie/generic-tie-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/tie/generic-tie-h_REF.gc index eeca28254b..e1f81ce1a5 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/tie/generic-tie-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/tie/generic-tie-h_REF.gc @@ -15,19 +15,19 @@ ) ;; definition for method 3 of type generic-tie-instance -(defmethod inspect generic-tie-instance ((obj generic-tie-instance)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-instance ((this generic-tie-instance)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-instance) - (format #t "~1Tmatrix-tag: #~%" (-> obj matrix-tag)) - (format #t "~1Tmatrix-data[6] @ #x~X~%" (-> obj matrix-data)) - (format #t "~1Tindex-tag: #~%" (-> obj index-tag)) - (format #t "~1Tindices[224] @ #x~X~%" (-> obj indices)) - (format #t "~1Tend-tag: #~%" (-> obj end-tag)) + (format #t "[~8x] ~A~%" this 'generic-tie-instance) + (format #t "~1Tmatrix-tag: #~%" (-> this matrix-tag)) + (format #t "~1Tmatrix-data[6] @ #x~X~%" (-> this matrix-data)) + (format #t "~1Tindex-tag: #~%" (-> this index-tag)) + (format #t "~1Tindices[224] @ #x~X~%" (-> this indices)) + (format #t "~1Tend-tag: #~%" (-> this end-tag)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-input @@ -48,23 +48,23 @@ ) ;; definition for method 3 of type generic-tie-input -(defmethod inspect generic-tie-input ((obj generic-tie-input)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-input ((this generic-tie-input)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-input) - (format #t "~1Tpalette-tag: #~%" (-> obj palette-tag)) - (format #t "~1Tpalette[128] @ #x~X~%" (-> obj palette)) - (format #t "~1Tmodel-tag: #~%" (-> obj model-tag)) - (format #t "~1Tmodel[146] @ #x~X~%" (-> obj model)) - (format #t "~1Tmatrix-tag: #~%" (-> obj matrix-tag)) - (format #t "~1Tmatrix-data[6] @ #x~X~%" (-> obj matrix-data)) - (format #t "~1Tindex-tag: #~%" (-> obj index-tag)) - (format #t "~1Tindices[224] @ #x~X~%" (-> obj indices)) - (format #t "~1Tend-tag: #~%" (-> obj end-tag)) + (format #t "[~8x] ~A~%" this 'generic-tie-input) + (format #t "~1Tpalette-tag: #~%" (-> this palette-tag)) + (format #t "~1Tpalette[128] @ #x~X~%" (-> this palette)) + (format #t "~1Tmodel-tag: #~%" (-> this model-tag)) + (format #t "~1Tmodel[146] @ #x~X~%" (-> this model)) + (format #t "~1Tmatrix-tag: #~%" (-> this matrix-tag)) + (format #t "~1Tmatrix-data[6] @ #x~X~%" (-> this matrix-data)) + (format #t "~1Tindex-tag: #~%" (-> this index-tag)) + (format #t "~1Tindices[224] @ #x~X~%" (-> this indices)) + (format #t "~1Tend-tag: #~%" (-> this end-tag)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-run-control @@ -88,26 +88,26 @@ ) ;; definition for method 3 of type generic-tie-run-control -(defmethod inspect generic-tie-run-control ((obj generic-tie-run-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-run-control ((this generic-tie-run-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-run-control) - (format #t "~1Tskip-bp2: ~D~%" (-> obj skip-bp2)) - (format #t "~1Tskip-ips: ~D~%" (-> obj skip-ips)) - (format #t "~1Tgifbuf-skip: ~D~%" (-> obj gifbuf-skip)) - (format #t "~1Tstrips: ~D~%" (-> obj strips)) - (format #t "~1Ttarget-bp1: ~D~%" (-> obj target-bp1)) - (format #t "~1Ttarget-bp2: ~D~%" (-> obj target-bp2)) - (format #t "~1Ttarget-ip1: ~D~%" (-> obj target-ip1)) - (format #t "~1Ttarget-ip2: ~D~%" (-> obj target-ip2)) - (format #t "~1Ttarget-bps: ~D~%" (-> obj target-bps)) - (format #t "~1Ttarget-ips: ~D~%" (-> obj target-ips)) - (format #t "~1Tis-generic: ~D~%" (-> obj is-generic)) - (format #t "~1Treserved: ~D~%" (-> obj reserved)) + (format #t "[~8x] ~A~%" this 'generic-tie-run-control) + (format #t "~1Tskip-bp2: ~D~%" (-> this skip-bp2)) + (format #t "~1Tskip-ips: ~D~%" (-> this skip-ips)) + (format #t "~1Tgifbuf-skip: ~D~%" (-> this gifbuf-skip)) + (format #t "~1Tstrips: ~D~%" (-> this strips)) + (format #t "~1Ttarget-bp1: ~D~%" (-> this target-bp1)) + (format #t "~1Ttarget-bp2: ~D~%" (-> this target-bp2)) + (format #t "~1Ttarget-ip1: ~D~%" (-> this target-ip1)) + (format #t "~1Ttarget-ip2: ~D~%" (-> this target-ip2)) + (format #t "~1Ttarget-bps: ~D~%" (-> this target-bps)) + (format #t "~1Ttarget-ips: ~D~%" (-> this target-ips)) + (format #t "~1Tis-generic: ~D~%" (-> this is-generic)) + (format #t "~1Treserved: ~D~%" (-> this reserved)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-base-point @@ -132,26 +132,26 @@ ;; definition for method 3 of type generic-tie-base-point ;; INFO: Used lq/sq -(defmethod inspect generic-tie-base-point ((obj generic-tie-base-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-base-point ((this generic-tie-base-point)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-base-point) - (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) - (format #t "~1Td0: ~D~%" (-> obj d0)) - (format #t "~1Tvtx: ~D~%" (-> obj vtx)) - (format #t "~1Tu: ~D~%" (-> obj u)) - (format #t "~1Tv: ~D~%" (-> obj v)) - (format #t "~1Ttex: ~D~%" (-> obj tex)) - (format #t "~1Tw: ~D~%" (-> obj w)) - (format #t "~1Td1: ~D~%" (-> obj d1)) + (format #t "[~8x] ~A~%" this 'generic-tie-base-point) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Td0: ~D~%" (-> this d0)) + (format #t "~1Tvtx: ~D~%" (-> this vtx)) + (format #t "~1Tu: ~D~%" (-> this u)) + (format #t "~1Tv: ~D~%" (-> this v)) + (format #t "~1Ttex: ~D~%" (-> this tex)) + (format #t "~1Tw: ~D~%" (-> this w)) + (format #t "~1Td1: ~D~%" (-> this d1)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-bps @@ -164,15 +164,15 @@ ) ;; definition for method 3 of type generic-tie-bps -(defmethod inspect generic-tie-bps ((obj generic-tie-bps)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-bps ((this generic-tie-bps)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-bps) - (format #t "~1Tbp[4] @ #x~X~%" (-> obj bp)) + (format #t "[~8x] ~A~%" this 'generic-tie-bps) + (format #t "~1Tbp[4] @ #x~X~%" (-> this bp)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-interp-point @@ -202,31 +202,31 @@ ;; definition for method 3 of type generic-tie-interp-point ;; INFO: Used lq/sq -(defmethod inspect generic-tie-interp-point ((obj generic-tie-interp-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-interp-point ((this generic-tie-interp-point)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-interp-point) - (format #t "~1Tdata[12] @ #x~X~%" (-> obj data)) - (format #t "~1Tquad: ~D~%" (-> (the-as (pointer uint128) obj) 0)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) - (format #t "~1Td0: ~D~%" (-> obj d0)) - (format #t "~1Tvtx0: ~D~%" (-> obj vtx0)) - (format #t "~1Tdx: ~D~%" (-> obj dx)) - (format #t "~1Tdy: ~D~%" (-> obj dy)) - (format #t "~1Tdz: ~D~%" (-> obj dz)) - (format #t "~1Tunused: ~D~%" (-> obj unused)) - (format #t "~1Tvtx1: ~D~%" (-> obj vtx1)) - (format #t "~1Tu: ~D~%" (-> obj u)) - (format #t "~1Tv: ~D~%" (-> obj v)) - (format #t "~1Ttex: ~D~%" (-> obj tex)) - (format #t "~1Tw: ~D~%" (-> obj w)) - (format #t "~1Td1: ~D~%" (-> obj d1)) + (format #t "[~8x] ~A~%" this 'generic-tie-interp-point) + (format #t "~1Tdata[12] @ #x~X~%" (-> this data)) + (format #t "~1Tquad: ~D~%" (-> (the-as (pointer uint128) this) 0)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Td0: ~D~%" (-> this d0)) + (format #t "~1Tvtx0: ~D~%" (-> this vtx0)) + (format #t "~1Tdx: ~D~%" (-> this dx)) + (format #t "~1Tdy: ~D~%" (-> this dy)) + (format #t "~1Tdz: ~D~%" (-> this dz)) + (format #t "~1Tunused: ~D~%" (-> this unused)) + (format #t "~1Tvtx1: ~D~%" (-> this vtx1)) + (format #t "~1Tu: ~D~%" (-> this u)) + (format #t "~1Tv: ~D~%" (-> this v)) + (format #t "~1Ttex: ~D~%" (-> this tex)) + (format #t "~1Tw: ~D~%" (-> this w)) + (format #t "~1Td1: ~D~%" (-> this d1)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-ips @@ -239,15 +239,15 @@ ) ;; definition for method 3 of type generic-tie-ips -(defmethod inspect generic-tie-ips ((obj generic-tie-ips)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-ips ((this generic-tie-ips)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-ips) - (format #t "~1Tip[2] @ #x~X~%" (-> obj ip)) + (format #t "[~8x] ~A~%" this 'generic-tie-ips) + (format #t "~1Tip[2] @ #x~X~%" (-> this ip)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-header @@ -269,24 +269,24 @@ ) ;; definition for method 3 of type generic-tie-header -(defmethod inspect generic-tie-header ((obj generic-tie-header)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-header ((this generic-tie-header)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-header) - (format #t "~1Teffect: ~D~%" (-> obj effect)) - (format #t "~1Tinterp-table-size: ~D~%" (-> obj interp-table-size)) - (format #t "~1Tnum-bps: ~D~%" (-> obj num-bps)) - (format #t "~1Tnum-ips: ~D~%" (-> obj num-ips)) - (format #t "~1Ttint-color: ~D~%" (-> obj tint-color)) - (format #t "~1Tindex-table-offset: ~D~%" (-> obj index-table-offset)) - (format #t "~1Tkick-table-offset: ~D~%" (-> obj kick-table-offset)) - (format #t "~1Tnormal-table-offset: ~D~%" (-> obj normal-table-offset)) - (format #t "~1Tinterp-table-offset: ~D~%" (-> obj interp-table-offset)) - (format #t "~1Tgsf-header: #~%" (-> obj gsf-header)) + (format #t "[~8x] ~A~%" this 'generic-tie-header) + (format #t "~1Teffect: ~D~%" (-> this effect)) + (format #t "~1Tinterp-table-size: ~D~%" (-> this interp-table-size)) + (format #t "~1Tnum-bps: ~D~%" (-> this num-bps)) + (format #t "~1Tnum-ips: ~D~%" (-> this num-ips)) + (format #t "~1Ttint-color: ~D~%" (-> this tint-color)) + (format #t "~1Tindex-table-offset: ~D~%" (-> this index-table-offset)) + (format #t "~1Tkick-table-offset: ~D~%" (-> this kick-table-offset)) + (format #t "~1Tnormal-table-offset: ~D~%" (-> this normal-table-offset)) + (format #t "~1Tinterp-table-offset: ~D~%" (-> this interp-table-offset)) + (format #t "~1Tgsf-header: #~%" (-> this gsf-header)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-matrix @@ -301,17 +301,17 @@ ) ;; definition for method 3 of type generic-tie-matrix -(defmethod inspect generic-tie-matrix ((obj generic-tie-matrix)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-matrix ((this generic-tie-matrix)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-matrix) - (format #t "~1Tmatrix: #~%" (-> obj matrix)) - (format #t "~1Tmorph: #~%" (-> obj morph)) - (format #t "~1Tfog: #~%" (-> obj fog)) + (format #t "[~8x] ~A~%" this 'generic-tie-matrix) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tmorph: #~%" (-> this morph)) + (format #t "~1Tfog: #~%" (-> this fog)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-normal @@ -327,18 +327,18 @@ ) ;; definition for method 3 of type generic-tie-normal -(defmethod inspect generic-tie-normal ((obj generic-tie-normal)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-normal ((this generic-tie-normal)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-normal) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) - (format #t "~1Tdummy: ~D~%" (-> obj dummy)) + (format #t "[~8x] ~A~%" this 'generic-tie-normal) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Tdummy: ~D~%" (-> this dummy)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-control @@ -365,29 +365,29 @@ ) ;; definition for method 3 of type generic-tie-control -(defmethod inspect generic-tie-control ((obj generic-tie-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-control ((this generic-tie-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-control) - (format #t "~1Tptr-palette: #x~X~%" (-> obj ptr-palette)) - (format #t "~1Tptr-shaders: #x~X~%" (-> obj ptr-shaders)) - (format #t "~1Tptr-runctrl: #~%" (-> obj ptr-runctrl)) - (format #t "~1Tptr-verts: #x~X~%" (-> obj ptr-verts)) - (format #t "~1Tptr-generic: #~%" (-> obj ptr-generic)) - (format #t "~1Tptr-dps: #x~X~%" (-> obj ptr-dps)) - (format #t "~1Tptr-kicks: #x~X~%" (-> obj ptr-kicks)) - (format #t "~1Tptr-normals: #x~X~%" (-> obj ptr-normals)) - (format #t "~1Tptr-interp: #x~X~%" (-> obj ptr-interp)) - (format #t "~1Tptr-mtxs: #~%" (-> obj ptr-mtxs)) - (format #t "~1Tptr-cinds: #x~X~%" (-> obj ptr-cinds)) - (format #t "~1Tnext-instance: #x~X~%" (-> obj next-instance)) - (format #t "~1Tnext-model: #x~X~%" (-> obj next-model)) - (format #t "~1Tnext-is-model: ~D~%" (-> obj next-is-model)) - (format #t "~1Ttie-type: ~D~%" (-> obj tie-type)) + (format #t "[~8x] ~A~%" this 'generic-tie-control) + (format #t "~1Tptr-palette: #x~X~%" (-> this ptr-palette)) + (format #t "~1Tptr-shaders: #x~X~%" (-> this ptr-shaders)) + (format #t "~1Tptr-runctrl: #~%" (-> this ptr-runctrl)) + (format #t "~1Tptr-verts: #x~X~%" (-> this ptr-verts)) + (format #t "~1Tptr-generic: #~%" (-> this ptr-generic)) + (format #t "~1Tptr-dps: #x~X~%" (-> this ptr-dps)) + (format #t "~1Tptr-kicks: #x~X~%" (-> this ptr-kicks)) + (format #t "~1Tptr-normals: #x~X~%" (-> this ptr-normals)) + (format #t "~1Tptr-interp: #x~X~%" (-> this ptr-interp)) + (format #t "~1Tptr-mtxs: #~%" (-> this ptr-mtxs)) + (format #t "~1Tptr-cinds: #x~X~%" (-> this ptr-cinds)) + (format #t "~1Tnext-instance: #x~X~%" (-> this next-instance)) + (format #t "~1Tnext-model: #x~X~%" (-> this next-model)) + (format #t "~1Tnext-is-model: ~D~%" (-> this next-is-model)) + (format #t "~1Ttie-type: ~D~%" (-> this tie-type)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-stats @@ -408,23 +408,23 @@ ) ;; definition for method 3 of type generic-tie-stats -(defmethod inspect generic-tie-stats ((obj generic-tie-stats)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-stats ((this generic-tie-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-stats) - (format #t "~1Tnum-bps: ~D~%" (-> obj num-bps)) - (format #t "~1Tnum-ips: ~D~%" (-> obj num-ips)) - (format #t "~1Tnum-dps: ~D~%" (-> obj num-dps)) - (format #t "~1Tnum-shaders: ~D~%" (-> obj num-shaders)) - (format #t "~1Tnum-models: ~D~%" (-> obj num-models)) - (format #t "~1Tnum-instances: ~D~%" (-> obj num-instances)) - (format #t "~1Tnum-waits: ~D~%" (-> obj num-waits)) - (format #t "~1Tnum-qwc: ~D~%" (-> obj num-qwc)) - (format #t "~1Tmax-qwc: ~D~%" (-> obj max-qwc)) + (format #t "[~8x] ~A~%" this 'generic-tie-stats) + (format #t "~1Tnum-bps: ~D~%" (-> this num-bps)) + (format #t "~1Tnum-ips: ~D~%" (-> this num-ips)) + (format #t "~1Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~1Tnum-shaders: ~D~%" (-> this num-shaders)) + (format #t "~1Tnum-models: ~D~%" (-> this num-models)) + (format #t "~1Tnum-instances: ~D~%" (-> this num-instances)) + (format #t "~1Tnum-waits: ~D~%" (-> this num-waits)) + (format #t "~1Tnum-qwc: ~D~%" (-> this num-qwc)) + (format #t "~1Tmax-qwc: ~D~%" (-> this max-qwc)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-calls @@ -441,18 +441,18 @@ ) ;; definition for method 3 of type generic-tie-calls -(defmethod inspect generic-tie-calls ((obj generic-tie-calls)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-calls ((this generic-tie-calls)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-calls) - (format #t "~1Tgeneric-prepare-dma-double: ~A~%" (-> obj generic-prepare-dma-double)) - (format #t "~1Tgeneric-envmap-dproc: ~A~%" (-> obj generic-envmap-dproc)) - (format #t "~1Tgeneric-interp-dproc: ~A~%" (-> obj generic-interp-dproc)) - (format #t "~1Tgeneric-no-light-dproc: ~A~%" (-> obj generic-no-light-dproc)) + (format #t "[~8x] ~A~%" this 'generic-tie-calls) + (format #t "~1Tgeneric-prepare-dma-double: ~A~%" (-> this generic-prepare-dma-double)) + (format #t "~1Tgeneric-envmap-dproc: ~A~%" (-> this generic-envmap-dproc)) + (format #t "~1Tgeneric-interp-dproc: ~A~%" (-> this generic-interp-dproc)) + (format #t "~1Tgeneric-no-light-dproc: ~A~%" (-> this generic-no-light-dproc)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-shadow @@ -474,23 +474,23 @@ ) ;; definition for method 3 of type generic-tie-shadow -(defmethod inspect generic-tie-shadow ((obj generic-tie-shadow)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-shadow ((this generic-tie-shadow)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-shadow) - (format #t "~1Tout-buf: #~%" (-> obj out-buf)) - (format #t "~1Tcur-buf: #x~X~%" (-> obj cur-buf)) - (format #t "~1Ttie-type: ~D~%" (-> obj tie-type)) - (format #t "~1Tptr-inst: #x~X~%" (-> obj ptr-inst)) - (format #t "~1Tptr-buf: #x~X~%" (-> obj ptr-buf)) - (format #t "~1Tinst-xor: ~D~%" (-> obj inst-xor)) - (format #t "~1Tend-of-chain: ~D~%" (-> obj end-of-chain)) - (format #t "~1Twrite-limit: ~D~%" (-> obj write-limit)) - (format #t "~1Tcalls: #~%" (-> obj calls)) + (format #t "[~8x] ~A~%" this 'generic-tie-shadow) + (format #t "~1Tout-buf: #~%" (-> this out-buf)) + (format #t "~1Tcur-buf: #x~X~%" (-> this cur-buf)) + (format #t "~1Ttie-type: ~D~%" (-> this tie-type)) + (format #t "~1Tptr-inst: #x~X~%" (-> this ptr-inst)) + (format #t "~1Tptr-buf: #x~X~%" (-> this ptr-buf)) + (format #t "~1Tinst-xor: ~D~%" (-> this inst-xor)) + (format #t "~1Tend-of-chain: ~D~%" (-> this end-of-chain)) + (format #t "~1Twrite-limit: ~D~%" (-> this write-limit)) + (format #t "~1Tcalls: #~%" (-> this calls)) (label cfg-4) - obj + this ) ;; definition of type generic-tie-work @@ -509,26 +509,22 @@ ) ;; definition for method 3 of type generic-tie-work -(defmethod inspect generic-tie-work ((obj generic-tie-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-tie-work ((this generic-tie-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-tie-work) - (format #t "~1Tcontrol: #~%" (-> obj control)) - (format #t "~1Tinterp-job: #~%" (-> obj interp-job)) - (format #t "~1Tshadow: #~%" (-> obj shadow)) - (format #t "~1Tinput-a: #~%" (-> obj input-a)) - (format #t "~1Tinput-b: #~%" (-> obj input-b)) - (format #t "~1Tinst-buf: #~%" (-> obj inst-buf)) - (format #t "~1Tpalette-buf[128] @ #x~X~%" (-> obj palette-buf)) + (format #t "[~8x] ~A~%" this 'generic-tie-work) + (format #t "~1Tcontrol: #~%" (-> this control)) + (format #t "~1Tinterp-job: #~%" (-> this interp-job)) + (format #t "~1Tshadow: #~%" (-> this shadow)) + (format #t "~1Tinput-a: #~%" (-> this input-a)) + (format #t "~1Tinput-b: #~%" (-> this input-b)) + (format #t "~1Tinst-buf: #~%" (-> this inst-buf)) + (format #t "~1Tpalette-buf[128] @ #x~X~%" (-> this palette-buf)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/background/tie/tie-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/tie/tie-h_REF.gc index e05b409d50..10ad64bda9 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/tie/tie-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/tie/tie-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type tie-fragment-debug -(defmethod inspect tie-fragment-debug ((obj tie-fragment-debug)) - (when (not obj) - (set! obj obj) +(defmethod inspect tie-fragment-debug ((this tie-fragment-debug)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tie-fragment-debug) - (format #t "~1Tnum-tris: ~D~%" (-> obj num-tris)) - (format #t "~1Tnum-dverts: ~D~%" (-> obj num-dverts)) - (format #t "~1Tdebug-lines: ~A~%" (-> obj debug-lines)) + (format #t "[~8x] ~A~%" this 'tie-fragment-debug) + (format #t "~1Tnum-tris: ~D~%" (-> this num-tris)) + (format #t "~1Tnum-dverts: ~D~%" (-> this num-dverts)) + (format #t "~1Tdebug-lines: ~A~%" (-> this debug-lines)) (label cfg-4) - obj + this ) ;; definition of type tie-fragment @@ -50,31 +50,31 @@ ) ;; definition for method 3 of type tie-fragment -(defmethod inspect tie-fragment ((obj tie-fragment)) - (when (not obj) - (set! obj obj) +(defmethod inspect tie-fragment ((this tie-fragment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tgif-ref: #x~X~%" (-> obj gif-ref)) - (format #t "~1Tpoint-ref: #x~X~%" (-> obj point-ref)) - (format #t "~1Tcolor-index: ~D~%" (-> obj color-index)) - (format #t "~1Tbase-colors: ~D~%" (-> obj base-colors)) - (format #t "~1Ttex-count: ~D~%" (-> obj tex-count)) - (format #t "~1Tgif-count: ~D~%" (-> obj gif-count)) - (format #t "~1Tvertex-count: ~D~%" (-> obj vertex-count)) - (format #t "~1Tcolor-count: ~D~%" (-> obj color-count)) - (format #t "~1Tdp-ref: #x~X~%" (-> obj dp-ref)) - (format #t "~1Tdp-qwc: ~D~%" (-> obj dp-qwc)) - (format #t "~1Tgeneric-ref: #x~X~%" (-> obj generic-ref)) - (format #t "~1Tgeneric-count: ~D~%" (-> obj generic-count)) - (format #t "~1Tnormal-count: ~D~%" (-> obj normal-count)) - (format #t "~1Tnormal-ref: #x~X~%" (-> obj normal-ref)) - (format #t "~1Tdebug: #~%" (-> obj debug)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tgif-ref: #x~X~%" (-> this gif-ref)) + (format #t "~1Tpoint-ref: #x~X~%" (-> this point-ref)) + (format #t "~1Tcolor-index: ~D~%" (-> this color-index)) + (format #t "~1Tbase-colors: ~D~%" (-> this base-colors)) + (format #t "~1Ttex-count: ~D~%" (-> this tex-count)) + (format #t "~1Tgif-count: ~D~%" (-> this gif-count)) + (format #t "~1Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~1Tcolor-count: ~D~%" (-> this color-count)) + (format #t "~1Tdp-ref: #x~X~%" (-> this dp-ref)) + (format #t "~1Tdp-qwc: ~D~%" (-> this dp-qwc)) + (format #t "~1Tgeneric-ref: #x~X~%" (-> this generic-ref)) + (format #t "~1Tgeneric-count: ~D~%" (-> this generic-count)) + (format #t "~1Tnormal-count: ~D~%" (-> this normal-count)) + (format #t "~1Tnormal-ref: #x~X~%" (-> this normal-ref)) + (format #t "~1Tdebug: #~%" (-> this debug)) (label cfg-4) - obj + this ) ;; definition of type instance-tie @@ -90,24 +90,24 @@ ) ;; definition for method 3 of type instance-tie -(defmethod inspect instance-tie ((obj instance-tie)) - (when (not obj) - (set! obj obj) +(defmethod inspect instance-tie ((this instance-tie)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tbucket-index: ~D~%" (-> obj bucket-index)) - (format #t "~1Torigin: #~%" (-> obj origin)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Twind-index: ~D~%" (-> obj wind-index)) - (format #t "~1Tcolor-indices: #x~X~%" (-> obj color-indices)) - (format #t "~1Tbucket-ptr: ~A~%" (-> obj bucket-ptr)) - (format #t "~1Tmax-scale: ~D~%" (-> obj max-scale)) - (format #t "~1Trmin-scale: ~D~%" (-> obj rmin-scale)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tbucket-index: ~D~%" (-> this bucket-index)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Twind-index: ~D~%" (-> this wind-index)) + (format #t "~1Tcolor-indices: #x~X~%" (-> this color-indices)) + (format #t "~1Tbucket-ptr: ~A~%" (-> this bucket-ptr)) + (format #t "~1Tmax-scale: ~D~%" (-> this max-scale)) + (format #t "~1Trmin-scale: ~D~%" (-> this rmin-scale)) (label cfg-4) - obj + this ) ;; definition of type drawable-inline-array-instance-tie @@ -130,22 +130,22 @@ ) ;; definition for method 3 of type drawable-tree-instance-tie -(defmethod inspect drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) - (when (not obj) - (set! obj obj) +(defmethod inspect drawable-tree-instance-tie ((this drawable-tree-instance-tie)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> obj data s5-0)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> this data s5-0)) ) - (format #t "~1Tprototypes: ~A~%" (-> obj prototypes)) + (format #t "~1Tprototypes: ~A~%" (-> this prototypes)) (label cfg-7) - obj + this ) ;; definition of type prototype-tie @@ -175,22 +175,22 @@ ) ;; definition for method 3 of type tie-matrix -(defmethod inspect tie-matrix ((obj tie-matrix)) - (when (not obj) - (set! obj obj) +(defmethod inspect tie-matrix ((this tie-matrix)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tie-matrix) - (format #t "~1Tmat: #~%" (-> obj mat)) - (format #t "~1Tmorph: #~%" (-> obj morph)) - (format #t "~1Tfog: #~%" (-> obj fog)) - (format #t "~1Tenvmap-flag: ~D~%" (-> obj envmap-flag)) - (format #t "~1Tguard-flag: ~D~%" (-> obj guard-flag)) - (format #t "~1Tvertex-alpha: ~f~%" (-> obj vertex-alpha)) - (format #t "~1Tfog-value: ~f~%" (-> obj fog-value)) - (format #t "~1Tfixed-alpha: ~f~%" (-> obj fixed-alpha)) + (format #t "[~8x] ~A~%" this 'tie-matrix) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Tmorph: #~%" (-> this morph)) + (format #t "~1Tfog: #~%" (-> this fog)) + (format #t "~1Tenvmap-flag: ~D~%" (-> this envmap-flag)) + (format #t "~1Tguard-flag: ~D~%" (-> this guard-flag)) + (format #t "~1Tvertex-alpha: ~f~%" (-> this vertex-alpha)) + (format #t "~1Tfog-value: ~f~%" (-> this fog-value)) + (format #t "~1Tfixed-alpha: ~f~%" (-> this fixed-alpha)) (label cfg-4) - obj + this ) ;; definition of type instance-tie-work @@ -248,60 +248,60 @@ ) ;; definition for method 3 of type instance-tie-work -(defmethod inspect instance-tie-work ((obj instance-tie-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect instance-tie-work ((this instance-tie-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'instance-tie-work) - (format #t "~1Twind-const: #~%" (-> obj wind-const)) - (format #t "~1Thmge-d: #~%" (-> obj hmge-d)) - (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~1Twind-force: #~%" (-> obj wind-force)) - (format #t "~1Tconstant: #~%" (-> obj constant)) - (format #t "~1Tfar-morph: #~%" (-> obj far-morph)) - (format #t "~1Tdist-test: #~%" (-> obj dist-test)) - (format #t "~1Tmin-dist: #~%" (-> obj min-dist)) - (format #t "~1Tguard-plane[4] @ #x~X~%" (-> obj guard-plane)) - (format #t "~1Tupload-color-0: #~%" (-> obj upload-color-0)) - (format #t "~1Tupload-color-1: #~%" (-> obj upload-color-1)) - (format #t "~1Tupload-color-2: #~%" (-> obj upload-color-2)) - (format #t "~1Tupload-color-ret: #~%" (-> obj upload-color-ret)) - (format #t "~1Tupload-color-temp: #~%" (-> obj upload-color-temp)) - (format #t "~1Tgeneric-color-0: #~%" (-> obj generic-color-0)) - (format #t "~1Tgeneric-color-1: #~%" (-> obj generic-color-1)) - (format #t "~1Tgeneric-color-end: #~%" (-> obj generic-color-end)) - (format #t "~1Tenvmap-color-0: #~%" (-> obj envmap-color-0)) - (format #t "~1Tenvmap-color-1: #~%" (-> obj envmap-color-1)) - (format #t "~1Ttie-scissor-perspective-matrix: #~%" (-> obj tie-scissor-perspective-matrix)) - (format #t "~1Ttod-env-color: #~%" (-> obj tod-env-color)) - (format #t "~1Tmorph-temp: #~%" (-> obj morph-temp)) - (format #t "~1Tfog-temp: #~%" (-> obj fog-temp)) - (format #t "~1Tfade-temp: ~f~%" (-> obj fade-temp)) - (format #t "~1Twind-vectors: #x~X~%" (-> obj wind-vectors)) - (format #t "~1Ttest-id: ~D~%" (-> obj test-id)) - (format #t "~1Ttest-id2: ~D~%" (-> obj test-id2)) - (format #t "~1Tdma-buffer: ~A~%" (-> obj dma-buffer)) - (format #t "~1Tto-spr: ~D~%" (-> obj to-spr)) - (format #t "~1Tfrom-spr: ~D~%" (-> obj from-spr)) - (format #t "~1Twind-work: ~D~%" (-> obj wind-work)) - (format #t "~1Tcur-vis-bits: ~D~%" (-> obj cur-vis-bits)) - (format #t "~1Tend-vis-bits: ~D~%" (-> obj end-vis-bits)) - (format #t "~1Trefl-fade-fac: ~f~%" (-> obj refl-fade-fac)) - (format #t "~1Trefl-fade-end: ~f~%" (-> obj refl-fade-end)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tvanish-flag: ~D~%" (-> obj vanish-flag)) - (format #t "~1Ttranslucent-flag: ~D~%" (-> obj translucent-flag)) - (format #t "~1Twait-from-spr: ~D~%" (-> obj wait-from-spr)) - (format #t "~1Twait-to-spr: ~D~%" (-> obj wait-to-spr)) - (format #t "~1Tuse-etie: ~A~%" (-> obj use-etie)) - (format #t "~1Tbuffer-start: #x~X~%" (-> obj buffer-start)) - (format #t "~1Tbuffer-end: #x~X~%" (-> obj buffer-end)) - (format #t "~1Ttfrag-dists: #x~X~%" (-> obj tfrag-dists)) - (format #t "~1Talpha-dists: #x~X~%" (-> obj alpha-dists)) - (format #t "~1Twater-dists: #x~X~%" (-> obj water-dists)) + (format #t "[~8x] ~A~%" this 'instance-tie-work) + (format #t "~1Twind-const: #~%" (-> this wind-const)) + (format #t "~1Thmge-d: #~%" (-> this hmge-d)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Twind-force: #~%" (-> this wind-force)) + (format #t "~1Tconstant: #~%" (-> this constant)) + (format #t "~1Tfar-morph: #~%" (-> this far-morph)) + (format #t "~1Tdist-test: #~%" (-> this dist-test)) + (format #t "~1Tmin-dist: #~%" (-> this min-dist)) + (format #t "~1Tguard-plane[4] @ #x~X~%" (-> this guard-plane)) + (format #t "~1Tupload-color-0: #~%" (-> this upload-color-0)) + (format #t "~1Tupload-color-1: #~%" (-> this upload-color-1)) + (format #t "~1Tupload-color-2: #~%" (-> this upload-color-2)) + (format #t "~1Tupload-color-ret: #~%" (-> this upload-color-ret)) + (format #t "~1Tupload-color-temp: #~%" (-> this upload-color-temp)) + (format #t "~1Tgeneric-color-0: #~%" (-> this generic-color-0)) + (format #t "~1Tgeneric-color-1: #~%" (-> this generic-color-1)) + (format #t "~1Tgeneric-color-end: #~%" (-> this generic-color-end)) + (format #t "~1Tenvmap-color-0: #~%" (-> this envmap-color-0)) + (format #t "~1Tenvmap-color-1: #~%" (-> this envmap-color-1)) + (format #t "~1Ttie-scissor-perspective-matrix: #~%" (-> this tie-scissor-perspective-matrix)) + (format #t "~1Ttod-env-color: #~%" (-> this tod-env-color)) + (format #t "~1Tmorph-temp: #~%" (-> this morph-temp)) + (format #t "~1Tfog-temp: #~%" (-> this fog-temp)) + (format #t "~1Tfade-temp: ~f~%" (-> this fade-temp)) + (format #t "~1Twind-vectors: #x~X~%" (-> this wind-vectors)) + (format #t "~1Ttest-id: ~D~%" (-> this test-id)) + (format #t "~1Ttest-id2: ~D~%" (-> this test-id2)) + (format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~1Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~1Tfrom-spr: ~D~%" (-> this from-spr)) + (format #t "~1Twind-work: ~D~%" (-> this wind-work)) + (format #t "~1Tcur-vis-bits: ~D~%" (-> this cur-vis-bits)) + (format #t "~1Tend-vis-bits: ~D~%" (-> this end-vis-bits)) + (format #t "~1Trefl-fade-fac: ~f~%" (-> this refl-fade-fac)) + (format #t "~1Trefl-fade-end: ~f~%" (-> this refl-fade-end)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tvanish-flag: ~D~%" (-> this vanish-flag)) + (format #t "~1Ttranslucent-flag: ~D~%" (-> this translucent-flag)) + (format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~1Tuse-etie: ~A~%" (-> this use-etie)) + (format #t "~1Tbuffer-start: #x~X~%" (-> this buffer-start)) + (format #t "~1Tbuffer-end: #x~X~%" (-> this buffer-end)) + (format #t "~1Ttfrag-dists: #x~X~%" (-> this tfrag-dists)) + (format #t "~1Talpha-dists: #x~X~%" (-> this alpha-dists)) + (format #t "~1Twater-dists: #x~X~%" (-> this water-dists)) (label cfg-4) - obj + this ) ;; definition of type instance-tie-dma @@ -318,19 +318,19 @@ ) ;; definition for method 3 of type instance-tie-dma -(defmethod inspect instance-tie-dma ((obj instance-tie-dma)) - (when (not obj) - (set! obj obj) +(defmethod inspect instance-tie-dma ((this instance-tie-dma)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'instance-tie-dma) - (format #t "~1Tbanka[32] @ #x~X~%" (-> obj banka)) - (format #t "~1Tbankb[32] @ #x~X~%" (-> obj bankb)) - (format #t "~1Touta[256] @ #x~X~%" (-> obj outa)) - (format #t "~1Toutb[256] @ #x~X~%" (-> obj outb)) - (format #t "~1Twork: #~%" (-> obj work 0)) + (format #t "[~8x] ~A~%" this 'instance-tie-dma) + (format #t "~1Tbanka[32] @ #x~X~%" (-> this banka)) + (format #t "~1Tbankb[32] @ #x~X~%" (-> this bankb)) + (format #t "~1Touta[256] @ #x~X~%" (-> this outa)) + (format #t "~1Toutb[256] @ #x~X~%" (-> this outb)) + (format #t "~1Twork: #~%" (-> this work 0)) (label cfg-4) - obj + this ) ;; definition of type prototype-tie-work @@ -422,94 +422,94 @@ ) ;; definition for method 3 of type prototype-tie-work -(defmethod inspect prototype-tie-work ((obj prototype-tie-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect prototype-tie-work ((this prototype-tie-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'prototype-tie-work) - (format #t "~1Tupload-flushe: #~%" (-> obj upload-flushe)) - (format #t "~1Tupload-palette: #~%" (-> obj upload-palette)) - (format #t "~1Tupload-model-0: #~%" (-> obj upload-model-0)) - (format #t "~1Tupload-model-1: #~%" (-> obj upload-model-1)) - (format #t "~1Tupload-model-2: #~%" (-> obj upload-model-2)) - (format #t "~1Tupload-model-3: #~%" (-> obj upload-model-3)) - (format #t "~1Tupload-model-near-0: #~%" (-> obj upload-model-near-0)) - (format #t "~1Tupload-model-near-1: #~%" (-> obj upload-model-near-1)) - (format #t "~1Tupload-model-near-2: #~%" (-> obj upload-model-near-2)) - (format #t "~1Tupload-model-near-3: #~%" (-> obj upload-model-near-3)) - (format #t "~1Tupload-model-near-4: #~%" (-> obj upload-model-near-4)) - (format #t "~1Tenvmap-palette: #~%" (-> obj envmap-palette)) - (format #t "~1Tenvmap-shader: #~%" (-> obj envmap-shader)) - (format #t "~1Tupload-envmap-0: #~%" (-> obj upload-envmap-0)) - (format #t "~1Tupload-envmap-1: #~%" (-> obj upload-envmap-1)) - (format #t "~1Tupload-envmap-2: #~%" (-> obj upload-envmap-2)) - (format #t "~1Tupload-envmap-3: #~%" (-> obj upload-envmap-3)) - (format #t "~1Tupload-envmap-4: #~%" (-> obj upload-envmap-4)) - (format #t "~1Tupload-envmap-scissor-4: #~%" (-> obj upload-envmap-scissor-4)) - (format #t "~1Tgeneric-palette: #~%" (-> obj generic-palette)) - (format #t "~1Tgeneric-model-0: #~%" (-> obj generic-model-0)) - (format #t "~1Tgeneric-model-1: #~%" (-> obj generic-model-1)) - (format #t "~1Tgeneric-model-2: #~%" (-> obj generic-model-2)) - (format #t "~1Tmodel-next: #~%" (-> obj model-next)) - (format #t "~1Tclamp: ~D~%" (-> obj clamp)) - (format #t "~1Tprototype-array: ~A~%" (-> obj prototype-array)) - (format #t "~1Twait-from-spr: ~D~%" (-> obj wait-from-spr)) - (format #t "~1Twait-to-spr: ~D~%" (-> obj wait-to-spr)) - (format #t "~1Tmood: #~%" (-> obj mood)) - (format #t "~1Tlast[16] @ #x~X~%" (-> obj last)) - (format #t "~1Tnext[16] @ #x~X~%" (-> obj next)) - (format #t "~1Tcount[16] @ #x~X~%" (-> obj count)) - (format #t "~1Ttie-last: #x~X~%" (-> obj tie-last)) - (format #t "~1Ttie-next: #x~X~%" (-> obj tie-next)) - (format #t "~1Ttie-count: ~D~%" (-> obj tie-count)) - (format #t "~1Ttrans-last: #x~X~%" (-> obj trans-last)) - (format #t "~1Ttrans-next: #x~X~%" (-> obj trans-next)) - (format #t "~1Ttrans-count: ~D~%" (-> obj trans-count)) - (format #t "~1Twater-last: #x~X~%" (-> obj water-last)) - (format #t "~1Twater-next: #x~X~%" (-> obj water-next)) - (format #t "~1Twater-count: ~D~%" (-> obj water-count)) - (format #t "~1Tscissor-last: #x~X~%" (-> obj scissor-last)) - (format #t "~1Tscissor-next: #x~X~%" (-> obj scissor-next)) - (format #t "~1Tscissor-count: ~D~%" (-> obj scissor-count)) - (format #t "~1Tscissor-trans-last: #x~X~%" (-> obj scissor-trans-last)) - (format #t "~1Tscissor-trans-next: #x~X~%" (-> obj scissor-trans-next)) - (format #t "~1Tscissor-trans-count: ~D~%" (-> obj scissor-trans-count)) - (format #t "~1Tscissor-water-last: #x~X~%" (-> obj scissor-water-last)) - (format #t "~1Tscissor-water-next: #x~X~%" (-> obj scissor-water-next)) - (format #t "~1Tscissor-water-count: ~D~%" (-> obj scissor-water-count)) - (format #t "~1Tenvmap-last: #x~X~%" (-> obj envmap-last)) - (format #t "~1Tenvmap-next: #x~X~%" (-> obj envmap-next)) - (format #t "~1Tenvmap-count: ~D~%" (-> obj envmap-count)) - (format #t "~1Tenvmap-trans-last: #x~X~%" (-> obj envmap-trans-last)) - (format #t "~1Tenvmap-trans-next: #x~X~%" (-> obj envmap-trans-next)) - (format #t "~1Tenvmap-trans-count: ~D~%" (-> obj envmap-trans-count)) - (format #t "~1Tenvmap-water-last: #x~X~%" (-> obj envmap-water-last)) - (format #t "~1Tenvmap-water-next: #x~X~%" (-> obj envmap-water-next)) - (format #t "~1Tenvmap-water-count: ~D~%" (-> obj envmap-water-count)) - (format #t "~1Tenvmap-scissor-last: #x~X~%" (-> obj envmap-scissor-last)) - (format #t "~1Tenvmap-scissor-next: #x~X~%" (-> obj envmap-scissor-next)) - (format #t "~1Tenvmap-scissor-count: ~D~%" (-> obj envmap-scissor-count)) - (format #t "~1Tenvmap-scissor-trans-last: #x~X~%" (-> obj envmap-scissor-trans-last)) - (format #t "~1Tenvmap-scissor-trans-next: #x~X~%" (-> obj envmap-scissor-trans-next)) - (format #t "~1Tenvmap-scissor-trans-count: ~D~%" (-> obj envmap-scissor-trans-count)) - (format #t "~1Tenvmap-scissor-water-last: #x~X~%" (-> obj envmap-scissor-water-last)) - (format #t "~1Tenvmap-scissor-water-next: #x~X~%" (-> obj envmap-scissor-water-next)) - (format #t "~1Tenvmap-scissor-water-count: ~D~%" (-> obj envmap-scissor-water-count)) - (format #t "~1Tgeneric-last: #x~X~%" (-> obj generic-last)) - (format #t "~1Tgeneric-next: #x~X~%" (-> obj generic-next)) - (format #t "~1Tgeneric-count: ~D~%" (-> obj generic-count)) - (format #t "~1Tgeneric-trans-last: #x~X~%" (-> obj generic-trans-last)) - (format #t "~1Tgeneric-trans-next: #x~X~%" (-> obj generic-trans-next)) - (format #t "~1Tgeneric-trans-count: ~D~%" (-> obj generic-trans-count)) - (format #t "~1Tgeneric-water-last: #x~X~%" (-> obj generic-water-last)) - (format #t "~1Tgeneric-water-next: #x~X~%" (-> obj generic-water-next)) - (format #t "~1Tgeneric-water-count: ~D~%" (-> obj generic-water-count)) - (format #t "~1Tvanish-last: #x~X~%" (-> obj vanish-last)) - (format #t "~1Tvanish-next: #x~X~%" (-> obj vanish-next)) - (format #t "~1Tvanish-count: ~D~%" (-> obj vanish-count)) + (format #t "[~8x] ~A~%" this 'prototype-tie-work) + (format #t "~1Tupload-flushe: #~%" (-> this upload-flushe)) + (format #t "~1Tupload-palette: #~%" (-> this upload-palette)) + (format #t "~1Tupload-model-0: #~%" (-> this upload-model-0)) + (format #t "~1Tupload-model-1: #~%" (-> this upload-model-1)) + (format #t "~1Tupload-model-2: #~%" (-> this upload-model-2)) + (format #t "~1Tupload-model-3: #~%" (-> this upload-model-3)) + (format #t "~1Tupload-model-near-0: #~%" (-> this upload-model-near-0)) + (format #t "~1Tupload-model-near-1: #~%" (-> this upload-model-near-1)) + (format #t "~1Tupload-model-near-2: #~%" (-> this upload-model-near-2)) + (format #t "~1Tupload-model-near-3: #~%" (-> this upload-model-near-3)) + (format #t "~1Tupload-model-near-4: #~%" (-> this upload-model-near-4)) + (format #t "~1Tenvmap-palette: #~%" (-> this envmap-palette)) + (format #t "~1Tenvmap-shader: #~%" (-> this envmap-shader)) + (format #t "~1Tupload-envmap-0: #~%" (-> this upload-envmap-0)) + (format #t "~1Tupload-envmap-1: #~%" (-> this upload-envmap-1)) + (format #t "~1Tupload-envmap-2: #~%" (-> this upload-envmap-2)) + (format #t "~1Tupload-envmap-3: #~%" (-> this upload-envmap-3)) + (format #t "~1Tupload-envmap-4: #~%" (-> this upload-envmap-4)) + (format #t "~1Tupload-envmap-scissor-4: #~%" (-> this upload-envmap-scissor-4)) + (format #t "~1Tgeneric-palette: #~%" (-> this generic-palette)) + (format #t "~1Tgeneric-model-0: #~%" (-> this generic-model-0)) + (format #t "~1Tgeneric-model-1: #~%" (-> this generic-model-1)) + (format #t "~1Tgeneric-model-2: #~%" (-> this generic-model-2)) + (format #t "~1Tmodel-next: #~%" (-> this model-next)) + (format #t "~1Tclamp: ~D~%" (-> this clamp)) + (format #t "~1Tprototype-array: ~A~%" (-> this prototype-array)) + (format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~1Tmood: #~%" (-> this mood)) + (format #t "~1Tlast[16] @ #x~X~%" (-> this last)) + (format #t "~1Tnext[16] @ #x~X~%" (-> this next)) + (format #t "~1Tcount[16] @ #x~X~%" (-> this count)) + (format #t "~1Ttie-last: #x~X~%" (-> this tie-last)) + (format #t "~1Ttie-next: #x~X~%" (-> this tie-next)) + (format #t "~1Ttie-count: ~D~%" (-> this tie-count)) + (format #t "~1Ttrans-last: #x~X~%" (-> this trans-last)) + (format #t "~1Ttrans-next: #x~X~%" (-> this trans-next)) + (format #t "~1Ttrans-count: ~D~%" (-> this trans-count)) + (format #t "~1Twater-last: #x~X~%" (-> this water-last)) + (format #t "~1Twater-next: #x~X~%" (-> this water-next)) + (format #t "~1Twater-count: ~D~%" (-> this water-count)) + (format #t "~1Tscissor-last: #x~X~%" (-> this scissor-last)) + (format #t "~1Tscissor-next: #x~X~%" (-> this scissor-next)) + (format #t "~1Tscissor-count: ~D~%" (-> this scissor-count)) + (format #t "~1Tscissor-trans-last: #x~X~%" (-> this scissor-trans-last)) + (format #t "~1Tscissor-trans-next: #x~X~%" (-> this scissor-trans-next)) + (format #t "~1Tscissor-trans-count: ~D~%" (-> this scissor-trans-count)) + (format #t "~1Tscissor-water-last: #x~X~%" (-> this scissor-water-last)) + (format #t "~1Tscissor-water-next: #x~X~%" (-> this scissor-water-next)) + (format #t "~1Tscissor-water-count: ~D~%" (-> this scissor-water-count)) + (format #t "~1Tenvmap-last: #x~X~%" (-> this envmap-last)) + (format #t "~1Tenvmap-next: #x~X~%" (-> this envmap-next)) + (format #t "~1Tenvmap-count: ~D~%" (-> this envmap-count)) + (format #t "~1Tenvmap-trans-last: #x~X~%" (-> this envmap-trans-last)) + (format #t "~1Tenvmap-trans-next: #x~X~%" (-> this envmap-trans-next)) + (format #t "~1Tenvmap-trans-count: ~D~%" (-> this envmap-trans-count)) + (format #t "~1Tenvmap-water-last: #x~X~%" (-> this envmap-water-last)) + (format #t "~1Tenvmap-water-next: #x~X~%" (-> this envmap-water-next)) + (format #t "~1Tenvmap-water-count: ~D~%" (-> this envmap-water-count)) + (format #t "~1Tenvmap-scissor-last: #x~X~%" (-> this envmap-scissor-last)) + (format #t "~1Tenvmap-scissor-next: #x~X~%" (-> this envmap-scissor-next)) + (format #t "~1Tenvmap-scissor-count: ~D~%" (-> this envmap-scissor-count)) + (format #t "~1Tenvmap-scissor-trans-last: #x~X~%" (-> this envmap-scissor-trans-last)) + (format #t "~1Tenvmap-scissor-trans-next: #x~X~%" (-> this envmap-scissor-trans-next)) + (format #t "~1Tenvmap-scissor-trans-count: ~D~%" (-> this envmap-scissor-trans-count)) + (format #t "~1Tenvmap-scissor-water-last: #x~X~%" (-> this envmap-scissor-water-last)) + (format #t "~1Tenvmap-scissor-water-next: #x~X~%" (-> this envmap-scissor-water-next)) + (format #t "~1Tenvmap-scissor-water-count: ~D~%" (-> this envmap-scissor-water-count)) + (format #t "~1Tgeneric-last: #x~X~%" (-> this generic-last)) + (format #t "~1Tgeneric-next: #x~X~%" (-> this generic-next)) + (format #t "~1Tgeneric-count: ~D~%" (-> this generic-count)) + (format #t "~1Tgeneric-trans-last: #x~X~%" (-> this generic-trans-last)) + (format #t "~1Tgeneric-trans-next: #x~X~%" (-> this generic-trans-next)) + (format #t "~1Tgeneric-trans-count: ~D~%" (-> this generic-trans-count)) + (format #t "~1Tgeneric-water-last: #x~X~%" (-> this generic-water-last)) + (format #t "~1Tgeneric-water-next: #x~X~%" (-> this generic-water-next)) + (format #t "~1Tgeneric-water-count: ~D~%" (-> this generic-water-count)) + (format #t "~1Tvanish-last: #x~X~%" (-> this vanish-last)) + (format #t "~1Tvanish-next: #x~X~%" (-> this vanish-next)) + (format #t "~1Tvanish-count: ~D~%" (-> this vanish-count)) (label cfg-4) - obj + this ) ;; definition of type prototype-tie-dma @@ -596,89 +596,89 @@ ) ;; definition for method 3 of type prototype-tie-dma -(defmethod inspect prototype-tie-dma ((obj prototype-tie-dma)) - (when (not obj) - (set! obj obj) +(defmethod inspect prototype-tie-dma ((this prototype-tie-dma)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'prototype-tie-dma) - (format #t "~1Tcolora[256] @ #x~X~%" (-> obj colora)) - (format #t "~1Tcolorb[256] @ #x~X~%" (-> obj colorb)) - (format #t "~1Touta[256] @ #x~X~%" (-> obj outa)) - (format #t "~1Toutb[256] @ #x~X~%" (-> obj outb)) - (format #t "~1Tgeometry[4] @ #x~X~%" (-> obj geometry)) - (format #t "~1Tnext[12] @ #x~X~%" (-> obj next)) - (format #t "~1Tcount[12] @ #x~X~%" (-> obj count)) - (format #t "~1Tcounts[4] @ #x~X~%" (-> obj counts)) - (format #t "~1Tpalette-ptr: #x~X~%" (-> obj palette-ptr)) - (format #t "~1Tmodel-ptr: #x~X~%" (-> obj model-ptr)) - (format #t "~1Tret-ptr: #x~X~%" (-> obj ret-ptr)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tdma-buffer: ~A~%" (-> obj dma-buffer)) - (format #t "~1Tthis-frag-count: ~D~%" (-> obj this-frag-count)) - (format #t "~1Tfrag-count[4] @ #x~X~%" (-> obj frag-count)) - (format #t "~1Tfrom-spr: #x~X~%" (-> obj from-spr)) - (format #t "~1Tto-spr: #x~X~%" (-> obj to-spr)) - (format #t "~1Tspr-out: #x~X~%" (-> obj spr-out)) - (format #t "~1Tthis-count: ~D~%" (-> obj this-count)) - (format #t "~1Tscissor-geometry: #x~X~%" (-> obj scissor-geometry)) - (format #t "~1Tnear-geometry: #x~X~%" (-> obj near-geometry)) - (format #t "~1Tmid-geometry: #x~X~%" (-> obj mid-geometry)) - (format #t "~1Tfar-geometry: #x~X~%" (-> obj far-geometry)) - (format #t "~1Tscissor-frag-count: ~D~%" (-> obj scissor-frag-count)) - (format #t "~1Tnear-frag-count: ~D~%" (-> obj near-frag-count)) - (format #t "~1Tmid-frag-count: ~D~%" (-> obj mid-frag-count)) - (format #t "~1Tfar-frag-count: ~D~%" (-> obj far-frag-count)) - (format #t "~1Ttie-scissor-next: #x~X~%" (-> obj tie-scissor-next)) - (format #t "~1Ttie-near-next: #x~X~%" (-> obj tie-near-next)) - (format #t "~1Ttie-mid-next: #x~X~%" (-> obj tie-mid-next)) - (format #t "~1Ttie-far-next: #x~X~%" (-> obj tie-far-next)) - (format #t "~1Ttrans-scissor-next[4] @ #x~X~%" (-> obj next)) - (format #t "~1Ttrans-near-next: #x~X~%" (-> obj tie-near-next)) - (format #t "~1Ttrans-mid-next: #x~X~%" (-> obj tie-mid-next)) - (format #t "~1Ttrans-far-next: #x~X~%" (-> obj tie-far-next)) - (format #t "~1Twater-scissor-next[4] @ #x~X~%" (-> obj next)) - (format #t "~1Twater-near-next: #x~X~%" (-> obj tie-near-next)) - (format #t "~1Twater-mid-next: #x~X~%" (-> obj tie-mid-next)) - (format #t "~1Twater-far-next: #x~X~%" (-> obj tie-far-next)) - (format #t "~1Tenvmap-scissor-next[4] @ #x~X~%" (-> obj envmap-scissor-next)) - (format #t "~1Tenvmap-near-next: #x~X~%" (-> obj envmap-near-next)) - (format #t "~1Tenvmap-mid-next: #x~X~%" (-> obj envmap-mid-next)) - (format #t "~1Tenvmap-far-next: #x~X~%" (-> obj envmap-far-next)) - (format #t "~1Tgeneric-near-next: #x~X~%" (-> obj generic-near-next)) - (format #t "~1Tgeneric-mid-next: #x~X~%" (-> obj generic-mid-next)) - (format #t "~1Tgeneric-far-next: #x~X~%" (-> obj generic-far-next)) - (format #t "~1Tvanish-next: #x~X~%" (-> obj vanish-next)) - (format #t "~1Ttie-count: ~D~%" (-> obj tie-count)) - (format #t "~1Ttie-scissor-count: ~D~%" (-> obj tie-count)) - (format #t "~1Ttie-near-count: ~D~%" (-> obj tie-near-count)) - (format #t "~1Ttie-mid-count: ~D~%" (-> obj tie-mid-count)) - (format #t "~1Ttie-far-count: ~D~%" (-> obj tie-far-count)) - (format #t "~1Ttrans-count: ~D~%" (-> obj tie-count)) - (format #t "~1Ttrans-scissor-count: ~D~%" (-> obj tie-count)) - (format #t "~1Ttrans-near-count: ~D~%" (-> obj tie-near-count)) - (format #t "~1Ttrans-mid-count: ~D~%" (-> obj tie-mid-count)) - (format #t "~1Ttrans-far-count: ~D~%" (-> obj tie-far-count)) - (format #t "~1Twater-count: ~D~%" (-> obj tie-count)) - (format #t "~1Twater-scissor-count: ~D~%" (-> obj tie-count)) - (format #t "~1Twater-near-count: ~D~%" (-> obj tie-near-count)) - (format #t "~1Twater-mid-count: ~D~%" (-> obj tie-mid-count)) - (format #t "~1Twater-far-count: ~D~%" (-> obj tie-far-count)) - (format #t "~1Tenvmap-count: ~D~%" (-> obj envmap-count)) - (format #t "~1Tenvmap-scissor-count: ~D~%" (-> obj envmap-count)) - (format #t "~1Tenvmap-near-count: ~D~%" (-> obj envmap-near-count)) - (format #t "~1Tenvmap-mid-count: ~D~%" (-> obj envmap-mid-count)) - (format #t "~1Tenvmap-far-count: ~D~%" (-> obj envmap-far-count)) - (format #t "~1Tgeneric-count: ~D~%" (-> obj generic-count)) - (format #t "~1Tgeneric-near-count: ~D~%" (-> obj generic-count)) - (format #t "~1Tgeneric-mid-count: ~D~%" (-> obj generic-mid-count)) - (format #t "~1Tgeneric-far-count: ~D~%" (-> obj generic-far-count)) - (format #t "~1Tvanish-count: ~D~%" (-> obj vanish-count)) - (format #t "~1Tnext-clear[3] @ #x~X~%" (-> obj next)) - (format #t "~1Tcount-clear[3] @ #x~X~%" (-> obj count)) + (format #t "[~8x] ~A~%" this 'prototype-tie-dma) + (format #t "~1Tcolora[256] @ #x~X~%" (-> this colora)) + (format #t "~1Tcolorb[256] @ #x~X~%" (-> this colorb)) + (format #t "~1Touta[256] @ #x~X~%" (-> this outa)) + (format #t "~1Toutb[256] @ #x~X~%" (-> this outb)) + (format #t "~1Tgeometry[4] @ #x~X~%" (-> this geometry)) + (format #t "~1Tnext[12] @ #x~X~%" (-> this next)) + (format #t "~1Tcount[12] @ #x~X~%" (-> this count)) + (format #t "~1Tcounts[4] @ #x~X~%" (-> this counts)) + (format #t "~1Tpalette-ptr: #x~X~%" (-> this palette-ptr)) + (format #t "~1Tmodel-ptr: #x~X~%" (-> this model-ptr)) + (format #t "~1Tret-ptr: #x~X~%" (-> this ret-ptr)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~1Tthis-frag-count: ~D~%" (-> this this-frag-count)) + (format #t "~1Tfrag-count[4] @ #x~X~%" (-> this frag-count)) + (format #t "~1Tfrom-spr: #x~X~%" (-> this from-spr)) + (format #t "~1Tto-spr: #x~X~%" (-> this to-spr)) + (format #t "~1Tspr-out: #x~X~%" (-> this spr-out)) + (format #t "~1Tthis-count: ~D~%" (-> this this-count)) + (format #t "~1Tscissor-geometry: #x~X~%" (-> this scissor-geometry)) + (format #t "~1Tnear-geometry: #x~X~%" (-> this near-geometry)) + (format #t "~1Tmid-geometry: #x~X~%" (-> this mid-geometry)) + (format #t "~1Tfar-geometry: #x~X~%" (-> this far-geometry)) + (format #t "~1Tscissor-frag-count: ~D~%" (-> this scissor-frag-count)) + (format #t "~1Tnear-frag-count: ~D~%" (-> this near-frag-count)) + (format #t "~1Tmid-frag-count: ~D~%" (-> this mid-frag-count)) + (format #t "~1Tfar-frag-count: ~D~%" (-> this far-frag-count)) + (format #t "~1Ttie-scissor-next: #x~X~%" (-> this tie-scissor-next)) + (format #t "~1Ttie-near-next: #x~X~%" (-> this tie-near-next)) + (format #t "~1Ttie-mid-next: #x~X~%" (-> this tie-mid-next)) + (format #t "~1Ttie-far-next: #x~X~%" (-> this tie-far-next)) + (format #t "~1Ttrans-scissor-next[4] @ #x~X~%" (-> this next)) + (format #t "~1Ttrans-near-next: #x~X~%" (-> this tie-near-next)) + (format #t "~1Ttrans-mid-next: #x~X~%" (-> this tie-mid-next)) + (format #t "~1Ttrans-far-next: #x~X~%" (-> this tie-far-next)) + (format #t "~1Twater-scissor-next[4] @ #x~X~%" (-> this next)) + (format #t "~1Twater-near-next: #x~X~%" (-> this tie-near-next)) + (format #t "~1Twater-mid-next: #x~X~%" (-> this tie-mid-next)) + (format #t "~1Twater-far-next: #x~X~%" (-> this tie-far-next)) + (format #t "~1Tenvmap-scissor-next[4] @ #x~X~%" (-> this envmap-scissor-next)) + (format #t "~1Tenvmap-near-next: #x~X~%" (-> this envmap-near-next)) + (format #t "~1Tenvmap-mid-next: #x~X~%" (-> this envmap-mid-next)) + (format #t "~1Tenvmap-far-next: #x~X~%" (-> this envmap-far-next)) + (format #t "~1Tgeneric-near-next: #x~X~%" (-> this generic-near-next)) + (format #t "~1Tgeneric-mid-next: #x~X~%" (-> this generic-mid-next)) + (format #t "~1Tgeneric-far-next: #x~X~%" (-> this generic-far-next)) + (format #t "~1Tvanish-next: #x~X~%" (-> this vanish-next)) + (format #t "~1Ttie-count: ~D~%" (-> this tie-count)) + (format #t "~1Ttie-scissor-count: ~D~%" (-> this tie-count)) + (format #t "~1Ttie-near-count: ~D~%" (-> this tie-near-count)) + (format #t "~1Ttie-mid-count: ~D~%" (-> this tie-mid-count)) + (format #t "~1Ttie-far-count: ~D~%" (-> this tie-far-count)) + (format #t "~1Ttrans-count: ~D~%" (-> this tie-count)) + (format #t "~1Ttrans-scissor-count: ~D~%" (-> this tie-count)) + (format #t "~1Ttrans-near-count: ~D~%" (-> this tie-near-count)) + (format #t "~1Ttrans-mid-count: ~D~%" (-> this tie-mid-count)) + (format #t "~1Ttrans-far-count: ~D~%" (-> this tie-far-count)) + (format #t "~1Twater-count: ~D~%" (-> this tie-count)) + (format #t "~1Twater-scissor-count: ~D~%" (-> this tie-count)) + (format #t "~1Twater-near-count: ~D~%" (-> this tie-near-count)) + (format #t "~1Twater-mid-count: ~D~%" (-> this tie-mid-count)) + (format #t "~1Twater-far-count: ~D~%" (-> this tie-far-count)) + (format #t "~1Tenvmap-count: ~D~%" (-> this envmap-count)) + (format #t "~1Tenvmap-scissor-count: ~D~%" (-> this envmap-count)) + (format #t "~1Tenvmap-near-count: ~D~%" (-> this envmap-near-count)) + (format #t "~1Tenvmap-mid-count: ~D~%" (-> this envmap-mid-count)) + (format #t "~1Tenvmap-far-count: ~D~%" (-> this envmap-far-count)) + (format #t "~1Tgeneric-count: ~D~%" (-> this generic-count)) + (format #t "~1Tgeneric-near-count: ~D~%" (-> this generic-count)) + (format #t "~1Tgeneric-mid-count: ~D~%" (-> this generic-mid-count)) + (format #t "~1Tgeneric-far-count: ~D~%" (-> this generic-far-count)) + (format #t "~1Tvanish-count: ~D~%" (-> this vanish-count)) + (format #t "~1Tnext-clear[3] @ #x~X~%" (-> this next)) + (format #t "~1Tcount-clear[3] @ #x~X~%" (-> this count)) (label cfg-4) - obj + this ) ;; definition for symbol *instance-tie-work-copy*, type instance-tie-work diff --git a/test/decompiler/reference/jak2/engine/gfx/background/tie/tie_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/tie/tie_REF.gc index 14ea0130fd..e77d140c89 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/tie/tie_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/tie/tie_REF.gc @@ -2,9 +2,9 @@ (in-package goal) ;; definition for method 9 of type tie-fragment -(defmethod login tie-fragment ((obj tie-fragment)) - (let ((s5-0 (the-as adgif-shader (-> obj gif-ref))) - (s4-0 (/ (-> obj tex-count) (the-as uint 5))) +(defmethod login tie-fragment ((this tie-fragment)) + (let ((s5-0 (the-as adgif-shader (-> this gif-ref))) + (s4-0 (/ (-> this tex-count) (the-as uint 5))) ) (dotimes (s3-0 (the-as int s4-0)) (let ((v1-1 (adgif-shader-login-no-remap s5-0))) @@ -31,62 +31,62 @@ (&+! s5-0 80) ) ) - obj + this ) ;; definition for method 3 of type drawable-inline-array-instance-tie -(defmethod inspect drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) ;; definition for method 5 of type drawable-inline-array-instance-tie ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie)) - (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> obj length) -1) 64))) +(defmethod asize-of drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie)) + (the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64))) ) ;; definition for method 9 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files -(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) - obj +(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) + this ) ;; definition for method 9 of type drawable-tree-instance-tie ;; INFO: this function exists in multiple non-identical object files -(defmethod login drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login drawable-tree-instance-tie ((this drawable-tree-instance-tie)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) ;; definition for method 3 of type prototype-tie -(defmethod inspect prototype-tie ((obj prototype-tie)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect prototype-tie ((this prototype-tie)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) ;; definition for method 9 of type prototype-tie -(defmethod login prototype-tie ((obj prototype-tie)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login prototype-tie ((this prototype-tie)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) ;; definition for method 8 of type drawable-tree-instance-tie -(defmethod mem-usage drawable-tree-instance-tie ((obj drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-tree-instance-tie ((this drawable-tree-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -94,17 +94,17 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - (mem-usage (-> obj prototypes prototype-array-tie) arg0 (logior arg1 1)) - obj + (mem-usage (-> this prototypes prototype-array-tie) arg0 (logior arg1 1)) + this ) ;; definition for method 8 of type tie-fragment -(defmethod mem-usage tie-fragment ((obj tie-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage tie-fragment ((this tie-fragment) (arg0 memory-usage-block) (arg1 int)) (when (logtest? arg1 2) - (let ((v1-3 (* (-> obj color-count) 4)) + (let ((v1-3 (* (-> this color-count) 4)) (a0-2 (cond ((logtest? arg1 4) 20 @@ -123,7 +123,7 @@ (+! (-> arg0 data a0-2 total) (logand -4 (+ v1-3 3))) ) (set! (-> arg0 length) (max 23 (-> arg0 length))) - (set! obj obj) + (set! this this) (goto cfg-13) ) (set! (-> arg0 length) (max 18 (-> arg0 length))) @@ -135,31 +135,31 @@ (set! (-> arg0 data 13 name) "tie-draw-points") (set! (-> arg0 data 17 name) "tie-generic") (+! (-> arg0 data 9 count) 1) - (let ((v1-21 (asize-of obj))) + (let ((v1-21 (asize-of this))) (+! (-> arg0 data 9 used) v1-21) (+! (-> arg0 data 9 total) (logand -16 (+ v1-21 15))) ) - (let ((v1-26 (* (-> obj gif-count) 16))) - (+! (-> arg0 data 10 count) (-> obj tex-count)) + (let ((v1-26 (* (-> this gif-count) 16))) + (+! (-> arg0 data 10 count) (-> this tex-count)) (+! (-> arg0 data 10 used) v1-26) (+! (-> arg0 data 10 total) (logand -16 (+ v1-26 15))) ) - (let ((v1-31 (* (-> obj vertex-count) 16))) - (+! (-> arg0 data 11 count) (-> obj vertex-count)) + (let ((v1-31 (* (-> this vertex-count) 16))) + (+! (-> arg0 data 11 count) (-> this vertex-count)) (+! (-> arg0 data 11 used) v1-31) (+! (-> arg0 data 11 total) (logand -16 (+ v1-31 15))) ) - (let ((v1-36 (* (-> obj dp-qwc) 16))) - (+! (-> arg0 data 13 count) (* (-> obj dp-qwc) 16)) + (let ((v1-36 (* (-> this dp-qwc) 16))) + (+! (-> arg0 data 13 count) (* (-> this dp-qwc) 16)) (+! (-> arg0 data 13 used) v1-36) (+! (-> arg0 data 13 total) (logand -16 (+ v1-36 15))) ) - (let ((v1-41 (* (-> obj generic-count) 16))) + (let ((v1-41 (* (-> this generic-count) 16))) (+! (-> arg0 data 17 count) 1) (+! (-> arg0 data 17 used) v1-41) (+! (-> arg0 data 17 total) (logand -16 (+ v1-41 15))) ) - (let ((s4-0 (-> obj debug debug-lines))) + (let ((s4-0 (-> this debug debug-lines))) (when (nonzero? s4-0) (dotimes (s3-0 (-> s4-0 length)) (+! (-> arg0 data 14 count) (-> s4-0 s3-0 length)) @@ -171,19 +171,19 @@ ) ) (label cfg-13) - obj + this ) ;; definition for method 8 of type instance-tie -(defmethod mem-usage instance-tie ((obj instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage instance-tie ((this instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 19 (-> arg0 length))) (set! (-> arg0 data 18 name) "instance-tie") (+! (-> arg0 data 18 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 18 used) v1-6) (+! (-> arg0 data 18 total) (logand -16 (+ v1-6 15))) ) - (when (nonzero? (-> obj color-indices)) + (when (nonzero? (-> this color-indices)) (set! (-> arg0 length) (max 24 (-> arg0 length))) (set! (-> arg0 data 23 name) "instance-tie-colors*") (set! (-> arg0 data 19 name) "instance-tie-colors0") @@ -191,7 +191,7 @@ (set! (-> arg0 data 21 name) "instance-tie-colors2") (set! (-> arg0 data 22 name) "instance-tie-colors3") (+! (-> arg0 data 23 count) 1) - (let ((s3-0 (-> obj bucket-ptr))) + (let ((s3-0 (-> this bucket-ptr))) (+ (-> arg0 data 19 used) (-> arg0 data 20 used) (-> arg0 data 21 used) (-> arg0 data 22 used)) (dotimes (s2-0 4) (let ((a0-10 (-> s3-0 tie-geom s2-0))) @@ -225,11 +225,11 @@ ) ) ) - obj + this ) ;; definition for method 8 of type drawable-inline-array-instance-tie -(defmethod mem-usage drawable-inline-array-instance-tie ((obj drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-instance-tie ((this drawable-inline-array-instance-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -237,14 +237,14 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 8 of type prototype-tie -(defmethod mem-usage prototype-tie ((obj prototype-tie) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-tie ((this prototype-tie) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -252,16 +252,16 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 5 of type prototype-tie ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of prototype-tie ((obj prototype-tie)) - (the-as int (+ (-> prototype-tie size) (* (+ (-> obj length) -1) 64))) +(defmethod asize-of prototype-tie ((this prototype-tie)) + (the-as int (+ (-> prototype-tie size) (* (+ (-> this length) -1) 64))) ) ;; definition of type tie-consts @@ -287,28 +287,28 @@ ) ;; definition for method 3 of type tie-consts -(defmethod inspect tie-consts ((obj tie-consts)) - (when (not obj) - (set! obj obj) +(defmethod inspect tie-consts ((this tie-consts)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tie-consts) - (format #t "~1Tdata[40] @ #x~X~%" (-> obj adgif)) - (format #t "~1Tvector[10] @ #x~X~%" (-> obj adgif)) - (format #t "~1Tquads[10] @ #x~X~%" (-> obj adgif)) - (format #t "~1Tadgif: #~%" (-> obj adgif)) - (format #t "~1Tstrgif: #~%" (-> obj strgif)) - (format #t "~1Textra: #~%" (-> obj extra)) - (format #t "~1Tgifbufs: #~%" (-> obj gifbufs)) - (format #t "~1Tclrbufs: #~%" (-> obj clrbufs)) - (format #t "~1Tmisc: #~%" (-> obj misc)) - (format #t "~1Tatestgif: #~%" (-> obj atestgif)) - (format #t "~1Talpha: #~%" (-> obj alpha)) - (format #t "~1Tatest[2] @ #x~X~%" (-> obj atest-tra)) - (format #t "~1Tatest-tra: #~%" (-> obj atest-tra)) - (format #t "~1Tatest-def: #~%" (-> obj atest-def)) + (format #t "[~8x] ~A~%" this 'tie-consts) + (format #t "~1Tdata[40] @ #x~X~%" (-> this adgif)) + (format #t "~1Tvector[10] @ #x~X~%" (-> this adgif)) + (format #t "~1Tquads[10] @ #x~X~%" (-> this adgif)) + (format #t "~1Tadgif: #~%" (-> this adgif)) + (format #t "~1Tstrgif: #~%" (-> this strgif)) + (format #t "~1Textra: #~%" (-> this extra)) + (format #t "~1Tgifbufs: #~%" (-> this gifbufs)) + (format #t "~1Tclrbufs: #~%" (-> this clrbufs)) + (format #t "~1Tmisc: #~%" (-> this misc)) + (format #t "~1Tatestgif: #~%" (-> this atestgif)) + (format #t "~1Talpha: #~%" (-> this alpha)) + (format #t "~1Tatest[2] @ #x~X~%" (-> this atest-tra)) + (format #t "~1Tatest-tra: #~%" (-> this atest-tra)) + (format #t "~1Tatest-def: #~%" (-> this atest-def)) (label cfg-4) - obj + this ) ;; definition for symbol tie-vu1-block, type vu-function @@ -438,7 +438,6 @@ ;; definition for function tie-end-buffer ;; WARN: Return type mismatch int vs none. -;; ERROR: Failed store: (s.w! (+ a1-0 8) 0) at op 4 (defun tie-end-buffer ((arg0 dma-buffer)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal)))) (let* ((v1-3 arg0) diff --git a/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc index 40fa180a10..b097bf75ba 100644 --- a/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type wind-vector -(defmethod inspect wind-vector ((obj wind-vector)) - (when (not obj) - (set! obj obj) +(defmethod inspect wind-vector ((this wind-vector)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'wind-vector) - (format #t "~1Twind-pos: #~%" (-> obj wind-pos)) - (format #t "~1Twind-vel: #~%" (-> obj wind-vel)) - (format #t "~1Tstiffness: ~f~%" (-> obj stiffness)) + (format #t "[~8x] ~A~%" this 'wind-vector) + (format #t "~1Twind-pos: #~%" (-> this wind-pos)) + (format #t "~1Twind-vel: #~%" (-> this wind-vel)) + (format #t "~1Tstiffness: ~f~%" (-> this stiffness)) (label cfg-4) - obj + this ) ;; definition for symbol *wind-scales*, type (array uint8) @@ -92,34 +92,34 @@ ) ;; definition for method 3 of type wind-work -(defmethod inspect wind-work ((obj wind-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect wind-work ((this wind-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twind-array[64] @ #x~X~%" (-> obj wind-array)) - (format #t "~1Twind-normal: ~`vector`P~%" (-> obj wind-normal)) - (format #t "~1Twind-temp: ~`vector`P~%" (-> obj wind-temp)) - (format #t "~1Twind-force[64] @ #x~X~%" (-> obj wind-force)) - (format #t "~1Twind-const: ~`vector`P~%" (-> obj wind-const)) - (format #t "~1Twind-time: ~D~%" (-> obj wind-time)) - (format #t "~1Twait-to-vu0: ~D~%" (-> obj wait-to-vu0)) - (format #t "~1Twait-to-spr: ~D~%" (-> obj wait-to-spr)) - (format #t "~1Twait-from-spr: ~D~%" (-> obj wait-from-spr)) - (format #t "~1Tspr-index: ~D~%" (-> obj spr-index)) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tnext-count: ~D~%" (-> obj next-count)) - (format #t "~1Tlast-count: ~D~%" (-> obj last-count)) - (format #t "~1Tto-spr: ~D~%" (-> obj to-spr)) - (format #t "~1Tfrom-spr: ~D~%" (-> obj from-spr)) - (format #t "~1Tnext-mem: #x~X~%" (-> obj next-mem)) - (format #t "~1Tlast-mem: #x~X~%" (-> obj last-mem)) - (format #t "~1Tnext-spr: #x~X~%" (-> obj next-spr)) - (format #t "~1Tlast-spr: #x~X~%" (-> obj last-spr)) - (format #t "~1Tto-ptrs[3] @ #x~X~%" (-> obj to-ptrs)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twind-array[64] @ #x~X~%" (-> this wind-array)) + (format #t "~1Twind-normal: ~`vector`P~%" (-> this wind-normal)) + (format #t "~1Twind-temp: ~`vector`P~%" (-> this wind-temp)) + (format #t "~1Twind-force[64] @ #x~X~%" (-> this wind-force)) + (format #t "~1Twind-const: ~`vector`P~%" (-> this wind-const)) + (format #t "~1Twind-time: ~D~%" (-> this wind-time)) + (format #t "~1Twait-to-vu0: ~D~%" (-> this wait-to-vu0)) + (format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~1Tspr-index: ~D~%" (-> this spr-index)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tnext-count: ~D~%" (-> this next-count)) + (format #t "~1Tlast-count: ~D~%" (-> this last-count)) + (format #t "~1Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~1Tfrom-spr: ~D~%" (-> this from-spr)) + (format #t "~1Tnext-mem: #x~X~%" (-> this next-mem)) + (format #t "~1Tlast-mem: #x~X~%" (-> this last-mem)) + (format #t "~1Tnext-spr: #x~X~%" (-> this next-spr)) + (format #t "~1Tlast-spr: #x~X~%" (-> this last-spr)) + (format #t "~1Tto-ptrs[3] @ #x~X~%" (-> this to-ptrs)) (label cfg-4) - obj + this ) ;; definition of type wind-dma @@ -134,17 +134,17 @@ ) ;; definition for method 3 of type wind-dma -(defmethod inspect wind-dma ((obj wind-dma)) - (when (not obj) - (set! obj obj) +(defmethod inspect wind-dma ((this wind-dma)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'wind-dma) - (format #t "~1Tbuffer0[128] @ #x~X~%" (-> obj buffer0)) - (format #t "~1Tbuffer1[128] @ #x~X~%" (-> obj buffer1)) - (format #t "~1Tbuffer2[128] @ #x~X~%" (-> obj buffer2)) + (format #t "[~8x] ~A~%" this 'wind-dma) + (format #t "~1Tbuffer0[128] @ #x~X~%" (-> this buffer0)) + (format #t "~1Tbuffer1[128] @ #x~X~%" (-> this buffer1)) + (format #t "~1Tbuffer2[128] @ #x~X~%" (-> this buffer2)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc index 48308a5c96..a1cc0842a4 100644 --- a/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc @@ -29,33 +29,33 @@ ) ;; definition for method 3 of type blit-displays-work -(defmethod inspect blit-displays-work ((obj blit-displays-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect blit-displays-work ((this blit-displays-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'blit-displays-work) - (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) - (format #t "~1Tsprite-slow-tmpl: #~%" (-> obj sprite-slow-tmpl)) - (format #t "~1Tline-tmpl: #~%" (-> obj line-tmpl)) - (format #t "~1Tscan-tmpl: #~%" (-> obj scan-tmpl)) - (format #t "~1Tcolor: #~%" (-> obj color)) - (format #t "~1Tline-color: ~D~%" (-> obj line-color)) - (format #t "~1Tscan-colors[15] @ #x~X~%" (-> obj scan-colors)) - (format #t "~1Tmenu-mode: ~A~%" (-> obj menu-mode)) - (format #t "~1Tscreen-copied: ~A~%" (-> obj screen-copied)) - (format #t "~1Tvu1-enable-user-menu: ~D~%" (-> obj vu1-enable-user-menu)) - (format #t "~1Ttexture-enable-user-menu: ~D~%" (-> obj texture-enable-user-menu)) - (format #t "~1Tcount-down: ~D~%" (-> obj count-down)) - (format #t "~1Thorizontal-flip-flag: ~A~%" (-> obj horizontal-flip-flag)) - (format #t "~1Tscan-alpha: ~f~%" (-> obj scan-alpha)) - (format #t "~1Tscanline: ~D~%" (-> obj scanline)) - (format #t "~1Tprogress-interp: ~f~%" (-> obj progress-interp)) - (format #t "~1Tprogress-interp-dest: ~f~%" (-> obj progress-interp-dest)) - (format #t "~1Tprogress-interp-speed: ~f~%" (-> obj progress-interp-speed)) + (format #t "[~8x] ~A~%" this 'blit-displays-work) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~1Tsprite-slow-tmpl: #~%" (-> this sprite-slow-tmpl)) + (format #t "~1Tline-tmpl: #~%" (-> this line-tmpl)) + (format #t "~1Tscan-tmpl: #~%" (-> this scan-tmpl)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Tline-color: ~D~%" (-> this line-color)) + (format #t "~1Tscan-colors[15] @ #x~X~%" (-> this scan-colors)) + (format #t "~1Tmenu-mode: ~A~%" (-> this menu-mode)) + (format #t "~1Tscreen-copied: ~A~%" (-> this screen-copied)) + (format #t "~1Tvu1-enable-user-menu: ~D~%" (-> this vu1-enable-user-menu)) + (format #t "~1Ttexture-enable-user-menu: ~D~%" (-> this texture-enable-user-menu)) + (format #t "~1Tcount-down: ~D~%" (-> this count-down)) + (format #t "~1Thorizontal-flip-flag: ~A~%" (-> this horizontal-flip-flag)) + (format #t "~1Tscan-alpha: ~f~%" (-> this scan-alpha)) + (format #t "~1Tscanline: ~D~%" (-> this scanline)) + (format #t "~1Tprogress-interp: ~f~%" (-> this progress-interp)) + (format #t "~1Tprogress-interp-dest: ~f~%" (-> this progress-interp-dest)) + (format #t "~1Tprogress-interp-speed: ~f~%" (-> this progress-interp-speed)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc index 879a10ae56..e664b54697 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type bone-buffer -(defmethod inspect bone-buffer ((obj bone-buffer)) - (when (not obj) - (set! obj obj) +(defmethod inspect bone-buffer ((this bone-buffer)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bone-buffer) - (format #t "~1Tjoint[16] @ #x~X~%" (-> obj joint)) - (format #t "~1Tbone[16] @ #x~X~%" (-> obj bone)) - (format #t "~1Toutput[16] @ #x~X~%" (-> obj output)) + (format #t "[~8x] ~A~%" this 'bone-buffer) + (format #t "~1Tjoint[16] @ #x~X~%" (-> this joint)) + (format #t "~1Tbone[16] @ #x~X~%" (-> this bone)) + (format #t "~1Toutput[16] @ #x~X~%" (-> this output)) (label cfg-4) - obj + this ) ;; definition of type bone-layout @@ -40,19 +40,19 @@ ) ;; definition for method 3 of type bone-layout -(defmethod inspect bone-layout ((obj bone-layout)) - (when (not obj) - (set! obj obj) +(defmethod inspect bone-layout ((this bone-layout)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bone-layout) - (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) - (format #t "~1Tjoint[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tbone[2] @ #x~X~%" (-> obj bone)) - (format #t "~1Toutput[2] @ #x~X~%" (-> obj output)) - (format #t "~1Tunused[2] @ #x~X~%" (-> obj unused)) + (format #t "[~8x] ~A~%" this 'bone-layout) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~1Tjoint[2] @ #x~X~%" (-> this data)) + (format #t "~1Tbone[2] @ #x~X~%" (-> this bone)) + (format #t "~1Toutput[2] @ #x~X~%" (-> this output)) + (format #t "~1Tunused[2] @ #x~X~%" (-> this unused)) (label cfg-4) - obj + this ) ;; definition of type bone-regs @@ -73,23 +73,23 @@ ) ;; definition for method 3 of type bone-regs -(defmethod inspect bone-regs ((obj bone-regs)) - (when (not obj) - (set! obj obj) +(defmethod inspect bone-regs ((this bone-regs)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bone-regs) - (format #t "~1Tdma-buf: ~A~%" (-> obj dma-buf)) - (format #t "~1Twait-count: ~D~%" (-> obj wait-count)) - (format #t "~1Tin-count: ~D~%" (-> obj in-count)) - (format #t "~1Tsp-size: ~D~%" (-> obj sp-size)) - (format #t "~1Tsp-bufnum: ~D~%" (-> obj sp-bufnum)) - (format #t "~1Tjoint-ptr: #x~X~%" (-> obj joint-ptr)) - (format #t "~1Tbone-ptr: #x~X~%" (-> obj bone-ptr)) - (format #t "~1Tnum-bones: ~D~%" (-> obj num-bones)) - (format #t "~1Tmtxs: #x~X~%" (-> obj mtxs)) + (format #t "[~8x] ~A~%" this 'bone-regs) + (format #t "~1Tdma-buf: ~A~%" (-> this dma-buf)) + (format #t "~1Twait-count: ~D~%" (-> this wait-count)) + (format #t "~1Tin-count: ~D~%" (-> this in-count)) + (format #t "~1Tsp-size: ~D~%" (-> this sp-size)) + (format #t "~1Tsp-bufnum: ~D~%" (-> this sp-bufnum)) + (format #t "~1Tjoint-ptr: #x~X~%" (-> this joint-ptr)) + (format #t "~1Tbone-ptr: #x~X~%" (-> this bone-ptr)) + (format #t "~1Tnum-bones: ~D~%" (-> this num-bones)) + (format #t "~1Tmtxs: #x~X~%" (-> this mtxs)) (label cfg-4) - obj + this ) ;; definition of type bone-work @@ -103,16 +103,16 @@ ) ;; definition for method 3 of type bone-work -(defmethod inspect bone-work ((obj bone-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect bone-work ((this bone-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bone-work) - (format #t "~1Tlayout: #~%" (-> obj layout)) - (format #t "~1Tregs: #~%" (-> obj regs)) + (format #t "[~8x] ~A~%" this 'bone-work) + (format #t "~1Tlayout: #~%" (-> this layout)) + (format #t "~1Tregs: #~%" (-> this regs)) (label cfg-4) - obj + this ) ;; definition of type bone-debug @@ -126,16 +126,16 @@ ) ;; definition for method 3 of type bone-debug -(defmethod inspect bone-debug ((obj bone-debug)) - (when (not obj) - (set! obj obj) +(defmethod inspect bone-debug ((this bone-debug)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bone-debug) - (format #t "~1Ttime-ctr: ~D~%" (-> obj time-ctr)) - (format #t "~1Ttiming[360] @ #x~X~%" (-> obj timing)) + (format #t "[~8x] ~A~%" this 'bone-debug) + (format #t "~1Ttime-ctr: ~D~%" (-> this time-ctr)) + (format #t "~1Ttiming[360] @ #x~X~%" (-> this timing)) (label cfg-4) - obj + this ) ;; definition of type bone-memory @@ -149,16 +149,16 @@ ) ;; definition for method 3 of type bone-memory -(defmethod inspect bone-memory ((obj bone-memory)) - (when (not obj) - (set! obj obj) +(defmethod inspect bone-memory ((this bone-memory)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bone-memory) - (format #t "~1Twork: #~%" (-> obj work)) - (format #t "~1Tbuffer[2] @ #x~X~%" (-> obj buffer)) + (format #t "[~8x] ~A~%" this 'bone-memory) + (format #t "~1Twork: #~%" (-> this work)) + (format #t "~1Tbuffer[2] @ #x~X~%" (-> this buffer)) (label cfg-4) - obj + this ) ;; definition of type bone-calculation @@ -184,27 +184,27 @@ ) ;; definition for method 3 of type bone-calculation -(defmethod inspect bone-calculation ((obj bone-calculation)) - (when (not obj) - (set! obj obj) +(defmethod inspect bone-calculation ((this bone-calculation)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bone-calculation) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tnum-bones: ~D~%" (-> obj num-bones)) - (format #t "~1Tmatrix-area: #x~X~%" (-> obj matrix-area)) - (format #t "~1Tjoints: #x~X~%" (-> obj joints)) - (format #t "~1Tbones: #x~X~%" (-> obj bones)) - (format #t "~1Tripple-scale: ~f~%" (-> obj ripple-scale)) - (format #t "~1Tripple-y-scale: ~f~%" (-> obj ripple-y-scale)) - (format #t "~1Tripple-normal-scale: ~f~%" (-> obj ripple-normal-scale)) - (format #t "~1Tripple-area: #x~X~%" (-> obj ripple-area)) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tdummy-1: ~D~%" (-> obj dummy-1)) - (format #t "~1Tdummy-2: ~D~%" (-> obj dummy-2)) - (format #t "~1Tdummy-3: ~D~%" (-> obj dummy-3)) + (format #t "[~8x] ~A~%" this 'bone-calculation) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tnum-bones: ~D~%" (-> this num-bones)) + (format #t "~1Tmatrix-area: #x~X~%" (-> this matrix-area)) + (format #t "~1Tjoints: #x~X~%" (-> this joints)) + (format #t "~1Tbones: #x~X~%" (-> this bones)) + (format #t "~1Tripple-scale: ~f~%" (-> this ripple-scale)) + (format #t "~1Tripple-y-scale: ~f~%" (-> this ripple-y-scale)) + (format #t "~1Tripple-normal-scale: ~f~%" (-> this ripple-normal-scale)) + (format #t "~1Tripple-area: #x~X~%" (-> this ripple-area)) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tdummy-1: ~D~%" (-> this dummy-1)) + (format #t "~1Tdummy-2: ~D~%" (-> this dummy-2)) + (format #t "~1Tdummy-3: ~D~%" (-> this dummy-3)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc index 8a19a10b92..3bc9affbd2 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/bones_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type bone-calculation-list -(defmethod inspect bone-calculation-list ((obj bone-calculation-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect bone-calculation-list ((this bone-calculation-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bone-calculation-list) - (format #t "~1Tfirst: #~%" (-> obj first)) - (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "[~8x] ~A~%" this 'bone-calculation-list) + (format #t "~1Tfirst: #~%" (-> this first)) + (format #t "~1Tnext: #~%" (-> this next)) (label cfg-4) - obj + this ) ;; definition for symbol *bone-calculation-list*, type bone-calculation-list diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc index b74f7f8700..8ac4250394 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc @@ -17,21 +17,21 @@ ) ;; definition for method 3 of type eye -(defmethod inspect eye ((obj eye)) - (when (not obj) - (set! obj obj) +(defmethod inspect eye ((this eye)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'eye) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tlid: ~f~%" (-> obj lid)) - (format #t "~1Tiris-scale: ~f~%" (-> obj iris-scale)) - (format #t "~1Tpupil-scale: ~f~%" (-> obj pupil-scale)) - (format #t "~1Tlid-scale: ~f~%" (-> obj lid-scale)) + (format #t "[~8x] ~A~%" this 'eye) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tlid: ~f~%" (-> this lid)) + (format #t "~1Tiris-scale: ~f~%" (-> this iris-scale)) + (format #t "~1Tpupil-scale: ~f~%" (-> this pupil-scale)) + (format #t "~1Tlid-scale: ~f~%" (-> this lid-scale)) (label cfg-4) - obj + this ) ;; definition of type eye-control @@ -52,23 +52,23 @@ ) ;; definition for method 3 of type eye-control -(defmethod inspect eye-control ((obj eye-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect eye-control ((this eye-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'eye-control) - (format #t "~1Tprocess: ~D~%" (-> obj process)) - (format #t "~1Tdraw-flag: ~A~%" (-> obj draw-flag)) - (format #t "~1Tdifferent-eyes: ~A~%" (-> obj different-eyes)) - (format #t "~1Trandom-time: ~D~%" (-> obj random-time)) - (format #t "~1Tbucket: ~D~%" (-> obj bucket)) - (format #t "~1Tblink: ~f~%" (-> obj blink)) - (format #t "~1Tshaders: #x~X~%" (-> obj shaders)) - (format #t "~1Tleft: #~%" (-> obj left)) - (format #t "~1Tright: #~%" (-> obj right)) + (format #t "[~8x] ~A~%" this 'eye-control) + (format #t "~1Tprocess: ~D~%" (-> this process)) + (format #t "~1Tdraw-flag: ~A~%" (-> this draw-flag)) + (format #t "~1Tdifferent-eyes: ~A~%" (-> this different-eyes)) + (format #t "~1Trandom-time: ~D~%" (-> this random-time)) + (format #t "~1Tbucket: ~D~%" (-> this bucket)) + (format #t "~1Tblink: ~f~%" (-> this blink)) + (format #t "~1Tshaders: #x~X~%" (-> this shaders)) + (format #t "~1Tleft: #~%" (-> this left)) + (format #t "~1Tright: #~%" (-> this right)) (label cfg-4) - obj + this ) ;; definition of type eye-control-array @@ -81,15 +81,15 @@ ) ;; definition for method 3 of type eye-control-array -(defmethod inspect eye-control-array ((obj eye-control-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect eye-control-array ((this eye-control-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdata[16] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type eye-control-arrays @@ -103,15 +103,15 @@ ) ;; definition for method 3 of type eye-control-arrays -(defmethod inspect eye-control-arrays ((obj eye-control-arrays)) - (when (not obj) - (set! obj obj) +(defmethod inspect eye-control-arrays ((this eye-control-arrays)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdata[6] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdata[6] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type eye-work @@ -127,18 +127,18 @@ ) ;; definition for method 3 of type eye-work -(defmethod inspect eye-work ((obj eye-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect eye-work ((this eye-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'eye-work) - (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) - (format #t "~1Tsprite-tmpl2: #~%" (-> obj sprite-tmpl2)) - (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~1Tblink-table[10] @ #x~X~%" (-> obj blink-table)) + (format #t "[~8x] ~A~%" this 'eye-work) + (format #t "~1Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~1Tsprite-tmpl2: #~%" (-> this sprite-tmpl2)) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tblink-table[10] @ #x~X~%" (-> this blink-table)) (label cfg-4) - obj + this ) ;; definition for symbol *eye-control-arrays*, type eye-control-arrays @@ -169,7 +169,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc index 97dc3d8593..5051925612 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc @@ -15,18 +15,18 @@ ) ;; definition for method 3 of type mercneric-chain -(defmethod inspect mercneric-chain ((obj mercneric-chain)) - (when (not obj) - (set! obj obj) +(defmethod inspect mercneric-chain ((this mercneric-chain)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mercneric-chain) - (format #t "~1Tfirst: #x~X~%" (-> obj first)) - (format #t "~1Tnext: #x~X~%" (-> obj next)) - (format #t "~1Tstate: #~%" (-> obj state)) - (format #t "~1Tvu1-bucket: ~D~%" (-> obj vu1-bucket)) + (format #t "[~8x] ~A~%" this 'mercneric-chain) + (format #t "~1Tfirst: #x~X~%" (-> this first)) + (format #t "~1Tnext: #x~X~%" (-> this next)) + (format #t "~1Tstate: #~%" (-> this state)) + (format #t "~1Tvu1-bucket: ~D~%" (-> this vu1-bucket)) (label cfg-4) - obj + this ) ;; definition of type merc-chain @@ -42,17 +42,17 @@ ) ;; definition for method 3 of type merc-chain -(defmethod inspect merc-chain ((obj merc-chain)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-chain ((this merc-chain)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-chain) - (format #t "~1Tfirst: #~%" (-> obj first)) - (format #t "~1Tpatch: #~%" (-> obj patch)) - (format #t "~1Tvu1-bucket: ~D~%" (-> obj vu1-bucket)) + (format #t "[~8x] ~A~%" this 'merc-chain) + (format #t "~1Tfirst: #~%" (-> this first)) + (format #t "~1Tpatch: #~%" (-> this patch)) + (format #t "~1Tvu1-bucket: ~D~%" (-> this vu1-bucket)) (label cfg-4) - obj + this ) ;; definition of type foreground-bucket @@ -67,17 +67,17 @@ ) ;; definition for method 3 of type foreground-bucket -(defmethod inspect foreground-bucket ((obj foreground-bucket)) - (when (not obj) - (set! obj obj) +(defmethod inspect foreground-bucket ((this foreground-bucket)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'foreground-bucket) - (format #t "~1Tmerc: #~%" (-> obj merc)) - (format #t "~1Temerc: #~%" (-> obj emerc)) - (format #t "~1Tmercneric: #~%" (-> obj mercneric)) + (format #t "[~8x] ~A~%" this 'foreground-bucket) + (format #t "~1Tmerc: #~%" (-> this merc)) + (format #t "~1Temerc: #~%" (-> this emerc)) + (format #t "~1Tmercneric: #~%" (-> this mercneric)) (label cfg-4) - obj + this ) ;; definition of type foreground-level-buckets @@ -90,15 +90,15 @@ ) ;; definition for method 3 of type foreground-level-buckets -(defmethod inspect foreground-level-buckets ((obj foreground-level-buckets)) - (when (not obj) - (set! obj obj) +(defmethod inspect foreground-level-buckets ((this foreground-level-buckets)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'foreground-level-buckets) - (format #t "~1Tdata[7] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'foreground-level-buckets) + (format #t "~1Tdata[7] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type foreground-bucket-grid @@ -112,16 +112,16 @@ ) ;; definition for method 3 of type foreground-bucket-grid -(defmethod inspect foreground-bucket-grid ((obj foreground-bucket-grid)) - (when (not obj) - (set! obj obj) +(defmethod inspect foreground-bucket-grid ((this foreground-bucket-grid)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'foreground-bucket-grid) - (format #t "~1Tlevel-buckets[7] @ #x~X~%" (-> obj level-buckets)) - (format #t "~1Twarp-chain: #~%" (-> obj warp-chain)) + (format #t "[~8x] ~A~%" this 'foreground-bucket-grid) + (format #t "~1Tlevel-buckets[7] @ #x~X~%" (-> this level-buckets)) + (format #t "~1Twarp-chain: #~%" (-> this warp-chain)) (label cfg-4) - obj + this ) ;; definition of type foreground-regs @@ -147,28 +147,28 @@ ) ;; definition for method 3 of type foreground-regs -(defmethod inspect foreground-regs ((obj foreground-regs)) - (when (not obj) - (set! obj obj) +(defmethod inspect foreground-regs ((this foreground-regs)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'foreground-regs) - (format #t "~1Tdist: ~f~%" (-> obj dist)) - (format #t "~1Tmerc-used: ~D~%" (-> obj merc-used)) - (format #t "~1Temerc-used: ~D~%" (-> obj emerc-used)) - (format #t "~1Tmercneric-used: ~D~%" (-> obj mercneric-used)) - (format #t "~1Tuse-isometric: ~D~%" (-> obj use-isometric)) - (format #t "~1Tbase-start: #~%" (-> obj base-start)) - (format #t "~1Tjoint-ptr: #x~X~%" (-> obj joint-ptr)) - (format #t "~1Tbone-ptr: #x~X~%" (-> obj bone-ptr)) - (format #t "~1Tnum-bones: ~D~%" (-> obj num-bones)) - (format #t "~1Tmtxs: #x~X~%" (-> obj mtxs)) - (format #t "~1Tdma-buf: ~A~%" (-> obj dma-buf)) - (format #t "~1Tdefault-texture-index: ~D~%" (-> obj default-texture-index)) - (format #t "~1Tmercneric-chain: #~%" (-> obj mercneric-chain)) - (format #t "~1Tlevel-buckets: #~%" (-> obj level-buckets)) + (format #t "[~8x] ~A~%" this 'foreground-regs) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tmerc-used: ~D~%" (-> this merc-used)) + (format #t "~1Temerc-used: ~D~%" (-> this emerc-used)) + (format #t "~1Tmercneric-used: ~D~%" (-> this mercneric-used)) + (format #t "~1Tuse-isometric: ~D~%" (-> this use-isometric)) + (format #t "~1Tbase-start: #~%" (-> this base-start)) + (format #t "~1Tjoint-ptr: #x~X~%" (-> this joint-ptr)) + (format #t "~1Tbone-ptr: #x~X~%" (-> this bone-ptr)) + (format #t "~1Tnum-bones: ~D~%" (-> this num-bones)) + (format #t "~1Tmtxs: #x~X~%" (-> this mtxs)) + (format #t "~1Tdma-buf: ~A~%" (-> this dma-buf)) + (format #t "~1Tdefault-texture-index: ~D~%" (-> this default-texture-index)) + (format #t "~1Tmercneric-chain: #~%" (-> this mercneric-chain)) + (format #t "~1Tlevel-buckets: #~%" (-> this level-buckets)) (label cfg-4) - obj + this ) ;; definition of type foreground-work @@ -187,21 +187,21 @@ ) ;; definition for method 3 of type foreground-work -(defmethod inspect foreground-work ((obj foreground-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect foreground-work ((this foreground-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'foreground-work) - (format #t "~1Tregs: #~%" (-> obj regs)) - (format #t "~1Tdraw-index-map[7] @ #x~X~%" (-> obj draw-index-map)) - (format #t "~1Tgrid: #~%" (-> obj grid)) - (format #t "~1Tbounds: #~%" (-> obj bounds)) - (format #t "~1Tlights: #~%" (-> obj lights)) - (format #t "~1Tdistance: #~%" (-> obj distance)) - (format #t "~1Tnext-tmpl: #~%" (-> obj next-tmpl)) + (format #t "[~8x] ~A~%" this 'foreground-work) + (format #t "~1Tregs: #~%" (-> this regs)) + (format #t "~1Tdraw-index-map[7] @ #x~X~%" (-> this draw-index-map)) + (format #t "~1Tgrid: #~%" (-> this grid)) + (format #t "~1Tbounds: #~%" (-> this bounds)) + (format #t "~1Tlights: #~%" (-> this lights)) + (format #t "~1Tdistance: #~%" (-> this distance)) + (format #t "~1Tnext-tmpl: #~%" (-> this next-tmpl)) (label cfg-4) - obj + this ) ;; definition for function invalidate-cache-line @@ -227,16 +227,16 @@ ) ;; definition for method 3 of type texscroll-globals -(defmethod inspect texscroll-globals ((obj texscroll-globals)) - (when (not obj) - (set! obj obj) +(defmethod inspect texscroll-globals ((this texscroll-globals)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texscroll-globals) - (format #t "~1Trequests: ~D~%" (-> obj requests)) - (format #t "~1Teffects[32] @ #x~X~%" (-> obj effects)) + (format #t "[~8x] ~A~%" this 'texscroll-globals) + (format #t "~1Trequests: ~D~%" (-> this requests)) + (format #t "~1Teffects[32] @ #x~X~%" (-> this effects)) (label cfg-4) - obj + this ) ;; definition of type merc-effect-bucket-info @@ -255,19 +255,19 @@ ) ;; definition for method 3 of type merc-effect-bucket-info -(defmethod inspect merc-effect-bucket-info ((obj merc-effect-bucket-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-effect-bucket-info ((this merc-effect-bucket-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-effect-bucket-info) - (format #t "~1Tcolor-fade: ~D~%" (-> obj color-fade)) - (format #t "~1Tmerc-path: ~D~%" (-> obj merc-path)) - (format #t "~1Tignore-alpha: ~D~%" (-> obj ignore-alpha)) - (format #t "~1Tdisable-draw: ~D~%" (-> obj disable-draw)) - (format #t "~1Tdisable-envmap: ~D~%" (-> obj disable-envmap)) + (format #t "[~8x] ~A~%" this 'merc-effect-bucket-info) + (format #t "~1Tcolor-fade: ~D~%" (-> this color-fade)) + (format #t "~1Tmerc-path: ~D~%" (-> this merc-path)) + (format #t "~1Tignore-alpha: ~D~%" (-> this ignore-alpha)) + (format #t "~1Tdisable-draw: ~D~%" (-> this disable-draw)) + (format #t "~1Tdisable-envmap: ~D~%" (-> this disable-envmap)) (label cfg-4) - obj + this ) ;; definition of type merc-bucket-info @@ -284,19 +284,19 @@ ) ;; definition for method 3 of type merc-bucket-info -(defmethod inspect merc-bucket-info ((obj merc-bucket-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-bucket-info ((this merc-bucket-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-bucket-info) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tneeds-clip: ~D~%" (-> obj needs-clip)) - (format #t "~1Tneed-mercprime-if-merc: ~D~%" (-> obj need-mercprime-if-merc)) - (format #t "~1Tmust-use-mercneric-for-clip: ~D~%" (-> obj must-use-mercneric-for-clip)) - (format #t "~1Teffect[64] @ #x~X~%" (-> obj effect)) + (format #t "[~8x] ~A~%" this 'merc-bucket-info) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tneeds-clip: ~D~%" (-> this needs-clip)) + (format #t "~1Tneed-mercprime-if-merc: ~D~%" (-> this need-mercprime-if-merc)) + (format #t "~1Tmust-use-mercneric-for-clip: ~D~%" (-> this must-use-mercneric-for-clip)) + (format #t "~1Teffect[64] @ #x~X~%" (-> this effect)) (label cfg-4) - obj + this ) ;; definition of type foreground-globals @@ -311,17 +311,17 @@ ) ;; definition for method 3 of type foreground-globals -(defmethod inspect foreground-globals ((obj foreground-globals)) - (when (not obj) - (set! obj obj) +(defmethod inspect foreground-globals ((this foreground-globals)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'foreground-globals) - (format #t "~1Tforeground-grid: #~%" (-> obj foreground-grid)) - (format #t "~1Tmerc-bucket-info: #~%" (-> obj merc-bucket-info)) - (format #t "~1Ttexscroll: #~%" (-> obj texscroll)) + (format #t "[~8x] ~A~%" this 'foreground-globals) + (format #t "~1Tforeground-grid: #~%" (-> this foreground-grid)) + (format #t "~1Tmerc-bucket-info: #~%" (-> this merc-bucket-info)) + (format #t "~1Ttexscroll: #~%" (-> this texscroll)) (label cfg-4) - obj + this ) ;; definition for symbol *foreground*, type foreground-globals @@ -341,19 +341,19 @@ ) ;; definition for method 3 of type shadow-dma-packet -(defmethod inspect shadow-dma-packet ((obj shadow-dma-packet)) - (when (not obj) - (set! obj obj) +(defmethod inspect shadow-dma-packet ((this shadow-dma-packet)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'shadow-dma-packet) - (format #t "~1Ttag: #~%" (-> obj tag)) - (format #t "~1Tsettings: #~%" (-> obj settings)) - (format #t "~1Tgeo-ref: #~%" (-> obj geo-ref)) - (format #t "~1Tmtx-ref: #~%" (-> obj mtx-ref)) - (format #t "~1Tend-tag: #~%" (-> obj end-tag)) + (format #t "[~8x] ~A~%" this 'shadow-dma-packet) + (format #t "~1Ttag: #~%" (-> this tag)) + (format #t "~1Tsettings: #~%" (-> this settings)) + (format #t "~1Tgeo-ref: #~%" (-> this geo-ref)) + (format #t "~1Tmtx-ref: #~%" (-> this mtx-ref)) + (format #t "~1Tend-tag: #~%" (-> this end-tag)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/lightning-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/lightning-h_REF.gc index 8f8c7dac4a..52df44547c 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/lightning-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/lightning-h_REF.gc @@ -31,35 +31,35 @@ ) ;; definition for method 3 of type lightning-spec -(defmethod inspect lightning-spec ((obj lightning-spec)) - (when (not obj) - (set! obj obj) +(defmethod inspect lightning-spec ((this lightning-spec)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Trand-func: ~D~%" (-> obj rand-func)) - (format #t "~1Tadjust-distance: ~D~%" (-> obj adjust-distance)) - (format #t "~1Tstart-color: ~D~%" (-> obj start-color)) - (format #t "~1Tend-color: ~D~%" (-> obj end-color)) - (format #t "~1Tfade-to-color: ~D~%" (-> obj fade-to-color)) - (format #t "~1Tfade-start-factor: ~f~%" (-> obj fade-start-factor)) - (format #t "~1Tfade-time: ~f~%" (-> obj fade-time)) - (format #t "~1Ttexture: ~D~%" (-> obj texture)) - (format #t "~1Treduction: ~f~%" (-> obj reduction)) - (format #t "~1Tnum-points: ~D~%" (-> obj num-points)) - (format #t "~1Tbox-size: ~f~%" (-> obj box-size)) - (format #t "~1Tmerge-factor: ~f~%" (-> obj merge-factor)) - (format #t "~1Tmerge-count: ~D~%" (-> obj merge-count)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) - (format #t "~1Tduration: ~f~%" (-> obj duration)) - (format #t "~1Tduration-rand: ~f~%" (-> obj duration-rand)) - (format #t "~1Tsound: ~A~%" (-> obj sound)) - (format #t "~1Tdelay: ~f~%" (-> obj delay)) - (format #t "~1Tdelay-rand: ~f~%" (-> obj delay-rand)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Trand-func: ~D~%" (-> this rand-func)) + (format #t "~1Tadjust-distance: ~D~%" (-> this adjust-distance)) + (format #t "~1Tstart-color: ~D~%" (-> this start-color)) + (format #t "~1Tend-color: ~D~%" (-> this end-color)) + (format #t "~1Tfade-to-color: ~D~%" (-> this fade-to-color)) + (format #t "~1Tfade-start-factor: ~f~%" (-> this fade-start-factor)) + (format #t "~1Tfade-time: ~f~%" (-> this fade-time)) + (format #t "~1Ttexture: ~D~%" (-> this texture)) + (format #t "~1Treduction: ~f~%" (-> this reduction)) + (format #t "~1Tnum-points: ~D~%" (-> this num-points)) + (format #t "~1Tbox-size: ~f~%" (-> this box-size)) + (format #t "~1Tmerge-factor: ~f~%" (-> this merge-factor)) + (format #t "~1Tmerge-count: ~D~%" (-> this merge-count)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tduration: ~f~%" (-> this duration)) + (format #t "~1Tduration-rand: ~f~%" (-> this duration-rand)) + (format #t "~1Tsound: ~A~%" (-> this sound)) + (format #t "~1Tdelay: ~f~%" (-> this delay)) + (format #t "~1Tdelay-rand: ~f~%" (-> this delay-rand)) (label cfg-4) - obj + this ) ;; definition for function lookup-lightning-spec-by-name @@ -97,24 +97,24 @@ ) ;; definition for method 3 of type lightning-state -(defmethod inspect lightning-state ((obj lightning-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect lightning-state ((this lightning-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'lightning-state) - (format #t "~1Tmode: ~D~%" (-> obj mode)) - (format #t "~1Tcounter: ~f~%" (-> obj counter)) - (format #t "~1Tpoints-to-draw: ~D~%" (-> obj points-to-draw)) - (format #t "~1Tbox-size: ~f~%" (-> obj box-size)) - (format #t "~1Tgcf-control: #~%" (-> obj gcf-control)) - (format #t "~1Tline: ~A~%" (-> obj line)) - (format #t "~1Tmeet: ~A~%" (-> obj meet)) - (format #t "~1Tpath: ~A~%" (-> obj path)) - (format #t "~1Tstart-color: ~D~%" (-> obj start-color)) - (format #t "~1Tend-color: ~D~%" (-> obj end-color)) + (format #t "[~8x] ~A~%" this 'lightning-state) + (format #t "~1Tmode: ~D~%" (-> this mode)) + (format #t "~1Tcounter: ~f~%" (-> this counter)) + (format #t "~1Tpoints-to-draw: ~D~%" (-> this points-to-draw)) + (format #t "~1Tbox-size: ~f~%" (-> this box-size)) + (format #t "~1Tgcf-control: #~%" (-> this gcf-control)) + (format #t "~1Tline: ~A~%" (-> this line)) + (format #t "~1Tmeet: ~A~%" (-> this meet)) + (format #t "~1Tpath: ~A~%" (-> this path)) + (format #t "~1Tstart-color: ~D~%" (-> this start-color)) + (format #t "~1Tend-color: ~D~%" (-> this end-color)) (label cfg-4) - obj + this ) ;; definition of type lightning-control @@ -137,48 +137,48 @@ ) ;; definition for method 3 of type lightning-control -(defmethod inspect lightning-control ((obj lightning-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect lightning-control ((this lightning-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tspec: ~A~%" (-> obj spec)) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Tstate: #~%" (-> obj state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tspec: ~A~%" (-> this spec)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tstate: #~%" (-> this state)) (label cfg-4) - obj + this ) ;; definition for method 9 of type lightning-control -(defmethod change-mode lightning-control ((obj lightning-control) (arg0 lightning-mode)) - (let ((v1-1 (!= arg0 (-> obj state mode)))) +(defmethod change-mode lightning-control ((this lightning-control) (arg0 lightning-mode)) + (let ((v1-1 (!= arg0 (-> this state mode)))) (case arg0 (((lightning-mode lm3)) (if v1-1 - (set! (-> obj state counter) 0.0) + (set! (-> this state counter) 0.0) ) ) (((lightning-mode lm1)) - (set! (-> obj state start-color) (-> obj spec start-color)) - (set! (-> obj state end-color) (-> obj spec end-color)) + (set! (-> this state start-color) (-> this spec start-color)) + (set! (-> this state end-color) (-> this spec end-color)) ) ) ) - (set! (-> obj state mode) arg0) + (set! (-> this state mode) arg0) arg0 ) ;; definition for method 10 of type lightning-control -(defmethod get-mode lightning-control ((obj lightning-control)) - (-> obj state mode) +(defmethod get-mode lightning-control ((this lightning-control)) + (-> this state mode) ) ;; definition for method 11 of type lightning-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-point! lightning-control ((obj lightning-control) (arg0 int) (arg1 vector)) - (let ((v1-0 (-> obj state))) +(defmethod set-point! lightning-control ((this lightning-control) (arg0 int) (arg1 vector)) + (let ((v1-0 (-> this state))) (when (and (-> v1-0 path) (>= arg0 0) (< arg0 (-> v1-0 path length))) (set! (-> v1-0 path data arg0 quad) (-> arg1 quad)) (when (and (< (+ (-> v1-0 points-to-draw) -1) arg0) (case (-> v1-0 mode) @@ -202,44 +202,44 @@ ;; definition for method 12 of type lightning-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch (inline-array vector) vs none. -(defmethod set-first-meet-point lightning-control ((obj lightning-control) (arg0 vector)) - (set! (-> obj state meet data 0 quad) (-> arg0 quad)) +(defmethod set-first-meet-point lightning-control ((this lightning-control) (arg0 vector)) + (set! (-> this state meet data 0 quad) (-> arg0 quad)) (none) ) ;; definition for method 13 of type lightning-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod set-last-meet-point lightning-control ((obj lightning-control) (arg0 vector)) - (set! (-> obj state meet data (+ (-> obj state points-to-draw) -1) quad) (-> arg0 quad)) +(defmethod set-last-meet-point lightning-control ((this lightning-control) (arg0 vector)) + (set! (-> this state meet data (+ (-> this state points-to-draw) -1) quad) (-> arg0 quad)) (none) ) ;; definition for method 7 of type lightning-control -(defmethod relocate lightning-control ((obj lightning-control) (arg0 int)) - (&+! (-> obj state line) arg0) - (&+! (-> obj state meet) arg0) - (if (-> obj state path) - (&+! (-> obj state path) arg0) +(defmethod relocate lightning-control ((this lightning-control) (arg0 int)) + (&+! (-> this state line) arg0) + (&+! (-> this state meet) arg0) + (if (-> this state path) + (&+! (-> this state path) arg0) ) - (let ((v1-8 (-> obj spec))) + (let ((v1-8 (-> this spec))) (if (and (>= (the-as int v1-8) (-> *kernel-context* relocating-min)) (< (the-as int v1-8) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj spec) arg0) + (&+! (-> this spec) arg0) ) ) - obj + this ) ;; definition for method 0 of type lightning-control ;; WARN: Return type mismatch object vs lightning-control. (defmethod new lightning-control ((allocation symbol) (type-to-make type) (arg0 lightning-spec) (arg1 process) (arg2 float)) (with-pp - (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (when (zero? obj) + (let ((this (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? this) (go process-drawable-art-error "memory") - (set! obj (the-as lightning-control 0)) + (set! this (the-as lightning-control 0)) (goto cfg-14) ) (let ((s3-0 (-> arg0 num-points))) @@ -250,28 +250,28 @@ (set! f0-0 (* f0-0 f1-1)) ) ) - (set! (-> obj state box-size) f0-0) + (set! (-> this state box-size) f0-0) ) - (set! (-> obj process) (process->ppointer arg1)) - (set! (-> obj state mode) (lightning-mode lm1)) - (set! (-> obj state line) ((method-of-type vector-array new) allocation vector-array s3-0)) - (set! (-> obj state meet) ((method-of-type vector-array new) allocation vector-array s3-0)) + (set! (-> this process) (process->ppointer arg1)) + (set! (-> this state mode) (lightning-mode lm1)) + (set! (-> this state line) ((method-of-type vector-array new) allocation vector-array s3-0)) + (set! (-> this state meet) ((method-of-type vector-array new) allocation vector-array s3-0)) (let ((v1-18 (-> arg0 rand-func))) - (set! (-> obj state path) (if (or (= v1-18 2) (= v1-18 3)) - ((method-of-type vector-array new) allocation vector-array s3-0) - (the-as vector-array #f) - ) + (set! (-> this state path) (if (or (= v1-18 2) (= v1-18 3)) + ((method-of-type vector-array new) allocation vector-array s3-0) + (the-as vector-array #f) + ) ) ) - (set! (-> obj state counter) 0.0) - (set! (-> obj state points-to-draw) s3-0) + (set! (-> this state counter) 0.0) + (set! (-> this state points-to-draw) s3-0) ) - (set! (-> obj spec) arg0) - (set! (-> obj state start-color) (-> arg0 start-color)) - (set! (-> obj state end-color) (-> arg0 end-color)) - (add-connection *lightning-engine* pp nothing obj #f #f) + (set! (-> this spec) arg0) + (set! (-> this state start-color) (-> arg0 start-color)) + (set! (-> this state end-color) (-> arg0 end-color)) + (add-connection *lightning-engine* pp nothing this #f #f) (label cfg-14) - (the-as lightning-control obj) + (the-as lightning-control this) ) ) ) @@ -292,21 +292,21 @@ ) ;; definition for method 3 of type lightning-probe-vars -(defmethod inspect lightning-probe-vars ((obj lightning-probe-vars)) - (when (not obj) - (set! obj obj) +(defmethod inspect lightning-probe-vars ((this lightning-probe-vars)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tsrc-joint-index: ~D~%" (-> obj src-joint-index)) - (format #t "~1Tnext-spawn-time: ~D~%" (-> obj next-spawn-time)) - (format #t "~1Tlast-valid-time: ~D~%" (-> obj last-valid-time)) - (format #t "~1Tpoint[2] @ #x~X~%" (-> obj point)) - (format #t "~1Tstart-pos: #~%" (-> obj point)) - (format #t "~1Tend-pos: #~%" (-> obj end-pos)) - (format #t "~1Tprobe-dirs: #x~X~%" (-> obj probe-dirs)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tsrc-joint-index: ~D~%" (-> this src-joint-index)) + (format #t "~1Tnext-spawn-time: ~D~%" (-> this next-spawn-time)) + (format #t "~1Tlast-valid-time: ~D~%" (-> this last-valid-time)) + (format #t "~1Tpoint[2] @ #x~X~%" (-> this point)) + (format #t "~1Tstart-pos: #~%" (-> this point)) + (format #t "~1Tend-pos: #~%" (-> this end-pos)) + (format #t "~1Tprobe-dirs: #x~X~%" (-> this probe-dirs)) (label cfg-4) - obj + this ) ;; definition for symbol *lightning-probe-vars*, type lightning-probe-vars diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/lightning_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/lightning_REF.gc index 5c3fb95395..c3b0327bfb 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/lightning_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/lightning_REF.gc @@ -269,16 +269,16 @@ ) ;; definition for method 3 of type lightning-globals -(defmethod inspect lightning-globals ((obj lightning-globals)) - (when (not obj) - (set! obj obj) +(defmethod inspect lightning-globals ((this lightning-globals)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'lightning-globals) - (format #t "~1Tgcf-buf: ~D~%" (-> obj gcf-buf)) - (format #t "~1Tvtx-buf: ~D~%" (-> obj vtx-buf)) + (format #t "[~8x] ~A~%" this 'lightning-globals) + (format #t "~1Tgcf-buf: ~D~%" (-> this gcf-buf)) + (format #t "~1Tvtx-buf: ~D~%" (-> this vtx-buf)) (label cfg-4) - obj + this ) ;; definition for function gs-packed-rgba-lerp! diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/lights-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/lights-h_REF.gc index 07133a036b..189a98018d 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/lights-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/lights-h_REF.gc @@ -15,17 +15,17 @@ ) ;; definition for method 3 of type vu-lights -(defmethod inspect vu-lights ((obj vu-lights)) - (when (not obj) - (set! obj obj) +(defmethod inspect vu-lights ((this vu-lights)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vu-lights) - (format #t "~1Tdirection[3] @ #x~X~%" (-> obj direction)) - (format #t "~1Tcolor[3] @ #x~X~%" (-> obj color)) - (format #t "~1Tambient: ~`vector`P~%" (-> obj ambient)) + (format #t "[~8x] ~A~%" this 'vu-lights) + (format #t "~1Tdirection[3] @ #x~X~%" (-> this direction)) + (format #t "~1Tcolor[3] @ #x~X~%" (-> this color)) + (format #t "~1Tambient: ~`vector`P~%" (-> this ambient)) (label cfg-4) - obj + this ) ;; definition of type light @@ -46,23 +46,23 @@ ) ;; definition for method 3 of type light -(defmethod inspect light ((obj light)) - (when (not obj) - (set! obj obj) +(defmethod inspect light ((this light)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'light) - (format #t "~1Tdirection: #~%" (-> obj direction)) - (format #t "~1Tcolor: #~%" (-> obj color)) - (format #t "~1Textra: #~%" (-> obj extra)) - (format #t "~1Tlevel: ~f~%" (-> obj extra x)) - (format #t "~1Tluminance: ~f~%" (-> obj extra z)) - (format #t "~1Tpriority: ~f~%" (-> obj extra w)) - (format #t "~1Tbytes[4] @ #x~X~%" (&-> obj extra y)) - (format #t "~1Tmask: ~D~%" (-> obj mask)) - (format #t "~1Tpalette-index: ~D~%" (-> obj palette-index)) + (format #t "[~8x] ~A~%" this 'light) + (format #t "~1Tdirection: #~%" (-> this direction)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Textra: #~%" (-> this extra)) + (format #t "~1Tlevel: ~f~%" (-> this extra x)) + (format #t "~1Tluminance: ~f~%" (-> this extra z)) + (format #t "~1Tpriority: ~f~%" (-> this extra w)) + (format #t "~1Tbytes[4] @ #x~X~%" (&-> this extra y)) + (format #t "~1Tmask: ~D~%" (-> this mask)) + (format #t "~1Tpalette-index: ~D~%" (-> this palette-index)) (label cfg-4) - obj + this ) ;; definition of type light-sphere @@ -84,24 +84,24 @@ ) ;; definition for method 3 of type light-sphere -(defmethod inspect light-sphere ((obj light-sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect light-sphere ((this light-sphere)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'light-sphere) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tdirection: ~`vector`P~%" (-> obj direction)) - (format #t "~1Tcolor: ~`vector`P~%" (-> obj color)) - (format #t "~1Tdecay-start: ~f~%" (-> obj decay-start)) - (format #t "~1Tambient-point-ratio: ~f~%" (-> obj ambient-point-ratio)) - (format #t "~1Tbrightness: ~f~%" (-> obj brightness)) - (format #t "~1Tbytes[4] @ #x~X~%" (&-> obj color w)) - (format #t "~1Tmask: ~D~%" (-> obj mask)) - (format #t "~1Tpalette-index: ~D~%" (-> obj palette-index)) + (format #t "[~8x] ~A~%" this 'light-sphere) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tdirection: ~`vector`P~%" (-> this direction)) + (format #t "~1Tcolor: ~`vector`P~%" (-> this color)) + (format #t "~1Tdecay-start: ~f~%" (-> this decay-start)) + (format #t "~1Tambient-point-ratio: ~f~%" (-> this ambient-point-ratio)) + (format #t "~1Tbrightness: ~f~%" (-> this brightness)) + (format #t "~1Tbytes[4] @ #x~X~%" (&-> this color w)) + (format #t "~1Tmask: ~D~%" (-> this mask)) + (format #t "~1Tpalette-index: ~D~%" (-> this palette-index)) (label cfg-4) - obj + this ) ;; definition of type light-hash-bucket @@ -116,16 +116,16 @@ ) ;; definition for method 3 of type light-hash-bucket -(defmethod inspect light-hash-bucket ((obj light-hash-bucket)) - (when (not obj) - (set! obj obj) +(defmethod inspect light-hash-bucket ((this light-hash-bucket)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'light-hash-bucket) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "[~8x] ~A~%" this 'light-hash-bucket) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tcount: ~D~%" (-> this count)) (label cfg-4) - obj + this ) ;; definition of type light-hash @@ -147,24 +147,24 @@ ) ;; definition for method 3 of type light-hash -(defmethod inspect light-hash ((obj light-hash)) - (when (not obj) - (set! obj obj) +(defmethod inspect light-hash ((this light-hash)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnum-lights: ~D~%" (-> obj num-lights)) - (format #t "~1Tnum-indices: ~D~%" (-> obj num-indices)) - (format #t "~1Tnum-buckets: ~D~%" (-> obj num-buckets)) - (format #t "~1Tbucket-step[2] @ #x~X~%" (-> obj bucket-step)) - (format #t "~1Tbase-trans: #~%" (-> obj base-trans)) - (format #t "~1Taxis-scale: #~%" (-> obj axis-scale)) - (format #t "~1Tdimension-array: #~%" (-> obj dimension-array)) - (format #t "~1Tbucket-array: #x~X~%" (-> obj bucket-array)) - (format #t "~1Tindex-array: #x~X~%" (-> obj index-array)) - (format #t "~1Tlight-sphere-array: #x~X~%" (-> obj light-sphere-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-lights: ~D~%" (-> this num-lights)) + (format #t "~1Tnum-indices: ~D~%" (-> this num-indices)) + (format #t "~1Tnum-buckets: ~D~%" (-> this num-buckets)) + (format #t "~1Tbucket-step[2] @ #x~X~%" (-> this bucket-step)) + (format #t "~1Tbase-trans: #~%" (-> this base-trans)) + (format #t "~1Taxis-scale: #~%" (-> this axis-scale)) + (format #t "~1Tdimension-array: #~%" (-> this dimension-array)) + (format #t "~1Tbucket-array: #x~X~%" (-> this bucket-array)) + (format #t "~1Tindex-array: #x~X~%" (-> this index-array)) + (format #t "~1Tlight-sphere-array: #x~X~%" (-> this light-sphere-array)) (label cfg-4) - obj + this ) ;; definition of type light-hash-work @@ -177,32 +177,32 @@ ) ;; definition for method 3 of type light-hash-work -(defmethod inspect light-hash-work ((obj light-hash-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect light-hash-work ((this light-hash-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'light-hash-work) - (format #t "~1Tones: #~%" (-> obj ones)) + (format #t "[~8x] ~A~%" this 'light-hash-work) + (format #t "~1Tones: #~%" (-> this ones)) (label cfg-4) - obj + this ) ;; definition for symbol *light-hash*, type light-hash (define *light-hash* (the-as light-hash #f)) ;; definition for method 2 of type light -(defmethod print light ((obj light)) +(defmethod print light ((this light)) (format #t "# obj extra x) - (-> obj direction x) - (-> obj direction y) - (-> obj direction z) + (-> this extra x) + (-> this direction x) + (-> this direction y) + (-> this direction z) ) - (format #t "~F ~F ~F @ #x~X>" (-> obj color x) (-> obj color y) (-> obj color z) obj) - obj + (format #t "~F ~F ~F @ #x~X>" (-> this color x) (-> this color y) (-> this color z) this) + this ) ;; definition of type light-group @@ -219,18 +219,18 @@ ) ;; definition for method 3 of type light-group -(defmethod inspect light-group ((obj light-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect light-group ((this light-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'light-group) - (format #t "~1Tdir0: ~`light`P~%" (-> obj dir0)) - (format #t "~1Tdir1: ~`light`P~%" (-> obj dir1)) - (format #t "~1Tdir2: ~`light`P~%" (-> obj dir2)) - (format #t "~1Tambi: ~`light`P~%" (-> obj ambi)) + (format #t "[~8x] ~A~%" this 'light-group) + (format #t "~1Tdir0: ~`light`P~%" (-> this dir0)) + (format #t "~1Tdir1: ~`light`P~%" (-> this dir1)) + (format #t "~1Tdir2: ~`light`P~%" (-> this dir2)) + (format #t "~1Tambi: ~`light`P~%" (-> this ambi)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/generic-merc-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/generic-merc-h_REF.gc index 2716e37abd..8693899d96 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/generic-merc-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/generic-merc-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type merc-matrix -(defmethod inspect merc-matrix ((obj merc-matrix)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-matrix ((this merc-matrix)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-matrix) - (format #t "~1Tquad[8] @ #x~X~%" (-> obj vector)) - (format #t "~1Tvector[8] @ #x~X~%" (-> obj vector)) - (format #t "~1Ttag: ~D~%" (-> obj tag)) + (format #t "[~8x] ~A~%" this 'merc-matrix) + (format #t "~1Tquad[8] @ #x~X~%" (-> this vector)) + (format #t "~1Tvector[8] @ #x~X~%" (-> this vector)) + (format #t "~1Ttag: ~D~%" (-> this tag)) (label cfg-4) - obj + this ) ;; definition of type generic-merc-tag @@ -38,20 +38,20 @@ ;; definition for method 3 of type generic-merc-tag ;; INFO: Used lq/sq -(defmethod inspect generic-merc-tag ((obj generic-merc-tag)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-merc-tag ((this generic-merc-tag)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-merc-tag) - (format #t "~1Tdma: #x~X~%" (-> obj dma)) - (format #t "~1Tvif0: #x~X~%" (-> obj vif0)) - (format #t "~1Tvif1: #x~X~%" (-> obj vif1)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tnext-ptr: ~D~%" (-> obj vif1)) - (format #t "~1Tsize: ~D~%" (-> obj vif0)) + (format #t "[~8x] ~A~%" this 'generic-merc-tag) + (format #t "~1Tdma: #x~X~%" (-> this dma)) + (format #t "~1Tvif0: #x~X~%" (-> this vif0)) + (format #t "~1Tvif1: #x~X~%" (-> this vif1)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tnext-ptr: ~D~%" (-> this vif1)) + (format #t "~1Tsize: ~D~%" (-> this vif0)) (label cfg-4) - obj + this ) ;; definition of type generic-merc-ctrl @@ -67,18 +67,18 @@ ) ;; definition for method 3 of type generic-merc-ctrl -(defmethod inspect generic-merc-ctrl ((obj generic-merc-ctrl)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-merc-ctrl ((this generic-merc-ctrl)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-merc-ctrl) - (format #t "~1Ttag: #~%" (-> obj tag)) - (format #t "~1Tlights: #~%" (-> obj lights)) - (format #t "~1Theader: #~%" (-> obj header)) - (format #t "~1Teffect: #~%" (-> obj effect)) + (format #t "[~8x] ~A~%" this 'generic-merc-ctrl) + (format #t "~1Ttag: #~%" (-> this tag)) + (format #t "~1Tlights: #~%" (-> this lights)) + (format #t "~1Theader: #~%" (-> this header)) + (format #t "~1Teffect: #~%" (-> this effect)) (label cfg-4) - obj + this ) ;; definition of type generic-merc-ctrl-with-sfx @@ -91,19 +91,19 @@ ) ;; definition for method 3 of type generic-merc-ctrl-with-sfx -(defmethod inspect generic-merc-ctrl-with-sfx ((obj generic-merc-ctrl-with-sfx)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-merc-ctrl-with-sfx ((this generic-merc-ctrl-with-sfx)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-merc-ctrl-with-sfx) - (format #t "~1Ttag: #~%" (-> obj tag)) - (format #t "~1Tlights: #~%" (-> obj lights)) - (format #t "~1Theader: #~%" (-> obj header)) - (format #t "~1Teffect: #~%" (-> obj effect)) - (format #t "~1Tsfx-data[11] @ #x~X~%" (-> obj sfx-data)) + (format #t "[~8x] ~A~%" this 'generic-merc-ctrl-with-sfx) + (format #t "~1Ttag: #~%" (-> this tag)) + (format #t "~1Tlights: #~%" (-> this lights)) + (format #t "~1Theader: #~%" (-> this header)) + (format #t "~1Teffect: #~%" (-> this effect)) + (format #t "~1Tsfx-data[11] @ #x~X~%" (-> this sfx-data)) (label cfg-4) - obj + this ) ;; definition of type generic-merc-input @@ -122,21 +122,21 @@ ) ;; definition for method 3 of type generic-merc-input -(defmethod inspect generic-merc-input ((obj generic-merc-input)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-merc-input ((this generic-merc-input)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-merc-input) - (format #t "~1Tgeo-tag: #~%" (-> obj geo-tag)) - (format #t "~1Tgeo-block[1296] @ #x~X~%" (-> obj geo-block)) - (format #t "~1Tbyte-header: #~%" (-> obj geo-block)) - (format #t "~1Tmatrix[9] @ #x~X~%" (-> obj matrix)) - (format #t "~1Tcontrol: #~%" (-> obj control)) - (format #t "~1Tend-tag: #~%" (-> obj end-tag)) - (format #t "~1Tshader: #~%" (-> obj shader)) + (format #t "[~8x] ~A~%" this 'generic-merc-input) + (format #t "~1Tgeo-tag: #~%" (-> this geo-tag)) + (format #t "~1Tgeo-block[1296] @ #x~X~%" (-> this geo-block)) + (format #t "~1Tbyte-header: #~%" (-> this geo-block)) + (format #t "~1Tmatrix[9] @ #x~X~%" (-> this matrix)) + (format #t "~1Tcontrol: #~%" (-> this control)) + (format #t "~1Tend-tag: #~%" (-> this end-tag)) + (format #t "~1Tshader: #~%" (-> this shader)) (label cfg-4) - obj + this ) ;; definition of type generic-merc-output @@ -154,20 +154,20 @@ ) ;; definition for method 3 of type generic-merc-output -(defmethod inspect generic-merc-output ((obj generic-merc-output)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-merc-output ((this generic-merc-output)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-merc-output) - (format #t "~1Tinfo: #~%" (-> obj info)) - (format #t "~1Theader: #~%" (-> obj header)) - (format #t "~1Tindex-kick-table[80] @ #x~X~%" (-> obj index-kick-table)) - (format #t "~1Tindex-table[160] @ #x~X~%" (-> obj index-kick-table)) - (format #t "~1Tinverse-table[256] @ #x~X~%" (-> obj inverse-table)) - (format #t "~1Tvertex-table[72] @ #x~X~%" (-> obj vertex-table)) + (format #t "[~8x] ~A~%" this 'generic-merc-output) + (format #t "~1Tinfo: #~%" (-> this info)) + (format #t "~1Theader: #~%" (-> this header)) + (format #t "~1Tindex-kick-table[80] @ #x~X~%" (-> this index-kick-table)) + (format #t "~1Tindex-table[160] @ #x~X~%" (-> this index-kick-table)) + (format #t "~1Tinverse-table[256] @ #x~X~%" (-> this inverse-table)) + (format #t "~1Tvertex-table[72] @ #x~X~%" (-> this vertex-table)) (label cfg-4) - obj + this ) ;; definition of type generic-merc-dcache @@ -185,20 +185,20 @@ ) ;; definition for method 3 of type generic-merc-dcache -(defmethod inspect generic-merc-dcache ((obj generic-merc-dcache)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-merc-dcache ((this generic-merc-dcache)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-merc-dcache) - (format #t "~1Toutput-a: #~%" (-> obj output-a)) - (format #t "~1Toutput-b: #~%" (-> obj output-b)) - (format #t "~1Tinv-table-1[544] @ #x~X~%" (-> obj inv-table-1)) - (format #t "~1Tinv-table-7[544] @ #x~X~%" (-> obj inv-table-7)) - (format #t "~1Tinv-safety[16] @ #x~X~%" (-> obj inv-safety)) - (format #t "~1Teffect-data[1584] @ #x~X~%" (-> obj effect-data)) + (format #t "[~8x] ~A~%" this 'generic-merc-dcache) + (format #t "~1Toutput-a: #~%" (-> this output-a)) + (format #t "~1Toutput-b: #~%" (-> this output-b)) + (format #t "~1Tinv-table-1[544] @ #x~X~%" (-> this inv-table-1)) + (format #t "~1Tinv-table-7[544] @ #x~X~%" (-> this inv-table-7)) + (format #t "~1Tinv-safety[16] @ #x~X~%" (-> this inv-safety)) + (format #t "~1Teffect-data[1584] @ #x~X~%" (-> this effect-data)) (label cfg-4) - obj + this ) ;; definition of type gm-shadow @@ -237,41 +237,41 @@ ) ;; definition for method 3 of type gm-shadow -(defmethod inspect gm-shadow ((obj gm-shadow)) - (when (not obj) - (set! obj obj) +(defmethod inspect gm-shadow ((this gm-shadow)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gm-shadow) - (format #t "~1Tperspective: #~%" (-> obj perspective)) - (format #t "~1Tisometric: #~%" (-> obj isometric)) - (format #t "~1Tinv-camera-rot: #~%" (-> obj inv-camera-rot)) - (format #t "~1Tenvmap-shader: #~%" (-> obj envmap-shader)) - (format #t "~1Tcurrent-chain: ~D~%" (-> obj current-chain)) - (format #t "~1Tnext-chain: ~D~%" (-> obj next-chain)) - (format #t "~1Tbuf-index: ~D~%" (-> obj buf-index)) - (format #t "~1Tfragment-count: ~D~%" (-> obj fragment-count)) - (format #t "~1Twrite-limit: ~D~%" (-> obj write-limit)) - (format #t "~1Tindexed-input-base: #~%" (-> obj indexed-input-base)) - (format #t "~1Tother-input-base: #~%" (-> obj other-input-base)) - (format #t "~1Tindexed-output-base: #~%" (-> obj indexed-output-base)) - (format #t "~1Tother-output-base: #~%" (-> obj other-output-base)) - (format #t "~1Tp-input: #x~X~%" (-> obj p-input)) - (format #t "~1Tgsf-buf: #~%" (-> obj gsf-buf)) - (format #t "~1Tp-fheader: #~%" (-> obj p-fheader)) - (format #t "~1Tcurr-chain: ~A~%" (-> obj curr-chain)) - (format #t "~1Tmercneric-convert: ~A~%" (-> obj mercneric-convert)) - (format #t "~1Tgeneric-prepare-dma-single: ~A~%" (-> obj generic-prepare-dma-single)) - (format #t "~1Tgeneric-prepare-dma-double: ~A~%" (-> obj generic-prepare-dma-double)) - (format #t "~1Tgeneric-light-proc: ~A~%" (-> obj generic-light-proc)) - (format #t "~1Tgeneric-envmap-proc: ~A~%" (-> obj generic-envmap-proc)) - (format #t "~1Thigh-speed-reject: ~A~%" (-> obj high-speed-reject)) - (format #t "~1Tdummy-0: ~D~%" (-> obj dummy-0)) - (format #t "~1Thsr-xmult: #~%" (-> obj hsr-xmult)) - (format #t "~1Thsr-ymult: #~%" (-> obj hsr-ymult)) - (format #t "~1Twarp-consts: #~%" (-> obj warp-consts)) + (format #t "[~8x] ~A~%" this 'gm-shadow) + (format #t "~1Tperspective: #~%" (-> this perspective)) + (format #t "~1Tisometric: #~%" (-> this isometric)) + (format #t "~1Tinv-camera-rot: #~%" (-> this inv-camera-rot)) + (format #t "~1Tenvmap-shader: #~%" (-> this envmap-shader)) + (format #t "~1Tcurrent-chain: ~D~%" (-> this current-chain)) + (format #t "~1Tnext-chain: ~D~%" (-> this next-chain)) + (format #t "~1Tbuf-index: ~D~%" (-> this buf-index)) + (format #t "~1Tfragment-count: ~D~%" (-> this fragment-count)) + (format #t "~1Twrite-limit: ~D~%" (-> this write-limit)) + (format #t "~1Tindexed-input-base: #~%" (-> this indexed-input-base)) + (format #t "~1Tother-input-base: #~%" (-> this other-input-base)) + (format #t "~1Tindexed-output-base: #~%" (-> this indexed-output-base)) + (format #t "~1Tother-output-base: #~%" (-> this other-output-base)) + (format #t "~1Tp-input: #x~X~%" (-> this p-input)) + (format #t "~1Tgsf-buf: #~%" (-> this gsf-buf)) + (format #t "~1Tp-fheader: #~%" (-> this p-fheader)) + (format #t "~1Tcurr-chain: ~A~%" (-> this curr-chain)) + (format #t "~1Tmercneric-convert: ~A~%" (-> this mercneric-convert)) + (format #t "~1Tgeneric-prepare-dma-single: ~A~%" (-> this generic-prepare-dma-single)) + (format #t "~1Tgeneric-prepare-dma-double: ~A~%" (-> this generic-prepare-dma-double)) + (format #t "~1Tgeneric-light-proc: ~A~%" (-> this generic-light-proc)) + (format #t "~1Tgeneric-envmap-proc: ~A~%" (-> this generic-envmap-proc)) + (format #t "~1Thigh-speed-reject: ~A~%" (-> this high-speed-reject)) + (format #t "~1Tdummy-0: ~D~%" (-> this dummy-0)) + (format #t "~1Thsr-xmult: #~%" (-> this hsr-xmult)) + (format #t "~1Thsr-ymult: #~%" (-> this hsr-ymult)) + (format #t "~1Twarp-consts: #~%" (-> this warp-consts)) (label cfg-4) - obj + this ) ;; definition of type generic-merc-work @@ -288,19 +288,19 @@ ) ;; definition for method 3 of type generic-merc-work -(defmethod inspect generic-merc-work ((obj generic-merc-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-merc-work ((this generic-merc-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-merc-work) - (format #t "~1Tinput-a: #~%" (-> obj input-a)) - (format #t "~1Tinput-b: #~%" (-> obj input-b)) - (format #t "~1Tctrl: #~%" (-> obj ctrl)) - (format #t "~1Tshadow: #~%" (-> obj shadow)) - (format #t "~1Tstack[16] @ #x~X~%" (-> obj stack)) + (format #t "[~8x] ~A~%" this 'generic-merc-work) + (format #t "~1Tinput-a: #~%" (-> this input-a)) + (format #t "~1Tinput-b: #~%" (-> this input-b)) + (format #t "~1Tctrl: #~%" (-> this ctrl)) + (format #t "~1Tshadow: #~%" (-> this shadow)) + (format #t "~1Tstack[16] @ #x~X~%" (-> this stack)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-death_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-death_REF.gc index 5453ab30c3..5fb07ea98f 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-death_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-death_REF.gc @@ -18,19 +18,19 @@ ) ;; definition for method 3 of type death-info -(defmethod inspect death-info ((obj death-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect death-info ((this death-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tvertex-skip: ~D~%" (-> obj vertex-skip)) - (format #t "~1Ttimer: ~D~%" (-> obj timer)) - (format #t "~1Toverlap: ~D~%" (-> obj overlap)) - (format #t "~1Teffect: ~D~%" (-> obj effect)) - (format #t "~1Tsound: ~A~%" (-> obj sound)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tvertex-skip: ~D~%" (-> this vertex-skip)) + (format #t "~1Ttimer: ~D~%" (-> this timer)) + (format #t "~1Toverlap: ~D~%" (-> this overlap)) + (format #t "~1Teffect: ~D~%" (-> this effect)) + (format #t "~1Tsound: ~A~%" (-> this sound)) (label cfg-4) - obj + this ) ;; definition for function birth-func-death-sparks diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-h_REF.gc index 312cfbcc34..29d9935f95 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc-h_REF.gc @@ -15,21 +15,21 @@ ) ;; definition for method 3 of type ripple-merc-query -(defmethod inspect ripple-merc-query ((obj ripple-merc-query)) - (when (not obj) - (set! obj obj) +(defmethod inspect ripple-merc-query ((this ripple-merc-query)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tstart-vertex: ~D~%" (-> obj start-vertex)) - (format #t "~1Tvertex-skip: ~D~%" (-> obj vertex-skip)) - (format #t "~1Tvertex-count: ~D~%" (-> obj vertex-count)) - (format #t "~1Tcurrent-loc: ~D~%" (-> obj current-loc)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tstart-vertex: ~D~%" (-> this start-vertex)) + (format #t "~1Tvertex-skip: ~D~%" (-> this vertex-skip)) + (format #t "~1Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~1Tcurrent-loc: ~D~%" (-> this current-loc)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -58,28 +58,28 @@ ) ;; definition for method 3 of type merc-byte-header -(defmethod inspect merc-byte-header ((obj merc-byte-header)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-byte-header ((this merc-byte-header)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-byte-header) - (format #t "~1Tsrcdest-off: ~D~%" (-> obj srcdest-off)) - (format #t "~1Trgba-off: ~D~%" (-> obj rgba-off)) - (format #t "~1Tlump-off: ~D~%" (-> obj lump-off)) - (format #t "~1Tfp-off: ~D~%" (-> obj fp-off)) - (format #t "~1Tmat1-cnt: ~D~%" (-> obj mat1-cnt)) - (format #t "~1Tmat2-cnt: ~D~%" (-> obj mat2-cnt)) - (format #t "~1Tmat3-cnt: ~D~%" (-> obj mat3-cnt)) - (format #t "~1Tsamecopy-cnt: ~D~%" (-> obj samecopy-cnt)) - (format #t "~1Tcrosscopy-cnt: ~D~%" (-> obj crosscopy-cnt)) - (format #t "~1Tstrip-len: ~D~%" (-> obj strip-len)) - (format #t "~1Tmm-quadword-fp-off: ~D~%" (-> obj mm-quadword-fp-off)) - (format #t "~1Tmm-quadword-size: ~D~%" (-> obj mm-quadword-size)) - (format #t "~1Tperc-off: ~D~%" (-> obj perc-off)) - (format #t "~1Tmat-slot[10] @ #x~X~%" (-> obj mat-slot)) + (format #t "[~8x] ~A~%" this 'merc-byte-header) + (format #t "~1Tsrcdest-off: ~D~%" (-> this srcdest-off)) + (format #t "~1Trgba-off: ~D~%" (-> this rgba-off)) + (format #t "~1Tlump-off: ~D~%" (-> this lump-off)) + (format #t "~1Tfp-off: ~D~%" (-> this fp-off)) + (format #t "~1Tmat1-cnt: ~D~%" (-> this mat1-cnt)) + (format #t "~1Tmat2-cnt: ~D~%" (-> this mat2-cnt)) + (format #t "~1Tmat3-cnt: ~D~%" (-> this mat3-cnt)) + (format #t "~1Tsamecopy-cnt: ~D~%" (-> this samecopy-cnt)) + (format #t "~1Tcrosscopy-cnt: ~D~%" (-> this crosscopy-cnt)) + (format #t "~1Tstrip-len: ~D~%" (-> this strip-len)) + (format #t "~1Tmm-quadword-fp-off: ~D~%" (-> this mm-quadword-fp-off)) + (format #t "~1Tmm-quadword-size: ~D~%" (-> this mm-quadword-size)) + (format #t "~1Tperc-off: ~D~%" (-> this perc-off)) + (format #t "~1Tmat-slot[10] @ #x~X~%" (-> this mat-slot)) (label cfg-4) - obj + this ) ;; definition of type merc-fragment @@ -96,16 +96,16 @@ ) ;; definition for method 3 of type merc-fragment -(defmethod inspect merc-fragment ((obj merc-fragment)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-fragment ((this merc-fragment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-fragment) - (format #t "~1Theader: #~%" (-> obj header)) - (format #t "~1Trest[1] @ #x~X~%" (-> obj rest)) + (format #t "[~8x] ~A~%" this 'merc-fragment) + (format #t "~1Theader: #~%" (-> this header)) + (format #t "~1Trest[1] @ #x~X~%" (-> this rest)) (label cfg-4) - obj + this ) ;; definition of type merc-vtx @@ -129,26 +129,26 @@ ) ;; definition for method 3 of type merc-vtx -(defmethod inspect merc-vtx ((obj merc-vtx)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-vtx ((this merc-vtx)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-vtx) - (format #t "~1Tmat-0: ~D~%" (-> obj mat-0)) - (format #t "~1Tmat-1: ~D~%" (-> obj mat-1)) - (format #t "~1Tnrm-x: ~D~%" (-> obj nrm-x)) - (format #t "~1Tpos-x: ~D~%" (-> obj pos-x)) - (format #t "~1Tdst-0: ~D~%" (-> obj dst-0)) - (format #t "~1Tdst-1: ~D~%" (-> obj dst-1)) - (format #t "~1Tnrm-y: ~D~%" (-> obj nrm-y)) - (format #t "~1Tpos-y: ~D~%" (-> obj pos-y)) - (format #t "~1Ttex-s: ~D~%" (-> obj tex-s)) - (format #t "~1Ttex-t: ~D~%" (-> obj tex-t)) - (format #t "~1Tnrm-z: ~D~%" (-> obj nrm-z)) - (format #t "~1Tpos-z: ~D~%" (-> obj pos-z)) + (format #t "[~8x] ~A~%" this 'merc-vtx) + (format #t "~1Tmat-0: ~D~%" (-> this mat-0)) + (format #t "~1Tmat-1: ~D~%" (-> this mat-1)) + (format #t "~1Tnrm-x: ~D~%" (-> this nrm-x)) + (format #t "~1Tpos-x: ~D~%" (-> this pos-x)) + (format #t "~1Tdst-0: ~D~%" (-> this dst-0)) + (format #t "~1Tdst-1: ~D~%" (-> this dst-1)) + (format #t "~1Tnrm-y: ~D~%" (-> this nrm-y)) + (format #t "~1Tpos-y: ~D~%" (-> this pos-y)) + (format #t "~1Ttex-s: ~D~%" (-> this tex-s)) + (format #t "~1Ttex-t: ~D~%" (-> this tex-t)) + (format #t "~1Tnrm-z: ~D~%" (-> this nrm-z)) + (format #t "~1Tpos-z: ~D~%" (-> this pos-z)) (label cfg-4) - obj + this ) ;; definition of type merc-fp-header @@ -167,21 +167,21 @@ ) ;; definition for method 3 of type merc-fp-header -(defmethod inspect merc-fp-header ((obj merc-fp-header)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-fp-header ((this merc-fp-header)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-fp-header) - (format #t "~1Tx-add: ~f~%" (-> obj x-add)) - (format #t "~1Ty-add: ~f~%" (-> obj y-add)) - (format #t "~1Tz-add: ~f~%" (-> obj z-add)) - (format #t "~1Tshader-cnt: ~D~%" (-> obj shader-cnt)) - (format #t "~1Tkick-info-offset: ~D~%" (-> obj kick-info-offset)) - (format #t "~1Tkick-info-step: ~D~%" (-> obj kick-info-step)) - (format #t "~1Thword-cnt: ~D~%" (-> obj hword-cnt)) + (format #t "[~8x] ~A~%" this 'merc-fp-header) + (format #t "~1Tx-add: ~f~%" (-> this x-add)) + (format #t "~1Ty-add: ~f~%" (-> this y-add)) + (format #t "~1Tz-add: ~f~%" (-> this z-add)) + (format #t "~1Tshader-cnt: ~D~%" (-> this shader-cnt)) + (format #t "~1Tkick-info-offset: ~D~%" (-> this kick-info-offset)) + (format #t "~1Tkick-info-step: ~D~%" (-> this kick-info-step)) + (format #t "~1Thword-cnt: ~D~%" (-> this hword-cnt)) (label cfg-4) - obj + this ) ;; definition for function merc-fragment-fp-data @@ -202,16 +202,16 @@ ) ;; definition for method 3 of type merc-mat-dest -(defmethod inspect merc-mat-dest ((obj merc-mat-dest)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-mat-dest ((this merc-mat-dest)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-mat-dest) - (format #t "~1Tmatrix-number: ~D~%" (-> obj matrix-number)) - (format #t "~1Tmatrix-dest: ~D~%" (-> obj matrix-dest)) + (format #t "[~8x] ~A~%" this 'merc-mat-dest) + (format #t "~1Tmatrix-number: ~D~%" (-> this matrix-number)) + (format #t "~1Tmatrix-dest: ~D~%" (-> this matrix-dest)) (label cfg-4) - obj + this ) ;; definition of type merc-fragment-control @@ -228,19 +228,19 @@ ) ;; definition for method 3 of type merc-fragment-control -(defmethod inspect merc-fragment-control ((obj merc-fragment-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-fragment-control ((this merc-fragment-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-fragment-control) - (format #t "~1Tunsigned-four-count: ~D~%" (-> obj unsigned-four-count)) - (format #t "~1Tlump-four-count: ~D~%" (-> obj lump-four-count)) - (format #t "~1Tfp-qwc: ~D~%" (-> obj fp-qwc)) - (format #t "~1Tmat-xfer-count: ~D~%" (-> obj mat-xfer-count)) - (format #t "~1Tmat-dest-data[0] @ #x~X~%" (-> obj mat-dest-data)) + (format #t "[~8x] ~A~%" this 'merc-fragment-control) + (format #t "~1Tunsigned-four-count: ~D~%" (-> this unsigned-four-count)) + (format #t "~1Tlump-four-count: ~D~%" (-> this lump-four-count)) + (format #t "~1Tfp-qwc: ~D~%" (-> this fp-qwc)) + (format #t "~1Tmat-xfer-count: ~D~%" (-> this mat-xfer-count)) + (format #t "~1Tmat-dest-data[0] @ #x~X~%" (-> this mat-dest-data)) (label cfg-4) - obj + this ) ;; definition of type merc-blend-data @@ -253,15 +253,15 @@ ) ;; definition for method 3 of type merc-blend-data -(defmethod inspect merc-blend-data ((obj merc-blend-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-blend-data ((this merc-blend-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-blend-data) - (format #t "~1Tint8-data[0] @ #x~X~%" (-> obj int8-data)) + (format #t "[~8x] ~A~%" this 'merc-blend-data) + (format #t "~1Tint8-data[0] @ #x~X~%" (-> this int8-data)) (label cfg-4) - obj + this ) ;; definition of type merc-blend-ctrl @@ -276,17 +276,17 @@ ) ;; definition for method 3 of type merc-blend-ctrl -(defmethod inspect merc-blend-ctrl ((obj merc-blend-ctrl)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-blend-ctrl ((this merc-blend-ctrl)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-blend-ctrl) - (format #t "~1Tblend-vtx-count: ~D~%" (-> obj blend-vtx-count)) - (format #t "~1Tnonzero-index-count: ~D~%" (-> obj nonzero-index-count)) - (format #t "~1Tbt-index[0] @ #x~X~%" (-> obj bt-index)) + (format #t "[~8x] ~A~%" this 'merc-blend-ctrl) + (format #t "~1Tblend-vtx-count: ~D~%" (-> this blend-vtx-count)) + (format #t "~1Tnonzero-index-count: ~D~%" (-> this nonzero-index-count)) + (format #t "~1Tbt-index[0] @ #x~X~%" (-> this bt-index)) (label cfg-4) - obj + this ) ;; definition of type mei-envmap-tint @@ -302,18 +302,18 @@ ) ;; definition for method 3 of type mei-envmap-tint -(defmethod inspect mei-envmap-tint ((obj mei-envmap-tint)) - (when (not obj) - (set! obj obj) +(defmethod inspect mei-envmap-tint ((this mei-envmap-tint)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mei-envmap-tint) - (format #t "~1Tfade0: ~f~%" (-> obj fade0)) - (format #t "~1Tfade1: ~f~%" (-> obj fade1)) - (format #t "~1Ttint: ~D~%" (-> obj tint)) - (format #t "~1Tdummy: ~D~%" (-> obj dummy)) + (format #t "[~8x] ~A~%" this 'mei-envmap-tint) + (format #t "~1Tfade0: ~f~%" (-> this fade0)) + (format #t "~1Tfade1: ~f~%" (-> this fade1)) + (format #t "~1Ttint: ~D~%" (-> this tint)) + (format #t "~1Tdummy: ~D~%" (-> this dummy)) (label cfg-4) - obj + this ) ;; definition of type mei-texture-scroll @@ -332,21 +332,21 @@ ) ;; definition for method 3 of type mei-texture-scroll -(defmethod inspect mei-texture-scroll ((obj mei-texture-scroll)) - (when (not obj) - (set! obj obj) +(defmethod inspect mei-texture-scroll ((this mei-texture-scroll)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mei-texture-scroll) - (format #t "~1Tmax-dist: ~f~%" (-> obj max-dist)) - (format #t "~1Tst-int-scale: ~D~%" (-> obj st-int-scale)) - (format #t "~1Ttime-factor: ~D~%" (-> obj time-factor)) - (format #t "~1Tscroll-dir: ~D~%" (-> obj scroll-dir)) - (format #t "~1Tcached-time: ~D~%" (-> obj cached-time)) - (format #t "~1Ttime-delta: ~D~%" (-> obj time-delta)) - (format #t "~1Tdummy[7] @ #x~X~%" (-> obj dummy)) + (format #t "[~8x] ~A~%" this 'mei-texture-scroll) + (format #t "~1Tmax-dist: ~f~%" (-> this max-dist)) + (format #t "~1Tst-int-scale: ~D~%" (-> this st-int-scale)) + (format #t "~1Ttime-factor: ~D~%" (-> this time-factor)) + (format #t "~1Tscroll-dir: ~D~%" (-> this scroll-dir)) + (format #t "~1Tcached-time: ~D~%" (-> this cached-time)) + (format #t "~1Ttime-delta: ~D~%" (-> this time-delta)) + (format #t "~1Tdummy[7] @ #x~X~%" (-> this dummy)) (label cfg-4) - obj + this ) ;; definition of type mei-ripple @@ -362,18 +362,18 @@ ) ;; definition for method 3 of type mei-ripple -(defmethod inspect mei-ripple ((obj mei-ripple)) - (when (not obj) - (set! obj obj) +(defmethod inspect mei-ripple ((this mei-ripple)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mei-ripple) - (format #t "~1Tx-base: ~f~%" (-> obj x-base)) - (format #t "~1Tz-base: ~f~%" (-> obj z-base)) - (format #t "~1Tgrid-size: ~f~%" (-> obj grid-size)) - (format #t "~1Tangle: ~f~%" (-> obj angle)) + (format #t "[~8x] ~A~%" this 'mei-ripple) + (format #t "~1Tx-base: ~f~%" (-> this x-base)) + (format #t "~1Tz-base: ~f~%" (-> this z-base)) + (format #t "~1Tgrid-size: ~f~%" (-> this grid-size)) + (format #t "~1Tangle: ~f~%" (-> this angle)) (label cfg-4) - obj + this ) ;; definition of type merc-extra-info @@ -390,19 +390,19 @@ ) ;; definition for method 3 of type merc-extra-info -(defmethod inspect merc-extra-info ((obj merc-extra-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-extra-info ((this merc-extra-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-extra-info) - (format #t "~1Tenvmap-tint-offset: ~D~%" (-> obj envmap-tint-offset)) - (format #t "~1Tshader-offset: ~D~%" (-> obj shader-offset)) - (format #t "~1Ttexture-scroll-offset: ~D~%" (-> obj texture-scroll-offset)) - (format #t "~1Tripple-offset: ~D~%" (-> obj ripple-offset)) - (format #t "~1Tdummy[12] @ #x~X~%" (-> obj dummy)) + (format #t "[~8x] ~A~%" this 'merc-extra-info) + (format #t "~1Tenvmap-tint-offset: ~D~%" (-> this envmap-tint-offset)) + (format #t "~1Tshader-offset: ~D~%" (-> this shader-offset)) + (format #t "~1Ttexture-scroll-offset: ~D~%" (-> this texture-scroll-offset)) + (format #t "~1Tripple-offset: ~D~%" (-> this ripple-offset)) + (format #t "~1Tdummy[12] @ #x~X~%" (-> this dummy)) (label cfg-4) - obj + this ) ;; definition of type merc-effect @@ -430,27 +430,27 @@ ) ;; definition for method 3 of type merc-effect -(defmethod inspect merc-effect ((obj merc-effect)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-effect ((this merc-effect)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-effect) - (format #t "~1Tfrag-geo: #~%" (-> obj frag-geo)) - (format #t "~1Tfrag-ctrl: #~%" (-> obj frag-ctrl)) - (format #t "~1Tblend-data: #~%" (-> obj blend-data)) - (format #t "~1Tblend-ctrl: #~%" (-> obj blend-ctrl)) - (format #t "~1Tmerc-effect-version: ~D~%" (-> obj merc-effect-version)) - (format #t "~1Teffect-bits: ~D~%" (-> obj effect-bits)) - (format #t "~1Tfrag-count: ~D~%" (-> obj frag-count)) - (format #t "~1Tblend-frag-count: ~D~%" (-> obj blend-frag-count)) - (format #t "~1Ttri-count: ~D~%" (-> obj tri-count)) - (format #t "~1Tdvert-count: ~D~%" (-> obj dvert-count)) - (format #t "~1Ttexture-index: ~D~%" (-> obj texture-index)) - (format #t "~1Teffect-usage: ~D~%" (-> obj effect-usage)) - (format #t "~1Textra-info: #~%" (-> obj extra-info)) + (format #t "[~8x] ~A~%" this 'merc-effect) + (format #t "~1Tfrag-geo: #~%" (-> this frag-geo)) + (format #t "~1Tfrag-ctrl: #~%" (-> this frag-ctrl)) + (format #t "~1Tblend-data: #~%" (-> this blend-data)) + (format #t "~1Tblend-ctrl: #~%" (-> this blend-ctrl)) + (format #t "~1Tmerc-effect-version: ~D~%" (-> this merc-effect-version)) + (format #t "~1Teffect-bits: ~D~%" (-> this effect-bits)) + (format #t "~1Tfrag-count: ~D~%" (-> this frag-count)) + (format #t "~1Tblend-frag-count: ~D~%" (-> this blend-frag-count)) + (format #t "~1Ttri-count: ~D~%" (-> this tri-count)) + (format #t "~1Tdvert-count: ~D~%" (-> this dvert-count)) + (format #t "~1Ttexture-index: ~D~%" (-> this texture-index)) + (format #t "~1Teffect-usage: ~D~%" (-> this effect-usage)) + (format #t "~1Textra-info: #~%" (-> this extra-info)) (label cfg-4) - obj + this ) ;; definition of type merc-eye-ctrl @@ -472,24 +472,24 @@ ) ;; definition for method 3 of type merc-eye-ctrl -(defmethod inspect merc-eye-ctrl ((obj merc-eye-ctrl)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-eye-ctrl ((this merc-eye-ctrl)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-eye-ctrl) - (format #t "~1Teye-slot: ~D~%" (-> obj eye-slot)) - (format #t "~1Tshader-offset: ~D~%" (-> obj shader-offset)) - (format #t "~1Tshader-count: ~D~%" (-> obj shader-count)) - (format #t "~1Tshader[6] @ #x~X~%" (-> obj left-iris-shader)) - (format #t "~1Tleft-iris-shader: #~%" (-> obj left-iris-shader)) - (format #t "~1Tleft-pupil-shader: #~%" (-> obj left-pupil-shader)) - (format #t "~1Tleft-lid-shader: #~%" (-> obj left-lid-shader)) - (format #t "~1Tright-iris-shader: #~%" (-> obj right-iris-shader)) - (format #t "~1Tright-pupil-shader: #~%" (-> obj right-pupil-shader)) - (format #t "~1Tright-lid-shader: #~%" (-> obj right-lid-shader)) + (format #t "[~8x] ~A~%" this 'merc-eye-ctrl) + (format #t "~1Teye-slot: ~D~%" (-> this eye-slot)) + (format #t "~1Tshader-offset: ~D~%" (-> this shader-offset)) + (format #t "~1Tshader-count: ~D~%" (-> this shader-count)) + (format #t "~1Tshader[6] @ #x~X~%" (-> this left-iris-shader)) + (format #t "~1Tleft-iris-shader: #~%" (-> this left-iris-shader)) + (format #t "~1Tleft-pupil-shader: #~%" (-> this left-pupil-shader)) + (format #t "~1Tleft-lid-shader: #~%" (-> this left-lid-shader)) + (format #t "~1Tright-iris-shader: #~%" (-> this right-iris-shader)) + (format #t "~1Tright-pupil-shader: #~%" (-> this right-pupil-shader)) + (format #t "~1Tright-lid-shader: #~%" (-> this right-lid-shader)) (label cfg-4) - obj + this ) ;; definition of type merc-eye-anim-frame @@ -509,21 +509,21 @@ ) ;; definition for method 3 of type merc-eye-anim-frame -(defmethod inspect merc-eye-anim-frame ((obj merc-eye-anim-frame)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-eye-anim-frame ((this merc-eye-anim-frame)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-eye-anim-frame) - (format #t "~1Tpupil-trans-x: ~D~%" (-> obj pupil-trans-x)) - (format #t "~1Tpupil-trans-y: ~D~%" (-> obj pupil-trans-y)) - (format #t "~1Tblink: ~D~%" (-> obj blink)) - (format #t "~1Tiris-scale: ~D~%" (-> obj iris-scale)) - (format #t "~1Tpupil-scale: ~D~%" (-> obj pupil-scale)) - (format #t "~1Tlid-scale: ~D~%" (-> obj lid-scale)) - (format #t "~1Tdword: ~D~%" (-> obj dword)) + (format #t "[~8x] ~A~%" this 'merc-eye-anim-frame) + (format #t "~1Tpupil-trans-x: ~D~%" (-> this pupil-trans-x)) + (format #t "~1Tpupil-trans-y: ~D~%" (-> this pupil-trans-y)) + (format #t "~1Tblink: ~D~%" (-> this blink)) + (format #t "~1Tiris-scale: ~D~%" (-> this iris-scale)) + (format #t "~1Tpupil-scale: ~D~%" (-> this pupil-scale)) + (format #t "~1Tlid-scale: ~D~%" (-> this lid-scale)) + (format #t "~1Tdword: ~D~%" (-> this dword)) (label cfg-4) - obj + this ) ;; definition of type merc-eye-anim-block @@ -537,16 +537,16 @@ ) ;; definition for method 3 of type merc-eye-anim-block -(defmethod inspect merc-eye-anim-block ((obj merc-eye-anim-block)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-eye-anim-block ((this merc-eye-anim-block)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-eye-anim-block) - (format #t "~1Tmax-frame: ~D~%" (-> obj max-frame)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'merc-eye-anim-block) + (format #t "~1Tmax-frame: ~D~%" (-> this max-frame)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type texture-usage-group @@ -559,15 +559,15 @@ ) ;; definition for method 3 of type texture-usage-group -(defmethod inspect texture-usage-group ((obj texture-usage-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-usage-group ((this texture-usage-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-usage-group) - (format #t "~1Tdata[7] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'texture-usage-group) + (format #t "~1Tdata[7] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type merc-ctrl-header @@ -626,61 +626,61 @@ ) ;; definition for method 3 of type merc-ctrl-header -(defmethod inspect merc-ctrl-header ((obj merc-ctrl-header)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-ctrl-header ((this merc-ctrl-header)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-ctrl-header) - (format #t "~1Txyz-scale: #x~X~%" (-> obj xyz-scale)) - (format #t "~1Tst-magic: #x~X~%" (-> obj st-magic)) - (format #t "~1Tst-out-a: #x~X~%" (-> obj st-out-a)) - (format #t "~1Tst-out-b: #x~X~%" (-> obj st-out-b)) - (format #t "~1Tst-vif-add: #x~X~%" (-> obj st-vif-add)) - (format #t "~1Tst-int-off: ~D~%" (-> obj st-int-off)) - (format #t "~1Tst-int-scale: ~D~%" (-> obj st-int-scale)) - (format #t "~1Teffect-count: ~D~%" (-> obj effect-count)) - (format #t "~1Tblend-target-count: ~D~%" (-> obj blend-target-count)) - (format #t "~1Tfragment-count: ~D~%" (-> obj fragment-count)) - (format #t "~1Ttri-count: ~D~%" (-> obj tri-count)) - (format #t "~1Tmatrix-count: ~D~%" (-> obj matrix-count)) - (format #t "~1Tshader-count: ~D~%" (-> obj shader-count)) - (format #t "~1Ttransform-vertex-count: ~D~%" (-> obj transform-vertex-count)) - (format #t "~1Tdvert-count: ~D~%" (-> obj dvert-count)) - (format #t "~1Tone-mat-count: ~D~%" (-> obj one-mat-count)) - (format #t "~1Ttwo-mat-count: ~D~%" (-> obj two-mat-count)) - (format #t "~1Ttwo-mat-reuse-count: ~D~%" (-> obj two-mat-reuse-count)) - (format #t "~1Tthree-mat-count: ~D~%" (-> obj three-mat-count)) - (format #t "~1Tthree-mat-reuse-count: ~D~%" (-> obj three-mat-reuse-count)) - (format #t "~1Tshader-upload-count: ~D~%" (-> obj shader-upload-count)) - (format #t "~1Tmatrix-upload-count: ~D~%" (-> obj matrix-upload-count)) - (format #t "~1Tsame-copy-count: ~D~%" (-> obj same-copy-count)) - (format #t "~1Tcross-copy-count: ~D~%" (-> obj cross-copy-count)) - (format #t "~1Tnum-verts: ~D~%" (-> obj num-verts)) - (format #t "~1Tlongest-edge: ~f~%" (-> obj longest-edge)) - (format #t "~1Teye-ctrl: #~%" (-> obj eye-ctrl)) - (format #t "~1Tpad[3] @ #x~X~%" (-> obj pad)) - (format #t "~1Tmasks-padding: #~%" (-> obj masks-padding)) - (format #t "~1Ttexture-usage-group: #~%" (-> obj texture-usage-group)) - (format #t "~1Tdummy-bytes[0] @ #x~X~%" (&-> obj fragment-count)) - (format #t "~1Tenvmap-tint: ~D~%" (-> obj envmap-tint)) - (format #t "~1Tquery: ~A~%" (-> obj query)) - (format #t "~1Tneeds-clip: ~D~%" (-> obj needs-clip)) - (format #t "~1Tuse-isometric: ~D~%" (-> obj use-isometric)) - (format #t "~1Tuse-attached-shader: ~D~%" (-> obj use-attached-shader)) - (format #t "~1Tdisplay-triangles: ~D~%" (-> obj display-triangles)) - (format #t "~1Tdeath-vertex-skip: ~D~%" (-> obj two-mat-count)) - (format #t "~1Tdeath-start-vertex: ~D~%" (-> obj two-mat-reuse-count)) - (format #t "~1Tdeath-effect: ~D~%" (-> obj death-effect)) - (format #t "~1Tuse-translucent: ~D~%" (-> obj shader-upload-count)) - (format #t "~1Tdisplay-this-fragment: ~D~%" (-> obj matrix-upload-count)) - (format #t "~1Tuse-warp: ~D~%" (-> obj use-warp)) - (format #t "~1Tignore-alpha: ~D~%" (-> obj ignore-alpha)) - (format #t "~1Tforce-fade: ~D~%" (-> obj force-fade)) - (format #t "~1Tdisable-fog: ~D~%" (-> obj disable-fog)) - (format #t "~1Tdisable-envmap: ~D~%" (-> obj disable-envmap)) + (format #t "[~8x] ~A~%" this 'merc-ctrl-header) + (format #t "~1Txyz-scale: #x~X~%" (-> this xyz-scale)) + (format #t "~1Tst-magic: #x~X~%" (-> this st-magic)) + (format #t "~1Tst-out-a: #x~X~%" (-> this st-out-a)) + (format #t "~1Tst-out-b: #x~X~%" (-> this st-out-b)) + (format #t "~1Tst-vif-add: #x~X~%" (-> this st-vif-add)) + (format #t "~1Tst-int-off: ~D~%" (-> this st-int-off)) + (format #t "~1Tst-int-scale: ~D~%" (-> this st-int-scale)) + (format #t "~1Teffect-count: ~D~%" (-> this effect-count)) + (format #t "~1Tblend-target-count: ~D~%" (-> this blend-target-count)) + (format #t "~1Tfragment-count: ~D~%" (-> this fragment-count)) + (format #t "~1Ttri-count: ~D~%" (-> this tri-count)) + (format #t "~1Tmatrix-count: ~D~%" (-> this matrix-count)) + (format #t "~1Tshader-count: ~D~%" (-> this shader-count)) + (format #t "~1Ttransform-vertex-count: ~D~%" (-> this transform-vertex-count)) + (format #t "~1Tdvert-count: ~D~%" (-> this dvert-count)) + (format #t "~1Tone-mat-count: ~D~%" (-> this one-mat-count)) + (format #t "~1Ttwo-mat-count: ~D~%" (-> this two-mat-count)) + (format #t "~1Ttwo-mat-reuse-count: ~D~%" (-> this two-mat-reuse-count)) + (format #t "~1Tthree-mat-count: ~D~%" (-> this three-mat-count)) + (format #t "~1Tthree-mat-reuse-count: ~D~%" (-> this three-mat-reuse-count)) + (format #t "~1Tshader-upload-count: ~D~%" (-> this shader-upload-count)) + (format #t "~1Tmatrix-upload-count: ~D~%" (-> this matrix-upload-count)) + (format #t "~1Tsame-copy-count: ~D~%" (-> this same-copy-count)) + (format #t "~1Tcross-copy-count: ~D~%" (-> this cross-copy-count)) + (format #t "~1Tnum-verts: ~D~%" (-> this num-verts)) + (format #t "~1Tlongest-edge: ~f~%" (-> this longest-edge)) + (format #t "~1Teye-ctrl: #~%" (-> this eye-ctrl)) + (format #t "~1Tpad[3] @ #x~X~%" (-> this pad)) + (format #t "~1Tmasks-padding: #~%" (-> this masks-padding)) + (format #t "~1Ttexture-usage-group: #~%" (-> this texture-usage-group)) + (format #t "~1Tdummy-bytes[0] @ #x~X~%" (&-> this fragment-count)) + (format #t "~1Tenvmap-tint: ~D~%" (-> this envmap-tint)) + (format #t "~1Tquery: ~A~%" (-> this query)) + (format #t "~1Tneeds-clip: ~D~%" (-> this needs-clip)) + (format #t "~1Tuse-isometric: ~D~%" (-> this use-isometric)) + (format #t "~1Tuse-attached-shader: ~D~%" (-> this use-attached-shader)) + (format #t "~1Tdisplay-triangles: ~D~%" (-> this display-triangles)) + (format #t "~1Tdeath-vertex-skip: ~D~%" (-> this two-mat-count)) + (format #t "~1Tdeath-start-vertex: ~D~%" (-> this two-mat-reuse-count)) + (format #t "~1Tdeath-effect: ~D~%" (-> this death-effect)) + (format #t "~1Tuse-translucent: ~D~%" (-> this shader-upload-count)) + (format #t "~1Tdisplay-this-fragment: ~D~%" (-> this matrix-upload-count)) + (format #t "~1Tuse-warp: ~D~%" (-> this use-warp)) + (format #t "~1Tignore-alpha: ~D~%" (-> this ignore-alpha)) + (format #t "~1Tforce-fade: ~D~%" (-> this force-fade)) + (format #t "~1Tdisable-fog: ~D~%" (-> this disable-fog)) + (format #t "~1Tdisable-envmap: ~D~%" (-> this disable-envmap)) (label cfg-4) - obj + this ) ;; definition of type merc-ctrl @@ -696,21 +696,21 @@ ) ;; definition for method 3 of type merc-ctrl -(defmethod inspect merc-ctrl ((obj merc-ctrl)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-ctrl ((this merc-ctrl)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Textra: ~A~%" (-> obj extra)) - (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~1Tseg-table: ~A~%" (-> obj seg-table)) - (format #t "~1Theader: #~%" (-> obj header)) - (format #t "~1Teffect[0] @ #x~X~%" (-> obj effect)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Tseg-table: ~A~%" (-> this seg-table)) + (format #t "~1Theader: #~%" (-> this header)) + (format #t "~1Teffect[0] @ #x~X~%" (-> this effect)) (label cfg-4) - obj + this ) ;; definition of type merc-vu1-low-mem @@ -727,19 +727,19 @@ ) ;; definition for method 3 of type merc-vu1-low-mem -(defmethod inspect merc-vu1-low-mem ((obj merc-vu1-low-mem)) - (when (not obj) - (set! obj obj) +(defmethod inspect merc-vu1-low-mem ((this merc-vu1-low-mem)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'merc-vu1-low-mem) - (format #t "~1Ttri-strip-gif: #~%" (-> obj tri-strip-gif)) - (format #t "~1Tad-gif: #~%" (-> obj ad-gif)) - (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~1Tperspective[4] @ #x~X~%" (-> obj perspective)) - (format #t "~1Tfog: #~%" (-> obj fog)) + (format #t "[~8x] ~A~%" this 'merc-vu1-low-mem) + (format #t "~1Ttri-strip-gif: #~%" (-> this tri-strip-gif)) + (format #t "~1Tad-gif: #~%" (-> this ad-gif)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Tperspective[4] @ #x~X~%" (-> this perspective)) + (format #t "~1Tfog: #~%" (-> this fog)) (label cfg-4) - obj + this ) ;; definition of type emerc-vu1-low-mem @@ -757,20 +757,20 @@ ) ;; definition for method 3 of type emerc-vu1-low-mem -(defmethod inspect emerc-vu1-low-mem ((obj emerc-vu1-low-mem)) - (when (not obj) - (set! obj obj) +(defmethod inspect emerc-vu1-low-mem ((this emerc-vu1-low-mem)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'emerc-vu1-low-mem) - (format #t "~1Ttri-strip-gif: #~%" (-> obj tri-strip-gif)) - (format #t "~1Tad-gif: #~%" (-> obj ad-gif)) - (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~1Tperspective[4] @ #x~X~%" (-> obj perspective)) - (format #t "~1Tfog: #~%" (-> obj fog)) - (format #t "~1Tunperspect: #~%" (-> obj unperspect)) + (format #t "[~8x] ~A~%" this 'emerc-vu1-low-mem) + (format #t "~1Ttri-strip-gif: #~%" (-> this tri-strip-gif)) + (format #t "~1Tad-gif: #~%" (-> this ad-gif)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Tperspective[4] @ #x~X~%" (-> this perspective)) + (format #t "~1Tfog: #~%" (-> this fog)) + (format #t "~1Tunperspect: #~%" (-> this unperspect)) (label cfg-4) - obj + this ) ;; definition of type ripple-wave @@ -791,22 +791,22 @@ ) ;; definition for method 3 of type ripple-wave -(defmethod inspect ripple-wave ((obj ripple-wave)) - (when (not obj) - (set! obj obj) +(defmethod inspect ripple-wave ((this ripple-wave)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ripple-wave) - (format #t "~1Tscale: ~f~%" (-> obj scale)) - (format #t "~1Toffs: ~f~%" (-> obj offs)) - (format #t "~1Txdiv: ~D~%" (-> obj xdiv)) - (format #t "~1Tzdiv: ~D~%" (-> obj zdiv)) - (format #t "~1Tspeed: ~f~%" (-> obj speed)) - (format #t "~1Txmul: ~f~%" (-> obj xmul)) - (format #t "~1Tzmul: ~f~%" (-> obj zmul)) - (format #t "~1Tdelta: ~f~%" (-> obj delta)) + (format #t "[~8x] ~A~%" this 'ripple-wave) + (format #t "~1Tscale: ~f~%" (-> this scale)) + (format #t "~1Toffs: ~f~%" (-> this offs)) + (format #t "~1Txdiv: ~D~%" (-> this xdiv)) + (format #t "~1Tzdiv: ~D~%" (-> this zdiv)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Txmul: ~f~%" (-> this xmul)) + (format #t "~1Tzmul: ~f~%" (-> this zmul)) + (format #t "~1Tdelta: ~f~%" (-> this delta)) (label cfg-4) - obj + this ) ;; definition of type ripple-wave-set @@ -823,19 +823,19 @@ ) ;; definition for method 3 of type ripple-wave-set -(defmethod inspect ripple-wave-set ((obj ripple-wave-set)) - (when (not obj) - (set! obj obj) +(defmethod inspect ripple-wave-set ((this ripple-wave-set)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tconverted: ~A~%" (-> obj converted)) - (format #t "~1Tnormal-scale: ~f~%" (-> obj normal-scale)) - (format #t "~1Twave[4] @ #x~X~%" (-> obj wave)) - (format #t "~1Tframe-save: ~D~%" (-> obj frame-save)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tconverted: ~A~%" (-> this converted)) + (format #t "~1Tnormal-scale: ~f~%" (-> this normal-scale)) + (format #t "~1Twave[4] @ #x~X~%" (-> this wave)) + (format #t "~1Tframe-save: ~D~%" (-> this frame-save)) (label cfg-4) - obj + this ) ;; definition of type ripple-control @@ -859,23 +859,23 @@ ) ;; definition for method 3 of type ripple-control -(defmethod inspect ripple-control ((obj ripple-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect ripple-control ((this ripple-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tglobal-scale: ~f~%" (-> obj global-scale)) - (format #t "~1Tlast-frame-scale: ~f~%" (-> obj last-frame-scale)) - (format #t "~1Tclose-fade-dist: ~f~%" (-> obj close-fade-dist)) - (format #t "~1Tfar-fade-dist: ~f~%" (-> obj far-fade-dist)) - (format #t "~1Tfaded-scale: ~f~%" (-> obj faded-scale)) - (format #t "~1Tindividual-normal-scale: ~f~%" (-> obj individual-normal-scale)) - (format #t "~1Twaveform: ~A~%" (-> obj waveform)) - (format #t "~1Tsend-query: ~A~%" (-> obj send-query)) - (format #t "~1Tquery: ~A~%" (-> obj query)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tglobal-scale: ~f~%" (-> this global-scale)) + (format #t "~1Tlast-frame-scale: ~f~%" (-> this last-frame-scale)) + (format #t "~1Tclose-fade-dist: ~f~%" (-> this close-fade-dist)) + (format #t "~1Tfar-fade-dist: ~f~%" (-> this far-fade-dist)) + (format #t "~1Tfaded-scale: ~f~%" (-> this faded-scale)) + (format #t "~1Tindividual-normal-scale: ~f~%" (-> this individual-normal-scale)) + (format #t "~1Twaveform: ~A~%" (-> this waveform)) + (format #t "~1Tsend-query: ~A~%" (-> this send-query)) + (format #t "~1Tquery: ~A~%" (-> this query)) (label cfg-4) - obj + this ) ;; definition for method 0 of type ripple-control diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc_REF.gc index 71bf02117b..b9fb5a9b44 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/merc/merc_REF.gc @@ -15,32 +15,32 @@ ) ;; definition for method 3 of type texture-login-data -(defmethod inspect texture-login-data ((obj texture-login-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-login-data ((this texture-login-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-login-data) - (format #t "~1Tdefault-texture-index: ~D~%" (-> obj default-texture-index)) - (format #t "~1Tcurrent-texture-index: ~D~%" (-> obj current-texture-index)) - (format #t "~1Ttexture-usage-group: #~%" (-> obj texture-usage-group)) - (format #t "~1Tmerc-ctrl-header: #~%" (-> obj merc-ctrl-header)) - (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "[~8x] ~A~%" this 'texture-login-data) + (format #t "~1Tdefault-texture-index: ~D~%" (-> this default-texture-index)) + (format #t "~1Tcurrent-texture-index: ~D~%" (-> this current-texture-index)) + (format #t "~1Ttexture-usage-group: #~%" (-> this texture-usage-group)) + (format #t "~1Tmerc-ctrl-header: #~%" (-> this merc-ctrl-header)) + (format #t "~1Tname: ~A~%" (-> this name)) (label cfg-4) - obj + this ) ;; definition for symbol *texture-login-data*, type texture-login-data (define *texture-login-data* (new 'global 'texture-login-data)) ;; definition for method 9 of type art-joint-geo -(defmethod login art-joint-geo ((obj art-joint-geo)) +(defmethod login art-joint-geo ((this art-joint-geo)) (let ((s5-0 *texture-login-data*)) (set! (-> s5-0 default-texture-index) - (res-lump-value (-> obj extra) 'texture-bucket int :default (the-as uint128 1) :time -1000000000.0) + (res-lump-value (-> this extra) 'texture-bucket int :default (the-as uint128 1) :time -1000000000.0) ) ) - obj + this ) ;; definition for function texture-usage-init @@ -99,13 +99,13 @@ ;; definition for method 5 of type merc-fragment ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of merc-fragment ((obj merc-fragment)) - (the-as int (* (-> obj header mm-quadword-size) 16)) +(defmethod asize-of merc-fragment ((this merc-fragment)) + (the-as int (* (-> this header mm-quadword-size) 16)) ) ;; definition for method 9 of type merc-fragment -(defmethod login-adgifs merc-fragment ((obj merc-fragment)) - (let* ((s5-0 (merc-fragment-fp-data obj)) +(defmethod login-adgifs merc-fragment ((this merc-fragment)) + (let* ((s5-0 (merc-fragment-fp-data this)) (v1-1 (-> *texture-login-data* merc-ctrl-header)) (s4-0 (if (nonzero? (-> v1-1 eye-ctrl)) (-> v1-1 eye-ctrl) @@ -203,46 +203,45 @@ (&+! s3-0 80) ) ) - obj + this ) ;; definition for method 5 of type merc-fragment-control ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of merc-fragment-control ((obj merc-fragment-control)) - (the-as int (+ (* (-> obj mat-xfer-count) 2) 4)) +(defmethod asize-of merc-fragment-control ((this merc-fragment-control)) + (the-as int (+ (* (-> this mat-xfer-count) 2) 4)) ) ;; definition for method 3 of type merc-fragment-control -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect merc-fragment-control ((obj merc-fragment-control)) - (format #t "[~8x] ~A~%" obj 'merc-fragment-control) - (format #t "~Tunsigned-four-count: ~D~%" (-> obj unsigned-four-count)) - (format #t "~Tlump-four-count: ~D~%" (-> obj lump-four-count)) - (format #t "~Tfp-qwc: ~D~%" (-> obj fp-qwc)) - (format #t "~Tmat-xfer-count: ~D~%" (-> obj mat-xfer-count)) - (dotimes (s5-0 (the-as int (-> obj mat-xfer-count))) +(defmethod inspect merc-fragment-control ((this merc-fragment-control)) + (format #t "[~8x] ~A~%" this 'merc-fragment-control) + (format #t "~Tunsigned-four-count: ~D~%" (-> this unsigned-four-count)) + (format #t "~Tlump-four-count: ~D~%" (-> this lump-four-count)) + (format #t "~Tfp-qwc: ~D~%" (-> this fp-qwc)) + (format #t "~Tmat-xfer-count: ~D~%" (-> this mat-xfer-count)) + (dotimes (s5-0 (the-as int (-> this mat-xfer-count))) (format #t "~Tmat-dest-data[~d]:~%" s5-0) - (format #t "~T~Tmatrix-number: ~D~%" (-> obj mat-dest-data s5-0 matrix-number)) - (format #t "~T~Tmatrix-dest: ~D~%" (-> obj mat-dest-data s5-0 matrix-dest)) + (format #t "~T~Tmatrix-number: ~D~%" (-> this mat-dest-data s5-0 matrix-number)) + (format #t "~T~Tmatrix-dest: ~D~%" (-> this mat-dest-data s5-0 matrix-dest)) ) - obj + this ) ;; definition for method 9 of type merc-effect ;; WARN: Return type mismatch merc-effect vs none. -(defmethod login-adgifs merc-effect ((obj merc-effect)) +(defmethod login-adgifs merc-effect ((this merc-effect)) (let* ((data *texture-login-data*) (a0-1 (-> data default-texture-index)) ) - (when (= (-> obj merc-effect-version) 1) - (if (!= (-> obj texture-index) 255) - (set! a0-1 (the-as int (-> obj texture-index))) + (when (= (-> this merc-effect-version) 1) + (if (!= (-> this texture-index) 255) + (set! a0-1 (the-as int (-> this texture-index))) ) ) (set! (-> data current-texture-index) a0-1) - (set! (-> obj texture-index) (the-as uint a0-1)) + (set! (-> this texture-index) (the-as uint a0-1)) ) - (let ((tex (-> obj extra-info))) + (let ((tex (-> this extra-info))) (when (nonzero? tex) (when (nonzero? (-> tex shader-offset)) (let ((a0-6 (adgif-shader-login (the-as adgif-shader (+ (the-as uint tex) (* (-> tex shader-offset) 16)))))) @@ -253,10 +252,10 @@ ) ) ) - (let ((ctrl (-> obj frag-ctrl)) - (geo (-> obj frag-geo)) + (let ((ctrl (-> this frag-ctrl)) + (geo (-> this frag-geo)) ) - (dotimes (frag-idx (the-as int (-> obj frag-count))) + (dotimes (frag-idx (the-as int (-> this frag-count))) (let ((ctrl-size (asize-of ctrl))) (let ((geo-size (asize-of geo))) (login-adgifs geo) @@ -270,30 +269,29 @@ ) ;; definition for method 3 of type merc-ctrl -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect merc-ctrl ((obj merc-ctrl)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~Textra: ~A~%" (-> obj extra)) - (format #t "~Tseg-table: ~A~%" (-> obj seg-table)) - (inspect (-> obj header)) - (dotimes (s5-0 (the-as int (-> obj header effect-count))) - (inspect (-> obj effect s5-0)) +(defmethod inspect merc-ctrl ((this merc-ctrl)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~Textra: ~A~%" (-> this extra)) + (format #t "~Tseg-table: ~A~%" (-> this seg-table)) + (inspect (-> this header)) + (dotimes (s5-0 (the-as int (-> this header effect-count))) + (inspect (-> this effect s5-0)) ) - obj + this ) ;; definition for method 8 of type merc-ctrl -(defmethod mem-usage merc-ctrl ((obj merc-ctrl) (arg0 memory-usage-block) (arg1 int)) - (if (-> obj extra) - (mem-usage (-> obj extra) arg0 arg1) +(defmethod mem-usage merc-ctrl ((this merc-ctrl) (arg0 memory-usage-block) (arg1 int)) + (if (-> this extra) + (mem-usage (-> this extra) arg0 arg1) ) - (let ((s4-0 (+ 32 128 (* (-> obj header effect-count) 32)))) - (dotimes (s3-0 (the-as int (-> obj header effect-count))) - (let ((s2-0 (the-as object (-> obj effect s3-0 frag-ctrl)))) - (dotimes (s1-0 (the-as int (-> obj effect s3-0 frag-count))) + (let ((s4-0 (+ 32 128 (* (-> this header effect-count) 32)))) + (dotimes (s3-0 (the-as int (-> this header effect-count))) + (let ((s2-0 (the-as object (-> this effect s3-0 frag-ctrl)))) + (dotimes (s1-0 (the-as int (-> this effect s3-0 frag-count))) (set! s4-0 (+ s4-0 (* (shr (+ (-> (the-as merc-fragment-control s2-0) unsigned-four-count) 3) 2) 16) (* (shr (+ (-> (the-as merc-fragment-control s2-0) lump-four-count) 3) 2) 16) @@ -312,10 +310,10 @@ (+! (-> arg0 data 78 total) (logand -16 (+ s4-0 15))) ) (let ((v1-35 0)) - (dotimes (a0-15 (the-as int (-> obj header effect-count))) - (when (nonzero? (-> obj effect a0-15 blend-frag-count)) - (let ((a1-9 (the-as object (-> obj effect a0-15 blend-ctrl)))) - (dotimes (a2-1 (the-as int (-> obj effect a0-15 blend-frag-count))) + (dotimes (a0-15 (the-as int (-> this header effect-count))) + (when (nonzero? (-> this effect a0-15 blend-frag-count)) + (let ((a1-9 (the-as object (-> this effect a0-15 blend-ctrl)))) + (dotimes (a2-1 (the-as int (-> this effect a0-15 blend-frag-count))) (let ((v1-36 (+ v1-35 (* (+ (-> (the-as merc-blend-ctrl a1-9) nonzero-index-count) 1) @@ -324,9 +322,9 @@ ) ) ) - (set! v1-35 (the-as int (+ (-> obj header blend-target-count) 2 v1-36))) + (set! v1-35 (the-as int (+ (-> this header blend-target-count) 2 v1-36))) ) - (set! a1-9 (&+ (the-as pointer a1-9) (+ (-> obj header blend-target-count) 2))) + (set! a1-9 (&+ (the-as pointer a1-9) (+ (-> this header blend-target-count) 2))) ) ) ) @@ -339,8 +337,8 @@ (+! (-> arg0 data 80 total) (logand -16 (+ v1-35 15))) ) ) - (when (and (-> obj header eye-ctrl) (nonzero? (-> obj header eye-ctrl))) - (let ((a0-29 (-> obj header eye-ctrl))) + (when (and (-> this header eye-ctrl) (nonzero? (-> this header eye-ctrl))) + (let ((a0-29 (-> this header eye-ctrl))) (set! (-> arg0 length) (max 112 (-> arg0 length))) (set! (-> arg0 data 111 name) "eye-anim") (+! (-> arg0 data 111 count) 1) @@ -350,18 +348,18 @@ ) ) ) - obj + this ) ;; definition for method 9 of type merc-ctrl -(defmethod login merc-ctrl ((obj merc-ctrl)) - (set! (-> *kernel-context* login-object) obj) - (texture-usage-init obj) - (dotimes (s5-0 (the-as int (-> obj header effect-count))) - (login-adgifs (-> obj effect s5-0)) +(defmethod login merc-ctrl ((this merc-ctrl)) + (set! (-> *kernel-context* login-object) this) + (texture-usage-init this) + (dotimes (s5-0 (the-as int (-> this header effect-count))) + (login-adgifs (-> this effect s5-0)) ) - (when (and (-> obj header eye-ctrl) (nonzero? (-> obj header eye-ctrl))) - (let ((s5-1 (-> obj header eye-ctrl))) + (when (and (-> this header eye-ctrl) (nonzero? (-> this header eye-ctrl))) + (let ((s5-1 (-> this header eye-ctrl))) (dotimes (s4-0 (-> s5-1 shader-count)) (let ((a0-5 (adgif-shader-login (-> s5-1 shader s4-0)))) (if a0-5 @@ -372,7 +370,7 @@ ) ) (set! (-> *kernel-context* login-object) #f) - obj + this ) ;; definition (debug) for function merc-stats-display @@ -584,7 +582,6 @@ ) ;; definition for function merc-vu1-init-buffer -;; ERROR: Failed store: (s.w! (+ a0-4 8) 0) at op 28 (defun merc-vu1-init-buffer ((dma-bucket bucket-id) (arg1 int) (arg2 symbol)) (let ((bucket (-> *display* frames (-> *display* on-screen) bucket-group dma-bucket))) (when (!= bucket (-> bucket last)) diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc index 25d9f11da8..e90579867a 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/ripple_REF.gc @@ -13,16 +13,16 @@ ) ;; definition for method 3 of type ripple-request -(defmethod inspect ripple-request ((obj ripple-request)) - (when (not obj) - (set! obj obj) +(defmethod inspect ripple-request ((this ripple-request)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ripple-request) - (format #t "~1Twaveform: ~A~%" (-> obj waveform)) - (format #t "~1Teffect: #~%" (-> obj effect)) + (format #t "[~8x] ~A~%" this 'ripple-request) + (format #t "~1Twaveform: ~A~%" (-> this waveform)) + (format #t "~1Teffect: #~%" (-> this effect)) (label cfg-4) - obj + this ) ;; definition of type ripple-globals @@ -36,16 +36,16 @@ ) ;; definition for method 3 of type ripple-globals -(defmethod inspect ripple-globals ((obj ripple-globals)) - (when (not obj) - (set! obj obj) +(defmethod inspect ripple-globals ((this ripple-globals)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ripple-globals) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Trequests[16] @ #x~X~%" (-> obj requests)) + (format #t "[~8x] ~A~%" this 'ripple-globals) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Trequests[16] @ #x~X~%" (-> this requests)) (label cfg-4) - obj + this ) ;; definition for symbol *ripple-globals*, type ripple-globals @@ -245,7 +245,3 @@ Once completed, all `requests` have been processed and the `count` is reset to ` ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-cpu_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-cpu_REF.gc index 30d7fe3502..b5b8374c05 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-cpu_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-cpu_REF.gc @@ -3,20 +3,20 @@ ;; definition for method 5 of type shadow-geo ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of shadow-geo ((obj shadow-geo)) - (the-as int (* (-> obj total-qwc) 16)) +(defmethod asize-of shadow-geo ((this shadow-geo)) + (the-as int (* (-> this total-qwc) 16)) ) ;; definition for method 8 of type shadow-geo -(defmethod mem-usage shadow-geo ((obj shadow-geo) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage shadow-geo ((this shadow-geo) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 111 (-> arg0 length))) (set! (-> arg0 data 110 name) "shadow-geo") (+! (-> arg0 data 110 count) 1) - (let ((v1-6 (* (-> obj total-qwc) 16))) + (let ((v1-6 (* (-> this total-qwc) 16))) (+! (-> arg0 data 110 used) v1-6) (+! (-> arg0 data 110 total) (logand -16 (+ v1-6 15))) ) - obj + this ) ;; definition for symbol *shadow-data*, type shadow-data @@ -507,20 +507,20 @@ ) ;; definition for method 3 of type shadow-stats -(defmethod inspect shadow-stats ((obj shadow-stats)) - (when (not obj) - (set! obj obj) +(defmethod inspect shadow-stats ((this shadow-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'shadow-stats) - (format #t "~1Tnum-single-tris: ~D~%" (-> obj num-single-tris)) - (format #t "~1Tnum-double-tris: ~D~%" (-> obj num-double-tris)) - (format #t "~1Tnum-single-edges: ~D~%" (-> obj num-single-edges)) - (format #t "~1Tnum-double-edges: ~D~%" (-> obj num-double-edges)) - (format #t "~1Tnum-fragments: ~D~%" (-> obj num-fragments)) - (format #t "~1Tnum-objects: ~D~%" (-> obj num-objects)) + (format #t "[~8x] ~A~%" this 'shadow-stats) + (format #t "~1Tnum-single-tris: ~D~%" (-> this num-single-tris)) + (format #t "~1Tnum-double-tris: ~D~%" (-> this num-double-tris)) + (format #t "~1Tnum-single-edges: ~D~%" (-> this num-single-edges)) + (format #t "~1Tnum-double-edges: ~D~%" (-> this num-double-edges)) + (format #t "~1Tnum-fragments: ~D~%" (-> this num-fragments)) + (format #t "~1Tnum-objects: ~D~%" (-> this num-objects)) (label cfg-4) - obj + this ) ;; definition of type shadow-dcache @@ -553,35 +553,35 @@ ) ;; definition for method 3 of type shadow-dcache -(defmethod inspect shadow-dcache ((obj shadow-dcache)) - (when (not obj) - (set! obj obj) +(defmethod inspect shadow-dcache ((this shadow-dcache)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'shadow-dcache) - (format #t "~1Tvtx-table: #x~X~%" (-> obj vtx-table)) - (format #t "~1Tsingle-edge-table: #x~X~%" (-> obj single-edge-table)) - (format #t "~1Tdouble-edge-table: #x~X~%" (-> obj double-edge-table)) - (format #t "~1Tdouble-tri-table: #x~X~%" (-> obj double-tri-table)) - (format #t "~1Tdcache-top: #x~X~%" (-> obj dcache-top)) - (format #t "~1Tnum-facing-single-tris: ~D~%" (-> obj num-facing-single-tris)) - (format #t "~1Tnum-single-edges: ~D~%" (-> obj num-single-edges)) - (format #t "~1Tnum-double-edges: ~D~%" (-> obj num-double-edges)) - (format #t "~1Tsingle-tri-list: #x~X~%" (-> obj single-tri-list)) - (format #t "~1Tsingle-edge-list: #x~X~%" (-> obj single-edge-list)) - (format #t "~1Tdouble-edge-list: #x~X~%" (-> obj double-edge-list)) - (format #t "~1Tptr-dual-verts: #x~X~%" (-> obj ptr-dual-verts)) - (format #t "~1Tstats: #~%" (-> obj stats)) - (format #t "~1Tfrag-qwc: ~D~%" (-> obj frag-qwc)) - (format #t "~1Tcenter: #~%" (-> obj center)) - (format #t "~1Tplane: #~%" (-> obj plane)) - (format #t "~1Ttop-plane: #~%" (-> obj top-plane)) - (format #t "~1Tnear-plane: #~%" (-> obj near-plane)) - (format #t "~1Tlight-dir: #~%" (-> obj light-dir)) - (format #t "~1Tvtx-min: #~%" (-> obj vtx-min)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'shadow-dcache) + (format #t "~1Tvtx-table: #x~X~%" (-> this vtx-table)) + (format #t "~1Tsingle-edge-table: #x~X~%" (-> this single-edge-table)) + (format #t "~1Tdouble-edge-table: #x~X~%" (-> this double-edge-table)) + (format #t "~1Tdouble-tri-table: #x~X~%" (-> this double-tri-table)) + (format #t "~1Tdcache-top: #x~X~%" (-> this dcache-top)) + (format #t "~1Tnum-facing-single-tris: ~D~%" (-> this num-facing-single-tris)) + (format #t "~1Tnum-single-edges: ~D~%" (-> this num-single-edges)) + (format #t "~1Tnum-double-edges: ~D~%" (-> this num-double-edges)) + (format #t "~1Tsingle-tri-list: #x~X~%" (-> this single-tri-list)) + (format #t "~1Tsingle-edge-list: #x~X~%" (-> this single-edge-list)) + (format #t "~1Tdouble-edge-list: #x~X~%" (-> this double-edge-list)) + (format #t "~1Tptr-dual-verts: #x~X~%" (-> this ptr-dual-verts)) + (format #t "~1Tstats: #~%" (-> this stats)) + (format #t "~1Tfrag-qwc: ~D~%" (-> this frag-qwc)) + (format #t "~1Tcenter: #~%" (-> this center)) + (format #t "~1Tplane: #~%" (-> this plane)) + (format #t "~1Ttop-plane: #~%" (-> this top-plane)) + (format #t "~1Tnear-plane: #~%" (-> this near-plane)) + (format #t "~1Tlight-dir: #~%" (-> this light-dir)) + (format #t "~1Tvtx-min: #~%" (-> this vtx-min)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for symbol shadow-vu0-block, type vu-function @@ -649,8 +649,8 @@ ;; definition for method 14 of type shadow-control ;; WARN: Return type mismatch int vs none. -(defmethod shadow-control-method-14 shadow-control ((obj shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float)) - (let ((gp-0 (-> obj settings))) +(defmethod shadow-control-method-14 shadow-control ((this shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float)) + (let ((gp-0 (-> this settings))) (let ((s4-0 (-> gp-0 shadow-dir))) (vector-normalize-copy! s4-0 arg1 1.0) (set! (-> gp-0 shadow-dir w) (- arg2)) @@ -880,7 +880,7 @@ ;; definition for method 13 of type shadow-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod shadow-control-method-13 shadow-control ((obj shadow-control) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod shadow-control-method-13 shadow-control ((this shadow-control) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (with-pp (let ((s4-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 pp)) @@ -898,19 +898,19 @@ ) (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* s4-0) 0.0) - (let ((v1-5 obj)) + (let ((v1-5 this)) (logclear! (-> v1-5 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((v1-7 obj)) + (let ((v1-7 this)) (set! (-> v1-7 settings bot-plane w) (- (+ (-> s4-0 best-other-tri intersect y) arg1))) ) 0 - (set! (-> obj settings top-plane w) (- (+ (-> s4-0 best-other-tri intersect y) arg2))) + (set! (-> this settings top-plane w) (- (+ (-> s4-0 best-other-tri intersect y) arg2))) 0 ) (else - (let ((v1-10 obj)) + (let ((v1-10 this)) (logior! (-> v1-10 settings flags) (shadow-flags disable-draw)) ) 0 diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-vu1_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-vu1_REF.gc index 389e21ca60..00e3f535ae 100644 --- a/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-vu1_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/shadow-vu1_REF.gc @@ -22,26 +22,26 @@ ) ;; definition for method 3 of type shadow-vu1-constants -(defmethod inspect shadow-vu1-constants ((obj shadow-vu1-constants)) - (when (not obj) - (set! obj obj) +(defmethod inspect shadow-vu1-constants ((this shadow-vu1-constants)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'shadow-vu1-constants) - (format #t "~1Thmgescale: #~%" (-> obj hmgescale)) - (format #t "~1Tinvhscale: #~%" (-> obj invhscale)) - (format #t "~1Ttexoffset: #~%" (-> obj texoffset)) - (format #t "~1Ttexscale: #~%" (-> obj texscale)) - (format #t "~1Thvdfoff: #~%" (-> obj hvdfoff)) - (format #t "~1Tfog: #~%" (-> obj fog)) - (format #t "~1Tclrs[2] @ #x~X~%" (-> obj clrs)) - (format #t "~1Tadgif: #~%" (-> obj adgif)) - (format #t "~1Ttexflush: #~%" (-> obj texflush)) - (format #t "~1Tflush: #~%" (-> obj flush)) - (format #t "~1Ttrigif: #~%" (-> obj trigif)) - (format #t "~1Tquadgif: #~%" (-> obj quadgif)) + (format #t "[~8x] ~A~%" this 'shadow-vu1-constants) + (format #t "~1Thmgescale: #~%" (-> this hmgescale)) + (format #t "~1Tinvhscale: #~%" (-> this invhscale)) + (format #t "~1Ttexoffset: #~%" (-> this texoffset)) + (format #t "~1Ttexscale: #~%" (-> this texscale)) + (format #t "~1Thvdfoff: #~%" (-> this hvdfoff)) + (format #t "~1Tfog: #~%" (-> this fog)) + (format #t "~1Tclrs[2] @ #x~X~%" (-> this clrs)) + (format #t "~1Tadgif: #~%" (-> this adgif)) + (format #t "~1Ttexflush: #~%" (-> this texflush)) + (format #t "~1Tflush: #~%" (-> this flush)) + (format #t "~1Ttrigif: #~%" (-> this trigif)) + (format #t "~1Tquadgif: #~%" (-> this quadgif)) (label cfg-4) - obj + this ) ;; definition of type shadow-vu1-data @@ -61,22 +61,22 @@ ) ;; definition for method 3 of type shadow-vu1-data -(defmethod inspect shadow-vu1-data ((obj shadow-vu1-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect shadow-vu1-data ((this shadow-vu1-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'shadow-vu1-data) - (format #t "~1Tadgif: #~%" (-> obj adgif)) - (format #t "~1Tad: #~%" (-> obj ad)) - (format #t "~1Tflush: #~%" (-> obj flush)) - (format #t "~1Ttrigif: #~%" (-> obj trigif)) - (format #t "~1Tquadgif: #~%" (-> obj quadgif)) - (format #t "~1Ttexoffset: #~%" (-> obj texoffset)) - (format #t "~1Ttexscale: #~%" (-> obj texscale)) - (format #t "~1Tclrs[2] @ #x~X~%" (-> obj clrs)) + (format #t "[~8x] ~A~%" this 'shadow-vu1-data) + (format #t "~1Tadgif: #~%" (-> this adgif)) + (format #t "~1Tad: #~%" (-> this ad)) + (format #t "~1Tflush: #~%" (-> this flush)) + (format #t "~1Ttrigif: #~%" (-> this trigif)) + (format #t "~1Tquadgif: #~%" (-> this quadgif)) + (format #t "~1Ttexoffset: #~%" (-> this texoffset)) + (format #t "~1Ttexscale: #~%" (-> this texscale)) + (format #t "~1Tclrs[2] @ #x~X~%" (-> this clrs)) (label cfg-4) - obj + this ) ;; definition for symbol *shadow-vu1-data*, type shadow-vu1-data @@ -277,7 +277,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc index d1211e8bd5..25808f75f6 100644 --- a/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc @@ -22,25 +22,25 @@ ) ;; definition for method 3 of type gsf-vertex -(defmethod inspect gsf-vertex ((obj gsf-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect gsf-vertex ((this gsf-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gsf-vertex) - (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) - (format #t "~1Tbyte[32] @ #x~X~%" (-> obj data)) - (format #t "~1Tquad[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tvt: #~%" (-> obj data)) - (format #t "~1Tpos: #~%" (-> obj data)) - (format #t "~1Ttex: #~%" (&-> obj vt vector4w w)) - (format #t "~1Tnrm: #~%" (-> obj nrm)) - (format #t "~1Tnc: #~%" (-> obj nrm)) - (format #t "~1Tclr: #~%" (&-> obj nc vector4w w)) - (format #t "~1Tdtex: #~%" (-> obj nrm)) - (format #t "~1Tdclr: #~%" (&-> obj nrm y)) + (format #t "[~8x] ~A~%" this 'gsf-vertex) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~1Tbyte[32] @ #x~X~%" (-> this data)) + (format #t "~1Tquad[2] @ #x~X~%" (-> this data)) + (format #t "~1Tvt: #~%" (-> this data)) + (format #t "~1Tpos: #~%" (-> this data)) + (format #t "~1Ttex: #~%" (&-> this vt vector4w w)) + (format #t "~1Tnrm: #~%" (-> this nrm)) + (format #t "~1Tnc: #~%" (-> this nrm)) + (format #t "~1Tclr: #~%" (&-> this nc vector4w w)) + (format #t "~1Tdtex: #~%" (-> this nrm)) + (format #t "~1Tdclr: #~%" (&-> this nrm y)) (label cfg-4) - obj + this ) ;; definition of type gsf-vertex-array @@ -53,15 +53,15 @@ ) ;; definition for method 3 of type gsf-vertex-array -(defmethod inspect gsf-vertex-array ((obj gsf-vertex-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect gsf-vertex-array ((this gsf-vertex-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gsf-vertex-array) - (format #t "~1Tvtx[0] @ #x~X~%" (-> obj vtx)) + (format #t "[~8x] ~A~%" this 'gsf-vertex-array) + (format #t "~1Tvtx[0] @ #x~X~%" (-> this vtx)) (label cfg-4) - obj + this ) ;; definition of type gsf-fx-vertex @@ -75,16 +75,16 @@ ) ;; definition for method 3 of type gsf-fx-vertex -(defmethod inspect gsf-fx-vertex ((obj gsf-fx-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect gsf-fx-vertex ((this gsf-fx-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gsf-fx-vertex) - (format #t "~1Tclr: #~%" (-> obj clr)) - (format #t "~1Ttex: #~%" (-> obj tex)) + (format #t "[~8x] ~A~%" this 'gsf-fx-vertex) + (format #t "~1Tclr: #~%" (-> this clr)) + (format #t "~1Ttex: #~%" (-> this tex)) (label cfg-4) - obj + this ) ;; definition of type gsf-fx-vertex-array @@ -97,15 +97,15 @@ ) ;; definition for method 3 of type gsf-fx-vertex-array -(defmethod inspect gsf-fx-vertex-array ((obj gsf-fx-vertex-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect gsf-fx-vertex-array ((this gsf-fx-vertex-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gsf-fx-vertex-array) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'gsf-fx-vertex-array) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type gsf-header @@ -122,19 +122,19 @@ ) ;; definition for method 3 of type gsf-header -(defmethod inspect gsf-header ((obj gsf-header)) - (when (not obj) - (set! obj obj) +(defmethod inspect gsf-header ((this gsf-header)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gsf-header) - (format #t "~1Tnum-strips: ~D~%" (-> obj num-strips)) - (format #t "~1Tnum-new-vtxs: ~D~%" (-> obj num-new-vtxs)) - (format #t "~1Tnum-dps: ~D~%" (-> obj num-dps)) - (format #t "~1Tnum-vtxs: ~D~%" (-> obj num-vtxs)) - (format #t "~1Tstrip-table[10] @ #x~X~%" (-> obj strip-table)) + (format #t "[~8x] ~A~%" this 'gsf-header) + (format #t "~1Tnum-strips: ~D~%" (-> this num-strips)) + (format #t "~1Tnum-new-vtxs: ~D~%" (-> this num-new-vtxs)) + (format #t "~1Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~1Tnum-vtxs: ~D~%" (-> this num-vtxs)) + (format #t "~1Tstrip-table[10] @ #x~X~%" (-> this strip-table)) (label cfg-4) - obj + this ) ;; definition of type gsf-ik @@ -148,16 +148,16 @@ ) ;; definition for method 3 of type gsf-ik -(defmethod inspect gsf-ik ((obj gsf-ik)) - (when (not obj) - (set! obj obj) +(defmethod inspect gsf-ik ((this gsf-ik)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gsf-ik) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tno-kick: ~D~%" (-> obj no-kick)) + (format #t "[~8x] ~A~%" this 'gsf-ik) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tno-kick: ~D~%" (-> this no-kick)) (label cfg-4) - obj + this ) ;; definition of type gsf-info @@ -173,18 +173,18 @@ ) ;; definition for method 3 of type gsf-info -(defmethod inspect gsf-info ((obj gsf-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect gsf-info ((this gsf-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gsf-info) - (format #t "~1Tptr-iks: #x~X~%" (-> obj ptr-iks)) - (format #t "~1Tptr-verts: #x~X~%" (-> obj ptr-verts)) - (format #t "~1Tptr-fx: #x~X~%" (-> obj ptr-fx)) - (format #t "~1Tdummy2: ~D~%" (-> obj dummy2)) + (format #t "[~8x] ~A~%" this 'gsf-info) + (format #t "~1Tptr-iks: #x~X~%" (-> this ptr-iks)) + (format #t "~1Tptr-verts: #x~X~%" (-> this ptr-verts)) + (format #t "~1Tptr-fx: #x~X~%" (-> this ptr-fx)) + (format #t "~1Tdummy2: ~D~%" (-> this dummy2)) (label cfg-4) - obj + this ) ;; definition of type gsf-buffer @@ -200,18 +200,18 @@ ) ;; definition for method 3 of type gsf-buffer -(defmethod inspect gsf-buffer ((obj gsf-buffer)) - (when (not obj) - (set! obj obj) +(defmethod inspect gsf-buffer ((this gsf-buffer)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gsf-buffer) - (format #t "~1Tdata[8192] @ #x~X~%" (-> obj data)) - (format #t "~1Tinfo: #~%" (-> obj data)) - (format #t "~1Theader: #~%" (-> obj header)) - (format #t "~1Twork-area[0] @ #x~X~%" (-> obj work-area)) + (format #t "[~8x] ~A~%" this 'gsf-buffer) + (format #t "~1Tdata[8192] @ #x~X~%" (-> this data)) + (format #t "~1Tinfo: #~%" (-> this data)) + (format #t "~1Theader: #~%" (-> this header)) + (format #t "~1Twork-area[0] @ #x~X~%" (-> this work-area)) (label cfg-4) - obj + this ) ;; definition of type generic-frag @@ -225,16 +225,16 @@ ) ;; definition for method 3 of type generic-frag -(defmethod inspect generic-frag ((obj generic-frag)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-frag ((this generic-frag)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-frag) - (format #t "~1Tstart-pos: ~D~%" (-> obj start-pos)) - (format #t "~1Tend-pos: ~D~%" (-> obj end-pos)) + (format #t "[~8x] ~A~%" this 'generic-frag) + (format #t "~1Tstart-pos: ~D~%" (-> this start-pos)) + (format #t "~1Tend-pos: ~D~%" (-> this end-pos)) (label cfg-4) - obj + this ) ;; definition of type generic-strip @@ -248,16 +248,16 @@ ) ;; definition for method 3 of type generic-strip -(defmethod inspect generic-strip ((obj generic-strip)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-strip ((this generic-strip)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-strip) - (format #t "~1Tpos: ~D~%" (-> obj pos)) - (format #t "~1Tlen: ~D~%" (-> obj len)) + (format #t "[~8x] ~A~%" this 'generic-strip) + (format #t "~1Tpos: ~D~%" (-> this pos)) + (format #t "~1Tlen: ~D~%" (-> this len)) (label cfg-4) - obj + this ) ;; definition of type generic-envmap-saves @@ -272,17 +272,17 @@ ) ;; definition for method 3 of type generic-envmap-saves -(defmethod inspect generic-envmap-saves ((obj generic-envmap-saves)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-envmap-saves ((this generic-envmap-saves)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-envmap-saves) - (format #t "~1Tindex-mask: #~%" (-> obj index-mask)) - (format #t "~1Tverts[12] @ #x~X~%" (-> obj verts)) - (format #t "~1Tkicks[4] @ #x~X~%" (-> obj kicks)) + (format #t "[~8x] ~A~%" this 'generic-envmap-saves) + (format #t "~1Tindex-mask: #~%" (-> this index-mask)) + (format #t "~1Tverts[12] @ #x~X~%" (-> this verts)) + (format #t "~1Tkicks[4] @ #x~X~%" (-> this kicks)) (label cfg-4) - obj + this ) ;; definition of type generic-interp-job @@ -302,21 +302,21 @@ ) ;; definition for method 3 of type generic-interp-job -(defmethod inspect generic-interp-job ((obj generic-interp-job)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-interp-job ((this generic-interp-job)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-interp-job) - (format #t "~1Tjob-type: ~D~%" (-> obj job-type)) - (format #t "~1Tnum: ~D~%" (-> obj num)) - (format #t "~1Tfirst: ~D~%" (-> obj first)) - (format #t "~1Tpad: ~D~%" (-> obj pad)) - (format #t "~1Tptr-data: #x~X~%" (-> obj ptr-data)) - (format #t "~1Tmorph-z: ~D~%" (-> obj morph-z)) - (format #t "~1Tmorph-w: ~D~%" (-> obj morph-w)) + (format #t "[~8x] ~A~%" this 'generic-interp-job) + (format #t "~1Tjob-type: ~D~%" (-> this job-type)) + (format #t "~1Tnum: ~D~%" (-> this num)) + (format #t "~1Tfirst: ~D~%" (-> this first)) + (format #t "~1Tpad: ~D~%" (-> this pad)) + (format #t "~1Tptr-data: #x~X~%" (-> this ptr-data)) + (format #t "~1Tmorph-z: ~D~%" (-> this morph-z)) + (format #t "~1Tmorph-w: ~D~%" (-> this morph-w)) (label cfg-4) - obj + this ) ;; definition of type generic-saves @@ -354,40 +354,40 @@ ) ;; definition for method 3 of type generic-saves -(defmethod inspect generic-saves ((obj generic-saves)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-saves ((this generic-saves)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-saves) - (format #t "~1Tptr-dma: #x~X~%" (-> obj ptr-dma)) - (format #t "~1Tptr-vtxs: #x~X~%" (-> obj ptr-vtxs)) - (format #t "~1Tptr-clrs: #x~X~%" (-> obj ptr-clrs)) - (format #t "~1Tptr-texs: #x~X~%" (-> obj ptr-texs)) - (format #t "~1Tptr-env-clrs: #x~X~%" (-> obj ptr-env-clrs)) - (format #t "~1Tptr-env-texs: #x~X~%" (-> obj ptr-env-texs)) - (format #t "~1Tcur-outbuf: #x~X~%" (-> obj cur-outbuf)) - (format #t "~1Tptr-fx-buf: ~D~%" (-> obj ptr-fx-buf)) - (format #t "~1Txor-outbufs: ~D~%" (-> obj xor-outbufs)) - (format #t "~1Tnum-dps: ~D~%" (-> obj num-dps)) - (format #t "~1Tqwc: ~D~%" (-> obj qwc)) - (format #t "~1Tgsf-buf: #~%" (-> obj gsf-buf)) - (format #t "~1Tptr-shaders: #x~X~%" (-> obj ptr-shaders)) - (format #t "~1Tptr-env-shader: ~D~%" (-> obj ptr-env-shader)) - (format #t "~1Tis-envmap: ~D~%" (-> obj is-envmap)) - (format #t "~1Tis-translucent: ~D~%" (-> obj is-translucent)) - (format #t "~1Tbasep: #x~X~%" (-> obj basep)) - (format #t "~1Tptr-interp-job: #~%" (-> obj ptr-interp-job)) - (format #t "~1Tgifbuf-adr: ~D~%" (-> obj gifbuf-adr)) - (format #t "~1Tinbuf-adr: ~D~%" (-> obj inbuf-adr)) - (format #t "~1Tfade-val: ~D~%" (-> obj fade-val)) - (format #t "~1Ttime-of-day-color: ~D~%" (-> obj time-of-day-color)) - (format #t "~1Tto-vu0-waits: ~D~%" (-> obj to-vu0-waits)) - (format #t "~1Tto-spr-waits: ~D~%" (-> obj to-spr-waits)) - (format #t "~1Tfrom-spr-waits: ~D~%" (-> obj from-spr-waits)) - (format #t "~1Tenvmap: #~%" (-> obj envmap)) + (format #t "[~8x] ~A~%" this 'generic-saves) + (format #t "~1Tptr-dma: #x~X~%" (-> this ptr-dma)) + (format #t "~1Tptr-vtxs: #x~X~%" (-> this ptr-vtxs)) + (format #t "~1Tptr-clrs: #x~X~%" (-> this ptr-clrs)) + (format #t "~1Tptr-texs: #x~X~%" (-> this ptr-texs)) + (format #t "~1Tptr-env-clrs: #x~X~%" (-> this ptr-env-clrs)) + (format #t "~1Tptr-env-texs: #x~X~%" (-> this ptr-env-texs)) + (format #t "~1Tcur-outbuf: #x~X~%" (-> this cur-outbuf)) + (format #t "~1Tptr-fx-buf: ~D~%" (-> this ptr-fx-buf)) + (format #t "~1Txor-outbufs: ~D~%" (-> this xor-outbufs)) + (format #t "~1Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~1Tqwc: ~D~%" (-> this qwc)) + (format #t "~1Tgsf-buf: #~%" (-> this gsf-buf)) + (format #t "~1Tptr-shaders: #x~X~%" (-> this ptr-shaders)) + (format #t "~1Tptr-env-shader: ~D~%" (-> this ptr-env-shader)) + (format #t "~1Tis-envmap: ~D~%" (-> this is-envmap)) + (format #t "~1Tis-translucent: ~D~%" (-> this is-translucent)) + (format #t "~1Tbasep: #x~X~%" (-> this basep)) + (format #t "~1Tptr-interp-job: #~%" (-> this ptr-interp-job)) + (format #t "~1Tgifbuf-adr: ~D~%" (-> this gifbuf-adr)) + (format #t "~1Tinbuf-adr: ~D~%" (-> this inbuf-adr)) + (format #t "~1Tfade-val: ~D~%" (-> this fade-val)) + (format #t "~1Ttime-of-day-color: ~D~%" (-> this time-of-day-color)) + (format #t "~1Tto-vu0-waits: ~D~%" (-> this to-vu0-waits)) + (format #t "~1Tto-spr-waits: ~D~%" (-> this to-spr-waits)) + (format #t "~1Tfrom-spr-waits: ~D~%" (-> this from-spr-waits)) + (format #t "~1Tenvmap: #~%" (-> this envmap)) (label cfg-4) - obj + this ) ;; definition of type generic-gif-tag @@ -405,20 +405,20 @@ ) ;; definition for method 3 of type generic-gif-tag -(defmethod inspect generic-gif-tag ((obj generic-gif-tag)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-gif-tag ((this generic-gif-tag)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-gif-tag) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj fan-prim)) - (format #t "~1Tqword: #~%" (&-> obj fan-prim)) - (format #t "~1Tfan-prim: ~D~%" (-> obj fan-prim)) - (format #t "~1Tstr-prim: ~D~%" (-> obj str-prim)) - (format #t "~1Tregs: ~D~%" (-> obj regs)) - (format #t "~1Tnum-strips: ~D~%" (-> obj num-strips)) + (format #t "[~8x] ~A~%" this 'generic-gif-tag) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this fan-prim)) + (format #t "~1Tqword: #~%" (&-> this fan-prim)) + (format #t "~1Tfan-prim: ~D~%" (-> this fan-prim)) + (format #t "~1Tstr-prim: ~D~%" (-> this str-prim)) + (format #t "~1Tregs: ~D~%" (-> this regs)) + (format #t "~1Tnum-strips: ~D~%" (-> this num-strips)) (label cfg-4) - obj + this ) ;; definition of type generic-envmap-consts @@ -434,18 +434,18 @@ ) ;; definition for method 3 of type generic-envmap-consts -(defmethod inspect generic-envmap-consts ((obj generic-envmap-consts)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-envmap-consts ((this generic-envmap-consts)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-envmap-consts) - (format #t "~1Tconsts: #~%" (-> obj consts)) - (format #t "~1Tstrgif: #~%" (-> obj strgif)) - (format #t "~1Tcolors: #~%" (-> obj colors)) - (format #t "~1Tshader: #~%" (-> obj shader)) + (format #t "[~8x] ~A~%" this 'generic-envmap-consts) + (format #t "~1Tconsts: #~%" (-> this consts)) + (format #t "~1Tstrgif: #~%" (-> this strgif)) + (format #t "~1Tcolors: #~%" (-> this colors)) + (format #t "~1Tshader: #~%" (-> this shader)) (label cfg-4) - obj + this ) ;; definition of type generic-consts @@ -480,38 +480,38 @@ ) ;; definition for method 3 of type generic-consts -(defmethod inspect generic-consts ((obj generic-consts)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-consts ((this generic-consts)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-consts) - (format #t "~1Tdma-header: #~%" (-> obj dma-header)) - (format #t "~1Tvif-header[4] @ #x~X~%" (-> obj vif-header)) - (format #t "~1Tdma-ref-vtxs: #~%" (-> obj dma-ref-vtxs)) - (format #t "~1Tdma-cnt-call: #~%" (-> obj dma-cnt-call)) - (format #t "~1Tmatrix: #~%" (-> obj matrix)) - (format #t "~1Tbase-strgif: #~%" (-> obj base-strgif)) - (format #t "~1Talpha-opaque: #~%" (-> obj alpha-opaque)) - (format #t "~1Talpha-translucent: #~%" (-> obj alpha-translucent)) - (format #t "~1Tztest-normal: #~%" (-> obj ztest-normal)) - (format #t "~1Tztest-opaque: #~%" (-> obj ztest-opaque)) - (format #t "~1Tadcmd-offsets[16] @ #x~X~%" (-> obj adcmd-offsets)) - (format #t "~1Tadcmds[4] @ #x~X~%" (-> obj alpha-opaque)) - (format #t "~1Tstcycle-tag: ~D~%" (-> obj stcycle-tag)) - (format #t "~1Tunpack-vtx-tag: ~D~%" (-> obj unpack-vtx-tag)) - (format #t "~1Tunpack-clr-tag: ~D~%" (-> obj unpack-clr-tag)) - (format #t "~1Tunpack-tex-tag: ~D~%" (-> obj unpack-tex-tag)) - (format #t "~1Tmscal-tag: ~D~%" (-> obj mscal-tag)) - (format #t "~1Tflush-tag: ~D~%" (-> obj flush-tag)) - (format #t "~1Treset-cycle-tag: ~D~%" (-> obj reset-cycle-tag)) - (format #t "~1Tdummy0: ~D~%" (-> obj dummy0)) - (format #t "~1Tdma-tag-cnt: ~D~%" (-> obj dma-tag-cnt)) - (format #t "~1Tenvmap: #~%" (-> obj envmap)) - (format #t "~1Tlight-consts: #~%" (-> obj light-consts)) - (format #t "~1Ttexture-offset[8] @ #x~X~%" (-> obj texture-offset)) + (format #t "[~8x] ~A~%" this 'generic-consts) + (format #t "~1Tdma-header: #~%" (-> this dma-header)) + (format #t "~1Tvif-header[4] @ #x~X~%" (-> this vif-header)) + (format #t "~1Tdma-ref-vtxs: #~%" (-> this dma-ref-vtxs)) + (format #t "~1Tdma-cnt-call: #~%" (-> this dma-cnt-call)) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tbase-strgif: #~%" (-> this base-strgif)) + (format #t "~1Talpha-opaque: #~%" (-> this alpha-opaque)) + (format #t "~1Talpha-translucent: #~%" (-> this alpha-translucent)) + (format #t "~1Tztest-normal: #~%" (-> this ztest-normal)) + (format #t "~1Tztest-opaque: #~%" (-> this ztest-opaque)) + (format #t "~1Tadcmd-offsets[16] @ #x~X~%" (-> this adcmd-offsets)) + (format #t "~1Tadcmds[4] @ #x~X~%" (-> this alpha-opaque)) + (format #t "~1Tstcycle-tag: ~D~%" (-> this stcycle-tag)) + (format #t "~1Tunpack-vtx-tag: ~D~%" (-> this unpack-vtx-tag)) + (format #t "~1Tunpack-clr-tag: ~D~%" (-> this unpack-clr-tag)) + (format #t "~1Tunpack-tex-tag: ~D~%" (-> this unpack-tex-tag)) + (format #t "~1Tmscal-tag: ~D~%" (-> this mscal-tag)) + (format #t "~1Tflush-tag: ~D~%" (-> this flush-tag)) + (format #t "~1Treset-cycle-tag: ~D~%" (-> this reset-cycle-tag)) + (format #t "~1Tdummy0: ~D~%" (-> this dummy0)) + (format #t "~1Tdma-tag-cnt: ~D~%" (-> this dma-tag-cnt)) + (format #t "~1Tenvmap: #~%" (-> this envmap)) + (format #t "~1Tlight-consts: #~%" (-> this light-consts)) + (format #t "~1Ttexture-offset[8] @ #x~X~%" (-> this texture-offset)) (label cfg-4) - obj + this ) ;; definition of type generic-storage @@ -524,15 +524,15 @@ ) ;; definition for method 3 of type generic-storage -(defmethod inspect generic-storage ((obj generic-storage)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-storage ((this generic-storage)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-storage) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'generic-storage) + (format #t "~1Tdata[16] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc index 760031e79d..ba78fb379f 100644 --- a/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc @@ -15,19 +15,19 @@ ) ;; definition for method 3 of type pris-mtx -(defmethod inspect pris-mtx ((obj pris-mtx)) - (when (not obj) - (set! obj obj) +(defmethod inspect pris-mtx ((this pris-mtx)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pris-mtx) - (format #t "~1Tdata[32] @ #x~X~%" (-> obj data)) - (format #t "~1Tvector[8] @ #x~X~%" (-> obj data)) - (format #t "~1Tt-mtx: #~%" (-> obj data)) - (format #t "~1Tn-mtx: #~%" (-> obj n-mtx)) - (format #t "~1Tscale: #~%" (-> obj scale)) + (format #t "[~8x] ~A~%" this 'pris-mtx) + (format #t "~1Tdata[32] @ #x~X~%" (-> this data)) + (format #t "~1Tvector[8] @ #x~X~%" (-> this data)) + (format #t "~1Tt-mtx: #~%" (-> this data)) + (format #t "~1Tn-mtx: #~%" (-> this n-mtx)) + (format #t "~1Tscale: #~%" (-> this scale)) (label cfg-4) - obj + this ) ;; definition of type generic-pris-mtx-save @@ -42,17 +42,17 @@ ) ;; definition for method 3 of type generic-pris-mtx-save -(defmethod inspect generic-pris-mtx-save ((obj generic-pris-mtx-save)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-pris-mtx-save ((this generic-pris-mtx-save)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-pris-mtx-save) - (format #t "~1Tloc-mtx: #~%" (-> obj loc-mtx)) - (format #t "~1Tpar-mtx: #~%" (-> obj par-mtx)) - (format #t "~1Tdif-mtx: #~%" (-> obj dif-mtx)) + (format #t "[~8x] ~A~%" this 'generic-pris-mtx-save) + (format #t "~1Tloc-mtx: #~%" (-> this loc-mtx)) + (format #t "~1Tpar-mtx: #~%" (-> this par-mtx)) + (format #t "~1Tdif-mtx: #~%" (-> this dif-mtx)) (label cfg-4) - obj + this ) ;; definition of type generic-constants @@ -72,22 +72,22 @@ ) ;; definition for method 3 of type generic-constants -(defmethod inspect generic-constants ((obj generic-constants)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-constants ((this generic-constants)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-constants) - (format #t "~1Tfog: #~%" (-> obj fog)) - (format #t "~1Tadgif: #~%" (-> obj adgif)) - (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~1Tinvh-scale: #~%" (-> obj invh-scale)) - (format #t "~1Tguard: #~%" (-> obj guard)) - (format #t "~1Tflush: #~%" (-> obj flush)) - (format #t "~1Tstores: #~%" (-> obj stores)) + (format #t "[~8x] ~A~%" this 'generic-constants) + (format #t "~1Tfog: #~%" (-> this fog)) + (format #t "~1Tadgif: #~%" (-> this adgif)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~1Tinvh-scale: #~%" (-> this invh-scale)) + (format #t "~1Tguard: #~%" (-> this guard)) + (format #t "~1Tflush: #~%" (-> this flush)) + (format #t "~1Tstores: #~%" (-> this stores)) (label cfg-4) - obj + this ) ;; definition of type generic-shrub-constants @@ -101,16 +101,16 @@ ) ;; definition for method 3 of type generic-shrub-constants -(defmethod inspect generic-shrub-constants ((obj generic-shrub-constants)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-shrub-constants ((this generic-shrub-constants)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-shrub-constants) - (format #t "~1Tshrub-giftag: #~%" (-> obj shrub-giftag)) - (format #t "~1Tshrub-adnop: #~%" (-> obj shrub-adnop)) + (format #t "[~8x] ~A~%" this 'generic-shrub-constants) + (format #t "~1Tshrub-giftag: #~%" (-> this shrub-giftag)) + (format #t "~1Tshrub-adnop: #~%" (-> this shrub-adnop)) (label cfg-4) - obj + this ) ;; definition of type gcf-shader @@ -126,18 +126,18 @@ ) ;; definition for method 3 of type gcf-shader -(defmethod inspect gcf-shader ((obj gcf-shader)) - (when (not obj) - (set! obj obj) +(defmethod inspect gcf-shader ((this gcf-shader)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gcf-shader) - (format #t "~1Tadgif[5] @ #x~X~%" (-> obj adgif)) - (format #t "~1Tshader: #~%" (-> obj adgif)) - (format #t "~1Tpos: ~D~%" (-> obj pos)) - (format #t "~1Tnum: ~D~%" (-> obj num)) + (format #t "[~8x] ~A~%" this 'gcf-shader) + (format #t "~1Tadgif[5] @ #x~X~%" (-> this adgif)) + (format #t "~1Tshader: #~%" (-> this adgif)) + (format #t "~1Tpos: ~D~%" (-> this pos)) + (format #t "~1Tnum: ~D~%" (-> this num)) (label cfg-4) - obj + this ) ;; definition of type gcf-control @@ -156,21 +156,21 @@ ) ;; definition for method 3 of type gcf-control -(defmethod inspect gcf-control ((obj gcf-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect gcf-control ((this gcf-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gcf-control) - (format #t "~1Tmatrix: #~%" (-> obj matrix)) - (format #t "~1Tgiftag: #~%" (-> obj giftag)) - (format #t "~1Tadnops[2] @ #x~X~%" (-> obj adnops)) - (format #t "~1Tnum-strips: ~D~%" (-> obj giftag num-strips)) - (format #t "~1Tnum-dps: ~D~%" (-> obj num-dps)) - (format #t "~1Tkick-offset: ~D~%" (-> obj kick-offset)) - (format #t "~1Tshader[0] @ #x~X~%" (-> obj shader)) + (format #t "[~8x] ~A~%" this 'gcf-control) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tgiftag: #~%" (-> this giftag)) + (format #t "~1Tadnops[2] @ #x~X~%" (-> this adnops)) + (format #t "~1Tnum-strips: ~D~%" (-> this giftag num-strips)) + (format #t "~1Tnum-dps: ~D~%" (-> this num-dps)) + (format #t "~1Tkick-offset: ~D~%" (-> this kick-offset)) + (format #t "~1Tshader[0] @ #x~X~%" (-> this shader)) (label cfg-4) - obj + this ) ;; definition of type gcf-vertex @@ -185,17 +185,17 @@ ) ;; definition for method 3 of type gcf-vertex -(defmethod inspect gcf-vertex ((obj gcf-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect gcf-vertex ((this gcf-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gcf-vertex) - (format #t "~1Ttex: #~%" (-> obj tex)) - (format #t "~1Tclr: #~%" (-> obj clr)) - (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this 'gcf-vertex) + (format #t "~1Ttex: #~%" (-> this tex)) + (format #t "~1Tclr: #~%" (-> this clr)) + (format #t "~1Tpos: #~%" (-> this pos)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc index 403cc09c1c..f4d9cdcd32 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc @@ -22,23 +22,23 @@ ) ;; definition for method 3 of type display-frame -(defmethod inspect display-frame ((obj display-frame)) - (when (not obj) - (set! obj obj) +(defmethod inspect display-frame ((this display-frame)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tbuffer[11] @ #x~X~%" (-> obj buffer)) - (format #t "~1Tcalc-buf: ~A~%" (-> obj calc-buf)) - (format #t "~1Tvu1-buf: ~A~%" (-> obj calc-buf)) - (format #t "~1Tdebug-buf: ~A~%" (-> obj debug-buf)) - (format #t "~1Tglobal-buf: ~A~%" (-> obj global-buf)) - (format #t "~1Tbucket-group: #~%" (-> obj bucket-group)) - (format #t "~1Tprofile-array: #~%" (-> obj profile-array)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Trun-time: ~D~%" (-> obj run-time)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tbuffer[11] @ #x~X~%" (-> this buffer)) + (format #t "~1Tcalc-buf: ~A~%" (-> this calc-buf)) + (format #t "~1Tvu1-buf: ~A~%" (-> this calc-buf)) + (format #t "~1Tdebug-buf: ~A~%" (-> this debug-buf)) + (format #t "~1Tglobal-buf: ~A~%" (-> this global-buf)) + (format #t "~1Tbucket-group: #~%" (-> this bucket-group)) + (format #t "~1Tprofile-array: #~%" (-> this profile-array)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Trun-time: ~D~%" (-> this run-time)) (label cfg-4) - obj + this ) ;; definition for method 0 of type display-frame @@ -96,42 +96,42 @@ ) ;; definition for method 3 of type display -(defmethod inspect display ((obj display)) - (when (not obj) - (set! obj obj) +(defmethod inspect display ((this display)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ton-screen: ~D~%" (-> obj on-screen)) - (format #t "~1Tlast-screen: ~D~%" (-> obj last-screen)) - (format #t "~1Tframes[2] @ #x~X~%" (-> obj frames)) - (format #t "~1Tbgcolor: #x~X~%" (-> obj bgcolor)) - (format #t "~1Tpmode: ~D~%" (-> obj pmode)) - (format #t "~1Tclock[13] @ #x~X~%" (-> obj clock)) - (format #t "~1Tsession-clock: ~A~%" (-> obj session-clock)) - (format #t "~1Tgame-clock: ~A~%" (-> obj game-clock)) - (format #t "~1Tbase-clock: ~A~%" (-> obj base-clock)) - (format #t "~1Treal-clock: ~A~%" (-> obj real-clock)) - (format #t "~1Tframe-clock: ~A~%" (-> obj frame-clock)) - (format #t "~1Treal-frame-clock: ~A~%" (-> obj real-frame-clock)) - (format #t "~1Ttarget-clock: ~A~%" (-> obj target-clock)) - (format #t "~1Tentity-clock: ~A~%" (-> obj entity-clock)) - (format #t "~1Tpart-clock: ~A~%" (-> obj part-clock)) - (format #t "~1Tbg-clock: ~A~%" (-> obj bg-clock)) - (format #t "~1Tcamera-clock: ~A~%" (-> obj camera-clock)) - (format #t "~1Tuser0-clock: ~A~%" (-> obj user0-clock)) - (format #t "~1Ttotal-game-clock: ~A~%" (-> obj total-game-clock)) - (format #t "~1Ttime-factor: ~f~%" (-> obj time-factor)) - (format #t "~1Tdog-ratio: ~f~%" (-> obj dog-ratio)) - (format #t "~1Tvblank-start-time[2] @ #x~X~%" (-> obj vblank-start-time)) - (format #t "~1Ttotal-run-time: ~D~%" (-> obj total-run-time)) - (format #t "~1Trun-half-speed: ~A~%" (-> obj run-half-speed)) - (format #t "~1Tdog-count: ~f~%" (-> obj dog-count)) - (format #t "~1Tvu1-enable-user: ~D~%" (-> obj vu1-enable-user)) - (format #t "~1Tvu1-enable-user-menu: ~D~%" (-> obj vu1-enable-user-menu)) - (format #t "~1Tforce-sync: ~D~%" (-> obj force-sync)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ton-screen: ~D~%" (-> this on-screen)) + (format #t "~1Tlast-screen: ~D~%" (-> this last-screen)) + (format #t "~1Tframes[2] @ #x~X~%" (-> this frames)) + (format #t "~1Tbgcolor: #x~X~%" (-> this bgcolor)) + (format #t "~1Tpmode: ~D~%" (-> this pmode)) + (format #t "~1Tclock[13] @ #x~X~%" (-> this clock)) + (format #t "~1Tsession-clock: ~A~%" (-> this session-clock)) + (format #t "~1Tgame-clock: ~A~%" (-> this game-clock)) + (format #t "~1Tbase-clock: ~A~%" (-> this base-clock)) + (format #t "~1Treal-clock: ~A~%" (-> this real-clock)) + (format #t "~1Tframe-clock: ~A~%" (-> this frame-clock)) + (format #t "~1Treal-frame-clock: ~A~%" (-> this real-frame-clock)) + (format #t "~1Ttarget-clock: ~A~%" (-> this target-clock)) + (format #t "~1Tentity-clock: ~A~%" (-> this entity-clock)) + (format #t "~1Tpart-clock: ~A~%" (-> this part-clock)) + (format #t "~1Tbg-clock: ~A~%" (-> this bg-clock)) + (format #t "~1Tcamera-clock: ~A~%" (-> this camera-clock)) + (format #t "~1Tuser0-clock: ~A~%" (-> this user0-clock)) + (format #t "~1Ttotal-game-clock: ~A~%" (-> this total-game-clock)) + (format #t "~1Ttime-factor: ~f~%" (-> this time-factor)) + (format #t "~1Tdog-ratio: ~f~%" (-> this dog-ratio)) + (format #t "~1Tvblank-start-time[2] @ #x~X~%" (-> this vblank-start-time)) + (format #t "~1Ttotal-run-time: ~D~%" (-> this total-run-time)) + (format #t "~1Trun-half-speed: ~A~%" (-> this run-half-speed)) + (format #t "~1Tdog-count: ~f~%" (-> this dog-count)) + (format #t "~1Tvu1-enable-user: ~D~%" (-> this vu1-enable-user)) + (format #t "~1Tvu1-enable-user-menu: ~D~%" (-> this vu1-enable-user-menu)) + (format #t "~1Tforce-sync: ~D~%" (-> this force-sync)) (label cfg-4) - obj + this ) ;; definition for method 0 of type display diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc index 38309dd03d..4e98f86cc4 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc @@ -12,17 +12,17 @@ ) ;; definition for method 9 of type display -(defmethod set-time-ratios display ((obj display) (arg0 float)) - (set! (-> obj dog-ratio) (fmin 4.0 arg0)) +(defmethod set-time-ratios display ((this display) (arg0 float)) + (set! (-> this dog-ratio) (fmin 4.0 arg0)) (case (get-video-mode) (('pal) - (set! (-> obj time-factor) 6.0) + (set! (-> this time-factor) 6.0) ) (else - (set! (-> obj time-factor) 5.0) + (set! (-> this time-factor) 5.0) ) ) - (-> obj dog-ratio) + (-> this dog-ratio) ) ;; definition for function set-display @@ -292,7 +292,6 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for function set-display-gs-state -;; ERROR: Failed store: (s.w! (+ t3-0 8) t4-1) at op 7 (defun set-display-gs-state ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) (let ((t2-0 (/ (+ arg2 63) 64))) (dma-buffer-add-gs-set-flusha arg0 @@ -309,7 +308,6 @@ ) ;; definition for function set-display-gs-state-offset -;; ERROR: Failed store: (s.w! (+ t5-0 8) t6-1) at op 7 (defun set-display-gs-state-offset ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int) (arg6 int) (arg7 int)) (let ((t4-0 (/ (+ arg2 63) 64))) (dma-buffer-add-gs-set-flusha arg0 @@ -326,7 +324,6 @@ ) ;; definition for function reset-display-gs-state -;; ERROR: Failed store: (s.w! (+ a2-0 8) a3-1) at op 5 (defun reset-display-gs-state ((arg0 display) (arg1 dma-buffer)) (dma-buffer-add-gs-set-flusha arg1 (scissor-1 (new 'static 'gs-scissor :scax1 #x1ff :scay1 #x19f)) diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc index f8aee7ac66..c48768e2e3 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc @@ -201,27 +201,27 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ) ;; definition for method 3 of type gs-bank -(defmethod inspect gs-bank ((obj gs-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-bank ((this gs-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-bank) - (format #t "~1Tpmode: #x~X~%" (-> obj pmode)) - (format #t "~1Tsmode2: #x~X~%" (-> obj smode2)) - (format #t "~1Tdspfb1: #x~X~%" (-> obj dspfb1)) - (format #t "~1Tdisplay1: #x~X~%" (-> obj display1)) - (format #t "~1Tdspfb2: #x~X~%" (-> obj dspfb2)) - (format #t "~1Tdisplay2: #x~X~%" (-> obj display2)) - (format #t "~1Textbuf: #x~X~%" (-> obj extbuf)) - (format #t "~1Textdata: #x~X~%" (-> obj extdata)) - (format #t "~1Textwrite: #x~X~%" (-> obj extwrite)) - (format #t "~1Tbgcolor: #x~X~%" (-> obj bgcolor)) - (format #t "~1Tcsr: #x~X~%" (-> obj csr)) - (format #t "~1Timr: #x~X~%" (-> obj imr)) - (format #t "~1Tbusdir: #x~X~%" (-> obj busdir)) + (format #t "[~8x] ~A~%" this 'gs-bank) + (format #t "~1Tpmode: #x~X~%" (-> this pmode)) + (format #t "~1Tsmode2: #x~X~%" (-> this smode2)) + (format #t "~1Tdspfb1: #x~X~%" (-> this dspfb1)) + (format #t "~1Tdisplay1: #x~X~%" (-> this display1)) + (format #t "~1Tdspfb2: #x~X~%" (-> this dspfb2)) + (format #t "~1Tdisplay2: #x~X~%" (-> this display2)) + (format #t "~1Textbuf: #x~X~%" (-> this extbuf)) + (format #t "~1Textdata: #x~X~%" (-> this extdata)) + (format #t "~1Textwrite: #x~X~%" (-> this extwrite)) + (format #t "~1Tbgcolor: #x~X~%" (-> this bgcolor)) + (format #t "~1Tcsr: #x~X~%" (-> this csr)) + (format #t "~1Timr: #x~X~%" (-> this imr)) + (format #t "~1Tbusdir: #x~X~%" (-> this busdir)) (label cfg-4) - obj + this ) ;; definition of type gs-frame @@ -404,23 +404,23 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition for method 3 of type gs-adcmd ;; INFO: Used lq/sq -(defmethod inspect gs-adcmd ((obj gs-adcmd)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-adcmd ((this gs-adcmd)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-adcmd) - (format #t "~1Tword[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tdata: ~D~%" (-> obj data)) - (format #t "~1Tcmds: ~D~%" (-> obj cmds)) - (format #t "~1Tcmd: ~D~%" (-> obj cmd)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) - (format #t "~1Tw: ~D~%" (-> obj w)) + (format #t "[~8x] ~A~%" this 'gs-adcmd) + (format #t "~1Tword[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tdata: ~D~%" (-> this data)) + (format #t "~1Tcmds: ~D~%" (-> this cmds)) + (format #t "~1Tcmd: ~D~%" (-> this cmd)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Tw: ~D~%" (-> this w)) (label cfg-4) - obj + this ) ;; definition of type gs-trxpos @@ -554,19 +554,19 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ) ;; definition for method 3 of type gs-alpha -(defmethod inspect gs-alpha ((obj gs-alpha)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-alpha ((this gs-alpha)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-alpha) - (format #t "~1Ta: ~D~%" (-> obj a)) - (format #t "~1Tb: ~D~%" (-> obj b)) - (format #t "~1Tc: ~D~%" (-> obj c)) - (format #t "~1Td: ~D~%" (-> obj d)) - (format #t "~1Tfix: ~D~%" (-> obj fix)) + (format #t "[~8x] ~A~%" this 'gs-alpha) + (format #t "~1Ta: ~D~%" (-> this a)) + (format #t "~1Tb: ~D~%" (-> this b)) + (format #t "~1Tc: ~D~%" (-> this c)) + (format #t "~1Td: ~D~%" (-> this d)) + (format #t "~1Tfix: ~D~%" (-> this fix)) (label cfg-4) - obj + this ) ;; definition of type gs-clamp @@ -593,15 +593,15 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ) ;; definition for method 3 of type gs-fog -(defmethod inspect gs-fog ((obj gs-fog)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-fog ((this gs-fog)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-fog) - (format #t "~1Tf: ~D~%" (-> obj f)) + (format #t "[~8x] ~A~%" this 'gs-fog) + (format #t "~1Tf: ~D~%" (-> this f)) (label cfg-4) - obj + this ) ;; definition of type gs-fogcol @@ -616,17 +616,17 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ) ;; definition for method 3 of type gs-fogcol -(defmethod inspect gs-fogcol ((obj gs-fogcol)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-fogcol ((this gs-fogcol)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-fogcol) - (format #t "~1Tr: ~D~%" (-> obj fcr)) - (format #t "~1Tg: ~D~%" (-> obj fcg)) - (format #t "~1Tb: ~D~%" (-> obj fcb)) + (format #t "[~8x] ~A~%" this 'gs-fogcol) + (format #t "~1Tr: ~D~%" (-> this fcr)) + (format #t "~1Tg: ~D~%" (-> this fcg)) + (format #t "~1Tb: ~D~%" (-> this fcb)) (label cfg-4) - obj + this ) ;; definition of type gif-ctrl @@ -718,24 +718,24 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ) ;; definition for method 3 of type gif-bank -(defmethod inspect gif-bank ((obj gif-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect gif-bank ((this gif-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gif-bank) - (format #t "~1Tctrl: #x~X~%" (-> obj ctrl)) - (format #t "~1Tmode: #x~X~%" (-> obj mode)) - (format #t "~1Tstat: #x~X~%" (-> obj stat)) - (format #t "~1Ttag0: #x~X~%" (-> obj tag0)) - (format #t "~1Ttag1: #x~X~%" (-> obj tag1)) - (format #t "~1Ttag2: #x~X~%" (-> obj tag2)) - (format #t "~1Ttag3: #x~X~%" (-> obj tag3)) - (format #t "~1Tcnt: #x~X~%" (-> obj cnt)) - (format #t "~1Tp3cnt: #x~X~%" (-> obj p3cnt)) - (format #t "~1Tp3tag: #x~X~%" (-> obj p3tag)) + (format #t "[~8x] ~A~%" this 'gif-bank) + (format #t "~1Tctrl: #x~X~%" (-> this ctrl)) + (format #t "~1Tmode: #x~X~%" (-> this mode)) + (format #t "~1Tstat: #x~X~%" (-> this stat)) + (format #t "~1Ttag0: #x~X~%" (-> this tag0)) + (format #t "~1Ttag1: #x~X~%" (-> this tag1)) + (format #t "~1Ttag2: #x~X~%" (-> this tag2)) + (format #t "~1Ttag3: #x~X~%" (-> this tag3)) + (format #t "~1Tcnt: #x~X~%" (-> this cnt)) + (format #t "~1Tp3cnt: #x~X~%" (-> this p3cnt)) + (format #t "~1Tp3tag: #x~X~%" (-> this p3tag)) (label cfg-4) - obj + this ) ;; definition of type gif-tag-prim @@ -821,48 +821,48 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ) ;; definition for method 3 of type gs-gif-tag -(defmethod inspect gs-gif-tag ((obj gs-gif-tag)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-gif-tag ((this gs-gif-tag)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-gif-tag) - (format #t "~1Tqword: #~%" (&-> obj tag)) - (format #t "~1Tdword[2] @ #x~X~%" (&-> obj tag)) - (format #t "~1Tword[4] @ #x~X~%" (&-> obj tag)) - (format #t "~1Ttag: ~D~%" (-> obj tag)) - (format #t "~1Tregs: ~D~%" (-> obj regs)) + (format #t "[~8x] ~A~%" this 'gs-gif-tag) + (format #t "~1Tqword: #~%" (&-> this tag)) + (format #t "~1Tdword[2] @ #x~X~%" (&-> this tag)) + (format #t "~1Tword[4] @ #x~X~%" (&-> this tag)) + (format #t "~1Ttag: ~D~%" (-> this tag)) + (format #t "~1Tregs: ~D~%" (-> this regs)) (label cfg-4) - obj + this ) ;; definition for method 3 of type gif-tag ;; WARN: Return type mismatch object vs gif-tag. -(defmethod inspect gif-tag ((obj gif-tag)) - (format #t "[~8x] gif-tag~%" obj) - (format #t "~Tnloop: ~4d~%" (-> obj nloop)) - (format #t "~Teop : ~4d~%" (-> obj eop)) - (format #t "~Tid : ~4d~%" (-> obj id)) - (format #t "~Tpre : ~4d~%" (-> obj pre)) - (format #t "~Tprim : ~4d~%" (-> obj prim)) - (format #t "~Tflg : ~4d~%" (-> obj flg)) - (format #t "~Tnreg : ~4d~%" (-> obj nreg)) - (format #t "~Tregs0 : ~4d~%" (-> obj regs0)) - (format #t "~Tregs1 : ~4d~%" (-> obj regs1)) - (format #t "~Tregs2 : ~4d~%" (-> obj regs2)) - (format #t "~Tregs3 : ~4d~%" (-> obj regs3)) - (format #t "~Tregs4 : ~4d~%" (-> obj regs4)) - (format #t "~Tregs5 : ~4d~%" (-> obj regs5)) - (format #t "~Tregs6 : ~4d~%" (-> obj regs6)) - (format #t "~Tregs7 : ~4d~%" (-> obj regs7)) - (format #t "~Tregs8 : ~4d~%" (-> obj regs8)) - (format #t "~Tregs9 : ~4d~%" (-> obj regs9)) - (format #t "~Tregs10: ~4d~%" (-> obj regs10)) - (format #t "~Tregs11: ~4d~%" (-> obj regs11)) - (format #t "~Tregs12: ~4d~%" (-> obj regs12)) - (format #t "~Tregs13: ~4d~%" (-> obj regs13)) - (format #t "~Tregs14: ~4d~%" (-> obj regs14)) - (the-as gif-tag (format #t "~Tregs15: ~4d~%" (-> obj regs15))) +(defmethod inspect gif-tag ((this gif-tag)) + (format #t "[~8x] gif-tag~%" this) + (format #t "~Tnloop: ~4d~%" (-> this nloop)) + (format #t "~Teop : ~4d~%" (-> this eop)) + (format #t "~Tid : ~4d~%" (-> this id)) + (format #t "~Tpre : ~4d~%" (-> this pre)) + (format #t "~Tprim : ~4d~%" (-> this prim)) + (format #t "~Tflg : ~4d~%" (-> this flg)) + (format #t "~Tnreg : ~4d~%" (-> this nreg)) + (format #t "~Tregs0 : ~4d~%" (-> this regs0)) + (format #t "~Tregs1 : ~4d~%" (-> this regs1)) + (format #t "~Tregs2 : ~4d~%" (-> this regs2)) + (format #t "~Tregs3 : ~4d~%" (-> this regs3)) + (format #t "~Tregs4 : ~4d~%" (-> this regs4)) + (format #t "~Tregs5 : ~4d~%" (-> this regs5)) + (format #t "~Tregs6 : ~4d~%" (-> this regs6)) + (format #t "~Tregs7 : ~4d~%" (-> this regs7)) + (format #t "~Tregs8 : ~4d~%" (-> this regs8)) + (format #t "~Tregs9 : ~4d~%" (-> this regs9)) + (format #t "~Tregs10: ~4d~%" (-> this regs10)) + (format #t "~Tregs11: ~4d~%" (-> this regs11)) + (format #t "~Tregs12: ~4d~%" (-> this regs12)) + (format #t "~Tregs13: ~4d~%" (-> this regs13)) + (format #t "~Tregs14: ~4d~%" (-> this regs14)) + (the-as gif-tag (format #t "~Tregs15: ~4d~%" (-> this regs15))) ) ;; definition for symbol *fog-color*, type rgba @@ -885,17 +885,17 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition for method 3 of type gif-packet ;; INFO: Used lq/sq -(defmethod inspect gif-packet ((obj gif-packet)) - (when (not obj) - (set! obj obj) +(defmethod inspect gif-packet ((this gif-packet)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Treg-count: ~D~%" (-> obj reg-count)) - (format #t "~1Tgif-tag0: #x~X~%" (-> obj gif-tag0)) - (format #t "~1Targs[1] @ #x~X~%" (-> obj args)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Treg-count: ~D~%" (-> this reg-count)) + (format #t "~1Tgif-tag0: #x~X~%" (-> this gif-tag0)) + (format #t "~1Targs[1] @ #x~X~%" (-> this args)) (label cfg-4) - obj + this ) ;; definition for method 0 of type gif-packet @@ -947,20 +947,20 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ) ;; definition for method 3 of type draw-context -(defmethod inspect draw-context ((obj draw-context)) - (when (not obj) - (set! obj obj) +(defmethod inspect draw-context ((this draw-context)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Torgx: ~D~%" (-> obj orgx)) - (format #t "~1Torgy: ~D~%" (-> obj orgy)) - (format #t "~1Torgz: ~D~%" (-> obj orgz)) - (format #t "~1Twidth: ~D~%" (-> obj width)) - (format #t "~1Theight: ~D~%" (-> obj height)) - (format #t "~1Tcolor: #x~X~%" (-> obj color)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Torgx: ~D~%" (-> this orgx)) + (format #t "~1Torgy: ~D~%" (-> this orgy)) + (format #t "~1Torgz: ~D~%" (-> this orgz)) + (format #t "~1Twidth: ~D~%" (-> this width)) + (format #t "~1Theight: ~D~%" (-> this height)) + (format #t "~1Tcolor: #x~X~%" (-> this color)) (label cfg-4) - obj + this ) ;; definition for method 0 of type draw-context @@ -998,25 +998,25 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition for method 3 of type gs-packed-rgba ;; INFO: Used lq/sq -(defmethod inspect gs-packed-rgba ((obj gs-packed-rgba)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-packed-rgba ((this gs-packed-rgba)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-packed-rgba) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) - (format #t "~1Tw: ~D~%" (-> obj w)) - (format #t "~1Tdword[2] @ #x~X~%" (&-> obj x)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tr: ~D~%" (-> obj x)) - (format #t "~1Tg: ~D~%" (-> obj y)) - (format #t "~1Tb: ~D~%" (-> obj z)) - (format #t "~1Ta: ~D~%" (-> obj w)) + (format #t "[~8x] ~A~%" this 'gs-packed-rgba) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Tw: ~D~%" (-> this w)) + (format #t "~1Tdword[2] @ #x~X~%" (&-> this x)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tr: ~D~%" (-> this x)) + (format #t "~1Tg: ~D~%" (-> this y)) + (format #t "~1Tb: ~D~%" (-> this z)) + (format #t "~1Ta: ~D~%" (-> this w)) (label cfg-4) - obj + this ) ;; definition of type gs-packed-xyzw @@ -1033,24 +1033,24 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition for method 3 of type gs-packed-xyzw ;; INFO: Used lq/sq -(defmethod inspect gs-packed-xyzw ((obj gs-packed-xyzw)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-packed-xyzw ((this gs-packed-xyzw)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-packed-xyzw) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj ix)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tix: ~D~%" (-> obj ix)) - (format #t "~1Tiy: ~D~%" (-> obj iy)) - (format #t "~1Tiz: ~D~%" (-> obj iz)) - (format #t "~1Tiw: ~D~%" (-> obj iw)) + (format #t "[~8x] ~A~%" this 'gs-packed-xyzw) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this ix)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tix: ~D~%" (-> this ix)) + (format #t "~1Tiy: ~D~%" (-> this iy)) + (format #t "~1Tiz: ~D~%" (-> this iz)) + (format #t "~1Tiw: ~D~%" (-> this iw)) (label cfg-4) - obj + this ) ;; definition of type gs-packed-stq @@ -1066,24 +1066,24 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition for method 3 of type gs-packed-stq ;; INFO: Used lq/sq -(defmethod inspect gs-packed-stq ((obj gs-packed-stq)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-packed-stq ((this gs-packed-stq)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-packed-stq) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Ttex-s: ~f~%" (-> obj x)) - (format #t "~1Ttex-t: ~f~%" (-> obj y)) - (format #t "~1Ttex-q: ~f~%" (-> obj z)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'gs-packed-stq) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Ttex-s: ~f~%" (-> this x)) + (format #t "~1Ttex-t: ~f~%" (-> this y)) + (format #t "~1Ttex-q: ~f~%" (-> this z)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type gs-packed-uv @@ -1098,23 +1098,23 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ;; definition for method 3 of type gs-packed-uv ;; INFO: Used lq/sq -(defmethod inspect gs-packed-uv ((obj gs-packed-uv)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-packed-uv ((this gs-packed-uv)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-packed-uv) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tu: ~D~%" (-> obj u)) - (format #t "~1Tv: ~D~%" (-> obj v)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'gs-packed-uv) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tu: ~D~%" (-> this u)) + (format #t "~1Tv: ~D~%" (-> this v)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type gs-packed-gt @@ -1129,17 +1129,17 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ) ;; definition for method 3 of type gs-packed-gt -(defmethod inspect gs-packed-gt ((obj gs-packed-gt)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-packed-gt ((this gs-packed-gt)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-packed-gt) - (format #t "~1Tstq: #~%" (-> obj stq)) - (format #t "~1Trgba: #~%" (-> obj rgba)) - (format #t "~1Txyzw: #~%" (-> obj xyzw)) + (format #t "[~8x] ~A~%" this 'gs-packed-gt) + (format #t "~1Tstq: #~%" (-> this stq)) + (format #t "~1Trgba: #~%" (-> this rgba)) + (format #t "~1Txyzw: #~%" (-> this xyzw)) (label cfg-4) - obj + this ) ;; definition of type gs-packed-gt4 @@ -1152,15 +1152,15 @@ bits 5 and 6 (0x20 and 0x40) should be zero" ) ;; definition for method 3 of type gs-packed-gt4 -(defmethod inspect gs-packed-gt4 ((obj gs-packed-gt4)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-packed-gt4 ((this gs-packed-gt4)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-packed-gt4) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'gs-packed-gt4) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc index 5e9ec15fa8..b41f97dd55 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc @@ -19,23 +19,23 @@ ) ;; definition for method 3 of type video-params -(defmethod inspect video-params ((obj video-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect video-params ((this video-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'video-params) - (format #t "~1Tset-video-mode: ~A~%" (-> obj set-video-mode)) - (format #t "~1Treset-video-mode: ~A~%" (-> obj reset-video-mode)) - (format #t "~1Tdisplay-fbp: ~D~%" (-> obj display-fbp)) - (format #t "~1Trelative-x-scale: ~f~%" (-> obj relative-x-scale)) - (format #t "~1Tdisplay-dx: ~D~%" (-> obj display-dx)) - (format #t "~1Tdisplay-dy: ~D~%" (-> obj display-dy)) - (format #t "~1Tdisplay-sy: ~D~%" (-> obj display-sy)) - (format #t "~1Trelative-x-scale-reciprical: ~f~%" (-> obj relative-x-scale-reciprical)) - (format #t "~1Tscreen-pages-high: ~D~%" (-> obj screen-pages-high)) + (format #t "[~8x] ~A~%" this 'video-params) + (format #t "~1Tset-video-mode: ~A~%" (-> this set-video-mode)) + (format #t "~1Treset-video-mode: ~A~%" (-> this reset-video-mode)) + (format #t "~1Tdisplay-fbp: ~D~%" (-> this display-fbp)) + (format #t "~1Trelative-x-scale: ~f~%" (-> this relative-x-scale)) + (format #t "~1Tdisplay-dx: ~D~%" (-> this display-dx)) + (format #t "~1Tdisplay-dy: ~D~%" (-> this display-dy)) + (format #t "~1Tdisplay-sy: ~D~%" (-> this display-sy)) + (format #t "~1Trelative-x-scale-reciprical: ~f~%" (-> this relative-x-scale-reciprical)) + (format #t "~1Tscreen-pages-high: ~D~%" (-> this screen-pages-high)) (label cfg-4) - obj + this ) ;; definition for symbol *video-params*, type video-params diff --git a/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc index 377830c2a1..d895907329 100644 --- a/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type vis-gif-tag -(defmethod inspect vis-gif-tag ((obj vis-gif-tag)) - (when (not obj) - (set! obj obj) +(defmethod inspect vis-gif-tag ((this vis-gif-tag)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vis-gif-tag) - (format #t "~1Tfog0: ~D~%" (-> obj fog0)) - (format #t "~1Tstrip: ~D~%" (-> obj strip)) - (format #t "~1Tregs: ~D~%" (-> obj regs)) - (format #t "~1Tfan: ~D~%" (-> obj fan)) + (format #t "[~8x] ~A~%" this 'vis-gif-tag) + (format #t "~1Tfog0: ~D~%" (-> this fog0)) + (format #t "~1Tstrip: ~D~%" (-> this strip)) + (format #t "~1Tregs: ~D~%" (-> this regs)) + (format #t "~1Tfan: ~D~%" (-> this fan)) (label cfg-4) - obj + this ) ;; definition of type cull-info @@ -54,30 +54,30 @@ ) ;; definition for method 3 of type cull-info -(defmethod inspect cull-info ((obj cull-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect cull-info ((this cull-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cull-info) - (format #t "~1Tx-fact: ~f~%" (-> obj x-fact)) - (format #t "~1Ty-fact: ~f~%" (-> obj y-fact)) - (format #t "~1Tz-fact: ~f~%" (-> obj z-fact)) - (format #t "~1Tcam-radius: ~f~%" (-> obj cam-radius)) - (format #t "~1Tcam-x: ~f~%" (-> obj cam-x)) - (format #t "~1Tcam-y: ~f~%" (-> obj cam-y)) - (format #t "~1Txz-dir-ax: ~f~%" (-> obj xz-dir-ax)) - (format #t "~1Txz-dir-az: ~f~%" (-> obj xz-dir-az)) - (format #t "~1Txz-dir-bx: ~f~%" (-> obj xz-dir-bx)) - (format #t "~1Txz-dir-bz: ~f~%" (-> obj xz-dir-bz)) - (format #t "~1Txz-cross-ab: ~f~%" (-> obj xz-cross-ab)) - (format #t "~1Tyz-dir-ay: ~f~%" (-> obj yz-dir-ay)) - (format #t "~1Tyz-dir-az: ~f~%" (-> obj yz-dir-az)) - (format #t "~1Tyz-dir-by: ~f~%" (-> obj yz-dir-by)) - (format #t "~1Tyz-dir-bz: ~f~%" (-> obj yz-dir-bz)) - (format #t "~1Tyz-cross-ab: ~f~%" (-> obj yz-cross-ab)) + (format #t "[~8x] ~A~%" this 'cull-info) + (format #t "~1Tx-fact: ~f~%" (-> this x-fact)) + (format #t "~1Ty-fact: ~f~%" (-> this y-fact)) + (format #t "~1Tz-fact: ~f~%" (-> this z-fact)) + (format #t "~1Tcam-radius: ~f~%" (-> this cam-radius)) + (format #t "~1Tcam-x: ~f~%" (-> this cam-x)) + (format #t "~1Tcam-y: ~f~%" (-> this cam-y)) + (format #t "~1Txz-dir-ax: ~f~%" (-> this xz-dir-ax)) + (format #t "~1Txz-dir-az: ~f~%" (-> this xz-dir-az)) + (format #t "~1Txz-dir-bx: ~f~%" (-> this xz-dir-bx)) + (format #t "~1Txz-dir-bz: ~f~%" (-> this xz-dir-bz)) + (format #t "~1Txz-cross-ab: ~f~%" (-> this xz-cross-ab)) + (format #t "~1Tyz-dir-ay: ~f~%" (-> this yz-dir-ay)) + (format #t "~1Tyz-dir-az: ~f~%" (-> this yz-dir-az)) + (format #t "~1Tyz-dir-by: ~f~%" (-> this yz-dir-by)) + (format #t "~1Tyz-dir-bz: ~f~%" (-> this yz-dir-bz)) + (format #t "~1Tyz-cross-ab: ~f~%" (-> this yz-cross-ab)) (label cfg-4) - obj + this ) ;; definition of type math-camera @@ -152,78 +152,74 @@ ;; definition for method 3 of type math-camera ;; INFO: Used lq/sq -(defmethod inspect math-camera ((obj math-camera)) - (when (not obj) - (set! obj obj) +(defmethod inspect math-camera ((this math-camera)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Td: (meters ~m)~%" (-> obj d)) - (format #t "~1Tf: (meters ~m)~%" (-> obj f)) - (format #t "~1Tfov: (deg ~r)~%" (-> obj fov)) - (format #t "~1Tx-ratio: ~f~%" (-> obj x-ratio)) - (format #t "~1Ty-ratio: ~f~%" (-> obj y-ratio)) - (format #t "~1Tx-pix: ~f~%" (-> obj x-pix)) - (format #t "~1Tx-clip: ~f~%" (-> obj x-clip)) - (format #t "~1Tx-clip-ratio-in: ~f~%" (-> obj x-clip-ratio-in)) - (format #t "~1Tx-clip-ratio-over: ~f~%" (-> obj x-clip-ratio-over)) - (format #t "~1Ty-pix: ~f~%" (-> obj y-pix)) - (format #t "~1Ty-clip: ~f~%" (-> obj y-clip)) - (format #t "~1Ty-clip-ratio-in: ~f~%" (-> obj y-clip-ratio-in)) - (format #t "~1Ty-clip-ratio-over: ~f~%" (-> obj y-clip-ratio-over)) - (format #t "~1Tcull-info: #~%" (-> obj cull-info)) - (format #t "~1Tfog-start: (meters ~m)~%" (-> obj fog-start)) - (format #t "~1Tfog-end: (meters ~m)~%" (-> obj fog-end)) - (format #t "~1Tfog-max: ~f~%" (-> obj fog-max)) - (format #t "~1Tfog-min: ~f~%" (-> obj fog-min)) - (format #t "~1Treset: ~D~%" (-> obj reset)) - (format #t "~1Tsmooth-step: ~f~%" (-> obj smooth-step)) - (format #t "~1Tsmooth-t: ~f~%" (-> obj smooth-t)) - (format #t "~1Tperspective: #~%" (-> obj perspective)) - (format #t "~1Tisometric: #~%" (-> obj isometric)) - (format #t "~1Tsprite-2d: #~%" (-> obj sprite-2d)) - (format #t "~1Tsprite-2d-hvdf: #~%" (-> obj sprite-2d-hvdf)) - (format #t "~1Tcamera-rot: #~%" (-> obj camera-rot)) - (format #t "~1Tinv-camera-rot: #~%" (-> obj inv-camera-rot)) - (format #t "~1Tinv-camera-rot-smooth: #~%" (-> obj inv-camera-rot-smooth)) - (format #t "~1Tinv-camera-rot-smooth-from: #~%" (-> obj inv-camera-rot-smooth-from)) - (format #t "~1Tcamera-temp: #~%" (-> obj camera-temp)) - (format #t "~1Tprev-camera-temp: #~%" (-> obj prev-camera-temp)) - (format #t "~1Tprev-inv-camera-rot: #~%" (-> obj prev-inv-camera-rot)) - (format #t "~1Tprev-trans: ~`vector`P~%" (-> obj prev-trans)) - (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~1Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) - (format #t "~1Thvdf-off: #~%" (-> obj hvdf-off)) - (format #t "~1Tguard: #~%" (-> obj guard)) - (format #t "~1Tvis-gifs[4] @ #x~X~%" (-> obj vis-gifs)) - (format #t "~1Tgiftex: ~D~%" (-> obj giftex)) - (format #t "~1Tgifgr: ~D~%" (-> obj gifgr)) - (format #t "~1Tgiftex-trans: ~D~%" (-> obj giftex-trans)) - (format #t "~1Tgifgr-trans: ~D~%" (-> obj gifgr-trans)) - (format #t "~1Tpfog0: ~f~%" (-> obj pfog0)) - (format #t "~1Tpfog1: ~f~%" (-> obj pfog1)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Tplane[4] @ #x~X~%" (-> obj plane)) - (format #t "~1Tguard-plane[4] @ #x~X~%" (-> obj guard-plane)) - (format #t "~1Tshrub-mat: #~%" (-> obj shrub-mat)) - (format #t "~1Tquat-other: #~%" (-> obj quat-other)) - (format #t "~1Ttrans-other: #~%" (-> obj trans-other)) - (format #t "~1Tshrub-mat-other: #~%" (-> obj shrub-mat-other)) - (format #t "~1Tcamera-temp-other: #~%" (-> obj camera-temp-other)) - (format #t "~1Tcamera-rot-other: #~%" (-> obj camera-rot-other)) - (format #t "~1Tinv-camera-rot-other: #~%" (-> obj inv-camera-rot-other)) - (format #t "~1Tplane-other[4] @ #x~X~%" (-> obj plane-other)) - (format #t "~1Tguard-plane-other[4] @ #x~X~%" (-> obj guard-plane-other)) - (format #t "~1Tmirror-trans: #~%" (-> obj mirror-trans)) - (format #t "~1Tmirror-normal: #~%" (-> obj mirror-normal)) - (format #t "~1Tfov-correction-factor: ~f~%" (-> obj fov-correction-factor)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Td: (meters ~m)~%" (-> this d)) + (format #t "~1Tf: (meters ~m)~%" (-> this f)) + (format #t "~1Tfov: (deg ~r)~%" (-> this fov)) + (format #t "~1Tx-ratio: ~f~%" (-> this x-ratio)) + (format #t "~1Ty-ratio: ~f~%" (-> this y-ratio)) + (format #t "~1Tx-pix: ~f~%" (-> this x-pix)) + (format #t "~1Tx-clip: ~f~%" (-> this x-clip)) + (format #t "~1Tx-clip-ratio-in: ~f~%" (-> this x-clip-ratio-in)) + (format #t "~1Tx-clip-ratio-over: ~f~%" (-> this x-clip-ratio-over)) + (format #t "~1Ty-pix: ~f~%" (-> this y-pix)) + (format #t "~1Ty-clip: ~f~%" (-> this y-clip)) + (format #t "~1Ty-clip-ratio-in: ~f~%" (-> this y-clip-ratio-in)) + (format #t "~1Ty-clip-ratio-over: ~f~%" (-> this y-clip-ratio-over)) + (format #t "~1Tcull-info: #~%" (-> this cull-info)) + (format #t "~1Tfog-start: (meters ~m)~%" (-> this fog-start)) + (format #t "~1Tfog-end: (meters ~m)~%" (-> this fog-end)) + (format #t "~1Tfog-max: ~f~%" (-> this fog-max)) + (format #t "~1Tfog-min: ~f~%" (-> this fog-min)) + (format #t "~1Treset: ~D~%" (-> this reset)) + (format #t "~1Tsmooth-step: ~f~%" (-> this smooth-step)) + (format #t "~1Tsmooth-t: ~f~%" (-> this smooth-t)) + (format #t "~1Tperspective: #~%" (-> this perspective)) + (format #t "~1Tisometric: #~%" (-> this isometric)) + (format #t "~1Tsprite-2d: #~%" (-> this sprite-2d)) + (format #t "~1Tsprite-2d-hvdf: #~%" (-> this sprite-2d-hvdf)) + (format #t "~1Tcamera-rot: #~%" (-> this camera-rot)) + (format #t "~1Tinv-camera-rot: #~%" (-> this inv-camera-rot)) + (format #t "~1Tinv-camera-rot-smooth: #~%" (-> this inv-camera-rot-smooth)) + (format #t "~1Tinv-camera-rot-smooth-from: #~%" (-> this inv-camera-rot-smooth-from)) + (format #t "~1Tcamera-temp: #~%" (-> this camera-temp)) + (format #t "~1Tprev-camera-temp: #~%" (-> this prev-camera-temp)) + (format #t "~1Tprev-inv-camera-rot: #~%" (-> this prev-inv-camera-rot)) + (format #t "~1Tprev-trans: ~`vector`P~%" (-> this prev-trans)) + (format #t "~1Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~1Tinv-hmge-scale: #~%" (-> this inv-hmge-scale)) + (format #t "~1Thvdf-off: #~%" (-> this hvdf-off)) + (format #t "~1Tguard: #~%" (-> this guard)) + (format #t "~1Tvis-gifs[4] @ #x~X~%" (-> this vis-gifs)) + (format #t "~1Tgiftex: ~D~%" (-> this giftex)) + (format #t "~1Tgifgr: ~D~%" (-> this gifgr)) + (format #t "~1Tgiftex-trans: ~D~%" (-> this giftex-trans)) + (format #t "~1Tgifgr-trans: ~D~%" (-> this gifgr-trans)) + (format #t "~1Tpfog0: ~f~%" (-> this pfog0)) + (format #t "~1Tpfog1: ~f~%" (-> this pfog1)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tplane[4] @ #x~X~%" (-> this plane)) + (format #t "~1Tguard-plane[4] @ #x~X~%" (-> this guard-plane)) + (format #t "~1Tshrub-mat: #~%" (-> this shrub-mat)) + (format #t "~1Tquat-other: #~%" (-> this quat-other)) + (format #t "~1Ttrans-other: #~%" (-> this trans-other)) + (format #t "~1Tshrub-mat-other: #~%" (-> this shrub-mat-other)) + (format #t "~1Tcamera-temp-other: #~%" (-> this camera-temp-other)) + (format #t "~1Tcamera-rot-other: #~%" (-> this camera-rot-other)) + (format #t "~1Tinv-camera-rot-other: #~%" (-> this inv-camera-rot-other)) + (format #t "~1Tplane-other[4] @ #x~X~%" (-> this plane-other)) + (format #t "~1Tguard-plane-other[4] @ #x~X~%" (-> this guard-plane-other)) + (format #t "~1Tmirror-trans: #~%" (-> this mirror-trans)) + (format #t "~1Tmirror-normal: #~%" (-> this mirror-normal)) + (format #t "~1Tfov-correction-factor: ~f~%" (-> this fov-correction-factor)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc index 1055c5d52b..12339cd8a1 100644 --- a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type fog-corrector -(defmethod inspect fog-corrector ((obj fog-corrector)) - (when (not obj) - (set! obj obj) +(defmethod inspect fog-corrector ((this fog-corrector)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fog-corrector) - (format #t "~1Tfog-end: ~f~%" (-> obj fog-end)) - (format #t "~1Tfog-start: ~f~%" (-> obj fog-start)) + (format #t "[~8x] ~A~%" this 'fog-corrector) + (format #t "~1Tfog-end: ~f~%" (-> this fog-end)) + (format #t "~1Tfog-start: ~f~%" (-> this fog-start)) (label cfg-4) - obj + this ) ;; definition for function fog-corrector-setup diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc index 3c36cd3d9c..cc70ce2f7c 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc @@ -10,14 +10,14 @@ ) ;; definition for method 3 of type default-interior-states -(defmethod inspect default-interior-states ((obj default-interior-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect default-interior-states ((this default-interior-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'default-interior-states) + (format #t "[~8x] ~A~%" this 'default-interior-states) (label cfg-4) - obj + this ) ;; definition for function update-mood-default-interior @@ -57,18 +57,18 @@ ) ;; definition for method 3 of type vinroom-states -(defmethod inspect vinroom-states ((obj vinroom-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect vinroom-states ((this vinroom-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vinroom-states) - (format #t "~1Tmain: ~f~%" (-> obj main)) - (format #t "~1Tflicker1: ~f~%" (-> obj flicker1)) - (format #t "~1Tflicker2: ~f~%" (-> obj flicker2)) - (format #t "~1Twarp: ~f~%" (-> obj warp)) + (format #t "[~8x] ~A~%" this 'vinroom-states) + (format #t "~1Tmain: ~f~%" (-> this main)) + (format #t "~1Tflicker1: ~f~%" (-> this flicker1)) + (format #t "~1Tflicker2: ~f~%" (-> this flicker2)) + (format #t "~1Twarp: ~f~%" (-> this warp)) (label cfg-4) - obj + this ) ;; definition for function update-vinroom-lights @@ -160,16 +160,16 @@ ) ;; definition for method 3 of type hideout-states -(defmethod inspect hideout-states ((obj hideout-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect hideout-states ((this hideout-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hideout-states) - (format #t "~1Tflame0: #~%" (-> obj flame0)) - (format #t "~1Tflame1: #~%" (-> obj flame1)) + (format #t "[~8x] ~A~%" this 'hideout-states) + (format #t "~1Tflame0: #~%" (-> this flame0)) + (format #t "~1Tflame1: #~%" (-> this flame1)) (label cfg-4) - obj + this ) ;; definition for function update-hideout-lights @@ -319,52 +319,52 @@ ) ;; definition for method 3 of type hiphog-states -(defmethod inspect hiphog-states ((obj hiphog-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect hiphog-states ((this hiphog-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hiphog-states) - (format #t "~1Tspec-m-on: #~%" (-> obj spec-m-on)) - (format #t "~1Tspec-o-on: #~%" (-> obj spec-o-on)) - (format #t "~1Tspec-r-on: #~%" (-> obj spec-r-on)) - (format #t "~1Tspec-g-on: #~%" (-> obj spec-g-on)) - (format #t "~1Tspec-a-on: #~%" (-> obj spec-a-on)) - (format #t "~1Tspec-n-on: #~%" (-> obj spec-n-on)) - (format #t "~1Tspec-m-off: #~%" (-> obj spec-m-off)) - (format #t "~1Tspec-o-off: #~%" (-> obj spec-o-off)) - (format #t "~1Tspec-r-off: #~%" (-> obj spec-r-off)) - (format #t "~1Tspec-g-off: #~%" (-> obj spec-g-off)) - (format #t "~1Tspec-a-off: #~%" (-> obj spec-a-off)) - (format #t "~1Tspec-n-off: #~%" (-> obj spec-n-off)) - (format #t "~1Tspec-hog-1-on: #~%" (-> obj spec-hog-1-on)) - (format #t "~1Tspec-hog-2-on: #~%" (-> obj spec-hog-2-on)) - (format #t "~1Tspec-hiphog-on: #~%" (-> obj spec-hiphog-on)) - (format #t "~1Tspec-hiphog-off: #~%" (-> obj spec-hiphog-off)) - (format #t "~1Tspec-hiphog-on2: #~%" (-> obj spec-hiphog-on2)) - (format #t "~1Tspec-hiphog-off2: #~%" (-> obj spec-hiphog-off2)) - (format #t "~1Tspec-clock-sun: #~%" (-> obj spec-clock-sun)) - (format #t "~1Tspec-clock-moon: #~%" (-> obj spec-clock-moon)) - (format #t "~1Tdoor: ~A~%" (-> obj door)) - (format #t "~1Tm-on: ~D~%" (-> obj m-on)) - (format #t "~1To-on: ~D~%" (-> obj o-on)) - (format #t "~1Tr-on: ~D~%" (-> obj r-on)) - (format #t "~1Tg-on: ~D~%" (-> obj g-on)) - (format #t "~1Ta-on: ~D~%" (-> obj a-on)) - (format #t "~1Tn-on: ~D~%" (-> obj n-on)) - (format #t "~1Tm-off: ~D~%" (-> obj m-off)) - (format #t "~1To-off: ~D~%" (-> obj o-off)) - (format #t "~1Tr-off: ~D~%" (-> obj r-off)) - (format #t "~1Tg-off: ~D~%" (-> obj g-off)) - (format #t "~1Ta-off: ~D~%" (-> obj a-off)) - (format #t "~1Tn-off: ~D~%" (-> obj n-off)) - (format #t "~1Thog-on: ~D~%" (-> obj hog-on)) - (format #t "~1Thiphog-on: ~D~%" (-> obj hiphog-on)) - (format #t "~1Thiphog-off: ~D~%" (-> obj hiphog-off)) - (format #t "~1Tclock-sun: ~D~%" (-> obj clock-sun)) - (format #t "~1Tclock-moon: ~D~%" (-> obj clock-moon)) + (format #t "[~8x] ~A~%" this 'hiphog-states) + (format #t "~1Tspec-m-on: #~%" (-> this spec-m-on)) + (format #t "~1Tspec-o-on: #~%" (-> this spec-o-on)) + (format #t "~1Tspec-r-on: #~%" (-> this spec-r-on)) + (format #t "~1Tspec-g-on: #~%" (-> this spec-g-on)) + (format #t "~1Tspec-a-on: #~%" (-> this spec-a-on)) + (format #t "~1Tspec-n-on: #~%" (-> this spec-n-on)) + (format #t "~1Tspec-m-off: #~%" (-> this spec-m-off)) + (format #t "~1Tspec-o-off: #~%" (-> this spec-o-off)) + (format #t "~1Tspec-r-off: #~%" (-> this spec-r-off)) + (format #t "~1Tspec-g-off: #~%" (-> this spec-g-off)) + (format #t "~1Tspec-a-off: #~%" (-> this spec-a-off)) + (format #t "~1Tspec-n-off: #~%" (-> this spec-n-off)) + (format #t "~1Tspec-hog-1-on: #~%" (-> this spec-hog-1-on)) + (format #t "~1Tspec-hog-2-on: #~%" (-> this spec-hog-2-on)) + (format #t "~1Tspec-hiphog-on: #~%" (-> this spec-hiphog-on)) + (format #t "~1Tspec-hiphog-off: #~%" (-> this spec-hiphog-off)) + (format #t "~1Tspec-hiphog-on2: #~%" (-> this spec-hiphog-on2)) + (format #t "~1Tspec-hiphog-off2: #~%" (-> this spec-hiphog-off2)) + (format #t "~1Tspec-clock-sun: #~%" (-> this spec-clock-sun)) + (format #t "~1Tspec-clock-moon: #~%" (-> this spec-clock-moon)) + (format #t "~1Tdoor: ~A~%" (-> this door)) + (format #t "~1Tm-on: ~D~%" (-> this m-on)) + (format #t "~1To-on: ~D~%" (-> this o-on)) + (format #t "~1Tr-on: ~D~%" (-> this r-on)) + (format #t "~1Tg-on: ~D~%" (-> this g-on)) + (format #t "~1Ta-on: ~D~%" (-> this a-on)) + (format #t "~1Tn-on: ~D~%" (-> this n-on)) + (format #t "~1Tm-off: ~D~%" (-> this m-off)) + (format #t "~1To-off: ~D~%" (-> this o-off)) + (format #t "~1Tr-off: ~D~%" (-> this r-off)) + (format #t "~1Tg-off: ~D~%" (-> this g-off)) + (format #t "~1Ta-off: ~D~%" (-> this a-off)) + (format #t "~1Tn-off: ~D~%" (-> this n-off)) + (format #t "~1Thog-on: ~D~%" (-> this hog-on)) + (format #t "~1Thiphog-on: ~D~%" (-> this hiphog-on)) + (format #t "~1Thiphog-off: ~D~%" (-> this hiphog-off)) + (format #t "~1Tclock-sun: ~D~%" (-> this clock-sun)) + (format #t "~1Tclock-moon: ~D~%" (-> this clock-moon)) (label cfg-4) - obj + this ) ;; definition for function init-mood-hiphog @@ -857,20 +857,20 @@ ) ;; definition for method 3 of type sewer-states -(defmethod inspect sewer-states ((obj sewer-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect sewer-states ((this sewer-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sewer-states) - (format #t "~1Tlight-flag: ~A~%" (-> obj light-flag)) - (format #t "~1Tlight-count: ~D~%" (-> obj light-count)) - (format #t "~1Tturret-value: ~f~%" (-> obj turret-value)) - (format #t "~1Tspec-light-center: #~%" (-> obj spec-light-center)) - (format #t "~1Tspec-light: #~%" (-> obj spec-light)) - (format #t "~1Texplosion: ~f~%" (-> obj explosion)) + (format #t "[~8x] ~A~%" this 'sewer-states) + (format #t "~1Tlight-flag: ~A~%" (-> this light-flag)) + (format #t "~1Tlight-count: ~D~%" (-> this light-count)) + (format #t "~1Tturret-value: ~f~%" (-> this turret-value)) + (format #t "~1Tspec-light-center: #~%" (-> this spec-light-center)) + (format #t "~1Tspec-light: #~%" (-> this spec-light)) + (format #t "~1Texplosion: ~f~%" (-> this explosion)) (label cfg-4) - obj + this ) ;; definition for function update-sewer-lights @@ -1116,20 +1116,20 @@ ) ;; definition for method 3 of type onintent-states -(defmethod inspect onintent-states ((obj onintent-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect onintent-states ((this onintent-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'onintent-states) - (format #t "~1Tflame0: #~%" (-> obj flame0)) - (format #t "~1Tflame1: #~%" (-> obj flame1)) - (format #t "~1Tflame2: #~%" (-> obj flame2)) - (format #t "~1Tgreen-flame: #~%" (-> obj green-flame)) - (format #t "~1Ttotem0: #~%" (-> obj totem0)) - (format #t "~1Ttotem1: #~%" (-> obj totem1)) + (format #t "[~8x] ~A~%" this 'onintent-states) + (format #t "~1Tflame0: #~%" (-> this flame0)) + (format #t "~1Tflame1: #~%" (-> this flame1)) + (format #t "~1Tflame2: #~%" (-> this flame2)) + (format #t "~1Tgreen-flame: #~%" (-> this green-flame)) + (format #t "~1Ttotem0: #~%" (-> this totem0)) + (format #t "~1Ttotem1: #~%" (-> this totem1)) (label cfg-4) - obj + this ) ;; definition for function update-onintent-lights @@ -1186,24 +1186,24 @@ ) ;; definition for method 3 of type oracle-states -(defmethod inspect oracle-states ((obj oracle-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect oracle-states ((this oracle-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'oracle-states) - (format #t "~1Tflame0: #~%" (-> obj flame0)) - (format #t "~1Tflame1: #~%" (-> obj flame1)) - (format #t "~1Tflame2: #~%" (-> obj flame2)) - (format #t "~1Tblue-flame: #~%" (-> obj blue-flame)) - (format #t "~1Tdoor-entity: ~A~%" (-> obj door-entity)) - (format #t "~1Tdoor-current: ~f~%" (-> obj door-current)) - (format #t "~1Tdoor-target: ~f~%" (-> obj door-target)) - (format #t "~1Tpurple-flag: ~A~%" (-> obj purple-flag)) - (format #t "~1Tpurple: ~f~%" (-> obj purple)) - (format #t "~1Tpurple-noise: ~f~%" (-> obj purple-noise)) + (format #t "[~8x] ~A~%" this 'oracle-states) + (format #t "~1Tflame0: #~%" (-> this flame0)) + (format #t "~1Tflame1: #~%" (-> this flame1)) + (format #t "~1Tflame2: #~%" (-> this flame2)) + (format #t "~1Tblue-flame: #~%" (-> this blue-flame)) + (format #t "~1Tdoor-entity: ~A~%" (-> this door-entity)) + (format #t "~1Tdoor-current: ~f~%" (-> this door-current)) + (format #t "~1Tdoor-target: ~f~%" (-> this door-target)) + (format #t "~1Tpurple-flag: ~A~%" (-> this purple-flag)) + (format #t "~1Tpurple: ~f~%" (-> this purple)) + (format #t "~1Tpurple-noise: ~f~%" (-> this purple-noise)) (label cfg-4) - obj + this ) ;; definition for function init-mood-oracle @@ -1290,19 +1290,19 @@ ) ;; definition for method 3 of type tomba-states -(defmethod inspect tomba-states ((obj tomba-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomba-states ((this tomba-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tomba-states) - (format #t "~1Tflame0: #~%" (-> obj flame0)) - (format #t "~1Tflame1: #~%" (-> obj flame1)) - (format #t "~1Tflame2: #~%" (-> obj flame2)) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tgem-light: ~f~%" (-> obj gem-light)) + (format #t "[~8x] ~A~%" this 'tomba-states) + (format #t "~1Tflame0: #~%" (-> this flame0)) + (format #t "~1Tflame1: #~%" (-> this flame1)) + (format #t "~1Tflame2: #~%" (-> this flame2)) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tgem-light: ~f~%" (-> this gem-light)) (label cfg-4) - obj + this ) ;; definition for function update-tomba-lights @@ -1387,18 +1387,18 @@ ) ;; definition for method 3 of type tombb-states -(defmethod inspect tombb-states ((obj tombb-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect tombb-states ((this tombb-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tombb-states) - (format #t "~1Tflame0: #~%" (-> obj flame0)) - (format #t "~1Tflame1: #~%" (-> obj flame1)) - (format #t "~1Tflame2: #~%" (-> obj flame2)) - (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "[~8x] ~A~%" this 'tombb-states) + (format #t "~1Tflame0: #~%" (-> this flame0)) + (format #t "~1Tflame1: #~%" (-> this flame1)) + (format #t "~1Tflame2: #~%" (-> this flame2)) + (format #t "~1Tlight: #~%" (-> this light)) (label cfg-4) - obj + this ) ;; definition for function update-tombb-lights @@ -1472,18 +1472,18 @@ ) ;; definition for method 3 of type tombc-states -(defmethod inspect tombc-states ((obj tombc-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect tombc-states ((this tombc-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tombc-states) - (format #t "~1Tflame0: #~%" (-> obj flame0)) - (format #t "~1Tflame1: #~%" (-> obj flame1)) - (format #t "~1Tflame2: #~%" (-> obj flame2)) - (format #t "~1Telectricity: #~%" (-> obj electricity)) + (format #t "[~8x] ~A~%" this 'tombc-states) + (format #t "~1Tflame0: #~%" (-> this flame0)) + (format #t "~1Tflame1: #~%" (-> this flame1)) + (format #t "~1Tflame2: #~%" (-> this flame2)) + (format #t "~1Telectricity: #~%" (-> this electricity)) (label cfg-4) - obj + this ) ;; definition for function init-mood-tombc @@ -1540,19 +1540,19 @@ ) ;; definition for method 3 of type tombd-states -(defmethod inspect tombd-states ((obj tombd-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect tombd-states ((this tombd-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tombd-states) - (format #t "~1Tflame0: #~%" (-> obj flame0)) - (format #t "~1Tflame1: #~%" (-> obj flame1)) - (format #t "~1Tflame2: #~%" (-> obj flame2)) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tgem-light: ~f~%" (-> obj gem-light)) + (format #t "[~8x] ~A~%" this 'tombd-states) + (format #t "~1Tflame0: #~%" (-> this flame0)) + (format #t "~1Tflame1: #~%" (-> this flame1)) + (format #t "~1Tflame2: #~%" (-> this flame2)) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tgem-light: ~f~%" (-> this gem-light)) (label cfg-4) - obj + this ) ;; definition for function update-tombd-lights @@ -1631,19 +1631,19 @@ ) ;; definition for method 3 of type tombe-states -(defmethod inspect tombe-states ((obj tombe-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect tombe-states ((this tombe-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tombe-states) - (format #t "~1Tflame0: #~%" (-> obj flame0)) - (format #t "~1Tflame1: #~%" (-> obj flame1)) - (format #t "~1Tflame2: #~%" (-> obj flame2)) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tgem-light: ~f~%" (-> obj gem-light)) + (format #t "[~8x] ~A~%" this 'tombe-states) + (format #t "~1Tflame0: #~%" (-> this flame0)) + (format #t "~1Tflame1: #~%" (-> this flame1)) + (format #t "~1Tflame2: #~%" (-> this flame2)) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tgem-light: ~f~%" (-> this gem-light)) (label cfg-4) - obj + this ) ;; definition for function update-mood-tombe @@ -1683,19 +1683,19 @@ ) ;; definition for method 3 of type tombboss-states -(defmethod inspect tombboss-states ((obj tombboss-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect tombboss-states ((this tombboss-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tombboss-states) - (format #t "~1Tflame0: #~%" (-> obj flame0)) - (format #t "~1Tflame1: #~%" (-> obj flame1)) - (format #t "~1Tflame2: #~%" (-> obj flame2)) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tgem-light: ~f~%" (-> obj gem-light)) + (format #t "[~8x] ~A~%" this 'tombboss-states) + (format #t "~1Tflame0: #~%" (-> this flame0)) + (format #t "~1Tflame1: #~%" (-> this flame1)) + (format #t "~1Tflame2: #~%" (-> this flame2)) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tgem-light: ~f~%" (-> this gem-light)) (label cfg-4) - obj + this ) ;; definition for function update-tombboss-lights @@ -1857,15 +1857,15 @@ ) ;; definition for method 3 of type fortress-states -(defmethod inspect fortress-states ((obj fortress-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect fortress-states ((this fortress-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fortress-states) - (format #t "~1Tpulse: #~%" (-> obj pulse)) + (format #t "[~8x] ~A~%" this 'fortress-states) + (format #t "~1Tpulse: #~%" (-> this pulse)) (label cfg-4) - obj + this ) ;; definition for function update-fortress-lights @@ -1945,17 +1945,17 @@ ) ;; definition for method 3 of type fordumpa-states -(defmethod inspect fordumpa-states ((obj fordumpa-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect fordumpa-states ((this fordumpa-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fordumpa-states) - (format #t "~1Tturret-value[4] @ #x~X~%" (-> obj turret-value)) - (format #t "~1Tpulse: #~%" (-> obj pulse)) - (format #t "~1Telectricity: #~%" (-> obj electricity)) + (format #t "[~8x] ~A~%" this 'fordumpa-states) + (format #t "~1Tturret-value[4] @ #x~X~%" (-> this turret-value)) + (format #t "~1Tpulse: #~%" (-> this pulse)) + (format #t "~1Telectricity: #~%" (-> this electricity)) (label cfg-4) - obj + this ) ;; definition for function init-mood-fordumpa @@ -2031,18 +2031,18 @@ ) ;; definition for method 3 of type fordumpc-states -(defmethod inspect fordumpc-states ((obj fordumpc-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect fordumpc-states ((this fordumpc-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fordumpc-states) - (format #t "~1Tlight-flag: ~A~%" (-> obj light-flag)) - (format #t "~1Tpulse0: #~%" (-> obj pulse0)) - (format #t "~1Tpulse1: #~%" (-> obj pulse1)) - (format #t "~1Tstrobe: #~%" (-> obj strobe)) + (format #t "[~8x] ~A~%" this 'fordumpc-states) + (format #t "~1Tlight-flag: ~A~%" (-> this light-flag)) + (format #t "~1Tpulse0: #~%" (-> this pulse0)) + (format #t "~1Tpulse1: #~%" (-> this pulse1)) + (format #t "~1Tstrobe: #~%" (-> this strobe)) (label cfg-4) - obj + this ) ;; definition for function init-mood-fordumpc @@ -2101,16 +2101,16 @@ ) ;; definition for method 3 of type forresca-states -(defmethod inspect forresca-states ((obj forresca-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect forresca-states ((this forresca-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'forresca-states) - (format #t "~1Tpulse: #~%" (-> obj pulse)) - (format #t "~1Telectricity[2] @ #x~X~%" (-> obj electricity)) + (format #t "[~8x] ~A~%" this 'forresca-states) + (format #t "~1Tpulse: #~%" (-> this pulse)) + (format #t "~1Telectricity[2] @ #x~X~%" (-> this electricity)) (label cfg-4) - obj + this ) ;; definition for function init-mood-forresca @@ -2164,16 +2164,16 @@ ) ;; definition for method 3 of type forrescb-states -(defmethod inspect forrescb-states ((obj forrescb-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect forrescb-states ((this forrescb-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'forrescb-states) - (format #t "~1Telectricity[2] @ #x~X~%" (-> obj electricity)) - (format #t "~1Tturret[4] @ #x~X~%" (-> obj turret)) + (format #t "[~8x] ~A~%" this 'forrescb-states) + (format #t "~1Telectricity[2] @ #x~X~%" (-> this electricity)) + (format #t "~1Tturret[4] @ #x~X~%" (-> this turret)) (label cfg-4) - obj + this ) ;; definition for function init-mood-forrescb @@ -2250,18 +2250,18 @@ ) ;; definition for method 3 of type prison-states -(defmethod inspect prison-states ((obj prison-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect prison-states ((this prison-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'prison-states) - (format #t "~1Tpulse: ~f~%" (-> obj pulse)) - (format #t "~1Tangle: ~f~%" (-> obj angle)) - (format #t "~1Ttorture: ~f~%" (-> obj torture)) - (format #t "~1Ttorture-flag: ~A~%" (-> obj torture-flag)) + (format #t "[~8x] ~A~%" this 'prison-states) + (format #t "~1Tpulse: ~f~%" (-> this pulse)) + (format #t "~1Tangle: ~f~%" (-> this angle)) + (format #t "~1Ttorture: ~f~%" (-> this torture)) + (format #t "~1Ttorture-flag: ~A~%" (-> this torture-flag)) (label cfg-4) - obj + this ) ;; definition for function update-prison-lights @@ -2362,22 +2362,22 @@ ) ;; definition for method 3 of type under-states -(defmethod inspect under-states ((obj under-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-states ((this under-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'under-states) - (format #t "~1Tflame0: #~%" (-> obj flame0)) - (format #t "~1Tflame1: #~%" (-> obj flame1)) - (format #t "~1Trot: ~f~%" (-> obj rot)) - (format #t "~1Trot2: ~f~%" (-> obj rot2)) - (format #t "~1Ttime: ~f~%" (-> obj time)) - (format #t "~1Tlaser: ~f~%" (-> obj laser)) - (format #t "~1Tfog-interp: ~f~%" (-> obj fog-interp)) - (format #t "~1Tflicker: ~f~%" (-> obj flicker)) + (format #t "[~8x] ~A~%" this 'under-states) + (format #t "~1Tflame0: #~%" (-> this flame0)) + (format #t "~1Tflame1: #~%" (-> this flame1)) + (format #t "~1Trot: ~f~%" (-> this rot)) + (format #t "~1Trot2: ~f~%" (-> this rot2)) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tlaser: ~f~%" (-> this laser)) + (format #t "~1Tfog-interp: ~f~%" (-> this fog-interp)) + (format #t "~1Tflicker: ~f~%" (-> this flicker)) (label cfg-4) - obj + this ) ;; definition for function update-under-lights @@ -2596,15 +2596,15 @@ ) ;; definition for method 3 of type gungame-states -(defmethod inspect gungame-states ((obj gungame-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect gungame-states ((this gungame-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gungame-states) - (format #t "~1Tflorescent: #~%" (-> obj florescent)) + (format #t "[~8x] ~A~%" this 'gungame-states) + (format #t "~1Tflorescent: #~%" (-> this florescent)) (label cfg-4) - obj + this ) ;; definition for function update-gungame-lights @@ -2655,18 +2655,18 @@ ) ;; definition for method 3 of type dig1-states -(defmethod inspect dig1-states ((obj dig1-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig1-states ((this dig1-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dig1-states) - (format #t "~1Tpulse0: #~%" (-> obj pulse0)) - (format #t "~1Tpulse1: #~%" (-> obj pulse1)) - (format #t "~1Texplosion: ~f~%" (-> obj explosion)) - (format #t "~1Tdrillbit: ~f~%" (-> obj drillbit)) + (format #t "[~8x] ~A~%" this 'dig1-states) + (format #t "~1Tpulse0: #~%" (-> this pulse0)) + (format #t "~1Tpulse1: #~%" (-> this pulse1)) + (format #t "~1Texplosion: ~f~%" (-> this explosion)) + (format #t "~1Tdrillbit: ~f~%" (-> this drillbit)) (label cfg-4) - obj + this ) ;; definition for function init-mood-dig1 @@ -2917,24 +2917,24 @@ ) ;; definition for method 3 of type vortex-states -(defmethod inspect vortex-states ((obj vortex-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect vortex-states ((this vortex-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vortex-states) - (format #t "~1Ttime: ~f~%" (-> obj time)) - (format #t "~1Tlevel: ~f~%" (-> obj level)) - (format #t "~1Tdelta: ~f~%" (-> obj delta)) - (format #t "~1Tscale: ~f~%" (-> obj scale)) - (format #t "~1Tflash: ~f~%" (-> obj flash)) - (format #t "~1Tnum: ~D~%" (-> obj num)) - (format #t "~1Twhite: ~A~%" (-> obj white)) - (format #t "~1Twhite-count: ~f~%" (-> obj white-count)) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tdir: #~%" (-> obj dir)) + (format #t "[~8x] ~A~%" this 'vortex-states) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tlevel: ~f~%" (-> this level)) + (format #t "~1Tdelta: ~f~%" (-> this delta)) + (format #t "~1Tscale: ~f~%" (-> this scale)) + (format #t "~1Tflash: ~f~%" (-> this flash)) + (format #t "~1Tnum: ~D~%" (-> this num)) + (format #t "~1Twhite: ~A~%" (-> this white)) + (format #t "~1Twhite-count: ~f~%" (-> this white-count)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tdir: #~%" (-> this dir)) (label cfg-4) - obj + this ) ;; definition for function update-vortex-lights @@ -3096,18 +3096,18 @@ ) ;; definition for method 3 of type nestb-states -(defmethod inspect nestb-states ((obj nestb-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect nestb-states ((this nestb-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nestb-states) - (format #t "~1Tpulse: #~%" (-> obj pulse)) - (format #t "~1Trot: ~f~%" (-> obj rot)) - (format #t "~1Tpurple: ~f~%" (-> obj purple)) - (format #t "~1Tpurple-noise: ~f~%" (-> obj purple-noise)) + (format #t "[~8x] ~A~%" this 'nestb-states) + (format #t "~1Tpulse: #~%" (-> this pulse)) + (format #t "~1Trot: ~f~%" (-> this rot)) + (format #t "~1Tpurple: ~f~%" (-> this purple)) + (format #t "~1Tpurple-noise: ~f~%" (-> this purple-noise)) (label cfg-4) - obj + this ) ;; definition for function update-nestb-lights @@ -3191,17 +3191,17 @@ ) ;; definition for method 3 of type consiteb-states -(defmethod inspect consiteb-states ((obj consiteb-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect consiteb-states ((this consiteb-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'consiteb-states) - (format #t "~1Tflicker: ~f~%" (-> obj flicker)) - (format #t "~1Tflicker-count: ~f~%" (-> obj flicker-count)) - (format #t "~1Tflicker-state: ~D~%" (-> obj flicker-state)) + (format #t "[~8x] ~A~%" this 'consiteb-states) + (format #t "~1Tflicker: ~f~%" (-> this flicker)) + (format #t "~1Tflicker-count: ~f~%" (-> this flicker-count)) + (format #t "~1Tflicker-state: ~D~%" (-> this flicker-state)) (label cfg-4) - obj + this ) ;; definition for function init-mood-consiteb @@ -3283,18 +3283,18 @@ ) ;; definition for method 3 of type castle-states -(defmethod inspect castle-states ((obj castle-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect castle-states ((this castle-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'castle-states) - (format #t "~1Telectricity: #~%" (-> obj electricity)) - (format #t "~1Tpulse[2] @ #x~X~%" (-> obj pulse)) - (format #t "~1Trot: ~f~%" (-> obj rot)) - (format #t "~1Trobot-rot: ~f~%" (-> obj robot-rot)) + (format #t "[~8x] ~A~%" this 'castle-states) + (format #t "~1Telectricity: #~%" (-> this electricity)) + (format #t "~1Tpulse[2] @ #x~X~%" (-> this pulse)) + (format #t "~1Trot: ~f~%" (-> this rot)) + (format #t "~1Trobot-rot: ~f~%" (-> this robot-rot)) (label cfg-4) - obj + this ) ;; definition for function update-castle-lights @@ -3441,14 +3441,14 @@ ) ;; definition for method 3 of type garage-states -(defmethod inspect garage-states ((obj garage-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect garage-states ((this garage-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'garage-states) + (format #t "[~8x] ~A~%" this 'garage-states) (label cfg-4) - obj + this ) ;; definition for function init-mood-garage @@ -3521,14 +3521,14 @@ ) ;; definition for method 3 of type palshaft-states -(defmethod inspect palshaft-states ((obj palshaft-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect palshaft-states ((this palshaft-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'palshaft-states) + (format #t "[~8x] ~A~%" this 'palshaft-states) (label cfg-4) - obj + this ) ;; definition for function update-mood-palshaft diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc index 4ec95aee66..2f24f7ddaa 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc @@ -34,17 +34,17 @@ ) ;; definition for method 3 of type ruins-states -(defmethod inspect ruins-states ((obj ruins-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruins-states ((this ruins-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ruins-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tspec-0: #~%" (-> obj spec-0)) - (format #t "~1Tspec-1: #~%" (-> obj spec-1)) + (format #t "[~8x] ~A~%" this 'ruins-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) (label cfg-4) - obj + this ) ;; definition for function init-mood-ruins @@ -107,18 +107,18 @@ ) ;; definition for method 3 of type strip-states -(defmethod inspect strip-states ((obj strip-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect strip-states ((this strip-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'strip-states) - (format #t "~1Tlight0: #~%" (-> obj light0)) - (format #t "~1Tlight1: #~%" (-> obj light1)) - (format #t "~1Tspec-0: #~%" (-> obj spec-0)) - (format #t "~1Tspec-1: #~%" (-> obj spec-1)) + (format #t "[~8x] ~A~%" this 'strip-states) + (format #t "~1Tlight0: #~%" (-> this light0)) + (format #t "~1Tlight1: #~%" (-> this light1)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) (label cfg-4) - obj + this ) ;; definition for function init-mood-strip @@ -187,16 +187,16 @@ ) ;; definition for method 3 of type ctywide-states -(defmethod inspect ctywide-states ((obj ctywide-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctywide-states ((this ctywide-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ctywide-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tflame: #~%" (-> obj flame)) + (format #t "[~8x] ~A~%" this 'ctywide-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflame: #~%" (-> this flame)) (label cfg-4) - obj + this ) ;; definition for function update-mood-ctywide @@ -244,15 +244,15 @@ ) ;; definition for method 3 of type ctyind-states -(defmethod inspect ctyind-states ((obj ctyind-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyind-states ((this ctyind-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ctyind-states) - (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "[~8x] ~A~%" this 'ctyind-states) + (format #t "~1Tlight: #~%" (-> this light)) (label cfg-4) - obj + this ) ;; definition for function update-mood-ctyind @@ -301,20 +301,20 @@ ) ;; definition for method 3 of type ctysluma-states -(defmethod inspect ctysluma-states ((obj ctysluma-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctysluma-states ((this ctysluma-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ctysluma-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tneon: #~%" (-> obj neon)) - (format #t "~1Tflame: #~%" (-> obj flame)) - (format #t "~1Tspec-0: #~%" (-> obj spec-0)) - (format #t "~1Tspec-1: #~%" (-> obj spec-1)) - (format #t "~1Tneon-min-bright: ~f~%" (-> obj neon-min-bright)) + (format #t "[~8x] ~A~%" this 'ctysluma-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tneon: #~%" (-> this neon)) + (format #t "~1Tflame: #~%" (-> this flame)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) + (format #t "~1Tneon-min-bright: ~f~%" (-> this neon-min-bright)) (label cfg-4) - obj + this ) ;; definition for function init-mood-ctysluma @@ -378,18 +378,18 @@ ) ;; definition for method 3 of type ctyslumb-states -(defmethod inspect ctyslumb-states ((obj ctyslumb-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyslumb-states ((this ctyslumb-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ctyslumb-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tflame: #~%" (-> obj flame)) - (format #t "~1Tspec-0: #~%" (-> obj spec-0)) - (format #t "~1Tspec-1: #~%" (-> obj spec-1)) + (format #t "[~8x] ~A~%" this 'ctyslumb-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflame: #~%" (-> this flame)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) (label cfg-4) - obj + this ) ;; definition for function init-mood-ctyslumb @@ -452,17 +452,17 @@ ) ;; definition for method 3 of type ctyslumc-states -(defmethod inspect ctyslumc-states ((obj ctyslumc-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyslumc-states ((this ctyslumc-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ctyslumc-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tspec-0: #~%" (-> obj spec-0)) - (format #t "~1Tspec-1: #~%" (-> obj spec-1)) + (format #t "[~8x] ~A~%" this 'ctyslumc-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) (label cfg-4) - obj + this ) ;; definition for function init-mood-ctyslumc @@ -520,17 +520,17 @@ ) ;; definition for method 3 of type ctyport-states -(defmethod inspect ctyport-states ((obj ctyport-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyport-states ((this ctyport-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ctyport-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tspec-0: #~%" (-> obj spec-0)) - (format #t "~1Tneon-min-bright: ~f~%" (-> obj neon-min-bright)) + (format #t "[~8x] ~A~%" this 'ctyport-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tneon-min-bright: ~f~%" (-> this neon-min-bright)) (label cfg-4) - obj + this ) ;; definition for function init-mood-ctyport @@ -601,16 +601,16 @@ ) ;; definition for method 3 of type ctymarka-states -(defmethod inspect ctymarka-states ((obj ctymarka-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctymarka-states ((this ctymarka-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ctymarka-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tblink: ~f~%" (-> obj blink)) + (format #t "[~8x] ~A~%" this 'ctymarka-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tblink: ~f~%" (-> this blink)) (label cfg-4) - obj + this ) ;; definition for function update-mood-ctymarka @@ -649,16 +649,16 @@ ) ;; definition for method 3 of type ctymarkb-states -(defmethod inspect ctymarkb-states ((obj ctymarkb-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctymarkb-states ((this ctymarkb-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ctymarkb-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tblink: ~f~%" (-> obj blink)) + (format #t "[~8x] ~A~%" this 'ctymarkb-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tblink: ~f~%" (-> this blink)) (label cfg-4) - obj + this ) ;; definition for function update-mood-ctymarkb @@ -708,17 +708,17 @@ ) ;; definition for method 3 of type palcab-states -(defmethod inspect palcab-states ((obj palcab-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect palcab-states ((this palcab-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'palcab-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tturret-value: ~f~%" (-> obj turret-value)) - (format #t "~1Telectricity: #~%" (-> obj electricity)) + (format #t "[~8x] ~A~%" this 'palcab-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tturret-value: ~f~%" (-> this turret-value)) + (format #t "~1Telectricity: #~%" (-> this electricity)) (label cfg-4) - obj + this ) ;; definition for function init-mood-palcab @@ -784,16 +784,16 @@ ) ;; definition for method 3 of type stadium-states -(defmethod inspect stadium-states ((obj stadium-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect stadium-states ((this stadium-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'stadium-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tflame: #~%" (-> obj flame)) + (format #t "[~8x] ~A~%" this 'stadium-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflame: #~%" (-> this flame)) (label cfg-4) - obj + this ) ;; definition for function update-stadium-lights @@ -861,17 +861,17 @@ ) ;; definition for method 3 of type stadiumb-states -(defmethod inspect stadiumb-states ((obj stadiumb-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect stadiumb-states ((this stadiumb-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'stadiumb-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tshield-count: ~f~%" (-> obj shield-count)) - (format #t "~1Tshield: ~f~%" (-> obj shield)) + (format #t "[~8x] ~A~%" this 'stadiumb-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tshield-count: ~f~%" (-> this shield-count)) + (format #t "~1Tshield: ~f~%" (-> this shield)) (label cfg-4) - obj + this ) ;; definition for function update-stadiumb-lights @@ -922,16 +922,16 @@ ) ;; definition for method 3 of type skatea-states -(defmethod inspect skatea-states ((obj skatea-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect skatea-states ((this skatea-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'skatea-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tflame: #~%" (-> obj flame)) + (format #t "[~8x] ~A~%" this 'skatea-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflame: #~%" (-> this flame)) (label cfg-4) - obj + this ) ;; definition for function update-mood-skatea @@ -962,17 +962,17 @@ ) ;; definition for method 3 of type ltentout-states -(defmethod inspect ltentout-states ((obj ltentout-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect ltentout-states ((this ltentout-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ltentout-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tflame: #~%" (-> obj flame)) - (format #t "~1Ttotem: #~%" (-> obj totem)) + (format #t "[~8x] ~A~%" this 'ltentout-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflame: #~%" (-> this flame)) + (format #t "~1Ttotem: #~%" (-> this totem)) (label cfg-4) - obj + this ) ;; definition for function update-ltentout-lights @@ -1021,23 +1021,23 @@ ) ;; definition for method 3 of type mountain-states -(defmethod inspect mountain-states ((obj mountain-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect mountain-states ((this mountain-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mountain-states) - (format #t "~1Tlight0: #~%" (-> obj light0)) - (format #t "~1Tlight1: #~%" (-> obj light1)) - (format #t "~1Tspec-0: #~%" (-> obj spec-0)) - (format #t "~1Tspec-1: #~%" (-> obj spec-1)) - (format #t "~1Tspec-2: #~%" (-> obj spec-2)) - (format #t "~1Tspec-3: #~%" (-> obj spec-3)) - (format #t "~1Tspec-4: #~%" (-> obj spec-4)) - (format #t "~1Tspec-5: #~%" (-> obj spec-5)) - (format #t "~1Tspec-6: #~%" (-> obj spec-6)) + (format #t "[~8x] ~A~%" this 'mountain-states) + (format #t "~1Tlight0: #~%" (-> this light0)) + (format #t "~1Tlight1: #~%" (-> this light1)) + (format #t "~1Tspec-0: #~%" (-> this spec-0)) + (format #t "~1Tspec-1: #~%" (-> this spec-1)) + (format #t "~1Tspec-2: #~%" (-> this spec-2)) + (format #t "~1Tspec-3: #~%" (-> this spec-3)) + (format #t "~1Tspec-4: #~%" (-> this spec-4)) + (format #t "~1Tspec-5: #~%" (-> this spec-5)) + (format #t "~1Tspec-6: #~%" (-> this spec-6)) (label cfg-4) - obj + this ) ;; definition for function init-mood-mountain @@ -1153,15 +1153,15 @@ ) ;; definition for method 3 of type forest-states -(defmethod inspect forest-states ((obj forest-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect forest-states ((this forest-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'forest-states) - (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "[~8x] ~A~%" this 'forest-states) + (format #t "~1Tlight: #~%" (-> this light)) (label cfg-4) - obj + this ) ;; definition for function update-mood-forest @@ -1189,16 +1189,16 @@ ) ;; definition for method 3 of type atoll-states -(defmethod inspect atoll-states ((obj atoll-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect atoll-states ((this atoll-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'atoll-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Texplosion: ~f~%" (-> obj explosion)) + (format #t "[~8x] ~A~%" this 'atoll-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Texplosion: ~f~%" (-> this explosion)) (label cfg-4) - obj + this ) ;; definition for function init-mood-atoll @@ -1273,21 +1273,21 @@ ) ;; definition for method 3 of type drill-states -(defmethod inspect drill-states ((obj drill-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-states ((this drill-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'drill-states) - (format #t "~1Tfire-floor: ~f~%" (-> obj fire-floor)) - (format #t "~1Tfire-floor-fade: ~f~%" (-> obj fire-floor-fade)) - (format #t "~1Tfire-floor-flag: ~A~%" (-> obj fire-floor-flag)) - (format #t "~1Tflame: #~%" (-> obj flame)) - (format #t "~1Telectricity[2] @ #x~X~%" (-> obj electricity)) - (format #t "~1Tpulse: #~%" (-> obj pulse)) - (format #t "~1Tlight-flag: ~A~%" (-> obj light-flag)) + (format #t "[~8x] ~A~%" this 'drill-states) + (format #t "~1Tfire-floor: ~f~%" (-> this fire-floor)) + (format #t "~1Tfire-floor-fade: ~f~%" (-> this fire-floor-fade)) + (format #t "~1Tfire-floor-flag: ~A~%" (-> this fire-floor-flag)) + (format #t "~1Tflame: #~%" (-> this flame)) + (format #t "~1Telectricity[2] @ #x~X~%" (-> this electricity)) + (format #t "~1Tpulse: #~%" (-> this pulse)) + (format #t "~1Tlight-flag: ~A~%" (-> this light-flag)) (label cfg-4) - obj + this ) ;; definition for function init-mood-drill @@ -1422,19 +1422,19 @@ ) ;; definition for method 3 of type drillb-states -(defmethod inspect drillb-states ((obj drillb-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect drillb-states ((this drillb-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'drillb-states) - (format #t "~1Tfire-floor: ~f~%" (-> obj fire-floor)) - (format #t "~1Tfire-floor-fade: ~f~%" (-> obj fire-floor-fade)) - (format #t "~1Tfire-floor-flag: ~A~%" (-> obj fire-floor-flag)) - (format #t "~1Tpulse: #~%" (-> obj pulse)) - (format #t "~1Tlight-flag: ~A~%" (-> obj light-flag)) + (format #t "[~8x] ~A~%" this 'drillb-states) + (format #t "~1Tfire-floor: ~f~%" (-> this fire-floor)) + (format #t "~1Tfire-floor-fade: ~f~%" (-> this fire-floor-fade)) + (format #t "~1Tfire-floor-flag: ~A~%" (-> this fire-floor-flag)) + (format #t "~1Tpulse: #~%" (-> this pulse)) + (format #t "~1Tlight-flag: ~A~%" (-> this light-flag)) (label cfg-4) - obj + this ) ;; definition for function init-mood-drillb @@ -1488,16 +1488,16 @@ ) ;; definition for method 3 of type casboss-states -(defmethod inspect casboss-states ((obj casboss-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect casboss-states ((this casboss-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'casboss-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Texplosion: ~f~%" (-> obj explosion)) + (format #t "[~8x] ~A~%" this 'casboss-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Texplosion: ~f~%" (-> this explosion)) (label cfg-4) - obj + this ) ;; definition for function update-casboss-lights @@ -1585,18 +1585,18 @@ ) ;; definition for method 3 of type caspad-states -(defmethod inspect caspad-states ((obj caspad-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect caspad-states ((this caspad-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'caspad-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tred: ~f~%" (-> obj red)) - (format #t "~1Twhite: ~f~%" (-> obj white)) - (format #t "~1Twhite-count: ~D~%" (-> obj white-count)) + (format #t "[~8x] ~A~%" this 'caspad-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tred: ~f~%" (-> this red)) + (format #t "~1Twhite: ~f~%" (-> this white)) + (format #t "~1Twhite-count: ~D~%" (-> this white-count)) (label cfg-4) - obj + this ) ;; definition for function update-mood-caspad @@ -1640,16 +1640,16 @@ ) ;; definition for method 3 of type palout-states -(defmethod inspect palout-states ((obj palout-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect palout-states ((this palout-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'palout-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tflame: #~%" (-> obj flame)) + (format #t "[~8x] ~A~%" this 'palout-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflame: #~%" (-> this flame)) (label cfg-4) - obj + this ) ;; definition for function init-mood-palout @@ -1693,15 +1693,15 @@ ) ;; definition for method 3 of type palroof-states -(defmethod inspect palroof-states ((obj palroof-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect palroof-states ((this palroof-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'palroof-states) - (format #t "~1Telectricity[2] @ #x~X~%" (-> obj electricity)) + (format #t "[~8x] ~A~%" this 'palroof-states) + (format #t "~1Telectricity[2] @ #x~X~%" (-> this electricity)) (label cfg-4) - obj + this ) ;; definition for function init-mood-palroof @@ -1750,16 +1750,16 @@ ) ;; definition for method 3 of type palent-states -(defmethod inspect palent-states ((obj palent-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect palent-states ((this palent-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'palent-states) - (format #t "~1Tflame: #~%" (-> obj flame)) - (format #t "~1Tturret-value: ~f~%" (-> obj turret-value)) + (format #t "[~8x] ~A~%" this 'palent-states) + (format #t "~1Tflame: #~%" (-> this flame)) + (format #t "~1Tturret-value: ~f~%" (-> this turret-value)) (label cfg-4) - obj + this ) ;; definition for function update-mood-palent @@ -1806,18 +1806,18 @@ ) ;; definition for method 3 of type nest-states -(defmethod inspect nest-states ((obj nest-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect nest-states ((this nest-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nest-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tgreen-flag: ~A~%" (-> obj green-flag)) - (format #t "~1Tgreen: ~f~%" (-> obj green)) - (format #t "~1Tgreen-noise: ~f~%" (-> obj green-noise)) + (format #t "[~8x] ~A~%" this 'nest-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tgreen-flag: ~A~%" (-> this green-flag)) + (format #t "~1Tgreen: ~f~%" (-> this green)) + (format #t "~1Tgreen-noise: ~f~%" (-> this green-noise)) (label cfg-4) - obj + this ) ;; definition for function init-mood-nest @@ -1885,16 +1885,16 @@ ) ;; definition for method 3 of type village1-states -(defmethod inspect village1-states ((obj village1-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect village1-states ((this village1-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'village1-states) - (format #t "~1Tinterp: ~f~%" (-> obj interp)) - (format #t "~1Tinterp-flag: ~A~%" (-> obj interp-flag)) + (format #t "[~8x] ~A~%" this 'village1-states) + (format #t "~1Tinterp: ~f~%" (-> this interp)) + (format #t "~1Tinterp-flag: ~A~%" (-> this interp-flag)) (label cfg-4) - obj + this ) ;; definition for function init-mood-village1 @@ -1993,16 +1993,16 @@ ) ;; definition for method 3 of type consite-states -(defmethod inspect consite-states ((obj consite-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect consite-states ((this consite-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'consite-states) - (format #t "~1Tlight: #~%" (-> obj light)) - (format #t "~1Tflash: ~f~%" (-> obj flash)) + (format #t "[~8x] ~A~%" this 'consite-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tflash: ~f~%" (-> this flash)) (label cfg-4) - obj + this ) ;; definition for function update-mood-consite @@ -2061,15 +2061,15 @@ ) ;; definition for method 3 of type mincan-states -(defmethod inspect mincan-states ((obj mincan-states)) - (when (not obj) - (set! obj obj) +(defmethod inspect mincan-states ((this mincan-states)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mincan-states) - (format #t "~1Tbeams[2] @ #x~X~%" (-> obj beams)) + (format #t "[~8x] ~A~%" this 'mincan-states) + (format #t "~1Tbeams[2] @ #x~X~%" (-> this beams)) (label cfg-4) - obj + this ) ;; definition for function update-mood-mincan diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc index 04dd1639f7..cd67ee101f 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type mood-channel -(defmethod inspect mood-channel ((obj mood-channel)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-channel ((this mood-channel)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-channel) - (format #t "~1Tdata[24] @ #x~X~%" (-> obj vecs)) - (format #t "~1Tvecs[6] @ #x~X~%" (-> obj vecs)) + (format #t "[~8x] ~A~%" this 'mood-channel) + (format #t "~1Tdata[24] @ #x~X~%" (-> this vecs)) + (format #t "~1Tvecs[6] @ #x~X~%" (-> this vecs)) (label cfg-4) - obj + this ) ;; definition of type mood-channel-group @@ -34,15 +34,15 @@ ) ;; definition for method 3 of type mood-channel-group -(defmethod inspect mood-channel-group ((obj mood-channel-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-channel-group ((this mood-channel-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-channel-group) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'mood-channel-group) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type mood-fog @@ -61,21 +61,21 @@ ) ;; definition for method 3 of type mood-fog -(defmethod inspect mood-fog ((obj mood-fog)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-fog ((this mood-fog)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-fog) - (format #t "~1Tfog-color: #~%" (-> obj fog-color)) - (format #t "~1Tfog-dists: #~%" (-> obj fog-dists)) - (format #t "~1Tfog-start: (meters ~m)~%" (-> obj fog-dists x)) - (format #t "~1Tfog-end: (meters ~m)~%" (-> obj fog-dists y)) - (format #t "~1Tfog-max: ~f~%" (-> obj fog-dists z)) - (format #t "~1Tfog-min: ~f~%" (-> obj fog-dists w)) - (format #t "~1Terase-color: #~%" (-> obj erase-color)) + (format #t "[~8x] ~A~%" this 'mood-fog) + (format #t "~1Tfog-color: #~%" (-> this fog-color)) + (format #t "~1Tfog-dists: #~%" (-> this fog-dists)) + (format #t "~1Tfog-start: (meters ~m)~%" (-> this fog-dists x)) + (format #t "~1Tfog-end: (meters ~m)~%" (-> this fog-dists y)) + (format #t "~1Tfog-max: ~f~%" (-> this fog-dists z)) + (format #t "~1Tfog-min: ~f~%" (-> this fog-dists w)) + (format #t "~1Terase-color: #~%" (-> this erase-color)) (label cfg-4) - obj + this ) ;; definition of type mood-fog-table @@ -89,15 +89,15 @@ ) ;; definition for method 3 of type mood-fog-table -(defmethod inspect mood-fog-table ((obj mood-fog-table)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-fog-table ((this mood-fog-table)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-fog-table) - (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'mood-fog-table) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type mood-color @@ -111,16 +111,16 @@ ) ;; definition for method 3 of type mood-color -(defmethod inspect mood-color ((obj mood-color)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-color ((this mood-color)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-color) - (format #t "~1Tlgt-color: #~%" (-> obj lgt-color)) - (format #t "~1Tamb-color: #~%" (-> obj amb-color)) + (format #t "[~8x] ~A~%" this 'mood-color) + (format #t "~1Tlgt-color: #~%" (-> this lgt-color)) + (format #t "~1Tamb-color: #~%" (-> this amb-color)) (label cfg-4) - obj + this ) ;; definition of type mood-direction-table @@ -133,15 +133,15 @@ ) ;; definition for method 3 of type mood-direction-table -(defmethod inspect mood-direction-table ((obj mood-direction-table)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-direction-table ((this mood-direction-table)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-direction-table) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'mood-direction-table) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type mood-color-table @@ -155,15 +155,15 @@ ) ;; definition for method 3 of type mood-color-table -(defmethod inspect mood-color-table ((obj mood-color-table)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-color-table ((this mood-color-table)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-color-table) - (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'mood-color-table) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type mood-sky-table @@ -176,15 +176,15 @@ ) ;; definition for method 3 of type mood-sky-table -(defmethod inspect mood-sky-table ((obj mood-sky-table)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-sky-table ((this mood-sky-table)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-sky-table) - (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'mood-sky-table) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type mood-clouds @@ -198,16 +198,16 @@ ) ;; definition for method 3 of type mood-clouds -(defmethod inspect mood-clouds ((obj mood-clouds)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-clouds ((this mood-clouds)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-clouds) - (format #t "~1Tcloud-min: ~f~%" (-> obj cloud-min)) - (format #t "~1Tcloud-max: ~f~%" (-> obj cloud-max)) + (format #t "[~8x] ~A~%" this 'mood-clouds) + (format #t "~1Tcloud-min: ~f~%" (-> this cloud-min)) + (format #t "~1Tcloud-max: ~f~%" (-> this cloud-max)) (label cfg-4) - obj + this ) ;; definition of type mood-weather @@ -224,17 +224,17 @@ ) ;; definition for method 3 of type mood-weather -(defmethod inspect mood-weather ((obj mood-weather)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-weather ((this mood-weather)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-weather) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tcloud: ~f~%" (-> obj cloud)) - (format #t "~1Tfog: ~f~%" (-> obj fog)) + (format #t "[~8x] ~A~%" this 'mood-weather) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~1Tcloud: ~f~%" (-> this cloud)) + (format #t "~1Tfog: ~f~%" (-> this fog)) (label cfg-4) - obj + this ) ;; definition of type mood-iweather @@ -250,17 +250,17 @@ ) ;; definition for method 3 of type mood-iweather -(defmethod inspect mood-iweather ((obj mood-iweather)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-iweather ((this mood-iweather)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-iweather) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tcloud: ~D~%" (-> obj cloud)) - (format #t "~1Tfog: ~D~%" (-> obj fog)) + (format #t "[~8x] ~A~%" this 'mood-iweather) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~1Tcloud: ~D~%" (-> this cloud)) + (format #t "~1Tfog: ~D~%" (-> this fog)) (label cfg-4) - obj + this ) ;; definition of type mood-range @@ -279,20 +279,20 @@ ;; definition for method 3 of type mood-range ;; INFO: Used lq/sq -(defmethod inspect mood-range ((obj mood-range)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-range ((this mood-range)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-range) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~1Tmin-cloud: ~f~%" (-> obj min-cloud)) - (format #t "~1Tmax-cloud: ~f~%" (-> obj max-cloud)) - (format #t "~1Tmin-fog: ~f~%" (-> obj min-fog)) - (format #t "~1Tmax-fog: ~f~%" (-> obj max-fog)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'mood-range) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~1Tmin-cloud: ~f~%" (-> this min-cloud)) + (format #t "~1Tmax-cloud: ~f~%" (-> this max-cloud)) + (format #t "~1Tmin-fog: ~f~%" (-> this min-fog)) + (format #t "~1Tmax-fog: ~f~%" (-> this max-fog)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type mood-filters-table @@ -305,15 +305,15 @@ ) ;; definition for method 3 of type mood-filters-table -(defmethod inspect mood-filters-table ((obj mood-filters-table)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-filters-table ((this mood-filters-table)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-filters-table) - (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'mood-filters-table) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type mood-table @@ -331,20 +331,20 @@ ) ;; definition for method 3 of type mood-table -(defmethod inspect mood-table ((obj mood-table)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-table ((this mood-table)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmood-fog-table: #~%" (-> obj mood-fog-table)) - (format #t "~1Tmood-color-table: #~%" (-> obj mood-color-table)) - (format #t "~1Tmood-channel-group: #~%" (-> obj mood-channel-group)) - (format #t "~1Tmood-direction-table: #~%" (-> obj mood-direction-table)) - (format #t "~1Tmood-sky-table: #~%" (-> obj mood-sky-table)) - (format #t "~1Tmood-interp-table: ~A~%" (-> obj mood-interp-table)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmood-fog-table: #~%" (-> this mood-fog-table)) + (format #t "~1Tmood-color-table: #~%" (-> this mood-color-table)) + (format #t "~1Tmood-channel-group: #~%" (-> this mood-channel-group)) + (format #t "~1Tmood-direction-table: #~%" (-> this mood-direction-table)) + (format #t "~1Tmood-sky-table: #~%" (-> this mood-sky-table)) + (format #t "~1Tmood-interp-table: ~A~%" (-> this mood-interp-table)) (label cfg-4) - obj + this ) ;; definition of type mood-context-core @@ -361,19 +361,19 @@ ) ;; definition for method 3 of type mood-context-core -(defmethod inspect mood-context-core ((obj mood-context-core)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-context-core ((this mood-context-core)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-context-core) - (format #t "~1Tcurrent-fog: #~%" (-> obj current-fog)) - (format #t "~1Tcurrent-sky-color: #~%" (-> obj current-sky-color)) - (format #t "~1Tcurrent-env-color: #~%" (-> obj current-env-color)) - (format #t "~1Tcurrent-prt-color: #~%" (-> obj current-prt-color)) - (format #t "~1Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) + (format #t "[~8x] ~A~%" this 'mood-context-core) + (format #t "~1Tcurrent-fog: #~%" (-> this current-fog)) + (format #t "~1Tcurrent-sky-color: #~%" (-> this current-sky-color)) + (format #t "~1Tcurrent-env-color: #~%" (-> this current-env-color)) + (format #t "~1Tcurrent-prt-color: #~%" (-> this current-prt-color)) + (format #t "~1Tcurrent-shadow-color: #~%" (-> this current-shadow-color)) (label cfg-4) - obj + this ) ;; definition of type mood-context-core2 @@ -386,20 +386,20 @@ ) ;; definition for method 3 of type mood-context-core2 -(defmethod inspect mood-context-core2 ((obj mood-context-core2)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-context-core2 ((this mood-context-core2)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-context-core2) - (format #t "~1Tcurrent-fog: #~%" (-> obj current-fog)) - (format #t "~1Tcurrent-sky-color: #~%" (-> obj current-sky-color)) - (format #t "~1Tcurrent-env-color: #~%" (-> obj current-env-color)) - (format #t "~1Tcurrent-prt-color: #~%" (-> obj current-prt-color)) - (format #t "~1Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) - (format #t "~1Tlight-group[8] @ #x~X~%" (-> obj light-group)) + (format #t "[~8x] ~A~%" this 'mood-context-core2) + (format #t "~1Tcurrent-fog: #~%" (-> this current-fog)) + (format #t "~1Tcurrent-sky-color: #~%" (-> this current-sky-color)) + (format #t "~1Tcurrent-env-color: #~%" (-> this current-env-color)) + (format #t "~1Tcurrent-prt-color: #~%" (-> this current-prt-color)) + (format #t "~1Tcurrent-shadow-color: #~%" (-> this current-shadow-color)) + (format #t "~1Tlight-group[8] @ #x~X~%" (-> this light-group)) (label cfg-4) - obj + this ) ;; definition of type mood-context-core3 @@ -412,21 +412,21 @@ ) ;; definition for method 3 of type mood-context-core3 -(defmethod inspect mood-context-core3 ((obj mood-context-core3)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-context-core3 ((this mood-context-core3)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-context-core3) - (format #t "~1Tcurrent-fog: #~%" (-> obj current-fog)) - (format #t "~1Tcurrent-sky-color: #~%" (-> obj current-sky-color)) - (format #t "~1Tcurrent-env-color: #~%" (-> obj current-env-color)) - (format #t "~1Tcurrent-prt-color: #~%" (-> obj current-prt-color)) - (format #t "~1Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) - (format #t "~1Tlight-group[8] @ #x~X~%" (-> obj light-group)) - (format #t "~1Ttimes[8] @ #x~X~%" (-> obj times)) + (format #t "[~8x] ~A~%" this 'mood-context-core3) + (format #t "~1Tcurrent-fog: #~%" (-> this current-fog)) + (format #t "~1Tcurrent-sky-color: #~%" (-> this current-sky-color)) + (format #t "~1Tcurrent-env-color: #~%" (-> this current-env-color)) + (format #t "~1Tcurrent-prt-color: #~%" (-> this current-prt-color)) + (format #t "~1Tcurrent-shadow-color: #~%" (-> this current-shadow-color)) + (format #t "~1Tlight-group[8] @ #x~X~%" (-> this light-group)) + (format #t "~1Ttimes[8] @ #x~X~%" (-> this times)) (label cfg-4) - obj + this ) ;; definition of type mood-context @@ -443,23 +443,23 @@ when updating the mood. This means that an individual state structure must be l ) ;; definition for method 3 of type mood-context -(defmethod inspect mood-context ((obj mood-context)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-context ((this mood-context)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-context) - (format #t "~1Tcurrent-fog: #~%" (-> obj current-fog)) - (format #t "~1Tcurrent-sky-color: #~%" (-> obj current-sky-color)) - (format #t "~1Tcurrent-env-color: #~%" (-> obj current-env-color)) - (format #t "~1Tcurrent-prt-color: #~%" (-> obj current-prt-color)) - (format #t "~1Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) - (format #t "~1Tlight-group[8] @ #x~X~%" (-> obj light-group)) - (format #t "~1Ttimes[8] @ #x~X~%" (-> obj times)) - (format #t "~1Titimes[4] @ #x~X~%" (-> obj itimes)) - (format #t "~1Tstate[32] @ #x~X~%" (-> obj state)) + (format #t "[~8x] ~A~%" this 'mood-context) + (format #t "~1Tcurrent-fog: #~%" (-> this current-fog)) + (format #t "~1Tcurrent-sky-color: #~%" (-> this current-sky-color)) + (format #t "~1Tcurrent-env-color: #~%" (-> this current-env-color)) + (format #t "~1Tcurrent-prt-color: #~%" (-> this current-prt-color)) + (format #t "~1Tcurrent-shadow-color: #~%" (-> this current-shadow-color)) + (format #t "~1Tlight-group[8] @ #x~X~%" (-> this light-group)) + (format #t "~1Ttimes[8] @ #x~X~%" (-> this times)) + (format #t "~1Titimes[4] @ #x~X~%" (-> this itimes)) + (format #t "~1Tstate[32] @ #x~X~%" (-> this state)) (label cfg-4) - obj + this ) ;; definition of type mood-control-work @@ -481,24 +481,24 @@ when updating the mood. This means that an individual state structure must be l ) ;; definition for method 3 of type mood-control-work -(defmethod inspect mood-control-work ((obj mood-control-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-control-work ((this mood-control-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mood-control-work) - (format #t "~1Tweather: #~%" (-> obj weather)) - (format #t "~1Tiweather: #~%" (-> obj iweather)) - (format #t "~1Tinterp: #~%" (-> obj interp)) - (format #t "~1Tindex[4] @ #x~X~%" (-> obj index)) - (format #t "~1Tcolor-interp: ~f~%" (-> obj color-interp)) - (format #t "~1Tcolor-index[2] @ #x~X~%" (-> obj color-index)) - (format #t "~1Tchannel-interp: ~f~%" (-> obj channel-interp)) - (format #t "~1Tchannel-index[2] @ #x~X~%" (-> obj channel-index)) - (format #t "~1Tcloud-interp: ~f~%" (-> obj cloud-interp)) - (format #t "~1Tcloud-index[2] @ #x~X~%" (-> obj cloud-index)) + (format #t "[~8x] ~A~%" this 'mood-control-work) + (format #t "~1Tweather: #~%" (-> this weather)) + (format #t "~1Tiweather: #~%" (-> this iweather)) + (format #t "~1Tinterp: #~%" (-> this interp)) + (format #t "~1Tindex[4] @ #x~X~%" (-> this index)) + (format #t "~1Tcolor-interp: ~f~%" (-> this color-interp)) + (format #t "~1Tcolor-index[2] @ #x~X~%" (-> this color-index)) + (format #t "~1Tchannel-interp: ~f~%" (-> this channel-interp)) + (format #t "~1Tchannel-index[2] @ #x~X~%" (-> this channel-index)) + (format #t "~1Tcloud-interp: ~f~%" (-> this cloud-interp)) + (format #t "~1Tcloud-index[2] @ #x~X~%" (-> this cloud-index)) (label cfg-4) - obj + this ) ;; definition of type mood-control @@ -548,46 +548,46 @@ when updating the mood. This means that an individual state structure must be l ) ;; definition for method 3 of type mood-control -(defmethod inspect mood-control ((obj mood-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect mood-control ((this mood-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmood-fog-table: #~%" (-> obj mood-fog-table)) - (format #t "~1Tmood-color-table: #~%" (-> obj mood-color-table)) - (format #t "~1Tmood-channel-group: #~%" (-> obj mood-channel-group)) - (format #t "~1Tmood-direction-table: #~%" (-> obj mood-direction-table)) - (format #t "~1Tmood-sky-table: #~%" (-> obj mood-sky-table)) - (format #t "~1Tmood-interp-table: ~A~%" (-> obj mood-interp-table)) - (format #t "~1Tmood-clouds: #~%" (-> obj mood-clouds)) - (format #t "~1Tcurrent-interp: #~%" (-> obj current-interp)) - (format #t "~1Ttarget-interp: #~%" (-> obj target-interp)) - (format #t "~1Tspeed-interp: #~%" (-> obj speed-interp)) - (format #t "~1Trange: #~%" (-> obj range)) - (format #t "~1Ttime-until-random: #~%" (-> obj time-until-random)) - (format #t "~1Ttime-until-random-min: #~%" (-> obj time-until-random-min)) - (format #t "~1Ttime-until-random-max: #~%" (-> obj time-until-random-max)) - (format #t "~1Tdisplay-flag: ~A~%" (-> obj display-flag)) - (format #t "~1Toveride-weather-flag: ~A~%" (-> obj overide-weather-flag)) - (format #t "~1Toveride: #~%" (-> obj overide)) - (format #t "~1Tlightning-index: ~D~%" (-> obj lightning-index)) - (format #t "~1Tlightning-val: ~D~%" (-> obj lightning-val)) - (format #t "~1Tlightning-time: ~D~%" (-> obj lightning-time)) - (format #t "~1Tlightning-time2: ~f~%" (-> obj lightning-time2)) - (format #t "~1Tlightning-flash: ~f~%" (-> obj lightning-flash)) - (format #t "~1Tlightning-id: ~D~%" (-> obj lightning-id)) - (format #t "~1Tlightning-count0: ~D~%" (-> obj lightning-count0)) - (format #t "~1Tlightning-count1: ~D~%" (-> obj lightning-count1)) - (format #t "~1Tlightning-count2: ~D~%" (-> obj lightning-count2)) - (format #t "~1Train-id: ~D~%" (-> obj rain-id)) - (format #t "~1Tsound-pitch: ~f~%" (-> obj sound-pitch)) - (format #t "~1Tfogs[9] @ #x~X~%" (-> obj fogs)) - (format #t "~1Tcolors[3] @ #x~X~%" (-> obj colors)) - (format #t "~1Tchannels[3] @ #x~X~%" (-> obj channels)) - (format #t "~1Tclouds[9] @ #x~X~%" (-> obj clouds)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmood-fog-table: #~%" (-> this mood-fog-table)) + (format #t "~1Tmood-color-table: #~%" (-> this mood-color-table)) + (format #t "~1Tmood-channel-group: #~%" (-> this mood-channel-group)) + (format #t "~1Tmood-direction-table: #~%" (-> this mood-direction-table)) + (format #t "~1Tmood-sky-table: #~%" (-> this mood-sky-table)) + (format #t "~1Tmood-interp-table: ~A~%" (-> this mood-interp-table)) + (format #t "~1Tmood-clouds: #~%" (-> this mood-clouds)) + (format #t "~1Tcurrent-interp: #~%" (-> this current-interp)) + (format #t "~1Ttarget-interp: #~%" (-> this target-interp)) + (format #t "~1Tspeed-interp: #~%" (-> this speed-interp)) + (format #t "~1Trange: #~%" (-> this range)) + (format #t "~1Ttime-until-random: #~%" (-> this time-until-random)) + (format #t "~1Ttime-until-random-min: #~%" (-> this time-until-random-min)) + (format #t "~1Ttime-until-random-max: #~%" (-> this time-until-random-max)) + (format #t "~1Tdisplay-flag: ~A~%" (-> this display-flag)) + (format #t "~1Toveride-weather-flag: ~A~%" (-> this overide-weather-flag)) + (format #t "~1Toveride: #~%" (-> this overide)) + (format #t "~1Tlightning-index: ~D~%" (-> this lightning-index)) + (format #t "~1Tlightning-val: ~D~%" (-> this lightning-val)) + (format #t "~1Tlightning-time: ~D~%" (-> this lightning-time)) + (format #t "~1Tlightning-time2: ~f~%" (-> this lightning-time2)) + (format #t "~1Tlightning-flash: ~f~%" (-> this lightning-flash)) + (format #t "~1Tlightning-id: ~D~%" (-> this lightning-id)) + (format #t "~1Tlightning-count0: ~D~%" (-> this lightning-count0)) + (format #t "~1Tlightning-count1: ~D~%" (-> this lightning-count1)) + (format #t "~1Tlightning-count2: ~D~%" (-> this lightning-count2)) + (format #t "~1Train-id: ~D~%" (-> this rain-id)) + (format #t "~1Tsound-pitch: ~f~%" (-> this sound-pitch)) + (format #t "~1Tfogs[9] @ #x~X~%" (-> this fogs)) + (format #t "~1Tcolors[3] @ #x~X~%" (-> this colors)) + (format #t "~1Tchannels[3] @ #x~X~%" (-> this channels)) + (format #t "~1Tclouds[9] @ #x~X~%" (-> this clouds)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc index eba40a2d2a..6844faab5a 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc @@ -637,18 +637,18 @@ ) ;; definition for method 3 of type flames-state -(defmethod inspect flames-state ((obj flames-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect flames-state ((this flames-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'flames-state) - (format #t "~1Ttime: ~f~%" (-> obj time)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Theight: ~D~%" (-> obj height)) + (format #t "[~8x] ~A~%" this 'flames-state) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Theight: ~D~%" (-> this height)) (label cfg-4) - obj + this ) ;; definition for function update-mood-flames @@ -764,16 +764,16 @@ ) ;; definition for method 3 of type light-state -(defmethod inspect light-state ((obj light-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect light-state ((this light-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'light-state) - (format #t "~1Ttime: ~f~%" (-> obj time)) - (format #t "~1Tfade: ~f~%" (-> obj fade)) + (format #t "[~8x] ~A~%" this 'light-state) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tfade: ~f~%" (-> this fade)) (label cfg-4) - obj + this ) ;; definition for function update-mood-light @@ -853,15 +853,15 @@ ) ;; definition for method 3 of type lava-state -(defmethod inspect lava-state ((obj lava-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect lava-state ((this lava-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'lava-state) - (format #t "~1Tlava: ~f~%" (-> obj lava)) + (format #t "[~8x] ~A~%" this 'lava-state) + (format #t "~1Tlava: ~f~%" (-> this lava)) (label cfg-4) - obj + this ) ;; definition for function update-mood-lava @@ -889,16 +889,16 @@ ) ;; definition for method 3 of type flicker-state -(defmethod inspect flicker-state ((obj flicker-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect flicker-state ((this flicker-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'flicker-state) - (format #t "~1Tflicker-off: ~D~%" (-> obj flicker-off)) - (format #t "~1Tflicker-on: ~D~%" (-> obj flicker-on)) + (format #t "[~8x] ~A~%" this 'flicker-state) + (format #t "~1Tflicker-off: ~D~%" (-> this flicker-off)) + (format #t "~1Tflicker-on: ~D~%" (-> this flicker-on)) (label cfg-4) - obj + this ) ;; definition for function update-mood-flicker @@ -942,17 +942,17 @@ ) ;; definition for method 3 of type florescent-state -(defmethod inspect florescent-state ((obj florescent-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect florescent-state ((this florescent-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'florescent-state) - (format #t "~1Tvalue: ~f~%" (-> obj value)) - (format #t "~1Tdelay: ~D~%" (-> obj delay)) - (format #t "~1Tdelay2: ~D~%" (-> obj delay2)) + (format #t "[~8x] ~A~%" this 'florescent-state) + (format #t "~1Tvalue: ~f~%" (-> this value)) + (format #t "~1Tdelay: ~D~%" (-> this delay)) + (format #t "~1Tdelay2: ~D~%" (-> this delay2)) (label cfg-4) - obj + this ) ;; definition for function update-mood-florescent @@ -994,16 +994,16 @@ ) ;; definition for method 3 of type electricity-state -(defmethod inspect electricity-state ((obj electricity-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect electricity-state ((this electricity-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'electricity-state) - (format #t "~1Tvalue: ~f~%" (-> obj value)) - (format #t "~1Tscale: ~f~%" (-> obj scale)) + (format #t "[~8x] ~A~%" this 'electricity-state) + (format #t "~1Tvalue: ~f~%" (-> this value)) + (format #t "~1Tscale: ~f~%" (-> this scale)) (label cfg-4) - obj + this ) ;; definition for function update-mood-electricity @@ -1029,15 +1029,15 @@ ) ;; definition for method 3 of type pulse-state -(defmethod inspect pulse-state ((obj pulse-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect pulse-state ((this pulse-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pulse-state) - (format #t "~1Tpulse: ~f~%" (-> obj pulse)) + (format #t "[~8x] ~A~%" this 'pulse-state) + (format #t "~1Tpulse: ~f~%" (-> this pulse)) (label cfg-4) - obj + this ) ;; definition for function update-mood-pulse @@ -1063,15 +1063,15 @@ ) ;; definition for method 3 of type strobe-state -(defmethod inspect strobe-state ((obj strobe-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect strobe-state ((this strobe-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'strobe-state) - (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "[~8x] ~A~%" this 'strobe-state) + (format #t "~1Ttime: ~f~%" (-> this time)) (label cfg-4) - obj + this ) ;; definition for function update-mood-strobe @@ -1101,17 +1101,17 @@ ;; definition for method 13 of type mood-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod apply-mood-clouds-and-fog mood-control ((obj mood-control) (arg0 mood-control-work)) - (let ((v1-0 (-> obj mood-fog-table))) +(defmethod apply-mood-clouds-and-fog mood-control ((this mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> this mood-fog-table))) (dotimes (a0-1 24) (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) ) ) - (let ((s4-0 (-> obj mood-fog-table))) + (let ((s4-0 (-> this mood-fog-table))) (let ((f30-0 (- 1.0 (-> arg0 interp cloud)))) (when (!= f30-0 0.0) (let ((f0-4 (* (- 1.0 (-> arg0 interp fog)) f30-0)) - (a2-0 (-> obj fogs (-> arg0 index 0))) + (a2-0 (-> this fogs (-> arg0 index 0))) ) (if (!= f0-4 0.0) (vector4-array-madd! @@ -1124,7 +1124,7 @@ ) ) (let ((f0-6 (* (-> arg0 interp fog) f30-0)) - (a2-1 (-> obj fogs (-> arg0 index 1))) + (a2-1 (-> this fogs (-> arg0 index 1))) ) (if (!= f0-6 0.0) (vector4-array-madd! @@ -1141,7 +1141,7 @@ (let ((f30-1 (-> arg0 interp cloud))) (when (!= f30-1 0.0) (let ((f0-10 (* (- 1.0 (-> arg0 interp fog)) f30-1)) - (a2-2 (-> obj fogs (-> arg0 index 2))) + (a2-2 (-> this fogs (-> arg0 index 2))) ) (if (!= f0-10 0.0) (vector4-array-madd! @@ -1154,7 +1154,7 @@ ) ) (let ((f0-12 (* (-> arg0 interp fog) f30-1)) - (a2-3 (-> obj fogs (-> arg0 index 3))) + (a2-3 (-> this fogs (-> arg0 index 3))) ) (if (!= f0-12 0.0) (vector4-array-madd! @@ -1170,7 +1170,7 @@ ) ) (let ((f0-13 (-> *time-of-day-context* fog-mult)) - (v1-29 (-> obj mood-fog-table)) + (v1-29 (-> this mood-fog-table)) ) (dotimes (a0-6 8) (set! (-> v1-29 data a0-6 fog-dists y) (* (-> v1-29 data a0-6 fog-dists y) f0-13)) @@ -1183,15 +1183,15 @@ ;; definition for method 14 of type mood-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod apply-mood-color mood-control ((obj mood-control) (arg0 mood-control-work)) - (let ((v1-0 (-> obj mood-color-table))) +(defmethod apply-mood-color mood-control ((this mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> this mood-color-table))) (dotimes (a0-1 16) (set! (-> v1-0 data-raw a0-1) (the-as uint128 0)) ) ) - (let ((s4-0 (-> obj mood-color-table))) + (let ((s4-0 (-> this mood-color-table))) (let ((f0-1 (- 1.0 (-> arg0 color-interp))) - (a2-0 (-> obj colors (-> arg0 color-index 0))) + (a2-0 (-> this colors (-> arg0 color-index 0))) ) (if (!= f0-1 0.0) (vector4-array-madd! @@ -1204,7 +1204,7 @@ ) ) (let ((f0-2 (-> arg0 color-interp)) - (a2-1 (-> obj colors (-> arg0 color-index 1))) + (a2-1 (-> this colors (-> arg0 color-index 1))) ) (if (!= f0-2 0.0) (vector4-array-madd! @@ -1224,15 +1224,15 @@ ;; definition for method 15 of type mood-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod apply-mood-channels mood-control ((obj mood-control) (arg0 mood-control-work)) - (let ((v1-0 (-> obj mood-channel-group))) +(defmethod apply-mood-channels mood-control ((this mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> this mood-channel-group))) (dotimes (a0-1 24) (set! (-> v1-0 data 0 vecs a0-1 quad) (the-as uint128 0)) ) ) - (let ((s4-0 (-> obj mood-channel-group))) + (let ((s4-0 (-> this mood-channel-group))) (let ((f0-1 (- 1.0 (-> arg0 channel-interp))) - (a2-0 (-> obj channels (-> arg0 channel-index 0))) + (a2-0 (-> this channels (-> arg0 channel-index 0))) ) (if (!= f0-1 0.0) (vector4-array-madd! @@ -1245,7 +1245,7 @@ ) ) (let ((f0-2 (-> arg0 channel-interp)) - (a2-1 (-> obj channels (-> arg0 channel-index 1))) + (a2-1 (-> this channels (-> arg0 channel-index 1))) ) (if (!= f0-2 0.0) (vector4-array-madd! @@ -1264,12 +1264,12 @@ ;; definition for method 16 of type mood-control ;; WARN: Return type mismatch int vs none. -(defmethod adjust-num-clouds! mood-control ((obj mood-control) (arg0 mood-control-work)) - (let ((v1-0 (-> obj mood-clouds))) +(defmethod adjust-num-clouds! mood-control ((this mood-control) (arg0 mood-control-work)) + (let ((v1-0 (-> this mood-clouds))) (set! (-> v1-0 cloud-min) 0.0) (set! (-> v1-0 cloud-max) 0.0) (let ((f0-3 (- 1.0 (-> arg0 cloud-interp))) - (a2-4 (-> obj clouds (-> arg0 cloud-index 0))) + (a2-4 (-> this clouds (-> arg0 cloud-index 0))) ) (when (!= f0-3 0.0) (set! (-> v1-0 cloud-min) (* (-> a2-4 cloud-min) f0-3)) @@ -1277,7 +1277,7 @@ ) ) (let ((f0-5 (-> arg0 cloud-interp)) - (a0-2 (-> obj clouds (-> arg0 cloud-index 1))) + (a0-2 (-> this clouds (-> arg0 cloud-index 1))) ) (when (!= f0-5 0.0) (+! (-> v1-0 cloud-min) (* (-> a0-2 cloud-min) f0-5)) @@ -1291,7 +1291,7 @@ ;; definition for method 18 of type mood-control ;; WARN: Return type mismatch int vs sound-id. -(defmethod play-or-stop-lightning! mood-control ((obj mood-control) (arg0 sound-spec) (arg1 vector)) +(defmethod play-or-stop-lightning! mood-control ((this mood-control) (arg0 sound-spec) (arg1 vector)) "Handles playing/stopping of the lightning sound - Plays the lightning sound if we are not loading and `lightning-id` is zero - Stops the lightning sound first if `lightning-id` is non-zero @@ -1299,21 +1299,21 @@ Returns the current value of `lightning-id`" (vector+! (new 'stack-no-clear 'vector) arg1 (math-camera-pos)) (the-as sound-id (cond ((or (load-in-progress? *level*) (movie?)) - (the-as sound-id (when (nonzero? (-> obj lightning-id)) - (sound-stop (-> obj lightning-id)) - (set! (-> obj lightning-id) (new 'static 'sound-id)) + (the-as sound-id (when (nonzero? (-> this lightning-id)) + (sound-stop (-> this lightning-id)) + (set! (-> this lightning-id) (new 'static 'sound-id)) (new 'static 'sound-id) ) ) ) (else - (when (nonzero? (-> obj lightning-id)) - (sound-stop (-> obj lightning-id)) - (set! (-> obj lightning-id) (new 'static 'sound-id)) + (when (nonzero? (-> this lightning-id)) + (sound-stop (-> this lightning-id)) + (set! (-> this lightning-id) (new 'static 'sound-id)) 0 ) (let ((lightning-sound-id (sound-play-by-spec arg0 (new-sound-id) arg1))) - (set! (-> obj lightning-id) lightning-sound-id) + (set! (-> this lightning-id) lightning-sound-id) lightning-sound-id ) ) @@ -1324,14 +1324,14 @@ Returns the current value of `lightning-id`" ;; definition for method 17 of type mood-control ;; INFO: Used lq/sq ;; WARN: disable def twice: 141. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gen-lightning-and-thunder! mood-control ((obj mood-control)) +(defmethod gen-lightning-and-thunder! mood-control ((this mood-control)) (local-vars (a1-1 (array float))) - (let ((v1-3 (-> obj mood-channel-group data (-> obj lightning-index) vecs)) - (a1-0 (-> obj lightning-val)) - (a0-4 (/ (-> obj lightning-time) 2)) - (f0-0 (-> obj lightning-time2)) + (let ((v1-3 (-> this mood-channel-group data (-> this lightning-index) vecs)) + (a1-0 (-> this lightning-val)) + (a0-4 (/ (-> this lightning-time) 2)) + (f0-0 (-> this lightning-time2)) ) - (set! (-> obj lightning-flash) 0.0) + (set! (-> this lightning-flash) 0.0) (cond ((>= 0.0 f0-0) (cond @@ -1366,23 +1366,23 @@ Returns the current value of `lightning-id`" (s5-0 (new 'stack-no-clear 'vector)) ) (cond - ((= (-> obj lightning-index) 4) - (set! (-> obj lightning-flash) f30-0) + ((= (-> this lightning-index) 4) + (set! (-> this lightning-flash) f30-0) ) - ((= (-> obj lightning-index) 5) - (set! (-> obj lightning-flash) f30-0) + ((= (-> this lightning-index) 5) + (set! (-> this lightning-flash) f30-0) (dotimes (s4-0 8) (set-vector! s5-0 255.0 255.0 255.0 128.0) (vector4-lerp! - (the-as vector (-> obj mood-fog-table data s4-0)) - (the-as vector (-> obj mood-fog-table data s4-0)) + (the-as vector (-> this mood-fog-table data s4-0)) + (the-as vector (-> this mood-fog-table data s4-0)) s5-0 f30-0 ) ) ) (else - (set! (-> obj lightning-flash) (* 1.9921875 f30-0)) + (set! (-> this lightning-flash) (* 1.9921875 f30-0)) (set-vector! (-> v1-3 0) 1.0 1.0 1.0 1.0) (set! (-> v1-3 1 quad) (-> v1-3 0 quad)) (set! (-> v1-3 2 quad) (-> v1-3 0 quad)) @@ -1393,61 +1393,61 @@ Returns the current value of `lightning-id`" ) ) (when (not (paused?)) - (let ((v0-2 (the-as number (+ (-> obj lightning-time) 1)))) - (set! (-> obj lightning-time) (the-as int v0-2)) + (let ((v0-2 (the-as number (+ (-> this lightning-time) 1)))) + (set! (-> this lightning-time) (the-as int v0-2)) v0-2 ) ) ) ((and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) name) 'nest)) - (set! (-> obj lightning-time2) (rand-vu-float-range 3.0 5.0)) + (set! (-> this lightning-time2) (rand-vu-float-range 3.0 5.0)) ) (else - (set! (-> obj lightning-time2) (rand-vu-float-range 15.0 20.0)) + (set! (-> this lightning-time2) (rand-vu-float-range 15.0 20.0)) ) ) ) (else (when (not (paused?)) - (set! (-> obj lightning-time2) (- (-> obj lightning-time2) (seconds-per-frame))) - (when (>= 0.0 (-> obj lightning-time2)) - (set! (-> obj lightning-index) (mod (the-as int (rand-uint31-gen *random-generator*)) 6)) - (set! (-> obj lightning-val) (the-as int (logand (rand-uint31-gen *random-generator*) 7))) - (set! (-> obj lightning-time) 0) + (set! (-> this lightning-time2) (- (-> this lightning-time2) (seconds-per-frame))) + (when (>= 0.0 (-> this lightning-time2)) + (set! (-> this lightning-index) (mod (the-as int (rand-uint31-gen *random-generator*)) 6)) + (set! (-> this lightning-val) (the-as int (logand (rand-uint31-gen *random-generator*) 7))) + (set! (-> this lightning-time) 0) (cond - ((zero? (-> obj lightning-index)) + ((zero? (-> this lightning-index)) (play-or-stop-lightning! - obj + this (static-sound-spec "thunder-b") (new 'static 'vector :x 37109760.0 :y 16261120.0 :z 5857280.0) ) ) - ((= (-> obj lightning-index) 1) + ((= (-> this lightning-index) 1) (play-or-stop-lightning! - obj + this (static-sound-spec "thunder-b") (new 'static 'vector :x 20480000.0 :y 33341440.0 :z 12124160.0) ) ) - ((= (-> obj lightning-index) 2) + ((= (-> this lightning-index) 2) (play-or-stop-lightning! - obj + this (static-sound-spec "thunder-b") (new 'static 'vector :x -20480000.0 :y 33341440.0 :z 12124160.0) ) ) - ((= (-> obj lightning-index) 3) + ((= (-> this lightning-index) 3) (play-or-stop-lightning! - obj + this (static-sound-spec "thunder-b") (new 'static 'vector :x -37109760.0 :y 16261120.0 :z 5857280.0) ) ) - ((= (-> obj lightning-index) 4) - (play-or-stop-lightning! obj (static-sound-spec "thunder-c") (new 'static 'vector :y 40960000.0)) + ((= (-> this lightning-index) 4) + (play-or-stop-lightning! this (static-sound-spec "thunder-c") (new 'static 'vector :y 40960000.0)) ) - ((= (-> obj lightning-index) 5) - (play-or-stop-lightning! obj (static-sound-spec "thunder-a") (new 'static 'vector :y 40960000.0)) + ((= (-> this lightning-index) 5) + (play-or-stop-lightning! this (static-sound-spec "thunder-a") (new 'static 'vector :y 40960000.0)) ) ) ) @@ -1459,29 +1459,29 @@ Returns the current value of `lightning-id`" ;; definition for method 9 of type mood-control ;; WARN: Return type mismatch int vs none. -(defmethod init-weather! mood-control ((obj mood-control)) +(defmethod init-weather! mood-control ((this mood-control)) (local-vars (v1-39 int)) (let ((s5-0 (level-get-target-inside *level*))) (when s5-0 (cond ((= (-> s5-0 info taskname) 'drill) - (mem-copy! (the-as pointer (-> obj mood-fog-table)) (the-as pointer *drill-mood-fog-table*) 384) - (mem-copy! (the-as pointer (-> obj mood-color-table)) (the-as pointer *drill-mood-color-table*) 256) - (set! (-> obj mood-direction-table) *drill-mood-direction-table*) - (set! (-> obj mood-clouds cloud-min) (-> *clouds-1000* cloud-min)) - (set! (-> obj mood-clouds cloud-max) (-> *clouds-1000* cloud-max)) + (mem-copy! (the-as pointer (-> this mood-fog-table)) (the-as pointer *drill-mood-fog-table*) 384) + (mem-copy! (the-as pointer (-> this mood-color-table)) (the-as pointer *drill-mood-color-table*) 256) + (set! (-> this mood-direction-table) *drill-mood-direction-table*) + (set! (-> this mood-clouds cloud-min) (-> *clouds-1000* cloud-min)) + (set! (-> this mood-clouds cloud-max) (-> *clouds-1000* cloud-max)) ) (else - (set! (-> obj mood-direction-table) *mood-direction-table*) + (set! (-> this mood-direction-table) *mood-direction-table*) (let ((s4-0 (new 'stack-no-clear 'mood-control-work))) (cond - ((and (-> obj overide-weather-flag) (not (movie?))) - (set! (-> s4-0 weather cloud) (* 2.0 (fmax 0.0 (fmin 1.0 (-> obj overide cloud))))) - (set! (-> s4-0 weather fog) (* 2.0 (-> obj overide fog))) + ((and (-> this overide-weather-flag) (not (movie?))) + (set! (-> s4-0 weather cloud) (* 2.0 (fmax 0.0 (fmin 1.0 (-> this overide cloud))))) + (set! (-> s4-0 weather fog) (* 2.0 (-> this overide fog))) ) (else - (set! (-> s4-0 weather cloud) (* 2.0 (fmax 0.0 (fmin 1.0 (-> obj current-interp cloud))))) - (set! (-> s4-0 weather fog) (* 2.0 (fmax 0.0 (fmin 1.0 (-> obj current-interp fog))))) + (set! (-> s4-0 weather cloud) (* 2.0 (fmax 0.0 (fmin 1.0 (-> this current-interp cloud))))) + (set! (-> s4-0 weather fog) (* 2.0 (fmax 0.0 (fmin 1.0 (-> this current-interp fog))))) ) ) (set! (-> s4-0 iweather cloud) (the int (-> s4-0 weather cloud))) @@ -1536,9 +1536,9 @@ Returns the current value of `lightning-id`" ) (set! (-> s4-0 channel-index 0) v1-39) (set! (-> s4-0 channel-index 1) (+ v1-39 1)) - (let* ((f0-33 (if (and (-> obj overide-weather-flag) (not (movie?))) - (* 8.0 (-> obj overide cloud)) - (* 8.0 (fmax 0.0 (fmin 1.0 (-> obj current-interp cloud)))) + (let* ((f0-33 (if (and (-> this overide-weather-flag) (not (movie?))) + (* 8.0 (-> this overide cloud)) + (* 8.0 (fmax 0.0 (fmin 1.0 (-> this current-interp cloud)))) ) ) (v1-52 (the int f0-33)) @@ -1547,88 +1547,88 @@ Returns the current value of `lightning-id`" (set! (-> s4-0 cloud-index 0) v1-52) (set! (-> s4-0 cloud-index 1) (+ v1-52 1)) ) - (apply-mood-clouds-and-fog obj s4-0) - (apply-mood-color obj s4-0) - (apply-mood-channels obj s4-0) - (adjust-num-clouds! obj s4-0) + (apply-mood-clouds-and-fog this s4-0) + (apply-mood-color this s4-0) + (apply-mood-channels this s4-0) + (adjust-num-clouds! this s4-0) ) - (when (not (or (paused?) (and (-> obj overide-weather-flag) (not (movie?))))) - (set! (-> obj target-interp cloud) - (fmax (fmin (-> obj target-interp cloud) (-> obj range max-cloud)) (-> obj range min-cloud)) + (when (not (or (paused?) (and (-> this overide-weather-flag) (not (movie?))))) + (set! (-> this target-interp cloud) + (fmax (fmin (-> this target-interp cloud) (-> this range max-cloud)) (-> this range min-cloud)) ) - (set! (-> obj target-interp fog) - (fmax (fmin (-> obj target-interp fog) (-> obj range max-fog)) (-> obj range min-fog)) + (set! (-> this target-interp fog) + (fmax (fmin (-> this target-interp fog) (-> this range max-fog)) (-> this range min-fog)) ) (seek! - (-> obj current-interp cloud) - (-> obj target-interp cloud) - (* (/ 1.0 (-> obj speed-interp cloud)) (seconds-per-frame)) + (-> this current-interp cloud) + (-> this target-interp cloud) + (* (/ 1.0 (-> this speed-interp cloud)) (seconds-per-frame)) ) (seek! - (-> obj current-interp fog) - (-> obj target-interp fog) - (* (/ 1.0 (-> obj speed-interp fog)) (seconds-per-frame)) + (-> this current-interp fog) + (-> this target-interp fog) + (* (/ 1.0 (-> this speed-interp fog)) (seconds-per-frame)) ) - (when (!= (-> obj time-until-random cloud) -99.0) - (set! (-> obj time-until-random cloud) (- (-> obj time-until-random cloud) (* 300.0 (seconds-per-frame)))) - (when (< (-> obj time-until-random cloud) 0.0) - (set! (-> obj time-until-random cloud) - (rand-vu-float-range (-> obj time-until-random-min cloud) (-> obj time-until-random-max cloud)) + (when (!= (-> this time-until-random cloud) -99.0) + (set! (-> this time-until-random cloud) (- (-> this time-until-random cloud) (* 300.0 (seconds-per-frame)))) + (when (< (-> this time-until-random cloud) 0.0) + (set! (-> this time-until-random cloud) + (rand-vu-float-range (-> this time-until-random-min cloud) (-> this time-until-random-max cloud)) ) - (let ((f30-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) - (f28-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) - (f26-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) - (f24-0 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) - (f1-36 (rand-vu-float-range (-> obj range min-cloud) (-> obj range max-cloud))) + (let ((f30-0 (rand-vu-float-range (-> this range min-cloud) (-> this range max-cloud))) + (f28-0 (rand-vu-float-range (-> this range min-cloud) (-> this range max-cloud))) + (f26-0 (rand-vu-float-range (-> this range min-cloud) (-> this range max-cloud))) + (f24-0 (rand-vu-float-range (-> this range min-cloud) (-> this range max-cloud))) + (f1-36 (rand-vu-float-range (-> this range min-cloud) (-> this range max-cloud))) ) - (set! (-> obj target-interp cloud) (fabs (+ -0.25 (* 0.25 (+ f30-0 f28-0 f26-0 f24-0 f1-36))))) + (set! (-> this target-interp cloud) (fabs (+ -0.25 (* 0.25 (+ f30-0 f28-0 f26-0 f24-0 f1-36))))) ) - (set! (-> obj speed-interp cloud) (rand-vu-float-range 30.0 120.0)) + (set! (-> this speed-interp cloud) (rand-vu-float-range 30.0 120.0)) (when (and (< 0.0 (-> *setting-control* user-current rain)) - (< (-> obj target-interp cloud) 0.5) - (< 0.25 (-> obj target-interp cloud)) - (or (< (-> obj target-interp fog) 0.25) (< 0.75 (-> obj target-interp fog))) + (< (-> this target-interp cloud) 0.5) + (< 0.25 (-> this target-interp cloud)) + (or (< (-> this target-interp fog) 0.25) (< 0.75 (-> this target-interp fog))) ) - (set! (-> obj speed-interp fog) - (fabs - (/ (* 1.25 (-> obj current-interp fog) (-> obj speed-interp cloud)) (+ -0.75 (-> obj current-interp cloud))) - ) + (set! (-> this speed-interp fog) (fabs (/ (* 1.25 (-> this current-interp fog) (-> this speed-interp cloud)) + (+ -0.75 (-> this current-interp cloud)) + ) + ) ) - (set! (-> obj target-interp fog) 0.5) - (set! (-> obj time-until-random fog) (-> obj time-until-random cloud)) + (set! (-> this target-interp fog) 0.5) + (set! (-> this time-until-random fog) (-> this time-until-random cloud)) ) ) ) - (when (!= (-> obj time-until-random fog) -99.0) - (set! (-> obj time-until-random fog) (- (-> obj time-until-random fog) (* 300.0 (seconds-per-frame)))) - (when (< (-> obj time-until-random fog) 0.0) - (set! (-> obj time-until-random fog) - (rand-vu-float-range (-> obj time-until-random-min fog) (-> obj time-until-random-max fog)) + (when (!= (-> this time-until-random fog) -99.0) + (set! (-> this time-until-random fog) (- (-> this time-until-random fog) (* 300.0 (seconds-per-frame)))) + (when (< (-> this time-until-random fog) 0.0) + (set! (-> this time-until-random fog) + (rand-vu-float-range (-> this time-until-random-min fog) (-> this time-until-random-max fog)) ) - (let ((f30-1 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) - (f28-1 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) - (f26-1 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) - (f1-52 (rand-vu-float-range (-> obj range min-fog) (-> obj range max-fog))) + (let ((f30-1 (rand-vu-float-range (-> this range min-fog) (-> this range max-fog))) + (f28-1 (rand-vu-float-range (-> this range min-fog) (-> this range max-fog))) + (f26-1 (rand-vu-float-range (-> this range min-fog) (-> this range max-fog))) + (f1-52 (rand-vu-float-range (-> this range min-fog) (-> this range max-fog))) ) - (set! (-> obj target-interp fog) (fabs (+ -1.0 (* 0.5 (+ f30-1 f28-1 f26-1 f1-52))))) + (set! (-> this target-interp fog) (fabs (+ -1.0 (* 0.5 (+ f30-1 f28-1 f26-1 f1-52))))) ) - (set! (-> obj speed-interp fog) (rand-vu-float-range 30.0 120.0)) + (set! (-> this speed-interp fog) (rand-vu-float-range 30.0 120.0)) ) ) ) - (let ((f30-2 (if (and (-> obj overide-weather-flag) (not (movie?))) - (-> obj overide cloud) - (-> obj current-interp cloud) + (let ((f30-2 (if (and (-> this overide-weather-flag) (not (movie?))) + (-> this overide cloud) + (-> this current-interp cloud) ) ) - (f26-2 (if (and (-> obj overide-weather-flag) (not (movie?))) - (-> obj overide fog) - (-> obj current-interp fog) + (f26-2 (if (and (-> this overide-weather-flag) (not (movie?))) + (-> this overide fog) + (-> this current-interp fog) ) ) (f28-2 (fmin (-> s5-0 info max-rain) (-> *time-of-day-context* max-rain))) ) - (set! (-> obj sound-pitch) (* 1.442695 (logf (-> *display* bg-clock clock-ratio)))) + (set! (-> this sound-pitch) (* 1.442695 (logf (-> *display* bg-clock clock-ratio)))) (let* ((f0-114 (fmax 0.0 (fmin (* 4.0 (fmax 0.0 (+ -0.5 f26-2)) (fmax 0.0 (+ -0.5 f30-2))) f28-2))) (f30-3 (fmin 0.75 f0-114)) ) @@ -1639,27 +1639,27 @@ Returns the current value of `lightning-id`" ) (!= *master-mode* 'progress) ) - (gen-lightning-and-thunder! obj) + (gen-lightning-and-thunder! this) (cond - ((zero? (-> obj rain-id)) - (set! (-> obj rain-id) (sound-play-by-name - (static-sound-name "rain-hiss") - (new-sound-id) - (the int (* 1024.0 f30-3)) - (the int (* 1524.0 (-> obj sound-pitch))) - 0 - (sound-group sfx) - #t - ) + ((zero? (-> this rain-id)) + (set! (-> this rain-id) (sound-play-by-name + (static-sound-name "rain-hiss") + (new-sound-id) + (the int (* 1024.0 f30-3)) + (the int (* 1524.0 (-> this sound-pitch))) + 0 + (sound-group sfx) + #t + ) ) ) (else (when *sound-player-enable* (let ((v1-136 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-136 command) (sound-command set-param)) - (set! (-> v1-136 id) (-> obj rain-id)) + (set! (-> v1-136 id) (-> this rain-id)) (set! (-> v1-136 params volume) (the int (* 1024.0 f30-3))) - (set! (-> v1-136 params pitch-mod) (the int (* 1524.0 (-> obj sound-pitch)))) + (set! (-> v1-136 params pitch-mod) (the int (* 1524.0 (-> this sound-pitch)))) (set! (-> v1-136 params mask) (the-as uint 3)) (-> v1-136 id) ) @@ -1668,31 +1668,31 @@ Returns the current value of `lightning-id`" ) ) (else - (set! (-> obj lightning-flash) 0.0) - (when (nonzero? (-> obj rain-id)) - (sound-stop (-> obj rain-id)) - (set! (-> obj rain-id) (new 'static 'sound-id)) + (set! (-> this lightning-flash) 0.0) + (when (nonzero? (-> this rain-id)) + (sound-stop (-> this rain-id)) + (set! (-> this rain-id) (new 'static 'sound-id)) 0 ) ) ) ) ) - (when (-> obj display-flag) + (when (-> this display-flag) (cond - ((and (-> obj overide-weather-flag) (not (movie?))) - (format *stdcon* "overide cloud ~f~%" (-> obj overide cloud)) - (format *stdcon* "overide fog ~f~%" (-> obj overide fog)) + ((and (-> this overide-weather-flag) (not (movie?))) + (format *stdcon* "overide cloud ~f~%" (-> this overide cloud)) + (format *stdcon* "overide fog ~f~%" (-> this overide fog)) ) (else - (format *stdcon* "time until random cloud ~f~%" (* 0.0033333334 (-> obj time-until-random cloud))) - (format *stdcon* "current cloud ~f~%" (-> obj current-interp cloud)) - (format *stdcon* "target cloud ~f~%" (-> obj target-interp cloud)) - (format *stdcon* "speed cloud ~f~%" (* (/ 1.0 (-> obj speed-interp cloud)) (seconds-per-frame))) - (format *stdcon* "time until random fog ~f~%" (* 0.0033333334 (-> obj time-until-random fog))) - (format *stdcon* "current fog ~f~%" (-> obj current-interp fog)) - (format *stdcon* "target fog ~f~%" (-> obj target-interp fog)) - (format *stdcon* "speed fog ~f~%" (* (/ 1.0 (-> obj speed-interp fog)) (seconds-per-frame))) + (format *stdcon* "time until random cloud ~f~%" (* 0.0033333334 (-> this time-until-random cloud))) + (format *stdcon* "current cloud ~f~%" (-> this current-interp cloud)) + (format *stdcon* "target cloud ~f~%" (-> this target-interp cloud)) + (format *stdcon* "speed cloud ~f~%" (* (/ 1.0 (-> this speed-interp cloud)) (seconds-per-frame))) + (format *stdcon* "time until random fog ~f~%" (* 0.0033333334 (-> this time-until-random fog))) + (format *stdcon* "current fog ~f~%" (-> this current-interp fog)) + (format *stdcon* "target fog ~f~%" (-> this target-interp fog)) + (format *stdcon* "speed fog ~f~%" (* (/ 1.0 (-> this speed-interp fog)) (seconds-per-frame))) ) ) ) @@ -1706,19 +1706,19 @@ Returns the current value of `lightning-id`" ;; definition for method 10 of type mood-control ;; WARN: Return type mismatch int vs none. -(defmethod update-mood-weather! mood-control ((obj mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) +(defmethod update-mood-weather! mood-control ((this mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float)) "Set the `target-interp` and `speed-interp` for the clouds and fog If `*-speed` is 0.0, use the `*-target` args to set `current-interp` See [[mood-weather]]" - (set! (-> obj target-interp cloud) cloud-target) - (set! (-> obj target-interp fog) fog-target) - (set! (-> obj speed-interp cloud) cloud-speed) - (set! (-> obj speed-interp fog) fog-speed) + (set! (-> this target-interp cloud) cloud-target) + (set! (-> this target-interp fog) fog-target) + (set! (-> this speed-interp cloud) cloud-speed) + (set! (-> this speed-interp fog) fog-speed) (if (= cloud-speed 0.0) - (set! (-> obj current-interp cloud) cloud-target) + (set! (-> this current-interp cloud) cloud-target) ) (if (= fog-speed 0.0) - (set! (-> obj current-interp fog) fog-target) + (set! (-> this current-interp fog) fog-target) ) 0 (none) @@ -1726,24 +1726,24 @@ See [[mood-weather]]" ;; definition for method 11 of type mood-control ;; WARN: Return type mismatch int vs none. -(defmethod update-mood-range! mood-control ((obj mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) +(defmethod update-mood-range! mood-control ((this mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float)) "Set the minimum and maximum ranges of clouds and fog See [[mood-range]]" - (set! (-> obj range min-cloud) min-cloud) - (set! (-> obj range max-cloud) max-cloud) - (set! (-> obj range min-fog) min-fog) - (set! (-> obj range max-fog) max-fog) + (set! (-> this range min-cloud) min-cloud) + (set! (-> this range max-cloud) max-cloud) + (set! (-> this range min-fog) min-fog) + (set! (-> this range max-fog) max-fog) 0 (none) ) ;; definition for method 12 of type mood-control ;; WARN: Return type mismatch int vs none. -(defmethod set-time-for-random-weather! mood-control ((obj mood-control) (arg0 float) (arg1 float)) +(defmethod set-time-for-random-weather! mood-control ((this mood-control) (arg0 float) (arg1 float)) "Set the `time-until-random`'s cloud and fog values See [[mood-weather]]" - (set! (-> obj time-until-random cloud) arg0) - (set! (-> obj time-until-random fog) arg1) + (set! (-> this time-until-random cloud) arg0) + (set! (-> this time-until-random fog) arg1) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc index 8aa6c7b334..a54334e5cf 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type palette-fade-control -(defmethod inspect palette-fade-control ((obj palette-fade-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect palette-fade-control ((this palette-fade-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'palette-fade-control) - (format #t "~1Ttrans: #~%" (-> obj trans)) - (format #t "~1Tfade: ~f~%" (-> obj fade)) - (format #t "~1Tactor-dist: ~f~%" (-> obj actor-dist)) + (format #t "[~8x] ~A~%" this 'palette-fade-control) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tfade: ~f~%" (-> this fade)) + (format #t "~1Tactor-dist: ~f~%" (-> this actor-dist)) (label cfg-4) - obj + this ) ;; definition of type palette-fade-controls @@ -40,15 +40,15 @@ ) ;; definition for method 3 of type palette-fade-controls -(defmethod inspect palette-fade-controls ((obj palette-fade-controls)) - (when (not obj) - (set! obj obj) +(defmethod inspect palette-fade-controls ((this palette-fade-controls)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcontrol[8] @ #x~X~%" (-> obj control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcontrol[8] @ #x~X~%" (-> this control)) (label cfg-4) - obj + this ) ;; definition (perm) for symbol *palette-fade-controls*, type palette-fade-controls @@ -83,32 +83,32 @@ ) ;; definition for method 3 of type time-of-day-proc -(defmethod inspect time-of-day-proc ((obj time-of-day-proc)) - (when (not obj) - (set! obj obj) +(defmethod inspect time-of-day-proc ((this time-of-day-proc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thours: ~D~%" (-> obj hours)) - (format #t "~2Tminutes: ~D~%" (-> obj minutes)) - (format #t "~2Tseconds: ~D~%" (-> obj seconds)) - (format #t "~2Told-frame: ~D~%" (-> obj old-frame)) - (format #t "~2Tcurrent-frame: ~D~%" (-> obj current-frame)) - (format #t "~2Tframes: ~D~%" (-> obj frames)) - (format #t "~2Ttime-of-day: ~f~%" (-> obj time-of-day)) - (format #t "~2Ttime-ratio: ~f~%" (-> obj time-ratio)) - (format #t "~2Tdest-time-ratio: ~f~%" (-> obj dest-time-ratio)) - (format #t "~2Tdest-time-delta: ~f~%" (-> obj dest-time-delta)) - (format #t "~2Tsun-count: ~D~%" (-> obj sun-count)) - (format #t "~2Tsun: ~A~%" (-> obj sun)) - (format #t "~2Tgreen-sun-count: ~D~%" (-> obj green-sun-count)) - (format #t "~2Tgreen-sun: ~A~%" (-> obj green-sun)) - (format #t "~2Tmoon-count: ~D~%" (-> obj moon-count)) - (format #t "~2Tmoon: ~A~%" (-> obj moon)) + (format #t "~2Thours: ~D~%" (-> this hours)) + (format #t "~2Tminutes: ~D~%" (-> this minutes)) + (format #t "~2Tseconds: ~D~%" (-> this seconds)) + (format #t "~2Told-frame: ~D~%" (-> this old-frame)) + (format #t "~2Tcurrent-frame: ~D~%" (-> this current-frame)) + (format #t "~2Tframes: ~D~%" (-> this frames)) + (format #t "~2Ttime-of-day: ~f~%" (-> this time-of-day)) + (format #t "~2Ttime-ratio: ~f~%" (-> this time-ratio)) + (format #t "~2Tdest-time-ratio: ~f~%" (-> this dest-time-ratio)) + (format #t "~2Tdest-time-delta: ~f~%" (-> this dest-time-delta)) + (format #t "~2Tsun-count: ~D~%" (-> this sun-count)) + (format #t "~2Tsun: ~A~%" (-> this sun)) + (format #t "~2Tgreen-sun-count: ~D~%" (-> this green-sun-count)) + (format #t "~2Tgreen-sun: ~A~%" (-> this green-sun)) + (format #t "~2Tmoon-count: ~D~%" (-> this moon-count)) + (format #t "~2Tmoon: ~A~%" (-> this moon)) (label cfg-4) - obj + this ) ;; definition of type time-of-day-palette @@ -124,18 +124,18 @@ ) ;; definition for method 3 of type time-of-day-palette -(defmethod inspect time-of-day-palette ((obj time-of-day-palette)) - (when (not obj) - (set! obj obj) +(defmethod inspect time-of-day-palette ((this time-of-day-palette)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twidth: ~D~%" (-> obj width)) - (format #t "~1Theight: ~D~%" (-> obj height)) - (format #t "~1Tpad: ~D~%" (-> obj pad)) - (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twidth: ~D~%" (-> this width)) + (format #t "~1Theight: ~D~%" (-> this height)) + (format #t "~1Tpad: ~D~%" (-> this pad)) + (format #t "~1Tdata[1] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type time-of-day-context @@ -172,39 +172,39 @@ ) ;; definition for method 3 of type time-of-day-context -(defmethod inspect time-of-day-context ((obj time-of-day-context)) - (when (not obj) - (set! obj obj) +(defmethod inspect time-of-day-context ((this time-of-day-context)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tinterp[6] @ #x~X~%" (-> obj interp)) - (format #t "~1Tcurrent-fog: #~%" (-> obj current-fog)) - (format #t "~1Tcurrent-sky-color: #~%" (-> obj current-sky-color)) - (format #t "~1Tcurrent-env-color: #~%" (-> obj current-env-color)) - (format #t "~1Tcurrent-prt-color: #~%" (-> obj current-prt-color)) - (format #t "~1Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) - (format #t "~1Tlight-group[8] @ #x~X~%" (-> obj light-group)) - (format #t "~1Tcurrent-clouds: #~%" (-> obj current-clouds)) - (format #t "~1Ttimes[8] @ #x~X~%" (-> obj times)) - (format #t "~1Ttitle-light-group: #~%" (-> obj title-light-group)) - (format #t "~1Tfilter: #~%" (-> obj filter)) - (format #t "~1Tfilter-color: #~%" (-> obj filter-color)) - (format #t "~1Ttime: ~f~%" (-> obj time)) - (format #t "~1Ttarget-interp: ~f~%" (-> obj target-interp)) - (format #t "~1Terase-color: ~D~%" (-> obj erase-color)) - (format #t "~1Tsky: ~A~%" (-> obj sky)) - (format #t "~1Tuse-camera-other: ~A~%" (-> obj use-camera-other)) - (format #t "~1Ttitle-updated: ~A~%" (-> obj title-updated)) - (format #t "~1Tmode: ~D~%" (-> obj mode)) - (format #t "~1Toveride-enable: ~A~%" (-> obj overide-enable)) - (format #t "~1Toveride-palette: ~D~%" (-> obj overide-palette)) - (format #t "~1Tmax-rain: ~f~%" (-> obj max-rain)) - (format #t "~1Tfog-mult: ~f~%" (-> obj fog-mult)) - (format #t "~1Texterior-level: ~A~%" (-> obj exterior-level)) - (format #t "~1Tocean-alpha: ~f~%" (-> obj ocean-alpha)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tinterp[6] @ #x~X~%" (-> this interp)) + (format #t "~1Tcurrent-fog: #~%" (-> this current-fog)) + (format #t "~1Tcurrent-sky-color: #~%" (-> this current-sky-color)) + (format #t "~1Tcurrent-env-color: #~%" (-> this current-env-color)) + (format #t "~1Tcurrent-prt-color: #~%" (-> this current-prt-color)) + (format #t "~1Tcurrent-shadow-color: #~%" (-> this current-shadow-color)) + (format #t "~1Tlight-group[8] @ #x~X~%" (-> this light-group)) + (format #t "~1Tcurrent-clouds: #~%" (-> this current-clouds)) + (format #t "~1Ttimes[8] @ #x~X~%" (-> this times)) + (format #t "~1Ttitle-light-group: #~%" (-> this title-light-group)) + (format #t "~1Tfilter: #~%" (-> this filter)) + (format #t "~1Tfilter-color: #~%" (-> this filter-color)) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Ttarget-interp: ~f~%" (-> this target-interp)) + (format #t "~1Terase-color: ~D~%" (-> this erase-color)) + (format #t "~1Tsky: ~A~%" (-> this sky)) + (format #t "~1Tuse-camera-other: ~A~%" (-> this use-camera-other)) + (format #t "~1Ttitle-updated: ~A~%" (-> this title-updated)) + (format #t "~1Tmode: ~D~%" (-> this mode)) + (format #t "~1Toveride-enable: ~A~%" (-> this overide-enable)) + (format #t "~1Toveride-palette: ~D~%" (-> this overide-palette)) + (format #t "~1Tmax-rain: ~f~%" (-> this max-rain)) + (format #t "~1Tfog-mult: ~f~%" (-> this fog-mult)) + (format #t "~1Texterior-level: ~A~%" (-> this exterior-level)) + (format #t "~1Tocean-alpha: ~f~%" (-> this ocean-alpha)) (label cfg-4) - obj + this ) ;; definition of type time-of-day-dma @@ -220,18 +220,18 @@ ) ;; definition for method 3 of type time-of-day-dma -(defmethod inspect time-of-day-dma ((obj time-of-day-dma)) - (when (not obj) - (set! obj obj) +(defmethod inspect time-of-day-dma ((this time-of-day-dma)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'time-of-day-dma) - (format #t "~1Touta[256] @ #x~X~%" (-> obj outa)) - (format #t "~1Toutb[256] @ #x~X~%" (-> obj outb)) - (format #t "~1Tbanka[256] @ #x~X~%" (-> obj banka)) - (format #t "~1Tbankb[256] @ #x~X~%" (-> obj bankb)) + (format #t "[~8x] ~A~%" this 'time-of-day-dma) + (format #t "~1Touta[256] @ #x~X~%" (-> this outa)) + (format #t "~1Toutb[256] @ #x~X~%" (-> this outb)) + (format #t "~1Tbanka[256] @ #x~X~%" (-> this banka)) + (format #t "~1Tbankb[256] @ #x~X~%" (-> this bankb)) (label cfg-4) - obj + this ) ;; definition for symbol *time-of-day-context*, type time-of-day-context diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc index 1d65cfd17e..13056bf28b 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day_REF.gc @@ -3,22 +3,22 @@ ;; definition for method 5 of type time-of-day-palette ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of time-of-day-palette ((obj time-of-day-palette)) - (the-as int (+ (-> obj type size) (* (* (-> obj height) (-> obj width)) 4))) +(defmethod asize-of time-of-day-palette ((this time-of-day-palette)) + (the-as int (+ (-> this type size) (* (* (-> this height) (-> this width)) 4))) ) ;; definition for method 10 of type time-of-day-proc -(defmethod deactivate time-of-day-proc ((obj time-of-day-proc)) - (if (nonzero? (-> obj sun)) - (kill-and-free-particles (-> obj sun)) +(defmethod deactivate time-of-day-proc ((this time-of-day-proc)) + (if (nonzero? (-> this sun)) + (kill-and-free-particles (-> this sun)) ) - (if (nonzero? (-> obj green-sun)) - (kill-and-free-particles (-> obj green-sun)) + (if (nonzero? (-> this green-sun)) + (kill-and-free-particles (-> this green-sun)) ) - (if (nonzero? (-> obj moon)) - (kill-and-free-particles (-> obj moon)) + (if (nonzero? (-> this moon)) + (kill-and-free-particles (-> this moon)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -651,10 +651,10 @@ ;; definition for method 10 of type palette-fade-controls ;; INFO: Used lq/sq -(defmethod set-fade! palette-fade-controls ((obj palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) +(defmethod set-fade! palette-fade-controls ((this palette-fade-controls) (arg0 int) (arg1 float) (arg2 float) (arg3 vector)) (cond ((and (>= arg0 0) (< arg0 8)) - (let ((v1-3 (-> obj control arg0))) + (let ((v1-3 (-> this control arg0))) (when (< arg2 (-> v1-3 actor-dist)) (if arg3 (set! (-> v1-3 trans quad) (-> arg3 quad)) @@ -672,9 +672,9 @@ ;; definition for method 9 of type palette-fade-controls ;; WARN: Return type mismatch int vs none. -(defmethod reset! palette-fade-controls ((obj palette-fade-controls)) +(defmethod reset! palette-fade-controls ((this palette-fade-controls)) (countdown (v1-0 8) - (let ((a1-2 (-> obj control v1-0))) + (let ((a1-2 (-> this control v1-0))) (set! (-> a1-2 fade) 0.0) (set! (-> a1-2 actor-dist) 4096000000.0) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc index 3d6b2911db..689716c74c 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc @@ -15,19 +15,19 @@ ) ;; definition for method 3 of type ocean-corner -(defmethod inspect ocean-corner ((obj ocean-corner)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-corner ((this ocean-corner)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-corner) - (format #t "~1Tbsphere: #~%" (-> obj bsphere)) - (format #t "~1Tstart-corner: #~%" (-> obj start-corner)) - (format #t "~1Ty-scales: #~%" (-> obj y-scales)) - (format #t "~1Talphas: #~%" (-> obj alphas)) - (format #t "~1Tcolors[4] @ #x~X~%" (-> obj colors)) + (format #t "[~8x] ~A~%" this 'ocean-corner) + (format #t "~1Tbsphere: #~%" (-> this bsphere)) + (format #t "~1Tstart-corner: #~%" (-> this start-corner)) + (format #t "~1Ty-scales: #~%" (-> this y-scales)) + (format #t "~1Talphas: #~%" (-> this alphas)) + (format #t "~1Tcolors[4] @ #x~X~%" (-> this colors)) (label cfg-4) - obj + this ) ;; definition of type ocean-wave-info @@ -47,22 +47,22 @@ ) ;; definition for method 3 of type ocean-wave-info -(defmethod inspect ocean-wave-info ((obj ocean-wave-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-wave-info ((this ocean-wave-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-wave-info) - (format #t "~1Tfrequency: ~f~%" (-> obj frequency)) - (format #t "~1Tamplitude: ~f~%" (-> obj amplitude)) - (format #t "~1Twave-speed: ~f~%" (-> obj wave-speed)) - (format #t "~1Tangle: ~f~%" (-> obj angle)) - (format #t "~1Tkx: ~f~%" (-> obj kx)) - (format #t "~1Tky: ~f~%" (-> obj ky)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "[~8x] ~A~%" this 'ocean-wave-info) + (format #t "~1Tfrequency: ~f~%" (-> this frequency)) + (format #t "~1Tamplitude: ~f~%" (-> this amplitude)) + (format #t "~1Twave-speed: ~f~%" (-> this wave-speed)) + (format #t "~1Tangle: ~f~%" (-> this angle)) + (format #t "~1Tkx: ~f~%" (-> this kx)) + (format #t "~1Tky: ~f~%" (-> this ky)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tflags: ~D~%" (-> this flags)) (label cfg-4) - obj + this ) ;; definition of type ocean-vertex @@ -77,17 +77,17 @@ ) ;; definition for method 3 of type ocean-vertex -(defmethod inspect ocean-vertex ((obj ocean-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-vertex ((this ocean-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-vertex) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tstq: #~%" (-> obj stq)) - (format #t "~1Tcol: #~%" (-> obj col)) + (format #t "[~8x] ~A~%" this 'ocean-vertex) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tstq: #~%" (-> this stq)) + (format #t "~1Tcol: #~%" (-> this col)) (label cfg-4) - obj + this ) ;; definition of type ocean-spheres @@ -100,15 +100,15 @@ ) ;; definition for method 3 of type ocean-spheres -(defmethod inspect ocean-spheres ((obj ocean-spheres)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-spheres ((this ocean-spheres)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-spheres) - (format #t "~1Tspheres[36] @ #x~X~%" (-> obj spheres)) + (format #t "[~8x] ~A~%" this 'ocean-spheres) + (format #t "~1Tspheres[36] @ #x~X~%" (-> this spheres)) (label cfg-4) - obj + this ) ;; definition of type ocean-colors @@ -121,15 +121,15 @@ ) ;; definition for method 3 of type ocean-colors -(defmethod inspect ocean-colors ((obj ocean-colors)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-colors ((this ocean-colors)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-colors) - (format #t "~1Tcolors[2548] @ #x~X~%" (-> obj colors)) + (format #t "[~8x] ~A~%" this 'ocean-colors) + (format #t "~1Tcolors[2548] @ #x~X~%" (-> this colors)) (label cfg-4) - obj + this ) ;; definition of type ocean-colors-float @@ -142,15 +142,15 @@ ) ;; definition for method 3 of type ocean-colors-float -(defmethod inspect ocean-colors-float ((obj ocean-colors-float)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-colors-float ((this ocean-colors-float)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-colors-float) - (format #t "~1Tcolors[2548] @ #x~X~%" (-> obj colors)) + (format #t "[~8x] ~A~%" this 'ocean-colors-float) + (format #t "~1Tcolors[2548] @ #x~X~%" (-> this colors)) (label cfg-4) - obj + this ) ;; definition of type ocean-mid-mask @@ -165,16 +165,16 @@ ) ;; definition for method 3 of type ocean-mid-mask -(defmethod inspect ocean-mid-mask ((obj ocean-mid-mask)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-mid-mask ((this ocean-mid-mask)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-mid-mask) - (format #t "~1Tmask[8] @ #x~X~%" (-> obj mask)) - (format #t "~1Tdword: #x~X~%" (-> obj dword)) + (format #t "[~8x] ~A~%" this 'ocean-mid-mask) + (format #t "~1Tmask[8] @ #x~X~%" (-> this mask)) + (format #t "~1Tdword: #x~X~%" (-> this dword)) (label cfg-4) - obj + this ) ;; definition of type ocean-mid-indices @@ -187,15 +187,15 @@ ) ;; definition for method 3 of type ocean-mid-indices -(defmethod inspect ocean-mid-indices ((obj ocean-mid-indices)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-mid-indices ((this ocean-mid-indices)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdata[36] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdata[36] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type ocean-mid-masks @@ -208,15 +208,15 @@ ) ;; definition for method 3 of type ocean-mid-masks -(defmethod inspect ocean-mid-masks ((obj ocean-mid-masks)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-mid-masks ((this ocean-mid-masks)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdata: #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdata: #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type ocean-trans-mask @@ -230,16 +230,16 @@ ) ;; definition for method 3 of type ocean-trans-mask -(defmethod inspect ocean-trans-mask ((obj ocean-trans-mask)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-trans-mask ((this ocean-trans-mask)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-trans-mask) - (format #t "~1Tmask[4] @ #x~X~%" (-> obj mask)) - (format #t "~1Tword: #x~X~%" (-> obj word)) + (format #t "[~8x] ~A~%" this 'ocean-trans-mask) + (format #t "~1Tmask[4] @ #x~X~%" (-> this mask)) + (format #t "~1Tword: #x~X~%" (-> this word)) (label cfg-4) - obj + this ) ;; definition of type ocean-trans-index @@ -254,16 +254,16 @@ ) ;; definition for method 3 of type ocean-trans-index -(defmethod inspect ocean-trans-index ((obj ocean-trans-index)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-trans-index ((this ocean-trans-index)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-trans-index) - (format #t "~1Tparent: ~D~%" (-> obj parent)) - (format #t "~1Tchild: ~D~%" (-> obj child)) + (format #t "[~8x] ~A~%" this 'ocean-trans-index) + (format #t "~1Tparent: ~D~%" (-> this parent)) + (format #t "~1Tchild: ~D~%" (-> this child)) (label cfg-4) - obj + this ) ;; definition of type ocean-trans-indices @@ -276,15 +276,15 @@ ) ;; definition for method 3 of type ocean-trans-indices -(defmethod inspect ocean-trans-indices ((obj ocean-trans-indices)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-trans-indices ((this ocean-trans-indices)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdata[2304] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdata[2304] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type ocean-near-index @@ -297,15 +297,15 @@ ) ;; definition for method 3 of type ocean-near-index -(defmethod inspect ocean-near-index ((obj ocean-near-index)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-near-index ((this ocean-near-index)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-near-index) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'ocean-near-index) + (format #t "~1Tdata[16] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type ocean-near-indices @@ -318,15 +318,15 @@ ) ;; definition for method 3 of type ocean-near-indices -(defmethod inspect ocean-near-indices ((obj ocean-near-indices)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-near-indices ((this ocean-near-indices)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdata: #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdata: #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type ocean-near-colors @@ -342,18 +342,18 @@ ) ;; definition for method 3 of type ocean-near-colors -(defmethod inspect ocean-near-colors ((obj ocean-near-colors)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-near-colors ((this ocean-near-colors)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-near-colors) - (format #t "~1Tcolor0: #~%" (-> obj color0)) - (format #t "~1Tcolor1: #~%" (-> obj color1)) - (format #t "~1Tcolor2: #~%" (-> obj color2)) - (format #t "~1Tcolor3: #~%" (-> obj color3)) + (format #t "[~8x] ~A~%" this 'ocean-near-colors) + (format #t "~1Tcolor0: #~%" (-> this color0)) + (format #t "~1Tcolor1: #~%" (-> this color1)) + (format #t "~1Tcolor2: #~%" (-> this color2)) + (format #t "~1Tcolor3: #~%" (-> this color3)) (label cfg-4) - obj + this ) ;; definition of type ocean-trans-strip @@ -366,15 +366,15 @@ ) ;; definition for method 3 of type ocean-trans-strip -(defmethod inspect ocean-trans-strip ((obj ocean-trans-strip)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-trans-strip ((this ocean-trans-strip)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-trans-strip) - (format #t "~1Tverts[10] @ #x~X~%" (-> obj verts)) + (format #t "[~8x] ~A~%" this 'ocean-trans-strip) + (format #t "~1Tverts[10] @ #x~X~%" (-> this verts)) (label cfg-4) - obj + this ) ;; definition of type ocean-trans-strip-array @@ -387,15 +387,15 @@ ) ;; definition for method 3 of type ocean-trans-strip-array -(defmethod inspect ocean-trans-strip-array ((obj ocean-trans-strip-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-trans-strip-array ((this ocean-trans-strip-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-trans-strip-array) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'ocean-trans-strip-array) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type ocean-wave-data @@ -408,15 +408,15 @@ ) ;; definition for method 3 of type ocean-wave-data -(defmethod inspect ocean-wave-data ((obj ocean-wave-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-wave-data ((this ocean-wave-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-wave-data) - (format #t "~1Tdata[1024] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'ocean-wave-data) + (format #t "~1Tdata[1024] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type ocean-wave-frames @@ -429,15 +429,15 @@ ) ;; definition for method 3 of type ocean-wave-frames -(defmethod inspect ocean-wave-frames ((obj ocean-wave-frames)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-wave-frames ((this ocean-wave-frames)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-wave-frames) - (format #t "~1Tframe[64] @ #x~X~%" (-> obj frame)) + (format #t "[~8x] ~A~%" this 'ocean-wave-frames) + (format #t "~1Tframe[64] @ #x~X~%" (-> this frame)) (label cfg-4) - obj + this ) ;; definition of type ocean-texture-constants @@ -456,21 +456,21 @@ ) ;; definition for method 3 of type ocean-texture-constants -(defmethod inspect ocean-texture-constants ((obj ocean-texture-constants)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-texture-constants ((this ocean-texture-constants)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-texture-constants) - (format #t "~1Tgiftag: #~%" (-> obj giftag)) - (format #t "~1Tbuffers: #~%" (-> obj buffers)) - (format #t "~1Tdests: #~%" (-> obj dests)) - (format #t "~1Tstart: #~%" (-> obj start)) - (format #t "~1Toffsets: #~%" (-> obj offsets)) - (format #t "~1Tconstants: #~%" (-> obj constants)) - (format #t "~1Tcam-nrm: #~%" (-> obj cam-nrm)) + (format #t "[~8x] ~A~%" this 'ocean-texture-constants) + (format #t "~1Tgiftag: #~%" (-> this giftag)) + (format #t "~1Tbuffers: #~%" (-> this buffers)) + (format #t "~1Tdests: #~%" (-> this dests)) + (format #t "~1Tstart: #~%" (-> this start)) + (format #t "~1Toffsets: #~%" (-> this offsets)) + (format #t "~1Tconstants: #~%" (-> this constants)) + (format #t "~1Tcam-nrm: #~%" (-> this cam-nrm)) (label cfg-4) - obj + this ) ;; definition of type ocean-mid-vertex @@ -485,17 +485,17 @@ ) ;; definition for method 3 of type ocean-mid-vertex -(defmethod inspect ocean-mid-vertex ((obj ocean-mid-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-mid-vertex ((this ocean-mid-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-mid-vertex) - (format #t "~1Tstq: #~%" (-> obj stq)) - (format #t "~1Tcol: #~%" (-> obj col)) - (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this 'ocean-mid-vertex) + (format #t "~1Tstq: #~%" (-> this stq)) + (format #t "~1Tcol: #~%" (-> this col)) + (format #t "~1Tpos: #~%" (-> this pos)) (label cfg-4) - obj + this ) ;; definition of type ocean-mid-constants @@ -528,35 +528,35 @@ ) ;; definition for method 3 of type ocean-mid-constants -(defmethod inspect ocean-mid-constants ((obj ocean-mid-constants)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-mid-constants ((this ocean-mid-constants)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-mid-constants) - (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~1Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) - (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~1Tfog: #~%" (-> obj fog)) - (format #t "~1Tconstants: #~%" (-> obj constants)) - (format #t "~1Tconstants2: #~%" (-> obj constants2)) - (format #t "~1Tdrw-fan: #~%" (-> obj drw-fan)) - (format #t "~1Tenv-fan: #~%" (-> obj env-fan)) - (format #t "~1Tdrw-adgif: #~%" (-> obj drw-adgif)) - (format #t "~1Tdrw-texture: #~%" (-> obj drw-texture)) - (format #t "~1Tdrw-strip-0: #~%" (-> obj drw-strip-0)) - (format #t "~1Tdrw-strip-1: #~%" (-> obj drw-strip-1)) - (format #t "~1Tenv-adgif: #~%" (-> obj env-adgif)) - (format #t "~1Tenv-texture: #~%" (-> obj env-texture)) - (format #t "~1Tenv-strip: #~%" (-> obj env-strip)) - (format #t "~1Tenv-color: #~%" (-> obj env-color)) - (format #t "~1Tindex-table[8] @ #x~X~%" (-> obj index-table)) - (format #t "~1Tpos0: #~%" (-> obj pos0)) - (format #t "~1Tpos1: #~%" (-> obj pos1)) - (format #t "~1Tpos2: #~%" (-> obj pos2)) - (format #t "~1Tpos3: #~%" (-> obj pos3)) + (format #t "[~8x] ~A~%" this 'ocean-mid-constants) + (format #t "~1Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~1Tinv-hmge-scale: #~%" (-> this inv-hmge-scale)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Tfog: #~%" (-> this fog)) + (format #t "~1Tconstants: #~%" (-> this constants)) + (format #t "~1Tconstants2: #~%" (-> this constants2)) + (format #t "~1Tdrw-fan: #~%" (-> this drw-fan)) + (format #t "~1Tenv-fan: #~%" (-> this env-fan)) + (format #t "~1Tdrw-adgif: #~%" (-> this drw-adgif)) + (format #t "~1Tdrw-texture: #~%" (-> this drw-texture)) + (format #t "~1Tdrw-strip-0: #~%" (-> this drw-strip-0)) + (format #t "~1Tdrw-strip-1: #~%" (-> this drw-strip-1)) + (format #t "~1Tenv-adgif: #~%" (-> this env-adgif)) + (format #t "~1Tenv-texture: #~%" (-> this env-texture)) + (format #t "~1Tenv-strip: #~%" (-> this env-strip)) + (format #t "~1Tenv-color: #~%" (-> this env-color)) + (format #t "~1Tindex-table[8] @ #x~X~%" (-> this index-table)) + (format #t "~1Tpos0: #~%" (-> this pos0)) + (format #t "~1Tpos1: #~%" (-> this pos1)) + (format #t "~1Tpos2: #~%" (-> this pos2)) + (format #t "~1Tpos3: #~%" (-> this pos3)) (label cfg-4) - obj + this ) ;; definition of type ocean-mid-upload @@ -572,18 +572,18 @@ ) ;; definition for method 3 of type ocean-mid-upload -(defmethod inspect ocean-mid-upload ((obj ocean-mid-upload)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-mid-upload ((this ocean-mid-upload)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-mid-upload) - (format #t "~1Trot: #~%" (-> obj rot)) - (format #t "~1Tmatrix: #~%" (-> obj matrix)) - (format #t "~1Tcolors[108] @ #x~X~%" (-> obj colors)) - (format #t "~1Tmasks[2] @ #x~X~%" (-> obj masks)) + (format #t "[~8x] ~A~%" this 'ocean-mid-upload) + (format #t "~1Trot: #~%" (-> this rot)) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tcolors[108] @ #x~X~%" (-> this colors)) + (format #t "~1Tmasks[2] @ #x~X~%" (-> this masks)) (label cfg-4) - obj + this ) ;; definition of type ocean-mid-upload2 @@ -607,26 +607,26 @@ ) ;; definition for method 3 of type ocean-mid-upload2 -(defmethod inspect ocean-mid-upload2 ((obj ocean-mid-upload2)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-mid-upload2 ((this ocean-mid-upload2)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-mid-upload2) - (format #t "~1Trot: #~%" (-> obj rot)) - (format #t "~1Tmatrix: #~%" (-> obj matrix)) - (format #t "~1Tcount: #~%" (-> obj count)) - (format #t "~1Ttex0: #~%" (-> obj tex0)) - (format #t "~1Ttex1: #~%" (-> obj tex1)) - (format #t "~1Ttex2: #~%" (-> obj tex2)) - (format #t "~1Ttex3: #~%" (-> obj tex3)) - (format #t "~1Tclr0: #~%" (-> obj clr0)) - (format #t "~1Tclr1: #~%" (-> obj clr1)) - (format #t "~1Tclr2: #~%" (-> obj clr2)) - (format #t "~1Tclr3: #~%" (-> obj clr3)) - (format #t "~1Tverts[18] @ #x~X~%" (-> obj verts)) + (format #t "[~8x] ~A~%" this 'ocean-mid-upload2) + (format #t "~1Trot: #~%" (-> this rot)) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tcount: #~%" (-> this count)) + (format #t "~1Ttex0: #~%" (-> this tex0)) + (format #t "~1Ttex1: #~%" (-> this tex1)) + (format #t "~1Ttex2: #~%" (-> this tex2)) + (format #t "~1Ttex3: #~%" (-> this tex3)) + (format #t "~1Tclr0: #~%" (-> this clr0)) + (format #t "~1Tclr1: #~%" (-> this clr1)) + (format #t "~1Tclr2: #~%" (-> this clr2)) + (format #t "~1Tclr3: #~%" (-> this clr3)) + (format #t "~1Tverts[18] @ #x~X~%" (-> this verts)) (label cfg-4) - obj + this ) ;; definition of type ocean-mid-work @@ -645,21 +645,21 @@ ) ;; definition for method 3 of type ocean-mid-work -(defmethod inspect ocean-mid-work ((obj ocean-mid-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-mid-work ((this ocean-mid-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-mid-work) - (format #t "~1Tenv0: #~%" (-> obj env0)) - (format #t "~1Tenv1: #~%" (-> obj env1)) - (format #t "~1Tenv2: #~%" (-> obj env2)) - (format #t "~1Thmg0: #~%" (-> obj hmg0)) - (format #t "~1Thmg1: #~%" (-> obj hmg1)) - (format #t "~1Thmg2: #~%" (-> obj hmg2)) - (format #t "~1Tindices[16] @ #x~X~%" (-> obj indices)) + (format #t "[~8x] ~A~%" this 'ocean-mid-work) + (format #t "~1Tenv0: #~%" (-> this env0)) + (format #t "~1Tenv1: #~%" (-> this env1)) + (format #t "~1Tenv2: #~%" (-> this env2)) + (format #t "~1Thmg0: #~%" (-> this hmg0)) + (format #t "~1Thmg1: #~%" (-> this hmg1)) + (format #t "~1Thmg2: #~%" (-> this hmg2)) + (format #t "~1Tindices[16] @ #x~X~%" (-> this indices)) (label cfg-4) - obj + this ) ;; definition of type ocean-near-constants @@ -697,40 +697,40 @@ ) ;; definition for method 3 of type ocean-near-constants -(defmethod inspect ocean-near-constants ((obj ocean-near-constants)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-near-constants ((this ocean-near-constants)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-near-constants) - (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~1Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) - (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~1Tfog: #~%" (-> obj fog)) - (format #t "~1Tconstants: #~%" (-> obj constants)) - (format #t "~1Tconstants2: #~%" (-> obj constants2)) - (format #t "~1Tconstants3: #~%" (-> obj constants3)) - (format #t "~1Tconstants4: #~%" (-> obj constants4)) - (format #t "~1Tconstants5: #~%" (-> obj constants5)) - (format #t "~1Tdrw-fan: #~%" (-> obj drw-fan)) - (format #t "~1Tdrw2-fan: #~%" (-> obj drw2-fan)) - (format #t "~1Tenv-fan: #~%" (-> obj env-fan)) - (format #t "~1Tdrw-adgif: #~%" (-> obj drw-adgif)) - (format #t "~1Tdrw-texture: #~%" (-> obj drw-texture)) - (format #t "~1Tdrw-strip: #~%" (-> obj drw-strip)) - (format #t "~1Tenv-adgif: #~%" (-> obj env-adgif)) - (format #t "~1Tenv-texture: #~%" (-> obj env-texture)) - (format #t "~1Tenv-strip: #~%" (-> obj env-strip)) - (format #t "~1Tenv-color: #~%" (-> obj env-color)) - (format #t "~1Tdrw2-adgif: #~%" (-> obj drw2-adgif)) - (format #t "~1Tdrw2-tex0: #~%" (-> obj drw2-tex0)) - (format #t "~1Tdrw2-frame: #~%" (-> obj drw2-frame)) - (format #t "~1Tdrw2-strip: #~%" (-> obj drw2-strip)) - (format #t "~1Tdrw3-adgif: #~%" (-> obj drw3-adgif)) - (format #t "~1Tdrw3-frame: #~%" (-> obj drw3-frame)) - (format #t "~1Tindex-table[4] @ #x~X~%" (-> obj index-table)) + (format #t "[~8x] ~A~%" this 'ocean-near-constants) + (format #t "~1Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~1Tinv-hmge-scale: #~%" (-> this inv-hmge-scale)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Tfog: #~%" (-> this fog)) + (format #t "~1Tconstants: #~%" (-> this constants)) + (format #t "~1Tconstants2: #~%" (-> this constants2)) + (format #t "~1Tconstants3: #~%" (-> this constants3)) + (format #t "~1Tconstants4: #~%" (-> this constants4)) + (format #t "~1Tconstants5: #~%" (-> this constants5)) + (format #t "~1Tdrw-fan: #~%" (-> this drw-fan)) + (format #t "~1Tdrw2-fan: #~%" (-> this drw2-fan)) + (format #t "~1Tenv-fan: #~%" (-> this env-fan)) + (format #t "~1Tdrw-adgif: #~%" (-> this drw-adgif)) + (format #t "~1Tdrw-texture: #~%" (-> this drw-texture)) + (format #t "~1Tdrw-strip: #~%" (-> this drw-strip)) + (format #t "~1Tenv-adgif: #~%" (-> this env-adgif)) + (format #t "~1Tenv-texture: #~%" (-> this env-texture)) + (format #t "~1Tenv-strip: #~%" (-> this env-strip)) + (format #t "~1Tenv-color: #~%" (-> this env-color)) + (format #t "~1Tdrw2-adgif: #~%" (-> this drw2-adgif)) + (format #t "~1Tdrw2-tex0: #~%" (-> this drw2-tex0)) + (format #t "~1Tdrw2-frame: #~%" (-> this drw2-frame)) + (format #t "~1Tdrw2-strip: #~%" (-> this drw2-strip)) + (format #t "~1Tdrw3-adgif: #~%" (-> this drw3-adgif)) + (format #t "~1Tdrw3-frame: #~%" (-> this drw3-frame)) + (format #t "~1Tindex-table[4] @ #x~X~%" (-> this index-table)) (label cfg-4) - obj + this ) ;; definition of type ocean-near-upload @@ -748,20 +748,20 @@ ) ;; definition for method 3 of type ocean-near-upload -(defmethod inspect ocean-near-upload ((obj ocean-near-upload)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-near-upload ((this ocean-near-upload)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-near-upload) - (format #t "~1Trot: #~%" (-> obj rot)) - (format #t "~1Tmatrix: #~%" (-> obj matrix)) - (format #t "~1Tmasks[2] @ #x~X~%" (-> obj masks)) - (format #t "~1Tstart-height: #~%" (-> obj start-height)) - (format #t "~1Tstart-st: #~%" (-> obj start-st)) - (format #t "~1Tnear-colors: #~%" (-> obj near-colors)) + (format #t "[~8x] ~A~%" this 'ocean-near-upload) + (format #t "~1Trot: #~%" (-> this rot)) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tmasks[2] @ #x~X~%" (-> this masks)) + (format #t "~1Tstart-height: #~%" (-> this start-height)) + (format #t "~1Tstart-st: #~%" (-> this start-st)) + (format #t "~1Tnear-colors: #~%" (-> this near-colors)) (label cfg-4) - obj + this ) ;; definition of type ocean-near-vertex @@ -776,17 +776,17 @@ ) ;; definition for method 3 of type ocean-near-vertex -(defmethod inspect ocean-near-vertex ((obj ocean-near-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-near-vertex ((this ocean-near-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-near-vertex) - (format #t "~1Tstq: #~%" (-> obj stq)) - (format #t "~1Tclr: #~%" (-> obj clr)) - (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this 'ocean-near-vertex) + (format #t "~1Tstq: #~%" (-> this stq)) + (format #t "~1Tclr: #~%" (-> this clr)) + (format #t "~1Tpos: #~%" (-> this pos)) (label cfg-4) - obj + this ) ;; definition of type ocean-near-work @@ -800,16 +800,16 @@ ) ;; definition for method 3 of type ocean-near-work -(defmethod inspect ocean-near-work ((obj ocean-near-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-near-work ((this ocean-near-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-near-work) - (format #t "~1Tverts-ptr: #~%" (-> obj verts-ptr)) - (format #t "~1Tindices[16] @ #x~X~%" (-> obj indices)) + (format #t "[~8x] ~A~%" this 'ocean-near-work) + (format #t "~1Tverts-ptr: #~%" (-> this verts-ptr)) + (format #t "~1Tindices[16] @ #x~X~%" (-> this indices)) (label cfg-4) - obj + this ) ;; definition of type ocean-height-array @@ -822,15 +822,15 @@ ) ;; definition for method 3 of type ocean-height-array -(defmethod inspect ocean-height-array ((obj ocean-height-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-height-array ((this ocean-height-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-height-array) - (format #t "~1Tdata[1024] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'ocean-height-array) + (format #t "~1Tdata[1024] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type ocean-vert-array @@ -843,15 +843,15 @@ ) ;; definition for method 3 of type ocean-vert-array -(defmethod inspect ocean-vert-array ((obj ocean-vert-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-vert-array ((this ocean-vert-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-vert-array) - (format #t "~1Tdata[2048] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'ocean-vert-array) + (format #t "~1Tdata[2048] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type ocean-map @@ -875,22 +875,22 @@ ) ;; definition for method 3 of type ocean-map -(defmethod inspect ocean-map ((obj ocean-map)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean-map ((this ocean-map)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean-map) - (format #t "~1Tstart-corner: #~%" (-> obj start-corner)) - (format #t "~1Tfar-color: #~%" (-> obj far-color)) - (format #t "~1Tocean-spheres: #~%" (-> obj ocean-spheres)) - (format #t "~1Tocean-colors: #~%" (-> obj ocean-colors)) - (format #t "~1Tocean-mid-indices: ~A~%" (-> obj ocean-mid-indices)) - (format #t "~1Tocean-trans-indices: ~A~%" (-> obj ocean-trans-indices)) - (format #t "~1Tocean-near-indices: ~A~%" (-> obj ocean-near-indices)) - (format #t "~1Tocean-mid-masks: ~A~%" (-> obj ocean-mid-masks)) + (format #t "[~8x] ~A~%" this 'ocean-map) + (format #t "~1Tstart-corner: #~%" (-> this start-corner)) + (format #t "~1Tfar-color: #~%" (-> this far-color)) + (format #t "~1Tocean-spheres: #~%" (-> this ocean-spheres)) + (format #t "~1Tocean-colors: #~%" (-> this ocean-colors)) + (format #t "~1Tocean-mid-indices: ~A~%" (-> this ocean-mid-indices)) + (format #t "~1Tocean-trans-indices: ~A~%" (-> this ocean-trans-indices)) + (format #t "~1Tocean-near-indices: ~A~%" (-> this ocean-near-indices)) + (format #t "~1Tocean-mid-masks: ~A~%" (-> this ocean-mid-masks)) (label cfg-4) - obj + this ) ;; definition of type ocean @@ -1079,116 +1079,116 @@ ) ;; definition for method 3 of type ocean -(defmethod inspect ocean ((obj ocean)) - (when (not obj) - (set! obj obj) +(defmethod inspect ocean ((this ocean)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ocean) - (format #t "~1Tstart-corner: #~%" (-> obj start-corner)) - (format #t "~1Tfar-color: #~%" (-> obj far-color)) - (format #t "~1Tocean-spheres: #~%" (-> obj ocean-spheres)) - (format #t "~1Tocean-colors: #~%" (-> obj ocean-colors)) - (format #t "~1Tocean-mid-indices: ~A~%" (-> obj ocean-mid-indices)) - (format #t "~1Tocean-trans-indices: ~A~%" (-> obj ocean-trans-indices)) - (format #t "~1Tocean-near-indices: ~A~%" (-> obj ocean-near-indices)) - (format #t "~1Tocean-mid-masks: ~A~%" (-> obj ocean-mid-masks)) - (format #t "~1Toff: ~A~%" (-> obj off)) - (format #t "~1Tnear-off: ~A~%" (-> obj near-off)) - (format #t "~1Tmid-off: ~A~%" (-> obj mid-off)) - (format #t "~1Tfar-on: ~A~%" (-> obj far-on)) - (format #t "~1Tocean-facing: ~D~%" (-> obj ocean-facing)) - (format #t "~1Theights: #~%" (-> obj heights)) - (format #t "~1Theights2: #~%" (-> obj heights2)) - (format #t "~1Tverts: #~%" (-> obj verts)) - (format #t "~1Tocean-near-translucent?: ~A~%" (-> obj ocean-near-translucent?)) - (format #t "~1Tdeltas: #~%" (-> obj deltas)) - (format #t "~1Tmap-min: #~%" (-> obj map-min)) - (format #t "~1Tmap-max: #~%" (-> obj map-max)) - (format #t "~1Tinterp: #~%" (-> obj interp)) - (format #t "~1Tcorner-array[25] @ #x~X~%" (-> obj corner-array)) - (format #t "~1Tcorner-count: ~D~%" (-> obj corner-count)) - (format #t "~1Ttemp-vecs[4] @ #x~X~%" (-> obj temp-vecs)) - (format #t "~1Tmid-mask-ptrs[36] @ #x~X~%" (-> obj mid-mask-ptrs)) - (format #t "~1Tmid-camera-masks[36] @ #x~X~%" (-> obj mid-camera-masks)) - (format #t "~1Ttrans-mask-ptrs[64] @ #x~X~%" (-> obj trans-mask-ptrs)) - (format #t "~1Ttrans-camera-masks[16] @ #x~X~%" (-> obj trans-camera-masks)) - (format #t "~1Ttrans-temp-masks[16] @ #x~X~%" (-> obj trans-temp-masks)) - (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) - (format #t "~1Tsprite-tmpl2: #~%" (-> obj sprite-tmpl2)) - (format #t "~1Tsprite-tmpl3: #~%" (-> obj sprite-tmpl3)) - (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~1Tline-tmpl: #~%" (-> obj line-tmpl)) - (format #t "~1Tsun-tmpl: #~%" (-> obj sun-tmpl)) - (format #t "~1Terase-tmpl: #~%" (-> obj erase-tmpl)) - (format #t "~1Thaze-tmpl: #~%" (-> obj haze-tmpl)) - (format #t "~1Tcloud-tmpl: #~%" (-> obj cloud-tmpl)) - (format #t "~1Tclut-tmpl: #~%" (-> obj clut-tmpl)) - (format #t "~1Tcloud-lights: #~%" (-> obj cloud-lights)) - (format #t "~1Thaze-lights: #~%" (-> obj haze-lights)) - (format #t "~1Tconstant: #~%" (-> obj constant)) - (format #t "~1Tsky-color: #~%" (-> obj sky-color)) - (format #t "~1Thaze-verts[32] @ #x~X~%" (-> obj haze-verts)) - (format #t "~1Tcloud-verts[36] @ #x~X~%" (-> obj cloud-verts)) - (format #t "~1Tcloud-nrms[36] @ #x~X~%" (-> obj cloud-nrms)) - (format #t "~1Tcloud-col0[36] @ #x~X~%" (-> obj cloud-col0)) - (format #t "~1Tcloud-col1[36] @ #x~X~%" (-> obj cloud-col1)) - (format #t "~1Tcloud-st0[36] @ #x~X~%" (-> obj cloud-st0)) - (format #t "~1Tcloud-st1[36] @ #x~X~%" (-> obj cloud-st1)) - (format #t "~1Tcolor80808080: #~%" (-> obj color80808080)) - (format #t "~1Tcolor80808040: #~%" (-> obj color80808040)) - (format #t "~1Tcolor80808000: #~%" (-> obj color80808000)) - (format #t "~1Tst0000: #~%" (-> obj st0000)) - (format #t "~1Tst0505: #~%" (-> obj st0505)) - (format #t "~1Tst1010: #~%" (-> obj st1010)) - (format #t "~1Tuv00: #~%" (-> obj uv00)) - (format #t "~1Tuv44: #~%" (-> obj uv44)) - (format #t "~1Tuv88: #~%" (-> obj uv88)) - (format #t "~1Tuv1010: #~%" (-> obj uv1010)) - (format #t "~1Tuv2020: #~%" (-> obj uv2020)) - (format #t "~1Tuv4040: #~%" (-> obj uv4040)) - (format #t "~1Tuv8080: #~%" (-> obj uv8080)) - (format #t "~1Txy00: #~%" (-> obj xy00)) - (format #t "~1Txy88: #~%" (-> obj xy88)) - (format #t "~1Txy1010: #~%" (-> obj xy1010)) - (format #t "~1Txy2020: #~%" (-> obj xy2020)) - (format #t "~1Txy4040: #~%" (-> obj xy4040)) - (format #t "~1Txy8080: #~%" (-> obj xy8080)) - (format #t "~1Tcloud-alpha[36] @ #x~X~%" (-> obj cloud-alpha)) - (format #t "~1Tnear-mask-indices[16] @ #x~X~%" (-> obj near-mask-indices)) - (format #t "~1Tmid-minx: ~D~%" (-> obj mid-minx)) - (format #t "~1Tmid-maxx: ~D~%" (-> obj mid-maxx)) - (format #t "~1Tmid-minz: ~D~%" (-> obj mid-minz)) - (format #t "~1Tmid-maxz: ~D~%" (-> obj mid-maxz)) - (format #t "~1Tnear-minx: ~D~%" (-> obj near-minx)) - (format #t "~1Tnear-maxx: ~D~%" (-> obj near-maxx)) - (format #t "~1Tnear-minz: ~D~%" (-> obj near-minz)) - (format #t "~1Tnear-maxz: ~D~%" (-> obj near-maxz)) - (format #t "~1Ttemp-minx: ~D~%" (-> obj temp-minx)) - (format #t "~1Ttemp-maxx: ~D~%" (-> obj temp-maxx)) - (format #t "~1Ttemp-minz: ~D~%" (-> obj temp-minz)) - (format #t "~1Ttemp-maxz: ~D~%" (-> obj temp-maxz)) - (format #t "~1Ttex1: ~D~%" (-> obj tex1)) - (format #t "~1Ttex1-near: ~D~%" (-> obj tex1-near)) - (format #t "~1Tcorner00: ~f~%" (-> obj corner00)) - (format #t "~1Tcorner01: ~f~%" (-> obj corner01)) - (format #t "~1Tcorner10: ~f~%" (-> obj corner10)) - (format #t "~1Tcorner11: ~f~%" (-> obj corner11)) - (format #t "~1Tframe-num: ~f~%" (-> obj frame-num)) - (format #t "~1Tframe-speed: ~f~%" (-> obj frame-speed)) - (format #t "~1Tframe-num2: ~f~%" (-> obj frame-num2)) - (format #t "~1Tframe-speed2: ~f~%" (-> obj frame-speed2)) - (format #t "~1Tcloud-interp: ~f~%" (-> obj constant w)) - (format #t "~1Tscales: #~%" (-> obj scales)) - (format #t "~1Tmask-hi: #~%" (-> obj mask-hi)) - (format #t "~1Tmask-lo: #~%" (-> obj mask-lo)) - (format #t "~1Tlights: #~%" (-> obj lights)) - (format #t "~1Tuv-scroll-0: #~%" (-> obj uv-scroll-0)) - (format #t "~1Tuv-scroll-1: #~%" (-> obj uv-scroll-1)) - (format #t "~1Tst-scroll: #~%" (-> obj st-scroll)) - (format #t "~1Twait-to-vu0: ~D~%" (-> obj wait-to-vu0)) + (format #t "[~8x] ~A~%" this 'ocean) + (format #t "~1Tstart-corner: #~%" (-> this start-corner)) + (format #t "~1Tfar-color: #~%" (-> this far-color)) + (format #t "~1Tocean-spheres: #~%" (-> this ocean-spheres)) + (format #t "~1Tocean-colors: #~%" (-> this ocean-colors)) + (format #t "~1Tocean-mid-indices: ~A~%" (-> this ocean-mid-indices)) + (format #t "~1Tocean-trans-indices: ~A~%" (-> this ocean-trans-indices)) + (format #t "~1Tocean-near-indices: ~A~%" (-> this ocean-near-indices)) + (format #t "~1Tocean-mid-masks: ~A~%" (-> this ocean-mid-masks)) + (format #t "~1Toff: ~A~%" (-> this off)) + (format #t "~1Tnear-off: ~A~%" (-> this near-off)) + (format #t "~1Tmid-off: ~A~%" (-> this mid-off)) + (format #t "~1Tfar-on: ~A~%" (-> this far-on)) + (format #t "~1Tocean-facing: ~D~%" (-> this ocean-facing)) + (format #t "~1Theights: #~%" (-> this heights)) + (format #t "~1Theights2: #~%" (-> this heights2)) + (format #t "~1Tverts: #~%" (-> this verts)) + (format #t "~1Tocean-near-translucent?: ~A~%" (-> this ocean-near-translucent?)) + (format #t "~1Tdeltas: #~%" (-> this deltas)) + (format #t "~1Tmap-min: #~%" (-> this map-min)) + (format #t "~1Tmap-max: #~%" (-> this map-max)) + (format #t "~1Tinterp: #~%" (-> this interp)) + (format #t "~1Tcorner-array[25] @ #x~X~%" (-> this corner-array)) + (format #t "~1Tcorner-count: ~D~%" (-> this corner-count)) + (format #t "~1Ttemp-vecs[4] @ #x~X~%" (-> this temp-vecs)) + (format #t "~1Tmid-mask-ptrs[36] @ #x~X~%" (-> this mid-mask-ptrs)) + (format #t "~1Tmid-camera-masks[36] @ #x~X~%" (-> this mid-camera-masks)) + (format #t "~1Ttrans-mask-ptrs[64] @ #x~X~%" (-> this trans-mask-ptrs)) + (format #t "~1Ttrans-camera-masks[16] @ #x~X~%" (-> this trans-camera-masks)) + (format #t "~1Ttrans-temp-masks[16] @ #x~X~%" (-> this trans-temp-masks)) + (format #t "~1Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~1Tsprite-tmpl2: #~%" (-> this sprite-tmpl2)) + (format #t "~1Tsprite-tmpl3: #~%" (-> this sprite-tmpl3)) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tline-tmpl: #~%" (-> this line-tmpl)) + (format #t "~1Tsun-tmpl: #~%" (-> this sun-tmpl)) + (format #t "~1Terase-tmpl: #~%" (-> this erase-tmpl)) + (format #t "~1Thaze-tmpl: #~%" (-> this haze-tmpl)) + (format #t "~1Tcloud-tmpl: #~%" (-> this cloud-tmpl)) + (format #t "~1Tclut-tmpl: #~%" (-> this clut-tmpl)) + (format #t "~1Tcloud-lights: #~%" (-> this cloud-lights)) + (format #t "~1Thaze-lights: #~%" (-> this haze-lights)) + (format #t "~1Tconstant: #~%" (-> this constant)) + (format #t "~1Tsky-color: #~%" (-> this sky-color)) + (format #t "~1Thaze-verts[32] @ #x~X~%" (-> this haze-verts)) + (format #t "~1Tcloud-verts[36] @ #x~X~%" (-> this cloud-verts)) + (format #t "~1Tcloud-nrms[36] @ #x~X~%" (-> this cloud-nrms)) + (format #t "~1Tcloud-col0[36] @ #x~X~%" (-> this cloud-col0)) + (format #t "~1Tcloud-col1[36] @ #x~X~%" (-> this cloud-col1)) + (format #t "~1Tcloud-st0[36] @ #x~X~%" (-> this cloud-st0)) + (format #t "~1Tcloud-st1[36] @ #x~X~%" (-> this cloud-st1)) + (format #t "~1Tcolor80808080: #~%" (-> this color80808080)) + (format #t "~1Tcolor80808040: #~%" (-> this color80808040)) + (format #t "~1Tcolor80808000: #~%" (-> this color80808000)) + (format #t "~1Tst0000: #~%" (-> this st0000)) + (format #t "~1Tst0505: #~%" (-> this st0505)) + (format #t "~1Tst1010: #~%" (-> this st1010)) + (format #t "~1Tuv00: #~%" (-> this uv00)) + (format #t "~1Tuv44: #~%" (-> this uv44)) + (format #t "~1Tuv88: #~%" (-> this uv88)) + (format #t "~1Tuv1010: #~%" (-> this uv1010)) + (format #t "~1Tuv2020: #~%" (-> this uv2020)) + (format #t "~1Tuv4040: #~%" (-> this uv4040)) + (format #t "~1Tuv8080: #~%" (-> this uv8080)) + (format #t "~1Txy00: #~%" (-> this xy00)) + (format #t "~1Txy88: #~%" (-> this xy88)) + (format #t "~1Txy1010: #~%" (-> this xy1010)) + (format #t "~1Txy2020: #~%" (-> this xy2020)) + (format #t "~1Txy4040: #~%" (-> this xy4040)) + (format #t "~1Txy8080: #~%" (-> this xy8080)) + (format #t "~1Tcloud-alpha[36] @ #x~X~%" (-> this cloud-alpha)) + (format #t "~1Tnear-mask-indices[16] @ #x~X~%" (-> this near-mask-indices)) + (format #t "~1Tmid-minx: ~D~%" (-> this mid-minx)) + (format #t "~1Tmid-maxx: ~D~%" (-> this mid-maxx)) + (format #t "~1Tmid-minz: ~D~%" (-> this mid-minz)) + (format #t "~1Tmid-maxz: ~D~%" (-> this mid-maxz)) + (format #t "~1Tnear-minx: ~D~%" (-> this near-minx)) + (format #t "~1Tnear-maxx: ~D~%" (-> this near-maxx)) + (format #t "~1Tnear-minz: ~D~%" (-> this near-minz)) + (format #t "~1Tnear-maxz: ~D~%" (-> this near-maxz)) + (format #t "~1Ttemp-minx: ~D~%" (-> this temp-minx)) + (format #t "~1Ttemp-maxx: ~D~%" (-> this temp-maxx)) + (format #t "~1Ttemp-minz: ~D~%" (-> this temp-minz)) + (format #t "~1Ttemp-maxz: ~D~%" (-> this temp-maxz)) + (format #t "~1Ttex1: ~D~%" (-> this tex1)) + (format #t "~1Ttex1-near: ~D~%" (-> this tex1-near)) + (format #t "~1Tcorner00: ~f~%" (-> this corner00)) + (format #t "~1Tcorner01: ~f~%" (-> this corner01)) + (format #t "~1Tcorner10: ~f~%" (-> this corner10)) + (format #t "~1Tcorner11: ~f~%" (-> this corner11)) + (format #t "~1Tframe-num: ~f~%" (-> this frame-num)) + (format #t "~1Tframe-speed: ~f~%" (-> this frame-speed)) + (format #t "~1Tframe-num2: ~f~%" (-> this frame-num2)) + (format #t "~1Tframe-speed2: ~f~%" (-> this frame-speed2)) + (format #t "~1Tcloud-interp: ~f~%" (-> this constant w)) + (format #t "~1Tscales: #~%" (-> this scales)) + (format #t "~1Tmask-hi: #~%" (-> this mask-hi)) + (format #t "~1Tmask-lo: #~%" (-> this mask-lo)) + (format #t "~1Tlights: #~%" (-> this lights)) + (format #t "~1Tuv-scroll-0: #~%" (-> this uv-scroll-0)) + (format #t "~1Tuv-scroll-1: #~%" (-> this uv-scroll-1)) + (format #t "~1Tst-scroll: #~%" (-> this st-scroll)) + (format #t "~1Twait-to-vu0: ~D~%" (-> this wait-to-vu0)) (label cfg-4) - obj + this ) ;; definition for symbol *ocean-map*, type ocean-map diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc index e41598f05a..dfed490099 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-mid_REF.gc @@ -7,7 +7,7 @@ ;; definition for method 47 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-setup-constants ocean ((obj ocean) (arg0 ocean-mid-constants)) +(defmethod ocean-mid-setup-constants ocean ((this ocean) (arg0 ocean-mid-constants)) (let ((v1-0 *math-camera*)) (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) @@ -228,7 +228,7 @@ (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :tcc #x1 :th (log2 128) :tw (log2 128)) ) (set! (-> arg0 drw-texture prims 1) (gs-reg64 tex0-1)) - (set! (-> arg0 drw-texture tex1) (-> obj tex1)) + (set! (-> arg0 drw-texture tex1) (-> this tex1)) (set! (-> arg0 drw-texture prims 3) (gs-reg64 tex1-1)) (set! (-> arg0 drw-texture miptbp1) (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0)) (set! (-> arg0 drw-texture prims 5) (gs-reg64 miptbp1-1)) @@ -290,7 +290,7 @@ ;; definition for method 48 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-constants ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-mid-add-constants ocean ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 36) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -302,14 +302,14 @@ ) (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) ) - (ocean-mid-setup-constants obj (the-as ocean-mid-constants (-> arg0 base))) + (ocean-mid-setup-constants this (the-as ocean-mid-constants (-> arg0 base))) (&+! (-> arg0 base) 576) 0 (none) ) ;; definition for method 43 of type ocean -(defmethod ocean-matrix*! ocean ((obj ocean) (arg0 matrix) (arg1 matrix) (arg2 matrix)) +(defmethod ocean-matrix*! ocean ((this ocean) (arg0 matrix) (arg1 matrix) (arg2 matrix)) (rlet ((acc :class vf) (vf1 :class vf) (vf10 :class vf) @@ -357,7 +357,7 @@ ) ;; definition for method 44 of type ocean -(defmethod ocean-vector-matrix*! ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 matrix)) +(defmethod ocean-vector-matrix*! ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 matrix)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -384,7 +384,7 @@ ;; definition for method 45 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-matrices ocean ((obj ocean) (arg0 dma-buffer) (arg1 vector)) +(defmethod ocean-mid-add-matrices ocean ((this ocean) (arg0 dma-buffer) (arg1 vector)) (let ((s4-0 (new-stack-vector0)) (v1-3 (if (-> *time-of-day-context* use-camera-other) (-> *math-camera* camera-rot-other) @@ -423,7 +423,7 @@ (set! (-> (the-as vector s2-0) z) (-> s4-0 z)) ) (let ((a1-5 (&+ (-> arg0 base) 64))) - (ocean-matrix*! obj (the-as matrix a1-5) (the-as matrix s3-0) (-> *math-camera* perspective)) + (ocean-matrix*! this (the-as matrix a1-5) (the-as matrix s3-0) (-> *math-camera* perspective)) ) ) ) @@ -434,7 +434,7 @@ ;; definition for method 46 of type ocean ;; INFO: Used lq/sq -(defmethod ocean-mid-check ocean ((obj ocean) (arg0 pointer) (arg1 int) (arg2 int) (arg3 vector)) +(defmethod ocean-mid-check ocean ((this ocean) (arg0 pointer) (arg1 int) (arg2 int) (arg3 vector)) (local-vars (v0-0 symbol) (v1-10 float) (t0-3 float) (t0-8 float) (t0-13 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -513,7 +513,7 @@ ;; definition for method 41 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-call ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-mid-add-call ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -528,7 +528,7 @@ ;; definition for method 42 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-call-flush ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint)) +(defmethod ocean-mid-add-call-flush ocean ((this ocean) (arg0 dma-buffer) (arg1 uint)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -544,7 +544,7 @@ ;; definition for method 52 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod ocean-mid-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float)) +(defmethod ocean-mid-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 float)) (local-vars (sv-32 int)) (set! sv-32 arg1) (let ((s0-0 arg2) @@ -553,14 +553,14 @@ (s2-0 arg5) (s5-0 (new-stack-vector0)) ) - (let ((v1-0 (-> obj start-corner))) + (let ((v1-0 (-> this start-corner))) (set! (-> s5-0 x) (+ (-> v1-0 x) (* 3145728.0 (the float s0-0)))) (set! (-> s5-0 y) (-> v1-0 y)) (set! (-> s5-0 z) (+ (-> v1-0 z) (* 3145728.0 (the float sv-32)))) ) (set! (-> s5-0 w) 1.0) - (ocean-mid-add-matrices obj arg0 s5-0) - (let ((v1-6 (+ (the-as uint (-> obj ocean-colors)) (* (+ (* 416 sv-32) (* s0-0 8)) 4)))) + (ocean-mid-add-matrices this arg0 s5-0) + (let ((v1-6 (+ (the-as uint (-> this ocean-colors)) (* (+ (* 416 sv-32) (* s0-0 8)) 4)))) (dotimes (a0-7 9) (let* ((a1-4 arg0) (a2-2 (the-as object (-> a1-4 base))) @@ -590,8 +590,8 @@ (set! (-> v1-9 base) (&+ (the-as pointer a0-8) 16)) ) (let ((v1-10 (-> arg0 base))) - (let ((a0-12 (-> obj ocean-mid-masks data s1-0))) - (set! (-> obj mid-mask-ptrs s4-0) v1-10) + (let ((a0-12 (-> this ocean-mid-masks data s1-0))) + (set! (-> this mid-mask-ptrs s4-0) v1-10) (set! (-> (the-as (pointer uint64) v1-10)) (-> a0-12 dword)) ) (set! (-> (the-as (pointer uint64) v1-10) 1) (the-as uint 0)) @@ -599,7 +599,7 @@ (&+! (-> arg0 base) 16) (when (< s2-0 556091.4) (let* ((v1-15 (-> *math-camera* trans)) - (s4-1 (&-> obj mid-camera-masks s4-0)) + (s4-1 (&-> this mid-camera-masks s4-0)) (s3-1 (+ (the int (* 0.0000025431316 (- (-> v1-15 x) (-> s5-0 x)))) -1)) (s2-1 (+ (the int (* 0.0000025431316 (- (-> v1-15 z) (-> s5-0 z)))) -1)) ) @@ -609,7 +609,7 @@ (a3-6 (+ s1-1 s2-1)) ) (if (and (>= a2-7 0) (>= a3-6 0) (< a2-7 8) (< a3-6 8)) - (ocean-mid-check obj s4-1 a2-7 a3-6 s5-0) + (ocean-mid-check this s4-1 a2-7 a3-6 s5-0) ) ) ) @@ -621,7 +621,7 @@ ) ;; definition for method 49 of type ocean -(defmethod ocean-mid-camera-masks-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-camera-masks-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #t @@ -633,14 +633,14 @@ (v1-1 (logand arg1 7)) (a2-3 (+ (* 6 (the-as int t0-0)) a3-3)) ) - (logtest? (-> (the-as (pointer uint8) (+ (+ a1-1 (* a2-3 8)) (the-as uint obj))) 2384) (ash 1 v1-1)) + (logtest? (-> (the-as (pointer uint8) (+ (+ a1-1 (* a2-3 8)) (the-as uint this))) 2384) (ash 1 v1-1)) ) ) ) ) ;; definition for method 50 of type ocean -(defmethod ocean-mid-mask-ptrs-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-mask-ptrs-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #t @@ -652,8 +652,8 @@ (v1-1 (logand arg1 7)) (a2-3 (+ (* 6 (the-as int t0-0)) a3-3)) ) - (if (-> obj mid-mask-ptrs a2-3) - (logtest? (-> (the-as (pointer uint8) (+ a1-1 (the-as uint (-> obj mid-mask-ptrs a2-3))))) (ash 1 v1-1)) + (if (-> this mid-mask-ptrs a2-3) + (logtest? (-> (the-as (pointer uint8) (+ a1-1 (the-as uint (-> this mid-mask-ptrs a2-3))))) (ash 1 v1-1)) #t ) ) @@ -662,7 +662,7 @@ ) ;; definition for method 51 of type ocean -(defmethod ocean-mid-camera-masks-set! ocean ((obj ocean) (arg0 uint) (arg1 uint)) +(defmethod ocean-mid-camera-masks-set! ocean ((this ocean) (arg0 uint) (arg1 uint)) (cond ((or (< (the-as int arg0) 0) (>= (the-as int arg0) 48) (< (the-as int arg1) 0) (>= (the-as int arg1) 48)) #f @@ -673,12 +673,12 @@ (v1-1 (logand arg0 7)) (a1-1 (logand arg1 7)) (a3-4 (+ (* 6 (the-as int t0-0)) a3-3)) - (a2-5 (&-> obj mid-camera-masks a3-4)) + (a2-5 (&-> this mid-camera-masks a3-4)) ) (cond (a2-5 (cond - ((logtest? (-> (the-as (pointer uint8) (+ v1-1 (the-as uint (-> obj mid-mask-ptrs a3-4))))) (ash 1 a1-1)) + ((logtest? (-> (the-as (pointer uint8) (+ v1-1 (the-as uint (-> this mid-mask-ptrs a3-4))))) (ash 1 a1-1)) #f ) (else @@ -699,7 +699,7 @@ ;; definition for method 53 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-upload-table ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) +(defmethod ocean-mid-add-upload-table ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 (pointer float)) (arg4 int) (arg5 symbol)) (local-vars (v1-13 float) (a0-20 uint128) @@ -716,15 +716,15 @@ (vf3 :class vf) (vf4 :class vf) ) - (when (ocean-mid-camera-masks-set! obj arg1 arg2) + (when (ocean-mid-camera-masks-set! this arg1 arg2) (let ((a2-2 (new-stack-vector0))) - (let ((v1-3 (-> obj start-corner))) + (let ((v1-3 (-> this start-corner))) (set! (-> a2-2 x) (+ (-> v1-3 x) (* 393216.0 (the float arg2)))) (set! (-> a2-2 y) (-> v1-3 y)) (set! (-> a2-2 z) (+ (-> v1-3 z) (* 393216.0 (the float arg1)))) ) (set! (-> a2-2 w) 1.0) - (ocean-mid-add-matrices obj arg0 a2-2) + (ocean-mid-add-matrices this arg0 a2-2) ) (let* ((a1-3 9) (v1-8 arg0) @@ -744,10 +744,10 @@ (set! (-> v1-12 1 quad) (-> *ocean-trans-st-table* 1 quad)) (set! (-> v1-12 2 quad) (-> *ocean-trans-st-table* 2 quad)) (set! (-> v1-12 3 quad) (-> *ocean-trans-st-table* 3 quad)) - (let ((a0-19 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) - (a1-12 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) - (a2-15 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) - (a3-9 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) + (let ((a0-19 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) + (a1-12 (the-as uint128 (-> this ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) + (a2-15 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) + (a3-9 (the-as uint128 (-> this ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) ) (.pextlb a0-20 0 a0-19) (nop!) @@ -800,8 +800,8 @@ (set! (-> v1-16 base) (&+ (the-as pointer a0-23) 16)) ) (if arg5 - (ocean-mid-add-call obj arg0 275) - (ocean-mid-add-call obj arg0 107) + (ocean-mid-add-call this arg0 275) + (ocean-mid-add-call this arg0 107) ) ) 0 @@ -811,35 +811,35 @@ ;; definition for method 54 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-upload-top ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) - (let ((s0-0 (-> obj mid-minx)) - (s2-0 (-> obj mid-maxx)) - (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) +(defmethod ocean-mid-add-upload-top ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> this mid-minx)) + (s2-0 (-> this mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) ) (cond - ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ((ocean-mid-mask-ptrs-bit? this arg1 arg2) ) ((= arg2 s0-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) ) (else - (let ((s2-1 (ocean-mid-mask-ptrs-bit? obj (+ arg1 1) arg2)) - (v1-12 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1))) + (let ((s2-1 (ocean-mid-mask-ptrs-bit? this (+ arg1 1) arg2)) + (v1-12 (ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 1))) ) (cond ((and s2-1 v1-12) ) (s2-1 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-right-table* 7 #t) ) (v1-12 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-down-table* 7 #t) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-right-table* 10 #f) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-down-right-table* 10 #f) ) ) ) @@ -849,24 +849,24 @@ ((= arg2 s2-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) ) (else - (let ((s2-2 (ocean-mid-mask-ptrs-bit? obj (+ arg1 1) arg2)) - (v1-27 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1))) + (let ((s2-2 (ocean-mid-mask-ptrs-bit? this (+ arg1 1) arg2)) + (v1-27 (ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 -1))) ) (cond ((and s2-2 v1-27) ) (s2-2 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-left-table* 7 #t) ) (v1-27 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-down-table* 7 #t) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-down-left-table* 10 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-down-left-table* 10 #t) ) ) ) @@ -874,7 +874,7 @@ ) ) (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 -1) arg2 *ocean-down-table* 7 #t) ) ) ) @@ -884,35 +884,35 @@ ;; definition for method 55 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-upload-middle ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) - (let ((s0-0 (-> obj mid-minx)) - (s2-0 (-> obj mid-maxx)) - (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) +(defmethod ocean-mid-add-upload-middle ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> this mid-minx)) + (s2-0 (-> this mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) ) (cond - ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ((ocean-mid-mask-ptrs-bit? this arg1 arg2) ) ((= arg2 s0-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) ) - ((ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1)) + ((ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 1)) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-right-table* 7 #t) ) ) ) ((= arg2 s2-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) ) - ((ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1)) + ((ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 -1)) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-left-table* 7 #t) ) ) ) @@ -924,35 +924,35 @@ ;; definition for method 56 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-mid-add-upload-bottom ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) - (let ((s0-0 (-> obj mid-minx)) - (s2-0 (-> obj mid-maxx)) - (s1-0 (ocean-mid-camera-masks-bit? obj arg1 arg2)) +(defmethod ocean-mid-add-upload-bottom ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (let ((s0-0 (-> this mid-minx)) + (s2-0 (-> this mid-maxx)) + (s1-0 (ocean-mid-camera-masks-bit? this arg1 arg2)) ) (cond - ((ocean-mid-mask-ptrs-bit? obj arg1 arg2) + ((ocean-mid-mask-ptrs-bit? this arg1 arg2) ) ((= arg2 s0-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 -1) *ocean-right-table* 7 #t) ) (else - (let ((s2-1 (ocean-mid-mask-ptrs-bit? obj (+ arg1 -1) arg2)) - (v1-12 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 1))) + (let ((s2-1 (ocean-mid-mask-ptrs-bit? this (+ arg1 -1) arg2)) + (v1-12 (ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 1))) ) (cond ((and s2-1 v1-12) ) (s2-1 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-right-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-right-table* 7 #t) ) (v1-12 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-up-table* 7 #t) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-right-table* 10 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-up-right-table* 10 #t) ) ) ) @@ -962,24 +962,24 @@ ((= arg2 s2-0) (cond (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) - (ocean-mid-add-upload-table obj arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 (+ arg2 1) *ocean-left-table* 7 #t) ) (else - (let ((s2-2 (ocean-mid-mask-ptrs-bit? obj (+ arg1 -1) arg2)) - (v1-27 (ocean-mid-mask-ptrs-bit? obj arg1 (+ arg2 -1))) + (let ((s2-2 (ocean-mid-mask-ptrs-bit? this (+ arg1 -1) arg2)) + (v1-27 (ocean-mid-mask-ptrs-bit? this arg1 (+ arg2 -1))) ) (cond ((and s2-2 v1-27) ) (s2-2 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-left-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-left-table* 7 #t) ) (v1-27 - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-up-table* 7 #t) ) (else - (ocean-mid-add-upload-table obj arg0 arg1 arg2 *ocean-up-left-table* 10 #f) + (ocean-mid-add-upload-table this arg0 arg1 arg2 *ocean-up-left-table* 10 #f) ) ) ) @@ -987,7 +987,7 @@ ) ) (s1-0 - (ocean-mid-add-upload-table obj arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) + (ocean-mid-add-upload-table this arg0 (+ arg1 1) arg2 *ocean-up-table* 7 #t) ) ) ) @@ -997,7 +997,7 @@ ;; definition for method 57 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-seams-add-constants ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-seams-add-constants ocean ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 4) (v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) @@ -1022,15 +1022,15 @@ ;; definition for method 58 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-mid-seams ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-mid-seams ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) - (ocean-seams-add-constants obj arg0) - (set! sv-32 (-> obj mid-minx)) - (set! sv-33 (-> obj mid-maxx)) - (set! sv-34 (-> obj mid-minz)) - (set! sv-35 (-> obj mid-maxz)) + (ocean-seams-add-constants this arg0) + (set! sv-32 (-> this mid-minx)) + (set! sv-33 (-> this mid-maxx)) + (set! sv-34 (-> this mid-minz)) + (set! sv-35 (-> this mid-maxz)) (set! sv-36 (new 'stack 'sphere)) - (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 y) (-> this start-corner y)) (set! (-> sv-36 r) 278045.7) (let ((s4-0 sv-34) (s3-0 sv-35) @@ -1040,18 +1040,18 @@ (s1-0 sv-33) ) (while (>= s1-0 s2-0) - (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> obj start-corner x))) - (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> obj start-corner z))) + (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> this start-corner x))) + (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> this start-corner z))) (when (sphere-cull sv-36) (cond ((= s4-0 sv-34) - (ocean-mid-add-upload-top obj arg0 s4-0 s2-0) + (ocean-mid-add-upload-top this arg0 s4-0 s2-0) ) ((= s4-0 sv-35) - (ocean-mid-add-upload-bottom obj arg0 s4-0 s2-0) + (ocean-mid-add-upload-bottom this arg0 s4-0 s2-0) ) (else - (ocean-mid-add-upload-middle obj arg0 s4-0 s2-0) + (ocean-mid-add-upload-middle this arg0 s4-0 s2-0) ) ) ) @@ -1062,8 +1062,8 @@ ) ) (dotimes (v1-29 36) - (if (and (-> obj mid-mask-ptrs v1-29) (nonzero? (-> obj mid-camera-masks v1-29))) - (logior! (-> (the-as (pointer uint64) (-> obj mid-mask-ptrs v1-29))) (-> obj mid-camera-masks v1-29)) + (if (and (-> this mid-mask-ptrs v1-29) (nonzero? (-> this mid-camera-masks v1-29))) + (logior! (-> (the-as (pointer uint64) (-> this mid-mask-ptrs v1-29))) (-> this mid-camera-masks v1-29)) ) ) 0 @@ -1073,7 +1073,7 @@ ;; definition for method 59 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-mid ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-mid ocean ((this ocean) (arg0 dma-buffer)) (local-vars (v1-8 float) (v1-9 float) (sv-32 int)) (rlet ((vf16 :class vf) (vf17 :class vf) @@ -1085,8 +1085,8 @@ (vf23 :class vf) ) (dotimes (v1-0 36) - (set! (-> obj mid-mask-ptrs v1-0) (the-as pointer #f)) - (set! (-> obj mid-camera-masks v1-0) (the-as uint 0)) + (set! (-> this mid-mask-ptrs v1-0) (the-as pointer #f)) + (set! (-> this mid-camera-masks v1-0) (the-as uint 0)) ) (dma-buffer-add-vu-function arg0 ocean-mid-block 1) (let* ((v1-3 arg0) @@ -1097,8 +1097,8 @@ (set! (-> (the-as dma-packet a0-6) vif1) (new 'static 'vif-tag :imm #x76 :cmd (vif-cmd offset))) (set! (-> v1-3 base) (&+ (the-as pointer a0-6) 16)) ) - (ocean-mid-add-constants obj arg0) - (ocean-mid-add-call obj arg0 0) + (ocean-mid-add-constants this arg0) + (ocean-mid-add-call this arg0 0) (let ((v1-7 *math-camera*)) (cond ((-> *time-of-day-context* use-camera-other) @@ -1130,15 +1130,15 @@ (dotimes (s3-0 6) (dotimes (s2-0 6) (let* ((s1-0 (+ (* 6 s3-0) s2-0)) - (s0-0 (-> obj ocean-spheres spheres s1-0)) + (s0-0 (-> this ocean-spheres spheres s1-0)) ) - (set! sv-32 (-> (the-as (pointer int16) (+ (* s1-0 2) (the-as int (-> obj ocean-mid-indices)))))) + (set! sv-32 (-> (the-as (pointer int16) (+ (* s1-0 2) (the-as int (-> this ocean-mid-indices)))))) (when (sphere-cull s0-0) (cond ((< sv-32 0) ) ((let ((f30-0 (- (vector-vector-distance s0-0 s4-0) (-> s0-0 r)))) - (let ((a0-16 obj) + (let ((a0-16 this) (t9-5 (method-of-type ocean ocean-mid-add-upload)) (a1-8 arg0) (a2-2 s3-0) @@ -1149,13 +1149,13 @@ ) (< f30-0 786432.0) ) - (ocean-mid-add-call obj arg0 73) + (ocean-mid-add-call this arg0 73) (+! (-> *terrain-stats* ocean-mid fragments) 1) (+! (-> *terrain-stats* ocean-mid tris) 256) (+! (-> *terrain-stats* ocean-mid dverts) 288) ) (else - (ocean-mid-add-call obj arg0 46) + (ocean-mid-add-call this arg0 46) (+! (-> *terrain-stats* ocean-mid fragments) 1) (+! (-> *terrain-stats* ocean-mid tris) 128) (+! (-> *terrain-stats* ocean-mid dverts) 144) @@ -1166,7 +1166,7 @@ ) ) ) - (when (not (or (-> obj near-off) (< 196608.0 (fabs (- (-> obj start-corner y) (-> *math-camera* trans y)))))) + (when (not (or (-> this near-off) (< 196608.0 (fabs (- (-> this start-corner y) (-> *math-camera* trans y)))))) (let ((a1-11 48) (a2-5 0) (v1-53 48) @@ -1174,7 +1174,7 @@ ) (dotimes (a3-1 6) (dotimes (t0-1 6) - (let ((t1-6 (&-> obj mid-camera-masks (+ (* 6 a3-1) t0-1)))) + (let ((t1-6 (&-> this mid-camera-masks (+ (* 6 a3-1) t0-1)))) (when (nonzero? (-> t1-6 0)) (dotimes (t2-3 8) (let ((t3-1 (-> (the-as (pointer uint8) (+ t2-3 (the-as int t1-6))) 0))) @@ -1206,24 +1206,20 @@ ) ) ) - (set! (-> obj mid-minx) (the-as uint a1-11)) - (set! (-> obj mid-maxx) (the-as uint a2-5)) - (set! (-> obj mid-minz) (the-as uint v1-53)) - (set! (-> obj mid-maxz) (the-as uint a0-25)) + (set! (-> this mid-minx) (the-as uint a1-11)) + (set! (-> this mid-maxx) (the-as uint a2-5)) + (set! (-> this mid-minz) (the-as uint v1-53)) + (set! (-> this mid-maxz) (the-as uint a0-25)) (when (and (< a1-11 a2-5) (< v1-53 a0-25)) - (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) - (ocean-mid-add-call-flush obj arg0 (the-as uint 43)) - (draw-ocean-transition obj arg0) - (draw-ocean-mid-seams obj arg0) + (ocean-mid-add-call-flush this arg0 (the-as uint 41)) + (ocean-mid-add-call-flush this arg0 (the-as uint 43)) + (draw-ocean-transition this arg0) + (draw-ocean-mid-seams this arg0) ) ) ) - (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + (ocean-mid-add-call-flush this arg0 (the-as uint 41)) 0 (none) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc index 2a83730737..8170acd694 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-near_REF.gc @@ -6,7 +6,7 @@ ;; definition for method 22 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-add-call ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-near-add-call ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -21,7 +21,7 @@ ;; definition for method 23 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-add-call-flush ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-near-add-call-flush ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -37,7 +37,7 @@ ;; definition for method 24 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-setup-constants ocean ((obj ocean) (arg0 ocean-near-constants)) +(defmethod ocean-near-setup-constants ocean ((this ocean) (arg0 ocean-near-constants)) (let ((v1-0 *math-camera*)) (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) @@ -302,7 +302,7 @@ (set! (-> arg0 drw-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) (set! (-> arg0 drw-texture tex0) (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :th (log2 128) :tw (log2 128))) (set! (-> arg0 drw-texture prims 1) (gs-reg64 tex0-1)) - (set! (-> arg0 drw-texture tex1) (-> obj tex1-near)) + (set! (-> arg0 drw-texture tex1) (-> this tex1-near)) (set! (-> arg0 drw-texture prims 3) (gs-reg64 tex1-1)) (set! (-> arg0 drw-texture miptbp1) (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0)) (set! (-> arg0 drw-texture prims 5) (gs-reg64 miptbp1-1)) @@ -369,7 +369,7 @@ ;; definition for method 25 of type ocean ;; WARN: Return type mismatch pointer vs none. -(defmethod ocean-near-add-constants ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-near-add-constants ocean ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 37) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -381,16 +381,16 @@ ) (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) ) - (ocean-near-setup-constants obj (the-as ocean-near-constants (-> arg0 base))) + (ocean-near-setup-constants this (the-as ocean-near-constants (-> arg0 base))) (&+! (-> arg0 base) 592) (none) ) ;; definition for method 26 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-add-heights ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-near-add-heights ocean ((this ocean) (arg0 dma-buffer)) (let ((v1-0 128) - (a0-1 (-> obj heights)) + (a0-1 (-> this heights)) ) (let* ((a2-0 arg0) (a3-0 (the-as object (-> a2-0 base))) @@ -422,7 +422,7 @@ ;; definition for method 27 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-add-matrices ocean ((obj ocean) (arg0 dma-buffer) (arg1 vector)) +(defmethod ocean-near-add-matrices ocean ((this ocean) (arg0 dma-buffer) (arg1 vector)) (let ((s4-0 (new-stack-vector0))) (if (-> *time-of-day-context* use-camera-other) (-> *math-camera* camera-rot-other) @@ -459,7 +459,7 @@ (set! (-> (the-as vector s2-0) z) (-> s4-0 z)) ) (let ((a1-7 (&+ (-> arg0 base) 64))) - (ocean-matrix*! obj (the-as matrix a1-7) (the-as matrix s3-0) (-> *math-camera* perspective)) + (ocean-matrix*! this (the-as matrix a1-7) (the-as matrix s3-0) (-> *math-camera* perspective)) ) ) ) @@ -471,7 +471,7 @@ ;; definition for method 28 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-near-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) +(defmethod ocean-near-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) (local-vars (v1-17 uint128) (v1-18 uint128) @@ -498,17 +498,17 @@ (vf8 :class vf) (vf9 :class vf) ) - (let ((s1-0 (-> obj mid-minx)) - (s2-0 (-> obj mid-minz)) + (let ((s1-0 (-> this mid-minx)) + (s2-0 (-> this mid-minz)) ) (let ((a2-1 (new-stack-vector0))) - (let ((v1-0 (-> obj start-corner))) + (let ((v1-0 (-> this start-corner))) (set! (-> a2-1 x) (+ (-> v1-0 x) (* 98304.0 (the float arg2)))) (set! (-> a2-1 y) (-> v1-0 y)) (set! (-> a2-1 z) (+ (-> v1-0 z) (* 98304.0 (the float arg1)))) ) (set! (-> a2-1 w) 1.0) - (ocean-near-add-matrices obj arg0 a2-1) + (ocean-near-add-matrices this arg0 a2-1) ) (let* ((a1-2 8) (v1-5 arg0) @@ -528,10 +528,10 @@ (a3-3 (shr a1-7 2)) (a0-7 (logand a0-6 3)) (a1-8 (logand a1-7 3)) - (a2-10 (-> (the-as (pointer int16) (+ (* (+ (* a3-3 4) a2-6) 2) (the-as uint obj))) 4002)) - (a3-7 (-> obj ocean-near-indices data a2-10)) + (a2-10 (-> (the-as (pointer int16) (+ (* (+ (* a3-3 4) a2-6) 2) (the-as uint this))) 4002)) + (a3-7 (-> this ocean-near-indices data a2-10)) (a0-13 - (-> obj ocean-mid-masks data (-> (the-as (pointer int16) (+ (* (+ (* a1-8 4) a0-7) 2) (the-as uint a3-7))))) + (-> this ocean-mid-masks data (-> (the-as (pointer int16) (+ (* (+ (* a1-8 4) a0-7) 2) (the-as uint a3-7))))) ) ) (set-vector! @@ -586,10 +586,10 @@ (.lvf vf8 (&-> (-> *ocean-trans-corner-table* 0 vector (+ a2-19 6)) quad)) ) (.mov a2-23 vf8) - (let ((a2-29 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int v1-10)) a0-15)))) - (a3-24 (the-as uint128 (-> obj ocean-colors colors (+ a0-15 1 (* 52 (the-as int v1-10)))))) - (t0-17 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ v1-10 1))) a0-15)))) - (v1-16 (the-as uint128 (-> obj ocean-colors colors (+ a0-15 1 (* 52 (the-as int (+ v1-10 1))))))) + (let ((a2-29 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int v1-10)) a0-15)))) + (a3-24 (the-as uint128 (-> this ocean-colors colors (+ a0-15 1 (* 52 (the-as int v1-10)))))) + (t0-17 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int (+ v1-10 1))) a0-15)))) + (v1-16 (the-as uint128 (-> this ocean-colors colors (+ a0-15 1 (* 52 (the-as int (+ v1-10 1))))))) ) (.pextlb a0-18 0 a2-29) (nop!) @@ -664,7 +664,7 @@ ;; definition for method 29 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-near ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-near ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-16 uint)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))) @@ -678,31 +678,31 @@ (set! (-> (the-as dma-packet a0-8) vif1) (new 'static 'vif-tag :imm #x10 :cmd (vif-cmd offset))) (set! (-> v1-3 base) (&+ (the-as pointer a0-8) 16)) ) - (ocean-near-add-constants obj arg0) - (ocean-near-add-heights obj arg0) - (ocean-near-add-call obj arg0 0) - (let ((s4-0 (-> obj near-minx)) - (s3-0 (-> obj near-maxx)) - (s2-0 (-> obj near-minz)) - (s1-0 (-> obj near-maxz)) + (ocean-near-add-constants this arg0) + (ocean-near-add-heights this arg0) + (ocean-near-add-call this arg0 0) + (let ((s4-0 (-> this near-minx)) + (s3-0 (-> this near-maxx)) + (s2-0 (-> this near-minz)) + (s1-0 (-> this near-maxz)) ) (when (and (< s4-0 s3-0) (< s2-0 s1-0)) (while (>= s1-0 s2-0) (let ((s0-0 s4-0)) (set! sv-16 s3-0) (while (>= sv-16 s0-0) - (when (ocean-trans-camera-masks-bit? obj s2-0 s0-0) - (let* ((a1-16 (- (shr s0-0 2) (-> obj mid-minx))) - (a2-3 (- (shr s2-0 2) (-> obj mid-minz))) + (when (ocean-trans-camera-masks-bit? this s2-0 s0-0) + (let* ((a1-16 (- (shr s0-0 2) (-> this mid-minx))) + (a2-3 (- (shr s2-0 2) (-> this mid-minz))) (v1-13 (logand s0-0 3)) (a0-17 (logand s2-0 3)) - (a1-20 (-> (the-as (pointer int16) (+ (* (+ (* a2-3 4) a1-16) 2) (the-as uint obj))) 4002)) + (a1-20 (-> (the-as (pointer int16) (+ (* (+ (* a2-3 4) a1-16) 2) (the-as uint this))) 4002)) ) (when (>= a1-20 0) - (let ((a1-22 (-> obj ocean-near-indices data a1-20))) + (let ((a1-22 (-> this ocean-near-indices data a1-20))) (when (>= (-> (the-as (pointer int16) (+ (* (+ (* a0-17 4) v1-13) 2) (the-as uint a1-22)))) 0) - (ocean-near-add-upload obj arg0 s2-0 s0-0) - (ocean-near-add-call obj arg0 39) + (ocean-near-add-upload this arg0 s2-0 s0-0) + (ocean-near-add-call this arg0 39) ) ) ) @@ -718,7 +718,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc index 51e2f1b62c..542e6f4f34 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-texture_REF.gc @@ -6,7 +6,7 @@ ;; definition for method 70 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-setup-constants ocean ((obj ocean) (arg0 ocean-texture-constants)) +(defmethod ocean-texture-setup-constants ocean ((this ocean) (arg0 ocean-texture-constants)) (set! (-> arg0 giftag tag) (new 'static 'gif-tag64 :nloop #x42 @@ -34,7 +34,7 @@ ;; definition for method 71 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-constants ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-constants ocean ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 7) (v1-0 arg0) (a1-1 (the-as object (-> v1-0 base))) @@ -46,7 +46,7 @@ ) (set! (-> v1-0 base) (&+ (the-as pointer a1-1) 16)) ) - (ocean-texture-setup-constants obj (the-as ocean-texture-constants (-> arg0 base))) + (ocean-texture-setup-constants this (the-as ocean-texture-constants (-> arg0 base))) (&+! (-> arg0 base) 112) 0 (none) @@ -55,10 +55,10 @@ ;; definition for method 72 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-envmap ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-envmap ocean ((this ocean) (arg0 dma-buffer)) (let ((v1-0 (the-as object (-> arg0 base)))) - (set! (-> (the-as (inline-array vector4w) v1-0) 0 quad) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (inline-array vector4w) v1-0) 1 quad) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (inline-array vector4w) v1-0) 0 quad) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-0) 1 quad) (-> this adgif-tmpl quad 1)) (let ((s4-0 (&+ (the-as pointer v1-0) 32))) (adgif-shader<-texture-simple! (the-as adgif-shader s4-0) @@ -73,7 +73,7 @@ ;; definition for method 73 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-verts ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod ocean-texture-add-verts ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -90,7 +90,7 @@ ;; definition for method 74 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-verts-last ocean ((obj ocean) (arg0 dma-buffer) (arg1 int) (arg2 int)) +(defmethod ocean-texture-add-verts-last ocean ((this ocean) (arg0 dma-buffer) (arg1 int) (arg2 int)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -117,7 +117,7 @@ ;; definition for method 75 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-call-start ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-start ocean ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -132,7 +132,7 @@ ;; definition for method 76 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-call-rest ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-rest ocean ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -147,7 +147,7 @@ ;; definition for method 77 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-texture-add-call-done ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-texture-add-call-done ocean ((this ocean) (arg0 dma-buffer)) (let* ((v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) ) @@ -162,9 +162,9 @@ ;; definition for method 78 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-texture ocean ((obj ocean) (arg0 dma-buffer) (arg1 int)) +(defmethod draw-ocean-texture ocean ((this ocean) (arg0 dma-buffer) (arg1 int)) (set-display-gs-state arg0 21 128 128 0 0) - (ocean-texture-add-envmap obj arg0) + (ocean-texture-add-envmap this arg0) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always))) (alpha-1 (new 'static 'gs-alpha :b #x2 :d #x1)) @@ -179,22 +179,22 @@ (set! (-> (the-as dma-packet a0-10) vif1) (new 'static 'vif-tag :imm #xc0 :cmd (vif-cmd offset))) (set! (-> v1-5 base) (&+ (the-as pointer a0-10) 16)) ) - (ocean-texture-add-constants obj arg0) + (ocean-texture-add-constants this arg0) (let ((s3-0 (+ arg1 0))) - (ocean-texture-add-verts obj arg0 s3-0) + (ocean-texture-add-verts this arg0 s3-0) (let ((s3-1 (+ s3-0 3072))) - (ocean-texture-add-call-start obj arg0) + (ocean-texture-add-call-start this arg0) (dotimes (s2-0 9) - (ocean-texture-add-verts obj arg0 s3-1) + (ocean-texture-add-verts this arg0 s3-1) (+! s3-1 3072) - (ocean-texture-add-call-rest obj arg0) + (ocean-texture-add-call-rest this arg0) ) - (ocean-texture-add-verts-last obj arg0 s3-1 (+ arg1 0)) + (ocean-texture-add-verts-last this arg0 s3-1 (+ arg1 0)) ) ) - (ocean-texture-add-call-rest obj arg0) - (ocean-texture-add-call-done obj arg0) - (ocean-method-81 obj arg0) + (ocean-texture-add-call-rest this arg0) + (ocean-texture-add-call-done this arg0) + (ocean-method-81 this arg0) (reset-display-gs-state *display* arg0) 0 (none) @@ -203,7 +203,7 @@ ;; definition for method 79 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-79 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-79 ocean ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 53 64 64 0 0) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -214,13 +214,13 @@ (texflush 0) ) (let ((v1-17 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-17 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-17 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-17 2 quad) (-> obj color80808040 quad)) - (set! (-> v1-17 3 quad) (-> obj uv00 quad)) - (set! (-> v1-17 4 quad) (-> obj xy00 quad)) - (set! (-> v1-17 5 quad) (-> obj uv8080 quad)) - (set! (-> v1-17 6 quad) (-> obj xy4040 quad)) + (set! (-> v1-17 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-17 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-17 2 quad) (-> this color80808040 quad)) + (set! (-> v1-17 3 quad) (-> this uv00 quad)) + (set! (-> v1-17 4 quad) (-> this xy00 quad)) + (set! (-> v1-17 5 quad) (-> this uv8080 quad)) + (set! (-> v1-17 6 quad) (-> this xy4040 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 61 32 32 0 0) @@ -229,13 +229,13 @@ (texflush 0) ) (let ((v1-30 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-30 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-30 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-30 2 quad) (-> obj color80808000 quad)) - (set! (-> v1-30 3 quad) (-> obj uv00 quad)) - (set! (-> v1-30 4 quad) (-> obj xy00 quad)) - (set! (-> v1-30 5 quad) (-> obj uv4040 quad)) - (set! (-> v1-30 6 quad) (-> obj xy2020 quad)) + (set! (-> v1-30 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-30 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-30 2 quad) (-> this color80808000 quad)) + (set! (-> v1-30 3 quad) (-> this uv00 quad)) + (set! (-> v1-30 4 quad) (-> this xy00 quad)) + (set! (-> v1-30 5 quad) (-> this uv4040 quad)) + (set! (-> v1-30 6 quad) (-> this xy2020 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 63 16 16 0 0) @@ -244,13 +244,13 @@ (texflush 0) ) (let ((v1-43 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-43 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-43 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-43 2 quad) (-> obj color80808000 quad)) - (set! (-> v1-43 3 quad) (-> obj uv00 quad)) - (set! (-> v1-43 4 quad) (-> obj xy00 quad)) - (set! (-> v1-43 5 quad) (-> obj uv2020 quad)) - (set! (-> v1-43 6 quad) (-> obj xy1010 quad)) + (set! (-> v1-43 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-43 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-43 2 quad) (-> this color80808000 quad)) + (set! (-> v1-43 3 quad) (-> this uv00 quad)) + (set! (-> v1-43 4 quad) (-> this xy00 quad)) + (set! (-> v1-43 5 quad) (-> this uv2020 quad)) + (set! (-> v1-43 6 quad) (-> this xy1010 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 64 8 8 0 0) @@ -259,13 +259,13 @@ (texflush 0) ) (let ((v1-56 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-56 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-56 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-56 2 quad) (-> obj color80808000 quad)) - (set! (-> v1-56 3 quad) (-> obj uv00 quad)) - (set! (-> v1-56 4 quad) (-> obj xy00 quad)) - (set! (-> v1-56 5 quad) (-> obj uv1010 quad)) - (set! (-> v1-56 6 quad) (-> obj xy88 quad)) + (set! (-> v1-56 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-56 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-56 2 quad) (-> this color80808000 quad)) + (set! (-> v1-56 3 quad) (-> this uv00 quad)) + (set! (-> v1-56 4 quad) (-> this xy00 quad)) + (set! (-> v1-56 5 quad) (-> this uv1010 quad)) + (set! (-> v1-56 6 quad) (-> this xy88 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 65 8 8 0 0) @@ -274,22 +274,22 @@ (texflush 0) ) (let ((v1-69 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-69 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-69 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-69 2 quad) (-> obj color80808000 quad)) - (set! (-> v1-69 3 quad) (-> obj uv00 quad)) - (set! (-> v1-69 4 quad) (-> obj xy00 quad)) - (set! (-> v1-69 5 quad) (-> obj uv1010 quad)) - (set! (-> v1-69 6 quad) (-> obj xy88 quad)) + (set! (-> v1-69 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-69 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-69 2 quad) (-> this color80808000 quad)) + (set! (-> v1-69 3 quad) (-> this uv00 quad)) + (set! (-> v1-69 4 quad) (-> this xy00 quad)) + (set! (-> v1-69 5 quad) (-> this uv1010 quad)) + (set! (-> v1-69 6 quad) (-> this xy88 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 66 8 8 0 0) (let ((v1-72 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-72 0 quad) (-> obj erase-tmpl dma-vif quad)) - (set! (-> v1-72 1 quad) (-> obj erase-tmpl quad 1)) - (set! (-> v1-72 2 quad) (-> obj color80808000 quad)) - (set! (-> v1-72 3 quad) (-> obj xy00 quad)) - (set! (-> v1-72 4 quad) (-> obj xy88 quad)) + (set! (-> v1-72 0 quad) (-> this erase-tmpl dma-vif quad)) + (set! (-> v1-72 1 quad) (-> this erase-tmpl quad 1)) + (set! (-> v1-72 2 quad) (-> this color80808000 quad)) + (set! (-> v1-72 3 quad) (-> this xy00 quad)) + (set! (-> v1-72 4 quad) (-> this xy88 quad)) ) (set! (-> arg0 base) (the-as pointer (-> (the-as (inline-array vector4w) (-> arg0 base)) 5))) (reset-display-gs-state *display* arg0) @@ -299,7 +299,7 @@ ;; definition for method 80 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-80 ocean ((obj ocean) (arg0 (pointer rgba))) +(defmethod ocean-method-80 ocean ((this ocean) (arg0 (pointer rgba))) (dotimes (v1-0 256) (let ((a0-3 (-> *clut-translate* v1-0))) (set! (-> arg0 a0-3 r) v1-0) @@ -314,28 +314,28 @@ ;; definition for method 91 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod do-tex-scroll! ocean ((obj ocean)) +(defmethod do-tex-scroll! ocean ((this ocean)) (when (not (paused?)) - (+! (-> obj st-scroll x) (* 8.0 (seconds-per-frame))) - (set! (-> obj st-scroll y) (- (-> obj st-scroll y) (* 8.0 (seconds-per-frame)))) - (if (< 128.0 (-> obj st-scroll x)) - (+! (-> obj st-scroll x) -128.0) + (+! (-> this st-scroll x) (* 8.0 (seconds-per-frame))) + (set! (-> this st-scroll y) (- (-> this st-scroll y) (* 8.0 (seconds-per-frame)))) + (if (< 128.0 (-> this st-scroll x)) + (+! (-> this st-scroll x) -128.0) ) - (if (< (-> obj st-scroll y) 0.0) - (+! (-> obj st-scroll y) 128.0) + (if (< (-> this st-scroll y) 0.0) + (+! (-> this st-scroll y) 128.0) ) ) - (set! (-> obj uv-scroll-0 x) (the int (* 16.0 (-> obj st-scroll x)))) - (set! (-> obj uv-scroll-0 y) (the int (* 16.0 (+ 256.0 (-> obj st-scroll y))))) - (set! (-> obj uv-scroll-1 x) (the int (* 16.0 (+ 256.0 (-> obj st-scroll x))))) - (set! (-> obj uv-scroll-1 y) (the int (* 16.0 (-> obj st-scroll y)))) + (set! (-> this uv-scroll-0 x) (the int (* 16.0 (-> this st-scroll x)))) + (set! (-> this uv-scroll-0 y) (the int (* 16.0 (+ 256.0 (-> this st-scroll y))))) + (set! (-> this uv-scroll-1 x) (the int (* 16.0 (+ 256.0 (-> this st-scroll x))))) + (set! (-> this uv-scroll-1 y) (the int (* 16.0 (-> this st-scroll y)))) 0 (none) ) ;; definition for method 81 of type ocean ;; INFO: Used lq/sq -(defmethod ocean-method-81 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-81 ocean ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 53 128 128 0 0) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) @@ -346,13 +346,13 @@ (texflush 0) ) (let ((v1-17 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-17 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-17 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-17 2 quad) (-> obj color80808080 quad)) - (set! (-> v1-17 3 quad) (-> obj uv00 quad)) - (set! (-> v1-17 4 quad) (-> obj xy00 quad)) - (set! (-> v1-17 5 quad) (-> obj uv8080 quad)) - (set! (-> v1-17 6 quad) (-> obj xy8080 quad)) + (set! (-> v1-17 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-17 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-17 2 quad) (-> this color80808080 quad)) + (set! (-> v1-17 3 quad) (-> this uv00 quad)) + (set! (-> v1-17 4 quad) (-> this xy00 quad)) + (set! (-> v1-17 5 quad) (-> this uv8080 quad)) + (set! (-> v1-17 6 quad) (-> this xy8080 quad)) ) (&+! (-> arg0 base) 112) (dma-buffer-add-gs-set arg0 @@ -362,9 +362,9 @@ (trxdir (new 'static 'gs-trxdir)) ) (let ((v1-23 (the-as object (-> arg0 base)))) - (set! (-> (the-as (inline-array vector4w) v1-23) 0 quad) (-> obj clut-tmpl dma-vif quad)) - (set! (-> (the-as (inline-array vector4w) v1-23) 1 quad) (-> obj clut-tmpl quad 1)) - (ocean-method-80 obj (the-as (pointer rgba) (&+ (the-as pointer v1-23) 32))) + (set! (-> (the-as (inline-array vector4w) v1-23) 0 quad) (-> this clut-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-23) 1 quad) (-> this clut-tmpl quad 1)) + (ocean-method-80 this (the-as (pointer rgba) (&+ (the-as pointer v1-23) 32))) ) (&+! (-> arg0 base) 1056) (set-display-gs-state arg0 85 128 128 0 0) @@ -387,13 +387,13 @@ (texflush 0) ) (let ((v1-40 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-40 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) - (set! (-> v1-40 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set! (-> v1-40 0 quad) (-> this sprite-tmpl3 dma-vif quad)) + (set! (-> v1-40 1 quad) (-> this sprite-tmpl3 quad 1)) (set-vector! (-> v1-40 2) 96 96 96 128) - (set! (-> v1-40 3 quad) (-> obj uv00 quad)) - (set! (-> v1-40 4 quad) (-> obj xy00 quad)) - (set! (-> v1-40 5 quad) (-> obj uv8080 quad)) - (set! (-> v1-40 6 quad) (-> obj xy8080 quad)) + (set! (-> v1-40 3 quad) (-> this uv00 quad)) + (set! (-> v1-40 4 quad) (-> this xy00 quad)) + (set! (-> v1-40 5 quad) (-> this uv8080 quad)) + (set! (-> v1-40 6 quad) (-> this xy8080 quad)) ) (&+! (-> arg0 base) 112) (dma-buffer-add-gs-set arg0 @@ -402,13 +402,13 @@ (texflush 0) ) (let ((v1-46 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-46 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) - (set! (-> v1-46 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set! (-> v1-46 0 quad) (-> this sprite-tmpl3 dma-vif quad)) + (set! (-> v1-46 1 quad) (-> this sprite-tmpl3 quad 1)) (set-vector! (-> v1-46 2) 64 64 64 64) - (set! (-> v1-46 3 quad) (-> obj uv-scroll-0 quad)) - (set! (-> v1-46 4 quad) (-> obj xy00 quad)) - (set! (-> v1-46 5 quad) (-> obj uv-scroll-1 quad)) - (set! (-> v1-46 6 quad) (-> obj xy8080 quad)) + (set! (-> v1-46 3 quad) (-> this uv-scroll-0 quad)) + (set! (-> v1-46 4 quad) (-> this xy00 quad)) + (set! (-> v1-46 5 quad) (-> this uv-scroll-1 quad)) + (set! (-> v1-46 6 quad) (-> this xy8080 quad)) ) (&+! (-> arg0 base) 112) (set-display-gs-state arg0 21 128 128 0 0) @@ -419,13 +419,13 @@ (texflush 0) ) (let ((v1-63 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-63 0 quad) (-> obj sprite-tmpl3 dma-vif quad)) - (set! (-> v1-63 1 quad) (-> obj sprite-tmpl3 quad 1)) + (set! (-> v1-63 0 quad) (-> this sprite-tmpl3 dma-vif quad)) + (set! (-> v1-63 1 quad) (-> this sprite-tmpl3 quad 1)) (set-vector! (-> v1-63 2) 128 128 128 64) - (set! (-> v1-63 3 quad) (-> obj uv-scroll-0 quad)) - (set! (-> v1-63 4 quad) (-> obj xy00 quad)) - (set! (-> v1-63 5 quad) (-> obj uv-scroll-1 quad)) - (set! (-> v1-63 6 quad) (-> obj xy8080 quad)) + (set! (-> v1-63 3 quad) (-> this uv-scroll-0 quad)) + (set! (-> v1-63 4 quad) (-> this xy00 quad)) + (set! (-> v1-63 5 quad) (-> this uv-scroll-1 quad)) + (set! (-> v1-63 6 quad) (-> this xy8080 quad)) ) (&+! (-> arg0 base) 112) (let ((s5-1 128) @@ -486,7 +486,7 @@ ;; definition for method 82 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-envmap-debug ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-envmap-debug ocean ((this ocean) (arg0 dma-buffer)) (format *stdcon* "draw-envmap-debug~%") (-> arg0 base) (dma-buffer-add-gs-set arg0 @@ -505,12 +505,12 @@ (texflush 0) ) (let ((v1-20 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-20 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-20 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-20 2 quad) (-> obj color80808080 quad)) - (set! (-> v1-20 3 quad) (-> obj uv00 quad)) + (set! (-> v1-20 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-20 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-20 2 quad) (-> this color80808080 quad)) + (set! (-> v1-20 3 quad) (-> this uv00 quad)) (set-vector! (-> v1-20 4) #x7b50 #x8000 #xffffff 0) - (set! (-> v1-20 5 quad) (-> obj uv4040 quad)) + (set! (-> v1-20 5 quad) (-> this uv4040 quad)) (set-vector! (-> v1-20 6) #x7f60 #x8400 #xffffff 0) ) (&+! (-> arg0 base) 112) @@ -525,12 +525,12 @@ (texflush 0) ) (let ((v1-44 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-44 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-44 1 quad) (-> obj sprite-tmpl quad 1)) - (set! (-> v1-44 2 quad) (-> obj color80808080 quad)) - (set! (-> v1-44 3 quad) (-> obj uv00 quad)) + (set! (-> v1-44 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-44 1 quad) (-> this sprite-tmpl quad 1)) + (set! (-> v1-44 2 quad) (-> this color80808080 quad)) + (set! (-> v1-44 3 quad) (-> this uv00 quad)) (set-vector! (-> v1-44 4) #x8000 #x8000 #xffffff 0) - (set! (-> v1-44 5 quad) (-> obj uv4040 quad)) + (set! (-> v1-44 5 quad) (-> this uv4040 quad)) (set-vector! (-> v1-44 6) #x8820 #x8400 #xffffff 0) ) (&+! (-> arg0 base) 112) @@ -541,7 +541,7 @@ ;; definition for method 83 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-83 ocean ((obj ocean) (arg0 dma-buffer) (arg1 float)) +(defmethod ocean-method-83 ocean ((this ocean) (arg0 dma-buffer) (arg1 float)) (let* ((s4-0 64) (s3-0 0) (f30-0 (/ -65536.0 (the float s4-0))) @@ -561,8 +561,8 @@ (texflush 0) ) (let ((v1-16 (-> arg0 base))) - (set! (-> (the-as (pointer uint128) v1-16)) (-> obj line-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-16) 1) (-> obj line-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) v1-16)) (-> this line-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-16) 1) (-> this line-tmpl quad 1)) ) (&+! (-> arg0 base) 32) (dotimes (s2-1 s4-0) @@ -570,8 +570,8 @@ (let ((f26-1 (+ 0.5 (* 0.5 (sin f28-0)))) (f0-5 (+ 0.5 (* 0.5 (cos f28-0)))) ) - (set! (-> (the-as (inline-array vector4w) s1-1) 0 quad) (-> obj color80808000 quad)) - (set! (-> (the-as (inline-array vector4w) s1-1) 1 quad) (-> obj st0505 quad)) + (set! (-> (the-as (inline-array vector4w) s1-1) 0 quad) (-> this color80808000 quad)) + (set! (-> (the-as (inline-array vector4w) s1-1) 1 quad) (-> this st0505 quad)) (set-vector! (-> (the-as (inline-array vector4w) s1-1) 2) s3-0 0 #xffffff 0) (set-vector! (-> (the-as (inline-array vector4w) s1-1) 3) @@ -595,7 +595,7 @@ ;; definition for method 84 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-84 ocean ((obj ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) +(defmethod ocean-method-84 ocean ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float)) (when (>= (-> arg1 sun 0 pos y) -150.0) (let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x))) (f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z))) @@ -615,13 +615,13 @@ (t0-2 (the int t0-1)) (t1-0 (the-as (inline-array vector4w) (-> arg0 base))) ) - (set! (-> t1-0 0 quad) (-> obj sun-tmpl dma-vif quad)) - (set! (-> t1-0 1 quad) (-> obj sun-tmpl quad 1)) + (set! (-> t1-0 0 quad) (-> this sun-tmpl dma-vif quad)) + (set! (-> t1-0 1 quad) (-> this sun-tmpl quad 1)) (set! (-> t1-0 2 quad) (-> arg2 quad)) (set! (-> t1-0 2 w) (the int (* 128.0 f0-6))) - (set! (-> t1-0 3 quad) (-> obj st0000 quad)) + (set! (-> t1-0 3 quad) (-> this st0000 quad)) (set-vector! (-> t1-0 4) (- v1-14 t0-2) (- a2-3 t0-2) #xffffff 0) - (set! (-> t1-0 5 quad) (-> obj st1010 quad)) + (set! (-> t1-0 5 quad) (-> this st1010 quad)) (set-vector! (-> t1-0 6) (+ v1-14 t0-2) (+ a2-3 t0-2) #xffffff 0) ) (&+! (-> arg0 base) 112) @@ -633,12 +633,12 @@ ;; definition for method 85 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-85 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-85 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 vector4w) (sv-64 vector4w)) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x2 :d #x1))) (let ((v1-3 (-> arg0 base))) - (set! (-> (the-as (pointer uint128) v1-3)) (-> obj haze-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-3) 1) (-> obj haze-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) v1-3)) (-> this haze-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-3) 1) (-> this haze-tmpl quad 1)) ) (&+! (-> arg0 base) 32) (let ((f30-0 0.0) @@ -649,8 +649,8 @@ ) (dotimes (s1-0 16) (let ((s0-0 (the-as object (-> arg0 base)))) - (set! sv-48 (-> obj haze-verts (* s1-0 2))) - (set! sv-64 (-> obj haze-verts (+ (* s1-0 2) 1))) + (set! sv-48 (-> this haze-verts (* s1-0 2))) + (set! sv-64 (-> this haze-verts (+ (* s1-0 2) 1))) (let ((f0-1 (+ -1024.0 (the float (-> sv-48 x)))) (f1-3 (+ -1024.0 (the float (-> sv-48 y)))) (v1-22 s2-0) @@ -660,7 +660,7 @@ (set! (-> v1-22 pos z) f1-3) (set! (-> v1-22 pos w) 1.0) ) - (add-colors! obj s3-0 s2-0) + (add-colors! this s3-0 s2-0) (vector-float*! s3-0 s3-0 0.25) (set-vector! (-> (the-as (inline-array vector4w) s0-0) 0) @@ -696,7 +696,7 @@ ;; definition for method 86 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-86 ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod ocean-method-86 ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (local-vars (v1-1 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -720,9 +720,9 @@ (.lvf vf2 (&-> v1-0 quad)) ) (.lvf vf7 (&-> arg1 quad)) - (.lvf vf4 (&-> obj cloud-lights sun0-normal quad)) - (.lvf vf5 (&-> obj cloud-lights sun1-normal quad)) - (.lvf vf6 (&-> obj cloud-lights moon-normal quad)) + (.lvf vf4 (&-> this cloud-lights sun0-normal quad)) + (.lvf vf5 (&-> this cloud-lights sun1-normal quad)) + (.lvf vf6 (&-> this cloud-lights moon-normal quad)) (.mul.vf vf8 vf4 vf7) (.mul.vf vf9 vf5 vf7) (.mul.vf vf10 vf6 vf7) @@ -740,8 +740,8 @@ (.max.vf vf8 vf8 vf0) (.max.vf vf9 vf9 vf0) (.max.vf vf10 vf10 vf0) - (.lvf vf12 (&-> obj cloud-lights sun1-color quad)) - (.lvf vf13 (&-> obj cloud-lights moon-color quad)) + (.lvf vf12 (&-> this cloud-lights sun1-color quad)) + (.lvf vf13 (&-> this cloud-lights moon-color quad)) (.mul.w.vf acc vf3 vf0) (.add.mul.x.vf acc vf11 vf8 acc) (.add.mul.x.vf acc vf12 vf9 acc) @@ -760,14 +760,14 @@ ;; definition for method 87 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-87 ocean ((obj ocean) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod ocean-method-87 ocean ((this ocean) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (f28-0 0.00390625) (f30-0 0.015625) ) - (let ((s3-0 (-> obj cloud-lights))) + (let ((s3-0 (-> this cloud-lights))) (set! (-> arg0 quad) (-> arg1 quad)) (vector--float*! s5-0 arg2 (-> s3-0 sun0-normal) 9.0) (vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0) @@ -786,7 +786,7 @@ ;; definition for method 88 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-88 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-88 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 vector) (sv-64 uint) (sv-80 vector) (sv-96 vector) (sv-112 vector)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test @@ -821,7 +821,7 @@ (dotimes (v1-19 6) (dotimes (a0-10 6) (set-vector! - (-> obj cloud-st0 (+ (* 6 v1-19) a0-10)) + (-> this cloud-st0 (+ (* 6 v1-19) a0-10)) (+ (* 0.5 (the float a0-10)) f0-1) (+ (* 0.5 (the float v1-19)) f1-3) 1.0 @@ -832,7 +832,7 @@ ) (let ((s4-1 (new 'stack-no-clear 'vector)) (s3-1 (new 'stack-no-clear 'vector)) - (s2-2 (-> obj cloud-lights)) + (s2-2 (-> this cloud-lights)) ) (vector-float*! (-> s2-2 sun0-color) (-> s2-2 sun0-color) 0.25) (vector-float*! (-> s2-2 sun0-color-lower) (-> s2-2 sun0-color-lower) 0.25) @@ -841,17 +841,17 @@ (vector-float*! (-> s2-2 ambi-color) (-> s2-2 ambi-color) 0.25) (vector-float*! (-> s2-2 ambi-color-lower) (-> s2-2 ambi-color-lower) 0.25) (dotimes (s1-0 36) - (let ((v1-36 (-> obj cloud-verts s1-0))) - (set! sv-80 (-> obj cloud-nrms s1-0)) - (let ((s0-0 (-> obj cloud-col0 s1-0))) - (set! sv-48 (-> obj cloud-col1 s1-0)) - (set! sv-112 (-> obj cloud-st0 s1-0)) - (set! sv-96 (-> obj cloud-st1 s1-0)) - (set! sv-64 (-> obj cloud-alpha s1-0)) + (let ((v1-36 (-> this cloud-verts s1-0))) + (set! sv-80 (-> this cloud-nrms s1-0)) + (let ((s0-0 (-> this cloud-col0 s1-0))) + (set! sv-48 (-> this cloud-col1 s1-0)) + (set! sv-112 (-> this cloud-st0 s1-0)) + (set! sv-96 (-> this cloud-st1 s1-0)) + (set! sv-64 (-> this cloud-alpha s1-0)) (set! (-> s4-1 x) (* 0.140625 (+ -1024.0 (the float (-> v1-36 x))))) (set! (-> s4-1 z) (* 0.140625 (+ -1024.0 (the float (-> v1-36 z))))) (vector-negate! s3-1 sv-80) - (let ((a0-41 obj) + (let ((a0-41 this) (t9-3 (method-of-type ocean ocean-method-86)) (a1-19 s0-0) (a3-0 (-> s2-2 sun0-color)) @@ -859,12 +859,12 @@ ) (t9-3 a0-41 a1-19 sv-80 a3-0 t0-0) ) - (ocean-method-86 obj sv-48 s3-1 (-> s2-2 sun0-color-lower) (-> s2-2 ambi-color-lower)) + (ocean-method-86 this sv-48 s3-1 (-> s2-2 sun0-color-lower) (-> s2-2 ambi-color-lower)) (set! (-> s0-0 w) (the-as float sv-64)) ) ) (set! (-> sv-48 w) (the-as float sv-64)) - (let ((a0-44 obj) + (let ((a0-44 this) (t9-5 (method-of-type ocean ocean-method-87)) (a3-2 s4-1) ) @@ -874,8 +874,8 @@ ) (dotimes (v1-46 5) (let ((a0-45 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> a0-45 0 quad) (-> obj cloud-tmpl dma-vif quad)) - (set! (-> a0-45 1 quad) (-> obj cloud-tmpl quad 1)) + (set! (-> a0-45 0 quad) (-> this cloud-tmpl dma-vif quad)) + (set! (-> a0-45 1 quad) (-> this cloud-tmpl quad 1)) ) (&+! (-> arg0 base) 32) (dotimes (a0-48 6) @@ -883,20 +883,20 @@ (a2-7 (+ (* 6 (+ v1-46 1)) a0-48)) (a1-28 (the-as (inline-array vector4w) (-> arg0 base))) ) - (set! (-> a1-28 0 quad) (-> obj cloud-col0 a3-3 quad)) - (set! (-> a1-28 1 quad) (-> obj cloud-st0 a3-3 quad)) - (set! (-> a1-28 2 quad) (-> obj cloud-verts a3-3 quad)) - (set! (-> a1-28 3 quad) (-> obj cloud-col0 a2-7 quad)) - (set! (-> a1-28 4 quad) (-> obj cloud-st0 a2-7 quad)) - (set! (-> a1-28 5 quad) (-> obj cloud-verts a2-7 quad)) + (set! (-> a1-28 0 quad) (-> this cloud-col0 a3-3 quad)) + (set! (-> a1-28 1 quad) (-> this cloud-st0 a3-3 quad)) + (set! (-> a1-28 2 quad) (-> this cloud-verts a3-3 quad)) + (set! (-> a1-28 3 quad) (-> this cloud-col0 a2-7 quad)) + (set! (-> a1-28 4 quad) (-> this cloud-st0 a2-7 quad)) + (set! (-> a1-28 5 quad) (-> this cloud-verts a2-7 quad)) ) (&+! (-> arg0 base) 96) ) ) (dotimes (v1-49 5) (let ((a0-51 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> a0-51 0 quad) (-> obj cloud-tmpl dma-vif quad)) - (set! (-> a0-51 1 quad) (-> obj cloud-tmpl quad 1)) + (set! (-> a0-51 0 quad) (-> this cloud-tmpl dma-vif quad)) + (set! (-> a0-51 1 quad) (-> this cloud-tmpl quad 1)) ) (&+! (-> arg0 base) 32) (dotimes (a0-54 6) @@ -904,12 +904,12 @@ (a2-12 (+ (* 6 (+ v1-49 1)) a0-54)) (a1-37 (the-as (inline-array vector4w) (-> arg0 base))) ) - (set! (-> a1-37 0 quad) (-> obj cloud-col1 a3-13 quad)) - (set! (-> a1-37 1 quad) (-> obj cloud-st1 a3-13 quad)) - (set! (-> a1-37 2 quad) (-> obj cloud-verts a3-13 quad)) - (set! (-> a1-37 3 quad) (-> obj cloud-col1 a2-12 quad)) - (set! (-> a1-37 4 quad) (-> obj cloud-st1 a2-12 quad)) - (set! (-> a1-37 5 quad) (-> obj cloud-verts a2-12 quad)) + (set! (-> a1-37 0 quad) (-> this cloud-col1 a3-13 quad)) + (set! (-> a1-37 1 quad) (-> this cloud-st1 a3-13 quad)) + (set! (-> a1-37 2 quad) (-> this cloud-verts a3-13 quad)) + (set! (-> a1-37 3 quad) (-> this cloud-col1 a2-12 quad)) + (set! (-> a1-37 4 quad) (-> this cloud-st1 a2-12 quad)) + (set! (-> a1-37 5 quad) (-> this cloud-verts a2-12 quad)) ) (&+! (-> arg0 base) 96) ) @@ -921,20 +921,20 @@ ;; definition for method 89 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-89 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-89 ocean ((this ocean) (arg0 dma-buffer)) (set-display-gs-state arg0 (the-as int (+ (-> *ocean-texture-base* vram-page) 8)) 64 64 0 0) - (vector-float*! (-> obj sky-color) (-> *time-of-day-context* current-sky-color) 0.25) - (+! (-> obj sky-color x) (* 0.5 (- (-> obj sky-color z) (-> obj sky-color x)))) - (+! (-> obj sky-color y) (* 0.5 (- (-> obj sky-color z) (-> obj sky-color y)))) + (vector-float*! (-> this sky-color) (-> *time-of-day-context* current-sky-color) 0.25) + (+! (-> this sky-color x) (* 0.5 (- (-> this sky-color z) (-> this sky-color x)))) + (+! (-> this sky-color y) (* 0.5 (- (-> this sky-color z) (-> this sky-color y)))) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) (texflush 0) ) (let ((v1-9 (the-as object (-> arg0 base)))) - (let ((a1-13 (-> obj sky-color))) - (set! (-> (the-as (inline-array vector4w) v1-9) 0 quad) (-> obj sprite-tmpl2 dma-vif quad)) - (set! (-> (the-as (inline-array vector4w) v1-9) 1 quad) (-> obj sprite-tmpl2 quad 1)) + (let ((a1-13 (-> this sky-color))) + (set! (-> (the-as (inline-array vector4w) v1-9) 0 quad) (-> this sprite-tmpl2 dma-vif quad)) + (set! (-> (the-as (inline-array vector4w) v1-9) 1 quad) (-> this sprite-tmpl2 quad 1)) (set-vector! (-> (the-as (inline-array vector4w) v1-9) 2) (the int (-> a1-13 x)) @@ -963,8 +963,8 @@ (texflush 0) ) (let ((v1-16 (the-as adgif-shader (-> arg0 base)))) - (set! (-> v1-16 quad 0 quad) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> v1-16 quad 1 quad) (-> obj adgif-tmpl quad 1)) + (set! (-> v1-16 quad 0 quad) (-> this adgif-tmpl dma-vif quad)) + (set! (-> v1-16 quad 1 quad) (-> this adgif-tmpl quad 1)) (let ((s4-0 (&-> v1-16 miptbp1))) (adgif-shader<-texture-simple! (the-as adgif-shader s4-0) @@ -977,7 +977,7 @@ (let ((s4-1 (-> *sky-work* upload-data)) (a3-1 (new 'stack 'vector4w)) ) - (let ((a0-28 (-> obj cloud-lights sun0-color))) + (let ((a0-28 (-> this cloud-lights sun0-color))) (set-vector! a3-1 (the int (* 128.0 (-> a0-28 x))) @@ -986,12 +986,12 @@ 1 ) ) - (ocean-method-84 obj arg0 s4-1 a3-1 80.0) + (ocean-method-84 this arg0 s4-1 a3-1 80.0) ) (let ((s4-2 (-> *sky-work* upload-data sun 1)) (a3-2 (new 'stack 'vector4w)) ) - (let ((a0-32 (-> obj cloud-lights sun1-color))) + (let ((a0-32 (-> this cloud-lights sun1-color))) (set-vector! a3-2 (the int (* 255.0 (-> a0-32 x))) @@ -1000,11 +1000,11 @@ 1 ) ) - (ocean-method-84 obj arg0 (the-as sky-upload-data s4-2) a3-2 64.0) + (ocean-method-84 this arg0 (the-as sky-upload-data s4-2) a3-2 64.0) ) (let ((v1-30 (the-as adgif-shader (-> arg0 base)))) - (set! (-> v1-30 quad 0 quad) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> v1-30 quad 1 quad) (-> obj adgif-tmpl quad 1)) + (set! (-> v1-30 quad 0 quad) (-> this adgif-tmpl dma-vif quad)) + (set! (-> v1-30 quad 1 quad) (-> this adgif-tmpl quad 1)) (let ((s4-3 (&-> v1-30 miptbp1))) (adgif-shader<-texture-simple! (the-as adgif-shader s4-3) @@ -1017,12 +1017,12 @@ (let ((a2-3 (-> *sky-work* upload-data moon)) (a3-3 (new 'static 'vector4w :x 80 :y 80 :z 80)) ) - (ocean-method-84 obj arg0 (the-as sky-upload-data a2-3) a3-3 48.0) + (ocean-method-84 this arg0 (the-as sky-upload-data a2-3) a3-3 48.0) ) - (ocean-method-85 obj arg0) - (ocean-method-88 obj arg0) + (ocean-method-85 this arg0) + (ocean-method-88 this arg0) (set-display-gs-state arg0 (the-as int (-> *ocean-envmap-texture-base* vram-page)) 64 64 0 0) - (ocean-method-83 obj arg0 32768.0) + (ocean-method-83 this arg0 32768.0) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) (tex0-1 (new 'static 'gs-tex0 @@ -1040,8 +1040,8 @@ ) (dma-buffer-add-gs-set arg0 (tex1-1 (new 'static 'gs-tex1)) (texflush 0)) (let ((v1-66 (the-as (inline-array vector4w) (-> arg0 base)))) - (set! (-> v1-66 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-66 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-66 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-66 1 quad) (-> this sprite-tmpl quad 1)) (set-vector! (-> v1-66 2) 128 128 128 128) (set-vector! (-> v1-66 3) 8 520 0 0) (set-vector! (-> v1-66 4) 0 512 #xffffff 0) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc index d57c841424..a40b21522c 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-transition_REF.gc @@ -2,9 +2,9 @@ (in-package goal) ;; definition for method 30 of type ocean -(defmethod ocean-trans-camera-masks-bit? ocean ((obj ocean) (arg0 uint) (arg1 uint)) - (let ((v1-2 (- arg0 (* (-> obj mid-minz) 4))) - (a1-3 (- arg1 (* (-> obj mid-minx) 4))) +(defmethod ocean-trans-camera-masks-bit? ocean ((this ocean) (arg0 uint) (arg1 uint)) + (let ((v1-2 (- arg0 (* (-> this mid-minz) 4))) + (a1-3 (- arg1 (* (-> this mid-minx) 4))) ) (cond ((or (< v1-2 0) (>= v1-2 (the-as uint 16)) (< a1-3 0) (>= a1-3 (the-as uint 16))) @@ -17,7 +17,7 @@ (v1-3 (logand a1-3 3)) (a1-5 (+ (* t0-0 4) a3-3)) ) - (logtest? (-> (the-as (pointer uint8) (+ (+ a2-2 (* a1-5 4)) (the-as uint obj))) 2928) (ash 1 v1-3)) + (logtest? (-> (the-as (pointer uint8) (+ (+ a2-2 (* a1-5 4)) (the-as uint this))) 2928) (ash 1 v1-3)) ) ) ) @@ -25,9 +25,9 @@ ) ;; definition for method 31 of type ocean -(defmethod ocean-trans-mask-ptrs-bit? ocean ((obj ocean) (arg0 int) (arg1 int)) - (let ((v1-2 (- arg0 (the-as int (* (-> obj mid-minz) 4)))) - (a1-3 (- arg1 (the-as int (* (-> obj mid-minx) 4)))) +(defmethod ocean-trans-mask-ptrs-bit? ocean ((this ocean) (arg0 int) (arg1 int)) + (let ((v1-2 (- arg0 (the-as int (* (-> this mid-minz) 4)))) + (a1-3 (- arg1 (the-as int (* (-> this mid-minx) 4)))) ) (cond ((or (< (the-as uint v1-2) 0) @@ -42,7 +42,7 @@ (a3-3 (shr a1-3 2)) (a2-2 (logand v1-2 3)) (v1-3 (logand a1-3 3)) - (a0-2 (-> obj trans-mask-ptrs (+ (* (+ (* t0-0 4) a3-3) 4) a2-2))) + (a0-2 (-> this trans-mask-ptrs (+ (* (+ (* t0-0 4) a3-3) 4) a2-2))) ) (if a0-2 (logtest? (-> (the-as (pointer int32) a0-2) 1) (ash 1 v1-3)) @@ -55,9 +55,9 @@ ) ;; definition for method 32 of type ocean -(defmethod ocean-trans-mask-ptrs-set! ocean ((obj ocean) (arg0 uint) (arg1 uint)) - (let ((v1-2 (- arg0 (* (-> obj mid-minz) 4))) - (a1-3 (- arg1 (* (-> obj mid-minx) 4))) +(defmethod ocean-trans-mask-ptrs-set! ocean ((this ocean) (arg0 uint) (arg1 uint)) + (let ((v1-2 (- arg0 (* (-> this mid-minz) 4))) + (a1-3 (- arg1 (* (-> this mid-minx) 4))) ) (cond ((or (< v1-2 0) (>= v1-2 (the-as uint 16)) (< a1-3 0) (>= a1-3 (the-as uint 16))) @@ -68,7 +68,7 @@ (a2-2 (shr a1-3 2)) (v1-3 (logand v1-2 3)) (a1-4 (logand a1-3 3)) - (t0-6 (-> obj trans-mask-ptrs (+ (* (+ (* a3-3 4) a2-2) 4) v1-3))) + (t0-6 (-> this trans-mask-ptrs (+ (* (+ (* a3-3 4) a2-2) 4) v1-3))) ) (cond (t0-6 @@ -77,7 +77,7 @@ #f ) (else - (let ((a0-1 (&-> obj trans-temp-masks (+ (* a3-3 4) a2-2)))) + (let ((a0-1 (&-> this trans-temp-masks (+ (* a3-3 4) a2-2)))) (set! (-> (the-as (pointer int8) (+ v1-3 (the-as uint a0-1))) 0) (the-as int (logior (-> (the-as (pointer uint8) (+ v1-3 (the-as uint a0-1))) 0) (ash 1 a1-4))) ) @@ -98,7 +98,7 @@ ;; definition for method 33 of type ocean ;; INFO: Used lq/sq -(defmethod ocean-trans-add-upload-table ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 symbol)) +(defmethod ocean-trans-add-upload-table ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 symbol)) (local-vars (v1-16 (inline-array vector4w)) (v1-18 float) @@ -125,15 +125,15 @@ (vf8 :class vf) (vf9 :class vf) ) - (when (ocean-trans-mask-ptrs-set! obj arg1 arg2) + (when (ocean-trans-mask-ptrs-set! this arg1 arg2) (let ((a2-2 (new-stack-vector0))) - (let ((v1-2 (-> obj start-corner))) + (let ((v1-2 (-> this start-corner))) (set! (-> a2-2 x) (+ (-> v1-2 x) (* 98304.0 (the float arg2)))) (set! (-> a2-2 y) (-> v1-2 y)) (set! (-> a2-2 z) (+ (-> v1-2 z) (* 98304.0 (the float arg1)))) ) (set! (-> a2-2 w) 1.0) - (ocean-mid-add-matrices obj arg0 a2-2) + (ocean-mid-add-matrices this arg0 a2-2) ) (let* ((a1-3 9) (v1-7 arg0) @@ -200,10 +200,10 @@ (.svf (&-> v1-17 2 quad) vf11) (nop!) (.svf (&-> v1-17 3 quad) vf12) - (let ((a2-16 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int a0-17)) a1-11)))) - (a3-8 (the-as uint128 (-> obj ocean-colors colors (+ a1-11 1 (* 52 (the-as int a0-17)))))) - (t0-9 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ a0-17 1))) a1-11)))) - (a0-23 (the-as uint128 (-> obj ocean-colors colors (+ a1-11 1 (* 52 (the-as int (+ a0-17 1))))))) + (let ((a2-16 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int a0-17)) a1-11)))) + (a3-8 (the-as uint128 (-> this ocean-colors colors (+ a1-11 1 (* 52 (the-as int a0-17)))))) + (t0-9 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int (+ a0-17 1))) a1-11)))) + (a0-23 (the-as uint128 (-> this ocean-colors colors (+ a1-11 1 (* 52 (the-as int (+ a0-17 1))))))) ) (.pextlb a1-14 0 a2-16) (nop!) @@ -281,8 +281,8 @@ (set! (-> v1-21 base) (&+ (the-as pointer a0-26) 16)) ) (if arg5 - (ocean-mid-add-call obj arg0 275) - (ocean-mid-add-call obj arg0 107) + (ocean-mid-add-call this arg0 275) + (ocean-mid-add-call this arg0 107) ) ) (none) @@ -292,7 +292,7 @@ ;; definition for method 34 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-trans-add-upload-strip ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 int)) +(defmethod ocean-trans-add-upload-strip ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint) (arg3 int) (arg4 int) (arg5 int)) (local-vars (v1-10 float) (a0-24 uint128) @@ -310,13 +310,13 @@ (vf4 :class vf) ) (let ((a2-1 (new-stack-vector0))) - (let ((v1-0 (-> obj start-corner))) + (let ((v1-0 (-> this start-corner))) (set! (-> a2-1 x) (+ (-> v1-0 x) (* 393216.0 (the float arg2)))) (set! (-> a2-1 y) (-> v1-0 y)) (set! (-> a2-1 z) (+ (-> v1-0 z) (* 393216.0 (the float arg1)))) ) (set! (-> a2-1 w) 1.0) - (ocean-mid-add-matrices obj arg0 a2-1) + (ocean-mid-add-matrices this arg0 a2-1) ) (let* ((a1-2 9) (v1-5 arg0) @@ -330,7 +330,7 @@ (set! (-> v1-5 base) (&+ (the-as pointer a0-3) 16)) ) (let ((v1-6 (the-as object (-> arg0 base)))) - (set! (-> obj trans-mask-ptrs (+ (* arg4 4) arg5)) (the-as pointer v1-6)) + (set! (-> this trans-mask-ptrs (+ (* arg4 4) arg5)) (the-as pointer v1-6)) (set! (-> (the-as vector4w v1-6) x) 10) (set! (-> (the-as vector4w v1-6) y) arg3) (set! (-> (the-as vector4w v1-6) z) 0) @@ -342,10 +342,10 @@ (set! (-> v1-9 1 quad) (-> *ocean-trans-st-table* 1 quad)) (set! (-> v1-9 2 quad) (-> *ocean-trans-st-table* 2 quad)) (set! (-> v1-9 3 quad) (-> *ocean-trans-st-table* 3 quad)) - (let ((a0-23 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) - (a1-11 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) - (a2-14 (the-as uint128 (-> obj ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) - (a3-9 (the-as uint128 (-> obj ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) + (let ((a0-23 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int arg1)) arg2)))) + (a1-11 (the-as uint128 (-> this ocean-colors colors (+ arg2 1 (* 52 (the-as int arg1)))))) + (a2-14 (the-as uint128 (-> this ocean-colors colors (+ (* 52 (the-as int (+ arg1 1))) arg2)))) + (a3-9 (the-as uint128 (-> this ocean-colors colors (+ arg2 1 (* 52 (the-as int (+ arg1 1))))))) ) (.pextlb a0-24 0 a0-23) (nop!) @@ -402,7 +402,7 @@ ) (set! (-> v1-13 base) (&+ (the-as pointer a0-27) 16)) ) - (ocean-mid-add-call obj arg0 107) + (ocean-mid-add-call this arg0 107) 0 (none) ) @@ -411,7 +411,7 @@ ;; definition for method 35 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-transition-check ocean ((obj ocean) (arg0 ocean-trans-mask) (arg1 int) (arg2 int) (arg3 vector)) +(defmethod ocean-transition-check ocean ((this ocean) (arg0 ocean-trans-mask) (arg1 int) (arg2 int) (arg3 vector)) (local-vars (v1-13 float) (t0-3 float) (t0-8 float) (t0-13 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -493,22 +493,22 @@ ;; definition for method 36 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-make-trans-camera-masks ocean ((obj ocean) (arg0 uint) (arg1 uint) (arg2 uint) (arg3 uint)) +(defmethod ocean-make-trans-camera-masks ocean ((this ocean) (arg0 uint) (arg1 uint) (arg2 uint) (arg3 uint)) (local-vars (sv-48 ocean-trans-mask) (sv-52 vector) (sv-56 vector) (sv-60 vector)) - (set! sv-48 (the-as ocean-trans-mask (&-> obj trans-camera-masks (+ (* arg2 4) arg3)))) + (set! sv-48 (the-as ocean-trans-mask (&-> this trans-camera-masks (+ (* arg2 4) arg3)))) (set! sv-52 (-> *math-camera* trans)) (set! sv-56 (new-stack-vector0)) (set! sv-60 (new-stack-vector0)) - (set! (-> sv-56 x) (+ (-> obj start-corner x) (* 393216.0 (the float arg1)))) - (set! (-> sv-56 y) (-> obj start-corner y)) - (set! (-> sv-56 z) (+ (-> obj start-corner z) (* 393216.0 (the float arg0)))) + (set! (-> sv-56 x) (+ (-> this start-corner x) (* 393216.0 (the float arg1)))) + (set! (-> sv-56 y) (-> this start-corner y)) + (set! (-> sv-56 z) (+ (-> this start-corner z) (* 393216.0 (the float arg0)))) (set! (-> sv-56 w) 1.0) (dotimes (s5-0 4) (dotimes (s4-0 4) (set! (-> sv-60 x) (- (+ (-> sv-56 x) (* 98304.0 (the float s4-0))) (-> sv-52 x))) (set! (-> sv-60 y) (- (-> sv-56 y) (-> sv-52 y))) (set! (-> sv-60 z) (- (+ (-> sv-56 z) (* 98304.0 (the float s5-0))) (-> sv-52 z))) - (ocean-transition-check obj sv-48 s4-0 s5-0 sv-56) + (ocean-transition-check this sv-48 s4-0 s5-0 sv-56) ) ) 0 @@ -517,12 +517,12 @@ ;; definition for method 37 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-trans-add-upload ocean ((obj ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) - (when (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int arg2))) - (let ((s0-0 (ocean-trans-camera-masks-bit? obj (+ arg1 -1) arg2)) - (s1-0 (ocean-trans-camera-masks-bit? obj (+ arg1 1) arg2)) - (s2-0 (ocean-trans-camera-masks-bit? obj arg1 (+ arg2 -1))) - (a0-6 (ocean-trans-camera-masks-bit? obj arg1 (+ arg2 1))) +(defmethod ocean-trans-add-upload ocean ((this ocean) (arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (when (not (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int arg2))) + (let ((s0-0 (ocean-trans-camera-masks-bit? this (+ arg1 -1) arg2)) + (s1-0 (ocean-trans-camera-masks-bit? this (+ arg1 1) arg2)) + (s2-0 (ocean-trans-camera-masks-bit? this arg1 (+ arg2 -1))) + (a0-6 (ocean-trans-camera-masks-bit? this arg1 (+ arg2 1))) (v1-7 0) ) (if s0-0 @@ -539,97 +539,97 @@ ) (cond ((= v1-7 1) - (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + (if (not (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 -1)) (the-as int arg2))) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) ) ) ((= v1-7 2) - (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + (if (not (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 1)) (the-as int arg2))) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) ) ) ((= v1-7 4) - (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + (if (not (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 -1)))) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) ) ) ((= v1-7 5) - (let ((s2-1 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) - (v1-25 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) + (let ((s2-1 (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 -1)) (the-as int arg2))) + (v1-25 (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 -1)))) ) (cond ((and s2-1 v1-25) ) (s2-1 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) ) (v1-25 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) ) (else - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-left-table*) 18 #f) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-up-left-table*) 18 #f) ) ) ) ) ((= v1-7 6) - (let ((s2-2 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) - (v1-35 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 -1)))) + (let ((s2-2 (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 1)) (the-as int arg2))) + (v1-35 (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 -1)))) ) (cond ((and s2-2 v1-35) ) (s2-2 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-left-table*) 11 #t) ) (v1-35 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) ) (else - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-left-table*) 18 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-down-left-table*) 18 #t) ) ) ) ) ((= v1-7 8) - (if (not (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + (if (not (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 1)))) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) ) ) ((= v1-7 9) - (let ((s2-3 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 -1)) (the-as int arg2))) - (v1-50 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) + (let ((s2-3 (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 -1)) (the-as int arg2))) + (v1-50 (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 1)))) ) (cond ((and s2-3 v1-50) ) (s2-3 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) ) (v1-50 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-up-table*) 11 #t) ) (else - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-up-right-table*) 18 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-up-right-table*) 18 #t) ) ) ) ) ((= v1-7 10) - (let ((s2-4 (ocean-trans-mask-ptrs-bit? obj (the-as int (+ arg1 1)) (the-as int arg2))) - (v1-61 (ocean-trans-mask-ptrs-bit? obj (the-as int arg1) (the-as int (+ arg2 1)))) + (let ((s2-4 (ocean-trans-mask-ptrs-bit? this (the-as int (+ arg1 1)) (the-as int arg2))) + (v1-61 (ocean-trans-mask-ptrs-bit? this (the-as int arg1) (the-as int (+ arg2 1)))) ) (cond ((and s2-4 v1-61) ) (s2-4 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-right-table*) 11 #t) ) (v1-61 - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-down-table*) 11 #t) ) (else - (ocean-trans-add-upload-table obj arg0 arg1 arg2 (the-as int *ocean-trans-down-right-table*) 18 #f) + (ocean-trans-add-upload-table this arg0 arg1 arg2 (the-as int *ocean-trans-down-right-table*) 18 #f) ) ) ) @@ -643,14 +643,14 @@ ;; definition for method 38 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-transition-seams ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-transition-seams ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) (sv-34 uint) (sv-35 uint) (sv-36 sphere)) - (set! sv-32 (-> obj near-minx)) - (set! sv-33 (-> obj near-maxx)) - (set! sv-34 (-> obj near-minz)) - (set! sv-35 (-> obj near-maxz)) + (set! sv-32 (-> this near-minx)) + (set! sv-33 (-> this near-maxx)) + (set! sv-34 (-> this near-minz)) + (set! sv-35 (-> this near-maxz)) (set! sv-36 (new 'stack 'sphere)) - (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 y) (-> this start-corner y)) (set! (-> sv-36 r) 69511.42) (when (and (< sv-32 sv-33) (< sv-34 sv-35)) (let ((s4-0 sv-34) @@ -661,11 +661,11 @@ (s1-0 sv-33) ) (while (>= s1-0 s2-0) - (set! (-> sv-36 x) (+ 49152.0 (* 98304.0 (the float s2-0)) (-> obj start-corner x))) - (set! (-> sv-36 z) (+ 49152.0 (* 98304.0 (the float s4-0)) (-> obj start-corner z))) + (set! (-> sv-36 x) (+ 49152.0 (* 98304.0 (the float s2-0)) (-> this start-corner x))) + (set! (-> sv-36 z) (+ 49152.0 (* 98304.0 (the float s4-0)) (-> this start-corner z))) (when (sphere-cull sv-36) - (if (not (ocean-trans-camera-masks-bit? obj s4-0 s2-0)) - (ocean-trans-add-upload obj arg0 s4-0 s2-0) + (if (not (ocean-trans-camera-masks-bit? this s4-0 s2-0)) + (ocean-trans-add-upload this arg0 s4-0 s2-0) ) ) (+! s2-0 1) @@ -676,13 +676,13 @@ ) ) (dotimes (v1-28 16) - (when (nonzero? (-> obj trans-camera-masks v1-28)) + (when (nonzero? (-> this trans-camera-masks v1-28)) (dotimes (a0-12 4) - (let ((a1-8 (-> obj trans-mask-ptrs (+ (* v1-28 4) a0-12)))) + (let ((a1-8 (-> this trans-mask-ptrs (+ (* v1-28 4) a0-12)))) (if a1-8 (logior! (-> (the-as (pointer int32) a1-8) 1) - (-> (the-as (pointer uint8) (+ (+ a0-12 (* v1-28 4)) (the-as int obj))) 2992) + (-> (the-as (pointer uint8) (+ (+ a0-12 (* v1-28 4)) (the-as int this))) 2992) ) ) ) @@ -695,7 +695,7 @@ ;; definition for method 39 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod ocean-trans-add-constants ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-trans-add-constants ocean ((this ocean) (arg0 dma-buffer)) (let* ((a2-0 4) (v1-0 arg0) (a0-1 (the-as object (-> v1-0 base))) @@ -721,7 +721,7 @@ ;; definition for method 40 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-ocean-transition ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-transition ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-32 uint) (sv-33 uint) @@ -733,18 +733,18 @@ (sv-48 int) ) (dotimes (v1-0 16) - (set! (-> obj trans-camera-masks v1-0) (the-as ocean-trans-mask 0)) - (set! (-> obj near-mask-indices v1-0) (the-as uint -1)) + (set! (-> this trans-camera-masks v1-0) (the-as ocean-trans-mask 0)) + (set! (-> this near-mask-indices v1-0) (the-as uint -1)) ) (dotimes (v1-3 64) - (set! (-> obj trans-mask-ptrs v1-3) (the-as pointer #f)) + (set! (-> this trans-mask-ptrs v1-3) (the-as pointer #f)) ) - (set! sv-32 (-> obj mid-minx)) - (set! sv-33 (-> obj mid-maxx)) - (set! sv-34 (-> obj mid-minz)) - (set! sv-35 (-> obj mid-maxz)) + (set! sv-32 (-> this mid-minx)) + (set! sv-33 (-> this mid-maxx)) + (set! sv-34 (-> this mid-minz)) + (set! sv-35 (-> this mid-maxz)) (set! sv-36 (new 'stack 'sphere)) - (set! (-> sv-36 y) (-> obj start-corner y)) + (set! (-> sv-36 y) (-> this start-corner y)) (set! (-> sv-36 r) 278045.7) (let ((s4-0 sv-34) (s3-0 sv-35) @@ -754,12 +754,12 @@ (s1-0 sv-33) ) (while (>= s1-0 s2-0) - (when (not (ocean-mid-mask-ptrs-bit? obj s4-0 s2-0)) - (when (ocean-mid-camera-masks-bit? obj s4-0 s2-0) - (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> obj start-corner x))) - (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> obj start-corner z))) + (when (not (ocean-mid-mask-ptrs-bit? this s4-0 s2-0)) + (when (ocean-mid-camera-masks-bit? this s4-0 s2-0) + (set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s2-0)) (-> this start-corner x))) + (set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s4-0)) (-> this start-corner z))) (if (sphere-cull sv-36) - (ocean-make-trans-camera-masks obj s4-0 s2-0 (- s4-0 sv-34) (- s2-0 sv-32)) + (ocean-make-trans-camera-masks this s4-0 s2-0 (- s4-0 sv-34) (- s2-0 sv-32)) ) ) ) @@ -782,7 +782,7 @@ (t2-0 sv-33) ) (while (>= t2-0 t1-0) - (set! sv-40 (the-as ocean-trans-mask (&-> obj trans-camera-masks (+ (* (- a3-1 sv-34) 4) (- t1-0 sv-32))))) + (set! sv-40 (the-as ocean-trans-mask (&-> this trans-camera-masks (+ (* (- a3-1 sv-34) 4) (- t1-0 sv-32))))) (when (nonzero? (-> sv-40 word)) (dotimes (t3-10 4) (let ((t4-4 (-> sv-40 mask t3-10))) @@ -817,13 +817,13 @@ (+! a3-1 1) ) ) - (set! (-> obj near-minx) (the-as uint (+ a2-3 -1))) - (set! (-> obj near-maxx) (the-as uint (+ a1-7 1))) - (set! (-> obj near-minz) (the-as uint (+ a0-11 -1))) - (set! (-> obj near-maxz) (the-as uint (+ v1-33 1))) + (set! (-> this near-minx) (the-as uint (+ a2-3 -1))) + (set! (-> this near-maxx) (the-as uint (+ a1-7 1))) + (set! (-> this near-minz) (the-as uint (+ a0-11 -1))) + (set! (-> this near-maxz) (the-as uint (+ v1-33 1))) ) (dotimes (v1-35 16) - (set! (-> obj trans-temp-masks v1-35) (the-as uint (-> obj trans-camera-masks v1-35))) + (set! (-> this trans-temp-masks v1-35) (the-as uint (-> this trans-camera-masks v1-35))) ) (let ((s4-1 sv-34) (s3-1 sv-35) @@ -833,18 +833,18 @@ (s1-1 sv-33) ) (while (>= s1-1 s2-1) - (when (not (ocean-mid-mask-ptrs-bit? obj s4-1 s2-1)) - (when (ocean-mid-camera-masks-bit? obj s4-1 s2-1) - (let ((v1-46 (-> obj ocean-trans-indices data (+ (* (the-as uint 48) s4-1) s2-1)))) + (when (not (ocean-mid-mask-ptrs-bit? this s4-1 s2-1)) + (when (ocean-mid-camera-masks-bit? this s4-1 s2-1) + (let ((v1-46 (-> this ocean-trans-indices data (+ (* (the-as uint 48) s4-1) s2-1)))) (when (>= (-> v1-46 parent) 0) (set! sv-44 (+ (* (- s4-1 sv-34) 4) (- s2-1 sv-32))) - (set! (-> obj near-mask-indices sv-44) (the-as uint (-> v1-46 child))) - (let ((s0-0 (-> obj ocean-mid-masks data (-> v1-46 parent)))) + (set! (-> this near-mask-indices sv-44) (the-as uint (-> v1-46 child))) + (let ((s0-0 (-> this ocean-mid-masks data (-> v1-46 parent)))) (set! sv-48 0) (while (< sv-48 4) (let ((t0-2 (-> s0-0 mask sv-48))) (if (!= t0-2 255) - (ocean-trans-add-upload-strip obj arg0 s4-1 s2-1 (the-as int t0-2) (the-as int sv-44) sv-48) + (ocean-trans-add-upload-strip this arg0 s4-1 s2-1 (the-as int t0-2) (the-as int sv-44) sv-48) ) ) (set! sv-48 (+ sv-48 1)) @@ -860,10 +860,10 @@ (+! s4-1 1) ) ) - (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) - (ocean-trans-add-constants obj arg0) - (draw-ocean-transition-seams obj arg0) - (ocean-mid-add-call-flush obj arg0 (the-as uint 41)) + (ocean-mid-add-call-flush this arg0 (the-as uint 41)) + (ocean-trans-add-constants this arg0) + (draw-ocean-transition-seams this arg0) + (ocean-mid-add-call-flush this arg0 (the-as uint 41)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc index 139aa0deb2..37b96a8179 100644 --- a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean_REF.gc @@ -2,7 +2,7 @@ (in-package goal) ;; definition for method 21 of type ocean -(defmethod set-corners! ocean ((obj ocean) (corner-x float) (corner-z float)) +(defmethod set-corners! ocean ((this ocean) (corner-x float) (corner-z float)) (let* ((f2-0 (* 0.00008138021 corner-x)) (f3-0 (* 0.00008138021 corner-z)) (f0-2 f2-0) @@ -13,69 +13,71 @@ (a3-0 (logand (the int f3-0) 31)) (v1-9 (logand (+ a1-1 1) 31)) (a2-2 (logand (+ a3-0 1) 31)) - (f2-3 (-> obj heights data (+ (* a3-0 32) a1-1))) - (f3-1 (-> obj heights data (+ (* a3-0 32) v1-9))) - (f4-4 (-> obj heights data (+ (* a2-2 32) a1-1))) - (f5-0 (-> obj heights data (+ (* a2-2 32) v1-9))) + (f2-3 (-> this heights data (+ (* a3-0 32) a1-1))) + (f3-1 (-> this heights data (+ (* a3-0 32) v1-9))) + (f4-4 (-> this heights data (+ (* a2-2 32) a1-1))) + (f5-0 (-> this heights data (+ (* a2-2 32) v1-9))) (f6-1 (+ (* f3-1 f0-4) (* f2-3 (- 1.0 f0-4)))) (f0-9 (+ (* (+ (* f5-0 f0-4) (* f4-4 (- 1.0 f0-4))) f1-8) (* f6-1 (- 1.0 f1-8)))) ) - (set! (-> obj corner00) f2-3) - (set! (-> obj corner01) f3-1) - (set! (-> obj corner10) f4-4) - (set! (-> obj corner11) f5-0) + (set! (-> this corner00) f2-3) + (set! (-> this corner01) f3-1) + (set! (-> this corner10) f4-4) + (set! (-> this corner11) f5-0) f0-9 ) ) ;; definition for method 11 of type ocean -(defmethod get-height ocean ((obj ocean) (arg0 vector) (arg1 symbol)) +(defmethod get-height ocean ((this ocean) (arg0 vector) (arg1 symbol)) (local-vars (v1-12 int)) (cond - ((and (-> obj heights) *ocean-map*) - (let* ((f30-0 (- (-> arg0 x) (-> obj start-corner x))) - (f28-0 (- (-> arg0 z) (-> obj start-corner z))) + ((and (-> this heights) *ocean-map*) + (let* ((f30-0 (- (-> arg0 x) (-> this start-corner x))) + (f28-0 (- (-> arg0 z) (-> this start-corner z))) (v1-3 (the int (* 0.0000025431316 f30-0))) (a0-2 (the int (* 0.0000025431316 f28-0))) - (v1-7 (-> obj ocean-trans-indices data (+ (* 48 a0-2) v1-3))) + (v1-7 (-> this ocean-trans-indices data (+ (* 48 a0-2) v1-3))) ) (cond ((= (-> v1-7 parent) -1) (if arg1 - (-> obj start-corner y) + (-> this start-corner y) 4095996000.0 ) ) ((begin (let ((a0-8 (logand (the int (* 0.000010172526 f30-0)) 3)) (a3-4 (logand (the int (* 0.000010172526 f28-0)) 3)) - (v1-10 (-> obj ocean-near-indices data (-> v1-7 child))) + (v1-10 (-> this ocean-near-indices data (-> v1-7 child))) ) (set! v1-12 (-> (the-as (pointer int16) (+ (* (+ (* a3-4 4) a0-8) 2) (the-as int v1-10))))) ) (= v1-12 -1) ) (if arg1 - (-> obj start-corner y) + (-> this start-corner y) 4095996000.0 ) ) (else (let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7))) (cond - ((not (logtest? (-> obj ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) (ash 1 a0-14)) + ((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7)) + (ash 1 a0-14) + ) ) (let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos))) (f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2)))) ) - (if (-> obj ocean-near-translucent?) - (+ (* f26-0 (set-corners! obj f30-0 f28-0)) (-> obj start-corner y)) - (-> obj start-corner y) + (if (-> this ocean-near-translucent?) + (+ (* f26-0 (set-corners! this f30-0 f28-0)) (-> this start-corner y)) + (-> this start-corner y) ) ) ) (arg1 - (-> obj start-corner y) + (-> this start-corner y) ) (else 4095996000.0 @@ -110,9 +112,9 @@ ;; definition for method 17 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod add-colors! ocean ((obj ocean) (arg0 vector) (arg1 ocean-vertex)) +(defmethod add-colors! ocean ((this ocean) (arg0 vector) (arg1 ocean-vertex)) (let ((s3-0 (new 'stack-no-clear 'vector)) - (s4-0 (-> obj haze-lights)) + (s4-0 (-> this haze-lights)) ) (set! (-> s3-0 quad) (-> arg1 pos quad)) (set! (-> s3-0 y) 0.0) @@ -157,10 +159,10 @@ ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-60 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-60 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) - (let ((f0-0 (-> obj start-corner z))) + (let ((f0-0 (-> this start-corner z))) (let ((f1-1 (+ -5898240.0 f0-0))) (set! (-> vertices 0 pos z) f1-1) (set! (-> vertices 1 pos z) f1-1) @@ -172,12 +174,12 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 1.0) (set! (-> vertices 3 pos w) 1.0) - (set! sv-48 (-> obj start-corner x)) + (set! sv-48 (-> this start-corner x)) (set! sv-52 (new 'stack-no-clear 'vector)) (set! sv-56 (new 'stack-no-clear 'vector)) - (let ((s3-0 (-> obj ocean-colors))) + (let ((s3-0 (-> this ocean-colors))) (let ((s2-0 #f)) - (rgba-to-vector! obj sv-52 (-> s3-0 colors)) + (rgba-to-vector! this sv-52 (-> s3-0 colors)) (dotimes (s1-0 48) (let ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48))) (let ((f1-6 (+ 393216.0 f0-8))) @@ -187,7 +189,7 @@ ) (set! (-> vertices 3 pos x) f0-8) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 1) 4))) + (rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 1) 4))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) (set! (-> vertices 1 col quad) (-> sv-56 quad)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) @@ -207,7 +209,7 @@ ) ) (label cfg-9) - (let ((f0-10 (+ -5898240.0 (-> obj start-corner z)))) + (let ((f0-10 (+ -5898240.0 (-> this start-corner z)))) (let ((f1-9 (+ -5898240.0 f0-10))) (set! (-> vertices 0 pos z) f1-9) (set! (-> vertices 1 pos z) f1-9) @@ -219,9 +221,9 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.5) - (let ((s3-1 (-> obj ocean-colors))) + (let ((s3-1 (-> this ocean-colors))) (let ((s2-1 #f)) - (rgba-to-vector! obj sv-52 (-> s3-1 colors)) + (rgba-to-vector! this sv-52 (-> s3-1 colors)) (dotimes (s1-1 48) (let ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48))) (let ((f1-14 (+ 393216.0 f0-17))) @@ -231,9 +233,9 @@ ) (set! (-> vertices 3 pos x) f0-17) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 1) 4))) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 1) 4))) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) (set! (-> vertices 3 col quad) (-> sv-52 quad)) (set! (-> sv-52 quad) (-> sv-56 quad)) @@ -271,10 +273,10 @@ ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-61 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-61 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) - (let* ((f0-1 (+ 18874368.0 (-> obj start-corner z))) + (let* ((f0-1 (+ 18874368.0 (-> this start-corner z))) (f1-2 (+ 5898240.0 f0-1)) ) (set! (-> vertices 0 pos z) f0-1) @@ -286,12 +288,12 @@ (set! (-> vertices 1 pos w) 1.0) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.5) - (set! sv-48 (-> obj start-corner x)) + (set! sv-48 (-> this start-corner x)) (set! sv-52 (new 'stack-no-clear 'vector)) (set! sv-56 (new 'stack-no-clear 'vector)) - (let ((s3-0 (-> obj ocean-colors))) + (let ((s3-0 (-> this ocean-colors))) (let ((s2-0 #f)) - (rgba-to-vector! obj sv-52 (&-> s3-0 colors 2444)) + (rgba-to-vector! this sv-52 (&-> s3-0 colors 2444)) (dotimes (s1-0 48) (let ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48))) (let ((f1-7 (+ 393216.0 f0-9))) @@ -301,7 +303,7 @@ ) (set! (-> vertices 3 pos x) f0-9) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 2445) 4))) + (rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ s1-0 2445) 4))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) (set! (-> vertices 1 col quad) (-> sv-56 quad)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) @@ -321,7 +323,7 @@ ) ) (label cfg-9) - (let* ((f0-11 (+ 24772608.0 (-> obj start-corner z))) + (let* ((f0-11 (+ 24772608.0 (-> this start-corner z))) (f1-10 (+ 5898240.0 f0-11)) ) (set! (-> vertices 0 pos z) f0-11) @@ -333,9 +335,9 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.0) - (let ((s3-1 (-> obj ocean-colors))) + (let ((s3-1 (-> this ocean-colors))) (let ((s2-1 #f)) - (rgba-to-vector! obj sv-52 (&-> s3-1 colors 2444)) + (rgba-to-vector! this sv-52 (&-> s3-1 colors 2444)) (dotimes (s1-1 48) (let ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48))) (let ((f1-15 (+ 393216.0 f0-18))) @@ -345,11 +347,11 @@ ) (set! (-> vertices 3 pos x) f0-18) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 2445) 4))) + (rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ s1-1 2445) 4))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) (set! (-> vertices 1 col quad) (-> sv-56 quad)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (set! (-> sv-52 quad) (-> sv-56 quad)) (cond ((render-ocean-quad vertices arg0) @@ -385,10 +387,10 @@ ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-62 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-62 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) - (let* ((f0-0 (-> obj start-corner x)) + (let* ((f0-0 (-> this start-corner x)) (f1-1 (+ -5898240.0 f0-0)) ) (set! (-> vertices 0 pos x) f1-1) @@ -400,12 +402,12 @@ (set! (-> vertices 1 pos w) 1.0) (set! (-> vertices 2 pos w) 1.0) (set! (-> vertices 3 pos w) 0.5) - (set! sv-48 (-> obj start-corner z)) + (set! sv-48 (-> this start-corner z)) (set! sv-52 (new 'stack-no-clear 'vector)) (set! sv-56 (new 'stack-no-clear 'vector)) - (let ((s3-0 (-> obj ocean-colors))) + (let ((s3-0 (-> this ocean-colors))) (let ((s2-0 #f)) - (rgba-to-vector! obj sv-52 (-> s3-0 colors)) + (rgba-to-vector! this sv-52 (-> s3-0 colors)) (dotimes (s1-0 48) (let* ((f0-8 (+ (* 393216.0 (the float s1-0)) sv-48)) (f1-6 (+ 393216.0 f0-8)) @@ -415,7 +417,7 @@ (set! (-> vertices 2 pos z) f1-6) (set! (-> vertices 3 pos z) f1-6) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* 208 (+ s1-0 1)))) + (rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* 208 (+ s1-0 1)))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) (set! (-> vertices 1 col quad) (-> sv-52 quad)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) @@ -435,7 +437,7 @@ ) ) (label cfg-9) - (let* ((f0-10 (+ -5898240.0 (-> obj start-corner x))) + (let* ((f0-10 (+ -5898240.0 (-> this start-corner x))) (f1-9 (+ -5898240.0 f0-10)) ) (set! (-> vertices 0 pos x) f1-9) @@ -447,9 +449,9 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.0) - (let ((s3-1 (-> obj ocean-colors))) + (let ((s3-1 (-> this ocean-colors))) (let ((s2-1 #f)) - (rgba-to-vector! obj sv-52 (-> s3-1 colors)) + (rgba-to-vector! this sv-52 (-> s3-1 colors)) (dotimes (s1-1 48) (let* ((f0-17 (+ (* 393216.0 (the float s1-1)) sv-48)) (f1-14 (+ 393216.0 f0-17)) @@ -459,11 +461,11 @@ (set! (-> vertices 2 pos z) f1-14) (set! (-> vertices 3 pos z) f1-14) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* 208 (+ s1-1 1)))) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* 208 (+ s1-1 1)))) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) (set! (-> vertices 1 col quad) (-> sv-52 quad)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (set! (-> sv-52 quad) (-> sv-56 quad)) (cond ((render-ocean-quad vertices arg0) @@ -499,10 +501,10 @@ ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-63 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-63 ocean ((this ocean) (arg0 dma-buffer)) (local-vars (sv-48 float) (sv-52 vector) (sv-56 vector)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) - (let ((f0-1 (+ 18874368.0 (-> obj start-corner x)))) + (let ((f0-1 (+ 18874368.0 (-> this start-corner x)))) (let ((f1-2 (+ 5898240.0 f0-1))) (set! (-> vertices 0 pos x) f0-1) (set! (-> vertices 1 pos x) f1-2) @@ -514,12 +516,12 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 1.0) - (set! sv-48 (-> obj start-corner z)) + (set! sv-48 (-> this start-corner z)) (set! sv-52 (new 'stack-no-clear 'vector)) (set! sv-56 (new 'stack-no-clear 'vector)) - (let ((s3-0 (-> obj ocean-colors))) + (let ((s3-0 (-> this ocean-colors))) (let ((s2-0 #f)) - (rgba-to-vector! obj sv-52 (&-> s3-0 colors 47)) + (rgba-to-vector! this sv-52 (&-> s3-0 colors 47)) (dotimes (s1-0 48) (let* ((f0-9 (+ (* 393216.0 (the float s1-0)) sv-48)) (f1-7 (+ 393216.0 f0-9)) @@ -529,7 +531,7 @@ (set! (-> vertices 2 pos z) f1-7) (set! (-> vertices 3 pos z) f1-7) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-0 colors) (* (+ (* 52 (+ s1-0 1)) 47) 4))) + (rgba-to-vector! this sv-56 (&+ (-> s3-0 colors) (* (+ (* 52 (+ s1-0 1)) 47) 4))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) (set! (-> vertices 1 col quad) (-> sv-52 quad)) (set! (-> vertices 2 col quad) (-> sv-56 quad)) @@ -549,7 +551,7 @@ ) ) (label cfg-9) - (let ((f0-11 (+ 24772608.0 (-> obj start-corner x)))) + (let ((f0-11 (+ 24772608.0 (-> this start-corner x)))) (let ((f1-10 (+ 5898240.0 f0-11))) (set! (-> vertices 0 pos x) f0-11) (set! (-> vertices 1 pos x) f1-10) @@ -561,9 +563,9 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.5) - (let ((s3-1 (-> obj ocean-colors))) + (let ((s3-1 (-> this ocean-colors))) (let ((s2-1 #f)) - (rgba-to-vector! obj sv-52 (&-> s3-1 colors 47)) + (rgba-to-vector! this sv-52 (&-> s3-1 colors 47)) (dotimes (s1-1 48) (let* ((f0-18 (+ (* 393216.0 (the float s1-1)) sv-48)) (f1-15 (+ 393216.0 f0-18)) @@ -573,10 +575,10 @@ (set! (-> vertices 2 pos z) f1-15) (set! (-> vertices 3 pos z) f1-15) ) - (rgba-to-vector! obj sv-56 (&+ (-> s3-1 colors) (* (+ (* 52 (+ s1-1 1)) 47) 4))) + (rgba-to-vector! this sv-56 (&+ (-> s3-1 colors) (* (+ (* 52 (+ s1-1 1)) 47) 4))) (set! (-> vertices 0 col quad) (-> sv-52 quad)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) (set! (-> vertices 3 col quad) (-> sv-56 quad)) (set! (-> sv-52 quad) (-> sv-56 quad)) (cond @@ -601,16 +603,16 @@ ;; definition for method 64 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-64 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-64 ocean ((this ocean) (arg0 dma-buffer)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) - (let* ((v1-1 (-> obj ocean-colors)) - (f30-0 (-> obj start-corner x)) - (f28-0 (-> obj start-corner z)) + (let* ((v1-1 (-> this ocean-colors)) + (f30-0 (-> this start-corner x)) + (f28-0 (-> this start-corner z)) (f26-0 (+ -5898240.0 f30-0)) (f24-0 (+ -5898240.0 f28-0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (rgba-to-vector! obj s3-0 (-> v1-1 colors)) + (rgba-to-vector! this s3-0 (-> v1-1 colors)) (set! (-> vertices 0 pos x) f26-0) (set! (-> vertices 1 pos x) f30-0) (set! (-> vertices 2 pos x) f30-0) @@ -628,8 +630,8 @@ (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let ((f0-7 (+ -5898240.0 (-> obj start-corner x))) - (f1-1 (-> obj start-corner z)) + (let ((f0-7 (+ -5898240.0 (-> this start-corner x))) + (f1-1 (-> this start-corner z)) ) (let ((f2-1 (+ -5898240.0 f0-7)) (f3-1 (+ -5898240.0 f1-1)) @@ -648,13 +650,13 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.0) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) (set! (-> vertices 1 col quad) (-> s3-0 quad)) (set! (-> vertices 2 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) - (let ((f0-13 (+ -5898240.0 (-> obj start-corner x))) - (f1-4 (+ -5898240.0 (-> obj start-corner z))) + (let ((f0-13 (+ -5898240.0 (-> this start-corner x))) + (f1-4 (+ -5898240.0 (-> this start-corner z))) ) (let ((f2-4 (+ -5898240.0 f0-13)) (f3-3 (+ -5898240.0 f1-4)) @@ -673,13 +675,13 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.0) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) (set! (-> vertices 2 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) - (let ((f0-18 (-> obj start-corner x)) - (f1-6 (+ -5898240.0 (-> obj start-corner z))) + (let ((f0-18 (-> this start-corner x)) + (f1-6 (+ -5898240.0 (-> this start-corner z))) ) (let ((f2-7 (+ -5898240.0 f0-18)) (f3-5 (+ -5898240.0 f1-6)) @@ -698,8 +700,8 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.5) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) - (add-colors! obj (-> vertices 1 col) (-> vertices 2)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 1 col) (-> vertices 2)) (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) ) @@ -712,16 +714,16 @@ ;; definition for method 65 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-65 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-65 ocean ((this ocean) (arg0 dma-buffer)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) - (let* ((v1-1 (-> obj ocean-colors)) - (f30-0 (+ 18874368.0 (-> obj start-corner x))) - (f28-0 (-> obj start-corner z)) + (let* ((v1-1 (-> this ocean-colors)) + (f30-0 (+ 18874368.0 (-> this start-corner x))) + (f28-0 (-> this start-corner z)) (f26-0 (+ 5898240.0 f30-0)) (f24-0 (+ -5898240.0 f28-0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (rgba-to-vector! obj s3-0 (&-> v1-1 colors 47)) + (rgba-to-vector! this s3-0 (&-> v1-1 colors 47)) (set! (-> vertices 0 pos x) f30-0) (set! (-> vertices 1 pos x) f26-0) (set! (-> vertices 2 pos x) f26-0) @@ -739,8 +741,8 @@ (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let ((f0-8 (+ 24772608.0 (-> obj start-corner x))) - (f1-2 (-> obj start-corner z)) + (let ((f0-8 (+ 24772608.0 (-> this start-corner x))) + (f1-2 (-> this start-corner z)) ) (let ((f2-1 (+ 5898240.0 f0-8)) (f3-1 (+ -5898240.0 f1-2)) @@ -760,12 +762,12 @@ (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.5) (set! (-> vertices 0 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let ((f0-14 (+ 18874368.0 (-> obj start-corner x))) - (f1-5 (+ -5898240.0 (-> obj start-corner z))) + (let ((f0-14 (+ 18874368.0 (-> this start-corner x))) + (f1-5 (+ -5898240.0 (-> this start-corner z))) ) (let ((f2-4 (+ 5898240.0 f0-14)) (f3-3 (+ -5898240.0 f1-5)) @@ -784,13 +786,13 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.5) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let ((f0-20 (+ 24772608.0 (-> obj start-corner x))) - (f1-8 (+ -5898240.0 (-> obj start-corner z))) + (let ((f0-20 (+ 24772608.0 (-> this start-corner x))) + (f1-8 (+ -5898240.0 (-> this start-corner z))) ) (let ((f2-7 (+ 5898240.0 f0-20)) (f3-5 (+ -5898240.0 f1-8)) @@ -809,9 +811,9 @@ (set! (-> vertices 1 pos w) 0.0) (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.5) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) ) (render-ocean-quad vertices arg0) @@ -823,16 +825,16 @@ ;; definition for method 66 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-66 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-66 ocean ((this ocean) (arg0 dma-buffer)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) - (let* ((v1-1 (-> obj ocean-colors)) - (f30-0 (-> obj start-corner x)) - (f28-0 (+ 18874368.0 (-> obj start-corner z))) + (let* ((v1-1 (-> this ocean-colors)) + (f30-0 (-> this start-corner x)) + (f28-0 (+ 18874368.0 (-> this start-corner z))) (f26-0 (+ -5898240.0 f30-0)) (f24-0 (+ 5898240.0 f28-0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (rgba-to-vector! obj s3-0 (&-> v1-1 colors 2444)) + (rgba-to-vector! this s3-0 (&-> v1-1 colors 2444)) (set! (-> vertices 0 pos x) f26-0) (set! (-> vertices 1 pos x) f30-0) (set! (-> vertices 2 pos x) f30-0) @@ -850,8 +852,8 @@ (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let* ((f0-8 (+ -5898240.0 (-> obj start-corner x))) - (f1-3 (+ 18874368.0 (-> obj start-corner z))) + (let* ((f0-8 (+ -5898240.0 (-> this start-corner x))) + (f1-3 (+ 18874368.0 (-> this start-corner z))) (f2-2 (+ -5898240.0 f0-8)) (f3-1 (+ 5898240.0 f1-3)) ) @@ -868,13 +870,13 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.5) (set! (-> vertices 3 pos w) 0.0) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) (set! (-> vertices 1 col quad) (-> s3-0 quad)) (set! (-> vertices 2 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) - (let* ((f0-14 (+ -5898240.0 (-> obj start-corner x))) - (f1-6 (+ 24772608.0 (-> obj start-corner z))) + (let* ((f0-14 (+ -5898240.0 (-> this start-corner x))) + (f1-6 (+ 24772608.0 (-> this start-corner z))) (f2-5 (+ -5898240.0 f0-14)) (f3-3 (+ 5898240.0 f1-6)) ) @@ -891,13 +893,13 @@ (set! (-> vertices 1 pos w) 0.5) (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.0) - (add-colors! obj (-> vertices 0 col) (-> vertices 0)) + (add-colors! this (-> vertices 0 col) (-> vertices 0)) (set! (-> vertices 1 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) - (let* ((f0-19 (-> obj start-corner x)) - (f1-8 (+ 24772608.0 (-> obj start-corner z))) + (let* ((f0-19 (-> this start-corner x)) + (f1-8 (+ 24772608.0 (-> this start-corner z))) (f2-8 (+ -5898240.0 f0-19)) (f3-5 (+ 5898240.0 f1-8)) ) @@ -917,8 +919,8 @@ (set! (-> vertices 0 col quad) (-> s3-0 quad)) (set! (-> vertices 1 col quad) (-> s3-0 quad)) ) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) ) 0 @@ -928,16 +930,16 @@ ;; definition for method 67 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ocean-method-67 ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod ocean-method-67 ocean ((this ocean) (arg0 dma-buffer)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) - (let* ((v1-1 (-> obj ocean-colors)) - (f30-0 (+ 18874368.0 (-> obj start-corner x))) - (f28-0 (+ 18874368.0 (-> obj start-corner z))) + (let* ((v1-1 (-> this ocean-colors)) + (f30-0 (+ 18874368.0 (-> this start-corner x))) + (f28-0 (+ 18874368.0 (-> this start-corner z))) (f26-0 (+ 5898240.0 f30-0)) (f24-0 (+ 5898240.0 f28-0)) (s3-0 (new 'stack-no-clear 'vector)) ) - (rgba-to-vector! obj s3-0 (&-> v1-1 colors 2491)) + (rgba-to-vector! this s3-0 (&-> v1-1 colors 2491)) (set! (-> vertices 0 pos x) f30-0) (set! (-> vertices 1 pos x) f26-0) (set! (-> vertices 2 pos x) f26-0) @@ -955,8 +957,8 @@ (set! (-> vertices 2 col quad) (-> s3-0 quad)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let* ((f0-9 (+ 24772608.0 (-> obj start-corner x))) - (f1-4 (+ 18874368.0 (-> obj start-corner z))) + (let* ((f0-9 (+ 24772608.0 (-> this start-corner x))) + (f1-4 (+ 18874368.0 (-> this start-corner z))) (f2-2 (+ 5898240.0 f0-9)) (f3-1 (+ 5898240.0 f1-4)) ) @@ -974,12 +976,12 @@ (set! (-> vertices 2 pos w) 0.0) (set! (-> vertices 3 pos w) 0.5) (set! (-> vertices 0 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) (set! (-> vertices 3 col quad) (-> s3-0 quad)) (render-ocean-quad vertices arg0) - (let* ((f0-15 (+ 18874368.0 (-> obj start-corner x))) - (f1-7 (+ 24772608.0 (-> obj start-corner z))) + (let* ((f0-15 (+ 18874368.0 (-> this start-corner x))) + (f1-7 (+ 24772608.0 (-> this start-corner z))) (f2-5 (+ 5898240.0 f0-15)) (f3-3 (+ 5898240.0 f1-7)) ) @@ -998,11 +1000,11 @@ (set! (-> vertices 3 pos w) 0.0) (set! (-> vertices 0 col quad) (-> s3-0 quad)) (set! (-> vertices 1 col quad) (-> s3-0 quad)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) - (let* ((f0-21 (+ 24772608.0 (-> obj start-corner x))) - (f1-10 (+ 24772608.0 (-> obj start-corner z))) + (let* ((f0-21 (+ 24772608.0 (-> this start-corner x))) + (f1-10 (+ 24772608.0 (-> this start-corner z))) (f2-8 (+ 5898240.0 f0-21)) (f3-5 (+ 5898240.0 f1-10)) ) @@ -1021,9 +1023,9 @@ (set! (-> vertices 3 pos w) 0.0) (set! (-> vertices 0 col quad) (-> s3-0 quad)) ) - (add-colors! obj (-> vertices 1 col) (-> vertices 1)) - (add-colors! obj (-> vertices 2 col) (-> vertices 2)) - (add-colors! obj (-> vertices 3 col) (-> vertices 3)) + (add-colors! this (-> vertices 1 col) (-> vertices 1)) + (add-colors! this (-> vertices 2 col) (-> vertices 2)) + (add-colors! this (-> vertices 3 col) (-> vertices 3)) (render-ocean-quad vertices arg0) ) 0 @@ -1032,9 +1034,9 @@ ;; definition for method 68 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod render-ocean-far ocean ((obj ocean) (arg1 dma-buffer) (facing int)) +(defmethod render-ocean-far ocean ((this ocean) (arg1 dma-buffer) (facing int)) (let ((vertices (the-as (inline-array ocean-vertex) (+ #x70000000 0)))) - (let ((f0-0 (-> obj start-corner y))) + (let ((f0-0 (-> this start-corner y))) (set! (-> vertices 0 pos y) f0-0) (set! (-> vertices 1 pos y) f0-0) (set! (-> vertices 2 pos y) f0-0) @@ -1045,20 +1047,20 @@ (set-vector! (-> vertices 2 stq) 1.0 15.0 1.0 1.0) (set-vector! (-> vertices 3 stq) 0.0 15.0 1.0 1.0) (if (not (logtest? facing 2)) - (ocean-method-60 obj arg1) + (ocean-method-60 this arg1) ) (if (not (logtest? facing 4)) - (ocean-method-61 obj arg1) + (ocean-method-61 this arg1) ) (set-vector! (-> vertices 0 stq) 0.0 0.0 1.0 1.0) (set-vector! (-> vertices 1 stq) 15.0 0.0 1.0 1.0) (set-vector! (-> vertices 2 stq) 15.0 1.0 1.0 1.0) (set-vector! (-> vertices 3 stq) 0.0 1.0 1.0 1.0) (if (not (logtest? facing 16)) - (ocean-method-62 obj arg1) + (ocean-method-62 this arg1) ) (if (not (logtest? facing 8)) - (ocean-method-63 obj arg1) + (ocean-method-63 this arg1) ) (set-vector! (-> vertices 0 stq) 0.0 0.0 1.0 1.0) (set-vector! (-> vertices 1 stq) 15.0 0.0 1.0 1.0) @@ -1066,16 +1068,16 @@ (set-vector! (-> vertices 3 stq) 0.0 15.0 1.0 1.0) ) (if (not (or (logtest? facing 2) (logtest? facing 16))) - (ocean-method-64 obj arg1) + (ocean-method-64 this arg1) ) (if (not (or (logtest? facing 2) (logtest? facing 8))) - (ocean-method-65 obj arg1) + (ocean-method-65 this arg1) ) (if (not (or (logtest? facing 4) (logtest? facing 16))) - (ocean-method-66 obj arg1) + (ocean-method-66 this arg1) ) (if (not (or (logtest? facing 4) (logtest? facing 8))) - (ocean-method-67 obj arg1) + (ocean-method-67 this arg1) ) 0 (none) @@ -1083,23 +1085,23 @@ ;; definition for method 69 of type ocean ;; WARN: Return type mismatch uint vs none. -(defmethod draw-ocean-far ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod draw-ocean-far ocean ((this ocean) (arg0 dma-buffer)) (init-ocean-far-regs) (let ((gp-0 (the-as object (-> arg0 base)))) (&+! (-> arg0 base) 16) - (let ((v1-2 (-> obj ocean-facing))) + (let ((v1-2 (-> this ocean-facing))) (cond ((zero? v1-2) - (render-ocean-far obj arg0 4) + (render-ocean-far this arg0 4) ) ((= v1-2 1) - (render-ocean-far obj arg0 2) + (render-ocean-far this arg0 2) ) ((= v1-2 3) - (render-ocean-far obj arg0 8) + (render-ocean-far this arg0 8) ) ((= v1-2 2) - (render-ocean-far obj arg0 16) + (render-ocean-far this arg0 16) ) ) ) @@ -1115,13 +1117,13 @@ ;; definition for method 19 of type ocean ;; WARN: Return type mismatch pointer vs none. -(defmethod init-buffer! ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod init-buffer! ocean ((this ocean) (arg0 dma-buffer)) "Initialize [[ocean]] DMA buffer." (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) (tex0-1 (new 'static 'gs-tex0 :tbp0 #x2a0 :tbw #x2 :th (log2 128) :tw (log2 128))) - (tex1-1 (-> obj tex1)) + (tex1-1 (-> this tex1)) (texa (new 'static 'gs-texa :ta0 #x80 :ta1 #x80)) (miptbp1-1 (new 'static 'gs-miptbp :tbp1 #x6a0 :tbw1 #x1 :tbp2 #x7a0 :tbp3 #x7e0)) (miptbp2-1 (new 'static 'gs-miptbp :tbp1 #x800 :tbp2 #x820 :tbp3 #x840)) @@ -1133,7 +1135,7 @@ ;; definition for method 20 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod end-buffer! ocean ((obj ocean) (arg0 dma-buffer)) +(defmethod end-buffer! ocean ((this ocean) (arg0 dma-buffer)) (dma-buffer-add-gs-set arg0 (texa (new 'static 'gs-texa :ta1 #x80))) 0 (none) @@ -1141,25 +1143,25 @@ ;; definition for method 9 of type ocean-map ;; WARN: Return type mismatch int vs none. -(defmethod set-height! ocean-map ((obj ocean-map) (arg0 float)) - (if obj - (set! (-> obj start-corner y) arg0) +(defmethod set-height! ocean-map ((this ocean-map) (arg0 float)) + (if this + (set! (-> this start-corner y) arg0) ) 0 (none) ) ;; definition for method 10 of type ocean-map -(defmethod get-base-height ocean-map ((obj ocean-map)) - (if obj - (-> obj start-corner y) +(defmethod get-base-height ocean-map ((this ocean-map)) + (if this + (-> this start-corner y) 0.0 ) ) ;; definition for method 90 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod rgba-to-vector! ocean ((obj ocean) (arg0 vector) (arg1 (pointer rgba))) +(defmethod rgba-to-vector! ocean ((this ocean) (arg0 vector) (arg1 (pointer rgba))) "Pack an [[rgba]]'s bytes into a vector." (local-vars (v1-1 uint128) (v1-2 uint128)) (rlet ((vf1 :class vf)) @@ -1179,7 +1181,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [psrah a2, a2, 8] -(defmethod ocean-method-18 ocean ((obj ocean) (arg0 (pointer ocean-colors)) (arg1 (pointer ocean-colors))) +(defmethod ocean-method-18 ocean ((this ocean) (arg0 (pointer ocean-colors)) (arg1 (pointer ocean-colors))) "Unused" (local-vars (a1-17 (pointer ocean-colors)) @@ -1226,34 +1228,34 @@ (cond (v1-1 (let ((s2-0 (new 'stack-no-clear 'vector))) - (let ((f0-0 (-> obj constant w)) + (let ((f0-0 (-> this constant w)) (a2-6 (-> *level* default-level mood-context times)) ) - (set! (-> s2-0 quad) (-> obj sky-color quad)) + (set! (-> s2-0 quad) (-> this sky-color quad)) (vector4-lerp! s2-0 s2-0 (the-as vector a2-6) f0-0) ) (let ((s1-0 (new 'stack-no-clear 'vector4)) (s3-0 (new 'stack-no-clear 'vector)) ) (let ((v1-5 (math-camera-pos))) - (vector-! (the-as vector s1-0) v1-5 (-> obj start-corner)) + (vector-! (the-as vector s1-0) v1-5 (-> this start-corner)) ) (vector4-scale! s1-0 s1-0 0.0000025431316) - (set! (-> s3-0 y) (* 0.0000025431316 (-> obj start-corner y))) - (.lvf vf16 (&-> obj constant quad)) + (set! (-> s3-0 y) (* 0.0000025431316 (-> this start-corner y))) + (.lvf vf16 (&-> this constant quad)) (.lvf vf3 (&-> s2-0 quad)) (.lvf vf4 (&-> s1-0 quad)) (.sub.vf vf16 vf0 vf16 :mask #b1000) (let ((f3-0 48.0)) - (.lvf vf7 (&-> obj haze-lights sun0-normal quad)) - (.lvf vf8 (&-> obj haze-lights sun1-normal quad)) - (.lvf vf9 (&-> obj haze-lights moon-normal quad)) + (.lvf vf7 (&-> this haze-lights sun0-normal quad)) + (.lvf vf8 (&-> this haze-lights sun1-normal quad)) + (.lvf vf9 (&-> this haze-lights moon-normal quad)) (.sub.vf vf7 vf0 vf7 :mask #b101) (.sub.vf vf8 vf0 vf8 :mask #b101) (.sub.vf vf9 vf0 vf9 :mask #b101) - (.lvf vf10 (&-> obj haze-lights sun0-color quad)) - (.lvf vf11 (&-> obj haze-lights sun1-color quad)) - (.lvf vf12 (&-> obj haze-lights moon-color quad)) + (.lvf vf10 (&-> this haze-lights sun0-color quad)) + (.lvf vf11 (&-> this haze-lights sun1-color quad)) + (.lvf vf12 (&-> this haze-lights moon-color quad)) (.max.w.vf vf1 vf0 vf0) (dotimes (v1-8 49) (dotimes (a0-10 52) @@ -1347,17 +1349,17 @@ ;; definition for method 13 of type ocean ;; WARN: Return type mismatch int vs none. -(defmethod update-map ocean ((obj ocean)) - (set! (-> obj heights) #f) - (set! (-> obj verts) #f) +(defmethod update-map ocean ((this ocean)) + (set! (-> this heights) #f) + (set! (-> this verts) #f) (let ((s5-0 *mood-control*)) - (set! (-> obj constant w) (if (and (-> s5-0 overide-weather-flag) (not (movie?))) - (-> s5-0 overide cloud) - (-> s5-0 current-interp cloud) - ) + (set! (-> this constant w) (if (and (-> s5-0 overide-weather-flag) (not (movie?))) + (-> s5-0 overide cloud) + (-> s5-0 current-interp cloud) + ) ) ) - (set! (-> obj constant w) (fmin 1.0 (* 2.0 (-> obj constant w)))) + (set! (-> this constant w) (fmin 1.0 (* 2.0 (-> this constant w)))) (let ((f0-5 1.0) (f30-0 1.0) ) @@ -1365,59 +1367,64 @@ (set! f0-5 0.333) (set! f30-0 0.75) ) - (set! (-> obj frame-speed) (* (+ 4.0 (-> *setting-control* user-current rain)) f0-5)) - (set! (-> obj frame-speed2) (* (+ 5.0 (-> *setting-control* user-current rain)) f0-5)) + (set! (-> this frame-speed) (* (+ 4.0 (-> *setting-control* user-current rain)) f0-5)) + (set! (-> this frame-speed2) (* (+ 5.0 (-> *setting-control* user-current rain)) f0-5)) (when (not (paused?)) - (let ((f0-8 (+ (-> obj frame-num) (* (-> obj frame-speed) (seconds-per-frame))))) - (set! (-> obj frame-num) (- f0-8 (* (the float (the int (/ f0-8 64.0))) 64.0))) + (let ((f0-8 (+ (-> this frame-num) (* (-> this frame-speed) (seconds-per-frame))))) + (set! (-> this frame-num) (- f0-8 (* (the float (the int (/ f0-8 64.0))) 64.0))) ) - (let ((f0-11 (+ (-> obj frame-num2) (* (-> obj frame-speed2) (seconds-per-frame))))) - (set! (-> obj frame-num2) (- f0-11 (* (the float (the int (/ f0-11 64.0))) 64.0))) + (let ((f0-11 (+ (-> this frame-num2) (* (-> this frame-speed2) (seconds-per-frame))))) + (set! (-> this frame-num2) (- f0-11 (* (the float (the int (/ f0-11 64.0))) 64.0))) ) ) (let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf))) - (set! (-> obj heights) (the-as ocean-height-array (-> s5-1 base))) - (interp-wave obj (the-as ocean-wave-info (-> obj heights)) (the-as uint (-> obj frame-num)) (* 0.08325 f30-0)) - (&+! (-> s5-1 base) 4096) - (set! (-> obj heights2) (the-as ocean-height-array (-> s5-1 base))) + (set! (-> this heights) (the-as ocean-height-array (-> s5-1 base))) (interp-wave - obj - (the-as ocean-wave-info (-> obj heights2)) - (the-as uint (-> obj frame-num2)) + this + (the-as ocean-wave-info (-> this heights)) + (the-as uint (-> this frame-num)) + (* 0.08325 f30-0) + ) + (&+! (-> s5-1 base) 4096) + (set! (-> this heights2) (the-as ocean-height-array (-> s5-1 base))) + (interp-wave + this + (the-as ocean-wave-info (-> this heights2)) + (the-as uint (-> this frame-num2)) (* 0.01665 f30-0) ) (&+! (-> s5-1 base) 4096) - (ocean-method-15 obj (the-as matrix (-> obj heights)) (the-as matrix (-> obj heights2))) - (set! (-> obj verts) (the-as ocean-vert-array (-> s5-1 base))) + (ocean-method-15 this (the-as matrix (-> this heights)) (the-as matrix (-> this heights2))) + (set! (-> this verts) (the-as ocean-vert-array (-> s5-1 base))) (&+! (-> s5-1 base) #x8000) ) ) - (when (not (or (-> obj off) (-> *blit-displays-work* menu-mode))) + (when (not (or (-> this off) (-> *blit-displays-work* menu-mode))) (when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask ocean)) - (mem-copy! (the-as pointer (-> obj cloud-lights)) (the-as pointer (-> *sky-work* cloud-lights)) 156) - (mem-copy! (the-as pointer (-> obj haze-lights)) (the-as pointer (-> *sky-work* haze-lights)) 124) + (mem-copy! (the-as pointer (-> this cloud-lights)) (the-as pointer (-> *sky-work* cloud-lights)) 156) + (mem-copy! (the-as pointer (-> this haze-lights)) (the-as pointer (-> *sky-work* haze-lights)) 124) (vector4-scale! - (the-as vector4 (-> obj sky-color)) + (the-as vector4 (-> this sky-color)) (the-as vector4 (-> *time-of-day-context* current-sky-color)) 0.0078125 ) - (generate-verts obj (-> obj verts) (-> obj heights)) + (generate-verts this (-> this verts) (-> this heights)) (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-2 (-> s4-0 base)) ) (if (-> *time-of-day-context* sky) - (ocean-method-89 obj s4-0) + (ocean-method-89 this s4-0) ) - (draw-ocean-texture obj s4-0 (the-as int (-> obj verts))) - (ocean-method-79 obj s4-0) - (init-buffer! obj s4-0) - (if (-> obj far-on) - (draw-ocean-far obj s4-0) + (draw-ocean-texture this s4-0 (the-as int (-> this verts))) + (ocean-method-79 this s4-0) + (init-buffer! this s4-0) + (if (-> this far-on) + (draw-ocean-far this s4-0) ) - (if (not (-> obj mid-off)) - (draw-ocean-mid obj s4-0) + (if (not (-> this mid-off)) + (draw-ocean-mid this s4-0) ) - (end-buffer! obj s4-0) + (end-buffer! this s4-0) (set-dirty-mask! (-> *level* default-level) 9 #xc0000 #x2a000) (let ((a3-3 (-> s4-0 base))) (let ((v1-87 (the-as object (-> s4-0 base)))) @@ -1434,16 +1441,16 @@ ) ) ) - (when (not (or (-> obj near-off) - (or (-> obj mid-off) (< 196608.0 (fabs (- (-> obj start-corner y) (-> *math-camera* trans y))))) + (when (not (or (-> this near-off) + (or (-> this mid-off) (< 196608.0 (fabs (- (-> this start-corner y) (-> *math-camera* trans y))))) ) ) (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-3 (-> s4-1 base)) ) - (draw-ocean-texture obj s4-1 (the-as int (-> obj verts))) - (draw-ocean-near obj s4-1) - (end-buffer! obj s4-1) + (draw-ocean-texture this s4-1 (the-as int (-> this verts))) + (draw-ocean-near this s4-1) + (end-buffer! this s4-1) (set-dirty-mask! (-> *level* default-level) 7 #xc0000 #x2a000) (let ((a3-5 (-> s4-1 base))) (let ((v1-113 (the-as object (-> s4-1 base)))) @@ -1464,12 +1471,12 @@ ) ) (when (not (paused?)) - (set! (-> obj off) #f) - (set! (-> obj mid-off) #f) - (set! (-> obj near-off) (if obj - (not (-> obj ocean-near-translucent?)) - #f - ) + (set! (-> this off) #f) + (set! (-> this mid-off) #f) + (set! (-> this near-off) (if this + (not (-> this ocean-near-translucent?)) + #f + ) ) ) 0 @@ -1479,15 +1486,15 @@ ;; definition for method 12 of type ocean ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw! ocean ((obj ocean)) - (do-tex-scroll! obj) +(defmethod draw! ocean ((this ocean)) + (do-tex-scroll! this) (set! *ocean-map* #f) - (set! (-> obj far-on) #f) + (set! (-> this far-on) #f) (dotimes (v1-2 (-> *level* length)) (let ((a0-5 (-> *level* level v1-2))) (when (= (-> a0-5 status) 'active) (if (-> a0-5 info ocean-far?) - (set! (-> obj far-on) #t) + (set! (-> this far-on) #t) ) (let ((a1-7 (-> a0-5 info ocean))) (cond @@ -1499,7 +1506,7 @@ ) ((and a1-7 (nonzero? (-> a1-7 value))) (set! *ocean-map* (the-as ocean-map (-> a1-7 value))) - (set! (-> obj ocean-near-translucent?) (-> a0-5 info ocean-near-translucent?)) + (set! (-> this ocean-near-translucent?) (-> a0-5 info ocean-near-translucent?)) ) ) ) @@ -1508,7 +1515,7 @@ ) (label cfg-17) (if *ocean-map* - (mem-copy! (the-as pointer obj) (the-as pointer *ocean-map*) 56) + (mem-copy! (the-as pointer this) (the-as pointer *ocean-map*) 56) ) (let ((v1-9 (new 'stack-no-clear 'vector))) (if (-> *time-of-day-context* use-camera-other) @@ -1518,16 +1525,16 @@ (cond ((< (fabs (-> v1-9 z)) (fabs (-> v1-9 x))) (if (< (-> v1-9 x) 0.0) - (set! (-> obj ocean-facing) (the-as uint 3)) - (set! (-> obj ocean-facing) (the-as uint 2)) + (set! (-> this ocean-facing) (the-as uint 3)) + (set! (-> this ocean-facing) (the-as uint 2)) ) ) ((< (-> v1-9 z) 0.0) - (set! (-> obj ocean-facing) (the-as uint 0)) + (set! (-> this ocean-facing) (the-as uint 0)) 0 ) (else - (set! (-> obj ocean-facing) (the-as uint 1)) + (set! (-> this ocean-facing) (the-as uint 1)) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc index c8575e0bfa..c5cd1b4373 100644 --- a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc @@ -11,17 +11,17 @@ ) ;; definition for method 3 of type billboard -(defmethod inspect billboard ((obj billboard)) - (when (not obj) - (set! obj obj) +(defmethod inspect billboard ((this billboard)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tflat: #~%" (-> obj flat)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tflat: #~%" (-> this flat)) (label cfg-4) - obj + this ) ;; definition of type shrub-view-data @@ -45,26 +45,26 @@ ) ;; definition for method 3 of type shrub-view-data -(defmethod inspect shrub-view-data ((obj shrub-view-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect shrub-view-data ((this shrub-view-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'shrub-view-data) - (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) - (format #t "~1Ttexture-giftag: #~%" (-> obj data)) - (format #t "~1Tconsts: #~%" (&-> obj tex-start-ptr)) - (format #t "~1Tfog-clamp: #~%" (-> obj fog-clamp)) - (format #t "~1Ttex-start-ptr: ~D~%" (-> obj tex-start-ptr)) - (format #t "~1Tgifbufsum: ~f~%" (-> obj gifbufsum)) - (format #t "~1Tmtx-buf-ptr: ~D~%" (-> obj mtx-buf-ptr)) - (format #t "~1Texp23: ~f~%" (-> obj exp23)) - (format #t "~1Tfog-0: ~f~%" (-> obj fog-0)) - (format #t "~1Tfog-1: ~f~%" (-> obj fog-1)) - (format #t "~1Tfog-min: ~f~%" (-> obj fog-clamp x)) - (format #t "~1Tfog-max: ~f~%" (-> obj fog-clamp y)) + (format #t "[~8x] ~A~%" this 'shrub-view-data) + (format #t "~1Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~1Ttexture-giftag: #~%" (-> this data)) + (format #t "~1Tconsts: #~%" (&-> this tex-start-ptr)) + (format #t "~1Tfog-clamp: #~%" (-> this fog-clamp)) + (format #t "~1Ttex-start-ptr: ~D~%" (-> this tex-start-ptr)) + (format #t "~1Tgifbufsum: ~f~%" (-> this gifbufsum)) + (format #t "~1Tmtx-buf-ptr: ~D~%" (-> this mtx-buf-ptr)) + (format #t "~1Texp23: ~f~%" (-> this exp23)) + (format #t "~1Tfog-0: ~f~%" (-> this fog-0)) + (format #t "~1Tfog-1: ~f~%" (-> this fog-1)) + (format #t "~1Tfog-min: ~f~%" (-> this fog-clamp x)) + (format #t "~1Tfog-max: ~f~%" (-> this fog-clamp y)) (label cfg-4) - obj + this ) ;; definition of type shrubbery @@ -86,26 +86,26 @@ ) ;; definition for method 3 of type shrubbery -(defmethod inspect shrubbery ((obj shrubbery)) - (when (not obj) - (set! obj obj) +(defmethod inspect shrubbery ((this shrubbery)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (&-> obj obj)) - (format #t "~1Ttextures: #x~X~%" (-> obj textures)) - (format #t "~1Theader: #~%" (-> obj header)) - (format #t "~1Tobj-qwc: ~D~%" (-> obj obj-qwc)) - (format #t "~1Tvtx-qwc: ~D~%" (-> obj vtx-qwc)) - (format #t "~1Tcol-qwc: ~D~%" (-> obj col-qwc)) - (format #t "~1Tstq-qwc: ~D~%" (-> obj stq-qwc)) - (format #t "~1Tobj: #x~X~%" (-> obj obj)) - (format #t "~1Tvtx: #x~X~%" (-> obj vtx)) - (format #t "~1Tcol: #x~X~%" (-> obj col)) - (format #t "~1Tstq: #x~X~%" (-> obj stq)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (&-> this obj)) + (format #t "~1Ttextures: #x~X~%" (-> this textures)) + (format #t "~1Theader: #~%" (-> this header)) + (format #t "~1Tobj-qwc: ~D~%" (-> this obj-qwc)) + (format #t "~1Tvtx-qwc: ~D~%" (-> this vtx-qwc)) + (format #t "~1Tcol-qwc: ~D~%" (-> this col-qwc)) + (format #t "~1Tstq-qwc: ~D~%" (-> this stq-qwc)) + (format #t "~1Tobj: #x~X~%" (-> this obj)) + (format #t "~1Tvtx: #x~X~%" (-> this vtx)) + (format #t "~1Tcol: #x~X~%" (-> this col)) + (format #t "~1Tstq: #x~X~%" (-> this stq)) (label cfg-4) - obj + this ) ;; definition of type instance-shrubbery @@ -120,23 +120,23 @@ ) ;; definition for method 3 of type instance-shrubbery -(defmethod inspect instance-shrubbery ((obj instance-shrubbery)) - (when (not obj) - (set! obj obj) +(defmethod inspect instance-shrubbery ((this instance-shrubbery)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tbucket-index: ~D~%" (-> obj bucket-index)) - (format #t "~1Torigin: #~%" (-> obj origin)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Twind-index: ~D~%" (-> obj wind-index)) - (format #t "~1Tflat-normal: #~%" (-> obj flat-normal)) - (format #t "~1Tflat-hwidth: ~f~%" (-> obj flat-normal w)) - (format #t "~1Tcolor: ~D~%" (-> obj color)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tbucket-index: ~D~%" (-> this bucket-index)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Twind-index: ~D~%" (-> this wind-index)) + (format #t "~1Tflat-normal: #~%" (-> this flat-normal)) + (format #t "~1Tflat-hwidth: ~f~%" (-> this flat-normal w)) + (format #t "~1Tcolor: ~D~%" (-> this color)) (label cfg-4) - obj + this ) ;; definition of type drawable-inline-array-instance-shrub @@ -178,26 +178,26 @@ ) ;; definition for method 3 of type generic-shrub-fragment -(defmethod inspect generic-shrub-fragment ((obj generic-shrub-fragment)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-shrub-fragment ((this generic-shrub-fragment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Ttextures: #x~X~%" (-> obj textures)) - (format #t "~1Tvtx-cnt: ~D~%" (-> obj vtx-cnt)) - (format #t "~1Tcnt-qwc: ~D~%" (-> obj cnt-qwc)) - (format #t "~1Tvtx-qwc: ~D~%" (-> obj vtx-qwc)) - (format #t "~1Tcol-qwc: ~D~%" (-> obj col-qwc)) - (format #t "~1Tstq-qwc: ~D~%" (-> obj stq-qwc)) - (format #t "~1Tcnt: #x~X~%" (-> obj bsphere x)) - (format #t "~1Tvtx: #x~X~%" (-> obj bsphere y)) - (format #t "~1Tcol: #x~X~%" (-> obj bsphere z)) - (format #t "~1Tstq: #x~X~%" (-> obj bsphere w)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Ttextures: #x~X~%" (-> this textures)) + (format #t "~1Tvtx-cnt: ~D~%" (-> this vtx-cnt)) + (format #t "~1Tcnt-qwc: ~D~%" (-> this cnt-qwc)) + (format #t "~1Tvtx-qwc: ~D~%" (-> this vtx-qwc)) + (format #t "~1Tcol-qwc: ~D~%" (-> this col-qwc)) + (format #t "~1Tstq-qwc: ~D~%" (-> this stq-qwc)) + (format #t "~1Tcnt: #x~X~%" (-> this bsphere x)) + (format #t "~1Tvtx: #x~X~%" (-> this bsphere y)) + (format #t "~1Tcol: #x~X~%" (-> this bsphere z)) + (format #t "~1Tstq: #x~X~%" (-> this bsphere w)) (label cfg-4) - obj + this ) ;; definition of type prototype-shrubbery @@ -237,16 +237,16 @@ ) ;; definition for method 3 of type shrubbery-matrix -(defmethod inspect shrubbery-matrix ((obj shrubbery-matrix)) - (when (not obj) - (set! obj obj) +(defmethod inspect shrubbery-matrix ((this shrubbery-matrix)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'shrubbery-matrix) - (format #t "~1Tmat: #~%" (-> obj mat)) - (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "[~8x] ~A~%" this 'shrubbery-matrix) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Tcolor: #~%" (-> this color)) (label cfg-4) - obj + this ) ;; definition for function shrubbery-login-post-texture @@ -303,22 +303,22 @@ ) ;; definition for method 3 of type shrub-near-packet -(defmethod inspect shrub-near-packet ((obj shrub-near-packet)) - (when (not obj) - (set! obj obj) +(defmethod inspect shrub-near-packet ((this shrub-near-packet)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'shrub-near-packet) - (format #t "~1Tmatrix-tmpl: #~%" (-> obj matrix-tmpl)) - (format #t "~1Theader-tmpl: #~%" (-> obj header-tmpl)) - (format #t "~1Tstq-tmpl: #~%" (-> obj stq-tmpl)) - (format #t "~1Tcolor-tmpl: #~%" (-> obj color-tmpl)) - (format #t "~1Tvertex-tmpl: #~%" (-> obj vertex-tmpl)) - (format #t "~1Tmscal-tmpl: #~%" (-> obj mscal-tmpl)) - (format #t "~1Tinit-tmpl: #~%" (-> obj init-tmpl)) - (format #t "~1Tinit-data[8] @ #x~X~%" (-> obj init-data)) + (format #t "[~8x] ~A~%" this 'shrub-near-packet) + (format #t "~1Tmatrix-tmpl: #~%" (-> this matrix-tmpl)) + (format #t "~1Theader-tmpl: #~%" (-> this header-tmpl)) + (format #t "~1Tstq-tmpl: #~%" (-> this stq-tmpl)) + (format #t "~1Tcolor-tmpl: #~%" (-> this color-tmpl)) + (format #t "~1Tvertex-tmpl: #~%" (-> this vertex-tmpl)) + (format #t "~1Tmscal-tmpl: #~%" (-> this mscal-tmpl)) + (format #t "~1Tinit-tmpl: #~%" (-> this init-tmpl)) + (format #t "~1Tinit-data[8] @ #x~X~%" (-> this init-data)) (label cfg-4) - obj + this ) ;; definition of type instance-shrub-work @@ -397,81 +397,81 @@ ) ;; definition for method 3 of type instance-shrub-work -(defmethod inspect instance-shrub-work ((obj instance-shrub-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect instance-shrub-work ((this instance-shrub-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'instance-shrub-work) - (format #t "~1Tdummy[3] @ #x~X~%" (-> obj dummy)) - (format #t "~1Tchaina[8] @ #x~X~%" (-> obj chaina)) - (format #t "~1Tchainb[8] @ #x~X~%" (-> obj chainb)) - (format #t "~1Tcolors[1024] @ #x~X~%" (-> obj colors)) - (format #t "~1Tmatrix-tmpl[20] @ #x~X~%" (-> obj matrix-tmpl)) - (format #t "~1Tcount-tmpl[20] @ #x~X~%" (-> obj count-tmpl)) - (format #t "~1Tmscalf-tmpl: #~%" (-> obj mscalf-tmpl)) - (format #t "~1Tmscalf-ret-tmpl: #~%" (-> obj mscalf-ret-tmpl)) - (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~1Tbillboard-tmpl: #~%" (-> obj billboard-tmpl)) - (format #t "~1Tbillboard-const: #~%" (-> obj billboard-const)) - (format #t "~1Tshrub-near-packets[6] @ #x~X~%" (-> obj shrub-near-packets)) - (format #t "~1Tdma-ref: #~%" (-> obj dma-ref)) - (format #t "~1Tdma-end: #~%" (-> obj dma-end)) - (format #t "~1Twind-const: #~%" (-> obj wind-const)) - (format #t "~1Tconstants: #~%" (-> obj constants)) - (format #t "~1Tcolor-constant: #~%" (-> obj color-constant)) - (format #t "~1Thmge-d: #~%" (-> obj hmge-d)) - (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~1Twind-force: #~%" (-> obj wind-force)) - (format #t "~1Tcolor: #~%" (-> obj color)) - (format #t "~1Tbb-color: #~%" (-> obj bb-color)) - (format #t "~1Tmin-dist: #~%" (-> obj min-dist)) - (format #t "~1Ttemp-vec: #~%" (-> obj temp-vec)) - (format #t "~1Tguard-plane[4] @ #x~X~%" (-> obj guard-plane)) - (format #t "~1Tplane[4] @ #x~X~%" (-> obj plane)) - (format #t "~1Tlast[4] @ #x~X~%" (-> obj last)) - (format #t "~1Tnext[4] @ #x~X~%" (-> obj next)) - (format #t "~1Tcount[4] @ #x~X~%" (-> obj count)) - (format #t "~1Tmod-count[4] @ #x~X~%" (-> obj mod-count)) - (format #t "~1Twind-vectors: #x~X~%" (-> obj wind-vectors)) - (format #t "~1Tinstance-ptr: ~D~%" (-> obj instance-ptr)) - (format #t "~1Tchain-ptr: ~D~%" (-> obj chain-ptr)) - (format #t "~1Tchain-ptr-next: ~D~%" (-> obj chain-ptr-next)) - (format #t "~1Tstack-ptr: ~D~%" (-> obj stack-ptr)) - (format #t "~1Tbucket-ptr: ~D~%" (-> obj bucket-ptr)) - (format #t "~1Tsrc-ptr: ~D~%" (-> obj src-ptr)) - (format #t "~1Tto-spr: ~D~%" (-> obj to-spr)) - (format #t "~1Tfrom-spr: ~D~%" (-> obj from-spr)) - (format #t "~1Tshrub-count: ~D~%" (-> obj shrub-count)) - (format #t "~1Tstack-ptr: ~D~%" (-> obj stack-ptr)) - (format #t "~1Tnode[6] @ #x~X~%" (-> obj node)) - (format #t "~1Tlength[6] @ #x~X~%" (-> obj length)) - (format #t "~1Tprototypes: ~D~%" (-> obj prototypes)) - (format #t "~1Tbucket-ptr: ~D~%" (-> obj bucket-ptr)) - (format #t "~1Tstart-bank[20] @ #x~X~%" (-> obj start-bank)) - (format #t "~1Tbuffer-index: ~D~%" (-> obj buffer-index)) - (format #t "~1Tcurrent-spr: ~D~%" (-> obj current-spr)) - (format #t "~1Tcurrent-mem: ~D~%" (-> obj current-mem)) - (format #t "~1Tcurrent-shrub-near-packet: ~D~%" (-> obj current-shrub-near-packet)) - (format #t "~1Tcurrent-shrub-near-trans-packet: ~D~%" (-> obj current-shrub-near-trans-packet)) - (format #t "~1Tto-spr: ~D~%" (-> obj to-spr)) - (format #t "~1Tdma-buffer: ~A~%" (-> obj dma-buffer)) - (format #t "~1Tnear-last: ~D~%" (-> obj near-last)) - (format #t "~1Tnear-next: ~D~%" (-> obj near-next)) - (format #t "~1Tnear-count: ~D~%" (-> obj near-count)) - (format #t "~1Tnear-trans-last: ~D~%" (-> obj near-trans-last)) - (format #t "~1Tnear-trans-next: ~D~%" (-> obj near-trans-next)) - (format #t "~1Tnear-trans-count: ~D~%" (-> obj near-trans-count)) - (format #t "~1Tlast-shrubs: ~D~%" (-> obj last-shrubs)) - (format #t "~1Tchains: ~D~%" (-> obj chains)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) - (format #t "~1Tinst-count: ~D~%" (-> obj inst-count)) - (format #t "~1Twait-from-spr: ~D~%" (-> obj wait-from-spr)) - (format #t "~1Twait-to-spr: ~D~%" (-> obj wait-to-spr)) - (format #t "~1Ttexture-dists: #x~X~%" (-> obj texture-dists)) + (format #t "[~8x] ~A~%" this 'instance-shrub-work) + (format #t "~1Tdummy[3] @ #x~X~%" (-> this dummy)) + (format #t "~1Tchaina[8] @ #x~X~%" (-> this chaina)) + (format #t "~1Tchainb[8] @ #x~X~%" (-> this chainb)) + (format #t "~1Tcolors[1024] @ #x~X~%" (-> this colors)) + (format #t "~1Tmatrix-tmpl[20] @ #x~X~%" (-> this matrix-tmpl)) + (format #t "~1Tcount-tmpl[20] @ #x~X~%" (-> this count-tmpl)) + (format #t "~1Tmscalf-tmpl: #~%" (-> this mscalf-tmpl)) + (format #t "~1Tmscalf-ret-tmpl: #~%" (-> this mscalf-ret-tmpl)) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tbillboard-tmpl: #~%" (-> this billboard-tmpl)) + (format #t "~1Tbillboard-const: #~%" (-> this billboard-const)) + (format #t "~1Tshrub-near-packets[6] @ #x~X~%" (-> this shrub-near-packets)) + (format #t "~1Tdma-ref: #~%" (-> this dma-ref)) + (format #t "~1Tdma-end: #~%" (-> this dma-end)) + (format #t "~1Twind-const: #~%" (-> this wind-const)) + (format #t "~1Tconstants: #~%" (-> this constants)) + (format #t "~1Tcolor-constant: #~%" (-> this color-constant)) + (format #t "~1Thmge-d: #~%" (-> this hmge-d)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Twind-force: #~%" (-> this wind-force)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Tbb-color: #~%" (-> this bb-color)) + (format #t "~1Tmin-dist: #~%" (-> this min-dist)) + (format #t "~1Ttemp-vec: #~%" (-> this temp-vec)) + (format #t "~1Tguard-plane[4] @ #x~X~%" (-> this guard-plane)) + (format #t "~1Tplane[4] @ #x~X~%" (-> this plane)) + (format #t "~1Tlast[4] @ #x~X~%" (-> this last)) + (format #t "~1Tnext[4] @ #x~X~%" (-> this next)) + (format #t "~1Tcount[4] @ #x~X~%" (-> this count)) + (format #t "~1Tmod-count[4] @ #x~X~%" (-> this mod-count)) + (format #t "~1Twind-vectors: #x~X~%" (-> this wind-vectors)) + (format #t "~1Tinstance-ptr: ~D~%" (-> this instance-ptr)) + (format #t "~1Tchain-ptr: ~D~%" (-> this chain-ptr)) + (format #t "~1Tchain-ptr-next: ~D~%" (-> this chain-ptr-next)) + (format #t "~1Tstack-ptr: ~D~%" (-> this stack-ptr)) + (format #t "~1Tbucket-ptr: ~D~%" (-> this bucket-ptr)) + (format #t "~1Tsrc-ptr: ~D~%" (-> this src-ptr)) + (format #t "~1Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~1Tfrom-spr: ~D~%" (-> this from-spr)) + (format #t "~1Tshrub-count: ~D~%" (-> this shrub-count)) + (format #t "~1Tstack-ptr: ~D~%" (-> this stack-ptr)) + (format #t "~1Tnode[6] @ #x~X~%" (-> this node)) + (format #t "~1Tlength[6] @ #x~X~%" (-> this length)) + (format #t "~1Tprototypes: ~D~%" (-> this prototypes)) + (format #t "~1Tbucket-ptr: ~D~%" (-> this bucket-ptr)) + (format #t "~1Tstart-bank[20] @ #x~X~%" (-> this start-bank)) + (format #t "~1Tbuffer-index: ~D~%" (-> this buffer-index)) + (format #t "~1Tcurrent-spr: ~D~%" (-> this current-spr)) + (format #t "~1Tcurrent-mem: ~D~%" (-> this current-mem)) + (format #t "~1Tcurrent-shrub-near-packet: ~D~%" (-> this current-shrub-near-packet)) + (format #t "~1Tcurrent-shrub-near-trans-packet: ~D~%" (-> this current-shrub-near-trans-packet)) + (format #t "~1Tto-spr: ~D~%" (-> this to-spr)) + (format #t "~1Tdma-buffer: ~A~%" (-> this dma-buffer)) + (format #t "~1Tnear-last: ~D~%" (-> this near-last)) + (format #t "~1Tnear-next: ~D~%" (-> this near-next)) + (format #t "~1Tnear-count: ~D~%" (-> this near-count)) + (format #t "~1Tnear-trans-last: ~D~%" (-> this near-trans-last)) + (format #t "~1Tnear-trans-next: ~D~%" (-> this near-trans-next)) + (format #t "~1Tnear-trans-count: ~D~%" (-> this near-trans-count)) + (format #t "~1Tlast-shrubs: ~D~%" (-> this last-shrubs)) + (format #t "~1Tchains: ~D~%" (-> this chains)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tinst-count: ~D~%" (-> this inst-count)) + (format #t "~1Twait-from-spr: ~D~%" (-> this wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> this wait-to-spr)) + (format #t "~1Ttexture-dists: #x~X~%" (-> this texture-dists)) (label cfg-4) - obj + this ) ;; definition of type instance-shrub-dma @@ -487,18 +487,18 @@ ) ;; definition for method 3 of type instance-shrub-dma -(defmethod inspect instance-shrub-dma ((obj instance-shrub-dma)) - (when (not obj) - (set! obj obj) +(defmethod inspect instance-shrub-dma ((this instance-shrub-dma)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'instance-shrub-dma) - (format #t "~1Tinstancea[325] @ #x~X~%" (-> obj instancea)) - (format #t "~1Tinstanceb[325] @ #x~X~%" (-> obj instanceb)) - (format #t "~1Touta[128] @ #x~X~%" (-> obj outa)) - (format #t "~1Toutb[128] @ #x~X~%" (-> obj outb)) + (format #t "[~8x] ~A~%" this 'instance-shrub-dma) + (format #t "~1Tinstancea[325] @ #x~X~%" (-> this instancea)) + (format #t "~1Tinstanceb[325] @ #x~X~%" (-> this instanceb)) + (format #t "~1Touta[128] @ #x~X~%" (-> this outa)) + (format #t "~1Toutb[128] @ #x~X~%" (-> this outb)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc index 96c569f5a1..3932561d76 100644 --- a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc @@ -2,21 +2,21 @@ (in-package goal) ;; definition for method 9 of type billboard -(defmethod login billboard ((obj billboard)) - (adgif-shader-login (-> obj flat)) - obj +(defmethod login billboard ((this billboard)) + (adgif-shader-login (-> this flat)) + this ) ;; definition for method 8 of type billboard -(defmethod mem-usage billboard ((obj billboard) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage billboard ((this billboard) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 34 (-> arg0 length))) (set! (-> arg0 data 33 name) "billboard") (+! (-> arg0 data 33 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 33 used) v1-6) (+! (-> arg0 data 33 total) (logand -16 (+ v1-6 15))) ) - obj + this ) ;; definition for function mem-usage-shrub-walk @@ -53,7 +53,7 @@ ) ;; definition for method 8 of type drawable-tree-instance-shrub -(defmethod mem-usage drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -61,66 +61,66 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (when (nonzero? (-> obj colors-added)) + (when (nonzero? (-> this colors-added)) (set! (-> arg0 length) (max 33 (-> arg0 length))) (set! (-> arg0 data 32 name) "shrubbery-pal") (+! (-> arg0 data 32 count) 1) - (let ((v1-19 (asize-of (-> obj colors-added)))) + (let ((v1-19 (asize-of (-> this colors-added)))) (+! (-> arg0 data 32 used) v1-19) (+! (-> arg0 data 32 total) (logand -16 (+ v1-19 15))) ) ) (mem-usage-shrub-walk - (the-as draw-node (&+ (-> obj data 0) 32)) - (-> (the-as drawable-group (-> obj data 0)) length) + (the-as draw-node (&+ (-> this data 0) 32)) + (-> (the-as drawable-group (-> this data 0)) length) arg0 arg1 ) - (mem-usage (-> obj info prototype-inline-array-shrub) arg0 (logior arg1 1)) - obj + (mem-usage (-> this info prototype-inline-array-shrub) arg0 (logior arg1 1)) + this ) ;; definition for method 9 of type generic-shrub-fragment -(defmethod login generic-shrub-fragment ((obj generic-shrub-fragment)) - (let ((s5-0 (/ (-> obj cnt-qwc) (the-as uint 5)))) +(defmethod login generic-shrub-fragment ((this generic-shrub-fragment)) + (let ((s5-0 (/ (-> this cnt-qwc) (the-as uint 5)))) (dotimes (s4-0 (the-as int s5-0)) - (adgif-shader-login-no-remap (-> obj textures s4-0)) + (adgif-shader-login-no-remap (-> this textures s4-0)) ) ) - obj + this ) ;; definition for method 8 of type generic-shrub-fragment -(defmethod mem-usage generic-shrub-fragment ((obj generic-shrub-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage generic-shrub-fragment ((this generic-shrub-fragment) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 27 (-> arg0 length))) (set! (-> arg0 data 25 name) "generic-shrub") (+! (-> arg0 data 25 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 25 used) v1-6) (+! (-> arg0 data 25 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 data 26 name) "generic-shrub-data") (+! (-> arg0 data 26 count) 1) - (let ((v1-17 (* (+ (-> obj cnt-qwc) (-> obj vtx-qwc) (-> obj col-qwc) (-> obj stq-qwc)) 16))) + (let ((v1-17 (* (+ (-> this cnt-qwc) (-> this vtx-qwc) (-> this col-qwc) (-> this stq-qwc)) 16))) (+! (-> arg0 data 26 used) v1-17) (+! (-> arg0 data 26 total) (logand -16 (+ v1-17 15))) ) - obj + this ) ;; definition for method 3 of type prototype-shrubbery -(defmethod inspect prototype-shrubbery ((obj prototype-shrubbery)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-0 (-> obj data s5-0)) +(defmethod inspect prototype-shrubbery ((this prototype-shrubbery)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0)) ) - obj + this ) ;; definition for method 8 of type prototype-shrubbery -(defmethod mem-usage prototype-shrubbery ((obj prototype-shrubbery) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage prototype-shrubbery ((this prototype-shrubbery) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -128,39 +128,39 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) - obj + this ) ;; definition for method 9 of type prototype-shrubbery -(defmethod login prototype-shrubbery ((obj prototype-shrubbery)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login prototype-shrubbery ((this prototype-shrubbery)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) ;; definition for method 5 of type prototype-shrubbery ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of prototype-shrubbery ((obj prototype-shrubbery)) - (the-as int (+ (-> prototype-shrubbery size) (* (+ (-> obj length) -1) 32))) +(defmethod asize-of prototype-shrubbery ((this prototype-shrubbery)) + (the-as int (+ (-> prototype-shrubbery size) (* (+ (-> this length) -1) 32))) ) ;; definition for method 9 of type prototype-generic-shrub -(defmethod login prototype-generic-shrub ((obj prototype-generic-shrub)) - (dotimes (s5-0 (-> obj length)) - (login (-> obj data s5-0)) +(defmethod login prototype-generic-shrub ((this prototype-generic-shrub)) + (dotimes (s5-0 (-> this length)) + (login (-> this data s5-0)) ) - obj + this ) ;; definition for method 9 of type shrubbery -(defmethod login shrubbery ((obj shrubbery)) - (let ((s5-0 (* (-> obj header data 0) 2))) +(defmethod login shrubbery ((this shrubbery)) + (let ((s5-0 (* (-> this header data 0) 2))) (dotimes (s4-0 (the-as int s5-0)) - (let ((v1-3 (adgif-shader-login-no-remap (-> obj textures s4-0)))) + (let ((v1-3 (adgif-shader-login-no-remap (-> this textures s4-0)))) (when v1-3 (dotimes (a0-5 3) (dotimes (a1-0 3) @@ -178,56 +178,56 @@ ) ) ) - (shrubbery-login-post-texture obj) - obj + (shrubbery-login-post-texture this) + this ) ;; definition for method 8 of type shrubbery -(defmethod mem-usage shrubbery ((obj shrubbery) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage shrubbery ((this shrubbery) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 28 (-> arg0 length))) (set! (-> arg0 data 27 name) "shrubbery") (+! (-> arg0 data 27 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 27 used) v1-6) (+! (-> arg0 data 27 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 30 (-> arg0 length))) (set! (-> arg0 data 29 name) "shrubbery-vertex") (+! (-> arg0 data 29 count) 1) - (let ((v1-16 (* (-> obj vtx-qwc) 16))) + (let ((v1-16 (* (-> this vtx-qwc) 16))) (+! (-> arg0 data 29 used) v1-16) (+! (-> arg0 data 29 total) (logand -16 (+ v1-16 15))) ) (set! (-> arg0 length) (max 31 (-> arg0 length))) (set! (-> arg0 data 30 name) "shrubbery-color") (+! (-> arg0 data 30 count) 1) - (let ((v1-26 (* (-> obj col-qwc) 16))) + (let ((v1-26 (* (-> this col-qwc) 16))) (+! (-> arg0 data 30 used) v1-26) (+! (-> arg0 data 30 total) (logand -16 (+ v1-26 15))) ) (set! (-> arg0 length) (max 29 (-> arg0 length))) (set! (-> arg0 data 28 name) "shrubbery-object") (+! (-> arg0 data 28 count) 1) - (let ((v1-36 (* (-> obj obj-qwc) 16))) + (let ((v1-36 (* (-> this obj-qwc) 16))) (+! (-> arg0 data 28 used) v1-36) (+! (-> arg0 data 28 total) (logand -16 (+ v1-36 15))) ) (set! (-> arg0 length) (max 32 (-> arg0 length))) (set! (-> arg0 data 31 name) "shrubbery-stq") (+! (-> arg0 data 31 count) 1) - (let ((v1-46 (* (-> obj stq-qwc) 16))) + (let ((v1-46 (* (-> this stq-qwc) 16))) (+! (-> arg0 data 31 used) v1-46) (+! (-> arg0 data 31 total) (logand -16 (+ v1-46 15))) ) - obj + this ) ;; definition for method 9 of type drawable-tree-instance-shrub -(defmethod login drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub)) - (if (nonzero? (-> obj info prototype-inline-array-shrub)) - (login (-> obj info prototype-inline-array-shrub)) +(defmethod login drawable-tree-instance-shrub ((this drawable-tree-instance-shrub)) + (if (nonzero? (-> this info prototype-inline-array-shrub)) + (login (-> this info prototype-inline-array-shrub)) ) - obj + this ) ;; definition for symbol shrub-vu1-block, type vu-function @@ -1070,11 +1070,11 @@ ;; definition for method 10 of type drawable-tree-instance-shrub ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 drawable-tree-instance-shrub) (arg1 display-frame)) +(defmethod draw drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 drawable-tree-instance-shrub) (arg1 display-frame)) (let ((v1-1 (-> *background-work* shrub-tree-count)) (a1-4 (-> *level* draw-level *draw-index*)) ) - (set! (-> *background-work* shrub-trees v1-1) obj) + (set! (-> *background-work* shrub-trees v1-1) this) (set! (-> *background-work* shrub-levels v1-1) a1-4) ) (+! (-> *background-work* shrub-tree-count) 1) @@ -1083,15 +1083,15 @@ ) ;; definition for method 15 of type drawable-tree-instance-shrub -(defmethod unpack-vis drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree-instance-shrub ((this drawable-tree-instance-shrub) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) ;; definition for method 13 of type drawable-tree-instance-shrub ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats drawable-tree-instance-shrub ((obj drawable-tree-instance-shrub)) +(defmethod collect-stats drawable-tree-instance-shrub ((this drawable-tree-instance-shrub)) (when (logtest? (vu1-renderer-mask shrubbery shrub-near billboard shrubbery-vanish) (-> *display* vu1-enable-user)) - (let* ((v1-4 (-> obj info prototype-inline-array-shrub)) + (let* ((v1-4 (-> this info prototype-inline-array-shrub)) (gp-0 (the-as object (-> v1-4 data))) ) (countdown (s5-0 (-> v1-4 length)) @@ -1186,15 +1186,15 @@ ) ;; definition for method 3 of type dma-test -(defmethod inspect dma-test ((obj dma-test)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-test ((this dma-test)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-test) - (format #t "~1Tdata[101] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'dma-test) + (format #t "~1Tdata[101] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for symbol *dma-test*, type dma-test @@ -1211,16 +1211,16 @@ ) ;; definition for method 3 of type dma-test-work -(defmethod inspect dma-test-work ((obj dma-test-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-test-work ((this dma-test-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dma-test-work) - (format #t "~1Tupload: #~%" (-> obj upload)) - (format #t "~1Tend: #~%" (-> obj end)) + (format #t "[~8x] ~A~%" this 'dma-test-work) + (format #t "~1Tupload: #~%" (-> this upload)) + (format #t "~1Tend: #~%" (-> this end)) (label cfg-4) - obj + this ) ;; definition for symbol *dma-test-work*, type dma-test-work diff --git a/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc index e3c2ab1fe6..ca50394246 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sky/sky-data_REF.gc @@ -1119,12 +1119,12 @@ ;; definition for method 9 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod init-sun-data! sky-work ((obj sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) +(defmethod init-sun-data! sky-work ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float)) "Sets the sun related upload data - the sun, halo and aurora" (let ((v1-0 (logand arg0 1))) - (set! (-> obj upload-data sun v1-0 r-sun) arg1) - (set! (-> obj upload-data sun v1-0 r-halo) arg2) - (set! (-> obj upload-data sun v1-0 r-aurora) arg3) + (set! (-> this upload-data sun v1-0 r-sun) arg1) + (set! (-> this upload-data sun v1-0 r-halo) arg2) + (set! (-> this upload-data sun v1-0 r-aurora) arg3) ) 0 (none) @@ -1132,13 +1132,13 @@ ;; definition for method 10 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod init-orbit-settings! sky-work ((obj sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) - (set! (-> obj orbit arg0 high-noon) arg1) - (set! (-> obj orbit arg0 tilt) (* 0.017453292 arg2)) - (set! (-> obj orbit arg0 rise) (* 0.017453292 arg3)) - (set! (-> obj orbit arg0 dist) arg4) - (set! (-> obj orbit arg0 min-halo) arg5) - (set! (-> obj orbit arg0 max-halo) arg6) +(defmethod init-orbit-settings! sky-work ((this sky-work) (arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) + (set! (-> this orbit arg0 high-noon) arg1) + (set! (-> this orbit arg0 tilt) (* 0.017453292 arg2)) + (set! (-> this orbit arg0 rise) (* 0.017453292 arg3)) + (set! (-> this orbit arg0 dist) arg4) + (set! (-> this orbit arg0 min-halo) arg5) + (set! (-> this orbit arg0 max-halo) arg6) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc index ab1036ae51..0ad27c3a72 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type sky-color-hour -(defmethod inspect sky-color-hour ((obj sky-color-hour)) - (when (not obj) - (set! obj obj) +(defmethod inspect sky-color-hour ((this sky-color-hour)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sky-color-hour) - (format #t "~1Tsnapshot1: ~D~%" (-> obj snapshot1)) - (format #t "~1Tsnapshot2: ~D~%" (-> obj snapshot2)) - (format #t "~1Tmorph-start: ~f~%" (-> obj morph-start)) - (format #t "~1Tmorph-end: ~f~%" (-> obj morph-end)) + (format #t "[~8x] ~A~%" this 'sky-color-hour) + (format #t "~1Tsnapshot1: ~D~%" (-> this snapshot1)) + (format #t "~1Tsnapshot2: ~D~%" (-> this snapshot2)) + (format #t "~1Tmorph-start: ~f~%" (-> this morph-start)) + (format #t "~1Tmorph-end: ~f~%" (-> this morph-end)) (label cfg-4) - obj + this ) ;; definition of type sky-color-day @@ -38,15 +38,15 @@ ) ;; definition for method 3 of type sky-color-day -(defmethod inspect sky-color-day ((obj sky-color-day)) - (when (not obj) - (set! obj obj) +(defmethod inspect sky-color-day ((this sky-color-day)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sky-color-day) - (format #t "~1Thour[24] @ #x~X~%" (-> obj hour)) + (format #t "[~8x] ~A~%" this 'sky-color-day) + (format #t "~1Thour[24] @ #x~X~%" (-> this hour)) (label cfg-4) - obj + this ) ;; definition of type sky-sun-data @@ -69,25 +69,25 @@ ) ;; definition for method 3 of type sky-sun-data -(defmethod inspect sky-sun-data ((obj sky-sun-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect sky-sun-data ((this sky-sun-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sky-sun-data) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj pos)) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tr-sun: ~f~%" (-> obj r-sun)) - (format #t "~1Tr-halo: ~f~%" (-> obj r-halo)) - (format #t "~1Tr-aurora: ~f~%" (-> obj r-aurora)) - (format #t "~1Tc-sun-start: ~D~%" (-> obj c-sun-start)) - (format #t "~1Tc-sun-end: ~D~%" (-> obj c-sun-end)) - (format #t "~1Tc-halo-start: ~D~%" (-> obj c-halo-start)) - (format #t "~1Tc-halo-end: ~D~%" (-> obj c-halo-end)) - (format #t "~1Tc-aurora-start: ~D~%" (-> obj c-aurora-start)) - (format #t "~1Tc-aurora-end: ~D~%" (-> obj c-aurora-end)) + (format #t "[~8x] ~A~%" this 'sky-sun-data) + (format #t "~1Tdata[4] @ #x~X~%" (-> this pos)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tr-sun: ~f~%" (-> this r-sun)) + (format #t "~1Tr-halo: ~f~%" (-> this r-halo)) + (format #t "~1Tr-aurora: ~f~%" (-> this r-aurora)) + (format #t "~1Tc-sun-start: ~D~%" (-> this c-sun-start)) + (format #t "~1Tc-sun-end: ~D~%" (-> this c-sun-end)) + (format #t "~1Tc-halo-start: ~D~%" (-> this c-halo-start)) + (format #t "~1Tc-halo-end: ~D~%" (-> this c-halo-end)) + (format #t "~1Tc-aurora-start: ~D~%" (-> this c-aurora-start)) + (format #t "~1Tc-aurora-end: ~D~%" (-> this c-aurora-end)) (label cfg-4) - obj + this ) ;; definition of type sky-moon-data @@ -102,17 +102,17 @@ ) ;; definition for method 3 of type sky-moon-data -(defmethod inspect sky-moon-data ((obj sky-moon-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect sky-moon-data ((this sky-moon-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sky-moon-data) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tpos: #~%" (-> obj data)) - (format #t "~1Tscale: #~%" (-> obj scale)) + (format #t "[~8x] ~A~%" this 'sky-moon-data) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~1Tpos: #~%" (-> this data)) + (format #t "~1Tscale: #~%" (-> this scale)) (label cfg-4) - obj + this ) ;; definition of type sky-orbit @@ -131,20 +131,20 @@ ) ;; definition for method 3 of type sky-orbit -(defmethod inspect sky-orbit ((obj sky-orbit)) - (when (not obj) - (set! obj obj) +(defmethod inspect sky-orbit ((this sky-orbit)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sky-orbit) - (format #t "~1Thigh-noon: ~f~%" (-> obj high-noon)) - (format #t "~1Ttilt: ~f~%" (-> obj tilt)) - (format #t "~1Trise: ~f~%" (-> obj rise)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) - (format #t "~1Tmin-halo: ~f~%" (-> obj min-halo)) - (format #t "~1Tmax-halo: ~f~%" (-> obj max-halo)) + (format #t "[~8x] ~A~%" this 'sky-orbit) + (format #t "~1Thigh-noon: ~f~%" (-> this high-noon)) + (format #t "~1Ttilt: ~f~%" (-> this tilt)) + (format #t "~1Trise: ~f~%" (-> this rise)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tmin-halo: ~f~%" (-> this min-halo)) + (format #t "~1Tmax-halo: ~f~%" (-> this max-halo)) (label cfg-4) - obj + this ) ;; definition of type sky-upload-data @@ -159,17 +159,17 @@ ) ;; definition for method 3 of type sky-upload-data -(defmethod inspect sky-upload-data ((obj sky-upload-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect sky-upload-data ((this sky-upload-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sky-upload-data) - (format #t "~1Tdata[10] @ #x~X~%" (-> obj sun)) - (format #t "~1Tsun[2] @ #x~X~%" (-> obj sun)) - (format #t "~1Tmoon: #~%" (-> obj moon)) + (format #t "[~8x] ~A~%" this 'sky-upload-data) + (format #t "~1Tdata[10] @ #x~X~%" (-> this sun)) + (format #t "~1Tsun[2] @ #x~X~%" (-> this sun)) + (format #t "~1Tmoon: #~%" (-> this moon)) (label cfg-4) - obj + this ) ;; definition of type sky-vertex @@ -185,27 +185,27 @@ ;; definition for method 3 of type sky-vertex ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sky-vertex ((obj sky-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect sky-vertex ((this sky-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sky-vertex) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tstq: #~%" (-> obj stq)) - (format #t "~1Tcol: #~%" (-> obj col)) + (format #t "[~8x] ~A~%" this 'sky-vertex) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tstq: #~%" (-> this stq)) + (format #t "~1Tcol: #~%" (-> this col)) (label cfg-4) - obj + this ) ;; definition for method 3 of type sky-vertex ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sky-vertex ((obj sky-vertex)) - (format #t "sky-vertex [~X]:~%" obj) - (format #t "~TPos: [~F ~F ~F ~F]~%" (-> obj pos x) (-> obj pos y) (-> obj pos z) (-> obj pos w)) - (format #t "~TSTQ: [~F ~F ~F ~F]~%" (-> obj stq x) (-> obj stq y) (-> obj stq z) (-> obj stq w)) - (format #t "~TCol: [~F ~F ~F ~F]~%" (-> obj col x) (-> obj col y) (-> obj col z) (-> obj col w)) - obj +(defmethod inspect sky-vertex ((this sky-vertex)) + (format #t "sky-vertex [~X]:~%" this) + (format #t "~TPos: [~F ~F ~F ~F]~%" (-> this pos x) (-> this pos y) (-> this pos z) (-> this pos w)) + (format #t "~TSTQ: [~F ~F ~F ~F]~%" (-> this stq x) (-> this stq y) (-> this stq z) (-> this stq w)) + (format #t "~TCol: [~F ~F ~F ~F]~%" (-> this col x) (-> this col y) (-> this col z) (-> this col w)) + this ) ;; definition of type cloud-vertex @@ -224,21 +224,21 @@ ) ;; definition for method 3 of type cloud-vertex -(defmethod inspect cloud-vertex ((obj cloud-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect cloud-vertex ((this cloud-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cloud-vertex) - (format #t "~1Tpos: ~`vector`P~%" (-> obj pos)) - (format #t "~1Tstq: ~`vector`P~%" (-> obj stq)) - (format #t "~1Tcol: ~`vector`P~%" (-> obj col)) - (format #t "~1Tnrm: ~`vector`P~%" (-> obj nrm)) - (format #t "~1Tstq2: ~`vector`P~%" (-> obj stq2)) - (format #t "~1Tcol2: ~`vector`P~%" (-> obj col2)) - (format #t "~1Tnrm2: ~`vector`P~%" (-> obj nrm2)) + (format #t "[~8x] ~A~%" this 'cloud-vertex) + (format #t "~1Tpos: ~`vector`P~%" (-> this pos)) + (format #t "~1Tstq: ~`vector`P~%" (-> this stq)) + (format #t "~1Tcol: ~`vector`P~%" (-> this col)) + (format #t "~1Tnrm: ~`vector`P~%" (-> this nrm)) + (format #t "~1Tstq2: ~`vector`P~%" (-> this stq2)) + (format #t "~1Tcol2: ~`vector`P~%" (-> this col2)) + (format #t "~1Tnrm2: ~`vector`P~%" (-> this nrm2)) (label cfg-4) - obj + this ) ;; definition of type cloud-vert-array @@ -251,15 +251,15 @@ ) ;; definition for method 3 of type cloud-vert-array -(defmethod inspect cloud-vert-array ((obj cloud-vert-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect cloud-vert-array ((this cloud-vert-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cloud-vert-array) - (format #t "~1Tdata[100] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'cloud-vert-array) + (format #t "~1Tdata[100] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type haze-vertex @@ -274,17 +274,17 @@ ) ;; definition for method 3 of type haze-vertex -(defmethod inspect haze-vertex ((obj haze-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect haze-vertex ((this haze-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'haze-vertex) - (format #t "~1Tpos: ~`vector`P~%" (-> obj pos)) - (format #t "~1Tnrm: ~`vector`P~%" (-> obj nrm)) - (format #t "~1Tcol: ~`vector`P~%" (-> obj col)) + (format #t "[~8x] ~A~%" this 'haze-vertex) + (format #t "~1Tpos: ~`vector`P~%" (-> this pos)) + (format #t "~1Tnrm: ~`vector`P~%" (-> this nrm)) + (format #t "~1Tcol: ~`vector`P~%" (-> this col)) (label cfg-4) - obj + this ) ;; definition of type haze-vert-array @@ -297,15 +297,15 @@ ) ;; definition for method 3 of type haze-vert-array -(defmethod inspect haze-vert-array ((obj haze-vert-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect haze-vert-array ((this haze-vert-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'haze-vert-array) - (format #t "~1Tdata[36] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'haze-vert-array) + (format #t "~1Tdata[36] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type cloud-lights @@ -329,26 +329,26 @@ ) ;; definition for method 3 of type cloud-lights -(defmethod inspect cloud-lights ((obj cloud-lights)) - (when (not obj) - (set! obj obj) +(defmethod inspect cloud-lights ((this cloud-lights)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cloud-lights) - (format #t "~1Tsun0-normal: #~%" (-> obj sun0-normal)) - (format #t "~1Tsun1-normal: #~%" (-> obj sun1-normal)) - (format #t "~1Tmoon-normal: #~%" (-> obj moon-normal)) - (format #t "~1Tambi-color: #~%" (-> obj ambi-color)) - (format #t "~1Tambi-color-lower: #~%" (-> obj ambi-color-lower)) - (format #t "~1Tsun0-color: #~%" (-> obj sun0-color)) - (format #t "~1Tsun1-color: #~%" (-> obj sun1-color)) - (format #t "~1Tmoon-color: #~%" (-> obj moon-color)) - (format #t "~1Tsun0-color-lower: #~%" (-> obj sun0-color-lower)) - (format #t "~1Tsun0-scale: ~f~%" (-> obj sun0-scale)) - (format #t "~1Tsun1-scale: ~f~%" (-> obj sun1-scale)) - (format #t "~1Tmoon-scale: ~f~%" (-> obj moon-scale)) + (format #t "[~8x] ~A~%" this 'cloud-lights) + (format #t "~1Tsun0-normal: #~%" (-> this sun0-normal)) + (format #t "~1Tsun1-normal: #~%" (-> this sun1-normal)) + (format #t "~1Tmoon-normal: #~%" (-> this moon-normal)) + (format #t "~1Tambi-color: #~%" (-> this ambi-color)) + (format #t "~1Tambi-color-lower: #~%" (-> this ambi-color-lower)) + (format #t "~1Tsun0-color: #~%" (-> this sun0-color)) + (format #t "~1Tsun1-color: #~%" (-> this sun1-color)) + (format #t "~1Tmoon-color: #~%" (-> this moon-color)) + (format #t "~1Tsun0-color-lower: #~%" (-> this sun0-color-lower)) + (format #t "~1Tsun0-scale: ~f~%" (-> this sun0-scale)) + (format #t "~1Tsun1-scale: ~f~%" (-> this sun1-scale)) + (format #t "~1Tmoon-scale: ~f~%" (-> this moon-scale)) (label cfg-4) - obj + this ) ;; definition of type haze-lights @@ -370,24 +370,24 @@ ) ;; definition for method 3 of type haze-lights -(defmethod inspect haze-lights ((obj haze-lights)) - (when (not obj) - (set! obj obj) +(defmethod inspect haze-lights ((this haze-lights)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'haze-lights) - (format #t "~1Tsun0-normal: #~%" (-> obj sun0-normal)) - (format #t "~1Tsun1-normal: #~%" (-> obj sun1-normal)) - (format #t "~1Tmoon-normal: #~%" (-> obj moon-normal)) - (format #t "~1Tambi-color: #~%" (-> obj ambi-color)) - (format #t "~1Tsun0-color: #~%" (-> obj sun0-color)) - (format #t "~1Tsun1-color: #~%" (-> obj sun1-color)) - (format #t "~1Tmoon-color: #~%" (-> obj moon-color)) - (format #t "~1Tsun0-scale: ~f~%" (-> obj sun0-scale)) - (format #t "~1Tsun1-scale: ~f~%" (-> obj sun1-scale)) - (format #t "~1Tmoon-scale: ~f~%" (-> obj moon-scale)) + (format #t "[~8x] ~A~%" this 'haze-lights) + (format #t "~1Tsun0-normal: #~%" (-> this sun0-normal)) + (format #t "~1Tsun1-normal: #~%" (-> this sun1-normal)) + (format #t "~1Tmoon-normal: #~%" (-> this moon-normal)) + (format #t "~1Tambi-color: #~%" (-> this ambi-color)) + (format #t "~1Tsun0-color: #~%" (-> this sun0-color)) + (format #t "~1Tsun1-color: #~%" (-> this sun1-color)) + (format #t "~1Tmoon-color: #~%" (-> this moon-color)) + (format #t "~1Tsun0-scale: ~f~%" (-> this sun0-scale)) + (format #t "~1Tsun1-scale: ~f~%" (-> this sun1-scale)) + (format #t "~1Tmoon-scale: ~f~%" (-> this moon-scale)) (label cfg-4) - obj + this ) ;; definition of type sky-work @@ -474,59 +474,59 @@ ) ;; definition for method 3 of type sky-work -(defmethod inspect sky-work ((obj sky-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect sky-work ((this sky-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sky-work) - (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~1Tdraw-tmpl: #~%" (-> obj draw-tmpl)) - (format #t "~1Tdraw-tmpl2: #~%" (-> obj draw-tmpl2)) - (format #t "~1Tfog-tmpl: #~%" (-> obj fog-tmpl)) - (format #t "~1Tblend-tmpl: #~%" (-> obj blend-tmpl)) - (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) - (format #t "~1Tsprite-tmpl2: #~%" (-> obj sprite-tmpl2)) - (format #t "~1Tsun-coords[2] @ #x~X~%" (-> obj sun-coords)) - (format #t "~1Tgreen-coords[2] @ #x~X~%" (-> obj green-coords)) - (format #t "~1Tmoon0-coords[2] @ #x~X~%" (-> obj moon0-coords)) - (format #t "~1Tmoon1-coords[2] @ #x~X~%" (-> obj moon1-coords)) - (format #t "~1Tmoon2-coords[2] @ #x~X~%" (-> obj moon2-coords)) - (format #t "~1Tstar-coords[2] @ #x~X~%" (-> obj star-coords)) - (format #t "~1Tsun-colors[2] @ #x~X~%" (-> obj sun-colors)) - (format #t "~1Tgreen-colors[2] @ #x~X~%" (-> obj green-colors)) - (format #t "~1Tmoon-colors[3] @ #x~X~%" (-> obj moon-colors)) - (format #t "~1Tstar-colors[16] @ #x~X~%" (-> obj star-colors)) - (format #t "~1Tst-coords[2] @ #x~X~%" (-> obj st-coords)) - (format #t "~1Trandom[8] @ #x~X~%" (-> obj random)) - (format #t "~1Tgiftag-base: #~%" (-> obj giftag-base)) - (format #t "~1Tgiftag-haze: #~%" (-> obj giftag-haze)) - (format #t "~1Tgiftag-roof: #~%" (-> obj giftag-roof)) - (format #t "~1Tgiftag-ocean: #~%" (-> obj giftag-ocean)) - (format #t "~1Tfog: #~%" (-> obj fog)) - (format #t "~1Tsky[8] @ #x~X~%" (-> obj sky)) - (format #t "~1Ttime: ~f~%" (-> obj time)) - (format #t "~1Toff-s: ~D~%" (-> obj off-s)) - (format #t "~1Toff-t: ~D~%" (-> obj off-t)) - (format #t "~1Torbit[3] @ #x~X~%" (-> obj orbit)) - (format #t "~1Tupload-data: #~%" (-> obj upload-data)) - (format #t "~1Tambi-color: #~%" (-> obj ambi-color)) - (format #t "~1Tambi-color-lower: #~%" (-> obj ambi-color-lower)) - (format #t "~1Tsun0-color: #~%" (-> obj sun0-color)) - (format #t "~1Tsun1-color: #~%" (-> obj sun1-color)) - (format #t "~1Tmoon-color: #~%" (-> obj moon-color)) - (format #t "~1Tsun0-color-lower: #~%" (-> obj sun0-color-lower)) - (format #t "~1Tcam-mat: #~%" (-> obj cam-mat)) - (format #t "~1Tstar-mat: #~%" (-> obj star-mat)) - (format #t "~1Tvec0: #~%" (-> obj vec0)) - (format #t "~1Tvec1: #~%" (-> obj vec1)) - (format #t "~1Tcloud-lights: #~%" (-> obj cloud-lights)) - (format #t "~1Thaze-lights: #~%" (-> obj haze-lights)) - (format #t "~1Tbuf: ~A~%" (-> obj buf)) - (format #t "~1Tdraw-vortex: ~A~%" (-> obj draw-vortex)) - (format #t "~1Tstars[512] @ #x~X~%" (-> obj stars)) + (format #t "[~8x] ~A~%" this 'sky-work) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tdraw-tmpl: #~%" (-> this draw-tmpl)) + (format #t "~1Tdraw-tmpl2: #~%" (-> this draw-tmpl2)) + (format #t "~1Tfog-tmpl: #~%" (-> this fog-tmpl)) + (format #t "~1Tblend-tmpl: #~%" (-> this blend-tmpl)) + (format #t "~1Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~1Tsprite-tmpl2: #~%" (-> this sprite-tmpl2)) + (format #t "~1Tsun-coords[2] @ #x~X~%" (-> this sun-coords)) + (format #t "~1Tgreen-coords[2] @ #x~X~%" (-> this green-coords)) + (format #t "~1Tmoon0-coords[2] @ #x~X~%" (-> this moon0-coords)) + (format #t "~1Tmoon1-coords[2] @ #x~X~%" (-> this moon1-coords)) + (format #t "~1Tmoon2-coords[2] @ #x~X~%" (-> this moon2-coords)) + (format #t "~1Tstar-coords[2] @ #x~X~%" (-> this star-coords)) + (format #t "~1Tsun-colors[2] @ #x~X~%" (-> this sun-colors)) + (format #t "~1Tgreen-colors[2] @ #x~X~%" (-> this green-colors)) + (format #t "~1Tmoon-colors[3] @ #x~X~%" (-> this moon-colors)) + (format #t "~1Tstar-colors[16] @ #x~X~%" (-> this star-colors)) + (format #t "~1Tst-coords[2] @ #x~X~%" (-> this st-coords)) + (format #t "~1Trandom[8] @ #x~X~%" (-> this random)) + (format #t "~1Tgiftag-base: #~%" (-> this giftag-base)) + (format #t "~1Tgiftag-haze: #~%" (-> this giftag-haze)) + (format #t "~1Tgiftag-roof: #~%" (-> this giftag-roof)) + (format #t "~1Tgiftag-ocean: #~%" (-> this giftag-ocean)) + (format #t "~1Tfog: #~%" (-> this fog)) + (format #t "~1Tsky[8] @ #x~X~%" (-> this sky)) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Toff-s: ~D~%" (-> this off-s)) + (format #t "~1Toff-t: ~D~%" (-> this off-t)) + (format #t "~1Torbit[3] @ #x~X~%" (-> this orbit)) + (format #t "~1Tupload-data: #~%" (-> this upload-data)) + (format #t "~1Tambi-color: #~%" (-> this ambi-color)) + (format #t "~1Tambi-color-lower: #~%" (-> this ambi-color-lower)) + (format #t "~1Tsun0-color: #~%" (-> this sun0-color)) + (format #t "~1Tsun1-color: #~%" (-> this sun1-color)) + (format #t "~1Tmoon-color: #~%" (-> this moon-color)) + (format #t "~1Tsun0-color-lower: #~%" (-> this sun0-color-lower)) + (format #t "~1Tcam-mat: #~%" (-> this cam-mat)) + (format #t "~1Tstar-mat: #~%" (-> this star-mat)) + (format #t "~1Tvec0: #~%" (-> this vec0)) + (format #t "~1Tvec1: #~%" (-> this vec1)) + (format #t "~1Tcloud-lights: #~%" (-> this cloud-lights)) + (format #t "~1Thaze-lights: #~%" (-> this haze-lights)) + (format #t "~1Tbuf: ~A~%" (-> this buf)) + (format #t "~1Tdraw-vortex: ~A~%" (-> this draw-vortex)) + (format #t "~1Tstars[512] @ #x~X~%" (-> this stars)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc index 468edff323..f626bcfc0a 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sky/sky-tng_REF.gc @@ -50,10 +50,10 @@ ;; definition for method 14 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-matrix sky-work ((obj sky-work) (arg0 matrix)) +(defmethod update-matrix sky-work ((this sky-work) (arg0 matrix)) (rlet ((vf0 :class vf)) (init-vf0-vector) - (let ((v1-0 (-> obj cam-mat))) + (let ((v1-0 (-> this cam-mat))) (let* ((a0-1 v1-0) (t0-0 arg0) (a1-1 (-> t0-0 quad 0)) @@ -77,7 +77,7 @@ ;; definition for method 15 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-template-colors sky-work ((obj sky-work)) +(defmethod update-template-colors sky-work ((this sky-work)) (let ((v1-1 (-> *time-of-day-context* current-fog erase-color)) (a0-2 (-> *level* default-level mood-context current-sky-color)) ) @@ -92,16 +92,16 @@ ;; definition for method 12 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod update-time-and-speed sky-work ((obj sky-work) (arg0 float) (arg1 float)) +(defmethod update-time-and-speed sky-work ((this sky-work) (arg0 float) (arg1 float)) (if (and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) info taskname) 'nest)) (set! arg1 (* 10.0 arg1)) ) - (sky-make-sun-data obj 0 arg0) - (sky-make-sun-data obj 1 arg0) - (sky-make-moon-data obj arg0) - (+! (-> obj off-s) (the int (* -8.0 arg1))) - (+! (-> obj off-t) (the int (* 2.0 arg1))) - (set! (-> obj time) arg0) + (sky-make-sun-data this 0 arg0) + (sky-make-sun-data this 1 arg0) + (sky-make-moon-data this arg0) + (+! (-> this off-s) (the int (* -8.0 arg1))) + (+! (-> this off-t) (the int (* 2.0 arg1))) + (set! (-> this time) arg0) 0 (none) ) @@ -117,7 +117,7 @@ ;; definition for method 11 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-colors-for-time sky-work ((obj sky-work) (arg0 float)) +(defmethod update-colors-for-time sky-work ((this sky-work) (arg0 float)) 0 0 0.0 @@ -136,30 +136,30 @@ ) (cond ((= a0-6 v1-7) - (set! (-> obj sun0-color quad) (-> s5-0 data a0-6 lgt-color quad)) + (set! (-> this sun0-color quad) (-> s5-0 data a0-6 lgt-color quad)) ) (else (let ((a1-5 (-> s5-0 data a0-6)) (v1-11 (-> s5-0 data v1-7)) ) - (vector4-lerp! (the-as vector (-> obj sun0-color)) (-> a1-5 lgt-color) (-> v1-11 lgt-color) f0-6) + (vector4-lerp! (the-as vector (-> this sun0-color)) (-> a1-5 lgt-color) (-> v1-11 lgt-color) f0-6) ) ) ) ) - (set! (-> obj sun0-color-lower quad) (-> s3-0 times 1 quad)) - (set! (-> obj ambi-color-lower quad) (-> s3-0 times 0 quad)) + (set! (-> this sun0-color-lower quad) (-> s3-0 times 1 quad)) + (set! (-> this ambi-color-lower quad) (-> s3-0 times 0 quad)) (set-vector! s4-0 1.9921875 1.9921875 1.9921875 1.0) (vector4-lerp! - (the-as vector (-> obj ambi-color)) - (the-as vector (-> obj ambi-color-lower)) + (the-as vector (-> this ambi-color)) + (the-as vector (-> this ambi-color-lower)) s4-0 (-> *mood-control* lightning-flash) ) ) - (set! (-> obj sun0-color quad) (-> obj sun0-color quad)) - (set! (-> obj sun1-color quad) (-> s5-0 data 7 lgt-color quad)) - (set! (-> obj moon-color quad) (-> s5-0 data 6 lgt-color quad)) + (set! (-> this sun0-color quad) (-> this sun0-color quad)) + (set! (-> this sun1-color quad) (-> s5-0 data 7 lgt-color quad)) + (set! (-> this moon-color quad) (-> s5-0 data 6 lgt-color quad)) ) 0 (none) @@ -168,7 +168,7 @@ ;; definition for method 18 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod cloud-vtx-light-update sky-work ((obj sky-work) (arg0 vector) (arg1 vector) (arg2 cloud-lights) (arg3 vector) (arg4 vector)) +(defmethod cloud-vtx-light-update sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 cloud-lights) (arg3 vector) (arg4 vector)) (let ((s5-0 (new 'stack-no-clear 'vector4))) (let* ((f0-1 (vector-dot (-> arg2 sun0-normal) arg1)) (f1-1 (vector-dot (-> arg2 sun1-normal) arg1)) @@ -194,7 +194,7 @@ ;; definition for method 19 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod cloud-vtx-tex-update sky-work ((obj sky-work) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 cloud-lights)) +(defmethod cloud-vtx-tex-update sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 cloud-lights)) (let ((s5-0 (new 'stack-no-clear 'vector4)) (s2-0 (new 'stack-no-clear 'vector4)) (s4-0 (new 'stack-no-clear 'vector4)) @@ -218,13 +218,13 @@ ;; definition for method 20 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod adjust-cloud-lighting sky-work ((obj sky-work)) +(defmethod adjust-cloud-lighting sky-work ((this sky-work)) (let ((s5-0 *cloud-vert-array*) - (s4-0 (-> obj cloud-lights)) + (s4-0 (-> this cloud-lights)) ) - (set! (-> s4-0 sun0-normal quad) (-> obj upload-data data 0)) - (set! (-> s4-0 sun1-normal quad) (-> obj upload-data sun 1 pos quad)) - (set! (-> s4-0 moon-normal quad) (-> obj upload-data moon pos quad)) + (set! (-> s4-0 sun0-normal quad) (-> this upload-data data 0)) + (set! (-> s4-0 sun1-normal quad) (-> this upload-data sun 1 pos quad)) + (set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad)) (vector-normalize! (-> s4-0 sun0-normal) 1.0) (vector-normalize! (-> s4-0 sun1-normal) 1.0) (vector-normalize! (-> s4-0 moon-normal) 1.0) @@ -233,45 +233,45 @@ (set! (-> s4-0 moon-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 moon-normal y)))))) (let ((s1-0 (-> s4-0 ambi-color)) (s2-0 (-> s4-0 ambi-color-lower)) - (s3-0 (-> obj sun0-color-lower)) + (s3-0 (-> this sun0-color-lower)) ) (let ((f30-0 (- 1.0 (fmax 0.0 (fmin 0.75 (* 4.0 (-> s4-0 moon-normal y)))))) (f28-0 (* 0.3333 (fmax 0.0 (fmin 1.0 (+ -1.0 (* 8.0 (-> s4-0 sun0-normal y))))))) ) - (vector4-scale! (the-as vector4 s2-0) (the-as vector4 (-> obj ambi-color-lower)) f30-0) + (vector4-scale! (the-as vector4 s2-0) (the-as vector4 (-> this ambi-color-lower)) f30-0) (vector4-madd! (the-as vector4 s2-0) (the-as vector4 s2-0) (the-as vector4 s3-0) f28-0) - (vector4-scale! (the-as vector4 s1-0) (the-as vector4 (-> obj ambi-color)) f30-0) + (vector4-scale! (the-as vector4 s1-0) (the-as vector4 (-> this ambi-color)) f30-0) (vector4-madd! (the-as vector4 s1-0) (the-as vector4 s1-0) (the-as vector4 s3-0) f28-0) ) (vector4-scale! (the-as vector4 (-> s4-0 sun0-color)) - (the-as vector4 (-> obj sun0-color)) + (the-as vector4 (-> this sun0-color)) (-> s4-0 sun0-scale) ) (vector4-scale! (the-as vector4 (-> s4-0 sun1-color)) - (the-as vector4 (-> obj sun1-color)) + (the-as vector4 (-> this sun1-color)) (* 0.5 (-> s4-0 sun1-scale)) ) (vector4-scale! (the-as vector4 (-> s4-0 moon-color)) - (the-as vector4 (-> obj moon-color)) + (the-as vector4 (-> this moon-color)) (-> s4-0 moon-scale) ) (vector4-scale! (the-as vector4 (-> s4-0 sun0-color-lower)) (the-as vector4 s3-0) (-> s4-0 sun0-scale)) ) (dotimes (s3-1 100) (let ((s2-1 (-> s5-0 data s3-1))) - (cloud-vtx-light-update obj (-> s2-1 col) (-> s2-1 nrm) s4-0 (-> s4-0 sun0-color) (-> s4-0 ambi-color)) + (cloud-vtx-light-update this (-> s2-1 col) (-> s2-1 nrm) s4-0 (-> s4-0 sun0-color) (-> s4-0 ambi-color)) (cloud-vtx-light-update - obj + this (-> s2-1 col2) (-> s2-1 nrm2) s4-0 (-> s4-0 sun0-color-lower) (-> s4-0 ambi-color-lower) ) - (cloud-vtx-tex-update obj (-> s2-1 stq2) (-> s2-1 stq) (-> s2-1 pos) s4-0) + (cloud-vtx-tex-update this (-> s2-1 stq2) (-> s2-1 stq) (-> s2-1 pos) s4-0) ) ) ) @@ -282,7 +282,7 @@ ;; definition for method 21 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod cloud-vtx1-to-sky sky-work ((obj sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) +(defmethod cloud-vtx1-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) (set! (-> arg0 pos quad) (-> arg1 pos quad)) (set! (-> arg0 stq quad) (-> arg1 stq quad)) (set! (-> arg0 col quad) (-> arg1 col quad)) @@ -293,7 +293,7 @@ ;; definition for method 22 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod cloud-vtx2-to-sky sky-work ((obj sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) +(defmethod cloud-vtx2-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex)) (set! (-> arg0 pos quad) (-> arg1 pos quad)) (set! (-> arg0 stq quad) (-> arg1 stq2 quad)) (set! (-> arg0 col quad) (-> arg1 col2 quad)) @@ -304,7 +304,7 @@ ;; definition for method 23 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-clouds sky-work ((obj sky-work) (arg0 dma-buffer)) +(defmethod draw-clouds sky-work ((this sky-work) (arg0 dma-buffer)) (local-vars (v1-19 float) (sv-16 cloud-vert-array) (sv-20 (inline-array sky-vertex)) (sv-32 int)) (rlet ((vf23 :class vf) (vf27 :class vf) @@ -335,12 +335,12 @@ (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) (texflush 0) ) - (.lvf vf27 (&-> obj giftag-roof quad)) + (.lvf vf27 (&-> this giftag-roof quad)) (let ((v1-18 #x43c80000)) (.mov vf23 v1-18) ) (.mov v1-19 vf23) - (set-tex-offset (the-as int (-> obj off-s)) (the-as int (-> obj off-t))) + (set-tex-offset (the-as int (-> this off-s)) (the-as int (-> this off-t))) (let ((s4-1 (the-as object (-> arg0 base)))) (&+! (-> arg0 base) 16) (set! sv-16 *cloud-vert-array*) @@ -350,14 +350,14 @@ (let ((s1-0 (+ (* 10 s3-1) s2-2))) (set! sv-32 (+ (* 9 s3-1) s2-2)) (let ((s0-0 (+ s2-2 81 (* 9 s3-1)))) - (cloud-vtx1-to-sky obj (-> sv-20 (* sv-32 4)) (-> sv-16 data s1-0)) - (cloud-vtx1-to-sky obj (-> sv-20 (+ (* sv-32 4) 1)) (-> sv-16 data (+ s1-0 1))) - (cloud-vtx1-to-sky obj (-> sv-20 (+ (* sv-32 4) 2)) (-> sv-16 data (+ s1-0 11))) - (cloud-vtx1-to-sky obj (-> sv-20 (+ (* sv-32 4) 3)) (-> sv-16 data (+ s1-0 10))) - (cloud-vtx2-to-sky obj (-> sv-20 (* s0-0 4)) (-> sv-16 data s1-0)) - (cloud-vtx2-to-sky obj (-> sv-20 (+ (* s0-0 4) 1)) (-> sv-16 data (+ s1-0 1))) - (cloud-vtx2-to-sky obj (-> sv-20 (+ (* s0-0 4) 2)) (-> sv-16 data (+ s1-0 11))) - (cloud-vtx2-to-sky obj (-> sv-20 (+ (* s0-0 4) 3)) (-> sv-16 data (+ s1-0 10))) + (cloud-vtx1-to-sky this (-> sv-20 (* sv-32 4)) (-> sv-16 data s1-0)) + (cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 1)) (-> sv-16 data (+ s1-0 1))) + (cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 2)) (-> sv-16 data (+ s1-0 11))) + (cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 3)) (-> sv-16 data (+ s1-0 10))) + (cloud-vtx2-to-sky this (-> sv-20 (* s0-0 4)) (-> sv-16 data s1-0)) + (cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 1)) (-> sv-16 data (+ s1-0 1))) + (cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 2)) (-> sv-16 data (+ s1-0 11))) + (cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 3)) (-> sv-16 data (+ s1-0 10))) ) ) ) @@ -380,7 +380,7 @@ ;; definition for method 24 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod apply-haze-light sky-work ((obj sky-work) (arg0 vector) (arg1 vector) (arg2 haze-lights)) +(defmethod apply-haze-light sky-work ((this sky-work) (arg0 vector) (arg1 vector) (arg2 haze-lights)) (let ((s5-0 (new 'stack-no-clear 'vector4))) (let* ((f0-1 (vector-dot (-> arg2 sun0-normal) arg1)) (f1-1 (vector-dot (-> arg2 sun1-normal) arg1)) @@ -406,13 +406,13 @@ ;; definition for method 25 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod adjust-haze-lighting sky-work ((obj sky-work)) +(defmethod adjust-haze-lighting sky-work ((this sky-work)) (let ((s5-0 *haze-vert-array*) - (s4-0 (-> obj haze-lights)) + (s4-0 (-> this haze-lights)) ) - (set! (-> s4-0 sun0-normal quad) (-> obj upload-data data 0)) - (set! (-> s4-0 sun1-normal quad) (-> obj upload-data sun 1 pos quad)) - (set! (-> s4-0 moon-normal quad) (-> obj upload-data moon pos quad)) + (set! (-> s4-0 sun0-normal quad) (-> this upload-data data 0)) + (set! (-> s4-0 sun1-normal quad) (-> this upload-data sun 1 pos quad)) + (set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad)) (vector-normalize! (-> s4-0 sun0-normal) 1.0) (vector-normalize! (-> s4-0 sun1-normal) 1.0) (vector-normalize! (-> s4-0 moon-normal) 1.0) @@ -420,30 +420,30 @@ (set! (-> s4-0 sun1-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 sun1-normal y)))))) (set! (-> s4-0 moon-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 moon-normal y)))))) (let ((a0-10 (-> s4-0 ambi-color))) - (-> obj sun0-color-lower) + (-> this sun0-color-lower) (let ((f0-7 (- 1.0 (fmax 0.0 (fmin 0.75 (* 4.0 (-> s4-0 moon-normal y))))))) (* 0.3333 (fmax 0.0 (fmin 1.0 (+ -1.0 (* 8.0 (-> s4-0 sun0-normal y)))))) - (vector4-scale! (the-as vector4 a0-10) (the-as vector4 (-> obj ambi-color)) f0-7) + (vector4-scale! (the-as vector4 a0-10) (the-as vector4 (-> this ambi-color)) f0-7) ) ) (vector4-scale! (the-as vector4 (-> s4-0 sun0-color)) - (the-as vector4 (-> obj sun0-color)) + (the-as vector4 (-> this sun0-color)) (-> s4-0 sun0-scale) ) (vector4-scale! (the-as vector4 (-> s4-0 sun1-color)) - (the-as vector4 (-> obj sun1-color)) + (the-as vector4 (-> this sun1-color)) (* 0.5 (-> s4-0 sun1-scale)) ) (vector4-scale! (the-as vector4 (-> s4-0 moon-color)) - (the-as vector4 (-> obj moon-color)) + (the-as vector4 (-> this moon-color)) (-> s4-0 moon-scale) ) (dotimes (s3-0 36) (let ((v1-25 (-> s5-0 data s3-0))) - (apply-haze-light obj (-> v1-25 col) (-> v1-25 nrm) s4-0) + (apply-haze-light this (-> v1-25 col) (-> v1-25 nrm) s4-0) ) ) ) @@ -454,7 +454,7 @@ ;; definition for method 26 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod haze-vtx-to-sky sky-work ((obj sky-work) (arg0 sky-vertex) (arg1 sky-vertex) (arg2 haze-vertex)) +(defmethod haze-vtx-to-sky sky-work ((this sky-work) (arg0 sky-vertex) (arg1 sky-vertex) (arg2 haze-vertex)) (set! (-> arg0 pos quad) (-> arg2 pos quad)) (set! (-> arg0 col quad) (-> arg2 col quad)) (set! (-> arg0 col w) 128.0) @@ -468,22 +468,22 @@ ;; definition for method 27 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod draw-haze sky-work ((obj sky-work) (arg0 dma-buffer)) +(defmethod draw-haze sky-work ((this sky-work) (arg0 dma-buffer)) (local-vars (sv-16 haze-vert-array) (sv-20 (inline-array sky-vertex))) (rlet ((vf27 :class vf)) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))) - (init-regs-for-large-polygon-draw obj) - (.lvf vf27 (&-> obj giftag-haze quad)) + (init-regs-for-large-polygon-draw this) + (.lvf vf27 (&-> this giftag-haze quad)) (let ((s4-0 (the-as object (-> arg0 base)))) (&+! (-> arg0 base) 16) (set! sv-16 *haze-vert-array*) (set! sv-20 *haze-poly*) (dotimes (s3-0 35) - (haze-vtx-to-sky obj (-> sv-20 (* s3-0 4)) (-> sv-20 (+ (* s3-0 4) 1)) (-> sv-16 data s3-0)) - (haze-vtx-to-sky obj (-> sv-20 (+ (* s3-0 4) 3)) (-> sv-20 (+ (* s3-0 4) 2)) (-> sv-16 data (+ s3-0 1))) + (haze-vtx-to-sky this (-> sv-20 (* s3-0 4)) (-> sv-20 (+ (* s3-0 4) 1)) (-> sv-16 data s3-0)) + (haze-vtx-to-sky this (-> sv-20 (+ (* s3-0 4) 3)) (-> sv-20 (+ (* s3-0 4) 2)) (-> sv-16 data (+ s3-0 1))) ) - (haze-vtx-to-sky obj (-> sv-20 140) (-> sv-20 141) (-> sv-16 data 35)) - (haze-vtx-to-sky obj (-> sv-20 143) (-> sv-20 142) (the-as haze-vertex (-> sv-16 data))) + (haze-vtx-to-sky this (-> sv-20 140) (-> sv-20 141) (-> sv-16 data 35)) + (haze-vtx-to-sky this (-> sv-20 143) (-> sv-20 142) (the-as haze-vertex (-> sv-16 data))) (dotimes (s5-1 36) (render-sky-quad (the-as (inline-array sky-vertex) (-> sv-20 (* s5-1 4))) arg0) ) @@ -514,7 +514,7 @@ ;; definition for method 31 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod setup-stars sky-work ((obj sky-work) (arg0 matrix) (arg1 sky-upload-data)) +(defmethod setup-stars sky-work ((this sky-work) (arg0 matrix) (arg1 sky-upload-data)) (set! (-> arg0 vector 2 quad) (-> arg1 data 0)) (vector-normalize! (-> arg0 vector 2) 1.0) (vector-cross! (the-as vector (-> arg0 vector)) *z-vector* (-> arg0 vector 2)) @@ -527,7 +527,7 @@ (let ((f0-1 (fmax 0.0 (fmin 1.0 (* 20.0 (+ 0.05 (-> s4-1 y))))))) (dotimes (v1-7 16) (let ((f1-4 (* (- 128.0 (* 8.0 (the float v1-7))) f0-1))) - (set-vector! (-> obj star-colors v1-7) (the int f1-4) (the int f1-4) (the int f1-4) 128) + (set-vector! (-> this star-colors v1-7) (the int f1-4) (the int f1-4) (the int f1-4) 128) ) ) ) @@ -546,15 +546,15 @@ ;; definition for method 34 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod draw-roof sky-work ((obj sky-work) (arg0 dma-buffer)) +(defmethod draw-roof sky-work ((this sky-work) (arg0 dma-buffer)) (rlet ((vf27 :class vf)) (dma-buffer-add-gs-set arg0 (zbuf-1 (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24))) (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) ) - (init-regs-for-large-polygon-draw obj) - (.lvf vf27 (&-> obj giftag-base quad)) + (init-regs-for-large-polygon-draw this) + (.lvf vf27 (&-> this giftag-base quad)) (let ((s5-1 (the-as object (-> arg0 base)))) (&+! (-> arg0 base) 16) (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 0)) arg0) @@ -575,14 +575,14 @@ ;; definition for method 35 of type sky-work ;; WARN: Return type mismatch int vs none. -(defmethod draw-base sky-work ((obj sky-work) (arg0 dma-buffer)) +(defmethod draw-base sky-work ((this sky-work) (arg0 dma-buffer)) (rlet ((vf27 :class vf)) (dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always))) ) (let ((s5-0 (the-as object (-> arg0 base)))) (&+! (-> arg0 base) 16) - (.lvf vf27 (&-> obj giftag-base quad)) + (.lvf vf27 (&-> this giftag-base quad)) (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 0)) arg0) (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 3)) arg0) (render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 6)) arg0) @@ -602,7 +602,7 @@ ;; definition for method 36 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-fog sky-work ((obj sky-work) (arg0 dma-buffer)) +(defmethod draw-fog sky-work ((this sky-work) (arg0 dma-buffer)) (let ((s4-0 (-> *sky-texture-anim-array* array-data 8 tex))) (if s4-0 (dma-buffer-add-gs-set arg0 @@ -642,8 +642,8 @@ (f0-2 (/ (- (-> *fog-texture-work* corner 2 y) f0-0) f4-0)) (a0-28 6400) ) - (set! (-> v1-26 0 quad) (-> obj fog-tmpl dma-vif quad)) - (set! (-> v1-26 1 quad) (-> obj fog-tmpl quad 1)) + (set! (-> v1-26 0 quad) (-> this fog-tmpl dma-vif quad)) + (set! (-> v1-26 1 quad) (-> this fog-tmpl quad 1)) (set-vector! (-> v1-26 2 vector4w) 128 128 128 128) (set-vector! (-> v1-26 3 vector4w) (the-as int f3-0) (the-as int 0.0) (the-as int 1.0) (the-as int 0.0)) (set-vector! (-> v1-26 4 vector4w) #x7000 #x7300 a0-28 0) @@ -662,7 +662,7 @@ ;; definition for method 13 of type sky-work ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw sky-work ((obj sky-work)) +(defmethod draw sky-work ((this sky-work)) (let ((v1-0 *time-of-day-context*) (a0-1 #f) ) @@ -687,14 +687,14 @@ ) ) ) - (update-matrix obj a1-7) + (update-matrix this a1-7) ) - (update-template-colors obj) - (adjust-haze-lighting obj) - (adjust-cloud-lighting obj) + (update-template-colors this) + (adjust-haze-lighting this) + (adjust-cloud-lighting this) (let ((s4-0 (the-as object #x70000000))) - (mem-copy! (the-as pointer s4-0) (the-as pointer obj) #x2760) - (setup-stars (the-as sky-work s4-0) (-> (the-as sky-work s4-0) star-mat) (-> obj upload-data)) + (mem-copy! (the-as pointer s4-0) (the-as pointer this) #x2760) + (setup-stars (the-as sky-work s4-0) (-> (the-as sky-work s4-0) star-mat) (-> this upload-data)) (if (nonzero? (-> (the-as sky-work s4-0) star-colors 0 x)) (stars-transform-asm (the-as sky-work s4-0)) ) @@ -750,8 +750,8 @@ (a0-46 #x7800) (a1-36 #x7980) ) - (set! (-> a2-40 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - (set! (-> a2-40 1 quad) (-> obj draw-tmpl2 quad 1)) + (set! (-> a2-40 0 quad) (-> this draw-tmpl2 dma-vif quad)) + (set! (-> a2-40 1 quad) (-> this draw-tmpl2 quad 1)) (set-vector! (-> a2-40 2 vector4w) 128 128 128 128) (set-vector! (-> a2-40 3 vector4w) 8 8 0 0) (set-vector! (-> a2-40 4 vector4w) a3-7 t0-1 0 0) @@ -765,8 +765,8 @@ (a0-49 #x9000) (a1-37 #x8d00) ) - (set! (-> t0-4 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - (set! (-> t0-4 1 quad) (-> obj draw-tmpl2 quad 1)) + (set! (-> t0-4 0 quad) (-> this draw-tmpl2 dma-vif quad)) + (set! (-> t0-4 1 quad) (-> this draw-tmpl2 quad 1)) (set-vector! (-> t0-4 2 vector4w) 128 128 128 128) (set-vector! (-> t0-4 3 vector4w) 8 8 0 0) (set-vector! (-> t0-4 4 vector4w) a2-42 a3-9 0 0) @@ -779,8 +779,8 @@ (texflush 0) ) (let ((t0-11 (the-as (inline-array qword) (-> s4-1 base)))) - (set! (-> t0-11 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - (set! (-> t0-11 1 quad) (-> obj draw-tmpl2 quad 1)) + (set! (-> t0-11 0 quad) (-> this draw-tmpl2 dma-vif quad)) + (set! (-> t0-11 1 quad) (-> this draw-tmpl2 quad 1)) (set-vector! (-> t0-11 2 vector4w) 128 128 128 80) (set-vector! (-> t0-11 3 vector4w) 0 0 0 0) (set-vector! (-> t0-11 4 vector4w) a2-42 a3-9 0 0) @@ -810,8 +810,8 @@ (let ((t5-0 (* (+ (* t0-12 16) 256) 16)) (t4-5 (* (+ (* (+ t0-12 1) 16) 256) 16)) ) - (set! (-> t1-22 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - (set! (-> t1-22 1 quad) (-> obj draw-tmpl2 quad 1)) + (set! (-> t1-22 0 quad) (-> this draw-tmpl2 dma-vif quad)) + (set! (-> t1-22 1 quad) (-> this draw-tmpl2 quad 1)) (set-vector! (-> t1-22 2 vector4w) a0-57 a1-46 a2-55 128) (set-vector! (-> t1-22 3 vector4w) (+ t5-0 8) (+ v1-57 24) 0 0) (set-vector! (-> t1-22 4 vector4w) t3-0 #x7300 0 0) @@ -828,8 +828,8 @@ (texflush 0) ) (let ((v1-63 (the-as (inline-array qword) (-> s4-1 base)))) - (set! (-> v1-63 0 quad) (-> obj draw-tmpl2 dma-vif quad)) - (set! (-> v1-63 1 quad) (-> obj draw-tmpl2 quad 1)) + (set! (-> v1-63 0 quad) (-> this draw-tmpl2 dma-vif quad)) + (set! (-> v1-63 1 quad) (-> this draw-tmpl2 quad 1)) (set-vector! (-> v1-63 2 vector4w) a0-57 a1-46 a2-55 (the int (- 128.0 (* 48.0 f0-0)))) (set-vector! (-> v1-63 3 vector4w) 0 24 0 0) (set-vector! (-> v1-63 4 vector4w) #x7000 #x7300 0 0) @@ -859,8 +859,8 @@ ) ) (let ((v1-78 (the-as (inline-array qword) (-> s4-1 base)))) - (set! (-> v1-78 0 quad) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> v1-78 1 quad) (-> obj sprite-tmpl quad 1)) + (set! (-> v1-78 0 quad) (-> this sprite-tmpl dma-vif quad)) + (set! (-> v1-78 1 quad) (-> this sprite-tmpl quad 1)) ) (&+! (-> s4-1 base) 32) (let ((v1-81 (the-as (inline-array qword) (-> s4-1 base)))) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc index 969c3e118c..f8412b1347 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc @@ -50,49 +50,49 @@ ) ;; definition for method 3 of type sparticle-cpuinfo -(defmethod inspect sparticle-cpuinfo ((obj sparticle-cpuinfo)) - (when (not obj) - (set! obj obj) +(defmethod inspect sparticle-cpuinfo ((this sparticle-cpuinfo)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sparticle-cpuinfo) - (format #t "~1Tsprite: #~%" (-> obj sprite)) - (format #t "~1Tadgif: #~%" (-> obj adgif)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) - (format #t "~1Tomega: ~f~%" (-> obj omega)) - (format #t "~1Tvel-sxvel: #~%" (-> obj vel-sxvel)) - (format #t "~1Trot-syvel: #~%" (-> obj rot-syvel)) - (format #t "~1Tfade: #~%" (-> obj fade)) - (format #t "~1Tacc: #~%" (-> obj acc)) - (format #t "~1Trotvel3d: #~%" (-> obj rotvel3d)) - (format #t "~1Tvel: #~%" (-> obj vel-sxvel)) - (format #t "~1Taccel: #~%" (-> obj acc)) - (format #t "~1Tscalevelx: ~f~%" (-> obj vel-sxvel w)) - (format #t "~1Tscalevely: ~f~%" (-> obj rot-syvel w)) - (format #t "~1Tfriction: ~f~%" (-> obj friction)) - (format #t "~1Ttimer: ~D~%" (-> obj timer)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tuser-int32: ~D~%" (-> obj user-float)) - (format #t "~1Tuser-uint32: ~D~%" (-> obj user-float)) - (format #t "~1Tuser-float: ~f~%" (-> obj user-float)) - (format #t "~1Tuser-pntr: #x~X~%" (-> obj user-float)) - (format #t "~1Tuser-object: ~A~%" (-> obj user-float)) - (format #t "~1Tuser-sprite: #~%" (-> obj user-float)) - (format #t "~1Tsp-func: ~A~%" (-> obj sp-func)) - (format #t "~1Tnext-time: ~D~%" (-> obj next-time)) - (format #t "~1Tnext-launcher: ~A~%" (-> obj next-launcher)) - (format #t "~1Tcache-alpha: ~f~%" (-> obj cache-alpha)) - (format #t "~1Tvalid: ~D~%" (-> obj valid)) - (format #t "~1Tclock-index: ~D~%" (-> obj clock-index)) - (format #t "~1Tuser1-int16: ~D~%" (-> obj user1-int16)) - (format #t "~1Tkey: ~A~%" (-> obj key)) - (format #t "~1Tbinding: #~%" (-> obj binding)) - (format #t "~1Tdata[1] @ #x~X~%" (&-> obj omega)) - (format #t "~1Tdatab[4] @ #x~X~%" (&-> obj omega)) - (format #t "~1Tdataf[1] @ #x~X~%" (&-> obj omega)) - (format #t "~1Tdatac[1] @ #x~X~%" (&-> obj omega)) + (format #t "[~8x] ~A~%" this 'sparticle-cpuinfo) + (format #t "~1Tsprite: #~%" (-> this sprite)) + (format #t "~1Tadgif: #~%" (-> this adgif)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tomega: ~f~%" (-> this omega)) + (format #t "~1Tvel-sxvel: #~%" (-> this vel-sxvel)) + (format #t "~1Trot-syvel: #~%" (-> this rot-syvel)) + (format #t "~1Tfade: #~%" (-> this fade)) + (format #t "~1Tacc: #~%" (-> this acc)) + (format #t "~1Trotvel3d: #~%" (-> this rotvel3d)) + (format #t "~1Tvel: #~%" (-> this vel-sxvel)) + (format #t "~1Taccel: #~%" (-> this acc)) + (format #t "~1Tscalevelx: ~f~%" (-> this vel-sxvel w)) + (format #t "~1Tscalevely: ~f~%" (-> this rot-syvel w)) + (format #t "~1Tfriction: ~f~%" (-> this friction)) + (format #t "~1Ttimer: ~D~%" (-> this timer)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tuser-int32: ~D~%" (-> this user-float)) + (format #t "~1Tuser-uint32: ~D~%" (-> this user-float)) + (format #t "~1Tuser-float: ~f~%" (-> this user-float)) + (format #t "~1Tuser-pntr: #x~X~%" (-> this user-float)) + (format #t "~1Tuser-object: ~A~%" (-> this user-float)) + (format #t "~1Tuser-sprite: #~%" (-> this user-float)) + (format #t "~1Tsp-func: ~A~%" (-> this sp-func)) + (format #t "~1Tnext-time: ~D~%" (-> this next-time)) + (format #t "~1Tnext-launcher: ~A~%" (-> this next-launcher)) + (format #t "~1Tcache-alpha: ~f~%" (-> this cache-alpha)) + (format #t "~1Tvalid: ~D~%" (-> this valid)) + (format #t "~1Tclock-index: ~D~%" (-> this clock-index)) + (format #t "~1Tuser1-int16: ~D~%" (-> this user1-int16)) + (format #t "~1Tkey: ~A~%" (-> this key)) + (format #t "~1Tbinding: #~%" (-> this binding)) + (format #t "~1Tdata[1] @ #x~X~%" (&-> this omega)) + (format #t "~1Tdatab[4] @ #x~X~%" (&-> this omega)) + (format #t "~1Tdataf[1] @ #x~X~%" (&-> this omega)) + (format #t "~1Tdatac[1] @ #x~X~%" (&-> this omega)) (label cfg-4) - obj + this ) ;; definition of type sparticle-launchinfo @@ -117,27 +117,27 @@ ) ;; definition for method 3 of type sparticle-launchinfo -(defmethod inspect sparticle-launchinfo ((obj sparticle-launchinfo)) - (when (not obj) - (set! obj obj) +(defmethod inspect sparticle-launchinfo ((this sparticle-launchinfo)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sparticle-launchinfo) - (format #t "~1Tlaunchrot: ~`vector`P~%" (-> obj launchrot)) - (format #t "~1Tconerot: ~`vector`P~%" (-> obj conerot)) - (format #t "~1Trotate-x: ~f~%" (-> obj rotate-x)) - (format #t "~1Trotate-y: ~f~%" (-> obj rotate-y)) - (format #t "~1Trotate-z: ~f~%" (-> obj rotate-z)) - (format #t "~1Tconeradius: ~f~%" (-> obj coneradius)) - (format #t "~1Trotate: ~`vector`P~%" (&-> obj rotate-x)) - (format #t "~1Tscale-x: ~f~%" (-> obj scale-x)) - (format #t "~1Tscale-y: ~f~%" (-> obj scale-y)) - (format #t "~1Tscale-z: ~f~%" (-> obj scale-z)) - (format #t "~1Tdummy: ~f~%" (-> obj dummy)) - (format #t "~1Tscale: ~`vector`P~%" (&-> obj scale-x)) - (format #t "~1Tdata[1] @ #x~X~%" (-> obj launchrot)) + (format #t "[~8x] ~A~%" this 'sparticle-launchinfo) + (format #t "~1Tlaunchrot: ~`vector`P~%" (-> this launchrot)) + (format #t "~1Tconerot: ~`vector`P~%" (-> this conerot)) + (format #t "~1Trotate-x: ~f~%" (-> this rotate-x)) + (format #t "~1Trotate-y: ~f~%" (-> this rotate-y)) + (format #t "~1Trotate-z: ~f~%" (-> this rotate-z)) + (format #t "~1Tconeradius: ~f~%" (-> this coneradius)) + (format #t "~1Trotate: ~`vector`P~%" (&-> this rotate-x)) + (format #t "~1Tscale-x: ~f~%" (-> this scale-x)) + (format #t "~1Tscale-y: ~f~%" (-> this scale-y)) + (format #t "~1Tscale-z: ~f~%" (-> this scale-z)) + (format #t "~1Tdummy: ~f~%" (-> this dummy)) + (format #t "~1Tscale: ~`vector`P~%" (&-> this scale-x)) + (format #t "~1Tdata[1] @ #x~X~%" (-> this launchrot)) (label cfg-4) - obj + this ) ;; definition of type sparticle-system @@ -161,23 +161,23 @@ ) ;; definition for method 3 of type sparticle-system -(defmethod inspect sparticle-system ((obj sparticle-system)) - (when (not obj) - (set! obj obj) +(defmethod inspect sparticle-system ((this sparticle-system)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tblocks[2] @ #x~X~%" (-> obj blocks)) - (format #t "~1Tlength[2] @ #x~X~%" (-> obj length)) - (format #t "~1Tnum-alloc[2] @ #x~X~%" (-> obj num-alloc)) - (format #t "~1Tis-3d: ~A~%" (-> obj is-3d)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Talloc-table: #x~X~%" (-> obj alloc-table)) - (format #t "~1Tcpuinfo-table: #x~X~%" (-> obj cpuinfo-table)) - (format #t "~1Tvecdata-table: #x~X~%" (-> obj vecdata-table)) - (format #t "~1Tadgifdata-table: #x~X~%" (-> obj adgifdata-table)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tblocks[2] @ #x~X~%" (-> this blocks)) + (format #t "~1Tlength[2] @ #x~X~%" (-> this length)) + (format #t "~1Tnum-alloc[2] @ #x~X~%" (-> this num-alloc)) + (format #t "~1Tis-3d: ~A~%" (-> this is-3d)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Talloc-table: #x~X~%" (-> this alloc-table)) + (format #t "~1Tcpuinfo-table: #x~X~%" (-> this cpuinfo-table)) + (format #t "~1Tvecdata-table: #x~X~%" (-> this vecdata-table)) + (format #t "~1Tadgifdata-table: #x~X~%" (-> this adgifdata-table)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc index 28e3e7649f..53031c30a6 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc @@ -19,23 +19,23 @@ ) ;; definition for method 3 of type sparticle-birthinfo -(defmethod inspect sparticle-birthinfo ((obj sparticle-birthinfo)) - (when (not obj) - (set! obj obj) +(defmethod inspect sparticle-birthinfo ((this sparticle-birthinfo)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sparticle-birthinfo) - (format #t "~1Tsprite: ~D~%" (-> obj sprite)) - (format #t "~1Tanim: ~D~%" (-> obj anim)) - (format #t "~1Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~1Tbirth-func: ~A~%" (-> obj birth-func)) - (format #t "~1Tjoint-ppoint: ~D~%" (-> obj joint-ppoint)) - (format #t "~1Tnum-to-birth: ~f~%" (-> obj num-to-birth)) - (format #t "~1Tsound: ~A~%" (-> obj sound)) - (format #t "~1Tdataf[1] @ #x~X~%" (&-> obj sprite)) - (format #t "~1Tdata[1] @ #x~X~%" (&-> obj sprite)) + (format #t "[~8x] ~A~%" this 'sparticle-birthinfo) + (format #t "~1Tsprite: ~D~%" (-> this sprite)) + (format #t "~1Tanim: ~D~%" (-> this anim)) + (format #t "~1Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~1Tbirth-func: ~A~%" (-> this birth-func)) + (format #t "~1Tjoint-ppoint: ~D~%" (-> this joint-ppoint)) + (format #t "~1Tnum-to-birth: ~f~%" (-> this num-to-birth)) + (format #t "~1Tsound: ~A~%" (-> this sound)) + (format #t "~1Tdataf[1] @ #x~X~%" (&-> this sprite)) + (format #t "~1Tdata[1] @ #x~X~%" (&-> this sprite)) (label cfg-4) - obj + this ) ;; definition of type sp-field-init-spec @@ -61,28 +61,28 @@ ) ;; definition for method 3 of type sp-field-init-spec -(defmethod inspect sp-field-init-spec ((obj sp-field-init-spec)) - (when (not obj) - (set! obj obj) +(defmethod inspect sp-field-init-spec ((this sp-field-init-spec)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sp-field-init-spec) - (format #t "~1Tfield: ~D~%" (-> obj field)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tinitial-valuef: ~f~%" (-> obj initial-valuef)) - (format #t "~1Trandom-rangef: ~f~%" (-> obj random-rangef)) - (format #t "~1Trandom-multf: ~f~%" (-> obj random-multf)) - (format #t "~1Tinitial-value: ~D~%" (-> obj initial-valuef)) - (format #t "~1Trandom-range: ~D~%" (-> obj random-rangef)) - (format #t "~1Trandom-mult: ~D~%" (-> obj random-multf)) - (format #t "~1Tfunc: ~A~%" (-> obj initial-valuef)) - (format #t "~1Ttex: ~D~%" (-> obj initial-valuef)) - (format #t "~1Tpntr: #x~X~%" (-> obj initial-valuef)) - (format #t "~1Tobject: ~A~%" (-> obj initial-valuef)) - (format #t "~1Tsym: ~A~%" (-> obj initial-valuef)) - (format #t "~1Tsound: ~A~%" (-> obj initial-valuef)) + (format #t "[~8x] ~A~%" this 'sp-field-init-spec) + (format #t "~1Tfield: ~D~%" (-> this field)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tinitial-valuef: ~f~%" (-> this initial-valuef)) + (format #t "~1Trandom-rangef: ~f~%" (-> this random-rangef)) + (format #t "~1Trandom-multf: ~f~%" (-> this random-multf)) + (format #t "~1Tinitial-value: ~D~%" (-> this initial-valuef)) + (format #t "~1Trandom-range: ~D~%" (-> this random-rangef)) + (format #t "~1Trandom-mult: ~D~%" (-> this random-multf)) + (format #t "~1Tfunc: ~A~%" (-> this initial-valuef)) + (format #t "~1Ttex: ~D~%" (-> this initial-valuef)) + (format #t "~1Tpntr: #x~X~%" (-> this initial-valuef)) + (format #t "~1Tobject: ~A~%" (-> this initial-valuef)) + (format #t "~1Tsym: ~A~%" (-> this initial-valuef)) + (format #t "~1Tsound: ~A~%" (-> this initial-valuef)) (label cfg-4) - obj + this ) ;; definition of type sparticle-launcher @@ -101,17 +101,17 @@ ) ;; definition for method 3 of type sparticle-launcher -(defmethod inspect sparticle-launcher ((obj sparticle-launcher)) - (when (not obj) - (set! obj obj) +(defmethod inspect sparticle-launcher ((this sparticle-launcher)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tbirthaccum: ~f~%" (-> obj birthaccum)) - (format #t "~1Tsoundaccum: ~f~%" (-> obj soundaccum)) - (format #t "~1Tinit-specs: #x~X~%" (-> obj init-specs)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tbirthaccum: ~f~%" (-> this birthaccum)) + (format #t "~1Tsoundaccum: ~f~%" (-> this soundaccum)) + (format #t "~1Tinit-specs: #x~X~%" (-> this init-specs)) (label cfg-4) - obj + this ) ;; definition of type sparticle-group-item @@ -132,23 +132,23 @@ ) ;; definition for method 3 of type sparticle-group-item -(defmethod inspect sparticle-group-item ((obj sparticle-group-item)) - (when (not obj) - (set! obj obj) +(defmethod inspect sparticle-group-item ((this sparticle-group-item)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sparticle-group-item) - (format #t "~1Tlauncher: ~D~%" (-> obj launcher)) - (format #t "~1Tfade-after: (meters ~m)~%" (-> obj fade-after)) - (format #t "~1Tfalloff-to: (meters ~m)~%" (-> obj falloff-to)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tperiod: ~D~%" (-> obj period)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Toffset: ~D~%" (-> obj offset)) - (format #t "~1Thour-mask: ~D~%" (-> obj hour-mask)) - (format #t "~1Tbinding: ~D~%" (-> obj binding)) + (format #t "[~8x] ~A~%" this 'sparticle-group-item) + (format #t "~1Tlauncher: ~D~%" (-> this launcher)) + (format #t "~1Tfade-after: (meters ~m)~%" (-> this fade-after)) + (format #t "~1Tfalloff-to: (meters ~m)~%" (-> this falloff-to)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Toffset: ~D~%" (-> this offset)) + (format #t "~1Thour-mask: ~D~%" (-> this hour-mask)) + (format #t "~1Tbinding: ~D~%" (-> this binding)) (label cfg-4) - obj + this ) ;; definition of type sparticle-launch-state @@ -175,29 +175,29 @@ ) ;; definition for method 3 of type sparticle-launch-state -(defmethod inspect sparticle-launch-state ((obj sparticle-launch-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect sparticle-launch-state ((this sparticle-launch-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sparticle-launch-state) - (format #t "~1Tgroup-item: #~%" (-> obj group-item)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Trandomize: ~D~%" (-> obj randomize)) - (format #t "~1Tcenter: #~%" (-> obj center)) - (format #t "~1Tsprite3d: #~%" (-> obj sprite3d)) - (format #t "~1Tsprite: ~A~%" (-> obj sprite)) - (format #t "~1Toffset: ~D~%" (-> obj offset)) - (format #t "~1Taccum: ~f~%" (-> obj accum)) - (format #t "~1Tspawn-time: ~D~%" (-> obj spawn-time)) - (format #t "~1Tcontrol: ~A~%" (-> obj control)) - (format #t "~1Tswarm: ~A~%" (-> obj offset)) - (format #t "~1Tseed: ~D~%" (-> obj accum)) - (format #t "~1Ttime: ~D~%" (-> obj spawn-time)) - (format #t "~1Tspec: ~A~%" (-> obj sprite)) - (format #t "~1Tid: ~D~%" (-> obj sprite3d)) + (format #t "[~8x] ~A~%" this 'sparticle-launch-state) + (format #t "~1Tgroup-item: #~%" (-> this group-item)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Trandomize: ~D~%" (-> this randomize)) + (format #t "~1Tcenter: #~%" (-> this center)) + (format #t "~1Tsprite3d: #~%" (-> this sprite3d)) + (format #t "~1Tsprite: ~A~%" (-> this sprite)) + (format #t "~1Toffset: ~D~%" (-> this offset)) + (format #t "~1Taccum: ~f~%" (-> this accum)) + (format #t "~1Tspawn-time: ~D~%" (-> this spawn-time)) + (format #t "~1Tcontrol: ~A~%" (-> this control)) + (format #t "~1Tswarm: ~A~%" (-> this offset)) + (format #t "~1Tseed: ~D~%" (-> this accum)) + (format #t "~1Ttime: ~D~%" (-> this spawn-time)) + (format #t "~1Tspec: ~A~%" (-> this sprite)) + (format #t "~1Tid: ~D~%" (-> this sprite3d)) (label cfg-4) - obj + this ) ;; definition of type sparticle-launch-group @@ -225,27 +225,27 @@ ) ;; definition for method 3 of type sparticle-launch-group -(defmethod inspect sparticle-launch-group ((obj sparticle-launch-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect sparticle-launch-group ((this sparticle-launch-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tduration: ~D~%" (-> obj duration)) - (format #t "~1Tlinger-duration: ~D~%" (-> obj linger-duration)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlauncher: #x~X~%" (-> obj launcher)) - (format #t "~1Trotate-x: (deg ~r)~%" (-> obj rotate-x)) - (format #t "~1Trotate-y: (deg ~r)~%" (-> obj rotate-y)) - (format #t "~1Trotate-z: (deg ~r)~%" (-> obj rotate-z)) - (format #t "~1Tscale-x: ~f~%" (-> obj scale-x)) - (format #t "~1Tscale-y: ~f~%" (-> obj scale-y)) - (format #t "~1Tscale-z: ~f~%" (-> obj scale-z)) - (format #t "~1Tbounds: #~%" (-> obj bounds)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tduration: ~D~%" (-> this duration)) + (format #t "~1Tlinger-duration: ~D~%" (-> this linger-duration)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlauncher: #x~X~%" (-> this launcher)) + (format #t "~1Trotate-x: (deg ~r)~%" (-> this rotate-x)) + (format #t "~1Trotate-y: (deg ~r)~%" (-> this rotate-y)) + (format #t "~1Trotate-z: (deg ~r)~%" (-> this rotate-z)) + (format #t "~1Tscale-x: ~f~%" (-> this scale-x)) + (format #t "~1Tscale-y: ~f~%" (-> this scale-y)) + (format #t "~1Tscale-z: ~f~%" (-> this scale-z)) + (format #t "~1Tbounds: #~%" (-> this bounds)) (label cfg-4) - obj + this ) ;; definition for symbol *launch-matrix*, type matrix @@ -281,28 +281,28 @@ ) ;; definition for method 3 of type sparticle-launch-control -(defmethod inspect sparticle-launch-control ((obj sparticle-launch-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect sparticle-launch-control ((this sparticle-launch-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tgroup: ~A~%" (-> obj group)) - (format #t "~1Tproc: ~A~%" (-> obj proc)) - (format #t "~1Tlocal-clock: ~D~%" (-> obj local-clock)) - (format #t "~1Tfade: ~f~%" (-> obj fade)) - (format #t "~1Tmatrix: ~D~%" (-> obj matrix)) - (format #t "~1Tstate-mode[3] @ #x~X~%" (-> obj state-mode)) - (format #t "~1Tstate-counter: ~D~%" (-> obj state-counter)) - (format #t "~1Tlast-spawn-frame: ~D~%" (-> obj last-spawn-frame)) - (format #t "~1Tlast-spawn-time: ~D~%" (-> obj last-spawn-time)) - (format #t "~1Torigin: #~%" (-> obj origin)) - (format #t "~1Tcenter: ~`vector`P~%" (-> obj origin trans)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tgroup: ~A~%" (-> this group)) + (format #t "~1Tproc: ~A~%" (-> this proc)) + (format #t "~1Tlocal-clock: ~D~%" (-> this local-clock)) + (format #t "~1Tfade: ~f~%" (-> this fade)) + (format #t "~1Tmatrix: ~D~%" (-> this matrix)) + (format #t "~1Tstate-mode[3] @ #x~X~%" (-> this state-mode)) + (format #t "~1Tstate-counter: ~D~%" (-> this state-counter)) + (format #t "~1Tlast-spawn-frame: ~D~%" (-> this last-spawn-frame)) + (format #t "~1Tlast-spawn-time: ~D~%" (-> this last-spawn-time)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tcenter: ~`vector`P~%" (-> this origin trans)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc index 8b856b288b..366756f302 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -3,11 +3,11 @@ ;; definition for method 3 of type sparticle-launcher ;; WARN: Return type mismatch int vs sparticle-launcher. -(defmethod inspect sparticle-launcher ((obj sparticle-launcher)) - (format #t "~X: sparticle-launcher~%" obj) +(defmethod inspect sparticle-launcher ((this sparticle-launcher)) + (format #t "~X: sparticle-launcher~%" this) (let ((s5-0 0)) - (while (!= (-> obj init-specs s5-0 field) (sp-field-id spt-end)) - (let* ((v1-1 (-> obj init-specs s5-0)) + (while (!= (-> this init-specs s5-0 field) (sp-field-id spt-end)) + (let* ((v1-1 (-> this init-specs s5-0)) (t9-1 format) (a0-3 #t) (a1-1 "~T~S : ~F / #x~X / ~D~%") @@ -345,17 +345,17 @@ ) ;; definition for method 3 of type sp-queued-launch-particles -(defmethod inspect sp-queued-launch-particles ((obj sp-queued-launch-particles)) - (when (not obj) - (set! obj obj) +(defmethod inspect sp-queued-launch-particles ((this sp-queued-launch-particles)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sp-queued-launch-particles) - (format #t "~1Tsp-system: ~A~%" (-> obj sp-system)) - (format #t "~1Tsp-launcher: ~A~%" (-> obj sp-launcher)) - (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this 'sp-queued-launch-particles) + (format #t "~1Tsp-system: ~A~%" (-> this sp-system)) + (format #t "~1Tsp-launcher: ~A~%" (-> this sp-launcher)) + (format #t "~1Tpos: #~%" (-> this pos)) (label cfg-4) - obj + this ) ;; definition of type sp-launch-queue @@ -369,16 +369,16 @@ ) ;; definition for method 3 of type sp-launch-queue -(defmethod inspect sp-launch-queue ((obj sp-launch-queue)) - (when (not obj) - (set! obj obj) +(defmethod inspect sp-launch-queue ((this sp-launch-queue)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tin-use: ~D~%" (-> obj in-use)) - (format #t "~1Tqueue[256] @ #x~X~%" (-> obj queue)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tin-use: ~D~%" (-> this in-use)) + (format #t "~1Tqueue[256] @ #x~X~%" (-> this queue)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -438,19 +438,19 @@ ) ;; definition for method 3 of type particle-adgif-cache -(defmethod inspect particle-adgif-cache ((obj particle-adgif-cache)) - (when (not obj) - (set! obj obj) +(defmethod inspect particle-adgif-cache ((this particle-adgif-cache)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tused: ~D~%" (-> obj used)) - (format #t "~1Tlast: ~D~%" (-> obj last)) - (format #t "~1Tlastgif: #~%" (-> obj lastgif)) - (format #t "~1Ttidhash[80] @ #x~X~%" (-> obj tidhash)) - (format #t "~1Tspadgif[80] @ #x~X~%" (-> obj spadgif)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tused: ~D~%" (-> this used)) + (format #t "~1Tlast: ~D~%" (-> this last)) + (format #t "~1Tlastgif: #~%" (-> this lastgif)) + (format #t "~1Ttidhash[80] @ #x~X~%" (-> this tidhash)) + (format #t "~1Tspadgif[80] @ #x~X~%" (-> this spadgif)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -699,30 +699,30 @@ ;; definition for method 3 of type sp-launch-stack ;; INFO: Used lq/sq -(defmethod inspect sp-launch-stack ((obj sp-launch-stack)) - (when (not obj) - (set! obj obj) +(defmethod inspect sp-launch-stack ((this sp-launch-stack)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sp-launch-stack) - (format #t "~1Tra: ~A~%" (-> obj ra)) - (format #t "~1Tdummy0: ~A~%" (-> obj dummy0)) - (format #t "~1Tdummy1: ~A~%" (-> obj dummy1)) - (format #t "~1Tb-spfic: ~A~%" (-> obj b-spfic)) - (format #t "~1Tr16: ~D~%" (-> obj r16)) - (format #t "~1Tr17: ~D~%" (-> obj r17)) - (format #t "~1Tr18: ~D~%" (-> obj r18)) - (format #t "~1Tpos: ~D~%" (-> obj pos)) - (format #t "~1Tmatrix: #~%" (-> obj matrix)) - (format #t "~1Tl-spfic: ~A~%" (-> obj l-spfic)) - (format #t "~1Tbirth-info: #~%" (-> obj birth-info)) - (format #t "~1Tsprite: #~%" (-> obj sprite)) - (format #t "~1Tr19: ~D~%" (-> obj r19)) - (format #t "~1Tr20: ~D~%" (-> obj r20)) - (format #t "~1Tr21: ~D~%" (-> obj r21)) - (format #t "~1Tr22: ~D~%" (-> obj r22)) + (format #t "[~8x] ~A~%" this 'sp-launch-stack) + (format #t "~1Tra: ~A~%" (-> this ra)) + (format #t "~1Tdummy0: ~A~%" (-> this dummy0)) + (format #t "~1Tdummy1: ~A~%" (-> this dummy1)) + (format #t "~1Tb-spfic: ~A~%" (-> this b-spfic)) + (format #t "~1Tr16: ~D~%" (-> this r16)) + (format #t "~1Tr17: ~D~%" (-> this r17)) + (format #t "~1Tr18: ~D~%" (-> this r18)) + (format #t "~1Tpos: ~D~%" (-> this pos)) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tl-spfic: ~A~%" (-> this l-spfic)) + (format #t "~1Tbirth-info: #~%" (-> this birth-info)) + (format #t "~1Tsprite: #~%" (-> this sprite)) + (format #t "~1Tr19: ~D~%" (-> this r19)) + (format #t "~1Tr20: ~D~%" (-> this r20)) + (format #t "~1Tr21: ~D~%" (-> this r21)) + (format #t "~1Tr22: ~D~%" (-> this r22)) (label cfg-4) - obj + this ) ;; definition for function sp-launch-particles-var @@ -1031,18 +1031,18 @@ ;; definition for method 9 of type sparticle-launch-control ;; WARN: Return type mismatch int vs none. -(defmethod initialize sparticle-launch-control ((obj sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) +(defmethod initialize sparticle-launch-control ((this sparticle-launch-control) (arg0 sparticle-launch-group) (arg1 process)) (let ((s5-0 0)) - (set! (-> obj group) arg0) - (set! (-> obj proc) (the-as process-drawable arg1)) - (set! (-> obj local-clock) 0) - (set! (-> obj fade) 1.0) - (set! (-> obj matrix) 0) - (set! (-> obj last-spawn-frame) (the-as int (+ (-> *display* real-frame-clock integral-frame-counter) -2))) - (set! (-> obj last-spawn-time) 0) - (if (logtest? (-> obj group flags) (sp-group-flag unk-4)) - (quaternion->matrix (-> obj origin) (-> (the-as process-drawable arg1) root quat)) - (matrix-identity! (-> obj origin)) + (set! (-> this group) arg0) + (set! (-> this proc) (the-as process-drawable arg1)) + (set! (-> this local-clock) 0) + (set! (-> this fade) 1.0) + (set! (-> this matrix) 0) + (set! (-> this last-spawn-frame) (the-as int (+ (-> *display* real-frame-clock integral-frame-counter) -2))) + (set! (-> this last-spawn-time) 0) + (if (logtest? (-> this group flags) (sp-group-flag unk-4)) + (quaternion->matrix (-> this origin) (-> (the-as process-drawable arg1) root quat)) + (matrix-identity! (-> this origin)) ) (when (logtest? (-> arg0 flags) (sp-group-flag unk-6)) (let ((f0-1 (-> arg0 rotate-x)) @@ -1057,7 +1057,7 @@ (set! (-> a1-2 z) f2-0) (set! (-> a1-2 w) 1.0) (let ((a1-3 (t9-2 a0-3 a1-2))) - (matrix*! (-> obj origin) a1-3 (-> obj origin)) + (matrix*! (-> this origin) a1-3 (-> this origin)) ) ) ) @@ -1068,13 +1068,13 @@ (set! (-> a1-4 z) (-> arg0 scale-z)) (set! (-> a1-4 w) 1.0) (set! (-> a1-4 w) 1.0) - (scale-matrix! (-> obj origin) a1-4 (-> obj origin)) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) ) ) (dotimes (s3-0 (-> arg0 length)) (let* ((a0-7 (-> arg0 launcher s3-0)) (a1-6 (-> *part-id-table* (-> a0-7 launcher))) - (v1-29 (-> obj data s5-0)) + (v1-29 (-> this data s5-0)) ) (when (nonzero? a1-6) (set! (-> v1-29 group-item) a0-7) @@ -1093,7 +1093,7 @@ ) (else (logior! (-> v1-29 flags) (sp-launch-state-flags launcher-active)) - (set! (-> v1-29 center) (-> obj origin trans)) + (set! (-> v1-29 center) (-> this origin trans)) (set! (-> v1-29 sprite3d) #f) (set! (-> v1-29 sprite) #f) ) @@ -1107,7 +1107,7 @@ ) ) ) - (set! (-> obj length) s5-0) + (set! (-> this length) s5-0) ) 0 (none) @@ -1115,14 +1115,14 @@ ;; definition for method 9 of type sparticle-launch-group ;; WARN: Return type mismatch object vs sparticle-launch-control. -(defmethod create-launch-control sparticle-launch-group ((obj sparticle-launch-group) (arg0 process)) - (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> obj length))))) +(defmethod create-launch-control sparticle-launch-group ((this sparticle-launch-group) (arg0 process)) + (let ((gp-0 (the-as object (new 'process 'sparticle-launch-control (-> this length))))) (when (zero? (the-as sparticle-launch-control gp-0)) (go process-drawable-art-error "memory") (set! gp-0 0) (goto cfg-4) ) - (initialize (the-as sparticle-launch-control gp-0) obj arg0) + (initialize (the-as sparticle-launch-control gp-0) this arg0) (label cfg-4) (the-as sparticle-launch-control gp-0) ) @@ -1130,17 +1130,17 @@ ;; definition for method 14 of type sparticle-launch-control ;; WARN: Return type mismatch int vs none. -(defmethod kill-and-free-particles sparticle-launch-control ((obj sparticle-launch-control)) - (countdown (v1-0 (-> obj length)) - (let ((a0-4 (-> obj data v1-0))) +(defmethod kill-and-free-particles sparticle-launch-control ((this sparticle-launch-control)) + (countdown (v1-0 (-> this length)) + (let ((a0-4 (-> this data v1-0))) (logclear! (-> a0-4 flags) (sp-launch-state-flags particles-active)) ) ) - (set! (-> obj local-clock) 0) - (set! (-> obj fade) 1.0) - (kill-all-particles-with-key obj) - (if (> (-> obj matrix) 0) - (sprite-release-user-hvdf (-> obj matrix)) + (set! (-> this local-clock) 0) + (set! (-> this fade) 1.0) + (kill-all-particles-with-key this) + (if (> (-> this matrix) 0) + (sprite-release-user-hvdf (-> this matrix)) ) 0 (none) @@ -1148,28 +1148,31 @@ ;; definition for method 15 of type sparticle-launch-control ;; WARN: Return type mismatch int vs none. -(defmethod kill-particles sparticle-launch-control ((obj sparticle-launch-control)) - (kill-all-particles-with-key obj) +(defmethod kill-particles sparticle-launch-control ((this sparticle-launch-control)) + (kill-all-particles-with-key this) 0 (none) ) ;; definition for method 10 of type sparticle-launch-control -(defmethod is-visible? sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) - (let* ((v1-0 (-> obj group)) +(defmethod is-visible? sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) + (let* ((v1-0 (-> this group)) (f0-0 (-> v1-0 bounds r)) ) (cond ((= f0-0 0.0) #t ) - ((nonzero? (-> obj matrix)) + ((nonzero? (-> this matrix)) #t ) (else (let ((s5-1 (vector+! (new 'stack-no-clear 'vector) arg0 (the-as vector (-> v1-0 bounds))))) (set! (-> s5-1 w) f0-0) - (when (or *display-sprite-marks* *display-sprite-spheres* (and *display-actor-vis* (= (-> obj proc) *debug-actor*))) + (when (or *display-sprite-marks* + *display-sprite-spheres* + (and *display-actor-vis* (= (-> this proc) *debug-actor*)) + ) (add-debug-sphere *display-sprite-spheres* (bucket-id debug2) @@ -1177,7 +1180,7 @@ (-> s5-1 w) (new 'static 'rgba :g #xff :a #x80) ) - (add-debug-matrix *display-sprite-marks* (bucket-id debug2) (-> obj origin) (meters 2)) + (add-debug-matrix *display-sprite-marks* (bucket-id debug2) (-> this origin) (meters 2)) ) (sphere-in-view-frustum? (the-as sphere s5-1)) ) @@ -1188,8 +1191,8 @@ ;; definition for method 12 of type sparticle-launch-control ;; INFO: Used lq/sq -(defmethod spawn-with-matrix sparticle-launch-control ((obj sparticle-launch-control) (arg0 matrix)) - (let* ((a2-0 (-> obj origin)) +(defmethod spawn-with-matrix sparticle-launch-control ((this sparticle-launch-control) (arg0 matrix)) + (let* ((a2-0 (-> this origin)) (a3-0 arg0) (v1-0 (-> a3-0 quad 0)) (a0-1 (-> a3-0 quad 1)) @@ -1201,7 +1204,7 @@ (set! (-> a2-0 quad 2) a1-1) (set! (-> a2-0 trans quad) a3-1) ) - (let ((s4-0 (-> obj group))) + (let ((s4-0 (-> this group))) (when (logtest? (-> s4-0 flags) (sp-group-flag unk-6)) (let ((f0-0 (-> s4-0 rotate-x)) (f1-0 (-> s4-0 rotate-y)) @@ -1215,7 +1218,7 @@ (set! (-> a1-2 z) f2-0) (set! (-> a1-2 w) 1.0) (let ((a1-3 (t9-0 a0-2 a1-2))) - (matrix*! (-> obj origin) a1-3 (-> obj origin)) + (matrix*! (-> this origin) a1-3 (-> this origin)) ) ) ) @@ -1226,18 +1229,18 @@ (set! (-> a1-4 z) (-> s4-0 scale-z)) (set! (-> a1-4 w) 1.0) (set! (-> a1-4 w) 1.0) - (scale-matrix! (-> obj origin) a1-4 (-> obj origin)) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) ) ) ) - (spawn obj (-> arg0 trans)) + (spawn this (-> arg0 trans)) (none) ) ;; definition for method 13 of type sparticle-launch-control ;; INFO: Used lq/sq -(defmethod spawn-with-cspace sparticle-launch-control ((obj sparticle-launch-control) (arg0 cspace)) - (let* ((v1-0 (-> obj origin)) +(defmethod spawn-with-cspace sparticle-launch-control ((this sparticle-launch-control) (arg0 cspace)) + (let* ((v1-0 (-> this origin)) (a3-0 (-> arg0 bone transform)) (a0-2 (-> a3-0 quad 0)) (a1-1 (-> a3-0 quad 1)) @@ -1249,7 +1252,7 @@ (set! (-> v1-0 quad 2) a2-0) (set! (-> v1-0 trans quad) a3-1) ) - (let ((s4-0 (-> obj group))) + (let ((s4-0 (-> this group))) (when (logtest? (-> s4-0 flags) (sp-group-flag unk-6)) (let ((f0-0 (-> s4-0 rotate-x)) (f1-0 (-> s4-0 rotate-y)) @@ -1263,7 +1266,7 @@ (set! (-> a1-2 z) f2-0) (set! (-> a1-2 w) 1.0) (let ((a1-3 (t9-0 a0-3 a1-2))) - (matrix*! (-> obj origin) a1-3 (-> obj origin)) + (matrix*! (-> this origin) a1-3 (-> this origin)) ) ) ) @@ -1274,11 +1277,11 @@ (set! (-> a1-4 z) (-> s4-0 scale-z)) (set! (-> a1-4 w) 1.0) (set! (-> a1-4 w) 1.0) - (scale-matrix! (-> obj origin) a1-4 (-> obj origin)) + (scale-matrix! (-> this origin) a1-4 (-> this origin)) ) ) ) - (spawn obj (vector<-cspace! (-> obj origin trans) arg0)) + (spawn this (vector<-cspace! (-> this origin trans) arg0)) (none) ) @@ -1286,26 +1289,26 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 11 sparticle-launch-control) has a return type of none, but the expression builder found a return statement. -(defmethod spawn sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) +(defmethod spawn sparticle-launch-control ((this sparticle-launch-control) (arg0 vector)) (with-pp - (set! (-> obj origin trans quad) (-> arg0 quad)) - (if (not (or (is-visible? obj arg0) (logtest? (-> obj group flags) (sp-group-flag always-draw screen-space)))) + (set! (-> this origin trans quad) (-> arg0 quad)) + (if (not (or (is-visible? this arg0) (logtest? (-> this group flags) (sp-group-flag always-draw screen-space)))) (return 0) ) (let ((s4-0 (the-as int (current-time))) - (s5-0 (-> obj last-spawn-time)) + (s5-0 (-> this last-spawn-time)) ) (let ((v1-10 (-> *display* real-frame-clock integral-frame-counter))) - (if (!= v1-10 (+ (-> obj last-spawn-frame) 1)) + (if (!= v1-10 (+ (-> this last-spawn-frame) 1)) (set! s5-0 (the-as int (- (the-as time-frame s4-0) (logand (the-as int (-> pp clock sparticle-data x)) 255)))) ) ) - (set! (-> obj last-spawn-frame) (the-as int (-> *display* real-frame-clock integral-frame-counter))) - (set! (-> obj last-spawn-time) s4-0) - (when (logtest? (-> obj group flags) (sp-group-flag use-local-clock)) - (set! s5-0 (-> obj local-clock)) - (+! (-> obj local-clock) (logand (the-as int (-> pp clock sparticle-data x)) 255)) - (set! s4-0 (-> obj local-clock)) + (set! (-> this last-spawn-frame) (the-as int (-> *display* real-frame-clock integral-frame-counter))) + (set! (-> this last-spawn-time) s4-0) + (when (logtest? (-> this group flags) (sp-group-flag use-local-clock)) + (set! s5-0 (-> this local-clock)) + (+! (-> this local-clock) (logand (the-as int (-> pp clock sparticle-data x)) 255)) + (set! s4-0 (-> this local-clock)) ) (let* ((f30-0 (vector-vector-distance arg0 (math-camera-pos))) (v1-26 1) @@ -1317,14 +1320,14 @@ ) ) ) - (if (nonzero? (-> obj matrix)) + (if (nonzero? (-> this matrix)) (set! f30-0 0.0) ) - (let ((s2-1 (-> obj length))) + (let ((s2-1 (-> this length))) (b! #t cfg-95 :delay (nop!)) (label cfg-19) (+! s2-1 -1) - (let* ((a3-0 (-> obj data s2-1)) + (let* ((a3-0 (-> this data s2-1)) (v1-33 (-> a3-0 group-item)) (a1-4 (-> *part-id-table* (-> v1-33 launcher))) ) @@ -1356,7 +1359,7 @@ (label cfg-35) (set! a0-36 *sp-particle-system-2d*) (label cfg-36) - (t9-3 a0-36 a1-4 (-> obj origin) a3-0 obj f0-5) + (t9-3 a0-36 a1-4 (-> this origin) a3-0 this f0-5) ) ) (b! #t cfg-41 :delay (nop!)) @@ -1370,7 +1373,7 @@ (a2-4 *launch-matrix*) ) (set! (-> a2-4 trans quad) (-> a3-0 center quad)) - (t9-4 a0-38 a1-4 a2-4 a3-0 obj f0-5) + (t9-4 a0-38 a1-4 a2-4 a3-0 this f0-5) ) ) ) @@ -1393,8 +1396,8 @@ 0 (let* ((a2-5 (-> v1-33 length)) (a0-57 (-> v1-33 period)) - (t0-10 (mod (+ (- s5-0 (the-as int (-> obj data s2-1 offset))) a0-57) (the-as int a0-57))) - (a0-58 (mod (the-as uint (+ (- s4-0 (the-as int (-> obj data s2-1 offset))) a0-57)) a0-57)) + (t0-10 (mod (+ (- s5-0 (the-as int (-> this data s2-1 offset))) a0-57) (the-as int a0-57))) + (a0-58 (mod (the-as uint (+ (- s4-0 (the-as int (-> this data s2-1 offset))) a0-57)) a0-57)) ) (set! f0-5 (cond ((and (< t0-10 (the-as int a2-5)) (< (the-as int a0-58) (the-as int a2-5))) @@ -1411,11 +1414,11 @@ 0 (goto cfg-93) ) - (when (< (the-as uint (- s4-0 (the-as int (-> obj data s2-1 spawn-time)))) (-> v1-33 period)) + (when (< (the-as uint (- s4-0 (the-as int (-> this data s2-1 spawn-time)))) (-> v1-33 period)) 0 (goto cfg-93) ) - (set! (-> obj data s2-1 offset) (- (-> v1-33 period) a0-58)) + (set! (-> this data s2-1 offset) (- (-> v1-33 period) a0-58)) (* 0.2 (the float (- s4-0 s5-0)) f0-5) ) ) @@ -1436,9 +1439,9 @@ *sp-particle-system-2d* ) a1-4 - (-> obj origin) + (-> this origin) :launch-state a3-0 - :launch-control obj + :launch-control this :rate f0-5 :origin-is-matrix #t ) @@ -1453,7 +1456,7 @@ (a2-22 *launch-matrix*) ) (set! (-> a2-22 trans quad) (-> a3-0 center quad)) - (t9-6 a0-83 a1-4 a2-22 a3-0 obj f0-5) + (t9-6 a0-83 a1-4 a2-22 a3-0 this f0-5) ) ) ) @@ -2318,14 +2321,14 @@ ;; definition for method 9 of type sparticle-launcher ;; WARN: new jak 2 until loop case, check carefully -(defmethod get-field-spec-by-id sparticle-launcher ((obj sparticle-launcher) (arg0 sp-field-id)) +(defmethod get-field-spec-by-id sparticle-launcher ((this sparticle-launcher) (arg0 sp-field-id)) "Returns the [[sp-field-init-spec]] that has the matching [[sp-field-id]]" (let ((v1-0 0)) (until #f - (let ((a2-2 (-> obj init-specs v1-0 field))) + (let ((a2-2 (-> this init-specs v1-0 field))) (cond ((= a2-2 arg0) - (return (-> obj init-specs v1-0)) + (return (-> this init-specs v1-0)) ) ((or (< (the-as uint arg0) (the-as uint a2-2)) (= a2-2 (sp-field-id spt-end))) (return (the-as sp-field-init-spec #f)) @@ -2342,15 +2345,15 @@ ;; definition for method 10 of type sparticle-launcher ;; WARN: Return type mismatch int vs none. -(defmethod setup-user-array sparticle-launcher ((obj sparticle-launcher) (arg0 string)) - (let ((s5-0 (get-field-spec-by-id obj (sp-field-id spt-texture))) +(defmethod setup-user-array sparticle-launcher ((this sparticle-launcher) (arg0 string)) + (let ((s5-0 (get-field-spec-by-id this (sp-field-id spt-texture))) (v1-1 (lookup-texture-id-by-name arg0 (the-as string #f))) ) (if s5-0 (set! (-> s5-0 initial-valuef) (the-as float v1-1)) ) ) - (let ((v1-3 (get-field-spec-by-id obj (sp-field-id spt-userdata)))) + (let ((v1-3 (get-field-spec-by-id this (sp-field-id spt-userdata)))) (when (and v1-3 (= (-> v1-3 flags) (sp-flag object))) (let ((gp-1 (the-as object (-> v1-3 initial-valuef)))) (when (and (= (logand (the-as int gp-1) 7) 4) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc index 1a4111ff6b..eee6e225a9 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle_REF.gc @@ -3,13 +3,13 @@ ;; definition for method 2 of type sparticle-cpuinfo ;; WARN: Return type mismatch object vs sparticle-cpuinfo. -(defmethod print sparticle-cpuinfo ((obj sparticle-cpuinfo)) +(defmethod print sparticle-cpuinfo ((this sparticle-cpuinfo)) (format #t "~%") (dotimes (s5-0 16) - (format #t "~D:~F~%" s5-0 (the-as float (-> obj data s5-0))) + (format #t "~D:~F~%" s5-0 (the-as float (-> this data s5-0))) ) - (format #t "TIMER:~D~%" (-> obj timer)) - (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> obj flags))) + (format #t "TIMER:~D~%" (-> this timer)) + (the-as sparticle-cpuinfo (format #t "FLAGS:~X~%" (-> this flags))) ) ;; definition for function sp-particle-copy! diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc index e249b1a6d8..87019083e1 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc @@ -25,34 +25,34 @@ ) ;; definition for method 3 of type sprite-glow-data -(defmethod inspect sprite-glow-data ((obj sprite-glow-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-glow-data ((this sprite-glow-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-glow-data) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tsize-x: ~f~%" (-> obj position w)) - (format #t "~1Tsize-probe: ~f~%" (-> obj size-probe)) - (format #t "~1Tz-offset: ~f~%" (-> obj z-offset)) - (format #t "~1Trot-angle: ~f~%" (-> obj rot-angle)) - (format #t "~1Tsize-y: ~f~%" (-> obj size-y)) - (format #t "~1Tcolor: #~%" (-> obj color)) - (format #t "~1Tfade-a: ~f~%" (-> obj fade-a)) - (format #t "~1Tfade-b: ~f~%" (-> obj fade-b)) - (format #t "~1Ttex-id: ~D~%" (-> obj tex-id)) - (format #t "~1Tdummy: ~D~%" (-> obj dummy)) + (format #t "[~8x] ~A~%" this 'sprite-glow-data) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tsize-x: ~f~%" (-> this position w)) + (format #t "~1Tsize-probe: ~f~%" (-> this size-probe)) + (format #t "~1Tz-offset: ~f~%" (-> this z-offset)) + (format #t "~1Trot-angle: ~f~%" (-> this rot-angle)) + (format #t "~1Tsize-y: ~f~%" (-> this size-y)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Tfade-a: ~f~%" (-> this fade-a)) + (format #t "~1Tfade-b: ~f~%" (-> this fade-b)) + (format #t "~1Ttex-id: ~D~%" (-> this tex-id)) + (format #t "~1Tdummy: ~D~%" (-> this dummy)) (label cfg-4) - obj + this ) ;; definition for method 9 of type sprite-glow-data ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-trans sprite-glow-data ((obj sprite-glow-data) (arg0 vector)) - (let ((f0-0 (-> obj position w))) - (set! (-> obj position quad) (-> arg0 quad)) - (set! (-> obj position w) f0-0) +(defmethod set-trans sprite-glow-data ((this sprite-glow-data) (arg0 vector)) + (let ((f0-0 (-> this position w))) + (set! (-> this position quad) (-> arg0 quad)) + (set! (-> this position w) f0-0) ) 0 (none) @@ -75,17 +75,17 @@ ) ;; definition for method 3 of type simple-sprite-system -(defmethod inspect simple-sprite-system ((obj simple-sprite-system)) - (when (not obj) - (set! obj obj) +(defmethod inspect simple-sprite-system ((this simple-sprite-system)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'simple-sprite-system) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tmax-count: ~D~%" (-> obj max-count)) - (format #t "~1Tdata: #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'simple-sprite-system) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tmax-count: ~D~%" (-> this max-count)) + (format #t "~1Tdata: #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc index 99ebf87659..12e223f19b 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-distort_REF.gc @@ -16,20 +16,20 @@ ) ;; definition for method 3 of type sprite-distorter-sine-tables -(defmethod inspect sprite-distorter-sine-tables ((obj sprite-distorter-sine-tables)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-distorter-sine-tables ((this sprite-distorter-sine-tables)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Taspx: ~f~%" (-> obj aspx)) - (format #t "~1Taspy: ~f~%" (-> obj aspy)) - (format #t "~1Tentry[128] @ #x~X~%" (-> obj entry)) - (format #t "~1Tientry[9] @ #x~X~%" (-> obj ientry)) - (format #t "~1Tgiftag: #~%" (-> obj giftag)) - (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Taspx: ~f~%" (-> this aspx)) + (format #t "~1Taspy: ~f~%" (-> this aspy)) + (format #t "~1Tentry[128] @ #x~X~%" (-> this entry)) + (format #t "~1Tientry[9] @ #x~X~%" (-> this ientry)) + (format #t "~1Tgiftag: #~%" (-> this giftag)) + (format #t "~1Tcolor: #~%" (-> this color)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -121,7 +121,6 @@ ;; definition for function sprite-init-distorter ;; WARN: Return type mismatch int vs none. -;; ERROR: Failed store: (s.w! (+ a1-0 8) 0) at op 4 (defun sprite-init-distorter ((dma-buff dma-buffer)) (dma-buffer-add-gs-set dma-buff (zbuf-1 (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24) :zmsk #x1)) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc index a29b5c2e71..48293aed62 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-glow_REF.gc @@ -46,50 +46,50 @@ ) ;; definition for method 3 of type sprite-glow-template -(defmethod inspect sprite-glow-template ((obj sprite-glow-template)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-glow-template ((this sprite-glow-template)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-glow-template) - (format #t "~1Tclear-init-giftag: #~%" (-> obj clear-init-giftag)) - (format #t "~1Tclear-init-adcmds[5] @ #x~X~%" (-> obj clear-init-adcmds)) - (format #t "~1Tclear-draw-giftag: #~%" (-> obj clear-draw-giftag)) - (format #t "~1Tclear-draw-clr-0: #~%" (-> obj clear-draw-clr-0)) - (format #t "~1Tclear-draw-xyz-0[2] @ #x~X~%" (-> obj clear-draw-xyz-0)) - (format #t "~1Tclear-draw-clr-1: #~%" (-> obj clear-draw-clr-1)) - (format #t "~1Tclear-draw-xyz-1[2] @ #x~X~%" (-> obj clear-draw-xyz-1)) - (format #t "~1Toffscr-setup-giftag: #~%" (-> obj offscr-setup-giftag)) - (format #t "~1Toffscr-setup-adcmds[8] @ #x~X~%" (-> obj offscr-setup-adcmds)) - (format #t "~1Toffscr-first-giftag: #~%" (-> obj offscr-first-giftag)) - (format #t "~1Toffscr-first-clr: #~%" (-> obj offscr-first-clr)) - (format #t "~1Toffscr-first-uv-0: #~%" (-> obj offscr-first-uv-0)) - (format #t "~1Toffscr-first-xyzw-0: #~%" (-> obj offscr-first-xyzw-0)) - (format #t "~1Toffscr-first-uv-1: #~%" (-> obj offscr-first-uv-1)) - (format #t "~1Toffscr-first-xyzw-1: #~%" (-> obj offscr-first-xyzw-1)) - (format #t "~1Trepeat-draw-giftag: #~%" (-> obj repeat-draw-giftag)) - (format #t "~1Trepeat-draw-adcmds[29] @ #x~X~%" (-> obj repeat-draw-adcmds)) - (format #t "~1Tflare-alpha-giftag: #~%" (-> obj flare-alpha-giftag)) - (format #t "~1Tflare-alpha-clr: #~%" (-> obj flare-alpha-clr)) - (format #t "~1Tflare-alpha-uv: #~%" (-> obj flare-alpha-uv)) - (format #t "~1Tflare-alpha-xyzw-0: #~%" (-> obj flare-alpha-xyzw-0)) - (format #t "~1Tflare-alpha-xyzw-1: #~%" (-> obj flare-alpha-xyzw-1)) - (format #t "~1Tflare-alpha-xyzw-2: #~%" (-> obj flare-alpha-xyzw-2)) - (format #t "~1Tflare-alpha-xyzw-3: #~%" (-> obj flare-alpha-xyzw-3)) - (format #t "~1Tflare-init-giftag: #~%" (-> obj flare-init-giftag)) - (format #t "~1Tflare-init-adcmds[8] @ #x~X~%" (-> obj flare-init-adcmds)) - (format #t "~1Tflare-draw-giftag: #~%" (-> obj flare-draw-giftag)) - (format #t "~1Tflare-draw-clr: #~%" (-> obj flare-draw-clr)) - (format #t "~1Tflare-draw-stq-0: #~%" (-> obj flare-draw-stq-0)) - (format #t "~1Tflare-draw-xyzw-0: #~%" (-> obj flare-draw-xyzw-0)) - (format #t "~1Tflare-draw-stq-1: #~%" (-> obj flare-draw-stq-1)) - (format #t "~1Tflare-draw-xyzw-1: #~%" (-> obj flare-draw-xyzw-1)) - (format #t "~1Tflare-draw-stq-2: #~%" (-> obj flare-draw-stq-2)) - (format #t "~1Tflare-draw-xyzw-2: #~%" (-> obj flare-draw-xyzw-2)) - (format #t "~1Tflare-draw-stq-3: #~%" (-> obj flare-draw-stq-3)) - (format #t "~1Tflare-draw-xyzw-3: #~%" (-> obj flare-draw-xyzw-3)) + (format #t "[~8x] ~A~%" this 'sprite-glow-template) + (format #t "~1Tclear-init-giftag: #~%" (-> this clear-init-giftag)) + (format #t "~1Tclear-init-adcmds[5] @ #x~X~%" (-> this clear-init-adcmds)) + (format #t "~1Tclear-draw-giftag: #~%" (-> this clear-draw-giftag)) + (format #t "~1Tclear-draw-clr-0: #~%" (-> this clear-draw-clr-0)) + (format #t "~1Tclear-draw-xyz-0[2] @ #x~X~%" (-> this clear-draw-xyz-0)) + (format #t "~1Tclear-draw-clr-1: #~%" (-> this clear-draw-clr-1)) + (format #t "~1Tclear-draw-xyz-1[2] @ #x~X~%" (-> this clear-draw-xyz-1)) + (format #t "~1Toffscr-setup-giftag: #~%" (-> this offscr-setup-giftag)) + (format #t "~1Toffscr-setup-adcmds[8] @ #x~X~%" (-> this offscr-setup-adcmds)) + (format #t "~1Toffscr-first-giftag: #~%" (-> this offscr-first-giftag)) + (format #t "~1Toffscr-first-clr: #~%" (-> this offscr-first-clr)) + (format #t "~1Toffscr-first-uv-0: #~%" (-> this offscr-first-uv-0)) + (format #t "~1Toffscr-first-xyzw-0: #~%" (-> this offscr-first-xyzw-0)) + (format #t "~1Toffscr-first-uv-1: #~%" (-> this offscr-first-uv-1)) + (format #t "~1Toffscr-first-xyzw-1: #~%" (-> this offscr-first-xyzw-1)) + (format #t "~1Trepeat-draw-giftag: #~%" (-> this repeat-draw-giftag)) + (format #t "~1Trepeat-draw-adcmds[29] @ #x~X~%" (-> this repeat-draw-adcmds)) + (format #t "~1Tflare-alpha-giftag: #~%" (-> this flare-alpha-giftag)) + (format #t "~1Tflare-alpha-clr: #~%" (-> this flare-alpha-clr)) + (format #t "~1Tflare-alpha-uv: #~%" (-> this flare-alpha-uv)) + (format #t "~1Tflare-alpha-xyzw-0: #~%" (-> this flare-alpha-xyzw-0)) + (format #t "~1Tflare-alpha-xyzw-1: #~%" (-> this flare-alpha-xyzw-1)) + (format #t "~1Tflare-alpha-xyzw-2: #~%" (-> this flare-alpha-xyzw-2)) + (format #t "~1Tflare-alpha-xyzw-3: #~%" (-> this flare-alpha-xyzw-3)) + (format #t "~1Tflare-init-giftag: #~%" (-> this flare-init-giftag)) + (format #t "~1Tflare-init-adcmds[8] @ #x~X~%" (-> this flare-init-adcmds)) + (format #t "~1Tflare-draw-giftag: #~%" (-> this flare-draw-giftag)) + (format #t "~1Tflare-draw-clr: #~%" (-> this flare-draw-clr)) + (format #t "~1Tflare-draw-stq-0: #~%" (-> this flare-draw-stq-0)) + (format #t "~1Tflare-draw-xyzw-0: #~%" (-> this flare-draw-xyzw-0)) + (format #t "~1Tflare-draw-stq-1: #~%" (-> this flare-draw-stq-1)) + (format #t "~1Tflare-draw-xyzw-1: #~%" (-> this flare-draw-xyzw-1)) + (format #t "~1Tflare-draw-stq-2: #~%" (-> this flare-draw-stq-2)) + (format #t "~1Tflare-draw-xyzw-2: #~%" (-> this flare-draw-xyzw-2)) + (format #t "~1Tflare-draw-stq-3: #~%" (-> this flare-draw-stq-3)) + (format #t "~1Tflare-draw-xyzw-3: #~%" (-> this flare-draw-xyzw-3)) (label cfg-4) - obj + this ) ;; definition of type sprite-glow-consts @@ -120,33 +120,33 @@ ) ;; definition for method 3 of type sprite-glow-consts -(defmethod inspect sprite-glow-consts ((obj sprite-glow-consts)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-glow-consts ((this sprite-glow-consts)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-glow-consts) - (format #t "~1Tcamera: #~%" (-> obj camera)) - (format #t "~1Tperspective: #~%" (-> obj perspective)) - (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) - (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~1Tconsts: #~%" (&-> obj pfog0)) - (format #t "~1Tpfog0: ~f~%" (-> obj pfog0)) - (format #t "~1Tdeg-to-rad: ~f~%" (-> obj deg-to-rad)) - (format #t "~1Tmin-scale: ~f~%" (-> obj min-scale)) - (format #t "~1Tinv-area: ~f~%" (-> obj inv-area)) - (format #t "~1Tsincos-01: #~%" (-> obj sincos-01)) - (format #t "~1Tsincos-23: #~%" (-> obj sincos-23)) - (format #t "~1Tsincos-45: #~%" (-> obj sincos-45)) - (format #t "~1Tsincos-67: #~%" (-> obj sincos-67)) - (format #t "~1Tsincos-89: #~%" (-> obj sincos-89)) - (format #t "~1Tbasis-x: #~%" (-> obj basis-x)) - (format #t "~1Tbasis-y: #~%" (-> obj basis-y)) - (format #t "~1Txy-array[4] @ #x~X~%" (-> obj xy-array)) - (format #t "~1Tclamp-min: #~%" (-> obj clamp-min)) - (format #t "~1Tclamp-max: #~%" (-> obj clamp-max)) + (format #t "[~8x] ~A~%" this 'sprite-glow-consts) + (format #t "~1Tcamera: #~%" (-> this camera)) + (format #t "~1Tperspective: #~%" (-> this perspective)) + (format #t "~1Thvdf-offset: #~%" (-> this hvdf-offset)) + (format #t "~1Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~1Tconsts: #~%" (&-> this pfog0)) + (format #t "~1Tpfog0: ~f~%" (-> this pfog0)) + (format #t "~1Tdeg-to-rad: ~f~%" (-> this deg-to-rad)) + (format #t "~1Tmin-scale: ~f~%" (-> this min-scale)) + (format #t "~1Tinv-area: ~f~%" (-> this inv-area)) + (format #t "~1Tsincos-01: #~%" (-> this sincos-01)) + (format #t "~1Tsincos-23: #~%" (-> this sincos-23)) + (format #t "~1Tsincos-45: #~%" (-> this sincos-45)) + (format #t "~1Tsincos-67: #~%" (-> this sincos-67)) + (format #t "~1Tsincos-89: #~%" (-> this sincos-89)) + (format #t "~1Tbasis-x: #~%" (-> this basis-x)) + (format #t "~1Tbasis-y: #~%" (-> this basis-y)) + (format #t "~1Txy-array[4] @ #x~X~%" (-> this xy-array)) + (format #t "~1Tclamp-min: #~%" (-> this clamp-min)) + (format #t "~1Tclamp-max: #~%" (-> this clamp-max)) (label cfg-4) - obj + this ) ;; definition for symbol *sprite-glow-template*, type sprite-glow-template @@ -453,19 +453,19 @@ ) ;; definition for method 3 of type sprite-glow-dma-packet-data -(defmethod inspect sprite-glow-dma-packet-data ((obj sprite-glow-dma-packet-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-glow-dma-packet-data ((this sprite-glow-dma-packet-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-glow-dma-packet-data) - (format #t "~1Tcontrol-packet: #~%" (-> obj control-packet)) - (format #t "~1Tvecdata-packet: #~%" (-> obj vecdata-packet)) - (format #t "~1Tshader-cnt-packet: #~%" (-> obj shader-cnt-packet)) - (format #t "~1Tshader-ref-packet: #~%" (-> obj shader-ref-packet)) - (format #t "~1Tmscal-packet: #~%" (-> obj mscal-packet)) + (format #t "[~8x] ~A~%" this 'sprite-glow-dma-packet-data) + (format #t "~1Tcontrol-packet: #~%" (-> this control-packet)) + (format #t "~1Tvecdata-packet: #~%" (-> this vecdata-packet)) + (format #t "~1Tshader-cnt-packet: #~%" (-> this shader-cnt-packet)) + (format #t "~1Tshader-ref-packet: #~%" (-> this shader-ref-packet)) + (format #t "~1Tmscal-packet: #~%" (-> this mscal-packet)) (label cfg-4) - obj + this ) ;; definition of type sprite-glow-cnt-template @@ -486,22 +486,22 @@ ) ;; definition for method 3 of type sprite-glow-cnt-template -(defmethod inspect sprite-glow-cnt-template ((obj sprite-glow-cnt-template)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-glow-cnt-template ((this sprite-glow-cnt-template)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-glow-cnt-template) - (format #t "~1Tcontrol-packet: #~%" (-> obj control-packet)) - (format #t "~1Tnum-sprites: ~D~%" (-> obj num-sprites)) - (format #t "~1Tdummys[3] @ #x~X~%" (-> obj dummys)) - (format #t "~1Tvecdata-packet: #~%" (-> obj vecdata-packet)) - (format #t "~1Tvecdata: #~%" (-> obj vecdata)) - (format #t "~1Tshader-packet: #~%" (-> obj shader-packet)) - (format #t "~1Tshader: #~%" (-> obj shader)) - (format #t "~1Tmscal-packet: #~%" (-> obj mscal-packet)) + (format #t "[~8x] ~A~%" this 'sprite-glow-cnt-template) + (format #t "~1Tcontrol-packet: #~%" (-> this control-packet)) + (format #t "~1Tnum-sprites: ~D~%" (-> this num-sprites)) + (format #t "~1Tdummys[3] @ #x~X~%" (-> this dummys)) + (format #t "~1Tvecdata-packet: #~%" (-> this vecdata-packet)) + (format #t "~1Tvecdata: #~%" (-> this vecdata)) + (format #t "~1Tshader-packet: #~%" (-> this shader-packet)) + (format #t "~1Tshader: #~%" (-> this shader)) + (format #t "~1Tmscal-packet: #~%" (-> this mscal-packet)) (label cfg-4) - obj + this ) ;; definition of type sprite-glow-ref-template @@ -522,21 +522,21 @@ ) ;; definition for method 3 of type sprite-glow-ref-template -(defmethod inspect sprite-glow-ref-template ((obj sprite-glow-ref-template)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-glow-ref-template ((this sprite-glow-ref-template)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-glow-ref-template) - (format #t "~1Tcontrol-packet: #~%" (-> obj control-packet)) - (format #t "~1Tnum-sprites: ~D~%" (-> obj num-sprites)) - (format #t "~1Tdummys[3] @ #x~X~%" (-> obj dummys)) - (format #t "~1Tvecdata-packet: #~%" (-> obj vecdata-packet)) - (format #t "~1Tvecdata: #~%" (-> obj vecdata)) - (format #t "~1Tshader-packet: #~%" (-> obj shader-packet)) - (format #t "~1Tmscal-packet: #~%" (-> obj mscal-packet)) + (format #t "[~8x] ~A~%" this 'sprite-glow-ref-template) + (format #t "~1Tcontrol-packet: #~%" (-> this control-packet)) + (format #t "~1Tnum-sprites: ~D~%" (-> this num-sprites)) + (format #t "~1Tdummys[3] @ #x~X~%" (-> this dummys)) + (format #t "~1Tvecdata-packet: #~%" (-> this vecdata-packet)) + (format #t "~1Tvecdata: #~%" (-> this vecdata)) + (format #t "~1Tshader-packet: #~%" (-> this shader-packet)) + (format #t "~1Tmscal-packet: #~%" (-> this mscal-packet)) (label cfg-4) - obj + this ) ;; definition for symbol *sprite-glow-dma-packet-data*, type sprite-glow-dma-packet-data @@ -699,10 +699,10 @@ ;; definition for method 9 of type simple-sprite-system ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod add! simple-sprite-system ((obj simple-sprite-system) (arg0 sprite-glow-data)) - (let ((v1-0 (-> obj count))) - (when (< v1-0 (-> obj max-count)) - (let* ((a2-3 (-> obj data v1-0)) +(defmethod add! simple-sprite-system ((this simple-sprite-system) (arg0 sprite-glow-data)) + (let ((v1-0 (-> this count))) + (when (< v1-0 (-> this max-count)) + (let* ((a2-3 (-> this data v1-0)) (v1-2 arg0) (a1-1 a2-3) (a2-4 (-> v1-2 position quad)) @@ -715,7 +715,7 @@ (set! (-> a1-1 color quad) t0-0) (set! (-> a1-1 quads 3 quad) v1-3) ) - (+! (-> obj count) 1) + (+! (-> this count) 1) ) ) 0 @@ -742,16 +742,16 @@ ;; definition for method 10 of type simple-sprite-system ;; WARN: Return type mismatch int vs none. -(defmethod draw-all-sprites! simple-sprite-system ((obj simple-sprite-system) (arg0 dma-buffer)) +(defmethod draw-all-sprites! simple-sprite-system ((this simple-sprite-system) (arg0 dma-buffer)) (local-vars (sv-528 sprite-glow-dma-packet-data) (sv-532 (pointer texture-id)) (sv-536 pointer)) - (b! (zero? (-> obj count)) cfg-13 :delay (nop!)) + (b! (zero? (-> this count)) cfg-13 :delay (nop!)) (set! sv-528 *sprite-glow-dma-packet-data*) (set! sv-532 (new 'stack-no-clear 'array 'texture-id 128)) (set! sv-536 (-> arg0 base)) - (dotimes (v1-5 (-> obj count)) - (set! (-> sv-532 v1-5) (-> obj data v1-5 tex-id)) + (dotimes (v1-5 (-> this count)) + (set! (-> sv-532 v1-5) (-> this data v1-5 tex-id)) ) - (countdown (s4-0 (-> obj count)) + (countdown (s4-0 (-> this count)) (let ((s3-0 (-> sv-532 s4-0))) (when (nonzero? s3-0) (let ((s2-0 (add-shader-to-dma arg0))) @@ -759,7 +759,7 @@ (countdown (s1-1 (+ s4-0 1)) (when (= s3-0 (-> sv-532 s1-1)) (set! (-> sv-532 s1-1) (new 'static 'texture-id)) - (let ((a2-1 (-> obj data s1-1))) + (let ((a2-1 (-> this data s1-1))) (sprite-glow-add-simple-sprite arg0 sv-528 a2-1 (the-as pointer s2-0)) ) ) @@ -775,8 +775,8 @@ ;; definition for method 11 of type simple-sprite-system ;; WARN: Return type mismatch int vs none. -(defmethod clear! simple-sprite-system ((obj simple-sprite-system)) - (set! (-> obj count) 0) +(defmethod clear! simple-sprite-system ((this simple-sprite-system)) + (set! (-> this count) 0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc index 572be15b94..84c5f8df2d 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc @@ -30,34 +30,34 @@ ) ;; definition for method 3 of type sprite-vec-data-2d -(defmethod inspect sprite-vec-data-2d ((obj sprite-vec-data-2d)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-vec-data-2d ((this sprite-vec-data-2d)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-vec-data-2d) - (format #t "~1Tx-y-z-sx: #~%" (-> obj x-y-z-sx)) - (format #t "~1Tflag-rot-sy: #~%" (-> obj flag-rot-sy)) - (format #t "~1Tr-g-b-a: #~%" (-> obj r-g-b-a)) - (format #t "~1Tx: ~f~%" (-> obj x-y-z-sx x)) - (format #t "~1Ty: ~f~%" (-> obj x-y-z-sx y)) - (format #t "~1Tz: ~f~%" (-> obj x-y-z-sx z)) - (format #t "~1Tsx: ~f~%" (-> obj x-y-z-sx w)) - (format #t "~1Tsy: ~f~%" (-> obj flag-rot-sy w)) - (format #t "~1Trot: ~f~%" (-> obj flag-rot-sy z)) - (format #t "~1Tflag: ~D~%" (-> obj flag-rot-sy x)) - (format #t "~1Tmatrix: ~D~%" (-> obj flag-rot-sy y)) - (format #t "~1Twarp-turns: ~D~%" (-> obj flag-rot-sy x)) - (format #t "~1Tr: ~f~%" (-> obj r-g-b-a x)) - (format #t "~1Tg: ~f~%" (-> obj r-g-b-a y)) - (format #t "~1Tb: ~f~%" (-> obj r-g-b-a z)) - (format #t "~1Ta: ~f~%" (-> obj r-g-b-a w)) - (format #t "~1Ttrans: #~%" (-> obj x-y-z-sx)) - (format #t "~1Tcolor: #~%" (-> obj r-g-b-a)) - (format #t "~1Tdata[1] @ #x~X~%" (-> obj x-y-z-sx)) - (format #t "~1Tdata64[6] @ #x~X~%" (-> obj x-y-z-sx)) + (format #t "[~8x] ~A~%" this 'sprite-vec-data-2d) + (format #t "~1Tx-y-z-sx: #~%" (-> this x-y-z-sx)) + (format #t "~1Tflag-rot-sy: #~%" (-> this flag-rot-sy)) + (format #t "~1Tr-g-b-a: #~%" (-> this r-g-b-a)) + (format #t "~1Tx: ~f~%" (-> this x-y-z-sx x)) + (format #t "~1Ty: ~f~%" (-> this x-y-z-sx y)) + (format #t "~1Tz: ~f~%" (-> this x-y-z-sx z)) + (format #t "~1Tsx: ~f~%" (-> this x-y-z-sx w)) + (format #t "~1Tsy: ~f~%" (-> this flag-rot-sy w)) + (format #t "~1Trot: ~f~%" (-> this flag-rot-sy z)) + (format #t "~1Tflag: ~D~%" (-> this flag-rot-sy x)) + (format #t "~1Tmatrix: ~D~%" (-> this flag-rot-sy y)) + (format #t "~1Twarp-turns: ~D~%" (-> this flag-rot-sy x)) + (format #t "~1Tr: ~f~%" (-> this r-g-b-a x)) + (format #t "~1Tg: ~f~%" (-> this r-g-b-a y)) + (format #t "~1Tb: ~f~%" (-> this r-g-b-a z)) + (format #t "~1Ta: ~f~%" (-> this r-g-b-a w)) + (format #t "~1Ttrans: #~%" (-> this x-y-z-sx)) + (format #t "~1Tcolor: #~%" (-> this r-g-b-a)) + (format #t "~1Tdata[1] @ #x~X~%" (-> this x-y-z-sx)) + (format #t "~1Tdata64[6] @ #x~X~%" (-> this x-y-z-sx)) (label cfg-4) - obj + this ) ;; definition of type sprite-array-2d @@ -78,20 +78,20 @@ ) ;; definition for method 3 of type sprite-array-2d -(defmethod inspect sprite-array-2d ((obj sprite-array-2d)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-array-2d ((this sprite-array-2d)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnum-sprites[2] @ #x~X~%" (-> obj num-sprites)) - (format #t "~1Tnum-valid[2] @ #x~X~%" (-> obj num-valid)) - (format #t "~1Tvec-data: #x~X~%" (-> obj vec-data)) - (format #t "~1Tadgif-data: #x~X~%" (-> obj adgif-data)) - (format #t "~1Tpad[4] @ #x~X~%" (-> obj pad)) - (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-sprites[2] @ #x~X~%" (-> this num-sprites)) + (format #t "~1Tnum-valid[2] @ #x~X~%" (-> this num-valid)) + (format #t "~1Tvec-data: #x~X~%" (-> this vec-data)) + (format #t "~1Tadgif-data: #x~X~%" (-> this adgif-data)) + (format #t "~1Tpad[4] @ #x~X~%" (-> this pad)) + (format #t "~1Tdata[1] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type sprite-vec-data-3d @@ -122,33 +122,33 @@ ) ;; definition for method 3 of type sprite-vec-data-3d -(defmethod inspect sprite-vec-data-3d ((obj sprite-vec-data-3d)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-vec-data-3d ((this sprite-vec-data-3d)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-vec-data-3d) - (format #t "~1Tx-y-z-sx: #~%" (-> obj x-y-z-sx)) - (format #t "~1Tqx-qy-qz-sy: #~%" (-> obj qx-qy-qz-sy)) - (format #t "~1Tr-g-b-a: #~%" (-> obj r-g-b-a)) - (format #t "~1Tx: ~f~%" (-> obj x-y-z-sx x)) - (format #t "~1Ty: ~f~%" (-> obj x-y-z-sx y)) - (format #t "~1Tz: ~f~%" (-> obj x-y-z-sx z)) - (format #t "~1Tsx: ~f~%" (-> obj x-y-z-sx w)) - (format #t "~1Tsy: ~f~%" (-> obj qx-qy-qz-sy w)) - (format #t "~1Tqx: ~f~%" (-> obj qx-qy-qz-sy x)) - (format #t "~1Tqy: ~f~%" (-> obj qx-qy-qz-sy y)) - (format #t "~1Tqz: ~f~%" (-> obj qx-qy-qz-sy z)) - (format #t "~1Tr: ~f~%" (-> obj r-g-b-a x)) - (format #t "~1Tg: ~f~%" (-> obj r-g-b-a y)) - (format #t "~1Tb: ~f~%" (-> obj r-g-b-a z)) - (format #t "~1Ta: ~f~%" (-> obj r-g-b-a w)) - (format #t "~1Ttrans: #~%" (-> obj x-y-z-sx)) - (format #t "~1Trot: #~%" (-> obj qx-qy-qz-sy)) - (format #t "~1Tcolor: #~%" (-> obj r-g-b-a)) - (format #t "~1Tdata[1] @ #x~X~%" (-> obj x-y-z-sx)) + (format #t "[~8x] ~A~%" this 'sprite-vec-data-3d) + (format #t "~1Tx-y-z-sx: #~%" (-> this x-y-z-sx)) + (format #t "~1Tqx-qy-qz-sy: #~%" (-> this qx-qy-qz-sy)) + (format #t "~1Tr-g-b-a: #~%" (-> this r-g-b-a)) + (format #t "~1Tx: ~f~%" (-> this x-y-z-sx x)) + (format #t "~1Ty: ~f~%" (-> this x-y-z-sx y)) + (format #t "~1Tz: ~f~%" (-> this x-y-z-sx z)) + (format #t "~1Tsx: ~f~%" (-> this x-y-z-sx w)) + (format #t "~1Tsy: ~f~%" (-> this qx-qy-qz-sy w)) + (format #t "~1Tqx: ~f~%" (-> this qx-qy-qz-sy x)) + (format #t "~1Tqy: ~f~%" (-> this qx-qy-qz-sy y)) + (format #t "~1Tqz: ~f~%" (-> this qx-qy-qz-sy z)) + (format #t "~1Tr: ~f~%" (-> this r-g-b-a x)) + (format #t "~1Tg: ~f~%" (-> this r-g-b-a y)) + (format #t "~1Tb: ~f~%" (-> this r-g-b-a z)) + (format #t "~1Ta: ~f~%" (-> this r-g-b-a w)) + (format #t "~1Ttrans: #~%" (-> this x-y-z-sx)) + (format #t "~1Trot: #~%" (-> this qx-qy-qz-sy)) + (format #t "~1Tcolor: #~%" (-> this r-g-b-a)) + (format #t "~1Tdata[1] @ #x~X~%" (-> this x-y-z-sx)) (label cfg-4) - obj + this ) ;; definition of type sprite-array-3d @@ -168,19 +168,19 @@ ) ;; definition for method 3 of type sprite-array-3d -(defmethod inspect sprite-array-3d ((obj sprite-array-3d)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-array-3d ((this sprite-array-3d)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnum-sprites[2] @ #x~X~%" (-> obj num-sprites)) - (format #t "~1Tnum-valid[2] @ #x~X~%" (-> obj num-valid)) - (format #t "~1Tvec-data: #x~X~%" (-> obj vec-data)) - (format #t "~1Tadgif-data: #x~X~%" (-> obj adgif-data)) - (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-sprites[2] @ #x~X~%" (-> this num-sprites)) + (format #t "~1Tnum-valid[2] @ #x~X~%" (-> this num-valid)) + (format #t "~1Tvec-data: #x~X~%" (-> this vec-data)) + (format #t "~1Tadgif-data: #x~X~%" (-> this adgif-data)) + (format #t "~1Tdata[1] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc index e07151bdaa..7b79ce5449 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type sprite-header -(defmethod inspect sprite-header ((obj sprite-header)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-header ((this sprite-header)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-header) - (format #t "~1Theader[1] @ #x~X~%" (-> obj header)) - (format #t "~1Tnum-sprites: ~D~%" (-> obj num-sprites)) + (format #t "[~8x] ~A~%" this 'sprite-header) + (format #t "~1Theader[1] @ #x~X~%" (-> this header)) + (format #t "~1Tnum-sprites: ~D~%" (-> this num-sprites)) (label cfg-4) - obj + this ) ;; definition for function sprite-setup-header @@ -41,15 +41,15 @@ ) ;; definition for method 3 of type sprite-hvdf-data -(defmethod inspect sprite-hvdf-data ((obj sprite-hvdf-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-hvdf-data ((this sprite-hvdf-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-hvdf-data) - (format #t "~1Tdata[76] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'sprite-hvdf-data) + (format #t "~1Tdata[76] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type sprite-hvdf-control @@ -62,15 +62,15 @@ ) ;; definition for method 3 of type sprite-hvdf-control -(defmethod inspect sprite-hvdf-control ((obj sprite-hvdf-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-hvdf-control ((this sprite-hvdf-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-hvdf-control) - (format #t "~1Talloc[76] @ #x~X~%" (-> obj alloc)) + (format #t "[~8x] ~A~%" this 'sprite-hvdf-control) + (format #t "~1Talloc[76] @ #x~X~%" (-> this alloc)) (label cfg-4) - obj + this ) ;; definition of type sprite-aux-elem @@ -88,19 +88,19 @@ ) ;; definition for method 3 of type sprite-aux-elem -(defmethod inspect sprite-aux-elem ((obj sprite-aux-elem)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-aux-elem ((this sprite-aux-elem)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-aux-elem) - (format #t "~1Taux-type: ~D~%" (-> obj aux-type)) - (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) - (format #t "~1Tvec-data: #~%" (-> obj vec-data)) - (format #t "~1Tgif-data: #~%" (-> obj gif-data)) - (format #t "~1Taux-data: #~%" (-> obj aux-data)) + (format #t "[~8x] ~A~%" this 'sprite-aux-elem) + (format #t "~1Taux-type: ~D~%" (-> this aux-type)) + (format #t "~1Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~1Tvec-data: #~%" (-> this vec-data)) + (format #t "~1Tgif-data: #~%" (-> this gif-data)) + (format #t "~1Taux-data: #~%" (-> this aux-data)) (label cfg-4) - obj + this ) ;; definition of type sprite-aux-list @@ -119,17 +119,17 @@ ;; definition for method 3 of type sprite-aux-list ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect sprite-aux-list ((obj sprite-aux-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-aux-list ((this sprite-aux-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnum-entries: ~D~%" (-> obj num-entries)) - (format #t "~1Tentry: ~D~%" (-> obj entry)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-entries: ~D~%" (-> this num-entries)) + (format #t "~1Tentry: ~D~%" (-> this entry)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for method 0 of type sprite-aux-list @@ -144,12 +144,12 @@ ;; definition for method 3 of type sprite-aux-list ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch symbol vs sprite-aux-list. -(defmethod inspect sprite-aux-list ((obj sprite-aux-list)) - (format #t "[~X] sprite-aux-list:~%" obj) - (format #t "~Tnum-entries: ~D~%" (-> obj num-entries)) - (format #t "~Tentry: ~D~%" (-> obj entry)) - (dotimes (s5-0 (-> obj entry)) - (format #t "~T~D : ~X~%" s5-0 (-> obj data s5-0)) +(defmethod inspect sprite-aux-list ((this sprite-aux-list)) + (format #t "[~X] sprite-aux-list:~%" this) + (format #t "~Tnum-entries: ~D~%" (-> this num-entries)) + (format #t "~Tentry: ~D~%" (-> this entry)) + (dotimes (s5-0 (-> this entry)) + (format #t "~T~D : ~X~%" s5-0 (-> this data s5-0)) ) (the-as sprite-aux-list #f) ) @@ -239,48 +239,48 @@ ) ;; definition for method 3 of type sprite-frame-data -(defmethod inspect sprite-frame-data ((obj sprite-frame-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect sprite-frame-data ((this sprite-frame-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sprite-frame-data) - (format #t "~1Tdata[42] @ #x~X~%" (-> obj cdata)) - (format #t "~1Tcdata[16] @ #x~X~%" (-> obj cdata)) - (format #t "~1Tfdata[26] @ #x~X~%" (-> obj hmge-scale)) - (format #t "~1Txy-array[8] @ #x~X~%" (-> obj cdata)) - (format #t "~1Tst-array[4] @ #x~X~%" (-> obj st-array)) - (format #t "~1Txyz-array[4] @ #x~X~%" (-> obj xyz-array)) - (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) - (format #t "~1Tconsts: #~%" (&-> obj pfog0)) - (format #t "~1Tpfog0: ~f~%" (-> obj pfog0)) - (format #t "~1Tdeg-to-rad: ~f~%" (-> obj deg-to-rad)) - (format #t "~1Tmin-scale: ~f~%" (-> obj min-scale)) - (format #t "~1Tinv-area: ~f~%" (-> obj inv-area)) - (format #t "~1Tadgif-giftag: #~%" (-> obj adgif-giftag)) - (format #t "~1Tsprite-2d-giftag: #~%" (-> obj sprite-2d-giftag)) - (format #t "~1Tsprite-2d-giftag-2: #~%" (-> obj sprite-2d-giftag-2)) - (format #t "~1Tsincos-01: #~%" (-> obj sincos-01)) - (format #t "~1Tsincos-23: #~%" (-> obj sincos-23)) - (format #t "~1Tsincos-45: #~%" (-> obj sincos-45)) - (format #t "~1Tsincos-67: #~%" (-> obj sincos-67)) - (format #t "~1Tsincos-89: #~%" (-> obj sincos-89)) - (format #t "~1Tbasis-x: #~%" (-> obj basis-x)) - (format #t "~1Tbasis-y: #~%" (-> obj basis-y)) - (format #t "~1Tsprite-3d-giftag: #~%" (-> obj sprite-3d-giftag)) - (format #t "~1Tsprite-3d-giftag-2: #~%" (-> obj sprite-3d-giftag-2)) - (format #t "~1Tscreen-shader: #~%" (-> obj screen-shader)) - (format #t "~1Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) - (format #t "~1Tstq-offset: #~%" (-> obj stq-offset)) - (format #t "~1Tstq-scale: #~%" (-> obj stq-scale)) - (format #t "~1Trgba-plain: #~%" (-> obj rgba-plain)) - (format #t "~1Twarp-giftag: #~%" (-> obj warp-giftag)) - (format #t "~1Tfog-clamp: #~%" (-> obj fog-clamp)) - (format #t "~1Tfog-min: ~f~%" (-> obj fog-clamp x)) - (format #t "~1Tfog-max: ~f~%" (-> obj fog-clamp y)) - (format #t "~1Tmax-scale: ~f~%" (-> obj max-scale)) + (format #t "[~8x] ~A~%" this 'sprite-frame-data) + (format #t "~1Tdata[42] @ #x~X~%" (-> this cdata)) + (format #t "~1Tcdata[16] @ #x~X~%" (-> this cdata)) + (format #t "~1Tfdata[26] @ #x~X~%" (-> this hmge-scale)) + (format #t "~1Txy-array[8] @ #x~X~%" (-> this cdata)) + (format #t "~1Tst-array[4] @ #x~X~%" (-> this st-array)) + (format #t "~1Txyz-array[4] @ #x~X~%" (-> this xyz-array)) + (format #t "~1Thmge-scale: #~%" (-> this hmge-scale)) + (format #t "~1Tconsts: #~%" (&-> this pfog0)) + (format #t "~1Tpfog0: ~f~%" (-> this pfog0)) + (format #t "~1Tdeg-to-rad: ~f~%" (-> this deg-to-rad)) + (format #t "~1Tmin-scale: ~f~%" (-> this min-scale)) + (format #t "~1Tinv-area: ~f~%" (-> this inv-area)) + (format #t "~1Tadgif-giftag: #~%" (-> this adgif-giftag)) + (format #t "~1Tsprite-2d-giftag: #~%" (-> this sprite-2d-giftag)) + (format #t "~1Tsprite-2d-giftag-2: #~%" (-> this sprite-2d-giftag-2)) + (format #t "~1Tsincos-01: #~%" (-> this sincos-01)) + (format #t "~1Tsincos-23: #~%" (-> this sincos-23)) + (format #t "~1Tsincos-45: #~%" (-> this sincos-45)) + (format #t "~1Tsincos-67: #~%" (-> this sincos-67)) + (format #t "~1Tsincos-89: #~%" (-> this sincos-89)) + (format #t "~1Tbasis-x: #~%" (-> this basis-x)) + (format #t "~1Tbasis-y: #~%" (-> this basis-y)) + (format #t "~1Tsprite-3d-giftag: #~%" (-> this sprite-3d-giftag)) + (format #t "~1Tsprite-3d-giftag-2: #~%" (-> this sprite-3d-giftag-2)) + (format #t "~1Tscreen-shader: #~%" (-> this screen-shader)) + (format #t "~1Tinv-hmge-scale: #~%" (-> this inv-hmge-scale)) + (format #t "~1Tstq-offset: #~%" (-> this stq-offset)) + (format #t "~1Tstq-scale: #~%" (-> this stq-scale)) + (format #t "~1Trgba-plain: #~%" (-> this rgba-plain)) + (format #t "~1Twarp-giftag: #~%" (-> this warp-giftag)) + (format #t "~1Tfog-clamp: #~%" (-> this fog-clamp)) + (format #t "~1Tfog-min: ~f~%" (-> this fog-clamp x)) + (format #t "~1Tfog-max: ~f~%" (-> this fog-clamp y)) + (format #t "~1Tmax-scale: ~f~%" (-> this max-scale)) (label cfg-4) - obj + this ) ;; definition for function sprite-setup-frame-data diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc index f43db7eb64..c7dfa82e04 100644 --- a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc @@ -50,42 +50,42 @@ ) ;; definition for method 3 of type texture-anim-layer -(defmethod inspect texture-anim-layer ((obj texture-anim-layer)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-anim-layer ((this texture-anim-layer)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-anim-layer) - (format #t "~1Textra: #~%" (-> obj extra)) - (format #t "~1Tfunc: ~A~%" (-> obj func)) - (format #t "~1Tfunc-id: ~A~%" (-> obj func)) - (format #t "~1Tinit-func: ~A~%" (-> obj init-func)) - (format #t "~1Tinit-func-id: ~A~%" (-> obj init-func)) - (format #t "~1Ttex: ~A~%" (-> obj tex)) - (format #t "~1Tstart-time: ~f~%" (-> obj start-time)) - (format #t "~1Tend-time: ~f~%" (-> obj end-time)) - (format #t "~1Ttex-name: ~A~%" (-> obj tex-name)) - (format #t "~1Ttest: #x~X~%" (-> obj test)) - (format #t "~1Talpha: #x~X~%" (-> obj alpha)) - (format #t "~1Tclamp: #x~X~%" (-> obj clamp)) - (format #t "~1Tstart-color: ~`vector`P~%" (-> obj start-color)) - (format #t "~1Tstart-scale: ~`vector2`P~%" (-> obj start-scale)) - (format #t "~1Tstart-offset: ~`vector2`P~%" (-> obj start-offset)) - (format #t "~1Tstart-st-scale: ~`vector2`P~%" (-> obj start-st-scale)) - (format #t "~1Tstart-st-offset: ~`vector2`P~%" (-> obj start-st-offset)) - (format #t "~1Tstart-qs: ~`vector`P~%" (-> obj start-qs)) - (format #t "~1Tstart-rot: (deg ~r)~%" (-> obj start-rot)) - (format #t "~1Tstart-st-rot: (deg ~r)~%" (-> obj start-st-rot)) - (format #t "~1Tend-color: ~`vector`P~%" (-> obj end-color)) - (format #t "~1Tend-scale: ~`vector2`P~%" (-> obj end-scale)) - (format #t "~1Tend-offset: ~`vector2`P~%" (-> obj end-offset)) - (format #t "~1Tend-st-scale: ~`vector2`P~%" (-> obj end-st-scale)) - (format #t "~1Tend-st-offset: ~`vector2`P~%" (-> obj end-st-offset)) - (format #t "~1Tend-qs: ~`vector`P~%" (-> obj end-qs)) - (format #t "~1Tend-rot: (deg ~r)~%" (-> obj end-rot)) - (format #t "~1Tend-st-rot: (deg ~r)~%" (-> obj end-st-rot)) + (format #t "[~8x] ~A~%" this 'texture-anim-layer) + (format #t "~1Textra: #~%" (-> this extra)) + (format #t "~1Tfunc: ~A~%" (-> this func)) + (format #t "~1Tfunc-id: ~A~%" (-> this func)) + (format #t "~1Tinit-func: ~A~%" (-> this init-func)) + (format #t "~1Tinit-func-id: ~A~%" (-> this init-func)) + (format #t "~1Ttex: ~A~%" (-> this tex)) + (format #t "~1Tstart-time: ~f~%" (-> this start-time)) + (format #t "~1Tend-time: ~f~%" (-> this end-time)) + (format #t "~1Ttex-name: ~A~%" (-> this tex-name)) + (format #t "~1Ttest: #x~X~%" (-> this test)) + (format #t "~1Talpha: #x~X~%" (-> this alpha)) + (format #t "~1Tclamp: #x~X~%" (-> this clamp)) + (format #t "~1Tstart-color: ~`vector`P~%" (-> this start-color)) + (format #t "~1Tstart-scale: ~`vector2`P~%" (-> this start-scale)) + (format #t "~1Tstart-offset: ~`vector2`P~%" (-> this start-offset)) + (format #t "~1Tstart-st-scale: ~`vector2`P~%" (-> this start-st-scale)) + (format #t "~1Tstart-st-offset: ~`vector2`P~%" (-> this start-st-offset)) + (format #t "~1Tstart-qs: ~`vector`P~%" (-> this start-qs)) + (format #t "~1Tstart-rot: (deg ~r)~%" (-> this start-rot)) + (format #t "~1Tstart-st-rot: (deg ~r)~%" (-> this start-st-rot)) + (format #t "~1Tend-color: ~`vector`P~%" (-> this end-color)) + (format #t "~1Tend-scale: ~`vector2`P~%" (-> this end-scale)) + (format #t "~1Tend-offset: ~`vector2`P~%" (-> this end-offset)) + (format #t "~1Tend-st-scale: ~`vector2`P~%" (-> this end-st-scale)) + (format #t "~1Tend-st-offset: ~`vector2`P~%" (-> this end-st-offset)) + (format #t "~1Tend-qs: ~`vector`P~%" (-> this end-qs)) + (format #t "~1Tend-rot: (deg ~r)~%" (-> this end-rot)) + (format #t "~1Tend-st-rot: (deg ~r)~%" (-> this end-st-rot)) (label cfg-4) - obj + this ) ;; definition of type texture-anim @@ -117,30 +117,30 @@ ) ;; definition for method 3 of type texture-anim -(defmethod inspect texture-anim ((obj texture-anim)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-anim ((this texture-anim)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-anim) - (format #t "~1Tnum-layers: ~D~%" (-> obj num-layers)) - (format #t "~1Tfunc: ~A~%" (-> obj func)) - (format #t "~1Tfunc-id: ~A~%" (-> obj func)) - (format #t "~1Tinit-func: ~A~%" (-> obj init-func)) - (format #t "~1Tinit-func-id: ~A~%" (-> obj init-func)) - (format #t "~1Ttex: ~A~%" (-> obj tex)) - (format #t "~1Ttex-name: ~A~%" (-> obj tex-name)) - (format #t "~1Textra: #~%" (-> obj extra)) - (format #t "~1Tcolor: #x~X~%" (-> obj color)) - (format #t "~1Tframe-time: ~f~%" (-> obj frame-time)) - (format #t "~1Tframe-delta: ~f~%" (-> obj frame-delta)) - (format #t "~1Tframe-mod: ~f~%" (-> obj frame-mod)) - (format #t "~1Ttest: #x~X~%" (-> obj test)) - (format #t "~1Talpha: #x~X~%" (-> obj alpha)) - (format #t "~1Tclamp: #x~X~%" (-> obj clamp)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'texture-anim) + (format #t "~1Tnum-layers: ~D~%" (-> this num-layers)) + (format #t "~1Tfunc: ~A~%" (-> this func)) + (format #t "~1Tfunc-id: ~A~%" (-> this func)) + (format #t "~1Tinit-func: ~A~%" (-> this init-func)) + (format #t "~1Tinit-func-id: ~A~%" (-> this init-func)) + (format #t "~1Ttex: ~A~%" (-> this tex)) + (format #t "~1Ttex-name: ~A~%" (-> this tex-name)) + (format #t "~1Textra: #~%" (-> this extra)) + (format #t "~1Tcolor: #x~X~%" (-> this color)) + (format #t "~1Tframe-time: ~f~%" (-> this frame-time)) + (format #t "~1Tframe-delta: ~f~%" (-> this frame-delta)) + (format #t "~1Tframe-mod: ~f~%" (-> this frame-mod)) + (format #t "~1Ttest: #x~X~%" (-> this test)) + (format #t "~1Talpha: #x~X~%" (-> this alpha)) + (format #t "~1Tclamp: #x~X~%" (-> this clamp)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type texture-anim-array @@ -157,18 +157,18 @@ ) ;; definition for method 3 of type texture-anim-array -(defmethod inspect texture-anim-array ((obj texture-anim-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-anim-array ((this texture-anim-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttype: ~A~%" (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tcontent-type: ~A~%" (-> obj content-type)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttype: ~A~%" (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tcontent-type: ~A~%" (-> this content-type)) (label cfg-4) - obj + this ) ;; definition of type texture-anim-work @@ -192,26 +192,26 @@ ) ;; definition for method 3 of type texture-anim-work -(defmethod inspect texture-anim-work ((obj texture-anim-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-anim-work ((this texture-anim-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-anim-work) - (format #t "~1Terase-tmpl: #~%" (-> obj erase-tmpl)) - (format #t "~1Tdraw-tmpl: #~%" (-> obj draw-tmpl)) - (format #t "~1Tdraw2-tmpl: #~%" (-> obj draw2-tmpl)) - (format #t "~1Tfill-tmpl: #~%" (-> obj fill-tmpl)) - (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~1Tcorner0: #~%" (-> obj corner0)) - (format #t "~1Tcorner1: #~%" (-> obj corner1)) - (format #t "~1Tcorner2: #~%" (-> obj corner2)) - (format #t "~1Tcorner3: #~%" (-> obj corner3)) - (format #t "~1Tconst: #~%" (-> obj const)) - (format #t "~1Trandom[8] @ #x~X~%" (-> obj random)) - (format #t "~1Trandom-index: ~D~%" (-> obj random-index)) + (format #t "[~8x] ~A~%" this 'texture-anim-work) + (format #t "~1Terase-tmpl: #~%" (-> this erase-tmpl)) + (format #t "~1Tdraw-tmpl: #~%" (-> this draw-tmpl)) + (format #t "~1Tdraw2-tmpl: #~%" (-> this draw2-tmpl)) + (format #t "~1Tfill-tmpl: #~%" (-> this fill-tmpl)) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tcorner0: #~%" (-> this corner0)) + (format #t "~1Tcorner1: #~%" (-> this corner1)) + (format #t "~1Tcorner2: #~%" (-> this corner2)) + (format #t "~1Tcorner3: #~%" (-> this corner3)) + (format #t "~1Tconst: #~%" (-> this const)) + (format #t "~1Trandom[8] @ #x~X~%" (-> this random)) + (format #t "~1Trandom-index: ~D~%" (-> this random-index)) (label cfg-4) - obj + this ) ;; definition of type clut16x16 @@ -224,15 +224,15 @@ ) ;; definition for method 3 of type clut16x16 -(defmethod inspect clut16x16 ((obj clut16x16)) - (when (not obj) - (set! obj obj) +(defmethod inspect clut16x16 ((this clut16x16)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'clut16x16) - (format #t "~1Tclut[256] @ #x~X~%" (-> obj clut)) + (format #t "[~8x] ~A~%" this 'clut16x16) + (format #t "~1Tclut[256] @ #x~X~%" (-> this clut)) (label cfg-4) - obj + this ) ;; definition of type noise8x8 @@ -245,15 +245,15 @@ ) ;; definition for method 3 of type noise8x8 -(defmethod inspect noise8x8 ((obj noise8x8)) - (when (not obj) - (set! obj obj) +(defmethod inspect noise8x8 ((this noise8x8)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'noise8x8) - (format #t "~1Timage[64] @ #x~X~%" (-> obj image)) + (format #t "[~8x] ~A~%" this 'noise8x8) + (format #t "~1Timage[64] @ #x~X~%" (-> this image)) (label cfg-4) - obj + this ) ;; definition of type noise16x16 @@ -266,15 +266,15 @@ ) ;; definition for method 3 of type noise16x16 -(defmethod inspect noise16x16 ((obj noise16x16)) - (when (not obj) - (set! obj obj) +(defmethod inspect noise16x16 ((this noise16x16)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'noise16x16) - (format #t "~1Timage[256] @ #x~X~%" (-> obj image)) + (format #t "[~8x] ~A~%" this 'noise16x16) + (format #t "~1Timage[256] @ #x~X~%" (-> this image)) (label cfg-4) - obj + this ) ;; definition of type noise32x32 @@ -287,15 +287,15 @@ ) ;; definition for method 3 of type noise32x32 -(defmethod inspect noise32x32 ((obj noise32x32)) - (when (not obj) - (set! obj obj) +(defmethod inspect noise32x32 ((this noise32x32)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'noise32x32) - (format #t "~1Timage[1024] @ #x~X~%" (-> obj image)) + (format #t "[~8x] ~A~%" this 'noise32x32) + (format #t "~1Timage[1024] @ #x~X~%" (-> this image)) (label cfg-4) - obj + this ) ;; definition of type noise64x64 @@ -308,15 +308,15 @@ ) ;; definition for method 3 of type noise64x64 -(defmethod inspect noise64x64 ((obj noise64x64)) - (when (not obj) - (set! obj obj) +(defmethod inspect noise64x64 ((this noise64x64)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'noise64x64) - (format #t "~1Timage[4096] @ #x~X~%" (-> obj image)) + (format #t "[~8x] ~A~%" this 'noise64x64) + (format #t "~1Timage[4096] @ #x~X~%" (-> this image)) (label cfg-4) - obj + this ) ;; definition of type noise128x128 @@ -329,15 +329,15 @@ ) ;; definition for method 3 of type noise128x128 -(defmethod inspect noise128x128 ((obj noise128x128)) - (when (not obj) - (set! obj obj) +(defmethod inspect noise128x128 ((this noise128x128)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'noise128x128) - (format #t "~1Timage[16384] @ #x~X~%" (-> obj image)) + (format #t "[~8x] ~A~%" this 'noise128x128) + (format #t "~1Timage[16384] @ #x~X~%" (-> this image)) (label cfg-4) - obj + this ) ;; definition of type fog8x256 @@ -350,15 +350,15 @@ ) ;; definition for method 3 of type fog8x256 -(defmethod inspect fog8x256 ((obj fog8x256)) - (when (not obj) - (set! obj obj) +(defmethod inspect fog8x256 ((this fog8x256)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fog8x256) - (format #t "~1Timage[256] @ #x~X~%" (-> obj image)) + (format #t "[~8x] ~A~%" this 'fog8x256) + (format #t "~1Timage[256] @ #x~X~%" (-> this image)) (label cfg-4) - obj + this ) ;; definition of type fog-texture-work @@ -381,25 +381,25 @@ ) ;; definition for method 3 of type fog-texture-work -(defmethod inspect fog-texture-work ((obj fog-texture-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect fog-texture-work ((this fog-texture-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fog-texture-work) - (format #t "~1Tcorner[4] @ #x~X~%" (-> obj corner)) - (format #t "~1Tconst: #~%" (-> obj const)) - (format #t "~1Tmin-corner: #~%" (-> obj min-corner)) - (format #t "~1Tmax-corner: #~%" (-> obj max-corner)) - (format #t "~1Tfog-near: ~f~%" (-> obj fog-near)) - (format #t "~1Tfog-far: ~f~%" (-> obj fog-far)) - (format #t "~1Tfog-delta: ~f~%" (-> obj fog-delta)) - (format #t "~1Talpha-near: ~f~%" (-> obj alpha-near)) - (format #t "~1Talpha-far: ~f~%" (-> obj alpha-far)) - (format #t "~1Talpha-delta: ~f~%" (-> obj alpha-delta)) - (format #t "~1Tcolor: ~D~%" (-> obj color)) + (format #t "[~8x] ~A~%" this 'fog-texture-work) + (format #t "~1Tcorner[4] @ #x~X~%" (-> this corner)) + (format #t "~1Tconst: #~%" (-> this const)) + (format #t "~1Tmin-corner: #~%" (-> this min-corner)) + (format #t "~1Tmax-corner: #~%" (-> this max-corner)) + (format #t "~1Tfog-near: ~f~%" (-> this fog-near)) + (format #t "~1Tfog-far: ~f~%" (-> this fog-far)) + (format #t "~1Tfog-delta: ~f~%" (-> this fog-delta)) + (format #t "~1Talpha-near: ~f~%" (-> this alpha-near)) + (format #t "~1Talpha-far: ~f~%" (-> this alpha-far)) + (format #t "~1Talpha-delta: ~f~%" (-> this alpha-delta)) + (format #t "~1Tcolor: ~D~%" (-> this color)) (label cfg-4) - obj + this ) ;; definition for symbol *clut-translate*, type (pointer uint8) diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim_REF.gc index 57f720177a..ec0a201f25 100644 --- a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim_REF.gc @@ -1229,38 +1229,40 @@ ) ;; definition for method 9 of type texture-anim-array -(defmethod init! texture-anim-array ((obj texture-anim-array)) - (dotimes (s5-0 (-> obj length)) - (init-textures! (-> obj array-data s5-0)) +(defmethod init! texture-anim-array ((this texture-anim-array)) + (dotimes (s5-0 (-> this length)) + (init-textures! (-> this array-data s5-0)) ) - obj + this ) ;; definition for method 10 of type texture-anim-array -(defmethod clear! texture-anim-array ((obj texture-anim-array)) - (dotimes (s5-0 (-> obj length)) - (clear-textures! (-> obj array-data s5-0)) +(defmethod clear! texture-anim-array ((this texture-anim-array)) + (dotimes (s5-0 (-> this length)) + (clear-textures! (-> this array-data s5-0)) ) - obj + this ) ;; definition for method 9 of type texture-anim ;; INFO: Used lq/sq -(defmethod init-textures! texture-anim ((obj texture-anim)) +(defmethod init-textures! texture-anim ((this texture-anim)) (local-vars (a3-3 uint128) (sv-16 texture-page)) - (if (logtest? (the-as int (-> obj func)) 1) - (set! (-> obj func) (the-as (function dma-buffer texture-anim int) (-> (the-as symbol (-> obj func)) value))) + (if (logtest? (the-as int (-> this func)) 1) + (set! (-> this func) + (the-as (function dma-buffer texture-anim int) (-> (the-as symbol (-> this func)) value)) + ) ) - (when (logtest? (the-as int (-> obj init-func)) 1) - (set! (-> obj init-func) (the-as (function texture-anim int) (-> (the-as symbol (-> obj init-func)) value))) - (if (-> obj init-func) - ((-> obj init-func) obj) + (when (logtest? (the-as int (-> this init-func)) 1) + (set! (-> this init-func) (the-as (function texture-anim int) (-> (the-as symbol (-> this init-func)) value))) + (if (-> this init-func) + ((-> this init-func) this) ) ) - (when (-> obj tex-name) + (when (-> this tex-name) (set! sv-16 (the-as texture-page #f)) - (let ((a0-3 (lookup-level-texture-by-name (-> obj tex-name) (-> *level* loading-level) (& sv-16)))) - (set! (-> obj tex) a0-3) + (let ((a0-3 (lookup-level-texture-by-name (-> this tex-name) (-> *level* loading-level) (& sv-16)))) + (set! (-> this tex) a0-3) (when (and a0-3 sv-16) 0 (cond @@ -1271,7 +1273,7 @@ (a1-5 (+ (-> v1-22 dest) (-> v1-22 size))) (a0-7 2048) ) - (set! (-> obj tex clutdest) (* (shr (+ a1-5 2047) 11) 32)) + (set! (-> this tex clutdest) (* (shr (+ a1-5 2047) 11) 32)) (+! (-> sv-16 size) a0-7) (+! (-> v1-22 size) a0-7) ) @@ -1285,7 +1287,7 @@ (a1-19 (+ (-> v1-26 dest) (-> v1-26 size))) (a0-12 (shl (sar (+ (* (-> a0-3 w) (-> a0-3 h)) 2047) 11) 11)) ) - (set! (-> obj tex dest 0) (* (shr (+ a1-19 2047) 11) 32)) + (set! (-> this tex dest 0) (* (shr (+ a1-19 2047) 11) 32)) (+! (-> sv-16 size) a0-12) (+! (-> v1-26 size) a0-12) ) @@ -1296,16 +1298,16 @@ ) ) ) - (dotimes (s5-0 (the-as int (-> obj num-layers))) - (initialize-texture! (-> obj data s5-0)) + (dotimes (s5-0 (the-as int (-> this num-layers))) + (initialize-texture! (-> this data s5-0)) ) - (let ((v1-34 (-> obj tex))) + (let ((v1-34 (-> this tex))) (when v1-34 (dotimes (a0-15 3) (set! (-> v1-34 masks data a0-15 mask quad) (the-as uint128 0)) ) - (dotimes (a0-18 (the-as int (-> obj num-layers))) - (let ((a1-33 (-> obj data a0-18 tex))) + (dotimes (a0-18 (the-as int (-> this num-layers))) + (let ((a1-33 (-> this data a0-18 tex))) (when a1-33 (dotimes (a2-8 3) (let ((a3-2 (-> v1-34 masks data a2-8 mask quad)) @@ -1320,45 +1322,48 @@ ) ) ) - obj + this ) ;; definition for method 10 of type texture-anim -(defmethod clear-textures! texture-anim ((obj texture-anim)) - (set! (-> obj tex) #f) - (dotimes (s5-0 (the-as int (-> obj num-layers))) - (clear-texture! (-> obj data s5-0)) +(defmethod clear-textures! texture-anim ((this texture-anim)) + (set! (-> this tex) #f) + (dotimes (s5-0 (the-as int (-> this num-layers))) + (clear-texture! (-> this data s5-0)) ) - obj + this ) ;; definition for method 9 of type texture-anim-layer -(defmethod initialize-texture! texture-anim-layer ((obj texture-anim-layer)) - (if (logtest? (the-as int (-> obj func)) 1) - (set! (-> obj func) (the-as - (function dma-buffer uint int int texture-anim-layer float int) - (-> (the-as symbol (-> obj func)) value) +(defmethod initialize-texture! texture-anim-layer ((this texture-anim-layer)) + (if (logtest? (the-as int (-> this func)) 1) + (set! (-> this func) (the-as + (function dma-buffer uint int int texture-anim-layer float int) + (-> (the-as symbol (-> this func)) value) + ) + ) + ) + (when (logtest? (the-as int (-> this init-func)) 1) + (set! (-> this init-func) + (the-as (function texture-anim-layer int) (-> (the-as symbol (-> this init-func)) value)) + ) + (if (-> this init-func) + ((-> this init-func) this) + ) + ) + (if (-> this tex-name) + (set! (-> this tex) (lookup-level-texture-by-name + (-> this tex-name) + (-> *level* loading-level) + (the-as (pointer texture-page) #f) ) ) ) - (when (logtest? (the-as int (-> obj init-func)) 1) - (set! (-> obj init-func) - (the-as (function texture-anim-layer int) (-> (the-as symbol (-> obj init-func)) value)) - ) - (if (-> obj init-func) - ((-> obj init-func) obj) - ) - ) - (if (-> obj tex-name) - (set! (-> obj tex) - (lookup-level-texture-by-name (-> obj tex-name) (-> *level* loading-level) (the-as (pointer texture-page) #f)) - ) - ) - obj + this ) ;; definition for method 10 of type texture-anim-layer -(defmethod clear-texture! texture-anim-layer ((obj texture-anim-layer)) - (set! (-> obj tex) #f) - obj +(defmethod clear-texture! texture-anim-layer ((this texture-anim-layer)) + (set! (-> this tex) #f) + this ) diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc index 92a0afbe49..322b278177 100644 --- a/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type texture-id -(defmethod inspect texture-id ((obj texture-id)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-id ((this texture-id)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-id) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tpage: ~D~%" (-> obj page)) + (format #t "[~8x] ~A~%" this 'texture-id) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tpage: ~D~%" (-> this page)) (label cfg-4) - obj + this ) ;; definition of type texture-pool-segment @@ -37,16 +37,16 @@ ) ;; definition for method 3 of type texture-pool-segment -(defmethod inspect texture-pool-segment ((obj texture-pool-segment)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-pool-segment ((this texture-pool-segment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-pool-segment) - (format #t "~1Tdest: #x~X~%" (-> obj dest)) - (format #t "~1Tsize: #x~X~%" (-> obj size)) + (format #t "[~8x] ~A~%" this 'texture-pool-segment) + (format #t "~1Tdest: #x~X~%" (-> this dest)) + (format #t "~1Tsize: #x~X~%" (-> this size)) (label cfg-4) - obj + this ) ;; definition of type texture-pool @@ -92,28 +92,28 @@ ) ;; definition for method 3 of type texture-pool -(defmethod inspect texture-pool ((obj texture-pool)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-pool ((this texture-pool)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttop: #x~X~%" (-> obj top)) - (format #t "~1Tcur: #x~X~%" (-> obj cur)) - (format #t "~1Tallocate-func: ~A~%" (-> obj allocate-func)) - (format #t "~1Tfont-palette: ~D~%" (-> obj font-palette)) - (format #t "~1Tsegment[4] @ #x~X~%" (-> obj segment)) - (format #t "~1Tsegment-near: #~%" (-> obj segment)) - (format #t "~1Tsegment-common: #~%" (-> obj segment-common)) - (format #t "~1Tcommon-page[32] @ #x~X~%" (-> obj common-page)) - (format #t "~1Tcommon-page-mask: ~D~%" (-> obj common-page-mask)) - (format #t "~1Tupdate-sprites-flag: ~A~%" (-> obj update-sprites-flag)) - (format #t "~1Tupdate-flag: ~A~%" (-> obj update-flag)) - (format #t "~1Ttexture-enable-user: ~D~%" (-> obj texture-enable-user)) - (format #t "~1Ttexture-enable-user-menu: ~D~%" (-> obj texture-enable-user-menu)) - (format #t "~1Tids[128] @ #x~X~%" (-> obj ids)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttop: #x~X~%" (-> this top)) + (format #t "~1Tcur: #x~X~%" (-> this cur)) + (format #t "~1Tallocate-func: ~A~%" (-> this allocate-func)) + (format #t "~1Tfont-palette: ~D~%" (-> this font-palette)) + (format #t "~1Tsegment[4] @ #x~X~%" (-> this segment)) + (format #t "~1Tsegment-near: #~%" (-> this segment)) + (format #t "~1Tsegment-common: #~%" (-> this segment-common)) + (format #t "~1Tcommon-page[32] @ #x~X~%" (-> this common-page)) + (format #t "~1Tcommon-page-mask: ~D~%" (-> this common-page-mask)) + (format #t "~1Tupdate-sprites-flag: ~A~%" (-> this update-sprites-flag)) + (format #t "~1Tupdate-flag: ~A~%" (-> this update-flag)) + (format #t "~1Ttexture-enable-user: ~D~%" (-> this texture-enable-user)) + (format #t "~1Ttexture-enable-user-menu: ~D~%" (-> this texture-enable-user-menu)) + (format #t "~1Tids[128] @ #x~X~%" (-> this ids)) (label cfg-4) - obj + this ) ;; definition of type texture-mask @@ -130,18 +130,18 @@ ;; definition for method 3 of type texture-mask ;; INFO: Used lq/sq -(defmethod inspect texture-mask ((obj texture-mask)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-mask ((this texture-mask)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-mask) - (format #t "~1Tmask: #~%" (-> obj mask)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) - (format #t "~1Tlong[2] @ #x~X~%" (-> obj mask)) - (format #t "~1Tquad: ~D~%" (-> obj mask quad)) + (format #t "[~8x] ~A~%" this 'texture-mask) + (format #t "~1Tmask: #~%" (-> this mask)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tlong[2] @ #x~X~%" (-> this mask)) + (format #t "~1Tquad: ~D~%" (-> this mask quad)) (label cfg-4) - obj + this ) ;; definition of type texture-masks @@ -154,15 +154,15 @@ ) ;; definition for method 3 of type texture-masks -(defmethod inspect texture-masks ((obj texture-masks)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-masks ((this texture-masks)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-masks) - (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'texture-masks) + (format #t "~1Tdata[3] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type texture-masks-array @@ -175,17 +175,17 @@ ) ;; definition for method 3 of type texture-masks-array -(defmethod inspect texture-masks-array ((obj texture-masks-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-masks-array ((this texture-masks-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -221,29 +221,29 @@ ) ;; definition for method 3 of type texture -(defmethod inspect texture ((obj texture)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture ((this texture)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tw: ~D~%" (-> obj w)) - (format #t "~1Th: ~D~%" (-> obj h)) - (format #t "~1Tnum-mips: ~D~%" (-> obj num-mips)) - (format #t "~1Ttex1-control: ~D~%" (-> obj tex1-control)) - (format #t "~1Tpsm: ~D~%" (-> obj psm)) - (format #t "~1Tmip-shift: ~D~%" (-> obj mip-shift)) - (format #t "~1Tclutpsm: ~D~%" (-> obj clutpsm)) - (format #t "~1Tdest[7] @ #x~X~%" (-> obj dest)) - (format #t "~1Tclutdest: ~D~%" (-> obj clutdest)) - (format #t "~1Twidth[7] @ #x~X~%" (-> obj width)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tsize: #x~X~%" (-> obj size)) - (format #t "~1Tuv-dist: ~f~%" (-> obj uv-dist)) - (format #t "~1Tpad[3] @ #x~X~%" (-> obj pad)) - (format #t "~1Tmasks: #~%" (-> obj masks)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tw: ~D~%" (-> this w)) + (format #t "~1Th: ~D~%" (-> this h)) + (format #t "~1Tnum-mips: ~D~%" (-> this num-mips)) + (format #t "~1Ttex1-control: ~D~%" (-> this tex1-control)) + (format #t "~1Tpsm: ~D~%" (-> this psm)) + (format #t "~1Tmip-shift: ~D~%" (-> this mip-shift)) + (format #t "~1Tclutpsm: ~D~%" (-> this clutpsm)) + (format #t "~1Tdest[7] @ #x~X~%" (-> this dest)) + (format #t "~1Tclutdest: ~D~%" (-> this clutdest)) + (format #t "~1Twidth[7] @ #x~X~%" (-> this width)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tsize: #x~X~%" (-> this size)) + (format #t "~1Tuv-dist: ~f~%" (-> this uv-dist)) + (format #t "~1Tpad[3] @ #x~X~%" (-> this pad)) + (format #t "~1Tmasks: #~%" (-> this masks)) (label cfg-4) - obj + this ) ;; definition of type texture-page-segment @@ -260,17 +260,17 @@ ) ;; definition for method 3 of type texture-page-segment -(defmethod inspect texture-page-segment ((obj texture-page-segment)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-page-segment ((this texture-page-segment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-page-segment) - (format #t "~1Tblock-data: #x~X~%" (-> obj block-data)) - (format #t "~1Tsize: #x~X~%" (-> obj size)) - (format #t "~1Tdest: #x~X~%" (-> obj dest)) + (format #t "[~8x] ~A~%" this 'texture-page-segment) + (format #t "~1Tblock-data: #x~X~%" (-> this block-data)) + (format #t "~1Tsize: #x~X~%" (-> this size)) + (format #t "~1Tdest: #x~X~%" (-> this dest)) (label cfg-4) - obj + this ) ;; definition for function texture-mip->segment @@ -308,24 +308,24 @@ ) ;; definition for method 3 of type texture-page -(defmethod inspect texture-page ((obj texture-page)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-page ((this texture-page)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tinfo: ~A~%" (-> obj info)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tmip0-size: ~D~%" (-> obj mip0-size)) - (format #t "~1Tsize: #x~X~%" (-> obj size)) - (format #t "~1Tsegment[3] @ #x~X~%" (-> obj segment)) - (format #t "~1Tdram-size: ~D~%" (-> obj dram-size)) - (format #t "~1Tpad[15] @ #x~X~%" (-> obj pad)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tmip0-size: ~D~%" (-> this mip0-size)) + (format #t "~1Tsize: #x~X~%" (-> this size)) + (format #t "~1Tsegment[3] @ #x~X~%" (-> this segment)) + (format #t "~1Tdram-size: ~D~%" (-> this dram-size)) + (format #t "~1Tpad[15] @ #x~X~%" (-> this pad)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type shader-ptr @@ -348,15 +348,15 @@ ) ;; definition for method 3 of type texture-link -(defmethod inspect texture-link ((obj texture-link)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-link ((this texture-link)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-link) - (format #t "~1Tnext: #x~X~%" (-> obj next 0)) + (format #t "[~8x] ~A~%" this 'texture-link) + (format #t "~1Tnext: #x~X~%" (-> this next 0)) (label cfg-4) - obj + this ) ;; definition of type texture-page-dir-entry @@ -374,18 +374,18 @@ ) ;; definition for method 3 of type texture-page-dir-entry -(defmethod inspect texture-page-dir-entry ((obj texture-page-dir-entry)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-page-dir-entry ((this texture-page-dir-entry)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-page-dir-entry) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tstatus: ~D~%" (-> obj status)) - (format #t "~1Tpage: ~A~%" (-> obj page)) - (format #t "~1Tlink: #x~X~%" (-> obj link)) + (format #t "[~8x] ~A~%" this 'texture-page-dir-entry) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tstatus: ~D~%" (-> this status)) + (format #t "~1Tpage: ~A~%" (-> this page)) + (format #t "~1Tlink: #x~X~%" (-> this link)) (label cfg-4) - obj + this ) ;; definition of type texture-page-dir @@ -417,20 +417,20 @@ ) ;; definition for method 3 of type texture-relocate-later -(defmethod inspect texture-relocate-later ((obj texture-relocate-later)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-relocate-later ((this texture-relocate-later)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmemcpy: ~A~%" (-> obj memcpy)) - (format #t "~1Tdest: ~D~%" (-> obj dest)) - (format #t "~1Tsource: ~D~%" (-> obj source)) - (format #t "~1Tmove: ~D~%" (-> obj move)) - (format #t "~1Tentry: #~%" (-> obj entry)) - (format #t "~1Tpage: ~A~%" (-> obj page)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmemcpy: ~A~%" (-> this memcpy)) + (format #t "~1Tdest: ~D~%" (-> this dest)) + (format #t "~1Tsource: ~D~%" (-> this source)) + (format #t "~1Tmove: ~D~%" (-> this move)) + (format #t "~1Tentry: #~%" (-> this entry)) + (format #t "~1Tpage: ~A~%" (-> this page)) (label cfg-4) - obj + this ) ;; definition for symbol *texture-relocate-later*, type texture-relocate-later @@ -469,30 +469,30 @@ ) ;; definition for method 3 of type adgif-shader -(defmethod inspect adgif-shader ((obj adgif-shader)) - (when (not obj) - (set! obj obj) +(defmethod inspect adgif-shader ((this adgif-shader)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'adgif-shader) - (format #t "~1Tquad[5] @ #x~X~%" (&-> obj tex0)) - (format #t "~1Tprims[10] @ #x~X~%" (&-> obj tex0)) - (format #t "~1Treg-0: ~D~%" (-> obj reg-0)) - (format #t "~1Treg-1: ~D~%" (-> obj reg-1)) - (format #t "~1Treg-2: ~D~%" (-> obj reg-2)) - (format #t "~1Treg-3: ~D~%" (-> obj reg-3)) - (format #t "~1Treg-4: ~D~%" (-> obj reg-4)) - (format #t "~1Ttex0: #x~X~%" (-> obj tex0)) - (format #t "~1Ttex1: #x~X~%" (-> obj tex1)) - (format #t "~1Tmiptbp1: #x~X~%" (-> obj miptbp1)) - (format #t "~1Tclamp: #x~X~%" (-> obj clamp)) - (format #t "~1Tclamp-reg: ~D~%" (-> obj clamp-reg)) - (format #t "~1Talpha: #x~X~%" (-> obj alpha)) - (format #t "~1Tlink-test: ~D~%" (-> obj link-test)) - (format #t "~1Ttexture-id: ~D~%" (-> obj texture-id)) - (format #t "~1Tnext: #x~X~%" (-> obj next)) + (format #t "[~8x] ~A~%" this 'adgif-shader) + (format #t "~1Tquad[5] @ #x~X~%" (&-> this tex0)) + (format #t "~1Tprims[10] @ #x~X~%" (&-> this tex0)) + (format #t "~1Treg-0: ~D~%" (-> this reg-0)) + (format #t "~1Treg-1: ~D~%" (-> this reg-1)) + (format #t "~1Treg-2: ~D~%" (-> this reg-2)) + (format #t "~1Treg-3: ~D~%" (-> this reg-3)) + (format #t "~1Treg-4: ~D~%" (-> this reg-4)) + (format #t "~1Ttex0: #x~X~%" (-> this tex0)) + (format #t "~1Ttex1: #x~X~%" (-> this tex1)) + (format #t "~1Tmiptbp1: #x~X~%" (-> this miptbp1)) + (format #t "~1Tclamp: #x~X~%" (-> this clamp)) + (format #t "~1Tclamp-reg: ~D~%" (-> this clamp-reg)) + (format #t "~1Talpha: #x~X~%" (-> this alpha)) + (format #t "~1Tlink-test: ~D~%" (-> this link-test)) + (format #t "~1Ttexture-id: ~D~%" (-> this texture-id)) + (format #t "~1Tnext: #x~X~%" (-> this next)) (label cfg-4) - obj + this ) ;; definition of type adgif-shader-array @@ -505,17 +505,17 @@ ) ;; definition for method 3 of type adgif-shader-array -(defmethod inspect adgif-shader-array ((obj adgif-shader-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect adgif-shader-array ((this adgif-shader-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -533,17 +533,17 @@ ) ;; definition for method 3 of type texture-base -(defmethod inspect texture-base ((obj texture-base)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-base ((this texture-base)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-base) - (format #t "~1Tvram-page: ~D~%" (-> obj vram-page)) - (format #t "~1Tvram-block: ~D~%" (-> obj vram-block)) - (format #t "~1Tvram-word: ~D~%" (-> obj vram-word)) + (format #t "[~8x] ~A~%" this 'texture-base) + (format #t "~1Tvram-page: ~D~%" (-> this vram-page)) + (format #t "~1Tvram-block: ~D~%" (-> this vram-block)) + (format #t "~1Tvram-word: ~D~%" (-> this vram-word)) (label cfg-4) - obj + this ) ;; definition for symbol ct32-24-block-table, type (array int32) @@ -855,18 +855,18 @@ ) ;; definition for method 3 of type texture-page-translate-item -(defmethod inspect texture-page-translate-item ((obj texture-page-translate-item)) - (when (not obj) - (set! obj obj) +(defmethod inspect texture-page-translate-item ((this texture-page-translate-item)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'texture-page-translate-item) - (format #t "~1Tbucket: ~D~%" (-> obj bucket)) - (format #t "~1Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~1Tlevel-texture-page: ~D~%" (-> obj level-texture-page)) - (format #t "~1Ttexture-user: ~D~%" (-> obj texture-user)) + (format #t "[~8x] ~A~%" this 'texture-page-translate-item) + (format #t "~1Tbucket: ~D~%" (-> this bucket)) + (format #t "~1Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~1Tlevel-texture-page: ~D~%" (-> this level-texture-page)) + (format #t "~1Ttexture-user: ~D~%" (-> this texture-user)) (label cfg-4) - obj + this ) ;; definition for symbol *texture-page-translate*, type (array texture-page-translate-item) diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc index 7dd8f31500..e29432f546 100644 --- a/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc @@ -2,45 +2,45 @@ (in-package goal) ;; definition for method 2 of type texture-page -(defmethod print texture-page ((obj texture-page)) +(defmethod print texture-page ((this texture-page)) (format #t "#" - (-> obj name) - (-> obj length) - (shr (-> obj segment 0 dest) 6) - (shr (+ (-> obj size) 255) 8) - obj + (-> this name) + (-> this length) + (shr (-> this segment 0 dest) 6) + (shr (+ (-> this size) 255) 8) + this ) - obj + this ) ;; definition for method 4 of type texture-page -(defmethod length texture-page ((obj texture-page)) - (-> obj length) +(defmethod length texture-page ((this texture-page)) + (-> this length) ) ;; definition for method 5 of type texture-page ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of texture-page ((obj texture-page)) - (the-as int (+ (-> obj type size) (* (-> obj length) 4))) +(defmethod asize-of texture-page ((this texture-page)) + (the-as int (+ (-> this type size) (* (-> this length) 4))) ) ;; definition for method 8 of type texture-page -(defmethod mem-usage texture-page ((obj texture-page) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage texture-page ((this texture-page) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 83 (-> arg0 length))) (set! (-> arg0 data 82 name) "texture") - (+! (-> arg0 data 82 count) (-> obj length)) - (let ((v1-7 (+ (asize-of obj) (* (-> obj dram-size) 4)))) - (dotimes (a0-6 (-> obj length)) - (if (-> obj data a0-6) + (+! (-> arg0 data 82 count) (-> this length)) + (let ((v1-7 (+ (asize-of this) (* (-> this dram-size) 4)))) + (dotimes (a0-6 (-> this length)) + (if (-> this data a0-6) (+! v1-7 112) ) ) (+! (-> arg0 data 82 used) v1-7) (+! (-> arg0 data 82 total) (logand -16 (+ v1-7 15))) ) - obj + this ) ;; definition for function texture-bpp @@ -126,25 +126,25 @@ ) ;; definition for method 2 of type texture -(defmethod print texture ((obj texture)) +(defmethod print texture ((this texture)) (format #t "# obj name) - (psm->string (-> obj psm)) - (-> obj w) - (-> obj h) - (-> obj num-mips) - (shr (-> obj size) 8) + (-> this name) + (psm->string (-> this psm)) + (-> this w) + (-> this h) + (-> this num-mips) + (shr (-> this size) 8) ) - (dotimes (s5-1 (the-as int (-> obj num-mips))) - (format #t " #x~X/~X" (-> obj dest s5-1) (-> obj width s5-1)) + (dotimes (s5-1 (the-as int (-> this num-mips))) + (format #t " #x~X/~X" (-> this dest s5-1) (-> this width s5-1)) ) - (if (< (texture-bpp (-> obj psm)) 16) - (format #t " :clut #x~X/1" (-> obj clutdest)) + (if (< (texture-bpp (-> this psm)) 16) + (format #t " :clut #x~X/1" (-> this clutdest)) ) - (format #t " @ #x~X>" obj) - obj + (format #t " @ #x~X>" this) + this ) ;; definition for function gs-find-block @@ -302,15 +302,15 @@ ) ;; definition for method 15 of type texture-pool -(defmethod allocate-vram-words! texture-pool ((obj texture-pool) (arg0 int)) - (let ((v0-0 (-> obj cur))) - (+! (-> obj cur) arg0) +(defmethod allocate-vram-words! texture-pool ((this texture-pool) (arg0 int)) + (let ((v0-0 (-> this cur))) + (+! (-> this cur) arg0) v0-0 ) ) ;; definition for method 18 of type texture-pool -(defmethod get-common-page-slot-by-id texture-pool ((obj texture-pool) (tpage-id int)) +(defmethod get-common-page-slot-by-id texture-pool ((this texture-pool) (tpage-id int)) (case tpage-id ((33) 1 @@ -325,67 +325,67 @@ ) ;; definition for method 9 of type texture-pool -(defmethod initialize! texture-pool ((obj texture-pool)) - (set! (-> obj cur) 0) - (set! (-> obj top) (-> obj cur)) - (set! (-> obj allocate-func) texture-page-default-allocate) - (allocate-defaults obj) - (format #t "font-palette start #x~x~%" (/ (-> obj cur) 64)) - (set! (-> obj font-palette) (allocate-vram-words! obj 64)) - (format #t "font-palette end #x~x~%" (/ (-> obj cur) 64)) +(defmethod initialize! texture-pool ((this texture-pool)) + (set! (-> this cur) 0) + (set! (-> this top) (-> this cur)) + (set! (-> this allocate-func) texture-page-default-allocate) + (allocate-defaults this) + (format #t "font-palette start #x~x~%" (/ (-> this cur) 64)) + (set! (-> this font-palette) (allocate-vram-words! this 64)) + (format #t "font-palette end #x~x~%" (/ (-> this cur) 64)) (dotimes (v1-8 32) - (set! (-> obj common-page v1-8) (the-as texture-page 0)) + (set! (-> this common-page v1-8) (the-as texture-page 0)) ) - (set! (-> obj common-page-mask) 0) - (set! (-> obj texture-enable-user-menu) + (set! (-> this common-page-mask) 0) + (set! (-> this texture-enable-user-menu) (texture-enable-mask tfrag pris shrub alpha water warp sprite map sky) ) - (set! (-> obj texture-enable-user) (texture-enable-mask tfrag pris shrub alpha water warp sprite map sky)) + (set! (-> this texture-enable-user) (texture-enable-mask tfrag pris shrub alpha water warp sprite map sky)) (dotimes (v1-13 128) - (set! (-> obj ids v1-13) (the-as uint 0)) + (set! (-> this ids v1-13) (the-as uint 0)) ) - obj + this ) ;; definition for method 10 of type texture-page -(defmethod get-leftover-block-count texture-page ((obj texture-page) (num-segments int) (upload-offset int)) +(defmethod get-leftover-block-count texture-page ((this texture-page) (num-segments int) (upload-offset int)) (let ((offset upload-offset)) (dotimes (i num-segments) - (+! offset (-> obj segment i size)) + (+! offset (-> this segment i size)) ) (logand (/ offset 64) 63) ) ) ;; definition for method 10 of type texture-pool -(defmethod print-usage texture-pool ((obj texture-pool)) +(defmethod print-usage texture-pool ((this texture-pool)) (format #t "--------------------~%") (format #t "texture pool ~DK - ~DK (~DK used, ~DK free)~%" - (/ (-> obj top) 256) - (/ (-> obj cur) 256) - (/ (- (-> obj cur) (-> obj top)) 256) - (/ (- #xfa000 (-> obj cur)) 256) + (/ (-> this top) 256) + (/ (-> this cur) 256) + (/ (- (-> this cur) (-> this top)) 256) + (/ (- #xfa000 (-> this cur)) 256) ) (format #t "--------------------~%") - obj + this ) ;; definition for method 16 of type texture-pool -(defmethod allocate-segment texture-pool ((obj texture-pool) (seg texture-pool-segment) (num-words int)) +(defmethod allocate-segment texture-pool ((this texture-pool) (seg texture-pool-segment) (num-words int)) (set! (-> seg size) (the-as uint num-words)) - (set! (-> seg dest) (the-as uint (allocate-vram-words! obj num-words))) + (set! (-> seg dest) (the-as uint (allocate-vram-words! this num-words))) seg ) ;; definition for method 12 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod allocate-defaults texture-pool ((obj texture-pool)) - (format #t "texture start #x~x~%" (/ (-> obj cur) 64)) - (allocate-segment obj (-> obj segment-common) #x3e000) - (format #t "texture end #x~x~%" (/ (-> obj cur) 64)) - (set! (-> *ocean-envmap-texture-base* vram-word) (the-as uint (allocate-vram-words! obj #x9400))) +(defmethod allocate-defaults texture-pool ((this texture-pool)) + (format #t "texture start #x~x~%" (/ (-> this cur) 64)) + (allocate-segment this (-> this segment-common) #x3e000) + (format #t "texture end #x~x~%" (/ (-> this cur) 64)) + (set! (-> *ocean-envmap-texture-base* vram-word) (the-as uint (allocate-vram-words! this #x9400))) (set! (-> *ocean-envmap-texture-base* vram-block) (shr (-> *ocean-envmap-texture-base* vram-word) 6)) (set! (-> *ocean-envmap-texture-base* vram-page) (shr (-> *ocean-envmap-texture-base* vram-word) 11)) (set! (-> *ocean-texture-base* vram-word) (+ (-> *ocean-envmap-texture-base* vram-word) 4096)) @@ -403,15 +403,15 @@ (set! (-> *skull-gem-texture-base* vram-word) (+ #x9000 (-> *ocean-envmap-texture-base* vram-word))) (set! (-> *skull-gem-texture-base* vram-block) (shr (-> *skull-gem-texture-base* vram-word) 6)) (set! (-> *skull-gem-texture-base* vram-page) (shr (-> *skull-gem-texture-base* vram-word) 11)) - (format #t "dynamic end #x~x~%" (/ (-> obj cur) 64)) + (format #t "dynamic end #x~x~%" (/ (-> this cur) 64)) 0 (none) ) ;; definition for method 9 of type texture-page -(defmethod remove-data-from-heap texture-page ((obj texture-page) (heap kheap)) - (set! (-> heap current) (-> obj segment 0 block-data)) - obj +(defmethod remove-data-from-heap texture-page ((this texture-page) (heap kheap)) + (set! (-> heap current) (-> this segment 0 block-data)) + this ) ;; definition for function texture-page-default-allocate @@ -472,7 +472,7 @@ ;; definition for method 22 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod lay-out-sprite-tex texture-pool ((obj texture-pool)) +(defmethod lay-out-sprite-tex texture-pool ((this texture-pool)) (let ((vram-loc 0)) (countdown (level-idx 7) (let ((lev (-> *level* level level-idx))) @@ -503,7 +503,7 @@ ;; definition for method 23 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod lay-out-hud-tex texture-pool ((obj texture-pool)) +(defmethod lay-out-hud-tex texture-pool ((this texture-pool)) (let ((level-idx 0)) (countdown (vram-loc 7) (let ((lev (-> *level* level vram-loc))) @@ -534,7 +534,7 @@ ;; definition for method 24 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod lay-out-warp-tex texture-pool ((obj texture-pool)) +(defmethod lay-out-warp-tex texture-pool ((this texture-pool)) (let ((vram-loc 0)) (countdown (level-idx 7) (let ((lev (-> *level* level level-idx))) @@ -588,9 +588,9 @@ ;; definition for method 25 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod clear-ids texture-pool ((obj texture-pool)) +(defmethod clear-ids texture-pool ((this texture-pool)) (dotimes (v1-0 128) - (set! (-> obj ids v1-0) (the-as uint 0)) + (set! (-> this ids v1-0) (the-as uint 0)) ) 0 (none) @@ -598,28 +598,28 @@ ;; definition for method 20 of type texture-pool ;; WARN: Return type mismatch symbol vs none. -(defmethod update-sprites texture-pool ((obj texture-pool)) - (lay-out-sprite-tex obj) - (clear-ids obj) - (set! (-> obj update-sprites-flag) #f) +(defmethod update-sprites texture-pool ((this texture-pool)) + (lay-out-sprite-tex this) + (clear-ids this) + (set! (-> this update-sprites-flag) #f) (none) ) ;; definition for method 19 of type texture-pool ;; WARN: Return type mismatch symbol vs none. -(defmethod update-warp-and-hud texture-pool ((obj texture-pool)) - (lay-out-hud-tex obj) - (lay-out-warp-tex obj) - (clear-ids obj) - (set! (-> obj update-flag) #f) +(defmethod update-warp-and-hud texture-pool ((this texture-pool)) + (lay-out-hud-tex this) + (lay-out-warp-tex this) + (clear-ids this) + (set! (-> this update-flag) #f) (none) ) ;; definition for method 21 of type texture-pool ;; WARN: Return type mismatch symbol vs none. -(defmethod mark-hud-warp-sprite-dirty texture-pool ((obj texture-pool)) - (set! (-> obj update-sprites-flag) #t) - (set! (-> obj update-flag) #t) +(defmethod mark-hud-warp-sprite-dirty texture-pool ((this texture-pool)) + (set! (-> this update-sprites-flag) #t) + (set! (-> this update-flag) #t) (none) ) @@ -1408,13 +1408,13 @@ ;; definition for method 13 of type texture-page ;; WARN: Return type mismatch int vs none. -(defmethod upload-now! texture-page ((obj texture-page) (arg0 tex-upload-mode)) +(defmethod upload-now! texture-page ((this texture-page) (arg0 tex-upload-mode)) (let ((gp-0 *txt-dma-list*)) (let ((v1-0 gp-0)) (set! (-> v1-0 base) (-> v1-0 data)) (set! (-> v1-0 end) (&-> v1-0 data-buffer (-> v1-0 allocated-length))) ) - (add-to-dma-buffer obj gp-0 arg0) + (add-to-dma-buffer this gp-0 arg0) (dma-buffer-add-gs-set gp-0 (texflush 1)) (let* ((v1-6 gp-0) (a0-7 (the-as object (-> v1-6 base))) @@ -1430,7 +1430,7 @@ ) ;; definition for method 12 of type texture-page -(defmethod add-to-dma-buffer texture-page ((obj texture-page) (arg0 dma-buffer) (arg1 tex-upload-mode)) +(defmethod add-to-dma-buffer texture-page ((this texture-page) (arg0 dma-buffer) (arg1 tex-upload-mode)) (local-vars (sv-16 int)) (let ((v1-0 arg1)) (set! sv-16 (cond @@ -1438,21 +1438,21 @@ 0 ) ((= v1-0 (tex-upload-mode seg0-1)) - (the-as int (+ (-> obj segment 0 size) (-> obj segment 1 size))) + (the-as int (+ (-> this segment 0 size) (-> this segment 1 size))) ) ((= v1-0 (tex-upload-mode seg0-1-2)) - (the-as int (-> obj size)) + (the-as int (-> this size)) ) (else - (the-as int (-> obj segment (the-as int arg1) size)) + (the-as int (-> this segment (the-as int arg1) size)) ) ) ) ) (let* ((v1-7 (max 0 (the-as int arg1))) (a3-4 (* (/ (+ (/ sv-16 64) 63) 64) 32)) - (t1-0 (shr (-> obj segment v1-7 dest) 6)) - (a2-10 (-> obj segment v1-7 block-data)) + (t1-0 (shr (-> this segment v1-7 dest) 6)) + (a2-10 (-> this segment v1-7 block-data)) ) (upload-vram-data arg0 (the-as int t1-0) a2-10 a3-4 128) ) @@ -1548,10 +1548,10 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod setup-font-texture texture-pool ((obj texture-pool)) +(defmethod setup-font-texture texture-pool ((this texture-pool)) (local-vars (sv-16 int) (sv-20 int)) - (let ((s3-0 (-> obj font-palette))) - (set! sv-16 (-> obj cur)) + (let ((s3-0 (-> this font-palette))) + (set! sv-16 (-> this cur)) (set! sv-20 (/ s3-0 64)) (let ((s5-0 (texture-page-login (new 'static 'texture-id :index #x1 :page #xc04) texture-page-default-allocate global) @@ -1626,8 +1626,8 @@ (dma-buffer-send-chain (the-as dma-bank-source #x10009000) s4-0) ) (dma-sync (the-as pointer #x10009000) 0 0) - (if (and s5-0 (-> s5-0 page) (= (-> obj cur) (+ sv-16 (-> s5-0 page size)))) - (set! (-> obj cur) sv-16) + (if (and s5-0 (-> s5-0 page) (= (-> this cur) (+ sv-16 (-> s5-0 page size)))) + (set! (-> this cur) sv-16) (format 0 "ERROR: could not resize texture pool to remove gamefont.~%") ) ) @@ -1638,32 +1638,32 @@ ;; definition for method 5 of type texture-page-dir ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of texture-page-dir ((obj texture-page-dir)) - (the-as int (+ (-> texture-page-dir size) (* 12 (+ (-> obj length) -1)))) +(defmethod asize-of texture-page-dir ((this texture-page-dir)) + (the-as int (+ (-> texture-page-dir size) (* 12 (+ (-> this length) -1)))) ) ;; definition for method 4 of type texture-page-dir -(defmethod length texture-page-dir ((obj texture-page-dir)) - (-> obj length) +(defmethod length texture-page-dir ((this texture-page-dir)) + (-> this length) ) ;; definition for method 7 of type texture-page-dir ;; WARN: Return type mismatch texture-page-dir vs none. -(defmethod relocate texture-page-dir ((obj texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) - (set! *texture-page-dir* obj) +(defmethod relocate texture-page-dir ((this texture-page-dir) (arg0 kheap) (arg1 (pointer uint8))) + (set! *texture-page-dir* this) (none) ) ;; definition for method 11 of type texture-page ;; WARN: Return type mismatch texture-page vs none. -(defmethod relocate-dests! texture-page ((obj texture-page) (new-dest int) (segs int)) +(defmethod relocate-dests! texture-page ((this texture-page) (new-dest int) (segs int)) (let ((new-tbp (shr new-dest 6)) - (old-tbp (shr (-> obj segment segs dest) 6)) + (old-tbp (shr (-> this segment segs dest) 6)) ) (when (!= new-tbp old-tbp) - (dotimes (tex-idx (-> obj length)) - (when (-> obj data tex-idx) - (let* ((tex (-> obj data tex-idx)) + (dotimes (tex-idx (-> this length)) + (when (-> this data tex-idx) + (let* ((tex (-> this data tex-idx)) (num-mips (-> tex num-mips)) ) (if (zero? segs) @@ -1685,53 +1685,53 @@ ) ) ) - (set! (-> obj segment segs dest) (the-as uint new-dest)) + (set! (-> this segment segs dest) (the-as uint new-dest)) ) ) (none) ) ;; definition for method 7 of type texture-page -(defmethod relocate texture-page ((obj texture-page) (loading-heap kheap) (name (pointer uint8))) +(defmethod relocate texture-page ((this texture-page) (loading-heap kheap) (name (pointer uint8))) (cond - ((or (not obj) (not (file-info-correct-version? (-> obj info) (file-kind tpage) 0))) + ((or (not this) (not (file-info-correct-version? (-> this info) (file-kind tpage) 0))) (the-as texture-page #f) ) (else (let ((loading-level (-> *level* loading-level))) (when loading-level - (set! (-> loading-level loaded-texture-page (-> loading-level loaded-texture-page-count)) obj) + (set! (-> loading-level loaded-texture-page (-> loading-level loaded-texture-page-count)) this) (+! (-> loading-level loaded-texture-page-count) 1) (if (and (>= (-> loading-level loaded-texture-page-count) 2) (zero? (-> loading-level load-buffer-mode))) (set! (-> loading-level load-buffer-mode) (load-buffer-mode small-center)) ) ) ) - (set! (-> obj segment 1 dest) (-> obj segment 0 size)) - (set! (-> obj segment 2 dest) (+ (-> obj segment 0 size) (-> obj segment 1 size))) - (let* ((tpage-id (-> obj id)) + (set! (-> this segment 1 dest) (-> this segment 0 size)) + (set! (-> this segment 2 dest) (+ (-> this segment 0 size) (-> this segment 1 size))) + (let* ((tpage-id (-> this id)) (dir-entry (-> *texture-page-dir* entries tpage-id)) ) (set! (-> *texture-relocate-later* memcpy) #f) - ((-> *texture-pool* allocate-func) *texture-pool* obj loading-heap (the-as int tpage-id)) + ((-> *texture-pool* allocate-func) *texture-pool* this loading-heap (the-as int tpage-id)) (cond ((not (-> *texture-relocate-later* memcpy)) - (set! (-> dir-entry page) obj) + (set! (-> dir-entry page) this) (if (not (-> dir-entry link)) (set! (-> dir-entry link) - (the-as texture-link (malloc 'loading-level (* (max (-> dir-entry length) (-> obj length)) 4))) + (the-as texture-link (malloc 'loading-level (* (max (-> dir-entry length) (-> this length)) 4))) ) ) ) (else (let ((v1-19 *texture-relocate-later*)) (set! (-> v1-19 entry) dir-entry) - (set! (-> v1-19 page) obj) + (set! (-> v1-19 page) this) ) ) ) ) - obj + this ) ) ) @@ -1869,7 +1869,7 @@ ;; definition for method 17 of type texture-pool ;; WARN: Return type mismatch int vs none. -(defmethod unload-page texture-pool ((obj texture-pool) (arg0 texture-page)) +(defmethod unload-page texture-pool ((this texture-pool) (arg0 texture-page)) (local-vars (a0-2 int)) (let ((v1-0 *texture-page-dir*)) (dotimes (a0-1 (-> v1-0 length)) @@ -1912,13 +1912,13 @@ ) ;; definition for method 9 of type texture-page-dir -(defmethod unlink-shaders-in-heap texture-page-dir ((obj texture-page-dir) (heap kheap)) +(defmethod unlink-shaders-in-heap texture-page-dir ((this texture-page-dir) (heap kheap)) (local-vars (dist-past-end uint)) (let ((mem-start (-> heap base)) (mem-end (-> heap top-base)) ) - (dotimes (entry-idx (-> obj length)) - (let* ((entry (-> obj entries entry-idx)) + (dotimes (entry-idx (-> this length)) + (let* ((entry (-> this entries entry-idx)) (tex-page (-> entry page)) ) (when tex-page @@ -2259,9 +2259,9 @@ ) ;; definition for method 3 of type texture-page-dir -(defmethod inspect texture-page-dir ((obj texture-page-dir)) - (texture-page-dir-inspect obj #f) - obj +(defmethod inspect texture-page-dir ((this texture-page-dir)) + (texture-page-dir-inspect this #f) + this ) ;; definition for symbol *texture-pool*, type texture-pool diff --git a/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc index cc1a59f7c7..b9a09c3cee 100644 --- a/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type dma-foreground-sink -(defmethod inspect dma-foreground-sink ((obj dma-foreground-sink)) - (when (not obj) - (set! obj obj) +(defmethod inspect dma-foreground-sink ((this dma-foreground-sink)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tbucket: ~D~%" (-> obj bucket)) - (format #t "~1Tforeground-texture-page: ~D~%" (-> obj foreground-texture-page)) - (format #t "~1Tforeground-texture-level: ~D~%" (-> obj foreground-texture-level)) - (format #t "~1Tforeground-output-bucket: ~D~%" (-> obj foreground-output-bucket)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tbucket: ~D~%" (-> this bucket)) + (format #t "~1Tforeground-texture-page: ~D~%" (-> this foreground-texture-page)) + (format #t "~1Tforeground-texture-level: ~D~%" (-> this foreground-texture-level)) + (format #t "~1Tforeground-output-bucket: ~D~%" (-> this foreground-output-bucket)) (label cfg-4) - obj + this ) ;; definition of type generic-bucket-state @@ -40,16 +40,16 @@ ) ;; definition for method 3 of type generic-bucket-state -(defmethod inspect generic-bucket-state ((obj generic-bucket-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-bucket-state ((this generic-bucket-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'generic-bucket-state) - (format #t "~1Tgifbuf-adr: ~D~%" (-> obj gifbuf-adr)) - (format #t "~1Tinbuf-adr: ~D~%" (-> obj inbuf-adr)) + (format #t "[~8x] ~A~%" this 'generic-bucket-state) + (format #t "~1Tgifbuf-adr: ~D~%" (-> this gifbuf-adr)) + (format #t "~1Tinbuf-adr: ~D~%" (-> this inbuf-adr)) (label cfg-4) - obj + this ) ;; definition of type generic-dma-foreground-sink @@ -62,24 +62,20 @@ ) ;; definition for method 3 of type generic-dma-foreground-sink -(defmethod inspect generic-dma-foreground-sink ((obj generic-dma-foreground-sink)) - (when (not obj) - (set! obj obj) +(defmethod inspect generic-dma-foreground-sink ((this generic-dma-foreground-sink)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tbucket: ~D~%" (-> obj bucket)) - (format #t "~1Tforeground-texture-page: ~D~%" (-> obj foreground-texture-page)) - (format #t "~1Tforeground-texture-level: ~D~%" (-> obj foreground-texture-level)) - (format #t "~1Tforeground-output-bucket: ~D~%" (-> obj foreground-output-bucket)) - (format #t "~1Tstate: #~%" (-> obj state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tbucket: ~D~%" (-> this bucket)) + (format #t "~1Tforeground-texture-page: ~D~%" (-> this foreground-texture-page)) + (format #t "~1Tforeground-texture-level: ~D~%" (-> this foreground-texture-level)) + (format #t "~1Tforeground-output-bucket: ~D~%" (-> this foreground-output-bucket)) + (format #t "~1Tstate: #~%" (-> this state)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc b/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc index 39489d1eb7..2e8a5611f6 100644 --- a/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc @@ -17,20 +17,20 @@ ) ;; definition for method 3 of type bsp-node -(defmethod inspect bsp-node ((obj bsp-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect bsp-node ((this bsp-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bsp-node) - (format #t "~1Tfront: ~D~%" (-> obj front)) - (format #t "~1Tback: ~D~%" (-> obj back)) - (format #t "~1Tfront-box-min: #~%" (-> obj front-box-min)) - (format #t "~1Tfront-box-max: #~%" (-> obj front-box-max)) - (format #t "~1Tback-box-min: #~%" (-> obj back-box-min)) - (format #t "~1Tback-box-max: #~%" (-> obj back-box-max)) + (format #t "[~8x] ~A~%" this 'bsp-node) + (format #t "~1Tfront: ~D~%" (-> this front)) + (format #t "~1Tback: ~D~%" (-> this back)) + (format #t "~1Tfront-box-min: #~%" (-> this front-box-min)) + (format #t "~1Tfront-box-max: #~%" (-> this front-box-max)) + (format #t "~1Tback-box-min: #~%" (-> this back-box-min)) + (format #t "~1Tback-box-max: #~%" (-> this back-box-max)) (label cfg-4) - obj + this ) ;; definition of type bsp-header @@ -111,15 +111,15 @@ ) ;; definition for method 3 of type game-level -(defmethod inspect game-level ((obj game-level)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-level ((this game-level)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmaster-bsp: ~A~%" (-> obj master-bsp)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmaster-bsp: ~A~%" (-> this master-bsp)) (label cfg-4) - obj + this ) ;; definition of type view-frustum @@ -139,34 +139,34 @@ ) ;; definition for method 3 of type view-frustum -(defmethod inspect view-frustum ((obj view-frustum)) - (when (not obj) - (set! obj obj) +(defmethod inspect view-frustum ((this view-frustum)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'view-frustum) - (format #t "~1Thither-top-left: #~%" (-> obj hither-top-left)) - (format #t "~1Thither-top-right: #~%" (-> obj hither-top-right)) - (format #t "~1Thither-bottom-left: #~%" (-> obj hither-bottom-left)) - (format #t "~1Thither-bottom-right: #~%" (-> obj hither-bottom-right)) - (format #t "~1Tyon-top-left: #~%" (-> obj yon-top-left)) - (format #t "~1Tyon-top-right: #~%" (-> obj yon-top-right)) - (format #t "~1Tyon-bottom-left: #~%" (-> obj yon-bottom-left)) - (format #t "~1Tyon-bottom-right: #~%" (-> obj yon-bottom-right)) + (format #t "[~8x] ~A~%" this 'view-frustum) + (format #t "~1Thither-top-left: #~%" (-> this hither-top-left)) + (format #t "~1Thither-top-right: #~%" (-> this hither-top-right)) + (format #t "~1Thither-bottom-left: #~%" (-> this hither-bottom-left)) + (format #t "~1Thither-bottom-right: #~%" (-> this hither-bottom-right)) + (format #t "~1Tyon-top-left: #~%" (-> this yon-top-left)) + (format #t "~1Tyon-top-right: #~%" (-> this yon-top-right)) + (format #t "~1Tyon-bottom-left: #~%" (-> this yon-bottom-left)) + (format #t "~1Tyon-bottom-right: #~%" (-> this yon-bottom-right)) (label cfg-4) - obj + this ) ;; definition for method 3 of type bsp-header -(defmethod inspect bsp-header ((obj bsp-header)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tall-visible-list: #x~X~%" (-> obj all-visible-list)) - (format #t "~Tvisible-list-length: ~D~%" (-> obj visible-list-length)) - (format #t "~Tdrawable-trees: ~A~%" (-> obj drawable-trees)) - (format #t "~Tpat: #x~X~%" (-> obj pat)) - (format #t "~Tpat-length: ~D~%" (-> obj pat-length)) - (inspect-bsp-tree obj (-> obj nodes 0)) - obj +(defmethod inspect bsp-header ((this bsp-header)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tall-visible-list: #x~X~%" (-> this all-visible-list)) + (format #t "~Tvisible-list-length: ~D~%" (-> this visible-list-length)) + (format #t "~Tdrawable-trees: ~A~%" (-> this drawable-trees)) + (format #t "~Tpat: #x~X~%" (-> this pat)) + (format #t "~Tpat-length: ~D~%" (-> this pat-length)) + (inspect-bsp-tree this (-> this nodes 0)) + this ) ;; definition (debug) for function inspect-bsp-tree @@ -234,23 +234,23 @@ ) ;; definition for method 3 of type collide-stats -(defmethod inspect collide-stats ((obj collide-stats)) - (when (not obj) - (set! obj obj) +(defmethod inspect collide-stats ((this collide-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-stats) - (format #t "~1Tcalls: ~D~%" (-> obj calls)) - (format #t "~1Tspheres: ~D~%" (-> obj spheres)) - (format #t "~1Tnodes: ~D~%" (-> obj nodes)) - (format #t "~1Tfrags: ~D~%" (-> obj frags)) - (format #t "~1Ttris: ~D~%" (-> obj tris)) - (format #t "~1Toutput: ~D~%" (-> obj output)) - (format #t "~1Ttotal-target: #~%" (&-> obj pad0 1)) - (format #t "~1Ttarget-cache-fill: #~%" (&-> obj total-target 7)) - (format #t "~1Ttarget-ray-poly: #~%" (&-> obj target-cache-fill 7)) + (format #t "[~8x] ~A~%" this 'collide-stats) + (format #t "~1Tcalls: ~D~%" (-> this calls)) + (format #t "~1Tspheres: ~D~%" (-> this spheres)) + (format #t "~1Tnodes: ~D~%" (-> this nodes)) + (format #t "~1Tfrags: ~D~%" (-> this frags)) + (format #t "~1Ttris: ~D~%" (-> this tris)) + (format #t "~1Toutput: ~D~%" (-> this output)) + (format #t "~1Ttotal-target: #~%" (&-> this pad0 1)) + (format #t "~1Ttarget-cache-fill: #~%" (&-> this total-target 7)) + (format #t "~1Ttarget-ray-poly: #~%" (&-> this target-cache-fill 7)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/level/bsp_REF.gc b/test/decompiler/reference/jak2/engine/level/bsp_REF.gc index 5e31b7bdfc..33c7b9d770 100644 --- a/test/decompiler/reference/jak2/engine/level/bsp_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/bsp_REF.gc @@ -27,22 +27,22 @@ ) ;; definition for method 8 of type bsp-header -(defmethod mem-usage bsp-header ((obj bsp-header) (arg0 memory-usage-block) (arg1 int)) - (set! (-> arg0 work-bsp) obj) - (when (nonzero? (-> obj info)) +(defmethod mem-usage bsp-header ((this bsp-header) (arg0 memory-usage-block) (arg1 int)) + (set! (-> arg0 work-bsp) this) + (when (nonzero? (-> this info)) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") (+! (-> arg0 data 84 count) 1) - (let ((v1-8 (asize-of (-> obj info)))) + (let ((v1-8 (asize-of (-> this info)))) (+! (-> arg0 data 84 used) v1-8) (+! (-> arg0 data 84 total) (logand -16 (+ v1-8 15))) ) ) - (if (nonzero? (-> obj drawable-trees)) - (mem-usage (-> obj drawable-trees) arg0 arg1) + (if (nonzero? (-> this drawable-trees)) + (mem-usage (-> this drawable-trees) arg0 arg1) ) - (if (nonzero? (-> obj collide-hash)) - (mem-usage (-> obj collide-hash) arg0 arg1) + (if (nonzero? (-> this collide-hash)) + (mem-usage (-> this collide-hash) arg0 arg1) ) (set! (-> arg0 length) (max 65 (-> arg0 length))) (set! (-> arg0 data 43 name) "entity") @@ -59,79 +59,79 @@ (set! (-> arg0 length) (max 62 (-> arg0 length))) (set! (-> arg0 data 61 name) "bsp-leaf-vis-self") (+! (-> arg0 data 61 count) 1) - (let ((v1-40 (-> obj visible-list-length))) + (let ((v1-40 (-> this visible-list-length))) (+! (-> arg0 data 61 used) v1-40) (+! (-> arg0 data 61 total) (logand -16 (+ v1-40 15))) ) (set! (-> arg0 length) (max 60 (-> arg0 length))) (set! (-> arg0 data 59 name) "bsp-misc") (+! (-> arg0 data 59 count) 1) - (let ((v1-50 (* (-> obj texture-remap-table-len) 8))) + (let ((v1-50 (* (-> this texture-remap-table-len) 8))) (+! (-> arg0 data 59 used) v1-50) (+! (-> arg0 data 59 total) (logand -16 (+ v1-50 15))) ) (set! (-> arg0 length) (max 60 (-> arg0 length))) (set! (-> arg0 data 59 name) "bsp-misc") (+! (-> arg0 data 59 count) 1) - (let ((v1-60 (* (-> obj texture-page-count) 4))) + (let ((v1-60 (* (-> this texture-page-count) 4))) (+! (-> arg0 data 59 used) v1-60) (+! (-> arg0 data 59 total) (logand -16 (+ v1-60 15))) ) - (when (nonzero? (-> obj unknown-basic)) + (when (nonzero? (-> this unknown-basic)) (set! (-> arg0 length) (max 60 (-> arg0 length))) (set! (-> arg0 data 59 name) "bsp-misc") (+! (-> arg0 data 59 count) 1) - (let ((v1-72 (asize-of (-> obj unknown-basic)))) + (let ((v1-72 (asize-of (-> this unknown-basic)))) (+! (-> arg0 data 59 used) v1-72) (+! (-> arg0 data 59 total) (logand -16 (+ v1-72 15))) ) ) - (when (nonzero? (-> obj actor-birth-order)) + (when (nonzero? (-> this actor-birth-order)) (set! (-> arg0 length) (max 60 (-> arg0 length))) (set! (-> arg0 data 59 name) "bsp-misc") (+! (-> arg0 data 59 count) 1) - (let ((v1-85 (* (-> obj actors length) 4))) + (let ((v1-85 (* (-> this actors length) 4))) (+! (-> arg0 data 59 used) v1-85) (+! (-> arg0 data 59 total) (logand -16 (+ v1-85 15))) ) ) - (+! (-> arg0 data 64 count) (-> obj pat-length)) - (let ((v1-92 (* (-> obj pat-length) 4))) + (+! (-> arg0 data 64 count) (-> this pat-length)) + (let ((v1-92 (* (-> this pat-length) 4))) (+! (-> arg0 data 64 used) v1-92) (+! (-> arg0 data 64 total) (logand -16 (+ v1-92 15))) ) - (when (nonzero? (-> obj region-trees)) - (let* ((s3-0 (-> obj region-trees length)) + (when (nonzero? (-> this region-trees)) + (let* ((s3-0 (-> this region-trees length)) (s2-0 0) - (a0-39 (-> obj region-trees s2-0)) + (a0-39 (-> this region-trees s2-0)) ) (while (< s2-0 s3-0) (mem-usage a0-39 arg0 (logior arg1 128)) (+! s2-0 1) - (set! a0-39 (-> obj region-trees s2-0)) + (set! a0-39 (-> this region-trees s2-0)) ) ) ) - (let ((s3-1 (-> obj cameras))) + (let ((s3-1 (-> this cameras))) (when (nonzero? s3-1) (dotimes (s2-1 (-> s3-1 length)) (mem-usage (-> s3-1 s2-1) arg0 (logior arg1 256)) ) ) ) - (if (nonzero? (-> obj nodes)) - (mem-usage-bsp-tree obj (-> obj nodes 0) arg0 arg1) + (if (nonzero? (-> this nodes)) + (mem-usage-bsp-tree this (-> this nodes 0) arg0 arg1) ) - obj + this ) ;; definition for method 9 of type bsp-header -(defmethod login bsp-header ((obj bsp-header)) - (if (nonzero? (-> obj drawable-trees)) - (login (-> obj drawable-trees)) +(defmethod login bsp-header ((this bsp-header)) + (if (nonzero? (-> this drawable-trees)) + (login (-> this drawable-trees)) ) - (set! (-> obj level tfrag-gs-test) - (if (logtest? (-> obj texture-flags 0) (texture-page-flag alpha-enable)) + (set! (-> this level tfrag-gs-test) + (if (logtest? (-> this texture-flags 0) (texture-page-flag alpha-enable)) (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest greater-equal)) (new 'static 'gs-test :ate #x1 @@ -142,7 +142,7 @@ ) ) ) - obj + this ) ;; definition for symbol *test-shrub*, type int @@ -151,7 +151,7 @@ ;; definition for method 10 of type bsp-header ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw bsp-header ((obj bsp-header) (arg0 bsp-header) (arg1 display-frame)) +(defmethod draw bsp-header ((this bsp-header) (arg0 bsp-header) (arg1 display-frame)) (local-vars (a3-4 uint128) (a3-5 uint128)) (rlet ((vf16 :class vf) (vf17 :class vf) @@ -170,7 +170,7 @@ (vf30 :class vf) (vf31 :class vf) ) - (let ((s4-0 (-> obj level))) + (let ((s4-0 (-> this level))) (when (-> s4-0 render?) (set! *draw-index* (-> s4-0 draw-index)) (set! (-> *prototype-tie-work* mood) (-> s4-0 mood-context)) @@ -178,7 +178,7 @@ (update-subdivide-settings! *subdivide-settings* *math-camera* 7) (update-subdivide-settings! *subdivide-settings* *math-camera* (-> s4-0 index)) ) - (let ((a2-3 (/ (+ (-> obj visible-list-length) 15) 16))) + (let ((a2-3 (/ (+ (-> this visible-list-length) 15) 16))) (dma-send-to-spr-no-flush (the-as uint (-> (the-as terrain-context #x70000000) work background vis-list)) (the-as uint (-> s4-0 vis-bits)) @@ -187,9 +187,9 @@ ) ) (when *artist-flip-visible* - (let ((v1-15 (/ (+ (-> obj visible-list-length) 15) 16)) + (let ((v1-15 (/ (+ (-> this visible-list-length) 15) 16)) (a0-7 (-> (the-as terrain-context #x70000000) work background vis-list)) - (a1-5 (-> obj all-visible-list)) + (a1-5 (-> this all-visible-list)) ) (dotimes (a2-4 v1-15) (let ((a3-3 (-> (the-as (pointer uint128) (+ (the-as uint a0-7) (* a2-4 16)))))) @@ -220,7 +220,7 @@ (.lvf vf30 (&-> at-0 camera-temp quad 2)) (.lvf vf31 (&-> at-0 camera-temp trans quad)) ) - (when (nonzero? (-> obj drawable-trees)) + (when (nonzero? (-> this drawable-trees)) (when *debug-segment* (let ((s4-1 (-> *display* frames (-> *display* on-screen) profile-array data 0)) (v1-27 'bsp) @@ -243,7 +243,7 @@ ) 0 ) - (let ((a1-8 (-> obj drawable-trees))) + (let ((a1-8 (-> this drawable-trees))) (draw a1-8 a1-8 arg1) ) (when *debug-segment* @@ -272,7 +272,7 @@ ;; definition for method 14 of type bsp-header ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw bsp-header ((obj bsp-header) (arg0 drawable) (arg1 display-frame)) +(defmethod debug-draw bsp-header ((this bsp-header) (arg0 drawable) (arg1 display-frame)) (rlet ((vf16 :class vf) (vf17 :class vf) (vf18 :class vf) @@ -290,10 +290,10 @@ (vf30 :class vf) (vf31 :class vf) ) - (let ((v1-0 (-> obj level))) + (let ((v1-0 (-> this level))) (set! *draw-index* (-> v1-0 draw-index)) (set! (-> *prototype-tie-work* mood) (-> v1-0 mood-context)) - (let ((a2-1 (/ (+ (-> obj visible-list-length) 15) 16))) + (let ((a2-1 (/ (+ (-> this visible-list-length) 15) 16))) (dma-send-to-spr-no-flush (the-as uint (+ #x38a0 #x70000000)) (the-as uint (-> v1-0 vis-bits)) @@ -320,8 +320,8 @@ (.lvf vf30 (&-> at-0 camera-temp quad 2)) (.lvf vf31 (&-> at-0 camera-temp trans quad)) ) - (when (nonzero? (-> obj drawable-trees)) - (let ((a1-4 (-> obj drawable-trees))) + (when (nonzero? (-> this drawable-trees)) + (let ((a1-4 (-> this drawable-trees))) (debug-draw a1-4 a1-4 arg1) ) ) @@ -332,7 +332,7 @@ ;; definition for method 13 of type bsp-header ;; WARN: Return type mismatch int vs none. -(defmethod collect-stats bsp-header ((obj bsp-header)) +(defmethod collect-stats bsp-header ((this bsp-header)) (rlet ((vf16 :class vf) (vf17 :class vf) (vf18 :class vf) @@ -350,8 +350,8 @@ (vf30 :class vf) (vf31 :class vf) ) - (let ((v1-0 (-> obj level)) - (a2-0 (/ (+ (-> obj visible-list-length) 15) 16)) + (let ((v1-0 (-> this level)) + (a2-0 (/ (+ (-> this visible-list-length) 15) 16)) ) (dma-send-to-spr-no-flush (the-as uint (+ #x38a0 #x70000000)) @@ -378,8 +378,8 @@ (.lvf vf30 (&-> at-0 camera-temp quad 2)) (.lvf vf31 (&-> at-0 camera-temp trans quad)) ) - (if (nonzero? (-> obj drawable-trees)) - (collect-stats (-> obj drawable-trees)) + (if (nonzero? (-> this drawable-trees)) + (collect-stats (-> this drawable-trees)) ) 0 (none) @@ -493,13 +493,13 @@ ;; definition for method 16 of type bsp-header ;; WARN: Return type mismatch int vs none. -(defmethod collect-regions bsp-header ((obj bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions bsp-header ((this bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @param! region-list Stores the overlapping regions and a count for how many were found @returns none" - (let ((s3-0 (-> obj region-trees))) + (let ((s3-0 (-> this region-trees))) (dotimes (s2-0 (-> s3-0 length)) (collect-regions (-> s3-0 s2-0) arg0 arg1 arg2) ) diff --git a/test/decompiler/reference/jak2/engine/level/level-h_REF.gc b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc index 4db74567a4..a58d5993fa 100644 --- a/test/decompiler/reference/jak2/engine/level/level-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc @@ -23,17 +23,17 @@ ) ;; definition for method 3 of type level-vis-info -(defmethod inspect level-vis-info ((obj level-vis-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect level-vis-info ((this level-vis-info)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tfrom-level: ~A~%" (-> obj from-level)) - (format #t "~1Tfrom-bsp: ~A~%" (-> obj from-bsp)) - (format #t "~1Tflags: #x~X : (vis-info-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tfrom-level: ~A~%" (-> this from-level)) + (format #t "~1Tfrom-bsp: ~A~%" (-> this from-bsp)) + (format #t "~1Tflags: #x~X : (vis-info-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand (vis-info-flag dummy22) s5-0) (vis-info-flag dummy22)) (format #t "dummy22 ") ) @@ -132,23 +132,23 @@ ) ) (format #t ")~%") - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdictionary-length: ~D~%" (-> obj dictionary-length)) - (format #t "~1Tdictionary: #x~X~%" (-> obj dictionary)) - (format #t "~1Tstring-block: #x~X~%" (-> obj string-block)) - (format #t "~1Tramdisk: ~D~%" (-> obj ramdisk)) - (format #t "~1Tvis-bits: #x~X~%" (-> obj vis-bits)) - (format #t "~1Tcurrent-vis-string: ~D~%" (-> obj current-vis-string)) - (format #t "~1Tvis-string[0] @ #x~X~%" (-> obj vis-string)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdictionary-length: ~D~%" (-> this dictionary-length)) + (format #t "~1Tdictionary: #x~X~%" (-> this dictionary)) + (format #t "~1Tstring-block: #x~X~%" (-> this string-block)) + (format #t "~1Tramdisk: ~D~%" (-> this ramdisk)) + (format #t "~1Tvis-bits: #x~X~%" (-> this vis-bits)) + (format #t "~1Tcurrent-vis-string: ~D~%" (-> this current-vis-string)) + (format #t "~1Tvis-string[0] @ #x~X~%" (-> this vis-string)) (label cfg-68) - obj + this ) ;; definition for method 5 of type level-vis-info ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of level-vis-info ((obj level-vis-info)) - (the-as int (+ (-> level-vis-info size) (-> obj dictionary-length))) +(defmethod asize-of level-vis-info ((this level-vis-info)) + (the-as int (+ (-> level-vis-info size) (-> this dictionary-length))) ) ;; definition of type level-load-info @@ -224,62 +224,62 @@ ) ;; definition for method 3 of type level-load-info -(defmethod inspect level-load-info ((obj level-load-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect level-load-info ((this level-load-info)) + (when (not this) + (set! this this) (goto cfg-51) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname-list[6] @ #x~X~%" (&-> obj name)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Ttask-level: ~D~%" (-> obj task-level)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tvisname: ~A~%" (-> obj visname)) - (format #t "~1Tnickname: ~A~%" (-> obj nickname)) - (format #t "~1Tdbname: ~A~%" (-> obj dbname)) - (format #t "~1Ttaskname: ~A~%" (-> obj taskname)) - (format #t "~1Tpackages: ~A~%" (-> obj packages)) - (format #t "~1Tmemory-mode: ~D~%" (-> obj memory-mode)) - (format #t "~1Tmusic-bank: ~A~%" (-> obj music-bank)) - (format #t "~1Tambient-sounds: ~A~%" (-> obj ambient-sounds)) - (format #t "~1Tsound-reverb: ~f~%" (-> obj sound-reverb)) - (format #t "~1Tmood-func: ~A~%" (-> obj mood-func)) - (format #t "~1Tmood-init: ~A~%" (-> obj mood-init)) - (format #t "~1Tocean: ~A~%" (-> obj ocean)) - (format #t "~1Tsky: ~A~%" (-> obj sky)) - (format #t "~1Tuse-camera-other: ~A~%" (-> obj use-camera-other)) - (format #t "~1Tpart-engine-max: ~D~%" (-> obj part-engine-max)) - (format #t "~1Tcity-map-bits: ~D~%" (-> obj city-map-bits)) - (format #t "~1Tcontinues: ~A~%" (-> obj continues)) - (format #t "~1Ttasks: ~A~%" (-> obj tasks)) - (format #t "~1Tpriority: ~D~%" (-> obj priority)) - (format #t "~1Tload-commands: ~A~%" (-> obj load-commands)) - (format #t "~1Talt-load-commands: ~A~%" (-> obj alt-load-commands)) - (format #t "~1Tbsp-mask: ~D~%" (-> obj bsp-mask)) - (format #t "~1Tbuzzer: ~D~%" (-> obj buzzer)) - (format #t "~1Tbottom-height: (meters ~m)~%" (-> obj buttom-height)) - (format #t "~1Trun-packages: ~A~%" (-> obj run-packages)) - (format #t "~1Tprev-level: ~A~%" (-> obj prev-level)) - (format #t "~1Tnext-level: ~A~%" (-> obj next-level)) - (format #t "~1Twait-for-load: ~A~%" (-> obj wait-for-load)) - (format #t "~1Tlogin-func: ~A~%" (-> obj login-func)) - (format #t "~1Tactivate-func: ~A~%" (-> obj activate-func)) - (format #t "~1Tdeactivate-func: ~A~%" (-> obj deactivate-func)) - (format #t "~1Tkill-func: ~A~%" (-> obj kill-func)) - (format #t "~1Tborrow-size[2] @ #x~X~%" (-> obj borrow-size)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname-list[6] @ #x~X~%" (&-> this name)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Ttask-level: ~D~%" (-> this task-level)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tvisname: ~A~%" (-> this visname)) + (format #t "~1Tnickname: ~A~%" (-> this nickname)) + (format #t "~1Tdbname: ~A~%" (-> this dbname)) + (format #t "~1Ttaskname: ~A~%" (-> this taskname)) + (format #t "~1Tpackages: ~A~%" (-> this packages)) + (format #t "~1Tmemory-mode: ~D~%" (-> this memory-mode)) + (format #t "~1Tmusic-bank: ~A~%" (-> this music-bank)) + (format #t "~1Tambient-sounds: ~A~%" (-> this ambient-sounds)) + (format #t "~1Tsound-reverb: ~f~%" (-> this sound-reverb)) + (format #t "~1Tmood-func: ~A~%" (-> this mood-func)) + (format #t "~1Tmood-init: ~A~%" (-> this mood-init)) + (format #t "~1Tocean: ~A~%" (-> this ocean)) + (format #t "~1Tsky: ~A~%" (-> this sky)) + (format #t "~1Tuse-camera-other: ~A~%" (-> this use-camera-other)) + (format #t "~1Tpart-engine-max: ~D~%" (-> this part-engine-max)) + (format #t "~1Tcity-map-bits: ~D~%" (-> this city-map-bits)) + (format #t "~1Tcontinues: ~A~%" (-> this continues)) + (format #t "~1Ttasks: ~A~%" (-> this tasks)) + (format #t "~1Tpriority: ~D~%" (-> this priority)) + (format #t "~1Tload-commands: ~A~%" (-> this load-commands)) + (format #t "~1Talt-load-commands: ~A~%" (-> this alt-load-commands)) + (format #t "~1Tbsp-mask: ~D~%" (-> this bsp-mask)) + (format #t "~1Tbuzzer: ~D~%" (-> this buzzer)) + (format #t "~1Tbottom-height: (meters ~m)~%" (-> this buttom-height)) + (format #t "~1Trun-packages: ~A~%" (-> this run-packages)) + (format #t "~1Tprev-level: ~A~%" (-> this prev-level)) + (format #t "~1Tnext-level: ~A~%" (-> this next-level)) + (format #t "~1Twait-for-load: ~A~%" (-> this wait-for-load)) + (format #t "~1Tlogin-func: ~A~%" (-> this login-func)) + (format #t "~1Tactivate-func: ~A~%" (-> this activate-func)) + (format #t "~1Tdeactivate-func: ~A~%" (-> this deactivate-func)) + (format #t "~1Tkill-func: ~A~%" (-> this kill-func)) + (format #t "~1Tborrow-size[2] @ #x~X~%" (-> this borrow-size)) (dotimes (s5-0 2) - (format #t "~T [~D]~1Tborrow-size: ~`integer`P~%" s5-0 (-> obj borrow-size s5-0)) + (format #t "~T [~D]~1Tborrow-size: ~`integer`P~%" s5-0 (-> this borrow-size s5-0)) ) - (format #t "~1Tborrow-level[2] @ #x~X~%" (-> obj borrow-level)) + (format #t "~1Tborrow-level[2] @ #x~X~%" (-> this borrow-level)) (dotimes (s5-1 2) - (format #t "~T [~D]~1Tborrow-level: ~`symbol`P~%" s5-1 (-> obj borrow-level s5-1)) + (format #t "~T [~D]~1Tborrow-level: ~`symbol`P~%" s5-1 (-> this borrow-level s5-1)) ) - (format #t "~1Tborrow-display?[2] @ #x~X~%" (-> obj borrow-display?)) + (format #t "~1Tborrow-display?[2] @ #x~X~%" (-> this borrow-display?)) (dotimes (s5-2 2) - (format #t "~T [~D]~1Tborrow-display?: ~A~%" s5-2 (-> obj borrow-display? s5-2)) + (format #t "~T [~D]~1Tborrow-display?: ~A~%" s5-2 (-> this borrow-display? s5-2)) ) - (format #t "~1Tbase-task-mask: #x~X : (task-mask " (-> obj base-task-mask)) - (let ((s5-3 (-> obj base-task-mask))) + (format #t "~1Tbase-task-mask: #x~X : (task-mask " (-> this base-task-mask)) + (let ((s5-3 (-> this base-task-mask))) (if (= (logand s5-3 (task-mask task0)) (task-mask task0)) (format #t "task0 ") ) @@ -339,30 +339,30 @@ ) ) (format #t ")~%") - (format #t "~1Ttexture-anim[10] @ #x~X~%" (&-> obj texture-anim-tfrag)) - (format #t "~1Ttexture-anim-tfrag: ~A~%" (-> obj texture-anim-tfrag)) - (format #t "~1Ttexture-anim-pris: ~A~%" (-> obj texture-anim-pris)) - (format #t "~1Ttexture-anim-shrub: ~A~%" (-> obj texture-anim-shrub)) - (format #t "~1Ttexture-anim-alpha: ~A~%" (-> obj texture-anim-alpha)) - (format #t "~1Ttexture-anim-water: ~A~%" (-> obj texture-anim-water)) - (format #t "~1Ttexture-anim-warp: ~A~%" (-> obj texture-anim-twarp)) - (format #t "~1Ttexture-anim-pris2: ~A~%" (-> obj texture-anim-pris2)) - (format #t "~1Ttexture-anim-sprite: ~A~%" (-> obj texture-anim-sprite)) - (format #t "~1Ttexture-anim-map: ~A~%" (-> obj texture-anim-map)) - (format #t "~1Ttexture-anim-sky: ~A~%" (-> obj texture-anim-sky)) - (format #t "~1Tdraw-priority: ~f~%" (-> obj draw-priority)) - (format #t "~1Tlevel-flags: ~D~%" (-> obj level-flags)) - (format #t "~1Tfog-height: ~f~%" (-> obj fog-height)) - (format #t "~1Tbigmap-id: ~D~%" (-> obj bigmap-id)) - (format #t "~1Tocean-near-translucent?: ~A~%" (-> obj ocean-near-translucent?)) - (format #t "~1Tocean-far?: ~A~%" (-> obj ocean-far?)) - (format #t "~1Tmood-range: #~%" (-> obj mood-range)) - (format #t "~1Tmax-rain: ~f~%" (-> obj max-rain)) - (format #t "~1Tfog-mult: ~f~%" (-> obj fog-mult)) - (format #t "~1Tocean-alpha: ~f~%" (-> obj ocean-alpha)) - (format #t "~1Textra-sound-bank: ~A~%" (-> obj extra-sound-bank)) + (format #t "~1Ttexture-anim[10] @ #x~X~%" (&-> this texture-anim-tfrag)) + (format #t "~1Ttexture-anim-tfrag: ~A~%" (-> this texture-anim-tfrag)) + (format #t "~1Ttexture-anim-pris: ~A~%" (-> this texture-anim-pris)) + (format #t "~1Ttexture-anim-shrub: ~A~%" (-> this texture-anim-shrub)) + (format #t "~1Ttexture-anim-alpha: ~A~%" (-> this texture-anim-alpha)) + (format #t "~1Ttexture-anim-water: ~A~%" (-> this texture-anim-water)) + (format #t "~1Ttexture-anim-warp: ~A~%" (-> this texture-anim-twarp)) + (format #t "~1Ttexture-anim-pris2: ~A~%" (-> this texture-anim-pris2)) + (format #t "~1Ttexture-anim-sprite: ~A~%" (-> this texture-anim-sprite)) + (format #t "~1Ttexture-anim-map: ~A~%" (-> this texture-anim-map)) + (format #t "~1Ttexture-anim-sky: ~A~%" (-> this texture-anim-sky)) + (format #t "~1Tdraw-priority: ~f~%" (-> this draw-priority)) + (format #t "~1Tlevel-flags: ~D~%" (-> this level-flags)) + (format #t "~1Tfog-height: ~f~%" (-> this fog-height)) + (format #t "~1Tbigmap-id: ~D~%" (-> this bigmap-id)) + (format #t "~1Tocean-near-translucent?: ~A~%" (-> this ocean-near-translucent?)) + (format #t "~1Tocean-far?: ~A~%" (-> this ocean-far?)) + (format #t "~1Tmood-range: #~%" (-> this mood-range)) + (format #t "~1Tmax-rain: ~f~%" (-> this max-rain)) + (format #t "~1Tfog-mult: ~f~%" (-> this fog-mult)) + (format #t "~1Tocean-alpha: ~f~%" (-> this ocean-alpha)) + (format #t "~1Textra-sound-bank: ~A~%" (-> this extra-sound-bank)) (label cfg-51) - obj + this ) ;; definition of type login-state @@ -378,18 +378,18 @@ ) ;; definition for method 3 of type login-state -(defmethod inspect login-state ((obj login-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect login-state ((this login-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tstate: ~D~%" (-> obj state)) - (format #t "~1Tpos: ~D~%" (-> obj pos)) - (format #t "~1Telts: ~D~%" (-> obj elts)) - (format #t "~1Telt[16] @ #x~X~%" (-> obj elt)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tstate: ~D~%" (-> this state)) + (format #t "~1Tpos: ~D~%" (-> this pos)) + (format #t "~1Telts: ~D~%" (-> this elts)) + (format #t "~1Telt[16] @ #x~X~%" (-> this elt)) (label cfg-4) - obj + this ) ;; definition of type level @@ -497,63 +497,63 @@ ) ;; definition for method 3 of type level -(defmethod inspect level ((obj level)) - (when (not obj) - (set! obj obj) +(defmethod inspect level ((this level)) + (when (not this) + (set! this this) (goto cfg-48) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tload-name: ~A~%" (-> obj load-name)) - (format #t "~1Tnickname: ~A~%" (-> obj nickname)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tstatus: ~A~%" (-> obj status)) - (format #t "~1Tborrow-level[2] @ #x~X~%" (-> obj borrow-level)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tload-name: ~A~%" (-> this load-name)) + (format #t "~1Tnickname: ~A~%" (-> this nickname)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tborrow-level[2] @ #x~X~%" (-> this borrow-level)) (dotimes (s5-0 2) - (format #t "~T [~D]~1Tborrow-level: ~A~%" s5-0 (-> obj borrow-level s5-0)) + (format #t "~T [~D]~1Tborrow-level: ~A~%" s5-0 (-> this borrow-level s5-0)) ) - (format #t "~1Tborrow-from-level: ~A~%" (-> obj borrow-from-level)) - (format #t "~1Theap: #~%" (-> obj heap)) - (format #t "~1Tborrow-heap[2] @ #x~X~%" (-> obj borrow-heap)) - (format #t "~1Tbsp: ~A~%" (-> obj bsp)) - (format #t "~1Tart-group: ~A~%" (-> obj art-group)) - (format #t "~1Tinfo: ~A~%" (-> obj info)) - (format #t "~1Ttexture-page[18] @ #x~X~%" (-> obj texture-page)) - (format #t "~1Tloaded-texture-page[16] @ #x~X~%" (-> obj loaded-texture-page)) - (format #t "~1Tloaded-texture-page-count: ~D~%" (-> obj loaded-texture-page-count)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tclosest-object: (meters ~m)~%" (&-> obj closest-object)) - (format #t "~1Tupload-size[18] @ #x~X~%" (-> obj upload-size)) - (format #t "~1Tinside-boxes?: ~A~%" (-> obj inside-boxes)) - (format #t "~1Tdisplay?: ~A~%" (-> obj display?)) - (format #t "~1Trender?: ~A~%" (-> obj render?)) - (format #t "~1Tmeta-inside?: ~A~%" (-> obj meta-inside?)) - (format #t "~1Tforce-inside?: ~A~%" (-> obj force-inside?)) - (format #t "~1Tmood-context: #~%" (-> obj mood-context)) - (format #t "~1Tmood-func: ~A~%" (-> obj mood-func)) - (format #t "~1Tmood-init: ~A~%" (-> obj mood-init)) - (format #t "~1Tvis-bits: #x~X~%" (-> obj vis-bits)) - (format #t "~1Tall-visible?: ~A~%" (-> obj all-visible?)) - (format #t "~1Tforce-all-visible?: ~A~%" (-> obj force-all-visible?)) - (format #t "~1Tlinking: ~A~%" (-> obj linking)) - (format #t "~1Tvis-info[8] @ #x~X~%" (-> obj vis-info)) - (format #t "~1Tvis-self-index: ~D~%" (-> obj vis-self-index)) - (format #t "~1Tvis-adj-index: ~D~%" (-> obj vis-adj-index)) - (format #t "~1Tvis-buffer[2048] @ #x~X~%" (-> obj vis-buffer)) - (format #t "~1Tmem-usage-block: ~A~%" (-> obj mem-usage-block)) - (format #t "~1Tmem-usage: ~D~%" (-> obj mem-usage)) - (format #t "~1Tcode-memory-start: #x~X~%" (-> obj code-memory-start)) - (format #t "~1Tcode-memory-end: #x~X~%" (-> obj code-memory-end)) - (format #t "~1Tload-start-time: ~D~%" (-> obj load-start-time)) - (format #t "~1Tload-stop-time: ~D~%" (-> obj load-stop-time)) - (format #t "~1Tload-buffer[2] @ #x~X~%" (-> obj load-buffer)) - (format #t "~1Tload-buffer-size: ~D~%" (-> obj load-buffer-size)) - (format #t "~1Tload-buffer-last: ~A~%" (-> obj load-buffer-last)) - (format #t "~1Tload-buffer-mode: ~D~%" (-> obj load-buffer-mode)) - (format #t "~1Tdisplay-start-time: ~D~%" (-> obj display-start-time)) - (format #t "~1Tmemory-mask: #b~B~%" (-> obj memory-mask)) - (format #t "~1Ttask-mask: #x~X : (task-mask " (-> obj task-mask)) - (let ((s5-1 (-> obj task-mask))) + (format #t "~1Tborrow-from-level: ~A~%" (-> this borrow-from-level)) + (format #t "~1Theap: #~%" (-> this heap)) + (format #t "~1Tborrow-heap[2] @ #x~X~%" (-> this borrow-heap)) + (format #t "~1Tbsp: ~A~%" (-> this bsp)) + (format #t "~1Tart-group: ~A~%" (-> this art-group)) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (format #t "~1Ttexture-page[18] @ #x~X~%" (-> this texture-page)) + (format #t "~1Tloaded-texture-page[16] @ #x~X~%" (-> this loaded-texture-page)) + (format #t "~1Tloaded-texture-page-count: ~D~%" (-> this loaded-texture-page-count)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tclosest-object: (meters ~m)~%" (&-> this closest-object)) + (format #t "~1Tupload-size[18] @ #x~X~%" (-> this upload-size)) + (format #t "~1Tinside-boxes?: ~A~%" (-> this inside-boxes)) + (format #t "~1Tdisplay?: ~A~%" (-> this display?)) + (format #t "~1Trender?: ~A~%" (-> this render?)) + (format #t "~1Tmeta-inside?: ~A~%" (-> this meta-inside?)) + (format #t "~1Tforce-inside?: ~A~%" (-> this force-inside?)) + (format #t "~1Tmood-context: #~%" (-> this mood-context)) + (format #t "~1Tmood-func: ~A~%" (-> this mood-func)) + (format #t "~1Tmood-init: ~A~%" (-> this mood-init)) + (format #t "~1Tvis-bits: #x~X~%" (-> this vis-bits)) + (format #t "~1Tall-visible?: ~A~%" (-> this all-visible?)) + (format #t "~1Tforce-all-visible?: ~A~%" (-> this force-all-visible?)) + (format #t "~1Tlinking: ~A~%" (-> this linking)) + (format #t "~1Tvis-info[8] @ #x~X~%" (-> this vis-info)) + (format #t "~1Tvis-self-index: ~D~%" (-> this vis-self-index)) + (format #t "~1Tvis-adj-index: ~D~%" (-> this vis-adj-index)) + (format #t "~1Tvis-buffer[2048] @ #x~X~%" (-> this vis-buffer)) + (format #t "~1Tmem-usage-block: ~A~%" (-> this mem-usage-block)) + (format #t "~1Tmem-usage: ~D~%" (-> this mem-usage)) + (format #t "~1Tcode-memory-start: #x~X~%" (-> this code-memory-start)) + (format #t "~1Tcode-memory-end: #x~X~%" (-> this code-memory-end)) + (format #t "~1Tload-start-time: ~D~%" (-> this load-start-time)) + (format #t "~1Tload-stop-time: ~D~%" (-> this load-stop-time)) + (format #t "~1Tload-buffer[2] @ #x~X~%" (-> this load-buffer)) + (format #t "~1Tload-buffer-size: ~D~%" (-> this load-buffer-size)) + (format #t "~1Tload-buffer-last: ~A~%" (-> this load-buffer-last)) + (format #t "~1Tload-buffer-mode: ~D~%" (-> this load-buffer-mode)) + (format #t "~1Tdisplay-start-time: ~D~%" (-> this display-start-time)) + (format #t "~1Tmemory-mask: #b~B~%" (-> this memory-mask)) + (format #t "~1Ttask-mask: #x~X : (task-mask " (-> this task-mask)) + (let ((s5-1 (-> this task-mask))) (if (= (logand s5-1 (task-mask task0)) (task-mask task0)) (format #t "task0 ") ) @@ -613,34 +613,34 @@ ) ) (format #t ")~%") - (format #t "~1Ttfrag-gs-test: ~D~%" (-> obj tfrag-gs-test)) - (format #t "~1Ttexture-dirty-masks[10] @ #x~X~%" (-> obj texture-dirty-masks)) - (format #t "~1Ttexture-mask[18] @ #x~X~%" (-> obj texture-mask)) - (format #t "~1Tsky-mask: #~%" (-> obj sky-mask)) - (format #t "~1Ttfrag-masks: ~A~%" (-> obj tfrag-masks)) - (format #t "~1Ttfrag-dists: #x~X~%" (-> obj tfrag-dists)) - (format #t "~1Tshrub-masks: ~A~%" (-> obj shrub-masks)) - (format #t "~1Tshrub-dists: #x~X~%" (-> obj shrub-dists)) - (format #t "~1Talpha-masks: ~A~%" (-> obj alpha-masks)) - (format #t "~1Talpha-dists: #x~X~%" (-> obj alpha-dists)) - (format #t "~1Twater-masks: ~A~%" (-> obj water-masks)) - (format #t "~1Twater-dists: #x~X~%" (-> obj water-dists)) - (format #t "~1Ttfrag-last-calls[6] @ #x~X~%" (-> obj tfrag-last-calls)) - (format #t "~1Ttexture-anim-array[10] @ #x~X~%" (-> obj texture-anim-array)) - (format #t "~1Tlight-hash: ~A~%" (-> obj light-hash)) - (format #t "~1Tdraw-priority: ~f~%" (-> obj draw-priority)) - (format #t "~1Tdraw-index: ~D~%" (-> obj draw-index)) - (format #t "~1Tpart-engine: ~A~%" (-> obj part-engine)) - (format #t "~1Tuser-object[4] @ #x~X~%" (-> obj user-object)) + (format #t "~1Ttfrag-gs-test: ~D~%" (-> this tfrag-gs-test)) + (format #t "~1Ttexture-dirty-masks[10] @ #x~X~%" (-> this texture-dirty-masks)) + (format #t "~1Ttexture-mask[18] @ #x~X~%" (-> this texture-mask)) + (format #t "~1Tsky-mask: #~%" (-> this sky-mask)) + (format #t "~1Ttfrag-masks: ~A~%" (-> this tfrag-masks)) + (format #t "~1Ttfrag-dists: #x~X~%" (-> this tfrag-dists)) + (format #t "~1Tshrub-masks: ~A~%" (-> this shrub-masks)) + (format #t "~1Tshrub-dists: #x~X~%" (-> this shrub-dists)) + (format #t "~1Talpha-masks: ~A~%" (-> this alpha-masks)) + (format #t "~1Talpha-dists: #x~X~%" (-> this alpha-dists)) + (format #t "~1Twater-masks: ~A~%" (-> this water-masks)) + (format #t "~1Twater-dists: #x~X~%" (-> this water-dists)) + (format #t "~1Ttfrag-last-calls[6] @ #x~X~%" (-> this tfrag-last-calls)) + (format #t "~1Ttexture-anim-array[10] @ #x~X~%" (-> this texture-anim-array)) + (format #t "~1Tlight-hash: ~A~%" (-> this light-hash)) + (format #t "~1Tdraw-priority: ~f~%" (-> this draw-priority)) + (format #t "~1Tdraw-index: ~D~%" (-> this draw-index)) + (format #t "~1Tpart-engine: ~A~%" (-> this part-engine)) + (format #t "~1Tuser-object[4] @ #x~X~%" (-> this user-object)) (dotimes (s5-2 4) - (format #t "~T [~D]~1Tuser-object: ~A~%" s5-2 (-> obj user-object s5-2)) + (format #t "~T [~D]~1Tuser-object: ~A~%" s5-2 (-> this user-object s5-2)) ) - (format #t "~1Tloaded-text-info-count: ~D~%" (-> obj loaded-text-info-count)) - (format #t "~1Tloaded-text-info[8] @ #x~X~%" (-> obj loaded-text-info)) - (format #t "~1Tlevel-type: ~A~%" (-> obj level-type)) - (format #t "~1Tload-order: ~D~%" (-> obj load-order)) + (format #t "~1Tloaded-text-info-count: ~D~%" (-> this loaded-text-info-count)) + (format #t "~1Tloaded-text-info[8] @ #x~X~%" (-> this loaded-text-info)) + (format #t "~1Tlevel-type: ~A~%" (-> this level-type)) + (format #t "~1Tload-order: ~D~%" (-> this load-order)) (label cfg-48) - obj + this ) ;; definition of type level-group @@ -709,53 +709,53 @@ ) ;; definition for method 3 of type level-group -(defmethod inspect level-group ((obj level-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect level-group ((this level-group)) + (when (not this) + (set! this this) (goto cfg-13) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tentity-link: ~`entity-links`P~%" (-> obj entity-link)) - (format #t "~1Tborder?: ~A~%" (-> obj border?)) - (format #t "~1Tvis?: ~A~%" (-> obj vis?)) - (format #t "~1Twant-level: ~A~%" (-> obj want-level)) - (format #t "~1Treceiving-level: ~A~%" (-> obj receiving-level)) - (format #t "~1Tload-commands: ~A~%" (-> obj load-commands)) - (format #t "~1Tplay?: ~A~%" (-> obj play?)) - (format #t "~1Ttarget-pos[2] @ #x~X~%" (-> obj target-pos)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tentity-link: ~`entity-links`P~%" (-> this entity-link)) + (format #t "~1Tborder?: ~A~%" (-> this border?)) + (format #t "~1Tvis?: ~A~%" (-> this vis?)) + (format #t "~1Twant-level: ~A~%" (-> this want-level)) + (format #t "~1Treceiving-level: ~A~%" (-> this receiving-level)) + (format #t "~1Tload-commands: ~A~%" (-> this load-commands)) + (format #t "~1Tplay?: ~A~%" (-> this play?)) + (format #t "~1Ttarget-pos[2] @ #x~X~%" (-> this target-pos)) (dotimes (s5-0 2) - (format #t "~T [~D]~1Ttarget-pos: ~`vector`P~%" s5-0 (-> obj target-pos s5-0)) + (format #t "~T [~D]~1Ttarget-pos: ~`vector`P~%" s5-0 (-> this target-pos s5-0)) ) - (format #t "~1Tcamera-pos[2] @ #x~X~%" (-> obj camera-pos)) + (format #t "~1Tcamera-pos[2] @ #x~X~%" (-> this camera-pos)) (dotimes (s5-1 2) - (format #t "~T [~D]~1Tcamera-pos: ~`vector`P~%" s5-1 (-> obj camera-pos s5-1)) + (format #t "~T [~D]~1Tcamera-pos: ~`vector`P~%" s5-1 (-> this camera-pos s5-1)) ) - (format #t "~1Theap: #~%" (-> obj heap)) - (format #t "~1Tsound-bank[4] @ #x~X~%" (-> obj sound-bank)) - (format #t "~1Tdisk-load-timing?: ~A~%" (-> obj disk-load-timing?)) - (format #t "~1Tload-level: ~A~%" (-> obj load-level)) - (format #t "~1Tload-size: ~D~%" (-> obj load-size)) - (format #t "~1Tload-time: ~f~%" (-> obj load-time)) - (format #t "~1Tload-login-time: ~f~%" (-> obj load-login-time)) - (format #t "~1Tdraw-level-count: ~D~%" (-> obj draw-level-count)) - (format #t "~1Tdraw-level[7] @ #x~X~%" (-> obj draw-level)) - (dotimes (s5-2 (-> obj draw-level-count)) - (format #t "~T [~D]~1Tdraw-level: ~`object`P~%" s5-2 (-> obj draw-level s5-2)) + (format #t "~1Theap: #~%" (-> this heap)) + (format #t "~1Tsound-bank[4] @ #x~X~%" (-> this sound-bank)) + (format #t "~1Tdisk-load-timing?: ~A~%" (-> this disk-load-timing?)) + (format #t "~1Tload-level: ~A~%" (-> this load-level)) + (format #t "~1Tload-size: ~D~%" (-> this load-size)) + (format #t "~1Tload-time: ~f~%" (-> this load-time)) + (format #t "~1Tload-login-time: ~f~%" (-> this load-login-time)) + (format #t "~1Tdraw-level-count: ~D~%" (-> this draw-level-count)) + (format #t "~1Tdraw-level[7] @ #x~X~%" (-> this draw-level)) + (dotimes (s5-2 (-> this draw-level-count)) + (format #t "~T [~D]~1Tdraw-level: ~`object`P~%" s5-2 (-> this draw-level s5-2)) ) - (format #t "~1Tdraw-index-map[7] @ #x~X~%" (-> obj draw-index-map)) - (format #t "~1Tload-order: ~D~%" (-> obj load-order)) - (format #t "~1Tlevel[7] @ #x~X~%" (-> obj level0)) - (format #t "~1Tdata[7] @ #x~X~%" (-> obj level0)) - (format #t "~1Tlevel0: ~`level`P~%" (-> obj level0)) - (format #t "~1Tlevel1: ~`level`P~%" (-> obj level1)) - (format #t "~1Tlevel2: ~`level`P~%" (-> obj level2)) - (format #t "~1Tlevel3: ~`level`P~%" (-> obj level3)) - (format #t "~1Tlevel4: ~`level`P~%" (-> obj level4)) - (format #t "~1Tlevel5: ~`level`P~%" (-> obj level5)) - (format #t "~1Tlevel-default: ~`level`P~%" (-> obj default-level)) + (format #t "~1Tdraw-index-map[7] @ #x~X~%" (-> this draw-index-map)) + (format #t "~1Tload-order: ~D~%" (-> this load-order)) + (format #t "~1Tlevel[7] @ #x~X~%" (-> this level0)) + (format #t "~1Tdata[7] @ #x~X~%" (-> this level0)) + (format #t "~1Tlevel0: ~`level`P~%" (-> this level0)) + (format #t "~1Tlevel1: ~`level`P~%" (-> this level1)) + (format #t "~1Tlevel2: ~`level`P~%" (-> this level2)) + (format #t "~1Tlevel3: ~`level`P~%" (-> this level3)) + (format #t "~1Tlevel4: ~`level`P~%" (-> this level4)) + (format #t "~1Tlevel5: ~`level`P~%" (-> this level5)) + (format #t "~1Tlevel-default: ~`level`P~%" (-> this default-level)) (label cfg-13) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/level/level_REF.gc b/test/decompiler/reference/jak2/engine/level/level_REF.gc index 97af854d20..e52925014f 100644 --- a/test/decompiler/reference/jak2/engine/level/level_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/level_REF.gc @@ -21,7 +21,7 @@ ;; definition for method 24 of type level-group ;; WARN: Return type mismatch object vs pair. -(defmethod alt-load-command-get-index level-group ((obj level-group) (arg0 symbol) (arg1 int)) +(defmethod alt-load-command-get-index level-group ((this level-group) (arg0 symbol) (arg1 int)) (let ((v1-1 (-> (lookup-level-info arg0) alt-load-commands))) (while (nonzero? arg1) (+! arg1 -1) @@ -35,16 +35,16 @@ ) ;; definition for method 29 of type level-group -(defmethod load-in-progress? level-group ((obj level-group)) +(defmethod load-in-progress? level-group ((this level-group)) (!= (-> *level* loading-level) (-> *level* default-level)) ) ;; definition for method 11 of type level-group -(defmethod get-level-by-heap-ptr-and-status level-group ((obj level-group) (arg0 pointer) (arg1 symbol)) +(defmethod get-level-by-heap-ptr-and-status level-group ((this level-group) (arg0 pointer) (arg1 symbol)) (case arg1 (('active) - (dotimes (v1-1 (-> obj length)) - (let ((a2-6 (-> obj level v1-1))) + (dotimes (v1-1 (-> this length)) + (let ((a2-6 (-> this level v1-1))) (when (= (-> a2-6 status) 'active) (if (and (>= (the-as int arg0) (the-as int (-> a2-6 heap base))) (< (the-as int arg0) (the-as int (-> a2-6 heap top-base))) @@ -56,8 +56,8 @@ ) ) (('loading) - (dotimes (v1-5 (-> obj length)) - (let ((a2-12 (-> obj level v1-5))) + (dotimes (v1-5 (-> this length)) + (let ((a2-12 (-> this level v1-5))) (when (!= (-> a2-12 status) 'inactive) (if (and (>= (the-as int arg0) (the-as int (-> a2-12 heap base))) (< (the-as int arg0) (the-as int (-> a2-12 heap top-base))) @@ -81,20 +81,20 @@ ) ;; definition for method 21 of type level -(defmethod get-art-group-by-name level ((obj level) (arg0 string)) - (countdown (s4-0 (-> obj art-group art-group-array length)) - (if (name= (-> obj art-group art-group-array s4-0 name) arg0) - (return (-> obj art-group art-group-array s4-0)) +(defmethod get-art-group-by-name level ((this level) (arg0 string)) + (countdown (s4-0 (-> this art-group art-group-array length)) + (if (name= (-> this art-group art-group-array s4-0 name) arg0) + (return (-> this art-group art-group-array s4-0)) ) ) (the-as art-group #f) ) ;; definition for method 13 of type level -(defmethod bsp-name level ((obj level)) - (if (and (!= (-> obj status) 'inactive) (-> obj bsp) (nonzero? (-> obj bsp name))) - (-> obj bsp name) - (-> obj name) +(defmethod bsp-name level ((this level)) + (if (and (!= (-> this status) 'inactive) (-> this bsp) (nonzero? (-> this bsp name))) + (-> this bsp name) + (-> this name) ) ) @@ -108,38 +108,38 @@ ) ;; definition for method 2 of type level -(defmethod print level ((obj level)) - (format #t "#<~A ~A ~S @ #x~X>" (-> obj type) (-> obj status) (-> obj name) obj) - obj +(defmethod print level ((this level)) + (format #t "#<~A ~A ~S @ #x~X>" (-> this type) (-> this status) (-> this name) this) + this ) ;; definition for method 7 of type bsp-header -(defmethod relocate bsp-header ((obj bsp-header) (arg0 int)) +(defmethod relocate bsp-header ((this bsp-header) (arg0 int)) (let ((s5-0 (-> *level* loading-level))) (when s5-0 (cond - (obj + (this (cond - ((not (type? obj bsp-header)) + ((not (type? this bsp-header)) (format 0 "ERROR: level ~A is not a bsp-header.~%" (-> s5-0 name)) (the-as bsp-header #f) ) - ((not (file-info-correct-version? (-> obj info) (file-kind level-bt) 0)) + ((not (file-info-correct-version? (-> this info) (file-kind level-bt) 0)) (the-as bsp-header #f) ) - ((< 2048 (-> obj visible-list-length)) + ((< 2048 (-> this visible-list-length)) (format 0 "ERROR: level ~A visible-list-length ~d is greater than 2048 (16384 drawables).~%" (-> s5-0 name) - (-> obj visible-list-length) + (-> this visible-list-length) ) (the-as bsp-header #f) ) (else - (set! (-> s5-0 bsp) obj) - (set! (-> obj level) s5-0) - obj + (set! (-> s5-0 bsp) this) + (set! (-> this level) s5-0) + this ) ) ) @@ -153,54 +153,54 @@ ) ;; definition for method 27 of type level -(defmethod load-required-packages level ((obj level)) - (when (not (or (not (-> obj bsp)) (= *kernel-boot-mode* 'debug-boot))) - (if (not (null? (-> obj info packages))) +(defmethod load-required-packages level ((this level)) + (when (not (or (not (-> this bsp)) (= *kernel-boot-mode* 'debug-boot))) + (if (not (null? (-> this info packages))) (load-package "common" global) ) ) - obj + this ) ;; definition for method 29 of type level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vis-clear level ((obj level)) +(defmethod vis-clear level ((this level)) (countdown (v1-0 8) (nop!) - (set! (-> obj vis-info v1-0) #f) + (set! (-> this vis-info v1-0) #f) ) (dotimes (v1-3 128) - (set! (-> (the-as (pointer int128) (&+ (-> obj vis-bits) (* v1-3 16)))) 0) + (set! (-> (the-as (pointer int128) (&+ (-> this vis-bits) (* v1-3 16)))) 0) ) - (set! (-> obj all-visible?) 'loading) + (set! (-> this all-visible?) 'loading) 0 (none) ) ;; definition for method 28 of type level ;; WARN: Return type mismatch int vs none. -(defmethod init-vis-from-bsp level ((obj level)) - (when (not (or (= (-> obj status) 'inactive) (not (-> obj bsp)))) - (set! (-> obj all-visible?) 'loading) +(defmethod init-vis-from-bsp level ((this level)) + (when (not (or (= (-> this status) 'inactive) (not (-> this bsp)))) + (set! (-> this all-visible?) 'loading) (dotimes (s5-0 8) - (let ((s4-0 (-> obj bsp vis-info s5-0))) + (let ((s4-0 (-> this bsp vis-info s5-0))) (cond ((and s4-0 (nonzero? s4-0) (valid? s4-0 level-vis-info (the-as string #f) #f 0)) - (set! (-> obj vis-info s5-0) s4-0) + (set! (-> this vis-info s5-0) s4-0) (set! (-> s4-0 current-vis-string) (the-as uint -1)) - (if (= (-> s4-0 from-level) (-> obj load-name)) - (set! (-> s4-0 from-bsp) (-> obj bsp)) + (if (= (-> s4-0 from-level) (-> this load-name)) + (set! (-> s4-0 from-bsp) (-> this bsp)) (set! (-> s4-0 from-bsp) #f) ) - (set! (-> s4-0 vis-bits) (the-as uint (-> obj vis-bits))) + (set! (-> s4-0 vis-bits) (the-as uint (-> this vis-bits))) (set! (-> s4-0 flags) (the-as vis-info-flag (logclear (-> s4-0 flags) (vis-info-flag in-iop loading vis-valid))) ) (set! *vis-boot* #t) ) (else - (set! (-> obj vis-info s5-0) #f) + (set! (-> this vis-info s5-0) #f) ) ) ) @@ -211,20 +211,20 @@ ) ;; definition for method 12 of type level-group -(defmethod level-get-for-use level-group ((obj level-group) (arg0 symbol) (arg1 symbol)) +(defmethod level-get-for-use level-group ((this level-group) (arg0 symbol) (arg1 symbol)) (local-vars (s5-1 level)) - (alloc-levels-if-needed obj #f) + (alloc-levels-if-needed this #f) (let* ((s2-0 (lookup-level-info arg0)) (s1-0 (remap-level-name s2-0)) ) - (let ((s5-0 (level-get obj s1-0))) + (let ((s5-0 (level-get this s1-0))) (when s5-0 (level-status-update! s5-0 arg1) (set! s5-1 s5-0) (goto cfg-13) ) ) - (let ((a0-7 (level-get-most-disposable obj))) + (let ((a0-7 (level-get-most-disposable this))) (set! s5-1 (if a0-7 (level-status-update! a0-7 'inactive) a0-7 @@ -236,8 +236,8 @@ (set! s5-1 (the-as level #f)) (goto cfg-13) ) - (let ((v1-13 (+ (-> obj load-order) 1))) - (set! (-> obj load-order) v1-13) + (let ((v1-13 (+ (-> this load-order) 1))) + (set! (-> this load-order) v1-13) (set! (-> s5-1 load-order) (the-as int v1-13)) ) (set! (-> s5-1 info) s2-0) @@ -259,7 +259,7 @@ ) ;; definition for method 28 of type level-group -(defmethod level-status level-group ((obj level-group) (arg0 symbol)) +(defmethod level-status level-group ((this level-group) (arg0 symbol)) (let ((v1-1 (level-get *level* arg0))) (if v1-1 (-> v1-1 status) @@ -269,64 +269,64 @@ ;; definition for method 26 of type level ;; INFO: Used lq/sq -(defmethod level-status-update! level ((obj level) (arg0 symbol)) +(defmethod level-status-update! level ((this level) (arg0 symbol)) (case arg0 (('inactive) - (-> obj status) - (unload! obj) + (-> this status) + (unload! this) ) (('loading) - (case (-> obj status) + (case (-> this status) (('inactive) - (load-begin obj) + (load-begin this) ) ) ) (('loading-bt) - (case (-> obj status) + (case (-> this status) (('loading) - (set! (-> obj status) arg0) - (load-continue obj) + (set! (-> this status) arg0) + (load-continue this) ) ) ) (('loading-done) - (case (-> obj status) + (case (-> this status) (('loading-bt) - (set! (-> obj status) arg0) + (set! (-> this status) arg0) ) ) ) (('loaded) - (case (-> obj status) + (case (-> this status) (('loading-done) - (login-begin obj) + (login-begin this) ) (('alive 'active) - (deactivate obj) + (deactivate this) ) ) ) (('alive 'active) (when *dproc* - (case (-> obj status) + (case (-> this status) (('loaded) - (birth obj) - (level-status-update! obj arg0) + (birth this) + (level-status-update! this arg0) ) (('alive) (when (and *dproc* (= arg0 'active)) - (when (zero? (-> obj display-start-time)) - (set! (-> obj display-start-time) (-> *display* real-clock frame-counter)) + (when (zero? (-> this display-start-time)) + (set! (-> this display-start-time) (-> *display* real-clock frame-counter)) 0 ) - (remove-by-param1 *background-draw-engine* (the-as int (-> obj bsp))) - (add-connection *background-draw-engine* *dproc* add-bsp-drawable (-> obj bsp) obj #f) + (remove-by-param1 *background-draw-engine* (the-as int (-> this bsp))) + (add-connection *background-draw-engine* *dproc* add-bsp-drawable (-> this bsp) this #f) (dotimes (v1-46 18) - (set! (-> obj closest-object-array v1-46) 0.0) - (set! (-> obj texture-mask v1-46 mask quad) (the-as uint128 0)) + (set! (-> this closest-object-array v1-46) 0.0) + (set! (-> this texture-mask v1-46 mask quad) (the-as uint128 0)) ) - (set! (-> obj status) 'active) + (set! (-> this status) 'active) (assign-draw-indices *level*) ) ) @@ -334,7 +334,7 @@ ) ) ) - obj + this ) ;; definition for symbol *login-state*, type login-state @@ -368,57 +368,57 @@ ) ;; definition for method 17 of type level -(defmethod load-continue level ((obj level)) +(defmethod load-continue level ((this level)) (local-vars (sv-16 symbol)) - (when (-> obj linking) + (when (-> this linking) (when (nonzero? (link-resume)) - (set! (-> obj linking) #f) - (case (-> obj status) + (set! (-> this linking) #f) + (case (-> this status) (('loading) (when (not (-> *texture-relocate-later* memcpy)) (cond - ((= (-> obj load-buffer-mode) (load-buffer-mode ten)) - (let ((a2-0 (logand -64 (&+ (-> obj heap current) 63)))) + ((= (-> this load-buffer-mode) (load-buffer-mode ten)) + (let ((a2-0 (logand -64 (&+ (-> this heap current) 63)))) (dgo-load-continue a2-0 a2-0 a2-0) ) ) (else - (load-buffer-resize obj (the-as dgo-header (-> obj load-buffer-last))) + (load-buffer-resize this (the-as dgo-header (-> this load-buffer-last))) (dgo-load-continue - (the-as pointer (-> obj load-buffer 0)) - (the-as pointer (-> obj load-buffer 1)) - (logand -64 (&+ (-> obj heap current) 63)) + (the-as pointer (-> this load-buffer 0)) + (the-as pointer (-> this load-buffer 1)) + (logand -64 (&+ (-> this heap current) 63)) ) ) ) ) ) (('loading-bt) - (level-status-update! obj 'loading-done) - (level-status-update! obj 'loaded) + (level-status-update! this 'loading-done) + (level-status-update! this 'loaded) ) ) ) - (set! obj obj) + (set! this this) (goto cfg-39) ) (when (-> *texture-relocate-later* memcpy) (relocate-later) - (load-buffer-resize obj (the-as dgo-header (-> obj load-buffer-last))) + (load-buffer-resize this (the-as dgo-header (-> this load-buffer-last))) (dgo-load-continue - (the-as pointer (-> obj load-buffer 0)) - (the-as pointer (-> obj load-buffer 1)) - (logand -64 (&+ (-> obj heap current) 63)) + (the-as pointer (-> this load-buffer 0)) + (the-as pointer (-> this load-buffer 1)) + (logand -64 (&+ (-> this heap current) 63)) ) - (set! obj obj) + (set! this this) (goto cfg-39) ) - (case (-> obj status) + (case (-> this status) (('loading) (set! sv-16 (the-as symbol #f)) (let ((s5-0 (dgo-load-get-next (& sv-16)))) (when s5-0 - (set! (-> obj load-buffer-last) (the-as uint s5-0)) + (set! (-> this load-buffer-last) (the-as uint s5-0)) (+! (-> *level* load-size) (-> (the-as (pointer uint32) s5-0))) (set! (-> *level* load-time) (* 0.016666668 (the float (- (-> *display* real-clock integral-frame-counter) (the-as uint *dgo-time*)))) @@ -429,73 +429,79 @@ (cond ((not sv-16) (cond - ((= (-> obj load-buffer-mode) (load-buffer-mode ten)) + ((= (-> this load-buffer-mode) (load-buffer-mode ten)) (cond - ((dgo-load-link (the-as dgo-header s5-0) (-> obj heap) (the-as uint (-> obj heap top-base)) *print-login* #f) + ((dgo-load-link (the-as dgo-header s5-0) (-> this heap) (the-as uint (-> this heap top-base)) *print-login* #f) (when (not (-> *texture-relocate-later* memcpy)) - (let ((a2-8 (logand -64 (&+ (-> obj heap current) 63)))) + (let ((a2-8 (logand -64 (&+ (-> this heap current) 63)))) (dgo-load-continue a2-8 a2-8 a2-8) ) ) ) (else - (set! (-> obj linking) #t) + (set! (-> this linking) #t) ) ) ) - ((dgo-load-link (the-as dgo-header s5-0) (-> obj heap) (-> obj load-buffer 1) *print-login* #f) + ((dgo-load-link (the-as dgo-header s5-0) (-> this heap) (-> this load-buffer 1) *print-login* #f) (when (not (-> *texture-relocate-later* memcpy)) - (load-buffer-resize obj (the-as dgo-header s5-0)) + (load-buffer-resize this (the-as dgo-header s5-0)) (dgo-load-continue - (the-as pointer (-> obj load-buffer 0)) - (the-as pointer (-> obj load-buffer 1)) - (logand -64 (&+ (-> obj heap current) 63)) + (the-as pointer (-> this load-buffer 0)) + (the-as pointer (-> this load-buffer 1)) + (logand -64 (&+ (-> this heap current) 63)) ) ) ) (else - (set! (-> obj linking) #t) + (set! (-> this linking) #t) ) ) ) (else - (set! (-> obj heap top) (-> obj heap top-base)) - (level-status-update! obj 'loading-bt) + (set! (-> this heap top) (-> this heap top-base)) + (level-status-update! this 'loading-bt) ) ) ) ) ) (('login) - (level-update-after-load obj *login-state*) + (level-update-after-load this *login-state*) ) (('loading-bt) - (let ((a0-36 (logand -64 (&+ (-> obj heap current) 63)))) + (let ((a0-36 (logand -64 (&+ (-> this heap current) 63)))) (cond - ((dgo-load-link (the-as dgo-header a0-36) (-> obj heap) (the-as uint (-> obj heap top-base)) *print-login* #t) - (level-status-update! obj 'loading-done) - (level-status-update! obj 'loaded) + ((dgo-load-link + (the-as dgo-header a0-36) + (-> this heap) + (the-as uint (-> this heap top-base)) + *print-login* + #t + ) + (level-status-update! this 'loading-done) + (level-status-update! this 'loaded) ) (else - (set! (-> obj linking) #t) + (set! (-> this linking) #t) ) ) ) ) ) (label cfg-39) - obj + this ) ;; definition for method 18 of type level -(defmethod load-begin level ((obj level)) +(defmethod load-begin level ((this level)) (local-vars (bits-to-use int) (borrow-from-lev level) (found-borrow symbol)) (dotimes (v1-0 2) - (set! (-> obj borrow-level v1-0) #f) + (set! (-> this borrow-level v1-0) #f) ) - (set! (-> obj borrow-from-level) #f) - (set! (-> obj memory-mask) (the-as uint 0)) - (let ((mem-mode (-> obj info memory-mode))) + (set! (-> this borrow-from-level) #f) + (set! (-> this memory-mask) (the-as uint 0)) + (let ((mem-mode (-> this info memory-mode))) (case mem-mode (((load-buffer-mode borrow)) (let ((slot-in-borrow-from-lev -1)) @@ -504,7 +510,7 @@ (when (and (or (= (-> maybe-borrow-from-lev status) 'active) (= (-> maybe-borrow-from-lev status) 'loaded)) (begin (dotimes (check-slot-idx 2) - (when (and (= (-> maybe-borrow-from-lev info borrow-level check-slot-idx) (-> obj name)) + (when (and (= (-> maybe-borrow-from-lev info borrow-level check-slot-idx) (-> this name)) (nonzero? (-> maybe-borrow-from-lev info borrow-size check-slot-idx)) ) (set! slot-in-borrow-from-lev check-slot-idx) @@ -529,10 +535,10 @@ (label cfg-32) (cond (borrow-from-lev - (set! (-> obj borrow-from-level) borrow-from-lev) - (set! (-> borrow-from-lev borrow-level slot-in-borrow-from-lev) obj) + (set! (-> this borrow-from-level) borrow-from-lev) + (set! (-> borrow-from-lev borrow-level slot-in-borrow-from-lev) this) (mem-copy! - (the-as pointer (-> obj heap)) + (the-as pointer (-> this heap)) (the-as pointer (-> borrow-from-lev borrow-heap slot-in-borrow-from-lev)) 16 ) @@ -541,7 +547,7 @@ (format 0 "ERROR: level ~A could not find free ~S bank in the level-group heap~%" - (-> obj name) + (-> this name) (cond ((= mem-mode (load-buffer-mode large)) "large" @@ -647,7 +653,7 @@ (format 0 "ERROR: level ~A could not find free ~S bank in the level-group heap~%" - (-> obj name) + (-> this name) (cond ((= v1-32 (load-buffer-mode large)) "large" @@ -685,10 +691,10 @@ 0 ) (else - (set! (-> obj memory-mask) (the-as uint bits-to-use)) + (set! (-> this memory-mask) (the-as uint bits-to-use)) (cond ((= (&- (-> *level* heap top) (the-as uint (-> *level* heap base))) #x1af2800) - (let ((v1-44 (-> obj heap))) + (let ((v1-44 (-> this heap))) (set! (-> v1-44 base) (&+ (-> *level* heap base) (* #x2f400 offset-in-level-heap))) (set! (-> v1-44 current) (-> v1-44 base)) (set! (-> v1-44 top-base) (&+ (-> v1-44 base) (+ heap-size (/ heap-size 2)))) @@ -696,7 +702,7 @@ ) ) (else - (let ((v1-45 (-> obj heap))) + (let ((v1-45 (-> this heap))) (set! (-> v1-45 base) (&+ (-> *level* heap base) (* #x1f800 offset-in-level-heap))) (set! (-> v1-45 current) (-> v1-45 base)) (set! (-> v1-45 top-base) (&+ (-> v1-45 base) heap-size)) @@ -710,68 +716,68 @@ ) ) ) - (set! loading-level (-> obj heap)) - (set! (-> *level* loading-level) obj) - (set! (-> obj level-type) #f) - (set! *level-type-list* (the-as type (&-> obj level-type))) + (set! loading-level (-> this heap)) + (set! (-> *level* loading-level) this) + (set! (-> this level-type) #f) + (set! *level-type-list* (the-as type (&-> this level-type))) (set! (-> *level* log-in-level-bsp) #f) - (set! (-> obj nickname) #f) - (set! (-> obj bsp) #f) - (set! (-> obj entity) #f) - (set! (-> obj linking) #f) - (set! (-> obj task-mask) (-> *setting-control* user-current task-mask)) - (vis-clear obj) - (set! (-> obj load-start-time) (-> *display* real-clock frame-counter)) - (set! (-> obj load-stop-time) 0) - (set! (-> obj display-start-time) 0) - (set! (-> obj part-engine) #f) + (set! (-> this nickname) #f) + (set! (-> this bsp) #f) + (set! (-> this entity) #f) + (set! (-> this linking) #f) + (set! (-> this task-mask) (-> *setting-control* user-current task-mask)) + (vis-clear this) + (set! (-> this load-start-time) (-> *display* real-clock frame-counter)) + (set! (-> this load-stop-time) 0) + (set! (-> this display-start-time) 0) + (set! (-> this part-engine) #f) (dotimes (v1-57 4) - (set! (-> obj user-object v1-57) #f) + (set! (-> this user-object v1-57) #f) ) - (set! (-> obj status) 'loading) + (set! (-> this status) 'loading) (set! (-> *texture-pool* allocate-func) texture-page-level-allocate) - (if (= (-> obj load-name) (-> obj info visname)) - (format (clear *temp-string*) "~S" (-> obj info nickname)) - (format (clear *temp-string*) "~S" (-> obj name)) + (if (= (-> this load-name) (-> this info visname)) + (format (clear *temp-string*) "~S" (-> this info nickname)) + (format (clear *temp-string*) "~S" (-> this name)) ) (set! (-> *temp-string* data 8) (the-as uint 0)) (format *temp-string* ".DGO") - (set! (-> obj heap top) (-> obj heap top-base)) - (set! (-> *level* load-level) (-> obj load-name)) + (set! (-> this heap top) (-> this heap top-base)) + (set! (-> *level* load-level) (-> this load-name)) (set! (-> *level* load-size) (the-as uint 0)) (set! (-> *level* load-time) 0.0) (set! (-> *level* load-login-time) 0.0) - (set! (-> obj code-memory-start) (-> obj heap current)) + (set! (-> this code-memory-start) (-> this heap current)) (cond - ((= (-> obj info memory-mode) (load-buffer-mode borrow)) - (set! (-> obj load-buffer-mode) (load-buffer-mode ten)) - (let ((a3-19 (logand -64 (&+ (-> obj heap current) 63)))) + ((= (-> this info memory-mode) (load-buffer-mode borrow)) + (set! (-> this load-buffer-mode) (load-buffer-mode ten)) + (let ((a3-19 (logand -64 (&+ (-> this heap current) 63)))) (dgo-load-begin *temp-string* a3-19 a3-19 a3-19) ) ) (else (let* ((s3-1 #x1b5800) - (s4-1 (kmalloc (-> obj heap) s3-1 (kmalloc-flags align-64 top) "dgo-level-buf-2")) - (s5-4 (kmalloc (-> obj heap) s3-1 (kmalloc-flags align-64 top) "dgo-level-buf-2")) + (s4-1 (kmalloc (-> this heap) s3-1 (kmalloc-flags align-64 top) "dgo-level-buf-2")) + (s5-4 (kmalloc (-> this heap) s3-1 (kmalloc-flags align-64 top) "dgo-level-buf-2")) ) - (format 0 "-----------> begin load ~A [~S]~%" (-> obj load-name) *temp-string*) - (set! (-> obj load-buffer 0) (the-as uint s5-4)) - (set! (-> obj load-buffer 1) (the-as uint s4-1)) - (set! (-> obj load-buffer-size) (the-as uint s3-1)) - (set! (-> obj load-buffer-mode) (load-buffer-mode small-edge)) - (dgo-load-begin *temp-string* s5-4 s4-1 (logand -64 (&+ (-> obj heap current) 63))) + (format 0 "-----------> begin load ~A [~S]~%" (-> this load-name) *temp-string*) + (set! (-> this load-buffer 0) (the-as uint s5-4)) + (set! (-> this load-buffer 1) (the-as uint s4-1)) + (set! (-> this load-buffer-size) (the-as uint s3-1)) + (set! (-> this load-buffer-mode) (load-buffer-mode small-edge)) + (dgo-load-begin *temp-string* s5-4 s4-1 (logand -64 (&+ (-> this heap current) 63))) ) ) ) - obj + this ) ;; definition for method 19 of type level -(defmethod login-begin level ((obj level)) +(defmethod login-begin level ((this level)) (set! (-> *texture-pool* allocate-func) texture-page-default-allocate) (cond - ((-> obj bsp) - (let ((s5-0 (-> obj bsp))) + ((-> this bsp) + (let ((s5-0 (-> this bsp))) (set! (-> s5-0 level tfrag-gs-test) (if (logtest? (-> s5-0 texture-flags 0) (texture-page-flag alpha-enable)) (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest greater-equal)) @@ -784,15 +790,15 @@ ) ) ) - (set! (-> *level* log-in-level-bsp) (-> obj bsp)) - (login-level-textures *texture-pool* obj (-> obj bsp texture-page-count) (-> obj bsp texture-ids)) + (set! (-> *level* log-in-level-bsp) (-> this bsp)) + (login-level-textures *texture-pool* this (-> this bsp texture-page-count) (-> this bsp texture-ids)) (dotimes (v1-10 6) - (set! (-> obj sky-mask mask data v1-10) 0) + (set! (-> this sky-mask mask data v1-10) 0) ) (dotimes (s4-0 10) - (let ((a0-8 (-> obj info texture-anim s4-0))) + (let ((a0-8 (-> this info texture-anim s4-0))) (if a0-8 - (set! (-> obj texture-anim-array s4-0) (init! (the-as texture-anim-array (-> a0-8 value)))) + (set! (-> this texture-anim-array s4-0) (init! (the-as texture-anim-array (-> a0-8 value)))) ) ) ) @@ -801,17 +807,17 @@ (set! (-> *login-state* state) -1) (set! (-> *login-state* pos) (the-as uint 0)) (set! (-> *login-state* elts) (the-as uint 0)) - (set! (-> obj status) 'login) + (set! (-> this status) 'login) ) (else - (level-status-update! obj 'inactive) + (level-status-update! this 'inactive) (set! loading-level global) (set! (-> *level* loading-level) (-> *level* default-level)) (set! *level-type-list* (the-as type 0)) 0 ) ) - obj + this ) ;; definition for function level-update-after-load @@ -1093,48 +1099,48 @@ ;; definition for method 25 of type level ;; INFO: Used lq/sq -(defmethod birth level ((obj level)) +(defmethod birth level ((this level)) (local-vars (sv-96 int)) - (case (-> obj status) + (case (-> this status) (('loaded) (let ((s5-0 loading-level) (s4-0 (-> *level* loading-level)) (s3-0 (-> *level* log-in-level-bsp)) (s2-1 *level-type-list*) ) - (let ((s1-0 (not (-> obj entity)))) - (set! loading-level (-> obj heap)) - (set! (-> *level* log-in-level-bsp) (-> obj bsp)) - (set! (-> *level* loading-level) obj) - (set! *level-type-list* (the-as type (&-> obj level-type))) + (let ((s1-0 (not (-> this entity)))) + (set! loading-level (-> this heap)) + (set! (-> *level* log-in-level-bsp) (-> this bsp)) + (set! (-> *level* loading-level) this) + (set! *level-type-list* (the-as type (&-> this level-type))) (cond - ((valid? (-> obj bsp light-hash) light-hash (the-as string #f) #t 0) - (set! (-> obj light-hash) (-> obj bsp light-hash)) + ((valid? (-> this bsp light-hash) light-hash (the-as string #f) #t 0) + (set! (-> this light-hash) (-> this bsp light-hash)) ) (else - (set! (-> obj light-hash) (the-as light-hash 0)) + (set! (-> this light-hash) (the-as light-hash 0)) 0 ) ) - (birth (-> obj bsp)) - (set! (-> obj status) 'alive) - (set! (-> obj render?) #t) - (copy-perms-to-level! *game-info* obj) - (send-event *camera* 'level-activate (-> obj name)) - (send-event *target* 'level-activate (-> obj name)) - (when (and (-> obj info login-func) s1-0) - (let ((s1-1 (-> obj info login-func value))) + (birth (-> this bsp)) + (set! (-> this status) 'alive) + (set! (-> this render?) #t) + (copy-perms-to-level! *game-info* this) + (send-event *camera* 'level-activate (-> this name)) + (send-event *target* 'level-activate (-> this name)) + (when (and (-> this info login-func) s1-0) + (let ((s1-1 (-> this info login-func value))) (if (and s1-1 (nonzero? s1-1) (type? s1-1 function)) - (s1-1 obj) + (s1-1 this) ) ) ) ) - (let ((s1-2 (-> obj status))) - (set! (-> obj status) 'active) + (let ((s1-2 (-> this status))) + (set! (-> this status) 'active) (update-task-masks 'level) (assign-draw-indices *level*) - (let ((s0-0 (-> obj bsp nav-meshes))) + (let ((s0-0 (-> this bsp nav-meshes))) (when (nonzero? s0-0) (set! sv-96 0) (while (< sv-96 (-> s0-0 length)) @@ -1143,17 +1149,17 @@ ) ) ) - (if (and (!= (-> obj bsp city-level-info) 0) *traffic-manager*) - (send-event *traffic-manager* 'level-loaded obj) + (if (and (!= (-> this bsp city-level-info) 0) *traffic-manager*) + (send-event *traffic-manager* 'level-loaded this) ) - (when (-> obj info activate-func) - (let ((s0-1 (-> obj info activate-func value))) + (when (-> this info activate-func) + (let ((s0-1 (-> this info activate-func value))) (if (and s0-1 (nonzero? s0-1) (type? s0-1 function)) - (s0-1 obj 'display) + (s0-1 this 'display) ) ) ) - (set! (-> obj status) s1-2) + (set! (-> this status) s1-2) ) (set! loading-level s5-0) (set! (-> *level* loading-level) s4-0) @@ -1162,42 +1168,42 @@ ) ) ) - obj + this ) ;; definition for method 9 of type level ;; INFO: Used lq/sq -(defmethod deactivate level ((obj level)) - (case (-> obj status) +(defmethod deactivate level ((this level)) + (case (-> this status) (('active 'alive) - (format 0 "----------- kill ~A (status ~A)~%" obj (-> obj status)) - (if (and (!= (-> obj bsp city-level-info) 0) *traffic-manager*) - (send-event *traffic-manager* 'level-killed obj) + (format 0 "----------- kill ~A (status ~A)~%" this (-> this status)) + (if (and (!= (-> this bsp city-level-info) 0) *traffic-manager*) + (send-event *traffic-manager* 'level-killed this) ) - (when (-> obj info kill-func) - (let ((s5-0 (-> obj info kill-func value))) + (when (-> this info kill-func) + (let ((s5-0 (-> this info kill-func value))) (if (and s5-0 (nonzero? s5-0) (type? s5-0 function)) - (s5-0 obj) + (s5-0 this) ) ) ) - (copy-perms-from-level! *game-info* obj) - (send-event *target* 'level-deactivate (-> obj name)) - (remove-by-param1 *background-draw-engine* (the-as int (-> obj bsp))) - (deactivate-entities (-> obj bsp)) - (kill-all-particles-in-level obj) - (unload-from-level *anim-manager* obj) - (set! (-> obj inside-boxes) #f) - (set! (-> obj meta-inside?) #f) - (set! (-> obj force-inside?) #f) - (set! (-> obj status) 'loaded) - (set! (-> obj light-hash) (the-as light-hash 0)) - (set! (-> obj all-visible?) 'loading) + (copy-perms-from-level! *game-info* this) + (send-event *target* 'level-deactivate (-> this name)) + (remove-by-param1 *background-draw-engine* (the-as int (-> this bsp))) + (deactivate-entities (-> this bsp)) + (kill-all-particles-in-level this) + (unload-from-level *anim-manager* this) + (set! (-> this inside-boxes) #f) + (set! (-> this meta-inside?) #f) + (set! (-> this force-inside?) #f) + (set! (-> this status) 'loaded) + (set! (-> this light-hash) (the-as light-hash 0)) + (set! (-> this all-visible?) 'loading) (dotimes (v1-34 128) - (set! (-> (the-as (pointer int128) (&+ (-> obj vis-bits) (* v1-34 16)))) 0) + (set! (-> (the-as (pointer int128) (&+ (-> this vis-bits) (* v1-34 16)))) 0) ) (countdown (v1-37 8) - (let ((a0-20 (-> obj vis-info v1-37))) + (let ((a0-20 (-> this vis-info v1-37))) (if a0-20 (set! (-> a0-20 current-vis-string) (the-as uint -1)) ) @@ -1205,105 +1211,105 @@ ) ) ) - (if (= (-> *level* log-in-level-bsp) (-> obj bsp)) + (if (= (-> *level* log-in-level-bsp) (-> this bsp)) (set! (-> *level* log-in-level-bsp) #f) ) - obj + this ) ;; definition for method 12 of type level ;; WARN: Using new Jak 2 rtype-of -(defmethod unload! level ((obj level)) - (deactivate obj) - (when (!= (-> obj status) 'inactive) +(defmethod unload! level ((this level)) + (deactivate this) + (when (!= (-> this status) 'inactive) (dotimes (s5-0 2) - (when (-> obj borrow-level s5-0) - (unload! (-> obj borrow-level s5-0)) - (set! (-> obj borrow-level s5-0) #f) + (when (-> this borrow-level s5-0) + (unload! (-> this borrow-level s5-0)) + (set! (-> this borrow-level s5-0) #f) ) ) - (when (-> obj borrow-from-level) + (when (-> this borrow-from-level) (dotimes (v1-19 2) - (if (= obj (-> obj borrow-from-level borrow-level v1-19)) - (set! (-> obj borrow-from-level borrow-level v1-19) #f) + (if (= this (-> this borrow-from-level borrow-level v1-19)) + (set! (-> this borrow-from-level borrow-level v1-19) #f) ) ) - (set! (-> obj borrow-from-level) #f) + (set! (-> this borrow-from-level) #f) ) - (case (-> obj status) + (case (-> this status) (('loading 'loading-bt) (if (nonzero? link-reset) (link-reset) ) ) (('alive 'active 'loaded) - (when (-> obj info deactivate-func) - (let ((s5-1 (-> obj info deactivate-func value))) + (when (-> this info deactivate-func) + (let ((s5-1 (-> this info deactivate-func value))) (if (and s5-1 (nonzero? s5-1) (type? s5-1 function)) - (s5-1 obj) + (s5-1 this) ) ) ) ) ) - (when (or (= (-> obj status) 'loaded) - (= (-> obj status) 'alive) - (= (-> obj status) 'active) - (= (-> obj status) 'login) + (when (or (= (-> this status) 'loaded) + (= (-> this status) 'alive) + (= (-> this status) 'active) + (= (-> this status) 'login) ) - (dotimes (s5-2 (-> obj art-group art-group-array length)) - (let ((s4-0 (-> obj art-group art-group-array s5-2))) + (dotimes (s5-2 (-> this art-group art-group-array length)) + (let ((s4-0 (-> this art-group art-group-array s5-2))) (if (needs-link? s4-0) (unlink-art! s4-0) ) ) ) ) - (set! (-> obj bsp) #f) - (set! (-> obj entity) #f) - (set! (-> obj status) 'inactive) - (set! (-> obj linking) #f) - (set! (-> obj art-group string-array length) 0) - (set! (-> obj art-group art-group-array length) 0) - (set! (-> obj mem-usage-block) (the-as memory-usage-block 0)) - (set! (-> obj mem-usage) 0) - (set! (-> obj part-engine) #f) + (set! (-> this bsp) #f) + (set! (-> this entity) #f) + (set! (-> this status) 'inactive) + (set! (-> this linking) #f) + (set! (-> this art-group string-array length) 0) + (set! (-> this art-group art-group-array length) 0) + (set! (-> this mem-usage-block) (the-as memory-usage-block 0)) + (set! (-> this mem-usage) 0) + (set! (-> this part-engine) #f) (dotimes (v1-60 4) - (set! (-> obj user-object v1-60) #f) + (set! (-> this user-object v1-60) #f) ) - (let ((v1-63 (-> obj status))) + (let ((v1-63 (-> this status))) (when (or (= v1-63 'alive) (or (= v1-63 'active) (= v1-63 'loaded))) (dotimes (s5-3 10) - (let ((a0-37 (-> obj info texture-anim s5-3))) + (let ((a0-37 (-> this info texture-anim s5-3))) (if a0-37 - (set! (-> obj texture-anim-array s5-3) (clear! (the-as texture-anim-array (-> a0-37 value)))) + (set! (-> this texture-anim-array s5-3) (clear! (the-as texture-anim-array (-> a0-37 value)))) ) ) ) ) ) (dotimes (v1-73 10) - (set! (-> obj texture-anim-array v1-73) #f) + (set! (-> this texture-anim-array v1-73) #f) ) - (countdown (s5-4 (-> obj loaded-texture-page-count)) + (countdown (s5-4 (-> this loaded-texture-page-count)) (dotimes (v1-76 32) - (when (= (-> obj loaded-texture-page s5-4) (-> *texture-pool* common-page v1-76)) + (when (= (-> this loaded-texture-page s5-4) (-> *texture-pool* common-page v1-76)) (set! (-> *texture-pool* common-page v1-76) (the-as texture-page 0)) 0 ) ) - (unload-page *texture-pool* (-> obj loaded-texture-page s5-4)) + (unload-page *texture-pool* (-> this loaded-texture-page s5-4)) ) - (set! (-> obj loaded-texture-page-count) 0) - (unlink-shaders-in-heap *texture-page-dir* (-> obj heap)) - (unlink-part-group-by-heap (-> obj heap)) - (unlink-lightning-spec-by-heap (-> obj heap)) + (set! (-> this loaded-texture-page-count) 0) + (unlink-shaders-in-heap *texture-page-dir* (-> this heap)) + (unlink-part-group-by-heap (-> this heap)) + (unlink-lightning-spec-by-heap (-> this heap)) (particle-adgif-cache-flush) - (set! (-> obj loaded-text-info-count) 0) + (set! (-> this loaded-text-info-count) 0) (dotimes (s5-5 2) (let ((v1-90 (-> *art-control* buffer s5-5 pending-load-file))) - (if (and (>= (the-as int v1-90) (the-as int (-> obj heap base))) - (< (the-as int v1-90) (the-as int (-> obj heap top-base))) + (if (and (>= (the-as int v1-90) (the-as int (-> this heap base))) + (< (the-as int v1-90) (the-as int (-> this heap top-base))) ) (set-pending-file (-> *art-control* buffer s5-5) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) @@ -1313,7 +1319,7 @@ (dotimes (a0-59 (-> v1-100 length)) (when (nonzero? a0-59) (let ((a1-20 (-> v1-100 a0-59))) - (when (and (-> a1-20 info) (= (-> a1-20 info level) (-> obj name))) + (when (and (-> a1-20 info) (= (-> a1-20 info level) (-> this name))) (countdown (a2-6 7) (set! (-> a1-20 info hooks a2-6) #f) ) @@ -1324,7 +1330,7 @@ ) (let ((v1-103 0) (a0-60 0) - (a1-23 (the-as basic (-> obj level-type))) + (a1-23 (the-as basic (-> this level-type))) ) (while a1-23 (+! a0-60 1) @@ -1333,7 +1339,7 @@ (set! a1-23 (-> (the-as type a1-23) method-table 8)) ) ) - (let* ((s5-6 (-> obj info packages)) + (let* ((s5-6 (-> this info packages)) (a0-61 (car s5-6)) ) (while (not (null? s5-6)) @@ -1349,15 +1355,15 @@ (set! a0-61 (car s5-6)) ) ) - (vis-clear obj) - (let ((v1-120 (-> obj heap))) + (vis-clear this) + (let ((v1-120 (-> this heap))) (set! (-> v1-120 current) (-> v1-120 base)) ) - (set! (-> obj memory-mask) (the-as uint 0)) - (set! (-> obj code-memory-start) (the-as pointer 0)) - (set! (-> obj code-memory-end) (the-as pointer 0)) - (set! (-> obj level-type) #f) - (when (= (-> *level* loading-level) obj) + (set! (-> this memory-mask) (the-as uint 0)) + (set! (-> this code-memory-start) (the-as pointer 0)) + (set! (-> this code-memory-end) (the-as pointer 0)) + (set! (-> this level-type) #f) + (when (= (-> *level* loading-level) this) (set! loading-level global) (set! (-> *level* loading-level) (-> *level* default-level)) (set! (-> *level* log-in-level-bsp) #f) @@ -1366,14 +1372,14 @@ ) (assign-draw-indices *level*) ) - obj + this ) ;; definition for method 10 of type level ;; ERROR: Unsupported inline assembly instruction kind - [addiu a0, a0, 56] -(defmethod is-object-visible? level ((obj level) (arg0 int)) +(defmethod is-object-visible? level ((this level) (arg0 int)) (local-vars (a0-1 int) (a0-3 int)) - (let ((v1-0 (-> obj vis-bits))) + (let ((v1-0 (-> this vis-bits))) (shift-arith-right-32 a0-1 arg0 3) (let ((v1-2 (-> (the-as (pointer int8) (+ a0-1 (the-as int v1-0)))))) (let ((a0-2 (logand arg0 7))) @@ -1385,28 +1391,28 @@ ) ;; definition for method 15 of type level -(defmethod inside-boxes-check level ((obj level) (arg0 vector)) +(defmethod inside-boxes-check level ((this level) (arg0 vector)) (cond - ((not (-> obj bsp)) + ((not (-> this bsp)) #f ) - ((-> obj force-inside?) + ((-> this force-inside?) #t ) (else - (zero? (-> obj bsp cam-outside-bsp)) + (zero? (-> this bsp cam-outside-bsp)) ) ) ) ;; definition for method 20 of type level ;; WARN: Return type mismatch int vs none. -(defmethod debug-print-region-splitbox level ((obj level) (arg0 vector) (arg1 object)) +(defmethod debug-print-region-splitbox level ((this level) (arg0 vector) (arg1 object)) (cond - ((or (not (-> obj bsp)) (zero? (-> obj bsp region-tree))) + ((or (not (-> this bsp)) (zero? (-> this bsp region-tree))) ) - ((nonzero? (-> obj bsp region-tree)) - (debug-print (-> obj bsp region-tree) arg0 arg1) + ((nonzero? (-> this bsp region-tree)) + (debug-print (-> this bsp region-tree) arg0 arg1) ) ) 0 @@ -1414,31 +1420,31 @@ ) ;; definition for method 8 of type level -(defmethod mem-usage level ((obj level) (arg0 memory-usage-block) (arg1 int)) - (when (= (-> obj status) 'active) +(defmethod mem-usage level ((this level) (arg0 memory-usage-block) (arg1 int)) + (when (= (-> this status) 'active) (set! (-> arg0 length) (max 67 (-> arg0 length))) (set! (-> arg0 data 66 name) "entity-links") - (+! (-> arg0 data 66 count) (-> obj entity length)) - (let ((v1-8 (asize-of (-> obj entity)))) + (+! (-> arg0 data 66 count) (-> this entity length)) + (let ((v1-8 (asize-of (-> this entity)))) (+! (-> arg0 data 66 used) v1-8) (+! (-> arg0 data 66 total) (logand -16 (+ v1-8 15))) ) - (mem-usage (-> obj art-group) arg0 arg1) + (mem-usage (-> this art-group) arg0 arg1) (set! (-> arg0 length) (max 66 (-> arg0 length))) (set! (-> arg0 data 65 name) "level-code") (+! (-> arg0 data 65 count) 1) - (let ((v1-20 (&- (-> obj code-memory-end) (the-as uint (-> obj code-memory-start))))) + (let ((v1-20 (&- (-> this code-memory-end) (the-as uint (-> this code-memory-start))))) (+! (-> arg0 data 65 used) v1-20) (+! (-> arg0 data 65 total) (logand -16 (+ v1-20 15))) ) - (countdown (s3-0 (-> obj loaded-texture-page-count)) - (mem-usage (-> obj loaded-texture-page s3-0) arg0 arg1) + (countdown (s3-0 (-> this loaded-texture-page-count)) + (mem-usage (-> this loaded-texture-page s3-0) arg0 arg1) ) - (countdown (s3-1 (-> obj loaded-text-info-count)) - (mem-usage (-> obj loaded-text-info s3-1) arg0 arg1) + (countdown (s3-1 (-> this loaded-text-info-count)) + (mem-usage (-> this loaded-text-info s3-1) arg0 arg1) ) (countdown (s3-2 8) - (let ((s2-0 (-> obj vis-info s3-2))) + (let ((s2-0 (-> this vis-info s3-2))) (when s2-0 (cond ((zero? s3-2) @@ -1463,14 +1469,14 @@ ) ) ) - (mem-usage (-> obj bsp) arg0 arg1) + (mem-usage (-> this bsp) arg0 arg1) ) - obj + this ) ;; definition for method 21 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod alloc-levels-if-needed level-group ((obj level-group) (arg0 symbol)) +(defmethod alloc-levels-if-needed level-group ((this level-group) (arg0 symbol)) (when (zero? (-> *level* heap base)) (kmemopen global "level-heaps") (when (nmember "game" *kernel-packages*) @@ -1486,7 +1492,7 @@ #x1af2800 ) ) - (gp-1 (-> obj heap)) + (gp-1 (-> this heap)) ) (set! (-> gp-1 base) (kmalloc global s5-1 (kmalloc-flags) "heap")) (set! (-> gp-1 current) (-> gp-1 base)) @@ -1500,46 +1506,46 @@ ) ;; definition for method 10 of type level-group -(defmethod level-get-with-status level-group ((obj level-group) (arg0 symbol)) - (dotimes (v1-0 (-> obj length)) - (if (= (-> obj level v1-0 status) arg0) - (return (-> obj level v1-0)) +(defmethod level-get-with-status level-group ((this level-group) (arg0 symbol)) + (dotimes (v1-0 (-> this length)) + (if (= (-> this level v1-0 status) arg0) + (return (-> this level v1-0)) ) ) (the-as level #f) ) ;; definition for method 30 of type level-group -(defmethod level-get-most-disposable level-group ((obj level-group)) - (dotimes (v1-0 (-> obj length)) - (case (-> obj level v1-0 status) +(defmethod level-get-most-disposable level-group ((this level-group)) + (dotimes (v1-0 (-> this length)) + (case (-> this level v1-0 status) (('inactive) - (return (-> obj level v1-0)) + (return (-> this level v1-0)) ) ) ) - (dotimes (v1-6 (-> obj length)) - (case (-> obj level v1-6 status) + (dotimes (v1-6 (-> this length)) + (case (-> this level v1-6 status) (('loading 'loading-bt) - (return (-> obj level v1-6)) + (return (-> this level v1-6)) ) ) ) - (dotimes (v1-12 (-> obj length)) - (case (-> obj level v1-12 status) + (dotimes (v1-12 (-> this length)) + (case (-> this level v1-12 status) (('loaded) - (return (-> obj level v1-12)) + (return (-> this level v1-12)) ) ) ) (let ((v0-0 (the-as level #f))) - (dotimes (v1-18 (-> obj length)) - (case (-> obj level v1-18 status) + (dotimes (v1-18 (-> this length)) + (case (-> this level v1-18 status) (('active) - (if (and (not (-> obj level v1-18 inside-boxes)) - (or (not v0-0) (< (-> obj level v1-18 info priority) (-> v0-0 info priority))) + (if (and (not (-> this level v1-18 inside-boxes)) + (or (not v0-0) (< (-> this level v1-18 info priority) (-> v0-0 info priority))) ) - (set! v0-0 (-> obj level v1-18)) + (set! v0-0 (-> this level v1-18)) ) ) ) @@ -1549,19 +1555,19 @@ ) ;; definition for method 9 of type level-group -(defmethod level-get level-group ((obj level-group) (arg0 symbol)) - (dotimes (v1-0 (-> obj length)) - (if (and (!= (-> obj level v1-0 status) 'inactive) - (or (= (-> obj level v1-0 name) arg0) (= (-> obj level v1-0 load-name) arg0)) +(defmethod level-get level-group ((this level-group) (arg0 symbol)) + (dotimes (v1-0 (-> this length)) + (if (and (!= (-> this level v1-0 status) 'inactive) + (or (= (-> this level v1-0 name) arg0) (= (-> this level v1-0 load-name) arg0)) ) - (return (-> obj level v1-0)) + (return (-> this level v1-0)) ) ) (the-as level #f) ) ;; definition for method 23 of type level-group -(defmethod art-group-get-by-name level-group ((obj level-group) (arg0 string) (arg1 (pointer uint32))) +(defmethod art-group-get-by-name level-group ((this level-group) (arg0 string) (arg1 (pointer uint32))) (countdown (s4-0 7) (let ((s3-0 (-> *level* level s4-0))) (when (or (= (-> s3-0 status) 'active) (= (-> s3-0 status) 'reserved)) @@ -1580,20 +1586,20 @@ ) ;; definition for method 13 of type level-group -(defmethod activate-levels! level-group ((obj level-group)) - (dotimes (s5-0 (-> obj length)) - (level-status-update! (-> obj level s5-0) 'active) +(defmethod activate-levels! level-group ((this level-group)) + (dotimes (s5-0 (-> this length)) + (level-status-update! (-> this level s5-0) 'active) ) 0 ) ;; definition for method 20 of type level-group -(defmethod level-get-target-inside level-group ((obj level-group)) +(defmethod level-get-target-inside level-group ((this level-group)) (let ((s5-0 (target-pos 0))) (let ((v1-1 (-> *load-state* vis-nick))) (when v1-1 - (dotimes (a0-3 (-> obj length)) - (let ((a1-3 (-> obj level a0-3))) + (dotimes (a0-3 (-> this length)) + (let ((a1-3 (-> this level a0-3))) (when (= (-> a1-3 status) 'active) (if (= (-> a1-3 name) v1-1) (return a1-3) @@ -1604,8 +1610,8 @@ ) ) (let ((v1-5 (-> *game-info* current-continue level))) - (dotimes (a0-5 (-> obj length)) - (let ((a1-8 (-> obj level a0-5))) + (dotimes (a0-5 (-> this length)) + (let ((a1-8 (-> this level a0-5))) (when (= (-> a1-8 status) 'active) (if (= (-> a1-8 name) v1-5) (return a1-8) @@ -1616,8 +1622,8 @@ ) (let ((s4-0 (the-as level #f))) (let ((f30-0 0.0)) - (dotimes (s3-0 (-> obj length)) - (let ((s2-0 (-> obj level s3-0))) + (dotimes (s3-0 (-> this length)) + (let ((s2-0 (-> this level s3-0))) (when (= (-> s2-0 status) 'active) (let ((f0-0 (vector-vector-distance (-> s2-0 bsp bsphere) s5-0))) (if (and (-> s2-0 inside-boxes) (or (not s4-0) (< f0-0 f30-0))) @@ -1633,8 +1639,8 @@ ) ) ) - (dotimes (v1-23 (-> obj length)) - (let ((a0-11 (-> obj level v1-23))) + (dotimes (v1-23 (-> this length)) + (let ((a0-11 (-> this level v1-23))) (when (= (-> a0-11 status) 'active) (if (-> a0-11 meta-inside?) (return a0-11) @@ -1644,8 +1650,8 @@ ) (let ((v0-1 (the-as level #f))) 0.0 - (dotimes (v1-26 (-> obj length)) - (let ((a0-16 (-> obj level v1-26))) + (dotimes (v1-26 (-> this length)) + (let ((a0-16 (-> this level v1-26))) (when (= (-> a0-16 status) 'active) (if (not v0-1) (set! v0-1 a0-16) @@ -1659,18 +1665,18 @@ ;; definition for method 22 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod load-commands-set! level-group ((obj level-group) (arg0 pair)) - (set! (-> obj load-commands) arg0) +(defmethod load-commands-set! level-group ((this level-group) (arg0 pair)) + (set! (-> this load-commands) arg0) 0 (none) ) ;; definition for method 8 of type level-group -(defmethod mem-usage level-group ((obj level-group) (arg0 memory-usage-block) (arg1 int)) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj level s3-0) arg0 arg1) +(defmethod mem-usage level-group ((this level-group) (arg0 memory-usage-block) (arg1 int)) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this level s3-0) arg0 arg1) ) - obj + this ) ;; definition for function bg @@ -1965,7 +1971,7 @@ ) ;; definition for method 10 of type load-state -(defmethod update! load-state ((obj load-state)) +(defmethod update! load-state ((this load-state)) (local-vars (all-levels-inactive symbol)) (let ((discarded-level #f)) (let ((most-recent-load-order 0)) @@ -1979,7 +1985,7 @@ ) (let ((still-wanted #f)) (dotimes (t0-2 6) - (if (= (-> unload-candidate-lev name) (-> obj want t0-2 name)) + (if (= (-> unload-candidate-lev name) (-> this want t0-2 name)) (set! still-wanted #t) ) ) @@ -2021,11 +2027,11 @@ (set! (-> desired-levels a0-14) #f) ) (dotimes (want-lev-idx 6) - (when (-> obj want want-lev-idx name) - (set! (-> desired-levels want-lev-idx) (-> obj want want-lev-idx name)) + (when (-> this want want-lev-idx name) + (set! (-> desired-levels want-lev-idx) (-> this want want-lev-idx name)) (dotimes (a1-17 6) (let ((a2-13 (-> *level* level a1-17))) - (if (and (!= (-> a2-13 status) 'inactive) (= (-> a2-13 name) (-> obj want want-lev-idx name))) + (if (and (!= (-> a2-13 status) 'inactive) (= (-> a2-13 name) (-> this want want-lev-idx name))) (set! (-> desired-levels want-lev-idx) #f) ) ) @@ -2042,9 +2048,9 @@ (label cfg-51) (when (!= want-lev-idx-to-load -1) (when (and (or no-levels-at-all (not (check-busy *load-dgo-rpc*))) (not (load-in-progress? *level*))) - (format 0 "Adding level ~A~%" (-> obj want want-lev-idx-to-load name)) - (let ((new-lev (level-get-for-use *level* (-> obj want want-lev-idx-to-load name) 'loaded))) - (when (and no-levels-at-all (-> obj want want-lev-idx-to-load display?)) + (format 0 "Adding level ~A~%" (-> this want want-lev-idx-to-load name)) + (let ((new-lev (level-get-for-use *level* (-> this want want-lev-idx-to-load name) 'loaded))) + (when (and no-levels-at-all (-> this want want-lev-idx-to-load display?)) (format 0 "Waiting for level to load~%") (while (or (= (-> new-lev status) 'loading) (= (-> new-lev status) 'loading-bt) (= (-> new-lev status) 'login)) (load-continue new-lev) @@ -2058,31 +2064,31 @@ ) ) (dotimes (want-lev-i 6) - (when (-> obj want want-lev-i name) + (when (-> this want want-lev-i name) (dotimes (lev-i 7) (let ((lev (-> *level* level lev-i))) (when (!= (-> lev status) 'inactive) - (when (= (-> lev name) (-> obj want want-lev-i name)) - (when (!= (-> lev display?) (-> obj want want-lev-i display?)) + (when (= (-> lev name) (-> this want want-lev-i name)) + (when (!= (-> lev display?) (-> this want want-lev-i display?)) (cond ((not (-> lev display?)) (cond ((or (= (-> lev status) 'loaded) (= (-> lev status) 'active)) - (format 0 "Displaying level ~A [~A]~%" (-> obj want want-lev-i name) (-> obj want want-lev-i display?)) + (format 0 "Displaying level ~A [~A]~%" (-> this want want-lev-i name) (-> this want want-lev-i display?)) (level-get-for-use *level* (-> lev info name) 'active) - (set! (-> lev display?) (-> obj want want-lev-i display?)) + (set! (-> lev display?) (-> this want want-lev-i display?)) ) (else - (if (and (-> lev info wait-for-load) (!= (-> obj want want-lev-i display?) 'display-no-wait)) + (if (and (-> lev info wait-for-load) (!= (-> this want want-lev-i display?) 'display-no-wait)) (send-event *target* 'loading) ) (if (= *cheat-mode* 'debug) - (format *stdcon* "display on for ~A but level is loading~%" (-> obj want want-lev-i name)) + (format *stdcon* "display on for ~A but level is loading~%" (-> this want want-lev-i name)) ) ) ) ) - ((not (-> obj want want-lev-i display?)) + ((not (-> this want want-lev-i display?)) (set! (-> lev display?) #f) (format 0 "Turning level ~A off~%" (-> lev name)) (deactivate lev) @@ -2091,31 +2097,31 @@ (format 0 "Setting level ~A display command to ~A~%" - (-> obj want want-lev-i name) - (-> obj want want-lev-i display?) + (-> this want want-lev-i name) + (-> this want want-lev-i display?) ) - (set! (-> lev display?) (-> obj want want-lev-i display?)) + (set! (-> lev display?) (-> this want want-lev-i display?)) ) ) ) - (when (!= (-> lev force-all-visible?) (-> obj want want-lev-i force-vis?)) - (set! (-> lev force-all-visible?) (-> obj want want-lev-i force-vis?)) + (when (!= (-> lev force-all-visible?) (-> this want want-lev-i force-vis?)) + (set! (-> lev force-all-visible?) (-> this want want-lev-i force-vis?)) (format 0 "Setting force-all-visible?[~A] to ~A~%" - (-> obj want want-lev-i name) - (-> obj want want-lev-i force-vis?) + (-> this want want-lev-i name) + (-> this want want-lev-i force-vis?) ) ) - (when (!= (-> lev force-inside?) (-> obj want want-lev-i force-inside?)) + (when (!= (-> lev force-inside?) (-> this want want-lev-i force-inside?)) (format 0 "Setting force-inside?[~A] ~A->~A~%" - (-> obj want want-lev-i name) + (-> this want want-lev-i name) (-> lev force-inside?) - (-> obj want want-lev-i force-inside?) + (-> this want want-lev-i force-inside?) ) - (set! (-> lev force-inside?) (-> obj want want-lev-i force-inside?)) + (set! (-> lev force-inside?) (-> this want want-lev-i force-inside?)) ) ) ) @@ -2130,7 +2136,7 @@ (let ((a2-32 (-> *level* level a1-35))) (when (= (-> a2-32 status) 'active) (when (and (-> a2-32 inside-boxes) (not (null? (-> a2-32 info continues)))) - (if (= (-> a2-32 name) (-> obj vis-nick)) + (if (= (-> a2-32 name) (-> this vis-nick)) (goto cfg-125) ) (set! lev-for-vis a2-32) @@ -2139,8 +2145,8 @@ ) ) ) - (if (and (>= num-vis-levs 1) (!= (-> lev-for-vis name) (-> obj vis-nick))) - (want-vis-level obj (-> lev-for-vis name)) + (if (and (>= num-vis-levs 1) (!= (-> lev-for-vis name) (-> this vis-nick))) + (want-vis-level this (-> lev-for-vis name)) ) ) (label cfg-125) @@ -2150,19 +2156,19 @@ ;; definition for method 16 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod assign-draw-indices level-group ((obj level-group)) +(defmethod assign-draw-indices level-group ((this level-group)) (local-vars (t0-3 symbol)) - (set! (-> obj draw-level-count) 0) + (set! (-> this draw-level-count) 0) (dotimes (v1-0 7) (let ((f0-0 100000.0) (a1-1 (the-as level #f)) ) - (dotimes (a2-0 (-> obj length)) - (let ((a3-3 (-> obj level a2-0))) + (dotimes (a2-0 (-> this length)) + (let ((a3-3 (-> this level a2-0))) (when (= (-> a3-3 status) 'active) (set! t0-3 (and (< (-> a3-3 draw-priority) f0-0) (begin - (dotimes (t0-4 (-> obj draw-level-count)) - (when (= a3-3 (-> obj draw-level t0-4)) + (dotimes (t0-4 (-> this draw-level-count)) + (when (= a3-3 (-> this draw-level t0-4)) (set! t0-3 #f) (goto cfg-14) ) @@ -2180,22 +2186,22 @@ ) ) (when a1-1 - (set! (-> obj draw-level (-> obj draw-level-count)) a1-1) - (set! (-> a1-1 draw-index) (-> obj draw-level-count)) - (+! (-> obj draw-level-count) 1) + (set! (-> this draw-level (-> this draw-level-count)) a1-1) + (set! (-> a1-1 draw-index) (-> this draw-level-count)) + (+! (-> this draw-level-count) 1) ) ) ) - (while (< (-> obj draw-level-count) 7) - (set! (-> obj draw-level (-> obj draw-level-count)) #f) - (+! (-> obj draw-level-count) 1) + (while (< (-> this draw-level-count) 7) + (set! (-> this draw-level (-> this draw-level-count)) #f) + (+! (-> this draw-level-count) 1) ) - (set! (-> obj draw-level 6) (-> obj default-level)) - (set! (-> (&-> obj default-level draw-index) 0) 6) + (set! (-> this draw-level 6) (-> this default-level)) + (set! (-> (&-> this default-level draw-index) 0) 6) (dotimes (v1-12 7) - (let ((a2-9 (-> obj level v1-12))) + (let ((a2-9 (-> this level v1-12))) (if a2-9 - (set! (-> obj draw-index-map v1-12) (the-as uint (-> a2-9 draw-index))) + (set! (-> this draw-index-map v1-12) (the-as uint (-> a2-9 draw-index))) ) ) ) @@ -2205,7 +2211,7 @@ ;; definition for method 19 of type level-group ;; WARN: Return type mismatch int vs none. -(defmethod level-update level-group ((obj level-group)) +(defmethod level-update level-group ((this level-group)) (local-vars (v1-101 symbol)) (camera-pos) (new 'static 'boxed-array :type symbol :length 0 :allocated-length 6) @@ -2214,10 +2220,10 @@ (update *art-control* #t) (clear-rec *art-control*) (dotimes (s5-0 6) - (load-continue (-> obj level s5-0)) + (load-continue (-> this level s5-0)) ) - (dotimes (s5-1 (-> obj length)) - (let ((s4-0 (-> obj level s5-1))) + (dotimes (s5-1 (-> this length)) + (let ((s4-0 (-> this level s5-1))) (when (= (-> s4-0 status) 'active) (set! (-> s4-0 inside-boxes) (inside-boxes-check s4-0 (-> *math-camera* trans))) (if (-> s4-0 inside-boxes) @@ -2227,12 +2233,12 @@ ) ) (update! *load-state*) - (dotimes (s5-2 (-> obj length)) - (let ((s4-1 (-> obj level s5-2))) + (dotimes (s5-2 (-> this length)) + (let ((s4-1 (-> this level s5-2))) (when (= (-> s4-1 status) 'active) (when (-> s4-1 inside-boxes) - (dotimes (v1-40 (-> obj length)) - (let ((a0-13 (-> obj level v1-40))) + (dotimes (v1-40 (-> this length)) + (let ((a0-13 (-> this level v1-40))) (when (= (-> a0-13 status) 'active) (if (and (!= s4-1 a0-13) (not (-> a0-13 inside-boxes))) (set! (-> a0-13 meta-inside?) #f) @@ -2241,7 +2247,7 @@ ) ) ) - (when (and (null? (-> obj load-commands)) + (when (and (null? (-> this load-commands)) (= (-> s4-1 name) (-> *load-state* vis-nick)) (begin (set! (-> *setting-control* user-default music) (-> s4-1 info music-bank)) @@ -2288,8 +2294,8 @@ ) ) ) - (dotimes (v1-88 (-> obj length)) - (let ((a0-48 (-> obj level v1-88))) + (dotimes (v1-88 (-> this length)) + (let ((a0-48 (-> this level v1-88))) (when (= (-> a0-48 status) 'active) (set! (-> a0-48 vis-self-index) 0) 0 @@ -2297,8 +2303,8 @@ ) ) (when (= *cheat-mode* 'debug) - (dotimes (s5-3 (-> obj length)) - (let ((v1-96 (-> obj level s5-3))) + (dotimes (s5-3 (-> this length)) + (let ((v1-96 (-> this level s5-3))) (when (= (-> v1-96 status) 'active) (if (and (= (-> v1-96 status) 'active) (!= (-> v1-96 display?) 'special) @@ -2311,7 +2317,7 @@ ) ) (countdown (v1-100 6) - (when (-> obj level v1-100 inside-boxes) + (when (-> this level v1-100 inside-boxes) (set! v1-101 #f) (goto cfg-90) ) @@ -2323,8 +2329,8 @@ 0 ) (else - (dotimes (s5-4 (-> obj length)) - (let ((s4-3 (-> obj level s5-4))) + (dotimes (s5-4 (-> this length)) + (let ((s4-3 (-> this level s5-4))) (when (= (-> s4-3 status) 'active) (dotimes (s3-1 8) (let ((s2-1 (-> s4-3 vis-info s3-1))) @@ -2335,7 +2341,7 @@ (set! (-> s2-1 from-bsp) (-> s4-3 bsp)) ) (else - (let ((v1-114 (level-get obj (-> s2-1 from-level)))) + (let ((v1-114 (level-get this (-> s2-1 from-level)))) (set! (-> s2-1 from-bsp) (if v1-114 (-> v1-114 bsp) ) @@ -2369,7 +2375,7 @@ ) ) ) - (assign-draw-indices obj) + (assign-draw-indices this) (when (or *display-level-border* *display-texture-distances* *display-texture-download* *display-split-box-info*) (when *display-level-border* (format @@ -2400,7 +2406,7 @@ ) ) (dotimes (s5-5 7) - (let ((s4-4 (-> obj level s5-5))) + (let ((s4-4 (-> this level s5-5))) (when (or (= (-> s4-4 status) 'active) (= (-> s4-4 status) 'reserved)) (let ((t9-19 format) (a0-90 *stdcon*) @@ -2450,12 +2456,12 @@ ) ) ) - (when (and (-> obj disk-load-timing?) (-> obj load-level)) + (when (and (-> this disk-load-timing?) (-> this load-level)) (let ((s5-6 format) (s4-5 *stdcon*) (s3-2 "~0Kload ~16S ~5S ~5DK ~5,,2fs ~5,,2fs~1K ~5,,0f k/s~%") - (s2-2 (-> obj load-level)) - (v1-180 (lookup-level-info (-> obj load-level))) + (s2-2 (-> this load-level)) + (v1-180 (lookup-level-info (-> this load-level))) ) (s5-6 s4-5 @@ -2465,12 +2471,12 @@ (-> v1-180 nickname) "" ) - (shr (-> obj load-size) 10) - (-> obj load-time) - (-> obj load-login-time) - (if (= (-> obj load-time) 0.0) + (shr (-> this load-size) 10) + (-> this load-time) + (-> this load-login-time) + (if (= (-> this load-time) 0.0) 0 - (* 0.0009765625 (/ (the float (-> obj load-size)) (-> obj load-time))) + (* 0.0009765625 (/ (the float (-> this load-size)) (-> this load-time))) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/level/region-h_REF.gc b/test/decompiler/reference/jak2/engine/level/region-h_REF.gc index c45fee42ce..af58b53026 100644 --- a/test/decompiler/reference/jak2/engine/level/region-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/region-h_REF.gc @@ -17,18 +17,18 @@ ) ;; definition for method 3 of type region -(defmethod inspect region ((obj region)) - (when (not obj) - (set! obj obj) +(defmethod inspect region ((this region)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'region) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Ton-enter: ~A~%" (-> obj on-enter)) - (format #t "~1Ton-inside: ~A~%" (-> obj on-inside)) - (format #t "~1Ton-exit: ~A~%" (-> obj on-exit)) + (format #t "[~8x] ~A~%" this 'region) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Ton-enter: ~A~%" (-> this on-enter)) + (format #t "~1Ton-inside: ~A~%" (-> this on-inside)) + (format #t "~1Ton-exit: ~A~%" (-> this on-exit)) (label cfg-4) - obj + this ) ;; definition of type region-array @@ -41,17 +41,17 @@ ) ;; definition for method 3 of type region-array -(defmethod inspect region-array ((obj region-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect region-array ((this region-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -72,17 +72,17 @@ ) ;; definition for method 3 of type drawable-region-prim -(defmethod inspect drawable-region-prim ((obj drawable-region-prim)) - (when (not obj) - (set! obj obj) +(defmethod inspect drawable-region-prim ((this drawable-region-prim)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tregion: #~%" (-> obj region)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tregion: #~%" (-> this region)) (label cfg-4) - obj + this ) ;; definition of type drawable-tree-region-prim @@ -100,22 +100,22 @@ ) ;; definition for method 3 of type drawable-tree-region-prim -(defmethod inspect drawable-tree-region-prim ((obj drawable-tree-region-prim)) - (when (not obj) - (set! obj obj) +(defmethod inspect drawable-tree-region-prim ((this drawable-tree-region-prim)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data2)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> obj data2 s5-0)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data2)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> this data2 s5-0)) ) - (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tname: ~A~%" (-> this name)) (label cfg-7) - obj + this ) ;; definition of type drawable-inline-array-region-prim @@ -137,17 +137,17 @@ ) ;; definition for method 3 of type drawable-region-sphere -(defmethod inspect drawable-region-sphere ((obj drawable-region-sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect drawable-region-sphere ((this drawable-region-sphere)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tregion: #~%" (-> obj region)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tregion: #~%" (-> this region)) (label cfg-4) - obj + this ) ;; definition of type region-face-data @@ -163,18 +163,18 @@ ) ;; definition for method 3 of type region-face-data -(defmethod inspect region-face-data ((obj region-face-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect region-face-data ((this region-face-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'region-face-data) - (format #t "~1Tnormal: #~%" (-> obj normal)) - (format #t "~1Tnormal-offset: ~f~%" (-> obj normal w)) - (format #t "~1Tnum-points: ~D~%" (-> obj num-points)) - (format #t "~1Tpoints[0] @ #x~X~%" (-> obj points)) + (format #t "[~8x] ~A~%" this 'region-face-data) + (format #t "~1Tnormal: #~%" (-> this normal)) + (format #t "~1Tnormal-offset: ~f~%" (-> this normal w)) + (format #t "~1Tnum-points: ~D~%" (-> this num-points)) + (format #t "~1Tpoints[0] @ #x~X~%" (-> this points)) (label cfg-4) - obj + this ) ;; definition of type drawable-region-face @@ -187,18 +187,18 @@ ) ;; definition for method 3 of type drawable-region-face -(defmethod inspect drawable-region-face ((obj drawable-region-face)) - (when (not obj) - (set! obj obj) +(defmethod inspect drawable-region-face ((this drawable-region-face)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tregion: #~%" (-> obj region)) - (format #t "~1Tdata: #~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tregion: #~%" (-> this region)) + (format #t "~1Tdata: #~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type region-face-array @@ -212,17 +212,17 @@ ) ;; definition for method 3 of type region-face-array -(defmethod inspect region-face-array ((obj region-face-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect region-face-array ((this region-face-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -238,18 +238,18 @@ ) ;; definition for method 3 of type drawable-region-volume -(defmethod inspect drawable-region-volume ((obj drawable-region-volume)) - (when (not obj) - (set! obj obj) +(defmethod inspect drawable-region-volume ((this drawable-region-volume)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tregion: #~%" (-> obj region)) - (format #t "~1Tfaces: ~A~%" (-> obj faces)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tregion: #~%" (-> this region)) + (format #t "~1Tfaces: ~A~%" (-> this faces)) (label cfg-4) - obj + this ) ;; definition of type region-prim-list @@ -263,16 +263,16 @@ ) ;; definition for method 3 of type region-prim-list -(defmethod inspect region-prim-list ((obj region-prim-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect region-prim-list ((this region-prim-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'region-prim-list) - (format #t "~1Tnum-items: ~D~%" (-> obj num-items)) - (format #t "~1Titems[320] @ #x~X~%" (-> obj items)) + (format #t "[~8x] ~A~%" this 'region-prim-list) + (format #t "~1Tnum-items: ~D~%" (-> this num-items)) + (format #t "~1Titems[320] @ #x~X~%" (-> this items)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/level/region_REF.gc b/test/decompiler/reference/jak2/engine/level/region_REF.gc index 0e412368b9..ca1690c514 100644 --- a/test/decompiler/reference/jak2/engine/level/region_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/region_REF.gc @@ -3,21 +3,21 @@ ;; definition for method 8 of type drawable-region-prim ;; WARN: Return type mismatch int vs drawable-region-prim. -(defmethod mem-usage drawable-region-prim ((obj drawable-region-prim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-region-prim ((this drawable-region-prim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 50 (-> arg0 length))) (set! (-> arg0 data 49 name) "region") (+! (-> arg0 data 49 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 49 used) v1-6) (+! (-> arg0 data 49 total) (logand -16 (+ v1-6 15))) ) - (mem-usage (-> obj region) arg0 (logior arg1 128)) + (mem-usage (-> this region) arg0 (logior arg1 128)) (the-as drawable-region-prim 0) ) ;; definition for method 8 of type drawable-inline-array-region-prim ;; WARN: Return type mismatch int vs drawable-inline-array-region-prim. -(defmethod mem-usage drawable-inline-array-region-prim ((obj drawable-inline-array-region-prim) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage drawable-inline-array-region-prim ((this drawable-inline-array-region-prim) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 1 (-> arg0 length))) (set! (-> arg0 data 0 name) (symbol->string 'drawable-group)) (+! (-> arg0 data 0 count) 1) @@ -25,38 +25,38 @@ (+! (-> arg0 data 0 used) v1-7) (+! (-> arg0 data 0 total) (logand -16 (+ v1-7 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj data s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this data s3-0) arg0 arg1) ) (the-as drawable-inline-array-region-prim 0) ) ;; definition for method 10 of type drawable-tree-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod draw drawable-tree-region-prim ((obj drawable-tree-region-prim) (arg0 drawable-tree-region-prim) (arg1 display-frame)) +(defmethod draw drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 drawable-tree-region-prim) (arg1 display-frame)) 0 (none) ) ;; definition for method 15 of type drawable-tree-region-prim -(defmethod unpack-vis drawable-tree-region-prim ((obj drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8))) +(defmethod unpack-vis drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 (pointer int8)) (arg1 (pointer int8))) arg1 ) ;; definition for method 16 of type drawable-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod collect-regions drawable-region-prim ((obj drawable-region-prim) (area-of-interest sphere) (_count int) (region-list region-prim-list)) +(defmethod collect-regions drawable-region-prim ((this drawable-region-prim) (area-of-interest sphere) (_count int) (region-list region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @param! region-list Stores the overlapping regions and a count for how many were found @returns none" (dotimes (count _count) - (when (spheres-overlap? area-of-interest (the-as sphere (-> obj bsphere))) - (set! (-> region-list items (-> region-list num-items)) obj) + (when (spheres-overlap? area-of-interest (the-as sphere (-> this bsphere))) + (set! (-> region-list items (-> region-list num-items)) this) (+! (-> region-list num-items) 1) ) - (&+! obj 32) + (&+! this 32) ) 0 (none) @@ -64,47 +64,47 @@ ;; definition for method 16 of type drawable-inline-array-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod collect-regions drawable-inline-array-region-prim ((obj drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions drawable-inline-array-region-prim ((this drawable-inline-array-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @param! region-list Stores the overlapping regions and a count for how many were found @returns none" - (collect-regions (the-as drawable-region-prim (-> obj data)) arg0 (-> obj length) arg2) + (collect-regions (the-as drawable-region-prim (-> this data)) arg0 (-> this length) arg2) 0 (none) ) ;; definition for method 16 of type drawable-tree-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod collect-regions drawable-tree-region-prim ((obj drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) +(defmethod collect-regions drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 sphere) (arg1 int) (arg2 region-prim-list)) "Determines the number of [[drawable]]s in the `obj` that overlap the given `area-of-interest` this number is stored in the `region-list`'s item count @param area-of-interest The area defined by a sphere that we care about overlaps @param _count The amount of [[drawable]]s in the object to enumerate through @param! region-list Stores the overlapping regions and a count for how many were found @returns none" - (collect-regions (-> obj data2 0) arg0 (-> obj length) arg2) + (collect-regions (-> this data2 0) arg0 (-> this length) arg2) 0 (none) ) ;; definition for method 17 of type drawable-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-region drawable-region-prim ((obj drawable-region-prim) (arg0 int)) +(defmethod debug-draw-region drawable-region-prim ((this drawable-region-prim) (arg0 int)) (local-vars (sv-32 vector2h) (sv-36 vector)) (set! sv-32 (new 'stack 'vector2h)) - (set! sv-36 (-> obj bsphere)) + (set! sv-36 (-> this bsphere)) (add-debug-x #t (bucket-id debug-no-zbuf1) sv-36 (new 'static 'rgba :r #xff :g #xff :a #x80)) - (when (nonzero? (-> obj region)) + (when (nonzero? (-> this region)) (let ((s5-0 add-debug-text-3d) (s4-0 #t) (s3-0 318) ) - (format (clear *temp-string*) "region-~D~%" (-> obj region id)) + (format (clear *temp-string*) "region-~D~%" (-> this region id)) (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* sv-36 (font-color white) sv-32) ) (+! (-> sv-32 y) 8) - (let ((s5-1 (-> obj region on-enter))) + (let ((s5-1 (-> this region on-enter))) (when s5-1 (let ((s4-1 add-debug-text-3d) (s3-1 #t) @@ -116,7 +116,7 @@ (+! (-> sv-32 y) 8) ) ) - (let ((s5-2 (-> obj region on-inside))) + (let ((s5-2 (-> this region on-inside))) (when s5-2 (let ((s4-2 add-debug-text-3d) (s3-2 #t) @@ -128,7 +128,7 @@ (+! (-> sv-32 y) 8) ) ) - (let ((gp-1 (-> obj region on-exit))) + (let ((gp-1 (-> this region on-exit))) (when gp-1 (let ((s5-3 add-debug-text-3d) (s4-3 #t) @@ -146,13 +146,13 @@ ) ;; definition for method 18 of type drawable-region-prim -(defmethod track-region drawable-region-prim ((obj drawable-region-prim) (arg0 region-prim-area)) +(defmethod track-region drawable-region-prim ((this drawable-region-prim) (arg0 region-prim-area)) "TODO" #f ) ;; definition for method 19 of type drawable-region-prim -(defmethod within-area? drawable-region-prim ((obj drawable-region-prim) (arg0 region-prim-area)) +(defmethod within-area? drawable-region-prim ((this drawable-region-prim) (arg0 region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" #f ) @@ -160,23 +160,23 @@ ;; definition for method 9 of type region-prim-area ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 9 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-entered-region! region-prim-area ((obj region-prim-area) (region-sphere drawable-region-sphere)) +(defmethod track-entered-region! region-prim-area ((this region-prim-area) (region-sphere drawable-region-sphere)) "Enumerates through the objects `region-enter-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and increment `region-enter-count` @param region-sphere Defines the region in question @returns nothing" - (let ((regions-entered (-> obj region-enter-count))) + (let ((regions-entered (-> this region-enter-count))) (let ((region (-> region-sphere region))) (countdown (idx regions-entered) - (if (= (-> obj region-enter-list idx) region) + (if (= (-> this region-enter-list idx) region) (return #f) ) ) - (set! (-> obj region-enter-list regions-entered) region) + (set! (-> this region-enter-list regions-entered) region) ) - (set! (-> obj region-enter-prim-list regions-entered) region-sphere) - (set! (-> obj region-enter-count) (+ regions-entered 1)) + (set! (-> this region-enter-prim-list regions-entered) region-sphere) + (set! (-> this region-enter-count) (+ regions-entered 1)) ) 0 (none) @@ -185,23 +185,23 @@ otherwise, add the [[drawable-region-sphere]] to `region-enter-prim-list` and in ;; definition for method 10 of type region-prim-area ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 10 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-exited-region! region-prim-area ((obj region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-exited-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-exit-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and increment `region-exit-count` @param region-sphere Defines the region in question @returns nothing" - (let ((regions-exited (-> obj region-exit-count))) + (let ((regions-exited (-> this region-exit-count))) (let ((region (-> arg0 region))) (countdown (idx regions-exited) - (if (= (-> obj region-exit-list idx) region) + (if (= (-> this region-exit-list idx) region) (return #f) ) ) - (set! (-> obj region-exit-list regions-exited) region) + (set! (-> this region-exit-list regions-exited) region) ) - (set! (-> obj region-exit-prim-list regions-exited) arg0) - (set! (-> obj region-exit-count) (+ regions-exited 1)) + (set! (-> this region-exit-prim-list regions-exited) arg0) + (set! (-> this region-exit-count) (+ regions-exited 1)) ) 0 (none) @@ -210,23 +210,23 @@ otherwise, add the [[drawable-region-sphere]] to `region-exit-prim-list` and inc ;; definition for method 11 of type region-prim-area ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 11 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-inside-region! region-prim-area ((obj region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-inside-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-inside-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and increment `region-inside-count` @param region-sphere Defines the region in question @returns nothing" - (let ((regions-inside (-> obj region-inside-count))) + (let ((regions-inside (-> this region-inside-count))) (let ((region (-> arg0 region))) (countdown (idx regions-inside) - (if (= (-> obj region-inside-list idx) region) + (if (= (-> this region-inside-list idx) region) (return #f) ) ) - (set! (-> obj region-inside-list regions-inside) region) + (set! (-> this region-inside-list regions-inside) region) ) - (set! (-> obj region-inside-prim-list regions-inside) arg0) - (set! (-> obj region-inside-count) (+ regions-inside 1)) + (set! (-> this region-inside-prim-list regions-inside) arg0) + (set! (-> this region-inside-count) (+ regions-inside 1)) ) 0 (none) @@ -235,23 +235,23 @@ otherwise, add the [[drawable-region-sphere]] to `region-inside-prim-list` and i ;; definition for method 12 of type region-prim-area ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 12 region-prim-area) has a return type of none, but the expression builder found a return statement. -(defmethod track-start-region! region-prim-area ((obj region-prim-area) (arg0 drawable-region-sphere)) +(defmethod track-start-region! region-prim-area ((this region-prim-area) (arg0 drawable-region-sphere)) "Enumerates through the objects `region-start-list`, if we find the provided `region`, do nothing and exit otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and increment `region-start-count` @param region-sphere Defines the region in question @returns nothing" - (let ((regions-started (-> obj region-start-count))) + (let ((regions-started (-> this region-start-count))) (let ((region (-> arg0 region))) (countdown (idx regions-started) - (if (= (-> obj region-start-list idx) region) + (if (= (-> this region-start-list idx) region) (return #f) ) ) - (set! (-> obj region-start-list regions-started) region) + (set! (-> this region-start-list regions-started) region) ) - (set! (-> obj region-start-prim-list regions-started) arg0) - (set! (-> obj region-start-count) (+ regions-started 1)) + (set! (-> this region-start-prim-list regions-started) arg0) + (set! (-> this region-start-count) (+ regions-started 1)) ) 0 (none) @@ -259,24 +259,24 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ;; definition for method 17 of type drawable-region-sphere ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-region drawable-region-sphere ((obj drawable-region-sphere) (arg0 int)) +(defmethod debug-draw-region drawable-region-sphere ((this drawable-region-sphere) (arg0 int)) (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (let ((a2-0 (-> obj bsphere))) - (add-debug-sphere #t (bucket-id debug2) a2-0 (-> obj bsphere w) (new 'static 'rgba :r #xff :a #x80)) + (let ((a2-0 (-> this bsphere))) + (add-debug-sphere #t (bucket-id debug2) a2-0 (-> this bsphere w) (new 'static 'rgba :r #xff :a #x80)) ) 0 (none) ) ;; definition for method 18 of type drawable-region-sphere -(defmethod track-region drawable-region-sphere ((obj drawable-region-sphere) (area region-prim-area)) +(defmethod track-region drawable-region-sphere ((this drawable-region-sphere) (area region-prim-area)) "TODO" - (-> obj region) - (let ((area-of-interest (-> obj bsphere))) + (-> this region) + (let ((area-of-interest (-> this bsphere))) (if (< 0.0 (ray-sphere-intersect (-> area pos) (-> area ray) area-of-interest (-> area-of-interest w))) - (track-entered-region! area obj) + (track-entered-region! area this) ) (if (< 0.0 (ray-sphere-intersect (-> area unknown-vector-uiyb1) @@ -285,47 +285,47 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (-> area-of-interest w) ) ) - (track-exited-region! area obj) + (track-exited-region! area this) ) (if (spheres-overlap? (the-as sphere (-> area pos)) (the-as sphere area-of-interest)) - (track-start-region! area obj) + (track-start-region! area this) ) (when (spheres-overlap? (the-as sphere (-> area unknown-vector-uiyb1)) (the-as sphere area-of-interest)) - (track-inside-region! area obj) + (track-inside-region! area this) #t ) ) ) ;; definition for method 19 of type drawable-region-sphere -(defmethod within-area? drawable-region-sphere ((obj drawable-region-sphere) (area region-prim-area)) +(defmethod within-area? drawable-region-sphere ((this drawable-region-sphere) (area region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" - (spheres-overlap? (the-as sphere (-> area pos)) (the-as sphere (-> obj bsphere))) + (spheres-overlap? (the-as sphere (-> area pos)) (the-as sphere (-> this bsphere))) ) ;; definition for method 17 of type drawable-region-face ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-region drawable-region-face ((obj drawable-region-face) (arg0 int)) +(defmethod debug-draw-region drawable-region-face ((this drawable-region-face) (arg0 int)) (when (zero? arg0) (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) - (t9-0 obj arg0) + (t9-0 this arg0) ) ) - (let ((s5-0 (-> obj bsphere))) + (let ((s5-0 (-> this bsphere))) (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-0 - (-> obj data normal) + (-> this data normal) (meters 2) (new 'static 'rgba :r #xff :g #xff :a #x80) ) - (add-debug-sphere #t (bucket-id debug2) s5-0 (-> obj bsphere w) (new 'static 'rgba :r #xff :a #x30)) + (add-debug-sphere #t (bucket-id debug2) s5-0 (-> this bsphere w) (new 'static 'rgba :r #xff :a #x30)) ) (add-debug-bound (bucket-id debug2) - (-> obj data points) - (the-as int (-> obj data num-points)) + (-> this data points) + (the-as int (-> this data num-points)) (new 'static 'rgba :r #xff :g #xff :a #x80) (new 'static 'rgba :r #xff :a #x80) 0 @@ -335,11 +335,11 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ;; definition for method 18 of type drawable-region-face -(defmethod track-region drawable-region-face ((obj drawable-region-face) (arg0 region-prim-area)) +(defmethod track-region drawable-region-face ((this drawable-region-face) (arg0 region-prim-area)) "TODO" (local-vars (sv-48 vector) (sv-52 vector) (sv-56 object)) - (-> obj region) - (let* ((s4-0 (-> obj data)) + (-> this region) + (let* ((s4-0 (-> this data)) (v1-1 (-> s4-0 normal)) (a0-3 (>= 0.0 (- (vector-dot (-> arg0 pos) v1-1) (-> v1-1 w)))) (s3-0 (>= 0.0 (- (vector-dot (-> arg0 unknown-vector-uiyb1) v1-1) (-> v1-1 w)))) @@ -393,8 +393,8 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) (label cfg-17) (if s3-0 - (track-entered-region! arg0 (the-as drawable-region-sphere obj)) - (track-exited-region! arg0 (the-as drawable-region-sphere obj)) + (track-entered-region! arg0 (the-as drawable-region-sphere this)) + (track-exited-region! arg0 (the-as drawable-region-sphere this)) ) ) (label cfg-20) @@ -404,18 +404,18 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ;; definition for method 17 of type drawable-region-volume ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-region drawable-region-volume ((obj drawable-region-volume) (arg0 int)) +(defmethod debug-draw-region drawable-region-volume ((this drawable-region-volume) (arg0 int)) (let ((t9-0 (method-of-type drawable-region-prim debug-draw-region))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (let* ((s5-0 (-> obj faces length)) + (let* ((s5-0 (-> this faces length)) (s4-0 0) - (a0-3 (-> obj faces data s4-0)) + (a0-3 (-> this faces data s4-0)) ) (while (< s4-0 s5-0) (debug-draw-region a0-3 1) (+! s4-0 1) - (set! a0-3 (-> obj faces data s4-0)) + (set! a0-3 (-> this faces data s4-0)) ) ) 0 @@ -423,33 +423,33 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ;; definition for method 18 of type drawable-region-volume -(defmethod track-region drawable-region-volume ((obj drawable-region-volume) (area region-prim-area)) +(defmethod track-region drawable-region-volume ((this drawable-region-volume) (area region-prim-area)) "TODO" - (if (within-area? obj area) - (track-start-region! area (the-as drawable-region-sphere obj)) + (if (within-area? this area) + (track-start-region! area (the-as drawable-region-sphere this)) ) - (let* ((s4-0 (-> obj faces length)) + (let* ((s4-0 (-> this faces length)) (s3-0 0) - (a0-4 (-> obj faces data s3-0)) + (a0-4 (-> this faces data s3-0)) ) (while (< s3-0 s4-0) (if (not (track-region a0-4 area)) (return #f) ) (+! s3-0 1) - (set! a0-4 (-> obj faces data s3-0)) + (set! a0-4 (-> this faces data s3-0)) ) ) - (track-inside-region! area (the-as drawable-region-sphere obj)) + (track-inside-region! area (the-as drawable-region-sphere this)) #t ) ;; definition for method 19 of type drawable-region-volume -(defmethod within-area? drawable-region-volume ((obj drawable-region-volume) (arg0 region-prim-area)) +(defmethod within-area? drawable-region-volume ((this drawable-region-volume) (arg0 region-prim-area)) "@returns Whether or not the object overlaps with the provided [[region-prim-area]]'s extent" - (let* ((v1-1 (-> obj faces length)) + (let* ((v1-1 (-> this faces length)) (a2-0 0) - (a3-2 (-> obj faces data a2-0)) + (a3-2 (-> this faces data a2-0)) ) (while (< a2-0 v1-1) (let ((a3-4 (-> a3-2 data normal))) @@ -458,25 +458,25 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ) (+! a2-0 1) - (set! a3-2 (-> obj faces data a2-0)) + (set! a3-2 (-> this faces data a2-0)) ) ) #t ) ;; definition for method 17 of type drawable-tree-region-prim -(defmethod drawable-tree-region-prim-method-17 drawable-tree-region-prim ((obj drawable-tree-region-prim) (arg0 vector)) +(defmethod drawable-tree-region-prim-method-17 drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 vector)) (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg0 0.0) - (let* ((s5-0 (-> obj data2 (+ (-> obj length) -1) length)) + (let* ((s5-0 (-> this data2 (+ (-> this length) -1) length)) (s4-0 0) - (a0-8 (the-as object (+ (+ (* s4-0 32) 32) (the-as int (-> obj data2 (+ (-> obj length) -1)))))) + (a0-8 (the-as object (+ (+ (* s4-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1)))))) ) (while (< s4-0 s5-0) (if (within-area? (the-as drawable-region-prim a0-8) (the-as region-prim-area (+ #x70000000 0))) (return #t) ) (+! s4-0 1) - (set! a0-8 (+ (+ (* s4-0 32) 32) (the-as int (-> obj data2 (+ (-> obj length) -1))))) + (set! a0-8 (+ (+ (* s4-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1))))) ) ) #f @@ -485,7 +485,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ;; definition for method 9 of type region ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs symbol. -(defmethod region-method-9 region ((obj region) (arg0 vector)) +(defmethod region-method-9 region ((this region) (arg0 vector)) (local-vars (sv-16 int) (sv-32 int)) (sphere<-vector+r! (the-as sphere (-> (the-as region-prim-area #x70000000) pos)) arg0 0.0) (dotimes (s5-0 (-> *level* length)) @@ -501,7 +501,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in (set! sv-16 0) (set! sv-32 (+ (+ (* sv-16 32) 32) (the-as int (-> s1-0 data2 (+ (-> s1-0 length) -1))))) (while (< sv-16 s0-0) - (if (and (= (-> (the-as drawable-region-prim sv-32) region) obj) + (if (and (= (-> (the-as drawable-region-prim sv-32) region) this) (within-area? (the-as drawable-region-prim sv-32) (the-as region-prim-area (-> (the-as region-prim-area #x70000000) region-prim-list)) @@ -526,11 +526,11 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ;; definition for method 18 of type drawable-tree-region-prim ;; WARN: Return type mismatch int vs none. -(defmethod debug-print drawable-tree-region-prim ((obj drawable-tree-region-prim) (arg0 vector) (arg1 object)) +(defmethod debug-print drawable-tree-region-prim ((this drawable-tree-region-prim) (arg0 vector) (arg1 object)) (sphere<-vector+r! (the-as sphere (+ 1296 #x70000000)) arg0 0.0) - (let* ((s4-0 (-> obj data2 (+ (-> obj length) -1) length)) + (let* ((s4-0 (-> this data2 (+ (-> this length) -1) length)) (s3-0 0) - (s2-0 (the-as object (+ (+ (* s3-0 32) 32) (the-as int (-> obj data2 (+ (-> obj length) -1)))))) + (s2-0 (the-as object (+ (+ (* s3-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1)))))) ) (while (< s3-0 s4-0) (if (within-area? (the-as drawable-region-prim s2-0) (the-as region-prim-area (+ #x70000000 0))) @@ -542,7 +542,7 @@ otherwise, add the [[drawable-region-sphere]] to `region-start-prim-list` and in ) ) (+! s3-0 1) - (set! s2-0 (+ (+ (* s3-0 32) 32) (the-as int (-> obj data2 (+ (-> obj length) -1))))) + (set! s2-0 (+ (+ (* s3-0 32) 32) (the-as int (-> this data2 (+ (-> this length) -1))))) ) ) 0 diff --git a/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc b/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc index c08a38fc19..15be59d777 100644 --- a/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc @@ -14,23 +14,19 @@ ) ;; definition for method 3 of type decomp-work -(defmethod inspect decomp-work ((obj decomp-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect decomp-work ((this decomp-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'decomp-work) - (format #t "~1Tbuffer0[2048] @ #x~X~%" (-> obj buffer0)) - (format #t "~1Tbuffer1[2048] @ #x~X~%" (-> obj buffer1)) - (format #t "~1Tindices[2048] @ #x~X~%" (-> obj indices)) - (format #t "~1Ttemp-indices[2048] @ #x~X~%" (-> obj temp-indices)) + (format #t "[~8x] ~A~%" this 'decomp-work) + (format #t "~1Tbuffer0[2048] @ #x~X~%" (-> this buffer0)) + (format #t "~1Tbuffer1[2048] @ #x~X~%" (-> this buffer1)) + (format #t "~1Tindices[2048] @ #x~X~%" (-> this indices)) + (format #t "~1Ttemp-indices[2048] @ #x~X~%" (-> this temp-indices)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/load/decomp_REF.gc b/test/decompiler/reference/jak2/engine/load/decomp_REF.gc index 7b2144b25f..e1cec1e3fe 100644 --- a/test/decompiler/reference/jak2/engine/load/decomp_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/decomp_REF.gc @@ -49,16 +49,16 @@ ) ;; definition for method 3 of type huf-dictionary-node -(defmethod inspect huf-dictionary-node ((obj huf-dictionary-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect huf-dictionary-node ((this huf-dictionary-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'huf-dictionary-node) - (format #t "~1Tzero: ~D~%" (-> obj zero)) - (format #t "~1Tone: ~D~%" (-> obj one)) + (format #t "[~8x] ~A~%" this 'huf-dictionary-node) + (format #t "~1Tzero: ~D~%" (-> this zero)) + (format #t "~1Tone: ~D~%" (-> this one)) (label cfg-4) - obj + this ) ;; definition for function unpack-comp-huf @@ -259,9 +259,7 @@ ;; definition for method 16 of type level ;; INFO: Used lq/sq -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 138] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 145] -(defmethod update-vis! level ((obj level) (vis-info level-vis-info) (unused uint) (in-bsp-vis-string (pointer uint8))) +(defmethod update-vis! level ((this level) (vis-info level-vis-info) (unused uint) (in-bsp-vis-string (pointer uint8))) (local-vars (t0-3 uint128) (extra-vis-length int) (extra-vis-dest (pointer int8))) (let* ((cam-leaf-idx (-> vis-info from-bsp current-leaf-idx)) (curr-vis-string-offset (-> vis-info current-vis-string)) @@ -276,7 +274,7 @@ (return #f) ) (logclear! (-> vis-info flags) (vis-info-flag loading)) - (let ((vis-buf (the-as (pointer integer) (-> obj vis-buffer)))) + (let ((vis-buf (the-as (pointer integer) (-> this vis-buffer)))) (b! #t cfg-16 :delay (nop!)) (label cfg-6) (return #t) @@ -292,7 +290,7 @@ (set! vis-buf (&+ in-bsp-vis-string desired-vis-string-offset)) (b! #t cfg-16 :delay (nop!)) (label cfg-15) - (format 0 "ERROR: ramdisk vis for level ~A, this is not supported~%" (-> obj name)) + (format 0 "ERROR: ramdisk vis for level ~A, this is not supported~%" (-> this name)) (let ((v0-1 #f)) (b! #t cfg-49 :delay (nop!)) (label cfg-16) @@ -333,7 +331,7 @@ ) (spad-start (&-> (the-as (pointer int8) #x70000000) 0)) (spad-end (the-as (pointer int8) (+ 2048 #x70000000))) - (list-len (-> obj bsp visible-list-length)) + (list-len (-> this bsp visible-list-length)) ) (when (zero? (the-as vis-info-flag lower-flag-bits)) (let ((qwc (/ (+ list-len 15) 16))) @@ -352,9 +350,9 @@ (set! (-> (the-as (pointer int128) (&+ spad-start (* a0-23 16)))) 0) ) ) - (set! extra-vis-length (-> obj bsp extra-vis-list-length)) + (set! extra-vis-length (-> this bsp extra-vis-list-length)) (set! extra-vis-dest (&+ spad-start (- list-len extra-vis-length))) - (let ((extra-vis-in (unpack-vis (-> obj bsp drawable-trees) spad-start (the-as (pointer int8) vis-buf)))) + (let ((extra-vis-in (unpack-vis (-> this bsp drawable-trees) spad-start (the-as (pointer int8) vis-buf)))) (dotimes (extra-vis-idx extra-vis-length) (let ((vis-byte (-> extra-vis-in 0))) (set! extra-vis-in (&-> extra-vis-in 1)) @@ -387,7 +385,7 @@ (shift-arith-right-32 lower-flag-bits lower-flag-bits 3) ) (let ((vis-ptr (the-as (pointer uint8) vis-buf)) - (all-vis-ptr (the-as (pointer uinteger) (-> obj bsp all-visible-list))) + (all-vis-ptr (the-as (pointer uinteger) (-> this bsp all-visible-list))) (vis-error #f) ) (dotimes (s0-1 list-len) @@ -419,7 +417,7 @@ ) (let ((unpacked-vis-ptr vis-buf) (final-vis-ptr (the-as object (-> vis-info vis-bits))) - (all-vis (the-as (pointer uinteger) (-> obj bsp all-visible-list))) + (all-vis (the-as (pointer uinteger) (-> this bsp all-visible-list))) (vis-qwc (/ (+ list-len 15) 16)) ) (dotimes (a3-6 vis-qwc) diff --git a/test/decompiler/reference/jak2/engine/load/file-io_REF.gc b/test/decompiler/reference/jak2/engine/load/file-io_REF.gc index 5dd2084ffa..56aab9c94f 100644 --- a/test/decompiler/reference/jak2/engine/load/file-io_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/file-io_REF.gc @@ -17,18 +17,18 @@ ) ;; definition for method 3 of type file-stream -(defmethod inspect file-stream ((obj file-stream)) - (when (not obj) - (set! obj obj) +(defmethod inspect file-stream ((this file-stream)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: #x~X~%" (-> obj flags)) - (format #t "~1Tmode: ~A~%" (-> obj mode)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tfile: ~D~%" (-> obj file)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: #x~X~%" (-> this flags)) + (format #t "~1Tmode: ~A~%" (-> this mode)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tfile: ~D~%" (-> this file)) (label cfg-4) - obj + this ) ;; definition for method 0 of type file-stream @@ -64,35 +64,35 @@ ) ;; definition for method 3 of type file-info -(defmethod inspect file-info ((obj file-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect file-info ((this file-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tfile-type: ~A~%" (-> obj file-type)) - (format #t "~1Tfile-name: ~A~%" (-> obj file-name)) - (format #t "~1Tmajor-version: ~D~%" (-> obj major-version)) - (format #t "~1Tminor-version: ~D~%" (-> obj minor-version)) - (format #t "~1Tmaya-file-name: ~A~%" (-> obj maya-file-name)) - (format #t "~1Ttool-debug: ~A~%" (-> obj tool-debug)) - (format #t "~1Tmdb-file-name: ~A~%" (-> obj mdb-file-name)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tfile-type: ~A~%" (-> this file-type)) + (format #t "~1Tfile-name: ~A~%" (-> this file-name)) + (format #t "~1Tmajor-version: ~D~%" (-> this major-version)) + (format #t "~1Tminor-version: ~D~%" (-> this minor-version)) + (format #t "~1Tmaya-file-name: ~A~%" (-> this maya-file-name)) + (format #t "~1Ttool-debug: ~A~%" (-> this tool-debug)) + (format #t "~1Tmdb-file-name: ~A~%" (-> this mdb-file-name)) (label cfg-4) - obj + this ) ;; definition for method 2 of type file-info -(defmethod print file-info ((obj file-info)) +(defmethod print file-info ((this file-info)) (format #t "#<~A ~A :version ~D.~D @ #x~X>" - (-> obj type) - (-> obj file-name) - (-> obj major-version) - (-> obj minor-version) - obj + (-> this type) + (-> this file-name) + (-> this major-version) + (-> this minor-version) + this ) - obj + this ) ;; definition for symbol *file-temp-string*, type string @@ -214,7 +214,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc b/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc index 5618871d9c..d1c67193bf 100644 --- a/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/load-dgo_REF.gc @@ -18,21 +18,21 @@ ;; definition for method 3 of type load-dgo-msg ;; INFO: Used lq/sq -(defmethod inspect load-dgo-msg ((obj load-dgo-msg)) - (when (not obj) - (set! obj obj) +(defmethod inspect load-dgo-msg ((this load-dgo-msg)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'load-dgo-msg) - (format #t "~1Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~1Tresult: ~D~%" (-> obj result)) - (format #t "~1Tb1: #x~X~%" (-> obj b1)) - (format #t "~1Tb2: #x~X~%" (-> obj b2)) - (format #t "~1Tbt: #x~X~%" (-> obj bt)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Taddress: ~D~%" (-> obj b1)) + (format #t "[~8x] ~A~%" this 'load-dgo-msg) + (format #t "~1Trsvd: ~D~%" (-> this rsvd)) + (format #t "~1Tresult: ~D~%" (-> this result)) + (format #t "~1Tb1: #x~X~%" (-> this b1)) + (format #t "~1Tb2: #x~X~%" (-> this b2)) + (format #t "~1Tbt: #x~X~%" (-> this bt)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Taddress: ~D~%" (-> this b1)) (label cfg-4) - obj + this ) ;; definition of type load-chunk-msg @@ -51,21 +51,21 @@ ) ;; definition for method 3 of type load-chunk-msg -(defmethod inspect load-chunk-msg ((obj load-chunk-msg)) - (when (not obj) - (set! obj obj) +(defmethod inspect load-chunk-msg ((this load-chunk-msg)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'load-chunk-msg) - (format #t "~1Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~1Tresult: ~D~%" (-> obj result)) - (format #t "~1Taddress: ~D~%" (-> obj address)) - (format #t "~1Tsection: ~D~%" (-> obj section)) - (format #t "~1Tmaxlen: ~D~%" (-> obj maxlen)) - (format #t "~1Tdummy[4] @ #x~X~%" (-> obj dummy)) - (format #t "~1Tbasename: #~%" (-> obj basename)) + (format #t "[~8x] ~A~%" this 'load-chunk-msg) + (format #t "~1Trsvd: ~D~%" (-> this rsvd)) + (format #t "~1Tresult: ~D~%" (-> this result)) + (format #t "~1Taddress: ~D~%" (-> this address)) + (format #t "~1Tsection: ~D~%" (-> this section)) + (format #t "~1Tmaxlen: ~D~%" (-> this maxlen)) + (format #t "~1Tdummy[4] @ #x~X~%" (-> this dummy)) + (format #t "~1Tbasename: #~%" (-> this basename)) (label cfg-4) - obj + this ) ;; definition of type play-chunk-msg @@ -84,21 +84,21 @@ ) ;; definition for method 3 of type play-chunk-msg -(defmethod inspect play-chunk-msg ((obj play-chunk-msg)) - (when (not obj) - (set! obj obj) +(defmethod inspect play-chunk-msg ((this play-chunk-msg)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'play-chunk-msg) - (format #t "~1Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~1Tresult: ~D~%" (-> obj result)) - (format #t "~1Taddress: ~D~%" (-> obj address)) - (format #t "~1Tsection: ~D~%" (-> obj section)) - (format #t "~1Tmaxlen: ~D~%" (-> obj maxlen)) - (format #t "~1Tid[4] @ #x~X~%" (-> obj id)) - (format #t "~1Tbasename[4] @ #x~X~%" (-> obj basename)) + (format #t "[~8x] ~A~%" this 'play-chunk-msg) + (format #t "~1Trsvd: ~D~%" (-> this rsvd)) + (format #t "~1Tresult: ~D~%" (-> this result)) + (format #t "~1Taddress: ~D~%" (-> this address)) + (format #t "~1Tsection: ~D~%" (-> this section)) + (format #t "~1Tmaxlen: ~D~%" (-> this maxlen)) + (format #t "~1Tid[4] @ #x~X~%" (-> this id)) + (format #t "~1Tbasename[4] @ #x~X~%" (-> this basename)) (label cfg-4) - obj + this ) ;; definition of type dgo-header @@ -112,16 +112,16 @@ ) ;; definition for method 3 of type dgo-header -(defmethod inspect dgo-header ((obj dgo-header)) - (when (not obj) - (set! obj obj) +(defmethod inspect dgo-header ((this dgo-header)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dgo-header) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Trootname[60] @ #x~X~%" (-> obj rootname)) + (format #t "[~8x] ~A~%" this 'dgo-header) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Trootname[60] @ #x~X~%" (-> this rootname)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/load/load-state_REF.gc b/test/decompiler/reference/jak2/engine/load/load-state_REF.gc index dfe645a496..401f41f440 100644 --- a/test/decompiler/reference/jak2/engine/load/load-state_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/load-state_REF.gc @@ -2,86 +2,86 @@ (in-package goal) ;; definition for method 2 of type level-buffer-state -(defmethod print level-buffer-state ((obj level-buffer-state)) +(defmethod print level-buffer-state ((this level-buffer-state)) (format #t "#" - (-> obj name) - (-> obj display?) - (-> obj force-vis?) - (-> obj force-inside?) - obj + (-> this name) + (-> this display?) + (-> this force-vis?) + (-> this force-inside?) + this ) - obj + this ) ;; definition for method 9 of type load-state -(defmethod reset! load-state ((obj load-state)) +(defmethod reset! load-state ((this load-state)) (dotimes (v1-0 6) - (set! (-> obj want v1-0 name) #f) - (set! (-> obj want v1-0 display?) #f) - (set! (-> obj want v1-0 force-vis?) #f) - (set! (-> obj want v1-0 force-inside?) #f) + (set! (-> this want v1-0 name) #f) + (set! (-> this want v1-0 display?) #f) + (set! (-> this want v1-0 force-vis?) #f) + (set! (-> this want v1-0 force-inside?) #f) ) (dotimes (v1-3 3) - (set! (-> obj want-sound v1-3) #f) + (set! (-> this want-sound v1-3) #f) ) - (set! (-> obj command-list) '()) + (set! (-> this command-list) '()) (dotimes (v1-7 256) - (set! (-> obj object-name v1-7) #f) - (set! (-> obj object-status v1-7) (the-as basic 0)) + (set! (-> this object-name v1-7) #f) + (set! (-> this object-status v1-7) (the-as basic 0)) ) - obj + this ) ;; definition for method 11 of type load-state -(defmethod want-levels load-state ((obj load-state) (arg0 (pointer symbol))) +(defmethod want-levels load-state ((this load-state) (arg0 (pointer symbol))) (dotimes (v1-0 6) (dotimes (a2-0 6) - (when (= (-> obj want v1-0 name) (-> arg0 a2-0)) + (when (= (-> this want v1-0 name) (-> arg0 a2-0)) (set! (-> arg0 a2-0) #f) (goto cfg-8) ) ) - (set! (-> obj want v1-0 name) #f) + (set! (-> this want v1-0 name) #f) (label cfg-8) ) (dotimes (v1-3 6) (when (-> arg0 v1-3) (dotimes (a2-13 6) - (when (not (-> obj want a2-13 name)) - (set! (-> obj want a2-13 name) (-> arg0 v1-3)) - (set! (-> obj want a2-13 display?) #f) - (set! (-> obj want a2-13 force-vis?) #f) - (set! (-> obj want a2-13 force-inside?) #f) + (when (not (-> this want a2-13 name)) + (set! (-> this want a2-13 name) (-> arg0 v1-3)) + (set! (-> this want a2-13 display?) #f) + (set! (-> this want a2-13 force-vis?) #f) + (set! (-> this want a2-13 force-inside?) #f) (goto cfg-19) ) ) ) (label cfg-19) ) - (add-borrow-levels obj) + (add-borrow-levels this) 0 ) ;; definition for method 12 of type load-state ;; WARN: Return type mismatch int vs none. -(defmethod want-sound-banks load-state ((obj load-state) (arg0 (pointer symbol))) +(defmethod want-sound-banks load-state ((this load-state) (arg0 (pointer symbol))) (dotimes (v1-0 3) (dotimes (a2-0 3) - (when (= (-> obj want-sound v1-0) (-> arg0 a2-0)) + (when (= (-> this want-sound v1-0) (-> arg0 a2-0)) (set! (-> arg0 a2-0) #f) (goto cfg-8) ) ) - (set! (-> obj want-sound v1-0) #f) + (set! (-> this want-sound v1-0) #f) (label cfg-8) ) (dotimes (v1-3 3) (when (-> arg0 v1-3) (dotimes (a2-13 3) - (when (not (-> obj want-sound a2-13)) - (set! (-> obj want-sound a2-13) (-> arg0 v1-3)) + (when (not (-> this want-sound a2-13)) + (set! (-> this want-sound a2-13) (-> arg0 v1-3)) (goto cfg-19) ) ) @@ -93,11 +93,11 @@ ) ;; definition for method 13 of type load-state -(defmethod want-display-level load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-display-level load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 6) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 display?) arg1) - (add-borrow-levels obj) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 display?) arg1) + (add-borrow-levels this) (return 0) ) ) @@ -109,22 +109,22 @@ ;; definition for method 14 of type load-state ;; WARN: Return type mismatch int vs none. -(defmethod want-vis-level load-state ((obj load-state) (arg0 symbol)) +(defmethod want-vis-level load-state ((this load-state) (arg0 symbol)) (let ((v1-0 (lookup-level-info arg0))) (if v1-0 (set! arg0 (-> v1-0 name)) ) ) - (set! (-> obj vis-nick) arg0) + (set! (-> this vis-nick) arg0) 0 (none) ) ;; definition for method 15 of type load-state -(defmethod want-force-vis load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-vis load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 6) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 force-vis?) arg1) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 force-vis?) arg1) (return 0) ) ) @@ -135,10 +135,10 @@ ;; definition for method 16 of type load-state ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 16 load-state) has a return type of none, but the expression builder found a return statement. -(defmethod want-force-inside load-state ((obj load-state) (arg0 symbol) (arg1 symbol)) +(defmethod want-force-inside load-state ((this load-state) (arg0 symbol) (arg1 symbol)) (dotimes (v1-0 6) - (when (= (-> obj want v1-0 name) arg0) - (set! (-> obj want v1-0 force-inside?) arg1) + (when (= (-> this want v1-0 name) arg0) + (set! (-> this want v1-0 force-inside?) arg1) (return 0) ) ) @@ -150,16 +150,16 @@ ;; definition for method 21 of type load-state ;; WARN: Return type mismatch int vs none. ;; ERROR: Failed load: (set! a0-11 (l.wu (+ a0-10 12))) at op 138 -(defmethod add-borrow-levels load-state ((obj load-state)) +(defmethod add-borrow-levels load-state ((this load-state)) (dotimes (s5-0 6) - (let ((a0-1 (-> obj want s5-0 name))) + (let ((a0-1 (-> this want s5-0 name))) (when a0-1 (let ((a0-2 (lookup-level-info a0-1))) (when (= (-> a0-2 memory-mode) (load-buffer-mode borrow)) - (set! (-> obj want s5-0 name) #f) - (set! (-> obj want s5-0 display?) #f) - (set! (-> obj want s5-0 force-vis?) #f) - (set! (-> obj want s5-0 force-inside?) #f) + (set! (-> this want s5-0 name) #f) + (set! (-> this want s5-0 display?) #f) + (set! (-> this want s5-0 force-vis?) #f) + (set! (-> this want s5-0 force-inside?) #f) ) ) ) @@ -168,22 +168,22 @@ (let ((s5-1 (new 'stack 'array symbol 24))) (set! (-> s5-1 length) 0) (dotimes (s4-0 6) - (let ((a0-5 (-> obj want s4-0 name))) + (let ((a0-5 (-> this want s4-0 name))) (when a0-5 (let ((v1-22 (+ (* (-> s5-1 length) 4) (the-as int s5-1)))) (s.w! (+ v1-22 12) a0-5) ) - (let ((v1-25 (-> obj want s4-0 display?)) + (let ((v1-25 (-> this want s4-0 display?)) (a1-4 (+ (* (+ (-> s5-1 length) 1) 4) (the-as int s5-1))) ) (s.w! (+ a1-4 12) v1-25) ) - (let ((v1-28 (-> obj want s4-0 force-vis?)) + (let ((v1-28 (-> this want s4-0 force-vis?)) (a1-8 (+ (* (+ (-> s5-1 length) 2) 4) (the-as int s5-1))) ) (s.w! (+ a1-8 12) v1-28) ) - (let ((v1-31 (-> obj want s4-0 force-inside?)) + (let ((v1-31 (-> this want s4-0 force-inside?)) (a1-12 (+ (* (+ (-> s5-1 length) 3) 4) (the-as int s5-1))) ) (s.w! (+ a1-12 12) v1-31) @@ -197,7 +197,7 @@ ) (s.w! (+ a2-4 12) a1-21) ) - (let ((a1-25 (if (-> obj want s4-0 display?) + (let ((a1-25 (if (-> this want s4-0 display?) (-> v1-34 borrow-display? a0-6) ) ) @@ -221,18 +221,18 @@ (dotimes (v1-39 6) (cond ((< (* v1-39 4) (-> s5-1 length)) - (set! (-> obj want v1-39 name) (the-as symbol (l.wu (+ (* (* v1-39 4) 4) (the-as int s5-1) 12)))) - (set! (-> obj want v1-39 display?) (the-as symbol (l.wu (+ (* (+ (* v1-39 4) 1) 4) (the-as int s5-1) 12)))) - (set! (-> obj want v1-39 force-vis?) (the-as symbol (l.wu (+ (* (+ (* v1-39 4) 2) 4) (the-as int s5-1) 12)))) - (set! (-> obj want v1-39 force-inside?) + (set! (-> this want v1-39 name) (the-as symbol (l.wu (+ (* (* v1-39 4) 4) (the-as int s5-1) 12)))) + (set! (-> this want v1-39 display?) (the-as symbol (l.wu (+ (* (+ (* v1-39 4) 1) 4) (the-as int s5-1) 12)))) + (set! (-> this want v1-39 force-vis?) (the-as symbol (l.wu (+ (* (+ (* v1-39 4) 2) 4) (the-as int s5-1) 12)))) + (set! (-> this want v1-39 force-inside?) (the-as symbol (l.wu (+ (* (+ (* v1-39 4) 3) 4) (the-as int s5-1) 12))) ) ) (else - (set! (-> obj want v1-39 name) #f) - (set! (-> obj want v1-39 display?) #f) - (set! (-> obj want v1-39 force-vis?) #f) - (set! (-> obj want v1-39 force-inside?) #f) + (set! (-> this want v1-39 name) #f) + (set! (-> this want v1-39 display?) #f) + (set! (-> this want v1-39 force-vis?) #f) + (set! (-> this want v1-39 force-inside?) #f) ) ) ) @@ -245,32 +245,32 @@ (define *display-load-commands* #f) ;; definition for method 18 of type load-state -(defmethod backup-load-state-and-set-cmds load-state ((obj load-state) (arg0 pair)) +(defmethod backup-load-state-and-set-cmds load-state ((this load-state) (arg0 pair)) (dotimes (s4-0 256) - (when (-> obj object-name s4-0) - (format 0 "WARNING: load state somehow aquired object command ~A~%" (-> obj object-name s4-0)) - (set! (-> obj object-name s4-0) #f) + (when (-> this object-name s4-0) + (format 0 "WARNING: load state somehow aquired object command ~A~%" (-> this object-name s4-0)) + (set! (-> this object-name s4-0) #f) ) ) - (mem-copy! (&-> *backup-load-state* type) (&-> obj type) 2168) + (mem-copy! (&-> *backup-load-state* type) (&-> this type) 2168) (set! (-> *backup-load-state* command-list) '()) - (set! (-> obj command-list) arg0) + (set! (-> this command-list) arg0) 0 ) ;; definition for method 19 of type load-state -(defmethod restore-load-state-and-cleanup load-state ((obj load-state)) +(defmethod restore-load-state-and-cleanup load-state ((this load-state)) (with-pp - (execute-commands-up-to obj 100000.0) + (execute-commands-up-to this 100000.0) (dotimes (s5-0 256) - (when (-> obj object-name s5-0) - (let ((a0-3 (entity-by-name (-> obj object-name s5-0)))) - (set! (-> a0-3 extra perm status) (the-as entity-perm-status (-> obj object-status s5-0))) + (when (-> this object-name s5-0) + (let ((a0-3 (entity-by-name (-> this object-name s5-0)))) + (set! (-> a0-3 extra perm status) (the-as entity-perm-status (-> this object-status s5-0))) (if (-> a0-3 extra process) (kill! a0-3) ) ) - (set! (-> obj object-name s5-0) #f) + (set! (-> this object-name s5-0) #f) ) ) (let ((s5-1 (new 'stack-no-clear 'inline-array 'level-buffer-state 6))) @@ -280,7 +280,7 @@ (dotimes (s4-1 6) (mem-copy! (the-as pointer (-> s5-1 s4-1)) (the-as pointer (-> *load-state* want s4-1)) 16) ) - (mem-copy! (&-> obj type) (&-> *backup-load-state* type) 2168) + (mem-copy! (&-> this type) (&-> *backup-load-state* type) 2168) (when (!= (-> pp type) scene-player) (dotimes (gp-1 6) (mem-copy! (the-as pointer (-> *load-state* want gp-1)) (the-as pointer (-> s5-1 gp-1)) 16) @@ -293,26 +293,26 @@ ) ;; definition for method 20 of type load-state -(defmethod restore-load-state load-state ((obj load-state)) +(defmethod restore-load-state load-state ((this load-state)) (dotimes (v1-0 256) - (if (-> obj object-name v1-0) - (set! (-> obj object-name v1-0) #f) + (if (-> this object-name v1-0) + (set! (-> this object-name v1-0) #f) ) ) - (mem-copy! (&-> obj type) (&-> *backup-load-state* type) 2168) + (mem-copy! (&-> this type) (&-> *backup-load-state* type) 2168) 0 ) ;; definition for method 17 of type load-state ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 17 load-state) has a return type of none, but the expression builder found a return statement. -(defmethod execute-commands-up-to load-state ((obj load-state) (arg0 float)) +(defmethod execute-commands-up-to load-state ((this load-state) (arg0 float)) (with-pp (let ((s4-0 (new 'stack 'script-context (process->ppointer pp) pp (the-as vector #f)))) - (set! (-> s4-0 load-state) obj) - (while (not (null? (-> obj command-list))) - (let ((f0-0 (command-get-float (car (car (-> obj command-list))) 0.0)) - (s3-0 (cdr (car (-> obj command-list)))) + (set! (-> s4-0 load-state) this) + (while (not (null? (-> this command-list))) + (let ((f0-0 (command-get-float (car (car (-> this command-list))) 0.0)) + (s3-0 (cdr (car (-> this command-list)))) ) (if (< arg0 f0-0) (return #f) @@ -335,7 +335,7 @@ ) ) ) - (set! (-> obj command-list) (cdr (-> obj command-list))) + (set! (-> this command-list) (cdr (-> this command-list))) ) ) 0 diff --git a/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc b/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc index a135cbd80c..46460232c7 100644 --- a/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc @@ -91,34 +91,34 @@ ) ;; definition for method 3 of type external-art-buffer -(defmethod inspect external-art-buffer ((obj external-art-buffer)) - (when (not obj) - (set! obj obj) +(defmethod inspect external-art-buffer ((this external-art-buffer)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tother: ~A~%" (-> obj other)) - (format #t "~1Tstatus: ~A~%" (-> obj status)) - (format #t "~1Tlocked?: ~A~%" (-> obj locked?)) - (format #t "~1Tlogin?: ~A~%" (-> obj login?)) - (format #t "~1Tframe-lock: ~A~%" (-> obj frame-lock)) - (format #t "~1Tinit-heap: ~A~%" (-> obj init-heap)) - (format #t "~1Theap: #~%" (-> obj heap)) - (format #t "~1Tpending-load-file: ~A~%" (-> obj pending-load-file)) - (format #t "~1Tpending-load-file-part: ~D~%" (-> obj pending-load-file-part)) - (format #t "~1Tpending-load-file-owner: ~D~%" (-> obj pending-load-file-owner)) - (format #t "~1Tpending-load-file-priority: ~f~%" (-> obj pending-load-file-priority)) - (format #t "~1Tload-file: ~A~%" (-> obj load-file)) - (format #t "~1Tload-file-part: ~D~%" (-> obj load-file-part)) - (format #t "~1Tload-file-owner: ~D~%" (-> obj load-file-owner)) - (format #t "~1Tload-file-priority: ~f~%" (-> obj load-file-priority)) - (format #t "~1Tbuf: #x~X~%" (-> obj buf)) - (format #t "~1Tlen: ~D~%" (-> obj len)) - (format #t "~1Tart-group: ~A~%" (-> obj art-group)) - (format #t "~1Tart-data: #x~X~%" (-> obj art-group)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tother: ~A~%" (-> this other)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tlocked?: ~A~%" (-> this locked?)) + (format #t "~1Tlogin?: ~A~%" (-> this login?)) + (format #t "~1Tframe-lock: ~A~%" (-> this frame-lock)) + (format #t "~1Tinit-heap: ~A~%" (-> this init-heap)) + (format #t "~1Theap: #~%" (-> this heap)) + (format #t "~1Tpending-load-file: ~A~%" (-> this pending-load-file)) + (format #t "~1Tpending-load-file-part: ~D~%" (-> this pending-load-file-part)) + (format #t "~1Tpending-load-file-owner: ~D~%" (-> this pending-load-file-owner)) + (format #t "~1Tpending-load-file-priority: ~f~%" (-> this pending-load-file-priority)) + (format #t "~1Tload-file: ~A~%" (-> this load-file)) + (format #t "~1Tload-file-part: ~D~%" (-> this load-file-part)) + (format #t "~1Tload-file-owner: ~D~%" (-> this load-file-owner)) + (format #t "~1Tload-file-priority: ~f~%" (-> this load-file-priority)) + (format #t "~1Tbuf: #x~X~%" (-> this buf)) + (format #t "~1Tlen: ~D~%" (-> this len)) + (format #t "~1Tart-group: ~A~%" (-> this art-group)) + (format #t "~1Tart-data: #x~X~%" (-> this art-group)) (label cfg-4) - obj + this ) ;; definition for method 0 of type external-art-buffer @@ -160,21 +160,21 @@ ) ;; definition for method 3 of type spool-anim -(defmethod inspect spool-anim ((obj spool-anim)) - (when (not obj) - (set! obj obj) +(defmethod inspect spool-anim ((this spool-anim)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tanim-name: ~A~%" (-> obj anim-name)) - (format #t "~1Tparts: ~D~%" (-> obj parts)) - (format #t "~1Thint-id: ~D~%" (-> obj parts)) - (format #t "~1Tpriority: ~f~%" (-> obj priority)) - (format #t "~1Towner: ~D~%" (-> obj owner)) - (format #t "~1Tcommand-list: ~A~%" (-> obj command-list)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tanim-name: ~A~%" (-> this anim-name)) + (format #t "~1Tparts: ~D~%" (-> this parts)) + (format #t "~1Thint-id: ~D~%" (-> this parts)) + (format #t "~1Tpriority: ~f~%" (-> this priority)) + (format #t "~1Towner: ~D~%" (-> this owner)) + (format #t "~1Tcommand-list: ~A~%" (-> this command-list)) (label cfg-4) - obj + this ) ;; definition of type external-art-control @@ -206,24 +206,24 @@ ) ;; definition for method 3 of type external-art-control -(defmethod inspect external-art-control ((obj external-art-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect external-art-control ((this external-art-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tbuffer[2] @ #x~X~%" (-> obj buffer)) - (format #t "~1Trec[3] @ #x~X~%" (-> obj rec)) - (format #t "~1Tspool-lock: ~D~%" (-> obj spool-lock)) - (format #t "~1Treserve-buffer: ~A~%" (-> obj reserve-buffer)) - (format #t "~1Treserve-buffer-count: ~D~%" (-> obj reserve-buffer-count)) - (format #t "~1Tdma-reserve-buffer-count: ~D~%" (-> obj dma-reserve-buffer-count)) - (format #t "~1Tactive-stream: ~A~%" (-> obj active-stream)) - (format #t "~1Tqueue-stream: ~A~%" (-> obj queue-stream)) - (format #t "~1Tframe-mask: ~D~%" (-> obj frame-mask)) - (format #t "~1Tdma-reserve-heap: #~%" (-> obj dma-reserve-heap)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tbuffer[2] @ #x~X~%" (-> this buffer)) + (format #t "~1Trec[3] @ #x~X~%" (-> this rec)) + (format #t "~1Tspool-lock: ~D~%" (-> this spool-lock)) + (format #t "~1Treserve-buffer: ~A~%" (-> this reserve-buffer)) + (format #t "~1Treserve-buffer-count: ~D~%" (-> this reserve-buffer-count)) + (format #t "~1Tdma-reserve-buffer-count: ~D~%" (-> this dma-reserve-buffer-count)) + (format #t "~1Tactive-stream: ~A~%" (-> this active-stream)) + (format #t "~1Tqueue-stream: ~A~%" (-> this queue-stream)) + (format #t "~1Tframe-mask: ~D~%" (-> this frame-mask)) + (format #t "~1Tdma-reserve-heap: #~%" (-> this dma-reserve-heap)) (label cfg-4) - obj + this ) ;; definition for method 0 of type external-art-control @@ -265,20 +265,20 @@ ) ;; definition for method 3 of type subtitle-range -(defmethod inspect subtitle-range ((obj subtitle-range)) - (when (not obj) - (set! obj obj) +(defmethod inspect subtitle-range ((this subtitle-range)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tstart-frame: ~f~%" (-> obj start-frame)) - (format #t "~1Tend-frame: ~f~%" (-> obj end-frame)) - (format #t "~1Tmessage[8] @ #x~X~%" (-> obj message)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tstart-frame: ~f~%" (-> this start-frame)) + (format #t "~1Tend-frame: ~f~%" (-> this end-frame)) + (format #t "~1Tmessage[8] @ #x~X~%" (-> this message)) (dotimes (s5-0 8) - (format #t "~T [~D]~1Tmessage: ~`object`P~%" s5-0 (-> obj message s5-0)) + (format #t "~T [~D]~1Tmessage: ~`object`P~%" s5-0 (-> this message s5-0)) ) (label cfg-7) - obj + this ) ;; definition of type subtitle-image @@ -294,18 +294,18 @@ ) ;; definition for method 3 of type subtitle-image -(defmethod inspect subtitle-image ((obj subtitle-image)) - (when (not obj) - (set! obj obj) +(defmethod inspect subtitle-image ((this subtitle-image)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twidth: ~D~%" (-> obj width)) - (format #t "~1Theight: ~D~%" (-> obj height)) - (format #t "~1Tpalette[16] @ #x~X~%" (-> obj palette)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twidth: ~D~%" (-> this width)) + (format #t "~1Theight: ~D~%" (-> this height)) + (format #t "~1Tpalette[16] @ #x~X~%" (-> this palette)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/load/loader_REF.gc b/test/decompiler/reference/jak2/engine/load/loader_REF.gc index 72b490ae24..d660a54887 100644 --- a/test/decompiler/reference/jak2/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader_REF.gc @@ -2,92 +2,92 @@ (in-package goal) ;; definition for method 8 of type subtitle-range -(defmethod mem-usage subtitle-range ((obj subtitle-range) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage subtitle-range ((this subtitle-range) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 73 (-> arg0 length))) (set! (-> arg0 data 72 name) "subtitle") (+! (-> arg0 data 72 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 72 used) v1-6) (+! (-> arg0 data 72 total) (logand -16 (+ v1-6 15))) ) - obj + this ) ;; definition for method 3 of type load-dir ;; INFO: Used lq/sq -(defmethod inspect load-dir ((obj load-dir)) +(defmethod inspect load-dir ((this load-dir)) (local-vars (sv-16 basic)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlevel: ~A~%" (-> obj lev)) - (format #t "~Tallocated-length: ~D~%" (-> obj string-array allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj string-array length)) - (dotimes (s5-0 (-> obj string-array length)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlevel: ~A~%" (-> this lev)) + (format #t "~Tallocated-length: ~D~%" (-> this string-array allocated-length)) + (format #t "~Tlength: ~D~%" (-> this string-array length)) + (dotimes (s5-0 (-> this string-array length)) (let ((s4-0 format) (s3-0 #t) (s2-0 "~T [~D] ~S ~A (~D bytes)~%") (s1-0 s5-0) - (s0-0 (-> obj string-array s5-0)) + (s0-0 (-> this string-array s5-0)) ) - (set! sv-16 (-> obj data-array s5-0)) - (let ((t1-0 (mem-size (-> obj data-array s5-0) #f 0))) + (set! sv-16 (-> this data-array s5-0)) + (let ((t1-0 (mem-size (-> this data-array s5-0) #f 0))) (s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0) ) ) ) - obj + this ) ;; definition for method 8 of type load-dir ;; WARN: Return type mismatch symbol vs load-dir. -(defmethod mem-usage load-dir ((obj load-dir) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage load-dir ((this load-dir) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") (+! (-> arg0 data 84 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 84 used) v1-6) (+! (-> arg0 data 84 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") (set! (-> arg0 data 84 count) (-> arg0 data 84 count)) - (let ((v1-15 (asize-of (-> obj string-array)))) + (let ((v1-15 (asize-of (-> this string-array)))) (+! (-> arg0 data 84 used) v1-15) (+! (-> arg0 data 84 total) (logand -16 (+ v1-15 15))) ) (set! (-> arg0 length) (max 85 (-> arg0 length))) (set! (-> arg0 data 84 name) "array") (set! (-> arg0 data 84 count) (-> arg0 data 84 count)) - (let ((v1-24 (asize-of (-> obj data-array)))) + (let ((v1-24 (asize-of (-> this data-array)))) (+! (-> arg0 data 84 used) v1-24) (+! (-> arg0 data 84 total) (logand -16 (+ v1-24 15))) ) - (dotimes (s3-0 (-> obj data-array length)) - (mem-usage (-> obj data-array s3-0) arg0 arg1) + (dotimes (s3-0 (-> this data-array length)) + (mem-usage (-> this data-array s3-0) arg0 arg1) ) (the-as load-dir #f) ) ;; definition for method 9 of type load-dir-art-group -(defmethod load-to-heap-by-name load-dir-art-group ((obj load-dir-art-group) (arg0 string) (arg1 symbol) (arg2 kheap) (arg3 int)) - (let ((s5-0 (-> obj string-array))) +(defmethod load-to-heap-by-name load-dir-art-group ((this load-dir-art-group) (arg0 string) (arg1 symbol) (arg2 kheap) (arg3 int)) + (let ((s5-0 (-> this string-array))) (dotimes (s3-0 (-> s5-0 length)) (when (string= arg0 (-> s5-0 s3-0)) (when arg1 (let ((v1-4 (art-group-load-check arg0 arg2 arg3))) (if v1-4 - (set! (-> obj art-group-array s3-0) v1-4) + (set! (-> this art-group-array s3-0) v1-4) ) ) ) - (return (-> obj art-group-array s3-0)) + (return (-> this art-group-array s3-0)) ) ) (let ((v0-2 (art-group-load-check arg0 arg2 arg3))) (when v0-2 (set! (-> s5-0 (-> s5-0 length)) arg0) - (set! (-> obj art-group-array (-> s5-0 length)) v0-2) + (set! (-> this art-group-array (-> s5-0 length)) v0-2) (+! (-> s5-0 length) 1) - (+! (-> obj art-group-array length) 1) + (+! (-> this art-group-array length) 1) ) v0-2 ) @@ -95,20 +95,20 @@ ) ;; definition for method 10 of type load-dir-art-group -(defmethod set-loaded-art load-dir-art-group ((obj load-dir-art-group) (arg0 art-group)) - (let ((s4-0 (-> obj string-array))) +(defmethod set-loaded-art load-dir-art-group ((this load-dir-art-group) (arg0 art-group)) + (let ((s4-0 (-> this string-array))) (dotimes (s3-0 (-> s4-0 length)) (when (string= (-> arg0 name) (-> s4-0 s3-0)) - (set! (-> obj art-group-array s3-0) arg0) - (set! arg0 (-> obj art-group-array s3-0)) + (set! (-> this art-group-array s3-0) arg0) + (set! arg0 (-> this art-group-array s3-0)) (goto cfg-7) ) ) (set! (-> s4-0 (-> s4-0 length)) (-> arg0 name)) - (set! (-> obj art-group-array (-> s4-0 length)) arg0) + (set! (-> this art-group-array (-> s4-0 length)) arg0) (+! (-> s4-0 length) 1) ) - (+! (-> obj art-group-array length) 1) + (+! (-> this art-group-array length) 1) (label cfg-7) arg0 ) @@ -179,17 +179,17 @@ ) ;; definition for method 2 of type external-art-buffer -(defmethod print external-art-buffer ((obj external-art-buffer)) +(defmethod print external-art-buffer ((this external-art-buffer)) (format #t "#<~A ~S ~D ~A @ #x~X>" - (-> obj type) - (-> obj pending-load-file) - (-> obj pending-load-file-part) - (-> obj status) - obj + (-> this type) + (-> this pending-load-file) + (-> this pending-load-file-part) + (-> this status) + this ) - obj + this ) ;; definition for function external-art-buffer-init @@ -204,40 +204,40 @@ ) ;; definition for method 9 of type external-art-buffer -(defmethod set-pending-file external-art-buffer ((obj external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) - (set! (-> obj pending-load-file) arg0) - (set! (-> obj pending-load-file-part) arg1) - (set! (-> obj pending-load-file-owner) arg2) - (set! (-> obj pending-load-file-priority) arg3) +(defmethod set-pending-file external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int) (arg2 handle) (arg3 float)) + (set! (-> this pending-load-file) arg0) + (set! (-> this pending-load-file-part) arg1) + (set! (-> this pending-load-file-owner) arg2) + (set! (-> this pending-load-file-priority) arg3) 0 ) ;; definition for method 15 of type external-art-buffer -(defmethod unlock! external-art-buffer ((obj external-art-buffer)) - (set! (-> obj locked?) #f) +(defmethod unlock! external-art-buffer ((this external-art-buffer)) + (set! (-> this locked?) #f) 0 ) ;; definition for method 11 of type external-art-buffer -(defmethod inactive? external-art-buffer ((obj external-art-buffer)) - (!= (-> obj status) 'active) +(defmethod inactive? external-art-buffer ((this external-art-buffer)) + (!= (-> this status) 'active) ) ;; definition for method 12 of type external-art-buffer -(defmethod file-status external-art-buffer ((obj external-art-buffer) (arg0 string) (arg1 int)) - (when (and (name= (-> obj pending-load-file) arg0) (= (-> obj pending-load-file-part) arg1)) - (if (and (name= (-> obj load-file) arg0) (= (-> obj load-file-part) arg1)) - (-> obj status) +(defmethod file-status external-art-buffer ((this external-art-buffer) (arg0 string) (arg1 int)) + (when (and (name= (-> this pending-load-file) arg0) (= (-> this pending-load-file-part) arg1)) + (if (and (name= (-> this load-file) arg0) (= (-> this load-file-part) arg1)) + (-> this status) 'pending ) ) ) ;; definition for method 13 of type art-group -(defmethod link-art! art-group ((obj art-group)) - (when obj - (countdown (s5-0 (-> obj length)) - (let* ((s3-0 (-> obj data s5-0)) +(defmethod link-art! art-group ((this art-group)) + (when this + (countdown (s5-0 (-> this length)) + (let* ((s3-0 (-> this data s5-0)) (s4-0 (if (type? s3-0 art-joint-anim) (the-as art-joint-anim s3-0) ) @@ -277,20 +277,20 @@ ) ) (if (not s2-0) - (format 0 "ERROR: ~A could not find a master slot to link for ~A.~%" (-> obj name) s4-0) + (format 0 "ERROR: ~A could not find a master slot to link for ~A.~%" (-> this name) s4-0) ) ) ) ) ) - obj + this ) ;; definition for method 14 of type art-group -(defmethod unlink-art! art-group ((obj art-group)) - (when obj - (countdown (s5-0 (-> obj length)) - (let* ((s3-0 (-> obj data s5-0)) +(defmethod unlink-art! art-group ((this art-group)) + (when this + (countdown (s5-0 (-> this length)) + (let* ((s3-0 (-> this data s5-0)) (s4-0 (if (type? s3-0 art-joint-anim) (the-as art-joint-anim s3-0) ) @@ -315,7 +315,7 @@ ) ) (if (not s3-1) - (format 0 "ERROR: ~A could not find a master slot to unlink for ~A.~%" (-> obj name) s4-0) + (format 0 "ERROR: ~A could not find a master slot to unlink for ~A.~%" (-> this name) s4-0) ) ) ) @@ -325,198 +325,200 @@ ) ;; definition for method 13 of type external-art-buffer -(defmethod link-file external-art-buffer ((obj external-art-buffer) (arg0 art-group)) +(defmethod link-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) (when arg0 (link-art! arg0) - (set! (-> obj art-group) arg0) + (set! (-> this art-group) arg0) ) arg0 ) ;; definition for method 14 of type external-art-buffer -(defmethod unlink-file external-art-buffer ((obj external-art-buffer) (arg0 art-group)) +(defmethod unlink-file external-art-buffer ((this external-art-buffer) (arg0 art-group)) (when arg0 (unlink-art! arg0) - (set! (-> obj art-group) #f) + (set! (-> this art-group) #f) ) 0 ) ;; definition for method 10 of type external-art-buffer ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. -(defmethod update external-art-buffer ((obj external-art-buffer)) - (when (or (not (name= (-> obj pending-load-file) (-> obj load-file))) - (!= (-> obj pending-load-file-part) (-> obj load-file-part)) +(defmethod update external-art-buffer ((this external-art-buffer)) + (when (or (not (name= (-> this pending-load-file) (-> this load-file))) + (!= (-> this pending-load-file-part) (-> this load-file-part)) ) - (when (not (handle->process (-> obj pending-load-file-owner))) - (set! (-> obj pending-load-file) #f) - (set! (-> obj pending-load-file-part) -1) - (set! (-> obj pending-load-file-owner) (the-as handle #f)) - (set! (-> obj pending-load-file-priority) 100000000.0) + (when (not (handle->process (-> this pending-load-file-owner))) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) 100000000.0) ) - (when (= (-> obj status) 'initialize) - ((-> obj init-heap) obj) - (set! (-> obj status) 'inactive) + (when (= (-> this status) 'initialize) + ((-> this init-heap) this) + (set! (-> this status) 'inactive) ) (cond - ((-> obj load-file) - (if (= (-> obj status) 'loading) + ((-> this load-file) + (if (= (-> this status) 'loading) (str-load-cancel) ) - (set! (-> obj load-file) #f) - (set! (-> obj load-file-part) -1) - (set! (-> obj load-file-owner) (the-as handle #f)) - (set! (-> obj load-file-priority) 100000000.0) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) 100000000.0) ) (else - (set! (-> obj load-file) (-> obj pending-load-file)) - (set! (-> obj load-file-part) (-> obj pending-load-file-part)) - (set! (-> obj load-file-owner) (-> obj pending-load-file-owner)) - (set! (-> obj load-file-priority) (-> obj pending-load-file-priority)) + (set! (-> this load-file) (-> this pending-load-file)) + (set! (-> this load-file-part) (-> this pending-load-file-part)) + (set! (-> this load-file-owner) (-> this pending-load-file-owner)) + (set! (-> this load-file-priority) (-> this pending-load-file-priority)) ) ) ) (label cfg-18) (cond - ((-> obj load-file) - (case (-> obj status) + ((-> this load-file) + (case (-> this status) (('active 'reserved) ) (('error) - (set! (-> obj status) 'inactive) - (set! (-> obj load-file) #f) - (set! (-> obj load-file-part) -1) - (set! (-> obj load-file-owner) (the-as handle #f)) - (set! (-> obj load-file-priority) 100000000.0) - (set! (-> obj pending-load-file) #f) - (set! (-> obj pending-load-file-part) -1) - (set! (-> obj pending-load-file-owner) (the-as handle #f)) - (set! (-> obj pending-load-file-priority) 100000000.0) - (set! (-> obj art-group) #f) + (set! (-> this status) 'inactive) + (set! (-> this load-file) #f) + (set! (-> this load-file-part) -1) + (set! (-> this load-file-owner) (the-as handle #f)) + (set! (-> this load-file-priority) 100000000.0) + (set! (-> this pending-load-file) #f) + (set! (-> this pending-load-file-part) -1) + (set! (-> this pending-load-file-owner) (the-as handle #f)) + (set! (-> this pending-load-file-priority) 100000000.0) + (set! (-> this art-group) #f) ) (('inactive) - (let ((v1-31 (-> obj heap))) + (let ((v1-31 (-> this heap))) (set! (-> v1-31 current) (-> v1-31 base)) ) (cond - ((string= (-> obj load-file) "reserved") + ((string= (-> this load-file) "reserved") (cond ((-> *art-control* reserve-buffer) - (format 0 "ERROR: trying double reserve ~A when ~A is reserved~%" obj (-> *art-control* reserve-buffer)) + (format 0 "ERROR: trying double reserve ~A when ~A is reserved~%" this (-> *art-control* reserve-buffer)) ) (else - (set! (-> obj status) 'reserved) - (set! (-> *art-control* reserve-buffer) obj) + (set! (-> this status) 'reserved) + (set! (-> *art-control* reserve-buffer) this) ) ) ) - ((and (!= (-> *level* loading-level) (-> *level* default-level)) (< 81920.0 (-> obj load-file-priority))) + ((and (!= (-> *level* loading-level) (-> *level* default-level)) (< 81920.0 (-> this load-file-priority))) ) - ((let ((v1-44 (logand -64 (&+ (-> obj heap current) 63)))) - (str-load (-> obj load-file) (-> obj load-file-part) v1-44 (&- (-> obj heap top) (the-as uint v1-44))) + ((let ((v1-44 (logand -64 (&+ (-> this heap current) 63)))) + (str-load (-> this load-file) (-> this load-file-part) v1-44 (&- (-> this heap top) (the-as uint v1-44))) ) - (set! (-> obj status) 'loading) + (set! (-> this status) 'loading) 0 ) ) ) (('loading) - (case (str-load-status (&-> obj len)) + (case (str-load-status (&-> this len)) (('error) - (set! (-> obj status) 'error) + (set! (-> this status) 'error) ) (('busy) ) (else - (set! (-> obj buf) (logand -64 (&+ (-> obj heap current) 63))) - (set! (-> obj status) 'loaded) + (set! (-> this buf) (logand -64 (&+ (-> this heap current) 63))) + (set! (-> this status) 'loaded) (goto cfg-18) ) ) ) (('loaded) - (let ((a0-34 (-> obj buf))) + (let ((a0-34 (-> this buf))) (cond - ((-> obj login?) - (set! (-> obj art-group) (the-as art-group (link a0-34 (-> obj load-file data) (-> obj len) (-> obj heap) 0))) - (let ((s4-0 (-> obj art-group)) - (s3-0 (-> obj load-file)) + ((-> this login?) + (set! (-> this art-group) + (the-as art-group (link a0-34 (-> this load-file data) (-> this len) (-> this heap) 0)) + ) + (let ((s4-0 (-> this art-group)) + (s3-0 (-> this load-file)) ) (cond ((not s4-0) - (format 0 "ERROR: art-group ~A part ~D is not a valid file.~%" s3-0 (-> obj load-file-part)) - (set! (-> obj status) 'error) + (format 0 "ERROR: art-group ~A part ~D is not a valid file.~%" s3-0 (-> this load-file-part)) + (set! (-> this status) 'error) ) ((not (type? s4-0 art-group)) - (format 0 "ERROR: art-group ~A part ~D is not a art-group.~%" s3-0 (-> obj load-file-part)) - (set! (-> obj status) 'error) + (format 0 "ERROR: art-group ~A part ~D is not a art-group.~%" s3-0 (-> this load-file-part)) + (set! (-> this status) 'error) ) ((not (file-info-correct-version? (-> s4-0 info) (file-kind art-group) 0)) - (set! (-> obj status) 'error) + (set! (-> this status) 'error) ) (else (login s4-0) - (set! (-> obj status) 'locked) + (set! (-> this status) 'locked) ) ) ) ) (else - (set! (-> obj status) 'locked) - (set! (-> obj art-group) (the-as art-group a0-34)) + (set! (-> this status) 'locked) + (set! (-> this art-group) (the-as art-group a0-34)) ) ) ) ) (('locked) - (when (and (not (-> obj locked?)) (handle->process (-> obj load-file-owner))) - (if (-> obj login?) - (link-file obj (-> obj art-group)) + (when (and (not (-> this locked?)) (handle->process (-> this load-file-owner))) + (if (-> this login?) + (link-file this (-> this art-group)) ) - (if (-> obj other) - (set! (-> obj other locked?) #t) + (if (-> this other) + (set! (-> this other locked?) #t) ) - (set! (-> obj status) 'active) + (set! (-> this status) 'active) (goto cfg-18) ) ) ) ) (else - (case (-> obj status) + (case (-> this status) (('initialize) ) (('reserved) (cond - ((= (-> *art-control* reserve-buffer) obj) + ((= (-> *art-control* reserve-buffer) this) (set! (-> *art-control* reserve-buffer) #f) - (set! (-> obj status) 'inactive) + (set! (-> this status) 'inactive) ) (else - (format 0 "ERROR: trying tro free ~A when ~A is reserved~%" obj (-> *art-control* reserve-buffer)) + (format 0 "ERROR: trying tro free ~A when ~A is reserved~%" this (-> *art-control* reserve-buffer)) ) ) ) (('active) - (if (-> obj login?) - (unlink-file obj (-> obj art-group)) + (if (-> this login?) + (unlink-file this (-> this art-group)) ) - (let ((v1-86 (-> obj heap))) + (let ((v1-86 (-> this heap))) (set! (-> v1-86 current) (-> v1-86 base)) ) - (set! (-> obj art-group) #f) - (set! (-> obj status) 'inactive) - (when (and (-> obj other) (-> obj other locked?)) - (unlock! (-> obj other)) - (update (-> obj other)) + (set! (-> this art-group) #f) + (set! (-> this status) 'inactive) + (when (and (-> this other) (-> this other locked?)) + (unlock! (-> this other)) + (update (-> this other)) ) ) (else - (let ((v1-96 (-> obj heap))) + (let ((v1-96 (-> this heap))) (set! (-> v1-96 current) (-> v1-96 base)) ) - (set! (-> obj art-group) #f) - (set! (-> obj status) 'inactive) + (set! (-> this art-group) #f) + (set! (-> this status) 'inactive) ) ) ) @@ -528,9 +530,9 @@ (define *preload-spool-anims* #t) ;; definition for method 12 of type external-art-control -(defmethod file-status external-art-control ((obj external-art-control) (arg0 string) (arg1 int)) +(defmethod file-status external-art-control ((this external-art-control) (arg0 string) (arg1 int)) (dotimes (s3-0 2) - (let ((v1-3 (file-status (-> obj buffer s3-0) arg0 arg1))) + (let ((v1-3 (file-status (-> this buffer s3-0) arg0 arg1))) (if v1-3 (return v1-3) ) @@ -540,31 +542,33 @@ ) ;; definition for method 9 of type external-art-control -(defmethod update external-art-control ((obj external-art-control) (arg0 symbol)) - (if (nonzero? (-> obj reserve-buffer-count)) - (spool-push obj "reserved" 0 *dproc* (if (-> obj reserve-buffer) - -110.0 - -0.5 - ) +(defmethod update external-art-control ((this external-art-control) (arg0 symbol)) + (if (nonzero? (-> this reserve-buffer-count)) + (spool-push this "reserved" 0 *dproc* (if (-> this reserve-buffer) + -110.0 + -0.5 + ) ) ) (dotimes (v1-5 2) - (set! (-> obj buffer v1-5 frame-lock) #f) + (set! (-> this buffer v1-5 frame-lock) #f) ) (dotimes (v1-8 3) - (set! (-> obj rec v1-8 anim-name) #f) + (set! (-> this rec v1-8 anim-name) #f) ) (dotimes (s4-0 2) - (let ((s3-0 (-> obj rec s4-0))) + (let ((s3-0 (-> this rec s4-0))) (when (-> s3-0 name) (dotimes (s2-0 2) - (when (and (file-status (-> obj buffer s2-0) (-> s3-0 name) (-> s3-0 parts)) (not (-> obj buffer s2-0 frame-lock))) - (set! (-> obj buffer s2-0 frame-lock) #t) - (set! (-> s3-0 anim-name) (-> obj buffer s2-0)) - (set! (-> obj buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) - (set! (-> obj buffer s2-0 load-file-owner) (-> s3-0 owner)) - (set! (-> obj buffer s2-0 pending-load-file-priority) (-> s3-0 priority)) - (set! (-> obj buffer s2-0 load-file-priority) (-> s3-0 priority)) + (when (and (file-status (-> this buffer s2-0) (-> s3-0 name) (-> s3-0 parts)) + (not (-> this buffer s2-0 frame-lock)) + ) + (set! (-> this buffer s2-0 frame-lock) #t) + (set! (-> s3-0 anim-name) (-> this buffer s2-0)) + (set! (-> this buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) + (set! (-> this buffer s2-0 load-file-owner) (-> s3-0 owner)) + (set! (-> this buffer s2-0 pending-load-file-priority) (-> s3-0 priority)) + (set! (-> this buffer s2-0 load-file-priority) (-> s3-0 priority)) (goto cfg-24) ) ) @@ -573,16 +577,16 @@ (label cfg-24) ) (dotimes (s4-1 2) - (let ((s3-1 (-> obj rec s4-1))) + (let ((s3-1 (-> this rec s4-1))) (when (and (-> s3-1 name) (not (-> s3-1 anim-name))) (if (and (not *preload-spool-anims*) (>= (-> s3-1 priority) 0.0)) (goto cfg-46) ) (dotimes (s2-1 2) - (when (not (-> obj buffer s2-1 frame-lock)) - (set! (-> obj buffer s2-1 frame-lock) #t) - (set-pending-file (-> obj buffer s2-1) (-> s3-1 name) (-> s3-1 parts) (-> s3-1 owner) (-> s3-1 priority)) - (set! (-> s3-1 anim-name) (-> obj buffer s2-1)) + (when (not (-> this buffer s2-1 frame-lock)) + (set! (-> this buffer s2-1 frame-lock) #t) + (set-pending-file (-> this buffer s2-1) (-> s3-1 name) (-> s3-1 parts) (-> s3-1 owner) (-> s3-1 priority)) + (set! (-> s3-1 anim-name) (-> this buffer s2-1)) (goto cfg-46) ) ) @@ -590,8 +594,8 @@ ) (label cfg-46) ) - (when (not (-> obj reserve-buffer)) - (let ((s4-2 (-> obj rec 0 anim-name))) + (when (not (-> this reserve-buffer)) + (let ((s4-2 (-> this rec 0 anim-name))) (if (and s4-2 (-> (the-as external-art-buffer s4-2) locked?) (not (string= (-> (the-as external-art-buffer s4-2) pending-load-file) "reserved")) @@ -608,13 +612,13 @@ ) ) (dotimes (s4-3 2) - (update (-> obj buffer s4-3)) + (update (-> this buffer s4-3)) ) - (let ((s4-4 (-> obj queue-stream))) + (let ((s4-4 (-> this queue-stream))) (set! (-> s4-4 length) 0) (dotimes (s3-2 3) - (when (-> obj rec s3-2 name) - (mem-copy! (&-> (-> s4-4 (-> s4-4 length)) type) (&-> (-> obj rec s3-2) type) 44) + (when (-> this rec s3-2 name) + (mem-copy! (&-> (-> s4-4 (-> s4-4 length)) type) (&-> (-> this rec s3-2) type) 44) (+! (-> s4-4 length) 1) ) ) @@ -625,10 +629,10 @@ (a0-27 *stdcon*) (a1-8 "rec ~d ~S ~D ~f ~A~%") (a2-5 s5-1) - (a3-3 (-> obj rec s5-1 name)) - (t0-3 (-> obj rec s5-1 parts)) - (t1-0 (-> obj rec s5-1 priority)) - (v1-121 (handle->process (-> obj rec s5-1 owner))) + (a3-3 (-> this rec s5-1 name)) + (t0-3 (-> this rec s5-1 parts)) + (t1-0 (-> this rec s5-1 priority)) + (v1-121 (handle->process (-> this rec s5-1 owner))) ) (t9-8 a0-27 a1-8 a2-5 a3-3 t0-3 t1-0 (if v1-121 (-> v1-121 name) @@ -641,15 +645,15 @@ (a0-28 *stdcon*) (a1-9 "buf ~d ~C ~S ~D ~A ~A~%") (a2-6 s5-2) - (a3-4 (if (-> obj buffer s5-2 locked?) + (a3-4 (if (-> this buffer s5-2 locked?) 108 32 ) ) - (t0-4 (-> obj buffer s5-2 pending-load-file)) - (t1-1 (-> obj buffer s5-2 pending-load-file-part)) - (t2-5 (-> obj buffer s5-2 status)) - (v1-142 (handle->process (-> obj buffer s5-2 pending-load-file-owner))) + (t0-4 (-> this buffer s5-2 pending-load-file)) + (t1-1 (-> this buffer s5-2 pending-load-file-part)) + (t2-5 (-> this buffer s5-2 status)) + (v1-142 (handle->process (-> this buffer s5-2 pending-load-file-owner))) ) (t9-9 a0-28 a1-9 a2-6 a3-4 t0-4 t1-1 t2-5 (if v1-142 (-> v1-142 name) @@ -657,61 +661,61 @@ ) ) ) - (format *stdcon* " a: ~S~%" (-> obj active-stream)) + (format *stdcon* " a: ~S~%" (-> this active-stream)) ) 0 ) ;; definition for method 15 of type external-art-control -(defmethod none-reserved? external-art-control ((obj external-art-control)) - (zero? (-> obj reserve-buffer-count)) +(defmethod none-reserved? external-art-control ((this external-art-control)) + (zero? (-> this reserve-buffer-count)) ) ;; definition for method 13 of type external-art-control -(defmethod reserve-alloc external-art-control ((obj external-art-control)) +(defmethod reserve-alloc external-art-control ((this external-art-control)) (cond - ((or (nonzero? (-> obj dma-reserve-buffer-count)) (= *master-mode* 'progress)) - (set! (-> obj dma-reserve-buffer-count) 1) + ((or (nonzero? (-> this dma-reserve-buffer-count)) (= *master-mode* 'progress)) + (set! (-> this dma-reserve-buffer-count) 1) (when (and (-> *bigmap* drawing-flag) (zero? (-> *blit-displays-work* count-down))) - (let ((v1-8 (-> obj dma-reserve-heap))) + (let ((v1-8 (-> this dma-reserve-heap))) (set! (-> v1-8 base) (logand -64 (&+ (&+ (-> *display* frames 1 global-buf end) -252992) 63))) (set! (-> v1-8 current) (-> v1-8 base)) (set! (-> v1-8 top-base) (&+ (-> v1-8 base) #x3dc00)) (set! (-> v1-8 top) (-> v1-8 top-base)) ) - (set! (-> *display* frames 1 global-buf end) (-> obj dma-reserve-heap base)) - (-> obj dma-reserve-heap) + (set! (-> *display* frames 1 global-buf end) (-> this dma-reserve-heap base)) + (-> this dma-reserve-heap) ) ) (else - (set! (-> obj reserve-buffer-count) 1) - (if (and (-> obj reserve-buffer) (not (check-busy *load-str-rpc*))) - (-> obj reserve-buffer heap) + (set! (-> this reserve-buffer-count) 1) + (if (and (-> this reserve-buffer) (not (check-busy *load-str-rpc*))) + (-> this reserve-buffer heap) ) ) ) ) ;; definition for method 14 of type external-art-control -(defmethod reserve-free external-art-control ((obj external-art-control) (arg0 kheap)) +(defmethod reserve-free external-art-control ((this external-art-control) (arg0 kheap)) (cond - ((nonzero? (-> obj dma-reserve-buffer-count)) - (set! (-> obj dma-reserve-buffer-count) 0) + ((nonzero? (-> this dma-reserve-buffer-count)) + (set! (-> this dma-reserve-buffer-count) 0) (let ((v1-3 (-> *display* frames 1 global-buf))) (set! (-> v1-3 end) (&-> v1-3 data-buffer (-> v1-3 allocated-length))) ) ) - ((and (zero? (-> obj reserve-buffer-count)) (zero? (-> obj dma-reserve-buffer-count))) + ((and (zero? (-> this reserve-buffer-count)) (zero? (-> this dma-reserve-buffer-count))) (format 0 "ERROR: illegal attempt to free a buffer #x~X which had not been reserved (none reserved).~%" arg0) ) - ((not (-> obj reserve-buffer)) - (set! (-> obj reserve-buffer-count) 0) + ((not (-> this reserve-buffer)) + (set! (-> this reserve-buffer-count) 0) 0 ) - ((= (-> obj reserve-buffer heap) arg0) - (set-pending-file (-> obj reserve-buffer) (the-as string #f) -1 (the-as handle #f) 100000000.0) - (update (-> obj reserve-buffer)) - (set! (-> obj reserve-buffer-count) 0) + ((= (-> this reserve-buffer heap) arg0) + (set-pending-file (-> this reserve-buffer) (the-as string #f) -1 (the-as handle #f) 100000000.0) + (update (-> this reserve-buffer)) + (set! (-> this reserve-buffer-count) 0) 0 ) (else @@ -722,71 +726,71 @@ ) ;; definition for method 10 of type external-art-control -(defmethod clear-rec external-art-control ((obj external-art-control)) +(defmethod clear-rec external-art-control ((this external-art-control)) (dotimes (v1-0 3) - (set! (-> obj rec v1-0 type) spool-anim) - (set! (-> obj rec v1-0 name) #f) - (set! (-> obj rec v1-0 priority) 100000000.0) - (set! (-> obj rec v1-0 owner) (the-as handle #f)) + (set! (-> this rec v1-0 type) spool-anim) + (set! (-> this rec v1-0 name) #f) + (set! (-> this rec v1-0 priority) 100000000.0) + (set! (-> this rec v1-0 owner) (the-as handle #f)) ) - (set! (-> obj frame-mask) (the-as uint (-> *setting-control* user-current process-mask))) + (set! (-> this frame-mask) (the-as uint (-> *setting-control* user-current process-mask))) 0 ) ;; definition for method 11 of type external-art-control -(defmethod spool-push external-art-control ((obj external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) +(defmethod spool-push external-art-control ((this external-art-control) (arg0 string) (arg1 int) (arg2 process) (arg3 float)) (when (and (= arg3 -99.0) arg2) (let ((a0-2 (target-pos 0))) (set! arg3 (vector-vector-distance a0-2 (-> (the-as process-drawable arg2) root trans))) ) ) (cond - ((and (= arg1 (-> obj rec 0 parts)) (name= arg0 (-> obj rec 0 name))) - (if (>= arg3 (-> obj rec 0 priority)) + ((and (= arg1 (-> this rec 0 parts)) (name= arg0 (-> this rec 0 name))) + (if (>= arg3 (-> this rec 0 priority)) (return (the-as int #f)) ) - (mem-copy! (&-> (-> obj rec) 0 type) (&-> (-> obj rec 1) type) 44) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec 2) type) 44) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (mem-copy! (&-> (-> this rec) 0 type) (&-> (-> this rec 1) type) 44) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec 2) type) 44) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) - ((and (= arg1 (-> obj rec 1 parts)) (name= arg0 (-> obj rec 1 name))) - (if (>= arg3 (-> obj rec 1 priority)) + ((and (= arg1 (-> this rec 1 parts)) (name= arg0 (-> this rec 1 name))) + (if (>= arg3 (-> this rec 1 priority)) (return (the-as int #f)) ) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec 2) type) 44) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec 2) type) 44) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) - ((and (= arg1 (-> obj rec 2 parts)) (name= arg0 (-> obj rec 2 name))) - (if (>= arg3 (-> obj rec 2 priority)) + ((and (= arg1 (-> this rec 2 parts)) (name= arg0 (-> this rec 2 name))) + (if (>= arg3 (-> this rec 2 priority)) (return (the-as int #f)) ) - (set! (-> obj rec 2 name) #f) - (set! (-> obj rec 2 owner) (the-as handle #f)) + (set! (-> this rec 2 name) #f) + (set! (-> this rec 2 owner) (the-as handle #f)) ) ) (cond - ((< arg3 (-> obj rec 0 priority)) - (mem-copy! (&-> (-> obj rec 2) type) (&-> (-> obj rec 1) type) 44) - (mem-copy! (&-> (-> obj rec 1) type) (&-> (-> obj rec) 0 type) 44) - (set! (-> obj rec 0 name) arg0) - (set! (-> obj rec 0 parts) arg1) - (set! (-> obj rec 0 priority) arg3) - (set! (-> obj rec 0 owner) (process->handle arg2)) + ((< arg3 (-> this rec 0 priority)) + (mem-copy! (&-> (-> this rec 2) type) (&-> (-> this rec 1) type) 44) + (mem-copy! (&-> (-> this rec 1) type) (&-> (-> this rec) 0 type) 44) + (set! (-> this rec 0 name) arg0) + (set! (-> this rec 0 parts) arg1) + (set! (-> this rec 0 priority) arg3) + (set! (-> this rec 0 owner) (process->handle arg2)) ) - ((< arg3 (-> obj rec 1 priority)) - (mem-copy! (&-> (-> obj rec 2) type) (&-> (-> obj rec 1) type) 44) - (set! (-> obj rec 1 name) arg0) - (set! (-> obj rec 1 parts) arg1) - (set! (-> obj rec 1 priority) arg3) - (set! (-> obj rec 1 owner) (process->handle arg2)) + ((< arg3 (-> this rec 1 priority)) + (mem-copy! (&-> (-> this rec 2) type) (&-> (-> this rec 1) type) 44) + (set! (-> this rec 1 name) arg0) + (set! (-> this rec 1 parts) arg1) + (set! (-> this rec 1 priority) arg3) + (set! (-> this rec 1 owner) (process->handle arg2)) ) - ((< arg3 (-> obj rec 2 priority)) - (set! (-> obj rec 2 name) arg0) - (set! (-> obj rec 2 parts) arg1) - (set! (-> obj rec 2 priority) arg3) - (set! (-> obj rec 2 owner) (process->handle arg2)) + ((< arg3 (-> this rec 2 priority)) + (set! (-> this rec 2 name) arg0) + (set! (-> this rec 2 parts) arg1) + (set! (-> this rec 2 priority) arg3) + (set! (-> this rec 2 owner) (process->handle arg2)) ) ) 0 @@ -818,28 +822,28 @@ ) ;; definition for method 3 of type spooler-block -(defmethod inspect spooler-block ((obj spooler-block)) - (when (not obj) - (set! obj obj) +(defmethod inspect spooler-block ((this spooler-block)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tanim: ~A~%" (-> obj anim)) - (format #t "~1Tidle: ~A~%" (-> obj idle)) - (format #t "~1Texit: ~A~%" (-> obj exit)) - (format #t "~1Tbreak-func: ~A~%" (-> obj break-func)) - (format #t "~1Tpart: ~D~%" (-> obj part)) - (format #t "~1Tpart-audio-start: ~f~%" (-> obj part-audio-start)) - (format #t "~1Told-status: ~D~%" (-> obj old-status)) - (format #t "~1Told-pos: ~D~%" (-> obj old-pos)) - (format #t "~1Tgood-time: ~D~%" (-> obj good-time)) - (format #t "~1Told-time: ~D~%" (-> obj old-time)) - (format #t "~1Tgood-count: ~D~%" (-> obj good-count)) - (format #t "~1Tsid: ~D~%" (-> obj sid)) - (format #t "~1Treal-start-time: ~D~%" (-> obj real-start-time)) - (format #t "~1Tpaused?: ~A~%" (-> obj paused?)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tanim: ~A~%" (-> this anim)) + (format #t "~1Tidle: ~A~%" (-> this idle)) + (format #t "~1Texit: ~A~%" (-> this exit)) + (format #t "~1Tbreak-func: ~A~%" (-> this break-func)) + (format #t "~1Tpart: ~D~%" (-> this part)) + (format #t "~1Tpart-audio-start: ~f~%" (-> this part-audio-start)) + (format #t "~1Told-status: ~D~%" (-> this old-status)) + (format #t "~1Told-pos: ~D~%" (-> this old-pos)) + (format #t "~1Tgood-time: ~D~%" (-> this good-time)) + (format #t "~1Told-time: ~D~%" (-> this old-time)) + (format #t "~1Tgood-count: ~D~%" (-> this good-count)) + (format #t "~1Tsid: ~D~%" (-> this sid)) + (format #t "~1Treal-start-time: ~D~%" (-> this real-start-time)) + (format #t "~1Tpaused?: ~A~%" (-> this paused?)) (label cfg-4) - obj + this ) ;; definition for function ja-play-spooled-anim @@ -925,7 +929,7 @@ (set-setting! 'spooling (process->ppointer self) 0.0 0) (set-setting! 'spool-anim (-> gp-0 anim) 0.0 0) (apply-settings *setting-control*) - (set! (-> gp-0 old-time) (current-time)) + (set-time! (-> gp-0 old-time)) (while (< (-> gp-0 part) (-> gp-0 anim parts)) (when (> (-> gp-0 part) 0) (while (let ((v1-99 (file-status *art-control* (-> gp-0 anim name) (-> gp-0 part)))) @@ -1071,13 +1075,13 @@ (f28-0 (+ (-> gp-0 part-audio-start) (/ (the float (+ (-> s5-8 frames num-frames) -1)) f30-0))) ) (set! sv-176 (current-str-pos (-> gp-0 sid))) - (set! (-> gp-0 good-time) (current-time)) + (set-time! (-> gp-0 good-time)) (until (>= (the float v0-59) f28-0) (if (= (-> self skel root-channel 0) (-> self skel channel)) (logior! (-> self skel status) (joint-control-status valid-spooled-frame)) ) (if (or ((-> gp-0 break-func) self) - (and (<= sv-176 0) (>= (- (current-time) (-> gp-0 good-time)) (seconds 4))) + (and (<= sv-176 0) (time-elapsed? (-> gp-0 good-time) (seconds 4))) (and (< 300 (-> gp-0 good-count)) (<= sv-176 0)) ) (goto cfg-130) @@ -1109,14 +1113,14 @@ (cond ((and (< (-> gp-0 old-pos) sv-176) (< -1 sv-176)) (+! (-> gp-0 good-count) (- (current-time) (-> self clock old-frame-counter))) - (set! (-> gp-0 good-time) (current-time)) + (set-time! (-> gp-0 good-time)) ) (else 0 ) ) (set! (-> gp-0 old-pos) sv-176) - (set! (-> gp-0 old-time) (current-time)) + (set-time! (-> gp-0 old-time)) (suspend) (let* ((f26-0 (* (- (the float (current-str-pos (-> gp-0 sid))) (-> gp-0 part-audio-start)) f30-0)) (f0-16 (if (str-id-is-playing? (the-as int (-> gp-0 sid))) @@ -1207,33 +1211,33 @@ ) ;; definition for method 3 of type gui-control -(defmethod inspect gui-control ((obj gui-control)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tengine: ~A~%" (-> obj engine)) - (let ((a2-2 (-> obj engine alive-list next0))) - (-> obj engine) +(defmethod inspect gui-control ((this gui-control)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tengine: ~A~%" (-> this engine)) + (let ((a2-2 (-> this engine alive-list next0))) + (-> this engine) (let ((s5-0 (-> a2-2 next0))) - (while (!= a2-2 (-> obj engine alive-list-end)) + (while (!= a2-2 (-> this engine alive-list-end)) (format #t "~T~T~`gui-connection`P~%" a2-2) (set! a2-2 s5-0) - (-> obj engine) + (-> this engine) (set! s5-0 (-> s5-0 next0)) ) ) ) - obj + this ) ;; definition for method 2 of type gui-connection -(defmethod print gui-connection ((obj gui-connection)) +(defmethod print gui-connection ((this gui-connection)) (let* ((t9-0 format) (a0-1 #t) (a1-0 "# obj name)) - (a3-0 (-> obj anim-part)) - (t0-0 (-> obj id)) - (t1-0 (-> obj priority)) - (v1-0 (-> obj channel)) + (a2-0 (-> this name)) + (a3-0 (-> this anim-part)) + (t0-0 (-> this id)) + (t1-0 (-> this priority)) + (v1-0 (-> this channel)) (t2-1 (cond ((= v1-0 (gui-channel hud-lower-left)) "hud-lower-left" @@ -1375,7 +1379,7 @@ ) ) ) - (v1-1 (-> obj action)) + (v1-1 (-> this action)) ) (t9-0 a0-1 a1-0 a2-0 a3-0 t0-0 t1-0 t2-1 (cond ((= v1-1 (gui-action queue)) @@ -1417,7 +1421,7 @@ (let ((s5-0 format) (s4-0 #t) (s3-0 " ~6S <@ #x~A>") - (v1-3 (get-status *gui-control* (-> obj id))) + (v1-3 (get-status *gui-control* (-> this id))) ) (s5-0 s4-0 @@ -1445,24 +1449,24 @@ "*unknown*" ) ) - obj + this ) ) - obj + this ) ;; definition for method 24 of type gui-control -(defmethod channel-id-set! gui-control ((obj gui-control) (arg0 gui-connection) (arg1 sound-id)) - (set! (-> obj ids (-> arg0 channel)) arg1) +(defmethod channel-id-set! gui-control ((this gui-control) (arg0 gui-connection) (arg1 sound-id)) + (set! (-> this ids (-> arg0 channel)) arg1) 0 ) ;; definition for method 15 of type gui-control -(defmethod lookup-gui-connection gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) - (let ((s1-0 (the-as gui-connection (-> obj engine alive-list next0)))) - (-> obj engine) +(defmethod lookup-gui-connection gui-control ((this gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) + (let ((s1-0 (the-as gui-connection (-> this engine alive-list next0)))) + (-> this engine) (let ((s0-0 (-> s1-0 next0))) - (while (!= s1-0 (-> obj engine alive-list-end)) + (while (!= s1-0 (-> this engine alive-list-end)) (if (and (or (= arg1 (gui-channel none)) (= (-> s1-0 channel) arg1)) (or (not arg0) (= (-> arg0 type) scene-player) (= arg0 (get-process s1-0))) (or (not arg2) (string= arg2 (-> s1-0 name))) @@ -1471,13 +1475,13 @@ (return s1-0) ) (set! s1-0 (the-as gui-connection s0-0)) - (-> obj engine) + (-> this engine) (set! s0-0 (-> s0-0 next0)) ) ) ) (countdown (s1-1 32) - (let ((s0-1 (-> obj connections s1-1))) + (let ((s0-1 (-> this connections s1-1))) (if (and (nonzero? (-> s0-1 id)) (or (= arg1 (gui-channel none)) (= (-> s0-1 channel) arg1)) (and (or (not arg0) (= (-> arg0 type) scene-player) (= arg0 (handle->process (-> s0-1 handle)))) @@ -1494,11 +1498,11 @@ ;; definition for method 14 of type gui-control ;; WARN: Return type mismatch int vs sound-id. -(defmethod lookup-gui-connection-id gui-control ((obj gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) - (let ((s2-0 (the-as gui-connection (-> obj engine alive-list next0)))) - (-> obj engine) +(defmethod lookup-gui-connection-id gui-control ((this gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) + (let ((s2-0 (the-as gui-connection (-> this engine alive-list next0)))) + (-> this engine) (let ((s1-0 (-> s2-0 next0))) - (while (!= s2-0 (-> obj engine alive-list-end)) + (while (!= s2-0 (-> this engine alive-list-end)) (if (and (or (= arg1 (gui-channel none)) (= arg1 (-> s2-0 channel))) (or (= arg2 (gui-action none)) (= arg2 (-> s2-0 action))) (or (not arg0) (string= arg0 (-> s2-0 name))) @@ -1506,13 +1510,13 @@ (return (the-as sound-id (-> s2-0 id))) ) (set! s2-0 (the-as gui-connection s1-0)) - (-> obj engine) + (-> this engine) (set! s1-0 (-> s1-0 next0)) ) ) ) (countdown (s2-1 32) - (let ((s1-1 (-> obj connections s2-1))) + (let ((s1-1 (-> this connections s2-1))) (if (and (nonzero? (-> s1-1 id)) (or (= arg1 (gui-channel none)) (= arg1 (-> s1-1 channel))) (or (= arg2 (gui-action none)) (= arg2 (-> s1-1 action))) @@ -1526,7 +1530,7 @@ ) ;; definition for method 20 of type gui-control -(defmethod set-falloff! gui-control ((obj gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) +(defmethod set-falloff! gui-control ((this gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) (when (nonzero? arg0) (let ((v1-2 (lookup-gui-connection *gui-control* (the-as process #f) (gui-channel none) (the-as string #f) arg0))) (when v1-2 @@ -1554,7 +1558,7 @@ ;; definition for method 18 of type gui-control ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 34. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gui-control-method-18 gui-control ((obj gui-control) (arg0 gui-channel)) +(defmethod gui-control-method-18 gui-control ((this gui-control) (arg0 gui-channel)) (let ((v1-0 arg0)) (the-as symbol @@ -1576,25 +1580,25 @@ ) ;; definition for method 23 of type gui-control -(defmethod handle-command gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) - (let ((s5-0 (-> obj ids arg1))) +(defmethod handle-command gui-control ((this gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) + (let ((s5-0 (-> this ids arg1))) (cond ((nonzero? s5-0) (case arg2 (('wait) - (if (nonzero? (get-status obj s5-0)) + (if (nonzero? (get-status this s5-0)) (return #f) ) ) (('stop 'priority-stop) - (when (nonzero? (-> obj ids arg1)) - (let ((s2-0 (lookup-gui-connection obj (the-as process #f) arg1 (the-as string #f) s5-0))) + (when (nonzero? (-> this ids arg1)) + (let ((s2-0 (lookup-gui-connection this (the-as process #f) arg1 (the-as string #f) s5-0))) (when (and s2-0 (or (= arg2 'priority) (= s2-0 arg3) (and arg3 (< (-> arg3 priority) (-> s2-0 priority))))) - (stop-str obj s2-0) + (stop-str this s2-0) (cond ((= (shr (the-as int arg1) 4) 5) - (set! (-> obj times arg1) - (the-as time-frame (max (-> obj times arg1) (+ (-> *display* base-clock frame-counter) (seconds 0.1)))) + (set! (-> this times arg1) + (the-as time-frame (max (-> this times arg1) (+ (-> *display* base-clock frame-counter) (seconds 0.1)))) ) (set! (-> s2-0 action) (gui-action hidden)) ) @@ -1608,15 +1612,15 @@ ) ) ) - (if (nonzero? (get-status obj s5-0)) + (if (nonzero? (get-status this s5-0)) (return #f) ) ) (('hide) - (let ((v1-34 (lookup-gui-connection obj (the-as process #f) arg1 (the-as string #f) s5-0))) + (let ((v1-34 (lookup-gui-connection this (the-as process #f) arg1 (the-as string #f) s5-0))) (when (and v1-34 (!= (-> v1-34 action) 8)) (set-action! - obj + this (gui-action hide) s5-0 (gui-channel none) @@ -1625,18 +1629,18 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj times arg1) - (the-as time-frame (max (-> obj times arg1) (+ (-> *display* base-clock frame-counter) (seconds 0.1)))) + (set! (-> this times arg1) + (the-as time-frame (max (-> this times arg1) (+ (-> *display* base-clock frame-counter) (seconds 0.1)))) ) ) ) - (if (nonzero? (get-status obj s5-0)) + (if (nonzero? (get-status this s5-0)) (return #f) ) ) ) ) - ((< (-> *display* base-clock frame-counter) (-> obj times arg1)) + ((< (-> *display* base-clock frame-counter) (-> this times arg1)) (if (= arg2 'wait) (return #f) ) @@ -1648,15 +1652,15 @@ ;; definition for method 19 of type gui-control ;; INFO: Used lq/sq -(defmethod handle-command-list gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-connection)) +(defmethod handle-command-list gui-control ((this gui-control) (arg0 gui-channel) (arg1 gui-connection)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int)) (let ((gp-0 #t)) (cond - ((or (not (gui-control-method-18 obj arg0)) (< (-> *display* base-clock frame-counter) (-> obj times arg0))) + ((or (not (gui-control-method-18 this arg0)) (< (-> *display* base-clock frame-counter) (-> this times arg0))) #f ) - ((not (null? (-> obj cmd arg0))) - (let* ((s2-0 (-> obj cmd arg0)) + ((not (null? (-> this cmd arg0))) + (let* ((s2-0 (-> this cmd arg0)) (v1-9 (car s2-0)) ) (while (not (null? s2-0)) @@ -1668,7 +1672,7 @@ (let ((s0-0 80)) (set! sv-16 90) (while (>= (the-as uint sv-16) (the-as uint s0-0)) - (if (not (handle-command obj arg0 (the-as gui-channel s0-0) (the-as symbol s1-0) arg1)) + (if (not (handle-command this arg0 (the-as gui-channel s0-0) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-0 1) @@ -1679,7 +1683,7 @@ (let ((s0-1 66)) (set! sv-32 70) (while (>= (the-as uint sv-32) (the-as uint s0-1)) - (if (not (handle-command obj arg0 (the-as gui-channel s0-1) (the-as symbol s1-0) arg1)) + (if (not (handle-command this arg0 (the-as gui-channel s0-1) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-1 1) @@ -1690,7 +1694,7 @@ (let ((s0-2 18)) (set! sv-48 32) (while (>= (the-as uint sv-48) (the-as uint s0-2)) - (if (not (handle-command obj arg0 (the-as gui-channel s0-2) (the-as symbol s1-0) arg1)) + (if (not (handle-command this arg0 (the-as gui-channel s0-2) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-2 1) @@ -1698,7 +1702,7 @@ ) ) (else - (if (not (handle-command obj arg0 a2-1 (the-as symbol s1-0) arg1)) + (if (not (handle-command this arg0 a2-1 (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) ) @@ -1716,28 +1720,28 @@ ;; definition for method 17 of type gui-control ;; WARN: Return type mismatch int vs gui-status. -(defmethod get-status gui-control ((obj gui-control) (arg0 sound-id)) +(defmethod get-status gui-control ((this gui-control) (arg0 sound-id)) (let ((gp-0 (the-as gui-connection #f))) (if (zero? arg0) (return (gui-status unknown)) ) - (let ((v1-4 (-> obj engine alive-list next0))) - (-> obj engine) + (let ((v1-4 (-> this engine alive-list next0))) + (-> this engine) (let ((a0-3 (-> v1-4 next0))) - (while (!= v1-4 (-> obj engine alive-list-end)) + (while (!= v1-4 (-> this engine alive-list-end)) (when (= arg0 (-> (the-as gui-connection v1-4) id)) (set! gp-0 (the-as gui-connection v1-4)) (goto cfg-15) ) (set! v1-4 a0-3) - (-> obj engine) + (-> this engine) (set! a0-3 (-> a0-3 next0)) ) ) ) #t (countdown (v1-10 32) - (let ((a0-7 (-> obj connections v1-10))) + (let ((a0-7 (-> this connections v1-10))) (when (= arg0 (-> a0-7 id)) (set! gp-0 a0-7) (goto cfg-15) @@ -1750,10 +1754,10 @@ (cond ((= (-> gp-0 channel) (gui-channel movie)) (cond - ((= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) + ((= (-> gp-0 id) (-> this ids (-> gp-0 channel))) 3 ) - ((handle-command-list obj (-> gp-0 channel) gp-0) + ((handle-command-list this (-> gp-0 channel) gp-0) 2 ) (else @@ -1786,7 +1790,7 @@ ((logtest? (-> *sound-iop-info* stream-status s4-0) (stream-status ststatus-nine)) (return (gui-status stop)) ) - ((or (= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) (handle-command-list obj (-> gp-0 channel) gp-0)) + ((or (= (-> gp-0 id) (-> this ids (-> gp-0 channel))) (handle-command-list this (-> gp-0 channel) gp-0)) (return (gui-status ready)) ) (else @@ -1810,13 +1814,13 @@ ) ((= (shr (the-as int (-> gp-0 channel)) 4) 5) (cond - ((= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) + ((= (-> gp-0 id) (-> this ids (-> gp-0 channel))) (if (or (= (-> gp-0 action) (gui-action hide)) (= (-> gp-0 action) (gui-action hidden))) 4 3 ) ) - ((handle-command-list obj (-> gp-0 channel) gp-0) + ((handle-command-list this (-> gp-0 channel) gp-0) 2 ) (else @@ -1828,10 +1832,10 @@ (case (shr (the-as int (-> gp-0 channel)) 4) ((4 5) (cond - ((= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) + ((= (-> gp-0 id) (-> this ids (-> gp-0 channel))) 3 ) - ((handle-command-list obj (-> gp-0 channel) gp-0) + ((handle-command-list this (-> gp-0 channel) gp-0) 2 ) (else @@ -1850,7 +1854,7 @@ ) ;; definition for method 16 of type gui-control -(defmethod set-action! gui-control ((obj gui-control) +(defmethod set-action! gui-control ((this gui-control) (arg0 gui-action) (arg1 sound-id) (arg2 gui-channel) @@ -1864,10 +1868,10 @@ (set! sv-17 arg3) (set! sv-20 arg4) (set! sv-24 arg5) - (let ((s1-0 (the-as gui-connection (-> obj engine alive-list next0)))) - (-> obj engine) + (let ((s1-0 (the-as gui-connection (-> this engine alive-list next0)))) + (-> this engine) (let ((s0-0 (-> s1-0 next0))) - (while (!= s1-0 (-> obj engine alive-list-end)) + (while (!= s1-0 (-> this engine alive-list-end)) (when (and (or (= arg1 1) (= arg1 (-> s1-0 id))) (or (= arg2 (gui-channel none)) (= arg2 (-> s1-0 channel))) (or (= sv-17 (gui-action none)) (= sv-17 (-> s1-0 action))) @@ -1876,21 +1880,21 @@ (or (not arg6) (= arg6 (get-process s1-0))) ) (cond - ((and (= sv-16 (gui-action hide)) (!= (-> obj ids (-> s1-0 channel)) (-> s1-0 id))) + ((and (= sv-16 (gui-action hide)) (!= (-> this ids (-> s1-0 channel)) (-> s1-0 id))) (set! (-> s1-0 action) (gui-action hidden)) ) ((and (= sv-16 (gui-action play)) (= (-> s1-0 action) (gui-action playing))) ) (else (set! (-> s1-0 action) sv-16) - (if (and (= sv-16 'play) (handle-command-list obj (-> s1-0 channel) s1-0)) - (channel-id-set! obj s1-0 (-> s1-0 id)) + (if (and (= sv-16 'play) (handle-command-list this (-> s1-0 channel) s1-0)) + (channel-id-set! this s1-0 (-> s1-0 id)) ) ) ) ) (set! s1-0 (the-as gui-connection s0-0)) - (-> obj engine) + (-> this engine) (set! s0-0 (-> s0-0 next0)) ) ) @@ -1901,7 +1905,7 @@ ;; definition for method 9 of type gui-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs sound-id. -(defmethod add-process gui-control ((obj gui-control) +(defmethod add-process gui-control ((this gui-control) (arg0 process) (arg1 gui-channel) (arg2 gui-action) @@ -1918,10 +1922,10 @@ (sv-80 int) ) (set! sv-32 (the-as gui-connection #f)) - (set! sv-48 (the-as gui-connection (-> obj engine alive-list next0))) - (-> obj engine) + (set! sv-48 (the-as gui-connection (-> this engine alive-list next0))) + (-> this engine) (set! sv-64 (the-as gui-connection (-> sv-48 next0))) - (while (!= sv-48 (-> obj engine alive-list-end)) + (while (!= sv-48 (-> this engine alive-list-end)) (when (and (= arg1 (-> (the-as gui-connection sv-48) channel)) (string= arg3 (-> (the-as gui-connection sv-48) name)) (= (get-process sv-48) arg0) @@ -1930,7 +1934,7 @@ (goto cfg-12) ) (set! sv-48 (the-as gui-connection sv-64)) - (-> obj engine) + (-> this engine) (set! sv-64 (the-as gui-connection (-> sv-64 next0))) ) (label cfg-12) @@ -1939,7 +1943,7 @@ (set! sv-80 32) (while (nonzero? sv-80) (set! sv-80 (+ sv-80 -1)) - (set! sv-20 (-> obj connections sv-80)) + (set! sv-20 (-> this connections sv-80)) (if (and (nonzero? (-> sv-20 id)) (= arg1 (-> sv-20 channel)) (string= arg3 (-> sv-20 name)) @@ -1951,7 +1955,7 @@ (if (zero? sv-16) (set! sv-16 (the-as int (new-sound-id))) ) - (set! sv-32 (the-as gui-connection (add-connection (-> obj engine) arg0 arg4 0 arg3 sv-16))) + (set! sv-32 (the-as gui-connection (add-connection (-> this engine) arg0 arg4 0 arg3 sv-16))) sv-32 ) (the-as sound-id (cond @@ -1975,16 +1979,16 @@ ;; definition for method 10 of type gui-control ;; WARN: Return type mismatch int vs none. -(defmethod remove-process gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel)) - (let ((s3-0 (the-as gui-connection (-> obj engine alive-list next0)))) - (-> obj engine) +(defmethod remove-process gui-control ((this gui-control) (arg0 process) (arg1 gui-channel)) + (let ((s3-0 (the-as gui-connection (-> this engine alive-list next0)))) + (-> this engine) (let ((s2-0 (-> s3-0 next0))) - (while (!= s3-0 (-> obj engine alive-list-end)) + (while (!= s3-0 (-> this engine alive-list-end)) (if (and (= arg1 (-> s3-0 channel)) (= arg0 (get-process s3-0))) (move-to-dead s3-0) ) (set! s3-0 (the-as gui-connection s2-0)) - (-> obj engine) + (-> this engine) (set! s2-0 (-> s2-0 next0)) ) ) @@ -1996,7 +2000,7 @@ ;; definition for method 12 of type gui-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs sound-id. -(defmethod gui-control-method-12 gui-control ((obj gui-control) +(defmethod gui-control-method-12 gui-control ((this gui-control) (arg0 process) (arg1 gui-channel) (arg2 gui-action) @@ -2019,7 +2023,7 @@ (set! sv-32 32) (while (nonzero? sv-32) (set! sv-32 (+ sv-32 -1)) - (set! sv-24 (-> obj connections sv-32)) + (set! sv-24 (-> this connections sv-32)) (when (and (nonzero? (-> sv-24 id)) (= arg1 (-> sv-24 channel)) (let ((v1-14 (handle->process (-> sv-24 handle)))) @@ -2029,7 +2033,7 @@ ) ) (when (< (-> sv-24 priority) arg5) - (set! (-> sv-24 time-stamp) (-> obj update-time)) + (set! (-> sv-24 time-stamp) (-> this update-time)) (return (the-as sound-id (-> sv-24 id))) ) (set! sv-16 sv-24) @@ -2037,7 +2041,7 @@ ) ) (countdown (v1-33 32) - (let ((a0-15 (-> obj connections v1-33))) + (let ((a0-15 (-> this connections v1-33))) (when (or (zero? (-> a0-15 id)) (not (handle->process (-> a0-15 handle)))) (set! sv-16 a0-15) (set! (-> sv-16 param3) 0) @@ -2051,7 +2055,7 @@ (sv-16 (when (zero? (-> (the-as gui-connection sv-16) id)) (when (zero? sv-20) - (let ((v1-46 (lookup-gui-connection obj arg0 arg1 arg3 (new 'static 'sound-id)))) + (let ((v1-46 (lookup-gui-connection this arg0 arg1 arg3 (new 'static 'sound-id)))) (if v1-46 (set! sv-20 (the-as int (-> v1-46 id))) ) @@ -2079,7 +2083,7 @@ ) ) ) - (set! (-> sv-16 time-stamp) (-> obj update-time)) + (set! (-> sv-16 time-stamp) (-> this update-time)) (set! (-> sv-16 handle) (process->handle arg0)) (set! (-> sv-16 priority) arg5) (set! (-> sv-16 channel) arg1) @@ -2097,10 +2101,10 @@ ) ;; definition for method 21 of type gui-control -(defmethod gui-control-method-21 gui-control ((obj gui-control) (arg0 gui-connection) (arg1 vector)) +(defmethod gui-control-method-21 gui-control ((this gui-control) (arg0 gui-connection) (arg1 vector)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) - (let ((s5-0 (-> obj spool-connections))) + (let ((s5-0 (-> this spool-connections))) (case (-> arg0 action) (((gui-action queue) (gui-action play) (gui-action playing) (gui-action fade)) (let ((f30-0 (-> arg0 priority))) @@ -2112,7 +2116,7 @@ ) ) (set! f30-0 (cond - ((= (-> arg0 id) (-> obj ids (-> arg0 channel))) + ((= (-> arg0 id) (-> this ids (-> arg0 channel))) -1.0 ) (v1-10 @@ -2169,23 +2173,23 @@ ) ;; definition for method 11 of type gui-control -(defmethod stop-str gui-control ((obj gui-control) (arg0 gui-connection)) +(defmethod stop-str gui-control ((this gui-control) (arg0 gui-connection)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) - (if (= (get-status obj (-> arg0 id)) (gui-status active)) + (if (= (get-status this (-> arg0 id)) (gui-status active)) (str-play-stop (-> arg0 name) (-> arg0 id)) ) ) ) - (if (= (-> obj ids (-> arg0 channel)) (-> arg0 id)) - (channel-id-set! obj arg0 (new 'static 'sound-id)) + (if (= (-> this ids (-> arg0 channel)) (-> arg0 id)) + (channel-id-set! this arg0 (new 'static 'sound-id)) ) 0 ) ;; definition for method 22 of type gui-control ;; WARN: Return type mismatch int vs none. -(defmethod gui-control-method-22 gui-control ((obj gui-control) (arg0 gui-connection) (arg1 process) (arg2 symbol)) +(defmethod gui-control-method-22 gui-control ((this gui-control) (arg0 gui-connection) (arg1 process) (arg2 symbol)) (local-vars (v1-66 symbol) (v1-143 symbol)) (with-pp (when (and (>= (the-as uint (-> arg0 channel)) (the-as uint 16)) @@ -2195,7 +2199,7 @@ (((gui-action queue)) (spool-push *art-control* (-> arg0 name) (the-as int (-> arg0 anim-part)) arg1 (-> arg0 priority)) (if (and (logtest? (-> arg0 flags) (gui-connection-flags gcf0)) - (= (get-status obj (-> arg0 id)) (gui-status active)) + (= (get-status this (-> arg0 id)) (gui-status active)) ) (set! (-> arg0 action) (gui-action playing)) ) @@ -2204,20 +2208,20 @@ ) (let ((v1-16 (-> arg0 action))) (b! (!= v1-16 (gui-action play)) cfg-39 :delay (empty-form)) - (if (handle-command-list obj (-> arg0 channel) arg0) - (channel-id-set! obj arg0 (-> arg0 id)) + (if (handle-command-list this (-> arg0 channel) arg0) + (channel-id-set! this arg0 (-> arg0 id)) ) (b! - (not (or (not (gui-control-method-18 obj (-> arg0 channel))) (= (get-status obj (-> arg0 id)) (gui-status stop))) + (not (or (not (gui-control-method-18 this (-> arg0 channel))) (= (get-status this (-> arg0 id)) (gui-status stop))) ) cfg-27 :delay (empty-form) ) - (if (= (-> obj ids (-> arg0 channel)) (-> arg0 id)) - (channel-id-set! obj arg0 (new 'static 'sound-id)) + (if (= (-> this ids (-> arg0 channel)) (-> arg0 id)) + (channel-id-set! this arg0 (new 'static 'sound-id)) ) (if (and arg2 (or (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)) - (= (get-status obj (-> arg0 id)) (gui-status stop)) + (= (get-status this (-> arg0 id)) (gui-status stop)) ) ) (move-to-dead arg0) @@ -2225,9 +2229,9 @@ (b! #t cfg-38 :delay (nop!)) (label cfg-27) (let ((v1-40 (-> arg0 id))) - (b! (!= (-> obj ids (-> arg0 channel)) v1-40) cfg-38 :delay (empty-form)) + (b! (!= (-> this ids (-> arg0 channel)) v1-40) cfg-38 :delay (empty-form)) ) - (let ((v1-43 (get-status obj (-> arg0 id)))) + (let ((v1-43 (get-status this (-> arg0 id)))) (b! (!= v1-43 (gui-status ready)) cfg-36 :delay (empty-form)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) @@ -2246,16 +2250,16 @@ (label cfg-39) (b! (not (or (= v1-16 (gui-action playing)) (= v1-16 (gui-action fade)))) cfg-117 :delay (empty-form)) (b! - (not (and (= (get-status obj (-> arg0 id)) (gui-status active)) - (gui-control-method-18 obj (-> arg0 channel)) + (not (and (= (get-status this (-> arg0 id)) (gui-status active)) + (gui-control-method-18 this (-> arg0 channel)) (or (= (-> arg0 action) (gui-action playing)) (< (-> arg0 fade) (the-as uint 30))) ) ) cfg-106 :delay (nop!) ) - (channel-id-set! obj arg0 (-> arg0 id)) - (set! (-> obj times 0) 0) + (channel-id-set! this arg0 (-> arg0 id)) + (set! (-> this times 0) 0) (let ((v1-64 (shr (the-as int (-> arg0 channel)) 4))) (set! v1-66 (and (or (= v1-64 1) (= v1-64 2)) @@ -2342,15 +2346,15 @@ ) (else (label cfg-106) - (when (= (-> obj ids (-> arg0 channel)) (-> arg0 id)) - (channel-id-set! obj arg0 (new 'static 'sound-id)) - (set! (-> obj times (-> arg0 channel)) (+ (-> *display* base-clock frame-counter) (-> arg0 hold-time))) + (when (= (-> this ids (-> arg0 channel)) (-> arg0 id)) + (channel-id-set! this arg0 (new 'static 'sound-id)) + (set! (-> this times (-> arg0 channel)) (+ (-> *display* base-clock frame-counter) (-> arg0 hold-time))) ) (b! (not arg2) cfg-113 :likely-delay (set! v1-143 arg2)) (let ((a0-75 (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)))) (b! a0-75 cfg-113 :likely-delay (set! v1-143 a0-75)) ) - (set! v1-143 (= (get-status obj (-> arg0 id)) (gui-status stop))) + (set! v1-143 (= (get-status this (-> arg0 id)) (gui-status stop))) (label cfg-113) (if v1-143 (move-to-dead arg0) @@ -2361,7 +2365,7 @@ (b! #t cfg-139 :delay (nop!)) (label cfg-117) (b! (!= v1-16 (gui-action stop)) cfg-121 :delay (empty-form)) - (stop-str obj arg0) + (stop-str this arg0) (if arg2 (move-to-dead arg0) ) @@ -2369,8 +2373,8 @@ (label cfg-121) (cond ((= v1-16 (gui-action abort)) - (if (= (-> obj ids (-> arg0 channel)) (-> arg0 id)) - (channel-id-set! obj arg0 (new 'static 'sound-id)) + (if (= (-> this ids (-> arg0 channel)) (-> arg0 id)) + (channel-id-set! this arg0 (new 'static 'sound-id)) ) (if arg2 (move-to-dead arg0) @@ -2381,16 +2385,16 @@ ((= v1-16 (gui-action hidden)) (cond ((or (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)) - (= (get-status obj (-> arg0 id)) (gui-status stop)) + (= (get-status this (-> arg0 id)) (gui-status stop)) ) - (stop-str obj arg0) + (stop-str this arg0) (if arg2 (move-to-dead arg0) ) ) (else - (if (= (-> obj ids (-> arg0 channel)) (-> arg0 id)) - (channel-id-set! obj arg0 (new 'static 'sound-id)) + (if (= (-> this ids (-> arg0 channel)) (-> arg0 id)) + (channel-id-set! this arg0 (new 'static 'sound-id)) ) ) ) @@ -2404,8 +2408,8 @@ ) ;; definition for method 13 of type gui-control -(defmethod update gui-control ((obj gui-control) (arg0 symbol)) - (set! (-> obj ids 65) +(defmethod update gui-control ((this gui-control) (arg0 symbol)) + (set! (-> this ids 65) (the-as sound-id (if (and (>= (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) (= (-> *setting-control* user-current bg-a) 0.0) (= (-> *setting-control* user-current bg-a-force) 0.0) @@ -2417,37 +2421,37 @@ ) (let ((s4-0 (target-pos 0))) (dotimes (v1-8 4) - (set! (-> obj spool-connections v1-8 param2) (the-as int #f)) - (set! (-> obj spool-connections v1-8 param3) 0) - (set! (-> obj spool-connections v1-8 priority) 100000000.0) + (set! (-> this spool-connections v1-8 param2) (the-as int #f)) + (set! (-> this spool-connections v1-8 param3) 0) + (set! (-> this spool-connections v1-8 priority) 100000000.0) ) - (let ((s3-0 (the-as gui-connection (-> obj engine alive-list next0)))) - (-> obj engine) + (let ((s3-0 (the-as gui-connection (-> this engine alive-list next0)))) + (-> this engine) (let ((s2-0 (-> s3-0 next0))) - (while (!= s3-0 (-> obj engine alive-list-end)) - (gui-control-method-21 obj s3-0 s4-0) + (while (!= s3-0 (-> this engine alive-list-end)) + (gui-control-method-21 this s3-0 s4-0) (case (-> s3-0 action) (((gui-action playing)) - (channel-id-set! obj s3-0 (-> s3-0 id)) + (channel-id-set! this s3-0 (-> s3-0 id)) ) ) (set! s3-0 (the-as gui-connection s2-0)) - (-> obj engine) + (-> this engine) (set! s2-0 (-> s2-0 next0)) ) ) ) - (let ((s3-1 (-> obj update-time))) + (let ((s3-1 (-> this update-time))) (countdown (s2-1 32) - (let ((s1-0 (-> obj connections s2-1))) + (let ((s1-0 (-> this connections s2-1))) (when (nonzero? (-> s1-0 id)) (cond ((= (-> s1-0 time-stamp) s3-1) - (gui-control-method-21 obj s1-0 s4-0) + (gui-control-method-21 this s1-0 s4-0) ) (else - (if (= (-> obj ids (-> s1-0 channel)) (-> s1-0 id)) - (channel-id-set! obj s1-0 (new 'static 'sound-id)) + (if (= (-> this ids (-> s1-0 channel)) (-> s1-0 id)) + (channel-id-set! this s1-0 (new 'static 'sound-id)) ) (set! (-> s1-0 param3) 0) 0 @@ -2463,37 +2467,37 @@ ) (let ((s2-2 (-> *setting-control* user-current movie-name))) (dotimes (s1-1 4) - (set! (-> s4-1 s1-1) (-> obj spool-connections s1-1 id)) - (when (and (-> obj spool-connections s1-1 name) (case (-> obj spool-connections s1-1 channel) - (((gui-channel art-load) (gui-channel art-load-next)) - #t + (set! (-> s4-1 s1-1) (-> this spool-connections s1-1 id)) + (when (and (-> this spool-connections s1-1 name) (case (-> this spool-connections s1-1 channel) + (((gui-channel art-load) (gui-channel art-load-next)) + #t + ) ) - ) ) (set! s3-2 (logior s3-2 (ash 1 s1-1))) - (if (and s2-2 (string= (-> obj spool-connections s1-1 name) (the-as string s2-2))) + (if (and s2-2 (string= (-> this spool-connections s1-1 name) (the-as string s2-2))) (set! s3-2 (logior s3-2 (ash 1 (+ s1-1 4)))) ) ) ) ) (let* ((t9-6 str-play-queue) - (v1-69 (-> obj spool-connections 0 name)) + (v1-69 (-> this spool-connections 0 name)) (a0-32 (if v1-69 v1-69 ) ) - (v1-70 (-> obj spool-connections 1 name)) + (v1-70 (-> this spool-connections 1 name)) (a1-7 (if v1-70 v1-70 ) ) - (v1-71 (-> obj spool-connections 2 name)) + (v1-71 (-> this spool-connections 2 name)) (a2-4 (if v1-71 v1-71 ) ) - (v1-72 (-> obj spool-connections 3 name)) + (v1-72 (-> this spool-connections 3 name)) ) (t9-6 a0-32 @@ -2507,29 +2511,29 @@ ) ) ) - (-> obj engine) - (let ((a0-33 (the-as connection (-> obj engine alive-list-end prev0)))) - (-> obj engine) + (-> this engine) + (let ((a0-33 (the-as connection (-> this engine alive-list-end prev0)))) + (-> this engine) (let ((s4-2 (-> a0-33 prev0))) - (while (!= a0-33 (-> obj engine alive-list)) - (gui-control-method-22 obj (the-as gui-connection a0-33) (get-process a0-33) #t) + (while (!= a0-33 (-> this engine alive-list)) + (gui-control-method-22 this (the-as gui-connection a0-33) (get-process a0-33) #t) (set! a0-33 (the-as connection s4-2)) - (-> obj engine) + (-> this engine) (set! s4-2 (-> s4-2 prev0)) ) ) ) (countdown (s4-3 32) - (let ((v1-91 (-> obj connections s4-3))) + (let ((v1-91 (-> this connections s4-3))) (if (nonzero? (-> v1-91 id)) - (gui-control-method-22 obj v1-91 (handle->process (-> v1-91 handle)) #f) + (gui-control-method-22 this v1-91 (handle->process (-> v1-91 handle)) #f) ) ) ) (when arg0 (when *display-art-control* (dotimes (s5-1 4) - (let ((a3-4 (-> obj spool-connections s5-1))) + (let ((a3-4 (-> this spool-connections s5-1))) (if (-> a3-4 name) (format *stdcon* "~D: ~`gui-connection`P~%" s5-1 a3-4) ) @@ -2548,20 +2552,20 @@ ) ) (when *display-gui-control* - (-> obj engine) - (let ((a2-12 (-> obj engine alive-list-end prev0))) - (-> obj engine) + (-> this engine) + (let ((a2-12 (-> this engine alive-list-end prev0))) + (-> this engine) (let ((s5-3 (-> a2-12 prev0))) - (while (!= a2-12 (-> obj engine alive-list)) + (while (!= a2-12 (-> this engine alive-list)) (format *stdcon* "c: ~`gui-connection`P~%" a2-12) (set! a2-12 s5-3) - (-> obj engine) + (-> this engine) (set! s5-3 (-> s5-3 prev0)) ) ) ) (countdown (s5-4 32) - (let ((a2-13 (-> obj connections s5-4))) + (let ((a2-13 (-> this connections s5-4))) (if (nonzero? (-> a2-13 id)) (format *stdcon* "l: ~`gui-connection`P~%" a2-13) ) @@ -2569,7 +2573,7 @@ ) ) ) - (set! (-> obj update-time) (-> *display* base-clock frame-counter)) + (set! (-> this update-time) (-> *display* base-clock frame-counter)) 0 ) diff --git a/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc b/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc index 981fd6cfd1..4dbecd8d79 100644 --- a/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/ramdisk_REF.gc @@ -15,18 +15,18 @@ ;; definition for method 3 of type ramdisk-rpc-fill ;; INFO: Used lq/sq -(defmethod inspect ramdisk-rpc-fill ((obj ramdisk-rpc-fill)) - (when (not obj) - (set! obj obj) +(defmethod inspect ramdisk-rpc-fill ((this ramdisk-rpc-fill)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ramdisk-rpc-fill) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tee-id: ~D~%" (-> obj ee-id)) - (format #t "~1Trsvd2[2] @ #x~X~%" (-> obj rsvd2)) - (format #t "~1Tfilename: ~D~%" (-> obj filename)) + (format #t "[~8x] ~A~%" this 'ramdisk-rpc-fill) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tee-id: ~D~%" (-> this ee-id)) + (format #t "~1Trsvd2[2] @ #x~X~%" (-> this rsvd2)) + (format #t "~1Tfilename: ~D~%" (-> this filename)) (label cfg-4) - obj + this ) ;; definition of type ramdisk-rpc-load @@ -42,18 +42,18 @@ ) ;; definition for method 3 of type ramdisk-rpc-load -(defmethod inspect ramdisk-rpc-load ((obj ramdisk-rpc-load)) - (when (not obj) - (set! obj obj) +(defmethod inspect ramdisk-rpc-load ((this ramdisk-rpc-load)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ramdisk-rpc-load) - (format #t "~1Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~1Tee-id: ~D~%" (-> obj ee-id)) - (format #t "~1Toffset: ~D~%" (-> obj offset)) - (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "[~8x] ~A~%" this 'ramdisk-rpc-load) + (format #t "~1Trsvd: ~D~%" (-> this rsvd)) + (format #t "~1Tee-id: ~D~%" (-> this ee-id)) + (format #t "~1Toffset: ~D~%" (-> this offset)) + (format #t "~1Tlength: ~D~%" (-> this length)) (label cfg-4) - obj + this ) ;; definition of type ramdisk-rpc-load-to-ee @@ -71,19 +71,19 @@ ;; definition for method 3 of type ramdisk-rpc-load-to-ee ;; INFO: Used lq/sq -(defmethod inspect ramdisk-rpc-load-to-ee ((obj ramdisk-rpc-load-to-ee)) - (when (not obj) - (set! obj obj) +(defmethod inspect ramdisk-rpc-load-to-ee ((this ramdisk-rpc-load-to-ee)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ramdisk-rpc-load-to-ee) - (format #t "~1Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~1Taddr: ~D~%" (-> obj addr)) - (format #t "~1Toffset: ~D~%" (-> obj offset)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tfilename: ~D~%" (-> obj filename)) + (format #t "[~8x] ~A~%" this 'ramdisk-rpc-load-to-ee) + (format #t "~1Trsvd: ~D~%" (-> this rsvd)) + (format #t "~1Taddr: ~D~%" (-> this addr)) + (format #t "~1Toffset: ~D~%" (-> this offset)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tfilename: ~D~%" (-> this filename)) (label cfg-4) - obj + this ) ;; definition for symbol *ramdisk-rpc*, type rpc-buffer-pair diff --git a/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc b/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc index 22332204d6..9d2bce2169 100644 --- a/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc @@ -17,20 +17,20 @@ ;; definition for method 3 of type euler-angles ;; INFO: Used lq/sq -(defmethod inspect euler-angles ((obj euler-angles)) - (when (not obj) - (set! obj obj) +(defmethod inspect euler-angles ((this euler-angles)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'euler-angles) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'euler-angles) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/math/math_REF.gc b/test/decompiler/reference/jak2/engine/math/math_REF.gc index 774930df70..dd9cc06b2b 100644 --- a/test/decompiler/reference/jak2/engine/math/math_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/math_REF.gc @@ -586,15 +586,15 @@ ) ;; definition for method 3 of type random-generator -(defmethod inspect random-generator ((obj random-generator)) - (when (not obj) - (set! obj obj) +(defmethod inspect random-generator ((this random-generator)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tseed: ~D~%" (-> obj seed)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tseed: ~D~%" (-> this seed)) (label cfg-4) - obj + this ) ;; definition for symbol *random-generator*, type random-generator diff --git a/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc b/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc index 950eb6e799..418c96ae33 100644 --- a/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc @@ -17,18 +17,19 @@ ) ;; definition for method 3 of type matrix -(defmethod inspect matrix ((obj matrix)) - (when (not obj) - (set! obj obj) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect matrix ((this matrix)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'matrix) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj vector)) - (format #t "~1Tvector[4] @ #x~X~%" (-> obj vector)) - (format #t "~1Tquad[4] @ #x~X~%" (-> obj vector)) - (format #t "~1Ttrans: #~%" (-> obj trans)) + (format #t "[~8x] ~A~%" this 'matrix) + (format #t "~1Tdata[16] @ #x~X~%" (-> this vector)) + (format #t "~1Tvector[4] @ #x~X~%" (-> this vector)) + (format #t "~1Tquad[4] @ #x~X~%" (-> this vector)) + (format #t "~1Ttrans: #~%" (-> this trans)) (label cfg-4) - obj + this ) ;; definition of type matrix3 @@ -43,17 +44,18 @@ ) ;; definition for method 3 of type matrix3 -(defmethod inspect matrix3 ((obj matrix3)) - (when (not obj) - (set! obj obj) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect matrix3 ((this matrix3)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'matrix3) - (format #t "~1Tdata[12] @ #x~X~%" (-> obj vector)) - (format #t "~1Tvector[3] @ #x~X~%" (-> obj vector)) - (format #t "~1Tquad[3] @ #x~X~%" (-> obj vector)) + (format #t "[~8x] ~A~%" this 'matrix3) + (format #t "~1Tdata[12] @ #x~X~%" (-> this vector)) + (format #t "~1Tvector[3] @ #x~X~%" (-> this vector)) + (format #t "~1Tquad[3] @ #x~X~%" (-> this vector)) (label cfg-4) - obj + this ) ;; definition of type matrix4h @@ -68,17 +70,17 @@ ) ;; definition for method 3 of type matrix4h -(defmethod inspect matrix4h ((obj matrix4h)) - (when (not obj) - (set! obj obj) +(defmethod inspect matrix4h ((this matrix4h)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'matrix4h) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) - (format #t "~1Tvector4h[4] @ #x~X~%" (-> obj data)) - (format #t "~1Tlong[4] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'matrix4h) + (format #t "~1Tdata[16] @ #x~X~%" (-> this data)) + (format #t "~1Tvector4h[4] @ #x~X~%" (-> this data)) + (format #t "~1Tlong[4] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for function matrix-copy! diff --git a/test/decompiler/reference/jak2/engine/math/matrix_REF.gc b/test/decompiler/reference/jak2/engine/math/matrix_REF.gc index 7b322cf418..5eed0c57f8 100644 --- a/test/decompiler/reference/jak2/engine/math/matrix_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/matrix_REF.gc @@ -2,43 +2,45 @@ (in-package goal) ;; definition for method 3 of type matrix -(defmethod inspect matrix ((obj matrix)) - (format #t "[~8x] matrix~%" obj) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect matrix ((this matrix)) + (format #t "[~8x] matrix~%" this) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj vector 0 x) - (-> obj vector 0 y) - (-> obj vector 0 z) - (-> obj vector 0 w) + (-> this vector 0 x) + (-> this vector 0 y) + (-> this vector 0 z) + (-> this vector 0 w) ) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj vector 1 x) - (-> obj vector 1 y) - (-> obj vector 1 z) - (-> obj vector 1 w) + (-> this vector 1 x) + (-> this vector 1 y) + (-> this vector 1 z) + (-> this vector 1 w) ) (format #t "~T[~F] [~F] [~F] [~F]~%" - (-> obj vector 2 x) - (-> obj vector 2 y) - (-> obj vector 2 z) - (-> obj vector 2 w) + (-> this vector 2 x) + (-> this vector 2 y) + (-> this vector 2 z) + (-> this vector 2 w) ) - (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) - obj + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) + this ) ;; definition for method 3 of type matrix3 -(defmethod inspect matrix3 ((obj matrix3)) - (format #t "[~8x] matrix3~%" obj) - (format #t "~T[~F] [~F] [~F]~%" (-> obj vector 0 x) (-> obj vector 0 y) (-> obj vector 0 z)) - (format #t "~T[~F] [~F] [~F]~%" (-> obj vector 1 x) (-> obj vector 1 y) (-> obj vector 1 z)) - (format #t "~T[~F] [~F] [~F]~%" (-> obj vector 2 x) (-> obj vector 2 y) (-> obj vector 2 z)) - obj +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect matrix3 ((this matrix3)) + (format #t "[~8x] matrix3~%" this) + (format #t "~T[~F] [~F] [~F]~%" (-> this vector 0 x) (-> this vector 0 y) (-> this vector 0 z)) + (format #t "~T[~F] [~F] [~F]~%" (-> this vector 1 x) (-> this vector 1 y) (-> this vector 1 z)) + (format #t "~T[~F] [~F] [~F]~%" (-> this vector 2 x) (-> this vector 2 y) (-> this vector 2 z)) + this ) ;; definition for function matrix-identity! diff --git a/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc b/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc index f2dfa0f2dd..4dafd65341 100644 --- a/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc @@ -17,22 +17,23 @@ ) ;; definition for method 3 of type quaternion +;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect quaternion ((obj quaternion)) - (when (not obj) - (set! obj obj) +(defmethod inspect quaternion ((this quaternion)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'quaternion) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tvec: #~%" (&-> obj x)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'quaternion) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tvec: #~%" (&-> this x)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition for symbol *unity-quaternion*, type quaternion diff --git a/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc index 65660c225c..a517ee5034 100644 --- a/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc @@ -2,16 +2,18 @@ (in-package goal) ;; definition for method 3 of type quaternion -(defmethod inspect quaternion ((obj quaternion)) - (format #t "[~8x] quaternion~%" obj) - (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj x) (-> obj y) (-> obj z) (-> obj w)) - (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> obj x) (-> obj x)) (* (-> obj y) (-> obj y)) (* (-> obj z) (-> obj z))))))) - (format #t "~Taxis: ~F ~F ~F" (* f0-5 (-> obj x)) (* f0-5 (-> obj y)) (* f0-5 (-> obj z))) +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect quaternion ((this quaternion)) + (format #t "[~8x] quaternion~%" this) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) + (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> this x) (-> this x)) (* (-> this y) (-> this y)) (* (-> this z) (-> this z)))))) + ) + (format #t "~Taxis: ~F ~F ~F" (* f0-5 (-> this x)) (* f0-5 (-> this y)) (* f0-5 (-> this z))) ) - (let ((f0-9 (* 2.0 (acos (-> obj w))))) + (let ((f0-9 (* 2.0 (acos (-> this w))))) (format #t "~T~Tangle: (deg ~R)~%" f0-9) ) - obj + this ) ;; definition for function quaternion-axis-angle! diff --git a/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc b/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc index 02d251fc66..c2a83443ab 100644 --- a/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type transform -(defmethod inspect transform ((obj transform)) - (when (not obj) - (set! obj obj) +(defmethod inspect transform ((this transform)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'transform) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Trot: ~`vector`P~%" (-> obj rot)) - (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) + (format #t "[~8x] ~A~%" this 'transform) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Trot: ~`vector`P~%" (-> this rot)) + (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) (label cfg-4) - obj + this ) ;; definition of type trs @@ -41,17 +41,17 @@ ) ;; definition for method 3 of type trs -(defmethod inspect trs ((obj trs)) - (when (not obj) - (set! obj obj) +(defmethod inspect trs ((this trs)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Trot: ~`vector`P~%" (-> obj rot)) - (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Trot: ~`vector`P~%" (-> this rot)) + (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/math/transform_REF.gc b/test/decompiler/reference/jak2/engine/math/transform_REF.gc index 239167cd3b..c8697f6ef1 100644 --- a/test/decompiler/reference/jak2/engine/math/transform_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/transform_REF.gc @@ -2,12 +2,12 @@ (in-package goal) ;; definition for method 2 of type transform -(defmethod print transform ((obj transform)) - (format #t "# obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) - (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> obj rot x) (-> obj rot y) (-> obj rot z) (-> obj rot w)) - (format #t "~T~Tscale:~F ~F ~F ~F>" (-> obj scale x) (-> obj scale y) (-> obj scale z) (-> obj scale w)) - obj +(defmethod print transform ((this transform)) + (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) + (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> this rot x) (-> this rot y) (-> this rot z) (-> this rot w)) + (format #t "~T~Tscale:~F ~F ~F ~F>" (-> this scale x) (-> this scale y) (-> this scale z) (-> this scale w)) + this ) ;; definition for method 0 of type trs diff --git a/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc b/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc index 83c4b8aa99..136eec7bf4 100644 --- a/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc @@ -11,18 +11,18 @@ ) ;; definition for method 3 of type transformq -(defmethod inspect transformq ((obj transformq)) - (when (not obj) - (set! obj obj) +(defmethod inspect transformq ((this transformq)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'transformq) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Trot: ~`vector`P~%" (-> obj quat)) - (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~1Tquat: #~%" (-> obj quat)) + (format #t "[~8x] ~A~%" this 'transformq) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Trot: ~`vector`P~%" (-> this quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~1Tquat: #~%" (-> this quat)) (label cfg-4) - obj + this ) ;; definition of type trsq @@ -35,18 +35,18 @@ ) ;; definition for method 3 of type trsq -(defmethod inspect trsq ((obj trsq)) - (when (not obj) - (set! obj obj) +(defmethod inspect trsq ((this trsq)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Trot: ~`vector`P~%" (-> obj quat)) - (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~1Tquat: #~%" (-> obj quat)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Trot: ~`vector`P~%" (-> this quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~1Tquat: #~%" (-> this quat)) (label cfg-4) - obj + this ) ;; definition of type trsqv @@ -87,36 +87,36 @@ ) ;; definition for method 3 of type trsqv -(defmethod inspect trsqv ((obj trsqv)) - (when (not obj) - (set! obj obj) +(defmethod inspect trsqv ((this trsqv)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Trot: ~`vector`P~%" (-> obj quat)) - (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance)) - (format #t "~1Tnav-radius: (meters ~m)~%" (-> obj nav-radius)) - (format #t "~1Ttransv: ~`vector`P~%" (-> obj transv)) - (format #t "~1Trotv: ~`vector`P~%" (-> obj rotv)) - (format #t "~1Tscalev: ~`vector`P~%" (-> obj scalev)) - (format #t "~1Tdir-targ: #~%" (-> obj dir-targ)) - (format #t "~1Tangle-change-time: ~D~%" (-> obj angle-change-time)) - (format #t "~1Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Trot: ~`vector`P~%" (-> this quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> this scale)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> this pause-adjust-distance)) + (format #t "~1Tnav-radius: (meters ~m)~%" (-> this nav-radius)) + (format #t "~1Ttransv: ~`vector`P~%" (-> this transv)) + (format #t "~1Trotv: ~`vector`P~%" (-> this rotv)) + (format #t "~1Tscalev: ~`vector`P~%" (-> this scalev)) + (format #t "~1Tdir-targ: #~%" (-> this dir-targ)) + (format #t "~1Tangle-change-time: ~D~%" (-> this angle-change-time)) + (format #t "~1Told-y-angle-diff: ~f~%" (-> this old-y-angle-diff)) (label cfg-4) - obj + this ) ;; definition for method 23 of type trsqv -(defmethod global-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) - (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans))) +(defmethod global-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans))) ) ;; definition for method 24 of type trsqv -(defmethod relative-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) - (deg-diff (y-angle obj) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)))) +(defmethod relative-y-angle-to-point trsqv ((this trsqv) (arg0 vector)) + (deg-diff (y-angle this) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)))) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/math/transformq_REF.gc b/test/decompiler/reference/jak2/engine/math/transformq_REF.gc index 20c2380f7f..efed82fb19 100644 --- a/test/decompiler/reference/jak2/engine/math/transformq_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/transformq_REF.gc @@ -2,48 +2,48 @@ (in-package goal) ;; definition for method 2 of type transformq -(defmethod print transformq ((obj transformq)) - (format #t "# obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) - (format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> obj quat x) (-> obj quat y) (-> obj quat z) (-> obj quat w)) - (format #t "~T~Tscale:~F ~F ~F ~F>" (-> obj scale x) (-> obj scale y) (-> obj scale z) (-> obj scale w)) - obj +(defmethod print transformq ((this transformq)) + (format #t "# this trans x) (-> this trans y) (-> this trans z) (-> this trans w)) + (format #t "~T~Tquat: ~F ~F ~F ~F ~%" (-> this quat x) (-> this quat y) (-> this quat z) (-> this quat w)) + (format #t "~T~Tscale:~F ~F ~F ~F>" (-> this scale x) (-> this scale y) (-> this scale z) (-> this scale w)) + this ) ;; definition for method 27 of type trsqv -(defmethod get-quaternion trsqv ((obj trsqv)) - (-> obj quat) +(defmethod get-quaternion trsqv ((this trsqv)) + (-> this quat) ) ;; definition for method 18 of type trsqv -(defmethod set-quaternion! trsqv ((obj trsqv) (arg0 quaternion)) - (quaternion-copy! (get-quaternion obj) arg0) +(defmethod set-quaternion! trsqv ((this trsqv) (arg0 quaternion)) + (quaternion-copy! (get-quaternion this) arg0) ) ;; definition for method 21 of type trsqv -(defmethod rot->dir-targ! trsqv ((obj trsqv)) - (quaternion-copy! (-> obj dir-targ) (get-quaternion obj)) +(defmethod rot->dir-targ! trsqv ((this trsqv)) + (quaternion-copy! (-> this dir-targ) (get-quaternion this)) ) ;; definition for method 22 of type trsqv -(defmethod y-angle trsqv ((obj trsqv)) - (quaternion-y-angle (get-quaternion obj)) +(defmethod y-angle trsqv ((this trsqv)) + (quaternion-y-angle (get-quaternion this)) ) ;; definition for method 9 of type trsqv -(defmethod seek-toward-heading-vec! trsqv ((obj trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) - (let* ((f0-0 (deg-diff (quaternion-y-angle (-> obj quat)) (vector-y-angle arg0))) +(defmethod seek-toward-heading-vec! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) + (let* ((f0-0 (deg-diff (quaternion-y-angle (-> this quat)) (vector-y-angle arg0))) (f1-2 (fmin (* arg1 (seconds-per-frame)) (/ (* 5.0 (fabs f0-0)) (the float arg2)))) (f30-0 (fmax (fmin f0-0 f1-2) (- f1-2))) ) - (let ((f0-2 (-> obj old-y-angle-diff))) + (let ((f0-2 (-> this old-y-angle-diff))) (set! f30-0 (cond ((or (= f0-2 0.0) (and (< 0.0 f30-0) (< 0.0 f0-2)) - (or (and (< f30-0 0.0) (< f0-2 0.0)) (>= (- (current-time) (-> obj angle-change-time)) (seconds 0.2))) + (or (and (< f30-0 0.0) (< f0-2 0.0)) (time-elapsed? (-> this angle-change-time) (seconds 0.2))) ) - (set! (-> obj angle-change-time) (current-time)) + (set-time! (-> this angle-change-time)) f30-0 ) (else @@ -52,16 +52,16 @@ ) ) ) - (set! (-> obj old-y-angle-diff) f30-0) - (let ((a1-2 (get-quaternion obj))) + (set! (-> this old-y-angle-diff) f30-0) + (let ((a1-2 (get-quaternion this))) (quaternion-rotate-y! a1-2 a1-2 f30-0) ) ) ) ;; definition for method 10 of type trsqv -(defmethod set-heading-vec! trsqv ((obj trsqv) (arg0 vector)) - (let ((s3-0 (get-quaternion obj))) +(defmethod set-heading-vec! trsqv ((this trsqv) (arg0 vector)) + (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) @@ -71,55 +71,55 @@ ) ;; definition for method 11 of type trsqv -(defmethod seek-to-point-toward-point! trsqv ((obj trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) - (seek-toward-heading-vec! obj (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) arg1 arg2) +(defmethod seek-to-point-toward-point! trsqv ((this trsqv) (arg0 vector) (arg1 float) (arg2 time-frame)) + (seek-toward-heading-vec! this (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) arg1 arg2) ) ;; definition for method 12 of type trsqv -(defmethod point-toward-point! trsqv ((obj trsqv) (arg0 vector)) - (let ((s3-0 (get-quaternion obj))) +(defmethod point-toward-point! trsqv ((this trsqv) (arg0 vector)) + (let ((s3-0 (get-quaternion this))) (forward-up-nopitch->quaternion s3-0 - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) (vector-y-quaternion! (new 'stack-no-clear 'vector) s3-0) ) ) ) ;; definition for method 13 of type trsqv -(defmethod seek-toward-yaw-angle! trsqv ((obj trsqv) (arg0 float) (arg1 float) (arg2 time-frame)) - (let ((s3-0 (method-of-object obj seek-toward-heading-vec!)) +(defmethod seek-toward-yaw-angle! trsqv ((this trsqv) (arg0 float) (arg1 float) (arg2 time-frame)) + (let ((s3-0 (method-of-object this seek-toward-heading-vec!)) (s2-0 (new 'stack-no-clear 'vector)) ) (set! (-> s2-0 x) (sin arg0)) (set! (-> s2-0 y) 0.0) (set! (-> s2-0 z) (cos arg0)) (set! (-> s2-0 w) 1.0) - (s3-0 obj s2-0 arg1 arg2) + (s3-0 this s2-0 arg1 arg2) ) ) ;; definition for method 14 of type trsqv -(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((obj trsqv) (arg0 float)) - (let ((s5-0 (method-of-object obj set-heading-vec-clear-roll-pitch!)) +(defmethod set-yaw-angle-clear-roll-pitch! trsqv ((this trsqv) (arg0 float)) + (let ((s5-0 (method-of-object this set-heading-vec-clear-roll-pitch!)) (s4-0 (new 'stack-no-clear 'vector)) ) (set! (-> s4-0 x) (sin arg0)) (set! (-> s4-0 y) 0.0) (set! (-> s4-0 z) (cos arg0)) (set! (-> s4-0 w) 1.0) - (s5-0 obj s4-0) + (s5-0 this s4-0) ) ) ;; definition for method 15 of type trsqv -(defmethod set-roll-to-grav! trsqv ((obj trsqv) (arg0 float)) - (set-roll-to-grav-2! obj arg0) +(defmethod set-roll-to-grav! trsqv ((this trsqv) (arg0 float)) + (set-roll-to-grav-2! this arg0) ) ;; definition for method 16 of type trsqv -(defmethod set-roll-to-grav-2! trsqv ((obj trsqv) (arg0 float)) - (let* ((s5-0 (get-quaternion obj)) +(defmethod set-roll-to-grav-2! trsqv ((this trsqv) (arg0 float)) + (let* ((s5-0 (get-quaternion this)) (s1-0 (-> *standard-dynamics* gravity-normal)) (s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) s5-0)) ) @@ -135,8 +135,8 @@ ) ;; definition for method 25 of type trsqv -(defmethod roll-relative-to-gravity trsqv ((obj trsqv)) - (let* ((s5-0 (get-quaternion obj)) +(defmethod roll-relative-to-gravity trsqv ((this trsqv)) + (let* ((s5-0 (get-quaternion this)) (gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) s5-0)) (s5-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) s5-0)) (a1-2 (-> *standard-dynamics* gravity-normal)) @@ -155,7 +155,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod rotate-toward-orientation! trsqv ((obj trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float)) +(defmethod rotate-toward-orientation! trsqv ((this trsqv) (arg0 quaternion) (arg1 float) (arg2 float) (arg3 int) (arg4 int) (arg5 float)) (local-vars (f0-4 float) (sv-192 (function quaternion vector vector float int quaternion)) @@ -167,7 +167,7 @@ ) (set! sv-240 arg4) (let ((s2-0 arg5) - (s5-0 (get-quaternion obj)) + (s5-0 (get-quaternion this)) ) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (when (< 0.0 arg2) @@ -222,19 +222,19 @@ ) ;; definition for method 19 of type trsqv -(defmethod set-heading-vec-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector)) +(defmethod set-heading-vec-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) (forward-up->quaternion - (get-quaternion obj) + (get-quaternion this) (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) (new 'static 'vector :y 1.0 :w 1.0) ) ) ;; definition for method 20 of type trsqv -(defmethod point-toward-point-clear-roll-pitch! trsqv ((obj trsqv) (arg0 vector)) +(defmethod point-toward-point-clear-roll-pitch! trsqv ((this trsqv) (arg0 vector)) (forward-up->quaternion - (get-quaternion obj) - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)) 1.0) + (get-quaternion this) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 (-> this trans)) 1.0) (new 'static 'vector :y 1.0 :w 1.0) ) ) diff --git a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc index 38d85f98ed..89036e8d89 100644 --- a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc @@ -21,16 +21,16 @@ ) ;; definition for method 3 of type bit-array -(defmethod inspect bit-array ((obj bit-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect bit-array ((this bit-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) (label cfg-4) - obj + this ) ;; definition for method 0 of type bit-array @@ -43,43 +43,43 @@ ) ;; definition for method 4 of type bit-array -(defmethod length bit-array ((obj bit-array)) - (-> obj length) +(defmethod length bit-array ((this bit-array)) + (-> this length) ) ;; definition for method 5 of type bit-array ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of bit-array ((obj bit-array)) - (the-as int (+ (-> obj type size) (/ (logand -8 (+ (-> obj allocated-length) 7)) 8))) +(defmethod asize-of bit-array ((this bit-array)) + (the-as int (+ (-> this type size) (/ (logand -8 (+ (-> this allocated-length) 7)) 8))) ) ;; definition for method 9 of type bit-array -(defmethod get-bit bit-array ((obj bit-array) (arg0 int)) - (let ((v1-2 (-> obj bytes (/ arg0 8)))) +(defmethod get-bit bit-array ((this bit-array) (arg0 int)) + (let ((v1-2 (-> this bytes (/ arg0 8)))) (logtest? v1-2 (ash 1 (logand arg0 7))) ) ) ;; definition for method 10 of type bit-array -(defmethod clear-bit bit-array ((obj bit-array) (arg0 int)) - (logclear! (-> obj bytes (/ arg0 8)) (ash 1 (logand arg0 7))) +(defmethod clear-bit bit-array ((this bit-array) (arg0 int)) + (logclear! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) ;; definition for method 11 of type bit-array -(defmethod set-bit bit-array ((obj bit-array) (arg0 int)) - (logior! (-> obj bytes (/ arg0 8)) (ash 1 (logand arg0 7))) +(defmethod set-bit bit-array ((this bit-array) (arg0 int)) + (logior! (-> this bytes (/ arg0 8)) (ash 1 (logand arg0 7))) 0 ) ;; definition for method 12 of type bit-array -(defmethod clear-all! bit-array ((obj bit-array)) - (countdown (v1-2 (/ (logand -8 (+ (-> obj allocated-length) 7)) 8)) +(defmethod clear-all! bit-array ((this bit-array)) + (countdown (v1-2 (/ (logand -8 (+ (-> this allocated-length) 7)) 8)) (nop!) (nop!) - (set! (-> obj bytes v1-2) (the-as uint 0)) + (set! (-> this bytes v1-2) (the-as uint 0)) ) - obj + this ) ;; definition of type vector16ub @@ -94,16 +94,16 @@ ;; definition for method 3 of type vector16ub ;; INFO: Used lq/sq -(defmethod inspect vector16ub ((obj vector16ub)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector16ub ((this vector16ub)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector16ub) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'vector16ub) + (format #t "~1Tdata[16] @ #x~X~%" (-> this data)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type vector4ub @@ -122,20 +122,20 @@ ) ;; definition for method 3 of type vector4ub -(defmethod inspect vector4ub ((obj vector4ub)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector4ub ((this vector4ub)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector4ub) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) - (format #t "~1Tw: ~D~%" (-> obj w)) - (format #t "~1Tclr: ~D~%" (-> obj clr)) + (format #t "[~8x] ~A~%" this 'vector4ub) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Tw: ~D~%" (-> this w)) + (format #t "~1Tclr: ~D~%" (-> this clr)) (label cfg-4) - obj + this ) ;; definition of type vector4b @@ -154,20 +154,20 @@ ) ;; definition for method 3 of type vector4b -(defmethod inspect vector4b ((obj vector4b)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector4b ((this vector4b)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector4b) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) - (format #t "~1Tw: ~D~%" (-> obj w)) - (format #t "~1Tclr: ~D~%" (-> obj clr)) + (format #t "[~8x] ~A~%" this 'vector4b) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Tw: ~D~%" (-> this w)) + (format #t "~1Tclr: ~D~%" (-> this clr)) (label cfg-4) - obj + this ) ;; definition of type vector2ub @@ -184,18 +184,18 @@ ) ;; definition for method 3 of type vector2ub -(defmethod inspect vector2ub ((obj vector2ub)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector2ub ((this vector2ub)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector2ub) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tclr: ~D~%" (-> obj clr)) + (format #t "[~8x] ~A~%" this 'vector2ub) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tclr: ~D~%" (-> this clr)) (label cfg-4) - obj + this ) ;; definition of type vector2b @@ -211,18 +211,18 @@ ) ;; definition for method 3 of type vector2b -(defmethod inspect vector2b ((obj vector2b)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector2b ((this vector2b)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector2b) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tclr: ~D~%" (-> obj clr)) + (format #t "[~8x] ~A~%" this 'vector2b) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tclr: ~D~%" (-> this clr)) (label cfg-4) - obj + this ) ;; definition of type vector2h @@ -238,17 +238,17 @@ ) ;; definition for method 3 of type vector2h -(defmethod inspect vector2h ((obj vector2h)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector2h ((this vector2h)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector2h) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "[~8x] ~A~%" this 'vector2h) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) (label cfg-4) - obj + this ) ;; definition of type vector2uh @@ -265,18 +265,18 @@ ) ;; definition for method 3 of type vector2uh -(defmethod inspect vector2uh ((obj vector2uh)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector2uh ((this vector2uh)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector2uh) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tval: ~D~%" (-> obj val)) + (format #t "[~8x] ~A~%" this 'vector2uh) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tval: ~D~%" (-> this val)) (label cfg-4) - obj + this ) ;; definition of type vector3h @@ -292,18 +292,18 @@ ) ;; definition for method 3 of type vector3h -(defmethod inspect vector3h ((obj vector3h)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector3h ((this vector3h)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector3h) - (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "[~8x] ~A~%" this 'vector3h) + (format #t "~1Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) (label cfg-4) - obj + this ) ;; definition of type vector3uh @@ -319,18 +319,18 @@ ) ;; definition for method 3 of type vector3uh -(defmethod inspect vector3uh ((obj vector3uh)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector3uh ((this vector3uh)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector3uh) - (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "[~8x] ~A~%" this 'vector3uh) + (format #t "~1Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) (label cfg-4) - obj + this ) ;; definition of type vector2w @@ -345,17 +345,17 @@ ) ;; definition for method 3 of type vector2w -(defmethod inspect vector2w ((obj vector2w)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector2w ((this vector2w)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector2w) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "[~8x] ~A~%" this 'vector2w) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) (label cfg-4) - obj + this ) ;; definition of type vector3w @@ -371,18 +371,18 @@ ) ;; definition for method 3 of type vector3w -(defmethod inspect vector3w ((obj vector3w)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector3w ((this vector3w)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector3w) - (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "[~8x] ~A~%" this 'vector3w) + (format #t "~1Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) (label cfg-4) - obj + this ) ;; definition of type vector4w @@ -402,21 +402,21 @@ ;; definition for method 3 of type vector4w ;; INFO: Used lq/sq -(defmethod inspect vector4w ((obj vector4w)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector4w ((this vector4w)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector4w) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) - (format #t "~1Tw: ~D~%" (-> obj w)) - (format #t "~1Tdword[2] @ #x~X~%" (&-> obj x)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'vector4w) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Tw: ~D~%" (-> this w)) + (format #t "~1Tdword[2] @ #x~X~%" (&-> this x)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type vector2 @@ -432,17 +432,17 @@ ) ;; definition for method 3 of type vector2 -(defmethod inspect vector2 ((obj vector2)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector2 ((this vector2)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector2) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) + (format #t "[~8x] ~A~%" this 'vector2) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) (label cfg-4) - obj + this ) ;; definition of type vector3 @@ -458,18 +458,18 @@ ) ;; definition for method 3 of type vector3 -(defmethod inspect vector3 ((obj vector3)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector3 ((this vector3)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector3) - (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) + (format #t "[~8x] ~A~%" this 'vector3) + (format #t "~1Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) (label cfg-4) - obj + this ) ;; definition of type vector4 @@ -489,27 +489,27 @@ ;; definition for method 3 of type vector4 ;; INFO: Used lq/sq -(defmethod inspect vector4 ((obj vector4)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector4 ((this vector4)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector4) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tdword[2] @ #x~X~%" (&-> obj x)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'vector4) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tdword[2] @ #x~X~%" (&-> this x)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition for method 2 of type vector4w -(defmethod print vector4w ((obj vector4w)) - (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) - obj +(defmethod print vector4w ((this vector4w)) + (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) + this ) ;; definition of type vector4w-2 @@ -524,17 +524,17 @@ ) ;; definition for method 3 of type vector4w-2 -(defmethod inspect vector4w-2 ((obj vector4w-2)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector4w-2 ((this vector4w-2)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector4w-2) - (format #t "~1Tdata[8] @ #x~X~%" (-> obj vector)) - (format #t "~1Tquad[2] @ #x~X~%" (-> obj vector)) - (format #t "~1Tvector[2] @ #x~X~%" (-> obj vector)) + (format #t "[~8x] ~A~%" this 'vector4w-2) + (format #t "~1Tdata[8] @ #x~X~%" (-> this vector)) + (format #t "~1Tquad[2] @ #x~X~%" (-> this vector)) + (format #t "~1Tvector[2] @ #x~X~%" (-> this vector)) (label cfg-4) - obj + this ) ;; definition of type vector4w-3 @@ -549,17 +549,17 @@ ) ;; definition for method 3 of type vector4w-3 -(defmethod inspect vector4w-3 ((obj vector4w-3)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector4w-3 ((this vector4w-3)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector4w-3) - (format #t "~1Tdata[12] @ #x~X~%" (-> obj vector)) - (format #t "~1Tquad[3] @ #x~X~%" (-> obj vector)) - (format #t "~1Tvector[3] @ #x~X~%" (-> obj vector)) + (format #t "[~8x] ~A~%" this 'vector4w-3) + (format #t "~1Tdata[12] @ #x~X~%" (-> this vector)) + (format #t "~1Tquad[3] @ #x~X~%" (-> this vector)) + (format #t "~1Tvector[3] @ #x~X~%" (-> this vector)) (label cfg-4) - obj + this ) ;; definition of type vector4w-4 @@ -574,17 +574,17 @@ ) ;; definition for method 3 of type vector4w-4 -(defmethod inspect vector4w-4 ((obj vector4w-4)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector4w-4 ((this vector4w-4)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector4w-4) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj vector)) - (format #t "~1Tquad[4] @ #x~X~%" (-> obj vector)) - (format #t "~1Tvector[4] @ #x~X~%" (-> obj vector)) + (format #t "[~8x] ~A~%" this 'vector4w-4) + (format #t "~1Tdata[16] @ #x~X~%" (-> this vector)) + (format #t "~1Tquad[4] @ #x~X~%" (-> this vector)) + (format #t "~1Tvector[4] @ #x~X~%" (-> this vector)) (label cfg-4) - obj + this ) ;; definition of type vector4h @@ -603,20 +603,20 @@ ) ;; definition for method 3 of type vector4h -(defmethod inspect vector4h ((obj vector4h)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector4h ((this vector4h)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector4h) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) - (format #t "~1Tw: ~D~%" (-> obj w)) - (format #t "~1Tlong: ~D~%" (-> obj long)) + (format #t "[~8x] ~A~%" this 'vector4h) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Tw: ~D~%" (-> this w)) + (format #t "~1Tlong: ~D~%" (-> this long)) (label cfg-4) - obj + this ) ;; definition of type vector8h @@ -631,16 +631,16 @@ ;; definition for method 3 of type vector8h ;; INFO: Used lq/sq -(defmethod inspect vector8h ((obj vector8h)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector8h ((this vector8h)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector8h) - (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'vector8h) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type vector16b @@ -655,30 +655,29 @@ ;; definition for method 3 of type vector16b ;; INFO: Used lq/sq -(defmethod inspect vector16b ((obj vector16b)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector16b ((this vector16b)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector16b) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'vector16b) + (format #t "~1Tdata[16] @ #x~X~%" (-> this data)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition for method 3 of type vector -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect vector ((obj vector)) - (format #t "[~8x] vector~%" obj) - (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj x) (-> obj y) (-> obj z) (-> obj w)) - obj +(defmethod inspect vector ((this vector)) + (format #t "[~8x] vector~%" this) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> this x) (-> this y) (-> this z) (-> this w)) + this ) ;; definition for method 2 of type vector -(defmethod print vector ((obj vector)) - (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) - obj +(defmethod print vector ((this vector)) + (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) + this ) ;; definition for symbol *null-vector*, type vector @@ -711,17 +710,17 @@ ) ;; definition for method 3 of type vector4s-3 -(defmethod inspect vector4s-3 ((obj vector4s-3)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector4s-3 ((this vector4s-3)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector4s-3) - (format #t "~1Tdata[12] @ #x~X~%" (-> obj data)) - (format #t "~1Tquad[3] @ #x~X~%" (-> obj data)) - (format #t "~1Tvector[3] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'vector4s-3) + (format #t "~1Tdata[12] @ #x~X~%" (-> this data)) + (format #t "~1Tquad[3] @ #x~X~%" (-> this data)) + (format #t "~1Tvector[3] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type vector-array @@ -734,17 +733,17 @@ ) ;; definition for method 3 of type vector-array -(defmethod inspect vector-array ((obj vector-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector-array ((this vector-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -764,24 +763,24 @@ ;; definition for method 3 of type rgbaf ;; INFO: Used lq/sq -(defmethod inspect rgbaf ((obj rgbaf)) - (when (not obj) - (set! obj obj) +(defmethod inspect rgbaf ((this rgbaf)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rgbaf) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tr: ~f~%" (-> obj x)) - (format #t "~1Tg: ~f~%" (-> obj y)) - (format #t "~1Tb: ~f~%" (-> obj z)) - (format #t "~1Ta: ~f~%" (-> obj w)) + (format #t "[~8x] ~A~%" this 'rgbaf) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tr: ~f~%" (-> this x)) + (format #t "~1Tg: ~f~%" (-> this y)) + (format #t "~1Tb: ~f~%" (-> this z)) + (format #t "~1Ta: ~f~%" (-> this w)) (label cfg-4) - obj + this ) ;; definition of type plane @@ -798,24 +797,24 @@ ;; definition for method 3 of type plane ;; INFO: Used lq/sq -(defmethod inspect plane ((obj plane)) - (when (not obj) - (set! obj obj) +(defmethod inspect plane ((this plane)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'plane) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Ta: ~f~%" (-> obj x)) - (format #t "~1Tb: ~f~%" (-> obj y)) - (format #t "~1Tc: ~f~%" (-> obj z)) - (format #t "~1Td: ~f~%" (-> obj w)) + (format #t "[~8x] ~A~%" this 'plane) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Ta: ~f~%" (-> this x)) + (format #t "~1Tb: ~f~%" (-> this y)) + (format #t "~1Tc: ~f~%" (-> this z)) + (format #t "~1Td: ~f~%" (-> this w)) (label cfg-4) - obj + this ) ;; definition of type sphere @@ -829,21 +828,21 @@ ;; definition for method 3 of type sphere ;; INFO: Used lq/sq -(defmethod inspect sphere ((obj sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect sphere ((this sphere)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sphere) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj r)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tr: ~f~%" (-> obj r)) + (format #t "[~8x] ~A~%" this 'sphere) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this r)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tr: ~f~%" (-> this r)) (label cfg-4) - obj + this ) ;; definition of type isphere @@ -868,19 +867,19 @@ ) ;; definition for method 3 of type box8s -(defmethod inspect box8s ((obj box8s)) - (when (not obj) - (set! obj obj) +(defmethod inspect box8s ((this box8s)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'box8s) - (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) - (format #t "~1Tquad[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tvector[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tmin: #~%" (-> obj data)) - (format #t "~1Tmax: #~%" (-> obj max)) + (format #t "[~8x] ~A~%" this 'box8s) + (format #t "~1Tdata[8] @ #x~X~%" (-> this data)) + (format #t "~1Tquad[2] @ #x~X~%" (-> this data)) + (format #t "~1Tvector[2] @ #x~X~%" (-> this data)) + (format #t "~1Tmin: #~%" (-> this data)) + (format #t "~1Tmax: #~%" (-> this max)) (label cfg-4) - obj + this ) ;; definition of type box8s-array @@ -893,17 +892,17 @@ ) ;; definition for method 3 of type box8s-array -(defmethod inspect box8s-array ((obj box8s-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect box8s-array ((this box8s-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -926,18 +925,18 @@ ) ;; definition for method 3 of type cylinder -(defmethod inspect cylinder ((obj cylinder)) - (when (not obj) - (set! obj obj) +(defmethod inspect cylinder ((this cylinder)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cylinder) - (format #t "~1Torigin: #~%" (-> obj origin)) - (format #t "~1Taxis: #~%" (-> obj axis)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) - (format #t "~1Tlength: ~f~%" (-> obj length)) + (format #t "[~8x] ~A~%" this 'cylinder) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tlength: ~f~%" (-> this length)) (label cfg-4) - obj + this ) ;; definition of type cylinder-flat @@ -957,18 +956,18 @@ ) ;; definition for method 3 of type cylinder-flat -(defmethod inspect cylinder-flat ((obj cylinder-flat)) - (when (not obj) - (set! obj obj) +(defmethod inspect cylinder-flat ((this cylinder-flat)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cylinder-flat) - (format #t "~1Torigin: #~%" (-> obj origin)) - (format #t "~1Taxis: #~%" (-> obj axis)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) - (format #t "~1Tlength: ~f~%" (-> obj length)) + (format #t "[~8x] ~A~%" this 'cylinder-flat) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tlength: ~f~%" (-> this length)) (label cfg-4) - obj + this ) ;; definition of type vertical-planes @@ -981,15 +980,15 @@ ) ;; definition for method 3 of type vertical-planes -(defmethod inspect vertical-planes ((obj vertical-planes)) - (when (not obj) - (set! obj obj) +(defmethod inspect vertical-planes ((this vertical-planes)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vertical-planes) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'vertical-planes) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type vertical-planes-array @@ -1003,16 +1002,16 @@ ) ;; definition for method 3 of type vertical-planes-array -(defmethod inspect vertical-planes-array ((obj vertical-planes-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect vertical-planes-array ((this vertical-planes-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type qword @@ -1033,22 +1032,22 @@ ;; definition for method 3 of type qword ;; INFO: Used lq/sq -(defmethod inspect qword ((obj qword)) - (when (not obj) - (set! obj obj) +(defmethod inspect qword ((this qword)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'qword) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~1Tbyte[16] @ #x~X~%" (-> obj data)) - (format #t "~1Thword[8] @ #x~X~%" (-> obj data)) - (format #t "~1Tword[4] @ #x~X~%" (-> obj data)) - (format #t "~1Tdword[2] @ #x~X~%" (-> obj data)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tvector: #~%" (-> obj data)) - (format #t "~1Tvector4w: #~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'qword) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~1Tbyte[16] @ #x~X~%" (-> this data)) + (format #t "~1Thword[8] @ #x~X~%" (-> this data)) + (format #t "~1Tword[4] @ #x~X~%" (-> this data)) + (format #t "~1Tdword[2] @ #x~X~%" (-> this data)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tvector: #~%" (-> this data)) + (format #t "~1Tvector4w: #~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type vector3s @@ -1065,18 +1064,18 @@ ) ;; definition for method 3 of type vector3s -(defmethod inspect vector3s ((obj vector3s)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector3s ((this vector3s)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector3s) - (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) + (format #t "[~8x] ~A~%" this 'vector3s) + (format #t "~1Tdata[3] @ #x~X~%" (-> this data)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) (label cfg-4) - obj + this ) ;; definition for function vector-dot diff --git a/test/decompiler/reference/jak2/engine/math/vector_REF.gc b/test/decompiler/reference/jak2/engine/math/vector_REF.gc index a3edc94567..fadc37c07e 100644 --- a/test/decompiler/reference/jak2/engine/math/vector_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector_REF.gc @@ -1508,9 +1508,9 @@ ) ;; definition for method 2 of type vector2 -(defmethod print vector2 ((obj vector2)) - (format #t "#" (-> obj x) (-> obj y) obj) - obj +(defmethod print vector2 ((this vector2)) + (format #t "#" (-> this x) (-> this y) this) + this ) ;; definition for function vector-vector-angle-safe diff --git a/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc index 32a2c18ba9..48dbb9ff50 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type check-vector-collision-with-nav-spheres-info -(defmethod inspect check-vector-collision-with-nav-spheres-info ((obj check-vector-collision-with-nav-spheres-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect check-vector-collision-with-nav-spheres-info ((this check-vector-collision-with-nav-spheres-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'check-vector-collision-with-nav-spheres-info) - (format #t "~1Tu: ~f~%" (-> obj u)) - (format #t "~1Tintersect: #~%" (-> obj intersect)) - (format #t "~1Tnormal: #~%" (-> obj normal)) + (format #t "[~8x] ~A~%" this 'check-vector-collision-with-nav-spheres-info) + (format #t "~1Tu: ~f~%" (-> this u)) + (format #t "~1Tintersect: #~%" (-> this intersect)) + (format #t "~1Tnormal: #~%" (-> this normal)) (label cfg-4) - obj + this ) ;; definition of type nav-gap-info @@ -37,16 +37,16 @@ ) ;; definition for method 3 of type nav-gap-info -(defmethod inspect nav-gap-info ((obj nav-gap-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-gap-info ((this nav-gap-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-gap-info) - (format #t "~1Tdest: ~`vector`P~%" (-> obj dest)) - (format #t "~1Tpoly: #~%" (-> obj poly)) + (format #t "[~8x] ~A~%" this 'nav-gap-info) + (format #t "~1Tdest: ~`vector`P~%" (-> this dest)) + (format #t "~1Tpoly: #~%" (-> this poly)) (label cfg-4) - obj + this ) ;; definition of type nav-avoid-spheres-params @@ -64,20 +64,20 @@ ) ;; definition for method 3 of type nav-avoid-spheres-params -(defmethod inspect nav-avoid-spheres-params ((obj nav-avoid-spheres-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-avoid-spheres-params ((this nav-avoid-spheres-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-avoid-spheres-params) - (format #t "~1Tcurrent-pos: #~%" (-> obj current-pos)) - (format #t "~1Ttravel: #~%" (-> obj travel)) - (format #t "~1Tpref-dir: #~%" (-> obj pref-dir)) - (format #t "~1Tout-travel[2] @ #x~X~%" (-> obj out-travel)) - (format #t "~1Tclosest-sphere-dist2: ~f~%" (-> obj closest-sphere-dist2)) - (format #t "~1Tavoiding-sphere?: ~A~%" (-> obj avoiding-sphere?)) + (format #t "[~8x] ~A~%" this 'nav-avoid-spheres-params) + (format #t "~1Tcurrent-pos: #~%" (-> this current-pos)) + (format #t "~1Ttravel: #~%" (-> this travel)) + (format #t "~1Tpref-dir: #~%" (-> this pref-dir)) + (format #t "~1Tout-travel[2] @ #x~X~%" (-> this out-travel)) + (format #t "~1Tclosest-sphere-dist2: ~f~%" (-> this closest-sphere-dist2)) + (format #t "~1Tavoiding-sphere?: ~A~%" (-> this avoiding-sphere?)) (label cfg-4) - obj + this ) ;; definition of type nav-callback-info @@ -91,16 +91,16 @@ ) ;; definition for method 3 of type nav-callback-info -(defmethod inspect nav-callback-info ((obj nav-callback-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-callback-info ((this nav-callback-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-callback-info) - (format #t "~1Tcallback-count: ~D~%" (-> obj callback-count)) - (format #t "~1Tcallback-array[10] @ #x~X~%" (-> obj callback-array)) + (format #t "[~8x] ~A~%" this 'nav-callback-info) + (format #t "~1Tcallback-count: ~D~%" (-> this callback-count)) + (format #t "~1Tcallback-array[10] @ #x~X~%" (-> this callback-array)) (label cfg-4) - obj + this ) ;; definition of type nav-state @@ -181,14 +181,14 @@ ) ;; definition for method 3 of type nav-state -(defmethod inspect nav-state ((obj nav-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-state ((this nav-state)) + (when (not this) + (set! this this) (goto cfg-34) ) - (format #t "[~8x] ~A~%" obj 'nav-state) - (format #t "~1Tflags: #x~X : (nav-state-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'nav-state) + (format #t "~1Tflags: #x~X : (nav-state-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (nav-state-flag in-target-poly)) (nav-state-flag in-target-poly)) (format #t "in-target-poly ") ) @@ -236,28 +236,28 @@ ) ) (format #t ")~%") - (format #t "~1Tnav: ~A~%" (-> obj nav)) - (format #t "~1Tuser-poly: #~%" (-> obj user-poly)) - (format #t "~1Tmesh: ~A~%" (-> obj mesh)) - (format #t "~1Tcurrent-poly: #~%" (-> obj current-poly)) - (format #t "~1Tvirtual-current-poly: #~%" (-> obj virtual-current-poly)) - (format #t "~1Tnext-poly: #~%" (-> obj next-poly)) - (format #t "~1Ttarget-poly: #~%" (-> obj target-poly)) - (format #t "~1Trotation-rate: ~f~%" (-> obj rotation-rate)) - (format #t "~1Tspeed: (meters ~m)~%" (-> obj speed)) - (format #t "~1Tprev-speed: (meters ~m)~%" (-> obj prev-speed)) - (format #t "~1Tpad0[1] @ #x~X~%" (-> obj pad0)) - (format #t "~1Ttravel: ~`vector`P~%" (-> obj travel)) - (format #t "~1Ttarget-pos: ~`vector`P~%" (-> obj target-post)) - (format #t "~1Tcurrent-pos: ~`vector`P~%" (-> obj current-pos)) - (format #t "~1Tcurrent-pos-local: ~`vector`P~%" (-> obj current-pos-local)) - (format #t "~1Tvirtual-current-pos-local: ~`vector`P~%" (-> obj virtual-current-pos-local)) - (format #t "~1Tvelocity: ~`vector`P~%" (-> obj velocity)) - (format #t "~1Theading: ~`vector`P~%" (-> obj heading)) - (format #t "~1Ttarget-dir: ~`vector`P~%" (-> obj target-dir)) - (format #t "~1Taccel: #~%" (-> obj target-dir)) + (format #t "~1Tnav: ~A~%" (-> this nav)) + (format #t "~1Tuser-poly: #~%" (-> this user-poly)) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tcurrent-poly: #~%" (-> this current-poly)) + (format #t "~1Tvirtual-current-poly: #~%" (-> this virtual-current-poly)) + (format #t "~1Tnext-poly: #~%" (-> this next-poly)) + (format #t "~1Ttarget-poly: #~%" (-> this target-poly)) + (format #t "~1Trotation-rate: ~f~%" (-> this rotation-rate)) + (format #t "~1Tspeed: (meters ~m)~%" (-> this speed)) + (format #t "~1Tprev-speed: (meters ~m)~%" (-> this prev-speed)) + (format #t "~1Tpad0[1] @ #x~X~%" (-> this pad0)) + (format #t "~1Ttravel: ~`vector`P~%" (-> this travel)) + (format #t "~1Ttarget-pos: ~`vector`P~%" (-> this target-post)) + (format #t "~1Tcurrent-pos: ~`vector`P~%" (-> this current-pos)) + (format #t "~1Tcurrent-pos-local: ~`vector`P~%" (-> this current-pos-local)) + (format #t "~1Tvirtual-current-pos-local: ~`vector`P~%" (-> this virtual-current-pos-local)) + (format #t "~1Tvelocity: ~`vector`P~%" (-> this velocity)) + (format #t "~1Theading: ~`vector`P~%" (-> this heading)) + (format #t "~1Ttarget-dir: ~`vector`P~%" (-> this target-dir)) + (format #t "~1Taccel: #~%" (-> this target-dir)) (label cfg-34) - obj + this ) ;; definition of type nav-control @@ -331,14 +331,14 @@ ) ;; definition for method 3 of type nav-control -(defmethod inspect nav-control ((obj nav-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-control ((this nav-control)) + (when (not this) + (set! this this) (goto cfg-25) ) - (format #t "[~8x] ~A~%" obj 'nav-control) - (format #t "~1Tflags: #x~X : (nav-control-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'nav-control) + (format #t "~1Tflags: #x~X : (nav-control-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (nav-control-flag display-marks)) (nav-control-flag display-marks)) (format #t "display-marks ") ) @@ -368,33 +368,33 @@ ) ) (format #t ")~%") - (format #t "~1Tcallback-info: #~%" (-> obj callback-info)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tpad0: ~D~%" (-> obj pad0)) - (format #t "~1Tshape: ~A~%" (-> obj shape)) - (format #t "~1Tnearest-y-threshold: (meters ~m)~%" (-> obj nearest-y-threshold)) - (format #t "~1Tnav-cull-radius: (meters ~m)~%" (-> obj nav-cull-radius)) - (format #t "~1Tsec-per-frame: ~f~%" (-> obj sec-per-frame)) - (format #t "~1Ttarget-speed: (meters ~m)~%" (-> obj target-speed)) - (format #t "~1Tacceleration: (meters ~m)~%" (-> obj acceleration)) - (format #t "~1Tturning-acceleration: (meters ~m)~%" (-> obj turning-acceleration)) - (format #t "~1Tmax-rotation-rate: ~f~%" (-> obj max-rotation-rate)) - (format #t "~1Tspeed-scale: ~f~%" (-> obj speed-scale)) - (format #t "~1Tsphere-count: ~D~%" (-> obj sphere-count)) - (format #t "~1Tsphere-array: #x~X~%" (-> obj sphere-array)) - (format #t "~1Troot-sphere-id: ~D~%" (-> obj root-sphere-id)) - (format #t "~1Tsphere-mask: ~D~%" (-> obj sphere-mask)) - (format #t "~1Tpad1[2] @ #x~X~%" (-> obj pad1)) - (format #t "~1Tsphere-id-array[16] @ #x~X~%" (-> obj sphere-id-array)) - (dotimes (s5-1 (-> obj sphere-count)) - (format #t "~T [~D]~1Tsphere-id-array: ~D~%" s5-1 (-> obj sphere-id-array s5-1)) + (format #t "~1Tcallback-info: #~%" (-> this callback-info)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tpad0: ~D~%" (-> this pad0)) + (format #t "~1Tshape: ~A~%" (-> this shape)) + (format #t "~1Tnearest-y-threshold: (meters ~m)~%" (-> this nearest-y-threshold)) + (format #t "~1Tnav-cull-radius: (meters ~m)~%" (-> this nav-cull-radius)) + (format #t "~1Tsec-per-frame: ~f~%" (-> this sec-per-frame)) + (format #t "~1Ttarget-speed: (meters ~m)~%" (-> this target-speed)) + (format #t "~1Tacceleration: (meters ~m)~%" (-> this acceleration)) + (format #t "~1Tturning-acceleration: (meters ~m)~%" (-> this turning-acceleration)) + (format #t "~1Tmax-rotation-rate: ~f~%" (-> this max-rotation-rate)) + (format #t "~1Tspeed-scale: ~f~%" (-> this speed-scale)) + (format #t "~1Tsphere-count: ~D~%" (-> this sphere-count)) + (format #t "~1Tsphere-array: #x~X~%" (-> this sphere-array)) + (format #t "~1Troot-sphere-id: ~D~%" (-> this root-sphere-id)) + (format #t "~1Tsphere-mask: ~D~%" (-> this sphere-mask)) + (format #t "~1Tpad1[2] @ #x~X~%" (-> this pad1)) + (format #t "~1Tsphere-id-array[16] @ #x~X~%" (-> this sphere-id-array)) + (dotimes (s5-1 (-> this sphere-count)) + (format #t "~T [~D]~1Tsphere-id-array: ~D~%" s5-1 (-> this sphere-id-array s5-1)) ) - (format #t "~1Textra-nav-sphere: ~`vector`P~%" (-> obj extra-nav-sphere)) - (format #t "~1Troot-nav-sphere: ~`vector`P~%" (-> obj root-nav-sphere)) - (format #t "~1Tstate: #~%" (-> obj state)) - (format #t "~1Tmesh: ~A~%" (-> obj state mesh)) + (format #t "~1Textra-nav-sphere: ~`vector`P~%" (-> this extra-nav-sphere)) + (format #t "~1Troot-nav-sphere: ~`vector`P~%" (-> this root-nav-sphere)) + (format #t "~1Tstate: #~%" (-> this state)) + (format #t "~1Tmesh: ~A~%" (-> this state mesh)) (label cfg-25) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc index 83b8a6aeb3..94659f057d 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc @@ -27,44 +27,44 @@ ) ;; definition for method 7 of type nav-control -(defmethod relocate nav-control ((obj nav-control) (arg0 int)) - (&+! (-> obj process) arg0) - (&+! (-> obj shape) arg0) - obj +(defmethod relocate nav-control ((this nav-control) (arg0 int)) + (&+! (-> this process) arg0) + (&+! (-> this shape) arg0) + this ) ;; definition for method 41 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod remove! nav-control ((obj nav-control)) +(defmethod remove! nav-control ((this nav-control)) "Remove this nav-control from the nav-mesh it belongs to." - (remove-nav-control (-> obj state mesh) obj) + (remove-nav-control (-> this state mesh) this) 0 (none) ) ;; definition for method 28 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod enable-extra-sphere! nav-control ((obj nav-control)) +(defmethod enable-extra-sphere! nav-control ((this nav-control)) "Sets a flag indicating that this nav-control has an extra-nav-sphere." - (logior! (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + (logior! (-> this shape nav-flags) (nav-flags has-extra-sphere)) 0 (none) ) ;; definition for method 29 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod disable-extra-sphere! nav-control ((obj nav-control)) +(defmethod disable-extra-sphere! nav-control ((this nav-control)) "Clears a flag indicating that this nav-control has an extra-nav-sphere." - (logclear! (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + (logclear! (-> this shape nav-flags) (nav-flags has-extra-sphere)) 0 (none) ) ;; definition for method 30 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod copy-extra-nav-sphere! nav-control ((obj nav-control) (arg0 sphere)) +(defmethod copy-extra-nav-sphere! nav-control ((this nav-control) (arg0 sphere)) "Copies the given [[sphere]] into `extra-nav-sphere`" - (mem-copy! (the-as pointer (-> obj extra-nav-sphere)) (the-as pointer arg0) 16) + (mem-copy! (the-as pointer (-> this extra-nav-sphere)) (the-as pointer arg0) 16) 0 (none) ) @@ -72,11 +72,11 @@ ;; definition for method 31 of type nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-extra-nav-sphere-xyz! nav-control ((obj nav-control) (arg0 sphere)) +(defmethod set-extra-nav-sphere-xyz! nav-control ((this nav-control) (arg0 sphere)) "Set the `extra-nav-sphere` with the data in the given [[sphere]]" - (let ((f0-0 (-> obj extra-nav-sphere w))) - (set! (-> obj extra-nav-sphere quad) (-> arg0 quad)) - (set! (-> obj extra-nav-sphere w) f0-0) + (let ((f0-0 (-> this extra-nav-sphere w))) + (set! (-> this extra-nav-sphere quad) (-> arg0 quad)) + (set! (-> this extra-nav-sphere w) f0-0) ) 0 (none) @@ -84,140 +84,141 @@ ;; definition for method 32 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-extra-nav-sphere-radius! nav-control ((obj nav-control) (arg0 float)) +(defmethod set-extra-nav-sphere-radius! nav-control ((this nav-control) (arg0 float)) "Set's `extra-nav-sphere`'s radius" - (set! (-> obj extra-nav-sphere w) arg0) + (set! (-> this extra-nav-sphere w) arg0) 0 (none) ) ;; definition for method 33 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-nearest-y-thres! nav-control ((obj nav-control) (arg0 float)) +(defmethod set-nearest-y-thres! nav-control ((this nav-control) (arg0 float)) "Set `nearest-y-threshold`" - (set! (-> obj nearest-y-threshold) arg0) + (set! (-> this nearest-y-threshold) arg0) 0 (none) ) ;; definition for method 34 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-nav-cull-radius! nav-control ((obj nav-control) (arg0 meters)) +(defmethod set-nav-cull-radius! nav-control ((this nav-control) (arg0 meters)) "Set `nav-cull-radius`" - (set! (-> obj nav-cull-radius) arg0) + (set! (-> this nav-cull-radius) arg0) 0 (none) ) ;; definition for method 35 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-speed-scale! nav-control ((obj nav-control) (arg0 float)) +(defmethod set-speed-scale! nav-control ((this nav-control) (arg0 float)) "Set `speed-scale`" - (set! (-> obj speed-scale) arg0) + (set! (-> this speed-scale) arg0) 0 (none) ) ;; definition for method 36 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-target-speed! nav-control ((obj nav-control) (arg0 meters)) +(defmethod set-target-speed! nav-control ((this nav-control) (arg0 meters)) "Set `target-speed`" - (set! (-> obj target-speed) arg0) + (set! (-> this target-speed) arg0) 0 (none) ) ;; definition for method 27 of type nav-control -(defmethod get-target-speed nav-control ((obj nav-control)) - (-> obj target-speed) +(defmethod get-target-speed nav-control ((this nav-control)) + (-> this target-speed) ) ;; definition for method 37 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-acceleration! nav-control ((obj nav-control) (arg0 meters)) +(defmethod set-acceleration! nav-control ((this nav-control) (arg0 meters)) "Set `acceleration`" - (set! (-> obj acceleration) arg0) + (set! (-> this acceleration) arg0) 0 (none) ) ;; definition for method 38 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-turning-acceleration! nav-control ((obj nav-control) (arg0 meters)) +(defmethod set-turning-acceleration! nav-control ((this nav-control) (arg0 meters)) "Set `turning-acceleration`" - (set! (-> obj turning-acceleration) arg0) + (set! (-> this turning-acceleration) arg0) 0 (none) ) ;; definition for method 39 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-max-rotation-rate! nav-control ((obj nav-control) (arg0 float)) +(defmethod set-max-rotation-rate! nav-control ((this nav-control) (arg0 float)) "Set `max-rotation-rate`" - (set! (-> obj max-rotation-rate) arg0) + (set! (-> this max-rotation-rate) arg0) 0 (none) ) ;; definition for method 25 of type nav-control -(defmethod get-max-rotation-rate nav-control ((obj nav-control)) - (-> obj max-rotation-rate) +(defmethod get-max-rotation-rate nav-control ((this nav-control)) + (-> this max-rotation-rate) ) ;; definition for method 40 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-sphere-mask! nav-control ((obj nav-control) (arg0 uint)) +(defmethod set-sphere-mask! nav-control ((this nav-control) (arg0 uint)) "TODO - probably an enum - Set `sphere-mask`" - (set! (-> obj sphere-mask) arg0) + (set! (-> this sphere-mask) arg0) 0 (none) ) ;; definition for method 26 of type nav-control -(defmethod get-sphere-mask nav-control ((obj nav-control)) - (-> obj sphere-mask) +(defmethod get-sphere-mask nav-control ((this nav-control)) + (-> this sphere-mask) ) ;; definition for method 10 of type nav-control -(defmethod point-in-bsphere? nav-control ((obj nav-control) (arg0 vector)) +(defmethod point-in-bsphere? nav-control ((this nav-control) (arg0 vector)) "Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius" - (let ((v1-1 (-> obj state mesh bounds))) + (let ((v1-1 (-> this state mesh bounds))) (>= (-> v1-1 w) (vector-vector-distance arg0 v1-1)) ) ) ;; definition for method 43 of type nav-control -(defmethod display-marks? nav-control ((obj nav-control)) +(defmethod display-marks? nav-control ((this nav-control)) "Returns if navigation related marks should be displayed" - (and *display-nav-marks* (logtest? (-> obj flags) (nav-control-flag display-marks))) + (and *display-nav-marks* (logtest? (-> this flags) (nav-control-flag display-marks))) ) ;; definition for method 42 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod init! nav-control ((obj nav-control) (arg0 collide-shape)) +(defmethod init! nav-control ((this nav-control) (arg0 collide-shape)) "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" - (set! (-> obj callback-info) #f) - (logior! (-> obj flags) (nav-control-flag update-heading-from-facing output-sphere-hash)) - (let ((v1-2 obj)) + (set! (-> this callback-info) #f) + (logior! (-> this flags) (nav-control-flag update-heading-from-facing output-sphere-hash)) + (let ((v1-2 this)) (set! (-> v1-2 sphere-mask) (the-as uint #x800f8)) ) 0 - (set! (-> obj sphere-count) 0) - (set! (-> obj sphere-array) (the-as (inline-array sphere) #f)) - (set! (-> obj shape) arg0) - (set! (-> obj process) (-> arg0 process)) - (set! (-> obj speed-scale) 1.0) - (set! (-> obj acceleration) 4096.0) - (set! (-> obj turning-acceleration) 4096.0) - (set! (-> obj max-rotation-rate) 131072.0) - (set! (-> obj target-speed) 0.0) - (set! (-> obj nav-cull-radius) 40960.0) - (reset! (-> obj state) obj) + (set! (-> this sphere-count) 0) + (set! (-> this sphere-array) (the-as (inline-array sphere) #f)) + (set! (-> this shape) arg0) + (set! (-> this process) (-> arg0 process)) + (set! (-> this speed-scale) 1.0) + (set! (-> this acceleration) 4096.0) + (set! (-> this turning-acceleration) 4096.0) + (set! (-> this max-rotation-rate) 131072.0) + (set! (-> this target-speed) 0.0) + (set! (-> this nav-cull-radius) 40960.0) + (reset! (-> this state) this) 0 (none) ) ;; definition for function get-nav-control +;; WARN: Return type mismatch object vs none. ;; WARN: Function get-nav-control has a return type of none, but the expression builder found a return statement. (defun get-nav-control ((arg0 process-drawable) (arg1 nav-mesh)) "Given a [[process-drawable]] get the associated [[nav-control]] using either: @@ -240,78 +241,78 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 13 of type nav-control -(defmethod find-nearest-poly-to-point nav-control ((obj nav-control) (arg0 vector)) +(defmethod find-nearest-poly-to-point nav-control ((this nav-control) (arg0 vector)) "Find the nav-poly closest to this point in the nav-mesh." (let ((gp-0 (new 'stack 'nav-find-poly-parms))) - (vector-! (-> gp-0 point) arg0 (-> obj state mesh bounds)) - (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> gp-0 point) arg0 (-> this state mesh bounds)) + (set! (-> gp-0 y-threshold) (-> this nearest-y-threshold)) (set! (-> gp-0 ignore) (the-as uint 2)) - (find-nearest-poly-to-point-local (-> obj state mesh) gp-0) + (find-nearest-poly-to-point-local (-> this state mesh) gp-0) (-> gp-0 poly) ) ) ;; definition for method 14 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod project-point-onto-plane-of-poly nav-control ((obj nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod project-point-onto-plane-of-poly nav-control ((this nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) "Move a point to the be on the plane containing the given nav-poly. Return the normal too" (project-point-onto-plane-of-poly-local - (-> obj state mesh) + (-> this state mesh) arg0 arg1 arg2 - (vector-! (new 'stack-no-clear 'vector) arg3 (-> obj state mesh bounds)) + (vector-! (new 'stack-no-clear 'vector) arg3 (-> this state mesh bounds)) ) - (vector+! arg1 arg1 (-> obj state mesh bounds)) + (vector+! arg1 arg1 (-> this state mesh bounds)) 0 (none) ) ;; definition for method 17 of type nav-control -(defmethod is-in-mesh? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) +(defmethod is-in-mesh? nav-control ((this nav-control) (arg0 vector) (arg1 float)) "Is this point in the mesh?" (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj state mesh bounds)) - (let ((a1-1 (-> obj state mesh))) - (is-in-mesh-local? a1-1 v1-0 arg1 (-> obj nearest-y-threshold)) + (vector-! v1-0 arg0 (-> this state mesh bounds)) + (let ((a1-1 (-> this state mesh))) + (is-in-mesh-local? a1-1 v1-0 arg1 (-> this nearest-y-threshold)) ) ) ) ;; definition for method 9 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw nav-control ((obj nav-control)) +(defmethod debug-draw nav-control ((this nav-control)) (local-vars (sv-32 nav-mesh) (sv-36 vector)) - (when (display-marks? obj) - (debug-draw (-> obj state mesh)) - (set! sv-32 (-> obj state mesh)) + (when (display-marks? this) + (debug-draw (-> this state mesh)) + (set! sv-32 (-> this state mesh)) (set! sv-36 (new 'stack-no-clear 'vector)) - (if (logtest? (-> obj shape nav-flags) (nav-flags has-root-sphere)) + (if (logtest? (-> this shape nav-flags) (nav-flags has-root-sphere)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj root-nav-sphere) - (-> obj root-nav-sphere w) + (-> this root-nav-sphere) + (-> this root-nav-sphere w) (new 'static 'rgba :g #xff :b #xff :a #x20) ) ) - (if (logtest? (-> obj shape nav-flags) (nav-flags has-extra-sphere)) + (if (logtest? (-> this shape nav-flags) (nav-flags has-extra-sphere)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj extra-nav-sphere) - (-> obj extra-nav-sphere w) + (-> this extra-nav-sphere) + (-> this extra-nav-sphere w) (new 'static 'rgba :g #xff :b #xff :a #x20) ) ) - (dotimes (s5-0 (-> obj sphere-count)) - (let ((v1-19 (-> obj state mesh work debug sphere-array s5-0))) + (dotimes (s5-0 (-> this sphere-count)) + (let ((v1-19 (-> this state mesh work debug sphere-array s5-0))) (vector+! sv-36 (-> sv-32 bounds) (the-as vector v1-19)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) sv-36 - (- (-> v1-19 r) (-> obj shape nav-radius)) + (- (-> v1-19 r) (-> this shape nav-radius)) (new 'static 'rgba :g #xff :b #xff :a #x20) ) ) @@ -328,56 +329,56 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) ) - (debug-draw (-> obj state)) + (debug-draw (-> this state)) ) 0 (none) ) ;; definition for method 11 of type nav-control -(defmethod find-poly-containing-point-1 nav-control ((obj nav-control) (arg0 vector)) +(defmethod find-poly-containing-point-1 nav-control ((this nav-control) (arg0 vector)) "Find nav-poly containing this point." (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) - (vector-! (-> v1-0 point) arg0 (-> obj state mesh bounds)) - (set! (-> v1-0 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> v1-0 point) arg0 (-> this state mesh bounds)) + (set! (-> v1-0 y-threshold) (-> this nearest-y-threshold)) (set! (-> v1-0 ignore) (the-as uint 2)) - (find-poly-containing-point-local (-> obj state mesh) v1-0) + (find-poly-containing-point-local (-> this state mesh) v1-0) ) ) ;; definition for method 15 of type nav-control -(defmethod find-poly-containing-point-2 nav-control ((obj nav-control) (arg0 vector)) +(defmethod find-poly-containing-point-2 nav-control ((this nav-control) (arg0 vector)) "Find nav-poly containing this point - same as 1" (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) - (vector-! (-> v1-0 point) arg0 (-> obj state mesh bounds)) - (set! (-> v1-0 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> v1-0 point) arg0 (-> this state mesh bounds)) + (set! (-> v1-0 y-threshold) (-> this nearest-y-threshold)) (set! (-> v1-0 ignore) (the-as uint 2)) - (find-poly-containing-point-local (-> obj state mesh) v1-0) + (find-poly-containing-point-local (-> this state mesh) v1-0) ) ) ;; definition for method 16 of type nav-control ;; WARN: Return type mismatch object vs symbol. -(defmethod is-above-poly-max-height? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) +(defmethod is-above-poly-max-height? nav-control ((this nav-control) (arg0 vector) (arg1 float)) "Is the point in a poly, and lower than a max height?" (let ((a1-1 (new 'stack-no-clear 'nav-find-poly-parms))) - (vector-! (-> a1-1 point) arg0 (-> obj state mesh bounds)) - (set! (-> a1-1 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> a1-1 point) arg0 (-> this state mesh bounds)) + (set! (-> a1-1 y-threshold) (-> this nearest-y-threshold)) (set! (-> a1-1 ignore) (the-as uint 2)) - (the-as symbol (and (find-poly-containing-point-local (-> obj state mesh) a1-1) - (< (-> arg0 y) (+ (-> obj state mesh bounds y) arg1)) + (the-as symbol (and (find-poly-containing-point-local (-> this state mesh) a1-1) + (< (-> arg0 y) (+ (-> this state mesh bounds y) arg1)) ) ) ) ) ;; definition for method 45 of type nav-control -(defmethod find-first-sphere-intersecting-ray nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod find-first-sphere-intersecting-ray nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) "Find the first sphere that this ray intersects" (let ((s5-0 (the-as sphere #f))) (let ((f30-0 -0.000001)) - (countdown (s1-0 (-> obj sphere-count)) - (let* ((s0-0 (-> obj sphere-array s1-0)) + (countdown (s1-0 (-> this sphere-count)) + (let* ((s0-0 (-> this sphere-array s1-0)) (f0-1 (ray-circle-intersect arg0 arg1 s0-0 (-> s0-0 r))) ) (when (< f30-0 f0-1) @@ -518,17 +519,17 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 46 of type nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod find-sphere-ids-from-sphere-hash nav-control ((obj nav-control) (arg0 symbol)) +(defmethod find-sphere-ids-from-sphere-hash nav-control ((this nav-control) (arg0 symbol)) "Use sphere-hash to look up navigation sphere IDs and save them." (let ((s5-0 (new 'stack-no-clear 'find-nav-sphere-ids-params))) - (set! (-> s5-0 bsphere quad) (-> obj root-nav-sphere quad)) - (+! (-> s5-0 bsphere r) (-> obj nav-cull-radius)) + (set! (-> s5-0 bsphere quad) (-> this root-nav-sphere quad)) + (+! (-> s5-0 bsphere r) (-> this nav-cull-radius)) (set! (-> s5-0 max-len) 16) - (set! (-> s5-0 mask) (-> obj sphere-mask)) - (set! (-> s5-0 array) (-> obj sphere-id-array)) - (set! (-> s5-0 y-threshold) (-> obj nearest-y-threshold)) - (find-nav-sphere-ids (-> obj state mesh sphere-hash) s5-0) - (set! (-> obj sphere-count) (-> s5-0 len)) + (set! (-> s5-0 mask) (-> this sphere-mask)) + (set! (-> s5-0 array) (-> this sphere-id-array)) + (set! (-> s5-0 y-threshold) (-> this nearest-y-threshold)) + (find-nav-sphere-ids (-> this state mesh sphere-hash) s5-0) + (set! (-> this sphere-count) (-> s5-0 len)) ) 0 (none) @@ -536,17 +537,17 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 23 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod set-spheres-from-nav-ids nav-control ((obj nav-control)) +(defmethod set-spheres-from-nav-ids nav-control ((this nav-control)) "Set up spheres from sphere ids previously found by find-sphere-ids-from-sphere-hash" - (let ((v1-2 (-> obj state mesh sphere-hash sphere-array)) - (a1-0 (-> obj sphere-id-array)) - (a2-1 (-> obj state mesh bounds)) - (a3-0 (-> obj root-nav-sphere)) - (t0-0 (-> obj sphere-count)) + (let ((v1-2 (-> this state mesh sphere-hash sphere-array)) + (a1-0 (-> this sphere-id-array)) + (a2-1 (-> this state mesh bounds)) + (a3-0 (-> this root-nav-sphere)) + (t0-0 (-> this sphere-count)) ) (dotimes (t1-0 t0-0) (let ((t3-0 (-> v1-2 (-> a1-0 t1-0))) - (t2-4 (-> obj sphere-array t1-0)) + (t2-4 (-> this sphere-array t1-0)) ) (vector-! (the-as vector t2-4) (the-as vector t3-0) a2-1) (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-0 w))) @@ -585,33 +586,33 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 3 of type nav-control-cfs-work -(defmethod inspect nav-control-cfs-work ((obj nav-control-cfs-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-control-cfs-work ((this nav-control-cfs-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-control-cfs-work) - (format #t "~1Tin-dir: #~%" (-> obj in-dir)) - (format #t "~1Tright-dir: #~%" (-> obj right-dir)) - (format #t "~1Tbest-dir[2] @ #x~X~%" (-> obj best-dir)) - (format #t "~1Ttemp-dir[2] @ #x~X~%" (-> obj temp-dir)) - (format #t "~1Taway-dir: #~%" (-> obj away-dir)) - (format #t "~1Tbest-dir-angle[2] @ #x~X~%" (-> obj best-dir-angle)) - (format #t "~1Tignore-mask: ~D~%" (-> obj ignore-mask)) - (format #t "~1Tinitial-ignore-mask: ~D~%" (-> obj initial-ignore-mask)) - (format #t "~1Ti-sphere: ~D~%" (-> obj i-sphere)) - (format #t "~1Ti-first-sphere: ~D~%" (-> obj i-first-sphere)) - (format #t "~1Ti-inside-sphere: ~D~%" (-> obj i-inside-sphere)) - (format #t "~1Tinside-sphere-dist: ~f~%" (-> obj inside-sphere-dist)) - (format #t "~1Tsign: ~f~%" (-> obj sign)) - (format #t "~1Ttravel-len: ~f~%" (-> obj travel-len)) - (format #t "~1Tdist2: ~f~%" (-> obj dist2)) - (format #t "~1Tinside-dist: ~f~%" (-> obj inside-dist)) - (format #t "~1Trand-angle: ~f~%" (-> obj rand-angle)) - (format #t "~1Tdir-update: ~A~%" (-> obj dir-update)) - (format #t "~1Tdebug-offset: #~%" (-> obj debug-offset)) + (format #t "[~8x] ~A~%" this 'nav-control-cfs-work) + (format #t "~1Tin-dir: #~%" (-> this in-dir)) + (format #t "~1Tright-dir: #~%" (-> this right-dir)) + (format #t "~1Tbest-dir[2] @ #x~X~%" (-> this best-dir)) + (format #t "~1Ttemp-dir[2] @ #x~X~%" (-> this temp-dir)) + (format #t "~1Taway-dir: #~%" (-> this away-dir)) + (format #t "~1Tbest-dir-angle[2] @ #x~X~%" (-> this best-dir-angle)) + (format #t "~1Tignore-mask: ~D~%" (-> this ignore-mask)) + (format #t "~1Tinitial-ignore-mask: ~D~%" (-> this initial-ignore-mask)) + (format #t "~1Ti-sphere: ~D~%" (-> this i-sphere)) + (format #t "~1Ti-first-sphere: ~D~%" (-> this i-first-sphere)) + (format #t "~1Ti-inside-sphere: ~D~%" (-> this i-inside-sphere)) + (format #t "~1Tinside-sphere-dist: ~f~%" (-> this inside-sphere-dist)) + (format #t "~1Tsign: ~f~%" (-> this sign)) + (format #t "~1Ttravel-len: ~f~%" (-> this travel-len)) + (format #t "~1Tdist2: ~f~%" (-> this dist2)) + (format #t "~1Tinside-dist: ~f~%" (-> this inside-dist)) + (format #t "~1Trand-angle: ~f~%" (-> this rand-angle)) + (format #t "~1Tdir-update: ~A~%" (-> this dir-update)) + (format #t "~1Tdebug-offset: #~%" (-> this debug-offset)) (label cfg-4) - obj + this ) ;; definition for function circle-tangent-directions @@ -809,7 +810,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 18 of type nav-control ;; INFO: Used lq/sq -(defmethod avoid-spheres-1! nav-control ((obj nav-control) (arg0 nav-avoid-spheres-params)) +(defmethod avoid-spheres-1! nav-control ((this nav-control) (arg0 nav-avoid-spheres-params)) (local-vars (v1-28 int) (a0-29 int) (a1-3 float)) (rlet ((acc :class vf) (Q :class vf) @@ -856,8 +857,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (let ((f0-10 65536.0)) (set! (-> arg0 closest-sphere-dist2) (* f0-10 f0-10)) ) - (dotimes (v1-10 (-> obj sphere-count)) - (let ((a0-13 (-> obj sphere-array v1-10))) + (dotimes (v1-10 (-> this sphere-count)) + (let ((a0-13 (-> this sphere-array v1-10))) (let ((a1-2 (-> arg0 current-pos)) (a2-0 a0-13) ) @@ -893,8 +894,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (-> arg0 current-pos) (-> s5-0 in-dir) (-> s5-0 travel-len) - (-> obj sphere-count) - (-> obj sphere-array) + (-> this sphere-count) + (-> this sphere-array) (the-as int (-> s5-0 initial-ignore-mask)) ) ) @@ -907,7 +908,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (b! #t cfg-43 :delay (nop!)) (label cfg-13) (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) - (let ((a1-17 (-> obj sphere-array (-> s5-0 i-first-sphere)))) + (let ((a1-17 (-> this sphere-array (-> s5-0 i-first-sphere)))) (circle-tangent-directions (-> arg0 current-pos) a1-17 @@ -939,7 +940,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (+! (-> s5-0 ignore-mask) (ash 1 v1-28)) (circle-tangent-directions (-> arg0 current-pos) - (-> obj sphere-array v1-28) + (-> this sphere-array v1-28) (the-as vector (-> s5-0 temp-dir)) (-> s5-0 temp-dir 1) ) @@ -971,8 +972,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (-> arg0 current-pos) (-> s5-0 best-dir s3-0) (-> s5-0 travel-len) - (-> obj sphere-count) - (-> obj sphere-array) + (-> this sphere-count) + (-> this sphere-array) (the-as int (-> s5-0 ignore-mask)) ) ) @@ -984,7 +985,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (b! (< s3-0 2) cfg-20) ) (when (!= (-> s5-0 i-inside-sphere) -1) - (let ((s4-1 (-> obj sphere-array (-> s5-0 i-inside-sphere)))) + (let ((s4-1 (-> this sphere-array (-> s5-0 i-inside-sphere)))) (vector-! (-> s5-0 away-dir) (-> arg0 current-pos) (the-as vector s4-1)) (set! (-> s5-0 away-dir y) 0.0) (when (>= 40.96 (vector-length (-> s5-0 away-dir))) @@ -1109,7 +1110,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 19 of type nav-control ;; INFO: Used lq/sq -(defmethod avoid-spheres-2! nav-control ((obj nav-control) (arg0 nav-avoid-spheres-params)) +(defmethod avoid-spheres-2! nav-control ((this nav-control) (arg0 nav-avoid-spheres-params)) (local-vars (a0-32 int) (a1-3 float)) (rlet ((acc :class vf) (Q :class vf) @@ -1153,8 +1154,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (let ((f0-9 65536.0)) (set! (-> arg0 closest-sphere-dist2) (* f0-9 f0-9)) ) - (dotimes (v1-9 (-> obj sphere-count)) - (let ((a0-13 (-> obj sphere-array v1-9))) + (dotimes (v1-9 (-> this sphere-count)) + (let ((a0-13 (-> this sphere-array v1-9))) (let ((a1-2 (-> arg0 current-pos)) (a2-0 a0-13) ) @@ -1185,8 +1186,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (-> arg0 current-pos) (-> s5-0 in-dir) (-> s5-0 travel-len) - (-> obj sphere-count) - (-> obj sphere-array) + (-> this sphere-count) + (-> this sphere-array) (the-as int (-> s5-0 initial-ignore-mask)) ) ) @@ -1199,7 +1200,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (b! #t cfg-21 :delay (nop!)) (label cfg-11) (+! (-> s5-0 initial-ignore-mask) (ash 1 (-> s5-0 i-first-sphere))) - (let ((a1-15 (-> obj sphere-array (-> s5-0 i-first-sphere)))) + (let ((a1-15 (-> this sphere-array (-> s5-0 i-first-sphere)))) (circle-tangent-directions (-> arg0 current-pos) a1-15 @@ -1242,8 +1243,13 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 21 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod clamp-vector-to-mesh-no-gaps nav-control ((obj nav-control) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) - (clamp-vector-to-mesh-no-gaps (-> obj state mesh) arg0 arg1 arg2 arg3) +(defmethod clamp-vector-to-mesh-no-gaps nav-control ((this nav-control) + (arg0 vector) + (arg1 nav-poly) + (arg2 vector) + (arg3 clamp-travel-vector-to-mesh-return-info) + ) + (clamp-vector-to-mesh-no-gaps (-> this state mesh) arg0 arg1 arg2 arg3) 0 (none) ) @@ -1339,7 +1345,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 164 signed mismatch ;; WARN: Stack slot offset 168 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod clamp-vector-to-mesh-no-gaps nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) +(defmethod clamp-vector-to-mesh-no-gaps nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) (local-vars (v1-12 symbol) (sv-112 nav-ray) @@ -1380,12 +1386,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! sv-112 (new 'stack-no-clear 'nav-ray)) (set! sv-116 (new 'stack-no-clear 'vector)) (set! sv-120 (the-as symbol #f)) - (set! sv-124 (-> obj work)) - (vector-! sv-116 arg0 (-> obj bounds)) + (set! sv-124 (-> this work)) + (vector-! sv-116 arg0 (-> this bounds)) (set! (-> sv-112 current-poly) arg1) (set! (-> sv-112 current-pos quad) (-> sv-116 quad)) (vector+! (-> sv-112 dest-pos) sv-116 arg2) - (let* ((t2-0 obj) + (let* ((t2-0 this) (v1-11 (-> sv-112 dest-pos)) (a1-4 (-> arg1 vertex-count)) (a2-1 (-> arg1 vertex)) @@ -1446,7 +1452,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr 0 (until (or (>= sv-128 15) (-> sv-112 terminated)) (set! sv-128 (+ sv-128 1)) - (let ((a1-9 obj) + (let ((a1-9 this) (v1-20 sv-112) ) (set! sv-136 -1) @@ -1534,14 +1540,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! sv-204 (* sv-204 f0-41)) ) (set! (-> arg3 found-boundary) #t) - (vector+! (-> arg3 intersection) (-> sv-112 current-pos) (-> obj bounds)) + (vector+! (-> arg3 intersection) (-> sv-112 current-pos) (-> this bounds)) (set! (-> arg3 boundary-normal x) sv-200) (set! (-> arg3 boundary-normal y) 0.0) (set! (-> arg3 boundary-normal z) sv-204) (set! (-> arg3 poly) (-> sv-112 current-poly)) (set! (-> arg3 edge) (-> sv-112 last-edge)) - (vector+! (-> arg3 vert-0) sv-192 (-> obj bounds)) - (vector+! (-> arg3 vert-1) sv-196 (-> obj bounds)) + (vector+! (-> arg3 vert-0) sv-192 (-> this bounds)) + (vector+! (-> arg3 vert-1) sv-196 (-> this bounds)) (set! (-> sv-112 dest-pos quad) (-> sv-112 current-pos quad)) (if (-> sv-112 hit-gap) (set! (-> arg3 gap-poly) (-> sv-112 next-poly)) @@ -1561,7 +1567,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 21 of type nav-mesh ;; WARN: Return type mismatch object vs none. ;; WARN: Function (method 21 nav-mesh) has a return type of none, but the expression builder found a return statement. -(defmethod find-adjacent-bounds-one nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) +(defmethod find-adjacent-bounds-one nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) (local-vars (sv-16 nav-poly)) (if (zero? arg3) (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> arg1 vertex-count)))) @@ -1582,11 +1588,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (if (zero? arg3) (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> s3-0 vertex-count)))) ) - (vector+! arg0 (-> s3-0 vertex arg2) (-> obj bounds)) + (vector+! arg0 (-> s3-0 vertex arg2) (-> this bounds)) (return #f) ) (else - (set! s3-0 (-> obj poly-array v1-12)) + (set! s3-0 (-> this poly-array v1-12)) (when (= s3-0 sv-16) (format 0 "ERROR: find-adjacent-bounds-one cur-poly = start-poly after step~%") (return #f) @@ -1610,9 +1616,9 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 20 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod set-normals-from-adjacent-bounds nav-mesh ((obj nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) - (find-adjacent-bounds-one obj (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) - (find-adjacent-bounds-one obj (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) +(defmethod set-normals-from-adjacent-bounds nav-mesh ((this nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) + (find-adjacent-bounds-one this (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) + (find-adjacent-bounds-one this (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) (vector-! (-> arg0 prev-normal) (-> arg0 vert-0) (-> arg0 vert-prev)) (vector-! (-> arg0 next-normal) (-> arg0 vert-next) (-> arg0 vert-1)) (vector-normalize! (-> arg0 prev-normal) 1.0) @@ -1790,7 +1796,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 156 signed mismatch ;; WARN: Stack slot offset 160 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod clamp-vector-to-mesh-cross-gaps nav-mesh ((obj nav-mesh) +(defmethod clamp-vector-to-mesh-cross-gaps nav-mesh ((this nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) @@ -1841,11 +1847,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! sv-96 (new 'stack-no-clear 'nav-ray)) (set! sv-100 (the-as symbol #f)) (set! sv-104 0) - (set! sv-112 (-> obj work)) + (set! sv-112 (-> this work)) (set! (-> sv-96 current-poly) arg1) (set! (-> sv-96 current-pos quad) (-> arg0 quad)) (vector+! (-> sv-96 dest-pos) arg0 arg2) - (let* ((t6-0 obj) + (let* ((t6-0 this) (t4-2 arg1) (v1-10 (-> sv-96 dest-pos)) (t3-3 (-> t4-2 vertex-count)) @@ -1908,7 +1914,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr 0 (until v1-22 (set! sv-120 (+ sv-120 1)) - (let ((t3-8 obj) + (let ((t3-8 this) (v1-19 sv-96) ) (set! sv-128 -1) @@ -1999,14 +2005,14 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (when arg5 (set! (-> arg5 found-boundary) #t) - (vector+! (-> arg5 intersection) (-> sv-96 current-pos) (-> obj bounds)) + (vector+! (-> arg5 intersection) (-> sv-96 current-pos) (-> this bounds)) (set! (-> arg5 boundary-normal x) sv-192) (set! (-> arg5 boundary-normal y) 0.0) (set! (-> arg5 boundary-normal z) sv-196) (set! (-> arg5 poly) (-> sv-96 current-poly)) (set! (-> arg5 edge) (-> sv-96 last-edge)) - (vector+! (-> arg5 vert-0) sv-184 (-> obj bounds)) - (vector+! (-> arg5 vert-1) sv-188 (-> obj bounds)) + (vector+! (-> arg5 vert-0) sv-184 (-> this bounds)) + (vector+! (-> arg5 vert-1) sv-188 (-> this bounds)) ) (set! (-> sv-96 dest-pos quad) (-> sv-96 current-pos quad)) (cond @@ -2043,7 +2049,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 22 of type nav-control -(defmethod find-first-sphere-and-update-avoid-params nav-control ((obj nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) +(defmethod find-first-sphere-and-update-avoid-params nav-control ((this nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -2052,12 +2058,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf3 :class vf) ) (init-vf0-vector) - (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root-nav-sphere) (-> obj state mesh bounds))) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this root-nav-sphere) (-> this state mesh bounds))) (f30-0 -1.0) ) (let ((s3-0 -1)) - (countdown (s1-0 (-> obj sphere-count)) - (let* ((s0-0 (-> obj sphere-array s1-0)) + (countdown (s1-0 (-> this sphere-count)) + (let* ((s0-0 (-> this sphere-array s1-0)) (f0-2 (ray-circle-intersect s2-1 arg0 s0-0 (+ -409.6 (-> s0-0 r)))) ) (when (>= f0-2 0.0) @@ -2076,11 +2082,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (when arg1 (set! (-> arg1 current-pos x) f30-0) (when (>= f30-0 0.0) - (vector+float*! (-> arg1 travel) (-> obj root-nav-sphere) arg0 f30-0) - (let ((a0-9 (-> obj sphere-array s3-0)) + (vector+float*! (-> arg1 travel) (-> this root-nav-sphere) arg0 f30-0) + (let ((a0-9 (-> this sphere-array s3-0)) (v1-19 (new 'stack-no-clear 'vector)) ) - (vector+! v1-19 (the-as vector a0-9) (-> obj state mesh bounds)) + (vector+! v1-19 (the-as vector a0-9) (-> this state mesh bounds)) (vector-! (-> arg1 pref-dir) (-> arg1 travel) v1-19) ) (set! (-> arg1 pref-dir w) 1.0) @@ -2112,89 +2118,89 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 24 of type nav-control -(defmethod add-root-sphere-to-hash! nav-control ((obj nav-control) (arg0 vector) (arg1 int)) +(defmethod add-root-sphere-to-hash! nav-control ((this nav-control) (arg0 vector) (arg1 int)) "Add our root sphere to the hash (if enabled with output-sphere-hash flag) at the given location." - (if (logtest? (-> obj flags) (nav-control-flag output-sphere-hash)) + (if (logtest? (-> this flags) (nav-control-flag output-sphere-hash)) (add-sphere-with-mask-and-id - (-> obj state mesh sphere-hash) + (-> this state mesh sphere-hash) arg0 (logand arg1 255) - (the-as int (-> obj root-sphere-id)) + (the-as int (-> this root-sphere-id)) ) ) ) ;; definition for method 47 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod reset! nav-state ((obj nav-state) (arg0 nav-control)) - (set! (-> obj nav) arg0) - (set! (-> obj flags) (nav-state-flag)) - (set! (-> obj current-poly) #f) - (set! (-> obj next-poly) #f) - (set! (-> obj target-poly) #f) - (set! (-> obj user-poly) #f) +(defmethod reset! nav-state ((this nav-state) (arg0 nav-control)) + (set! (-> this nav) arg0) + (set! (-> this flags) (nav-state-flag)) + (set! (-> this current-poly) #f) + (set! (-> this next-poly) #f) + (set! (-> this target-poly) #f) + (set! (-> this user-poly) #f) 0 (none) ) ;; definition for method 7 of type nav-state -(defmethod relocate nav-state ((obj nav-state) (arg0 int)) +(defmethod relocate nav-state ((this nav-state) (arg0 int)) (break!) - (&+! (-> obj nav) arg0) - obj + (&+! (-> this nav) arg0) + this ) ;; definition for method 12 of type nav-state ;; INFO: Used lq/sq -(defmethod get-velocity nav-state ((obj nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> obj velocity quad)) +(defmethod get-velocity nav-state ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this velocity quad)) arg0 ) ;; definition for method 14 of type nav-state ;; INFO: Used lq/sq -(defmethod get-heading nav-state ((obj nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> obj heading quad)) +(defmethod get-heading nav-state ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this heading quad)) arg0 ) ;; definition for method 15 of type nav-state ;; INFO: Used lq/sq -(defmethod get-target-post nav-state ((obj nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> obj target-post quad)) +(defmethod get-target-post nav-state ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this target-post quad)) arg0 ) ;; definition for method 19 of type nav-state -(defmethod get-current-poly nav-state ((obj nav-state)) +(defmethod get-current-poly nav-state ((this nav-state)) "@returns `current-poly`" - (-> obj current-poly) + (-> this current-poly) ) ;; definition for method 16 of type nav-state -(defmethod get-speed nav-state ((obj nav-state)) +(defmethod get-speed nav-state ((this nav-state)) "@returns `speed`" - (-> obj speed) + (-> this speed) ) ;; definition for method 17 of type nav-state -(defmethod get-rotation-rate nav-state ((obj nav-state)) +(defmethod get-rotation-rate nav-state ((this nav-state)) "@returns `rotation-rate`" - (-> obj rotation-rate) + (-> this rotation-rate) ) ;; definition for method 13 of type nav-state ;; INFO: Used lq/sq -(defmethod get-travel nav-state ((obj nav-state) (arg0 vector)) - (set! (-> arg0 quad) (-> obj travel quad)) +(defmethod get-travel nav-state ((this nav-state) (arg0 vector)) + (set! (-> arg0 quad) (-> this travel quad)) arg0 ) ;; definition for method 44 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-velocity! nav-state ((obj nav-state) (velocity vector)) - (set! (-> obj velocity quad) (-> velocity quad)) +(defmethod set-velocity! nav-state ((this nav-state) (velocity vector)) + (set! (-> this velocity quad) (-> velocity quad)) 0 (none) ) @@ -2202,16 +2208,16 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 45 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-heading! nav-state ((obj nav-state) (arg0 vector)) - (set! (-> obj heading quad) (-> arg0 quad)) +(defmethod set-heading! nav-state ((this nav-state) (arg0 vector)) + (set! (-> this heading quad) (-> arg0 quad)) 0 (none) ) ;; definition for method 46 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod set-speed! nav-state ((obj nav-state) (arg0 meters)) - (set! (-> obj speed) arg0) +(defmethod set-speed! nav-state ((this nav-state) (arg0 meters)) + (set! (-> this speed) arg0) 0 (none) ) @@ -2219,10 +2225,10 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 42 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-target-post! nav-state ((obj nav-state) (arg0 vector)) - (logclear! (-> obj flags) (nav-state-flag directional-mode)) - (logior! (-> obj flags) (nav-state-flag target-poly-dirty)) - (set! (-> obj target-post quad) (-> arg0 quad)) +(defmethod set-target-post! nav-state ((this nav-state) (arg0 vector)) + (logclear! (-> this flags) (nav-state-flag directional-mode)) + (logior! (-> this flags) (nav-state-flag target-poly-dirty)) + (set! (-> this target-post quad) (-> arg0 quad)) 0 (none) ) @@ -2230,25 +2236,25 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 43 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-travel! nav-state ((obj nav-state) (arg0 vector)) - (logior! (-> obj flags) (nav-state-flag directional-mode)) - (set! (-> obj travel quad) (-> arg0 quad)) +(defmethod set-travel! nav-state ((this nav-state) (arg0 vector)) + (logior! (-> this flags) (nav-state-flag directional-mode)) + (set! (-> this travel quad) (-> arg0 quad)) 0 (none) ) ;; definition for method 20 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod copy-nav-state! nav-state ((obj nav-state) (arg0 (pointer nav-state))) +(defmethod copy-nav-state! nav-state ((this nav-state) (arg0 (pointer nav-state))) "Copies the [[nav-state]] the given pointer points to into the current object" - (mem-copy! (the-as pointer obj) arg0 176) + (mem-copy! (the-as pointer this) arg0 176) 0 (none) ) ;; definition for method 10 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod nav-state-method-10 nav-state ((obj nav-state)) +(defmethod nav-state-method-10 nav-state ((this nav-state)) 0 (none) ) @@ -2256,34 +2262,34 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 9 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw nav-state ((obj nav-state)) - (let ((s5-0 (-> obj mesh))) - (if (-> obj next-poly) - (debug-draw-poly s5-0 (-> obj next-poly) *color-cyan*) +(defmethod debug-draw nav-state ((this nav-state)) + (let ((s5-0 (-> this mesh))) + (if (-> this next-poly) + (debug-draw-poly s5-0 (-> this next-poly) *color-cyan*) ) - (if (-> obj target-poly) - (debug-draw-poly s5-0 (-> obj target-poly) *color-yellow*) + (if (-> this target-poly) + (debug-draw-poly s5-0 (-> this target-poly) *color-yellow*) ) - (if (-> obj current-poly) - (debug-draw-poly s5-0 (-> obj current-poly) *color-red*) + (if (-> this current-poly) + (debug-draw-poly s5-0 (-> this current-poly) *color-red*) ) ) - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj target-post) *color-yellow*) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this target-post) *color-yellow*) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj current-pos) - (-> obj travel) + (-> this current-pos) + (-> this travel) (meters 0.00024414062) *color-white* ) (let ((s5-1 (new 'stack-no-clear 'vector))) 0.0 - (-> obj mesh work debug) - (set! (-> s5-1 quad) (-> obj current-pos quad)) + (-> this mesh work debug) + (set! (-> s5-1 quad) (-> this current-pos quad)) (let ((f30-0 (-> s5-1 y))) (set! (-> s5-1 y) (+ 2048.0 f30-0)) - (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-1 (-> obj heading) (meters 1) *color-yellow*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) s5-1 (-> this heading) (meters 1) *color-yellow*) (set! (-> s5-1 y) (+ 4096.0 f30-0)) ) ) @@ -2291,7 +2297,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (add-debug-x #t (bucket-id debug-no-zbuf1) - (vector+! (new 'stack-no-clear 'vector) (-> obj current-pos) (-> obj travel)) + (vector+! (new 'stack-no-clear 'vector) (-> this current-pos) (-> this travel)) *color-white* ) 0 @@ -2300,19 +2306,19 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 38 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod set-current-poly! nav-state ((obj nav-state) (arg0 nav-poly)) - (set! (-> obj current-poly) arg0) +(defmethod set-current-poly! nav-state ((this nav-state) (arg0 nav-poly)) + (set! (-> this current-poly) arg0) 0 (none) ) ;; definition for method 41 of type nav-state -(defmethod clamp-vector-to-mesh-cross-gaps nav-state ((obj nav-state) (arg0 vector)) - (when (-> obj current-poly) +(defmethod clamp-vector-to-mesh-cross-gaps nav-state ((this nav-state) (arg0 vector)) + (when (-> this current-poly) (clamp-vector-to-mesh-cross-gaps - (-> obj nav) - (-> obj current-pos) - (-> obj current-poly) + (-> this nav) + (-> this current-pos) + (-> this current-poly) arg0 204.8 #f @@ -2325,7 +2331,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 40 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-navigation-to-destination nav-state ((obj nav-state) (arg0 vector)) +(defmethod do-navigation-to-destination nav-state ((this nav-state) (arg0 vector)) (local-vars (v1-15 symbol)) (rlet ((acc :class vf) (Q :class vf) @@ -2336,17 +2342,17 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (init-vf0-vector) (cond - ((-> obj current-poly) - (let ((s3-0 (-> obj mesh)) + ((-> this current-poly) + (let ((s3-0 (-> this mesh)) (s4-0 (new 'stack-no-clear 'nav-ray)) ) (let ((s2-0 0)) - (set! (-> s4-0 current-poly) (-> obj current-poly)) - (vector-! (-> s4-0 current-pos) (-> obj current-pos) (-> s3-0 bounds)) + (set! (-> s4-0 current-poly) (-> this current-poly)) + (vector-! (-> s4-0 current-pos) (-> this current-pos) (-> s3-0 bounds)) (vector-! (-> s4-0 dest-pos) arg0 (-> s3-0 bounds)) - (b! (not (point-in-poly? s3-0 (-> obj current-poly) (-> s4-0 dest-pos))) cfg-3 :delay (empty-form)) - (logior! (-> obj flags) (nav-state-flag in-mesh)) - (set! (-> obj current-pos quad) (-> arg0 quad)) + (b! (not (point-in-poly? s3-0 (-> this current-poly) (-> s4-0 dest-pos))) cfg-3 :delay (empty-form)) + (logior! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) (b! #t cfg-17 :delay (nop!)) (label cfg-3) (let ((v1-10 s4-0)) @@ -2388,26 +2394,26 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (set! v1-15 (or (>= s2-0 15) (-> s4-0 terminated))) ) ) - (set! (-> obj current-poly) (-> s4-0 current-poly)) + (set! (-> this current-poly) (-> s4-0 current-poly)) (when (-> s4-0 reached-dest) - (if (not (point-in-poly? s3-0 (-> obj current-poly) (-> s4-0 dest-pos))) + (if (not (point-in-poly? s3-0 (-> this current-poly) (-> s4-0 dest-pos))) (set! (-> s4-0 reached-dest) #f) ) ) (cond ((-> s4-0 reached-dest) - (logior! (-> obj flags) (nav-state-flag in-mesh)) - (set! (-> obj current-pos quad) (-> arg0 quad)) + (logior! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) ) (else - (logclear! (-> obj flags) (nav-state-flag in-mesh)) - (set! (-> obj current-pos quad) (-> arg0 quad)) + (logclear! (-> this flags) (nav-state-flag in-mesh)) + (set! (-> this current-pos quad) (-> arg0 quad)) (let ((s4-1 (new 'stack 'nav-find-poly-parms))) - (vector-! (-> s4-1 point) arg0 (-> obj mesh bounds)) - (set! (-> s4-1 y-threshold) (-> obj nav nearest-y-threshold)) + (vector-! (-> s4-1 point) arg0 (-> this mesh bounds)) + (set! (-> s4-1 y-threshold) (-> this nav nearest-y-threshold)) (set! (-> s4-1 ignore) (the-as uint 1)) - (find-nearest-poly-to-point-local (-> obj mesh) s4-1) - (set! (-> obj current-poly) (-> s4-1 poly)) + (find-nearest-poly-to-point-local (-> this mesh) s4-1) + (set! (-> this current-poly) (-> s4-1 poly)) ) 0 ) @@ -2415,16 +2421,16 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) (else - (set! (-> obj current-pos quad) (-> arg0 quad)) + (set! (-> this current-pos quad) (-> arg0 quad)) (let ((s4-2 (new 'stack 'nav-find-poly-parms))) - (vector-! (-> s4-2 point) arg0 (-> obj mesh bounds)) - (set! (-> s4-2 y-threshold) (-> obj nav nearest-y-threshold)) + (vector-! (-> s4-2 point) arg0 (-> this mesh bounds)) + (set! (-> s4-2 y-threshold) (-> this nav nearest-y-threshold)) (set! (-> s4-2 ignore) (the-as uint 1)) - (find-nearest-poly-to-point-local (-> obj mesh) s4-2) - (set! (-> obj current-poly) (-> s4-2 poly)) - (logclear! (-> obj flags) (nav-state-flag in-mesh)) + (find-nearest-poly-to-point-local (-> this mesh) s4-2) + (set! (-> this current-poly) (-> s4-2 poly)) + (logclear! (-> this flags) (nav-state-flag in-mesh)) (if (-> s4-2 point-inside?) - (logior! (-> obj flags) (nav-state-flag in-mesh)) + (logior! (-> this flags) (nav-state-flag in-mesh)) ) ) ) @@ -2436,11 +2442,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ;; definition for method 18 of type nav-state -(defmethod try-projecting-to-current-poly nav-state ((obj nav-state) (arg0 vector) (arg1 object) (arg2 vector)) +(defmethod try-projecting-to-current-poly nav-state ((this nav-state) (arg0 vector) (arg1 object) (arg2 vector)) (cond - ((-> obj current-poly) - (let ((s5-0 (-> obj nav)) - (v1-1 (-> obj current-poly)) + ((-> this current-poly) + (let ((s5-0 (-> this nav)) + (v1-1 (-> this current-poly)) (gp-0 arg0) ) (let ((t1-0 arg1) @@ -2467,7 +2473,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 20 of type nav-control ;; WARN: Return type mismatch int vs none. -(defmethod clamp-vector-to-mesh-cross-gaps nav-control ((obj nav-control) +(defmethod clamp-vector-to-mesh-cross-gaps nav-control ((this nav-control) (arg0 vector) (arg1 nav-poly) (arg2 vector) @@ -2476,27 +2482,27 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (arg5 clamp-travel-vector-to-mesh-return-info) ) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj state mesh bounds)) - (clamp-vector-to-mesh-cross-gaps (-> obj state mesh) v1-0 arg1 arg2 arg3 arg4 arg5) + (vector-! v1-0 arg0 (-> this state mesh bounds)) + (clamp-vector-to-mesh-cross-gaps (-> this state mesh) v1-0 arg1 arg2 arg3 arg4 arg5) ) 0 (none) ) ;; definition for method 12 of type nav-control -(defmethod cloest-point-on-mesh nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) +(defmethod cloest-point-on-mesh nav-control ((this nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) (local-vars (sv-16 vector)) (set! sv-16 arg0) (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) (set! (-> gp-0 poly) arg2) - (vector-! (-> gp-0 point) arg1 (-> obj state mesh bounds)) - (when (or (not (-> gp-0 poly)) (not (point-in-poly? (-> obj state mesh) (-> gp-0 poly) (-> gp-0 point)))) - (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> gp-0 point) arg1 (-> this state mesh bounds)) + (when (or (not (-> gp-0 poly)) (not (point-in-poly? (-> this state mesh) (-> gp-0 poly) (-> gp-0 point)))) + (set! (-> gp-0 y-threshold) (-> this nearest-y-threshold)) (set! (-> gp-0 ignore) (the-as uint 3)) - (find-nearest-poly-to-point-local (-> obj state mesh) gp-0) + (find-nearest-poly-to-point-local (-> this state mesh) gp-0) (when (-> gp-0 poly) - (project-point-into-poly-2d (-> obj state mesh) (-> gp-0 poly) sv-16 (-> gp-0 point)) - (vector+! sv-16 sv-16 (-> obj state mesh bounds)) + (project-point-into-poly-2d (-> this state mesh) (-> gp-0 poly) sv-16 (-> gp-0 point)) + (vector+! sv-16 sv-16 (-> this state mesh bounds)) ) ) (-> gp-0 poly) @@ -2520,7 +2526,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 50 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod nav-state-method-50 nav-state ((obj nav-state)) +(defmethod nav-state-method-50 nav-state ((this nav-state)) 0 (none) ) @@ -2588,7 +2594,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 51 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-route-portals nav-state ((obj nav-state)) +(defmethod navigate-using-route-portals nav-state ((this nav-state)) (local-vars (v1-117 float) (sv-112 vector) @@ -2602,56 +2608,56 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf2 :class vf) ) (init-vf0-vector) - (set! (-> obj virtual-current-poly) (-> obj current-poly)) + (set! (-> this virtual-current-poly) (-> this current-poly)) (set! sv-112 (new 'stack-no-clear 'vector)) (set! sv-116 (new 'stack-no-clear 'nav-route-portal)) (set! sv-120 (new 'stack-no-clear 'inline-array 'vector 2)) (set! sv-124 (the-as symbol #f)) - (vector-! (-> obj current-pos-local) (-> obj current-pos) (-> obj mesh bounds)) - (set! (-> obj virtual-current-pos-local quad) (-> obj current-pos-local quad)) + (vector-! (-> this current-pos-local) (-> this current-pos) (-> this mesh bounds)) + (set! (-> this virtual-current-pos-local quad) (-> this current-pos-local quad)) (set! (-> sv-116 next-poly) #f) - (when (not (logtest? (-> obj flags) (nav-state-flag directional-mode))) + (when (not (logtest? (-> this flags) (nav-state-flag directional-mode))) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (new 'stack-no-clear 'nav-find-poly-parms))) - (vector-! s5-0 (-> obj target-post) (-> obj mesh bounds)) - (when (or (logtest? (-> obj flags) (nav-state-flag target-poly-dirty)) (not (-> obj target-poly))) + (vector-! s5-0 (-> this target-post) (-> this mesh bounds)) + (when (or (logtest? (-> this flags) (nav-state-flag target-poly-dirty)) (not (-> this target-poly))) (set! (-> s4-0 point quad) (-> s5-0 quad)) - (set! (-> s4-0 y-threshold) (-> obj nav nearest-y-threshold)) + (set! (-> s4-0 y-threshold) (-> this nav nearest-y-threshold)) (set! (-> s4-0 ignore) (the-as uint 3)) - (find-nearest-poly-to-point-local (-> obj mesh) s4-0) - (set! (-> obj target-poly) (-> s4-0 poly)) - (if (not (-> obj target-poly)) - (set! (-> obj target-poly) (-> obj current-poly)) + (find-nearest-poly-to-point-local (-> this mesh) s4-0) + (set! (-> this target-poly) (-> s4-0 poly)) + (if (not (-> this target-poly)) + (set! (-> this target-poly) (-> this current-poly)) ) - (logclear! (-> obj flags) (nav-state-flag target-poly-dirty)) + (logclear! (-> this flags) (nav-state-flag target-poly-dirty)) ) ) - (project-point-into-poly-2d (-> obj mesh) (-> obj target-poly) sv-112 s5-0) + (project-point-into-poly-2d (-> this mesh) (-> this target-poly) sv-112 s5-0) ) - (set! (-> sv-112 y) (-> obj current-pos-local y)) - (vector-! (-> obj travel) sv-112 (-> obj current-pos-local)) - (set! (-> obj travel y) 0.0) - (let* ((v1-32 (-> obj travel)) + (set! (-> sv-112 y) (-> this current-pos-local y)) + (vector-! (-> this travel) sv-112 (-> this current-pos-local)) + (set! (-> this travel y) 0.0) + (let* ((v1-32 (-> this travel)) (f0-6 (+ (* (-> v1-32 x) (-> v1-32 x)) (* (-> v1-32 z) (-> v1-32 z)))) (f1-3 4096.0) ) (if (< f0-6 (* f1-3 f1-3)) - (logior! (-> obj flags) (nav-state-flag at-target)) + (logior! (-> this flags) (nav-state-flag at-target)) ) ) - (get-route-portal (-> obj mesh) (-> obj current-poly) (-> obj target-poly) sv-116) + (get-route-portal (-> this mesh) (-> this current-poly) (-> this target-poly) sv-116) ) (cond ((not (-> sv-116 next-poly)) - (set! (-> obj next-poly) #f) + (set! (-> this next-poly) #f) ) (else - (set! (-> obj next-poly) (-> sv-116 next-poly)) + (set! (-> this next-poly) (-> sv-116 next-poly)) (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) (set! sv-124 #t) (while (and sv-124 (-> sv-116 next-poly) (test-xz-point-on-line-segment? - (-> obj current-pos-local) + (-> this current-pos-local) (the-as vector (-> sv-116 vertex)) (-> sv-116 vertex 1) 409.59998 @@ -2660,25 +2666,25 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (when #t #t (vector-segment-distance-point! - (-> obj current-pos-local) + (-> this current-pos-local) (the-as vector (-> sv-116 vertex)) (-> sv-116 vertex 1) - (-> obj virtual-current-pos-local) + (-> this virtual-current-pos-local) ) - (vector-! (-> obj travel) sv-112 (-> obj virtual-current-pos-local)) - (set! (-> obj travel y) 0.0) + (vector-! (-> this travel) sv-112 (-> this virtual-current-pos-local)) + (set! (-> this travel y) 0.0) 0 ) - (set! (-> obj virtual-current-poly) (-> sv-116 next-poly)) + (set! (-> this virtual-current-poly) (-> sv-116 next-poly)) (cond - ((get-route-portal (-> obj mesh) (-> sv-116 next-poly) (-> obj target-poly) sv-116) - (set! (-> obj next-poly) (-> sv-116 next-poly)) + ((get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) sv-116) + (set! (-> this next-poly) (-> sv-116 next-poly)) (set! (-> sv-120 0 quad) (-> sv-116 vertex 0 quad)) (set! (-> sv-120 1 quad) (-> sv-116 vertex 1 quad)) 0 ) (else - (set! (-> obj next-poly) #f) + (set! (-> this next-poly) #f) (set! sv-124 (the-as symbol #f)) ) ) @@ -2693,8 +2699,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vector-! (-> sv-120 1) (-> sv-120 1) (the-as vector (-> s5-1 vector))) ) (when (not (ray-ccw-line-segment-intersection? - (-> obj virtual-current-pos-local) - (-> obj travel) + (-> this virtual-current-pos-local) + (-> this travel) (-> sv-120 0) (-> sv-120 1) ) @@ -2703,12 +2709,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (let* ((f0-8 (cos 8192.0)) (f0-10 (* f0-8 f0-8)) (v1-93 (new 'stack-no-clear 'vector)) - (a0-39 (-> obj travel)) + (a0-39 (-> this travel)) (f1-9 (+ (* (-> a0-39 x) (-> a0-39 x)) (* (-> a0-39 z) (-> a0-39 z)))) ) (countdown (a0-41 2) - (vector-! v1-93 (-> sv-120 a0-41) (-> obj virtual-current-pos-local)) - (let ((f2-5 (vector-dot (-> obj travel) v1-93))) + (vector-! v1-93 (-> sv-120 a0-41) (-> this virtual-current-pos-local)) + (let ((f2-5 (vector-dot (-> this travel) v1-93))) (when (< 0.0 f2-5) (let* ((f2-7 (* f2-5 f2-5)) (a1-26 v1-93) @@ -2728,7 +2734,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (s3-0 (new 'stack-no-clear 'nav-route-portal)) (s4-1 (new 'stack-no-clear 'vector)) ) - (get-route-portal (-> obj mesh) (-> sv-116 next-poly) (-> obj target-poly) s3-0) + (get-route-portal (-> this mesh) (-> sv-116 next-poly) (-> this target-poly) s3-0) (cond ((-> s3-0 next-poly) (vector+! s4-1 (the-as vector (-> s3-0 vertex)) (the-as vector (-> s3-0 vertex 1))) @@ -2740,7 +2746,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (countdown (s3-1 2) (let* ((s2-0 (-> sv-120 s3-1)) - (f0-13 (+ (vector-vector-xz-distance-squared (-> obj virtual-current-pos-local) s2-0) + (f0-13 (+ (vector-vector-xz-distance-squared (-> this virtual-current-pos-local) s2-0) (vector-vector-xz-distance-squared s4-1 s2-0) ) ) @@ -2753,12 +2759,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) ) - (vector-! (-> obj travel) (-> sv-120 s5-2) (-> obj virtual-current-pos-local)) + (vector-! (-> this travel) (-> sv-120 s5-2) (-> this virtual-current-pos-local)) ) - (set! (-> obj travel y) 0.0) + (set! (-> this travel y) 0.0) ) ) - (.lvf vf1 (&-> (-> obj travel) quad)) + (.lvf vf1 (&-> (-> this travel) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -2766,10 +2772,10 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-117 vf1) (let ((f0-15 v1-117) - (f1-10 (-> obj nav nav-cull-radius)) + (f1-10 (-> this nav nav-cull-radius)) ) (if (< (* f1-10 f1-10) f0-15) - (vector-float*! (-> obj travel) (-> obj travel) (/ (-> obj nav nav-cull-radius) (sqrtf f0-15))) + (vector-float*! (-> this travel) (-> this travel) (/ (-> this nav nav-cull-radius) (sqrtf f0-15))) ) ) 0 @@ -2852,7 +2858,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 124 signed mismatch ;; WARN: Stack slot offset 128 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-best-dir-use-existing-avoid-spheres nav-state ((obj nav-state) (arg0 nav-avoid-spheres-params)) +(defmethod navigate-using-best-dir-use-existing-avoid-spheres nav-state ((this nav-state) (arg0 nav-avoid-spheres-params)) (local-vars (sv-96 int) (sv-104 nav-mesh-work) @@ -2877,19 +2883,19 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (init-vf0-vector) (when (-> arg0 avoiding-sphere?) - (logior! (-> obj flags) (nav-state-flag avoiding-sphere)) + (logior! (-> this flags) (nav-state-flag avoiding-sphere)) (let ((f0-0 (-> arg0 closest-sphere-dist2)) (f1-0 512.0) ) (if (< f0-0 (* f1-0 f1-0)) - (logior! (-> obj flags) (nav-state-flag touching-sphere)) + (logior! (-> this flags) (nav-state-flag touching-sphere)) ) ) - (set! (-> obj travel quad) (-> arg0 out-travel 0 quad)) + (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) (let ((v1-10 (new 'stack-no-clear 'nav-ray))) - (set! (-> v1-10 current-pos quad) (-> obj virtual-current-pos-local quad)) - (set! (-> v1-10 current-poly) (-> obj virtual-current-poly)) - (vector+! (-> v1-10 dest-pos) (-> obj virtual-current-pos-local) (-> obj travel)) + (set! (-> v1-10 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> v1-10 current-poly) (-> this virtual-current-poly)) + (vector+! (-> v1-10 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) (let ((a2-5 0)) (let ((a3-3 v1-10)) (vector-! (-> a3-3 dir) (-> a3-3 dest-pos) (-> a3-3 current-pos)) @@ -2925,7 +2931,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr 0 (until (or (>= a2-5 15) (-> v1-10 terminated)) (+! a2-5 1) - (let ((t0-6 (-> obj mesh)) + (let ((t0-6 (-> this mesh)) (a3-5 v1-10) ) (set! sv-96 -1) @@ -2997,11 +3003,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (cond ((or (-> v1-10 reached-dest) (-> v1-10 hit-gap) (>= (-> v1-10 len) 4096.0)) - (set! (-> obj travel quad) (-> arg0 out-travel 0 quad)) + (set! (-> this travel quad) (-> arg0 out-travel 0 quad)) ) (else - (set! (-> obj travel quad) (-> arg0 out-travel 1 quad)) - (logior! (-> obj flags) (nav-state-flag trapped-by-sphere)) + (set! (-> this travel quad) (-> arg0 out-travel 1 quad)) + (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) ) ) ) @@ -3086,7 +3092,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 220 signed mismatch ;; WARN: Stack slot offset 224 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 nav-state ((obj nav-state)) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1 nav-state ((this nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) @@ -3111,30 +3117,30 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (set! (-> s5-0 current-pos quad) (-> obj virtual-current-pos-local quad)) - (set! (-> s5-0 travel quad) (-> obj travel quad)) - (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> obj flags) (nav-state-flag trapped-by-sphere)) - (-> obj heading) - (-> obj travel) + (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> this travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) ) quad ) ) - (avoid-spheres-1! (-> obj nav) s5-0) + (avoid-spheres-1! (-> this nav) s5-0) (when (-> s5-0 avoiding-sphere?) - (logior! (-> obj flags) (nav-state-flag avoiding-sphere)) + (logior! (-> this flags) (nav-state-flag avoiding-sphere)) (let ((f0-0 (-> s5-0 closest-sphere-dist2)) (f1-0 512.0) ) (if (< f0-0 (* f1-0 f1-0)) - (logior! (-> obj flags) (nav-state-flag touching-sphere)) + (logior! (-> this flags) (nav-state-flag touching-sphere)) ) ) - (set! (-> obj travel quad) (-> s5-0 out-travel 0 quad)) + (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) (let ((v1-15 (new 'stack-no-clear 'nav-ray))) - (set! (-> v1-15 current-pos quad) (-> obj virtual-current-pos-local quad)) - (set! (-> v1-15 current-poly) (-> obj virtual-current-poly)) - (vector+! (-> v1-15 dest-pos) (-> obj virtual-current-pos-local) (-> obj travel)) + (set! (-> v1-15 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> v1-15 current-poly) (-> this virtual-current-poly)) + (vector+! (-> v1-15 dest-pos) (-> this virtual-current-pos-local) (-> this travel)) (let ((a0-15 0)) (let ((a1-4 v1-15)) (vector-! (-> a1-4 dir) (-> a1-4 dest-pos) (-> a1-4 current-pos)) @@ -3170,7 +3176,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr 0 (until (or (>= a0-15 15) (-> v1-15 terminated)) (+! a0-15 1) - (let ((a2-6 (-> obj mesh)) + (let ((a2-6 (-> this mesh)) (a1-6 v1-15) ) (set! sv-192 -1) @@ -3242,11 +3248,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (cond ((or (-> v1-15 reached-dest) (-> v1-15 hit-gap) (>= (-> v1-15 len) 4096.0)) - (set! (-> obj travel quad) (-> s5-0 out-travel 0 quad)) + (set! (-> this travel quad) (-> s5-0 out-travel 0 quad)) ) (else - (set! (-> obj travel quad) (-> s5-0 out-travel 1 quad)) - (logior! (-> obj flags) (nav-state-flag trapped-by-sphere)) + (set! (-> this travel quad) (-> s5-0 out-travel 1 quad)) + (logior! (-> this flags) (nav-state-flag trapped-by-sphere)) ) ) ) @@ -3261,7 +3267,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 53 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod navigate-within-poly nav-state ((obj nav-state)) +(defmethod navigate-within-poly nav-state ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3270,8 +3276,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf3 :class vf) ) (init-vf0-vector) - (set! (-> obj target-dir quad) (-> obj travel quad)) - (let ((v1-1 (-> obj target-dir))) + (set! (-> this target-dir quad) (-> this travel quad)) + (let ((v1-1 (-> this target-dir))) (let ((f0-0 1.0)) (.lvf vf1 (&-> v1-1 quad)) (.mul.vf vf2 vf1 vf1 :mask #b111) @@ -3291,16 +3297,16 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (.svf (&-> v1-1 quad) vf1) ) (cond - ((logtest? (-> obj nav flags) (nav-control-flag limit-rotation-rate)) - (let ((s5-0 (nav-state-method-39 obj))) + ((logtest? (-> this nav flags) (nav-control-flag limit-rotation-rate)) + (let ((s5-0 (nav-state-method-39 this))) (let* ((f0-1 40.96) (f0-3 (* f0-1 f0-1)) - (v1-8 (-> obj travel)) + (v1-8 (-> this travel)) ) (when (< f0-3 (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) - (set! (-> obj heading quad) (-> obj travel quad)) - (set! (-> obj heading y) 0.0) - (let ((v1-12 (-> obj heading))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-12 (-> this heading))) (let ((f0-5 1.0)) (.lvf vf1 (&-> v1-12 quad)) (.mul.vf vf2 vf1 vf1 :mask #b111) @@ -3321,15 +3327,18 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) ) - (let ((f0-6 - (find-first-sphere-and-update-avoid-params (-> obj nav) (-> obj travel) (the-as nav-avoid-spheres-params #f)) - ) + (let ((f0-6 (find-first-sphere-and-update-avoid-params + (-> this nav) + (-> this travel) + (the-as nav-avoid-spheres-params #f) + ) + ) ) (when (>= f0-6 0.0) - (vector-float*! (-> obj travel) (-> obj travel) f0-6) - (let ((f0-7 (* f0-6 (-> obj nav nav-cull-radius)))) + (vector-float*! (-> this travel) (-> this travel) f0-6) + (let ((f0-7 (* f0-6 (-> this nav nav-cull-radius)))) (if (and (not s5-0) (>= 40.96 f0-7)) - (logior! (-> obj flags) (nav-state-flag blocked)) + (logior! (-> this flags) (nav-state-flag blocked)) ) ) ) @@ -3339,12 +3348,12 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (else (let* ((f0-8 40.96) (f0-10 (* f0-8 f0-8)) - (v1-26 (-> obj travel)) + (v1-26 (-> this travel)) ) (when (< f0-10 (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))) - (set! (-> obj heading quad) (-> obj travel quad)) - (set! (-> obj heading y) 0.0) - (let ((v1-30 (-> obj heading))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-30 (-> this heading))) (let ((f0-12 1.0)) (.lvf vf1 (&-> v1-30 quad)) (.mul.vf vf2 vf1 vf1 :mask #b111) @@ -3367,8 +3376,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) ) - (if (not (logtest? (-> obj flags) (nav-state-flag touching-sphere))) - (logclear! (-> obj flags) (nav-state-flag trapped-by-sphere)) + (if (not (logtest? (-> this flags) (nav-state-flag touching-sphere))) + (logclear! (-> this flags) (nav-state-flag trapped-by-sphere)) ) 0 (none) @@ -3377,37 +3386,37 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 54 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod clamp-travel-vector nav-state ((obj nav-state)) +(defmethod clamp-travel-vector nav-state ((this nav-state)) (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-cross-gaps - (-> obj mesh) - (-> obj virtual-current-pos-local) - (-> obj virtual-current-poly) - (-> obj travel) - (-> obj mesh work nav-poly-min-dist) - (not (or (logtest? (-> obj nav flags) (nav-control-flag no-redirect-in-clamp)) - (logtest? (-> obj nav flags) (nav-control-flag limit-rotation-rate)) + (-> this mesh) + (-> this virtual-current-pos-local) + (-> this virtual-current-poly) + (-> this travel) + (-> this mesh work nav-poly-min-dist) + (not (or (logtest? (-> this nav flags) (nav-control-flag no-redirect-in-clamp)) + (logtest? (-> this nav flags) (nav-control-flag limit-rotation-rate)) ) ) s5-0 ) (when (-> s5-0 gap-poly) - (set! (-> obj next-poly) (-> s5-0 gap-poly)) - (let* ((v1-12 (-> obj travel)) + (set! (-> this next-poly) (-> s5-0 gap-poly)) + (let* ((v1-12 (-> this travel)) (f0-4 (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) (f1-3 1024.0) ) (if (< f0-4 (* f1-3 f1-3)) - (logior! (-> obj flags) (nav-state-flag at-gap)) + (logior! (-> this flags) (nav-state-flag at-gap)) ) ) ) ) (let ((v1-19 (new 'stack-no-clear 'vector))) - (vector-! v1-19 (-> obj virtual-current-pos-local) (-> obj current-pos-local)) - (vector+! (-> obj travel) (-> obj travel) v1-19) + (vector-! v1-19 (-> this virtual-current-pos-local) (-> this current-pos-local)) + (vector+! (-> this travel) (-> this travel) v1-19) ) - (set! (-> obj travel y) 0.0) + (set! (-> this travel y) 0.0) 0 (none) ) @@ -3418,20 +3427,20 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch -(defmethod plan-over-pat1-polys-using-route nav-state ((obj nav-state) (arg0 nav-gap-info)) +(defmethod plan-over-pat1-polys-using-route nav-state ((this nav-state) (arg0 nav-gap-info)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) - (let ((a1-1 (-> obj next-poly))) + (let ((a1-1 (-> this next-poly))) (when (logtest? (-> a1-1 pat) 1) (while (and a1-1 (logtest? (-> a1-1 pat) 1)) - (set! a1-1 (lookup-poly-on-route-to-target (-> obj mesh) a1-1 (-> obj target-poly))) + (set! a1-1 (lookup-poly-on-route-to-target (-> this mesh) a1-1 (-> this target-poly))) ) - (when (and a1-1 (!= a1-1 (-> obj current-poly))) + (when (and a1-1 (!= a1-1 (-> this current-poly))) (set! (-> arg0 poly) a1-1) - (-> obj mesh) + (-> this mesh) (let ((s3-0 (-> arg0 poly)) (s4-0 (-> arg0 dest)) ) - (let ((s2-0 (-> obj current-pos-local))) + (let ((s2-0 (-> this current-pos-local))) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) (set! sv-56 10000000000000000000000000000000000000.0) @@ -3451,7 +3460,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (set! (-> s4-0 quad) (-> sv-52 quad)) ) - (vector+! (-> arg0 dest) (-> arg0 dest) (-> obj mesh bounds)) + (vector+! (-> arg0 dest) (-> arg0 dest) (-> this mesh bounds)) #t ) ) @@ -3461,7 +3470,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 24 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod turn-and-navigate-to-destination nav-state ((obj nav-state)) +(defmethod turn-and-navigate-to-destination nav-state ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3470,19 +3479,19 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf3 :class vf) ) (init-vf0-vector) - (set! (-> obj rotation-rate) (-> obj nav max-rotation-rate)) - (if (< 0.0 (-> obj speed)) - (set! (-> obj rotation-rate) + (set! (-> this rotation-rate) (-> this nav max-rotation-rate)) + (if (< 0.0 (-> this speed)) + (set! (-> this rotation-rate) (fmin - (-> obj rotation-rate) - (* (/ (-> obj nav turning-acceleration) (-> obj speed)) (-> obj mesh work rad-to-deg)) + (-> this rotation-rate) + (* (/ (-> this nav turning-acceleration) (-> this speed)) (-> this mesh work rad-to-deg)) ) ) ) - (when (logtest? (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (vector-z-quaternion! (-> obj heading) (-> obj nav shape quat)) - (set! (-> obj heading y) 0.0) - (let ((v1-12 (-> obj heading))) + (when (logtest? (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (vector-z-quaternion! (-> this heading) (-> this nav shape quat)) + (set! (-> this heading y) 0.0) + (let ((v1-12 (-> this heading))) (let ((f0-5 1.0)) (.lvf vf1 (&-> v1-12 quad)) (.mul.vf vf2 vf1 vf1 :mask #b111) @@ -3503,16 +3512,16 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) (let ((a1-1 (new 'stack-no-clear 'vector))) - (set! (-> a1-1 quad) (-> obj nav shape trans quad)) - (if (or (not (-> obj current-poly)) - (!= (-> obj current-pos x) (-> a1-1 x)) - (!= (-> obj current-pos z) (-> a1-1 z)) + (set! (-> a1-1 quad) (-> this nav shape trans quad)) + (if (or (not (-> this current-poly)) + (!= (-> this current-pos x) (-> a1-1 x)) + (!= (-> this current-pos z) (-> a1-1 z)) ) - (do-navigation-to-destination obj a1-1) + (do-navigation-to-destination this a1-1) ) ) (logclear! - (-> obj flags) + (-> this flags) (nav-state-flag blocked in-target-poly at-target avoiding-sphere touching-sphere at-gap) ) 0 @@ -3522,24 +3531,24 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 25 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-route-portals-wrapper nav-state ((obj nav-state)) - (navigate-using-route-portals obj) +(defmethod navigate-using-route-portals-wrapper nav-state ((this nav-state)) + (navigate-using-route-portals this) 0 (none) ) ;; definition for method 26 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper nav-state ((obj nav-state)) - (navigate-using-best-dir-recompute-avoid-spheres-1 obj) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper nav-state ((this nav-state)) + (navigate-using-best-dir-recompute-avoid-spheres-1 this) 0 (none) ) ;; definition for method 27 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod navigate-within-poly-wrapper nav-state ((obj nav-state)) - (navigate-within-poly obj) +(defmethod navigate-within-poly-wrapper nav-state ((this nav-state)) + (navigate-within-poly this) 0 (none) ) @@ -3572,9 +3581,9 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 204 signed mismatch ;; WARN: Stack slot offset 204 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod compute-travel-speed nav-state ((obj nav-state)) +(defmethod compute-travel-speed nav-state ((this nav-state)) (local-vars (sv-192 float) (sv-196 float) (sv-200 float) (sv-204 float) (sv-224 vector)) - (let ((s5-0 obj)) + (let ((s5-0 this)) (let ((s4-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-cross-gaps (-> s5-0 mesh) @@ -3608,35 +3617,35 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) 0 (cond - ((logtest? (-> obj nav flags) (nav-control-flag use-momentum)) - (set! sv-192 (-> obj nav target-speed)) - (if (not (logtest? (-> obj nav flags) (nav-control-flag momentum-ignore-heading))) - (set! sv-192 (* sv-192 (fmax 0.0 (vector-dot (-> obj heading) (-> obj target-dir))))) + ((logtest? (-> this nav flags) (nav-control-flag use-momentum)) + (set! sv-192 (-> this nav target-speed)) + (if (not (logtest? (-> this nav flags) (nav-control-flag momentum-ignore-heading))) + (set! sv-192 (* sv-192 (fmax 0.0 (vector-dot (-> this heading) (-> this target-dir))))) ) - (set! sv-196 (- sv-192 (-> obj speed))) - (set! sv-200 (* (-> obj nav sec-per-frame) (-> obj nav acceleration))) + (set! sv-196 (- sv-192 (-> this speed))) + (set! sv-200 (* (-> this nav sec-per-frame) (-> this nav acceleration))) (set! sv-204 (fmin sv-200 (fabs sv-196))) (if (< sv-196 0.0) - (set! (-> obj speed) (- (-> obj speed) sv-204)) - (+! (-> obj speed) sv-204) + (set! (-> this speed) (- (-> this speed) sv-204)) + (+! (-> this speed) sv-204) ) ) (else - (set! (-> obj speed) (-> obj nav target-speed)) + (set! (-> this speed) (-> this nav target-speed)) ) ) - (let* ((f0-22 (/ (vector-length (-> obj travel)) (-> obj nav sec-per-frame))) - (f1-18 (fmin (* (-> obj nav speed-scale) (-> obj speed)) f0-22)) + (let* ((f0-22 (/ (vector-length (-> this travel)) (-> this nav sec-per-frame))) + (f1-18 (fmin (* (-> this nav speed-scale) (-> this speed)) f0-22)) ) (set! sv-224 (new 'stack-no-clear 'vector)) - (when (< f0-22 (-> obj speed)) - (set! (-> obj prev-speed) (-> obj speed)) - (set! (-> obj speed) (/ f0-22 (-> obj nav speed-scale))) + (when (< f0-22 (-> this speed)) + (set! (-> this prev-speed) (-> this speed)) + (set! (-> this speed) (/ f0-22 (-> this nav speed-scale))) ) - (vector-normalize-copy! sv-224 (-> obj travel) f1-18) + (vector-normalize-copy! sv-224 (-> this travel) f1-18) ) - (set! (-> obj velocity x) (-> sv-224 x)) - (set! (-> obj velocity z) (-> sv-224 z)) + (set! (-> this velocity x) (-> sv-224 x)) + (set! (-> this velocity z) (-> sv-224 z)) 0 (none) ) @@ -3644,7 +3653,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 34 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod navigate-v1! nav-state ((obj nav-state)) +(defmethod navigate-v1! nav-state ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -3653,7 +3662,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf3 :class vf) ) (init-vf0-vector) - (let ((s5-0 obj)) + (let ((s5-0 this)) (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) (if (< 0.0 (-> s5-0 speed)) (set! (-> s5-0 rotation-rate) @@ -3701,9 +3710,9 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) 0 - (navigate-using-route-portals obj) + (navigate-using-route-portals this) 0 - (let* ((v1-26 (-> obj nav)) + (let* ((v1-26 (-> this nav)) (a0-13 (-> v1-26 state mesh sphere-hash sphere-array)) (a1-2 (-> v1-26 sphere-id-array)) (a2-1 (-> v1-26 state mesh bounds)) @@ -3720,11 +3729,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) 0 - (navigate-using-best-dir-recompute-avoid-spheres-1 obj) + (navigate-using-best-dir-recompute-avoid-spheres-1 this) 0 - (navigate-within-poly obj) + (navigate-within-poly this) 0 - (compute-travel-speed obj) + (compute-travel-speed this) 0 (none) ) @@ -3732,30 +3741,30 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 35 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod reset-target! nav-state ((obj nav-state)) - (vector-reset! (-> obj target-dir)) +(defmethod reset-target! nav-state ((this nav-state)) + (vector-reset! (-> this target-dir)) 0 (none) ) ;; definition for method 36 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod add-offset-to-target! nav-state ((obj nav-state) (arg0 vector)) - (vector+! (-> obj target-dir) (-> obj target-dir) arg0) +(defmethod add-offset-to-target! nav-state ((this nav-state) (arg0 vector)) + (vector+! (-> this target-dir) (-> this target-dir) arg0) 0 (none) ) ;; definition for method 29 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod nav-state-method-29 nav-state ((obj nav-state)) +(defmethod nav-state-method-29 nav-state ((this nav-state)) 0 (none) ) ;; definition for method 30 of type nav-state ;; WARN: Return type mismatch int vs none. -(defmethod nav-state-method-30 nav-state ((obj nav-state)) +(defmethod nav-state-method-30 nav-state ((this nav-state)) 0 (none) ) @@ -3835,7 +3844,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; WARN: Stack slot offset 220 signed mismatch ;; WARN: Stack slot offset 224 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 nav-state ((obj nav-state)) +(defmethod navigate-using-best-dir-recompute-avoid-spheres-2 nav-state ((this nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) @@ -3860,17 +3869,17 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (set! (-> s5-0 current-pos quad) (-> obj virtual-current-pos-local quad)) - (set! (-> s5-0 travel quad) (-> obj travel quad)) - (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> obj flags) (nav-state-flag trapped-by-sphere)) - (-> obj heading) - (-> obj travel) + (set! (-> s5-0 current-pos quad) (-> this virtual-current-pos-local quad)) + (set! (-> s5-0 travel quad) (-> this travel quad)) + (set! (-> s5-0 pref-dir quad) (-> (if (logtest? (-> this flags) (nav-state-flag trapped-by-sphere)) + (-> this heading) + (-> this travel) ) quad ) ) - (avoid-spheres-2! (-> obj nav) s5-0) - (let ((v1-5 obj)) + (avoid-spheres-2! (-> this nav) s5-0) + (let ((v1-5 this)) (when (-> s5-0 avoiding-sphere?) (logior! (-> v1-5 flags) (nav-state-flag avoiding-sphere)) (let ((f0-0 (-> s5-0 closest-sphere-dist2)) @@ -4004,8 +4013,8 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) 0 - (if (not (logtest? (-> obj flags) (nav-state-flag touching-sphere))) - (logclear! (-> obj flags) (nav-state-flag trapped-by-sphere)) + (if (not (logtest? (-> this flags) (nav-state-flag touching-sphere))) + (logclear! (-> this flags) (nav-state-flag trapped-by-sphere)) ) 0 (none) @@ -4015,7 +4024,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 32 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-travel-dir-from-spheres nav-state ((obj nav-state)) +(defmethod update-travel-dir-from-spheres nav-state ((this nav-state)) (local-vars (v1-11 float) (v1-25 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -4025,15 +4034,15 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-control-cfs-work))) (vector-reset! (-> s5-0 in-dir)) - (set! (-> s5-0 best-dir 0 quad) (-> obj travel quad)) + (set! (-> s5-0 best-dir 0 quad) (-> this travel quad)) (set! (-> s5-0 best-dir 0 y) 0.0) - (vector-normalize! (the-as vector (-> s5-0 best-dir)) (-> obj nav target-speed)) - (vector-! (-> s5-0 right-dir) (the-as vector (-> s5-0 best-dir)) (-> obj velocity)) + (vector-normalize! (the-as vector (-> s5-0 best-dir)) (-> this nav target-speed)) + (vector-! (-> s5-0 right-dir) (the-as vector (-> s5-0 best-dir)) (-> this velocity)) (vector-float*! (-> s5-0 right-dir) (-> s5-0 right-dir) 4.0) (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) - (dotimes (s4-0 (-> obj nav sphere-count)) - (let ((s3-0 (-> obj nav sphere-array s4-0))) - (vector-! (-> s5-0 right-dir) (-> obj current-pos-local) (the-as vector s3-0)) + (dotimes (s4-0 (-> this nav sphere-count)) + (let ((s3-0 (-> this nav sphere-array s4-0))) + (vector-! (-> s5-0 right-dir) (-> this current-pos-local) (the-as vector s3-0)) (.lvf vf1 (&-> (-> s5-0 right-dir) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -4043,7 +4052,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (.mov v1-11 vf1) (let ((f30-0 v1-11)) (vector-normalize! (-> s5-0 right-dir) 2.0) - (let* ((f0-4 (+ (-> obj nav root-nav-sphere w) (-> s3-0 r))) + (let* ((f0-4 (+ (-> this nav root-nav-sphere w) (-> s3-0 r))) (f1-1 (* f0-4 f0-4)) (f0-7 (fmax 0.0 (/ (- f1-1 f30-0) f1-1))) ) @@ -4053,11 +4062,11 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) (vector+! (-> s5-0 in-dir) (-> s5-0 in-dir) (-> s5-0 right-dir)) ) - (vector+! (-> obj target-dir) (-> obj target-dir) (-> s5-0 in-dir)) + (vector+! (-> this target-dir) (-> this target-dir) (-> s5-0 in-dir)) ) - (set! (-> obj target-dir y) 0.0) - (vector+float*! (-> obj velocity) (-> obj velocity) (-> obj target-dir) (-> obj nav sec-per-frame)) - (.lvf vf1 (&-> (-> obj velocity) quad)) + (set! (-> this target-dir y) 0.0) + (vector+float*! (-> this velocity) (-> this velocity) (-> this target-dir) (-> this nav sec-per-frame)) + (.lvf vf1 (&-> (-> this velocity) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -4065,13 +4074,13 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-25 vf1) (let ((f0-11 v1-25) - (f1-4 (-> obj nav target-speed)) + (f1-4 (-> this nav target-speed)) ) (if (< (* f1-4 f1-4) f0-11) - (vector-float*! (-> obj velocity) (-> obj velocity) (/ (-> obj nav target-speed) (sqrtf f0-11))) + (vector-float*! (-> this velocity) (-> this velocity) (/ (-> this nav target-speed) (sqrtf f0-11))) ) ) - (vector-float*! (-> obj travel) (-> obj velocity) (-> obj nav sec-per-frame)) + (vector-float*! (-> this travel) (-> this velocity) (-> this nav sec-per-frame)) 0 (none) ) @@ -4080,7 +4089,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 33 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod compute-speed-simple nav-state ((obj nav-state)) +(defmethod compute-speed-simple nav-state ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -4091,26 +4100,26 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-cross-gaps - (-> obj mesh) - (-> obj virtual-current-pos-local) - (-> obj virtual-current-poly) - (-> obj travel) - (-> obj mesh work nav-poly-min-dist) + (-> this mesh) + (-> this virtual-current-pos-local) + (-> this virtual-current-poly) + (-> this travel) + (-> this mesh work nav-poly-min-dist) #t s5-0 ) (if (-> s5-0 gap-poly) - (set! (-> obj next-poly) (-> s5-0 gap-poly)) + (set! (-> this next-poly) (-> s5-0 gap-poly)) ) ) (let* ((f0-1 40.96) (f0-3 (* f0-1 f0-1)) - (v1-9 (-> obj travel)) + (v1-9 (-> this travel)) ) (when (< f0-3 (+ (* (-> v1-9 x) (-> v1-9 x)) (* (-> v1-9 z) (-> v1-9 z)))) - (set! (-> obj heading quad) (-> obj travel quad)) - (set! (-> obj heading y) 0.0) - (let ((v1-13 (-> obj heading))) + (set! (-> this heading quad) (-> this travel quad)) + (set! (-> this heading y) 0.0) + (let ((v1-13 (-> this heading))) (let ((f0-5 1.0)) (.lvf vf1 (&-> v1-13 quad)) (.mul.vf vf2 vf1 vf1 :mask #b111) @@ -4131,9 +4140,9 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) ) - (vector-float*! (-> obj velocity) (-> obj travel) (/ 1.0 (-> obj nav sec-per-frame))) - (set! (-> obj speed) (vector-length (-> obj velocity))) - (vector-reset! (-> obj target-dir)) + (vector-float*! (-> this velocity) (-> this travel) (/ 1.0 (-> this nav sec-per-frame))) + (set! (-> this speed) (vector-length (-> this velocity))) + (vector-reset! (-> this target-dir)) 0 (none) ) @@ -4142,7 +4151,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ;; definition for method 37 of type nav-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod navigate-v2! nav-state ((obj nav-state)) +(defmethod navigate-v2! nav-state ((this nav-state)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -4151,7 +4160,7 @@ Note that this doesn't actually return the nav-control, but instead adds this pr (vf3 :class vf) ) (init-vf0-vector) - (let ((s5-0 obj)) + (let ((s5-0 this)) (set! (-> s5-0 rotation-rate) (-> s5-0 nav max-rotation-rate)) (if (< 0.0 (-> s5-0 speed)) (set! (-> s5-0 rotation-rate) @@ -4199,9 +4208,9 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) 0 - (navigate-using-route-portals obj) + (navigate-using-route-portals this) 0 - (let* ((v1-26 (-> obj nav)) + (let* ((v1-26 (-> this nav)) (a0-13 (-> v1-26 state mesh sphere-hash sphere-array)) (a1-2 (-> v1-26 sphere-id-array)) (a2-1 (-> v1-26 state mesh bounds)) @@ -4218,9 +4227,9 @@ Note that this doesn't actually return the nav-control, but instead adds this pr ) ) 0 - (navigate-using-best-dir-recompute-avoid-spheres-2 obj) - (update-travel-dir-from-spheres obj) - (compute-speed-simple obj) + (navigate-using-best-dir-recompute-avoid-spheres-2 this) + (update-travel-dir-from-spheres this) + (compute-speed-simple this) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-enemy-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-enemy-h_REF.gc index d9b5a1d16b..95373cb067 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-enemy-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-enemy-h_REF.gc @@ -38,119 +38,119 @@ ;; definition for method 3 of type nav-enemy-info ;; INFO: Used lq/sq -(defmethod inspect nav-enemy-info ((obj nav-enemy-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-enemy-info ((this nav-enemy-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tfact-defaults: ~A~%" (-> obj fact-defaults)) - (format #t "~1Tuse-die-falling: ~A~%" (-> obj use-die-falling)) - (format #t "~1Tuse-victory: ~A~%" (-> obj use-victory)) - (format #t "~1Tuse-jump-blocked: ~A~%" (-> obj use-jump-blocked)) - (format #t "~1Tdebug-draw-neck: ~A~%" (-> obj debug-draw-neck)) - (format #t "~1Tjump-debug-draw: ~A~%" (-> obj jump-debug-draw)) - (format #t "~1Tmove-to-ground: ~A~%" (-> obj move-to-ground)) - (format #t "~1Thover-if-no-ground: ~A~%" (-> obj hover-if-no-ground)) - (format #t "~1Tidle-anim-script: #x~X~%" (-> obj idle-anim-script)) - (format #t "~1Tidle-anim: ~D~%" (-> obj idle-anim)) - (format #t "~1Tnotice-anim: ~D~%" (-> obj notice-anim)) - (format #t "~1Thostile-anim: ~D~%" (-> obj hostile-anim)) - (format #t "~1Thit-anim: ~D~%" (-> obj hit-anim)) - (format #t "~1Tknocked-anim: ~D~%" (-> obj knocked-anim)) - (format #t "~1Tknocked-land-anim: ~D~%" (-> obj knocked-land-anim)) - (format #t "~1Tdie-anim: ~D~%" (-> obj die-anim)) - (format #t "~1Tdie-falling-anim: ~D~%" (-> obj die-falling-anim)) - (format #t "~1Tvictory-anim: ~D~%" (-> obj victory-anim)) - (format #t "~1Tjump-wind-up-anim: ~D~%" (-> obj jump-wind-up-anim)) - (format #t "~1Tjump-in-air-anim: ~D~%" (-> obj jump-in-air-anim)) - (format #t "~1Tjump-land-anim: ~D~%" (-> obj jump-land-anim)) - (format #t "~1Tneck-joint: ~D~%" (-> obj neck-joint)) - (format #t "~1Tlook-at-joint: ~D~%" (-> obj look-at-joint)) - (format #t "~1Tbullseye-joint: ~D~%" (-> obj bullseye-joint)) - (format #t "~1Tsound-hit: ~D~%" (-> obj sound-hit)) - (format #t "~1Tsound-die: ~D~%" (-> obj sound-die)) - (format #t "~1Tnotice-distance: (meters ~m)~%" (-> obj notice-distance)) - (format #t "~1Tnotice-distance-delta: (meters ~m)~%" (-> obj notice-distance-delta)) - (format #t "~1Tproximity-notice-distance: (meters ~m)~%" (-> obj proximity-notice-distance)) - (format #t "~1Tdefault-hit-points: ~D~%" (-> obj default-hit-points)) - (format #t "~1Tgnd-collide-with: ~D~%" (-> obj gnd-collide-with)) - (format #t "~1Toverlaps-others-collide-with-filter: ~D~%" (-> obj overlaps-others-collide-with-filter)) - (format #t "~1Tpenetrate-flinch: ~D~%" (-> obj penetrate-flinch)) - (format #t "~1Tpenetrate-knocked: ~D~%" (-> obj penetrate-knocked)) - (format #t "~1Tmovement-gravity: (meters ~m)~%" (-> obj movement-gravity)) - (format #t "~1Tfriction: ~f~%" (-> obj friction)) - (format #t "~1Tslip-factor: ~f~%" (-> obj slip-factor)) - (format #t "~1Tattack-shove-back: (meters ~m)~%" (-> obj attack-shove-back)) - (format #t "~1Tattack-shove-up: (meters ~m)~%" (-> obj attack-shove-up)) - (format #t "~1Tattack-mode: ~A~%" (-> obj attack-mode)) - (format #t "~1Tattack-damage: ~D~%" (-> obj attack-damage)) - (format #t "~1Trecover-gnd-collide-with: ~D~%" (-> obj recover-gnd-collide-with)) - (format #t "~1Tjump-height-min: (meters ~m)~%" (-> obj jump-height-min)) - (format #t "~1Tjump-height-factor: ~f~%" (-> obj jump-height-factor)) - (format #t "~1Tknocked-seek-ry-clamp: ~f~%" (-> obj knocked-seek-ry-clamp)) - (format #t "~1Tknocked-soft-vxz-lo: ~f~%" (-> obj knocked-soft-vxz-lo)) - (format #t "~1Tknocked-soft-vxz-hi: ~f~%" (-> obj knocked-soft-vxz-hi)) - (format #t "~1Tknocked-soft-vy-lo: ~f~%" (-> obj knocked-soft-vy-lo)) - (format #t "~1Tknocked-soft-vy-hi: ~f~%" (-> obj knocked-soft-vy-hi)) - (format #t "~1Tknocked-medium-vxz-lo: ~f~%" (-> obj knocked-medium-vxz-lo)) - (format #t "~1Tknocked-medium-vxz-hi: ~f~%" (-> obj knocked-medium-vxz-hi)) - (format #t "~1Tknocked-medium-vy-lo: ~f~%" (-> obj knocked-medium-vy-lo)) - (format #t "~1Tknocked-medium-vy-hi: ~f~%" (-> obj knocked-medium-vy-hi)) - (format #t "~1Tknocked-hard-vxz-lo: ~f~%" (-> obj knocked-hard-vxz-lo)) - (format #t "~1Tknocked-hard-vxz-hi: ~f~%" (-> obj knocked-hard-vxz-hi)) - (format #t "~1Tknocked-hard-vy-lo: ~f~%" (-> obj knocked-hard-vy-lo)) - (format #t "~1Tknocked-hard-vy-hi: ~f~%" (-> obj knocked-hard-vy-hi)) - (format #t "~1Tknocked-huge-vxz-lo: ~f~%" (-> obj knocked-huge-vxz-lo)) - (format #t "~1Tknocked-huge-vxz-hi: ~f~%" (-> obj knocked-huge-vxz-hi)) - (format #t "~1Tknocked-huge-vy-lo: ~f~%" (-> obj knocked-huge-vy-lo)) - (format #t "~1Tknocked-huge-vy-hi: ~f~%" (-> obj knocked-huge-vy-hi)) - (format #t "~1Tknocked-yellow-vxz-lo: ~f~%" (-> obj knocked-yellow-vxz-lo)) - (format #t "~1Tknocked-yellow-vxz-hi: ~f~%" (-> obj knocked-yellow-vxz-hi)) - (format #t "~1Tknocked-yellow-vy-lo: ~f~%" (-> obj knocked-yellow-vy-lo)) - (format #t "~1Tknocked-yellow-vy-hi: ~f~%" (-> obj knocked-yellow-vy-hi)) - (format #t "~1Tknocked-red-vxz-lo: ~f~%" (-> obj knocked-red-vxz-lo)) - (format #t "~1Tknocked-red-vxz-hi: ~f~%" (-> obj knocked-red-vxz-hi)) - (format #t "~1Tknocked-red-vy-lo: ~f~%" (-> obj knocked-red-vy-lo)) - (format #t "~1Tknocked-red-vy-hi: ~f~%" (-> obj knocked-red-vy-hi)) - (format #t "~1Tknocked-blue-vxz-lo: ~f~%" (-> obj knocked-blue-vxz-lo)) - (format #t "~1Tknocked-blue-vxz-hi: ~f~%" (-> obj knocked-blue-vxz-hi)) - (format #t "~1Tknocked-blue-vy-lo: ~f~%" (-> obj knocked-blue-vy-lo)) - (format #t "~1Tknocked-blue-vy-hi: ~f~%" (-> obj knocked-blue-vy-hi)) - (format #t "~1Tshadow-size: (meters ~m)~%" (-> obj shadow-size)) - (format #t "~1Tshadow-max-y: (meters ~m)~%" (-> obj shadow-max-y)) - (format #t "~1Tshadow-min-y: (meters ~m)~%" (-> obj shadow-min-y)) - (format #t "~1Tshadow-locus-dist: (meters ~m)~%" (-> obj shadow-locus-dist)) - (format #t "~1Tgem-joint: ~D~%" (-> obj gem-joint)) - (format #t "~1Tgem-seg: ~D~%" (-> obj gem-seg)) - (format #t "~1Tgem-no-seg: ~D~%" (-> obj gem-no-seg)) - (format #t "~1Tgem-offset: #~%" (-> obj gem-offset)) - (format #t "~1Tcallback-info: #~%" (-> obj callback-info)) - (format #t "~1Tuse-momentum: ~A~%" (-> obj use-momentum)) - (format #t "~1Tuse-frustration: ~A~%" (-> obj use-frustration)) - (format #t "~1Tuse-stop-chase: ~A~%" (-> obj use-stop-chase)) - (format #t "~1Tuse-circling: ~A~%" (-> obj use-circling)) - (format #t "~1Tuse-pacing: ~A~%" (-> obj use-pacing)) - (format #t "~1Twalk-anim: ~D~%" (-> obj walk-anim)) - (format #t "~1Tturn-anim: ~D~%" (-> obj turn-anim)) - (format #t "~1Trun-anim: ~D~%" (-> obj run-anim)) - (format #t "~1Ttaunt-anim: ~D~%" (-> obj taunt-anim)) - (format #t "~1Trun-travel-speed: (meters ~m)~%" (-> obj run-travel-speed)) - (format #t "~1Trun-acceleration: (meters ~m)~%" (-> obj run-acceleration)) - (format #t "~1Trun-turning-acceleration: (meters ~m)~%" (-> obj run-turning-acceleration)) - (format #t "~1Twalk-travel-speed: (meters ~m)~%" (-> obj walk-travel-speed)) - (format #t "~1Twalk-acceleration: (meters ~m)~%" (-> obj walk-acceleration)) - (format #t "~1Twalk-turning-acceleration: (meters ~m)~%" (-> obj walk-turning-acceleration)) - (format #t "~1Tmaximum-rotation-rate: (deg ~r)~%" (-> obj maximum-rotation-rate)) - (format #t "~1Tnotice-nav-radius: (meters ~m)~%" (-> obj notice-nav-radius)) - (format #t "~1Tfrustration-distance: (meters ~m)~%" (-> obj frustration-distance)) - (format #t "~1Tfrustration-time: ~D~%" (-> obj frustration-time)) - (format #t "~1Tblocked-time: ~D~%" (-> obj blocked-time)) - (format #t "~1Tcircle-dist-lo: ~f~%" (-> obj circle-dist-lo)) - (format #t "~1Tcircle-dist-hi: ~f~%" (-> obj circle-dist-hi)) - (format #t "~1Tnav-mesh: ~A~%" (-> obj nav-mesh)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tfact-defaults: ~A~%" (-> this fact-defaults)) + (format #t "~1Tuse-die-falling: ~A~%" (-> this use-die-falling)) + (format #t "~1Tuse-victory: ~A~%" (-> this use-victory)) + (format #t "~1Tuse-jump-blocked: ~A~%" (-> this use-jump-blocked)) + (format #t "~1Tdebug-draw-neck: ~A~%" (-> this debug-draw-neck)) + (format #t "~1Tjump-debug-draw: ~A~%" (-> this jump-debug-draw)) + (format #t "~1Tmove-to-ground: ~A~%" (-> this move-to-ground)) + (format #t "~1Thover-if-no-ground: ~A~%" (-> this hover-if-no-ground)) + (format #t "~1Tidle-anim-script: #x~X~%" (-> this idle-anim-script)) + (format #t "~1Tidle-anim: ~D~%" (-> this idle-anim)) + (format #t "~1Tnotice-anim: ~D~%" (-> this notice-anim)) + (format #t "~1Thostile-anim: ~D~%" (-> this hostile-anim)) + (format #t "~1Thit-anim: ~D~%" (-> this hit-anim)) + (format #t "~1Tknocked-anim: ~D~%" (-> this knocked-anim)) + (format #t "~1Tknocked-land-anim: ~D~%" (-> this knocked-land-anim)) + (format #t "~1Tdie-anim: ~D~%" (-> this die-anim)) + (format #t "~1Tdie-falling-anim: ~D~%" (-> this die-falling-anim)) + (format #t "~1Tvictory-anim: ~D~%" (-> this victory-anim)) + (format #t "~1Tjump-wind-up-anim: ~D~%" (-> this jump-wind-up-anim)) + (format #t "~1Tjump-in-air-anim: ~D~%" (-> this jump-in-air-anim)) + (format #t "~1Tjump-land-anim: ~D~%" (-> this jump-land-anim)) + (format #t "~1Tneck-joint: ~D~%" (-> this neck-joint)) + (format #t "~1Tlook-at-joint: ~D~%" (-> this look-at-joint)) + (format #t "~1Tbullseye-joint: ~D~%" (-> this bullseye-joint)) + (format #t "~1Tsound-hit: ~D~%" (-> this sound-hit)) + (format #t "~1Tsound-die: ~D~%" (-> this sound-die)) + (format #t "~1Tnotice-distance: (meters ~m)~%" (-> this notice-distance)) + (format #t "~1Tnotice-distance-delta: (meters ~m)~%" (-> this notice-distance-delta)) + (format #t "~1Tproximity-notice-distance: (meters ~m)~%" (-> this proximity-notice-distance)) + (format #t "~1Tdefault-hit-points: ~D~%" (-> this default-hit-points)) + (format #t "~1Tgnd-collide-with: ~D~%" (-> this gnd-collide-with)) + (format #t "~1Toverlaps-others-collide-with-filter: ~D~%" (-> this overlaps-others-collide-with-filter)) + (format #t "~1Tpenetrate-flinch: ~D~%" (-> this penetrate-flinch)) + (format #t "~1Tpenetrate-knocked: ~D~%" (-> this penetrate-knocked)) + (format #t "~1Tmovement-gravity: (meters ~m)~%" (-> this movement-gravity)) + (format #t "~1Tfriction: ~f~%" (-> this friction)) + (format #t "~1Tslip-factor: ~f~%" (-> this slip-factor)) + (format #t "~1Tattack-shove-back: (meters ~m)~%" (-> this attack-shove-back)) + (format #t "~1Tattack-shove-up: (meters ~m)~%" (-> this attack-shove-up)) + (format #t "~1Tattack-mode: ~A~%" (-> this attack-mode)) + (format #t "~1Tattack-damage: ~D~%" (-> this attack-damage)) + (format #t "~1Trecover-gnd-collide-with: ~D~%" (-> this recover-gnd-collide-with)) + (format #t "~1Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) + (format #t "~1Tjump-height-factor: ~f~%" (-> this jump-height-factor)) + (format #t "~1Tknocked-seek-ry-clamp: ~f~%" (-> this knocked-seek-ry-clamp)) + (format #t "~1Tknocked-soft-vxz-lo: ~f~%" (-> this knocked-soft-vxz-lo)) + (format #t "~1Tknocked-soft-vxz-hi: ~f~%" (-> this knocked-soft-vxz-hi)) + (format #t "~1Tknocked-soft-vy-lo: ~f~%" (-> this knocked-soft-vy-lo)) + (format #t "~1Tknocked-soft-vy-hi: ~f~%" (-> this knocked-soft-vy-hi)) + (format #t "~1Tknocked-medium-vxz-lo: ~f~%" (-> this knocked-medium-vxz-lo)) + (format #t "~1Tknocked-medium-vxz-hi: ~f~%" (-> this knocked-medium-vxz-hi)) + (format #t "~1Tknocked-medium-vy-lo: ~f~%" (-> this knocked-medium-vy-lo)) + (format #t "~1Tknocked-medium-vy-hi: ~f~%" (-> this knocked-medium-vy-hi)) + (format #t "~1Tknocked-hard-vxz-lo: ~f~%" (-> this knocked-hard-vxz-lo)) + (format #t "~1Tknocked-hard-vxz-hi: ~f~%" (-> this knocked-hard-vxz-hi)) + (format #t "~1Tknocked-hard-vy-lo: ~f~%" (-> this knocked-hard-vy-lo)) + (format #t "~1Tknocked-hard-vy-hi: ~f~%" (-> this knocked-hard-vy-hi)) + (format #t "~1Tknocked-huge-vxz-lo: ~f~%" (-> this knocked-huge-vxz-lo)) + (format #t "~1Tknocked-huge-vxz-hi: ~f~%" (-> this knocked-huge-vxz-hi)) + (format #t "~1Tknocked-huge-vy-lo: ~f~%" (-> this knocked-huge-vy-lo)) + (format #t "~1Tknocked-huge-vy-hi: ~f~%" (-> this knocked-huge-vy-hi)) + (format #t "~1Tknocked-yellow-vxz-lo: ~f~%" (-> this knocked-yellow-vxz-lo)) + (format #t "~1Tknocked-yellow-vxz-hi: ~f~%" (-> this knocked-yellow-vxz-hi)) + (format #t "~1Tknocked-yellow-vy-lo: ~f~%" (-> this knocked-yellow-vy-lo)) + (format #t "~1Tknocked-yellow-vy-hi: ~f~%" (-> this knocked-yellow-vy-hi)) + (format #t "~1Tknocked-red-vxz-lo: ~f~%" (-> this knocked-red-vxz-lo)) + (format #t "~1Tknocked-red-vxz-hi: ~f~%" (-> this knocked-red-vxz-hi)) + (format #t "~1Tknocked-red-vy-lo: ~f~%" (-> this knocked-red-vy-lo)) + (format #t "~1Tknocked-red-vy-hi: ~f~%" (-> this knocked-red-vy-hi)) + (format #t "~1Tknocked-blue-vxz-lo: ~f~%" (-> this knocked-blue-vxz-lo)) + (format #t "~1Tknocked-blue-vxz-hi: ~f~%" (-> this knocked-blue-vxz-hi)) + (format #t "~1Tknocked-blue-vy-lo: ~f~%" (-> this knocked-blue-vy-lo)) + (format #t "~1Tknocked-blue-vy-hi: ~f~%" (-> this knocked-blue-vy-hi)) + (format #t "~1Tshadow-size: (meters ~m)~%" (-> this shadow-size)) + (format #t "~1Tshadow-max-y: (meters ~m)~%" (-> this shadow-max-y)) + (format #t "~1Tshadow-min-y: (meters ~m)~%" (-> this shadow-min-y)) + (format #t "~1Tshadow-locus-dist: (meters ~m)~%" (-> this shadow-locus-dist)) + (format #t "~1Tgem-joint: ~D~%" (-> this gem-joint)) + (format #t "~1Tgem-seg: ~D~%" (-> this gem-seg)) + (format #t "~1Tgem-no-seg: ~D~%" (-> this gem-no-seg)) + (format #t "~1Tgem-offset: #~%" (-> this gem-offset)) + (format #t "~1Tcallback-info: #~%" (-> this callback-info)) + (format #t "~1Tuse-momentum: ~A~%" (-> this use-momentum)) + (format #t "~1Tuse-frustration: ~A~%" (-> this use-frustration)) + (format #t "~1Tuse-stop-chase: ~A~%" (-> this use-stop-chase)) + (format #t "~1Tuse-circling: ~A~%" (-> this use-circling)) + (format #t "~1Tuse-pacing: ~A~%" (-> this use-pacing)) + (format #t "~1Twalk-anim: ~D~%" (-> this walk-anim)) + (format #t "~1Tturn-anim: ~D~%" (-> this turn-anim)) + (format #t "~1Trun-anim: ~D~%" (-> this run-anim)) + (format #t "~1Ttaunt-anim: ~D~%" (-> this taunt-anim)) + (format #t "~1Trun-travel-speed: (meters ~m)~%" (-> this run-travel-speed)) + (format #t "~1Trun-acceleration: (meters ~m)~%" (-> this run-acceleration)) + (format #t "~1Trun-turning-acceleration: (meters ~m)~%" (-> this run-turning-acceleration)) + (format #t "~1Twalk-travel-speed: (meters ~m)~%" (-> this walk-travel-speed)) + (format #t "~1Twalk-acceleration: (meters ~m)~%" (-> this walk-acceleration)) + (format #t "~1Twalk-turning-acceleration: (meters ~m)~%" (-> this walk-turning-acceleration)) + (format #t "~1Tmaximum-rotation-rate: (deg ~r)~%" (-> this maximum-rotation-rate)) + (format #t "~1Tnotice-nav-radius: (meters ~m)~%" (-> this notice-nav-radius)) + (format #t "~1Tfrustration-distance: (meters ~m)~%" (-> this frustration-distance)) + (format #t "~1Tfrustration-time: ~D~%" (-> this frustration-time)) + (format #t "~1Tblocked-time: ~D~%" (-> this blocked-time)) + (format #t "~1Tcircle-dist-lo: ~f~%" (-> this circle-dist-lo)) + (format #t "~1Tcircle-dist-hi: ~f~%" (-> this circle-dist-hi)) + (format #t "~1Tnav-mesh: ~A~%" (-> this nav-mesh)) (label cfg-4) - obj + this ) ;; definition of type nav-enemy @@ -215,23 +215,23 @@ ) ;; definition for method 3 of type nav-enemy -(defmethod inspect nav-enemy ((obj nav-enemy)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-enemy ((this nav-enemy)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfrustration-point: ~`vector`P~%" (-> obj frustration-point)) - (format #t "~2Tmove-dest: ~`vector`P~%" (-> obj move-dest)) - (format #t "~2Tfrustration-time: ~D~%" (-> obj frustration-time)) - (format #t "~2Tblocked-start-time: ~D~%" (-> obj blocked-start-time)) - (format #t "~2Trestore-nav-radius-time: ~D~%" (-> obj restore-nav-radius-time)) - (format #t "~2Tnav-radius-backup: ~f~%" (-> obj nav-radius-backup)) - (format #t "~2Tcircle-radial-dist: ~f~%" (-> obj desired-angle)) + (format #t "~2Tfrustration-point: ~`vector`P~%" (-> this frustration-point)) + (format #t "~2Tmove-dest: ~`vector`P~%" (-> this move-dest)) + (format #t "~2Tfrustration-time: ~D~%" (-> this frustration-time)) + (format #t "~2Tblocked-start-time: ~D~%" (-> this blocked-start-time)) + (format #t "~2Trestore-nav-radius-time: ~D~%" (-> this restore-nav-radius-time)) + (format #t "~2Tnav-radius-backup: ~f~%" (-> this nav-radius-backup)) + (format #t "~2Tcircle-radial-dist: ~f~%" (-> this desired-angle)) (label cfg-4) - obj + this ) ;; definition of type nav-enemy-debug-control-info @@ -246,17 +246,17 @@ ) ;; definition for method 3 of type nav-enemy-debug-control-info -(defmethod inspect nav-enemy-debug-control-info ((obj nav-enemy-debug-control-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-enemy-debug-control-info ((this nav-enemy-debug-control-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tenable: ~A~%" (-> obj enable)) - (format #t "~1Tsteering: ~f~%" (-> obj steering)) - (format #t "~1Tthrottle: ~f~%" (-> obj throttle)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tenable: ~A~%" (-> this enable)) + (format #t "~1Tsteering: ~f~%" (-> this steering)) + (format #t "~1Tthrottle: ~f~%" (-> this throttle)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc index 6f1ec6f46d..0e6118c977 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc @@ -3,46 +3,46 @@ ;; definition for method 10 of type nav-enemy-info ;; WARN: Return type mismatch int vs none. -(defmethod copy-nav-enemy-info! nav-enemy-info ((obj nav-enemy-info) (obj-to-copy nav-enemy-info)) +(defmethod copy-nav-enemy-info! nav-enemy-info ((this nav-enemy-info) (obj-to-copy nav-enemy-info)) "Copies the provided [[nav-enemy-info]] into the current object" - (mem-copy! (&-> obj type) (&-> obj-to-copy type) 492) + (mem-copy! (&-> this type) (&-> obj-to-copy type) 492) 0 (none) ) ;; definition for method 61 of type nav-enemy -(defmethod enemy-method-61 nav-enemy ((obj nav-enemy) (arg0 int)) +(defmethod enemy-method-61 nav-enemy ((this nav-enemy) (arg0 int)) (let* ((t9-0 (method-of-type enemy enemy-method-61)) - (s5-0 (t9-0 obj arg0)) + (s5-0 (t9-0 this arg0)) ) - (if (and (>= 1 (the-as int (-> obj focus aware))) (< 1 s5-0)) - (nav-enemy-method-161 obj) + (if (and (>= 1 (the-as int (-> this focus aware))) (< 1 s5-0)) + (nav-enemy-method-161 this) ) s5-0 ) ) ;; definition for method 74 of type nav-enemy -(defmethod general-event-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler nav-enemy ((this nav-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('nav-mesh-kill) - (deactivate obj) + (deactivate this) #t ) (('nav-mesh-new) - (set! (-> obj water-max-height) (-> obj nav state mesh water-max-height)) + (set! (-> this water-max-height) (-> this nav state mesh water-max-height)) #t ) (('debug-control-on) - (go (method-of-object obj debug-control)) + (go (method-of-object this debug-control)) ) (('debug-control-off) - (react-to-focus obj) + (react-to-focus this) ) (else - ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -61,28 +61,28 @@ ;; definition for method 156 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-156 nav-enemy ((obj nav-enemy)) +(defmethod nav-enemy-method-156 nav-enemy ((this nav-enemy)) (cond - ((zero? (-> obj path)) + ((zero? (-> this path)) (go process-drawable-art-error "no path") ) (else - (let ((s4-0 (-> obj path curve num-cverts))) + (let ((s4-0 (-> this path curve num-cverts))) (if (<= s4-0 0) (go process-drawable-art-error "no path") ) - (let ((s2-0 (get-rand-int obj s4-0)) + (let ((s2-0 (get-rand-int this s4-0)) (s5-0 (new 'stack-no-clear 'vector)) ) (countdown (s3-0 s4-0) - (get-point-in-path! (-> obj path) s5-0 (the float s2-0) 'interp) - (if (< 4096.0 (vector-vector-xz-distance s5-0 (-> obj root trans))) + (get-point-in-path! (-> this path) s5-0 (the float s2-0) 'interp) + (if (< 4096.0 (vector-vector-xz-distance s5-0 (-> this root trans))) (goto cfg-11) ) (set! s2-0 (mod (+ s2-0 1) s4-0)) ) (label cfg-11) - (let ((v1-19 (-> obj nav state))) + (let ((v1-19 (-> this nav state))) (logclear! (-> v1-19 flags) (nav-state-flag directional-mode)) (logior! (-> v1-19 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-19 target-post quad) (-> s5-0 quad)) @@ -98,9 +98,9 @@ ;; definition for method 102 of type nav-enemy ;; INFO: Used lq/sq -(defmethod enemy-method-102 nav-enemy ((obj nav-enemy)) - (let ((gp-0 (-> obj root)) - (s3-0 (-> obj nav state)) +(defmethod enemy-method-102 nav-enemy ((this nav-enemy)) + (let ((gp-0 (-> this root)) + (s3-0 (-> this nav state)) ) (do-navigation-to-destination s3-0 (-> gp-0 trans)) (let ((s4-0 (new 'stack-no-clear 'vector))) @@ -119,9 +119,9 @@ ) ) (cond - ((-> obj enemy-info move-to-ground) + ((-> this enemy-info move-to-ground) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (when (enemy-above-ground? obj s3-1 s4-0 (-> obj enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) + (when (enemy-above-ground? this s3-1 s4-0 (-> this enemy-info recover-gnd-collide-with) 8192.0 81920.0 1024.0) (let ((f0-4 (- (-> gp-0 trans y) (-> s3-1 best-other-tri intersect y)))) (if (and (>= 12288.0 f0-4) (< -8192.0 f0-4)) (return #f) @@ -142,20 +142,20 @@ ;; definition for method 100 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs symbol. -(defmethod enemy-method-100 nav-enemy ((obj nav-enemy)) +(defmethod enemy-method-100 nav-enemy ((this nav-enemy)) (local-vars (v0-1 vector)) - (when (not (-> obj enemy-info move-to-ground)) - (enemy-method-103 obj) + (when (not (-> this enemy-info move-to-ground)) + (enemy-method-103 this) (return (the-as symbol #f)) ) - (when (not (logtest? (enemy-flag directed) (-> obj enemy-flags))) - (let ((s5-0 (-> obj root))) - (if (focus-test? obj under-water) - (enemy-method-47 obj (-> s5-0 transv)) - (+! (-> s5-0 transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame))) + (when (not (logtest? (enemy-flag directed) (-> this enemy-flags))) + (let ((s5-0 (-> this root))) + (if (focus-test? this under-water) + (enemy-method-47 this (-> s5-0 transv)) + (+! (-> s5-0 transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) - (let ((v1-16 (-> obj enemy-info))) + (let ((v1-16 (-> this enemy-info))) (set! (-> a2-0 gnd-collide-with) (-> v1-16 recover-gnd-collide-with)) (set! (-> a2-0 popup) 8192.0) (set! (-> a2-0 dont-move-if-overlaps?) #t) @@ -165,16 +165,16 @@ ) (set! (-> a2-0 overlaps-params tlist) *touching-list*) (-> a2-0 overlaps-params) - (enemy-method-128 obj (-> s5-0 transv) a2-0) + (enemy-method-128 this (-> s5-0 transv) a2-0) ) ) ) - (logclear! (-> obj enemy-flags) (enemy-flag directed)) - (if (and (enemy-method-102 obj) (not (logtest? (-> obj focus-status) (focus-status dead)))) - (kill-prefer-falling obj) + (logclear! (-> this enemy-flags) (enemy-flag directed)) + (if (and (enemy-method-102 this) (not (logtest? (-> this focus-status) (focus-status dead)))) + (kill-prefer-falling this) ) - (the-as symbol (when (logtest? (-> obj nav state flags) (nav-state-flag in-mesh)) - (let ((s5-1 (-> obj root)) + (the-as symbol (when (logtest? (-> this nav state flags) (nav-state-flag in-mesh)) + (let ((s5-1 (-> this root)) (a1-2 (new 'stack-no-clear 'collide-query)) (s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) @@ -182,10 +182,10 @@ (set! (-> s3-0 quad) (-> s5-1 gspot-pos quad)) (set! (-> s4-0 quad) (-> s5-1 gspot-normal quad)) (cond - ((find-ground s5-1 a1-2 (-> obj enemy-info gnd-collide-with) 8192.0 81920.0 1024.0) + ((find-ground s5-1 a1-2 (-> this enemy-info gnd-collide-with) 8192.0 81920.0 1024.0) (let ((f0-4 (- (-> s5-1 trans y) (-> s5-1 gspot-pos y)))) (when (>= 409.6 (fabs f0-4)) - (enemy-method-103 obj) + (enemy-method-103 this) (return (the-as symbol #f)) v0-1 ) @@ -211,7 +211,7 @@ - looks at the target and handles attacking @TODO Not extremely well understood yet" (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) (when (logtest? (enemy-flag use-trigger) (-> self enemy-flags)) @@ -258,7 +258,7 @@ ) ) (when (and (logtest? (-> self enemy-flags) (enemy-flag attackable-backup)) - (>= (- (current-time) (-> self auto-reset-penetrate-time)) (seconds 0.1)) + (time-elapsed? (-> self auto-reset-penetrate-time) (seconds 0.1)) ) (logclear! (-> self enemy-flags) (enemy-flag attackable-backup)) (set! (-> self root penetrated-by) (get-penetrate-info self)) @@ -293,12 +293,12 @@ ;; definition for method 177 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-177 nav-enemy ((obj nav-enemy)) - (let ((v1-2 (-> obj nav state current-poly))) +(defmethod nav-enemy-method-177 nav-enemy ((this nav-enemy)) + (let ((v1-2 (-> this nav state current-poly))) (when (and v1-2 (logtest? (-> v1-2 pat) 4) (!= (-> v1-2 link) 255)) - (let ((v1-6 (-> obj nav state mesh link-array (-> v1-2 link) dest-mesh))) + (let ((v1-6 (-> this nav state mesh link-array (-> v1-2 link) dest-mesh))) (if v1-6 - (change-to v1-6 obj) + (change-to v1-6 this) ) ) ) @@ -309,51 +309,51 @@ ;; definition for method 176 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-176 nav-enemy ((obj nav-enemy)) - (nav-enemy-method-177 obj) +(defmethod nav-enemy-method-176 nav-enemy ((this nav-enemy)) + (nav-enemy-method-177 this) (cond - ((nav-enemy-method-174 obj) - (logior! (-> obj enemy-flags) (enemy-flag directed)) - (let ((s5-0 (-> obj nav))) + ((nav-enemy-method-174 this) + (logior! (-> this enemy-flags) (enemy-flag directed)) + (let ((s5-0 (-> this nav))) (when (logtest? (-> s5-0 state flags) (nav-state-flag at-gap)) (let ((s4-0 (new 'stack-no-clear 'nav-gap-info))) (when (plan-over-pat1-polys-using-route (-> s5-0 state) s4-0) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable) (-> obj enemy-flags)))) - (send-event obj 'jump 1 (-> s4-0 dest)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable) (-> this enemy-flags)))) + (send-event this 'jump 1 (-> s4-0 dest)) ) ) ) (cond - ((logtest? (enemy-flag enemy-flag38) (-> obj enemy-flags)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag38)))) + ((logtest? (enemy-flag enemy-flag38) (-> this enemy-flags)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag38)))) ) (else - (when (not (logtest? (enemy-flag enemy-flag42) (-> obj enemy-flags))) - (nav-enemy-method-142 obj s5-0) - (nav-enemy-method-143 obj s5-0) + (when (not (logtest? (enemy-flag enemy-flag42) (-> this enemy-flags))) + (nav-enemy-method-142 this s5-0) + (nav-enemy-method-143 this s5-0) ) ) ) (cond ((logtest? (-> s5-0 state flags) (nav-state-flag blocked)) - (if (zero? (-> obj blocked-start-time)) - (set! (-> obj blocked-start-time) (current-time)) + (if (zero? (-> this blocked-start-time)) + (set-time! (-> this blocked-start-time)) ) ) (else - (set! (-> obj blocked-start-time) 0) + (set! (-> this blocked-start-time) 0) 0 ) ) ) ) (else - (set! (-> obj blocked-start-time) 0) + (set! (-> this blocked-start-time) 0) 0 ) ) - (track-target! obj) - (update-transforms (-> obj root)) + (track-target! this) + (update-transforms (-> this root)) 0 (none) ) @@ -361,7 +361,7 @@ ;; definition for method 145 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-145 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-145 nav-enemy ((this nav-enemy) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -425,7 +425,7 @@ ;; definition for method 146 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-146 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-146 nav-enemy ((this nav-enemy) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 @@ -434,7 +434,7 @@ ;; definition for method 147 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-147 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-147 nav-enemy ((this nav-enemy) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-1 (-> arg0 state)) 0 0 @@ -443,7 +443,7 @@ ;; definition for method 148 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-148 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-148 nav-enemy ((this nav-enemy) (arg0 nav-control)) (navigate-within-poly (-> arg0 state)) 0 0 @@ -452,7 +452,7 @@ ;; definition for method 149 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-149 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-149 nav-enemy ((this nav-enemy) (arg0 nav-control)) (compute-travel-speed (-> arg0 state)) 0 (none) @@ -460,8 +460,8 @@ ;; definition for method 155 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-155 nav-enemy ((obj nav-enemy)) - (navigate-v1! (-> obj nav state)) +(defmethod nav-enemy-method-155 nav-enemy ((this nav-enemy)) + (navigate-v1! (-> this nav state)) 0 (none) ) @@ -469,7 +469,7 @@ ;; definition for method 150 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-150 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-150 nav-enemy ((this nav-enemy) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -533,7 +533,7 @@ ;; definition for method 151 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-151 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-151 nav-enemy ((this nav-enemy) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 @@ -542,7 +542,7 @@ ;; definition for method 152 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-152 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-152 nav-enemy ((this nav-enemy) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg0 state)) 0 (none) @@ -550,7 +550,7 @@ ;; definition for method 153 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-153 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-153 nav-enemy ((this nav-enemy) (arg0 nav-control)) (update-travel-dir-from-spheres (-> arg0 state)) 0 (none) @@ -558,7 +558,7 @@ ;; definition for method 154 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-154 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-154 nav-enemy ((this nav-enemy) (arg0 nav-control)) (compute-speed-simple (-> arg0 state)) 0 (none) @@ -567,16 +567,16 @@ ;; definition for method 142 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-142 nav-enemy ((this nav-enemy) (arg0 nav-control)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s5-0 quad) (-> a1-1 heading quad)) ) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) - (quaternion-set! (-> obj root quat) 0.0 (-> s5-0 x) 0.0 (+ 1.0 (-> s5-0 z))) + (quaternion-set! (-> this root quat) 0.0 (-> s5-0 x) 0.0 (+ 1.0 (-> s5-0 z))) ) - (quaternion-normalize! (-> obj root quat)) + (quaternion-normalize! (-> this root quat)) 0 (none) ) @@ -584,25 +584,25 @@ ;; definition for method 143 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-143 nav-enemy ((obj nav-enemy) (arg0 nav-control)) +(defmethod nav-enemy-method-143 nav-enemy ((this nav-enemy) (arg0 nav-control)) (let ((v1-0 (new 'stack-no-clear 'vector))) (let ((a2-0 (-> arg0 state))) (set! (-> v1-0 quad) (-> a2-0 velocity quad)) ) - (let ((a0-3 (-> obj root transv))) + (let ((a0-3 (-> this root transv))) (set! (-> a0-3 x) (-> v1-0 x)) (set! (-> a0-3 z) (-> v1-0 z)) ) ) (cond - ((-> obj enemy-info move-to-ground) - (if (focus-test? obj under-water) - (enemy-method-47 obj (-> obj root transv)) - (+! (-> obj root transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame))) + ((-> this enemy-info move-to-ground) + (if (focus-test? this under-water) + (enemy-method-47 this (-> this root transv)) + (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) (let ((a2-3 (new 'stack-no-clear 'move-above-ground-params))) - (let ((v1-14 (-> obj enemy-info))) - (set! (-> a2-3 gnd-collide-with) (the-as collide-spec (-> obj gnd-collide))) + (let ((v1-14 (-> this enemy-info))) + (set! (-> a2-3 gnd-collide-with) (the-as collide-spec (-> this gnd-collide))) (set! (-> a2-3 popup) 8192.0) (set! (-> a2-3 dont-move-if-overlaps?) #t) (set! (-> a2-3 hover-if-no-ground?) (-> v1-14 hover-if-no-ground)) @@ -611,15 +611,15 @@ ) (set! (-> a2-3 overlaps-params tlist) *touching-list*) (-> a2-3 overlaps-params) - (enemy-method-128 obj (-> obj root transv) a2-3) + (enemy-method-128 this (-> this root transv) a2-3) ) ) (else (let ((a2-4 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a2-4 options) (overlaps-others-options oo0)) - (set! (-> a2-4 collide-with-filter) (-> obj enemy-info overlaps-others-collide-with-filter)) + (set! (-> a2-4 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) (set! (-> a2-4 tlist) *touching-list*) - (integrate-for-enemy-no-mtg (-> obj root) (-> obj root transv) a2-4) + (integrate-for-enemy-no-mtg (-> this root) (-> this root transv) a2-4) ) ) ) @@ -870,54 +870,54 @@ ;; definition for method 170 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-170 nav-enemy ((obj nav-enemy)) - (if (not (logtest? (enemy-flag enemy-flag36) (-> obj enemy-flags))) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> obj enemy-flags)))) +(defmethod nav-enemy-method-170 nav-enemy ((this nav-enemy)) + (if (not (logtest? (enemy-flag enemy-flag36) (-> this enemy-flags))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> this enemy-flags)))) ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> obj enemy-flags)))) - (set! (-> obj nav callback-info) (-> obj enemy-info callback-info)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag36) (-> this enemy-flags)))) + (set! (-> this nav callback-info) (-> this enemy-info callback-info)) 0 (none) ) ;; definition for method 171 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-171 nav-enemy ((obj nav-enemy)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag36)))) - (set! (-> obj nav callback-info) *nav-enemy-null-callback-info*) +(defmethod nav-enemy-method-171 nav-enemy ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> this nav callback-info) *nav-enemy-null-callback-info*) 0 (none) ) ;; definition for method 172 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-172 nav-enemy ((obj nav-enemy)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> obj enemy-flags)))) +(defmethod nav-enemy-method-172 nav-enemy ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> this enemy-flags)))) 0 (none) ) ;; definition for method 173 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-173 nav-enemy ((obj nav-enemy)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag37)))) +(defmethod nav-enemy-method-173 nav-enemy ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag37)))) 0 (none) ) ;; definition for method 174 of type nav-enemy -(defmethod nav-enemy-method-174 nav-enemy ((obj nav-enemy)) - (logtest? (enemy-flag enemy-flag36) (-> obj enemy-flags)) +(defmethod nav-enemy-method-174 nav-enemy ((this nav-enemy)) + (logtest? (enemy-flag enemy-flag36) (-> this enemy-flags)) ) ;; definition for method 175 of type nav-enemy -(defmethod nav-enemy-method-175 nav-enemy ((obj nav-enemy)) - (logtest? (enemy-flag enemy-flag37) (-> obj enemy-flags)) +(defmethod nav-enemy-method-175 nav-enemy ((this nav-enemy)) + (logtest? (enemy-flag enemy-flag37) (-> this enemy-flags)) ) ;; definition for method 157 of type nav-enemy -(defmethod nav-enemy-method-157 nav-enemy ((obj nav-enemy) (arg0 vector)) - (let ((v1-0 (-> obj nav)) +(defmethod nav-enemy-method-157 nav-enemy ((this nav-enemy) (arg0 vector)) + (let ((v1-0 (-> this nav)) (a0-1 arg0) (a1-1 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -929,13 +929,13 @@ ) ;; definition for method 158 of type nav-enemy -(defmethod nav-enemy-method-158 nav-enemy ((obj nav-enemy) (arg0 vector)) - (let ((f1-0 (-> obj root trans y)) +(defmethod nav-enemy-method-158 nav-enemy ((this nav-enemy) (arg0 vector)) + (let ((f1-0 (-> this root trans y)) (f0-0 (-> arg0 y)) - (v1-1 (-> obj fact)) + (v1-1 (-> this fact)) ) (and (< f0-0 (+ f1-0 (-> v1-1 notice-top))) - (and (< (- f1-0 (-> v1-1 notice-bottom)) f0-0) (let ((v1-3 (-> obj nav)) + (and (< (- f1-0 (-> v1-1 notice-bottom)) f0-0) (let ((v1-3 (-> this nav)) (a0-1 arg0) (a1-1 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -950,21 +950,21 @@ ) ;; definition for method 159 of type nav-enemy -(defmethod nav-enemy-method-159 nav-enemy ((obj nav-enemy) (arg0 vector)) - (let ((f1-0 (-> obj root trans y)) +(defmethod nav-enemy-method-159 nav-enemy ((this nav-enemy) (arg0 vector)) + (let ((f1-0 (-> this root trans y)) (f0-0 (-> arg0 y)) - (v1-1 (-> obj fact)) + (v1-1 (-> this fact)) ) (and (< f0-0 (+ f1-0 (-> v1-1 notice-top))) (and (< (- f1-0 (-> v1-1 notice-bottom)) f0-0) - (is-in-mesh? (-> obj nav) arg0 (-> obj enemy-info notice-nav-radius)) + (is-in-mesh? (-> this nav) arg0 (-> this enemy-info notice-nav-radius)) ) ) ) ) ;; definition for method 98 of type nav-enemy -(defmethod in-aggro-range? nav-enemy ((obj nav-enemy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? nav-enemy ((this nav-enemy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -975,16 +975,16 @@ ) (when arg1 (let* ((f0-0 (-> arg1 y)) - (v1-4 (-> obj root)) + (v1-4 (-> this root)) (f1-0 (-> v1-4 trans y)) - (a0-2 (-> obj fact)) + (a0-2 (-> this fact)) ) (when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0)) - (let* ((f30-0 (-> obj enemy-info notice-nav-radius)) + (let* ((f30-0 (-> this enemy-info notice-nav-radius)) (f0-1 f30-0) ) (or (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1)) - (is-in-mesh? (-> obj nav) arg1 f30-0) + (is-in-mesh? (-> this nav) arg1 f30-0) ) ) ) @@ -995,12 +995,12 @@ ;; definition for method 161 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-161 nav-enemy ((obj nav-enemy)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag not-frustrated)))) - (set! (-> obj frustration-time) (current-time)) - (let ((v1-7 (handle->process (-> obj focus handle)))) +(defmethod nav-enemy-method-161 nav-enemy ((this nav-enemy)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag not-frustrated)))) + (set-time! (-> this frustration-time)) + (let ((v1-7 (handle->process (-> this focus handle)))) (if v1-7 - (set! (-> obj frustration-point quad) (-> (get-trans (the-as process-focusable v1-7) 1) quad)) + (set! (-> this frustration-point quad) (-> (get-trans (the-as process-focusable v1-7) 1) quad)) ) ) 0 @@ -1009,22 +1009,20 @@ ;; definition for method 160 of type nav-enemy ;; WARN: Return type mismatch object vs none. -(defmethod nav-enemy-method-160 nav-enemy ((obj nav-enemy)) - (let ((s5-0 (handle->process (-> obj focus handle)))) +(defmethod nav-enemy-method-160 nav-enemy ((this nav-enemy)) + (let ((s5-0 (handle->process (-> this focus handle)))) (cond ((or (not s5-0) - (< 6144.0 (vector-vector-distance (get-trans (the-as process-focusable s5-0) 1) (-> obj frustration-point))) - (< (-> obj enemy-info frustration-distance) - (vector-vector-xz-distance (get-trans (the-as process-focusable s5-0) 0) (-> obj root trans)) + (< 6144.0 (vector-vector-distance (get-trans (the-as process-focusable s5-0) 1) (-> this frustration-point))) + (< (-> this enemy-info frustration-distance) + (vector-vector-xz-distance (get-trans (the-as process-focusable s5-0) 0) (-> this root trans)) ) ) - (nav-enemy-method-161 obj) + (nav-enemy-method-161 this) ) (else - (when (>= (- (current-time) (-> obj frustration-time)) - (+ (-> obj reaction-time) (-> obj enemy-info frustration-time)) - ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag not-frustrated) (-> obj enemy-flags)))) + (when (time-elapsed? (-> this frustration-time) (+ (-> this reaction-time) (-> this enemy-info frustration-time))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag not-frustrated) (-> this enemy-flags)))) 0 ) ) @@ -1035,25 +1033,25 @@ ;; definition for method 162 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-162 nav-enemy ((obj nav-enemy)) - (set! (-> obj blocked-start-time) 0) +(defmethod nav-enemy-method-162 nav-enemy ((this nav-enemy)) + (set! (-> this blocked-start-time) 0) 0 (none) ) ;; definition for method 163 of type nav-enemy -(defmethod nav-enemy-method-163 nav-enemy ((obj nav-enemy)) - (let ((v1-0 (-> obj blocked-start-time))) - (and (nonzero? v1-0) (>= (- (current-time) v1-0) (-> obj enemy-info blocked-time))) +(defmethod nav-enemy-method-163 nav-enemy ((this nav-enemy)) + (let ((v1-0 (-> this blocked-start-time))) + (and (nonzero? v1-0) (time-elapsed? v1-0 (-> this enemy-info blocked-time))) ) ) ;; definition for method 164 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-164 nav-enemy ((obj nav-enemy)) - (if (-> obj enemy-info use-momentum) - (logior! (-> obj nav flags) (nav-control-flag use-momentum)) - (logclear! (-> obj nav flags) (nav-control-flag use-momentum)) +(defmethod nav-enemy-method-164 nav-enemy ((this nav-enemy)) + (if (-> this enemy-info use-momentum) + (logior! (-> this nav flags) (nav-control-flag use-momentum)) + (logclear! (-> this nav flags) (nav-control-flag use-momentum)) ) 0 (none) @@ -1061,17 +1059,17 @@ ;; definition for method 167 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-167 nav-enemy ((obj nav-enemy)) - (let ((v1-0 (-> obj nav))) +(defmethod nav-enemy-method-167 nav-enemy ((this nav-enemy)) + (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) 0.0) ) 0 - (let ((v1-3 (-> obj nav state))) + (let ((v1-3 (-> this nav state))) (set! (-> v1-3 speed) 0.0) ) 0 - (let ((v1-5 (-> obj nav))) - (set! (-> v1-5 acceleration) (-> obj enemy-info walk-acceleration)) + (let ((v1-5 (-> this nav))) + (set! (-> v1-5 acceleration) (-> this enemy-info walk-acceleration)) ) 0 0 @@ -1080,17 +1078,17 @@ ;; definition for method 165 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-165 nav-enemy ((obj nav-enemy)) - (let ((v1-0 (-> obj nav))) - (set! (-> v1-0 target-speed) (-> obj enemy-info walk-travel-speed)) +(defmethod nav-enemy-method-165 nav-enemy ((this nav-enemy)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 target-speed) (-> this enemy-info walk-travel-speed)) ) 0 - (let ((v1-2 (-> obj nav))) - (set! (-> v1-2 acceleration) (-> obj enemy-info walk-acceleration)) + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 acceleration) (-> this enemy-info walk-acceleration)) ) 0 - (let ((v1-4 (-> obj nav))) - (set! (-> v1-4 turning-acceleration) (-> obj enemy-info walk-turning-acceleration)) + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 turning-acceleration) (-> this enemy-info walk-turning-acceleration)) ) 0 0 @@ -1099,17 +1097,17 @@ ;; definition for method 166 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-166 nav-enemy ((obj nav-enemy)) - (let ((v1-0 (-> obj nav))) - (set! (-> v1-0 target-speed) (-> obj enemy-info run-travel-speed)) +(defmethod nav-enemy-method-166 nav-enemy ((this nav-enemy)) + (let ((v1-0 (-> this nav))) + (set! (-> v1-0 target-speed) (-> this enemy-info run-travel-speed)) ) 0 - (let ((v1-2 (-> obj nav))) - (set! (-> v1-2 acceleration) (-> obj enemy-info run-acceleration)) + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 acceleration) (-> this enemy-info run-acceleration)) ) 0 - (let ((v1-4 (-> obj nav))) - (set! (-> v1-4 turning-acceleration) (-> obj enemy-info run-turning-acceleration)) + (let ((v1-4 (-> this nav))) + (set! (-> v1-4 turning-acceleration) (-> this enemy-info run-turning-acceleration)) ) 0 0 @@ -1118,19 +1116,21 @@ ;; definition for method 112 of type nav-enemy ;; WARN: Return type mismatch float vs none. -(defmethod set-enemy-info! nav-enemy ((obj nav-enemy) (arg0 nav-enemy-info)) +(defmethod set-enemy-info! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) "In addition to setting the `enemy-info`, also init the `neck-joint` if applicable from it @param info Set `enemy-info` accordingly" - (set! (-> obj enemy-info) arg0) + (set! (-> this enemy-info) arg0) (set! (-> arg0 callback-info) *nav-enemy-callback-info*) - (when (and (!= (-> obj enemy-info neck-joint) -1) (zero? (-> obj neck))) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj (-> obj enemy-info neck-joint))) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 102400.0) - (set! (-> obj neck ignore-angle) 16384.0) + (when (and (!= (-> this enemy-info neck-joint) -1) (zero? (-> this neck))) + (set! (-> this neck) + (new 'process 'joint-mod (joint-mod-mode flex-blend) this (-> this enemy-info neck-joint)) + ) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 102400.0) + (set! (-> this neck ignore-angle) 16384.0) ) (none) ) @@ -1138,148 +1138,148 @@ ;; definition for method 113 of type nav-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-behaviour-and-stats! nav-enemy ((obj nav-enemy) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! nav-enemy ((this nav-enemy) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (local-vars (sv-16 res-tag)) - (when (coin-flip? obj) - (let ((a0-2 (-> obj node-list data 2))) + (when (coin-flip? this) + (let ((a0-2 (-> this node-list data 2))) (set! (-> a0-2 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint-flip-z!)) (set! (-> a0-2 param1) #f) (set! (-> a0-2 param2) #f) ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag dislike-combo) (-> obj enemy-flags)))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag dislike-combo) (-> this enemy-flags)))) ) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj enemy-flags) (enemy-flag notice)) - (set! (-> obj nav-radius-backup) (-> obj root nav-radius)) - (set-enemy-info! obj arg0) - (set! (-> obj enemy-info callback-info) *nav-enemy-callback-info*) - (let ((a1-2 (-> obj enemy-info idle-anim-script))) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask actor-pause)) + (logior! (-> this enemy-flags) (enemy-flag notice)) + (set! (-> this nav-radius-backup) (-> this root nav-radius)) + (set-enemy-info! this arg0) + (set! (-> this enemy-info callback-info) *nav-enemy-callback-info*) + (let ((a1-2 (-> this enemy-info idle-anim-script))) (if a1-2 - (idle-control-method-9 (-> obj idle-anim-player) a1-2) + (idle-control-method-9 (-> this idle-anim-player) a1-2) ) ) - (if (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) (new - 'process - 'shadow-control - (-> obj enemy-info shadow-min-y) - (-> obj enemy-info shadow-max-y) - (-> obj enemy-info shadow-locus-dist) - (shadow-flags shdf00 shdf04) - 245760.0 - ) + (if (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new + 'process + 'shadow-control + (-> this enemy-info shadow-min-y) + (-> this enemy-info shadow-max-y) + (-> this enemy-info shadow-locus-dist) + (shadow-flags shdf00 shdf04) + 245760.0 + ) ) - (set! (-> obj draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) + (set! (-> this draw shadow-ctrl) *nav-enemy-dummy-shadow-control*) ) - (get-nav-control obj (-> arg0 nav-mesh)) - (set! (-> obj water-max-height) (-> obj nav state mesh water-max-height)) - (let ((v1-33 obj)) + (get-nav-control this (-> arg0 nav-mesh)) + (set! (-> this water-max-height) (-> this nav state mesh water-max-height)) + (let ((v1-33 this)) (set! (-> v1-33 enemy-flags) (the-as enemy-flag (logclear (-> v1-33 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-33 nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (let ((v1-36 obj)) + (let ((v1-36 this)) (set! (-> v1-36 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-36 enemy-flags)))) ) 0 - (logior! (-> obj nav flags) (nav-control-flag display-marks limit-rotation-rate)) - (logior! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag43) (-> obj enemy-flags)))) - (let ((v1-47 (-> obj nav))) + (logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate)) + (logior! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag43) (-> this enemy-flags)))) + (let ((v1-47 (-> this nav))) (set! (-> v1-47 target-speed) 0.0) ) 0 - (let ((v1-49 (-> obj nav))) - (set! (-> v1-49 acceleration) (-> obj enemy-info walk-acceleration)) + (let ((v1-49 (-> this nav))) + (set! (-> v1-49 acceleration) (-> this enemy-info walk-acceleration)) ) 0 - (let ((v1-51 (-> obj nav))) - (set! (-> v1-51 turning-acceleration) (-> obj enemy-info walk-turning-acceleration)) + (let ((v1-51 (-> this nav))) + (set! (-> v1-51 turning-acceleration) (-> this enemy-info walk-turning-acceleration)) ) 0 - (let ((v1-53 (-> obj nav))) - (set! (-> v1-53 max-rotation-rate) (-> obj enemy-info maximum-rotation-rate)) + (let ((v1-53 (-> this nav))) + (set! (-> v1-53 max-rotation-rate) (-> this enemy-info maximum-rotation-rate)) ) 0 - (nav-enemy-method-164 obj) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #t)) - (if (nonzero? (-> obj path)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (nav-enemy-method-164 this) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #t)) + (if (nonzero? (-> this path)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) ) (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) - (set! (-> obj hit-points) (* (-> obj enemy-info default-hit-points) 2)) - (set! (-> obj hit-points) (-> obj enemy-info default-hit-points)) + (set! (-> this hit-points) (* (-> this enemy-info default-hit-points) 2)) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) ) (let* ((v1-71 *game-info*) (a0-28 (+ (-> v1-71 attack-id) 1)) ) (set! (-> v1-71 attack-id) a0-28) - (set! (-> obj attack-id) a0-28) + (set! (-> this attack-id) a0-28) ) (let* ((v1-72 *game-info*) (a0-30 (+ (-> v1-72 attack-id) 1)) ) (set! (-> v1-72 attack-id) a0-30) - (set! (-> obj persistent-attack-id) a0-30) + (set! (-> this persistent-attack-id) a0-30) ) - (enemy-method-124 obj) - (set! (-> obj fact) (new - 'process - 'fact-info-enemy - obj - (the-as (pointer float) (-> arg0 fact-defaults)) - (pickup-type eco-pill-random) - (-> *FACT-bank* default-eco-pill-green-inc) - ) + (enemy-method-124 this) + (set! (-> this fact) (new + 'process + 'fact-info-enemy + this + (the-as (pointer float) (-> arg0 fact-defaults)) + (pickup-type eco-pill-random) + (-> *FACT-bank* default-eco-pill-green-inc) + ) ) - (let ((a1-9 (if (logtest? (enemy-option multi-focus) (-> obj fact enemy-options)) + (let ((a1-9 (if (logtest? (enemy-option multi-focus) (-> this fact enemy-options)) 1030 1026 ) ) ) - (reset-to-collide-spec (-> obj focus) (the-as collide-spec a1-9)) + (reset-to-collide-spec (-> this focus) (the-as collide-spec a1-9)) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-82 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-82 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-82 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-82)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-82)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice symbol)) - (set! (-> obj on-active) (res-lump-struct (-> obj entity) 'on-active symbol)) - (set! (-> obj on-hostile) (res-lump-struct (-> obj entity) 'on-hostile symbol)) - (set! (-> obj on-death) (res-lump-struct (-> obj entity) 'on-death symbol)) - (if (-> obj on-notice) - (logior! (-> obj enemy-flags) (enemy-flag auto-reset-penetrate)) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice symbol)) + (set! (-> this on-active) (res-lump-struct (-> this entity) 'on-active symbol)) + (set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile symbol)) + (set! (-> this on-death) (res-lump-struct (-> this entity) 'on-death symbol)) + (if (-> this on-notice) + (logior! (-> this enemy-flags) (enemy-flag auto-reset-penetrate)) ) - (if (-> obj on-active) - (logior! (-> obj enemy-flags) (enemy-flag jump-check-blocked)) + (if (-> this on-active) + (logior! (-> this enemy-flags) (enemy-flag jump-check-blocked)) ) - (if (-> obj on-hostile) - (logior! (-> obj enemy-flags) (enemy-flag drawn-mirrored)) + (if (-> this on-hostile) + (logior! (-> this enemy-flags) (enemy-flag drawn-mirrored)) ) - (set! (-> obj incoming attacker-handle) (the-as handle #f)) - (let ((s4-0 (-> obj root))) - (set! (-> obj penetrated-by-all) (-> obj root penetrated-by)) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) + (set! (-> this incoming attacker-handle) (the-as handle #f)) + (let ((s4-0 (-> this root))) + (set! (-> this penetrated-by-all) (-> this root penetrated-by)) + (set! (-> this root penetrated-by) (get-penetrate-info this)) (set! (-> s4-0 event-self) 'touched) ) - (set! (-> obj penetrated-flinch) (-> arg0 penetrate-flinch)) - (set! (-> obj penetrated-knocked) (-> arg0 penetrate-knocked)) - (set! (-> obj reaction-time) (the-as time-frame (get-rand-int-range obj 30 240))) - (let* ((v1-113 (-> obj enemy-flags)) - (a0-47 (-> obj fact enemy-options)) + (set! (-> this penetrated-flinch) (-> arg0 penetrate-flinch)) + (set! (-> this penetrated-knocked) (-> arg0 penetrate-knocked)) + (set! (-> this reaction-time) (the-as time-frame (get-rand-int-range this 30 240))) + (let* ((v1-113 (-> this enemy-flags)) + (a0-47 (-> this fact enemy-options)) (v1-114 (logior (enemy-flag enable-on-active checking-water @@ -1298,18 +1298,18 @@ (if (logtest? (enemy-option has-trigger) a0-47) (set! v1-114 (logior (enemy-flag called-dying) v1-114)) ) - (set! (-> obj enemy-flags) v1-114) + (set! (-> this enemy-flags) v1-114) ) - (logior! (-> obj mask) (process-mask collectable)) - (do-navigation-to-destination (-> obj nav state) (-> obj root trans)) - (if (and (-> obj enemy-info move-to-ground) - (not (logtest? (enemy-flag vulnerable-backup) (-> obj enemy-flags))) - (not (logtest? (enemy-option ambush) (-> obj fact enemy-options))) + (logior! (-> this mask) (process-mask collectable)) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) + (if (and (-> this enemy-info move-to-ground) + (not (logtest? (enemy-flag vulnerable-backup) (-> this enemy-flags))) + (not (logtest? (enemy-option ambush) (-> this fact enemy-options))) ) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) + (enemy-method-127 this 40960.0 40960.0 #t (the-as collide-spec (-> this gnd-collide))) ) - (if (zero? (-> obj draw light-index)) - (set! (-> obj draw light-index) (the-as uint 10)) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) ) 0 (none) @@ -1317,66 +1317,66 @@ ;; definition for method 11 of type nav-enemy ;; WARN: Return type mismatch int vs none. -(defmethod init-from-entity! nav-enemy ((obj nav-enemy) (arg0 entity-actor)) +(defmethod init-from-entity! nav-enemy ((this nav-enemy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-enemy-collision! obj) - (process-drawable-from-entity! obj arg0) - (init-enemy! obj) - (when (> (-> obj enemy-info gem-joint) 0) + (init-enemy-collision! this) + (process-drawable-from-entity! this arg0) + (init-enemy! this) + (when (> (-> this enemy-info gem-joint) 0) (cond - ((or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status save))) - (not (-> obj entity)) + ((or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status save))) + (not (-> this entity)) ) (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-no-seg)) - (the-as int (-> obj enemy-info gem-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-no-seg)) + (the-as int (-> this enemy-info gem-seg)) ) ) (else (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-seg)) - (the-as int (-> obj enemy-info gem-no-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-seg)) + (the-as int (-> this enemy-info gem-no-seg)) ) - (add-connection *part-engine* obj (-> obj enemy-info gem-joint) obj 314 (-> obj enemy-info gem-offset)) + (add-connection *part-engine* this (-> this enemy-info gem-joint) this 314 (-> this enemy-info gem-offset)) ) ) ) - (let ((v1-25 (-> obj fact enemy-options))) + (let ((v1-25 (-> this fact enemy-options))) (cond ((logtest? (enemy-option spawner) v1-25) - (process-entity-status! obj (entity-perm-status dead) #t) - (go (method-of-object obj die-fast)) + (process-entity-status! this (entity-perm-status dead) #t) + (go (method-of-object this die-fast)) ) (*debug-view-anims* - (go (method-of-object obj view-anims)) + (go (method-of-object this view-anims)) ) ((logtest? (enemy-option dormant) v1-25) - (let ((v1-33 (-> obj root root-prim))) + (let ((v1-33 (-> this root root-prim))) (set! (-> v1-33 prim-core collide-as) (collide-spec)) (set! (-> v1-33 prim-core collide-with) (collide-spec)) ) 0 - (logior! (-> obj draw status) (draw-control-status no-draw)) - (go (method-of-object obj dormant)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this dormant)) ) ((logtest? (enemy-option dormant-aware) v1-25) - (let ((v1-43 (-> obj root root-prim))) + (let ((v1-43 (-> this root root-prim))) (set! (-> v1-43 prim-core collide-as) (collide-spec)) (set! (-> v1-43 prim-core collide-with) (collide-spec)) ) 0 - (logior! (-> obj draw status) (draw-control-status no-draw)) - (go (method-of-object obj dormant-aware)) + (logior! (-> this draw status) (draw-control-status no-draw)) + (go (method-of-object this dormant-aware)) ) (else - (go-idle obj) + (go-idle this) ) ) ) @@ -1488,28 +1488,28 @@ This commonly includes things such as: ) ;; definition for method 169 of type nav-enemy -(defmethod nav-enemy-method-169 nav-enemy ((obj nav-enemy) (arg0 float) (arg1 symbol)) +(defmethod nav-enemy-method-169 nav-enemy ((this nav-enemy) (arg0 float) (arg1 symbol)) (if arg1 - (set! (-> obj nav-radius-backup) arg0) + (set! (-> this nav-radius-backup) arg0) ) - (if (zero? (-> obj restore-nav-radius-time)) - (set! (-> obj root nav-radius) arg0) + (if (zero? (-> this restore-nav-radius-time)) + (set! (-> this root nav-radius) arg0) ) ) ;; definition for method 168 of type nav-enemy -(defmethod nav-enemy-method-168 nav-enemy ((obj nav-enemy)) - (if (zero? (-> obj restore-nav-radius-time)) - (set! (-> obj root nav-radius) (-> obj nav-radius-backup)) +(defmethod nav-enemy-method-168 nav-enemy ((this nav-enemy)) + (if (zero? (-> this restore-nav-radius-time)) + (set! (-> this root nav-radius) (-> this nav-radius-backup)) ) ) ;; definition for method 144 of type nav-enemy ;; WARN: Return type mismatch int vs time-frame. -(defmethod nav-enemy-method-144 nav-enemy ((obj nav-enemy)) - (set! (-> obj root nav-radius) 4.096) - (let ((s5-1 (max (-> obj restore-nav-radius-time) (+ (current-time) (get-rand-int-range obj 1500 2400))))) - (set! (-> obj restore-nav-radius-time) (the-as time-frame s5-1)) +(defmethod nav-enemy-method-144 nav-enemy ((this nav-enemy)) + (set! (-> this root nav-radius) 4.096) + (let ((s5-1 (max (-> this restore-nav-radius-time) (+ (current-time) (get-rand-int-range this 1500 2400))))) + (set! (-> this restore-nav-radius-time) (the-as time-frame s5-1)) (the-as time-frame s5-1) ) ) @@ -1534,7 +1534,7 @@ This commonly includes things such as: (nav-enemy-method-176 self) (if (and (nav-enemy-method-163 self) (zero? (-> self restore-nav-radius-time)) - (>= (- (current-time) (-> self blocked-start-time)) (seconds 4)) + (time-elapsed? (-> self blocked-start-time) (seconds 4)) ) (nav-enemy-method-144 self) ) @@ -1559,7 +1559,7 @@ This commonly includes things such as: (seek-toward-heading-vec! (-> self root) arg0 (-> self nav max-rotation-rate) (seconds 0.02)) (suspend) (ja :num! (loop! 0.75)) - (set! v1-18 (or (>= (- (current-time) s4-0) (seconds 10)) (enemy-method-94 self arg0 arg1))) + (set! v1-18 (or (time-elapsed? s4-0 (seconds 10)) (enemy-method-94 self arg0 arg1))) ) ) (forward-up->quaternion (-> self root quat) arg0 *y-vector*) @@ -1582,48 +1582,48 @@ This commonly includes things such as: ) ;; definition for method 68 of type nav-enemy -(defmethod go-stare2 nav-enemy ((obj nav-enemy)) - (if (!= (-> obj enemy-info taunt-anim) -1) - (go (method-of-object obj taunt)) +(defmethod go-stare2 nav-enemy ((this nav-enemy)) + (if (!= (-> this enemy-info taunt-anim) -1) + (go (method-of-object this taunt)) ) - (go (method-of-object obj stare)) + (go (method-of-object this stare)) ) ;; definition for method 67 of type nav-enemy -(defmethod go-stare nav-enemy ((obj nav-enemy)) - (let ((s5-0 (-> obj focus aware))) +(defmethod go-stare nav-enemy ((this nav-enemy)) + (let ((s5-0 (-> this focus aware))) (cond - ((or (and (-> obj enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> obj enemy-flags))) - (nav-enemy-method-163 obj) + ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) + (nav-enemy-method-163 this) ) - (go-stare2 obj) + (go-stare2 this) ) - ((and (= s5-0 (enemy-aware enemy-aware-3)) (-> obj enemy-info use-circling)) - (go (method-of-object obj circling)) + ((and (= s5-0 (enemy-aware enemy-aware-3)) (-> this enemy-info use-circling)) + (go (method-of-object this circling)) ) ((= s5-0 (enemy-aware unaware)) - (go (method-of-object obj flee)) + (go (method-of-object this flee)) ) (else - (go-stare2 obj) + (go-stare2 this) ) ) ) ) ;; definition for method 70 of type nav-enemy -(defmethod go-hostile nav-enemy ((obj nav-enemy)) - (if (or (and (-> obj enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> obj enemy-flags))) - (nav-enemy-method-163 obj) +(defmethod go-hostile nav-enemy ((this nav-enemy)) + (if (or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) + (nav-enemy-method-163 this) ) - (go-stare2 obj) - (go (method-of-object obj hostile)) + (go-stare2 this) + (go (method-of-object this hostile)) ) ) ;; definition for method 71 of type nav-enemy -(defmethod go-flee nav-enemy ((obj nav-enemy)) - (go (method-of-object obj flee)) +(defmethod go-flee nav-enemy ((this nav-enemy)) + (go (method-of-object this flee)) ) ;; definition for symbol *nav-enemy-debug-control-info*, type nav-enemy-debug-control-info @@ -1906,7 +1906,7 @@ This commonly includes things such as: (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (nav-enemy-method-163 self) (go-stare2 self) ) @@ -1942,7 +1942,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((a1-0 (new 'stack-no-clear 'vector))) (let ((a2-0 (-> self nav state))) (set! (-> a1-0 quad) (-> a2-0 target-post quad)) @@ -1976,14 +1976,14 @@ This commonly includes things such as: (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (nav-enemy-method-163 self) (go-stare2 self) ) (let ((gp-0 (-> self focus aware))) (cond ((>= 1 (the-as int gp-0)) - (if (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) (go-virtual active) ) ) @@ -1994,7 +1994,7 @@ This commonly includes things such as: (go-flee self) ) (else - (if (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) (go-stare self) ) ) @@ -2043,7 +2043,7 @@ This commonly includes things such as: 0 (nav-enemy-method-167 self) (vector-reset! (-> self root transv)) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) :exit (behavior () (rlet ((acc :class vf) @@ -2102,9 +2102,9 @@ This commonly includes things such as: ) (let ((gp-0 (-> self focus aware))) (if (< (the-as int gp-0) 2) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) - (when (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) (not (nav-enemy-method-163 self))) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (not (nav-enemy-method-163 self))) (cond ((>= 1 (the-as int gp-0)) (go-virtual active) @@ -2112,7 +2112,7 @@ This commonly includes things such as: ((= gp-0 (enemy-aware enemy-aware-3)) (if (and (get-enemy-target self) (not (and (-> self enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> self enemy-flags)))) - (>= (- (current-time) (-> self starting-time)) (-> self reaction-time)) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) ) (go-hostile self) ) @@ -2125,7 +2125,7 @@ This commonly includes things such as: ) ((and (= gp-0 (enemy-aware enemy-aware-2)) (-> self enemy-info use-pacing) - (>= (- (current-time) (-> self starting-time)) (-> self reaction-time)) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) ) (go-virtual pacing) ) @@ -2169,7 +2169,7 @@ This commonly includes things such as: ) :exit (-> (method-of-type nav-enemy stare) exit) :trans (behavior () - (when (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) (not (nav-enemy-method-163 self))) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (not (nav-enemy-method-163 self))) (let ((v1-6 (-> self focus aware))) (cond ((>= 1 (the-as int v1-6)) @@ -2193,7 +2193,7 @@ This commonly includes things such as: :num! (loop! f28-0) :frame-num 0.0 ) - (until (>= (- (current-time) s5-0) gp-0) + (until (time-elapsed? s5-0 gp-0) (suspend) (ja :num! (loop! f28-0)) ) @@ -2218,7 +2218,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (look-at-target! self (enemy-flag lock-focus)) (logior! (-> self enemy-flags) (enemy-flag use-notice-distance)) (let ((v1-6 self)) @@ -2237,7 +2237,7 @@ This commonly includes things such as: (logclear! (-> self mask) (process-mask actor-pause)) (set! (-> self move-dest quad) (-> self root trans quad)) (set! (-> self state-timeout) (the-as time-frame (get-rand-int-range self 2100 3300))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) (if (zero? (get-rand-int self 2)) (set! (-> self enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag40) (-> self enemy-flags)))) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag enemy-flag40)))) @@ -2257,14 +2257,14 @@ This commonly includes things such as: ) (let ((gp-1 (-> self focus aware))) (if (or (!= gp-1 3) (not (get-enemy-target self))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (>= 1 (the-as int gp-1)) (go-virtual active) ) (when (= gp-1 (enemy-aware enemy-aware-3)) - (when (and (get-enemy-target self) (>= (- (current-time) (-> self starting-time)) (-> self reaction-time))) + (when (and (get-enemy-target self) (time-elapsed? (-> self starting-time) (-> self reaction-time))) (nav-enemy-method-161 self) (go-virtual hostile) ) @@ -2275,14 +2275,14 @@ This commonly includes things such as: (if (nav-enemy-method-163 self) (go-stare2 self) ) - (when (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (nav-enemy-method-161 self) (go-stare2 self) ) ) ) (when (>= 1024.0 (vector-vector-xz-distance (-> self root trans) (-> self move-dest))) - (when (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) (zero? (get-rand-int self 3))) + (when (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (zero? (get-rand-int self 3))) (nav-enemy-method-161 self) (go-stare2 self) ) @@ -2351,7 +2351,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (look-at-target! self (enemy-flag lock-focus)) (logior! (-> self enemy-flags) (enemy-flag use-notice-distance)) (let ((v1-6 self)) @@ -2386,7 +2386,7 @@ This commonly includes things such as: ) (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag enemy-flag41)))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) :trans (behavior () (let ((a0-1 (handle->process (-> self focus handle)))) @@ -2396,9 +2396,9 @@ This commonly includes things such as: ) (let ((gp-1 (-> self focus aware))) (if (or (!= gp-1 3) (not (get-enemy-target self))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (when (>= 1 (the-as int gp-1)) (nav-enemy-method-161 self) (if (-> self enemy-info use-stop-chase) @@ -2408,7 +2408,7 @@ This commonly includes things such as: ) (when (and (= gp-1 (enemy-aware enemy-aware-3)) (get-enemy-target self) - (>= (- (current-time) (-> self starting-time)) (-> self reaction-time)) + (time-elapsed? (-> self starting-time) (-> self reaction-time)) ) (nav-enemy-method-161 self) (go-hostile self) @@ -2506,7 +2506,7 @@ This commonly includes things such as: 0 ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (let ((v1-3 (-> self focus aware))) (if (!= v1-3 (enemy-aware unaware)) (go-stare self) @@ -2681,25 +2681,25 @@ This commonly includes things such as: ;; definition for method 82 of type nav-enemy ;; INFO: Used lq/sq -(defmethod enemy-method-82 nav-enemy ((obj nav-enemy) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 nav-enemy ((this nav-enemy) (arg0 enemy-jump-info)) "@abstract" (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) - (set! (-> v1-0 w) (-> obj nav-radius-backup)) - (add-root-sphere-to-hash! (-> obj nav) v1-0 #x80068) + (set! (-> v1-0 w) (-> this nav-radius-backup)) + (add-root-sphere-to-hash! (-> this nav) v1-0 #x80068) ) ) ;; definition for method 92 of type nav-enemy ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-92 nav-enemy ((obj nav-enemy) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 nav-enemy ((this nav-enemy) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" (let ((v1-0 arg0)) (when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3)) - (let ((a1-4 obj)) + (let ((a1-4 this)) (if (logtest? (enemy-flag enemy-flag37) (-> a1-4 enemy-flags)) - (seek-to-point-toward-point! (-> obj root) (-> arg1 vertex2) (-> obj nav max-rotation-rate) (seconds 0.02)) + (seek-to-point-toward-point! (-> this root) (-> arg1 vertex2) (-> this nav max-rotation-rate) (seconds 0.02)) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc index 72bd52167e..dc8af19a7e 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc @@ -23,27 +23,27 @@ ) ;; definition for method 3 of type nav-mesh-work-debug -(defmethod inspect nav-mesh-work-debug ((obj nav-mesh-work-debug)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-mesh-work-debug ((this nav-mesh-work-debug)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-mesh-work-debug) - (format #t "~1Tdebug-vec1: ~`vector`P~%" (-> obj debug-vec1)) - (format #t "~1Tdebug-vec2: ~`vector`P~%" (-> obj debug-vec2)) - (format #t "~1Tdebug-vec3: ~`vector`P~%" (-> obj debug-vec3)) - (format #t "~1Tdebug-vec4: ~`vector`P~%" (-> obj debug-vec4)) - (format #t "~1Tdebug-vec5: ~`vector`P~%" (-> obj debug-vec5)) - (format #t "~1Tdebug-vec6: ~`vector`P~%" (-> obj debug-vec6)) - (format #t "~1Tdebug-vec7: ~`vector`P~%" (-> obj debug-vec7)) - (format #t "~1Tdebug-vec8: ~`vector`P~%" (-> obj debug-vec8)) - (format #t "~1Tdebug-vec9: ~`vector`P~%" (-> obj debug-vec9)) - (format #t "~1Tdebug-vec10: ~`vector`P~%" (-> obj debug-vec10)) - (format #t "~1Tdebug-vec11: ~`vector`P~%" (-> obj debug-vec11)) - (format #t "~1Tdebug-vec12: ~`vector`P~%" (-> obj debug-vec12)) - (format #t "~1Tsphere-array[16] @ #x~X~%" (-> obj sphere-array)) + (format #t "[~8x] ~A~%" this 'nav-mesh-work-debug) + (format #t "~1Tdebug-vec1: ~`vector`P~%" (-> this debug-vec1)) + (format #t "~1Tdebug-vec2: ~`vector`P~%" (-> this debug-vec2)) + (format #t "~1Tdebug-vec3: ~`vector`P~%" (-> this debug-vec3)) + (format #t "~1Tdebug-vec4: ~`vector`P~%" (-> this debug-vec4)) + (format #t "~1Tdebug-vec5: ~`vector`P~%" (-> this debug-vec5)) + (format #t "~1Tdebug-vec6: ~`vector`P~%" (-> this debug-vec6)) + (format #t "~1Tdebug-vec7: ~`vector`P~%" (-> this debug-vec7)) + (format #t "~1Tdebug-vec8: ~`vector`P~%" (-> this debug-vec8)) + (format #t "~1Tdebug-vec9: ~`vector`P~%" (-> this debug-vec9)) + (format #t "~1Tdebug-vec10: ~`vector`P~%" (-> this debug-vec10)) + (format #t "~1Tdebug-vec11: ~`vector`P~%" (-> this debug-vec11)) + (format #t "~1Tdebug-vec12: ~`vector`P~%" (-> this debug-vec12)) + (format #t "~1Tsphere-array[16] @ #x~X~%" (-> this sphere-array)) (label cfg-4) - obj + this ) ;; definition of type nav-mesh-work @@ -73,32 +73,32 @@ ) ;; definition for method 3 of type nav-mesh-work -(defmethod inspect nav-mesh-work ((obj nav-mesh-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-mesh-work ((this nav-mesh-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-mesh-work) - (format #t "~1Tvert0-table[4] @ #x~X~%" (-> obj vert0-table)) - (format #t "~1Tvert1-table[4] @ #x~X~%" (-> obj vert1-table)) - (format #t "~1Tedge-mask-table[3] @ #x~X~%" (-> obj edge-mask-table)) - (format #t "~1Tpad0: ~D~%" (-> obj pad0)) - (format #t "~1Tdeg-to-rad: ~f~%" (-> obj deg-to-rad)) - (format #t "~1Trad-to-deg: ~f~%" (-> obj rad-to-deg)) - (format #t "~1Tnav-poly-min-dist: ~f~%" (-> obj nav-poly-min-dist)) - (format #t "~1Tnav-poly-epsilon: ~f~%" (-> obj nav-poly-epsilon)) - (format #t "~1Tsphere-array[16] @ #x~X~%" (-> obj sphere-array)) - (format #t "~1Tdebug: #~%" (-> obj debug)) - (format #t "~1Twork-struct-in-scratch: ~D~%" (-> obj work-struct-in-scratch)) - (format #t "~1Tmesh-struct-in-scratch: ~D~%" (-> obj mesh-struct-in-scratch)) - (format #t "~1Tpolys-in-scratch: ~D~%" (-> obj polys-in-scratch)) - (format #t "~1Tmesh: ~A~%" (-> obj mesh)) - (format #t "~1Tnav: ~A~%" (-> obj nav)) - (format #t "~1Tpoly0: ~A~%" (-> obj poly0)) - (format #t "~1Tpoly1: ~A~%" (-> obj poly1)) - (format #t "~1Tpoly-id: ~D~%" (-> obj poly-id)) + (format #t "[~8x] ~A~%" this 'nav-mesh-work) + (format #t "~1Tvert0-table[4] @ #x~X~%" (-> this vert0-table)) + (format #t "~1Tvert1-table[4] @ #x~X~%" (-> this vert1-table)) + (format #t "~1Tedge-mask-table[3] @ #x~X~%" (-> this edge-mask-table)) + (format #t "~1Tpad0: ~D~%" (-> this pad0)) + (format #t "~1Tdeg-to-rad: ~f~%" (-> this deg-to-rad)) + (format #t "~1Trad-to-deg: ~f~%" (-> this rad-to-deg)) + (format #t "~1Tnav-poly-min-dist: ~f~%" (-> this nav-poly-min-dist)) + (format #t "~1Tnav-poly-epsilon: ~f~%" (-> this nav-poly-epsilon)) + (format #t "~1Tsphere-array[16] @ #x~X~%" (-> this sphere-array)) + (format #t "~1Tdebug: #~%" (-> this debug)) + (format #t "~1Twork-struct-in-scratch: ~D~%" (-> this work-struct-in-scratch)) + (format #t "~1Tmesh-struct-in-scratch: ~D~%" (-> this mesh-struct-in-scratch)) + (format #t "~1Tpolys-in-scratch: ~D~%" (-> this polys-in-scratch)) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tnav: ~A~%" (-> this nav)) + (format #t "~1Tpoly0: ~A~%" (-> this poly0)) + (format #t "~1Tpoly1: ~A~%" (-> this poly1)) + (format #t "~1Tpoly-id: ~D~%" (-> this poly-id)) (label cfg-4) - obj + this ) ;; definition of type nav-mesh-link @@ -117,21 +117,21 @@ ) ;; definition for method 3 of type nav-mesh-link -(defmethod inspect nav-mesh-link ((obj nav-mesh-link)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-mesh-link ((this nav-mesh-link)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-mesh-link) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tdest-mesh-id: ~D~%" (-> obj dest-mesh-id)) - (format #t "~1Tsrc-link-poly-id: ~D~%" (-> obj src-link-poly-id)) - (format #t "~1Tsrc-switch-poly-id: ~D~%" (-> obj src-switch-poly-id)) - (format #t "~1Tdest-link-poly-id: ~D~%" (-> obj dest-link-poly-id)) - (format #t "~1Tdest-switch-poly-id: ~D~%" (-> obj dest-switch-poly-id)) - (format #t "~1Tdest-mesh: ~A~%" (-> obj dest-mesh)) + (format #t "[~8x] ~A~%" this 'nav-mesh-link) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tdest-mesh-id: ~D~%" (-> this dest-mesh-id)) + (format #t "~1Tsrc-link-poly-id: ~D~%" (-> this src-link-poly-id)) + (format #t "~1Tsrc-switch-poly-id: ~D~%" (-> this src-switch-poly-id)) + (format #t "~1Tdest-link-poly-id: ~D~%" (-> this dest-link-poly-id)) + (format #t "~1Tdest-switch-poly-id: ~D~%" (-> this dest-switch-poly-id)) + (format #t "~1Tdest-mesh: ~A~%" (-> this dest-mesh)) (label cfg-4) - obj + this ) ;; definition of type nav-poly @@ -160,31 +160,31 @@ ) ;; definition for method 3 of type nav-poly -(defmethod inspect nav-poly ((obj nav-poly)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-poly ((this nav-poly)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-poly) - (format #t "~1Tdata[64] @ #x~X~%" (-> obj vertex)) - (format #t "~1Tvertex[4] @ #x~X~%" (-> obj vertex)) - (format #t "~1Tvertex0: ~`vector`P~%" (-> obj vertex)) - (format #t "~1Tvertex1: ~`vector`P~%" (-> obj vertex1)) - (format #t "~1Tvertex2: ~`vector`P~%" (-> obj vertex2)) - (format #t "~1Tvertex3: ~`vector`P~%" (-> obj vertex3)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tpat: ~D~%" (-> obj pat)) - (format #t "~1Tvertex-count: ~D~%" (-> obj vertex-count)) - (format #t "~1Tlink: ~D~%" (-> obj link)) - (format #t "~1Tadj-poly[4] @ #x~X~%" (&-> obj vertex1 w)) - (format #t "~1Tadj-poly0: ~D~%" (-> obj adj-poly0)) - (format #t "~1Tadj-poly1: ~D~%" (-> obj adj-poly1)) - (format #t "~1Tadj-poly2: ~D~%" (-> obj adj-poly2)) - (format #t "~1Tadj-poly3: ~D~%" (-> obj adj-poly3)) - (format #t "~1Tmin-y: ~f~%" (-> obj vertex2 w)) - (format #t "~1Tmax-y: ~f~%" (-> obj vertex3 w)) + (format #t "[~8x] ~A~%" this 'nav-poly) + (format #t "~1Tdata[64] @ #x~X~%" (-> this vertex)) + (format #t "~1Tvertex[4] @ #x~X~%" (-> this vertex)) + (format #t "~1Tvertex0: ~`vector`P~%" (-> this vertex)) + (format #t "~1Tvertex1: ~`vector`P~%" (-> this vertex1)) + (format #t "~1Tvertex2: ~`vector`P~%" (-> this vertex2)) + (format #t "~1Tvertex3: ~`vector`P~%" (-> this vertex3)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tpat: ~D~%" (-> this pat)) + (format #t "~1Tvertex-count: ~D~%" (-> this vertex-count)) + (format #t "~1Tlink: ~D~%" (-> this link)) + (format #t "~1Tadj-poly[4] @ #x~X~%" (&-> this vertex1 w)) + (format #t "~1Tadj-poly0: ~D~%" (-> this adj-poly0)) + (format #t "~1Tadj-poly1: ~D~%" (-> this adj-poly1)) + (format #t "~1Tadj-poly2: ~D~%" (-> this adj-poly2)) + (format #t "~1Tadj-poly3: ~D~%" (-> this adj-poly3)) + (format #t "~1Tmin-y: ~f~%" (-> this vertex2 w)) + (format #t "~1Tmax-y: ~f~%" (-> this vertex3 w)) (label cfg-4) - obj + this ) ;; definition of type nav-vertex @@ -199,20 +199,20 @@ and declared out of order (cannot use forward declared structures in inline arra ;; definition for method 3 of type nav-vertex ;; INFO: Used lq/sq -(defmethod inspect nav-vertex ((obj nav-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-vertex ((this nav-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-vertex) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'nav-vertex) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type nav-sphere @@ -225,15 +225,15 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; definition for method 3 of type nav-sphere -(defmethod inspect nav-sphere ((obj nav-sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-sphere ((this nav-sphere)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-sphere) - (format #t "~1Ttrans: #~%" (-> obj trans)) + (format #t "[~8x] ~A~%" this 'nav-sphere) + (format #t "~1Ttrans: #~%" (-> this trans)) (label cfg-4) - obj + this ) ;; definition of type nav-ray @@ -257,26 +257,26 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; definition for method 3 of type nav-ray -(defmethod inspect nav-ray ((obj nav-ray)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-ray ((this nav-ray)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-ray) - (format #t "~1Tcurrent-pos: #~%" (-> obj current-pos)) - (format #t "~1Tdir: #~%" (-> obj dir)) - (format #t "~1Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~1Tcurrent-poly: #~%" (-> obj current-poly)) - (format #t "~1Tnext-poly: #~%" (-> obj next-poly)) - (format #t "~1Tlen: (meters ~m)~%" (-> obj len)) - (format #t "~1Tlast-edge: ~D~%" (-> obj last-edge)) - (format #t "~1Tignore: ~D~%" (-> obj ignore)) - (format #t "~1Tterminated: ~A~%" (-> obj terminated)) - (format #t "~1Treached-dest: ~A~%" (-> obj reached-dest)) - (format #t "~1Thit-boundary: ~A~%" (-> obj hit-boundary)) - (format #t "~1Thit-gap: ~A~%" (-> obj hit-gap)) + (format #t "[~8x] ~A~%" this 'nav-ray) + (format #t "~1Tcurrent-pos: #~%" (-> this current-pos)) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~1Tcurrent-poly: #~%" (-> this current-poly)) + (format #t "~1Tnext-poly: #~%" (-> this next-poly)) + (format #t "~1Tlen: (meters ~m)~%" (-> this len)) + (format #t "~1Tlast-edge: ~D~%" (-> this last-edge)) + (format #t "~1Tignore: ~D~%" (-> this ignore)) + (format #t "~1Tterminated: ~A~%" (-> this terminated)) + (format #t "~1Treached-dest: ~A~%" (-> this reached-dest)) + (format #t "~1Thit-boundary: ~A~%" (-> this hit-boundary)) + (format #t "~1Thit-gap: ~A~%" (-> this hit-gap)) (label cfg-4) - obj + this ) ;; definition of type nav-route-portal @@ -291,17 +291,17 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; definition for method 3 of type nav-route-portal -(defmethod inspect nav-route-portal ((obj nav-route-portal)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-route-portal ((this nav-route-portal)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-route-portal) - (format #t "~1Tvertex[2] @ #x~X~%" (-> obj vertex)) - (format #t "~1Tnext-poly: #~%" (-> obj next-poly)) - (format #t "~1Tedge-index: ~D~%" (-> obj edge-index)) + (format #t "[~8x] ~A~%" this 'nav-route-portal) + (format #t "~1Tvertex[2] @ #x~X~%" (-> this vertex)) + (format #t "~1Tnext-poly: #~%" (-> this next-poly)) + (format #t "~1Tedge-index: ~D~%" (-> this edge-index)) (label cfg-4) - obj + this ) ;; definition of type nav-find-poly-parms @@ -319,20 +319,20 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; definition for method 3 of type nav-find-poly-parms -(defmethod inspect nav-find-poly-parms ((obj nav-find-poly-parms)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-find-poly-parms ((this nav-find-poly-parms)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-find-poly-parms) - (format #t "~1Tpoint: #~%" (-> obj point)) - (format #t "~1Ty-threshold: ~f~%" (-> obj y-threshold)) - (format #t "~1Tignore: ~D~%" (-> obj ignore)) - (format #t "~1Tpoly: #~%" (-> obj poly)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) - (format #t "~1Tpoint-inside?: ~A~%" (-> obj point-inside?)) + (format #t "[~8x] ~A~%" this 'nav-find-poly-parms) + (format #t "~1Tpoint: #~%" (-> this point)) + (format #t "~1Ty-threshold: ~f~%" (-> this y-threshold)) + (format #t "~1Tignore: ~D~%" (-> this ignore)) + (format #t "~1Tpoly: #~%" (-> this poly)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tpoint-inside?: ~A~%" (-> this point-inside?)) (label cfg-4) - obj + this ) ;; definition of type clamp-travel-vector-to-mesh-return-info @@ -357,27 +357,27 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; definition for method 3 of type clamp-travel-vector-to-mesh-return-info -(defmethod inspect clamp-travel-vector-to-mesh-return-info ((obj clamp-travel-vector-to-mesh-return-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect clamp-travel-vector-to-mesh-return-info ((this clamp-travel-vector-to-mesh-return-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'clamp-travel-vector-to-mesh-return-info) - (format #t "~1Tfound-boundary: ~A~%" (-> obj found-boundary)) - (format #t "~1Tintersection: #~%" (-> obj intersection)) - (format #t "~1Tboundary-normal: #~%" (-> obj boundary-normal)) - (format #t "~1Tprev-normal: #~%" (-> obj prev-normal)) - (format #t "~1Tnext-normal: #~%" (-> obj next-normal)) - (format #t "~1Tpoly: #~%" (-> obj poly)) - (format #t "~1Tgap-poly: #~%" (-> obj gap-poly)) - (format #t "~1Tedge: ~D~%" (-> obj edge)) - (format #t "~1Tignore: ~D~%" (-> obj ignore)) - (format #t "~1Tvert-prev: #~%" (-> obj vert-prev)) - (format #t "~1Tvert-0: #~%" (-> obj vert-0)) - (format #t "~1Tvert-1: #~%" (-> obj vert-1)) - (format #t "~1Tvert-next: #~%" (-> obj vert-next)) + (format #t "[~8x] ~A~%" this 'clamp-travel-vector-to-mesh-return-info) + (format #t "~1Tfound-boundary: ~A~%" (-> this found-boundary)) + (format #t "~1Tintersection: #~%" (-> this intersection)) + (format #t "~1Tboundary-normal: #~%" (-> this boundary-normal)) + (format #t "~1Tprev-normal: #~%" (-> this prev-normal)) + (format #t "~1Tnext-normal: #~%" (-> this next-normal)) + (format #t "~1Tpoly: #~%" (-> this poly)) + (format #t "~1Tgap-poly: #~%" (-> this gap-poly)) + (format #t "~1Tedge: ~D~%" (-> this edge)) + (format #t "~1Tignore: ~D~%" (-> this ignore)) + (format #t "~1Tvert-prev: #~%" (-> this vert-prev)) + (format #t "~1Tvert-0: #~%" (-> this vert-0)) + (format #t "~1Tvert-1: #~%" (-> this vert-1)) + (format #t "~1Tvert-next: #~%" (-> this vert-next)) (label cfg-4) - obj + this ) ;; definition of type nav-mesh @@ -453,44 +453,44 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; definition for method 3 of type nav-mesh -(defmethod inspect nav-mesh ((obj nav-mesh)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-mesh ((this nav-mesh)) + (when (not this) + (set! this this) (goto cfg-6) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twork: #~%" (-> obj work)) - (format #t "~1Tpoly-array: #x~X~%" (-> obj poly-array)) - (format #t "~1Tstatic-sphere-count: ~D~%" (-> obj static-sphere-count)) - (format #t "~1Tpoly-count: ~D~%" (-> obj poly-count)) - (format #t "~1Tnav-control-count: ~D~%" (-> obj nav-control-count)) - (format #t "~1Tmax-nav-control-count: ~D~%" (-> obj max-nav-control-count)) - (format #t "~1Troute: #x~X~%" (-> obj route)) - (format #t "~1Tpoly-hash: ~A~%" (-> obj poly-hash)) - (format #t "~1Tnav-control-array: #x~X~%" (-> obj nav-control-array)) - (format #t "~1Tsphere-hash: ~A~%" (-> obj sphere-hash)) - (format #t "~1Tstatic-sphere: #x~X~%" (-> obj static-sphere)) - (format #t "~1Tuser-list: ~A~%" (-> obj user-list)) - (format #t "~1Tnext-nav-mesh: ~A~%" (-> obj next-nav-mesh)) - (format #t "~1Tprev-nav-mesh: ~A~%" (-> obj prev-nav-mesh)) - (format #t "~1Tbounds: ~`sphere`P~%" (-> obj bounds)) - (format #t "~1Torigin: #~%" (-> obj bounds)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tlink-array: #x~X~%" (-> obj link-array)) - (format #t "~1Tlink-count: ~D~%" (-> obj link-count)) - (format #t "~1Tflags: #x~X : (nav-mesh-flag " (-> obj flags)) - (let ((a0-22 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twork: #~%" (-> this work)) + (format #t "~1Tpoly-array: #x~X~%" (-> this poly-array)) + (format #t "~1Tstatic-sphere-count: ~D~%" (-> this static-sphere-count)) + (format #t "~1Tpoly-count: ~D~%" (-> this poly-count)) + (format #t "~1Tnav-control-count: ~D~%" (-> this nav-control-count)) + (format #t "~1Tmax-nav-control-count: ~D~%" (-> this max-nav-control-count)) + (format #t "~1Troute: #x~X~%" (-> this route)) + (format #t "~1Tpoly-hash: ~A~%" (-> this poly-hash)) + (format #t "~1Tnav-control-array: #x~X~%" (-> this nav-control-array)) + (format #t "~1Tsphere-hash: ~A~%" (-> this sphere-hash)) + (format #t "~1Tstatic-sphere: #x~X~%" (-> this static-sphere)) + (format #t "~1Tuser-list: ~A~%" (-> this user-list)) + (format #t "~1Tnext-nav-mesh: ~A~%" (-> this next-nav-mesh)) + (format #t "~1Tprev-nav-mesh: ~A~%" (-> this prev-nav-mesh)) + (format #t "~1Tbounds: ~`sphere`P~%" (-> this bounds)) + (format #t "~1Torigin: #~%" (-> this bounds)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlink-array: #x~X~%" (-> this link-array)) + (format #t "~1Tlink-count: ~D~%" (-> this link-count)) + (format #t "~1Tflags: #x~X : (nav-mesh-flag " (-> this flags)) + (let ((a0-22 (-> this flags))) (if (= (logand a0-22 (nav-mesh-flag dummy)) (nav-mesh-flag dummy)) (format #t "dummy ") ) ) (format #t ")~%") - (format #t "~1Tpad1[2] @ #x~X~%" (-> obj pad1)) - (format #t "~1Tnearest-y-threshold: (meters ~m)~%" (-> obj nearest-y-threshold)) - (format #t "~1Twater-max-height: (meters ~m)~%" (-> obj water-max-height)) - (format #t "~1Tpad2[7] @ #x~X~%" (-> obj pad2)) + (format #t "~1Tpad1[2] @ #x~X~%" (-> this pad1)) + (format #t "~1Tnearest-y-threshold: (meters ~m)~%" (-> this nearest-y-threshold)) + (format #t "~1Twater-max-height: (meters ~m)~%" (-> this water-max-height)) + (format #t "~1Tpad2[7] @ #x~X~%" (-> this pad2)) (label cfg-6) - obj + this ) ;; definition for function vector-normalize-unity! @@ -635,8 +635,8 @@ and declared out of order (cannot use forward declared structures in inline arra ) ;; definition for method 37 of type nav-mesh -(defmethod point-in-poly? nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) - (let* ((a3-0 obj) +(defmethod point-in-poly? nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (let* ((a3-0 this) (v1-0 arg1) (a0-1 (-> arg0 vertex-count)) (a1-1 (-> arg0 vertex)) @@ -668,7 +668,7 @@ and declared out of order (cannot use forward declared structures in inline arra ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Return type mismatch vector vs none. -(defmethod closest-point-on-boundary nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod closest-point-on-boundary nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) @@ -697,10 +697,10 @@ and declared out of order (cannot use forward declared structures in inline arra ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Stack slot offset 56 signed mismatch ;; WARN: Return type mismatch vector vs none. -(defmethod project-point-into-poly-2d nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) +(defmethod project-point-into-poly-2d nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (cond - ((point-in-poly? obj arg0 arg2) + ((point-in-poly? this arg0 arg2) (set! (-> arg1 quad) (-> arg2 quad)) ) (else @@ -779,7 +779,7 @@ and declared out of order (cannot use forward declared structures in inline arra ;; WARN: Stack slot offset 44 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod move-along-nav-ray! nav-mesh ((obj nav-mesh) (ray nav-ray)) +(defmethod move-along-nav-ray! nav-mesh ((this nav-mesh) (ray nav-ray)) (local-vars (next-poly-idx int) (work nav-mesh-work) @@ -796,11 +796,11 @@ and declared out of order (cannot use forward declared structures in inline arra (sv-68 uint) ) (set! next-poly-idx -1) - (set! work (-> obj work)) + (set! work (-> this work)) (set! current-poly (-> ray current-poly)) (set! current-poly-vtx-count (-> ray current-poly vertex-count)) - (set! v0-table (-> obj work vert0-table)) - (set! v1-table (-> obj work vert1-table)) + (set! v0-table (-> this work vert0-table)) + (set! v1-table (-> this work vert1-table)) (set! delta-x (- (-> ray dest-pos x) (-> ray current-pos x))) (set! delta-z (- (-> ray dest-pos z) (-> ray current-pos z))) (dotimes (i (the-as int current-poly-vtx-count)) @@ -842,7 +842,7 @@ and declared out of order (cannot use forward declared structures in inline arra (+! (-> ray current-pos z) delta-z) (set! sv-68 (-> current-poly adj-poly next-poly-idx)) (if (!= sv-68 255) - (set! (-> ray next-poly) (-> obj poly-array sv-68)) + (set! (-> ray next-poly) (-> this poly-array sv-68)) ) (cond ((and (-> ray next-poly) (not (logtest? (-> ray next-poly pat) (-> ray ignore)))) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc index 23cbfd67b8..1ae06d8e05 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc @@ -354,11 +354,11 @@ ;; definition for method 27 of type entity-nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod initialize-nav-mesh! entity-nav-mesh ((obj entity-nav-mesh)) +(defmethod initialize-nav-mesh! entity-nav-mesh ((this entity-nav-mesh)) "Initialize the nav-mesh in this entity." - (let ((v1-0 (-> obj nav-mesh))) + (let ((v1-0 (-> this nav-mesh))) (if (nonzero? v1-0) - (init-from-entity v1-0 obj) + (init-from-entity v1-0 this) ) ) 0 @@ -366,37 +366,37 @@ ) ;; definition for method 22 of type entity-nav-mesh -(defmethod birth! entity-nav-mesh ((obj entity-nav-mesh)) - (let ((a0-1 (-> obj nav-mesh))) +(defmethod birth! entity-nav-mesh ((this entity-nav-mesh)) + (let ((a0-1 (-> this nav-mesh))) (if (nonzero? a0-1) (handle-birth a0-1) ) ) - obj + this ) ;; definition for method 23 of type entity-nav-mesh -(defmethod kill! entity-nav-mesh ((obj entity-nav-mesh)) - (if (-> obj nav-mesh) - (handle-kill (-> obj nav-mesh)) +(defmethod kill! entity-nav-mesh ((this entity-nav-mesh)) + (if (-> this nav-mesh) + (handle-kill (-> this nav-mesh)) ) - obj + this ) ;; definition for method 28 of type entity-nav-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw entity-nav-mesh ((obj entity-nav-mesh)) +(defmethod debug-draw entity-nav-mesh ((this entity-nav-mesh)) (add-debug-x #t (bucket-id debug-no-zbuf1) - (-> obj nav-mesh bounds) + (-> this nav-mesh bounds) (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj nav-mesh bounds quad)) + (set! (-> s5-0 quad) (-> this nav-mesh bounds quad)) (let ((a0-6 (new 'stack 'random-generator))) - (set! (-> a0-6 seed) (-> obj aid)) + (set! (-> a0-6 seed) (-> this aid)) (let* ((v1-4 (rand-uint31-gen a0-6)) (f30-0 (* 182.04445 (the float (logand v1-4 #xffff)))) ) @@ -407,7 +407,7 @@ (add-debug-text-3d #t (bucket-id debug-no-zbuf1) - (res-lump-struct obj 'name string) + (res-lump-struct this 'name string) s5-0 (font-color white) (new 'static 'vector2h :data (new 'static 'array int16 2 0 8)) @@ -416,7 +416,7 @@ (s3-1 #t) (s2-1 318) ) - (format (clear *temp-string*) "aid ~D" (-> obj aid)) + (format (clear *temp-string*) "aid ~D" (-> this aid)) (s4-1 s3-1 (the-as bucket-id s2-1) @@ -427,14 +427,14 @@ ) ) ) - (debug-draw (-> obj nav-mesh)) + (debug-draw (-> this nav-mesh)) 0 (none) ) ;; definition for method 31 of type entity-actor ;; INFO: Used lq/sq -(defmethod get-simple-travel-vector entity-actor ((obj entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) +(defmethod get-simple-travel-vector entity-actor ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 object) (arg4 float)) (local-vars (at-0 int) (at-1 int)) (with-pp (rlet ((vf0 :class vf) @@ -442,7 +442,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((gp-0 (nav-mesh-from-res-tag obj 'nav-mesh-actor 0))) + (let ((gp-0 (nav-mesh-from-res-tag this 'nav-mesh-actor 0))) (cond (gp-0 (let ((v1-0 arg0)) @@ -504,9 +504,9 @@ ;; definition for method 32 of type entity-actor ;; INFO: Used lq/sq -(defmethod project-point-to-nav-mesh entity-actor ((obj entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) +(defmethod project-point-to-nav-mesh entity-actor ((this entity-actor) (arg0 vector) (arg1 vector) (arg2 nav-poly) (arg3 float)) (local-vars (sv-16 vector)) - (let ((gp-0 (nav-mesh-from-res-tag obj 'nav-mesh-actor 0))) + (let ((gp-0 (nav-mesh-from-res-tag this 'nav-mesh-actor 0))) (cond (gp-0 (set! sv-16 arg0) @@ -535,16 +535,16 @@ ;; definition for method 4 of type nav-mesh ;; WARN: Return type mismatch uint vs int. -(defmethod length nav-mesh ((obj nav-mesh)) - (the-as int (-> obj poly-count)) +(defmethod length nav-mesh ((this nav-mesh)) + (the-as int (-> this poly-count)) ) ;; definition for method 36 of type nav-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-poly nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 rgba)) +(defmethod debug-draw-poly nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 rgba)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) - (set! (-> gp-0 0 quad) (-> obj bounds quad)) + (set! (-> gp-0 0 quad) (-> this bounds quad)) (if (logtest? (-> arg0 pat) 7) (+! (-> gp-0 0 y) 409.6) ) @@ -562,9 +562,9 @@ (set! v1-7 s2-0) ) ) - (when (and (logtest? (-> arg0 pat) 4) (< (-> arg0 link) (-> obj link-count))) - (poly-centroid obj arg0 (-> gp-0 1)) - (let ((s5-1 (-> obj link-array (-> arg0 link)))) + (when (and (logtest? (-> arg0 pat) 4) (< (-> arg0 link) (-> this link-count))) + (poly-centroid this arg0 (-> gp-0 1)) + (let ((s5-1 (-> this link-array (-> arg0 link)))) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> gp-0 1) *color-magenta*) (let ((s4-1 add-debug-text-3d) (s3-1 #t) @@ -588,30 +588,30 @@ ) ;; definition for method 27 of type nav-mesh -(defmethod new-nav-control nav-mesh ((obj nav-mesh) (arg0 process-drawable)) +(defmethod new-nav-control nav-mesh ((this nav-mesh) (arg0 process-drawable)) (let ((gp-0 (the-as nav-control #f))) - (dotimes (v1-0 (the-as int (-> obj nav-control-count))) - (let ((a1-2 (-> obj nav-control-array v1-0))) + (dotimes (v1-0 (the-as int (-> this nav-control-count))) + (let ((a1-2 (-> this nav-control-array v1-0))) (b! (-> a1-2 process) cfg-3 :delay (empty-form)) (set! gp-0 a1-2) ) (set! (-> gp-0 process) (the-as process 0)) - (set! (-> gp-0 state mesh) obj) + (set! (-> gp-0 state mesh) this) (b! #t cfg-8 :delay (nop!)) (label cfg-3) ) - (let ((v1-3 (-> obj nav-control-count))) + (let ((v1-3 (-> this nav-control-count))) (cond - ((< v1-3 (-> obj max-nav-control-count)) - (+! (-> obj nav-control-count) 1) - (set! gp-0 (-> obj nav-control-array v1-3)) - (set! (-> gp-0 state mesh) obj) + ((< v1-3 (-> this max-nav-control-count)) + (+! (-> this nav-control-count) 1) + (set! gp-0 (-> this nav-control-array v1-3)) + (set! (-> gp-0 state mesh) this) ) (else (format 0 "nav-mesh::new-nav-control: too many users for nav-mesh ~s~%" - (res-lump-struct (-> obj entity) 'name structure) + (res-lump-struct (-> this entity) 'name structure) ) ) ) @@ -623,13 +623,13 @@ ;; definition for method 28 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod remove-nav-control nav-mesh ((obj nav-mesh) (arg0 nav-control)) +(defmethod remove-nav-control nav-mesh ((this nav-mesh) (arg0 nav-control)) (set! (-> arg0 process) #f) - (let ((v1-1 (+ (-> obj nav-control-count) -1))) - (while (and (>= v1-1 0) (not (-> obj nav-control-array v1-1 process))) + (let ((v1-1 (+ (-> this nav-control-count) -1))) + (while (and (>= v1-1 0) (not (-> this nav-control-array v1-1 process))) (+! v1-1 -1) ) - (set! (-> obj nav-control-count) (+ v1-1 1)) + (set! (-> this nav-control-count) (+ v1-1 1)) ) 0 (none) @@ -637,10 +637,10 @@ ;; definition for method 29 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod add-process-drawable-to-navmesh nav-mesh ((obj nav-mesh) (arg0 process-drawable) (arg1 symbol)) +(defmethod add-process-drawable-to-navmesh nav-mesh ((this nav-mesh) (arg0 process-drawable) (arg1 symbol)) (if arg1 - (change-to obj arg0) - (add-connection (-> obj user-list) arg0 nothing arg0 #f (-> arg0 root)) + (change-to this arg0) + (add-connection (-> this user-list) arg0 nothing arg0 #f (-> arg0 root)) ) 0 (none) @@ -648,11 +648,11 @@ ;; definition for method 30 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod remove-process-drawable nav-mesh ((obj nav-mesh) (arg0 process-drawable)) - (remove-from-process (-> obj user-list) arg0) +(defmethod remove-process-drawable nav-mesh ((this nav-mesh) (arg0 process-drawable)) + (remove-from-process (-> this user-list) arg0) (let ((a1-2 (-> arg0 nav))) (when (nonzero? a1-2) - (remove-nav-control obj a1-2) + (remove-nav-control this a1-2) (set! (-> arg0 nav) #f) ) ) @@ -662,10 +662,10 @@ ;; definition for method 31 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod change-to nav-mesh ((obj nav-mesh) (arg0 process-drawable)) +(defmethod change-to nav-mesh ((this nav-mesh) (arg0 process-drawable)) (local-vars (v1-5 symbol)) (let ((gp-0 arg0)) - (b! (nonzero? (-> obj user-list)) cfg-2 :delay (empty-form)) + (b! (nonzero? (-> this user-list)) cfg-2 :delay (empty-form)) (go process-drawable-art-error "nav mesh not initialized") (b! #t cfg-18 :delay (nop!)) (label cfg-2) @@ -674,10 +674,10 @@ (set! s3-0 (the-as nav-control #f)) (label cfg-4) (b! (not s3-0) cfg-7 :likely-delay (set! v1-5 #t)) - (set! v1-5 (!= obj (-> s3-0 state mesh))) + (set! v1-5 (!= this (-> s3-0 state mesh))) (label cfg-7) (b! (not v1-5) cfg-18 :delay (empty-form)) - (let ((s4-0 (new-nav-control obj arg0))) + (let ((s4-0 (new-nav-control this arg0))) (b! s4-0 cfg-12 :delay (empty-form)) (b! (not *debug-segment*) cfg-11 :delay (empty-form)) (format 0 "ERROR: nav-mesh::change-to: unable to allocate nav-mesh for ~s~%" gp-0) @@ -687,7 +687,7 @@ (cond (s3-0 (quad-copy! (the-as pointer s4-0) (the-as pointer s3-0) 18) - (set! (-> s4-0 state mesh) obj) + (set! (-> s4-0 state mesh) this) (set! (-> s4-0 state nav) s4-0) (set! (-> s4-0 state current-poly) #f) (set! (-> s4-0 state virtual-current-poly) #f) @@ -703,11 +703,11 @@ (init! s4-0 (the-as collide-shape (-> gp-0 root))) ) ) - (set-nearest-y-thres! s4-0 (-> obj nearest-y-threshold)) + (set-nearest-y-thres! s4-0 (-> this nearest-y-threshold)) (set! (-> gp-0 nav) s4-0) ) ) - (add-connection (-> obj user-list) gp-0 nothing gp-0 #t (-> gp-0 root)) + (add-connection (-> this user-list) gp-0 nothing gp-0 #t (-> gp-0 root)) (send-event gp-0 'nav-mesh-new :from gp-0) ) (label cfg-18) @@ -716,7 +716,7 @@ ) ;; definition for method 45 of type nav-mesh -(defmethod link-to-other-mesh nav-mesh ((obj nav-mesh) (arg0 nav-mesh-link)) +(defmethod link-to-other-mesh nav-mesh ((this nav-mesh) (arg0 nav-mesh-link)) (when (not (-> arg0 dest-mesh)) (let* ((s4-0 (entity-nav-mesh-by-aid (the-as actor-id (-> arg0 dest-mesh-id)))) (v1-1 (if (type? s4-0 entity-nav-mesh) @@ -741,7 +741,7 @@ (label cfg-10) (when v1-2 (set! (-> arg0 dest-mesh) a0-3) - (set! (-> v1-2 dest-mesh) obj) + (set! (-> v1-2 dest-mesh) this) (set! (-> arg0 dest-link-poly-id) (-> v1-2 src-switch-poly-id)) (set! (-> arg0 dest-switch-poly-id) (-> v1-2 src-link-poly-id)) (set! (-> v1-2 dest-link-poly-id) (-> arg0 src-switch-poly-id)) @@ -756,7 +756,7 @@ ;; definition for method 46 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod unlink-mesh nav-mesh ((obj nav-mesh) (arg0 nav-mesh-link)) +(defmethod unlink-mesh nav-mesh ((this nav-mesh) (arg0 nav-mesh-link)) (let ((a0-1 (-> arg0 dest-mesh))) (when a0-1 (let ((v1-0 (the-as nav-mesh-link #f))) @@ -783,11 +783,11 @@ ) ;; definition for method 32 of type nav-mesh -(defmethod link-by-id nav-mesh ((obj nav-mesh) (arg0 uint)) +(defmethod link-by-id nav-mesh ((this nav-mesh) (arg0 uint)) "arg1 is a [[nav-mesh-link]] `id`" (let ((v1-0 (the-as nav-mesh-link #f))) - (dotimes (a2-0 (the-as int (-> obj link-count))) - (let ((a3-1 (-> obj link-array a2-0))) + (dotimes (a2-0 (the-as int (-> this link-count))) + (let ((a3-1 (-> this link-array a2-0))) (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) (set! v1-0 a3-1) ) @@ -796,17 +796,17 @@ ) (label cfg-6) (if v1-0 - (link-to-other-mesh obj v1-0) + (link-to-other-mesh this v1-0) ) ) ) ;; definition for method 33 of type nav-mesh -(defmethod unlink-by-id nav-mesh ((obj nav-mesh) (arg0 uint)) +(defmethod unlink-by-id nav-mesh ((this nav-mesh) (arg0 uint)) "arg1 is a [[nav-mesh-link]] `id`" (let ((v1-0 (the-as nav-mesh-link #f))) - (dotimes (a2-0 (the-as int (-> obj link-count))) - (let ((a3-1 (-> obj link-array a2-0))) + (dotimes (a2-0 (the-as int (-> this link-count))) + (let ((a3-1 (-> this link-array a2-0))) (b! (!= (-> a3-1 id) arg0) cfg-3 :delay (empty-form)) (set! v1-0 a3-1) ) @@ -815,7 +815,7 @@ ) (label cfg-6) (when v1-0 - (unlink-mesh obj v1-0) + (unlink-mesh this v1-0) #t ) ) @@ -824,48 +824,48 @@ ;; definition for method 23 of type nav-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-from-entity nav-mesh ((obj nav-mesh) (arg0 entity-nav-mesh)) +(defmethod init-from-entity nav-mesh ((this nav-mesh) (arg0 entity-nav-mesh)) "Initialize this mesh from an entity." (local-vars (sv-16 res-tag)) - (set! (-> obj entity) arg0) - (set! (-> obj work) *nav-mesh-work*) + (set! (-> this entity) arg0) + (set! (-> this work) *nav-mesh-work*) (set! sv-16 (new 'static 'res-tag)) (let ((v1-2 (res-lump-data arg0 'nav-mesh-sphere pointer :tag-ptr (& sv-16)))) (when v1-2 - (set! (-> obj static-sphere-count) (-> sv-16 elt-count)) - (set! (-> obj static-sphere) (the-as (inline-array sphere) v1-2)) + (set! (-> this static-sphere-count) (-> sv-16 elt-count)) + (set! (-> this static-sphere) (the-as (inline-array sphere) v1-2)) ) ) - (set! (-> obj nearest-y-threshold) (res-lump-float arg0 'nearest-y-threshold :default 40960.0)) - (set! (-> obj flags) (nav-mesh-flag)) - (set! (-> obj water-max-height) (res-lump-float arg0 'water-max-height :default 8192.0)) + (set! (-> this nearest-y-threshold) (res-lump-float arg0 'nearest-y-threshold :default 40960.0)) + (set! (-> this flags) (nav-mesh-flag)) + (set! (-> this water-max-height) (res-lump-float arg0 'water-max-height :default 8192.0)) (let ((s5-1 (res-lump-value arg0 'nav-max-users uint128 :default (the-as uint128 64) :time -1000000000.0))) - (set! (-> obj user-list) (new 'loading-level 'engine 'nav-engine (the-as int s5-1) connection)) - (set! (-> obj nav-control-array) + (set! (-> this user-list) (new 'loading-level 'engine 'nav-engine (the-as int s5-1) connection)) + (set! (-> this nav-control-array) (the-as (inline-array nav-control) (malloc 'loading-level (* 288 (the-as int s5-1)))) ) - (set! (-> obj nav-control-count) (the-as uint 0)) - (set! (-> obj max-nav-control-count) (the-as uint s5-1)) - (set! (-> obj sphere-hash) - (new 'loading-level 'sphere-hash 4096 (the-as int (+ s5-1 (-> obj static-sphere-count)))) + (set! (-> this nav-control-count) (the-as uint 0)) + (set! (-> this max-nav-control-count) (the-as uint s5-1)) + (set! (-> this sphere-hash) + (new 'loading-level 'sphere-hash 4096 (the-as int (+ s5-1 (-> this static-sphere-count)))) ) ) - (if (nonzero? (-> obj poly-hash)) - (set! (-> obj poly-hash work) *grid-hash-work*) + (if (nonzero? (-> this poly-hash)) + (set! (-> this poly-hash work) *grid-hash-work*) ) - (initialize-mesh! obj) + (initialize-mesh! this) 0 (none) ) ;; definition for method 24 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod handle-birth nav-mesh ((obj nav-mesh)) +(defmethod handle-birth nav-mesh ((this nav-mesh)) "Handle the parent nav-mesh-entity birth." - (dotimes (s5-0 (the-as int (-> obj link-count))) - (let ((a1-0 (-> obj link-array s5-0))) + (dotimes (s5-0 (the-as int (-> this link-count))) + (let ((a1-0 (-> this link-array s5-0))) (if (not (-> a1-0 dest-mesh)) - (link-to-other-mesh obj a1-0) + (link-to-other-mesh this a1-0) ) ) ) @@ -875,11 +875,11 @@ ;; definition for method 25 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod handle-kill nav-mesh ((obj nav-mesh)) +(defmethod handle-kill nav-mesh ((this nav-mesh)) "Handle the parent nav-mesh-entity kill." - (when (nonzero? (-> obj user-list)) - (countdown (s5-0 (-> obj nav-control-count)) - (let* ((v1-3 (-> obj nav-control-array s5-0)) + (when (nonzero? (-> this user-list)) + (countdown (s5-0 (-> this nav-control-count)) + (let* ((v1-3 (-> this nav-control-array s5-0)) (s4-0 (-> v1-3 process)) ) (when s4-0 @@ -889,11 +889,11 @@ ) ) ) - (remove-all (-> obj user-list)) - (dotimes (s5-1 (the-as int (-> obj link-count))) - (let ((a1-2 (-> obj link-array s5-1))) + (remove-all (-> this user-list)) + (dotimes (s5-1 (the-as int (-> this link-count))) + (let ((a1-2 (-> this link-array s5-1))) (if (-> a1-2 dest-mesh) - (unlink-mesh obj a1-2) + (unlink-mesh this a1-2) ) ) ) @@ -921,23 +921,23 @@ ) ;; definition for method 3 of type nav-engine-spr-buffer -(defmethod inspect nav-engine-spr-buffer ((obj nav-engine-spr-buffer)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-engine-spr-buffer ((this nav-engine-spr-buffer)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-engine-spr-buffer) - (format #t "~1Tmem-addr: ~D~%" (-> obj mem-addr)) - (format #t "~1Tmem-nav: #x~X~%" (-> obj mem-addr)) - (format #t "~1Tspr-addr: ~D~%" (-> obj spr-addr)) - (format #t "~1Tspr-nav: #x~X~%" (-> obj spr-addr)) - (format #t "~1Tq-size: ~D~%" (-> obj q-size)) - (format #t "~1Ti-nav: ~D~%" (-> obj i-nav)) - (format #t "~1Tdone: ~D~%" (-> obj done)) - (format #t "~1Tnav-count: ~D~%" (-> obj nav-count)) - (format #t "~1Ti-pass: ~D~%" (-> obj i-pass)) + (format #t "[~8x] ~A~%" this 'nav-engine-spr-buffer) + (format #t "~1Tmem-addr: ~D~%" (-> this mem-addr)) + (format #t "~1Tmem-nav: #x~X~%" (-> this mem-addr)) + (format #t "~1Tspr-addr: ~D~%" (-> this spr-addr)) + (format #t "~1Tspr-nav: #x~X~%" (-> this spr-addr)) + (format #t "~1Tq-size: ~D~%" (-> this q-size)) + (format #t "~1Ti-nav: ~D~%" (-> this i-nav)) + (format #t "~1Tdone: ~D~%" (-> this done)) + (format #t "~1Tnav-count: ~D~%" (-> this nav-count)) + (format #t "~1Ti-pass: ~D~%" (-> this i-pass)) (label cfg-4) - obj + this ) ;; definition of type nav-engine @@ -984,92 +984,92 @@ ) ;; definition for method 3 of type nav-engine -(defmethod inspect nav-engine ((obj nav-engine)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-engine ((this nav-engine)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-engine) - (format #t "~1Tspr-addr: ~D~%" (-> obj spr-addr)) - (format #t "~1Tnav-work-addr: ~D~%" (-> obj nav-work-addr)) - (format #t "~1Tnav-mesh-addr: ~D~%" (-> obj nav-mesh-addr)) - (format #t "~1Tpoly-array-addr: ~D~%" (-> obj poly-array-addr)) - (format #t "~1Thash-sphere-addr: ~D~%" (-> obj hash-sphere-addr)) - (format #t "~1Thash-buckets-addr: ~D~%" (-> obj hash-buckets-addr)) - (format #t "~1Tbuf-nav-control-count: ~D~%" (-> obj buf-nav-control-count)) - (format #t "~1Tmax-pass-count: ~D~%" (-> obj max-pass-count)) - (format #t "~1Toutput-sphere-hash: ~D~%" (-> obj output-sphere-hash)) - (format #t "~1Twork-buf-array[3] @ #x~X~%" (-> obj work-buf-array)) - (format #t "~1Tspr-work: #~%" (-> obj nav-work-addr)) - (format #t "~1Tmem-work: #~%" (-> obj mem-work)) - (format #t "~1Tspr-mesh: ~A~%" (-> obj nav-mesh-addr)) - (format #t "~1Tmem-mesh: ~A~%" (-> obj mem-mesh)) - (format #t "~1Tspr-poly-array: #x~X~%" (-> obj poly-array-addr)) - (format #t "~1Tmem-poly-array: #x~X~%" (-> obj mem-poly-array)) - (format #t "~1Thash-sphere-list: #x~X~%" (-> obj hash-sphere-addr)) - (format #t "~1Thash-buckets: #x~X~%" (-> obj hash-buckets-addr)) - (format #t "~1Tto-spr-wait: ~D~%" (-> obj to-spr-wait)) - (format #t "~1Tfrom-spr-wait: ~D~%" (-> obj from-spr-wait)) + (format #t "[~8x] ~A~%" this 'nav-engine) + (format #t "~1Tspr-addr: ~D~%" (-> this spr-addr)) + (format #t "~1Tnav-work-addr: ~D~%" (-> this nav-work-addr)) + (format #t "~1Tnav-mesh-addr: ~D~%" (-> this nav-mesh-addr)) + (format #t "~1Tpoly-array-addr: ~D~%" (-> this poly-array-addr)) + (format #t "~1Thash-sphere-addr: ~D~%" (-> this hash-sphere-addr)) + (format #t "~1Thash-buckets-addr: ~D~%" (-> this hash-buckets-addr)) + (format #t "~1Tbuf-nav-control-count: ~D~%" (-> this buf-nav-control-count)) + (format #t "~1Tmax-pass-count: ~D~%" (-> this max-pass-count)) + (format #t "~1Toutput-sphere-hash: ~D~%" (-> this output-sphere-hash)) + (format #t "~1Twork-buf-array[3] @ #x~X~%" (-> this work-buf-array)) + (format #t "~1Tspr-work: #~%" (-> this nav-work-addr)) + (format #t "~1Tmem-work: #~%" (-> this mem-work)) + (format #t "~1Tspr-mesh: ~A~%" (-> this nav-mesh-addr)) + (format #t "~1Tmem-mesh: ~A~%" (-> this mem-mesh)) + (format #t "~1Tspr-poly-array: #x~X~%" (-> this poly-array-addr)) + (format #t "~1Tmem-poly-array: #x~X~%" (-> this mem-poly-array)) + (format #t "~1Thash-sphere-list: #x~X~%" (-> this hash-sphere-addr)) + (format #t "~1Thash-buckets: #x~X~%" (-> this hash-buckets-addr)) + (format #t "~1Tto-spr-wait: ~D~%" (-> this to-spr-wait)) + (format #t "~1Tfrom-spr-wait: ~D~%" (-> this from-spr-wait)) (label cfg-4) - obj + this ) ;; definition for method 9 of type nav-engine -(defmethod inc-spr-addr! nav-engine ((obj nav-engine) (arg0 uint)) +(defmethod inc-spr-addr! nav-engine ((this nav-engine) (arg0 uint)) "Adds the given integer to `spr-addr` and returns it" - (let ((v0-0 (-> obj spr-addr))) - (+! (-> obj spr-addr) arg0) + (let ((v0-0 (-> this spr-addr))) + (+! (-> this spr-addr) arg0) v0-0 ) ) ;; definition for method 10 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod lay-out-spad-memory nav-engine ((obj nav-engine) (arg0 nav-mesh)) +(defmethod lay-out-spad-memory nav-engine ((this nav-engine) (arg0 nav-mesh)) (let ((s5-0 0)) - (set! (-> obj spr-addr) (the-as uint #x70000060)) - (let* ((v1-1 obj) + (set! (-> this spr-addr) (the-as uint #x70000060)) + (let* ((v1-1 this) (a1-1 320) (a0-1 (-> v1-1 spr-addr)) ) (+! (-> v1-1 spr-addr) a1-1) - (set! (-> obj nav-work-addr) a0-1) + (set! (-> this nav-work-addr) a0-1) ) - (let* ((v1-2 obj) + (let* ((v1-2 this) (a1-3 112) (a0-2 (-> v1-2 spr-addr)) ) (+! (-> v1-2 spr-addr) a1-3) - (set! (-> obj nav-mesh-addr) (the-as nav-mesh a0-2)) + (set! (-> this nav-mesh-addr) (the-as nav-mesh a0-2)) ) (if (and (= (-> *nav-mesh-work* polys-in-scratch) 1) (< (-> arg0 poly-count) (the-as uint 64))) (set! s5-0 (the-as int (-> arg0 poly-count))) ) - (let* ((v1-10 obj) + (let* ((v1-10 this) (a1-5 (* s5-0 64)) (a0-4 (-> v1-10 spr-addr)) ) (+! (-> v1-10 spr-addr) a1-5) - (set! (-> obj poly-array-addr) a0-4) + (set! (-> this poly-array-addr) a0-4) ) - (let* ((v1-11 obj) + (let* ((v1-11 this) (a1-7 (* (-> arg0 sphere-hash max-object-count) 16)) (a0-7 (-> v1-11 spr-addr)) ) (+! (-> v1-11 spr-addr) a1-7) - (set! (-> obj hash-sphere-addr) a0-7) + (set! (-> this hash-sphere-addr) a0-7) ) - (let* ((v1-12 obj) + (let* ((v1-12 this) (a1-9 0) (a0-8 (-> v1-12 spr-addr)) ) (+! (-> v1-12 spr-addr) a1-9) - (set! (-> obj hash-buckets-addr) a0-8) + (set! (-> this hash-buckets-addr) a0-8) ) - (set! (-> obj buf-nav-control-count) 7) + (set! (-> this buf-nav-control-count) 7) (dotimes (v1-14 3) - (let ((a0-11 (-> obj work-buf-array v1-14))) - (let* ((a1-11 obj) + (let ((a0-11 (-> this work-buf-array v1-14))) + (let* ((a1-11 this) (a3-0 2048) (a2-5 (-> a1-11 spr-addr)) ) @@ -1082,27 +1082,27 @@ (set! (-> a0-11 i-pass) -1) ) ) - (set! (-> obj output-sphere-hash) (the-as uint 0)) - (set! (-> obj mem-mesh) arg0) + (set! (-> this output-sphere-hash) (the-as uint 0)) + (set! (-> this mem-mesh) arg0) (cond ((= (-> *nav-mesh-work* mesh-struct-in-scratch) 1) - (set! (-> obj nav-mesh-addr) (the-as nav-mesh (&-> (-> obj nav-mesh-addr) poly-array))) - (mem-copy! (&-> (-> obj nav-mesh-addr) type) (&-> arg0 type) 112) + (set! (-> this nav-mesh-addr) (the-as nav-mesh (&-> (-> this nav-mesh-addr) poly-array))) + (mem-copy! (&-> (-> this nav-mesh-addr) type) (&-> arg0 type) 112) ) (else - (set! (-> obj nav-mesh-addr) arg0) + (set! (-> this nav-mesh-addr) arg0) ) ) - (set! (-> obj mem-work) (-> arg0 work)) + (set! (-> this mem-work) (-> arg0 work)) (if (= (-> *nav-mesh-work* work-struct-in-scratch) 1) - (quad-copy! (the-as pointer (-> obj nav-work-addr)) (the-as pointer (-> obj mem-work)) 20) - (set! (-> obj nav-work-addr) (the-as uint (-> arg0 work))) + (quad-copy! (the-as pointer (-> this nav-work-addr)) (the-as pointer (-> this mem-work)) 20) + (set! (-> this nav-work-addr) (the-as uint (-> arg0 work))) ) - (set! (-> obj nav-mesh-addr work) (the-as nav-mesh-work (-> obj nav-work-addr))) - (set! (-> obj mem-poly-array) (-> arg0 poly-array)) + (set! (-> this nav-mesh-addr work) (the-as nav-mesh-work (-> this nav-work-addr))) + (set! (-> this mem-poly-array) (-> arg0 poly-array)) (when (> s5-0 0) - (quad-copy! (the-as pointer (-> obj poly-array-addr)) (the-as pointer (-> obj mem-poly-array)) (* s5-0 4)) - (set! (-> obj nav-mesh-addr poly-array) (the-as (inline-array nav-poly) (-> obj poly-array-addr))) + (quad-copy! (the-as pointer (-> this poly-array-addr)) (the-as pointer (-> this mem-poly-array)) (* s5-0 4)) + (set! (-> this nav-mesh-addr poly-array) (the-as (inline-array nav-poly) (-> this poly-array-addr))) ) ) 0 @@ -1111,10 +1111,10 @@ ;; definition for method 11 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-up-mem-work nav-engine ((obj nav-engine)) - (let ((v1-0 (-> obj mem-mesh))) - (set! (-> v1-0 poly-array) (-> obj mem-poly-array)) - (set! (-> v1-0 work) (-> obj mem-work)) +(defmethod set-up-mem-work nav-engine ((this nav-engine)) + (let ((v1-0 (-> this mem-mesh))) + (set! (-> v1-0 poly-array) (-> this mem-poly-array)) + (set! (-> v1-0 work) (-> this mem-work)) ) 0 (none) @@ -1123,7 +1123,7 @@ ;; definition for method 12 of type nav-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod add-spheres-from-mesh-user-list nav-engine ((obj nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) +(defmethod add-spheres-from-mesh-user-list nav-engine ((this nav-engine) (arg0 sphere-hash) (arg1 nav-mesh)) (countdown (s3-0 (-> arg1 static-sphere-count)) (add-a-sphere-with-flag arg0 (-> arg1 static-sphere s3-0) 64) ) @@ -1142,7 +1142,7 @@ (set! (-> s1-0 root-nav-sphere quad) (-> (the-as collide-shape s2-0) trans quad)) (set! (-> s1-0 root-nav-sphere w) (-> (the-as collide-shape s2-0) nav-radius)) (if (logtest? (-> s1-0 flags) (nav-control-flag output-sphere-hash)) - (set! (-> obj output-sphere-hash) (the-as uint 1)) + (set! (-> this output-sphere-hash) (the-as uint 1)) ) (if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere)) (set! (-> s1-0 root-sphere-id) @@ -1210,13 +1210,13 @@ ;; definition for method 13 of type nav-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod add-all-spheres nav-engine ((obj nav-engine)) - (let ((s4-0 (-> obj nav-mesh-addr)) - (gp-0 (-> obj nav-mesh-addr sphere-hash)) +(defmethod add-all-spheres nav-engine ((this nav-engine)) + (let ((s4-0 (-> this nav-mesh-addr)) + (gp-0 (-> this nav-mesh-addr sphere-hash)) ) (clear-objects! gp-0) - (set! (-> gp-0 bucket-array) (the-as (pointer grid-hash-word) (-> obj hash-buckets-addr))) - (set! (-> gp-0 sphere-array) (the-as (inline-array sphere) (-> obj hash-sphere-addr))) + (set! (-> gp-0 bucket-array) (the-as (pointer grid-hash-word) (-> this hash-buckets-addr))) + (set! (-> gp-0 sphere-array) (the-as (inline-array sphere) (-> this hash-sphere-addr))) (when *target* (let ((a1-0 (new 'stack-no-clear 'nav-vertex))) (let ((v1-8 (-> *target* control))) @@ -1226,16 +1226,16 @@ (add-a-sphere-with-flag gp-0 a1-0 2) ) ) - (add-spheres-from-mesh-user-list obj gp-0 s4-0) + (add-spheres-from-mesh-user-list this gp-0 s4-0) (let ((s3-0 (the-as nav-mesh (-> s4-0 next-nav-mesh)))) (while (and s3-0 (nonzero? s3-0)) - (add-spheres-from-mesh-user-list obj gp-0 s3-0) + (add-spheres-from-mesh-user-list this gp-0 s3-0) (set! s3-0 (the-as nav-mesh (-> s3-0 next-nav-mesh))) ) ) (let ((s4-1 (the-as nav-mesh (-> s4-0 prev-nav-mesh)))) (while (and s4-1 (nonzero? s4-1)) - (add-spheres-from-mesh-user-list obj gp-0 s4-1) + (add-spheres-from-mesh-user-list this gp-0 s4-1) (set! s4-1 (the-as nav-mesh (-> s4-1 prev-nav-mesh))) ) ) @@ -1247,16 +1247,16 @@ ;; definition for method 14 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod do-sphere-lookups nav-engine ((obj nav-engine)) - (let ((s5-0 (-> obj nav-mesh-addr))) +(defmethod do-sphere-lookups nav-engine ((this nav-engine)) + (let ((s5-0 (-> this nav-mesh-addr))) (dotimes (s4-0 (the-as int (-> s5-0 nav-control-count))) (let ((a0-3 (-> s5-0 nav-control-array s4-0))) (when (-> a0-3 process) (set! (-> a0-3 sphere-count) 0) - (set! (-> a0-3 state mesh) (-> obj nav-mesh-addr)) - (set! (-> obj mem-work nav) (the-as basic a0-3)) + (set! (-> a0-3 state mesh) (-> this nav-mesh-addr)) + (set! (-> this mem-work nav) (the-as basic a0-3)) (find-sphere-ids-from-sphere-hash a0-3 #f) - (set! (-> obj mem-work nav) #f) + (set! (-> this mem-work nav) #f) ) ) ) @@ -1300,7 +1300,7 @@ ;; definition for method 19 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod do-callbacks nav-engine ((obj nav-engine) (arg0 nav-engine-spr-buffer)) +(defmethod do-callbacks nav-engine ((this nav-engine) (arg0 nav-engine-spr-buffer)) (local-vars (sv-16 nav-callback-info)) (with-pp (dotimes (s4-0 (-> arg0 nav-count)) @@ -1313,16 +1313,16 @@ (when (and (logtest? (-> a1-1 flags) (nav-control-flag kernel-run)) sv-16) (let ((s3-0 pp)) (set! pp a0-3) - (set! (-> obj mem-mesh work nav) (the-as basic a1-1)) + (set! (-> this mem-mesh work nav) (the-as basic a1-1)) (let ((v1-10 (-> sv-16 callback-count))) - (set! (-> obj max-pass-count) (max (-> obj max-pass-count) v1-10)) + (set! (-> this max-pass-count) (max (-> this max-pass-count) v1-10)) (if (< (-> arg0 i-pass) v1-10) ((-> sv-16 callback-array (-> arg0 i-pass)) a0-3 a1-1) ) ) (set! pp s3-0) ) - (set! (-> obj mem-mesh work nav) #f) + (set! (-> this mem-mesh work nav) #f) ) ) ) @@ -1342,7 +1342,7 @@ ;; definition for method 15 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-nav-controls-pipelined-in-spr nav-engine ((obj nav-engine)) +(defmethod update-nav-controls-pipelined-in-spr nav-engine ((this nav-engine)) (local-vars (v1-33 int) (v1-45 int) @@ -1358,37 +1358,37 @@ (sv-48 nav-engine-spr-buffer) ) (flush-cache 0) - (set! (-> obj max-pass-count) 3) + (set! (-> this max-pass-count) 3) (set! sv-16 (the-as symbol #f)) (set! sv-24 0) (set! sv-32 0) - (set! sv-40 (-> obj nav-mesh-addr nav-control-count)) - (set! sv-44 (-> obj nav-mesh-addr nav-control-array)) + (set! sv-40 (-> this nav-mesh-addr nav-control-count)) + (set! sv-44 (-> this nav-mesh-addr nav-control-array)) (let ((s5-0 2) (s3-0 1) (s4-0 0) ) (while (not sv-16) - (let ((s2-0 (-> obj work-buf-array s5-0))) + (let ((s2-0 (-> this work-buf-array s5-0))) (set! (-> s2-0 i-nav) (the-as uint sv-32)) - (set! (-> s2-0 nav-count) (min (-> obj buf-nav-control-count) (the-as int (- sv-40 (the-as uint sv-32))))) + (set! (-> s2-0 nav-count) (min (-> this buf-nav-control-count) (the-as int (- sv-40 (the-as uint sv-32))))) (set! (-> s2-0 i-pass) sv-24) (set! (-> s2-0 mem-addr) (the-as (pointer nav-mesh) (-> sv-44 sv-32))) (set! (-> s2-0 q-size) (the-as uint (* 18 (-> s2-0 nav-count)))) (set! (-> s2-0 done) 0) - (when (>= sv-24 (-> obj max-pass-count)) + (when (>= sv-24 (-> this max-pass-count)) (set! (-> s2-0 nav-count) 0) 0 ) (if (> (-> s2-0 nav-count) 0) - (upload-nav-to-spr obj s2-0) + (upload-nav-to-spr this s2-0) (dma-sync (the-as pointer #x1000d400) 0 0) ) (set! sv-32 (+ sv-32 (-> s2-0 nav-count))) (when (>= sv-32 (the-as int sv-40)) (set! sv-32 0) (set! sv-24 (+ sv-24 1)) - (if (= sv-24 (-> obj max-pass-count)) + (if (= sv-24 (-> this max-pass-count)) (set! (-> s2-0 done) 1) ) ) @@ -1400,9 +1400,9 @@ (move-if-not-zero v1-33 0 a0-14 v1-32) ) (set! s5-0 v1-33) - (let ((s2-1 (-> obj work-buf-array s4-0))) + (let ((s2-1 (-> this work-buf-array s4-0))) (when (> (-> s2-1 nav-count) 0) - (download-nav-from-spr obj s2-1) + (download-nav-from-spr this s2-1) (when (= (-> s2-1 done) 1) (dma-sync (the-as pointer #x1000d000) 0 0) (set! sv-16 #t) @@ -1416,14 +1416,14 @@ (move-if-not-zero v1-45 0 a0-19 v1-44) ) (set! s4-0 v1-45) - (set! sv-48 (-> obj work-buf-array s3-0)) + (set! sv-48 (-> this work-buf-array s3-0)) (when (> (-> sv-48 nav-count) 0) (if (zero? (-> sv-48 i-pass)) - (reloc-ptrs-to-spad obj sv-48) + (reloc-ptrs-to-spad this sv-48) ) - (do-callbacks obj sv-48) - (if (= (-> sv-48 i-pass) (+ (-> obj max-pass-count) -1)) - (reloc-ptrs-to-mem obj sv-48) + (do-callbacks this sv-48) + (if (= (-> sv-48 i-pass) (+ (-> this max-pass-count) -1)) + (reloc-ptrs-to-mem this sv-48) ) ) (let ((v1-65 (+ s3-0 1))) @@ -1441,31 +1441,31 @@ ;; definition for method 16 of type nav-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-nav-controls-in-spr nav-engine ((obj nav-engine)) +(defmethod update-nav-controls-in-spr nav-engine ((this nav-engine)) (flush-cache 0) - (set! (-> obj max-pass-count) 1) - (let ((gp-0 (the-as object (-> obj work-buf-array)))) + (set! (-> this max-pass-count) 1) + (let ((gp-0 (the-as object (-> this work-buf-array)))) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-nav) (the-as uint 0)) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count) - (the-as int (-> obj nav-mesh-addr nav-control-count)) + (the-as int (-> this nav-mesh-addr nav-control-count)) ) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) 0) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 mem-addr) - (the-as (pointer nav-mesh) (-> obj nav-mesh-addr nav-control-array)) + (the-as (pointer nav-mesh) (-> this nav-mesh-addr nav-control-array)) ) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 q-size) (the-as uint (* 18 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count))) ) (set! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 done) 0) (when (> (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count) 0) - (upload-nav-to-spr obj (the-as nav-engine-spr-buffer gp-0)) + (upload-nav-to-spr this (the-as nav-engine-spr-buffer gp-0)) (dma-sync (the-as pointer #x1000d400) 0 0) - (reloc-ptrs-to-spad obj (the-as nav-engine-spr-buffer gp-0)) - (while (< (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) (-> obj max-pass-count)) - (do-callbacks obj (the-as nav-engine-spr-buffer gp-0)) + (reloc-ptrs-to-spad this (the-as nav-engine-spr-buffer gp-0)) + (while (< (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) (-> this max-pass-count)) + (do-callbacks this (the-as nav-engine-spr-buffer gp-0)) (+! (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 i-pass) 1) ) - (reloc-ptrs-to-mem obj (the-as nav-engine-spr-buffer gp-0)) + (reloc-ptrs-to-mem this (the-as nav-engine-spr-buffer gp-0)) (dotimes (s4-0 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count)) (let ((a2-1 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 spr-addr s4-0 state mesh))) (when (>= (the-as uint a2-1) (the-as uint #x70000000)) @@ -1475,7 +1475,7 @@ ) ) ) - (download-nav-from-spr obj (the-as nav-engine-spr-buffer gp-0)) + (download-nav-from-spr this (the-as nav-engine-spr-buffer gp-0)) (dma-sync (the-as pointer #x1000d000) 0 0) (dotimes (s5-1 (-> (the-as (inline-array nav-engine-spr-buffer) gp-0) 0 nav-count)) (let ((a2-3 (-> (&+ (-> (the-as nav-engine-spr-buffer gp-0) mem-addr) (* 288 s5-1)) 31))) @@ -1494,18 +1494,18 @@ ;; definition for method 26 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod update-navigation nav-mesh ((obj nav-mesh)) +(defmethod update-navigation nav-mesh ((this nav-mesh)) (local-vars (sp-0 int)) - (when (zero? (-> obj next-nav-mesh)) - (set! (-> obj next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> obj entity) 'next-actor 0))) - (set! (-> obj prev-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> obj entity) 'prev-actor 0))) + (when (zero? (-> this next-nav-mesh)) + (set! (-> this next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'next-actor 0))) + (set! (-> this prev-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'prev-actor 0))) ) - (when (> (-> obj nav-control-count) 0) + (when (> (-> this nav-control-count) 0) (the-as none sp-0) (set! sp-0 #x70003fc0) - (set! (-> obj work mesh) obj) + (set! (-> this work mesh) this) (let ((s4-0 (the-as nav-engine #x70000000))) - (lay-out-spad-memory s4-0 obj) + (lay-out-spad-memory s4-0 this) (add-all-spheres s4-0) (do-sphere-lookups s4-0) (when (nonzero? (-> s4-0 output-sphere-hash)) @@ -1520,7 +1520,7 @@ (set! (-> s3-0 sphere-array) (the-as (inline-array sphere) (-> s3-0 mem-sphere-array))) ) ) - (if (< (the-as uint (* 3 (-> s4-0 buf-nav-control-count))) (-> obj nav-control-count)) + (if (< (the-as uint (* 3 (-> s4-0 buf-nav-control-count))) (-> this nav-control-count)) (update-nav-controls-pipelined-in-spr s4-0) (update-nav-controls-in-spr s4-0) ) @@ -1533,26 +1533,26 @@ ;; definition for method 9 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw nav-mesh ((obj nav-mesh)) +(defmethod debug-draw nav-mesh ((this nav-mesh)) (local-vars (sv-32 vector) (sv-36 int)) (set! sv-32 (new 'stack-no-clear 'vector)) (set! sv-36 16) (add-debug-sphere (logtest? sv-36 4) (bucket-id debug2) - (-> obj bounds) - (-> obj bounds w) + (-> this bounds) + (-> this bounds w) (new 'static 'rgba :r #xff :g #xff :a #x20) ) - (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj bounds) *x-vector* (meters 1) *color-red*) - (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj bounds) *z-vector* (meters 1) *color-blue*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this bounds) *x-vector* (meters 1) *color-red*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this bounds) *z-vector* (meters 1) *color-blue*) (when (logtest? sv-36 16) - (dotimes (s5-0 (the-as int (-> obj static-sphere-count))) + (dotimes (s5-0 (the-as int (-> this static-sphere-count))) (add-debug-sphere #t (bucket-id debug2) - (-> obj static-sphere s5-0) - (-> obj static-sphere s5-0 r) + (-> this static-sphere s5-0) + (-> this static-sphere s5-0 r) *color-light-blue* ) (let ((s4-0 add-debug-text-3d) @@ -1564,31 +1564,31 @@ s3-0 (the-as bucket-id s2-0) *temp-string* - (-> obj static-sphere s5-0) + (-> this static-sphere s5-0) (font-color cyan) (the-as vector2h #f) ) ) ) - (dotimes (s5-1 (the-as int (-> obj poly-count))) - (let ((s4-1 (-> obj poly-array s5-1))) - (debug-draw-poly obj s4-1 (cond - ((logtest? (-> s4-1 pat) 1) - *color-black* - ) - ((logtest? (-> s4-1 pat) 2) - *color-gray* - ) - ((logtest? (-> s4-1 pat) 4) - (if (-> obj link-array (-> s4-1 link) dest-mesh) - *color-green* - *color-light-red* - ) - ) - (else - *color-cyan* + (dotimes (s5-1 (the-as int (-> this poly-count))) + (let ((s4-1 (-> this poly-array s5-1))) + (debug-draw-poly this s4-1 (cond + ((logtest? (-> s4-1 pat) 1) + *color-black* ) - ) + ((logtest? (-> s4-1 pat) 2) + *color-gray* + ) + ((logtest? (-> s4-1 pat) 4) + (if (-> this link-array (-> s4-1 link) dest-mesh) + *color-green* + *color-light-red* + ) + ) + (else + *color-cyan* + ) + ) ) (when (logtest? sv-36 32) (let ((s3-1 add-debug-text-3d) @@ -1600,7 +1600,7 @@ s2-1 (the-as bucket-id s1-1) *temp-string* - (poly-centroid obj s4-1 sv-32) + (poly-centroid this s4-1 sv-32) (font-color cyan) (the-as vector2h #f) ) @@ -1614,7 +1614,7 @@ ) ;; definition for method 12 of type nav-mesh -(defmethod poly-centroid-local nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) +(defmethod poly-centroid-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((v1-0 (new 'stack-no-clear 'nav-vertex))) @@ -1628,9 +1628,9 @@ ) ;; definition for method 11 of type nav-mesh -(defmethod poly-centroid nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) - (poly-centroid-local obj arg0 arg1) - (vector+! arg1 arg1 (-> obj bounds)) +(defmethod poly-centroid nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector)) + (poly-centroid-local this arg0 arg1) + (vector+! arg1 arg1 (-> this bounds)) ) ;; definition for function vu-point-triangle-intersection? @@ -1692,10 +1692,10 @@ ) ;; definition for method 42 of type nav-mesh -(defmethod find-poly-containing-point-local nav-mesh ((obj nav-mesh) (arg0 nav-find-poly-parms)) +(defmethod find-poly-containing-point-local nav-mesh ((this nav-mesh) (arg0 nav-find-poly-parms)) (local-vars (v1-6 symbol) (v1-15 int) (a0-3 symbol) (sv-16 nav-poly)) - (let ((s4-0 (search-for-point (-> obj poly-hash) (-> arg0 point))) - (s3-0 (-> obj poly-hash bucket-size)) + (let ((s4-0 (search-for-point (-> this poly-hash) (-> arg0 point))) + (s3-0 (-> this poly-hash bucket-size)) (s2-0 0) ) (until (zero? v1-15) @@ -1707,7 +1707,7 @@ (nop!) (b! (zero? v1-2) cfg-16 :delay (nop!)) ) - (set! sv-16 (-> obj poly-array s1-0)) + (set! sv-16 (-> this poly-array s1-0)) (let ((v1-5 sv-16) (f0-0 (-> arg0 point y)) (f1-0 (-> arg0 y-threshold)) @@ -1719,7 +1719,7 @@ ) (label cfg-9) (when (and v1-6 (not (logtest? (-> sv-16 pat) (-> arg0 ignore)))) - (if (point-in-poly? obj sv-16 (-> arg0 point)) + (if (point-in-poly? this sv-16 (-> arg0 point)) (return sv-16) ) ) @@ -1745,7 +1745,7 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 24 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch -(defmethod is-in-mesh-local? nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod is-in-mesh-local? nav-mesh ((this nav-mesh) (arg0 vector) (arg1 float) (arg2 float)) (local-vars (v1-3 float) (sv-16 float) (sv-20 vector) (sv-24 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1756,7 +1756,7 @@ (set! sv-16 arg2) (set! sv-20 arg0) (set! sv-24 arg1) - (let* ((f0-3 (+ sv-24 (-> obj bounds w))) + (let* ((f0-3 (+ sv-24 (-> this bounds w))) (f0-5 (* f0-3 f0-3)) ) (.lvf vf1 (&-> sv-20 quad)) @@ -1771,14 +1771,14 @@ (set! (-> s5-0 point quad) (-> sv-20 quad)) (set! (-> s5-0 y-threshold) sv-16) (set! (-> s5-0 ignore) (the-as uint 2)) - (find-nearest-poly-to-point-local obj s5-0) + (find-nearest-poly-to-point-local this s5-0) (cond ((-> s5-0 point-inside?) #t ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) - (project-point-into-poly-2d obj (-> s5-0 poly) s4-0 sv-20) + (project-point-into-poly-2d this (-> s5-0 poly) s4-0 sv-20) (let ((f0-7 (vector-vector-xz-distance-squared s4-0 sv-20)) (f1-2 sv-24) ) @@ -1914,14 +1914,14 @@ ) ;; definition for method 17 of type nav-mesh -(defmethod try-move-along-ray nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod try-move-along-ray nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (v1-2 symbol)) (let ((gp-0 (new 'stack-no-clear 'nav-ray))) (let ((s4-0 0)) (init-ray-dir-local gp-0 arg0 arg1 arg2 arg3) (until v1-2 (+! s4-0 1) - (move-along-nav-ray! obj gp-0) + (move-along-nav-ray! this gp-0) (set! v1-2 (or (>= s4-0 15) (-> gp-0 terminated))) ) ) @@ -2034,7 +2034,7 @@ ;; WARN: Stack slot offset 28 signed mismatch ;; WARN: Stack slot offset 52 signed mismatch ;; WARN: Stack slot offset 28 signed mismatch -(defmethod find-nearest-poly-to-point-local nav-mesh ((obj nav-mesh) (arg0 nav-find-poly-parms)) +(defmethod find-nearest-poly-to-point-local nav-mesh ((this nav-mesh) (arg0 nav-find-poly-parms)) (local-vars (v1-16 int) (v1-34 int) @@ -2048,9 +2048,9 @@ (sv-52 float) ) (set! sv-16 (the-as nav-poly #f)) - (set! sv-20 (search-for-sphere (-> obj poly-hash) (-> arg0 point) 12288.0)) + (set! sv-20 (search-for-sphere (-> this poly-hash) (-> arg0 point) 12288.0)) (set! (-> arg0 point-inside?) #f) - (let ((s4-0 (-> obj poly-hash bucket-size)) + (let ((s4-0 (-> this poly-hash bucket-size)) (s3-0 sv-20) (s2-0 0) ) @@ -2064,7 +2064,7 @@ (nop!) (b! (zero? v1-3) cfg-16 :delay (nop!)) ) - (set! sv-24 (-> obj poly-array s1-0)) + (set! sv-24 (-> this poly-array s1-0)) (let ((v1-6 sv-24) (f0-0 (-> arg0 point y)) (f1-0 (-> arg0 y-threshold)) @@ -2078,7 +2078,7 @@ :delay (empty-form) ) ) - (b! (not (point-in-poly? obj sv-24 (-> arg0 point))) cfg-16 :delay (empty-form)) + (b! (not (point-in-poly? this sv-24 (-> arg0 point))) cfg-16 :delay (empty-form)) (set! (-> arg0 point-inside?) #t) (set! (-> arg0 dist) 0.0) (set! sv-16 sv-24) @@ -2099,7 +2099,7 @@ (set! sv-28 (the-as float 10000000000000000000000000000000000000.0)) (set! sv-32 0) (set! sv-40 0) - (let ((s4-1 (-> obj poly-hash bucket-size)) + (let ((s4-1 (-> this poly-hash bucket-size)) (s3-1 sv-20) (s2-1 0) ) @@ -2112,7 +2112,7 @@ (nop!) (b! (zero? v1-19) cfg-33 :delay (nop!)) ) - (set! sv-48 (-> obj poly-array s1-1)) + (set! sv-48 (-> this poly-array s1-1)) (let ((v1-22 sv-48) (f0-3 (-> arg0 point y)) (f1-2 (-> arg0 y-threshold)) @@ -2121,7 +2121,7 @@ (not (logtest? (-> sv-48 pat) (-> arg0 ignore))) ) (set! sv-40 (+ sv-40 1)) - (set! sv-52 (point-poly-distance-min (-> obj work) (the-as nav-poly (-> arg0 point)) sv-28 sv-48)) + (set! sv-52 (point-poly-distance-min (-> this work) (the-as nav-poly (-> arg0 point)) sv-28 sv-48)) (when (< sv-52 sv-28) (set! sv-28 sv-52) (set! sv-16 sv-48) @@ -2142,7 +2142,7 @@ ) ) (if (not sv-16) - (set! sv-16 (-> obj poly-array 0)) + (set! sv-16 (-> this poly-array 0)) ) (set! (-> arg0 dist) sv-28) (label cfg-38) @@ -2157,15 +2157,15 @@ ;; definition for method 14 of type nav-mesh ;; INFO: Used lq/sq -(defmethod get-route-portal nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) +(defmethod get-route-portal nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly) (arg2 nav-route-portal)) (set! (-> arg2 next-poly) #f) (cond ((and arg0 arg1 (!= arg0 arg1)) - (let* ((a1-1 obj) + (let* ((a1-1 this) (v1-1 (-> arg0 id)) (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a1-1 poly-count))) 2)) (s3-0 - (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) + (logand (ash (-> (the-as (pointer uint8) (&+ (-> this route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) 3 ) ) @@ -2178,7 +2178,7 @@ 0 ) (set! (-> arg2 edge-index) (the-as int s3-0)) - (set! (-> arg2 next-poly) (-> obj poly-array s2-0)) + (set! (-> arg2 next-poly) (-> this poly-array s2-0)) ) (let ((a0-7 s3-0) (v1-16 (the-as int (+ s3-0 1))) @@ -2201,14 +2201,14 @@ ) ;; definition for method 13 of type nav-mesh -(defmethod lookup-poly-on-route-to-target nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) +(defmethod lookup-poly-on-route-to-target nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 nav-poly)) (cond ((and arg0 arg1 (!= arg0 arg1)) - (let* ((a3-0 obj) + (let* ((a3-0 this) (v1-1 (-> arg0 id)) (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a3-0 poly-count))) 2)) (v1-9 - (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) + (logand (ash (-> (the-as (pointer uint8) (&+ (-> this route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) 3 ) ) @@ -2221,7 +2221,7 @@ (let ((v1-11 (-> (the-as (pointer uint8) (&+ a2-5 v1-9))))) (if (= v1-11 255) (the-as nav-poly #f) - (-> obj poly-array v1-11) + (-> this poly-array v1-11) ) ) ) @@ -2234,7 +2234,7 @@ ;; definition for method 22 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod compute-bounding-box-from-vertices nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector)) +(defmethod compute-bounding-box-from-vertices nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector)) (let ((f0-0 10000000000000000000000000000000000000.0) (f1-0 -10000000000000000000000000000000000000.0) ) @@ -2245,8 +2245,8 @@ (set! (-> arg1 y) f1-0) (set! (-> arg1 z) f1-0) ) - (dotimes (v1-3 (the-as int (-> obj poly-count))) - (let ((a3-1 (-> obj poly-array v1-3))) + (dotimes (v1-3 (the-as int (-> this poly-count))) + (let ((a3-1 (-> this poly-array v1-3))) (dotimes (t0-1 (the-as int (-> a3-1 vertex-count))) (let ((t1-2 (-> a3-1 vertex t0-1))) (set! (-> arg0 x) (fmin (-> arg0 x) (-> t1-2 x))) @@ -2259,15 +2259,15 @@ ) ) ) - (vector+! arg0 arg0 (-> obj bounds)) - (vector+! arg1 arg1 (-> obj bounds)) + (vector+! arg0 arg0 (-> this bounds)) + (vector+! arg1 arg1 (-> this bounds)) 0 (none) ) ;; definition for method 15 of type nav-mesh ;; WARN: Return type mismatch int vs none. -(defmethod initialize-mesh! nav-mesh ((obj nav-mesh)) +(defmethod initialize-mesh! nav-mesh ((this nav-mesh)) (local-vars (sv-32 vector) (sv-36 uint) @@ -2289,13 +2289,13 @@ ) (init-vf0-vector) (set! sv-32 (new 'stack-no-clear 'vector)) - (set! sv-36 (-> obj poly-count)) + (set! sv-36 (-> this poly-count)) (set! sv-40 0) (set! sv-48 0) (set! sv-56 0) (set! sv-64 (the-as symbol #f)) (countdown (s5-0 sv-36) - (let ((v1-3 (-> obj poly-array s5-0))) + (let ((v1-3 (-> this poly-array s5-0))) (if (logtest? (-> v1-3 pat) 1) (set! sv-56 (+ sv-56 1)) ) @@ -2415,7 +2415,7 @@ ;; definition for method 38 of type nav-mesh ;; INFO: Used lq/sq -(defmethod nav-mesh-method-38 nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) +(defmethod nav-mesh-method-38 nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 (pointer nav-poly))) (local-vars (s1-0 vector) (sv-16 int) @@ -2427,7 +2427,7 @@ (sv-44 vector) ) (set! sv-16 -1) - (set! sv-24 (-> obj work)) + (set! sv-24 (-> this work)) (set! sv-28 (-> arg0 vertex-count)) (set! sv-32 (-> sv-24 vert0-table)) (set! sv-36 (-> sv-24 vert1-table)) @@ -2459,19 +2459,19 @@ (let ((v1-16 (-> arg0 adj-poly sv-16))) (cond ((!= v1-16 255) - (set! (-> arg4 0) (-> obj poly-array v1-16)) + (set! (-> arg4 0) (-> this poly-array v1-16)) (set! sv-16 -1) ) ((let ((a1-1 (-> arg0 vertex (-> sv-32 sv-16)))) (set! s1-0 (-> arg0 vertex (-> sv-36 sv-16))) - (< (vector-vector-xz-distance arg1 a1-1) (-> obj work nav-poly-min-dist)) + (< (vector-vector-xz-distance arg1 a1-1) (-> this work nav-poly-min-dist)) ) (set! sv-16 (+ sv-16 -1)) (if (< sv-16 0) (set! sv-16 (the-as int (+ sv-28 -1))) ) ) - ((< (vector-vector-xz-distance arg1 s1-0) (-> obj work nav-poly-min-dist)) + ((< (vector-vector-xz-distance arg1 s1-0) (-> this work nav-poly-min-dist)) (set! sv-16 (+ sv-16 1)) (when (>= sv-16 (the-as int sv-28)) (set! sv-16 0) @@ -2541,7 +2541,7 @@ ;; definition for method 40 of type nav-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod project-point-onto-plane-of-poly-local nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod project-point-onto-plane-of-poly-local nav-mesh ((this nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((s4-0 (new 'stack-no-clear 'vector))) (cond @@ -2576,25 +2576,25 @@ ;; definition for method 8 of type nav-mesh ;; WARN: Return type mismatch int vs nav-mesh. -(defmethod mem-usage nav-mesh ((obj nav-mesh) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage nav-mesh ((this nav-mesh) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 45 used) v1-6) (+! (-> arg0 data 45 total) (logand -16 (+ v1-6 15))) ) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let ((v1-16 (* (-> obj poly-count) 64))) + (let ((v1-16 (* (-> this poly-count) 64))) (+! (-> arg0 data 45 used) v1-16) (+! (-> arg0 data 45 total) (logand -16 (+ v1-16 15))) ) (set! (-> arg0 length) (max 46 (-> arg0 length))) (set! (-> arg0 data 45 name) "nav-mesh") (+! (-> arg0 data 45 count) 1) - (let* ((v1-25 (-> obj poly-count)) + (let* ((v1-25 (-> this poly-count)) (v1-27 (shr (* v1-25 v1-25) 2)) ) (+! (-> arg0 data 45 used) v1-27) @@ -2679,19 +2679,19 @@ ) ;; definition for method 10 of type nav-mesh -(defmethod nav-mesh-method-10 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) +(defmethod nav-mesh-method-10 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 nav-poly)) (local-vars (sv-16 vector)) (set! sv-16 arg0) (let ((gp-0 (new 'stack-no-clear 'nav-find-poly-parms))) (set! (-> gp-0 poly) arg2) - (vector-! (-> gp-0 point) arg1 (-> obj bounds)) - (when (or (not (-> gp-0 poly)) (not (point-in-poly? obj (-> gp-0 poly) (-> gp-0 point)))) - (set! (-> gp-0 y-threshold) (-> obj nearest-y-threshold)) + (vector-! (-> gp-0 point) arg1 (-> this bounds)) + (when (or (not (-> gp-0 poly)) (not (point-in-poly? this (-> gp-0 poly) (-> gp-0 point)))) + (set! (-> gp-0 y-threshold) (-> this nearest-y-threshold)) (set! (-> gp-0 ignore) (the-as uint 3)) - (find-nearest-poly-to-point-local obj gp-0) + (find-nearest-poly-to-point-local this gp-0) (when (-> gp-0 poly) - (project-point-into-poly-2d obj (-> gp-0 poly) sv-16 (-> gp-0 point)) - (vector+! sv-16 sv-16 (-> obj bounds)) + (project-point-into-poly-2d this (-> gp-0 poly) sv-16 (-> gp-0 point)) + (vector+! sv-16 sv-16 (-> this bounds)) ) ) (-> gp-0 poly) @@ -2731,15 +2731,15 @@ ;; definition for method 34 of type nav-mesh ;; INFO: Used lq/sq -(defmethod nav-mesh-method-34 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod nav-mesh-method-34 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) (local-vars (v1-8 symbol) (v1-13 int) (a1-2 symbol) (sv-80 vector) (sv-84 (pointer uint8))) (let ((gp-0 (new 'stack-no-clear 'nav-poly))) (set! sv-80 arg0) (set! (-> gp-0 vertex3 y) (the-as float #x7f800000)) (set! (-> gp-0 vertex3 x) arg2) (set! (-> gp-0 vertex1 quad) (-> arg1 quad)) - (set! sv-84 (search-for-sphere (-> obj poly-hash) (-> gp-0 vertex1) (-> gp-0 vertex3 x))) - (let ((s4-0 (-> obj poly-hash bucket-size)) + (set! sv-84 (search-for-sphere (-> this poly-hash) (-> gp-0 vertex1) (-> gp-0 vertex3 x))) + (let ((s4-0 (-> this poly-hash bucket-size)) (s3-0 sv-84) (s2-0 0) ) @@ -2752,10 +2752,10 @@ (nop!) (b! (zero? v1-5) cfg-13 :delay (nop!)) ) - (let ((a0-5 (-> obj poly-array s1-0))) + (let ((a0-5 (-> this poly-array s1-0))) (let ((v1-7 a0-5) (f0-3 (-> gp-0 vertex1 y)) - (f1-0 (-> obj nearest-y-threshold)) + (f1-0 (-> this nearest-y-threshold)) ) (b! (>= (+ (-> v1-7 vertex3 w) f1-0) f0-3) cfg-5 :delay (set! a1-2 #t)) (set! a1-2 #f) @@ -2793,28 +2793,28 @@ ;; definition for method 35 of type nav-mesh ;; INFO: Used lq/sq ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-mesh-method-35 nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod nav-mesh-method-35 nav-mesh ((this nav-mesh) (arg0 vector) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'nav-poly 3))) (set! (-> gp-0 2 vertex3 y) arg2) - (vector-! (the-as vector (-> gp-0 0)) arg0 (-> obj bounds)) - (vector-! (-> gp-0 0 vertex1) arg1 (-> obj bounds)) + (vector-! (the-as vector (-> gp-0 0)) arg0 (-> this bounds)) + (vector-! (-> gp-0 0 vertex1) arg1 (-> this bounds)) (set! (-> gp-0 2 vertex1 quad) (-> gp-0 0 vertex0 quad)) - (set! (-> gp-0 2 vertex2 x) (-> obj nearest-y-threshold)) + (set! (-> gp-0 2 vertex2 x) (-> this nearest-y-threshold)) (set! (-> gp-0 2 data 36) (the-as uint 3)) - (let ((a1-4 (find-poly-containing-point-local obj (the-as nav-find-poly-parms (-> gp-0 2 vertex1))))) + (let ((a1-4 (find-poly-containing-point-local this (the-as nav-find-poly-parms (-> gp-0 2 vertex1))))) (cond (a1-4 (init-ray-local (the-as nav-ray (-> gp-0 1)) a1-4 (the-as vector (-> gp-0 0)) (-> gp-0 0 vertex1)) (until #f (set! (-> gp-0 2 vertex3 z) - (nav-mesh-method-34 obj (-> gp-0 0 vertex3) (the-as vector (-> gp-0 1)) (-> gp-0 2 vertex3 y)) + (nav-mesh-method-34 this (-> gp-0 0 vertex3) (the-as vector (-> gp-0 1)) (-> gp-0 2 vertex3 y)) ) (b! (>= (-> gp-0 2 vertex3 z) (-> gp-0 2 vertex3 y)) cfg-4 :delay #f) (set! (-> gp-0 2 vertex3 y) (-> gp-0 2 vertex3 z)) (set! (-> gp-0 0 vertex2 quad) (-> gp-0 0 vertex3 quad)) (label cfg-4) (b! (-> gp-0 2 vertex0 x) cfg-6 :delay (nop!)) - (move-along-nav-ray! obj (the-as nav-ray (-> gp-0 1))) + (move-along-nav-ray! this (the-as nav-ray (-> gp-0 1))) ) #f (label cfg-6) diff --git a/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc index 42699ced45..75a64fb252 100644 --- a/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc @@ -11,15 +11,15 @@ ) ;; definition for method 3 of type chain-physics-setup -(defmethod inspect chain-physics-setup ((obj chain-physics-setup)) - (when (not obj) - (set! obj obj) +(defmethod inspect chain-physics-setup ((this chain-physics-setup)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'chain-physics-setup) - (format #t "~1Tjoint-index: ~D~%" (-> obj joint-index)) + (format #t "[~8x] ~A~%" this 'chain-physics-setup) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) (label cfg-4) - obj + this ) ;; definition of type chain-physics-joint @@ -35,18 +35,18 @@ ) ;; definition for method 3 of type chain-physics-joint -(defmethod inspect chain-physics-joint ((obj chain-physics-joint)) - (when (not obj) - (set! obj obj) +(defmethod inspect chain-physics-joint ((this chain-physics-joint)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'chain-physics-joint) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) - (format #t "~1Told-x: #~%" (-> obj old-x)) - (format #t "~1Tjoint-mod: ~A~%" (-> obj joint-mod)) + (format #t "[~8x] ~A~%" this 'chain-physics-joint) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Told-x: #~%" (-> this old-x)) + (format #t "~1Tjoint-mod: ~A~%" (-> this joint-mod)) (label cfg-4) - obj + this ) ;; definition of type chain-physics @@ -84,29 +84,29 @@ ) ;; definition for method 3 of type chain-physics -(defmethod inspect chain-physics ((obj chain-physics)) - (when (not obj) - (set! obj obj) +(defmethod inspect chain-physics ((this chain-physics)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tchain-joints[20] @ #x~X~%" (-> obj chain-joints)) - (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~1Troot-joint-index: ~D~%" (-> obj root-joint-index)) - (format #t "~1Tjoint-length: ~f~%" (-> obj joint-length)) - (format #t "~1Tgravity: #~%" (-> obj gravity)) - (format #t "~1Tgravity-target: #~%" (-> obj gravity-target)) - (format #t "~1Tstretch-vel: ~f~%" (-> obj stretch-vel)) - (format #t "~1Tstretch-vel-parallel: ~f~%" (-> obj stretch-vel-parallel)) - (format #t "~1Tcompress-vel: ~f~%" (-> obj compress-vel)) - (format #t "~1Tcompress-vel-parallel: ~f~%" (-> obj compress-vel-parallel)) - (format #t "~1Tnegate-y: ~A~%" (-> obj negate-y)) - (format #t "~1Taxial-slop: ~f~%" (-> obj axial-slop)) - (format #t "~1Tmaximum-stretch: ~f~%" (-> obj maximum-stretch)) - (format #t "~1Tturn-off-start: ~D~%" (-> obj turn-off-start)) - (format #t "~1Tturn-off-duration: ~D~%" (-> obj turn-off-duration)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tchain-joints[20] @ #x~X~%" (-> this chain-joints)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Troot-joint-index: ~D~%" (-> this root-joint-index)) + (format #t "~1Tjoint-length: ~f~%" (-> this joint-length)) + (format #t "~1Tgravity: #~%" (-> this gravity)) + (format #t "~1Tgravity-target: #~%" (-> this gravity-target)) + (format #t "~1Tstretch-vel: ~f~%" (-> this stretch-vel)) + (format #t "~1Tstretch-vel-parallel: ~f~%" (-> this stretch-vel-parallel)) + (format #t "~1Tcompress-vel: ~f~%" (-> this compress-vel)) + (format #t "~1Tcompress-vel-parallel: ~f~%" (-> this compress-vel-parallel)) + (format #t "~1Tnegate-y: ~A~%" (-> this negate-y)) + (format #t "~1Taxial-slop: ~f~%" (-> this axial-slop)) + (format #t "~1Tmaximum-stretch: ~f~%" (-> this maximum-stretch)) + (format #t "~1Tturn-off-start: ~D~%" (-> this turn-off-start)) + (format #t "~1Tturn-off-duration: ~D~%" (-> this turn-off-duration)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc b/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc index 26429f9501..f6c560b6bf 100644 --- a/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/chain-physics_REF.gc @@ -3,18 +3,18 @@ ;; definition for method 12 of type chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod gravity-update chain-physics ((obj chain-physics) (arg0 process-drawable)) - (vector-seek-3d-smooth! (-> obj gravity) (-> obj gravity-target) 0.05 0.1) +(defmethod gravity-update chain-physics ((this chain-physics) (arg0 process-drawable)) + (vector-seek-3d-smooth! (-> this gravity) (-> this gravity-target) 0.05 0.1) 0 (none) ) ;; definition for method 13 of type chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod apply-gravity chain-physics ((obj chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity chain-physics ((this chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (vector-float*! arg0 - (-> obj gravity) + (-> this gravity) (* 4096.0 (-> self clock time-adjust-ratio) (fmax 0.2 (lerp-scale 0.38 0.18 (the float arg1) 0.0 5.0))) ) 0 @@ -23,10 +23,10 @@ ;; definition for method 14 of type chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-14 chain-physics ((obj chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 chain-physics ((this chain-physics) (arg0 vector) (arg1 int)) (vector-float*! arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ arg1 1) 64))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64))) (fmin 0.9 (lerp-scale 0.2 1.0 (the float arg1) 0.0 4.0)) ) 0 @@ -34,31 +34,31 @@ ) ;; definition for method 15 of type chain-physics -(defmethod clamp-length chain-physics ((obj chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) +(defmethod clamp-length chain-physics ((this chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) (let ((gp-0 (new 'stack-no-clear 'vector))) (vector-! gp-0 arg0 arg1) - (vector-normalize! gp-0 (-> obj joint-length)) + (vector-normalize! gp-0 (-> this joint-length)) (vector+! arg0 gp-0 arg1) ) ) ;; definition for method 16 of type chain-physics -(defmethod chain-physics-method-16 chain-physics ((obj chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 chain-physics ((this chain-physics) (arg0 int)) (lerp-scale 5461.3335 10922.667 (the float arg0) 0.0 8.0) ) ;; definition for method 17 of type chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-17 chain-physics ((obj chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 chain-physics ((this chain-physics) (arg0 vector) (arg1 int)) 0 (none) ) ;; definition for method 9 of type chain-physics -(defmethod initialize-chain-joints chain-physics ((obj chain-physics)) - (set! (-> obj turn-off-start) 0) - (dotimes (s5-0 (the-as int (-> obj num-joints))) - (let ((s4-0 (-> obj chain-joints s5-0))) +(defmethod initialize-chain-joints chain-physics ((this chain-physics)) + (set! (-> this turn-off-start) 0) + (dotimes (s5-0 (the-as int (-> this num-joints))) + (let ((s4-0 (-> this chain-joints s5-0))) (vector<-cspace! (-> s4-0 position) (-> s4-0 joint-mod joint)) (vector-reset! (-> s4-0 velocity)) (mode-set! (-> s4-0 joint-mod) (joint-mod-mode joint-set-world)) @@ -69,9 +69,9 @@ ;; definition for method 10 of type chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod turn-off chain-physics ((obj chain-physics) (arg0 time-frame)) - (set! (-> obj turn-off-start) (current-time)) - (set! (-> obj turn-off-duration) arg0) +(defmethod turn-off chain-physics ((this chain-physics) (arg0 time-frame)) + (set-time! (-> this turn-off-start)) + (set! (-> this turn-off-duration) arg0) 0 (none) ) @@ -79,7 +79,7 @@ ;; definition for method 11 of type chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update chain-physics ((obj chain-physics) (arg0 process-drawable)) +(defmethod update chain-physics ((this chain-physics) (arg0 process-drawable)) (local-vars (v1-78 float) (f0-11 float) @@ -111,49 +111,49 @@ (vf6 :class vf) ) (init-vf0-vector) - (gravity-update obj arg0) + (gravity-update this arg0) (let ((s4-0 (new 'stack-no-clear 'matrix)) - (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg0 node-list data (-> obj root-joint-index)))) + (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg0 node-list data (-> this root-joint-index)))) (s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> arg0 node-list data (-> obj root-joint-index) bone transform vector 2) + (-> arg0 node-list data (-> this root-joint-index) bone transform vector 2) 1.0 ) ) (s1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> arg0 node-list data (-> obj root-joint-index) bone transform vector 1) + (-> arg0 node-list data (-> this root-joint-index) bone transform vector 1) 1.0 ) ) ) (new 'stack-no-clear 'vector) (let ((f30-0 1.0)) - (if (nonzero? (-> obj turn-off-start)) + (if (nonzero? (-> this turn-off-start)) (set! f30-0 (fmax 0.0 (fmin 1.0 (parameter-ease-sin-clamp - (- 1.0 (/ (the float (- (current-time) (-> obj turn-off-start))) (the float (-> obj turn-off-duration)))) + (- 1.0 (/ (the float (- (current-time) (-> this turn-off-start))) (the float (-> this turn-off-duration)))) ) ) ) ) ) - (dotimes (s0-0 (the-as int (-> obj num-joints))) - (set! sv-272 (-> obj chain-joints s0-0)) + (dotimes (s0-0 (the-as int (-> this num-joints))) + (set! sv-272 (-> this chain-joints s0-0)) (set! sv-528 (new 'stack-no-clear 'vector)) (let ((v1-27 (-> sv-272 position quad))) (set! (-> sv-528 quad) v1-27) ) (set! (-> sv-272 joint-mod flex-blend) f30-0) - (if (-> obj negate-y) + (if (-> this negate-y) (vector-negate! s1-0 s1-0) ) (set! sv-288 (new 'stack-no-clear 'vector)) - (apply-gravity obj sv-288 s0-0 arg0) + (apply-gravity this sv-288 s0-0 arg0) (let ((v1-34 sv-528)) (let ((a0-10 sv-528)) (.mov.vf vf6 vf0 :mask #b1000) @@ -163,9 +163,9 @@ (.add.vf vf6 vf4 vf5 :mask #b111) (.svf (&-> v1-34 quad) vf6) ) - (when (< s0-0 (the-as int (+ (-> obj root-joint-index) -1))) + (when (< s0-0 (the-as int (+ (-> this root-joint-index) -1))) (set! sv-304 (new 'stack-no-clear 'vector)) - (chain-physics-method-14 obj sv-304 s0-0) + (chain-physics-method-14 this sv-304 s0-0) (let ((v1-40 sv-528)) (let ((a0-13 sv-528)) (.mov.vf vf6 vf0 :mask #b1000) @@ -176,7 +176,7 @@ (.svf (&-> v1-40 quad) vf6) ) ) - (clamp-length obj sv-528 s3-0 s0-0 arg0) + (clamp-length this sv-528 s3-0 s0-0 arg0) (set! sv-400 (new 'stack-no-clear 'vector)) (let ((v1-43 sv-528) (a0-16 s3-0) @@ -189,7 +189,7 @@ (.svf (&-> sv-400 quad) vf6) (let ((f28-1 (vector-normalize-ret-len! sv-400 1.0)) (f24-0 (vector-dot sv-400 s1-0)) - (f26-0 (chain-physics-method-16 obj s0-0)) + (f26-0 (chain-physics-method-16 this s0-0)) ) (when (< f24-0 (cos f26-0)) (vector--float*! sv-400 sv-400 s1-0 f24-0) @@ -215,7 +215,7 @@ (vector+float*! sv-528 s3-0 sv-400 f28-1) ) ) - (chain-physics-method-17 obj sv-528 s0-0) + (chain-physics-method-17 this sv-528 s0-0) (set! sv-432 (new 'stack-no-clear 'vector)) (let ((v1-61 s3-0) (a0-27 sv-528) @@ -241,12 +241,12 @@ (vector--float*! sv-416 sv-416 sv-432 f28-2) (cond ((< f28-2 0.0) - (set! f0-11 (* f28-2 (-> obj compress-vel-parallel))) - (vector-float*! sv-416 sv-416 (-> obj compress-vel)) + (set! f0-11 (* f28-2 (-> this compress-vel-parallel))) + (vector-float*! sv-416 sv-416 (-> this compress-vel)) ) (else - (set! f0-11 (* f28-2 (-> obj stretch-vel-parallel))) - (vector-float*! sv-416 sv-416 (-> obj stretch-vel)) + (set! f0-11 (* f28-2 (-> this stretch-vel-parallel))) + (vector-float*! sv-416 sv-416 (-> this stretch-vel)) ) ) ) @@ -271,7 +271,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-78 vf1) (let* ((f0-13 v1-78) - (f1-6 (* (-> obj maximum-stretch) (-> obj joint-length))) + (f1-6 (* (-> this maximum-stretch) (-> this joint-length))) (f2-3 f1-6) ) (if (< (* f2-3 f2-3) f0-13) @@ -283,10 +283,10 @@ (if (-> sv-272 joint-mod) (set! (-> sv-272 joint-mod trans quad) (-> sv-528 quad)) ) - (when (< s0-0 (the-as int (-> obj num-joints))) + (when (< s0-0 (the-as int (-> this num-joints))) (vector-! (-> s4-0 vector 1) sv-528 s3-0) (vector-normalize! (-> s4-0 vector 1) 1.0) - (if (-> obj negate-y) + (if (-> this negate-y) (vector-negate! (-> s4-0 vector 1) (-> s4-0 vector 1)) ) (vector-cross! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) s2-0) @@ -304,13 +304,13 @@ (vector-flatten! sv-496 (-> sv-272 old-x) (-> s4-0 vector 1)) (vector-normalize! sv-496 1.0) (cond - ((< (vector-dot (the-as vector (-> s4-0 vector)) sv-496) (cos (-> obj axial-slop))) + ((< (vector-dot (the-as vector (-> s4-0 vector)) sv-496) (cos (-> this axial-slop))) (vector-cross! sv-496 sv-496 (the-as vector (-> s4-0 vector))) (vector-cross! sv-496 (the-as vector (-> s4-0 vector)) sv-496) (vector-normalize! sv-496 1.0) (set! sv-464 (-> s4-0 vector)) (set! sv-448 (-> s4-0 vector)) - (let ((f0-20 (cos (-> obj axial-slop)))) + (let ((f0-20 (cos (-> this axial-slop)))) (.lvf vf1 (&-> sv-448 0 quad)) (let ((v1-107 f0-20)) (.mov vf2 v1-107) @@ -321,7 +321,7 @@ (.svf (&-> sv-464 0 quad) vf1) (set! sv-512 (-> s4-0 vector)) (set! sv-480 (-> s4-0 vector)) - (let ((f0-22 (sin (-> obj axial-slop)))) + (let ((f0-22 (sin (-> this axial-slop)))) (.lvf vf2 (&-> sv-496 quad)) (.lvf vf1 (&-> sv-480 0 quad)) (let ((v1-113 f0-22)) @@ -356,13 +356,13 @@ ) ;; definition for method 7 of type chain-physics -(defmethod relocate chain-physics ((obj chain-physics) (arg0 int)) - (dotimes (v1-0 (the-as int (-> obj num-joints))) - (if (nonzero? (-> obj chain-joints v1-0 joint-mod)) - (&+! (-> obj chain-joints v1-0 joint-mod) arg0) +(defmethod relocate chain-physics ((this chain-physics) (arg0 int)) + (dotimes (v1-0 (the-as int (-> this num-joints))) + (if (nonzero? (-> this chain-joints v1-0 joint-mod)) + (&+! (-> this chain-joints v1-0 joint-mod) arg0) ) ) - obj + this ) ;; definition for function chain-physics-initialize diff --git a/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc index 233dfb966a..7572ba0d21 100644 --- a/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc @@ -20,28 +20,28 @@ ) ;; definition for method 3 of type dynamics -(defmethod inspect dynamics ((obj dynamics)) - (when (not obj) - (set! obj obj) +(defmethod inspect dynamics ((this dynamics)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tgravity-max: (meters ~m)~%" (-> obj gravity-max)) - (format #t "~1Tgravity-length: (meters ~m)~%" (-> obj gravity-length)) - (format #t "~1Tgravity: ~`vector`P~%" (-> obj gravity)) - (format #t "~1Tgravity-normal: ~`vector`P~%" (-> obj gravity-normal)) - (format #t "~1Twalk-distance: (meters ~m)~%" (-> obj walk-distance)) - (format #t "~1Trun-distance: (meters ~m)~%" (-> obj run-distance)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tgravity-max: (meters ~m)~%" (-> this gravity-max)) + (format #t "~1Tgravity-length: (meters ~m)~%" (-> this gravity-length)) + (format #t "~1Tgravity: ~`vector`P~%" (-> this gravity)) + (format #t "~1Tgravity-normal: ~`vector`P~%" (-> this gravity-normal)) + (format #t "~1Twalk-distance: (meters ~m)~%" (-> this walk-distance)) + (format #t "~1Trun-distance: (meters ~m)~%" (-> this run-distance)) (label cfg-4) - obj + this ) ;; definition for method 9 of type dynamics ;; WARN: Return type mismatch int vs none. -(defmethod set-gravity-length dynamics ((obj dynamics) (arg0 float)) - (set! (-> obj gravity-length) arg0) - (vector-float*! (-> obj gravity) (-> obj gravity-normal) arg0) +(defmethod set-gravity-length dynamics ((this dynamics) (arg0 float)) + (set! (-> this gravity-length) arg0) + (vector-float*! (-> this gravity) (-> this gravity-normal) arg0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc index 2abd33fcff..f4628b9a2d 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body-h_REF.gc @@ -25,25 +25,25 @@ ) ;; definition for method 3 of type rigid-body-info -(defmethod inspect rigid-body-info ((obj rigid-body-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-info ((this rigid-body-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rigid-body-info) - (format #t "~1Tmass: ~f~%" (-> obj mass)) - (format #t "~1Tinv-mass: ~f~%" (-> obj inv-mass)) - (format #t "~1Tlinear-damping: ~f~%" (-> obj linear-damping)) - (format #t "~1Tangular-damping: ~f~%" (-> obj angular-damping)) - (format #t "~1Tbounce-factor: ~f~%" (-> obj bounce-factor)) - (format #t "~1Tfriction-factor: ~f~%" (-> obj friction-factor)) - (format #t "~1Tbounce-mult-factor: ~f~%" (-> obj bounce-mult-factor)) - (format #t "~1Tcm-offset-joint: ~`vector`P~%" (-> obj cm-offset-joint)) - (format #t "~1Tinv-inertial-tensor: #~%" (-> obj inv-inertial-tensor)) - (format #t "~1Tinertial-tensor: #~%" (-> obj inertial-tensor)) - (format #t "~1Tinertial-tensor-box[3] @ #x~X~%" (-> obj inertial-tensor-box)) + (format #t "[~8x] ~A~%" this 'rigid-body-info) + (format #t "~1Tmass: ~f~%" (-> this mass)) + (format #t "~1Tinv-mass: ~f~%" (-> this inv-mass)) + (format #t "~1Tlinear-damping: ~f~%" (-> this linear-damping)) + (format #t "~1Tangular-damping: ~f~%" (-> this angular-damping)) + (format #t "~1Tbounce-factor: ~f~%" (-> this bounce-factor)) + (format #t "~1Tfriction-factor: ~f~%" (-> this friction-factor)) + (format #t "~1Tbounce-mult-factor: ~f~%" (-> this bounce-mult-factor)) + (format #t "~1Tcm-offset-joint: ~`vector`P~%" (-> this cm-offset-joint)) + (format #t "~1Tinv-inertial-tensor: #~%" (-> this inv-inertial-tensor)) + (format #t "~1Tinertial-tensor: #~%" (-> this inertial-tensor)) + (format #t "~1Tinertial-tensor-box[3] @ #x~X~%" (-> this inertial-tensor-box)) (label cfg-4) - obj + this ) ;; definition of type rigid-body-object-extra-info @@ -60,18 +60,18 @@ ) ;; definition for method 3 of type rigid-body-object-extra-info -(defmethod inspect rigid-body-object-extra-info ((obj rigid-body-object-extra-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-object-extra-info ((this rigid-body-object-extra-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rigid-body-object-extra-info) - (format #t "~1Tmax-time-step: ~f~%" (-> obj max-time-step)) - (format #t "~1Tgravity: (meters ~m)~%" (-> obj gravity)) - (format #t "~1Tidle-distance: (meters ~m)~%" (-> obj idle-distance)) - (format #t "~1Tattack-force-scale: ~f~%" (-> obj attack-force-scale)) + (format #t "[~8x] ~A~%" this 'rigid-body-object-extra-info) + (format #t "~1Tmax-time-step: ~f~%" (-> this max-time-step)) + (format #t "~1Tgravity: (meters ~m)~%" (-> this gravity)) + (format #t "~1Tidle-distance: (meters ~m)~%" (-> this idle-distance)) + (format #t "~1Tattack-force-scale: ~f~%" (-> this attack-force-scale)) (label cfg-4) - obj + this ) ;; definition of type rigid-body-object-constants @@ -98,33 +98,33 @@ ) ;; definition for method 3 of type rigid-body-object-constants -(defmethod inspect rigid-body-object-constants ((obj rigid-body-object-constants)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-object-constants ((this rigid-body-object-constants)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rigid-body-object-constants) - (format #t "~1Tinfo: #~%" (-> obj info)) - (format #t "~1Tmass: ~f~%" (-> obj info mass)) - (format #t "~1Tinv-mass: ~f~%" (-> obj info inv-mass)) - (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> obj info cm-offset-joint x)) - (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> obj info cm-offset-joint y)) - (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> obj info cm-offset-joint z)) - (format #t "~1Tlinear-damping: ~f~%" (-> obj info linear-damping)) - (format #t "~1Tangular-damping: ~f~%" (-> obj info angular-damping)) - (format #t "~1Tbounce-factor: ~f~%" (-> obj info bounce-factor)) - (format #t "~1Tfriction-factor: ~f~%" (-> obj info friction-factor)) - (format #t "~1Tinertial-tensor-x: (meters ~m)~%" (-> obj inertial-tensor-x)) - (format #t "~1Tinertial-tensor-y: (meters ~m)~%" (-> obj inertial-tensor-y)) - (format #t "~1Tinertial-tensor-z: (meters ~m)~%" (-> obj inertial-tensor-z)) - (format #t "~1Textra: #~%" (-> obj extra)) - (format #t "~1Tmax-time-step: ~f~%" (-> obj extra max-time-step)) - (format #t "~1Tgravity: (meters ~m)~%" (-> obj extra gravity)) - (format #t "~1Tidle-distance: (meters ~m)~%" (-> obj extra idle-distance)) - (format #t "~1Tattack-force-scale: ~f~%" (-> obj extra attack-force-scale)) - (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "[~8x] ~A~%" this 'rigid-body-object-constants) + (format #t "~1Tinfo: #~%" (-> this info)) + (format #t "~1Tmass: ~f~%" (-> this info mass)) + (format #t "~1Tinv-mass: ~f~%" (-> this info inv-mass)) + (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> this info cm-offset-joint x)) + (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> this info cm-offset-joint y)) + (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> this info cm-offset-joint z)) + (format #t "~1Tlinear-damping: ~f~%" (-> this info linear-damping)) + (format #t "~1Tangular-damping: ~f~%" (-> this info angular-damping)) + (format #t "~1Tbounce-factor: ~f~%" (-> this info bounce-factor)) + (format #t "~1Tfriction-factor: ~f~%" (-> this info friction-factor)) + (format #t "~1Tinertial-tensor-x: (meters ~m)~%" (-> this inertial-tensor-x)) + (format #t "~1Tinertial-tensor-y: (meters ~m)~%" (-> this inertial-tensor-y)) + (format #t "~1Tinertial-tensor-z: (meters ~m)~%" (-> this inertial-tensor-z)) + (format #t "~1Textra: #~%" (-> this extra)) + (format #t "~1Tmax-time-step: ~f~%" (-> this extra max-time-step)) + (format #t "~1Tgravity: (meters ~m)~%" (-> this extra gravity)) + (format #t "~1Tidle-distance: (meters ~m)~%" (-> this extra idle-distance)) + (format #t "~1Tattack-force-scale: ~f~%" (-> this extra attack-force-scale)) + (format #t "~1Tname: ~A~%" (-> this name)) (label cfg-4) - obj + this ) ;; definition of type rigid-body-impact @@ -143,21 +143,21 @@ ) ;; definition for method 3 of type rigid-body-impact -(defmethod inspect rigid-body-impact ((obj rigid-body-impact)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-impact ((this rigid-body-impact)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rigid-body-impact) - (format #t "~1Tpoint: ~`vector`P~%" (-> obj point)) - (format #t "~1Tnormal: ~`vector`P~%" (-> obj normal)) - (format #t "~1Tvelocity: ~`vector`P~%" (-> obj velocity)) - (format #t "~1Timpulse: ~f~%" (-> obj impulse)) - (format #t "~1Tpat: ~D~%" (-> obj pat)) - (format #t "~1Trbody: ~A~%" (-> obj rbody)) - (format #t "~1Tprim-id: ~D~%" (-> obj prim-id)) + (format #t "[~8x] ~A~%" this 'rigid-body-impact) + (format #t "~1Tpoint: ~`vector`P~%" (-> this point)) + (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~1Tvelocity: ~`vector`P~%" (-> this velocity)) + (format #t "~1Timpulse: ~f~%" (-> this impulse)) + (format #t "~1Tpat: ~D~%" (-> this pat)) + (format #t "~1Trbody: ~A~%" (-> this rbody)) + (format #t "~1Tprim-id: ~D~%" (-> this prim-id)) (label cfg-4) - obj + this ) ;; definition of type rigid-body @@ -212,16 +212,16 @@ ) ;; definition for method 3 of type rigid-body -(defmethod inspect rigid-body ((obj rigid-body)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body ((this rigid-body)) + (when (not this) + (set! this this) (goto cfg-16) ) - (format #t "[~8x] ~A~%" obj 'rigid-body) - (format #t "~1Twork: ~A~%" (-> obj work)) - (format #t "~1Tinfo: #~%" (-> obj info)) - (format #t "~1Tflags: #x~X : (rigid-body-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'rigid-body) + (format #t "~1Twork: ~A~%" (-> this work)) + (format #t "~1Tinfo: #~%" (-> this info)) + (format #t "~1Tflags: #x~X : (rigid-body-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (rigid-body-flag active)) (rigid-body-flag active)) (format #t "active ") ) @@ -242,23 +242,23 @@ ) ) (format #t ")~%") - (format #t "~1Tforce-callback: ~A~%" (-> obj force-callback)) - (format #t "~1Tblocked-by: ~A~%" (-> obj blocked-by)) - (format #t "~1Ttime-remaining: ~f~%" (-> obj time-remaining)) - (format #t "~1Tstep-count: ~D~%" (-> obj step-count)) - (format #t "~1Tposition: ~`vector`P~%" (-> obj position)) - (format #t "~1Trot: ~`vector`P~%" (-> obj rotation)) - (format #t "~1Trotation: #~%" (-> obj rotation)) - (format #t "~1Tlin-momentum: ~`vector`P~%" (-> obj lin-momentum)) - (format #t "~1Tang-momentum: ~`vector`P~%" (-> obj ang-momentum)) - (format #t "~1Tforce: ~`vector`P~%" (-> obj force)) - (format #t "~1Ttorque: ~`vector`P~%" (-> obj torque)) - (format #t "~1Tlin-velocity: ~`vector`P~%" (-> obj lin-velocity)) - (format #t "~1Tang-velocity: ~`vector`P~%" (-> obj ang-velocity)) - (format #t "~1Tmatrix: #~%" (-> obj matrix)) - (format #t "~1Tinv-i-world: #~%" (-> obj inv-i-world)) + (format #t "~1Tforce-callback: ~A~%" (-> this force-callback)) + (format #t "~1Tblocked-by: ~A~%" (-> this blocked-by)) + (format #t "~1Ttime-remaining: ~f~%" (-> this time-remaining)) + (format #t "~1Tstep-count: ~D~%" (-> this step-count)) + (format #t "~1Tposition: ~`vector`P~%" (-> this position)) + (format #t "~1Trot: ~`vector`P~%" (-> this rotation)) + (format #t "~1Trotation: #~%" (-> this rotation)) + (format #t "~1Tlin-momentum: ~`vector`P~%" (-> this lin-momentum)) + (format #t "~1Tang-momentum: ~`vector`P~%" (-> this ang-momentum)) + (format #t "~1Tforce: ~`vector`P~%" (-> this force)) + (format #t "~1Ttorque: ~`vector`P~%" (-> this torque)) + (format #t "~1Tlin-velocity: ~`vector`P~%" (-> this lin-velocity)) + (format #t "~1Tang-velocity: ~`vector`P~%" (-> this ang-velocity)) + (format #t "~1Tmatrix: #~%" (-> this matrix)) + (format #t "~1Tinv-i-world: #~%" (-> this inv-i-world)) (label cfg-16) - obj + this ) ;; definition of type rigid-body-control @@ -292,18 +292,18 @@ ) ;; definition for method 3 of type rigid-body-control -(defmethod inspect rigid-body-control ((obj rigid-body-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-control ((this rigid-body-control)) + (when (not this) + (set! this this) (goto cfg-16) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tstate: #~%" (-> obj state)) - (format #t "~1Twork: ~A~%" (-> obj state work)) - (format #t "~1Tinfo: #~%" (-> obj state info)) - (format #t "~1Tflags: #x~X : (rigid-body-flag " (-> obj state flags)) - (let ((s5-0 (-> obj state flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tstate: #~%" (-> this state)) + (format #t "~1Twork: ~A~%" (-> this state work)) + (format #t "~1Tinfo: #~%" (-> this state info)) + (format #t "~1Tflags: #x~X : (rigid-body-flag " (-> this state flags)) + (let ((s5-0 (-> this state flags))) (if (= (logand s5-0 (rigid-body-flag active)) (rigid-body-flag active)) (format #t "active ") ) @@ -324,123 +324,122 @@ ) ) (format #t ")~%") - (format #t "~1Tforce-callback: ~A~%" (-> obj state force-callback)) - (format #t "~1Tblocked-by: ~A~%" (-> obj state blocked-by)) - (format #t "~1Ttime-remaining: ~f~%" (-> obj state time-remaining)) - (format #t "~1Tstep-count: ~D~%" (-> obj state step-count)) - (format #t "~1Tposition: ~`vector`P~%" (-> obj state position)) - (format #t "~1Trot: ~`vector`P~%" (-> obj state rotation)) - (format #t "~1Trotation: #~%" (-> obj state rotation)) - (format #t "~1Tlin-momentum: ~`vector`P~%" (-> obj state lin-momentum)) - (format #t "~1Tang-momentum: ~`vector`P~%" (-> obj state ang-momentum)) - (format #t "~1Tforce: ~`vector`P~%" (-> obj state force)) - (format #t "~1Ttorque: ~`vector`P~%" (-> obj state torque)) - (format #t "~1Tlin-velocity: ~`vector`P~%" (-> obj state lin-velocity)) - (format #t "~1Tang-velocity: ~`vector`P~%" (-> obj state ang-velocity)) - (format #t "~1Tmatrix: #~%" (-> obj state matrix)) - (format #t "~1Tinv-i-world: #~%" (-> obj state inv-i-world)) + (format #t "~1Tforce-callback: ~A~%" (-> this state force-callback)) + (format #t "~1Tblocked-by: ~A~%" (-> this state blocked-by)) + (format #t "~1Ttime-remaining: ~f~%" (-> this state time-remaining)) + (format #t "~1Tstep-count: ~D~%" (-> this state step-count)) + (format #t "~1Tposition: ~`vector`P~%" (-> this state position)) + (format #t "~1Trot: ~`vector`P~%" (-> this state rotation)) + (format #t "~1Trotation: #~%" (-> this state rotation)) + (format #t "~1Tlin-momentum: ~`vector`P~%" (-> this state lin-momentum)) + (format #t "~1Tang-momentum: ~`vector`P~%" (-> this state ang-momentum)) + (format #t "~1Tforce: ~`vector`P~%" (-> this state force)) + (format #t "~1Ttorque: ~`vector`P~%" (-> this state torque)) + (format #t "~1Tlin-velocity: ~`vector`P~%" (-> this state lin-velocity)) + (format #t "~1Tang-velocity: ~`vector`P~%" (-> this state ang-velocity)) + (format #t "~1Tmatrix: #~%" (-> this state matrix)) + (format #t "~1Tinv-i-world: #~%" (-> this state inv-i-world)) (label cfg-16) - obj + this ) ;; definition for method 9 of type rigid-body-control -(defmethod rigid-body-control-method-9 rigid-body-control ((obj rigid-body-control) (arg0 collide-shape-moving) (arg1 float)) - (rigid-body-method-9 (-> obj state) arg0 arg1) +(defmethod rigid-body-control-method-9 rigid-body-control ((this rigid-body-control) (arg0 collide-shape-moving) (arg1 float)) + (rigid-body-method-9 (-> this state) arg0 arg1) (none) ) ;; definition for method 10 of type rigid-body-control -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch none vs object. -(defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) - (rigid-body-method-10 (-> obj state)) +(defmethod rigid-body-control-method-10 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) + (rigid-body-method-10 (-> this state)) ) ;; definition for method 11 of type rigid-body-control -(defmethod rigid-body-control-method-11 rigid-body-control ((obj rigid-body-control) (arg0 collide-shape-moving)) - (rigid-body-method-11 (-> obj state) arg0) +(defmethod rigid-body-control-method-11 rigid-body-control ((this rigid-body-control) (arg0 collide-shape-moving)) + (rigid-body-method-11 (-> this state) arg0) (none) ) ;; definition for method 12 of type rigid-body-control -(defmethod rigid-body-control-method-12 rigid-body-control ((obj rigid-body-control) (arg0 float)) - (rigid-body-method-12 (-> obj state) arg0) +(defmethod rigid-body-control-method-12 rigid-body-control ((this rigid-body-control) (arg0 float)) + (rigid-body-method-12 (-> this state) arg0) (none) ) ;; definition for method 13 of type rigid-body-control -(defmethod rigid-body-control-method-13 rigid-body-control ((obj rigid-body-control)) - (rigid-body-method-13 (-> obj state)) +(defmethod rigid-body-control-method-13 rigid-body-control ((this rigid-body-control)) + (rigid-body-method-13 (-> this state)) (none) ) ;; definition for method 14 of type rigid-body-control -(defmethod rigid-body-control-method-14 rigid-body-control ((obj rigid-body-control) (arg0 float)) - (rigid-body-method-14 (-> obj state) arg0) +(defmethod rigid-body-control-method-14 rigid-body-control ((this rigid-body-control) (arg0 float)) + (rigid-body-method-14 (-> this state) arg0) (none) ) ;; definition for method 15 of type rigid-body-control -(defmethod clear-force-torque! rigid-body-control ((obj rigid-body-control)) - (clear-force-torque! (-> obj state)) +(defmethod clear-force-torque! rigid-body-control ((this rigid-body-control)) + (clear-force-torque! (-> this state)) (none) ) ;; definition for method 16 of type rigid-body-control -(defmethod clear-momentum! rigid-body-control ((obj rigid-body-control)) - (clear-momentum! (-> obj state)) +(defmethod clear-momentum! rigid-body-control ((this rigid-body-control)) + (clear-momentum! (-> this state)) (none) ) ;; definition for method 17 of type rigid-body-control -(defmethod rigid-body-control-method-17 rigid-body-control ((obj rigid-body-control) (arg0 vector) (arg1 vector)) - (rigid-body-method-18 (-> obj state) arg0 arg1) +(defmethod rigid-body-control-method-17 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) + (rigid-body-method-18 (-> this state) arg0 arg1) (none) ) ;; definition for method 18 of type rigid-body-control -(defmethod rigid-body-control-method-18 rigid-body-control ((obj rigid-body-control) (arg0 vector) (arg1 vector)) - (rigid-body-method-19 (-> obj state) arg0 arg1) +(defmethod rigid-body-control-method-18 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) + (rigid-body-method-19 (-> this state) arg0 arg1) (none) ) ;; definition for method 19 of type rigid-body-control -(defmethod rigid-body-control-method-19 rigid-body-control ((obj rigid-body-control) (arg0 vector)) - (rigid-body-method-20 (-> obj state) arg0) +(defmethod rigid-body-control-method-19 rigid-body-control ((this rigid-body-control) (arg0 vector)) + (rigid-body-method-20 (-> this state) arg0) (none) ) ;; definition for method 20 of type rigid-body-control -(defmethod rigid-body-control-method-20 rigid-body-control ((obj rigid-body-control) (arg0 vector) (arg1 vector) (arg2 float)) - (rigid-body-method-21 (-> obj state) arg0 arg1 arg2) +(defmethod rigid-body-control-method-20 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector) (arg2 float)) + (rigid-body-method-21 (-> this state) arg0 arg1 arg2) (none) ) ;; definition for method 21 of type rigid-body-control -(defmethod rigid-body-control-method-21 rigid-body-control ((obj rigid-body-control) (arg0 vector) (arg1 vector)) - (rigid-body-method-22 (-> obj state) arg0 arg1) +(defmethod rigid-body-control-method-21 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 vector)) + (rigid-body-method-22 (-> this state) arg0 arg1) ) ;; definition for method 22 of type rigid-body-control -(defmethod rigid-body-control-method-22 rigid-body-control ((obj rigid-body-control) (arg0 vector)) - (rigid-body-method-23 (-> obj state) arg0) +(defmethod rigid-body-control-method-22 rigid-body-control ((this rigid-body-control) (arg0 vector)) + (rigid-body-method-23 (-> this state) arg0) ) ;; definition for method 23 of type rigid-body-control -(defmethod rigid-body-control-method-23 rigid-body-control ((obj rigid-body-control)) - (rigid-body-method-24 (-> obj state)) +(defmethod rigid-body-control-method-23 rigid-body-control ((this rigid-body-control)) + (rigid-body-method-24 (-> this state)) (none) ) ;; definition for method 24 of type rigid-body-control -(defmethod rigid-body-control-method-24 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 basic)) - (rigid-body-method-25 (-> obj state) arg0 arg1 arg2 (the-as function arg3)) +(defmethod rigid-body-control-method-24 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 basic)) + (rigid-body-method-25 (-> this state) arg0 arg1 arg2 (the-as function arg3)) (none) ) ;; definition for method 25 of type rigid-body-control -(defmethod rigid-body-control-method-25 rigid-body-control ((obj rigid-body-control) (arg0 vector) (arg1 quaternion)) - (rigid-body-method-26 (-> obj state) arg0 arg1) +(defmethod rigid-body-control-method-25 rigid-body-control ((this rigid-body-control) (arg0 vector) (arg1 quaternion)) + (rigid-body-method-26 (-> this state) arg0 arg1) (none) ) @@ -491,17 +490,17 @@ ) ;; definition for method 3 of type rigid-body-object -(defmethod inspect rigid-body-object ((obj rigid-body-object)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-object ((this rigid-body-object)) + (when (not this) + (set! this this) (goto cfg-22) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: #~%" (-> obj info)) - (format #t "~2Tflags: #x~X : (rigid-body-object-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "~2Tinfo: #~%" (-> this info)) + (format #t "~2Tflags: #x~X : (rigid-body-object-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (rigid-body-object-flag dead)) (rigid-body-object-flag dead)) (format #t "dead ") ) @@ -531,14 +530,14 @@ ) ) (format #t ")~%") - (format #t "~2Tmax-time-step: ~f~%" (-> obj max-time-step)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tplayer-touch-time: ~D~%" (-> obj player-touch-time)) - (format #t "~2Tdisturbed-time: ~D~%" (-> obj disturbed-time)) - (format #t "~2Tplayer-force-position: #~%" (-> obj player-force-position)) - (format #t "~2Tplayer-force: #~%" (-> obj player-force)) + (format #t "~2Tmax-time-step: ~f~%" (-> this max-time-step)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tplayer-touch-time: ~D~%" (-> this player-touch-time)) + (format #t "~2Tdisturbed-time: ~D~%" (-> this disturbed-time)) + (format #t "~2Tplayer-force-position: #~%" (-> this player-force-position)) + (format #t "~2Tplayer-force: #~%" (-> this player-force)) (label cfg-22) - obj + this ) ;; definition of type rigid-body-queue @@ -562,16 +561,16 @@ ) ;; definition for method 3 of type rigid-body-queue -(defmethod inspect rigid-body-queue ((obj rigid-body-queue)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-queue ((this rigid-body-queue)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rigid-body-queue) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tarray[128] @ #x~X~%" (-> obj array)) + (format #t "[~8x] ~A~%" this 'rigid-body-queue) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tarray[128] @ #x~X~%" (-> this array)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc index 976fd73f04..c8643974a7 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body-queue_REF.gc @@ -3,24 +3,24 @@ ;; definition for method 9 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-9 rigid-body-queue ((obj rigid-body-queue)) - (set! (-> obj count) 0) +(defmethod rigid-body-queue-method-9 rigid-body-queue ((this rigid-body-queue)) + (set! (-> this count) 0) (dotimes (v1-0 128) - (set! (-> obj array v1-0) (the-as handle #f)) + (set! (-> this array v1-0) (the-as handle #f)) ) 0 (none) ) ;; definition for method 16 of type rigid-body-queue -(defmethod validate rigid-body-queue ((obj rigid-body-queue)) +(defmethod validate rigid-body-queue ((this rigid-body-queue)) (let ((gp-0 0)) - (dotimes (v1-0 (-> obj count)) - (let ((a1-2 (-> obj array v1-0)) + (dotimes (v1-0 (-> this count)) + (let ((a1-2 (-> this array v1-0)) (a2-0 (+ v1-0 1)) ) - (while (< a2-0 (-> obj count)) - (if (= a1-2 (-> obj array a2-0)) + (while (< a2-0 (-> this count)) + (if (= a1-2 (-> this array a2-0)) (+! gp-0 1) ) (+! a2-0 1) @@ -36,16 +36,16 @@ ;; definition for method 10 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-10 rigid-body-queue ((obj rigid-body-queue)) +(defmethod rigid-body-queue-method-10 rigid-body-queue ((this rigid-body-queue)) (local-vars (s4-0 process)) (with-pp (let ((f0-0 (seconds-per-frame)) - (v1-1 (-> obj count)) + (v1-1 (-> this count)) ) (b! #t cfg-9 :delay (nop!)) (label cfg-1) (+! v1-1 -1) - (let ((a0-4 (handle->process (-> obj array v1-1)))) + (let ((a0-4 (handle->process (-> this array v1-1)))) (cond (a0-4 (let ((a0-6 (-> (the-as rigid-body-object a0-4) rbody))) @@ -64,9 +64,9 @@ ) (let ((s5-0 0)) (b! #t cfg-35 :delay (nop!)) - (until (= (-> obj array s5-0) (process->handle s4-0)) + (until (= (-> this array s5-0) (process->handle s4-0)) (label cfg-11) - (set! s4-0 (handle->process (-> obj array s5-0))) + (set! s4-0 (handle->process (-> this array s5-0))) (b! (not s4-0) cfg-34 :delay (empty-form)) (let ((s3-0 (-> (the-as rigid-body-object s4-0) rbody))) (b! @@ -83,19 +83,19 @@ (b! (not a2-2) cfg-34 :delay (empty-form)) (b! (not #t) cfg-34 :delay (empty-form)) (logior! (-> a2-2 rbody state flags) (rigid-body-flag blocker)) - (rigid-body-queue-method-13 obj s5-0 a2-2) + (rigid-body-queue-method-13 this s5-0 a2-2) ) ) ) (label cfg-34) (+! s5-0 1) (label cfg-35) - (b! (< s5-0 (-> obj count)) cfg-11) + (b! (< s5-0 (-> this count)) cfg-11) ) (let ((s5-1 0)) (b! #t cfg-48 :delay (nop!)) (label cfg-37) - (let ((a0-20 (handle->process (-> obj array s5-1)))) + (let ((a0-20 (handle->process (-> this array s5-1)))) (when (and a0-20 (logtest? (-> (the-as rigid-body-object a0-20) rbody state flags) (rigid-body-flag enable-physics)) ) @@ -108,7 +108,7 @@ ) (+! s5-1 1) (label cfg-48) - (b! (< s5-1 (-> obj count)) cfg-37) + (b! (< s5-1 (-> this count)) cfg-37) ) 0 (none) @@ -117,28 +117,28 @@ ;; definition for method 11 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-11 rigid-body-queue ((obj rigid-body-queue) (arg0 rigid-body-object)) +(defmethod rigid-body-queue-method-11 rigid-body-queue ((this rigid-body-queue) (arg0 rigid-body-object)) (let ((v1-0 -1)) (let ((a2-0 0)) (b! #t cfg-9 :delay (nop!)) (label cfg-1) - (b! (handle->process (-> obj array a2-0)) cfg-8 :delay (empty-form)) + (b! (handle->process (-> this array a2-0)) cfg-8 :delay (empty-form)) (set! v1-0 a2-0) (b! #t cfg-11 :delay (nop!)) (label cfg-8) (+! a2-0 1) (label cfg-9) - (b! (< a2-0 (-> obj count)) cfg-1) + (b! (< a2-0 (-> this count)) cfg-1) ) (label cfg-11) (b! (= v1-0 -1) cfg-18 :delay (nop!)) - (set! (-> obj array v1-0) (process->handle arg0)) + (set! (-> this array v1-0) (process->handle arg0)) ) (b! #t cfg-25 :delay (nop!)) (label cfg-18) - (b! (>= (-> obj count) 128) cfg-25 :delay #f) - (set! (-> obj array (-> obj count)) (process->handle arg0)) - (+! (-> obj count) 1) + (b! (>= (-> this count) 128) cfg-25 :delay #f) + (set! (-> this array (-> this count)) (process->handle arg0)) + (+! (-> this count) 1) (label cfg-25) 0 0 @@ -147,18 +147,18 @@ ;; definition for method 12 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-12 rigid-body-queue ((obj rigid-body-queue) (arg0 int) (arg1 int)) +(defmethod rigid-body-queue-method-12 rigid-body-queue ((this rigid-body-queue) (arg0 int) (arg1 int)) (when (< arg0 arg1) (let ((v1-1 arg1) (a3-0 (+ arg1 -1)) - (a2-3 (-> obj array arg1)) + (a2-3 (-> this array arg1)) ) (while (>= a3-0 arg0) - (set! (-> obj array v1-1) (-> obj array a3-0)) + (set! (-> this array v1-1) (-> this array a3-0)) (+! a3-0 -1) (+! v1-1 -1) ) - (set! (-> obj array arg0) a2-3) + (set! (-> this array arg0) a2-3) ) ) 0 @@ -167,19 +167,19 @@ ;; definition for method 13 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-13 rigid-body-queue ((obj rigid-body-queue) (arg0 int) (arg1 rigid-body-object)) +(defmethod rigid-body-queue-method-13 rigid-body-queue ((this rigid-body-queue) (arg0 int) (arg1 rigid-body-object)) (let ((v1-2 (process->handle arg1)) (a2-4 (+ arg0 1)) ) (b! #t cfg-9 :delay (nop!)) (label cfg-6) - (b! (!= (-> obj array a2-4) v1-2) cfg-8 :delay (empty-form)) - (rigid-body-queue-method-12 obj arg0 a2-4) + (b! (!= (-> this array a2-4) v1-2) cfg-8 :delay (empty-form)) + (rigid-body-queue-method-12 this arg0 a2-4) (b! #t cfg-11 :delay (nop!)) (label cfg-8) (+! a2-4 1) (label cfg-9) - (b! (< a2-4 (-> obj count)) cfg-6) + (b! (< a2-4 (-> this count)) cfg-6) ) (label cfg-11) 0 @@ -189,36 +189,36 @@ ;; definition for method 14 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-14 rigid-body-queue ((obj rigid-body-queue) (arg0 int)) +(defmethod rigid-body-queue-method-14 rigid-body-queue ((this rigid-body-queue) (arg0 int)) (let ((v1-0 arg0) (a1-1 (+ arg0 1)) ) - (while (< a1-1 (-> obj count)) - (set! (-> obj array v1-0) (-> obj array a1-1)) + (while (< a1-1 (-> this count)) + (set! (-> this array v1-0) (-> this array a1-1)) (+! a1-1 1) (+! v1-0 1) ) ) - (+! (-> obj count) -1) + (+! (-> this count) -1) 0 (none) ) ;; definition for method 15 of type rigid-body-queue ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-queue-method-15 rigid-body-queue ((obj rigid-body-queue) (arg0 rigid-body-object)) +(defmethod rigid-body-queue-method-15 rigid-body-queue ((this rigid-body-queue) (arg0 rigid-body-object)) (let ((v1-2 (process->handle arg0)) (a1-4 0) ) (b! #t cfg-9 :delay (nop!)) (label cfg-6) - (b! (!= (-> obj array a1-4) v1-2) cfg-8 :delay (empty-form)) - (rigid-body-queue-method-14 obj a1-4) + (b! (!= (-> this array a1-4) v1-2) cfg-8 :delay (empty-form)) + (rigid-body-queue-method-14 this a1-4) (b! #t cfg-11 :delay (nop!)) (label cfg-8) (+! a1-4 1) (label cfg-9) - (b! (< a1-4 (-> obj count)) cfg-6) + (b! (< a1-4 (-> this count)) cfg-6) ) (label cfg-11) 0 @@ -240,17 +240,17 @@ ) ;; definition for method 3 of type rigid-body-queue-manager -(defmethod inspect rigid-body-queue-manager ((obj rigid-body-queue-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-queue-manager ((this rigid-body-queue-manager)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tqueue: #~%" (-> obj queue)) + (format #t "~2Tqueue: #~%" (-> this queue)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc index 6e59d783be..d91c53b95c 100644 --- a/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/rigid-body_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type rigid-body-work -(defmethod inspect rigid-body-work ((obj rigid-body-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-work ((this rigid-body-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rigid-body-work) - (format #t "~1Tmax-ang-momentum: ~f~%" (-> obj max-ang-momentum)) - (format #t "~1Tmax-ang-velocity: ~f~%" (-> obj max-ang-velocity)) + (format #t "[~8x] ~A~%" this 'rigid-body-work) + (format #t "~1Tmax-ang-momentum: ~f~%" (-> this max-ang-momentum)) + (format #t "~1Tmax-ang-velocity: ~f~%" (-> this max-ang-velocity)) (label cfg-4) - obj + this ) ;; definition for symbol *rigid-body-work*, type rigid-body-work @@ -36,45 +36,45 @@ ) ;; definition for method 7 of type rigid-body-control -(defmethod relocate rigid-body-control ((obj rigid-body-control) (arg0 int)) - (&+! (-> obj process) arg0) - obj +(defmethod relocate rigid-body-control ((this rigid-body-control) (arg0 int)) + (&+! (-> this process) arg0) + this ) ;; definition for method 9 of type rigid-body-info ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-info-method-9 rigid-body-info ((obj rigid-body-info)) - (let ((f24-0 (-> obj mass)) - (f28-0 (-> obj inertial-tensor-box 0)) - (f30-0 (-> obj inertial-tensor-box 1)) - (f26-0 (-> obj inertial-tensor-box 2)) +(defmethod rigid-body-info-method-9 rigid-body-info ((this rigid-body-info)) + (let ((f24-0 (-> this mass)) + (f28-0 (-> this inertial-tensor-box 0)) + (f30-0 (-> this inertial-tensor-box 1)) + (f26-0 (-> this inertial-tensor-box 2)) ) (let ((f0-0 f24-0)) - (set! (-> obj inv-mass) (/ 1.0 f0-0)) + (set! (-> this inv-mass) (/ 1.0 f0-0)) ) - (matrix-identity! (-> obj inertial-tensor)) - (matrix-identity! (-> obj inv-inertial-tensor)) + (matrix-identity! (-> this inertial-tensor)) + (matrix-identity! (-> this inv-inertial-tensor)) (let ((f0-4 (* 0.083333336 f24-0))) (let* ((f1-1 f30-0) (f1-3 (* f1-1 f1-1)) (f2-0 f26-0) ) - (set! (-> obj inertial-tensor vector 0 x) (* f0-4 (+ f1-3 (* f2-0 f2-0)))) + (set! (-> this inertial-tensor vector 0 x) (* f0-4 (+ f1-3 (* f2-0 f2-0)))) ) (let ((f1-6 f28-0)) - (set! (-> obj inertial-tensor vector 1 y) (* f0-4 (+ (* f1-6 f1-6) (* f26-0 f26-0)))) + (set! (-> this inertial-tensor vector 1 y) (* f0-4 (+ (* f1-6 f1-6) (* f26-0 f26-0)))) ) - (set! (-> obj inertial-tensor vector 2 z) (* f0-4 (+ (* f28-0 f28-0) (* f30-0 f30-0)))) + (set! (-> this inertial-tensor vector 2 z) (* f0-4 (+ (* f28-0 f28-0) (* f30-0 f30-0)))) ) ) - (let ((f0-6 (-> obj inertial-tensor vector 0 x))) - (set! (-> obj inv-inertial-tensor vector 0 x) (/ 1.0 f0-6)) + (let ((f0-6 (-> this inertial-tensor vector 0 x))) + (set! (-> this inv-inertial-tensor vector 0 x) (/ 1.0 f0-6)) ) - (let ((f0-9 (-> obj inertial-tensor vector 1 y))) - (set! (-> obj inv-inertial-tensor vector 1 y) (/ 1.0 f0-9)) + (let ((f0-9 (-> this inertial-tensor vector 1 y))) + (set! (-> this inv-inertial-tensor vector 1 y) (/ 1.0 f0-9)) ) - (let ((f0-12 (-> obj inertial-tensor vector 2 z))) - (set! (-> obj inv-inertial-tensor vector 2 z) (/ 1.0 f0-12)) + (let ((f0-12 (-> this inertial-tensor vector 2 z))) + (set! (-> this inv-inertial-tensor vector 2 z) (/ 1.0 f0-12)) ) 0 (none) @@ -83,9 +83,9 @@ ;; definition for method 16 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod clear-force-torque! rigid-body ((obj rigid-body)) - (set! (-> obj force quad) (the-as uint128 0)) - (set! (-> obj torque quad) (the-as uint128 0)) +(defmethod clear-force-torque! rigid-body ((this rigid-body)) + (set! (-> this force quad) (the-as uint128 0)) + (set! (-> this torque quad) (the-as uint128 0)) 0 (none) ) @@ -93,21 +93,21 @@ ;; definition for method 17 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod clear-momentum! rigid-body ((obj rigid-body)) - (set! (-> obj lin-momentum quad) (the-as uint128 0)) - (set! (-> obj ang-momentum quad) (the-as uint128 0)) +(defmethod clear-momentum! rigid-body ((this rigid-body)) + (set! (-> this lin-momentum quad) (the-as uint128 0)) + (set! (-> this ang-momentum quad) (the-as uint128 0)) 0 (none) ) ;; definition for method 24 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-24 rigid-body ((obj rigid-body)) +(defmethod rigid-body-method-24 rigid-body ((this rigid-body)) (when #t - (quaternion->matrix (-> obj matrix) (-> obj rotation)) + (quaternion->matrix (-> this matrix) (-> this rotation)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-rotate*! s5-0 (-> obj info cm-offset-joint) (-> obj matrix)) - (vector-! (-> obj matrix trans) (-> obj position) s5-0) + (vector-rotate*! s5-0 (-> this info cm-offset-joint) (-> this matrix)) + (vector-! (-> this matrix trans) (-> this position) s5-0) ) ) 0 @@ -116,15 +116,15 @@ ;; definition for method 26 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-26 rigid-body ((obj rigid-body) (arg0 vector) (arg1 quaternion)) +(defmethod rigid-body-method-26 rigid-body ((this rigid-body) (arg0 vector) (arg1 quaternion)) (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 8))) (quaternion->matrix (the-as matrix (-> s3-0 1)) arg1) - (vector-rotate*! (-> s3-0 0) (-> obj info cm-offset-joint) (the-as matrix (-> s3-0 1))) - (vector+! (-> obj position) arg0 (-> s3-0 0)) + (vector-rotate*! (-> s3-0 0) (-> this info cm-offset-joint) (the-as matrix (-> s3-0 1))) + (vector+! (-> this position) arg0 (-> s3-0 0)) ) - (quaternion-copy! (-> obj rotation) arg1) - (quaternion-normalize! (-> obj rotation)) - (rigid-body-method-24 obj) + (quaternion-copy! (-> this rotation) arg1) + (quaternion-normalize! (-> this rotation)) + (rigid-body-method-24 this) 0 (none) ) @@ -132,29 +132,29 @@ ;; definition for method 25 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-25 rigid-body ((obj rigid-body) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 function)) - (set! (-> obj work) *rigid-body-work*) - (set! (-> obj info) arg0) - (set! (-> obj force-callback) (the-as (function object float none) arg3)) - (rigid-body-info-method-9 (-> obj info)) - (let ((v1-3 obj)) +(defmethod rigid-body-method-25 rigid-body ((this rigid-body) (arg0 rigid-body-info) (arg1 vector) (arg2 quaternion) (arg3 function)) + (set! (-> this work) *rigid-body-work*) + (set! (-> this info) arg0) + (set! (-> this force-callback) (the-as (function object float none) arg3)) + (rigid-body-info-method-9 (-> this info)) + (let ((v1-3 this)) (set! (-> v1-3 force quad) (the-as uint128 0)) (set! (-> v1-3 torque quad) (the-as uint128 0)) ) 0 - (clear-momentum! obj) - (rigid-body-method-26 obj arg1 arg2) - (rigid-body-method-13 obj) + (clear-momentum! this) + (rigid-body-method-26 this arg1 arg2) + (rigid-body-method-13 this) 0 (none) ) ;; definition for method 22 of type rigid-body -(defmethod rigid-body-method-22 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) - (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj position)))) - (vector-cross! arg1 (-> obj ang-velocity) v1-1) +(defmethod rigid-body-method-22 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position)))) + (vector-cross! arg1 (-> this ang-velocity) v1-1) ) - (vector+! arg1 arg1 (-> obj lin-velocity)) + (vector+! arg1 arg1 (-> this lin-velocity)) arg1 ) @@ -185,7 +185,7 @@ ;; definition for method 12 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-12 rigid-body ((obj rigid-body) (arg0 float)) +(defmethod rigid-body-method-12 rigid-body ((this rigid-body) (arg0 float)) (local-vars (v1-6 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -197,9 +197,9 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((a2-0 (-> obj lin-momentum))) - (let ((v1-0 (-> obj lin-momentum))) - (let ((a0-1 (-> obj force))) + (let ((a2-0 (-> this lin-momentum))) + (let ((v1-0 (-> this lin-momentum))) + (let ((a0-1 (-> this force))) (let ((a3-0 arg0)) (.mov vf7 a3-0) ) @@ -212,9 +212,9 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a2-0 quad) vf6) ) - (let ((a2-1 (-> obj ang-momentum))) - (let ((v1-1 (-> obj ang-momentum))) - (let ((a0-2 (-> obj torque))) + (let ((a2-1 (-> this ang-momentum))) + (let ((v1-1 (-> this ang-momentum))) + (let ((a0-2 (-> this torque))) (let ((a1-1 arg0)) (.mov vf7 a1-1) ) @@ -227,11 +227,11 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a2-1 quad) vf6) ) - (let* ((f0-3 (* 500000000.0 (-> obj info mass))) + (let* ((f0-3 (* 500000000.0 (-> this info mass))) (f1-1 f0-3) (f1-3 (* f1-1 f1-1)) ) - (.lvf vf1 (&-> (-> obj ang-momentum) quad)) + (.lvf vf1 (&-> (-> this ang-momentum) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -239,11 +239,11 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-6 vf1) (if (< f1-3 v1-6) - (vector-normalize! (-> obj ang-momentum) f0-3) + (vector-normalize! (-> this ang-momentum) f0-3) ) ) - (set! (-> obj force quad) (the-as uint128 0)) - (set! (-> obj torque quad) (the-as uint128 0)) + (set! (-> this force quad) (the-as uint128 0)) + (set! (-> this torque quad) (the-as uint128 0)) 0 0 (none) @@ -252,12 +252,12 @@ ;; definition for method 13 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-13 rigid-body ((obj rigid-body)) - (let ((v1-0 (-> obj info))) - (vector-float*! (-> obj lin-velocity) (-> obj lin-momentum) (-> v1-0 inv-mass)) - (matrix-3x3-triple-transpose-product (-> obj inv-i-world) (-> obj matrix) (-> v1-0 inv-inertial-tensor)) +(defmethod rigid-body-method-13 rigid-body ((this rigid-body)) + (let ((v1-0 (-> this info))) + (vector-float*! (-> this lin-velocity) (-> this lin-momentum) (-> v1-0 inv-mass)) + (matrix-3x3-triple-transpose-product (-> this inv-i-world) (-> this matrix) (-> v1-0 inv-inertial-tensor)) ) - (vector-rotate*! (-> obj ang-velocity) (-> obj ang-momentum) (-> obj inv-i-world)) + (vector-rotate*! (-> this ang-velocity) (-> this ang-momentum) (-> this inv-i-world)) 0 (none) ) @@ -265,7 +265,7 @@ ;; definition for method 14 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-14 rigid-body ((obj rigid-body) (arg0 float)) +(defmethod rigid-body-method-14 rigid-body ((this rigid-body) (arg0 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -274,9 +274,9 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((a1-1 (-> obj position))) - (let ((v1-0 (-> obj position))) - (let ((a0-1 (-> obj lin-velocity))) + (let ((a1-1 (-> this position))) + (let ((v1-0 (-> this position))) + (let ((a0-1 (-> this lin-velocity))) (let ((a2-0 arg0)) (.mov vf7 a2-0) ) @@ -290,17 +290,17 @@ (.svf (&-> a1-1 quad) vf6) ) (let ((s4-0 (new 'stack-no-clear 'quaternion))) - (set! (-> (the-as vector (&-> s4-0 x)) quad) (-> obj ang-velocity quad)) + (set! (-> (the-as vector (&-> s4-0 x)) quad) (-> this ang-velocity quad)) (set! (-> s4-0 w) 0.0) - (quaternion*! s4-0 s4-0 (-> obj rotation)) + (quaternion*! s4-0 s4-0 (-> this rotation)) (quaternion-float*! s4-0 s4-0 0.5) - (+! (-> obj rotation x) (* (-> s4-0 x) arg0)) - (+! (-> obj rotation y) (* (-> s4-0 y) arg0)) - (+! (-> obj rotation z) (* (-> s4-0 z) arg0)) - (+! (-> obj rotation w) (* (-> s4-0 w) arg0)) + (+! (-> this rotation x) (* (-> s4-0 x) arg0)) + (+! (-> this rotation y) (* (-> s4-0 y) arg0)) + (+! (-> this rotation z) (* (-> s4-0 z) arg0)) + (+! (-> this rotation w) (* (-> s4-0 w) arg0)) ) - (quaternion-normalize! (-> obj rotation)) - (rigid-body-method-24 obj) + (quaternion-normalize! (-> this rotation)) + (rigid-body-method-24 this) 0 (none) ) @@ -319,11 +319,11 @@ ;; definition for method 9 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-9 rigid-body ((obj rigid-body) (arg0 collide-shape-moving) (arg1 float)) - (rigid-body-method-12 obj arg1) - (let ((v1-2 (-> obj info))) - (let* ((a0-2 (-> obj lin-momentum)) - (a1-2 (-> obj lin-momentum)) +(defmethod rigid-body-method-9 rigid-body ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) + (rigid-body-method-12 this arg1) + (let ((v1-2 (-> this info))) + (let* ((a0-2 (-> this lin-momentum)) + (a1-2 (-> this lin-momentum)) (f3-0 (-> v1-2 linear-damping)) (f2-0 arg1) (f0-0 0.0) @@ -333,8 +333,8 @@ ) (vector-float*! a0-2 a1-2 (fmax f0-0 (+ f1-0 (* f2-1 (/ 1.0 f3-2))))) ) - (let* ((a0-4 (-> obj ang-momentum)) - (a1-3 (-> obj ang-momentum)) + (let* ((a0-4 (-> this ang-momentum)) + (a1-3 (-> this ang-momentum)) (f3-5 (-> v1-2 angular-damping)) (f2-3 arg1) (f0-3 0.0) @@ -345,10 +345,10 @@ (vector-float*! a0-4 a1-3 (fmax f0-3 (+ f1-2 (* f2-4 (/ 1.0 f3-7))))) ) ) - (rigid-body-method-13 obj) - (if (logtest? (-> obj flags) (rigid-body-flag enable-collision)) - (collide-shape-moving-method-63 arg0 obj arg1) - (rigid-body-method-14 obj arg1) + (rigid-body-method-13 this) + (if (logtest? (-> this flags) (rigid-body-flag enable-collision)) + (collide-shape-moving-method-63 arg0 this arg1) + (rigid-body-method-14 this arg1) ) 0 (none) @@ -356,7 +356,7 @@ ;; definition for method 67 of type collide-shape-moving ;; WARN: Return type mismatch int vs none. -(defmethod collide-with-all-collide-cache-prims collide-shape-moving ((obj collide-shape-moving) (arg0 matrix) (arg1 collide-query)) +(defmethod collide-with-all-collide-cache-prims collide-shape-moving ((this collide-shape-moving) (arg0 matrix) (arg1 collide-query)) (rlet ((acc :class vf) (vf0 :class vf) (vf1 :class vf) @@ -370,7 +370,7 @@ ) (init-vf0-vector) (let ((s4-0 *collide-cache*) - (s3-0 (-> obj root-prim)) + (s3-0 (-> this root-prim)) (s2-0 1) ) (b! (nonzero? (-> s3-0 prim-core prim-type)) cfg-2 :delay (empty-form)) @@ -460,7 +460,7 @@ ;; definition for method 63 of type collide-shape-moving ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod collide-shape-moving-method-63 collide-shape-moving ((obj collide-shape-moving) (arg0 rigid-body) (arg1 float)) +(defmethod collide-shape-moving-method-63 collide-shape-moving ((this collide-shape-moving) (arg0 rigid-body) (arg1 float)) (local-vars (s3-0 rigid-body)) (with-pp (rlet ((acc :class vf) @@ -476,7 +476,7 @@ (set! (-> s5-0 dt) arg1) (set! (-> s5-0 float-1) 1.0) (set! (-> s5-0 cnt) 0) - (until (not (and (< 0.05 (-> s5-0 float-1)) (< (-> s5-0 cnt) (the-as int (-> obj max-iteration-count))))) + (until (not (and (< 0.05 (-> s5-0 float-1)) (< (-> s5-0 cnt) (the-as int (-> this max-iteration-count))))) (set! (-> s5-0 cquery best-dist) -100000000.0) (set! (-> s5-0 cquery best-my-prim) #f) (set! (-> s5-0 cquery num-spheres) (the-as uint #f)) @@ -487,13 +487,13 @@ (set! (-> arg0 position quad) (-> s5-0 vec-1 quad)) (quaternion-copy! (-> arg0 rotation) (-> s5-0 quat-1)) (rigid-body-method-24 arg0) - (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) - (collide-with-all-collide-cache-prims obj (-> s5-0 mat-1) (-> s5-0 cquery)) + (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) + (collide-with-all-collide-cache-prims this (-> s5-0 mat-1) (-> s5-0 cquery)) (let ((f30-0 (-> s5-0 cquery best-dist))) (b! (>= f30-0 0.0) cfg-3 :delay #f) (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt))) (rigid-body-method-13 arg0) - (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) (set! (-> s5-0 float-1) 0.0) (b! #t cfg-44 :delay (nop!)) (label cfg-3) @@ -501,7 +501,7 @@ (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt) f30-0)) ) (rigid-body-method-13 arg0) - (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) (mem-copy! (the-as pointer (-> s5-0 mat-1)) (the-as pointer (-> arg0 matrix)) 64) (set! s3-0 (the-as rigid-body #f)) (b! (not (-> s5-0 cquery num-spheres)) cfg-12 :delay (empty-form)) @@ -612,7 +612,7 @@ ) ) (set! (-> s5-0 rbody) s3-0) - (send-event (-> obj process) 'impact-impulse :from v1-103 (-> s5-0 vec-2)) + (send-event (-> this process) 'impact-impulse :from v1-103 (-> s5-0 vec-2)) ) (b! (not s3-0) cfg-32 :delay (empty-form)) (rigid-body-method-12 s3-0 1.0) @@ -622,7 +622,7 @@ (vector-float*! (-> s5-0 vec-5) (-> s5-0 vec-5) -1.0) (vector-float*! (-> s5-0 vec-3) (-> s5-0 vec-3) -1.0) (set! (-> s5-0 rbody) arg0) - (send-event (-> s2-0 process) 'impact-impulse :from (-> obj process) (-> s5-0 vec-2)) + (send-event (-> s2-0 process) 'impact-impulse :from (-> this process) (-> s5-0 vec-2)) ) (label cfg-32) (+! (-> s5-0 cnt) 1) @@ -642,7 +642,7 @@ (when (< 0.0 (-> s5-0 float-1)) (rigid-body-method-14 arg0 (* (-> s5-0 float-1) (-> s5-0 dt))) (rigid-body-method-13 arg0) - (transform-rigid-body-prims (-> obj root-prim) (-> arg0 matrix)) + (transform-rigid-body-prims (-> this root-prim) (-> arg0 matrix)) (set! (-> s5-0 float-1) 0.0) ) (label cfg-44) @@ -665,7 +665,7 @@ ;; WARN: Stack slot offset 632 signed mismatch ;; WARN: Stack slot offset 632 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-15 rigid-body ((obj rigid-body) (arg0 collide-shape-moving) (arg1 float)) +(defmethod rigid-body-method-15 rigid-body ((this rigid-body) (arg0 collide-shape-moving) (arg1 float)) (local-vars (sv-576 vector) (sv-624 vector) @@ -684,13 +684,13 @@ (vf7 :class vf) ) (init-vf0-vector) - (-> obj work) - (let ((s4-0 (-> obj info)) + (-> this work) + (let ((s4-0 (-> this info)) (s3-0 (new 'stack-no-clear 'collide-query)) (f30-0 1.0) (s2-0 0) ) - (set! (-> s3-0 start-pos quad) (-> obj position quad)) + (set! (-> s3-0 start-pos quad) (-> this position quad)) (let ((v1-3 s3-0)) (set! (-> v1-3 radius) (-> arg0 root-prim prim-core world-sphere w)) (set! (-> v1-3 collide-with) (-> arg0 root-prim prim-core collide-with)) @@ -700,41 +700,41 @@ (set! (-> v1-3 action-mask) (collide-action solid)) ) (until (>= s2-0 4) - (vector-float*! (-> s3-0 move-dist) (-> obj lin-velocity) (* f30-0 arg1)) + (vector-float*! (-> s3-0 move-dist) (-> this lin-velocity) (* f30-0 arg1)) (let ((f28-0 (probe-using-line-sphere *collide-cache* s3-0))) (b! (>= f28-0 0.0) cfg-3) - (rigid-body-method-14 obj (* f30-0 arg1)) + (rigid-body-method-14 this (* f30-0 arg1)) (b! #t cfg-9 :delay (nop!)) (label cfg-3) - (rigid-body-method-14 obj (* f30-0 arg1 f28-0)) + (rigid-body-method-14 this (* f30-0 arg1 f28-0)) (set! sv-576 (new 'stack-no-clear 'vector)) (set! sv-624 (new 'stack-no-clear 'vector)) (set! sv-628 (new 'stack-no-clear 'vector)) - (vector-! sv-576 (-> obj position) (-> s3-0 best-other-tri intersect)) + (vector-! sv-576 (-> this position) (-> s3-0 best-other-tri intersect)) (vector-normalize! sv-576 1.0) - (set! sv-632 (vector-dot sv-576 (-> obj lin-momentum))) + (set! sv-632 (vector-dot sv-576 (-> this lin-momentum))) (when (< sv-632 0.0) (vector-float*! sv-624 sv-576 sv-632) - (vector-! sv-628 (-> obj lin-momentum) sv-624) + (vector-! sv-628 (-> this lin-momentum) sv-624) (vector-float*! sv-628 sv-628 (- 1.0 (-> s4-0 friction-factor))) (vector-float*! sv-624 sv-624 (- (-> s4-0 bounce-factor))) - (vector+! (-> obj lin-momentum) sv-628 sv-624) - (vector-float*! (-> obj lin-velocity) (-> obj lin-momentum) (-> s4-0 inv-mass)) + (vector+! (-> this lin-momentum) sv-628 sv-624) + (vector-float*! (-> this lin-velocity) (-> this lin-momentum) (-> s4-0 inv-mass)) ) (b! (>= f28-0 0.0001) cfg-7 :delay #f) - (vector+float*! (-> obj position) (-> obj position) sv-576 409.6) + (vector+float*! (-> this position) (-> this position) sv-576 409.6) (label cfg-7) (set! sv-704 (new 'stack-no-clear 'vector)) (set! sv-708 (new 'stack-no-clear 'vector)) (set! sv-712 (new 'stack-no-clear 'vector)) (set! sv-716 (new 'stack-no-clear 'vector)) - (vector-! sv-704 (-> s3-0 best-other-tri intersect) (-> obj position)) - (rigid-body-method-22 obj (-> s3-0 best-other-tri intersect) sv-708) + (vector-! sv-704 (-> s3-0 best-other-tri intersect) (-> this position)) + (rigid-body-method-22 this (-> s3-0 best-other-tri intersect) sv-708) (vector+float*! sv-708 sv-708 sv-576 (- (vector-dot sv-708 sv-576))) (vector-float*! sv-712 sv-708 (* -1.0 (-> s4-0 mass) (-> s4-0 friction-factor))) (vector-cross! sv-716 sv-704 sv-712) - (let ((a1-20 (-> obj ang-momentum))) - (let ((v1-46 (-> obj ang-momentum))) + (let ((a1-20 (-> this ang-momentum))) + (let ((v1-46 (-> this ang-momentum))) (let ((a0-27 sv-716)) (let ((a2-6 1.0)) (.mov vf7 a2-6) @@ -748,7 +748,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-20 quad) vf6) ) - (vector-rotate*! (-> obj ang-velocity) (-> obj ang-momentum) (-> obj inv-i-world)) + (vector-rotate*! (-> this ang-velocity) (-> this ang-momentum) (-> this inv-i-world)) (set! f30-0 (* f30-0 (- 1.0 f28-0))) ) (+! s2-0 1) @@ -763,14 +763,14 @@ ;; definition for method 18 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-18 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) - (vector+! (-> obj force) (-> obj force) arg1) +(defmethod rigid-body-method-18 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) + (vector+! (-> this force) (-> this force) arg1) (let ((a3-1 (new 'stack-no-clear 'vector)) (v1-1 (new 'stack-no-clear 'vector)) ) - (vector-! a3-1 arg0 (-> obj position)) + (vector-! a3-1 arg0 (-> this position)) (vector-cross! v1-1 a3-1 arg1) - (vector+! (-> obj torque) (-> obj torque) v1-1) + (vector+! (-> this torque) (-> this torque) v1-1) ) 0 (none) @@ -778,9 +778,9 @@ ;; definition for method 21 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-21 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) - (vector+! (-> obj force) (-> obj force) arg1) - (let* ((t0-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj position))) +(defmethod rigid-body-method-21 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector) (arg2 float)) + (vector+! (-> this force) (-> this force) arg1) + (let* ((t0-2 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this position))) (v1-3 (vector-cross! (new 'stack-no-clear 'vector) t0-2 arg1)) ) (let ((f0-0 (vector-length t0-2))) @@ -788,7 +788,7 @@ (vector-float*! v1-3 v1-3 (/ arg2 f0-0)) ) ) - (vector+! (-> obj torque) (-> obj torque) v1-3) + (vector+! (-> this torque) (-> this torque) v1-3) ) 0 (none) @@ -796,15 +796,15 @@ ;; definition for method 19 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-19 rigid-body ((obj rigid-body) (arg0 vector) (arg1 vector)) +(defmethod rigid-body-method-19 rigid-body ((this rigid-body) (arg0 vector) (arg1 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (-> obj work) - (vector-rotate*! s4-0 arg1 (-> obj matrix)) - (vector-rotate*! s5-0 arg0 (-> obj matrix)) - (vector+! s5-0 s5-0 (-> obj position)) - (rigid-body-method-18 obj s5-0 s4-0) + (-> this work) + (vector-rotate*! s4-0 arg1 (-> this matrix)) + (vector-rotate*! s5-0 arg0 (-> this matrix)) + (vector+! s5-0 s5-0 (-> this position)) + (rigid-body-method-18 this s5-0 s4-0) ) 0 (none) @@ -812,59 +812,71 @@ ;; definition for method 20 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-20 rigid-body ((obj rigid-body) (arg0 vector)) - (vector+! (-> obj force) (-> obj force) arg0) +(defmethod rigid-body-method-20 rigid-body ((this rigid-body) (arg0 vector)) + (vector+! (-> this force) (-> this force) arg0) 0 (none) ) ;; definition for method 23 of type rigid-body -(defmethod rigid-body-method-23 rigid-body ((obj rigid-body) (arg0 vector)) +(defmethod rigid-body-method-23 rigid-body ((this rigid-body) (arg0 vector)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-rotate*! gp-0 (-> obj info cm-offset-joint) (-> obj matrix)) - (vector-! arg0 (-> obj position) gp-0) + (vector-rotate*! gp-0 (-> this info cm-offset-joint) (-> this matrix)) + (vector-! arg0 (-> this position) gp-0) ) arg0 ) ;; definition for method 28 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod print-force-torque rigid-body ((obj rigid-body) (arg0 object)) - (format arg0 " force ~M ~M ~M" (-> obj force x) (-> obj force y) (-> obj force z)) - (format arg0 " torque ~M ~M ~M~%" (-> obj torque x) (-> obj torque y) (-> obj torque z)) +(defmethod print-force-torque rigid-body ((this rigid-body) (arg0 object)) + (format arg0 " force ~M ~M ~M" (-> this force x) (-> this force y) (-> this force z)) + (format arg0 " torque ~M ~M ~M~%" (-> this torque x) (-> this torque y) (-> this torque z)) 0 (none) ) ;; definition for method 30 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod print-momentum rigid-body ((obj rigid-body) (arg0 object)) - (format arg0 " lin-mom ~M ~M ~M" (-> obj lin-momentum x) (-> obj lin-momentum y) (-> obj lin-momentum z)) - (format arg0 " ang-mom ~M ~M ~M~%" (-> obj ang-momentum x) (-> obj ang-momentum y) (-> obj ang-momentum z)) +(defmethod print-momentum rigid-body ((this rigid-body) (arg0 object)) + (format arg0 " lin-mom ~M ~M ~M" (-> this lin-momentum x) (-> this lin-momentum y) (-> this lin-momentum z)) + (format + arg0 + " ang-mom ~M ~M ~M~%" + (-> this ang-momentum x) + (-> this ang-momentum y) + (-> this ang-momentum z) + ) 0 (none) ) ;; definition for method 31 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod print-velocity rigid-body ((obj rigid-body) (arg0 object)) - (format arg0 " lin-vel ~M ~M ~M" (-> obj lin-velocity x) (-> obj lin-velocity y) (-> obj lin-velocity z)) - (format arg0 " ang-vel ~f ~f ~f~%" (-> obj ang-velocity x) (-> obj ang-velocity y) (-> obj ang-velocity z)) +(defmethod print-velocity rigid-body ((this rigid-body) (arg0 object)) + (format arg0 " lin-vel ~M ~M ~M" (-> this lin-velocity x) (-> this lin-velocity y) (-> this lin-velocity z)) + (format + arg0 + " ang-vel ~f ~f ~f~%" + (-> this ang-velocity x) + (-> this ang-velocity y) + (-> this ang-velocity z) + ) 0 (none) ) ;; definition for method 29 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod print-position-rotation rigid-body ((obj rigid-body) (arg0 object)) - (format arg0 " position ~M ~M ~M" (-> obj position x) (-> obj position y) (-> obj position z)) +(defmethod print-position-rotation rigid-body ((this rigid-body) (arg0 object)) + (format arg0 " position ~M ~M ~M" (-> this position x) (-> this position y) (-> this position z)) (format arg0 " rotation ~f ~f ~f ~f~%" - (-> obj rotation x) - (-> obj rotation y) - (-> obj rotation z) - (-> obj rotation w) + (-> this rotation x) + (-> this rotation y) + (-> this rotation z) + (-> this rotation w) ) 0 (none) @@ -872,27 +884,26 @@ ;; definition for method 27 of type rigid-body ;; WARN: Return type mismatch int vs none. -(defmethod print-physics rigid-body ((obj rigid-body) (arg0 object)) - (print-force-torque obj arg0) - (print-position-rotation obj arg0) - (print-momentum obj arg0) - (print-velocity obj arg0) +(defmethod print-physics rigid-body ((this rigid-body) (arg0 object)) + (print-force-torque this arg0) + (print-position-rotation this arg0) + (print-momentum this arg0) + (print-velocity this arg0) 0 (none) ) ;; definition for method 10 of type rigid-body-control -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch int vs object. -(defmethod rigid-body-control-method-10 rigid-body-control ((obj rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) +(defmethod rigid-body-control-method-10 rigid-body-control ((this rigid-body-control) (arg0 rigid-body-object) (arg1 float) (arg2 float)) (let* ((s4-1 (max 1 (min 4 (+ (the int (* 0.9999 (/ arg1 arg2))) 1)))) (f30-0 (/ arg1 (the float s4-1))) - (s3-0 (-> obj state force-callback)) + (s3-0 (-> this state force-callback)) ) (while (nonzero? s4-1) (+! s4-1 -1) (s3-0 arg0 f30-0) - (let ((v1-2 obj) + (let ((v1-2 this) (a1-2 (-> arg0 root)) (f0-4 f30-0) ) @@ -906,45 +917,45 @@ ;; definition for method 11 of type rigid-body ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-method-11 rigid-body ((obj rigid-body) (arg0 collide-shape-moving)) - (quaternion-copy! (-> arg0 quat) (-> obj rotation)) - (rigid-body-method-23 obj (-> arg0 trans)) - (set! (-> arg0 transv quad) (-> obj lin-velocity quad)) +(defmethod rigid-body-method-11 rigid-body ((this rigid-body) (arg0 collide-shape-moving)) + (quaternion-copy! (-> arg0 quat) (-> this rotation)) + (rigid-body-method-23 this (-> arg0 trans)) + (set! (-> arg0 transv quad) (-> this lin-velocity quad)) 0 (none) ) ;; definition for method 26 of type rigid-body-object -(defmethod get-inv-mass rigid-body-object ((obj rigid-body-object)) - (-> obj info info inv-mass) +(defmethod get-inv-mass rigid-body-object ((this rigid-body-object)) + (-> this info info inv-mass) ) ;; definition for method 35 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-35 rigid-body-object ((obj rigid-body-object)) - (let ((a0-1 (-> obj info name))) +(defmethod rigid-body-object-method-35 rigid-body-object ((this rigid-body-object)) + (let ((a0-1 (-> this info name))) (when (nonzero? a0-1) - (set! (-> obj info) (the-as rigid-body-object-constants (-> a0-1 value))) - (set! (-> obj rbody state info) (-> obj info info)) + (set! (-> this info) (the-as rigid-body-object-constants (-> a0-1 value))) + (set! (-> this rbody state info) (-> this info info)) ) ) - (rigid-body-info-method-9 (-> obj info info)) - (set! (-> obj rbody state force-callback) (method-of-object obj rigid-body-object-method-29)) + (rigid-body-info-method-9 (-> this info info)) + (set! (-> this rbody state force-callback) (method-of-object this rigid-body-object-method-29)) 0 (none) ) ;; definition for method 50 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-50 rigid-body-object ((obj rigid-body-object) (arg0 float)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force)) - (logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force)) - (vector-float*! (-> obj player-force) (-> obj player-force) (/ 1.0 arg0)) +(defmethod rigid-body-object-method-50 rigid-body-object ((this rigid-body-object) (arg0 float)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force)) + (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force)) + (vector-float*! (-> this player-force) (-> this player-force) (/ 1.0 arg0)) ) - (let ((v1-10 (-> obj rbody)) - (a1-1 (-> obj player-force-position)) - (a2-2 (-> obj player-force)) + (let ((v1-10 (-> this rbody)) + (a1-1 (-> this player-force-position)) + (a2-2 (-> this player-force)) ) (rigid-body-method-18 (-> v1-10 state) a1-1 a2-2) ) @@ -955,11 +966,11 @@ ;; definition for method 29 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 rigid-body-object ((obj rigid-body-object) (arg0 float)) +(defmethod rigid-body-object-method-29 rigid-body-object ((this rigid-body-object) (arg0 float)) (let ((a1-1 (new 'stack-no-clear 'vector))) (vector-reset! a1-1) - (set! (-> a1-1 y) (* -1.0 (-> obj info extra gravity) (-> obj rbody state info mass))) - (rigid-body-method-20 (-> obj rbody state) a1-1) + (set! (-> a1-1 y) (* -1.0 (-> this info extra gravity) (-> this rbody state info mass))) + (rigid-body-method-20 (-> this rbody state) a1-1) ) 0 (none) @@ -967,54 +978,59 @@ ;; definition for method 30 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-30 rigid-body-object ((obj rigid-body-object)) - (rigid-body-control-method-10 (-> obj rbody) obj (seconds-per-frame) (-> obj max-time-step)) - (logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force)) +(defmethod rigid-body-object-method-30 rigid-body-object ((this rigid-body-object)) + (rigid-body-control-method-10 (-> this rbody) this (seconds-per-frame) (-> this max-time-step)) + (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) 0 (none) ) ;; definition for method 51 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-51 rigid-body-object ((obj rigid-body-object)) - (rigid-body-control-method-10 (-> obj rbody) obj (-> obj rbody state time-remaining) (-> obj max-time-step)) +(defmethod rigid-body-object-method-51 rigid-body-object ((this rigid-body-object)) + (rigid-body-control-method-10 + (-> this rbody) + this + (-> this rbody state time-remaining) + (-> this max-time-step) + ) 0 (none) ) ;; definition for method 52 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-52 rigid-body-object ((obj rigid-body-object)) - (logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force)) +(defmethod rigid-body-object-method-52 rigid-body-object ((this rigid-body-object)) + (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force)) 0 (none) ) ;; definition for method 34 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-34 rigid-body-object ((obj rigid-body-object)) - (go (method-of-object obj idle)) +(defmethod rigid-body-object-method-34 rigid-body-object ((this rigid-body-object)) + (go (method-of-object this idle)) 0 (none) ) ;; definition for method 31 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod alloc-and-init-rigid-body-control rigid-body-object ((obj rigid-body-object) (arg0 rigid-body-object-constants)) - (set! (-> obj info) arg0) - (set! (-> obj rbody) (new 'process 'rigid-body-control obj)) - (update-transforms (-> obj root)) +(defmethod alloc-and-init-rigid-body-control rigid-body-object ((this rigid-body-object) (arg0 rigid-body-object-constants)) + (set! (-> this info) arg0) + (set! (-> this rbody) (new 'process 'rigid-body-control this)) + (update-transforms (-> this root)) (rigid-body-method-25 - (-> obj rbody state) - (-> obj info info) - (-> obj root trans) - (-> obj root quat) - (method-of-object obj rigid-body-object-method-29) + (-> this rbody state) + (-> this info info) + (-> this root trans) + (-> this root quat) + (method-of-object this rigid-body-object-method-29) ) - (rigid-body-object-method-35 obj) - (set! (-> obj max-time-step) (-> arg0 extra max-time-step)) - (set! (-> obj root max-iteration-count) (the-as uint 4)) - (let ((v1-15 (-> obj skel root-channel 0))) + (rigid-body-object-method-35 this) + (set! (-> this max-time-step) (-> arg0 extra max-time-step)) + (set! (-> this root max-iteration-count) (the-as uint 4)) + (let ((v1-15 (-> this skel root-channel 0))) (set! (-> v1-15 num-func) num-func-identity) (set! (-> v1-15 frame-num) 0.0) ) @@ -1024,8 +1040,8 @@ ;; definition for method 32 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape rigid-body-object ((obj rigid-body-object)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod allocate-and-init-cshape rigid-body-object ((this rigid-body-object)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1046,7 +1062,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1076,43 +1092,43 @@ ;; definition for method 33 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body rigid-body-object ((obj rigid-body-object)) - (alloc-and-init-rigid-body-control obj *rigid-body-object-constants*) +(defmethod init-skel-and-rigid-body rigid-body-object ((this rigid-body-object)) + (alloc-and-init-rigid-body-control this *rigid-body-object-constants*) 0 (none) ) ;; definition for method 11 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod init-from-entity! rigid-body-object ((obj rigid-body-object) (arg0 entity-actor)) +(defmethod init-from-entity! rigid-body-object ((this rigid-body-object) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (allocate-and-init-cshape obj) - (process-drawable-from-entity! obj arg0) - (init-skel-and-rigid-body obj) - (rigid-body-object-method-34 obj) + (allocate-and-init-cshape this) + (process-drawable-from-entity! this arg0) + (init-skel-and-rigid-body this) + (rigid-body-object-method-34 this) 0 (none) ) ;; definition for method 36 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod do-engine-sounds rigid-body-object ((obj rigid-body-object)) +(defmethod do-engine-sounds rigid-body-object ((this rigid-body-object)) 0 (none) ) ;; definition for method 37 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-37 rigid-body-object ((obj rigid-body-object)) - (rigid-body-object-method-30 obj) - (do-engine-sounds obj) - (let ((v1-4 (-> obj rbody)) - (a1-0 (-> obj root)) +(defmethod rigid-body-object-method-37 rigid-body-object ((this rigid-body-object)) + (rigid-body-object-method-30 this) + (do-engine-sounds this) + (let ((v1-4 (-> this rbody)) + (a1-0 (-> this root)) ) (rigid-body-method-11 (-> v1-4 state) a1-0) ) @@ -1123,11 +1139,11 @@ This commonly includes things such as: ;; definition for method 40 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-40 rigid-body-object ((obj rigid-body-object)) - (logior! (-> obj flags) (rigid-body-object-flag enable-collision)) - (let ((v1-3 (-> obj root root-prim))) - (set! (-> v1-3 prim-core collide-as) (-> obj root backup-collide-as)) - (set! (-> v1-3 prim-core collide-with) (-> obj root backup-collide-with)) +(defmethod rigid-body-object-method-40 rigid-body-object ((this rigid-body-object)) + (logior! (-> this flags) (rigid-body-object-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> this root backup-collide-with)) ) 0 (none) @@ -1135,9 +1151,9 @@ This commonly includes things such as: ;; definition for method 41 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-41 rigid-body-object ((obj rigid-body-object)) - (logclear! (-> obj flags) (rigid-body-object-flag enable-collision)) - (let ((v1-3 (-> obj root root-prim))) +(defmethod rigid-body-object-method-41 rigid-body-object ((this rigid-body-object)) + (logclear! (-> this flags) (rigid-body-object-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) @@ -1148,12 +1164,12 @@ This commonly includes things such as: ;; definition for method 38 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-38 rigid-body-object ((obj rigid-body-object)) - (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (rigid-body-method-26 (-> obj rbody state) (-> obj root trans) (-> obj root quat)) - (vector-float*! (-> obj rbody state lin-momentum) (-> obj root transv) (-> obj info info mass)) - (vector-reset! (-> obj rbody state ang-momentum)) +(defmethod rigid-body-object-method-38 rigid-body-object ((this rigid-body-object)) + (when (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) + (logior! (-> this rbody state flags) (rigid-body-flag enable-physics)) + (rigid-body-method-26 (-> this rbody state) (-> this root trans) (-> this root quat)) + (vector-float*! (-> this rbody state lin-momentum) (-> this root transv) (-> this info info mass)) + (vector-reset! (-> this rbody state ang-momentum)) ) 0 (none) @@ -1161,19 +1177,19 @@ This commonly includes things such as: ;; definition for method 39 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-39 rigid-body-object ((obj rigid-body-object)) - (logclear! (-> obj rbody state flags) (rigid-body-flag enable-physics)) +(defmethod rigid-body-object-method-39 rigid-body-object ((this rigid-body-object)) + (logclear! (-> this rbody state flags) (rigid-body-flag enable-physics)) 0 (none) ) ;; definition for method 42 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-42 rigid-body-object ((obj rigid-body-object)) - (logior! (-> obj flags) (rigid-body-object-flag disturbed)) - (set! (-> obj disturbed-time) (current-time)) - (if (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) - (rigid-body-object-method-38 obj) +(defmethod rigid-body-object-method-42 rigid-body-object ((this rigid-body-object)) + (logior! (-> this flags) (rigid-body-object-flag disturbed)) + (set-time! (-> this disturbed-time)) + (if (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) + (rigid-body-object-method-38 this) ) 0 (none) @@ -1181,22 +1197,22 @@ This commonly includes things such as: ;; definition for method 43 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-43 rigid-body-object ((obj rigid-body-object)) - (go (method-of-object obj active)) +(defmethod rigid-body-object-method-43 rigid-body-object ((this rigid-body-object)) + (go (method-of-object this active)) 0 (none) ) ;; definition for method 44 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod apply-damage rigid-body-object ((obj rigid-body-object) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage rigid-body-object ((this rigid-body-object) (arg0 float) (arg1 rigid-body-impact)) 0 (none) ) ;; definition for method 45 of type rigid-body-object ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-45 rigid-body-object ((obj rigid-body-object) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 rigid-body-object ((this rigid-body-object) (arg0 rigid-body-impact)) 0 (none) ) @@ -1204,17 +1220,17 @@ This commonly includes things such as: ;; definition for method 49 of type rigid-body-object ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-49 rigid-body-object ((obj rigid-body-object) (arg0 rigid-body-impact) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-49 rigid-body-object ((this rigid-body-object) (arg0 rigid-body-impact) (arg1 touching-shapes-entry)) (set! (-> arg0 rbody) #f) (set! (-> arg0 prim-id) (the-as uint 0)) (vector-reset! (-> arg0 normal)) (vector-reset! (-> arg0 velocity)) - (set! (-> arg0 point quad) (-> obj root trans quad)) + (set! (-> arg0 point quad) (-> this root trans quad)) (when arg1 (let ((s3-0 (-> arg1 head))) (when s3-0 - (get-intersect-point (-> arg0 point) s3-0 (-> obj root) arg1) - (let ((s5-1 (get-touched-prim s3-0 (-> obj root) arg1))) + (get-intersect-point (-> arg0 point) s3-0 (-> this root) arg1) + (let ((s5-1 (get-touched-prim s3-0 (-> this root) arg1))) (when s5-1 (set! (-> arg0 prim-id) (-> s5-1 prim-id)) (vector-! (-> arg0 normal) (-> arg0 point) (the-as vector (-> s5-1 prim-core))) @@ -1236,7 +1252,7 @@ This commonly includes things such as: ;; definition for method 47 of type rigid-body-object ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-47 rigid-body-object ((obj rigid-body-object) +(defmethod rigid-body-object-method-47 rigid-body-object ((this rigid-body-object) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) @@ -1245,7 +1261,7 @@ This commonly includes things such as: (local-vars (f0-2 float)) (when arg2 (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact))) - (rigid-body-object-method-49 obj s5-0 arg2) + (rigid-body-object-method-49 this s5-0 arg2) (if (logtest? (attack-mask attacker-velocity) (-> arg1 mask)) (set! (-> s5-0 velocity quad) (-> arg1 attacker-velocity quad)) (vector-! (-> s5-0 velocity) (-> s5-0 point) (-> arg0 root trans)) @@ -1284,35 +1300,35 @@ This commonly includes things such as: ) ) ) - (set! (-> s5-0 impulse) (* f0-2 (-> obj info extra attack-force-scale))) - (apply-damage obj (* 0.667 f1-0) s5-0) + (set! (-> s5-0 impulse) (* f0-2 (-> this info extra attack-force-scale))) + (apply-damage this (* 0.667 f1-0) s5-0) ) - (rigid-body-object-method-42 obj) + (rigid-body-object-method-42 this) (let ((s4-1 (new 'stack-no-clear 'vector))) (set! (-> s4-1 quad) (-> s5-0 velocity quad)) (vector-normalize! s4-1 1.0) (vector-float*! s4-1 s4-1 (-> s5-0 impulse)) - (let ((v1-46 (-> obj rbody)) + (let ((v1-46 (-> this rbody)) (a1-6 (-> s5-0 point)) (a2-3 s4-1) ) (rigid-body-method-18 (-> v1-46 state) a1-6 a2-3) ) - (let ((v1-49 (-> obj rbody)) + (let ((v1-49 (-> this rbody)) (f0-7 1.0) ) (rigid-body-method-12 (-> v1-49 state) f0-7) ) - (rigid-body-method-13 (-> obj rbody state)) + (rigid-body-method-13 (-> this rbody state)) (when #t (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 point) *color-blue*) (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> s5-0 point) s4-1 (meters 0.00024414062) *color-blue*) ) ) - (rigid-body-object-method-45 obj s5-0) + (rigid-body-object-method-45 this s5-0) ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (rigid-body-object-method-43 obj) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (rigid-body-object-method-43 this) ) #t ) @@ -1320,7 +1336,7 @@ This commonly includes things such as: ;; definition for method 48 of type rigid-body-object ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-48 rigid-body-object ((obj rigid-body-object) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-48 rigid-body-object ((this rigid-body-object) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (v1-2 symbol)) (b! (not (logtest? (process-mask target crate enemy) (-> arg0 mask))) cfg-5 :likely-delay (set! v1-2 #t)) (b! (not (logtest? (-> arg0 mask) (process-mask target))) cfg-5 :likely-delay (set! v1-2 #f)) @@ -1331,10 +1347,10 @@ This commonly includes things such as: (s4-0 (new 'stack-no-clear 'vector)) (f30-0 (get-inv-mass arg0)) ) - (rigid-body-object-method-49 obj s5-0 arg1) + (rigid-body-object-method-49 this s5-0 arg1) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (let ((v1-14 (-> obj rbody)) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (let ((v1-14 (-> this rbody)) (a1-3 (-> s5-0 point)) (a2-2 (-> s5-0 velocity)) ) @@ -1342,7 +1358,7 @@ This commonly includes things such as: ) ) (else - (set! (-> s5-0 velocity quad) (-> obj root transv quad)) + (set! (-> s5-0 velocity quad) (-> this root transv quad)) ) ) (let ((v1-18 (-> arg0 root))) @@ -1351,24 +1367,24 @@ This commonly includes things such as: ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) (when (< f0-1 0.0) - (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info info inv-mass)))) + (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> this info info inv-mass)))) (vector+float*! s4-0 s4-0 (-> s5-0 normal) (* -3.1 f30-0 (-> s5-0 impulse))) (set! (-> s4-0 y) (fmax (* 49152.0 f30-0) (-> s4-0 y))) - (rigid-body-object-method-42 obj) + (rigid-body-object-method-42 this) (let ((a2-4 (new 'stack-no-clear 'vector))) (vector-float*! a2-4 (-> s5-0 normal) (-> s5-0 impulse)) - (let ((v1-31 (-> obj rbody)) + (let ((v1-31 (-> this rbody)) (a1-8 (-> s5-0 point)) ) (rigid-body-method-18 (-> v1-31 state) a1-8 a2-4) ) ) - (let ((v1-34 (-> obj rbody)) + (let ((v1-34 (-> this rbody)) (f0-10 1.0) ) (rigid-body-method-12 (-> v1-34 state) f0-10) ) - (rigid-body-method-13 (-> obj rbody state)) + (rigid-body-method-13 (-> this rbody state)) (when #f (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 point) *color-blue*) (add-debug-vector @@ -1380,9 +1396,9 @@ This commonly includes things such as: *color-blue* ) ) - (rigid-body-object-method-45 obj s5-0) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (rigid-body-object-method-43 obj) + (rigid-body-object-method-45 this s5-0) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (rigid-body-object-method-43 this) ) ) ) @@ -1393,21 +1409,21 @@ This commonly includes things such as: ;; definition for method 46 of type rigid-body-object ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-46 rigid-body-object ((obj rigid-body-object) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 rigid-body-object ((this rigid-body-object) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-impulse) (let ((s5-1 (-> arg3 param 0))) - (if (!= obj arg0) - (rigid-body-object-method-42 obj) + (if (!= this arg0) + (rigid-body-object-method-42 this) ) - (rigid-body-object-method-45 obj (the-as rigid-body-impact s5-1)) + (rigid-body-object-method-45 this (the-as rigid-body-impact s5-1)) ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (rigid-body-object-method-43 obj) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (rigid-body-object-method-43 this) ) ) (('touched) - (if (= obj *debug-actor*) + (if (= this *debug-actor*) (format *stdcon* "rigid-body-object got touched~%") ) (when (zero? (-> arg0 rbody)) @@ -1418,12 +1434,12 @@ This commonly includes things such as: ) (when s3-0 (when (logtest? (-> s3-0 mask) (process-mask target)) - (logior! (-> obj flags) (rigid-body-object-flag player-touching)) - (set! (-> obj player-touch-time) (current-time)) - (rigid-body-object-method-42 obj) + (logior! (-> this flags) (rigid-body-object-flag player-touching)) + (set-time! (-> this player-touch-time)) + (rigid-body-object-method-42 this) ) (if (not (logtest? (-> s3-0 mask) (process-mask target))) - (rigid-body-object-method-48 obj s3-0 (the-as touching-shapes-entry (-> arg3 param 0))) + (rigid-body-object-method-48 this s3-0 (the-as touching-shapes-entry (-> arg3 param 0))) ) ) ) @@ -1433,15 +1449,15 @@ This commonly includes things such as: (let ((s3-1 (the-as attack-info (-> arg3 param 1))) (t0-1 (get-penetrate-using-from-attack-event arg0 arg3)) ) - (when (!= (-> s3-1 id) (-> obj incoming-attack-id)) - (set! (-> obj incoming-attack-id) (-> s3-1 id)) - (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) t0-1) + (when (!= (-> s3-1 id) (-> this incoming-attack-id)) + (set! (-> this incoming-attack-id) (-> s3-1 id)) + (rigid-body-object-method-47 this arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) t0-1) ) ) ) (('edge-grabbed 'pilot-edge-grab) (let ((s5-2 (the-as object (-> arg3 param 0)))) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) + (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) (let ((a0-25 (if (type? arg0 process-focusable) (the-as process-focusable arg0) ) @@ -1449,16 +1465,16 @@ This commonly includes things such as: ) (when a0-25 (let ((f0-1 (/ 163840.0 (get-inv-mass a0-25)))) - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-edge-grabbing player-contact-force)) - (set! (-> obj player-force-position quad) (-> (the-as attack-info s5-2) attacker-velocity quad)) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (* -1.0 f0-1)) + (logior! (-> this flags) (rigid-body-object-flag player-touching player-edge-grabbing player-contact-force)) + (set! (-> this player-force-position quad) (-> (the-as attack-info s5-2) attacker-velocity quad)) + (vector-reset! (-> this player-force)) + (set! (-> this player-force y) (* -1.0 f0-1)) ) ) ) ) ) - (not (logtest? (-> obj focus-status) (focus-status dead inactive))) + (not (logtest? (-> this focus-status) (focus-status dead inactive))) ) (('ridden) (let ((v1-45 (the-as object (-> arg3 param 0)))) @@ -1473,14 +1489,14 @@ This commonly includes things such as: (logtest? (-> a0-34 mask) (process-mask target)) (not (logtest? (-> a0-34 focus-status) (focus-status on-water under-water))) ) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-impulse-force))) - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) - (set! (-> obj player-force-position quad) (-> a0-34 root trans quad)) - (vector-reset! (-> obj player-force)) + (when (not (logtest? (-> this flags) (rigid-body-object-flag player-impulse-force))) + (logior! (-> this flags) (rigid-body-object-flag player-touching player-standing-on player-contact-force)) + (set! (-> this player-force-position quad) (-> a0-34 root trans quad)) + (vector-reset! (-> this player-force)) (let ((f0-4 (/ 163840.0 (get-inv-mass a0-34))) (f1-1 1.0) ) - (set! (-> obj player-force y) (* -1.0 f0-4 f1-1)) + (set! (-> this player-force y) (* -1.0 f0-4 f1-1)) ) ) ) @@ -1496,20 +1512,20 @@ This commonly includes things such as: ) ) (when a0-38 - (logior! (-> obj flags) (rigid-body-object-flag player-touching player-impulse-force)) - (set! (-> obj player-force-position quad) (-> a0-38 root trans quad)) + (logior! (-> this flags) (rigid-body-object-flag player-touching player-impulse-force)) + (set! (-> this player-force-position quad) (-> a0-38 root trans quad)) (let ((f30-2 (* 0.00012207031 (the-as float (-> arg3 param 1)))) (f0-9 (/ 163840.0 (get-inv-mass a0-38))) ) - (vector-reset! (-> obj player-force)) - (set! (-> obj player-force y) (* -0.1 f0-9 f30-2)) + (vector-reset! (-> this player-force)) + (set! (-> this player-force y) (* -0.1 f0-9 f30-2)) ) ) ) ) ) (('enable-physics) - (rigid-body-object-method-42 obj) + (rigid-body-object-method-42 this) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc index 336eaf038d..03c9da3bbe 100644 --- a/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc @@ -25,18 +25,18 @@ ) ;; definition for method 3 of type trajectory -(defmethod inspect trajectory ((obj trajectory)) - (when (not obj) - (set! obj obj) +(defmethod inspect trajectory ((this trajectory)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'trajectory) - (format #t "~1Tinitial-position: ~`vector`P~%" (-> obj initial-position)) - (format #t "~1Tinitial-velocity: ~`vector`P~%" (-> obj initial-velocity)) - (format #t "~1Ttime: ~f~%" (-> obj time)) - (format #t "~1Tgravity: (meters ~m)~%" (-> obj gravity)) + (format #t "[~8x] ~A~%" this 'trajectory) + (format #t "~1Tinitial-position: ~`vector`P~%" (-> this initial-position)) + (format #t "~1Tinitial-velocity: ~`vector`P~%" (-> this initial-velocity)) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tgravity: (meters ~m)~%" (-> this gravity)) (label cfg-4) - obj + this ) ;; definition of type impact-control @@ -61,24 +61,24 @@ ) ;; definition for method 3 of type impact-control -(defmethod inspect impact-control ((obj impact-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect impact-control ((this impact-control)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj 'impact-control) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Tradius: (meters ~m)~%" (-> obj radius)) - (format #t "~1Tjoint: ~D~%" (-> obj joint)) - (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Ttrans[2] @ #x~X~%" (-> obj trans)) + (format #t "[~8x] ~A~%" this 'impact-control) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tradius: (meters ~m)~%" (-> this radius)) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Ttrans[2] @ #x~X~%" (-> this trans)) (dotimes (s5-0 2) - (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> obj trans s5-0)) + (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> this trans s5-0)) ) - (format #t "~1Tdir: ~`vector`P~%" (-> obj dir)) + (format #t "~1Tdir: ~`vector`P~%" (-> this dir)) (label cfg-7) - obj + this ) ;; definition for method 0 of type impact-control @@ -113,18 +113,18 @@ ) ;; definition for method 3 of type point-tracker -(defmethod inspect point-tracker ((obj point-tracker)) - (when (not obj) - (set! obj obj) +(defmethod inspect point-tracker ((this point-tracker)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj 'point-tracker) - (format #t "~1Ttrans[2] @ #x~X~%" (-> obj trans)) + (format #t "[~8x] ~A~%" this 'point-tracker) + (format #t "~1Ttrans[2] @ #x~X~%" (-> this trans)) (dotimes (s5-0 2) - (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> obj trans s5-0)) + (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> this trans s5-0)) ) (label cfg-7) - obj + this ) ;; definition for method 0 of type point-tracker @@ -152,20 +152,20 @@ ) ;; definition for method 3 of type combo-tracker -(defmethod inspect combo-tracker ((obj combo-tracker)) - (when (not obj) - (set! obj obj) +(defmethod inspect combo-tracker ((this combo-tracker)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj 'combo-tracker) - (format #t "~1Ttrans[2] @ #x~X~%" (-> obj trans)) + (format #t "[~8x] ~A~%" this 'combo-tracker) + (format #t "~1Ttrans[2] @ #x~X~%" (-> this trans)) (dotimes (s5-0 2) - (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> obj trans s5-0)) + (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> this trans s5-0)) ) - (format #t "~1Ttarget: ~D~%" (-> obj target)) - (format #t "~1Tmove-start-time: ~D~%" (-> obj move-start-time)) + (format #t "~1Ttarget: ~D~%" (-> this target)) + (format #t "~1Tmove-start-time: ~D~%" (-> this move-start-time)) (label cfg-7) - obj + this ) ;; definition of type traj2d-params @@ -183,20 +183,20 @@ ) ;; definition for method 3 of type traj2d-params -(defmethod inspect traj2d-params ((obj traj2d-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect traj2d-params ((this traj2d-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traj2d-params) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tgravity: ~f~%" (-> obj gravity)) - (format #t "~1Tinitial-tilt: ~f~%" (-> obj initial-tilt)) - (format #t "~1Tinitial-speed: ~f~%" (-> obj initial-speed)) - (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "[~8x] ~A~%" this 'traj2d-params) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tgravity: ~f~%" (-> this gravity)) + (format #t "~1Tinitial-tilt: ~f~%" (-> this initial-tilt)) + (format #t "~1Tinitial-speed: ~f~%" (-> this initial-speed)) + (format #t "~1Ttime: ~f~%" (-> this time)) (label cfg-4) - obj + this ) ;; definition of type traj3d-params @@ -216,22 +216,22 @@ ) ;; definition for method 3 of type traj3d-params -(defmethod inspect traj3d-params ((obj traj3d-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect traj3d-params ((this traj3d-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traj3d-params) - (format #t "~1Tgravity: ~f~%" (-> obj gravity)) - (format #t "~1Tinitial-tilt: ~f~%" (-> obj initial-tilt)) - (format #t "~1Tinitial-speed: ~f~%" (-> obj initial-speed)) - (format #t "~1Ttime: ~f~%" (-> obj time)) - (format #t "~1Tsrc: #~%" (-> obj src)) - (format #t "~1Tdest: #~%" (-> obj dest)) - (format #t "~1Tdiff: #~%" (-> obj diff)) - (format #t "~1Tinitial-velocity: #~%" (-> obj initial-velocity)) + (format #t "[~8x] ~A~%" this 'traj3d-params) + (format #t "~1Tgravity: ~f~%" (-> this gravity)) + (format #t "~1Tinitial-tilt: ~f~%" (-> this initial-tilt)) + (format #t "~1Tinitial-speed: ~f~%" (-> this initial-speed)) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tsrc: #~%" (-> this src)) + (format #t "~1Tdest: #~%" (-> this dest)) + (format #t "~1Tdiff: #~%" (-> this diff)) + (format #t "~1Tinitial-velocity: #~%" (-> this initial-velocity)) (label cfg-4) - obj + this ) ;; definition of type cubic-curve @@ -251,15 +251,15 @@ ) ;; definition for method 3 of type cubic-curve -(defmethod inspect cubic-curve ((obj cubic-curve)) - (when (not obj) - (set! obj obj) +(defmethod inspect cubic-curve ((this cubic-curve)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'cubic-curve) - (format #t "~1Tmat: #~%" (-> obj mat)) + (format #t "[~8x] ~A~%" this 'cubic-curve) + (format #t "~1Tmat: #~%" (-> this mat)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc index 46a402f7ee..8b1e0a943a 100644 --- a/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak2/engine/physics/trajectory_REF.gc @@ -2,46 +2,46 @@ (in-package goal) ;; definition for method 9 of type trajectory -(defmethod compute-trans-at-time trajectory ((obj trajectory) (arg0 float) (arg1 vector)) - (vector+float*! arg1 (-> obj initial-position) (-> obj initial-velocity) arg0) - (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> obj gravity))) +(defmethod compute-trans-at-time trajectory ((this trajectory) (arg0 float) (arg1 vector)) + (vector+float*! arg1 (-> this initial-position) (-> this initial-velocity) arg0) + (+! (-> arg1 y) (* 0.5 arg0 arg0 (-> this gravity))) arg1 ) ;; definition for method 10 of type trajectory ;; INFO: Used lq/sq -(defmethod compute-transv-at-time trajectory ((obj trajectory) (arg0 float) (arg1 vector)) - (set! (-> arg1 quad) (-> obj initial-velocity quad)) - (+! (-> arg1 y) (* arg0 (-> obj gravity))) +(defmethod compute-transv-at-time trajectory ((this trajectory) (arg0 float) (arg1 vector)) + (set! (-> arg1 quad) (-> this initial-velocity quad)) + (+! (-> arg1 y) (* arg0 (-> this gravity))) arg1 ) ;; definition for method 11 of type trajectory -(defmethod compute-time-until-apex trajectory ((obj trajectory)) - (/ (- (-> obj initial-velocity y)) (-> obj gravity)) +(defmethod compute-time-until-apex trajectory ((this trajectory)) + (/ (- (-> this initial-velocity y)) (-> this gravity)) ) ;; definition for method 12 of type trajectory ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod setup-from-to-duration! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) - (set! (-> obj initial-position quad) (-> arg0 quad)) - (set! (-> obj gravity) arg3) - (set! (-> obj time) arg2) +(defmethod setup-from-to-duration! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + (set! (-> this initial-position quad) (-> arg0 quad)) + (set! (-> this gravity) arg3) + (set! (-> this time) arg2) (let ((f0-3 (/ (vector-vector-xz-distance arg1 arg0) arg2))) - (vector-! (-> obj initial-velocity) arg1 arg0) - (vector-xz-normalize! (-> obj initial-velocity) f0-3) + (vector-! (-> this initial-velocity) arg1 arg0) + (vector-xz-normalize! (-> this initial-velocity) f0-3) ) - (set! (-> obj initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* 0.5 arg2 (-> obj gravity)))) + (set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* 0.5 arg2 (-> this gravity)))) 0 (none) ) ;; definition for method 13 of type trajectory ;; WARN: Return type mismatch int vs none. -(defmethod setup-from-to-xz-vel! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-xz-vel! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let ((f0-1 (/ (vector-vector-xz-distance arg1 arg0) arg2))) - (setup-from-to-duration! obj arg0 arg1 f0-1 arg3) + (setup-from-to-duration! this arg0 arg1 f0-1 arg3) ) 0 (none) @@ -49,7 +49,7 @@ ;; definition for method 14 of type trajectory ;; WARN: Return type mismatch int vs none. -(defmethod setup-from-to-y-vel! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-y-vel! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let* ((f0-0 arg2) (f1-3 (- (* f0-0 f0-0) (* 2.0 (- (-> arg0 y) (-> arg1 y)) arg3))) (f0-3 900.0) @@ -59,7 +59,7 @@ (set! f0-3 (fmax (/ (- (- arg2) f0-4) arg3) (/ (+ (- arg2) f0-4) arg3))) ) ) - (setup-from-to-duration! obj arg0 arg1 f0-3 arg3) + (setup-from-to-duration! this arg0 arg1 f0-3 arg3) ) 0 (none) @@ -67,7 +67,7 @@ ;; definition for method 15 of type trajectory ;; WARN: Return type mismatch int vs none. -(defmethod setup-from-to-height! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let* ((f0-1 (+ arg2 (fmax (-> arg0 y) (-> arg1 y)))) (f1-4 (* 2.0 (- (-> arg0 y) f0-1) arg3)) (f0-4 4096.0) @@ -75,7 +75,7 @@ (if (< 0.0 f1-4) (set! f0-4 (sqrtf f1-4)) ) - (setup-from-to-y-vel! obj arg0 arg1 f0-4 arg3) + (setup-from-to-y-vel! this arg0 arg1 f0-4 arg3) ) 0 (none) @@ -84,7 +84,7 @@ ;; definition for method 16 of type trajectory ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 16 trajectory) has a return type of none, but the expression builder found a return statement. -(defmethod setup-from-to-duration-and-height! trajectory ((obj trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod setup-from-to-duration-and-height! trajectory ((this trajectory) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let ((f0-1 (- (-> arg1 y) (-> arg0 y)))) (cond ((= f0-1 0.0) @@ -93,7 +93,7 @@ (f0-3 (* -8.0 arg3)) (f1-3 arg2) ) - (t9-0 obj arg0 arg1 v1-2 (/ f0-3 (* f1-3 f1-3))) + (t9-0 this arg0 arg1 v1-2 (/ f0-3 (* f1-3 f1-3))) ) (return 0) ) @@ -109,7 +109,7 @@ (f1-18 (/ (- 1.0 f1-14) (- arg2 (* arg2 (sqrtf f1-14))))) (f0-8 (* f0-6 (* f1-18 f1-18) arg3)) ) - (setup-from-to-duration! obj arg0 arg1 arg2 f0-8) + (setup-from-to-duration! this arg0 arg1 arg2 f0-8) ) ) 0 @@ -119,16 +119,16 @@ ;; definition for method 17 of type trajectory ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw trajectory ((obj trajectory)) +(defmethod debug-draw trajectory ((this trajectory)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 10) ) - (set! (-> s4-0 quad) (-> obj initial-position quad)) + (set! (-> s4-0 quad) (-> this initial-position quad)) (dotimes (s2-0 s3-0) (set! (-> s5-0 quad) (-> s4-0 quad)) - (let ((f0-1 (* (-> obj time) (/ (+ 1.0 (the float s2-0)) (the float s3-0))))) - (compute-trans-at-time obj f0-1 s4-0) + (let ((f0-1 (* (-> this time) (/ (+ 1.0 (the float s2-0)) (the float s3-0))))) + (compute-trans-at-time this f0-1 s4-0) ) (add-debug-line #t @@ -147,25 +147,25 @@ ;; definition for method 9 of type impact-control ;; INFO: Used lq/sq -(defmethod initialize impact-control ((obj impact-control) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) - (set! (-> obj start-time) (current-time)) - (set! (-> obj process) (the-as (pointer process-drawable) (process->ppointer arg0))) - (set! (-> obj joint) arg1) - (set! (-> obj radius) arg2) - (set! (-> obj collide-with) (logclear arg3 (collide-spec water))) - (set! (-> obj trans 0 quad) (the-as uint128 0)) - (set! (-> obj trans 1 quad) (the-as uint128 0)) - obj +(defmethod initialize impact-control ((this impact-control) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) + (set-time! (-> this start-time)) + (set! (-> this process) (the-as (pointer process-drawable) (process->ppointer arg0))) + (set! (-> this joint) arg1) + (set! (-> this radius) arg2) + (set! (-> this collide-with) (logclear arg3 (collide-spec water))) + (set! (-> this trans 0 quad) (the-as uint128 0)) + (set! (-> this trans 1 quad) (the-as uint128 0)) + this ) ;; definition for method 10 of type impact-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-from-cspace impact-control ((obj impact-control)) - (when (>= (-> obj joint) 0) - (set! (-> obj trans 1 quad) (-> obj trans 0 quad)) - (vector<-cspace! (the-as vector (-> obj trans)) (-> obj process 0 node-list data (-> obj joint))) - (vector-! (-> obj dir) (the-as vector (-> obj trans)) (-> obj trans 1)) +(defmethod update-from-cspace impact-control ((this impact-control)) + (when (>= (-> this joint) 0) + (set! (-> this trans 1 quad) (-> this trans 0 quad)) + (vector<-cspace! (the-as vector (-> this trans)) (-> this process 0 node-list data (-> this joint))) + (vector-! (-> this dir) (the-as vector (-> this trans)) (-> this trans 1)) ) 0 (none) @@ -173,21 +173,21 @@ ;; definition for method 11 of type impact-control ;; INFO: Used lq/sq -(defmethod impact-control-method-11 impact-control ((obj impact-control) (arg0 collide-query) (arg1 process) (arg2 pat-surface)) - (set! (-> arg0 start-pos quad) (-> obj trans 1 quad)) - (set! (-> arg0 move-dist quad) (-> obj dir quad)) - (let ((v1-2 (ppointer->process (-> obj process))) +(defmethod impact-control-method-11 impact-control ((this impact-control) (arg0 collide-query) (arg1 process) (arg2 pat-surface)) + (set! (-> arg0 start-pos quad) (-> this trans 1 quad)) + (set! (-> arg0 move-dist quad) (-> this dir quad)) + (let ((v1-2 (ppointer->process (-> this process))) (a0-6 arg0) ) - (set! (-> a0-6 radius) (-> obj radius)) - (set! (-> a0-6 collide-with) (-> obj collide-with)) + (set! (-> a0-6 radius) (-> this radius)) + (set! (-> a0-6 collide-with) (-> this collide-with)) (set! (-> a0-6 ignore-process0) v1-2) (set! (-> a0-6 ignore-process1) #f) (set! (-> a0-6 ignore-pat) arg2) (set! (-> a0-6 action-mask) (collide-action solid)) ) (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* arg0))) - (when (and arg1 (>= f30-0 0.0) (>= 0.0 (vector-dot (-> arg0 best-other-tri normal) (-> obj dir)))) + (when (and arg1 (>= f30-0 0.0) (>= 0.0 (vector-dot (-> arg0 best-other-tri normal) (-> this dir)))) (let* ((s3-0 (new 'stack-no-clear 'touching-shapes-entry)) (s2-0 (-> arg0 best-other-tri collide-ptr)) (v1-12 (if (type? s2-0 collide-shape-prim) @@ -211,7 +211,7 @@ ) #f s3-0 - obj + this arg0 ) ) @@ -222,15 +222,15 @@ ;; definition for method 9 of type point-tracker ;; INFO: Used lq/sq -(defmethod initialize point-tracker ((obj point-tracker) (arg0 vector) (arg1 vector)) - (set! (-> obj trans 0 quad) (-> arg0 quad)) - (set! (-> obj trans 1 quad) (-> arg1 quad)) - obj +(defmethod initialize point-tracker ((this point-tracker) (arg0 vector) (arg1 vector)) + (set! (-> this trans 0 quad) (-> arg0 quad)) + (set! (-> this trans 1 quad) (-> arg1 quad)) + this ) ;; definition for method 10 of type point-tracker ;; INFO: Used lq/sq -(defmethod point-tracker-method-10 point-tracker ((obj point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-10 point-tracker ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (cond ((>= 0.0 arg3) (set! (-> arg0 quad) (-> arg1 quad)) @@ -248,9 +248,9 @@ ) ;; definition for method 11 of type point-tracker -(defmethod point-tracker-method-11 point-tracker ((obj point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-11 point-tracker ((this point-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (with-pp - (let ((v1-1 (point-tracker-method-10 obj (new 'stack-no-clear 'vector) arg1 arg2 arg3))) + (let ((v1-1 (point-tracker-method-10 this (new 'stack-no-clear 'vector) arg1 arg2 arg3))) (vector-! arg0 v1-1 arg1) ) (vector-float*! arg0 arg0 (-> pp clock frames-per-second)) @@ -259,7 +259,7 @@ ) ;; definition for method 13 of type combo-tracker -(defmethod combo-tracker-method-13 combo-tracker ((obj combo-tracker) (arg0 handle) (arg1 vector) (arg2 float) (arg3 vector) (arg4 float)) +(defmethod combo-tracker-method-13 combo-tracker ((this combo-tracker) (arg0 handle) (arg1 vector) (arg2 float) (arg3 vector) (arg4 float)) (cond ((send-event (handle->process arg0) 'combo) (let ((gp-1 (handle->process arg0))) @@ -311,16 +311,16 @@ ) ;; definition for method 12 of type combo-tracker -(defmethod combo-tracker-method-12 combo-tracker ((obj combo-tracker) (arg0 vector) (arg1 vector) (arg2 process) (arg3 time-frame)) - (initialize obj arg0 arg1) - (set! (-> obj target) (process->handle arg2)) - (set! (-> obj move-start-time) arg3) - obj +(defmethod combo-tracker-method-12 combo-tracker ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 process) (arg3 time-frame)) + (initialize this arg0 arg1) + (set! (-> this target) (process->handle arg2)) + (set! (-> this move-start-time) arg3) + this ) ;; definition for method 11 of type combo-tracker ;; INFO: Used lq/sq -(defmethod point-tracker-method-11 combo-tracker ((obj combo-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod point-tracker-method-11 combo-tracker ((this combo-tracker) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -328,14 +328,14 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((v1-1 (point-tracker-method-10 obj (new 'stack-no-clear 'vector) arg1 arg2 arg3))) + (let ((v1-1 (point-tracker-method-10 this (new 'stack-no-clear 'vector) arg1 arg2 arg3))) (vector-! arg0 v1-1 arg1) ) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) (process->ppointer pp)) (set! (-> a1-4 num-params) 0) (set! (-> a1-4 message) 'nav-control) - (let* ((s3-0 (send-event-function (handle->process (-> obj target)) a1-4)) + (let* ((s3-0 (send-event-function (handle->process (-> this target)) a1-4)) (s4-1 (if (type? s3-0 nav-control) s3-0 ) @@ -431,7 +431,7 @@ ;; definition for method 9 of type cubic-curve ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod cubic-curve-method-9 cubic-curve ((obj cubic-curve) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod cubic-curve-method-9 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -440,8 +440,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (set! (-> obj mat quad 0) (-> arg0 quad)) - (set! (-> obj mat vector 1 quad) (-> arg1 quad)) + (set! (-> this mat quad 0) (-> arg0 quad)) + (set! (-> this mat vector 1 quad) (-> arg1 quad)) (let ((v1-2 (new 'stack-no-clear 'trajectory))) (vector-! (-> v1-2 initial-velocity) arg2 arg0) (vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) 3.0) @@ -461,14 +461,14 @@ (.svf (&-> t1-7 quad) vf6) ) (vector-! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3) - (set! (-> obj mat vector 2 quad) (-> v1-2 initial-position quad)) + (set! (-> this mat vector 2 quad) (-> v1-2 initial-position quad)) (vector-float*! (-> v1-2 initial-position) (-> v1-2 initial-velocity) -2.0) (vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg1) (vector+! (-> v1-2 initial-position) (-> v1-2 initial-position) arg3) - (set! (-> obj mat trans quad) (-> v1-2 initial-position quad)) + (set! (-> this mat trans quad) (-> v1-2 initial-position quad)) ) (dotimes (v1-5 4) - (set! (-> obj mat vector v1-5 w) 0.0) + (set! (-> this mat vector v1-5 w) 0.0) ) 0 (none) @@ -476,32 +476,32 @@ ) ;; definition for method 10 of type cubic-curve -(defmethod cubic-curve-method-10 cubic-curve ((obj cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-10 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (let ((f0-1 (* arg1 arg1))) (set-vector! (-> v1-0 initial-position) 1.0 arg1 f0-1 (* f0-1 arg1)) ) - (vector-matrix*! arg0 (-> v1-0 initial-position) (-> obj mat)) + (vector-matrix*! arg0 (-> v1-0 initial-position) (-> this mat)) ) (set! (-> arg0 w) 1.0) arg0 ) ;; definition for method 11 of type cubic-curve -(defmethod cubic-curve-method-11 cubic-curve ((obj cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-11 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (set-vector! (-> v1-0 initial-position) 0.0 1.0 (* 2.0 arg1) (* 3.0 arg1 arg1)) - (vector-matrix*! arg0 (-> v1-0 initial-position) (-> obj mat)) + (vector-matrix*! arg0 (-> v1-0 initial-position) (-> this mat)) ) (set! (-> arg0 w) 1.0) arg0 ) ;; definition for method 12 of type cubic-curve -(defmethod cubic-curve-method-12 cubic-curve ((obj cubic-curve) (arg0 vector) (arg1 float)) +(defmethod cubic-curve-method-12 cubic-curve ((this cubic-curve) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'trajectory))) (set-vector! (-> v1-0 initial-position) 0.0 0.0 2.0 (* 6.0 arg1)) - (vector-matrix*! arg0 (-> v1-0 initial-position) (-> obj mat)) + (vector-matrix*! arg0 (-> v1-0 initial-position) (-> this mat)) ) (set! (-> arg0 w) 1.0) arg0 @@ -510,16 +510,16 @@ ;; definition for method 13 of type cubic-curve ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-curve cubic-curve ((obj cubic-curve)) +(defmethod debug-draw-curve cubic-curve ((this cubic-curve)) (let ((s5-0 (new 'stack-no-clear 'trajectory)) (s4-0 10) ) - (cubic-curve-method-10 obj (-> s5-0 initial-velocity) 0.0) + (cubic-curve-method-10 this (-> s5-0 initial-velocity) 0.0) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 initial-velocity) *color-red*) (dotimes (s3-0 s4-0) (set! (-> s5-0 initial-position quad) (-> s5-0 initial-velocity quad)) (let ((f0-2 (/ (+ 1.0 (the float s3-0)) (the float s4-0)))) - (cubic-curve-method-10 obj (-> s5-0 initial-velocity) f0-2) + (cubic-curve-method-10 this (-> s5-0 initial-velocity) f0-2) ) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 initial-velocity) *color-red*) (add-debug-line diff --git a/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc index e78f5cf220..f042fa0691 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/focus_REF.gc @@ -18,29 +18,29 @@ ) ;; definition for method 3 of type focus -(defmethod inspect focus ((obj focus)) - (when (not obj) - (set! obj obj) +(defmethod inspect focus ((this focus)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'focus) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) + (format #t "[~8x] ~A~%" this 'focus) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tcollide-with: ~D~%" (-> this collide-with)) (label cfg-4) - obj + this ) ;; definition for method 11 of type focus ;; WARN: Return type mismatch int vs none. -(defmethod reset-to-collide-spec focus ((obj focus) (arg0 collide-spec)) - (set! (-> obj collide-with) arg0) - (set! (-> obj handle) (the-as handle #f)) +(defmethod reset-to-collide-spec focus ((this focus) (arg0 collide-spec)) + (set! (-> this collide-with) arg0) + (set! (-> this handle) (the-as handle #f)) 0 (none) ) ;; definition for method 10 of type focus -(defmethod collide-check? focus ((obj focus) (arg0 process-focusable)) +(defmethod collide-check? focus ((this focus) (arg0 process-focusable)) (when (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead)))) (let* ((s5-0 (-> arg0 root)) (v1-2 (if (type? s5-0 collide-shape) @@ -48,23 +48,23 @@ ) ) ) - (and v1-2 (logtest? (-> obj collide-with) (-> v1-2 root-prim prim-core collide-as))) + (and v1-2 (logtest? (-> this collide-with) (-> v1-2 root-prim prim-core collide-as))) ) ) ) ;; definition for method 12 of type focus -(defmethod try-update-focus focus ((obj focus) (arg0 process-focusable)) - (when (!= (handle->process (-> obj handle)) arg0) - (set! (-> obj handle) (process->handle arg0)) +(defmethod try-update-focus focus ((this focus) (arg0 process-focusable)) + (when (!= (handle->process (-> this handle)) arg0) + (set! (-> this handle) (process->handle arg0)) #t ) ) ;; definition for method 9 of type focus ;; WARN: Return type mismatch int vs none. -(defmethod clear-focused focus ((obj focus)) - (set! (-> obj handle) (the-as handle #f)) +(defmethod clear-focused focus ((this focus)) + (set! (-> this handle) (the-as handle #f)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc index cfd09edb19..292742fd4d 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc @@ -2,13 +2,13 @@ (in-package goal) ;; definition for method 15 of type skeleton-group -(defmethod add-to-loading-level skeleton-group ((obj skeleton-group)) +(defmethod add-to-loading-level skeleton-group ((this skeleton-group)) (let ((v1-1 (-> *level* loading-level))) (if v1-1 - (set-loaded-art (-> v1-1 art-group) obj) + (set-loaded-art (-> v1-1 art-group) this) ) ) - obj + this ) ;; definition for function cspace-by-name @@ -195,14 +195,14 @@ ;; definition for method 10 of type draw-control ;; WARN: Return type mismatch int vs none. -(defmethod lod-set! draw-control ((obj draw-control) (arg0 int)) - (let ((v1-1 (max 0 (min arg0 (-> obj lod-set max-lod))))) - (set! (-> obj desired-lod) v1-1) - (when (!= (-> obj cur-lod) v1-1) - (set! (-> obj mgeo) (-> obj lod-set lod v1-1 geo)) - (set! (-> obj cur-lod) v1-1) - (if (nonzero? (-> obj seg-mask)) - (setup-masks obj 0 0) +(defmethod lod-set! draw-control ((this draw-control) (arg0 int)) + (let ((v1-1 (max 0 (min arg0 (-> this lod-set max-lod))))) + (set! (-> this desired-lod) v1-1) + (when (!= (-> this cur-lod) v1-1) + (set! (-> this mgeo) (-> this lod-set lod v1-1 geo)) + (set! (-> this cur-lod) v1-1) + (if (nonzero? (-> this seg-mask)) + (setup-masks this 0 0) ) ) ) @@ -212,11 +212,11 @@ ;; definition for method 11 of type draw-control ;; WARN: Return type mismatch int vs none. -(defmethod lods-assign! draw-control ((obj draw-control) (arg0 lod-set)) - (mem-copy! (the-as pointer (-> obj lod-set)) (the-as pointer arg0) 49) - (let ((a1-2 (min (-> obj cur-lod) (-> obj lod-set max-lod)))) - (set! (-> obj cur-lod) -1) - (lod-set! obj a1-2) +(defmethod lods-assign! draw-control ((this draw-control) (arg0 lod-set)) + (mem-copy! (the-as pointer (-> this lod-set)) (the-as pointer arg0) 49) + (let ((a1-2 (min (-> this cur-lod) (-> this lod-set max-lod)))) + (set! (-> this cur-lod) -1) + (lod-set! this a1-2) ) 0 (none) @@ -224,26 +224,26 @@ ;; definition for method 12 of type draw-control ;; WARN: Return type mismatch int vs none. -(defmethod setup-masks draw-control ((obj draw-control) (arg0 int) (arg1 int)) +(defmethod setup-masks draw-control ((this draw-control) (arg0 int) (arg1 int)) "TODO - use the enum types" (local-vars (v1-4 int) (a2-1 (array uint64))) - (let ((a1-2 (logior (logclear (-> obj seg-mask) arg0) arg1))) - (set! (-> obj seg-mask) a1-2) + (let ((a1-2 (logior (logclear (-> this seg-mask) arg0) arg1))) + (set! (-> this seg-mask) a1-2) (cond ((zero? a1-2) - (set! (-> obj effect-mask) (the-as uint 0)) + (set! (-> this effect-mask) (the-as uint 0)) 0 ) - ((begin (set! a2-1 (-> obj mgeo seg-table)) (set! v1-4 0) (nonzero? a2-1)) + ((begin (set! a2-1 (-> this mgeo seg-table)) (set! v1-4 0) (nonzero? a2-1)) (countdown (a3-0 (-> a2-1 length)) (if (logtest? a1-2 (ash 1 a3-0)) (set! v1-4 (logior v1-4 (-> a2-1 a3-0))) ) ) - (set! (-> obj effect-mask) (the-as uint v1-4)) + (set! (-> this effect-mask) (the-as uint v1-4)) ) (else - (set! (-> obj effect-mask) (the-as uint 0)) + (set! (-> this effect-mask) (the-as uint 0)) 0 ) ) @@ -254,28 +254,28 @@ ;; definition for method 9 of type lod-set ;; INFO: Used lq/sq -(defmethod setup-lods! lod-set ((obj lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) +(defmethod setup-lods! lod-set ((this lod-set) (arg0 skeleton-group) (arg1 art-group) (arg2 entity)) (local-vars (sv-16 res-tag)) (let ((v1-0 (-> arg1 length)) (s3-0 (-> arg0 max-lod)) ) - (set! (-> obj max-lod) s3-0) + (set! (-> this max-lod) s3-0) (dotimes (a0-1 (+ s3-0 1)) (when (or (< (-> arg0 mgeo a0-1) 0) (>= (-> arg0 mgeo a0-1) v1-0)) - (set! obj (the-as lod-set #f)) + (set! this (the-as lod-set #f)) (goto cfg-22) ) (let ((a1-14 (-> arg1 data (-> arg0 mgeo a0-1)))) (when (or (zero? a1-14) (!= (-> a1-14 type) merc-ctrl)) - (set! obj (the-as lod-set #f)) + (set! this (the-as lod-set #f)) (goto cfg-22) ) - (set! (-> obj lod a0-1 geo) (the-as merc-ctrl a1-14)) + (set! (-> this lod a0-1 geo) (the-as merc-ctrl a1-14)) ) - (set! (-> obj lod a0-1 dist) (-> arg0 lod-dist a0-1)) + (set! (-> this lod a0-1 dist) (-> arg0 lod-dist a0-1)) ) - (if (= (-> obj lod s3-0 dist) 4095996000.0) - (set! (-> obj lod s3-0 dist) (res-lump-float arg2 'vis-dist :default 4095996000.0)) + (if (= (-> this lod s3-0 dist) 4095996000.0) + (set! (-> this lod s3-0 dist) (res-lump-float arg2 'vis-dist :default 4095996000.0)) ) ) (let ((v1-14 (-> arg1 data (-> arg0 jgeo)))) @@ -283,20 +283,20 @@ (let ((v1-15 (res-lump-data (-> v1-14 extra) 'lod-dist pointer :tag-ptr (& sv-16)))) (when v1-15 (dotimes (a0-6 (the-as int (-> sv-16 elt-count))) - (set! (-> obj lod a0-6 dist) (-> (the-as (pointer float) (&+ v1-15 (* a0-6 4))))) + (set! (-> this lod a0-6 dist) (-> (the-as (pointer float) (&+ v1-15 (* a0-6 4))))) ) ) ) ) (label cfg-22) - obj + this ) ;; definition for method 13 of type draw-control -(defmethod setup-cspace-and-add draw-control ((obj draw-control) (arg0 art-joint-geo) (arg1 symbol)) +(defmethod setup-cspace-and-add draw-control ((this draw-control) (arg0 art-joint-geo) (arg1 symbol)) (let ((s5-0 ((method-of-type cspace-array new) arg1 cspace-array (+ (-> arg0 length) 1)))) (let ((v0-1 ((method-of-type skeleton new) arg1 skeleton (+ (-> arg0 length) 1)))) - (set! (-> obj skeleton) v0-1) + (set! (-> this skeleton) v0-1) (let ((s3-1 v0-1)) (when (or (zero? s5-0) (zero? s3-1)) (go process-drawable-art-error "memory") @@ -308,7 +308,7 @@ ) (let ((v1-10 (-> s5-0 data))) (set! (-> v1-10 0 param0) (the-as (function cspace transformq none) cspace<-transformq!)) - (set! (-> v1-10 0 param1) (the-as basic (-> (the-as process-drawable (-> obj process)) root trans))) + (set! (-> v1-10 0 param1) (the-as basic (-> (the-as process-drawable (-> this process)) root trans))) ) (let ((v1-12 (reset-and-assign-geo! (-> s5-0 data 1) (the-as drawable #f)))) (set! (-> v1-12 joint) (-> arg0 data 0)) @@ -320,7 +320,7 @@ (set! (-> v1-14 bone) (-> s3-1 bones 2)) (set! (-> v1-14 parent) (the-as cspace (-> s5-0 data))) (set! (-> v1-14 param0) (the-as (function cspace transformq none) cspace<-parented-matrix-joint!)) - (set! (-> v1-14 param1) (-> obj process)) + (set! (-> v1-14 param1) (-> this process)) ) (let ((s2-0 3)) (while (< s2-0 (-> s5-0 length)) @@ -341,7 +341,7 @@ ) ) ) - (add-connection *foreground-draw-engine* (-> obj process) add-process-drawable (-> obj process) obj #f) + (add-connection *foreground-draw-engine* (-> this process) add-process-drawable (-> this process) this #f) (label cfg-13) s5-0 ) @@ -368,27 +368,27 @@ ;; definition for method 14 of type draw-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-joint-math draw-control ((obj draw-control) (arg0 cspace-array) (arg1 joint-control)) +(defmethod do-joint-math draw-control ((this draw-control) (arg0 cspace-array) (arg1 joint-control)) (with-pp (cond - ((logtest? (-> obj status) (draw-control-status no-draw no-draw-temp)) + ((logtest? (-> this status) (draw-control-status no-draw no-draw-temp)) ) ((zero? arg1) (matrix<-transformq+trans! - (the-as matrix (-> obj skeleton bones 3)) - (the-as transformq (-> (the-as process-drawable (-> obj process)) root trans)) - (-> obj skeleton bones 0 transform trans) + (the-as matrix (-> this skeleton bones 3)) + (the-as transformq (-> (the-as process-drawable (-> this process)) root trans)) + (-> this skeleton bones 0 transform trans) ) - (vector+! (-> obj origin) (-> obj skeleton bones 3 transform trans) (-> obj bounds)) - (set! (-> obj origin w) (-> obj bounds w)) + (vector+! (-> this origin) (-> this skeleton bones 3 transform trans) (-> this bounds)) + (set! (-> this origin w) (-> this bounds w)) ) (else - (let* ((s2-0 (-> obj mgeo num-joints)) + (let* ((s2-0 (-> this mgeo num-joints)) (s1-0 (+ s2-0 2)) ) (+ s1-0 1) (let ((s5-0 pp)) - (set! pp (-> obj process)) + (set! pp (-> this process)) ((-> arg1 generate-frame-function) (the-as joint-anim-frame (+ 2400 #x70000000)) s1-0 arg1) (if (-> arg1 prebind-function) ((-> arg1 prebind-function) (the-as joint-anim-frame (+ 2400 #x70000000)) s1-0 arg1) @@ -425,15 +425,15 @@ ) ) (if (-> arg1 postbind-function) - ((-> arg1 postbind-function) obj arg0 arg1) + ((-> arg1 postbind-function) this arg0 arg1) ) (let ((a1-11 (new 'stack-no-clear 'vector))) - (set! (-> a1-11 quad) (-> obj bounds quad)) + (set! (-> a1-11 quad) (-> this bounds quad)) (set! (-> a1-11 w) 1.0) - (vector-matrix*! (-> obj origin) a1-11 (the-as matrix (-> obj skeleton bones (-> obj origin-joint-index)))) + (vector-matrix*! (-> this origin) a1-11 (the-as matrix (-> this skeleton bones (-> this origin-joint-index)))) ) - (let ((f0-2 (-> obj bounds w))) - (set! (-> obj origin w) f0-2) + (let ((f0-2 (-> this bounds w))) + (set! (-> this origin w) f0-2) f0-2 ) (set! pp s5-0) @@ -448,26 +448,26 @@ ;; definition for method 17 of type process-drawable ;; WARN: Return type mismatch int vs none. -(defmethod cleanup-for-death process-drawable ((obj process-drawable)) - (when (type? (-> obj root) collide-shape) - (let ((v1-2 (-> (the-as collide-shape (-> obj root)) root-prim))) +(defmethod cleanup-for-death process-drawable ((this process-drawable)) + (when (type? (-> this root) collide-shape) + (let ((v1-2 (-> (the-as collide-shape (-> this root)) root-prim))) (set! (-> v1-2 prim-core collide-as) (collide-spec)) (set! (-> v1-2 prim-core collide-with) (collide-spec)) ) 0 ) - (if (nonzero? (-> obj skel)) + (if (nonzero? (-> this skel)) (ja-channel-set! 0) ) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) 0 (none) ) ;; definition for method 18 of type process-drawable ;; WARN: Return type mismatch int vs none. -(defmethod relocate-nav process-drawable ((obj process-drawable) (arg0 int)) - (set! (-> obj nav) (the-as nav-control (&+ (the-as pointer (-> obj nav)) arg0))) +(defmethod relocate-nav process-drawable ((this process-drawable) (arg0 int)) + (set! (-> this nav) (the-as nav-control (&+ (the-as pointer (-> this nav)) arg0))) 0 (none) ) @@ -525,19 +525,19 @@ ) ;; definition for method 10 of type process-drawable -(defmethod deactivate process-drawable ((obj process-drawable)) - (if (nonzero? (-> obj part)) - (kill-and-free-particles (-> obj part)) +(defmethod deactivate process-drawable ((this process-drawable)) + (if (nonzero? (-> this part)) + (kill-and-free-particles (-> this part)) ) - (if (nonzero? (-> obj sound)) - (stop! (-> obj sound)) + (if (nonzero? (-> this sound)) + (stop! (-> this sound)) ) - (let ((a0-3 (-> obj nav))) + (let ((a0-3 (-> this nav))) (if (and a0-3 (nonzero? a0-3)) (remove! a0-3) ) ) - (let* ((s5-0 (-> obj root)) + (let* ((s5-0 (-> this root)) (a0-5 (if (type? s5-0 collide-shape) s5-0 ) @@ -554,7 +554,7 @@ ) ) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -733,13 +733,13 @@ ;; definition for method 14 of type process-drawable ;; INFO: Used lq/sq -(defmethod initialize-skeleton process-drawable ((obj process-drawable) (arg0 skeleton-group) (arg1 pair)) +(defmethod initialize-skeleton process-drawable ((this process-drawable) (arg0 skeleton-group) (arg1 pair)) (local-vars (v1-14 art-element)) (if (not arg0) (go process-drawable-art-error "skel-group") ) - (set! (-> obj draw) (skeleton-group->draw-control obj arg0 (&-> obj node-list))) - (let* ((s3-0 (-> obj draw)) + (set! (-> this draw) (skeleton-group->draw-control this arg0 (&-> this node-list))) + (let* ((s3-0 (-> this draw)) (a2-3 (res-lump-value (-> s3-0 jgeo extra) 'joint-channel uint128 :default (the-as uint128 6) :time -1000000000.0) ) @@ -748,7 +748,7 @@ ((> (the-as int a2-3) 0) (logior! (-> s3-0 status) (draw-control-status math-skel)) (let ((v0-3 (new 'process 'joint-control (the-as int a2-3)))) - (set! (-> obj skel) v0-3) + (set! (-> this skel) v0-3) (let ((s4-0 v0-3)) (let ((s3-1 (-> s3-0 art-group))) (cond @@ -761,7 +761,7 @@ (return (the-as draw-control #f)) ) (ja-channel-set! 1) - (let ((s2-0 (-> obj skel root-channel 0))) + (let ((s2-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s2-0 (the-as art-joint-anim (-> s3-1 data (-> arg0 janim))) @@ -775,7 +775,7 @@ ) ) ) - (set! (-> s4-0 effect) (new 'process 'effect-control obj)) + (set! (-> s4-0 effect) (new 'process 'effect-control this)) ) ) ) @@ -796,38 +796,38 @@ ) ) ) - (let ((s5-3 (-> obj root))) + (let ((s5-3 (-> this root))) (if (and s5-3 (nonzero? s5-3) (type? s5-3 collide-shape)) (find-collision-meshes (the-as collide-shape s5-3)) ) ) - (-> obj draw) + (-> this draw) ) ;; definition for method 15 of type process-drawable -(defmethod initialize-skeleton-by-name process-drawable ((obj process-drawable) (arg0 string)) +(defmethod initialize-skeleton-by-name process-drawable ((this process-drawable) (arg0 string)) (let* ((s4-0 *level*) (s3-0 (method-of-object s4-0 art-group-get-by-name)) ) (format (clear *temp-string*) "skel-~S" arg0) (let ((s4-1 (s3-0 s4-0 *temp-string* (the-as (pointer uint32) #f)))) (if (and (nonzero? s4-1) (valid? s4-1 skeleton-group (the-as string #f) #f 0)) - (initialize-skeleton obj (the-as skeleton-group s4-1) (the-as pair 0)) + (initialize-skeleton this (the-as skeleton-group s4-1) (the-as pair 0)) (go process-drawable-art-error arg0) ) ) ) - (-> obj draw) + (-> this draw) ) ;; definition for method 16 of type process-drawable -(defmethod apply-alignment process-drawable ((obj process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment process-drawable ((this process-drawable) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (with-pp (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) - (let* ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat))) + (let* ((s3-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat))) (s0-0 (matrix-transpose! (new 'stack-no-clear 'matrix) s3-0)) (s2-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> *standard-dynamics* gravity) s0-0)) - (a1-5 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj root transv) s0-0)) + (a1-5 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this root transv) s0-0)) ) (if (logtest? arg0 (align-opts no-gravity)) (set-vector! s2-0 0.0 0.0 0.0 1.0) @@ -855,13 +855,13 @@ (set! (-> a1-5 x) 0.0) ) ) - (vector-matrix*! (-> obj root transv) a1-5 s3-0) + (vector-matrix*! (-> this root transv) a1-5 s3-0) ) ) (if (logtest? arg0 (align-opts adjust-quat)) - (quaternion-normalize! (quaternion*! (-> obj root quat) (-> obj root quat) (-> arg1 quat))) + (quaternion-normalize! (quaternion*! (-> this root quat) (-> this root quat) (-> arg1 quat))) ) - (-> obj root) + (-> this root) ) ) @@ -1194,11 +1194,11 @@ ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod update-anim-data joint-control ((obj joint-control)) +(defmethod update-anim-data joint-control ((this joint-control)) (local-vars (s7-0 none) (ra-0 int)) - (let ((s5-0 (+ (-> obj active-channels) (-> obj float-channels)))) + (let ((s5-0 (+ (-> this active-channels) (-> this float-channels)))) (dotimes (s4-0 (the-as int s5-0)) - (let ((s3-0 (-> obj channel s4-0))) + (let ((s3-0 (-> this channel s4-0))) (case (-> s3-0 command) (((joint-control-command stack) (joint-control-command stack1)) ) @@ -1238,9 +1238,9 @@ ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod evaluate-joint-control process-drawable ((obj process-drawable)) +(defmethod evaluate-joint-control process-drawable ((this process-drawable)) (local-vars (s1-0 joint-control-channel) (s2-0 int) (s4-0 uint) (s7-0 none) (ra-0 int)) - (let ((gp-0 (-> obj skel))) + (let ((gp-0 (-> this skel))) (let ((a0-1 (-> gp-0 top-anim))) (b! (not a0-1) cfg-2 :delay (empty-form)) (update a0-1) @@ -1249,7 +1249,7 @@ (label cfg-2) (set! s4-0 (+ (-> gp-0 active-channels) (-> gp-0 float-channels))) (let ((s3-0 (current-time))) - (b! (logtest? (-> obj draw status) (draw-control-status no-draw)) cfg-45 :delay (empty-form)) + (b! (logtest? (-> this draw status) (draw-control-status no-draw)) cfg-45 :delay (empty-form)) (set! s2-0 0) (b! #t cfg-30 :delay (nop!)) (label cfg-4) @@ -1307,13 +1307,13 @@ (set! (-> gp-0 channel v1-56 frame-interp 1) (fmax 0.0 (fmin 1.0 (-> gp-0 channel v1-56 frame-interp 1)))) ) (if (or (zero? s4-0) (or (not (-> gp-0 root-channel 0 frame-group)) (zero? (-> gp-0 active-channels)))) - (logior! (-> obj draw status) (draw-control-status no-draw-temp)) + (logior! (-> this draw status) (draw-control-status no-draw-temp)) ) - (if (logtest? (-> obj skel status) (joint-control-status blend-shape blend-shape-valid)) - (merc-blend-shape obj) + (if (logtest? (-> this skel status) (joint-control-status blend-shape blend-shape-valid)) + (merc-blend-shape this) ) - (if (logtest? (-> obj skel status) (joint-control-status eye-anim-valid eye-anim)) - (merc-eye-anim obj) + (if (logtest? (-> this skel status) (joint-control-status eye-anim-valid eye-anim)) + (merc-eye-anim this) ) (label cfg-45) (let ((a0-26 (-> gp-0 effect))) @@ -1354,11 +1354,11 @@ ) ;; definition for method 9 of type joint-control -(defmethod current-cycle-distance joint-control ((obj joint-control)) +(defmethod current-cycle-distance joint-control ((this joint-control)) (cond - ((< (the-as int (-> obj root-channel)) (the-as int (-> obj channel (-> obj active-channels)))) - (let ((s4-0 (-> obj root-channel (-> obj root-channel 0 group-size))) - (s3-0 (the-as joint-control-channel (-> obj root-channel))) + ((< (the-as int (-> this root-channel)) (the-as int (-> this channel (-> this active-channels)))) + (let ((s4-0 (-> this root-channel (-> this root-channel 0 group-size))) + (s3-0 (the-as joint-control-channel (-> this root-channel))) (s5-0 (the-as (pointer float) (new 'stack-no-clear 'vector))) ) (while (< (the-as int s3-0) (the-as int s4-0)) @@ -1368,10 +1368,10 @@ (set! s5-0 (&-> s5-0 1)) ) (((joint-control-command blend) (joint-control-command push1) (joint-control-command float)) - (set! (-> s5-0 -1) (lerp (-> s5-0 -1) (-> s3-0 dist) (-> s3-0 frame-interp (-> obj active-frame-interp)))) + (set! (-> s5-0 -1) (lerp (-> s5-0 -1) (-> s3-0 dist) (-> s3-0 frame-interp (-> this active-frame-interp)))) ) (((joint-control-command stack)) - (set! (-> s5-0 -2) (lerp (-> s5-0 -2) (-> s5-0 -1) (-> s3-0 frame-interp (-> obj active-frame-interp)))) + (set! (-> s5-0 -2) (lerp (-> s5-0 -2) (-> s5-0 -1) (-> s3-0 frame-interp (-> this active-frame-interp)))) (set! s5-0 (&-> s5-0 -1)) ) ) @@ -1402,8 +1402,8 @@ ;; definition for method 9 of type top-anim-joint-control ;; WARN: Return type mismatch top-anim-joint-control vs none. -(defmethod reset top-anim-joint-control ((obj top-anim-joint-control)) - (let ((v0-0 obj)) +(defmethod reset top-anim-joint-control ((this top-anim-joint-control)) + (let ((v0-0 this)) (set! (-> v0-0 interp) 0.0) (set! (-> v0-0 frame-targ) #f) (set! (-> v0-0 frame-group) #f) @@ -1421,12 +1421,12 @@ ) ;; definition for method 11 of type top-anim-joint-control -(defmethod get-channel top-anim-joint-control ((obj top-anim-joint-control) (arg0 int)) +(defmethod get-channel top-anim-joint-control ((this top-anim-joint-control) (arg0 int)) (case arg0 ((1) - (case (-> obj process 0 skel float-channels) + (case (-> this process 0 skel float-channels) ((2) - (-> obj process 0 skel channel (-> obj process 0 skel active-channels)) + (-> this process 0 skel channel (-> this process 0 skel active-channels)) ) (else (the-as joint-control-channel #f) @@ -1434,12 +1434,12 @@ ) ) (else - (case (-> obj process 0 skel float-channels) + (case (-> this process 0 skel float-channels) ((1) - (-> obj process 0 skel channel (-> obj process 0 skel active-channels)) + (-> this process 0 skel channel (-> this process 0 skel active-channels)) ) ((2) - (-> obj process 0 skel channel (+ (-> obj process 0 skel active-channels) 1)) + (-> this process 0 skel channel (+ (-> this process 0 skel active-channels) 1)) ) (else (the-as joint-control-channel #f) @@ -1451,7 +1451,7 @@ ;; definition for method 12 of type top-anim-joint-control ;; WARN: Return type mismatch int vs none. -(defmethod push-anim-to-targ top-anim-joint-control ((obj top-anim-joint-control) +(defmethod push-anim-to-targ top-anim-joint-control ((this top-anim-joint-control) (arg0 art-joint-anim) (arg1 float) (arg2 int) @@ -1460,8 +1460,8 @@ (arg5 float) (arg6 symbol) ) - (when (!= (-> obj interp) 0.0) - (let ((v1-1 obj)) + (when (!= (-> this interp) 0.0) + (let ((v1-1 this)) (set! (-> v1-1 frame-targ) arg0) (set! (-> v1-1 frame-speed) arg4) (set! (-> v1-1 frame-start) (/ arg1 (-> arg0 artist-step))) @@ -1476,7 +1476,7 @@ ) ) (set! (-> v1-1 frame-post-end) (/ arg5 (-> arg0 artist-step))) - (set! (-> v1-1 frame-push-time) (current-time)) + (set-time! (-> v1-1 frame-push-time)) (set! (-> v1-1 frame-post-put-away) #f) ) (if arg6 @@ -1489,61 +1489,61 @@ ;; definition for method 10 of type top-anim-joint-control ;; WARN: Return type mismatch int vs none. -(defmethod update top-anim-joint-control ((obj top-anim-joint-control)) +(defmethod update top-anim-joint-control ((this top-anim-joint-control)) (with-pp - (let* ((v1-0 (-> obj process)) + (let* ((v1-0 (-> this process)) (pp (if v1-0 (the-as process-drawable (-> v1-0 0 self)) ) ) - (s3-0 (get-channel obj 1)) - (s5-0 (get-channel obj 0)) - (s4-0 (-> obj base-anim)) + (s3-0 (get-channel this 1)) + (s5-0 (get-channel this 0)) + (s4-0 (-> this base-anim)) ) - (set! (-> obj frame-group-push) #f) + (set! (-> this frame-group-push) #f) (cond - ((= (-> obj interp) 0.0) + ((= (-> this interp) 0.0) (when s5-0 (seek! (-> s5-0 frame-interp 1) 0.0 (* 8.0 (seconds-per-frame))) (if s3-0 (set! (-> s3-0 frame-interp 1) (fmin (-> s3-0 frame-interp 1) (-> s5-0 frame-interp 1))) ) (when (= (-> s5-0 frame-interp 1) 0.0) - (set! (-> obj frame-post-put-away) #f) - (when (= (-> obj interp) 0.0) + (set! (-> this frame-post-put-away) #f) + (when (= (-> this interp) 0.0) (joint-channel-float-delete! s5-0) - (set! (-> obj frame-group) #f) - (set! (-> obj frame-num) 0.0) + (set! (-> this frame-group) #f) + (set! (-> this frame-num) 0.0) (set! (-> pp skel generate-frame-function) create-interpolated-joint-animation-frame) ) (when s3-0 (joint-channel-float-delete! s3-0) - (set! (-> obj frame-group-push) #f) + (set! (-> this frame-group-push) #f) ) ) ) ) (else (when (or (not s5-0) - (or (and (-> obj frame-targ) - (and (!= (-> obj frame-blend) 0.0) - (or (!= (-> s5-0 frame-group) (-> obj frame-targ)) (< (-> obj update-time) (-> obj frame-push-time))) + (or (and (-> this frame-targ) + (and (!= (-> this frame-blend) 0.0) + (or (!= (-> s5-0 frame-group) (-> this frame-targ)) (< (-> this update-time) (-> this frame-push-time))) ) ) - (and (not (-> obj frame-targ)) + (and (not (-> this frame-targ)) (!= (-> s5-0 frame-group) s4-0) - (set! (-> obj frame-blend) (-> obj frame-post-blend)) + (set! (-> this frame-blend) (-> this frame-post-blend)) ) ) ) (when s3-0 (joint-channel-float-delete! s3-0) - (set! (-> obj frame-group-push) #f) - (set! s5-0 (get-channel obj 0)) - (set! (-> s5-0 frame-interp 1) (-> obj interp)) + (set! (-> this frame-group-push) #f) + (set! s5-0 (get-channel this 0)) + (set! (-> s5-0 frame-interp 1) (-> this interp)) ) (set! (-> pp skel generate-frame-function) create-interpolated2-joint-animation-frame) - (let ((s2-0 (the-as basic (-> obj frame-targ)))) + (let ((s2-0 (the-as basic (-> this frame-targ)))) (set! s2-0 (cond ((the-as art-joint-anim s2-0) (empty) @@ -1556,7 +1556,7 @@ ) (set! s3-0 s5-0) (if s3-0 - (set! (-> obj frame-group-push) (-> s3-0 frame-group)) + (set! (-> this frame-group-push) (-> s3-0 frame-group)) ) (cond ((= s4-0 s2-0) @@ -1569,26 +1569,26 @@ ) ) (when s5-0 - (set! (-> s5-0 frame-num) (-> obj frame-start)) - (set! (-> obj base-anim-speed) 1.0) - (set! (-> obj base-anim-blend) 0.1333333) + (set! (-> s5-0 frame-num) (-> this frame-start)) + (set! (-> this base-anim-speed) 1.0) + (set! (-> this base-anim-blend) 0.1333333) ) ) - ((>= (-> obj frame-speed) 0.0) + ((>= (-> this frame-speed) 0.0) (let ((v1-35 (ja-channel-float! (the-as art-joint-anim s2-0) 0.0 0.0 0.0))) (set! s5-0 (when v1-35 (set! (-> v1-35 param 0) - (- (the float (+ (-> (the-as art-joint-anim s2-0) frames num-frames) -1)) (-> obj frame-post-end)) + (- (the float (+ (-> (the-as art-joint-anim s2-0) frames num-frames) -1)) (-> this frame-post-end)) ) - (set! (-> v1-35 param 1) (-> obj frame-speed)) + (set! (-> v1-35 param 1) (-> this frame-speed)) (set! (-> v1-35 num-func) num-func-seek!) v1-35 ) ) ) (if s5-0 - (set! (-> s5-0 frame-num) (-> obj frame-start)) + (set! (-> s5-0 frame-num) (-> this frame-start)) ) ) (else @@ -1596,36 +1596,38 @@ (let ((v1-39 (ja-channel-float! (the-as art-joint-anim s2-0) 0.0 0.0 0.0))) (set! s5-0 (when v1-39 (set! (-> v1-39 param 0) 0.0) - (set! (-> v1-39 param 1) (fabs (-> obj frame-speed))) + (set! (-> v1-39 param 1) (fabs (-> this frame-speed))) (set! (-> v1-39 num-func) num-func-seek!) v1-39 ) ) ) (when s5-0 - (set! (-> s5-0 frame-num) (- (the float (+ (-> s5-0 frame-group frames num-frames) -1)) (-> obj frame-start))) - (set! (-> obj base-anim-speed) 1.0) - (set! (-> obj base-anim-blend) 0.1333333) + (set! (-> s5-0 frame-num) + (- (the float (+ (-> s5-0 frame-group frames num-frames) -1)) (-> this frame-start)) + ) + (set! (-> this base-anim-speed) 1.0) + (set! (-> this base-anim-blend) 0.1333333) ) ) ) ) ) (when s5-0 - (set! (-> obj frame-group) (-> s5-0 frame-group)) - (set! (-> obj frame-num) (-> s5-0 frame-num)) - (set! (-> obj frame-cur-blend) (-> obj frame-blend)) + (set! (-> this frame-group) (-> s5-0 frame-group)) + (set! (-> this frame-num) (-> s5-0 frame-num)) + (set! (-> this frame-cur-blend) (-> this frame-blend)) ) ) (when s5-0 - (set! (-> pp skel interp-select 0) (the-as int (-> obj interp-select 0))) - (set! (-> pp skel interp-select 1) (the-as int (-> obj interp-select 1))) + (set! (-> pp skel interp-select 0) (the-as int (-> this interp-select 0))) + (set! (-> pp skel interp-select 1) (the-as int (-> this interp-select 1))) (let ((f0-35 (cond - ((not (-> obj frame-targ)) - (-> obj base-anim-blend) + ((not (-> this frame-targ)) + (-> this base-anim-blend) ) (s3-0 - (-> obj frame-cur-blend) + (-> this frame-cur-blend) ) (else 0.1333333 @@ -1634,24 +1636,24 @@ ) ) (if (= f0-35 0.0) - (set! (-> s5-0 frame-interp 1) (-> obj interp)) - (seek! (-> s5-0 frame-interp 1) (-> obj interp) (* f0-35 (-> pp clock time-adjust-ratio))) + (set! (-> s5-0 frame-interp 1) (-> this interp)) + (seek! (-> s5-0 frame-interp 1) (-> this interp) (* f0-35 (-> pp clock time-adjust-ratio))) ) ) (when s3-0 - (set! (-> obj frame-group-push) (-> s3-0 frame-group)) - (set! (-> s3-0 frame-interp 1) (-> obj interp)) + (set! (-> this frame-group-push) (-> s3-0 frame-group)) + (set! (-> s3-0 frame-interp 1) (-> this interp)) (if (!= (-> s3-0 eval-time) (current-time)) (joint-control-channel-eval s3-0) ) - (when (= (-> s5-0 frame-interp 1) (-> obj interp)) + (when (= (-> s5-0 frame-interp 1) (-> this interp)) (joint-channel-float-delete! s3-0) - (set! (-> obj frame-group-push) #f) - (set! s5-0 (get-channel obj 0)) - (set! (-> s5-0 frame-interp 1) (-> obj interp)) + (set! (-> this frame-group-push) #f) + (set! s5-0 (get-channel this 0)) + (set! (-> s5-0 frame-interp 1) (-> this interp)) ) ) - (let ((v1-70 (-> obj frame-targ))) + (let ((v1-70 (-> this frame-targ))) (cond (v1-70 (cond @@ -1660,14 +1662,14 @@ (joint-control-channel-eval s5-0) ) (when (= (-> s5-0 frame-num) (-> s5-0 param 0)) - (set! (-> obj frame-targ) #f) - (set! (-> obj frame-start) 0.0) + (set! (-> this frame-targ) #f) + (set! (-> this frame-start) 0.0) (cond - ((-> obj frame-post-put-away) - (set! (-> obj interp) 0.0) - (set! (-> obj frame-post-put-away) #f) + ((-> this frame-post-put-away) + (set! (-> this interp) 0.0) + (set! (-> this frame-post-put-away) #f) ) - ((!= (-> obj frame-post-blend) 0.0) + ((!= (-> this frame-post-blend) 0.0) (set! (-> s5-0 param 0) (the float (+ (-> s5-0 frame-group frames num-frames) -1))) ) (else @@ -1682,42 +1684,42 @@ (else (set! (-> s5-0 eval-time) (the-as uint (current-time))) (set! (-> s5-0 frame-group) v1-70) - (set! (-> s5-0 frame-num) (if (< (-> obj frame-speed) 0.0) - (- (the float (+ (-> v1-70 frames num-frames) -1)) (-> obj frame-start)) - (set! (-> s5-0 frame-num) (-> obj frame-start)) + (set! (-> s5-0 frame-num) (if (< (-> this frame-speed) 0.0) + (- (the float (+ (-> v1-70 frames num-frames) -1)) (-> this frame-start)) + (set! (-> s5-0 frame-num) (-> this frame-start)) ) ) (set! (-> s5-0 num-func) num-func-seek!) - (if (>= (-> obj frame-speed) 0.0) + (if (>= (-> this frame-speed) 0.0) (set! (-> s5-0 param 0) - (- (the float (+ (-> s5-0 frame-group frames num-frames) -1)) (-> obj frame-post-end)) + (- (the float (+ (-> s5-0 frame-group frames num-frames) -1)) (-> this frame-post-end)) ) (set! (-> s5-0 param 0) 0.0) ) - (set! (-> s5-0 param 1) (fabs (-> obj frame-speed))) + (set! (-> s5-0 param 1) (fabs (-> this frame-speed))) ) ) ) (else (when (!= (-> s5-0 frame-group) s4-0) (set! (-> s5-0 frame-num) 0.0) - (set! (-> obj base-anim-speed) 1.0) - (set! (-> obj base-anim-blend) 0.1333333) + (set! (-> this base-anim-speed) 1.0) + (set! (-> this base-anim-blend) 0.1333333) ) (set! (-> s5-0 frame-group) (the-as art-joint-anim s4-0)) (set! (-> s5-0 num-func) num-func-loop!) - (set! (-> s5-0 param 0) (-> obj base-anim-speed)) - (set! (-> obj frame-post-blend) 0.1333333) + (set! (-> s5-0 param 0) (-> this base-anim-speed)) + (set! (-> this frame-post-blend) 0.1333333) ) ) ) - (set! (-> obj frame-group) (-> s5-0 frame-group)) - (set! (-> obj frame-num) (-> s5-0 frame-num)) + (set! (-> this frame-group) (-> s5-0 frame-group)) + (set! (-> this frame-num) (-> s5-0 frame-num)) ) ) ) ) - (set! (-> obj update-time) (current-time)) + (set-time! (-> this update-time)) 0 (none) ) @@ -1806,7 +1808,7 @@ (while (and *target* (focus-test? *target* in-air)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (process-grab? *target* #f) (while (or (-> *setting-control* user-current talking) (-> *setting-control* user-current spooling) @@ -1815,7 +1817,7 @@ ) (suspend) ) - (while (< (- (current-time) (-> self state-time)) arg0) + (while (not (time-elapsed? (-> self state-time) arg0)) (suspend) ) (process-release? *target*) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc index 23f06e226a..b08d58ace5 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc @@ -22,24 +22,24 @@ ) ;; definition for method 3 of type process-focusable -(defmethod inspect process-focusable ((obj process-focusable)) - (when (not obj) - (set! obj obj) +(defmethod inspect process-focusable ((this process-focusable)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfocus-status: ~D~%" (-> obj focus-status)) + (format #t "~2Tfocus-status: ~D~%" (-> this focus-status)) (label cfg-4) - obj + this ) ;; definition for method 20 of type process-focusable ;; WARN: Return type mismatch structure vs vector. -(defmethod get-trans process-focusable ((obj process-focusable) (arg0 int)) +(defmethod get-trans process-focusable ((this process-focusable) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((gp-0 (-> obj root))) + (let ((gp-0 (-> this root))) (the-as vector (cond ((zero? arg0) (-> gp-0 trans) @@ -59,34 +59,34 @@ ) ;; definition for method 22 of type process-focusable -(defmethod get-transv process-focusable ((obj process-focusable)) - (-> obj root transv) +(defmethod get-transv process-focusable ((this process-focusable)) + (-> this root transv) ) ;; definition for method 21 of type process-focusable -(defmethod get-quat process-focusable ((obj process-focusable) (arg0 int)) - (-> obj root quat) +(defmethod get-quat process-focusable ((this process-focusable) (arg0 int)) + (-> this root quat) ) ;; definition for method 23 of type process-focusable -(defmethod time-to-apex-or-ground process-focusable ((obj process-focusable) (arg0 int)) +(defmethod time-to-apex-or-ground process-focusable ((this process-focusable) (arg0 int)) 0 ) ;; definition for method 24 of type process-focusable ;; WARN: Return type mismatch int vs meters. -(defmethod get-water-height process-focusable ((obj process-focusable)) +(defmethod get-water-height process-focusable ((this process-focusable)) (the-as meters 0) ) ;; definition for method 26 of type process-focusable -(defmethod get-inv-mass process-focusable ((obj process-focusable)) +(defmethod get-inv-mass process-focusable ((this process-focusable)) 0.0 ) ;; definition for method 25 of type process-focusable ;; WARN: Return type mismatch int vs time-frame. -(defmethod get-notice-time process-focusable ((obj process-focusable)) +(defmethod get-notice-time process-focusable ((this process-focusable)) (the-as time-frame 0) ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc index 6f66623d3f..2b6317d1d7 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc @@ -38,30 +38,30 @@ ) ;; definition for method 3 of type process-taskable -(defmethod inspect process-taskable ((obj process-taskable)) - (when (not obj) - (set! obj obj) +(defmethod inspect process-taskable ((this process-taskable)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttask: ~A~%" (-> obj task)) - (format #t "~2Tambient: #~%" (-> obj ambient)) - (format #t "~2Tneck-joint-index: ~D~%" (-> obj neck-joint-index)) - (format #t "~2Ttalk-message: ~D~%" (-> obj talk-message)) - (format #t "~2Tbounce-away: ~A~%" (-> obj bounce-away)) - (format #t "~2Twill-talk: ~A~%" (-> obj will-talk)) - (format #t "~2Tlook-at-me: ~A~%" (-> obj look-at-me)) - (format #t "~2Thide-during-movie: ~A~%" (-> obj hide-during-movie)) - (format #t "~2Ttalk-distance: (meters ~m)~%" (-> obj talk-distance)) - (format #t "~2Ttalk-height: (meters ~m)~%" (-> obj talk-height)) - (format #t "~2Tlast-talk: ~D~%" (-> obj last-talk)) - (format #t "~2Twant-to-say: ~D~%" (-> obj want-to-say)) - (format #t "~2Tbirth-time: ~D~%" (-> obj birth-time)) - (format #t "~2Tslave: ~D~%" (-> obj slave)) + (format #t "~2Ttask: ~A~%" (-> this task)) + (format #t "~2Tambient: #~%" (-> this ambient)) + (format #t "~2Tneck-joint-index: ~D~%" (-> this neck-joint-index)) + (format #t "~2Ttalk-message: ~D~%" (-> this talk-message)) + (format #t "~2Tbounce-away: ~A~%" (-> this bounce-away)) + (format #t "~2Twill-talk: ~A~%" (-> this will-talk)) + (format #t "~2Tlook-at-me: ~A~%" (-> this look-at-me)) + (format #t "~2Thide-during-movie: ~A~%" (-> this hide-during-movie)) + (format #t "~2Ttalk-distance: (meters ~m)~%" (-> this talk-distance)) + (format #t "~2Ttalk-height: (meters ~m)~%" (-> this talk-height)) + (format #t "~2Tlast-talk: ~D~%" (-> this last-talk)) + (format #t "~2Twant-to-say: ~D~%" (-> this want-to-say)) + (format #t "~2Tbirth-time: ~D~%" (-> this birth-time)) + (format #t "~2Tslave: ~D~%" (-> this slave)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc index ec372519c5..419a3b677a 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable_REF.gc @@ -3,11 +3,11 @@ ;; definition for method 7 of type process-taskable ;; WARN: Return type mismatch process-focusable vs process-taskable. -(defmethod relocate process-taskable ((obj process-taskable) (arg0 int)) - (if (nonzero? (-> obj task)) - (&+! (-> obj task) arg0) +(defmethod relocate process-taskable ((this process-taskable) (arg0 int)) + (if (nonzero? (-> this task)) + (&+! (-> this task) arg0) ) - (the-as process-taskable ((method-of-type process-focusable relocate) obj arg0)) + (the-as process-taskable ((method-of-type process-focusable relocate) this arg0)) ) ;; definition for function process-taskable-anim-loop @@ -34,38 +34,38 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ;; definition for method 34 of type process-taskable -(defmethod process-taskable-method-34 process-taskable ((obj process-taskable)) +(defmethod process-taskable-method-34 process-taskable ((this process-taskable)) #t ) ;; definition for method 35 of type process-taskable ;; WARN: Return type mismatch art-joint-anim vs art-element. -(defmethod get-art-elem process-taskable ((obj process-taskable)) +(defmethod get-art-elem process-taskable ((this process-taskable)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (the-as art-element (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (the-as art-element (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) ;; definition for method 36 of type process-taskable ;; WARN: Return type mismatch int vs none. -(defmethod process-taskable-method-36 process-taskable ((obj process-taskable)) +(defmethod process-taskable-method-36 process-taskable ((this process-taskable)) 0 (none) ) ;; definition for method 37 of type process-taskable ;; WARN: Return type mismatch object vs none. -(defmethod process-taskable-method-37 process-taskable ((obj process-taskable)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod process-taskable-method-37 process-taskable ((this process-taskable)) + (let ((v1-1 (-> this draw shadow-ctrl))) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) ) - (shadow-control-method-13 v1-1 (-> obj draw origin) -4096.0 4096.0 32768.0) + (shadow-control-method-13 v1-1 (-> this draw origin) -4096.0 4096.0 32768.0) ) (else (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) @@ -90,7 +90,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self draw status) (draw-control-status no-draw-bounds)) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (collide-spec)) @@ -109,7 +109,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (let ((v1-1 (get-current-task-event (-> self task)))) (if (and (nonzero? (-> v1-1 action)) (or (not (logtest? (-> self draw status) (draw-control-status on-screen))) (logtest? (-> v1-1 flags) (game-task-flags gatflag-01)) - (< (- (current-time) (-> self birth-time)) (seconds 0.1)) + (not (time-elapsed? (-> self birth-time) (seconds 0.1))) ) ) (go-virtual idle) @@ -146,7 +146,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (logclear! (-> self draw status) (draw-control-status no-draw)) @@ -199,7 +199,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (< (vector-vector-distance (target-pos 0) s5-0) f30-0) ) ) - (< (- (current-time) (-> self want-to-say)) (seconds 4)) + (not (time-elapsed? (-> self want-to-say) (seconds 4))) ) (or (not (load-in-progress? *level*)) (= (-> gp-0 action) (game-task-action say))) (and (not (movie?)) @@ -219,7 +219,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) (process-taskable-method-34 self) ) - (when (or (= (-> gp-0 action) (game-task-action say)) (< (- (current-time) (-> self want-to-say)) (seconds 4))) + (when (or (= (-> gp-0 action) (game-task-action say)) (not (time-elapsed? (-> self want-to-say) (seconds 4)))) (case (-> gp-0 action) (((game-task-action play)) (go-virtual play-game gp-0) @@ -295,7 +295,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ) :exit (behavior () (set! (-> self last-talk) (-> *display* game-clock frame-counter)) - (if (< (- (current-time) (-> self want-to-say)) (seconds 4)) + (if (not (time-elapsed? (-> self want-to-say) (seconds 4))) (set! (-> self will-talk) #t) (set! (-> self will-talk) #f) ) @@ -335,7 +335,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy :exit (-> (method-of-type process-taskable active) exit) :code (behavior ((arg0 game-task-event)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.5)) + (until (time-elapsed? gp-0 (seconds 0.5)) (suspend) ) ) @@ -346,8 +346,8 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; definition for method 31 of type process-taskable ;; WARN: Return type mismatch int vs none. -(defmethod process-taskable-method-31 process-taskable ((obj process-taskable)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod process-taskable-method-31 process-taskable ((this process-taskable)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s5-0 total-prims) (the-as uint 4)) (set! (-> s4-0 prim-core collide-as) (collide-spec civilian)) @@ -379,7 +379,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -387,27 +387,27 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; definition for method 32 of type process-taskable ;; WARN: Return type mismatch int vs none. -(defmethod process-taskable-method-32 process-taskable ((obj process-taskable)) - (logior! (-> obj skel status) (joint-control-status eye-anim)) - (set! (-> obj talk-message) (text-id press-triangle-to-talk)) - (set! (-> obj bounce-away) #t) - (set! (-> obj will-talk) #t) - (set! (-> obj look-at-me) #t) - (set! (-> obj hide-during-movie) #t) - (set! (-> obj neck-joint-index) -1) - (set! (-> obj talk-distance) (res-lump-float (-> obj entity) 'distance :default 32768.0)) - (set! (-> obj talk-height) (res-lump-float (-> obj entity) 'height :default 8192.0)) - (set! (-> obj slave) (the-as handle #f)) - (set! (-> obj draw shadow-ctrl) +(defmethod process-taskable-method-32 process-taskable ((this process-taskable)) + (logior! (-> this skel status) (joint-control-status eye-anim)) + (set! (-> this talk-message) (text-id press-triangle-to-talk)) + (set! (-> this bounce-away) #t) + (set! (-> this will-talk) #t) + (set! (-> this look-at-me) #t) + (set! (-> this hide-during-movie) #t) + (set! (-> this neck-joint-index) -1) + (set! (-> this talk-distance) (res-lump-float (-> this entity) 'distance :default 32768.0)) + (set! (-> this talk-height) (res-lump-float (-> this entity) 'height :default 8192.0)) + (set! (-> this slave) (the-as handle #f)) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (shadow-flags shdf02 shdf03 shdf04 disable-draw) 245760.0) ) (let ((s5-0 0)) - (let ((v1-15 (the-as joint (get-art-by-name-method (-> obj draw jgeo) "main" (the-as type #f))))) + (let ((v1-15 (the-as joint (get-art-by-name-method (-> this draw jgeo) "main" (the-as type #f))))) (if v1-15 (set! s5-0 (+ (-> v1-15 number) 1)) ) ) - (let ((v1-19 (the-as collide-shape-prim-group (-> obj root root-prim)))) + (let ((v1-19 (the-as collide-shape-prim-group (-> this root root-prim)))) (set! (-> v1-19 transform-index) s5-0) (dotimes (a0-7 (the-as int (-> v1-19 num-children))) (set! (-> v1-19 child a0-7 transform-index) s5-0) @@ -420,7 +420,7 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; definition for method 33 of type process-taskable ;; WARN: Return type mismatch int vs none. -(defmethod init-art! process-taskable ((obj process-taskable)) +(defmethod init-art! process-taskable ((this process-taskable)) "@see [[initialize-skeleton]]" 0 (none) @@ -428,29 +428,29 @@ Seen take in - `true-func` which takes no args TODO - seems fishy ;; definition for method 11 of type process-taskable ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! process-taskable ((obj process-taskable) (arg0 entity-actor)) +(defmethod init-from-entity! process-taskable ((this process-taskable) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (process-taskable-method-31 obj) - (process-drawable-from-entity! obj arg0) - (set! (-> obj task) + (stack-size-set! (-> this main-thread) 512) + (process-taskable-method-31 this) + (process-drawable-from-entity! this arg0) + (set! (-> this task) (new 'process 'game-task-control (res-lump-value arg0 'task-actor game-task-actor :time -1000000000.0)) ) - (init-art! obj) - (process-taskable-method-32 obj) + (init-art! this) + (process-taskable-method-32 this) (when (logtest? #x1000000 (res-lump-value arg0 'options uint128 :time -1000000000.0)) (let* ((s5-1 *level*) (s4-2 (method-of-object s5-1 art-group-get-by-name)) ) - (format (clear *temp-string*) "skel-~S" (-> obj draw art-group name)) + (format (clear *temp-string*) "skel-~S" (-> this draw art-group name)) (let ((s4-3 (s4-2 s5-1 *temp-string* (the-as (pointer uint32) #f)))) (when s4-3 - (let ((s5-2 (process-spawn manipy :init manipy-init (-> obj root trans) (-> obj entity) s4-3 #f 0 :to obj))) + (let ((s5-2 (process-spawn manipy :init manipy-init (-> this root trans) (-> this entity) s4-3 #f 0 :to this))) (send-event (ppointer->process s5-2) 'anim-mode 'mirror) (send-event (ppointer->process s5-2) 'mirror #t) ) @@ -458,7 +458,7 @@ This commonly includes things such as: ) ) ) - (set! (-> obj event-hook) (-> (method-of-object obj idle) event)) - (go (method-of-object obj hide)) + (set! (-> this event-hook) (-> (method-of-object this idle) event)) + (go (method-of-object this hide)) (none) ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc index f750aa7958..9e7c5abf2a 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/simple-focus_REF.gc @@ -15,29 +15,29 @@ ) ;; definition for method 3 of type simple-focus -(defmethod inspect simple-focus ((obj simple-focus)) - (when (not obj) - (set! obj obj) +(defmethod inspect simple-focus ((this simple-focus)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfirst-time?: ~A~%" (-> obj first-time?)) + (format #t "~2Tfirst-time?: ~A~%" (-> this first-time?)) (label cfg-4) - obj + this ) ;; definition for method 20 of type simple-focus -(defmethod get-trans simple-focus ((obj simple-focus) (arg0 int)) +(defmethod get-trans simple-focus ((this simple-focus) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (-> obj root trans) + (-> this root trans) ) ;; definition for method 12 of type simple-focus -(defmethod run-logic? simple-focus ((obj simple-focus)) - (when (-> obj first-time?) - (set! (-> obj first-time?) #f) +(defmethod run-logic? simple-focus ((this simple-focus)) + (when (-> this first-time?) + (set! (-> this first-time?) #f) #t ) ) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc index 1590d89919..5af839f378 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/simple-nav-sphere_REF.gc @@ -18,18 +18,18 @@ ) ;; definition for method 3 of type simple-nav-sphere -(defmethod inspect simple-nav-sphere ((obj simple-nav-sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect simple-nav-sphere ((this simple-nav-sphere)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfirst-time?: ~A~%" (-> obj first-time?)) - (format #t "~2Ttrack-joint: ~D~%" (-> obj track-joint)) + (format #t "~2Tfirst-time?: ~A~%" (-> this first-time?)) + (format #t "~2Ttrack-joint: ~D~%" (-> this track-joint)) (label cfg-4) - obj + this ) ;; definition for function simple-nav-sphere-event-handler @@ -56,16 +56,16 @@ ) ;; definition for method 12 of type simple-nav-sphere -(defmethod run-logic? simple-nav-sphere ((obj simple-nav-sphere)) +(defmethod run-logic? simple-nav-sphere ((this simple-nav-sphere)) (cond (*display-nav-marks* #t ) - ((>= (-> obj track-joint) 0) + ((>= (-> this track-joint) 0) #t ) - ((-> obj first-time?) - (set! (-> obj first-time?) #f) + ((-> this first-time?) + (set! (-> this first-time?) #f) #t ) ) diff --git a/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc index adb0febce8..febced8fc2 100644 --- a/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc @@ -36,31 +36,31 @@ ) ;; definition for method 3 of type mc-file-info -(defmethod inspect mc-file-info ((obj mc-file-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect mc-file-info ((this mc-file-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mc-file-info) - (format #t "~1Tpresent: ~D~%" (-> obj present)) - (format #t "~1Tblind-data[16] @ #x~X~%" (-> obj blind-data)) - (format #t "~1Tblind-data-int8[64] @ #x~X~%" (-> obj blind-data)) - (format #t "~1Tlevel-index: ~D~%" (-> obj level-index)) - (format #t "~1Tgem-count: ~f~%" (-> obj gem-count)) - (format #t "~1Tskill-count: ~f~%" (-> obj skill-count)) - (format #t "~1Tcompletion-percentage: ~f~%" (-> obj completion-percentage)) - (format #t "~1Tminute: #x~X~%" (-> obj minute)) - (format #t "~1Thour: #x~X~%" (-> obj hour)) - (format #t "~1Tweek: #x~X~%" (-> obj week)) - (format #t "~1Tday: #x~X~%" (-> obj day)) - (format #t "~1Tmonth: #x~X~%" (-> obj month)) - (format #t "~1Tyear: #x~X~%" (-> obj year)) - (format #t "~1Tgame-time0: ~D~%" (-> obj game-time0)) - (format #t "~1Tgame-time1: ~D~%" (-> obj game-time1)) - (format #t "~1Tsecrets: #x~X~%" (-> obj secrets)) - (format #t "~1Tfeatures: #x~X~%" (-> obj features)) + (format #t "[~8x] ~A~%" this 'mc-file-info) + (format #t "~1Tpresent: ~D~%" (-> this present)) + (format #t "~1Tblind-data[16] @ #x~X~%" (-> this blind-data)) + (format #t "~1Tblind-data-int8[64] @ #x~X~%" (-> this blind-data)) + (format #t "~1Tlevel-index: ~D~%" (-> this level-index)) + (format #t "~1Tgem-count: ~f~%" (-> this gem-count)) + (format #t "~1Tskill-count: ~f~%" (-> this skill-count)) + (format #t "~1Tcompletion-percentage: ~f~%" (-> this completion-percentage)) + (format #t "~1Tminute: #x~X~%" (-> this minute)) + (format #t "~1Thour: #x~X~%" (-> this hour)) + (format #t "~1Tweek: #x~X~%" (-> this week)) + (format #t "~1Tday: #x~X~%" (-> this day)) + (format #t "~1Tmonth: #x~X~%" (-> this month)) + (format #t "~1Tyear: #x~X~%" (-> this year)) + (format #t "~1Tgame-time0: ~D~%" (-> this game-time0)) + (format #t "~1Tgame-time1: ~D~%" (-> this game-time1)) + (format #t "~1Tsecrets: #x~X~%" (-> this secrets)) + (format #t "~1Tfeatures: #x~X~%" (-> this features)) (label cfg-4) - obj + this ) ;; definition of type mc-slot-info @@ -81,22 +81,22 @@ ) ;; definition for method 3 of type mc-slot-info -(defmethod inspect mc-slot-info ((obj mc-slot-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect mc-slot-info ((this mc-slot-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mc-slot-info) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tknown: ~D~%" (-> obj known)) - (format #t "~1Tformatted: ~D~%" (-> obj formatted)) - (format #t "~1Tinited: ~D~%" (-> obj inited)) - (format #t "~1Tlast-file: ~D~%" (-> obj last-file)) - (format #t "~1Tmem-required: ~D~%" (-> obj mem-required)) - (format #t "~1Tmem-actual: ~D~%" (-> obj mem-actual)) - (format #t "~1Tfile[4] @ #x~X~%" (-> obj file)) + (format #t "[~8x] ~A~%" this 'mc-slot-info) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tknown: ~D~%" (-> this known)) + (format #t "~1Tformatted: ~D~%" (-> this formatted)) + (format #t "~1Tinited: ~D~%" (-> this inited)) + (format #t "~1Tlast-file: ~D~%" (-> this last-file)) + (format #t "~1Tmem-required: ~D~%" (-> this mem-required)) + (format #t "~1Tmem-actual: ~D~%" (-> this mem-actual)) + (format #t "~1Tfile[4] @ #x~X~%" (-> this file)) (label cfg-4) - obj + this ) ;; definition for function mc-sync diff --git a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc index 22133c3d89..fed5ae7ed5 100644 --- a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc @@ -18,22 +18,22 @@ ) ;; definition for method 3 of type scf-time -(defmethod inspect scf-time ((obj scf-time)) - (when (not obj) - (set! obj obj) +(defmethod inspect scf-time ((this scf-time)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'scf-time) - (format #t "~1Tstat: ~D~%" (-> obj stat)) - (format #t "~1Tsecond: #x~X~%" (-> obj second)) - (format #t "~1Tminute: #x~X~%" (-> obj minute)) - (format #t "~1Thour: #x~X~%" (-> obj hour)) - (format #t "~1Tweek: #x~X~%" (-> obj week)) - (format #t "~1Tday: #x~X~%" (-> obj day)) - (format #t "~1Tmonth: #x~X~%" (-> obj month)) - (format #t "~1Tyear: #x~X~%" (-> obj year)) + (format #t "[~8x] ~A~%" this 'scf-time) + (format #t "~1Tstat: ~D~%" (-> this stat)) + (format #t "~1Tsecond: #x~X~%" (-> this second)) + (format #t "~1Tminute: #x~X~%" (-> this minute)) + (format #t "~1Thour: #x~X~%" (-> this hour)) + (format #t "~1Tweek: #x~X~%" (-> this week)) + (format #t "~1Tday: #x~X~%" (-> this day)) + (format #t "~1Tmonth: #x~X~%" (-> this month)) + (format #t "~1Tyear: #x~X~%" (-> this year)) (label cfg-4) - obj + this ) ;; definition for symbol *cheat-mode*, type symbol @@ -57,23 +57,23 @@ ) ;; definition for method 3 of type hw-cpad -(defmethod inspect hw-cpad ((obj hw-cpad)) - (when (not obj) - (set! obj obj) +(defmethod inspect hw-cpad ((this hw-cpad)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tvalid: #x~X~%" (-> obj valid)) - (format #t "~1Tstatus: #x~X~%" (-> obj status)) - (format #t "~1Tbutton0: #x~X~%" (-> obj button0)) - (format #t "~1Trightx: ~D~%" (-> obj rightx)) - (format #t "~1Trighty: ~D~%" (-> obj righty)) - (format #t "~1Tleftx: ~D~%" (-> obj leftx)) - (format #t "~1Tlefty: ~D~%" (-> obj lefty)) - (format #t "~1Tabutton[12] @ #x~X~%" (-> obj abutton)) - (format #t "~1Tdummy[12] @ #x~X~%" (-> obj dummy)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tvalid: #x~X~%" (-> this valid)) + (format #t "~1Tstatus: #x~X~%" (-> this status)) + (format #t "~1Tbutton0: #x~X~%" (-> this button0)) + (format #t "~1Trightx: ~D~%" (-> this rightx)) + (format #t "~1Trighty: ~D~%" (-> this righty)) + (format #t "~1Tleftx: ~D~%" (-> this leftx)) + (format #t "~1Tlefty: ~D~%" (-> this lefty)) + (format #t "~1Tabutton[12] @ #x~X~%" (-> this abutton)) + (format #t "~1Tdummy[12] @ #x~X~%" (-> this dummy)) (label cfg-4) - obj + this ) ;; definition of type cpad-info @@ -111,45 +111,45 @@ ) ;; definition for method 3 of type cpad-info -(defmethod inspect cpad-info ((obj cpad-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect cpad-info ((this cpad-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tvalid: #x~X~%" (-> obj valid)) - (format #t "~1Tstatus: #x~X~%" (-> obj status)) - (format #t "~1Tbutton0: #x~X~%" (-> obj button0)) - (format #t "~1Trightx: ~D~%" (-> obj rightx)) - (format #t "~1Trighty: ~D~%" (-> obj righty)) - (format #t "~1Tleftx: ~D~%" (-> obj leftx)) - (format #t "~1Tlefty: ~D~%" (-> obj lefty)) - (format #t "~1Tabutton[12] @ #x~X~%" (-> obj abutton)) - (format #t "~1Tdummy[12] @ #x~X~%" (-> obj dummy)) - (format #t "~1Tnumber: ~D~%" (-> obj number)) - (format #t "~1Tcpad-file: ~D~%" (-> obj cpad-file)) - (format #t "~1Tbutton0-abs[3] @ #x~X~%" (-> obj button0-abs)) - (format #t "~1Tbutton0-shadow-abs[1] @ #x~X~%" (-> obj button0-shadow-abs)) - (format #t "~1Tbutton0-rel[3] @ #x~X~%" (-> obj button0-rel)) - (format #t "~1Tstick0-dir: ~f~%" (-> obj stick0-dir)) - (format #t "~1Tstick0-speed: ~f~%" (-> obj stick0-speed)) - (format #t "~1Tnew-pad: ~D~%" (-> obj new-pad)) - (format #t "~1Tstate: ~D~%" (-> obj state)) - (format #t "~1Talign[6] @ #x~X~%" (-> obj align)) - (format #t "~1Tdirect[6] @ #x~X~%" (-> obj direct)) - (format #t "~1Tbuzz-val[2] @ #x~X~%" (-> obj buzz-val)) - (format #t "~1Tbuzz-pause-val[1] @ #x~X~%" (-> obj buzz-pause-val)) - (format #t "~1Tbuzz-pause-time: ~D~%" (-> obj buzz-pause-time)) - (format #t "~1Tbuzz-time[2] @ #x~X~%" (-> obj buzz-time)) - (format #t "~1Tbuzz: ~A~%" (-> obj buzz)) - (format #t "~1Tbuzz-act: ~D~%" (-> obj buzz-act)) - (format #t "~1Tchange-time: ~D~%" (-> obj change-time)) - (format #t "~1Told-rightx[2] @ #x~X~%" (-> obj old-rightx)) - (format #t "~1Told-righty[2] @ #x~X~%" (-> obj old-righty)) - (format #t "~1Told-leftx[2] @ #x~X~%" (-> obj old-leftx)) - (format #t "~1Told-lefty[2] @ #x~X~%" (-> obj old-lefty)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tvalid: #x~X~%" (-> this valid)) + (format #t "~1Tstatus: #x~X~%" (-> this status)) + (format #t "~1Tbutton0: #x~X~%" (-> this button0)) + (format #t "~1Trightx: ~D~%" (-> this rightx)) + (format #t "~1Trighty: ~D~%" (-> this righty)) + (format #t "~1Tleftx: ~D~%" (-> this leftx)) + (format #t "~1Tlefty: ~D~%" (-> this lefty)) + (format #t "~1Tabutton[12] @ #x~X~%" (-> this abutton)) + (format #t "~1Tdummy[12] @ #x~X~%" (-> this dummy)) + (format #t "~1Tnumber: ~D~%" (-> this number)) + (format #t "~1Tcpad-file: ~D~%" (-> this cpad-file)) + (format #t "~1Tbutton0-abs[3] @ #x~X~%" (-> this button0-abs)) + (format #t "~1Tbutton0-shadow-abs[1] @ #x~X~%" (-> this button0-shadow-abs)) + (format #t "~1Tbutton0-rel[3] @ #x~X~%" (-> this button0-rel)) + (format #t "~1Tstick0-dir: ~f~%" (-> this stick0-dir)) + (format #t "~1Tstick0-speed: ~f~%" (-> this stick0-speed)) + (format #t "~1Tnew-pad: ~D~%" (-> this new-pad)) + (format #t "~1Tstate: ~D~%" (-> this state)) + (format #t "~1Talign[6] @ #x~X~%" (-> this align)) + (format #t "~1Tdirect[6] @ #x~X~%" (-> this direct)) + (format #t "~1Tbuzz-val[2] @ #x~X~%" (-> this buzz-val)) + (format #t "~1Tbuzz-pause-val[1] @ #x~X~%" (-> this buzz-pause-val)) + (format #t "~1Tbuzz-pause-time: ~D~%" (-> this buzz-pause-time)) + (format #t "~1Tbuzz-time[2] @ #x~X~%" (-> this buzz-time)) + (format #t "~1Tbuzz: ~A~%" (-> this buzz)) + (format #t "~1Tbuzz-act: ~D~%" (-> this buzz-act)) + (format #t "~1Tchange-time: ~D~%" (-> this change-time)) + (format #t "~1Told-rightx[2] @ #x~X~%" (-> this old-rightx)) + (format #t "~1Told-righty[2] @ #x~X~%" (-> this old-righty)) + (format #t "~1Told-leftx[2] @ #x~X~%" (-> this old-leftx)) + (format #t "~1Told-lefty[2] @ #x~X~%" (-> this old-lefty)) (label cfg-4) - obj + this ) ;; definition for function cpad-invalid! @@ -213,16 +213,16 @@ ) ;; definition for method 3 of type cpad-list -(defmethod inspect cpad-list ((obj cpad-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect cpad-list ((this cpad-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnum-cpads: ~D~%" (-> obj num-cpads)) - (format #t "~1Tcpads[2] @ #x~X~%" (-> obj cpads)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-cpads: ~D~%" (-> this num-cpads)) + (format #t "~1Tcpads[2] @ #x~X~%" (-> this cpads)) (label cfg-4) - obj + this ) ;; definition for method 0 of type cpad-list @@ -565,37 +565,37 @@ ) ;; definition for method 3 of type mouse-info -(defmethod inspect mouse-info ((obj mouse-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect mouse-info ((this mouse-info)) + (when (not this) + (set! this this) (goto cfg-7) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tactive: ~A~%" (-> obj active)) - (format #t "~1Tcursor: ~A~%" (-> obj cursor)) - (format #t "~1Tvalid: ~A~%" (-> obj valid)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tstatus: #x~X~%" (-> obj status)) - (format #t "~1Tbutton0: #x~X~%" (-> obj button0)) - (format #t "~1Tdeltax: ~D~%" (-> obj deltax)) - (format #t "~1Tdeltay: ~D~%" (-> obj deltay)) - (format #t "~1Twheel: ~D~%" (-> obj wheel)) - (format #t "~1Tchange-time: ~D~%" (-> obj change-time)) - (format #t "~1Tbutton0-abs[3] @ #x~X~%" (-> obj button0-abs)) - (format #t "~1Tbutton0-shadow-abs[1] @ #x~X~%" (-> obj button0-shadow-abs)) - (format #t "~1Tbutton0-rel[3] @ #x~X~%" (-> obj button0-rel)) - (format #t "~1Tpos[2] @ #x~X~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tactive: ~A~%" (-> this active)) + (format #t "~1Tcursor: ~A~%" (-> this cursor)) + (format #t "~1Tvalid: ~A~%" (-> this valid)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tstatus: #x~X~%" (-> this status)) + (format #t "~1Tbutton0: #x~X~%" (-> this button0)) + (format #t "~1Tdeltax: ~D~%" (-> this deltax)) + (format #t "~1Tdeltay: ~D~%" (-> this deltay)) + (format #t "~1Twheel: ~D~%" (-> this wheel)) + (format #t "~1Tchange-time: ~D~%" (-> this change-time)) + (format #t "~1Tbutton0-abs[3] @ #x~X~%" (-> this button0-abs)) + (format #t "~1Tbutton0-shadow-abs[1] @ #x~X~%" (-> this button0-shadow-abs)) + (format #t "~1Tbutton0-rel[3] @ #x~X~%" (-> this button0-rel)) + (format #t "~1Tpos[2] @ #x~X~%" (-> this pos)) (dotimes (s5-0 2) - (format #t "~T [~D]~1Tpos: ~`vector`P~%" s5-0 (-> obj pos s5-0)) + (format #t "~T [~D]~1Tpos: ~`vector`P~%" s5-0 (-> this pos s5-0)) ) - (format #t "~1Tposx: ~f~%" (-> obj posx)) - (format #t "~1Tposy: ~f~%" (-> obj posy)) - (format #t "~1Toldposx: ~f~%" (-> obj pos 1 x)) - (format #t "~1Toldposy: ~f~%" (-> obj oldposy)) - (format #t "~1Tspeedx: ~f~%" (-> obj speedx)) - (format #t "~1Tspeedy: ~f~%" (-> obj speedy)) + (format #t "~1Tposx: ~f~%" (-> this posx)) + (format #t "~1Tposy: ~f~%" (-> this posy)) + (format #t "~1Toldposx: ~f~%" (-> this pos 1 x)) + (format #t "~1Toldposy: ~f~%" (-> this oldposy)) + (format #t "~1Tspeedx: ~f~%" (-> this speedx)) + (format #t "~1Tspeedy: ~f~%" (-> this speedy)) (label cfg-7) - obj + this ) ;; definition for method 0 of type mouse-info diff --git a/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc index 7b594c69d8..1b00f6f477 100644 --- a/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc @@ -19,20 +19,20 @@ ) ;; definition for method 3 of type rpc-buffer -(defmethod inspect rpc-buffer ((obj rpc-buffer)) - (when (not obj) - (set! obj obj) +(defmethod inspect rpc-buffer ((this rpc-buffer)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Telt-size: ~D~%" (-> obj elt-size)) - (format #t "~1Telt-count: ~D~%" (-> obj elt-count)) - (format #t "~1Telt-used: ~D~%" (-> obj elt-used)) - (format #t "~1Tbusy: ~A~%" (-> obj busy)) - (format #t "~1Tbase: ~D~%" (-> obj base)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Telt-size: ~D~%" (-> this elt-size)) + (format #t "~1Telt-count: ~D~%" (-> this elt-count)) + (format #t "~1Telt-used: ~D~%" (-> this elt-used)) + (format #t "~1Tbusy: ~A~%" (-> this busy)) + (format #t "~1Tbase: ~D~%" (-> this base)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for method 0 of type rpc-buffer @@ -71,18 +71,18 @@ ) ;; definition for method 3 of type rpc-buffer-pair -(defmethod inspect rpc-buffer-pair ((obj rpc-buffer-pair)) - (when (not obj) - (set! obj obj) +(defmethod inspect rpc-buffer-pair ((this rpc-buffer-pair)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tbuffer[2] @ #x~X~%" (-> obj buffer)) - (format #t "~1Tcurrent: ~A~%" (-> obj current)) - (format #t "~1Tlast-recv-buffer: #x~X~%" (-> obj last-recv-buffer)) - (format #t "~1Trpc-port: ~D~%" (-> obj rpc-port)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tbuffer[2] @ #x~X~%" (-> this buffer)) + (format #t "~1Tcurrent: ~A~%" (-> this current)) + (format #t "~1Tlast-recv-buffer: #x~X~%" (-> this last-recv-buffer)) + (format #t "~1Trpc-port: ~D~%" (-> this rpc-port)) (label cfg-4) - obj + this ) ;; definition for method 0 of type rpc-buffer-pair @@ -98,19 +98,19 @@ ) ;; definition for method 12 of type rpc-buffer-pair -(defmethod sync rpc-buffer-pair ((obj rpc-buffer-pair) (arg0 symbol)) - (let ((s5-0 (if (= (-> obj current) (-> obj buffer 0)) - (-> obj buffer 1) - (-> obj buffer 0) +(defmethod sync rpc-buffer-pair ((this rpc-buffer-pair) (arg0 symbol)) + (let ((s5-0 (if (= (-> this current) (-> this buffer 0)) + (-> this buffer 1) + (-> this buffer 0) ) ) ) (when (-> s5-0 busy) - (when (nonzero? (rpc-busy? (-> obj rpc-port))) + (when (nonzero? (rpc-busy? (-> this rpc-port))) (if arg0 - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) ) - (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (while (nonzero? (rpc-busy? (-> this rpc-port))) (nop!) (nop!) (nop!) @@ -130,15 +130,15 @@ ) ;; definition for method 13 of type rpc-buffer-pair -(defmethod check-busy rpc-buffer-pair ((obj rpc-buffer-pair)) - (let ((gp-0 (if (= (-> obj current) (-> obj buffer 0)) - (-> obj buffer 1) - (-> obj buffer 0) +(defmethod check-busy rpc-buffer-pair ((this rpc-buffer-pair)) + (let ((gp-0 (if (= (-> this current) (-> this buffer 0)) + (-> this buffer 1) + (-> this buffer 0) ) ) ) (when (-> gp-0 busy) - (if (nonzero? (rpc-busy? (-> obj rpc-port))) + (if (nonzero? (rpc-busy? (-> this rpc-port))) (return #t) ) (set! (-> gp-0 busy) #f) @@ -150,18 +150,18 @@ ) ;; definition for method 9 of type rpc-buffer-pair -(defmethod call rpc-buffer-pair ((obj rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) - (when (nonzero? (-> obj current elt-used)) - (let ((s2-0 (if (= (-> obj current) (-> obj buffer 0)) - (-> obj buffer 1) - (-> obj buffer 0) +(defmethod call rpc-buffer-pair ((this rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) + (when (nonzero? (-> this current elt-used)) + (let ((s2-0 (if (= (-> this current) (-> this buffer 0)) + (-> this buffer 1) + (-> this buffer 0) ) ) ) (when (-> s2-0 busy) - (when (nonzero? (rpc-busy? (-> obj rpc-port))) - (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) - (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (when (nonzero? (rpc-busy? (-> this rpc-port))) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> this rpc-port)) + (while (nonzero? (rpc-busy? (-> this rpc-port))) (nop!) (nop!) (nop!) @@ -176,9 +176,9 @@ (set! (-> s2-0 elt-used) (the-as uint 0)) 0 ) - (let ((s1-0 (-> obj current))) + (let ((s1-0 (-> this current))) (rpc-call - (-> obj rpc-port) + (-> this rpc-port) arg0 (the-as uint 1) (the-as uint (-> s1-0 base)) @@ -188,30 +188,30 @@ ) (set! (-> s1-0 busy) (the-as basic #t)) ) - (set! (-> obj last-recv-buffer) arg1) - (set! (-> obj current) s2-0) + (set! (-> this last-recv-buffer) arg1) + (set! (-> this current) s2-0) ) ) 0 ) ;; definition for method 14 of type rpc-buffer-pair -(defmethod pop-last-received rpc-buffer-pair ((obj rpc-buffer-pair)) - (let ((v0-0 (-> obj last-recv-buffer))) - (set! (-> obj last-recv-buffer) (the-as pointer #f)) +(defmethod pop-last-received rpc-buffer-pair ((this rpc-buffer-pair)) + (let ((v0-0 (-> this last-recv-buffer))) + (set! (-> this last-recv-buffer) (the-as pointer #f)) v0-0 ) ) ;; definition for method 10 of type rpc-buffer-pair -(defmethod add-element rpc-buffer-pair ((obj rpc-buffer-pair)) - (let ((v1-0 (-> obj current))) +(defmethod add-element rpc-buffer-pair ((this rpc-buffer-pair)) + (let ((v1-0 (-> this current))) (when (= (-> v1-0 elt-used) (-> v1-0 elt-count)) - (if (zero? (-> obj rpc-port)) + (if (zero? (-> this rpc-port)) (format 0 "WARNING: too many sound commands queued~%") ) - (call obj (the-as uint 0) (the-as pointer 0) (the-as uint 0)) - (set! v1-0 (-> obj current)) + (call this (the-as uint 0) (the-as pointer 0) (the-as uint 0)) + (set! v1-0 (-> this current)) ) (let ((v0-2 (&+ (-> v1-0 base) (* (-> v1-0 elt-used) (-> v1-0 elt-size))))) (+! (-> v1-0 elt-used) 1) @@ -221,16 +221,12 @@ ) ;; definition for method 11 of type rpc-buffer-pair -(defmethod decrement-elt-used rpc-buffer-pair ((obj rpc-buffer-pair)) - (if (> (-> obj current elt-used) 0) - (+! (-> obj current elt-used) -1) +(defmethod decrement-elt-used rpc-buffer-pair ((this rpc-buffer-pair)) + (if (> (-> this current elt-used) 0) + (+! (-> this current elt-used) -1) ) 0 ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc index ae62c6496e..1718242b98 100644 --- a/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc @@ -31,17 +31,17 @@ ) ;; definition for method 3 of type timer-bank -(defmethod inspect timer-bank ((obj timer-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect timer-bank ((this timer-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'timer-bank) - (format #t "~1Tcount: #x~X~%" (-> obj count)) - (format #t "~1Tmode: #x~X~%" (-> obj mode)) - (format #t "~1Tcomp: #x~X~%" (-> obj comp)) + (format #t "[~8x] ~A~%" this 'timer-bank) + (format #t "~1Tcount: #x~X~%" (-> this count)) + (format #t "~1Tmode: #x~X~%" (-> this mode)) + (format #t "~1Tcomp: #x~X~%" (-> this comp)) (label cfg-4) - obj + this ) ;; definition of type timer-hold-bank @@ -54,18 +54,18 @@ ) ;; definition for method 3 of type timer-hold-bank -(defmethod inspect timer-hold-bank ((obj timer-hold-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect timer-hold-bank ((this timer-hold-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'timer-hold-bank) - (format #t "~1Tcount: #x~X~%" (-> obj count)) - (format #t "~1Tmode: #x~X~%" (-> obj mode)) - (format #t "~1Tcomp: #x~X~%" (-> obj comp)) - (format #t "~1Thold: #x~X~%" (-> obj hold)) + (format #t "[~8x] ~A~%" this 'timer-hold-bank) + (format #t "~1Tcount: #x~X~%" (-> this count)) + (format #t "~1Tmode: #x~X~%" (-> this mode)) + (format #t "~1Tcomp: #x~X~%" (-> this comp)) + (format #t "~1Thold: #x~X~%" (-> this hold)) (label cfg-4) - obj + this ) ;; definition of type stopwatch @@ -80,17 +80,17 @@ ) ;; definition for method 3 of type stopwatch -(defmethod inspect stopwatch ((obj stopwatch)) - (when (not obj) - (set! obj obj) +(defmethod inspect stopwatch ((this stopwatch)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-time-elapsed: ~D~%" (-> obj prev-time-elapsed)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Tbegin-level: ~D~%" (-> obj begin-level)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-time-elapsed: ~D~%" (-> this prev-time-elapsed)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tbegin-level: ~D~%" (-> this begin-level)) (label cfg-4) - obj + this ) ;; definition for symbol *ticks-per-frame*, type int @@ -111,7 +111,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc index cfe9d19ba1..01a8d285c7 100644 --- a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc @@ -138,85 +138,85 @@ ) ;; definition for method 9 of type clock -(defmethod update-rates! clock ((obj clock) (arg0 float)) - (set! (-> obj clock-ratio) arg0) +(defmethod update-rates! clock ((this clock) (arg0 float)) + (set! (-> this clock-ratio) arg0) (let ((f0-6 (if (nonzero? *display*) (* (-> *display* time-factor) (-> *display* dog-ratio) arg0) (* 5.0 arg0) ) ) ) - (set! (-> obj time-adjust-ratio) (* 0.2 f0-6)) + (set! (-> this time-adjust-ratio) (* 0.2 f0-6)) ) - (set! (-> obj seconds-per-frame) (* 0.016666668 (-> obj time-adjust-ratio))) - (set! (-> obj frames-per-second) (if (= (-> obj time-adjust-ratio) 0.0) - 0.0 - (* 60.0 (/ 1.0 (-> obj time-adjust-ratio))) - ) + (set! (-> this seconds-per-frame) (* 0.016666668 (-> this time-adjust-ratio))) + (set! (-> this frames-per-second) (if (= (-> this time-adjust-ratio) 0.0) + 0.0 + (* 60.0 (/ 1.0 (-> this time-adjust-ratio))) + ) ) - (let* ((v1-12 (- (-> obj frame-counter) (-> obj old-frame-counter))) + (let* ((v1-12 (- (-> this frame-counter) (-> this old-frame-counter))) (f0-14 (gpr->fpr v1-12)) (f1-9 (* 0.2 (the float v1-12))) ) - (set-vector! (-> obj sparticle-data) (the-as float f0-14) (* 5.0 f1-9) f1-9 f1-9) + (set-vector! (-> this sparticle-data) (the-as float f0-14) (* 5.0 f1-9) f1-9 f1-9) ) arg0 ) ;; definition for method 10 of type clock -(defmethod advance-by! clock ((obj clock) (arg0 float)) - (the int (+ arg0 (-> obj accum))) - (+! (-> obj integral-accum) arg0) - (set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter)) - (while (>= (-> obj integral-accum) (-> *display* time-factor)) - (+! (-> obj integral-frame-counter) 1) - (set! (-> obj integral-accum) (- (-> obj integral-accum) (-> *display* time-factor))) +(defmethod advance-by! clock ((this clock) (arg0 float)) + (the int (+ arg0 (-> this accum))) + (+! (-> this integral-accum) arg0) + (set! (-> this old-integral-frame-counter) (-> this integral-frame-counter)) + (while (>= (-> this integral-accum) (-> *display* time-factor)) + (+! (-> this integral-frame-counter) 1) + (set! (-> this integral-accum) (- (-> this integral-accum) (-> *display* time-factor))) ) - (let ((v1-7 (the int (+ arg0 (-> obj accum))))) - (set! (-> obj accum) (- (+ arg0 (-> obj accum)) (the float v1-7))) - (set! (-> obj old-frame-counter) (-> obj frame-counter)) - (+! (-> obj frame-counter) v1-7) + (let ((v1-7 (the int (+ arg0 (-> this accum))))) + (set! (-> this accum) (- (+ arg0 (-> this accum)) (the float v1-7))) + (set! (-> this old-frame-counter) (-> this frame-counter)) + (+! (-> this frame-counter) v1-7) ) - (update-rates! obj (-> obj clock-ratio)) - obj + (update-rates! this (-> this clock-ratio)) + this ) ;; definition for method 11 of type clock -(defmethod tick! clock ((obj clock)) - (if (not (logtest? (-> obj mask) (-> *kernel-context* prevent-from-run))) - (advance-by! obj (* (-> *display* time-factor) (-> *display* dog-ratio) (-> obj clock-ratio))) - (set! (-> obj sparticle-data x) 0.0) +(defmethod tick! clock ((this clock)) + (if (not (logtest? (-> this mask) (-> *kernel-context* prevent-from-run))) + (advance-by! this (* (-> *display* time-factor) (-> *display* dog-ratio) (-> this clock-ratio))) + (set! (-> this sparticle-data x) 0.0) ) - obj + this ) ;; definition for method 14 of type clock ;; WARN: Return type mismatch int vs none. -(defmethod reset! clock ((obj clock)) - (set! (-> obj frame-counter) (seconds 1000)) - (set! (-> obj integral-frame-counter) (the-as uint #x493e0)) - (set! (-> obj accum) 0.0) - (set! (-> obj old-frame-counter) (+ (-> obj frame-counter) -1)) - (set! (-> obj old-integral-frame-counter) (+ (-> obj integral-frame-counter) -1)) - (update-rates! obj 1.0) +(defmethod reset! clock ((this clock)) + (set! (-> this frame-counter) (seconds 1000)) + (set! (-> this integral-frame-counter) (the-as uint #x493e0)) + (set! (-> this accum) 0.0) + (set! (-> this old-frame-counter) (+ (-> this frame-counter) -1)) + (set! (-> this old-integral-frame-counter) (+ (-> this integral-frame-counter) -1)) + (update-rates! this 1.0) 0 (none) ) ;; definition for method 12 of type clock -(defmethod save! clock ((obj clock) (arg0 (pointer uint64))) - (set! (-> arg0 0) (the-as uint (-> obj frame-counter))) - (set! (-> arg0 1) (-> obj integral-frame-counter)) +(defmethod save! clock ((this clock) (arg0 (pointer uint64))) + (set! (-> arg0 0) (the-as uint (-> this frame-counter))) + (set! (-> arg0 1) (-> this integral-frame-counter)) 16 ) ;; definition for method 13 of type clock -(defmethod load! clock ((obj clock) (arg0 (pointer uint64))) - (set! (-> obj frame-counter) (the-as time-frame (-> arg0 0))) - (set! (-> obj integral-frame-counter) (-> arg0 1)) - (set! (-> obj accum) 0.0) - (set! (-> obj integral-accum) 0.0) - (set! (-> obj old-frame-counter) (-> obj frame-counter)) - (set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter)) +(defmethod load! clock ((this clock) (arg0 (pointer uint64))) + (set! (-> this frame-counter) (the-as time-frame (-> arg0 0))) + (set! (-> this integral-frame-counter) (-> arg0 1)) + (set! (-> this accum) 0.0) + (set! (-> this integral-accum) 0.0) + (set! (-> this old-frame-counter) (-> this frame-counter)) + (set! (-> this old-integral-frame-counter) (-> this integral-frame-counter)) 16 ) diff --git a/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc index 6b74e546e5..edb6cacc8e 100644 --- a/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc @@ -20,24 +20,24 @@ ) ;; definition for method 3 of type vif-stat -(defmethod inspect vif-stat ((obj vif-stat)) - (when (not obj) - (set! obj obj) +(defmethod inspect vif-stat ((this vif-stat)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vif-stat) - (format #t "~1Tvps: ~D~%" (-> obj vps)) - (format #t "~1Tvew: ~D~%" (-> obj vew)) - (format #t "~1Tmrk: ~D~%" (-> obj mrk)) - (format #t "~1Tvss: ~D~%" (-> obj vss)) - (format #t "~1Tvfs: ~D~%" (-> obj vfs)) - (format #t "~1Tvis: ~D~%" (-> obj vis)) - (format #t "~1Tint: ~D~%" (-> obj int)) - (format #t "~1Ter0: ~D~%" (-> obj er0)) - (format #t "~1Ter1: ~D~%" (-> obj er1)) - (format #t "~1Tfqc: ~D~%" (-> obj fqc)) + (format #t "[~8x] ~A~%" this 'vif-stat) + (format #t "~1Tvps: ~D~%" (-> this vps)) + (format #t "~1Tvew: ~D~%" (-> this vew)) + (format #t "~1Tmrk: ~D~%" (-> this mrk)) + (format #t "~1Tvss: ~D~%" (-> this vss)) + (format #t "~1Tvfs: ~D~%" (-> this vfs)) + (format #t "~1Tvis: ~D~%" (-> this vis)) + (format #t "~1Tint: ~D~%" (-> this int)) + (format #t "~1Ter0: ~D~%" (-> this er0)) + (format #t "~1Ter1: ~D~%" (-> this er1)) + (format #t "~1Tfqc: ~D~%" (-> this fqc)) (label cfg-4) - obj + this ) ;; definition of type vif-fbrst @@ -95,42 +95,38 @@ ) ;; definition for method 3 of type vif-bank -(defmethod inspect vif-bank ((obj vif-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect vif-bank ((this vif-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vif-bank) - (format #t "~1Tstat: #x~X~%" (-> obj stat)) - (format #t "~1Tfbrst: #x~X~%" (-> obj fbrst)) - (format #t "~1Terr: #x~X~%" (-> obj err)) - (format #t "~1Tmark: #x~X~%" (-> obj mark)) - (format #t "~1Tcycle: #x~X~%" (-> obj cycle)) - (format #t "~1Tmode: #x~X~%" (-> obj mode)) - (format #t "~1Tnum: #x~X~%" (-> obj num)) - (format #t "~1Tmask: #x~X~%" (-> obj mask)) - (format #t "~1Tcode: #x~X~%" (-> obj code)) - (format #t "~1Titops: #x~X~%" (-> obj itops)) - (format #t "~1Tbase: #x~X~%" (-> obj base)) - (format #t "~1Toffset: #x~X~%" (-> obj offset)) - (format #t "~1Ttops: #x~X~%" (-> obj tops)) - (format #t "~1Titop: #x~X~%" (-> obj itop)) - (format #t "~1Ttop: #x~X~%" (-> obj top)) - (format #t "~1Tr0: #x~X~%" (-> obj r0)) - (format #t "~1Tr1: #x~X~%" (-> obj r1)) - (format #t "~1Tr2: #x~X~%" (-> obj r2)) - (format #t "~1Tr3: #x~X~%" (-> obj r3)) - (format #t "~1Tc0: #x~X~%" (-> obj c0)) - (format #t "~1Tc1: #x~X~%" (-> obj c1)) - (format #t "~1Tc2: #x~X~%" (-> obj c2)) - (format #t "~1Tc3: #x~X~%" (-> obj c3)) + (format #t "[~8x] ~A~%" this 'vif-bank) + (format #t "~1Tstat: #x~X~%" (-> this stat)) + (format #t "~1Tfbrst: #x~X~%" (-> this fbrst)) + (format #t "~1Terr: #x~X~%" (-> this err)) + (format #t "~1Tmark: #x~X~%" (-> this mark)) + (format #t "~1Tcycle: #x~X~%" (-> this cycle)) + (format #t "~1Tmode: #x~X~%" (-> this mode)) + (format #t "~1Tnum: #x~X~%" (-> this num)) + (format #t "~1Tmask: #x~X~%" (-> this mask)) + (format #t "~1Tcode: #x~X~%" (-> this code)) + (format #t "~1Titops: #x~X~%" (-> this itops)) + (format #t "~1Tbase: #x~X~%" (-> this base)) + (format #t "~1Toffset: #x~X~%" (-> this offset)) + (format #t "~1Ttops: #x~X~%" (-> this tops)) + (format #t "~1Titop: #x~X~%" (-> this itop)) + (format #t "~1Ttop: #x~X~%" (-> this top)) + (format #t "~1Tr0: #x~X~%" (-> this r0)) + (format #t "~1Tr1: #x~X~%" (-> this r1)) + (format #t "~1Tr2: #x~X~%" (-> this r2)) + (format #t "~1Tr3: #x~X~%" (-> this r3)) + (format #t "~1Tc0: #x~X~%" (-> this c0)) + (format #t "~1Tc1: #x~X~%" (-> this c1)) + (format #t "~1Tc2: #x~X~%" (-> this c2)) + (format #t "~1Tc3: #x~X~%" (-> this c3)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc index 57b617abf3..b8fe0f37fa 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc @@ -30,31 +30,31 @@ ) ;; definition for method 3 of type scene-actor -(defmethod inspect scene-actor ((obj scene-actor)) - (when (not obj) - (set! obj obj) +(defmethod inspect scene-actor ((this scene-actor)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tart-group: ~A~%" (-> obj art-group)) - (format #t "~1Tprefix: ~A~%" (-> obj prefix)) - (format #t "~1Tdraw-frames: ~A~%" (-> obj draw-frames)) - (format #t "~1Tscissor-frames: ~A~%" (-> obj scissor-frames)) - (format #t "~1Tcamera: ~D~%" (-> obj camera)) - (format #t "~1Tlight-index: ~D~%" (-> obj light-index)) - (format #t "~1Tshadow-mask: ~D~%" (-> obj shadow-mask)) - (format #t "~1Tshadow-values: ~D~%" (-> obj shadow-values)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tcommand-list: ~A~%" (-> obj command-list)) - (format #t "~1Tshadow-flags: ~D~%" (-> obj shadow-flags)) - (format #t "~1Tshadow-volume-joint: ~A~%" (-> obj shadow-volume-joint)) - (format #t "~1Tdraw-seg: ~D~%" (-> obj draw-seg)) - (format #t "~1Tno-draw-seg: ~D~%" (-> obj no-draw-seg)) - (format #t "~1Tprocess: ~D~%" (-> obj process)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tart-group: ~A~%" (-> this art-group)) + (format #t "~1Tprefix: ~A~%" (-> this prefix)) + (format #t "~1Tdraw-frames: ~A~%" (-> this draw-frames)) + (format #t "~1Tscissor-frames: ~A~%" (-> this scissor-frames)) + (format #t "~1Tcamera: ~D~%" (-> this camera)) + (format #t "~1Tlight-index: ~D~%" (-> this light-index)) + (format #t "~1Tshadow-mask: ~D~%" (-> this shadow-mask)) + (format #t "~1Tshadow-values: ~D~%" (-> this shadow-values)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tcommand-list: ~A~%" (-> this command-list)) + (format #t "~1Tshadow-flags: ~D~%" (-> this shadow-flags)) + (format #t "~1Tshadow-volume-joint: ~A~%" (-> this shadow-volume-joint)) + (format #t "~1Tdraw-seg: ~D~%" (-> this draw-seg)) + (format #t "~1Tno-draw-seg: ~D~%" (-> this no-draw-seg)) + (format #t "~1Tprocess: ~D~%" (-> this process)) (label cfg-4) - obj + this ) ;; definition of type scene @@ -98,43 +98,43 @@ ) ;; definition for method 3 of type scene -(defmethod inspect scene ((obj scene)) - (when (not obj) - (set! obj obj) +(defmethod inspect scene ((this scene)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Textra: ~A~%" (-> obj extra)) - (format #t "~1Tinfo: ~A~%" (-> obj info)) - (format #t "~1Tdata[0] @ #x~X~%" (&-> obj mask-to-clear)) - (format #t "~1Tmask-to-clear: ~D~%" (-> obj mask-to-clear)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tart-group: ~A~%" (-> obj art-group)) - (format #t "~1Tanim: ~A~%" (-> obj anim)) - (format #t "~1Tparts: ~D~%" (-> obj parts)) - (format #t "~1Tcommand-list: ~A~%" (-> obj command-list)) - (format #t "~1Tcut-list: ~A~%" (-> obj cut-list)) - (format #t "~1Twait-max-time: ~D~%" (-> obj wait-max-time)) - (format #t "~1Twait-air-time: ~D~%" (-> obj wait-air-time)) - (format #t "~1Twait-ground-time: ~D~%" (-> obj wait-ground-time)) - (format #t "~1Tdraw-target: ~A~%" (-> obj draw-target)) - (format #t "~1Tabort: ~A~%" (-> obj abort)) - (format #t "~1Tactor: ~A~%" (-> obj actor)) - (format #t "~1Tload-point: ~A~%" (-> obj load-point-obj)) - (format #t "~1Tend-point: ~A~%" (-> obj end-point-obj)) - (format #t "~1Tborrow: ~A~%" (-> obj borrow)) - (format #t "~1Tsfx-volume: ~f~%" (-> obj sfx-volume)) - (format #t "~1Tambient-volume: ~f~%" (-> obj ambient-volume)) - (format #t "~1Tmusic-volume: ~f~%" (-> obj music-volume)) - (format #t "~1Tblackout-end: ~A~%" (-> obj blackout-end)) - (format #t "~1Tpeaceful: ~A~%" (-> obj peaceful)) - (format #t "~1Tmusic-delay: ~f~%" (-> obj music-delay)) - (format #t "~1Tsave: ~A~%" (-> obj save)) - (format #t "~1Tscene-task: ~D~%" (-> obj scene-task)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Textra: ~A~%" (-> this extra)) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (format #t "~1Tdata[0] @ #x~X~%" (&-> this mask-to-clear)) + (format #t "~1Tmask-to-clear: ~D~%" (-> this mask-to-clear)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tart-group: ~A~%" (-> this art-group)) + (format #t "~1Tanim: ~A~%" (-> this anim)) + (format #t "~1Tparts: ~D~%" (-> this parts)) + (format #t "~1Tcommand-list: ~A~%" (-> this command-list)) + (format #t "~1Tcut-list: ~A~%" (-> this cut-list)) + (format #t "~1Twait-max-time: ~D~%" (-> this wait-max-time)) + (format #t "~1Twait-air-time: ~D~%" (-> this wait-air-time)) + (format #t "~1Twait-ground-time: ~D~%" (-> this wait-ground-time)) + (format #t "~1Tdraw-target: ~A~%" (-> this draw-target)) + (format #t "~1Tabort: ~A~%" (-> this abort)) + (format #t "~1Tactor: ~A~%" (-> this actor)) + (format #t "~1Tload-point: ~A~%" (-> this load-point-obj)) + (format #t "~1Tend-point: ~A~%" (-> this end-point-obj)) + (format #t "~1Tborrow: ~A~%" (-> this borrow)) + (format #t "~1Tsfx-volume: ~f~%" (-> this sfx-volume)) + (format #t "~1Tambient-volume: ~f~%" (-> this ambient-volume)) + (format #t "~1Tmusic-volume: ~f~%" (-> this music-volume)) + (format #t "~1Tblackout-end: ~A~%" (-> this blackout-end)) + (format #t "~1Tpeaceful: ~A~%" (-> this peaceful)) + (format #t "~1Tmusic-delay: ~f~%" (-> this music-delay)) + (format #t "~1Tsave: ~A~%" (-> this save)) + (format #t "~1Tscene-task: ~D~%" (-> this scene-task)) (label cfg-4) - obj + this ) ;; definition of type scene-player @@ -178,38 +178,38 @@ ) ;; definition for method 3 of type scene-player -(defmethod inspect scene-player ((obj scene-player)) - (when (not obj) - (set! obj obj) +(defmethod inspect scene-player ((this scene-player)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tscene-list: ~A~%" (-> obj scene-list)) - (format #t "~2Tscene: ~A~%" (-> obj scene)) - (format #t "~2Tscene-index: ~D~%" (-> obj scene-index)) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tnext-anim: ~A~%" (-> obj next-anim)) - (format #t "~2Tcamera: ~D~%" (-> obj camera)) - (format #t "~2Tmain-entity: ~A~%" (-> obj main-entity)) - (format #t "~2Twait: ~A~%" (-> obj wait)) - (format #t "~2Told-target-pos: #~%" (-> obj old-target-pos)) - (format #t "~2Tpre-cut-frame: ~A~%" (-> obj pre-cut-frame)) - (format #t "~2Tpreload-continue: ~A~%" (-> obj preload-continue)) - (format #t "~2Tdma-max: ~D~%" (-> obj dma-max)) - (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) - (format #t "~2Taborted?: ~A~%" (-> obj aborted?)) - (format #t "~2Tscene-start-time: ~D~%" (-> obj scene-start-time)) - (format #t "~2Ttarg-speed: ~f~%" (-> obj targ-speed)) - (format #t "~2Tcur-speed: ~f~%" (-> obj cur-speed)) - (format #t "~2Tspeed-change-time: ~D~%" (-> obj speed-change-time)) - (format #t "~2Tspeed-press-time: ~D~%" (-> obj speed-press-time)) - (format #t "~2Tspeed-change-speed: ~f~%" (-> obj speed-change-speed)) - (format #t "~2Tsubtitle-change-time: ~D~%" (-> obj subtitle-change-time)) - (format #t "~2Tuser-sound[4] @ #x~X~%" (-> obj user-sound)) + (format #t "~2Tscene-list: ~A~%" (-> this scene-list)) + (format #t "~2Tscene: ~A~%" (-> this scene)) + (format #t "~2Tscene-index: ~D~%" (-> this scene-index)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tnext-anim: ~A~%" (-> this next-anim)) + (format #t "~2Tcamera: ~D~%" (-> this camera)) + (format #t "~2Tmain-entity: ~A~%" (-> this main-entity)) + (format #t "~2Twait: ~A~%" (-> this wait)) + (format #t "~2Told-target-pos: #~%" (-> this old-target-pos)) + (format #t "~2Tpre-cut-frame: ~A~%" (-> this pre-cut-frame)) + (format #t "~2Tpreload-continue: ~A~%" (-> this preload-continue)) + (format #t "~2Tdma-max: ~D~%" (-> this dma-max)) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) + (format #t "~2Taborted?: ~A~%" (-> this aborted?)) + (format #t "~2Tscene-start-time: ~D~%" (-> this scene-start-time)) + (format #t "~2Ttarg-speed: ~f~%" (-> this targ-speed)) + (format #t "~2Tcur-speed: ~f~%" (-> this cur-speed)) + (format #t "~2Tspeed-change-time: ~D~%" (-> this speed-change-time)) + (format #t "~2Tspeed-press-time: ~D~%" (-> this speed-press-time)) + (format #t "~2Tspeed-change-speed: ~f~%" (-> this speed-change-speed)) + (format #t "~2Tsubtitle-change-time: ~D~%" (-> this subtitle-change-time)) + (format #t "~2Tuser-sound[4] @ #x~X~%" (-> this user-sound)) (label cfg-4) - obj + this ) ;; definition for symbol *scene-player*, type (pointer scene-player) diff --git a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc index 521ce47d9e..7bcd3a656f 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc @@ -10,15 +10,15 @@ ) ;; definition for method 3 of type scene-stage -(defmethod inspect scene-stage ((obj scene-stage)) - (when (not obj) - (set! obj obj) +(defmethod inspect scene-stage ((this scene-stage)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) (format #t "process-tree ") ) @@ -117,49 +117,49 @@ ) ) (format #t ")~%") - (format #t "~1Tclock: ~A~%" (-> obj clock)) - (format #t "~1Tparent: #x~X~%" (-> obj parent)) - (format #t "~1Tbrother: #x~X~%" (-> obj brother)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) - (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tstatus: ~A~%" (-> obj status)) - (format #t "~1Tpid: ~D~%" (-> obj pid)) - (format #t "~1Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~1Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tstate: ~A~%" (-> obj state)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~1Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~1Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~1Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~1Theap-cur: #x~X~%" (-> obj heap-cur)) - (format #t "~1Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~1Theap: #~%" (&-> obj heap-base)) - (format #t "~1Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tstatus: ~A~%" (-> this status)) + (format #t "~1Tpid: ~D~%" (-> this pid)) + (format #t "~1Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tstate: ~A~%" (-> this state)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> this heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~1Theap: #~%" (&-> this heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) (label cfg-68) - obj + this ) ;; definition for method 2 of type scene -(defmethod print scene ((obj scene)) - (format #t "#" (-> obj art-group) (-> obj anim) obj) - obj +(defmethod print scene ((this scene)) + (format #t "#" (-> this art-group) (-> this anim) this) + this ) ;; definition for method 15 of type scene ;; WARN: Return type mismatch spool-anim vs none. -(defmethod scene-method-15 scene ((obj scene) (arg0 spool-anim)) - (set! (-> arg0 name) (-> obj anim)) - (set! (-> arg0 anim-name) (-> obj anim)) - (set! (-> arg0 parts) (-> obj parts)) - (set! (-> arg0 command-list) (-> obj command-list)) +(defmethod scene-method-15 scene ((this scene) (arg0 spool-anim)) + (set! (-> arg0 name) (-> this anim)) + (set! (-> arg0 anim-name) (-> this anim)) + (set! (-> arg0 parts) (-> this parts)) + (set! (-> arg0 command-list) (-> this command-list)) (none) ) @@ -185,10 +185,10 @@ ;; definition for method 9 of type scene-actor ;; INFO: Used lq/sq -(defmethod scene-actor-method-9 scene-actor ((obj scene-actor) (arg0 scene-player)) +(defmethod scene-actor-method-9 scene-actor ((this scene-actor) (arg0 scene-player)) (local-vars (s4-0 (pointer process)) (sv-96 process) (sv-112 process)) - (let ((s1-0 (if (-> obj level) - (level-get *level* (-> obj level)) + (let ((s1-0 (if (-> this level) + (level-get *level* (-> this level)) (-> *level* default-level) ) ) @@ -206,16 +206,16 @@ (goto cfg-211) ) ) - (let* ((s4-1 (art-group-get-by-name *level* (-> obj art-group) (the-as (pointer uint32) #f))) + (let* ((s4-1 (art-group-get-by-name *level* (-> this art-group) (the-as (pointer uint32) #f))) (s2-0 (if (type? s4-1 skeleton-group) (the-as skeleton-group s4-1) ) ) (s0-0 (-> arg0 level)) (s3-0 - (or (string= (-> obj name) "jak-highres") - (string= (-> obj name) "jak-highres-prison") - (string= (-> obj name) "darkjak-highres") + (or (string= (-> this name) "jak-highres") + (string= (-> this name) "jak-highres-prison") + (string= (-> this name) "darkjak-highres") ) ) ) @@ -231,7 +231,7 @@ (set! sv-96 (get-process *default-dead-pool* manipy #x4000)) (set! s4-0 (when sv-96 (let ((t9-7 (method-of-type manipy activate))) - (t9-7 (the-as manipy sv-96) arg0 (-> obj name) (the-as pointer #x70004000)) + (t9-7 (the-as manipy sv-96) arg0 (-> this name) (the-as pointer #x70004000)) ) (run-now-in-process sv-96 @@ -251,31 +251,31 @@ (set! (-> arg0 level) s0-0) (send-event (ppointer->process s4-0) 'anim-mode 'clone-anim) (send-event (ppointer->process s4-0) 'blend-shape #t) - (send-event (ppointer->process s4-0) 'prefix (-> obj prefix)) + (send-event (ppointer->process s4-0) 'prefix (-> this prefix)) (cond - ((zero? (-> obj light-index)) + ((zero? (-> this light-index)) (if (zero? (-> s2-0 light-index)) (send-event (ppointer->process s4-0) 'light-index 80) ) ) (else - (send-event (ppointer->process s4-0) 'light-index (* (-> obj light-index) 8)) + (send-event (ppointer->process s4-0) 'light-index (* (-> this light-index) 8)) ) ) - (if (nonzero? (-> obj shadow-mask)) - (send-event (ppointer->process s4-0) 'shadow-mask (* (-> obj shadow-mask) 8)) + (if (nonzero? (-> this shadow-mask)) + (send-event (ppointer->process s4-0) 'shadow-mask (* (-> this shadow-mask) 8)) ) - (if (nonzero? (-> obj shadow-values)) - (send-event (ppointer->process s4-0) 'shadow-values (* (-> obj shadow-values) 8)) + (if (nonzero? (-> this shadow-values)) + (send-event (ppointer->process s4-0) 'shadow-values (* (-> this shadow-values) 8)) ) - (if (and s4-0 (not (logtest? (-> obj flags) 1)) (nonzero? (-> (the-as process-drawable (-> s4-0 0)) draw))) + (if (and s4-0 (not (logtest? (-> this flags) 1)) (nonzero? (-> (the-as process-drawable (-> s4-0 0)) draw))) (logior! (-> (the-as process-drawable (-> s4-0 0)) draw status) (draw-control-status no-draw-bounds)) ) - (if (-> obj shadow-volume-joint) - (send-event (ppointer->process s4-0) 'shadow-volume (-> obj shadow-volume-joint) (-> obj shadow-flags)) + (if (-> this shadow-volume-joint) + (send-event (ppointer->process s4-0) 'shadow-volume (-> this shadow-volume-joint) (-> this shadow-flags)) ) - (if (or (nonzero? (-> obj draw-seg)) (nonzero? (-> obj no-draw-seg))) - (send-event (ppointer->process s4-0) 'segment (* (-> obj draw-seg) 8) (* (-> obj no-draw-seg) 8)) + (if (or (nonzero? (-> this draw-seg)) (nonzero? (-> this no-draw-seg))) + (send-event (ppointer->process s4-0) 'segment (* (-> this draw-seg) 8) (* (-> this no-draw-seg) 8)) ) (when s3-0 (if (not (-> *setting-control* user-current beard)) @@ -304,11 +304,11 @@ ) ) ) - (when (and s4-0 (logtest? (-> obj flags) 2)) + (when (and s4-0 (logtest? (-> this flags) 2)) (set! sv-112 (get-process *default-dead-pool* manipy #x4000)) (let ((s0-1 (when sv-112 (let ((t9-24 (method-of-type manipy activate))) - (t9-24 (the-as manipy sv-112) (ppointer->process s4-0) (-> obj name) (the-as pointer #x70004000)) + (t9-24 (the-as manipy sv-112) (ppointer->process s4-0) (-> this name) (the-as pointer #x70004000)) ) (run-now-in-process sv-112 manipy-init (-> arg0 root trans) s1-1 s2-0 #f 0) (-> sv-112 ppointer) @@ -317,23 +317,23 @@ ) (send-event (ppointer->process s0-1) 'mirror #t) (send-event (ppointer->process s0-1) 'anim-mode 'mirror) - (if (nonzero? (-> obj light-index)) - (send-event (ppointer->process s0-1) 'light-index (* (-> obj light-index) 8)) + (if (nonzero? (-> this light-index)) + (send-event (ppointer->process s0-1) 'light-index (* (-> this light-index) 8)) ) - (if (nonzero? (-> obj shadow-mask)) - (send-event (ppointer->process s0-1) 'shadow-mask (* (-> obj shadow-mask) 8)) + (if (nonzero? (-> this shadow-mask)) + (send-event (ppointer->process s0-1) 'shadow-mask (* (-> this shadow-mask) 8)) ) - (if (nonzero? (-> obj shadow-values)) - (send-event (ppointer->process s0-1) 'shadow-values (* (-> obj shadow-values) 8)) + (if (nonzero? (-> this shadow-values)) + (send-event (ppointer->process s0-1) 'shadow-values (* (-> this shadow-values) 8)) ) - (if (and s0-1 (not (logtest? (-> obj flags) 1)) (nonzero? (-> (the-as process-drawable (-> s0-1 0)) draw))) + (if (and s0-1 (not (logtest? (-> this flags) 1)) (nonzero? (-> (the-as process-drawable (-> s0-1 0)) draw))) (logior! (-> (the-as process-drawable (-> s0-1 0)) draw status) (draw-control-status no-draw-bounds)) ) - (if (-> obj shadow-volume-joint) - (send-event (ppointer->process s0-1) 'shadow-volume (-> obj shadow-volume-joint) (-> obj shadow-flags)) + (if (-> this shadow-volume-joint) + (send-event (ppointer->process s0-1) 'shadow-volume (-> this shadow-volume-joint) (-> this shadow-flags)) ) - (if (or (nonzero? (-> obj draw-seg)) (nonzero? (-> obj no-draw-seg))) - (send-event (ppointer->process s0-1) 'segment (* (-> obj draw-seg) 8) (* (-> obj no-draw-seg) 8)) + (if (or (nonzero? (-> this draw-seg)) (nonzero? (-> this no-draw-seg))) + (send-event (ppointer->process s0-1) 'segment (* (-> this draw-seg) 8) (* (-> this no-draw-seg) 8)) ) (when s3-0 (if (not (-> *setting-control* user-current beard)) @@ -343,18 +343,18 @@ ) ) ) - (when (nonzero? (-> obj camera)) + (when (nonzero? (-> this camera)) (cond ((handle->process (-> arg0 camera)) (change-parent (handle->process (-> arg0 camera)) (ppointer->process s4-0)) (send-event (handle->process (-> arg0 camera)) 'target (ppointer->process s4-0)) - (send-event (handle->process (-> arg0 camera)) 'joint (* (-> obj camera) 8)) + (send-event (handle->process (-> arg0 camera)) 'joint (* (-> this camera) 8)) ) (else (set! (-> arg0 camera) (ppointer->handle (process-spawn othercam (ppointer->process s4-0) - (-> obj camera) + (-> this camera) #t 'scene-player :to (ppointer->process s4-0) @@ -374,40 +374,40 @@ ) ;; definition for method 10 of type scene-player -(defmethod deactivate scene-player ((obj scene-player)) +(defmethod deactivate scene-player ((this scene-player)) (set! *scene-player* (the-as (pointer scene-player) #f)) (kill-persister *setting-control* (the-as engine-pers 'blackout) 'bg-a-force) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type scene-player ;; WARN: Return type mismatch process-drawable vs scene-player. -(defmethod relocate scene-player ((obj scene-player) (arg0 int)) +(defmethod relocate scene-player ((this scene-player) (arg0 int)) (let ((v1-0 *kernel-context*)) - (set! (-> v1-0 relocating-process) obj) - (set! (-> v1-0 relocating-min) (the-as int (&-> obj type))) + (set! (-> v1-0 relocating-process) this) + (set! (-> v1-0 relocating-min) (the-as int (&-> this type))) (set! (-> v1-0 relocating-max) - (the-as int (+ (+ (-> obj allocated-length) -4 (-> process size)) (the-as int obj))) + (the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this))) ) (set! (-> v1-0 relocating-offset) arg0) ) - (let ((v1-2 (-> obj scene-list))) + (let ((v1-2 (-> this scene-list))) (if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min)) (< (the-as int v1-2) (-> *kernel-context* relocating-max)) ) - (&+! (-> obj scene-list) arg0) + (&+! (-> this scene-list) arg0) ) ) - (the-as scene-player ((method-of-type process-drawable relocate) obj arg0)) + (the-as scene-player ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 25 of type scene-player ;; WARN: Return type mismatch int vs none. -(defmethod scene-player-method-25 scene-player ((obj scene-player) (arg0 float)) +(defmethod scene-player-method-25 scene-player ((this scene-player) (arg0 float)) (local-vars (v1-11 symbol) (v1-40 symbol) (s0-0 object) (s0-1 object)) - (dotimes (s4-0 (-> obj scene actor length)) - (let ((s3-0 (-> obj scene actor s4-0))) + (dotimes (s4-0 (-> this scene actor length)) + (let ((s3-0 (-> this scene actor s4-0))) (let* ((s2-0 (-> s3-0 draw-frames)) (s1-0 (car s2-0)) ) @@ -431,7 +431,7 @@ (cond (v1-11 (if (not (handle->process (-> s3-0 process))) - (set! (-> s3-0 process) (ppointer->handle (scene-actor-method-9 s3-0 obj))) + (set! (-> s3-0 process) (ppointer->handle (scene-actor-method-9 s3-0 this))) ) (let ((s2-1 (handle->process (-> s3-0 process)))) (when (and s2-1 (nonzero? (-> (the-as process-drawable s2-1) draw))) @@ -516,7 +516,7 @@ ;; definition for method 24 of type scene-player ;; WARN: Return type mismatch basic vs scene. -(defmethod scene-player-method-24 scene-player ((obj scene-player) (arg0 basic) (arg1 symbol)) +(defmethod scene-player-method-24 scene-player ((this scene-player) (arg0 basic) (arg1 symbol)) "TODO - arg1 can be string/scene" (when (= (-> arg0 type) string) (let ((v1-2 (scene-lookup arg0))) @@ -531,18 +531,18 @@ ) (when arg1 (let ((s4-1 (get-level-by-heap-ptr-and-status *level* (the-as pointer arg0) 'active))) - (scene-method-15 (the-as scene arg0) (-> obj anim)) - (set! (-> obj level) s4-1) + (scene-method-15 (the-as scene arg0) (-> this anim)) + (set! (-> this level) s4-1) ) - (set! (-> obj scene) (the-as scene arg0)) + (set! (-> this scene) (the-as scene arg0)) ) (the-as scene arg0) ) ;; definition for method 23 of type scene-player ;; WARN: Return type mismatch int vs none. -(defmethod scene-player-method-23 scene-player ((obj scene-player) (arg0 string) (arg1 symbol)) - (let ((gp-0 (scene-player-method-24 obj arg0 #t))) +(defmethod scene-player-method-23 scene-player ((this scene-player) (arg0 string) (arg1 symbol)) + (let ((gp-0 (scene-player-method-24 this arg0 #t))) (when (-> gp-0 peaceful) (let ((s3-0 *traffic-manager*)) (send-event s3-0 'decrease-alert-level 0) @@ -555,15 +555,15 @@ (format 0 "ERROR: SCENE: scene ~A can not find entity ~A~%" (-> gp-0 name) (-> gp-0 entity)) (go process-drawable-art-error (-> gp-0 entity)) ) - (set! (-> obj main-entity) (the-as entity-actor s3-1)) + (set! (-> this main-entity) (the-as entity-actor s3-1)) (cond (s3-1 - (process-drawable-from-entity! obj (-> obj main-entity)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this (-> this main-entity)) + (logclear! (-> this mask) (process-mask actor-pause)) ) (else - (vector-reset! (-> obj root trans)) - (quaternion-identity! (-> obj root quat)) + (vector-reset! (-> this root trans)) + (quaternion-identity! (-> this root quat)) ) ) ) @@ -572,36 +572,36 @@ (format 0 "ERROR: SCENE: scene ~A can not find art-group ~A~%" (-> gp-0 name) (-> gp-0 art-group)) (go process-drawable-art-error (-> gp-0 art-group)) ) - (set! (-> obj draw art-group) s3-2) + (set! (-> this draw art-group) s3-2) (countdown (v1-33 (-> s3-2 length)) (when (-> s3-2 data v1-33) (cond ((= (-> s3-2 data v1-33 type) merc-ctrl) - (set! (-> obj draw mgeo) (the-as merc-ctrl (-> s3-2 data v1-33))) + (set! (-> this draw mgeo) (the-as merc-ctrl (-> s3-2 data v1-33))) ) ((= (-> s3-2 data v1-33 type) art-joint-geo) - (set! (-> obj draw jgeo) (the-as art-joint-geo (-> s3-2 data v1-33))) + (set! (-> this draw jgeo) (the-as art-joint-geo (-> s3-2 data v1-33))) ) ) ) ) ) (cond - ((< (+ (-> obj scene-index) 1) (-> obj scene-list length)) - (let ((a0-34 (scene-player-method-24 obj (-> obj scene-list (+ (-> obj scene-index) 1)) #f))) + ((< (+ (-> this scene-index) 1) (-> this scene-list length)) + (let ((a0-34 (scene-player-method-24 this (-> this scene-list (+ (-> this scene-index) 1)) #f))) (cond (a0-34 - (scene-method-15 a0-34 (-> obj next-anim)) + (scene-method-15 a0-34 (-> this next-anim)) ) (else - (set! (-> obj next-anim anim-name) (the-as basic 0)) + (set! (-> this next-anim anim-name) (the-as basic 0)) 0 ) ) ) ) (else - (set! (-> obj next-anim anim-name) (the-as basic 0)) + (set! (-> this next-anim anim-name) (the-as basic 0)) 0 ) ) @@ -646,12 +646,12 @@ ) ) ) - (process-entity-status! obj (entity-perm-status no-kill) #t) + (process-entity-status! this (entity-perm-status no-kill) #t) (when arg1 (set-setting! 'region-mode #f 0.0 0) (set-setting! 'process-mask 'set 0.0 (-> gp-0 mask-to-clear)) (set-setting! 'sound-bank-load #f 0.0 0) - (set-setting! 'movie (process->ppointer obj) 0.0 0) + (set-setting! 'movie (process->ppointer this) 0.0 0) (set-setting! 'movie-name (-> gp-0 name) 0.0 0) (set-setting! 'music-volume @@ -703,17 +703,17 @@ ) ;; definition for method 3 of type subtitle-work -(defmethod inspect subtitle-work ((obj subtitle-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect subtitle-work ((this subtitle-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'subtitle-work) - (format #t "~1Tdraw-tmpl: #~%" (-> obj draw-tmpl)) - (format #t "~1Tcolor0: #~%" (-> obj color0)) - (format #t "~1Tcolor1: #~%" (-> obj color1)) + (format #t "[~8x] ~A~%" this 'subtitle-work) + (format #t "~1Tdraw-tmpl: #~%" (-> this draw-tmpl)) + (format #t "~1Tcolor0: #~%" (-> this color0)) + (format #t "~1Tcolor1: #~%" (-> this color1)) (label cfg-4) - obj + this ) ;; definition for symbol *subtitle-work*, type subtitle-work @@ -921,7 +921,7 @@ (defstate wait (scene-player) :virtual #t :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (when (or (-> self scene) (-> self preload-continue)) (let ((gp-0 (scene-decode-continue (the-as basic (if (-> self scene) (-> self scene load-point-obj) @@ -1010,7 +1010,7 @@ (and (-> *target* next-state) (= (-> *target* next-state name) 'target-flop-hit-ground)) ) (-> self scene) - (< (- (current-time) (-> self state-time)) (-> self scene wait-air-time)) + (not (time-elapsed? (-> self state-time) (-> self scene wait-air-time))) ) (suspend) ) @@ -1048,8 +1048,8 @@ ) ) (when arg0 - (while (and (-> self scene) (not (or (>= (- (current-time) s5-0) (-> self scene wait-ground-time)) - (>= (- (current-time) (-> self state-time)) (-> self scene wait-max-time)) + (while (and (-> self scene) (not (or (time-elapsed? s5-0 (-> self scene wait-ground-time)) + (time-elapsed? (-> self state-time) (-> self scene wait-max-time)) ) ) ) @@ -1150,7 +1150,7 @@ (bucket-id screen-filter) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.05)) + (until (time-elapsed? gp-0 (seconds 0.05)) (suspend) ) ) @@ -1312,7 +1312,7 @@ (suspend) (scene-player-method-25 self 0.0) (set! (-> self cur-speed) 0.0) - (set! (-> self scene-start-time) (current-time)) + (set-time! (-> self scene-start-time)) (ja-play-spooled-anim (-> self anim) (the-as art-joint-anim #f) @@ -1484,9 +1484,9 @@ ) (when (cpad-pressed? 0 square) (set! (-> *setting-control* user-default subtitle) (not (-> *setting-control* user-default subtitle))) - (set! (-> self subtitle-change-time) (current-time)) + (set-time! (-> self subtitle-change-time)) ) - (when (and (< (- (current-time) (-> self subtitle-change-time)) (seconds 2)) + (when (and (not (time-elapsed? (-> self subtitle-change-time) (seconds 2))) (< (mod (- (current-time) (-> self subtitle-change-time)) 300) 210) ) (let ((gp-6 @@ -1529,7 +1529,7 @@ (cond ((cpad-hold? 0 r1) (if (cpad-pressed? 0 circle) - (set! (-> self speed-press-time) (current-time)) + (set-time! (-> self speed-press-time)) ) (seek! (-> self speed-change-speed) @@ -1541,7 +1541,7 @@ ) ((cpad-hold? 0 l1) (if (cpad-pressed? 0 square) - (set! (-> self speed-press-time) (current-time)) + (set-time! (-> self speed-press-time)) ) (seek! (-> self speed-change-speed) @@ -1553,7 +1553,7 @@ ) ((cpad-hold? 0 x) (when (cpad-pressed? 0 x) - (set! (-> self speed-press-time) (current-time)) + (set-time! (-> self speed-press-time)) (cond ((= (-> self cur-speed) 0.0) (set! (-> self speed-change-speed) -1000.0) @@ -1586,12 +1586,12 @@ ) (set! (-> self targ-speed) 0.0) (set! (-> self cur-speed) 0.0) - (set! (-> self speed-change-time) (current-time)) + (set-time! (-> self speed-change-time)) ) ) ((= (-> self speed-change-speed) -1000.0) (when (!= (-> self cur-speed) -1000.0) - (set! (-> self speed-change-time) (current-time)) + (set-time! (-> self speed-change-time)) (set! (-> self targ-speed) -1000.0) (set! (-> self cur-speed) -1000.0) (sound-pause (-> gp-7 id)) @@ -1601,7 +1601,7 @@ (set! (-> self targ-speed) (fmax -10.0 (fmin 10.0 (+ (-> self targ-speed) (* (-> self speed-change-speed) (seconds-per-frame))))) ) - (if (< (- (current-time) (-> self speed-change-time)) (seconds 3)) + (if (not (time-elapsed? (-> self speed-change-time) (seconds 3))) (format *stdcon* "id ~d speed ~f~%" @@ -1614,7 +1614,7 @@ ) (when (and gp-7 (and (!= (-> self targ-speed) (-> self cur-speed)) (< (-> self speed-change-time) (current-time)) - (>= (- (current-time) (-> self scene-start-time)) (seconds 1)) + (time-elapsed? (-> self scene-start-time) (seconds 1)) ) ) (when *sound-player-enable* @@ -1627,7 +1627,7 @@ ) ) (set! (-> self cur-speed) (-> self targ-speed)) - (set! (-> self speed-change-time) (current-time)) + (set-time! (-> self speed-change-time)) ) ) ) @@ -1730,11 +1730,11 @@ ) ;; definition for method 16 of type scene -(defmethod scene-method-16 scene ((obj scene)) +(defmethod scene-method-16 scene ((this scene)) (let ((v1-1 (-> *level* loading-level))) (if v1-1 - (set-loaded-art (-> v1-1 art-group) obj) + (set-loaded-art (-> v1-1 art-group) this) ) ) - obj + this ) diff --git a/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc index 9723eb1ae1..0ca74f35a4 100644 --- a/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc @@ -12,15 +12,15 @@ ) ;; definition for method 3 of type sound-stream-name -(defmethod inspect sound-stream-name ((obj sound-stream-name)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-stream-name ((this sound-stream-name)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-stream-name) - (format #t "~1Tname[48] @ #x~X~%" (-> obj name)) + (format #t "[~8x] ~A~%" this 'sound-stream-name) + (format #t "~1Tname[48] @ #x~X~%" (-> this name)) (label cfg-4) - obj + this ) ;; definition of type sound-id @@ -63,16 +63,16 @@ ) ;; definition for method 3 of type sound-rpc-cmd -(defmethod inspect sound-rpc-cmd ((obj sound-rpc-cmd)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-cmd ((this sound-rpc-cmd)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-cmd) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "[~8x] ~A~%" this 'sound-rpc-cmd) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) (label cfg-4) - obj + this ) ;; definition of type sound-play-params @@ -97,25 +97,25 @@ ) ;; definition for method 3 of type sound-play-params -(defmethod inspect sound-play-params ((obj sound-play-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-play-params ((this sound-play-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-play-params) - (format #t "~1Tmask: ~D~%" (-> obj mask)) - (format #t "~1Tpitch-mod: ~D~%" (-> obj pitch-mod)) - (format #t "~1Tbend: ~D~%" (-> obj bend)) - (format #t "~1Tfo-min: ~D~%" (-> obj fo-min)) - (format #t "~1Tfo-max: ~D~%" (-> obj fo-max)) - (format #t "~1Tfo-curve: ~D~%" (-> obj fo-curve)) - (format #t "~1Tpriority: ~D~%" (-> obj priority)) - (format #t "~1Tvolume: ~D~%" (-> obj volume)) - (format #t "~1Ttrans[3] @ #x~X~%" (-> obj trans)) - (format #t "~1Tgroup: ~D~%" (-> obj group)) - (format #t "~1Treg[3] @ #x~X~%" (-> obj reg)) + (format #t "[~8x] ~A~%" this 'sound-play-params) + (format #t "~1Tmask: ~D~%" (-> this mask)) + (format #t "~1Tpitch-mod: ~D~%" (-> this pitch-mod)) + (format #t "~1Tbend: ~D~%" (-> this bend)) + (format #t "~1Tfo-min: ~D~%" (-> this fo-min)) + (format #t "~1Tfo-max: ~D~%" (-> this fo-max)) + (format #t "~1Tfo-curve: ~D~%" (-> this fo-curve)) + (format #t "~1Tpriority: ~D~%" (-> this priority)) + (format #t "~1Tvolume: ~D~%" (-> this volume)) + (format #t "~1Ttrans[3] @ #x~X~%" (-> this trans)) + (format #t "~1Tgroup: ~D~%" (-> this group)) + (format #t "~1Treg[3] @ #x~X~%" (-> this reg)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-bank-cmd @@ -129,17 +129,17 @@ ;; definition for method 3 of type sound-rpc-bank-cmd ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-bank-cmd ((obj sound-rpc-bank-cmd)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-bank-cmd ((this sound-rpc-bank-cmd)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-bank-cmd) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tbank-name: ~D~%" (-> obj bank-name)) + (format #t "[~8x] ~A~%" this 'sound-rpc-bank-cmd) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tbank-name: ~D~%" (-> this bank-name)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-test-cmd @@ -153,18 +153,18 @@ ) ;; definition for method 3 of type sound-rpc-test-cmd -(defmethod inspect sound-rpc-test-cmd ((obj sound-rpc-test-cmd)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-test-cmd ((this sound-rpc-test-cmd)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-test-cmd) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tee-addr: ~D~%" (-> obj ee-addr)) - (format #t "~1Tparam0: ~D~%" (-> obj param0)) + (format #t "[~8x] ~A~%" this 'sound-rpc-test-cmd) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tee-addr: ~D~%" (-> this ee-addr)) + (format #t "~1Tparam0: ~D~%" (-> this param0)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-sound-cmd @@ -177,17 +177,17 @@ ) ;; definition for method 3 of type sound-rpc-sound-cmd -(defmethod inspect sound-rpc-sound-cmd ((obj sound-rpc-sound-cmd)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-sound-cmd ((this sound-rpc-sound-cmd)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-sound-cmd) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "[~8x] ~A~%" this 'sound-rpc-sound-cmd) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tid: ~D~%" (-> this id)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-group-cmd @@ -200,17 +200,17 @@ ) ;; definition for method 3 of type sound-rpc-group-cmd -(defmethod inspect sound-rpc-group-cmd ((obj sound-rpc-group-cmd)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-group-cmd ((this sound-rpc-group-cmd)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-group-cmd) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tgroup: ~D~%" (-> obj group)) + (format #t "[~8x] ~A~%" this 'sound-rpc-group-cmd) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tgroup: ~D~%" (-> this group)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-load-bank @@ -224,18 +224,18 @@ ;; definition for method 3 of type sound-rpc-load-bank ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-load-bank ((obj sound-rpc-load-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-load-bank ((this sound-rpc-load-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-load-bank) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tbank-name: ~D~%" (-> obj bank-name)) - (format #t "~1Tee-addr: ~D~%" (-> obj ee-addr)) + (format #t "[~8x] ~A~%" this 'sound-rpc-load-bank) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tbank-name: ~D~%" (-> this bank-name)) + (format #t "~1Tee-addr: ~D~%" (-> this ee-addr)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-load-music @@ -248,17 +248,17 @@ ;; definition for method 3 of type sound-rpc-load-music ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-load-music ((obj sound-rpc-load-music)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-load-music ((this sound-rpc-load-music)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-load-music) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tbank-name: ~D~%" (-> obj bank-name)) + (format #t "[~8x] ~A~%" this 'sound-rpc-load-music) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tbank-name: ~D~%" (-> this bank-name)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-unload-bank @@ -271,17 +271,17 @@ ;; definition for method 3 of type sound-rpc-unload-bank ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-unload-bank ((obj sound-rpc-unload-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-unload-bank ((this sound-rpc-unload-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-unload-bank) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tbank-name: ~D~%" (-> obj bank-name)) + (format #t "[~8x] ~A~%" this 'sound-rpc-unload-bank) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tbank-name: ~D~%" (-> this bank-name)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-play @@ -296,19 +296,19 @@ ;; definition for method 3 of type sound-rpc-play ;; INFO: Used lq/sq -(defmethod inspect sound-rpc-play ((obj sound-rpc-play)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-play ((this sound-rpc-play)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-play) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tparams: #~%" (-> obj params)) + (format #t "[~8x] ~A~%" this 'sound-rpc-play) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tparams: #~%" (-> this params)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-pause-sound @@ -320,17 +320,17 @@ ) ;; definition for method 3 of type sound-rpc-pause-sound -(defmethod inspect sound-rpc-pause-sound ((obj sound-rpc-pause-sound)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-pause-sound ((this sound-rpc-pause-sound)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-pause-sound) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "[~8x] ~A~%" this 'sound-rpc-pause-sound) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tid: ~D~%" (-> this id)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-stop-sound @@ -342,17 +342,17 @@ ) ;; definition for method 3 of type sound-rpc-stop-sound -(defmethod inspect sound-rpc-stop-sound ((obj sound-rpc-stop-sound)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-stop-sound ((this sound-rpc-stop-sound)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-stop-sound) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "[~8x] ~A~%" this 'sound-rpc-stop-sound) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tid: ~D~%" (-> this id)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-continue-sound @@ -364,17 +364,17 @@ ) ;; definition for method 3 of type sound-rpc-continue-sound -(defmethod inspect sound-rpc-continue-sound ((obj sound-rpc-continue-sound)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-continue-sound ((this sound-rpc-continue-sound)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-continue-sound) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "[~8x] ~A~%" this 'sound-rpc-continue-sound) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tid: ~D~%" (-> this id)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-set-param @@ -389,20 +389,20 @@ ) ;; definition for method 3 of type sound-rpc-set-param -(defmethod inspect sound-rpc-set-param ((obj sound-rpc-set-param)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-set-param ((this sound-rpc-set-param)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-param) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tparams: #~%" (-> obj params)) - (format #t "~1Tauto-time: ~D~%" (-> obj auto-time)) - (format #t "~1Tauto-from: ~D~%" (-> obj auto-from)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-param) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tparams: #~%" (-> this params)) + (format #t "~1Tauto-time: ~D~%" (-> this auto-time)) + (format #t "~1Tauto-from: ~D~%" (-> this auto-from)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-set-master-volume @@ -415,18 +415,18 @@ ) ;; definition for method 3 of type sound-rpc-set-master-volume -(defmethod inspect sound-rpc-set-master-volume ((obj sound-rpc-set-master-volume)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-set-master-volume ((this sound-rpc-set-master-volume)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-master-volume) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tgroup: ~D~%" (-> obj group)) - (format #t "~1Tvolume: ~D~%" (-> obj volume)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-master-volume) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tgroup: ~D~%" (-> this group)) + (format #t "~1Tvolume: ~D~%" (-> this volume)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-pause-group @@ -438,17 +438,17 @@ ) ;; definition for method 3 of type sound-rpc-pause-group -(defmethod inspect sound-rpc-pause-group ((obj sound-rpc-pause-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-pause-group ((this sound-rpc-pause-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-pause-group) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tgroup: ~D~%" (-> obj group)) + (format #t "[~8x] ~A~%" this 'sound-rpc-pause-group) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tgroup: ~D~%" (-> this group)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-stop-group @@ -460,17 +460,17 @@ ) ;; definition for method 3 of type sound-rpc-stop-group -(defmethod inspect sound-rpc-stop-group ((obj sound-rpc-stop-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-stop-group ((this sound-rpc-stop-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-stop-group) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tgroup: ~D~%" (-> obj group)) + (format #t "[~8x] ~A~%" this 'sound-rpc-stop-group) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tgroup: ~D~%" (-> this group)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-continue-group @@ -482,17 +482,17 @@ ) ;; definition for method 3 of type sound-rpc-continue-group -(defmethod inspect sound-rpc-continue-group ((obj sound-rpc-continue-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-continue-group ((this sound-rpc-continue-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-continue-group) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tgroup: ~D~%" (-> obj group)) + (format #t "[~8x] ~A~%" this 'sound-rpc-continue-group) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tgroup: ~D~%" (-> this group)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-get-irx-version @@ -507,19 +507,19 @@ ) ;; definition for method 3 of type sound-rpc-get-irx-version -(defmethod inspect sound-rpc-get-irx-version ((obj sound-rpc-get-irx-version)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-get-irx-version ((this sound-rpc-get-irx-version)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-get-irx-version) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tmajor: ~D~%" (-> obj major)) - (format #t "~1Tminor: ~D~%" (-> obj minor)) - (format #t "~1Tee-addr: ~D~%" (-> obj ee-addr)) + (format #t "[~8x] ~A~%" this 'sound-rpc-get-irx-version) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tmajor: ~D~%" (-> this major)) + (format #t "~1Tminor: ~D~%" (-> this minor)) + (format #t "~1Tee-addr: ~D~%" (-> this ee-addr)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-set-language @@ -532,17 +532,17 @@ ) ;; definition for method 3 of type sound-rpc-set-language -(defmethod inspect sound-rpc-set-language ((obj sound-rpc-set-language)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-set-language ((this sound-rpc-set-language)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-language) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tlang: ~D~%" (-> obj lang)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-language) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tlang: ~D~%" (-> this lang)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-set-stereo-mode @@ -555,17 +555,17 @@ ) ;; definition for method 3 of type sound-rpc-set-stereo-mode -(defmethod inspect sound-rpc-set-stereo-mode ((obj sound-rpc-set-stereo-mode)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-set-stereo-mode ((this sound-rpc-set-stereo-mode)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-stereo-mode) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tmode: ~D~%" (-> obj mode)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-stereo-mode) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tmode: ~D~%" (-> this mode)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-set-reverb @@ -581,20 +581,20 @@ ) ;; definition for method 3 of type sound-rpc-set-reverb -(defmethod inspect sound-rpc-set-reverb ((obj sound-rpc-set-reverb)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-set-reverb ((this sound-rpc-set-reverb)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-reverb) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tcore: ~D~%" (-> obj core)) - (format #t "~1Treverb: ~D~%" (-> obj reverb)) - (format #t "~1Tleft: ~D~%" (-> obj left)) - (format #t "~1Tright: ~D~%" (-> obj right)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-reverb) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tcore: ~D~%" (-> this core)) + (format #t "~1Treverb: ~D~%" (-> this reverb)) + (format #t "~1Tleft: ~D~%" (-> this left)) + (format #t "~1Tright: ~D~%" (-> this right)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-set-ear-trans @@ -610,20 +610,20 @@ ) ;; definition for method 3 of type sound-rpc-set-ear-trans -(defmethod inspect sound-rpc-set-ear-trans ((obj sound-rpc-set-ear-trans)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-set-ear-trans ((this sound-rpc-set-ear-trans)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-ear-trans) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tear-trans1[3] @ #x~X~%" (-> obj ear-trans1)) - (format #t "~1Tear-trans0[3] @ #x~X~%" (-> obj ear-trans0)) - (format #t "~1Tcam-trans[3] @ #x~X~%" (-> obj cam-trans)) - (format #t "~1Tcam-angle: ~D~%" (-> obj cam-angle)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-ear-trans) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tear-trans1[3] @ #x~X~%" (-> this ear-trans1)) + (format #t "~1Tear-trans0[3] @ #x~X~%" (-> this ear-trans0)) + (format #t "~1Tcam-trans[3] @ #x~X~%" (-> this cam-trans)) + (format #t "~1Tcam-angle: ~D~%" (-> this cam-angle)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-set-flava @@ -637,18 +637,18 @@ ) ;; definition for method 3 of type sound-rpc-set-flava -(defmethod inspect sound-rpc-set-flava ((obj sound-rpc-set-flava)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-set-flava ((this sound-rpc-set-flava)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-flava) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tflava: ~D~%" (-> obj flava)) - (format #t "~1Texcitement: ~D~%" (-> obj excitement)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-flava) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tflava: ~D~%" (-> this flava)) + (format #t "~1Texcitement: ~D~%" (-> this excitement)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-set-midi-reg @@ -662,18 +662,18 @@ ) ;; definition for method 3 of type sound-rpc-set-midi-reg -(defmethod inspect sound-rpc-set-midi-reg ((obj sound-rpc-set-midi-reg)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-set-midi-reg ((this sound-rpc-set-midi-reg)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-midi-reg) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Treg: ~D~%" (-> obj reg)) - (format #t "~1Tvalue: ~D~%" (-> obj value)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-midi-reg) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Treg: ~D~%" (-> this reg)) + (format #t "~1Tvalue: ~D~%" (-> this value)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-shutdown @@ -685,16 +685,16 @@ ) ;; definition for method 3 of type sound-rpc-shutdown -(defmethod inspect sound-rpc-shutdown ((obj sound-rpc-shutdown)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-shutdown ((this sound-rpc-shutdown)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-shutdown) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "[~8x] ~A~%" this 'sound-rpc-shutdown) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-set-fps @@ -707,17 +707,17 @@ ) ;; definition for method 3 of type sound-rpc-set-fps -(defmethod inspect sound-rpc-set-fps ((obj sound-rpc-set-fps)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-set-fps ((this sound-rpc-set-fps)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-set-fps) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tfps: ~D~%" (-> obj fps)) + (format #t "[~8x] ~A~%" this 'sound-rpc-set-fps) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tfps: ~D~%" (-> this fps)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-list-sounds @@ -729,16 +729,16 @@ ) ;; definition for method 3 of type sound-rpc-list-sounds -(defmethod inspect sound-rpc-list-sounds ((obj sound-rpc-list-sounds)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-list-sounds ((this sound-rpc-list-sounds)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-list-sounds) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "[~8x] ~A~%" this 'sound-rpc-list-sounds) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-unload-music @@ -750,16 +750,16 @@ ) ;; definition for method 3 of type sound-rpc-unload-music -(defmethod inspect sound-rpc-unload-music ((obj sound-rpc-unload-music)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-unload-music ((this sound-rpc-unload-music)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-unload-music) - (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "[~8x] ~A~%" this 'sound-rpc-unload-music) + (format #t "~1Trsvd1: ~D~%" (-> this rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> this command)) (label cfg-4) - obj + this ) ;; definition of type sound-rpc-union @@ -793,36 +793,36 @@ ) ;; definition for method 3 of type sound-rpc-union -(defmethod inspect sound-rpc-union ((obj sound-rpc-union)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-rpc-union ((this sound-rpc-union)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sound-rpc-union) - (format #t "~1Tdata[20] @ #x~X~%" (-> obj data)) - (format #t "~1Tload-bank: #~%" (-> obj load-bank)) - (format #t "~1Tunload-bank: #~%" (-> obj load-bank)) - (format #t "~1Tplay: #~%" (-> obj load-bank)) - (format #t "~1Tpause-sound: #~%" (-> obj load-bank)) - (format #t "~1Tstop-sound: #~%" (-> obj load-bank)) - (format #t "~1Tcontinue-sound: #~%" (-> obj load-bank)) - (format #t "~1Tset-param: #~%" (-> obj load-bank)) - (format #t "~1Tset-master-volume: #~%" (-> obj load-bank)) - (format #t "~1Tpause-group: #~%" (-> obj load-bank)) - (format #t "~1Tstop-group: #~%" (-> obj load-bank)) - (format #t "~1Tcontinue-group: #~%" (-> obj load-bank)) - (format #t "~1Tget-irx-version: #~%" (-> obj load-bank)) - (format #t "~1Tset-language: #~%" (-> obj load-bank)) - (format #t "~1Tset-reverb: #~%" (-> obj load-bank)) - (format #t "~1Tset-ear-trans: #~%" (-> obj load-bank)) - (format #t "~1Tset-flava: #~%" (-> obj load-bank)) - (format #t "~1Tset-midi-reg: #~%" (-> obj load-bank)) - (format #t "~1Tset-fps: #~%" (-> obj load-bank)) - (format #t "~1Tshutdown: #~%" (-> obj load-bank)) - (format #t "~1Tlist-sounds: #~%" (-> obj load-bank)) - (format #t "~1Tunload-music: #~%" (-> obj load-bank)) + (format #t "[~8x] ~A~%" this 'sound-rpc-union) + (format #t "~1Tdata[20] @ #x~X~%" (-> this data)) + (format #t "~1Tload-bank: #~%" (-> this load-bank)) + (format #t "~1Tunload-bank: #~%" (-> this load-bank)) + (format #t "~1Tplay: #~%" (-> this load-bank)) + (format #t "~1Tpause-sound: #~%" (-> this load-bank)) + (format #t "~1Tstop-sound: #~%" (-> this load-bank)) + (format #t "~1Tcontinue-sound: #~%" (-> this load-bank)) + (format #t "~1Tset-param: #~%" (-> this load-bank)) + (format #t "~1Tset-master-volume: #~%" (-> this load-bank)) + (format #t "~1Tpause-group: #~%" (-> this load-bank)) + (format #t "~1Tstop-group: #~%" (-> this load-bank)) + (format #t "~1Tcontinue-group: #~%" (-> this load-bank)) + (format #t "~1Tget-irx-version: #~%" (-> this load-bank)) + (format #t "~1Tset-language: #~%" (-> this load-bank)) + (format #t "~1Tset-reverb: #~%" (-> this load-bank)) + (format #t "~1Tset-ear-trans: #~%" (-> this load-bank)) + (format #t "~1Tset-flava: #~%" (-> this load-bank)) + (format #t "~1Tset-midi-reg: #~%" (-> this load-bank)) + (format #t "~1Tset-fps: #~%" (-> this load-bank)) + (format #t "~1Tshutdown: #~%" (-> this load-bank)) + (format #t "~1Tlist-sounds: #~%" (-> this load-bank)) + (format #t "~1Tunload-music: #~%" (-> this load-bank)) (label cfg-4) - obj + this ) ;; definition of type sound-spec @@ -852,30 +852,30 @@ ;; definition for method 3 of type sound-spec ;; INFO: Used lq/sq -(defmethod inspect sound-spec ((obj sound-spec)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-spec ((this sound-spec)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmask: ~D~%" (-> obj mask)) - (format #t "~1Tnum: ~f~%" (-> obj num)) - (format #t "~1Tgroup: ~D~%" (-> obj group)) - (format #t "~1Treg[3] @ #x~X~%" (-> obj reg)) - (format #t "~1Tsound-name-char: ~g~%" (&-> obj sound-name)) - (format #t "~1Tsound-name: ~D~%" (-> obj sound-name)) - (format #t "~1Ttrans[4] @ #x~X~%" (-> obj trans)) - (format #t "~1Tvolume: ~D~%" (-> obj volume)) - (format #t "~1Tpitch-mod: ~D~%" (-> obj pitch-mod)) - (format #t "~1Tbend: ~D~%" (-> obj bend)) - (format #t "~1Tfo-min: ~D~%" (-> obj fo-min)) - (format #t "~1Tfo-max: ~D~%" (-> obj fo-max)) - (format #t "~1Tfo-curve: ~D~%" (-> obj fo-curve)) - (format #t "~1Tpriority: ~D~%" (-> obj priority)) - (format #t "~1Tauto-time: ~D~%" (-> obj auto-time)) - (format #t "~1Tauto-from: ~D~%" (-> obj auto-from)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmask: ~D~%" (-> this mask)) + (format #t "~1Tnum: ~f~%" (-> this num)) + (format #t "~1Tgroup: ~D~%" (-> this group)) + (format #t "~1Treg[3] @ #x~X~%" (-> this reg)) + (format #t "~1Tsound-name-char: ~g~%" (&-> this sound-name)) + (format #t "~1Tsound-name: ~D~%" (-> this sound-name)) + (format #t "~1Ttrans[4] @ #x~X~%" (-> this trans)) + (format #t "~1Tvolume: ~D~%" (-> this volume)) + (format #t "~1Tpitch-mod: ~D~%" (-> this pitch-mod)) + (format #t "~1Tbend: ~D~%" (-> this bend)) + (format #t "~1Tfo-min: ~D~%" (-> this fo-min)) + (format #t "~1Tfo-max: ~D~%" (-> this fo-max)) + (format #t "~1Tfo-curve: ~D~%" (-> this fo-curve)) + (format #t "~1Tpriority: ~D~%" (-> this priority)) + (format #t "~1Tauto-time: ~D~%" (-> this auto-time)) + (format #t "~1Tauto-from: ~D~%" (-> this auto-from)) (label cfg-4) - obj + this ) ;; definition for symbol *current-sound-id*, type sound-id @@ -917,30 +917,30 @@ ;; definition for method 3 of type ambient-sound ;; INFO: Used lq/sq -(defmethod inspect ambient-sound ((obj ambient-sound)) - (when (not obj) - (set! obj obj) +(defmethod inspect ambient-sound ((this ambient-sound)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tspec: ~A~%" (-> obj spec)) - (format #t "~1Tplaying-id: ~D~%" (-> obj playing-id)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tplay-time: ~D~%" (-> obj play-time)) - (format #t "~1Ttime-base: ~D~%" (-> obj time-base)) - (format #t "~1Ttime-random: ~D~%" (-> obj time-random)) - (format #t "~1Tvolume: ~D~%" (-> obj volume)) - (format #t "~1Tpitch: ~D~%" (-> obj pitch)) - (format #t "~1Tfalloff-near: ~D~%" (-> obj falloff-near)) - (format #t "~1Tfalloff-far: ~D~%" (-> obj falloff-far)) - (format #t "~1Tfalloff-mode: ~D~%" (-> obj falloff-mode)) - (format #t "~1Tparams: #x~X~%" (-> obj params)) - (format #t "~1Tparam-count: ~D~%" (-> obj param-count)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tsound-count: ~D~%" (-> obj sound-count)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tspec: ~A~%" (-> this spec)) + (format #t "~1Tplaying-id: ~D~%" (-> this playing-id)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tplay-time: ~D~%" (-> this play-time)) + (format #t "~1Ttime-base: ~D~%" (-> this time-base)) + (format #t "~1Ttime-random: ~D~%" (-> this time-random)) + (format #t "~1Tvolume: ~D~%" (-> this volume)) + (format #t "~1Tpitch: ~D~%" (-> this pitch)) + (format #t "~1Tfalloff-near: ~D~%" (-> this falloff-near)) + (format #t "~1Tfalloff-far: ~D~%" (-> this falloff-far)) + (format #t "~1Tfalloff-mode: ~D~%" (-> this falloff-mode)) + (format #t "~1Tparams: #x~X~%" (-> this params)) + (format #t "~1Tparam-count: ~D~%" (-> this param-count)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tsound-count: ~D~%" (-> this sound-count)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc index a3ef031e4a..9157fdbb77 100644 --- a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc @@ -10,27 +10,27 @@ ) ;; definition for method 3 of type engine-sound-pers -(defmethod inspect engine-sound-pers ((obj engine-sound-pers)) - (when (not obj) - (set! obj obj) +(defmethod inspect engine-sound-pers ((this engine-sound-pers)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Telement-type: ~A~%" (-> obj element-type)) - (format #t "~1Texecute-time: ~D~%" (-> obj execute-time)) - (format #t "~1Talive-list: #~%" (-> obj alive-list)) - (format #t "~1Tdead-list: #~%" (-> obj dead-list)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Telement-type: ~A~%" (-> this element-type)) + (format #t "~1Texecute-time: ~D~%" (-> this execute-time)) + (format #t "~1Talive-list: #~%" (-> this alive-list)) + (format #t "~1Tdead-list: #~%" (-> this dead-list)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for method 10 of type engine-sound-pers ;; WARN: Return type mismatch int vs none. -(defmethod kill-callback engine-sound-pers ((obj engine-sound-pers) (arg0 connection-pers)) +(defmethod kill-callback engine-sound-pers ((this engine-sound-pers) (arg0 connection-pers)) (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) (set! (-> v1-0 id) (the-as sound-id (-> arg0 param-int64 0))) @@ -102,48 +102,48 @@ ) ;; definition for method 3 of type sound-iop-info -(defmethod inspect sound-iop-info ((obj sound-iop-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect sound-iop-info ((this sound-iop-info)) + (when (not this) + (set! this this) (goto cfg-16) ) - (format #t "[~8x] ~A~%" obj 'sound-iop-info) - (format #t "~1Tframe: ~D~%" (-> obj frame)) - (format #t "~1Tstrpos: ~D~%" (-> obj strpos)) - (format #t "~1Tstr-id: ~D~%" (-> obj str-id)) - (format #t "~1Tstr-id-sign: ~D~%" (-> obj str-id-sign)) - (format #t "~1Tfreemem: ~D~%" (-> obj freemem)) - (format #t "~1Tchinfo[48] @ #x~X~%" (-> obj chinfo)) - (format #t "~1Tfreemem2: ~D~%" (-> obj freemem2)) - (format #t "~1Tnocd: ~D~%" (-> obj nocd)) - (format #t "~1Tdirtycd: ~D~%" (-> obj dirtycd)) - (format #t "~1Tdiskspeed[2] @ #x~X~%" (-> obj diskspeed)) - (format #t "~1Tlastspeed: ~D~%" (-> obj lastspeed)) - (format #t "~1Tdupseg: ~D~%" (-> obj dupseg)) - (format #t "~1Ttimes[41] @ #x~X~%" (-> obj times)) - (format #t "~1Ttimes-seq: ~D~%" (-> obj times-seq)) - (format #t "~1Tiop-ticks: ~D~%" (-> obj iop-ticks)) - (format #t "~1Tstream-position[4] @ #x~X~%" (-> obj stream-position)) + (format #t "[~8x] ~A~%" this 'sound-iop-info) + (format #t "~1Tframe: ~D~%" (-> this frame)) + (format #t "~1Tstrpos: ~D~%" (-> this strpos)) + (format #t "~1Tstr-id: ~D~%" (-> this str-id)) + (format #t "~1Tstr-id-sign: ~D~%" (-> this str-id-sign)) + (format #t "~1Tfreemem: ~D~%" (-> this freemem)) + (format #t "~1Tchinfo[48] @ #x~X~%" (-> this chinfo)) + (format #t "~1Tfreemem2: ~D~%" (-> this freemem2)) + (format #t "~1Tnocd: ~D~%" (-> this nocd)) + (format #t "~1Tdirtycd: ~D~%" (-> this dirtycd)) + (format #t "~1Tdiskspeed[2] @ #x~X~%" (-> this diskspeed)) + (format #t "~1Tlastspeed: ~D~%" (-> this lastspeed)) + (format #t "~1Tdupseg: ~D~%" (-> this dupseg)) + (format #t "~1Ttimes[41] @ #x~X~%" (-> this times)) + (format #t "~1Ttimes-seq: ~D~%" (-> this times-seq)) + (format #t "~1Tiop-ticks: ~D~%" (-> this iop-ticks)) + (format #t "~1Tstream-position[4] @ #x~X~%" (-> this stream-position)) (dotimes (s5-0 4) - (format #t "~T [~D]~1Tstream-position: ~`integer`P~%" s5-0 (-> obj stream-position s5-0)) + (format #t "~T [~D]~1Tstream-position: ~`integer`P~%" s5-0 (-> this stream-position s5-0)) ) - (format #t "~1Tstream-status[4] @ #x~X~%" (-> obj stream-status)) + (format #t "~1Tstream-status[4] @ #x~X~%" (-> this stream-status)) (dotimes (s5-1 4) - (format #t "~T [~D]~1Tstream-status: #x~X~%" s5-1 (-> obj stream-status s5-1)) + (format #t "~T [~D]~1Tstream-status: #x~X~%" s5-1 (-> this stream-status s5-1)) ) - (format #t "~1Tstream-name[4] @ #x~X~%" (-> obj stream-name)) + (format #t "~1Tstream-name[4] @ #x~X~%" (-> this stream-name)) (dotimes (s5-2 4) - (format #t "~T [~D]~1Tstream-name: ~g~%" s5-2 (-> obj stream-name s5-2)) + (format #t "~T [~D]~1Tstream-name: ~g~%" s5-2 (-> this stream-name s5-2)) ) - (format #t "~1Tstream-id[4] @ #x~X~%" (-> obj stream-id)) + (format #t "~1Tstream-id[4] @ #x~X~%" (-> this stream-id)) (dotimes (s5-3 4) - (format #t "~T [~D]~1Tstream-id: ~`uint32`P~%" s5-3 (-> obj stream-id s5-3)) + (format #t "~T [~D]~1Tstream-id: ~`uint32`P~%" s5-3 (-> this stream-id s5-3)) ) - (format #t "~1Tmusic-register[17] @ #x~X~%" (-> obj music-register)) - (format #t "~1Tmusic-excite: ~D~%" (-> obj music-excite)) - (format #t "~1Tramdisk-name: ~g~%" (-> obj ramdisk-name)) + (format #t "~1Tmusic-register[17] @ #x~X~%" (-> this music-register)) + (format #t "~1Tmusic-excite: ~D~%" (-> this music-excite)) + (format #t "~1Tramdisk-name: ~g~%" (-> this ramdisk-name)) (label cfg-16) - obj + this ) ;; definition for symbol *sound-iop-info*, type sound-iop-info @@ -959,38 +959,38 @@ otherwise, an explicit [[vector]] can be provided" ;; definition for method 9 of type ambient-sound ;; INFO: Used lq/sq -(defmethod update! ambient-sound ((obj ambient-sound)) +(defmethod update! ambient-sound ((this ambient-sound)) (with-pp (if (not *ambient-sound-class*) (return (the-as int #f)) ) (cond - ((-> obj spec) - (when (or (< (-> obj time-base) 0) (>= (current-time) (-> obj play-time))) - (when (>= (-> obj time-base) 0) - (set! (-> obj play-time) - (+ (current-time) (-> obj time-base) (rand-vu-int-count (the-as int (-> obj time-random)))) + ((-> this spec) + (when (or (< (-> this time-base) 0) (>= (current-time) (-> this play-time))) + (when (>= (-> this time-base) 0) + (set! (-> this play-time) + (+ (current-time) (-> this time-base) (rand-vu-int-count (the-as int (-> this time-random)))) ) - (set! (-> obj playing-id) (new-sound-id)) + (set! (-> this playing-id) (new-sound-id)) ) - (let ((s5-1 (-> obj spec))) + (let ((s5-1 (-> this spec))) (when (= s5-1 *ambient-spec*) - (set! (-> s5-1 volume) (-> obj volume)) - (set! (-> s5-1 pitch-mod) (-> obj pitch)) + (set! (-> s5-1 volume) (-> this volume)) + (set! (-> s5-1 pitch-mod) (-> this pitch)) (set! (-> s5-1 bend) 0) - (set! (-> s5-1 sound-name) (-> obj name)) - (set! (-> s5-1 fo-max) (-> obj falloff-far)) + (set! (-> s5-1 sound-name) (-> this name)) + (set! (-> s5-1 fo-max) (-> this falloff-far)) (set! (-> s5-1 mask) (sound-mask)) - (if (-> obj params) - (effect-param->sound-spec s5-1 (-> obj params) (-> obj param-count) (the-as process-focusable pp)) + (if (-> this params) + (effect-param->sound-spec s5-1 (-> this params) (-> this param-count) (the-as process-focusable pp)) ) ) (let ((v1-23 (-> s5-1 fo-max))) - (if (and (nonzero? v1-23) (< (* 4096.0 (the float v1-23)) (vector-vector-distance (ear-trans 0) (-> obj trans)))) + (if (and (nonzero? v1-23) (< (* 4096.0 (the float v1-23)) (vector-vector-distance (ear-trans 0) (-> this trans)))) (return 0) ) ) - (when (and *debug-effect-control* (>= (-> obj time-base) 0)) + (when (and *debug-effect-control* (>= (-> this time-base) 0)) (format #t "(~5D) effect sound ~A ~G " (current-time) (-> pp name) (&-> s5-1 sound-name)) (format #t @@ -1000,45 +1000,45 @@ otherwise, an explicit [[vector]] can be provided" ) ) (let ((s4-2 (-> s5-1 volume))) - (set! (-> s5-1 volume) (-> obj volume)) - (set! (-> obj playing-id) (sound-play-by-spec s5-1 (-> obj playing-id) (-> obj trans))) + (set! (-> s5-1 volume) (-> this volume)) + (set! (-> this playing-id) (sound-play-by-spec s5-1 (-> this playing-id) (-> this trans))) (set! (-> s5-1 volume) s4-2) ) ) ) ) - ((< (-> obj time-base) 0) - (let ((v1-39 (-> obj falloff-far))) - (if (and (nonzero? v1-39) (< (* 4096.0 (the float v1-39)) (vector-vector-distance (ear-trans 0) (-> obj trans)))) + ((< (-> this time-base) 0) + (let ((v1-39 (-> this falloff-far))) + (if (and (nonzero? v1-39) (< (* 4096.0 (the float v1-39)) (vector-vector-distance (ear-trans 0) (-> this trans)))) (return 0) ) ) - (set! (-> obj playing-id) (sound-play-by-name - (-> obj name) - (-> obj playing-id) - (-> obj volume) - (-> obj pitch) - 0 - (sound-group sfx) - (-> obj trans) - ) + (set! (-> this playing-id) (sound-play-by-name + (-> this name) + (-> this playing-id) + (-> this volume) + (-> this pitch) + 0 + (sound-group sfx) + (-> this trans) + ) ) ) (else - (when (>= (current-time) (-> obj play-time)) - (set! (-> obj playing-id) + (when (>= (current-time) (-> this play-time)) + (set! (-> this playing-id) (sound-play-by-name - (-> obj name) + (-> this name) (new-sound-id) - (-> obj volume) - (-> obj pitch) + (-> this volume) + (-> this pitch) 0 (sound-group sfx) - (-> obj trans) + (-> this trans) ) ) - (set! (-> obj play-time) - (+ (current-time) (-> obj time-base) (rand-vu-int-count (the-as int (-> obj time-random)))) + (set! (-> this play-time) + (+ (current-time) (-> this time-base) (rand-vu-int-count (the-as int (-> this time-random)))) ) ) ) @@ -1048,21 +1048,21 @@ otherwise, an explicit [[vector]] can be provided" ) ;; definition for method 15 of type ambient-sound -(defmethod stop! ambient-sound ((obj ambient-sound)) - (sound-stop (-> obj playing-id)) +(defmethod stop! ambient-sound ((this ambient-sound)) + (sound-stop (-> this playing-id)) 0 ) ;; definition for method 11 of type ambient-sound ;; INFO: Used lq/sq -(defmethod update-trans! ambient-sound ((obj ambient-sound) (arg0 vector)) +(defmethod update-trans! ambient-sound ((this ambient-sound) (arg0 vector)) (with-pp - (set! (-> obj trans quad) (-> arg0 quad)) - (when (nonzero? (-> obj playing-id)) + (set! (-> this trans quad) (-> arg0 quad)) + (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((s5-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-0 command) (sound-command set-param)) - (set! (-> s5-0 id) (-> obj playing-id)) + (set! (-> s5-0 id) (-> this playing-id)) (let ((s4-1 (the-as process-drawable pp))) (when (= arg0 #t) (if (and s4-1 (type? s4-1 process-drawable) (nonzero? (-> s4-1 root))) @@ -1082,56 +1082,56 @@ otherwise, an explicit [[vector]] can be provided" ) ;; definition for method 12 of type ambient-sound -(defmethod update-vol! ambient-sound ((obj ambient-sound) (arg0 float)) - (when (nonzero? (-> obj playing-id)) +(defmethod update-vol! ambient-sound ((this ambient-sound) (arg0 float)) + (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-4 command) (sound-command set-param)) - (set! (-> v1-4 id) (-> obj playing-id)) + (set! (-> v1-4 id) (-> this playing-id)) (set! (-> v1-4 params volume) (the int (* 1024.0 arg0))) (set! (-> v1-4 params mask) (the-as uint 1)) (-> v1-4 id) ) ) ) - (set! (-> obj volume) (the int (* 1024.0 arg0))) + (set! (-> this volume) (the int (* 1024.0 arg0))) 0 ) ;; definition for method 13 of type ambient-sound ;; WARN: Return type mismatch int vs none. -(defmethod update-pitch-mod! ambient-sound ((obj ambient-sound) (arg0 float)) - (when (nonzero? (-> obj playing-id)) +(defmethod update-pitch-mod! ambient-sound ((this ambient-sound) (arg0 float)) + (when (nonzero? (-> this playing-id)) (when *sound-player-enable* (let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-4 command) (sound-command set-param)) - (set! (-> v1-4 id) (-> obj playing-id)) + (set! (-> v1-4 id) (-> this playing-id)) (set! (-> v1-4 params pitch-mod) (the int (* 1524.0 arg0))) (set! (-> v1-4 params mask) (the-as uint 2)) (-> v1-4 id) ) ) ) - (set! (-> obj pitch) (the int (* 1524.0 arg0))) + (set! (-> this pitch) (the int (* 1524.0 arg0))) 0 (none) ) ;; definition for method 14 of type ambient-sound ;; WARN: Return type mismatch int vs none. -(defmethod set-falloff-far! ambient-sound ((obj ambient-sound) (arg0 float)) - (set! (-> obj falloff-far) (the int (* 0.00024414062 arg0))) +(defmethod set-falloff-far! ambient-sound ((this ambient-sound) (arg0 float)) + (set! (-> this falloff-far) (the int (* 0.00024414062 arg0))) 0 (none) ) ;; definition for method 10 of type ambient-sound ;; INFO: Used lq/sq -(defmethod change-sound! ambient-sound ((obj ambient-sound) (arg0 sound-name)) - (when (not (and (= (the-as uint (-> obj name)) (the-as uint arg0)) (= (-> arg0 hi) (-> obj name hi)))) - (stop! obj) - (set! (-> obj playing-id) (new-sound-id)) - (set! (-> obj name) arg0) +(defmethod change-sound! ambient-sound ((this ambient-sound) (arg0 sound-name)) + (when (not (and (= (the-as uint (-> this name)) (the-as uint arg0)) (= (-> arg0 hi) (-> this name hi)))) + (stop! this) + (set! (-> this playing-id) (new-sound-id)) + (set! (-> this name) arg0) ) 0 ) @@ -1313,7 +1313,7 @@ otherwise, an explicit [[vector]] can be provided" (want-sound-banks *load-state* a1-3) ) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 1)) + (until (time-elapsed? s5-0 (seconds 1)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc b/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc index 88122c1287..749db96990 100644 --- a/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc @@ -19,29 +19,29 @@ ) ;; definition for method 3 of type speech-type-info -(defmethod inspect speech-type-info ((obj speech-type-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect speech-type-info ((this speech-type-info)) + (when (not this) + (set! this this) (goto cfg-6) ) - (format #t "[~8x] ~A~%" obj 'speech-type-info) - (format #t "~1Tchannel: ~D~%" (-> obj channel)) - (format #t "~1Tflags: #x~X : (speech-type-flag " (-> obj flags)) - (let ((a0-4 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'speech-type-info) + (format #t "~1Tchannel: ~D~%" (-> this channel)) + (format #t "~1Tflags: #x~X : (speech-type-flag " (-> this flags)) + (let ((a0-4 (-> this flags))) (if (= (logand a0-4 (speech-type-flag random-order)) (speech-type-flag random-order)) (format #t "random-order ") ) ) (format #t ")~%") - (format #t "~1Tpriority: ~D~%" (-> obj priority)) - (format #t "~1Trequest-timeout: ~D~%" (-> obj request-timeout)) - (format #t "~1Tmin-delay: ~D~%" (-> obj min-delay)) - (format #t "~1Tmax-delay: ~D~%" (-> obj max-delay)) - (format #t "~1Tdelay: ~D~%" (-> obj delay)) - (format #t "~1Tplay-index: ~D~%" (-> obj play-index)) - (format #t "~1Tlist: ~A~%" (-> obj list)) + (format #t "~1Tpriority: ~D~%" (-> this priority)) + (format #t "~1Trequest-timeout: ~D~%" (-> this request-timeout)) + (format #t "~1Tmin-delay: ~D~%" (-> this min-delay)) + (format #t "~1Tmax-delay: ~D~%" (-> this max-delay)) + (format #t "~1Tdelay: ~D~%" (-> this delay)) + (format #t "~1Tplay-index: ~D~%" (-> this play-index)) + (format #t "~1Tlist: ~A~%" (-> this list)) (label cfg-6) - obj + this ) ;; definition of type speech-request @@ -58,18 +58,18 @@ ) ;; definition for method 3 of type speech-request -(defmethod inspect speech-request ((obj speech-request)) - (when (not obj) - (set! obj obj) +(defmethod inspect speech-request ((this speech-request)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'speech-request) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Ttime: ~D~%" (-> obj time)) - (format #t "~1Tpriority: ~f~%" (-> obj priority)) - (format #t "~1Tspeech-type: ~D~%" (-> obj speech-type)) + (format #t "[~8x] ~A~%" this 'speech-request) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Ttime: ~D~%" (-> this time)) + (format #t "~1Tpriority: ~f~%" (-> this priority)) + (format #t "~1Tspeech-type: ~D~%" (-> this speech-type)) (label cfg-4) - obj + this ) ;; definition of type speech-channel @@ -99,31 +99,31 @@ ) ;; definition for method 3 of type speech-channel -(defmethod inspect speech-channel ((obj speech-channel)) - (when (not obj) - (set! obj obj) +(defmethod inspect speech-channel ((this speech-channel)) + (when (not this) + (set! this this) (goto cfg-6) ) - (format #t "[~8x] ~A~%" obj 'speech-channel) - (format #t "~1Tflags: #x~X : (speech-channel-flag " (-> obj flags)) - (let ((a0-3 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'speech-channel) + (format #t "~1Tflags: #x~X : (speech-channel-flag " (-> this flags)) + (let ((a0-3 (-> this flags))) (if (= (logand a0-3 (speech-channel-flag disable)) (speech-channel-flag disable)) (format #t "disable ") ) ) (format #t ")~%") - (format #t "~1Tgui-channel: ~D~%" (-> obj gui-channel)) - (format #t "~1Tdelay: ~D~%" (-> obj delay)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tupdate-time: ~D~%" (-> obj update-time)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Tend-time: ~D~%" (-> obj end-time)) - (format #t "~1Trequest: #~%" (-> obj request)) - (format #t "~1Tlast-request: #~%" (-> obj last-request)) - (format #t "~1Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~1Tspeech-table: #x~X~%" (-> obj speech-table)) + (format #t "~1Tgui-channel: ~D~%" (-> this gui-channel)) + (format #t "~1Tdelay: ~D~%" (-> this delay)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tupdate-time: ~D~%" (-> this update-time)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tend-time: ~D~%" (-> this end-time)) + (format #t "~1Trequest: #~%" (-> this request)) + (format #t "~1Tlast-request: #~%" (-> this last-request)) + (format #t "~1Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~1Tspeech-table: #x~X~%" (-> this speech-table)) (label cfg-6) - obj + this ) ;; definition of type speech-control @@ -147,16 +147,16 @@ ) ;; definition for method 3 of type speech-control -(defmethod inspect speech-control ((obj speech-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect speech-control ((this speech-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'speech-control) - (format #t "~1Tchannel-array[2] @ #x~X~%" (-> obj channel-array)) - (format #t "~1Tspeech-table[57] @ #x~X~%" (-> obj speech-table)) + (format #t "[~8x] ~A~%" this 'speech-control) + (format #t "~1Tchannel-array[2] @ #x~X~%" (-> this channel-array)) + (format #t "~1Tspeech-table[57] @ #x~X~%" (-> this speech-table)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/sound/speech_REF.gc b/test/decompiler/reference/jak2/engine/sound/speech_REF.gc index 15eca8c293..3f3f7bf249 100644 --- a/test/decompiler/reference/jak2/engine/sound/speech_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/speech_REF.gc @@ -3,19 +3,19 @@ ;; definition for method 12 of type speech-channel ;; WARN: Return type mismatch int vs none. -(defmethod speech-channel-method-12 speech-channel ((obj speech-channel)) - (set! (-> obj request handle) (the-as handle #f)) - (set! (-> obj request priority) -10000000000000000000000000000000000000.0) +(defmethod speech-channel-method-12 speech-channel ((this speech-channel)) + (set! (-> this request handle) (the-as handle #f)) + (set! (-> this request priority) -10000000000000000000000000000000000000.0) 0 (none) ) ;; definition for method 13 of type speech-channel ;; WARN: Return type mismatch int vs none. -(defmethod speech-channel-method-13 speech-channel ((obj speech-channel)) - (set! (-> obj id) (new 'static 'sound-id)) - (set! (-> obj last-request handle) (the-as handle #f)) - (set! (-> obj last-request priority) -10000000000000000000000000000000000000.0) +(defmethod speech-channel-method-13 speech-channel ((this speech-channel)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) + (set! (-> this last-request priority) -10000000000000000000000000000000000000.0) 0 (none) ) @@ -23,43 +23,43 @@ ;; definition for method 11 of type speech-channel ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod speech-channel-method-11 speech-channel ((obj speech-channel)) +(defmethod speech-channel-method-11 speech-channel ((this speech-channel)) (local-vars (v1-44 int)) (with-pp - (logclear! (-> obj flags) (speech-channel-flag disable)) + (logclear! (-> this flags) (speech-channel-flag disable)) (if (or (not (-> *setting-control* user-current speech-control)) (load-in-progress? *level*) - (nonzero? (-> obj id)) + (nonzero? (-> this id)) ) - (logior! (-> obj flags) (speech-channel-flag disable)) + (logior! (-> this flags) (speech-channel-flag disable)) ) - (set! (-> obj target-pos quad) (-> (target-pos 0) quad)) - (when (not (logtest? (-> obj flags) (speech-channel-flag disable))) - (let ((s5-1 (-> obj speech-table (-> obj request speech-type)))) + (set! (-> this target-pos quad) (-> (target-pos 0) quad)) + (when (not (logtest? (-> this flags) (speech-channel-flag disable))) + (let ((s5-1 (-> this speech-table (-> this request speech-type)))) (cond (s5-1 - (let ((a0-8 (- (-> obj update-time) (-> obj request time))) - (v1-20 (handle->process (-> obj request handle))) + (let ((a0-8 (- (-> this update-time) (-> this request time))) + (v1-20 (handle->process (-> this request handle))) ) (if (or (< (the-as time-frame (-> s5-1 request-timeout)) a0-8) (or (not v1-20) (let ((f0-0 245760.0)) (< (* f0-0 f0-0) - (vector-vector-distance-squared (-> obj target-pos) (-> (the-as process-drawable v1-20) root trans)) + (vector-vector-distance-squared (-> this target-pos) (-> (the-as process-drawable v1-20) root trans)) ) ) ) ) - (speech-channel-method-12 obj) + (speech-channel-method-12 this) ) ) - (let ((s4-0 (handle->process (-> obj request handle)))) + (let ((s4-0 (handle->process (-> this request handle)))) (when s4-0 - (when (or (and (>= (-> obj request priority) 0.0) - (>= (- (current-time) (-> obj end-time)) (the-as time-frame (-> s5-1 delay))) + (when (or (and (>= (-> this request priority) 0.0) + (time-elapsed? (-> this end-time) (the-as time-frame (-> s5-1 delay))) ) - (and (>= (- (current-time) (-> obj end-time)) (the-as time-frame (-> s5-1 delay))) - (>= (- (current-time) (-> obj end-time)) (the-as time-frame (-> obj delay))) + (and (time-elapsed? (-> this end-time) (the-as time-frame (-> s5-1 delay))) + (time-elapsed? (-> this end-time) (the-as time-frame (-> this delay))) ) ) (let ((s3-0 (-> s5-1 list length)) @@ -85,16 +85,16 @@ ) (set! (-> s5-1 play-index) v1-44) (let ((s3-1 (-> s5-1 list v1-44))) - (mem-copy! (the-as pointer (-> obj last-request)) (the-as pointer (-> obj request)) 21) - (set! (-> obj start-time) (current-time)) - (set! (-> obj delay) + (mem-copy! (the-as pointer (-> this last-request)) (the-as pointer (-> this request)) 21) + (set-time! (-> this start-time)) + (set! (-> this delay) (the-as uint (rand-vu-int-range (the-as int (-> s5-1 min-delay)) (the-as int (-> s5-1 max-delay)))) ) - (set! (-> s5-1 delay) (-> obj delay)) - (set! (-> obj id) (add-process *gui-control* s4-0 (-> obj gui-channel) (gui-action play) s3-1 -99.0 0)) + (set! (-> s5-1 delay) (-> this delay)) + (set! (-> this id) (add-process *gui-control* s4-0 (-> this gui-channel) (gui-action play) s3-1 -99.0 0)) ) - (speech-channel-method-12 obj) - (logior! (-> obj flags) (speech-channel-flag disable)) + (speech-channel-method-12 this) + (logior! (-> this flags) (speech-channel-flag disable)) ) ) ) @@ -102,20 +102,20 @@ ) ) (else - (speech-channel-method-12 obj) + (speech-channel-method-12 this) ) ) ) ) - (set! (-> obj update-time) (current-time)) - (when (nonzero? (-> obj id)) - (let ((s4-1 (handle->process (-> obj last-request handle)))) + (set-time! (-> this update-time)) + (when (nonzero? (-> this id)) + (let ((s4-1 (handle->process (-> this last-request handle)))) (cond ((and s4-1 (-> *setting-control* user-current speech-control)) (when *sound-player-enable* (let ((s5-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> s5-2 command) (sound-command set-param)) - (set! (-> s5-2 id) (-> obj id)) + (set! (-> s5-2 id) (-> this id)) (set! (-> s5-2 params fo-min) 15) (set! (-> s5-2 params fo-max) 90) (set! (-> s5-2 params fo-curve) 9) @@ -139,39 +139,39 @@ (set-action! *gui-control* (gui-action stop) - (-> obj id) + (-> this id) (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj id) (new 'static 'sound-id)) + (set! (-> this id) (new 'static 'sound-id)) 0 ) ) ) - (case (get-status *gui-control* (-> obj id)) + (case (get-status *gui-control* (-> this id)) (((gui-status pending)) - (when (>= (- (current-time) (-> obj start-time)) (seconds 1)) + (when (time-elapsed? (-> this start-time) (seconds 1)) (set-action! *gui-control* (gui-action stop) - (-> obj id) + (-> this id) (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj id) (new 'static 'sound-id)) - (set! (-> obj end-time) (-> obj update-time)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this end-time) (-> this update-time)) ) ) (((gui-status unknown)) - (set! (-> obj id) (new 'static 'sound-id)) - (set! (-> obj last-request handle) (the-as handle #f)) - (set! (-> obj end-time) (-> obj update-time)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) + (set! (-> this end-time) (-> this update-time)) ) ) ) @@ -182,20 +182,20 @@ ;; definition for method 9 of type speech-channel ;; WARN: Return type mismatch int vs none. -(defmethod speech-channel-method-9 speech-channel ((obj speech-channel) (arg0 process-drawable) (arg1 speech-type)) - (let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> obj target-pos))) +(defmethod speech-channel-method-9 speech-channel ((this speech-channel) (arg0 process-drawable) (arg1 speech-type)) + (let ((f0-0 (vector-vector-distance-squared (-> arg0 root trans) (-> this target-pos))) (f1-0 245760.0) ) (when (< f0-0 (* f1-0 f1-0)) (let* ((f1-3 -1.0) (f2-0 409600.0) - (f0-2 (+ (* f0-0 (/ f1-3 (* f2-0 f2-0))) (the float (-> obj speech-table arg1 priority)))) + (f0-2 (+ (* f0-0 (/ f1-3 (* f2-0 f2-0))) (the float (-> this speech-table arg1 priority)))) ) - (when (< (-> obj request priority) f0-2) - (set! (-> obj request priority) f0-2) - (set! (-> obj request handle) (process->handle arg0)) - (set! (-> obj request speech-type) arg1) - (set! (-> obj request time) (current-time)) + (when (< (-> this request priority) f0-2) + (set! (-> this request priority) f0-2) + (set! (-> this request handle) (process->handle arg0)) + (set! (-> this request speech-type) arg1) + (set-time! (-> this request time)) ) ) ) @@ -206,20 +206,20 @@ ;; definition for method 10 of type speech-channel ;; WARN: Return type mismatch int vs none. -(defmethod speech-channel-method-10 speech-channel ((obj speech-channel) (arg0 handle)) - (when (= arg0 (handle->process (-> obj last-request handle))) +(defmethod speech-channel-method-10 speech-channel ((this speech-channel) (arg0 handle)) + (when (= arg0 (handle->process (-> this last-request handle))) (set-action! *gui-control* (gui-action stop) - (-> obj id) + (-> this id) (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj id) (new 'static 'sound-id)) - (set! (-> obj last-request handle) (the-as handle #f)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this last-request handle) (the-as handle #f)) ) 0 (none) @@ -227,10 +227,10 @@ ;; definition for method 12 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-12 speech-control ((obj speech-control) (arg0 process-drawable) (arg1 speech-type)) - (let ((v1-2 (-> obj speech-table arg1))) +(defmethod speech-control-method-12 speech-control ((this speech-control) (arg0 process-drawable) (arg1 speech-type)) + (let ((v1-2 (-> this speech-table arg1))) (when v1-2 - (let ((a0-1 (-> obj channel-array (-> v1-2 channel)))) + (let ((a0-1 (-> this channel-array (-> v1-2 channel)))) (if (not (logtest? (-> a0-1 flags) (speech-channel-flag disable))) (speech-channel-method-9 a0-1 arg0 arg1) ) @@ -243,9 +243,9 @@ ;; definition for method 11 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-11 speech-control ((obj speech-control)) +(defmethod speech-control-method-11 speech-control ((this speech-control)) (dotimes (s5-0 2) - (speech-channel-method-11 (-> obj channel-array s5-0)) + (speech-channel-method-11 (-> this channel-array s5-0)) ) 0 (none) @@ -253,17 +253,17 @@ ;; definition for method 10 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-table-set! speech-control ((obj speech-control) (arg0 speech-type) (arg1 speech-type-info)) - (set! (-> obj speech-table arg0) arg1) +(defmethod speech-table-set! speech-control ((this speech-control) (arg0 speech-type) (arg1 speech-type-info)) + (set! (-> this speech-table arg0) arg1) 0 (none) ) ;; definition for method 13 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-13 speech-control ((obj speech-control) (arg0 handle)) +(defmethod speech-control-method-13 speech-control ((this speech-control) (arg0 handle)) (dotimes (s4-0 2) - (speech-channel-method-10 (-> obj channel-array s4-0) arg0) + (speech-channel-method-10 (-> this channel-array s4-0) arg0) ) 0 (none) @@ -271,16 +271,16 @@ ;; definition for method 14 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-14 speech-control ((obj speech-control)) - (speech-control-method-9 obj) - (let ((s5-0 (-> obj channel-array))) +(defmethod speech-control-method-14 speech-control ((this speech-control)) + (speech-control-method-9 this) + (let ((s5-0 (-> this channel-array))) ((method-of-type speech-channel speech-channel-method-13) (the-as speech-channel s5-0)) - (set! (-> s5-0 0 speech-table) (-> obj speech-table)) + (set! (-> s5-0 0 speech-table) (-> this speech-table)) (set! (-> s5-0 0 gui-channel) (gui-channel guard)) ) - (let ((s5-1 (-> obj channel-array 1))) + (let ((s5-1 (-> this channel-array 1))) (speech-channel-method-13 s5-1) - (set! (-> s5-1 speech-table) (-> obj speech-table)) + (set! (-> s5-1 speech-table) (-> this speech-table)) (set! (-> s5-1 gui-channel) (gui-channel citizen)) ) 0 @@ -289,19 +289,19 @@ ;; definition for method 15 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-15 speech-control ((obj speech-control) (arg0 process-drawable)) - (when (not (logtest? (-> obj channel-array 0 flags) (speech-channel-flag disable))) +(defmethod speech-control-method-15 speech-control ((this speech-control) (arg0 process-drawable)) + (when (not (logtest? (-> this channel-array 0 flags) (speech-channel-flag disable))) (let ((v1-3 *target*)) (when v1-3 (cond ((focus-test? v1-3 dark) - (speech-control-method-12 obj arg0 (speech-type speech-type-8)) + (speech-control-method-12 this arg0 (speech-type speech-type-8)) ) ((focus-test? v1-3 pilot) - (speech-control-method-12 obj arg0 (speech-type speech-type-7)) + (speech-control-method-12 this arg0 (speech-type speech-type-7)) ) (else - (speech-control-method-12 obj arg0 (speech-type speech-type-6)) + (speech-control-method-12 this arg0 (speech-type speech-type-6)) ) ) ) @@ -313,7 +313,7 @@ ;; definition for method 16 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-16 speech-control ((obj speech-control)) +(defmethod speech-control-method-16 speech-control ((this speech-control)) (set-action! *gui-control* (gui-action stop) @@ -335,7 +335,7 @@ (the-as process #f) ) (dotimes (s5-0 2) - (speech-channel-method-12 (-> obj channel-array s5-0)) + (speech-channel-method-12 (-> this channel-array s5-0)) ) 0 (none) @@ -343,168 +343,168 @@ ;; definition for method 9 of type speech-control ;; WARN: Return type mismatch int vs none. -(defmethod speech-control-method-9 speech-control ((obj speech-control)) +(defmethod speech-control-method-9 speech-control ((this speech-control)) (dotimes (v1-0 57) - (set! (-> obj speech-table v1-0) #f) + (set! (-> this speech-table v1-0) #f) ) (dotimes (s5-0 2) - (speech-channel-method-12 (-> obj channel-array s5-0)) + (speech-channel-method-12 (-> this channel-array s5-0)) ) - (speech-table-set! obj (speech-type speech-type-0) (new 'static 'speech-type-info - :priority 3 - :request-timeout #x12c - :min-delay (seconds 1) - :max-delay (seconds 1) - :list (new 'static 'boxed-array :type string) - ) + (speech-table-set! this (speech-type speech-type-0) (new 'static 'speech-type-info + :priority 3 + :request-timeout #x12c + :min-delay (seconds 1) + :max-delay (seconds 1) + :list (new 'static 'boxed-array :type string) + ) ) - (speech-table-set! obj (speech-type speech-type-3) (new 'static 'speech-type-info - :priority 3 - :request-timeout #x12c - :min-delay (seconds 1) - :max-delay (seconds 1) - :list (new 'static 'boxed-array :type string - "kg136" - "kg139" - "kg140" - "kg141" - "kg142" - "kg134" - "kg157" - "kg143" - "kg156" - "kg176" - "kg177" - "kg536" - "kg551" - ) - ) + (speech-table-set! this (speech-type speech-type-3) (new 'static 'speech-type-info + :priority 3 + :request-timeout #x12c + :min-delay (seconds 1) + :max-delay (seconds 1) + :list (new 'static 'boxed-array :type string + "kg136" + "kg139" + "kg140" + "kg141" + "kg142" + "kg134" + "kg157" + "kg143" + "kg156" + "kg176" + "kg177" + "kg536" + "kg551" + ) + ) ) - (speech-table-set! obj (speech-type speech-type-9) (new 'static 'speech-type-info - :priority 1 - :min-delay (seconds 2) - :max-delay (seconds 4) - :list (new 'static 'boxed-array :type string - "kg133" - "kg135" - "kg137" - "kg138" - "kg144" - "kg145" - "kg146" - "kg147" - "kg148" - "kg149" - "kg150" - "kg151" - "kg152" - "kg153" - "kg154" - "kg155" - "kg158" - "kg159" - "kg160" - "kg163" - "kg164" - "kg507" - "kg508" - "kg509" - "kg511" - "kg513" - "kg514" - "kg515" - "kg516" - "kg517" - "kg518" - "kg520" - "kg521" - "kg523" - "kg526" - "kg527" - "kg528" - "kg529" - "kg530" - "kg532" - "kg534" - "kg535" - "kg537" - "kg538" - "kg539" - "kg540" - "kg541" - "kg542" - "kg543" - "kg544" - "kg545" - "kg546" - "kg549" - "kg550" - ) - ) - ) - (speech-table-set! obj (speech-type speech-type-10) (new 'static 'speech-type-info - :flags (speech-type-flag random-order) - :priority 10 - :request-timeout #x258 + (speech-table-set! this (speech-type speech-type-9) (new 'static 'speech-type-info + :priority 1 :min-delay (seconds 2) :max-delay (seconds 4) :list (new 'static 'boxed-array :type string - "kg165" - "kg165a" - "kg165b" - "kg166" - "kg166a" - "kg166b" - "kg167" - "kg167a" - "kg167b" - "kg168" - "kg168a" - "kg168b" - "kg169" - "kg169a" - "kg169b" - "kg170" - "kg170a" - "kg170b" - "kg171" - "kg171a" - "kg171b" - "kg172" - "kg172a" - "kg172b" - "kg173" - "kg173a" - "kg173b" - "kg174" - "kg174a" - "kg174b" - "kg175" - "kg175a" - "kg175b" - "kg510" + "kg133" + "kg135" + "kg137" + "kg138" + "kg144" + "kg145" + "kg146" + "kg147" + "kg148" + "kg149" + "kg150" + "kg151" + "kg152" + "kg153" + "kg154" + "kg155" + "kg158" + "kg159" + "kg160" + "kg163" + "kg164" + "kg507" + "kg508" + "kg509" + "kg511" + "kg513" + "kg514" + "kg515" + "kg516" + "kg517" + "kg518" + "kg520" + "kg521" + "kg523" + "kg526" + "kg527" + "kg528" + "kg529" + "kg530" + "kg532" + "kg534" + "kg535" + "kg537" + "kg538" + "kg539" + "kg540" + "kg541" + "kg542" + "kg543" + "kg544" + "kg545" + "kg546" + "kg549" + "kg550" ) ) ) - (speech-table-set! obj (speech-type speech-type-11) (new 'static 'speech-type-info - :priority 2 - :min-delay (seconds 0.1) - :max-delay (seconds 0.1) - :list (new 'static 'boxed-array :type string - "kg386a" - "kg428a" - "kg641" - "kg650" - "kg338a" - "kg339a" - "kg340a" - "kg341a" - "kg342a" - "kg343a" - "kg344a" - "kg512" - ) - ) + (speech-table-set! this (speech-type speech-type-10) (new 'static 'speech-type-info + :flags (speech-type-flag random-order) + :priority 10 + :request-timeout #x258 + :min-delay (seconds 2) + :max-delay (seconds 4) + :list (new 'static 'boxed-array :type string + "kg165" + "kg165a" + "kg165b" + "kg166" + "kg166a" + "kg166b" + "kg167" + "kg167a" + "kg167b" + "kg168" + "kg168a" + "kg168b" + "kg169" + "kg169a" + "kg169b" + "kg170" + "kg170a" + "kg170b" + "kg171" + "kg171a" + "kg171b" + "kg172" + "kg172a" + "kg172b" + "kg173" + "kg173a" + "kg173b" + "kg174" + "kg174a" + "kg174b" + "kg175" + "kg175a" + "kg175b" + "kg510" + ) + ) + ) + (speech-table-set! this (speech-type speech-type-11) (new 'static 'speech-type-info + :priority 2 + :min-delay (seconds 0.1) + :max-delay (seconds 0.1) + :list (new 'static 'boxed-array :type string + "kg386a" + "kg428a" + "kg641" + "kg650" + "kg338a" + "kg339a" + "kg340a" + "kg341a" + "kg342a" + "kg343a" + "kg344a" + "kg512" + ) + ) ) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/actor-hash_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/actor-hash_REF.gc index d4f4397d2b..21f3a2c357 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/actor-hash_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/actor-hash_REF.gc @@ -20,15 +20,15 @@ ) ;; definition for method 3 of type actor-cshape-ptr -(defmethod inspect actor-cshape-ptr ((obj actor-cshape-ptr)) - (when (not obj) - (set! obj obj) +(defmethod inspect actor-cshape-ptr ((this actor-cshape-ptr)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'actor-cshape-ptr) - (format #t "~1Tcshape: ~A~%" (-> obj cshape)) + (format #t "[~8x] ~A~%" this 'actor-cshape-ptr) + (format #t "~1Tcshape: ~A~%" (-> this cshape)) (label cfg-4) - obj + this ) ;; definition of type actor-hash-bucket @@ -47,26 +47,26 @@ ) ;; definition for method 3 of type actor-hash-bucket -(defmethod inspect actor-hash-bucket ((obj actor-hash-bucket)) - (when (not obj) - (set! obj obj) +(defmethod inspect actor-hash-bucket ((this actor-hash-bucket)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'actor-hash-bucket) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tmax-length: ~D~%" (-> obj max-length)) - (format #t "~1Tdata: #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'actor-hash-bucket) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tmax-length: ~D~%" (-> this max-length)) + (format #t "~1Tdata: #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for method 9 of type actor-hash-bucket ;; WARN: Return type mismatch int vs none. -(defmethod add-actor-cshape actor-hash-bucket ((obj actor-hash-bucket) (arg0 collide-shape)) - (let ((v1-0 (-> obj length))) - (when (< v1-0 (-> obj max-length)) - (set! (-> obj data v1-0 cshape) arg0) - (set! (-> obj length) (+ v1-0 1)) +(defmethod add-actor-cshape actor-hash-bucket ((this actor-hash-bucket) (arg0 collide-shape)) + (let ((v1-0 (-> this length))) + (when (< v1-0 (-> this max-length)) + (set! (-> this data v1-0 cshape) arg0) + (set! (-> this length) (+ v1-0 1)) ) ) 0 @@ -89,36 +89,36 @@ ) ;; definition for method 3 of type actor-hash-buckets -(defmethod inspect actor-hash-buckets ((obj actor-hash-buckets)) - (when (not obj) - (set! obj obj) +(defmethod inspect actor-hash-buckets ((this actor-hash-buckets)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'actor-hash-buckets) - (format #t "~1Thash: ~A~%" (-> obj hash)) - (format #t "~1Tlist: ~A~%" (-> obj list)) - (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) - (format #t "~1Ttpos: #~%" (-> obj tpos)) + (format #t "[~8x] ~A~%" this 'actor-hash-buckets) + (format #t "~1Thash: ~A~%" (-> this hash)) + (format #t "~1Tlist: ~A~%" (-> this list)) + (format #t "~1Tdata[4] @ #x~X~%" (-> this data)) + (format #t "~1Ttpos: #~%" (-> this tpos)) (label cfg-4) - obj + this ) ;; definition for method 9 of type actor-hash-buckets ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hash-actors actor-hash-buckets ((obj actor-hash-buckets)) +(defmethod hash-actors actor-hash-buckets ((this actor-hash-buckets)) (local-vars (sv-16 hash-object-info) (sv-32 collide-prim-core) (sv-48 collide-shape) (sv-64 hash-object-info)) - (set! (-> obj hash) *actor-hash*) - (set! (-> obj list) *collide-hit-by-others-list*) - (clear-objects! (-> obj hash)) + (set! (-> this hash) *actor-hash*) + (set! (-> this list) *collide-hit-by-others-list*) + (clear-objects! (-> this hash)) (cond - ((>= 256 (-> obj list length)) - (let ((v1-5 (-> obj list alive-list next0))) - (-> obj list) + ((>= 256 (-> this list length)) + (let ((v1-5 (-> this list alive-list next0))) + (-> this list) (let ((s5-0 (-> v1-5 next0))) - (while (!= v1-5 (-> obj list alive-list-end)) + (while (!= v1-5 (-> this list alive-list-end)) (let* ((s4-0 (the-as collide-shape (-> (the-as connection v1-5) param1))) - (s3-0 (-> obj hash)) + (s3-0 (-> this hash)) (s1-0 (-> s4-0 root-prim prim-core)) (s0-0 s4-0) (s2-0 (-> s3-0 object-count)) @@ -150,55 +150,55 @@ (set! (-> s4-0 actor-hash-index) s2-0) ) (set! v1-5 s5-0) - (-> obj list) + (-> this list) (set! s5-0 (-> s5-0 next0)) ) ) ) ) (else - (set! (-> obj tpos quad) (-> (target-pos 0) quad)) + (set! (-> this tpos quad) (-> (target-pos 0) quad)) (dotimes (v1-21 4) - (set! (-> obj data v1-21 length) 0) + (set! (-> this data v1-21 length) 0) ) - (let ((v1-25 (-> obj list alive-list next0))) - (-> obj list) + (let ((v1-25 (-> this list alive-list next0))) + (-> this list) (let ((s5-2 (-> v1-25 next0))) - (while (!= v1-25 (-> obj list alive-list-end)) + (while (!= v1-25 (-> this list alive-list-end)) (let* ((s4-1 (the-as collide-shape (-> (the-as connection v1-25) param1))) - (f0-4 (vector-vector-distance-squared (-> obj tpos) (-> s4-1 trans))) + (f0-4 (vector-vector-distance-squared (-> this tpos) (-> s4-1 trans))) (f1-4 102400.0) ) (cond ((< f0-4 (* f1-4 f1-4)) - ((method-of-type actor-hash-bucket add-actor-cshape) (the-as actor-hash-bucket (-> obj data)) s4-1) + ((method-of-type actor-hash-bucket add-actor-cshape) (the-as actor-hash-bucket (-> this data)) s4-1) ) ((let ((f1-7 204800.0)) (< f0-4 (* f1-7 f1-7)) ) - (add-actor-cshape (-> obj data 1) s4-1) + (add-actor-cshape (-> this data 1) s4-1) ) ((let ((f1-10 307200.0)) (< f0-4 (* f1-10 f1-10)) ) - (add-actor-cshape (-> obj data 2) s4-1) + (add-actor-cshape (-> this data 2) s4-1) ) (else - (add-actor-cshape (-> obj data 3) s4-1) + (add-actor-cshape (-> this data 3) s4-1) ) ) ) (set! v1-25 s5-2) - (-> obj list) + (-> this list) (set! s5-2 (-> s5-2 next0)) ) ) ) (dotimes (s5-3 4) - (let ((s4-2 (-> obj data s5-3))) + (let ((s4-2 (-> this data s5-3))) (countdown (s3-1 (-> s4-2 length)) (let ((s2-1 (-> s4-2 data s3-1 cshape)) - (s1-1 (-> obj hash)) + (s1-1 (-> this hash)) ) (set! sv-32 (-> s2-1 root-prim prim-core)) (set! sv-48 s2-1) @@ -235,7 +235,7 @@ ) ) ) - (update-from-spheres (-> obj hash)) + (update-from-spheres (-> this hash)) 0 (none) ) @@ -1322,7 +1322,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash-h_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash-h_REF.gc index d4c7a97298..c449dbd801 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash-h_REF.gc @@ -1,15 +1,22 @@ +;;-*-Lisp-*- (in-package goal) +;; definition for symbol *collide-list-boxes*, type object (define *collide-list-boxes* (the-as object #f)) +;; definition for symbol *collide-hash-fragments*, type object (define *collide-hash-fragments* (the-as object 0)) +;; definition for symbol *collide-hash-fragments-tfrag*, type object (define *collide-hash-fragments-tfrag* (the-as object 0)) +;; definition for symbol *collide-hash-fragments-instance*, type object (define *collide-hash-fragments-instance* (the-as object 0)) +;; definition for symbol *already-printed-exeeded-max-cache-tris*, type symbol (define *already-printed-exeeded-max-cache-tris* #f) +;; definition of type collide-hash-scratch (deftype collide-hash-scratch (structure) ((collidable-bits uint128 128 :offset-assert 0) (poly-bits uint64 2 :offset 0) @@ -21,20 +28,22 @@ :flag-assert #x900000804 ) -(defmethod inspect collide-hash-scratch ((obj collide-hash-scratch)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type collide-hash-scratch +(defmethod inspect collide-hash-scratch ((this collide-hash-scratch)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-hash-scratch) - (format #t "~1Tcollidable-bits[128] @ #x~X~%" (-> obj collidable-bits)) - (format #t "~1Tpoly-bits[2] @ #x~X~%" (-> obj collidable-bits)) - (format #t "~1Tid-bits[512] @ #x~X~%" (-> obj collidable-bits)) - (format #t "~1Ttris: ~D~%" (-> obj tris)) + (format #t "[~8x] ~A~%" this 'collide-hash-scratch) + (format #t "~1Tcollidable-bits[128] @ #x~X~%" (-> this collidable-bits)) + (format #t "~1Tpoly-bits[2] @ #x~X~%" (-> this collidable-bits)) + (format #t "~1Tid-bits[512] @ #x~X~%" (-> this collidable-bits)) + (format #t "~1Ttris: ~D~%" (-> this tris)) (label cfg-4) - obj + this ) +;; definition of type collide-hash-bucket (deftype collide-hash-bucket (structure) ((index int16 :offset-assert 0) (count int16 :offset-assert 2) @@ -44,18 +53,20 @@ :flag-assert #x900000004 ) -(defmethod inspect collide-hash-bucket ((obj collide-hash-bucket)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type collide-hash-bucket +(defmethod inspect collide-hash-bucket ((this collide-hash-bucket)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-hash-bucket) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "[~8x] ~A~%" this 'collide-hash-bucket) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tcount: ~D~%" (-> this count)) (label cfg-4) - obj + this ) +;; definition of type collide-hash-item (deftype collide-hash-item (structure) ((id uint32 :offset-assert 0) (collidable basic :offset-assert 4) @@ -66,18 +77,20 @@ :flag-assert #x900000008 ) -(defmethod inspect collide-hash-item ((obj collide-hash-item)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type collide-hash-item +(defmethod inspect collide-hash-item ((this collide-hash-item)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-hash-item) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tcollidable: ~A~%" (-> obj collidable)) + (format #t "[~8x] ~A~%" this 'collide-hash-item) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tcollidable: ~A~%" (-> this collidable)) (label cfg-4) - obj + this ) +;; definition of type collide-hash-poly (deftype collide-hash-poly (structure) ((data uint8 4 :offset-assert 0) (vert-index0 uint8 :offset 0) @@ -91,22 +104,24 @@ :flag-assert #x900000004 ) -(defmethod inspect collide-hash-poly ((obj collide-hash-poly)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type collide-hash-poly +(defmethod inspect collide-hash-poly ((this collide-hash-poly)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-hash-poly) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj vert-index0)) - (format #t "~1Tvert-index0: ~D~%" (-> obj vert-index0)) - (format #t "~1Tvert-index1: ~D~%" (-> obj vert-index1)) - (format #t "~1Tvert-index2: ~D~%" (-> obj vert-index2)) - (format #t "~1Tpat-index: ~D~%" (-> obj pat-index)) - (format #t "~1Tword: ~D~%" (-> obj word)) + (format #t "[~8x] ~A~%" this 'collide-hash-poly) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this vert-index0)) + (format #t "~1Tvert-index0: ~D~%" (-> this vert-index0)) + (format #t "~1Tvert-index1: ~D~%" (-> this vert-index1)) + (format #t "~1Tvert-index2: ~D~%" (-> this vert-index2)) + (format #t "~1Tpat-index: ~D~%" (-> this pat-index)) + (format #t "~1Tword: ~D~%" (-> this word)) (label cfg-4) - obj + this ) +;; definition of type collide-hash-fragment-stats (deftype collide-hash-fragment-stats (structure) ((num-verts uint16 :offset-assert 0) (num-polys uint8 :offset-assert 2) @@ -118,19 +133,21 @@ :flag-assert #x900000004 ) -(defmethod inspect collide-hash-fragment-stats ((obj collide-hash-fragment-stats)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type collide-hash-fragment-stats +(defmethod inspect collide-hash-fragment-stats ((this collide-hash-fragment-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'collide-hash-fragment-stats) - (format #t "~1Tnum-verts: ~D~%" (-> obj num-verts)) - (format #t "~1Tnum-polys: ~D~%" (-> obj num-polys)) - (format #t "~1Tpoly-count: ~D~%" (-> obj poly-count)) + (format #t "[~8x] ~A~%" this 'collide-hash-fragment-stats) + (format #t "~1Tnum-verts: ~D~%" (-> this num-verts)) + (format #t "~1Tnum-polys: ~D~%" (-> this num-polys)) + (format #t "~1Tpoly-count: ~D~%" (-> this poly-count)) (label cfg-4) - obj + this ) +;; definition of type collide-hash-fragment (deftype collide-hash-fragment (drawable) ((num-buckets uint16 :offset 4) (num-indices uint16 :offset 6) @@ -155,35 +172,37 @@ :flag-assert #x1100000070 ) -(defmethod inspect collide-hash-fragment ((obj collide-hash-fragment)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type collide-hash-fragment +(defmethod inspect collide-hash-fragment ((this collide-hash-fragment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tnum-buckets: ~D~%" (-> obj num-buckets)) - (format #t "~1Tnum-indices: ~D~%" (-> obj num-indices)) - (format #t "~1Tpat-array: #x~X~%" (-> obj pat-array)) - (format #t "~1Tbucket-array: #x~X~%" (-> obj bucket-array)) - (format #t "~1Tgrid-step: #~%" (-> obj grid-step)) - (format #t "~1Tbbox: #~%" (-> obj bbox)) - (format #t "~1Tbbox4w: #~%" (-> obj bbox4w)) - (format #t "~1Taxis-scale: #~%" (-> obj bbox max)) - (format #t "~1Tavg-extents: #~%" (-> obj bbox4w)) - (format #t "~1Tdimension-array[4] @ #x~X~%" (&-> obj grid-step w)) - (format #t "~1Tstats: #~%" (&-> obj bbox min w)) - (format #t "~1Tnum-verts: ~D~%" (-> obj stats num-verts)) - (format #t "~1Tnum-polys: ~D~%" (-> obj stats num-polys)) - (format #t "~1Tpoly-count: ~D~%" (-> obj stats poly-count)) - (format #t "~1Tpoly-array: #x~X~%" (-> obj bbox max w)) - (format #t "~1Tvert-array: #x~X~%" (-> obj avg-extents w)) - (format #t "~1Tindex-array: #x~X~%" (-> obj index-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tnum-buckets: ~D~%" (-> this num-buckets)) + (format #t "~1Tnum-indices: ~D~%" (-> this num-indices)) + (format #t "~1Tpat-array: #x~X~%" (-> this pat-array)) + (format #t "~1Tbucket-array: #x~X~%" (-> this bucket-array)) + (format #t "~1Tgrid-step: #~%" (-> this grid-step)) + (format #t "~1Tbbox: #~%" (-> this bbox)) + (format #t "~1Tbbox4w: #~%" (-> this bbox4w)) + (format #t "~1Taxis-scale: #~%" (-> this bbox max)) + (format #t "~1Tavg-extents: #~%" (-> this bbox4w)) + (format #t "~1Tdimension-array[4] @ #x~X~%" (&-> this grid-step w)) + (format #t "~1Tstats: #~%" (&-> this bbox min w)) + (format #t "~1Tnum-verts: ~D~%" (-> this stats num-verts)) + (format #t "~1Tnum-polys: ~D~%" (-> this stats num-polys)) + (format #t "~1Tpoly-count: ~D~%" (-> this stats poly-count)) + (format #t "~1Tpoly-array: #x~X~%" (-> this bbox max w)) + (format #t "~1Tvert-array: #x~X~%" (-> this avg-extents w)) + (format #t "~1Tindex-array: #x~X~%" (-> this index-array)) (label cfg-4) - obj + this ) +;; definition of type collide-hash-fragment-array (deftype collide-hash-fragment-array (array) ((fragments collide-hash-fragment :dynamic :offset 16) ) @@ -192,20 +211,22 @@ :flag-assert #x900000010 ) -(defmethod inspect collide-hash-fragment-array ((obj collide-hash-fragment-array)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type collide-hash-fragment-array +(defmethod inspect collide-hash-fragment-array ((this collide-hash-fragment-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttype: ~A~%" (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tcontent-type: ~A~%" (-> obj content-type)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttype: ~A~%" (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tcontent-type: ~A~%" (-> this content-type)) (label cfg-4) - obj + this ) +;; definition of type collide-hash (deftype collide-hash (drawable) ((num-ids uint16 :offset 4) (id-count uint16 :offset 6) @@ -226,29 +247,31 @@ :flag-assert #x1100000060 ) -(defmethod inspect collide-hash ((obj collide-hash)) - (when (not obj) - (set! obj obj) +;; definition for method 3 of type collide-hash +(defmethod inspect collide-hash ((this collide-hash)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) - (format #t "~1Tnum-ids: ~D~%" (-> obj num-ids)) - (format #t "~1Tid-count: ~D~%" (-> obj id-count)) - (format #t "~1Tnum-buckets: ~D~%" (-> obj num-buckets)) - (format #t "~1Tqwc-id-bits: ~D~%" (-> obj qwc-id-bits)) - (format #t "~1Tgrid-step: #~%" (-> obj bsphere)) - (format #t "~1Tbbox: #~%" (-> obj bbox)) - (format #t "~1Tbbox4w: #~%" (-> obj bbox4w)) - (format #t "~1Taxis-scale: #~%" (-> obj bbox max)) - (format #t "~1Tavg-extents: #~%" (-> obj bbox4w)) - (format #t "~1Tbucket-array: #x~X~%" (-> obj bbox min w)) - (format #t "~1Titem-array: #x~X~%" (-> obj item-array)) - (format #t "~1Tdimension-array[3] @ #x~X~%" (&-> obj bbox4w min w)) - (format #t "~1Tnum-items: ~D~%" (-> obj num-items)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> this bsphere)) + (format #t "~1Tnum-ids: ~D~%" (-> this num-ids)) + (format #t "~1Tid-count: ~D~%" (-> this id-count)) + (format #t "~1Tnum-buckets: ~D~%" (-> this num-buckets)) + (format #t "~1Tqwc-id-bits: ~D~%" (-> this qwc-id-bits)) + (format #t "~1Tgrid-step: #~%" (-> this bsphere)) + (format #t "~1Tbbox: #~%" (-> this bbox)) + (format #t "~1Tbbox4w: #~%" (-> this bbox4w)) + (format #t "~1Taxis-scale: #~%" (-> this bbox max)) + (format #t "~1Tavg-extents: #~%" (-> this bbox4w)) + (format #t "~1Tbucket-array: #x~X~%" (-> this bbox min w)) + (format #t "~1Titem-array: #x~X~%" (-> this item-array)) + (format #t "~1Tdimension-array[3] @ #x~X~%" (&-> this bbox4w min w)) + (format #t "~1Tnum-items: ~D~%" (-> this num-items)) (label cfg-4) - obj + this ) +;; failed to figure out what this is: 0 diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc index 334c1e116f..7eb7386987 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc @@ -614,46 +614,46 @@ ;; definition for method 8 of type collide-hash ;; INFO: Used lq/sq -(defmethod mem-usage collide-hash ((obj collide-hash) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-hash ((this collide-hash) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 51 (-> arg0 length))) (set! (-> arg0 data 50 name) (symbol->string 'collision)) (+! (-> arg0 data 50 count) 1) - (let ((v1-10 (+ (* (-> obj num-items) 8) 96 (* (-> obj num-buckets) 4)))) + (let ((v1-10 (+ (* (-> this num-items) 8) 96 (* (-> this num-buckets) 4)))) (+! (-> arg0 data 50 used) v1-10) (+! (-> arg0 data 50 total) (logand -16 (+ v1-10 15))) ) - (dotimes (v1-14 (the-as int (-> obj qwc-id-bits))) + (dotimes (v1-14 (the-as int (-> this qwc-id-bits))) (set! (-> (the-as collide-hash-scratch #x70000000) collidable-bits v1-14) (the-as uint128 0)) ) - (dotimes (s3-0 (the-as int (-> obj num-items))) - (let* ((a0-12 (-> obj item-array s3-0 id)) + (dotimes (s3-0 (the-as int (-> this num-items))) + (let* ((a0-12 (-> this item-array s3-0 id)) (v1-19 (shr a0-12 5)) ) (when (not (logtest? (-> (the-as collide-hash-scratch #x70000000) id-bits v1-19) (ash 1 (logand a0-12 31)))) (logior! (-> (the-as collide-hash-scratch #x70000000) id-bits v1-19) (ash 1 (logand a0-12 31))) - (if (= (-> obj item-array s3-0 collidable type) collide-hash-fragment) - (mem-usage (-> obj item-array s3-0 collidable) arg0 arg1) + (if (= (-> this item-array s3-0 collidable type) collide-hash-fragment) + (mem-usage (-> this item-array s3-0 collidable) arg0 arg1) ) ) ) ) - obj + this ) ;; definition for method 8 of type collide-hash-fragment -(defmethod mem-usage collide-hash-fragment ((obj collide-hash-fragment) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-hash-fragment ((this collide-hash-fragment) (arg0 memory-usage-block) (arg1 int)) (cond ((logtest? arg1 1) (set! (-> arg0 length) (max 58 (-> arg0 length))) (set! (-> arg0 data 55 name) (symbol->string 'prototype-fragment)) (+! (-> arg0 data 55 count) 1) (set! (-> arg0 data 56 name) (symbol->string 'prototype-poly)) - (+! (-> arg0 data 56 count) (-> obj stats num-polys)) + (+! (-> arg0 data 56 count) (-> this stats num-polys)) (set! (-> arg0 data 57 name) (symbol->string 'prototype-vertex)) - (+! (-> arg0 data 57 count) (-> obj stats num-verts)) - (let ((a3-0 (+ (-> obj num-indices) 112 (* (-> obj num-buckets) 4))) - (a2-9 (* (-> obj stats num-polys) 4)) - (v1-22 (* (the-as uint 6) (-> obj stats num-verts))) + (+! (-> arg0 data 57 count) (-> this stats num-verts)) + (let ((a3-0 (+ (-> this num-indices) 112 (* (-> this num-buckets) 4))) + (a2-9 (* (-> this stats num-polys) 4)) + (v1-22 (* (the-as uint 6) (-> this stats num-verts))) ) (+! (-> arg0 data 55 used) a3-0) (+! (-> arg0 data 55 total) (- (logand -16 (+ v1-22 15 a2-9 a3-0)) (the-as int (+ a2-9 v1-22)))) @@ -668,12 +668,12 @@ (set! (-> arg0 data 51 name) (symbol->string 'collision-fragment)) (+! (-> arg0 data 51 count) 1) (set! (-> arg0 data 52 name) (symbol->string 'collision-poly)) - (+! (-> arg0 data 52 count) (-> obj stats num-polys)) + (+! (-> arg0 data 52 count) (-> this stats num-polys)) (set! (-> arg0 data 53 name) (symbol->string 'collision-vertex)) - (+! (-> arg0 data 53 count) (-> obj stats num-verts)) - (let ((a3-8 (+ (-> obj num-indices) 112 (* (-> obj num-buckets) 4))) - (a2-22 (* (-> obj stats num-polys) 4)) - (v1-45 (* (the-as uint 6) (-> obj stats num-verts))) + (+! (-> arg0 data 53 count) (-> this stats num-verts)) + (let ((a3-8 (+ (-> this num-indices) 112 (* (-> this num-buckets) 4))) + (a2-22 (* (-> this stats num-polys) 4)) + (v1-45 (* (the-as uint 6) (-> this stats num-verts))) ) (+! (-> arg0 data 51 used) a3-8) (+! (-> arg0 data 51 total) (- (logand -16 (+ v1-45 15 a2-22 a3-8)) (the-as int (+ a2-22 v1-45)))) @@ -684,20 +684,20 @@ ) ) ) - obj + this ) ;; definition for method 8 of type collide-hash-fragment-array -(defmethod mem-usage collide-hash-fragment-array ((obj collide-hash-fragment-array) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage collide-hash-fragment-array ((this collide-hash-fragment-array) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 55 (-> arg0 length))) (set! (-> arg0 data 54 name) (symbol->string 'prototype-collision)) (+! (-> arg0 data 54 count) 1) - (let ((v1-8 (asize-of obj))) + (let ((v1-8 (asize-of this))) (+! (-> arg0 data 54 used) v1-8) (+! (-> arg0 data 54 total) (logand -16 (+ v1-8 15))) ) - (dotimes (s3-0 (-> obj length)) - (mem-usage (-> obj fragments s3-0) arg0 arg1) + (dotimes (s3-0 (-> this length)) + (mem-usage (-> this fragments s3-0) arg0 arg1) ) - obj + this ) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc index 6c9ad5d114..ec49d3a33c 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/spatial-hash-h_REF.gc @@ -21,16 +21,16 @@ ) ;; definition for method 3 of type grid-hash-box -(defmethod inspect grid-hash-box ((obj grid-hash-box)) - (when (not obj) - (set! obj obj) +(defmethod inspect grid-hash-box ((this grid-hash-box)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'grid-hash-box) - (format #t "~1Tmin[3] @ #x~X~%" (-> obj min)) - (format #t "~1Tmax[3] @ #x~X~%" (-> obj max)) + (format #t "[~8x] ~A~%" this 'grid-hash-box) + (format #t "~1Tmin[3] @ #x~X~%" (-> this min)) + (format #t "~1Tmax[3] @ #x~X~%" (-> this max)) (label cfg-4) - obj + this ) ;; definition of type grid-hash @@ -78,31 +78,31 @@ ) ;; definition for method 3 of type grid-hash -(defmethod inspect grid-hash ((obj grid-hash)) - (when (not obj) - (set! obj obj) +(defmethod inspect grid-hash ((this grid-hash)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twork: ~A~%" (-> obj work)) - (format #t "~1Tsearch-box: #~%" (-> obj search-box)) - (format #t "~1Tbucket-size: ~D~%" (-> obj bucket-size)) - (format #t "~1Taxis-scale[3] @ #x~X~%" (-> obj axis-scale)) - (format #t "~1Tdimension-array[3] @ #x~X~%" (-> obj dimension-array)) - (format #t "~1Tvertical-cell-count: ~D~%" (-> obj vertical-cell-count)) - (format #t "~1Tbucket-array: #x~X~%" (-> obj bucket-array)) - (format #t "~1Tbox-min[3] @ #x~X~%" (-> obj box-min)) - (format #t "~1Tbox-max[3] @ #x~X~%" (-> obj box-max)) - (format #t "~1Tobject-count: ~D~%" (-> obj object-count)) - (format #t "~1Tbucket-count: ~D~%" (-> obj bucket-count)) - (format #t "~1Tmin-cell-size: ~f~%" (-> obj min-cell-size)) - (format #t "~1Tbucket-memory-size: ~D~%" (-> obj bucket-memory-size)) - (format #t "~1Tmem-bucket-array: #x~X~%" (-> obj mem-bucket-array)) - (format #t "~1Tspr-bucket-array: #x~X~%" (-> obj spr-bucket-array)) - (format #t "~1Tdebug-draw: ~A~%" (-> obj debug-draw)) - (format #t "~1Tuse-scratch-ram: ~A~%" (-> obj use-scratch-ram)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twork: ~A~%" (-> this work)) + (format #t "~1Tsearch-box: #~%" (-> this search-box)) + (format #t "~1Tbucket-size: ~D~%" (-> this bucket-size)) + (format #t "~1Taxis-scale[3] @ #x~X~%" (-> this axis-scale)) + (format #t "~1Tdimension-array[3] @ #x~X~%" (-> this dimension-array)) + (format #t "~1Tvertical-cell-count: ~D~%" (-> this vertical-cell-count)) + (format #t "~1Tbucket-array: #x~X~%" (-> this bucket-array)) + (format #t "~1Tbox-min[3] @ #x~X~%" (-> this box-min)) + (format #t "~1Tbox-max[3] @ #x~X~%" (-> this box-max)) + (format #t "~1Tobject-count: ~D~%" (-> this object-count)) + (format #t "~1Tbucket-count: ~D~%" (-> this bucket-count)) + (format #t "~1Tmin-cell-size: ~f~%" (-> this min-cell-size)) + (format #t "~1Tbucket-memory-size: ~D~%" (-> this bucket-memory-size)) + (format #t "~1Tmem-bucket-array: #x~X~%" (-> this mem-bucket-array)) + (format #t "~1Tspr-bucket-array: #x~X~%" (-> this spr-bucket-array)) + (format #t "~1Tdebug-draw: ~A~%" (-> this debug-draw)) + (format #t "~1Tuse-scratch-ram: ~A~%" (-> this use-scratch-ram)) (label cfg-4) - obj + this ) ;; definition of type find-nav-sphere-ids-params @@ -120,20 +120,20 @@ ) ;; definition for method 3 of type find-nav-sphere-ids-params -(defmethod inspect find-nav-sphere-ids-params ((obj find-nav-sphere-ids-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect find-nav-sphere-ids-params ((this find-nav-sphere-ids-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'find-nav-sphere-ids-params) - (format #t "~1Tbsphere: #~%" (-> obj bsphere)) - (format #t "~1Ty-threshold: ~f~%" (-> obj y-threshold)) - (format #t "~1Tlen: ~D~%" (-> obj len)) - (format #t "~1Tmax-len: ~D~%" (-> obj max-len)) - (format #t "~1Tmask: ~D~%" (-> obj mask)) - (format #t "~1Tarray: #x~X~%" (-> obj array)) + (format #t "[~8x] ~A~%" this 'find-nav-sphere-ids-params) + (format #t "~1Tbsphere: #~%" (-> this bsphere)) + (format #t "~1Ty-threshold: ~f~%" (-> this y-threshold)) + (format #t "~1Tlen: ~D~%" (-> this len)) + (format #t "~1Tmax-len: ~D~%" (-> this max-len)) + (format #t "~1Tmask: ~D~%" (-> this mask)) + (format #t "~1Tarray: #x~X~%" (-> this array)) (label cfg-4) - obj + this ) ;; definition of type sphere-hash @@ -162,36 +162,36 @@ ) ;; definition for method 3 of type sphere-hash -(defmethod inspect sphere-hash ((obj sphere-hash)) - (when (not obj) - (set! obj obj) +(defmethod inspect sphere-hash ((this sphere-hash)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twork: ~A~%" (-> obj work)) - (format #t "~1Tsearch-box: #~%" (-> obj search-box)) - (format #t "~1Tbucket-size: ~D~%" (-> obj bucket-size)) - (format #t "~1Taxis-scale[3] @ #x~X~%" (-> obj axis-scale)) - (format #t "~1Tdimension-array[3] @ #x~X~%" (-> obj dimension-array)) - (format #t "~1Tvertical-cell-count: ~D~%" (-> obj vertical-cell-count)) - (format #t "~1Tbucket-array: #x~X~%" (-> obj bucket-array)) - (format #t "~1Tbox-min[3] @ #x~X~%" (-> obj box-min)) - (format #t "~1Tbox-max[3] @ #x~X~%" (-> obj box-max)) - (format #t "~1Tobject-count: ~D~%" (-> obj object-count)) - (format #t "~1Tbucket-count: ~D~%" (-> obj bucket-count)) - (format #t "~1Tmin-cell-size: ~f~%" (-> obj min-cell-size)) - (format #t "~1Tbucket-memory-size: ~D~%" (-> obj bucket-memory-size)) - (format #t "~1Tmem-bucket-array: #x~X~%" (-> obj mem-bucket-array)) - (format #t "~1Tspr-bucket-array: #x~X~%" (-> obj spr-bucket-array)) - (format #t "~1Tdebug-draw: ~A~%" (-> obj debug-draw)) - (format #t "~1Tuse-scratch-ram: ~A~%" (-> obj use-scratch-ram)) - (format #t "~1Tsphere-array: #x~X~%" (-> obj sphere-array)) - (format #t "~1Tmax-object-count: ~D~%" (-> obj max-object-count)) - (format #t "~1Tpad: ~D~%" (-> obj pad)) - (format #t "~1Tmem-sphere-array: #x~X~%" (-> obj mem-sphere-array)) - (format #t "~1Tspr-sphere-array: #x~X~%" (-> obj spr-sphere-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twork: ~A~%" (-> this work)) + (format #t "~1Tsearch-box: #~%" (-> this search-box)) + (format #t "~1Tbucket-size: ~D~%" (-> this bucket-size)) + (format #t "~1Taxis-scale[3] @ #x~X~%" (-> this axis-scale)) + (format #t "~1Tdimension-array[3] @ #x~X~%" (-> this dimension-array)) + (format #t "~1Tvertical-cell-count: ~D~%" (-> this vertical-cell-count)) + (format #t "~1Tbucket-array: #x~X~%" (-> this bucket-array)) + (format #t "~1Tbox-min[3] @ #x~X~%" (-> this box-min)) + (format #t "~1Tbox-max[3] @ #x~X~%" (-> this box-max)) + (format #t "~1Tobject-count: ~D~%" (-> this object-count)) + (format #t "~1Tbucket-count: ~D~%" (-> this bucket-count)) + (format #t "~1Tmin-cell-size: ~f~%" (-> this min-cell-size)) + (format #t "~1Tbucket-memory-size: ~D~%" (-> this bucket-memory-size)) + (format #t "~1Tmem-bucket-array: #x~X~%" (-> this mem-bucket-array)) + (format #t "~1Tspr-bucket-array: #x~X~%" (-> this spr-bucket-array)) + (format #t "~1Tdebug-draw: ~A~%" (-> this debug-draw)) + (format #t "~1Tuse-scratch-ram: ~A~%" (-> this use-scratch-ram)) + (format #t "~1Tsphere-array: #x~X~%" (-> this sphere-array)) + (format #t "~1Tmax-object-count: ~D~%" (-> this max-object-count)) + (format #t "~1Tpad: ~D~%" (-> this pad)) + (format #t "~1Tmem-sphere-array: #x~X~%" (-> this mem-sphere-array)) + (format #t "~1Tspr-sphere-array: #x~X~%" (-> this spr-sphere-array)) (label cfg-4) - obj + this ) ;; definition of type hash-object-info @@ -204,15 +204,15 @@ ) ;; definition for method 3 of type hash-object-info -(defmethod inspect hash-object-info ((obj hash-object-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect hash-object-info ((this hash-object-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hash-object-info) - (format #t "~1Tobject: ~A~%" (-> obj object)) + (format #t "[~8x] ~A~%" this 'hash-object-info) + (format #t "~1Tobject: ~A~%" (-> this object)) (label cfg-4) - obj + this ) ;; definition of type spatial-hash @@ -237,39 +237,39 @@ ) ;; definition for method 3 of type spatial-hash -(defmethod inspect spatial-hash ((obj spatial-hash)) - (when (not obj) - (set! obj obj) +(defmethod inspect spatial-hash ((this spatial-hash)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twork: ~A~%" (-> obj work)) - (format #t "~1Tsearch-box: #~%" (-> obj search-box)) - (format #t "~1Tbucket-size: ~D~%" (-> obj bucket-size)) - (format #t "~1Taxis-scale[3] @ #x~X~%" (-> obj axis-scale)) - (format #t "~1Tdimension-array[3] @ #x~X~%" (-> obj dimension-array)) - (format #t "~1Tvertical-cell-count: ~D~%" (-> obj vertical-cell-count)) - (format #t "~1Tbucket-array: #x~X~%" (-> obj bucket-array)) - (format #t "~1Tbox-min[3] @ #x~X~%" (-> obj box-min)) - (format #t "~1Tbox-max[3] @ #x~X~%" (-> obj box-max)) - (format #t "~1Tobject-count: ~D~%" (-> obj object-count)) - (format #t "~1Tbucket-count: ~D~%" (-> obj bucket-count)) - (format #t "~1Tmin-cell-size: ~f~%" (-> obj min-cell-size)) - (format #t "~1Tbucket-memory-size: ~D~%" (-> obj bucket-memory-size)) - (format #t "~1Tmem-bucket-array: #x~X~%" (-> obj mem-bucket-array)) - (format #t "~1Tspr-bucket-array: #x~X~%" (-> obj spr-bucket-array)) - (format #t "~1Tdebug-draw: ~A~%" (-> obj debug-draw)) - (format #t "~1Tuse-scratch-ram: ~A~%" (-> obj use-scratch-ram)) - (format #t "~1Tsphere-array: #x~X~%" (-> obj sphere-array)) - (format #t "~1Tmax-object-count: ~D~%" (-> obj max-object-count)) - (format #t "~1Tpad: ~D~%" (-> obj pad)) - (format #t "~1Tmem-sphere-array: #x~X~%" (-> obj mem-sphere-array)) - (format #t "~1Tspr-sphere-array: #x~X~%" (-> obj spr-sphere-array)) - (format #t "~1Tobject-array: #x~X~%" (-> obj object-array)) - (format #t "~1Tmem-object-array: #x~X~%" (-> obj mem-object-array)) - (format #t "~1Tspr-object-array: #x~X~%" (-> obj spr-object-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twork: ~A~%" (-> this work)) + (format #t "~1Tsearch-box: #~%" (-> this search-box)) + (format #t "~1Tbucket-size: ~D~%" (-> this bucket-size)) + (format #t "~1Taxis-scale[3] @ #x~X~%" (-> this axis-scale)) + (format #t "~1Tdimension-array[3] @ #x~X~%" (-> this dimension-array)) + (format #t "~1Tvertical-cell-count: ~D~%" (-> this vertical-cell-count)) + (format #t "~1Tbucket-array: #x~X~%" (-> this bucket-array)) + (format #t "~1Tbox-min[3] @ #x~X~%" (-> this box-min)) + (format #t "~1Tbox-max[3] @ #x~X~%" (-> this box-max)) + (format #t "~1Tobject-count: ~D~%" (-> this object-count)) + (format #t "~1Tbucket-count: ~D~%" (-> this bucket-count)) + (format #t "~1Tmin-cell-size: ~f~%" (-> this min-cell-size)) + (format #t "~1Tbucket-memory-size: ~D~%" (-> this bucket-memory-size)) + (format #t "~1Tmem-bucket-array: #x~X~%" (-> this mem-bucket-array)) + (format #t "~1Tspr-bucket-array: #x~X~%" (-> this spr-bucket-array)) + (format #t "~1Tdebug-draw: ~A~%" (-> this debug-draw)) + (format #t "~1Tuse-scratch-ram: ~A~%" (-> this use-scratch-ram)) + (format #t "~1Tsphere-array: #x~X~%" (-> this sphere-array)) + (format #t "~1Tmax-object-count: ~D~%" (-> this max-object-count)) + (format #t "~1Tpad: ~D~%" (-> this pad)) + (format #t "~1Tmem-sphere-array: #x~X~%" (-> this mem-sphere-array)) + (format #t "~1Tspr-sphere-array: #x~X~%" (-> this spr-sphere-array)) + (format #t "~1Tobject-array: #x~X~%" (-> this object-array)) + (format #t "~1Tmem-object-array: #x~X~%" (-> this mem-object-array)) + (format #t "~1Tspr-object-array: #x~X~%" (-> this spr-object-array)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 a1d83cb2ed..5bccb75dcb 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 @@ -21,25 +21,25 @@ ) ;; definition for method 3 of type grid-hash-work -(defmethod inspect grid-hash-work ((obj grid-hash-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect grid-hash-work ((this grid-hash-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tresult-words[32] @ #x~X~%" (-> obj result-words)) - (format #t "~1Tresult-bits[32] @ #x~X~%" (-> obj result-words)) - (format #t "~1Tobject-id: ~D~%" (-> obj object-id)) - (format #t "~1Ttemp-box-min: #~%" (-> obj temp-box-min)) - (format #t "~1Ttemp-box-max: #~%" (-> obj temp-box-max)) - (format #t "~1Tvisit-count: ~D~%" (-> obj visit-count)) - (format #t "~1Ttemp-time: ~D~%" (-> obj temp-time)) - (format #t "~1Tqueue-object-time: ~D~%" (-> obj queue-object-time)) - (format #t "~1Tmake-hash-time: ~D~%" (-> obj make-hash-time)) - (format #t "~1Tsearch-time: ~D~%" (-> obj search-time)) - (format #t "~1Tadd-object-time: ~D~%" (-> obj add-object-time)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tresult-words[32] @ #x~X~%" (-> this result-words)) + (format #t "~1Tresult-bits[32] @ #x~X~%" (-> this result-words)) + (format #t "~1Tobject-id: ~D~%" (-> this object-id)) + (format #t "~1Ttemp-box-min: #~%" (-> this temp-box-min)) + (format #t "~1Ttemp-box-max: #~%" (-> this temp-box-max)) + (format #t "~1Tvisit-count: ~D~%" (-> this visit-count)) + (format #t "~1Ttemp-time: ~D~%" (-> this temp-time)) + (format #t "~1Tqueue-object-time: ~D~%" (-> this queue-object-time)) + (format #t "~1Tmake-hash-time: ~D~%" (-> this make-hash-time)) + (format #t "~1Tsearch-time: ~D~%" (-> this search-time)) + (format #t "~1Tadd-object-time: ~D~%" (-> this add-object-time)) (label cfg-4) - obj + this ) ;; definition for symbol *grid-hash-work*, type grid-hash-work @@ -72,12 +72,12 @@ ;; definition for method 16 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod verify-bits-in-bucket grid-hash ((obj grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) +(defmethod verify-bits-in-bucket grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 grid-hash-box)) (let ((s5-0 0)) 0 (let ((v1-1 8) - (a0-1 (-> obj object-count)) - (a1-2 (* (-> obj bucket-size) 8)) + (a0-1 (-> this object-count)) + (a1-2 (* (-> this bucket-size) 8)) ) (while (< a0-1 a1-2) (let ((a3-0 (- a0-1 (* (/ a0-1 v1-1) v1-1)))) @@ -86,8 +86,8 @@ (+! a0-1 1) ) ) - (dotimes (s4-0 (-> obj bucket-count)) - (let ((a3-2 (-> obj bucket-array (+ (-> obj bucket-size) -1 (* s4-0 (-> obj bucket-size)))))) + (dotimes (s4-0 (-> this bucket-count)) + (let ((a3-2 (-> this bucket-array (+ (-> this bucket-size) -1 (* s4-0 (-> this bucket-size)))))) (when (logtest? a3-2 s5-0) (format 0 "bad bits in bucket ~d bucket-word ~8x test-word ~8x~%" s4-0 a3-2 s5-0) (break!) @@ -102,18 +102,18 @@ ;; definition for method 17 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod box-of-everything grid-hash ((obj grid-hash) (arg0 object) (arg1 grid-hash-box)) +(defmethod box-of-everything grid-hash ((this grid-hash) (arg0 object) (arg1 grid-hash-box)) (dotimes (v1-0 3) - (set! (-> arg1 min v1-0) (-> obj dimension-array v1-0)) + (set! (-> arg1 min v1-0) (-> this dimension-array v1-0)) (set! (-> arg1 max v1-0) -1) ) - (let* ((v1-3 (-> obj bucket-size)) - (a3-4 (* (-> obj dimension-array 0) v1-3)) - (t0-3 (* (-> obj dimension-array 2) a3-4)) - (t1-0 (-> obj dimension-array 0)) - (t2-0 (-> obj dimension-array 2)) - (t3-0 (-> obj dimension-array 1)) - (a0-2 (&-> (-> obj bucket-array) (/ (the-as int arg0) 8))) + (let* ((v1-3 (-> this bucket-size)) + (a3-4 (* (-> this dimension-array 0) v1-3)) + (t0-3 (* (-> this dimension-array 2) a3-4)) + (t1-0 (-> this dimension-array 0)) + (t2-0 (-> this dimension-array 2)) + (t3-0 (-> this dimension-array 1)) + (a0-2 (&-> (-> this bucket-array) (/ (the-as int arg0) 8))) (a1-2 (ash 1 (logand (the-as int arg0) 7))) ) (dotimes (t4-3 t3-0) @@ -186,23 +186,23 @@ ;; definition for method 21 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod set-up-box grid-hash ((obj grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) +(defmethod set-up-box grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector)) (dotimes (v1-0 3) (set! (-> arg0 min v1-0) (the int (fmax 0.0 (fmin - (* (- (-> arg1 data v1-0) (-> obj box-min v1-0)) (-> obj axis-scale v1-0)) - (the float (+ (-> obj dimension-array v1-0) -1)) + (* (- (-> arg1 data v1-0) (-> this box-min v1-0)) (-> this axis-scale v1-0)) + (the float (+ (-> this dimension-array v1-0) -1)) ) ) ) ) (set! (-> arg0 max v1-0) (the int (fmax 0.0 (fmin - (* (- (-> arg2 data v1-0) (-> obj box-min v1-0)) (-> obj axis-scale v1-0)) - (the float (+ (-> obj dimension-array v1-0) -1)) + (* (- (-> arg2 data v1-0) (-> this box-min v1-0)) (-> this axis-scale v1-0)) + (the float (+ (-> this dimension-array v1-0) -1)) ) ) ) @@ -219,7 +219,7 @@ ;; definition for method 23 of type grid-hash ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod line-sphere-to-grid-box grid-hash ((obj grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod line-sphere-to-grid-box grid-hash ((this grid-hash) (arg0 grid-hash-box) (arg1 vector) (arg2 vector) (arg3 float)) (let ((s4-0 (new 'stack-no-clear 'grid-hash-box)) (s5-0 (new 'stack-no-clear 'grid-hash-box)) ) @@ -230,8 +230,8 @@ (vector+! s2-0 arg1 arg2) (set! (-> v1-0 w) arg3) (set! (-> s2-0 w) arg3) - (sphere-to-grid-box obj s4-0 (the-as sphere v1-0)) - (sphere-to-grid-box obj s5-0 (the-as sphere s2-0)) + (sphere-to-grid-box this s4-0 (the-as sphere v1-0)) + (sphere-to-grid-box this s5-0 (the-as sphere s2-0)) ) (set! (-> arg0 min 0) (min (-> s4-0 min 0) (-> s5-0 min 0))) (set! (-> arg0 min 1) (min (-> s4-0 min 1) (-> s5-0 min 1))) @@ -247,16 +247,16 @@ ;; definition for method 10 of type grid-hash ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod clear-bucket-array grid-hash ((obj grid-hash)) - (let ((v1-5 (/ (+ (* (* (* (-> obj dimension-array 0) (-> obj dimension-array 1)) (-> obj dimension-array 2)) - (-> obj bucket-size) +(defmethod clear-bucket-array grid-hash ((this grid-hash)) + (let ((v1-5 (/ (+ (* (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)) + (-> this bucket-size) ) 15 ) 16 ) ) - (a0-1 (the-as (pointer uinteger) (-> obj bucket-array))) + (a0-1 (the-as (pointer uinteger) (-> this bucket-array))) ) (while (nonzero? v1-5) (+! v1-5 -1) @@ -271,25 +271,25 @@ ;; definition for method 24 of type grid-hash ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-grid grid-hash ((obj grid-hash)) +(defmethod update-grid grid-hash ((this grid-hash)) (let ((v1-0 (new 'stack-no-clear 'vector))) (dotimes (a1-0 3) - (set! (-> v1-0 data a1-0) (fmax (-> obj min-cell-size) (- (-> obj box-max a1-0) (-> obj box-min a1-0)))) + (set! (-> v1-0 data a1-0) (fmax (-> this min-cell-size) (- (-> this box-max a1-0) (-> this box-min a1-0)))) ) (b! - (and (> (-> obj object-count) 0) (< 0.0 (-> v1-0 x)) (< 0.0 (-> v1-0 y)) (< 0.0 (-> v1-0 z))) + (and (> (-> this object-count) 0) (< 0.0 (-> v1-0 x)) (< 0.0 (-> v1-0 y)) (< 0.0 (-> v1-0 z))) cfg-23 :delay (empty-form) ) - (set! (-> obj bucket-count) 1) - (set! (-> obj bucket-size) 1) + (set! (-> this bucket-count) 1) + (set! (-> this bucket-size) 1) (dotimes (v1-3 3) - (set! (-> obj box-min v1-3) 0.0) - (set! (-> obj box-max v1-3) 0.0) - (set! (-> obj axis-scale v1-3) 0.0) - (set! (-> obj dimension-array v1-3) 1) + (set! (-> this box-min v1-3) 0.0) + (set! (-> this box-max v1-3) 0.0) + (set! (-> this axis-scale v1-3) 0.0) + (set! (-> this dimension-array v1-3) 1) ) - (let* ((v1-6 obj) + (let* ((v1-6 this) (a0-6 (/ (+ (* (* (* (-> v1-6 dimension-array 0) (-> v1-6 dimension-array 1)) (-> v1-6 dimension-array 2)) (-> v1-6 bucket-size) @@ -311,21 +311,21 @@ (b! #t cfg-41 :delay (nop!)) (label cfg-23) (let ((a1-18 8)) - (set! (-> obj bucket-size) (/ (+ a1-18 -1 (-> obj object-count)) a1-18)) + (set! (-> this bucket-size) (/ (+ a1-18 -1 (-> this object-count)) a1-18)) ) - (set! (-> obj bucket-count) - (min (* (-> obj object-count) 16) (/ (-> obj bucket-memory-size) (-> obj bucket-size))) + (set! (-> this bucket-count) + (min (* (-> this object-count) 16) (/ (-> this bucket-memory-size) (-> this bucket-size))) ) (let ((f0-11 (sqrtf - (/ (the float (-> obj bucket-count)) (* (-> v1-0 x) (-> v1-0 z) (the float (-> obj vertical-cell-count)))) + (/ (the float (-> this bucket-count)) (* (-> v1-0 x) (-> v1-0 z) (the float (-> this vertical-cell-count)))) ) ) ) - (let ((a1-27 (min 126 (+ (-> obj bucket-count) -1)))) - (set! (-> obj dimension-array 0) (max 1 (min (the int (* f0-11 (-> v1-0 x))) a1-27))) - (set! (-> obj dimension-array 1) (-> obj vertical-cell-count)) - (set! (-> obj dimension-array 2) (max 1 (min (the int (* f0-11 (-> v1-0 z))) a1-27))) + (let ((a1-27 (min 126 (+ (-> this bucket-count) -1)))) + (set! (-> this dimension-array 0) (max 1 (min (the int (* f0-11 (-> v1-0 x))) a1-27))) + (set! (-> this dimension-array 1) (-> this vertical-cell-count)) + (set! (-> this dimension-array 2) (max 1 (min (the int (* f0-11 (-> v1-0 z))) a1-27))) ) (let* ((f1-15 (* f0-11 (-> v1-0 z))) (f1-17 (- f1-15 (the float (the int f1-15)))) @@ -333,17 +333,17 @@ ) (cond ((< f1-17 (- f0-12 (the float (the int f0-12)))) - (if (>= (-> obj bucket-count) - (* (* (+ (-> obj dimension-array 0) 1) (-> obj dimension-array 1)) (-> obj dimension-array 2)) + (if (>= (-> this bucket-count) + (* (* (+ (-> this dimension-array 0) 1) (-> this dimension-array 1)) (-> this dimension-array 2)) ) - (+! (-> obj dimension-array 0) 1) + (+! (-> this dimension-array 0) 1) ) ) (else - (if (>= (-> obj bucket-count) - (* (* (-> obj dimension-array 0) (-> obj dimension-array 1)) (+ (-> obj dimension-array 2) 1)) + (if (>= (-> this bucket-count) + (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (+ (-> this dimension-array 2) 1)) ) - (+! (-> obj dimension-array 2) 1) + (+! (-> this dimension-array 2) 1) ) ) ) @@ -351,20 +351,20 @@ ) (dotimes (a1-40 2) (let* ((a2-26 (* a1-40 2)) - (a3-12 (max 1 (the int (/ (-> v1-0 data a2-26) (-> obj min-cell-size))))) + (a3-12 (max 1 (the int (/ (-> v1-0 data a2-26) (-> this min-cell-size))))) ) - (set! (-> (the-as (pointer uint8) (+ a2-26 (the-as int obj))) 24) - (the-as uint (min (-> (the-as (pointer int8) (+ a2-26 (the-as int obj))) 24) a3-12)) + (set! (-> (the-as (pointer uint8) (+ a2-26 (the-as int this))) 24) + (the-as uint (min (-> (the-as (pointer int8) (+ a2-26 (the-as int this))) 24) a3-12)) ) ) ) (dotimes (a1-43 3) - (set! (-> obj axis-scale a1-43) (/ (the float (-> obj dimension-array a1-43)) (-> v1-0 data a1-43))) + (set! (-> this axis-scale a1-43) (/ (the float (-> this dimension-array a1-43)) (-> v1-0 data a1-43))) ) ) - (let ((a2-34 (* (* (-> obj dimension-array 0) (-> obj dimension-array 1)) (-> obj dimension-array 2)))) - (b! (< (-> obj bucket-count) a2-34) cfg-40) - (let* ((v1-16 obj) + (let ((a2-34 (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (-> this dimension-array 2)))) + (b! (< (-> this bucket-count) a2-34) cfg-40) + (let* ((v1-16 this) (a0-12 (/ (+ (* (* (* (-> v1-16 dimension-array 0) (-> v1-16 dimension-array 1)) (-> v1-16 dimension-array 2)) (-> v1-16 bucket-size) @@ -389,9 +389,9 @@ *stdcon* "grid-hash::update-grid: bucket overflow! ~d dim ~d ~d ~d~%" a2-34 - (-> obj dimension-array 0) - (-> obj dimension-array 1) - (-> obj dimension-array 2) + (-> this dimension-array 0) + (-> this dimension-array 1) + (-> this dimension-array 2) ) ) (label cfg-41) @@ -401,20 +401,20 @@ ;; definition for method 9 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod update-grid-for-objects-in-box grid-hash ((obj grid-hash) (arg0 int) (arg1 vector) (arg2 vector)) - (set! (-> obj object-count) arg0) +(defmethod update-grid-for-objects-in-box grid-hash ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector)) + (set! (-> this object-count) arg0) (dotimes (v1-0 3) - (set! (-> obj box-min v1-0) (-> arg1 data v1-0)) - (set! (-> obj box-max v1-0) (-> arg2 data v1-0)) + (set! (-> this box-min v1-0) (-> arg1 data v1-0)) + (set! (-> this box-max v1-0) (-> arg2 data v1-0)) ) - (update-grid obj) + (update-grid this) 0 (none) ) ;; definition for method 11 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod setup-search-box grid-hash ((obj grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) +(defmethod setup-search-box grid-hash ((this grid-hash) (arg0 int) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((v1-0 (new 'stack-no-clear 'vector)) (t1-0 (new 'stack-no-clear 'vector)) ) @@ -422,8 +422,8 @@ (set! (-> v1-0 data t2-0) (fmin (fmin (-> arg1 data t2-0) (-> arg2 data t2-0)) (-> arg3 data t2-0))) (set! (-> t1-0 data t2-0) (fmax (fmax (-> arg1 data t2-0) (-> arg2 data t2-0)) (-> arg3 data t2-0))) ) - (let ((a2-3 obj) - (a3-1 (-> obj search-box)) + (let ((a2-3 this) + (a3-1 (-> this search-box)) ) (dotimes (t0-1 3) (set! (-> a3-1 min t0-1) @@ -449,9 +449,9 @@ ) ) 0 - (set! (-> obj work object-id) arg0) - (let* ((t1-1 obj) - (t2-21 (-> obj search-box)) + (set! (-> this work object-id) arg0) + (let* ((t1-1 this) + (t2-21 (-> this search-box)) (a3-2 arg0) (v1-5 (-> t1-1 bucket-size)) (a0-2 (* (-> t1-1 dimension-array 0) v1-5)) @@ -502,9 +502,9 @@ ) ;; definition for method 12 of type grid-hash -(defmethod search-for-point grid-hash ((obj grid-hash) (arg0 vector)) - (let ((v1-0 obj) - (a0-1 (-> obj search-box)) +(defmethod search-for-point grid-hash ((this grid-hash) (arg0 vector)) + (let ((v1-0 this) + (a0-1 (-> this search-box)) (a2-0 arg0) ) (dotimes (a3-0 3) @@ -530,42 +530,42 @@ ) ) 0 - (do-search! obj (-> obj search-box) (-> obj work result-words)) - (-> obj work result-words) + (do-search! this (-> this search-box) (-> this work result-words)) + (-> this work result-words) ) ;; definition for method 13 of type grid-hash ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. ;; INFO: Used lq/sq -(defmethod search-for-sphere grid-hash ((obj grid-hash) (arg0 vector) (arg1 float)) +(defmethod search-for-sphere grid-hash ((this grid-hash) (arg0 vector) (arg1 float)) (let ((v1-0 (new 'stack-no-clear 'sphere))) (set! (-> v1-0 quad) (-> arg0 quad)) (set! (-> v1-0 r) arg1) - (sphere-to-grid-box obj (-> obj search-box) v1-0) + (sphere-to-grid-box this (-> this search-box) v1-0) ) - (let ((s5-0 (-> obj work result-words)) + (let ((s5-0 (-> this work result-words)) (s4-0 0) ) (label cfg-1) - (do-search! obj (-> obj search-box) s5-0) - (dotimes (v1-5 (-> obj bucket-size)) + (do-search! this (-> this search-box) s5-0) + (dotimes (v1-5 (-> this bucket-size)) (set! s4-0 (logior s4-0 (-> s5-0 v1-5))) ) (when (zero? s4-0) - (when (or (> (-> obj search-box min 0) 0) - (> (-> obj search-box min 2) 0) - (< (-> obj search-box max 0) (+ (-> obj dimension-array 0) -1)) - (< (-> obj search-box max 2) (+ (-> obj dimension-array 2) -1)) + (when (or (> (-> this search-box min 0) 0) + (> (-> this search-box min 2) 0) + (< (-> this search-box max 0) (+ (-> this dimension-array 0) -1)) + (< (-> this search-box max 2) (+ (-> this dimension-array 2) -1)) ) - (set! (-> obj search-box min 0) (max 0 (+ (-> obj search-box min 0) -1))) - (set! (-> obj search-box min 2) (max 0 (+ (-> obj search-box min 2) -1))) - (set! (-> obj search-box max 0) (min (+ (-> obj dimension-array 0) -1) (+ (-> obj search-box max 0) 1))) - (set! (-> obj search-box max 2) (min (+ (-> obj dimension-array 2) -1) (+ (-> obj search-box max 2) 1))) + (set! (-> this search-box min 0) (max 0 (+ (-> this search-box min 0) -1))) + (set! (-> this search-box min 2) (max 0 (+ (-> this search-box min 2) -1))) + (set! (-> this search-box max 0) (min (+ (-> this dimension-array 0) -1) (+ (-> this search-box max 0) 1))) + (set! (-> this search-box max 2) (min (+ (-> this dimension-array 2) -1) (+ (-> this search-box max 2) 1))) (goto cfg-1) ) ) ) - (-> obj work result-words) + (-> this work result-words) ) ;; definition (debug) for function draw-grid @@ -617,16 +617,16 @@ ;; definition for method 14 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod draw grid-hash ((obj grid-hash) (arg0 rgba)) +(defmethod draw grid-hash ((this grid-hash) (arg0 rgba)) "Draws the grid-hash" (let ((v1-0 (new 'stack-no-clear 'vector)) (t0-0 (new 'stack-no-clear 'vector)) ) (dotimes (a2-0 3) - (set! (-> v1-0 data a2-0) (-> obj box-min a2-0)) - (set! (-> t0-0 data a2-0) (-> obj box-max a2-0)) + (set! (-> v1-0 data a2-0) (-> this box-min a2-0)) + (set! (-> t0-0 data a2-0) (-> this box-max a2-0)) ) - (draw-grid v1-0 t0-0 (-> obj dimension-array) arg0) + (draw-grid v1-0 t0-0 (-> this dimension-array) arg0) ) 0 (none) @@ -634,26 +634,26 @@ ;; definition for method 15 of type grid-hash ;; WARN: Return type mismatch int vs none. -(defmethod dump-grid-info grid-hash ((obj grid-hash)) +(defmethod dump-grid-info grid-hash ((this grid-hash)) "Prints out info about the grid-hash, also draws via [[grid-hash::draw-grid]] if `debug-draw` is `#t`" - (if (-> obj debug-draw) - (draw obj *color-light-blue*) + (if (-> this debug-draw) + (draw this *color-light-blue*) ) (format *stdcon* "bucket memory ~d, bucket-size ~d, word-size ~d bits~%" - (-> obj bucket-memory-size) - (-> obj bucket-size) + (-> this bucket-memory-size) + (-> this bucket-size) 8 ) (format *stdcon* "bucket dimensions ~d ~d ~d~%" - (-> obj dimension-array 0) - (-> obj dimension-array 1) - (-> obj dimension-array 2) + (-> this dimension-array 0) + (-> this dimension-array 1) + (-> this dimension-array 2) ) - (format *stdcon* "object-count ~d, bucket-count ~d~%" (-> obj object-count) (-> obj bucket-count)) + (format *stdcon* "object-count ~d, bucket-count ~d~%" (-> this object-count) (-> this bucket-count)) 0 (none) ) @@ -719,20 +719,20 @@ ;; definition for method 25 of type sphere-hash ;; WARN: Return type mismatch int vs none. -(defmethod clear-objects! sphere-hash ((obj sphere-hash)) - (set! (-> obj object-count) 0) +(defmethod clear-objects! sphere-hash ((this sphere-hash)) + (set! (-> this object-count) 0) (dotimes (v1-0 3) - (set! (-> obj box-min v1-0) 10000000000000000000000000000000000000.0) - (set! (-> obj box-max v1-0) -10000000000000000000000000000000000000.0) + (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) + (set! (-> this box-max v1-0) -10000000000000000000000000000000000000.0) ) (cond - ((-> obj use-scratch-ram) - (set! (-> obj sphere-array) (the-as (inline-array sphere) (-> obj spr-sphere-array))) - (set! (-> obj bucket-array) (-> obj spr-bucket-array)) + ((-> this use-scratch-ram) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this spr-sphere-array))) + (set! (-> this bucket-array) (-> this spr-bucket-array)) ) (else - (set! (-> obj sphere-array) (the-as (inline-array sphere) (-> obj mem-sphere-array))) - (set! (-> obj bucket-array) (-> obj mem-bucket-array)) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this mem-sphere-array))) + (set! (-> this bucket-array) (-> this mem-bucket-array)) ) ) 0 @@ -744,18 +744,18 @@ (defmethod-mips2c "(method 28 sphere-hash)" 28 sphere-hash) ;; definition for method 26 of type sphere-hash -(defmethod add-a-sphere sphere-hash ((obj sphere-hash) (arg0 vector)) - (let ((gp-0 (-> obj object-count))) +(defmethod add-a-sphere sphere-hash ((this sphere-hash) (arg0 vector)) + (let ((gp-0 (-> this object-count))) (cond - ((< gp-0 (-> obj max-object-count)) - (let ((a0-2 (-> obj sphere-array gp-0))) + ((< gp-0 (-> this max-object-count)) + (let ((a0-2 (-> this sphere-array gp-0))) (mem-copy! (the-as pointer a0-2) (the-as pointer arg0) 16) ) (dotimes (v1-2 3) - (set! (-> obj box-min v1-2) (fmin (-> obj box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) - (set! (-> obj box-max v1-2) (fmax (-> obj box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-min v1-2) (fmin (-> this box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-max v1-2) (fmax (-> this box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) ) - (+! (-> obj object-count) 1) + (+! (-> this object-count) 1) gp-0 ) (else @@ -766,19 +766,19 @@ ) ;; definition for method 27 of type sphere-hash -(defmethod add-a-sphere-with-flag sphere-hash ((obj sphere-hash) (arg0 vector) (arg1 int)) - (let ((gp-0 (-> obj object-count))) +(defmethod add-a-sphere-with-flag sphere-hash ((this sphere-hash) (arg0 vector) (arg1 int)) + (let ((gp-0 (-> this object-count))) (cond - ((< gp-0 (-> obj max-object-count)) - (let ((s2-0 (the-as object (-> obj sphere-array gp-0)))) + ((< gp-0 (-> this max-object-count)) + (let ((s2-0 (the-as object (-> this sphere-array gp-0)))) (mem-copy! (the-as pointer s2-0) (the-as pointer arg0) 16) (dotimes (v1-2 3) - (set! (-> obj box-min v1-2) (fmin (-> obj box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) - (set! (-> obj box-max v1-2) (fmax (-> obj box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-min v1-2) (fmin (-> this box-min v1-2) (- (-> arg0 data v1-2) (-> arg0 w)))) + (set! (-> this box-max v1-2) (fmax (-> this box-max v1-2) (+ (-> arg0 data v1-2) (-> arg0 w)))) ) (set! (-> (the-as (pointer int8) s2-0) 12) arg1) ) - (+! (-> obj object-count) 1) + (+! (-> this object-count) 1) gp-0 ) (else @@ -811,18 +811,18 @@ ;; definition for method 15 of type sphere-hash ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod dump-grid-info sphere-hash ((obj sphere-hash)) +(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) obj) + ((find-parent-method sphere-hash 15) this) (new 'stack-no-clear 'vector) (let ((f30-0 6144.0)) - (set! (-> obj work temp-box-min quad) (-> (target-pos 0) quad)) - (+! (-> obj work temp-box-min y) f30-0) + (set! (-> this work temp-box-min quad) (-> (target-pos 0) quad)) + (+! (-> this work temp-box-min y) f30-0) ) - (set! (-> obj work temp-box-max quad) (-> obj work temp-box-min quad)) - (set! (-> obj work visit-count) 0) - (set! (-> obj debug-draw) #t) - (set! (-> obj work add-object-time) (the-as uint 0)) + (set! (-> this work temp-box-max quad) (-> this work temp-box-min quad)) + (set! (-> this work visit-count) 0) + (set! (-> this debug-draw) #t) + (set! (-> this work add-object-time) (the-as uint 0)) 0 (none) ) @@ -867,22 +867,22 @@ ;; definition for method 25 of type spatial-hash ;; WARN: Return type mismatch int vs none. -(defmethod clear-objects! spatial-hash ((obj spatial-hash)) - (set! (-> obj object-count) 0) +(defmethod clear-objects! spatial-hash ((this spatial-hash)) + (set! (-> this object-count) 0) (dotimes (v1-0 3) - (set! (-> obj box-min v1-0) 10000000000000000000000000000000000000.0) - (set! (-> obj box-max v1-0) -10000000000000000000000000000000000000.0) + (set! (-> this box-min v1-0) 10000000000000000000000000000000000000.0) + (set! (-> this box-max v1-0) -10000000000000000000000000000000000000.0) ) (cond - ((-> obj use-scratch-ram) - (set! (-> obj sphere-array) (the-as (inline-array sphere) (-> obj spr-sphere-array))) - (set! (-> obj object-array) (-> obj spr-object-array)) - (set! (-> obj bucket-array) (-> obj spr-bucket-array)) + ((-> this use-scratch-ram) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this spr-sphere-array))) + (set! (-> this object-array) (-> this spr-object-array)) + (set! (-> this bucket-array) (-> this spr-bucket-array)) ) (else - (set! (-> obj sphere-array) (the-as (inline-array sphere) (-> obj mem-sphere-array))) - (set! (-> obj object-array) (-> obj mem-object-array)) - (set! (-> obj bucket-array) (-> obj mem-bucket-array)) + (set! (-> this sphere-array) (the-as (inline-array sphere) (-> this mem-sphere-array))) + (set! (-> this object-array) (-> this mem-object-array)) + (set! (-> this bucket-array) (-> this mem-bucket-array)) ) ) 0 @@ -894,21 +894,21 @@ (defmethod-mips2c "(method 33 spatial-hash)" 33 spatial-hash) ;; definition for method 34 of type spatial-hash -(defmethod add-an-object spatial-hash ((obj spatial-hash) (arg0 vector) (arg1 hash-object-info)) - (let ((gp-0 (-> obj object-count))) +(defmethod add-an-object spatial-hash ((this spatial-hash) (arg0 vector) (arg1 hash-object-info)) + (let ((gp-0 (-> this object-count))) (cond - ((< gp-0 (-> obj max-object-count)) - (let ((a0-2 (-> obj sphere-array gp-0)) - (s2-0 (-> obj object-array gp-0)) + ((< gp-0 (-> this max-object-count)) + (let ((a0-2 (-> this sphere-array gp-0)) + (s2-0 (-> this object-array gp-0)) ) (mem-copy! (the-as pointer a0-2) (the-as pointer arg0) 16) (set! (-> s2-0 object) (the-as basic arg1)) ) (dotimes (v1-3 3) - (set! (-> obj box-min v1-3) (fmin (-> obj box-min v1-3) (- (-> arg0 data v1-3) (-> arg0 w)))) - (set! (-> obj box-max v1-3) (fmax (-> obj box-max v1-3) (+ (-> arg0 data v1-3) (-> arg0 w)))) + (set! (-> this box-min v1-3) (fmin (-> this box-min v1-3) (- (-> arg0 data v1-3) (-> arg0 w)))) + (set! (-> this box-max v1-3) (fmax (-> this box-max v1-3) (+ (-> arg0 data v1-3) (-> arg0 w)))) ) - (+! (-> obj object-count) 1) + (+! (-> this object-count) 1) gp-0 ) (else @@ -936,19 +936,19 @@ ;; definition for method 38 of type spatial-hash ;; INFO: Used lq/sq -(defmethod fill-actor-list-for-vec+r spatial-hash ((obj spatial-hash) (arg0 vector) (arg1 (pointer collide-shape)) (arg2 int)) +(defmethod fill-actor-list-for-vec+r spatial-hash ((this spatial-hash) (arg0 vector) (arg1 (pointer collide-shape)) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'sphere))) (set! (-> v1-0 quad) (-> arg0 quad)) (set! (-> v1-0 r) 0.0) - (fill-actor-list-for-sphere obj v1-0 arg1 arg2) + (fill-actor-list-for-sphere this v1-0 arg1 arg2) ) ) ;; definition for method 40 of type spatial-hash ;; WARN: Return type mismatch int vs none. -(defmethod validate-objects spatial-hash ((obj spatial-hash)) - (dotimes (s5-0 (-> obj object-count)) - (let ((a0-2 (-> obj object-array s5-0 object))) +(defmethod validate-objects spatial-hash ((this spatial-hash)) + (dotimes (s5-0 (-> this object-count)) + (let ((a0-2 (-> this object-array s5-0 object))) (when (not (valid? a0-2 basic "" #t 0)) (break!) 0 diff --git a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc index a2b06b2da7..74d200d3e8 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc @@ -19,20 +19,20 @@ ) ;; definition for method 3 of type board -(defmethod inspect board ((obj board)) - (when (not obj) - (set! obj obj) +(defmethod inspect board ((this board)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcontrol: ~A~%" (-> obj root)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tshadow-backup: ~A~%" (-> obj shadow-backup)) - (format #t "~2Tmain: ~A~%" (-> obj main)) + (format #t "~2Tcontrol: ~A~%" (-> this root)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Tmain: ~A~%" (-> this main)) (label cfg-4) - obj + this ) ;; definition of type board-info @@ -195,154 +195,154 @@ ) ;; definition for method 3 of type board-info -(defmethod inspect board-info ((obj board-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect board-info ((this board-info)) + (when (not this) + (set! this this) (goto cfg-19) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tboard: #x~X~%" (-> obj board)) - (format #t "~1Tcamera-interp: ~f~%" (-> obj camera-interp)) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Tboard-trans: ~`vector`P~%" (-> obj board-trans)) - (format #t "~1Tboard-quat: ~`vector`P~%" (-> obj board-quat)) - (format #t "~1Tboard-scale: ~`vector`P~%" (-> obj board-scale)) - (format #t "~1Tmain: ~A~%" (-> obj main)) - (format #t "~1Tupper-body: ~A~%" (-> obj upper-body)) - (format #t "~1Tsound-bank-knob: ~f~%" (-> obj sound-bank-knob)) - (format #t "~1Tsound-air-knob: ~f~%" (-> obj sound-air-knob)) - (format #t "~1Twind-sound-id: ~D~%" (-> obj wind-sound-id)) - (format #t "~1Twind-sound-pitch: ~f~%" (-> obj wind-sound-pitch)) - (format #t "~1Twind-sound-volume: ~f~%" (-> obj wind-sound-volume)) - (format #t "~1Tengine-sound-id: ~D~%" (-> obj engine-sound-id)) - (format #t "~1Tengine-sound-pitch: ~f~%" (-> obj engine-sound-pitch)) - (format #t "~1Tengine-sound-volume: ~f~%" (-> obj engine-sound-volume)) - (format #t "~1Tbank-sound-id: ~D~%" (-> obj bank-sound-id)) - (format #t "~1Tbank-sound-pitch: ~f~%" (-> obj bank-sound-pitch)) - (format #t "~1Tbank-sound-volume: ~f~%" (-> obj bank-sound-volume)) - (format #t "~1Tride-sound-id: ~D~%" (-> obj ride-sound-id)) - (format #t "~1Tspin-sound-id: ~D~%" (-> obj spin-sound-id)) - (format #t "~1Tspin-sound-volume: ~f~%" (-> obj spin-sound-volume)) - (format #t "~1Tspin-sound-pitch: ~f~%" (-> obj spin-sound-pitch)) - (format #t "~1Tup-vector[2] @ #x~X~%" (-> obj up-vector)) - (format #t "~1Tslow-transv: #~%" (-> obj slow-transv)) - (format #t "~1Tboard-time: ~D~%" (-> obj board-time)) - (format #t "~1Tboard-get-on-time: ~D~%" (-> obj board-get-on-time)) - (format #t "~1Tin-air-time: ~D~%" (-> obj in-air-time)) - (format #t "~1Tstick-lock: ~A~%" (-> obj stick-lock)) - (format #t "~1Tstick-off: ~A~%" (-> obj stick-off)) - (format #t "~1Tstance-info: #~%" (-> obj stance-info)) - (format #t "~1Tmods-backup: ~A~%" (-> obj mods-backup)) - (format #t "~1Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~1Tlatch?: ~A~%" (-> obj latch?)) - (format #t "~1Tunstuck-time: ~D~%" (-> obj unstuck-time)) - (format #t "~1Tstuck-count: ~D~%" (-> obj stuck-count)) - (format #t "~1Tthrust-scale: ~f~%" (-> obj thrust-scale)) - (format #t "~1Tflip-time: ~D~%" (-> obj flip-time)) - (format #t "~1Ttransv-max: (meters ~m)~%" (-> obj transv-max)) - (format #t "~1Tturn-anim-tilt?: ~A~%" (-> obj turn-anim-tilt?)) - (format #t "~1Tturn-anim-mag: ~f~%" (-> obj turn-anim-mag)) - (format #t "~1Tturn-anim-targ: ~f~%" (-> obj turn-anim-targ)) - (format #t "~1Tturn-anim-frame: ~f~%" (-> obj turn-anim-frame)) - (format #t "~1Tturn-anim-vel: ~f~%" (-> obj turn-anim-vel)) - (format #t "~1Tturn-anim-duck: ~f~%" (-> obj turn-anim-duck)) - (format #t "~1Tturn-anim-duck-vel: ~f~%" (-> obj turn-anim-duck-vel)) - (format #t "~1Ttilt-anim-frame: ~`vector`P~%" (-> obj tilt-anim-frame)) - (format #t "~1Ttilt-anim-targ: ~`vector`P~%" (-> obj tilt-anim-target)) - (format #t "~1Tsmack-surface-time: ~D~%" (-> obj smack-surface-time)) - (format #t "~1Tsmack-speed: (meters ~m)~%" (-> obj smack-speed)) - (format #t "~1Tsmack-normal: ~`vector`P~%" (-> obj smack-normal)) - (format #t "~1Tglance-time: ~D~%" (-> obj glance-time)) - (format #t "~1Tglance-speed: (meters ~m)~%" (-> obj glance-speed)) - (format #t "~1Tglance-in-transv: ~`vector`P~%" (-> obj glance-in-transv)) - (format #t "~1Tglance-out-transv: ~`vector`P~%" (-> obj glance-out-transv)) - (format #t "~1Tglance-normal: ~`vector`P~%" (-> obj glance-normal)) - (format #t "~1Ton-flat-time: ~D~%" (-> obj on-flat-time)) - (format #t "~1Tjump-land-time: ~D~%" (-> obj jump-land-time)) - (format #t "~1Tslip-factor: ~f~%" (-> obj slip-factor)) - (format #t "~1Tground-on-dir: ~`vector`P~%" (-> obj ground-on-dir)) - (format #t "~1Tride-time: ~D~%" (-> obj ride-time)) - (format #t "~1Tride-start-time: ~D~%" (-> obj ride-start-time)) - (format #t "~1Tride-button-time: ~D~%" (-> obj ride-button-time)) - (format #t "~1Tride-lean-targ: ~f~%" (-> obj ride-lean-targ)) - (format #t "~1Tride-lean: ~f~%" (-> obj ride-lean)) - (format #t "~1Tride-leanv: ~f~%" (-> obj ride-leanv)) - (format #t "~1Tride-lean-mag: ~f~%" (-> obj ride-lean-mag)) - (format #t "~1Tride-tilt-targ: ~f~%" (-> obj ride-tilt-targ)) - (format #t "~1Tride-tilt: ~f~%" (-> obj ride-tilt)) - (format #t "~1Tride-tiltv: ~f~%" (-> obj ride-tiltv)) - (format #t "~1Tride-tilt-mag: ~f~%" (-> obj ride-tilt-mag)) - (format #t "~1Tride-lock: ~A~%" (-> obj ride-lock)) - (format #t "~1Tride-lock-on: ~A~%" (-> obj ride-lock-on)) - (format #t "~1Tride-speed: (meters ~m)~%" (-> obj ride-speed)) - (format #t "~1Tride-mode: ~D~%" (-> obj ride-mode)) - (format #t "~1Tride-rot: (deg ~r)~%" (-> obj ride-rot)) - (format #t "~1Tride-rot-old: (deg ~r)~%" (-> obj ride-rot-old)) - (format #t "~1Tride-rot-abs[2] @ #x~X~%" (-> obj ride-rot-abs)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tboard: #x~X~%" (-> this board)) + (format #t "~1Tcamera-interp: ~f~%" (-> this camera-interp)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tboard-trans: ~`vector`P~%" (-> this board-trans)) + (format #t "~1Tboard-quat: ~`vector`P~%" (-> this board-quat)) + (format #t "~1Tboard-scale: ~`vector`P~%" (-> this board-scale)) + (format #t "~1Tmain: ~A~%" (-> this main)) + (format #t "~1Tupper-body: ~A~%" (-> this upper-body)) + (format #t "~1Tsound-bank-knob: ~f~%" (-> this sound-bank-knob)) + (format #t "~1Tsound-air-knob: ~f~%" (-> this sound-air-knob)) + (format #t "~1Twind-sound-id: ~D~%" (-> this wind-sound-id)) + (format #t "~1Twind-sound-pitch: ~f~%" (-> this wind-sound-pitch)) + (format #t "~1Twind-sound-volume: ~f~%" (-> this wind-sound-volume)) + (format #t "~1Tengine-sound-id: ~D~%" (-> this engine-sound-id)) + (format #t "~1Tengine-sound-pitch: ~f~%" (-> this engine-sound-pitch)) + (format #t "~1Tengine-sound-volume: ~f~%" (-> this engine-sound-volume)) + (format #t "~1Tbank-sound-id: ~D~%" (-> this bank-sound-id)) + (format #t "~1Tbank-sound-pitch: ~f~%" (-> this bank-sound-pitch)) + (format #t "~1Tbank-sound-volume: ~f~%" (-> this bank-sound-volume)) + (format #t "~1Tride-sound-id: ~D~%" (-> this ride-sound-id)) + (format #t "~1Tspin-sound-id: ~D~%" (-> this spin-sound-id)) + (format #t "~1Tspin-sound-volume: ~f~%" (-> this spin-sound-volume)) + (format #t "~1Tspin-sound-pitch: ~f~%" (-> this spin-sound-pitch)) + (format #t "~1Tup-vector[2] @ #x~X~%" (-> this up-vector)) + (format #t "~1Tslow-transv: #~%" (-> this slow-transv)) + (format #t "~1Tboard-time: ~D~%" (-> this board-time)) + (format #t "~1Tboard-get-on-time: ~D~%" (-> this board-get-on-time)) + (format #t "~1Tin-air-time: ~D~%" (-> this in-air-time)) + (format #t "~1Tstick-lock: ~A~%" (-> this stick-lock)) + (format #t "~1Tstick-off: ~A~%" (-> this stick-off)) + (format #t "~1Tstance-info: #~%" (-> this stance-info)) + (format #t "~1Tmods-backup: ~A~%" (-> this mods-backup)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tlatch?: ~A~%" (-> this latch?)) + (format #t "~1Tunstuck-time: ~D~%" (-> this unstuck-time)) + (format #t "~1Tstuck-count: ~D~%" (-> this stuck-count)) + (format #t "~1Tthrust-scale: ~f~%" (-> this thrust-scale)) + (format #t "~1Tflip-time: ~D~%" (-> this flip-time)) + (format #t "~1Ttransv-max: (meters ~m)~%" (-> this transv-max)) + (format #t "~1Tturn-anim-tilt?: ~A~%" (-> this turn-anim-tilt?)) + (format #t "~1Tturn-anim-mag: ~f~%" (-> this turn-anim-mag)) + (format #t "~1Tturn-anim-targ: ~f~%" (-> this turn-anim-targ)) + (format #t "~1Tturn-anim-frame: ~f~%" (-> this turn-anim-frame)) + (format #t "~1Tturn-anim-vel: ~f~%" (-> this turn-anim-vel)) + (format #t "~1Tturn-anim-duck: ~f~%" (-> this turn-anim-duck)) + (format #t "~1Tturn-anim-duck-vel: ~f~%" (-> this turn-anim-duck-vel)) + (format #t "~1Ttilt-anim-frame: ~`vector`P~%" (-> this tilt-anim-frame)) + (format #t "~1Ttilt-anim-targ: ~`vector`P~%" (-> this tilt-anim-target)) + (format #t "~1Tsmack-surface-time: ~D~%" (-> this smack-surface-time)) + (format #t "~1Tsmack-speed: (meters ~m)~%" (-> this smack-speed)) + (format #t "~1Tsmack-normal: ~`vector`P~%" (-> this smack-normal)) + (format #t "~1Tglance-time: ~D~%" (-> this glance-time)) + (format #t "~1Tglance-speed: (meters ~m)~%" (-> this glance-speed)) + (format #t "~1Tglance-in-transv: ~`vector`P~%" (-> this glance-in-transv)) + (format #t "~1Tglance-out-transv: ~`vector`P~%" (-> this glance-out-transv)) + (format #t "~1Tglance-normal: ~`vector`P~%" (-> this glance-normal)) + (format #t "~1Ton-flat-time: ~D~%" (-> this on-flat-time)) + (format #t "~1Tjump-land-time: ~D~%" (-> this jump-land-time)) + (format #t "~1Tslip-factor: ~f~%" (-> this slip-factor)) + (format #t "~1Tground-on-dir: ~`vector`P~%" (-> this ground-on-dir)) + (format #t "~1Tride-time: ~D~%" (-> this ride-time)) + (format #t "~1Tride-start-time: ~D~%" (-> this ride-start-time)) + (format #t "~1Tride-button-time: ~D~%" (-> this ride-button-time)) + (format #t "~1Tride-lean-targ: ~f~%" (-> this ride-lean-targ)) + (format #t "~1Tride-lean: ~f~%" (-> this ride-lean)) + (format #t "~1Tride-leanv: ~f~%" (-> this ride-leanv)) + (format #t "~1Tride-lean-mag: ~f~%" (-> this ride-lean-mag)) + (format #t "~1Tride-tilt-targ: ~f~%" (-> this ride-tilt-targ)) + (format #t "~1Tride-tilt: ~f~%" (-> this ride-tilt)) + (format #t "~1Tride-tiltv: ~f~%" (-> this ride-tiltv)) + (format #t "~1Tride-tilt-mag: ~f~%" (-> this ride-tilt-mag)) + (format #t "~1Tride-lock: ~A~%" (-> this ride-lock)) + (format #t "~1Tride-lock-on: ~A~%" (-> this ride-lock-on)) + (format #t "~1Tride-speed: (meters ~m)~%" (-> this ride-speed)) + (format #t "~1Tride-mode: ~D~%" (-> this ride-mode)) + (format #t "~1Tride-rot: (deg ~r)~%" (-> this ride-rot)) + (format #t "~1Tride-rot-old: (deg ~r)~%" (-> this ride-rot-old)) + (format #t "~1Tride-rot-abs[2] @ #x~X~%" (-> this ride-rot-abs)) (dotimes (s5-0 2) - (format #t "~T [~D]~1Tride-rot-abs: (deg ~r)~%" s5-0 (-> obj ride-rot-abs s5-0)) + (format #t "~T [~D]~1Tride-rot-abs: (deg ~r)~%" s5-0 (-> this ride-rot-abs s5-0)) ) - (format #t "~1Tride-rotv-abs: (deg ~r)~%" (-> obj ride-rtv-abs)) - (format #t "~1Tride-touch-segment[2] @ #x~X~%" (-> obj ride-touch-segment)) + (format #t "~1Tride-rotv-abs: (deg ~r)~%" (-> this ride-rtv-abs)) + (format #t "~1Tride-touch-segment[2] @ #x~X~%" (-> this ride-touch-segment)) (dotimes (s5-1 2) - (format #t "~T [~D]~1Tride-touch-segment: ~`vector`P~%" s5-1 (-> obj ride-touch-segment s5-1)) + (format #t "~T [~D]~1Tride-touch-segment: ~`vector`P~%" s5-1 (-> this ride-touch-segment s5-1)) ) - (format #t "~1Tride-dir: ~`vector`P~%" (-> obj ride-dir)) - (format #t "~1Tride-vertex-length: ~D~%" (-> obj ride-vertex-length)) - (format #t "~1Tride-vertex-length-old: ~D~%" (-> obj ride-vertex-length-old)) - (format #t "~1Tride-vertex-base: ~D~%" (-> obj ride-vertex-base)) - (format #t "~1Tride-vertex-base2: ~D~%" (-> obj ride-vertex-base2)) - (format #t "~1Tride-vertex-index: ~f~%" (-> obj ride-vertex-index)) - (format #t "~1Tride-vertex-index2: ~f~%" (-> obj ride-vertex-index2)) - (format #t "~1Tride-vertex-index-old: ~f~%" (-> obj ride-vertex-index-old)) - (format #t "~1Tride-vertex[3] @ #x~X~%" (-> obj ride-vertex)) + (format #t "~1Tride-dir: ~`vector`P~%" (-> this ride-dir)) + (format #t "~1Tride-vertex-length: ~D~%" (-> this ride-vertex-length)) + (format #t "~1Tride-vertex-length-old: ~D~%" (-> this ride-vertex-length-old)) + (format #t "~1Tride-vertex-base: ~D~%" (-> this ride-vertex-base)) + (format #t "~1Tride-vertex-base2: ~D~%" (-> this ride-vertex-base2)) + (format #t "~1Tride-vertex-index: ~f~%" (-> this ride-vertex-index)) + (format #t "~1Tride-vertex-index2: ~f~%" (-> this ride-vertex-index2)) + (format #t "~1Tride-vertex-index-old: ~f~%" (-> this ride-vertex-index-old)) + (format #t "~1Tride-vertex[3] @ #x~X~%" (-> this ride-vertex)) (dotimes (s5-2 3) - (format #t "~T [~D]~1Tride-vertex: ~`vector`P~%" s5-2 (-> obj ride-vertex s5-2)) + (format #t "~T [~D]~1Tride-vertex: ~`vector`P~%" s5-2 (-> this ride-vertex s5-2)) ) - (format #t "~1Tride-segment: ~`vector`P~%" (-> obj ride-segment)) - (format #t "~1Tride-dir-lean: ~`vector`P~%" (-> obj ride-dir-lean)) - (format #t "~1Tride-pad-vector[1] @ #x~X~%" (-> obj ride-pad-vector)) - (format #t "~1Tride-vertex-old[3] @ #x~X~%" (-> obj ride-vertex-old)) + (format #t "~1Tride-segment: ~`vector`P~%" (-> this ride-segment)) + (format #t "~1Tride-dir-lean: ~`vector`P~%" (-> this ride-dir-lean)) + (format #t "~1Tride-pad-vector[1] @ #x~X~%" (-> this ride-pad-vector)) + (format #t "~1Tride-vertex-old[3] @ #x~X~%" (-> this ride-vertex-old)) (dotimes (s5-3 3) - (format #t "~T [~D]~1Tride-vertex-old: ~`vector`P~%" s5-3 (-> obj ride-vertex-old s5-3)) + (format #t "~T [~D]~1Tride-vertex-old: ~`vector`P~%" s5-3 (-> this ride-vertex-old s5-3)) ) - (format #t "~1Tride-segment-old: ~`vector`P~%" (-> obj ride-segment-old)) - (format #t "~1Tride-vertex-trail[128] @ #x~X~%" (-> obj ride-vertex-trail)) + (format #t "~1Tride-segment-old: ~`vector`P~%" (-> this ride-segment-old)) + (format #t "~1Tride-vertex-trail[128] @ #x~X~%" (-> this ride-vertex-trail)) (dotimes (s5-4 128) - (format #t "~T [~D]~1Tride-vertex-trail: ~`vector`P~%" s5-4 (-> obj ride-vertex-trail s5-4)) + (format #t "~T [~D]~1Tride-vertex-trail: ~`vector`P~%" s5-4 (-> this ride-vertex-trail s5-4)) ) - (format #t "~1Thalfpipe-side-time: ~D~%" (-> obj halfpipe-side-time)) - (format #t "~1Thalfpipe-jump-time: ~D~%" (-> obj halfpipe-jump-time)) - (format #t "~1Thalfpipe-lip-time: ~D~%" (-> obj halfpipe-lip-time)) - (format #t "~1Thalfpipe-time: ~D~%" (-> obj halfpipe-time)) - (format #t "~1Thalfpipe-gspot-time: ~D~%" (-> obj halfpipe-gspot-time)) - (format #t "~1Thalfpipe-lip-event: ~A~%" (-> obj halfpipe-lip-event)) - (format #t "~1Tspin-check-time: ~D~%" (-> obj spin-check-time)) - (format #t "~1Tspin-time: ~D~%" (-> obj spin-time)) - (format #t "~1Tspin-start-time: ~D~%" (-> obj spin-start-time)) - (format #t "~1Tspin-start-dir: ~`vector`P~%" (-> obj spin-start-dir)) - (format #t "~1Tspin-control: ~f~%" (-> obj spin-control)) - (format #t "~1Tspin-ground-start-time: ~D~%" (-> obj spin-ground-start-time)) - (format #t "~1Tspin-ground-time: ~D~%" (-> obj spin-ground-time)) - (format #t "~1Tspin-ground-press-time: ~D~%" (-> obj spin-ground-press-time)) - (format #t "~1Tflip-control: ~f~%" (-> obj flip-control)) - (format #t "~1Tflip-count: ~D~%" (-> obj flip-count)) - (format #t "~1Ttrickx-count: ~D~%" (-> obj trickx-count)) - (format #t "~1Trotyv-max: (deg ~r)~%" (-> obj trotyv-max)) - (format #t "~1Trotyv: (deg ~r)~%" (-> obj trotyv)) - (format #t "~1Troty: (deg ~r)~%" (-> obj troty)) - (format #t "~1Troty-cum: (deg ~r)~%" (&-> obj troty-cum)) - (format #t "~1Tupper-body-rotyv-max: (deg ~r)~%" (-> obj upper-body-rotyv-max)) - (format #t "~1Tupper-body-rotyv: (deg ~r)~%" (-> obj upper-body-rotyv)) - (format #t "~1Tupper-body-roty: (deg ~r)~%" (-> obj upper-body-roty)) - (format #t "~1Tcushion-base: (meters ~m)~%" (-> obj cushion-base)) - (format #t "~1Tcushion-offset: (meters ~m)~%" (-> obj cushion-offset)) - (format #t "~1Tshock-offset: (meters ~m)~%" (-> obj shock-offset)) - (format #t "~1Tshock-offsetv: (meters ~m)~%" (-> obj shock-offsetv)) - (format #t "~1Tshock-rotx: (meters ~m)~%" (-> obj shock-rotx)) - (format #t "~1Ttrick-count: ~D~%" (-> obj trick-count)) + (format #t "~1Thalfpipe-side-time: ~D~%" (-> this halfpipe-side-time)) + (format #t "~1Thalfpipe-jump-time: ~D~%" (-> this halfpipe-jump-time)) + (format #t "~1Thalfpipe-lip-time: ~D~%" (-> this halfpipe-lip-time)) + (format #t "~1Thalfpipe-time: ~D~%" (-> this halfpipe-time)) + (format #t "~1Thalfpipe-gspot-time: ~D~%" (-> this halfpipe-gspot-time)) + (format #t "~1Thalfpipe-lip-event: ~A~%" (-> this halfpipe-lip-event)) + (format #t "~1Tspin-check-time: ~D~%" (-> this spin-check-time)) + (format #t "~1Tspin-time: ~D~%" (-> this spin-time)) + (format #t "~1Tspin-start-time: ~D~%" (-> this spin-start-time)) + (format #t "~1Tspin-start-dir: ~`vector`P~%" (-> this spin-start-dir)) + (format #t "~1Tspin-control: ~f~%" (-> this spin-control)) + (format #t "~1Tspin-ground-start-time: ~D~%" (-> this spin-ground-start-time)) + (format #t "~1Tspin-ground-time: ~D~%" (-> this spin-ground-time)) + (format #t "~1Tspin-ground-press-time: ~D~%" (-> this spin-ground-press-time)) + (format #t "~1Tflip-control: ~f~%" (-> this flip-control)) + (format #t "~1Tflip-count: ~D~%" (-> this flip-count)) + (format #t "~1Ttrickx-count: ~D~%" (-> this trickx-count)) + (format #t "~1Trotyv-max: (deg ~r)~%" (-> this trotyv-max)) + (format #t "~1Trotyv: (deg ~r)~%" (-> this trotyv)) + (format #t "~1Troty: (deg ~r)~%" (-> this troty)) + (format #t "~1Troty-cum: (deg ~r)~%" (&-> this troty-cum)) + (format #t "~1Tupper-body-rotyv-max: (deg ~r)~%" (-> this upper-body-rotyv-max)) + (format #t "~1Tupper-body-rotyv: (deg ~r)~%" (-> this upper-body-rotyv)) + (format #t "~1Tupper-body-roty: (deg ~r)~%" (-> this upper-body-roty)) + (format #t "~1Tcushion-base: (meters ~m)~%" (-> this cushion-base)) + (format #t "~1Tcushion-offset: (meters ~m)~%" (-> this cushion-offset)) + (format #t "~1Tshock-offset: (meters ~m)~%" (-> this shock-offset)) + (format #t "~1Tshock-offsetv: (meters ~m)~%" (-> this shock-offsetv)) + (format #t "~1Tshock-rotx: (meters ~m)~%" (-> this shock-rotx)) + (format #t "~1Ttrick-count: ~D~%" (-> this trick-count)) (label cfg-19) - obj + this ) ;; definition of type target-board-bank @@ -365,25 +365,25 @@ ) ;; definition for method 3 of type target-board-bank -(defmethod inspect target-board-bank ((obj target-board-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect target-board-bank ((this target-board-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tjump-height-min: (meters ~m)~%" (-> obj jump-height-min)) - (format #t "~1Tjump-height-max: (meters ~m)~%" (-> obj jump-height-max)) - (format #t "~1Tduck-jump-height-min: (meters ~m)~%" (-> obj duck-jump-height-min)) - (format #t "~1Tduck-jump-height-max: (meters ~m)~%" (-> obj duck-jump-height-max)) - (format #t "~1Tturn-frames: ~f~%" (-> obj turn-frames)) - (format #t "~1Twall-kick-window: (seconds ~e)~%" (-> obj wall-kick-window)) - (format #t "~1Tcushion: (meters ~m)~%" (-> obj cushion)) - (format #t "~1Ttrickx-jump-height-min: (meters ~m)~%" (-> obj trickx-jump-height-min)) - (format #t "~1Ttrickx-jump-height-max: (meters ~m)~%" (-> obj trickx-jump-height-max)) - (format #t "~1Ttricky-jump-height-min: (meters ~m)~%" (-> obj tricky-jump-height-min)) - (format #t "~1Ttricky-jump-height-max: (meters ~m)~%" (-> obj tricky-jump-height-max)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) + (format #t "~1Tjump-height-max: (meters ~m)~%" (-> this jump-height-max)) + (format #t "~1Tduck-jump-height-min: (meters ~m)~%" (-> this duck-jump-height-min)) + (format #t "~1Tduck-jump-height-max: (meters ~m)~%" (-> this duck-jump-height-max)) + (format #t "~1Tturn-frames: ~f~%" (-> this turn-frames)) + (format #t "~1Twall-kick-window: (seconds ~e)~%" (-> this wall-kick-window)) + (format #t "~1Tcushion: (meters ~m)~%" (-> this cushion)) + (format #t "~1Ttrickx-jump-height-min: (meters ~m)~%" (-> this trickx-jump-height-min)) + (format #t "~1Ttrickx-jump-height-max: (meters ~m)~%" (-> this trickx-jump-height-max)) + (format #t "~1Ttricky-jump-height-min: (meters ~m)~%" (-> this tricky-jump-height-min)) + (format #t "~1Ttricky-jump-height-max: (meters ~m)~%" (-> this tricky-jump-height-max)) (label cfg-4) - obj + this ) ;; definition for symbol *TARGET_BOARD-bank*, type target-board-bank @@ -411,13 +411,13 @@ (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons l2))) ) (not *pause-lock*) - (>= (- (current-time) (-> self control time-of-last-debug-heal)) (seconds 0.1)) + (time-elapsed? (-> self control time-of-last-debug-heal) (seconds 0.1)) (>= (-> self control last-time-on-surface) (-> self control time-of-last-debug-float)) ) (-> self board latch?) ) (not (focus-test? self dead hit grabbed in-head edge-grab pole board pilot mech dark)) - (or (zero? (-> self board)) (>= (- (current-time) (-> self board board-time)) (seconds 0.5))) + (or (zero? (-> self board)) (time-elapsed? (-> self board board-time) (seconds 0.5))) (not (logtest? (state-flags prevent-board) (-> self state-flags))) (< (-> self board board-time) (-> self control list-time-on-ground)) (not (logtest? (surface-flag no-board) (-> self control current-surface flags))) @@ -466,7 +466,7 @@ #f #t ) - (begin (set! (-> self board latch?) #t) (>= (- (current-time) (-> self gun gun-time)) (seconds 0.4))) + (begin (set! (-> self board latch?) #t) (time-elapsed? (-> self gun gun-time) (seconds 0.4))) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc index b911231530..d483940958 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-states_REF.gc @@ -81,7 +81,7 @@ ) (set! (-> self board turn-anim-duck-vel) (* 0.98 (-> self board turn-anim-duck-vel))) (+! (-> self board turn-anim-duck-vel) (* -8.0 (seconds-per-frame))) - (when (and (board-on-ground?) (>= (- (current-time) (-> self board unknown-time-frame02)) (seconds 0.2))) + (when (and (board-on-ground?) (time-elapsed? (-> self board unknown-time-frame02) (seconds 0.2))) (if (logtest? (-> self control status) (collide-status impact-surface)) (+! (-> self board turn-anim-duck-vel) (lerp-scale 0.0 15.0 (-> self control normal-impact-vel) 0.0 81920.0)) ) @@ -100,19 +100,19 @@ (defbehavior target-board-spin-check target () (when (and (or (cpad-pressed? (-> self control cpad number) r1) (and (cpad-hold? (-> self control cpad number) r1) - (>= (- (current-time) (-> self board spin-check-time)) (seconds 0.3)) + (time-elapsed? (-> self board spin-check-time) (seconds 0.3)) ) ) (not (and (and (-> self next-state) (let ((v1-24 (-> self next-state name))) (or (= v1-24 'target-board-trickx) (= v1-24 'target-board-hold)) ) ) - (< (- (current-time) (-> self board spin-start-time)) (seconds 0.5)) + (not (time-elapsed? (-> self board spin-start-time) (seconds 0.5))) ) ) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) ) - (set! (-> self board spin-start-time) (current-time)) + (set-time! (-> self board spin-start-time)) (set! (-> self board spin-start-dir quad) (-> self node-list data 3 bone transform vector 2 quad)) (vector-flatten! (-> self control turn-to-alt-heading) (-> self control c-R-w vector 2) *up-vector*) (vector-normalize! (-> self control turn-to-alt-heading) 1.0) @@ -135,14 +135,14 @@ (cond ((and (cpad-hold? (-> self control cpad number) r1) (and (or (= (-> self control mod-surface name) 'spin) - (< (- (current-time) (-> self board spin-time)) (seconds 0.05)) + (not (time-elapsed? (-> self board spin-time) (seconds 0.05))) ) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) ) ) (set! (-> self board turn-anim-tilt?) #f) (set! (-> self control mod-surface) *board-spin-mods*) - (set! (-> self board spin-time) (current-time)) + (set-time! (-> self board spin-time)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) (set! (-> gp-0 y) 0.0) @@ -188,7 +188,7 @@ (set! (-> self control mod-surface) (the-as surface (-> self board mods-backup))) ) ) - (set! (-> self board spin-check-time) (current-time)) + (set-time! (-> self board spin-check-time)) (when (and (or (cpad-pressed? (-> self control cpad number) l1) (< (-> self control last-time-on-surface) (-> self board unknown-time-frame06)) ) @@ -196,7 +196,7 @@ ) (set! (-> self board turn-anim-tilt?) #f) (set! (-> self control mod-surface) *board-spin-mods*) - (set! (-> self board unknown-time-frame03) (current-time)) + (set-time! (-> self board unknown-time-frame03)) (let ((gp-2 (new 'stack-no-clear 'vector))) (set! (-> gp-2 x) (* -0.0078125 (+ -128.0 (the float (-> self control cpad leftx))))) (set! (-> gp-2 y) 0.0) @@ -214,7 +214,7 @@ (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (and (>= (target-height-above-ground) 4096.0) (< (seconds 0.165) (target-time-to-ground)) - (>= (- (current-time) (-> self board unknown-time-frame05)) (seconds 0.05)) + (time-elapsed? (-> self board unknown-time-frame05) (seconds 0.05)) (< (-> self board unknown-time-frame05) (-> self board unknown-time-frame06)) ) ) @@ -238,7 +238,7 @@ (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (and (>= (target-height-above-ground) 4096.0) (< (seconds 0.165) (target-time-to-ground)) - (>= (- (current-time) (-> self board unknown-time-frame05)) (seconds 0.05)) + (time-elapsed? (-> self board unknown-time-frame05) (seconds 0.05)) ) ) ) @@ -310,7 +310,7 @@ ) (set! (-> self board troty-cum) 0.0) (set! (-> self board flip-count) 0) - (if (>= (- (current-time) (-> self board in-air-time)) (seconds 0.2)) + (if (time-elapsed? (-> self board in-air-time) (seconds 0.2)) (flush-trick-list (-> self board)) ) 0 @@ -327,7 +327,7 @@ (f28-0 (vector-y-angle (-> self control transv))) (f0-2 (y-angle (-> self control))) ) - (if (< (- (current-time) (-> self board halfpipe-time)) (seconds 0.1)) + (if (not (time-elapsed? (-> self board halfpipe-time) (seconds 0.1))) (set! f28-0 (+ 32768.0 f28-0)) ) (let ((f0-5 (fabs (deg-diff f0-2 f28-0)))) @@ -435,7 +435,7 @@ (< 0.0 (vector-dot (-> self control transv) gp-0)) (and (< (-> self control surface-angle) 0.3) (zero? (-> self board halfpipe-side-time))) ) - (set! (-> self board halfpipe-side-time) (current-time)) + (set-time! (-> self board halfpipe-side-time)) (set! v0-3 (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset))) (set! (-> self control root-prim prim-core action) v0-3) v0-3 @@ -443,11 +443,11 @@ (else (if (and (not (board-on-ground?)) (nonzero? (-> self board halfpipe-side-time)) - (>= (- (current-time) (-> self board halfpipe-side-time)) (seconds 0.05)) + (time-elapsed? (-> self board halfpipe-side-time) (seconds 0.05)) ) (go target-board-halfpipe) ) - (when (>= (- (current-time) (-> self board halfpipe-side-time)) (seconds 0.2)) + (when (time-elapsed? (-> self board halfpipe-side-time) (seconds 0.2)) (set! (-> self board halfpipe-side-time) 0) (set! v0-3 (logclear (-> self control root-prim prim-core action) (collide-action no-normal-reset))) (set! (-> self control root-prim prim-core action) v0-3) @@ -461,10 +461,10 @@ ;; definition for function target-board-jump-trans (defbehavior target-board-jump-trans target () (when (and (!= (-> self state-time) (current-time)) (jump-hit-ground-stuck?)) - (set! (-> self board jump-land-time) (current-time)) + (set-time! (-> self board jump-land-time)) (go target-board-hit-ground) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (target-board-smack-surface?) ) (if (and (cpad-pressed? (-> self control cpad number) x) @@ -511,8 +511,8 @@ (< 0.0 (vector-dot (-> self control transv) s5-0)) ) ) - (set! (-> self board halfpipe-lip-time) (current-time)) - (set! (-> self board halfpipe-side-time) (current-time)) + (set-time! (-> self board halfpipe-lip-time)) + (set-time! (-> self board halfpipe-side-time)) (set! (-> self board halfpipe-lip-event) (the-as symbol (-> block param 0))) (let ((v0-2 (the-as object (logior (-> self control root-prim prim-core action) (collide-action no-normal-reset)))) ) @@ -565,9 +565,8 @@ :trans (behavior () (if (and (cpad-hold? (-> self control cpad number) l1) (not (logtest? (-> self state-flags) (state-flags prevent-duck))) - (< (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (not (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) + ) ) (go target-board-duck-stance) ) @@ -589,7 +588,7 @@ ) (vector-normalize! gp-0 1.0) (cond - ((and (< (- (current-time) (-> self board halfpipe-jump-time)) (seconds 0.5)) + ((and (not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) (= (-> self control ground-pat mode) (pat-mode halfpipe)) ) ) @@ -597,7 +596,7 @@ (< 0.0 (vector-dot (-> self control transv) gp-0)) (< (-> self control surface-angle) 0.5) ) - (set! (-> self board halfpipe-jump-time) (current-time)) + (set-time! (-> self board halfpipe-jump-time)) (vector-float*! (-> self control transv) (-> self control transv) 1.5) ) (else @@ -608,14 +607,14 @@ ) ) (if (cpad-pressed? (-> self control cpad number) r1) - (set! (-> self board spin-ground-press-time) (current-time)) + (set-time! (-> self board spin-ground-press-time)) ) (if (and (cpad-hold? (-> self control cpad number) r1) (can-feet? #t) - (< (- (current-time) (-> self board spin-ground-press-time)) (seconds 0.3)) + (not (time-elapsed? (-> self board spin-ground-press-time) (seconds 0.3))) (turn-around?) ) - (set! (-> self board spin-ground-start-time) (current-time)) + (set-time! (-> self board spin-ground-start-time)) ) (target-board-halfpipe-check) (if (target-board-smack-surface?) @@ -628,7 +627,7 @@ (set! (-> self control mod-surface) *board-walk-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) ) - ((and (>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1)) + ((and (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) (or (= (-> self control mod-surface name) 'spin) (< 4096.0 (target-height-above-ground))) ) (set! (-> self control mod-surface) *board-jump-mods*) @@ -750,9 +749,7 @@ :trans (behavior () (if (and (or (not (cpad-hold? (-> self control cpad number) l1)) (logtest? (-> self state-flags) (state-flags prevent-duck)) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) ) (can-exit-duck? self) ) @@ -776,7 +773,7 @@ ) (vector-normalize! gp-0 1.0) (cond - ((and (< (- (current-time) (-> self board halfpipe-jump-time)) (seconds 0.5)) + ((and (not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) (= (-> self control ground-pat mode) (pat-mode halfpipe)) ) ) @@ -784,7 +781,7 @@ (< 0.0 (vector-dot (-> self control transv) gp-0)) (< (-> self control surface-angle) 0.5) ) - (set! (-> self board halfpipe-jump-time) (current-time)) + (set-time! (-> self board halfpipe-jump-time)) (vector-float*! (-> self control transv) (-> self control transv) 1.5) ) (else @@ -804,14 +801,14 @@ ) ) (if (cpad-pressed? (-> self control cpad number) r1) - (set! (-> self board spin-ground-press-time) (current-time)) + (set-time! (-> self board spin-ground-press-time)) ) (if (and (cpad-hold? (-> self control cpad number) r1) (can-feet? #t) - (< (- (current-time) (-> self board spin-ground-press-time)) (seconds 0.3)) + (not (time-elapsed? (-> self board spin-ground-press-time) (seconds 0.3))) (turn-around?) ) - (set! (-> self board spin-ground-start-time) (current-time)) + (set-time! (-> self board spin-ground-start-time)) ) (target-board-halfpipe-check) (if (target-board-smack-surface?) @@ -825,7 +822,7 @@ (set! (-> self control mod-surface) *board-duck-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) ) - ((and (>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1)) + ((and (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) (or (= (-> self control mod-surface name) 'spin) (< 4096.0 (target-height-above-ground))) ) (set! (-> self control mod-surface) *board-duck-jump-mods*) @@ -845,7 +842,7 @@ ;; failed to figure out what this is: (defstate target-board-jump (target) :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) - (if (and (= message 'edge-grab) (< (- (current-time) (-> self state-time)) (seconds 0.1))) + (if (and (= message 'edge-grab) (not (time-elapsed? (-> self state-time) (seconds 0.1)))) (return #f) ) (target-board-handler proc argc message block) @@ -858,7 +855,7 @@ (if (= arg2 'hit) (set! arg2 #f) ) - (when (< (- (current-time) (-> self board ride-time)) (seconds 0.5)) + (when (not (time-elapsed? (-> self board ride-time) (seconds 0.5))) (set! arg2 (the-as symbol *board-ride-jump-mods*)) (let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self control transv) 1.0))) (forward-up-nopitch->quaternion @@ -874,12 +871,12 @@ ) ) (set! (-> self control dynam gravity-length) 245760.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((f30-0 0.0)) (cond ((and (< 0.0 (-> self board shock-offsetv)) - (< (- (current-time) (-> self board jump-land-time)) (seconds 0.5)) - (>= (- (current-time) (-> self board ride-time)) (seconds 0.5)) + (not (time-elapsed? (-> self board jump-land-time) (seconds 0.5))) + (time-elapsed? (-> self board ride-time) (seconds 0.5)) ) (let ((s3-2 (new 'stack-no-clear 'vector))) (set! (-> s3-2 quad) (-> self control trans quad)) @@ -971,7 +968,7 @@ #t #f (-> self control transv) - (if (>= (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) + (if (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)) 2.0 0.0 ) @@ -1131,7 +1128,7 @@ ) :enter (behavior () (logior! (-> self focus-status) (focus-status halfpipe)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) (set! (-> self control mod-surface) *board-halfpipe-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) @@ -1205,7 +1202,7 @@ ) :trans (behavior () (when (and (or (= (the-as int (-> self control did-move-to-pole-or-max-jump-height)) #t) - (and (< (- (current-time) (-> self board halfpipe-lip-time)) (seconds 0.1)) + (and (not (time-elapsed? (-> self board halfpipe-lip-time) (seconds 0.1))) (= (-> self board halfpipe-lip-event) 'lipramp) ) ) @@ -1231,20 +1228,20 @@ ) ) ) - (set! (-> self board halfpipe-time) (current-time)) + (set-time! (-> self board halfpipe-time)) (if (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) - (set! (-> self board halfpipe-gspot-time) (current-time)) + (set-time! (-> self board halfpipe-gspot-time)) ) (when (jump-hit-ground-stuck?) (vector-float*! (-> self control transv) (-> self control transv) 1.5) (go target-board-turn-to (-> self control transv) (seconds 0.5)) ) (when (and (cpad-pressed? (-> self control cpad number) x) - (>= (- (current-time) (-> self board halfpipe-jump-time)) (seconds 0.6)) - (< (- (current-time) (-> self state-time)) (the-as time-frame (-> *TARGET-bank* ground-timeout))) + (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.6)) + (not (time-elapsed? (-> self state-time) (the-as time-frame (-> *TARGET-bank* ground-timeout)))) (< 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) - (set! (-> self board halfpipe-jump-time) (current-time)) + (set-time! (-> self board halfpipe-jump-time)) (vector-float*! (-> self control transv) (-> self control transv) 1.5) ) (target-board-spin-check) @@ -1274,7 +1271,7 @@ ) ) (when (or (>= (-> self control sliding-start-time) (seconds 0.05)) - (and (>= (- (current-time) (-> self board halfpipe-gspot-time)) (seconds 0.5)) + (and (time-elapsed? (-> self board halfpipe-gspot-time) (seconds 0.5)) (< (-> self board halfpipe-lip-time) (+ (-> self state-time) (seconds -0.2))) ) ) @@ -1286,7 +1283,7 @@ ) :code (behavior () (cond - ((< (- (current-time) (-> self board halfpipe-jump-time)) (seconds 0.5)) + ((not (time-elapsed? (-> self board halfpipe-jump-time) (seconds 0.5))) (ja-channel-push! 1 (seconds 0.05)) (ja-no-eval :group! (-> self draw art-group data 155) :num! (seek! (ja-aframe 8.0 0) 0.5) :frame-num 0.0) (until (ja-done? 0) @@ -1402,7 +1399,7 @@ (defstate target-board-jump-kick (target) :event target-board-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *board-jump-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) (sound-play "board-k-jump") @@ -1414,10 +1411,10 @@ ) (target-board-smack-surface?) (cond - ((< (- (current-time) (-> self board smack-surface-time)) (seconds 0.2)) + ((not (time-elapsed? (-> self board smack-surface-time) (seconds 0.2))) (go target-board-wall-kick (-> self board smack-normal) (-> self board smack-speed)) ) - ((< (- (current-time) (-> self board glance-time)) (seconds 0.2)) + ((not (time-elapsed? (-> self board glance-time) (seconds 0.2))) (go target-board-wall-kick (vector-normalize-copy! (-> self control unknown-vector38) (-> self board glance-out-transv) 1.0) @@ -1459,7 +1456,7 @@ (* 0.008333334 (- (-> self control dynam gravity-length))) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *board-wall-kick-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) (set! (-> self board smack-surface-time) 0) @@ -1500,7 +1497,7 @@ (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) ) (set! (-> self control dynam gravity-length) 245760.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (cond ((= arg2 'halfpipe) (logior! (-> self focus-status) (focus-status halfpipe)) @@ -1666,8 +1663,8 @@ (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) ) (set! (-> self control dynam gravity-length) 245760.0) - (set! (-> self state-time) (current-time)) - (set! (-> self board unknown-time-frame04) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self board unknown-time-frame04)) (cond ((= arg2 'halfpipe) (logior! (-> self focus-status) (focus-status halfpipe)) @@ -1687,7 +1684,7 @@ ) :exit (behavior () (set! (-> self board unknown-float01) 0.0) - (set! (-> self board unknown-time-frame05) (current-time)) + (set-time! (-> self board unknown-time-frame05)) (let ((v1-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-3 command) (sound-command set-param)) (set! (-> v1-3 id) (-> self board unknown-sound-id01)) @@ -1858,7 +1855,7 @@ (mod-var-jump #t #f (cpad-hold? (-> self control cpad number) x) (-> self control transv)) ) (when (jump-hit-ground-stuck?) - (set! (-> self board jump-land-time) (current-time)) + (set-time! (-> self board jump-land-time)) (go target-board-hit-ground) ) (set! (-> self board slow-transv quad) (-> self control transv quad)) @@ -2020,7 +2017,7 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *board-turn-to-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) (set! (-> self control sliding-start-time) arg1) @@ -2046,7 +2043,7 @@ (flush-trick-list (-> self board)) (go target-board-jump (-> *TARGET_BOARD-bank* jump-height-min) (-> *TARGET_BOARD-bank* jump-height-max) #f) ) - (if (>= (- (current-time) (-> self state-time)) (-> self control sliding-start-time)) + (if (time-elapsed? (-> self state-time) (-> self control sliding-start-time)) (go target-board-stance) ) (target-board-anim-trans) @@ -2085,7 +2082,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self focus-status) (focus-status rail)) (logior! (-> self control root-prim prim-core action) (collide-action can-ride)) (set! (-> self control mod-surface) *board-ride-mods*) @@ -2209,7 +2206,7 @@ (set! (-> self control unknown-word04) (the-as uint #f)) ) (if (-> self control unknown-spool-anim00) - (set! (-> self board ride-button-time) (current-time)) + (set-time! (-> self board ride-button-time)) ) (set! (-> self board turn-anim-targ) (* (-> self board ride-lean) (- (-> *TARGET_BOARD-bank* turn-frames)))) (cond @@ -2319,7 +2316,7 @@ :enter (behavior ((arg0 handle)) (logior! (-> self focus-status) (focus-status halfpipe)) (set! (-> self control unknown-handle02) arg0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self control root-prim prim-core action) (collide-action no-normal-reset)) (set! (-> self control mod-surface) *board-halfpipe-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) @@ -2347,11 +2344,11 @@ ((-> target-board-halfpipe exit)) ) :trans (behavior () - (set! (-> self board halfpipe-time) (current-time)) + (set-time! (-> self board halfpipe-time)) (if (= (-> self control gspot-pat-surfce mode) (pat-mode halfpipe)) - (set! (-> self board halfpipe-gspot-time) (current-time)) + (set-time! (-> self board halfpipe-gspot-time)) ) - (if (< (- (current-time) (-> self state-time)) (seconds 1)) + (if (not (time-elapsed? (-> self state-time) (seconds 1))) (vector+float*! (-> self control transv) (-> self control transv) @@ -2363,7 +2360,7 @@ (vector-float*! (-> self control transv) (-> self control transv) 1.5) (go target-board-turn-to (-> self control transv) (seconds 0.5)) ) - (when (>= (- (current-time) (-> self board halfpipe-gspot-time)) (seconds 0.5)) + (when (time-elapsed? (-> self board halfpipe-gspot-time) (seconds 0.5)) (+! (-> self control transv x) (* 20480.0 (-> self control edge-grab-across-edge-dir x))) (+! (-> self control transv z) (* 20480.0 (-> self control edge-grab-across-edge-dir z))) (go target-board-stance) @@ -2431,7 +2428,7 @@ ) :enter (behavior () (set! (-> self board shock-offsetv) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *board-jump-mods*) (set! (-> self board mods-backup) (-> self control mod-surface)) @@ -2576,7 +2573,7 @@ :enter (behavior ((arg0 handle)) (logclear! (-> self focus-status) (focus-status halfpipe)) (set! (-> self board shock-offsetv) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) ) :exit target-board-exit @@ -2664,7 +2661,7 @@ ) (logclear! (-> self focus-status) (focus-status halfpipe)) (set! (-> self board shock-offsetv) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) (new 'static 'surface :name 'jump @@ -2954,7 +2951,7 @@ :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) - (set! (-> self control time-of-last-debug-heal) (current-time)) + (set-time! (-> self control time-of-last-debug-heal)) (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) (go target-board-stance) ) @@ -2963,7 +2960,7 @@ :code (behavior ((arg0 vector) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) (logclear! (-> self focus-status) (focus-status halfpipe)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) (let ((v1-6 gp-0)) @@ -3012,7 +3009,7 @@ (cond ((= arg0 'attack) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('endlessfall) (cond @@ -3021,7 +3018,7 @@ (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) (let ((s3-1 (current-time))) - (until (>= (- (current-time) s3-1) (seconds 1)) + (until (time-elapsed? s3-1 (seconds 1)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc index f42c7ffa70..16b9048303 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-util_REF.gc @@ -3,11 +3,11 @@ ;; definition for method 7 of type board ;; WARN: Return type mismatch process-drawable vs board. -(defmethod relocate board ((obj board) (arg0 int)) - (if (nonzero? (-> obj main)) - (&+! (-> obj main) arg0) +(defmethod relocate board ((this board) (arg0 int)) + (if (nonzero? (-> this main)) + (&+! (-> this main) arg0) ) - (the-as board ((method-of-type process-drawable relocate) obj arg0)) + (the-as board ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for function board-post diff --git a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc index 20711eafe6..3a18298d35 100644 --- a/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/target-board_REF.gc @@ -37,7 +37,7 @@ (case arg3 ((1) (if (< 0.9 (-> self control surface-angle)) - (set! (-> self board on-flat-time) (current-time)) + (set-time! (-> self board on-flat-time)) ) (set! (-> self board slip-factor) (lerp-scale 1.0 (-> arg0 slip-factor) (fabs (-> self control ctrl-slope-heading)) 0.0 1.0) @@ -69,9 +69,9 @@ (set! (-> arg0 turnv) (lerp-scale 91022.22 (-> arg1 turnv) (the float (- (current-time) (-> self board spin-time))) 0.0 600.0) ) - (when (< (- (current-time) (-> self board spin-ground-start-time)) (seconds 0.3)) - (set! (-> self control last-attack-end-time) (current-time)) - (set! (-> self board spin-ground-time) (current-time)) + (when (not (time-elapsed? (-> self board spin-ground-start-time) (seconds 0.3))) + (set-time! (-> self control last-attack-end-time)) + (set-time! (-> self board spin-ground-time)) (set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0))) (set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90))) (set! (-> arg0 vel-turn) 131072.0) @@ -298,7 +298,7 @@ ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) (case arg3 ((1) - (when (< (- (current-time) (-> self state-time)) (seconds 0.05)) + (when (not (time-elapsed? (-> self state-time) (seconds 0.05))) (set! (-> arg0 turnv) 0.0) (set! (-> arg0 turnvf) 0.0) ) @@ -514,7 +514,7 @@ ) (vector+float*! s5-1 (-> self control trans) (-> self control c-R-w vector 2) (* 40960.0 (seconds-per-frame))) (let ((f0-2 (vector-segment-overlap s5-1 (the-as vector (-> gp-1 world-vertex)) (-> gp-1 world-vertex 1)))) - (if (and (>= (- (current-time) (-> self board ride-time)) (seconds 0.4)) + (if (and (time-elapsed? (-> self board ride-time) (seconds 0.4)) (>= f0-2 0.0) (>= 1.0 f0-2) (not (and (-> self next-state) (= (-> self next-state name) 'target-board-duck-stance))) @@ -665,10 +665,10 @@ (set! (-> self board unknown-sound-id00) (new 'static 'sound-id)) (set-setting! 'mode-sound-bank 'board 0.0 0) (set-setting! 'sound-flava #f 30.0 2) - (set! (-> self board board-get-on-time) (current-time)) + (set-time! (-> self board board-get-on-time)) (set! (-> self board stick-lock) #f) (set! (-> self board stick-off) #f) - (set! (-> self board unstuck-time) (current-time)) + (set-time! (-> self board unstuck-time)) (set! (-> self board stuck-count) 0) (set! (-> self board slip-factor) 1.0) (set! (-> self board unknown-symbol00) #f) @@ -835,7 +835,7 @@ (not (logtest? (-> self control status) (collide-status touch-actor))) ) ) - (set! (-> self board smack-surface-time) (current-time)) + (set-time! (-> self board smack-surface-time)) (set! (-> self board smack-speed) (-> self control ctrl-xz-vel)) (set! (-> self board smack-normal quad) (-> self control wall-contact-normal quad)) #t @@ -910,14 +910,14 @@ (set! f0-28 0.0) (set! f1-23 0.0) ) - (when (and (< (- (current-time) (-> self control last-time-touching-actor)) (seconds 1)) + (when (and (not (time-elapsed? (-> self control last-time-touching-actor) (seconds 1))) (>= f28-0 0.5) (< (vector-dot (-> self control wall-contact-normal) (-> self control to-target-pt-xz)) -0.7) (logtest? (-> self control mod-surface flags) (surface-flag air)) (< 0.0 (-> gp-0 y)) ) (cond - ((and (>= (- (current-time) (-> self control last-time-touching-actor)) (seconds 0.1)) + ((and (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.1)) (< 0.3 (-> self control blocked-factor)) ) (set! f0-28 f1-23) @@ -1023,7 +1023,7 @@ (logtest? (state-flags prevent-board) (-> self state-flags)) (not (logtest? (-> *game-info* features) (game-feature board))) ) - (and (>= (- (current-time) (-> self board board-get-on-time)) (seconds 1)) + (and (time-elapsed? (-> self board board-get-on-time) (seconds 1)) (< (-> self board board-get-on-time) (max (-> self control list-time-on-ground) (-> self control last-time-of-stuck)) ) @@ -1192,7 +1192,7 @@ ;; WARN: Return type mismatch int vs none. (defbehavior target-board-physics target ((arg0 vector)) (let ((f30-0 0.5)) - (if (>= (- (current-time) (-> self board unknown-time-frame02)) (seconds 0.3)) + (if (time-elapsed? (-> self board unknown-time-frame02) (seconds 0.3)) (+! (-> self board shock-offsetv) (* (- (-> arg0 y) (-> self control transv y)) f30-0)) (set! (-> self board up-vector 1 quad) (-> self board up-vector 0 quad)) ) @@ -1210,7 +1210,7 @@ (set! (-> self board shock-offsetv) 0.0) (set! (-> self board shock-offset) (* 0.96 (-> self board shock-offset))) ) - ((and (or (< (- (current-time) (-> self control last-time-on-surface)) (seconds 0.2)) + ((and (or (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.2))) (< (-> self board shock-offset) 0.0) ) (!= (-> self control mod-surface mode) 'air) @@ -1396,7 +1396,7 @@ (not (and (-> self next-state) (= (-> self next-state name) 'target-board-smack))) (not (focus-test? self halfpipe)) (!= (-> self control ground-pat mode) 3) - (>= (- (current-time) (-> self board halfpipe-time)) (seconds 0.1)) + (time-elapsed? (-> self board halfpipe-time) (seconds 0.1)) ) ) (let ((s5-3 (new 'stack-no-clear 'vector))) @@ -1417,7 +1417,7 @@ (s3-3 (vector-matrix*! (new 'stack-no-clear 'vector) s3-2 (-> self control w-R-c))) ) (logior! (-> self control status) (collide-status glance)) - (set! (-> self board glance-time) (current-time)) + (set-time! (-> self board glance-time)) (let ((v1-99 s2-2)) (set! (-> self board glance-speed) (sqrtf (+ (* (-> v1-99 x) (-> v1-99 x)) (* (-> v1-99 z) (-> v1-99 z))))) ) @@ -1485,7 +1485,7 @@ (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) - (set! (-> self control last-time-of-stuck) (current-time)) + (set-time! (-> self control last-time-of-stuck)) ) 0 (none) @@ -1517,7 +1517,7 @@ (not (logtest? (-> self control status) (collide-status on-surface))) ) (begin - (set! (-> self board in-air-time) (current-time)) + (set-time! (-> self board in-air-time)) (and (not (and (-> self next-state) (let ((v1-12 (-> self next-state name))) (or (= v1-12 'target-board-stance) (= v1-12 'target-board-duck-stance) (= v1-12 'target-board-turn-to)) @@ -1556,7 +1556,7 @@ ) ) ) - (>= (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.2)) + (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.2)) ) ) ) @@ -1567,7 +1567,7 @@ (else (set! (-> self control bend-speed) 1024.0) (set! (-> self control bend-target) 1.0) - (when (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) + (when (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1))) (forward-up-nopitch->quaternion (-> self control dir-targ) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control dir-targ)) @@ -1621,7 +1621,7 @@ (#f (set! (-> self control dynam gravity-length) 245760.0) ) - ((>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1)) + ((time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) (seek! (-> self control dynam gravity-length) 245760.0 (* 245760.0 (seconds-per-frame))) ) (else @@ -1670,15 +1670,15 @@ ) (when (and (zero? (shr (shl (-> self board unknown-int00) 54) 61)) (!= (shr (shl (-> self board unknown-int00) 40) 58) 13) - (>= (- (current-time) (-> self board unknown-time-frame02)) (seconds 0.2)) + (time-elapsed? (-> self board unknown-time-frame02) (seconds 0.2)) (< 819.2 (- f30-0 f0-36)) (or (< (-> self board unknown-time-frame01) (-> self control last-time-on-surface)) - (< (- (current-time) (-> self board unknown-time-frame01)) (seconds 0.2)) + (not (time-elapsed? (-> self board unknown-time-frame01) (seconds 0.2))) ) (< 0.98 (vector-dot (-> self board unknown-vector01) (-> self control standard-dynamics gravity-normal))) (< f26-0 8192.0) (< f30-0 8192.0) - (or (< (* 0.2 f28-0) f30-0) (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1))) + (or (< (* 0.2 f28-0) f30-0) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)))) ) (vector+float*! (-> self control transv) @@ -1686,25 +1686,25 @@ (-> self control dynam gravity-normal) (* 7.0 (fmin 4096.0 f30-0)) ) - (if (>= (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) - (set! (-> self board unknown-time-frame01) (current-time)) + (if (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)) + (set-time! (-> self board unknown-time-frame01)) ) - (set! (-> self board unknown-time-frame00) (current-time)) + (set-time! (-> self board unknown-time-frame00)) ) ) (when (and (not (logtest? (-> self control status) (collide-status on-surface))) (< 0.0 f28-0) (or (and (or (< (target-height-above-ground) 4096.0) - (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) + (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1))) ) (< 8192.0 (- f28-0 (vector-dot (-> self control dynam gravity-normal) (-> self board slow-transv)))) ) - (< (- (current-time) (-> self board unknown-time-frame02)) (seconds 0.1)) + (not (time-elapsed? (-> self board unknown-time-frame02) (seconds 0.1))) ) (>= 204.8 f30-0) (not (and (-> self next-state) (= (-> self next-state name) 'target-board-jump))) ) - (set! (-> self board unknown-time-frame02) (current-time)) + (set-time! (-> self board unknown-time-frame02)) (vector-length (-> self control transv)) (let ((v1-303 (new-stack-vector0)) (f0-51 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -1777,14 +1777,14 @@ (if (and (= (-> self control pad-magnitude) 0.0) (>= (current-time) (-> self control turn-lockout-end-time)) (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) - (>= (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) + (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)) ) (rot->dir-targ! (-> self control)) ) - (when (and (< (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1)) + (when (and (not (time-elapsed? (-> self control last-time-on-surface) (seconds 0.1))) (>= (current-time) (-> self control turn-lockout-end-time)) (not (logtest? (-> self control current-surface flags) (surface-flag turn-to-vel))) - (>= (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.1)) + (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1)) ) (let* ((s3-0 (vector-flatten! @@ -1810,7 +1810,7 @@ ) ) (if (cpad-pressed? (-> self control cpad number) l1) - (set! (-> self board unknown-time-frame06) (current-time)) + (set-time! (-> self board unknown-time-frame06)) ) (board-add-thrust) (add-gravity) @@ -1884,7 +1884,7 @@ (set! (-> self board trotyv) 0.0) ) ((and (= (-> self control danger-mode) 'board-spin) - (or (board-on-ground?) (>= (- (current-time) (-> self board spin-time)) (seconds 0.5))) + (or (board-on-ground?) (time-elapsed? (-> self board spin-time) (seconds 0.5))) ) (target-danger-set! 'harmless #f) ) @@ -1976,7 +1976,7 @@ (joint-points) (do-target-gspot) (target-powerup-process) - (set! (-> self board board-time) (current-time)) + (set-time! (-> self board board-time)) (target-board-exit-check) (target-board-effect) (when (board-on-ground?) @@ -2036,9 +2036,9 @@ (return (the-as time-frame #f)) ) (vector-normalize-copy! (-> self board ride-dir) (-> self board ride-segment) 1.0) - (when (>= (- (current-time) (-> self board ride-time)) (seconds 0.2)) + (when (time-elapsed? (-> self board ride-time) (seconds 0.2)) (set! (-> self board ride-lock-on) #f) - (set! (-> self board ride-start-time) (current-time)) + (set-time! (-> self board ride-start-time)) (vector-normalize-copy! (-> self board ride-dir) (-> self control transv) 1.0) (dotimes (v1-25 3) (vector-reset! (-> self board ride-vertex-old v1-25)) @@ -2130,7 +2130,7 @@ ) ) (when (and (< (-> self board ride-vertex-index) 0.0) - (< (- (current-time) (-> self board ride-time)) (seconds 0.2)) + (not (time-elapsed? (-> self board ride-time) (seconds 0.2))) (zero? s3-3) ) (+! s3-3 1) @@ -2158,7 +2158,7 @@ (dotimes (v1-127 3) (set! (-> self board ride-vertex v1-127 w) 1.0) ) - (when (>= (- (current-time) (-> self board ride-time)) (seconds 0.2)) + (when (time-elapsed? (-> self board ride-time) (seconds 0.2)) (set! (-> self board ride-rot-abs 0) (vector-y-angle (-> self board ride-segment))) (set! (-> self board ride-rtv-abs) 0.0) ) @@ -2205,7 +2205,7 @@ ) ) (let ((s4-3 0)) - (if (and (< (fabs f30-2) 16384.0) (< (- (current-time) (-> self board ride-start-time)) (seconds 0.1))) + (if (and (< (fabs f30-2) 16384.0) (not (time-elapsed? (-> self board ride-start-time) (seconds 0.1)))) (set! s4-3 (logior s4-3 1)) ) (if (or (< (vector-dot @@ -2299,7 +2299,7 @@ (set! s4-3 (logior s4-3 8)) ) ) - (if (>= (- (current-time) (-> self board ride-button-time)) (seconds 0.05)) + (if (time-elapsed? (-> self board ride-button-time) (seconds 0.05)) (set! s4-3 (logior s4-3 16)) ) (if (< (vector-length (-> self board ride-segment)) @@ -2311,7 +2311,7 @@ (set! s4-3 (logior s4-3 64)) ) (logclear! (-> self control status) (collide-status probe-hit)) - (when (and (< (- (current-time) (-> self board ride-time)) (seconds 0.2)) (nonzero? s4-3)) + (when (and (not (time-elapsed? (-> self board ride-time) (seconds 0.2))) (nonzero? s4-3)) (if (logtest? s4-3 1) (format #t "exit speed ~M~%" f30-2) ) @@ -2387,7 +2387,7 @@ (-> self control to-target-pt-xz) (+ (-> self board ride-rot) (* -2730.6667 (-> self board ride-lean))) ) - (set! (-> self board ride-time) (current-time)) + (set-time! (-> self board ride-time)) (set! (-> self board ride-speed) f30-2) ) ) @@ -2544,7 +2544,7 @@ (when (logtest? (-> self control root-prim prim-core action) (collide-action check-edge)) (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags two)) (cond - ((>= (- (current-time) (-> self board ride-time)) (seconds 0.2)) + ((time-elapsed? (-> self board ride-time) (seconds 0.2)) (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one)) (set! (-> *collide-edge-board-spec* touching-segment) #f) ) @@ -2670,7 +2670,7 @@ (target-powerup-process) (target-board-exit-check) (target-board-effect) - (set! (-> self board board-time) (current-time)) + (set-time! (-> self board board-time)) 0 (none) ) @@ -2799,29 +2799,29 @@ ;; definition for method 9 of type board-info ;; WARN: Return type mismatch int vs none. -(defmethod add-to-trick-list board-info ((obj board-info) (arg0 board-tricks) (arg1 float)) +(defmethod add-to-trick-list board-info ((this board-info) (arg0 board-tricks) (arg1 float)) "Add specified trick and point amount to trick list." - (send-event (handle->process (-> obj process 0 notify)) 'notify 'trick-point arg0) - (when (and (< (-> obj trick-count) 16) - (and (< 0.0 arg1) (nonzero? (-> (the-as fact-info-target (-> obj process 0 fact)) trick-point-duration))) + (send-event (handle->process (-> this process 0 notify)) 'notify 'trick-point arg0) + (when (and (< (-> this trick-count) 16) + (and (< 0.0 arg1) (nonzero? (-> (the-as fact-info-target (-> this process 0 fact)) trick-point-duration))) ) (let ((s4-0 0)) (when (>= (- (-> *display* game-clock frame-counter) - (-> (the-as fact-info-target (-> obj process 0 fact)) trick-point-pickup-time) + (-> (the-as fact-info-target (-> this process 0 fact)) trick-point-pickup-time) ) (seconds 30) ) (countdown (v1-20 16) - (set! (-> obj trick-list 0) (board-tricks none)) + (set! (-> this trick-list 0) (board-tricks none)) ) ) (countdown (v1-23 15) - (if (= (-> obj trick-list v1-23) arg0) + (if (= (-> this trick-list v1-23) arg0) (+! s4-0 1) ) - (set! (-> obj trick-list (+ v1-23 1)) (-> obj trick-list v1-23)) + (set! (-> this trick-list (+ v1-23 1)) (-> this trick-list v1-23)) ) - (set! (-> obj trick-list 0) arg0) + (set! (-> this trick-list 0) arg0) (let* ((a0-24 (* arg1 (lerp-scale 1.0 0.1 (the float s4-0) 2.0 6.0))) (s3-1 (the float (* 25 (/ (+ (the int a0-24) 24) 25)))) ) @@ -2900,18 +2900,18 @@ s3-1 ) ) - (when (nonzero? (-> obj trick-count)) - (format #t " + combo ~,,0f" (-> obj trick-points-array (+ (-> obj trick-count) -1))) - (+! (-> obj trick-points-array (+ (-> obj trick-count) -1)) - (-> obj trick-points-array (+ (-> obj trick-count) -1)) + (when (nonzero? (-> this trick-count)) + (format #t " + combo ~,,0f" (-> this trick-points-array (+ (-> this trick-count) -1))) + (+! (-> this trick-points-array (+ (-> this trick-count) -1)) + (-> this trick-points-array (+ (-> this trick-count) -1)) ) ) (format #t "~%") - (set! (-> obj trick-array (-> obj trick-count)) arg0) - (set! (-> obj trick-points-array (-> obj trick-count)) s3-1) + (set! (-> this trick-array (-> this trick-count)) arg0) + (set! (-> this trick-points-array (-> this trick-count)) s3-1) ) ) - (+! (-> obj trick-count) 1) + (+! (-> this trick-count) 1) ) 0 (none) @@ -2919,26 +2919,26 @@ ;; definition for method 10 of type board-info ;; WARN: Return type mismatch int vs none. -(defmethod flush-trick-list board-info ((obj board-info)) +(defmethod flush-trick-list board-info ((this board-info)) "Flush trick list and give out points." (let ((f30-0 0.0)) - (dotimes (v1-0 (-> obj trick-count)) - (+! f30-0 (-> obj trick-points-array v1-0)) + (dotimes (v1-0 (-> this trick-count)) + (+! f30-0 (-> this trick-points-array v1-0)) ) (when (< 0.0 f30-0) (send-event - (handle->process (-> obj process 0 notify)) + (handle->process (-> this process 0 notify)) 'notify 'trick-flush f30-0 - (-> obj trick-list) - (-> obj trick-count) + (-> this trick-list) + (-> this trick-count) ) - (send-event (ppointer->process (-> obj process)) 'get-pickup (pickup-type trick-point) f30-0) + (send-event (ppointer->process (-> this process)) 'get-pickup (pickup-type trick-point) f30-0) (sound-play "trick-score") ) ) - (set! (-> obj trick-count) 0) + (set! (-> this trick-count) 0) 0 0 (none) diff --git a/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc b/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc index 802d7a0e21..9b7bcca1d3 100644 --- a/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/collide-reaction-target_REF.gc @@ -142,9 +142,9 @@ ) ) (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf07))) - (set! (-> arg0 time-of-last-lc-touch-edge) (current-time)) + (set-time! (-> arg0 time-of-last-lc-touch-edge)) (set! sv-40 (logior sv-40 (collide-status touch-edge))) - (set! (-> arg0 time-of-last-lc) (current-time)) + (set-time! (-> arg0 time-of-last-lc)) (let ((f30-0 (vector-dot tangent (-> arg0 turn-to-target))) (f0-27 (if (logtest? sv-32 (cshape-reaction-flags csrf01)) (cos (- 16384.0 (acos (-> arg0 coverage)))) @@ -194,13 +194,13 @@ ) (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf06))) (set! sv-40 (logior sv-40 (collide-status touch-edge))) - (set! (-> arg0 time-of-last-lc) (current-time)) + (set-time! (-> arg0 time-of-last-lc)) (set! sv-48 (the-as symbol #f)) ) (#t (set! sv-32 (logior sv-32 (cshape-reaction-flags csrf06))) (set! sv-40 (logior sv-40 (collide-status touch-edge))) - (set! (-> arg0 time-of-last-lc) (current-time)) + (set-time! (-> arg0 time-of-last-lc)) ) ) ) @@ -381,7 +381,7 @@ (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-other-tri intersect) (-> arg0 grount-touch-point)) ) ) - (< (- (current-time) (-> arg0 list-time-on-ground)) (seconds 0.3)) + (not (time-elapsed? (-> arg0 list-time-on-ground) (seconds 0.3))) ) (logtest? sv-104 (cshape-reaction-flags csrf15)) ) @@ -452,7 +452,7 @@ (set! (-> arg0 ground-poly-normal quad) (-> arg0 poly-normal quad)) (set! (-> arg0 ground-contact-normal quad) (-> sv-84 quad)) (set! (-> arg0 ground-local-norm-dot-grav) (vector-dot sv-84 (-> arg0 dynam gravity-normal))) - (set! (-> arg0 list-time-on-ground) (current-time)) + (set-time! (-> arg0 list-time-on-ground)) (set! (-> arg0 ground-pat) (-> arg0 poly-pat)) (set! (-> arg0 grount-touch-point quad) (-> arg1 best-other-tri intersect quad)) (set! (-> arg0 ground-contact-sphere-center quad) (-> arg1 best-my-prim prim-core world-sphere quad)) @@ -582,7 +582,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defbehavior rail-surface-touch target () - (when (>= (- (current-time) (-> self control time-of-last-surface-change)) (seconds 0.2)) + (when (time-elapsed? (-> self control time-of-last-surface-change) (seconds 0.2)) (logclear! (-> *collide-edge-board-spec* flags) (collide-edge-spec-flags one send-event)) (set! (-> *collide-edge-board-spec* touching-segment) #f) (do-edge-grabs *target* *collide-cache* *collide-edge-board-spec*) diff --git a/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc b/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc index 1f6939ec6c..7370707208 100644 --- a/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/darkjak-h_REF.gc @@ -26,27 +26,27 @@ ) ;; definition for method 3 of type darkjak-info -(defmethod inspect darkjak-info ((obj darkjak-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect darkjak-info ((this darkjak-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Tattack-time: ~D~%" (-> obj attack-time)) - (format #t "~1Tattack-count: ~D~%" (-> obj attack-count)) - (format #t "~1Tstage: ~D~%" (-> obj stage)) - (format #t "~1Twant-stage: ~D~%" (-> obj want-stage)) - (format #t "~1Tclock-pos: ~f~%" (-> obj clock-pos)) - (format #t "~1Tclock-vel: ~f~%" (-> obj clock-vel)) - (format #t "~1Tclock-on: ~A~%" (-> obj clock-on)) - (format #t "~1Thud[1] @ #x~X~%" (-> obj hud)) - (format #t "~1Ttone: ~D~%" (-> obj tone)) - (format #t "~1Tbomb: ~D~%" (-> obj bomb)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~1Tattack-count: ~D~%" (-> this attack-count)) + (format #t "~1Tstage: ~D~%" (-> this stage)) + (format #t "~1Twant-stage: ~D~%" (-> this want-stage)) + (format #t "~1Tclock-pos: ~f~%" (-> this clock-pos)) + (format #t "~1Tclock-vel: ~f~%" (-> this clock-vel)) + (format #t "~1Tclock-on: ~A~%" (-> this clock-on)) + (format #t "~1Thud[1] @ #x~X~%" (-> this hud)) + (format #t "~1Ttone: ~D~%" (-> this tone)) + (format #t "~1Tbomb: ~D~%" (-> this bomb)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-blue-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-blue-shot_REF.gc index 2e042276c8..9589e9794c 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-blue-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-blue-shot_REF.gc @@ -47,64 +47,64 @@ ) ;; definition for method 3 of type gun-blue-shot -(defmethod inspect gun-blue-shot ((obj gun-blue-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-blue-shot ((this gun-blue-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinit-pos: #~%" (-> obj init-pos)) - (format #t "~2Tinit-dir: #~%" (-> obj init-dir)) - (format #t "~2Tcollide-normal: #~%" (-> obj collide-normal)) + (format #t "~2Tinit-pos: #~%" (-> this init-pos)) + (format #t "~2Tinit-dir: #~%" (-> this init-dir)) + (format #t "~2Tcollide-normal: #~%" (-> this collide-normal)) (label cfg-4) - obj + this ) ;; definition for method 24 of type gun-blue-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight gun-blue-shot ((obj gun-blue-shot)) +(defmethod draw-laser-sight gun-blue-shot ((this gun-blue-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (let* ((s5-0 (ppointer->process (-> obj parent))) + (let* ((s5-0 (ppointer->process (-> this parent))) (s4-0 (-> *part-id-table* 196)) (s3-0 (get-field-spec-by-id s4-0 (sp-field-id spt-omega))) (s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> (the-as projectile s5-0) node-list data 16))) ) (when s3-0 - (let ((s1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 1.0)) + (let ((s1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 1.0)) (s2-0 (new 'stack-no-clear 'collide-query)) ) (vector-rotate-y! s1-0 s1-0 16384.0) (vector+float*! s1-0 s5-1 s1-0 -8806.4) (set! (-> s2-0 start-pos quad) (-> s1-0 quad)) - (vector-float*! (-> s2-0 move-dist) (-> obj root dynam gravity-normal) -81920.0) + (vector-float*! (-> s2-0 move-dist) (-> this root dynam gravity-normal) -81920.0) (let ((v1-11 s2-0)) (set! (-> v1-11 radius) 1228.8) (set! (-> v1-11 collide-with) (collide-spec backgnd obstacle hit-by-player-list hit-by-others-list)) - (set! (-> v1-11 ignore-process0) obj) - (set! (-> v1-11 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> v1-11 ignore-process0) this) + (set! (-> v1-11 ignore-process1) (ppointer->process (-> this parent))) (set! (-> v1-11 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-11 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) (set! (-> s3-0 initial-valuef) - (fmin (+ 1638.4 (-> s2-0 best-other-tri intersect y)) (+ -1228.8 (-> obj starting-pos y))) + (fmin (+ 1638.4 (-> s2-0 best-other-tri intersect y)) (+ -1228.8 (-> this starting-pos y))) ) - (set! (-> s3-0 initial-valuef) (+ -81920.0 (-> obj starting-pos y))) + (set! (-> s3-0 initial-valuef) (+ -81920.0 (-> this starting-pos y))) ) ) ) (let ((s4-1 (get-field-spec-by-id s4-0 (sp-field-id spt-rotate-y)))) (if s4-1 - (set! (-> s4-1 initial-valuef) (y-angle (-> obj root))) + (set! (-> s4-1 initial-valuef) (y-angle (-> this root))) ) ) (launch-particles (-> *part-id-table* 196) s5-1) (let ((s4-2 (get-field-spec-by-id (-> *part-id-table* 195) (sp-field-id spt-rotate-y)))) (if s4-2 - (set! (-> s4-2 initial-valuef) (y-angle (-> obj root))) + (set! (-> s4-2 initial-valuef) (y-angle (-> this root))) ) ) (launch-particles (-> *part-id-table* 195) s5-1) @@ -116,7 +116,7 @@ ;; definition for method 26 of type gun-blue-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles gun-blue-shot ((obj gun-blue-shot)) +(defmethod spawn-shell-particles gun-blue-shot ((this gun-blue-shot)) "TODO - confirm" (rlet ((vf0 :class vf) (vf4 :class vf) @@ -124,14 +124,14 @@ (vf6 :class vf) ) (init-vf0-vector) - (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> obj init-pos)))) - (draw-beam (-> *part-id-table* 191) (-> obj init-pos) s3-1 #t #t) - (draw-beam (-> *part-id-table* 194) (-> obj init-pos) (-> obj starting-dir) #f #t) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this init-pos)))) + (draw-beam (-> *part-id-table* 191) (-> this init-pos) s3-1 #t #t) + (draw-beam (-> *part-id-table* 194) (-> this init-pos) (-> this starting-dir) #f #t) (let ((s5-0 (-> *part-id-table* 206)) (s4-0 (-> *part-id-table* 205)) ) (new 'stack-no-clear 'vector) - (let ((s2-0 (vector-reflect! (new 'stack-no-clear 'vector) s3-1 (-> obj collide-normal)))) + (let ((s2-0 (vector-reflect! (new 'stack-no-clear 'vector) s3-1 (-> this collide-normal)))) (vector-normalize! s2-0 1.0) (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-x)) (get-field-spec-by-id s5-0 (sp-field-id spt-conerot-y)) @@ -182,7 +182,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-13) a0-19 a1-15 @@ -204,17 +204,17 @@ ;; definition for method 27 of type gun-blue-shot ;; WARN: Return type mismatch int vs none. -(defmethod unknown-particles gun-blue-shot ((obj gun-blue-shot)) +(defmethod unknown-particles gun-blue-shot ((this gun-blue-shot)) "TODO - confirm" - (draw-beam (-> *part-id-table* 191) (-> obj init-pos) (-> obj init-dir) #f #t) - (draw-beam (-> *part-id-table* 194) (-> obj init-pos) (-> obj starting-dir) #f #t) + (draw-beam (-> *part-id-table* 191) (-> this init-pos) (-> this init-dir) #f #t) + (draw-beam (-> *part-id-table* 194) (-> this init-pos) (-> this starting-dir) #f #t) 0 (none) ) ;; definition for method 28 of type gun-blue-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound gun-blue-shot ((obj gun-blue-shot) (arg0 projectile-options)) +(defmethod play-impact-sound gun-blue-shot ((this gun-blue-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -229,16 +229,16 @@ ) ;; definition for method 38 of type gun-blue-shot -(defmethod made-impact? gun-blue-shot ((obj gun-blue-shot)) +(defmethod made-impact? gun-blue-shot ((this gun-blue-shot)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a1-0 t1-0)) (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a1-0 ignore-process0) obj) - (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-0 action-mask) (collide-action solid)) ) @@ -275,9 +275,9 @@ ;; definition for method 30 of type gun-blue-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! gun-blue-shot ((obj gun-blue-shot)) +(defmethod init-proj-collision! gun-blue-shot ((this gun-blue-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-blue-shot) (set! (-> s5-0 no-reaction) @@ -315,9 +315,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 @@ -327,22 +327,22 @@ ;; definition for method 31 of type gun-blue-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-blue-shot ((obj gun-blue-shot)) +(defmethod init-proj-settings! gun-blue-shot ((this gun-blue-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (with-pp (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (set! (-> obj init-pos quad) (-> obj root trans quad)) - (set! (-> obj init-dir quad) (-> obj starting-dir quad)) - (vector-normalize-copy! (-> obj root transv) (-> obj init-dir) (* 327680.0 (-> pp clock frames-per-second))) - (set! (-> obj attack-mode) 'eco-blue) - (set! (-> obj max-speed) (* 327680.0 (-> pp clock frames-per-second))) - (set! (-> obj timeout) 1) - (set! (-> obj move) gun-blue-shot-move) - (vector-reset! (-> obj collide-normal)) - (set! (-> obj damage) (if (logtest? (game-feature gun-upgrade-damage) (-> *game-info* features)) - 4.0 - 2.0 - ) + (set! (-> this init-pos quad) (-> this root trans quad)) + (set! (-> this init-dir quad) (-> this starting-dir quad)) + (vector-normalize-copy! (-> this root transv) (-> this init-dir) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this attack-mode) 'eco-blue) + (set! (-> this max-speed) (* 327680.0 (-> pp clock frames-per-second))) + (set! (-> this timeout) 1) + (set! (-> this move) gun-blue-shot-move) + (vector-reset! (-> this collide-normal)) + (set! (-> this damage) (if (logtest? (game-feature gun-upgrade-damage) (-> *game-info* features)) + 4.0 + 2.0 + ) ) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc index bcb46d7bf9..9423e2ec83 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc @@ -108,28 +108,28 @@ ) ;; definition for method 3 of type gun-dark-shot -(defmethod inspect gun-dark-shot ((obj gun-dark-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-dark-shot ((this gun-dark-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tblast-radius: ~f~%" (-> obj blast-radius)) - (format #t "~2Tcore-position: #~%" (-> obj core-position)) - (format #t "~2Tcore-velocity: #~%" (-> obj core-velocity)) - (format #t "~2Tspin-vector: #~%" (-> obj spin-vector)) - (format #t "~2Ttrack-target: ~D~%" (-> obj track-target)) - (format #t "~2Tsize-t: ~f~%" (-> obj size-t)) - (format #t "~2Tresult-array[16] @ #x~X~%" (-> obj result-array)) - (format #t "~2Tcharge-sound: ~D~%" (-> obj charge-sound)) - (format #t "~2Tfire-sound: ~D~%" (-> obj fire-sound)) - (format #t "~2Ttrail-sound: ~D~%" (-> obj trail-sound)) - (format #t "~2Texplode-sound: ~D~%" (-> obj explode-sound)) - (format #t "~2Tstart-pilot?: ~A~%" (-> obj start-pilot?)) + (format #t "~2Tblast-radius: ~f~%" (-> this blast-radius)) + (format #t "~2Tcore-position: #~%" (-> this core-position)) + (format #t "~2Tcore-velocity: #~%" (-> this core-velocity)) + (format #t "~2Tspin-vector: #~%" (-> this spin-vector)) + (format #t "~2Ttrack-target: ~D~%" (-> this track-target)) + (format #t "~2Tsize-t: ~f~%" (-> this size-t)) + (format #t "~2Tresult-array[16] @ #x~X~%" (-> this result-array)) + (format #t "~2Tcharge-sound: ~D~%" (-> this charge-sound)) + (format #t "~2Tfire-sound: ~D~%" (-> this fire-sound)) + (format #t "~2Ttrail-sound: ~D~%" (-> this trail-sound)) + (format #t "~2Texplode-sound: ~D~%" (-> this explode-sound)) + (format #t "~2Tstart-pilot?: ~A~%" (-> this start-pilot?)) (label cfg-4) - obj + this ) ;; definition for function target-gun-fire-dark @@ -165,44 +165,44 @@ ;; definition for method 31 of type gun-dark-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-dark-shot ((obj gun-dark-shot)) +(defmethod init-proj-settings! gun-dark-shot ((this gun-dark-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj attack-mode) 'eco-dark) - (vector-normalize! (-> obj root transv) (+ 225280.0 (* 225280.0 (-> obj charge-level)))) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 72) obj)) - (set! (-> obj blast-radius) 40960.0) - (set! (-> obj size-t) 0.0) - (set! (-> obj charge-sound) (new-sound-id)) - (set! (-> obj fire-sound) (new-sound-id)) - (set! (-> obj trail-sound) (new-sound-id)) - (set! (-> obj explode-sound) - (add-process *gui-control* obj (gui-channel background) (gui-action queue) "pmkrxplo" -99.0 0) + (set! (-> this attack-mode) 'eco-dark) + (vector-normalize! (-> this root transv) (+ 225280.0 (* 225280.0 (-> this charge-level)))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 72) this)) + (set! (-> this blast-radius) 40960.0) + (set! (-> this size-t) 0.0) + (set! (-> this charge-sound) (new-sound-id)) + (set! (-> this fire-sound) (new-sound-id)) + (set! (-> this trail-sound) (new-sound-id)) + (set! (-> this explode-sound) + (add-process *gui-control* this (gui-channel background) (gui-action queue) "pmkrxplo" -99.0 0) ) - (set-falloff! *gui-control* (-> obj explode-sound) #t 50 150 11) - (set! (-> obj start-pilot?) (the-as basic (and *target* (focus-test? *target* pilot)))) - ((method-of-type projectile init-proj-settings!) obj) + (set-falloff! *gui-control* (-> this explode-sound) #t 50 150 11) + (set! (-> this start-pilot?) (the-as basic (and *target* (focus-test? *target* pilot)))) + ((method-of-type projectile init-proj-settings!) this) 0 (none) ) ;; definition for method 25 of type gun-dark-shot -(defmethod spawn-impact-particles gun-dark-shot ((obj gun-dark-shot)) +(defmethod spawn-impact-particles gun-dark-shot ((this gun-dark-shot)) "Spawns associated particles with the projectile if applicable" (cond - ((and (and (-> obj next-state) (= (-> obj next-state name) 'startup)) + ((and (and (-> this next-state) (= (-> this next-state name) 'startup)) (and *target* (focus-test? *target* in-head)) ) - (kill-and-free-particles (-> obj part)) + (kill-and-free-particles (-> this part)) ) (else - (set! (-> *part-id-table* 219 init-specs 2 initial-valuef) (lerp 409.6 9216.0 (-> obj size-t))) - (set! (-> *part-id-table* 219 init-specs 8 initial-valuef) (lerp 0.0 32.0 (-> obj size-t))) - (set! (-> *part-id-table* 220 init-specs 2 initial-valuef) (lerp 409.6 32768.0 (-> obj size-t))) - (set! (-> *part-id-table* 220 init-specs 8 initial-valuef) (lerp 0.0 16.0 (-> obj size-t))) - (set! (-> *part-id-table* 218 init-specs 2 initial-valuef) (lerp 409.6 8192.0 (-> obj size-t))) - (set! (-> *part-id-table* 217 init-specs 1 initial-valuef) (lerp 0.1 1.0 (-> obj size-t))) - (set! (-> *part-id-table* 217 init-specs 2 initial-valuef) (lerp 409.6 3686.4 (-> obj size-t))) - (spawn (-> obj part) (-> obj root trans)) + (set! (-> *part-id-table* 219 init-specs 2 initial-valuef) (lerp 409.6 9216.0 (-> this size-t))) + (set! (-> *part-id-table* 219 init-specs 8 initial-valuef) (lerp 0.0 32.0 (-> this size-t))) + (set! (-> *part-id-table* 220 init-specs 2 initial-valuef) (lerp 409.6 32768.0 (-> this size-t))) + (set! (-> *part-id-table* 220 init-specs 8 initial-valuef) (lerp 0.0 16.0 (-> this size-t))) + (set! (-> *part-id-table* 218 init-specs 2 initial-valuef) (lerp 409.6 8192.0 (-> this size-t))) + (set! (-> *part-id-table* 217 init-specs 1 initial-valuef) (lerp 0.1 1.0 (-> this size-t))) + (set! (-> *part-id-table* 217 init-specs 2 initial-valuef) (lerp 409.6 3686.4 (-> this size-t))) + (spawn (-> this part) (-> this root trans)) ) ) (ja-post) @@ -211,8 +211,8 @@ ;; definition for method 32 of type gun-dark-shot ;; WARN: Return type mismatch int vs none. -(defmethod go-moving! gun-dark-shot ((obj gun-dark-shot)) - (go (method-of-object obj startup)) +(defmethod go-moving! gun-dark-shot ((this gun-dark-shot)) + (go (method-of-object this startup)) 0 (none) ) @@ -234,7 +234,7 @@ ) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (cond ((or (and *target* @@ -245,7 +245,7 @@ ) (go-virtual dissipate) ) - ((or (< (- (current-time) (-> self state-time)) (seconds 0.3)) (cpad-hold? 0 r1)) + ((or (not (time-elapsed? (-> self state-time) (seconds 0.3))) (cpad-hold? 0 r1)) (set! (-> self size-t) (fmin 1.0 (* 0.016666668 (the float (- (current-time) (-> self state-time)))))) (let ((t9-1 vector<-cspace!) (a0-13 (-> self root trans)) @@ -318,7 +318,7 @@ (vector-float*! (-> self spin-vector) (-> self spin-vector) (/ 1.0 f0-5)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-2 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-2 (let ((t9-4 (method-of-type part-tracker activate))) @@ -543,10 +543,10 @@ (defstate fizzle (gun-dark-shot) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (deactivate self) ) (process-drawable-shock-effect @@ -632,7 +632,7 @@ (sv-320 process-drawable) (sv-336 process-drawable) ) - (if (< (- (current-time) (-> self spawn-time)) (seconds 0.1)) + (if (not (time-elapsed? (-> self spawn-time) (seconds 0.1))) (send-event (ppointer->process (-> self parent)) 'release) ) (sound-stop (-> self trail-sound)) @@ -818,17 +818,17 @@ ) ) ) - (< (- (current-time) s3-0) (seconds 0.1)) + (not (time-elapsed? s3-0 (seconds 0.1))) ) ) ) - (< (- (current-time) s3-0) (seconds 5)) + (not (time-elapsed? s3-0 (seconds 5))) (not (logtest? (-> (the-as process-drawable (-> s5-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) ) ) ) ) - (when (>= (- (current-time) (the-as time-frame s4-0)) (seconds 0.05)) + (when (time-elapsed? (the-as time-frame s4-0) (seconds 0.05)) (set! s4-0 (the-as int (current-time))) (if (handle->process arg0) (process-drawable-shock-effect-bullseye @@ -860,7 +860,7 @@ :to s4-1 ) (let ((s4-2 (current-time))) - (until (>= (- (current-time) s4-2) (seconds 0.1)) + (until (time-elapsed? s4-2 (seconds 0.1)) (suspend) ) ) @@ -871,7 +871,7 @@ ) (let ((gp-3 (current-time))) (while (or (-> self child) - (and (nonzero? (get-status *gui-control* (-> self explode-sound))) (< (- (current-time) gp-3) (seconds 10))) + (and (nonzero? (get-status *gui-control* (-> self explode-sound))) (not (time-elapsed? gp-3 (seconds 10)))) ) (suspend) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc index 7aafdeec9a..6d4cecaefe 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc @@ -24,24 +24,24 @@ ) ;; definition for method 3 of type gun -(defmethod inspect gun ((obj gun)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun ((this gun)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcontrol: ~A~%" (-> obj root)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tshadow-backup: ~A~%" (-> obj shadow-backup)) - (format #t "~2Tread-scale: ~A~%" (-> obj read-scale)) - (format #t "~2Tgun-type: ~D~%" (-> obj gun-type)) - (format #t "~2Tbarrel: ~A~%" (-> obj barrel)) - (format #t "~2Tmag[4] @ #x~X~%" (-> obj mag)) - (format #t "~2Tmag-scale[4] @ #x~X~%" (-> obj mag-scale)) + (format #t "~2Tcontrol: ~A~%" (-> this root)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Tread-scale: ~A~%" (-> this read-scale)) + (format #t "~2Tgun-type: ~D~%" (-> this gun-type)) + (format #t "~2Tbarrel: ~A~%" (-> this barrel)) + (format #t "~2Tmag[4] @ #x~X~%" (-> this mag)) + (format #t "~2Tmag-scale[4] @ #x~X~%" (-> this mag-scale)) (label cfg-4) - obj + this ) ;; definition of type gun-info @@ -138,23 +138,23 @@ ) ;; definition for method 3 of type gun-info -(defmethod inspect gun-info ((obj gun-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-info ((this gun-info)) + (when (not this) + (set! this this) (goto cfg-145) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Tgun: #x~X~%" (-> obj gun)) - (format #t "~1Tgun-pos: #~%" (-> obj gun-pos)) - (format #t "~1Tgun-trans: ~`vector`P~%" (-> obj gun-pos)) - (format #t "~1Tgun-quat: ~`vector`P~%" (-> obj gun-pos quat)) - (format #t "~1Tgun-scale: ~`vector`P~%" (-> obj gun-pos scale)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tgun: #x~X~%" (-> this gun)) + (format #t "~1Tgun-pos: #~%" (-> this gun-pos)) + (format #t "~1Tgun-trans: ~`vector`P~%" (-> this gun-pos)) + (format #t "~1Tgun-quat: ~`vector`P~%" (-> this gun-pos quat)) + (format #t "~1Tgun-scale: ~`vector`P~%" (-> this gun-pos scale)) (let ((t9-7 format) (a0-8 #t) (a1-7 "~1Tgun-type: #x~X : ~S~%") - (a2-7 (-> obj gun-type)) - (v1-2 (-> obj gun-type)) + (a2-7 (-> this gun-type)) + (v1-2 (-> this gun-type)) ) (t9-7 a0-8 a1-7 a2-7 (cond ((= v1-2 (pickup-type eco-pill-dark)) @@ -268,8 +268,8 @@ (let ((t9-8 format) (a0-9 #t) (a1-8 "~1Tusing-gun-type: #x~X : ~S~%") - (a2-8 (-> obj using-gun-type)) - (v1-3 (-> obj using-gun-type)) + (a2-8 (-> this using-gun-type)) + (v1-3 (-> this using-gun-type)) ) (t9-8 a0-9 a1-8 a2-8 (cond ((= v1-3 (pickup-type eco-pill-dark)) @@ -380,92 +380,92 @@ ) ) ) - (format #t "~1Tactive?: ~A~%" (-> obj active?)) - (format #t "~1Tlatch?: ~A~%" (-> obj latch?)) - (format #t "~1Tput-away?: ~A~%" (-> obj put-away?)) - (format #t "~1Tsurpress-time: ~D~%" (-> obj surpress-time)) - (format #t "~1Tfire-time: ~D~%" (-> obj fire-time)) - (format #t "~1Tgun-time: ~D~%" (-> obj gun-time)) - (format #t "~1Tgun-get-on-time: ~D~%" (-> obj gun-get-on-time)) - (format #t "~1Tactive-time: ~D~%" (-> obj active-time)) - (format #t "~1Tfire-delay: ~D~%" (-> obj fire-delay)) - (format #t "~1Tgun-control: ~D~%" (-> obj gun-control)) - (format #t "~1Tgun-target: ~D~%" (-> obj gun-target)) - (format #t "~1Tgun-daxter: ~f~%" (-> obj gun-daxter)) - (format #t "~1Tgun-roty-rel: (deg ~r)~%" (-> obj gun-roty-rel)) - (format #t "~1Tgun-roty: (deg ~r)~%" (-> obj gun-roty)) - (format #t "~1Tgun-roty-targ: (deg ~r)~%" (-> obj gun-roty-targ)) - (format #t "~1Thips: ~A~%" (-> obj hips)) - (format #t "~1Tupper-body: ~A~%" (-> obj upper-body)) - (format #t "~1Tchest: ~A~%" (-> obj chest)) - (format #t "~1Tfire-dir-rot: (deg ~r)~%" (-> obj fire-dir-rot)) - (format #t "~1Tfire-dir: ~`vector`P~%" (-> obj fire-dir)) - (format #t "~1Tfire-point: ~`vector`P~%" (-> obj fire-point)) - (format #t "~1Tfire-dir-backup: ~`vector`P~%" (-> obj fire-dir-backup)) - (format #t "~1Tfire-dir-out: ~`vector`P~%" (-> obj fire-dir-out)) - (format #t "~1Tfire-pending: ~D~%" (-> obj fire-pending)) - (format #t "~1Tfire-pending-time: ~D~%" (-> obj fire-pending-time)) - (format #t "~1Tfire-start-time: ~D~%" (-> obj fire-start-time)) - (format #t "~1Tfire-charge: ~f~%" (-> obj fire-charge)) - (format #t "~1Tfire-spin: (deg ~r)~%" (-> obj fire-spin)) - (format #t "~1Tfire-spinv: (deg ~r)~%" (-> obj fire-spinv)) - (format #t "~1Tfire-chamber: ~D~%" (-> obj fire-chamber)) - (format #t "~1Tfire-range: (meters ~m)~%" (-> obj fire-range)) - (format #t "~1Tlaser-active?: ~A~%" (-> obj laser-active?)) - (format #t "~1Tlaser-point: ~`vector`P~%" (-> obj laser-point)) - (format #t "~1Tlaser-dir: ~`vector`P~%" (-> obj laser-dir)) - (format #t "~1Tlaser-hit-point: ~`vector`P~%" (-> obj laser-hit-point)) - (format #t "~1Ttrack?: ~D~%" (-> obj track?)) - (format #t "~1Ttrack-tilt: (deg ~r)~%" (-> obj track-tilt)) - (format #t "~1Ttrack-turn: (deg ~r)~%" (-> obj track-turn)) - (format #t "~1Ttrack-find-range: (meters ~m)~%" (-> obj track-find-range)) - (format #t "~1Ttrack-turnv-range: (meters ~m)~%" (-> obj track-turnv-range)) - (format #t "~1Ttrack-tilt-range: (meters ~m)~%" (-> obj track-tilt-range)) - (format #t "~1Ttrack-turn-range: (meters ~m)~%" (-> obj track-turn-range)) - (format #t "~1Ttrack-tilt-max: (deg ~r)~%" (-> obj track-tilt-max)) - (format #t "~1Ttrack-turn-max: (deg ~r)~%" (-> obj track-turn-max)) - (format #t "~1Ttrack-angle-mult: ~f~%" (-> obj track-angle-mult)) - (format #t "~1Ttrack-beam-size: ~f~%" (-> obj track-beam-size)) - (format #t "~1Ttrack-auto-fire: ~A~%" (-> obj track-auto-fire)) - (format #t "~1Ttrack-require: ~D~%" (-> obj track-require)) - (format #t "~1Ttrack-target-hold-time: ~D~%" (-> obj track-target-hold-time)) - (format #t "~1Ttrack-start-time: ~D~%" (-> obj track-start-time)) - (format #t "~1Ttrack-press-start-time: ~D~%" (-> obj track-press-start-time)) - (format #t "~1Ttrack-target[2] @ #x~X~%" (-> obj track-target)) + (format #t "~1Tactive?: ~A~%" (-> this active?)) + (format #t "~1Tlatch?: ~A~%" (-> this latch?)) + (format #t "~1Tput-away?: ~A~%" (-> this put-away?)) + (format #t "~1Tsurpress-time: ~D~%" (-> this surpress-time)) + (format #t "~1Tfire-time: ~D~%" (-> this fire-time)) + (format #t "~1Tgun-time: ~D~%" (-> this gun-time)) + (format #t "~1Tgun-get-on-time: ~D~%" (-> this gun-get-on-time)) + (format #t "~1Tactive-time: ~D~%" (-> this active-time)) + (format #t "~1Tfire-delay: ~D~%" (-> this fire-delay)) + (format #t "~1Tgun-control: ~D~%" (-> this gun-control)) + (format #t "~1Tgun-target: ~D~%" (-> this gun-target)) + (format #t "~1Tgun-daxter: ~f~%" (-> this gun-daxter)) + (format #t "~1Tgun-roty-rel: (deg ~r)~%" (-> this gun-roty-rel)) + (format #t "~1Tgun-roty: (deg ~r)~%" (-> this gun-roty)) + (format #t "~1Tgun-roty-targ: (deg ~r)~%" (-> this gun-roty-targ)) + (format #t "~1Thips: ~A~%" (-> this hips)) + (format #t "~1Tupper-body: ~A~%" (-> this upper-body)) + (format #t "~1Tchest: ~A~%" (-> this chest)) + (format #t "~1Tfire-dir-rot: (deg ~r)~%" (-> this fire-dir-rot)) + (format #t "~1Tfire-dir: ~`vector`P~%" (-> this fire-dir)) + (format #t "~1Tfire-point: ~`vector`P~%" (-> this fire-point)) + (format #t "~1Tfire-dir-backup: ~`vector`P~%" (-> this fire-dir-backup)) + (format #t "~1Tfire-dir-out: ~`vector`P~%" (-> this fire-dir-out)) + (format #t "~1Tfire-pending: ~D~%" (-> this fire-pending)) + (format #t "~1Tfire-pending-time: ~D~%" (-> this fire-pending-time)) + (format #t "~1Tfire-start-time: ~D~%" (-> this fire-start-time)) + (format #t "~1Tfire-charge: ~f~%" (-> this fire-charge)) + (format #t "~1Tfire-spin: (deg ~r)~%" (-> this fire-spin)) + (format #t "~1Tfire-spinv: (deg ~r)~%" (-> this fire-spinv)) + (format #t "~1Tfire-chamber: ~D~%" (-> this fire-chamber)) + (format #t "~1Tfire-range: (meters ~m)~%" (-> this fire-range)) + (format #t "~1Tlaser-active?: ~A~%" (-> this laser-active?)) + (format #t "~1Tlaser-point: ~`vector`P~%" (-> this laser-point)) + (format #t "~1Tlaser-dir: ~`vector`P~%" (-> this laser-dir)) + (format #t "~1Tlaser-hit-point: ~`vector`P~%" (-> this laser-hit-point)) + (format #t "~1Ttrack?: ~D~%" (-> this track?)) + (format #t "~1Ttrack-tilt: (deg ~r)~%" (-> this track-tilt)) + (format #t "~1Ttrack-turn: (deg ~r)~%" (-> this track-turn)) + (format #t "~1Ttrack-find-range: (meters ~m)~%" (-> this track-find-range)) + (format #t "~1Ttrack-turnv-range: (meters ~m)~%" (-> this track-turnv-range)) + (format #t "~1Ttrack-tilt-range: (meters ~m)~%" (-> this track-tilt-range)) + (format #t "~1Ttrack-turn-range: (meters ~m)~%" (-> this track-turn-range)) + (format #t "~1Ttrack-tilt-max: (deg ~r)~%" (-> this track-tilt-max)) + (format #t "~1Ttrack-turn-max: (deg ~r)~%" (-> this track-turn-max)) + (format #t "~1Ttrack-angle-mult: ~f~%" (-> this track-angle-mult)) + (format #t "~1Ttrack-beam-size: ~f~%" (-> this track-beam-size)) + (format #t "~1Ttrack-auto-fire: ~A~%" (-> this track-auto-fire)) + (format #t "~1Ttrack-require: ~D~%" (-> this track-require)) + (format #t "~1Ttrack-target-hold-time: ~D~%" (-> this track-target-hold-time)) + (format #t "~1Ttrack-start-time: ~D~%" (-> this track-start-time)) + (format #t "~1Ttrack-press-start-time: ~D~%" (-> this track-press-start-time)) + (format #t "~1Ttrack-target[2] @ #x~X~%" (-> this track-target)) (dotimes (s5-0 2) - (format #t "~T [~D]~1Ttrack-target: ~`focus`P~%" s5-0 (-> obj track-target s5-0)) + (format #t "~T [~D]~1Ttrack-target: ~`focus`P~%" s5-0 (-> this track-target s5-0)) ) - (format #t "~1Ttrack-trans: ~`vector`P~%" (-> obj track-trans)) - (format #t "~1Ttrack-dir: ~`vector`P~%" (-> obj track-dir)) - (format #t "~1Tturn-fast-hold-time: ~D~%" (-> obj turn-fast-hold-time)) - (format #t "~1Tblue-whine-sound-id: ~D~%" (-> obj blue-whine-sound-id)) - (format #t "~1Tblue-whine-volume: ~f~%" (-> obj blue-whine-volume)) - (format #t "~1Ttop-anim-twist: ~`vector`P~%" (-> obj top-anim-twist)) - (format #t "~1Ttop-anim-twist-targ: ~`vector`P~%" (-> obj top-anim-twist-targ)) - (format #t "~1Ttop-anim-look-at: ~`vector`P~%" (-> obj top-anim-look-at)) - (format #t "~1Ttop-anim-twist-reset: ~D~%" (-> obj top-anim-twist-reset)) - (format #t "~1Ttop-anim-gun-height: (meters ~m)~%" (-> obj top-anim-gun-height)) - (format #t "~1Ttop-anim-blue-cycle: ~f~%" (-> obj top-anim-blue-cycle)) - (format #t "~1Ttop-anim-low-high: ~f~%" (-> obj top-anim-low-high)) - (format #t "~1Ttop-anim-extra-twistv: (deg ~r)~%" (-> obj top-anim-extra-twistv)) - (format #t "~1Ttop-anim-tilt-up: (deg ~r)~%" (-> obj top-anim-tilt-up)) - (format #t "~1Tattack-combo: #~%" (-> obj attack-combo)) - (format #t "~1Tcombo-window-start: ~D~%" (-> obj combo-window-start)) - (format #t "~1Tcombo-window-state: ~A~%" (-> obj combo-window-state)) - (format #t "~1Tcombo-fire-delay: ~D~%" (-> obj combo-fire-delay)) - (format #t "~1Tcharge-ammo: ~f~%" (-> obj charge-ammo)) - (format #t "~1Tcharge-start-time: ~D~%" (-> obj charge-start-time)) - (format #t "~1Tcharge-inc-time: ~D~%" (-> obj charge-inc-time)) - (format #t "~1Tcharge-active?: ~D~%" (-> obj charge-active?)) + (format #t "~1Ttrack-trans: ~`vector`P~%" (-> this track-trans)) + (format #t "~1Ttrack-dir: ~`vector`P~%" (-> this track-dir)) + (format #t "~1Tturn-fast-hold-time: ~D~%" (-> this turn-fast-hold-time)) + (format #t "~1Tblue-whine-sound-id: ~D~%" (-> this blue-whine-sound-id)) + (format #t "~1Tblue-whine-volume: ~f~%" (-> this blue-whine-volume)) + (format #t "~1Ttop-anim-twist: ~`vector`P~%" (-> this top-anim-twist)) + (format #t "~1Ttop-anim-twist-targ: ~`vector`P~%" (-> this top-anim-twist-targ)) + (format #t "~1Ttop-anim-look-at: ~`vector`P~%" (-> this top-anim-look-at)) + (format #t "~1Ttop-anim-twist-reset: ~D~%" (-> this top-anim-twist-reset)) + (format #t "~1Ttop-anim-gun-height: (meters ~m)~%" (-> this top-anim-gun-height)) + (format #t "~1Ttop-anim-blue-cycle: ~f~%" (-> this top-anim-blue-cycle)) + (format #t "~1Ttop-anim-low-high: ~f~%" (-> this top-anim-low-high)) + (format #t "~1Ttop-anim-extra-twistv: (deg ~r)~%" (-> this top-anim-extra-twistv)) + (format #t "~1Ttop-anim-tilt-up: (deg ~r)~%" (-> this top-anim-tilt-up)) + (format #t "~1Tattack-combo: #~%" (-> this attack-combo)) + (format #t "~1Tcombo-window-start: ~D~%" (-> this combo-window-start)) + (format #t "~1Tcombo-window-state: ~A~%" (-> this combo-window-state)) + (format #t "~1Tcombo-fire-delay: ~D~%" (-> this combo-fire-delay)) + (format #t "~1Tcharge-ammo: ~f~%" (-> this charge-ammo)) + (format #t "~1Tcharge-start-time: ~D~%" (-> this charge-start-time)) + (format #t "~1Tcharge-inc-time: ~D~%" (-> this charge-inc-time)) + (format #t "~1Tcharge-active?: ~D~%" (-> this charge-active?)) (label cfg-145) - obj + this ) ;; definition for function want-to-gun? (defbehavior want-to-gun? process ((arg0 target) (arg1 symbol)) (local-vars (v1-36 symbol)) (and (logtest? (-> arg0 game features) (game-feature gun)) - (>= (- (current-time) (-> arg0 gun gun-time)) (seconds 0.1)) + (time-elapsed? (-> arg0 gun gun-time) (seconds 0.1)) (not (focus-test? arg0 dead hit board mech dark teleporting)) (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> arg0 control current-surface flags))) (not (logtest? (state-flags prevent-gun) (-> arg0 state-flags))) @@ -487,7 +487,7 @@ (-> arg0 gun latch?) ) (not (-> arg0 skel top-anim frame-group)) - (>= (- (current-time) (-> arg0 control time-of-last-debug-float)) (seconds 0.1)) + (time-elapsed? (-> arg0 control time-of-last-debug-float) (seconds 0.1)) ) ) @@ -523,11 +523,11 @@ ) ;; definition for method 12 of type fact-info-target -(defmethod get-gun-ammo fact-info-target ((obj fact-info-target)) - (let ((current-gun (gun->ammo (-> (the-as target (-> obj process)) gun gun-type)))) +(defmethod get-gun-ammo fact-info-target ((this fact-info-target)) + (let ((current-gun (gun->ammo (-> (the-as target (-> this process)) gun gun-type)))) (if (zero? current-gun) 0.0 - (-> (the-as target (-> obj process)) game gun-ammo (+ current-gun -13)) + (-> (the-as target (-> this process)) game gun-ammo (+ current-gun -13)) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc index 210e21e674..f0570f2ea2 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-red-shot_REF.gc @@ -32,24 +32,24 @@ ) ;; definition for method 3 of type gun-red-shot -(defmethod inspect gun-red-shot ((obj gun-red-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-red-shot ((this gun-red-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tprobe-count: ~D~%" (-> obj probe-count)) - (format #t "~2Tprobe-mask: ~D~%" (-> obj probe-mask)) - (format #t "~2Tactor-count: ~D~%" (-> obj actor-count)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tstart-pos: #~%" (-> obj start-pos)) - (format #t "~2Tstart-dir: #~%" (-> obj start-dir)) - (format #t "~2Tstart-rot: #~%" (-> obj start-rot)) - (format #t "~2Tprobe-dir[19] @ #x~X~%" (-> obj probe-dir)) + (format #t "~2Tprobe-count: ~D~%" (-> this probe-count)) + (format #t "~2Tprobe-mask: ~D~%" (-> this probe-mask)) + (format #t "~2Tactor-count: ~D~%" (-> this actor-count)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tstart-pos: #~%" (-> this start-pos)) + (format #t "~2Tstart-dir: #~%" (-> this start-dir)) + (format #t "~2Tstart-rot: #~%" (-> this start-rot)) + (format #t "~2Tprobe-dir[19] @ #x~X~%" (-> this probe-dir)) (label cfg-4) - obj + this ) ;; definition for function target-gun-fire-red @@ -148,7 +148,7 @@ ;; definition for method 29 of type gun-red-shot ;; INFO: Used lq/sq -(defmethod fire! gun-red-shot ((obj gun-red-shot) (arg0 process-drawable) (arg1 int)) +(defmethod fire! gun-red-shot ((this gun-red-shot) (arg0 process-drawable) (arg1 int)) (let* ((s5-0 arg0) (v1-0 (if (type? s5-0 process-drawable) s5-0 @@ -156,7 +156,7 @@ ) ) (when v1-0 - (let* ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> v1-0 root trans) (-> obj start-pos))) + (let* ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> v1-0 root trans) (-> this start-pos))) (f30-0 (* (if (< (vector-length s5-2) 24576.0) 3.0 2.0 @@ -170,15 +170,15 @@ ) (let ((s2-0 (new 'stack-no-clear 'vector))) (rot-zxy-from-vector! s2-0 s5-2) - (let ((f28-0 (deg- (-> s2-0 x) (-> obj start-rot x))) - (f0-6 (deg- (-> s2-0 y) (-> obj start-rot y))) + (let ((f28-0 (deg- (-> s2-0 x) (-> this start-rot x))) + (f0-6 (deg- (-> s2-0 y) (-> this start-rot y))) ) (when (or (< 2730.6667 (fabs f28-0)) (< 8192.0 (fabs f0-6))) (let ((f1-5 (fmax -2730.6667 (fmin 2730.6667 f28-0))) (f0-8 (fmax -8192.0 (fmin 8192.0 f0-6))) ) - (set! (-> s2-0 x) (+ (-> obj start-rot x) f1-5)) - (set! (-> s2-0 y) (+ (-> obj start-rot y) f0-8)) + (set! (-> s2-0 x) (+ (-> this start-rot x) f1-5)) + (set! (-> s2-0 y) (+ (-> this start-rot y) f0-8)) ) (set-vector! s5-2 0.0 0.0 1.0 1.0) (vector-rotate-around-x! s5-2 s5-2 (-> s2-0 x)) @@ -190,7 +190,7 @@ arg0 'attack arg1 - (static-attack-info ((id (-> obj attack-id)) (mode 'eco-red) (attacker-velocity s5-2) (damage f30-0))) + (static-attack-info ((id (-> this attack-id)) (mode 'eco-red) (attacker-velocity s5-2) (damage f30-0))) ) ) ) @@ -199,7 +199,7 @@ ;; definition for method 25 of type gun-red-shot ;; WARN: Return type mismatch int vs none. -(defmethod noop gun-red-shot ((obj gun-red-shot)) +(defmethod noop gun-red-shot ((this gun-red-shot)) "Does nothing" 0 (none) @@ -208,9 +208,9 @@ ;; definition for method 23 of type gun-red-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-probes! gun-red-shot ((obj gun-red-shot) (arg0 collide-shape)) +(defmethod init-probes! gun-red-shot ((this gun-red-shot) (arg0 collide-shape)) "Create all 19 probe vectors" - (let ((s5-0 (-> obj probe-count))) + (let ((s5-0 (-> this probe-count))) (when (< s5-0 19) (let* ((s4-0 (-> arg0 process)) (a0-2 (if (type? s4-0 process-focusable) @@ -223,19 +223,19 @@ (set! (-> s4-1 quad) (-> (get-trans a0-2 3) quad)) (set! (-> s4-1 quad) (-> arg0 root-prim prim-core world-sphere quad)) ) - (vector-! s4-1 s4-1 (-> obj start-pos)) + (vector-! s4-1 s4-1 (-> this start-pos)) (vector-normalize! s4-1 1.0) (let ((s3-2 (new 'stack-no-clear 'vector))) (rot-zxy-from-vector! s3-2 s4-1) - (let ((f30-0 (deg- (-> s3-2 x) (-> obj start-rot x))) - (f0-4 (deg- (-> s3-2 y) (-> obj start-rot y))) + (let ((f30-0 (deg- (-> s3-2 x) (-> this start-rot x))) + (f0-4 (deg- (-> s3-2 y) (-> this start-rot y))) ) (when (or (< 2730.6667 (fabs f30-0)) (< 8192.0 (fabs f0-4))) (let ((f1-3 (fmax -2730.6667 (fmin 2730.6667 f30-0))) (f0-6 (fmax -8192.0 (fmin 8192.0 f0-4))) ) - (set! (-> s3-2 x) (+ (-> obj start-rot x) f1-3)) - (set! (-> s3-2 y) (+ (-> obj start-rot y) f0-6)) + (set! (-> s3-2 x) (+ (-> this start-rot x) f1-3)) + (set! (-> s3-2 y) (+ (-> this start-rot y) f0-6)) ) (set-vector! s4-1 0.0 0.0 1.0 1.0) (vector-rotate-around-x! s4-1 s4-1 (-> s3-2 x)) @@ -243,9 +243,9 @@ ) ) ) - (set! (-> obj probe-dir s5-0 quad) (-> s4-1 quad)) + (set! (-> this probe-dir s5-0 quad) (-> s4-1 quad)) ) - (set! (-> obj probe-count) (+ s5-0 1)) + (set! (-> this probe-count) (+ s5-0 1)) ) ) (none) @@ -254,18 +254,18 @@ ;; definition for method 26 of type gun-red-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod gun-red-shot-method-26 gun-red-shot ((obj gun-red-shot)) +(defmethod gun-red-shot-method-26 gun-red-shot ((this gun-red-shot)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj start-dir quad)) + (set! (-> s5-0 quad) (-> this start-dir quad)) (vector-float*! s5-0 s5-0 43417.6) - (vector+! s5-0 s5-0 (-> obj start-pos)) + (vector+! s5-0 s5-0 (-> this start-pos)) (set! (-> s5-0 w) 43827.2) - (let ((s4-0 (-> obj root root-prim prim-core collide-with))) + (let ((s4-0 (-> this root root-prim prim-core collide-with))) (set! *actor-list-length* 0) (if (logtest? s4-0 (collide-spec hit-by-others-list)) (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* (the-as sphere s5-0) *actor-list* 256)) @@ -355,13 +355,13 @@ (dotimes (s5-1 *actor-list-length*) (let ((a1-28 (-> *actor-list* s5-1))) (if (logtest? s4-0 (-> a1-28 root-prim prim-core collide-as)) - (init-probes! obj a1-28) + (init-probes! this a1-28) ) ) ) ) ) - (set! (-> obj actor-count) (-> obj probe-count)) + (set! (-> this actor-count) (-> this probe-count)) 0 (none) ) @@ -369,21 +369,21 @@ ;; definition for method 27 of type gun-red-shot ;; WARN: Return type mismatch int vs none. -(defmethod gun-red-shot-method-27 gun-red-shot ((obj gun-red-shot)) - (gun-red-shot-method-26 obj) - (let ((s5-0 (-> obj probe-count))) +(defmethod gun-red-shot-method-27 gun-red-shot ((this gun-red-shot)) + (gun-red-shot-method-26 this) + (let ((s5-0 (-> this probe-count))) (while (< s5-0 19) (let ((f28-0 (rand-vu-float-range -2730.6667 2730.6667)) (f30-0 (rand-vu-float-range -8192.0 8192.0)) - (s4-0 (-> obj probe-dir s5-0)) + (s4-0 (-> this probe-dir s5-0)) ) (set-vector! s4-0 0.0 0.0 1.0 1.0) - (vector-rotate-around-x! s4-0 s4-0 (+ (-> obj start-rot x) f28-0)) - (vector-rotate-around-y! s4-0 s4-0 (+ (-> obj start-rot y) f30-0)) + (vector-rotate-around-x! s4-0 s4-0 (+ (-> this start-rot x) f28-0)) + (vector-rotate-around-y! s4-0 s4-0 (+ (-> this start-rot y) f30-0)) ) (+! s5-0 1) ) - (set! (-> obj probe-count) s5-0) + (set! (-> this probe-count) s5-0) ) 0 (none) @@ -391,7 +391,7 @@ ;; definition for method 28 of type gun-red-shot ;; INFO: Used lq/sq -(defmethod gun-red-shot-method-28 gun-red-shot ((obj gun-red-shot) (arg0 vector)) +(defmethod gun-red-shot-method-28 gun-red-shot ((this gun-red-shot) (arg0 vector)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -399,15 +399,15 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((gp-0 (-> obj root))) + (let ((gp-0 (-> this root))) (let ((v1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> gp-0 trans quad) (-> obj start-pos quad)) + (set! (-> gp-0 trans quad) (-> this start-pos quad)) (vector-float*! (-> gp-0 transv) arg0 61440.0) (let ((a1-1 v1-0)) (set! (-> a1-1 radius) (-> gp-0 root-prim local-sphere w)) (set! (-> a1-1 collide-with) (-> gp-0 root-prim prim-core collide-with)) - (set! (-> a1-1 ignore-process0) obj) - (set! (-> a1-1 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-1 ignore-process0) this) + (set! (-> a1-1 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a1-1 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-1 action-mask) (collide-action solid)) ) @@ -435,15 +435,15 @@ ) ;; definition for method 24 of type gun-red-shot -(defmethod gun-red-shot-method-24 gun-red-shot ((obj gun-red-shot)) - (let ((v1-0 (-> obj root)) +(defmethod gun-red-shot-method-24 gun-red-shot ((this gun-red-shot)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a1-0 t1-0)) (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a1-0 ignore-process0) obj) - (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-0 action-mask) (collide-action solid)) ) @@ -457,8 +457,8 @@ (defstate debug-idle (gun-red-shot) :virtual #t :code (behavior () - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 3)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 3)) (let ((gp-0 (new 'stack-no-clear 'vector))) (dotimes (s5-0 (-> self probe-count)) (vector-float*! gp-0 (-> self probe-dir s5-0) 61440.0) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc index f7aee0cff7..3645f1fa35 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-states_REF.gc @@ -43,7 +43,7 @@ (logior! (-> self state-flags) (state-flags lleg-still rleg-still)) (set! (-> self control mod-surface) *gun-walk-mods*) (set! (-> self control unknown-word04) (the-as uint #f)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (set! (-> self control bend-target) 0.0) @@ -117,7 +117,7 @@ (defstate target-gun-walk (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *gun-walk-mods*) (case (-> self gun gun-type) (((pickup-type eco-yellow) (pickup-type eco-blue)) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc index b8484b6195..59dafba96a 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-util_REF.gc @@ -11,38 +11,38 @@ ) ;; definition for method 3 of type gun-eject -(defmethod inspect gun-eject ((obj gun-eject)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-eject ((this gun-eject)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile-bounce inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 31 of type gun-eject ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-eject ((obj gun-eject)) +(defmethod init-proj-settings! gun-eject ((this gun-eject)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gun" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) - (let ((v1-5 (-> obj skel root-channel 0))) - (set! (-> v1-5 frame-group) (-> (the-as gun (-> obj parent 0)) skel channel 0 frame-group)) + (let ((v1-5 (-> this skel root-channel 0))) + (set! (-> v1-5 frame-group) (-> (the-as gun (-> this parent 0)) skel channel 0 frame-group)) ) (let ((t9-3 (method-of-type projectile-bounce init-proj-settings!))) - (t9-3 obj) + (t9-3 this) ) - (quaternion-copy! (-> obj root quat) (-> (the-as gun (-> obj parent 0)) root quat)) - (set! (-> obj timeout) (seconds 4)) - (set! (-> (the-as collide-shape (-> obj root)) root-prim local-sphere w) 3276.8) - (logclear! (-> obj mask) (process-mask projectile)) + (quaternion-copy! (-> this root quat) (-> (the-as gun (-> this parent 0)) root quat)) + (set! (-> this timeout) (seconds 4)) + (set! (-> (the-as collide-shape (-> this root)) root-prim local-sphere w) 3276.8) + (logclear! (-> this mask) (process-mask projectile)) 0 (none) ) @@ -57,31 +57,31 @@ ) ;; definition for method 3 of type gun-mag-yellow -(defmethod inspect gun-mag-yellow ((obj gun-mag-yellow)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-mag-yellow ((this gun-mag-yellow)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile-bounce inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 31 of type gun-mag-yellow ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-mag-yellow ((obj gun-mag-yellow)) +(defmethod init-proj-settings! gun-mag-yellow ((this gun-mag-yellow)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj timeout) (seconds 4)) + (set! (-> this timeout) (seconds 4)) (sound-play "dark-shot-fire") 0 (none) @@ -97,31 +97,31 @@ ) ;; definition for method 3 of type gun-mag-red -(defmethod inspect gun-mag-red ((obj gun-mag-red)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-mag-red ((this gun-mag-red)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile-bounce inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 31 of type gun-mag-red ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-mag-red ((obj gun-mag-red)) +(defmethod init-proj-settings! gun-mag-red ((this gun-mag-red)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj timeout) (seconds 4)) + (set! (-> this timeout) (seconds 4)) (sound-play "dark-shot-fire") 0 (none) @@ -137,31 +137,31 @@ ) ;; definition for method 3 of type gun-mag-blue -(defmethod inspect gun-mag-blue ((obj gun-mag-blue)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-mag-blue ((this gun-mag-blue)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile-bounce inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 31 of type gun-mag-blue ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-mag-blue ((obj gun-mag-blue)) +(defmethod init-proj-settings! gun-mag-blue ((this gun-mag-blue)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj timeout) (seconds 4)) + (set! (-> this timeout) (seconds 4)) (sound-play "dark-shot-fire") 0 (none) @@ -177,31 +177,31 @@ ) ;; definition for method 3 of type gun-mag-dark -(defmethod inspect gun-mag-dark ((obj gun-mag-dark)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-mag-dark ((this gun-mag-dark)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile-bounce inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 31 of type gun-mag-dark ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-mag-dark ((obj gun-mag-dark)) +(defmethod init-proj-settings! gun-mag-dark ((this gun-mag-dark)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj timeout) (seconds 4)) + (set! (-> this timeout) (seconds 4)) (sound-play "dark-shot-fire") 0 (none) @@ -217,15 +217,15 @@ ) ;; definition for method 3 of type beam-info -(defmethod inspect beam-info ((obj beam-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect beam-info ((this beam-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'beam-info) - (format #t "~1Ty-scale: ~f~%" (-> obj y-scale)) + (format #t "[~8x] ~A~%" this 'beam-info) + (format #t "~1Ty-scale: ~f~%" (-> this y-scale)) (label cfg-4) - obj + this ) ;; definition for symbol *beam-info*, type beam-info @@ -354,16 +354,16 @@ ;; definition for method 7 of type gun ;; WARN: Return type mismatch process-drawable vs gun. -(defmethod relocate gun ((obj gun) (arg0 int)) - (if (nonzero? (-> obj barrel)) - (&+! (-> obj barrel) arg0) +(defmethod relocate gun ((this gun) (arg0 int)) + (if (nonzero? (-> this barrel)) + (&+! (-> this barrel) arg0) ) (dotimes (v1-4 4) - (if (nonzero? (-> obj mag v1-4)) - (&+! (-> obj mag v1-4) arg0) + (if (nonzero? (-> this mag v1-4)) + (&+! (-> this mag v1-4) arg0) ) ) - (the-as gun ((method-of-type process-drawable relocate) obj arg0)) + (the-as gun ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for function gun-post @@ -576,7 +576,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self draw shadow) (-> self shadow-backup)) (logior! (-> self skel status) (joint-control-status sync-math)) ) @@ -986,23 +986,23 @@ ;; definition for method 9 of type gun-info ;; INFO: Used lq/sq -(defmethod gun-info-method-9 gun-info ((obj gun-info)) - (when (and (-> obj laser-active?) - (-> obj active?) - (not (logtest? (-> obj gun 0 draw status) (draw-control-status no-draw))) +(defmethod gun-info-method-9 gun-info ((this gun-info)) + (when (and (-> this laser-active?) + (-> this active?) + (not (logtest? (-> this gun 0 draw status) (draw-control-status no-draw))) #t ) - (let ((s5-0 (-> obj laser-point)) + (let ((s5-0 (-> this laser-point)) (s4-0 (new 'stack-no-clear 'collide-query)) - (s3-0 (-> obj laser-dir)) - (f30-0 (rotate-y<-vector+vector (the-as vector (-> obj laser-dir)) (-> obj laser-dir 1))) + (s3-0 (-> this laser-dir)) + (f30-0 (rotate-y<-vector+vector (the-as vector (-> this laser-dir)) (-> this laser-dir 1))) ) (vector+float*! (-> s4-0 start-pos) s5-0 (the-as vector s3-0) -8192.0) (vector-float*! (-> s4-0 move-dist) (the-as vector s3-0) 163840.0) (let ((v1-13 s4-0)) - (set! (-> v1-13 radius) (-> obj track-beam-size)) - (set! (-> v1-13 collide-with) (-> obj process 0 control root-prim prim-core collide-with)) - (set! (-> v1-13 ignore-process0) (ppointer->process (-> obj process))) + (set! (-> v1-13 radius) (-> this track-beam-size)) + (set! (-> v1-13 collide-with) (-> this process 0 control root-prim prim-core collide-with)) + (set! (-> v1-13 ignore-process0) (ppointer->process (-> this process))) (set! (-> v1-13 ignore-process1) #f) (set! (-> v1-13 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) @@ -1013,7 +1013,7 @@ (cond ((>= f0-3 0.0) (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) (-> s4-0 move-dist) f0-3) - (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) (the-as vector s3-0) (-> obj track-beam-size)) + (vector+float*! (-> s4-0 start-pos) (-> s4-0 start-pos) (the-as vector s3-0) (-> this track-beam-size)) (let* ((s2-0 (-> s4-0 best-other-tri collide-ptr)) (s0-0 (if (type? s2-0 collide-shape-prim) (the-as collide-shape-prim s2-0) @@ -1026,9 +1026,9 @@ (cond ((and s0-0 (or (logtest? (process-mask enemy guard) (-> s0-0 cshape process mask)) - (= (handle->process (-> obj track-target 0 handle)) (-> s0-0 cshape process)) + (= (handle->process (-> this track-target 0 handle)) (-> s0-0 cshape process)) ) - (>= (-> obj fire-range) (vector-vector-distance s2-1 s5-0)) + (>= (-> this fire-range) (vector-vector-distance s2-1 s5-0)) ) (vector+! s2-1 s2-1 s1-0) (launch-particles (-> *part-id-table* 185) s2-1) @@ -1046,7 +1046,7 @@ ) ) ) - (set! (-> obj laser-hit-point quad) (-> s4-0 start-pos quad)) + (set! (-> this laser-hit-point quad) (-> s4-0 start-pos quad)) (let ((s1-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (camera-pos) s5-0) 1.0)) (t9-10 vector-normalize!) (a0-41 (new 'stack-no-clear 'vector)) @@ -1105,5 +1105,5 @@ ) ) ) - (-> obj laser-dir) + (-> this laser-dir) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc index f6a58d3e62..83a321b392 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-yellow-shot_REF.gc @@ -62,26 +62,26 @@ ) ;; definition for method 3 of type gun-yellow-shot -(defmethod inspect gun-yellow-shot ((obj gun-yellow-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-yellow-shot ((this gun-yellow-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thit-actor?: ~A~%" (-> obj hit-actor?)) - (format #t "~2Ttail-pos: #~%" (-> obj tail-pos)) - (format #t "~2Thit-pos: #~%" (-> obj hit-pos)) + (format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (format #t "~2Thit-pos: #~%" (-> this hit-pos)) (label cfg-4) - obj + this ) ;; definition for method 24 of type gun-yellow-shot ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod draw-laser-sight gun-yellow-shot ((this gun-yellow-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 227) (-> obj tail-pos) (-> obj starting-dir) #f #t) + (draw-beam (-> *part-id-table* 227) (-> this tail-pos) (-> this starting-dir) #f #t) 0 (none) ) @@ -89,7 +89,7 @@ ;; definition for method 25 of type gun-yellow-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod spawn-impact-particles gun-yellow-shot ((this gun-yellow-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -99,8 +99,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((s4-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((s4-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) s4-0 a1-0)) (f30-0 (vector-length s5-1)) (gp-0 (new 'stack-no-clear 'vector)) @@ -156,11 +156,11 @@ ) ;; definition for method 37 of type gun-yellow-shot -(defmethod deal-damage! gun-yellow-shot ((obj gun-yellow-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! gun-yellow-shot ((this gun-yellow-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) - (when (t9-0 obj arg0 arg1) - (set! (-> obj hit-actor?) #t) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) #t ) ) @@ -169,10 +169,10 @@ ;; definition for method 26 of type gun-yellow-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod spawn-shell-particles gun-yellow-shot ((this gun-yellow-shot)) "TODO - confirm" (cond - ((-> obj hit-actor?) + ((-> this hit-actor?) (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) (when s5-0 (let ((t9-1 (method-of-type part-tracker activate))) @@ -193,7 +193,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -230,7 +230,7 @@ (t2-1 #f) (t3-1 *launch-matrix*) ) - (set! (-> t3-1 trans quad) (-> obj root trans quad)) + (set! (-> t3-1 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-5) a0-6 a1-5 @@ -253,7 +253,7 @@ ;; definition for method 28 of type gun-yellow-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound gun-yellow-shot ((obj gun-yellow-shot) (arg0 projectile-options)) +(defmethod play-impact-sound gun-yellow-shot ((this gun-yellow-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -266,7 +266,7 @@ (sound-play "yellow-shot-fiz") ) (else - (sound-play "yellow-shot-std" :id (-> obj sound-id) :position (-> obj root trans)) + (sound-play "yellow-shot-std" :id (-> this sound-id) :position (-> this root trans)) ) ) ) @@ -274,22 +274,22 @@ ) ;; definition for method 38 of type gun-yellow-shot -(defmethod made-impact? gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod made-impact? gun-yellow-shot ((this gun-yellow-shot)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a0-1 t1-0)) (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a0-1 ignore-process0) obj) - (set! (-> a0-1 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) (set! (-> a0-1 action-mask) (collide-action solid)) ) (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -10240.0 12697.6 -4096.0 t1-0) - (if (logtest? (-> obj root status) (collide-status touch-actor)) - (set! (-> obj hit-actor?) #t) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) ) #t ) @@ -331,9 +331,9 @@ ;; definition for method 30 of type gun-yellow-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod init-proj-collision! gun-yellow-shot ((this gun-yellow-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -374,9 +374,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 @@ -386,20 +386,20 @@ ;; definition for method 31 of type gun-yellow-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! gun-yellow-shot ((obj gun-yellow-shot)) +(defmethod init-proj-settings! gun-yellow-shot ((this gun-yellow-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj hit-actor?) #f) - (set! (-> obj tail-pos quad) (-> obj root trans quad)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj max-speed) 819200.0) - (set! (-> obj move) gun-yellow-shot-move) - (set! (-> obj timeout) (seconds 0.5)) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj damage) (if (logtest? (game-feature gun-upgrade-damage) (-> *game-info* features)) - 4.0 - 2.0 - ) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) gun-yellow-shot-move) + (set! (-> this timeout) (seconds 0.5)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this damage) (if (logtest? (game-feature gun-upgrade-damage) (-> *game-info* features)) + 4.0 + 2.0 + ) ) 0 (none) 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 0594f530c0..60b291427c 100644 --- a/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/logic-target_REF.gc @@ -6,7 +6,7 @@ (defbehavior build-conversions target ((arg0 vector)) (when (!= (-> self control prev-surf) (-> self control surf)) (set! (-> self control prev-surf) (-> self control surf)) - (set! (-> self control time-of-last-surface-change) (current-time)) + (set-time! (-> self control time-of-last-surface-change)) ) (surface-mult! (-> self control current-surface) (-> self control mod-surface) (-> self control surf)) (when (and (and (= (-> (the-as fact-info-target (-> self fact)) eco-type) 3) @@ -626,14 +626,14 @@ (set! (-> self control idx-of-fastest-xz-vel) a0-3) (set! (-> self control average-xz-vel) f1-1) (if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around)) - (set! (-> v1-7 0) (current-time)) + (set-time! (-> v1-7 0)) ) - (and (>= (the-as uint (- (current-time) (-> v1-7 0))) (the-as uint 300)) + (and (time-elapsed? (-> v1-7 0) (seconds 1)) (< f0-1 0.0) (< 32768.0 f1-1) (< 0.7 (-> self control pad-magnitude)) - (>= (- (current-time) (-> self control last-time-touching-actor)) (seconds 0.3)) - (>= (- (current-time) (-> self control time-of-last-lc)) (seconds 0.3)) + (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.3)) + (time-elapsed? (-> self control time-of-last-lc) (seconds 0.3)) (logtest? (-> self control status) (collide-status on-surface)) (and (< 0.7 (-> self control surface-angle)) #t) ) @@ -657,11 +657,11 @@ ) ) ) - (if (>= (- (current-time) (-> self control time-of-last-wall-hide-first-check-pass)) (seconds 0.1)) - (set! (-> self control time-of-first-wall-hide-first-check-pass) (current-time)) + (if (time-elapsed? (-> self control time-of-last-wall-hide-first-check-pass) (seconds 0.1)) + (set-time! (-> self control time-of-first-wall-hide-first-check-pass)) ) - (set! (-> self control time-of-last-wall-hide-first-check-pass) (current-time)) - (when (>= (- (current-time) (-> self control time-of-first-wall-hide-first-check-pass)) (seconds 0.5)) + (set-time! (-> self control time-of-last-wall-hide-first-check-pass)) + (when (time-elapsed? (-> self control time-of-first-wall-hide-first-check-pass) (seconds 0.5)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((v1-34 (-> gp-0 bbox)) (a0-13 (-> self control trans)) @@ -720,7 +720,7 @@ ;; WARN: Return type mismatch int vs none. (defbehavior target-log-trans target () (let ((v1-1 (-> self control trans-log-idx))) - (set! (-> self control trans-log-times v1-1) (current-time)) + (set-time! (-> self control trans-log-times v1-1)) (set! (-> self control trans-log-trans v1-1 quad) (-> self control trans quad)) (set! (-> self control trans-log-idx) (logand (+ v1-1 1) 127)) ) @@ -739,7 +739,7 @@ (let* ((v1-0 127) (a1-2 (logand (+ (-> s4-0 trans-log-idx) v1-0) 127)) ) - (while (and (< (- (current-time) (-> s4-0 trans-log-times a1-2)) arg0) (> v1-0 0)) + (while (and (not (time-elapsed? (-> s4-0 trans-log-times a1-2) arg0)) (> v1-0 0)) (vector+! s5-0 s5-0 (-> s4-0 trans-log-trans a1-2)) (+! gp-0 1) (+! v1-0 -1) @@ -988,9 +988,9 @@ ) ) ) - (set! (-> self control time-of-last-clear-wall-in-jump) (current-time)) + (set-time! (-> self control time-of-last-clear-wall-in-jump)) ) - (if (< (- (current-time) (-> self control time-of-last-clear-wall-in-jump)) (seconds 0.2)) + (if (not (time-elapsed? (-> self control time-of-last-clear-wall-in-jump) (seconds 0.2))) (set! f30-0 (+ 204800.0 f30-0)) ) (if (and (not (logtest? (-> self control status) (collide-status touch-wall))) @@ -1139,14 +1139,14 @@ (collide-status on-surface touch-surface) ) ) - (< (- (current-time) (-> self control last-time-touching-actor)) (seconds 0.5)) + (not (time-elapsed? (-> self control last-time-touching-actor) (seconds 0.5))) (not (and (-> self next-state) (let ((v1-15 (-> self next-state name))) (or (= v1-15 'target-walk) (= v1-15 'target-gun-walk)) ) ) ) - (< (- (current-time) (-> self state-time)) (seconds 0.5)) - (< (- (current-time) (-> self control time-of-last-lc)) (seconds 0.5)) + (not (time-elapsed? (-> self state-time) (seconds 0.5))) + (not (time-elapsed? (-> self control time-of-last-lc) (seconds 0.5))) (logtest? (-> self control current-surface flags) (surface-flag turn-to-pad)) (!= (-> self control force-turn-to-strength) 0.0) ) @@ -1581,11 +1581,11 @@ (if (zero? (-> self control time-between-zero-inputs)) (set! (-> self control time-between-zero-inputs) (- (current-time) (-> self control time-of-last-zero-input))) ) - (set! (-> self control time-of-last-zero-input) (current-time)) + (set-time! (-> self control time-of-last-zero-input)) (quaternion-copy! (-> self control last-nonzero-input-dir-targ) (-> self control dir-targ)) ) (else - (set! (-> self control time-of-last-nonzero-input) (current-time)) + (set-time! (-> self control time-of-last-nonzero-input)) (set! (-> self control time-between-zero-inputs) 0) 0 ) @@ -1596,7 +1596,7 @@ ((-> self control current-surface active-hook)) (cond ((logtest? (-> self control status) (collide-status on-surface)) - (set! (-> self control last-time-on-surface) (current-time)) + (set-time! (-> self control last-time-on-surface)) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) (if (and (>= (-> self control coverage) 1.0) (not (logtest? (-> self control status) (collide-status touch-actor on-water))) @@ -1634,7 +1634,7 @@ (logtest? (-> self control mod-surface flags) (surface-flag look-around)) (not (focus-test? self edge-grab pole flut tube board pilot dark)) (-> *setting-control* user-current allow-look-around) - (>= (- (current-time) (the-as int (-> self no-look-around-wait))) (seconds 0.05)) + (time-elapsed? (the-as int (-> self no-look-around-wait)) (seconds 0.05)) (not (and (= (-> self control ground-pat material) (pat-material ice)) (< 4096.0 (-> self control ctrl-xz-vel))) ) ) @@ -1690,7 +1690,7 @@ ) ) (send-event *camera* 'reset-follow) - (set! (-> self control time-of-last-debug-float) (current-time)) + (set-time! (-> self control time-of-last-debug-float)) (cond ((focus-test? self mech indax) (if (not (and (-> self next-state) (let ((v1-179 (-> self next-state name))) @@ -1774,7 +1774,7 @@ ) ) (let ((v1-229 (-> self current-level))) - (if (and (or (>= (- (current-time) (-> self control last-time-on-surface)) (seconds 2)) (focus-test? self pilot)) + (if (and (or (time-elapsed? (-> self control last-time-on-surface) (seconds 2)) (focus-test? self pilot)) (and v1-229 (< (-> self control trans y) (-> v1-229 info buttom-height)) (not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2))) @@ -1810,19 +1810,19 @@ ;; WARN: Return type mismatch int vs none. (defbehavior post-flag-setup target () (if (logtest? (-> self control status) (collide-status touch-wall touch-actor)) - (set! (-> self control last-time-touching-actor) (current-time)) + (set-time! (-> self control last-time-touching-actor)) ) (when (logtest? (-> self state-flags) (state-flags tinvul1)) (if (< (logand (- (current-time) (-> self control invul1-on-time)) 3) 1) (logior! (-> self draw status) (draw-control-status no-draw-bounds)) (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) ) - (if (>= (- (current-time) (-> self control invul1-on-time)) (-> self control invul1-off-time)) + (if (time-elapsed? (-> self control invul1-on-time) (-> self control invul1-off-time)) (target-timed-invulnerable-off self 1) ) ) (when (logtest? (state-flags tinvul2) (-> self state-flags)) - (if (>= (- (current-time) (-> self control invul2-on-time)) (-> self control invul2-off-time)) + (if (time-elapsed? (-> self control invul2-on-time) (-> self control invul2-off-time)) (target-timed-invulnerable-off self 2) ) ) @@ -2050,7 +2050,7 @@ (set! (-> self control hand-to-edge-dist) (vector-length s4-1)) (cond ((and (< 819.2 (-> self control hand-to-edge-dist)) - (>= (- (current-time) (-> self control last-successful-compute-edge-time)) (seconds 0.2)) + (time-elapsed? (-> self control last-successful-compute-edge-time) (seconds 0.2)) ) (cond ((-> s5-0 pilot-edge-grab?) @@ -2096,7 +2096,7 @@ ) ) (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) - (set! (-> self control rider-time) (current-time)) + (set-time! (-> self control rider-time)) (vector+! s3-1 s3-1 (-> self control cspace-offset)) (move-to-point! (-> self control) s3-1) ) @@ -2109,9 +2109,9 @@ (move-by-vector! (-> self control) a1-20) ) (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) - (set! (-> self control rider-time) (current-time)) - (if (and (>= (- (current-time) (-> self control edge-grab-start-time)) (seconds 0.5)) - (>= (- (current-time) (-> self control last-successful-compute-edge-time)) (seconds 0.5)) + (set-time! (-> self control rider-time)) + (if (and (time-elapsed? (-> self control edge-grab-start-time) (seconds 0.5)) + (time-elapsed? (-> self control last-successful-compute-edge-time) (seconds 0.5)) ) (send-event self 'end-mode) ) @@ -2122,13 +2122,13 @@ (let ((a1-23 (new 'stack-no-clear 'vector))) (vector-! a1-23 (-> s5-0 center-hold) (-> self control ctrl-to-hands-offset)) (vector-float*! (-> self control rider-last-move) s4-1 (-> self clock frames-per-second)) - (set! (-> self control rider-time) (current-time)) + (set-time! (-> self control rider-time)) (vector+! a1-23 a1-23 (-> self control cspace-offset)) (move-to-point! (-> self control) a1-23) ) (set! (-> self control hand-to-edge-dist) 0.0) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) - (set! (-> self control last-successful-compute-edge-time) (current-time)) + (set-time! (-> self control last-successful-compute-edge-time)) ) ) ) @@ -2201,7 +2201,7 @@ ) (let ((a1-15 (vector-! (new-stack-vector0) (-> gp-0 center-hold) (-> gp-0 center-hold-old)))) (vector-float*! (-> self control rider-last-move) a1-15 (-> self clock frames-per-second)) - (set! (-> self control rider-time) (current-time)) + (set-time! (-> self control rider-time)) (move-by-vector! (-> self control) a1-15) ) ) @@ -2241,7 +2241,7 @@ (send-event *camera* 'ease-in 0.5 v1-10) ) (vector-segment-distance-point! (-> self control midpoint-of-hands) s4-1 s3-1 s5-0) - (if (< (- (current-time) (-> self state-time)) (seconds 0.05)) + (if (not (time-elapsed? (-> self state-time) (seconds 0.05))) (set! (-> self control hand-to-edge-dist) (fmax 0.0 (fmin 1.0 (/ (vector-vector-distance s4-1 s5-0) (* 2.0 (-> (the-as swingpole s2-0) edge-length))))) ) @@ -3087,7 +3087,7 @@ (set! (-> self control bent-gravity-normal quad) (-> self control standard-dynamics gravity-normal quad)) (quaternion-identity! (-> self control override-quat)) (set! (-> self control override-quat-alpha) 0.0) - (set! (-> self control last-time-on-surface) (current-time)) + (set-time! (-> self control last-time-on-surface)) (set! (-> self control bend-amount) 0.0) (set! (-> self control bend-speed) 32.0) (set! (-> self cam-user-mode) 'normal) @@ -3101,12 +3101,12 @@ ;; definition for method 28 of type target ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-target target ((obj target) (arg0 continue-point) (arg1 symbol)) +(defmethod init-target target ((this target) (arg0 continue-point) (arg1 symbol)) (local-vars (s1-0 int) (s2-0 int) (s3-0 int) (s4-0 int) (sv-16 collide-shape-prim-group)) - (set! (-> obj tobot?) arg1) - (set! (-> obj tobot-recorder) #f) - (set! (-> obj mode-cache) #f) - (set! (-> obj color-effect) #f) + (set! (-> this tobot?) arg1) + (set! (-> this tobot-recorder) #f) + (set! (-> this mode-cache) #f) + (set! (-> this color-effect) #f) (set-setting! 'allow-pause #f 0.0 0) (set-setting! 'allow-progress #f 0.0 0) (set! (-> *setting-control* cam-default mode-name) 'cam-string) @@ -3115,11 +3115,11 @@ (set! arg0 (get-current-continue-forced *game-info*)) ) (set-continue! *game-info* arg0 #f) - (stack-size-set! (-> obj main-thread) 1024) - (logior! (-> obj mask) (process-mask target)) - (set! (-> obj state-hook) (the-as (function none :behavior target) nothing)) + (stack-size-set! (-> this main-thread) 1024) + (logior! (-> this mask) (process-mask target)) + (set! (-> this state-hook) (the-as (function none :behavior target) nothing)) (cond - ((= (-> obj tobot?) 'tobot) + ((= (-> this tobot?) 'tobot) (set! s4-0 #x40000) (set! s3-0 #x2183f7f) (set! s2-0 #x40000) @@ -3132,7 +3132,7 @@ (set! s1-0 #x21c377c) ) ) - (let ((s0-0 (new 'process 'control-info obj (collide-list-enum hit-by-others)))) + (let ((s0-0 (new 'process 'control-info this (collide-list-enum hit-by-others)))) (set! (-> s0-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s0-0 reaction) target-collision-reaction) (set! (-> s0-0 no-reaction) target-collision-no-reaction) @@ -3205,9 +3205,9 @@ (set! (-> s0-0 backup-collide-with) (-> v1-66 prim-core collide-with)) ) (set! (-> s0-0 event-priority) (the-as uint 9)) - (set! (-> obj control) s0-0) + (set! (-> this control) s0-0) ) - (let ((v1-69 (-> obj control))) + (let ((v1-69 (-> this control))) (set! (-> v1-69 default-collide-as-all) (the-as collide-spec s4-0)) (set! (-> v1-69 default-collide-with-all) (the-as collide-spec s3-0)) (set! (-> v1-69 default-collide-as-fgnd) (the-as collide-spec s2-0)) @@ -3215,115 +3215,124 @@ (set! (-> v1-69 max-iteration-count) (the-as uint 8)) (set! (-> v1-69 event-self) 'touched) ) - (set! (-> obj game) *game-info*) - (move-to-point! (-> obj control) (-> arg0 trans)) - (set! (-> obj control camera-pos quad) (-> arg0 trans quad)) - (set! (-> obj focus-search) (new 'process 'boxed-array collide-shape 128)) - (set! (-> obj focus-search length) 0) - (set! (-> obj control cpad) (-> *cpad-list* cpads 0)) - (set! (-> obj control current-surface) (new 'process 'surface)) - (set! (-> obj control current-surface name) 'current) - (set! (-> obj control current-surface active-hook) nothing) - (set! (-> obj control current-surface touch-hook) nothing) - (set! (-> obj control send-attack-dest) (the-as handle #f)) + (set! (-> this game) *game-info*) + (move-to-point! (-> this control) (-> arg0 trans)) + (set! (-> this control camera-pos quad) (-> arg0 trans quad)) + (set! (-> this focus-search) (new 'process 'boxed-array collide-shape 128)) + (set! (-> this focus-search length) 0) + (set! (-> this control cpad) (-> *cpad-list* cpads 0)) + (set! (-> this control current-surface) (new 'process 'surface)) + (set! (-> this control current-surface name) 'current) + (set! (-> this control current-surface active-hook) nothing) + (set! (-> this control current-surface touch-hook) nothing) + (set! (-> this control send-attack-dest) (the-as handle #f)) (dotimes (v1-84 8) - (set! (-> obj attack-info-old v1-84 attacker) (the-as handle #f)) + (set! (-> this attack-info-old v1-84 attacker) (the-as handle #f)) ) - (set! (-> obj notify) (the-as handle #f)) - (set! (-> obj mirror) (the-as (pointer process-drawable) #f)) + (set! (-> this notify) (the-as handle #f)) + (set! (-> this mirror) (the-as (pointer process-drawable) #f)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-jchar" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj skel effect flags) (effect-control-flag ecf0 ecf1)) - (let ((v1-94 (-> obj node-list data))) + (logior! (-> this skel effect flags) (effect-control-flag ecf0 ecf1)) + (let ((v1-94 (-> this node-list data))) (set! (-> v1-94 0 param0) (the-as (function cspace transformq none) cspace<-transformq+trans!)) - (set! (-> v1-94 0 param1) (the-as basic (-> obj control trans))) - (set! (-> v1-94 0 param2) (the-as basic (-> obj control cspace-offset))) + (set! (-> v1-94 0 param1) (the-as basic (-> this control trans))) + (set! (-> v1-94 0 param2) (the-as basic (-> this control cspace-offset))) ) - (set! (-> obj skel override) (new 'process 'boxed-array float 54)) - (set! (-> obj draw light-index) (the-as uint 30)) - (set! (-> obj beard?) #t) - (set! (-> obj draw lod-set max-lod) 0) - (logior! (-> obj skel status) (joint-control-status sync-math blend-shape eye-anim)) - (set! (-> obj draw shadow-ctrl) *target-shadow-control*) - (set! (-> obj shadow-backup) (-> obj draw shadow)) - (set! (-> obj carry) - (new 'process 'carry-info obj 41 (new 'static 'vector :w 1.0) (new 'static 'vector :z 1.0 :w 1.0) 12743.111) + (set! (-> this skel override) (new 'process 'boxed-array float 54)) + (set! (-> this draw light-index) (the-as uint 30)) + (set! (-> this beard?) #t) + (set! (-> this draw lod-set max-lod) 0) + (logior! (-> this skel status) (joint-control-status sync-math blend-shape eye-anim)) + (set! (-> this draw shadow-ctrl) *target-shadow-control*) + (set! (-> this shadow-backup) (-> this draw shadow)) + (set! (-> this carry) + (new 'process 'carry-info this 41 (new 'static 'vector :w 1.0) (new 'static 'vector :z 1.0 :w 1.0) 12743.111) ) - (set! (-> obj control lhand-cspace) (-> obj node-list data 45)) - (set! (-> obj control rhand-cspace) (-> obj node-list data 55)) - (set! (-> obj control rhand-cspace) (-> obj node-list data 55)) - (set! (-> obj control sidekick-root parent) (-> obj node-list data 23)) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-mode look-at) obj 8)) - (set! (-> obj neck parented-scale?) #t) - (set! (-> obj neck base-joint) (the-as uint 6)) - (set! (-> obj neck ignore-angle) 16384.0) - (set! (-> obj head) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 7)) - (set! (-> obj head parented-scale?) #t) - (set! (-> obj upper-body) (new 'process 'joint-mod (joint-mod-mode gun-look-at) obj 4)) - (set! (-> obj upper-body parented-scale?) #t) - (set! (-> obj horns) (new 'process 'joint-mod (joint-mod-mode joint-set) obj 42)) - (set! (-> obj horns parented-scale?) #t) - (set! (-> obj horns track-mode) (track-mode no-trans no-rotate)) - (set! (-> obj hair 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 9)) - (set! (-> obj hair 0 parented-scale?) #t) - (set! (-> obj hair 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 10)) - (set! (-> obj hair 1 parented-scale?) #t) - (set! (-> obj arm-ik 0) (new 'process 'joint-mod-ik obj 17 1228.8)) - (set! (-> obj arm-ik 1) (new 'process 'joint-mod-ik obj 21 -1228.8)) - (set! (-> obj arm-ik 1 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj arm-ik 1 elbow-rotation-axis) (the-as uint 0)) - (set! (-> obj leg-ik 0) (new 'process 'joint-mod-ik obj 28 1687.552)) - (set! (-> obj leg-ik 0 callback) (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback)) - (set! (-> obj leg-ik 0 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj leg-ik 0 elbow-rotation-axis) (the-as uint 0)) - (logior! (-> obj leg-ik 0 flags) (joint-mod-ik-flags elbow-trans-neg)) - (set! (-> obj leg-ik 1) (new 'process 'joint-mod-ik obj 35 -1687.552)) - (set! (-> obj leg-ik 1 callback) (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback)) - (set! (-> obj leg-ik 1 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj leg-ik 1 elbow-rotation-axis) (the-as uint 0)) - (set! (-> obj foot 0) (new 'process 'joint-mod (joint-mod-mode foot-rot) obj 29)) - (set! (-> obj foot 1) (new 'process 'joint-mod (joint-mod-mode foot-rot) obj 36)) - (set! (-> obj fact) - (new 'process 'fact-info-target obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this control lhand-cspace) (-> this node-list data 45)) + (set! (-> this control rhand-cspace) (-> this node-list data 55)) + (set! (-> this control rhand-cspace) (-> this node-list data 55)) + (set! (-> this control sidekick-root parent) (-> this node-list data 23)) + (set! (-> this neck) (new 'process 'joint-mod (joint-mod-mode look-at) this 8)) + (set! (-> this neck parented-scale?) #t) + (set! (-> this neck base-joint) (the-as uint 6)) + (set! (-> this neck ignore-angle) 16384.0) + (set! (-> this head) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 7)) + (set! (-> this head parented-scale?) #t) + (set! (-> this upper-body) (new 'process 'joint-mod (joint-mod-mode gun-look-at) this 4)) + (set! (-> this upper-body parented-scale?) #t) + (set! (-> this horns) (new 'process 'joint-mod (joint-mod-mode joint-set) this 42)) + (set! (-> this horns parented-scale?) #t) + (set! (-> this horns track-mode) (track-mode no-trans no-rotate)) + (set! (-> this hair 0) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 9)) + (set! (-> this hair 0 parented-scale?) #t) + (set! (-> this hair 1) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 10)) + (set! (-> this hair 1 parented-scale?) #t) + (set! (-> this arm-ik 0) (new 'process 'joint-mod-ik this 17 1228.8)) + (set! (-> this arm-ik 1) (new 'process 'joint-mod-ik this 21 -1228.8)) + (set! (-> this arm-ik 1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this arm-ik 1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this leg-ik 0) (new 'process 'joint-mod-ik this 28 1687.552)) + (set! (-> this leg-ik 0 callback) + (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback) ) - (target-gun-setup (logtest? (-> obj game features) (game-feature gun))) - (target-board-setup (logtest? (-> obj game features) (game-feature board))) - (target-sidekick-setup (logtest? (-> obj game features) (game-feature sidekick))) - (target-darkjak-setup (logtest? (-> obj game features) (game-feature darkjak))) + (set! (-> this leg-ik 0 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this leg-ik 0 elbow-rotation-axis) (the-as uint 0)) + (logior! (-> this leg-ik 0 flags) (joint-mod-ik-flags elbow-trans-neg)) + (set! (-> this leg-ik 1) (new 'process 'joint-mod-ik this 35 -1687.552)) + (set! (-> this leg-ik 1 callback) + (the-as (function joint-mod-ik matrix matrix vector object) leg-ik-callback) + ) + (set! (-> this leg-ik 1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this leg-ik 1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this foot 0) (new 'process 'joint-mod (joint-mod-mode foot-rot) this 29)) + (set! (-> this foot 1) (new 'process 'joint-mod (joint-mod-mode foot-rot) this 36)) + (set! (-> this fact) (new + 'process + 'fact-info-target + this + (pickup-type eco-pill-random) + (-> *FACT-bank* default-eco-pill-green-inc) + ) + ) + (target-gun-setup (logtest? (-> this game features) (game-feature gun))) + (target-board-setup (logtest? (-> this game features) (game-feature board))) + (target-sidekick-setup (logtest? (-> this game features) (game-feature sidekick))) + (target-darkjak-setup (logtest? (-> this game features) (game-feature darkjak))) (target-collide-set! 'normal 0.0) - (let ((v1-163 (-> obj control root-prim))) - (set! (-> obj control backup-collide-as) (-> v1-163 prim-core collide-as)) - (set! (-> obj control backup-collide-with) (-> v1-163 prim-core collide-with)) + (let ((v1-163 (-> this control root-prim))) + (set! (-> this control backup-collide-as) (-> v1-163 prim-core collide-as)) + (set! (-> this control backup-collide-with) (-> v1-163 prim-core collide-with)) ) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj control trans))) - (set! (-> obj control unknown-sound-id04) (new-sound-id)) - (set! (-> obj control bubbles-sound) (new-sound-id)) - (set! (-> obj control board-jump-and-swim-sound) (new-sound-id)) - (if (and *debug-segment* (!= (-> obj tobot?) 'tobot)) - (add-connection *debug-engine* obj target-print-stats obj *stdcon0* #f) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this control trans))) + (set! (-> this control unknown-sound-id04) (new-sound-id)) + (set! (-> this control bubbles-sound) (new-sound-id)) + (set! (-> this control board-jump-and-swim-sound) (new-sound-id)) + (if (and *debug-segment* (!= (-> this tobot?) 'tobot)) + (add-connection *debug-engine* this target-print-stats this *stdcon0* #f) ) - (if (!= (-> obj tobot?) 'tobot) - (activate-hud obj) + (if (!= (-> this tobot?) 'tobot) + (activate-hud this) ) - (set! (-> obj fp-hud) (the-as handle #f)) - (set! (-> obj burn-proc) (the-as handle #f)) - (set! (-> obj water) (new 'process 'water-control obj 10 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags swim-ground part-splash part-drip part-rings part-water find-water)) + (set! (-> this fp-hud) (the-as handle #f)) + (set! (-> this burn-proc) (the-as handle #f)) + (set! (-> this water) (new 'process 'water-control this 10 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags swim-ground part-splash part-drip part-rings part-water find-water)) (reset-target-state #t) - (set! (-> obj control last-trans-any-surf quad) (-> obj control trans quad)) - (+! (-> obj control last-trans-any-surf y) -819200.0) - (set! (-> obj align) (new 'process 'align-control obj)) - (set! (-> obj manipy) (the-as (pointer manipy) #f)) - (set! (-> obj event-hook) target-generic-event-handler) - (set! (-> obj current-level) #f) + (set! (-> this control last-trans-any-surf quad) (-> this control trans quad)) + (+! (-> this control last-trans-any-surf y) -819200.0) + (set! (-> this align) (new 'process 'align-control this)) + (set! (-> this manipy) (the-as (pointer manipy) #f)) + (set! (-> this event-hook) target-generic-event-handler) + (set! (-> this current-level) #f) (level-setup) - (set! (-> obj pre-joint-hook) (the-as (function none :behavior target) nothing)) - (set! (-> obj init-time) (current-time)) - (set! (-> obj spool-anim) (the-as spool-anim #t)) - (set! (-> obj ambient-time) (current-time)) + (set! (-> this pre-joint-hook) (the-as (function none :behavior target) nothing)) + (set-time! (-> this init-time)) + (set! (-> this spool-anim) (the-as spool-anim #t)) + (set-time! (-> this ambient-time)) 0 (none) ) @@ -3350,14 +3359,14 @@ ) ;; definition for method 10 of type target -(defmethod deactivate target ((obj target)) +(defmethod deactivate target ((this target)) (kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed) - (if (nonzero? (-> obj darkjak)) - (sound-stop (-> obj darkjak tone)) + (if (nonzero? (-> this darkjak)) + (sound-stop (-> this darkjak tone)) ) (set! (-> *setting-control* cam-default mode-name) #f) (set-zero! *camera-smush-control*) - ((the-as (function target none) (find-parent-method target 10)) obj) + ((the-as (function target none) (find-parent-method target 10)) this) (none) ) diff --git a/test/decompiler/reference/jak2/engine/target/mech/carry-h_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/carry-h_REF.gc index 6939fed944..6c77efcfac 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/carry-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/carry-h_REF.gc @@ -42,28 +42,28 @@ ) ;; definition for method 3 of type carry-info -(defmethod inspect carry-info ((obj carry-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect carry-info ((this carry-info)) + (when (not this) + (set! this this) (goto cfg-10) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Tpickup-time: ~D~%" (-> obj pickup-time)) - (format #t "~1Tother-value: ~f~%" (-> obj other-value)) - (format #t "~1Tother: ~D~%" (-> obj other)) - (format #t "~1Tpoint: ~`vector`P~%" (-> obj point)) - (format #t "~1Tnormal: ~`vector`P~%" (-> obj normal)) - (format #t "~1Tmax-angle: (deg ~r)~%" (-> obj max-angle)) - (format #t "~1Tmax-distance: (meters ~m)~%" (-> obj max-distance)) - (format #t "~1Tmax-pull: (meters ~m)~%" (-> obj max-pull)) - (format #t "~1Tmin-pull: (meters ~m)~%" (-> obj min-pull)) - (format #t "~1Tgrab-trans-blend: ~f~%" (-> obj grab-trans-blend)) - (format #t "~1Tcarry-radius: (meters ~m)~%" (-> obj carry-radius)) - (format #t "~1Tbackup-radius: (meters ~m)~%" (-> obj backup-radius)) - (format #t "~1Tjoint: ~D~%" (-> obj joint)) - (format #t "~1Tmode: #x~X : (carry-mode " (-> obj mode)) - (let ((s5-0 (-> obj mode))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tpickup-time: ~D~%" (-> this pickup-time)) + (format #t "~1Tother-value: ~f~%" (-> this other-value)) + (format #t "~1Tother: ~D~%" (-> this other)) + (format #t "~1Tpoint: ~`vector`P~%" (-> this point)) + (format #t "~1Tnormal: ~`vector`P~%" (-> this normal)) + (format #t "~1Tmax-angle: (deg ~r)~%" (-> this max-angle)) + (format #t "~1Tmax-distance: (meters ~m)~%" (-> this max-distance)) + (format #t "~1Tmax-pull: (meters ~m)~%" (-> this max-pull)) + (format #t "~1Tmin-pull: (meters ~m)~%" (-> this min-pull)) + (format #t "~1Tgrab-trans-blend: ~f~%" (-> this grab-trans-blend)) + (format #t "~1Tcarry-radius: (meters ~m)~%" (-> this carry-radius)) + (format #t "~1Tbackup-radius: (meters ~m)~%" (-> this backup-radius)) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (format #t "~1Tmode: #x~X : (carry-mode " (-> this mode)) + (let ((s5-0 (-> this mode))) (if (= (logand s5-0 (carry-mode mech-carry)) (carry-mode mech-carry)) (format #t "mech-carry ") ) @@ -75,14 +75,14 @@ ) ) (format #t ")~%") - (format #t "~1Tface-dir: ~D~%" (-> obj face-dir)) - (format #t "~1Tlocal-point: ~`vector`P~%" (-> obj local-point)) - (format #t "~1Tlocal-normal: ~`vector`P~%" (-> obj local-normal)) - (format #t "~1Tgrab-quat: ~`vector`P~%" (-> obj grab-quat)) - (format #t "~1Tgrab-trans: ~`vector`P~%" (-> obj grab-trans)) - (format #t "~1Thold-trans: ~`vector`P~%" (-> obj hold-trans)) + (format #t "~1Tface-dir: ~D~%" (-> this face-dir)) + (format #t "~1Tlocal-point: ~`vector`P~%" (-> this local-point)) + (format #t "~1Tlocal-normal: ~`vector`P~%" (-> this local-normal)) + (format #t "~1Tgrab-quat: ~`vector`P~%" (-> this grab-quat)) + (format #t "~1Tgrab-trans: ~`vector`P~%" (-> this grab-trans)) + (format #t "~1Thold-trans: ~`vector`P~%" (-> this hold-trans)) (label cfg-10) - obj + this ) ;; definition for method 0 of type carry-info @@ -131,77 +131,77 @@ ;; definition for method 9 of type carry-info ;; WARN: Return type mismatch int vs none. -(defmethod carry-info-method-9 carry-info ((obj carry-info)) - (let ((s5-0 (-> obj process 0 node-list data (-> obj joint) bone transform))) - (vector-rotate*! (-> obj normal) (-> obj local-normal) s5-0) - (vector-matrix*! (-> obj point) (-> obj local-point) s5-0) +(defmethod carry-info-method-9 carry-info ((this carry-info)) + (let ((s5-0 (-> this process 0 node-list data (-> this joint) bone transform))) + (vector-rotate*! (-> this normal) (-> this local-normal) s5-0) + (vector-matrix*! (-> this point) (-> this local-point) s5-0) ) 0 (none) ) ;; definition for method 10 of type carry-info -(defmethod distance-from-destination carry-info ((obj carry-info) (arg0 carry-info)) +(defmethod distance-from-destination carry-info ((this carry-info) (arg0 carry-info)) "Returns the distance from the current `point` and the provided [[carry-info]]'s `point`. Returns `-1.0` if it exceeds the maximum allowed" - (let* ((f28-0 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> arg0 point) (-> obj point)))) - (f30-0 (fabs (deg-diff f28-0 (vector-y-angle (-> obj normal))))) + (let* ((f28-0 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) (-> arg0 point) (-> this point)))) + (f30-0 (fabs (deg-diff f28-0 (vector-y-angle (-> this normal))))) (f28-1 (fabs (deg-diff (+ 32768.0 f28-0) (vector-y-angle (-> arg0 normal))))) - (f26-0 (vector-vector-distance (-> obj point) (-> arg0 point))) + (f26-0 (vector-vector-distance (-> this point) (-> arg0 point))) ) (cond - ((or (< (-> obj max-distance) f26-0) + ((or (< (-> this max-distance) f26-0) (< (-> arg0 max-distance) f26-0) - (< (-> obj max-angle) f30-0) - (or (< (-> arg0 max-angle) f28-1) (not (logtest? (-> obj mode) (-> arg0 mode)))) + (< (-> this max-angle) f30-0) + (or (< (-> arg0 max-angle) f28-1) (not (logtest? (-> this mode) (-> arg0 mode)))) ) - (if (< (-> obj max-distance) f26-0) + (if (< (-> this max-distance) f26-0) (format #t " ~A ~A failed for this distance ~M ~M~%" - (-> obj process 0 name) + (-> this process 0 name) (-> arg0 process 0 name) f26-0 - (-> obj max-distance) + (-> this max-distance) ) ) (if (< (-> arg0 max-distance) f26-0) (format #t " ~A ~A failed for other distance ~M ~M~%" - (-> obj process 0 name) + (-> this process 0 name) (-> arg0 process 0 name) f26-0 (-> arg0 max-distance) ) ) - (if (< (-> obj max-angle) f30-0) + (if (< (-> this max-angle) f30-0) (format #t " ~A ~A failed for this angle ~R ~R~%" - (-> obj process 0 name) + (-> this process 0 name) (-> arg0 process 0 name) f30-0 - (-> obj max-angle) + (-> this max-angle) ) ) (if (< (-> arg0 max-angle) f28-1) (format #t " ~A ~A failed for other angle ~R ~R~%" - (-> obj process 0 name) + (-> this process 0 name) (-> arg0 process 0 name) f28-1 (-> arg0 max-angle) ) ) - (if (not (logtest? (-> obj mode) (-> arg0 mode))) + (if (not (logtest? (-> this mode) (-> arg0 mode))) (format #t " ~A ~A failed for mode ~X ~X~%" - (-> obj process 0 name) + (-> this process 0 name) (-> arg0 process 0 name) - (-> obj mode) + (-> this mode) (-> arg0 mode) ) ) @@ -217,18 +217,18 @@ Returns `-1.0` if it exceeds the maximum allowed" ;; definition for method 11 of type carry-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod drag! carry-info ((obj carry-info) (arg0 carry-info)) +(defmethod drag! carry-info ((this carry-info) (arg0 carry-info)) (let ((v1-0 (-> arg0 process))) - (set! (-> obj other) (the-as handle (logior (if v1-0 - (new 'static 'handle :pid (-> v1-0 0 pid)) - (new 'static 'handle) - ) - (new 'static 'handle :process v1-0) - ) - ) + (set! (-> this other) (the-as handle (logior (if v1-0 + (new 'static 'handle :pid (-> v1-0 0 pid)) + (new 'static 'handle) + ) + (new 'static 'handle :process v1-0) + ) + ) ) ) - (let ((v1-3 (-> obj process))) + (let ((v1-3 (-> this process))) (set! (-> arg0 other) (the-as handle (logior (if v1-3 (new 'static 'handle :pid (-> v1-3 0 pid)) (new 'static 'handle) @@ -238,7 +238,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) ) - (set! (-> obj pickup-time) (-> obj process 0 clock frame-counter)) + (set! (-> this pickup-time) (-> this process 0 clock frame-counter)) (set! (-> arg0 pickup-time) (-> arg0 process 0 clock frame-counter)) (set! (-> arg0 grab-trans-blend) 1.0) (let* ((s4-0 (the-as collide-shape (-> arg0 process 0 control))) @@ -252,7 +252,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) (quaternion-copy! (-> arg0 grab-quat) (-> arg0 process 0 control quat)) - (quaternion-rotate-y! (-> arg0 grab-quat) (-> arg0 grab-quat) (- (vector-y-angle (-> obj normal)))) + (quaternion-rotate-y! (-> arg0 grab-quat) (-> arg0 grab-quat) (- (vector-y-angle (-> this normal)))) (let* ((f30-0 (quaternion-y-angle (-> arg0 grab-quat))) (f0-8 (the float (the int (* 0.000061035156 (+ 73728.0 (the float (sar (shl (the int f30-0) 48) 48))))))) (f28-0 (the float (sar (shl (the int (* 16384.0 f0-8)) 48) 48))) @@ -264,7 +264,7 @@ Returns `-1.0` if it exceeds the maximum allowed" (-> arg0 process 0 node-list data (-> arg0 joint) bone transform) ) ) - (s4-3 (vector-negate! (new 'stack-no-clear 'vector) (-> obj normal))) + (s4-3 (vector-negate! (new 'stack-no-clear 'vector) (-> this normal))) ) (set! (-> s4-3 y) 0.0) (vector-xz-normalize! s4-3 (-> arg0 max-pull)) @@ -286,7 +286,7 @@ Returns `-1.0` if it exceeds the maximum allowed" (-> arg0 local-point z) ) ) - (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> obj process))) + (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> this process))) (let ((v1-49 (-> (the-as collide-shape (-> (the-as process-drawable (ppointer->process (-> arg0 process))) root)) root-prim ) @@ -318,7 +318,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ;; definition for method 12 of type carry-info ;; WARN: Return type mismatch int vs none. -(defmethod drop-impl! carry-info ((obj carry-info) (arg0 carry-info)) +(defmethod drop-impl! carry-info ((this carry-info) (arg0 carry-info)) (let ((a1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> arg0 process 0 control quat)))) (set! (-> a1-2 y) 0.0) (set-heading-vec-clear-roll-pitch! (-> arg0 process 0 control) a1-2) @@ -333,7 +333,7 @@ Returns `-1.0` if it exceeds the maximum allowed" (set! (-> v1-9 root-prim local-sphere w) (-> arg0 backup-radius)) ) ) - (set! (-> obj other) (the-as handle #f)) + (set! (-> this other) (the-as handle #f)) (set! (-> arg0 other) (the-as handle #f)) (change-parent (ppointer->process (-> arg0 process)) *entity-pool*) (let ((v1-16 @@ -359,21 +359,25 @@ Returns `-1.0` if it exceeds the maximum allowed" ;; definition for method 13 of type carry-info ;; INFO: Used lq/sq -(defmethod carry-info-method-13 carry-info ((obj carry-info)) +(defmethod carry-info-method-13 carry-info ((this carry-info)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'carry-info) - (let* ((s4-0 (the-as carry-info (send-event-function (handle->process (-> obj other)) a1-0))) - (s2-0 (-> obj process 0 node-list data (-> obj joint) bone transform)) - (v1-10 - (vector-matrix*! - (new 'stack-no-clear 'vector) - (vector-lerp! (new 'stack-no-clear 'vector) (-> obj hold-trans) (-> obj grab-trans) (-> obj grab-trans-blend)) - s2-0 - ) - ) - (s3-2 (vector-! (new 'stack-no-clear 'vector) v1-10 (-> obj process 0 control trans))) + (let* ((s4-0 (the-as carry-info (send-event-function (handle->process (-> this other)) a1-0))) + (s2-0 (-> this process 0 node-list data (-> this joint) bone transform)) + (v1-10 (vector-matrix*! + (new 'stack-no-clear 'vector) + (vector-lerp! + (new 'stack-no-clear 'vector) + (-> this hold-trans) + (-> this grab-trans) + (-> this grab-trans-blend) + ) + s2-0 + ) + ) + (s3-2 (vector-! (new 'stack-no-clear 'vector) v1-10 (-> this process 0 control trans))) ) (when s4-0 (let ((s5-1 (new 'stack-no-clear 'matrix))) @@ -393,25 +397,25 @@ Returns `-1.0` if it exceeds the maximum allowed" (vector-normalize! (-> s5-1 vector 2) 1.0) (vector-reset! (-> s5-1 trans)) (let* ((a1-8 (quaternion-normalize! (matrix->quaternion (new 'stack-no-clear 'quaternion) s5-1))) - (s5-3 (quaternion-normalize! (quaternion*! a1-8 a1-8 (-> obj grab-quat)))) + (s5-3 (quaternion-normalize! (quaternion*! a1-8 a1-8 (-> this grab-quat)))) (v1-19 (vector-! (new 'stack-no-clear 'vector) (-> s4-0 point) s3-2)) - (f30-0 (* 0.033333335 (the float (- (current-time) (-> obj pickup-time))))) + (f30-0 (* 0.033333335 (the float (- (current-time) (-> this pickup-time))))) ) (cond - ((>= (- (current-time) (-> obj pickup-time)) (seconds 1)) - (set! (-> obj process 0 control trans quad) (-> v1-19 quad)) - (quaternion-copy! (-> obj process 0 control quat) s5-3) + ((time-elapsed? (-> this pickup-time) (seconds 1)) + (set! (-> this process 0 control trans quad) (-> v1-19 quad)) + (quaternion-copy! (-> this process 0 control quat) s5-3) ) (else (vector-lerp! - (-> obj process 0 control trans) - (-> obj process 0 control trans) + (-> this process 0 control trans) + (-> this process 0 control trans) v1-19 (fmin 1.0 (* f30-0 (-> self clock time-adjust-ratio))) ) (quaternion-slerp! - (-> obj process 0 control quat) - (-> obj process 0 control quat) + (-> this process 0 control quat) + (-> this process 0 control quat) s5-3 (fmin 1.0 (* f30-0 (-> self clock time-adjust-ratio))) ) @@ -428,18 +432,18 @@ Returns `-1.0` if it exceeds the maximum allowed" ;; definition for method 14 of type carry-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod carry! carry-info ((obj carry-info) (arg0 carry-info) (arg1 vector) (arg2 vector)) +(defmethod carry! carry-info ((this carry-info) (arg0 carry-info) (arg1 vector) (arg2 vector)) (let ((v1-0 (-> arg0 process))) - (set! (-> obj other) (the-as handle (logior (if v1-0 - (new 'static 'handle :pid (-> v1-0 0 pid)) - (new 'static 'handle) - ) - (new 'static 'handle :process v1-0) - ) - ) + (set! (-> this other) (the-as handle (logior (if v1-0 + (new 'static 'handle :pid (-> v1-0 0 pid)) + (new 'static 'handle) + ) + (new 'static 'handle :process v1-0) + ) + ) ) ) - (let ((v1-3 (-> obj process))) + (let ((v1-3 (-> this process))) (set! (-> arg0 other) (the-as handle (logior (if v1-3 (new 'static 'handle :pid (-> v1-3 0 pid)) (new 'static 'handle) @@ -449,7 +453,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) ) - (set! (-> obj pickup-time) (-> obj process 0 clock frame-counter)) + (set! (-> this pickup-time) (-> this process 0 clock frame-counter)) (set! (-> arg0 pickup-time) (-> arg0 process 0 clock frame-counter)) (set! (-> arg0 grab-trans-blend) 1.0) (let* ((s2-0 (the-as collide-shape (-> arg0 process 0 control))) @@ -464,13 +468,13 @@ Returns `-1.0` if it exceeds the maximum allowed" ) (quaternion-copy! (-> arg0 grab-quat) (-> arg0 process 0 control quat)) (set! (-> arg0 grab-trans quad) (-> arg0 process 0 control trans quad)) - (set! (-> arg0 hold-trans quad) (-> obj process 0 control trans quad)) - (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (-> obj point) (-> arg0 point)))) + (set! (-> arg0 hold-trans quad) (-> this process 0 control trans quad)) + (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) (-> this point) (-> arg0 point)))) (vector-xz-normalize! s2-2 (-> arg0 max-pull)) (vector+! s2-2 s2-2 (-> arg0 point)) (let ((f30-0 (y-angle (-> arg0 process 0 control)))) - (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-2 (-> obj process 0 control trans))) - (let* ((f0-5 (the float (-> obj face-dir))) + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s2-2 (-> this process 0 control trans))) + (let* ((f0-5 (the float (-> this face-dir))) (f28-0 (the float (sar (shl (the int (* 16384.0 f0-5)) 48) 48))) ) (set-vector! arg2 (sin (+ f30-0 f28-0)) 0.0 (cos (+ f30-0 f28-0)) 1.0) @@ -478,7 +482,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ) (vector+float*! arg1 (-> arg0 point) arg2 (- (-> arg0 carry-radius))) - (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> obj process))) + (change-parent (ppointer->process (-> arg0 process)) (ppointer->process (-> this process))) (let ((v1-49 (-> (the-as collide-shape (-> (the-as process-drawable (ppointer->process (-> arg0 process))) root)) root-prim ) @@ -508,15 +512,15 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ;; definition for method 16 of type carry-info -(defmethod translate! carry-info ((obj carry-info)) +(defmethod translate! carry-info ((this carry-info)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'carry-info) - (let ((a0-6 (the-as carry-info (send-event-function (handle->process (-> obj other)) a1-0)))) + (let ((a0-6 (the-as carry-info (send-event-function (handle->process (-> this other)) a1-0)))) (when a0-6 - (let ((v1-6 (vector-! (new 'stack-no-clear 'vector) (-> obj grab-trans) (-> obj hold-trans)))) - (vector+! (-> obj process 0 control trans) (-> a0-6 process 0 control trans) v1-6) + (let ((v1-6 (vector-! (new 'stack-no-clear 'vector) (-> this grab-trans) (-> this hold-trans)))) + (vector+! (-> this process 0 control trans) (-> a0-6 process 0 control trans) v1-6) ) #t ) @@ -525,7 +529,7 @@ Returns `-1.0` if it exceeds the maximum allowed" ) ;; definition for method 15 of type carry-info -(defmethod drop! carry-info ((obj carry-info) (arg0 carry-info)) - (drop-impl! obj arg0) +(defmethod drop! carry-info ((this carry-info) (arg0 carry-info)) + (drop-impl! this arg0) (none) ) diff --git a/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc index 424052eeda..a42f83fb3d 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/grunt-mech_REF.gc @@ -18,22 +18,22 @@ ) ;; definition for method 3 of type grunt-mech-hold -(defmethod inspect grunt-mech-hold ((obj grunt-mech-hold)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt-mech-hold ((this grunt-mech-hold)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'grunt-mech-hold) - (format #t "~1Treserve-mask: ~D~%" (-> obj reserve-mask)) - (format #t "~1Tlower-hold: ~D~%" (-> obj lower-hold)) - (format #t "~1Tgrunt-handle: ~D~%" (-> obj grunt-handle)) - (format #t "~1Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~1Tlocal-rot: #~%" (-> obj local-rot)) - (format #t "~1Tlocal-mat: #~%" (-> obj local-mat)) - (format #t "~1Tworld-mat: #~%" (-> obj world-mat)) + (format #t "[~8x] ~A~%" this 'grunt-mech-hold) + (format #t "~1Treserve-mask: ~D~%" (-> this reserve-mask)) + (format #t "~1Tlower-hold: ~D~%" (-> this lower-hold)) + (format #t "~1Tgrunt-handle: ~D~%" (-> this grunt-handle)) + (format #t "~1Ttimeout: ~D~%" (-> this timeout)) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tlocal-rot: #~%" (-> this local-rot)) + (format #t "~1Tlocal-mat: #~%" (-> this local-mat)) + (format #t "~1Tworld-mat: #~%" (-> this world-mat)) (label cfg-4) - obj + this ) ;; definition of type grunt-mech-info @@ -52,17 +52,17 @@ ) ;; definition for method 3 of type grunt-mech-info -(defmethod inspect grunt-mech-info ((obj grunt-mech-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt-mech-info ((this grunt-mech-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Treserved-mask: ~D~%" (-> obj reserved-mask)) - (format #t "~1Tlast-update-time: ~D~%" (-> obj last-update-time)) - (format #t "~1Tholds[6] @ #x~X~%" (-> obj holds)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Treserved-mask: ~D~%" (-> this reserved-mask)) + (format #t "~1Tlast-update-time: ~D~%" (-> this last-update-time)) + (format #t "~1Tholds[6] @ #x~X~%" (-> this holds)) (label cfg-4) - obj + this ) ;; definition for symbol *grunt-mech-info*, type grunt-mech-info @@ -124,32 +124,32 @@ ;; definition for method 10 of type grunt-mech-info ;; WARN: Return type mismatch int vs none. -(defmethod grunt-mech-info-method-10 grunt-mech-info ((obj grunt-mech-info)) +(defmethod grunt-mech-info-method-10 grunt-mech-info ((this grunt-mech-info)) (let ((s5-0 (current-time))) - (when (!= (-> obj last-update-time) s5-0) - (when (< s5-0 (-> obj last-update-time)) + (when (!= (-> this last-update-time) s5-0) + (when (< s5-0 (-> this last-update-time)) (countdown (v1-4 6) - (let ((a0-4 (-> obj holds v1-4))) + (let ((a0-4 (-> this holds v1-4))) (set! (-> a0-4 grunt-handle) (the-as handle #f)) (set! (-> a0-4 timeout) (the-as uint 0)) ) 0 ) - (set! (-> obj reserved-mask) (the-as uint 0)) + (set! (-> this reserved-mask) (the-as uint 0)) 0 ) - (set! (-> obj last-update-time) s5-0) + (set! (-> this last-update-time) s5-0) (let ((v1-8 *target*)) (cond ((and v1-8 (focus-test? v1-8 mech)) (let ((s4-0 (-> v1-8 manipy 0 node-list data 3))) (dotimes (s3-0 6) - (let ((s2-0 (-> obj holds s3-0))) + (let ((s2-0 (-> this holds s3-0))) (matrix*! (-> s2-0 world-mat) (-> s2-0 local-mat) (-> s4-0 bone transform)) (vector-float*! (-> s2-0 world-mat trans) (-> s2-0 world-mat trans) (/ 1.0 (-> s2-0 world-mat trans w))) (when (and (!= (-> s2-0 grunt-handle) #f) (>= s5-0 (the-as time-frame (-> s2-0 timeout)))) (set! (-> s2-0 grunt-handle) (the-as handle #f)) - (logclear! (-> obj reserved-mask) (-> s2-0 reserve-mask)) + (logclear! (-> this reserved-mask) (-> s2-0 reserve-mask)) ) ) ) @@ -157,13 +157,13 @@ ) (else (countdown (v1-25 6) - (let ((a0-16 (-> obj holds v1-25))) + (let ((a0-16 (-> this holds v1-25))) (set! (-> a0-16 grunt-handle) (the-as handle #f)) (set! (-> a0-16 timeout) (the-as uint 0)) ) 0 ) - (set! (-> obj reserved-mask) (the-as uint 0)) + (set! (-> this reserved-mask) (the-as uint 0)) 0 ) ) @@ -174,18 +174,18 @@ ) ;; definition for method 9 of type grunt-mech-info -(defmethod grunt-mech-info-method-9 grunt-mech-info ((obj grunt-mech-info) (arg0 int) (arg1 process) (arg2 symbol)) - (grunt-mech-info-method-10 obj) +(defmethod grunt-mech-info-method-9 grunt-mech-info ((this grunt-mech-info) (arg0 int) (arg1 process) (arg2 symbol)) + (grunt-mech-info-method-10 this) (let ((v1-2 *target*)) (when (and v1-2 (focus-test? v1-2 mech) (not (logtest? (-> v1-2 focus-status) (focus-status dead ignore)))) - (let ((v1-8 (-> obj holds arg0))) + (let ((v1-8 (-> this holds arg0))) (when (and (!= (-> v1-8 grunt-handle) #f) (= (handle->process (-> v1-8 grunt-handle)) arg1)) (set! (-> v1-8 timeout) (the-as uint (+ (current-time) (seconds 0.5)))) (return #t) ) - (when (not (logtest? (-> obj reserved-mask) (-> v1-8 reserve-mask))) + (when (not (logtest? (-> this reserved-mask) (-> v1-8 reserve-mask))) (when (not arg2) - (logior! (-> obj reserved-mask) (-> v1-8 reserve-mask)) + (logior! (-> this reserved-mask) (-> v1-8 reserve-mask)) (set! (-> v1-8 grunt-handle) (process->handle arg1)) (set! (-> v1-8 timeout) (the-as uint (+ (current-time) (seconds 0.5)))) ) @@ -220,28 +220,28 @@ ) ;; definition for method 3 of type grunt-mech -(defmethod inspect grunt-mech ((obj grunt-mech)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt-mech ((this grunt-mech)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type grunt inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thold-id: ~D~%" (-> obj hold-id)) - (format #t "~2Tdismount-dest: #~%" (-> obj dismount-dest)) + (format #t "~2Thold-id: ~D~%" (-> this hold-id)) + (format #t "~2Tdismount-dest: #~%" (-> this dismount-dest)) (label cfg-4) - obj + this ) ;; definition for method 55 of type grunt-mech ;; WARN: Return type mismatch int vs none. -(defmethod track-target! grunt-mech ((obj grunt-mech)) +(defmethod track-target! grunt-mech ((this grunt-mech)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - ((method-of-type grunt track-target!) obj) + ((method-of-type grunt track-target!) this) 0 (none) ) @@ -251,23 +251,23 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod grunt-mech-method-193 grunt-mech ((obj grunt-mech)) +(defmethod grunt-mech-method-193 grunt-mech ((this grunt-mech)) (local-vars (f0-3 float) (sv-592 vector)) (let ((s4-0 *grunt-mech-info*)) (grunt-mech-info-method-10 s4-0) (let ((gp-0 -1)) (let ((f30-0 0.0) - (s3-0 (-> obj root trans)) + (s3-0 (-> this root trans)) ) (countdown (s2-0 4) (let ((s1-0 (-> s4-0 holds s2-0))) - (when (grunt-mech-info-method-9 s4-0 s2-0 obj #t) + (when (grunt-mech-info-method-9 s4-0 s2-0 this #t) (let ((s0-0 (new 'stack-no-clear 'vector))) (set! sv-592 (new 'stack-no-clear 'vector)) (set! (-> s0-0 quad) (-> s1-0 world-mat vector 2 quad)) (set! (-> s0-0 y) 0.0) (vector-normalize! s0-0 1.0) - (vector-! sv-592 (-> s1-0 world-mat trans) (-> obj root trans)) + (vector-! sv-592 (-> s1-0 world-mat trans) (-> this root trans)) (set! (-> sv-592 y) 0.0) (vector-normalize! sv-592 1.0) (let ((f0-2 (-> sv-592 x)) @@ -297,17 +297,17 @@ (when (!= gp-0 -1) (let ((s3-1 (-> s4-0 holds gp-0 lower-hold))) (when (!= s3-1 -1) - (if (and (or (zero? (get-rand-int obj 2)) - (>= 14336.0 (vector-vector-xz-distance-squared (-> obj root trans) (target-pos 0))) + (if (and (or (zero? (get-rand-int this 2)) + (>= 14336.0 (vector-vector-xz-distance-squared (-> this root trans) (target-pos 0))) ) - (grunt-mech-info-method-9 s4-0 s3-1 obj #t) + (grunt-mech-info-method-9 s4-0 s3-1 this #t) ) (set! gp-0 s3-1) ) ) ) (let ((a1-9 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-9 start-pos quad) (-> obj root trans quad)) + (set! (-> a1-9 start-pos quad) (-> this root trans quad)) (+! (-> a1-9 start-pos y) 6144.0) (vector-! (-> a1-9 move-dist) @@ -317,7 +317,7 @@ (let ((v1-41 a1-9)) (set! (-> v1-41 radius) 2048.0) (set! (-> v1-41 collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) - (set! (-> v1-41 ignore-process0) obj) + (set! (-> v1-41 ignore-process0) this) (set! (-> v1-41 ignore-process1) #f) (set! (-> v1-41 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-41 action-mask) (collide-action solid)) @@ -333,7 +333,7 @@ ) ;; definition for method 184 of type grunt-mech -(defmethod grunt-method-184 grunt-mech ((obj grunt-mech) (arg0 float)) +(defmethod grunt-method-184 grunt-mech ((this grunt-mech) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -341,14 +341,14 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((gp-0 (get-enemy-target obj))) + (let ((gp-0 (get-enemy-target this))) (when gp-0 (cond ((focus-test? gp-0 mech) (let ((v1-4 (get-trans gp-0 0)) (a1-2 (new 'stack-no-clear 'vector)) ) - (vector-! a1-2 v1-4 (-> obj root trans)) + (vector-! a1-2 v1-4 (-> this root trans)) (.lvf vf1 (&-> a1-2 quad)) ) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -361,15 +361,15 @@ (f1-0 28672.0) ) (when (>= (* f1-0 f1-0) f0-0) - (let ((a1-3 (grunt-mech-method-193 obj))) + (let ((a1-3 (grunt-mech-method-193 this))) (cond ((= a1-3 -1) - (go (method-of-object obj mech-pre-circling)) + (go (method-of-object this mech-pre-circling)) ) (else - (set! (-> obj hold-id) a1-3) - (grunt-mech-info-method-9 *grunt-mech-info* a1-3 obj #f) - (go (method-of-object obj mech-lunge)) + (set! (-> this hold-id) a1-3) + (grunt-mech-info-method-9 *grunt-mech-info* a1-3 this #f) + (go (method-of-object this mech-lunge)) ) ) ) @@ -378,7 +378,7 @@ gp-0 ) (else - ((method-of-type grunt grunt-method-184) obj arg0) + ((method-of-type grunt grunt-method-184) this arg0) ) ) ) @@ -461,7 +461,7 @@ ;; definition for method 195 of type grunt-mech ;; INFO: Used lq/sq -(defmethod grunt-mech-method-195 grunt-mech ((obj grunt-mech) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod grunt-mech-method-195 grunt-mech ((this grunt-mech) (arg0 vector) (arg1 vector) (arg2 vector)) (local-vars (v1-13 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -470,16 +470,16 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (vector-! (-> s5-0 current-pos) (-> obj root trans) (-> obj nav state mesh bounds)) + (vector-! (-> s5-0 current-pos) (-> this root trans) (-> this nav state mesh bounds)) (vector-normalize-copy! (-> s5-0 travel) arg0 (the-as float arg1)) (set! (-> s5-0 pref-dir quad) (-> s5-0 travel quad)) - (avoid-spheres-1! (-> obj nav) s5-0) + (avoid-spheres-1! (-> this nav) s5-0) (when (>= (fabs (vector-dot (the-as vector (-> s5-0 out-travel)) arg2)) 0.0) (let ((t0-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-no-gaps - (-> obj nav) - (-> obj root trans) - (-> obj nav state current-poly) + (-> this nav) + (-> this root trans) + (-> this nav state current-poly) (the-as vector (-> s5-0 out-travel)) t0-0 ) @@ -497,14 +497,14 @@ (when (>= f0-3 (* f1-1 f1-1)) (let ((a1-3 (new 'stack-no-clear 'vector))) (set! (-> a1-3 quad) (-> s5-0 out-travel 0 quad)) - (set! (-> a1-3 w) (-> obj nav-radius-backup)) - (when (not (add-root-sphere-to-hash! (-> obj nav) a1-3 #x80068)) + (set! (-> a1-3 w) (-> this nav-radius-backup)) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-3 #x80068)) (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector+! s4-1 (-> obj root trans) (the-as vector (-> s5-0 out-travel))) + (vector+! s4-1 (-> this root trans) (the-as vector (-> s5-0 out-travel))) (let ((s5-1 (new 'stack-no-clear 'collide-query))) - (when (enemy-above-ground? obj s5-1 s4-1 (the-as collide-spec (-> obj gnd-collide)) 4096.0 122880.0 1024.0) + (when (enemy-above-ground? this s5-1 s4-1 (the-as collide-spec (-> this gnd-collide)) 4096.0 122880.0 1024.0) (set! (-> s4-1 y) (-> s5-1 best-other-tri intersect y)) - (set! (-> obj dismount-dest quad) (-> s4-1 quad)) + (set! (-> this dismount-dest quad) (-> s4-1 quad)) #t ) ) @@ -519,17 +519,17 @@ ) ;; definition for method 192 of type grunt-mech -(defmethod grunt-mech-method-192 grunt-mech ((obj grunt-mech)) - (do-navigation-to-destination (-> obj nav state) (-> obj root trans)) +(defmethod grunt-mech-method-192 grunt-mech ((this grunt-mech)) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) (let ((a1-1 *target*)) (if (or (not a1-1) (not (logtest? (focus-status mech) (-> a1-1 focus-status)))) (return #t) ) ) - (when (logtest? (-> obj nav state flags) (nav-state-flag in-mesh)) + (when (logtest? (-> this nav state flags) (nav-state-flag in-mesh)) (let ((s5-0 *grunt-mech-info*)) (grunt-mech-info-method-10 s5-0) - (let* ((v1-15 (-> obj nav)) + (let* ((v1-15 (-> this nav)) (a0-7 (-> v1-15 state mesh sphere-hash sphere-array)) (a1-3 (-> v1-15 sphere-id-array)) (a2-1 (-> v1-15 state mesh bounds)) @@ -546,7 +546,7 @@ ) ) 0 - (let ((v1-22 (-> s5-0 holds (-> obj hold-id))) + (let ((v1-22 (-> s5-0 holds (-> this hold-id))) (s5-1 (new 'stack-no-clear 'vector)) ) (vector-negate! s5-1 (-> v1-22 world-mat vector 2)) @@ -554,8 +554,8 @@ (vector-normalize! s5-1 1.0) (countdown (s4-0 3) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-rotate-around-y! s3-0 s5-1 (get-rand-float-range obj -10922.667 10922.667)) - (when (grunt-mech-method-195 obj s3-0 (the-as vector (get-rand-float-range obj 16384.0 24576.0)) s5-1) + (vector-rotate-around-y! s3-0 s5-1 (get-rand-float-range this -10922.667 10922.667)) + (when (grunt-mech-method-195 this s3-0 (the-as vector (get-rand-float-range this 16384.0 24576.0)) s5-1) #t (goto cfg-16) ) @@ -565,10 +565,10 @@ ) ) (label cfg-16) - (let ((a0-15 (-> obj root trans))) - (if (or (>= 0.0 (- (-> a0-15 y) (-> obj dismount-dest y))) + (let ((a0-15 (-> this root trans))) + (if (or (>= 0.0 (- (-> a0-15 y) (-> this dismount-dest y))) (let ((f0-4 40960.0)) - (< (* f0-4 f0-4) (vector-vector-xz-distance-squared a0-15 (-> obj dismount-dest))) + (< (* f0-4 f0-4) (vector-vector-xz-distance-squared a0-15 (-> this dismount-dest))) ) ) (return #t) @@ -579,16 +579,16 @@ ;; definition for method 194 of type grunt-mech ;; WARN: Return type mismatch object vs none. -(defmethod grunt-mech-method-194 grunt-mech ((obj grunt-mech)) +(defmethod grunt-mech-method-194 grunt-mech ((this grunt-mech)) (send-event *target* 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'grunt)))) (none) ) ;; definition for method 191 of type grunt-mech ;; WARN: Return type mismatch object vs none. -(defmethod grunt-mech-method-191 grunt-mech ((obj grunt-mech)) - (if (>= (current-time) (-> obj state-timeout)) - (go (method-of-object obj mech-dismount)) +(defmethod grunt-mech-method-191 grunt-mech ((this grunt-mech)) + (if (>= (current-time) (-> this state-timeout)) + (go (method-of-object this mech-dismount)) ) (none) ) @@ -598,7 +598,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (set! (-> self root root-prim prim-core collide-as) (collide-spec)) (stop-looking-at-target! self) @@ -729,7 +729,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root root-prim prim-core collide-as) (collide-spec)) (let* ((v1-4 (-> self nav)) (a1-0 (-> self dismount-dest)) @@ -824,9 +824,9 @@ ) (let ((gp-1 (-> self focus aware))) (if (or (!= gp-1 3) (not (get-enemy-target self))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (when (>= 1 (the-as int gp-1)) (nav-enemy-method-161 self) (if (-> self enemy-info use-stop-chase) @@ -845,7 +845,7 @@ ) ) (else - (when (>= (- (current-time) (-> self starting-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self starting-time) (-> self reaction-time)) (nav-enemy-method-161 self) (go-hostile self) ) diff --git a/test/decompiler/reference/jak2/engine/target/mech/mech-h_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/mech-h_REF.gc index 51111d9846..2a41348be2 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/mech-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/mech-h_REF.gc @@ -54,58 +54,58 @@ ) ;; definition for method 3 of type mech-info -(defmethod inspect mech-info ((obj mech-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect mech-info ((this mech-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Thud[1] @ #x~X~%" (-> obj hud)) - (format #t "~1Tmech-trans: ~`vector`P~%" (-> obj mech-trans)) - (format #t "~1Tmech-quat: ~`vector`P~%" (-> obj mech-quat)) - (format #t "~1Tmech-scale: ~`vector`P~%" (-> obj mech-scale)) - (format #t "~1Tengine-sound-id: ~D~%" (-> obj engine-sound-id)) - (format #t "~1Tengine-sound-volume: ~f~%" (-> obj engine-sound-volume)) - (format #t "~1Tengine-sound-pitch: ~f~%" (-> obj engine-sound-pitch)) - (format #t "~1Tthrust-sound-id: ~D~%" (-> obj thrust-sound-id)) - (format #t "~1Tdrag-sound-id: ~D~%" (-> obj drag-sound-id)) - (format #t "~1Twhine-sound-id: ~D~%" (-> obj whine-sound-id)) - (format #t "~1Tmech-start-time: ~D~%" (-> obj mech-start-time)) - (format #t "~1Tmech-time: ~D~%" (-> obj mech-time)) - (format #t "~1Tno-get-off-time: ~D~%" (-> obj no-get-off-time)) - (format #t "~1Tstick-lock: ~A~%" (-> obj stick-lock)) - (format #t "~1Tstick-off: ~A~%" (-> obj stick-off)) - (format #t "~1Tforward-vel: (meters ~m)~%" (-> obj forward-vel)) - (format #t "~1Tjump-thrust: (meters ~m)~%" (-> obj jump-thrust)) - (format #t "~1Tjump-thrust-fuel: ~f~%" (-> obj jump-thrust-fuel)) - (format #t "~1Tunstuck-time: ~D~%" (-> obj unstuck-time)) - (format #t "~1Tstuck-count: ~D~%" (-> obj stuck-count)) - (format #t "~1Tback-touch-point: ~`vector`P~%" (-> obj back-touch-point)) - (format #t "~1Tback-touch-trans: ~`vector`P~%" (-> obj back-touch-trans)) - (format #t "~1Tback-touch-time: ~D~%" (-> obj back-touch-time)) - (format #t "~1Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~1Tshield-value: ~f~%" (-> obj shield-value)) - (format #t "~1Tshield-max: ~f~%" (-> obj shield-max)) - (format #t "~1Twalk-anim-leg: ~D~%" (-> obj walk-anim-leg)) - (format #t "~1Tstate-impact?[1] @ #x~X~%" (-> obj state-impact?)) - (format #t "~1Tstate-impact[1] @ #x~X~%" (-> obj state-impact)) - (format #t "~1Tthruster-flame-width: (meters ~m)~%" (-> obj thruster-flame-width)) - (format #t "~1Tthruster-flame-length: (meters ~m)~%" (-> obj thruster-flame-length)) - (format #t "~1Tthruster-local-pos[2] @ #x~X~%" (-> obj thruster-local-pos)) - (format #t "~1Texhaust-local-pos[2] @ #x~X~%" (-> obj exhaust-local-pos)) - (format #t "~1Texhaust-local-dir[2] @ #x~X~%" (-> obj exhaust-local-dir)) - (format #t "~1Tsmoke-local-pos[2] @ #x~X~%" (-> obj smoke-local-pos)) - (format #t "~1Tsmoke-local-vel[2] @ #x~X~%" (-> obj smoke-local-vel)) - (format #t "~1Tparticle-system-2d: ~A~%" (-> obj particle-system-2d)) - (format #t "~1Tparticle-system-3d: ~A~%" (-> obj particle-system-3d)) - (format #t "~1Tpart-thruster: ~A~%" (-> obj part-thruster)) - (format #t "~1Tpart-thruster-scale-x: #~%" (-> obj part-thruster-scale-x)) - (format #t "~1Tpart-thruster-scale-y: #~%" (-> obj part-thruster-scale-y)) - (format #t "~1Tpart-quat: #~%" (-> obj part-quat)) - (format #t "~1Tpart-vel: #~%" (-> obj part-vel)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Thud[1] @ #x~X~%" (-> this hud)) + (format #t "~1Tmech-trans: ~`vector`P~%" (-> this mech-trans)) + (format #t "~1Tmech-quat: ~`vector`P~%" (-> this mech-quat)) + (format #t "~1Tmech-scale: ~`vector`P~%" (-> this mech-scale)) + (format #t "~1Tengine-sound-id: ~D~%" (-> this engine-sound-id)) + (format #t "~1Tengine-sound-volume: ~f~%" (-> this engine-sound-volume)) + (format #t "~1Tengine-sound-pitch: ~f~%" (-> this engine-sound-pitch)) + (format #t "~1Tthrust-sound-id: ~D~%" (-> this thrust-sound-id)) + (format #t "~1Tdrag-sound-id: ~D~%" (-> this drag-sound-id)) + (format #t "~1Twhine-sound-id: ~D~%" (-> this whine-sound-id)) + (format #t "~1Tmech-start-time: ~D~%" (-> this mech-start-time)) + (format #t "~1Tmech-time: ~D~%" (-> this mech-time)) + (format #t "~1Tno-get-off-time: ~D~%" (-> this no-get-off-time)) + (format #t "~1Tstick-lock: ~A~%" (-> this stick-lock)) + (format #t "~1Tstick-off: ~A~%" (-> this stick-off)) + (format #t "~1Tforward-vel: (meters ~m)~%" (-> this forward-vel)) + (format #t "~1Tjump-thrust: (meters ~m)~%" (-> this jump-thrust)) + (format #t "~1Tjump-thrust-fuel: ~f~%" (-> this jump-thrust-fuel)) + (format #t "~1Tunstuck-time: ~D~%" (-> this unstuck-time)) + (format #t "~1Tstuck-count: ~D~%" (-> this stuck-count)) + (format #t "~1Tback-touch-point: ~`vector`P~%" (-> this back-touch-point)) + (format #t "~1Tback-touch-trans: ~`vector`P~%" (-> this back-touch-trans)) + (format #t "~1Tback-touch-time: ~D~%" (-> this back-touch-time)) + (format #t "~1Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~1Tshield-value: ~f~%" (-> this shield-value)) + (format #t "~1Tshield-max: ~f~%" (-> this shield-max)) + (format #t "~1Twalk-anim-leg: ~D~%" (-> this walk-anim-leg)) + (format #t "~1Tstate-impact?[1] @ #x~X~%" (-> this state-impact?)) + (format #t "~1Tstate-impact[1] @ #x~X~%" (-> this state-impact)) + (format #t "~1Tthruster-flame-width: (meters ~m)~%" (-> this thruster-flame-width)) + (format #t "~1Tthruster-flame-length: (meters ~m)~%" (-> this thruster-flame-length)) + (format #t "~1Tthruster-local-pos[2] @ #x~X~%" (-> this thruster-local-pos)) + (format #t "~1Texhaust-local-pos[2] @ #x~X~%" (-> this exhaust-local-pos)) + (format #t "~1Texhaust-local-dir[2] @ #x~X~%" (-> this exhaust-local-dir)) + (format #t "~1Tsmoke-local-pos[2] @ #x~X~%" (-> this smoke-local-pos)) + (format #t "~1Tsmoke-local-vel[2] @ #x~X~%" (-> this smoke-local-vel)) + (format #t "~1Tparticle-system-2d: ~A~%" (-> this particle-system-2d)) + (format #t "~1Tparticle-system-3d: ~A~%" (-> this particle-system-3d)) + (format #t "~1Tpart-thruster: ~A~%" (-> this part-thruster)) + (format #t "~1Tpart-thruster-scale-x: #~%" (-> this part-thruster-scale-x)) + (format #t "~1Tpart-thruster-scale-y: #~%" (-> this part-thruster-scale-y)) + (format #t "~1Tpart-quat: #~%" (-> this part-quat)) + (format #t "~1Tpart-vel: #~%" (-> this part-vel)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc index 5837b4a736..f2a0e5b886 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/mech-states_REF.gc @@ -57,7 +57,7 @@ ) 1820.4445 ) - (>= (- (current-time) (-> self control time-of-last-zero-input)) (seconds 0.05)) + (time-elapsed? (-> self control time-of-last-zero-input) (seconds 0.05)) ) ) (go target-mech-walk) @@ -503,7 +503,7 @@ ) ) (set! (-> self control send-attack-dest) (process->handle s5-2)) - (set! (-> self control send-attack-time) (current-time)) + (set-time! (-> self control send-attack-time)) #t ) ) @@ -562,7 +562,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *mech-punch-mods*) (set! (-> self mech state-impact? 0) #f) (rot->dir-targ! (-> self control)) @@ -570,7 +570,7 @@ :exit (behavior () (set! (-> *mech-punch-mods* turnvv) 0.0) (set! (-> self mech state-impact? 0) #f) - (set! (-> self control last-running-attack-end-time) (current-time)) + (set-time! (-> self control last-running-attack-end-time)) (target-exit) (target-mech-exit) ) @@ -723,9 +723,7 @@ ) ) ) - (set! s3-2 - (and (>= (- (current-time) (-> self state-time)) s4-0) (and (>= (-> self mech forward-vel) 0.0) s3-2)) - ) + (set! s3-2 (and (time-elapsed? (-> self state-time) s4-0) (and (>= (-> self mech forward-vel) 0.0) s3-2))) (set! (-> self mech state-impact? 0) s3-2) (set-forward-vel (-> self mech forward-vel)) (when (< 20480.0 (vector-length (-> self control transv))) @@ -758,7 +756,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *mech-jump-mods*) (set! (-> self mech jump-thrust) 0.0) (let* ((v1-4 *game-info*) @@ -785,7 +783,7 @@ ) (when (if (and (and v1-9 (= v1-9 (-> self draw art-group data 330))) (< f0-0 (-> *TARGET-bank* stuck-distance)) - (and (>= (- (current-time) (-> self state-time)) (seconds 2)) + (and (time-elapsed? (-> self state-time) (seconds 2)) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) ) @@ -887,7 +885,7 @@ (defstate target-mech-jump (target) :event (-> target-mech-falling event) :enter (behavior ((arg0 float) (arg1 float) (arg2 surface)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (let* ((v1-4 *game-info*) (a2-5 (+ (-> v1-4 attack-id) 1)) @@ -928,7 +926,7 @@ (-> v1-0 id) ) (set! (-> self mech jump-thrust-fuel) (-> *TARGET-bank* mech-jump-thrust-fuel)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (cond ((= arg0 'stuck) ) @@ -958,7 +956,7 @@ (if (and (cpad-pressed? (-> self control cpad number) circle square) (can-hands? #t)) (go target-mech-punch) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.25)) + (when (time-elapsed? (-> self state-time) (seconds 0.25)) (if (move-legs?) (go target-mech-walk) ) @@ -1007,7 +1005,7 @@ :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) - (set! (-> self control time-of-last-debug-heal) (current-time)) + (set-time! (-> self control time-of-last-debug-heal)) (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) (go target-mech-stance) ) @@ -1015,7 +1013,7 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self attack-info)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -1062,7 +1060,7 @@ (cond ((= arg0 'attack) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('endlessfall) (cond @@ -1071,7 +1069,7 @@ (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) (let ((s3-1 (current-time))) - (until (>= (- (current-time) s3-1) (seconds 1)) + (until (time-elapsed? s3-1 (seconds 1)) (suspend) ) ) @@ -1211,7 +1209,7 @@ (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! (-> self draw art-group data 330) :num! (loop! 0.5) :frame-num 0.0) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.8)) + (until (time-elapsed? gp-3 (seconds 0.8)) (ja :group! (-> self draw art-group data 330) :num! (loop! 0.5)) (suspend) ) @@ -1336,7 +1334,7 @@ (ja :num! (seek!)) ) (let ((gp-9 (current-time))) - (until (>= (- (current-time) gp-9) (seconds 2)) + (until (time-elapsed? gp-9 (seconds 2)) (suspend) ) ) @@ -1347,7 +1345,7 @@ (if (!= (-> self game mode) 'play) (go target-jump 16384.0 16384.0 (the-as surface #f)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sleep-code) ) :post target-mech-post @@ -1442,7 +1440,7 @@ :enter (behavior () (set! (-> self control mod-surface) *mech-pickup-mods*) (set! (-> self mech stick-off) (the-as basic #t)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) (set! (-> self carry other) (the-as handle #f)) (set! (-> self carry other-value) 100000000000.0) @@ -1683,7 +1681,7 @@ ) :enter (behavior () (set! (-> self control mod-surface) *mech-walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) (set! (-> self mech stick-off) (the-as basic #t)) ) @@ -1847,7 +1845,7 @@ (set! (-> self control mod-surface turnvv) 20024.889) (set! (-> self control did-move-to-pole-or-max-jump-height) 0.0) (rot->dir-targ! (-> self control)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () ((-> target-mech-carry-pickup exit)) @@ -1860,13 +1858,13 @@ ) 1820.4445 ) - (>= (- (current-time) (-> self control time-of-last-zero-input)) (seconds 0.05)) + (time-elapsed? (-> self control time-of-last-zero-input) (seconds 0.05)) ) ) (go target-mech-carry-walk) ) (if (and (cpad-pressed? (-> self control cpad number) r1) - (>= (- (current-time) (-> self carry pickup-time)) (seconds 0.1)) + (time-elapsed? (-> self carry pickup-time) (seconds 0.1)) ) (go target-mech-carry-drop) ) @@ -1939,7 +1937,7 @@ (defstate target-mech-carry-walk (target) :event (-> target-mech-carry-stance event) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *mech-carry-walk-mods*) (set! (-> self control unknown-word04) (the-as uint 0.0)) ) @@ -1962,7 +1960,7 @@ ) ) (if (and (cpad-pressed? (-> self control cpad number) r1) - (>= (- (current-time) (-> self carry pickup-time)) (seconds 0.1)) + (time-elapsed? (-> self carry pickup-time) (seconds 0.1)) ) (go target-mech-carry-drop) ) @@ -2066,7 +2064,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control sliding-start-time) 0) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self control mod-surface) *mech-carry-drag-mods*) @@ -2098,7 +2096,7 @@ ) :trans (behavior () (when (and (not (cpad-hold? (-> self control cpad number) r1)) - (>= (- (current-time) (-> self carry pickup-time)) (seconds 0.5)) + (time-elapsed? (-> self carry pickup-time) (seconds 0.5)) ) (sound-play "mech-drag-off") (if (or (and (>= (-> self mech back-touch-time) (-> self state-time)) @@ -2277,7 +2275,7 @@ ) :enter (behavior () (set! (-> self control mod-surface) *mech-carry-jump-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (-> target-mech-carry-pickup exit) :trans (behavior () @@ -2285,7 +2283,7 @@ (go target-mech-carry-hit-ground #f) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) #t @@ -2395,7 +2393,7 @@ (defstate target-mech-carry-jump (target) :event (-> target-mech-carry-falling event) :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *mech-carry-jump-mods*) @@ -2467,7 +2465,7 @@ :event (-> target-mech-carry-drop event) :enter (behavior () (set! (-> self control mod-surface) *mech-walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) (set! (-> self mech stick-off) (the-as basic #t)) ) diff --git a/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc b/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc index 1d4819a90c..c7d9ea1aac 100644 --- a/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/mech/mech_REF.gc @@ -31,32 +31,32 @@ ) ;; definition for method 3 of type mech -(defmethod inspect mech ((obj mech)) - (when (not obj) - (set! obj obj) +(defmethod inspect mech ((this mech)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Textra-trans: ~`vector`P~%" (-> obj extra-trans)) - (format #t "~2Tcondition: ~D~%" (-> obj condition)) - (format #t "~2Tshadow-backup: ~A~%" (-> obj shadow-backup)) - (format #t "~2Trider: ~D~%" (-> obj rider)) - (format #t "~2Tshield-value: ~f~%" (-> obj shield-value)) - (format #t "~2Tnav-sphere-handle: ~D~%" (-> obj nav-sphere-handle)) - (format #t "~2Tprobe-time: ~D~%" (-> obj probe-time)) + (format #t "~2Textra-trans: ~`vector`P~%" (-> this extra-trans)) + (format #t "~2Tcondition: ~D~%" (-> this condition)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Trider: ~D~%" (-> this rider)) + (format #t "~2Tshield-value: ~f~%" (-> this shield-value)) + (format #t "~2Tnav-sphere-handle: ~D~%" (-> this nav-sphere-handle)) + (format #t "~2Tprobe-time: ~D~%" (-> this probe-time)) (label cfg-4) - obj + this ) ;; definition for method 24 of type mech ;; WARN: Return type mismatch int vs none. -(defmethod mech-method-24 mech ((obj mech)) - (if (nonzero? (-> obj part)) - (spawn (-> obj part) (-> obj root trans)) +(defmethod mech-method-24 mech ((this mech)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) ) - (update! (-> obj sound)) + (update! (-> this sound)) 0 (none) ) @@ -142,7 +142,7 @@ (let ((f30-0 20480.0)) (until #f (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) - (>= (- (current-time) (-> self probe-time)) (seconds 1)) + (time-elapsed? (-> self probe-time) (seconds 1)) ) (move-to-ground (-> self root) @@ -151,7 +151,7 @@ #t (collide-spec backgnd obstacle hit-by-player-list hit-by-others-list pusher) ) - (set! (-> self probe-time) (current-time)) + (set-time! (-> self probe-time)) ) (when (and (and *target* (and (>= f30-0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (not (logtest? (focus-status teleporting) (-> *target* focus-status))) @@ -267,7 +267,7 @@ (suspend) ) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 1)) + (until (time-elapsed? s5-0 (seconds 1)) (mech-method-24 self) (suspend) ) @@ -382,7 +382,7 @@ ) ;; definition for method 11 of type mech -(defmethod init-from-entity! mech ((obj mech) (arg0 entity-actor)) +(defmethod init-from-entity! mech ((this mech) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -407,16 +407,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mech-target -(defmethod inspect mech-target ((obj mech-target)) - (when (not obj) - (set! obj obj) +(defmethod inspect mech-target ((this mech-target)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -431,7 +431,7 @@ This commonly includes things such as: :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('look-at-point) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (go-virtual active) ) ) @@ -464,7 +464,7 @@ This commonly includes things such as: :virtual #t :event (-> (method-of-type mech-target idle) event) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (and (or (or (not *target*) (or (< 106496.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) @@ -473,7 +473,7 @@ This commonly includes things such as: ) (not (logtest? (focus-status mech) (-> *target* focus-status))) ) - (>= (- (current-time) (-> self state-time)) (seconds 10)) + (time-elapsed? (-> self state-time) (seconds 10)) ) (go-virtual idle) ) diff --git a/test/decompiler/reference/jak2/engine/target/sidekick_REF.gc b/test/decompiler/reference/jak2/engine/target/sidekick_REF.gc index 8e78d2f9f6..3ea95cde55 100644 --- a/test/decompiler/reference/jak2/engine/target/sidekick_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/sidekick_REF.gc @@ -62,7 +62,7 @@ ,(lambda :behavior sidekick ((arg0 object) (arg1 vector) (arg2 object)) (let ((gp-0 (ppointer->process (-> self parent)))) - (when (>= (- (current-time) (-> self special-anim-time)) (seconds 1)) + (when (time-elapsed? (-> self special-anim-time) (seconds 1)) (set! (-> self special-anim-interp) 0.0) (set! (-> self special-anim-frame) 0.0) ) @@ -72,7 +72,7 @@ ) (case arg2 ((1) - (set! (-> self special-anim-time) (current-time)) + (set-time! (-> self special-anim-time)) (cond ((= (-> gp-0 control mod-surface name) 'spin) (set! (-> arg1 z) diff --git a/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc b/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc index f92cbf361f..6fe60e45f5 100644 --- a/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc @@ -49,52 +49,52 @@ ) ;; definition for method 3 of type surface -(defmethod inspect surface ((obj surface)) - (when (not obj) - (set! obj obj) +(defmethod inspect surface ((this surface)) + (when (not this) + (set! this this) (goto cfg-62) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tdata[30] @ #x~X~%" (&-> obj turnv)) - (format #t "~1Tturnv: ~f~%" (-> obj turnv)) - (format #t "~1Tturnvf: ~f~%" (-> obj turnvf)) - (format #t "~1Tturnvv: ~f~%" (-> obj turnvv)) - (format #t "~1Tturnvvf: ~f~%" (-> obj turnvvf)) - (format #t "~1Ttiltv: ~f~%" (-> obj tiltv)) - (format #t "~1Ttiltvf: ~f~%" (-> obj tiltvf)) - (format #t "~1Ttiltvv: ~f~%" (-> obj tiltvv)) - (format #t "~1Ttiltvvf: ~f~%" (-> obj tiltvvf)) - (format #t "~1Tvel-turn: ~f~%" (-> obj vel-turn)) - (format #t "~1Ttransv-max: ~f~%" (-> obj transv-max)) - (format #t "~1Ttarget-speed: ~f~%" (-> obj target-speed)) - (format #t "~1Tseek0: ~f~%" (-> obj seek0)) - (format #t "~1Tseek90: ~f~%" (-> obj seek90)) - (format #t "~1Tseek180: ~f~%" (-> obj seek180)) - (format #t "~1Tfric: ~f~%" (-> obj fric)) - (format #t "~1Tnonlin-fric-dist: ~f~%" (-> obj nonlin-fric-dist)) - (format #t "~1Tslip-factor: ~f~%" (-> obj slip-factor)) - (format #t "~1Tslide-factor: ~f~%" (-> obj slide-factor)) - (format #t "~1Tslope-up-factor: ~f~%" (-> obj slope-up-factor)) - (format #t "~1Tslope-down-factor: ~f~%" (-> obj slope-down-factor)) - (format #t "~1Tslope-slip-angle: ~f~%" (-> obj slope-slip-angle)) - (format #t "~1Timpact-fric: ~f~%" (-> obj impact-fric)) - (format #t "~1Tbend-factor: ~f~%" (-> obj bend-factor)) - (format #t "~1Tbend-speed: ~f~%" (-> obj bend-speed)) - (format #t "~1Talignv: ~f~%" (-> obj alignv)) - (format #t "~1Tslope-up-traction: ~f~%" (-> obj slope-up-traction)) - (format #t "~1Talign-speed: ~f~%" (-> obj align-speed)) - (format #t "~1Tslope-change-preserve: ~f~%" (-> obj slope-change-preserve)) - (format #t "~1Thook[5] @ #x~X~%" (&-> obj active-hook)) - (format #t "~1Tactive-hook: ~A~%" (-> obj active-hook)) - (format #t "~1Ttouch-hook: ~A~%" (-> obj touch-hook)) - (format #t "~1Timpact-hook: ~A~%" (-> obj impact-hook)) - (format #t "~1Tmult-hook: ~A~%" (-> obj mult-hook)) - (format #t "~1Texit-hook: ~A~%" (-> obj exit-hook)) - (format #t "~1Tdataw[2] @ #x~X~%" (&-> obj mode)) - (format #t "~1Tmode: ~A~%" (-> obj mode)) - (format #t "~1Tflags: #x~X : (surface-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tdata[30] @ #x~X~%" (&-> this turnv)) + (format #t "~1Tturnv: ~f~%" (-> this turnv)) + (format #t "~1Tturnvf: ~f~%" (-> this turnvf)) + (format #t "~1Tturnvv: ~f~%" (-> this turnvv)) + (format #t "~1Tturnvvf: ~f~%" (-> this turnvvf)) + (format #t "~1Ttiltv: ~f~%" (-> this tiltv)) + (format #t "~1Ttiltvf: ~f~%" (-> this tiltvf)) + (format #t "~1Ttiltvv: ~f~%" (-> this tiltvv)) + (format #t "~1Ttiltvvf: ~f~%" (-> this tiltvvf)) + (format #t "~1Tvel-turn: ~f~%" (-> this vel-turn)) + (format #t "~1Ttransv-max: ~f~%" (-> this transv-max)) + (format #t "~1Ttarget-speed: ~f~%" (-> this target-speed)) + (format #t "~1Tseek0: ~f~%" (-> this seek0)) + (format #t "~1Tseek90: ~f~%" (-> this seek90)) + (format #t "~1Tseek180: ~f~%" (-> this seek180)) + (format #t "~1Tfric: ~f~%" (-> this fric)) + (format #t "~1Tnonlin-fric-dist: ~f~%" (-> this nonlin-fric-dist)) + (format #t "~1Tslip-factor: ~f~%" (-> this slip-factor)) + (format #t "~1Tslide-factor: ~f~%" (-> this slide-factor)) + (format #t "~1Tslope-up-factor: ~f~%" (-> this slope-up-factor)) + (format #t "~1Tslope-down-factor: ~f~%" (-> this slope-down-factor)) + (format #t "~1Tslope-slip-angle: ~f~%" (-> this slope-slip-angle)) + (format #t "~1Timpact-fric: ~f~%" (-> this impact-fric)) + (format #t "~1Tbend-factor: ~f~%" (-> this bend-factor)) + (format #t "~1Tbend-speed: ~f~%" (-> this bend-speed)) + (format #t "~1Talignv: ~f~%" (-> this alignv)) + (format #t "~1Tslope-up-traction: ~f~%" (-> this slope-up-traction)) + (format #t "~1Talign-speed: ~f~%" (-> this align-speed)) + (format #t "~1Tslope-change-preserve: ~f~%" (-> this slope-change-preserve)) + (format #t "~1Thook[5] @ #x~X~%" (&-> this active-hook)) + (format #t "~1Tactive-hook: ~A~%" (-> this active-hook)) + (format #t "~1Ttouch-hook: ~A~%" (-> this touch-hook)) + (format #t "~1Timpact-hook: ~A~%" (-> this impact-hook)) + (format #t "~1Tmult-hook: ~A~%" (-> this mult-hook)) + (format #t "~1Texit-hook: ~A~%" (-> this exit-hook)) + (format #t "~1Tdataw[2] @ #x~X~%" (&-> this mode)) + (format #t "~1Tmode: ~A~%" (-> this mode)) + (format #t "~1Tflags: #x~X : (surface-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand (surface-flag gun-inactive) s5-0) (surface-flag gun-inactive)) (format #t "gun-inactive ") ) @@ -185,7 +185,7 @@ ) (format #t ")~%") (label cfg-62) - obj + this ) ;; definition for function calc-terminal-vel @@ -209,20 +209,20 @@ ;; definition for method 2 of type surface ;; ERROR: Function may read a register that is not set: t3 -(defmethod print surface ((obj surface)) +(defmethod print surface ((this surface)) (local-vars (t3-0 none)) (format #t "# obj turnv) - (-> obj turnvv) - (-> obj tiltv) - (-> obj tiltvv) - (-> obj transv-max) + (-> this turnv) + (-> this turnvv) + (-> this tiltv) + (-> this tiltvv) + (-> this transv-max) t3-0 ) - (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> obj target-speed) (-> obj seek0) (-> obj seek90) obj) - obj + (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> this target-speed) (-> this seek0) (-> this seek90) this) + this ) ;; definition for function surface-interp! diff --git a/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc b/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc index 47d82659ce..4295826dc5 100644 --- a/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-anim_REF.gc @@ -535,8 +535,8 @@ (cond ((and v1-52 (= v1-52 jakb-roll-flip-ja)) (let ((s5-0 (current-time))) - (while (or (= arg0 -1) (< (- (current-time) s5-0) arg0)) - (when (>= (- (current-time) s5-0) (seconds 0.01)) + (while (or (= arg0 -1) (not (time-elapsed? s5-0 arg0))) + (when (time-elapsed? s5-0 (seconds 0.01)) (let ((v1-62 (ja-group))) (when (not (and v1-62 (= v1-62 jakb-jump-loop-ja))) (ja-channel-push! 1 (seconds 0.1)) @@ -586,7 +586,7 @@ (ja-no-eval :group! jakb-jump-loop-ja :num! (loop!) :frame-num 0.0) (let ((s5-1 (current-time))) (while (or (= arg0 -1) - (and (< (- (current-time) s5-1) arg0) (not (logtest? (-> self control status) (collide-status on-surface)))) + (and (not (time-elapsed? s5-1 arg0)) (not (logtest? (-> self control status) (collide-status on-surface)))) ) (suspend) (ja :group! jakb-jump-loop-ja :num! (loop!)) @@ -998,7 +998,7 @@ ) ) ) - (until (and (>= arg0 0) (>= (- (current-time) s4-10) arg0)) + (until (and (>= arg0 0) (time-elapsed? s4-10 arg0)) (let ((f20-0 (fmax -1.0 (fmin 1.0 (* 2.0 (-> self control local-slope-z))))) (f22-1 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x))))) ) @@ -1576,7 +1576,7 @@ (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) (while (not (or (and (< (fabs (/ f0-11 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) - (>= (- (current-time) (-> self state-time)) (seconds 1.7)) + (time-elapsed? (-> self state-time) (seconds 1.7)) ) ) (quaternion-rotate-y! diff --git a/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc b/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc index 6bc877b3ca..79ee8c3089 100644 --- a/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-carry_REF.gc @@ -152,7 +152,7 @@ ) :enter (behavior () (set! (-> self control mod-surface) *walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) (set! (-> self carry other) (the-as handle #f)) (set! (-> self carry other-value) 100000000000.0) @@ -292,7 +292,7 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control mod-surface) *walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) ) :code (behavior () @@ -415,7 +415,7 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control mod-surface) *carry-walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () ((-> target-carry-pickup exit)) @@ -468,7 +468,7 @@ (defstate target-carry-walk (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *carry-walk-mods*) ) :exit (behavior () @@ -527,7 +527,7 @@ :event target-jump-event-handler :enter (behavior () (set! (-> self control mod-surface) *carry-jump-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (logtest? (-> self control status) (collide-status on-surface)) @@ -543,7 +543,7 @@ ) (when (if (and (< f0-0 (-> *TARGET-bank* stuck-distance)) (and (>= v1-12 0) - (>= (- (current-time) (-> self state-time)) v1-12) + (time-elapsed? (-> self state-time) v1-12) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) ) @@ -636,7 +636,7 @@ (defstate target-carry-jump (target) :event target-jump-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 70) (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) @@ -701,7 +701,7 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control mod-surface) *walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-forward-vel 0.0) ) :code (behavior () diff --git a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc index e90fb7e33e..f7a1114d10 100644 --- a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc @@ -51,7 +51,7 @@ ) ) (or (and (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) - (and (>= (- (current-time) (-> (the-as fact-info-target (-> self fact)) darkjak-start-time)) (seconds 0.05)) + (and (time-elapsed? (-> (the-as fact-info-target (-> self fact)) darkjak-start-time) (seconds 0.05)) (>= (-> self game eco-pill-dark) (-> *FACT-bank* eco-pill-dark-max-default)) ) ) @@ -113,9 +113,10 @@ ) (target-danger-set! (-> self control danger-mode) #f) (update-transforms (-> self control)) - (if (and (or (>= (- (current-time) (-> (the-as fact-info-target (-> self fact)) darkjak-start-time)) - (-> (the-as fact-info-target (-> self fact)) darkjak-effect-time) - ) + (if (and (or (time-elapsed? + (-> (the-as fact-info-target (-> self fact)) darkjak-start-time) + (-> (the-as fact-info-target (-> self fact)) darkjak-effect-time) + ) (not (-> *setting-control* user-current darkjak)) ) (not (focus-test? self dead dangerous hit grabbed)) @@ -193,7 +194,7 @@ ) (set-darkjak-texture-morph! f30-0) (cond - ((and (= f30-0 0.0) (< (- (current-time) (-> self teleport-time)) (seconds 0.5))) + ((and (= f30-0 0.0) (not (time-elapsed? (-> self teleport-time) (seconds 0.5)))) (set! (-> self skel override 0) 0.00001) (set! (-> self skel override 41) 0.000001) ) @@ -305,12 +306,12 @@ (set! (-> self darkjak want-stage) (-> self darkjak stage)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control mod-surface) *darkjak-trans-mods*) - (set! (-> self darkjak start-time) (current-time)) + (set-time! (-> self darkjak start-time)) (set! (-> self darkjak attack-count) (the-as uint 0)) (set! (-> self darkjak-giant-interp) 1.0) (set-setting! 'sound-flava #f 30.0 4) (logior! (-> self focus-status) (focus-status dark)) - (set! (-> (the-as fact-info-target (-> self fact)) darkjak-start-time) (current-time)) + (set-time! (-> (the-as fact-info-target (-> self fact)) darkjak-start-time)) (set! (-> (the-as fact-info-target (-> self fact)) darkjak-effect-time) (seconds 20)) (if (logtest? (-> self darkjak stage) (darkjak-stage invinc)) (logior! (-> self state-flags) (state-flags sf4)) @@ -663,7 +664,7 @@ ) (set! sv-40 (the-as int (current-time))) ) - (when (>= (- (current-time) (the-as time-frame sv-40)) (seconds 0.5)) + (when (time-elapsed? (the-as time-frame sv-40) (seconds 0.5)) (set! sv-40 0) 0 ) @@ -728,13 +729,11 @@ (cond ((and (>= (ja-frame-num 0) 20.0) (and (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) - (>= (- (current-time) (-> self control sliding-start-time)) (seconds 0.04)) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) ) ) (go target-falling #f) @@ -754,8 +753,8 @@ ) (let ((s5-1 (get-trans (the-as process-focusable gp-0) 3))) (when (and (< 2048.0 (vector-vector-distance (-> self control trans) s5-1)) - (or (and (= gp-0 (handle->process sv-56)) (< (- (current-time) (the-as time-frame sv-64)) (seconds 0.1))) - (>= (- (current-time) (the-as time-frame sv-64)) (seconds 1)) + (or (and (= gp-0 (handle->process sv-56)) (not (time-elapsed? (the-as time-frame sv-64) (seconds 0.1)))) + (time-elapsed? (the-as time-frame sv-64) (seconds 1)) ) ) (forward-up-nopitch->quaternion @@ -789,13 +788,13 @@ (set-forward-vel sv-16) ) ((and (nonzero? (-> self control unknown-time-frame18)) - (>= (- (current-time) (-> self control unknown-time-frame18)) (seconds 0.04)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) ) (set-forward-vel 0.0) ) ((and (not (cpad-hold? (-> self control cpad number) square)) (zero? sv-32) - (>= (- (current-time) (-> self control unknown-combo-tracker00 move-start-time)) (seconds 0.2)) + (time-elapsed? (-> self control unknown-combo-tracker00 move-start-time) (seconds 0.2)) ) (if (= (-> self control ground-pat material) (pat-material ice)) (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) @@ -937,7 +936,7 @@ ) (suspend) (ja :num! (seek! max (* (-> self control current-surface align-speed) (the-as float sv-48)))) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (if (< 2 sv-24) @@ -946,9 +945,7 @@ (set! sv-24 (+ sv-24 1)) ) (if (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) @@ -961,30 +958,30 @@ ;; definition for method 9 of type darkjak-info ;; WARN: Return type mismatch int vs none. -(defmethod update-clock! darkjak-info ((obj darkjak-info) (arg0 int)) - (when (-> obj clock-on) - (+! (-> obj clock-pos) (* (-> obj clock-vel) (seconds-per-frame))) - (+! (-> obj clock-vel) (* 4.0 (seconds-per-frame))) +(defmethod update-clock! darkjak-info ((this darkjak-info) (arg0 int)) + (when (-> this clock-on) + (+! (-> this clock-pos) (* (-> this clock-vel) (seconds-per-frame))) + (+! (-> this clock-vel) (* 4.0 (seconds-per-frame))) (cond - ((< 1.0 (-> obj clock-pos)) - (set! (-> obj clock-pos) 1.0) - (set! (-> obj clock-vel) 0.0) + ((< 1.0 (-> this clock-pos)) + (set! (-> this clock-pos) 1.0) + (set! (-> this clock-vel) 0.0) ) - ((< (-> obj clock-pos) 0.05) - (set! (-> obj clock-pos) 0.05) - (set! (-> obj clock-vel) 1.0) + ((< (-> this clock-pos) 0.05) + (set! (-> this clock-pos) 0.05) + (set! (-> this clock-vel) 1.0) ) ) - (update-rates! (-> *display* entity-clock) (-> obj clock-pos)) - (update-rates! (-> *display* bg-clock) (-> obj clock-pos)) + (update-rates! (-> *display* entity-clock) (-> this clock-pos)) + (update-rates! (-> *display* bg-clock) (-> this clock-pos)) (if (= arg0 4) - (update-rates! (-> *display* target-clock) (-> obj clock-pos)) + (update-rates! (-> *display* target-clock) (-> this clock-pos)) ) (when *sound-player-enable* (let ((v1-27 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-27 command) (sound-command set-param)) - (set! (-> v1-27 id) (-> obj process 0 control unknown-sound-id00)) - (set! (-> v1-27 params pitch-mod) (the int (* 1524.0 (- (- 1.0 (-> obj clock-pos)))))) + (set! (-> v1-27 id) (-> this process 0 control unknown-sound-id00)) + (set! (-> v1-27 params pitch-mod) (the int (* 1524.0 (- (- 1.0 (-> this clock-pos)))))) (set! (-> v1-27 params mask) (the-as uint 2)) (-> v1-27 id) ) @@ -1802,7 +1799,7 @@ (ja-channel-push! 2 (seconds 0.05)) (ja :group! jakb-darkjak-attack-ice-loop-ja) (ja :chan 1 :group! jakb-darkjak-attack-ice-loop2-ja) - (while (or (< sv-64 sv-48) (< (- (current-time) sv-80) (seconds 1.5))) + (while (or (< sv-64 sv-48) (not (time-elapsed? sv-80 (seconds 1.5)))) (let ((v1-77 (new-stack-vector0))) (let ((f0-8 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) 0.0 @@ -1822,11 +1819,11 @@ (set! (-> self darkjak clock-vel) -4.0) (set! (-> self darkjak clock-on) #t) (send-event *camera* 'joystick -0.25 1.0) - (when (>= (- (current-time) sv-72) (seconds 0.1)) + (when (time-elapsed? sv-72 (seconds 0.1)) (set! sv-72 (current-time)) (target-bomb1-fire-shot sv-60 sv-64 sv-48 (the-as int sv-104)) (set! sv-64 (+ sv-64 1)) - (if (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (set! sv-92 1.0) ) ) @@ -1856,7 +1853,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self gun surpress-time) (current-time)) + (set-time! (-> self gun surpress-time)) (send-event (handle->process (-> self notify)) 'notify 'attack 17) (go target-darkjak-get-off) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc index d40beb43c7..b72394f6d7 100644 --- a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc @@ -89,7 +89,7 @@ (apply-settings *setting-control*) (logclear! (-> self focus-status) (focus-status teleporting)) (set! (-> self mode-cache) #f) - (set! (-> self teleport-time) (current-time)) + (set-time! (-> self teleport-time)) (set! (-> self control last-trans-any-surf quad) (-> self control trans quad)) (set! (-> self game kiosk-timeout) (the-as uint (-> *display* game-clock frame-counter))) ) @@ -97,7 +97,7 @@ (local-vars (v1-96 symbol)) (set! *spawn-actors* #f) (set! (-> self control unknown-word04) (the-as uint #f)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self focus-status) (focus-status teleporting)) (let ((a0-3 (get-continue-by-name (-> self game) (-> arg0 name)))) (cond @@ -293,7 +293,7 @@ ) ) (let ((s5-6 (current-time))) - (until (>= (- (current-time) s5-6) (seconds 0.05)) + (until (time-elapsed? s5-6 (seconds 0.05)) (suspend) ) ) @@ -320,7 +320,7 @@ ) ((logtest? (-> arg0 flags) (continue-flags warp-gate)) (let ((s5-7 (current-time))) - (until (>= (- (current-time) s5-7) (seconds 0.05)) + (until (time-elapsed? s5-7 (seconds 0.05)) (suspend) ) ) @@ -353,7 +353,7 @@ ) (else (let ((s5-9 (current-time))) - (until (>= (- (current-time) s5-9) (seconds 0.05)) + (until (time-elapsed? s5-9 (seconds 0.05)) (suspend) ) ) @@ -673,9 +673,7 @@ (if (and (cpad-pressed? (-> self control cpad number) square) (and (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (>= (- (current-time) (-> self control last-time-of-stuck)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -697,7 +695,7 @@ ) ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) - (and (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> *TARGET-bank* stuck-time))) + (and (time-elapsed? (-> self state-time) (the-as time-frame (-> *TARGET-bank* stuck-time))) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) ) @@ -952,7 +950,7 @@ :trans (behavior () (when (= *cheat-mode* 'debug) (when (and (not *pause-lock*) (cpad-hold? (-> self control cpad number) r2)) - (set! (-> self control time-of-last-debug-heal) (current-time)) + (set-time! (-> self control time-of-last-debug-heal)) (pickup-collectable! (-> self fact) (pickup-type health) 100.0 (the-as handle #f)) (go target-stance) ) @@ -961,7 +959,7 @@ :code (behavior ((arg0 symbol) (arg1 attack-info)) (local-vars (sv-32 attack-info) (sv-36 vector)) (logclear! (-> self water flags) (water-flags jump-out)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self neck flex-blend) 0.0) (set! sv-32 (-> self attack-info)) (set! sv-36 (new 'stack-no-clear 'vector)) @@ -1016,7 +1014,7 @@ ((= arg0 'attack) (send-event (handle->process (-> self notify)) 'notify 'hit (-> sv-32 mode)) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (case (-> sv-32 mode) (('endlessfall) (cond @@ -1025,7 +1023,7 @@ (set! (-> gp-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) (seconds 1)) + (until (time-elapsed? s5-1 (seconds 1)) (suspend) ) ) @@ -1288,16 +1286,16 @@ ) ;; definition for method 3 of type kill-nearby-enemies-info -(defmethod inspect kill-nearby-enemies-info ((obj kill-nearby-enemies-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect kill-nearby-enemies-info ((this kill-nearby-enemies-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) - (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tpos: #~%" (-> this pos)) (label cfg-4) - obj + this ) ;; definition for symbol *kill-nearby-enemies-info*, type kill-nearby-enemies-info @@ -1487,7 +1485,7 @@ (the-as game-save #f) (the-as string #f) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sleep-code) 0 (none) @@ -1675,7 +1673,7 @@ (ja-channel-set! 0) (ja-post) (let ((s5-3 (current-time))) - (until (>= (- (current-time) s5-3) (seconds 2)) + (until (time-elapsed? s5-3 (seconds 2)) (suspend) ) ) @@ -1752,7 +1750,7 @@ (ja :num! (seek!)) ) (while (not (or (logtest? (-> self control status) (collide-status on-surface)) - (>= (- (current-time) (-> self state-time)) (seconds 2)) + (time-elapsed? (-> self state-time) (seconds 2)) ) ) (suspend) @@ -1790,7 +1788,7 @@ (ja :num! (seek!)) ) (let ((s5-7 (current-time))) - (until (>= (- (current-time) s5-7) (seconds 2)) + (until (time-elapsed? s5-7 (seconds 2)) (suspend) ) ) @@ -1843,7 +1841,7 @@ (ja-channel-set! 0) (ja-post) (let ((s5-10 (current-time))) - (until (>= (- (current-time) s5-10) (seconds 2)) + (until (time-elapsed? s5-10 (seconds 2)) (suspend) ) ) @@ -1863,7 +1861,7 @@ (ja-channel-set! 0) (ja-post) (let ((s5-11 (current-time))) - (until (>= (- (current-time) s5-11) (seconds 1.2)) + (until (time-elapsed? s5-11 (seconds 1.2)) (suspend) ) ) @@ -1905,7 +1903,7 @@ (ja-channel-push! 1 (seconds 0.3)) (ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.8)) + (until (time-elapsed? gp-1 (seconds 0.8)) (when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2)) (set! v1-24 'target-hit-ground-hard) (goto cfg-17) @@ -1951,7 +1949,7 @@ (ja :num! (seek!)) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 2)) + (until (time-elapsed? gp-2 (seconds 2)) (suspend) ) ) @@ -2044,7 +2042,7 @@ (ja :num! (seek!)) ) (let ((s5-13 (current-time))) - (until (>= (- (current-time) s5-13) (seconds 2)) + (until (time-elapsed? s5-13 (seconds 2)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc index d081f4c2ab..9a01391056 100644 --- a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc @@ -208,7 +208,7 @@ (set! (-> self gun top-anim-twist-reset) (the-as uint 0)) (set! (-> gp-0 gun-type) (pickup-type eco-yellow)) (target-gun-type-set! arg0) - (set! (-> gp-0 gun-get-on-time) (current-time)) + (set-time! (-> gp-0 gun-get-on-time)) ) (set! (-> self board latch?) #f) (set! (-> self gun put-away?) #f) @@ -1191,7 +1191,7 @@ (logclear! (-> self gun track?) (gun-track-flags gutflags-3)) ) (let ((gp-0 (the-as basic #f))) - (when (and (or (< (- (current-time) (-> self control time-of-last-nonzero-input)) (seconds 0.2)) + (when (and (or (not (time-elapsed? (-> self control time-of-last-nonzero-input) (seconds 0.2))) (and (logtest? (-> self control mod-surface flags) (surface-flag air)) (not (logtest? (-> self control status) (collide-status on-surface))) ) @@ -1273,9 +1273,9 @@ (the-as focus (-> self gun track-target)) (the-as process-focusable gp-0) ) - (set! (-> self gun track-start-time) (current-time)) - (if (< (- (current-time) (-> self control time-of-last-nonzero-input)) (seconds 0.2)) - (set! (-> self gun track-press-start-time) (current-time)) + (set-time! (-> self gun track-start-time)) + (if (not (time-elapsed? (-> self control time-of-last-nonzero-input) (seconds 0.2))) + (set-time! (-> self gun track-press-start-time)) ) ) (if (logtest? (process-mask enemy guard) (-> (the-as process-focusable gp-0) mask)) @@ -1478,7 +1478,7 @@ ) (set! (-> self gun top-anim-low-high) 1.0) (if (zero? (-> self gun fire-pending)) - (set! (-> self gun fire-time) (current-time)) + (set-time! (-> self gun fire-time)) ) ) (((pickup-type eco-blue)) @@ -1532,14 +1532,12 @@ (if (!= (not (logtest? (-> self game features) (game-feature gun))) (not (-> self gun gun))) (target-gun-setup (logtest? (-> self game features) (game-feature gun))) ) - (if (and (>= (- (current-time) (-> self gun combo-window-start)) (seconds 0.7)) - (zero? (-> self gun fire-pending)) - ) + (if (and (time-elapsed? (-> self gun combo-window-start) (seconds 0.7)) (zero? (-> self gun fire-pending))) (set! (-> self gun combo-window-state) #f) ) (cond ((and (cpad-pressed? (-> self control cpad number) r1) - (< (- (current-time) (-> self gun combo-window-start)) (seconds 0.7)) + (not (time-elapsed? (-> self gun combo-window-start) (seconds 0.7))) (not (focus-test? self mech dark)) (not (logtest? (surface-flag gun-off) (-> self control current-surface flags))) (not (logtest? (state-flags prevent-gun) (-> self state-flags))) @@ -1577,7 +1575,7 @@ (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) - (set! (-> self gun fire-pending-time) (current-time)) + (set-time! (-> self gun fire-pending-time)) (target-gun-combo-start 20 (seconds 0.4)) (send-event self 'gun-combo #t) (case (-> self gun combo-window-state) @@ -1605,7 +1603,7 @@ (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) - (set! (-> self gun fire-pending-time) (current-time)) + (set-time! (-> self gun fire-pending-time)) (target-top-anim-base-mode 60) (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) (set! (-> self gun turn-fast-hold-time) (+ (current-time) (seconds 0.2))) @@ -1619,7 +1617,7 @@ (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) - (set! (-> self gun fire-pending-time) (current-time)) + (set-time! (-> self gun fire-pending-time)) ) ) ) @@ -1796,7 +1794,7 @@ ((and (logtest? (-> self gun track?) (gun-track-flags gutflags-0)) (logtest? (process-mask enemy guard) (-> (handle->process (-> self gun track-target 0 handle)) mask)) ) - (if (and (< (- (current-time) (-> self gun track-press-start-time)) (seconds 0.5)) + (if (and (not (time-elapsed? (-> self gun track-press-start-time) (seconds 0.5))) (< (-> self control time-between-zero-inputs) (seconds 0.5)) (and (= (-> self control turn-to-magnitude) 0.0) (not (logtest? (-> self control current-surface flags) (surface-flag air attack))) @@ -1877,7 +1875,7 @@ ) ) (set! (-> self gun upper-body track-mode) (the-as track-mode (-> self gun track?))) - (when (< (- (current-time) (-> self gun fire-time)) (seconds 1.5)) + (when (not (time-elapsed? (-> self gun fire-time) (seconds 1.5))) (let ((v1-459 (-> self neck))) (set! (-> v1-459 blend) 0.0) ) @@ -1943,7 +1941,7 @@ jakb-gun-stance-yellow-low-ja ) (else - (when (and (>= (- (current-time) (-> self gun fire-time)) (seconds 1.5)) + (when (and (time-elapsed? (-> self gun fire-time) (seconds 1.5)) (let ((v1-50 (-> self skel top-anim frame-group))) (or (= v1-50 jakb-gun-yellow-highlow-ja) (= v1-50 jakb-gun-stance-yellow-ja)) ) @@ -1990,8 +1988,8 @@ jakb-gun-stance-ja ) (else - (when (and (or (>= (- (current-time) (-> self gun fire-time)) (seconds 2.5)) - (and (< 4096.0 (-> self control ctrl-xz-vel)) (>= (- (current-time) (-> self gun fire-time)) (seconds 1.25))) + (when (and (or (time-elapsed? (-> self gun fire-time) (seconds 2.5)) + (and (< 4096.0 (-> self control ctrl-xz-vel)) (time-elapsed? (-> self gun fire-time) (seconds 1.25))) ) (let ((v1-104 (-> self skel top-anim frame-group))) (or (= v1-104 jakb-gun-stance-red-sideways-ja) @@ -2021,7 +2019,7 @@ (let ((v1-119 (ja-group))) (cond ((and (and v1-119 (or (= v1-119 self) (= v1-119 jakb-gun-walk-side-ja))) - (and (< (-> self gun top-anim-low-high) 0.5) (>= (- (current-time) (-> self gun fire-time)) (seconds 0.2))) + (and (< (-> self gun top-anim-low-high) 0.5) (time-elapsed? (-> self gun fire-time) (seconds 0.2))) ) (let ((s5-2 (get-channel (-> self skel top-anim) 0))) (set! gp-0 (if (< 0.9 (-> self control unknown-float002)) @@ -2162,7 +2160,7 @@ ) (set! (-> self gun active?) (and (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> self control current-surface flags))) - (and (>= (- (current-time) (-> self gun gun-get-on-time)) (seconds 0.1)) + (and (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) (>= (current-time) (-> self gun surpress-time)) (let ((v1-35 (-> self skel top-anim frame-group)) (f0-13 (-> self skel top-anim frame-num)) @@ -2230,19 +2228,19 @@ ) ) (if (-> self gun active?) - (set! (-> self gun active-time) (current-time)) + (set-time! (-> self gun active-time)) ) (set! (-> self gun laser-active?) (not (logtest? (surface-flag gun-inactive gun-hide gun-off laser-hide) (-> self control current-surface flags)) ) ) (when (and (not (and (not (logtest? (surface-flag gun-inactive gun-hide gun-off) (-> self control current-surface flags))) - (>= (- (current-time) (-> self gun gun-get-on-time)) (seconds 0.1)) + (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) (>= (current-time) (-> self gun surpress-time)) ) ) - (and (>= (- (current-time) (-> self gun fire-pending-time)) (seconds 0.2)) - (>= (- (current-time) (-> self gun active-time)) (seconds 0.2)) + (and (time-elapsed? (-> self gun fire-pending-time) (seconds 0.2)) + (time-elapsed? (-> self gun active-time) (seconds 0.2)) (= (-> self gun fire-pending) 1) ) ) @@ -2306,7 +2304,7 @@ ) ) ) - (>= (- (current-time) (-> self gun gun-get-on-time)) (seconds 0.1)) + (time-elapsed? (-> self gun gun-get-on-time) (seconds 0.1)) (let ((v1-110 (-> self skel top-anim frame-targ))) (or (not v1-110) (= v1-110 jakb-gun-side-jump-ja) @@ -2484,7 +2482,7 @@ ) (set! (-> self gun top-anim-low-high) 0.0) ) - ((and (rand-vu-percent? 0.2) (< (- (current-time) (-> self gun fire-time)) (seconds 2))) + ((and (rand-vu-percent? 0.2) (not (time-elapsed? (-> self gun fire-time) (seconds 2)))) (push-anim-to-targ (-> self skel top-anim) (the-as art-joint-anim jakb-gun-dark-fire-twirl-ja) @@ -2500,7 +2498,7 @@ ) ) ((and (or (rand-vu-percent? 0.2) (= (-> self skel top-anim frame-targ) jakb-gun-red-fire-ja)) - (< (- (current-time) (-> self gun fire-time)) (seconds 2)) + (not (time-elapsed? (-> self gun fire-time) (seconds 2))) ) (push-anim-to-targ (-> self skel top-anim) @@ -2601,23 +2599,23 @@ (set! (-> gp-0 combo-window-state) 'target-attack-air) ) (if (cpad-pressed? (-> self control cpad number) r1) - (set! (-> gp-0 fire-start-time) (current-time)) + (set-time! (-> gp-0 fire-start-time)) ) (case (-> gp-0 gun-control) ((1) (when (and (cpad-pressed? (-> self control cpad number) r1) (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) ) - (set! (-> gp-0 fire-pending-time) (current-time)) + (set-time! (-> gp-0 fire-pending-time)) (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) (set! (-> gp-0 fire-charge) 0.5) ) - (when (and (or (>= (- (current-time) (-> gp-0 fire-time)) (the-as time-frame (-> gp-0 fire-delay))) + (when (and (or (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) (case (-> gp-0 combo-window-state) (('target-attack-air 'target-attack 'target-running-attack) - (>= (- (current-time) (-> gp-0 fire-time)) (the-as time-frame (-> gp-0 combo-fire-delay))) + (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 combo-fire-delay))) ) ) ) @@ -2627,7 +2625,7 @@ (seekl! (-> self gun fire-pending) 0 1) (cond ((send-event self 'gun (-> gp-0 gun-type)) - (set! (-> self gun fire-time) (current-time)) + (set-time! (-> self gun fire-time)) ) (else (set! (-> self gun fire-time) 0) @@ -2643,20 +2641,20 @@ (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) ) ) - (set! (-> gp-0 fire-pending-time) (current-time)) + (set-time! (-> gp-0 fire-pending-time)) (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) (set! (-> gp-0 fire-charge) 0.5) ) - (when (and (>= (- (current-time) (-> gp-0 fire-time)) (the-as time-frame (-> gp-0 fire-delay))) + (when (and (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) (> (-> gp-0 fire-pending) 0) (-> self gun active?) ) (seekl! (-> self gun fire-pending) 0 1) (cond ((send-event self 'gun (-> gp-0 gun-type)) - (set! (-> self gun fire-time) (current-time)) + (set-time! (-> self gun fire-time)) ) (else (set! (-> self gun fire-time) 0) @@ -2718,20 +2716,20 @@ (-> self gun active?) (< (the-as time-frame (+ (-> gp-0 fire-delay) -30)) (- (current-time) (-> gp-0 fire-time))) ) - (set! (-> gp-0 fire-pending-time) (current-time)) + (set-time! (-> gp-0 fire-pending-time)) (if (zero? (-> self gun fire-pending)) (+! (-> self gun fire-pending) 1) ) (set! (-> gp-0 fire-charge) 0.5) ) - (when (and (>= (- (current-time) (-> gp-0 fire-time)) (the-as time-frame (-> gp-0 fire-delay))) + (when (and (time-elapsed? (-> gp-0 fire-time) (the-as time-frame (-> gp-0 fire-delay))) (> (-> gp-0 fire-pending) 0) (-> self gun active?) ) (seekl! (-> self gun fire-pending) 0 1) (cond ((send-event self 'gun (-> gp-0 gun-type)) - (set! (-> self gun fire-time) (current-time)) + (set-time! (-> self gun fire-time)) ) (else (set! (-> self gun fire-time) 0) @@ -2770,7 +2768,7 @@ ) ) ) - (set! (-> gp-0 gun-time) (current-time)) + (set-time! (-> gp-0 gun-time)) ) ) 0 diff --git a/test/decompiler/reference/jak2/engine/target/target-h_REF.gc b/test/decompiler/reference/jak2/engine/target/target-h_REF.gc index 401283b75c..fd686f76e4 100644 --- a/test/decompiler/reference/jak2/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-h_REF.gc @@ -238,80 +238,80 @@ ) ;; definition for method 3 of type target -(defmethod inspect target ((obj target)) - (when (not obj) - (set! obj obj) +(defmethod inspect target ((this target)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcontrol: ~A~%" (-> obj control)) - (format #t "~2Tskel2: ~A~%" (-> obj skel2)) - (format #t "~2Tshadow-backup: ~A~%" (-> obj shadow-backup)) - (format #t "~2Ttarget-flags: ~D~%" (-> obj state-flags)) - (format #t "~2Tgame: ~A~%" (-> obj game)) - (format #t "~2Tneck: ~A~%" (-> obj neck)) - (format #t "~2Thead: ~A~%" (-> obj head)) - (format #t "~2Tupper-body: ~A~%" (-> obj upper-body)) - (format #t "~2Thorns: ~A~%" (-> obj horns)) - (format #t "~2Thair[2] @ #x~X~%" (-> obj hair)) - (format #t "~2Tdarkjak-interp: ~f~%" (-> obj darkjak-interp)) - (format #t "~2Tdarkjak-giant-interp: ~f~%" (-> obj darkjak-giant-interp)) - (format #t "~2Tarm-ik[2] @ #x~X~%" (-> obj arm-ik)) - (format #t "~2Tleg-ik[2] @ #x~X~%" (-> obj leg-ik)) - (format #t "~2Tfoot[2] @ #x~X~%" (-> obj foot)) - (format #t "~2Tinit-time: ~D~%" (-> obj init-time)) - (format #t "~2Tteleport-time: ~D~%" (-> obj teleport-time)) - (format #t "~2Tstate-hook-time: ~D~%" (-> obj state-hook-time)) - (format #t "~2Tstate-hook: ~A~%" (-> obj state-hook)) - (format #t "~2Tcam-user-mode: ~A~%" (-> obj cam-user-mode)) - (format #t "~2Tsidekick: #x~X~%" (-> obj sidekick)) - (format #t "~2Tmanipy: #x~X~%" (-> obj manipy)) - (format #t "~2Tmirror: #x~X~%" (-> obj mirror)) - (format #t "~2Tattack-info: #~%" (-> obj attack-info)) - (format #t "~2Tattack-info-rec: #~%" (-> obj attack-info-rec)) - (format #t "~2Tattack-info-old[8] @ #x~X~%" (-> obj attack-info-old)) - (format #t "~2Tanim-seed: ~D~%" (-> obj anim-seed)) - (format #t "~2Talt-cam-pos: ~`vector`P~%" (-> obj alt-cam-pos)) - (format #t "~2Tcurrent-level: ~A~%" (-> obj current-level)) - (format #t "~2Tsaved-pos: #~%" (-> obj saved-pos)) - (format #t "~2Tsaved-owner: ~D~%" (-> obj saved-owner)) - (format #t "~2Talt-neck-pos: ~`vector`P~%" (-> obj alt-neck-pos)) - (format #t "~2Tfocus-search: ~A~%" (-> obj focus-search)) - (format #t "~2Texcitement: ~f~%" (-> obj excitement)) - (format #t "~2Tshock-effect-time: ~D~%" (-> obj shock-effect-time)) - (format #t "~2Tbeard?: ~A~%" (-> obj beard?)) - (format #t "~2Tspool-anim: ~A~%" (-> obj spool-anim)) - (format #t "~2Tambient-time: ~D~%" (-> obj ambient-time)) - (format #t "~2Tfp-hud: ~D~%" (-> obj fp-hud)) - (format #t "~2Tno-load-wait: ~D~%" (-> obj no-load-wait)) - (format #t "~2Tno-look-around-wait: ~D~%" (-> obj no-look-around-wait)) - (format #t "~2Tburn-proc: ~D~%" (-> obj burn-proc)) - (format #t "~2Tpre-joint-hook: ~A~%" (-> obj pre-joint-hook)) - (format #t "~2Tnotify: ~D~%" (-> obj notify)) - (format #t "~2Tmode-cache: ~A~%" (-> obj mode-cache)) - (format #t "~2Tmode-param1: ~D~%" (-> obj mode-param1)) - (format #t "~2Tmode-param2: ~A~%" (-> obj mode-param2)) - (format #t "~2Tmode-param3: ~A~%" (-> obj mode-param3)) - (format #t "~2Ttobot-state: ~A~%" (-> obj tobot-state)) - (format #t "~2Ttobot?: ~A~%" (-> obj tobot?)) - (format #t "~2Ttobot-recorder: ~A~%" (-> obj tobot-recorder)) - (format #t "~2Tcolor-effect: ~A~%" (-> obj color-effect)) - (format #t "~2Tcolor-effect-start-time: ~D~%" (-> obj color-effect-start-time)) - (format #t "~2Tcolor-effect-duration: ~D~%" (-> obj color-effect-duration)) - (format #t "~2Tracer: ~A~%" (-> obj racer)) - (format #t "~2Ttube: ~A~%" (-> obj tube)) - (format #t "~2Tflut: ~A~%" (-> obj flut)) - (format #t "~2Tboard: ~A~%" (-> obj board)) - (format #t "~2Tpilot: ~A~%" (-> obj pilot)) - (format #t "~2Tgun: ~A~%" (-> obj gun)) - (format #t "~2Tmech: ~A~%" (-> obj mech)) - (format #t "~2Tturret: ~A~%" (-> obj turret)) - (format #t "~2Tdarkjak: ~A~%" (-> obj darkjak)) - (format #t "~2Tindax: ~A~%" (-> obj indax)) + (format #t "~2Tcontrol: ~A~%" (-> this control)) + (format #t "~2Tskel2: ~A~%" (-> this skel2)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Ttarget-flags: ~D~%" (-> this state-flags)) + (format #t "~2Tgame: ~A~%" (-> this game)) + (format #t "~2Tneck: ~A~%" (-> this neck)) + (format #t "~2Thead: ~A~%" (-> this head)) + (format #t "~2Tupper-body: ~A~%" (-> this upper-body)) + (format #t "~2Thorns: ~A~%" (-> this horns)) + (format #t "~2Thair[2] @ #x~X~%" (-> this hair)) + (format #t "~2Tdarkjak-interp: ~f~%" (-> this darkjak-interp)) + (format #t "~2Tdarkjak-giant-interp: ~f~%" (-> this darkjak-giant-interp)) + (format #t "~2Tarm-ik[2] @ #x~X~%" (-> this arm-ik)) + (format #t "~2Tleg-ik[2] @ #x~X~%" (-> this leg-ik)) + (format #t "~2Tfoot[2] @ #x~X~%" (-> this foot)) + (format #t "~2Tinit-time: ~D~%" (-> this init-time)) + (format #t "~2Tteleport-time: ~D~%" (-> this teleport-time)) + (format #t "~2Tstate-hook-time: ~D~%" (-> this state-hook-time)) + (format #t "~2Tstate-hook: ~A~%" (-> this state-hook)) + (format #t "~2Tcam-user-mode: ~A~%" (-> this cam-user-mode)) + (format #t "~2Tsidekick: #x~X~%" (-> this sidekick)) + (format #t "~2Tmanipy: #x~X~%" (-> this manipy)) + (format #t "~2Tmirror: #x~X~%" (-> this mirror)) + (format #t "~2Tattack-info: #~%" (-> this attack-info)) + (format #t "~2Tattack-info-rec: #~%" (-> this attack-info-rec)) + (format #t "~2Tattack-info-old[8] @ #x~X~%" (-> this attack-info-old)) + (format #t "~2Tanim-seed: ~D~%" (-> this anim-seed)) + (format #t "~2Talt-cam-pos: ~`vector`P~%" (-> this alt-cam-pos)) + (format #t "~2Tcurrent-level: ~A~%" (-> this current-level)) + (format #t "~2Tsaved-pos: #~%" (-> this saved-pos)) + (format #t "~2Tsaved-owner: ~D~%" (-> this saved-owner)) + (format #t "~2Talt-neck-pos: ~`vector`P~%" (-> this alt-neck-pos)) + (format #t "~2Tfocus-search: ~A~%" (-> this focus-search)) + (format #t "~2Texcitement: ~f~%" (-> this excitement)) + (format #t "~2Tshock-effect-time: ~D~%" (-> this shock-effect-time)) + (format #t "~2Tbeard?: ~A~%" (-> this beard?)) + (format #t "~2Tspool-anim: ~A~%" (-> this spool-anim)) + (format #t "~2Tambient-time: ~D~%" (-> this ambient-time)) + (format #t "~2Tfp-hud: ~D~%" (-> this fp-hud)) + (format #t "~2Tno-load-wait: ~D~%" (-> this no-load-wait)) + (format #t "~2Tno-look-around-wait: ~D~%" (-> this no-look-around-wait)) + (format #t "~2Tburn-proc: ~D~%" (-> this burn-proc)) + (format #t "~2Tpre-joint-hook: ~A~%" (-> this pre-joint-hook)) + (format #t "~2Tnotify: ~D~%" (-> this notify)) + (format #t "~2Tmode-cache: ~A~%" (-> this mode-cache)) + (format #t "~2Tmode-param1: ~D~%" (-> this mode-param1)) + (format #t "~2Tmode-param2: ~A~%" (-> this mode-param2)) + (format #t "~2Tmode-param3: ~A~%" (-> this mode-param3)) + (format #t "~2Ttobot-state: ~A~%" (-> this tobot-state)) + (format #t "~2Ttobot?: ~A~%" (-> this tobot?)) + (format #t "~2Ttobot-recorder: ~A~%" (-> this tobot-recorder)) + (format #t "~2Tcolor-effect: ~A~%" (-> this color-effect)) + (format #t "~2Tcolor-effect-start-time: ~D~%" (-> this color-effect-start-time)) + (format #t "~2Tcolor-effect-duration: ~D~%" (-> this color-effect-duration)) + (format #t "~2Tracer: ~A~%" (-> this racer)) + (format #t "~2Ttube: ~A~%" (-> this tube)) + (format #t "~2Tflut: ~A~%" (-> this flut)) + (format #t "~2Tboard: ~A~%" (-> this board)) + (format #t "~2Tpilot: ~A~%" (-> this pilot)) + (format #t "~2Tgun: ~A~%" (-> this gun)) + (format #t "~2Tmech: ~A~%" (-> this mech)) + (format #t "~2Tturret: ~A~%" (-> this turret)) + (format #t "~2Tdarkjak: ~A~%" (-> this darkjak)) + (format #t "~2Tindax: ~A~%" (-> this indax)) (label cfg-4) - obj + this ) ;; definition (perm) for symbol *target*, type target @@ -339,25 +339,25 @@ ) ;; definition for method 3 of type sidekick -(defmethod inspect sidekick ((obj sidekick)) - (when (not obj) - (set! obj obj) +(defmethod inspect sidekick ((this sidekick)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcontrol: ~A~%" (-> obj root)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tanim-seed: ~D~%" (-> obj anim-seed)) - (format #t "~2Tshadow-in-movie?: ~A~%" (-> obj shadow-in-movie?)) - (format #t "~2Tspecial-anim-time: ~D~%" (-> obj special-anim-time)) - (format #t "~2Tspecial-anim-interp: ~f~%" (-> obj special-anim-interp)) - (format #t "~2Tspecial-anim-frame: ~f~%" (-> obj special-anim-frame)) - (format #t "~2Toffset: #~%" (-> obj offset)) - (format #t "~2Tmirror: #x~X~%" (-> obj mirror)) + (format #t "~2Tcontrol: ~A~%" (-> this root)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tanim-seed: ~D~%" (-> this anim-seed)) + (format #t "~2Tshadow-in-movie?: ~A~%" (-> this shadow-in-movie?)) + (format #t "~2Tspecial-anim-time: ~D~%" (-> this special-anim-time)) + (format #t "~2Tspecial-anim-interp: ~f~%" (-> this special-anim-interp)) + (format #t "~2Tspecial-anim-frame: ~f~%" (-> this special-anim-frame)) + (format #t "~2Toffset: #~%" (-> this offset)) + (format #t "~2Tmirror: #x~X~%" (-> this mirror)) (label cfg-4) - obj + this ) ;; definition (perm) for symbol *sidekick*, type sidekick diff --git a/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc b/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc index 0c14d9fd80..a1d79266cb 100644 --- a/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-handler_REF.gc @@ -274,7 +274,7 @@ ) (when sv-96 (set! (-> self control send-attack-dest) (process->handle arg0)) - (set! (-> self control send-attack-time) (current-time)) + (set-time! (-> self control send-attack-time)) (send-event self 'hit arg1 arg0 arg2) (set! arg0 (and (and (focus-test? self dark) (nonzero? (-> self darkjak)) @@ -326,7 +326,7 @@ ) ) ) - (< (- (current-time) s3-0) (seconds 15)) + (not (time-elapsed? s3-0 (seconds 15))) (not (logtest? (-> (the-as process-focusable (-> gp-0 0)) draw status) (draw-control-status no-draw no-draw-temp)) ) ) @@ -355,10 +355,10 @@ ) ) (send-event (ppointer->process gp-0) 'color-effect 'dark (seconds 0.2)) - (when (>= (- (current-time) (the-as time-frame s4-0)) (seconds 0.05)) + (when (time-elapsed? (the-as time-frame s4-0) (seconds 0.05)) (set! s4-0 (the-as int (current-time))) (cond - ((and (< (- (current-time) s3-0) (seconds 0.5)) (handle->process arg0)) + ((and (not (time-elapsed? s3-0 (seconds 0.5))) (handle->process arg0)) (process-drawable2-shock-effect (the-as process-drawable (handle->process arg0)) (the-as process-drawable (ppointer->process gp-0)) @@ -644,7 +644,7 @@ (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.2)) ) ((= v1-37 'darkjak) - (set! (-> self darkjak attack-time) (current-time)) + (set-time! (-> self darkjak attack-time)) (let* ((v1-160 *game-info*) (a0-102 (+ (-> v1-160 attack-id) 1)) ) @@ -823,7 +823,7 @@ ) (('color-effect) (set! (-> self color-effect) (the-as basic (-> arg3 param 0))) - (set! (-> self color-effect-start-time) (current-time)) + (set-time! (-> self color-effect-start-time)) (set! v0-0 (-> arg3 param 1)) (set! (-> self color-effect-duration) (the-as uint v0-0)) v0-0 @@ -1105,7 +1105,7 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> v1-15 quad) vf1) ) - (set! (-> self control additional-decaying-velocity-end-time) (current-time)) + (set-time! (-> self control additional-decaying-velocity-end-time)) (set! (-> self control additional-decaying-velocity-decay-start-time) (+ (current-time) (the-as time-frame (-> arg3 param 1))) ) @@ -1114,7 +1114,7 @@ (label cfg-23) (b! (!= v1-0 'push-transv) cfg-25 :delay (nop!)) (set! (-> self control additional-decaying-velocity quad) (-> (the-as vector (-> arg3 param 0)) quad)) - (set! (-> self control additional-decaying-velocity-end-time) (current-time)) + (set-time! (-> self control additional-decaying-velocity-end-time)) (set! (-> self control additional-decaying-velocity-decay-start-time) (+ (current-time) (the-as time-frame (-> arg3 param 1))) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-part_REF.gc b/test/decompiler/reference/jak2/engine/target/target-part_REF.gc index 5003f68597..322f51da61 100644 --- a/test/decompiler/reference/jak2/engine/target/target-part_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-part_REF.gc @@ -2249,7 +2249,7 @@ ) (set! (-> s5-1 quad) (-> (the-as process-drawable (-> s4-1 0)) draw color-mult quad)) (let ((s2-1 (vector-float*! (the-as vector (new 'stack 'rgbaf)) (the-as vector s5-1) 0.0))) - (while (< (- (current-time) s3-0) arg0) + (while (not (time-elapsed? s3-0 arg0)) (let ((v1-8 (- (current-time) s3-0))) (if (< v1-8 (the-as time-frame (/ arg0 2))) (vector-lerp! @@ -2653,7 +2653,7 @@ (set! (-> v1-29 action-mask) (collide-action solid)) ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-688) 0.0) - (set! (-> s5-0 last-valid-time) (current-time)) + (set-time! (-> s5-0 last-valid-time)) (set! (-> s5-0 src-joint-index) (the-as uint sv-656)) (set! (-> s5-0 end-pos quad) (-> sv-688 best-other-tri intersect quad)) (when (< 8192.0 (vector-vector-distance (-> s5-0 end-pos) (-> sv-688 start-pos))) diff --git a/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc b/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc index 45ea96c670..a0c940f504 100644 --- a/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-swim_REF.gc @@ -5,7 +5,7 @@ (defstate target-wade-stance (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *wade-mods*) (set-zero! (-> self water bob)) ) @@ -20,7 +20,7 @@ :trans (behavior () ((-> self state-hook)) (when (and (not (logtest? (water-flags wading) (-> self water flags))) - (>= (- (current-time) (-> self water wade-time)) (seconds 0.05)) + (time-elapsed? (-> self water wade-time) (seconds 0.05)) ) (if (logtest? (water-flags swimming) (-> self water flags)) (go target-swim-stance) @@ -73,7 +73,7 @@ :trans (behavior () ((-> self state-hook)) (when (and (not (logtest? (water-flags wading) (-> self water flags))) - (>= (- (current-time) (-> self water wade-time)) (seconds 0.1)) + (time-elapsed? (-> self water wade-time) (seconds 0.1)) ) (if (logtest? (water-flags swimming) (-> self water flags)) (go target-swim-stance) @@ -283,7 +283,7 @@ (ja :chan 2 :num! (chan 0)) (ja :chan 3 :num! (chan 0)) (ja :chan 4 :num! (chan 0)) - (when (and (>= (- (current-time) (the-as time-frame gp-6)) (seconds 0.2)) + (when (and (time-elapsed? (the-as time-frame gp-6) (seconds 0.2)) (< (- (-> self water height) (-> self control trans y)) 4096.0) ) (case (the int (ja-aframe-num 0)) @@ -355,7 +355,7 @@ (defstate target-swim-stance (target) :event target-standard-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *swim-mods*) (logior! (-> self water flags) (water-flags swim-ground)) (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik)) @@ -400,7 +400,7 @@ (set-zero! (-> self water bob)) ) (when (and (not (logtest? (water-flags swimming) (-> self water flags))) - (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (if (logtest? (water-flags wading) (-> self water flags)) (go target-wade-stance) @@ -415,7 +415,7 @@ (pad-buttons x) ) (can-jump? #f) - (>= (- (current-time) (-> self water enter-swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) ) (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) ) @@ -518,7 +518,7 @@ (set-zero! (-> self water bob)) ) (when (and (not (logtest? (water-flags swimming) (-> self water flags))) - (>= (- (current-time) (-> self water swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water swim-time) (seconds 0.1)) ) (if (logtest? (water-flags wading) (-> self water flags)) (go target-wade-stance) @@ -533,7 +533,7 @@ (pad-buttons x) ) (can-jump? #f) - (>= (- (current-time) (-> self water enter-swim-time)) (seconds 0.1)) + (time-elapsed? (-> self water enter-swim-time) (seconds 0.1)) ) (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) ) @@ -552,7 +552,7 @@ ) (cond ((= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0) - (if (>= (the-as uint (- (current-time) (the-as int (-> self control unknown-word04)))) (the-as uint 15)) + (if (time-elapsed? (the-as int (-> self control unknown-word04)) (seconds 0.05)) (go target-swim-stance) ) ) @@ -654,13 +654,13 @@ (target-standard-event-handler proc argc message block) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self state-flags) (state-flags lleg-no-ik rleg-no-ik)) (logclear! (-> self water flags) (water-flags swim-ground)) (set! (-> self control mod-surface) *dive-mods*) (set! (-> self control dynam gravity-max) 16384.0) (set! (-> self control dynam gravity-length) 16384.0) - (set! (-> self water swim-time) (current-time)) + (set-time! (-> self water swim-time)) (set! (-> self control unknown-word04) (the-as uint #f)) (set! (-> self neck flex-blend) 0.0) ) @@ -698,11 +698,11 @@ (set! (-> self neck flex-blend) 1.0) ) :trans (behavior () - (if (>= (- (current-time) (-> self water swim-time)) (seconds 0.5)) + (if (time-elapsed? (-> self water swim-time) (seconds 0.5)) (go target-stance) ) (cond - ((>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.1)) + ((time-elapsed? (-> self control last-time-on-surface) (seconds 0.1)) (set! (-> self control mod-surface) *dive-mods*) (if (and (-> self next-state) (= (-> self next-state name) 'target-swim-down)) (target-swim-tilt -0.9 1.0 0.0 0.5) @@ -783,21 +783,21 @@ ) ) (until #f - (when (and (!= (-> self tobot?) 'tobot) (>= (- (current-time) (-> self state-time)) (seconds 0.05))) + (when (and (!= (-> self tobot?) 'tobot) (time-elapsed? (-> self state-time) (seconds 0.05))) (if (and (or (not (cpad-hold? (-> self control cpad number) circle square)) (-> self control unknown-spool-anim00)) - (>= (- (current-time) (-> self state-time)) gp-0) + (time-elapsed? (-> self state-time) gp-0) ) (go target-swim-up) ) - (if (or (>= (- (current-time) (-> self control unknown-time-frame27)) s5-0) + (if (or (time-elapsed? (-> self control unknown-time-frame27) s5-0) (and (logtest? (-> self control status) (collide-status on-surface)) - (and (< (-> self water swim-depth) 8192.0) (>= (- (current-time) (-> self state-time)) gp-0)) + (and (< (-> self water swim-depth) 8192.0) (time-elapsed? (-> self state-time) gp-0)) ) ) (go target-swim-up) ) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (sound-play "water-bubbles" :id (-> self control bubbles-sound)) ) (let ((s4-3 (new-stack-vector0)) @@ -845,17 +845,17 @@ (the-as surface #f) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 10)) + (if (and (time-elapsed? (-> self state-time) (seconds 10)) (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) ) (send-event self 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'drown-death)))) ) (if (and (cpad-pressed? (-> self control cpad number) circle square) - (or (< (- (current-time) (-> self control unknown-time-frame27)) (seconds 10)) + (or (not (time-elapsed? (-> self control unknown-time-frame27) (seconds 10))) (logtest? (-> self control status) (collide-status touch-ceiling)) ) (and (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) - (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) ) ) (go target-swim-down) @@ -938,7 +938,7 @@ #f (label cfg-51) (logior! (-> self water flags) (water-flags swim-ground)) - (set! (-> self water swim-time) (current-time)) + (set-time! (-> self water swim-time)) (start-bobbing! (-> self water) -4096.0 600 1500) (set! (-> self water bob start-time) (+ (current-time) (seconds -0.05))) (go target-swim-stance) @@ -953,7 +953,7 @@ :exit target-exit :trans (behavior () (cond - ((< (- (current-time) (-> self state-time)) (seconds 0.5)) + ((not (time-elapsed? (-> self state-time) (seconds 0.5))) (logior! (-> self water flags) (water-flags jump-out)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc index 4dc70165ba..da5a251aef 100644 --- a/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-tube_REF.gc @@ -141,31 +141,31 @@ ) ;; definition for method 3 of type tube-info -(defmethod inspect tube-info ((obj tube-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect tube-info ((this tube-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Ttube: ~D~%" (-> obj tube)) - (format #t "~1Tdownhill: ~`vector`P~%" (-> obj downhill)) - (format #t "~1Tcentertube: ~`vector`P~%" (-> obj centertube)) - (format #t "~1Tdowntube: ~`vector`P~%" (-> obj downtube)) - (format #t "~1Tsidetube: ~`vector`P~%" (-> obj sidetube)) - (format #t "~1Tforetube: ~`vector`P~%" (-> obj foretube)) - (format #t "~1Told-transv: ~`vector`P~%" (-> obj old-transv)) - (format #t "~1Tmod-x: ~f~%" (-> obj mod-x)) - (format #t "~1Tmod-y: ~f~%" (-> obj mod-y)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Tturn-anim-targ: ~f~%" (-> obj turn-anim-targ)) - (format #t "~1Tturn-anim-frame: ~f~%" (-> obj turn-anim-frame)) - (format #t "~1Tturn-anim-vel: ~f~%" (-> obj turn-anim-vel)) - (format #t "~1Ttube-sound-id: ~D~%" (-> obj tube-sound-id)) - (format #t "~1Ttube-sound-vol: ~f~%" (-> obj tube-sound-vol)) - (format #t "~1Ttube-sound-pitch: ~f~%" (-> obj tube-sound-pitch)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Ttube: ~D~%" (-> this tube)) + (format #t "~1Tdownhill: ~`vector`P~%" (-> this downhill)) + (format #t "~1Tcentertube: ~`vector`P~%" (-> this centertube)) + (format #t "~1Tdowntube: ~`vector`P~%" (-> this downtube)) + (format #t "~1Tsidetube: ~`vector`P~%" (-> this sidetube)) + (format #t "~1Tforetube: ~`vector`P~%" (-> this foretube)) + (format #t "~1Told-transv: ~`vector`P~%" (-> this old-transv)) + (format #t "~1Tmod-x: ~f~%" (-> this mod-x)) + (format #t "~1Tmod-y: ~f~%" (-> this mod-y)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tturn-anim-targ: ~f~%" (-> this turn-anim-targ)) + (format #t "~1Tturn-anim-frame: ~f~%" (-> this turn-anim-frame)) + (format #t "~1Tturn-anim-vel: ~f~%" (-> this turn-anim-vel)) + (format #t "~1Ttube-sound-id: ~D~%" (-> this tube-sound-id)) + (format #t "~1Ttube-sound-vol: ~f~%" (-> this tube-sound-vol)) + (format #t "~1Ttube-sound-pitch: ~f~%" (-> this tube-sound-pitch)) (label cfg-4) - obj + this ) ;; definition of type tube-bank @@ -177,14 +177,14 @@ ) ;; definition for method 3 of type tube-bank -(defmethod inspect tube-bank ((obj tube-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect tube-bank ((this tube-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "[~8x] ~A~%" this (-> this type)) (label cfg-4) - obj + this ) ;; definition for symbol *TUBE-bank*, type tube-bank @@ -622,7 +622,7 @@ (set! (-> self tube entity) (-> a0-4 entity)) ) ) - (set! (-> self tube start-time) (current-time)) + (set-time! (-> self tube start-time)) (set! (-> self tube tube-sound-id) (new-sound-id)) (set! (-> self tube tube-sound-vol) 0.0) (set! (-> self tube tube-sound-pitch) 0.0) @@ -775,7 +775,7 @@ (defstate target-tube-jump (target) :event (-> target-tube-start event) :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *tube-jump-mods*) @@ -850,9 +850,9 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (let ((gp-0 (-> self attack-info))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (when (not (logtest? (-> arg1 mask) (attack-mask vector))) (vector-! (-> arg1 vector) @@ -901,7 +901,7 @@ (when (= arg0 'attack) (send-event (handle->process (-> self notify)) 'notify 'hit (-> gp-0 mode)) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('bot) (pickup-collectable! (-> self fact) (pickup-type health) -1000.0 (the-as handle #f)) @@ -984,10 +984,10 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'life (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until v1-42 (suspend) - (set! v1-42 (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (movie?)))) + (set! v1-42 (and (time-elapsed? (-> self state-time) (seconds 1)) (not (movie?)))) ) (go target-tube) ) @@ -1013,21 +1013,21 @@ ) ;; definition for method 3 of type slide-control -(defmethod inspect slide-control ((obj slide-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect slide-control ((this slide-control)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttarget: ~D~%" (-> obj target)) - (format #t "~2Tpos: ~f~%" (-> obj pos)) - (format #t "~2Ttrans: ~`vector`P~%" (-> obj trans)) - (format #t "~2Trot: ~`vector`P~%" (-> obj rot)) - (format #t "~2Tside: ~`vector`P~%" (-> obj side)) + (format #t "~2Ttarget: ~D~%" (-> this target)) + (format #t "~2Tpos: ~f~%" (-> this pos)) + (format #t "~2Ttrans: ~`vector`P~%" (-> this trans)) + (format #t "~2Trot: ~`vector`P~%" (-> this rot)) + (format #t "~2Tside: ~`vector`P~%" (-> this side)) (label cfg-4) - obj + this ) ;; definition for function distance-from-tangent @@ -1169,19 +1169,19 @@ ;; definition for method 11 of type slide-control ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! slide-control ((obj slide-control) (arg0 entity-actor)) +(defmethod init-from-entity! slide-control ((this slide-control) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj target) (the-as handle #f)) - (go (method-of-object obj slide-control-watch)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this target) (the-as handle #f)) + (go (method-of-object this slide-control-watch)) (none) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc index fcd1c7f396..7fbc8be0a6 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret-shot_REF.gc @@ -199,17 +199,17 @@ ) ;; definition for method 3 of type turret-shot -(defmethod inspect turret-shot ((obj turret-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect turret-shot ((this turret-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type guard-shot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thit-pos: #~%" (-> obj hit-pos)) + (format #t "~2Thit-pos: #~%" (-> this hit-pos)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -258,7 +258,7 @@ ;; definition for method 25 of type turret-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles turret-shot ((obj turret-shot)) +(defmethod spawn-impact-particles turret-shot ((this turret-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -268,8 +268,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((gp-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) (f30-0 (vector-length s5-1)) ) @@ -318,10 +318,10 @@ ;; definition for method 26 of type turret-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles turret-shot ((obj turret-shot)) +(defmethod spawn-shell-particles turret-shot ((this turret-shot)) "TODO - confirm" - (let* ((root (-> obj root)) - (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> root trans)) 2048.0)) + (let* ((root (-> this root)) + (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> root trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> root trans quad)) @@ -368,7 +368,7 @@ ;; definition for method 28 of type turret-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound turret-shot ((obj turret-shot) (proj-options projectile-options)) +(defmethod play-impact-sound turret-shot ((this turret-shot) (proj-options projectile-options)) (let ((options proj-options)) (cond ((zero? options) @@ -386,23 +386,23 @@ ;; definition for method 31 of type turret-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch projectile-options vs none. -(defmethod init-proj-settings! turret-shot ((obj turret-shot)) +(defmethod init-proj-settings! turret-shot ((this turret-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) + (set! (-> this tail-pos quad) (-> this root trans quad)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) - (set! (-> obj attack-mode) 'turret) - (set! (-> obj max-speed) 1228800.0) - (set! (-> obj move) guard-shot-move) - (set! (-> obj damage) 1.0) - (logior! (-> obj options) (projectile-options deal-damage)) + (set! (-> this attack-mode) 'turret) + (set! (-> this max-speed) 1228800.0) + (set! (-> this move) guard-shot-move) + (set! (-> this damage) 1.0) + (logior! (-> this options) (projectile-options deal-damage)) (none) ) ;; definition for method 30 of type turret-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! turret-shot ((obj turret-shot)) +(defmethod init-proj-collision! turret-shot ((this turret-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -468,9 +468,9 @@ ) (set! (-> cshape max-iteration-count) (the-as uint 1)) (set! (-> cshape event-self) 'touched) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 diff --git a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc index 41df7ab756..94cb661b31 100644 --- a/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-turret_REF.gc @@ -275,25 +275,25 @@ ) ;; definition for method 3 of type hud-turret-health -(defmethod inspect hud-turret-health ((obj hud-turret-health)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-turret-health ((this hud-turret-health)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfade-interp: ~f~%" (-> obj fade-interp)) + (format #t "~2Tfade-interp: ~f~%" (-> this fade-interp)) (label cfg-4) - obj + this ) ;; definition for method 15 of type hud-turret-health ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-turret-health ((obj hud-turret-health)) +(defmethod draw hud-turret-health ((this hud-turret-health)) (with-pp (seek! - (-> obj fade-interp) + (-> this fade-interp) (if (>= (-> *camera-combiner* interp-val) 1.0) 80.0 0.0 @@ -301,35 +301,35 @@ (-> pp clock time-adjust-ratio) ) (dotimes (v1-3 30) - (set! (-> obj sprites v1-3 color w) (the int (* (-> obj fade-interp) (- 1.0 (-> obj offset))))) + (set! (-> this sprites v1-3 color w) (the int (* (-> this fade-interp) (- 1.0 (-> this offset))))) ) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) 44 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites)) 0 44) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites)) 44 44) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 44 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) 0 44) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) 44 44) (dotimes (v1-6 16) - (set! (-> obj sprites (- 19 v1-6) scale-x) (if (< v1-6 (-> obj values 0 current)) - 0.7 - 0.0 - ) + (set! (-> this sprites (- 19 v1-6) scale-x) (if (< v1-6 (-> this values 0 current)) + 0.7 + 0.0 + ) ) ) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites)) 13 6) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites)) 25 10) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites)) 34 19) - (set-as-offset-from! (-> obj sprites 7) (the-as vector4w (-> obj sprites)) 39 32) - (set-as-offset-from! (-> obj sprites 8) (the-as vector4w (-> obj sprites)) 39 47) - (set-as-offset-from! (-> obj sprites 9) (the-as vector4w (-> obj sprites)) 34 59) - (set-as-offset-from! (-> obj sprites 10) (the-as vector4w (-> obj sprites)) 25 67) - (set-as-offset-from! (-> obj sprites 11) (the-as vector4w (-> obj sprites)) 13 71) - (set-as-offset-from! (-> obj sprites 12) (the-as vector4w (-> obj sprites)) -1 71) - (set-as-offset-from! (-> obj sprites 13) (the-as vector4w (-> obj sprites)) -14 67) - (set-as-offset-from! (-> obj sprites 14) (the-as vector4w (-> obj sprites)) -22 59) - (set-as-offset-from! (-> obj sprites 15) (the-as vector4w (-> obj sprites)) -27 47) - (set-as-offset-from! (-> obj sprites 16) (the-as vector4w (-> obj sprites)) -27 32) - (set-as-offset-from! (-> obj sprites 17) (the-as vector4w (-> obj sprites)) -22 19) - (set-as-offset-from! (-> obj sprites 18) (the-as vector4w (-> obj sprites)) -14 10) - (set-as-offset-from! (-> obj sprites 19) (the-as vector4w (-> obj sprites)) -1 6) - (let ((f0-9 (the float (-> obj values 1 current)))) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) 13 6) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites)) 25 10) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites)) 34 19) + (set-as-offset-from! (-> this sprites 7) (the-as vector4w (-> this sprites)) 39 32) + (set-as-offset-from! (-> this sprites 8) (the-as vector4w (-> this sprites)) 39 47) + (set-as-offset-from! (-> this sprites 9) (the-as vector4w (-> this sprites)) 34 59) + (set-as-offset-from! (-> this sprites 10) (the-as vector4w (-> this sprites)) 25 67) + (set-as-offset-from! (-> this sprites 11) (the-as vector4w (-> this sprites)) 13 71) + (set-as-offset-from! (-> this sprites 12) (the-as vector4w (-> this sprites)) -1 71) + (set-as-offset-from! (-> this sprites 13) (the-as vector4w (-> this sprites)) -14 67) + (set-as-offset-from! (-> this sprites 14) (the-as vector4w (-> this sprites)) -22 59) + (set-as-offset-from! (-> this sprites 15) (the-as vector4w (-> this sprites)) -27 47) + (set-as-offset-from! (-> this sprites 16) (the-as vector4w (-> this sprites)) -27 32) + (set-as-offset-from! (-> this sprites 17) (the-as vector4w (-> this sprites)) -22 19) + (set-as-offset-from! (-> this sprites 18) (the-as vector4w (-> this sprites)) -14 10) + (set-as-offset-from! (-> this sprites 19) (the-as vector4w (-> this sprites)) -1 6) + (let ((f0-9 (the float (-> this values 1 current)))) (cond ((>= f0-9 100.0) (let ((f0-10 (if (< 100 (mod (-> *display* game-clock frame-counter) 200)) @@ -338,63 +338,63 @@ ) ) ) - (set! (-> obj sprites 26 angle) (* 182.04445 (- 270.0 f0-10))) - (set! (-> obj sprites 24 angle) (* 182.04445 (- f0-10))) - (set! (-> obj sprites 22 angle) (* 182.04445 (- 90.0 f0-10))) - (set! (-> obj sprites 20 angle) (* 182.04445 (- 180.0 f0-10))) + (set! (-> this sprites 26 angle) (* 182.04445 (- 270.0 f0-10))) + (set! (-> this sprites 24 angle) (* 182.04445 (- f0-10))) + (set! (-> this sprites 22 angle) (* 182.04445 (- 90.0 f0-10))) + (set! (-> this sprites 20 angle) (* 182.04445 (- 180.0 f0-10))) ) ) ((< 75.0 f0-9) - (set! (-> obj sprites 26 angle) (* 182.04445 (- 180.0 (* 3.6 (+ -75.0 f0-9))))) - (set! (-> obj sprites 24 angle) 32768.0) - (set! (-> obj sprites 22 angle) 49152.0) - (set! (-> obj sprites 20 angle) 0.0) + (set! (-> this sprites 26 angle) (* 182.04445 (- 180.0 (* 3.6 (+ -75.0 f0-9))))) + (set! (-> this sprites 24 angle) 32768.0) + (set! (-> this sprites 22 angle) 49152.0) + (set! (-> this sprites 20 angle) 0.0) ) ((< 50.0 f0-9) - (set! (-> obj sprites 26 angle) 32768.0) - (set! (-> obj sprites 24 angle) (* 182.04445 (- 270.0 (* 3.6 (+ -50.0 f0-9))))) - (set! (-> obj sprites 22 angle) 49152.0) - (set! (-> obj sprites 20 angle) 0.0) + (set! (-> this sprites 26 angle) 32768.0) + (set! (-> this sprites 24 angle) (* 182.04445 (- 270.0 (* 3.6 (+ -50.0 f0-9))))) + (set! (-> this sprites 22 angle) 49152.0) + (set! (-> this sprites 20 angle) 0.0) ) ((< 25.0 f0-9) - (set! (-> obj sprites 26 angle) 32768.0) - (set! (-> obj sprites 24 angle) 49152.0) - (set! (-> obj sprites 22 angle) (* 182.04445 (- (* 3.6 (+ -25.0 f0-9))))) - (set! (-> obj sprites 20 angle) 0.0) + (set! (-> this sprites 26 angle) 32768.0) + (set! (-> this sprites 24 angle) 49152.0) + (set! (-> this sprites 22 angle) (* 182.04445 (- (* 3.6 (+ -25.0 f0-9))))) + (set! (-> this sprites 20 angle) 0.0) ) (else - (set! (-> obj sprites 26 angle) 32768.0) - (set! (-> obj sprites 24 angle) 49152.0) - (set! (-> obj sprites 22 angle) 0.0) - (set! (-> obj sprites 20 angle) (* 182.04445 (- 90.0 (* 3.6 f0-9)))) + (set! (-> this sprites 26 angle) 32768.0) + (set! (-> this sprites 24 angle) 49152.0) + (set! (-> this sprites 22 angle) 0.0) + (set! (-> this sprites 20 angle) (* 182.04445 (- 90.0 (* 3.6 f0-9)))) ) ) ) - (set-as-offset-from! (-> obj sprites 20) (the-as vector4w (-> obj sprites)) 0 45) - (set-as-offset-from! (-> obj sprites 22) (the-as vector4w (-> obj sprites)) 0 44) - (set-as-offset-from! (-> obj sprites 24) (the-as vector4w (-> obj sprites)) 2 44) - (set-as-offset-from! (-> obj sprites 26) (the-as vector4w (-> obj sprites)) 2 45) - (set-as-offset-from! (-> obj sprites 21) (the-as vector4w (-> obj sprites)) 0 14) - (set-as-offset-from! (-> obj sprites 23) (the-as vector4w (-> obj sprites)) 0 44) - (set-as-offset-from! (-> obj sprites 25) (the-as vector4w (-> obj sprites)) -30 44) - (set-as-offset-from! (-> obj sprites 27) (the-as vector4w (-> obj sprites)) -30 14) - (set-as-offset-from! (-> obj sprites 29) (the-as vector4w (-> obj sprites)) -10 36) - (let ((f0-34 (if (and (= (-> obj values 4 current) 1) (< 25 (mod (-> *display* game-clock frame-counter) 50))) + (set-as-offset-from! (-> this sprites 20) (the-as vector4w (-> this sprites)) 0 45) + (set-as-offset-from! (-> this sprites 22) (the-as vector4w (-> this sprites)) 0 44) + (set-as-offset-from! (-> this sprites 24) (the-as vector4w (-> this sprites)) 2 44) + (set-as-offset-from! (-> this sprites 26) (the-as vector4w (-> this sprites)) 2 45) + (set-as-offset-from! (-> this sprites 21) (the-as vector4w (-> this sprites)) 0 14) + (set-as-offset-from! (-> this sprites 23) (the-as vector4w (-> this sprites)) 0 44) + (set-as-offset-from! (-> this sprites 25) (the-as vector4w (-> this sprites)) -30 44) + (set-as-offset-from! (-> this sprites 27) (the-as vector4w (-> this sprites)) -30 14) + (set-as-offset-from! (-> this sprites 29) (the-as vector4w (-> this sprites)) -10 36) + (let ((f0-34 (if (and (= (-> this values 4 current) 1) (< 25 (mod (-> *display* game-clock frame-counter) 50))) 250.0 100.0 ) ) ) - (set! (-> obj sprites 29 color x) (the int f0-34)) - (set! (-> obj sprites 29 color y) (the int (if (>= (-> obj values 1 current) 100) - 0.0 - f0-34 - ) - ) + (set! (-> this sprites 29 color x) (the int f0-34)) + (set! (-> this sprites 29 color y) (the int (if (>= (-> this values 1 current) 100) + 0.0 + f0-34 + ) + ) ) ) - (set! (-> obj sprites 29 color z) (-> obj sprites 29 color y)) - (let ((f30-0 (- (the float (-> obj values 3 current))))) + (set! (-> this sprites 29 color z) (-> this sprites 29 color y)) + (let ((f30-0 (- (the float (-> this values 3 current))))) (let ((a1-31 (new 'stack-no-clear 'vector))) (set! (-> a1-31 x) 128.0) (set! (-> a1-31 y) 128.0) @@ -406,23 +406,23 @@ (set! (-> a2-29 z) 32.0) (set! (-> a2-29 w) 0.0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-lerp! s5-0 a1-31 a2-29 (* 0.01 (the float (-> obj values 5 current)))) - (vector-cvt.w.s! (the-as vector (-> obj sprites 28 color2)) s5-0) + (vector-lerp! s5-0 a1-31 a2-29 (* 0.01 (the float (-> this values 5 current)))) + (vector-cvt.w.s! (the-as vector (-> this sprites 28 color2)) s5-0) ) ) ) - (set! (-> obj sprites 28 color w) - (the int (* 0.00390625 (-> obj fade-interp) (the float (-> obj values 2 current)))) + (set! (-> this sprites 28 color w) + (the int (* 0.00390625 (-> this fade-interp) (the float (-> this values 2 current)))) ) (set-as-offset-from! - (-> obj sprites 28) - (the-as vector4w (-> obj sprites)) + (-> this sprites 28) + (the-as vector4w (-> this sprites)) (the int (* -70.0 (sin f30-0))) (+ (the int (* -70.0 (cos f30-0))) 44) ) - (set! (-> obj sprites 28 angle) (+ -8192.0 f30-0)) + (set! (-> this sprites 28 angle) (+ -8192.0 f30-0)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) @@ -430,44 +430,44 @@ ;; definition for method 16 of type hud-turret-health ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-turret-health ((obj hud-turret-health)) - (set! (-> obj values 0 target) (the int (-> *game-info* score))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-turret-health ((this hud-turret-health)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 18 of type hud-turret-health -(defmethod event-callback hud-turret-health ((obj hud-turret-health) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-callback hud-turret-health ((this hud-turret-health) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('set-heat) - (set! (-> obj values 1 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) + (set! (-> this values 1 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) ) (('set-arrow-alpha) - (set! (-> obj values 2 target) (the int (* 256.0 (the-as float (-> arg3 param 0))))) + (set! (-> this values 2 target) (the int (* 256.0 (the-as float (-> arg3 param 0))))) ) (('set-arrow-angle) - (set! (-> obj values 3 target) (the int (the-as float (-> arg3 param 0)))) + (set! (-> this values 3 target) (the int (the-as float (-> arg3 param 0)))) ) (('set-target-flash) - (set! (-> obj values 4 target) (if (-> arg3 param 0) - 1 - 0 - ) + (set! (-> this values 4 target) (if (-> arg3 param 0) + 1 + 0 + ) ) ) (('set-arrow-red) - (set! (-> obj values 5 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) + (set! (-> this values 5 target) (the int (* 100.0 (the-as float (-> arg3 param 0))))) ) (('set-hud-pos) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) (the-as int (-> arg3 param 0)) (the-as int (+ (-> arg3 param 1) -4)) ) ) ) - ((method-of-type hud event-callback) obj arg0 arg1 arg2 arg3) + ((method-of-type hud event-callback) this arg0 arg1 arg2 arg3) ) ;; definition for function init-turret-hud @@ -589,24 +589,24 @@ ) ;; definition for method 3 of type hud-drill-turret-health -(defmethod inspect hud-drill-turret-health ((obj hud-drill-turret-health)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-drill-turret-health ((this hud-drill-turret-health)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud-turret-health inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 17 of type hud-drill-turret-health ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-drill-turret-health ((obj hud-drill-turret-health)) - (set! (-> obj level) (level-get *level* 'drillmid)) - (init-turret-hud obj "drillmid-minimap") - ((method-of-type hud init-callback) obj) +(defmethod init-callback hud-drill-turret-health ((this hud-drill-turret-health)) + (set! (-> this level) (level-get *level* 'drillmid)) + (init-turret-hud this "drillmid-minimap") + ((method-of-type hud init-callback) this) 0 (none) ) @@ -621,24 +621,24 @@ ) ;; definition for method 3 of type hud-port-turret-health -(defmethod inspect hud-port-turret-health ((obj hud-port-turret-health)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-port-turret-health ((this hud-port-turret-health)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud-turret-health inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 17 of type hud-port-turret-health ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-port-turret-health ((obj hud-port-turret-health)) - (set! (-> obj level) (level-get *level* 'portblmp)) - (init-turret-hud obj "portblmp-minimap") - ((method-of-type hud init-callback) obj) +(defmethod init-callback hud-port-turret-health ((this hud-port-turret-health)) + (set! (-> this level) (level-get *level* 'portblmp)) + (init-turret-hud this "portblmp-minimap") + ((method-of-type hud init-callback) this) 0 (none) ) @@ -658,20 +658,20 @@ ) ;; definition for method 3 of type turret-info -(defmethod inspect turret-info ((obj turret-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect turret-info ((this turret-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tturret: #x~X~%" (-> obj turret)) - (format #t "~1Tgrabbed?: ~A~%" (-> obj grabbed?)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tturret: #x~X~%" (-> this turret)) + (format #t "~1Tgrabbed?: ~A~%" (-> this grabbed?)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Ttrans: ~`vector`P~%" (-> this trans)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -724,17 +724,17 @@ ) ;; definition for method 3 of type turret-path-event -(defmethod inspect turret-path-event ((obj turret-path-event)) - (when (not obj) - (set! obj obj) +(defmethod inspect turret-path-event ((this turret-path-event)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'turret-path-event) - (format #t "~1Tpos: ~f~%" (-> obj pos)) - (format #t "~1Tevent-type: ~A~%" (-> obj event-type)) - (format #t "~1Tparam: ~A~%" (-> obj param)) + (format #t "[~8x] ~A~%" this 'turret-path-event) + (format #t "~1Tpos: ~f~%" (-> this pos)) + (format #t "~1Tevent-type: ~A~%" (-> this event-type)) + (format #t "~1Tparam: ~A~%" (-> this param)) (label cfg-4) - obj + this ) ;; definition of type turret-path @@ -748,16 +748,16 @@ ) ;; definition for method 3 of type turret-path -(defmethod inspect turret-path ((obj turret-path)) - (when (not obj) - (set! obj obj) +(defmethod inspect turret-path ((this turret-path)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'turret-path) - (format #t "~1Tevent-count: ~D~%" (-> obj event-count)) - (format #t "~1Tevent-tbl: #x~X~%" (-> obj event-tbl)) + (format #t "[~8x] ~A~%" this 'turret-path) + (format #t "~1Tevent-count: ~D~%" (-> this event-count)) + (format #t "~1Tevent-tbl: #x~X~%" (-> this event-tbl)) (label cfg-4) - obj + this ) ;; definition of type base-turret @@ -843,101 +843,101 @@ ) ;; definition for method 3 of type base-turret -(defmethod inspect base-turret ((obj base-turret)) - (when (not obj) - (set! obj obj) +(defmethod inspect base-turret ((this base-turret)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thud: ~D~%" (-> obj hud)) - (format #t "~2Tcondition: ~D~%" (-> obj condition)) - (format #t "~2Tshadow-backup: ~A~%" (-> obj shadow-backup)) - (format #t "~2Trider: ~D~%" (-> obj rider)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Thud: ~D~%" (-> this hud)) + (format #t "~2Tcondition: ~D~%" (-> this condition)) + (format #t "~2Tshadow-backup: ~A~%" (-> this shadow-backup)) + (format #t "~2Trider: ~D~%" (-> this rider)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Talt-actor: ~A~%" (-> obj alt-actor)) - (format #t "~2Tsmush-control: #~%" (-> obj smush-control)) - (format #t "~2Tsound-id[3] @ #x~X~%" (-> obj sound-id)) - (format #t "~2Tsound-playing[3] @ #x~X~%" (-> obj sound-playing)) - (format #t "~2Tcam-string-vector: #~%" (-> obj cam-string-vector)) - (format #t "~2Tpath-event: #~%" (-> obj path-event)) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-u-prev: ~f~%" (-> obj path-u-prev)) - (format #t "~2Tpath-mode: ~D~%" (-> obj path-mode)) - (format #t "~2Tpath-speed: ~f~%" (-> obj path-speed)) - (format #t "~2Tpath-speed-mult: ~f~%" (-> obj path-speed-mult)) - (format #t "~2Tpath-speed-mult-final: ~f~%" (-> obj path-speed-mult-final)) - (format #t "~2Tpath-old-pos: ~`vector`P~%" (-> obj path-old-pos)) - (format #t "~2Tpath-direction: ~A~%" (-> obj path-direction)) - (format #t "~2Tpause-proc: ~A~%" (-> obj pause-proc)) - (format #t "~2Tgun-recoil-jmod[4] @ #x~X~%" (-> obj gun-recoil-jmod)) - (format #t "~2Tgun-index: ~D~%" (-> obj gun-index)) - (format #t "~2Tshot-timeout: ~D~%" (-> obj shot-timeout)) - (format #t "~2Tfire-time: ~D~%" (-> obj fire-time)) - (format #t "~2Tfire-time-interval: ~D~%" (-> obj fire-time-interval)) - (format #t "~2Tenable-controls: ~A~%" (-> obj enable-controls)) - (format #t "~2Tavailable-for-pickup: ~A~%" (-> obj available-for-pickup)) - (format #t "~2Troty: (deg ~r)~%" (-> obj roty)) - (format #t "~2Trotyv: (deg ~r)~%" (-> obj rotyv)) - (format #t "~2Trotyvv: (deg ~r)~%" (-> obj rotyvv)) - (format #t "~2Troty-min: (deg ~r)~%" (-> obj roty-min)) - (format #t "~2Troty-max: (deg ~r)~%" (-> obj roty-max)) - (format #t "~2Trotx: (deg ~r)~%" (-> obj rotx)) - (format #t "~2Trotxv: (deg ~r)~%" (-> obj rotxv)) - (format #t "~2Trotxvv: (deg ~r)~%" (-> obj rotxvv)) - (format #t "~2Trotx-min: (deg ~r)~%" (-> obj rotx-min)) - (format #t "~2Trotx-max: (deg ~r)~%" (-> obj rotx-max)) - (format #t "~2Ttarget-quat: #~%" (-> obj target-quat)) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Thealth: ~f~%" (-> obj health)) - (format #t "~2Ttrack-handle: ~D~%" (-> obj track-handle)) - (format #t "~2Theat: ~f~%" (-> obj heat)) - (format #t "~2Theat-target: ~f~%" (-> obj heat-target)) - (format #t "~2Tarrow-angle: ~f~%" (-> obj arrow-angle)) - (format #t "~2Tarrow-alpha: ~f~%" (-> obj arrow-alpha)) - (format #t "~2Tarrow-red: ~f~%" (-> obj arrow-red)) - (format #t "~2Tred-filter-timer: ~D~%" (-> obj red-filter-timer)) - (format #t "~2Tride-height: ~f~%" (-> obj ride-height)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Talt-actor: ~A~%" (-> this alt-actor)) + (format #t "~2Tsmush-control: #~%" (-> this smush-control)) + (format #t "~2Tsound-id[3] @ #x~X~%" (-> this sound-id)) + (format #t "~2Tsound-playing[3] @ #x~X~%" (-> this sound-playing)) + (format #t "~2Tcam-string-vector: #~%" (-> this cam-string-vector)) + (format #t "~2Tpath-event: #~%" (-> this path-event)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-u-prev: ~f~%" (-> this path-u-prev)) + (format #t "~2Tpath-mode: ~D~%" (-> this path-mode)) + (format #t "~2Tpath-speed: ~f~%" (-> this path-speed)) + (format #t "~2Tpath-speed-mult: ~f~%" (-> this path-speed-mult)) + (format #t "~2Tpath-speed-mult-final: ~f~%" (-> this path-speed-mult-final)) + (format #t "~2Tpath-old-pos: ~`vector`P~%" (-> this path-old-pos)) + (format #t "~2Tpath-direction: ~A~%" (-> this path-direction)) + (format #t "~2Tpause-proc: ~A~%" (-> this pause-proc)) + (format #t "~2Tgun-recoil-jmod[4] @ #x~X~%" (-> this gun-recoil-jmod)) + (format #t "~2Tgun-index: ~D~%" (-> this gun-index)) + (format #t "~2Tshot-timeout: ~D~%" (-> this shot-timeout)) + (format #t "~2Tfire-time: ~D~%" (-> this fire-time)) + (format #t "~2Tfire-time-interval: ~D~%" (-> this fire-time-interval)) + (format #t "~2Tenable-controls: ~A~%" (-> this enable-controls)) + (format #t "~2Tavailable-for-pickup: ~A~%" (-> this available-for-pickup)) + (format #t "~2Troty: (deg ~r)~%" (-> this roty)) + (format #t "~2Trotyv: (deg ~r)~%" (-> this rotyv)) + (format #t "~2Trotyvv: (deg ~r)~%" (-> this rotyvv)) + (format #t "~2Troty-min: (deg ~r)~%" (-> this roty-min)) + (format #t "~2Troty-max: (deg ~r)~%" (-> this roty-max)) + (format #t "~2Trotx: (deg ~r)~%" (-> this rotx)) + (format #t "~2Trotxv: (deg ~r)~%" (-> this rotxv)) + (format #t "~2Trotxvv: (deg ~r)~%" (-> this rotxvv)) + (format #t "~2Trotx-min: (deg ~r)~%" (-> this rotx-min)) + (format #t "~2Trotx-max: (deg ~r)~%" (-> this rotx-max)) + (format #t "~2Ttarget-quat: #~%" (-> this target-quat)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Thealth: ~f~%" (-> this health)) + (format #t "~2Ttrack-handle: ~D~%" (-> this track-handle)) + (format #t "~2Theat: ~f~%" (-> this heat)) + (format #t "~2Theat-target: ~f~%" (-> this heat-target)) + (format #t "~2Tarrow-angle: ~f~%" (-> this arrow-angle)) + (format #t "~2Tarrow-alpha: ~f~%" (-> this arrow-alpha)) + (format #t "~2Tarrow-red: ~f~%" (-> this arrow-red)) + (format #t "~2Tred-filter-timer: ~D~%" (-> this red-filter-timer)) + (format #t "~2Tride-height: ~f~%" (-> this ride-height)) (label cfg-7) - obj + this ) ;; definition for method 7 of type base-turret ;; WARN: Return type mismatch process-drawable vs base-turret. -(defmethod relocate base-turret ((obj base-turret) (arg0 int)) +(defmethod relocate base-turret ((this base-turret) (arg0 int)) (countdown (v1-0 4) - (if (-> obj gun-recoil-jmod v1-0) - (&+! (-> obj gun-recoil-jmod v1-0) arg0) + (if (-> this gun-recoil-jmod v1-0) + (&+! (-> this gun-recoil-jmod v1-0) arg0) ) ) - (the-as base-turret ((method-of-type process-drawable relocate) obj arg0)) + (the-as base-turret ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 34 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-34 base-turret ((obj base-turret) (arg0 process)) +(defmethod base-turret-method-34 base-turret ((this base-turret) (arg0 process)) 0 (none) ) ;; definition for method 35 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-35 base-turret ((obj base-turret)) - (send-event (handle->process (-> obj hud)) 'force-show) +(defmethod base-turret-method-35 base-turret ((this base-turret)) + (send-event (handle->process (-> this hud)) 'force-show) 0 (none) ) ;; definition for method 36 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-36 base-turret ((obj base-turret)) - (if (nonzero? (-> obj part)) - (spawn (-> obj part) (-> obj root trans)) +(defmethod base-turret-method-36 base-turret ((this base-turret)) + (if (nonzero? (-> this part)) + (spawn (-> this part) (-> this root trans)) ) 0 (none) @@ -945,18 +945,18 @@ ;; definition for method 40 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-40 base-turret ((obj base-turret)) +(defmethod base-turret-method-40 base-turret ((this base-turret)) (let ((s3-0 (new 'stack-no-clear 'matrix)) (s4-0 (new 'stack-no-clear 'matrix)) (gp-0 (new 'stack-no-clear 'quaternion)) ) - (matrix-rotate-y! s3-0 (-> obj roty)) - (matrix-rotate-x! s4-0 (-> obj rotx)) + (matrix-rotate-y! s3-0 (-> this roty)) + (matrix-rotate-x! s4-0 (-> this rotx)) (matrix*! s3-0 s4-0 s3-0) (matrix->quaternion gp-0 s3-0) - (quaternion-smooth-seek! (-> obj target-quat) (-> obj target-quat) gp-0 0.33) - (let ((f0-2 (update! (-> obj smush-control)))) - (quaternion-rotate-local-x! (-> obj root quat) gp-0 (* -910.2222 f0-2)) + (quaternion-smooth-seek! (-> this target-quat) (-> this target-quat) gp-0 0.33) + (let ((f0-2 (update! (-> this smush-control)))) + (quaternion-rotate-local-x! (-> this root quat) gp-0 (* -910.2222 f0-2)) ) ) 0 @@ -965,55 +965,55 @@ ;; definition for method 37 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-37 base-turret ((obj base-turret)) - (let ((f30-0 (fabs (* 0.00006866455 (-> obj rotyv)))) - (f28-0 (fabs (* 0.00010986328 (-> obj rotxv)))) +(defmethod base-turret-method-37 base-turret ((this base-turret)) + (let ((f30-0 (fabs (* 0.00006866455 (-> this rotyv)))) + (f28-0 (fabs (* 0.00010986328 (-> this rotxv)))) (f26-0 0.33333334) (f24-0 0.5) - (s5-0 (-> obj sound-playing 0)) - (s4-0 (-> obj sound-playing 1)) + (s5-0 (-> this sound-playing 0)) + (s4-0 (-> this sound-playing 1)) ) (cond - ((and (-> obj sound-playing 0) (< f30-0 f26-0)) - (sound-stop (-> obj sound-id 0)) - (set! (-> obj sound-playing 0) #f) + ((and (-> this sound-playing 0) (< f30-0 f26-0)) + (sound-stop (-> this sound-id 0)) + (set! (-> this sound-playing 0) #f) ) ((< (* 1.2 f26-0) f30-0) - (sound-play "drill-turret-lp" :id (-> obj sound-id 0) :position (-> obj root trans)) - (set! (-> obj sound-playing 0) #t) + (sound-play "drill-turret-lp" :id (-> this sound-id 0) :position (-> this root trans)) + (set! (-> this sound-playing 0) #t) ) ) (cond - ((and (-> obj sound-playing 1) (< f28-0 f24-0)) - (sound-stop (-> obj sound-id 1)) - (set! (-> obj sound-playing 1) #f) + ((and (-> this sound-playing 1) (< f28-0 f24-0)) + (sound-stop (-> this sound-id 1)) + (set! (-> this sound-playing 1) #f) ) ((< (* 1.2 f24-0) f28-0) - (sound-play "drill-turret-l2" :id (-> obj sound-id 1) :position (-> obj root trans)) - (set! (-> obj sound-playing 1) #t) + (sound-play "drill-turret-l2" :id (-> this sound-id 1) :position (-> this root trans)) + (set! (-> this sound-playing 1) #t) ) ) (if (and (or s5-0 s4-0) (< f30-0 f26-0) (< f28-0 f24-0)) - (sound-play "drill-tur-stop" :position (-> obj root trans)) + (sound-play "drill-tur-stop" :position (-> this root trans)) ) ) - (case (-> obj path-mode) + (case (-> this path-mode) ((2 3 4) (sound-play-by-name (static-sound-name "turret-track") - (-> obj sound-id 2) - (the int (* 1024.0 (lerp-clamp 0.0 1.0 (-> obj path-speed-mult)))) - (the int (* 1524.0 (lerp-scale -0.3 0.3 (-> obj path-speed-mult) 0.0 4.0))) + (-> this sound-id 2) + (the int (* 1024.0 (lerp-clamp 0.0 1.0 (-> this path-speed-mult)))) + (the int (* 1524.0 (lerp-scale -0.3 0.3 (-> this path-speed-mult) 0.0 4.0))) 0 (sound-group sfx) - (-> obj root trans) + (-> this root trans) ) - (set! (-> obj sound-playing 2) #t) + (set! (-> this sound-playing 2) #t) ) (else - (when (-> obj sound-playing 2) - (sound-stop (-> obj sound-id 2)) - (set! (-> obj sound-playing 2) #f) + (when (-> this sound-playing 2) + (sound-stop (-> this sound-id 2)) + (set! (-> this sound-playing 2) #f) ) ) ) @@ -1023,32 +1023,32 @@ ;; definition for method 48 of type base-turret ;; INFO: Used lq/sq -(defmethod turret-event-handler base-turret ((obj base-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod turret-event-handler base-turret ((this base-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-0 object)) (case arg2 (('trans) (set! v0-0 (-> arg3 param 0)) - (set! (-> (the-as vector v0-0) quad) (-> obj root trans quad)) + (set! (-> (the-as vector v0-0) quad) (-> this root trans quad)) v0-0 ) (('quat) - (quaternion-copy! (the-as quaternion (-> arg3 param 0)) (-> obj target-quat)) + (quaternion-copy! (the-as quaternion (-> arg3 param 0)) (-> this target-quat)) ) (('path) - (if (not (logtest? (-> obj path flags) (path-control-flag not-found))) - (-> obj path) + (if (not (logtest? (-> this path flags) (path-control-flag not-found))) + (-> this path) #f ) ) (('shadow) (cond ((-> arg3 param 0) - (set! v0-0 (-> obj shadow-backup)) - (set! (-> obj draw shadow) (the-as shadow-geo v0-0)) + (set! v0-0 (-> this shadow-backup)) + (set! (-> this draw shadow) (the-as shadow-geo v0-0)) v0-0 ) (else - (set! (-> obj draw shadow) #f) + (set! (-> this draw shadow) #f) #f ) ) @@ -1062,11 +1062,11 @@ ) ;; definition for method 20 of type base-turret -(defmethod get-trans base-turret ((obj base-turret) (arg0 int)) +(defmethod get-trans base-turret ((this base-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (if (= arg0 1) - (-> obj root trans) - ((method-of-type process-focusable get-trans) obj arg0) + (-> this root trans) + ((method-of-type process-focusable get-trans) this arg0) ) ) @@ -1261,21 +1261,21 @@ (a1-1 (-> self fire-time-interval)) ) (when (>= v1-8 (* a0-7 a1-1)) - (set! (-> self fire-time) (current-time)) + (set-time! (-> self fire-time)) (base-turret-method-45 self a1-1 message) ) ) ) (else - (when (>= (- (current-time) (-> self fire-time)) (-> self fire-time-interval)) - (set! (-> self fire-time) (current-time)) + (when (time-elapsed? (-> self fire-time) (-> self fire-time-interval)) + (set-time! (-> self fire-time)) (base-turret-method-45 self argc message) ) ) ) ) (('fire-pressed) - (set! (-> self fire-time) (current-time)) + (set-time! (-> self fire-time)) (base-turret-method-45 self argc message) ) (('bonk) @@ -1694,7 +1694,7 @@ (sound-stop (-> self sound-id 2)) (set! (-> self focus-status) (focus-status disable ignore inactive)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.8)) + (until (time-elapsed? gp-0 (seconds 0.8)) (suspend) ) ) @@ -1763,15 +1763,15 @@ ;; definition for method 46 of type base-turret ;; WARN: Return type mismatch symbol vs process. -(defmethod base-turret-method-46 base-turret ((obj base-turret) (arg0 process)) +(defmethod base-turret-method-46 base-turret ((this base-turret) (arg0 process)) (the-as process #t) ) ;; definition for method 47 of type base-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-47 base-turret ((obj base-turret)) - (let ((a0-1 (-> obj root trans)) +(defmethod base-turret-method-47 base-turret ((this base-turret)) + (let ((a0-1 (-> this root trans)) (f30-0 0.0) (s4-0 (the-as process-drawable #f)) ) @@ -1798,11 +1798,11 @@ (logtest? (process-mask enemy) (-> s2-1 mask)) (logtest? (process-mask collectable) (-> s2-1 mask)) (not (focus-test? (the-as process-focusable s2-1) disable dead ignore inactive)) - (!= s2-1 obj) + (!= s2-1 this) (!= s2-1 *target*) - (base-turret-method-46 obj s2-1) + (base-turret-method-46 this s2-1) ) - (let ((f0-1 (vector-vector-xz-distance (-> obj root trans) (-> s2-1 root trans)))) + (let ((f0-1 (vector-vector-xz-distance (-> this root trans) (-> s2-1 root trans)))) (when (or (not s4-0) (< f0-1 f30-0)) (set! s4-0 s2-1) (set! f30-0 f0-1) @@ -1822,43 +1822,43 @@ (set! (-> s5-1 z) 0.0) (set! (-> s5-1 w) 1.0) (let ((s1-1 (new 'stack-no-clear 'vector)) - (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 12))) - (s2-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 12))) + (s2-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (vector-matrix*! s5-1 s5-1 (-> (the-as process-focusable s4-0) node-list data 0 bone transform)) (vector-line-distance-point! s5-1 s3-1 (vector+float*! (new 'stack-no-clear 'vector) s3-1 s2-2 4096.0) s1-1) (let* ((a1-10 (vector-! (new 'stack-no-clear 'vector) s5-1 s1-1)) - (s4-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) a1-10 (-> obj root quat))) + (s4-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) a1-10 (-> this root quat))) (f30-1 (vector-vector-angle-safe s2-2 (vector-! (new 'stack-no-clear 'vector) s5-1 s3-1))) ) (let ((f0-10 (- (atan (-> s4-1 x) (-> s4-1 y))))) (if (logtest? (-> *game-info* secrets) (game-secrets hflip-screen)) (set! f0-10 (* -1.0 f0-10)) ) - (set! (-> obj arrow-angle) (deg-seek (-> obj arrow-angle) f0-10 (* 65536.0 (seconds-per-frame)))) + (set! (-> this arrow-angle) (deg-seek (-> this arrow-angle) f0-10 (* 65536.0 (seconds-per-frame)))) ) (cond ((< 910.2222 f30-1) - (seek! (-> obj arrow-alpha) 1.0 (seconds-per-frame)) - (send-event (handle->process (-> obj hud)) 'set-target-flash #f) + (seek! (-> this arrow-alpha) 1.0 (seconds-per-frame)) + (send-event (handle->process (-> this hud)) 'set-target-flash #f) ) (else - (seek! (-> obj arrow-alpha) 0.0 (* 4.0 (seconds-per-frame))) - (send-event (handle->process (-> obj hud)) 'set-target-flash #t) + (seek! (-> this arrow-alpha) 0.0 (* 4.0 (seconds-per-frame))) + (send-event (handle->process (-> this hud)) 'set-target-flash #t) ) ) ) ) (seek! - (-> obj arrow-red) - (lerp-scale 1.0 0.0 (vector-vector-distance s5-1 (-> obj root trans)) 122880.0 245760.0) + (-> this arrow-red) + (lerp-scale 1.0 0.0 (vector-vector-distance s5-1 (-> this root trans)) 122880.0 245760.0) (seconds-per-frame) ) ) ) (else - (seek! (-> obj arrow-alpha) 0.0 (seconds-per-frame)) - (send-event (handle->process (-> obj hud)) 'set-target-flash #f) + (seek! (-> this arrow-alpha) 0.0 (seconds-per-frame)) + (send-event (handle->process (-> this hud)) 'set-target-flash #f) ) ) ) @@ -1868,13 +1868,13 @@ ;; definition for method 43 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-43 base-turret ((obj base-turret)) - (set! (-> obj roty) (y-angle (-> obj root))) - (set! (-> obj rotyv) 0.0) - (set! (-> obj rotyvv) 0.0) - (set! (-> obj rotx) 0.0) - (set! (-> obj rotxv) 0.0) - (set! (-> obj rotxvv) 0.0) +(defmethod base-turret-method-43 base-turret ((this base-turret)) + (set! (-> this roty) (y-angle (-> this root))) + (set! (-> this rotyv) 0.0) + (set! (-> this rotyvv) 0.0) + (set! (-> this rotx) 0.0) + (set! (-> this rotxv) 0.0) + (set! (-> this rotxvv) 0.0) 0 (none) ) @@ -1882,10 +1882,10 @@ ;; definition for method 33 of type base-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod turret-init! base-turret ((obj base-turret) (arg0 entity-actor) (arg1 matrix)) +(defmethod turret-init! base-turret ((this base-turret) (arg0 entity-actor) (arg1 matrix)) (local-vars (sv-16 res-tag)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s3-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s3-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s3-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s3-0 reaction) cshape-reaction-default) (set! (-> s3-0 no-reaction) @@ -1914,111 +1914,111 @@ (set! (-> s3-0 backup-collide-as) (-> v1-19 prim-core collide-as)) (set! (-> s3-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) - (set! (-> obj root) s3-0) + (set! (-> this root) s3-0) ) (when arg0 - (process-drawable-from-entity! obj arg0) - (set-yaw-angle-clear-roll-pitch! (-> obj root) (res-lump-float arg0 'rotoffset)) + (process-drawable-from-entity! this arg0) + (set-yaw-angle-clear-roll-pitch! (-> this root) (res-lump-float arg0 'rotoffset)) ) (when arg1 - (set! (-> obj root trans quad) (-> arg1 vector 0 quad)) - (quaternion-copy! (-> obj root quat) (the-as quaternion (-> arg1 vector 1))) + (set! (-> this root trans quad) (-> arg1 vector 0 quad)) + (quaternion-copy! (-> this root quat) (the-as quaternion (-> arg1 vector 1))) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-turret" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj shadow-backup) (the-as symbol (-> obj draw shadow))) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj condition) (res-lump-value arg0 'index int :time -1000000000.0)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this shadow-backup) (the-as symbol (-> this draw shadow))) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this condition) (res-lump-value arg0 'index int :time -1000000000.0)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (if (-> obj entity) - (move-to-ground (the-as collide-shape-moving (-> obj root)) 40960.0 40960.0 #t (collide-spec backgnd)) + (if (-> this entity) + (move-to-ground (the-as collide-shape-moving (-> this root)) 40960.0 40960.0 #t (collide-spec backgnd)) ) - (set-zero! (-> obj smush-control)) - (set! (-> obj hud) (the-as handle #f)) - (base-turret-method-43 obj) - (set! (-> obj alt-actor) (the-as symbol (entity-actor-lookup (-> obj entity) 'alt-actor 0))) + (set-zero! (-> this smush-control)) + (set! (-> this hud) (the-as handle #f)) + (base-turret-method-43 this) + (set! (-> this alt-actor) (the-as symbol (entity-actor-lookup (-> this entity) 'alt-actor 0))) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-49 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-49 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-49 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-49)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-49)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj sound-id 0) (new-sound-id)) - (set! (-> obj sound-id 1) (new-sound-id)) - (set! (-> obj sound-id 2) (new-sound-id)) - (set! (-> obj sound-playing 0) #f) - (set! (-> obj sound-playing 1) #f) - (set! (-> obj sound-playing 2) #f) - (let ((s5-1 (new 'process 'curve-control obj 'path -1000000000.0))) - (set! (-> obj path) s5-1) - (set! (-> obj path-u) 0.0) - (set! (-> obj path-u-prev) 0.0) - (set! (-> obj path-speed) (/ 16384.0 (total-distance s5-1))) - (set! (-> obj path-speed-mult) 0.0) - (set! (-> obj path-speed-mult-final) 1.0) - (set! (-> obj path-direction) #f) + (set! (-> this sound-id 0) (new-sound-id)) + (set! (-> this sound-id 1) (new-sound-id)) + (set! (-> this sound-id 2) (new-sound-id)) + (set! (-> this sound-playing 0) #f) + (set! (-> this sound-playing 1) #f) + (set! (-> this sound-playing 2) #f) + (let ((s5-1 (new 'process 'curve-control this 'path -1000000000.0))) + (set! (-> this path) s5-1) + (set! (-> this path-u) 0.0) + (set! (-> this path-u-prev) 0.0) + (set! (-> this path-speed) (/ 16384.0 (total-distance s5-1))) + (set! (-> this path-speed-mult) 0.0) + (set! (-> this path-speed-mult-final) 1.0) + (set! (-> this path-direction) #f) (cond ((logtest? (-> s5-1 flags) (path-control-flag not-found)) - (set! (-> obj path-mode) (the-as uint 0)) + (set! (-> this path-mode) (the-as uint 0)) 0 ) (else - (set! (-> obj path-mode) (the-as uint 1)) + (set! (-> this path-mode) (the-as uint 1)) ) ) (logior! (-> s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) ) - (when (not (logtest? (-> obj path flags) (path-control-flag not-found))) - (get-point-at-percent-along-path! (-> obj path) (-> obj root trans) 0.0 'interp) - (set! (-> obj path-old-pos quad) (-> obj root trans quad)) + (when (not (logtest? (-> this path flags) (path-control-flag not-found))) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) 0.0 'interp) + (set! (-> this path-old-pos quad) (-> this root trans quad)) ) - (set! (-> obj path-speed-mult) 1.0) - (quaternion-copy! (-> obj target-quat) *unity-quaternion*) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (set! (-> obj gun-index) 0) - (set! (-> obj shot-timeout) (seconds 0.667)) - (set! (-> obj gun-recoil-jmod 0) (new 'process 'joint-mod-add-local obj 5 #t #f #f)) - (set! (-> obj gun-recoil-jmod 0 enable) #f) - (set! (-> obj gun-recoil-jmod 1) (new 'process 'joint-mod-add-local obj 11 #t #f #f)) - (set! (-> obj gun-recoil-jmod 1 enable) #f) - (set! (-> obj gun-recoil-jmod 2) (new 'process 'joint-mod-add-local obj 7 #t #f #f)) - (set! (-> obj gun-recoil-jmod 2 enable) #f) - (set! (-> obj gun-recoil-jmod 3) (new 'process 'joint-mod-add-local obj 9 #t #f #f)) - (set! (-> obj gun-recoil-jmod 3 enable) #f) - (set! (-> obj health) 16.0) - (set! (-> obj heat) 0.0) - (set! (-> obj heat-target) 0.0) - (set! (-> obj arrow-angle) 0.0) - (set! (-> obj enable-controls) #t) - (set! (-> obj available-for-pickup) #t) - (set! (-> obj rotx-min) -10922.667) - (set! (-> obj rotx-max) 5461.3335) - (set! (-> obj roty-min) 0.0) - (set! (-> obj roty-max) 0.0) - (set! (-> obj fire-time-interval) (seconds 0.15)) + (set! (-> this path-speed-mult) 1.0) + (quaternion-copy! (-> this target-quat) *unity-quaternion*) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (set! (-> this gun-index) 0) + (set! (-> this shot-timeout) (seconds 0.667)) + (set! (-> this gun-recoil-jmod 0) (new 'process 'joint-mod-add-local this 5 #t #f #f)) + (set! (-> this gun-recoil-jmod 0 enable) #f) + (set! (-> this gun-recoil-jmod 1) (new 'process 'joint-mod-add-local this 11 #t #f #f)) + (set! (-> this gun-recoil-jmod 1 enable) #f) + (set! (-> this gun-recoil-jmod 2) (new 'process 'joint-mod-add-local this 7 #t #f #f)) + (set! (-> this gun-recoil-jmod 2 enable) #f) + (set! (-> this gun-recoil-jmod 3) (new 'process 'joint-mod-add-local this 9 #t #f #f)) + (set! (-> this gun-recoil-jmod 3 enable) #f) + (set! (-> this health) 16.0) + (set! (-> this heat) 0.0) + (set! (-> this heat-target) 0.0) + (set! (-> this arrow-angle) 0.0) + (set! (-> this enable-controls) #t) + (set! (-> this available-for-pickup) #t) + (set! (-> this rotx-min) -10922.667) + (set! (-> this rotx-max) 5461.3335) + (set! (-> this roty-min) 0.0) + (set! (-> this roty-max) 0.0) + (set! (-> this fire-time-interval) (seconds 0.15)) 0 (none) ) ;; definition for method 41 of type base-turret ;; INFO: Used lq/sq -(defmethod base-turret-method-41 base-turret ((obj base-turret) (arg0 vector)) +(defmethod base-turret-method-41 base-turret ((this base-turret) (arg0 vector)) (local-vars (sv-592 int)) - (let* ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj init-quat))) - (s1-0 (-> obj root trans)) + (let* ((s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this init-quat))) + (s1-0 (-> this root trans)) (s5-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack 'collide-query)) (s0-0 8) @@ -2036,9 +2036,9 @@ (let ((v1-9 s2-0)) (set! (-> v1-9 radius) 409.6) (set! (-> v1-9 collide-with) (collide-spec backgnd)) - (set! (-> v1-9 ignore-process0) obj) + (set! (-> v1-9 ignore-process0) this) (set! (-> v1-9 ignore-process1) #f) - (set! (-> v1-9 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-9 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-9 action-mask) (collide-action solid)) ) (when (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) @@ -2055,24 +2055,24 @@ ;; definition for method 44 of type base-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-44 base-turret ((obj base-turret) (arg0 vector) (arg1 vector)) +(defmethod base-turret-method-44 base-turret ((this base-turret) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> gp-0 ent) (-> obj entity)) + (set! (-> gp-0 ent) (-> this entity)) (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options account-for-target-velocity proj-options-8000)) (set! (-> gp-0 pos quad) (-> arg0 quad)) (set! (-> gp-0 vel quad) (-> (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1228800.0) quad)) (set! (-> gp-0 notify-handle) (the-as handle #f)) (set! (-> gp-0 owner-handle) (the-as handle #f)) - (set! (-> gp-0 ignore-handle) (process->handle obj)) + (set! (-> gp-0 ignore-handle) (process->handle this)) (let* ((v1-9 *game-info*) (a0-9 (+ (-> v1-9 attack-id) 1)) ) (set! (-> v1-9 attack-id) a0-9) (set! (-> gp-0 attack-id) a0-9) ) - (set! (-> gp-0 timeout) (-> obj shot-timeout)) - (spawn-projectile turret-shot gp-0 obj *default-dead-pool*) + (set! (-> gp-0 timeout) (-> this shot-timeout)) + (spawn-projectile turret-shot gp-0 this *default-dead-pool*) ) 0 (none) @@ -2080,14 +2080,14 @@ ;; definition for method 42 of type base-turret ;; INFO: Used lq/sq -(defmethod base-turret-method-42 base-turret ((obj base-turret) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod base-turret-method-42 base-turret ((this base-turret) (arg0 vector) (arg1 vector) (arg2 float)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (set! (-> s5-0 start-pos quad) (-> arg0 quad)) (vector-normalize-copy! (-> s5-0 move-dist) arg1 819200.0) (let ((v1-1 s5-0)) (set! (-> v1-1 radius) 2048.0) (set! (-> v1-1 collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) - (set! (-> v1-1 ignore-process0) obj) + (set! (-> v1-1 ignore-process0) this) (set! (-> v1-1 ignore-process1) #f) (set! (-> v1-1 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-1 action-mask) (collide-action solid)) @@ -2109,7 +2109,7 @@ ;; definition for method 45 of type base-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-45 base-turret ((obj base-turret) (arg0 object) (arg1 symbol)) +(defmethod base-turret-method-45 base-turret ((this base-turret) (arg0 object) (arg1 symbol)) (local-vars (sv-112 vector) (sv-128 vector) (sv-144 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2119,24 +2119,24 @@ (vf4 :class vf) ) (init-vf0-vector) - (when (< (-> obj heat) 1.0) + (when (< (-> this heat) 1.0) (let ((s3-0 (new 'static 'array int32 4 5 11 7 9)) - (s4-0 (* (-> obj gun-index) 2)) - (s2-0 (+ (* (-> obj gun-index) 2) 1)) - (s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (s4-0 (* (-> this gun-index) 2)) + (s2-0 (+ (* (-> this gun-index) 2) 1)) + (s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) - (set-recoil (the-as joint-mod (-> obj gun-recoil-jmod s4-0)) -819.2 arg1) - (set-recoil (the-as joint-mod (-> obj gun-recoil-jmod s2-0)) 819.2 arg1) - (let ((s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> s3-0 s4-0)))) - (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> s3-0 s2-0)))) - (s0-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 12))) + (set-recoil (the-as joint-mod (-> this gun-recoil-jmod s4-0)) -819.2 arg1) + (set-recoil (the-as joint-mod (-> this gun-recoil-jmod s2-0)) 819.2 arg1) + (let ((s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> s3-0 s4-0)))) + (s3-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> s3-0 s2-0)))) + (s0-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 12))) (s1-0 (new 'stack-no-clear 'vector)) (s2-1 (new 'stack-no-clear 'vector)) ) (set! sv-144 s0-0) (set! sv-112 s0-0) (set! sv-128 s5-0) - (let ((f0-2 (+ 20480.0 (base-turret-method-42 obj s0-0 s5-0 819200.0)))) + (let ((f0-2 (+ 20480.0 (base-turret-method-42 this s0-0 s5-0 819200.0)))) (.lvf vf2 (&-> sv-128 quad)) (.lvf vf1 (&-> sv-112 quad)) (let ((v1-25 f0-2)) @@ -2151,14 +2151,14 @@ (vector-! s2-1 s0-0 s3-1) (vector-normalize! s1-0 1.0) (vector-normalize! s2-1 1.0) - (base-turret-method-44 obj s4-1 s1-0) - (base-turret-method-44 obj s3-1 s2-1) + (base-turret-method-44 this s4-1 s1-0) + (base-turret-method-44 this s3-1 s2-1) ) ) - (set! (-> obj gun-index) (- 1 (-> obj gun-index))) - (activate! (-> obj smush-control) 0.1 30 120 0.8 0.9 (-> *display* entity-clock)) + (set! (-> this gun-index) (- 1 (-> this gun-index))) + (activate! (-> this smush-control) 0.1 30 120 0.8 0.9 (-> *display* entity-clock)) ) - (seek! (-> obj heat-target) 1.05 0.1) + (seek! (-> this heat-target) 1.05 0.1) 0 (none) ) @@ -2166,7 +2166,7 @@ ;; definition for method 39 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-39 base-turret ((obj base-turret) (arg0 turret-path-event)) +(defmethod base-turret-method-39 base-turret ((this base-turret) (arg0 turret-path-event)) (case (-> arg0 event-type) (('script) (script-eval (the-as pair (-> arg0 param))) @@ -2179,32 +2179,32 @@ ) ) (('pause-until) - (set! (-> obj path-mode) (the-as uint 3)) - (set! (-> obj pause-proc) (the-as (function base-turret symbol) (-> arg0 param))) - (set! (-> obj path-speed-mult-final) 0.0) + (set! (-> this path-mode) (the-as uint 3)) + (set! (-> this pause-proc) (the-as (function base-turret symbol) (-> arg0 param))) + (set! (-> this path-speed-mult-final) 0.0) ) (('pause-while) - (set! (-> obj path-mode) (the-as uint 4)) - (set! (-> obj pause-proc) (the-as (function base-turret symbol) (-> arg0 param))) - (set! (-> obj path-speed-mult-final) 0.0) + (set! (-> this path-mode) (the-as uint 4)) + (set! (-> this pause-proc) (the-as (function base-turret symbol) (-> arg0 param))) + (set! (-> this path-speed-mult-final) 0.0) ) (('set-speed-mult) - (set! (-> obj path-speed-mult-final) (* 0.1 (the float (/ (the-as int (-> arg0 param)) 8)))) + (set! (-> this path-speed-mult-final) (* 0.1 (the float (/ (the-as int (-> arg0 param)) 8)))) ) (('enable-controls) - (set! (-> obj enable-controls) #t) + (set! (-> this enable-controls) #t) ) (('disable-controls) - (set! (-> obj enable-controls) #f) + (set! (-> this enable-controls) #f) ) (('set-roty-min) - (set! (-> obj roty-min) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) + (set! (-> this roty-min) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) ) (('set-roty-max) - (set! (-> obj roty-max) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) + (set! (-> this roty-max) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) ) (('set-rotyvv) - (set! (-> obj rotyvv) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) + (set! (-> this rotyvv) (* 182.04445 (the float (/ (the-as int (-> arg0 param)) 8)))) ) ) 0 @@ -2213,17 +2213,17 @@ ;; definition for method 38 of type base-turret ;; WARN: Return type mismatch int vs none. -(defmethod base-turret-method-38 base-turret ((obj base-turret)) - (when (nonzero? (-> obj path-event)) - (let* ((s5-0 (-> obj path-event)) - (f0-0 (get-num-segments (-> obj path))) - (f30-0 (* f0-0 (-> obj path-u))) - (f28-0 (* f0-0 (-> obj path-u-prev))) +(defmethod base-turret-method-38 base-turret ((this base-turret)) + (when (nonzero? (-> this path-event)) + (let* ((s5-0 (-> this path-event)) + (f0-0 (get-num-segments (-> this path))) + (f30-0 (* f0-0 (-> this path-u))) + (f28-0 (* f0-0 (-> this path-u-prev))) ) (dotimes (s4-0 (-> s5-0 event-count)) (let ((a1-0 (-> s5-0 event-tbl s4-0))) (if (and (>= f30-0 (-> a1-0 pos)) (< f28-0 (-> a1-0 pos))) - (base-turret-method-39 obj a1-0) + (base-turret-method-39 this a1-0) ) ) ) @@ -2234,28 +2234,28 @@ ) ;; definition for method 10 of type base-turret -(defmethod deactivate base-turret ((obj base-turret)) - (if (valid? (-> obj hud) (the-as type #f) "" #t 0) - (send-event (handle->process (-> obj hud)) 'hide-and-die) +(defmethod deactivate base-turret ((this base-turret)) + (if (valid? (-> this hud) (the-as type #f) "" #t 0) + (send-event (handle->process (-> this hud)) 'hide-and-die) ) - (sound-stop (-> obj sound-id 0)) - (sound-stop (-> obj sound-id 1)) - (sound-stop (-> obj sound-id 2)) - ((method-of-type process-drawable deactivate) obj) + (sound-stop (-> this sound-id 0)) + (sound-stop (-> this sound-id 1)) + (sound-stop (-> this sound-id 2)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 11 of type base-turret ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! base-turret ((obj base-turret) (arg0 entity-actor)) +(defmethod init-from-entity! base-turret ((this base-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (turret-init! obj arg0 (the-as matrix #f)) - (go (method-of-object obj idle)) + (turret-init! this arg0 (the-as matrix #f)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/engine/target/target-util_REF.gc b/test/decompiler/reference/jak2/engine/target/target-util_REF.gc index 3a354a9911..00b2bf7ad2 100644 --- a/test/decompiler/reference/jak2/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-util_REF.gc @@ -171,117 +171,117 @@ ) ;; definition for method 3 of type target-bank -(defmethod inspect target-bank ((obj target-bank)) - (when (not obj) - (set! obj obj) +(defmethod inspect target-bank ((this target-bank)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tjump-collide-offset: (meters ~m)~%" (-> obj jump-collide-offset)) - (format #t "~1Tjump-height-min: (meters ~m)~%" (-> obj jump-height-min)) - (format #t "~1Tjump-height-max: (meters ~m)~%" (-> obj jump-height-max)) - (format #t "~1Tdouble-jump-height-min: (meters ~m)~%" (-> obj double-jump-height-min)) - (format #t "~1Tdouble-jump-height-max: (meters ~m)~%" (-> obj double-jump-height-max)) - (format #t "~1Tflip-jump-height-min: (meters ~m)~%" (-> obj flip-jump-height-min)) - (format #t "~1Tflip-jump-height-max: (meters ~m)~%" (-> obj flip-jump-height-max)) - (format #t "~1Tduck-jump-height-min: (meters ~m)~%" (-> obj duck-jump-height-min)) - (format #t "~1Tduck-jump-height-max: (meters ~m)~%" (-> obj duck-jump-height-max)) - (format #t "~1Tflop-jump-height-min: (meters ~m)~%" (-> obj flop-jump-height-min)) - (format #t "~1Tflop-jump-height-max: (meters ~m)~%" (-> obj flop-jump-height-max)) - (format #t "~1Tattack-jump-height-min: (meters ~m)~%" (-> obj attack-jump-height-min)) - (format #t "~1Tattack-jump-height-max: (meters ~m)~%" (-> obj attack-jump-height-max)) - (format #t "~1Tedge-grab-jump-height-min: (meters ~m)~%" (-> obj edge-grab-jump-height-min)) - (format #t "~1Tedge-grab-jump-height-max: (meters ~m)~%" (-> obj edge-grab-jump-height-max)) - (format #t "~1Tswim-jump-height-min: (meters ~m)~%" (-> obj swim-jump-height-min)) - (format #t "~1Tswim-jump-height-max: (meters ~m)~%" (-> obj swim-jump-height-max)) - (format #t "~1Ttube-jump-height-min: (meters ~m)~%" (-> obj tube-jump-height-min)) - (format #t "~1Ttube-jump-height-max: (meters ~m)~%" (-> obj tube-jump-height-max)) - (format #t "~1Tcarry-jump-height-min: (meters ~m)~%" (-> obj carry-jump-height-min)) - (format #t "~1Tcarry-jump-height-max: (meters ~m)~%" (-> obj carry-jump-height-max)) - (format #t "~1Tmech-jump-height-min: (meters ~m)~%" (-> obj mech-jump-height-min)) - (format #t "~1Tmech-jump-height-max: (meters ~m)~%" (-> obj mech-jump-height-max)) - (format #t "~1Tmech-carry-jump-height-min: (meters ~m)~%" (-> obj mech-carry-jump-height-min)) - (format #t "~1Tmech-carry-jump-height-max: (meters ~m)~%" (-> obj mech-carry-jump-height-max)) - (format #t "~1Tindax-jump-height-min: (meters ~m)~%" (-> obj indax-jump-height-min)) - (format #t "~1Tindax-jump-height-max: (meters ~m)~%" (-> obj indax-jump-height-max)) - (format #t "~1Tindax-double-jump-height-min: (meters ~m)~%" (-> obj indax-double-jump-height-min)) - (format #t "~1Tindax-double-jump-height-max: (meters ~m)~%" (-> obj indax-double-jump-height-max)) - (format #t "~1Troll-duration: ~D~%" (-> obj roll-duration)) - (format #t "~1Troll-jump-pre-window: ~D~%" (-> obj roll-jump-pre-window)) - (format #t "~1Troll-jump-post-window: ~D~%" (-> obj roll-jump-post-window)) - (format #t "~1Troll-timeout: ~D~%" (-> obj roll-timeout)) - (format #t "~1Troll-speed-min: (meters ~m)~%" (-> obj roll-speed-min)) - (format #t "~1Troll-speed-inc: (meters ~m)~%" (-> obj roll-speed-inc)) - (format #t "~1Troll-flip-duration: ~D~%" (-> obj roll-flip-duration)) - (format #t "~1Troll-flip-height: (meters ~m)~%" (-> obj roll-flip-height)) - (format #t "~1Troll-flip-dist: (meters ~m)~%" (-> obj roll-flip-dist)) - (format #t "~1Troll-flip-art-height: (meters ~m)~%" (-> obj roll-flip-art-height)) - (format #t "~1Troll-flip-art-dist: (meters ~m)~%" (-> obj roll-flip-art-dist)) - (format #t "~1Tduck-slide-distance: (meters ~m)~%" (-> obj duck-slide-distance)) - (format #t "~1Tfall-far: (meters ~m)~%" (-> obj fall-far)) - (format #t "~1Tfall-far-inc: (meters ~m)~%" (-> obj fall-far-inc)) - (format #t "~1Tattack-timeout: ~D~%" (-> obj attack-timeout)) - (format #t "~1Tground-timeout: ~D~%" (-> obj ground-timeout)) - (format #t "~1Tslide-down-timeout: ~D~%" (-> obj slide-down-timeout)) - (format #t "~1Tfall-timeout: ~D~%" (-> obj fall-timeout)) - (format #t "~1Tfall-stumble-threshold: (meters ~m)~%" (-> obj fall-stumble-threshold)) - (format #t "~1Tyellow-projectile-speed: (meters ~m)~%" (-> obj yellow-projectile-speed)) - (format #t "~1Thit-invulnerable-timeout: ~D~%" (-> obj hit-invulnerable-timeout)) - (format #t "~1Tsame-attack-invulnerable-timeout: ~D~%" (-> obj same-attack-invulnerable-timeout)) - (format #t "~1Trun-cycle-length: ~f~%" (-> obj run-cycle-length)) - (format #t "~1Twalk-cycle-dist: (meters ~m)~%" (-> obj walk-cycle-dist)) - (format #t "~1Twalk-up-cycle-dist: (meters ~m)~%" (-> obj walk-up-cycle-dist)) - (format #t "~1Twalk-down-cycle-dist: (meters ~m)~%" (-> obj walk-down-cycle-dist)) - (format #t "~1Twalk-side-cycle-dist: (meters ~m)~%" (-> obj walk-side-cycle-dist)) - (format #t "~1Trun-cycle-dist: (meters ~m)~%" (-> obj run-cycle-dist)) - (format #t "~1Trun-up-cycle-dist: (meters ~m)~%" (-> obj run-up-cycle-dist)) - (format #t "~1Trun-down-cycle-dist: (meters ~m)~%" (-> obj run-down-cycle-dist)) - (format #t "~1Trun-side-cycle-dist: (meters ~m)~%" (-> obj run-side-cycle-dist)) - (format #t "~1Trun-wall-cycle-dist: (meters ~m)~%" (-> obj run-wall-cycle-dist)) - (format #t "~1Tduck-walk-cycle-dist: (meters ~m)~%" (-> obj duck-walk-cycle-dist)) - (format #t "~1Twade-shallow-walk-cycle-dist: (meters ~m)~%" (-> obj wade-shallow-walk-cycle-dist)) - (format #t "~1Twade-deep-walk-cycle-dist: (meters ~m)~%" (-> obj wade-deep-walk-cycle-dist)) - (format #t "~1Tmech-walk-cycle-dist: (meters ~m)~%" (-> obj mech-walk-cycle-dist)) - (format #t "~1Tmech-run-cycle-dist: (meters ~m)~%" (-> obj mech-run-cycle-dist)) - (format #t "~1Tsmack-surface-dist: (meters ~m)~%" (-> obj smack-surface-dist)) - (format #t "~1Tsmack-surface-height: (meters ~m)~%" (-> obj smack-surface-height)) - (format #t "~1Tmin-dive-depth: (meters ~m)~%" (-> obj min-dive-depth)) - (format #t "~1Troot-radius: (meters ~m)~%" (-> obj root-radius)) - (format #t "~1Troot-offset: ~`vector`P~%" (-> obj root-offset)) - (format #t "~1Tbody-radius: (meters ~m)~%" (-> obj body-radius)) - (format #t "~1Tedge-radius: (meters ~m)~%" (-> obj edge-radius)) - (format #t "~1Tedge-offset: ~`vector`P~%" (-> obj edge-offset)) - (format #t "~1Tedge-grab-height-off-ground: (meters ~m)~%" (-> obj edge-grab-height-off-ground)) - (format #t "~1Thead-radius: (meters ~m)~%" (-> obj head-radius)) - (format #t "~1Thead-height: (meters ~m)~%" (-> obj head-height)) - (format #t "~1Thead-offset: ~`vector`P~%" (-> obj head-offset)) - (format #t "~1Tspin-radius: (meters ~m)~%" (-> obj spin-radius)) - (format #t "~1Tspin-offset: ~`vector`P~%" (-> obj spin-offset)) - (format #t "~1Tduck-spin-radius: (meters ~m)~%" (-> obj duck-spin-radius)) - (format #t "~1Tduck-spin-offset: ~`vector`P~%" (-> obj duck-spin-offset)) - (format #t "~1Tpunch-radius: (meters ~m)~%" (-> obj punch-radius)) - (format #t "~1Tpunch-offset: ~`vector`P~%" (-> obj punch-offset)) - (format #t "~1Tuppercut-radius: (meters ~m)~%" (-> obj uppercut-radius)) - (format #t "~1Tuppercut0-offset: ~`vector`P~%" (-> obj uppercut0-offset)) - (format #t "~1Tuppercut1-offset: ~`vector`P~%" (-> obj uppercut1-offset)) - (format #t "~1Tflop-radius: (meters ~m)~%" (-> obj flop-radius)) - (format #t "~1Tflop0-offset: ~`vector`P~%" (-> obj flop0-offset)) - (format #t "~1Tflop1-offset: ~`vector`P~%" (-> obj flop1-offset)) - (format #t "~1Tstuck-time: (seconds ~e)~%" (-> obj stuck-time)) - (format #t "~1Tstuck-timeout: (seconds ~e)~%" (-> obj stuck-timeout)) - (format #t "~1Tstuck-distance: (meters ~m)~%" (-> obj stuck-distance)) - (format #t "~1Ttongue-pull-speed-min: ~f~%" (-> obj tongue-pull-speed-min)) - (format #t "~1Ttongue-pull-speed-max: ~f~%" (-> obj tongue-pull-speed-max)) - (format #t "~1Tyellow-attack-timeout: ~D~%" (-> obj yellow-attack-timeout)) - (format #t "~1Tfall-height: (meters ~m)~%" (-> obj fall-height)) - (format #t "~1Tmech-jump-thrust-fuel: ~f~%" (-> obj mech-jump-thrust-fuel)) - (format #t "~1Tstrafe-jump-pre-window: ~D~%" (-> obj strafe-jump-pre-window)) - (format #t "~1Tstrafe-jump: ~A~%" (-> obj strafe-jump)) - (format #t "~1Tstrafe-duck-jump: ~A~%" (-> obj strafe-duck-jump)) - (format #t "~1Tdark-jump-height-min: (meters ~m)~%" (-> obj dark-jump-height-min)) - (format #t "~1Tdark-jump-height-max: (meters ~m)~%" (-> obj dark-jump-height-max)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tjump-collide-offset: (meters ~m)~%" (-> this jump-collide-offset)) + (format #t "~1Tjump-height-min: (meters ~m)~%" (-> this jump-height-min)) + (format #t "~1Tjump-height-max: (meters ~m)~%" (-> this jump-height-max)) + (format #t "~1Tdouble-jump-height-min: (meters ~m)~%" (-> this double-jump-height-min)) + (format #t "~1Tdouble-jump-height-max: (meters ~m)~%" (-> this double-jump-height-max)) + (format #t "~1Tflip-jump-height-min: (meters ~m)~%" (-> this flip-jump-height-min)) + (format #t "~1Tflip-jump-height-max: (meters ~m)~%" (-> this flip-jump-height-max)) + (format #t "~1Tduck-jump-height-min: (meters ~m)~%" (-> this duck-jump-height-min)) + (format #t "~1Tduck-jump-height-max: (meters ~m)~%" (-> this duck-jump-height-max)) + (format #t "~1Tflop-jump-height-min: (meters ~m)~%" (-> this flop-jump-height-min)) + (format #t "~1Tflop-jump-height-max: (meters ~m)~%" (-> this flop-jump-height-max)) + (format #t "~1Tattack-jump-height-min: (meters ~m)~%" (-> this attack-jump-height-min)) + (format #t "~1Tattack-jump-height-max: (meters ~m)~%" (-> this attack-jump-height-max)) + (format #t "~1Tedge-grab-jump-height-min: (meters ~m)~%" (-> this edge-grab-jump-height-min)) + (format #t "~1Tedge-grab-jump-height-max: (meters ~m)~%" (-> this edge-grab-jump-height-max)) + (format #t "~1Tswim-jump-height-min: (meters ~m)~%" (-> this swim-jump-height-min)) + (format #t "~1Tswim-jump-height-max: (meters ~m)~%" (-> this swim-jump-height-max)) + (format #t "~1Ttube-jump-height-min: (meters ~m)~%" (-> this tube-jump-height-min)) + (format #t "~1Ttube-jump-height-max: (meters ~m)~%" (-> this tube-jump-height-max)) + (format #t "~1Tcarry-jump-height-min: (meters ~m)~%" (-> this carry-jump-height-min)) + (format #t "~1Tcarry-jump-height-max: (meters ~m)~%" (-> this carry-jump-height-max)) + (format #t "~1Tmech-jump-height-min: (meters ~m)~%" (-> this mech-jump-height-min)) + (format #t "~1Tmech-jump-height-max: (meters ~m)~%" (-> this mech-jump-height-max)) + (format #t "~1Tmech-carry-jump-height-min: (meters ~m)~%" (-> this mech-carry-jump-height-min)) + (format #t "~1Tmech-carry-jump-height-max: (meters ~m)~%" (-> this mech-carry-jump-height-max)) + (format #t "~1Tindax-jump-height-min: (meters ~m)~%" (-> this indax-jump-height-min)) + (format #t "~1Tindax-jump-height-max: (meters ~m)~%" (-> this indax-jump-height-max)) + (format #t "~1Tindax-double-jump-height-min: (meters ~m)~%" (-> this indax-double-jump-height-min)) + (format #t "~1Tindax-double-jump-height-max: (meters ~m)~%" (-> this indax-double-jump-height-max)) + (format #t "~1Troll-duration: ~D~%" (-> this roll-duration)) + (format #t "~1Troll-jump-pre-window: ~D~%" (-> this roll-jump-pre-window)) + (format #t "~1Troll-jump-post-window: ~D~%" (-> this roll-jump-post-window)) + (format #t "~1Troll-timeout: ~D~%" (-> this roll-timeout)) + (format #t "~1Troll-speed-min: (meters ~m)~%" (-> this roll-speed-min)) + (format #t "~1Troll-speed-inc: (meters ~m)~%" (-> this roll-speed-inc)) + (format #t "~1Troll-flip-duration: ~D~%" (-> this roll-flip-duration)) + (format #t "~1Troll-flip-height: (meters ~m)~%" (-> this roll-flip-height)) + (format #t "~1Troll-flip-dist: (meters ~m)~%" (-> this roll-flip-dist)) + (format #t "~1Troll-flip-art-height: (meters ~m)~%" (-> this roll-flip-art-height)) + (format #t "~1Troll-flip-art-dist: (meters ~m)~%" (-> this roll-flip-art-dist)) + (format #t "~1Tduck-slide-distance: (meters ~m)~%" (-> this duck-slide-distance)) + (format #t "~1Tfall-far: (meters ~m)~%" (-> this fall-far)) + (format #t "~1Tfall-far-inc: (meters ~m)~%" (-> this fall-far-inc)) + (format #t "~1Tattack-timeout: ~D~%" (-> this attack-timeout)) + (format #t "~1Tground-timeout: ~D~%" (-> this ground-timeout)) + (format #t "~1Tslide-down-timeout: ~D~%" (-> this slide-down-timeout)) + (format #t "~1Tfall-timeout: ~D~%" (-> this fall-timeout)) + (format #t "~1Tfall-stumble-threshold: (meters ~m)~%" (-> this fall-stumble-threshold)) + (format #t "~1Tyellow-projectile-speed: (meters ~m)~%" (-> this yellow-projectile-speed)) + (format #t "~1Thit-invulnerable-timeout: ~D~%" (-> this hit-invulnerable-timeout)) + (format #t "~1Tsame-attack-invulnerable-timeout: ~D~%" (-> this same-attack-invulnerable-timeout)) + (format #t "~1Trun-cycle-length: ~f~%" (-> this run-cycle-length)) + (format #t "~1Twalk-cycle-dist: (meters ~m)~%" (-> this walk-cycle-dist)) + (format #t "~1Twalk-up-cycle-dist: (meters ~m)~%" (-> this walk-up-cycle-dist)) + (format #t "~1Twalk-down-cycle-dist: (meters ~m)~%" (-> this walk-down-cycle-dist)) + (format #t "~1Twalk-side-cycle-dist: (meters ~m)~%" (-> this walk-side-cycle-dist)) + (format #t "~1Trun-cycle-dist: (meters ~m)~%" (-> this run-cycle-dist)) + (format #t "~1Trun-up-cycle-dist: (meters ~m)~%" (-> this run-up-cycle-dist)) + (format #t "~1Trun-down-cycle-dist: (meters ~m)~%" (-> this run-down-cycle-dist)) + (format #t "~1Trun-side-cycle-dist: (meters ~m)~%" (-> this run-side-cycle-dist)) + (format #t "~1Trun-wall-cycle-dist: (meters ~m)~%" (-> this run-wall-cycle-dist)) + (format #t "~1Tduck-walk-cycle-dist: (meters ~m)~%" (-> this duck-walk-cycle-dist)) + (format #t "~1Twade-shallow-walk-cycle-dist: (meters ~m)~%" (-> this wade-shallow-walk-cycle-dist)) + (format #t "~1Twade-deep-walk-cycle-dist: (meters ~m)~%" (-> this wade-deep-walk-cycle-dist)) + (format #t "~1Tmech-walk-cycle-dist: (meters ~m)~%" (-> this mech-walk-cycle-dist)) + (format #t "~1Tmech-run-cycle-dist: (meters ~m)~%" (-> this mech-run-cycle-dist)) + (format #t "~1Tsmack-surface-dist: (meters ~m)~%" (-> this smack-surface-dist)) + (format #t "~1Tsmack-surface-height: (meters ~m)~%" (-> this smack-surface-height)) + (format #t "~1Tmin-dive-depth: (meters ~m)~%" (-> this min-dive-depth)) + (format #t "~1Troot-radius: (meters ~m)~%" (-> this root-radius)) + (format #t "~1Troot-offset: ~`vector`P~%" (-> this root-offset)) + (format #t "~1Tbody-radius: (meters ~m)~%" (-> this body-radius)) + (format #t "~1Tedge-radius: (meters ~m)~%" (-> this edge-radius)) + (format #t "~1Tedge-offset: ~`vector`P~%" (-> this edge-offset)) + (format #t "~1Tedge-grab-height-off-ground: (meters ~m)~%" (-> this edge-grab-height-off-ground)) + (format #t "~1Thead-radius: (meters ~m)~%" (-> this head-radius)) + (format #t "~1Thead-height: (meters ~m)~%" (-> this head-height)) + (format #t "~1Thead-offset: ~`vector`P~%" (-> this head-offset)) + (format #t "~1Tspin-radius: (meters ~m)~%" (-> this spin-radius)) + (format #t "~1Tspin-offset: ~`vector`P~%" (-> this spin-offset)) + (format #t "~1Tduck-spin-radius: (meters ~m)~%" (-> this duck-spin-radius)) + (format #t "~1Tduck-spin-offset: ~`vector`P~%" (-> this duck-spin-offset)) + (format #t "~1Tpunch-radius: (meters ~m)~%" (-> this punch-radius)) + (format #t "~1Tpunch-offset: ~`vector`P~%" (-> this punch-offset)) + (format #t "~1Tuppercut-radius: (meters ~m)~%" (-> this uppercut-radius)) + (format #t "~1Tuppercut0-offset: ~`vector`P~%" (-> this uppercut0-offset)) + (format #t "~1Tuppercut1-offset: ~`vector`P~%" (-> this uppercut1-offset)) + (format #t "~1Tflop-radius: (meters ~m)~%" (-> this flop-radius)) + (format #t "~1Tflop0-offset: ~`vector`P~%" (-> this flop0-offset)) + (format #t "~1Tflop1-offset: ~`vector`P~%" (-> this flop1-offset)) + (format #t "~1Tstuck-time: (seconds ~e)~%" (-> this stuck-time)) + (format #t "~1Tstuck-timeout: (seconds ~e)~%" (-> this stuck-timeout)) + (format #t "~1Tstuck-distance: (meters ~m)~%" (-> this stuck-distance)) + (format #t "~1Ttongue-pull-speed-min: ~f~%" (-> this tongue-pull-speed-min)) + (format #t "~1Ttongue-pull-speed-max: ~f~%" (-> this tongue-pull-speed-max)) + (format #t "~1Tyellow-attack-timeout: ~D~%" (-> this yellow-attack-timeout)) + (format #t "~1Tfall-height: (meters ~m)~%" (-> this fall-height)) + (format #t "~1Tmech-jump-thrust-fuel: ~f~%" (-> this mech-jump-thrust-fuel)) + (format #t "~1Tstrafe-jump-pre-window: ~D~%" (-> this strafe-jump-pre-window)) + (format #t "~1Tstrafe-jump: ~A~%" (-> this strafe-jump)) + (format #t "~1Tstrafe-duck-jump: ~A~%" (-> this strafe-duck-jump)) + (format #t "~1Tdark-jump-height-min: (meters ~m)~%" (-> this dark-jump-height-min)) + (format #t "~1Tdark-jump-height-max: (meters ~m)~%" (-> this dark-jump-height-max)) (label cfg-4) - obj + this ) ;; definition for symbol *TARGET-bank*, type target-bank @@ -1112,8 +1112,8 @@ ) ;; definition for method 27 of type control-info -(defmethod get-quaternion control-info ((obj control-info)) - (-> obj quat-for-control) +(defmethod get-quaternion control-info ((this control-info)) + (-> this quat-for-control) ) ;; definition for function debounce-speed @@ -1136,12 +1136,12 @@ ) ;; definition for method 26 of type target -(defmethod get-inv-mass target ((obj target)) - (if (or (and (focus-test? obj dark) - (nonzero? (-> obj darkjak)) - (logtest? (-> obj darkjak stage) (darkjak-stage giant)) +(defmethod get-inv-mass target ((this target)) + (if (or (and (focus-test? this dark) + (nonzero? (-> this darkjak)) + (logtest? (-> this darkjak stage) (darkjak-stage giant)) ) - (focus-test? obj mech) + (focus-test? this mech) ) 0.1 1.0 @@ -1151,16 +1151,16 @@ ;; definition for method 16 of type target ;; INFO: Used lq/sq ;; WARN: Return type mismatch control-info vs trsqv. -(defmethod apply-alignment target ((obj target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) +(defmethod apply-alignment target ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector)) (with-pp (let ((s2-0 (new 'stack-no-clear 'vector))) (set! (-> s2-0 quad) (-> arg2 quad)) (set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z))) (when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel)) - (let* ((s3-0 (-> obj control c-R-w)) - (s0-0 (-> obj control w-R-c)) - (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control dynam gravity) s0-0)) - (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> obj control transv) s0-0)) + (let* ((s3-0 (-> this control c-R-w)) + (s0-0 (-> this control w-R-c)) + (s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control dynam gravity) s0-0)) + (a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control transv) s0-0)) ) (if (logtest? arg0 (align-opts no-gravity)) (set-vector! s1-0 0.0 0.0 0.0 1.0) @@ -1188,16 +1188,16 @@ (set! (-> a1-3 x) 0.0) ) ) - (vector-matrix*! (-> obj control transv) a1-3 s3-0) + (vector-matrix*! (-> this control transv) a1-3 s3-0) ) ) ) (if (logtest? arg0 (align-opts adjust-quat)) (quaternion-normalize! - (quaternion*! (-> obj control quat-for-control) (-> obj control quat-for-control) (-> arg1 quat)) + (quaternion*! (-> this control quat-for-control) (-> this control quat-for-control) (-> arg1 quat)) ) ) - (the-as trsqv (-> obj control)) + (the-as trsqv (-> this control)) ) ) @@ -1222,7 +1222,7 @@ (>= (- (-> *display* base-clock frame-counter) (-> self control cpad change-time)) (seconds 60)) (>= (- (-> *display* game-clock frame-counter) (the-as int (-> self game kiosk-timeout))) (seconds 60)) ) - (and (>= (- (current-time) (-> self ambient-time)) (seconds 30)) + (and (time-elapsed? (-> self ambient-time) (seconds 30)) (not (logtest? (-> self control status) (collide-status touch-actor))) (logtest? (-> self control status) (collide-status on-surface)) (not (or (logtest? (water-flags touch-water) (-> self water flags)) @@ -1266,15 +1266,14 @@ ;; definition for function can-jump? (defbehavior can-jump? target ((arg0 symbol)) (and (or (logtest? (-> self control status) (collide-status on-surface)) - (< (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (not (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) + ) (and (logtest? (-> self control status) (collide-status on-surface)) (< 0.866 (-> self control surface-angle)) ) (and (= arg0 'board) - (or (< (- (current-time) (-> self board unknown-time-frame00)) (seconds 0.05)) - (and (< (- (current-time) (-> self control last-time-of-stuck)) (seconds 0.5)) + (or (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.05))) + (and (not (time-elapsed? (-> self control last-time-of-stuck) (seconds 0.5))) (< (target-height-above-ground) 2048.0) ) ) @@ -1309,7 +1308,7 @@ (when (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) - (set! (-> self control last-time-of-stuck) (current-time)) + (set-time! (-> self control last-time-of-stuck)) #t ) ) @@ -1335,13 +1334,11 @@ ;; WARN: Return type mismatch object vs none. (defbehavior fall-test target ((arg0 (state symbol target)) (arg1 float)) (when (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) arg1) ) - (if (< (- (current-time) (-> self control rider-time)) (the-as time-frame (-> *TARGET-bank* ground-timeout))) + (if (not (time-elapsed? (-> self control rider-time) (the-as time-frame (-> *TARGET-bank* ground-timeout)))) (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) ) (go arg0 #f) @@ -1353,9 +1350,7 @@ ;; WARN: Return type mismatch object vs none. (defbehavior slide-down-test target () (if (and (not (logtest? (-> self control status) (collide-status on-surface touch-edge))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (logtest? (-> self control status) (collide-status touch-surface)) (< 0.5 (-> self control surface-angle)) ) @@ -1383,11 +1378,11 @@ (< (-> self control local-slope-z) 0.7) (not (logtest? (-> self state-flags) (state-flags prevent-attack prevent-duck))) (not (and (focus-test? self dark) (nonzero? (-> self darkjak)))) - (>= (- (current-time) (the-as int (-> *TARGET-bank* roll-timeout))) (-> self control last-roll-end-time)) + (time-elapsed? (the-as int (-> *TARGET-bank* roll-timeout)) (-> self control last-roll-end-time)) (or (not (enabled-gun? self)) (not (-> *TARGET-bank* strafe-duck-jump)) (and (< 0.3 (vector-dot (-> self control to-target-pt-xz) (-> self control c-R-w vector 2))) - (>= (- (current-time) (-> self control time-of-last-zero-input)) (seconds 0.3)) + (time-elapsed? (-> self control time-of-last-zero-input) (seconds 0.3)) ) ) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -1451,24 +1446,24 @@ #f ) ((and (or (not arg0) - (and (< (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (and (not (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) + ) (< (-> self control local-slope-z) 0.7) ) ) - (>= (- (current-time) (-> self control last-running-attack-end-time)) - (the-as time-frame (if (and (= (-> self fact eco-type) 1) (>= (-> self fact eco-level) 1.0)) - (-> *TARGET-bank* yellow-attack-timeout) - (-> *TARGET-bank* attack-timeout) - ) - ) - ) + (time-elapsed? + (-> self control last-running-attack-end-time) + (the-as time-frame (if (and (= (-> self fact eco-type) 1) (>= (-> self fact eco-level) 1.0)) + (-> *TARGET-bank* yellow-attack-timeout) + (-> *TARGET-bank* attack-timeout) + ) + ) + ) ) #t ) (else - (set! (-> self control last-hands-attempt-time) (current-time)) + (set-time! (-> self control last-hands-attempt-time)) #f ) ) @@ -1482,13 +1477,11 @@ ) #f ) - ((>= (- (current-time) (-> self control last-attack-end-time)) - (the-as time-frame (-> *TARGET-bank* attack-timeout)) - ) + ((time-elapsed? (-> self control last-attack-end-time) (the-as time-frame (-> *TARGET-bank* attack-timeout))) #t ) (else - (set! (-> self control last-feet-attempt-time) (current-time)) + (set-time! (-> self control last-feet-attempt-time)) #f ) ) @@ -1579,12 +1572,12 @@ (case arg2 ((1) (logior! (-> arg1 state-flags) (state-flags tinvul1)) - (set! (-> arg1 control invul1-on-time) (current-time)) + (set-time! (-> arg1 control invul1-on-time)) (set! (-> arg1 control invul1-off-time) arg0) ) ((2) (logior! (-> arg1 state-flags) (state-flags tinvul2)) - (set! (-> arg1 control invul2-on-time) (current-time)) + (set-time! (-> arg1 control invul2-on-time)) (set! (-> arg1 control invul2-off-time) arg0) ) ) @@ -1627,9 +1620,8 @@ (dotimes (a2-2 8) (let ((v1-9 (-> self attack-info-old a2-2))) (when (= (-> arg0 id) (-> v1-9 id)) - (if (< (- (current-time) (-> v1-9 attack-time)) - (the-as time-frame (-> *TARGET-bank* same-attack-invulnerable-timeout)) - ) + (if (not (time-elapsed? (-> v1-9 attack-time) (the-as time-frame (-> *TARGET-bank* same-attack-invulnerable-timeout))) + ) (return #f) ) (cond @@ -1660,7 +1652,7 @@ ;; definition for method 9 of type attack-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod attack-info-method-9 attack-info ((obj attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable)) +(defmethod attack-info-method-9 attack-info ((this attack-info) (arg0 attack-info) (arg1 process-drawable) (arg2 process-drawable)) (local-vars (v1-14 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1679,8 +1671,8 @@ ) ) (cond - ((logtest? (attack-mask attacker-velocity) (-> obj mask)) - (set! (-> arg0 attacker-velocity quad) (-> obj attacker-velocity quad)) + ((logtest? (attack-mask attacker-velocity) (-> this mask)) + (set! (-> arg0 attacker-velocity quad) (-> this attacker-velocity quad)) (vector-normalize-copy! (-> arg0 trans) (-> arg0 attacker-velocity) 1.0) ) (v1-0 @@ -1732,137 +1724,137 @@ ) ;; definition for method 10 of type attack-info -(defmethod compute-intersect-info attack-info ((obj attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry)) +(defmethod compute-intersect-info attack-info ((this attack-info) (arg0 object) (arg1 process-drawable) (arg2 process) (arg3 touching-shapes-entry)) (when (and arg3 arg1) (let ((a1-2 (prims-touching? arg3 (the-as collide-shape (-> arg1 root)) (the-as uint -1)))) (when a1-2 - (get-intersect-point (-> obj intersection) a1-2 (the-as collide-shape (-> arg1 root)) arg3) - (logior! (-> obj mask) (attack-mask intersection)) + (get-intersect-point (-> this intersection) a1-2 (the-as collide-shape (-> arg1 root)) arg3) + (logior! (-> this mask) (attack-mask intersection)) ) ) ) (when arg1 - (set! (-> obj prev-state) (-> arg1 state)) - (logior! (-> obj mask) (attack-mask prev-state)) + (set! (-> this prev-state) (-> arg1 state)) + (logior! (-> this mask) (attack-mask prev-state)) ) - (when (not (logtest? (-> obj mask) (attack-mask attacker))) - (set! (-> obj attacker) (process->handle arg2)) - (logior! (-> obj mask) (attack-mask attacker)) + (when (not (logtest? (-> this mask) (attack-mask attacker))) + (set! (-> this attacker) (process->handle arg2)) + (logior! (-> this mask) (attack-mask attacker)) ) - (when (not (logtest? (-> obj mask) (attack-mask attack-time))) - (set! (-> obj attack-time) (-> *display* base-clock frame-counter)) - (logior! (-> obj mask) (attack-mask attack-time)) + (when (not (logtest? (-> this mask) (attack-mask attack-time))) + (set! (-> this attack-time) (-> *display* base-clock frame-counter)) + (logior! (-> this mask) (attack-mask attack-time)) ) - (if (not (logtest? (attack-mask damage) (-> obj mask))) - (set! (-> obj damage) (-> *FACT-bank* health-default-inc)) + (if (not (logtest? (attack-mask damage) (-> this mask))) + (set! (-> this damage) (-> *FACT-bank* health-default-inc)) ) - obj + this ) ;; definition for method 11 of type attack-info ;; INFO: Used lq/sq -(defmethod combine! attack-info ((obj attack-info) (arg0 attack-info) (arg1 process-drawable)) +(defmethod combine! attack-info ((this attack-info) (arg0 attack-info) (arg1 process-drawable)) (let ((s4-0 (-> arg0 mask))) - (set! (-> obj mask) (-> arg0 mask)) + (set! (-> this mask) (-> arg0 mask)) (if (logtest? s4-0 (attack-mask attacker)) - (set! (-> obj attacker) (-> arg0 attacker)) + (set! (-> this attacker) (-> arg0 attacker)) ) (if (logtest? s4-0 (attack-mask mode)) - (set! (-> obj mode) (-> arg0 mode)) + (set! (-> this mode) (-> arg0 mode)) ) (if (logtest? s4-0 (attack-mask angle)) - (set! (-> obj angle) (-> arg0 angle)) + (set! (-> this angle) (-> arg0 angle)) ) (if (logtest? s4-0 (attack-mask dist)) - (set! (-> obj dist) (-> arg0 dist)) + (set! (-> this dist) (-> arg0 dist)) ) (if (logtest? s4-0 (attack-mask control)) - (set! (-> obj control) (-> arg0 control)) + (set! (-> this control) (-> arg0 control)) ) (if (logtest? s4-0 (attack-mask speed)) - (set! (-> obj speed) (-> arg0 speed)) + (set! (-> this speed) (-> arg0 speed)) ) (if (logtest? (attack-mask penetrate-using) s4-0) - (set! (-> obj penetrate-using) (-> arg0 penetrate-using)) + (set! (-> this penetrate-using) (-> arg0 penetrate-using)) ) (if (logtest? (attack-mask damage) s4-0) - (set! (-> obj damage) (-> arg0 damage)) + (set! (-> this damage) (-> arg0 damage)) ) (if (logtest? (attack-mask shield-damage) s4-0) - (set! (-> obj shield-damage) (-> arg0 shield-damage)) + (set! (-> this shield-damage) (-> arg0 shield-damage)) ) (if (logtest? (attack-mask knock) s4-0) - (set! (-> obj knock) (-> arg0 knock)) + (set! (-> this knock) (-> arg0 knock)) ) (if (logtest? (attack-mask count) s4-0) - (set! (-> obj count) (-> arg0 count)) + (set! (-> this count) (-> arg0 count)) ) (if (logtest? s4-0 (attack-mask id)) - (set! (-> obj id) (-> arg0 id)) + (set! (-> this id) (-> arg0 id)) ) (if (logtest? s4-0 (attack-mask shove-back)) - (set! (-> obj shove-back) (-> arg0 shove-back)) + (set! (-> this shove-back) (-> arg0 shove-back)) ) (if (logtest? s4-0 (attack-mask shove-up)) - (set! (-> obj shove-up) (-> arg0 shove-up)) + (set! (-> this shove-up) (-> arg0 shove-up)) ) (if (logtest? s4-0 (attack-mask invinc-time)) - (set! (-> obj invinc-time) (-> arg0 invinc-time)) + (set! (-> this invinc-time) (-> arg0 invinc-time)) ) (if (logtest? s4-0 (attack-mask rotate-to)) - (set! (-> obj rotate-to) (-> arg0 rotate-to)) + (set! (-> this rotate-to) (-> arg0 rotate-to)) ) (if (logtest? s4-0 (attack-mask intersection)) - (set! (-> obj intersection quad) (-> arg0 intersection quad)) + (set! (-> this intersection quad) (-> arg0 intersection quad)) ) (if (logtest? (attack-mask attacker-velocity) s4-0) - (set! (-> obj attacker-velocity quad) (-> arg0 attacker-velocity quad)) + (set! (-> this attacker-velocity quad) (-> arg0 attacker-velocity quad)) ) (cond ((not (logtest? s4-0 (attack-mask vector))) - (let* ((s2-0 (handle->process (-> obj attacker))) + (let* ((s2-0 (handle->process (-> this attacker))) (v1-65 (if (type? s2-0 process-drawable) s2-0 ) ) ) (when (and v1-65 (nonzero? (-> (the-as process-drawable v1-65) root))) - (set! (-> obj trans quad) (-> (the-as process-drawable v1-65) root trans quad)) - (vector-! (-> obj vector) (-> arg1 root trans) (-> (the-as process-drawable v1-65) root trans)) - (logior! (-> obj mask) (attack-mask vector)) + (set! (-> this trans quad) (-> (the-as process-drawable v1-65) root trans quad)) + (vector-! (-> this vector) (-> arg1 root trans) (-> (the-as process-drawable v1-65) root trans)) + (logior! (-> this mask) (attack-mask vector)) ) ) ) (else - (let* ((s3-1 (handle->process (-> obj attacker))) + (let* ((s3-1 (handle->process (-> this attacker))) (v1-72 (if (type? s3-1 process-drawable) s3-1 ) ) ) (if (and v1-72 (nonzero? (-> (the-as process-drawable v1-72) root))) - (set! (-> obj trans quad) (-> (the-as process-drawable v1-72) root trans quad)) + (set! (-> this trans quad) (-> (the-as process-drawable v1-72) root trans quad)) ) ) - (set! (-> obj vector quad) (-> arg0 vector quad)) + (set! (-> this vector quad) (-> arg0 vector quad)) (when (not (logtest? s4-0 (attack-mask shove-back))) - (let ((v1-79 (-> obj vector))) - (set! (-> obj shove-back) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z))))) + (let ((v1-79 (-> this vector))) + (set! (-> this shove-back) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z))))) ) ) (if (not (logtest? s4-0 (attack-mask shove-up))) - (set! (-> obj shove-up) (-> obj vector y)) + (set! (-> this shove-up) (-> this vector y)) ) ) ) - (if (not (logtest? (-> obj mask) (attack-mask dist))) - (set! (-> obj dist) (fabs (-> obj shove-back))) + (if (not (logtest? (-> this mask) (attack-mask dist))) + (set! (-> this dist) (fabs (-> this shove-back))) ) (if (logtest? s4-0 (attack-mask trans)) - (set! (-> obj trans quad) (-> arg0 trans quad)) + (set! (-> this trans quad) (-> arg0 trans quad)) ) ) - obj + this ) ;; definition for function ground-tween-initialize @@ -2036,24 +2028,24 @@ ;; definition for method 20 of type target ;; INFO: Used lq/sq -(defmethod get-trans target ((obj target) (arg0 int)) +(defmethod get-trans target ((this target) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (v0-0 vector)) - (let ((v1-0 (-> obj control))) + (let ((v1-0 (-> this control))) (cond ((zero? arg0) (-> v1-0 trans) ) ((= arg0 1) - (let ((a1-2 (-> obj water flags))) + (let ((a1-2 (-> this water flags))) (cond ((and (logtest? (water-flags touch-water) a1-2) (logtest? (water-flags under-water swimming) a1-2) - (not (logtest? (focus-status mech) (-> obj focus-status))) + (not (logtest? (focus-status mech) (-> this focus-status))) ) (set! v0-0 (new 'static 'vector :w 1.0)) - (set! (-> v0-0 quad) (-> obj control trans quad)) - (set! (-> v0-0 y) (-> obj water height)) + (set! (-> v0-0 quad) (-> this control trans quad)) + (set! (-> v0-0 y) (-> this water height)) v0-0 ) (else @@ -2063,10 +2055,10 @@ ) ) ((= arg0 2) - (vector<-cspace! (new 'static 'vector) (-> obj node-list data 8)) + (vector<-cspace! (new 'static 'vector) (-> this node-list data 8)) ) ((= arg0 3) - (set! v0-0 (vector<-cspace! (new 'static 'vector) (-> obj node-list data 6))) + (set! v0-0 (vector<-cspace! (new 'static 'vector) (-> this node-list data 6))) (set! (-> v0-0 w) 4096.0) v0-0 ) @@ -2074,15 +2066,15 @@ (target-cam-pos) ) ((= arg0 5) - (if (= (-> obj draw origin w) 0.0) + (if (= (-> this draw origin w) 0.0) (-> v1-0 trans) - (-> obj draw origin) + (-> this draw origin) ) ) ((= arg0 6) (let ((f0-4 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) (cond - ((and (< 0.0 f0-4) (focus-test? obj in-air)) + ((and (< 0.0 f0-4) (focus-test? this in-air)) (let* ((v0-1 (new 'static 'vector)) (f0-5 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-4)) (f0-8 (/ (* 0.5 f0-5 f0-5) (-> v1-0 dynam gravity-length))) @@ -2110,19 +2102,19 @@ ) ;; definition for method 23 of type target -(defmethod time-to-apex-or-ground target ((obj target) (arg0 int)) - (let ((v1-0 (-> obj control))) +(defmethod time-to-apex-or-ground target ((this target) (arg0 int)) + (let ((v1-0 (-> this control))) (cond ((zero? arg0) (let ((f0-1 (vector-dot (-> v1-0 dynam gravity-normal) (-> v1-0 transv)))) - (if (and (< 0.0 f0-1) (focus-test? obj in-air)) + (if (and (< 0.0 f0-1) (focus-test? this in-air)) (time-to-apex f0-1 (- (-> v1-0 dynam gravity-length))) 0 ) ) ) ((= arg0 1) - (if (focus-test? obj in-air) + (if (focus-test? this in-air) (the-as int (target-time-to-ground)) 0 ) @@ -2135,41 +2127,41 @@ ) ;; definition for method 21 of type target -(defmethod get-quat target ((obj target) (arg0 int)) +(defmethod get-quat target ((this target) (arg0 int)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (-> obj control quat) + (-> this control quat) ) ((= v1-0 1) - (-> obj control quat-for-control) + (-> this control quat-for-control) ) ((= v1-0 2) - (-> obj control dir-targ) + (-> this control dir-targ) ) ((= v1-0 3) - (if (using-gun? obj) + (if (using-gun? this) (forward-up->quaternion (new 'static 'quaternion) - (-> obj gun fire-dir-out) - (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj control quat-for-control)) + (-> this gun fire-dir-out) + (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this control quat-for-control)) ) - (-> obj control quat) + (-> this control quat) ) ) (else - (-> obj control quat) + (-> this control quat) ) ) ) ) ;; definition for method 24 of type target -(defmethod get-water-height target ((obj target)) - (-> obj water surface-height) +(defmethod get-water-height target ((this target)) + (-> this water surface-height) ) ;; definition for method 25 of type target -(defmethod get-notice-time target ((obj target)) - (-> obj neck notice-time) +(defmethod get-notice-time target ((this target)) + (-> this neck notice-time) ) diff --git a/test/decompiler/reference/jak2/engine/target/target2_REF.gc b/test/decompiler/reference/jak2/engine/target/target2_REF.gc index ef5d80c62a..9088efb753 100644 --- a/test/decompiler/reference/jak2/engine/target/target2_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target2_REF.gc @@ -12,7 +12,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('loading) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) #f ) (else @@ -23,8 +23,8 @@ :exit target-exit :code (behavior () (set! (-> self control mod-surface) *trip-mods*) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 0.05)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.05))) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! jakb-trip-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -44,7 +44,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.3)) + (until (time-elapsed? gp-0 (seconds 0.3)) (suspend) (ja :num! (seek! (ja-aframe 19.0 0) 0.05)) (suspend) @@ -121,10 +121,10 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () - (set! (-> self ambient-time) (current-time)) + (set-time! (-> self ambient-time)) (let ((a0-0 (-> self spool-anim))) (when (and a0-0 (= (-> *setting-control* user-current spooling) (process->ppointer self))) (ja-abort-spooled-anim a0-0 (the-as art-joint-anim #f) -1) @@ -186,8 +186,8 @@ (set! (-> a1-0 from) (process->ppointer self)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'dist-from-interp-src) - (and (or (< (send-event-function *camera* a1-0) 4915.2) (< (- (current-time) (-> self state-time)) (seconds 0.05))) - (and (< (- (current-time) (-> self state-time)) (seconds 0.07)) (zero? (ja-group-size))) + (and (or (< (send-event-function *camera* a1-0) 4915.2) (not (time-elapsed? (-> self state-time) (seconds 0.05)))) + (and (not (time-elapsed? (-> self state-time) (seconds 0.07))) (zero? (ja-group-size))) ) ) (suspend) @@ -363,7 +363,7 @@ (logior! (-> self skel effect flags) (effect-control-flag ecf2)) ) :exit (behavior () - (set! (-> self ambient-time) (current-time)) + (set-time! (-> self ambient-time)) (logclear! (-> self state-flags) (state-flags sf2)) (target-exit) ) @@ -514,7 +514,7 @@ ) :enter (behavior ((arg0 handle)) (set! (-> self control anim-handle) arg0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *pole-mods*) (logior! (-> self focus-status) (focus-status pole)) (target-collide-set! 'pole 0.0) @@ -538,7 +538,7 @@ (pad-buttons x) ) (not (logtest? (-> self state-flags) (state-flags prevent-jump))) - (>= (- (current-time) (-> self state-time)) (seconds 0.4)) + (time-elapsed? (-> self state-time) (seconds 0.4)) ) (set! (-> self control transv quad) (the-as uint128 0)) (cond @@ -732,11 +732,11 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> *edge-grab-info* pilot-edge-grab?) #f) (set! (-> self control unknown-handle000) (the-as handle #f)) (set! (-> self control mod-surface) *edge-grab-mods*) - (set! (-> self control edge-grab-start-time) (current-time)) + (set-time! (-> self control edge-grab-start-time)) (logior! (-> self control root-prim prim-core action) (collide-action dont-push-away)) (logior! (-> self focus-status) (focus-status edge-grab)) (set! (-> self control unknown-vector37 quad) (-> self control transv quad)) @@ -769,7 +769,7 @@ (set! (-> self control draw-offset y) 0.0) ) :trans (behavior () - (when (and (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.2)) (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) ) @@ -1001,7 +1001,7 @@ (logclear! (-> self control root-prim prim-core action) (collide-action dont-push-away)) (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.2))) (vector-float*! (-> self control transv) (-> self control edge-grab-across-edge-dir) -40960.0) - (if (< (- (current-time) (-> self control rider-time)) (seconds 0.2)) + (if (not (time-elapsed? (-> self control rider-time) (seconds 0.2))) (send-event self 'push-transv (-> self control rider-last-move) (seconds 100)) ) (go target-falling 'target-edge-grab) @@ -1113,7 +1113,7 @@ (-> self control wall-contact-normal) (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> self control quat)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (if (using-gun? self) @@ -1130,7 +1130,7 @@ (go target-ice-stance) ) (if (and (move-legs?) - (and (>= (- (current-time) (-> self state-time)) (seconds 1)) + (and (time-elapsed? (-> self state-time) (seconds 1)) (let ((f0-1 (vector-dot (-> self control to-target-pt-xz) (-> self control wall-contact-normal)))) (< 0.1 f0-1) ) @@ -1243,7 +1243,7 @@ (let ((s5-0 (rand-vu-int-range 30 600))) (ja :group! jakb-wall-hide-head-ja) (let ((s4-0 (current-time))) - (until (>= (- (current-time) s4-0) s5-0) + (until (time-elapsed? s4-0 s5-0) (gp-0) (suspend) ) @@ -1287,7 +1287,7 @@ (let ((s5-2 (rand-vu-int-range 60 300)) (s4-2 (current-time)) ) - (until (>= (- (current-time) s4-2) s5-2) + (until (time-elapsed? s4-2 s5-2) (gp-0) (suspend) ) @@ -1309,7 +1309,7 @@ (let ((s5-3 (rand-vu-int-range 60 300)) (s4-3 (current-time)) ) - (until (>= (- (current-time) s4-3) s5-3) + (until (time-elapsed? s4-3 s5-3) (gp-0) (suspend) ) @@ -1339,7 +1339,7 @@ ) ) :code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *turn-around-mods*) (ja-channel-push! 1 (seconds 0.15)) (set-forward-vel 0.0) @@ -1363,7 +1363,7 @@ (set! sv-40 v1-2) ) (set! sv-44 #t) - (until (>= (- (current-time) sv-32) arg1) + (until (time-elapsed? sv-32 arg1) (let ((s4-0 (ppointer->process (-> self parent)))) (cond ((and sv-44 @@ -1509,7 +1509,7 @@ ) (rot->dir-targ! (-> self control)) (logior! (-> self control status) (collide-status on-surface on-ground touch-surface)) - (set! (-> self control last-time-on-surface) (current-time)) + (set-time! (-> self control last-time-on-surface)) (ja-channel-set! 0) (ja-post) (target-exit) @@ -1574,7 +1574,7 @@ ) ) :trans (behavior () - (set! (-> self control time-of-last-debug-float) (current-time)) + (set-time! (-> self control time-of-last-debug-float)) (cond ((cpad-hold? (-> self control cpad number) r2) (let ((a1-0 (new 'stack-no-clear 'vector))) diff --git a/test/decompiler/reference/jak2/engine/target/target_REF.gc b/test/decompiler/reference/jak2/engine/target/target_REF.gc index 5c8627391a..9f53129c13 100644 --- a/test/decompiler/reference/jak2/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target_REF.gc @@ -15,7 +15,7 @@ ) (when (if (and (< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance)) (>= arg1 0) - (>= (- (current-time) (-> self state-time)) arg1) + (time-elapsed? (-> self state-time) arg1) (not (and *cheat-mode* (cpad-hold? (-> self control cpad number) r2))) ) #t @@ -46,7 +46,7 @@ :event target-standard-event-handler :enter (behavior () (set! (-> self control mod-surface) *walk-mods*) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (logclear! (-> self state-flags) (state-flags lleg-still rleg-still)) @@ -145,7 +145,7 @@ (if (and (using-gun? self) (-> self next-state) (= (-> self next-state name) 'target-walk)) (go target-gun-walk) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *walk-mods*) ) :exit (behavior () @@ -216,7 +216,7 @@ ) (go target-running-attack) ) - (when (and (turn-around?) (>= (- (current-time) (-> self state-time)) (seconds 0.3))) + (when (and (turn-around?) (time-elapsed? (-> self state-time) (seconds 0.3))) (set! (-> self control transv quad) (-> self control transv-history (-> self control idx-of-fastest-xz-vel) quad) ) @@ -281,7 +281,7 @@ (go target-running-attack) ) (if (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) (seconds 0.08)) + (time-elapsed? (-> self control last-time-on-surface) (seconds 0.08)) ) (go target-falling #f) ) @@ -315,7 +315,7 @@ (set! (-> self control mod-surface) *jump-mods*) ) :exit (behavior () - (set! (-> self control unknown-time-frame13) (current-time)) + (set-time! (-> self control unknown-time-frame13)) ) :trans (behavior () (when (or (logtest? (-> self control status) (collide-status on-surface)) @@ -428,7 +428,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *slide-down-mods*) (set! (-> self control sliding-start-time) 0) (set! (-> self control force-turn-to-strength) 1.0) @@ -437,7 +437,7 @@ :exit (behavior () (target-effect-exit) (target-exit) - (set! (-> self control unknown-time-frame13) (current-time)) + (set-time! (-> self control unknown-time-frame13)) ) :trans (behavior () (if (and (or (and (logtest? (-> self control status) (collide-status on-surface)) @@ -456,7 +456,7 @@ ) (zero? (-> self control sliding-start-time)) ) - (set! (-> self control sliding-start-time) (current-time)) + (set-time! (-> self control sliding-start-time)) ) (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (-> *cpad-list* cpads (-> self control cpad number) button0-rel 1) @@ -496,7 +496,7 @@ (pad-buttons square) ) (can-hands? #t) - (>= (- (current-time) (-> self control last-running-attack-end-time)) (seconds 0.7)) + (time-elapsed? (-> self control last-running-attack-end-time) (seconds 0.7)) (!= (-> self state-time) (current-time)) ) (go target-running-attack) @@ -560,7 +560,7 @@ (set! arg1 (* arg1 (-> self darkjak-giant-interp))) ) (logclear! (-> self control status) (collide-status touch-ceiling-sticky)) - (set! (-> self control unknown-time-frame19) (current-time)) + (set-time! (-> self control unknown-time-frame19)) (delete-back-vel) (let* ((f0-4 arg5) (f1-2 0.0) @@ -572,7 +572,7 @@ (s3-1 (+ arg0 f0-5)) ) (let ((s2-1 (+ arg1 f0-5))) - (when (< (- (current-time) (-> self control rider-time)) (seconds 0.05)) + (when (not (time-elapsed? (-> self control rider-time) (seconds 0.05))) (let ((f0-8 (fmax 0.0 @@ -771,7 +771,7 @@ :event target-standard-event-handler :enter (behavior ((arg0 symbol)) (if (not arg0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (set! (-> self control bend-target) 1.0) (set! (-> self control mod-surface) *duck-mods*) @@ -924,7 +924,7 @@ :event target-standard-event-handler :enter (behavior ((arg0 symbol)) (if (not arg0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (set! (-> self control bend-target) 1.0) (target-collide-set! 'duck 1.0) @@ -1075,7 +1075,7 @@ (go target-launch (the-as float a0-7) (the-as symbol a1-3) a2-3 (-> self control unknown-dword10)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 70) (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) @@ -1132,9 +1132,7 @@ (* 26624.0 (-> self darkjak-giant-interp) (-> self darkjak-giant-interp)) ) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (>= (- (current-time) (-> self control last-time-of-stuck)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -1328,7 +1326,7 @@ (go target-launch (the-as float a0-3) (the-as symbol a1-1) a2-0 (-> self control unknown-dword10)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (if (!= (-> self control mod-surface) *slide-jump-mods*) @@ -1351,9 +1349,7 @@ (if (and (cpad-pressed? (-> self control cpad number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (>= (- (current-time) (-> self control last-time-of-stuck)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -1451,7 +1447,7 @@ (if (or (= arg2 'duck) (= arg2 'launch)) (go target-duck-high-jump arg0 arg1 (the-as symbol arg2)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (sound-play "jump" :pitch 0.3) (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) @@ -1493,9 +1489,7 @@ ) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (>= (- (current-time) (-> self control last-time-of-stuck)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -1527,7 +1521,7 @@ (defstate target-duck-high-jump (target) :event target-standard-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *turn-around-mods*) (case arg2 @@ -1575,7 +1569,7 @@ :event target-jump-event-handler :enter (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (set! (-> self control unknown-symbol03) (the-as float arg2)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 80 :pitch -0.4) (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) @@ -1719,7 +1713,7 @@ ) ) (set! (-> self control unknown-word04) (the-as uint arg0)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (target-falling-trans @@ -1994,7 +1988,7 @@ (the-as int (-> self control attack-count)) (-> self control penetrate-using) ) - (set! (-> self gun combo-window-start) (current-time)) + (set-time! (-> self gun combo-window-start)) (let ((v0-2 (the-as object (-> self state name)))) (set! (-> self gun combo-window-state) (the-as symbol v0-2)) v0-2 @@ -2027,7 +2021,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (target-start-attack) (target-danger-set! 'spin #f) (set! (-> self control mod-surface) *attack-mods*) @@ -2050,7 +2044,7 @@ (if (zero? (-> self gun track-target-hold-time)) (quaternion-copy! (-> self control dir-targ) (-> self control unknown-quaternion04)) ) - (set! (-> self control last-attack-end-time) (current-time)) + (set-time! (-> self control last-attack-end-time)) (target-exit) ) :code (behavior () @@ -2244,8 +2238,8 @@ ) ) (when gp-1 - (set! (-> self control sliding-start-time) (current-time)) - (set! (-> self gun combo-window-start) (current-time)) + (set-time! (-> self control sliding-start-time)) + (set-time! (-> self gun combo-window-start)) (set! (-> self gun combo-window-state) (-> self state name)) (let ((v1-13 (if (type? proc process-focusable) proc @@ -2312,7 +2306,7 @@ ) (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square)) (logclear! (-> *cpad-list* cpads (-> self control cpad number) button0-rel 0) (pad-buttons square)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (combo-tracker-method-12 (-> self control unknown-combo-tracker00) *null-vector* @@ -2347,7 +2341,7 @@ (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) (set! (-> *run-attack-mods* turnv) 0.0) (set! (-> *run-attack-mods* turnvv) 0.0) - (set! (-> self control last-running-attack-end-time) (current-time)) + (set-time! (-> self control last-running-attack-end-time)) (target-exit) ) :trans (behavior () @@ -2358,7 +2352,7 @@ ) ) (begin - (set! (-> self control unknown-time-frame18) (current-time)) + (set-time! (-> self control unknown-time-frame18)) (set! (-> self control bend-target) 0.0) (let ((v1-11 (new-stack-vector0)) (f0-3 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) @@ -2379,14 +2373,14 @@ #t ) (or (zero? (-> self control sliding-start-time)) - (>= (- (current-time) (-> self control sliding-start-time)) (seconds 0.04)) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) ) (!= (-> self control unknown-word04) 1) ) ) (if (and (cpad-pressed? (-> self control cpad number) x) (< 4096.0 (-> self control ctrl-xz-vel)) - (or (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (or (time-elapsed? (-> self state-time) (seconds 0.1)) (not (logtest? (-> *cpad-list* cpads (-> self control cpad number) button0-abs 0) (pad-buttons square))) ) (not (logtest? (-> self state-flags) (state-flags prevent-jump prevent-attack))) @@ -2492,13 +2486,11 @@ (cond ((and (>= (ja-aframe-num 0) 20.0) (and (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) - (>= (- (current-time) (-> self control sliding-start-time)) (seconds 0.04)) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) ) ) (go target-falling #f) @@ -2508,12 +2500,12 @@ (set-forward-vel (the-as float f26-0)) ) ((and (nonzero? (-> self control unknown-time-frame18)) - (>= (- (current-time) (-> self control unknown-time-frame18)) (seconds 0.04)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) ) (set-forward-vel 0.0) ) ((and (not (cpad-hold? (-> self control cpad number) square)) - (>= (- (current-time) (-> self control unknown-combo-tracker00 move-start-time)) (seconds 0.05)) + (time-elapsed? (-> self control unknown-combo-tracker00 move-start-time) (seconds 0.05)) ) (if (= (-> self control ground-pat material) (pat-material ice)) (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) @@ -2631,7 +2623,7 @@ ) (suspend) (ja :num! (seek! max (* (-> self control current-surface align-speed) f28-0))) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (if (< 2 gp-2) @@ -2641,9 +2633,7 @@ ) ) (if (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) @@ -2754,7 +2744,7 @@ ) ) :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (target-start-attack) (target-danger-set! 'spin-air #f) @@ -2830,7 +2820,7 @@ :exit (behavior () (set! (-> self control dynam gravity-max) (-> self control standard-dynamics gravity-max)) (set! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length)) - (set! (-> self control last-attack-end-time) (current-time)) + (set-time! (-> self control last-attack-end-time)) (target-exit) ) :trans (behavior () @@ -2838,14 +2828,14 @@ (set-quaternion! (-> self control) (-> self control dir-targ)) (go target-hit-ground #f) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (seek! (-> self control dynam gravity-length) (-> self control standard-dynamics gravity-length) (* 245760.0 (seconds-per-frame)) ) ) - (when (and (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.05)) (< (vector-dot (-> self control dynam gravity-normal) (-> self control last-transv)) (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) ) @@ -2932,7 +2922,7 @@ (defstate target-attack-uppercut (target) :event target-dangerous-event-handler :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (target-start-attack) (target-danger-set! 'uppercut #f) (set! (-> self control mod-surface) *uppercut-mods*) @@ -3086,14 +3076,14 @@ (if (and (= (-> self control ground-pat material) (pat-material ice)) (< 32768.0 (-> self control ctrl-xz-vel))) (set-forward-vel 32768.0) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 #t #f (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self neck flex-blend) 0.0) (set! (-> self control mod-surface) *uppercut-jump-mods*) (target-start-attack) (target-danger-set! 'uppercut #f) - (set! (-> self gun combo-window-start) (current-time)) + (set-time! (-> self gun combo-window-start)) (set! (-> self gun combo-window-state) (-> self state name)) (set! (-> self gun track-target-hold-time) 0) 0 @@ -3106,9 +3096,7 @@ (when (and (cpad-pressed? (-> self control cpad number) square) (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (and (>= (- (current-time) (-> self control last-time-of-stuck)) - (the-as time-frame (-> *TARGET-bank* stuck-timeout)) - ) + (and (time-elapsed? (-> self control last-time-of-stuck) (the-as time-frame (-> *TARGET-bank* stuck-timeout))) (not (logtest? (-> self state-flags) (state-flags prevent-attack))) (not (logtest? (-> self control current-surface flags) (surface-flag no-attack no-hands))) (not (and (not (using-gun? self)) (!= (-> self skel top-anim interp) 0.0))) @@ -3216,7 +3204,7 @@ ) ) ) - (set! (-> self gun surpress-time) (current-time)) + (set-time! (-> self gun surpress-time)) (go target-falling #f) ) :post target-post @@ -3269,7 +3257,7 @@ (set-forward-vel arg2) (set-forward-vel (-> self control ctrl-xz-vel)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *flop-mods*) (set! (-> self neck flex-blend) 0.0) @@ -3322,7 +3310,7 @@ (not (logtest? (-> self control status) (collide-status touch-actor))) (>= (-> self control unknown-word04) (the-as uint 2)) ) - (set! (-> self control last-time-of-stuck) (current-time)) + (set-time! (-> self control last-time-of-stuck)) (set! gp-1 'stuck) ) ) @@ -3469,7 +3457,7 @@ ) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> *TARGET-bank* fall-timeout))) + (if (and (time-elapsed? (-> self state-time) (the-as time-frame (-> *TARGET-bank* fall-timeout))) (!= (-> self tobot?) 'tobot) ) (go target-falling #f) @@ -3521,7 +3509,7 @@ ) (target-land-effect) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control unknown-word04) (the-as uint arg0)) (set-forward-vel 0.0) (set! (-> self control mod-surface) *flop-land-mods*) @@ -3551,7 +3539,7 @@ ) ) (when (and (and (= (-> self fact eco-type) 2) (>= (-> self fact eco-level) 1.0)) - (< (- (current-time) (-> self state-time)) (seconds 0.25)) + (not (time-elapsed? (-> self state-time) (seconds 0.25))) ) (do-effect (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) (if (rand-vu-percent? 0.5) 22 @@ -3602,7 +3590,7 @@ ) :enter (behavior () (target-collide-set! 'duck 1.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self neck flex-blend) 0.0) (set! (-> self neck base-joint) (the-as uint 8)) (set! (-> self control mod-surface) *roll-mods*) @@ -3622,7 +3610,7 @@ :exit (behavior () (when (not (and (-> self next-state) (= (-> self next-state name) 'target-roll))) (set! (-> self control unknown-word02) 0) - (set! (-> self control last-roll-end-time) (current-time)) + (set-time! (-> self control last-roll-end-time)) ) (target-exit) (target-collide-set! 'normal 0.0) @@ -3649,14 +3637,14 @@ (if (cpad-pressed? (-> self control cpad number) x) (set! gp-0 (the-as int (current-time))) ) - (when (and (not s4-0) (>= (- (current-time) (-> self state-time)) (seconds 0.2))) + (when (and (not s4-0) (time-elapsed? (-> self state-time) (seconds 0.2))) (set! s4-0 #t) - (set! (-> self gun combo-window-start) (current-time)) + (set-time! (-> self gun combo-window-start)) (set! (-> self gun combo-window-state) (-> self state name)) ) (when (and (or (smack-surface? #f) (>= (-> self control surface-slope-z) 0.7)) - (>= (the-as uint (- (current-time) (the-as int (-> self control unknown-word04)))) (the-as uint 3)) - (>= (- (current-time) (-> self state-time)) 1) + (time-elapsed? (the-as int (-> self control unknown-word04)) (seconds 0.01)) + (time-elapsed? (-> self state-time) 1) ) (when (>= 6.0 (ja-aframe-num 0)) (if (using-gun? self) @@ -3694,7 +3682,7 @@ (set! f30-0 (* f30-0 (fmin 1.0 (-> self control zx-vel-frac)))) ) ) - (if (and (or (< (- (current-time) (the-as time-frame gp-0)) (the-as time-frame (-> *TARGET-bank* roll-jump-pre-window))) + (if (and (or (not (time-elapsed? (the-as time-frame gp-0) (the-as time-frame (-> *TARGET-bank* roll-jump-pre-window)))) (cpad-pressed? (-> self control cpad number) x) ) (can-jump? 'target-roll-flip) @@ -3702,12 +3690,12 @@ (go target-roll-flip (-> *TARGET-bank* roll-flip-height) (-> *TARGET-bank* roll-flip-dist)) ) ) - (set! (-> self state-hook-time) (current-time)) + (set-time! (-> self state-hook-time)) (set! (-> self state-hook) (lambda :behavior target () (cond - ((>= (- (current-time) (-> self state-hook-time)) (the-as time-frame (-> *TARGET-bank* roll-jump-post-window))) + ((time-elapsed? (-> self state-hook-time) (the-as time-frame (-> *TARGET-bank* roll-jump-post-window))) (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) ) (else @@ -3759,7 +3747,7 @@ (set! (-> self neck flex-blend) 0.0) (set! (-> self neck base-joint) (the-as uint 8)) (set! (-> self gun track-target-hold-time) 0) - (set! (-> self gun combo-window-start) (current-time)) + (set-time! (-> self gun combo-window-start)) (set! (-> self gun combo-window-state) (-> self state name)) (target-collide-set! 'duck 1.0) ) @@ -3831,9 +3819,9 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while (not (logtest? (-> self control status) (collide-status on-surface))) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.01)) + (when (time-elapsed? (-> self state-time) (seconds 0.01)) (let ((v1-50 (ja-group))) (when (not (and v1-50 (= v1-50 jakb-jump-loop-ja))) (ja-channel-push! 1 (seconds 0.1)) @@ -3867,12 +3855,12 @@ ) (target-land-effect) (set! (-> self gun surpress-time) (+ (current-time) (seconds 0.1))) - (set! (-> self state-hook-time) (current-time)) + (set-time! (-> self state-hook-time)) (set! (-> self state-hook) (lambda :behavior target () (cond - ((>= (- (current-time) (-> self state-hook-time)) (seconds 0.1)) + ((time-elapsed? (-> self state-hook-time) (seconds 0.1)) (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) ) (else diff --git a/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc index 60c205fbe6..3f349acd2f 100644 --- a/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc @@ -11,15 +11,15 @@ ) ;; definition for method 3 of type bigmap-bit-mask -(defmethod inspect bigmap-bit-mask ((obj bigmap-bit-mask)) - (when (not obj) - (set! obj obj) +(defmethod inspect bigmap-bit-mask ((this bigmap-bit-mask)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bigmap-bit-mask) - (format #t "~1Tdata[6656] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'bigmap-bit-mask) + (format #t "~1Tdata[6656] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type bigmap-layer-mask @@ -32,15 +32,15 @@ ) ;; definition for method 3 of type bigmap-layer-mask -(defmethod inspect bigmap-layer-mask ((obj bigmap-layer-mask)) - (when (not obj) - (set! obj obj) +(defmethod inspect bigmap-layer-mask ((this bigmap-layer-mask)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bigmap-layer-mask) - (format #t "~1Tdata[26624] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'bigmap-layer-mask) + (format #t "~1Tdata[26624] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type bigmap-image @@ -56,18 +56,18 @@ ) ;; definition for method 3 of type bigmap-image -(defmethod inspect bigmap-image ((obj bigmap-image)) - (when (not obj) - (set! obj obj) +(defmethod inspect bigmap-image ((this bigmap-image)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bigmap-image) - (format #t "~1Tclut-offset: ~D~%" (-> obj clut-offset)) - (format #t "~1Timage-offset: ~D~%" (-> obj image-offset)) - (format #t "~1Tpad[2] @ #x~X~%" (-> obj pad)) - (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'bigmap-image) + (format #t "~1Tclut-offset: ~D~%" (-> this clut-offset)) + (format #t "~1Timage-offset: ~D~%" (-> this image-offset)) + (format #t "~1Tpad[2] @ #x~X~%" (-> this pad)) + (format #t "~1Tdata[1] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type bigmap-info @@ -82,22 +82,22 @@ ;; definition for method 3 of type bigmap-info ;; INFO: Used lq/sq -(defmethod inspect bigmap-info ((obj bigmap-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect bigmap-info ((this bigmap-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bigmap-info) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj scale)) - (format #t "~1Tw: ~f~%" (-> obj inv-scale)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tscale: ~f~%" (-> obj scale)) - (format #t "~1Tinv-scale: ~f~%" (-> obj inv-scale)) + (format #t "[~8x] ~A~%" this 'bigmap-info) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this scale)) + (format #t "~1Tw: ~f~%" (-> this inv-scale)) + (format #t "~1Tquad: ~D~%" (-> this quad)) + (format #t "~1Tscale: ~f~%" (-> this scale)) + (format #t "~1Tinv-scale: ~f~%" (-> this inv-scale)) (label cfg-4) - obj + this ) ;; definition of type bigmap-info-array @@ -110,15 +110,15 @@ ) ;; definition for method 3 of type bigmap-info-array -(defmethod inspect bigmap-info-array ((obj bigmap-info-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect bigmap-info-array ((this bigmap-info-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bigmap-info-array) - (format #t "~1Tdata[21] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'bigmap-info-array) + (format #t "~1Tdata[21] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type bigmap-compressed-layers @@ -151,35 +151,35 @@ ) ;; definition for method 3 of type bigmap-compressed-layers -(defmethod inspect bigmap-compressed-layers ((obj bigmap-compressed-layers)) - (when (not obj) - (set! obj obj) +(defmethod inspect bigmap-compressed-layers ((this bigmap-compressed-layers)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bigmap-compressed-layers) - (format #t "~1Tdata[20] @ #x~X~%" (&-> obj layer0)) - (format #t "~1Tlayer0: #x~X~%" (-> obj layer0)) - (format #t "~1Tlayer1: #x~X~%" (-> obj layer1)) - (format #t "~1Tlayer2: #x~X~%" (-> obj layer2)) - (format #t "~1Tlayer3: #x~X~%" (-> obj layer3)) - (format #t "~1Tlayer4: #x~X~%" (-> obj layer4)) - (format #t "~1Tlayer5: #x~X~%" (-> obj layer5)) - (format #t "~1Tlayer6: #x~X~%" (-> obj layer6)) - (format #t "~1Tlayer7: #x~X~%" (-> obj layer7)) - (format #t "~1Tlayer8: #x~X~%" (-> obj layer8)) - (format #t "~1Tlayer9: #x~X~%" (-> obj layer9)) - (format #t "~1Tlayer10: #x~X~%" (-> obj layer10)) - (format #t "~1Tlayer11: #x~X~%" (-> obj layer11)) - (format #t "~1Tlayer12: #x~X~%" (-> obj layer12)) - (format #t "~1Tlayer13: #x~X~%" (-> obj layer13)) - (format #t "~1Tlayer14: #x~X~%" (-> obj layer14)) - (format #t "~1Tlayer15: #x~X~%" (-> obj layer15)) - (format #t "~1Tlayer16: #x~X~%" (-> obj layer16)) - (format #t "~1Tlayer17: #x~X~%" (-> obj layer17)) - (format #t "~1Tlayer18: #x~X~%" (-> obj layer18)) - (format #t "~1Tlayer19: #x~X~%" (-> obj layer19)) + (format #t "[~8x] ~A~%" this 'bigmap-compressed-layers) + (format #t "~1Tdata[20] @ #x~X~%" (&-> this layer0)) + (format #t "~1Tlayer0: #x~X~%" (-> this layer0)) + (format #t "~1Tlayer1: #x~X~%" (-> this layer1)) + (format #t "~1Tlayer2: #x~X~%" (-> this layer2)) + (format #t "~1Tlayer3: #x~X~%" (-> this layer3)) + (format #t "~1Tlayer4: #x~X~%" (-> this layer4)) + (format #t "~1Tlayer5: #x~X~%" (-> this layer5)) + (format #t "~1Tlayer6: #x~X~%" (-> this layer6)) + (format #t "~1Tlayer7: #x~X~%" (-> this layer7)) + (format #t "~1Tlayer8: #x~X~%" (-> this layer8)) + (format #t "~1Tlayer9: #x~X~%" (-> this layer9)) + (format #t "~1Tlayer10: #x~X~%" (-> this layer10)) + (format #t "~1Tlayer11: #x~X~%" (-> this layer11)) + (format #t "~1Tlayer12: #x~X~%" (-> this layer12)) + (format #t "~1Tlayer13: #x~X~%" (-> this layer13)) + (format #t "~1Tlayer14: #x~X~%" (-> this layer14)) + (format #t "~1Tlayer15: #x~X~%" (-> this layer15)) + (format #t "~1Tlayer16: #x~X~%" (-> this layer16)) + (format #t "~1Tlayer17: #x~X~%" (-> this layer17)) + (format #t "~1Tlayer18: #x~X~%" (-> this layer18)) + (format #t "~1Tlayer19: #x~X~%" (-> this layer19)) (label cfg-4) - obj + this ) ;; definition of type bigmap @@ -252,53 +252,53 @@ ) ;; definition for method 3 of type bigmap -(defmethod inspect bigmap ((obj bigmap)) - (when (not obj) - (set! obj obj) +(defmethod inspect bigmap ((this bigmap)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdrawing-flag: ~A~%" (-> obj drawing-flag)) - (format #t "~1Tloading-flag: ~A~%" (-> obj loading-flag)) - (format #t "~1Trecording-flag: ~A~%" (-> obj recording-flag)) - (format #t "~1Tfill-flag: ~A~%" (-> obj fill-flag)) - (format #t "~1Tbigmap-index: ~D~%" (-> obj bigmap-index)) - (format #t "~1Tbigmap-image: ~A~%" (-> obj bigmap-image)) - (format #t "~1Ttpage: ~A~%" (-> obj tpage)) - (format #t "~1Tprogress-minimap: ~A~%" (-> obj progress-minimap)) - (format #t "~1Tmask-index: ~D~%" (-> obj mask-index)) - (format #t "~1Tbit-mask: #~%" (-> obj bit-mask)) - (format #t "~1Tcompressed-next-index: ~D~%" (-> obj compressed-next-index)) - (format #t "~1Tmax-next-index: ~D~%" (-> obj max-next-index)) - (format #t "~1Tcompressed-masks[20] @ #x~X~%" (-> obj compressed-masks)) - (format #t "~1Tcompressed-data: #x~X~%" (-> obj compressed-data)) - (format #t "~1Tlayer-index: ~D~%" (-> obj layer-index)) - (format #t "~1Tlayer-mask: #~%" (-> obj layer-mask)) - (format #t "~1Tcompressed-layers: #~%" (-> obj compressed-layers)) - (format #t "~1Tlayer-mask-enable: ~D~%" (-> obj layer-mask-enable)) - (format #t "~1Tload-index: ~D~%" (-> obj load-index)) - (format #t "~1Tx0: ~D~%" (-> obj x0)) - (format #t "~1Ty0: ~D~%" (-> obj y0)) - (format #t "~1Tx1: ~D~%" (-> obj x1)) - (format #t "~1Ty1: ~D~%" (-> obj y1)) - (format #t "~1Ty2: ~D~%" (-> obj y2)) - (format #t "~1Tgoal-time: ~f~%" (-> obj goal-time)) - (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) - (format #t "~1Tdraw-tmpl: #~%" (-> obj draw-tmpl)) - (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~1Toffset: #~%" (-> obj offset)) - (format #t "~1Tsize: ~f~%" (-> obj offset z)) - (format #t "~1Tscale: ~f~%" (-> obj offset w)) - (format #t "~1Tdraw-offset: #~%" (-> obj draw-offset)) - (format #t "~1Tdraw-size: ~f~%" (-> obj draw-offset z)) - (format #t "~1Tdraw-scale: ~f~%" (-> obj draw-offset w)) - (format #t "~1Tscroll: #~%" (-> obj scroll)) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tcolor: #~%" (-> obj color)) - (format #t "~1Tcorner[4] @ #x~X~%" (-> obj corner)) - (format #t "~1Tauto-save-icon-flag: ~A~%" (-> obj auto-save-icon-flag)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdrawing-flag: ~A~%" (-> this drawing-flag)) + (format #t "~1Tloading-flag: ~A~%" (-> this loading-flag)) + (format #t "~1Trecording-flag: ~A~%" (-> this recording-flag)) + (format #t "~1Tfill-flag: ~A~%" (-> this fill-flag)) + (format #t "~1Tbigmap-index: ~D~%" (-> this bigmap-index)) + (format #t "~1Tbigmap-image: ~A~%" (-> this bigmap-image)) + (format #t "~1Ttpage: ~A~%" (-> this tpage)) + (format #t "~1Tprogress-minimap: ~A~%" (-> this progress-minimap)) + (format #t "~1Tmask-index: ~D~%" (-> this mask-index)) + (format #t "~1Tbit-mask: #~%" (-> this bit-mask)) + (format #t "~1Tcompressed-next-index: ~D~%" (-> this compressed-next-index)) + (format #t "~1Tmax-next-index: ~D~%" (-> this max-next-index)) + (format #t "~1Tcompressed-masks[20] @ #x~X~%" (-> this compressed-masks)) + (format #t "~1Tcompressed-data: #x~X~%" (-> this compressed-data)) + (format #t "~1Tlayer-index: ~D~%" (-> this layer-index)) + (format #t "~1Tlayer-mask: #~%" (-> this layer-mask)) + (format #t "~1Tcompressed-layers: #~%" (-> this compressed-layers)) + (format #t "~1Tlayer-mask-enable: ~D~%" (-> this layer-mask-enable)) + (format #t "~1Tload-index: ~D~%" (-> this load-index)) + (format #t "~1Tx0: ~D~%" (-> this x0)) + (format #t "~1Ty0: ~D~%" (-> this y0)) + (format #t "~1Tx1: ~D~%" (-> this x1)) + (format #t "~1Ty1: ~D~%" (-> this y1)) + (format #t "~1Ty2: ~D~%" (-> this y2)) + (format #t "~1Tgoal-time: ~f~%" (-> this goal-time)) + (format #t "~1Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~1Tdraw-tmpl: #~%" (-> this draw-tmpl)) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Toffset: #~%" (-> this offset)) + (format #t "~1Tsize: ~f~%" (-> this offset z)) + (format #t "~1Tscale: ~f~%" (-> this offset w)) + (format #t "~1Tdraw-offset: #~%" (-> this draw-offset)) + (format #t "~1Tdraw-size: ~f~%" (-> this draw-offset z)) + (format #t "~1Tdraw-scale: ~f~%" (-> this draw-offset w)) + (format #t "~1Tscroll: #~%" (-> this scroll)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Tcorner[4] @ #x~X~%" (-> this corner)) + (format #t "~1Tauto-save-icon-flag: ~A~%" (-> this auto-save-icon-flag)) (label cfg-4) - obj + this ) ;; definition for method 0 of type bigmap diff --git a/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc b/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc index 7c45490b87..326b7188ae 100644 --- a/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/bigmap_REF.gc @@ -2,35 +2,35 @@ (in-package goal) ;; definition for method 17 of type bigmap -(defmethod set-pos! bigmap ((obj bigmap) (arg0 vector)) +(defmethod set-pos! bigmap ((this bigmap) (arg0 vector)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) (.lvf vf1 (&-> arg0 quad)) - (.lvf vf2 (&-> obj offset quad)) + (.lvf vf2 (&-> this offset quad)) (.add.z.vf vf1 vf0 vf1 :mask #b10) (.sub.vf vf1 vf1 vf2) (.mul.w.vf vf1 vf1 vf2) (.ftoi.vf vf1 vf1) - (.svf (&-> obj pos quad) vf1) + (.svf (&-> this pos quad) vf1) 0 ) ) ;; definition for method 18 of type bigmap ;; INFO: Used lq/sq -(defmethod decompress-current-masks! bigmap ((obj bigmap)) - (let ((compressed-mask-data (-> obj compressed-masks (-> obj mask-index)))) - (set! (-> obj compressed-masks (-> obj mask-index)) (the-as (pointer int8) #f)) +(defmethod decompress-current-masks! bigmap ((this bigmap)) + (let ((compressed-mask-data (-> this compressed-masks (-> this mask-index)))) + (set! (-> this compressed-masks (-> this mask-index)) (the-as (pointer int8) #f)) (cond (compressed-mask-data - (let* ((decompressed-data-end (unpack-comp-rle (the-as (pointer int8) (-> obj bit-mask data)) compressed-mask-data)) + (let* ((decompressed-data-end (unpack-comp-rle (the-as (pointer int8) (-> this bit-mask data)) compressed-mask-data)) (decompressed-size (&- decompressed-data-end (the-as uint compressed-mask-data))) ) (let ((bytes-to-shift-back - (+ (- (the-as int compressed-mask-data)) (-> obj compressed-data) (-> obj compressed-next-index)) + (+ (- (the-as int compressed-mask-data)) (-> this compressed-data) (-> this compressed-next-index)) ) ) (dotimes (byte-idx bytes-to-shift-back) @@ -40,17 +40,17 @@ ) ) (dotimes (layer-idx 20) - (let ((layer-data (-> obj compressed-masks layer-idx))) + (let ((layer-data (-> this compressed-masks layer-idx))) (if (and layer-data (>= (the-as int layer-data) (the-as int compressed-mask-data))) - (set! (-> obj compressed-masks layer-idx) (&- layer-data (the-as uint decompressed-size))) + (set! (-> this compressed-masks layer-idx) (&- layer-data (the-as uint decompressed-size))) ) ) ) - (set! (-> obj compressed-next-index) (- (-> obj compressed-next-index) (the-as uint decompressed-size))) + (set! (-> this compressed-next-index) (- (-> this compressed-next-index) (the-as uint decompressed-size))) ) ) (else - (let ((data (-> obj bit-mask data))) + (let ((data (-> this bit-mask data))) (dotimes (qw-idx 416) (set! (-> (the-as (pointer int128) (&+ data (* qw-idx 16)))) 0) ) @@ -62,24 +62,24 @@ ) ;; definition for method 19 of type bigmap -(defmethod compress-current-masks! bigmap ((obj bigmap)) - (let* ((compressed-data-dest (+ (-> obj compressed-next-index) 0 (-> obj compressed-data))) +(defmethod compress-current-masks! bigmap ((this bigmap)) + (let* ((compressed-data-dest (+ (-> this compressed-next-index) 0 (-> this compressed-data))) (compressed-data-size (pack-comp-rle (the-as (pointer uint8) compressed-data-dest) - (-> obj bit-mask data) + (-> this bit-mask data) 6656 - (the-as int (- #x8000 (the-as int (-> obj compressed-next-index)))) + (the-as int (- #x8000 (the-as int (-> this compressed-next-index)))) ) ) ) - (set! (-> obj compressed-masks (-> obj mask-index)) (the-as (pointer int8) compressed-data-dest)) - (set! (-> obj compressed-next-index) - (the-as uint (+ (-> obj compressed-next-index) (the-as uint compressed-data-size))) + (set! (-> this compressed-masks (-> this mask-index)) (the-as (pointer int8) compressed-data-dest)) + (set! (-> this compressed-next-index) + (the-as uint (+ (-> this compressed-next-index) (the-as uint compressed-data-size))) ) ) - (set! (-> obj max-next-index) - (the-as uint (max (the-as int (-> obj max-next-index)) (the-as int (-> obj compressed-next-index)))) + (set! (-> this max-next-index) + (the-as uint (max (the-as int (-> this max-next-index)) (the-as int (-> this compressed-next-index)))) ) 0 ) @@ -143,30 +143,30 @@ ) ;; definition for method 20 of type bigmap -(defmethod set-enable-from-position! bigmap ((obj bigmap)) - (let ((v1-4 (-> obj layer-mask data (+ (* (-> obj pos y) 128) (/ (-> obj pos x) 2))))) - (if (not (logtest? (-> obj pos x) 1)) - (set! (-> obj layer-mask-enable) (shr v1-4 4)) - (set! (-> obj layer-mask-enable) (logand v1-4 15)) +(defmethod set-enable-from-position! bigmap ((this bigmap)) + (let ((v1-4 (-> this layer-mask data (+ (* (-> this pos y) 128) (/ (-> this pos x) 2))))) + (if (not (logtest? (-> this pos x) 1)) + (set! (-> this layer-mask-enable) (shr v1-4 4)) + (set! (-> this layer-mask-enable) (logand v1-4 15)) ) ) 0 ) ;; definition for method 21 of type bigmap -(defmethod maybe-fill-for-position bigmap ((obj bigmap) (arg0 int) (arg1 int)) +(defmethod maybe-fill-for-position bigmap ((this bigmap) (arg0 int) (arg1 int)) (local-vars (v1-3 uint)) (let* ((v1-1 (+ (* arg1 128) (/ arg0 2))) - (a3-3 (-> obj layer-mask data v1-1)) + (a3-3 (-> this layer-mask data v1-1)) ) (if (not (logtest? v1-1 1)) (set! v1-3 (shr a3-3 4)) (set! v1-3 (logand a3-3 15)) ) ) - (when (= (-> obj layer-mask-enable) v1-3) + (when (= (-> this layer-mask-enable) v1-3) (let ((v1-5 (+ (* arg1 32) (/ arg0 8))) - (a0-1 (-> obj bit-mask)) + (a0-1 (-> this bit-mask)) (a2-2 (logand arg0 7)) ) (logior! (-> a0-1 data v1-5) (ash 1 a2-2)) @@ -198,10 +198,10 @@ ;; definition for method 23 of type bigmap ;; WARN: Return type mismatch int vs none. -(defmethod mask-image-from-bit-mask bigmap ((obj bigmap)) - (let* ((v1-0 (the-as object (-> obj bit-mask))) +(defmethod mask-image-from-bit-mask bigmap ((this bigmap)) + (let* ((v1-0 (the-as object (-> this bit-mask))) (a1-0 *image-mask-table*) - (a0-2 (the-as object (-> obj bigmap-image art-group))) + (a0-2 (the-as object (-> this bigmap-image art-group))) (a0-3 (the-as (pointer int64) (+ (+ #x34000 (-> (the-as (pointer uint32) a0-2) 1) 16) (the-as uint a0-2)))) ) (dotimes (a2-3 208) @@ -233,7 +233,7 @@ ;; definition for method 22 of type bigmap ;; WARN: Return type mismatch int vs none. -(defmethod texture-upload-dma bigmap ((obj bigmap) (arg0 dma-buffer) (arg1 (pointer uint32)) (arg2 int) (arg3 int) (arg4 int) (arg5 gs-psm)) +(defmethod texture-upload-dma bigmap ((this bigmap) (arg0 dma-buffer) (arg1 (pointer uint32)) (arg2 int) (arg3 int) (arg4 int) (arg5 gs-psm)) (local-vars (sv-16 int)) (set! sv-16 arg2) (dma-buffer-add-gs-set arg0 @@ -250,11 +250,11 @@ ;; definition for method 26 of type bigmap ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -(defmethod sprite-dma bigmap ((obj bigmap) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) +(defmethod sprite-dma bigmap ((this bigmap) (arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) (let ((v1-0 (-> arg0 base))) - (set! (-> (the-as (pointer uint128) v1-0) 0) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-0) 1) (-> obj sprite-tmpl quad 1)) - (set! (-> (the-as (pointer uint128) v1-0) 2) (-> obj color quad)) + (set! (-> (the-as (pointer uint128) v1-0) 0) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-0) 1) (-> this sprite-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) v1-0) 2) (-> this color quad)) (set-vector! (the-as vector4w (&+ v1-0 48)) 0 0 0 0) (set-vector! (the-as vector4w (&+ v1-0 64)) (* arg1 16) (* arg2 16) #xfffff0 0) (set-vector! (the-as vector4w (&+ v1-0 80)) 8192 3328 0 0) @@ -265,73 +265,73 @@ ) ;; definition for method 24 of type bigmap -(defmethod draw-non-city-map bigmap ((obj bigmap) (arg0 dma-buffer)) - (let ((s4-0 (the-as (pointer uint32) (-> obj bigmap-image art-group)))) +(defmethod draw-non-city-map bigmap ((this bigmap) (arg0 dma-buffer)) + (let ((s4-0 (the-as (pointer uint32) (-> this bigmap-image art-group)))) (let ((v1-1 (-> s4-0 0)) (s3-0 (-> s4-0 1)) ) - (texture-upload-dma obj arg0 (+ (+ v1-1 16) (the-as uint s4-0)) 0 16 16 (gs-psm ct32)) + (texture-upload-dma this arg0 (+ (+ v1-1 16) (the-as uint s4-0)) 0 16 16 (gs-psm ct32)) (dma-buffer-add-gs-set arg0 (texflush 1)) - (texture-upload-dma obj arg0 (+ (+ s3-0 16) (the-as uint s4-0)) 8 512 208 (gs-psm mt8)) + (texture-upload-dma this arg0 (+ (+ s3-0 16) (the-as uint s4-0)) 8 512 208 (gs-psm mt8)) ) (dma-buffer-add-gs-set arg0 (tex0-1 (new 'static 'gs-tex0 :tbp0 #x8 :tbw #x8 :psm #x13 :tw #x9 :th #x9 :cld #x1)) (tex1-1 (new 'static 'gs-tex1)) (texflush 1) ) - (sprite-dma obj arg0 (-> obj x0) (-> obj y0) (-> obj x1) (-> obj y2)) + (sprite-dma this arg0 (-> this x0) (-> this y0) (-> this x1) (-> this y2)) (let ((v1-16 (+ #x1a000 (-> s4-0 1)))) - (texture-upload-dma obj arg0 (+ (+ v1-16 16) (the-as uint s4-0)) 8 512 208 (gs-psm mt8)) + (texture-upload-dma this arg0 (+ (+ v1-16 16) (the-as uint s4-0)) 8 512 208 (gs-psm mt8)) ) (dma-buffer-add-gs-set arg0 (texflush 0)) - (sprite-dma obj arg0 (-> obj x0) (-> obj y2) (-> obj x1) (-> obj y1)) + (sprite-dma this arg0 (-> this x0) (-> this y2) (-> this x1) (-> this y1)) (let ((v1-25 (+ (-> s4-0 0) 1024)) (s3-1 (+ #x34000 (-> s4-0 1))) ) - (texture-upload-dma obj arg0 (+ (+ v1-25 16) (the-as uint s4-0)) 0 16 16 (gs-psm ct32)) - (texture-upload-dma obj arg0 (+ (+ s3-1 16) (the-as uint s4-0)) 8 512 208 (gs-psm mt8)) + (texture-upload-dma this arg0 (+ (+ v1-25 16) (the-as uint s4-0)) 0 16 16 (gs-psm ct32)) + (texture-upload-dma this arg0 (+ (+ s3-1 16) (the-as uint s4-0)) 8 512 208 (gs-psm mt8)) ) (dma-buffer-add-gs-set arg0 (tex0-1 (new 'static 'gs-tex0 :tbp0 #x8 :tbw #x8 :psm #x13 :tw #x9 :th #x9 :tcc #x1 :cld #x1)) (tex1-1 (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) (texflush 1) ) - (sprite-dma obj arg0 (-> obj x0) (-> obj y0) (-> obj x1) (-> obj y2)) + (sprite-dma this arg0 (-> this x0) (-> this y0) (-> this x1) (-> this y2)) (let ((v1-37 (+ #x4e000 (-> s4-0 1)))) - (texture-upload-dma obj arg0 (+ (+ v1-37 16) (the-as uint s4-0)) 8 512 208 (gs-psm mt8)) + (texture-upload-dma this arg0 (+ (+ v1-37 16) (the-as uint s4-0)) 8 512 208 (gs-psm mt8)) ) ) (dma-buffer-add-gs-set arg0 (texflush 1)) - (sprite-dma obj arg0 (-> obj x0) (-> obj y2) (-> obj x1) (-> obj y1)) + (sprite-dma this arg0 (-> this x0) (-> this y2) (-> this x1) (-> this y1)) (none) ) ;; definition for method 25 of type bigmap -(defmethod draw-city-map bigmap ((obj bigmap) (arg0 dma-buffer)) - (let ((s4-0 (the-as (pointer uint32) (-> obj bigmap-image art-group)))) - (texture-upload-dma obj arg0 (+ (+ (-> s4-0 0) 16) (the-as uint s4-0)) 0 16 16 (gs-psm ct32)) +(defmethod draw-city-map bigmap ((this bigmap) (arg0 dma-buffer)) + (let ((s4-0 (the-as (pointer uint32) (-> this bigmap-image art-group)))) + (texture-upload-dma this arg0 (+ (+ (-> s4-0 0) 16) (the-as uint s4-0)) 0 16 16 (gs-psm ct32)) (dma-buffer-add-gs-set arg0 (texflush 0)) - (let ((v1-10 (+ (* (the int (-> obj scroll y)) 512) (-> s4-0 1)))) - (texture-upload-dma obj arg0 (+ (+ v1-10 16) (the-as int s4-0)) 8 512 208 (gs-psm mt8)) + (let ((v1-10 (+ (* (the int (-> this scroll y)) 512) (-> s4-0 1)))) + (texture-upload-dma this arg0 (+ (+ v1-10 16) (the-as int s4-0)) 8 512 208 (gs-psm mt8)) ) (dma-buffer-add-gs-set arg0 (tex0-1 (new 'static 'gs-tex0 :tbp0 #x8 :tbw #x8 :psm #x13 :tw #x9 :th #x9 :cld #x1)) (tex1-1 (new 'static 'gs-tex1)) (texflush 1) ) - (sprite-dma obj arg0 (-> obj x0) (-> obj y0) (-> obj x1) (-> obj y2)) - (let ((v1-21 (+ (* (+ (the int (-> obj scroll y)) 208) 512) (-> s4-0 1)))) - (texture-upload-dma obj arg0 (+ (+ v1-21 16) (the-as int s4-0)) 8 512 208 (gs-psm mt8)) + (sprite-dma this arg0 (-> this x0) (-> this y0) (-> this x1) (-> this y2)) + (let ((v1-21 (+ (* (+ (the int (-> this scroll y)) 208) 512) (-> s4-0 1)))) + (texture-upload-dma this arg0 (+ (+ v1-21 16) (the-as int s4-0)) 8 512 208 (gs-psm mt8)) ) ) (dma-buffer-add-gs-set arg0 (texflush 1)) - (sprite-dma obj arg0 (-> obj x0) (-> obj y2) (-> obj x1) (-> obj y1)) + (sprite-dma this arg0 (-> this x0) (-> this y2) (-> this x1) (-> this y1)) (none) ) ;; definition for method 27 of type bigmap ;; INFO: Used lq/sq -(defmethod draw-from-minimap bigmap ((obj bigmap) (arg0 dma-buffer) (arg1 connection-minimap)) +(defmethod draw-from-minimap bigmap ((this bigmap) (arg0 dma-buffer) (arg1 connection-minimap)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) @@ -383,20 +383,20 @@ (let ((f1-0 (-> *video-params* relative-x-scale))) (-> arg1 class) (.lvf vf1 (&-> arg1 last-world-pos quad)) - (.lvf vf2 (&-> obj draw-offset quad)) + (.lvf vf2 (&-> this draw-offset quad)) (.add.z.vf vf1 vf0 vf1 :mask #b10) (.sub.vf vf1 vf1 vf2) (.mul.w.vf vf1 vf1 vf2) (.ftoi.vf vf1 vf1) (.svf (&-> a3-0 quad) vf1) (if (logtest? (-> arg1 class flags) (minimap-flag goal)) - (set! (-> arg1 class icon-xy x) (the-as uint (mod (the int (-> obj goal-time)) 6))) + (set! (-> arg1 class icon-xy x) (the-as uint (mod (the int (-> this goal-time)) 6))) ) (if (-> *blit-displays-work* horizontal-flip-flag) (set! f1-0 (- f1-0)) ) - (set! (-> a2-1 x) (+ (the float (-> obj x0)) (* 2.0 f1-0 (the float (-> a3-0 x))))) - (set! (-> a2-1 y) (- (the float (+ (* (-> a3-0 y) 2) 1840)) (-> obj scroll y))) + (set! (-> a2-1 x) (+ (the float (-> this x0)) (* 2.0 f1-0 (the float (-> a3-0 x))))) + (set! (-> a2-1 y) (- (the float (+ (* (-> a3-0 y) 2) 1840)) (-> this scroll y))) (let ((f1-2 (* 20.0 f1-0 f0-0)) (f0-1 (* 20.0 f0-0)) ) @@ -412,8 +412,8 @@ (a3-11 (+ t2-0 312)) (t0-15 (-> arg0 base)) ) - (set! (-> (the-as (pointer uint128) t0-15) 0) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) t0-15) 1) (-> obj sprite-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) t0-15) 0) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) t0-15) 1) (-> this sprite-tmpl quad 1)) (set-vector! (the-as vector4w (&+ t0-15 32)) (the-as int (-> a1-5 r)) @@ -446,17 +446,17 @@ ;; definition for method 9 of type bigmap ;; WARN: Return type mismatch int vs none. -(defmethod initialize bigmap ((obj bigmap)) - (set! (-> obj bigmap-index) (the-as uint 20)) - (set-pending-file (-> obj bigmap-image) (the-as string #f) 0 (process->handle *dproc*) 0.0) - (set! (-> obj compressed-next-index) (the-as uint 0)) - (set! (-> obj max-next-index) (the-as uint 0)) +(defmethod initialize bigmap ((this bigmap)) + (set! (-> this bigmap-index) (the-as uint 20)) + (set-pending-file (-> this bigmap-image) (the-as string #f) 0 (process->handle *dproc*) 0.0) + (set! (-> this compressed-next-index) (the-as uint 0)) + (set! (-> this max-next-index) (the-as uint 0)) (dotimes (v1-5 20) - (set! (-> obj compressed-masks v1-5) (the-as (pointer int8) #f)) + (set! (-> this compressed-masks v1-5) (the-as (pointer int8) #f)) ) - (set! (-> obj mask-index) (the-as uint 20)) - (set! (-> obj layer-index) (the-as uint 20)) - (set! (-> obj layer-mask-enable) (the-as uint 0)) + (set! (-> this mask-index) (the-as uint 20)) + (set! (-> this layer-index) (the-as uint 20)) + (set! (-> this layer-mask-enable) (the-as uint 0)) 0 (none) ) @@ -464,36 +464,36 @@ ;; definition for method 10 of type bigmap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update bigmap ((obj bigmap)) +(defmethod update bigmap ((this bigmap)) (let ((v1-1 (level-get-target-inside *level*))) (if v1-1 - (set! (-> obj bigmap-index) (the-as uint (-> v1-1 info bigmap-id))) + (set! (-> this bigmap-index) (the-as uint (-> v1-1 info bigmap-id))) ) ) (cond - ((-> obj drawing-flag) + ((-> this drawing-flag) (cond ((= (-> *blit-displays-work* count-down) 1) (set-pending-file - (-> obj bigmap-image) + (-> this bigmap-image) "world-map" - (the-as int (-> obj load-index)) + (the-as int (-> this load-index)) (process->handle *dproc*) 0.0 ) - (set-pending-file (-> obj tpage) "progress-minimap" 0 (process->handle *dproc*) 0.0) - (set! (-> obj loading-flag) #t) + (set-pending-file (-> this tpage) "progress-minimap" 0 (process->handle *dproc*) 0.0) + (set! (-> this loading-flag) #t) ) (else - (update (-> obj bigmap-image)) - (update (-> obj tpage)) - (when (and (-> obj loading-flag) - (= (file-status (-> obj bigmap-image) "world-map" (the-as int (-> obj load-index))) 'active) - (= (file-status (-> obj tpage) "progress-minimap" 0) 'active) + (update (-> this bigmap-image)) + (update (-> this tpage)) + (when (and (-> this loading-flag) + (= (file-status (-> this bigmap-image) "world-map" (the-as int (-> this load-index))) 'active) + (= (file-status (-> this tpage) "progress-minimap" 0) 'active) (not (load-in-progress? *level*)) ) - (if (!= (-> obj bigmap-index) 20) - (mask-image-from-bit-mask obj) + (if (!= (-> this bigmap-index) 20) + (mask-image-from-bit-mask this) ) (let ((s5-0 (-> *level* loading-level)) (s4-0 (-> *texture-pool* allocate-func)) @@ -502,55 +502,55 @@ (set! (-> *texture-pool* allocate-func) texture-page-common-boot-allocate) (set! (-> *level* loading-level) #f) (set! (-> *texture-relocate-later* memcpy) #f) - (set! (-> obj progress-minimap) + (set! (-> this progress-minimap) (the-as texture-page - (link (-> obj tpage buf) (-> obj tpage load-file data) (-> obj tpage len) (-> obj tpage heap) 4) + (link (-> this tpage buf) (-> this tpage load-file data) (-> this tpage len) (-> this tpage heap) 4) ) ) (set! (-> *level* loading-level) s5-0) (set! (-> *texture-pool* allocate-func) s4-0) (set! (-> *texture-relocate-later* memcpy) s3-0) ) - (set! (-> obj loading-flag) #f) + (set! (-> this loading-flag) #f) ) ) ) ) - ((!= (-> obj bigmap-index) 20) - (set! (-> obj offset quad) (-> *bigmap-info-array* data (-> obj mask-index) quad)) - (when (!= (-> obj bigmap-index) (-> obj mask-index)) - (if (!= (-> obj mask-index) 20) - (compress-current-masks! obj) + ((!= (-> this bigmap-index) 20) + (set! (-> this offset quad) (-> *bigmap-info-array* data (-> this mask-index) quad)) + (when (!= (-> this bigmap-index) (-> this mask-index)) + (if (!= (-> this mask-index) 20) + (compress-current-masks! this) ) - (set! (-> obj mask-index) (-> obj bigmap-index)) - (decompress-current-masks! obj) + (set! (-> this mask-index) (-> this bigmap-index)) + (decompress-current-masks! this) ) - (when (!= (-> obj bigmap-index) (-> obj layer-index)) - (set! (-> obj layer-index) (-> obj bigmap-index)) + (when (!= (-> this bigmap-index) (-> this layer-index)) + (set! (-> this layer-index) (-> this bigmap-index)) (unpack-comp-rle - (the-as (pointer int8) (-> obj layer-mask data)) - (the-as (pointer int8) (-> obj compressed-layers data (-> obj layer-index))) + (the-as (pointer int8) (-> this layer-mask data)) + (the-as (pointer int8) (-> this compressed-layers data (-> this layer-index))) ) ) - (set-pos! obj (target-pos 0)) - (set-enable-from-position! obj) + (set-pos! this (target-pos 0)) + (set-enable-from-position! this) (cond - ((-> obj recording-flag) - (when (-> obj fill-flag) - (let ((a1-9 (-> obj pos x)) - (a2-5 (-> obj pos y)) + ((-> this recording-flag) + (when (-> this fill-flag) + (let ((a1-9 (-> this pos x)) + (a2-5 (-> this pos y)) ) (if (and (>= a1-9 0) (< a1-9 256) (>= a2-5 0) (< a2-5 208)) - (maybe-fill-for-position obj a1-9 a2-5) + (maybe-fill-for-position this a1-9 a2-5) ) ) ) ) (else - (let* ((f0-1 (* 131072.0 (-> obj offset w))) + (let* ((f0-1 (* 131072.0 (-> this offset w))) (f30-0 (* f0-1 f0-1)) - (s4-2 (the int (* 131072.0 (-> obj offset w)))) + (s4-2 (the int (* 131072.0 (-> this offset w)))) (s5-2 (- s4-2)) ) (while (>= s4-2 s5-2) @@ -559,11 +559,11 @@ (s3-1 (- s2-0)) ) (while (>= s2-0 s3-1) - (let ((a1-10 (+ (-> obj pos x) s3-1)) - (a2-6 (+ (-> obj pos y) s5-2)) + (let ((a1-10 (+ (-> this pos x) s3-1)) + (a2-6 (+ (-> this pos y) s5-2)) ) (if (and (>= a1-10 0) (< a1-10 256) (>= a2-6 0) (< a2-6 208)) - (maybe-fill-for-position obj a1-10 a2-6) + (maybe-fill-for-position this a1-10 a2-6) ) ) (+! s3-1 1) @@ -576,7 +576,7 @@ ) ) (else - (set-vector! (-> obj offset) -2621440.0 -4456448.0 16384.0 0.000030517578) + (set-vector! (-> this offset) -2621440.0 -4456448.0 16384.0 0.000030517578) ) ) 0 @@ -585,26 +585,26 @@ ;; definition for method 11 of type bigmap ;; INFO: Used lq/sq -(defmethod draw bigmap ((obj bigmap) (arg0 int) (arg1 int) (arg2 int) (arg3 int)) +(defmethod draw bigmap ((this bigmap) (arg0 int) (arg1 int) (arg2 int) (arg3 int)) (local-vars (sv-96 pointer) (sv-100 texture) (sv-104 matrix) (sv-112 int)) - (when (and (= (file-status (-> obj bigmap-image) "world-map" (the-as int (-> obj load-index))) 'active) - (not (-> obj loading-flag)) + (when (and (= (file-status (-> this bigmap-image) "world-map" (the-as int (-> this load-index))) 'active) + (not (-> this loading-flag)) ) (let ((f0-0 (-> *video-params* relative-x-scale))) (cond ((-> *blit-displays-work* horizontal-flip-flag) - (set! (-> obj x0) (+ (the int (* (the float (+ arg2 -2048)) f0-0)) 2048)) - (set! (-> obj x1) (+ (the int (* (the float (+ arg0 -2048)) f0-0)) 2048)) + (set! (-> this x0) (+ (the int (* (the float (+ arg2 -2048)) f0-0)) 2048)) + (set! (-> this x1) (+ (the int (* (the float (+ arg0 -2048)) f0-0)) 2048)) ) (else - (set! (-> obj x0) (+ (the int (* (the float (+ arg0 -2048)) f0-0)) 2048)) - (set! (-> obj x1) (+ (the int (* (the float (+ arg2 -2048)) f0-0)) 2048)) + (set! (-> this x0) (+ (the int (* (the float (+ arg0 -2048)) f0-0)) 2048)) + (set! (-> this x1) (+ (the int (* (the float (+ arg2 -2048)) f0-0)) 2048)) ) ) ) - (set! (-> obj y0) arg1) - (set! (-> obj y1) arg3) - (set! (-> obj y2) (/ (+ arg1 arg3) 2)) + (set! (-> this y0) arg1) + (set! (-> this y1) arg3) + (set! (-> this y2) (/ (+ arg1 arg3) 2)) (with-dma-buffer-add-bucket ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id tex-all-map) ) @@ -613,21 +613,21 @@ (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) (clamp-1 (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp))) ) - (if (= (-> obj bigmap-index) 20) - (draw-city-map obj s4-1) - (draw-non-city-map obj s4-1) + (if (= (-> this bigmap-index) 20) + (draw-city-map this s4-1) + (draw-non-city-map this s4-1) ) ) (with-dma-buffer-add-bucket ((s4-2 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id tex-all-map) ) - (when (= (-> obj y0) 1840) + (when (= (-> this y0) 1840) (let ((s2-1 (-> s4-2 base)) (s3-1 (lookup-texture-by-id-fast (new 'static 'texture-id :index #x15 :page #xc93))) ) (when s3-1 - (set! (-> (the-as (pointer uint128) s2-1) 0) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s2-1) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s2-1) 0) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s2-1) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s2-1 32)) s3-1) (&+! (-> s4-2 base) 112) ) @@ -640,12 +640,12 @@ (let ((a2-3 (the-as connection-minimap s3-2))) (when (logtest? (-> a2-3 class flags) (minimap-flag bigmap)) (cond - ((= (-> obj bigmap-index) 20) - (draw-from-minimap obj s4-2 a2-3) + ((= (-> this bigmap-index) 20) + (draw-from-minimap this s4-2 a2-3) ) (else (if (not (logtest? (-> a2-3 class flags) (minimap-flag city-only))) - (draw-from-minimap obj s4-2 a2-3) + (draw-from-minimap this s4-2 a2-3) ) ) ) @@ -666,7 +666,7 @@ (set! sv-104 (new 'stack-no-clear 'matrix)) (set! sv-112 (the int (* 56.0 f30-0))) (when sv-100 - (set-pos! obj (target-pos 0)) + (set-pos! this (target-pos 0)) (if (-> *blit-displays-work* horizontal-flip-flag) (set! f30-0 (- f30-0)) ) @@ -675,62 +675,62 @@ (set-vector! (-> (the-as matrix sv-104) vector 2) (* (-> s3-3 x) f30-0) 0.0 (-> s3-3 z) 1.0) (set-vector! (-> (the-as matrix sv-104) trans) - (+ (the float (-> obj x0)) (* 2.0 f30-0 (the float (-> obj pos x)))) + (+ (the float (-> this x0)) (* 2.0 f30-0 (the float (-> this pos x)))) 0.0 - (- (the float (+ (* (-> obj pos y) 2) 1840)) (-> obj scroll y)) + (- (the float (+ (* (-> this pos y) 2) 1840)) (-> this scroll y)) 1.0 ) - (set-vector! (-> obj corner 0) 0.0 0.0 -7.0 1.0) - (set-vector! (-> obj corner 1) 7.0 0.0 0.0 1.0) - (set-vector! (-> obj corner 2) -7.0 0.0 0.0 1.0) - (set-vector! (-> obj corner 3) 0.0 0.0 7.0 1.0) - (vector-matrix*! (the-as vector (-> obj corner)) (the-as vector (-> obj corner)) sv-104) - (vector-matrix*! (-> obj corner 1) (-> obj corner 1) sv-104) - (vector-matrix*! (-> obj corner 2) (-> obj corner 2) sv-104) - (vector-matrix*! (-> obj corner 3) (-> obj corner 3) sv-104) - (let ((v1-101 (-> obj adgif-tmpl dma-vif quad))) + (set-vector! (-> this corner 0) 0.0 0.0 -7.0 1.0) + (set-vector! (-> this corner 1) 7.0 0.0 0.0 1.0) + (set-vector! (-> this corner 2) -7.0 0.0 0.0 1.0) + (set-vector! (-> this corner 3) 0.0 0.0 7.0 1.0) + (vector-matrix*! (the-as vector (-> this corner)) (the-as vector (-> this corner)) sv-104) + (vector-matrix*! (-> this corner 1) (-> this corner 1) sv-104) + (vector-matrix*! (-> this corner 2) (-> this corner 2) sv-104) + (vector-matrix*! (-> this corner 3) (-> this corner 3) sv-104) + (let ((v1-101 (-> this adgif-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-96)) v1-101) ) - (let ((v1-102 (-> obj adgif-tmpl quad 1))) + (let ((v1-102 (-> this adgif-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-96) 1) v1-102) ) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ sv-96 32)) sv-100) - (let ((v1-104 (-> obj draw-tmpl dma-vif quad))) + (let ((v1-104 (-> this draw-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-96) 7) v1-104) ) - (let ((v1-105 (-> obj draw-tmpl quad 1))) + (let ((v1-105 (-> this draw-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-96) 8) v1-105) ) (set-vector! (the-as vector4w (&+ sv-96 144)) 0 255 255 128) (set-vector! (the-as vector4w (&+ sv-96 160)) 0 0 0 0) (set-vector! (the-as vector4w (&+ sv-96 176)) - (the int (* 16.0 (-> obj corner 0 x))) - (the int (* 16.0 (-> obj corner 0 z))) + (the int (* 16.0 (-> this corner 0 x))) + (the int (* 16.0 (-> this corner 0 z))) #xffffff 0 ) (set-vector! (the-as vector4w (&+ sv-96 192)) 256 0 0 0) (set-vector! (the-as vector4w (&+ sv-96 208)) - (the int (* 16.0 (-> obj corner 1 x))) - (the int (* 16.0 (-> obj corner 1 z))) + (the int (* 16.0 (-> this corner 1 x))) + (the int (* 16.0 (-> this corner 1 z))) #xffffff 0 ) (set-vector! (the-as vector4w (&+ sv-96 224)) 0 256 0 0) (set-vector! (the-as vector4w (&+ sv-96 240)) - (the int (* 16.0 (-> obj corner 2 x))) - (the int (* 16.0 (-> obj corner 2 z))) + (the int (* 16.0 (-> this corner 2 x))) + (the int (* 16.0 (-> this corner 2 z))) #xffffff 0 ) (set-vector! (the-as vector4w (&+ sv-96 256)) 256 256 0 0) (set-vector! (the-as vector4w (&+ sv-96 272)) - (the int (* 16.0 (-> obj corner 3 x))) - (the int (* 16.0 (-> obj corner 3 z))) + (the int (* 16.0 (-> this corner 3 x))) + (the int (* 16.0 (-> this corner 3 z))) #xffffff 0 ) @@ -739,7 +739,7 @@ ) ) ) - (+! (-> obj goal-time) (* 16.0 (seconds-per-frame))) + (+! (-> this goal-time) (* 16.0 (seconds-per-frame))) (set-dirty-mask! (-> *level* default-level) 4 #x1a400 0) ) 0 @@ -747,17 +747,17 @@ ;; definition for method 12 of type bigmap ;; INFO: Used lq/sq -(defmethod handle-cpad-inputs bigmap ((obj bigmap)) +(defmethod handle-cpad-inputs bigmap ((this bigmap)) (cond - ((= (-> obj bigmap-index) 20) + ((= (-> this bigmap-index) 20) (let* ((v1-2 (-> *cpad-list* cpads 0)) (f1-0 (analog-input (the-as int (-> v1-2 lefty)) 128.0 32.0 110.0 4.0)) ) - (set! (-> obj scroll y) (fmax 0.0 (fmin 416.0 (+ (-> obj scroll y) f1-0)))) + (set! (-> this scroll y) (fmax 0.0 (fmin 416.0 (+ (-> this scroll y) f1-0)))) ) ) (else - (set! (-> obj scroll quad) (the-as uint128 0)) + (set! (-> this scroll quad) (the-as uint128 0)) 0 ) ) @@ -765,10 +765,10 @@ ) ;; definition for method 13 of type bigmap -(defmethod compress-all bigmap ((obj bigmap)) - (when (!= (-> obj mask-index) 20) - (compress-current-masks! obj) - (set! (-> obj mask-index) (the-as uint 20)) +(defmethod compress-all bigmap ((this bigmap)) + (when (!= (-> this mask-index) 20) + (compress-current-masks! this) + (set! (-> this mask-index) (the-as uint 20)) ) 0 ) @@ -776,71 +776,71 @@ ;; definition for method 14 of type bigmap ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod enable-drawing bigmap ((obj bigmap)) - (set! (-> obj bigmap-index) (the-as uint (-> (level-get-target-inside *level*) info bigmap-id))) +(defmethod enable-drawing bigmap ((this bigmap)) + (set! (-> this bigmap-index) (the-as uint (-> (level-get-target-inside *level*) info bigmap-id))) (cond - ((= (-> obj bigmap-index) 20) - (set-pos! obj (target-pos 0)) - (set! (-> obj scroll y) (the float (max 0 (+ (* (-> obj pos y) 2) -208)))) - (set-vector! (-> obj draw-offset) -2621440.0 -4456448.0 16384.0 0.000030517578) + ((= (-> this bigmap-index) 20) + (set-pos! this (target-pos 0)) + (set! (-> this scroll y) (the float (max 0 (+ (* (-> this pos y) 2) -208)))) + (set-vector! (-> this draw-offset) -2621440.0 -4456448.0 16384.0 0.000030517578) (cond ((logtest? (game-feature pass-red) (-> *game-info* features)) (cond ((and (logtest? (game-feature pass-green) (-> *game-info* features)) (logtest? (game-feature pass-yellow) (-> *game-info* features)) ) - (set! (-> obj load-index) (the-as uint 24)) + (set! (-> this load-index) (the-as uint 24)) ) ((logtest? (game-feature pass-green) (-> *game-info* features)) - (set! (-> obj load-index) (the-as uint 23)) + (set! (-> this load-index) (the-as uint 23)) ) ((logtest? (game-feature pass-yellow) (-> *game-info* features)) - (set! (-> obj load-index) (the-as uint 22)) + (set! (-> this load-index) (the-as uint 22)) ) (else - (set! (-> obj load-index) (the-as uint 21)) + (set! (-> this load-index) (the-as uint 21)) ) ) ) (else - (set! (-> obj load-index) (the-as uint 20)) + (set! (-> this load-index) (the-as uint 20)) ) ) ) (else - (set! (-> obj scroll y) 0.0) - (set! (-> obj draw-offset quad) (-> *bigmap-info-array* data (-> obj bigmap-index) quad)) - (set! (-> obj load-index) (-> obj bigmap-index)) + (set! (-> this scroll y) 0.0) + (set! (-> this draw-offset quad) (-> *bigmap-info-array* data (-> this bigmap-index) quad)) + (set! (-> this load-index) (-> this bigmap-index)) ) ) - (set! (-> obj drawing-flag) #t) + (set! (-> this drawing-flag) #t) (none) ) ;; definition for method 15 of type bigmap -(defmethod disable-drawing bigmap ((obj bigmap)) +(defmethod disable-drawing bigmap ((this bigmap)) (set-pending-file - (-> obj bigmap-image) + (-> this bigmap-image) (the-as string #f) - (the-as int (-> obj bigmap-index)) + (the-as int (-> this bigmap-index)) (process->handle *dproc*) 0.0 ) - (set-pending-file (-> obj tpage) (the-as string #f) 0 (process->handle *dproc*) 0.0) + (set-pending-file (-> this tpage) (the-as string #f) 0 (process->handle *dproc*) 0.0) (let ((v1-8 #f)) (while (not v1-8) - (update (-> obj bigmap-image)) - (update (-> obj tpage)) - (set! v1-8 (and (= (-> obj bigmap-image status) 'inactive) (= (-> obj tpage status) 'inactive))) + (update (-> this bigmap-image)) + (update (-> this tpage)) + (set! v1-8 (and (= (-> this bigmap-image status) 'inactive) (= (-> this tpage status) 'inactive))) ) ) - (when (-> obj progress-minimap) - (unload-page *texture-pool* (-> obj progress-minimap)) + (when (-> this progress-minimap) + (unload-page *texture-pool* (-> this progress-minimap)) (set! (-> *level* default-level texture-page 3) (the-as texture-page 0)) - (set! (-> obj progress-minimap) #f) + (set! (-> this progress-minimap) #f) ) - (set! (-> obj drawing-flag) #f) - (set! (-> obj loading-flag) #f) + (set! (-> this drawing-flag) #f) + (set! (-> this loading-flag) #f) 0 ) @@ -848,11 +848,11 @@ (define *map-save-ptr* (the-as (pointer uint64) #f)) ;; definition for method 16 of type bigmap -(defmethod dump-to-file bigmap ((obj bigmap)) +(defmethod dump-to-file bigmap ((this bigmap)) (if (not *map-save-ptr*) (set! *map-save-ptr* (the-as (pointer uint64) (malloc 'debug #xd0000))) ) - (let ((v1-3 (the-as (pointer uint8) (-> obj bit-mask))) + (let ((v1-3 (the-as (pointer uint8) (-> this bit-mask))) (a0-2 *map-save-ptr*) ) (dotimes (a1-1 208) diff --git a/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc index 3c25dcf32b..04e8d38e4f 100644 --- a/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc @@ -25,27 +25,27 @@ ) ;; definition for method 3 of type gui-connection -(defmethod inspect gui-connection ((obj gui-connection)) - (when (not obj) - (set! obj obj) +(defmethod inspect gui-connection ((this gui-connection)) + (when (not this) + (set! this this) (goto cfg-116) ) - (format #t "[~8x] ~A~%" obj 'gui-connection) - (format #t "~1Tnext0: ~`connectable`P~%" (-> obj next0)) - (format #t "~1Tprev0: ~`connectable`P~%" (-> obj prev0)) - (format #t "~1Tnext1: ~`connectable`P~%" (-> obj next1)) - (format #t "~1Tprev1: ~`connectable`P~%" (-> obj prev1)) - (format #t "~1Tparam0: ~A~%" (-> obj priority)) - (format #t "~1Tparam1: ~A~%" (-> obj param1)) - (format #t "~1Tparam2: ~A~%" (-> obj param2)) - (format #t "~1Tparam3: ~A~%" (-> obj param3)) - (format #t "~1Tquad[2] @ #x~X~%" (&-> obj next0)) - (format #t "~1Tpriority: ~f~%" (-> obj priority)) + (format #t "[~8x] ~A~%" this 'gui-connection) + (format #t "~1Tnext0: ~`connectable`P~%" (-> this next0)) + (format #t "~1Tprev0: ~`connectable`P~%" (-> this prev0)) + (format #t "~1Tnext1: ~`connectable`P~%" (-> this next1)) + (format #t "~1Tprev1: ~`connectable`P~%" (-> this prev1)) + (format #t "~1Tparam0: ~A~%" (-> this priority)) + (format #t "~1Tparam1: ~A~%" (-> this param1)) + (format #t "~1Tparam2: ~A~%" (-> this param2)) + (format #t "~1Tparam3: ~A~%" (-> this param3)) + (format #t "~1Tquad[2] @ #x~X~%" (&-> this next0)) + (format #t "~1Tpriority: ~f~%" (-> this priority)) (let ((t9-11 format) (a0-12 #t) (a1-11 "~1Taction: #x~X : ~S~%") - (a2-11 (-> obj action)) - (v1-2 (-> obj action)) + (a2-11 (-> this action)) + (v1-2 (-> this action)) ) (t9-11 a0-12 a1-11 a2-11 (cond ((= v1-2 (gui-action queue)) @@ -87,8 +87,8 @@ (let ((t9-12 format) (a0-13 #t) (a1-12 "~1Tchannel: #x~X : ~S~%") - (a2-12 (-> obj channel)) - (v1-3 (-> obj channel)) + (a2-12 (-> this channel)) + (v1-3 (-> this channel)) ) (t9-12 a0-13 a1-12 a2-12 (cond ((= v1-3 (gui-channel hud-lower-left)) @@ -232,19 +232,19 @@ ) ) ) - (format #t "~1Tanim-part: ~D~%" (-> obj anim-part)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Ttime-stamp: ~D~%" (-> obj time-stamp)) - (format #t "~1Thold-time: ~D~%" (-> obj hold-time)) - (format #t "~1Tfo-min: ~D~%" (-> obj fo-min)) - (format #t "~1Tfo-max: ~D~%" (-> obj fo-max)) - (format #t "~1Tfo-curve: ~D~%" (-> obj fo-curve)) - (format #t "~1Tfade: ~D~%" (-> obj fade)) + (format #t "~1Tanim-part: ~D~%" (-> this anim-part)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Ttime-stamp: ~D~%" (-> this time-stamp)) + (format #t "~1Thold-time: ~D~%" (-> this hold-time)) + (format #t "~1Tfo-min: ~D~%" (-> this fo-min)) + (format #t "~1Tfo-max: ~D~%" (-> this fo-max)) + (format #t "~1Tfo-curve: ~D~%" (-> this fo-curve)) + (format #t "~1Tfade: ~D~%" (-> this fade)) (label cfg-116) - obj + this ) ;; definition of type gui-control diff --git a/test/decompiler/reference/jak2/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/jak2/engine/ui/hud-classes_REF.gc index f71ffbf38c..125a3ec584 100644 --- a/test/decompiler/reference/jak2/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/hud-classes_REF.gc @@ -3,40 +3,40 @@ ;; definition for method 15 of type hud-map ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-map ((obj hud-map)) +(defmethod draw hud-map ((this hud-map)) (set-hud-piece-position! - (-> obj sprites 1) - (the int (+ 492.0 (* 140.0 (-> obj offset)))) - (the int (+ 281.0 (* 140.0 (-> obj offset)))) + (-> this sprites 1) + (the int (+ 492.0 (* 140.0 (-> this offset)))) + (the int (+ 281.0 (* 140.0 (-> this offset)))) ) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) 11 -11) - (set! (-> obj sprites 0 color w) - (the int (+ 70.0 (* 70.0 (sin (* 182.04445 (the float (-> obj values 1 current))))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) 11 -11) + (set! (-> this sprites 0 color w) + (the int (+ 70.0 (* 70.0 (sin (* 182.04445 (the float (-> this values 1 current))))))) ) (set! (-> *minimap* color y) - (the int (- 96.0 (* 32.0 (sin (* 182.04445 (the float (-> obj values 1 current))))))) + (the int (- 96.0 (* 32.0 (sin (* 182.04445 (the float (-> this values 1 current))))))) ) (set! (-> *minimap* color z) - (the int (- 96.0 (* 32.0 (sin (* 182.04445 (the float (-> obj values 1 current))))))) + (the int (- 96.0 (* 32.0 (sin (* 182.04445 (the float (-> this values 1 current))))))) ) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) (when (>= (-> *setting-control* user-current race-minimap) 0) - (set! (-> obj sprites 0 scale-x) 0.0) - (set! (-> obj sprites 0 scale-y) 0.0) - (set! (-> obj sprites 1 scale-x) 0.0) - (set! (-> obj sprites 1 scale-y) 0.0) + (set! (-> this sprites 0 scale-x) 0.0) + (set! (-> this sprites 0 scale-y) 0.0) + (set! (-> this sprites 1 scale-x) 0.0) + (set! (-> this sprites 1 scale-y) 0.0) ) (let ((t9-5 (method-of-type hud draw))) - (t9-5 obj) + (t9-5 this) ) (cond ((< (-> *setting-control* user-current race-minimap) 0) (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 2 -3) - (draw-1 *minimap* s4-0 (the-as vector4w (-> obj sprites 2)) #t) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 2 -3) + (draw-1 *minimap* s4-0 (the-as vector4w (-> this sprites 2)) #t) ) ) ((zero? (-> *setting-control* user-current race-minimap)) @@ -52,8 +52,8 @@ (with-dma-buffer-add-bucket ((s4-2 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 10 -15) - (draw-sprite2 *minimap* s4-2 (the-as vector4w (-> obj sprites 2)) #t) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 10 -15) + (draw-sprite2 *minimap* s4-2 (the-as vector4w (-> this sprites 2)) #t) ) ) ) @@ -71,8 +71,8 @@ (with-dma-buffer-add-bucket ((s4-4 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 20 -8) - (draw-sprite2 *minimap* s4-4 (the-as vector4w (-> obj sprites 2)) #t) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 20 -8) + (draw-sprite2 *minimap* s4-4 (the-as vector4w (-> this sprites 2)) #t) ) ) ) @@ -90,8 +90,8 @@ (with-dma-buffer-add-bucket ((s4-6 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 10 -8) - (draw-sprite2 *minimap* s4-6 (the-as vector4w (-> obj sprites 2)) #t) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 10 -8) + (draw-sprite2 *minimap* s4-6 (the-as vector4w (-> this sprites 2)) #t) ) ) ) @@ -106,25 +106,25 @@ ;; definition for method 16 of type hud-map ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-map ((obj hud-map)) +(defmethod update-values hud-map ((this hud-map)) (cond ((update! *minimap*) - (logior! (-> obj flags) (hud-flags show)) + (logior! (-> this flags) (hud-flags show)) (let ((t9-1 (method-of-type hud update-values))) - (t9-1 obj) + (t9-1 this) ) ) (else - (send-event obj 'force-hide) + (send-event this 'force-hide) ) ) (when (not (paused?)) (let ((v1-10 8)) - (if (and (< (-> obj values 1 target) 270) (< 270 (+ (-> obj values 1 target) v1-10))) - (set! (-> obj values 1 target) 270) + (if (and (< (-> this values 1 target) 270) (< 270 (+ (-> this values 1 target) v1-10))) + (set! (-> this values 1 target) 270) ) - (if (or (-> *game-info* wanted-flash) (!= (-> obj values 1 target) 270)) - (set! (-> obj values 1 target) (mod (+ (-> obj values 1 target) v1-10) 360)) + (if (or (-> *game-info* wanted-flash) (!= (-> this values 1 target) 270)) + (set! (-> this values 1 target) (mod (+ (-> this values 1 target) v1-10) 360)) ) ) ) @@ -134,21 +134,21 @@ ;; definition for method 17 of type hud-map ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-map ((obj hud-map)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-map ((this hud-map)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 pos z) #xffff00) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x67a))) - (set! (-> obj sprites 1 scale-x) 0.85) - (set! (-> obj sprites 1 scale-y) 0.85) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 1 pos z) #xffff00) - (set! (-> obj values 0 current) 0) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 pos z) #xffff00) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x67a))) + (set! (-> this sprites 1 scale-x) 0.85) + (set! (-> this sprites 1 scale-y) 0.85) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 1 pos z) #xffff00) + (set! (-> this values 0 current) 0) (update! *minimap*) 0 (none) @@ -156,203 +156,203 @@ ;; definition for method 15 of type hud-health ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-health ((obj hud-health)) +(defmethod draw hud-health ((this hud-health)) (set-hud-piece-position! - (-> obj sprites 8) - (the int (+ (* -130.0 (-> obj offset)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) - 20.0 - 30.0 - ) + (-> this sprites 8) + (the int (+ (* -130.0 (-> this offset)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 20.0 + 30.0 + ) ) ) - (the int (+ 306.0 (* 130.0 (-> obj offset)))) + (the int (+ 306.0 (* 130.0 (-> this offset)))) ) - (set-as-offset-from! (-> obj sprites 9) (the-as vector4w (-> obj sprites 8)) 40 0) - (set-as-offset-from! (-> obj sprites 10) (the-as vector4w (-> obj sprites 8)) 0 40) - (set-as-offset-from! (-> obj sprites 11) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 12) (the-as vector4w (-> obj sprites 8)) 2 32) - (set-as-offset-from! (-> obj sprites 13) (the-as vector4w (-> obj sprites 8)) 7 60) - (set-as-offset-from! (-> obj sprites 14) (the-as vector4w (-> obj sprites 8)) 40 60) - (set-as-offset-from! (-> obj sprites 15) (the-as vector4w (-> obj sprites 8)) 63 32) - (set-as-offset-from! (-> obj sprites 16) (the-as vector4w (-> obj sprites 8)) 63 16) - (set-as-offset-from! (-> obj sprites 17) (the-as vector4w (-> obj sprites 8)) 41 4) - (set-as-offset-from! (-> obj sprites 18) (the-as vector4w (-> obj sprites 8)) 6 4) - (set-as-offset-from! (-> obj sprites 19) (the-as vector4w (-> obj sprites 8)) 2 17) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 7) (the-as vector4w (-> obj sprites 8)) 40 40) - (set-as-offset-from! (-> obj sprites 21) (the-as vector4w (-> obj sprites 8)) 25 25) + (set-as-offset-from! (-> this sprites 9) (the-as vector4w (-> this sprites 8)) 40 0) + (set-as-offset-from! (-> this sprites 10) (the-as vector4w (-> this sprites 8)) 0 40) + (set-as-offset-from! (-> this sprites 11) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 12) (the-as vector4w (-> this sprites 8)) 2 32) + (set-as-offset-from! (-> this sprites 13) (the-as vector4w (-> this sprites 8)) 7 60) + (set-as-offset-from! (-> this sprites 14) (the-as vector4w (-> this sprites 8)) 40 60) + (set-as-offset-from! (-> this sprites 15) (the-as vector4w (-> this sprites 8)) 63 32) + (set-as-offset-from! (-> this sprites 16) (the-as vector4w (-> this sprites 8)) 63 16) + (set-as-offset-from! (-> this sprites 17) (the-as vector4w (-> this sprites 8)) 41 4) + (set-as-offset-from! (-> this sprites 18) (the-as vector4w (-> this sprites 8)) 6 4) + (set-as-offset-from! (-> this sprites 19) (the-as vector4w (-> this sprites 8)) 2 17) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 7) (the-as vector4w (-> this sprites 8)) 40 40) + (set-as-offset-from! (-> this sprites 21) (the-as vector4w (-> this sprites 8)) 25 25) (let ((v1-12 (+ (the int (* 127.0 (sin (* 182.04445 (the float (* (-> *display* game-clock frame-counter) 2)))))) 127) ) ) - (set! (-> obj sprites 1 color x) v1-12) - (set! (-> obj sprites 1 color y) v1-12) - (set! (-> obj sprites 1 color z) v1-12) + (set! (-> this sprites 1 color x) v1-12) + (set! (-> this sprites 1 color y) v1-12) + (set! (-> this sprites 1 color z) v1-12) ) - (set! (-> obj sprites 3 color x) (-> obj sprites 1 color x)) - (set! (-> obj sprites 5 color x) (-> obj sprites 1 color x)) - (set! (-> obj sprites 7 color x) (-> obj sprites 1 color x)) - (set! (-> obj sprites 3 color y) (-> obj sprites 1 color y)) - (set! (-> obj sprites 5 color y) (-> obj sprites 1 color y)) - (set! (-> obj sprites 7 color y) (-> obj sprites 1 color y)) - (set! (-> obj sprites 3 color z) (-> obj sprites 1 color z)) - (set! (-> obj sprites 5 color z) (-> obj sprites 1 color z)) - (set! (-> obj sprites 7 color z) (-> obj sprites 1 color z)) - (let ((f30-1 (the float (-> obj values 2 current)))) + (set! (-> this sprites 3 color x) (-> this sprites 1 color x)) + (set! (-> this sprites 5 color x) (-> this sprites 1 color x)) + (set! (-> this sprites 7 color x) (-> this sprites 1 color x)) + (set! (-> this sprites 3 color y) (-> this sprites 1 color y)) + (set! (-> this sprites 5 color y) (-> this sprites 1 color y)) + (set! (-> this sprites 7 color y) (-> this sprites 1 color y)) + (set! (-> this sprites 3 color z) (-> this sprites 1 color z)) + (set! (-> this sprites 5 color z) (-> this sprites 1 color z)) + (set! (-> this sprites 7 color z) (-> this sprites 1 color z)) + (let ((f30-1 (the float (-> this values 2 current)))) (if (= f30-1 100.0) - (set! (-> obj sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1f :page #x67a))) - (set! (-> obj sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #x67a))) + (set! (-> this sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1f :page #x67a))) + (set! (-> this sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #x67a))) ) (cond ((< 75.0 f30-1) - (set! (-> obj sprites 0 angle) (* 182.04445 (- 180.0 (* 3.6 (+ -75.0 f30-1))))) - (set! (-> obj sprites 2 angle) 32768.0) - (set! (-> obj sprites 4 angle) 49152.0) - (set! (-> obj sprites 6 angle) 0.0) + (set! (-> this sprites 0 angle) (* 182.04445 (- 180.0 (* 3.6 (+ -75.0 f30-1))))) + (set! (-> this sprites 2 angle) 32768.0) + (set! (-> this sprites 4 angle) 49152.0) + (set! (-> this sprites 6 angle) 0.0) ) ((< 50.0 f30-1) - (set! (-> obj sprites 0 angle) 32768.0) - (set! (-> obj sprites 2 angle) (* 182.04445 (- 270.0 (* 3.6 (+ -50.0 f30-1))))) - (set! (-> obj sprites 4 angle) 49152.0) - (set! (-> obj sprites 6 angle) 0.0) + (set! (-> this sprites 0 angle) 32768.0) + (set! (-> this sprites 2 angle) (* 182.04445 (- 270.0 (* 3.6 (+ -50.0 f30-1))))) + (set! (-> this sprites 4 angle) 49152.0) + (set! (-> this sprites 6 angle) 0.0) ) ((< 25.0 f30-1) - (set! (-> obj sprites 0 angle) 32768.0) - (set! (-> obj sprites 2 angle) 49152.0) - (set! (-> obj sprites 4 angle) (* 182.04445 (- (* 3.6 (+ -25.0 f30-1))))) - (set! (-> obj sprites 6 angle) 0.0) + (set! (-> this sprites 0 angle) 32768.0) + (set! (-> this sprites 2 angle) 49152.0) + (set! (-> this sprites 4 angle) (* 182.04445 (- (* 3.6 (+ -25.0 f30-1))))) + (set! (-> this sprites 6 angle) 0.0) ) (else - (set! (-> obj sprites 0 angle) 32768.0) - (set! (-> obj sprites 2 angle) 49152.0) - (set! (-> obj sprites 4 angle) 0.0) - (set! (-> obj sprites 6 angle) (* 182.04445 (- 90.0 (* 3.6 f30-1)))) + (set! (-> this sprites 0 angle) 32768.0) + (set! (-> this sprites 2 angle) 49152.0) + (set! (-> this sprites 4 angle) 0.0) + (set! (-> this sprites 6 angle) (* 182.04445 (- 90.0 (* 3.6 f30-1)))) ) ) ) - (let ((v1-55 (-> obj values 0 current)) + (let ((v1-55 (-> this values 0 current)) (a0-25 12) ) (while (< a0-25 20) - (set! (-> obj sprites a0-25 scale-x) (if (> v1-55 0) - 1.0 - 0.0 - ) + (set! (-> this sprites a0-25 scale-x) (if (> v1-55 0) + 1.0 + 0.0 + ) ) (+! a0-25 1) (+! v1-55 -10) ) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-health ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-health ((obj hud-health)) - (set! (-> obj values 0 target) (the int (* 10.0 (-> *target* fact health)))) - (set! (-> obj values 1 target) (the-as int (-> *target* fact health-pickup-time))) - (set! (-> obj values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) - (set! (-> obj values 3 target) (the-as int (-> *target* fact eco-pill-dark-pickup-time))) - (if (and (zero? (-> obj values 2 target)) (!= (-> *target* game eco-pill-dark) 0.0)) - (set! (-> obj values 2 target) 100) +(defmethod update-values hud-health ((this hud-health)) + (set! (-> this values 0 target) (the int (* 10.0 (-> *target* fact health)))) + (set! (-> this values 1 target) (the-as int (-> *target* fact health-pickup-time))) + (set! (-> this values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) + (set! (-> this values 3 target) (the-as int (-> *target* fact eco-pill-dark-pickup-time))) + (if (and (zero? (-> this values 2 target)) (!= (-> *target* game eco-pill-dark) 0.0)) + (set! (-> this values 2 target) 100) ) - ((method-of-type hud update-values) obj) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-health ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-health ((obj hud-health)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-left-1) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-health ((this hud-health)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left-1) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 pos z) #xfffff1) - (set! (-> obj sprites 0 scale-x) 8.0) - (set! (-> obj sprites 0 scale-y) 8.0) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) - (set! (-> obj sprites 1 angle) 32768.0) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 2 pos z) #xfffff3) - (set! (-> obj sprites 2 scale-x) 8.0) - (set! (-> obj sprites 2 scale-y) 8.0) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) - (set! (-> obj sprites 3 angle) 49152.0) - (set! (-> obj sprites 3 pos z) #xfffff2) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 4 pos z) #xfffff5) - (set! (-> obj sprites 4 scale-x) 8.0) - (set! (-> obj sprites 4 scale-y) 8.0) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) - (set! (-> obj sprites 5 angle) 0.0) - (set! (-> obj sprites 5 pos z) #xfffff4) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 6 pos z) #xfffff7) - (set! (-> obj sprites 6 scale-x) 8.0) - (set! (-> obj sprites 6 scale-y) 8.0) - (set! (-> obj sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) - (set! (-> obj sprites 7 angle) 16384.0) - (set! (-> obj sprites 7 pos z) #xfffff6) - (set! (-> obj sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x67a))) - (set! (-> obj sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x67a))) - (set! (-> obj sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x67a))) - (set! (-> obj sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #x67a))) - (set! (-> obj sprites 12 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) - (set! (-> obj sprites 12 flags) (the-as uint 3)) - (set! (-> obj sprites 12 scale-x) 0.9) - (set! (-> obj sprites 12 scale-y) 1.0) - (set! (-> obj sprites 13 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) - (set! (-> obj sprites 13 flags) (the-as uint 3)) - (set! (-> obj sprites 13 scale-x) 0.9) - (set! (-> obj sprites 13 scale-y) 1.0) - (set! (-> obj sprites 14 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) - (set! (-> obj sprites 14 flags) (the-as uint 2)) - (set! (-> obj sprites 14 scale-x) 0.9) - (set! (-> obj sprites 14 scale-y) 1.0) - (set! (-> obj sprites 15 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) - (set! (-> obj sprites 15 flags) (the-as uint 2)) - (set! (-> obj sprites 15 scale-x) 0.9) - (set! (-> obj sprites 15 scale-y) 1.0) - (set! (-> obj sprites 16 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) - (set! (-> obj sprites 16 scale-x) 0.9) - (set! (-> obj sprites 16 scale-y) 1.0) - (set! (-> obj sprites 17 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) - (set! (-> obj sprites 17 scale-x) 0.9) - (set! (-> obj sprites 17 scale-y) 1.0) - (set! (-> obj sprites 18 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) - (set! (-> obj sprites 18 flags) (the-as uint 1)) - (set! (-> obj sprites 18 scale-x) 0.9) - (set! (-> obj sprites 18 scale-y) 1.0) - (set! (-> obj sprites 19 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) - (set! (-> obj sprites 19 flags) (the-as uint 1)) - (set! (-> obj sprites 19 scale-x) 0.9) - (set! (-> obj sprites 19 scale-y) 1.0) - (set! (-> obj sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #x67a))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 pos z) #xfffff1) + (set! (-> this sprites 0 scale-x) 8.0) + (set! (-> this sprites 0 scale-y) 8.0) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> this sprites 1 angle) 32768.0) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 2 pos z) #xfffff3) + (set! (-> this sprites 2 scale-x) 8.0) + (set! (-> this sprites 2 scale-y) 8.0) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> this sprites 3 angle) 49152.0) + (set! (-> this sprites 3 pos z) #xfffff2) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 4 pos z) #xfffff5) + (set! (-> this sprites 4 scale-x) 8.0) + (set! (-> this sprites 4 scale-y) 8.0) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> this sprites 5 angle) 0.0) + (set! (-> this sprites 5 pos z) #xfffff4) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 6 pos z) #xfffff7) + (set! (-> this sprites 6 scale-x) 8.0) + (set! (-> this sprites 6 scale-y) 8.0) + (set! (-> this sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> this sprites 7 angle) 16384.0) + (set! (-> this sprites 7 pos z) #xfffff6) + (set! (-> this sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x67a))) + (set! (-> this sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x67a))) + (set! (-> this sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x67a))) + (set! (-> this sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #x67a))) + (set! (-> this sprites 12 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> this sprites 12 flags) (the-as uint 3)) + (set! (-> this sprites 12 scale-x) 0.9) + (set! (-> this sprites 12 scale-y) 1.0) + (set! (-> this sprites 13 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> this sprites 13 flags) (the-as uint 3)) + (set! (-> this sprites 13 scale-x) 0.9) + (set! (-> this sprites 13 scale-y) 1.0) + (set! (-> this sprites 14 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> this sprites 14 flags) (the-as uint 2)) + (set! (-> this sprites 14 scale-x) 0.9) + (set! (-> this sprites 14 scale-y) 1.0) + (set! (-> this sprites 15 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> this sprites 15 flags) (the-as uint 2)) + (set! (-> this sprites 15 scale-x) 0.9) + (set! (-> this sprites 15 scale-y) 1.0) + (set! (-> this sprites 16 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> this sprites 16 scale-x) 0.9) + (set! (-> this sprites 16 scale-y) 1.0) + (set! (-> this sprites 17 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> this sprites 17 scale-x) 0.9) + (set! (-> this sprites 17 scale-y) 1.0) + (set! (-> this sprites 18 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> this sprites 18 flags) (the-as uint 1)) + (set! (-> this sprites 18 scale-x) 0.9) + (set! (-> this sprites 18 scale-y) 1.0) + (set! (-> this sprites 19 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> this sprites 19 flags) (the-as uint 1)) + (set! (-> this sprites 19 scale-x) 0.9) + (set! (-> this sprites 19 scale-y) 1.0) + (set! (-> this sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #x67a))) 0 (none) ) ;; definition for method 15 of type hud-dark-eco-symbol ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) +(defmethod draw hud-dark-eco-symbol ((this hud-dark-eco-symbol)) (let ((v1-0 (process-by-name "hud-health" *active-pool*)) - (f30-0 (-> obj offset)) + (f30-0 (-> this offset)) ) (if (and v1-0 (< (-> (the-as hud-health v1-0) offset) f30-0)) (set! f30-0 (-> (the-as hud-health v1-0) offset)) ) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) (the int (+ 13.0 (* -130.0 f30-0))) (the int (+ 25.0 (* -130.0 f30-0))) @@ -360,81 +360,81 @@ (the int (+ 299.0 (* 130.0 f30-0))) ) (cond - ((or (= (-> obj values 2 target) 100) (= (-> *target* game eco-pill-dark) 100.0)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x11 :page #x67a))) + ((or (= (-> this values 2 target) 100) (= (-> *target* game eco-pill-dark) 100.0)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x11 :page #x67a))) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) (the int (+ 13.0 (* -130.0 f30-0))) (the int (+ 25.0 (* -130.0 f30-0))) ) (the int (+ 299.0 (* 130.0 f30-0))) ) - (set! (-> obj sprites 0 scale-x) 1.5) - (set! (-> obj sprites 0 scale-y) 1.5) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this sprites 0 scale-y) 1.5) (let ((v1-31 (+ (the int (* 15.0 (sin (* 182.04445 (the float (* (-> *display* game-clock frame-counter) 4)))))) 160) ) ) - (set! (-> obj sprites 0 color x) v1-31) - (set! (-> obj sprites 0 color y) v1-31) - (set! (-> obj sprites 0 color z) v1-31) + (set! (-> this sprites 0 color x) v1-31) + (set! (-> this sprites 0 color y) v1-31) + (set! (-> this sprites 0 color z) v1-31) ) ) (else - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #x67a))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #x67a))) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) (the int (+ 29.0 (* -130.0 f30-0))) (the int (+ 36.0 (* -130.0 f30-0))) ) (the int (+ 315.0 (* 130.0 f30-0))) ) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (set! (-> obj sprites 0 color x) 128) - (set! (-> obj sprites 0 color y) 128) - (set! (-> obj sprites 0 color z) 128) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 color x) 128) + (set! (-> this sprites 0 color y) 128) + (set! (-> this sprites 0 color z) 128) ) ) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-dark-eco-symbol ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) - (set! (-> obj values 0 target) (the int (* 10.0 (-> *target* fact health)))) - (set! (-> obj values 1 target) (the-as int (-> *target* fact health-pickup-time))) - (set! (-> obj values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) - (set! (-> obj values 3 target) (the-as int (-> *target* fact eco-pill-dark-pickup-time))) - (if (and (or (and (zero? (-> obj values 2 target)) (!= (-> *target* game eco-pill-dark) 0.0)) +(defmethod update-values hud-dark-eco-symbol ((this hud-dark-eco-symbol)) + (set! (-> this values 0 target) (the int (* 10.0 (-> *target* fact health)))) + (set! (-> this values 1 target) (the-as int (-> *target* fact health-pickup-time))) + (set! (-> this values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) + (set! (-> this values 3 target) (the-as int (-> *target* fact eco-pill-dark-pickup-time))) + (if (and (or (and (zero? (-> this values 2 target)) (!= (-> *target* game eco-pill-dark) 0.0)) (focus-test? *target* dark) ) (and (not (focus-test? *target* indax)) (-> *setting-control* user-current darkjak)) ) - (set! (-> obj values 2 target) 100) + (set! (-> this values 2 target) 100) ) - (if (= (-> obj values 2 target) 100) - (+! (-> obj values 4 target) 1) + (if (= (-> this values 2 target) 100) + (+! (-> this values 4 target) 1) ) - ((method-of-type hud update-values) obj) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-dark-eco-symbol ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-left-2) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-dark-eco-symbol ((this hud-dark-eco-symbol)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left-2) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.5) - (set! (-> obj sprites 0 scale-y) 1.5) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this sprites 0 scale-y) 1.5) 0 (none) ) @@ -444,130 +444,134 @@ ;; definition for method 15 of type hud-skullgem ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-skullgem ((obj hud-skullgem)) +(defmethod draw hud-skullgem ((this hud-skullgem)) (set-hud-piece-position! - (the-as hud-sprite (-> obj icons 0 pos)) - (the int (+ 60.0 (* -130.0 (-> obj offset)))) + (the-as hud-sprite (-> this icons 0 pos)) + (the int (+ 60.0 (* -130.0 (-> this offset)))) 150 ) (set-as-offset-from! - (the-as hud-sprite (-> obj sprites)) - (the-as vector4w (-> obj icons 0 pos)) + (the-as hud-sprite (-> this sprites)) + (the-as vector4w (-> this icons 0 pos)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) -27 -35 ) 20 ) - (set! (-> obj sprites 0 scale-x) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) - 0.86 - 1.1 - ) + (set! (-> this sprites 0 scale-x) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 0.86 + 1.1 + ) ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj icons 0 pos)) 0 45) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this icons 0 pos)) 0 45) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-skullgem ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-skullgem ((obj hud-skullgem)) - (set! (-> obj values 0 target) (the int (-> *target* game gem))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-skullgem ((this hud-skullgem)) + (set! (-> this values 0 target) (the int (-> *target* game gem))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-skullgem ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-skullgem ((obj hud-skullgem)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-center-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-skullgem ((this hud-skullgem)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (hud-create-icon obj 0 (the-as int (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f)))) - (set! (-> obj icons 0 scale-x) 0.025) - (set! (-> obj icons 0 scale-y) 0.035) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 0.86) - (set! (-> obj sprites 0 scale-y) 1.05) - (set! (-> obj sprites 0 pos z) #xfff9ff) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 scale) 0.5) + (hud-create-icon this 0 (the-as int (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f)))) + (set! (-> this icons 0 scale-x) 0.025) + (set! (-> this icons 0 scale-y) 0.035) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x67a))) + (set! (-> this sprites 0 scale-x) 0.86) + (set! (-> this sprites 0 scale-y) 1.05) + (set! (-> this sprites 0 pos z) #xfff9ff) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 scale) 0.5) 0 (none) ) ;; definition for method 15 of type hud-skill ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-skill ((obj hud-skill)) +(defmethod draw hud-skill ((this hud-skill)) (set-hud-piece-position! - (the-as hud-sprite (-> obj icons 0 pos)) - (the int (+ 60.0 (* -130.0 (-> obj offset)))) + (the-as hud-sprite (-> this icons 0 pos)) + (the int (+ 60.0 (* -130.0 (-> this offset)))) 270 ) (set-as-offset-from! - (the-as hud-sprite (-> obj sprites)) - (the-as vector4w (-> obj icons 0 pos)) + (the-as hud-sprite (-> this sprites)) + (the-as vector4w (-> this icons 0 pos)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) -19 -25 ) -39 ) - (set! (-> obj sprites 0 scale-x) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) - 0.62 - 0.77 - ) + (set! (-> this sprites 0 scale-x) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 0.62 + 0.77 + ) ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj icons 0 pos)) 0 -5) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this icons 0 pos)) 0 -5) (when (not (paused?)) (let ((s5-1 (new 'stack-no-clear 'quaternion))) (quaternion-axis-angle! s5-1 0.0 1.0 0.0 364.0889) - (quaternion*! (-> obj icons 0 icon 0 root quat) s5-1 (-> obj icons 0 icon 0 root quat)) + (quaternion*! (-> this icons 0 icon 0 root quat) s5-1 (-> this icons 0 icon 0 root quat)) ) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-skill ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-skill ((obj hud-skill)) - (set! (-> obj values 0 target) (the int (-> *target* game skill))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-skill ((this hud-skill)) + (set! (-> this values 0 target) (the int (-> *target* game skill))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-skill ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-skill ((obj hud-skill)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-skill ((this hud-skill)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (hud-create-icon obj 0 (the-as int (art-group-get-by-name *level* "skel-skill" (the-as (pointer uint32) #f)))) - (set! (-> obj icons 0 scale-x) 0.009) - (set! (-> obj icons 0 scale-y) -0.018) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 0.62) - (set! (-> obj sprites 0 scale-y) 1.34) - (set! (-> obj sprites 0 pos z) #xfff9ff) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 scale) 0.5) - (logior! (-> obj values 0 flags) 1) + (hud-create-icon + this + 0 + (the-as int (art-group-get-by-name *level* "skel-skill" (the-as (pointer uint32) #f))) + ) + (set! (-> this icons 0 scale-x) 0.009) + (set! (-> this icons 0 scale-y) -0.018) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x67a))) + (set! (-> this sprites 0 scale-x) 0.62) + (set! (-> this sprites 0 scale-y) 1.34) + (set! (-> this sprites 0 pos z) #xfff9ff) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 scale) 0.5) + (logior! (-> this values 0 flags) 1) 0 (none) ) ;; definition for method 25 of type hud-skill ;; WARN: Return type mismatch int vs none. -(defmethod update-value-callback hud-skill ((obj hud-skill) (arg0 int) (arg1 int)) +(defmethod update-value-callback hud-skill ((this hud-skill) (arg0 int) (arg1 int)) (if (> arg1 0) (sound-play "skill-pickup" :pitch 0.5) ) @@ -577,211 +581,216 @@ ;; definition for method 15 of type hud-score ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-score ((obj hud-score)) +(defmethod draw hud-score ((this hud-score)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 480.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 480.0 (* 130.0 (-> this offset)))) 140 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -12 8) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -12 8) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-score ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-score ((obj hud-score)) - (set! (-> obj values 0 target) (the int (-> *game-info* score))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-score ((this hud-score)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-score ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-score ((obj hud-score)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-center-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-score ((this hud-score)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.5) - (set! (-> obj strings 0 scale) 0.5) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning right large)) - (set! (-> obj strings 0 color) (font-color red)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning right large)) + (set! (-> this strings 0 color) (font-color red)) 0 (none) ) ;; definition for method 15 of type hud-timer ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-timer ((obj hud-timer)) +(defmethod draw hud-timer ((this hud-timer)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 264 - (the int (+ 50.0 (* -100.0 (-> obj offset)))) + (the int (+ 50.0 (* -100.0 (-> this offset)))) ) - (format (clear (-> obj strings 0 text)) "~1,'0D" (/ (-> obj values 0 current) 10)) - (format (clear (-> obj strings 1 text)) "~1,'0D" (mod (-> obj values 0 current) 10)) - (format (clear (-> obj strings 2 text)) ":") - (format (clear (-> obj strings 3 text)) "~1,'0D" (/ (-> obj values 1 current) 10)) - (format (clear (-> obj strings 4 text)) "~1,'0D" (mod (-> obj values 1 current) 10)) + (format (clear (-> this strings 0 text)) "~1,'0D" (/ (-> this values 0 current) 10)) + (format (clear (-> this strings 1 text)) "~1,'0D" (mod (-> this values 0 current) 10)) + (format (clear (-> this strings 2 text)) ":") + (format (clear (-> this strings 3 text)) "~1,'0D" (/ (-> this values 1 current) 10)) + (format (clear (-> this strings 4 text)) "~1,'0D" (mod (-> this values 1 current) 10)) (let ((s5-5 20) (s4-0 -42) ) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) s4-0 -24) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) s4-0 -24) (let ((s4-1 (+ s4-0 s5-5))) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj sprites)) s4-1 -24) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) s4-1 -24) (let ((s4-2 (+ s4-1 16))) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 2 pos)) (the-as vector4w (-> obj sprites)) s4-2 -24) + (set-as-offset-from! (the-as hud-sprite (-> this strings 2 pos)) (the-as vector4w (-> this sprites)) s4-2 -24) (let ((s4-3 (+ s4-2 16))) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 3 pos)) (the-as vector4w (-> obj sprites)) s4-3 -24) + (set-as-offset-from! (the-as hud-sprite (-> this strings 3 pos)) (the-as vector4w (-> this sprites)) s4-3 -24) (let ((a2-13 (+ s4-3 s5-5))) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 4 pos)) (the-as vector4w (-> obj sprites)) a2-13 -24) + (set-as-offset-from! + (the-as hud-sprite (-> this strings 4 pos)) + (the-as vector4w (-> this sprites)) + a2-13 + -24 + ) ) ) ) ) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-timer ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-timer ((obj hud-timer)) - (set! (-> obj values 0 target) (/ (-> *game-info* timer) #x4650)) - (set! (-> obj values 1 target) (/ (mod (-> *game-info* timer) #x4650) 300)) - (let ((v1-8 (abs (- (-> obj values 1 target) (-> obj values 2 target))))) +(defmethod update-values hud-timer ((this hud-timer)) + (set! (-> this values 0 target) (/ (-> *game-info* timer) #x4650)) + (set! (-> this values 1 target) (/ (mod (-> *game-info* timer) #x4650) 300)) + (let ((v1-8 (abs (- (-> this values 1 target) (-> this values 2 target))))) (when (> v1-8 0) - (set! (-> obj values 2 target) (-> obj values 1 target)) - (if (and (< (-> obj values 0 target) 1) (< (-> obj values 1 target) 10)) + (set! (-> this values 2 target) (-> this values 1 target)) + (if (and (< (-> this values 0 target) 1) (< (-> this values 1 target) 10)) (sound-play "timer-warn") (sound-play "timer-beep") ) ) ) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-timer ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-timer ((obj hud-timer)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-center) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-timer ((this hud-timer)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 8)) - (set! (-> obj sprites 0 scale-x) 2.2) - (set! (-> obj sprites 0 scale-y) 2.0) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 8)) + (set! (-> this sprites 0 scale-x) 2.2) + (set! (-> this sprites 0 scale-y) 2.0) (dotimes (s5-0 5) - (alloc-string-if-needed obj s5-0) - (set! (-> obj strings s5-0 scale) 0.8) - (set! (-> obj strings s5-0 flags) (font-flags kerning middle large)) - (set! (-> obj strings s5-0 color) (font-color green)) + (alloc-string-if-needed this s5-0) + (set! (-> this strings s5-0 scale) 0.8) + (set! (-> this strings s5-0 flags) (font-flags kerning middle large)) + (set! (-> this strings s5-0 color) (font-color green)) ) - (set! (-> obj values 2 target) (-> obj values 1 target)) + (set! (-> this values 2 target) (-> this values 1 target)) 0 (none) ) ;; definition for method 15 of type hud-big-score ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-big-score ((obj hud-big-score)) +(defmethod draw hud-big-score ((this hud-big-score)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 264 - (the int (+ 50.0 (* -100.0 (-> obj offset)))) + (the int (+ 50.0 (* -100.0 (-> this offset)))) ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -7 -24) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -7 -24) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-big-score ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-big-score ((obj hud-big-score)) - (set! (-> obj values 0 target) (the int (-> *game-info* score))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-big-score ((this hud-big-score)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-big-score ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-big-score ((obj hud-big-score)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-center) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-big-score ((this hud-big-score)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 8)) - (set! (-> obj sprites 0 scale-x) 2.7) - (set! (-> obj sprites 0 scale-y) 2.0) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.8) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color green)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 8)) + (set! (-> this sprites 0 scale-x) 2.7) + (set! (-> this sprites 0 scale-y) 2.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.8) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color green)) 0 (none) ) ;; definition for method 15 of type hud-goal ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-goal ((obj hud-goal)) +(defmethod draw hud-goal ((this hud-goal)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 65.0 (* -130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 65.0 (* -130.0 (-> this offset)))) 70 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) 0 -8) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj sprites)) 0 -40) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 0 -40) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-goal ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-goal ((obj hud-goal)) - (set! (-> obj values 0 target) (the int (-> *game-info* goal))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-goal ((this hud-goal)) + (set! (-> this values 0 target) (the int (-> *game-info* goal))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-goal ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-goal ((obj hud-goal)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-goal ((this hud-goal)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 flags) (the-as uint 8)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.5) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color red)) - (alloc-string-if-needed obj 1) - (set! (-> obj strings 1 scale) 0.75) - (set! (-> obj strings 1 flags) (font-flags kerning middle large)) - (set! (-> obj strings 1 color) (font-color red)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 flags) (the-as uint 8)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.75) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color red)) (let ((s5-0 format) - (gp-1 (clear (-> obj strings 1 text))) + (gp-1 (clear (-> this strings 1 text))) (s4-0 "~S") ) (format (clear *temp-string*) (lookup-text! *common-text* (text-id highscore-text-goal) #f)) @@ -793,62 +802,62 @@ ;; definition for method 15 of type hud-miss ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-miss ((obj hud-miss)) +(defmethod draw hud-miss ((this hud-miss)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 448.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 448.0 (* 130.0 (-> this offset)))) 70 ) - (format (clear (-> obj strings 0 text)) "~D/~D" (-> obj values 0 current) (-> obj values 1 current)) + (format (clear (-> this strings 0 text)) "~D/~D" (-> this values 0 current) (-> this values 1 current)) (let ((s5-1 format) - (s4-0 (clear (-> obj strings 1 text))) + (s4-0 (clear (-> this strings 1 text))) (s3-0 "~S") ) (format (clear *temp-string*) (lookup-text! *common-text* (text-id miss) #f)) (s5-1 s4-0 s3-0 *temp-string*) ) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) 0 -8) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj sprites)) 0 -40) - ((method-of-type hud draw) obj) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 0 -40) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-miss ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-miss ((obj hud-miss)) - (set! (-> obj values 0 target) (the int (-> *game-info* miss))) - (set! (-> obj values 1 target) (the int (-> *game-info* miss-max))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-miss ((this hud-miss)) + (set! (-> this values 0 target) (the int (-> *game-info* miss))) + (set! (-> this values 1 target) (the int (-> *game-info* miss-max))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-miss ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-miss ((obj hud-miss)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-miss ((this hud-miss)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 flags) (the-as uint 8)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.5) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color red)) - (alloc-string-if-needed obj 1) - (set! (-> obj strings 1 scale) 0.75) - (set! (-> obj strings 1 flags) (font-flags kerning middle large)) - (set! (-> obj strings 1 color) (font-color red)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 flags) (the-as uint 8)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.75) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color red)) 0 (none) ) ;; definition for method 15 of type hud-progress ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-progress ((obj hud-progress)) +(defmethod draw hud-progress ((this hud-progress)) (with-pp (let ((f0-0 (if (process-by-name "hud-timer" *active-pool*) 65.0 @@ -856,20 +865,20 @@ ) ) ) - (seek! (-> obj sprites 2 scale-y) f0-0 (* 2.0 (-> pp clock time-adjust-ratio))) + (seek! (-> this sprites 2 scale-y) f0-0 (* 2.0 (-> pp clock time-adjust-ratio))) ) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 256 - (the int (+ (* -100.0 (-> obj offset)) (-> obj sprites 2 scale-y))) + (the int (+ (* -100.0 (-> this offset)) (-> this sprites 2 scale-y))) ) (set-as-offset-from! - (-> obj sprites 1) - (the-as vector4w (-> obj sprites)) - (+ (the int (* 0.09 (the float (-> obj values 0 current)))) -42) + (-> this sprites 1) + (the-as vector4w (-> this sprites)) + (+ (the int (* 0.09 (the float (-> this values 0 current)))) -42) 0 ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) @@ -877,33 +886,33 @@ ;; definition for method 16 of type hud-progress ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-progress ((obj hud-progress)) - (set! (-> obj values 0 target) (the int (* 1000.0 (-> *game-info* distance)))) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-progress ((this hud-progress)) + (set! (-> this values 0 target) (the int (* 1000.0 (-> *game-info* distance)))) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-progress ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-progress ((obj hud-progress)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-center-2) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-progress ((this hud-progress)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x33 :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 8)) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x34 :page #x67a))) - (set! (-> obj sprites 1 flags) (the-as uint 8)) - (set! (-> obj sprites 1 scale-x) 1.8) - (set! (-> obj sprites 1 scale-y) 1.8) - (set! (-> obj sprites 2 scale-y) (if (process-by-name "hud-timer" *active-pool*) - 65.0 - 35.0 - ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x33 :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 8)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x34 :page #x67a))) + (set! (-> this sprites 1 flags) (the-as uint 8)) + (set! (-> this sprites 1 scale-x) 1.8) + (set! (-> this sprites 1 scale-y) 1.8) + (set! (-> this sprites 2 scale-y) (if (process-by-name "hud-timer" *active-pool*) + 65.0 + 35.0 + ) ) 0 (none) @@ -912,7 +921,7 @@ ;; definition for method 15 of type hud-gun ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-gun ((obj hud-gun)) +(defmethod draw hud-gun ((this hud-gun)) (local-vars (s3-0 int) (sv-16 int) (sv-32 dma-buffer)) (let ((s4-0 0) (s5-0 0) @@ -920,43 +929,43 @@ 0 (let ((s2-0 20)) (cond - ((= (-> obj values 0 current) 1) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xf :page #x67a))) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x23 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.1) - (set! (-> obj sprites 0 scale-y) 1.5) - (set! (-> obj sprites 1 scale-x) 0.0) + ((= (-> this values 0 current) 1) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xf :page #x67a))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x23 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.1) + (set! (-> this sprites 0 scale-y) 1.5) + (set! (-> this sprites 1 scale-x) 0.0) (set! s5-0 -3) (set! s3-0 (the int (-> *FACT-bank* ammo-yellow-max))) ) - ((= (-> obj values 0 current) 4) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #x67a))) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x21 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.8) - (set! (-> obj sprites 0 scale-y) 1.6) - (set! (-> obj sprites 1 scale-x) 0.0) + ((= (-> this values 0 current) 4) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #x67a))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x21 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.8) + (set! (-> this sprites 0 scale-y) 1.6) + (set! (-> this sprites 1 scale-x) 0.0) (set! s4-0 14) (set! s3-0 (the int (-> *FACT-bank* ammo-dark-max))) (set! s2-0 10) ) - ((= (-> obj values 0 current) 3) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #x67a))) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #x67a))) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x20 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.4) - (set! (-> obj sprites 0 scale-y) 1.4) - (set! (-> obj sprites 1 scale-x) 1.4) - (set! (-> obj sprites 1 scale-y) 1.4) + ((= (-> this values 0 current) 3) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #x67a))) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #x67a))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x20 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.4) + (set! (-> this sprites 0 scale-y) 1.4) + (set! (-> this sprites 1 scale-x) 1.4) + (set! (-> this sprites 1 scale-y) 1.4) (set! s4-0 43) (set! s5-0 6) (set! s3-0 (the int (-> *FACT-bank* ammo-blue-max))) ) (else - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xe :page #x67a))) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x22 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.8) - (set! (-> obj sprites 0 scale-y) 1.6) - (set! (-> obj sprites 1 scale-x) 0.0) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xe :page #x67a))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x22 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.8) + (set! (-> this sprites 0 scale-y) 1.6) + (set! (-> this sprites 1 scale-x) 0.0) (set! s4-0 14) (set! s5-0 -2) (set! s3-0 (the int (-> *FACT-bank* ammo-red-max))) @@ -967,35 +976,35 @@ (set! s3-0 (* s3-0 2)) ) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (- (the int (+ 507.0 (* 130.0 (-> obj offset)))) s4-0) - (the int (+ (- 25.0 (the float s5-0)) (* -100.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (- (the int (+ 507.0 (* 130.0 (-> this offset)))) s4-0) + (the int (+ (- 25.0 (the float s5-0)) (* -100.0 (-> this offset)))) ) (let ((f30-0 1.0)) (cond - ((zero? (-> obj values 0 current)) + ((zero? (-> this values 0 current)) (set! f30-0 0.0) - (set! (-> obj strings 0 pos 0) 0) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) -3 0) + (set! (-> this strings 0 pos 0) 0) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -3 0) ) (else - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) -4 11) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -4 11) (set-as-offset-from! - (the-as hud-sprite (-> obj strings 0 pos)) - (the-as vector4w (-> obj sprites)) + (the-as hud-sprite (-> this strings 0 pos)) + (the-as vector4w (-> this sprites)) (+ s4-0 -70) (+ s5-0 18) ) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites)) (+ s4-0 -68) (+ (if (= s2-0 20) - 98 - 73 - ) - s5-0 - ) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites)) (+ s4-0 -68) (+ (if (= s2-0 20) + 98 + 73 + ) + s5-0 + ) ) - (set! (-> obj sprites 6 scale-x) 1.0) - (let ((s0-0 (mod (-> obj values 1 current) s2-0))) - (if (and (zero? s0-0) (nonzero? (-> obj values 1 current))) + (set! (-> this sprites 6 scale-x) 1.0) + (let ((s0-0 (mod (-> this values 1 current) s2-0))) + (if (and (zero? s0-0) (nonzero? (-> this values 1 current))) (set! s0-0 s2-0) ) (set! sv-32 (-> *display* frames (-> *display* on-screen) global-buf)) @@ -1003,17 +1012,17 @@ (set! sv-16 0) (while (< sv-16 s2-0) (if (= sv-16 s0-0) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x24 :page #x67a))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x24 :page #x67a))) ) - (draw (-> obj sprites 6) sv-32 (-> obj level)) - (+! (-> obj sprites 6 pos y) -5) + (draw (-> this sprites 6) sv-32 (-> this level)) + (+! (-> this sprites 6 pos y) -5) (if (= sv-16 (+ (/ s2-0 2) -1)) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites)) (+ s4-0 -83) (+ (if (= s2-0 20) - 98 - 73 - ) - s5-0 - ) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites)) (+ s4-0 -83) (+ (if (= s2-0 20) + 98 + 73 + ) + s5-0 + ) ) ) (set! sv-16 (+ sv-16 1)) @@ -1036,8 +1045,8 @@ ) ) ) - (set! (-> obj sprites 6 scale-x) 0.0) - (set! (-> obj sprites 2 scale-x) + (set! (-> this sprites 6 scale-x) 0.0) + (set! (-> this sprites 2 scale-x) (if (and (logtest? (-> *target* game features) (game-feature gun)) (-> *setting-control* user-current gun) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue)) @@ -1048,7 +1057,7 @@ 0.0 ) ) - (set! (-> obj sprites 3 scale-x) + (set! (-> this sprites 3 scale-x) (if (and (logtest? (-> *target* game features) (game-feature gun)) (and (-> *setting-control* user-current gun) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark)) @@ -1060,7 +1069,7 @@ 0.0 ) ) - (set! (-> obj sprites 4 scale-x) + (set! (-> this sprites 4 scale-x) (if (and (logtest? (-> *target* game features) (game-feature gun)) (and (-> *setting-control* user-current gun) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red)) @@ -1072,7 +1081,7 @@ 0.0 ) ) - (set! (-> obj sprites 5 scale-x) + (set! (-> this sprites 5 scale-x) (if (and (logtest? (-> *target* game features) (game-feature gun)) (and (-> *setting-control* user-current gun) (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow)) @@ -1086,104 +1095,104 @@ ) ) ) - (format (clear (-> obj strings 0 text)) "~D/~D" (-> obj values 1 current) s3-0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites)) (+ s4-0 -110) (+ s5-0 18)) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites)) (+ s4-0 -36) (+ s5-0 19)) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites)) (+ s4-0 -78) (+ s5-0 7)) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites)) (+ s4-0 -78) (+ s5-0 37)) + (format (clear (-> this strings 0 text)) "~D/~D" (-> this values 1 current) s3-0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) (+ s4-0 -110) (+ s5-0 18)) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) (+ s4-0 -36) (+ s5-0 19)) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) (+ s4-0 -78) (+ s5-0 7)) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites)) (+ s4-0 -78) (+ s5-0 37)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-gun ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-gun ((obj hud-gun)) +(defmethod update-values hud-gun ((this hud-gun)) (cond ((focus-test? *target* gun) - (set! (-> obj values 0 target) (the-as int (-> *target* gun gun-type))) - (set! (-> obj values 1 target) (the int (get-gun-ammo (-> *target* fact)))) - (logclear! (-> obj flags) (hud-flags disable)) - (logior! (-> obj flags) (hud-flags show)) + (set! (-> this values 0 target) (the-as int (-> *target* gun gun-type))) + (set! (-> this values 1 target) (the int (get-gun-ammo (-> *target* fact)))) + (logclear! (-> this flags) (hud-flags disable)) + (logior! (-> this flags) (hud-flags show)) ) (else - (logior! (-> obj flags) (hud-flags disable)) - (logclear! (-> obj flags) (hud-flags show)) - (send-event obj 'hide) + (logior! (-> this flags) (hud-flags disable)) + (logclear! (-> this flags) (hud-flags show)) + (send-event this 'hide) ) ) - ((method-of-type hud update-values) obj) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-gun ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-gun ((obj hud-gun)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-gun ((this hud-gun)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x67a))) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x9 :page #x67a))) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xa :page #x67a))) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x7 :page #x67a))) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 scale) 0.5) - (logior! (-> obj flags) (hud-flags disable)) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x67a))) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x9 :page #x67a))) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xa :page #x67a))) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x7 :page #x67a))) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 scale) 0.5) + (logior! (-> this flags) (hud-flags disable)) 0 (none) ) ;; definition for method 15 of type hud-samos-young ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-samos-young ((obj hud-samos-young)) +(defmethod draw hud-samos-young ((this hud-samos-young)) (set-hud-piece-position! - (-> obj sprites 2) - (the int (+ 30.0 (* -130.0 (-> obj offset)))) - (the int (+ 30.0 (* -100.0 (-> obj offset)))) + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 7 5) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 7 5) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-samos-young ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-samos-young ((obj hud-samos-young)) - (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-samos-young ((this hud-samos-young)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-samos-young ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-samos-young ((obj hud-samos-young)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-samos-young ((this hud-samos-young)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 scale-x) 12.0) - (set! (-> obj sprites 0 scale-y) 11.2) - (set! (-> obj sprites 0 pos z) #xfffff2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 3 tex) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tex) (lookup-texture-by-name "hud-samos-young-head-01" (the-as string #f) (the-as (pointer texture-page) #f)) ) - (set! (-> obj sprites 3 scale-x) 0.8) - (set! (-> obj sprites 3 scale-y) 0.8) - (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 scale-x) 0.8) + (set! (-> this sprites 3 scale-y) 0.8) + (set! (-> this sprites 3 pos z) #xffffff) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc index 70c9867dd5..28cc8c8e1f 100644 --- a/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc @@ -16,19 +16,19 @@ ) ;; definition for method 3 of type hud-string -(defmethod inspect hud-string ((obj hud-string)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-string ((this hud-string)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ttext: ~A~%" (-> obj text)) - (format #t "~1Tscale: ~f~%" (-> obj scale)) - (format #t "~1Tcolor: ~D~%" (-> obj color)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ttext: ~A~%" (-> this text)) + (format #t "~1Tscale: ~f~%" (-> this scale)) + (format #t "~1Tcolor: ~D~%" (-> this color)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tpos: #~%" (-> this pos)) (label cfg-4) - obj + this ) ;; definition of type hud-sprite @@ -52,21 +52,21 @@ ) ;; definition for method 3 of type hud-sprite -(defmethod inspect hud-sprite ((obj hud-sprite)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-sprite ((this hud-sprite)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hud-sprite) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tcolor: #~%" (-> obj color2)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tscale-x: ~f~%" (-> obj scale-x)) - (format #t "~1Tscale-y: ~f~%" (-> obj scale-y)) - (format #t "~1Tangle: ~f~%" (-> obj angle)) - (format #t "~1Ttex: ~A~%" (-> obj tex)) + (format #t "[~8x] ~A~%" this 'hud-sprite) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tcolor: #~%" (-> this color2)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tscale-x: ~f~%" (-> this scale-x)) + (format #t "~1Tscale-y: ~f~%" (-> this scale-y)) + (format #t "~1Tangle: ~f~%" (-> this angle)) + (format #t "~1Ttex: ~A~%" (-> this tex)) (label cfg-4) - obj + this ) ;; definition of type hud-box @@ -90,17 +90,17 @@ ) ;; definition for method 3 of type hud-box -(defmethod inspect hud-box ((obj hud-box)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-box ((this hud-box)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hud-box) - (format #t "~1Tmin: #~%" (-> obj min)) - (format #t "~1Tmax: #~%" (-> obj max)) - (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "[~8x] ~A~%" this 'hud-box) + (format #t "~1Tmin: #~%" (-> this min)) + (format #t "~1Tmax: #~%" (-> this max)) + (format #t "~1Tcolor: #~%" (-> this color)) (label cfg-4) - obj + this ) ;; definition of type hud-icon @@ -117,18 +117,18 @@ ) ;; definition for method 3 of type hud-icon -(defmethod inspect hud-icon ((obj hud-icon)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-icon ((this hud-icon)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ticon: #x~X~%" (-> obj icon)) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tscale-x: ~f~%" (-> obj scale-x)) - (format #t "~1Tscale-y: ~f~%" (-> obj scale-y)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ticon: #x~X~%" (-> this icon)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tscale-x: ~f~%" (-> this scale-x)) + (format #t "~1Tscale-y: ~f~%" (-> this scale-y)) (label cfg-4) - obj + this ) ;; definition of type hud-value @@ -145,18 +145,18 @@ ) ;; definition for method 3 of type hud-value -(defmethod inspect hud-value ((obj hud-value)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-value ((this hud-value)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcurrent: ~D~%" (-> obj current)) - (format #t "~1Ttarget: ~D~%" (-> obj target)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tcounter: ~D~%" (-> obj counter)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcurrent: ~D~%" (-> this current)) + (format #t "~1Ttarget: ~D~%" (-> this target)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tcounter: ~D~%" (-> this counter)) (label cfg-4) - obj + this ) ;; definition of type hud @@ -199,25 +199,25 @@ ) ;; definition for method 3 of type hud -(defmethod inspect hud ((obj hud)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud ((this hud)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttrigger-time: ~D~%" (-> obj trigger-time)) - (format #t "~2Tlast-hide-time: ~D~%" (-> obj last-hide-time)) - (format #t "~2Toffset: ~f~%" (-> obj offset)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tvalues[8] @ #x~X~%" (-> obj values)) - (format #t "~2Tstrings[14] @ #x~X~%" (-> obj strings)) - (format #t "~2Tsprites[30] @ #x~X~%" (-> obj sprites)) - (format #t "~2Ticons[2] @ #x~X~%" (-> obj icons)) - (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) + (format #t "~2Ttrigger-time: ~D~%" (-> this trigger-time)) + (format #t "~2Tlast-hide-time: ~D~%" (-> this last-hide-time)) + (format #t "~2Toffset: ~f~%" (-> this offset)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tvalues[8] @ #x~X~%" (-> this values)) + (format #t "~2Tstrings[14] @ #x~X~%" (-> this strings)) + (format #t "~2Tsprites[30] @ #x~X~%" (-> this sprites)) + (format #t "~2Ticons[2] @ #x~X~%" (-> this icons)) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) (label cfg-4) - obj + this ) ;; definition of type hud-ashelin @@ -230,16 +230,16 @@ ) ;; definition for method 3 of type hud-ashelin -(defmethod inspect hud-ashelin ((obj hud-ashelin)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-ashelin ((this hud-ashelin)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-cargo @@ -252,16 +252,16 @@ ) ;; definition for method 3 of type hud-cargo -(defmethod inspect hud-cargo ((obj hud-cargo)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-cargo ((this hud-cargo)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-citizen @@ -274,16 +274,16 @@ ) ;; definition for method 3 of type hud-citizen -(defmethod inspect hud-citizen ((obj hud-citizen)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-citizen ((this hud-citizen)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-cpanel @@ -296,16 +296,16 @@ ) ;; definition for method 3 of type hud-cpanel -(defmethod inspect hud-cpanel ((obj hud-cpanel)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-cpanel ((this hud-cpanel)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-dig-clasp @@ -318,16 +318,16 @@ ) ;; definition for method 3 of type hud-dig-clasp -(defmethod inspect hud-dig-clasp ((obj hud-dig-clasp)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-dig-clasp ((this hud-dig-clasp)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-gun @@ -340,16 +340,16 @@ ) ;; definition for method 3 of type hud-gun -(defmethod inspect hud-gun ((obj hud-gun)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-gun ((this hud-gun)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-health @@ -362,16 +362,16 @@ ) ;; definition for method 3 of type hud-health -(defmethod inspect hud-health ((obj hud-health)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-health ((this hud-health)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-dark-eco-symbol @@ -384,16 +384,16 @@ ) ;; definition for method 3 of type hud-dark-eco-symbol -(defmethod inspect hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-dark-eco-symbol ((this hud-dark-eco-symbol)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-helldog @@ -406,16 +406,16 @@ ) ;; definition for method 3 of type hud-helldog -(defmethod inspect hud-helldog ((obj hud-helldog)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-helldog ((this hud-helldog)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-lurker @@ -428,16 +428,16 @@ ) ;; definition for method 3 of type hud-lurker -(defmethod inspect hud-lurker ((obj hud-lurker)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-lurker ((this hud-lurker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-map @@ -450,16 +450,16 @@ ) ;; definition for method 3 of type hud-map -(defmethod inspect hud-map ((obj hud-map)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-map ((this hud-map)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-moneybag @@ -472,16 +472,16 @@ ) ;; definition for method 3 of type hud-moneybag -(defmethod inspect hud-moneybag ((obj hud-moneybag)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-moneybag ((this hud-moneybag)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-pegasus @@ -494,16 +494,16 @@ ) ;; definition for method 3 of type hud-pegasus -(defmethod inspect hud-pegasus ((obj hud-pegasus)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-pegasus ((this hud-pegasus)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-plasmite @@ -516,16 +516,16 @@ ) ;; definition for method 3 of type hud-plasmite -(defmethod inspect hud-plasmite ((obj hud-plasmite)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-plasmite ((this hud-plasmite)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-dig-button @@ -538,16 +538,16 @@ ) ;; definition for method 3 of type hud-dig-button -(defmethod inspect hud-dig-button ((obj hud-dig-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-dig-button ((this hud-dig-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-predator @@ -560,16 +560,16 @@ ) ;; definition for method 3 of type hud-predator -(defmethod inspect hud-predator ((obj hud-predator)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-predator ((this hud-predator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-heatmeter @@ -582,16 +582,16 @@ ) ;; definition for method 3 of type hud-heatmeter -(defmethod inspect hud-heatmeter ((obj hud-heatmeter)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-heatmeter ((this hud-heatmeter)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-progress @@ -604,16 +604,16 @@ ) ;; definition for method 3 of type hud-progress -(defmethod inspect hud-progress ((obj hud-progress)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-progress ((this hud-progress)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-rocketsensor @@ -626,16 +626,16 @@ ) ;; definition for method 3 of type hud-rocketsensor -(defmethod inspect hud-rocketsensor ((obj hud-rocketsensor)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-rocketsensor ((this hud-rocketsensor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-ruffians @@ -648,16 +648,16 @@ ) ;; definition for method 3 of type hud-ruffians -(defmethod inspect hud-ruffians ((obj hud-ruffians)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-ruffians ((this hud-ruffians)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-score @@ -670,16 +670,16 @@ ) ;; definition for method 3 of type hud-score -(defmethod inspect hud-score ((obj hud-score)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-score ((this hud-score)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-sig @@ -692,16 +692,16 @@ ) ;; definition for method 3 of type hud-sig -(defmethod inspect hud-sig ((obj hud-sig)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-sig ((this hud-sig)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-skill @@ -714,16 +714,16 @@ ) ;; definition for method 3 of type hud-skill -(defmethod inspect hud-skill ((obj hud-skill)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-skill ((this hud-skill)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-skullgem @@ -736,16 +736,16 @@ ) ;; definition for method 3 of type hud-skullgem -(defmethod inspect hud-skullgem ((obj hud-skullgem)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-skullgem ((this hud-skullgem)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-timer @@ -758,16 +758,16 @@ ) ;; definition for method 3 of type hud-timer -(defmethod inspect hud-timer ((obj hud-timer)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-timer ((this hud-timer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-turret @@ -780,16 +780,16 @@ ) ;; definition for method 3 of type hud-turret -(defmethod inspect hud-turret ((obj hud-turret)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-turret ((this hud-turret)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-squid @@ -802,16 +802,16 @@ ) ;; definition for method 3 of type hud-squid -(defmethod inspect hud-squid ((obj hud-squid)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-squid ((this hud-squid)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-gunturret @@ -824,16 +824,16 @@ ) ;; definition for method 3 of type hud-gunturret -(defmethod inspect hud-gunturret ((obj hud-gunturret)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-gunturret ((this hud-gunturret)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-gruntegg @@ -846,16 +846,16 @@ ) ;; definition for method 3 of type hud-gruntegg -(defmethod inspect hud-gruntegg ((obj hud-gruntegg)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-gruntegg ((this hud-gruntegg)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-crimsonhover @@ -868,16 +868,16 @@ ) ;; definition for method 3 of type hud-crimsonhover -(defmethod inspect hud-crimsonhover ((obj hud-crimsonhover)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-crimsonhover ((this hud-crimsonhover)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-metalkor @@ -890,16 +890,16 @@ ) ;; definition for method 3 of type hud-metalkor -(defmethod inspect hud-metalkor ((obj hud-metalkor)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-metalkor ((this hud-metalkor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-big-score @@ -912,16 +912,16 @@ ) ;; definition for method 3 of type hud-big-score -(defmethod inspect hud-big-score ((obj hud-big-score)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-big-score ((this hud-big-score)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-goal @@ -934,16 +934,16 @@ ) ;; definition for method 3 of type hud-goal -(defmethod inspect hud-goal ((obj hud-goal)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-goal ((this hud-goal)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-miss @@ -956,16 +956,16 @@ ) ;; definition for method 3 of type hud-miss -(defmethod inspect hud-miss ((obj hud-miss)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-miss ((this hud-miss)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-race-timer @@ -978,16 +978,16 @@ ) ;; definition for method 3 of type hud-race-timer -(defmethod inspect hud-race-timer ((obj hud-race-timer)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-race-timer ((this hud-race-timer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-race-lap-counter @@ -1000,16 +1000,16 @@ ) ;; definition for method 3 of type hud-race-lap-counter -(defmethod inspect hud-race-lap-counter ((obj hud-race-lap-counter)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-race-lap-counter ((this hud-race-lap-counter)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-race-turbo-counter @@ -1022,16 +1022,16 @@ ) ;; definition for method 3 of type hud-race-turbo-counter -(defmethod inspect hud-race-turbo-counter ((obj hud-race-turbo-counter)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-race-turbo-counter ((this hud-race-turbo-counter)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-race-position @@ -1044,16 +1044,16 @@ ) ;; definition for method 3 of type hud-race-position -(defmethod inspect hud-race-position ((obj hud-race-position)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-race-position ((this hud-race-position)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-race-map @@ -1066,16 +1066,16 @@ ) ;; definition for method 3 of type hud-race-map -(defmethod inspect hud-race-map ((obj hud-race-map)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-race-map ((this hud-race-map)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-samos-old @@ -1088,16 +1088,16 @@ ) ;; definition for method 3 of type hud-samos-old -(defmethod inspect hud-samos-old ((obj hud-samos-old)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-samos-old ((this hud-samos-old)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-samos-young @@ -1110,16 +1110,16 @@ ) ;; definition for method 3 of type hud-samos-young -(defmethod inspect hud-samos-young ((obj hud-samos-young)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-samos-young ((this hud-samos-young)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-lurker-button @@ -1132,16 +1132,16 @@ ) ;; definition for method 3 of type hud-lurker-button -(defmethod inspect hud-lurker-button ((obj hud-lurker-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-lurker-button ((this hud-lurker-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-widow @@ -1154,16 +1154,16 @@ ) ;; definition for method 3 of type hud-widow -(defmethod inspect hud-widow ((obj hud-widow)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-widow ((this hud-widow)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-race-final-stats @@ -1176,16 +1176,16 @@ ) ;; definition for method 3 of type hud-race-final-stats -(defmethod inspect hud-race-final-stats ((obj hud-race-final-stats)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-race-final-stats ((this hud-race-final-stats)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-mech-air-tank @@ -1198,16 +1198,16 @@ ) ;; definition for method 3 of type hud-mech-air-tank -(defmethod inspect hud-mech-air-tank ((obj hud-mech-air-tank)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-mech-air-tank ((this hud-mech-air-tank)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-homing-beacon @@ -1220,16 +1220,16 @@ ) ;; definition for method 3 of type hud-homing-beacon -(defmethod inspect hud-homing-beacon ((obj hud-homing-beacon)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-homing-beacon ((this hud-homing-beacon)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-dark-eco-pickup @@ -1242,16 +1242,16 @@ ) ;; definition for method 3 of type hud-dark-eco-pickup -(defmethod inspect hud-dark-eco-pickup ((obj hud-dark-eco-pickup)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-dark-eco-pickup ((this hud-dark-eco-pickup)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type hud-green-eco-pickup @@ -1264,16 +1264,16 @@ ) ;; definition for method 3 of type hud-green-eco-pickup -(defmethod inspect hud-green-eco-pickup ((obj hud-green-eco-pickup)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-green-eco-pickup ((this hud-green-eco-pickup)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc index 0e947d4978..c0362a953e 100644 --- a/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc @@ -18,15 +18,15 @@ ) ;; definition for method 3 of type minimap-class-node -(defmethod inspect minimap-class-node ((obj minimap-class-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect minimap-class-node ((this minimap-class-node)) + (when (not this) + (set! this this) (goto cfg-179) ) - (format #t "[~8x] ~A~%" obj 'minimap-class-node) - (format #t "~1Tdefault-position: ~`vector`P~%" (-> obj default-position)) - (format #t "~1Tflags: #x~X : (minimap-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'minimap-class-node) + (format #t "~1Tdefault-position: ~`vector`P~%" (-> this default-position)) + (format #t "~1Tflags: #x~X : (minimap-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (minimap-flag active)) (minimap-flag active)) (format #t "active ") ) @@ -80,8 +80,8 @@ (let ((t9-20 format) (a0-37 #t) (a1-20 "~1Tclass: #x~X : ~S~%") - (a2-3 (-> obj class)) - (v1-50 (-> obj class)) + (a2-3 (-> this class)) + (v1-50 (-> this class)) ) (t9-20 a0-37 a1-20 a2-3 (cond ((= v1-50 (minimap-class onintent)) @@ -303,12 +303,12 @@ ) ) ) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Ticon-xy: #~%" (-> obj icon-xy)) - (format #t "~1Tscale: ~f~%" (-> obj scale)) - (format #t "~1Tcolor: #x~X~%" (-> obj color)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Ticon-xy: #~%" (-> this icon-xy)) + (format #t "~1Tscale: ~f~%" (-> this scale)) + (format #t "~1Tcolor: #x~X~%" (-> this color)) (label cfg-179) - obj + this ) ;; definition of type connection-minimap @@ -330,38 +330,38 @@ ;; definition for method 3 of type connection-minimap ;; INFO: Used lq/sq -(defmethod inspect connection-minimap ((obj connection-minimap)) - (when (not obj) - (set! obj obj) +(defmethod inspect connection-minimap ((this connection-minimap)) + (when (not this) + (set! this this) (goto cfg-48) ) - (format #t "[~8x] ~A~%" obj 'connection-minimap) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tkey: ~A~%" (-> obj key)) - (format #t "~1Tupdate-time: ~D~%" (-> obj handle)) - (format #t "~1Tparam[4] @ #x~X~%" (-> obj param)) + (format #t "[~8x] ~A~%" this 'connection-minimap) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tkey: ~A~%" (-> this key)) + (format #t "~1Tupdate-time: ~D~%" (-> this handle)) + (format #t "~1Tparam[4] @ #x~X~%" (-> this param)) (dotimes (s5-0 4) - (format #t "~T [~D]~1Tparam: ~A~%" s5-0 (-> obj param s5-0)) + (format #t "~T [~D]~1Tparam: ~A~%" s5-0 (-> this param s5-0)) ) - (format #t "~1Tparam-int32[4] @ #x~X~%" (-> obj param)) + (format #t "~1Tparam-int32[4] @ #x~X~%" (-> this param)) (dotimes (s5-1 4) - (format #t "~T [~D]~1Tparam-int32: ~D~%" s5-1 (-> obj param s5-1)) + (format #t "~T [~D]~1Tparam-int32: ~D~%" s5-1 (-> this param s5-1)) ) - (format #t "~1Tparam-int64[2] @ #x~X~%" (-> obj param)) + (format #t "~1Tparam-int64[2] @ #x~X~%" (-> this param)) (dotimes (s5-2 2) - (format #t "~T [~D]~1Tparam-int64: ~D~%" s5-2 (-> obj param-int64 s5-2)) + (format #t "~T [~D]~1Tparam-int64: ~D~%" s5-2 (-> this param-int64 s5-2)) ) - (format #t "~1Tparam-float[4] @ #x~X~%" (-> obj param)) + (format #t "~1Tparam-float[4] @ #x~X~%" (-> this param)) (dotimes (s5-3 4) - (format #t "~T [~D]~1Tparam-float: ~f~%" s5-3 (the-as float (-> obj param s5-3))) + (format #t "~T [~D]~1Tparam-float: ~f~%" s5-3 (the-as float (-> this param s5-3))) ) - (format #t "~1Tparam-quat: #x~X~%" (-> obj param-quat)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Talpha: ~f~%" (-> obj alpha)) - (format #t "~1Tclass: #~%" (-> obj class)) - (format #t "~1Tflags: #x~X : (minimap-flag " (-> obj flags)) - (let ((s5-4 (-> obj flags))) + (format #t "~1Tparam-quat: #x~X~%" (-> this param-quat)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Talpha: ~f~%" (-> this alpha)) + (format #t "~1Tclass: #~%" (-> this class)) + (format #t "~1Tflags: #x~X : (minimap-flag " (-> this flags)) + (let ((s5-4 (-> this flags))) (if (= (logand s5-4 (minimap-flag active)) (minimap-flag active)) (format #t "active ") ) @@ -412,12 +412,12 @@ ) ) (format #t ")~%") - (format #t "~1Tnode: ~D~%" (-> obj node)) - (format #t "~1Tedge-ry: ~f~%" (-> obj edge-ry)) - (format #t "~1Tlast-world-pos: ~`vector`P~%" (-> obj last-world-pos)) - (format #t "~1Tlast-relative-pos: ~`vector`P~%" (-> obj last-relative-pos)) + (format #t "~1Tnode: ~D~%" (-> this node)) + (format #t "~1Tedge-ry: ~f~%" (-> this edge-ry)) + (format #t "~1Tlast-world-pos: ~`vector`P~%" (-> this last-world-pos)) + (format #t "~1Tlast-relative-pos: ~`vector`P~%" (-> this last-relative-pos)) (label cfg-48) - obj + this ) ;; definition of type engine-minimap @@ -431,23 +431,22 @@ ) ;; definition for method 3 of type engine-minimap -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect engine-minimap ((obj engine-minimap)) - (when (not obj) - (set! obj obj) +(defmethod inspect engine-minimap ((this engine-minimap)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Telement-type: ~A~%" (-> obj element-type)) - (format #t "~1Texecute-time: ~D~%" (-> obj execute-time)) - (format #t "~1Talive-list: #~%" (-> obj alive-list)) - (format #t "~1Tdead-list: #~%" (-> obj dead-list)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Telement-type: ~A~%" (-> this element-type)) + (format #t "~1Texecute-time: ~D~%" (-> this execute-time)) + (format #t "~1Talive-list: #~%" (-> this alive-list)) + (format #t "~1Tdead-list: #~%" (-> this dead-list)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type minimap-trail @@ -471,22 +470,22 @@ ) ;; definition for method 3 of type minimap-trail -(defmethod inspect minimap-trail ((obj minimap-trail)) - (when (not obj) - (set! obj obj) +(defmethod inspect minimap-trail ((this minimap-trail)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'minimap-trail) - (format #t "~1Tused-by: ~`connection-minimap`P~%" (-> obj used-by)) - (format #t "~1Tsearch-id: ~D~%" (-> obj search-id)) - (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) - (format #t "~1Tgoal-node-id: ~D~%" (-> obj goal-node-id)) - (format #t "~1Tnode-path-dist: ~f~%" (-> obj node-path-dist)) - (format #t "~1Tlast-updated: ~D~%" (-> obj last-updated)) - (format #t "~1Tcached-info: #~%" (-> obj cached-info)) - (format #t "~1Tnode-id[64] @ #x~X~%" (-> obj node-id)) + (format #t "[~8x] ~A~%" this 'minimap-trail) + (format #t "~1Tused-by: ~`connection-minimap`P~%" (-> this used-by)) + (format #t "~1Tsearch-id: ~D~%" (-> this search-id)) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tgoal-node-id: ~D~%" (-> this goal-node-id)) + (format #t "~1Tnode-path-dist: ~f~%" (-> this node-path-dist)) + (format #t "~1Tlast-updated: ~D~%" (-> this last-updated)) + (format #t "~1Tcached-info: #~%" (-> this cached-info)) + (format #t "~1Tnode-id[64] @ #x~X~%" (-> this node-id)) (label cfg-4) - obj + this ) ;; definition of type minimap-draw-work @@ -503,19 +502,19 @@ ) ;; definition for method 3 of type minimap-draw-work -(defmethod inspect minimap-draw-work ((obj minimap-draw-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect minimap-draw-work ((this minimap-draw-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'minimap-draw-work) - (format #t "~1Tbuf: ~A~%" (-> obj buf)) - (format #t "~1Tjustify-right: ~A~%" (-> obj justify-right)) - (format #t "~1Tdraw-pos: #~%" (-> obj draw-pos)) - (format #t "~1Tmat: #~%" (-> obj mat)) - (format #t "~1Tcorner[4] @ #x~X~%" (-> obj corner)) + (format #t "[~8x] ~A~%" this 'minimap-draw-work) + (format #t "~1Tbuf: ~A~%" (-> this buf)) + (format #t "~1Tjustify-right: ~A~%" (-> this justify-right)) + (format #t "~1Tdraw-pos: #~%" (-> this draw-pos)) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Tcorner[4] @ #x~X~%" (-> this corner)) (label cfg-4) - obj + this ) ;; definition of type minimap @@ -575,41 +574,41 @@ ) ;; definition for method 3 of type minimap -(defmethod inspect minimap ((obj minimap)) - (when (not obj) - (set! obj obj) +(defmethod inspect minimap ((this minimap)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'minimap) - (format #t "~1Tdraw-tmpl: #~%" (-> obj draw-tmpl)) - (format #t "~1Tdraw2-tmpl: #~%" (-> obj draw2-tmpl)) - (format #t "~1Tdraw3-tmpl: #~%" (-> obj draw3-tmpl)) - (format #t "~1Tdraw4-tmpl: #~%" (-> obj draw4-tmpl)) - (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) - (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) - (format #t "~1Tcolor: #~%" (-> obj color)) - (format #t "~1Toffset: #~%" (-> obj offset)) - (format #t "~1Tminimap-corner: #~%" (-> obj minimap-corner)) - (format #t "~1Tlast-name: ~A~%" (-> obj last-name)) - (format #t "~1Tlast-tex: ~A~%" (-> obj last-tex)) - (format #t "~1Ttarget-inv-scale: ~f~%" (-> obj target-inv-scale)) - (format #t "~1Tmap-bits: ~D~%" (-> obj map-bits)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tctywide: ~A~%" (-> obj ctywide)) - (format #t "~1Tinv-scale: ~f~%" (-> obj offset y)) - (format #t "~1Tfade: ~f~%" (-> obj offset w)) - (format #t "~1Tengine: ~A~%" (-> obj engine)) - (format #t "~1Tengine-key: ~D~%" (-> obj engine-key)) - (format #t "~1Ttrail[6] @ #x~X~%" (-> obj trail)) - (format #t "~1Trace-tex: ~A~%" (-> obj race-tex)) - (format #t "~1Trace-scale: ~f~%" (-> obj race-scale)) - (format #t "~1Trace-level: ~A~%" (-> obj race-level)) - (format #t "~1Tsprite2-tmpl: #~%" (-> obj sprite2-tmpl)) - (format #t "~1Trace-corner: #~%" (-> obj race-corner)) - (format #t "~1Tgoal-time: ~f~%" (-> obj goal-time)) - (format #t "~1Tfrustum-alpha: ~f~%" (-> obj frustum-alpha)) + (format #t "[~8x] ~A~%" this 'minimap) + (format #t "~1Tdraw-tmpl: #~%" (-> this draw-tmpl)) + (format #t "~1Tdraw2-tmpl: #~%" (-> this draw2-tmpl)) + (format #t "~1Tdraw3-tmpl: #~%" (-> this draw3-tmpl)) + (format #t "~1Tdraw4-tmpl: #~%" (-> this draw4-tmpl)) + (format #t "~1Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~1Tadgif-tmpl: #~%" (-> this adgif-tmpl)) + (format #t "~1Tcolor: #~%" (-> this color)) + (format #t "~1Toffset: #~%" (-> this offset)) + (format #t "~1Tminimap-corner: #~%" (-> this minimap-corner)) + (format #t "~1Tlast-name: ~A~%" (-> this last-name)) + (format #t "~1Tlast-tex: ~A~%" (-> this last-tex)) + (format #t "~1Ttarget-inv-scale: ~f~%" (-> this target-inv-scale)) + (format #t "~1Tmap-bits: ~D~%" (-> this map-bits)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tctywide: ~A~%" (-> this ctywide)) + (format #t "~1Tinv-scale: ~f~%" (-> this offset y)) + (format #t "~1Tfade: ~f~%" (-> this offset w)) + (format #t "~1Tengine: ~A~%" (-> this engine)) + (format #t "~1Tengine-key: ~D~%" (-> this engine-key)) + (format #t "~1Ttrail[6] @ #x~X~%" (-> this trail)) + (format #t "~1Trace-tex: ~A~%" (-> this race-tex)) + (format #t "~1Trace-scale: ~f~%" (-> this race-scale)) + (format #t "~1Trace-level: ~A~%" (-> this race-level)) + (format #t "~1Tsprite2-tmpl: #~%" (-> this sprite2-tmpl)) + (format #t "~1Trace-corner: #~%" (-> this race-corner)) + (format #t "~1Tgoal-time: ~f~%" (-> this goal-time)) + (format #t "~1Tfrustum-alpha: ~f~%" (-> this frustum-alpha)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc index 36dc4f6d15..c2aee3251e 100644 --- a/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/minimap_REF.gc @@ -11,15 +11,15 @@ ) ;; definition for method 3 of type minimap-texture-name-array -(defmethod inspect minimap-texture-name-array ((obj minimap-texture-name-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect minimap-texture-name-array ((this minimap-texture-name-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'minimap-texture-name-array) - (format #t "~1Tdata[35] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'minimap-texture-name-array) + (format #t "~1Tdata[35] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type minimap-corner-array @@ -32,15 +32,15 @@ ) ;; definition for method 3 of type minimap-corner-array -(defmethod inspect minimap-corner-array ((obj minimap-corner-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect minimap-corner-array ((this minimap-corner-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'minimap-corner-array) - (format #t "~1Tdata[35] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'minimap-corner-array) + (format #t "~1Tdata[35] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for symbol *minimap-texture-name-array*, type minimap-texture-name-array @@ -862,13 +862,13 @@ ;; definition for method 9 of type minimap ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw minimap ((obj minimap)) +(defmethod debug-draw minimap ((this minimap)) (when *trail-graph* (dotimes (s5-0 6) - (let ((s4-0 (-> obj trail s5-0))) + (let ((s4-0 (-> this trail s5-0))) (when (and (-> s4-0 used-by) (>= (-> s4-0 node-count) 0) - (< (- (current-time) (the-as int (-> s4-0 last-updated))) (seconds 5)) + (not (time-elapsed? (the-as int (-> s4-0 last-updated)) (seconds 5))) ) (let* ((a3-0 (target-pos 0)) (v1-12 s5-0) @@ -912,7 +912,7 @@ ;; definition for method 14 of type minimap ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod update-trails minimap ((obj minimap)) +(defmethod update-trails minimap ((this minimap)) "Main function to do trail search per-frame" (let ((s5-0 *trail-graph*)) (when s5-0 @@ -928,7 +928,7 @@ (let ((v1-5 -1)) (let ((a0-5 0)) (countdown (a1-1 6) - (let* ((a2-3 (-> obj trail a1-1)) + (let* ((a2-3 (-> this trail a1-1)) (a3-0 (-> a2-3 used-by)) ) (when (and a3-0 (and (< 0.0 (-> a3-0 alpha)) (or (< v1-5 0) (< (the-as int (-> a2-3 last-updated)) a0-5)))) @@ -943,7 +943,7 @@ ) ) ) - (let ((s4-0 (-> obj trail v1-5)) + (let ((s4-0 (-> this trail v1-5)) (s3-0 (the-as object #f)) ) (let* ((v1-9 (-> s4-0 used-by)) @@ -996,7 +996,7 @@ ) ((or (= v1-2 3) (= v1-2 2)) (countdown (v1-33 6) - (let ((s4-1 (-> obj trail v1-33))) + (let ((s4-1 (-> this trail v1-33))) (when (and (= (-> s4-1 search-id) (-> s5-0 search-id)) (-> s4-1 used-by)) (set! (-> s4-1 node-count) (get-path-to-root s5-0 (-> s4-1 node-id) 64 (&-> s4-1 goal-node-id) (&-> s4-1 node-path-dist)) @@ -1023,11 +1023,11 @@ ) ;; definition for method 10 of type minimap -(defmethod get-trail-for-connection minimap ((obj minimap) (arg0 connection-minimap) (arg1 symbol)) +(defmethod get-trail-for-connection minimap ((this minimap) (arg0 connection-minimap) (arg1 symbol)) "Get a trail for connection. If arg1 is set, allow allocating a new one." (local-vars (gp-0 minimap-trail)) (countdown (v1-0 6) - (let ((a3-3 (-> obj trail v1-0))) + (let ((a3-3 (-> this trail v1-0))) (when (= (-> a3-3 used-by) arg0) (set! gp-0 a3-3) (goto cfg-14) @@ -1036,7 +1036,7 @@ ) (when arg1 (dotimes (v1-4 6) - (let ((a3-7 (-> obj trail v1-4))) + (let ((a3-7 (-> this trail v1-4))) (when (not (-> a3-7 used-by)) (set! (-> a3-7 used-by) arg0) (set! gp-0 a3-7) @@ -1056,10 +1056,10 @@ ;; definition for method 13 of type minimap ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 13 minimap) has a return type of none, but the expression builder found a return statement. -(defmethod free-trail-by-connection minimap ((obj minimap) (arg0 connection-minimap)) +(defmethod free-trail-by-connection minimap ((this minimap) (arg0 connection-minimap)) "Free the trail associated with this connection." (countdown (v1-0 6) - (let ((a2-3 (-> obj trail v1-0))) + (let ((a2-3 (-> this trail v1-0))) (when (= (-> a2-3 used-by) arg0) (set! (-> a2-3 used-by) #f) (reset a2-3) @@ -1073,17 +1073,17 @@ ;; definition for method 10 of type minimap-trail ;; WARN: Return type mismatch int vs none. -(defmethod reset minimap-trail ((obj minimap-trail)) - (set! (-> obj node-count) -1) - (set! (-> obj search-id) (the-as uint 0)) - (set! (-> obj last-updated) (the-as uint 0)) - (set! (-> obj cached-info goal-conn-id) -1) +(defmethod reset minimap-trail ((this minimap-trail)) + (set! (-> this node-count) -1) + (set! (-> this search-id) (the-as uint 0)) + (set! (-> this last-updated) (the-as uint 0)) + (set! (-> this cached-info goal-conn-id) -1) (none) ) ;; definition for method 11 of type minimap ;; INFO: Used lq/sq -(defmethod get-icon-draw-pos minimap ((obj minimap) (arg0 connection-minimap) (arg1 minimap-trail) (arg2 vector) (arg3 float) (arg4 vector)) +(defmethod get-icon-draw-pos minimap ((this minimap) (arg0 connection-minimap) (arg1 minimap-trail) (arg2 vector) (arg3 float) (arg4 vector)) "Follow the path from the start until it reaches the border of the map, then get this position." (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 4))) (vector-reset! (-> s5-0 2)) @@ -1126,18 +1126,18 @@ ) ;; definition for method 9 of type minimap-trail -(defmethod get-distance-with-path minimap-trail ((obj minimap-trail) (arg0 vector) (arg1 vector)) +(defmethod get-distance-with-path minimap-trail ((this minimap-trail) (arg0 vector) (arg1 vector)) "Assuming we go from a to b, using this path in the middle, how long is it?" 0.0 (let ((s4-0 *trail-graph*)) (cond - ((and s4-0 (> (-> obj node-count) 0)) - (let ((f30-0 (-> obj node-path-dist)) + ((and s4-0 (> (-> this node-count) 0)) + (let ((f30-0 (-> this node-path-dist)) (s2-0 (new 'stack-no-clear 'vector)) ) - (get-node-location-by-id s4-0 (-> obj node-id 0) s2-0) + (get-node-location-by-id s4-0 (-> this node-id 0) s2-0) (let ((f30-1 (+ f30-0 (vector-vector-xz-distance arg0 s2-0)))) - (get-node-location-by-id s4-0 (the-as uint (-> obj goal-node-id)) s2-0) + (get-node-location-by-id s4-0 (the-as uint (-> this goal-node-id)) s2-0) (+ f30-1 (vector-vector-xz-distance arg1 s2-0)) ) ) @@ -1150,21 +1150,21 @@ ) ;; definition for method 2 of type connection-minimap -(defmethod print connection-minimap ((obj connection-minimap)) +(defmethod print connection-minimap ((this connection-minimap)) (format #t "#" - (-> obj class name) - (-> obj flags) - (handle->process (-> obj handle)) - obj + (-> this class name) + (-> this flags) + (handle->process (-> this handle)) + this ) - obj + this ) ;; definition for method 3 of type engine-minimap -(defmethod inspect engine-minimap ((obj engine-minimap)) - ((the-as (function engine-minimap engine-minimap) (find-parent-method engine-minimap 3)) obj) +(defmethod inspect engine-minimap ((this engine-minimap)) + ((the-as (function engine-minimap engine-minimap) (find-parent-method engine-minimap 3)) this) (let ((s5-0 0) (s4-0 (the-as connection-pers (-> *minimap* engine alive-list))) ) @@ -1176,14 +1176,14 @@ (set! s4-0 (-> s4-0 next)) ) ) - obj + this ) ;; definition for method 14 of type engine-minimap ;; WARN: Return type mismatch int vs none. -(defmethod run-pending-updates! engine-minimap ((obj engine-minimap) (arg0 time-frame)) - (let ((s2-0 (the-as (pointer connection-pers) (&-> obj alive-list))) - (s3-0 (-> obj alive-list)) +(defmethod run-pending-updates! engine-minimap ((this engine-minimap) (arg0 time-frame)) + (let ((s2-0 (the-as (pointer connection-pers) (&-> this alive-list))) + (s3-0 (-> this alive-list)) ) (while s3-0 (let ((s4-0 (-> s3-0 next))) @@ -1203,7 +1203,7 @@ (let ((f30-0 1.0)) (when (logtest? (-> s3-0 class flags) (minimap-flag trail)) (let ((v1-26 (get-trail-for-connection *minimap* s3-0 #f))) - (if (or (not v1-26) (>= (- (current-time) (the-as int (-> v1-26 last-updated))) (seconds 5))) + (if (or (not v1-26) (time-elapsed? (the-as int (-> v1-26 last-updated)) (seconds 5))) (set! f30-0 0.0001) ) ) @@ -1218,11 +1218,11 @@ ) (cond ((and (logtest? (-> s3-0 flags) (minimap-flag fade-out)) (= (-> s3-0 alpha) 0.0)) - (kill-callback obj s3-0) + (kill-callback this s3-0) (set! (-> s2-0 0) (-> s3-0 next)) - (set! (-> s3-0 next) (-> obj dead-list)) - (set! (-> obj dead-list) s3-0) - (+! (-> obj length) -1) + (set! (-> s3-0 next) (-> this dead-list)) + (set! (-> this dead-list) s3-0) + (+! (-> this length) -1) ) ((and (handle->process (-> s3-0 handle)) (not (and (= (logand (the-as int (-> s3-0 position)) 7) 4) @@ -1233,12 +1233,12 @@ ) ) ) - (update-callback obj) + (update-callback this) (set! s2-0 (&-> s3-0 next)) ) (else (logior! (-> s3-0 flags) (minimap-flag fade-out)) - (update-callback obj) + (update-callback this) (set! s2-0 (&-> s3-0 next)) ) ) @@ -1246,14 +1246,14 @@ ) ) ) - (set! (-> obj execute-time) arg0) + (set! (-> this execute-time) arg0) 0 (none) ) ;; definition for method 12 of type minimap ;; INFO: Used lq/sq -(defmethod add-icon! minimap ((obj minimap) (arg0 process) (arg1 uint) (arg2 int) (arg3 vector) (arg4 int)) +(defmethod add-icon! minimap ((this minimap) (arg0 process) (arg1 uint) (arg2 int) (arg3 vector) (arg4 int)) "Add an icon to the map!" (when (not arg2) (let ((v1-3 (+ (-> *minimap* engine-key) 1))) @@ -1261,7 +1261,7 @@ (set! arg2 (the-as int v1-3)) ) ) - (let ((s3-0 (the-as connection-minimap (schedule-callback (-> obj engine) arg2 0)))) + (let ((s3-0 (the-as connection-minimap (schedule-callback (-> this engine) arg2 0)))) (let ((s2-1 (-> *minimap-class-list* arg1))) (when s3-0 (when (not (logtest? (-> s3-0 flags) (minimap-flag active))) @@ -1292,7 +1292,7 @@ ;; definition for method 10 of type engine-minimap ;; WARN: Function (method 10 engine-minimap) has a return type of none, but the expression builder found a return statement. -(defmethod kill-callback engine-minimap ((obj engine-minimap) (arg0 connection-pers)) +(defmethod kill-callback engine-minimap ((this engine-minimap) (arg0 connection-pers)) (if (not arg0) (return #f) ) @@ -1300,7 +1300,7 @@ (free-trail-by-connection *minimap* (the-as connection-minimap arg0)) ) (set! (-> arg0 update-time) (the-as time-frame #f)) - ((method-of-type engine-pers kill-callback) obj arg0) + ((method-of-type engine-pers kill-callback) this arg0) (none) ) @@ -1333,29 +1333,29 @@ ;; definition for method 20 of type minimap ;; INFO: Used lq/sq -(defmethod update! minimap ((obj minimap)) - (set! (-> obj ctywide) (level-get *level* 'ctywide)) - (set! (-> obj map-bits) (the-as uint 0)) +(defmethod update! minimap ((this minimap)) + (set! (-> this ctywide) (level-get *level* 'ctywide)) + (set! (-> this map-bits) (the-as uint 0)) (dotimes (v1-2 (-> *level* length)) (let ((a0-5 (-> *level* level v1-2))) (if (= (-> a0-5 status) 'active) - (logior! (-> obj map-bits) (-> a0-5 info city-map-bits)) + (logior! (-> this map-bits) (-> a0-5 info city-map-bits)) ) ) ) (let ((s5-0 (the int (* 0.0000006357829 (+ 3145728.0 (-> (target-pos 0) x))))) (v1-9 (the int (* 0.0000006357829 (+ 3145728.0 (-> (target-pos 0) z))))) ) - (when (and (< s5-0 5) (< v1-9 7) (logtest? (-> obj map-bits) (ash 1 (+ (* 5 v1-9) s5-0)))) + (when (and (< s5-0 5) (< v1-9 7) (logtest? (-> this map-bits) (ash 1 (+ (* 5 v1-9) s5-0)))) (let ((a0-19 (-> *minimap-texture-name-array* data (+ (* 5 v1-9) s5-0)))) (when a0-19 - (set! (-> obj last-name) a0-19) - (set! (-> obj minimap-corner quad) (-> *minimap-corner-array* data (+ (* 5 v1-9) s5-0) quad)) + (set! (-> this last-name) a0-19) + (set! (-> this minimap-corner quad) (-> *minimap-corner-array* data (+ (* 5 v1-9) s5-0) quad)) (dotimes (a0-21 (-> *level* length)) (let ((a1-23 (-> *level* level a0-21))) (when (= (-> a1-23 status) 'active) (if (logtest? (-> a1-23 info city-map-bits) (ash 1 (+ (* 5 v1-9) s5-0))) - (set! (-> obj level) a1-23) + (set! (-> this level) a1-23) ) ) ) @@ -1364,23 +1364,23 @@ ) ) ) - (set! (-> obj last-tex) - (lookup-minimap-texture-by-name (-> obj last-name) (the-as string #f) (the-as (pointer texture-page) #f)) + (set! (-> this last-tex) + (lookup-minimap-texture-by-name (-> this last-name) (the-as string #f) (the-as (pointer texture-page) #f)) ) (let ((f30-2 (seconds-per-frame))) - (let ((v1-12 (-> obj last-tex))) + (let ((v1-12 (-> this last-tex))) (cond - ((or (not (-> obj level)) (zero? (-> obj level)) (!= (-> obj level status) 'active) (not v1-12)) - (set! (-> obj offset w) 0.0) + ((or (not (-> this level)) (zero? (-> this level)) (!= (-> this level status) 'active) (not v1-12)) + (set! (-> this offset w) 0.0) ) ((not (logtest? (-> *setting-control* user-current minimap) 128)) - (seek! (-> obj offset w) 0.0 f30-2) + (seek! (-> this offset w) 0.0 f30-2) ) - ((and *target* (nonzero? (-> obj map-bits))) - (set! (-> obj offset w) (fmin 0.5 (+ (-> obj offset w) f30-2))) + ((and *target* (nonzero? (-> this map-bits))) + (set! (-> this offset w) (fmin 0.5 (+ (-> this offset w) f30-2))) ) (else - (set! (-> obj offset w) 0.0) + (set! (-> this offset w) 0.0) ) ) ) @@ -1391,22 +1391,22 @@ (f2-0 122880.0) (v1-33 (-> *target* control transv)) ) - (set! (-> obj target-inv-scale) + (set! (-> this target-inv-scale) (fmax f0-14 (* f1-2 (fmin f2-0 (sqrtf (+ (* (-> v1-33 x) (-> v1-33 x)) (* (-> v1-33 z) (-> v1-33 z))))))) ) ) ) (else - (set! (-> obj target-inv-scale) 0.5) + (set! (-> this target-inv-scale) 0.5) ) ) - (seek! (-> obj offset y) (-> obj target-inv-scale) (* 0.5 f30-2)) + (seek! (-> this offset y) (-> this target-inv-scale) (* 0.5 f30-2)) ) - (run-pending-updates! (-> obj engine) (-> *display* base-clock frame-counter)) - (when (and (-> obj ctywide) (and (= (-> obj ctywide status) 'active) (!= (-> obj offset w) 0.0))) - (update-trails obj) + (run-pending-updates! (-> this engine) (-> *display* base-clock frame-counter)) + (when (and (-> this ctywide) (and (= (-> this ctywide status) 'active) (!= (-> this offset w) 0.0))) + (update-trails this) (if *display-trail-graph* - (debug-draw obj) + (debug-draw this) ) #t ) @@ -1415,7 +1415,7 @@ ;; definition for method 23 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-racer-2 minimap ((obj minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-racer-2 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1448,8 +1448,8 @@ (set! (-> sv-220 vector 0 y) 0.0) (set! (-> sv-220 vector 0 w) 0.0) (vector-! sv-212 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) - (let ((f0-4 (/ (-> sv-212 x) (* 16384.0 (-> obj offset y)))) - (f1-3 (/ (-> sv-212 z) (* 16384.0 (-> obj offset y)))) + (let ((f0-4 (/ (-> sv-212 x) (* 16384.0 (-> this offset y)))) + (f1-3 (/ (-> sv-212 z) (* 16384.0 (-> this offset y)))) ) (set-vector! (-> sv-224 vector 0) (-> sv-216 z) 0.0 (- (-> sv-216 x)) 0.0) (set-vector! (-> sv-224 vector 1) 0.0 1.0 0.0 0.0) @@ -1472,20 +1472,20 @@ (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-228) (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-228) (let* ((a0-38 (-> arg1 class color)) - (a0-45 (copy-and-set-field a0-38 r (shr (* (-> a0-38 r) (the-as uint (-> obj color x))) 7))) - (a0-52 (copy-and-set-field a0-45 g (shr (* (-> a0-45 g) (the-as uint (-> obj color y))) 7))) + (a0-45 (copy-and-set-field a0-38 r (shr (* (-> a0-38 r) (the-as uint (-> this color x))) 7))) + (a0-52 (copy-and-set-field a0-45 g (shr (* (-> a0-45 g) (the-as uint (-> this color y))) 7))) (v1-57 (copy-and-set-field - (copy-and-set-field a0-52 b (shr (* (-> a0-52 b) (the-as uint (-> obj color z))) 7)) + (copy-and-set-field a0-52 b (shr (* (-> a0-52 b) (the-as uint (-> this color z))) 7)) a (the int (* 128.0 (-> arg1 alpha))) ) ) ) - (let ((a0-64 (-> obj draw4-tmpl dma-vif quad))) + (let ((a0-64 (-> this draw4-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-208)) a0-64) ) - (let ((a0-65 (-> obj draw4-tmpl quad 1))) + (let ((a0-65 (-> this draw4-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-208) 1) a0-65) ) (set-vector! @@ -1542,7 +1542,7 @@ ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-racer-1 minimap ((obj minimap) (arg0 minimap-draw-work) (arg1 connection-minimap) (arg2 float) (arg3 float) (arg4 float)) +(defmethod draw-racer-1 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap) (arg2 float) (arg3 float) (arg4 float)) (local-vars (sv-16 process) (sv-20 float) @@ -1569,7 +1569,7 @@ (vector-xz-normalize! sv-136 -1.0) (set! (-> sv-136 y) 0.0) (set! (-> sv-136 w) 0.0) - (vector-! sv-132 (-> (the-as process-drawable sv-16) root trans) (-> obj race-corner)) + (vector-! sv-132 (-> (the-as process-drawable sv-16) root trans) (-> this race-corner)) (cond ((-> *blit-displays-work* horizontal-flip-flag) (let ((f0-4 (+ arg3 (* (- 128.0 (/ (-> sv-132 x) arg2)) sv-20))) @@ -1603,20 +1603,20 @@ (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) sv-140) (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) sv-140) (let* ((a0-32 (-> arg1 class color)) - (a0-39 (copy-and-set-field a0-32 r (shr (* (-> a0-32 r) (the-as uint (-> obj color x))) 7))) - (a0-46 (copy-and-set-field a0-39 g (shr (* (-> a0-39 g) (the-as uint (-> obj color y))) 7))) + (a0-39 (copy-and-set-field a0-32 r (shr (* (-> a0-32 r) (the-as uint (-> this color x))) 7))) + (a0-46 (copy-and-set-field a0-39 g (shr (* (-> a0-39 g) (the-as uint (-> this color y))) 7))) (v1-59 (copy-and-set-field - (copy-and-set-field a0-46 b (shr (* (-> a0-46 b) (the-as uint (-> obj color z))) 7)) + (copy-and-set-field a0-46 b (shr (* (-> a0-46 b) (the-as uint (-> this color z))) 7)) a (the int (* 128.0 (-> arg1 alpha))) ) ) ) - (let ((a0-58 (-> obj draw4-tmpl dma-vif quad))) + (let ((a0-58 (-> this draw4-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-128)) a0-58) ) - (let ((a0-59 (-> obj draw4-tmpl quad 1))) + (let ((a0-59 (-> this draw4-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-128) 1) a0-59) ) (set-vector! @@ -1667,7 +1667,7 @@ ;; definition for method 17 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-frustum-1 minimap ((obj minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-frustum-1 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1709,8 +1709,8 @@ (set! (-> sv-224 vector 0 y) 0.0) (set! (-> sv-224 vector 0 w) 0.0) (vector-! sv-216 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) - (let ((f0-4 (/ (-> sv-216 x) (* 16384.0 (-> obj offset y)))) - (f1-3 (/ (-> sv-216 z) (* 16384.0 (-> obj offset y)))) + (let ((f0-4 (/ (-> sv-216 x) (* 16384.0 (-> this offset y)))) + (f1-3 (/ (-> sv-216 z) (* 16384.0 (-> this offset y)))) ) (set-vector! (-> sv-228 vector 0) (-> sv-220 z) 0.0 (- (-> sv-220 x)) 0.0) (set-vector! (-> sv-228 vector 1) 0.0 1.0 0.0 0.0) @@ -1722,7 +1722,7 @@ (set-vector! (-> sv-232 trans) f0-4 0.0 f1-3 1.0) ) (matrix*! sv-232 sv-232 sv-228) - (let ((f0-8 (/ -10.0 (-> obj offset y)))) + (let ((f0-8 (/ -10.0 (-> this offset y)))) (set-vector! (-> arg0 corner 0) 0.0 0.0 0.0 1.0) (set-vector! (-> arg0 corner 1) (- f0-8) 0.0 f0-8 1.0) (set-vector! (-> arg0 corner 2) f0-8 0.0 f0-8 1.0) @@ -1749,27 +1749,27 @@ (.svf (&-> v1-49 quad) vf5) (when (and (< (-> a0-40 x) 228.0) (< (-> a0-40 z) 228.0) (< 100.0 (-> v1-49 x)) (< 100.0 (-> v1-49 z))) (let* ((a0-46 (-> arg1 class color)) - (a0-53 (copy-and-set-field a0-46 r (shr (* (-> a0-46 r) (the-as uint (-> obj color x))) 7))) - (a0-60 (copy-and-set-field a0-53 g (shr (* (-> a0-53 g) (the-as uint (-> obj color y))) 7))) + (a0-53 (copy-and-set-field a0-46 r (shr (* (-> a0-46 r) (the-as uint (-> this color x))) 7))) + (a0-60 (copy-and-set-field a0-53 g (shr (* (-> a0-53 g) (the-as uint (-> this color y))) 7))) (s4-1 (copy-and-set-field - (copy-and-set-field a0-60 b (shr (* (-> a0-60 b) (the-as uint (-> obj color z))) 7)) + (copy-and-set-field a0-60 b (shr (* (-> a0-60 b) (the-as uint (-> this color z))) 7)) a - (the int (* 128.0 (-> obj frustum-alpha) (-> arg1 alpha))) + (the int (* 128.0 (-> this frustum-alpha) (-> arg1 alpha))) ) ) ) - (let ((v1-60 (-> obj adgif-tmpl dma-vif quad))) + (let ((v1-60 (-> this adgif-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-208)) v1-60) ) - (let ((v1-61 (-> obj adgif-tmpl quad 1))) + (let ((v1-61 (-> this adgif-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-208) 1) v1-61) ) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ sv-208 32)) sv-212) - (let ((v1-63 (-> obj draw4-tmpl dma-vif quad))) + (let ((v1-63 (-> this draw4-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-208) 7) v1-63) ) - (let ((v1-64 (-> obj draw4-tmpl quad 1))) + (let ((v1-64 (-> this draw4-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-208) 8) v1-64) ) (set-vector! @@ -1824,7 +1824,7 @@ ;; definition for method 18 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-frustum-2 minimap ((obj minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-frustum-2 minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (local-vars (sv-16 process) (sv-20 dma-buffer) @@ -1860,8 +1860,8 @@ (set! (-> sv-224 vector 0 y) 0.0) (set! (-> sv-224 vector 0 w) 0.0) (vector-! sv-216 (target-pos 0) (-> (the-as process-drawable sv-16) root trans)) - (let ((f0-4 (/ (-> sv-216 x) (* 16384.0 (-> obj offset y)))) - (f1-3 (/ (-> sv-216 z) (* 16384.0 (-> obj offset y)))) + (let ((f0-4 (/ (-> sv-216 x) (* 16384.0 (-> this offset y)))) + (f1-3 (/ (-> sv-216 z) (* 16384.0 (-> this offset y)))) ) (set-vector! (-> sv-228 vector 0) (-> sv-220 z) 0.0 (- (-> sv-220 x)) 0.0) (set-vector! (-> sv-228 vector 1) 0.0 1.0 0.0 0.0) @@ -1889,20 +1889,20 @@ (v1-54 (+ a2-6 304)) (a0-43 (+ a1-12 304)) ) - (let* ((t0-2 (copy-and-set-field a3-0 r (shr (* (-> a3-0 r) (the-as uint (-> obj color x))) 7))) - (t0-9 (copy-and-set-field t0-2 g (shr (* (-> t0-2 g) (the-as uint (-> obj color y))) 7))) + (let* ((t0-2 (copy-and-set-field a3-0 r (shr (* (-> a3-0 r) (the-as uint (-> this color x))) 7))) + (t0-9 (copy-and-set-field t0-2 g (shr (* (-> t0-2 g) (the-as uint (-> this color y))) 7))) (a3-13 (copy-and-set-field - (copy-and-set-field t0-9 b (shr (* (-> t0-9 b) (the-as uint (-> obj color z))) 7)) + (copy-and-set-field t0-9 b (shr (* (-> t0-9 b) (the-as uint (-> this color z))) 7)) a (the int (* 128.0 (-> arg1 alpha))) ) ) ) - (let ((t0-21 (-> obj draw3-tmpl dma-vif quad))) + (let ((t0-21 (-> this draw3-tmpl dma-vif quad))) (set! (-> (the-as (pointer uint128) sv-208)) t0-21) ) - (let ((t0-22 (-> obj draw3-tmpl quad 1))) + (let ((t0-22 (-> this draw3-tmpl quad 1))) (set! (-> (the-as (pointer uint128) sv-208) 1) t0-22) ) (set-vector! @@ -1955,13 +1955,13 @@ ;; definition for method 21 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod sub-draw-1-1 minimap ((obj minimap) (arg0 minimap-draw-work)) +(defmethod sub-draw-1-1 minimap ((this minimap) (arg0 minimap-draw-work)) (let ((s5-0 (-> arg0 buf))) (set-display-gs-state s5-0 (the-as int (-> *map-texture-base* vram-page)) 128 128 0 0) (let ((s3-0 (-> s5-0 base))) - (set! (-> (the-as (pointer uint128) s3-0)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-0) 1) (-> obj adgif-tmpl quad 1)) - (let ((a1-2 (-> obj last-tex))) + (set! (-> (the-as (pointer uint128) s3-0)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-0) 1) (-> this adgif-tmpl quad 1)) + (let ((a1-2 (-> this last-tex))) (if (not a1-2) (set! a1-2 (lookup-texture-by-id-fast (new 'static 'texture-id :index #x9b :page #xb))) ) @@ -1976,8 +1976,8 @@ ) (let ((s3-1 (the-as object (-> s5-0 base)))) (let ((f30-0 (-> *video-params* relative-x-scale))) - (set! (-> (the-as (pointer uint128) s3-1)) (-> obj draw2-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-1) 1) (-> obj draw2-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-1)) (-> this draw2-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-1) 1) (-> this draw2-tmpl quad 1)) (let ((s2-0 (new-stack-vector0))) (let ((s1-0 (new-stack-vector0))) (set! (-> s1-0 quad) (-> (matrix-local->world #f #f) vector 2 quad)) @@ -1992,24 +1992,24 @@ (set-vector! (-> arg0 mat vector 1) 0.0 1.0 0.0 0.0) (set-vector! (-> arg0 mat vector 2) (* (-> s1-0 x) f30-0) 0.0 (-> s1-0 z) 0.0) ) - (vector-! s2-0 (target-pos 0) (-> obj minimap-corner)) + (vector-! s2-0 (target-pos 0) (-> this minimap-corner)) (set! (-> s2-0 x) (* 0.00000023841858 (-> s2-0 x))) (set! (-> s2-0 z) (* 0.00000023841858 (-> s2-0 z))) - (vector+! (-> arg0 mat trans) s2-0 (-> obj offset)) + (vector+! (-> arg0 mat trans) s2-0 (-> this offset)) ) ) (set! (-> arg0 mat trans y) 0.0) - (set! (-> arg0 corner 0 x) (* 0.25 (-> obj offset y))) - (set! (-> arg0 corner 0 z) (* 0.25 (-> obj offset y))) + (set! (-> arg0 corner 0 x) (* 0.25 (-> this offset y))) + (set! (-> arg0 corner 0 z) (* 0.25 (-> this offset y))) (set! (-> arg0 corner 0 w) 1.0) - (set! (-> arg0 corner 1 x) (* -0.25 (-> obj offset y))) - (set! (-> arg0 corner 1 z) (* 0.25 (-> obj offset y))) + (set! (-> arg0 corner 1 x) (* -0.25 (-> this offset y))) + (set! (-> arg0 corner 1 z) (* 0.25 (-> this offset y))) (set! (-> arg0 corner 1 w) 1.0) - (set! (-> arg0 corner 2 x) (* 0.25 (-> obj offset y))) - (set! (-> arg0 corner 2 z) (* -0.25 (-> obj offset y))) + (set! (-> arg0 corner 2 x) (* 0.25 (-> this offset y))) + (set! (-> arg0 corner 2 z) (* -0.25 (-> this offset y))) (set! (-> arg0 corner 2 w) 1.0) - (set! (-> arg0 corner 3 x) (* -0.25 (-> obj offset y))) - (set! (-> arg0 corner 3 z) (* -0.25 (-> obj offset y))) + (set! (-> arg0 corner 3 x) (* -0.25 (-> this offset y))) + (set! (-> arg0 corner 3 z) (* -0.25 (-> this offset y))) (set! (-> arg0 corner 3 w) 1.0) (vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) (-> arg0 mat)) (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) (-> arg0 mat)) @@ -2032,15 +2032,15 @@ (set! f0-57 0.0) ) ) - (seek! (-> obj frustum-alpha) f0-57 (seconds-per-frame)) + (seek! (-> this frustum-alpha) f0-57 (seconds-per-frame)) ) (dma-buffer-add-gs-set s5-0 (xyoffset-1 (new 'static 'gs-xy-offset :ofx #x640 :ofy #x640))) - (when (!= (-> obj frustum-alpha) 0.0) + (when (!= (-> this frustum-alpha) 0.0) (let ((s3-2 (the-as connection-pers (-> *minimap* engine alive-list)))) (while s3-2 (let ((a2-6 s3-2)) (if (logtest? (-> (the-as connection-minimap a2-6) class flags) (minimap-flag frustum)) - (draw-frustum-1 obj arg0 (the-as connection-minimap a2-6)) + (draw-frustum-1 this arg0 (the-as connection-minimap a2-6)) ) ) (set! s3-2 (-> s3-2 next)) @@ -2051,8 +2051,8 @@ (s3-3 (lookup-texture-by-id-fast (new 'static 'texture-id :page #x679))) ) (when s3-3 - (set! (-> (the-as (pointer uint128) s2-1)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s2-1) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s2-1)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s2-1) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s2-1 32)) s3-3) (&+! (-> arg0 buf base) 112) ) @@ -2064,7 +2064,7 @@ (while s3-4 (let ((a2-7 s3-4)) (if (logtest? (-> (the-as connection-minimap a2-7) class flags) (minimap-flag frustum)) - (draw-frustum-2 obj arg0 (the-as connection-minimap a2-7)) + (draw-frustum-2 this arg0 (the-as connection-minimap a2-7)) ) ) (set! s3-4 (-> s3-4 next)) @@ -2074,8 +2074,8 @@ (a1-32 (lookup-texture-by-id-fast (new 'static 'texture-id :index #x42 :page #xb))) ) (when a1-32 - (set! (-> (the-as (pointer uint128) s3-5)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-5) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-5)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-5) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s3-5 32)) a1-32) (&+! (-> arg0 buf base) 112) ) @@ -2084,7 +2084,7 @@ (while s3-6 (let ((a2-8 s3-6)) (if (logtest? (-> (the-as connection-minimap a2-8) class flags) (minimap-flag racer)) - (draw-racer-2 obj arg0 (the-as connection-minimap a2-8)) + (draw-racer-2 this arg0 (the-as connection-minimap a2-8)) ) ) (set! s3-6 (-> s3-6 next)) @@ -2096,14 +2096,14 @@ (xyoffset-1 (new 'static 'gs-xy-offset)) ) (let ((s3-7 (the-as object (-> s5-0 base)))) - (set! (-> (the-as (pointer uint128) s3-7)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-7) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-7)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-7) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s3-7) 2)) (lookup-texture-by-id-fast (new 'static 'texture-id :index #x2a :page #x67a)) ) - (set! (-> (the-as (pointer uint128) s3-7) 7) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-7) 8) (-> obj sprite-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-7) 7) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-7) 8) (-> this sprite-tmpl quad 1)) (set-vector! (-> (the-as (inline-array vector4w) s3-7) 9) 128 128 128 128) (set-vector! (-> (the-as (inline-array vector4w) s3-7) 10) 0 0 0 0) (set-vector! (-> (the-as (inline-array vector4w) s3-7) 11) 0 0 #xffffff 0) @@ -2120,7 +2120,7 @@ ;; definition for method 19 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod sub-draw-1-2 minimap ((obj minimap) (arg0 minimap-draw-work)) +(defmethod sub-draw-1-2 minimap ((this minimap) (arg0 minimap-draw-work)) (local-vars (a3-4 int) (t0-4 int) (sv-48 vector) (sv-52 matrix) (sv-56 vector)) (let ((s5-0 (-> arg0 buf))) (reset-display-gs-state *display* s5-0) @@ -2159,9 +2159,9 @@ (set! t0-4 (* (+ t0-0 1792 (-> arg0 draw-pos x)) 16)) ) ) - (set! (-> (the-as (pointer uint128) v1-20)) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-20) 1) (-> obj sprite-tmpl quad 1)) - (let ((t1-5 (-> obj color quad))) + (set! (-> (the-as (pointer uint128) v1-20)) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-20) 1) (-> this sprite-tmpl quad 1)) + (let ((t1-5 (-> this color quad))) (set! (-> (the-as (pointer uint128) (&+ (the-as pointer v1-20) 32))) t1-5) ) (cond @@ -2258,11 +2258,11 @@ (vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) s1-2) (vector-matrix*! (-> arg0 corner 2) (-> arg0 corner 2) s1-2) (vector-matrix*! (-> arg0 corner 3) (-> arg0 corner 3) s1-2) - (set! (-> (the-as (pointer uint128) s3-2)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-2) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-2)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-2) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&-> (the-as (pointer uint128) s3-2) 2)) s2-1) - (set! (-> (the-as (pointer uint128) s3-2) 7) (-> obj draw-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s3-2) 8) (-> obj draw-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s3-2) 7) (-> this draw-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s3-2) 8) (-> this draw-tmpl quad 1)) (set-vector! (-> (the-as (inline-array vector4w) s3-2) 9) 0 255 255 128) (set-vector! (-> (the-as (inline-array vector4w) s3-2) 10) 0 0 #xffffff 0) (set-vector! @@ -2310,7 +2310,7 @@ ;; definition for method 16 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch pointer vs none. -(defmethod draw-connection minimap ((obj minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) +(defmethod draw-connection minimap ((this minimap) (arg0 minimap-draw-work) (arg1 connection-minimap)) (let ((s1-0 (target-pos 0))) (cond ((= (-> arg1 position) #t) @@ -2359,7 +2359,7 @@ (let ((s3-2 (new 'stack-no-clear 'vector)) (s2-0 #f) ) - (let ((f30-0 (/ 1.0 (* 16384.0 (-> obj offset y))))) + (let ((f30-0 (/ 1.0 (* 16384.0 (-> this offset y))))) 0.0 (set! (-> s3-2 quad) (-> arg1 last-relative-pos quad)) (set! (-> s3-2 x) (* (-> s3-2 x) f30-0)) @@ -2373,11 +2373,11 @@ ((logtest? (-> arg1 class flags) (minimap-flag trail)) (cond (*trail-graph* - (let ((a2-2 (get-trail-for-connection obj arg1 #f))) + (let ((a2-2 (get-trail-for-connection this arg1 #f))) (cond ((not a2-2) (when (!= (-> arg1 alpha) 0.0) - (when (not (get-trail-for-connection obj arg1 #t)) + (when (not (get-trail-for-connection this arg1 #t)) (let ((s2-1 (the-as connection-pers (-> *minimap* engine alive-list)))) (while s2-1 (let ((a1-12 s2-1)) @@ -2393,7 +2393,7 @@ (set! s2-0 #t) (set! (-> arg1 edge-ry) -131072.0) ) - ((>= (- (current-time) (the-as int (-> a2-2 last-updated))) (seconds 5)) + ((time-elapsed? (the-as int (-> a2-2 last-updated)) (seconds 5)) (set! s2-0 #t) (set! (-> arg1 edge-ry) -131072.0) ) @@ -2497,18 +2497,18 @@ (set! s2-0 #t) ) (if (logtest? (-> arg1 class flags) (minimap-flag goal)) - (set! (-> arg1 class icon-xy x) (the-as uint (mod (the int (-> obj goal-time)) 6))) + (set! (-> arg1 class icon-xy x) (the-as uint (mod (the int (-> this goal-time)) 6))) ) (when (not s2-0) (vector-matrix*! s3-2 s3-2 (-> arg0 mat)) (let ((v1-115 (the-as object (-> arg0 buf base)))) (let* ((f0-48 (-> arg1 class scale)) (a1-25 (-> arg1 class color)) - (a1-32 (copy-and-set-field a1-25 r (shr (* (-> a1-25 r) (the-as uint (-> obj color x))) 7))) - (a1-39 (copy-and-set-field a1-32 g (shr (* (-> a1-32 g) (the-as uint (-> obj color y))) 7))) + (a1-32 (copy-and-set-field a1-25 r (shr (* (-> a1-25 r) (the-as uint (-> this color x))) 7))) + (a1-39 (copy-and-set-field a1-32 g (shr (* (-> a1-32 g) (the-as uint (-> this color y))) 7))) (a0-70 (copy-and-set-field - (copy-and-set-field a1-39 b (shr (* (-> a1-39 b) (the-as uint (-> obj color z))) 7)) + (copy-and-set-field a1-39 b (shr (* (-> a1-39 b) (the-as uint (-> this color z))) 7)) a (the int (* 128.0 (-> arg1 alpha))) ) @@ -2527,8 +2527,8 @@ (a1-61 (+ a3-1 312)) (a2-14 (+ t0-1 312)) ) - (set! (-> (the-as (pointer uint128) v1-115)) (-> obj sprite-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-115) 1) (-> obj sprite-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) v1-115)) (-> this sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-115) 1) (-> this sprite-tmpl quad 1)) (set-vector! (-> (the-as (inline-array vector4w) v1-115) 2) (the-as int (-> a0-70 r)) @@ -2565,23 +2565,23 @@ ;; definition for method 15 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-1 minimap ((obj minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) +(defmethod draw-1 minimap ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) (local-vars (v1-19 uint128)) (when (= (level-status *level* 'ctywide) 'active) (let ((s5-1 (new 'stack-no-clear 'minimap-draw-work))) (set! (-> s5-1 buf) arg0) (set! (-> s5-1 draw-pos quad) (-> arg1 quad)) (set! (-> s5-1 justify-right) arg2) - (sub-draw-1-1 obj s5-1) - (sub-draw-1-2 obj s5-1) - (set! (-> obj ctywide) (level-get *level* 'ctywide)) + (sub-draw-1-1 this s5-1) + (sub-draw-1-2 this s5-1) + (set! (-> this ctywide) (level-get *level* 'ctywide)) (let ((s2-1 (-> s5-1 buf base)) (s4-1 (lookup-texture-by-id-fast (new 'static 'texture-id :page #x679))) ) - (let ((s3-1 (-> obj ctywide texture-mask 8))) + (let ((s3-1 (-> this ctywide texture-mask 8))) (when s4-1 - (set! (-> (the-as (pointer uint128) s2-1)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s2-1) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s2-1)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s2-1) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s2-1 32)) s4-1) (&+! (-> s5-1 buf base) 112) (let ((v1-18 (-> s3-1 mask quad)) @@ -2599,13 +2599,13 @@ (let ((s4-2 (the-as connection-pers (-> *minimap* engine alive-list)))) (while s4-2 (let ((a2-1 s4-2)) - (draw-connection obj s5-1 (the-as connection-minimap a2-1)) + (draw-connection this s5-1 (the-as connection-minimap a2-1)) ) (set! s4-2 (-> s4-2 next)) ) ) (if (not (paused?)) - (+! (-> obj goal-time) (* 14.0 (seconds-per-frame))) + (+! (-> this goal-time) (* 14.0 (seconds-per-frame))) ) (reset-display-gs-state *display* (-> s5-1 buf)) ) @@ -2617,20 +2617,20 @@ ;; definition for method 24 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-sprite2 minimap ((obj minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) +(defmethod draw-sprite2 minimap ((this minimap) (arg0 dma-buffer) (arg1 vector4w) (arg2 symbol)) (local-vars (v1-24 uint128) (a0-8 uint128) (a3-5 int) (t0-4 int)) - (when (-> obj race-tex) + (when (-> this race-tex) (let ((s5-0 (new 'stack-no-clear 'minimap-draw-work))) (set! (-> s5-0 buf) arg0) (set! (-> s5-0 draw-pos quad) (-> arg1 quad)) (set! (-> s5-0 justify-right) arg2) (let ((v1-4 (-> s5-0 buf base)) - (s3-0 (-> obj race-tex)) - (s2-0 (-> obj race-level texture-mask 8)) + (s3-0 (-> this race-tex)) + (s2-0 (-> this race-level texture-mask 8)) ) (when s3-0 - (set! (-> (the-as (pointer uint128) v1-4)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-4) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) v1-4)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-4) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ v1-4 32)) s3-0) (&+! (-> s5-0 buf base) 112) (let ((v1-8 (-> s2-0 mask quad)) @@ -2663,9 +2663,9 @@ ) (set! (-> s5-0 draw-pos x) a3-5) (set! (-> s5-0 draw-pos y) a2-1) - (set! (-> (the-as (pointer uint128) v1-10)) (-> obj sprite2-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) v1-10) 1) (-> obj sprite2-tmpl quad 1)) - (let ((t1-5 (-> obj color quad))) + (set! (-> (the-as (pointer uint128) v1-10)) (-> this sprite2-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) v1-10) 1) (-> this sprite2-tmpl quad 1)) + (let ((t1-5 (-> this color quad))) (set! (-> (the-as (pointer uint128) (&+ (the-as pointer v1-10) 32))) t1-5) ) (cond @@ -2687,11 +2687,11 @@ (&+! (-> arg0 base) 112) (let ((s2-1 (-> s5-0 buf base)) (s4-1 (lookup-texture-by-id-fast (new 'static 'texture-id :index #x42 :page #xb))) - (s3-1 (-> obj ctywide texture-mask 8)) + (s3-1 (-> this ctywide texture-mask 8)) ) (when s4-1 - (set! (-> (the-as (pointer uint128) s2-1)) (-> obj adgif-tmpl dma-vif quad)) - (set! (-> (the-as (pointer uint128) s2-1) 1) (-> obj adgif-tmpl quad 1)) + (set! (-> (the-as (pointer uint128) s2-1)) (-> this adgif-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) s2-1) 1) (-> this adgif-tmpl quad 1)) (adgif-shader<-texture-simple! (the-as adgif-shader (&+ s2-1 32)) s4-1) (&+! (-> s5-0 buf base) 112) (let ((v1-23 (-> s3-1 mask quad)) @@ -2712,7 +2712,7 @@ (when (logtest? (-> (the-as connection-minimap s2-2) class flags) (minimap-flag racer)) (if (string= (the-as string (-> (the-as connection-minimap s2-2) class name)) "racer-target") (set! s4-2 s2-2) - (draw-racer-1 obj s5-0 (the-as connection-minimap s2-2) (-> obj race-scale) f30-0 f28-0) + (draw-racer-1 this s5-0 (the-as connection-minimap s2-2) (-> this race-scale) f30-0 f28-0) ) ) ) @@ -2720,7 +2720,7 @@ ) ) (if s4-2 - (draw-racer-1 obj s5-0 (the-as connection-minimap s4-2) (-> obj race-scale) f30-0 f28-0) + (draw-racer-1 this s5-0 (the-as connection-minimap s4-2) (-> this race-scale) f30-0 f28-0) ) ) ) @@ -2731,19 +2731,19 @@ ;; definition for method 25 of type minimap ;; WARN: Return type mismatch int vs none. -(defmethod set-race-texture minimap ((obj minimap) (arg0 texture) (arg1 float) (arg2 level)) - (set! (-> obj race-tex) arg0) - (set! (-> obj race-scale) arg1) - (set! (-> obj race-level) arg2) +(defmethod set-race-texture minimap ((this minimap) (arg0 texture) (arg1 float) (arg2 level)) + (set! (-> this race-tex) arg0) + (set! (-> this race-scale) arg1) + (set! (-> this race-level) arg2) 0 (none) ) ;; definition for method 27 of type minimap ;; WARN: Return type mismatch int vs none. -(defmethod set-race-corner minimap ((obj minimap) (arg0 float) (arg1 float)) - (set! (-> obj race-corner x) arg0) - (set! (-> obj race-corner z) arg1) +(defmethod set-race-corner minimap ((this minimap) (arg0 float) (arg1 float)) + (set! (-> this race-corner x) arg0) + (set! (-> this race-corner z) arg1) 0 (none) ) @@ -2751,8 +2751,8 @@ ;; definition for method 22 of type minimap ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-color minimap ((obj minimap) (arg0 vector)) - (set! (-> obj color quad) (-> arg0 quad)) +(defmethod set-color minimap ((this minimap) (arg0 vector)) + (set! (-> this color quad) (-> arg0 quad)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc index 95713607dd..26c4a43ed9 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc @@ -633,7 +633,7 @@ ;; definition for method 10 of type menu-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-option ((obj menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-option ((this menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) 0 (none) ) @@ -641,11 +641,11 @@ ;; definition for method 10 of type menu-on-off-option ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-on-off-option ((this menu-on-off-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-8 string) (sv-16 string)) (let ((s3-0 (if arg3 (&-> *progress-state* on-off-choice) - (-> obj value-to-modify) + (-> this value-to-modify) ) ) ) @@ -656,7 +656,7 @@ (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress-force-selected)) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond ((-> s3-0 0) @@ -685,7 +685,7 @@ (s1-2 (clear *temp-string*)) (s0-2 "~S: ~S") ) - (set! sv-16 (lookup-text! *common-text* (-> obj name) #f)) + (set! sv-16 (lookup-text! *common-text* (-> this name) #f)) (let ((a3-4 (if (-> s3-0 0) (lookup-text! *common-text* (text-id progress-on) #f) (lookup-text! *common-text* (text-id progress-off) #f) @@ -700,14 +700,14 @@ ) ) ) - (print-menu-text a0-8 (-> obj scale) arg1 arg0) + (print-menu-text a0-8 (-> this scale) arg1 arg0) 0 (none) ) ;; definition for method 10 of type menu-yes-no-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-yes-no-option ((this menu-yes-no-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-8 string)) (let ((s3-0 (&-> *progress-state* yes-no-choice))) (set! a0-8 @@ -717,7 +717,7 @@ (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress-force-selected)) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond ((-> s3-0 0) @@ -742,20 +742,20 @@ a0-8 ) (else - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) *temp-string* ) ) ) ) - (print-menu-text a0-8 (-> obj scale) arg1 arg0) + (print-menu-text a0-8 (-> this scale) arg1 arg0) 0 (none) ) ;; definition for method 10 of type menu-video-mode-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-video-mode-option ((obj menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-video-mode-option ((this menu-video-mode-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((s3-0 (&-> *progress-state* video-mode-choice)) (f28-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (f30-0 (-> arg1 origin y)) @@ -785,7 +785,7 @@ (set! (-> a0-6 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 44 f28-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 20.0) (cond ((= (-> s3-0 0) 'pal) @@ -827,7 +827,7 @@ ) ) (+! (-> arg1 origin y) -8.0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 20.0) (cond ((= (-> s3-0 0) 'pal) @@ -856,7 +856,7 @@ (-> *progress-state* graphic-options-item-picked) ) ) - (print-menu-text s2-0 (-> obj scale) arg1 arg0) + (print-menu-text s2-0 (-> this scale) arg1 arg0) ) ) (set! (-> arg1 origin y) f30-0) @@ -867,7 +867,7 @@ ;; definition for method 10 of type menu-unlocked-menu-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-unlocked-menu-option ((this menu-unlocked-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((s5-0 (memcard-unlocked-secrets? #t)) (f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) ) @@ -877,7 +877,7 @@ (let ((v1-4 arg1)) (set! (-> v1-4 scale) 0.6) ) - (when (nonzero? (-> obj name)) + (when (nonzero? (-> this name)) (cond ((= arg2 (-> arg0 option-index)) (progress-selected 0) @@ -889,7 +889,7 @@ ) (+! (-> arg1 origin y) 8.0) (cond - ((= (-> obj name) (text-id progress-main-secrets-scrapbook)) + ((= (-> this name) (text-id progress-main-secrets-scrapbook)) (cond ((logtest? s5-0 (game-secrets scrap-book-1)) (print-game-text @@ -908,7 +908,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-mega-scrapbook)) + ((= (-> this name) (text-id progress-main-secrets-mega-scrapbook)) (cond ((logtest? s5-0 (game-secrets scrap-book-2)) (print-game-text @@ -927,7 +927,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-scrapbook-3)) + ((= (-> this name) (text-id progress-main-secrets-scrapbook-3)) (cond ((logtest? s5-0 (game-secrets scrap-book-3)) (print-game-text @@ -946,7 +946,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-sceneplayer-1)) + ((= (-> this name) (text-id progress-main-secrets-sceneplayer-1)) (cond ((logtest? s5-0 (game-secrets scene-player-1)) (print-game-text @@ -965,7 +965,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-sceneplayer-2)) + ((= (-> this name) (text-id progress-main-secrets-sceneplayer-2)) (cond ((logtest? s5-0 (game-secrets scene-player-2)) (print-game-text @@ -984,7 +984,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-sceneplayer-3)) + ((= (-> this name) (text-id progress-main-secrets-sceneplayer-3)) (cond ((logtest? s5-0 (game-secrets scene-player-3)) (print-game-text @@ -1003,7 +1003,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-hero-mode)) + ((= (-> this name) (text-id progress-main-secrets-hero-mode)) (cond ((logtest? s5-0 (game-secrets hero-mode)) (print-game-text @@ -1022,7 +1022,7 @@ ) ) ) - ((= (-> obj name) (text-id progress-main-secrets-levelselect)) + ((= (-> this name) (text-id progress-main-secrets-levelselect)) (cond ((logtest? s5-0 (game-secrets level-select)) (print-game-text @@ -1050,10 +1050,10 @@ ;; definition for method 10 of type menu-main-menu-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-main-menu-option ((this menu-main-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (-> arg1 flags) (when (and (= (-> arg0 menu-transition) 0.0) (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) - (nonzero? (-> obj name)) + (nonzero? (-> this name)) (= arg2 (-> arg0 option-index)) ) ) @@ -1092,13 +1092,13 @@ ) ) (cond - ((= (-> obj name) (text-id progress-root-show-map)) + ((= (-> this name) (text-id progress-root-show-map)) (when (= (-> *setting-control* user-default language) (language-enum french)) (let ((v1-18 arg1)) (set! (-> v1-18 scale) 0.7) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (set! (-> arg1 origin y) (the float (if (= (get-aspect-ratio) 'aspect4x3) 210 200 @@ -1294,7 +1294,7 @@ ) ) (else - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) ) ) @@ -2121,7 +2121,7 @@ ;; WARN: Stack slot offset 36 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-memcard-slot-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (v0-74 pointer) (sv-16 float) @@ -2207,7 +2207,7 @@ ) ) ) - (set-vector! (-> obj box 0 color) 64 128 128 (the int (* 128.0 sv-16))) + (set-vector! (-> this box 0 color) 64 128 128 (the int (* 128.0 sv-16))) (when (= arg2 sv-20) (cond ((!= *save-options-title* (-> arg0 current-options)) @@ -2220,7 +2220,7 @@ ) ) (draw-savegame-box - obj + this (the float sv-64) (the float (+ sv-64 sv-80)) (the float (+ sv-72 (* sv-88 arg2))) @@ -2228,14 +2228,14 @@ ) (when (!= arg2 3) (draw-savegame-box - obj + this (the float sv-64) (the float (+ sv-64 sv-80)) (the float (+ sv-72 sv-88 (* sv-88 arg2))) (the float (+ sv-72 sv-88 (* sv-88 arg2))) ) (draw-savegame-box - obj + this (the float (+ sv-64 sv-80)) (the float (+ sv-64 sv-80)) (the float (+ sv-72 sv-88 (* sv-88 arg2))) @@ -2243,7 +2243,7 @@ ) ) (draw-savegame-box - obj + this (the float (+ sv-64 sv-80)) (the float (+ sv-64 sv-80)) (the float sv-72) @@ -2271,7 +2271,7 @@ (set! sv-80 166) (set! sv-88 42) (draw-savegame-box - obj + this (the float (+ sv-64 sv-80)) (the float (+ sv-64 sv-80)) (the float (+ sv-72 sv-88 (* sv-88 arg2))) @@ -2280,7 +2280,7 @@ ) ) (draw-savegame-box - obj + this (the float sv-64) (the float (+ sv-64 sv-80)) (the float (+ sv-72 (* sv-88 arg2))) @@ -2288,14 +2288,14 @@ ) (when (!= arg2 4) (draw-savegame-box - obj + this (the float sv-64) (the float (+ sv-64 sv-80)) (the float (+ sv-72 sv-88 (* sv-88 arg2))) (the float (+ sv-72 sv-88 (* sv-88 arg2))) ) (draw-savegame-box - obj + this (the float (+ sv-64 sv-80)) (the float (+ sv-64 sv-80)) (the float (+ sv-72 sv-88 (* sv-88 arg2))) @@ -2303,7 +2303,7 @@ ) ) (draw-savegame-box - obj + this (the float (+ sv-64 sv-80)) (the float (+ sv-64 sv-80)) (the float sv-72) @@ -2373,67 +2373,67 @@ (set! (-> arg1 height) 190.0) (let ((s2-8 (-> *progress-save-info* file arg2 level-index))) (when (= arg2 sv-20) - (let ((v1-199 (-> obj sprites 0 color2))) + (let ((v1-199 (-> this sprites 0 color2))) (set! (-> v1-199 0) 128) (set! (-> v1-199 1) 128) (set! (-> v1-199 2) 128) (set! (-> v1-199 3) (the int (* 128.0 sv-16))) ) - (let ((v1-200 (-> obj sprites 1 color2))) + (let ((v1-200 (-> this sprites 1 color2))) (set! (-> v1-200 0) 128) (set! (-> v1-200 1) 128) (set! (-> v1-200 2) 128) (set! (-> v1-200 3) (the int (* 128.0 sv-16))) ) - (set! (-> obj sprites 1 pos z) #xffffff) - (set! (-> obj sprites 1 pos w) 1) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 s2-8))) - (set! (-> obj sprites 1 scale-x) 1.0) - (set! (-> obj sprites 1 scale-y) 1.0) - (set-hud-piece-position! (-> obj sprites 1) sv-40 sv-48) - (let ((v1-205 (-> obj sprites 2 color2))) + (set! (-> this sprites 1 pos z) #xffffff) + (set! (-> this sprites 1 pos w) 1) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 s2-8))) + (set! (-> this sprites 1 scale-x) 1.0) + (set! (-> this sprites 1 scale-y) 1.0) + (set-hud-piece-position! (-> this sprites 1) sv-40 sv-48) + (let ((v1-205 (-> this sprites 2 color2))) (set! (-> v1-205 0) 128) (set! (-> v1-205 1) 128) (set! (-> v1-205 2) 128) (set! (-> v1-205 3) (the int (* 128.0 sv-16))) ) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 2 pos w) 1) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 s2-8))) - (set! (-> obj sprites 2 scale-x) 1.0) - (set! (-> obj sprites 2 scale-y) 1.0) - (set-hud-piece-position! (-> obj sprites 2) (+ sv-40 sv-56) sv-48) - (let ((v1-211 (-> obj sprites 3 color2))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 2 pos w) 1) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 s2-8))) + (set! (-> this sprites 2 scale-x) 1.0) + (set! (-> this sprites 2 scale-y) 1.0) + (set-hud-piece-position! (-> this sprites 2) (+ sv-40 sv-56) sv-48) + (let ((v1-211 (-> this sprites 3 color2))) (set! (-> v1-211 0) 128) (set! (-> v1-211 1) 128) (set! (-> v1-211 2) 128) (set! (-> v1-211 3) (the int (* 128.0 sv-16))) ) - (set! (-> obj sprites 3 pos z) #xffffff) - (set! (-> obj sprites 3 pos w) 1) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 s2-8))) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.0) - (set-hud-piece-position! (-> obj sprites 3) sv-40 (+ sv-48 64)) - (let ((v1-217 (-> obj sprites 4 color2))) + (set! (-> this sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 pos w) 1) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 s2-8))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set-hud-piece-position! (-> this sprites 3) sv-40 (+ sv-48 64)) + (let ((v1-217 (-> this sprites 4 color2))) (set! (-> v1-217 0) 128) (set! (-> v1-217 1) 128) (set! (-> v1-217 2) 128) (set! (-> v1-217 3) (the int (* 128.0 sv-16))) ) - (set! (-> obj sprites 4 pos z) #xffffff) - (set! (-> obj sprites 4 pos w) 1) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 s2-8))) - (set! (-> obj sprites 4 scale-x) 1.0) - (set! (-> obj sprites 4 scale-y) 1.0) - (set-hud-piece-position! (-> obj sprites 4) (+ sv-40 sv-56) (+ sv-48 64)) + (set! (-> this sprites 4 pos z) #xffffff) + (set! (-> this sprites 4 pos w) 1) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 s2-8))) + (set! (-> this sprites 4 scale-x) 1.0) + (set! (-> this sprites 4 scale-y) 1.0) + (set-hud-piece-position! (-> this sprites 4) (+ sv-40 sv-56) (+ sv-48 64)) (with-dma-buffer-add-bucket ((s1-7 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (draw (-> obj sprites 1) s1-7 (-> *level* default-level)) - (draw (-> obj sprites 2) s1-7 (-> *level* default-level)) - (draw (-> obj sprites 3) s1-7 (-> *level* default-level)) - (draw (-> obj sprites 4) s1-7 (-> *level* default-level)) + (draw (-> this sprites 1) s1-7 (-> *level* default-level)) + (draw (-> this sprites 2) s1-7 (-> *level* default-level)) + (draw (-> this sprites 3) s1-7 (-> *level* default-level)) + (draw (-> this sprites 4) s1-7 (-> *level* default-level)) ) (let ((v1-245 arg1)) (set! (-> v1-245 scale) 0.6) @@ -2442,14 +2442,14 @@ (set! (-> arg1 origin y) 263.0) (set! (-> arg1 width) 170.0) (set! (-> arg1 height) 52.0) - (set! (-> obj sprites 0 scale-x) 0.7) - (set! (-> obj sprites 0 scale-y) 0.7) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xc93))) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 265 263) + (set! (-> this sprites 0 scale-x) 0.7) + (set! (-> this sprites 0 scale-y) 0.7) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 265 263) (with-dma-buffer-add-bucket ((s1-8 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-8 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s1-8 (-> *level* default-level)) ) (+! (-> arg1 origin y) 1.0) (+! (-> arg1 origin x) 28.0) @@ -2463,38 +2463,38 @@ (s1-9 *temp-string* arg1 #f 44 (bucket-id progress)) ) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #xc93))) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 368 263) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 368 263) (with-dma-buffer-add-bucket ((s1-10 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-10 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s1-10 (-> *level* default-level)) ) (+! (-> arg1 origin x) 100.0) (let ((s2-13 print-game-text)) (format (clear *temp-string*) "~D%" (the int (-> *progress-save-info* file arg2 completion-percentage))) (s2-13 *temp-string* arg1 #f 44 (bucket-id progress)) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 368 289) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 368 289) (with-dma-buffer-add-bucket ((s1-12 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-12 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s1-12 (-> *level* default-level)) ) (+! (-> arg1 origin y) 28.0) (let ((s2-15 print-game-text)) (format (clear *temp-string*) "~D" (the int (-> *progress-save-info* file arg2 skill-count))) (s2-15 *temp-string* arg1 #f 44 (bucket-id progress)) ) - (set! (-> obj sprites 0 scale-x) 0.6) - (set! (-> obj sprites 0 scale-y) 0.6) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x82 :page #xc93))) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 253 290) + (set! (-> this sprites 0 scale-x) 0.6) + (set! (-> this sprites 0 scale-y) 0.6) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x82 :page #xc93))) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 253 290) (with-dma-buffer-add-bucket ((s1-14 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-14 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s1-14 (-> *level* default-level)) ) (+! (-> arg1 origin x) -100.0) (let ((s2-17 print-game-text)) @@ -2544,10 +2544,10 @@ (set! (-> arg1 width) sv-32) (set! (-> arg1 height) sv-36) (if (zero? arg2) - (draw-decoration-load-save obj arg1 sv-16 (if (= (-> arg0 current) 'select-load) - (text-id progress-select-file-to-load) - (text-id progress-select-file-to-save) - ) + (draw-decoration-load-save this arg1 sv-16 (if (= (-> arg0 current) 'select-load) + (text-id progress-select-file-to-load) + (text-id progress-select-file-to-save) + ) ) ) ) @@ -2559,7 +2559,7 @@ ;; definition for method 10 of type menu-loading-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-loading-option ((obj menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-loading-option ((this menu-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-3 arg1)) @@ -2616,7 +2616,7 @@ ;; definition for method 10 of type menu-insufficient-space-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-insufficient-space-option ((this menu-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (when (!= (-> arg0 current) 'none) (let ((v1-3 arg1)) @@ -2709,7 +2709,7 @@ ;; definition for method 10 of type menu-secrets-insufficient-space-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-secrets-insufficient-space-option ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2756,7 +2756,7 @@ ;; definition for method 10 of type menu-insert-card-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-insert-card-option ((this menu-insert-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2804,7 +2804,7 @@ ;; definition for method 10 of type menu-error-loading-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-error-loading-option ((this menu-error-loading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2873,7 +2873,7 @@ ;; definition for method 10 of type menu-error-auto-saving-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-error-auto-saving-option ((this menu-error-auto-saving-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -2950,7 +2950,7 @@ ;; definition for method 10 of type menu-card-removed-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-card-removed-option ((this menu-card-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((v1-1 arg1)) (set! (-> v1-1 scale) 0.5) @@ -3013,7 +3013,7 @@ ;; definition for method 10 of type menu-error-disc-removed-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-error-disc-removed-option ((this menu-error-disc-removed-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3073,7 +3073,7 @@ ;; definition for method 10 of type menu-error-reading-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-error-reading-option ((this menu-error-reading-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3131,7 +3131,7 @@ ;; definition for method 10 of type menu-icon-info-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-icon-info-option ((this menu-icon-info-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3140,22 +3140,22 @@ (set! (-> v1-2 scale) 0.5) ) (set! (-> *bigmap* auto-save-icon-flag) #t) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x48 :page #x67a))) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (let ((v1-6 (-> obj sprites 0 color2))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x48 :page #x67a))) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (let ((v1-6 (-> this sprites 0 color2))) (set! (-> v1-6 0) 128) (set! (-> v1-6 1) 128) (set! (-> v1-6 2) 128) (set! (-> v1-6 3) (the int (* 128.0 (- 1.0 (-> arg0 menu-transition))))) ) - (set! (-> obj sprites 0 pos z) #xffffff) - (set! (-> obj sprites 0 pos w) 0) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 240 160) + (set! (-> this sprites 0 pos z) #xffffff) + (set! (-> this sprites 0 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 240 160) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s3-0 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s3-0 (-> *level* default-level)) ) (let ((a0-16 arg1)) (set! (-> a0-16 flags) (font-flags kerning middle middle-vert large)) @@ -3207,7 +3207,7 @@ ;; definition for method 10 of type menu-format-card-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-format-card-option ((this menu-format-card-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3261,7 +3261,7 @@ ;; definition for method 10 of type menu-already-exists-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-already-exists-option ((this menu-already-exists-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3307,7 +3307,7 @@ ;; definition for method 10 of type menu-create-game-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-create-game-option ((this menu-create-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3350,7 +3350,7 @@ ;; definition for method 10 of type menu-video-mode-warning-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-video-mode-warning-option ((this menu-video-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3418,7 +3418,7 @@ ;; definition for method 10 of type menu-video-mode-ok-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-video-mode-ok-option ((this menu-video-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3464,7 +3464,7 @@ ;; definition for method 10 of type menu-progressive-mode-warning-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-progressive-mode-warning-option ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3532,7 +3532,7 @@ ;; definition for method 10 of type menu-progressive-mode-ok-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-progressive-mode-ok-option ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3578,7 +3578,7 @@ ;; definition for method 10 of type menu-quit-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-quit-option ((this menu-quit-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (set! (-> arg1 alpha) (- 1.0 (-> arg0 menu-transition))) (let ((a0-1 arg1)) (set! (-> a0-1 color) (font-color progress)) @@ -3615,7 +3615,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: disable def twice: 147. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod draw-option menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-select-start-option ((this menu-select-start-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-48 int) (sv-64 int) @@ -3625,7 +3625,7 @@ (sv-128 hud-box) ) (let* ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) - (s3-0 (-> obj task-index)) + (s3-0 (-> this task-index)) (s2-0 0) (s1-0 50) (f28-0 (* (-> arg0 sliding-height) (the float s1-0))) @@ -3669,8 +3669,8 @@ (if (or (= (-> *setting-control* user-default language) (language-enum french)) (= (-> *setting-control* user-default language) (language-enum spanish)) ) - (draw-decoration obj arg1 f30-0 (the-as text-id a3-1) #t 0.7) - (draw-decoration obj arg1 f30-0 (the-as text-id a3-1) #t 0.95) + (draw-decoration this arg1 f30-0 (the-as text-id a3-1) #t 0.7) + (draw-decoration this arg1 f30-0 (the-as text-id a3-1) #t 0.95) ) ) (begin-scissor-level sv-128) @@ -3728,7 +3728,7 @@ (set! sv-80 (-> *game-info* play-list sv-64)) (cond ((zero? s2-0) - (set! (-> obj real-task-index) sv-64) + (set! (-> this real-task-index) sv-64) (set! sv-96 arg1) (set! (-> sv-96 color) (progress-selected 0)) (draw-highlight (+ s0-0 47) 50 f30-0) @@ -3786,7 +3786,7 @@ ;; definition for method 10 of type menu-select-scene-option ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-select-scene-option ((this menu-select-scene-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-48 int) (sv-64 (function string font-context symbol int bucket-id float)) @@ -3802,7 +3802,7 @@ (sv-224 (function string font-context symbol int bucket-id float)) ) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) - (s4-0 (-> obj task-index)) + (s4-0 (-> this task-index)) (s3-0 0) (s2-0 *hud-select-scene-act1*) ) @@ -3846,8 +3846,8 @@ (if (or (= (-> *setting-control* user-default language) (language-enum french)) (= (-> *setting-control* user-default language) (language-enum spanish)) ) - (draw-decoration obj arg1 f30-0 (text-id progress-select-scene) #t 0.7) - (draw-decoration obj arg1 f30-0 (text-id progress-select-scene) #t 0.95) + (draw-decoration this arg1 f30-0 (text-id progress-select-scene) #t 0.7) + (draw-decoration this arg1 f30-0 (text-id progress-select-scene) #t 0.95) ) (begin-scissor-scene s1-0) (let ((v1-23 arg1)) @@ -3964,7 +3964,7 @@ ;; definition for method 10 of type menu-bigmap-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-bigmap-option ((this menu-bigmap-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) 0 (none) ) @@ -4184,7 +4184,7 @@ ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-missions-option ((obj menu-missions-option) (progress progress) (font-ctx font-context) (arg3 int) (arg4 symbol)) +(defmethod draw-option menu-missions-option ((this menu-missions-option) (progress progress) (font-ctx font-context) (arg3 int) (arg4 symbol)) (local-vars (f0-50 float) (font-alpha float) @@ -4259,13 +4259,13 @@ (let ((font-ctx-2 font-ctx)) (set! (-> font-ctx-2 color) (font-color progress)) ) - (let ((page-idx (-> obj page-index))) + (let ((page-idx (-> this page-index))) (cond ((zero? page-idx) - (draw-missions-decoration obj font-ctx font-alpha (text-id progress-root-missions)) + (draw-missions-decoration this font-ctx font-alpha (text-id progress-root-missions)) ) ((= page-idx 1) - (draw-missions-decoration obj font-ctx font-alpha (text-id progress-root-missions)) + (draw-missions-decoration this font-ctx font-alpha (text-id progress-root-missions)) ) ) ) @@ -4285,8 +4285,8 @@ (let ((font-ctx-4 font-ctx)) (set! (-> font-ctx-4 scale) font-scale) ) - (when (zero? (-> obj page-index)) - (set! game-task-idx (-> obj task-line-index)) + (when (zero? (-> this page-index)) + (set! game-task-idx (-> this task-line-index)) (set! task-info-idx 0) (let ((y-offset (+ default-y-origin-4x3 44))) (set! default-y-origin-4x3 y-offset) @@ -4888,7 +4888,7 @@ ;; WARN: Stack slot offset 112 signed mismatch ;; WARN: Stack slot offset 108 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-secret-option ((this menu-secret-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-16 float) (sv-20 symbol) @@ -4916,44 +4916,44 @@ (set! sv-48 arg0) (set! sv-96 (if (not sv-20) 0 - (-> obj num-items) + (-> this num-items) ) ) (set! sv-104 (if (not sv-20) - (-> obj num-items) - (+ (-> obj num-items) (-> obj num-hero-items)) + (-> this num-items) + (+ (-> this num-items) (-> this num-hero-items)) ) ) (set! sv-108 (* (-> sv-48 sliding) sv-36)) - (set! sv-112 (-> obj item-index)) - (set! sv-116 (-> obj prev-item-index)) + (set! sv-112 (-> this item-index)) + (set! sv-116 (-> this prev-item-index)) (set! sv-120 (new 'stack-no-clear 'hud-box)) (set! sv-128 205) (if (< sv-16 0.0) (set! sv-16 (the-as float 0.0)) ) (cond - ((or (not (-> *bigmap* progress-minimap)) (< (-> obj item-index) sv-96) (< sv-104 (-> obj item-index))) + ((or (not (-> *bigmap* progress-minimap)) (< (-> this item-index) sv-96) (< sv-104 (-> this item-index))) (draw-busy-loading arg1) ) (else - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.64) - (set! (-> obj sprites 0 scale-y) 0.64) - (let ((v1-32 (-> obj sprites 0 color2))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xc93))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.64) + (set! (-> this sprites 0 scale-y) 0.64) + (let ((v1-32 (-> this sprites 0 color2))) (set! (-> v1-32 0) 128) (set! (-> v1-32 1) 128) (set! (-> v1-32 2) 128) (set! (-> v1-32 3) (the int (* 128.0 sv-16))) ) - (set! (-> obj sprites 0 pos z) #xffffff) - (set! (-> obj sprites 0 pos w) 0) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 100 128) + (set! (-> this sprites 0 pos z) #xffffff) + (set! (-> this sprites 0 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 100 128) (with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s3-0 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) s3-0 (-> *level* default-level)) ) (set! (-> arg1 alpha) sv-16) (let ((a0-21 arg1)) @@ -4974,7 +4974,7 @@ ) (set! (-> arg1 origin y) 82.0) (let ((t9-5 draw-decoration-secrets) - (a0-24 obj) + (a0-24 this) (a1-4 arg1) (a2-4 sv-16) (a3-2 339) @@ -5028,65 +5028,65 @@ (cond (sv-40 (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) - (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + (draw-secret-list (-> this secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) ) ((>= (- sv-112 sv-116) 0) (when (>= (+ sv-112 -3) sv-96) (set! (-> arg1 origin y) (the float (+ (the int sv-108) -50 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 -3)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 -3)) sv-48 arg1 0 sv-40 sv-108) ) (when (>= (+ sv-112 -2) sv-96) (set! (-> arg1 origin y) (the float (+ (the int sv-108) -25 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) ) (set! (-> arg1 origin y) (the float (+ sv-128 (the int sv-108)))) (when (>= (+ sv-112 -1) sv-96) (draw-highlight (+ sv-128 22) 22 sv-16) - (draw-secret-list (-> obj secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) ) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) (draw-highlight (+ sv-128 22) 22 sv-16) - (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + (draw-secret-list (-> this secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) (when (< (+ sv-112 1) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 50 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) ) (when (< (+ sv-112 2) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 75 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) ) (when (< (+ sv-112 3) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 100 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) ) ) (else (when (>= (+ sv-112 -2) sv-96) (set! (-> arg1 origin y) (the float (+ (the int sv-108) -25 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 -2)) sv-48 arg1 0 sv-40 sv-108) ) (set! (-> arg1 origin y) (the float (+ sv-128 (the int sv-108)))) (if (>= (+ sv-112 -1) sv-96) - (draw-secret-list (-> obj secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 -1)) sv-48 arg1 0 sv-40 sv-108) ) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 25 sv-128))) (draw-highlight (+ sv-128 22) 22 sv-16) - (draw-secret-list (-> obj secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) + (draw-secret-list (-> this secret-items sv-112) sv-48 arg1 1 sv-40 sv-108) (when (< (+ sv-112 1) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 50 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 1)) sv-48 arg1 0 sv-40 sv-108) ) (when (< (+ sv-112 2) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 75 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 2)) sv-48 arg1 0 sv-40 sv-108) ) (when (< (+ sv-112 3) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 100 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 3)) sv-48 arg1 0 sv-40 sv-108) ) (when (< (+ sv-112 4) sv-104) (set! (-> arg1 origin y) (the float (+ (the int sv-108) 125 sv-128))) - (draw-secret-list (-> obj secret-items (+ sv-112 4)) sv-48 arg1 0 sv-40 sv-108) + (draw-secret-list (-> this secret-items (+ sv-112 4)) sv-48 arg1 0 sv-40 sv-108) ) ) ) @@ -5116,23 +5116,23 @@ ) ;; definition for method 3 of type print-highscore-obj -(defmethod inspect print-highscore-obj ((obj print-highscore-obj)) - (when (not obj) - (set! obj obj) +(defmethod inspect print-highscore-obj ((this print-highscore-obj)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tprevious: ~A~%" (-> obj previous)) - (format #t "~1Tplace: ~D~%" (-> obj place)) - (format #t "~1Tscore: ~f~%" (-> obj score)) - (format #t "~1Tgame-score: ~A~%" (-> obj game-score)) - (format #t "~1Tcontext: ~A~%" (-> obj context)) - (format #t "~1Tlocal-scale: ~f~%" (-> obj local-scale)) - (format #t "~1Tinterp: ~f~%" (-> obj interp)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tprevious: ~A~%" (-> this previous)) + (format #t "~1Tplace: ~D~%" (-> this place)) + (format #t "~1Tscore: ~f~%" (-> this score)) + (format #t "~1Tgame-score: ~A~%" (-> this game-score)) + (format #t "~1Tcontext: ~A~%" (-> this context)) + (format #t "~1Tlocal-scale: ~f~%" (-> this local-scale)) + (format #t "~1Tinterp: ~f~%" (-> this interp)) (label cfg-4) - obj + this ) ;; definition for function draw-highscore-icon @@ -6064,7 +6064,7 @@ ;; WARN: Stack slot offset 120 signed mismatch ;; WARN: Stack slot offset 108 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-highscores-option ((this menu-highscores-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-96 float) (sv-100 float) @@ -6087,12 +6087,12 @@ (set! sv-112 (new 'stack-no-clear 'hud-box)) (set! sv-116 (new 'stack 'print-highscore-obj)) (set! sv-120 (* (-> arg0 sliding) sv-104)) - (set! sv-124 (* (-> arg0 sliding-off) (-> obj slide-dir) sv-104)) + (set! sv-124 (* (-> arg0 sliding-off) (-> this slide-dir) sv-104)) (set! sv-128 arg3) (set! sv-132 arg2) (set! sv-136 arg0) (set! sv-140 arg1) - (set! sv-144 obj) + (set! sv-144 this) (if (< sv-96 0.0) (set! sv-96 (the-as float 0.0)) ) @@ -6369,7 +6369,7 @@ ;; definition for method 10 of type menu-on-off-game-vibrations-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-on-off-game-vibrations-option ((obj menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-on-off-game-vibrations-option ((this menu-on-off-game-vibrations-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-10 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -6388,7 +6388,7 @@ (set! (-> a0-2 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond (s3-0 @@ -6426,7 +6426,7 @@ ) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond (s3-0 @@ -6452,14 +6452,14 @@ ) ) ) - (print-menu-text a0-10 (-> obj scale) arg1 arg0) + (print-menu-text a0-10 (-> this scale) arg1 arg0) 0 (none) ) ;; definition for method 10 of type menu-on-off-game-subtitles-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-on-off-game-subtitles-option ((obj menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-on-off-game-subtitles-option ((this menu-on-off-game-subtitles-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-11 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -6478,7 +6478,7 @@ (set! (-> a0-3 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 41 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond (s3-0 @@ -6516,7 +6516,7 @@ ) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond (s3-0 @@ -6542,14 +6542,14 @@ ) ) ) - (print-menu-text a0-11 (-> obj scale) arg1 arg0) + (print-menu-text a0-11 (-> this scale) arg1 arg0) 0 (none) ) ;; definition for method 10 of type menu-subtitle-language-game-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-subtitle-language-game-option ((obj menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-subtitle-language-game-option ((this menu-subtitle-language-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (with-pp (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (let ((v1-2 arg1)) @@ -6577,18 +6577,18 @@ (set! (-> a0-7 color) (font-color progress-force-selected)) ) (draw-highlight (the int (-> arg1 origin y)) 44 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 24.0) - (-> obj language-selection) + (-> this language-selection) (let ((s4-1 (-> s4-0 0))) 7 - (if (-> obj language-transition) - (seekl! (-> obj language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) + (if (-> this language-transition) + (seekl! (-> this language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) ) - (when (>= (-> obj language-x-offset) 75) - (set! (-> obj language-selection) (the-as uint s4-1)) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) + (when (>= (-> this language-x-offset) 75) + (set! (-> this language-selection) (the-as uint s4-1)) + (set! (-> this language-transition) #f) + (set! (-> this language-x-offset) 0) 0 ) ) @@ -6648,7 +6648,7 @@ (let ((v1-52 arg1)) (set! (-> v1-52 scale) 0.65) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (let ((v1-54 arg1)) (set! (-> v1-54 scale) 0.5) ) @@ -6684,7 +6684,7 @@ ;; definition for method 10 of type menu-language-game-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-language-game-option ((obj menu-language-game-option) +(defmethod draw-option menu-language-game-option ((this menu-language-game-option) (progress progress) (font-ctx font-context) (option-index int) @@ -6718,20 +6718,20 @@ ) (draw-highlight (the int (-> font-ctx origin y)) 44 alpha) (let ((print-game-text-fn-1 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) (print-game-text-fn-1 *temp-string* font-ctx #f 44 (bucket-id progress)) ) (+! (-> font-ctx origin y) 24.0) - (-> obj language-selection) + (-> this language-selection) (let ((curr-language (-> curr-language-ptr 0))) 7 - (if (-> obj language-transition) - (seekl! (-> obj language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) + (if (-> this language-transition) + (seekl! (-> this language-x-offset) 150 (the int (* 10.0 (-> pp clock time-adjust-ratio)))) ) - (when (>= (-> obj language-x-offset) 75) - (set! (-> obj language-selection) (the-as uint curr-language)) - (set! (-> obj language-transition) #f) - (set! (-> obj language-x-offset) 0) + (when (>= (-> this language-x-offset) 75) + (set! (-> this language-selection) (the-as uint curr-language)) + (set! (-> this language-transition) #f) + (set! (-> this language-x-offset) 0) 0 ) ) @@ -6793,7 +6793,7 @@ (set! (-> font-ctx-10 scale) 0.65) ) (let ((print-game-text-fn-4 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) (print-game-text-fn-4 *temp-string* font-ctx #f 44 (bucket-id progress)) ) (let ((font-ctx-11 font-ctx)) @@ -6838,7 +6838,7 @@ ;; definition for method 10 of type menu-sub-menu-game-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-sub-menu-game-option ((obj menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-sub-menu-game-option ((this menu-sub-menu-game-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) 395.0 (-> arg1 origin y) @@ -6851,8 +6851,8 @@ (set! (-> a1-1 flags) (font-flags kerning middle large)) ) (if (= (-> *setting-control* user-default language) (language-enum spanish)) - (draw-decoration obj arg1 f0-1 (text-id progress-root-game-options) #f 0.85) - (draw-decoration obj arg1 f0-1 (text-id progress-root-game-options) #f 0.95) + (draw-decoration this arg1 f0-1 (text-id progress-root-game-options) #f 0.85) + (draw-decoration this arg1 f0-1 (text-id progress-root-game-options) #f 0.95) ) ) 0 @@ -6861,7 +6861,7 @@ ;; definition for method 10 of type menu-aspect-ratio-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-aspect-ratio-option ((obj menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-aspect-ratio-option ((this menu-aspect-ratio-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-12 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -6886,7 +6886,7 @@ (set! (-> a0-4 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 42 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 23.0) (cond ((= s3-0 'aspect4x3) @@ -6928,7 +6928,7 @@ ) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) (+! (-> arg1 origin y) 23.0) (cond @@ -6958,9 +6958,9 @@ (-> *progress-state* graphic-options-item-picked) ) ) - (print-menu-text a0-12 (-> obj scale) arg1 arg0) + (print-menu-text a0-12 (-> this scale) arg1 arg0) ) - (draw-decoration obj arg1 f30-0 (text-id progress-root-graphic-options) #f 0.95) + (draw-decoration this arg1 f30-0 (text-id progress-root-graphic-options) #f 0.95) ) 0 (none) @@ -6968,7 +6968,7 @@ ;; definition for method 10 of type menu-on-off-progressive-scan-graphic-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-on-off-progressive-scan-graphic-option ((obj menu-on-off-progressive-scan-graphic-option) +(defmethod draw-option menu-on-off-progressive-scan-graphic-option ((this menu-on-off-progressive-scan-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) @@ -6995,7 +6995,7 @@ (set! (-> a0-3 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 42 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 18.0) (cond (s3-0 @@ -7037,7 +7037,7 @@ ) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) (+! (-> arg1 origin y) 18.0) (cond @@ -7068,7 +7068,7 @@ (-> *progress-state* graphic-options-item-picked) ) ) - (print-menu-text a0-11 (-> obj scale) arg1 arg0) + (print-menu-text a0-11 (-> this scale) arg1 arg0) ) 0 (none) @@ -7076,7 +7076,7 @@ ;; definition for method 10 of type menu-center-screen-graphic-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-center-screen-graphic-option ((obj menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-center-screen-graphic-option ((this menu-center-screen-graphic-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) (set! f30-0 0.0) @@ -7173,7 +7173,7 @@ ) ) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) ) ) @@ -7183,7 +7183,7 @@ ;; definition for method 10 of type menu-restart-mission-qr-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-restart-mission-qr-option ((obj menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-restart-mission-qr-option ((this menu-restart-mission-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-11 string)) (let ((f0-1 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f0-1 0.0) @@ -7203,7 +7203,7 @@ (set! (-> a0-2 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 50 f0-1) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 25.0) (let ((v1-17 arg1)) (set! (-> v1-17 scale) 0.6) @@ -7234,7 +7234,7 @@ (if (and (= (-> arg0 option-index) arg2) (zero? (-> *progress-state* qr-options-item-selected))) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 26 f0-1) ) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) *temp-string* ) ) @@ -7248,7 +7248,7 @@ ;; definition for method 10 of type menu-quit-qr-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-quit-qr-option ((obj menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-quit-qr-option ((this menu-quit-qr-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (a0-12 string)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (if (< f30-0 0.0) @@ -7268,7 +7268,7 @@ (set! (-> a0-3 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 50 f30-0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (+! (-> arg1 origin y) 25.0) (let ((v1-18 arg1)) (set! (-> v1-18 scale) 0.6) @@ -7299,7 +7299,7 @@ (if (and (= (-> arg0 option-index) arg2) (= (-> *progress-state* qr-options-item-selected) 1)) (draw-highlight (the int (+ -2.0 (-> arg1 origin y))) 26 f30-0) ) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) *temp-string* ) ) @@ -7308,13 +7308,13 @@ (print-game-text a0-12 arg1 #f 44 (bucket-id progress)) (cond ((= (-> *setting-control* user-default language) (language-enum french)) - (draw-decoration obj arg1 f30-0 (text-id progress-restart-quit) #f 0.8) + (draw-decoration this arg1 f30-0 (text-id progress-restart-quit) #f 0.8) ) ((= (-> *setting-control* user-default language) (language-enum german)) - (draw-decoration obj arg1 f30-0 (text-id progress-restart-quit) #f 0.7) + (draw-decoration this arg1 f30-0 (text-id progress-restart-quit) #f 0.7) ) (else - (draw-decoration obj arg1 f30-0 (text-id progress-restart-quit) #f 0.95) + (draw-decoration this arg1 f30-0 (text-id progress-restart-quit) #f 0.95) ) ) ) @@ -7325,7 +7325,7 @@ ;; definition for method 10 of type menu-slider-option ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-slider-option ((this menu-slider-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (v0-42 pointer) (sv-16 progress) @@ -7427,14 +7427,14 @@ (set! (-> s5-0 origin x) (the float sv-48)) (cond (sv-32 - (set! sv-128 (-> obj value-to-modify)) + (set! sv-128 (-> this value-to-modify)) (+! (-> s5-0 origin y) -8.0) (let ((a0-12 s5-0)) (set! (-> a0-12 color) (font-color progress-force-selected)) ) (draw-highlight (the int (+ -2.0 (-> s5-0 origin y))) 52 f30-0) (set! sv-144 print-game-text) - (let ((a0-15 (lookup-text! *common-text* (-> obj name) #f)) + (let ((a0-15 (lookup-text! *common-text* (-> this name) #f)) (a1-3 s5-0) (a2-3 #f) (a3-1 44) @@ -7459,61 +7459,61 @@ (shr (shl (the int (* 128.0 f30-0)) 56) 32) ) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) - (set! (-> obj sprites 0 scale-x) f28-0) - (set! (-> obj sprites 0 scale-y) 0.7) - (let ((v1-57 (-> obj sprites 0 color2))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) + (set! (-> this sprites 0 scale-x) f28-0) + (set! (-> this sprites 0 scale-y) 0.7) + (let ((v1-57 (-> this sprites 0 color2))) (set! (-> v1-57 0) 128) (set! (-> v1-57 1) 128) (set! (-> v1-57 2) 128) (set! (-> v1-57 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 0 pos z) #x3fffff) - (set! (-> obj sprites 0 pos w) 0) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) - (set! (-> obj sprites 1 scale-x) 0.2) - (set! (-> obj sprites 1 scale-y) 1.33) - (let ((v1-62 (-> obj sprites 1 color2))) + (set! (-> this sprites 0 pos z) #x3fffff) + (set! (-> this sprites 0 pos w) 0) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) + (set! (-> this sprites 1 scale-x) 0.2) + (set! (-> this sprites 1 scale-y) 1.33) + (let ((v1-62 (-> this sprites 1 color2))) (set! (-> v1-62 0) 128) (set! (-> v1-62 1) 128) (set! (-> v1-62 2) 128) (set! (-> v1-62 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 1 pos z) #x3fffff) - (set! (-> obj sprites 1 pos w) 0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) - (set! (-> obj sprites 2 scale-x) 1.0) - (set! (-> obj sprites 2 scale-y) 1.0) - (let ((v1-67 (-> obj sprites 2 color2))) + (set! (-> this sprites 1 pos z) #x3fffff) + (set! (-> this sprites 1 pos w) 0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) + (set! (-> this sprites 2 scale-x) 1.0) + (set! (-> this sprites 2 scale-y) 1.0) + (let ((v1-67 (-> this sprites 2 color2))) (set! (-> v1-67 0) sv-80) (set! (-> v1-67 1) sv-96) (set! (-> v1-67 2) sv-112) (set! (-> v1-67 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 2 pos w) 0) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.0) - (let ((v1-72 (-> obj sprites 3 color2))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 2 pos w) 0) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (let ((v1-72 (-> this sprites 3 color2))) (set! (-> v1-72 0) sv-80) (set! (-> v1-72 1) sv-96) (set! (-> v1-72 2) sv-112) (set! (-> v1-72 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 3 pos z) #xffffff) - (set! (-> obj sprites 3 pos w) 0) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) + (set! (-> this sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) s1-0 s2-0) (set-hud-piece-position! - (-> obj sprites 1) + (-> this sprites 1) (+ s1-0 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) (+ s2-0 -4) ) - (set-hud-piece-position! (-> obj sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) - (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) + (set-hud-piece-position! (-> this sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) + (set-hud-piece-position! (-> this sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) (set! sv-176 (-> *display* frames (-> *display* on-screen) global-buf)) (set! sv-192 (-> sv-176 base)) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) sv-176 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) sv-176 (-> *level* default-level)) (draw-sprite2d-xy sv-176 (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) @@ -7522,9 +7522,9 @@ 9 (the-as rgba sv-160) ) - (draw (-> obj sprites 1) sv-176 (-> *level* default-level)) - (draw (-> obj sprites 2) sv-176 (-> *level* default-level)) - (draw (-> obj sprites 3) sv-176 (-> *level* default-level)) + (draw (-> this sprites 1) sv-176 (-> *level* default-level)) + (draw (-> this sprites 2) sv-176 (-> *level* default-level)) + (draw (-> this sprites 3) sv-176 (-> *level* default-level)) (let ((a3-6 (-> sv-176 base))) (let ((v1-100 (the-as object (-> sv-176 base)))) (set! (-> (the-as dma-packet v1-100) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -7552,7 +7552,7 @@ ) ) (else - (set! sv-208 (-> obj value-to-modify)) + (set! sv-208 (-> this value-to-modify)) (+! (-> s5-0 origin y) -8.0) (when (or (= (-> *setting-control* user-default language) (language-enum german)) (= (-> *setting-control* user-default language) (language-enum french)) @@ -7565,7 +7565,7 @@ (draw-highlight (the int (+ -2.0 (-> s5-0 origin y))) 24 f30-0) ) (set! sv-224 print-game-text) - (let ((a0-81 (lookup-text! *common-text* (-> obj name) #f)) + (let ((a0-81 (lookup-text! *common-text* (-> this name) #f)) (a1-21 s5-0) (a2-18 #f) (a3-8 44) @@ -7590,61 +7590,61 @@ (shr (shl (the int (* 128.0 f30-0)) 56) 32) ) ) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) - (set! (-> obj sprites 0 scale-x) f28-0) - (set! (-> obj sprites 0 scale-y) 0.7) - (let ((v1-140 (-> obj sprites 0 color2))) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) + (set! (-> this sprites 0 scale-x) f28-0) + (set! (-> this sprites 0 scale-y) 0.7) + (let ((v1-140 (-> this sprites 0 color2))) (set! (-> v1-140 0) 128) (set! (-> v1-140 1) 128) (set! (-> v1-140 2) 128) (set! (-> v1-140 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 0 pos z) #x3fffff) - (set! (-> obj sprites 0 pos w) 0) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) - (set! (-> obj sprites 1 scale-x) 0.2) - (set! (-> obj sprites 1 scale-y) 1.33) - (let ((v1-145 (-> obj sprites 1 color2))) + (set! (-> this sprites 0 pos z) #x3fffff) + (set! (-> this sprites 0 pos w) 0) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) + (set! (-> this sprites 1 scale-x) 0.2) + (set! (-> this sprites 1 scale-y) 1.33) + (let ((v1-145 (-> this sprites 1 color2))) (set! (-> v1-145 0) 128) (set! (-> v1-145 1) 128) (set! (-> v1-145 2) 128) (set! (-> v1-145 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 1 pos z) #x3fffff) - (set! (-> obj sprites 1 pos w) 0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) - (set! (-> obj sprites 2 scale-x) 1.0) - (set! (-> obj sprites 2 scale-y) 1.0) - (let ((v1-150 (-> obj sprites 2 color2))) + (set! (-> this sprites 1 pos z) #x3fffff) + (set! (-> this sprites 1 pos w) 0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) + (set! (-> this sprites 2 scale-x) 1.0) + (set! (-> this sprites 2 scale-y) 1.0) + (let ((v1-150 (-> this sprites 2 color2))) (set! (-> v1-150 0) sv-80) (set! (-> v1-150 1) sv-96) (set! (-> v1-150 2) sv-112) (set! (-> v1-150 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 2 pos w) 0) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.0) - (let ((v1-155 (-> obj sprites 3 color2))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 2 pos w) 0) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (let ((v1-155 (-> this sprites 3 color2))) (set! (-> v1-155 0) sv-80) (set! (-> v1-155 1) sv-96) (set! (-> v1-155 2) sv-112) (set! (-> v1-155 3) (the int (* 128.0 f30-0))) ) - (set! (-> obj sprites 3 pos z) #xffffff) - (set! (-> obj sprites 3 pos w) 0) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) + (set! (-> this sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 pos w) 0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) s1-0 s2-0) (set-hud-piece-position! - (-> obj sprites 1) + (-> this sprites 1) (+ s1-0 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) (+ s2-0 -4) ) - (set-hud-piece-position! (-> obj sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) - (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) + (set-hud-piece-position! (-> this sprites 2) (- s1-0 sv-64) (+ s2-0 -4)) + (set-hud-piece-position! (-> this sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) (set! sv-256 (-> *display* frames (-> *display* on-screen) global-buf)) (set! sv-272 (-> sv-256 base)) - ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) sv-256 (-> *level* default-level)) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> this sprites)) sv-256 (-> *level* default-level)) (draw-sprite2d-xy sv-256 (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) @@ -7653,9 +7653,9 @@ 9 (the-as rgba sv-240) ) - (draw (-> obj sprites 1) sv-256 (-> *level* default-level)) - (draw (-> obj sprites 2) sv-256 (-> *level* default-level)) - (draw (-> obj sprites 3) sv-256 (-> *level* default-level)) + (draw (-> this sprites 1) sv-256 (-> *level* default-level)) + (draw (-> this sprites 2) sv-256 (-> *level* default-level)) + (draw (-> this sprites 3) sv-256 (-> *level* default-level)) (let ((a3-13 (-> sv-256 base))) (let ((v1-183 (the-as object (-> sv-256 base)))) (set! (-> (the-as dma-packet v1-183) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -7684,7 +7684,7 @@ ) ) (if (zero? gp-0) - (draw-sound-options-decoration obj s5-0 f30-0 (text-id progress-root-sound-options) #f) + (draw-sound-options-decoration this s5-0 f30-0 (text-id progress-root-sound-options) #f) ) ) ) @@ -7698,7 +7698,7 @@ ;; definition for method 10 of type menu-stereo-mode-sound-option ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-stereo-mode-sound-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (s5-0 int)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition))))) (let ((v1-2 arg1)) @@ -7732,7 +7732,7 @@ ) (draw-highlight (the int (+ -1.0 (-> arg1 origin y))) 42 f30-0) (let ((s3-1 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) (s3-1 *temp-string* arg1 #f 44 (bucket-id progress)) ) (+! (-> arg1 origin y) 22.0) @@ -7779,7 +7779,7 @@ (set! (-> v1-37 scale) 0.65) ) (let ((s3-4 print-game-text)) - (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> obj name) #f)) + (format (clear *temp-string*) "~S" (lookup-text! *common-text* (-> this name) #f)) (s3-4 *temp-string* arg1 #f 44 (bucket-id progress)) ) (let ((v1-39 arg1)) @@ -7806,7 +7806,7 @@ ;; definition for method 10 of type menu-sub-menu-option ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-option menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) +(defmethod draw-option menu-sub-menu-option ((this menu-sub-menu-option) (arg0 progress) (arg1 font-context) (arg2 int) (arg3 symbol)) (local-vars (sv-16 dma-buffer)) (let ((f30-0 (* 2.0 (- 0.5 (-> arg0 menu-transition)))) (s2-0 (the int (+ -1.0 (-> arg1 origin y)))) @@ -7843,7 +7843,7 @@ (+! s2-0 -28) ) ) - (when (nonzero? (-> obj name)) + (when (nonzero? (-> this name)) (let ((s0-0 arg1)) (set! (-> s0-0 color) (if (= arg2 (-> arg0 option-index)) (the-as font-color (the-as int (progress-selected 0))) @@ -7863,8 +7863,8 @@ ) ) ) - (if (and (and (= arg2 (-> arg0 option-index)) (!= 298 (-> obj name))) - (not (and (= (-> obj name) (text-id progress-root-secrets)) + (if (and (and (= arg2 (-> arg0 option-index)) (!= 298 (-> this name))) + (not (and (= (-> this name) (text-id progress-root-secrets)) (= *title* (-> arg0 current-options)) (not (memcard-unlocked-secrets? #f)) (= (-> arg0 option-index) 3) @@ -7876,7 +7876,7 @@ (cond ((= *save-options-title* (-> arg0 current-options)) (cond - ((= (-> obj name) (text-id progress-continue-without-saving)) + ((= (-> this name) (text-id progress-continue-without-saving)) (cond ((= arg2 (-> arg0 option-index)) (let ((v1-39 arg1)) @@ -7904,7 +7904,7 @@ ) ) (set! (-> arg1 height) 260.0) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) (when (= arg2 (-> arg0 option-index)) (let ((s4-1 69) (s2-4 110) @@ -7944,16 +7944,16 @@ ) ) ) - (set-vector! (-> obj box 0 color) 64 128 128 (the int (* 128.0 f30-0))) + (set-vector! (-> this box 0 color) 64 128 128 (the int (* 128.0 f30-0))) (draw-savegame-box - obj + this (the float s4-1) (the float (+ s4-1 s3-1)) (the float (+ s2-4 (* s1-1 arg2))) (the float (+ s2-4 (* s1-1 arg2))) ) (draw-savegame-box - obj + this (the float (+ s4-1 s3-1)) (the float (+ s4-1 s3-1)) (the float s2-4) @@ -7983,16 +7983,16 @@ ((= *load-save-options* (-> arg0 current-options)) (+! (-> arg1 origin x) -100.0) (+! (-> arg1 origin y) -25.0) - (print-menu-text (lookup-text! *common-text* (-> obj name) #f) (-> obj scale) arg1 arg0) + (print-menu-text (lookup-text! *common-text* (-> this name) #f) (-> this scale) arg1 arg0) ) ((and (= *title* (-> arg0 current-options)) - (= (text-id progress-root-secrets) (-> obj name)) + (= (text-id progress-root-secrets) (-> this name)) (memcard-unlocked-secrets? #f) ) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) - ((!= (-> obj name) (text-id progress-root-secrets)) - (print-game-text (lookup-text! *common-text* (-> obj name) #f) arg1 #f 44 (bucket-id progress)) + ((!= (-> this name) (text-id progress-root-secrets)) + (print-game-text (lookup-text! *common-text* (-> this name) #f) arg1 #f 44 (bucket-id progress)) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc index f3e75feac3..c0487a02a6 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc @@ -51,41 +51,41 @@ ) ;; definition for method 3 of type progress -(defmethod inspect progress ((obj progress)) - (when (not obj) - (set! obj obj) +(defmethod inspect progress ((this progress)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcurrent-options: ~A~%" (-> obj current-options)) - (format #t "~2Tmenu-transition: ~f~%" (-> obj menu-transition)) - (format #t "~2Toption-index: ~D~%" (-> obj option-index)) - (format #t "~2Twant-option-index: ~D~%" (-> obj want-option-index)) - (format #t "~2Tnext-option-index: ~D~%" (-> obj next-option-index)) - (format #t "~2Tgraphic-index: ~D~%" (-> obj graphic-index)) - (format #t "~2Tselected-option: ~A~%" (-> obj selected-option)) - (format #t "~2Tcurrent: ~A~%" (-> obj current)) - (format #t "~2Tnext: ~A~%" (-> obj next)) - (format #t "~2Tring-angle: ~f~%" (-> obj ring-angle)) - (format #t "~2Tring-want-angle: ~f~%" (-> obj ring-want-angle)) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Tpos-transition: ~f~%" (-> obj pos-transition)) - (format #t "~2Tanim-frame: ~f~%" (-> obj anim-frame)) - (format #t "~2Tswing: ~f~%" (-> obj swing)) - (format #t "~2Tmain-menu: ~A~%" (-> obj main-menu)) - (format #t "~2Tstate-stack[5] @ #x~X~%" (-> obj state-stack)) - (format #t "~2Toption-index-stack[5] @ #x~X~%" (-> obj option-index-stack)) - (format #t "~2Tstate-pos: ~D~%" (-> obj state-pos)) - (format #t "~2Tsecret-buying: ~A~%" (-> obj secret-buying)) - (format #t "~2Tsecret-buy-choice: ~A~%" (-> obj secret-buy-choice)) - (format #t "~2Tsliding: ~f~%" (-> obj sliding)) - (format #t "~2Tsliding-off: ~f~%" (-> obj sliding-off)) - (format #t "~2Tscanlines-alpha: ~f~%" (-> obj scanlines-alpha)) - (format #t "~2Tsliding-height: ~f~%" (-> obj sliding-height)) + (format #t "~2Tcurrent-options: ~A~%" (-> this current-options)) + (format #t "~2Tmenu-transition: ~f~%" (-> this menu-transition)) + (format #t "~2Toption-index: ~D~%" (-> this option-index)) + (format #t "~2Twant-option-index: ~D~%" (-> this want-option-index)) + (format #t "~2Tnext-option-index: ~D~%" (-> this next-option-index)) + (format #t "~2Tgraphic-index: ~D~%" (-> this graphic-index)) + (format #t "~2Tselected-option: ~A~%" (-> this selected-option)) + (format #t "~2Tcurrent: ~A~%" (-> this current)) + (format #t "~2Tnext: ~A~%" (-> this next)) + (format #t "~2Tring-angle: ~f~%" (-> this ring-angle)) + (format #t "~2Tring-want-angle: ~f~%" (-> this ring-want-angle)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tpos-transition: ~f~%" (-> this pos-transition)) + (format #t "~2Tanim-frame: ~f~%" (-> this anim-frame)) + (format #t "~2Tswing: ~f~%" (-> this swing)) + (format #t "~2Tmain-menu: ~A~%" (-> this main-menu)) + (format #t "~2Tstate-stack[5] @ #x~X~%" (-> this state-stack)) + (format #t "~2Toption-index-stack[5] @ #x~X~%" (-> this option-index-stack)) + (format #t "~2Tstate-pos: ~D~%" (-> this state-pos)) + (format #t "~2Tsecret-buying: ~A~%" (-> this secret-buying)) + (format #t "~2Tsecret-buy-choice: ~A~%" (-> this secret-buy-choice)) + (format #t "~2Tsliding: ~f~%" (-> this sliding)) + (format #t "~2Tsliding-off: ~f~%" (-> this sliding-off)) + (format #t "~2Tscanlines-alpha: ~f~%" (-> this scanlines-alpha)) + (format #t "~2Tsliding-height: ~f~%" (-> this sliding-height)) (label cfg-4) - obj + this ) ;; definition of type menu-option @@ -107,17 +107,17 @@ ) ;; definition for method 3 of type menu-option -(defmethod inspect menu-option ((obj menu-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-option ((this menu-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-on-off-option @@ -130,18 +130,18 @@ ) ;; definition for method 3 of type menu-on-off-option -(defmethod inspect menu-on-off-option ((obj menu-on-off-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-on-off-option ((this menu-on-off-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) (label cfg-4) - obj + this ) ;; definition of type menu-yes-no-option @@ -154,18 +154,18 @@ ) ;; definition for method 3 of type menu-yes-no-option -(defmethod inspect menu-yes-no-option ((obj menu-yes-no-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-yes-no-option ((this menu-yes-no-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) (label cfg-4) - obj + this ) ;; definition of type menu-language-option @@ -181,21 +181,21 @@ ) ;; definition for method 3 of type menu-language-option -(defmethod inspect menu-language-option ((obj menu-language-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-language-option ((this menu-language-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlanguage-selection: ~D~%" (-> obj language-selection)) - (format #t "~1Tlanguage-direction: ~A~%" (-> obj language-direction)) - (format #t "~1Tlanguage-transition: ~A~%" (-> obj language-transition)) - (format #t "~1Tlanguage-x-offset: ~D~%" (-> obj language-x-offset)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlanguage-selection: ~D~%" (-> this language-selection)) + (format #t "~1Tlanguage-direction: ~A~%" (-> this language-direction)) + (format #t "~1Tlanguage-transition: ~A~%" (-> this language-transition)) + (format #t "~1Tlanguage-x-offset: ~D~%" (-> this language-x-offset)) (label cfg-4) - obj + this ) ;; definition of type menu-quit-option @@ -207,17 +207,17 @@ ) ;; definition for method 3 of type menu-quit-option -(defmethod inspect menu-quit-option ((obj menu-quit-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-quit-option ((this menu-quit-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-slider-option @@ -231,19 +231,19 @@ ) ;; definition for method 3 of type menu-slider-option -(defmethod inspect menu-slider-option ((obj menu-slider-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-slider-option ((this menu-slider-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) - (format #t "~1Tsprites[5] @ #x~X~%" (-> obj sprites)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) + (format #t "~1Tsprites[5] @ #x~X~%" (-> this sprites)) (label cfg-4) - obj + this ) ;; definition of type menu-sub-menu-option @@ -257,19 +257,19 @@ ) ;; definition for method 3 of type menu-sub-menu-option -(defmethod inspect menu-sub-menu-option ((obj menu-sub-menu-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-sub-menu-option ((this menu-sub-menu-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-sub-menu-sound-option @@ -282,18 +282,18 @@ ) ;; definition for method 3 of type menu-sub-menu-sound-option -(defmethod inspect menu-sub-menu-sound-option ((obj menu-sub-menu-sound-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-sub-menu-sound-option ((this menu-sub-menu-sound-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) (label cfg-4) - obj + this ) ;; definition of type menu-stereo-mode-sound-option @@ -305,17 +305,17 @@ ) ;; definition for method 3 of type menu-stereo-mode-sound-option -(defmethod inspect menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-stereo-mode-sound-option ((this menu-stereo-mode-sound-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-sub-menu-graphic-option @@ -328,18 +328,18 @@ ) ;; definition for method 3 of type menu-sub-menu-graphic-option -(defmethod inspect menu-sub-menu-graphic-option ((obj menu-sub-menu-graphic-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-sub-menu-graphic-option ((this menu-sub-menu-graphic-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) (label cfg-4) - obj + this ) ;; definition of type menu-unlocked-menu-option @@ -351,19 +351,19 @@ ) ;; definition for method 3 of type menu-unlocked-menu-option -(defmethod inspect menu-unlocked-menu-option ((obj menu-unlocked-menu-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-unlocked-menu-option ((this menu-unlocked-menu-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-main-menu-option @@ -376,18 +376,18 @@ ) ;; definition for method 3 of type menu-main-menu-option -(defmethod inspect menu-main-menu-option ((obj menu-main-menu-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-main-menu-option ((this menu-main-menu-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) (label cfg-4) - obj + this ) ;; definition of type menu-memcard-slot-option @@ -401,19 +401,19 @@ ) ;; definition for method 3 of type menu-memcard-slot-option -(defmethod inspect menu-memcard-slot-option ((obj menu-memcard-slot-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-memcard-slot-option ((this menu-memcard-slot-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tsprites[5] @ #x~X~%" (-> obj sprites)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tsprites[5] @ #x~X~%" (-> this sprites)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-loading-option @@ -425,17 +425,17 @@ ) ;; definition for method 3 of type menu-loading-option -(defmethod inspect menu-loading-option ((obj menu-loading-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-loading-option ((this menu-loading-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-insufficient-space-option @@ -448,18 +448,18 @@ ) ;; definition for method 3 of type menu-insufficient-space-option -(defmethod inspect menu-insufficient-space-option ((obj menu-insufficient-space-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-insufficient-space-option ((this menu-insufficient-space-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) (label cfg-4) - obj + this ) ;; definition of type menu-secrets-insufficient-space-option @@ -471,17 +471,17 @@ ) ;; definition for method 3 of type menu-secrets-insufficient-space-option -(defmethod inspect menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-secrets-insufficient-space-option ((this menu-secrets-insufficient-space-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-insert-card-option @@ -493,17 +493,17 @@ ) ;; definition for method 3 of type menu-insert-card-option -(defmethod inspect menu-insert-card-option ((obj menu-insert-card-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-insert-card-option ((this menu-insert-card-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-error-loading-option @@ -515,17 +515,17 @@ ) ;; definition for method 3 of type menu-error-loading-option -(defmethod inspect menu-error-loading-option ((obj menu-error-loading-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-error-loading-option ((this menu-error-loading-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-error-auto-saving-option @@ -537,17 +537,17 @@ ) ;; definition for method 3 of type menu-error-auto-saving-option -(defmethod inspect menu-error-auto-saving-option ((obj menu-error-auto-saving-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-error-auto-saving-option ((this menu-error-auto-saving-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-card-removed-option @@ -559,17 +559,17 @@ ) ;; definition for method 3 of type menu-card-removed-option -(defmethod inspect menu-card-removed-option ((obj menu-card-removed-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-card-removed-option ((this menu-card-removed-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-error-disc-removed-option @@ -581,17 +581,17 @@ ) ;; definition for method 3 of type menu-error-disc-removed-option -(defmethod inspect menu-error-disc-removed-option ((obj menu-error-disc-removed-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-error-disc-removed-option ((this menu-error-disc-removed-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-error-reading-option @@ -603,17 +603,17 @@ ) ;; definition for method 3 of type menu-error-reading-option -(defmethod inspect menu-error-reading-option ((obj menu-error-reading-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-error-reading-option ((this menu-error-reading-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-icon-info-option @@ -626,18 +626,18 @@ ) ;; definition for method 3 of type menu-icon-info-option -(defmethod inspect menu-icon-info-option ((obj menu-icon-info-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-icon-info-option ((this menu-icon-info-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tsprites[2] @ #x~X~%" (-> obj sprites)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tsprites[2] @ #x~X~%" (-> this sprites)) (label cfg-4) - obj + this ) ;; definition of type menu-format-card-option @@ -649,17 +649,17 @@ ) ;; definition for method 3 of type menu-format-card-option -(defmethod inspect menu-format-card-option ((obj menu-format-card-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-format-card-option ((this menu-format-card-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-already-exists-option @@ -671,17 +671,17 @@ ) ;; definition for method 3 of type menu-already-exists-option -(defmethod inspect menu-already-exists-option ((obj menu-already-exists-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-already-exists-option ((this menu-already-exists-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-create-game-option @@ -693,17 +693,17 @@ ) ;; definition for method 3 of type menu-create-game-option -(defmethod inspect menu-create-game-option ((obj menu-create-game-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-create-game-option ((this menu-create-game-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-video-mode-warning-option @@ -715,17 +715,17 @@ ) ;; definition for method 3 of type menu-video-mode-warning-option -(defmethod inspect menu-video-mode-warning-option ((obj menu-video-mode-warning-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-video-mode-warning-option ((this menu-video-mode-warning-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-video-mode-ok-option @@ -737,17 +737,17 @@ ) ;; definition for method 3 of type menu-video-mode-ok-option -(defmethod inspect menu-video-mode-ok-option ((obj menu-video-mode-ok-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-video-mode-ok-option ((this menu-video-mode-ok-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-progressive-mode-warning-option @@ -759,17 +759,17 @@ ) ;; definition for method 3 of type menu-progressive-mode-warning-option -(defmethod inspect menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-progressive-mode-warning-option ((this menu-progressive-mode-warning-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-progressive-mode-ok-option @@ -781,17 +781,17 @@ ) ;; definition for method 3 of type menu-progressive-mode-ok-option -(defmethod inspect menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-progressive-mode-ok-option ((this menu-progressive-mode-ok-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type menu-select-start-option @@ -806,20 +806,20 @@ ) ;; definition for method 3 of type menu-select-start-option -(defmethod inspect menu-select-start-option ((obj menu-select-start-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-select-start-option ((this menu-select-start-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Ttask-index: ~D~%" (-> obj task-index)) - (format #t "~1Treal-task-index: ~D~%" (-> obj real-task-index)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Ttask-index: ~D~%" (-> this task-index)) + (format #t "~1Treal-task-index: ~D~%" (-> this real-task-index)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) (label cfg-4) - obj + this ) ;; definition of type menu-select-scene-option @@ -833,19 +833,19 @@ ) ;; definition for method 3 of type menu-select-scene-option -(defmethod inspect menu-select-scene-option ((obj menu-select-scene-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-select-scene-option ((this menu-select-scene-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Ttask-index: ~D~%" (-> obj task-index)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Ttask-index: ~D~%" (-> this task-index)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) (label cfg-4) - obj + this ) ;; definition of type menu-bigmap-option @@ -857,17 +857,17 @@ ) ;; definition for method 3 of type menu-bigmap-option -(defmethod inspect menu-bigmap-option ((obj menu-bigmap-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-bigmap-option ((this menu-bigmap-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) (label cfg-4) - obj + this ) ;; definition of type paged-menu-option @@ -883,21 +883,21 @@ ) ;; definition for method 3 of type paged-menu-option -(defmethod inspect paged-menu-option ((obj paged-menu-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect paged-menu-option ((this paged-menu-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tpage-index: ~D~%" (-> obj page-index)) - (format #t "~1Tprev-page-index: ~D~%" (-> obj prev-page-index)) - (format #t "~1Tnum-pages: ~D~%" (-> obj num-pages)) - (format #t "~1Tslide-dir: ~f~%" (-> obj slide-dir)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tpage-index: ~D~%" (-> this page-index)) + (format #t "~1Tprev-page-index: ~D~%" (-> this prev-page-index)) + (format #t "~1Tnum-pages: ~D~%" (-> this num-pages)) + (format #t "~1Tslide-dir: ~f~%" (-> this slide-dir)) (label cfg-4) - obj + this ) ;; definition of type menu-missions-option @@ -911,23 +911,23 @@ ) ;; definition for method 3 of type menu-missions-option -(defmethod inspect menu-missions-option ((obj menu-missions-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-missions-option ((this menu-missions-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tpage-index: ~D~%" (-> obj page-index)) - (format #t "~1Tprev-page-index: ~D~%" (-> obj prev-page-index)) - (format #t "~1Tnum-pages: ~D~%" (-> obj num-pages)) - (format #t "~1Tslide-dir: ~f~%" (-> obj slide-dir)) - (format #t "~1Ttask-line-index: ~D~%" (-> obj task-line-index)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tpage-index: ~D~%" (-> this page-index)) + (format #t "~1Tprev-page-index: ~D~%" (-> this prev-page-index)) + (format #t "~1Tnum-pages: ~D~%" (-> this num-pages)) + (format #t "~1Tslide-dir: ~f~%" (-> this slide-dir)) + (format #t "~1Ttask-line-index: ~D~%" (-> this task-line-index)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) (label cfg-4) - obj + this ) ;; definition of type menu-highscores-option @@ -941,23 +941,23 @@ ) ;; definition for method 3 of type menu-highscores-option -(defmethod inspect menu-highscores-option ((obj menu-highscores-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-highscores-option ((this menu-highscores-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tpage-index: ~D~%" (-> obj page-index)) - (format #t "~1Tprev-page-index: ~D~%" (-> obj prev-page-index)) - (format #t "~1Tnum-pages: ~D~%" (-> obj num-pages)) - (format #t "~1Tslide-dir: ~f~%" (-> obj slide-dir)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tsprites[2] @ #x~X~%" (-> obj sprites)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tpage-index: ~D~%" (-> this page-index)) + (format #t "~1Tprev-page-index: ~D~%" (-> this prev-page-index)) + (format #t "~1Tnum-pages: ~D~%" (-> this num-pages)) + (format #t "~1Tslide-dir: ~f~%" (-> this slide-dir)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tsprites[2] @ #x~X~%" (-> this sprites)) (label cfg-4) - obj + this ) ;; definition of type secret-item-option @@ -973,21 +973,21 @@ ) ;; definition for method 3 of type secret-item-option -(defmethod inspect secret-item-option ((obj secret-item-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect secret-item-option ((this secret-item-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tcost: ~D~%" (-> obj cost)) - (format #t "~1Tcan-toggle: ~A~%" (-> obj can-toggle)) - (format #t "~1Tflag: ~D~%" (-> obj flag)) - (format #t "~1Tavail-after: ~D~%" (-> obj avail-after)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tcost: ~D~%" (-> this cost)) + (format #t "~1Tcan-toggle: ~A~%" (-> this can-toggle)) + (format #t "~1Tflag: ~D~%" (-> this flag)) + (format #t "~1Tavail-after: ~D~%" (-> this avail-after)) (label cfg-4) - obj + this ) ;; definition of type menu-secret-option @@ -1006,24 +1006,24 @@ ) ;; definition for method 3 of type menu-secret-option -(defmethod inspect menu-secret-option ((obj menu-secret-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-secret-option ((this menu-secret-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Titem-index: ~D~%" (-> obj item-index)) - (format #t "~1Tprev-item-index: ~D~%" (-> obj prev-item-index)) - (format #t "~1Tnum-items: ~D~%" (-> obj num-items)) - (format #t "~1Tnum-hero-items: ~D~%" (-> obj num-hero-items)) - (format #t "~1Tsecret-items: ~A~%" (-> obj secret-items)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tsprites[2] @ #x~X~%" (-> obj sprites)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Titem-index: ~D~%" (-> this item-index)) + (format #t "~1Tprev-item-index: ~D~%" (-> this prev-item-index)) + (format #t "~1Tnum-items: ~D~%" (-> this num-items)) + (format #t "~1Tnum-hero-items: ~D~%" (-> this num-hero-items)) + (format #t "~1Tsecret-items: ~A~%" (-> this secret-items)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tsprites[2] @ #x~X~%" (-> this sprites)) (label cfg-4) - obj + this ) ;; definition of type menu-option-list @@ -1039,18 +1039,18 @@ ) ;; definition for method 3 of type menu-option-list -(defmethod inspect menu-option-list ((obj menu-option-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-option-list ((this menu-option-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Ty-center: ~D~%" (-> obj y-center)) - (format #t "~1Ty-space: ~D~%" (-> obj y-space)) - (format #t "~1Tscale: ~f~%" (-> obj scale)) - (format #t "~1Toptions: ~A~%" (-> obj options)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Ty-center: ~D~%" (-> this y-center)) + (format #t "~1Ty-space: ~D~%" (-> this y-space)) + (format #t "~1Tscale: ~f~%" (-> this scale)) + (format #t "~1Toptions: ~A~%" (-> this options)) (label cfg-4) - obj + this ) ;; definition of type menu-qr-option @@ -1064,20 +1064,20 @@ ) ;; definition for method 3 of type menu-qr-option -(defmethod inspect menu-qr-option ((obj menu-qr-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-qr-option ((this menu-qr-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) (label cfg-4) - obj + this ) ;; definition of type menu-restart-mission-qr-option @@ -1090,21 +1090,21 @@ ) ;; definition for method 3 of type menu-restart-mission-qr-option -(defmethod inspect menu-restart-mission-qr-option ((obj menu-restart-mission-qr-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-restart-mission-qr-option ((this menu-restart-mission-qr-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) (label cfg-4) - obj + this ) ;; definition of type menu-quit-qr-option @@ -1117,21 +1117,21 @@ ) ;; definition for method 3 of type menu-quit-qr-option -(defmethod inspect menu-quit-qr-option ((obj menu-quit-qr-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-quit-qr-option ((this menu-quit-qr-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) (label cfg-4) - obj + this ) ;; definition of type menu-sub-menu-qr-option @@ -1144,21 +1144,21 @@ ) ;; definition for method 3 of type menu-sub-menu-qr-option -(defmethod inspect menu-sub-menu-qr-option ((obj menu-sub-menu-qr-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-sub-menu-qr-option ((this menu-sub-menu-qr-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) (label cfg-4) - obj + this ) ;; definition of type menu-graphic-option @@ -1172,20 +1172,20 @@ ) ;; definition for method 3 of type menu-graphic-option -(defmethod inspect menu-graphic-option ((obj menu-graphic-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-graphic-option ((this menu-graphic-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) (label cfg-4) - obj + this ) ;; definition of type menu-on-off-progressive-scan-graphic-option @@ -1197,20 +1197,20 @@ ) ;; definition for method 3 of type menu-on-off-progressive-scan-graphic-option -(defmethod inspect menu-on-off-progressive-scan-graphic-option ((obj menu-on-off-progressive-scan-graphic-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-on-off-progressive-scan-graphic-option ((this menu-on-off-progressive-scan-graphic-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) (label cfg-4) - obj + this ) ;; definition of type menu-aspect-ratio-option @@ -1222,20 +1222,20 @@ ) ;; definition for method 3 of type menu-aspect-ratio-option -(defmethod inspect menu-aspect-ratio-option ((obj menu-aspect-ratio-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-aspect-ratio-option ((this menu-aspect-ratio-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) (label cfg-4) - obj + this ) ;; definition of type menu-center-screen-graphic-option @@ -1248,21 +1248,21 @@ ) ;; definition for method 3 of type menu-center-screen-graphic-option -(defmethod inspect menu-center-screen-graphic-option ((obj menu-center-screen-graphic-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-center-screen-graphic-option ((this menu-center-screen-graphic-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) (label cfg-4) - obj + this ) ;; definition of type menu-video-mode-option @@ -1274,20 +1274,20 @@ ) ;; definition for method 3 of type menu-video-mode-option -(defmethod inspect menu-video-mode-option ((obj menu-video-mode-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-video-mode-option ((this menu-video-mode-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) (label cfg-4) - obj + this ) ;; definition of type menu-game-option @@ -1301,20 +1301,20 @@ ) ;; definition for method 3 of type menu-game-option -(defmethod inspect menu-game-option ((obj menu-game-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-game-option ((this menu-game-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) (label cfg-4) - obj + this ) ;; definition of type menu-on-off-game-vibrations-option @@ -1326,20 +1326,20 @@ ) ;; definition for method 3 of type menu-on-off-game-vibrations-option -(defmethod inspect menu-on-off-game-vibrations-option ((obj menu-on-off-game-vibrations-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-on-off-game-vibrations-option ((this menu-on-off-game-vibrations-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) (label cfg-4) - obj + this ) ;; definition of type menu-on-off-game-subtitles-option @@ -1351,20 +1351,20 @@ ) ;; definition for method 3 of type menu-on-off-game-subtitles-option -(defmethod inspect menu-on-off-game-subtitles-option ((obj menu-on-off-game-subtitles-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-on-off-game-subtitles-option ((this menu-on-off-game-subtitles-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) (label cfg-4) - obj + this ) ;; definition of type menu-sub-menu-game-option @@ -1377,21 +1377,21 @@ ) ;; definition for method 3 of type menu-sub-menu-game-option -(defmethod inspect menu-sub-menu-game-option ((obj menu-sub-menu-game-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-sub-menu-game-option ((this menu-sub-menu-game-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) - (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) + (format #t "~1Tnext-state: ~A~%" (-> this next-state)) (label cfg-4) - obj + this ) ;; definition of type menu-language-game-option @@ -1407,24 +1407,24 @@ ) ;; definition for method 3 of type menu-language-game-option -(defmethod inspect menu-language-game-option ((obj menu-language-game-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-language-game-option ((this menu-language-game-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) - (format #t "~1Tlanguage-selection: ~D~%" (-> obj language-selection)) - (format #t "~1Tlanguage-direction: ~A~%" (-> obj language-direction)) - (format #t "~1Tlanguage-transition: ~A~%" (-> obj language-transition)) - (format #t "~1Tlanguage-x-offset: ~D~%" (-> obj language-x-offset)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) + (format #t "~1Tlanguage-selection: ~D~%" (-> this language-selection)) + (format #t "~1Tlanguage-direction: ~A~%" (-> this language-direction)) + (format #t "~1Tlanguage-transition: ~A~%" (-> this language-transition)) + (format #t "~1Tlanguage-x-offset: ~D~%" (-> this language-x-offset)) (label cfg-4) - obj + this ) ;; definition of type menu-subtitle-language-game-option @@ -1440,24 +1440,24 @@ ) ;; definition for method 3 of type menu-subtitle-language-game-option -(defmethod inspect menu-subtitle-language-game-option ((obj menu-subtitle-language-game-option)) - (when (not obj) - (set! obj obj) +(defmethod inspect menu-subtitle-language-game-option ((this menu-subtitle-language-game-option)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tscale: ~A~%" (-> obj scale)) - (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) - (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) - (format #t "~1Tname: ~D~%" (-> obj name)) - (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) - (format #t "~1Tlanguage-selection: ~D~%" (-> obj language-selection)) - (format #t "~1Tlanguage-direction: ~A~%" (-> obj language-direction)) - (format #t "~1Tlanguage-transition: ~A~%" (-> obj language-transition)) - (format #t "~1Tlanguage-x-offset: ~D~%" (-> obj language-x-offset)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tscale: ~A~%" (-> this scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> this box)) + (format #t "~1Tlast-move: ~D~%" (-> this last-move)) + (format #t "~1Tname: ~D~%" (-> this name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> this value-to-modify)) + (format #t "~1Tlanguage-selection: ~D~%" (-> this language-selection)) + (format #t "~1Tlanguage-direction: ~A~%" (-> this language-direction)) + (format #t "~1Tlanguage-transition: ~A~%" (-> this language-transition)) + (format #t "~1Tlanguage-x-offset: ~D~%" (-> this language-x-offset)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc index 2d5c060e5e..2deb294df5 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-static_REF.gc @@ -893,18 +893,18 @@ ) ;; definition for method 3 of type hud-scene-info -(defmethod inspect hud-scene-info ((obj hud-scene-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-scene-info ((this hud-scene-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tcontinue: ~A~%" (-> obj continue)) - (format #t "~1Tinfo: ~A~%" (-> obj info)) - (format #t "~1Ttext: ~D~%" (-> obj text)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tcontinue: ~A~%" (-> this continue)) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (format #t "~1Ttext: ~D~%" (-> this text)) (label cfg-4) - obj + this ) ;; definition for symbol *hud-select-scene-act1*, type (array hud-scene-info) 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 57635dbd20..fd8256230f 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc @@ -57,61 +57,61 @@ ) ;; definition for method 3 of type progress-global-state -(defmethod inspect progress-global-state ((obj progress-global-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect progress-global-state ((this progress-global-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Taspect-ratio-choice: ~A~%" (-> obj aspect-ratio-choice)) - (format #t "~1Tvideo-mode-choice: ~A~%" (-> obj video-mode-choice)) - (format #t "~1Tyes-no-choice: ~A~%" (-> obj yes-no-choice)) - (format #t "~1Ton-off-choice: ~A~%" (-> obj on-off-choice)) - (format #t "~1Twhich-slot: ~D~%" (-> obj which-slot)) - (format #t "~1Tstarting-state: ~A~%" (-> obj starting-state)) - (format #t "~1Tlast-slot-saved: ~D~%" (-> obj last-slot-saved)) - (format #t "~1Tslider-backup: ~f~%" (-> obj slider-backup)) - (format #t "~1Tlanguage-backup: ~D~%" (-> obj language-backup)) - (format #t "~1Tcenter-x-backup: ~D~%" (-> obj center-x-backup)) - (format #t "~1Tcenter-y-backup: ~D~%" (-> obj center-y-backup)) - (format #t "~1Taspect-ratio-backup: ~A~%" (-> obj aspect-ratio-backup)) - (format #t "~1Tlast-slider-sound: ~D~%" (-> obj last-slider-sound)) - (format #t "~1Tvideo-mode-timeout: ~D~%" (-> obj video-mode-timeout)) - (format #t "~1Tprogressive-mode-timeout: ~D~%" (-> obj progressive-mode-timeout)) - (format #t "~1Tcurrent-task-index: ~D~%" (-> obj current-task-index)) - (format #t "~1Tcurrent-line-index: ~D~%" (-> obj current-line-index)) - (format #t "~1Tfirst-closed-line-index: ~D~%" (-> obj first-closed-line-index)) - (format #t "~1Textra-text-state: ~D~%" (-> obj extra-text-state)) - (format #t "~1Tcurrent-task: ~D~%" (-> obj current-task)) - (format #t "~1Tnum-open-tasks-found: ~D~%" (-> obj num-open-tasks-found)) - (format #t "~1Tnum-closed-tasks-found: ~D~%" (-> obj num-closed-tasks-found)) - (format #t "~1Tcolor-flash-counter: ~D~%" (-> obj color-flash-counter)) - (format #t "~1Tnum-unlocked-secrets: ~D~%" (-> obj num-unlocked-secrets)) - (format #t "~1Tgame-options-item-selected: ~D~%" (-> obj game-options-item-selected)) - (format #t "~1Tgame-options-item-picked: ~A~%" (-> obj game-options-item-picked)) - (format #t "~1Tgame-options-last-move: ~D~%" (-> obj game-options-last-move)) - (format #t "~1Tgame-options-vibrations: ~A~%" (-> obj game-options-vibrations)) - (format #t "~1Tgame-options-subtitles: ~A~%" (-> obj game-options-subtitles)) - (format #t "~1Tgame-options-language-index: ~D~%" (-> obj game-options-language-index)) - (format #t "~1Tgame-options-subtitle-language-index: ~D~%" (-> obj game-options-subtitle-language-index)) - (format #t "~1Tgraphic-options-item-selected: ~D~%" (-> obj graphic-options-item-selected)) - (format #t "~1Tgraphic-options-item-picked: ~A~%" (-> obj graphic-options-item-picked)) - (format #t "~1Tgraphic-options-last-move: ~D~%" (-> obj graphic-options-last-move)) - (format #t "~1Tgraphic-options-aspect-ratio: ~A~%" (-> obj graphic-options-aspect-ratio)) - (format #t "~1Tgraphic-options-progressive-scan: ~A~%" (-> obj graphic-options-progressive-scan)) - (format #t "~1Tqr-options-item-selected: ~D~%" (-> obj qr-options-item-selected)) - (format #t "~1Tqr-options-item-picked: ~A~%" (-> obj qr-options-item-picked)) - (format #t "~1Tqr-options-last-move: ~D~%" (-> obj qr-options-last-move)) - (format #t "~1Tqr-options-restart: ~A~%" (-> obj qr-options-restart)) - (format #t "~1Tqr-options-quit: ~A~%" (-> obj qr-options-quit)) - (format #t "~1Ttotal-num-tasks: ~D~%" (-> obj total-num-tasks)) - (format #t "~1Tscene-player-act: ~D~%" (-> obj scene-player-act)) - (format #t "~1Tstereo-mode-backup: ~D~%" (-> obj stereo-mode-backup)) - (format #t "~1Tsecrets-unlocked: ~A~%" (-> obj secrets-unlocked)) - (format #t "~1Tmissions-total-spacing: ~f~%" (-> obj missions-total-spacing)) - (format #t "~1Tclear-screen: ~A~%" (-> obj clear-screen)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Taspect-ratio-choice: ~A~%" (-> this aspect-ratio-choice)) + (format #t "~1Tvideo-mode-choice: ~A~%" (-> this video-mode-choice)) + (format #t "~1Tyes-no-choice: ~A~%" (-> this yes-no-choice)) + (format #t "~1Ton-off-choice: ~A~%" (-> this on-off-choice)) + (format #t "~1Twhich-slot: ~D~%" (-> this which-slot)) + (format #t "~1Tstarting-state: ~A~%" (-> this starting-state)) + (format #t "~1Tlast-slot-saved: ~D~%" (-> this last-slot-saved)) + (format #t "~1Tslider-backup: ~f~%" (-> this slider-backup)) + (format #t "~1Tlanguage-backup: ~D~%" (-> this language-backup)) + (format #t "~1Tcenter-x-backup: ~D~%" (-> this center-x-backup)) + (format #t "~1Tcenter-y-backup: ~D~%" (-> this center-y-backup)) + (format #t "~1Taspect-ratio-backup: ~A~%" (-> this aspect-ratio-backup)) + (format #t "~1Tlast-slider-sound: ~D~%" (-> this last-slider-sound)) + (format #t "~1Tvideo-mode-timeout: ~D~%" (-> this video-mode-timeout)) + (format #t "~1Tprogressive-mode-timeout: ~D~%" (-> this progressive-mode-timeout)) + (format #t "~1Tcurrent-task-index: ~D~%" (-> this current-task-index)) + (format #t "~1Tcurrent-line-index: ~D~%" (-> this current-line-index)) + (format #t "~1Tfirst-closed-line-index: ~D~%" (-> this first-closed-line-index)) + (format #t "~1Textra-text-state: ~D~%" (-> this extra-text-state)) + (format #t "~1Tcurrent-task: ~D~%" (-> this current-task)) + (format #t "~1Tnum-open-tasks-found: ~D~%" (-> this num-open-tasks-found)) + (format #t "~1Tnum-closed-tasks-found: ~D~%" (-> this num-closed-tasks-found)) + (format #t "~1Tcolor-flash-counter: ~D~%" (-> this color-flash-counter)) + (format #t "~1Tnum-unlocked-secrets: ~D~%" (-> this num-unlocked-secrets)) + (format #t "~1Tgame-options-item-selected: ~D~%" (-> this game-options-item-selected)) + (format #t "~1Tgame-options-item-picked: ~A~%" (-> this game-options-item-picked)) + (format #t "~1Tgame-options-last-move: ~D~%" (-> this game-options-last-move)) + (format #t "~1Tgame-options-vibrations: ~A~%" (-> this game-options-vibrations)) + (format #t "~1Tgame-options-subtitles: ~A~%" (-> this game-options-subtitles)) + (format #t "~1Tgame-options-language-index: ~D~%" (-> this game-options-language-index)) + (format #t "~1Tgame-options-subtitle-language-index: ~D~%" (-> this game-options-subtitle-language-index)) + (format #t "~1Tgraphic-options-item-selected: ~D~%" (-> this graphic-options-item-selected)) + (format #t "~1Tgraphic-options-item-picked: ~A~%" (-> this graphic-options-item-picked)) + (format #t "~1Tgraphic-options-last-move: ~D~%" (-> this graphic-options-last-move)) + (format #t "~1Tgraphic-options-aspect-ratio: ~A~%" (-> this graphic-options-aspect-ratio)) + (format #t "~1Tgraphic-options-progressive-scan: ~A~%" (-> this graphic-options-progressive-scan)) + (format #t "~1Tqr-options-item-selected: ~D~%" (-> this qr-options-item-selected)) + (format #t "~1Tqr-options-item-picked: ~A~%" (-> this qr-options-item-picked)) + (format #t "~1Tqr-options-last-move: ~D~%" (-> this qr-options-last-move)) + (format #t "~1Tqr-options-restart: ~A~%" (-> this qr-options-restart)) + (format #t "~1Tqr-options-quit: ~A~%" (-> this qr-options-quit)) + (format #t "~1Ttotal-num-tasks: ~D~%" (-> this total-num-tasks)) + (format #t "~1Tscene-player-act: ~D~%" (-> this scene-player-act)) + (format #t "~1Tstereo-mode-backup: ~D~%" (-> this stereo-mode-backup)) + (format #t "~1Tsecrets-unlocked: ~A~%" (-> this secrets-unlocked)) + (format #t "~1Tmissions-total-spacing: ~f~%" (-> this missions-total-spacing)) + (format #t "~1Tclear-screen: ~A~%" (-> this clear-screen)) (label cfg-4) - obj + this ) ;; definition for symbol *progress-stack*, type (pointer uint8) @@ -158,7 +158,7 @@ ;; definition for method 24 of type progress ;; WARN: Return type mismatch connection vs object. -(defmethod init-defaults progress ((obj progress)) +(defmethod init-defaults progress ((this progress)) "Initialize default menu settings." (set! (-> *progress-state* aspect-ratio-choice) (get-aspect-ratio)) (set! (-> *progress-state* video-mode-choice) (get-video-mode)) @@ -186,10 +186,10 @@ (set! (-> *progress-state* total-num-tasks) 0) (set! (-> *progress-state* secrets-unlocked) #f) (set! (-> *progress-state* clear-screen) #f) - (set! (-> obj sliding) 0.0) - (set! (-> obj sliding-height) 0.0) - (set! (-> obj sliding-off) 1.0) - (set! (-> obj scanlines-alpha) 0.0) + (set! (-> this sliding) 0.0) + (set! (-> this sliding-height) 0.0) + (set! (-> this sliding-off) 1.0) + (set! (-> this scanlines-alpha) 0.0) (set! (-> (the-as menu-on-off-game-vibrations-option (-> *game-options* options 0)) value-to-modify) (&-> *setting-control* user-default vibration) ) @@ -244,19 +244,19 @@ ) ;; definition for method 3 of type hud-ring-cell -(defmethod inspect hud-ring-cell ((obj hud-ring-cell)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-ring-cell ((this hud-ring-cell)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tjoint-idx: ~D~%" (-> obj joint-idx)) - (format #t "~2Tinit-angle: ~f~%" (-> obj init-angle)) - (format #t "~2Tgraphic-index: ~D~%" (-> obj graphic-index)) + (format #t "~2Tjoint-idx: ~D~%" (-> this joint-idx)) + (format #t "~2Tinit-angle: ~f~%" (-> this init-angle)) + (format #t "~2Tgraphic-index: ~D~%" (-> this graphic-index)) (label cfg-4) - obj + this ) ;; definition for function hud-ring-cell-init-by-other @@ -542,7 +542,7 @@ ) ;; definition for method 10 of type progress -(defmethod deactivate progress ((obj progress)) +(defmethod deactivate progress ((this progress)) (remove-setting-by-arg0 *setting-control* 'extra-bank) (disable-drawing *bigmap*) (set! (-> *blit-displays-work* menu-mode) #f) @@ -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)) obj) + ((the-as (function progress none) (find-parent-method progress 10)) this) (none) ) @@ -575,7 +575,7 @@ ) ;; definition for method 26 of type progress -(defmethod gone? progress ((obj progress)) +(defmethod gone? progress ((this progress)) (and *progress-process* (-> *progress-process* 0 next-state) (= (-> *progress-process* 0 next-state name) 'gone) @@ -609,27 +609,27 @@ ) ;; definition for method 27 of type progress -(defmethod can-go-back? progress ((obj progress)) - (and (= (-> obj menu-transition) 0.0) - (not (-> obj selected-option)) - (!= (-> obj current) 'loading) - (!= (-> obj current) 'saving) - (!= (-> obj current) 'formatting) - (!= (-> obj current) 'creating) - (!= (-> obj current) 'error-disc-removed) - (!= (-> obj current) 'error-reading) - (!= (-> obj current) 'card-removed) - (!= (-> obj current) 'error-auto-saving) - (!= (-> obj current) 'title) - (!= (-> obj current) 'insufficient-space) - (!= (-> obj current) 'secrets-insufficient-space) - (!= (-> obj current) 'no-memory-card) - (!= (-> obj current) 'icon-info) - (!= (-> obj current) 'insert-card) - (!= (-> obj current) 'progressive-mode-ok) - (!= (-> obj current) 'video-mode-ok) - (!= (-> obj current) 'progressive-mode-warning) - (!= (-> obj current) 'video-mode-warning) +(defmethod can-go-back? progress ((this progress)) + (and (= (-> this menu-transition) 0.0) + (not (-> this selected-option)) + (!= (-> this current) 'loading) + (!= (-> this current) 'saving) + (!= (-> this current) 'formatting) + (!= (-> this current) 'creating) + (!= (-> this current) 'error-disc-removed) + (!= (-> this current) 'error-reading) + (!= (-> this current) 'card-removed) + (!= (-> this current) 'error-auto-saving) + (!= (-> this current) 'title) + (!= (-> this current) 'insufficient-space) + (!= (-> this current) 'secrets-insufficient-space) + (!= (-> this current) 'no-memory-card) + (!= (-> this current) 'icon-info) + (!= (-> this current) 'insert-card) + (!= (-> this current) 'progressive-mode-ok) + (!= (-> this current) 'video-mode-ok) + (!= (-> this current) 'progressive-mode-warning) + (!= (-> this current) 'video-mode-warning) ) ) @@ -669,12 +669,12 @@ ) ;; definition for method 28 of type progress -(defmethod get-state-check-card progress ((obj progress) (arg0 symbol)) +(defmethod get-state-check-card progress ((this progress) (arg0 symbol)) (let ((v1-0 *progress-save-info*) (v0-0 arg0) ) (when v1-0 - (when (and v1-0 (= (-> obj menu-transition) 0.0)) + (when (and v1-0 (= (-> this menu-transition) 0.0)) (case arg0 (('insufficient-space 'no-memory-card 'unformatted-card) (cond @@ -683,7 +683,7 @@ ) ((zero? (-> v1-0 formatted)) (cond - ((or (zero? (-> obj state-pos)) (!= (-> *progress-state* starting-state) 'title)) + ((or (zero? (-> this state-pos)) (!= (-> *progress-state* starting-state) 'title)) (set! v0-0 'go-away) ) (else @@ -696,7 +696,7 @@ ((and (zero? (-> v1-0 inited)) (< (-> v1-0 mem-actual) (-> v1-0 mem-required))) (set! v0-0 'insufficient-space) ) - ((or (zero? (-> obj state-pos)) (!= (-> *progress-state* starting-state) 'title)) + ((or (zero? (-> this state-pos)) (!= (-> *progress-state* starting-state) 'title)) (set! v0-0 'go-away) ) (else @@ -767,13 +767,13 @@ ) ;; definition for method 29 of type progress -(defmethod push-state progress ((obj progress)) - (let ((v1-0 (-> obj state-pos))) +(defmethod push-state progress ((this progress)) + (let ((v1-0 (-> this state-pos))) (cond ((< v1-0 5) - (set! (-> obj state-stack v1-0) (-> obj current)) - (set! (-> obj option-index-stack v1-0) (-> obj option-index)) - (set! (-> obj state-pos) (+ v1-0 1)) + (set! (-> this state-stack v1-0) (-> this current)) + (set! (-> this option-index-stack v1-0) (-> this option-index)) + (set! (-> this state-pos) (+ v1-0 1)) ) (else (format #t "ERROR: Can't push any more states on the state-stack.~%") @@ -784,17 +784,17 @@ ) ;; definition for method 30 of type progress -(defmethod pop-state progress ((obj progress)) - (let ((v1-0 (-> obj state-pos))) +(defmethod pop-state progress ((this progress)) + (let ((v1-0 (-> this state-pos))) (cond ((> v1-0 0) (let ((a2-0 (+ v1-0 -1))) - (set! (-> obj state-pos) a2-0) - (set-next-state obj (-> obj state-stack a2-0) (-> obj option-index-stack a2-0)) + (set! (-> this state-pos) a2-0) + (set-next-state this (-> this state-stack a2-0) (-> this option-index-stack a2-0)) ) ) (else - (set-next-state obj 'go-away 0) + (set-next-state this 'go-away 0) ) ) ) @@ -808,26 +808,26 @@ ) ;; definition for method 31 of type progress -(defmethod set-next-state progress ((obj progress) (arg0 symbol) (arg1 int)) +(defmethod set-next-state progress ((this progress) (arg0 symbol) (arg1 int)) "Set the next menu state specified by arg0 at the index specified by arg1." (set! (-> *progress-state* clear-screen) #f) - (when (!= arg0 (-> obj current)) + (when (!= arg0 (-> this current)) (set! (-> *progress-state* yes-no-choice) #f) - (set! (-> obj selected-option) #f) - (set! (-> obj next-option-index) arg1) - (set! (-> obj next) arg0) - (case (-> obj next) + (set! (-> this selected-option) #f) + (set! (-> this next-option-index) arg1) + (set! (-> this next) arg0) + (case (-> this next) (('select-load 'select-save 'select-save-title 'select-save-title-hero) - (set! (-> obj next) (get-state-check-card obj (-> obj next))) + (set! (-> this next) (get-state-check-card this (-> this next))) ) ) - (case (-> obj next) + (case (-> this next) (('creating) - (auto-save-command 'create-file 0 0 obj #f) + (auto-save-command 'create-file 0 0 this #f) ) (('loading) (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which-slot)) - (auto-save-command 'restore 0 (-> *progress-state* which-slot) obj #f) + (auto-save-command 'restore 0 (-> *progress-state* which-slot) this #f) (set! (-> (the-as menu-missions-option (-> (the-as (array menu-option) (-> *missions-options* options)) 0)) task-line-index ) @@ -837,13 +837,13 @@ ) (('saving) (set! (-> *progress-state* last-slot-saved) (-> *progress-state* which-slot)) - (auto-save-command 'save 0 (-> *progress-state* which-slot) obj #f) + (auto-save-command 'save 0 (-> *progress-state* which-slot) this #f) ) (('formatting) - (auto-save-command 'format-card 0 0 obj #f) + (auto-save-command 'format-card 0 0 this #f) ) (('select-save 'select-load) - (set! (-> obj next-option-index) (max 0 (-> *progress-state* last-slot-saved))) + (set! (-> this next-option-index) (max 0 (-> *progress-state* last-slot-saved))) ) (('card-removed) (set! (-> *progress-state* last-slot-saved) 0) @@ -855,32 +855,32 @@ ) ;; definition for method 32 of type progress -(defmethod set-menu-options progress ((obj progress) (arg0 symbol)) +(defmethod set-menu-options progress ((this progress) (arg0 symbol)) "Set the menu options for the menu state specified by arg0." - (set! (-> obj current-options) #f) + (set! (-> this current-options) #f) (case arg0 (('go-away) - (go (method-of-object obj go-away)) + (go (method-of-object this go-away)) ) (('main) - (set! (-> obj current-options) (cond - (*cheat-mode* - *main-options* + (set! (-> this current-options) (cond + (*cheat-mode* + *main-options* + ) + ((= *kernel-boot-message* 'kiosk) + *main-kiosk-options* ) - ((= *kernel-boot-message* 'kiosk) - *main-kiosk-options* - ) - ((demo?) - *main-demo-options* - ) - (else - *main-options* + ((demo?) + *main-demo-options* ) - ) + (else + *main-options* + ) + ) ) ) (('game-options) - (set! (-> obj current-options) + (set! (-> this current-options) (cond ((demo?) (if (= (scf-get-territory) 1) @@ -898,7 +898,7 @@ ) ) (('graphic-options) - (set! (-> obj current-options) + (set! (-> this current-options) (if (or (= (scf-get-territory) 1) (and (= *progress-cheat* 'pal) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) *graphic-title-options-pal* *graphic-options* @@ -906,81 +906,81 @@ ) ) (('sound-options) - (set! (-> obj current-options) *sound-options*) + (set! (-> this current-options) *sound-options*) ) (('select-load 'select-save) - (set! (-> obj current-options) *load-save-options*) + (set! (-> this current-options) *load-save-options*) ) (('select-save-title) - (set! (-> obj current-options) *save-options-title*) + (set! (-> this current-options) *save-options-title*) ) (('select-save-title-hero) (logior! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) (logior! (-> *game-info* secrets) (game-secrets hero-mode)) - (set! (-> obj current-options) *save-options-title*) + (set! (-> this current-options) *save-options-title*) ) (('loading 'saving 'creating 'formatting) - (set! (-> obj current-options) *loading-options*) + (set! (-> this current-options) *loading-options*) ) (('unformatted-card 'insufficient-space 'no-memory-card) - (set! (-> obj current-options) *insufficient-space-options*) + (set! (-> this current-options) *insufficient-space-options*) ) (('secrets-insufficient-space 'secrets-no-memory-card) - (set! (-> obj current-options) *secrets-insufficient-space-options*) + (set! (-> this current-options) *secrets-insufficient-space-options*) ) (('insert-card) - (set! (-> obj current-options) *insert-card-options*) + (set! (-> this current-options) *insert-card-options*) ) (('error-loading 'error-saving 'error-formatting 'error-creating) - (set! (-> obj current-options) *error-loading-options*) + (set! (-> this current-options) *error-loading-options*) ) (('error-auto-saving) - (set! (-> obj current-options) *error-auto-saving-options*) + (set! (-> this current-options) *error-auto-saving-options*) ) (('card-removed) - (set! (-> obj current-options) *card-removed-options*) + (set! (-> this current-options) *card-removed-options*) ) (('error-disc-removed) - (set! (-> obj current-options) *error-disc-removed-options*) + (set! (-> this current-options) *error-disc-removed-options*) ) (('error-reading) - (set! (-> obj current-options) *error-reading-options*) + (set! (-> this current-options) *error-reading-options*) ) (('icon-info) - (set! (-> obj current-options) *icon-info-options*) + (set! (-> this current-options) *icon-info-options*) ) (('format-card) - (set! (-> obj current-options) *format-card-options*) + (set! (-> this current-options) *format-card-options*) ) (('already-exists) - (set! (-> obj current-options) *already-exists-options*) + (set! (-> this current-options) *already-exists-options*) ) (('create-game) - (set! (-> obj current-options) *create-game-options*) + (set! (-> this current-options) *create-game-options*) ) (('video-mode-warning) - (set! (-> obj current-options) *video-mode-warning-options*) + (set! (-> this current-options) *video-mode-warning-options*) ) (('video-mode-ok) - (set! (-> obj current-options) *video-mode-ok-options*) + (set! (-> this current-options) *video-mode-ok-options*) ) (('progressive-mode-warning) - (set! (-> obj current-options) *progressive-mode-warning-options*) + (set! (-> this current-options) *progressive-mode-warning-options*) ) (('progressive-mode-ok) - (set! (-> obj current-options) *progressive-mode-ok-options*) + (set! (-> this current-options) *progressive-mode-ok-options*) ) (('quit) - (set! (-> obj current-options) *quit-options*) + (set! (-> this current-options) *quit-options*) ) (('title) - (set! (-> obj current-options) *title*) + (set! (-> this current-options) *title*) ) (('title-options) - (set! (-> obj current-options) *options*) + (set! (-> this current-options) *options*) ) (('select-start 'select-pre-start 'select-kiosk-start) - (set! (-> obj current-options) *select-start-options*) + (set! (-> this current-options) *select-start-options*) (set! (-> (the-as menu-select-start-option (-> (the-as (array menu-option) (-> *select-start-options* options)) 0)) task-index ) @@ -989,7 +989,7 @@ 0 ) (('select-scene) - (set! (-> obj current-options) *select-scene-options*) + (set! (-> this current-options) *select-scene-options*) (set! (-> (the-as menu-select-scene-option (-> (the-as (array menu-option) (-> *select-scene-options* options)) 0)) task-index ) @@ -999,28 +999,28 @@ ) (('select-scene-special) (set! (-> *progress-state* starting-state) 'title) - (set! (-> obj state-pos) 0) - (let ((v1-67 (-> obj state-pos))) - (set! (-> obj state-stack v1-67) 'title) - (set! (-> obj option-index-stack v1-67) 3) + (set! (-> this state-pos) 0) + (let ((v1-67 (-> this state-pos))) + (set! (-> this state-stack v1-67) 'title) + (set! (-> this option-index-stack v1-67) 3) (let ((v1-68 (+ v1-67 1))) - (set! (-> obj state-stack v1-68) 'unlocked-secrets) - (set! (-> obj option-index-stack v1-68) (-> obj option-index)) - (set! (-> obj state-pos) (+ v1-68 1)) + (set! (-> this state-stack v1-68) 'unlocked-secrets) + (set! (-> this option-index-stack v1-68) (-> this option-index)) + (set! (-> this state-pos) (+ v1-68 1)) ) ) - (dotimes (s5-1 (-> obj state-pos)) + (dotimes (s5-1 (-> this state-pos)) (format #t "select-scene-special: ~S ~D~%" - (symbol->string (-> obj state-stack s5-1)) - (-> obj option-index-stack s5-1) + (symbol->string (-> this state-stack s5-1)) + (-> this option-index-stack s5-1) ) ) - (set! (-> obj current-options) *select-scene-options*) + (set! (-> this current-options) *select-scene-options*) ) (('bigmap) - (set! (-> obj current-options) *bigmap-options*) + (set! (-> this current-options) *bigmap-options*) ) (('missions) (set! (-> *progress-state* missions-total-spacing) 0.0) @@ -1029,7 +1029,7 @@ ) 0 ) - (set! (-> obj current-options) *missions-options*) + (set! (-> this current-options) *missions-options*) ) (('highscores) (set! (-> (the-as menu-highscores-option (-> (the-as (array menu-option) (-> *highscores-options* options)) 0)) @@ -1042,50 +1042,50 @@ ) 0 ) - (set! (-> obj current-options) *highscores-options*) + (set! (-> this current-options) *highscores-options*) ) (('secret) - (set! (-> obj secret-buying) #f) - (set! (-> obj current-options) *secret-options*) + (set! (-> this secret-buying) #f) + (set! (-> this current-options) *secret-options*) ) (('quit-restart) - (set! (-> obj current-options) *quit-restart-options*) + (set! (-> this current-options) *quit-restart-options*) ) (('unlocked-secrets) - (set! (-> obj current-options) *unlocked-secrets*) + (set! (-> this current-options) *unlocked-secrets*) ) ) - (when (= (-> obj current-options) #f) + (when (= (-> this current-options) #f) (format #t "Didn't find new menu settings!!~%") - (pop-state obj) + (pop-state this) ) 0 ) ;; definition for method 25 of type progress ;; WARN: Return type mismatch int vs none. -(defmethod respond-to-cpad progress ((obj progress)) +(defmethod respond-to-cpad progress ((this progress)) (mc-get-slot-info 0 *progress-save-info*) - (when (-> obj current-options) - (let ((option-array (-> obj current-options options))) - (when (and option-array (= (-> obj menu-transition) 0.0)) + (when (-> this current-options) + (let ((option-array (-> this current-options options))) + (when (and option-array (= (-> this menu-transition) 0.0)) (respond-progress - (the-as menu-option (-> option-array (-> obj option-index))) - obj - (and (= (-> obj menu-transition) 0.0) (-> obj selected-option)) + (the-as menu-option (-> option-array (-> this option-index))) + this + (and (= (-> this menu-transition) 0.0) (-> this selected-option)) ) (cond - ((-> obj selected-option) + ((-> this selected-option) (cond ((cpad-pressed? 0 confirm) - (set! (-> obj selected-option) #f) + (set! (-> this selected-option) #f) ) ((cpad-pressed? 0 triangle) - (if (= (-> obj current-options) *main-options*) + (if (= (-> this current-options) *main-options*) (sound-play "window-contract") (sound-play "generic-beep") ) - (set! (-> obj selected-option) #f) + (set! (-> this selected-option) #f) ) ) ) @@ -1093,28 +1093,31 @@ (cond ((cpad-pressed? 0 up l-analog-up) (cond - ((= (-> obj current-options) *main-options*) + ((= (-> this current-options) *main-options*) (sound-play "ring-select") ) ((!= (length option-array) 1) (sound-play "roll-over") ) ) - (if (and (= *title* (-> obj current-options)) (not (memcard-unlocked-secrets? #f)) (zero? (-> obj option-index))) - (set! (-> obj option-index) 3) + (if (and (= *title* (-> this current-options)) + (not (memcard-unlocked-secrets? #f)) + (zero? (-> this option-index)) + ) + (set! (-> this option-index) 3) ) (cond - ((> (-> obj want-option-index) 0) - (set! (-> obj want-option-index) -1) + ((> (-> this want-option-index) 0) + (set! (-> this want-option-index) -1) ) - ((< -2 (-> obj want-option-index)) - (+! (-> obj want-option-index) -1) + ((< -2 (-> this want-option-index)) + (+! (-> this want-option-index) -1) ) ) ) ((cpad-pressed? 0 down l-analog-down) (cond - ((= (-> obj current-options) *main-options*) + ((= (-> this current-options) *main-options*) (sound-play "ring-select") ) ((!= (length option-array) 1) @@ -1122,11 +1125,11 @@ ) ) (cond - ((< (-> obj want-option-index) 0) - (set! (-> obj want-option-index) 1) + ((< (-> this want-option-index) 0) + (set! (-> this want-option-index) 1) ) - ((< (-> obj want-option-index) 2) - (+! (-> obj want-option-index) 1) + ((< (-> this want-option-index) 2) + (+! (-> this want-option-index) 1) ) ) ) @@ -1136,17 +1139,17 @@ (if (not (-> *progress-state* clear-screen)) (sound-play "generic-beep") ) - (set! (-> obj selected-option) #t) + (set! (-> this selected-option) #t) ) ((cpad-pressed? 0 triangle) - (when (can-go-back? obj) + (when (can-go-back? this) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) - (if (and (= (-> *progress-state* starting-state) 'main) (!= (-> obj current-options) *main-options*)) + (if (and (= (-> *progress-state* starting-state) 'main) (!= (-> this current-options) *main-options*)) (sound-play "window-contract") (sound-play "generic-beep") ) - (pop-state obj) + (pop-state this) ) ) ) @@ -1820,13 +1823,13 @@ ) ;; definition for method 9 of type menu-option -(defmethod respond-progress menu-option ((obj menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-option ((this menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." 0 ) ;; definition for method 9 of type menu-on-off-option -(defmethod respond-progress menu-on-off-option ((obj menu-on-off-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-on-off-option ((this menu-on-off-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* on-off-choice)) (gp-0 #f) @@ -1837,7 +1840,7 @@ ((cpad-pressed? 0 left l-analog-left) (when (not (-> v1-1 0)) (set! gp-0 #t) - (when (= (-> obj value-to-modify) (&-> *setting-control* user-default vibration)) + (when (= (-> this value-to-modify) (&-> *setting-control* user-default vibration)) (set! (-> *cpad-list* cpads 0 buzz-pause-val 0) (the-as uint 255)) (set! (-> *cpad-list* cpads 0 buzz-pause-time) (the-as uint 15)) ) @@ -1850,14 +1853,14 @@ ) ((cpad-pressed? 0 confirm) (cond - ((and (-> v1-1 0) (= (-> obj value-to-modify) (&-> *setting-control* user-default use-progressive-scan))) + ((and (-> v1-1 0) (= (-> this value-to-modify) (&-> *setting-control* user-default use-progressive-scan))) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (push-state arg0) (set-next-state arg0 'progressive-mode-warning 0) ) (else - (set! (-> obj value-to-modify 0) (-> *progress-state* on-off-choice)) + (set! (-> this value-to-modify 0) (-> *progress-state* on-off-choice)) ) ) ) @@ -1865,7 +1868,7 @@ ) (else (if (cpad-pressed? 0 confirm) - (set! (-> *progress-state* on-off-choice) (-> obj value-to-modify 0)) + (set! (-> *progress-state* on-off-choice) (-> this value-to-modify 0)) ) ) ) @@ -1877,7 +1880,7 @@ ) ;; definition for method 9 of type menu-yes-no-option -(defmethod respond-progress menu-yes-no-option ((obj menu-yes-no-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-yes-no-option ((this menu-yes-no-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -1896,13 +1899,13 @@ ) ((cpad-pressed? 0 confirm) (cond - ((and (-> v1-1 0) (= (-> obj name) (text-id progress-root-restart-mission))) + ((and (-> v1-1 0) (= (-> this name) (text-id progress-root-restart-mission))) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (restart-mission) (set-next-state arg0 'go-away 0) ) - ((and (-> v1-1 0) (= (-> obj name) (text-id progress-quit))) + ((and (-> v1-1 0) (= (-> this name) (text-id progress-quit))) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (initialize! *game-info* 'game (the-as game-save #f) "title-restart") @@ -1919,10 +1922,10 @@ ) ;; definition for method 9 of type menu-slider-option -(defmethod respond-progress menu-slider-option ((obj menu-slider-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-slider-option ((this menu-slider-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (-> *bigmap* progress-minimap) - (let ((gp-0 (-> obj value-to-modify)) + (let ((gp-0 (-> this value-to-modify)) (s4-0 #f) ) (cond @@ -1977,13 +1980,13 @@ ) (when s4-0 (let ((f30-0 1.0)) - (case (-> obj name) + (case (-> this name) (((text-id progress-sound-music-volume) (text-id progress-sound-speech-volume)) (set! f30-0 (-> (the-as (pointer float) gp-0))) ) ) (when (< (seconds 0.03) (- (current-time) (-> *progress-state* last-slider-sound))) - (set! (-> *progress-state* last-slider-sound) (current-time)) + (set-time! (-> *progress-state* last-slider-sound)) (sound-play-by-name (static-sound-name "menu-slide") (new-sound-id) @@ -2002,7 +2005,7 @@ ) ;; definition for method 9 of type menu-stereo-mode-sound-option -(defmethod respond-progress menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-stereo-mode-sound-option ((this menu-stereo-mode-sound-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (-> *bigmap* progress-minimap) (let ((a0-1 (-> *setting-control* user-default stereo-mode)) @@ -2041,7 +2044,7 @@ ) ;; definition for method 9 of type menu-main-menu-option -(defmethod respond-progress menu-main-menu-option ((obj menu-main-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-main-menu-option ((this menu-main-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (cond ((cpad-pressed? 0 start) @@ -2053,7 +2056,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) (when (and (= (-> arg0 ring-angle) (-> arg0 ring-want-angle)) #t) (cond - ((= (-> obj name) (text-id progress-demo-exit)) + ((= (-> this name) (text-id progress-demo-exit)) (case *kernel-boot-message* (('demo-shared) (set! *master-exit* 'force) @@ -2065,11 +2068,11 @@ ) ) ) - ((or (= (-> obj name) (text-id progress-main-secrets-sceneplayer-1)) - (= (-> obj name) (text-id progress-main-secrets-sceneplayer-2)) - (= (-> obj name) (text-id progress-main-secrets-sceneplayer-3)) + ((or (= (-> this name) (text-id progress-main-secrets-sceneplayer-1)) + (= (-> this name) (text-id progress-main-secrets-sceneplayer-2)) + (= (-> this name) (text-id progress-main-secrets-sceneplayer-3)) ) - (case (-> obj name) + (case (-> this name) (((text-id progress-main-secrets-sceneplayer-2)) (set! (-> *progress-state* scene-player-act) 2) ) @@ -2082,12 +2085,12 @@ ) (sound-play "window-expand") (push-state arg0) - (set-next-state arg0 (-> obj next-state) 0) + (set-next-state arg0 (-> this next-state) 0) ) - ((= (-> obj next-state) 'back) + ((= (-> this next-state) 'back) (pop-state arg0) ) - ((= (-> obj next-state) 'restart) + ((= (-> this next-state) 'restart) (sound-volume-off) (restart-mission) (pop-state arg0) @@ -2095,7 +2098,7 @@ (else (sound-play "window-expand") (push-state arg0) - (set-next-state arg0 (-> obj next-state) 0) + (set-next-state arg0 (-> this next-state) 0) ) ) ) @@ -2137,7 +2140,7 @@ ) ;; definition for method 9 of type menu-sub-menu-option -(defmethod respond-progress menu-sub-menu-option ((obj menu-sub-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-sub-menu-option ((this menu-sub-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (and (-> *progress-state* secrets-unlocked) (not (memcard-unlocked-secrets? #f)) @@ -2152,12 +2155,12 @@ (set! (-> arg0 state-pos) 0) (set-next-state arg0 'secrets-insufficient-space 0) ) - (when (= (-> obj name) (text-id progress-continue-without-saving)) + (when (= (-> this name) (text-id progress-continue-without-saving)) (let ((a1-3 (get-state-check-card arg0 (-> arg0 current)))) (set-next-state arg0 a1-3 0) ) ) - (when (and (= (-> obj name) (text-id progress-root-secrets)) + (when (and (= (-> this name) (text-id progress-root-secrets)) (= *title* (-> arg0 current-options)) (not (memcard-unlocked-secrets? #f)) (= (-> arg0 option-index) 3) @@ -2169,7 +2172,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (cond - ((= (-> obj name) (text-id progress-demo-exit)) + ((= (-> this name) (text-id progress-demo-exit)) (case *kernel-boot-message* (('demo-shared) (set! *master-exit* 'force) @@ -2181,16 +2184,16 @@ ) ) ) - ((= (-> obj name) (text-id progress-continue-without-saving)) + ((= (-> this name) (text-id progress-continue-without-saving)) (progress-intro-start (logtest? (-> *game-info* purchase-secrets) (game-secrets hero-mode))) ) - ((= (-> obj next-state) 'back) + ((= (-> this next-state) 'back) (pop-state arg0) ) (else (sound-play "generic-beep") (push-state arg0) - (set-next-state arg0 (-> obj next-state) 0) + (set-next-state arg0 (-> this next-state) 0) ) ) ) @@ -2198,7 +2201,7 @@ ) ;; definition for method 9 of type menu-unlocked-menu-option -(defmethod respond-progress menu-unlocked-menu-option ((obj menu-unlocked-menu-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-unlocked-menu-option ((this menu-unlocked-menu-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (memcard-unlocked-secrets? #t))) (logclear! (-> *game-info* purchase-secrets) (game-secrets hero-mode)) @@ -2213,7 +2216,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (cond - ((and (= (-> obj name) (text-id progress-main-secrets-scrapbook)) (logtest? s4-0 (game-secrets scrap-book-1))) + ((and (= (-> this name) (text-id progress-main-secrets-scrapbook)) (logtest? s4-0 (game-secrets scrap-book-1))) (sound-play "generic-beep") (cond ((send-event (handle->process (-> *game-info* controller 0)) 'scrap-book 1) @@ -2227,7 +2230,7 @@ ) ) ) - ((and (= (-> obj name) (text-id progress-main-secrets-mega-scrapbook)) + ((and (= (-> this name) (text-id progress-main-secrets-mega-scrapbook)) (logtest? s4-0 (game-secrets scrap-book-2)) ) (sound-play "generic-beep") @@ -2243,7 +2246,7 @@ ) ) ) - ((and (= (-> obj name) (text-id progress-main-secrets-scrapbook-3)) + ((and (= (-> this name) (text-id progress-main-secrets-scrapbook-3)) (logtest? s4-0 (game-secrets scrap-book-3)) ) (sound-play "generic-beep") @@ -2259,7 +2262,7 @@ ) ) ) - ((and (= (-> obj name) (text-id progress-main-secrets-sceneplayer-1)) + ((and (= (-> this name) (text-id progress-main-secrets-sceneplayer-1)) (logtest? s4-0 (game-secrets scene-player-1)) ) (set! (-> *progress-state* scene-player-act) 1) @@ -2267,7 +2270,7 @@ (push-state arg0) (set-next-state arg0 'select-scene 0) ) - ((and (= (-> obj name) (text-id progress-main-secrets-sceneplayer-2)) + ((and (= (-> this name) (text-id progress-main-secrets-sceneplayer-2)) (logtest? s4-0 (game-secrets scene-player-2)) ) (set! (-> *progress-state* scene-player-act) 2) @@ -2275,7 +2278,7 @@ (push-state arg0) (set-next-state arg0 'select-scene 0) ) - ((and (= (-> obj name) (text-id progress-main-secrets-sceneplayer-3)) + ((and (= (-> this name) (text-id progress-main-secrets-sceneplayer-3)) (logtest? s4-0 (game-secrets scene-player-3)) ) (set! (-> *progress-state* scene-player-act) 3) @@ -2283,19 +2286,19 @@ (push-state arg0) (set-next-state arg0 'select-scene 0) ) - ((and (= (-> obj name) (text-id progress-main-secrets-hero-mode)) (logtest? s4-0 (game-secrets hero-mode))) + ((and (= (-> this name) (text-id progress-main-secrets-hero-mode)) (logtest? s4-0 (game-secrets hero-mode))) (sound-play "generic-beep") (push-state arg0) (set-next-state arg0 'select-save-title-hero 0) ) - ((and (= (-> obj name) (text-id progress-main-secrets-levelselect)) + ((and (= (-> this name) (text-id progress-main-secrets-levelselect)) (logtest? s4-0 (game-secrets level-select)) ) (sound-play "generic-beep") (push-state arg0) (set-next-state arg0 'select-start 0) ) - ((= (-> obj next-state) 'back) + ((= (-> this next-state) 'back) (pop-state arg0) ) ) @@ -2336,7 +2339,7 @@ ) ;; definition for method 9 of type menu-memcard-slot-option -(defmethod respond-progress menu-memcard-slot-option ((obj menu-memcard-slot-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-memcard-slot-option ((this menu-memcard-slot-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (memcard-unlocked-secrets? #t) (let ((a1-2 (get-state-check-card arg0 (-> arg0 current)))) @@ -2382,7 +2385,7 @@ ) ;; definition for method 9 of type menu-already-exists-option -(defmethod respond-progress menu-already-exists-option ((obj menu-already-exists-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-already-exists-option ((this menu-already-exists-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (a1-2 (get-state-check-card arg0 'select-save)) @@ -2425,7 +2428,7 @@ ) ;; definition for method 9 of type menu-create-game-option -(defmethod respond-progress menu-create-game-option ((obj menu-create-game-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-create-game-option ((this menu-create-game-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2471,7 +2474,7 @@ ) ;; definition for method 9 of type menu-insufficient-space-option -(defmethod respond-progress menu-insufficient-space-option ((obj menu-insufficient-space-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-insufficient-space-option ((this menu-insufficient-space-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s5-0 (&-> *progress-state* yes-no-choice)) (s3-0 (get-state-check-card arg0 'select-save)) @@ -2510,7 +2513,7 @@ ) (else (sound-play "generic-beep") - (set! (-> obj last-move) (current-time)) + (set-time! (-> this last-move)) (set! (-> arg0 current) 'none) (set-next-state arg0 s3-0 0) ) @@ -2567,7 +2570,7 @@ ) ;; definition for method 9 of type menu-secrets-insufficient-space-option -(defmethod respond-progress menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-secrets-insufficient-space-option ((this menu-secrets-insufficient-space-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (&-> *progress-state* yes-no-choice) (cond @@ -2586,7 +2589,7 @@ ) ;; definition for method 9 of type menu-video-mode-warning-option -(defmethod respond-progress menu-video-mode-warning-option ((obj menu-video-mode-warning-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-video-mode-warning-option ((this menu-video-mode-warning-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2607,7 +2610,7 @@ (cond ((-> *progress-state* yes-no-choice) (set! (-> *setting-control* user-default video-mode) (-> *progress-state* video-mode-choice)) - (set! (-> *progress-state* video-mode-timeout) (current-time)) + (set-time! (-> *progress-state* video-mode-timeout)) (set-next-state arg0 'video-mode-ok 0) ) (else @@ -2625,7 +2628,7 @@ ) ;; definition for method 9 of type menu-video-mode-ok-option -(defmethod respond-progress menu-video-mode-ok-option ((obj menu-video-mode-ok-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-video-mode-ok-option ((this menu-video-mode-ok-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (s5-0 #f) @@ -2672,7 +2675,7 @@ ) ;; definition for method 9 of type menu-progressive-mode-warning-option -(defmethod respond-progress menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-progressive-mode-warning-option ((this menu-progressive-mode-warning-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2697,7 +2700,7 @@ (sound-play "generic-beep") (set-progressive-scan #t) (set! (-> *progress-state* graphic-options-progressive-scan) #t) - (set! (-> *progress-state* progressive-mode-timeout) (current-time)) + (set-time! (-> *progress-state* progressive-mode-timeout)) (set-next-state arg0 'progressive-mode-ok 0) ) (else @@ -2718,7 +2721,7 @@ ) ;; definition for method 9 of type menu-progressive-mode-ok-option -(defmethod respond-progress menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-progressive-mode-ok-option ((this menu-progressive-mode-ok-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (s5-0 #f) @@ -2767,7 +2770,7 @@ ) ;; definition for method 9 of type menu-card-removed-option -(defmethod respond-progress menu-card-removed-option ((obj menu-card-removed-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-card-removed-option ((this menu-card-removed-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2779,7 +2782,7 @@ ) ;; definition for method 9 of type menu-insert-card-option -(defmethod respond-progress menu-insert-card-option ((obj menu-insert-card-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-insert-card-option ((this menu-insert-card-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." *progress-save-info* (cond @@ -2797,7 +2800,7 @@ ) ;; definition for method 9 of type menu-error-loading-option -(defmethod respond-progress menu-error-loading-option ((obj menu-error-loading-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-error-loading-option ((this menu-error-loading-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2809,7 +2812,7 @@ ) ;; definition for method 9 of type menu-error-auto-saving-option -(defmethod respond-progress menu-error-auto-saving-option ((obj menu-error-auto-saving-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-error-auto-saving-option ((this menu-error-auto-saving-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2821,7 +2824,7 @@ ) ;; definition for method 9 of type menu-error-disc-removed-option -(defmethod respond-progress menu-error-disc-removed-option ((obj menu-error-disc-removed-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-error-disc-removed-option ((this menu-error-disc-removed-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2835,7 +2838,7 @@ ) ;; definition for method 9 of type menu-error-reading-option -(defmethod respond-progress menu-error-reading-option ((obj menu-error-reading-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-error-reading-option ((this menu-error-reading-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2847,7 +2850,7 @@ ) ;; definition for method 9 of type menu-icon-info-option -(defmethod respond-progress menu-icon-info-option ((obj menu-icon-info-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-icon-info-option ((this menu-icon-info-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (when (cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -2859,7 +2862,7 @@ ) ;; definition for method 9 of type menu-quit-option -(defmethod respond-progress menu-quit-option ((obj menu-quit-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-quit-option ((this menu-quit-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((v1-1 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2904,7 +2907,7 @@ ) ;; definition for method 9 of type menu-format-card-option -(defmethod respond-progress menu-format-card-option ((obj menu-format-card-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-format-card-option ((this menu-format-card-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let ((s4-0 (&-> *progress-state* yes-no-choice)) (gp-0 #f) @@ -2950,7 +2953,7 @@ ;; definition for method 9 of type menu-select-start-option ;; WARN: disable def twice: 110. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod respond-progress menu-select-start-option ((obj menu-select-start-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-select-start-option ((this menu-select-start-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -2969,19 +2972,19 @@ ) (cond ((or (cpad-pressed? 0 up l-analog-up) - (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 up l-analog-up) (time-elapsed? (-> this last-move) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (> (-> obj task-index) 0) + (set-time! (-> this last-move)) + (when (> (-> this task-index) 0) (set! s4-0 #t) - (+! (-> obj task-index) -1) + (+! (-> this task-index) -1) (set! (-> arg0 sliding-height) -1.0) ) ) ((or (cpad-pressed? 0 down l-analog-down) - (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 down l-analog-down) (time-elapsed? (-> this last-move) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) + (set-time! (-> this last-move)) (let ((s3-0 -1)) (dotimes (s2-0 (-> *game-info* play-list length)) (let* ((v1-41 (-> *game-info* play-list s2-0)) @@ -3004,9 +3007,9 @@ ) ) ) - (when (< (-> obj task-index) s3-0) + (when (< (-> this task-index) s3-0) (set! s4-0 #t) - (+! (-> obj task-index) 1) + (+! (-> this task-index) 1) (set! (-> arg0 sliding-height) 1.0) ) ) @@ -3016,7 +3019,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (sound-play "generic-beep") (let* ((t9-6 play-task) - (a0-40 (-> obj real-task-index)) + (a0-40 (-> this real-task-index)) (a1-8 'debug) (v1-64 (-> arg0 current)) (a1-9 (t9-6 (the-as game-task a0-40) a1-8 (cond @@ -3046,7 +3049,7 @@ ) ;; definition for method 9 of type menu-select-scene-option -(defmethod respond-progress menu-select-scene-option ((obj menu-select-scene-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-select-scene-option ((this menu-select-scene-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -3077,22 +3080,22 @@ ) (cond ((or (cpad-pressed? 0 up l-analog-up) - (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 up l-analog-up) (time-elapsed? (-> this last-move) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (> (-> obj task-index) 0) + (set-time! (-> this last-move)) + (when (> (-> this task-index) 0) (set! gp-0 #t) - (+! (-> obj task-index) -1) + (+! (-> this task-index) -1) (set! (-> arg0 sliding-height) -1.0) ) ) ((or (cpad-pressed? 0 down l-analog-down) - (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 down l-analog-down) (time-elapsed? (-> this last-move) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (< (-> obj task-index) (+ (length s4-0) -1)) + (set-time! (-> this last-move)) + (when (< (-> this task-index) (+ (length s4-0) -1)) (set! gp-0 #t) - (+! (-> obj task-index) 1) + (+! (-> this task-index) 1) (set! (-> arg0 sliding-height) 1.0) ) ) @@ -3105,7 +3108,7 @@ (set! *display-profile* s3-2) ) (set! (-> *game-info* mode) 'play) - (let ((s5-1 (-> s4-0 (-> obj task-index)))) + (let ((s5-1 (-> s4-0 (-> this task-index)))) (set! (-> *game-info* demo-state) (the-as uint 100)) (logior! (-> *game-info* secrets) (game-secrets scene-player-1)) (process-spawn scene-player :init scene-player-init (-> s5-1 info) #t (-> s5-1 continue)) @@ -3122,7 +3125,7 @@ ) ;; definition for method 9 of type menu-bigmap-option -(defmethod respond-progress menu-bigmap-option ((obj menu-bigmap-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-bigmap-option ((this menu-bigmap-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (handle-cpad-inputs *bigmap*) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) @@ -3131,7 +3134,7 @@ ) ;; definition for method 9 of type menu-missions-option -(defmethod respond-progress menu-missions-option ((obj menu-missions-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-missions-option ((this menu-missions-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding-height) (seek-ease (-> arg0 sliding-height) @@ -3144,21 +3147,21 @@ (let ((s5-0 #f)) (cond ((or (cpad-pressed? 0 up l-analog-up) - (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 up l-analog-up) (time-elapsed? (-> this last-move) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (> (-> obj task-line-index) 0) + (set-time! (-> this last-move)) + (when (> (-> this task-line-index) 0) (set! s5-0 #t) - (+! (-> obj task-line-index) -1) + (+! (-> this task-line-index) -1) (set! (-> arg0 sliding-height) -1.0) ) ) ((or (cpad-pressed? 0 down l-analog-down) - (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 down l-analog-down) (time-elapsed? (-> this last-move) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (< (-> obj task-line-index) (+ (-> *progress-state* total-num-tasks) -1)) - (+! (-> obj task-line-index) 1) + (set-time! (-> this last-move)) + (when (< (-> this task-line-index) (+ (-> *progress-state* total-num-tasks) -1)) + (+! (-> this task-line-index) 1) (set! (-> arg0 sliding-height) 1.0) (set! s5-0 #t) ) @@ -3181,7 +3184,7 @@ ) ;; definition for method 9 of type menu-highscores-option -(defmethod respond-progress menu-highscores-option ((obj menu-highscores-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-highscores-option ((this menu-highscores-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (set! (-> arg0 sliding) (seek-ease (-> arg0 sliding) @@ -3203,29 +3206,29 @@ (let ((s5-0 #f)) (cond ((or (cpad-pressed? 0 right l-analog-right) - (and (cpad-hold? 0 right l-analog-right) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 right l-analog-right) (time-elapsed? (-> this last-move) (seconds 0.2))) ) (when (< 1 (get-num-highscores)) - (set! (-> obj last-move) (current-time)) + (set-time! (-> this last-move)) (set! s5-0 #t) - (set! (-> obj prev-page-index) (-> obj page-index)) - (set! (-> obj page-index) (get-next-highscore (-> obj page-index))) + (set! (-> this prev-page-index) (-> this page-index)) + (set! (-> this page-index) (get-next-highscore (-> this page-index))) (set! (-> arg0 sliding) 1.0) (set! (-> arg0 sliding-off) 0.0) - (set! (-> obj slide-dir) -1.0) + (set! (-> this slide-dir) -1.0) ) ) ((or (cpad-pressed? 0 left l-analog-left) - (and (cpad-hold? 0 left l-analog-left) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 left l-analog-left) (time-elapsed? (-> this last-move) (seconds 0.2))) ) (when (< 1 (get-num-highscores)) - (set! (-> obj last-move) (current-time)) - (set! (-> obj prev-page-index) (-> obj page-index)) - (set! (-> obj page-index) (get-prev-highscore (-> obj page-index))) + (set-time! (-> this last-move)) + (set! (-> this prev-page-index) (-> this page-index)) + (set! (-> this page-index) (get-prev-highscore (-> this page-index))) (set! s5-0 #t) (set! (-> arg0 sliding) -1.0) (set! (-> arg0 sliding-off) 0.0) - (set! (-> obj slide-dir) 1.0) + (set! (-> this slide-dir) 1.0) ) ) ((cpad-pressed? 0 triangle confirm) @@ -3249,17 +3252,17 @@ ) ;; definition for method 9 of type menu-secret-option -(defmethod respond-progress menu-secret-option ((obj menu-secret-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-secret-option ((this menu-secret-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (let* ((s5-1 (logtest? (-> *game-info* secrets) (game-secrets hero-mode))) (s3-0 (if (not s5-1) 0 - (-> obj num-items) + (-> this num-items) ) ) (s2-0 (if (not s5-1) - (+ (-> obj num-items) -1) - (+ (-> obj num-items) -1 (-> obj num-hero-items)) + (+ (-> this num-items) -1) + (+ (-> this num-items) -1 (-> this num-hero-items)) ) ) ) @@ -3272,16 +3275,16 @@ ) ) (cond - ((and s5-1 (< (-> obj item-index) s3-0)) - (set! (-> obj item-index) s3-0) - (set! (-> obj prev-item-index) s3-0) + ((and s5-1 (< (-> this item-index) s3-0)) + (set! (-> this item-index) s3-0) + (set! (-> this prev-item-index) s3-0) ) - ((and (not s5-1) (< s2-0 (-> obj item-index))) - (set! (-> obj item-index) s3-0) - (set! (-> obj prev-item-index) s3-0) + ((and (not s5-1) (< s2-0 (-> this item-index))) + (set! (-> this item-index) s3-0) + (set! (-> this prev-item-index) s3-0) ) ) - (menu-update-purchase-secrets obj) + (menu-update-purchase-secrets this) (when (-> *bigmap* progress-minimap) (let ((s5-2 #f)) (cond @@ -3296,24 +3299,24 @@ (else (cond ((or (cpad-pressed? 0 down l-analog-down) - (and (cpad-hold? 0 down l-analog-down) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 down l-analog-down) (time-elapsed? (-> this last-move) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (< (-> obj item-index) s2-0) - (set! (-> obj prev-item-index) (-> obj item-index)) + (set-time! (-> this last-move)) + (when (< (-> this item-index) s2-0) + (set! (-> this prev-item-index) (-> this item-index)) (set! s5-2 #t) - (+! (-> obj item-index) 1) + (+! (-> this item-index) 1) (set! (-> arg0 sliding) 1.0) (set! (-> arg0 sliding-off) 0.0) ) ) ((or (cpad-pressed? 0 up l-analog-up) - (and (cpad-hold? 0 up l-analog-up) (>= (- (current-time) (-> obj last-move)) (seconds 0.2))) + (and (cpad-hold? 0 up l-analog-up) (time-elapsed? (-> this last-move) (seconds 0.2))) ) - (set! (-> obj last-move) (current-time)) - (when (< s3-0 (-> obj item-index)) - (set! (-> obj prev-item-index) (-> obj item-index)) - (+! (-> obj item-index) -1) + (set-time! (-> this last-move)) + (when (< s3-0 (-> this item-index)) + (set! (-> this prev-item-index) (-> this item-index)) + (+! (-> this item-index) -1) (set! s5-2 #t) (set! (-> arg0 sliding) -1.0) (set! (-> arg0 sliding-off) 0.0) @@ -3322,19 +3325,19 @@ ((cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) - (let ((v1-74 (-> obj item-index))) - (-> obj secret-items v1-74 cost) - (let ((a0-54 (-> obj secret-items v1-74 flag)) - (a1-9 (= (-> obj secret-items v1-74 can-toggle) #t)) + (let ((v1-74 (-> this item-index))) + (-> this secret-items v1-74 cost) + (let ((a0-54 (-> this secret-items v1-74 flag)) + (a1-9 (= (-> this secret-items v1-74 can-toggle) #t)) ) - (-> obj secret-items v1-74 avail-after) + (-> this secret-items v1-74 avail-after) (the int (-> *game-info* skill)) (cond ((and (logtest? (-> *game-info* purchase-secrets) a0-54) a1-9) (set! (-> arg0 selected-option) #t) (sound-play "generic-beep") ) - ((= (-> obj secret-items v1-74 can-toggle) 'auto) + ((= (-> this secret-items v1-74 can-toggle) 'auto) ) ((logtest? (-> *game-info* purchase-secrets) a0-54) (set! (-> arg0 selected-option) #t) @@ -3368,7 +3371,7 @@ ) ;; definition for method 9 of type menu-game-option -(defmethod respond-progress menu-game-option ((obj menu-game-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-game-option ((this menu-game-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* game-options-vibrations) (-> *progress-state* game-options-subtitles) @@ -3379,10 +3382,10 @@ (cond ((or (cpad-pressed? 0 down l-analog-down) (and (cpad-hold? 0 down l-analog-down) - (>= (- (current-time) (-> *progress-state* game-options-last-move)) (seconds 0.5)) + (time-elapsed? (-> *progress-state* game-options-last-move) (seconds 0.5)) ) ) - (set! (-> *progress-state* game-options-last-move) (current-time)) + (set-time! (-> *progress-state* game-options-last-move)) (cond ((< (-> *progress-state* game-options-item-selected) 3) (+! (-> *progress-state* game-options-item-selected) 1) @@ -3394,11 +3397,9 @@ ) ) ((or (cpad-pressed? 0 up l-analog-up) - (and (cpad-hold? 0 up l-analog-up) - (>= (- (current-time) (-> *progress-state* game-options-last-move)) (seconds 0.5)) - ) + (and (cpad-hold? 0 up l-analog-up) (time-elapsed? (-> *progress-state* game-options-last-move) (seconds 0.5))) ) - (set! (-> *progress-state* game-options-last-move) (current-time)) + (set-time! (-> *progress-state* game-options-last-move)) (if (> (-> *progress-state* game-options-item-selected) 0) (+! (-> *progress-state* game-options-item-selected) -1) (set! (-> *progress-state* game-options-item-selected) 3) @@ -3407,7 +3408,7 @@ ((cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) - (set! (-> *progress-state* game-options-last-move) (current-time)) + (set-time! (-> *progress-state* game-options-last-move)) (set! (-> *progress-state* game-options-item-picked) (the-as basic #t)) (sound-play "generic-beep") ) @@ -3582,7 +3583,7 @@ ) (when v1-0 (when (< (seconds 0.3) (- (current-time) (-> *progress-state* last-slider-sound))) - (set! (-> *progress-state* last-slider-sound) (current-time)) + (set-time! (-> *progress-state* last-slider-sound)) (sound-play "roll-over") ) ) @@ -3591,7 +3592,7 @@ ) ;; definition for method 9 of type menu-graphic-option -(defmethod respond-progress menu-graphic-option ((obj menu-graphic-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-graphic-option ((this menu-graphic-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* graphic-options-aspect-ratio) (-> *progress-state* graphic-options-progressive-scan) @@ -3601,10 +3602,10 @@ (cond ((or (cpad-pressed? 0 down l-analog-down) (and (cpad-hold? 0 down l-analog-down) - (>= (- (current-time) (-> *progress-state* graphic-options-last-move)) (seconds 0.5)) + (time-elapsed? (-> *progress-state* graphic-options-last-move) (seconds 0.5)) ) ) - (set! (-> *progress-state* graphic-options-last-move) (current-time)) + (set-time! (-> *progress-state* graphic-options-last-move)) (set! (-> arg0 selected-option) #f) (cond ((< (-> *progress-state* graphic-options-item-selected) (if (= (scf-get-territory) 1) @@ -3623,10 +3624,10 @@ ) ((or (cpad-pressed? 0 up l-analog-up) (and (cpad-hold? 0 up l-analog-up) - (>= (- (current-time) (-> *progress-state* graphic-options-last-move)) (seconds 0.5)) + (time-elapsed? (-> *progress-state* graphic-options-last-move) (seconds 0.5)) ) ) - (set! (-> *progress-state* graphic-options-last-move) (current-time)) + (set-time! (-> *progress-state* graphic-options-last-move)) (set! (-> arg0 selected-option) #f) (cond ((> (-> *progress-state* graphic-options-item-selected) 0) @@ -3646,7 +3647,7 @@ ((cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) - (set! (-> *progress-state* graphic-options-last-move) (current-time)) + (set-time! (-> *progress-state* graphic-options-last-move)) (set! (-> *progress-state* graphic-options-item-picked) #t) (set! (-> arg0 selected-option) #f) (sound-play "generic-beep") @@ -3684,7 +3685,7 @@ ((and (zero? (-> *progress-state* graphic-options-item-selected)) (cpad-pressed? 0 up right down left l-analog-up l-analog-right l-analog-down l-analog-left) ) - (update-center-screen obj arg0 #t) + (update-center-screen this arg0 #t) ) ((and (= (-> *progress-state* graphic-options-item-selected) 1) (cpad-pressed? 0 left l-analog-left)) (sound-play "generic-beep") @@ -3724,7 +3725,7 @@ (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) (sound-play "generic-beep") (if (zero? (-> *progress-state* graphic-options-item-selected)) - (update-center-screen obj arg0 #t) + (update-center-screen this arg0 #t) ) (when (= (-> *progress-state* graphic-options-item-selected) 1) (if (!= (-> *progress-state* graphic-options-aspect-ratio) (-> *setting-control* user-default aspect-ratio)) @@ -3805,7 +3806,7 @@ ) ;; definition for method 9 of type menu-qr-option -(defmethod respond-progress menu-qr-option ((obj menu-qr-option) (arg0 progress) (arg1 symbol)) +(defmethod respond-progress menu-qr-option ((this menu-qr-option) (arg0 progress) (arg1 symbol)) "Handle progress menu navigation logic." (-> *progress-state* qr-options-restart) (-> *progress-state* qr-options-quit) @@ -3816,10 +3817,10 @@ (cond ((or (cpad-pressed? 0 down l-analog-down) (and (cpad-hold? 0 down l-analog-down) - (>= (- (current-time) (-> *progress-state* qr-options-last-move)) (seconds 0.5)) + (time-elapsed? (-> *progress-state* qr-options-last-move) (seconds 0.5)) ) ) - (set! (-> *progress-state* qr-options-last-move) (current-time)) + (set-time! (-> *progress-state* qr-options-last-move)) (cond ((< (-> *progress-state* qr-options-item-selected) 1) (+! (-> *progress-state* qr-options-item-selected) 1) @@ -3836,11 +3837,9 @@ ) ) ((or (cpad-pressed? 0 up l-analog-up) - (and (cpad-hold? 0 up l-analog-up) - (>= (- (current-time) (-> *progress-state* qr-options-last-move)) (seconds 0.5)) - ) + (and (cpad-hold? 0 up l-analog-up) (time-elapsed? (-> *progress-state* qr-options-last-move) (seconds 0.5))) ) - (set! (-> *progress-state* qr-options-last-move) (current-time)) + (set-time! (-> *progress-state* qr-options-last-move)) (cond ((> (-> *progress-state* qr-options-item-selected) 0) (+! (-> *progress-state* qr-options-item-selected) -1) @@ -3857,7 +3856,7 @@ ((cpad-pressed? 0 confirm) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons confirm)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons confirm)) - (set! (-> *progress-state* qr-options-last-move) (current-time)) + (set-time! (-> *progress-state* qr-options-last-move)) (set! (-> *progress-state* qr-options-item-picked) (the-as basic #t)) (set! (-> arg0 selected-option) #t) (sound-play "generic-beep") @@ -3893,19 +3892,19 @@ ) ((and (zero? (-> *progress-state* qr-options-item-selected)) (cpad-pressed? 0 left l-analog-left)) (sound-play "generic-beep") - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) ((and (zero? (-> *progress-state* qr-options-item-selected)) (cpad-pressed? 0 right l-analog-right)) (sound-play "generic-beep") - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) ((and (= (-> *progress-state* qr-options-item-selected) 1) (cpad-pressed? 0 left l-analog-left)) (sound-play "generic-beep") - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) ((and (= (-> *progress-state* qr-options-item-selected) 1) (cpad-pressed? 0 right l-analog-right)) (sound-play "generic-beep") - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) ((cpad-pressed? 0 triangle) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) @@ -3919,12 +3918,12 @@ (when (zero? (-> *progress-state* qr-options-item-selected)) (set! (-> arg0 selected-option) #t) (set! (-> arg0 option-index) 0) - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) (when (= (-> *progress-state* qr-options-item-selected) 1) (set! (-> arg0 selected-option) #t) (set! (-> arg0 option-index) 1) - (update-restart-quit obj arg0 #t) + (update-restart-quit this arg0 #t) ) (set! (-> *progress-state* qr-options-item-picked) #f) (set! (-> *progress-state* yes-no-choice) #f) diff --git a/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc index 5314b63b2b..28687948ba 100644 --- a/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc @@ -13,16 +13,16 @@ ) ;; definition for method 3 of type game-text -(defmethod inspect game-text ((obj game-text)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-text ((this game-text)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'game-text) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Ttext: ~A~%" (-> obj text)) + (format #t "[~8x] ~A~%" this 'game-text) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Ttext: ~A~%" (-> this text)) (label cfg-4) - obj + this ) ;; definition of type game-text-info @@ -41,19 +41,18 @@ ) ;; definition for method 3 of type game-text-info -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-text-info ((obj game-text-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect game-text-info ((this game-text-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tlanguage-id: ~D~%" (-> obj language-id)) - (format #t "~1Tgroup-name: ~A~%" (-> obj group-name)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tlanguage-id: ~D~%" (-> this language-id)) + (format #t "~1Tgroup-name: ~A~%" (-> this group-name)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for symbol *text-group-names*, type (array string) diff --git a/test/decompiler/reference/jak2/engine/ui/text_REF.gc b/test/decompiler/reference/jak2/engine/ui/text_REF.gc index 226606d109..f153a20598 100644 --- a/test/decompiler/reference/jak2/engine/ui/text_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/text_REF.gc @@ -36,60 +36,59 @@ (kmemclose) ;; definition for method 7 of type game-text-info -(defmethod relocate game-text-info ((obj game-text-info) (arg0 int)) +(defmethod relocate game-text-info ((this game-text-info) (arg0 int)) (let ((v1-1 (-> *level* loading-level))) (when v1-1 - (set! (-> v1-1 loaded-text-info (-> v1-1 loaded-text-info-count)) obj) + (set! (-> v1-1 loaded-text-info (-> v1-1 loaded-text-info-count)) this) (+! (-> v1-1 loaded-text-info-count) 1) ) ) - obj + this ) ;; definition for method 4 of type game-text-info -(defmethod length game-text-info ((obj game-text-info)) - (-> obj length) +(defmethod length game-text-info ((this game-text-info)) + (-> this length) ) ;; definition for method 5 of type game-text-info ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of game-text-info ((obj game-text-info)) - (the-as int (+ (-> obj type size) (* (-> obj length) 8))) +(defmethod asize-of game-text-info ((this game-text-info)) + (the-as int (+ (-> this type size) (* (-> this length) 8))) ) ;; definition for method 3 of type game-text-info -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect game-text-info ((obj game-text-info)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tlanguage-id: ~D~%" (-> obj language-id)) - (format #t "~Tgroup-name: ~A~%" (-> obj group-name)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj length) (-> obj data)) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] #x~X ~A~%" s5-0 (-> obj data s5-0 id) (-> obj data s5-0 text)) +(defmethod inspect game-text-info ((this game-text-info)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tlanguage-id: ~D~%" (-> this language-id)) + (format #t "~Tgroup-name: ~A~%" (-> this group-name)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] #x~X ~A~%" s5-0 (-> this data s5-0 id) (-> this data s5-0 text)) ) - obj + this ) ;; definition for method 8 of type game-text-info -(defmethod mem-usage game-text-info ((obj game-text-info) (arg0 memory-usage-block) (arg1 int)) +(defmethod mem-usage game-text-info ((this game-text-info) (arg0 memory-usage-block) (arg1 int)) (set! (-> arg0 length) (max 84 (-> arg0 length))) (set! (-> arg0 data 83 name) "string") (+! (-> arg0 data 83 count) 1) - (let ((v1-6 (asize-of obj))) + (let ((v1-6 (asize-of this))) (+! (-> arg0 data 83 used) v1-6) (+! (-> arg0 data 83 total) (logand -16 (+ v1-6 15))) ) - (dotimes (s4-0 (-> obj length)) + (dotimes (s4-0 (-> this length)) (set! (-> arg0 length) (max 84 (-> arg0 length))) (set! (-> arg0 data 83 name) "string") (+! (-> arg0 data 83 count) 1) - (let ((v1-18 (asize-of (-> obj data s4-0 text)))) + (let ((v1-18 (asize-of (-> this data s4-0 text)))) (+! (-> arg0 data 83 used) v1-18) (+! (-> arg0 data 83 total) (logand -16 (+ v1-18 15))) ) ) - obj + this ) ;; definition for function convert-korean-text @@ -182,9 +181,9 @@ ) ;; definition for method 9 of type game-text-info -(defmethod lookup-text! game-text-info ((obj game-text-info) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text! game-text-info ((this game-text-info) (arg0 text-id) (arg1 symbol)) (cond - ((= obj #f) + ((= this #f) (cond (arg1 (the-as string #f) @@ -197,12 +196,12 @@ ) (else (let* ((a1-2 0) - (a3-0 (+ (-> obj length) 1)) + (a3-0 (+ (-> this length) 1)) (v1-2 (/ (+ a1-2 a3-0) 2)) ) (let ((t0-0 -1)) - (while (and (!= (-> obj data v1-2 id) arg0) (!= v1-2 t0-0)) - (if (< (the-as uint arg0) (the-as uint (-> obj data v1-2 id))) + (while (and (!= (-> this data v1-2 id) arg0) (!= v1-2 t0-0)) + (if (< (the-as uint arg0) (the-as uint (-> this data v1-2 id))) (set! a3-0 v1-2) (set! a1-2 v1-2) ) @@ -211,7 +210,7 @@ ) ) (cond - ((!= (-> obj data v1-2 id) arg0) + ((!= (-> this data v1-2 id) arg0) (cond (arg1 (the-as string #f) @@ -222,11 +221,11 @@ ) ) ) - ((= (-> obj language-id) 6) - (convert-korean-text (-> obj data v1-2 text)) + ((= (-> this language-id) 6) + (convert-korean-text (-> this data v1-2 text)) ) (else - (-> obj data v1-2 text) + (-> this data v1-2 text) ) ) ) @@ -235,11 +234,11 @@ ) ;; definition for method 23 of type level -(defmethod lookup-text level ((obj level) (arg0 text-id) (arg1 symbol)) +(defmethod lookup-text level ((this level) (arg0 text-id) (arg1 symbol)) (let ((v1-0 *common-text*)) - (dotimes (a3-0 (-> obj loaded-text-info-count)) - (if (= (-> obj loaded-text-info a3-0 language-id) (-> *setting-control* user-current language)) - (set! v1-0 (-> obj loaded-text-info a3-0)) + (dotimes (a3-0 (-> this loaded-text-info-count)) + (if (= (-> this loaded-text-info a3-0 language-id) (-> *setting-control* user-current language)) + (set! v1-0 (-> this loaded-text-info a3-0)) ) ) (lookup-text! v1-0 arg0 arg1) diff --git a/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc b/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc index 778fcf46c3..177129ceac 100644 --- a/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc @@ -26,26 +26,26 @@ ;; definition for method 3 of type gs-store-image-packet ;; INFO: Used lq/sq -(defmethod inspect gs-store-image-packet ((obj gs-store-image-packet)) - (when (not obj) - (set! obj obj) +(defmethod inspect gs-store-image-packet ((this gs-store-image-packet)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gs-store-image-packet) - (format #t "~1Tvifcode[4] @ #x~X~%" (-> obj vifcode)) - (format #t "~1Tgiftag: ~D~%" (-> obj giftag)) - (format #t "~1Tbitbltbuf: ~D~%" (-> obj bitbltbuf)) - (format #t "~1Tbitbltbuf-addr: ~D~%" (-> obj bitbltbuf-addr)) - (format #t "~1Ttrxpos: ~D~%" (-> obj trxpos)) - (format #t "~1Ttrxpos-addr: ~D~%" (-> obj trxpos-addr)) - (format #t "~1Ttrxreg: ~D~%" (-> obj trxreg)) - (format #t "~1Ttrxreg-addr: ~D~%" (-> obj trxreg-addr)) - (format #t "~1Tfinish: ~D~%" (-> obj finish)) - (format #t "~1Tfinish-addr: ~D~%" (-> obj finish-addr)) - (format #t "~1Ttrxdir: ~D~%" (-> obj trxdir)) - (format #t "~1Ttrxdir-addr: ~D~%" (-> obj trxdir-addr)) + (format #t "[~8x] ~A~%" this 'gs-store-image-packet) + (format #t "~1Tvifcode[4] @ #x~X~%" (-> this vifcode)) + (format #t "~1Tgiftag: ~D~%" (-> this giftag)) + (format #t "~1Tbitbltbuf: ~D~%" (-> this bitbltbuf)) + (format #t "~1Tbitbltbuf-addr: ~D~%" (-> this bitbltbuf-addr)) + (format #t "~1Ttrxpos: ~D~%" (-> this trxpos)) + (format #t "~1Ttrxpos-addr: ~D~%" (-> this trxpos-addr)) + (format #t "~1Ttrxreg: ~D~%" (-> this trxreg)) + (format #t "~1Ttrxreg-addr: ~D~%" (-> this trxreg-addr)) + (format #t "~1Tfinish: ~D~%" (-> this finish)) + (format #t "~1Tfinish-addr: ~D~%" (-> this finish-addr)) + (format #t "~1Ttrxdir: ~D~%" (-> this trxdir)) + (format #t "~1Ttrxdir-addr: ~D~%" (-> this trxdir-addr)) (label cfg-4) - obj + this ) ;; definition of type screen-shot-work @@ -62,19 +62,19 @@ ) ;; definition for method 3 of type screen-shot-work -(defmethod inspect screen-shot-work ((obj screen-shot-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect screen-shot-work ((this screen-shot-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'screen-shot-work) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tsize: ~D~%" (-> obj size)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Thighres-enable: ~A~%" (-> obj highres-enable)) - (format #t "~1Thud-enable: ~A~%" (-> obj hud-enable)) + (format #t "[~8x] ~A~%" this 'screen-shot-work) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tsize: ~D~%" (-> this size)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Thighres-enable: ~A~%" (-> this highres-enable)) + (format #t "~1Thud-enable: ~A~%" (-> this hud-enable)) (label cfg-4) - obj + this ) ;; definition for symbol *screen-shot-work*, type screen-shot-work diff --git a/test/decompiler/reference/jak2/engine/util/glist-h_REF.gc b/test/decompiler/reference/jak2/engine/util/glist-h_REF.gc index 59386953b7..223c4e992c 100644 --- a/test/decompiler/reference/jak2/engine/util/glist-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/glist-h_REF.gc @@ -15,16 +15,16 @@ ) ;; definition for method 3 of type glst-node -(defmethod inspect glst-node ((obj glst-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect glst-node ((this glst-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'glst-node) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tprev: #~%" (-> obj prev)) + (format #t "[~8x] ~A~%" this 'glst-node) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) (label cfg-4) - obj + this ) ;; definition of type glst-named-node @@ -37,17 +37,17 @@ ) ;; definition for method 3 of type glst-named-node -(defmethod inspect glst-named-node ((obj glst-named-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect glst-named-node ((this glst-named-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'glst-named-node) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tprev: #~%" (-> obj prev)) - (format #t "~1Tprivname: ~A~%" (-> obj privname)) + (format #t "[~8x] ~A~%" this 'glst-named-node) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) + (format #t "~1Tprivname: ~A~%" (-> this privname)) (label cfg-4) - obj + this ) ;; definition of type glst-list @@ -63,18 +63,18 @@ ) ;; definition for method 3 of type glst-list -(defmethod inspect glst-list ((obj glst-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect glst-list ((this glst-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'glst-list) - (format #t "~1Thead: #~%" (-> obj head)) - (format #t "~1Ttail: #~%" (-> obj tail)) - (format #t "~1Ttailpred: #~%" (-> obj tailpred)) - (format #t "~1Tnumelem: ~D~%" (-> obj numelem)) + (format #t "[~8x] ~A~%" this 'glst-list) + (format #t "~1Thead: #~%" (-> this head)) + (format #t "~1Ttail: #~%" (-> this tail)) + (format #t "~1Ttailpred: #~%" (-> this tailpred)) + (format #t "~1Tnumelem: ~D~%" (-> this numelem)) (label cfg-4) - obj + this ) ;; definition for function glst-next diff --git a/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc b/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc index 450987ec11..bf2ff76fee 100644 --- a/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc @@ -20,23 +20,23 @@ ) ;; definition for method 3 of type profile-segment -(defmethod inspect profile-segment ((obj profile-segment)) - (when (not obj) - (set! obj obj) +(defmethod inspect profile-segment ((this profile-segment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'profile-segment) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Tend-time: ~D~%" (-> obj end-time)) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tvu-count: ~D~%" (-> obj vu-count)) - (format #t "~1Tdepth: ~D~%" (-> obj depth)) - (format #t "~1Tcolor: #x~X~%" (-> obj color)) - (format #t "~1Tcode-time: ~D~%" (-> obj code-time)) - (format #t "~1Tvu-time: ~D~%" (-> obj vu-time)) + (format #t "[~8x] ~A~%" this 'profile-segment) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tend-time: ~D~%" (-> this end-time)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tvu-count: ~D~%" (-> this vu-count)) + (format #t "~1Tdepth: ~D~%" (-> this depth)) + (format #t "~1Tcolor: #x~X~%" (-> this color)) + (format #t "~1Tcode-time: ~D~%" (-> this code-time)) + (format #t "~1Tvu-time: ~D~%" (-> this vu-time)) (label cfg-4) - obj + this ) ;; definition of type profile-collapse @@ -50,16 +50,16 @@ ) ;; definition for method 3 of type profile-collapse -(defmethod inspect profile-collapse ((obj profile-collapse)) - (when (not obj) - (set! obj obj) +(defmethod inspect profile-collapse ((this profile-collapse)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'profile-collapse) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tdata[48] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'profile-collapse) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tdata[48] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type profile-segment-array @@ -83,20 +83,20 @@ ) ;; definition for method 3 of type profile-segment-array -(defmethod inspect profile-segment-array ((obj profile-segment-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect profile-segment-array ((this profile-segment-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tdepth: ~D~%" (-> obj depth)) - (format #t "~1Tmax-depth: ~D~%" (-> obj max-depth)) - (format #t "~1Tbase-time: ~D~%" (-> obj base-time)) - (format #t "~1Tsegment[9] @ #x~X~%" (-> obj segment)) - (format #t "~1Tdata[512] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tdepth: ~D~%" (-> this depth)) + (format #t "~1Tmax-depth: ~D~%" (-> this max-depth)) + (format #t "~1Tbase-time: ~D~%" (-> this base-time)) + (format #t "~1Tsegment[9] @ #x~X~%" (-> this segment)) + (format #t "~1Tdata[512] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type profile-array @@ -114,20 +114,20 @@ ) ;; definition for method 3 of type profile-array -(defmethod inspect profile-array ((obj profile-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect profile-array ((this profile-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'profile-array) - (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'profile-array) + (format #t "~1Tdata[2] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for method 9 of type profile-segment-array -(defmethod get-total-time profile-segment-array ((obj profile-segment-array)) - (- (-> obj data 0 end-time) (-> obj data 0 start-time)) +(defmethod get-total-time profile-segment-array ((this profile-segment-array)) + (- (-> this data 0 end-time) (-> this data 0 start-time)) ) ;; definition for symbol *profile-gap-color*, type rgba @@ -250,6 +250,3 @@ (define *profile-interrupt-start* #f) ) - - - diff --git a/test/decompiler/reference/jak2/engine/util/profile_REF.gc b/test/decompiler/reference/jak2/engine/util/profile_REF.gc index 189ba9540f..038928763c 100644 --- a/test/decompiler/reference/jak2/engine/util/profile_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/profile_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type profile-work -(defmethod inspect profile-work ((obj profile-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect profile-work ((this profile-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'profile-work) - (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) - (format #t "~1Tline-tmpl: #~%" (-> obj line-tmpl)) - (format #t "~1Tlast-index: ~D~%" (-> obj last-index)) + (format #t "[~8x] ~A~%" this 'profile-work) + (format #t "~1Tsprite-tmpl: #~%" (-> this sprite-tmpl)) + (format #t "~1Tline-tmpl: #~%" (-> this line-tmpl)) + (format #t "~1Tlast-index: ~D~%" (-> this last-index)) (label cfg-4) - obj + this ) ;; definition for symbol *profile-work*, type profile-work @@ -77,32 +77,32 @@ ;; definition for method 10 of type profile-segment-array ;; WARN: Return type mismatch int vs none. -(defmethod start-frame! profile-segment-array ((obj profile-segment-array)) - (set! (-> obj count) 0) - (set! (-> obj depth) 0) - (set! (-> obj max-depth) 0) - (set! (-> obj base-time) (the-as int (timer-count (the-as timer-bank #x10000800)))) - (start-segment! obj 'all *profile-all-color*) +(defmethod start-frame! profile-segment-array ((this profile-segment-array)) + (set! (-> this count) 0) + (set! (-> this depth) 0) + (set! (-> this max-depth) 0) + (set! (-> this base-time) (the-as int (timer-count (the-as timer-bank #x10000800)))) + (start-segment! this 'all *profile-all-color*) 0 (none) ) ;; definition for method 11 of type profile-segment-array ;; WARN: Return type mismatch int vs none. -(defmethod start-segment! profile-segment-array ((obj profile-segment-array) (arg0 symbol) (arg1 rgba)) +(defmethod start-segment! profile-segment-array ((this profile-segment-array) (arg0 symbol) (arg1 rgba)) (when (and *dproc* *debug-segment*) - (let ((s4-0 (-> obj data (-> obj count)))) - (let ((s3-0 (-> obj base-time))) + (let ((s4-0 (-> this data (-> this count)))) + (let ((s3-0 (-> this base-time))) (set! (-> s4-0 name) arg0) (set! (-> s4-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-0)))) ) - (set! (-> s4-0 depth) (the-as uint (-> obj depth))) + (set! (-> s4-0 depth) (the-as uint (-> this depth))) (set! (-> s4-0 color) arg1) - (set! (-> obj segment (-> obj depth)) s4-0) + (set! (-> this segment (-> this depth)) s4-0) ) - (+! (-> obj count) 1) - (+! (-> obj depth) 1) - (set! (-> obj max-depth) (max (-> obj max-depth) (-> obj depth))) + (+! (-> this count) 1) + (+! (-> this depth) 1) + (set! (-> this max-depth) (max (-> this max-depth) (-> this depth))) ) 0 (none) @@ -110,15 +110,15 @@ ;; definition for method 12 of type profile-segment-array ;; WARN: Return type mismatch int vs none. -(defmethod end-segment! profile-segment-array ((obj profile-segment-array)) +(defmethod end-segment! profile-segment-array ((this profile-segment-array)) (when (and *dproc* *debug-segment*) - (let* ((v1-4 (+ (-> obj depth) -1)) - (s5-0 (-> obj segment v1-4)) - (s4-0 (-> obj base-time)) + (let* ((v1-4 (+ (-> this depth) -1)) + (s5-0 (-> this segment v1-4)) + (s4-0 (-> this base-time)) ) (when (>= v1-4 0) (set! (-> s5-0 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-0)))) - (+! (-> obj depth) -1) + (+! (-> this depth) -1) ) ) ) @@ -402,12 +402,12 @@ ;; definition for method 9 of type profile-array ;; WARN: Return type mismatch int vs none. -(defmethod setup-categories! profile-array ((obj profile-array)) +(defmethod setup-categories! profile-array ((this profile-array)) (dotimes (s5-0 2) (let ((s3-0 (-> *profile-array* data s5-0)) (s4-0 *profile-collapse*) ) - (mem-copy! (&-> s3-0 type) (&-> (-> obj data s5-0) type) 8240) + (mem-copy! (&-> s3-0 type) (&-> (-> this data s5-0) type) 8240) (cond ((zero? s5-0) ((lambda ((arg0 profile-segment-array) (arg1 profile-collapse)) @@ -561,8 +561,7 @@ ;; definition for method 10 of type profile-array ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -;; ERROR: Failed store: (s.w! (+ a0-1 8) 0) at op 7 -(defmethod draw-bars! profile-array ((obj profile-array) (arg0 dma-buffer) (arg1 int)) +(defmethod draw-bars! profile-array ((this profile-array) (arg0 dma-buffer) (arg1 int)) (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object))) (dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)) @@ -586,7 +585,7 @@ ) (&+! (-> arg0 base) 80) (dotimes (s3-0 2) - (let* ((v1-12 (-> obj data s3-0)) + (let* ((v1-12 (-> this data s3-0)) (a0-11 (-> v1-12 max-depth)) (s2-1 (max 14 (* a0-11 2))) ) @@ -740,7 +739,7 @@ ;; definition for method 11 of type profile-array ;; WARN: Return type mismatch int vs none. -(defmethod draw-text! profile-array ((obj profile-array)) +(defmethod draw-text! profile-array ((this profile-array)) (let ((gp-0 *profile-collapse*)) (dotimes (s5-0 (-> gp-0 count)) (when (or (nonzero? (-> gp-0 data s5-0 count)) (nonzero? (-> gp-0 data s5-0 vu-count))) diff --git a/test/decompiler/reference/jak2/engine/util/script-h_REF.gc b/test/decompiler/reference/jak2/engine/util/script-h_REF.gc index 9d4718c822..9c2cb11fd9 100644 --- a/test/decompiler/reference/jak2/engine/util/script-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/script-h_REF.gc @@ -17,17 +17,17 @@ ) ;; definition for method 3 of type script-form -(defmethod inspect script-form ((obj script-form)) - (when (not obj) - (set! obj obj) +(defmethod inspect script-form ((this script-form)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'script-form) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tspec: ~A~%" (-> obj spec)) - (format #t "~1Tfunc: ~A~%" (-> obj func)) + (format #t "[~8x] ~A~%" this 'script-form) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tspec: ~A~%" (-> this spec)) + (format #t "~1Tfunc: ~A~%" (-> this func)) (label cfg-4) - obj + this ) ;; definition of type script-context @@ -55,30 +55,30 @@ ) ;; definition for method 3 of type script-context -(defmethod inspect script-context ((obj script-context)) - (when (not obj) - (set! obj obj) +(defmethod inspect script-context ((this script-context)) + (when (not this) + (set! this this) (goto cfg-10) ) - (format #t "[~8x] ~A~%" obj 'script-context) - (format #t "~1Tload-state: ~A~%" (-> obj load-state)) - (format #t "~1Tkey: ~A~%" (-> obj key)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Ttrans: #~%" (-> obj trans)) - (format #t "~1Tside-effect?: ~A~%" (-> obj side-effect?)) - (format #t "~1Tgot-error?: ~A~%" (-> obj got-error?)) - (format #t "~1Texpr: ~A~%" (-> obj expr)) - (format #t "~1Tparam-count: ~D~%" (-> obj param-count)) - (format #t "~1Tparam[16] @ #x~X~%" (-> obj param)) - (dotimes (s5-0 (-> obj param-count)) - (format #t "~T [~D]~1Tparam: ~`object`P~%" s5-0 (-> obj param s5-0)) + (format #t "[~8x] ~A~%" this 'script-context) + (format #t "~1Tload-state: ~A~%" (-> this load-state)) + (format #t "~1Tkey: ~A~%" (-> this key)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tside-effect?: ~A~%" (-> this side-effect?)) + (format #t "~1Tgot-error?: ~A~%" (-> this got-error?)) + (format #t "~1Texpr: ~A~%" (-> this expr)) + (format #t "~1Tparam-count: ~D~%" (-> this param-count)) + (format #t "~1Tparam[16] @ #x~X~%" (-> this param)) + (dotimes (s5-0 (-> this param-count)) + (format #t "~T [~D]~1Tparam: ~`object`P~%" s5-0 (-> this param s5-0)) ) - (format #t "~1Tparam-type[16] @ #x~X~%" (-> obj param-type)) - (dotimes (s5-1 (-> obj param-count)) - (format #t "~T [~D]~1Tparam-type: ~`object`P~%" s5-1 (-> obj param-type s5-1)) + (format #t "~1Tparam-type[16] @ #x~X~%" (-> this param-type)) + (dotimes (s5-1 (-> this param-count)) + (format #t "~T [~D]~1Tparam-type: ~`object`P~%" s5-1 (-> this param-type s5-1)) ) (label cfg-10) - obj + this ) ;; definition for method 0 of type script-context diff --git a/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc b/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc index fce7690b82..5d05ecdf06 100644 --- a/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc @@ -26,60 +26,60 @@ ) ;; definition for method 3 of type smush-control -(defmethod inspect smush-control ((obj smush-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect smush-control ((this smush-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'smush-control) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Tperiod: ~f~%" (-> obj period)) - (format #t "~1Tduration: ~f~%" (-> obj duration)) - (format #t "~1Tamp: ~f~%" (-> obj amp)) - (format #t "~1Tdamp-amp: ~f~%" (-> obj damp-amp)) - (format #t "~1Tdamp-period: ~f~%" (-> obj damp-period)) - (format #t "~1Tticks: ~f~%" (-> obj ticks)) + (format #t "[~8x] ~A~%" this 'smush-control) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tperiod: ~f~%" (-> this period)) + (format #t "~1Tduration: ~f~%" (-> this duration)) + (format #t "~1Tamp: ~f~%" (-> this amp)) + (format #t "~1Tdamp-amp: ~f~%" (-> this damp-amp)) + (format #t "~1Tdamp-period: ~f~%" (-> this damp-period)) + (format #t "~1Tticks: ~f~%" (-> this ticks)) (label cfg-4) - obj + this ) ;; definition for method 13 of type smush-control -(defmethod nonzero-amplitude? smush-control ((obj smush-control)) - (!= (-> obj amp) 0.0) +(defmethod nonzero-amplitude? smush-control ((this smush-control)) + (!= (-> this amp) 0.0) ) ;; definition for method 9 of type smush-control -(defmethod set-zero! smush-control ((obj smush-control)) - (set! (-> obj period) 0.0) - (set! (-> obj duration) 0.0) - (set! (-> obj amp) 0.0) - (set! (-> obj damp-amp) 0.0) - (set! (-> obj damp-period) 0.0) - (set! (-> obj ticks) 0.0) - obj +(defmethod set-zero! smush-control ((this smush-control)) + (set! (-> this period) 0.0) + (set! (-> this duration) 0.0) + (set! (-> this amp) 0.0) + (set! (-> this damp-amp) 0.0) + (set! (-> this damp-period) 0.0) + (set! (-> this ticks) 0.0) + this ) ;; definition for method 10 of type smush-control -(defmethod update! smush-control ((obj smush-control)) +(defmethod update! smush-control ((this smush-control)) (cond - ((!= (-> obj amp) 0.0) - (let* ((f30-0 (the float (- (current-time) (-> obj start-time)))) - (f0-2 (-> obj period)) + ((!= (-> this amp) 0.0) + (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) + (f0-2 (-> this period)) (f28-0 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) ) - (when (>= (- f30-0 (-> obj ticks)) (-> obj period)) - (set! (-> obj amp) (* (-> obj amp) (-> obj damp-amp))) - (set! (-> obj period) (* (-> obj period) (-> obj damp-period))) - (set! (-> obj ticks) f30-0) - (if (< (-> obj damp-period) 0.0) - (set-zero! obj) + (when (>= (- f30-0 (-> this ticks)) (-> this period)) + (set! (-> this amp) (* (-> this amp) (-> this damp-amp))) + (set! (-> this period) (* (-> this period) (-> this damp-period))) + (set! (-> this ticks) f30-0) + (if (< (-> this damp-period) 0.0) + (set-zero! this) ) ) - (if (>= f30-0 (-> obj duration)) - (set-zero! obj) + (if (>= f30-0 (-> this duration)) + (set-zero! this) ) - (* (sin (/ (* 65536.0 f28-0) (-> obj period))) - (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + (* (sin (/ (* 65536.0 f28-0) (-> this period))) + (* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration))) ) ) ) @@ -90,15 +90,15 @@ ) ;; definition for method 11 of type smush-control -(defmethod get-no-update smush-control ((obj smush-control)) +(defmethod get-no-update smush-control ((this smush-control)) (cond - ((!= (-> obj amp) 0.0) - (let* ((f30-0 (the float (- (current-time) (-> obj start-time)))) - (f0-2 (-> obj period)) + ((!= (-> this amp) 0.0) + (let* ((f30-0 (the float (- (current-time) (-> this start-time)))) + (f0-2 (-> this period)) (f0-4 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) ) - (* (sin (/ (* 65536.0 f0-4) (-> obj period))) - (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + (* (sin (/ (* 65536.0 f0-4) (-> this period))) + (* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration))) ) ) ) @@ -109,23 +109,23 @@ ) ;; definition for method 14 of type smush-control -(defmethod die-on-next-update! smush-control ((obj smush-control)) - (if (!= (-> obj amp) 0.0) - (set! (-> obj damp-period) -1.0) +(defmethod die-on-next-update! smush-control ((this smush-control)) + (if (!= (-> this amp) 0.0) + (set! (-> this damp-period) -1.0) ) - obj + this ) ;; definition for method 12 of type smush-control -(defmethod activate! smush-control ((obj smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) - (when (>= (fabs (* 0.2 (-> obj amp))) (fabs (get-no-update obj))) - (set! (-> obj amp) arg0) - (set! (-> obj period) (the float arg1)) - (set! (-> obj duration) (the float arg2)) - (set! (-> obj damp-amp) arg3) - (set! (-> obj damp-period) arg4) - (set! (-> obj ticks) 0.0) - (set! (-> obj start-time) (-> arg5 frame-counter)) +(defmethod activate! smush-control ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) + (when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this))) + (set! (-> this amp) arg0) + (set! (-> this period) (the float arg1)) + (set! (-> this duration) (the float arg2)) + (set! (-> this damp-amp) arg3) + (set! (-> this damp-period) arg4) + (set! (-> this ticks) 0.0) + (set! (-> this start-time) (-> arg5 frame-counter)) ) - obj + this ) diff --git a/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc b/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc index 7bee344ec7..8c6ebf7083 100644 --- a/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc @@ -19,23 +19,23 @@ ) ;; definition for method 3 of type sync-info-params -(defmethod inspect sync-info-params ((obj sync-info-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect sync-info-params ((this sync-info-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sync-info-params) - (format #t "~1Tsync-type: ~A~%" (-> obj sync-type)) - (format #t "~1Tsync-flags: ~D~%" (-> obj sync-flags)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tperiod: ~D~%" (-> obj period)) - (format #t "~1Tpercent: ~f~%" (-> obj percent)) - (format #t "~1Tease-in: ~f~%" (-> obj ease-in)) - (format #t "~1Tease-out: ~f~%" (-> obj ease-out)) - (format #t "~1Tpause-in: ~f~%" (-> obj pause-in)) - (format #t "~1Tpause-out: ~f~%" (-> obj pause-out)) + (format #t "[~8x] ~A~%" this 'sync-info-params) + (format #t "~1Tsync-type: ~A~%" (-> this sync-type)) + (format #t "~1Tsync-flags: ~D~%" (-> this sync-flags)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (format #t "~1Tpercent: ~f~%" (-> this percent)) + (format #t "~1Tease-in: ~f~%" (-> this ease-in)) + (format #t "~1Tease-out: ~f~%" (-> this ease-out)) + (format #t "~1Tpause-in: ~f~%" (-> this pause-in)) + (format #t "~1Tpause-out: ~f~%" (-> this pause-out)) (label cfg-4) - obj + this ) ;; definition of type sync-info @@ -59,17 +59,17 @@ ) ;; definition for method 3 of type sync-info -(defmethod inspect sync-info ((obj sync-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect sync-info ((this sync-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sync-info) - (format #t "~1Tsync-flags: ~D~%" (-> obj sync-flags)) - (format #t "~1Toffset: ~f~%" (-> obj offset)) - (format #t "~1Tperiod: ~D~%" (-> obj period)) + (format #t "[~8x] ~A~%" this 'sync-info) + (format #t "~1Tsync-flags: ~D~%" (-> this sync-flags)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tperiod: ~D~%" (-> this period)) (label cfg-4) - obj + this ) ;; definition of type sync-linear @@ -82,17 +82,17 @@ ) ;; definition for method 3 of type sync-linear -(defmethod inspect sync-linear ((obj sync-linear)) - (when (not obj) - (set! obj obj) +(defmethod inspect sync-linear ((this sync-linear)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sync-linear) - (format #t "~1Tsync-flags: ~D~%" (-> obj sync-flags)) - (format #t "~1Toffset: ~f~%" (-> obj offset)) - (format #t "~1Tperiod: ~D~%" (-> obj period)) + (format #t "[~8x] ~A~%" this 'sync-linear) + (format #t "~1Tsync-flags: ~D~%" (-> this sync-flags)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tperiod: ~D~%" (-> this period)) (label cfg-4) - obj + this ) ;; definition of type sync-eased @@ -112,24 +112,24 @@ ) ;; definition for method 3 of type sync-eased -(defmethod inspect sync-eased ((obj sync-eased)) - (when (not obj) - (set! obj obj) +(defmethod inspect sync-eased ((this sync-eased)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sync-eased) - (format #t "~1Tsync-flags: ~D~%" (-> obj sync-flags)) - (format #t "~1Toffset: ~f~%" (-> obj offset)) - (format #t "~1Tperiod: ~D~%" (-> obj period)) - (format #t "~1Ttlo: ~f~%" (-> obj tlo)) - (format #t "~1Tthi: ~f~%" (-> obj thi)) - (format #t "~1Tylo: ~f~%" (-> obj ylo)) - (format #t "~1Tm2: ~f~%" (-> obj m2)) - (format #t "~1Tyend: ~f~%" (-> obj yend)) - (format #t "~1Tpause-in: ~f~%" (-> obj pause-in)) - (format #t "~1Tpause-out: ~f~%" (-> obj pause-out)) + (format #t "[~8x] ~A~%" this 'sync-eased) + (format #t "~1Tsync-flags: ~D~%" (-> this sync-flags)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (format #t "~1Ttlo: ~f~%" (-> this tlo)) + (format #t "~1Tthi: ~f~%" (-> this thi)) + (format #t "~1Tylo: ~f~%" (-> this ylo)) + (format #t "~1Tm2: ~f~%" (-> this m2)) + (format #t "~1Tyend: ~f~%" (-> this yend)) + (format #t "~1Tpause-in: ~f~%" (-> this pause-in)) + (format #t "~1Tpause-out: ~f~%" (-> this pause-out)) (label cfg-4) - obj + this ) ;; definition of type sync-paused @@ -143,19 +143,19 @@ ) ;; definition for method 3 of type sync-paused -(defmethod inspect sync-paused ((obj sync-paused)) - (when (not obj) - (set! obj obj) +(defmethod inspect sync-paused ((this sync-paused)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sync-paused) - (format #t "~1Tsync-flags: ~D~%" (-> obj sync-flags)) - (format #t "~1Toffset: ~f~%" (-> obj offset)) - (format #t "~1Tperiod: ~D~%" (-> obj period)) - (format #t "~1Tpause-in: ~f~%" (-> obj pause-in)) - (format #t "~1Tpause-out: ~f~%" (-> obj pause-out)) + (format #t "[~8x] ~A~%" this 'sync-paused) + (format #t "~1Tsync-flags: ~D~%" (-> this sync-flags)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tperiod: ~D~%" (-> this period)) + (format #t "~1Tpause-in: ~f~%" (-> this pause-in)) + (format #t "~1Tpause-out: ~f~%" (-> this pause-out)) (label cfg-4) - obj + this ) ;; definition of type delayed-rand-float @@ -180,20 +180,20 @@ ) ;; definition for method 3 of type delayed-rand-float -(defmethod inspect delayed-rand-float ((obj delayed-rand-float)) - (when (not obj) - (set! obj obj) +(defmethod inspect delayed-rand-float ((this delayed-rand-float)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'delayed-rand-float) - (format #t "~1Tmin-time: ~D~%" (-> obj min-time)) - (format #t "~1Tmax-time: ~D~%" (-> obj max-time)) - (format #t "~1Tmax-val: ~f~%" (-> obj max-val)) - (format #t "~1Ttimer: ~D~%" (-> obj timer)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Tvalue: ~f~%" (-> obj value)) + (format #t "[~8x] ~A~%" this 'delayed-rand-float) + (format #t "~1Tmin-time: ~D~%" (-> this min-time)) + (format #t "~1Tmax-time: ~D~%" (-> this max-time)) + (format #t "~1Tmax-val: ~f~%" (-> this max-val)) + (format #t "~1Ttimer: ~D~%" (-> this timer)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tvalue: ~f~%" (-> this value)) (label cfg-4) - obj + this ) ;; definition of type oscillating-float @@ -216,20 +216,20 @@ ) ;; definition for method 3 of type oscillating-float -(defmethod inspect oscillating-float ((obj oscillating-float)) - (when (not obj) - (set! obj obj) +(defmethod inspect oscillating-float ((this oscillating-float)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'oscillating-float) - (format #t "~1Tvalue: ~f~%" (-> obj value)) - (format #t "~1Ttarget: ~f~%" (-> obj target)) - (format #t "~1Tvel: ~f~%" (-> obj vel)) - (format #t "~1Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~1Tdamping: ~f~%" (-> obj damping)) - (format #t "~1Taccel: ~f~%" (-> obj accel)) + (format #t "[~8x] ~A~%" this 'oscillating-float) + (format #t "~1Tvalue: ~f~%" (-> this value)) + (format #t "~1Ttarget: ~f~%" (-> this target)) + (format #t "~1Tvel: ~f~%" (-> this vel)) + (format #t "~1Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~1Tdamping: ~f~%" (-> this damping)) + (format #t "~1Taccel: ~f~%" (-> this accel)) (label cfg-4) - obj + this ) ;; definition of type bouncing-float @@ -253,19 +253,19 @@ ) ;; definition for method 3 of type bouncing-float -(defmethod inspect bouncing-float ((obj bouncing-float)) - (when (not obj) - (set! obj obj) +(defmethod inspect bouncing-float ((this bouncing-float)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bouncing-float) - (format #t "~1Tosc: #~%" (-> obj osc)) - (format #t "~1Tmax-value: ~f~%" (-> obj max-value)) - (format #t "~1Tmin-value: ~f~%" (-> obj min-value)) - (format #t "~1Telasticity: ~f~%" (-> obj elasticity)) - (format #t "~1Tstate: ~D~%" (-> obj state)) + (format #t "[~8x] ~A~%" this 'bouncing-float) + (format #t "~1Tosc: #~%" (-> this osc)) + (format #t "~1Tmax-value: ~f~%" (-> this max-value)) + (format #t "~1Tmin-value: ~f~%" (-> this min-value)) + (format #t "~1Telasticity: ~f~%" (-> this elasticity)) + (format #t "~1Tstate: ~D~%" (-> this state)) (label cfg-4) - obj + this ) ;; definition of type delayed-rand-vector @@ -290,21 +290,21 @@ ) ;; definition for method 3 of type delayed-rand-vector -(defmethod inspect delayed-rand-vector ((obj delayed-rand-vector)) - (when (not obj) - (set! obj obj) +(defmethod inspect delayed-rand-vector ((this delayed-rand-vector)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'delayed-rand-vector) - (format #t "~1Tmin-time: ~D~%" (-> obj min-time)) - (format #t "~1Tmax-time: ~D~%" (-> obj max-time)) - (format #t "~1Txz-max: ~f~%" (-> obj xz-max)) - (format #t "~1Ty-max: ~f~%" (-> obj y-max)) - (format #t "~1Ttimer: ~D~%" (-> obj timer)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Tvalue: #~%" (-> obj value)) + (format #t "[~8x] ~A~%" this 'delayed-rand-vector) + (format #t "~1Tmin-time: ~D~%" (-> this min-time)) + (format #t "~1Tmax-time: ~D~%" (-> this max-time)) + (format #t "~1Txz-max: ~f~%" (-> this xz-max)) + (format #t "~1Ty-max: ~f~%" (-> this y-max)) + (format #t "~1Ttimer: ~D~%" (-> this timer)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tvalue: #~%" (-> this value)) (label cfg-4) - obj + this ) ;; definition of type oscillating-vector @@ -326,20 +326,20 @@ ) ;; definition for method 3 of type oscillating-vector -(defmethod inspect oscillating-vector ((obj oscillating-vector)) - (when (not obj) - (set! obj obj) +(defmethod inspect oscillating-vector ((this oscillating-vector)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'oscillating-vector) - (format #t "~1Tvalue: #~%" (-> obj value)) - (format #t "~1Ttarget: #~%" (-> obj target)) - (format #t "~1Tvel: #~%" (-> obj vel)) - (format #t "~1Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~1Tdamping: ~f~%" (-> obj damping)) - (format #t "~1Taccel: ~f~%" (-> obj accel)) + (format #t "[~8x] ~A~%" this 'oscillating-vector) + (format #t "~1Tvalue: #~%" (-> this value)) + (format #t "~1Ttarget: #~%" (-> this target)) + (format #t "~1Tvel: #~%" (-> this vel)) + (format #t "~1Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~1Tdamping: ~f~%" (-> this damping)) + (format #t "~1Taccel: ~f~%" (-> this accel)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc b/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc index 80f8fb8d88..f92182b7bf 100644 --- a/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/sync-info_REF.gc @@ -3,68 +3,68 @@ ;; definition for method 13 of type sync-info ;; WARN: Return type mismatch object vs none. -(defmethod initialize! sync-info ((obj sync-info) (arg0 sync-info-params)) +(defmethod initialize! sync-info ((this sync-info) (arg0 sync-info-params)) "Set up a sync-info from params." (format 0 "ERROR: Invalid call to sync-info::initialize!~%") (none) ) ;; definition for method 9 of type sync-info -(defmethod get-current-phase-no-mod sync-info ((obj sync-info)) +(defmethod get-current-phase-no-mod sync-info ((this sync-info)) "Get the current value, with no fancy modifications." - (let* ((v1-0 (-> obj period)) + (let* ((v1-0 (-> this period)) (f0-1 (the float v1-0)) - (f1-2 (+ (the float (mod (the-as uint (current-time)) v1-0)) (-> obj offset))) + (f1-2 (+ (the float (mod (the-as uint (current-time)) v1-0)) (-> this offset))) ) (/ (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)) f0-1) ) ) ;; definition for method 10 of type sync-info -(defmethod get-phase-offset sync-info ((obj sync-info)) +(defmethod get-phase-offset sync-info ((this sync-info)) "Get the offset, as a fraction of period" - (/ (-> obj offset) (the float (-> obj period))) + (/ (-> this offset) (the float (-> this period))) ) ;; definition for method 15 of type sync-info ;; WARN: Return type mismatch int vs none. -(defmethod sync-now! sync-info ((obj sync-info) (arg0 float)) +(defmethod sync-now! sync-info ((this sync-info) (arg0 float)) "Adjust our offset so our current phase is the given phase." - (let* ((a2-0 (-> obj period)) + (let* ((a2-0 (-> this period)) (f0-1 (the float a2-0)) (v1-0 (- arg0 (* (the float (the int (/ arg0 f0-1))) f0-1))) - (f1-4 (+ (the float (mod (the-as uint (current-time)) a2-0)) (-> obj offset))) + (f1-4 (+ (the float (mod (the-as uint (current-time)) a2-0)) (-> this offset))) (f1-6 (/ (- f1-4 (* (the float (the int (/ f1-4 f0-1))) f0-1)) f0-1)) - (f1-10 (+ (* (- v1-0 f1-6) f0-1) f0-1 (-> obj offset))) + (f1-10 (+ (* (- v1-0 f1-6) f0-1) f0-1 (-> this offset))) ) - (set! (-> obj offset) (- f1-10 (* (the float (the int (/ f1-10 f0-1))) f0-1))) + (set! (-> this offset) (- f1-10 (* (the float (the int (/ f1-10 f0-1))) f0-1))) ) 0 (none) ) ;; definition for method 11 of type sync-info -(defmethod get-norm! sync-info ((obj sync-info) (arg0 int)) +(defmethod get-norm! sync-info ((this sync-info) (arg0 int)) "Get the current value, from 0 to 1." (format 0 "ERROR: Unsupported sync-info::get-norm!~%") 0.0 ) ;; definition for method 12 of type sync-info -(defmethod get-scaled-val! sync-info ((obj sync-info) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! sync-info ((this sync-info) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" - (* (get-norm! obj arg1) arg0) + (* (get-norm! this arg1) arg0) ) ;; definition for method 14 of type sync-info -(defmethod get-timeframe-offset! sync-info ((obj sync-info) (arg0 time-frame)) +(defmethod get-timeframe-offset! sync-info ((this sync-info) (arg0 time-frame)) "Get the difference between the given time-frame and when this sync-info is at 0." (if (zero? arg0) (set! arg0 (current-time)) ) - (let* ((v1-4 (-> obj period)) + (let* ((v1-4 (-> this period)) (f0-1 (the float v1-4)) - (f1-2 (+ (the float (mod arg0 (the-as time-frame v1-4))) (-> obj offset))) + (f1-2 (+ (the float (mod arg0 (the-as time-frame v1-4))) (-> this offset))) ) (+ arg0 (the int (- f0-1 (* (/ (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1)) f0-1) f0-1)))) ) @@ -73,7 +73,7 @@ ;; definition for method 13 of type sync-linear ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-linear ((obj sync-linear) (arg0 sync-info-params)) +(defmethod initialize! sync-linear ((this sync-linear) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-linear) @@ -83,7 +83,7 @@ (-> arg0 sync-type) ) ) - (set! (-> obj sync-flags) (-> arg0 sync-flags)) + (set! (-> this sync-flags) (-> arg0 sync-flags)) (let ((s4-0 (the-as int (-> arg0 period))) (f30-0 (-> arg0 percent)) ) @@ -98,29 +98,29 @@ ) ) ) - (set! (-> obj period) (the-as uint s4-0)) + (set! (-> this period) (the-as uint s4-0)) (let* ((f0-4 (the float s4-0)) (f1-1 (* f30-0 f0-4)) ) - (set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) + (set! (-> this offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) ) ) (none) ) ;; definition for method 11 of type sync-linear -(defmethod get-norm! sync-linear ((obj sync-linear) (arg0 int)) +(defmethod get-norm! sync-linear ((this sync-linear) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) ) - (let* ((v1-4 (-> obj period)) + (let* ((v1-4 (-> this period)) (f0-1 (the float v1-4)) ) (cond - ((logtest? (-> obj sync-flags) (sync-flags pong)) + ((logtest? (-> this sync-flags) (sync-flags pong)) (let* ((f1-0 2.0) - (f2-2 (+ (the float (mod arg0 (the-as int v1-4))) (-> obj offset))) + (f2-2 (+ (the float (mod arg0 (the-as int v1-4))) (-> this offset))) (f0-3 (* f1-0 (/ (- f2-2 (* (the float (the int (/ f2-2 f0-1))) f0-1)) f0-1))) ) (if (>= f0-3 1.0) @@ -130,7 +130,7 @@ ) ) (else - (let ((f1-5 (+ (the float (mod arg0 (the-as int v1-4))) (-> obj offset)))) + (let ((f1-5 (+ (the float (mod arg0 (the-as int v1-4))) (-> this offset)))) (/ (- f1-5 (* (the float (the int (/ f1-5 f0-1))) f0-1)) f0-1) ) ) @@ -139,15 +139,15 @@ ) ;; definition for method 12 of type sync-linear -(defmethod get-scaled-val! sync-linear ((obj sync-linear) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! sync-linear ((this sync-linear) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" - (* (get-norm! obj arg1) arg0) + (* (get-norm! this arg1) arg0) ) ;; definition for method 13 of type sync-eased ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-eased ((obj sync-eased) (arg0 sync-info-params)) +(defmethod initialize! sync-eased ((this sync-eased) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-eased) @@ -157,7 +157,7 @@ (-> arg0 sync-type) ) ) - (set! (-> obj sync-flags) (-> arg0 sync-flags)) + (set! (-> this sync-flags) (-> arg0 sync-flags)) (let ((s5-0 (the-as int (-> arg0 period))) (f22-0 (-> arg0 percent)) (f24-0 (-> arg0 pause-in)) @@ -184,11 +184,11 @@ ) ) ) - (set! (-> obj period) (the-as uint s5-0)) + (set! (-> this period) (the-as uint s5-0)) (let* ((f0-4 (the float s5-0)) (f1-1 (* f22-0 f0-4)) ) - (set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) + (set! (-> this offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) ) (cond ((< f26-0 0.0) @@ -207,8 +207,8 @@ ) ) (let ((f0-14 (the float s5-0))) - (set! (-> obj pause-in) (* f24-0 f0-14)) - (set! (-> obj pause-out) (* f26-0 f0-14)) + (set! (-> this pause-in) (* f24-0 f0-14)) + (set! (-> this pause-out) (* f26-0 f0-14)) ) (if (< f30-0 0.0) (set! f30-0 0.0) @@ -235,11 +235,11 @@ (f4-3 (/ f0-21 (- 1.0 f1-7))) (f3-4 (+ (* (- 1.0 f1-7) (- 1.0 f1-7) f4-3) f3-3)) ) - (set! (-> obj tlo) f0-21) - (set! (-> obj thi) f1-7) - (set! (-> obj ylo) f2-3) - (set! (-> obj m2) f4-3) - (set! (-> obj yend) f3-4) + (set! (-> this tlo) f0-21) + (set! (-> this thi) f1-7) + (set! (-> this ylo) f2-3) + (set! (-> this m2) f4-3) + (set! (-> this yend) f3-4) ) ) ) @@ -247,21 +247,21 @@ ) ;; definition for method 11 of type sync-eased -(defmethod get-norm! sync-eased ((obj sync-eased) (arg0 int)) +(defmethod get-norm! sync-eased ((this sync-eased) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) ) - (let* ((v1-4 (-> obj period)) + (let* ((v1-4 (-> this period)) (f3-0 (the float v1-4)) - (f0-1 (-> obj pause-in)) - (f2-0 (-> obj pause-out)) + (f0-1 (-> this pause-in)) + (f2-0 (-> this pause-out)) (f1-1 (* 0.5 (- f3-0 (+ f0-1 f2-0)))) ) (the int (+ f0-1 f2-0 f3-0)) (cond - ((logtest? (-> obj sync-flags) (sync-flags pong)) - (let* ((f4-7 (+ (the float (mod arg0 (the-as int v1-4))) (-> obj offset))) + ((logtest? (-> this sync-flags) (sync-flags pong)) + (let* ((f4-7 (+ (the float (mod arg0 (the-as int v1-4))) (-> this offset))) (f3-2 (- f4-7 (* (the float (the int (/ f4-7 f3-0))) f3-0))) (v1-6 #f) ) @@ -280,21 +280,21 @@ ) ) (let* ((f0-3 (/ (- f3-2 f0-1) f1-1)) - (f1-2 (-> obj tlo)) + (f1-2 (-> this tlo)) (f0-8 (/ (cond ((< f0-3 f1-2) (* f0-3 f0-3) ) - ((< f0-3 (-> obj thi)) - (+ (* 2.0 f1-2 (- f0-3 f1-2)) (-> obj ylo)) + ((< f0-3 (-> this thi)) + (+ (* 2.0 f1-2 (- f0-3 f1-2)) (-> this ylo)) ) (else (let ((f1-5 (- 1.0 f0-3))) - (- (-> obj yend) (* f1-5 f1-5 (-> obj m2))) + (- (-> this yend) (* f1-5 f1-5 (-> this m2))) ) ) ) - (-> obj yend) + (-> this yend) ) ) ) @@ -314,15 +314,15 @@ ) ;; definition for method 12 of type sync-eased -(defmethod get-scaled-val! sync-eased ((obj sync-eased) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! sync-eased ((this sync-eased) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" - (* (get-norm! obj arg1) arg0) + (* (get-norm! this arg1) arg0) ) ;; definition for method 13 of type sync-paused ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod initialize! sync-paused ((obj sync-paused) (arg0 sync-info-params)) +(defmethod initialize! sync-paused ((this sync-paused) (arg0 sync-info-params)) "Set up a sync-info from params." (local-vars (sv-16 res-tag)) (if (!= (-> arg0 sync-type) 'sync-paused) @@ -332,7 +332,7 @@ (-> arg0 sync-type) ) ) - (set! (-> obj sync-flags) (-> arg0 sync-flags)) + (set! (-> this sync-flags) (-> arg0 sync-flags)) (let ((s5-0 (the-as int (-> arg0 period))) (f26-0 (-> arg0 percent)) (f28-0 (-> arg0 pause-in)) @@ -353,11 +353,11 @@ ) ) ) - (set! (-> obj period) (the-as uint s5-0)) + (set! (-> this period) (the-as uint s5-0)) (let* ((f0-4 (the float s5-0)) (f1-1 (* f26-0 f0-4)) ) - (set! (-> obj offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) + (set! (-> this offset) (- f1-1 (* (the float (the int (/ f1-1 f0-4))) f0-4))) ) (cond ((< f30-0 0.0) @@ -376,28 +376,28 @@ ) ) (let ((f0-14 (the float s5-0))) - (set! (-> obj pause-in) (* f28-0 f0-14)) - (set! (-> obj pause-out) (* f30-0 f0-14)) + (set! (-> this pause-in) (* f28-0 f0-14)) + (set! (-> this pause-out) (* f30-0 f0-14)) ) ) (none) ) ;; definition for method 11 of type sync-paused -(defmethod get-norm! sync-paused ((obj sync-paused) (arg0 int)) +(defmethod get-norm! sync-paused ((this sync-paused) (arg0 int)) "Get the current value, from 0 to 1." (if (zero? arg0) (set! arg0 (the-as int (current-time))) ) - (let* ((v1-4 (-> obj period)) + (let* ((v1-4 (-> this period)) (f2-0 (the float v1-4)) - (f0-1 (-> obj pause-in)) - (f1-0 (-> obj pause-out)) + (f0-1 (-> this pause-in)) + (f1-0 (-> this pause-out)) ) (the int (+ f0-1 f1-0 f2-0)) (cond - ((logtest? (-> obj sync-flags) (sync-flags pong)) - (let* ((f3-5 (+ (the float (mod arg0 (the-as int v1-4))) (-> obj offset))) + ((logtest? (-> this sync-flags) (sync-flags pong)) + (let* ((f3-5 (+ (the float (mod arg0 (the-as int v1-4))) (-> this offset))) (f3-6 (- f3-5 (* (the float (the int (/ f3-5 f2-0))) f2-0))) (f2-2 (* 0.5 (- f2-0 (+ f0-1 f1-0)))) (v1-7 #f) @@ -418,7 +418,7 @@ ) ) (else - (let* ((f3-9 (+ (the float (mod arg0 (the-as int v1-4))) (-> obj offset))) + (let* ((f3-9 (+ (the float (mod arg0 (the-as int v1-4))) (-> this offset))) (f3-10 (- f3-9 (* (the float (the int (/ f3-9 f2-0))) f2-0))) (f1-5 (- f2-0 (+ f0-1 f1-0))) (f1-6 (/ (- f3-10 f0-1) f1-5)) @@ -431,74 +431,74 @@ ) ;; definition for method 12 of type sync-paused -(defmethod get-scaled-val! sync-paused ((obj sync-paused) (arg0 float) (arg1 int)) +(defmethod get-scaled-val! sync-paused ((this sync-paused) (arg0 float) (arg1 int)) "Multiples result of `get-norm!` by the provided float" - (* (get-norm! obj arg1) arg0) + (* (get-norm! this arg1) arg0) ) ;; definition for method 9 of type delayed-rand-float -(defmethod set-params! delayed-rand-float ((obj delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) - (set! (-> obj min-time) arg0) - (set! (-> obj max-time) arg1) - (set! (-> obj max-val) (* 0.5 arg2)) - (set! (-> obj start-time) 0) - (set! (-> obj timer) 0) - (set! (-> obj value) 0.0) - (-> obj value) +(defmethod set-params! delayed-rand-float ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float)) + (set! (-> this min-time) arg0) + (set! (-> this max-time) arg1) + (set! (-> this max-val) (* 0.5 arg2)) + (set! (-> this start-time) 0) + (set! (-> this timer) 0) + (set! (-> this value) 0.0) + (-> this value) ) ;; definition for method 10 of type delayed-rand-float -(defmethod reset! delayed-rand-float ((obj delayed-rand-float)) - (set! (-> obj start-time) (current-time)) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value) (rand-vu-float-range (- (-> obj max-val)) (-> obj max-val))) +(defmethod reset! delayed-rand-float ((this delayed-rand-float)) + (set-time! (-> this start-time)) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value) (rand-vu-float-range (- (-> this max-val)) (-> this max-val))) ) ;; definition for method 11 of type delayed-rand-float -(defmethod update! delayed-rand-float ((obj delayed-rand-float)) - (if (>= (- (current-time) (-> obj start-time)) (-> obj timer)) - (reset! obj) +(defmethod update! delayed-rand-float ((this delayed-rand-float)) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (reset! this) ) - (-> obj value) + (-> this value) ) ;; definition for method 12 of type delayed-rand-float ;; WARN: Return type mismatch float vs none. -(defmethod update-and-clear! delayed-rand-float ((obj delayed-rand-float)) - (if (>= (- (current-time) (-> obj start-time)) (-> obj timer)) - (reset! obj) - (set! (-> obj value) 0.0) +(defmethod update-and-clear! delayed-rand-float ((this delayed-rand-float)) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (reset! this) + (set! (-> this value) 0.0) ) - (-> obj value) + (-> this value) (none) ) ;; definition for method 9 of type oscillating-float -(defmethod set-params! oscillating-float ((obj oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) - (set! (-> obj value) arg0) - (set! (-> obj target) arg0) - (set! (-> obj vel) 0.0) - (set! (-> obj max-vel) arg2) - (set! (-> obj damping) arg3) - (set! (-> obj accel) arg1) - (-> obj value) +(defmethod set-params! oscillating-float ((this oscillating-float) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> this value) arg0) + (set! (-> this target) arg0) + (set! (-> this vel) 0.0) + (set! (-> this max-vel) arg2) + (set! (-> this damping) arg3) + (set! (-> this accel) arg1) + (-> this value) ) ;; definition for method 10 of type oscillating-float -(defmethod update! oscillating-float ((obj oscillating-float) (arg0 float)) +(defmethod update! oscillating-float ((this oscillating-float) (arg0 float)) (with-pp - (let ((f0-3 (* (- (+ (-> obj target) arg0) (-> obj value)) (* (-> obj accel) (-> pp clock time-adjust-ratio))))) - (+! (-> obj vel) f0-3) + (let ((f0-3 (* (- (+ (-> this target) arg0) (-> this value)) (* (-> this accel) (-> pp clock time-adjust-ratio))))) + (+! (-> this vel) f0-3) ) - (set! (-> obj vel) (fmin (-> obj max-vel) (fmax (- (-> obj max-vel)) (-> obj vel)))) - (set! (-> obj vel) (* (-> obj vel) (-> obj damping))) - (+! (-> obj value) (* (-> obj vel) (-> pp clock time-adjust-ratio))) - (-> obj value) + (set! (-> this vel) (fmin (-> this max-vel) (fmax (- (-> this max-vel)) (-> this vel)))) + (set! (-> this vel) (* (-> this vel) (-> this damping))) + (+! (-> this value) (* (-> this vel) (-> pp clock time-adjust-ratio))) + (-> this value) ) ) ;; definition for method 9 of type bouncing-float -(defmethod set-params! bouncing-float ((obj bouncing-float) +(defmethod set-params! bouncing-float ((this bouncing-float) (arg0 float) (arg1 float) (arg2 float) @@ -507,128 +507,128 @@ (arg5 float) (arg6 float) ) - (set-params! (-> obj osc) arg0 arg4 arg5 arg6) - (set! (-> obj max-value) arg1) - (set! (-> obj min-value) arg2) - (set! (-> obj elasticity) arg3) - (set! (-> obj state) 0) - (-> obj osc value) + (set-params! (-> this osc) arg0 arg4 arg5 arg6) + (set! (-> this max-value) arg1) + (set! (-> this min-value) arg2) + (set! (-> this elasticity) arg3) + (set! (-> this state) 0) + (-> this osc value) ) ;; definition for method 10 of type bouncing-float -(defmethod update! bouncing-float ((obj bouncing-float) (arg0 float)) - (update! (-> obj osc) arg0) - (set! (-> obj state) 0) - (when (>= (-> obj osc value) (-> obj max-value)) - (set! (-> obj osc value) (-> obj max-value)) - (if (< 0.0 (-> obj osc vel)) - (set! (-> obj osc vel) (* (-> obj osc vel) (- (-> obj elasticity)))) +(defmethod update! bouncing-float ((this bouncing-float) (arg0 float)) + (update! (-> this osc) arg0) + (set! (-> this state) 0) + (when (>= (-> this osc value) (-> this max-value)) + (set! (-> this osc value) (-> this max-value)) + (if (< 0.0 (-> this osc vel)) + (set! (-> this osc vel) (* (-> this osc vel) (- (-> this elasticity)))) ) - (set! (-> obj state) 1) + (set! (-> this state) 1) ) - (when (>= (-> obj min-value) (-> obj osc value)) - (set! (-> obj osc value) (-> obj min-value)) - (if (< (-> obj osc vel) 0.0) - (set! (-> obj osc vel) (* (-> obj osc vel) (- (-> obj elasticity)))) + (when (>= (-> this min-value) (-> this osc value)) + (set! (-> this osc value) (-> this min-value)) + (if (< (-> this osc vel) 0.0) + (set! (-> this osc vel) (* (-> this osc vel) (- (-> this elasticity)))) ) - (set! (-> obj state) -1) + (set! (-> this state) -1) ) - (-> obj osc value) + (-> this osc value) ) ;; definition for method 11 of type bouncing-float -(defmethod at-min? bouncing-float ((obj bouncing-float)) - (= (-> obj state) -1) +(defmethod at-min? bouncing-float ((this bouncing-float)) + (= (-> this state) -1) ) ;; definition for method 12 of type bouncing-float -(defmethod at-max? bouncing-float ((obj bouncing-float)) - (= (-> obj state) 1) +(defmethod at-max? bouncing-float ((this bouncing-float)) + (= (-> this state) 1) ) ;; definition for method 9 of type delayed-rand-vector -(defmethod set-params! delayed-rand-vector ((obj delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) - (set! (-> obj min-time) arg0) - (set! (-> obj max-time) arg1) - (set! (-> obj xz-max) (* 0.5 arg2)) - (set! (-> obj y-max) (* 0.5 arg3)) - (set! (-> obj start-time) 0) - (set! (-> obj timer) 0) - (vector-reset! (-> obj value)) - (-> obj value) +(defmethod set-params! delayed-rand-vector ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) + (set! (-> this min-time) arg0) + (set! (-> this max-time) arg1) + (set! (-> this xz-max) (* 0.5 arg2)) + (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this start-time) 0) + (set! (-> this timer) 0) + (vector-reset! (-> this value)) + (-> this value) ) ;; definition for method 10 of type delayed-rand-vector -(defmethod update-now! delayed-rand-vector ((obj delayed-rand-vector)) - (set! (-> obj start-time) (current-time)) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value x) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (set! (-> obj value y) (rand-vu-float-range (- (-> obj y-max)) (-> obj y-max))) - (set! (-> obj value z) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (-> obj value) +(defmethod update-now! delayed-rand-vector ((this delayed-rand-vector)) + (set-time! (-> this start-time)) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (set! (-> this value y) (rand-vu-float-range (- (-> this y-max)) (-> this y-max))) + (set! (-> this value z) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (-> this value) ) ;; definition for method 11 of type delayed-rand-vector -(defmethod update-with-delay! delayed-rand-vector ((obj delayed-rand-vector)) - (if (>= (- (current-time) (-> obj start-time)) (-> obj timer)) - (update-now! obj) +(defmethod update-with-delay! delayed-rand-vector ((this delayed-rand-vector)) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (update-now! this) ) - (-> obj value) + (-> this value) ) ;; definition for method 12 of type delayed-rand-vector -(defmethod update-with-delay-or-reset! delayed-rand-vector ((obj delayed-rand-vector)) - (if (>= (- (current-time) (-> obj start-time)) (-> obj timer)) - (update-now! obj) - (vector-reset! (-> obj value)) +(defmethod update-with-delay-or-reset! delayed-rand-vector ((this delayed-rand-vector)) + (if (time-elapsed? (-> this start-time) (-> this timer)) + (update-now! this) + (vector-reset! (-> this value)) ) - (-> obj value) + (-> this value) ) ;; definition for method 9 of type oscillating-vector ;; INFO: Used lq/sq -(defmethod set-params! oscillating-vector ((obj oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod set-params! oscillating-vector ((this oscillating-vector) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> obj value quad) (-> arg0 quad)) - (set! (-> obj target quad) (-> arg0 quad)) + (set! (-> this value quad) (-> arg0 quad)) + (set! (-> this target quad) (-> arg0 quad)) ) (else - (vector-reset! (-> obj value)) - (vector-reset! (-> obj target)) + (vector-reset! (-> this value)) + (vector-reset! (-> this target)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj max-vel) arg2) - (set! (-> obj damping) arg3) - (set! (-> obj accel) arg1) - (-> obj value) + (vector-reset! (-> this vel)) + (set! (-> this max-vel) arg2) + (set! (-> this damping) arg3) + (set! (-> this accel) arg1) + (-> this value) ) ;; definition for method 10 of type oscillating-vector -(defmethod update! oscillating-vector ((obj oscillating-vector) (arg0 vector)) +(defmethod update! oscillating-vector ((this oscillating-vector) (arg0 vector)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vector))) (cond (arg0 - (vector+! v1-0 (-> obj target) arg0) - (vector-! v1-0 v1-0 (-> obj value)) + (vector+! v1-0 (-> this target) arg0) + (vector-! v1-0 v1-0 (-> this value)) ) (else - (vector-! v1-0 (-> obj target) (-> obj value)) + (vector-! v1-0 (-> this target) (-> this value)) ) ) - (vector-float*! v1-0 v1-0 (* (-> obj accel) (-> pp clock time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) v1-0) - (let ((f0-2 (vector-length (-> obj vel)))) - (if (< (-> obj max-vel) f0-2) - (vector-float*! (-> obj vel) (-> obj vel) (/ (-> obj max-vel) f0-2)) + (vector-float*! v1-0 v1-0 (* (-> this accel) (-> pp clock time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) v1-0) + (let ((f0-2 (vector-length (-> this vel)))) + (if (< (-> this max-vel) f0-2) + (vector-float*! (-> this vel) (-> this vel) (/ (-> this max-vel) f0-2)) ) ) - (vector-float*! (-> obj vel) (-> obj vel) (-> obj damping)) - (vector-float*! v1-0 (-> obj vel) (-> pp clock time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) v1-0) + (vector-float*! (-> this vel) (-> this vel) (-> this damping)) + (vector-float*! v1-0 (-> this vel) (-> pp clock time-adjust-ratio)) + (vector+! (-> this value) (-> this value) v1-0) ) - (-> obj value) + (-> this value) ) ) diff --git a/test/decompiler/reference/jak2/kernel/dgo-h_REF.gc b/test/decompiler/reference/jak2/kernel/dgo-h_REF.gc index c3f871e888..7fc9c20448 100644 --- a/test/decompiler/reference/jak2/kernel/dgo-h_REF.gc +++ b/test/decompiler/reference/jak2/kernel/dgo-h_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type dgo-entry -(defmethod inspect dgo-entry ((obj dgo-entry)) - (when (not obj) - (set! obj obj) +(defmethod inspect dgo-entry ((this dgo-entry)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dgo-entry) - (format #t "~1Toffset: ~D~%" (-> obj offset)) - (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "[~8x] ~A~%" this 'dgo-entry) + (format #t "~1Toffset: ~D~%" (-> this offset)) + (format #t "~1Tlength: ~D~%" (-> this length)) (label cfg-4) - obj + this ) ;; definition of type dgo-file @@ -37,23 +37,19 @@ ) ;; definition for method 3 of type dgo-file -(defmethod inspect dgo-file ((obj dgo-file)) - (when (not obj) - (set! obj obj) +(defmethod inspect dgo-file ((this dgo-file)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnum-go-files: ~D~%" (-> obj num-go-files)) - (format #t "~1Ttotal-length: ~D~%" (-> obj total-length)) - (format #t "~1Trsvd: ~D~%" (-> obj rsvd)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnum-go-files: ~D~%" (-> this num-go-files)) + (format #t "~1Ttotal-length: ~D~%" (-> this total-length)) + (format #t "~1Trsvd: ~D~%" (-> this rsvd)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/kernel/gcommon_REF.gc b/test/decompiler/reference/jak2/kernel/gcommon_REF.gc index cf1a5342cc..b422e5a1f0 100644 --- a/test/decompiler/reference/jak2/kernel/gcommon_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gcommon_REF.gc @@ -112,24 +112,24 @@ ) ;; definition for method 3 of type vec4s -(defmethod inspect vec4s ((obj vec4s)) - (when (not obj) - (set! obj obj) +(defmethod inspect vec4s ((this vec4s)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vec4s) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) + (format #t "[~8x] ~A~%" this 'vec4s) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) (label cfg-4) - obj + this ) ;; definition for method 2 of type vec4s -(defmethod print vec4s ((obj vec4s)) - (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) - obj +(defmethod print vec4s ((this vec4s)) + (format #t "#" (-> this x) (-> this y) (-> this z) (-> this w) this) + this ) ;; definition of type vector @@ -147,22 +147,21 @@ ) ;; definition for method 3 of type vector -;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq -(defmethod inspect vector ((obj vector)) - (when (not obj) - (set! obj obj) +(defmethod inspect vector ((this vector)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vector) - (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) - (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) - (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "[~8x] ~A~%" this 'vector) + (format #t "~1Tdata[4] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) + (format #t "~1Tz: ~f~%" (-> this z)) + (format #t "~1Tw: ~f~%" (-> this w)) + (format #t "~1Tquad: ~D~%" (-> this quad)) (label cfg-4) - obj + this ) ;; definition of type bfloat @@ -175,27 +174,27 @@ ) ;; definition for method 3 of type bfloat -(defmethod inspect bfloat ((obj bfloat)) - (when (not obj) - (set! obj obj) +(defmethod inspect bfloat ((this bfloat)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdata: ~f~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdata: ~f~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for method 2 of type bfloat -(defmethod print bfloat ((obj bfloat)) - (format #t "~f" (-> obj data)) - obj +(defmethod print bfloat ((this bfloat)) + (format #t "~f" (-> this data)) + this ) ;; definition for method 5 of type type ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of type ((obj type)) - (the-as int (logand (the-as uint #xfffffff0) (+ (* (-> obj allocated-length) 4) 43))) +(defmethod asize-of type ((this type)) + (the-as int (logand (the-as uint #xfffffff0) (+ (* (-> this allocated-length) 4) 43))) ) ;; definition for function basic-type? @@ -277,14 +276,14 @@ ) ;; definition for method 4 of type pair -(defmethod length pair ((obj pair)) +(defmethod length pair ((this pair)) (local-vars (v0-0 int)) (cond - ((null? obj) + ((null? this) (set! v0-0 0) ) (else - (let ((v1-1 (cdr obj))) + (let ((v1-1 (cdr this))) (set! v0-0 1) (while (and (not (null? v1-1)) (pair? v1-1)) (+! v0-0 1) @@ -298,7 +297,7 @@ ;; definition for method 5 of type pair ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of pair ((obj pair)) +(defmethod asize-of pair ((this pair)) (the-as int (-> pair size)) ) @@ -511,16 +510,16 @@ ) ;; definition for method 3 of type inline-array-class -(defmethod inspect inline-array-class ((obj inline-array-class)) - (when (not obj) - (set! obj obj) +(defmethod inspect inline-array-class ((this inline-array-class)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) (label cfg-4) - obj + this ) ;; definition for method 0 of type inline-array-class @@ -541,14 +540,14 @@ ) ;; definition for method 4 of type inline-array-class -(defmethod length inline-array-class ((obj inline-array-class)) - (-> obj length) +(defmethod length inline-array-class ((this inline-array-class)) + (-> this length) ) ;; definition for method 5 of type inline-array-class ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of inline-array-class ((obj inline-array-class)) - (the-as int (+ (-> obj type size) (* (-> obj allocated-length) (the-as int (-> obj type heap-base))))) +(defmethod asize-of inline-array-class ((this inline-array-class)) + (the-as int (+ (-> this type size) (* (-> this allocated-length) (the-as int (-> this type heap-base))))) ) ;; definition for method 0 of type array @@ -575,246 +574,246 @@ ;; definition for method 2 of type array ;; INFO: Used lq/sq -(defmethod print array ((obj array)) +(defmethod print array ((this array)) (format #t "#(") (cond - ((type-type? (-> obj content-type) integer) - (case (-> obj content-type symbol) + ((type-type? (-> this content-type) integer) + (case (-> this content-type symbol) (('int32) - (dotimes (s5-0 (-> obj length)) + (dotimes (s5-0 (-> this length)) (format #t (if (zero? s5-0) "~D" " ~D" ) - (-> (the-as (array int32) obj) s5-0) + (-> (the-as (array int32) this) s5-0) ) ) ) (('uint32) - (dotimes (s5-1 (-> obj length)) + (dotimes (s5-1 (-> this length)) (format #t (if (zero? s5-1) "~D" " ~D" ) - (-> (the-as (array uint32) obj) s5-1) + (-> (the-as (array uint32) this) s5-1) ) ) ) (('int64) - (dotimes (s5-2 (-> obj length)) + (dotimes (s5-2 (-> this length)) (format #t (if (zero? s5-2) "~D" " ~D" ) - (-> (the-as (array int64) obj) s5-2) + (-> (the-as (array int64) this) s5-2) ) ) ) (('uint64) - (dotimes (s5-3 (-> obj length)) + (dotimes (s5-3 (-> this length)) (format #t (if (zero? s5-3) "#x~X" " #x~X" ) - (-> (the-as (array uint64) obj) s5-3) + (-> (the-as (array uint64) this) s5-3) ) ) ) (('int8) - (dotimes (s5-4 (-> obj length)) + (dotimes (s5-4 (-> this length)) (format #t (if (zero? s5-4) "~D" " ~D" ) - (-> (the-as (array int8) obj) s5-4) + (-> (the-as (array int8) this) s5-4) ) ) ) (('uint8) - (dotimes (s5-5 (-> obj length)) + (dotimes (s5-5 (-> this length)) (format #t (if (zero? s5-5) "~D" " ~D" ) - (-> (the-as (array uint8) obj) s5-5) + (-> (the-as (array uint8) this) s5-5) ) ) ) (('int16) - (dotimes (s5-6 (-> obj length)) + (dotimes (s5-6 (-> this length)) (format #t (if (zero? s5-6) "~D" " ~D" ) - (-> (the-as (array int16) obj) s5-6) + (-> (the-as (array int16) this) s5-6) ) ) ) (('uint16) - (dotimes (s5-7 (-> obj length)) + (dotimes (s5-7 (-> this length)) (format #t (if (zero? s5-7) "~D" " ~D" ) - (-> (the-as (array uint16) obj) s5-7) + (-> (the-as (array uint16) this) s5-7) ) ) ) (('uint128 'int128) - (dotimes (s5-8 (-> obj length)) + (dotimes (s5-8 (-> this length)) (format #t (if (zero? s5-8) "#x~X" " #x~X" ) - (-> (the-as (array uint128) obj) s5-8) + (-> (the-as (array uint128) this) s5-8) ) ) ) (else - (dotimes (s5-9 (-> obj length)) + (dotimes (s5-9 (-> this length)) (format #t (if (zero? s5-9) "~D" " ~D" ) - (-> (the-as (array int32) obj) s5-9) + (-> (the-as (array int32) this) s5-9) ) ) ) ) ) - ((= (-> obj content-type) float) - (dotimes (s5-10 (-> obj length)) + ((= (-> this content-type) float) + (dotimes (s5-10 (-> this length)) (if (zero? s5-10) - (format #t "~f" (-> (the-as (array float) obj) s5-10)) - (format #t " ~f" (-> (the-as (array float) obj) s5-10)) + (format #t "~f" (-> (the-as (array float) this) s5-10)) + (format #t " ~f" (-> (the-as (array float) this) s5-10)) ) ) ) (else - (dotimes (s5-11 (-> obj length)) + (dotimes (s5-11 (-> this length)) (if (zero? s5-11) - (format #t "~A" (-> (the-as (array basic) obj) s5-11)) - (format #t " ~A" (-> (the-as (array basic) obj) s5-11)) + (format #t "~A" (-> (the-as (array basic) this) s5-11)) + (format #t " ~A" (-> (the-as (array basic) this) s5-11)) ) ) ) ) (format #t ")") - obj + this ) ;; definition for method 3 of type array ;; INFO: Used lq/sq -(defmethod inspect array ((obj array)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tlength: ~D~%" (-> obj length)) - (format #t "~Tcontent-type: ~A~%" (-> obj content-type)) - (format #t "~Tdata[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj data)) +(defmethod inspect array ((this array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tlength: ~D~%" (-> this length)) + (format #t "~Tcontent-type: ~A~%" (-> this content-type)) + (format #t "~Tdata[~D]: @ #x~X~%" (-> this allocated-length) (-> this data)) (cond - ((and (= (logand (the-as int (-> obj content-type)) 7) 4) (type-type? (-> obj content-type) integer)) - (case (-> obj content-type symbol) + ((and (= (logand (the-as int (-> this content-type)) 7) 4) (type-type? (-> this content-type) integer)) + (case (-> this content-type symbol) (('int32) - (dotimes (s5-0 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-0 (-> (the-as (array int32) obj) s5-0)) + (dotimes (s5-0 (-> this length)) + (format #t "~T [~D] ~D~%" s5-0 (-> (the-as (array int32) this) s5-0)) ) ) (('uint32) - (dotimes (s5-1 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-1 (-> (the-as (array uint32) obj) s5-1)) + (dotimes (s5-1 (-> this length)) + (format #t "~T [~D] ~D~%" s5-1 (-> (the-as (array uint32) this) s5-1)) ) ) (('int64) - (dotimes (s5-2 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-2 (-> (the-as (array int64) obj) s5-2)) + (dotimes (s5-2 (-> this length)) + (format #t "~T [~D] ~D~%" s5-2 (-> (the-as (array int64) this) s5-2)) ) ) (('uint64) - (dotimes (s5-3 (-> obj length)) - (format #t "~T [~D] #x~X~%" s5-3 (-> (the-as (array uint64) obj) s5-3)) + (dotimes (s5-3 (-> this length)) + (format #t "~T [~D] #x~X~%" s5-3 (-> (the-as (array uint64) this) s5-3)) ) ) (('int8) - (dotimes (s5-4 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-4 (-> (the-as (array int8) obj) s5-4)) + (dotimes (s5-4 (-> this length)) + (format #t "~T [~D] ~D~%" s5-4 (-> (the-as (array int8) this) s5-4)) ) ) (('uint8) - (dotimes (s5-5 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-5 (-> (the-as (array int8) obj) s5-5)) + (dotimes (s5-5 (-> this length)) + (format #t "~T [~D] ~D~%" s5-5 (-> (the-as (array int8) this) s5-5)) ) ) (('int16) - (dotimes (s5-6 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-6 (-> (the-as (array int16) obj) s5-6)) + (dotimes (s5-6 (-> this length)) + (format #t "~T [~D] ~D~%" s5-6 (-> (the-as (array int16) this) s5-6)) ) ) (('uint16) - (dotimes (s5-7 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-7 (-> (the-as (array uint16) obj) s5-7)) + (dotimes (s5-7 (-> this length)) + (format #t "~T [~D] ~D~%" s5-7 (-> (the-as (array uint16) this) s5-7)) ) ) (('int128 'uint128) - (dotimes (s5-8 (-> obj length)) - (format #t "~T [~D] #x~X~%" s5-8 (-> (the-as (array uint128) obj) s5-8)) + (dotimes (s5-8 (-> this length)) + (format #t "~T [~D] #x~X~%" s5-8 (-> (the-as (array uint128) this) s5-8)) ) ) (else - (dotimes (s5-9 (-> obj length)) - (format #t "~T [~D] ~D~%" s5-9 (-> (the-as (array int32) obj) s5-9)) + (dotimes (s5-9 (-> this length)) + (format #t "~T [~D] ~D~%" s5-9 (-> (the-as (array int32) this) s5-9)) ) ) ) ) - ((= (-> obj content-type) float) - (dotimes (s5-10 (-> obj length)) - (format #t "~T [~D] ~f~%" s5-10 (-> (the-as (array float) obj) s5-10)) + ((= (-> this content-type) float) + (dotimes (s5-10 (-> this length)) + (format #t "~T [~D] ~f~%" s5-10 (-> (the-as (array float) this) s5-10)) ) ) (else - (dotimes (s5-11 (-> obj length)) - (format #t "~T [~D] ~A~%" s5-11 (-> (the-as (array basic) obj) s5-11)) + (dotimes (s5-11 (-> this length)) + (format #t "~T [~D] ~A~%" s5-11 (-> (the-as (array basic) this) s5-11)) ) ) ) - obj + this ) ;; definition for method 4 of type array -(defmethod length array ((obj array)) - (-> obj length) +(defmethod length array ((this array)) + (-> this length) ) ;; definition for method 5 of type array ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of array ((obj array)) +(defmethod asize-of array ((this array)) (the-as int - (+ (-> obj type size) (* (-> obj allocated-length) (if (type-type? (-> obj content-type) number) - (the-as int (-> obj content-type size)) - 4 - ) - ) + (+ (-> this type size) (* (-> this allocated-length) (if (type-type? (-> this content-type) number) + (the-as int (-> this content-type size)) + 4 + ) + ) ) ) ) diff --git a/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc b/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc index b8acd5cae8..15ac4db288 100644 --- a/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gkernel-h_REF.gc @@ -23,27 +23,27 @@ ) ;; definition for method 3 of type kernel-context -(defmethod inspect kernel-context ((obj kernel-context)) - (when (not obj) - (set! obj obj) +(defmethod inspect kernel-context ((this kernel-context)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprevent-from-run: ~D~%" (-> obj prevent-from-run)) - (format #t "~1Trequire-for-run: ~D~%" (-> obj require-for-run)) - (format #t "~1Tallow-to-run: ~D~%" (-> obj allow-to-run)) - (format #t "~1Tnext-pid: ~D~%" (-> obj next-pid)) - (format #t "~1Tfast-stack-top: #x~X~%" (-> obj fast-stack-top)) - (format #t "~1Tcurrent-process: ~A~%" (-> obj current-process)) - (format #t "~1Trelocating-process: ~A~%" (-> obj relocating-process)) - (format #t "~1Trelocating-min: #x~X~%" (-> obj relocating-min)) - (format #t "~1Trelocating-max: #x~X~%" (-> obj relocating-max)) - (format #t "~1Trelocating-offset: ~D~%" (-> obj relocating-offset)) - (format #t "~1Trelocating-level: ~A~%" (-> obj relocating-level)) - (format #t "~1Tlow-memory-message: ~A~%" (-> obj low-memory-message)) - (format #t "~1Tlogin-object: ~A~%" (-> obj login-object)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprevent-from-run: ~D~%" (-> this prevent-from-run)) + (format #t "~1Trequire-for-run: ~D~%" (-> this require-for-run)) + (format #t "~1Tallow-to-run: ~D~%" (-> this allow-to-run)) + (format #t "~1Tnext-pid: ~D~%" (-> this next-pid)) + (format #t "~1Tfast-stack-top: #x~X~%" (-> this fast-stack-top)) + (format #t "~1Tcurrent-process: ~A~%" (-> this current-process)) + (format #t "~1Trelocating-process: ~A~%" (-> this relocating-process)) + (format #t "~1Trelocating-min: #x~X~%" (-> this relocating-min)) + (format #t "~1Trelocating-max: #x~X~%" (-> this relocating-max)) + (format #t "~1Trelocating-offset: ~D~%" (-> this relocating-offset)) + (format #t "~1Trelocating-level: ~A~%" (-> this relocating-level)) + (format #t "~1Tlow-memory-message: ~A~%" (-> this low-memory-message)) + (format #t "~1Tlogin-object: ~A~%" (-> this login-object)) (label cfg-4) - obj + this ) ;; definition of type time-frame @@ -85,27 +85,27 @@ ) ;; definition for method 3 of type clock -(defmethod inspect clock ((obj clock)) - (when (not obj) - (set! obj obj) +(defmethod inspect clock ((this clock)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tmask: ~D~%" (-> obj mask)) - (format #t "~1Tclock-ratio: ~f~%" (-> obj clock-ratio)) - (format #t "~1Taccum: ~f~%" (-> obj accum)) - (format #t "~1Tintegral-accum: ~f~%" (-> obj integral-accum)) - (format #t "~1Tframe-counter: ~D~%" (-> obj frame-counter)) - (format #t "~1Told-frame-counter: ~D~%" (-> obj old-frame-counter)) - (format #t "~1Tintegral-frame-counter: ~D~%" (-> obj integral-frame-counter)) - (format #t "~1Told-integral-frame-counter: ~D~%" (-> obj old-integral-frame-counter)) - (format #t "~1Tsparticle-data: ~`vector`P~%" (-> obj sparticle-data)) - (format #t "~1Tseconds-per-frame: ~f~%" (-> obj seconds-per-frame)) - (format #t "~1Tframes-per-second: ~f~%" (-> obj frames-per-second)) - (format #t "~1Ttime-adjust-ratio: ~f~%" (-> obj time-adjust-ratio)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tmask: ~D~%" (-> this mask)) + (format #t "~1Tclock-ratio: ~f~%" (-> this clock-ratio)) + (format #t "~1Taccum: ~f~%" (-> this accum)) + (format #t "~1Tintegral-accum: ~f~%" (-> this integral-accum)) + (format #t "~1Tframe-counter: ~D~%" (-> this frame-counter)) + (format #t "~1Told-frame-counter: ~D~%" (-> this old-frame-counter)) + (format #t "~1Tintegral-frame-counter: ~D~%" (-> this integral-frame-counter)) + (format #t "~1Told-integral-frame-counter: ~D~%" (-> this old-integral-frame-counter)) + (format #t "~1Tsparticle-data: ~`vector`P~%" (-> this sparticle-data)) + (format #t "~1Tseconds-per-frame: ~f~%" (-> this seconds-per-frame)) + (format #t "~1Tframes-per-second: ~f~%" (-> this frames-per-second)) + (format #t "~1Ttime-adjust-ratio: ~f~%" (-> this time-adjust-ratio)) (label cfg-4) - obj + this ) ;; definition for method 0 of type clock @@ -144,23 +144,23 @@ ) ;; definition for method 3 of type thread -(defmethod inspect thread ((obj thread)) - (when (not obj) - (set! obj obj) +(defmethod inspect thread ((this thread)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tprevious: ~A~%" (-> obj previous)) - (format #t "~1Tsuspend-hook: ~A~%" (-> obj suspend-hook)) - (format #t "~1Tresume-hook: ~A~%" (-> obj resume-hook)) - (format #t "~1Tpc: #x~X~%" (-> obj pc)) - (format #t "~1Tsp: #x~X~%" (-> obj sp)) - (format #t "~1Tstack-top: #x~X~%" (-> obj stack-top)) - (format #t "~1Tstack-size: ~D~%" (-> obj stack-size)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tprevious: ~A~%" (-> this previous)) + (format #t "~1Tsuspend-hook: ~A~%" (-> this suspend-hook)) + (format #t "~1Tresume-hook: ~A~%" (-> this resume-hook)) + (format #t "~1Tpc: #x~X~%" (-> this pc)) + (format #t "~1Tsp: #x~X~%" (-> this sp)) + (format #t "~1Tstack-top: #x~X~%" (-> this stack-top)) + (format #t "~1Tstack-size: ~D~%" (-> this stack-size)) (label cfg-4) - obj + this ) ;; definition of type cpu-thread @@ -178,26 +178,26 @@ ) ;; definition for method 3 of type cpu-thread -(defmethod inspect cpu-thread ((obj cpu-thread)) - (when (not obj) - (set! obj obj) +(defmethod inspect cpu-thread ((this cpu-thread)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tprevious: ~A~%" (-> obj previous)) - (format #t "~1Tsuspend-hook: ~A~%" (-> obj suspend-hook)) - (format #t "~1Tresume-hook: ~A~%" (-> obj resume-hook)) - (format #t "~1Tpc: #x~X~%" (-> obj pc)) - (format #t "~1Tsp: #x~X~%" (-> obj sp)) - (format #t "~1Tstack-top: #x~X~%" (-> obj stack-top)) - (format #t "~1Tstack-size: ~D~%" (-> obj stack-size)) - (format #t "~1Trreg[8] @ #x~X~%" (-> obj rreg)) - (format #t "~1Tfreg[6] @ #x~X~%" (&-> obj freg 2)) - (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tprevious: ~A~%" (-> this previous)) + (format #t "~1Tsuspend-hook: ~A~%" (-> this suspend-hook)) + (format #t "~1Tresume-hook: ~A~%" (-> this resume-hook)) + (format #t "~1Tpc: #x~X~%" (-> this pc)) + (format #t "~1Tsp: #x~X~%" (-> this sp)) + (format #t "~1Tstack-top: #x~X~%" (-> this stack-top)) + (format #t "~1Tstack-size: ~D~%" (-> this stack-size)) + (format #t "~1Trreg[8] @ #x~X~%" (-> this rreg)) + (format #t "~1Tfreg[6] @ #x~X~%" (&-> this freg 2)) + (format #t "~1Tstack[0] @ #x~X~%" (-> this stack)) (label cfg-4) - obj + this ) ;; definition of type dead-pool @@ -214,15 +214,15 @@ ) ;; definition for method 3 of type dead-pool -(defmethod inspect dead-pool ((obj dead-pool)) - (when (not obj) - (set! obj obj) +(defmethod inspect dead-pool ((this dead-pool)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) (format #t "process-tree ") ) @@ -321,14 +321,14 @@ ) ) (format #t ")~%") - (format #t "~1Tclock: ~A~%" (-> obj clock)) - (format #t "~1Tparent: #x~X~%" (-> obj parent)) - (format #t "~1Tbrother: #x~X~%" (-> obj brother)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) - (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~1Tself: ~A~%" (-> obj self)) + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) (label cfg-68) - obj + this ) ;; definition of type dead-pool-heap-rec @@ -344,17 +344,17 @@ ) ;; definition for method 3 of type dead-pool-heap-rec -(defmethod inspect dead-pool-heap-rec ((obj dead-pool-heap-rec)) - (when (not obj) - (set! obj obj) +(defmethod inspect dead-pool-heap-rec ((this dead-pool-heap-rec)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dead-pool-heap-rec) - (format #t "~1Tprocess: ~A~%" (-> obj process)) - (format #t "~1Tprev: #~%" (-> obj prev)) - (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "[~8x] ~A~%" this 'dead-pool-heap-rec) + (format #t "~1Tprocess: ~A~%" (-> this process)) + (format #t "~1Tprev: #~%" (-> this prev)) + (format #t "~1Tnext: #~%" (-> this next)) (label cfg-4) - obj + this ) ;; definition of type dead-pool-heap @@ -394,15 +394,15 @@ ;; definition for method 3 of type dead-pool-heap ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect dead-pool-heap ((obj dead-pool-heap)) - (when (not obj) - (set! obj obj) +(defmethod inspect dead-pool-heap ((this dead-pool-heap)) + (when (not this) + (set! this this) (goto cfg-68) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (let ((s5-0 (-> obj mask))) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (let ((s5-0 (-> this mask))) (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) (format #t "process-tree ") ) @@ -501,26 +501,26 @@ ) ) (format #t ")~%") - (format #t "~1Tclock: ~A~%" (-> obj clock)) - (format #t "~1Tparent: #x~X~%" (-> obj parent)) - (format #t "~1Tbrother: #x~X~%" (-> obj brother)) - (format #t "~1Tchild: #x~X~%" (-> obj child)) - (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tcompact-time: ~D~%" (-> obj compact-time)) - (format #t "~1Tcompact-count-targ: ~D~%" (-> obj compact-count-targ)) - (format #t "~1Tcompact-count: ~D~%" (-> obj compact-count)) - (format #t "~1Tfill-percent: ~f~%" (-> obj fill-percent)) - (format #t "~1Tfirst-gap: #~%" (-> obj first-gap)) - (format #t "~1Tfirst-shrink: #~%" (-> obj first-shrink)) - (format #t "~1Theap: #~%" (-> obj heap)) - (format #t "~1Talive-list: #~%" (-> obj alive-list)) - (format #t "~1Tlast: #~%" (-> obj alive-list prev)) - (format #t "~1Tdead-list: #~%" (-> obj dead-list)) - (format #t "~1Tprocess-list[0] @ #x~X~%" (-> obj process-list)) + (format #t "~1Tclock: ~A~%" (-> this clock)) + (format #t "~1Tparent: #x~X~%" (-> this parent)) + (format #t "~1Tbrother: #x~X~%" (-> this brother)) + (format #t "~1Tchild: #x~X~%" (-> this child)) + (format #t "~1Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tcompact-time: ~D~%" (-> this compact-time)) + (format #t "~1Tcompact-count-targ: ~D~%" (-> this compact-count-targ)) + (format #t "~1Tcompact-count: ~D~%" (-> this compact-count)) + (format #t "~1Tfill-percent: ~f~%" (-> this fill-percent)) + (format #t "~1Tfirst-gap: #~%" (-> this first-gap)) + (format #t "~1Tfirst-shrink: #~%" (-> this first-shrink)) + (format #t "~1Theap: #~%" (-> this heap)) + (format #t "~1Talive-list: #~%" (-> this alive-list)) + (format #t "~1Tlast: #~%" (-> this alive-list prev)) + (format #t "~1Tdead-list: #~%" (-> this dead-list)) + (format #t "~1Tprocess-list[0] @ #x~X~%" (-> this process-list)) (label cfg-68) - obj + this ) ;; definition of type catch-frame @@ -539,20 +539,20 @@ ) ;; definition for method 3 of type catch-frame -(defmethod inspect catch-frame ((obj catch-frame)) - (when (not obj) - (set! obj obj) +(defmethod inspect catch-frame ((this catch-frame)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tsp: #x~X~%" (-> obj sp)) - (format #t "~1Tra: #x~X~%" (-> obj ra)) - (format #t "~1Tfreg[6] @ #x~X~%" (-> obj freg)) - (format #t "~1Trreg[8] @ #x~X~%" (&-> obj freg 7)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tsp: #x~X~%" (-> this sp)) + (format #t "~1Tra: #x~X~%" (-> this ra)) + (format #t "~1Tfreg[6] @ #x~X~%" (-> this freg)) + (format #t "~1Trreg[8] @ #x~X~%" (&-> this freg 7)) (label cfg-4) - obj + this ) ;; definition of type protect-frame @@ -568,17 +568,17 @@ ) ;; definition for method 3 of type protect-frame -(defmethod inspect protect-frame ((obj protect-frame)) - (when (not obj) - (set! obj obj) +(defmethod inspect protect-frame ((this protect-frame)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Texit: ~A~%" (-> obj exit)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Texit: ~A~%" (-> this exit)) (label cfg-4) - obj + this ) ;; definition of type handle @@ -593,25 +593,25 @@ ) ;; definition for method 3 of type handle -(defmethod inspect handle ((obj handle)) - (when (not obj) - (set! obj obj) +(defmethod inspect handle ((this handle)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'handle) - (format #t "~1Tprocess: #x~X~%" (-> obj process)) - (format #t "~1Tpid: ~D~%" (-> obj pid)) + (format #t "[~8x] ~A~%" this 'handle) + (format #t "~1Tprocess: #x~X~%" (-> this process)) + (format #t "~1Tpid: ~D~%" (-> this pid)) (label cfg-4) - obj + this ) ;; definition for method 2 of type handle -(defmethod print handle ((obj handle)) - (if (nonzero? obj) - (format #t "#" (handle->process obj) (-> obj pid)) +(defmethod print handle ((this handle)) + (if (nonzero? this) + (format #t "#" (handle->process this) (-> this pid)) (format #t "#") ) - obj + this ) ;; definition of type state @@ -631,22 +631,22 @@ ) ;; definition for method 3 of type state -(defmethod inspect state ((obj state)) - (when (not obj) - (set! obj obj) +(defmethod inspect state ((this state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Texit: ~A~%" (-> obj exit)) - (format #t "~1Tcode: ~A~%" (-> obj code)) - (format #t "~1Ttrans: ~A~%" (-> obj trans)) - (format #t "~1Tpost: ~A~%" (-> obj post)) - (format #t "~1Tenter: ~A~%" (-> obj enter)) - (format #t "~1Tevent: ~A~%" (-> obj event)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Texit: ~A~%" (-> this exit)) + (format #t "~1Tcode: ~A~%" (-> this code)) + (format #t "~1Ttrans: ~A~%" (-> this trans)) + (format #t "~1Tpost: ~A~%" (-> this post)) + (format #t "~1Tenter: ~A~%" (-> this enter)) + (format #t "~1Tevent: ~A~%" (-> this event)) (label cfg-4) - obj + this ) ;; definition of type event-message-block @@ -665,21 +665,21 @@ ) ;; definition for method 3 of type event-message-block -(defmethod inspect event-message-block ((obj event-message-block)) - (when (not obj) - (set! obj obj) +(defmethod inspect event-message-block ((this event-message-block)) + (when (not this) + (set! this this) (goto cfg-8) ) - (format #t "[~8x] ~A~%" obj 'event-message-block) - (format #t "~1Tto-handle: ~D~%" (-> obj to-handle)) - (format #t "~1Tto: ~A~%" (ppointer->process (-> obj to))) - (format #t "~1Tfrom-handle: ~D~%" (-> obj form-handle)) - (format #t "~1Tfrom: ~A~%" (ppointer->process (-> obj from))) - (format #t "~1Tparam[6] @ #x~X~%" (-> obj param)) - (format #t "~1Tmessage: ~A~%" (-> obj message)) - (format #t "~1Tnum-params: ~D~%" (-> obj num-params)) + (format #t "[~8x] ~A~%" this 'event-message-block) + (format #t "~1Tto-handle: ~D~%" (-> this to-handle)) + (format #t "~1Tto: ~A~%" (ppointer->process (-> this to))) + (format #t "~1Tfrom-handle: ~D~%" (-> this form-handle)) + (format #t "~1Tfrom: ~A~%" (ppointer->process (-> this from))) + (format #t "~1Tparam[6] @ #x~X~%" (-> this param)) + (format #t "~1Tmessage: ~A~%" (-> this message)) + (format #t "~1Tnum-params: ~D~%" (-> this num-params)) (label cfg-8) - obj + this ) ;; definition of type event-message-block-array @@ -695,17 +695,17 @@ ) ;; definition for method 3 of type event-message-block-array -(defmethod inspect event-message-block-array ((obj event-message-block-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect event-message-block-array ((this event-message-block-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -736,13 +736,13 @@ ) ;; definition for method 2 of type sql-result -(defmethod print sql-result ((obj sql-result)) - (format #t "#(~A" (-> obj error)) - (dotimes (s5-0 (-> obj len)) - (format #t " ~A" (-> obj data s5-0)) +(defmethod print sql-result ((this sql-result)) + (format #t "#(~A" (-> this error)) + (dotimes (s5-0 (-> this len)) + (format #t " ~A" (-> this data s5-0)) ) (format #t ")") - obj + this ) ;; definition for symbol *sql-result*, type sql-result diff --git a/test/decompiler/reference/jak2/kernel/gkernel_REF.gc b/test/decompiler/reference/jak2/kernel/gkernel_REF.gc index 5223fbda2b..1756694045 100644 --- a/test/decompiler/reference/jak2/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gkernel_REF.gc @@ -26,8 +26,8 @@ (define *last-loado-debug-usage* 0) ;; definition for method 7 of type object -(defmethod relocate object ((obj object) (arg0 int)) - obj +(defmethod relocate object ((this object) (arg0 int)) + this ) ;; definition for symbol *kernel-packages*, type pair @@ -75,35 +75,43 @@ ;; definition for method 1 of type thread ;; WARN: Return type mismatch int vs none. -(defmethod delete thread ((obj thread)) - (when (= obj (-> obj process main-thread)) +(defmethod delete thread ((this thread)) + (when (= this (-> this process main-thread)) (break!) 0 ) - (set! (-> obj process top-thread) (the-as cpu-thread (-> obj previous))) + (set! (-> this process top-thread) (the-as cpu-thread (-> this previous))) 0 (none) ) ;; definition for method 2 of type thread -(defmethod print thread ((obj thread)) - (format #t "#<~A ~S of ~S pc: #x~X @ #x~X>" (-> obj type) (-> obj name) (-> obj process name) (-> obj pc) obj) - obj +(defmethod print thread ((this thread)) + (format + #t + "#<~A ~S of ~S pc: #x~X @ #x~X>" + (-> this type) + (-> this name) + (-> this process name) + (-> this pc) + this + ) + this ) ;; definition for method 9 of type thread ;; WARN: Return type mismatch int vs none. -(defmethod stack-size-set! thread ((obj thread) (arg0 int)) - (let ((a2-0 (-> obj process))) +(defmethod stack-size-set! thread ((this thread) (arg0 int)) + (let ((a2-0 (-> this process))) (cond - ((!= obj (-> a2-0 main-thread)) + ((!= this (-> a2-0 main-thread)) (format 0 "ERROR: illegal attempt change stack size of ~A when the main-thread is not the top-thread.~%" a2-0) ) - ((= (-> obj stack-size) arg0) + ((= (-> this stack-size) arg0) ) - ((= (-> a2-0 heap-cur) (+ (+ (-> obj stack-size) -4 (-> obj type size)) (the-as int obj))) - (set! (-> a2-0 heap-cur) (the-as pointer (+ (+ arg0 -4 (-> obj type size)) (the-as int obj)))) - (set! (-> obj stack-size) arg0) + ((= (-> a2-0 heap-cur) (+ (+ (-> this stack-size) -4 (-> this type size)) (the-as int this))) + (set! (-> a2-0 heap-cur) (the-as pointer (+ (+ arg0 -4 (-> this type size)) (the-as int this)))) + (set! (-> this stack-size) arg0) ) (else (format 0 "ERROR: illegal attempt change stack size of ~A after more heap allocation has occured.~%" a2-0) @@ -146,8 +154,8 @@ ;; definition for method 5 of type cpu-thread ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of cpu-thread ((obj cpu-thread)) - (the-as int (+ (-> obj type size) (-> obj stack-size))) +(defmethod asize-of cpu-thread ((this cpu-thread)) + (the-as int (+ (-> this type size) (-> this stack-size))) ) ;; definition for function remove-exit @@ -270,9 +278,9 @@ (define *pause-lock* #f) ;; definition for method 2 of type process-tree -(defmethod print process-tree ((obj process-tree)) - (format #t "#<~A ~S @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print process-tree ((this process-tree)) + (format #t "#<~A ~S @ #x~X>" (-> this type) (-> this name) this) + this ) ;; definition for method 0 of type process-tree @@ -291,17 +299,17 @@ ) ;; definition for method 3 of type process-tree -(defmethod inspect process-tree ((obj process-tree)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~S~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (stream<-process-mask #t (-> obj mask)) +(defmethod inspect process-tree ((this process-tree)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~S~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (stream<-process-mask #t (-> this mask)) (format #t ")~%") - (format #t "~Tclock: ~A~%" (-> obj clock)) - (format #t "~Tparent: ~A~%" (ppointer->process (-> obj parent))) - (format #t "~Tbrother: ~A~%" (ppointer->process (-> obj brother))) - (format #t "~Tchild: ~A~%" (ppointer->process (-> obj child))) - obj + (format #t "~Tclock: ~A~%" (-> this clock)) + (format #t "~Tparent: ~A~%" (ppointer->process (-> this parent))) + (format #t "~Tbrother: ~A~%" (ppointer->process (-> this brother))) + (format #t "~Tchild: ~A~%" (ppointer->process (-> this child))) + this ) ;; definition for method 0 of type process @@ -358,83 +366,82 @@ ) ;; definition for method 3 of type process -(defmethod inspect process ((obj process)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~S~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (stream<-process-mask #t (-> obj mask)) +(defmethod inspect process ((this process)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~S~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (stream<-process-mask #t (-> this mask)) (format #t ")~%") - (format #t "~Tclock: ~A~%" (-> obj clock)) - (format #t "~Tstatus: ~A~%" (-> obj status)) - (format #t "~Tmain-thread: ~A~%" (-> obj main-thread)) - (format #t "~Ttop-thread: ~A~%" (-> obj top-thread)) - (format #t "~Tentity: ~A~%" (-> obj entity)) - (format #t "~Tlevel: ~A~%" (-> obj level)) - (format #t "~Tstate: ~A~%" (-> obj state)) - (format #t "~Tnext-state: ~A~%" (-> obj next-state)) - (format #t "~Ttrans-hook: ~A~%" (-> obj trans-hook)) - (format #t "~Tpost-hook: ~A~%" (-> obj post-hook)) - (format #t "~Tevent-hook: ~A~%" (-> obj event-hook)) - (format #t "~Tparent: ~A~%" (ppointer->process (-> obj parent))) - (format #t "~Tbrother: ~A~%" (ppointer->process (-> obj brother))) - (format #t "~Tchild: ~A~%" (ppointer->process (-> obj child))) - (format #t "~Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) - (format #t "~Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) - (format #t "~Theap-base: #x~X~%" (-> obj heap-base)) - (format #t "~Theap-top: #x~X~%" (-> obj heap-top)) - (format #t "~Theap-cur: #x~X~%" (-> obj heap-cur)) + (format #t "~Tclock: ~A~%" (-> this clock)) + (format #t "~Tstatus: ~A~%" (-> this status)) + (format #t "~Tmain-thread: ~A~%" (-> this main-thread)) + (format #t "~Ttop-thread: ~A~%" (-> this top-thread)) + (format #t "~Tentity: ~A~%" (-> this entity)) + (format #t "~Tlevel: ~A~%" (-> this level)) + (format #t "~Tstate: ~A~%" (-> this state)) + (format #t "~Tnext-state: ~A~%" (-> this next-state)) + (format #t "~Ttrans-hook: ~A~%" (-> this trans-hook)) + (format #t "~Tpost-hook: ~A~%" (-> this post-hook)) + (format #t "~Tevent-hook: ~A~%" (-> this event-hook)) + (format #t "~Tparent: ~A~%" (ppointer->process (-> this parent))) + (format #t "~Tbrother: ~A~%" (ppointer->process (-> this brother))) + (format #t "~Tchild: ~A~%" (ppointer->process (-> this child))) + (format #t "~Tconnection-list: ~`connectable`P~%" (-> this connection-list)) + (format #t "~Tstack-frame-top: ~A~%" (-> this stack-frame-top)) + (format #t "~Theap-base: #x~X~%" (-> this heap-base)) + (format #t "~Theap-top: #x~X~%" (-> this heap-top)) + (format #t "~Theap-cur: #x~X~%" (-> this heap-cur)) (let ((s5-0 *print-column*)) (set! *print-column* (+ *print-column* 64)) (format #t "----~%") - (inspect-process-heap obj) + (inspect-process-heap this) (format #t "----~%") (set! *print-column* s5-0) ) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Tstack[~D] @ #x~X~%" (-> obj allocated-length) (-> obj stack)) - obj + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Tstack[~D] @ #x~X~%" (-> this allocated-length) (-> this stack)) + this ) ;; definition for method 5 of type process ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of process ((obj process)) - (the-as int (+ (-> process size) (-> obj allocated-length))) +(defmethod asize-of process ((this process)) + (the-as int (+ (-> process size) (-> this allocated-length))) ) ;; definition for method 2 of type process -;; INFO: this function exists in multiple non-identical object files -(defmethod print process ((obj process)) +(defmethod print process ((this process)) (cond - ((and (-> obj top-thread) (!= (-> obj status) 'dead)) - (format #t "#<~A ~S ~A :state ~S " (-> obj type) (-> obj name) (-> obj status) (if (-> obj state) - (-> obj state name) - ) + ((and (-> this top-thread) (!= (-> this status) 'dead)) + (format #t "#<~A ~S ~A :state ~S " (-> this type) (-> this name) (-> this status) (if (-> this state) + (-> this state name) + ) ) (format #t ":stack ~D/~D :heap ~D/~D @ #x~X>" - (&- (-> obj top-thread stack-top) (the-as uint (-> obj top-thread sp))) - (-> obj main-thread stack-size) - (- (-> obj allocated-length) (&- (-> obj heap-top) (the-as uint (-> obj heap-cur)))) - (-> obj allocated-length) - obj + (&- (-> this top-thread stack-top) (the-as uint (-> this top-thread sp))) + (-> this main-thread stack-size) + (- (-> this allocated-length) (&- (-> this heap-top) (the-as uint (-> this heap-cur)))) + (-> this allocated-length) + this ) ) (else (format #t "#<~A ~S ~A :state ~S @ #x~X" - (-> obj type) - (-> obj name) - (-> obj status) - (if (-> obj state) - (-> obj state name) + (-> this type) + (-> this name) + (-> this status) + (if (-> this state) + (-> this state name) ) - obj + this ) ) ) - obj + this ) ;; definition for function return-from-thread @@ -477,9 +484,9 @@ ) ;; definition for method 14 of type dead-pool -(defmethod get-process dead-pool ((obj dead-pool) (arg0 type) (arg1 int)) - (let ((s4-0 (the-as object (-> obj child)))) - (when (and (not (the-as (pointer process-tree) s4-0)) *debug-segment* (!= obj *debug-dead-pool*)) +(defmethod get-process dead-pool ((this dead-pool) (arg0 type) (arg1 int)) + (let ((s4-0 (the-as object (-> this child)))) + (when (and (not (the-as (pointer process-tree) s4-0)) *debug-segment* (!= this *debug-dead-pool*)) (set! s4-0 (get-process *debug-dead-pool* arg0 arg1)) (if (the-as process s4-0) (format @@ -487,7 +494,7 @@ "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%" arg0 (ppointer->process (the-as process s4-0)) - (-> obj name) + (-> this name) ) ) ) @@ -502,7 +509,7 @@ "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" arg0 (ppointer->process (the-as (pointer process) s4-0)) - (-> obj name) + (-> this name) ) (the-as process #f) ) @@ -512,8 +519,8 @@ ;; definition for method 15 of type dead-pool ;; WARN: Return type mismatch int vs none. -(defmethod return-process dead-pool ((obj dead-pool) (arg0 process)) - (change-parent arg0 obj) +(defmethod return-process dead-pool ((this dead-pool) (arg0 process)) + (change-parent arg0 this) 0 (none) ) @@ -536,34 +543,34 @@ ;; definition for method 16 of type dead-pool-heap ;; WARN: Return type mismatch dead-pool-heap vs none. -(defmethod init dead-pool-heap ((obj dead-pool-heap) (arg0 symbol) (arg1 int)) - (countdown (v1-0 (-> obj allocated-length)) - (let ((a0-4 (-> obj process-list v1-0))) +(defmethod init dead-pool-heap ((this dead-pool-heap) (arg0 symbol) (arg1 int)) + (countdown (v1-0 (-> this allocated-length)) + (let ((a0-4 (-> this process-list v1-0))) (set! (-> a0-4 process) *null-process*) - (set! (-> a0-4 next) (-> obj process-list (+ v1-0 1))) + (set! (-> a0-4 next) (-> this process-list (+ v1-0 1))) ) ) - (set! (-> obj dead-list next) (the-as dead-pool-heap-rec (-> obj process-list))) - (set! (-> obj alive-list process) #f) - (set! (-> obj process-list (+ (-> obj allocated-length) -1) next) #f) - (set! (-> obj alive-list prev) (-> obj alive-list)) - (set! (-> obj alive-list next) #f) - (set! (-> obj alive-list process) #f) - (set! (-> obj first-gap) (-> obj alive-list)) - (set! (-> obj first-shrink) #f) + (set! (-> this dead-list next) (the-as dead-pool-heap-rec (-> this process-list))) + (set! (-> this alive-list process) #f) + (set! (-> this process-list (+ (-> this allocated-length) -1) next) #f) + (set! (-> this alive-list prev) (-> this alive-list)) + (set! (-> this alive-list next) #f) + (set! (-> this alive-list process) #f) + (set! (-> this first-gap) (-> this alive-list)) + (set! (-> this first-shrink) #f) (cond ((zero? arg1) - (set! (-> obj heap base) (the-as pointer 0)) - (set! (-> obj heap current) (the-as pointer 0)) - (set! (-> obj heap top) (the-as pointer 0)) - (set! (-> obj heap top-base) (the-as pointer 0)) + (set! (-> this heap base) (the-as pointer 0)) + (set! (-> this heap current) (the-as pointer 0)) + (set! (-> this heap top) (the-as pointer 0)) + (set! (-> this heap top-base) (the-as pointer 0)) 0 ) (else - (set! (-> obj heap base) (malloc arg0 arg1)) - (set! (-> obj heap current) (-> obj heap base)) - (set! (-> obj heap top) (&+ (-> obj heap base) arg1)) - (set! (-> obj heap top-base) (-> obj heap top)) + (set! (-> this heap base) (malloc arg0 arg1)) + (set! (-> this heap current) (-> this heap base)) + (set! (-> this heap top) (&+ (-> this heap base) arg1)) + (set! (-> this heap top-base) (-> this heap top)) ) ) (none) @@ -571,39 +578,39 @@ ;; definition for method 25 of type dead-pool-heap ;; WARN: Return type mismatch object vs pointer. -(defmethod gap-location dead-pool-heap ((obj dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-location dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) (the-as pointer (if (-> arg0 process) (+ (+ (-> arg0 process allocated-length) -4 (-> process size)) (the-as int (-> arg0 process))) - (-> obj heap base) + (-> this heap base) ) ) ) ;; definition for method 24 of type dead-pool-heap -(defmethod gap-size dead-pool-heap ((obj dead-pool-heap) (arg0 dead-pool-heap-rec)) +(defmethod gap-size dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) (cond ((-> arg0 process) (let ((v1-3 (&+ (&+ (the-as pointer (-> arg0 process)) (-> process size)) (-> arg0 process allocated-length)))) (if (-> arg0 next) (&- (the-as pointer (-> arg0 next process)) (the-as uint v1-3)) - (&- (-> obj heap top) (the-as uint (&+ v1-3 4))) + (&- (-> this heap top) (the-as uint (&+ v1-3 4))) ) ) ) ((-> arg0 next) - (&- (the-as pointer (-> arg0 next process)) (the-as uint (&+ (-> obj heap base) 4))) + (&- (the-as pointer (-> arg0 next process)) (the-as uint (&+ (-> this heap base) 4))) ) (else - (&- (-> obj heap top) (the-as uint (-> obj heap base))) + (&- (-> this heap top) (the-as uint (-> this heap base))) ) ) ) ;; definition for method 26 of type dead-pool-heap -(defmethod find-gap dead-pool-heap ((obj dead-pool-heap) (arg0 dead-pool-heap-rec)) - (while (and (-> arg0 next) (zero? (gap-size obj arg0))) +(defmethod find-gap dead-pool-heap ((this dead-pool-heap) (arg0 dead-pool-heap-rec)) + (while (and (-> arg0 next) (zero? (gap-size this arg0))) (set! arg0 (-> arg0 next)) ) arg0 @@ -611,90 +618,90 @@ ;; definition for method 3 of type dead-pool-heap ;; INFO: this function exists in multiple non-identical object files -(defmethod inspect dead-pool-heap ((obj dead-pool-heap)) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~Tname: ~A~%" (-> obj name)) - (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) - (stream<-process-mask #t (-> obj mask)) +(defmethod inspect dead-pool-heap ((this dead-pool-heap)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~Tname: ~A~%" (-> this name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> this mask)) + (stream<-process-mask #t (-> this mask)) (format #t ")~%") - (format #t "~Tparent: #x~X~%" (-> obj parent)) - (format #t "~Tbrother: #x~X~%" (-> obj brother)) - (format #t "~Tchild: #x~X~%" (-> obj child)) - (format #t "~Tppointer: #x~X~%" (-> obj ppointer)) - (format #t "~Tself: ~A~%" (-> obj self)) - (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~Theap: #~%" (-> obj heap)) - (format #t "~Tfirst-gap: #~%" (-> obj first-gap)) - (format #t "~Tfirst-shrink: #~%" (-> obj first-shrink)) - (format #t "~Talive-list: #~%" (-> obj alive-list)) - (format #t "~Tlast: #~%" (-> obj alive-list prev)) - (format #t "~Tdead-list: #~%" (-> obj dead-list)) - (let* ((s5-0 (&- (-> obj heap top) (the-as uint (-> obj heap base)))) - (v1-3 (if (-> obj alive-list prev) - (gap-size obj (-> obj alive-list prev)) + (format #t "~Tparent: #x~X~%" (-> this parent)) + (format #t "~Tbrother: #x~X~%" (-> this brother)) + (format #t "~Tchild: #x~X~%" (-> this child)) + (format #t "~Tppointer: #x~X~%" (-> this ppointer)) + (format #t "~Tself: ~A~%" (-> this self)) + (format #t "~Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~Theap: #~%" (-> this heap)) + (format #t "~Tfirst-gap: #~%" (-> this first-gap)) + (format #t "~Tfirst-shrink: #~%" (-> this first-shrink)) + (format #t "~Talive-list: #~%" (-> this alive-list)) + (format #t "~Tlast: #~%" (-> this alive-list prev)) + (format #t "~Tdead-list: #~%" (-> this dead-list)) + (let* ((s5-0 (&- (-> this heap top) (the-as uint (-> this heap base)))) + (v1-3 (if (-> this alive-list prev) + (gap-size this (-> this alive-list prev)) s5-0 ) ) ) - (format #t "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%" (-> obj process-list) (- s5-0 v1-3) s5-0) + (format #t "~Tprocess-list[0] @ #x~X ~D/~D bytes used~%" (-> this process-list) (- s5-0 v1-3) s5-0) ) - (let ((s5-1 (-> obj alive-list)) + (let ((s5-1 (-> this alive-list)) (s4-0 0) ) (while s5-1 (if (-> s5-1 process) (format #t "~T [~3D] # ~A~%" s4-0 s5-1 (-> s5-1 process)) ) - (let ((s3-0 (gap-size obj s5-1))) + (let ((s3-0 (gap-size this s5-1))) (if (nonzero? s3-0) - (format #t "~T gap: ~D bytes @ #x~X~%" s3-0 (gap-location obj s5-1)) + (format #t "~T gap: ~D bytes @ #x~X~%" s3-0 (gap-location this s5-1)) ) ) (set! s5-1 (-> s5-1 next)) (+! s4-0 1) ) ) - obj + this ) ;; definition for method 5 of type dead-pool-heap ;; WARN: Return type mismatch uint vs int. -(defmethod asize-of dead-pool-heap ((obj dead-pool-heap)) - (the-as int (+ (-> obj type size) (* 12 (-> obj allocated-length)))) +(defmethod asize-of dead-pool-heap ((this dead-pool-heap)) + (the-as int (+ (-> this type size) (* 12 (-> this allocated-length)))) ) ;; definition for method 20 of type dead-pool-heap -(defmethod memory-used dead-pool-heap ((obj dead-pool-heap)) - (if (-> obj alive-list prev) - (- (memory-total obj) (gap-size obj (-> obj alive-list prev))) +(defmethod memory-used dead-pool-heap ((this dead-pool-heap)) + (if (-> this alive-list prev) + (- (memory-total this) (gap-size this (-> this alive-list prev))) 0 ) ) ;; definition for method 21 of type dead-pool-heap -(defmethod memory-total dead-pool-heap ((obj dead-pool-heap)) - (&- (-> obj heap top) (the-as uint (-> obj heap base))) +(defmethod memory-total dead-pool-heap ((this dead-pool-heap)) + (&- (-> this heap top) (the-as uint (-> this heap base))) ) ;; definition for method 22 of type dead-pool-heap -(defmethod memory-free dead-pool-heap ((obj dead-pool-heap)) - (let ((v1-0 (-> obj heap top))) - (if (-> obj alive-list prev) - (gap-size obj (-> obj alive-list prev)) - (&- v1-0 (the-as uint (-> obj heap base))) +(defmethod memory-free dead-pool-heap ((this dead-pool-heap)) + (let ((v1-0 (-> this heap top))) + (if (-> this alive-list prev) + (gap-size this (-> this alive-list prev)) + (&- v1-0 (the-as uint (-> this heap base))) ) ) ) ;; definition for method 23 of type dead-pool-heap -(defmethod compact-time dead-pool-heap ((obj dead-pool-heap)) - (-> obj compact-time) +(defmethod compact-time dead-pool-heap ((this dead-pool-heap)) + (-> this compact-time) ) ;; definition for method 27 of type dead-pool-heap -(defmethod find-gap-by-size dead-pool-heap ((obj dead-pool-heap) (arg0 int)) - (let ((gp-0 (-> obj first-gap))) - (while (and gp-0 (< (gap-size obj gp-0) arg0)) +(defmethod find-gap-by-size dead-pool-heap ((this dead-pool-heap) (arg0 int)) + (let ((gp-0 (-> this first-gap))) + (while (and gp-0 (< (gap-size this gp-0) arg0)) (set! gp-0 (-> gp-0 next)) ) gp-0 @@ -702,14 +709,14 @@ ) ;; definition for method 14 of type dead-pool-heap -(defmethod get-process dead-pool-heap ((obj dead-pool-heap) (arg0 type) (arg1 int)) - (let ((s4-0 (-> obj dead-list next)) +(defmethod get-process dead-pool-heap ((this dead-pool-heap) (arg0 type) (arg1 int)) + (let ((s4-0 (-> this dead-list next)) (s3-0 (the-as process #f)) ) - (let ((s1-0 (find-gap-by-size obj (the-as int (+ (-> process size) arg1))))) + (let ((s1-0 (find-gap-by-size this (the-as int (+ (-> process size) arg1))))) (cond - ((and s4-0 s1-0 (nonzero? (-> obj heap base))) - (set! (-> obj dead-list next) (-> s4-0 next)) + ((and s4-0 s1-0 (nonzero? (-> this heap base))) + (set! (-> this dead-list next) (-> s4-0 next)) (let ((v1-6 (-> s1-0 next))) (set! (-> s1-0 next) s4-0) (set! (-> s4-0 next) v1-6) @@ -718,26 +725,26 @@ ) ) (set! (-> s4-0 prev) s1-0) - (if (= s1-0 (-> obj alive-list prev)) - (set! (-> obj alive-list prev) s4-0) + (if (= s1-0 (-> this alive-list prev)) + (set! (-> this alive-list prev) s4-0) ) - (let ((a0-5 (gap-location obj s1-0))) + (let ((a0-5 (gap-location this s1-0))) (set! s3-0 ((method-of-type process new) (the-as symbol a0-5) process "process" arg1)) ) (set! (-> s4-0 process) s3-0) (set! (-> s3-0 ppointer) (&-> s4-0 process)) - (if (= (-> obj first-gap) s1-0) - (set! (-> obj first-gap) (find-gap obj s4-0)) + (if (= (-> this first-gap) s1-0) + (set! (-> this first-gap) (find-gap this s4-0)) ) - (if (or (not (-> obj first-shrink)) (< (the-as int s3-0) (the-as int (-> obj first-shrink process)))) - (set! (-> obj first-shrink) s4-0) + (if (or (not (-> this first-shrink)) (< (the-as int s3-0) (the-as int (-> this first-shrink process)))) + (set! (-> this first-shrink) s4-0) ) - (set! (-> s3-0 parent) (-> obj ppointer)) - (set! (-> s3-0 pool) obj) - (set! (-> obj child) (&-> s4-0 process)) + (set! (-> s3-0 parent) (-> this ppointer)) + (set! (-> s3-0 pool) this) + (set! (-> this child) (&-> s4-0 process)) ) (else - (when (and *debug-segment* (!= obj *debug-dead-pool*)) + (when (and *debug-segment* (!= this *debug-dead-pool*)) (set! s3-0 (get-process *debug-dead-pool* arg0 arg1)) (if (and s3-0 *vis-boot*) (format @@ -745,7 +752,7 @@ "WARNING: ~A ~A had to be allocated from the debug pool, because ~A was empty.~%" arg0 s3-0 - (-> obj name) + (-> this name) ) ) ) @@ -754,7 +761,7 @@ ) (if s3-0 (set! (-> s3-0 type) arg0) - (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" arg0 s3-0 (-> obj name)) + (format 0 "WARNING: ~A ~A could not be allocated, because ~A was empty.~%" arg0 s3-0 (-> this name)) ) s3-0 ) @@ -762,32 +769,32 @@ ;; definition for method 15 of type dead-pool-heap ;; WARN: Return type mismatch int vs none. -(defmethod return-process dead-pool-heap ((obj dead-pool-heap) (arg0 process)) - (if (!= obj (-> arg0 pool)) - (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" arg0 obj) +(defmethod return-process dead-pool-heap ((this dead-pool-heap) (arg0 process)) + (if (!= this (-> arg0 pool)) + (format 0 "ERROR: process ~A does not belong to dead-pool-heap ~A.~%" arg0 this) ) - (change-parent arg0 obj) - (set! (-> obj child) (the-as (pointer process-tree) #f)) + (change-parent arg0 this) + (set! (-> this child) (the-as (pointer process-tree) #f)) (let ((s5-1 (-> arg0 ppointer))) - (if (or (= (-> obj first-gap) s5-1) (< (the-as int (gap-location obj (the-as dead-pool-heap-rec s5-1))) - (the-as int (gap-location obj (-> obj first-gap))) - ) + (if (or (= (-> this first-gap) s5-1) (< (the-as int (gap-location this (the-as dead-pool-heap-rec s5-1))) + (the-as int (gap-location this (-> this first-gap))) + ) ) - (set! (-> obj first-gap) (the-as dead-pool-heap-rec (-> s5-1 1))) + (set! (-> this first-gap) (the-as dead-pool-heap-rec (-> s5-1 1))) ) - (when (= (-> obj first-shrink) s5-1) - (set! (-> obj first-shrink) (the-as dead-pool-heap-rec (-> s5-1 1))) - (if (not (-> obj first-shrink process)) - (set! (-> obj first-shrink) #f) + (when (= (-> this first-shrink) s5-1) + (set! (-> this first-shrink) (the-as dead-pool-heap-rec (-> s5-1 1))) + (if (not (-> this first-shrink process)) + (set! (-> this first-shrink) #f) ) ) (set! (-> s5-1 1 clock) (the-as clock (-> s5-1 2))) (if (-> s5-1 2) (set! (-> s5-1 2 mask) (the-as process-mask (-> s5-1 1))) - (set! (-> obj alive-list prev) (the-as dead-pool-heap-rec (-> s5-1 1))) + (set! (-> this alive-list prev) (the-as dead-pool-heap-rec (-> s5-1 1))) ) - (set! (-> s5-1 2) (the-as process (-> obj dead-list next))) - (set! (-> obj dead-list next) (the-as dead-pool-heap-rec s5-1)) + (set! (-> s5-1 2) (the-as process (-> this dead-list next))) + (set! (-> this dead-list next) (the-as dead-pool-heap-rec s5-1)) (set! (-> s5-1 0) *null-process*) ) 0 @@ -795,7 +802,7 @@ ) ;; definition for method 18 of type dead-pool-heap -(defmethod shrink-heap dead-pool-heap ((obj dead-pool-heap) (arg0 process)) +(defmethod shrink-heap dead-pool-heap ((this dead-pool-heap) (arg0 process)) (when arg0 (let ((s5-0 (-> arg0 ppointer))) (when (not (or (logtest? (-> arg0 mask) (process-mask heap-shrunk)) @@ -804,28 +811,28 @@ ) (set! (-> arg0 allocated-length) (&- (-> arg0 heap-cur) (the-as uint (-> arg0 stack)))) (set! (-> arg0 heap-top) (&-> arg0 stack (-> arg0 allocated-length))) - (if (< (the-as int arg0) (the-as int (gap-location obj (-> obj first-gap)))) - (set! (-> obj first-gap) (find-gap obj (the-as dead-pool-heap-rec s5-0))) + (if (< (the-as int arg0) (the-as int (gap-location this (-> this first-gap)))) + (set! (-> this first-gap) (find-gap this (the-as dead-pool-heap-rec s5-0))) ) (logior! (-> arg0 mask) (process-mask heap-shrunk)) ) - (if (= (-> obj first-shrink) s5-0) - (set! (-> obj first-shrink) (the-as dead-pool-heap-rec (-> s5-0 2))) + (if (= (-> this first-shrink) s5-0) + (set! (-> this first-shrink) (the-as dead-pool-heap-rec (-> s5-0 2))) ) ) ) - obj + this ) ;; definition for method 17 of type dead-pool-heap ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 17 dead-pool-heap) has a return type of none, but the expression builder found a return statement. -(defmethod compact dead-pool-heap ((obj dead-pool-heap) (arg0 int)) - (if (zero? (-> obj heap base)) +(defmethod compact dead-pool-heap ((this dead-pool-heap) (arg0 int)) + (if (zero? (-> this heap base)) (return 0) ) - (let* ((s4-0 (memory-free obj)) - (v1-5 (memory-total obj)) + (let* ((s4-0 (memory-free this)) + (v1-5 (memory-total this)) (f0-2 (/ (the float s4-0) (the float v1-5))) ) (cond @@ -843,33 +850,33 @@ ) ) ) - (set! (-> obj compact-count-targ) (the-as uint arg0)) - (set! (-> obj compact-count) (the-as uint 0)) + (set! (-> this compact-count-targ) (the-as uint arg0)) + (set! (-> this compact-count) (the-as uint 0)) (while (nonzero? arg0) (+! arg0 -1) - (let ((v1-19 (-> obj first-shrink))) + (let ((v1-19 (-> this first-shrink))) (when (not v1-19) - (set! v1-19 (-> obj alive-list next)) - (set! (-> obj first-shrink) v1-19) + (set! v1-19 (-> this alive-list next)) + (set! (-> this first-shrink) v1-19) ) (if v1-19 - (shrink-heap obj (-> v1-19 process)) + (shrink-heap this (-> v1-19 process)) ) ) - (let ((s4-1 (-> obj first-gap))) + (let ((s4-1 (-> this first-gap))) (when (-> s4-1 next) (let ((s3-0 (-> s4-1 next process)) - (s2-0 (gap-size obj s4-1)) + (s2-0 (gap-size this s4-1)) ) (when (nonzero? s2-0) (when (< s2-0 0) (break!) 0 ) - (shrink-heap obj s3-0) + (shrink-heap this s3-0) (relocate s3-0 (- s2-0)) - (set! (-> obj first-gap) (find-gap obj s4-1)) - (+! (-> obj compact-count) 1) + (set! (-> this first-gap) (find-gap this s4-1)) + (+! (-> this compact-count) 1) ) ) ) @@ -881,28 +888,28 @@ ;; definition for method 19 of type dead-pool-heap ;; WARN: Return type mismatch int vs none. -(defmethod churn dead-pool-heap ((obj dead-pool-heap) (arg0 int)) +(defmethod churn dead-pool-heap ((this dead-pool-heap) (arg0 int)) (while (nonzero? arg0) (+! arg0 -1) - (let ((s4-0 (-> obj alive-list next))) + (let ((s4-0 (-> this alive-list next))) (when s4-0 - (if (or (= (-> obj first-gap) s4-0) - (< (the-as int (gap-location obj s4-0)) (the-as int (gap-location obj (-> obj first-gap)))) + (if (or (= (-> this first-gap) s4-0) + (< (the-as int (gap-location this s4-0)) (the-as int (gap-location this (-> this first-gap)))) ) - (set! (-> obj first-gap) (-> s4-0 prev)) + (set! (-> this first-gap) (-> s4-0 prev)) ) - (when (= (-> obj first-shrink) s4-0) - (set! (-> obj first-shrink) (-> s4-0 prev)) - (if (not (-> obj first-shrink process)) - (set! (-> obj first-shrink) #f) + (when (= (-> this first-shrink) s4-0) + (set! (-> this first-shrink) (-> s4-0 prev)) + (if (not (-> this first-shrink process)) + (set! (-> this first-shrink) #f) ) ) (set! (-> s4-0 prev next) (-> s4-0 next)) (if (-> s4-0 next) (set! (-> s4-0 next prev) (-> s4-0 prev)) - (set! (-> obj alive-list prev) (-> s4-0 prev)) + (set! (-> this alive-list prev) (-> s4-0 prev)) ) - (let ((a1-3 (-> obj alive-list prev))) + (let ((a1-3 (-> this alive-list prev))) (let ((v1-19 (-> a1-3 next))) (set! (-> a1-3 next) s4-0) (set! (-> s4-0 next) v1-19) @@ -911,9 +918,9 @@ ) ) (set! (-> s4-0 prev) a1-3) - (set! (-> obj alive-list prev) s4-0) + (set! (-> this alive-list prev) s4-0) (set! (-> s4-0 process) - (relocate (-> s4-0 process) (&- (gap-location obj a1-3) (the-as uint (&-> (-> s4-0 process) type)))) + (relocate (-> s4-0 process) (&- (gap-location this a1-3) (the-as uint (&-> (-> s4-0 process) type)))) ) ) ) @@ -1025,7 +1032,7 @@ ) ;; definition for method 12 of type process -(defmethod run-logic? process ((obj process)) +(defmethod run-logic? process ((this process)) #t ) @@ -1396,42 +1403,42 @@ ) ;; definition for method 9 of type process -(defmethod activate process ((obj process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) - (set! (-> obj mask) (logclear (-> arg0 mask) (process-mask sleep sleep-code process-tree heap-shrunk))) - (set! (-> obj clock) (-> arg0 clock)) - (set! (-> obj status) 'ready) +(defmethod activate process ((this process) (arg0 process-tree) (arg1 basic) (arg2 pointer)) + (set! (-> this mask) (logclear (-> arg0 mask) (process-mask sleep sleep-code process-tree heap-shrunk))) + (set! (-> this clock) (-> arg0 clock)) + (set! (-> this status) 'ready) (let ((v1-5 (-> *kernel-context* next-pid))) - (set! (-> obj pid) v1-5) + (set! (-> this pid) v1-5) (set! (-> *kernel-context* next-pid) (+ v1-5 1)) ) - (set! (-> obj top-thread) #f) - (set! (-> obj main-thread) #f) - (set! (-> obj name) (the-as string arg1)) - (let ((v1-10 (&-> obj stack (-> obj type heap-base)))) - (set! (-> obj heap-cur) v1-10) - (set! (-> obj heap-base) v1-10) + (set! (-> this top-thread) #f) + (set! (-> this main-thread) #f) + (set! (-> this name) (the-as string arg1)) + (let ((v1-10 (&-> this stack (-> this type heap-base)))) + (set! (-> this heap-cur) v1-10) + (set! (-> this heap-base) v1-10) ) - (set! (-> obj stack-frame-top) #f) - (mem-set32! (-> obj stack) (the-as int (shr (-> obj type heap-base) 2)) 0) - (set! (-> obj trans-hook) #f) - (set! (-> obj post-hook) #f) - (set! (-> obj event-hook) #f) - (set! (-> obj state) #f) - (set! (-> obj next-state) #f) + (set! (-> this stack-frame-top) #f) + (mem-set32! (-> this stack) (the-as int (shr (-> this type heap-base) 2)) 0) + (set! (-> this trans-hook) #f) + (set! (-> this post-hook) #f) + (set! (-> this event-hook) #f) + (set! (-> this state) #f) + (set! (-> this next-state) #f) (cond ((logtest? (-> arg0 mask) (process-mask process-tree)) - (set! (-> obj entity) #f) - (set! (-> obj level) *default-level*) + (set! (-> this entity) #f) + (set! (-> this level) *default-level*) ) (else - (set! (-> obj entity) (-> (the-as process arg0) entity)) - (set! (-> obj level) (-> (the-as process arg0) level)) + (set! (-> this entity) (-> (the-as process arg0) entity)) + (set! (-> this level) (-> (the-as process arg0) level)) ) ) - (set! (-> obj connection-list next1) #f) - (set! (-> obj connection-list prev1) #f) - (set! (-> obj main-thread) (new 'process 'cpu-thread obj 'code 256 arg2)) - (change-parent obj arg0) + (set! (-> this connection-list next1) #f) + (set! (-> this connection-list prev1) #f) + (set! (-> this main-thread) (new 'process 'cpu-thread this 'code 256 arg2)) + (change-parent this arg0) ) ;; definition for function run-function-in-process @@ -1469,7 +1476,7 @@ ;; definition for method 10 of type process-tree ;; WARN: Return type mismatch int vs none. -(defmethod deactivate process-tree ((obj process-tree)) +(defmethod deactivate process-tree ((this process-tree)) 0 (none) ) @@ -1486,16 +1493,16 @@ ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)] ;; ERROR: Unsupported inline assembly instruction kind - [jr ra] -(defmethod deactivate process ((obj process)) +(defmethod deactivate process ((this process)) (local-vars (s7-0 none) (ra-0 int)) (with-pp - (when (!= (-> obj status) 'dead) - (set! (-> obj next-state) dead-state) - (if (-> obj entity) - (entity-deactivate-handler obj (-> obj entity)) + (when (!= (-> this status) 'dead) + (set! (-> this next-state) dead-state) + (if (-> this entity) + (entity-deactivate-handler this (-> this entity)) ) (let ((s5-0 pp)) - (set! pp obj) + (set! pp this) (let ((s4-0 (-> pp stack-frame-top))) (while (the-as protect-frame s4-0) (case (-> s4-0 type) @@ -1508,8 +1515,8 @@ ) (set! pp s5-0) ) - (process-disconnect obj) - (let ((v1-12 (-> obj child))) + (process-disconnect this) + (let ((v1-12 (-> this child))) (while v1-12 (let ((s5-1 (-> v1-12 0 brother))) (deactivate (-> v1-12 0)) @@ -1517,25 +1524,25 @@ ) ) ) - (return-process (-> obj pool) obj) - (set! (-> obj state) #f) - (set! (-> obj next-state) #f) - (set! (-> obj entity) #f) - (set! (-> obj pid) 0) + (return-process (-> this pool) this) + (set! (-> this state) #f) + (set! (-> this next-state) #f) + (set! (-> this entity) #f) + (set! (-> this pid) 0) (cond - ((= (-> *kernel-context* current-process) obj) - (set! (-> obj status) 'dead) + ((= (-> *kernel-context* current-process) this) + (set! (-> this status) 'dead) (.lw ra-0 return-from-thread s7-0) (.jr ra-0) (nop!) 0 ) - ((= (-> obj status) 'initialize) - (set! (-> obj status) 'dead) + ((= (-> this status) 'initialize) + (set! (-> this status) 'dead) (throw 'initialize #f) ) ) - (set! (-> obj status) 'dead) + (set! (-> this status) 'dead) ) 0 (none) diff --git a/test/decompiler/reference/jak2/kernel/gstate_REF.gc b/test/decompiler/reference/jak2/kernel/gstate_REF.gc index 431cd2a217..99cca00cd8 100644 --- a/test/decompiler/reference/jak2/kernel/gstate_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gstate_REF.gc @@ -36,9 +36,9 @@ ) ;; definition for method 2 of type state -(defmethod print state ((obj state)) - (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) - obj +(defmethod print state ((this state)) + (format #t "#<~A ~A @ #x~X>" (-> this type) (-> this name) this) + this ) ;; definition for function enter-state @@ -151,9 +151,9 @@ ;; definition for method 9 of type event-message-block-array ;; WARN: Return type mismatch int vs none. -(defmethod send-all! event-message-block-array ((obj event-message-block-array)) - (dotimes (s5-0 (-> obj length)) - (let* ((a1-0 (-> obj data s5-0)) +(defmethod send-all! event-message-block-array ((this event-message-block-array)) + (dotimes (s5-0 (-> this length)) + (let* ((a1-0 (-> this data s5-0)) (a0-2 (handle->process (-> a1-0 to-handle))) ) (if (and a0-2 (handle->process (-> a1-0 form-handle))) @@ -161,7 +161,7 @@ ) ) ) - (set! (-> obj length) 0) + (set! (-> this length) 0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/kernel/gstring_REF.gc b/test/decompiler/reference/jak2/kernel/gstring_REF.gc index 7265e421c9..e3328eb139 100644 --- a/test/decompiler/reference/jak2/kernel/gstring_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gstring_REF.gc @@ -2,21 +2,21 @@ (in-package goal) ;; definition for method 4 of type string -(defmethod length string ((obj string)) - (let ((v1-0 (-> obj data))) +(defmethod length string ((this string)) + (let ((v1-0 (-> this data))) (while (nonzero? (-> v1-0 0)) (nop!) (nop!) (nop!) (set! v1-0 (&-> v1-0 1)) ) - (&- v1-0 (the-as uint (-> obj data))) + (&- v1-0 (the-as uint (-> this data))) ) ) ;; definition for method 5 of type string -(defmethod asize-of string ((obj string)) - (+ (-> obj allocated-length) 1 (-> string size)) +(defmethod asize-of string ((this string)) + (+ (-> this allocated-length) 1 (-> string size)) ) ;; definition for function copy-string<-string diff --git a/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc b/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc index 5bc95910b7..6b263726c3 100644 --- a/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/ash1-course_REF.gc @@ -15,25 +15,27 @@ ) ;; definition for method 3 of type ashelin-battle -(defmethod inspect ashelin-battle ((obj ashelin-battle)) - (when (not obj) - (set! obj obj) +(defmethod inspect ashelin-battle ((this ashelin-battle)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type ashelin inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tplayer-in-bounds-time: ~D~%" (-> obj player-in-bounds-time)) + (format #t "~2Tplayer-in-bounds-time: ~D~%" (-> this player-in-bounds-time)) (label cfg-4) - obj + this ) ;; definition for method 251 of type ashelin-battle ;; WARN: Return type mismatch int vs none. -(defmethod set-frontline-dist! ashelin-battle ((obj ashelin-battle)) +(defmethod set-frontline-dist! ashelin-battle ((this ashelin-battle)) (let ((a0-1 *target*)) (when a0-1 - (set! (-> obj frontline w) (- (+ 40960.0 (vector-dot (the-as vector (-> obj frontline)) (get-trans a0-1 0))))) + (set! (-> this frontline w) + (- (+ 40960.0 (vector-dot (the-as vector (-> this frontline)) (get-trans a0-1 0)))) + ) 0 ) ) @@ -101,12 +103,12 @@ ) ) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (let ((s5-0 (get-current-task-event (-> arg1 task)))) (cond ((and (nonzero? (-> arg1 waypoint-time0)) - (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) + (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 1)) (let ((f0-0 143360.0)) (and (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg1 root trans))) (= (-> s5-0 action) (game-task-action say)) @@ -205,13 +207,13 @@ (with-pp (when (not (channel-active? arg1 (the-as uint 0))) (cond - ((and (not (speech-playing? arg1 45)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2.5))) + ((and (not (speech-playing? arg1 45)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.5))) (play-speech arg1 45) ) - ((and (not (speech-playing? arg1 46)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 7))) + ((and (not (speech-playing? arg1 46)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 7))) (play-speech arg1 46) ) - ((and (not (speech-playing? arg1 47)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 14))) + ((and (not (speech-playing? arg1 47)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 14))) (play-speech arg1 47) ) ) @@ -249,9 +251,9 @@ (set-frontline-dist! arg0) (let ((s5-0 (target-pos 0))) (if (>= (-> s5-0 y) 176128.0) - (set! (-> arg0 player-in-bounds-time) (current-time)) + (set-time! (-> arg0 player-in-bounds-time)) ) - (if (>= (- (current-time) (-> arg0 player-in-bounds-time)) (seconds 4)) + (if (time-elapsed? (-> arg0 player-in-bounds-time) (seconds 4)) (send-event arg0 'instant-death) ) (if (< (-> s5-0 y) 192512.0) @@ -308,7 +310,7 @@ (set! (-> v1-22 bytes 8) 7) (let ((v0-12 (lambda ((arg0 asht-wait-spot) (arg1 ashelin-battle)) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.5)) (let ((s5-0 (get-current-task-event (-> arg1 task)))) (when (and (= (-> s5-0 action) (game-task-action say)) (not (channel-active? arg1 (the-as uint 0))) 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 7c1c76e623..3a7bbf706e 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-obs_REF.gc @@ -25,24 +25,24 @@ ) ;; definition for method 3 of type piston -(defmethod inspect piston ((obj piston)) - (when (not obj) - (set! obj obj) +(defmethod inspect piston ((this piston)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-trans: #~%" (-> obj sound-trans)) - (format #t "~2Tinit-height: ~f~%" (-> obj init-height)) - (format #t "~2Trange-top: ~f~%" (-> obj range-top)) - (format #t "~2Trange-bottom: ~f~%" (-> obj range-bottom)) - (format #t "~2Tsound-time[2] @ #x~X~%" (-> obj sound-time)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tpiston-id: ~D~%" (-> obj piston-id)) - (format #t "~2Tlooping-id: ~D~%" (-> obj looping-id)) + (format #t "~2Tsound-trans: #~%" (-> this sound-trans)) + (format #t "~2Tinit-height: ~f~%" (-> this init-height)) + (format #t "~2Trange-top: ~f~%" (-> this range-top)) + (format #t "~2Trange-bottom: ~f~%" (-> this range-bottom)) + (format #t "~2Tsound-time[2] @ #x~X~%" (-> this sound-time)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tpiston-id: ~D~%" (-> this piston-id)) + (format #t "~2Tlooping-id: ~D~%" (-> this looping-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -136,16 +136,16 @@ ) ;; definition for method 10 of type piston -(defmethod deactivate piston ((obj piston)) - (sound-stop (-> obj looping-id)) - ((method-of-type process-focusable deactivate) obj) +(defmethod deactivate piston ((this piston)) + (sound-stop (-> this looping-id)) + ((method-of-type process-focusable deactivate) this) (none) ) ;; definition for method 11 of type piston ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! piston ((obj piston) (arg0 entity-actor)) +(defmethod init-from-entity! piston ((this piston) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -153,7 +153,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-64 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -169,23 +169,23 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj sound-trans quad) (-> obj root trans quad)) - (+! (-> obj root trans y) 53248.0) + (process-drawable-from-entity! this arg0) + (set! (-> this sound-trans quad) (-> this root trans quad)) + (+! (-> this root trans y) 53248.0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-piston" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj focus-status) (focus-status ignore)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logior! (-> this focus-status) (focus-status ignore)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj piston-id) - (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) + (set! (-> this piston-id) + (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) ) (let ((a1-8 (new 'stack-no-clear 'sync-info-params))) (let ((v1-29 0)) @@ -196,13 +196,13 @@ This commonly includes things such as: (set! (-> a1-8 sync-flags) (the-as sync-flags v1-29)) ) (set! (-> a1-8 period) (the-as uint 1500)) - (set! (-> a1-8 entity) (-> obj entity)) + (set! (-> a1-8 entity) (-> this entity)) (set! (-> a1-8 percent) 0.0) (set! (-> a1-8 ease-in) 0.15) (set! (-> a1-8 ease-out) 0.15) (set! (-> a1-8 pause-in) 0.0) (set! (-> a1-8 pause-out) 0.0) - (initialize! (-> obj sync) a1-8) + (initialize! (-> this sync) a1-8) ) (let ((f28-0 -3.0) (f30-0 3.0) @@ -214,29 +214,29 @@ This commonly includes things such as: (set! f30-0 (-> v1-40 1)) ) ) - (set! (-> obj range-bottom) (* 4096.0 f28-0)) - (set! (-> obj range-top) (* 4096.0 f30-0)) + (set! (-> this range-bottom) (* 4096.0 f28-0)) + (set! (-> this range-top) (* 4096.0 f30-0)) ) - (set! (-> obj init-height) (-> obj root trans y)) - (+! (-> obj root trans y) -40960.0) + (set! (-> this init-height) (-> this root trans y)) + (+! (-> this root trans y) -40960.0) (cond - ((logtest? (actor-option user18) (-> obj fact options)) - (set! (-> obj looping-id) (new-sound-id)) + ((logtest? (actor-option user18) (-> this fact options)) + (set! (-> this looping-id) (new-sound-id)) ) (else - (set! (-> obj looping-id) (new 'static 'sound-id)) + (set! (-> this looping-id) (new 'static 'sound-id)) 0 ) ) (ja-channel-push! 1 0) - (let ((a0-26 (-> obj skel root-channel 0))) - (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-26 (-> this skel root-channel 0))) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-26 param 0) 1.0) (set! (-> a0-26 frame-num) 0.0) - (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-loop!) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -258,20 +258,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type turbine -(defmethod inspect turbine ((obj turbine)) - (when (not obj) - (set! obj obj) +(defmethod inspect turbine ((this turbine)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tdest-height: ~f~%" (-> obj dest-height)) - (format #t "~2Trise-height: ~f~%" (-> obj rise-height)) - (format #t "~2Trotspeed: ~f~%" (-> obj rotspeed)) - (format #t "~2Trisen: ~A~%" (-> obj risen)) + (format #t "~2Tdest-height: ~f~%" (-> this dest-height)) + (format #t "~2Trise-height: ~f~%" (-> this rise-height)) + (format #t "~2Trotspeed: ~f~%" (-> this rotspeed)) + (format #t "~2Trisen: ~A~%" (-> this risen)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -332,7 +332,7 @@ This commonly includes things such as: ;; definition for method 11 of type turbine ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! turbine ((obj turbine) (arg0 entity-actor)) +(defmethod init-from-entity! turbine ((this turbine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -340,7 +340,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -356,18 +356,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (+! (-> obj root trans y) 73728.0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (+! (-> this root trans y) 73728.0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-turbine" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj dest-height) (-> obj root trans y)) - (set! (-> obj risen) #f) + (set! (-> this dest-height) (-> this root trans y)) + (set! (-> this risen) #f) (let ((f30-0 8192.0) (f28-0 0.0) ) @@ -383,21 +383,21 @@ This commonly includes things such as: (set! f28-0 (-> (the-as (pointer float) v1-27))) ) ) - (set! (-> obj rotspeed) f30-0) - (set! (-> obj rise-height) f28-0) + (set! (-> this rotspeed) f30-0) + (set! (-> this rise-height) f28-0) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "turbine" :fo-max 50) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "turbine" :fo-max 50) (-> this root trans)) ) (ja-channel-push! 1 0) - (let ((a0-19 (-> obj skel root-channel 0))) - (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-19 (-> this skel root-channel 0))) + (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-19 param 0) 1.0) (set! (-> a0-19 frame-num) 0.0) - (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + (joint-control-channel-group! a0-19 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-loop!) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -418,18 +418,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type liftcat -(defmethod inspect liftcat ((obj liftcat)) - (when (not obj) - (set! obj obj) +(defmethod inspect liftcat ((this liftcat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tup-y: ~f~%" (-> obj up-y)) - (format #t "~2Tdown-y: ~f~%" (-> obj down-y)) + (format #t "~2Tup-y: ~f~%" (-> this up-y)) + (format #t "~2Tdown-y: ~f~%" (-> this down-y)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -467,7 +467,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "liftcat") ) :trans (behavior () @@ -476,7 +476,7 @@ This commonly includes things such as: (if (>= (-> self down-y) (-> gp-0 trans y)) (go-virtual idle-down) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (set! (-> self root transv y) -8192.0) (set! (-> self root transv y) 0.0) ) @@ -509,7 +509,7 @@ This commonly includes things such as: ;; definition for method 11 of type liftcat ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! liftcat ((obj liftcat) (arg0 entity-actor)) +(defmethod init-from-entity! liftcat ((this liftcat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -517,7 +517,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -533,10 +533,10 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (let ((s4-1 (-> obj root))) + (process-drawable-from-entity! this arg0) + (let ((s4-1 (-> this root))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-15 (res-lump-data arg0 'trans-offset vector :tag-ptr (& sv-16)))) (when v1-15 @@ -554,40 +554,40 @@ This commonly includes things such as: ) ) ) - (+! (-> obj root trans y) 55558.145) + (+! (-> this root trans y) 55558.145) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-liftcat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-24 (-> obj root))) - (set! (-> obj down-y) (-> v1-24 trans y)) + (let ((v1-24 (-> this root))) + (set! (-> this down-y) (-> v1-24 trans y)) (+! (-> v1-24 trans y) 28672.0) - (set! (-> obj up-y) (-> v1-24 trans y)) + (set! (-> this up-y) (-> v1-24 trans y)) (vector-reset! (-> v1-24 transv)) ) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (if (task-complete? *game-info* (game-task atoll-sig)) - (process-entity-status! obj (entity-perm-status subtask-complete) #t) + (process-entity-status! this (entity-perm-status subtask-complete) #t) ) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (set! (-> obj root trans y) (-> obj down-y)) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (set! (-> this root trans y) (-> this down-y)) (transform-post) - (go (method-of-object obj idle-down)) + (go (method-of-object this idle-down)) ) (else - (set! (-> obj root trans y) (-> obj up-y)) + (set! (-> this root trans y) (-> this up-y)) (transform-post) - (go (method-of-object obj idle-up)) + (go (method-of-object this idle-up)) ) ) (none) @@ -613,22 +613,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type atollrotpipe -(defmethod inspect atollrotpipe ((obj atollrotpipe)) - (when (not obj) - (set! obj obj) +(defmethod inspect atollrotpipe ((this atollrotpipe)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsmush: #~%" (-> obj smush)) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Trot-angle: ~f~%" (-> obj rot-angle)) - (format #t "~2Tshudder-angle: ~f~%" (-> obj shudder-angle)) - (format #t "~2Tcycle-time: ~f~%" (-> obj cycle-time)) - (format #t "~2Tcycle-offset: ~f~%" (-> obj cycle-offset)) + (format #t "~2Tsmush: #~%" (-> this smush)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Trot-angle: ~f~%" (-> this rot-angle)) + (format #t "~2Tshudder-angle: ~f~%" (-> this shudder-angle)) + (format #t "~2Tcycle-time: ~f~%" (-> this cycle-time)) + (format #t "~2Tcycle-offset: ~f~%" (-> this cycle-offset)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -660,20 +660,20 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (the int (-> self cycle-offset))) + (until (time-elapsed? gp-0 (the int (-> self cycle-offset))) (suspend) ) ) (until #f (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (the int (-> self cycle-time))) + (until (time-elapsed? gp-1 (the int (-> self cycle-time))) (suspend) ) ) (activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock)) (sound-play "rot-pipe-wiggle" :position (-> self root trans)) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.75)) + (until (time-elapsed? gp-3 (seconds 0.75)) (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) (suspend) ) @@ -681,7 +681,7 @@ This commonly includes things such as: (set! (-> self shudder-angle) 0.0) (set-zero! (-> self smush)) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.25)) + (until (time-elapsed? gp-4 (seconds 0.25)) (suspend) ) ) @@ -690,7 +690,7 @@ This commonly includes things such as: (f30-1 (* 16384.0 f0-7)) (gp-6 (current-time)) ) - (until (>= (- (current-time) gp-6) (seconds 0.5)) + (until (time-elapsed? gp-6 (seconds 0.5)) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) @@ -718,7 +718,7 @@ This commonly includes things such as: ;; definition for method 11 of type atollrotpipe ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atollrotpipe ((obj atollrotpipe) (arg0 entity-actor)) +(defmethod init-from-entity! atollrotpipe ((this atollrotpipe) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -726,7 +726,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -742,24 +742,24 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (set! (-> obj root rider-max-momentum) 8192.0) - (process-drawable-from-entity! obj arg0) + (set! (-> this root rider-max-momentum) 8192.0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atollrotpipe" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj rot-angle) 0.0) - (set! (-> obj shudder-angle) 0.0) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this rot-angle) 0.0) + (set! (-> this shudder-angle) 0.0) + (quaternion-copy! (-> this init-quat) (-> this root quat)) (ja-channel-push! 1 0) - (let ((s4-2 (-> obj skel root-channel 0))) + (let ((s4-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s4-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s4-2 frame-num) 0.0) @@ -775,10 +775,10 @@ This commonly includes things such as: (set! f30-0 (-> v1-29 1)) ) ) - (set! (-> obj cycle-time) (the float (max 0 (+ (the int (* 300.0 f28-0)) -375)))) - (set! (-> obj cycle-offset) (the float (the int (* 300.0 f30-0)))) + (set! (-> this cycle-time) (the float (max 0 (+ (the int (* 300.0 f28-0)) -375)))) + (set! (-> this cycle-offset) (the float (the int (* 300.0 f30-0)))) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -803,23 +803,23 @@ This commonly includes things such as: ) ;; definition for method 3 of type slider -(defmethod inspect slider ((obj slider)) - (when (not obj) - (set! obj obj) +(defmethod inspect slider ((this slider)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tcollide-off-timer: ~D~%" (-> obj collide-off-timer)) - (format #t "~2Tl-points[6] @ #x~X~%" (-> obj l-points)) - (format #t "~2Tl-bolts[4] @ #x~X~%" (-> obj l-bolts)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tcollide-off-timer: ~D~%" (-> this collide-off-timer)) + (format #t "~2Tl-points[6] @ #x~X~%" (-> this l-points)) + (format #t "~2Tl-bolts[4] @ #x~X~%" (-> this l-bolts)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -834,7 +834,7 @@ This commonly includes things such as: :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('touch 'attack) - (when (>= (- (current-time) (the-as int (-> self collide-off-timer))) (seconds 2)) + (when (time-elapsed? (the-as int (-> self collide-off-timer)) (seconds 2)) (let* ((s4-0 proc) (s3-0 (if (type? s4-0 process-focusable) s4-0 @@ -911,42 +911,42 @@ This commonly includes things such as: ) ;; definition for method 12 of type slider -(defmethod run-logic? slider ((obj slider)) +(defmethod run-logic? slider ((this slider)) #t ) ;; definition for method 10 of type slider -(defmethod deactivate slider ((obj slider)) - (sound-stop (the-as sound-id (-> obj sound-id))) - ((the-as (function process-drawable none) (find-parent-method slider 10)) obj) +(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) (none) ) ;; definition for method 7 of type slider ;; WARN: Return type mismatch process-drawable vs slider. -(defmethod relocate slider ((obj slider) (arg0 int)) +(defmethod relocate slider ((this slider) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj l-bolts v1-0)) - (&+! (-> obj l-bolts v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method slider 7)) this arg0) ) ) ;; definition for method 11 of type slider ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! slider ((obj slider) (arg0 entity-actor)) +(defmethod init-from-entity! slider ((this slider) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -960,12 +960,12 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-drawable-from-entity! obj arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-slider" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -978,31 +978,31 @@ This commonly includes things such as: (set! (-> a1-7 sync-flags) (the-as sync-flags v1-12)) ) (set! (-> a1-7 period) (the-as uint 2400)) - (set! (-> a1-7 entity) (-> obj entity)) + (set! (-> a1-7 entity) (-> this entity)) (set! (-> a1-7 percent) 0.0) (set! (-> a1-7 ease-in) 0.15) (set! (-> a1-7 ease-out) 0.15) (set! (-> a1-7 pause-in) 0.0) (set! (-> a1-7 pause-out) 0.0) - (initialize! (-> obj sync) a1-7) + (initialize! (-> this sync) a1-7) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-pos) 0.0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-pos) 0.0) (let* ((v1-24 *game-info*) (a0-20 (+ (-> v1-24 attack-id) 1)) ) (set! (-> v1-24 attack-id) a0-20) - (set! (-> obj attack-id) a0-20) + (set! (-> this attack-id) a0-20) ) - (set! (-> obj sound-id) (the-as uint (new-sound-id))) - (set! (-> obj collide-off-timer) (the-as uint 0)) - (set-vector! (-> obj l-points 0) 19660.8 20480.0 1638.4 0.0) - (set-vector! (-> obj l-points 1) 0.0 24576.0 1638.4 0.0) - (set-vector! (-> obj l-points 2) -19660.8 20480.0 1638.4 0.0) - (set-vector! (-> obj l-points 3) 19660.8 20480.0 -1638.4 0.0) - (set-vector! (-> obj l-points 4) 0.0 24576.0 -1638.4 0.0) - (set-vector! (-> obj l-points 5) -19660.8 20480.0 -1638.4 0.0) + (set! (-> this sound-id) (the-as uint (new-sound-id))) + (set! (-> this collide-off-timer) (the-as uint 0)) + (set-vector! (-> this l-points 0) 19660.8 20480.0 1638.4 0.0) + (set-vector! (-> this l-points 1) 0.0 24576.0 1638.4 0.0) + (set-vector! (-> this l-points 2) -19660.8 20480.0 1638.4 0.0) + (set-vector! (-> this l-points 3) 19660.8 20480.0 -1638.4 0.0) + (set-vector! (-> this l-points 4) 0.0 24576.0 -1638.4 0.0) + (set-vector! (-> this l-points 5) -19660.8 20480.0 -1638.4 0.0) (let ((s5-2 (new 'static 'lightning-spec :name #f @@ -1023,11 +1023,11 @@ This commonly includes things such as: :sound #f ) ) - (s4-2 (-> obj l-points)) - (s3-0 (-> obj root trans)) + (s4-2 (-> this l-points)) + (s3-0 (-> this root trans)) ) (dotimes (s2-0 4) - (set! (-> obj l-bolts s2-0) (new 'process 'lightning-control s5-2 obj 0.0)) + (set! (-> this l-bolts s2-0) (new 'process 'lightning-control s5-2 this 0.0)) (let* ((a1-10 (if (< s2-0 1) (+ s2-0 1) s2-0 @@ -1036,27 +1036,27 @@ This commonly includes things such as: (a0-39 (vector+! (new 'stack-no-clear 'vector) s3-0 (-> s4-2 a1-10))) (v1-37 (vector+! (new 'stack-no-clear 'vector) s3-0 (-> s4-2 (+ a1-10 1)))) ) - (set! (-> obj l-bolts s2-0 state meet data 0 quad) (-> a0-39 quad)) - (let ((a0-43 (-> obj l-bolts s2-0))) + (set! (-> this l-bolts s2-0 state meet data 0 quad) (-> a0-39 quad)) + (let ((a0-43 (-> this l-bolts s2-0))) (set! (-> a0-43 state meet data (+ (-> a0-43 state points-to-draw) -1) quad) (-> v1-37 quad)) ) ) ) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "slider" :fo-max 50) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "slider" :fo-max 50) (-> this root trans)) ) (ja-channel-push! 1 0) - (let ((s5-3 (-> obj skel root-channel 0))) + (let ((s5-3 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-3 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-3 frame-num) 0.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1076,19 +1076,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type atoll-windmill -(defmethod inspect atoll-windmill ((obj atoll-windmill)) - (when (not obj) - (set! obj obj) +(defmethod inspect atoll-windmill ((this atoll-windmill)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tblade-normal: #~%" (-> obj blade-normal)) - (format #t "~2Torig-quat: #~%" (-> obj orig-quat)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tblade-normal: #~%" (-> this blade-normal)) + (format #t "~2Torig-quat: #~%" (-> this orig-quat)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1124,14 +1124,14 @@ This commonly includes things such as: ;; definition for method 11 of type atoll-windmill ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-windmill ((obj atoll-windmill) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-windmill ((this atoll-windmill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) + (logior! (-> this mask) (process-mask ambient)) (let ((a1-1 (new 'stack-no-clear 'sync-info-params))) (let ((v1-2 0)) (if #f @@ -1143,33 +1143,33 @@ This commonly includes things such as: (set! (-> a1-1 entity) arg0) (set! (-> a1-1 period) (the-as uint 3000)) (set! (-> a1-1 percent) 0.0) - (initialize! (-> obj sync) a1-1) + (initialize! (-> this sync) a1-1) ) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-windmill" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-copy! (-> obj orig-quat) (-> obj root quat)) - (vector-z-quaternion! (-> obj blade-normal) (-> obj root quat)) - (vector-normalize! (-> obj blade-normal) 1.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "atoll-windmill" :fo-max 50) (-> obj root trans)) + (quaternion-copy! (-> this orig-quat) (-> this root quat)) + (vector-z-quaternion! (-> this blade-normal) (-> this root quat)) + (vector-normalize! (-> this blade-normal) 1.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "atoll-windmill" :fo-max 50) (-> this root trans)) ) (ja-channel-push! 1 0) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1186,16 +1186,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type atoll-valve -(defmethod inspect atoll-valve ((obj atoll-valve)) - (when (not obj) - (set! obj obj) +(defmethod inspect atoll-valve ((this atoll-valve)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1213,24 +1213,24 @@ This commonly includes things such as: ;; definition for method 11 of type atoll-valve ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-valve ((obj atoll-valve) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-valve ((this atoll-valve) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-valve" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1247,16 +1247,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type atoll-hatch -(defmethod inspect atoll-hatch ((obj atoll-hatch)) - (when (not obj) - (set! obj obj) +(defmethod inspect atoll-hatch ((this atoll-hatch)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1274,48 +1274,48 @@ This commonly includes things such as: ;; definition for method 11 of type atoll-hatch ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-hatch ((obj atoll-hatch) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-hatch ((this atoll-hatch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-hatch" (the-as (pointer uint32) #f))) (the-as pair 0) ) (cond ((task-complete? *game-info* (game-task atoll-water)) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) 1.0) (set! (-> a0-8 frame-num) 1.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-seek!) ) ) (else - (let ((a0-9 (-> obj skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-9 (-> this skel root-channel 0))) + (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-9 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) (set! (-> a0-9 param 1) 1.0) (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-seek!) + (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-seek!) ) ) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1333,16 +1333,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type atoll-hellcat -(defmethod inspect atoll-hellcat ((obj atoll-hellcat)) - (when (not obj) - (set! obj obj) +(defmethod inspect atoll-hellcat ((this atoll-hellcat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1361,14 +1361,14 @@ This commonly includes things such as: ;; definition for method 11 of type atoll-hellcat ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-hellcat ((obj atoll-hellcat) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-hellcat ((this atoll-hellcat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core action) (collide-action solid)) @@ -1382,22 +1382,22 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-hellcat" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((a1-7 (new 'stack-no-clear 'vector))) (set-vector! a1-7 0.0 19441.436 0.0 1.0) - (quaternion-zxy! (-> obj root quat) a1-7) + (quaternion-zxy! (-> this root quat) a1-7) ) (transform-post) (if (task-complete? *game-info* (game-task atoll-battle)) - (go (method-of-object obj die-fast)) - (go (method-of-object obj idle)) + (go (method-of-object this die-fast)) + (go (method-of-object this idle)) ) (none) ) @@ -1422,16 +1422,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type atoll-mar-symbol -(defmethod inspect atoll-mar-symbol ((obj atoll-mar-symbol)) - (when (not obj) - (set! obj obj) +(defmethod inspect atoll-mar-symbol ((this atoll-mar-symbol)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1442,22 +1442,22 @@ This commonly includes things such as: ;; definition for method 11 of type atoll-mar-symbol ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-mar-symbol ((obj atoll-mar-symbol) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-mar-symbol ((this atoll-mar-symbol) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-mar-symbol" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1470,9 +1470,9 @@ This commonly includes things such as: () (local-vars (v1-31 symbol)) (set! (-> self data-int32 0) 0) - (set! (-> self beep-time) (current-time)) + (set-time! (-> self beep-time)) (until #f - (when (>= (- (current-time) (-> self beep-time)) (seconds 40)) + (when (time-elapsed? (-> self beep-time) (seconds 40)) (let ((v1-7 (logand (-> self data-int32 0) 3))) (cond ((zero? v1-7) @@ -1489,7 +1489,7 @@ This commonly includes things such as: ) ) ) - (set! (-> self beep-time) (current-time)) + (set-time! (-> self beep-time)) (+! (-> self data-int32 0) 1) ) (b! diff --git a/test/decompiler/reference/jak2/levels/atoll/atoll-part_REF.gc b/test/decompiler/reference/jak2/levels/atoll/atoll-part_REF.gc index 365730e148..f934211259 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type atoll-part -(defmethod inspect atoll-part ((obj atoll-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect atoll-part ((this atoll-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc b/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc index e8b3eea868..e6bc06625d 100644 --- a/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/atoll-tank_REF.gc @@ -1664,48 +1664,48 @@ ) ;; definition for method 3 of type atoll-tank -(defmethod inspect atoll-tank ((obj atoll-tank)) - (when (not obj) - (set! obj obj) +(defmethod inspect atoll-tank ((this atoll-tank)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tis-master?: ~A~%" (-> obj is-master?)) - (format #t "~2Taftermath-part: ~A~%" (-> obj aftermath-part)) + (format #t "~2Tis-master?: ~A~%" (-> this is-master?)) + (format #t "~2Taftermath-part: ~A~%" (-> this aftermath-part)) (label cfg-4) - obj + this ) ;; definition for method 10 of type atoll-tank -(defmethod deactivate atoll-tank ((obj atoll-tank)) - (if (nonzero? (-> obj aftermath-part)) - (kill-and-free-particles (-> obj aftermath-part)) +(defmethod deactivate atoll-tank ((this atoll-tank)) + (if (nonzero? (-> this aftermath-part)) + (kill-and-free-particles (-> this aftermath-part)) ) - ((method-of-type process-focusable deactivate) obj) + ((method-of-type process-focusable deactivate) this) (none) ) ;; definition for method 7 of type atoll-tank ;; WARN: Return type mismatch process-focusable vs atoll-tank. -(defmethod relocate atoll-tank ((obj atoll-tank) (arg0 int)) - (if (nonzero? (-> obj aftermath-part)) - (&+! (-> obj aftermath-part) arg0) +(defmethod relocate atoll-tank ((this atoll-tank) (arg0 int)) + (if (nonzero? (-> this aftermath-part)) + (&+! (-> this aftermath-part) arg0) ) - (the-as atoll-tank ((method-of-type process-focusable relocate) obj arg0)) + (the-as atoll-tank ((method-of-type process-focusable relocate) this arg0)) ) ;; definition for method 12 of type atoll-tank -(defmethod run-logic? atoll-tank ((obj atoll-tank)) +(defmethod run-logic? atoll-tank ((this atoll-tank)) #t ) ;; definition for method 20 of type atoll-tank ;; INFO: Used lq/sq -(defmethod get-trans atoll-tank ((obj atoll-tank) (arg0 int)) +(defmethod get-trans atoll-tank ((this atoll-tank) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((v1-0 (-> obj root))) + (let ((v1-0 (-> this root))) (case arg0 ((3 2) (let ((v0-0 (new 'static 'vector :w 1.0))) @@ -1791,15 +1791,15 @@ ;; definition for method 11 of type atoll-tank ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! atoll-tank ((obj atoll-tank) (arg0 entity-actor)) +(defmethod init-from-entity! atoll-tank ((this atoll-tank) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj is-master?) #t) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this is-master?) #t) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s4-0 total-prims) (the-as uint 10)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1867,45 +1867,45 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-28 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-28 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-atoll-tank-a-debris" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj focus-status) (focus-status ignore)) + (logior! (-> this focus-status) (focus-status ignore)) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (transform-post) - (setup-masks (-> obj draw) 0 2) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 321) obj)) - (set! (-> obj aftermath-part) (create-launch-control (-> *part-group-id-table* 322) obj)) + (setup-masks (-> this draw) 0 2) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 321) this)) + (set! (-> this aftermath-part) (create-launch-control (-> *part-group-id-table* 322) this)) (cond ((task-node-closed? (game-task-node atoll-sig-tank)) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) (else - (logior! (-> obj draw status) (draw-control-status no-draw)) - (let ((v1-54 (-> obj root root-prim))) + (logior! (-> this draw status) (draw-control-status no-draw)) + (let ((v1-54 (-> this root root-prim))) (set! (-> v1-54 prim-core collide-as) (collide-spec)) (set! (-> v1-54 prim-core collide-with) (collide-spec)) ) - (set! (-> obj root backup-collide-as) (collide-spec)) - (set! (-> obj root backup-collide-with) (collide-spec)) + (set! (-> this root backup-collide-as) (collide-spec)) + (set! (-> this root backup-collide-with) (collide-spec)) 0 - (go (method-of-object obj dormant)) + (go (method-of-object this dormant)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc b/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc index 564729cd10..a11e761f68 100644 --- a/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/juicer_REF.gc @@ -117,42 +117,42 @@ ) ;; definition for method 3 of type juicer-shot -(defmethod inspect juicer-shot ((obj juicer-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect juicer-shot ((this juicer-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlightning[5] @ #x~X~%" (-> obj lightning)) - (format #t "~2Tvictim: ~D~%" (-> obj victim)) + (format #t "~2Tlightning[5] @ #x~X~%" (-> this lightning)) + (format #t "~2Tvictim: ~D~%" (-> this victim)) (label cfg-4) - obj + this ) ;; definition for method 35 of type juicer-shot ;; INFO: Used lq/sq -(defmethod event-handler! juicer-shot ((obj juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod event-handler! juicer-shot ((this juicer-shot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Multiplex the projectile's event processing, called by [[projectile-event-handler]]" (case arg2 (('reset) (let ((v1-1 (the-as object (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> (the-as matrix v1-1) trans quad)) - (set! (-> obj starting-pos quad) (-> (the-as matrix v1-1) trans quad)) - (set! (-> obj root transv quad) (-> (&+ (the-as matrix v1-1) 64) quad 0)) - (set! (-> obj pre-move-transv quad) (-> (&+ (the-as matrix v1-1) 64) quad 0)) + (set! (-> this root trans quad) (-> (the-as matrix v1-1) trans quad)) + (set! (-> this starting-pos quad) (-> (the-as matrix v1-1) trans quad)) + (set! (-> this root transv quad) (-> (&+ (the-as matrix v1-1) 64) quad 0)) + (set! (-> this pre-move-transv quad) (-> (&+ (the-as matrix v1-1) 64) quad 0)) ) - (set! (-> obj hits) 0) - (set! (-> obj spawn-time) (current-time)) - (if (made-impact? obj) - (go (method-of-object obj impact)) - (go (method-of-object obj moving)) + (set! (-> this hits) 0) + (set-time! (-> this spawn-time)) + (if (made-impact? this) + (go (method-of-object this impact)) + (go (method-of-object this moving)) ) #t ) (else - ((method-of-type projectile event-handler!) obj arg0 arg1 arg2 arg3) + ((method-of-type projectile event-handler!) this arg0 arg1 arg2 arg3) ) ) ) @@ -166,7 +166,7 @@ ) ;; definition for method 37 of type juicer-shot -(defmethod deal-damage! juicer-shot ((obj juicer-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! juicer-shot ((this juicer-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((a0-2 (if (type? arg0 process-focusable) arg0 @@ -174,7 +174,7 @@ ) ) (when a0-2 - (set! (-> obj victim) (process->handle a0-2)) + (set! (-> this victim) (process->handle a0-2)) #t ) ) @@ -183,10 +183,10 @@ ;; definition for method 25 of type juicer-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles juicer-shot ((obj juicer-shot)) +(defmethod spawn-impact-particles juicer-shot ((this juicer-shot)) "Spawns associated particles with the projectile if applicable" - (let ((s5-0 (-> obj starting-pos)) - (s4-0 (-> obj root trans)) + (let ((s5-0 (-> this starting-pos)) + (s4-0 (-> this root trans)) ) (when (line-in-view-frustum? s5-0 s4-0) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -195,7 +195,7 @@ ) (launch-particles (-> *part-id-table* 4637) s5-0) (launch-particles (-> *part-id-table* 4638) s5-0) - (when (not (handle->process (-> obj victim))) + (when (not (handle->process (-> this victim))) (launch-particles (-> *part-id-table* 4637) s4-0) (launch-particles (-> *part-id-table* 4638) s4-0) ) @@ -208,12 +208,12 @@ (dotimes (s0-0 5) (vector-matrix*! s3-0 s3-0 s1-0) (vector+! s2-0 s3-0 s5-0) - (let ((a0-17 (-> obj lightning s0-0)) + (let ((a0-17 (-> this lightning s0-0)) (v1-21 s2-0) ) (set! (-> a0-17 state meet data 0 quad) (-> v1-21 quad)) ) - (let ((a0-20 (-> obj lightning s0-0)) + (let ((a0-20 (-> this lightning s0-0)) (v1-25 s4-0) ) (set! (-> a0-20 state meet data (+ (the-as int (-> a0-20 state points-to-draw)) -1) quad) (-> v1-25 quad)) @@ -229,9 +229,9 @@ ;; definition for method 26 of type juicer-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles juicer-shot ((obj juicer-shot)) +(defmethod spawn-shell-particles juicer-shot ((this juicer-shot)) "TODO - confirm" - (spawn-impact-particles obj) + (spawn-impact-particles this) (let ((s5-0 (get-process *default-dead-pool* part-tracker #x4000))) (when s5-0 (let ((t9-2 (method-of-type part-tracker activate))) @@ -252,7 +252,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-3) a0-4 a1-2 @@ -272,20 +272,20 @@ ) ;; definition for method 38 of type juicer-shot -(defmethod made-impact? juicer-shot ((obj juicer-shot)) +(defmethod made-impact? juicer-shot ((this juicer-shot)) "TODO - queries the collision cache, return true/false" - (let ((gp-0 (-> obj root)) + (let ((gp-0 (-> this root)) (s5-0 (new 'stack-no-clear 'collide-query)) ) (let ((v1-0 s5-0)) (set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w)) (set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) - (set! (-> v1-0 ignore-process0) obj) - (set! (-> v1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> v1-0 ignore-process0) this) + (set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> v1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-0 action-mask) (collide-action solid)) ) - (let ((a0-2 (handle->process (-> obj notify-handle)))) + (let ((a0-2 (handle->process (-> this notify-handle)))) (when a0-2 (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans (the-as process-focusable a0-2) 3))) (f0-2 (- (vector-length s4-1))) @@ -321,9 +321,9 @@ ;; definition for method 30 of type juicer-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! juicer-shot ((obj juicer-shot)) +(defmethod init-proj-collision! juicer-shot ((this juicer-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -358,9 +358,9 @@ (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) @@ -368,54 +368,54 @@ ;; definition for method 7 of type juicer-shot ;; WARN: Return type mismatch projectile vs juicer-shot. -(defmethod relocate juicer-shot ((obj juicer-shot) (arg0 int)) +(defmethod relocate juicer-shot ((this juicer-shot) (arg0 int)) (dotimes (v1-0 5) - (if (nonzero? (-> obj lightning v1-0)) - (&+! (-> obj lightning v1-0) arg0) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) arg0) ) ) - (the-as juicer-shot ((method-of-type projectile relocate) obj arg0)) + (the-as juicer-shot ((method-of-type projectile relocate) this arg0)) ) ;; definition for method 31 of type juicer-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! juicer-shot ((obj juicer-shot)) +(defmethod init-proj-settings! juicer-shot ((this juicer-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (logior! (-> obj options) (projectile-options proj-options-8000)) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj move) juicer-proj-move) - (set! (-> obj root dynam gravity y) 0.0) - (set! (-> obj root dynam gravity-length) 0.0) - (set! (-> obj root dynam gravity-max) 0.0) - (set! (-> obj attack-mode) 'shock-red) + (logior! (-> this options) (projectile-options proj-options-8000)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this move) juicer-proj-move) + (set! (-> this root dynam gravity y) 0.0) + (set! (-> this root dynam gravity-length) 0.0) + (set! (-> this root dynam gravity-max) 0.0) + (set! (-> this attack-mode) 'shock-red) (dotimes (s5-0 5) - (set! (-> obj lightning s5-0) (new - 'process - 'lightning-control - (new 'static 'lightning-spec - :name #f - :flags (lightning-spec-flags lsf0) - :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) - :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) - :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) - :fade-start-factor 0.2 - :fade-time 120.0 - :texture (new 'static 'texture-id :index #x86 :page #xc) - :reduction 0.42 - :num-points 8 - :box-size 8192.0 - :merge-factor 0.5 - :merge-count 2 - :radius 1433.6 - :duration -1.0 - :sound #f - ) - obj - 0.0 - ) + (set! (-> this lightning s5-0) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x86 :page #xc) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1433.6 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) ) ) - (set! (-> obj victim) (the-as handle #f)) + (set! (-> this victim) (the-as handle #f)) 0 (none) ) @@ -438,15 +438,15 @@ ) ;; definition for method 3 of type juicer-anim-info -(defmethod inspect juicer-anim-info ((obj juicer-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect juicer-anim-info ((this juicer-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'juicer-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "[~8x] ~A~%" this 'juicer-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) (label cfg-4) - obj + this ) ;; definition of type juicer-global-info @@ -468,24 +468,24 @@ ) ;; definition for method 3 of type juicer-global-info -(defmethod inspect juicer-global-info ((obj juicer-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect juicer-global-info ((this juicer-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-yellow-hit: ~D~%" (-> obj prev-yellow-hit)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tidle-anim[3] @ #x~X~%" (-> obj idle-anim)) - (format #t "~1Tpatrol-anim[2] @ #x~X~%" (-> obj patrol-anim)) - (format #t "~1Tnotice-anim[2] @ #x~X~%" (-> obj notice-anim)) - (format #t "~1Tcharge-anim[2] @ #x~X~%" (-> obj charge-anim)) - (format #t "~1Tknocked-anim[2] @ #x~X~%" (-> obj knocked-anim)) - (format #t "~1Tcelebrate-anim[2] @ #x~X~%" (-> obj celebrate-anim)) - (format #t "~1Tyellow-hit-anim[4] @ #x~X~%" (-> obj yellow-hit-anim)) - (format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> obj blue-hit-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tidle-anim[3] @ #x~X~%" (-> this idle-anim)) + (format #t "~1Tpatrol-anim[2] @ #x~X~%" (-> this patrol-anim)) + (format #t "~1Tnotice-anim[2] @ #x~X~%" (-> this notice-anim)) + (format #t "~1Tcharge-anim[2] @ #x~X~%" (-> this charge-anim)) + (format #t "~1Tknocked-anim[2] @ #x~X~%" (-> this knocked-anim)) + (format #t "~1Tcelebrate-anim[2] @ #x~X~%" (-> this celebrate-anim)) + (format #t "~1Tyellow-hit-anim[4] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> this blue-hit-anim)) (label cfg-4) - obj + this ) ;; definition of type juicer @@ -524,34 +524,34 @@ ) ;; definition for method 3 of type juicer -(defmethod inspect juicer ((obj juicer)) - (when (not obj) - (set! obj obj) +(defmethod inspect juicer ((this juicer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlos: #~%" (-> obj los)) - (format #t "~2Tintro-path: ~A~%" (-> obj intro-path)) - (format #t "~2Tjoint: ~A~%" (-> obj joint)) - (format #t "~2Tjoint-enable: ~A~%" (-> obj joint-enable)) - (format #t "~2Tjoint-blend: ~f~%" (-> obj joint-blend)) - (format #t "~2Tlast-fire-time: ~D~%" (-> obj last-fire-time)) - (format #t "~2Theading: ~A~%" (-> obj heading)) - (format #t "~2Tmove-angle: ~f~%" (-> obj move-angle)) - (format #t "~2Ttorso-track-player: ~A~%" (-> obj torso-track-player)) - (format #t "~2Tcircle-radial-dist: ~f~%" (-> obj desired-angle)) - (format #t "~2Tcircle-backward?: ~A~%" (-> obj circle-backward?)) - (format #t "~2Tusing-turn-anim: ~A~%" (-> obj using-turn-anim)) - (format #t "~2Thit-focus: ~A~%" (-> obj hit-focus)) - (format #t "~2Tambush-path-pt: ~D~%" (-> obj ambush-path-pt)) - (format #t "~2Tcharge-index: ~D~%" (-> obj charge-index)) - (format #t "~2Thostile-dest: #~%" (-> obj hostile-dest)) - (format #t "~2Tfocus-is-up: ~A~%" (-> obj focus-is-up)) - (format #t "~2Tcurrent-projectile: ~D~%" (-> obj current-projectile)) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Tintro-path: ~A~%" (-> this intro-path)) + (format #t "~2Tjoint: ~A~%" (-> this joint)) + (format #t "~2Tjoint-enable: ~A~%" (-> this joint-enable)) + (format #t "~2Tjoint-blend: ~f~%" (-> this joint-blend)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Theading: ~A~%" (-> this heading)) + (format #t "~2Tmove-angle: ~f~%" (-> this move-angle)) + (format #t "~2Ttorso-track-player: ~A~%" (-> this torso-track-player)) + (format #t "~2Tcircle-radial-dist: ~f~%" (-> this desired-angle)) + (format #t "~2Tcircle-backward?: ~A~%" (-> this circle-backward?)) + (format #t "~2Tusing-turn-anim: ~A~%" (-> this using-turn-anim)) + (format #t "~2Thit-focus: ~A~%" (-> this hit-focus)) + (format #t "~2Tambush-path-pt: ~D~%" (-> this ambush-path-pt)) + (format #t "~2Tcharge-index: ~D~%" (-> this charge-index)) + (format #t "~2Thostile-dest: #~%" (-> this hostile-dest)) + (format #t "~2Tfocus-is-up: ~A~%" (-> this focus-is-up)) + (format #t "~2Tcurrent-projectile: ~D~%" (-> this current-projectile)) (label cfg-4) - obj + this ) ;; definition for symbol *juicer-global-info*, type juicer-global-info @@ -751,20 +751,20 @@ ;; definition for method 182 of type juicer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod juicer-method-182 juicer ((obj juicer)) - (let ((s3-0 (handle->process (-> obj focus handle)))) +(defmethod juicer-method-182 juicer ((this juicer)) + (let ((s3-0 (handle->process (-> this focus handle)))) (when s3-0 - (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 4))) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) (let ((s3-1 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 4 bone transform vector 2) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 4 bone transform vector 2) 1.0) ) ) (vector-! s5-0 s5-0 s4-0) (vector-normalize! s5-0 1.0) - (quaternion-from-two-vectors-partial! (-> obj joint quat) s3-1 s5-0 (-> obj joint-blend)) + (quaternion-from-two-vectors-partial! (-> this joint quat) s3-1 s5-0 (-> this joint-blend)) ) ) ) @@ -775,18 +775,18 @@ ;; definition for method 183 of type juicer ;; WARN: Return type mismatch int vs none. -(defmethod juicer-method-183 juicer ((obj juicer)) +(defmethod juicer-method-183 juicer ((this juicer)) (cond - ((-> obj torso-track-player) - (set! (-> obj joint-enable) #t) - (seek! (-> obj joint-blend) 1.0 (* 2.0 (seconds-per-frame))) - (juicer-method-182 obj) + ((-> this torso-track-player) + (set! (-> this joint-enable) #t) + (seek! (-> this joint-blend) 1.0 (* 2.0 (seconds-per-frame))) + (juicer-method-182 this) ) - ((-> obj joint-enable) - (seek! (-> obj joint-blend) 0.0 (* 4.0 (seconds-per-frame))) - (juicer-method-182 obj) - (if (= (-> obj joint-blend) 0.0) - (set! (-> obj joint-enable) #f) + ((-> this joint-enable) + (seek! (-> this joint-blend) 0.0 (* 4.0 (seconds-per-frame))) + (juicer-method-182 this) + (if (= (-> this joint-blend) 0.0) + (set! (-> this joint-enable) #f) ) ) ) @@ -795,66 +795,66 @@ ) ;; definition for method 55 of type juicer -(defmethod track-target! juicer ((obj juicer)) +(defmethod track-target! juicer ((this juicer)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) - (juicer-method-183 obj) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (juicer-method-183 this) (none) ) ;; definition for method 180 of type juicer ;; WARN: Return type mismatch object vs none. -(defmethod juicer-method-180 juicer ((obj juicer)) - (if (and (= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) - (or (= v1-6 'knocked) (= v1-6 'jump) (= v1-6 'jump-land)) - ) +(defmethod juicer-method-180 juicer ((this juicer)) + (if (and (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (not (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'knocked) (= v1-6 'jump) (= v1-6 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) - (go (method-of-object obj knocked)) + (kill-prefer-falling this) + (go (method-of-object this knocked)) ) (none) ) ;; definition for method 74 of type juicer -(defmethod general-event-handler juicer ((obj juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler juicer ((this juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit-flinch) (cond - ((zero? (-> obj hit-points)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + ((zero? (-> this hit-points)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (juicer-method-180 obj) + (juicer-method-180 this) ) (else - (let ((v1-31 (ja-channel-float! (the-as art-joint-anim (-> obj draw art-group data 11)) 0.0 0.0 0.0))) + (let ((v1-31 (ja-channel-float! (the-as art-joint-anim (-> this draw art-group data 11)) 0.0 0.0 0.0))) (when v1-31 (set! (-> v1-31 param 0) 1.0) (set! (-> v1-31 param 1) 0.75) @@ -867,59 +867,59 @@ #t ) (('hit) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (if (zero? (-> obj hit-points)) - (juicer-method-180 obj) - (go (method-of-object obj hit)) + (if (zero? (-> this hit-points)) + (juicer-method-180 this) + (go (method-of-object this hit)) ) #t ) (('instant-death) - (when (> (-> obj hit-points) 0) - (set! (-> obj hit-points) 0) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) - (let ((s4-0 (enemy-method-50 obj (new 'stack-no-clear 'vector)))) - (vector-z-quaternion! s4-0 (-> obj root quat)) + (when (> (-> this hit-points) 0) + (set! (-> this hit-points) 0) + (set! (-> this root penetrated-by) (get-penetrate-info this)) + (let ((s4-0 (enemy-method-50 this (new 'stack-no-clear 'vector)))) + (vector-z-quaternion! s4-0 (-> this root quat)) (vector-float*! s4-0 s4-0 -1.0) (vector-normalize! s4-0 1.0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (juicer-method-180 obj) + (juicer-method-180 this) ) #t ) (('notify) - (if (and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) (handle->process (-> obj focus handle)))) - (set! (-> obj hit-focus) (the-as enemy-focus #t)) + (if (and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) (handle->process (-> this focus handle)))) + (set! (-> this hit-focus) (the-as enemy-focus #t)) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -997,16 +997,16 @@ ) ;; definition for method 84 of type juicer -(defmethod enemy-method-84 juicer ((obj juicer) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 juicer ((this juicer) (arg0 enemy-jump-info)) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user8)) + ((logtest? (-> this fact enemy-options) (enemy-option user8)) (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)) (let ((f0-1 8192.0)) (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f0-1 -4.551111) ) ) (else - ((method-of-type nav-enemy enemy-method-84) obj arg0) + ((method-of-type nav-enemy enemy-method-84) this arg0) ) ) (none) @@ -1014,13 +1014,13 @@ ;; definition for method 93 of type juicer ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 juicer ((obj juicer)) - (case (-> obj jump-why) +(defmethod enemy-method-93 juicer ((this juicer)) + (case (-> this jump-why) ((2) - (go (method-of-object obj ambush-cont)) + (go (method-of-object this ambush-cont)) ) (else - ((method-of-type nav-enemy enemy-method-93) obj) + ((method-of-type nav-enemy enemy-method-93) this) ) ) (none) @@ -1252,11 +1252,9 @@ (when (and (or (logtest? (-> self nav state flags) (nav-state-flag blocked)) (logtest? (-> self nav state flags) (nav-state-flag at-target)) ) - (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) - ) - (if (and (>= (- (current-time) (-> self last-fire-time)) (rand-vu-int-range (seconds 1) (seconds 2))) - (< 20480.0 f30-0) + (time-elapsed? (-> self state-time) (-> self reaction-time)) ) + (if (and (time-elapsed? (-> self last-fire-time) (rand-vu-int-range (seconds 1) (seconds 2))) (< 20480.0 f30-0)) (go-virtual attack) (go-virtual circling) ) @@ -1265,9 +1263,7 @@ ) (if (and (check-los? (-> self los) 0) (or (>= 11468.8 f30-0) - (and (>= (- (current-time) (-> self last-fire-time)) (rand-vu-int-range (seconds 5) (seconds 8))) - (>= 53248.0 f30-0) - ) + (and (time-elapsed? (-> self last-fire-time) (rand-vu-int-range (seconds 5) (seconds 8))) (>= 53248.0 f30-0)) ) ) (go-virtual attack) @@ -1321,29 +1317,29 @@ ;; definition for method 181 of type juicer ;; WARN: Return type mismatch object vs none. -(defmethod fire-projectile juicer ((obj juicer) (arg0 process-focusable) (arg1 uint)) +(defmethod fire-projectile juicer ((this juicer) (arg0 process-focusable) (arg1 uint)) (with-pp - (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 20))) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 20))) (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (when (not (handle->process (-> obj current-projectile))) - (set! (-> s5-0 ent) (-> obj entity)) + (when (not (handle->process (-> this current-projectile))) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options)) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (set! (-> s5-0 attack-id) arg1) (set! (-> s5-0 timeout) (seconds 4)) ) (vector-normalize! (vector-! (-> s5-0 pos) (get-trans arg0 3) s4-0) 1.0) (vector-float*! (-> s5-0 vel) (-> s5-0 pos) (* 24576.0 (-> pp clock frames-per-second))) (vector+float*! (-> s5-0 pos) s4-0 (-> s5-0 pos) -1024.0) - (let ((a0-20 (handle->process (-> obj current-projectile)))) + (let ((a0-20 (handle->process (-> this current-projectile)))) (if a0-20 (send-event a0-20 'reset s5-0) - (set! (-> obj current-projectile) - (ppointer->handle (spawn-projectile juicer-shot s5-0 obj *default-dead-pool*)) + (set! (-> this current-projectile) + (ppointer->handle (spawn-projectile juicer-shot s5-0 this *default-dead-pool*)) ) ) ) @@ -1380,7 +1376,7 @@ (set! (-> self torso-track-player) #f) (logclear! (-> self enemy-flags) (enemy-flag actor-pause-backup)) (juicer-method-184 self #f) - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) (logior! (-> self focus-status) (focus-status dangerous)) (logclear! (-> self focus-status) (focus-status dangerous)) @@ -1408,7 +1404,7 @@ ) (set! (-> v1-29 attack-id) s5-0) (let ((s4-0 (current-time))) - (until (>= (- (current-time) s4-0) (seconds 0.25)) + (until (time-elapsed? s4-0 (seconds 0.25)) (ja-no-eval :group! juicer-attack0-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (let ((s3-0 (handle->process (-> self focus handle)))) @@ -1623,7 +1619,7 @@ :num! (loop! f28-0) :frame-num 0.0 ) - (until (>= (- (current-time) s5-0) gp-0) + (until (time-elapsed? s5-0 gp-0) (suspend) (ja :num! (loop! f28-0)) ) @@ -1643,17 +1639,17 @@ ) ;; definition for method 77 of type juicer -(defmethod enemy-method-77 juicer ((obj juicer) (arg0 (pointer float))) +(defmethod enemy-method-77 juicer ((this juicer) (arg0 (pointer float))) (local-vars (a2-2 int)) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 0) (let* ((a2-0 (ash 1 (-> *juicer-global-info* prev-yellow-hit))) - (v1-3 (enemy-method-120 obj 4 a2-0)) - (a1-6 (-> obj draw art-group data (-> *juicer-global-info* yellow-hit-anim v1-3))) + (v1-3 (enemy-method-120 this 4 a2-0)) + (a1-6 (-> this draw art-group data (-> *juicer-global-info* yellow-hit-anim v1-3))) ) (set! (-> *juicer-global-info* prev-yellow-hit) v1-3) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) (set! (-> a0-13 param 1) (-> arg0 0)) @@ -1664,26 +1660,26 @@ ) (((knocked-type knocked-type-6)) (let ((v1-11 (ash 1 (-> *juicer-global-info* prev-blue-hit)))) - (if (zero? (-> obj charge-index)) + (if (zero? (-> this charge-index)) (set! a2-2 (logior v1-11 56)) (set! a2-2 (logior v1-11 7)) ) ) - (let* ((v1-15 (enemy-method-120 obj 6 a2-2)) - (s5-1 (-> obj draw art-group data (-> *juicer-global-info* blue-hit-anim v1-15))) + (let* ((v1-15 (enemy-method-120 this 6 a2-2)) + (s5-1 (-> this draw art-group data (-> *juicer-global-info* blue-hit-anim v1-15))) ) (set! (-> *juicer-global-info* prev-blue-hit) v1-15) - (let ((v1-18 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-18 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-18 (= v1-18 (-> obj draw art-group data 32))) + (if (and v1-18 (= v1-18 (-> this draw art-group data 32))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-32 (-> obj skel root-channel 0))) + (let ((a0-32 (-> this skel root-channel 0))) (set! (-> a0-32 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-32 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-32 param 1) 1.0) @@ -1693,9 +1689,9 @@ ) ) (else - (let ((s4-1 (-> obj draw art-group data (-> *juicer-global-info* knocked-anim (get-rand-int obj 2))))) + (let ((s4-1 (-> this draw art-group data (-> *juicer-global-info* knocked-anim (get-rand-int this 2))))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-37 (-> obj skel root-channel 0))) + (let ((a0-37 (-> this skel root-channel 0))) (set! (-> a0-37 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-37 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-37 param 1) (-> arg0 0)) @@ -1709,13 +1705,13 @@ ) ;; definition for method 78 of type juicer -(defmethod enemy-method-78 juicer ((obj juicer) (arg0 (pointer float))) +(defmethod enemy-method-78 juicer ((this juicer) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((s4-0 (-> obj draw art-group data 32))) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 32))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-3 param 1) (-> arg0 0)) @@ -1726,19 +1722,19 @@ #t ) ) - ((!= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (let* ((v1-14 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((!= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (let* ((v1-14 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) - (s4-1 (if (and v1-14 (= v1-14 (-> obj draw art-group data 18))) - (-> obj draw art-group data 19) - (-> obj draw art-group data 17) + (s4-1 (if (and v1-14 (= v1-14 (-> this draw art-group data 18))) + (-> this draw art-group data 19) + (-> this draw art-group data 17) ) ) ) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-10 param 1) (-> arg0 0)) @@ -1753,8 +1749,8 @@ ;; definition for method 184 of type juicer ;; WARN: Return type mismatch symbol vs none. -(defmethod juicer-method-184 juicer ((obj juicer) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod juicer-method-184 juicer ((this juicer) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) (if arg0 @@ -1769,10 +1765,10 @@ ;; definition for method 63 of type juicer ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 juicer ((obj juicer) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 juicer ((this juicer) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 obj arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 this arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) @@ -1780,9 +1776,9 @@ ;; definition for method 114 of type juicer ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! juicer ((obj juicer)) +(defmethod init-enemy-collision! juicer ((this juicer)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1866,7 +1862,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1874,78 +1870,78 @@ ;; definition for method 7 of type juicer ;; WARN: Return type mismatch process-focusable vs juicer. -(defmethod relocate juicer ((obj juicer) (arg0 int)) - (if (nonzero? (-> obj intro-path)) - (&+! (-> obj intro-path) arg0) +(defmethod relocate juicer ((this juicer) (arg0 int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) arg0) ) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) arg0) ) (the-as juicer - ((the-as (function process-focusable int process-focusable) (find-parent-method juicer 7)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method juicer 7)) this arg0) ) ) ;; definition for method 115 of type juicer ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! juicer ((obj juicer)) +(defmethod init-enemy! juicer ((this juicer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-juicer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *juicer-nav-enemy-info*) - (let ((v1-5 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *juicer-nav-enemy-info*) + (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) (set! (-> v1-5 ear) (the-as uint 0)) (set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0) (set! (-> v1-5 ignore-angle) 30947.555) ) - (let ((v1-7 (-> obj nav))) + (let ((v1-7 (-> this nav))) (set! (-> v1-7 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (set! (-> obj last-fire-time) 0) - (set! (-> obj heading) (the-as basic (if (rand-vu-percent? 0.5) - #t - #f - ) - ) + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this last-fire-time) 0) + (set! (-> this heading) (the-as basic (if (rand-vu-percent? 0.5) + #t + #f + ) + ) ) - (set! (-> obj move-angle) 5461.3335) - (set! (-> obj torso-track-player) #f) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd obstacle)) - (set! (-> obj joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) obj 5)) - (set! (-> obj using-turn-anim) #f) - (let ((v1-18 (new 'process 'path-control obj 'intro 0.0 (the-as entity #f) #t))) - (set! (-> obj intro-path) v1-18) + (set! (-> this move-angle) 5461.3335) + (set! (-> this torso-track-player) #f) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle)) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 5)) + (set! (-> this using-turn-anim) #f) + (let ((v1-18 (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t))) + (set! (-> this intro-path) v1-18) (if (nonzero? v1-18) (logior! (-> v1-18 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) (add-connection *part-engine* - obj + this 34 - obj + this 318 (new 'static 'vector :x 901.12 :y -1146.88 :z 1269.76 :w 163840.0) ) (add-connection *part-engine* - obj + this 34 - obj + this 318 (new 'static 'vector :x -901.12 :y -1146.88 :z 1269.76 :w 163840.0) ) - (add-connection *part-engine* obj 20 obj 4635 (new 'static 'vector :w 163840.0)) - (set! (-> obj root pause-adjust-distance) 81920.0) - (set! (-> obj current-projectile) (the-as handle #f)) + (add-connection *part-engine* this 20 this 4635 (new 'static 'vector :w 163840.0)) + (set! (-> this root pause-adjust-distance) 81920.0) + (set! (-> this current-projectile) (the-as handle #f)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc index 20602e00c7..17a7606e39 100644 --- a/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/sig0-course_REF.gc @@ -15,16 +15,16 @@ ) ;; definition for method 3 of type sig-atoll -(defmethod inspect sig-atoll ((obj sig-atoll)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig-atoll ((this sig-atoll)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type sig inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type sig0-course @@ -39,44 +39,44 @@ ) ;; definition for method 3 of type sig0-course -(defmethod inspect sig0-course ((obj sig0-course)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig0-course ((this sig0-course)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcourse-id: ~D~%" (-> obj course-id)) - (format #t "~1Tspeech-count: ~D~%" (-> obj speech-count)) - (format #t "~1Tspot-count: ~D~%" (-> obj spot-count)) - (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) - (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> obj too-far-warn-speeches)) - (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> obj too-far-fail-speeches)) - (format #t "~1Tattack-player-speeches: ~A~%" (-> obj attack-player-speeches)) - (format #t "~1Tdefault-check-too-far: ~A~%" (-> obj default-check-too-far)) - (format #t "~1Twaypoints: ~A~%" (-> obj waypoints)) - (format #t "~1Tspeeches: #x~X~%" (-> obj speeches)) - (format #t "~1Tspeech-tunings: #x~X~%" (-> obj speech-tunings)) - (format #t "~1Tdirs: #x~X~%" (-> obj dirs)) - (format #t "~1Tspots: #x~X~%" (-> obj spots)) - (format #t "~1Tliftcat-speech-index: ~D~%" (-> obj liftcat-speech-index)) - (format #t "~1Tfirst-liftcat-speeches: ~A~%" (-> obj first-liftcat-speeches)) - (format #t "~1Tsecond-liftcat-speeches: ~A~%" (-> obj second-liftcat-speeches)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse-id: ~D~%" (-> this course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> this speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> this spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> this too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> this too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> this attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> this default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> this waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> this speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> this speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> this dirs)) + (format #t "~1Tspots: #x~X~%" (-> this spots)) + (format #t "~1Tliftcat-speech-index: ~D~%" (-> this liftcat-speech-index)) + (format #t "~1Tfirst-liftcat-speeches: ~A~%" (-> this first-liftcat-speeches)) + (format #t "~1Tsecond-liftcat-speeches: ~A~%" (-> this second-liftcat-speeches)) (label cfg-4) - obj + this ) ;; definition for method 183 of type sig-atoll ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? sig-atoll ((obj sig-atoll)) +(defmethod alive? sig-atoll ((this sig-atoll)) (let ((t9-0 (method-of-type bot alive?))) - (the-as symbol (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'waiting-far) - (= v1-3 'waiting-close) - (= v1-3 'waiting-turn) - (= v1-3 'waiting-crouched) - (= v1-3 'charge-plasma) - ) - ) + (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'waiting-far) + (= v1-3 'waiting-close) + (= v1-3 'waiting-turn) + (= v1-3 'waiting-crouched) + (= v1-3 'charge-plasma) + ) + ) ) ) ) @@ -84,14 +84,14 @@ ;; definition for method 116 of type sig-atoll ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig-atoll ((obj sig-atoll)) +(defmethod go-idle sig-atoll ((this sig-atoll)) (cond ((task-node-closed? (game-task-node atoll-sig-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj waiting-crouched)) + (go (method-of-object this waiting-crouched)) ) ) (none) @@ -99,11 +99,11 @@ ;; definition for method 259 of type sig-atoll ;; WARN: Return type mismatch object vs symbol. -(defmethod sig-atoll-method-259 sig-atoll ((obj sig-atoll)) +(defmethod sig-atoll-method-259 sig-atoll ((this sig-atoll)) (let ((v1-0 *target*)) (the-as symbol (and v1-0 (not (focus-test? v1-0 edge-grab)) - (>= (- (-> v1-0 control trans y) (-> obj sig-course spots 11 center y)) -819.2) + (>= (- (-> v1-0 control trans y) (-> this sig-course spots 11 center y)) -819.2) ) ) ) @@ -927,14 +927,14 @@ ) ) (when (and (demo?) - (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 1)) + (time-elapsed? (-> arg0 waypoint-time0) (seconds 1)) (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) ) (logclear! (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) (talker-spawn-func (-> *talker-speech* 80) *entity-pool* (target-pos 0) (the-as region #f)) ) (when (or (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-3))) - (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8)) + (time-elapsed? (-> arg0 waypoint-time0) (seconds 8)) ) (if (and (demo?) (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-3)))) (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-4)) @@ -951,7 +951,7 @@ (set! (-> s5-4 liftcat-speech-index) v1-62) ) ) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) ) ) ) @@ -1003,7 +1003,7 @@ (process-grab? arg1 #t) (process-grab? *target* #t) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (process-grab? arg1 #f) (process-grab? *target* #f) @@ -1020,7 +1020,7 @@ ) ) ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 4.5)) (process-release? arg1) (process-release? *target*) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -1030,7 +1030,7 @@ ) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (set-setting! 'sound-mode #f 0.0 1) @@ -1257,11 +1257,11 @@ :on-update (lambda ((arg0 sig-atoll)) (with-pp (b! (not (channel-active? arg0 (the-as uint 0))) cfg-2 :delay (empty-form)) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) (b! #t cfg-21 :delay (nop!)) (label cfg-2) (b! - (not (and (not (speech-playing? arg0 12)) (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.75)))) + (not (and (not (speech-playing? arg0 12)) (time-elapsed? (-> arg0 waypoint-time0) (seconds 0.75)))) cfg-7 :delay (empty-form) ) @@ -1269,7 +1269,7 @@ (b! #t cfg-21 :delay (nop!)) (label cfg-7) (if (and (not (speech-playing? arg0 13)) - (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.5)) + (time-elapsed? (-> arg0 waypoint-time0) (seconds 0.5)) (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) (process->ppointer pp)) @@ -1431,7 +1431,7 @@ (process-grab? arg1 #t) (process-grab? *target* #t) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (process-grab? arg1 #f) (process-grab? *target* #f) (play-speech arg1 15) @@ -1447,7 +1447,7 @@ ) ) ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 4.5)) (process-release? arg1) (process-release? *target*) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -1457,7 +1457,7 @@ ) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) @@ -1657,7 +1657,7 @@ (none) ) :on-update (lambda ((arg0 sig-atoll)) - (if (and (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 1.5)) + (if (and (time-elapsed? (-> arg0 waypoint-time0) (seconds 1.5)) (not (speech-playing? arg0 18)) (not (channel-active? arg0 (the-as uint 0))) ) @@ -1714,7 +1714,7 @@ ) ) (when (or (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 8)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 8)) ) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let* ((s5-1 (-> arg1 sig-course)) @@ -1728,7 +1728,7 @@ (set! (-> s5-1 liftcat-speech-index) v1-35) ) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) ) ) @@ -1833,7 +1833,7 @@ (process-grab? arg1 #t) (process-grab? *target* #t) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (process-grab? arg1 #f) (process-grab? *target* #f) (reset-warn-time! arg1) @@ -1849,7 +1849,7 @@ ) ) ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 4.5)) (process-release? arg1) (process-release? *target*) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -1859,7 +1859,7 @@ ) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (set-setting! 'sound-mode #f 0.0 1) @@ -2180,7 +2180,7 @@ (process-grab? arg1 #t) (process-grab? *target* #t) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (process-grab? arg1 #f) (process-grab? *target* #f) (reset-warn-time! arg1) @@ -2197,12 +2197,12 @@ ) ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) ) (remove-setting! 'string-startup-vector) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3.5)) (process-release? arg1) (process-release? *target*) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -2212,7 +2212,7 @@ ) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) @@ -2419,7 +2419,7 @@ (with-pp (cond ((not (logtest? (-> arg0 bot-task-bits) (bot-task-bits botbits-2))) - (when (and (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.25)) + (when (and (time-elapsed? (-> arg0 waypoint-time0) (seconds 0.25)) (< (-> arg0 sig-course spots 36 center x) (-> (target-pos 0) x)) ) (logior! (-> arg0 bot-task-bits) (bot-task-bits botbits-2)) @@ -2509,7 +2509,7 @@ :on-update (lambda ((arg0 sig-atoll)) (sig0-say-look-out-if-should arg0) (when (and (not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-0))) - (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 8)) + (time-elapsed? (-> arg0 waypoint-time0) (seconds 8)) ) (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (logior! (-> arg0 focus-status) (focus-status disable)) @@ -2610,7 +2610,7 @@ (with-pp (cond ((not (speech-playing? arg0 27)) - (if (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 0.5)) + (if (time-elapsed? (-> arg0 waypoint-time0) (seconds 0.5)) (play-speech arg0 27) ) ) @@ -2619,7 +2619,7 @@ (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-0)) (logclear! (-> arg0 focus-status) (focus-status disable)) (set! (-> arg0 notice-enemy-dist) 122880.0) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) ) ) ((not (logtest? (-> arg0 waypoint-bits) (waypoint-bits wabits-1))) @@ -2643,13 +2643,13 @@ ) 5 ) - (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 10)) + (time-elapsed? (-> arg0 waypoint-time0) (seconds 10)) ) (logior! (-> arg0 bot-flags) (bot-flags bf21)) (logior! (-> arg0 waypoint-bits) (waypoint-bits wabits-1)) ) (else - (if (and (>= (- (current-time) (-> arg0 waypoint-time0)) (seconds 4)) (not (speech-playing? arg0 28))) + (if (and (time-elapsed? (-> arg0 waypoint-time0) (seconds 4)) (not (speech-playing? arg0 28))) (play-speech arg0 28) ) ) @@ -2804,7 +2804,7 @@ (process-grab? arg1 #t) (process-grab? *target* #t) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (process-grab? arg1 #f) (process-grab? *target* #f) (reset-warn-time! arg1) @@ -2821,12 +2821,12 @@ ) ((begin (reset-warn-time! arg1) (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) ) (remove-setting! 'string-startup-vector) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 4.5)) (process-release? arg1) (process-release? *target*) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -2836,7 +2836,7 @@ ) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x -1.0) 0) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) diff --git a/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc b/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc index ef351a5a49..b94230ed54 100644 --- a/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc +++ b/test/decompiler/reference/jak2/levels/atoll/sniper_REF.gc @@ -12,17 +12,17 @@ ) ;; definition for method 3 of type sniper -(defmethod inspect sniper ((obj sniper)) - (when (not obj) - (set! obj obj) +(defmethod inspect sniper ((this sniper)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type spyder inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnext-pick-time: ~D~%" (-> obj next-pick-time)) + (format #t "~2Tnext-pick-time: ~D~%" (-> this next-pick-time)) (label cfg-4) - obj + this ) ;; definition for symbol *sniper-nav-enemy-info*, type nav-enemy-info @@ -203,23 +203,23 @@ (set! (-> *sniper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 12 of type sniper -(defmethod run-logic? sniper ((obj sniper)) +(defmethod run-logic? sniper ((this sniper)) (let ((f0-0 573440.0)) - (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) + (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> this root trans) (camera-pos))) ) ) ;; definition for method 129 of type sniper ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-129 sniper ((obj sniper)) +(defmethod enemy-method-129 sniper ((this sniper)) (let ((a0-1 *target*)) (if a0-1 - (set! (-> obj focus handle) (process->handle a0-1)) - (set! (-> obj focus handle) (the-as handle #f)) + (set! (-> this focus handle) (process->handle a0-1)) + (set! (-> this focus handle) (the-as handle #f)) ) ) - (set! (-> obj focus aware) - (if (>= (vector-vector-distance (-> obj root trans) (camera-pos)) (-> obj fact idle-distance)) + (set! (-> this focus aware) + (if (>= (vector-vector-distance (-> this root trans) (camera-pos)) (-> this fact idle-distance)) (enemy-aware enemy-aware-0) (enemy-aware enemy-aware-1) ) @@ -230,23 +230,23 @@ ;; definition for method 156 of type sniper ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-156 sniper ((obj sniper)) - (let ((s4-0 (-> obj path curve num-cverts))) +(defmethod nav-enemy-method-156 sniper ((this sniper)) + (let ((s4-0 (-> this path curve num-cverts))) (if (<= s4-0 0) (go process-drawable-art-error "no path") ) - (let ((s2-0 (get-rand-int obj s4-0)) + (let ((s2-0 (get-rand-int this s4-0)) (gp-0 (new 'stack-no-clear 'vector)) ) (countdown (s3-0 s4-0) - (get-point-in-path! (-> obj path) gp-0 (the float s2-0) 'interp) - (if (< 409.6 (vector-vector-xz-distance gp-0 (-> obj root trans))) + (get-point-in-path! (-> this path) gp-0 (the float s2-0) 'interp) + (if (< 409.6 (vector-vector-xz-distance gp-0 (-> this root trans))) (goto cfg-9) ) (set! s2-0 (mod (+ s2-0 1) s4-0)) ) (label cfg-9) - (let ((v1-16 (-> obj nav state))) + (let ((v1-16 (-> this nav state))) (logclear! (-> v1-16 flags) (nav-state-flag directional-mode)) (logior! (-> v1-16 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-16 target-post quad) (-> gp-0 quad)) @@ -267,7 +267,7 @@ (t9-0) ) ) - (set! (-> self next-pick-time) (current-time)) + (set-time! (-> self next-pick-time)) ) :code (behavior () (ja-channel-push! 1 (seconds 0.2)) @@ -300,32 +300,32 @@ ;; definition for method 115 of type sniper ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! sniper ((obj sniper)) +(defmethod init-enemy! sniper ((this sniper)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type spyder init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set-enemy-info! obj *sniper-nav-enemy-info*) - (logior! (-> obj focus-status) (focus-status ignore)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) + (set-enemy-info! this *sniper-nav-enemy-info*) + (logior! (-> this focus-status) (focus-status ignore)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag check-water)) 0 (none) ) ;; definition for method 114 of type sniper ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! sniper ((obj sniper)) +(defmethod init-enemy-collision! sniper ((this sniper)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" (let ((t9-0 (method-of-type spyder init-enemy-collision!))) - (t9-0 obj) + (t9-0 this) ) - (let ((v1-2 (-> obj root root-prim))) + (let ((v1-2 (-> this root root-prim))) (set! (-> v1-2 prim-core collide-as) (collide-spec)) (set! (-> v1-2 prim-core collide-with) (collide-spec)) ) - (set! (-> obj root backup-collide-as) (collide-spec)) - (set! (-> obj root backup-collide-with) (collide-spec)) + (set! (-> this root backup-collide-as) (collide-spec)) + (set! (-> this root backup-collide-with) (collide-spec)) 0 0 (none) @@ -333,14 +333,14 @@ ;; definition for method 116 of type sniper ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sniper ((obj sniper)) +(defmethod go-idle sniper ((this sniper)) (cond - ((script-eval (res-lump-struct (-> obj entity) 'on-activate pair)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + ((script-eval (res-lump-struct (-> this entity) 'on-activate pair)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/castle/boss/casboss-part_REF.gc b/test/decompiler/reference/jak2/levels/castle/boss/casboss-part_REF.gc index 7cb5874422..75c1b53619 100644 --- a/test/decompiler/reference/jak2/levels/castle/boss/casboss-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/boss/casboss-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type casboss-part -(defmethod inspect casboss-part ((obj casboss-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect casboss-part ((this casboss-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type cascity-part @@ -33,16 +33,16 @@ ) ;; definition for method 3 of type cascity-part -(defmethod inspect cascity-part ((obj cascity-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect cascity-part ((this cascity-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 36f57ce050..1220ae5287 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 @@ -14,16 +14,16 @@ ) ;; definition for method 3 of type cboss-tractor -(defmethod inspect cboss-tractor ((obj cboss-tractor)) - (when (not obj) - (set! obj obj) +(defmethod inspect cboss-tractor ((this cboss-tractor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -50,21 +50,21 @@ ;; definition for method 11 of type cboss-tractor ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cboss-tractor ((obj cboss-tractor) (arg0 entity-actor)) +(defmethod init-from-entity! cboss-tractor ((this cboss-tractor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cboss-tractor" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -85,17 +85,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type cboss-elevator -(defmethod inspect cboss-elevator ((obj cboss-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect cboss-elevator ((this cboss-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -130,42 +130,42 @@ This commonly includes things such as: ) ;; definition for method 30 of type cboss-elevator -(defmethod get-art-group cboss-elevator ((obj cboss-elevator)) +(defmethod get-art-group cboss-elevator ((this cboss-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cboss-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 10 of type cboss-elevator -(defmethod deactivate cboss-elevator ((obj cboss-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method cboss-elevator 10)) obj) +(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) (none) ) ;; definition for method 33 of type cboss-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! cboss-elevator ((obj cboss-elevator)) +(defmethod init-plat! cboss-elevator ((this cboss-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." - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this sound-id) (new-sound-id)) 0 (none) ) ;; definition for method 43 of type cboss-elevator -(defmethod move-between-points cboss-elevator ((obj cboss-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points cboss-elevator ((this cboss-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) ) ) @@ -173,7 +173,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 45 of type cboss-elevator -(defmethod commited-to-ride? cboss-elevator ((obj cboss-elevator)) +(defmethod commited-to-ride? cboss-elevator ((this cboss-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -183,9 +183,9 @@ For example for an elevator pre-compute the distance between the first and last ) (when a0-2 (let* ((v1-1 (get-trans a0-2 0)) - (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> obj root trans))) + (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this root trans))) ) - (vector-inv-orient-by-quat! gp-2 gp-2 (-> obj root quat)) + (vector-inv-orient-by-quat! gp-2 gp-2 (-> this root quat)) (and (< (fabs (-> gp-2 x)) 40960.0) (< (fabs (-> gp-2 z)) 40960.0)) ) ) @@ -194,9 +194,9 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 31 of type cboss-elevator ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! cboss-elevator ((obj cboss-elevator)) +(defmethod init-plat-collision! cboss-elevator ((this cboss-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -224,7 +224,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) @@ -253,25 +253,25 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 3 of type krew-boss-clone -(defmethod inspect krew-boss-clone ((obj krew-boss-clone)) - (when (not obj) - (set! obj obj) +(defmethod inspect krew-boss-clone ((this krew-boss-clone)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Told-y-deg: ~f~%" (-> obj old-y-deg)) - (format #t "~2Tdiff-angle: ~f~%" (-> obj diff-angle)) - (format #t "~2Thit-target: ~A~%" (-> obj hit-target)) - (format #t "~2Tlightning[4] @ #x~X~%" (-> obj lightning)) - (format #t "~2Twiggle-time: ~D~%" (-> obj wiggle-time)) - (format #t "~2Twiggle-angle: ~f~%" (-> obj wiggle-angle)) - (format #t "~2Tdelta-wiggle-angle: ~f~%" (-> obj delta-wiggle-angle)) - (format #t "~2Twiggle-factor: ~f~%" (-> obj wiggle-factor)) - (format #t "~2Tid: ~D~%" (-> obj id)) + (format #t "~2Told-y-deg: ~f~%" (-> this old-y-deg)) + (format #t "~2Tdiff-angle: ~f~%" (-> this diff-angle)) + (format #t "~2Thit-target: ~A~%" (-> this hit-target)) + (format #t "~2Tlightning[4] @ #x~X~%" (-> this lightning)) + (format #t "~2Twiggle-time: ~D~%" (-> this wiggle-time)) + (format #t "~2Twiggle-angle: ~f~%" (-> this wiggle-angle)) + (format #t "~2Tdelta-wiggle-angle: ~f~%" (-> this delta-wiggle-angle)) + (format #t "~2Twiggle-factor: ~f~%" (-> this wiggle-factor)) + (format #t "~2Tid: ~D~%" (-> this id)) (label cfg-4) - obj + this ) ;; definition of type krew-boss @@ -307,35 +307,35 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 3 of type krew-boss -(defmethod inspect krew-boss ((obj krew-boss)) - (when (not obj) - (set! obj obj) +(defmethod inspect krew-boss ((this krew-boss)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttask-timeout: ~D~%" (-> obj task-timeout)) - (format #t "~2Tmovie-handle: ~D~%" (-> obj movie-handle)) - (format #t "~2Tclones[8] @ #x~X~%" (-> obj clones)) - (format #t "~2Tlast-closest-spawn: ~D~%" (-> obj last-closest-spawn)) - (format #t "~2Tnext-clone-side: ~D~%" (-> obj next-clone-side)) - (format #t "~2Tnext-shooting-frame: ~D~%" (-> obj next-shooting-frame)) - (format #t "~2Told-y-deg: ~f~%" (-> obj old-y-deg)) - (format #t "~2Tdiff-angle: ~f~%" (-> obj diff-angle)) - (format #t "~2Thit-target: ~A~%" (-> obj hit-target)) - (format #t "~2Tfloating: ~A~%" (-> obj floating)) - (format #t "~2Tnext-path-point: ~D~%" (-> obj next-path-point)) - (format #t "~2Tnum-clones-to-spawn: ~D~%" (-> obj num-clones-to-spawn)) - (format #t "~2Tgameplay-pass: ~D~%" (-> obj gameplay-pass)) - (format #t "~2Thud-handle: ~D~%" (-> obj hud-handle)) - (format #t "~2Tchannel: ~D~%" (-> obj channel)) - (format #t "~2Tid: ~D~%" (-> obj id)) - (format #t "~2Tplay-clone-wave-speech: ~A~%" (-> obj play-clone-wave-speech)) - (format #t "~2Tlast-damage-time: ~D~%" (-> obj last-damage-time)) - (format #t "~2Tspawn-charge: ~A~%" (-> obj spawn-charge)) + (format #t "~2Ttask-timeout: ~D~%" (-> this task-timeout)) + (format #t "~2Tmovie-handle: ~D~%" (-> this movie-handle)) + (format #t "~2Tclones[8] @ #x~X~%" (-> this clones)) + (format #t "~2Tlast-closest-spawn: ~D~%" (-> this last-closest-spawn)) + (format #t "~2Tnext-clone-side: ~D~%" (-> this next-clone-side)) + (format #t "~2Tnext-shooting-frame: ~D~%" (-> this next-shooting-frame)) + (format #t "~2Told-y-deg: ~f~%" (-> this old-y-deg)) + (format #t "~2Tdiff-angle: ~f~%" (-> this diff-angle)) + (format #t "~2Thit-target: ~A~%" (-> this hit-target)) + (format #t "~2Tfloating: ~A~%" (-> this floating)) + (format #t "~2Tnext-path-point: ~D~%" (-> this next-path-point)) + (format #t "~2Tnum-clones-to-spawn: ~D~%" (-> this num-clones-to-spawn)) + (format #t "~2Tgameplay-pass: ~D~%" (-> this gameplay-pass)) + (format #t "~2Thud-handle: ~D~%" (-> this hud-handle)) + (format #t "~2Tchannel: ~D~%" (-> this channel)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Tplay-clone-wave-speech: ~A~%" (-> this play-clone-wave-speech)) + (format #t "~2Tlast-damage-time: ~D~%" (-> this last-damage-time)) + (format #t "~2Tspawn-charge: ~A~%" (-> this spawn-charge)) (label cfg-4) - obj + this ) ;; definition for function clones-wave-speech @@ -817,53 +817,53 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 55 of type krew-boss-clone ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! krew-boss-clone ((obj krew-boss-clone)) +(defmethod track-target! krew-boss-clone ((this krew-boss-clone)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s5-0 (-> obj node-list data 36)) + (vector<-cspace! s5-0 (-> this node-list data 36)) (dotimes (s3-0 4) (let ((v1-2 s3-0)) (cond ((zero? v1-2) - (vector<-cspace! s5-0 (-> obj node-list data 7)) - (vector<-cspace! s4-0 (-> obj node-list data 15)) + (vector<-cspace! s5-0 (-> this node-list data 7)) + (vector<-cspace! s4-0 (-> this node-list data 15)) ) ((= v1-2 1) - (vector<-cspace! s5-0 (-> obj node-list data 6)) - (vector<-cspace! s4-0 (-> obj node-list data 7)) + (vector<-cspace! s5-0 (-> this node-list data 6)) + (vector<-cspace! s4-0 (-> this node-list data 7)) ) ((= v1-2 2) - (vector<-cspace! s5-0 (-> obj node-list data 19)) - (vector<-cspace! s4-0 (-> obj node-list data 27)) + (vector<-cspace! s5-0 (-> this node-list data 19)) + (vector<-cspace! s4-0 (-> this node-list data 27)) ) (else - (vector<-cspace! s5-0 (-> obj node-list data 18)) - (vector<-cspace! s4-0 (-> obj node-list data 19)) + (vector<-cspace! s5-0 (-> this node-list data 18)) + (vector<-cspace! s4-0 (-> this node-list data 19)) ) ) ) - (let ((a0-13 (-> obj lightning s3-0)) + (let ((a0-13 (-> this lightning s3-0)) (v1-17 s5-0) ) (set! (-> a0-13 state meet data 0 quad) (-> v1-17 quad)) ) - (let ((a0-16 (-> obj lightning s3-0)) + (let ((a0-16 (-> this lightning s3-0)) (v1-21 s4-0) ) (set! (-> a0-16 state meet data (+ (-> a0-16 state points-to-draw) -1) quad) (-> v1-21 quad)) ) - (when (not (and (-> obj next-state) (= (-> obj next-state name) 'die-falling))) - (case (-> obj lightning s3-0 state mode) + (when (not (and (-> this next-state) (= (-> this next-state name) 'die-falling))) + (case (-> this lightning s3-0 state mode) (((lightning-mode lm0) (lightning-mode lm3)) - (let ((v1-35 (-> obj lightning s3-0)) + (let ((v1-35 (-> this lightning s3-0)) (a0-22 1) ) (let ((a1-14 (!= a0-22 (-> v1-35 state mode)))) @@ -886,21 +886,21 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (if (< (-> obj root trans y) 1228800.0) - (deactivate obj) + (if (< (-> this root trans y) 1228800.0) + (deactivate this) ) 0 (none) ) ;; definition for method 74 of type krew-boss-clone -(defmethod general-event-handler krew-boss-clone ((obj krew-boss-clone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler krew-boss-clone ((this krew-boss-clone) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (with-pp (case arg2 (('touch 'bonk 'attack) - (when (and (-> obj next-state) (= (-> obj next-state name) 'hostile)) + (when (and (-> this next-state) (= (-> this next-state name) 'hostile)) (send-event arg0 'attack @@ -911,30 +911,30 @@ For example for an elevator pre-compute the distance between the first and last ) (cond ((!= arg0 *target*) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-15 (-> obj skel root-channel 0))) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) ) (set! (-> a0-15 param 0) 0.0) (set! (-> a0-15 param 1) (* 2.0 (-> pp clock time-adjust-ratio))) (set! (-> a0-15 frame-num) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim))) frames num-frames) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) frames num-frames) -1 ) ) ) (joint-control-channel-group! a0-15 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) num-func-seek! ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ) ) @@ -942,18 +942,18 @@ For example for an elevator pre-compute the distance between the first and last (('track) (cond ((-> arg3 param 0) - (if (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (if (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) #t 'abort ) ) (else - (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -1023,37 +1023,39 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 77 of type krew-boss-clone -(defmethod enemy-method-77 krew-boss-clone ((obj krew-boss-clone) (arg0 (pointer float))) +(defmethod enemy-method-77 krew-boss-clone ((this krew-boss-clone) (arg0 (pointer float))) (with-pp (ja-channel-push! 1 0) (cond - ((<= (-> obj hit-points) 0) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim)))) + ((<= (-> this hit-points) 0) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) + ) (set! (-> a0-2 param 0) 0.0) (set! (-> a0-2 param 1) (* 2.0 (-> pp clock time-adjust-ratio))) (set! (-> a0-2 frame-num) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim))) frames num-frames) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) frames num-frames) -1 ) ) ) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info die-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info die-anim))) num-func-seek! ) ) ) (else - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) ) (set! (-> a0-3 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) frames num-frames) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) frames num-frames) -1 ) ) @@ -1062,7 +1064,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> a0-3 frame-num) 0.0) (joint-control-channel-group! a0-3 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) num-func-seek! ) ) @@ -1073,16 +1075,16 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 78 of type krew-boss-clone -(defmethod enemy-method-78 krew-boss-clone ((obj krew-boss-clone) (arg0 (pointer float))) - (when (> (-> obj hit-points) 0) +(defmethod enemy-method-78 krew-boss-clone ((this krew-boss-clone) (arg0 (pointer float))) + (when (> (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) ) (set! (-> a0-2 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) frames num-frames ) @@ -1094,7 +1096,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) num-func-seek! ) ) @@ -1103,12 +1105,12 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 79 of type krew-boss-clone -(defmethod enemy-method-79 krew-boss-clone ((obj krew-boss-clone) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 krew-boss-clone ((this krew-boss-clone) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (enemy-method-77 obj (the-as (pointer float) arg1)) + (enemy-method-77 this (the-as (pointer float) arg1)) #f ) ((= v1-0 1) @@ -1117,8 +1119,8 @@ For example for an elevator pre-compute the distance between the first and last s5-0 ) ((= v1-0 2) - (set! s5-0 (not (enemy-method-78 obj (the-as (pointer float) arg1)))) - (set! (-> obj incoming blue-juggle-count) (the-as uint 0)) + (set! s5-0 (not (enemy-method-78 this (the-as (pointer float) arg1)))) + (set! (-> this incoming blue-juggle-count) (the-as uint 0)) s5-0 ) ((= v1-0 3) @@ -1127,7 +1129,7 @@ For example for an elevator pre-compute the distance between the first and last s5-0 ) ((= v1-0 4) - (vector-reset! (-> obj root transv)) + (vector-reset! (-> this root transv)) #t ) (else @@ -1139,15 +1141,15 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 180 of type krew-boss-clone ;; WARN: Return type mismatch int vs none. -(defmethod krew-boss-clone-method-180 krew-boss-clone ((obj krew-boss-clone)) +(defmethod krew-boss-clone-method-180 krew-boss-clone ((this krew-boss-clone)) (let* ((f0-0 (rand-vu-float-range 0.0 1.0)) (f1-1 (+ 1.0 (* 2.0 f0-0))) (f2-2 f1-1) (f2-4 (/ 1.0 f2-2)) ) (+ 1.0 (* 0.2 f0-0)) - (set! (-> obj delta-wiggle-angle) (* 182.04445 f1-1)) - (set! (-> obj wiggle-factor) (* 2.0 f2-4)) + (set! (-> this delta-wiggle-angle) (* 182.04445 f1-1)) + (set! (-> this wiggle-factor) (* 2.0 f2-4)) ) 0 (none) @@ -1156,7 +1158,7 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 179 of type krew-boss-clone ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod krew-boss-clone-method-179 krew-boss-clone ((obj krew-boss-clone) (arg0 vector)) +(defmethod krew-boss-clone-method-179 krew-boss-clone ((this krew-boss-clone) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1165,16 +1167,16 @@ For example for an elevator pre-compute the distance between the first and last (vf7 :class vf) ) (init-vf0-vector) - (+! (-> obj wiggle-angle) (-> obj delta-wiggle-angle)) - (if (< 65536.0 (-> obj wiggle-angle)) - (+! (-> obj wiggle-angle) -65536.0) + (+! (-> this wiggle-angle) (-> this delta-wiggle-angle)) + (if (< 65536.0 (-> this wiggle-angle)) + (+! (-> this wiggle-angle) -65536.0) ) - (let* ((v1-5 (-> obj root trans)) + (let* ((v1-5 (-> this root trans)) (a1-2 (vector-! (new 'stack-no-clear 'vector) v1-5 arg0)) (s3-0 (vector-rotate-around-y! (new 'stack-no-clear 'vector) a1-2 16384.0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (let ((v1-6 (* (-> obj wiggle-factor) (sin (-> obj wiggle-angle))))) + (let ((v1-6 (* (-> this wiggle-factor) (sin (-> this wiggle-angle))))) (.mov vf7 v1-6) ) (.lvf vf5 (&-> s3-0 quad)) @@ -1183,7 +1185,7 @@ For example for an elevator pre-compute the distance between the first and last (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s4-0 quad) vf6) - (let ((v1-8 (-> obj nav state))) + (let ((v1-8 (-> this nav state))) (logclear! (-> v1-8 flags) (nav-state-flag directional-mode)) (logior! (-> v1-8 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-8 target-post quad) (-> s4-0 quad)) @@ -1196,8 +1198,8 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 68 of type krew-boss-clone -(defmethod go-stare2 krew-boss-clone ((obj krew-boss-clone)) - (go (method-of-object obj hostile)) +(defmethod go-stare2 krew-boss-clone ((this krew-boss-clone)) + (go (method-of-object this hostile)) ) ;; failed to figure out what this is: @@ -1222,8 +1224,8 @@ For example for an elevator pre-compute the distance between the first and last (let ((f30-0 (get-rand-float-range self 0.9 1.1))) (until #f (ja :num! (loop! f30-0)) - (when (>= (- (current-time) (-> self wiggle-time)) (seconds 1)) - (set! (-> self wiggle-time) (current-time)) + (when (time-elapsed? (-> self wiggle-time) (seconds 1)) + (set-time! (-> self wiggle-time)) (krew-boss-clone-method-180 self) ) (suspend) @@ -1291,9 +1293,9 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 114 of type krew-boss-clone ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! krew-boss-clone ((obj krew-boss-clone)) +(defmethod init-enemy-collision! krew-boss-clone ((this krew-boss-clone)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1350,70 +1352,70 @@ For example for an elevator pre-compute the distance between the first and last ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :probe #x1 :noendlessfall #x1)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 60 of type krew-boss-clone -(defmethod coin-flip? krew-boss-clone ((obj krew-boss-clone)) +(defmethod coin-flip? krew-boss-clone ((this krew-boss-clone)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 7 of type krew-boss-clone ;; WARN: Return type mismatch nav-enemy vs krew-boss-clone. -(defmethod relocate krew-boss-clone ((obj krew-boss-clone) (arg0 int)) +(defmethod relocate krew-boss-clone ((this krew-boss-clone) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj lightning v1-0)) - (&+! (-> obj lightning v1-0) arg0) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) arg0) ) ) - (the-as krew-boss-clone ((method-of-type nav-enemy relocate) obj arg0)) + (the-as krew-boss-clone ((method-of-type nav-enemy relocate) this arg0)) ) ;; definition for method 115 of type krew-boss-clone ;; WARN: Return type mismatch object vs none. -(defmethod init-enemy! krew-boss-clone ((obj krew-boss-clone)) +(defmethod init-enemy! krew-boss-clone ((this krew-boss-clone)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-krew-boss-clone" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> obj enemy-flags)))) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> this enemy-flags)))) (set! (-> *krew-boss-clone-nav-enemy-info* nav-mesh) - (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 1) + (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 1) ) - (init-enemy-behaviour-and-stats! obj *krew-boss-clone-nav-enemy-info*) + (init-enemy-behaviour-and-stats! this *krew-boss-clone-nav-enemy-info*) (dotimes (s5-1 4) - (set! (-> obj lightning s5-1) (new - 'process - 'lightning-control - (new 'static 'lightning-spec - :name #f - :flags (lightning-spec-flags lsf0) - :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) - :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) - :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) - :fade-start-factor 0.2 - :texture (new 'static 'texture-id :page #xd82) - :reduction 0.42 - :num-points 16 - :box-size 8192.0 - :merge-factor 0.5 - :merge-count 2 - :radius 512.0 - :duration 30.0 - :sound #f - ) - obj - 0.0 - ) + (set! (-> this lightning s5-1) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :page #xd82) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 512.0 + :duration 30.0 + :sound #f + ) + this + 0.0 + ) ) - (let ((v1-17 (-> obj lightning s5-1)) + (let ((v1-17 (-> this lightning s5-1)) (a0-8 0) ) (let ((a1-6 (!= a0-8 (-> v1-17 state mode)))) @@ -1432,28 +1434,28 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> v1-17 state mode) (the-as lightning-mode a0-8)) ) ) - (let ((v1-20 (-> obj neck))) + (let ((v1-20 (-> this neck))) (set! (-> v1-20 up) (the-as uint 1)) (set! (-> v1-20 nose) (the-as uint 2)) (set! (-> v1-20 ear) (the-as uint 0)) (set-vector! (-> v1-20 twist-max) 3640.889 11832.889 0.0 1.0) (set! (-> v1-20 ignore-angle) 15473.777) ) - (let ((v1-22 (-> obj nav))) + (let ((v1-22 (-> this nav))) (set! (-> v1-22 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (set-vector! (-> obj root scale) 0.8 0.8 0.8 1.0) - (set! (-> obj draw light-index) (the-as uint 1)) - (set-vector! (-> obj draw color-emissive) 0.0 1.0 0.0 0.0) - (set! (-> obj wiggle-angle) 0.0) - (set! (-> obj delta-wiggle-angle) 182.04445) - (set! (-> obj wiggle-factor) 2.0) - (set! (-> obj id) (new 'static 'sound-id)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj spawning)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set-vector! (-> this root scale) 0.8 0.8 0.8 1.0) + (set! (-> this draw light-index) (the-as uint 1)) + (set-vector! (-> this draw color-emissive) 0.0 1.0 0.0 0.0) + (set! (-> this wiggle-angle) 0.0) + (set! (-> this delta-wiggle-angle) 182.04445) + (set! (-> this wiggle-factor) 2.0) + (set! (-> this id) (new 'static 'sound-id)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this spawning)) (none) ) @@ -1467,16 +1469,16 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 3 of type krew-boss-shot -(defmethod inspect krew-boss-shot ((obj krew-boss-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect krew-boss-shot ((this krew-boss-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type guard-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for function krew-boss-shot-move @@ -1489,18 +1491,18 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 31 of type krew-boss-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! krew-boss-shot ((obj krew-boss-shot)) +(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)) obj) - (set! (-> obj move) krew-boss-shot-move) - (set! (-> obj max-speed) 245760.0) - (set! (-> obj timeout) (seconds 5)) + ((the-as (function projectile none) (find-parent-method krew-boss-shot 31)) this) + (set! (-> this move) krew-boss-shot-move) + (set! (-> this max-speed) 245760.0) + (set! (-> this timeout) (seconds 5)) (none) ) ;; definition for method 28 of type krew-boss-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound krew-boss-shot ((obj krew-boss-shot) (arg0 projectile-options)) +(defmethod play-impact-sound krew-boss-shot ((this krew-boss-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -1525,72 +1527,72 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 3 of type hud-krew-boss -(defmethod inspect hud-krew-boss ((obj hud-krew-boss)) - (when (not obj) - (set! obj obj) +(defmethod inspect hud-krew-boss ((this hud-krew-boss)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hud inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 15 of type hud-krew-boss ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-krew-boss ((obj hud-krew-boss)) - (set-hud-piece-position! (-> obj sprites 1) (the int (+ 462.0 (* 130.0 (-> obj offset)))) 350) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -32 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) -96 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 1)) -62 14) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 1)) -32 14) - (let ((s5-0 (-> obj values 0 current)) - (f28-0 (* 0.01 (the float (-> obj values 1 current)))) - (f30-0 (* 0.01 (the float (-> obj values 2 current)))) +(defmethod draw hud-krew-boss ((this hud-krew-boss)) + (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) -96 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites 1)) -32 14) + (let ((s5-0 (-> this values 0 current)) + (f28-0 (* 0.01 (the float (-> this values 1 current)))) + (f30-0 (* 0.01 (the float (-> this values 2 current)))) ) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 1)) -92 15) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 1)) -92 15) (cond ((zero? s5-0) - (set! (-> obj sprites 3 color x) 0) - (set! (-> obj sprites 3 color y) 255) + (set! (-> this sprites 3 color x) 0) + (set! (-> this sprites 3 color y) 255) (set! f28-0 (+ 2.0 f28-0)) ) ((= s5-0 1) - (set! (-> obj sprites 3 color y) 255) - (set! (-> obj sprites 3 color x) 255) + (set! (-> this sprites 3 color y) 255) + (set! (-> this sprites 3 color x) 255) (set! f28-0 (+ 1.0 f28-0)) ) (else - (set! (-> obj sprites 3 color x) 255) - (set! (-> obj sprites 3 color y) 0) + (set! (-> this sprites 3 color x) 255) + (set! (-> this sprites 3 color y) 0) 0 ) ) - (set! (-> obj sprites 3 scale-x) (* -7.25 f28-0)) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 1)) -84 4) + (set! (-> this sprites 3 scale-x) (* -7.25 f28-0)) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 1)) -84 4) (cond ((< f30-0 0.5) - (set! (-> obj sprites 4 color x) 255) - (set! (-> obj sprites 4 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-0)))) + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-0)))) ) (else - (set! (-> obj sprites 4 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-0))))) - (set! (-> obj sprites 4 color y) 255) + (set! (-> this sprites 4 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-0))))) + (set! (-> this sprites 4 color y) 255) ) ) - (set! (-> obj sprites 4 scale-x) (* -18.25 f30-0)) + (set! (-> this sprites 4 scale-x) (* -18.25 f30-0)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-krew-boss ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-krew-boss ((obj hud-krew-boss)) - (set! (-> obj values 0 target) (+ (-> (the-as krew-boss (-> obj parent 0)) gameplay-pass) -1)) - (let ((v1-7 (/ (-> (the-as krew-boss (-> obj parent 0)) hit-points) +(defmethod update-values hud-krew-boss ((this hud-krew-boss)) + (set! (-> this values 0 target) (+ (-> (the-as krew-boss (-> this parent 0)) gameplay-pass) -1)) + (let ((v1-7 (/ (-> (the-as krew-boss (-> this parent 0)) hit-points) (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) 2 1 @@ -1598,61 +1600,61 @@ For example for an elevator pre-compute the distance between the first and last ) ) ) - (case (-> (the-as krew-boss (-> obj parent 0)) gameplay-pass) + (case (-> (the-as krew-boss (-> this parent 0)) gameplay-pass) ((1) - (set! (-> obj values 1 target) (the int (* 3.3333333 (the float (+ v1-7 -70))))) + (set! (-> this values 1 target) (the int (* 3.3333333 (the float (+ v1-7 -70))))) ) ((2) - (set! (-> obj values 1 target) (the int (* 3.3333333 (the float (+ v1-7 -40))))) + (set! (-> this values 1 target) (the int (* 3.3333333 (the float (+ v1-7 -40))))) ) (else - (set! (-> obj values 1 target) (the int (* 2.5 (the float v1-7)))) + (set! (-> this values 1 target) (the int (* 2.5 (the float v1-7)))) ) ) ) - (when (< (-> obj values 1 target) 0) - (set! (-> obj values 1 target) 0) + (when (< (-> this values 1 target) 0) + (set! (-> this values 1 target) 0) 0 ) - ((method-of-type hud update-values) obj) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-krew-boss ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-krew-boss ((obj hud-krew-boss)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-krew-boss ((this hud-krew-boss)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj values 0 target) 0) - (set! (-> obj values 1 target) 100) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 2 tex) + (set! (-> this values 0 target) 0) + (set! (-> this values 1 target) 100) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 2 tex) (lookup-texture-by-name "hud-baronsymbol-01" (the-as string #f) (the-as (pointer texture-page) #f)) ) - (set! (-> obj sprites 2 flags) (the-as uint 4)) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 5 scale-x) 0.5) - (set! (-> obj sprites 5 flags) (the-as uint 4)) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 6 scale-x) 0.5) - (set! (-> obj sprites 6 flags) (the-as uint 4)) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 3 scale-y) 3.25) - (set! (-> obj sprites 3 color z) 0) - (set! (-> obj sprites 3 flags) (the-as uint 4)) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 4 scale-y) 1.5) - (set! (-> obj sprites 4 color z) 0) - (set! (-> obj sprites 4 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning large)) - (set! (-> obj strings 0 scale) 0.5) + (set! (-> this sprites 2 flags) (the-as uint 4)) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 5 scale-x) 0.5) + (set! (-> this sprites 5 flags) (the-as uint 4)) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 6 scale-x) 0.5) + (set! (-> this sprites 6 flags) (the-as uint 4)) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 3 scale-y) 3.25) + (set! (-> this sprites 3 color z) 0) + (set! (-> this sprites 3 flags) (the-as uint 4)) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 4 scale-y) 1.5) + (set! (-> this sprites 4 color z) 0) + (set! (-> this sprites 4 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning large)) + (set! (-> this strings 0 scale) 0.5) 0 (none) ) @@ -2009,54 +2011,54 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 115 of type krew-boss ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! krew-boss ((obj krew-boss)) +(defmethod init-enemy! krew-boss ((this krew-boss)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-krew-boss" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *krew-boss-nav-enemy-info*) - (let ((v1-5 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *krew-boss-nav-enemy-info*) + (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) (set! (-> v1-5 ear) (the-as uint 0)) (set-vector! (-> v1-5 twist-max) 3640.889 11832.889 0.0 1.0) (set! (-> v1-5 ignore-angle) 15473.777) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (let ((v1-9 (-> obj nav))) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((v1-9 (-> this nav))) (set! (-> v1-9 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (set-vector! (-> obj root trans) -1302528.0 -1449984.0 -6836224.0 1.0) - (let ((v1-20 (-> obj nav state)) - (a0-17 (-> obj root trans)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set-vector! (-> this root trans) -1302528.0 -1449984.0 -6836224.0 1.0) + (let ((v1-20 (-> this nav state)) + (a0-17 (-> this root trans)) ) (logclear! (-> v1-20 flags) (nav-state-flag directional-mode)) (logior! (-> v1-20 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-20 target-post quad) (-> a0-17 quad)) ) 0 - (set! (-> obj next-clone-side) 0) - (set! (-> obj last-closest-spawn) 0) - (set! (-> obj next-shooting-frame) 0) - (set! (-> obj floating) #f) - (set! (-> obj next-path-point) 0) - (set! (-> obj num-clones-to-spawn) 0) - (set! (-> obj gameplay-pass) 0) - (set! (-> obj hud-handle) (the-as handle #f)) - (set! (-> obj id) (new 'static 'sound-id)) - (set! (-> obj channel) (the-as uint 35)) - (set! (-> obj play-clone-wave-speech) #f) - (set! (-> obj spawn-charge) #f) + (set! (-> this next-clone-side) 0) + (set! (-> this last-closest-spawn) 0) + (set! (-> this next-shooting-frame) 0) + (set! (-> this floating) #f) + (set! (-> this next-path-point) 0) + (set! (-> this num-clones-to-spawn) 0) + (set! (-> this gameplay-pass) 0) + (set! (-> this hud-handle) (the-as handle #f)) + (set! (-> this id) (new 'static 'sound-id)) + (set! (-> this channel) (the-as uint 35)) + (set! (-> this play-clone-wave-speech) #f) + (set! (-> this spawn-charge) #f) (dotimes (v1-24 8) - (set! (-> obj clones v1-24) (the-as handle #f)) + (set! (-> this clones v1-24) (the-as handle #f)) ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag36)))) - (set! (-> obj nav callback-info) *nav-enemy-null-callback-info*) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag36)))) + (set! (-> this nav callback-info) *nav-enemy-null-callback-info*) 0 0 (none) @@ -2064,14 +2066,14 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 116 of type krew-boss ;; WARN: Return type mismatch object vs none. -(defmethod go-idle krew-boss ((obj krew-boss)) +(defmethod go-idle krew-boss ((this krew-boss)) (cond ((task-node-closed? (game-task-node castle-boss-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj hidden)) + (go (method-of-object this hidden)) ) ) (none) @@ -2132,68 +2134,68 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 74 of type krew-boss ;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler krew-boss ((obj krew-boss) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler krew-boss ((this krew-boss) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('track) (cond ((-> arg3 param 0) - (if (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (if (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) #t 'abort ) ) (else - (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active)) + (logtest? (-> this enemy-flags) (enemy-flag enable-on-active)) ) ) ) (('notify) (case (-> arg3 param 0) (('hit) - (krew-hits-jak-speech obj) - (set! (-> obj next-shooting-frame) 100) - (set! (-> obj spawn-charge) #t) + (krew-hits-jak-speech this) + (set! (-> this next-shooting-frame) 100) + (set! (-> this spawn-charge) #t) (let ((v0-0 (the-as object (current-time)))) - (set! (-> obj state-time) (the-as time-frame v0-0)) + (set! (-> this state-time) (the-as time-frame v0-0)) v0-0 ) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 102 of type krew-boss -(defmethod enemy-method-102 krew-boss ((obj krew-boss)) +(defmethod enemy-method-102 krew-boss ((this krew-boss)) #f ) ;; definition for method 77 of type krew-boss -(defmethod enemy-method-77 krew-boss ((obj krew-boss) (arg0 (pointer float))) +(defmethod enemy-method-77 krew-boss ((this krew-boss) (arg0 (pointer float))) (with-pp (ja-channel-push! 1 0) (cond - ((<= (-> obj hit-points) 0) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 14))) + ((<= (-> this hit-points) 0) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) (set! (-> a0-2 param 0) (-> pp clock time-adjust-ratio)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 14)) num-func-loop!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-loop!) ) ) (else - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) ) (set! (-> a0-3 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) frames num-frames) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) frames num-frames) -1 ) ) @@ -2202,7 +2204,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> a0-3 frame-num) 0.0) (joint-control-channel-group! a0-3 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) num-func-seek! ) ) @@ -2213,20 +2215,20 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 78 of type krew-boss -(defmethod enemy-method-78 krew-boss ((obj krew-boss) (arg0 (pointer float))) +(defmethod enemy-method-78 krew-boss ((this krew-boss) (arg0 (pointer float))) (cond - ((<= (-> obj hit-points) 0) + ((<= (-> this hit-points) 0) #f ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) ) (set! (-> a0-2 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) frames num-frames ) @@ -2238,7 +2240,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-land-anim))) num-func-seek! ) ) @@ -2248,7 +2250,7 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 81 of type krew-boss -(defmethod enemy-method-81 krew-boss ((obj krew-boss)) +(defmethod enemy-method-81 krew-boss ((this krew-boss)) #f ) @@ -2320,9 +2322,9 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 114 of type krew-boss ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! krew-boss ((obj krew-boss)) +(defmethod init-enemy-collision! krew-boss ((this krew-boss)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2372,14 +2374,14 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 60 of type krew-boss -(defmethod coin-flip? krew-boss ((obj krew-boss)) +(defmethod coin-flip? krew-boss ((this krew-boss)) "@returns The result of a 50/50 RNG roll" #f ) @@ -2464,14 +2466,14 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 56 of type krew-boss -(defmethod damage-amount-from-attack krew-boss ((obj krew-boss) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack krew-boss ((this krew-boss) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let ((v1-0 (get-penetrate-using-from-attack-event (the-as process-drawable arg0) arg1))) (cond ((or (logtest? (penetrate jak-blue-shot) v1-0) (logtest? (penetrate jak-dark-shot) v1-0)) (cond - ((>= (- (current-time) (-> obj last-damage-time)) (seconds 5)) - (set! (-> obj last-damage-time) (current-time)) + ((time-elapsed? (-> this last-damage-time) (seconds 5)) + (set-time! (-> this last-damage-time)) 5 ) (else @@ -2492,12 +2494,12 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 142 of type krew-boss ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 krew-boss ((obj krew-boss) (arg0 nav-control)) +(defmethod nav-enemy-method-142 krew-boss ((this krew-boss) (arg0 nav-control)) (with-pp (cond - ((not (logtest? (-> obj nav flags) (nav-control-flag update-heading-from-facing))) - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root trans))) - (s3-0 (quaternion->matrix (new-stack-matrix0) (-> obj root quat))) + ((not (logtest? (-> this nav flags) (nav-control-flag update-heading-from-facing))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (s3-0 (quaternion->matrix (new-stack-matrix0) (-> this root quat))) ) (vector-normalize! s5-1 1.0) (let* ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s3-0 vector 1) 1.0)) @@ -2509,10 +2511,10 @@ For example for an elevator pre-compute the distance between the first and last (f2-0 182.04445) ) (cond - ((= (-> obj gameplay-pass) 2) + ((= (-> this gameplay-pass) 2) (set! f2-0 273.06668) ) - ((= (-> obj gameplay-pass) 3) + ((= (-> this gameplay-pass) 3) (set! f2-0 364.0889) ) ) @@ -2527,13 +2529,13 @@ For example for an elevator pre-compute the distance between the first and last ) ) (let ((f0-3 (seek f30-0 f0-0 (* f2-0 (-> pp clock time-adjust-ratio))))) - (quaternion-axis-angle! (-> obj root quat) 0.0 1.0 0.0 f0-3) + (quaternion-axis-angle! (-> this root quat) 0.0 1.0 0.0 f0-3) ) ) ) ) (else - ((method-of-type nav-enemy nav-enemy-method-142) obj arg0) + ((method-of-type nav-enemy nav-enemy-method-142) this arg0) ) ) 0 @@ -2627,7 +2629,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> self spawn-charge) #t) (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag enemy-flag41)))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) (when (not (handle->process (-> self hud-handle))) (set! (-> self hud-handle) (ppointer->handle (process-spawn hud-krew-boss :init hud-init-by-other :to self))) (krew-comes-in-speech self) @@ -2649,7 +2651,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (if (or (!= (-> self focus aware) 3) (not (get-enemy-target self))) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) (when (= (-> self next-shooting-frame) 200) (cond @@ -2688,7 +2690,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (else - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -2753,7 +2755,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (let ((gp-2 (the int (* 300.0 (- 3.0 (* 0.5 (+ -1.0 (the float (-> self gameplay-pass))))))))) - (when (and (-> self spawn-charge) (>= (- (current-time) (-> self state-time)) (+ gp-2 -300))) + (when (and (-> self spawn-charge) (time-elapsed? (-> self state-time) (+ gp-2 -300))) (process-spawn part-tracker :init part-tracker-init @@ -2767,7 +2769,7 @@ For example for an elevator pre-compute the distance between the first and last ) (set! (-> self spawn-charge) #f) ) - (when (and (= (-> self next-shooting-frame) 100) (>= (- (current-time) (-> self state-time)) gp-2)) + (when (and (= (-> self next-shooting-frame) 100) (time-elapsed? (-> self state-time) gp-2)) (set! (-> self next-shooting-frame) 0) (ja :chan 1 :num-func num-func-identity :frame-num 0.0) ) @@ -2783,7 +2785,7 @@ For example for an elevator pre-compute the distance between the first and last ((= (-> self next-shooting-frame) 20) (set! (-> self next-shooting-frame) 100) (set! (-> self spawn-charge) #t) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (else (+! (-> self next-shooting-frame) 5) @@ -2840,15 +2842,15 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 73 of type krew-boss -(defmethod kill-prefer-falling krew-boss ((obj krew-boss)) +(defmethod kill-prefer-falling krew-boss ((this krew-boss)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (when (handle->process (-> obj hud-handle)) - (send-event (-> obj hud-handle process 0) 'hide-and-die) - (set! (-> obj hud-handle) (the-as handle #f)) + (when (handle->process (-> this hud-handle)) + (send-event (-> this hud-handle process 0) 'hide-and-die) + (set! (-> this hud-handle) (the-as handle #f)) ) (send-event *target* 'get-notify #f) - (add-process *gui-control* obj (the-as gui-channel (-> obj channel)) (gui-action play) "ds269" -99.0 0) - ((method-of-type nav-enemy kill-prefer-falling) obj) + (add-process *gui-control* this (the-as gui-channel (-> this channel)) (gui-action play) "ds269" -99.0 0) + ((method-of-type nav-enemy kill-prefer-falling) this) ) ;; definition for symbol *krew-boss-die-positions*, type (array vector) 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 a24969fdac..8e30ce417e 100644 --- a/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/castle-obs_REF.gc @@ -20,41 +20,41 @@ ) ;; definition for method 3 of type cas-conveyor -(defmethod inspect cas-conveyor ((obj cas-conveyor)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-conveyor ((this cas-conveyor)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type conveyor inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Ttexture-anim-index: ~D~%" (-> obj texture-anim-index)) - (format #t "~2Tmy-id: ~D~%" (-> obj my-id)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Ttarget-speed: ~f~%" (-> obj target-speed)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Ttexture-anim-index: ~D~%" (-> this texture-anim-index)) + (format #t "~2Tmy-id: ~D~%" (-> this my-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Ttarget-speed: ~f~%" (-> this target-speed)) (label cfg-7) - obj + this ) ;; definition for method 24 of type cas-conveyor ;; WARN: Return type mismatch int vs none. -(defmethod init! cas-conveyor ((obj cas-conveyor)) +(defmethod init! cas-conveyor ((this cas-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" (let ((t9-0 (method-of-type conveyor init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj speed) (res-lump-float (-> obj entity) 'speed :default 30720.0)) - (set! (-> obj belt-radius) (res-lump-float (-> obj entity) 'center-radius :default 15974.4)) - (set! (-> obj texture-anim-index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) - (set! (-> obj my-id) - (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) + (set! (-> this speed) (res-lump-float (-> this entity) 'speed :default 30720.0)) + (set! (-> this belt-radius) (res-lump-float (-> this entity) 'center-radius :default 15974.4)) + (set! (-> this texture-anim-index) (res-lump-value (-> this entity) 'index uint :time -1000000000.0)) + (set! (-> this my-id) + (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) ) - (set! (-> obj pull-y-threshold) 409.6) + (set! (-> this pull-y-threshold) 409.6) 0 (none) ) @@ -62,7 +62,7 @@ ;; definition for method 11 of type cas-conveyor ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-conveyor ((obj cas-conveyor) (arg0 entity-actor)) +(defmethod init-from-entity! cas-conveyor ((this cas-conveyor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -70,38 +70,38 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (reset-root! obj) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (if (< (-> obj path curve num-cverts) 2) + (reset-root! this) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) - (init! obj) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj target-speed) (-> obj speed)) - (conveyor-method-21 obj) + (init! this) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this target-speed) (-> this speed)) + (conveyor-method-21 this) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-16 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-16 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-16 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-16)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-16)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) ;; definition for method 10 of type cas-conveyor -(defmethod deactivate cas-conveyor ((obj cas-conveyor)) - (sound-stop (-> obj sound-id)) - ((the-as (function conveyor none) (find-parent-method cas-conveyor 10)) obj) +(defmethod deactivate cas-conveyor ((this cas-conveyor)) + (sound-stop (-> this sound-id)) + ((the-as (function conveyor none) (find-parent-method cas-conveyor 10)) this) (none) ) @@ -194,30 +194,30 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-conveyor-switch -(defmethod inspect cas-conveyor-switch ((obj cas-conveyor-switch)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-conveyor-switch ((this cas-conveyor-switch)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tquat0: #~%" (-> obj quat0)) - (format #t "~2Tquat180: #~%" (-> obj quat180)) - (format #t "~2Tred-pos: #~%" (-> obj red-pos)) - (format #t "~2Tblue-pos: #~%" (-> obj blue-pos)) - (format #t "~2Ttrack-flag: ~A~%" (-> obj track-flag)) - (format #t "~2Tlightning-timer: ~D~%" (-> obj lightning-timer)) - (format #t "~2Tspeed: ~f~%" (-> obj speed)) - (format #t "~2Ttarget-speed: ~f~%" (-> obj target-speed)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tquat0: #~%" (-> this quat0)) + (format #t "~2Tquat180: #~%" (-> this quat180)) + (format #t "~2Tred-pos: #~%" (-> this red-pos)) + (format #t "~2Tblue-pos: #~%" (-> this blue-pos)) + (format #t "~2Ttrack-flag: ~A~%" (-> this track-flag)) + (format #t "~2Tlightning-timer: ~D~%" (-> this lightning-timer)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Ttarget-speed: ~f~%" (-> this target-speed)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -406,7 +406,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-conveyor-switch ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-conveyor-switch ((obj cas-conveyor-switch) (arg0 entity-actor)) +(defmethod init-from-entity! cas-conveyor-switch ((this cas-conveyor-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -414,7 +414,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) @@ -429,48 +429,48 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-conveyor-switch" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (if (!= (-> obj path curve num-cverts) 2) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (!= (-> this path curve num-cverts) 2) (go process-drawable-art-error "bad path") ) - (get-point-in-path! (-> obj path) (-> obj red-pos) 0.0 'exact) - (get-point-in-path! (-> obj path) (-> obj blue-pos) 1.0 'exact) - (set! (-> obj lightning-timer) 0) + (get-point-in-path! (-> this path) (-> this red-pos) 0.0 'exact) + (get-point-in-path! (-> this path) (-> this blue-pos) 1.0 'exact) + (set! (-> this lightning-timer) 0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-27 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-27 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-27 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-27)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-27)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj quat0 quad) (-> obj root quat quad)) - (quaternion-rotate-y! (-> obj quat180) (-> obj quat0) 32768.0) - (set! (-> obj speed) (res-lump-float (-> obj entity) 'speed :default 30720.0)) - (set! (-> obj target-speed) (-> obj speed)) - (go (method-of-object obj idle)) + (set! (-> this quat0 quad) (-> this root quat quad)) + (quaternion-rotate-y! (-> this quat180) (-> this quat0) 32768.0) + (set! (-> this speed) (res-lump-float (-> this entity) 'speed :default 30720.0)) + (set! (-> this target-speed) (-> this speed)) + (go (method-of-object this idle)) (none) ) @@ -490,18 +490,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-electric-fence -(defmethod inspect cas-electric-fence ((obj cas-electric-fence)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-electric-fence ((this cas-electric-fence)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnext-spawn-time: ~D~%" (-> obj next-spawn-time)) - (format #t "~2Tstop: ~A~%" (-> obj stop)) + (format #t "~2Tnext-spawn-time: ~D~%" (-> this next-spawn-time)) + (format #t "~2Tstop: ~A~%" (-> this stop)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -567,7 +567,7 @@ This commonly includes things such as: (suspend) (logior! (-> self entity extra perm status) (entity-perm-status dead)) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 4)) + (until (time-elapsed? gp-2 (seconds 4)) (suspend) ) ) @@ -711,14 +711,14 @@ This commonly includes things such as: ;; definition for method 11 of type cas-electric-fence ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-electric-fence ((obj cas-electric-fence) (arg0 entity-actor)) +(defmethod init-from-entity! cas-electric-fence ((this cas-electric-fence) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) @@ -734,24 +734,24 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-electric-fence" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj next-spawn-time) 0) - (set! (-> obj stop) #f) + (set! (-> this next-spawn-time) 0) + (set! (-> this stop) #f) (ja-channel-set! 1) - (let ((a0-14 (-> obj skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -768,16 +768,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-button -(defmethod inspect cas-button ((obj cas-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-button ((this cas-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type basebutton inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -788,9 +788,9 @@ This commonly includes things such as: ;; definition for method 34 of type cas-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-34 cas-button ((obj cas-button)) +(defmethod basebutton-method-34 cas-button ((this cas-button)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -806,7 +806,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -814,9 +814,9 @@ This commonly includes things such as: ;; definition for method 35 of type cas-button ;; WARN: Return type mismatch int vs none. -(defmethod prepare-trigger-event! cas-button ((obj cas-button)) +(defmethod prepare-trigger-event! cas-button ((this cas-button)) "Sets `event-going-down` to `'trigger`" - (set! (-> obj event-down) 'shutdown) + (set! (-> this event-down) 'shutdown) 0 (none) ) @@ -847,39 +847,39 @@ This commonly includes things such as: ;; definition for method 33 of type cas-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 cas-button ((obj cas-button)) +(defmethod basebutton-method-33 cas-button ((this cas-button)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) - (let ((s5-1 (-> obj skel root-channel 0))) + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) ) ) (else - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) ) ) - (set! (-> obj anim-speed) 2.0) + (set! (-> this anim-speed) 2.0) (transform-post) (none) ) @@ -898,17 +898,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-elevator -(defmethod inspect cas-elevator ((obj cas-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-elevator ((this cas-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -918,17 +918,17 @@ This commonly includes things such as: ) ;; definition for method 30 of type cas-elevator -(defmethod get-art-group cas-elevator ((obj cas-elevator)) +(defmethod get-art-group cas-elevator ((this cas-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cas-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 49 of type cas-elevator ;; WARN: Return type mismatch float vs none. -(defmethod cas-elevator-method-49 cas-elevator ((obj cas-elevator)) - (let* ((f0-1 (fmax 0.0 (- (-> obj root trans y) (-> obj bottom-top 0)))) +(defmethod cas-elevator-method-49 cas-elevator ((this cas-elevator)) + (let* ((f0-1 (fmax 0.0 (- (-> this root trans y) (-> this bottom-top 0)))) (f0-3 (* 0.001171875 (- f0-1 (* (the float (the int (/ f0-1 30720.0))) 30720.0)))) - (v1-6 (-> obj skel root-channel 0)) + (v1-6 (-> this skel root-channel 0)) ) (set! (-> v1-6 num-func) num-func-identity) (set! (-> v1-6 frame-num) f0-3) @@ -937,15 +937,15 @@ This commonly includes things such as: ) ;; definition for method 43 of type cas-elevator -(defmethod move-between-points cas-elevator ((obj cas-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points cas-elevator ((this cas-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s5-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s5-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((a0-8 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) @@ -956,7 +956,7 @@ This commonly includes things such as: ) ;; definition for method 45 of type cas-elevator -(defmethod commited-to-ride? cas-elevator ((obj cas-elevator)) +(defmethod commited-to-ride? cas-elevator ((this cas-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) @@ -966,7 +966,7 @@ This commonly includes things such as: ) (when a0-2 (let* ((a0-3 (get-trans a0-2 0)) - (v1-2 (vector-! (new 'stack-no-clear 'vector) a0-3 (-> obj root trans))) + (v1-2 (vector-! (new 'stack-no-clear 'vector) a0-3 (-> this root trans))) ) (< (sqrtf (+ (* (-> v1-2 x) (-> v1-2 x)) (* (-> v1-2 z) (-> v1-2 z)))) 28672.0) ) @@ -1054,26 +1054,26 @@ This commonly includes things such as: ) ;; definition for method 10 of type cas-elevator -(defmethod deactivate cas-elevator ((obj cas-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method cas-elevator 10)) obj) +(defmethod deactivate cas-elevator ((this cas-elevator)) + (sound-stop (-> this sound-id)) + ((the-as (function elevator none) (find-parent-method cas-elevator 10)) this) (none) ) ;; definition for method 33 of type cas-elevator -(defmethod init-plat! cas-elevator ((obj cas-elevator)) +(defmethod init-plat! cas-elevator ((this cas-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." - (set! (-> obj sound-id) (new-sound-id)) - (cas-elevator-method-49 obj) + (set! (-> this sound-id) (new-sound-id)) + (cas-elevator-method-49 this) (none) ) ;; definition for method 31 of type cas-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! cas-elevator ((obj cas-elevator)) +(defmethod init-plat-collision! cas-elevator ((this cas-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1094,7 +1094,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1120,23 +1120,23 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 3 of type cas-rot-bridge -(defmethod inspect cas-rot-bridge ((obj cas-rot-bridge)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-rot-bridge ((this cas-rot-bridge)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tindex: ~D~%" (-> obj index)) - (format #t "~2Tanim-index: ~D~%" (-> obj anim-index)) - (format #t "~2Ttest-index: ~D~%" (-> obj test-index)) - (format #t "~2Tpos: ~f~%" (-> obj pos)) - (format #t "~2Tpos-old: ~f~%" (-> obj pos-old)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tsound-flag: ~A~%" (-> obj sound-flag)) + (format #t "~2Tindex: ~D~%" (-> this index)) + (format #t "~2Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~2Ttest-index: ~D~%" (-> this test-index)) + (format #t "~2Tpos: ~f~%" (-> this pos)) + (format #t "~2Tpos-old: ~f~%" (-> this pos-old)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tsound-flag: ~A~%" (-> this sound-flag)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1398,14 +1398,14 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 11 of type cas-rot-bridge ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-rot-bridge ((obj cas-rot-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! cas-rot-bridge ((this cas-rot-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) (set! (-> s4-0 total-prims) (the-as uint 6)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1455,39 +1455,39 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-rot-bridge" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) 16384.0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) - (let ((v1-30 (-> obj index))) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) 16384.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this index) (res-lump-value (-> this entity) 'index uint :time -1000000000.0)) + (let ((v1-30 (-> this index))) (cond ((zero? v1-30) - (+! (-> obj root trans x) 5734.4) - (let ((s5-2 (-> obj skel root-channel 0))) - (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-identity) + (+! (-> this root trans x) 5734.4) + (let ((s5-2 (-> this skel root-channel 0))) + (joint-control-channel-group! s5-2 (the-as art-joint-anim (-> this draw art-group data 6)) num-func-identity) (set! (-> s5-2 frame-num) 0.0) ) ) ((= v1-30 1) - (let ((s5-3 (-> obj skel root-channel 0))) - (joint-control-channel-group! s5-3 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (let ((s5-3 (-> this skel root-channel 0))) + (joint-control-channel-group! s5-3 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) (set! (-> s5-3 frame-num) 0.0) ) ) ) ) - (set! (-> obj draw light-index) (the-as uint 1)) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj sound-flag) #f) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this sound-flag) #f) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1514,29 +1514,29 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-switch -(defmethod inspect cas-switch ((obj cas-switch)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-switch ((this cas-switch)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tanim-index: ~D~%" (-> obj anim-index)) - (format #t "~2Tdirection: ~D~%" (-> obj direction)) - (format #t "~2Tpos-old: ~f~%" (-> obj pos-old)) - (format #t "~2Ty-start: ~f~%" (-> obj y-start)) - (format #t "~2Ty-delta: ~f~%" (-> obj y-delta)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tsound-flag: ~A~%" (-> obj sound-flag)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~2Tdirection: ~D~%" (-> this direction)) + (format #t "~2Tpos-old: ~f~%" (-> this pos-old)) + (format #t "~2Ty-start: ~f~%" (-> this y-start)) + (format #t "~2Ty-delta: ~f~%" (-> this y-delta)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tsound-flag: ~A~%" (-> this sound-flag)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -1659,7 +1659,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-switch ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-switch ((obj cas-switch) (arg0 entity-actor)) +(defmethod init-from-entity! cas-switch ((this cas-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1667,7 +1667,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1696,35 +1696,35 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-switch" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-22 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-22 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-22 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-22)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-22)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj anim-index) (res-lump-value (-> obj entity) 'index uint :time -1000000000.0)) - (set! (-> obj direction) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0)) - (let ((s5-2 (-> obj root trans)) - (s4-2 (-> obj root trans)) + (set! (-> this anim-index) (res-lump-value (-> this entity) 'index uint :time -1000000000.0)) + (set! (-> this direction) (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0)) + (let ((s5-2 (-> this root trans)) + (s4-2 (-> this root trans)) (t9-10 (method-of-type res-lump get-property-struct)) - (a0-27 (-> obj entity)) + (a0-27 (-> this entity)) (a1-19 'trans-offset) (a2-9 'interp) (a3-7 -1000000000.0) @@ -1740,14 +1740,14 @@ This commonly includes things such as: (the-as vector (t9-10 a0-27 a1-19 a2-9 a3-7 t0-6 (the-as (pointer res-tag) #f) *res-static-buf*)) ) ) - (set! (-> obj y-start) (-> obj root trans y)) - (if (zero? (-> obj direction)) - (set! (-> obj y-delta) -12288.0) - (set! (-> obj y-delta) 12288.0) + (set! (-> this y-start) (-> this root trans y)) + (if (zero? (-> this direction)) + (set! (-> this y-delta) -12288.0) + (set! (-> this y-delta) 12288.0) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj sound-flag) #f) - (go (method-of-object obj idle)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this sound-flag) #f) + (go (method-of-object this idle)) (none) ) @@ -1766,16 +1766,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-trapdoor -(defmethod inspect cas-trapdoor ((obj cas-trapdoor)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-trapdoor ((this cas-trapdoor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1877,7 +1877,7 @@ This commonly includes things such as: (suspend) (ja-channel-set! 0) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -1892,14 +1892,14 @@ This commonly includes things such as: ;; definition for method 11 of type cas-trapdoor ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-trapdoor ((obj cas-trapdoor) (arg0 entity-actor)) +(defmethod init-from-entity! cas-trapdoor ((this cas-trapdoor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1914,24 +1914,24 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) (if (not (task-node-closed? (game-task-node castle-boss-resolution))) - (set! (-> obj root penetrated-by) (penetrate flop)) + (set! (-> this root penetrated-by) (penetrate flop)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-trapdoor" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-14 (-> obj skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1950,16 +1950,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-chain-plat -(defmethod inspect cas-chain-plat ((obj cas-chain-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-chain-plat ((this cas-chain-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2009,14 +2009,14 @@ This commonly includes things such as: ;; definition for method 11 of type cas-chain-plat ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-chain-plat ((obj cas-chain-plat) (arg0 entity-actor)) +(defmethod init-from-entity! cas-chain-plat ((this cas-chain-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) @@ -2031,16 +2031,16 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-chain-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask enemy)) + (go (method-of-object this idle)) (none) ) @@ -2061,20 +2061,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-rot-blade -(defmethod inspect cas-rot-blade ((obj cas-rot-blade)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-rot-blade ((this cas-rot-blade)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Trot: ~f~%" (-> obj rot)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Trot: ~f~%" (-> this rot)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2150,14 +2150,14 @@ This commonly includes things such as: ;; definition for method 11 of type cas-rot-blade ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-rot-blade ((obj cas-rot-blade) (arg0 entity-actor)) +(defmethod init-from-entity! cas-rot-blade ((this cas-rot-blade) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -2186,15 +2186,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-rot-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 2)) + (set! (-> this draw light-index) (the-as uint 2)) (let ((a1-10 (new 'stack-no-clear 'sync-info-params))) (let ((v1-20 0)) (if #t @@ -2210,22 +2210,22 @@ This commonly includes things such as: (set! (-> a1-10 ease-out) 0.15) (set! (-> a1-10 pause-in) 0.2) (set! (-> a1-10 pause-out) 0.0) - (initialize! (-> obj sync) a1-10) + (initialize! (-> this sync) a1-10) ) - (let ((a0-26 (-> obj node-list data 4))) + (let ((a0-26 (-> this node-list data 4))) (set! (-> a0-26 param0) cas-rot-blade-callback) - (set! (-> a0-26 param1) obj) + (set! (-> a0-26 param1) this) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj draw shadow-ctrl) *cas-rot-blade-shadow-control*) - (go (method-of-object obj idle)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this draw shadow-ctrl) *cas-rot-blade-shadow-control*) + (go (method-of-object this idle)) (none) ) ;; definition for method 10 of type cas-rot-blade -(defmethod deactivate cas-rot-blade ((obj cas-rot-blade)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method cas-rot-blade 10)) obj) +(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) (none) ) @@ -2242,16 +2242,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-flag-a -(defmethod inspect cas-flag-a ((obj cas-flag-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-flag-a ((this cas-flag-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2278,21 +2278,21 @@ This commonly includes things such as: ;; definition for method 11 of type cas-flag-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-flag-a ((obj cas-flag-a) (arg0 entity-actor)) +(defmethod init-from-entity! cas-flag-a ((this cas-flag-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-flag-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2309,16 +2309,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-flag-b -(defmethod inspect cas-flag-b ((obj cas-flag-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-flag-b ((this cas-flag-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2345,21 +2345,21 @@ This commonly includes things such as: ;; definition for method 11 of type cas-flag-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-flag-b ((obj cas-flag-b) (arg0 entity-actor)) +(defmethod init-from-entity! cas-flag-b ((this cas-flag-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-flag-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2390,31 +2390,31 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-robot-door -(defmethod inspect cas-robot-door ((obj cas-robot-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-robot-door ((this cas-robot-door)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspawner-actor: ~A~%" (-> obj spawner-actor)) - (format #t "~2Tdoor-actor[2] @ #x~X~%" (-> obj door-actor)) - (format #t "~2Tspawn-count: ~D~%" (-> obj spawn-count)) - (format #t "~2Tspawn-count-total: ~D~%" (-> obj spawn-count-total)) - (format #t "~2Tspawn-max: ~D~%" (-> obj spawn-max)) - (format #t "~2Tspawn-total: ~D~%" (-> obj spawn-total)) - (format #t "~2Tnotice-dist: ~f~%" (-> obj notice-dist)) - (format #t "~2Tplayer-dist: ~f~%" (-> obj player-dist)) - (format #t "~2Tanim-index: ~D~%" (-> obj anim-index)) - (format #t "~2Tlast-guard: ~D~%" (-> obj last-guard)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tspawner-actor: ~A~%" (-> this spawner-actor)) + (format #t "~2Tdoor-actor[2] @ #x~X~%" (-> this door-actor)) + (format #t "~2Tspawn-count: ~D~%" (-> this spawn-count)) + (format #t "~2Tspawn-count-total: ~D~%" (-> this spawn-count-total)) + (format #t "~2Tspawn-max: ~D~%" (-> this spawn-max)) + (format #t "~2Tspawn-total: ~D~%" (-> this spawn-total)) + (format #t "~2Tnotice-dist: ~f~%" (-> this notice-dist)) + (format #t "~2Tplayer-dist: ~f~%" (-> this player-dist)) + (format #t "~2Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~2Tlast-guard: ~D~%" (-> this last-guard)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -2434,10 +2434,10 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.6)) + (when (time-elapsed? (-> self state-time) (seconds 0.6)) (let ((a0-1 *target*)) (if (and a0-1 (not (focus-test? a0-1 disable dead)) @@ -2446,7 +2446,7 @@ This commonly includes things such as: (go-virtual spawning) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) :code sleep-code @@ -2466,19 +2466,19 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self spawn-count) 0) (set! (-> self spawn-count-total) 0) (set! (-> self player-dist) (-> self notice-dist)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.6)) + (when (time-elapsed? (-> self state-time) (seconds 0.6)) (let ((a0-1 *target*)) (if (and a0-1 (not (logtest? (-> a0-1 focus-status) (focus-status disable dead)))) (set! (-> self player-dist) (vector-vector-distance (get-trans a0-1 0) (-> self root trans))) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) :code (behavior () @@ -2490,7 +2490,7 @@ This commonly includes things such as: (ja :num! (seek!)) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (suspend) ) ) @@ -2530,14 +2530,14 @@ This commonly includes things such as: ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (the int (* 300.0 (rand-vu-float-range 0.5 1.0)))) + (until (time-elapsed? gp-3 (the int (* 300.0 (rand-vu-float-range 0.5 1.0)))) (suspend) ) ) ) (while (> (-> self spawn-count) 0) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.43)) + (until (time-elapsed? gp-4 (seconds 0.43)) (suspend) ) ) @@ -2559,7 +2559,7 @@ This commonly includes things such as: ) ) (let ((gp-5 (current-time))) - (until (>= (- (current-time) gp-5) (seconds 2)) + (until (time-elapsed? gp-5 (seconds 2)) (suspend) ) ) @@ -2593,7 +2593,7 @@ This commonly includes things such as: ) ) (let ((gp-7 (current-time))) - (until (>= (- (current-time) gp-7) (seconds 1)) + (until (time-elapsed? gp-7 (seconds 1)) (suspend) ) ) @@ -2627,7 +2627,7 @@ This commonly includes things such as: (ja :num! (seek! 0.0)) ) (let ((gp-10 (current-time))) - (until (>= (- (current-time) gp-10) (seconds 1)) + (until (time-elapsed? gp-10 (seconds 1)) (suspend) ) ) @@ -2668,7 +2668,7 @@ This commonly includes things such as: (not v1-28) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.51)) + (until (time-elapsed? gp-1 (seconds 0.51)) (suspend) ) ) @@ -2682,7 +2682,7 @@ This commonly includes things such as: ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 1)) + (until (time-elapsed? gp-2 (seconds 1)) (suspend) ) ) @@ -2722,7 +2722,7 @@ This commonly includes things such as: ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 2.5)) + (until (time-elapsed? gp-3 (seconds 2.5)) (suspend) ) ) @@ -2737,7 +2737,7 @@ This commonly includes things such as: ;; definition for method 11 of type cas-robot-door ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cas-robot-door ((obj cas-robot-door) (arg0 entity-actor)) +(defmethod init-from-entity! cas-robot-door ((this cas-robot-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2745,7 +2745,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak hit-by-others-list player-list)) @@ -2760,54 +2760,54 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cas-robot-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj spawner-actor) (the-as symbol (entity-actor-lookup arg0 'alt-actor 0))) - (set! (-> obj door-actor 0) (entity-actor-lookup arg0 'alt-actor 1)) - (set! (-> obj door-actor 1) (entity-actor-lookup arg0 'alt-actor 2)) - (set! (-> obj spawn-max) 5) - (set! (-> obj spawn-total) -1) - (set! (-> obj last-guard) (the-as handle #f)) + (set! (-> this spawner-actor) (the-as symbol (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this door-actor 0) (entity-actor-lookup arg0 'alt-actor 1)) + (set! (-> this door-actor 1) (entity-actor-lookup arg0 'alt-actor 2)) + (set! (-> this spawn-max) 5) + (set! (-> this spawn-total) -1) + (set! (-> this last-guard) (the-as handle #f)) (set! sv-16 (new 'static 'res-tag)) (let ((v1-13 (res-lump-data arg0 'extra-id (pointer int32) :tag-ptr (& sv-16)))) (when v1-13 - (set! (-> obj spawn-max) (-> v1-13 0)) + (set! (-> this spawn-max) (-> v1-13 0)) (if (< (the-as uint 1) (-> sv-16 elt-count)) - (set! (-> obj spawn-total) (-> v1-13 1)) + (set! (-> this spawn-total) (-> v1-13 1)) ) ) ) - (set! (-> obj notice-dist) (res-lump-float arg0 'notice-dist :default 122880.0)) - (set! (-> obj anim-index) - (res-lump-value (-> obj entity) 'index int :default (the-as uint128 -1) :time -1000000000.0) + (set! (-> this notice-dist) (res-lump-float arg0 'notice-dist :default 122880.0)) + (set! (-> this anim-index) + (res-lump-value (-> this entity) 'index int :default (the-as uint128 -1) :time -1000000000.0) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-17 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (let ((v1-17 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-32)))) (cond ((and v1-17 (nonzero? (-> sv-32 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-17)) - (set! (-> obj actor-group-count) (the-as int (-> sv-32 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-17)) + (set! (-> this actor-group-count) (the-as int (-> sv-32 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (let ((a0-27 (-> obj skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-27 (-> this skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2826,17 +2826,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type lightning-ball -(defmethod inspect lightning-ball ((obj lightning-ball)) - (when (not obj) - (set! obj obj) +(defmethod inspect lightning-ball ((this lightning-ball)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttimer: ~D~%" (-> obj timer)) + (format #t "~2Ttimer: ~D~%" (-> this timer)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2865,7 +2865,7 @@ This commonly includes things such as: :virtual #t :code sleep-code :post (behavior () - (when (>= (- (current-time) (-> self timer)) (seconds 0.08)) + (when (time-elapsed? (-> self timer) (seconds 0.08)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((f30-1 (* 182.04445 (rand-vu-float-range -20.0 20.0))) (f28-1 (* 182.04445 (rand-vu-float-range -180.0 180.0))) @@ -2901,21 +2901,21 @@ This commonly includes things such as: ) ) ) - (set! (-> self timer) (current-time)) + (set-time! (-> self timer)) ) ) ) ;; definition for method 11 of type lightning-ball ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! lightning-ball ((obj lightning-ball) (arg0 entity-actor)) +(defmethod init-from-entity! lightning-ball ((this lightning-ball) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core action) (collide-action solid)) @@ -2928,11 +2928,11 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj timer) (current-time)) - (update-transforms (-> obj root)) - (go (method-of-object obj idle)) + (process-drawable-from-entity! this arg0) + (set-time! (-> this timer)) + (update-transforms (-> this root)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/castle/castle-part_REF.gc b/test/decompiler/reference/jak2/levels/castle/castle-part_REF.gc index fd427f6888..52588343af 100644 --- a/test/decompiler/reference/jak2/levels/castle/castle-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/castle-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type castle-part -(defmethod inspect castle-part ((obj castle-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect castle-part ((this castle-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 1ead0f62fa..d535f03db7 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 @@ -15,17 +15,17 @@ ) ;; definition for method 3 of type cpad-elevator -(defmethod inspect cpad-elevator ((obj cpad-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect cpad-elevator ((this cpad-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -35,25 +35,25 @@ ) ;; definition for method 30 of type cpad-elevator -(defmethod get-art-group cpad-elevator ((obj cpad-elevator)) +(defmethod get-art-group cpad-elevator ((this cpad-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-cpad-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 43 of type cpad-elevator -(defmethod move-between-points cpad-elevator ((obj cpad-elevator) (vec vector) (point-a float) (point-b float)) +(defmethod move-between-points cpad-elevator ((this cpad-elevator) (vec vector) (point-a float) (point-b float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((path-point-a (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) point-a 'interp)) - (path-point-b (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) point-b 'interp)) - (elevator-trans (-> obj root trans)) + (let ((path-point-a (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-a 'interp)) + (path-point-b (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-b 'interp)) + (elevator-trans (-> this root trans)) ) (when (and (< (-> path-point-b y) (-> path-point-a y)) (< (-> vec y) (+ -8192.0 (-> elevator-trans y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) vec elevator-trans))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 49152.0) (< (fabs (-> s4-2 z)) 49152.0)) ) ) @@ -61,7 +61,7 @@ ) ;; definition for method 45 of type cpad-elevator -(defmethod commited-to-ride? cpad-elevator ((obj cpad-elevator)) +(defmethod commited-to-ride? cpad-elevator ((this cpad-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((target *target*) (target-proc (if (type? target process-focusable) @@ -71,9 +71,9 @@ ) (when target-proc (let* ((target-pos (get-trans target-proc 0)) - (dist-from-center (vector-! (new 'stack-no-clear 'vector) target-pos (-> obj root trans))) + (dist-from-center (vector-! (new 'stack-no-clear 'vector) target-pos (-> this root trans))) ) - (vector-inv-orient-by-quat! dist-from-center dist-from-center (-> obj root quat)) + (vector-inv-orient-by-quat! dist-from-center dist-from-center (-> this root quat)) (and (< (fabs (-> dist-from-center x)) 40960.0) (< (fabs (-> dist-from-center z)) 40960.0)) ) ) @@ -82,10 +82,10 @@ ;; definition for method 49 of type cpad-elevator ;; WARN: Return type mismatch int vs none. -(defmethod configure-collision cpad-elevator ((obj cpad-elevator) (collide-with-jak? symbol)) +(defmethod configure-collision cpad-elevator ((this cpad-elevator) (collide-with-jak? symbol)) "Appropriately sets the collision on the elevator @param collide-with-jak? If set, the elevator will collide with Jak" - (let ((prim (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) + (let ((prim (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (collide-with-jak? (set! (-> prim prim-core collide-as) (collide-spec obstacle pusher)) @@ -126,7 +126,7 @@ ) :code (behavior () (let ((frame-counter (current-time))) - (until (>= (- (current-time) frame-counter) (seconds 1)) + (until (time-elapsed? frame-counter (seconds 1)) (suspend) ) ) @@ -159,49 +159,49 @@ ) ;; definition for method 40 of type cpad-elevator -(defmethod activate-elevator cpad-elevator ((obj cpad-elevator)) +(defmethod activate-elevator cpad-elevator ((this cpad-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (if (task-node-closed? (game-task-node dig-knock-down-introduction)) - (go (method-of-object obj arrived)) - (go (method-of-object obj dormant)) + (go (method-of-object this arrived)) + (go (method-of-object this dormant)) ) ) ;; definition for method 10 of type cpad-elevator -(defmethod deactivate cpad-elevator ((obj cpad-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method cpad-elevator 10)) obj) +(defmethod deactivate cpad-elevator ((this cpad-elevator)) + (sound-stop (-> this sound-id)) + ((the-as (function elevator none) (find-parent-method cpad-elevator 10)) this) (none) ) ;; definition for method 42 of type cpad-elevator ;; WARN: Return type mismatch ambient-sound vs none. -(defmethod set-ambient-sound! cpad-elevator ((obj cpad-elevator)) +(defmethod set-ambient-sound! cpad-elevator ((this cpad-elevator)) "Sets the elevator's [[ambient-sound]] up" - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "cpad-elevator-l" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "cpad-elevator-l" :fo-max 70) (-> this root trans)) ) (none) ) ;; definition for method 33 of type cpad-elevator ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! cpad-elevator ((obj cpad-elevator)) +(defmethod init-plat! cpad-elevator ((this cpad-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." - (let ((last-path-index (+ (-> obj path curve num-cverts) -1))) - (calc-dist-between-points! obj 0 last-path-index) - (calc-dist-between-points! obj last-path-index 0) + (let ((last-path-index (+ (-> this path curve num-cverts) -1))) + (calc-dist-between-points! this 0 last-path-index) + (calc-dist-between-points! this last-path-index 0) ) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this sound-id) (new-sound-id)) (none) ) ;; definition for method 31 of type cpad-elevator ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! cpad-elevator ((obj cpad-elevator)) +(defmethod init-plat-collision! cpad-elevator ((this cpad-elevator)) "TODO - collision stuff for setting up the platform" - (let ((cshape-moving (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape-moving dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape-moving reaction) cshape-reaction-default) (set! (-> cshape-moving no-reaction) @@ -234,7 +234,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> cshape-moving backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape-moving backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape-moving) + (set! (-> this root) cshape-moving) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/castle/pad/caspad-part_REF.gc b/test/decompiler/reference/jak2/levels/castle/pad/caspad-part_REF.gc index ba243f80d7..33b03cbc95 100644 --- a/test/decompiler/reference/jak2/levels/castle/pad/caspad-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/pad/caspad-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type caspad-part -(defmethod inspect caspad-part ((obj caspad-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect caspad-part ((this caspad-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc b/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc index f0efcb7db0..6a65b09e0f 100644 --- a/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/pad/castle-tasks_REF.gc @@ -19,7 +19,7 @@ (when (< (vector-vector-distance (target-pos 0) (-> self info end-sphere)) (-> self info end-sphere r)) (send-event (handle->process (-> self arrow)) 'leave) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.007)) + (until (time-elapsed? gp-2 (seconds 0.007)) (suspend) ) ) 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 fdbdfc90ab..9d50333dfd 100644 --- a/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/castle/roboguard-level_REF.gc @@ -33,25 +33,25 @@ ) ;; definition for method 3 of type roboguard-level -(defmethod inspect roboguard-level ((obj roboguard-level)) - (when (not obj) - (set! obj obj) +(defmethod inspect roboguard-level ((this roboguard-level)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tmove-dest: #~%" (-> obj move-dest)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Troll-timer: ~D~%" (-> obj roll-timer)) - (format #t "~2Troll-dir: #~%" (-> obj roll-dir)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tturning-acc: ~f~%" (-> obj turning-acc)) - (format #t "~2Tspeed: ~f~%" (-> obj speed)) - (format #t "~2Troll-attack-count: ~D~%" (-> obj roll-attack-count)) - (format #t "~2Troll-sound: ~D~%" (-> obj roll-sound)) + (format #t "~2Tmove-dest: #~%" (-> this move-dest)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Troll-timer: ~D~%" (-> this roll-timer)) + (format #t "~2Troll-dir: #~%" (-> this roll-dir)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tturning-acc: ~f~%" (-> this turning-acc)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Troll-attack-count: ~D~%" (-> this roll-attack-count)) + (format #t "~2Troll-sound: ~D~%" (-> this roll-sound)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -509,7 +509,7 @@ ) :post (behavior () (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) (ja-post) @@ -606,7 +606,7 @@ ) 0 (logior! (-> self focus-status) (focus-status dangerous)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (roboguard-level-method-185 self (the-as symbol 1)) (vector-z-quaternion! (-> self roll-dir) (-> self root quat)) (set! (-> self roll-timer) 0) @@ -781,8 +781,8 @@ ) ;; definition for method 70 of type roboguard-level -(defmethod go-hostile roboguard-level ((obj roboguard-level)) - (go (method-of-object obj roll-enter)) +(defmethod go-hostile roboguard-level ((this roboguard-level)) + (go (method-of-object this roll-enter)) ) ;; failed to figure out what this is: @@ -863,8 +863,8 @@ ;; definition for method 185 of type roboguard-level ;; WARN: Return type mismatch int vs none. -(defmethod roboguard-level-method-185 roboguard-level ((obj roboguard-level) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim)) +(defmethod roboguard-level-method-185 roboguard-level ((this roboguard-level) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim)) (a0-1 arg0) ) (cond @@ -930,33 +930,33 @@ ) ;; definition for method 77 of type roboguard-level -(defmethod enemy-method-77 roboguard-level ((obj roboguard-level) (arg0 (pointer float))) +(defmethod enemy-method-77 roboguard-level ((this roboguard-level) (arg0 (pointer float))) (ja-channel-push! 1 0) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-0) (knocked-type knocked-type-1) (knocked-type knocked-type-4) (knocked-type knocked-type-6) ) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 21)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) ) ) (else - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) (-> arg0 0)) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) ) ) @@ -964,32 +964,32 @@ ) ;; definition for method 78 of type roboguard-level -(defmethod enemy-method-78 roboguard-level ((obj roboguard-level) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 roboguard-level ((this roboguard-level) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-0) (knocked-type knocked-type-1) (knocked-type knocked-type-4) (knocked-type knocked-type-6) ) - (let ((v1-4 (-> obj skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> v1-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> v1-4 param 1) (-> arg0 0)) (set! (-> v1-4 frame-num) 0.0) - (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) ) (else - (let ((v1-8 (-> obj skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 24))) + (let ((v1-8 (-> this skel root-channel 0))) + (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 24))) (set! (-> v1-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 24)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 24)) frames num-frames) -1)) ) (set! (-> v1-8 param 1) (-> arg0 0)) (set! (-> v1-8 frame-num) 0.0) - (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> obj draw art-group data 24)) num-func-seek!) + (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> this draw art-group data 24)) num-func-seek!) ) ) ) @@ -998,43 +998,43 @@ ;; definition for method 74 of type roboguard-level ;; INFO: Used lq/sq -(defmethod general-event-handler roboguard-level ((obj roboguard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler roboguard-level ((this roboguard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) (cond - ((logtest? (-> obj flags) 4) + ((logtest? (-> this flags) 4) (let ((v1-3 (the-as object (-> arg3 param 1))) (a0-2 arg0) ) (cond - ((!= (-> (the-as attack-info v1-3) id) (-> obj incoming-attack-id)) - (set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-3) id)) + ((!= (-> (the-as attack-info v1-3) id) (-> this incoming-attack-id)) + (set! (-> this incoming-attack-id) (-> (the-as attack-info v1-3) id)) (when (and a0-2 (not (logtest? (process-mask enemy) (-> a0-2 mask)))) (let ((s5-0 (find-offending-process-focusable a0-2 (the-as attack-info v1-3)))) (when s5-0 (new 'stack-no-clear 'vector) (set! (-> (new 'stack-no-clear 'vector) quad) (-> s5-0 root trans quad)) - (if (< (-> obj roll-attack-count) (the-as uint 3)) - (+! (-> obj roll-attack-count) 1) + (if (< (-> this roll-attack-count) (the-as uint 3)) + (+! (-> this roll-attack-count) 1) ) - (vector-! (-> obj roll-dir) (-> obj root trans) (-> s5-0 root trans)) - (set! (-> obj roll-dir y) 0.0) - (vector-xz-normalize! (-> obj roll-dir) 1.0) - (set! (-> obj speed) (+ 245760.0 (vector-length (-> s5-0 root transv)))) - (let ((a0-9 (-> obj nav state)) - (v1-19 (vector-float*! (new 'stack-no-clear 'vector) (-> obj roll-dir) (-> obj speed))) + (vector-! (-> this roll-dir) (-> this root trans) (-> s5-0 root trans)) + (set! (-> this roll-dir y) 0.0) + (vector-xz-normalize! (-> this roll-dir) 1.0) + (set! (-> this speed) (+ 245760.0 (vector-length (-> s5-0 root transv)))) + (let ((a0-9 (-> this nav state)) + (v1-19 (vector-float*! (new 'stack-no-clear 'vector) (-> this roll-dir) (-> this speed))) ) (set! (-> a0-9 velocity quad) (-> v1-19 quad)) ) 0 - (let ((v1-23 (-> obj nav state))) - (set! (-> v1-23 speed) (-> obj speed)) + (let ((v1-23 (-> this nav state))) + (set! (-> v1-23 speed) (-> this speed)) ) 0 - (let ((v1-25 (-> obj nav))) - (set! (-> v1-25 target-speed) (-> obj speed)) + (let ((v1-25 (-> this nav))) + (set! (-> v1-25 target-speed) (-> this speed)) ) 0 (sound-play "robo-ball-kick") @@ -1050,14 +1050,14 @@ ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('hit 'hit-knocked 'hit-flinch) - (when (not (logtest? (-> obj flags) 4)) + (when (not (logtest? (-> this flags) 4)) (let ((s5-2 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> s5-2 fountain-rand-transv-lo quad) (-> obj incoming attacker-pos quad)) + (set! (-> s5-2 fountain-rand-transv-lo quad) (-> this incoming attacker-pos quad)) (set! (-> s5-2 fountain-rand-transv-hi x) 4096.0) (set! (-> s5-2 fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -1066,15 +1066,15 @@ 31 s5-2 *roboguard-level-exploder-params* - :to obj + :to this ) ) - (dispose! obj) - (go (method-of-object obj explode)) + (dispose! this) + (go (method-of-object this explode)) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -1082,7 +1082,7 @@ ;; definition for method 76 of type roboguard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 roboguard-level ((obj roboguard-level) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 roboguard-level ((this roboguard-level) (arg0 process) (arg1 event-message-block)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1094,8 +1094,8 @@ (the-as symbol (cond - ((or (= (-> arg0 type) target) (not (logtest? (-> obj flags) 4))) - ((method-of-type nav-enemy enemy-method-76) obj arg0 arg1) + ((or (= (-> arg0 type) target) (not (logtest? (-> this flags) 4))) + ((method-of-type nav-enemy enemy-method-76) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -1108,7 +1108,7 @@ ) (when (and s1-0 (logtest? (process-mask enemy) (-> s1-0 mask))) (let ((s2-1 - (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> (the-as process-drawable s1-0) root trans)) + (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> (the-as process-drawable s1-0) root trans)) ) ) (new 'stack-no-clear 'vector) @@ -1116,10 +1116,10 @@ (let ((s3-1 (new 'stack-no-clear 'vector))) (vector-normalize! s2-1 1.0) (let ((f0-3 - (- (vector-dot (-> obj root transv) s2-1) (vector-dot (-> (the-as process-drawable s1-0) root transv) s2-1)) + (- (vector-dot (-> this root transv) s2-1) (vector-dot (-> (the-as process-drawable s1-0) root transv) s2-1)) ) ) - (let ((a1-5 (-> obj nav state))) + (let ((a1-5 (-> this nav state))) (set! (-> s3-1 quad) (-> a1-5 velocity quad)) ) (let ((a0-16 s3-1)) @@ -1136,34 +1136,34 @@ (.svf (&-> a0-16 quad) vf6) ) ) - (let ((a0-17 (-> obj nav state)) + (let ((a0-17 (-> this nav state)) (v1-22 s3-1) ) (set! (-> a0-17 velocity quad) (-> v1-22 quad)) ) 0 - (set! (-> obj speed) (vector-length s3-1)) - (let ((v1-28 (-> obj nav state))) - (set! (-> v1-28 speed) (-> obj speed)) + (set! (-> this speed) (vector-length s3-1)) + (let ((v1-28 (-> this nav state))) + (set! (-> v1-28 speed) (-> this speed)) ) 0 - (let ((v1-30 (-> obj nav))) - (set! (-> v1-30 target-speed) (-> obj speed)) + (let ((v1-30 (-> this nav))) + (set! (-> v1-30 target-speed) (-> this speed)) ) 0 - (set! (-> obj roll-timer) (+ (current-time) (the int (* 300.0 (get-rand-float-range obj 3.0 5.0))))) - (set! (-> obj roll-dir quad) (-> s3-1 quad)) + (set! (-> this roll-timer) (+ (current-time) (the int (* 300.0 (get-rand-float-range this 3.0 5.0))))) + (set! (-> this roll-dir quad) (-> s3-1 quad)) ) ) - (set! (-> obj roll-dir y) 0.0) - (vector-xz-normalize! (-> obj roll-dir) 1.0) - (let ((a0-22 (-> obj nav state)) - (v1-40 (-> obj roll-dir)) + (set! (-> this roll-dir y) 0.0) + (vector-xz-normalize! (-> this roll-dir) 1.0) + (let ((a0-22 (-> this nav state)) + (v1-40 (-> this roll-dir)) ) (set! (-> a0-22 heading quad) (-> v1-40 quad)) ) 0 - (logior! (-> obj flags) 64) + (logior! (-> this flags) 64) ) ) (send-event arg0 'touch (-> arg1 param 0)) @@ -1177,7 +1177,7 @@ ;; definition for method 142 of type roboguard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 roboguard-level ((obj roboguard-level) (arg0 nav-control)) +(defmethod nav-enemy-method-142 roboguard-level ((this roboguard-level) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s3-0 quad) (-> a1-1 heading quad)) @@ -1185,7 +1185,7 @@ (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (let ((gp-0 (new 'stack-no-clear 'quaternion)) - (s5-1 (-> obj root quat)) + (s5-1 (-> this root quat)) ) (quaternion-set! gp-0 0.0 (-> s3-0 x) 0.0 (+ 1.0 (-> s3-0 z))) (quaternion-normalize! gp-0) @@ -1204,59 +1204,59 @@ ;; definition for method 176 of type roboguard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-176 roboguard-level ((obj roboguard-level)) - (nav-enemy-method-177 obj) - (let ((a0-2 obj)) +(defmethod nav-enemy-method-176 roboguard-level ((this roboguard-level)) + (nav-enemy-method-177 this) + (let ((a0-2 this)) (when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags)) (cond - ((logtest? (enemy-flag enemy-flag38) (-> obj enemy-flags)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag38)))) - (set! (-> obj root gspot-pos quad) (-> obj root trans quad)) + ((logtest? (enemy-flag enemy-flag38) (-> this enemy-flags)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag38)))) + (set! (-> this root gspot-pos quad) (-> this root trans quad)) ) (else - (nav-enemy-method-142 obj (-> obj nav)) - (nav-enemy-method-143 obj (-> obj nav)) + (nav-enemy-method-142 this (-> this nav)) + (nav-enemy-method-143 this (-> this nav)) ) ) ) ) - (track-target! obj) - (update-transforms (-> obj root)) + (track-target! this) + (update-transforms (-> this root)) 0 (none) ) ;; definition for method 132 of type roboguard-level -(defmethod dispose! roboguard-level ((obj roboguard-level)) +(defmethod dispose! roboguard-level ((this roboguard-level)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) - (send-event (ppointer->process (-> obj parent)) 'roboguard-die) - ((method-of-type nav-enemy dispose!) obj) + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) + (send-event (ppointer->process (-> this parent)) 'roboguard-die) + ((method-of-type nav-enemy dispose!) this) ) (none) ) ;; definition for method 10 of type roboguard-level -(defmethod deactivate roboguard-level ((obj roboguard-level)) - (sound-stop (-> obj roll-sound)) - ((the-as (function nav-enemy none) (find-parent-method roboguard-level 10)) obj) +(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) (none) ) ;; definition for method 7 of type roboguard-level ;; WARN: Return type mismatch nav-enemy vs roboguard-level. -(defmethod relocate roboguard-level ((obj roboguard-level) (arg0 int)) +(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)) obj arg0) + ((the-as (function nav-enemy int nav-enemy) (find-parent-method roboguard-level 7)) this arg0) ) ) ;; definition for method 114 of type roboguard-level ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! roboguard-level ((obj roboguard-level)) +(defmethod init-enemy-collision! roboguard-level ((this roboguard-level)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1306,7 +1306,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1314,26 +1314,26 @@ ;; definition for method 115 of type roboguard-level ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! roboguard-level ((obj roboguard-level)) +(defmethod init-enemy! roboguard-level ((this roboguard-level)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-roboguard-level" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> obj enemy-flags)))) - (init-enemy-behaviour-and-stats! obj *roboguard-level-nav-enemy-info*) - (let ((v1-8 (-> obj nav))) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> this enemy-flags)))) + (init-enemy-behaviour-and-stats! this *roboguard-level-nav-enemy-info*) + (let ((v1-8 (-> this nav))) (set! (-> v1-8 nav-cull-radius) 81920.0) ) 0 - (set! (-> obj fact cam-horz) 98304.0) - (set! (-> obj fact cam-vert) 24576.0) - (set! (-> obj fact cam-notice-dist) 122880.0) - (let ((v1-16 (-> obj nav))) + (set! (-> this fact cam-horz) 98304.0) + (set! (-> this fact cam-vert) 24576.0) + (set! (-> this fact cam-notice-dist) 122880.0) + (let ((v1-16 (-> this nav))) (logclear! (-> v1-16 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43)))) (let ((a0-13 v1-16)) (set! (-> a0-13 sphere-mask) (the-as uint #x800fe)) ) @@ -1344,8 +1344,8 @@ 0 (logclear! (-> v1-16 flags) (nav-control-flag output-sphere-hash)) ) - (set! (-> obj enemy-info callback-info) *nav-enemy-physics-callback-info*) - (let ((v1-18 obj)) + (set! (-> this enemy-info callback-info) *nav-enemy-physics-callback-info*) + (let ((v1-18 this)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-18 enemy-flags))) (set! (-> v1-18 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-18 enemy-flags)))) ) @@ -1353,8 +1353,8 @@ (set! (-> v1-18 nav callback-info) (-> v1-18 enemy-info callback-info)) ) 0 - (set! (-> obj roll-sound) (new-sound-id)) - (set! (-> obj flags) (the-as uint 0)) + (set! (-> this roll-sound) (new-sound-id)) + (set! (-> this flags) (the-as uint 0)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot-h_REF.gc b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot-h_REF.gc index ff4584a0d8..d75df10457 100644 --- a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot-h_REF.gc @@ -15,19 +15,19 @@ ) ;; definition for method 3 of type bombbot-node -(defmethod inspect bombbot-node ((obj bombbot-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect bombbot-node ((this bombbot-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bombbot-node) - (format #t "~1Tposition: ~`vector`P~%" (-> obj position)) - (format #t "~1Tnav-mesh-id: ~D~%" (-> obj nav-mesh-id)) - (format #t "~1Tpos-x: ~f~%" (-> obj position x)) - (format #t "~1Tpos-y: ~f~%" (-> obj position y)) - (format #t "~1Tpos-z: ~f~%" (-> obj position z)) + (format #t "[~8x] ~A~%" this 'bombbot-node) + (format #t "~1Tposition: ~`vector`P~%" (-> this position)) + (format #t "~1Tnav-mesh-id: ~D~%" (-> this nav-mesh-id)) + (format #t "~1Tpos-x: ~f~%" (-> this position x)) + (format #t "~1Tpos-y: ~f~%" (-> this position y)) + (format #t "~1Tpos-z: ~f~%" (-> this position z)) (label cfg-4) - obj + this ) ;; definition of type bombbot-path @@ -41,16 +41,16 @@ ) ;; definition for method 3 of type bombbot-path -(defmethod inspect bombbot-path ((obj bombbot-path)) - (when (not obj) - (set! obj obj) +(defmethod inspect bombbot-path ((this bombbot-path)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bombbot-path) - (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) - (format #t "~1Tnode: #x~X~%" (-> obj node)) + (format #t "[~8x] ~A~%" this 'bombbot-path) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tnode: #x~X~%" (-> this node)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 669e610aa7..d4f2dcae31 100644 --- a/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/bombbot/bombbot_REF.gc @@ -532,24 +532,24 @@ ) ;; definition for method 3 of type bombbot-foot -(defmethod inspect bombbot-foot ((obj bombbot-foot)) - (when (not obj) - (set! obj obj) +(defmethod inspect bombbot-foot ((this bombbot-foot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bombbot-foot) - (format #t "~1Tpos-offset: #~%" (-> obj pos-offset)) - (format #t "~1Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~1Toffset: ~f~%" (-> obj offset)) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tnext-position: #~%" (-> obj next-position)) - (format #t "~1Treal-position: #~%" (-> obj real-position)) - (format #t "~1Tspeed: #~%" (-> obj speed)) - (format #t "~1Tmoving: ~A~%" (-> obj moving)) - (format #t "~1Tmain-y: ~f~%" (-> obj main-y)) - (format #t "~1Tdelta-y: ~f~%" (-> obj delta-y)) + (format #t "[~8x] ~A~%" this 'bombbot-foot) + (format #t "~1Tpos-offset: #~%" (-> this pos-offset)) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tnext-position: #~%" (-> this next-position)) + (format #t "~1Treal-position: #~%" (-> this real-position)) + (format #t "~1Tspeed: #~%" (-> this speed)) + (format #t "~1Tmoving: ~A~%" (-> this moving)) + (format #t "~1Tmain-y: ~f~%" (-> this main-y)) + (format #t "~1Tdelta-y: ~f~%" (-> this delta-y)) (label cfg-4) - obj + this ) ;; definition of type bombbot @@ -612,57 +612,57 @@ ) ;; definition for method 3 of type bombbot -(defmethod inspect bombbot ((obj bombbot)) - (when (not obj) - (set! obj obj) +(defmethod inspect bombbot ((this bombbot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tjoint-ik[4] @ #x~X~%" (-> obj joint-ik)) - (format #t "~2Tfeet[4] @ #x~X~%" (-> obj feet)) - (format #t "~2Tlegs-strength[4] @ #x~X~%" (-> obj legs-strength)) - (format #t "~2Tlast-trans: #~%" (-> obj last-trans)) - (format #t "~2Tlinear-speed: #~%" (-> obj linear-speed)) - (format #t "~2Tlast-quat: #~%" (-> obj last-quat)) - (format #t "~2Ty-angular-velocity: ~f~%" (-> obj y-angular-velocity)) - (format #t "~2Tmain-quat: #~%" (-> obj main-quat)) - (format #t "~2Tmain-spd-y: ~f~%" (-> obj main-spd-y)) - (format #t "~2Tmain-pos-y: ~f~%" (-> obj main-pos-y)) - (format #t "~2Tmain-pos: #~%" (-> obj main-pos)) - (format #t "~2Tcity-path: #~%" (-> obj city-path)) - (format #t "~2Tcurrent-node: ~D~%" (-> obj current-node)) - (format #t "~2Tshot-count: ~D~%" (-> obj shot-count)) - (format #t "~2Tnext-shoot: ~D~%" (-> obj next-shoot)) - (format #t "~2Tstop-shoot: ~D~%" (-> obj stop-shoot)) - (format #t "~2Tnext-target: ~D~%" (-> obj next-target)) - (format #t "~2Tstart-target: ~D~%" (-> obj start-target)) - (format #t "~2Tbeep-time: ~D~%" (-> obj beep-time)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Tstart-target-pos: #~%" (-> obj start-target-pos)) - (format #t "~2Tstart-target-vel: #~%" (-> obj start-target-vel)) - (format #t "~2Ttop-quat: #~%" (-> obj top-quat)) - (format #t "~2Tgun-swivel-quat: #~%" (-> obj gun-swivel-quat)) - (format #t "~2Tgun-quat: #~%" (-> obj gun-quat)) - (format #t "~2Tangle-turret: ~f~%" (-> obj angle-turret)) - (format #t "~2Tangle-gun: ~f~%" (-> obj angle-gun)) - (format #t "~2Thigh: ~f~%" (-> obj high)) - (format #t "~2Tshield-hit-points: ~f~%" (-> obj shield-hit-points)) - (format #t "~2Thit-axis: #~%" (-> obj hit-axis)) - (format #t "~2Trigidbody: ~A~%" (-> obj rigidbody)) - (format #t "~2Tinfo: #~%" (-> obj info)) - (format #t "~2Texplosing: ~A~%" (-> obj explosing)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) - (format #t "~2Tlazer-sound: ~D~%" (-> obj lazer-sound)) - (format #t "~2Thead-sound: ~D~%" (-> obj head-sound)) - (format #t "~2Tcannon-sound: ~D~%" (-> obj cannon-sound)) - (format #t "~2Tlast-head-roty-speed: ~f~%" (-> obj last-head-roty-speed)) - (format #t "~2Thead-roty-speed: ~f~%" (-> obj head-roty-speed)) - (format #t "~2Tlast-cannon-roty-speed: ~f~%" (-> obj last-cannon-roty-speed)) - (format #t "~2Tcannon-roty-speed: ~f~%" (-> obj cannon-roty-speed)) + (format #t "~2Tjoint-ik[4] @ #x~X~%" (-> this joint-ik)) + (format #t "~2Tfeet[4] @ #x~X~%" (-> this feet)) + (format #t "~2Tlegs-strength[4] @ #x~X~%" (-> this legs-strength)) + (format #t "~2Tlast-trans: #~%" (-> this last-trans)) + (format #t "~2Tlinear-speed: #~%" (-> this linear-speed)) + (format #t "~2Tlast-quat: #~%" (-> this last-quat)) + (format #t "~2Ty-angular-velocity: ~f~%" (-> this y-angular-velocity)) + (format #t "~2Tmain-quat: #~%" (-> this main-quat)) + (format #t "~2Tmain-spd-y: ~f~%" (-> this main-spd-y)) + (format #t "~2Tmain-pos-y: ~f~%" (-> this main-pos-y)) + (format #t "~2Tmain-pos: #~%" (-> this main-pos)) + (format #t "~2Tcity-path: #~%" (-> this city-path)) + (format #t "~2Tcurrent-node: ~D~%" (-> this current-node)) + (format #t "~2Tshot-count: ~D~%" (-> this shot-count)) + (format #t "~2Tnext-shoot: ~D~%" (-> this next-shoot)) + (format #t "~2Tstop-shoot: ~D~%" (-> this stop-shoot)) + (format #t "~2Tnext-target: ~D~%" (-> this next-target)) + (format #t "~2Tstart-target: ~D~%" (-> this start-target)) + (format #t "~2Tbeep-time: ~D~%" (-> this beep-time)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tstart-target-pos: #~%" (-> this start-target-pos)) + (format #t "~2Tstart-target-vel: #~%" (-> this start-target-vel)) + (format #t "~2Ttop-quat: #~%" (-> this top-quat)) + (format #t "~2Tgun-swivel-quat: #~%" (-> this gun-swivel-quat)) + (format #t "~2Tgun-quat: #~%" (-> this gun-quat)) + (format #t "~2Tangle-turret: ~f~%" (-> this angle-turret)) + (format #t "~2Tangle-gun: ~f~%" (-> this angle-gun)) + (format #t "~2Thigh: ~f~%" (-> this high)) + (format #t "~2Tshield-hit-points: ~f~%" (-> this shield-hit-points)) + (format #t "~2Thit-axis: #~%" (-> this hit-axis)) + (format #t "~2Trigidbody: ~A~%" (-> this rigidbody)) + (format #t "~2Tinfo: #~%" (-> this info)) + (format #t "~2Texplosing: ~A~%" (-> this explosing)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tlazer-sound: ~D~%" (-> this lazer-sound)) + (format #t "~2Thead-sound: ~D~%" (-> this head-sound)) + (format #t "~2Tcannon-sound: ~D~%" (-> this cannon-sound)) + (format #t "~2Tlast-head-roty-speed: ~f~%" (-> this last-head-roty-speed)) + (format #t "~2Thead-roty-speed: ~f~%" (-> this head-roty-speed)) + (format #t "~2Tlast-cannon-roty-speed: ~f~%" (-> this last-cannon-roty-speed)) + (format #t "~2Tcannon-roty-speed: ~f~%" (-> this cannon-roty-speed)) (label cfg-4) - obj + this ) ;; definition for symbol *bombbot-nav-enemy-info*, type nav-enemy-info @@ -788,17 +788,16 @@ ) ;; definition for method 3 of type ik-setup -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect ik-setup ((obj ik-setup)) - (when (not obj) - (set! obj obj) +(defmethod inspect ik-setup ((this ik-setup)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ik-setup) - (format #t "~1Telbow-index: ~D~%" (-> obj elbow-index)) - (format #t "~1Thand-dist: ~f~%" (-> obj hand-dist)) + (format #t "[~8x] ~A~%" this 'ik-setup) + (format #t "~1Telbow-index: ~D~%" (-> this elbow-index)) + (format #t "~1Thand-dist: ~f~%" (-> this hand-dist)) (label cfg-4) - obj + this ) ;; definition for symbol *bombbot-ik-setup*, type (array ik-setup) @@ -881,11 +880,11 @@ ;; definition for method 180 of type bombbot ;; INFO: Used lq/sq -(defmethod bombbot-method-180 bombbot ((obj bombbot)) +(defmethod bombbot-method-180 bombbot ((this bombbot)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) - (set! (-> a1-0 sphere quad) (-> obj root trans quad)) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> obj root transv quad)) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) (vector-reset! (-> a1-0 velocity)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) @@ -918,7 +917,7 @@ ;; ERROR: Stack slot load at 896 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 912 mismatch: defined as size 4, got size 16 ;; WARN: Return type mismatch int vs none. -(defmethod bombbot-method-179 bombbot ((obj bombbot)) +(defmethod bombbot-method-179 bombbot ((this bombbot)) (local-vars (at-0 int) (sv-864 vector) @@ -942,7 +941,7 @@ (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 (-> s5-0 bbox)) - (a0-2 (-> obj root trans)) + (a0-2 (-> this root trans)) (a1-0 (new 'stack-no-clear 'vector)) ) (set! (-> a1-0 x) 24576.0) @@ -952,7 +951,7 @@ (vector-! (the-as vector v1-0) a0-2 a1-0) ) (let ((v1-2 (-> s5-0 bbox max)) - (a0-4 (-> obj root trans)) + (a0-4 (-> this root trans)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 x) 24576.0) @@ -967,28 +966,28 @@ (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (fill-using-bounding-box *collide-cache* s5-0) (dotimes (s4-0 4) - (-> obj joint-ik s4-0 shoulder-matrix-no-ik) - (-> obj joint-ik s4-0 elbow-matrix-no-ik) + (-> this joint-ik s4-0 shoulder-matrix-no-ik) + (-> this joint-ik s4-0 elbow-matrix-no-ik) (new 'stack-no-clear 'vector) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> obj node-list data 3 bone transform vector 1 quad)) + (set! (-> s2-0 quad) (-> this node-list data 3 bone transform vector 1 quad)) (new 'stack-no-clear 'vector) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((f30-0 0.4)) (vector-normalize! s2-0 1.0) - (let ((s1-0 (-> obj feet s4-0))) + (let ((s1-0 (-> this feet s4-0))) (let* ((f0-10 (+ (* 0.0033333334 (the float (mod (current-time) 300))) (-> s1-0 offset))) (f28-0 (- f0-10 (* (the float (the int (/ f0-10 1.0))) 1.0))) (s0-0 (new 'stack-no-clear 'vector)) ) (cond ((>= f30-0 f28-0) - (vector-orient-by-quat! s3-0 (-> s1-0 pos-offset) (-> obj root quat)) + (vector-orient-by-quat! s3-0 (-> s1-0 pos-offset) (-> this root quat)) (let ((f26-0 (- f30-0 f28-0))) (set! sv-880 s0-0) (set! sv-864 (new 'stack-no-clear 'vector)) (set! (-> sv-864 x) 0.0) - (set! (-> sv-864 y) (sin (* (-> obj y-angular-velocity) (-> pp clock frames-per-second)))) + (set! (-> sv-864 y) (sin (* (-> this y-angular-velocity) (-> pp clock frames-per-second)))) (set! (-> sv-864 z) 0.0) (set! (-> sv-864 w) 1.0) (let ((v1-39 s3-0)) @@ -1002,7 +1001,7 @@ (v1-41 s0-0) (a0-11 (new 'stack-no-clear 'vector)) ) - (.lvf vf1 (&-> (-> obj linear-speed) quad)) + (.lvf vf1 (&-> (-> this linear-speed) quad)) (let ((f0-17 (-> pp clock frames-per-second))) (.mov at-0 f0-17) ) @@ -1043,7 +1042,7 @@ (.svf (&-> a1-8 quad) vf6) ) ) - (vector+! s3-0 s3-0 (-> obj root trans)) + (vector+! s3-0 s3-0 (-> this root trans)) (let ((a1-11 (-> s5-0 start-pos))) (let ((v1-45 s3-0)) (let ((a0-17 s2-0)) @@ -1158,7 +1157,7 @@ (let ((s0-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s0-2 (let ((t9-11 (method-of-type part-tracker activate))) - (t9-11 (the-as part-tracker s0-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-11 (the-as part-tracker s0-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-12 run-function-in-process) (a0-39 s0-2) @@ -1252,15 +1251,15 @@ (let ((f0-64 (- (-> s3-0 y) (-> s0-4 y)))) (lerp-scale 1.0 0.0 f0-64 0.0 8192.0) ) - (- (-> s0-4 y) (-> obj root trans y)) - (vector-dot s2-0 (vector-! (new 'stack-no-clear 'vector) s0-4 (-> obj root trans))) + (- (-> s0-4 y) (-> this root trans y)) + (vector-dot s2-0 (vector-! (new 'stack-no-clear 'vector) s0-4 (-> this root trans))) ) ) ) (set! (-> s1-0 real-position quad) (-> s3-0 quad)) ) ) - (handle-copy! (-> obj joint-ik s4-0) s3-0) + (handle-copy! (-> this joint-ik s4-0) s3-0) ) ) ) @@ -1274,46 +1273,46 @@ ;; definition for method 55 of type bombbot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! bombbot ((obj bombbot)) +(defmethod track-target! bombbot ((this bombbot)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (local-vars (sv-16 sparticle-launcher) (sv-20 sparticle-launcher)) (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) (cond - ((= (-> obj nav state mesh) *default-nav-mesh*) + ((= (-> this nav state mesh) *default-nav-mesh*) (dotimes (s5-0 4) - (enable-set! (-> obj joint-ik s5-0) #f) + (enable-set! (-> this joint-ik s5-0) #f) ) ) (else - (bombbot-method-179 obj) + (bombbot-method-179 this) (dotimes (s5-1 4) - (enable-set! (-> obj joint-ik s5-1) #t) + (enable-set! (-> this joint-ik s5-1) #t) ) ) ) - (vector-! (-> obj linear-speed) (-> obj root trans) (-> obj last-trans)) - (set! (-> obj last-trans quad) (-> obj root trans quad)) - (set! (-> obj y-angular-velocity) - (deg- (quaternion-y-angle (-> obj root quat)) (quaternion-y-angle (-> obj last-quat))) + (vector-! (-> this linear-speed) (-> this root trans) (-> this last-trans)) + (set! (-> this last-trans quad) (-> this root trans quad)) + (set! (-> this y-angular-velocity) + (deg- (quaternion-y-angle (-> this root quat)) (quaternion-y-angle (-> this last-quat))) ) - (quaternion-copy! (-> obj last-quat) (-> obj root quat)) - (set! (-> obj rigidbody state force-callback) - (the-as (function object float none) (method-of-object obj bombbot-method-183)) + (quaternion-copy! (-> this last-quat) (-> this root quat)) + (set! (-> this rigidbody state force-callback) + (the-as (function object float none) (method-of-object this bombbot-method-183)) ) - (bombbot-method-184 obj) + (bombbot-method-184 this) (set! sv-16 (the-as sparticle-launcher #f)) (set! sv-20 (the-as sparticle-launcher #f)) (cond - ((< (-> obj hit-points) 30) + ((< (-> this hit-points) 30) (set! sv-16 (-> *part-id-table* 778)) (set! sv-20 (-> *part-id-table* 774)) ) - ((< (-> obj hit-points) 60) + ((< (-> this hit-points) 60) (set! sv-16 (-> *part-id-table* 781)) ) (else @@ -1323,7 +1322,7 @@ ) ) (when sv-16 - (let ((gp-1 (-> obj node-list data 4 bone transform)) + (let ((gp-1 (-> this node-list data 4 bone transform)) (s5-3 (new 'stack-no-clear 'vector)) ) (dotimes (s4-1 2) @@ -1365,31 +1364,31 @@ ) ;; definition for method 12 of type bombbot -(defmethod run-logic? bombbot ((obj bombbot)) +(defmethod run-logic? bombbot ((this bombbot)) #t ) ;; definition for method 58 of type bombbot -(defmethod enemy-method-58 bombbot ((obj bombbot) (arg0 process) (arg1 event-message-block)) - ((method-of-type nav-enemy enemy-method-58) obj arg0 arg1) +(defmethod enemy-method-58 bombbot ((this bombbot) (arg0 process) (arg1 event-message-block)) + ((method-of-type nav-enemy enemy-method-58) this arg0 arg1) 'hit-flinch ) ;; definition for method 56 of type bombbot -(defmethod damage-amount-from-attack bombbot ((obj bombbot) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack bombbot ((this bombbot) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (-> arg1 param 1) - (let ((f0-1 (the float (penetrate-using->damage (the-as penetrate (-> obj incoming penetrate-using)))))) + (let ((f0-1 (the float (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using)))))) (cond - ((logtest? #xc0000 (-> obj incoming penetrate-using)) - (if (and (logtest? #x40000 (-> obj incoming penetrate-using)) - (logtest? #x80000 (-> obj incoming penetrate-using)) + ((logtest? #xc0000 (-> this incoming penetrate-using)) + (if (and (logtest? #x40000 (-> this incoming penetrate-using)) + (logtest? #x80000 (-> this incoming penetrate-using)) ) #x42c80000 (the int (* 1.8 f0-1)) ) ) - ((logtest? #x20000 (-> obj incoming penetrate-using)) + ((logtest? #x20000 (-> this incoming penetrate-using)) (the int (* 2.0 f0-1)) ) (else @@ -1401,20 +1400,20 @@ ;; definition for method 74 of type bombbot ;; INFO: Used lq/sq -(defmethod general-event-handler bombbot ((obj bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler bombbot ((this bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('nav-mesh-kill) - (change-to *default-nav-mesh* obj) + (change-to *default-nav-mesh* this) #t ) (('hit-flinch) (send-event *traffic-manager* 'set-alert-level 1) (cond - ((zero? (-> obj hit-points)) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'die))) - (kill-prefer-falling obj) + ((zero? (-> this hit-points)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'die))) + (kill-prefer-falling this) ) ) (else @@ -1425,7 +1424,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector))) (let ((s4-1 (new 'stack-no-clear 'vector))) (set! (-> s4-1 quad) (-> v1-14 root trans quad)) - (let ((s3-1 (matrix->trans (-> obj node-list data 3 bone transform) (new 'stack-no-clear 'vector)))) + (let ((s3-1 (matrix->trans (-> this node-list data 3 bone transform) (new 'stack-no-clear 'vector)))) (+! (-> s4-1 x) (* 4096.0 (rand-vu-float-range -20.0 20.0))) (+! (-> s4-1 y) (* 4096.0 (rand-vu-float-range -20.0 20.0))) (+! (-> s4-1 z) (* 4096.0 (rand-vu-float-range -20.0 20.0))) @@ -1433,9 +1432,9 @@ ) ) (vector-normalize! s5-1 4096000.0) - (vector-inv-orient-by-quat! s5-1 s5-1 (-> obj root quat)) - (let* ((s4-2 (-> obj rigidbody)) - (v1-26 (-> obj rigidbody)) + (vector-inv-orient-by-quat! s5-1 s5-1 (-> this root quat)) + (let* ((s4-2 (-> this rigidbody)) + (v1-26 (-> this rigidbody)) (a1-10 (new 'stack-no-clear 'vector)) (a1-11 (rigid-body-method-23 (-> v1-26 state) a1-10)) ) @@ -1451,18 +1450,18 @@ ) ) (('explode) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'explode))) - (go (method-of-object obj explode)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'explode))) + (go (method-of-object this explode)) ) ) (('touched 'touch 'attack) (if (logtest? (process-mask vehicle) (-> arg0 mask)) (send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((id (new-attack-id)) (mode 'mine)))) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -1483,7 +1482,7 @@ ;; definition for method 181 of type bombbot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod bombbot-method-181 bombbot ((obj bombbot) (arg0 vector)) +(defmethod bombbot-method-181 bombbot ((this bombbot) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1511,17 +1510,17 @@ ) ) (when (and s1-1 - (!= obj s1-1) - (not (focus-test? obj inactive)) - (not (focus-test? obj disable)) - (not (focus-test? obj dead)) + (!= this s1-1) + (not (focus-test? this inactive)) + (not (focus-test? this disable)) + (not (focus-test? this dead)) (not (logtest? (process-mask guard) (-> s1-1 mask))) (not (logtest? (process-mask crate) (-> s1-1 mask))) (logtest? (process-mask vehicle) (-> s1-1 mask)) s1-1 (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) ) - (let ((f0-0 (vector-vector-xz-distance (-> obj root trans) (-> s1-1 root trans)))) + (let ((f0-0 (vector-vector-xz-distance (-> this root trans) (-> s1-1 root trans)))) (when (or (not gp-0) (< f0-0 f30-0)) (set! gp-0 s1-1) (set! f30-0 f0-0) @@ -1538,8 +1537,8 @@ ) (cond (gp-0 - (set! (-> obj target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) - (let ((v1-34 (-> obj target-pos))) + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable gp-0) 3) quad)) + (let ((v1-34 (-> this target-pos))) (let ((a0-16 (-> gp-0 root trans))) (let ((a1-8 (-> gp-0 root transv))) (let ((a2-1 0.0)) @@ -1554,12 +1553,12 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-34 quad) vf6) ) - (set! (-> obj start-target-pos quad) (-> gp-0 root trans quad)) - (set! (-> obj start-target-vel quad) (-> gp-0 root transv quad)) - (try-update-focus (-> obj focus) (the-as process-focusable gp-0) obj) + (set! (-> this start-target-pos quad) (-> gp-0 root trans quad)) + (set! (-> this start-target-vel quad) (-> gp-0 root transv quad)) + (try-update-focus (-> this focus) (the-as process-focusable gp-0) this) ) (else - (clear-focused (-> obj focus)) + (clear-focused (-> this focus)) ) ) ) @@ -1726,7 +1725,7 @@ ;; definition for method 182 of type bombbot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod bombbot-method-182 bombbot ((obj bombbot)) +(defmethod bombbot-method-182 bombbot ((this bombbot)) (local-vars (v1-28 symbol) (sv-880 matrix) @@ -1748,9 +1747,9 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s2-0 (handle->process (-> obj focus handle)))) + (let ((s2-0 (handle->process (-> this focus handle)))) (set! sv-880 (new 'stack-no-clear 'matrix)) - (let* ((a0-4 (-> obj node-list data 6 bone transform)) + (let* ((a0-4 (-> this node-list data 6 bone transform)) (a2-0 (-> a0-4 quad 0)) (a1-1 (-> a0-4 quad 1)) (v1-7 (-> a0-4 quad 2)) @@ -1801,7 +1800,7 @@ player-list ) ) - (set! (-> v1-14 ignore-process0) obj) + (set! (-> v1-14 ignore-process0) this) (set! (-> v1-14 ignore-process1) #f) (set! (-> v1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-14 action-mask) (collide-action solid)) @@ -1897,12 +1896,12 @@ (not (logtest? (-> (the-as process-focusable s2-0) focus-status) (focus-status disable dead ignore grabbed))) ) (let ((s2-1 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> s2-1 ent) (-> obj entity)) + (set! (-> s2-1 ent) (-> this entity)) (set! (-> s2-1 charge) 1.0) (set! (-> s2-1 options) (projectile-options)) - (set! (-> s2-1 notify-handle) (process->handle obj)) + (set! (-> s2-1 notify-handle) (process->handle this)) (set! (-> s2-1 owner-handle) (the-as handle #f)) - (set! (-> s2-1 ignore-handle) (process->handle obj)) + (set! (-> s2-1 ignore-handle) (process->handle this)) (let* ((v1-69 *game-info*) (a0-67 (+ (-> v1-69 attack-id) 1)) ) @@ -1913,18 +1912,18 @@ (set! (-> s2-1 pos quad) (-> s3-0 start-pos quad)) (vector+! (-> s2-1 vel) (-> s3-0 start-pos) s5-0) (vector-normalize-copy! (-> s2-1 vel) (-> s3-0 move-dist) 40960000.0) - (spawn-projectile guard-lazer-shot s2-1 obj *default-dead-pool*) + (spawn-projectile guard-lazer-shot s2-1 this *default-dead-pool*) ) ) ) ) - (when (zero? (-> obj lazer-sound)) + (when (zero? (-> this lazer-sound)) (let ((s3-1 sound-play-by-spec) (s2-2 (static-sound-spec "bb-laser-fire" :volume 0.0 :mask (pitch))) ) (set! (-> s2-2 volume) 1024) (set! (-> s2-2 pitch-mod) 0) - (set! (-> obj lazer-sound) (s3-1 s2-2 (new-sound-id) s4-0)) + (set! (-> this lazer-sound) (s3-1 s2-2 (new-sound-id) s4-0)) ) ) (set! (-> *part-id-table* 4630 init-specs 4 initial-valuef) (vector-length s5-0)) @@ -2059,7 +2058,7 @@ ) ) (if (= (vector-length (-> self root transv)) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (set! (-> self last-head-roty-speed) (-> self head-roty-speed)) (set! (-> self head-roty-speed) (vector-y-angle (-> self node-list data 4 bone transform vector 2))) @@ -2176,7 +2175,7 @@ ) (set! (-> self explosing) #f) (set! (-> self beep-time) 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let ((v1-0 (-> self nav))) @@ -2188,16 +2187,16 @@ (if (>= (- (current-time) (-> self state-time)) 0) (seek! (-> self legs-strength 0) 0.8 (* 10.0 (seconds-per-frame))) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.8)) + (if (time-elapsed? (-> self state-time) (seconds 0.8)) (seek! (-> self legs-strength 3) 0.4 (* 10.0 (seconds-per-frame))) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 1.6)) + (if (time-elapsed? (-> self state-time) (seconds 1.6)) (seek! (-> self legs-strength 1) 0.0 (* 10.0 (seconds-per-frame))) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 2.4)) + (if (time-elapsed? (-> self state-time) (seconds 2.4)) (seek! (-> self legs-strength 2) 0.5 (* 10.0 (seconds-per-frame))) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 2.8)) + (when (time-elapsed? (-> self state-time) (seconds 2.8)) (sound-play "bb-explode") (go-virtual explode) ) @@ -2233,7 +2232,7 @@ (set! (-> self minimap) #f) ) (set! (-> self explosing) #f) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) (set! (-> gp-0 fountain-rand-transv-lo quad) (-> self root trans quad)) (set! (-> gp-0 duration) (seconds 3)) @@ -2307,23 +2306,23 @@ ;; definition for method 7 of type bombbot ;; WARN: Return type mismatch nav-enemy vs bombbot. -(defmethod relocate bombbot ((obj bombbot) (arg0 int)) +(defmethod relocate bombbot ((this bombbot) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj joint-ik v1-0)) - (&+! (-> obj joint-ik v1-0) arg0) + (if (nonzero? (-> this joint-ik v1-0)) + (&+! (-> this joint-ik v1-0) arg0) ) ) - (if (nonzero? (-> obj rigidbody)) - (&+! (-> obj rigidbody) arg0) + (if (nonzero? (-> this rigidbody)) + (&+! (-> this rigidbody) arg0) ) - (the-as bombbot ((the-as (function nav-enemy int nav-enemy) (find-parent-method bombbot 7)) obj arg0)) + (the-as bombbot ((the-as (function nav-enemy int nav-enemy) (find-parent-method bombbot 7)) this arg0)) ) ;; definition for method 114 of type bombbot ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! bombbot ((obj bombbot)) +(defmethod init-enemy-collision! bombbot ((this bombbot)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2574,14 +2573,14 @@ (set! (-> s5-0 backup-collide-as) (-> v1-78 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-78 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 60 of type bombbot -(defmethod coin-flip? bombbot ((obj bombbot)) +(defmethod coin-flip? bombbot ((this bombbot)) "@returns The result of a 50/50 RNG roll" #f ) @@ -2836,16 +2835,16 @@ ) ;; definition for method 3 of type spring-setup -(defmethod inspect spring-setup ((obj spring-setup)) - (when (not obj) - (set! obj obj) +(defmethod inspect spring-setup ((this spring-setup)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'spring-setup) - (format #t "~1Tbpos1: #~%" (-> obj bpos1)) - (format #t "~1Twpos2: #~%" (-> obj wpos2)) + (format #t "[~8x] ~A~%" this 'spring-setup) + (format #t "~1Tbpos1: #~%" (-> this bpos1)) + (format #t "~1Twpos2: #~%" (-> this wpos2)) (label cfg-4) - obj + this ) ;; definition for symbol *bombbot-spring-setup*, type (array spring-setup) @@ -2872,7 +2871,7 @@ ;; definition for method 183 of type bombbot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod bombbot-method-183 bombbot ((obj bombbot)) +(defmethod bombbot-method-183 bombbot ((this bombbot)) (local-vars (at-0 int) (sv-160 vector) (sv-176 vector)) (with-pp (rlet ((vf0 :class vf) @@ -2885,16 +2884,16 @@ (init-vf0-vector) (let ((a1-0 (new 'stack-no-clear 'vector))) (vector-reset! a1-0) - (set! (-> a1-0 y) (* -1.0 (-> obj info extra gravity) (-> obj rigidbody state info mass))) - (rigid-body-method-20 (-> obj rigidbody state) a1-0) + (set! (-> a1-0 y) (* -1.0 (-> this info extra gravity) (-> this rigidbody state info mass))) + (rigid-body-method-20 (-> this rigidbody state) a1-0) ) - (rigid-body-method-24 (-> obj rigidbody state)) - (logclear! (-> obj rigidbody state flags) (rigid-body-flag active)) + (rigid-body-method-24 (-> this rigidbody state)) + (logclear! (-> this rigidbody state flags) (rigid-body-flag active)) (dotimes (s5-0 4) (let ((s4-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> *bombbot-spring-setup* s5-0 bpos1) - (-> obj rigidbody state matrix) + (-> this rigidbody state matrix) ) ) ) @@ -2908,12 +2907,12 @@ (s1-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> sv-160 y) (* (-> obj legs-strength s5-0) (-> sv-160 y))) - (+! (-> sv-160 y) (-> obj feet s5-0 main-y)) + (set! (-> sv-160 y) (* (-> this legs-strength s5-0) (-> sv-160 y))) + (+! (-> sv-160 y) (-> this feet s5-0 main-y)) 0.0 0.0 0.0 - (let ((v1-33 (-> obj rigidbody)) + (let ((v1-33 (-> this rigidbody)) (a1-3 s4-0) (a2-1 sv-176) ) @@ -2939,12 +2938,12 @@ (vector-float*! s3-0 s2-0 (- (+ f0-12 f1-8))) ) ) - (rigid-body-method-18 (-> obj rigidbody state) s4-0 s3-0) + (rigid-body-method-18 (-> this rigidbody state) s4-0 s3-0) ) ) ) (let ((v1-54 (new 'stack-no-clear 'vector))) - (.lvf vf1 (&-> (-> obj linear-speed) quad)) + (.lvf vf1 (&-> (-> this linear-speed) quad)) (let ((f0-15 (-> pp clock frames-per-second))) (.mov at-0 f0-15) ) @@ -2961,10 +2960,10 @@ ;; definition for method 184 of type bombbot ;; WARN: Return type mismatch int vs none. -(defmethod bombbot-method-184 bombbot ((obj bombbot)) +(defmethod bombbot-method-184 bombbot ((this bombbot)) (rigid-body-control-method-10 - (-> obj rigidbody) - (the-as rigid-body-object obj) + (-> this rigidbody) + (the-as rigid-body-object this) (seconds-per-frame) 0.033333335 ) @@ -2975,123 +2974,123 @@ ;; definition for method 115 of type bombbot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! bombbot ((obj bombbot)) +(defmethod init-enemy! bombbot ((this bombbot)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bombbot" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *bombbot-nav-enemy-info*) - (set-vector! (-> obj root scale) 1.0 1.0 1.0 1.0) - (let ((v1-7 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *bombbot-nav-enemy-info*) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (let ((v1-7 (-> this nav))) (set! (-> v1-7 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) (dotimes (s5-1 4) - (set! (-> obj joint-ik s5-1) + (set! (-> this joint-ik s5-1) (new 'process 'joint-mod-ik - obj + this (-> *bombbot-ik-setup* s5-1 elbow-index) (-> *bombbot-ik-setup* s5-1 hand-dist) ) ) - (set! (-> obj joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) ) - (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) - (logior! (-> obj joint-ik 3 flags) (joint-mod-ik-flags elbow-trans-neg)) - (logior! (-> obj joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) - (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) - (logior! (-> obj joint-ik 2 flags) (joint-mod-ik-flags elbow-rot-neg)) - (logior! (-> obj joint-ik 3 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 3 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 2 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 3 flags) (joint-mod-ik-flags elbow-rot-neg)) (let ((f1-0 11878.4) (f0-6 10240.0) ) (let ((f2-0 -10240.0)) - (let ((v1-51 (-> obj feet))) + (let ((v1-51 (-> this feet))) (set! (-> v1-51 0 pos-offset x) f1-0) (set! (-> v1-51 0 pos-offset y) 0.0) (set! (-> v1-51 0 pos-offset z) f0-6) (set! (-> v1-51 0 pos-offset w) 1.0) ) - (set! (-> obj feet 0 offset) 0.0) - (let ((v1-52 (-> obj feet 1))) + (set! (-> this feet 0 offset) 0.0) + (let ((v1-52 (-> this feet 1))) (set! (-> v1-52 pos-offset x) f1-0) (set! (-> v1-52 pos-offset y) 0.0) (set! (-> v1-52 pos-offset z) f2-0) (set! (-> v1-52 pos-offset w) 1.0) ) - (set! (-> obj feet 1 offset) 0.5) - (let ((v1-54 (-> obj feet 2))) + (set! (-> this feet 1 offset) 0.5) + (let ((v1-54 (-> this feet 2))) (set! (-> v1-54 pos-offset x) (- f1-0)) (set! (-> v1-54 pos-offset y) 0.0) (set! (-> v1-54 pos-offset z) f2-0) (set! (-> v1-54 pos-offset w) 1.0) ) ) - (set! (-> obj feet 2 offset) 0.1) - (let ((v1-56 (-> obj feet 3))) + (set! (-> this feet 2 offset) 0.1) + (let ((v1-56 (-> this feet 3))) (set! (-> v1-56 pos-offset x) (- f1-0)) (set! (-> v1-56 pos-offset y) 0.0) (set! (-> v1-56 pos-offset z) f0-6) (set! (-> v1-56 pos-offset w) 1.0) ) ) - (set! (-> obj feet 3 offset) 0.6) - (quaternion-copy! (-> obj last-quat) (-> obj root quat)) - (quaternion-copy! (-> obj main-quat) *unity-quaternion*) - (let ((v1-60 (-> obj nav))) + (set! (-> this feet 3 offset) 0.6) + (quaternion-copy! (-> this last-quat) (-> this root quat)) + (quaternion-copy! (-> this main-quat) *unity-quaternion*) + (let ((v1-60 (-> this nav))) (set! (-> v1-60 sphere-mask) (the-as uint 64)) ) 0 - (let ((a0-28 (-> obj node-list data 3))) + (let ((a0-28 (-> this node-list data 3))) (set! (-> a0-28 param0) bombbot-callback) - (set! (-> a0-28 param1) obj) + (set! (-> a0-28 param1) this) ) - (let ((a0-29 (-> obj node-list data 4))) + (let ((a0-29 (-> this node-list data 4))) (set! (-> a0-29 param0) bombbot-head-callback) - (set! (-> a0-29 param1) obj) + (set! (-> a0-29 param1) this) ) - (let ((a0-30 (-> obj node-list data 5))) + (let ((a0-30 (-> this node-list data 5))) (set! (-> a0-30 param0) bombbot-gun-swivel-callback) - (set! (-> a0-30 param1) obj) + (set! (-> a0-30 param1) this) ) - (let ((a0-31 (-> obj node-list data 6))) + (let ((a0-31 (-> this node-list data 6))) (set! (-> a0-31 param0) bombbot-gun-callback) - (set! (-> a0-31 param1) obj) + (set! (-> a0-31 param1) this) ) - (set! (-> obj rigidbody) (new 'process 'rigid-body-control obj)) - (set! (-> obj info) *bombbot-body-constants*) + (set! (-> this rigidbody) (new 'process 'rigid-body-control this)) + (set! (-> this info) *bombbot-body-constants*) (rigid-body-method-25 - (-> obj rigidbody state) - (-> obj info info) + (-> this rigidbody state) + (-> this info info) *null-vector* *unity-quaternion* - (method-of-object obj bombbot-method-183) + (method-of-object this bombbot-method-183) ) - (set! (-> obj shield-hit-points) 3.0) - (set! (-> obj lazer-sound) (new-sound-id)) - (set! (-> obj head-sound) (new 'static 'sound-id)) - (set! (-> obj cannon-sound) (new 'static 'sound-id)) + (set! (-> this shield-hit-points) 3.0) + (set! (-> this lazer-sound) (new-sound-id)) + (set! (-> this head-sound) (new 'static 'sound-id)) + (set! (-> this cannon-sound) (new 'static 'sound-id)) (transform-post) (dotimes (s5-2 4) - (let ((s4-1 (-> obj feet s5-2))) + (let ((s4-1 (-> this feet s5-2))) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-orient-by-quat! s3-0 (-> s4-1 pos-offset) (-> obj root quat)) - (vector+! s3-0 s3-0 (-> obj root trans)) + (vector-orient-by-quat! s3-0 (-> s4-1 pos-offset) (-> this root quat)) + (vector+! s3-0 s3-0 (-> this root trans)) (set! (-> s4-1 next-position quad) (-> s3-0 quad)) (set! (-> s4-1 position quad) (-> s3-0 quad)) ) (set! (-> s4-1 delta-y) 0.0) ) - (set! (-> obj legs-strength s5-2) 1.0) + (set! (-> this legs-strength s5-2) 1.0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) @@ -3109,18 +3108,18 @@ ) ;; definition for method 3 of type bombbot-spawn-params -(defmethod inspect bombbot-spawn-params ((obj bombbot-spawn-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect bombbot-spawn-params ((this bombbot-spawn-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bombbot-spawn-params) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Tnav-mesh: ~A~%" (-> obj nav-mesh)) - (format #t "~1Tpath: #~%" (-> obj path)) + (format #t "[~8x] ~A~%" this 'bombbot-spawn-params) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~1Tpath: #~%" (-> this path)) (label cfg-4) - obj + this ) ;; definition for function bombbot-init-by-other @@ -3276,7 +3275,7 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (talker-spawn-func (-> *talker-speech* 117) *entity-pool* (target-pos 0) (the-as region #f)) (none) ) @@ -3298,8 +3297,8 @@ ((= (level-status *level* 'ctysluma) 'active) (set-setting! 'entity-name "camera-236" 0.0 0) (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (add-process *gui-control* self (gui-channel sig) (gui-action play) "bbotxplo" -99.0 0) @@ -3315,8 +3314,8 @@ ) ) ) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 0.3)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.3))) (suspend) ) (setup @@ -3326,7 +3325,7 @@ (seconds-per-frame) (bucket-id tex-all-map) ) - (while (< (- (current-time) (-> self state-time)) (seconds 1)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (suspend) ) (set-setting! 'interp-time 'abs 0.0 0) @@ -3427,7 +3426,7 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (suspend) ) diff --git a/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc b/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc index f96d609432..186c0d8e62 100644 --- a/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/burning-bush/ctywide-bbush_REF.gc @@ -278,21 +278,21 @@ ) ;; definition for method 3 of type race-ring -(defmethod inspect race-ring ((obj race-ring)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-ring ((this race-ring)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlast-target-pos: #~%" (-> obj last-target-pos)) - (format #t "~2Tkeep-part-track-alive: ~A~%" (-> obj keep-part-track-alive)) - (format #t "~2Tpart-track: ~D~%" (-> obj part-track)) - (format #t "~2Trot-y: ~f~%" (-> obj rot-y)) - (format #t "~2Tcyl: #~%" (-> obj cyl)) + (format #t "~2Tlast-target-pos: #~%" (-> this last-target-pos)) + (format #t "~2Tkeep-part-track-alive: ~A~%" (-> this keep-part-track-alive)) + (format #t "~2Tpart-track: ~D~%" (-> this part-track)) + (format #t "~2Trot-y: ~f~%" (-> this rot-y)) + (format #t "~2Tcyl: #~%" (-> this cyl)) (label cfg-4) - obj + this ) ;; definition for function race-ring-set-particle-rotation-callback @@ -397,7 +397,7 @@ (cond ((handle->process (-> self part-track)) (if (-> self keep-part-track-alive) - (set! (-> (the-as part-tracker (-> self part-track process 0)) start-time) (current-time)) + (set-time! (-> (the-as part-tracker (-> self part-track process 0)) start-time)) ) ) (else @@ -486,8 +486,8 @@ ;; definition for method 22 of type race-ring ;; WARN: Return type mismatch int vs none. -(defmethod race-ring-method-22 race-ring ((obj race-ring)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod race-ring-method-22 race-ring ((this race-ring)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) @@ -495,16 +495,16 @@ ;; definition for method 23 of type race-ring ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod race-ring-method-23 race-ring ((obj race-ring)) - (add-icon! *minimap* obj (the-as uint 15) (the-as int #f) (the-as vector #t) 0) - (set! (-> obj keep-part-track-alive) #f) - (set! (-> obj part-track) (the-as handle #f)) - (set! (-> obj rot-y) (+ 16384.0 (quaternion-y-angle (-> obj root quat)))) - (set! (-> obj last-target-pos quad) (-> (target-pos 0) quad)) - (set-vector! (-> obj cyl axis) (cos (-> obj rot-y)) 0.0 (- (sin (-> obj rot-y))) 1.0) - (vector+float*! (the-as vector (-> obj cyl)) (-> obj root trans) (-> obj cyl axis) -2048.0) - (set! (-> obj cyl radius) 24576.0) - (set! (-> obj cyl length) 4096.0) +(defmethod race-ring-method-23 race-ring ((this race-ring)) + (add-icon! *minimap* this (the-as uint 15) (the-as int #f) (the-as vector #t) 0) + (set! (-> this keep-part-track-alive) #f) + (set! (-> this part-track) (the-as handle #f)) + (set! (-> this rot-y) (+ 16384.0 (quaternion-y-angle (-> this root quat)))) + (set! (-> this last-target-pos quad) (-> (target-pos 0) quad)) + (set-vector! (-> this cyl axis) (cos (-> this rot-y)) 0.0 (- (sin (-> this rot-y))) 1.0) + (vector+float*! (the-as vector (-> this cyl)) (-> this root trans) (-> this cyl axis) -2048.0) + (set! (-> this cyl radius) 24576.0) + (set! (-> this cyl length) 4096.0) 0 (none) ) @@ -548,18 +548,18 @@ ) ;; definition for method 3 of type bb-ring-info -(defmethod inspect bb-ring-info ((obj bb-ring-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect bb-ring-info ((this bb-ring-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bb-ring-info) - (format #t "~1Ttime: ~D~%" (-> obj time)) - (format #t "~1Tstart-pos: #~%" (-> obj start-pos)) - (format #t "~1Trotation: ~f~%" (-> obj rotation)) - (format #t "~1Trings: ~A~%" (-> obj rings)) + (format #t "[~8x] ~A~%" this 'bb-ring-info) + (format #t "~1Ttime: ~D~%" (-> this time)) + (format #t "~1Tstart-pos: #~%" (-> this start-pos)) + (format #t "~1Trotation: ~f~%" (-> this rotation)) + (format #t "~1Trings: ~A~%" (-> this rings)) (label cfg-4) - obj + this ) ;; definition for symbol *bb-ring-info*, type (array bb-ring-info) @@ -1542,7 +1542,7 @@ ) ) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (+! (-> self sub-state) 1) ) ) @@ -1565,7 +1565,7 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (none) @@ -1715,25 +1715,25 @@ ) ;; definition for method 3 of type bush-collect -(defmethod inspect bush-collect ((obj bush-collect)) - (when (not obj) - (set! obj obj) +(defmethod inspect bush-collect ((this bush-collect)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tminimap: #~%" (-> obj minimap)) - (format #t "~2Ttrans-y: ~f~%" (-> obj trans-y)) - (format #t "~2Tbeep-time: ~f~%" (-> obj beep-time)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Ttrans-y: ~f~%" (-> this trans-y)) + (format #t "~2Tbeep-time: ~f~%" (-> this beep-time)) (label cfg-4) - obj + this ) ;; definition for method 22 of type bush-collect ;; WARN: Return type mismatch int vs none. -(defmethod bush-collect-method-22 bush-collect ((obj bush-collect)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod bush-collect-method-22 bush-collect ((this bush-collect)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1753,7 +1753,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1761,7 +1761,7 @@ ;; definition for method 23 of type bush-collect ;; WARN: Return type mismatch int vs none. -(defmethod bush-collect-method-23 bush-collect ((obj bush-collect)) +(defmethod bush-collect-method-23 bush-collect ((this bush-collect)) 0 (none) ) @@ -1834,14 +1834,14 @@ ;; definition for method 11 of type bush-collect ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! bush-collect ((obj bush-collect) (arg0 entity-actor)) +(defmethod init-from-entity! bush-collect ((this bush-collect) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -1931,24 +1931,24 @@ This commonly includes things such as: ) ;; definition for method 3 of type burning-bush-collection-info -(defmethod inspect burning-bush-collection-info ((obj burning-bush-collection-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect burning-bush-collection-info ((this burning-bush-collection-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'burning-bush-collection-info) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tminimap: #~%" (-> obj minimap)) + (format #t "[~8x] ~A~%" this 'burning-bush-collection-info) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tminimap: #~%" (-> this minimap)) (label cfg-4) - obj + this ) ;; definition for method 9 of type burning-bush-collection-info ;; WARN: Return type mismatch int vs none. -(defmethod burning-bush-collection-info-method-9 burning-bush-collection-info ((obj burning-bush-collection-info) (arg0 object)) +(defmethod burning-bush-collection-info-method-9 burning-bush-collection-info ((this burning-bush-collection-info) (arg0 object)) (format arg0 "(static-burning-bush-collection-info~%") - (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%)~%" (-> obj pos x) (-> obj pos y) (-> obj pos z)) + (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%)~%" (-> this pos x) (-> this pos y) (-> this pos z)) 0 (none) ) @@ -1965,17 +1965,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type bb-collection-info -(defmethod inspect bb-collection-info ((obj bb-collection-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect bb-collection-info ((this bb-collection-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bb-collection-info) - (format #t "~1Tuser-data: ~D~%" (-> obj user-data)) - (format #t "~1Ttime: ~D~%" (-> obj time)) - (format #t "~1Tcolls: ~A~%" (-> obj colls)) + (format #t "[~8x] ~A~%" this 'bb-collection-info) + (format #t "~1Tuser-data: ~D~%" (-> this user-data)) + (format #t "~1Ttime: ~D~%" (-> this time)) + (format #t "~1Tcolls: ~A~%" (-> this colls)) (label cfg-4) - obj + this ) ;; definition for symbol *bb-collection-info*, type (array bb-collection-info) @@ -2748,7 +2748,7 @@ This commonly includes things such as: ) ) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self time-limit) (-> gp-0 time)) ) (none) @@ -2793,7 +2793,7 @@ This commonly includes things such as: *game-info* (game-task-node city-burning-bush-collection-1-resolution) TASK_MANAGER_CODE_HOOK - (lambda :behavior task-manager () (set! (-> self state-time) (current-time)) (none)) + (lambda :behavior task-manager () (set-time! (-> self state-time)) (none)) ) ;; failed to figure out what this is: @@ -2822,19 +2822,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type burning-bush-get-on-info -(defmethod inspect burning-bush-get-on-info ((obj burning-bush-get-on-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect burning-bush-get-on-info ((this burning-bush-get-on-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'burning-bush-get-on-info) - (format #t "~1Ttrans: #~%" (-> obj trans)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Tcamera-trans: #~%" (-> obj camera-trans)) - (format #t "~1Tcamera-rot[9] @ #x~X~%" (-> obj camera-rot)) - (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "[~8x] ~A~%" this 'burning-bush-get-on-info) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tcamera-trans: #~%" (-> this camera-trans)) + (format #t "~1Tcamera-rot[9] @ #x~X~%" (-> this camera-rot)) + (format #t "~1Ttime: ~f~%" (-> this time)) (label cfg-4) - obj + this ) ;; definition for symbol *burning-bush-get-on-info*, type (array burning-bush-get-on-info) @@ -3033,7 +3033,7 @@ This commonly includes things such as: ) ) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self time-limit) (the-as time-frame (the int (+ 300.0 (-> *burning-bush-get-on-info* (-> self info index) time)))) ) @@ -3070,7 +3070,7 @@ This commonly includes things such as: (send-event *camera* 'teleport-to-transformq gp-0) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 3)) + (until (time-elapsed? gp-1 (seconds 3)) (suspend) ) ) @@ -3199,127 +3199,127 @@ This commonly includes things such as: ;; definition for method 15 of type hud-homing-beacon ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-homing-beacon ((obj hud-homing-beacon)) +(defmethod draw hud-homing-beacon ((this hud-homing-beacon)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 160 ) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj strings 0 scale) 0.5) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -16 60) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 60) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-homing-beacon ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-homing-beacon ((obj hud-homing-beacon)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-homing-beacon ((this hud-homing-beacon)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-homing-beacon ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-homing-beacon ((obj hud-homing-beacon)) - (set! (-> obj level) (level-get *level* 'lbbush)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-homing-beacon ((this hud-homing-beacon)) + (set! (-> this level) (level-get *level* 'lbbush)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd89))) - (alloc-string-if-needed obj 0) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd89))) + (alloc-string-if-needed this 0) 0 (none) ) ;; definition for method 15 of type hud-dark-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-dark-eco-pickup ((obj hud-dark-eco-pickup)) +(defmethod draw hud-dark-eco-pickup ((this hud-dark-eco-pickup)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 180 ) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 scale) 0.5) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -16 26) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 scale) 0.5) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 26) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-dark-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-dark-eco-pickup ((obj hud-dark-eco-pickup)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-dark-eco-pickup ((this hud-dark-eco-pickup)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-dark-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-dark-eco-pickup ((obj hud-dark-eco-pickup)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-dark-eco-pickup ((this hud-dark-eco-pickup)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x46 :page #x67a))) - (alloc-string-if-needed obj 0) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x46 :page #x67a))) + (alloc-string-if-needed this 0) 0 (none) ) ;; definition for method 15 of type hud-green-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-green-eco-pickup ((obj hud-green-eco-pickup)) +(defmethod draw hud-green-eco-pickup ((this hud-green-eco-pickup)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 180 ) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 scale) 0.5) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -16 26) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 scale) 0.5) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 26) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-green-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-green-eco-pickup ((obj hud-green-eco-pickup)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-green-eco-pickup ((this hud-green-eco-pickup)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-green-eco-pickup ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-green-eco-pickup ((obj hud-green-eco-pickup)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-green-eco-pickup ((this hud-green-eco-pickup)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x47 :page #x67a))) - (alloc-string-if-needed obj 0) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x47 :page #x67a))) + (alloc-string-if-needed this 0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/common/height-map-h_REF.gc b/test/decompiler/reference/jak2/levels/city/common/height-map-h_REF.gc index bedb8e2c40..9d7f8073a4 100644 --- a/test/decompiler/reference/jak2/levels/city/common/height-map-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/height-map-h_REF.gc @@ -32,25 +32,25 @@ all initialized from static data." ) ;; definition for method 3 of type xz-height-map -(defmethod inspect xz-height-map ((obj xz-height-map)) - (when (not obj) - (set! obj obj) +(defmethod inspect xz-height-map ((this xz-height-map)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'xz-height-map) - (format #t "~1Toffset[3] @ #x~X~%" (-> obj offset)) - (format #t "~1Tx-offset: ~f~%" (-> obj x-offset)) - (format #t "~1Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~1Tz-offset: ~f~%" (-> obj z-offset)) - (format #t "~1Tx-inv-spacing: ~f~%" (-> obj x-inv-spacing)) - (format #t "~1Tz-inv-spacing: ~f~%" (-> obj z-inv-spacing)) - (format #t "~1Ty-scale: ~f~%" (-> obj y-scale)) - (format #t "~1Tdim[2] @ #x~X~%" (-> obj dim)) - (format #t "~1Tx-dim: ~D~%" (-> obj x-dim)) - (format #t "~1Tz-dim: ~D~%" (-> obj z-dim)) - (format #t "~1Tdata: #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'xz-height-map) + (format #t "~1Toffset[3] @ #x~X~%" (-> this offset)) + (format #t "~1Tx-offset: ~f~%" (-> this x-offset)) + (format #t "~1Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~1Tz-offset: ~f~%" (-> this z-offset)) + (format #t "~1Tx-inv-spacing: ~f~%" (-> this x-inv-spacing)) + (format #t "~1Tz-inv-spacing: ~f~%" (-> this z-inv-spacing)) + (format #t "~1Ty-scale: ~f~%" (-> this y-scale)) + (format #t "~1Tdim[2] @ #x~X~%" (-> this dim)) + (format #t "~1Tx-dim: ~D~%" (-> this x-dim)) + (format #t "~1Tz-dim: ~D~%" (-> this z-dim)) + (format #t "~1Tdata: #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition for function get-traffic-height diff --git a/test/decompiler/reference/jak2/levels/city/common/height-map_REF.gc b/test/decompiler/reference/jak2/levels/city/common/height-map_REF.gc index b31923ecf2..53973282db 100644 --- a/test/decompiler/reference/jak2/levels/city/common/height-map_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/height-map_REF.gc @@ -3,27 +3,27 @@ ;; definition for method 11 of type xz-height-map ;; WARN: Return type mismatch int vs none. -(defmethod debug-print xz-height-map ((obj xz-height-map)) +(defmethod debug-print xz-height-map ((this xz-height-map)) (format #t "(define *traffic-height-map*~%") (format #t " (static-height-map~%") (format #t " :offset ((meters ~M) (meters ~M) (meters ~M))~%" - (-> obj x-offset) - (-> obj y-offset) - (-> obj z-offset) + (-> this x-offset) + (-> this y-offset) + (-> this z-offset) ) - (format #t " :x-spacing (meters ~M)~%" (/ 1.0 (-> obj x-inv-spacing))) - (format #t " :z-spacing (meters ~M)~%" (/ 1.0 (-> obj z-inv-spacing))) - (format #t " :y-scale (meters ~M)~%" (-> obj y-scale)) - (format #t " :x-dim ~d~%" (-> obj x-dim)) - (format #t " :z-dim ~d~%" (-> obj z-dim)) + (format #t " :x-spacing (meters ~M)~%" (/ 1.0 (-> this x-inv-spacing))) + (format #t " :z-spacing (meters ~M)~%" (/ 1.0 (-> this z-inv-spacing))) + (format #t " :y-scale (meters ~M)~%" (-> this y-scale)) + (format #t " :x-dim ~d~%" (-> this x-dim)) + (format #t " :z-dim ~d~%" (-> this z-dim)) (format #t " :data~%") (format #t " (~%") (let ((s5-0 0)) - (dotimes (s4-0 (-> obj z-dim)) - (dotimes (s3-0 (-> obj x-dim)) - (format #t " ~2d" (-> obj data s5-0)) + (dotimes (s4-0 (-> this z-dim)) + (dotimes (s3-0 (-> this x-dim)) + (format #t " ~2d" (-> this data s5-0)) (+! s5-0 1) ) (format #t "~%") @@ -38,14 +38,14 @@ ;; definition for method 14 of type xz-height-map ;; WARN: Return type mismatch int vs none. -(defmethod debug-add-offset xz-height-map ((obj xz-height-map) (arg0 vector) (arg1 int)) +(defmethod debug-add-offset xz-height-map ((this xz-height-map) (arg0 vector) (arg1 int)) "Add an offset to the given point, likely for debugging purposes." - (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> obj x-offset)) (-> obj x-inv-spacing))))) - (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> obj z-offset)) (-> obj z-inv-spacing))))) + (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> this x-offset)) (-> this x-inv-spacing))))) + (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> this z-offset)) (-> this z-inv-spacing))))) ) - (when (and (>= v1-1 0) (< v1-1 (-> obj x-dim)) (>= a1-1 0) (< a1-1 (-> obj z-dim))) - (let ((v1-2 (+ v1-1 (* a1-1 (-> obj x-dim))))) - (+! (-> obj data v1-2) arg1) + (when (and (>= v1-1 0) (< v1-1 (-> this x-dim)) (>= a1-1 0) (< a1-1 (-> this z-dim))) + (let ((v1-2 (+ v1-1 (* a1-1 (-> this x-dim))))) + (+! (-> this data v1-2) arg1) ) ) ) @@ -55,21 +55,21 @@ ;; definition for method 12 of type xz-height-map ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-at-point xz-height-map ((obj xz-height-map) (arg0 vector)) - (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> obj x-offset)) (-> obj x-inv-spacing))))) - (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> obj z-offset)) (-> obj z-inv-spacing))))) - (a2-1 (-> obj x-dim)) - (a3-0 (-> obj z-dim)) +(defmethod debug-draw-at-point xz-height-map ((this xz-height-map) (arg0 vector)) + (let ((v1-1 (the int (+ 0.5 (* (- (-> arg0 x) (-> this x-offset)) (-> this x-inv-spacing))))) + (a1-1 (the int (+ 0.5 (* (- (-> arg0 z) (-> this z-offset)) (-> this z-inv-spacing))))) + (a2-1 (-> this x-dim)) + (a3-0 (-> this z-dim)) ) (when (and (>= v1-1 0) (< v1-1 a2-1) (>= a1-1 0) (< a1-1 a3-0)) (let* ((a2-3 (+ v1-1 (* a1-1 a2-1))) - (gp-0 (-> obj data a2-3)) + (gp-0 (-> this data a2-3)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 x) (+ (-> obj x-offset) (/ (the float v1-1) (-> obj x-inv-spacing)))) + (set! (-> s5-0 x) (+ (-> this x-offset) (/ (the float v1-1) (-> this x-inv-spacing)))) (set! (-> s5-0 y) 0.0) - (set! (-> s5-0 z) (+ (-> obj z-offset) (/ (the float a1-1) (-> obj z-inv-spacing)))) - (set! (-> s5-0 y) (get-height-at-point obj s5-0)) + (set! (-> s5-0 z) (+ (-> this z-offset) (/ (the float a1-1) (-> this z-inv-spacing)))) + (set! (-> s5-0 y) (get-height-at-point this s5-0)) (let ((s4-0 add-debug-text-3d) (s3-0 #t) (s2-0 318) @@ -92,19 +92,19 @@ ) ;; definition for method 9 of type xz-height-map -(defmethod get-height-at-point xz-height-map ((obj xz-height-map) (arg0 vector)) - (let* ((f0-1 (fmax 0.0 (* (-> obj x-inv-spacing) (- (-> arg0 x) (-> obj x-offset))))) - (f2-4 (fmax 0.0 (* (-> obj z-inv-spacing) (- (-> arg0 z) (-> obj z-offset))))) +(defmethod get-height-at-point xz-height-map ((this xz-height-map) (arg0 vector)) + (let* ((f0-1 (fmax 0.0 (* (-> this x-inv-spacing) (- (-> arg0 x) (-> this x-offset))))) + (f2-4 (fmax 0.0 (* (-> this z-inv-spacing) (- (-> arg0 z) (-> this z-offset))))) (a2-0 (the int f0-1)) (a1-1 (the int f2-4)) (f1-7 (- f0-1 (the float a2-0))) (f0-4 (- f2-4 (the float a1-1))) - (v1-0 (-> obj x-dim)) - (a3-0 (-> obj z-dim)) + (v1-0 (-> this x-dim)) + (a3-0 (-> this z-dim)) (a1-7 (the-as (pointer int8) - (+ (+ (min a2-0 (+ v1-0 -2)) (* (min a1-1 (+ a3-0 -2)) v1-0) 0) (the-as int (the-as pointer (-> obj data)))) + (+ (+ (min a2-0 (+ v1-0 -2)) (* (min a1-1 (+ a3-0 -2)) v1-0) 0) (the-as int (the-as pointer (-> this data)))) ) ) (f3-3 (the float (-> a1-7 0))) @@ -114,7 +114,7 @@ (f3-5 (+ (* f3-3 (- 1.0 f1-7)) (* f4-1 f1-7))) (f1-9 (+ (* f2-8 (- 1.0 f1-7)) (* f5-1 f1-7))) ) - (+ (* (+ (* f3-5 (- 1.0 f0-4)) (* f1-9 f0-4)) (-> obj y-scale)) (-> obj y-offset)) + (+ (* (+ (* f3-5 (- 1.0 f0-4)) (* f1-9 f0-4)) (-> this y-scale)) (-> this y-offset)) ) ) @@ -132,31 +132,31 @@ ;; definition for method 10 of type xz-height-map ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-mesh xz-height-map ((obj xz-height-map) (arg0 vector)) +(defmethod debug-draw-mesh xz-height-map ((this xz-height-map) (arg0 vector)) (local-vars (sv-80 int) (sv-96 int)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'matrix))) (mem-copy! (the-as pointer (-> s5-0 vector 2)) (the-as pointer arg0) 32) (.svf (&-> (-> s5-0 vector) 0 quad) vf0) - (let ((f30-0 (/ 1.0 (-> obj z-inv-spacing))) - (f28-0 (/ 1.0 (-> obj x-inv-spacing))) - (s4-0 (-> obj x-dim)) - (s3-0 (-> obj z-dim)) + (let ((f30-0 (/ 1.0 (-> this z-inv-spacing))) + (f28-0 (/ 1.0 (-> this x-inv-spacing))) + (s4-0 (-> this x-dim)) + (s3-0 (-> this z-dim)) ) - (let ((s2-0 (&-> (-> obj data) 0))) - (set! (-> s5-0 vector 0 z) (-> obj z-offset)) + (let ((s2-0 (&-> (-> this data) 0))) + (set! (-> s5-0 vector 0 z) (-> this z-offset)) (countdown (s1-0 s3-0) (let ((s0-0 s2-0)) - (set! (-> s5-0 vector 0 x) (-> obj x-offset)) - (set! (-> s5-0 vector 0 y) (+ (-> obj y-offset) (* (the float (-> s0-0 0)) (-> obj y-scale)))) + (set! (-> s5-0 vector 0 x) (-> this x-offset)) + (set! (-> s5-0 vector 0 y) (+ (-> this y-offset) (* (the float (-> s0-0 0)) (-> this y-scale)))) (set! sv-80 (+ s4-0 -1)) (while (nonzero? sv-80) (set! sv-80 (+ sv-80 -1)) (set! (-> s5-0 vector 1 quad) (-> s5-0 vector 0 quad)) (+! (-> s5-0 vector 0 x) f28-0) (set! s0-0 (&-> s0-0 1)) - (set! (-> s5-0 vector 0 y) (+ (-> obj y-offset) (* (the float (-> s0-0 0)) (-> obj y-scale)))) + (set! (-> s5-0 vector 0 y) (+ (-> this y-offset) (* (the float (-> s0-0 0)) (-> this y-scale)))) (if (and (point-in-bbox? (the-as bounding-box (-> s5-0 vector 2)) (the-as vector (-> s5-0 vector))) (point-in-bbox? (the-as bounding-box (-> s5-0 vector 2)) (-> s5-0 vector 1)) ) @@ -176,13 +176,13 @@ (&+! s2-0 s4-0) ) ) - (let ((s2-1 (&-> (-> obj data) 0))) - (set! (-> s5-0 vector 0 x) (-> obj x-offset)) + (let ((s2-1 (&-> (-> this data) 0))) + (set! (-> s5-0 vector 0 x) (-> this x-offset)) (countdown (s1-1 s4-0) (let ((s0-1 (the-as pointer s2-1))) - (set! (-> s5-0 vector 0 z) (-> obj z-offset)) + (set! (-> s5-0 vector 0 z) (-> this z-offset)) (set! (-> s5-0 vector 0 y) - (+ (-> obj y-offset) (* (the float (-> (the-as (pointer int8) s0-1) 0)) (-> obj y-scale))) + (+ (-> this y-offset) (* (the float (-> (the-as (pointer int8) s0-1) 0)) (-> this y-scale))) ) (set! sv-96 (+ s3-0 -1)) (while (nonzero? sv-96) @@ -191,7 +191,7 @@ (+! (-> s5-0 vector 0 z) f30-0) (&+! s0-1 s4-0) (set! (-> s5-0 vector 0 y) - (+ (-> obj y-offset) (* (the float (-> (the-as (pointer int8) s0-1))) (-> obj y-scale))) + (+ (-> this y-offset) (* (the float (-> (the-as (pointer int8) s0-1))) (-> this y-scale))) ) (if (and (point-in-bbox? (the-as bounding-box (-> s5-0 vector 2)) (the-as vector (-> s5-0 vector))) (point-in-bbox? (the-as bounding-box (-> s5-0 vector 2)) (-> s5-0 vector 1)) @@ -221,7 +221,7 @@ ;; definition for method 13 of type xz-height-map ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw xz-height-map ((obj xz-height-map) (arg0 vector)) +(defmethod debug-draw xz-height-map ((this xz-height-map) (arg0 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) @@ -251,9 +251,9 @@ (.add.x.vf vf5 vf4 vf6 :mask #b111) (.svf (&-> a1-2 quad) vf5) ) - (debug-draw-mesh obj (the-as vector (-> v1-0 vector))) + (debug-draw-mesh this (the-as vector (-> v1-0 vector))) ) - (debug-draw-at-point obj arg0) + (debug-draw-at-point this arg0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc b/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc index 17eb755020..b0d06af982 100644 --- a/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/nav-graph-h_REF.gc @@ -36,26 +36,26 @@ ) ;; definition for method 3 of type nav-branch -(defmethod inspect nav-branch ((obj nav-branch)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-branch ((this nav-branch)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-branch) - (format #t "~1Tnode[2] @ #x~X~%" (-> obj node)) - (format #t "~1Tsrc-node: ~A~%" (-> obj src-node)) - (format #t "~1Tdest-node: ~A~%" (-> obj dest-node)) - (format #t "~1Ttemp-dest-node-id: ~D~%" (-> obj dest-node)) - (format #t "~1Tspeed-limit: ~D~%" (-> obj speed-limit)) - (format #t "~1Tdensity: ~D~%" (-> obj density)) - (format #t "~1Tclock-type: ~D~%" (-> obj clock-type)) - (format #t "~1Tclock-mask: ~D~%" (-> obj clock-mask)) - (format #t "~1Tmax-user-count: ~D~%" (-> obj max-user-count)) - (format #t "~1Tuser-count: ~D~%" (-> obj user-count)) - (format #t "~1Twidth: ~D~%" (-> obj width)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "[~8x] ~A~%" this 'nav-branch) + (format #t "~1Tnode[2] @ #x~X~%" (-> this node)) + (format #t "~1Tsrc-node: ~A~%" (-> this src-node)) + (format #t "~1Tdest-node: ~A~%" (-> this dest-node)) + (format #t "~1Ttemp-dest-node-id: ~D~%" (-> this dest-node)) + (format #t "~1Tspeed-limit: ~D~%" (-> this speed-limit)) + (format #t "~1Tdensity: ~D~%" (-> this density)) + (format #t "~1Tclock-type: ~D~%" (-> this clock-type)) + (format #t "~1Tclock-mask: ~D~%" (-> this clock-mask)) + (format #t "~1Tmax-user-count: ~D~%" (-> this max-user-count)) + (format #t "~1Tuser-count: ~D~%" (-> this user-count)) + (format #t "~1Twidth: ~D~%" (-> this width)) + (format #t "~1Tflags: ~D~%" (-> this flags)) (label cfg-4) - obj + this ) ;; definition of type nav-node @@ -96,23 +96,23 @@ ) ;; definition for method 3 of type nav-node -(defmethod inspect nav-node ((obj nav-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-node ((this nav-node)) + (when (not this) + (set! this this) (goto cfg-14) ) - (format #t "[~8x] ~A~%" obj 'nav-node) - (format #t "~1Tdata[32] @ #x~X~%" (-> obj position)) - (format #t "~1Tposition: ~`vector`P~%" (-> obj position)) - (format #t "~1Tpos-x: ~f~%" (-> obj position x)) - (format #t "~1Tpos-y: ~f~%" (-> obj position y)) - (format #t "~1Tpos-z: ~f~%" (-> obj position z)) - (format #t "~1Tangle: ~D~%" (-> obj angle)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tradius: ~D~%" (-> obj radius)) - (format #t "~1Tbranch-count: ~D~%" (-> obj branch-count)) - (format #t "~1Tflags: #x~X : (nav-node-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'nav-node) + (format #t "~1Tdata[32] @ #x~X~%" (-> this position)) + (format #t "~1Tposition: ~`vector`P~%" (-> this position)) + (format #t "~1Tpos-x: ~f~%" (-> this position x)) + (format #t "~1Tpos-y: ~f~%" (-> this position y)) + (format #t "~1Tpos-z: ~f~%" (-> this position z)) + (format #t "~1Tangle: ~D~%" (-> this angle)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tradius: ~D~%" (-> this radius)) + (format #t "~1Tbranch-count: ~D~%" (-> this branch-count)) + (format #t "~1Tflags: #x~X : (nav-node-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (nav-node-flag-byte blocked)) (nav-node-flag-byte blocked)) (format #t "blocked ") ) @@ -130,65 +130,65 @@ ) ) (format #t ")~%") - (format #t "~1Tpad0[1] @ #x~X~%" (-> obj pad0)) - (format #t "~1Tbranch-array: #x~X~%" (-> obj branch-array)) - (format #t "~1Tnav-mesh-id: ~D~%" (-> obj nav-mesh-id)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tpad0[1] @ #x~X~%" (-> this pad0)) + (format #t "~1Tbranch-array: #x~X~%" (-> this branch-array)) + (format #t "~1Tnav-mesh-id: ~D~%" (-> this nav-mesh-id)) + (format #t "~1Tlevel: ~A~%" (-> this level)) (label cfg-14) - obj + this ) ;; definition for method 11 of type nav-branch -(defmethod get-density nav-branch ((obj nav-branch)) +(defmethod get-density nav-branch ((this nav-branch)) "TODO @returns `density * 0.0078125` - is this some kind of trick?" - (* 0.0078125 (the float (-> obj density))) + (* 0.0078125 (the float (-> this density))) ) ;; definition for method 12 of type nav-branch -(defmethod get-speed-limit nav-branch ((obj nav-branch)) +(defmethod get-speed-limit nav-branch ((this nav-branch)) "TODO @returns `speed-limit * 1024.0`" - (* 1024.0 (the float (-> obj speed-limit))) + (* 1024.0 (the float (-> this speed-limit))) ) ;; definition for method 13 of type nav-branch -(defmethod get-width nav-branch ((obj nav-branch)) +(defmethod get-width nav-branch ((this nav-branch)) "TODO @returns `width * 256.0`" - (* 256.0 (the float (-> obj width))) + (* 256.0 (the float (-> this width))) ) ;; definition for method 14 of type nav-branch -(defmethod user-limit-reached? nav-branch ((obj nav-branch)) - (>= (-> obj user-count) (-> obj max-user-count)) +(defmethod user-limit-reached? nav-branch ((this nav-branch)) + (>= (-> this user-count) (-> this max-user-count)) ) ;; definition for method 15 of type nav-branch -(defmethod dest-node-id-at-max? nav-branch ((obj nav-branch)) +(defmethod dest-node-id-at-max? nav-branch ((this nav-branch)) "@returns if `dest-node`'s `id` is equal to `#FFFF` @see [[nav-node]]" - (!= (-> obj dest-node id) #xffff) + (!= (-> this dest-node id) #xffff) ) ;; definition for method 21 of type nav-node -(defmethod get-radius nav-node ((obj nav-node)) +(defmethod get-radius nav-node ((this nav-node)) "TODO @returns `radius * 1024.0" - (* 1024.0 (the float (-> obj radius))) + (* 1024.0 (the float (-> this radius))) ) ;; definition for method 20 of type nav-node -(defmethod get-angle nav-node ((obj nav-node)) - (the float (-> obj angle)) +(defmethod get-angle nav-node ((this nav-node)) + (the float (-> this angle)) ) ;; definition for method 19 of type nav-node -(defmethod calc-sine-and-cosine! nav-node ((obj nav-node) (ret vector)) +(defmethod calc-sine-and-cosine! nav-node ((this nav-node) (ret vector)) "Computes the sine and cosine of the `angle`. @param! ret The result @returns Nothing, the result will be in `ret`" - (let ((angle (the float (-> obj angle))) + (let ((angle (the float (-> this angle))) (sin-cos-result (new 'stack-no-clear 'vector)) ) (sincos! sin-cos-result angle) @@ -202,10 +202,10 @@ ;; definition for method 18 of type nav-node ;; INFO: Used lq/sq -(defmethod get-position nav-node ((obj nav-node) (ret vector)) +(defmethod get-position nav-node ((this nav-node) (ret vector)) "@param! ret The [[vector]] that is modified to hold the result @returns the `position` [[vector]] with a `w` component of `1.0`" - (set! (-> ret quad) (-> obj position quad)) + (set! (-> ret quad) (-> this position quad)) (set! (-> ret w) 1.0) ret ) @@ -225,20 +225,20 @@ ) ;; definition for method 3 of type nav-graph-link -(defmethod inspect nav-graph-link ((obj nav-graph-link)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-graph-link ((this nav-graph-link)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-graph-link) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tdest-graph-id: ~D~%" (-> obj dest-graph-id)) - (format #t "~1Tsrc-branch-id: ~D~%" (-> obj src-branch-id)) - (format #t "~1Tdest-node-id: ~D~%" (-> obj dest-node-id)) - (format #t "~1Tdest-graph: ~A~%" (-> obj dest-graph)) - (format #t "~1Tdummy-node: #~%" (-> obj dummy-node)) + (format #t "[~8x] ~A~%" this 'nav-graph-link) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tdest-graph-id: ~D~%" (-> this dest-graph-id)) + (format #t "~1Tsrc-branch-id: ~D~%" (-> this src-branch-id)) + (format #t "~1Tdest-node-id: ~D~%" (-> this dest-node-id)) + (format #t "~1Tdest-graph: ~A~%" (-> this dest-graph)) + (format #t "~1Tdummy-node: #~%" (-> this dummy-node)) (label cfg-4) - obj + this ) ;; definition of type nav-graph @@ -301,36 +301,36 @@ ) ;; definition for method 3 of type nav-graph -(defmethod inspect nav-graph ((obj nav-graph)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-graph ((this nav-graph)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) - (format #t "~1Tbranch-count: ~D~%" (-> obj branch-count)) - (format #t "~1Tnode-array: #x~X~%" (-> obj node-array)) - (format #t "~1Tbranch-array: #x~X~%" (-> obj branch-array)) - (format #t "~1Tlink-count: ~D~%" (-> obj link-count)) - (format #t "~1Tpad2: ~D~%" (-> obj pad2)) - (format #t "~1Tlink-array: #x~X~%" (-> obj link-array)) - (format #t "~1Tfirst-node: ~D~%" (-> obj first-node)) - (format #t "~1Tpad0: ~D~%" (-> obj pad0)) - (format #t "~1Tpatched: ~A~%" (-> obj patched)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tpad1[6] @ #x~X~%" (-> obj pad1)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tbranch-count: ~D~%" (-> this branch-count)) + (format #t "~1Tnode-array: #x~X~%" (-> this node-array)) + (format #t "~1Tbranch-array: #x~X~%" (-> this branch-array)) + (format #t "~1Tlink-count: ~D~%" (-> this link-count)) + (format #t "~1Tpad2: ~D~%" (-> this pad2)) + (format #t "~1Tlink-array: #x~X~%" (-> this link-array)) + (format #t "~1Tfirst-node: ~D~%" (-> this first-node)) + (format #t "~1Tpad0: ~D~%" (-> this pad0)) + (format #t "~1Tpatched: ~A~%" (-> this patched)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tpad1[6] @ #x~X~%" (-> this pad1)) (label cfg-4) - obj + this ) ;; definition for method 41 of type nav-graph -(defmethod node-at-idx nav-graph ((obj nav-graph) (idx int)) +(defmethod node-at-idx nav-graph ((this nav-graph) (idx int)) "Get the `nav-node` at a given position. @param idx The position in the `node-array` to return @returns the [[nav-node]] if it can be found, otherwise return [[#f]]" (let ((v0-0 (the-as nav-node #f))) - (if (and (>= idx 0) (< idx (-> obj node-count))) - (set! v0-0 (-> obj node-array idx)) + (if (and (>= idx 0) (< idx (-> this node-count))) + (set! v0-0 (-> this node-array idx)) ) v0-0 ) diff --git a/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc b/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc index ef6b5994f0..f51121ff5b 100644 --- a/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/nav-graph_REF.gc @@ -3,50 +3,50 @@ ;; definition for method 16 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-density nav-branch ((obj nav-branch) (arg0 float)) - (set! (-> obj density) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 128.0 arg0))))))) +(defmethod set-density nav-branch ((this nav-branch) (arg0 float)) + (set! (-> this density) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 128.0 arg0))))))) 0 (none) ) ;; definition for method 17 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-speed-limit nav-branch ((obj nav-branch) (arg0 float)) - (set! (-> obj speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) +(defmethod set-speed-limit nav-branch ((this nav-branch) (arg0 float)) + (set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) 0 (none) ) ;; definition for method 18 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-width nav-branch ((obj nav-branch) (arg0 float)) - (set! (-> obj width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) +(defmethod set-width nav-branch ((this nav-branch) (arg0 float)) + (set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0))))))) 0 (none) ) ;; definition for method 19 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-src-node nav-branch ((obj nav-branch) (arg0 nav-node)) - (set! (-> obj src-node) arg0) +(defmethod set-src-node nav-branch ((this nav-branch) (arg0 nav-node)) + (set! (-> this src-node) arg0) 0 (none) ) ;; definition for method 20 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-dst-node nav-branch ((obj nav-branch) (arg0 nav-node)) - (set! (-> obj dest-node) arg0) +(defmethod set-dst-node nav-branch ((this nav-branch) (arg0 nav-node)) + (set! (-> this dest-node) arg0) 0 (none) ) ;; definition for method 9 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod set-default-density-speed-and-width nav-branch ((obj nav-branch)) - (set-density obj 0.25) - (set-speed-limit obj 61440.0) - (set-width obj 16384.0) +(defmethod set-default-density-speed-and-width nav-branch ((this nav-branch)) + (set-density this 0.25) + (set-speed-limit this 61440.0) + (set-width this 16384.0) 0 (none) ) @@ -54,7 +54,7 @@ ;; definition for method 9 of type nav-node ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw nav-node ((obj nav-node)) +(defmethod debug-draw nav-node ((this nav-node)) (rlet ((vf0 :class vf) (vf4 :class vf) (vf5 :class vf) @@ -64,17 +64,17 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'sphere)) ) - (let ((a1-0 obj) + (let ((a1-0 this) (v1-0 gp-0) ) (set! (-> v1-0 quad) (-> a1-0 position quad)) (set! (-> v1-0 w) 1.0) ) (set! (-> s4-0 quad) (-> gp-0 quad)) - (let ((v1-2 obj)) + (let ((v1-2 this)) (set! (-> s4-0 r) (* 1024.0 (the float (-> v1-2 radius)))) ) - (when (logtest? (-> obj flags) (nav-node-flag-byte selected)) + (when (logtest? (-> this flags) (nav-node-flag-byte selected)) (let ((v1-8 (new 'stack-no-clear 'nav-graph-link))) (let ((a1-3 (&-> v1-8 id))) (let ((a0-6 gp-0)) @@ -107,7 +107,7 @@ ) ) ) - (when (and (not (logtest? (-> obj flags) (nav-node-flag-byte hidden))) + (when (and (not (logtest? (-> this flags) (nav-node-flag-byte hidden))) (let ((f0-6 (vector-vector-distance-squared gp-0 (camera-pos))) (f1-2 327680.0) ) @@ -119,13 +119,13 @@ (s3-1 #t) (s2-1 324) ) - (format (clear *temp-string*) "~D ~D" (-> obj id) (-> obj nav-mesh-id)) + (format (clear *temp-string*) "~D ~D" (-> this id) (-> this nav-mesh-id)) (s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* gp-0 - (if (logtest? (-> obj flags) (nav-node-flag-byte blocked)) + (if (logtest? (-> this flags) (nav-node-flag-byte blocked)) (font-color red) (font-color cyan) ) @@ -137,7 +137,7 @@ (s2-2 324) (s1-1 (new 'stack-no-clear 'vector)) ) - (let ((f0-8 (the float (-> obj angle))) + (let ((f0-8 (the float (-> this angle))) (s5-1 (new 'stack-no-clear 'vector)) ) (sincos! s5-1 f0-8) @@ -157,13 +157,13 @@ ;; definition for method 10 of type nav-branch ;; WARN: Return type mismatch int vs none. -(defmethod debug-print nav-branch ((obj nav-branch) (arg0 object) (arg1 int)) - (format arg0 "~S~T~T~T (new-nav-branch :dest-node-id ~d~%" arg1 (-> obj dest-node id)) +(defmethod debug-print nav-branch ((this nav-branch) (arg0 object) (arg1 int)) + (format arg0 "~S~T~T~T (new-nav-branch :dest-node-id ~d~%" arg1 (-> this dest-node id)) (let ((t9-1 format) (a0-2 arg0) (a1-2 "~S~T~T~T~T~T :density ~4,,3f~%") (a2-2 arg1) - (v1-1 obj) + (v1-1 this) ) (t9-1 a0-2 a1-2 a2-2 (* 0.0078125 (the float (-> v1-1 density)))) ) @@ -171,7 +171,7 @@ (a0-3 arg0) (a1-3 "~S~T~T~T~T~T :width ~4,,3M~%") (a2-3 arg1) - (v1-3 obj) + (v1-3 this) ) (t9-2 a0-3 a1-3 a2-3 (* 256.0 (the float (-> v1-3 width)))) ) @@ -179,16 +179,16 @@ (a0-4 arg0) (a1-4 "~S~T~T~T~T~T :speed-limit ~4,,3M~%") (a2-4 arg1) - (v1-5 obj) + (v1-5 this) ) (t9-3 a0-4 a1-4 a2-4 (* 1024.0 (the float (-> v1-5 speed-limit)))) ) - (when (nonzero? (-> obj clock-type)) + (when (nonzero? (-> this clock-type)) (let ((t9-4 format) (a0-5 arg0) (a1-5 "~S~T~T~T~T~T :clock-type ~S~%") (a2-5 arg1) - (v1-9 (-> obj clock-type)) + (v1-9 (-> this clock-type)) ) (t9-4 a0-5 a1-5 a2-5 (cond ((= v1-9 (nav-branch-clock-type clock3)) @@ -210,7 +210,7 @@ ) ) (format arg0 "~S~T~T~T~T~T :clock-mask (" arg1) - (let ((s4-1 (-> obj clock-mask))) + (let ((s4-1 (-> this clock-mask))) (if (= (logand s4-1 (nav-branch-clock-mask phase-1a)) (nav-branch-clock-mask phase-1a)) (format arg0 "phase-1a ") ) @@ -246,14 +246,14 @@ ;; definition for method 10 of type nav-node ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-print nav-node ((obj nav-node) (arg0 symbol) (arg1 string)) - (format arg0 "~S (new-nav-node :id ~d~%" arg1 (-> obj id)) +(defmethod debug-print nav-node ((this nav-node) (arg0 symbol) (arg1 string)) + (format arg0 "~S (new-nav-node :id ~d~%" arg1 (-> this id)) (format arg0 "~S~T :branch-list (~%" arg1) - (dotimes (s3-0 (-> obj branch-count)) - (debug-print (-> obj branch-array s3-0) arg0 (the-as int arg1)) + (dotimes (s3-0 (-> this branch-count)) + (debug-print (-> this branch-array s3-0) arg0 (the-as int arg1)) ) (format arg0 "~S~T~T~T )~%" arg1) - (let* ((v1-6 (-> obj flags)) + (let* ((v1-6 (-> this flags)) (s3-1 (logclear v1-6 (nav-node-flag-byte visited blocked))) ) (when (nonzero? s3-1) @@ -277,7 +277,7 @@ ) ) (let ((v1-24 (new 'stack-no-clear 'vector))) - (let ((a2-6 obj) + (let ((a2-6 this) (a0-19 v1-24) ) (set! (-> a0-19 quad) (-> a2-6 position quad)) @@ -285,20 +285,20 @@ ) (format arg0 "~S~T :position (~4,,2M ~4,,2M ~4,,2M)~%" arg1 (-> v1-24 x) (-> v1-24 y) (-> v1-24 z)) ) - (format arg0 "~S~T :angle ~4,,3f~%" arg1 (* 0.005493164 (the float (-> obj angle)))) + (format arg0 "~S~T :angle ~4,,3f~%" arg1 (* 0.005493164 (the float (-> this angle)))) (let ((t9-13 format) (a0-22 arg0) (a1-16 "~S~T :radius ~4,,2M~%") (a2-11 arg1) - (v1-30 obj) + (v1-30 this) ) (t9-13 a0-22 a1-16 a2-11 (* 1024.0 (the float (-> v1-30 radius)))) ) - (if (nonzero? (-> obj nav-mesh-id)) - (format arg0 "~S~T :nav-mesh-id ~d~%" arg1 (-> obj nav-mesh-id)) + (if (nonzero? (-> this nav-mesh-id)) + (format arg0 "~S~T :nav-mesh-id ~d~%" arg1 (-> this nav-mesh-id)) ) - (if (-> obj level) - (format arg0 "~S~T :level ~s~%" arg1 (-> obj level)) + (if (-> this level) + (format arg0 "~S~T :level ~s~%" arg1 (-> this level)) ) (format arg0 "~S~T )~%" arg1) 0 @@ -308,10 +308,10 @@ ;; definition for method 13 of type nav-node ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-pos-xyz nav-node ((obj nav-node) (arg0 vector)) - (let ((f0-0 (-> obj position w))) - (set! (-> obj position quad) (-> arg0 quad)) - (set! (-> obj position w) f0-0) +(defmethod set-pos-xyz nav-node ((this nav-node) (arg0 vector)) + (let ((f0-0 (-> this position w))) + (set! (-> this position quad) (-> arg0 quad)) + (set! (-> this position w) f0-0) ) 0 (none) @@ -319,34 +319,34 @@ ;; definition for method 14 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod set-angle-from-heading nav-node ((obj nav-node) (arg0 vector)) - (set! (-> obj angle) (the-as uint (the int (atan (- (-> arg0 z)) (-> arg0 x))))) +(defmethod set-angle-from-heading nav-node ((this nav-node) (arg0 vector)) + (set! (-> this angle) (the-as uint (the int (atan (- (-> arg0 z)) (-> arg0 x))))) 0 (none) ) ;; definition for method 16 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod set-radius nav-node ((obj nav-node) (arg0 float)) - (set! (-> obj radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) +(defmethod set-radius nav-node ((this nav-node) (arg0 float)) + (set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0))))))) 0 (none) ) ;; definition for method 17 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod set-angle nav-node ((obj nav-node) (arg0 float)) - (set! (-> obj angle) (the-as uint (the int (+ 0.5 arg0)))) +(defmethod set-angle nav-node ((this nav-node) (arg0 float)) + (set! (-> this angle) (the-as uint (the int (+ 0.5 arg0)))) 0 (none) ) ;; definition for method 15 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod set-id-and-link-branches-back nav-node ((obj nav-node) (arg0 uint)) - (set! (-> obj id) arg0) - (dotimes (v1-0 (-> obj branch-count)) - (set! (-> obj branch-array v1-0 src-node) obj) +(defmethod set-id-and-link-branches-back nav-node ((this nav-node) (arg0 uint)) + (set! (-> this id) arg0) + (dotimes (v1-0 (-> this branch-count)) + (set! (-> this branch-array v1-0 src-node) this) ) 0 (none) @@ -354,15 +354,15 @@ ;; definition for method 12 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod init-from-pt-and-heading nav-node ((obj nav-node) (arg0 vector) (arg1 vector)) - (set-pos-xyz obj arg0) - (set-angle-from-heading obj arg1) - (set! (-> obj flags) (nav-node-flag-byte pedestrian selected)) - (set-radius obj 32768.0) - (set! (-> obj level) 'ctyport) - (set! (-> obj nav-mesh-id) (the-as uint 0)) - (dotimes (s5-1 (-> obj branch-count)) - (set-default-density-speed-and-width (-> obj branch-array s5-1)) +(defmethod init-from-pt-and-heading nav-node ((this nav-node) (arg0 vector) (arg1 vector)) + (set-pos-xyz this arg0) + (set-angle-from-heading this arg1) + (set! (-> this flags) (nav-node-flag-byte pedestrian selected)) + (set-radius this 32768.0) + (set! (-> this level) 'ctyport) + (set! (-> this nav-mesh-id) (the-as uint 0)) + (dotimes (s5-1 (-> this branch-count)) + (set-default-density-speed-and-width (-> this branch-array s5-1)) ) 0 (none) @@ -370,18 +370,18 @@ ;; definition for method 11 of type nav-node ;; WARN: Return type mismatch int vs none. -(defmethod remove-branch-by-idx nav-node ((obj nav-node) (arg0 int)) - (when (and (>= arg0 0) (< arg0 (-> obj branch-count))) +(defmethod remove-branch-by-idx nav-node ((this nav-node) (arg0 int)) + (when (and (>= arg0 0) (< arg0 (-> this branch-count))) (let ((s5-0 (+ arg0 1)) (s4-0 arg0) ) - (while (< s5-0 (-> obj branch-count)) - (mem-copy! (the-as pointer (-> obj branch-array s4-0)) (the-as pointer (-> obj branch-array s5-0)) 16) + (while (< s5-0 (-> this branch-count)) + (mem-copy! (the-as pointer (-> this branch-array s4-0)) (the-as pointer (-> this branch-array s5-0)) 16) (+! s5-0 1) (+! s4-0 1) ) ) - (+! (-> obj branch-count) -1) + (+! (-> this branch-count) -1) ) 0 (none) @@ -389,11 +389,11 @@ ;; definition for method 18 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod debug-reset-branch-array nav-graph ((obj nav-graph) (arg0 nav-node) (arg1 int)) +(defmethod debug-reset-branch-array nav-graph ((this nav-graph) (arg0 nav-node) (arg1 int)) "kinda dangerous" - (set! (-> arg0 branch-array) (the-as (inline-array nav-branch) (-> obj branch-array (-> obj branch-count)))) + (set! (-> arg0 branch-array) (the-as (inline-array nav-branch) (-> this branch-array (-> this branch-count)))) (set! (-> arg0 branch-count) arg1) - (+! (-> obj branch-count) arg1) + (+! (-> this branch-count) arg1) (dotimes (s4-0 arg1) (let ((s3-0 (-> arg0 branch-array s4-0))) (set-default-density-speed-and-width s3-0) @@ -406,16 +406,16 @@ ) ;; definition for method 16 of type nav-graph -(defmethod debug-add-node nav-graph ((obj nav-graph) (arg0 int)) +(defmethod debug-add-node nav-graph ((this nav-graph) (arg0 int)) (let ((s4-0 (the-as nav-node #f))) - (let ((s5-0 (-> obj node-count)) - (v1-1 (+ arg0 -1 (-> obj branch-count))) + (let ((s5-0 (-> this node-count)) + (v1-1 (+ arg0 -1 (-> this branch-count))) ) (when (and (< s5-0 2000) (< v1-1 2500)) - (set! s4-0 (-> obj node-array s5-0)) - (debug-reset-branch-array obj s4-0 arg0) + (set! s4-0 (-> this node-array s5-0)) + (debug-reset-branch-array this s4-0 arg0) (set-id-and-link-branches-back s4-0 (the-as uint s5-0)) - (+! (-> obj node-count) 1) + (+! (-> this node-count) 1) ) ) s4-0 @@ -424,12 +424,12 @@ ;; definition for method 17 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod debug-link-node-to-graph nav-graph ((obj nav-graph) (arg0 nav-node)) +(defmethod debug-link-node-to-graph nav-graph ((this nav-graph) (arg0 nav-node)) (when (> (-> arg0 branch-count) 0) (let ((a0-1 (-> arg0 branch-array 0)) (t9-0 (method-of-type nav-branch set-dst-node)) - (a2-0 obj) - (v1-4 (-> obj first-node)) + (a2-0 this) + (v1-4 (-> this first-node)) (a1-1 (the-as nav-node #f)) ) (if (and (>= v1-4 0) (< v1-4 (-> a2-0 node-count))) @@ -438,8 +438,8 @@ (t9-0 a0-1 a1-1) ) (let ((v1-9 (+ (-> arg0 id) -1))) - (when (>= v1-9 (the-as uint (-> obj first-node))) - (let ((v1-11 (-> obj node-array v1-9))) + (when (>= v1-9 (the-as uint (-> this first-node))) + (let ((v1-11 (-> this node-array v1-9))) (set! (-> v1-11 branch-count) 1) (set-dst-node (-> v1-11 branch-array 0) arg0) ) @@ -452,20 +452,20 @@ ;; definition for method 13 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-13 nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (when (and (< arg0 (-> obj node-count)) (> arg1 0)) - (let ((s4-1 (min arg1 (- (-> obj node-count) arg0)))) - (dotimes (s3-0 (-> obj node-count)) - (let ((s2-0 (-> obj node-array s3-0))) +(defmethod nav-graph-method-13 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (when (and (< arg0 (-> this node-count)) (> arg1 0)) + (let ((s4-1 (min arg1 (- (-> this node-count) arg0)))) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) (dotimes (s1-0 (-> s2-0 branch-count)) - (let ((v1-9 (nav-graph-method-40 obj (the-as int (-> s2-0 branch-array s1-0 dest-node))))) + (let ((v1-9 (nav-graph-method-40 this (the-as int (-> s2-0 branch-array s1-0 dest-node))))) (when (and (>= v1-9 arg0) (< v1-9 (+ arg0 s4-1))) - (let ((v1-11 (-> obj node-array v1-9))) + (let ((v1-11 (-> this node-array v1-9))) (cond ((= (-> v1-11 branch-count) 1) (let ((v1-14 (-> v1-11 branch-array 0 dest-node id))) (if (or (< v1-14 (the-as uint arg0)) (>= v1-14 (the-as uint (+ arg0 s4-1)))) - (set-dst-node (-> s2-0 branch-array s1-0) (-> obj node-array v1-14)) + (set-dst-node (-> s2-0 branch-array s1-0) (-> this node-array v1-14)) (remove-branch-by-idx s2-0 s1-0) ) ) @@ -480,22 +480,22 @@ ) ) ) - (dotimes (s3-1 (-> obj node-count)) - (let ((s2-1 (-> obj node-array s3-1))) + (dotimes (s3-1 (-> this node-count)) + (let ((s2-1 (-> this node-array s3-1))) (dotimes (s1-1 (-> s2-1 branch-count)) - (let ((v1-28 (nav-graph-method-40 obj (the-as int (-> s2-1 branch-array s1-1 dest-node))))) + (let ((v1-28 (nav-graph-method-40 this (the-as int (-> s2-1 branch-array s1-1 dest-node))))) (if (>= v1-28 (+ arg0 s4-1)) - (set-dst-node (-> s2-1 branch-array s1-1) (-> obj node-array (- v1-28 s4-1))) + (set-dst-node (-> s2-1 branch-array s1-1) (-> this node-array (- v1-28 s4-1))) ) ) ) ) ) (let ((s3-2 arg0) - (s2-2 (-> obj node-array (+ arg0 s4-1))) - (s1-2 (-> obj node-array arg0)) + (s2-2 (-> this node-array (+ arg0 s4-1))) + (s1-2 (-> this node-array arg0)) ) - (countdown (s0-0 (- (-> obj node-count) (+ arg0 s4-1))) + (countdown (s0-0 (- (-> this node-count) (+ arg0 s4-1))) (mem-copy! (the-as pointer s1-2) (the-as pointer s2-2) 32) (set-id-and-link-branches-back s1-2 (the-as uint s3-2)) (&+! s2-2 32) @@ -503,9 +503,9 @@ (+! s3-2 1) ) ) - (set! (-> obj node-count) (- (-> obj node-count) s4-1)) - (if (< arg0 (-> obj first-node)) - (set! (-> obj first-node) (- (-> obj first-node) s4-1)) + (set! (-> this node-count) (- (-> this node-count) s4-1)) + (if (< arg0 (-> this first-node)) + (set! (-> this first-node) (- (-> this first-node) s4-1)) ) ) ) @@ -515,24 +515,24 @@ ;; definition for method 14 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-14 nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (when (and (< arg0 (-> obj node-count)) (> arg1 0)) - (dotimes (s3-0 (-> obj node-count)) - (let ((s2-0 (-> obj node-array s3-0))) +(defmethod nav-graph-method-14 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (when (and (< arg0 (-> this node-count)) (> arg1 0)) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) (dotimes (s1-0 (-> s2-0 branch-count)) - (let ((v1-7 (nav-graph-method-40 obj (the-as int (-> s2-0 branch-array s1-0 dest-node))))) + (let ((v1-7 (nav-graph-method-40 this (the-as int (-> s2-0 branch-array s1-0 dest-node))))) (if (< arg0 v1-7) - (set-dst-node (-> s2-0 branch-array s1-0) (-> obj node-array (+ v1-7 arg1))) + (set-dst-node (-> s2-0 branch-array s1-0) (-> this node-array (+ v1-7 arg1))) ) ) ) ) ) - (let* ((s3-1 (+ arg1 -1 (-> obj node-count))) - (s2-1 (-> obj node-array (- s3-1 arg1))) - (s1-1 (-> obj node-array s3-1)) + (let* ((s3-1 (+ arg1 -1 (-> this node-count))) + (s2-1 (-> this node-array (- s3-1 arg1))) + (s1-1 (-> this node-array s3-1)) ) - (countdown (s0-0 (- (-> obj node-count) arg0)) + (countdown (s0-0 (- (-> this node-count) arg0)) (mem-copy! (the-as pointer s1-1) (the-as pointer s2-1) 32) (set-id-and-link-branches-back s1-1 (the-as uint s3-1)) (set! s2-1 (+ (the-as uint s2-1) -32)) @@ -540,17 +540,17 @@ (+! s3-1 -1) ) ) - (+! (-> obj node-count) arg1) - (+! (-> obj first-node) arg1) - (let ((s3-2 (-> obj node-array arg0)) - (s2-2 (-> obj node-array arg0)) + (+! (-> this node-count) arg1) + (+! (-> this first-node) arg1) + (let ((s3-2 (-> this node-array arg0)) + (s2-2 (-> this node-array arg0)) ) (dotimes (s1-2 arg1) (mem-copy! (the-as pointer s2-2) (the-as pointer s3-2) 32) (set-id-and-link-branches-back s2-2 (the-as uint arg0)) (+! (-> s2-2 position y) (* 8192.0 (the float (+ s1-2 1)))) - (debug-reset-branch-array obj s2-2 1) - (set-dst-node (-> s2-2 branch-array 0) (-> obj node-array (+ arg0 1))) + (debug-reset-branch-array this s2-2 1) + (set-dst-node (-> s2-2 branch-array 0) (-> this node-array (+ arg0 1))) (&+! s2-2 32) (+! arg0 1) ) @@ -562,34 +562,34 @@ ;; definition for method 15 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod debug-reset nav-graph ((obj nav-graph)) - (set! (-> obj node-count) 0) - (set! (-> obj branch-count) 0) - (set! (-> obj first-node) 0) - (set! (-> obj patched) #f) +(defmethod debug-reset nav-graph ((this nav-graph)) + (set! (-> this node-count) 0) + (set! (-> this branch-count) 0) + (set! (-> this first-node) 0) + (set! (-> this patched) #f) 0 (none) ) ;; definition for method 12 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-12 nav-graph ((obj nav-graph)) - (set! (-> obj first-node) (-> obj node-count)) +(defmethod nav-graph-method-12 nav-graph ((this nav-graph)) + (set! (-> this first-node) (-> this node-count)) 0 (none) ) ;; definition for method 28 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod print-selected-nodes nav-graph ((obj nav-graph)) +(defmethod print-selected-nodes nav-graph ((this nav-graph)) (let ((s4-0 0) (s1-0 0) (v1-0 #f) (s3-0 0) (gp-0 0) ) - (dotimes (s2-0 (-> obj node-count)) - (let* ((a0-2 (-> obj node-array s2-0)) + (dotimes (s2-0 (-> this node-count)) + (let* ((a0-2 (-> this node-array s2-0)) (s0-1 (logtest? (-> a0-2 flags) (nav-node-flag-byte selected))) ) (when s0-1 @@ -600,7 +600,7 @@ (set! s1-0 s2-0) ) (set! v1-0 (and (not s0-1) v1-0)) - (when (or v1-0 (and s0-1 (= s2-0 (+ (-> obj node-count) -1)))) + (when (or v1-0 (and s0-1 (= s2-0 (+ (-> this node-count) -1)))) (if (> s3-0 0) (format #t ", ") ) @@ -622,72 +622,72 @@ ;; definition for method 22 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod select-nodes-in-range nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (when (< arg0 (-> obj node-count)) - (let ((v1-3 (min arg1 (+ (-> obj node-count) -1))) +(defmethod select-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) ) (+ (- 1 arg0) v1-3) (while (>= v1-3 a2-3) - (let ((a1-4 (-> obj node-array a2-3))) + (let ((a1-4 (-> this node-array a2-3))) (logior! (-> a1-4 flags) (nav-node-flag-byte selected)) ) (+! a2-3 1) ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) ;; definition for method 23 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod deselect-nodes-in-range nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (when (< arg0 (-> obj node-count)) - (let ((v1-3 (min arg1 (+ (-> obj node-count) -1))) +(defmethod deselect-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) ) (+ (- 1 arg0) v1-3) (while (>= v1-3 a2-3) - (let ((a1-4 (-> obj node-array a2-3))) + (let ((a1-4 (-> this node-array a2-3))) (logclear! (-> a1-4 flags) (nav-node-flag-byte selected)) ) (+! a2-3 1) ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) ;; definition for method 24 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod toggle-select-nodes-in-range nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (when (< arg0 (-> obj node-count)) - (let ((v1-3 (min arg1 (+ (-> obj node-count) -1))) +(defmethod toggle-select-nodes-in-range nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (when (< arg0 (-> this node-count)) + (let ((v1-3 (min arg1 (+ (-> this node-count) -1))) (a2-3 arg0) ) (+ (- 1 arg0) v1-3) (while (>= v1-3 a2-3) - (let ((a1-4 (-> obj node-array a2-3))) + (let ((a1-4 (-> this node-array a2-3))) (logxor! (-> a1-4 flags) (nav-node-flag-byte selected)) ) (+! a2-3 1) ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) ;; definition for method 25 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod select-nodes-in-level nav-graph ((obj nav-graph) (arg0 symbol) (arg1 symbol)) - (dotimes (v1-0 (-> obj node-count)) - (let* ((a3-1 (-> obj node-array v1-0)) +(defmethod select-nodes-in-level nav-graph ((this nav-graph) (arg0 symbol) (arg1 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((a3-1 (-> this node-array v1-0)) (t0-2 (= (-> a3-1 level) arg0)) ) (case arg1 @@ -710,16 +710,16 @@ ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) ;; definition for method 26 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod select-nodes-by-nav-mesh-id nav-graph ((obj nav-graph) (arg0 int) (arg1 symbol)) - (dotimes (v1-0 (-> obj node-count)) - (let* ((a3-1 (-> obj node-array v1-0)) +(defmethod select-nodes-by-nav-mesh-id nav-graph ((this nav-graph) (arg0 int) (arg1 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((a3-1 (-> this node-array v1-0)) (t0-2 (= (-> a3-1 nav-mesh-id) arg0)) ) (case arg1 @@ -742,16 +742,16 @@ ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) ;; definition for method 27 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod select-nodes-by-flags nav-graph ((obj nav-graph) (arg0 nav-node-flag-byte) (arg1 nav-node-flag-byte) (arg2 symbol)) - (dotimes (v1-0 (-> obj node-count)) - (let* ((t0-1 (-> obj node-array v1-0)) +(defmethod select-nodes-by-flags nav-graph ((this nav-graph) (arg0 nav-node-flag-byte) (arg1 nav-node-flag-byte) (arg2 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let* ((t0-1 (-> this node-array v1-0)) (t1-3 (= (logand (-> t0-1 flags) arg1) arg0)) ) (case arg2 @@ -774,16 +774,16 @@ ) ) ) - (print-selected-nodes obj) + (print-selected-nodes this) 0 (none) ) ;; definition for method 29 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod assign-selected-nodes-to-level nav-graph ((obj nav-graph) (arg0 symbol)) - (dotimes (v1-0 (-> obj node-count)) - (let ((a2-1 (-> obj node-array v1-0))) +(defmethod assign-selected-nodes-to-level nav-graph ((this nav-graph) (arg0 symbol)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) (set! (-> a2-1 level) arg0) ) @@ -795,9 +795,9 @@ ;; definition for method 30 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod assign-selected-nodes-to-nav-mesh nav-graph ((obj nav-graph) (arg0 uint)) - (dotimes (v1-0 (-> obj node-count)) - (let ((a2-1 (-> obj node-array v1-0))) +(defmethod assign-selected-nodes-to-nav-mesh nav-graph ((this nav-graph) (arg0 uint)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) (set! (-> a2-1 nav-mesh-id) arg0) ) @@ -809,9 +809,9 @@ ;; definition for method 31 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod set-radius-of-selected-nodes nav-graph ((obj nav-graph) (arg0 float)) - (dotimes (s4-0 (-> obj node-count)) - (let ((a0-2 (-> obj node-array s4-0))) +(defmethod set-radius-of-selected-nodes nav-graph ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((a0-2 (-> this node-array s4-0))) (if (logtest? (-> a0-2 flags) (nav-node-flag-byte selected)) (set-radius a0-2 arg0) ) @@ -823,9 +823,9 @@ ;; definition for method 35 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod or-flags-of-selected-nodes nav-graph ((obj nav-graph) (arg0 nav-node-flag-byte)) - (dotimes (v1-0 (-> obj node-count)) - (let ((a2-1 (-> obj node-array v1-0))) +(defmethod or-flags-of-selected-nodes nav-graph ((this nav-graph) (arg0 nav-node-flag-byte)) + (dotimes (v1-0 (-> this node-count)) + (let ((a2-1 (-> this node-array v1-0))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) (logior! (-> a2-1 flags) arg0) ) @@ -837,10 +837,10 @@ ;; definition for method 36 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod and-flags-of-selected-nodes nav-graph ((obj nav-graph) (arg0 nav-node-flag-byte)) +(defmethod and-flags-of-selected-nodes nav-graph ((this nav-graph) (arg0 nav-node-flag-byte)) (let ((v1-0 (lognot arg0))) - (dotimes (a1-1 (-> obj node-count)) - (let ((a2-1 (-> obj node-array a1-1))) + (dotimes (a1-1 (-> this node-count)) + (let ((a2-1 (-> this node-array a1-1))) (if (logtest? (-> a2-1 flags) (nav-node-flag-byte selected)) (logand! (-> a2-1 flags) v1-0) ) @@ -853,9 +853,9 @@ ;; definition for method 32 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod set-speed-limit-of-selected nav-graph ((obj nav-graph) (arg0 float)) - (dotimes (s4-0 (-> obj node-count)) - (let ((s3-0 (-> obj node-array s4-0))) +(defmethod set-speed-limit-of-selected nav-graph ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) (dotimes (s2-0 (-> s3-0 branch-count)) (set-speed-limit (-> s3-0 branch-array s2-0) arg0) @@ -869,9 +869,9 @@ ;; definition for method 33 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod set-density-of-selected nav-graph ((obj nav-graph) (arg0 float)) - (dotimes (s4-0 (-> obj node-count)) - (let ((s3-0 (-> obj node-array s4-0))) +(defmethod set-density-of-selected nav-graph ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) (dotimes (s2-0 (-> s3-0 branch-count)) (set-density (-> s3-0 branch-array s2-0) arg0) @@ -885,9 +885,9 @@ ;; definition for method 34 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod set-width-of-selected nav-graph ((obj nav-graph) (arg0 float)) - (dotimes (s4-0 (-> obj node-count)) - (let ((s3-0 (-> obj node-array s4-0))) +(defmethod set-width-of-selected nav-graph ((this nav-graph) (arg0 float)) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) (when (logtest? (-> s3-0 flags) (nav-node-flag-byte selected)) (dotimes (s2-0 (-> s3-0 branch-count)) (set-width (-> s3-0 branch-array s2-0) arg0) @@ -902,10 +902,10 @@ ;; definition for method 37 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod offset-pos-of-selected nav-graph ((obj nav-graph) (arg0 vector)) +(defmethod offset-pos-of-selected nav-graph ((this nav-graph) (arg0 vector)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (dotimes (s3-0 (-> obj node-count)) - (let ((a0-2 (-> obj node-array s3-0))) + (dotimes (s3-0 (-> this node-count)) + (let ((a0-2 (-> this node-array s3-0))) (when (logtest? (-> a0-2 flags) (nav-node-flag-byte selected)) (let ((a2-0 a0-2) (v1-4 s4-0) @@ -925,12 +925,12 @@ ;; definition for method 38 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-38 nav-graph ((obj nav-graph)) +(defmethod nav-graph-method-38 nav-graph ((this nav-graph)) (let ((s5-0 (new 'stack-no-clear 'vehicle-controller)) (s4-0 (new 'stack-no-clear 'vector)) ) - (dotimes (s3-0 (-> obj node-count)) - (let ((s2-0 (-> obj node-array s3-0))) + (dotimes (s3-0 (-> this node-count)) + (let ((s2-0 (-> this node-array s3-0))) (when (and (logtest? (-> s2-0 flags) (nav-node-flag-byte selected)) (= (-> s2-0 branch-count) 1)) (let ((a1-0 (-> s2-0 branch-array 0))) (-> a1-0 dest-node) @@ -952,10 +952,10 @@ ;; definition for method 9 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-nodes nav-graph ((obj nav-graph)) +(defmethod debug-draw-nodes nav-graph ((this nav-graph)) (let ((s5-0 (new 'stack-no-clear 'matrix))) - (dotimes (s4-0 (-> obj node-count)) - (let ((s3-0 (-> obj node-array s4-0))) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) (when (not (logtest? (-> s3-0 flags) (nav-node-flag-byte hidden))) (debug-draw s3-0) (let ((a1-0 s3-0) @@ -1013,13 +1013,13 @@ ;; definition for method 10 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch nav-node vs none. -(defmethod nav-graph-method-10 nav-graph ((obj nav-graph) (arg0 vector) (arg1 int)) +(defmethod nav-graph-method-10 nav-graph ((this nav-graph) (arg0 vector) (arg1 int)) (let* ((gp-0 (the-as nav-node #f)) (f0-0 409600000.0) (f30-0 (* f0-0 f0-0)) ) - (dotimes (s2-0 (-> obj node-count)) - (let ((s1-0 (-> obj node-array s2-0)) + (dotimes (s2-0 (-> this node-count)) + (let ((s1-0 (-> this node-array s2-0)) (a1-1 (new 'stack-no-clear 'vector)) ) (when (and (not (logtest? (-> s1-0 flags) (nav-node-flag-byte hidden))) @@ -1047,9 +1047,9 @@ ;; definition for method 21 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-selected-to-height-map-height nav-graph ((obj nav-graph)) - (dotimes (s5-0 (-> obj node-count)) - (let ((s4-0 (-> obj node-array s5-0)) +(defmethod move-selected-to-height-map-height nav-graph ((this nav-graph)) + (dotimes (s5-0 (-> this node-count)) + (let ((s4-0 (-> this node-array s5-0)) (s3-0 (new 'stack-no-clear 'vector)) ) (when (and (not (logtest? (-> s4-0 flags) (nav-node-flag-byte hidden))) @@ -1076,10 +1076,10 @@ ;; definition for method 39 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-39 nav-graph ((obj nav-graph)) +(defmethod nav-graph-method-39 nav-graph ((this nav-graph)) (local-vars (sv-80 entity-nav-mesh) (sv-96 entity-nav-mesh)) - (dotimes (s5-0 (-> obj node-count)) - (let ((s4-0 (-> obj node-array s5-0)) + (dotimes (s5-0 (-> this node-count)) + (let ((s4-0 (-> this node-array s5-0)) (s3-0 (new 'stack-no-clear 'vector)) ) (let ((a1-0 s4-0) @@ -1130,21 +1130,21 @@ ) ;; definition for method 19 of type nav-graph -(defmethod nav-graph-method-19 nav-graph ((obj nav-graph) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) - (let ((gp-0 (-> obj node-array arg0)) - (s0-0 (-> obj node-array arg1)) - (s4-0 (-> obj node-array arg2)) - (s2-0 (-> obj node-array arg3)) - (s1-0 (-> obj node-array arg4)) - (s3-0 (-> obj node-array arg5)) +(defmethod nav-graph-method-19 nav-graph ((this nav-graph) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) + (let ((gp-0 (-> this node-array arg0)) + (s0-0 (-> this node-array arg1)) + (s4-0 (-> this node-array arg2)) + (s2-0 (-> this node-array arg3)) + (s1-0 (-> this node-array arg4)) + (s3-0 (-> this node-array arg5)) ) - (debug-reset-branch-array obj s0-0 2) + (debug-reset-branch-array this s0-0 2) (set-dst-node (-> s0-0 branch-array 0) s4-0) (set-dst-node (-> s0-0 branch-array 1) s1-0) - (debug-reset-branch-array obj s2-0 2) + (debug-reset-branch-array this s2-0 2) (set-dst-node (-> s2-0 branch-array 0) s1-0) (set-dst-node (-> s2-0 branch-array 1) gp-0) - (debug-reset-branch-array obj s3-0 2) + (debug-reset-branch-array this s3-0 2) (set-dst-node (-> s3-0 branch-array 0) gp-0) (set-dst-node (-> s3-0 branch-array 1) s4-0) ) @@ -1152,17 +1152,17 @@ ) ;; definition for method 40 of type nav-graph -(defmethod nav-graph-method-40 nav-graph ((obj nav-graph) (arg0 int)) +(defmethod nav-graph-method-40 nav-graph ((this nav-graph) (arg0 int)) -1 - (shr (- arg0 (the-as int (-> obj node-array 0))) 5) + (shr (- arg0 (the-as int (-> this node-array 0))) 5) ) ;; definition for method 20 of type nav-graph -(defmethod nav-graph-method-20 nav-graph ((obj nav-graph) (arg0 int) (arg1 int)) - (let ((gp-0 (-> obj node-array arg0)) - (s5-0 (-> obj node-array arg1)) +(defmethod nav-graph-method-20 nav-graph ((this nav-graph) (arg0 int) (arg1 int)) + (let ((gp-0 (-> this node-array arg0)) + (s5-0 (-> this node-array arg1)) ) - (debug-reset-branch-array obj gp-0 1) + (debug-reset-branch-array this gp-0 1) (set-dst-node (-> gp-0 branch-array 0) s5-0) ) (none) @@ -1170,12 +1170,12 @@ ;; definition for method 11 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod nav-graph-method-11 nav-graph ((obj nav-graph)) +(defmethod nav-graph-method-11 nav-graph ((this nav-graph)) (format #t "(define *traffic-nav-graph*~%") (format #t " (new-nav-graph~%") (format #t " :node-list (~%") - (dotimes (s5-0 (-> obj node-count)) - (let ((a0-5 (-> obj node-array s5-0))) + (dotimes (s5-0 (-> this node-count)) + (let ((a0-5 (-> this node-array s5-0))) (set! (-> a0-5 id) (the-as uint s5-0)) (debug-print a0-5 #t " ") ) @@ -1189,20 +1189,20 @@ ;; definition for method 42 of type nav-graph ;; WARN: Return type mismatch int vs none. -(defmethod patch-nodes nav-graph ((obj nav-graph)) +(defmethod patch-nodes nav-graph ((this nav-graph)) "Patch nodes. Node pointers are stored as indices into arrays to be allocated on the level heap and patched at runtime after loading." - (when (not (-> obj patched)) - (set! (-> obj patched) #t) + (when (not (-> this patched)) + (set! (-> this patched) #t) (let ((s5-0 0)) - (dotimes (s4-0 (-> obj node-count)) - (let ((s3-0 (-> obj node-array s4-0))) + (dotimes (s4-0 (-> this node-count)) + (let ((s3-0 (-> this node-array s4-0))) (dotimes (s2-0 (-> s3-0 branch-count)) (let ((s1-0 (-> s3-0 branch-array s2-0))) (+! s5-0 1) (set-src-node s1-0 s3-0) (let ((v1-7 (the-as object (-> s1-0 dest-node)))) - (set-dst-node s1-0 (-> obj node-array (the-as uint v1-7))) + (set-dst-node s1-0 (-> this node-array (the-as uint v1-7))) ) ) ) @@ -1218,7 +1218,7 @@ and patched at runtime after loading." ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 43 nav-graph) has a return type of none, but the expression builder found a return statement. -(defmethod copy-to-mysql-graph nav-graph ((obj nav-graph) (arg0 mysql-nav-graph) (arg1 string)) +(defmethod copy-to-mysql-graph nav-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 string)) (set! (-> arg0 node-array length) 0) (set! (-> arg0 edge-array length) 0) (set! (-> arg0 visnode-array length) 0) @@ -1226,15 +1226,15 @@ and patched at runtime after loading." (format s3-0 "select nav_graph_id from nav_graph where name='~S'" arg1) (let ((a2-2 (sql-query s3-0))) (when (!= (-> a2-2 error) 'select) - (format 0 "ERROR: sql: select error ~A for ~A~%" a2-2 obj) + (format 0 "ERROR: sql: select error ~A for ~A~%" a2-2 this) (return #f) ) (set! (-> arg0 nav_graph_id) (the-as uint (string->int (-> a2-2 data 0)))) ) ) - (dotimes (v1-7 (-> obj node-count)) + (dotimes (v1-7 (-> this node-count)) (let ((a1-6 (-> arg0 node-array data (-> arg0 node-array length))) - (a0-11 (-> obj node-array v1-7)) + (a0-11 (-> this node-array v1-7)) ) (logior! (-> a1-6 mysql-save-flag) (mysql-save-flag insert)) (set! (-> a1-6 runtime-id) (-> a0-11 id)) @@ -1312,7 +1312,7 @@ and patched at runtime after loading." ;; definition for method 44 of type nav-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod from-editor nav-graph ((obj nav-graph) (arg0 mysql-nav-graph) (arg1 symbol)) +(defmethod from-editor nav-graph ((this nav-graph) (arg0 mysql-nav-graph) (arg1 symbol)) (local-vars (v1-4 symbol) (v1-6 symbol) @@ -1325,9 +1325,9 @@ and patched at runtime after loading." (sv-96 nav-node) (sv-112 int) ) - (set! (-> obj node-count) 0) - (set! (-> obj branch-count) 0) - (set! (-> obj link-count) 0) + (set! (-> this node-count) 0) + (set! (-> this branch-count) 0) + (set! (-> this link-count) 0) (mysql-nav-graph-method-20 arg0) (let ((s5-0 0)) (let ((s2-0 0)) @@ -1344,7 +1344,7 @@ and patched at runtime after loading." (label cfg-7) (b! (not v1-6) cfg-27 :delay (nop!)) (set! sv-16 (temp-edge-size s0-0)) - (let ((s1-0 (debug-add-node obj sv-16))) + (let ((s1-0 (debug-add-node this sv-16))) (b! (not s1-0) cfg-36 :delay (nop!)) (set! (-> s1-0 id) (the-as uint (if arg1 (-> s0-0 level-node-index) @@ -1358,7 +1358,7 @@ and patched at runtime after loading." (set-radius s1-0 (-> s0-0 radius)) (set! (-> s1-0 level) (-> s0-0 level_name)) (set! (-> s1-0 nav-mesh-id) (-> s0-0 nav_mesh_id)) - (when (!= (-> obj branch-array s5-0) (-> s1-0 branch-array 0)) + (when (!= (-> this branch-array s5-0) (-> s1-0 branch-array 0)) (format 0 "nav-graph::from-editor: ERROR something went awry in allocate-branches~%") (break!) 0 @@ -1368,7 +1368,7 @@ and patched at runtime after loading." (b! #t cfg-25 :delay (nop!)) (label cfg-15) (set! sv-32 (+ sv-32 -1)) - (set! sv-64 (-> obj branch-array s5-0)) + (set! sv-64 (-> this branch-array s5-0)) (set-src-node sv-64 s1-0) (set-speed-limit sv-64 (-> (the-as mysql-nav-edge s0-1) speed_limit)) (set-density sv-64 (-> (the-as mysql-nav-edge s0-1) density)) @@ -1383,10 +1383,10 @@ and patched at runtime after loading." (label cfg-18) (b! (not v1-37) cfg-23 :delay (nop!)) (let ((t9-11 (method-of-type nav-branch set-dst-node)) - (a1-11 (-> obj node-array (if arg1 - (-> sv-48 level-node-index) - (-> (the-as mysql-nav-edge s0-1) runtime-node-id-2) - ) + (a1-11 (-> this node-array (if arg1 + (-> sv-48 level-node-index) + (-> (the-as mysql-nav-edge s0-1) runtime-node-id-2) + ) ) ) ) @@ -1395,8 +1395,8 @@ and patched at runtime after loading." (b! #t cfg-24 :delay (nop!)) (label cfg-23) (set-dst-node sv-64 (the-as nav-node #f)) - (set! sv-112 (-> obj link-count)) - (set! sv-80 (-> obj link-array sv-112)) + (set! sv-112 (-> this link-count)) + (set! sv-80 (-> this link-array sv-112)) (set! (-> sv-80 dest-graph-id) (-> (lookup-level-info2 arg0 sv-48 #f) level-id)) (set! (-> sv-80 src-branch-id) (the-as uint s5-0)) (set! (-> sv-80 dest-node-id) (the-as uint (-> sv-48 level-node-index))) @@ -1411,7 +1411,7 @@ and patched at runtime after loading." (set! (-> sv-96 nav-mesh-id) (-> sv-48 nav_mesh_id)) (set-dst-node sv-64 (-> sv-80 dummy-node)) (format #t "outputting link ~d~%" sv-112) - (+! (-> obj link-count) 1) + (+! (-> this link-count) 1) (label cfg-24) (+! s5-0 1) (set! s0-1 (-> (the-as mysql-nav-edge s0-1) temp-next-edge)) @@ -1438,7 +1438,7 @@ and patched at runtime after loading." ) (format #t "branch-count ~d~%" s5-0) ) - (set! (-> obj patched) #t) + (set! (-> this patched) #t) (label cfg-36) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc b/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc index cd08e25dbb..0677d825de 100644 --- a/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/pilot-states_REF.gc @@ -752,7 +752,7 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (local-vars (sv-16 attack-info)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self neck flex-blend) 0.0) (set! sv-16 (-> self attack-info)) (let ((v1-4 sv-16)) @@ -810,7 +810,7 @@ (case arg0 (('melt 'grenade 'explode) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 0.2)) + (until (time-elapsed? s5-0 (seconds 0.2)) (suspend) ) ) @@ -937,7 +937,7 @@ 0 (ja-channel-set! 0) (let ((s5-7 (current-time))) - (until (>= (- (current-time) s5-7) (seconds 1.8)) + (until (time-elapsed? s5-7 (seconds 1.8)) (suspend) ) ) @@ -970,7 +970,7 @@ ) ) (let ((s5-9 (current-time))) - (until (>= (- (current-time) s5-9) (seconds 0.5)) + (until (time-elapsed? s5-9 (seconds 0.5)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc b/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc index 3b40cadc49..07b563cd4a 100644 --- a/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/searchlight_REF.gc @@ -15,17 +15,17 @@ ) ;; definition for method 3 of type searchlight -(defmethod inspect searchlight ((obj searchlight)) - (when (not obj) - (set! obj obj) +(defmethod inspect searchlight ((this searchlight)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) + (format #t "~2Tsync: #~%" (-> this sync)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -82,24 +82,24 @@ ;; definition for method 11 of type searchlight ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! searchlight ((obj searchlight) (arg0 entity-actor)) +(defmethod init-from-entity! searchlight ((this searchlight) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-searchlight" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status disable-fog)) - (set! (-> obj root scale y) (rand-vu-float-range 1.8 2.0)) - (set-vector! (-> obj draw color-mult) 0.0 0.0 0.0 0.0) + (logior! (-> this draw status) (draw-control-status disable-fog)) + (set! (-> this root scale y) (rand-vu-float-range 1.8 2.0)) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.0 0.0) (let ((s4-1 (new 'stack-no-clear 'sync-info-params))) (let ((v1-12 0)) (if #t @@ -115,8 +115,8 @@ This commonly includes things such as: (set! (-> s4-1 ease-out) 0.15) (set! (-> s4-1 pause-in) 0.0) (set! (-> s4-1 pause-out) 0.0) - (initialize! (-> obj sync) s4-1) + (initialize! (-> this sync) s4-1) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/common/trail-h_REF.gc b/test/decompiler/reference/jak2/levels/city/common/trail-h_REF.gc index 8b29a1c461..79989168f1 100644 --- a/test/decompiler/reference/jak2/levels/city/common/trail-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/trail-h_REF.gc @@ -26,24 +26,24 @@ ) ;; definition for method 3 of type trail-node -(defmethod inspect trail-node ((obj trail-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect trail-node ((this trail-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'trail-node) - (format #t "~1Tnext-id: ~D~%" (-> obj next-id)) - (format #t "~1Tprev-id: ~D~%" (-> obj prev-id)) - (format #t "~1Tparent-id: ~D~%" (-> obj parent-id)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Tz: ~D~%" (-> obj z)) - (format #t "~1Tfirst-conn: ~D~%" (-> obj first-conn)) - (format #t "~1Tcost-from-start: ~D~%" (-> obj cost-from-start)) - (format #t "~1Tcost-to-goal: ~D~%" (-> obj cost-to-goal)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tconn-count: ~D~%" (-> obj conn-count)) + (format #t "[~8x] ~A~%" this 'trail-node) + (format #t "~1Tnext-id: ~D~%" (-> this next-id)) + (format #t "~1Tprev-id: ~D~%" (-> this prev-id)) + (format #t "~1Tparent-id: ~D~%" (-> this parent-id)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Tz: ~D~%" (-> this z)) + (format #t "~1Tfirst-conn: ~D~%" (-> this first-conn)) + (format #t "~1Tcost-from-start: ~D~%" (-> this cost-from-start)) + (format #t "~1Tcost-to-goal: ~D~%" (-> this cost-to-goal)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tconn-count: ~D~%" (-> this conn-count)) (label cfg-4) - obj + this ) ;; definition of type trail-visgroup @@ -58,17 +58,17 @@ ) ;; definition for method 3 of type trail-visgroup -(defmethod inspect trail-visgroup ((obj trail-visgroup)) - (when (not obj) - (set! obj obj) +(defmethod inspect trail-visgroup ((this trail-visgroup)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'trail-visgroup) - (format #t "~1Tfirst-node: ~D~%" (-> obj first-node)) - (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) - (format #t "~1Tpad: ~D~%" (-> obj pad)) + (format #t "[~8x] ~A~%" this 'trail-visgroup) + (format #t "~1Tfirst-node: ~D~%" (-> this first-node)) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tpad: ~D~%" (-> this pad)) (label cfg-4) - obj + this ) ;; definition of type trail-conn @@ -89,19 +89,19 @@ ) ;; definition for method 3 of type trail-conn -(defmethod inspect trail-conn ((obj trail-conn)) - (when (not obj) - (set! obj obj) +(defmethod inspect trail-conn ((this trail-conn)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'trail-conn) - (format #t "~1Thead-id: ~D~%" (-> obj head-id)) - (format #t "~1Ttail-id: ~D~%" (-> obj tail-id)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tvisgroup-id: ~D~%" (-> obj visgroup-id)) - (format #t "~1Tcost: ~D~%" (-> obj cost)) + (format #t "[~8x] ~A~%" this 'trail-conn) + (format #t "~1Thead-id: ~D~%" (-> this head-id)) + (format #t "~1Ttail-id: ~D~%" (-> this tail-id)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tvisgroup-id: ~D~%" (-> this visgroup-id)) + (format #t "~1Tcost: ~D~%" (-> this cost)) (label cfg-4) - obj + this ) ;; definition of type trail-conn-hash-cell @@ -117,17 +117,17 @@ ) ;; definition for method 3 of type trail-conn-hash-cell -(defmethod inspect trail-conn-hash-cell ((obj trail-conn-hash-cell)) - (when (not obj) - (set! obj obj) +(defmethod inspect trail-conn-hash-cell ((this trail-conn-hash-cell)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'trail-conn-hash-cell) - (format #t "~1Tfirst-conn: ~D~%" (-> obj first-conn)) - (format #t "~1Tconn-count: ~D~%" (-> obj conn-count)) - (format #t "~1Tpad: ~D~%" (-> obj pad)) + (format #t "[~8x] ~A~%" this 'trail-conn-hash-cell) + (format #t "~1Tfirst-conn: ~D~%" (-> this first-conn)) + (format #t "~1Tconn-count: ~D~%" (-> this conn-count)) + (format #t "~1Tpad: ~D~%" (-> this pad)) (label cfg-4) - obj + this ) ;; definition of type trail-conn-search @@ -149,25 +149,25 @@ ) ;; definition for method 3 of type trail-conn-search -(defmethod inspect trail-conn-search ((obj trail-conn-search)) - (when (not obj) - (set! obj obj) +(defmethod inspect trail-conn-search ((this trail-conn-search)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'trail-conn-search) - (format #t "~1Tbest-conn-id: ~D~%" (-> obj best-conn-id)) - (format #t "~1Tbest-dist: ~f~%" (-> obj best-dist)) - (format #t "~1Tsrc-pos: #~%" (-> obj src-pos)) - (format #t "~1Tconn-pos: #~%" (-> obj conn-pos)) - (format #t "~1Tdebug-cells-searched: ~D~%" (-> obj debug-cells-searched)) - (format #t "~1Tdebug-conns-searched: ~D~%" (-> obj debug-conns-searched)) - (format #t "~1Tbounds: #~%" (-> obj bounds)) - (format #t "~1Tcell-quads[2] @ #x~X~%" (-> obj cell-quads)) - (format #t "~1Tconn-quads[7] @ #x~X~%" (-> obj conn-quads)) - (format #t "~1Tcell-bits[2] @ #x~X~%" (-> obj cell-quads)) - (format #t "~1Tconn-bits[2] @ #x~X~%" (-> obj conn-quads)) + (format #t "[~8x] ~A~%" this 'trail-conn-search) + (format #t "~1Tbest-conn-id: ~D~%" (-> this best-conn-id)) + (format #t "~1Tbest-dist: ~f~%" (-> this best-dist)) + (format #t "~1Tsrc-pos: #~%" (-> this src-pos)) + (format #t "~1Tconn-pos: #~%" (-> this conn-pos)) + (format #t "~1Tdebug-cells-searched: ~D~%" (-> this debug-cells-searched)) + (format #t "~1Tdebug-conns-searched: ~D~%" (-> this debug-conns-searched)) + (format #t "~1Tbounds: #~%" (-> this bounds)) + (format #t "~1Tcell-quads[2] @ #x~X~%" (-> this cell-quads)) + (format #t "~1Tconn-quads[7] @ #x~X~%" (-> this conn-quads)) + (format #t "~1Tcell-bits[2] @ #x~X~%" (-> this cell-quads)) + (format #t "~1Tconn-bits[2] @ #x~X~%" (-> this conn-quads)) (label cfg-4) - obj + this ) ;; definition of type trail-conn-hash @@ -183,18 +183,18 @@ ) ;; definition for method 3 of type trail-conn-hash -(defmethod inspect trail-conn-hash ((obj trail-conn-hash)) - (when (not obj) - (set! obj obj) +(defmethod inspect trail-conn-hash ((this trail-conn-hash)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcell-width: (meters ~m)~%" (-> obj cell-width)) - (format #t "~1Torigin: #~%" (-> obj origin)) - (format #t "~1Tcell: #x~X~%" (-> obj cell)) - (format #t "~1Tconn-ids: #x~X~%" (-> obj conn-ids)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcell-width: (meters ~m)~%" (-> this cell-width)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tcell: #x~X~%" (-> this cell)) + (format #t "~1Tconn-ids: #x~X~%" (-> this conn-ids)) (label cfg-4) - obj + this ) ;; definition of type trail-cached-search-info @@ -209,17 +209,17 @@ ) ;; definition for method 3 of type trail-cached-search-info -(defmethod inspect trail-cached-search-info ((obj trail-cached-search-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect trail-cached-search-info ((this trail-cached-search-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'trail-cached-search-info) - (format #t "~1Tgoal-conn-id: ~D~%" (-> obj goal-conn-id)) - (format #t "~1Torig-goal-pos: #~%" (-> obj orig-goal-pos)) - (format #t "~1Tconn-goal-pos: #~%" (-> obj conn-goal-pos)) + (format #t "[~8x] ~A~%" this 'trail-cached-search-info) + (format #t "~1Tgoal-conn-id: ~D~%" (-> this goal-conn-id)) + (format #t "~1Torig-goal-pos: #~%" (-> this orig-goal-pos)) + (format #t "~1Tconn-goal-pos: #~%" (-> this conn-goal-pos)) (label cfg-4) - obj + this ) ;; definition of type trail-graph @@ -273,36 +273,36 @@ ) ;; definition for method 3 of type trail-graph -(defmethod inspect trail-graph ((obj trail-graph)) - (when (not obj) - (set! obj obj) +(defmethod inspect trail-graph ((this trail-graph)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tmode: ~D~%" (-> obj mode)) - (format #t "~1Tsearch-id: ~D~%" (-> obj search-id)) - (format #t "~1Topen-head-id: ~D~%" (-> obj open-head-id)) - (format #t "~1Tgoal-conn-id: ~D~%" (-> obj goal-conn-id)) - (format #t "~1Tgoal-node-id: ~D~%" (-> obj goal-node-id)) - (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) - (format #t "~1Tconn-count: ~D~%" (-> obj conn-count)) - (format #t "~1Tconn-mask: ~D~%" (-> obj conn-mask)) - (format #t "~1Tnode: #x~X~%" (-> obj node)) - (format #t "~1Tconn: #x~X~%" (-> obj conn)) - (format #t "~1Tconn-ids: #x~X~%" (-> obj conn-ids)) - (format #t "~1Tvisgroup: #x~X~%" (-> obj visgroup)) - (format #t "~1Tvisnode-ids: #x~X~%" (-> obj visnode-ids)) - (format #t "~1Tconn-hash: ~A~%" (-> obj conn-hash)) - (format #t "~1Torig-start-pos: #~%" (-> obj orig-start-pos)) - (format #t "~1Torig-goal-pos: #~%" (-> obj orig-goal-pos)) - (format #t "~1Tconn-start-pos: #~%" (-> obj conn-start-pos)) - (format #t "~1Tconn-goal-pos: #~%" (-> obj conn-goal-pos)) - (format #t "~1Topen-quads[6] @ #x~X~%" (-> obj open-quads)) - (format #t "~1Tclosed-quads[6] @ #x~X~%" (-> obj closed-quads)) - (format #t "~1Topen-bits[2] @ #x~X~%" (-> obj open-quads)) - (format #t "~1Tclosed-bits[2] @ #x~X~%" (-> obj closed-quads)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tmode: ~D~%" (-> this mode)) + (format #t "~1Tsearch-id: ~D~%" (-> this search-id)) + (format #t "~1Topen-head-id: ~D~%" (-> this open-head-id)) + (format #t "~1Tgoal-conn-id: ~D~%" (-> this goal-conn-id)) + (format #t "~1Tgoal-node-id: ~D~%" (-> this goal-node-id)) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tconn-count: ~D~%" (-> this conn-count)) + (format #t "~1Tconn-mask: ~D~%" (-> this conn-mask)) + (format #t "~1Tnode: #x~X~%" (-> this node)) + (format #t "~1Tconn: #x~X~%" (-> this conn)) + (format #t "~1Tconn-ids: #x~X~%" (-> this conn-ids)) + (format #t "~1Tvisgroup: #x~X~%" (-> this visgroup)) + (format #t "~1Tvisnode-ids: #x~X~%" (-> this visnode-ids)) + (format #t "~1Tconn-hash: ~A~%" (-> this conn-hash)) + (format #t "~1Torig-start-pos: #~%" (-> this orig-start-pos)) + (format #t "~1Torig-goal-pos: #~%" (-> this orig-goal-pos)) + (format #t "~1Tconn-start-pos: #~%" (-> this conn-start-pos)) + (format #t "~1Tconn-goal-pos: #~%" (-> this conn-goal-pos)) + (format #t "~1Topen-quads[6] @ #x~X~%" (-> this open-quads)) + (format #t "~1Tclosed-quads[6] @ #x~X~%" (-> this closed-quads)) + (format #t "~1Topen-bits[2] @ #x~X~%" (-> this open-quads)) + (format #t "~1Tclosed-bits[2] @ #x~X~%" (-> this closed-quads)) (label cfg-4) - obj + this ) ;; definition for symbol *trail-graph*, type trail-graph diff --git a/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc b/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc index a9775896bd..766aa2e86b 100644 --- a/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/common/trail_REF.gc @@ -3,9 +3,9 @@ ;; definition for method 9 of type trail-conn ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw trail-conn ((obj trail-conn) (arg0 trail-graph) (arg1 int)) - (let ((a2-3 (-> arg0 node (-> obj head-id))) - (v1-2 (-> arg0 node (-> obj tail-id))) +(defmethod debug-draw trail-conn ((this trail-conn) (arg0 trail-graph) (arg1 int)) + (let ((a2-3 (-> arg0 node (-> this head-id))) + (v1-2 (-> arg0 node (-> this tail-id))) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) @@ -46,11 +46,11 @@ ;; definition for method 10 of type trail-node ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw trail-node ((obj trail-node) (arg0 int)) +(defmethod debug-draw trail-node ((this trail-node) (arg0 int)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'sphere)) ) - (set-vector! s5-0 (* 4096.0 (the float (-> obj x))) 53248.0 (* 4096.0 (the float (-> obj z))) 1.0) + (set-vector! s5-0 (* 4096.0 (the float (-> this x))) 53248.0 (* 4096.0 (the float (-> this z))) 1.0) (set! (-> s4-0 quad) (-> s5-0 quad)) (set! (-> s4-0 r) 4096.0) (let ((f0-7 (vector-vector-distance-squared s5-0 (math-camera-pos))) @@ -74,9 +74,9 @@ ;; definition for method 13 of type trail-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw-cell trail-graph ((obj trail-graph) (arg0 int)) +(defmethod debug-draw-cell trail-graph ((this trail-graph) (arg0 int)) (local-vars (sv-80 int) (sv-96 (function _varargs_ object))) - (let* ((s5-0 (-> obj conn-hash)) + (let* ((s5-0 (-> this conn-hash)) (s4-0 (-> s5-0 cell arg0)) (s3-0 (new 'stack-no-clear 'inline-array 'vector 2)) ) @@ -126,12 +126,12 @@ ) ) (countdown (s2-1 (-> s4-0 conn-count)) - (let ((s1-1 (-> obj conn (-> s5-0 conn-ids (+ s2-1 (-> s4-0 first-conn)))))) - (get-position (-> obj node (-> s1-1 head-id)) (-> s3-0 0)) + (let ((s1-1 (-> this conn (-> s5-0 conn-ids (+ s2-1 (-> s4-0 first-conn)))))) + (get-position (-> this node (-> s1-1 head-id)) (-> s3-0 0)) (set! (-> s3-0 0 y) 53248.0) (+! (-> s3-0 0 x) -2048.0) (+! (-> s3-0 0 z) -2048.0) - (get-position (-> obj node (-> s1-1 tail-id)) (-> s3-0 1)) + (get-position (-> this node (-> s1-1 tail-id)) (-> s3-0 1)) ) (set! (-> s3-0 1 y) 53248.0) (+! (-> s3-0 1 x) -2048.0) @@ -145,7 +145,7 @@ ;; definition for method 14 of type trail-graph ;; INFO: Used lq/sq ;; WARN: new jak 2 until loop case, check carefully -(defmethod debug-draw-path trail-graph ((obj trail-graph) (arg0 int) (arg1 (pointer uint16)) (arg2 vector) (arg3 vector) (arg4 rgba) (arg5 float)) +(defmethod debug-draw-path trail-graph ((this trail-graph) (arg0 int) (arg1 (pointer uint16)) (arg2 vector) (arg3 vector) (arg4 rgba) (arg5 float)) (local-vars (sv-48 int)) (let ((s0-0 (new 'stack-no-clear 'inline-array 'vector 2))) (set-vector! (-> s0-0 1) (+ (-> arg2 x) arg5) 53248.0 (+ (-> arg2 z) arg5) 1.0) @@ -154,7 +154,7 @@ (set! (-> s0-0 0 quad) (-> s0-0 1 quad)) (cond ((< sv-48 arg0) - (let ((a0-7 (-> obj node (-> arg1 sv-48)))) + (let ((a0-7 (-> this node (-> arg1 sv-48)))) (set-vector! (-> s0-0 1) (+ (* 4096.0 (the float (-> a0-7 x))) arg5) @@ -182,17 +182,17 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: new jak 2 until loop case, check carefully -(defmethod debug-draw trail-graph ((obj trail-graph)) - (when (= (-> obj mode) 3) +(defmethod debug-draw trail-graph ((this trail-graph)) + (when (= (-> this mode) 3) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 2))) - (set! (-> s5-0 1 quad) (-> obj orig-goal-pos quad)) + (set! (-> s5-0 1 quad) (-> this orig-goal-pos quad)) (set! (-> s5-0 1 y) 53248.0) - (let ((v1-4 (-> obj goal-node-id))) + (let ((v1-4 (-> this goal-node-id))) (until #f (set! (-> s5-0 0 quad) (-> s5-0 1 quad)) (cond ((>= v1-4 0) - (let ((s4-0 (-> obj node v1-4))) + (let ((s4-0 (-> this node v1-4))) (set-vector! (-> s5-0 1) (+ 2048.0 (* 4096.0 (the float (-> s4-0 x)))) @@ -205,7 +205,7 @@ ) ) (else - (set! (-> s5-0 1 quad) (-> obj orig-start-pos quad)) + (set! (-> s5-0 1 quad) (-> this orig-start-pos quad)) (set! (-> s5-0 1 y) 53248.0) (add-debug-line #t (bucket-id debug2) (-> s5-0 0) (-> s5-0 1) *color-green* #f (the-as rgba -1)) (goto cfg-7) @@ -217,77 +217,77 @@ #f ) (label cfg-7) - (case (-> obj mode) + (case (-> this mode) ((1 2 3) (let ((s5-1 (new 'stack-no-clear 'vector))) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj orig-start-pos) + (-> this orig-start-pos) (meters 1) (new 'static 'rgba :r #xff :a #x80) ) - (set! (-> s5-1 quad) (-> obj conn-start-pos quad)) + (set! (-> s5-1 quad) (-> this conn-start-pos quad)) (set! (-> s5-1 y) 53248.0) (add-debug-sphere #t (bucket-id debug-no-zbuf1) s5-1 (meters 0.25) (new 'static 'rgba :r #xff :a #x80)) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj orig-goal-pos) + (-> this orig-goal-pos) (meters 1) (new 'static 'rgba :g #xff :a #x80) ) - (set! (-> s5-1 quad) (-> obj conn-goal-pos quad)) + (set! (-> s5-1 quad) (-> this conn-goal-pos quad)) (set! (-> s5-1 y) 53248.0) (add-debug-sphere #t (bucket-id debug-no-zbuf1) s5-1 (meters 0.25) (new 'static 'rgba :g #xff :a #x80)) ) ) ) - (dotimes (s5-2 (the-as int (-> obj conn-count))) - (debug-draw (-> obj conn s5-2) obj s5-2) + (dotimes (s5-2 (the-as int (-> this conn-count))) + (debug-draw (-> this conn s5-2) this s5-2) ) - (dotimes (s5-3 (the-as int (-> obj node-count))) - (debug-draw (-> obj node s5-3) s5-3) + (dotimes (s5-3 (the-as int (-> this node-count))) + (debug-draw (-> this node s5-3) s5-3) ) 0 (none) ) ;; definition for method 11 of type trail-node -(defmethod get-position trail-node ((obj trail-node) (arg0 vector)) +(defmethod get-position trail-node ((this trail-node) (arg0 vector)) "Unpack the position to a vector" (let ((v0-0 arg0)) - (set! (-> v0-0 x) (* 4096.0 (the float (-> obj x)))) + (set! (-> v0-0 x) (* 4096.0 (the float (-> this x)))) (set! (-> v0-0 y) 0.0) - (set! (-> v0-0 z) (* 4096.0 (the float (-> obj z)))) + (set! (-> v0-0 z) (* 4096.0 (the float (-> this z)))) (set! (-> v0-0 w) 1.0) v0-0 ) ) ;; definition for method 17 of type trail-graph -(defmethod get-node-location-by-id trail-graph ((obj trail-graph) (arg0 uint) (arg1 vector)) +(defmethod get-node-location-by-id trail-graph ((this trail-graph) (arg0 uint) (arg1 vector)) "Get the location of the node with the given ID" - (get-position (-> obj node (the-as int arg0)) arg1) + (get-position (-> this node (the-as int arg0)) arg1) ) ;; definition for method 18 of type trail-graph -(defmethod get-path-to-root trail-graph ((obj trail-graph) (arg0 (pointer uint16)) (arg1 int) (arg2 (pointer int32)) (arg3 (pointer float))) +(defmethod get-path-to-root trail-graph ((this trail-graph) (arg0 (pointer uint16)) (arg1 int) (arg2 (pointer int32)) (arg3 (pointer float))) "Get the path from goal to root, following parent-id" (set! (-> arg3 0) 0.0) - (set! (-> arg2 0) (-> obj goal-node-id)) + (set! (-> arg2 0) (-> this goal-node-id)) (let ((v0-0 -1)) - (when (= (-> obj mode) 3) - (let ((v1-3 (-> obj node)) + (when (= (-> this mode) 3) + (let ((v1-3 (-> this node)) (a3-2 0) ) - (let ((t1-0 (-> obj goal-node-id))) + (let ((t1-0 (-> this goal-node-id))) (while (>= t1-0 0) (+! a3-2 1) (set! t1-0 (-> v1-3 t1-0 parent-id)) ) ) - (let ((t1-4 (-> obj goal-node-id))) + (let ((t1-4 (-> this goal-node-id))) (let ((t2-1 (- a3-2 arg1))) (cond ((> t2-1 0) @@ -308,7 +308,7 @@ ) ) (when (> a3-2 0) - (let ((a0-3 (-> v1-3 (-> obj goal-node-id))) + (let ((a0-3 (-> v1-3 (-> this goal-node-id))) (v1-4 (-> v1-3 (-> arg0 0))) ) (set! (-> arg3 0) @@ -323,42 +323,42 @@ ) ;; definition for method 20 of type trail-graph -(defmethod try-initialize trail-graph ((obj trail-graph)) +(defmethod try-initialize trail-graph ((this trail-graph)) "Init and verify that constants are good." - (let ((a3-0 (shr (+ (-> obj node-count) 127) 7))) + (let ((a3-0 (shr (+ (-> this node-count) 127) 7))) (when (!= a3-0 6) (format 0 "ERROR: TRAIL_NODE_BIT_ARRAY_QUAD_COUNT is ~d, but should be ~d! Please change it!~%" 6 a3-0) (return #f) ) ) - (let ((a3-1 (shr (+ (-> obj conn-count) 127) 7))) + (let ((a3-1 (shr (+ (-> this conn-count) 127) 7))) (when (!= a3-1 7) (format 0 "ERROR: TRAIL_CONN_BIT_ARRAY_QUAD_COUNT is ~d, but should be ~d! Please change it!~%" 7 a3-1) (return #f) ) ) - (set! (-> obj mode) (the-as uint 0)) - (set! (-> obj goal-conn-id) -1) - (set! (-> obj goal-node-id) -1) - (set! (-> obj open-head-id) -1) + (set! (-> this mode) (the-as uint 0)) + (set! (-> this goal-conn-id) -1) + (set! (-> this goal-node-id) -1) + (set! (-> this open-head-id) -1) #t ) ;; definition for method 23 of type trail-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod reset-search-state trail-graph ((obj trail-graph)) +(defmethod reset-search-state trail-graph ((this trail-graph)) "Reset the search/goal." - (when (nonzero? (-> obj mode)) - (set! (-> obj goal-node-id) -1) - (let ((a1-0 (-> obj goal-conn-id))) + (when (nonzero? (-> this mode)) + (set! (-> this goal-node-id) -1) + (let ((a1-0 (-> this goal-conn-id))) (when (>= a1-0 0) - (update-node-flags-for-conn obj a1-0 (trail-node-flag) (trail-node-flag tnf0)) - (set! (-> obj goal-conn-id) -1) + (update-node-flags-for-conn this a1-0 (trail-node-flag) (trail-node-flag tnf0)) + (set! (-> this goal-conn-id) -1) ) ) - (set! (-> obj open-head-id) -1) - (let ((v1-7 (-> obj open-quads))) + (set! (-> this open-head-id) -1) + (let ((v1-7 (-> this open-quads))) (set! (-> v1-7 0 quad) (the-as uint128 0)) (set! (-> v1-7 1 quad) (the-as uint128 0)) (set! (-> v1-7 2 quad) (the-as uint128 0)) @@ -367,7 +367,7 @@ (set! (-> v1-7 5 quad) (the-as uint128 0)) ) 0 - (let ((v1-9 (-> obj closed-quads))) + (let ((v1-9 (-> this closed-quads))) (set! (-> v1-9 0 quad) (the-as uint128 0)) (set! (-> v1-9 1 quad) (the-as uint128 0)) (set! (-> v1-9 2 quad) (the-as uint128 0)) @@ -376,7 +376,7 @@ (set! (-> v1-9 5 quad) (the-as uint128 0)) ) 0 - (set! (-> obj mode) (the-as uint 0)) + (set! (-> this mode) (the-as uint 0)) 0 ) (none) @@ -384,17 +384,17 @@ ;; definition for method 21 of type trail-graph ;; WARN: Return type mismatch trail-node-flag vs none. -(defmethod update-node-flags-for-conn trail-graph ((obj trail-graph) (arg0 int) (arg1 trail-node-flag) (arg2 trail-node-flag)) +(defmethod update-node-flags-for-conn trail-graph ((this trail-graph) (arg0 int) (arg1 trail-node-flag) (arg2 trail-node-flag)) "Set arg1, clear arg2" (let* ((v1-0 (lognot arg2)) - (a3-2 (-> obj conn arg0)) + (a3-2 (-> this conn arg0)) (t0-0 (-> a3-2 visgroup-id)) - (a1-2 (-> obj node)) + (a1-2 (-> this node)) ) (cond ((> t0-0 0) - (let* ((a3-4 (-> obj visgroup (+ t0-0 -1))) - (a0-2 (&-> (-> obj visnode-ids) (-> a3-4 first-conn))) + (let* ((a3-4 (-> this visgroup (+ t0-0 -1))) + (a0-2 (&-> (-> this visnode-ids) (-> a3-4 first-conn))) ) (countdown (a3-5 (-> a3-4 conn-count)) (let ((t0-8 (-> a1-2 (-> a0-2 0)))) @@ -420,7 +420,7 @@ ;; definition for method 25 of type trail-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod trail-graph-method-25 trail-graph ((obj trail-graph) (arg0 trail-conn-search) (arg1 int) (arg2 int)) +(defmethod trail-graph-method-25 trail-graph ((this trail-graph) (arg0 trail-conn-search) (arg1 int) (arg2 int)) (let* ((v1-1 (+ (* arg2 16) arg1)) (a0-1 (/ v1-1 8)) (a1-2 (ash 1 (logand v1-1 7))) @@ -428,8 +428,8 @@ ) (when (not (logtest? a2-4 a1-2)) (set! (-> arg0 cell-quads 0 byte a0-1) (logior a2-4 a1-2)) - (let* ((v1-3 (-> obj conn-hash cell v1-1)) - (s4-0 (&-> (-> obj conn-hash conn-ids) (-> v1-3 first-conn))) + (let* ((v1-3 (-> this conn-hash cell v1-1)) + (s4-0 (&-> (-> this conn-hash conn-ids) (-> v1-3 first-conn))) ) (countdown (s3-0 (-> v1-3 conn-count)) (let* ((s2-0 (-> s4-0 0)) @@ -439,12 +439,12 @@ ) (when (not (logtest? a2-5 a1-7)) (set! (-> arg0 conn-quads 0 byte v1-4) (logior a2-5 a1-7)) - (let* ((v1-7 (-> obj conn s2-0)) + (let* ((v1-7 (-> this conn s2-0)) (a0-14 (-> v1-7 flags)) ) - (when (= (logand (the-as conn-flag (-> obj conn-mask)) a0-14) a0-14) - (let ((a3-2 (-> obj node (-> v1-7 head-id))) - (v1-10 (-> obj node (-> v1-7 tail-id))) + (when (= (logand (the-as conn-flag (-> this conn-mask)) a0-14) a0-14) + (let ((a3-2 (-> this node (-> v1-7 head-id))) + (v1-10 (-> this node (-> v1-7 tail-id))) (a1-14 (new 'stack-no-clear 'vector)) (a2-7 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) @@ -485,8 +485,8 @@ ;; definition for method 15 of type trail-graph ;; INFO: Used lq/sq -(defmethod do-path trail-graph ((obj trail-graph) (arg0 vector) (arg1 vector)) - (let ((v1-0 (-> obj conn-hash)) +(defmethod do-path trail-graph ((this trail-graph) (arg0 vector) (arg1 vector)) + (let ((v1-0 (-> this conn-hash)) (s5-0 (new 'stack-no-clear 'trail-conn-search)) ) (set! (-> s5-0 src-pos) arg0) @@ -527,7 +527,7 @@ (until (< (-> s5-0 bounds max z) s3-0) (let ((s2-0 (-> s5-0 bounds min x))) (until (< (-> s5-0 bounds max x) s2-0) - (trail-graph-method-25 obj s5-0 s2-0 s3-0) + (trail-graph-method-25 this s5-0 s2-0 s3-0) (+! s2-0 1) ) ) @@ -543,15 +543,15 @@ ) (let ((s3-1 (-> s5-0 bounds min x))) (until (< (-> s5-0 bounds max x) s3-1) - (trail-graph-method-25 obj s5-0 s3-1 (-> s5-0 bounds min z)) - (trail-graph-method-25 obj s5-0 s3-1 (-> s5-0 bounds max z)) + (trail-graph-method-25 this s5-0 s3-1 (-> s5-0 bounds min z)) + (trail-graph-method-25 this s5-0 s3-1 (-> s5-0 bounds max z)) (+! s3-1 1) ) ) (let ((s3-2 (-> s5-0 bounds min z))) (until (< (-> s5-0 bounds max z) s3-2) - (trail-graph-method-25 obj s5-0 (-> s5-0 bounds min x) s3-2) - (trail-graph-method-25 obj s5-0 (-> s5-0 bounds max x) s3-2) + (trail-graph-method-25 this s5-0 (-> s5-0 bounds min x) s3-2) + (trail-graph-method-25 this s5-0 (-> s5-0 bounds max x) s3-2) (+! s3-2 1) ) ) @@ -563,38 +563,38 @@ ;; definition for method 9 of type trail-graph ;; WARN: Return type mismatch int vs none. -(defmethod trail-graph-method-9 trail-graph ((obj trail-graph) (arg0 int)) - (let ((s4-0 (-> obj node arg0))) - (set! (-> s4-0 cost-from-start) (get-dist-score s4-0 (-> obj orig-start-pos))) - (set! (-> s4-0 cost-to-goal) (get-dist-score s4-0 (-> obj orig-goal-pos))) +(defmethod trail-graph-method-9 trail-graph ((this trail-graph) (arg0 int)) + (let ((s4-0 (-> this node arg0))) + (set! (-> s4-0 cost-from-start) (get-dist-score s4-0 (-> this orig-start-pos))) + (set! (-> s4-0 cost-to-goal) (get-dist-score s4-0 (-> this orig-goal-pos))) ) - (trail-graph-method-11 obj arg0 -1) + (trail-graph-method-11 this arg0 -1) 0 (none) ) ;; definition for method 10 of type trail-graph -(defmethod trail-graph-method-10 trail-graph ((obj trail-graph) (arg0 int)) - (let* ((s5-0 (-> obj conn arg0)) +(defmethod trail-graph-method-10 trail-graph ((this trail-graph) (arg0 int)) + (let* ((s5-0 (-> this conn arg0)) (v1-1 (-> s5-0 visgroup-id)) ) (cond ((> v1-1 0) - (let* ((v1-4 (-> obj visgroup (+ v1-1 -1))) - (s5-1 (&-> (-> obj visnode-ids) (-> v1-4 first-conn))) + (let* ((v1-4 (-> this visgroup (+ v1-1 -1))) + (s5-1 (&-> (-> this visnode-ids) (-> v1-4 first-conn))) (s4-0 (-> v1-4 conn-count)) ) - (-> obj visnode-ids) + (-> this visnode-ids) (while (nonzero? s4-0) (+! s4-0 -1) - (trail-graph-method-9 obj (the-as int (-> s5-1 0))) + (trail-graph-method-9 this (the-as int (-> s5-1 0))) (set! s5-1 (&-> s5-1 1)) ) ) ) (else - (trail-graph-method-9 obj (the-as int (-> s5-0 head-id))) - (trail-graph-method-9 obj (the-as int (-> s5-0 tail-id))) + (trail-graph-method-9 this (the-as int (-> s5-0 head-id))) + (trail-graph-method-9 this (the-as int (-> s5-0 tail-id))) ) ) ) @@ -603,18 +603,18 @@ ;; definition for method 11 of type trail-graph ;; WARN: new jak 2 until loop case, check carefully -(defmethod trail-graph-method-11 trail-graph ((obj trail-graph) (arg0 int) (arg1 int)) +(defmethod trail-graph-method-11 trail-graph ((this trail-graph) (arg0 int) (arg1 int)) (let ((v1-0 (/ arg0 8)) (a3-1 (ash 1 (logand arg0 7))) ) - (logior! (-> obj open-quads 0 byte v1-0) a3-1) + (logior! (-> this open-quads 0 byte v1-0) a3-1) ) - (let* ((v1-2 (-> obj node)) + (let* ((v1-2 (-> this node)) (v0-0 (-> v1-2 arg0)) ) (set! (-> v0-0 parent-id) arg1) (let ((a3-6 (+ (-> v0-0 cost-from-start) (-> v0-0 cost-to-goal))) - (t0-4 (-> obj open-head-id)) + (t0-4 (-> this open-head-id)) (a2-2 -1) ) (until #f @@ -623,7 +623,7 @@ (set! (-> v0-0 prev-id) a2-2) (if (>= a2-2 0) (set! (-> v1-2 a2-2 next-id) arg0) - (set! (-> obj open-head-id) arg0) + (set! (-> this open-head-id) arg0) ) (return v0-0) ) @@ -634,7 +634,7 @@ (set! (-> t1-4 prev-id) arg0) (if (>= a2-2 0) (set! (-> v1-2 a2-2 next-id) arg0) - (set! (-> obj open-head-id) arg0) + (set! (-> this open-head-id) arg0) ) (return v0-0) ) @@ -650,13 +650,13 @@ ;; definition for method 22 of type trail-graph ;; WARN: Return type mismatch int vs none. -(defmethod trail-graph-method-22 trail-graph ((obj trail-graph) (arg0 int)) +(defmethod trail-graph-method-22 trail-graph ((this trail-graph) (arg0 int)) (let ((v1-0 (/ arg0 8)) (a2-1 (ash 1 (logand arg0 7))) ) - (logior! (-> obj open-quads 0 byte v1-0) a2-1) + (logior! (-> this open-quads 0 byte v1-0) a2-1) ) - (let* ((v1-2 (-> obj node)) + (let* ((v1-2 (-> this node)) (a2-4 (-> v1-2 arg0)) (a1-2 (-> a2-4 prev-id)) (a2-5 (-> a2-4 next-id)) @@ -669,7 +669,7 @@ ) ) (else - (set! (-> obj open-head-id) a2-5) + (set! (-> this open-head-id) a2-5) (if (>= a2-5 0) (set! (-> v1-2 a2-5 prev-id) -1) ) @@ -680,13 +680,13 @@ ) ;; definition for method 24 of type trail-graph -(defmethod get-next-to-explore trail-graph ((obj trail-graph)) - (let ((v0-0 (-> obj open-head-id))) +(defmethod get-next-to-explore trail-graph ((this trail-graph)) + (let ((v0-0 (-> this open-head-id))) (when (>= v0-0 0) - (let* ((v1-1 (-> obj node)) + (let* ((v1-1 (-> this node)) (a2-0 (-> v1-1 v0-0 next-id)) ) - (set! (-> obj open-head-id) a2-0) + (set! (-> this open-head-id) a2-0) (if (>= a2-0 0) (set! (-> v1-1 a2-0 prev-id) -1) ) @@ -694,8 +694,8 @@ (let ((v1-3 (/ v0-0 8)) (a1-6 (ash 1 (logand v0-0 7))) ) - (logior! (-> obj closed-quads 0 byte v1-3) a1-6) - (logxor! (-> obj open-quads 0 byte v1-3) (the-as uint a1-6)) + (logior! (-> this closed-quads 0 byte v1-3) a1-6) + (logxor! (-> this open-quads 0 byte v1-3) (the-as uint a1-6)) ) ) v0-0 @@ -704,9 +704,9 @@ ;; definition for method 9 of type trail-node ;; WARN: Return type mismatch int vs uint. -(defmethod get-dist-score trail-node ((obj trail-node) (arg0 vector)) - (let* ((f0-1 (- (-> arg0 x) (* 4096.0 (the float (-> obj x))))) - (f1-3 (- (-> arg0 z) (* 4096.0 (the float (-> obj z))))) +(defmethod get-dist-score trail-node ((this trail-node) (arg0 vector)) + (let* ((f0-1 (- (-> arg0 x) (* 4096.0 (the float (-> this x))))) + (f1-3 (- (-> arg0 z) (* 4096.0 (the float (-> this z))))) (f0-4 (sqrtf (+ (* f0-1 f0-1) (* f1-3 f1-3)))) ) (the uint (fmin 65535.0 (* 0.00024414062 (* 8.0 f0-4)))) @@ -714,47 +714,47 @@ ) ;; definition for method 27 of type trail-graph -(defmethod do-some-work trail-graph ((obj trail-graph)) - (let ((s5-0 (get-next-to-explore obj))) +(defmethod do-some-work trail-graph ((this trail-graph)) + (let ((s5-0 (get-next-to-explore this))) (if (< s5-0 0) (return 2) ) - (let ((s4-0 (-> obj node s5-0))) + (let ((s4-0 (-> this node s5-0))) (when (logtest? (-> s4-0 flags) (trail-node-flag tnf0)) - (set! (-> obj goal-node-id) s5-0) + (set! (-> this goal-node-id) s5-0) (return 3) ) - (let ((s3-0 (&-> (-> obj conn-ids) (-> s4-0 first-conn)))) + (let ((s3-0 (&-> (-> this conn-ids) (-> s4-0 first-conn)))) (countdown (s2-0 (-> s4-0 conn-count)) - (let* ((a0-7 (-> obj conn (-> s3-0 0))) + (let* ((a0-7 (-> this conn (-> s3-0 0))) (v1-12 (-> a0-7 flags)) ) - (when (= (logand (the-as conn-flag (-> obj conn-mask)) v1-12) v1-12) + (when (= (logand (the-as conn-flag (-> this conn-mask)) v1-12) v1-12) (let ((s1-0 (-> a0-7 tail-id))) (if (= s1-0 s5-0) (set! s1-0 (-> a0-7 head-id)) ) - (let ((s0-0 (-> obj node s1-0)) + (let ((s0-0 (-> this node s1-0)) (v1-17 (min #xffff (the-as int (+ (-> a0-7 cost) (-> s4-0 cost-from-start))))) (a0-10 (shr s1-0 3)) (a1-7 (ash 1 (logand s1-0 7))) ) (cond - ((logtest? (-> obj open-quads 0 byte a0-10) a1-7) + ((logtest? (-> this open-quads 0 byte a0-10) a1-7) (when (< (the-as uint v1-17) (-> s0-0 cost-from-start)) (set! (-> s0-0 cost-from-start) (the-as uint v1-17)) - (trail-graph-method-22 obj (the-as int s1-0)) - (trail-graph-method-11 obj (the-as int s1-0) s5-0) + (trail-graph-method-22 this (the-as int s1-0)) + (trail-graph-method-11 this (the-as int s1-0) s5-0) ) ) - ((not (logtest? (-> obj closed-quads 0 byte a0-10) a1-7)) + ((not (logtest? (-> this closed-quads 0 byte a0-10) a1-7)) (set! (-> s0-0 cost-from-start) (the-as uint v1-17)) - (set! (-> s0-0 cost-to-goal) (get-dist-score s0-0 (-> obj orig-goal-pos))) - (trail-graph-method-11 obj (the-as int s1-0) s5-0) + (set! (-> s0-0 cost-to-goal) (get-dist-score s0-0 (-> this orig-goal-pos))) + (trail-graph-method-11 this (the-as int s1-0) s5-0) ) ((< (the-as uint v1-17) (-> s0-0 cost-from-start)) (set! (-> s0-0 cost-from-start) (the-as uint v1-17)) - (trail-graph-method-11 obj (the-as int s1-0) s5-0) + (trail-graph-method-11 this (the-as int s1-0) s5-0) ) ) ) @@ -773,16 +773,16 @@ ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod run-until-done-or-timeout trail-graph ((obj trail-graph) (arg0 int)) +(defmethod run-until-done-or-timeout trail-graph ((this trail-graph) (arg0 int)) (local-vars (v1-1 int)) - (let ((v0-0 (the-as int (-> obj mode)))) + (let ((v0-0 (the-as int (-> this mode)))) 0 (.mfc0 v1-1 Count) (while (and (= v0-0 1) (< (the-as uint v1-1) (the-as uint arg0))) - (set! v0-0 (do-some-work obj)) + (set! v0-0 (do-some-work this)) (.mfc0 v1-1 Count) ) - (set! (-> obj mode) (the-as uint v0-0)) + (set! (-> this mode) (the-as uint v0-0)) ) (none) ) @@ -802,27 +802,27 @@ ) ;; definition for method 3 of type trail-vis-work -(defmethod inspect trail-vis-work ((obj trail-vis-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect trail-vis-work ((this trail-vis-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'trail-vis-work) - (format #t "~1Tbest-count: ~D~%" (-> obj best-count)) - (format #t "~1Tbest-dist: ~f~%" (-> obj best-dist)) - (format #t "~1Tstart-conn-id: ~D~%" (-> obj start-conn-id)) - (format #t "~1Tp0: #~%" (-> obj p0)) - (format #t "~1Tp1: #~%" (-> obj p1)) - (format #t "~1Tbest-node-id[64] @ #x~X~%" (-> obj best-node-id)) + (format #t "[~8x] ~A~%" this 'trail-vis-work) + (format #t "~1Tbest-count: ~D~%" (-> this best-count)) + (format #t "~1Tbest-dist: ~f~%" (-> this best-dist)) + (format #t "~1Tstart-conn-id: ~D~%" (-> this start-conn-id)) + (format #t "~1Tp0: #~%" (-> this p0)) + (format #t "~1Tp1: #~%" (-> this p1)) + (format #t "~1Tbest-node-id[64] @ #x~X~%" (-> this best-node-id)) (label cfg-4) - obj + this ) ;; definition for method 19 of type trail-graph ;; INFO: Used lq/sq -(defmethod trail-graph-method-19 trail-graph ((obj trail-graph) (arg0 int) (arg1 int)) +(defmethod trail-graph-method-19 trail-graph ((this trail-graph) (arg0 int) (arg1 int)) (local-vars (s4-1 symbol)) - (let* ((s4-0 (-> obj node)) + (let* ((s4-0 (-> this node)) (v1-2 (-> s4-0 arg1)) (s5-0 (new 'stack-no-clear 'trail-vis-work)) ) @@ -830,16 +830,16 @@ (set-vector! (-> s5-0 p0) (* 4096.0 (the float (-> v1-2 x))) - (-> obj orig-goal-pos y) + (-> this orig-goal-pos y) (* 4096.0 (the float (-> v1-2 z))) 1.0 ) (set! (-> s5-0 p1 quad) (-> s5-0 p0 quad)) (set! (-> s5-0 best-count) (the-as uint 0)) (set! (-> s5-0 best-dist) -1.0) - (let ((s2-0 (&-> (-> obj conn-ids) (-> v1-2 first-conn)))) + (let ((s2-0 (&-> (-> this conn-ids) (-> v1-2 first-conn)))) (countdown (s1-0 (-> v1-2 conn-count)) - (let* ((v1-4 (-> obj conn (-> s2-0 0))) + (let* ((v1-4 (-> this conn (-> s2-0 0))) (s0-0 (-> v1-4 tail-id)) ) (if (= s0-0 arg1) @@ -849,7 +849,7 @@ (set! (-> s5-0 p1 x) (* 4096.0 (the float (-> v1-8 x)))) (set! (-> s5-0 p1 z) (* 4096.0 (the float (-> v1-8 z)))) ) - (let ((f0-11 (vector-segment-distance-point! (-> obj orig-goal-pos) (-> s5-0 p0) (-> s5-0 p1) (the-as vector #f))) + (let ((f0-11 (vector-segment-distance-point! (-> this orig-goal-pos) (-> s5-0 p0) (-> s5-0 p1) (the-as vector #f))) (f1-8 (-> s5-0 best-dist)) ) (cond @@ -872,7 +872,12 @@ (set! s2-0 (&-> s2-0 1)) ) ) - (update-node-flags-for-conn obj (the-as int (-> s5-0 start-conn-id)) (trail-node-flag tnf1) (trail-node-flag)) + (update-node-flags-for-conn + this + (the-as int (-> s5-0 start-conn-id)) + (trail-node-flag tnf1) + (trail-node-flag) + ) (countdown (v1-20 (-> s5-0 best-count)) (let ((a1-14 (-> s4-0 (-> s5-0 best-node-id v1-20)))) (when (= (logand (-> a1-14 flags) (trail-node-flag tnf0 tnf1)) (trail-node-flag tnf0 tnf1)) @@ -883,7 +888,12 @@ ) (set! s4-1 #f) (label cfg-22) - (update-node-flags-for-conn obj (the-as int (-> s5-0 start-conn-id)) (trail-node-flag) (trail-node-flag tnf1)) + (update-node-flags-for-conn + this + (the-as int (-> s5-0 start-conn-id)) + (trail-node-flag) + (trail-node-flag tnf1) + ) ) s4-1 ) @@ -891,10 +901,10 @@ ;; definition for method 26 of type trail-graph ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-search! trail-graph ((obj trail-graph) (arg0 vector) (arg1 vector) (arg2 trail-cached-search-info)) - (reset-search-state obj) - (+! (-> obj search-id) 1) - (set! (-> obj orig-start-pos quad) (-> arg0 quad)) +(defmethod do-search! trail-graph ((this trail-graph) (arg0 vector) (arg1 vector) (arg2 trail-cached-search-info)) + (reset-search-state this) + (+! (-> this search-id) 1) + (set! (-> this orig-start-pos quad) (-> arg0 quad)) (let ((a1-1 -1)) (when arg2 (let ((v1-6 (-> arg2 goal-conn-id))) @@ -904,21 +914,21 @@ (= (-> arg2 orig-goal-pos z) (-> arg1 z)) ) (set! a1-1 v1-6) - (set! (-> obj conn-goal-pos quad) (-> arg2 conn-goal-pos quad)) + (set! (-> this conn-goal-pos quad) (-> arg2 conn-goal-pos quad)) ) ) ) - (set! (-> obj orig-goal-pos quad) (-> arg1 quad)) + (set! (-> this orig-goal-pos quad) (-> arg1 quad)) (when (< a1-1 0) - (set! a1-1 (do-path obj (-> obj orig-goal-pos) (-> obj conn-goal-pos))) + (set! a1-1 (do-path this (-> this orig-goal-pos) (-> this conn-goal-pos))) (when arg2 (set! (-> arg2 goal-conn-id) a1-1) - (set! (-> arg2 orig-goal-pos quad) (-> obj orig-goal-pos quad)) - (set! (-> arg2 conn-goal-pos quad) (-> obj conn-goal-pos quad)) + (set! (-> arg2 orig-goal-pos quad) (-> this orig-goal-pos quad)) + (set! (-> arg2 conn-goal-pos quad) (-> this conn-goal-pos quad)) ) ) - (set! (-> obj goal-conn-id) a1-1) - (update-node-flags-for-conn obj a1-1 (trail-node-flag tnf0) (trail-node-flag)) + (set! (-> this goal-conn-id) a1-1) + (update-node-flags-for-conn this a1-1 (trail-node-flag tnf0) (trail-node-flag)) ) (let ((v1-17 -1)) (let ((a0-16 (-> *game-info* features))) @@ -935,14 +945,14 @@ (set! v1-17 (logand -9 v1-17)) ) ) - (set! (-> obj conn-mask) (the-as uint v1-17)) + (set! (-> this conn-mask) (the-as uint v1-17)) ) - (let ((s5-1 (do-path obj (-> obj orig-start-pos) (-> obj conn-start-pos)))) - (trail-graph-method-10 obj s5-1) - (let ((a2-5 (-> obj open-head-id))) - (if (and (logtest? (-> obj node a2-5 flags) (trail-node-flag tnf0)) (trail-graph-method-19 obj s5-1 a2-5)) - (set! (-> obj mode) (the-as uint 3)) - (set! (-> obj mode) (the-as uint 1)) + (let ((s5-1 (do-path this (-> this orig-start-pos) (-> this conn-start-pos)))) + (trail-graph-method-10 this s5-1) + (let ((a2-5 (-> this open-head-id))) + (if (and (logtest? (-> this node a2-5 flags) (trail-node-flag tnf0)) (trail-graph-method-19 this s5-1 a2-5)) + (set! (-> this mode) (the-as uint 3)) + (set! (-> this mode) (the-as uint 1)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc index 21f850c0fe..6bb7f57038 100644 --- a/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctyport-obs_REF.gc @@ -17,18 +17,18 @@ ) ;; definition for method 3 of type boat-manager -(defmethod inspect boat-manager ((obj boat-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect boat-manager ((this boat-manager)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tmesh: ~A~%" (-> obj mesh)) - (format #t "~2Tpaths[4] @ #x~X~%" (-> obj paths)) + (format #t "~2Tmesh: ~A~%" (-> this mesh)) + (format #t "~2Tpaths[4] @ #x~X~%" (-> this paths)) (label cfg-4) - obj + this ) ;; definition for symbol *barge-constants*, type rigid-body-vehicle-constants @@ -151,26 +151,26 @@ ) ;; definition for method 3 of type boat-base -(defmethod inspect boat-base ((obj boat-base)) - (when (not obj) - (set! obj obj) +(defmethod inspect boat-base ((this boat-base)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tangle: ~f~%" (-> obj angle)) - (format #t "~2Ty-rot: ~f~%" (-> obj y-rot)) - (format #t "~2Tpath-num: ~D~%" (-> obj path-num)) - (format #t "~2Tpath-index: ~f~%" (-> obj path-index)) + (format #t "~2Tangle: ~f~%" (-> this angle)) + (format #t "~2Ty-rot: ~f~%" (-> this y-rot)) + (format #t "~2Tpath-num: ~D~%" (-> this path-num)) + (format #t "~2Tpath-index: ~f~%" (-> this path-index)) (label cfg-4) - obj + this ) ;; definition for method 144 of type boat-base ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod boat-base-method-144 boat-base ((obj boat-base) (arg0 nav-control)) +(defmethod boat-base-method-144 boat-base ((this boat-base) (arg0 nav-control)) (rlet ((acc :class vf) (Q :class vf) (vf0 :class vf) @@ -234,7 +234,7 @@ ;; definition for method 145 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod boat-base-method-145 boat-base ((obj boat-base) (arg0 nav-control)) +(defmethod boat-base-method-145 boat-base ((this boat-base) (arg0 nav-control)) (navigate-using-route-portals (-> arg0 state)) 0 0 @@ -243,7 +243,7 @@ ;; definition for method 146 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod boat-base-method-146 boat-base ((obj boat-base) (arg0 nav-control)) +(defmethod boat-base-method-146 boat-base ((this boat-base) (arg0 nav-control)) (navigate-using-best-dir-recompute-avoid-spheres-2 (-> arg0 state)) 0 (none) @@ -251,7 +251,7 @@ ;; definition for method 147 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod boat-base-method-147 boat-base ((obj boat-base) (arg0 nav-control)) +(defmethod boat-base-method-147 boat-base ((this boat-base) (arg0 nav-control)) (update-travel-dir-from-spheres (-> arg0 state)) 0 (none) @@ -259,7 +259,7 @@ ;; definition for method 148 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod boat-base-method-148 boat-base ((obj boat-base) (arg0 nav-control)) +(defmethod boat-base-method-148 boat-base ((this boat-base) (arg0 nav-control)) (compute-speed-simple (-> arg0 state)) 0 (none) @@ -386,45 +386,45 @@ ;; definition for method 44 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod apply-damage boat-base ((obj boat-base) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage boat-base ((this boat-base) (arg0 float) (arg1 rigid-body-impact)) 0 (none) ) ;; definition for method 47 of type boat-base -(defmethod rigid-body-object-method-47 boat-base ((obj boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) - ((method-of-type vehicle rigid-body-object-method-47) obj arg0 arg1 arg2 arg3) +(defmethod rigid-body-object-method-47 boat-base ((this boat-base) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) + ((method-of-type vehicle rigid-body-object-method-47) this arg0 arg1 arg2 arg3) #f ) ;; definition for method 120 of type boat-base ;; INFO: Used lq/sq -(defmethod vehicle-method-120 boat-base ((obj boat-base)) +(defmethod vehicle-method-120 boat-base ((this boat-base)) (let ((t9-0 (method-of-type vehicle vehicle-method-120))) - (t9-0 obj) + (t9-0 this) ) - (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) - (let ((a1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (when (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) + (let ((a1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'quaternion)) ) (quaternion-from-two-vectors-max-angle! s5-0 a1-1 *up-vector* (* 728.1778 (seconds-per-frame))) - (quaternion*! (-> obj root quat) s5-0 (-> obj root quat)) + (quaternion*! (-> this root quat) s5-0 (-> this root quat)) ) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (new 'stack-no-clear 'vector) - (let ((a1-4 (-> obj nav state))) + (let ((a1-4 (-> this nav state))) (set! (-> s4-0 quad) (-> a1-4 velocity quad)) ) (let ((s1-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) ) - (let ((s0-0 (-> obj nav state current-poly))) + (let ((s0-0 (-> this nav state current-poly))) (vector-xz-normalize-copy! s1-0 s4-0 163840.0) (set! (-> s2-0 quad) (-> s1-0 quad)) - (clamp-vector-to-mesh-no-gaps (-> obj nav) (-> obj root trans) s0-0 s2-0 s3-0) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s0-0 s2-0 s3-0) ) (when (-> s3-0 found-boundary) (let ((f30-0 (vector-length s4-0))) @@ -432,53 +432,53 @@ (vector-rotate90-around-y! s4-0 (-> s3-0 boundary-normal)) (vector-normalize! s4-0 f30-0) ) - (when (= obj *debug-actor*) - (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> obj root trans) s4-0 (meters 10) *color-blue*) + (when (= this *debug-actor*) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> this root trans) s4-0 (meters 10) *color-blue*) (format *stdcon* "avoid border~%") ) ) ) - (set! (-> obj y-rot) (- (-> obj y-rot) (* 2.0 (seconds-per-frame) (-> obj y-rot)))) - (+! (-> obj y-rot) + (set! (-> this y-rot) (- (-> this y-rot) (* 2.0 (seconds-per-frame) (-> this y-rot)))) + (+! (-> this y-rot) (* 10.0 (seconds-per-frame) - (deg- (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> obj root quat))) (-> obj y-rot)) + (deg- (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> this root quat))) (-> this y-rot)) ) ) - (set! (-> obj y-rot) (fmax -10922.667 (fmin 10922.667 (-> obj y-rot)))) - (set! (-> obj y-rot) (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> obj root quat)))) - (quaternion-rotate-local-y! (-> obj root quat) (-> obj root quat) (* (-> obj y-rot) (seconds-per-frame))) - (vector-v*float+! (-> obj root trans) (-> obj root trans) s5-1 8954.266) + (set! (-> this y-rot) (fmax -10922.667 (fmin 10922.667 (-> this y-rot)))) + (set! (-> this y-rot) (deg- (vector-y-angle s4-0) (quaternion-y-angle (-> this root quat)))) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) (* (-> this y-rot) (seconds-per-frame))) + (vector-v*float+! (-> this root trans) (-> this root trans) s5-1 8954.266) ) - (seek! (-> obj root trans y) 4096.0 (* 4096.0 (seconds-per-frame))) - (when (= obj *debug-actor*) + (seek! (-> this root trans y) 4096.0 (* 4096.0 (seconds-per-frame))) + (when (= this *debug-actor*) (format *stdcon* "no physics~%") - (format *stdcon* "~M~%" (-> obj root trans y)) + (format *stdcon* "~M~%" (-> this root trans y)) ) ) - (if (= obj *debug-actor*) - (format *stdcon* "speed ~M~%" (vector-length (-> obj root transv))) + (if (= this *debug-actor*) + (format *stdcon* "speed ~M~%" (vector-length (-> this root transv))) ) - (let ((s4-2 (ppointer->process (-> obj parent))) + (let ((s4-2 (ppointer->process (-> this parent))) (s5-2 (new 'stack-no-clear 'vector)) ) (when s4-2 - (let ((a1-24 (-> obj nav state))) + (let ((a1-24 (-> this nav state))) (set! (-> s5-2 quad) (-> a1-24 target-post quad)) ) - (when (< (vector-vector-xz-distance (-> obj root trans) s5-2) 163840.0) - (+! (-> obj path-index) 0.01) - (let ((f0-22 (-> obj path-index))) - (set! (-> obj path-index) (- f0-22 (* (the float (the int (/ f0-22 1.0))) 1.0))) + (when (< (vector-vector-xz-distance (-> this root trans) s5-2) 163840.0) + (+! (-> this path-index) 0.01) + (let ((f0-22 (-> this path-index))) + (set! (-> this path-index) (- f0-22 (* (the float (the int (/ f0-22 1.0))) 1.0))) ) ) (get-point-at-percent-along-path! - (-> (the-as boat-manager (+ (* (-> obj path-num) 4) (the-as uint s4-2))) paths 0) + (-> (the-as boat-manager (+ (* (-> this path-num) 4) (the-as uint s4-2))) paths 0) s5-2 - (-> obj path-index) + (-> this path-index) 'interp ) - (let ((v1-76 (-> obj nav state))) + (let ((v1-76 (-> this nav state))) (logclear! (-> v1-76 flags) (nav-state-flag directional-mode)) (logior! (-> v1-76 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-76 target-post quad) (-> s5-2 quad)) @@ -486,13 +486,13 @@ 0 ) ) - (draw-thrusters obj) + (draw-thrusters this) (none) ) ;; definition for method 29 of type boat-base ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-29 boat-base ((obj boat-base) (arg0 float)) +(defmethod rigid-body-object-method-29 boat-base ((this boat-base) (arg0 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -501,18 +501,18 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s3-0 (-> obj rbody)) - (s2-0 (-> obj info)) + (let ((s3-0 (-> this rbody)) + (s2-0 (-> this info)) (s4-0 (new 'stack-no-clear 'matrix)) ) - (let ((a1-1 (-> obj nav state))) + (let ((a1-1 (-> this nav state))) (set! (-> s4-0 vector 1 quad) (-> a1-1 velocity quad)) ) (vector-! (the-as vector (-> s4-0 vector)) (-> s4-0 vector 1) (-> s3-0 state lin-velocity)) (vector-float*! (the-as vector (-> s4-0 vector)) (the-as vector (-> s4-0 vector)) (* 4.0 (-> s2-0 info mass))) (let ((s1-0 (-> s4-0 vector 2))) - (let ((s0-0 (-> obj root trans))) - (let ((v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s0-0 (-> this root trans))) + (let ((v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-6 40960.0)) (.mov vf7 a0-6) ) @@ -527,7 +527,7 @@ ) (let ((s0-1 (-> s4-0 vector 2))) (let ((s1-1 (-> s4-0 vector 2))) - (let ((v1-9 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((v1-9 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-9 -32768.0)) (.mov vf7 a0-9) ) @@ -552,62 +552,62 @@ (rigid-body-method-20 (-> s3-0 state) (the-as vector a1-10)) ) ) - (rigid-body-object-method-50 obj arg0) - (vehicle-method-99 obj arg0) + (rigid-body-object-method-50 this arg0) + (vehicle-method-99 this arg0) (none) ) ) ;; definition for method 96 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-96 boat-base ((obj boat-base)) +(defmethod vehicle-method-96 boat-base ((this boat-base)) 0 (none) ) ;; definition for method 36 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod do-engine-sounds boat-base ((obj boat-base)) +(defmethod do-engine-sounds boat-base ((this boat-base)) 0 (none) ) ;; definition for method 135 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-135 boat-base ((obj boat-base) (arg0 traffic-object-spawn-params)) - (get-nav-control obj (-> arg0 nav-mesh)) - (set! (-> obj nav callback-info) *boat-nav-callback-info*) - (logior! (-> obj nav flags) (nav-control-flag display-marks limit-rotation-rate update-heading-from-facing)) - (let ((v1-4 (-> obj nav))) +(defmethod vehicle-method-135 boat-base ((this boat-base) (arg0 traffic-object-spawn-params)) + (get-nav-control this (-> arg0 nav-mesh)) + (set! (-> this nav callback-info) *boat-nav-callback-info*) + (logior! (-> this nav flags) (nav-control-flag display-marks limit-rotation-rate update-heading-from-facing)) + (let ((v1-4 (-> this nav))) (set! (-> v1-4 target-speed) 40960.0) ) 0 - (let ((v1-6 (-> obj nav))) + (let ((v1-6 (-> this nav))) (set! (-> v1-6 acceleration) 8192.0) ) 0 - (let ((v1-8 (-> obj nav))) + (let ((v1-8 (-> this nav))) (set! (-> v1-8 turning-acceleration) 8192.0) ) 0 - (let ((v1-10 (-> obj nav))) + (let ((v1-10 (-> this nav))) (set! (-> v1-10 max-rotation-rate) 9102.223) ) 0 - (let ((v1-12 (-> obj nav))) + (let ((v1-12 (-> this nav))) (set! (-> v1-12 nav-cull-radius) 122880.0) ) 0 - (let ((v1-14 (-> obj nav))) + (let ((v1-14 (-> this nav))) (set! (-> v1-14 sphere-mask) (the-as uint 64)) ) 0 - (set! (-> obj path-num) (-> arg0 user-data)) - (set! (-> obj path-index) (+ 0.05 (-> arg0 position w))) - (logior! (-> obj root root-prim prim-core collide-as) (collide-spec pusher)) - (let ((v1-21 (-> obj root root-prim))) - (set! (-> obj root backup-collide-as) (-> v1-21 prim-core collide-as)) - (set! (-> obj root backup-collide-with) (-> v1-21 prim-core collide-with)) + (set! (-> this path-num) (-> arg0 user-data)) + (set! (-> this path-index) (+ 0.05 (-> arg0 position w))) + (logior! (-> this root root-prim prim-core collide-as) (collide-spec pusher)) + (let ((v1-21 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-21 prim-core collide-with)) ) 0 (none) @@ -615,16 +615,16 @@ ;; definition for method 31 of type boat-base ;; WARN: Return type mismatch int vs none. -(defmethod alloc-and-init-rigid-body-control boat-base ((obj boat-base) (arg0 rigid-body-vehicle-constants)) - ((method-of-type vehicle alloc-and-init-rigid-body-control) obj arg0) +(defmethod alloc-and-init-rigid-body-control boat-base ((this boat-base) (arg0 rigid-body-vehicle-constants)) + ((method-of-type vehicle alloc-and-init-rigid-body-control) this arg0) 0 (none) ) ;; definition for method 113 of type boat-base ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-113 boat-base ((obj boat-base)) - (go (method-of-object obj idle)) +(defmethod vehicle-method-113 boat-base ((this boat-base)) + (go (method-of-object this idle)) (none) ) @@ -656,7 +656,7 @@ :event vehicle-event-handler :enter (behavior () (logior! (-> self flags) (rigid-body-object-flag riding)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () '() @@ -688,23 +688,23 @@ ) ;; definition for method 3 of type barge -(defmethod inspect barge ((obj barge)) - (when (not obj) - (set! obj obj) +(defmethod inspect barge ((this barge)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type boat-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tengine: ~D~%" (-> obj engine)) - (format #t "~2Tbow-wash: ~D~%" (-> obj bow-wash)) + (format #t "~2Tengine: ~D~%" (-> this engine)) + (format #t "~2Tbow-wash: ~D~%" (-> this bow-wash)) (label cfg-4) - obj + this ) ;; definition for method 120 of type barge ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-120 barge ((obj barge)) +(defmethod vehicle-method-120 barge ((this barge)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -714,11 +714,11 @@ ) (init-vf0-vector) (let ((t9-0 (method-of-type boat-base vehicle-method-120))) - (t9-0 obj) + (t9-0 this) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (let ((s4-0 (-> obj root trans))) - (let ((v1-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s4-0 (-> this root trans))) + (let ((v1-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-4 -61440.0)) (.mov vf7 a0-4) ) @@ -733,17 +733,17 @@ (cond ((< (vector-vector-distance s5-0 (camera-pos)) 614400.0) (let ((a0-6 (static-sound-spec "barge-engine"))) - (sound-play-by-spec a0-6 (-> obj engine) s5-0) + (sound-play-by-spec a0-6 (-> this engine) s5-0) ) ) (else - (sound-stop (-> obj engine)) + (sound-stop (-> this engine)) ) ) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (let ((s4-2 (-> obj root trans))) - (let ((v1-9 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s4-2 (-> this root trans))) + (let ((v1-9 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-10 61440.0)) (.mov vf7 a0-10) ) @@ -758,11 +758,11 @@ (cond ((< (vector-vector-distance s5-1 (camera-pos)) 614400.0) (let ((a0-12 (static-sound-spec "bow-wash"))) - (sound-play-by-spec a0-12 (-> obj bow-wash) s5-1) + (sound-play-by-spec a0-12 (-> this bow-wash) s5-1) ) ) (else - (sound-stop (-> obj bow-wash)) + (sound-stop (-> this bow-wash)) ) ) ) @@ -772,8 +772,8 @@ ;; definition for method 32 of type barge ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape barge ((obj barge)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape barge ((this barge)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -886,7 +886,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-49 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-49 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -894,18 +894,18 @@ ;; definition for method 33 of type barge ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body barge ((obj barge)) +(defmethod init-skel-and-rigid-body barge ((this barge)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-barge" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *barge-constants*) - (set! (-> obj draw lod-set lod 0 dist) 1228800.0) - (set! (-> obj engine) (new-sound-id)) - (set! (-> obj bow-wash) (new-sound-id)) + (alloc-and-init-rigid-body-control this *barge-constants*) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this engine) (new-sound-id)) + (set! (-> this bow-wash) (new-sound-id)) (iterate-prims - (-> obj root) + (-> this root) (lambda ((arg0 collide-shape-prim)) (case (-> arg0 prim-core prim-type) (((prim-type sphere)) @@ -959,13 +959,13 @@ ;; definition for method 7 of type boat-manager ;; WARN: Return type mismatch process vs boat-manager. -(defmethod relocate boat-manager ((obj boat-manager) (arg0 int)) +(defmethod relocate boat-manager ((this boat-manager) (arg0 int)) (dotimes (v1-0 4) - (if (-> obj paths v1-0) - (&+! (-> obj paths v1-0) arg0) + (if (-> this paths v1-0) + (&+! (-> this paths v1-0) arg0) ) ) - (the-as boat-manager ((method-of-type process relocate) obj arg0)) + (the-as boat-manager ((method-of-type process relocate) this arg0)) ) ;; failed to figure out what this is: @@ -992,21 +992,21 @@ ;; definition for method 11 of type boat-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! boat-manager ((obj boat-manager) (arg0 entity-actor)) +(defmethod init-from-entity! boat-manager ((this boat-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) - (set! (-> obj entity) arg0) - (when (-> obj mesh) + (set! (-> this mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) + (set! (-> this entity) arg0) + (when (-> this mesh) (dotimes (s5-1 4) - (set! (-> obj paths s5-1) (new 'process 'curve-control obj 'path (the float s5-1))) - (when (-> obj paths s5-1) - (logior! (-> obj paths s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) - (let ((s4-0 (-> obj paths s5-1)) + (set! (-> this paths s5-1) (new 'process 'curve-control this 'path (the float s5-1))) + (when (-> this paths s5-1) + (logior! (-> this paths s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((s4-0 (-> this paths s5-1)) (s3-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) (f30-0 0.0) @@ -1020,13 +1020,13 @@ This commonly includes things such as: (let ((s1-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> s1-0 behavior) (the-as uint 1)) (set! (-> s1-0 id) (the-as uint 0)) - (set! (-> s1-0 nav-mesh) (the-as nav-mesh (-> obj mesh))) + (set! (-> s1-0 nav-mesh) (the-as nav-mesh (-> this mesh))) (set! (-> s1-0 position quad) (-> s3-0 quad)) (quaternion-look-at! (-> s1-0 rotation) s2-0 *up-vector*) (set! (-> s1-0 user-data) (the-as uint s5-1)) (set! (-> s1-0 position w) f30-0) (logior! (-> s1-0 flags) (traffic-spawn-flags trsflags-00)) - (process->handle (vehicle-spawn obj barge s1-0)) + (process->handle (vehicle-spawn this barge s1-0)) ) (+! f30-0 (/ (* 4096.0 (+ 150.0 (* 150.0 (rand-vu)))) (total-distance s4-0))) ) @@ -1034,6 +1034,6 @@ This commonly includes things such as: ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-obs-h_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-obs-h_REF.gc index da40201403..4b7ebfa249 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-obs-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-obs-h_REF.gc @@ -17,18 +17,18 @@ ) ;; definition for method 3 of type city-race-ring-info -(defmethod inspect city-race-ring-info ((obj city-race-ring-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-race-ring-info ((this city-race-ring-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-race-ring-info) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tangle: ~f~%" (-> obj pos w)) - (format #t "~1Tboost: ~f~%" (-> obj boost)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) + (format #t "[~8x] ~A~%" this 'city-race-ring-info) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tangle: ~f~%" (-> this pos w)) + (format #t "~1Tboost: ~f~%" (-> this boost)) + (format #t "~1Tdist: ~f~%" (-> this dist)) (label cfg-4) - obj + this ) ;; definition of type city-ambush-spot @@ -42,16 +42,16 @@ ) ;; definition for method 3 of type city-ambush-spot -(defmethod inspect city-ambush-spot ((obj city-ambush-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-ambush-spot ((this city-ambush-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-ambush-spot) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tobj-type: ~D~%" (-> obj obj-type)) + (format #t "[~8x] ~A~%" this 'city-ambush-spot) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tobj-type: ~D~%" (-> this obj-type)) (label cfg-4) - obj + this ) ;; definition of type city-ambush-info @@ -68,16 +68,16 @@ ) ;; definition for method 3 of type city-ambush-info -(defmethod inspect city-ambush-info ((obj city-ambush-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-ambush-info ((this city-ambush-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-ambush-info) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tarray: #x~X~%" (-> obj array)) + (format #t "[~8x] ~A~%" this 'city-ambush-info) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tarray: #x~X~%" (-> this array)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 e40e0381fb..8a379f3917 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-obs_REF.gc @@ -29,26 +29,26 @@ ) ;; definition for method 3 of type security-wall -(defmethod inspect security-wall ((obj security-wall)) - (when (not obj) - (set! obj obj) +(defmethod inspect security-wall ((this security-wall)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpass: ~D~%" (-> obj pass)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tnext-message-time: ~D~%" (-> obj next-message-time)) - (format #t "~2Tmessage: ~D~%" (-> obj message)) - (format #t "~2Tplane: #~%" (-> obj plane)) - (format #t "~2Tcolor: #~%" (-> obj color)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Tflash: ~f~%" (-> obj flash)) - (format #t "~2Ttouch-count: ~D~%" (-> obj touch-count)) - (format #t "~2Tbreach: ~A~%" (-> obj breach)) + (format #t "~2Tpass: ~D~%" (-> this pass)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tnext-message-time: ~D~%" (-> this next-message-time)) + (format #t "~2Tmessage: ~D~%" (-> this message)) + (format #t "~2Tplane: #~%" (-> this plane)) + (format #t "~2Tcolor: #~%" (-> this color)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tflash: ~f~%" (-> this flash)) + (format #t "~2Ttouch-count: ~D~%" (-> this touch-count)) + (format #t "~2Tbreach: ~A~%" (-> this breach)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -59,149 +59,149 @@ ;; definition for method 23 of type security-wall ;; WARN: Return type mismatch int vs none. -(defmethod security-wall-method-23 security-wall ((obj security-wall)) - (when (< (-> obj next-message-time) (current-time)) - (set! (-> obj next-message-time) +(defmethod security-wall-method-23 security-wall ((this security-wall)) + (when (< (-> this next-message-time) (current-time)) + (set! (-> this next-message-time) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0))))) ) (let ((v1-6 (rand-vu-int-count 15))) (cond ((zero? v1-6) - (case (-> obj pass) + (case (-> this pass) ((29) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) ) ((30) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) ) ((31) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) ) ((32) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) ) ) ) ((= v1-6 1) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) ) ((= v1-6 2) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) ) ((= v1-6 3) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) ) ((= v1-6 4) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) ) ((= v1-6 5) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv011" -99.0 0) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) ) ((= v1-6 6) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) ) ((= v1-6 7) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) ) ((= v1-6 8) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv014" -99.0 0) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) ) ((= v1-6 9) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv012" -99.0 0) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv012" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) ) ((= v1-6 10) (let ((v1-45 (rand-vu-int-count 3))) (cond ((zero? v1-45) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv035" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv035" -99.0 0) ) ((= v1-45 1) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv038" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv038" -99.0 0) ) ((= v1-45 2) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv058" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv058" -99.0 0) ) ) ) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) ) ((= v1-6 11) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) (let ((v1-57 (rand-vu-int-count 3))) (cond ((zero? v1-57) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv035" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv035" -99.0 0) ) ((= v1-57 1) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv038" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv038" -99.0 0) ) ((= v1-57 2) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv058" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv058" -99.0 0) ) ) ) ) ((= v1-6 12) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv014" -99.0 0) - (case (-> obj pass) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv014" -99.0 0) + (case (-> this pass) ((29) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) ) ((30) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) ) ((31) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) ) ((32) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) ) ) ) ((= v1-6 13) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv011" -99.0 0) - (case (-> obj pass) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv011" -99.0 0) + (case (-> this pass) ((29) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) ) ((30) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) ) ((31) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) ) ((32) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) ) ) ) ((= v1-6 14) - (case (-> obj pass) + (case (-> this pass) ((29) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv015" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv015" -99.0 0) ) ((30) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv016" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv016" -99.0 0) ) ((31) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv017" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv017" -99.0 0) ) ((32) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv018" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv018" -99.0 0) ) ) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) "cityv013" -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) "cityv013" -99.0 0) ) ) ) - (+! (-> obj message) 1) - (when (>= (-> obj message) 5) - (set! (-> obj message) 0) + (+! (-> this message) 1) + (when (>= (-> this message) 5) + (set! (-> this message) 0) 0 ) ) @@ -212,33 +212,33 @@ ;; definition for method 24 of type security-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod security-wall-method-24 security-wall ((obj security-wall)) +(defmethod security-wall-method-24 security-wall ((this security-wall)) (let ((s4-0 *target*)) (when s4-0 - (let* ((f0-0 (vector-vector-distance-squared (-> obj root trans) (-> s4-0 control trans))) - (f30-0 (+ 40960.0 (-> obj root root-prim local-sphere w))) + (let* ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> s4-0 control trans))) + (f30-0 (+ 40960.0 (-> this root root-prim local-sphere w))) (f1-1 f30-0) ) (when (< f0-0 (* f1-1 f1-1)) (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1))) (set! (-> s5-0 0 quad) (-> s4-0 control trans quad)) - (when (< (vector-vector-distance-squared (-> obj root trans) (-> obj target-pos)) (* f30-0 f30-0)) - (let ((f0-3 (vector4-dot (-> obj target-pos) (the-as vector (-> obj plane)))) - (f1-7 (vector4-dot (-> s5-0 0) (the-as vector (-> obj plane)))) + (when (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) (* f30-0 f30-0)) + (let ((f0-3 (vector4-dot (-> this target-pos) (the-as vector (-> this plane)))) + (f1-7 (vector4-dot (-> s5-0 0) (the-as vector (-> this plane)))) ) (if (and (< (fabs f1-7) 16384.0) (< (fabs f0-3) 16384.0) (or (and (< f0-3 0.0) (>= f1-7 0.0)) (and (< f1-7 0.0) (>= f0-3 0.0))) ) - (set! (-> obj breach) #t) + (set! (-> this breach) #t) ) ) ) - (set! (-> obj target-pos quad) (-> s5-0 0 quad)) + (set! (-> this target-pos quad) (-> s5-0 0 quad)) ) - (when (-> obj breach) + (when (-> this breach) (if (send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'grenade)))) - (set! (-> obj breach) #f) + (set! (-> this breach) #f) ) ) ) @@ -468,7 +468,7 @@ ;; definition for method 22 of type security-wall ;; INFO: Used lq/sq -(defmethod security-wall-method-22 security-wall ((obj security-wall) (arg0 path-control) (arg1 float)) +(defmethod security-wall-method-22 security-wall ((this security-wall) (arg0 path-control) (arg1 float)) (let ((s4-0 (new 'static 'vector)) (s3-0 (new 'static 'vector)) ) @@ -476,7 +476,7 @@ (get-point-in-path! arg0 s4-0 0.0 'exact) (get-point-in-path! arg0 s3-0 1.0 'exact) (* 0.5 (vector-vector-distance s4-0 s3-0)) - (let ((s2-1 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s2-1 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-7 (new 'process 'collide-shape-prim-mesh s2-1 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-7 prim-core collide-as) (collide-spec blocking-plane camera-blocker)) (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list)) @@ -490,10 +490,10 @@ (set! (-> s2-1 backup-collide-as) (-> v1-10 prim-core collide-as)) (set! (-> s2-1 backup-collide-with) (-> v1-10 prim-core collide-with)) ) - (set! (-> obj root) s2-1) + (set! (-> this root) s2-1) ) (let ((s2-2 (new 'stack-no-clear 'matrix)) - (s1-0 (-> obj root)) + (s1-0 (-> this root)) ) (vector+! (-> s1-0 trans) s4-0 s3-0) (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) @@ -507,9 +507,9 @@ (vector-cross! (-> s2-2 vector 2) (the-as vector (-> s2-2 vector)) (-> s2-2 vector 1)) (vector-normalize! (-> s2-2 vector 2) 1.0) (matrix->quaternion (-> s1-0 quat) s2-2) - (set! (-> obj plane quad) (-> s2-2 vector 2 quad)) - (set! (-> obj plane w) (- (vector-dot (-> s2-2 vector 2) (-> obj root trans)))) - (let ((v0-8 (-> obj root root-prim local-sphere))) + (set! (-> this plane quad) (-> s2-2 vector 2 quad)) + (set! (-> this plane w) (- (vector-dot (-> s2-2 vector 2) (-> this root trans)))) + (let ((v0-8 (-> this root root-prim local-sphere))) (set! (-> v0-8 x) 0.0) (set! (-> v0-8 y) (* 0.00024414062 (* 0.5 arg1))) (set! (-> v0-8 z) 0.0) @@ -528,7 +528,7 @@ ;; definition for method 11 of type security-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! security-wall ((obj security-wall) (arg0 entity-actor)) +(defmethod init-from-entity! security-wall ((this security-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -536,50 +536,50 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (ctywide-entity-hack) - (set! (-> obj breach) #f) - (set! (-> obj pass) (res-lump-value arg0 'pickup-type int :time -1000000000.0)) - (let ((v1-3 (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f))) - (set! (-> obj path) v1-3) + (set! (-> this breach) #f) + (set! (-> this pass) (res-lump-value arg0 'pickup-type int :time -1000000000.0)) + (let ((v1-3 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))) + (set! (-> this path) v1-3) (if (or (not v1-3) (!= (-> v1-3 curve num-cverts) 2)) (go process-drawable-art-error "bad path") ) ) - (security-wall-method-22 obj (-> obj path) 122880.0) + (security-wall-method-22 this (-> this path) 122880.0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-security-wall" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj root event-self) 'touched) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (logior! (-> obj draw status) (draw-control-status disable-fog)) - (set-security-texture-masks! (the-as vector (-> obj draw mgeo header texture-usage-group data 4))) - (set-vector! (-> obj color) 1.0 1.0 1.0 1.0) + (set! (-> this root event-self) 'touched) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this draw status) (draw-control-status disable-fog)) + (set-security-texture-masks! (the-as vector (-> this draw mgeo header texture-usage-group data 4))) + (set-vector! (-> this color) 1.0 1.0 1.0 1.0) (cond - ((= (-> obj pass) 29) - (set-vector! (-> obj color) 1.0 0.0 0.0 1.0) + ((= (-> this pass) 29) + (set-vector! (-> this color) 1.0 0.0 0.0 1.0) ) - ((= (-> obj pass) 31) - (set-vector! (-> obj color) 1.0 1.0 0.0 1.0) + ((= (-> this pass) 31) + (set-vector! (-> this color) 1.0 1.0 0.0 1.0) ) - ((= (-> obj pass) 30) - (set-vector! (-> obj color) 0.0 1.0 0.0 1.0) + ((= (-> this pass) 30) + (set-vector! (-> this color) 0.0 1.0 0.0 1.0) ) - ((= (-> obj pass) 32) - (set-vector! (-> obj color) 0.0 0.0 1.0 1.0) + ((= (-> this pass) 32) + (set-vector! (-> this color) 0.0 0.0 1.0 1.0) ) ) - (set-security-color! (-> obj color)) - (set-vector! (-> obj draw color-mult) 0.0 0.0 0.0 0.0) - (set-vector! (-> obj draw color-emissive) 1.0 1.0 1.0 1.0) + (set-security-color! (-> this color)) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.0 0.0) + (set-vector! (-> this draw color-emissive) 1.0 1.0 1.0 1.0) (transform-post) - (if (or (and (logtest? (game-feature pass-red) (-> *game-info* features)) (= 29 (-> obj pass))) - (and (logtest? (game-feature pass-green) (-> *game-info* features)) (= 30 (-> obj pass))) - (and (logtest? (game-feature pass-yellow) (-> *game-info* features)) (= 31 (-> obj pass))) - (and (logtest? (game-feature pass-blue) (-> *game-info* features)) (= 32 (-> obj pass))) + (if (or (and (logtest? (game-feature pass-red) (-> *game-info* features)) (= 29 (-> this pass))) + (and (logtest? (game-feature pass-green) (-> *game-info* features)) (= 30 (-> this pass))) + (and (logtest? (game-feature pass-yellow) (-> *game-info* features)) (= 31 (-> this pass))) + (and (logtest? (game-feature pass-blue) (-> *game-info* features)) (= 32 (-> this pass))) ) - (go (method-of-object obj idle-open)) - (go (method-of-object obj idle-close)) + (go (method-of-object this idle-open)) + (go (method-of-object this idle-close)) ) (none) ) @@ -606,23 +606,23 @@ This commonly includes things such as: ) ;; definition for method 3 of type fruit-stand -(defmethod inspect fruit-stand ((obj fruit-stand)) - (when (not obj) - (set! obj obj) +(defmethod inspect fruit-stand ((this fruit-stand)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Thack-counter: ~D~%" (-> obj hack-counter)) - (format #t "~2Tcount-sparts: ~D~%" (-> obj count-sparts)) - (format #t "~2Tfirst-sparts: ~D~%" (-> obj first-sparts)) - (format #t "~2Tnum-sparts: ~D~%" (-> obj num-sparts)) - (format #t "~2Tsparts-index[4] @ #x~X~%" (-> obj sparts-index)) - (format #t "~2Tsparts-pos[4] @ #x~X~%" (-> obj sparts-pos)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Thack-counter: ~D~%" (-> this hack-counter)) + (format #t "~2Tcount-sparts: ~D~%" (-> this count-sparts)) + (format #t "~2Tfirst-sparts: ~D~%" (-> this first-sparts)) + (format #t "~2Tnum-sparts: ~D~%" (-> this num-sparts)) + (format #t "~2Tsparts-index[4] @ #x~X~%" (-> this sparts-index)) + (format #t "~2Tsparts-pos[4] @ #x~X~%" (-> this sparts-pos)) (label cfg-4) - obj + this ) ;; definition for symbol *fruit-check-ground-counter*, type int @@ -989,8 +989,8 @@ This commonly includes things such as: ;; definition for method 28 of type fruit-stand ;; WARN: Return type mismatch int vs none. -(defmethod fruit-stand-method-28 fruit-stand ((obj fruit-stand)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod fruit-stand-method-28 fruit-stand ((this fruit-stand)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1010,7 +1010,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1018,31 +1018,31 @@ This commonly includes things such as: ;; definition for method 29 of type fruit-stand ;; WARN: Return type mismatch int vs none. -(defmethod fruit-stand-method-29 fruit-stand ((obj fruit-stand)) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 185) obj)) +(defmethod fruit-stand-method-29 fruit-stand ((this fruit-stand)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 185) this)) 0 (none) ) ;; definition for method 11 of type fruit-stand ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fruit-stand ((obj fruit-stand) (arg0 entity-actor)) +(defmethod init-from-entity! fruit-stand ((this fruit-stand) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (fruit-stand-method-28 obj) - (process-drawable-from-entity! obj arg0) + (fruit-stand-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fruit-stand" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (fruit-stand-method-29 obj) - (go (method-of-object obj idle)) + (fruit-stand-method-29 this) + (go (method-of-object this idle)) (none) ) @@ -1056,16 +1056,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type cty-fruit-stand -(defmethod inspect cty-fruit-stand ((obj cty-fruit-stand)) - (when (not obj) - (set! obj obj) +(defmethod inspect cty-fruit-stand ((this cty-fruit-stand)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type fruit-stand inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1366,30 +1366,30 @@ This commonly includes things such as: ) ;; definition for method 3 of type cty-guard-turret -(defmethod inspect cty-guard-turret ((obj cty-guard-turret)) - (when (not obj) - (set! obj obj) +(defmethod inspect cty-guard-turret ((this cty-guard-turret)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tjm-turret: ~A~%" (-> obj jm-turret)) - (format #t "~2Tjm-gunsL: ~A~%" (-> obj jm-gunsL)) - (format #t "~2Tjm-gunsR: ~A~%" (-> obj jm-gunsR)) - (format #t "~2Tangle-turret: ~f~%" (-> obj angle-turret)) - (format #t "~2Tangle-guns: ~f~%" (-> obj angle-guns)) - (format #t "~2Tlast-no-zero: ~D~%" (-> obj last-no-zero)) - (format #t "~2Tnext-time-shot: ~D~%" (-> obj next-time-shot)) - (format #t "~2Tnum-shots: ~D~%" (-> obj num-shots)) - (format #t "~2Tfocus: #~%" (-> obj focus)) - (format #t "~2Tid: ~D~%" (-> obj id)) - (format #t "~2Tdestroyed: ~A~%" (-> obj destroyed)) - (format #t "~2Tbutton-down?: ~A~%" (-> obj button-down?)) - (format #t "~2Thit-points: ~D~%" (-> obj hit-points)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tjm-turret: ~A~%" (-> this jm-turret)) + (format #t "~2Tjm-gunsL: ~A~%" (-> this jm-gunsL)) + (format #t "~2Tjm-gunsR: ~A~%" (-> this jm-gunsR)) + (format #t "~2Tangle-turret: ~f~%" (-> this angle-turret)) + (format #t "~2Tangle-guns: ~f~%" (-> this angle-guns)) + (format #t "~2Tlast-no-zero: ~D~%" (-> this last-no-zero)) + (format #t "~2Tnext-time-shot: ~D~%" (-> this next-time-shot)) + (format #t "~2Tnum-shots: ~D~%" (-> this num-shots)) + (format #t "~2Tfocus: #~%" (-> this focus)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Tdestroyed: ~A~%" (-> this destroyed)) + (format #t "~2Tbutton-down?: ~A~%" (-> this button-down?)) + (format #t "~2Thit-points: ~D~%" (-> this hit-points)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1475,13 +1475,13 @@ This commonly includes things such as: ) ;; definition for method 20 of type cty-guard-turret -(defmethod get-trans cty-guard-turret ((obj cty-guard-turret) (arg0 int)) +(defmethod get-trans cty-guard-turret ((this cty-guard-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((v1-0 (-> obj root))) + (let ((v1-0 (-> this root))) (cond ((= arg0 3) - (let ((v0-0 (vector<-cspace! (new 'static 'vector) (-> obj node-list data 6)))) - (set! (-> v0-0 w) (-> obj root root-prim prim-core world-sphere w)) + (let ((v0-0 (vector<-cspace! (new 'static 'vector) (-> this node-list data 6)))) + (set! (-> v0-0 w) (-> this root root-prim prim-core world-sphere w)) v0-0 ) ) @@ -1493,7 +1493,7 @@ This commonly includes things such as: ) ;; definition for method 26 of type cty-guard-turret -(defmethod get-inv-mass cty-guard-turret ((obj cty-guard-turret)) +(defmethod get-inv-mass cty-guard-turret ((this cty-guard-turret)) 0.01 ) @@ -1757,7 +1757,7 @@ This commonly includes things such as: (ja :num! (seek! (ja-aframe 32.0 0))) ) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 5)) + (until (time-elapsed? gp-4 (seconds 5)) (suspend) ) ) @@ -1773,7 +1773,7 @@ This commonly includes things such as: ;; definition for method 34 of type cty-guard-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod cty-guard-turret-method-34 cty-guard-turret ((obj cty-guard-turret)) +(defmethod cty-guard-turret-method-34 cty-guard-turret ((this cty-guard-turret)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1782,8 +1782,8 @@ This commonly includes things such as: (vf7 :class vf) ) (init-vf0-vector) - (let ((s2-0 (-> obj node-list data 7 bone transform)) - (s5-0 (-> obj node-list data 8 bone transform)) + (let ((s2-0 (-> this node-list data 7 bone transform)) + (s5-0 (-> this node-list data 8 bone transform)) (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) (let ((s1-0 (new 'stack-no-clear 'vector)) @@ -1821,12 +1821,12 @@ This commonly includes things such as: (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-3 quad) vf6) ) - (set! (-> s4-0 ent) (-> obj entity)) + (set! (-> s4-0 ent) (-> this entity)) (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options)) - (set! (-> s4-0 notify-handle) (process->handle obj)) + (set! (-> s4-0 notify-handle) (process->handle this)) (set! (-> s4-0 owner-handle) (the-as handle #f)) - (set! (-> s4-0 ignore-handle) (process->handle obj)) + (set! (-> s4-0 ignore-handle) (process->handle this)) (let* ((v1-14 *game-info*) (a0-14 (+ (-> v1-14 attack-id) 1)) ) @@ -1837,12 +1837,12 @@ This commonly includes things such as: (set! (-> s4-0 pos quad) (-> s1-0 quad)) (set! (-> s4-0 vel quad) (-> s2-0 vector 2 quad)) (vector-normalize! (-> s4-0 vel) 819200.0) - (spawn-projectile guard-shot s4-0 obj *default-dead-pool*) + (spawn-projectile guard-shot s4-0 this *default-dead-pool*) (set! (-> s4-0 pos quad) (-> s3-0 quad)) ) (vector-negate! (-> s4-0 vel) (-> s5-0 vector 2)) (vector-normalize! (-> s4-0 vel) 819200.0) - (spawn-projectile guard-shot s4-0 obj *default-dead-pool*) + (spawn-projectile guard-shot s4-0 this *default-dead-pool*) ) (none) ) @@ -1850,7 +1850,7 @@ This commonly includes things such as: ;; definition for method 35 of type cty-guard-turret ;; INFO: Used lq/sq -(defmethod cty-guard-turret-method-35 cty-guard-turret ((obj cty-guard-turret)) +(defmethod cty-guard-turret-method-35 cty-guard-turret ((this cty-guard-turret)) (local-vars (sv-192 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1860,12 +1860,12 @@ This commonly includes things such as: (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (handle->process (-> obj focus handle)))) + (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) (let ((s0-0 (new 'stack-no-clear 'vector))) - (let ((v1-8 (-> obj root trans))) + (let ((v1-8 (-> this root trans))) (let ((a0-5 *y-vector*)) (let ((a1-3 10240.0)) (.mov vf7 a1-3) @@ -1897,13 +1897,13 @@ This commonly includes things such as: (.svf (&-> a0-7 quad) vf6) ) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 s0-0)) - (s1-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (s1-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (set! sv-192 (new 'stack-no-clear 'vector)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (-> obj node-list data 6 bone transform) - (-> obj node-list data 7 bone transform) - (-> obj node-list data 8 bone transform) + (-> this node-list data 6 bone transform) + (-> this node-list data 7 bone transform) + (-> this node-list data 8 bone transform) (vector-rotate90-around-y! sv-192 s3-1) (set! (-> sv-192 y) 0.0) (vector-normalize! sv-192 1.0) @@ -1937,27 +1937,27 @@ This commonly includes things such as: (set! (-> s4-1 y) (deg- (-> s2-0 y) (-> s0-1 y))) (cond ((focus-test? (the-as process-focusable s5-0) pilot) - (set! (-> obj angle-turret) (deg-seek (-> obj angle-turret) (-> s4-1 y) (* 36408.89 (seconds-per-frame)))) - (set! (-> obj angle-guns) (deg-seek (-> obj angle-guns) (-> s4-1 x) (* 7281.778 (seconds-per-frame)))) + (set! (-> this angle-turret) (deg-seek (-> this angle-turret) (-> s4-1 y) (* 36408.89 (seconds-per-frame)))) + (set! (-> this angle-guns) (deg-seek (-> this angle-guns) (-> s4-1 x) (* 7281.778 (seconds-per-frame)))) ) (else - (set! (-> obj angle-turret) (deg-seek (-> obj angle-turret) (-> s4-1 y) (* 18204.445 (seconds-per-frame)))) - (set! (-> obj angle-guns) (deg-seek (-> obj angle-guns) (-> s4-1 x) (* 7281.778 (seconds-per-frame)))) + (set! (-> this angle-turret) (deg-seek (-> this angle-turret) (-> s4-1 y) (* 18204.445 (seconds-per-frame)))) + (set! (-> this angle-guns) (deg-seek (-> this angle-guns) (-> s4-1 x) (* 7281.778 (seconds-per-frame)))) ) ) - (quaternion-axis-angle! (-> obj jm-turret quat) 0.0 1.0 0.0 (-> obj angle-turret)) - (when (= (+ (fabs (- (-> obj angle-turret) (-> s4-1 y))) (fabs (- (-> obj angle-guns) (-> s4-1 x)))) 0.0) - (set! (-> obj next-time-shot) (+ (current-time) (seconds 1))) - (set! (-> obj num-shots) (the-as uint 0)) + (quaternion-axis-angle! (-> this jm-turret quat) 0.0 1.0 0.0 (-> this angle-turret)) + (when (= (+ (fabs (- (-> this angle-turret) (-> s4-1 y))) (fabs (- (-> this angle-guns) (-> s4-1 x)))) 0.0) + (set! (-> this next-time-shot) (+ (current-time) (seconds 1))) + (set! (-> this num-shots) (the-as uint 0)) 0 ) ) (let ((s5-1 (new 'stack-no-clear 'quaternion))) (let ((f0-42 (/ 45511.11 (* 0.00024414062 f30-0)))) - (quaternion-axis-angle! s5-1 1.0 0.0 0.0 (fmax (fmin (-> obj angle-guns) f0-42) (- f0-42))) + (quaternion-axis-angle! s5-1 1.0 0.0 0.0 (fmax (fmin (-> this angle-guns) f0-42) (- f0-42))) ) (quaternion*! - (-> obj jm-gunsL quat) + (-> this jm-gunsL quat) (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (+ -16384.0 f28-1)) s5-1 ) @@ -1969,7 +1969,7 @@ This commonly includes things such as: ) ) ) - (quaternion-copy! (-> obj jm-gunsR quat) (-> obj jm-gunsL quat)) + (quaternion-copy! (-> this jm-gunsR quat) (-> this jm-gunsL quat)) ) ) ) @@ -1980,7 +1980,7 @@ This commonly includes things such as: :virtual #t :event cty-guard-turret-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self num-shots) (the-as uint 0)) 0 ) @@ -2057,26 +2057,29 @@ 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 ((obj cty-guard-turret) (arg0 int)) - (if (nonzero? (-> obj jm-turret)) - (&+! (-> obj jm-turret) arg0) +(defmethod relocate cty-guard-turret ((this cty-guard-turret) (arg0 int)) + (if (nonzero? (-> this jm-turret)) + (&+! (-> this jm-turret) arg0) ) - (if (nonzero? (-> obj jm-gunsL)) - (&+! (-> obj jm-gunsL) arg0) + (if (nonzero? (-> this jm-gunsL)) + (&+! (-> this jm-gunsL) arg0) ) - (if (nonzero? (-> obj jm-gunsR)) - (&+! (-> obj jm-gunsR) arg0) + (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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method cty-guard-turret 7)) + this + arg0 + ) ) ) ;; definition for method 32 of type cty-guard-turret ;; WARN: Return type mismatch int vs none. -(defmethod cty-guard-turret-method-32 cty-guard-turret ((obj cty-guard-turret)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod cty-guard-turret-method-32 cty-guard-turret ((this cty-guard-turret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2141,7 +2144,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-22 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -2149,15 +2152,15 @@ This commonly includes things such as: ;; definition for method 33 of type cty-guard-turret ;; WARN: Return type mismatch int vs none. -(defmethod cty-guard-turret-method-33 cty-guard-turret ((obj cty-guard-turret)) - (logior! (-> obj mask) (process-mask enemy)) +(defmethod cty-guard-turret-method-33 cty-guard-turret ((this cty-guard-turret)) + (logior! (-> this mask) (process-mask enemy)) 0 (none) ) ;; definition for method 11 of type cty-guard-turret ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cty-guard-turret ((obj cty-guard-turret) (arg0 entity-actor)) +(defmethod init-from-entity! cty-guard-turret ((this cty-guard-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2166,26 +2169,26 @@ This commonly includes things such as: - sounds" (local-vars (v1-23 handle)) (with-pp - (cty-guard-turret-method-32 obj) - (set! (-> obj entity) arg0) - (process-drawable-from-entity! obj arg0) + (cty-guard-turret-method-32 this) + (set! (-> this entity) arg0) + (process-drawable-from-entity! this arg0) (ctywide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-guard-turret" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (cty-guard-turret-method-33 obj) - (reset-to-collide-spec (-> obj focus) (collide-spec jak player-list)) - (set! (-> obj jm-turret) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 6)) - (set! (-> obj jm-gunsL) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 7)) - (set! (-> obj jm-gunsR) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 8)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 186) obj)) - (set! (-> obj id) (res-lump-value arg0 'extra-id int :default (the-as uint128 -1) :time -1000000000.0)) - (set! (-> obj destroyed) #f) - (set! (-> obj hit-points) 6) + (cty-guard-turret-method-33 this) + (reset-to-collide-spec (-> this focus) (collide-spec jak player-list)) + (set! (-> this jm-turret) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 6)) + (set! (-> this jm-gunsL) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 7)) + (set! (-> this jm-gunsR) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 8)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 186) this)) + (set! (-> this id) (res-lump-value arg0 'extra-id int :default (the-as uint128 -1) :time -1000000000.0)) + (set! (-> this destroyed) #f) + (set! (-> this hit-points) 6) (cond - ((and (>= (-> obj id) 0) + ((and (>= (-> this id) 0) (begin (let ((v1-21 (-> *game-info* sub-task-list (game-task-node city-power-resolution)))) (set! v1-23 (if (-> v1-21 info) @@ -2206,8 +2209,8 @@ This commonly includes things such as: (set! (-> a1-11 from) (process->ppointer pp)) (set! (-> a1-11 num-params) 2) (set! (-> a1-11 message) 'guard-turret-status) - (set! (-> a1-11 param 0) (the-as uint (-> obj id))) - (set! (-> a1-11 param 1) (the-as uint (-> obj root trans))) + (set! (-> a1-11 param 0) (the-as uint (-> this id))) + (set! (-> a1-11 param 1) (the-as uint (-> this root trans))) (let* ((t9-12 send-event-function) (v1-33 (-> *game-info* sub-task-list (game-task-node city-power-resolution))) (v1-38 (t9-12 @@ -2222,23 +2225,23 @@ This commonly includes things such as: ) (cond ((zero? v1-38) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-38 1) - (go (method-of-object obj wait-for-pushing)) + (go (method-of-object this wait-for-pushing)) ) ((= v1-38 2) - (go (method-of-object obj pushed)) + (go (method-of-object this pushed)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) ) ) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -2266,28 +2269,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type parking-spot -(defmethod inspect parking-spot ((obj parking-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect parking-spot ((this parking-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tvehicle: ~D~%" (-> obj vehicle)) - (format #t "~2Tspawned: ~A~%" (-> obj spawned)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) - (format #t "~2Ttest-sphere: #~%" (-> obj test-sphere)) + (format #t "~2Tvehicle: ~D~%" (-> this vehicle)) + (format #t "~2Tspawned: ~A~%" (-> this spawned)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Ttest-sphere: #~%" (-> this test-sphere)) (label cfg-4) - obj + this ) ;; definition for method 24 of type parking-spot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod parking-spot-method-24 parking-spot ((obj parking-spot)) +(defmethod parking-spot-method-24 parking-spot ((this parking-spot)) (let ((gp-0 (new 'stack-no-clear 'collide-query-with-2vec))) - (set! (-> gp-0 vec quad) (-> obj root trans quad)) + (set! (-> gp-0 vec quad) (-> this root trans quad)) (set! (-> gp-0 cquery start-pos quad) (-> gp-0 vec quad)) (vector-reset! (-> gp-0 vec2)) (set! (-> gp-0 vec2 y) 1.0) @@ -2304,15 +2307,15 @@ This commonly includes things such as: (when (>= f30-0 0.0) (vector+float*! (-> gp-0 vec) (-> gp-0 cquery start-pos) (-> gp-0 cquery move-dist) f30-0) (set! (-> gp-0 vec2 quad) (-> gp-0 cquery best-other-tri normal quad)) - (set! (-> obj root trans quad) (-> gp-0 vec quad)) + (set! (-> this root trans quad) (-> gp-0 vec quad)) (format #t "parking-spot::find-ground: ground y ~M~%" (-> gp-0 vec y)) ) (if (< f30-0 0.0) (format #t "parking-spot::find-ground: could not find ground~%") ) ) - (set! (-> obj root trans quad) (-> gp-0 vec quad)) - (forward-up-nopitch->quaternion (-> obj root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec2)) + (set! (-> this root trans quad) (-> gp-0 vec quad)) + (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec2)) ) 0 (none) @@ -2320,31 +2323,31 @@ This commonly includes things such as: ;; definition for method 21 of type parking-spot ;; WARN: Return type mismatch int vs none. -(defmethod parking-spot-method-21 parking-spot ((obj parking-spot)) - (let ((s5-0 (handle->process (-> obj vehicle)))) +(defmethod parking-spot-method-21 parking-spot ((this parking-spot)) + (let ((s5-0 (handle->process (-> this vehicle)))) (cond (s5-0 (cond ((or (focus-test? (the-as vehicle s5-0) dead inactive) (not (logtest? (-> (the-as vehicle s5-0) flags) (rigid-body-object-flag waiting-for-player))) - (let ((f0-0 (-> obj test-sphere r))) - (< (* f0-0 f0-0) (vector-vector-distance-squared (-> (the-as vehicle s5-0) root trans) (-> obj test-sphere))) + (let ((f0-0 (-> this test-sphere r))) + (< (* f0-0 f0-0) (vector-vector-distance-squared (-> (the-as vehicle s5-0) root trans) (-> this test-sphere))) ) ) (logclear! (-> (the-as vehicle s5-0) flags) (rigid-body-object-flag persistent)) - (set! (-> obj vehicle) (the-as handle #f)) + (set! (-> this vehicle) (the-as handle #f)) ) (else - (if (not (-> obj minimap)) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 17) (the-as int #f) (the-as vector #t) 0)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 17) (the-as int #f) (the-as vector #t) 0)) ) ) ) ) (else - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) ) ) @@ -2356,13 +2359,13 @@ This commonly includes things such as: ;; definition for method 23 of type parking-spot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod parking-spot-method-23 parking-spot ((obj parking-spot) (arg0 uint)) +(defmethod parking-spot-method-23 parking-spot ((this parking-spot) (arg0 uint)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'collide-query 1))) (let* ((a0-1 (new 'stack-no-clear 'inline-array 'vector 1)) (a1-1 #x813f9) (a2-1 (logand -2 a1-1)) ) - (set! (-> a0-1 0 quad) (-> obj test-sphere quad)) + (set! (-> a0-1 0 quad) (-> this test-sphere quad)) (let ((a1-3 (-> v1-0 0))) (set! (-> a1-3 best-dist) (the-as float a0-1)) (set! (-> a1-3 num-spheres) (the-as uint 1)) @@ -2377,16 +2380,16 @@ This commonly includes things such as: 0 (when (not (fill-and-probe-using-spheres *collide-cache* (-> v1-0 0))) (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) - (set! (-> s4-0 position quad) (-> obj root trans quad)) - (mem-copy! (the-as pointer (-> s4-0 rotation)) (the-as pointer (-> obj root quat)) 16) + (set! (-> s4-0 position quad) (-> this root trans quad)) + (mem-copy! (the-as pointer (-> s4-0 rotation)) (the-as pointer (-> this root quat)) 16) (+! (-> s4-0 position y) 14336.0) (set! (-> s4-0 behavior) (the-as uint 0)) (set! (-> s4-0 object-type) (the-as traffic-type arg0)) (set! (-> s4-0 id) (the-as uint 0)) (send-event *traffic-manager* 'activate-object s4-0) (when (-> s4-0 proc) - (set! (-> obj vehicle) (process->handle (-> s4-0 proc))) - (set! (-> obj spawned) #t) + (set! (-> this vehicle) (process->handle (-> s4-0 proc))) + (set! (-> this spawned) #t) ) ) ) @@ -2398,34 +2401,34 @@ This commonly includes things such as: ;; definition for method 11 of type parking-spot ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! parking-spot ((obj parking-spot) (arg0 entity-actor)) +(defmethod init-from-entity! parking-spot ((this parking-spot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (set! (-> obj minimap) #f) - (set! (-> obj vehicle) (the-as handle #f)) - (set! (-> obj spawned) #f) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause movie)) - (let ((f0-0 (res-lump-float (-> obj entity) 'rotoffset))) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this minimap) #f) + (set! (-> this vehicle) (the-as handle #f)) + (set! (-> this spawned) #f) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-0 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) ) ) - (parking-spot-method-24 obj) - (set! (-> obj test-sphere quad) (-> obj root trans quad)) - (set! (-> obj test-sphere r) 24576.0) - (set! (-> obj state-time) (current-time)) + (parking-spot-method-24 this) + (set! (-> this test-sphere quad) (-> this root trans quad)) + (set! (-> this test-sphere r) 24576.0) + (set-time! (-> this state-time)) (let ((a1-5 (get-random-parking-spot-type *traffic-engine*))) (if (!= a1-5 (traffic-type traffic-type-21)) - (parking-spot-method-23 obj (the-as uint a1-5)) + (parking-spot-method-23 this (the-as uint a1-5)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2438,8 +2441,8 @@ This commonly includes things such as: ) :code sleep-code :post (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.25)) - (set! (-> self state-time) (current-time)) + (when (time-elapsed? (-> self state-time) (seconds 0.25)) + (set-time! (-> self state-time)) (parking-spot-method-21 self) (when (not (-> self spawned)) (let ((f0-0 (vector-vector-distance-squared (camera-pos) (-> self test-sphere))) @@ -2486,22 +2489,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type propa -(defmethod inspect propa ((obj propa)) - (when (not obj) - (set! obj obj) +(defmethod inspect propa ((this propa)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tsound-index: ~D~%" (-> obj sound-index)) - (format #t "~2Thandle: ~D~%" (-> obj handle)) - (format #t "~2Ty-rot: ~f~%" (-> obj y-rot)) - (format #t "~2Thit-points: ~D~%" (-> obj hit-points)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tsound-index: ~D~%" (-> this sound-index)) + (format #t "~2Thandle: ~D~%" (-> this handle)) + (format #t "~2Ty-rot: ~f~%" (-> this y-rot)) + (format #t "~2Thit-points: ~D~%" (-> this hit-points)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2853,7 +2856,7 @@ This commonly includes things such as: ;; definition for method 31 of type propa ;; WARN: Return type mismatch int vs none. -(defmethod propa-method-31 propa ((obj propa) (arg0 vector)) +(defmethod propa-method-31 propa ((this propa) (arg0 vector)) (let ((s5-0 (the-as process-focusable #f))) (let ((f30-0 (the-as float #x7f800000)) (s3-0 (new 'stack-no-clear 'array 'collide-shape 64)) @@ -2873,7 +2876,7 @@ This commonly includes things such as: ) ) (when (and s1-1 - (!= obj s1-1) + (!= this s1-1) (not (focus-test? s1-1 inactive)) (not (focus-test? s1-1 disable)) (not (focus-test? s1-1 dead)) @@ -2881,7 +2884,7 @@ This commonly includes things such as: (not (logtest? (process-mask crate) (-> s1-1 mask))) (not (logtest? (process-mask vehicle) (-> s1-1 mask))) ) - (let ((f0-0 (vector-vector-xz-distance (-> obj root trans) (-> s1-1 root trans)))) + (let ((f0-0 (vector-vector-xz-distance (-> this root trans) (-> s1-1 root trans)))) (when (or (not s5-0) (< f0-0 f30-0)) (set! s5-0 s1-1) (set! f30-0 f0-0) @@ -2897,8 +2900,8 @@ This commonly includes things such as: (set! s5-0 *target*) ) (if s5-0 - (set! (-> obj handle) (process->handle s5-0)) - (set! (-> obj handle) (the-as handle #f)) + (set! (-> this handle) (process->handle s5-0)) + (set! (-> this handle) (the-as handle #f)) ) ) 0 @@ -2907,8 +2910,8 @@ This commonly includes things such as: ;; definition for method 29 of type propa ;; WARN: Return type mismatch int vs none. -(defmethod propa-method-29 propa ((obj propa)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod propa-method-29 propa ((this propa)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2939,7 +2942,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -2947,37 +2950,37 @@ This commonly includes things such as: ;; definition for method 30 of type propa ;; WARN: Return type mismatch int vs none. -(defmethod propa-method-30 propa ((obj propa)) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 170) obj)) +(defmethod propa-method-30 propa ((this propa)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 170) this)) 0 (none) ) ;; definition for method 11 of type propa ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! propa ((obj propa) (arg0 entity-actor)) +(defmethod init-from-entity! propa ((this propa) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (propa-method-29 obj) - (process-drawable-from-entity! obj arg0) + (propa-method-29 this) + (process-drawable-from-entity! this arg0) (ctywide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-propa" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (propa-method-30 obj) - (set! (-> obj sound-index) (the-as uint (rand-vu-int-count (-> *propa-sounds* length)))) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 4 0) - (set! (-> obj hit-points) 10) + (propa-method-30 this) + (set! (-> this sound-index) (the-as uint (rand-vu-int-count (-> *propa-sounds* length)))) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 4 0) + (set! (-> this hit-points) 10) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2994,16 +2997,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type baron-statue -(defmethod inspect baron-statue ((obj baron-statue)) - (when (not obj) - (set! obj obj) +(defmethod inspect baron-statue ((this baron-statue)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3013,7 +3016,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type baron-statue -(defmethod run-logic? baron-statue ((obj baron-statue)) +(defmethod run-logic? baron-statue ((this baron-statue)) #t ) @@ -3025,26 +3028,26 @@ This commonly includes things such as: ;; definition for method 11 of type baron-statue ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! baron-statue ((obj baron-statue) (arg0 entity-actor)) +(defmethod init-from-entity! baron-statue ((this baron-statue) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-baron-statue" (the-as (pointer uint32) #f))) (the-as pair 0) ) (when (task-node-closed? (game-task-node canyon-insert-items-resolution)) - (cleanup-for-death obj) + (cleanup-for-death this) (go empty-state) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3071,21 +3074,21 @@ This commonly includes things such as: ) ;; definition for method 3 of type burning-bush -(defmethod inspect burning-bush ((obj burning-bush)) - (when (not obj) - (set! obj obj) +(defmethod inspect burning-bush ((this burning-bush)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttask: ~A~%" (-> obj task)) - (format #t "~2Tpart-off: ~A~%" (-> obj part-off)) - (format #t "~2Tpart-alert: ~A~%" (-> obj part-alert)) - (format #t "~2Tangle: ~f~%" (-> obj angle)) - (format #t "~2Ttime: ~f~%" (-> obj time)) + (format #t "~2Ttask: ~A~%" (-> this task)) + (format #t "~2Tpart-off: ~A~%" (-> this part-off)) + (format #t "~2Tpart-alert: ~A~%" (-> this part-alert)) + (format #t "~2Tangle: ~f~%" (-> this angle)) + (format #t "~2Ttime: ~f~%" (-> this time)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3331,7 +3334,7 @@ This commonly includes things such as: (add-setting! 'music-volume 'rel (-> *setting-control* user-current music-volume-movie) 0) (add-setting! 'sfx-volume 'rel (-> *setting-control* user-current sfx-movie-volume) 0) (add-setting! 'dialog-volume 'rel (-> *setting-control* user-current dialog-volume-hint) 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let* ((v1-21 (get-current-task-event (-> self task))) (gp-0 (add-process *gui-control* @@ -3410,7 +3413,7 @@ This commonly includes things such as: :enter (behavior () (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) (set! (-> self time) -1.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (remove-setting! 'minimap) @@ -3452,7 +3455,7 @@ This commonly includes things such as: (vf7 :class vf) ) (init-vf0-vector) - (when (>= (- (current-time) (-> self state-time)) (seconds 1.5)) + (when (time-elapsed? (-> self state-time) (seconds 1.5)) (let ((gp-0 0) (s5-0 0) ) @@ -3890,10 +3893,10 @@ This commonly includes things such as: ) ;; definition for method 32 of type burning-bush -(defmethod burning-bush-method-32 burning-bush ((obj burning-bush)) - (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root trans))) - (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) gp-1)) - (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) gp-1)) +(defmethod burning-bush-method-32 burning-bush ((this burning-bush)) + (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) + (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) ) (and *target* (not (focus-test? *target* pilot)) @@ -3906,8 +3909,8 @@ This commonly includes things such as: ;; definition for method 30 of type burning-bush ;; WARN: Return type mismatch int vs none. -(defmethod burning-bush-method-30 burning-bush ((obj burning-bush)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod burning-bush-method-30 burning-bush ((this burning-bush)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -3927,7 +3930,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -3935,74 +3938,74 @@ This commonly includes things such as: ;; definition for method 31 of type burning-bush ;; WARN: Return type mismatch int vs none. -(defmethod burning-bush-method-31 burning-bush ((obj burning-bush)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 173) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 171) obj)) - (set! (-> obj part-alert) (create-launch-control (-> *part-group-id-table* 172) obj)) +(defmethod burning-bush-method-31 burning-bush ((this burning-bush)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 173) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 171) this)) + (set! (-> this part-alert) (create-launch-control (-> *part-group-id-table* 172) this)) 0 (none) ) ;; definition for method 7 of type burning-bush ;; WARN: Return type mismatch process-focusable vs burning-bush. -(defmethod relocate burning-bush ((obj burning-bush) (arg0 int)) - (if (nonzero? (-> obj task)) - (&+! (-> obj task) arg0) +(defmethod relocate burning-bush ((this burning-bush) (arg0 int)) + (if (nonzero? (-> this task)) + (&+! (-> this task) arg0) ) - (if (nonzero? (-> obj part-off)) - (&+! (-> obj part-off) arg0) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) arg0) ) - (if (nonzero? (-> obj part-alert)) - (&+! (-> obj part-alert) arg0) + (if (nonzero? (-> this part-alert)) + (&+! (-> this part-alert) arg0) ) - (the-as burning-bush ((method-of-type process-focusable relocate) obj arg0)) + (the-as burning-bush ((method-of-type process-focusable relocate) this arg0)) ) ;; definition for method 12 of type burning-bush -(defmethod run-logic? burning-bush ((obj burning-bush)) - (or (not (logtest? (-> obj mask) (process-mask actor-pause))) - (or (and (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root trans) (math-camera-pos)) +(defmethod run-logic? burning-bush ((this burning-bush)) + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) ) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-control-status uninited))) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) ) ) ) ;; definition for method 11 of type burning-bush ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! burning-bush ((obj burning-bush) (arg0 entity-actor)) +(defmethod init-from-entity! burning-bush ((this burning-bush) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (burning-bush-method-30 obj) - (process-drawable-from-entity! obj arg0) + (burning-bush-method-30 this) + (process-drawable-from-entity! this arg0) (ctywide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-burning-bush" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (burning-bush-method-31 obj) - (let ((f0-0 (res-lump-float (-> obj entity) 'rotoffset))) + (burning-bush-method-31 this) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-0 0.0) - (quaternion-rotate-local-y! (-> obj root quat) (-> obj root quat) f0-0) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-0) ) ) - (set! (-> obj task) + (set! (-> this task) (new 'process 'game-task-control (res-lump-value arg0 'task-actor game-task-actor :time -1000000000.0)) ) - (set! (-> obj angle) 0.0) - (set! (-> obj root pause-adjust-distance) 819200.0) + (set! (-> this angle) 0.0) + (set! (-> this root pause-adjust-distance) 819200.0) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -4029,25 +4032,25 @@ This commonly includes things such as: ) ;; definition for method 3 of type barons-ship-lores -(defmethod inspect barons-ship-lores ((obj barons-ship-lores)) - (when (not obj) - (set! obj obj) +(defmethod inspect barons-ship-lores ((this barons-ship-lores)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpaths[3] @ #x~X~%" (-> obj paths)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tcurrent-path: ~D~%" (-> obj current-path)) - (format #t "~2Tforward-backward: ~A~%" (-> obj forward-backward)) + (format #t "~2Tpaths[3] @ #x~X~%" (-> this paths)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tcurrent-path: ~D~%" (-> this current-path)) + (format #t "~2Tforward-backward: ~A~%" (-> this forward-backward)) (label cfg-4) - obj + this ) ;; definition for method 11 of type barons-ship-lores ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! barons-ship-lores ((obj barons-ship-lores) (arg0 entity-actor)) +(defmethod init-from-entity! barons-ship-lores ((this barons-ship-lores) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -4055,26 +4058,26 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (when (demo?) - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (go empty-state) ) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-barons-ship-lores" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj root pause-adjust-distance) 32768000.0) - (set! (-> obj paths 0) (new 'process 'curve-control obj 'path 0.0)) - (set! (-> obj paths 1) (new 'process 'curve-control obj 'path 1.0)) - (set! (-> obj paths 2) (new 'process 'curve-control obj 'path 2.0)) - (set! (-> obj current-path) 0) - (set! (-> obj forward-backward) #t) - (logior! (-> obj paths 0 flags) (path-control-flag display draw-line draw-point draw-text)) - (logior! (-> obj paths 1 flags) (path-control-flag display draw-line draw-point draw-text)) - (logior! (-> obj paths 2 flags) (path-control-flag display draw-line draw-point draw-text)) - (logior! (-> obj mask) (process-mask no-kill)) + (set! (-> this root pause-adjust-distance) 32768000.0) + (set! (-> this paths 0) (new 'process 'curve-control this 'path 0.0)) + (set! (-> this paths 1) (new 'process 'curve-control this 'path 1.0)) + (set! (-> this paths 2) (new 'process 'curve-control this 'path 2.0)) + (set! (-> this current-path) 0) + (set! (-> this forward-backward) #t) + (logior! (-> this paths 0 flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this paths 1 flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this paths 2 flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this mask) (process-mask no-kill)) (let ((a1-9 (new 'stack-no-clear 'sync-info-params))) (let ((v1-24 0)) (if #t @@ -4090,27 +4093,27 @@ This commonly includes things such as: (set! (-> a1-9 ease-out) 0.15) (set! (-> a1-9 pause-in) 0.05) (set! (-> a1-9 pause-out) 0.0) - (initialize! (-> obj sync) a1-9) + (initialize! (-> this sync) a1-9) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) ;; definition for method 7 of type barons-ship-lores ;; WARN: Return type mismatch process-drawable vs barons-ship-lores. -(defmethod relocate barons-ship-lores ((obj barons-ship-lores) (arg0 int)) - (if (nonzero? (-> obj paths 0)) - (&+! (-> obj paths 0) arg0) +(defmethod relocate barons-ship-lores ((this barons-ship-lores) (arg0 int)) + (if (nonzero? (-> this paths 0)) + (&+! (-> this paths 0) arg0) ) - (if (nonzero? (-> obj paths 1)) - (&+! (-> obj paths 1) arg0) + (if (nonzero? (-> this paths 1)) + (&+! (-> this paths 1) arg0) ) - (if (nonzero? (-> obj paths 2)) - (&+! (-> obj paths 2) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method barons-ship-lores 7)) this arg0) ) ) @@ -4182,16 +4185,16 @@ This commonly includes things such as: ;; definition for method 9 of type city-race-ring-info ;; WARN: Return type mismatch int vs none. -(defmethod city-race-ring-info-method-9 city-race-ring-info ((obj city-race-ring-info) (arg0 symbol)) +(defmethod city-race-ring-info-method-9 city-race-ring-info ((this city-race-ring-info) (arg0 symbol)) (format arg0 "(static-race-ring-info~%") - (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%" (-> obj pos x) (-> obj pos y) (-> obj pos z)) - (let ((f0-3 (-> obj pos w))) + (format arg0 " :pos (~4,,2M ~4,,2M ~4,,2M)~%" (-> this pos x) (-> this pos y) (-> this pos z)) + (let ((f0-3 (-> this pos w))) (format arg0 " :angle (deg ~f)~%" (* 0.005493164 f0-3)) ) - (if (!= (-> obj boost) 1.0) - (format arg0 " :boost ~4,,2f~%" (-> obj boost)) + (if (!= (-> this boost) 1.0) + (format arg0 " :boost ~4,,2f~%" (-> this boost)) ) - (format arg0 " :dist (meters ~4,,2M)~%" (-> obj dist)) + (format arg0 " :dist (meters ~4,,2M)~%" (-> this dist)) (format arg0 " ~%)~%") 0 (none) @@ -4200,12 +4203,12 @@ This commonly includes things such as: ;; definition for method 9 of type city-ambush-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod city-ambush-info-method-9 city-ambush-info ((obj city-ambush-info) (arg0 traffic-object-spawn-params)) - (set! (-> arg0 position quad) (-> obj array 0 pos quad)) +(defmethod city-ambush-info-method-9 city-ambush-info ((this city-ambush-info) (arg0 traffic-object-spawn-params)) + (set! (-> arg0 position quad) (-> this array 0 pos quad)) (set! (-> arg0 nav-mesh) (find-nearest-nav-mesh (-> arg0 position) (the-as float #x7f800000))) (vector-reset! (-> arg0 velocity)) - (dotimes (s4-0 (-> obj count)) - (let ((v1-3 (-> obj array s4-0))) + (dotimes (s4-0 (-> this count)) + (let ((v1-3 (-> this array s4-0))) (set! (-> arg0 position quad) (-> v1-3 pos quad)) (set! (-> arg0 object-type) (the-as traffic-type (-> v1-3 obj-type))) ) @@ -4240,18 +4243,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type lurker-pipe-lid -(defmethod inspect lurker-pipe-lid ((obj lurker-pipe-lid)) - (when (not obj) - (set! obj obj) +(defmethod inspect lurker-pipe-lid ((this lurker-pipe-lid)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tangle: ~f~%" (-> obj angle)) - (format #t "~2Trot: ~f~%" (-> obj rot)) + (format #t "~2Tangle: ~f~%" (-> this angle)) + (format #t "~2Trot: ~f~%" (-> this rot)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -4289,8 +4292,8 @@ This commonly includes things such as: ;; definition for method 28 of type lurker-pipe-lid ;; WARN: Return type mismatch int vs none. -(defmethod lurker-pipe-lid-method-28 lurker-pipe-lid ((obj lurker-pipe-lid)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod lurker-pipe-lid-method-28 lurker-pipe-lid ((this lurker-pipe-lid)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -4310,7 +4313,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -4318,33 +4321,33 @@ This commonly includes things such as: ;; definition for method 29 of type lurker-pipe-lid ;; WARN: Return type mismatch int vs none. -(defmethod lurker-pipe-lid-method-29 lurker-pipe-lid ((obj lurker-pipe-lid)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod lurker-pipe-lid-method-29 lurker-pipe-lid ((this lurker-pipe-lid)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; definition for method 11 of type lurker-pipe-lid ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! lurker-pipe-lid ((obj lurker-pipe-lid) (arg0 entity-actor)) +(defmethod init-from-entity! lurker-pipe-lid ((this lurker-pipe-lid) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (lurker-pipe-lid-method-28 obj) - (process-drawable-from-entity! obj arg0) + (lurker-pipe-lid-method-28 this) + (process-drawable-from-entity! this arg0) (ctywide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-lurker-pipe-lid" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (lurker-pipe-lid-method-29 obj) - (set! (-> obj angle) 0.0) + (lurker-pipe-lid-method-29 this) + (set! (-> this angle) 0.0) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -4364,16 +4367,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type ctyn-lamp -(defmethod inspect ctyn-lamp ((obj ctyn-lamp)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyn-lamp ((this ctyn-lamp)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -4454,8 +4457,8 @@ This commonly includes things such as: ;; definition for method 29 of type ctyn-lamp ;; WARN: Return type mismatch int vs none. -(defmethod ctyn-lamp-method-29 ctyn-lamp ((obj ctyn-lamp)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod ctyn-lamp-method-29 ctyn-lamp ((this ctyn-lamp)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -4493,7 +4496,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -4501,30 +4504,30 @@ This commonly includes things such as: ;; definition for method 30 of type ctyn-lamp ;; WARN: Return type mismatch int vs none. -(defmethod ctyn-lamp-method-30 ctyn-lamp ((obj ctyn-lamp)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod ctyn-lamp-method-30 ctyn-lamp ((this ctyn-lamp)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; definition for method 11 of type ctyn-lamp ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctyn-lamp ((obj ctyn-lamp) (arg0 entity-actor)) +(defmethod init-from-entity! ctyn-lamp ((this ctyn-lamp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (ctyn-lamp-method-29 obj) - (process-drawable-from-entity! obj arg0) + (ctyn-lamp-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ctyn-lamp" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (ctyn-lamp-method-30 obj) + (ctyn-lamp-method-30 this) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-part_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-part_REF.gc index 3094993444..940732d342 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctywide-part -(defmethod inspect ctywide-part ((obj ctywide-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctywide-part ((this ctywide-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type citywide-part @@ -33,16 +33,16 @@ ) ;; definition for method 3 of type citywide-part -(defmethod inspect citywide-part ((obj citywide-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect citywide-part ((this citywide-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for function birth-func-race-poster diff --git a/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc b/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc index 327f821115..8098587cd2 100644 --- a/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/ctywide-tasks_REF.gc @@ -42,8 +42,8 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (none) @@ -92,8 +92,8 @@ (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'leave) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (none) @@ -186,7 +186,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -241,7 +241,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -253,7 +253,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 1)) + (until (time-elapsed? gp-3 (seconds 1)) (suspend) ) ) @@ -278,7 +278,7 @@ (wait-for-speech-end (-> self sound-id 0)) (set! (-> self sub-state) (the-as uint 2)) (let ((gp-6 (current-time))) - (until (>= (- (current-time) gp-6) (seconds 1)) + (until (time-elapsed? gp-6 (seconds 1)) (suspend) ) ) @@ -329,7 +329,7 @@ ) ) (else - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -350,7 +350,7 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (until (>= (- (current-time) (-> self state-time)) (seconds 60)) + (until (time-elapsed? (-> self state-time) (seconds 60)) (suspend) ) (set! (-> self sub-state) (the-as uint 1)) @@ -359,7 +359,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -377,7 +377,7 @@ ) (wait-for-speech-end (-> self sound-id 0)) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 3)) + (until (time-elapsed? gp-4 (seconds 3)) (suspend) ) ) @@ -474,7 +474,7 @@ ) ) (set-setting! 'airlock #f 0.0 0) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (none) ) ) @@ -490,8 +490,8 @@ (send-event *traffic-manager* 'set-alert-duration (seconds 30)) (send-event *target* 'end-mode) (set-setting! 'pilot #f 0.0 0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (script-eval '(send-event "keira-npc-1" 'say)) @@ -713,19 +713,19 @@ ) ;; definition for method 3 of type city-bb-racepoint-info -(defmethod inspect city-bb-racepoint-info ((obj city-bb-racepoint-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-bb-racepoint-info ((this city-bb-racepoint-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-bb-racepoint-info) - (format #t "~1Tbike-pos: #~%" (-> obj bike-pos)) - (format #t "~1Tend-pos: #~%" (-> obj end-pos)) - (format #t "~1Tbike-angle: ~f~%" (-> obj bike-angle)) - (format #t "~1Tmap: ~A~%" (-> obj map)) - (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "[~8x] ~A~%" this 'city-bb-racepoint-info) + (format #t "~1Tbike-pos: #~%" (-> this bike-pos)) + (format #t "~1Tend-pos: #~%" (-> this end-pos)) + (format #t "~1Tbike-angle: ~f~%" (-> this bike-angle)) + (format #t "~1Tmap: ~A~%" (-> this map)) + (format #t "~1Ttime: ~f~%" (-> this time)) (label cfg-4) - obj + this ) ;; definition for symbol *city-bb-racepoint-info*, type (array city-bb-racepoint-info) @@ -810,7 +810,7 @@ (set! (-> self arrow) (process->handle a0-20)) ) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self time-limit) (the-as time-frame (the int (-> gp-0 time)))) ) (none) @@ -866,8 +866,8 @@ () (send-event *target* 'end-mode) (set-setting! 'pilot #f 0.0 0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (close! (-> self node-info) 'event) diff --git a/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc index 4eb553d886..f123c4c881 100644 --- a/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/farm/ctyfarm-obs_REF.gc @@ -930,39 +930,39 @@ ) ;; definition for method 3 of type shaker -(defmethod inspect shaker ((obj shaker)) - (when (not obj) - (set! obj obj) +(defmethod inspect shaker ((this shaker)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'shaker) - (format #t "~1Taxis: #~%" (-> obj axis)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Tdecay-time: ~f~%" (-> obj decay-time)) - (format #t "~1Tamplitude: ~f~%" (-> obj amplitude)) - (format #t "~1Tfreq: ~f~%" (-> obj freq)) - (format #t "~1Ty-decay-time: ~f~%" (-> obj y-decay-time)) - (format #t "~1Ty-amplitude: ~f~%" (-> obj y-amplitude)) - (format #t "~1Ty-freq: ~f~%" (-> obj y-freq)) - (format #t "~1Tshake: ~f~%" (-> obj shake)) - (format #t "~1Ty-shake: ~f~%" (-> obj y-shake)) + (format #t "[~8x] ~A~%" this 'shaker) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tdecay-time: ~f~%" (-> this decay-time)) + (format #t "~1Tamplitude: ~f~%" (-> this amplitude)) + (format #t "~1Tfreq: ~f~%" (-> this freq)) + (format #t "~1Ty-decay-time: ~f~%" (-> this y-decay-time)) + (format #t "~1Ty-amplitude: ~f~%" (-> this y-amplitude)) + (format #t "~1Ty-freq: ~f~%" (-> this y-freq)) + (format #t "~1Tshake: ~f~%" (-> this shake)) + (format #t "~1Ty-shake: ~f~%" (-> this y-shake)) (label cfg-4) - obj + this ) ;; definition for method 9 of type shaker ;; WARN: Return type mismatch float vs none. -(defmethod shaker-method-9 shaker ((obj shaker)) - (let ((s5-0 (- (current-time) (-> obj start-time)))) - (set! (-> obj shake) (* (-> obj amplitude) - (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> obj decay-time)) - (cos (* 65536.0 (/ (the float s5-0) (-> obj freq)))) - ) +(defmethod shaker-method-9 shaker ((this shaker)) + (let ((s5-0 (- (current-time) (-> this start-time)))) + (set! (-> this shake) (* (-> this amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this freq)))) + ) ) - (set! (-> obj y-shake) (* (-> obj y-amplitude) - (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> obj y-decay-time)) - (cos (* 65536.0 (/ (the float s5-0) (-> obj y-freq)))) - ) + (set! (-> this y-shake) (* (-> this y-amplitude) + (lerp-scale 1.0 0.0 (the float s5-0) 0.0 (-> this y-decay-time)) + (cos (* 65536.0 (/ (the float s5-0) (-> this y-freq)))) + ) ) ) (none) @@ -1049,18 +1049,18 @@ ) ;; definition for method 3 of type farm-marrow -(defmethod inspect farm-marrow ((obj farm-marrow)) - (when (not obj) - (set! obj obj) +(defmethod inspect farm-marrow ((this farm-marrow)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tshakers[5] @ #x~X~%" (-> obj shakers)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (format #t "~2Tshakers[5] @ #x~X~%" (-> this shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) (label cfg-4) - obj + this ) ;; definition for function farm-marrow-callback @@ -1136,7 +1136,7 @@ ) (let ((v1-10 (-> self shakers))) (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) - (set! (-> v1-10 0 start-time) (current-time)) + (set-time! (-> v1-10 0 start-time)) (set! (-> v1-10 0 decay-time) 300.0) (set! (-> v1-10 0 freq) 150.0) (set! (-> v1-10 0 amplitude) 1820.4445) @@ -1256,8 +1256,8 @@ ;; definition for method 29 of type farm-marrow ;; WARN: Return type mismatch int vs none. -(defmethod farm-marrow-method-29 farm-marrow ((obj farm-marrow)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-marrow-method-29 farm-marrow ((this farm-marrow)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1277,7 +1277,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1285,35 +1285,35 @@ ;; definition for method 30 of type farm-marrow ;; WARN: Return type mismatch int vs none. -(defmethod farm-marrow-method-30 farm-marrow ((obj farm-marrow)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-marrow-method-30 farm-marrow ((this farm-marrow)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; definition for method 11 of type farm-marrow ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-marrow ((obj farm-marrow) (arg0 entity-actor)) +(defmethod init-from-entity! farm-marrow ((this farm-marrow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-marrow-method-29 obj) - (process-drawable-from-entity! obj arg0) + (farm-marrow-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-marrow" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (farm-marrow-method-30 obj) - (quaternion-vector-angle! (-> obj root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (farm-marrow-method-30 this) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) (let ((f0-2 (rand-vu-float-range 0.9 1.1))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1366,18 +1366,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type farm-beetree -(defmethod inspect farm-beetree ((obj farm-beetree)) - (when (not obj) - (set! obj obj) +(defmethod inspect farm-beetree ((this farm-beetree)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tshakers[2] @ #x~X~%" (-> obj shakers)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (format #t "~2Tshakers[2] @ #x~X~%" (-> this shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) (label cfg-4) - obj + this ) ;; definition for function farm-beetree-callback @@ -1453,7 +1453,7 @@ This commonly includes things such as: ) (let ((v1-10 (-> self shakers))) (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) - (set! (-> v1-10 0 start-time) (current-time)) + (set-time! (-> v1-10 0 start-time)) (set! (-> v1-10 0 decay-time) 300.0) (set! (-> v1-10 0 freq) 150.0) (set! (-> v1-10 0 amplitude) 1820.4445) @@ -1532,8 +1532,8 @@ This commonly includes things such as: ;; definition for method 29 of type farm-beetree ;; WARN: Return type mismatch int vs none. -(defmethod farm-beetree-method-29 farm-beetree ((obj farm-beetree)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-beetree-method-29 farm-beetree ((this farm-beetree)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1553,7 +1553,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1561,35 +1561,35 @@ This commonly includes things such as: ;; definition for method 30 of type farm-beetree ;; WARN: Return type mismatch int vs none. -(defmethod farm-beetree-method-30 farm-beetree ((obj farm-beetree)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-beetree-method-30 farm-beetree ((this farm-beetree)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; definition for method 11 of type farm-beetree ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-beetree ((obj farm-beetree) (arg0 entity-actor)) +(defmethod init-from-entity! farm-beetree ((this farm-beetree) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-beetree-method-29 obj) - (process-drawable-from-entity! obj arg0) + (farm-beetree-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-beetree" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (farm-beetree-method-30 obj) - (quaternion-vector-angle! (-> obj root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (farm-beetree-method-30 this) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) (let ((f0-2 (rand-vu-float-range 0.9 1.1))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1638,18 +1638,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type farm-cabbage -(defmethod inspect farm-cabbage ((obj farm-cabbage)) - (when (not obj) - (set! obj obj) +(defmethod inspect farm-cabbage ((this farm-cabbage)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tshakers[2] @ #x~X~%" (-> obj shakers)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (format #t "~2Tshakers[2] @ #x~X~%" (-> this shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) (label cfg-4) - obj + this ) ;; definition for function farm-cabbage-callback @@ -1725,7 +1725,7 @@ This commonly includes things such as: ) (let ((v1-10 (-> self shakers))) (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) - (set! (-> v1-10 0 start-time) (current-time)) + (set-time! (-> v1-10 0 start-time)) (set! (-> v1-10 0 decay-time) 300.0) (set! (-> v1-10 0 freq) 150.0) (set! (-> v1-10 0 amplitude) 1820.4445) @@ -1804,8 +1804,8 @@ This commonly includes things such as: ;; definition for method 29 of type farm-cabbage ;; WARN: Return type mismatch int vs none. -(defmethod farm-cabbage-method-29 farm-cabbage ((obj farm-cabbage)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-cabbage-method-29 farm-cabbage ((this farm-cabbage)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1825,7 +1825,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1833,35 +1833,35 @@ This commonly includes things such as: ;; definition for method 30 of type farm-cabbage ;; WARN: Return type mismatch int vs none. -(defmethod farm-cabbage-method-30 farm-cabbage ((obj farm-cabbage)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-cabbage-method-30 farm-cabbage ((this farm-cabbage)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; definition for method 11 of type farm-cabbage ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-cabbage ((obj farm-cabbage) (arg0 entity-actor)) +(defmethod init-from-entity! farm-cabbage ((this farm-cabbage) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-cabbage-method-29 obj) - (process-drawable-from-entity! obj arg0) + (farm-cabbage-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-cabbage" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (farm-cabbage-method-30 obj) - (quaternion-vector-angle! (-> obj root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (farm-cabbage-method-30 this) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) (let ((f0-2 (rand-vu-float-range 0.9 1.1))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1912,18 +1912,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type farm-small-cabbage -(defmethod inspect farm-small-cabbage ((obj farm-small-cabbage)) - (when (not obj) - (set! obj obj) +(defmethod inspect farm-small-cabbage ((this farm-small-cabbage)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tshakers[1] @ #x~X~%" (-> obj shakers)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (format #t "~2Tshakers[1] @ #x~X~%" (-> this shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) (label cfg-4) - obj + this ) ;; definition for function farm-small-cabbage-callback @@ -1999,7 +1999,7 @@ This commonly includes things such as: ) (let ((v1-10 (-> self shakers))) (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) - (set! (-> v1-10 0 start-time) (current-time)) + (set-time! (-> v1-10 0 start-time)) (set! (-> v1-10 0 decay-time) 300.0) (set! (-> v1-10 0 freq) 150.0) (set! (-> v1-10 0 amplitude) 910.2222) @@ -2063,8 +2063,8 @@ This commonly includes things such as: ;; definition for method 29 of type farm-small-cabbage ;; WARN: Return type mismatch int vs none. -(defmethod farm-small-cabbage-method-29 farm-small-cabbage ((obj farm-small-cabbage)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-small-cabbage-method-29 farm-small-cabbage ((this farm-small-cabbage)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2084,7 +2084,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -2092,35 +2092,35 @@ This commonly includes things such as: ;; definition for method 30 of type farm-small-cabbage ;; WARN: Return type mismatch int vs none. -(defmethod farm-small-cabbage-method-30 farm-small-cabbage ((obj farm-small-cabbage)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-small-cabbage-method-30 farm-small-cabbage ((this farm-small-cabbage)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; definition for method 11 of type farm-small-cabbage ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-small-cabbage ((obj farm-small-cabbage) (arg0 entity-actor)) +(defmethod init-from-entity! farm-small-cabbage ((this farm-small-cabbage) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-small-cabbage-method-29 obj) - (process-drawable-from-entity! obj arg0) + (farm-small-cabbage-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-small-cabbage" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (farm-small-cabbage-method-30 obj) - (quaternion-vector-angle! (-> obj root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (farm-small-cabbage-method-30 this) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) (let ((f0-2 (rand-vu-float-range 0.9 1.1))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2171,18 +2171,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type farm-chilirots -(defmethod inspect farm-chilirots ((obj farm-chilirots)) - (when (not obj) - (set! obj obj) +(defmethod inspect farm-chilirots ((this farm-chilirots)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tshakers[4] @ #x~X~%" (-> obj shakers)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) + (format #t "~2Tshakers[4] @ #x~X~%" (-> this shakers)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) (label cfg-4) - obj + this ) ;; definition for function farm-chilirots-callback @@ -2258,7 +2258,7 @@ This commonly includes things such as: ) (let ((v1-10 (-> self shakers))) (set! (-> v1-10 0 axis quad) (-> gp-4 quad)) - (set! (-> v1-10 0 start-time) (current-time)) + (set-time! (-> v1-10 0 start-time)) (set! (-> v1-10 0 decay-time) 300.0) (set! (-> v1-10 0 freq) 150.0) (set! (-> v1-10 0 amplitude) 1820.4445) @@ -2366,8 +2366,8 @@ This commonly includes things such as: ;; definition for method 29 of type farm-chilirots ;; WARN: Return type mismatch int vs none. -(defmethod farm-chilirots-method-29 farm-chilirots ((obj farm-chilirots)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-chilirots-method-29 farm-chilirots ((this farm-chilirots)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2387,7 +2387,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -2395,35 +2395,35 @@ This commonly includes things such as: ;; definition for method 30 of type farm-chilirots ;; WARN: Return type mismatch int vs none. -(defmethod farm-chilirots-method-30 farm-chilirots ((obj farm-chilirots)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-chilirots-method-30 farm-chilirots ((this farm-chilirots)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; definition for method 11 of type farm-chilirots ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-chilirots ((obj farm-chilirots) (arg0 entity-actor)) +(defmethod init-from-entity! farm-chilirots ((this farm-chilirots) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-chilirots-method-29 obj) - (process-drawable-from-entity! obj arg0) + (farm-chilirots-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-chilirots" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (farm-chilirots-method-30 obj) - (quaternion-vector-angle! (-> obj root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) + (farm-chilirots-method-30 this) + (quaternion-vector-angle! (-> this root quat) *up-vector* (* 182.04445 (rand-vu-float-range 0.0 360.0))) (let ((f0-2 (rand-vu-float-range 0.9 1.1))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2448,16 +2448,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type farm-sprinkler-barrels -(defmethod inspect farm-sprinkler-barrels ((obj farm-sprinkler-barrels)) - (when (not obj) - (set! obj obj) +(defmethod inspect farm-sprinkler-barrels ((this farm-sprinkler-barrels)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2480,8 +2480,8 @@ This commonly includes things such as: ;; definition for method 28 of type farm-sprinkler-barrels ;; WARN: Return type mismatch int vs none. -(defmethod farm-sprinkler-barrels-method-28 farm-sprinkler-barrels ((obj farm-sprinkler-barrels)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod farm-sprinkler-barrels-method-28 farm-sprinkler-barrels ((this farm-sprinkler-barrels)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2514,7 +2514,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -2522,35 +2522,35 @@ This commonly includes things such as: ;; definition for method 29 of type farm-sprinkler-barrels ;; WARN: Return type mismatch int vs none. -(defmethod farm-sprinkler-barrels-method-29 farm-sprinkler-barrels ((obj farm-sprinkler-barrels)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod farm-sprinkler-barrels-method-29 farm-sprinkler-barrels ((this farm-sprinkler-barrels)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; definition for method 11 of type farm-sprinkler-barrels ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farm-sprinkler-barrels ((obj farm-sprinkler-barrels) (arg0 entity-actor)) +(defmethod init-from-entity! farm-sprinkler-barrels ((this farm-sprinkler-barrels) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (farm-sprinkler-barrels-method-28 obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (farm-sprinkler-barrels-method-28 this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farm-sprinkler-barrels" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (farm-sprinkler-barrels-method-29 obj) + (farm-sprinkler-barrels-method-29 this) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/farm/ctyfarma-part_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/ctyfarma-part_REF.gc index b239bc0971..74f1c9761e 100644 --- a/test/decompiler/reference/jak2/levels/city/farm/ctyfarma-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/farm/ctyfarma-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctyfarma-part -(defmethod inspect ctyfarma-part ((obj ctyfarma-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyfarma-part ((this ctyfarma-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/farm/ctyfarmb-part_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/ctyfarmb-part_REF.gc index 021889db2e..565e0b1285 100644 --- a/test/decompiler/reference/jak2/levels/city/farm/ctyfarmb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/farm/ctyfarmb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctyfarmb-part -(defmethod inspect ctyfarmb-part ((obj ctyfarmb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyfarmb-part ((this ctyfarmb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc b/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc index d06e733ea5..9dc36e9582 100644 --- a/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/farm/yakow_REF.gc @@ -22,18 +22,18 @@ ) ;; definition for method 3 of type yakow -(defmethod inspect yakow ((obj yakow)) - (when (not obj) - (set! obj obj) +(defmethod inspect yakow ((this yakow)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tgrazing: ~A~%" (-> obj grazing)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tgrazing: ~A~%" (-> this grazing)) (label cfg-4) - obj + this ) ;; definition for symbol *yakow-nav-enemy-info*, type nav-enemy-info @@ -215,32 +215,32 @@ (set! (-> *yakow-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 56 of type yakow -(defmethod damage-amount-from-attack yakow ((obj yakow) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack yakow ((this yakow) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) ;; definition for method 74 of type yakow -(defmethod general-event-handler yakow ((obj yakow) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler yakow ((this yakow) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) (let ((v1-1 (the-as object (-> arg3 param 1)))) - (when (!= (-> (the-as attack-info v1-1) id) (-> obj incoming-attack-id)) - (set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-1) id)) - (go (method-of-object obj kicked)) + (when (!= (-> (the-as attack-info v1-1) id) (-> this incoming-attack-id)) + (set! (-> this incoming-attack-id) (-> (the-as attack-info v1-1) id)) + (go (method-of-object this kicked)) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 123 of type yakow -(defmethod enemy-method-123 yakow ((obj yakow) (arg0 float)) +(defmethod enemy-method-123 yakow ((this yakow) (arg0 float)) "TODO" (>= arg0 (rand-vu)) ) @@ -249,16 +249,16 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 156 yakow) has a return type of none, but the expression builder found a return statement. -(defmethod nav-enemy-method-156 yakow ((obj yakow)) +(defmethod nav-enemy-method-156 yakow ((this yakow)) (dotimes (s5-0 16) - (let ((f30-1 (* 4096.0 (get-rand-float-range obj -10.0 10.0))) - (f0-2 (* 4096.0 (get-rand-float-range obj -10.0 10.0))) + (let ((f30-1 (* 4096.0 (get-rand-float-range this -10.0 10.0))) + (f0-2 (* 4096.0 (get-rand-float-range this -10.0 10.0))) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> obj root trans quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) (+! (-> s4-0 x) f30-1) (+! (-> s4-0 z) f0-2) - (let ((v1-7 (-> obj nav)) + (let ((v1-7 (-> this nav)) (a0-6 s4-0) (a1-2 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -266,7 +266,7 @@ (set! (-> a1-2 y-threshold) (-> v1-7 nearest-y-threshold)) (set! (-> a1-2 ignore) (the-as uint 2)) (when (find-poly-containing-point-local (-> v1-7 state mesh) a1-2) - (let ((v1-12 (-> obj nav state))) + (let ((v1-12 (-> this nav state))) (logclear! (-> v1-12 flags) (nav-state-flag directional-mode)) (logior! (-> v1-12 flags) (nav-state-flag target-poly-dirty)) (set! (-> v1-12 target-post quad) (-> s4-0 quad)) @@ -308,7 +308,7 @@ ) :post (behavior () (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-control-status on-screen))) - (set! (-> self last-draw-time) (current-time)) + (set-time! (-> self last-draw-time)) ) (enemy-method-129 self) (ja-post) @@ -319,7 +319,7 @@ (defstate active (yakow) :virtual #t :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (< (the-as int (-> self focus aware)) 1) (go-virtual idle) ) @@ -416,7 +416,7 @@ (set! (-> v1-0 nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () '() @@ -438,9 +438,9 @@ ;; definition for method 114 of type yakow ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! yakow ((obj yakow)) +(defmethod init-enemy-collision! yakow ((this yakow)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -478,7 +478,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -486,19 +486,19 @@ ;; definition for method 115 of type yakow ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! yakow ((obj yakow)) +(defmethod init-enemy! yakow ((this yakow)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-yakow" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *yakow-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *yakow-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 327680.0) + (set-gravity-length (-> this root dynam) 327680.0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/generic/ctygena-part_REF.gc b/test/decompiler/reference/jak2/levels/city/generic/ctygena-part_REF.gc index 5339d3c027..f1c326fbf5 100644 --- a/test/decompiler/reference/jak2/levels/city/generic/ctygena-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/generic/ctygena-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctygena-part -(defmethod inspect ctygena-part ((obj ctygena-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctygena-part ((this ctygena-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type citytest-part @@ -33,16 +33,16 @@ ) ;; definition for method 3 of type citytest-part -(defmethod inspect citytest-part ((obj citytest-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect citytest-part ((this citytest-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/generic/ctygenb-part_REF.gc b/test/decompiler/reference/jak2/levels/city/generic/ctygenb-part_REF.gc index e4bff5781f..949a12eea7 100644 --- a/test/decompiler/reference/jak2/levels/city/generic/ctygenb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/generic/ctygenb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctygenb-part -(defmethod inspect ctygenb-part ((obj ctygenb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctygenb-part ((this ctygenb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/generic/ctygenc-part_REF.gc b/test/decompiler/reference/jak2/levels/city/generic/ctygenc-part_REF.gc index 6f9d3ae0dd..b76bc969a0 100644 --- a/test/decompiler/reference/jak2/levels/city/generic/ctygenc-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/generic/ctygenc-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctygenc-part -(defmethod inspect ctygenc-part ((obj ctygenc-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctygenc-part ((this ctygenc-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc b/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc index 85249760ba..255d19a7a9 100644 --- a/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/generic/neon-praxis-part_REF.gc @@ -1078,80 +1078,80 @@ ) ;; definition for method 3 of type city-neon-praxis -(defmethod inspect city-neon-praxis ((obj city-neon-praxis)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-neon-praxis ((this city-neon-praxis)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trot: ~`vector`P~%" (-> obj rot)) - (format #t "~2Tmaster-enable: ~D~%" (-> obj master-enable)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tpraxis-mode: ~D~%" (-> obj praxis-mode)) - (format #t "~2Tback-mode: ~D~%" (-> obj back-mode)) - (format #t "~2Tpraxis-counter: ~D~%" (-> obj praxis-counter)) - (format #t "~2Tback-counter: ~D~%" (-> obj back-counter)) - (format #t "~2Tparts[2] @ #x~X~%" (-> obj parts)) + (format #t "~2Trot: ~`vector`P~%" (-> this rot)) + (format #t "~2Tmaster-enable: ~D~%" (-> this master-enable)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tpraxis-mode: ~D~%" (-> this praxis-mode)) + (format #t "~2Tback-mode: ~D~%" (-> this back-mode)) + (format #t "~2Tpraxis-counter: ~D~%" (-> this praxis-counter)) + (format #t "~2Tback-counter: ~D~%" (-> this back-counter)) + (format #t "~2Tparts[2] @ #x~X~%" (-> this parts)) (label cfg-4) - obj + this ) ;; definition for method 10 of type city-neon-praxis -(defmethod deactivate city-neon-praxis ((obj city-neon-praxis)) +(defmethod deactivate city-neon-praxis ((this city-neon-praxis)) (dotimes (s5-0 2) - (let ((a0-1 (-> obj parts s5-0))) + (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type city-neon-praxis ;; WARN: Return type mismatch process-drawable vs city-neon-praxis. -(defmethod relocate city-neon-praxis ((obj city-neon-praxis) (arg0 int)) +(defmethod relocate city-neon-praxis ((this city-neon-praxis) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj parts v1-0)) - (&+! (-> obj parts v1-0) arg0) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) arg0) ) ) - (the-as city-neon-praxis ((method-of-type process-drawable relocate) obj arg0)) + (the-as city-neon-praxis ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 21 of type city-neon-praxis ;; WARN: Return type mismatch symbol vs none. -(defmethod city-neon-praxis-method-21 city-neon-praxis ((obj city-neon-praxis)) - (+! (-> obj parts 1 state-counter) 1) - (when (!= (-> obj parts 1 state-mode 0) (-> obj praxis-mode)) - (set! (-> obj parts 1 state-mode 0) (-> obj praxis-mode)) - (set! (-> obj parts 1 state-counter) (the-as uint 0)) +(defmethod city-neon-praxis-method-21 city-neon-praxis ((this city-neon-praxis)) + (+! (-> this parts 1 state-counter) 1) + (when (!= (-> this parts 1 state-mode 0) (-> this praxis-mode)) + (set! (-> this parts 1 state-mode 0) (-> this praxis-mode)) + (set! (-> this parts 1 state-counter) (the-as uint 0)) 0 ) - (+! (-> obj parts 0 state-counter) 1) - (when (!= (-> obj parts 0 state-mode 0) (-> obj back-mode)) - (set! (-> obj parts 0 state-mode 0) (-> obj back-mode)) - (set! (-> obj parts 0 state-counter) (the-as uint 0)) + (+! (-> this parts 0 state-counter) 1) + (when (!= (-> this parts 0 state-mode 0) (-> this back-mode)) + (set! (-> this parts 0 state-mode 0) (-> this back-mode)) + (set! (-> this parts 0 state-counter) (the-as uint 0)) 0 ) - (let ((s5-0 (-> obj master-enable)) + (let ((s5-0 (-> this master-enable)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) - (f30-0 (-> obj rot y)) + (f30-0 (-> this rot y)) ) (set-vector! s4-0 (* 3276.8 (cos (- 49152.0 f30-0))) 0.0 (* 3276.8 (sin (- 49152.0 f30-0))) 1.0) - (vector-! s3-0 (camera-pos) (-> obj root trans)) + (vector-! s3-0 (camera-pos) (-> this root trans)) (when (< (vector-dot s4-0 s3-0) 0.0) (vector-negate! s4-0 s4-0) (set! f30-0 (+ 32768.0 f30-0)) ) - (vector+! s4-0 s4-0 (-> obj root trans)) + (vector+! s4-0 s4-0 (-> this root trans)) (dotimes (s3-1 2) (when (logtest? s5-0 1) - (let ((s2-3 (-> obj parts s3-1))) + (let ((s2-3 (-> this parts s3-1))) (matrix-rotate-y! (-> s2-3 origin) (+ 16384.0 f30-0)) (spawn s2-3 s4-0) ) @@ -1209,35 +1209,35 @@ ;; definition for method 11 of type city-neon-praxis ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! city-neon-praxis ((obj city-neon-praxis) (arg0 entity-actor)) +(defmethod init-from-entity! city-neon-praxis ((this city-neon-praxis) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause enemy)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj master-enable) (the-as uint -1)) - (set! (-> obj praxis-mode) (the-as uint (rand-vu-int-count 5))) - (set! (-> obj back-mode) (the-as uint (rand-vu-int-count 8))) - (-> obj rot y) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause enemy)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this master-enable) (the-as uint -1)) + (set! (-> this praxis-mode) (the-as uint (rand-vu-int-count 5))) + (set! (-> this back-mode) (the-as uint (rand-vu-int-count 8))) + (-> this rot y) (let ((f0-1 16384.0)) - (set! (-> obj rot y) f0-1) - (quaternion-vector-angle! (-> obj root quat) (new 'static 'vector :y 1.0 :w 1.0) f0-1) + (set! (-> this rot y) f0-1) + (quaternion-vector-angle! (-> this root quat) (new 'static 'vector :y 1.0 :w 1.0) f0-1) ) (let ((s5-1 (new 'stack-no-clear 'vector))) - (vector-z-quaternion! s5-1 (-> obj root quat)) + (vector-z-quaternion! s5-1 (-> this root quat)) (vector-normalize! s5-1 -4096.0) - (vector+! (-> obj root trans) (-> obj root trans) s5-1) + (vector+! (-> this root trans) (-> this root trans) s5-1) ) (let ((s5-2 *city-neon-praxis-group-ids*)) (dotimes (s4-0 2) - (set! (-> obj parts s4-0) (create-launch-control (-> *part-group-id-table* (-> s5-2 s4-0)) obj)) + (set! (-> this parts s4-0) (create-launch-control (-> *part-group-id-table* (-> s5-2 s4-0)) this)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-part_REF.gc b/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-part_REF.gc index 510c272058..a3895da405 100644 --- a/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/industrial/ctyinda-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctyinda-part -(defmethod inspect ctyinda-part ((obj ctyinda-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyinda-part ((this ctyinda-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-part_REF.gc b/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-part_REF.gc index 27be3e2c3e..6594e2f303 100644 --- a/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/industrial/ctyindb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctyindb-part -(defmethod inspect ctyindb-part ((obj ctyindb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyindb-part ((this ctyindb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-h_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-h_REF.gc index 95ce82f917..fc2847ed8b 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-h_REF.gc @@ -33,22 +33,22 @@ ) ;; definition for method 3 of type crocadog-escort -(defmethod inspect crocadog-escort ((obj crocadog-escort)) - (when (not obj) - (set! obj obj) +(defmethod inspect crocadog-escort ((this crocadog-escort)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttravel-anim-interp: ~f~%" (-> obj travel-anim-interp)) - (format #t "~2Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~2Tkid-handle: ~D~%" (-> obj kid-handle)) - (format #t "~2Tvehicle-handle: ~D~%" (-> obj vehicle-handle)) - (format #t "~2Tlocal-seat-pos: #~%" (-> obj local-seat-pos)) - (format #t "~2Texit-vehicle-dest: ~`vector`P~%" (-> obj exit-vehicle-dest)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> this travel-anim-interp)) + (format #t "~2Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~2Tkid-handle: ~D~%" (-> this kid-handle)) + (format #t "~2Tvehicle-handle: ~D~%" (-> this vehicle-handle)) + (format #t "~2Tlocal-seat-pos: #~%" (-> this local-seat-pos)) + (format #t "~2Texit-vehicle-dest: ~`vector`P~%" (-> this exit-vehicle-dest)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -72,23 +72,23 @@ ) ;; definition for method 3 of type crocesct-wait-spot -(defmethod inspect crocesct-wait-spot ((obj crocesct-wait-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect crocesct-wait-spot ((this crocesct-wait-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> obj spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> this spot-indexes)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-states_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-states_REF.gc index 7561c24afd..871fcd33dd 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-states_REF.gc @@ -6,7 +6,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -150,7 +150,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -194,7 +194,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -220,10 +220,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (go-idle-or-move self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -254,7 +254,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -283,10 +283,10 @@ (logclear! (-> self bot-flags) (bot-flags bf15)) (go-idle-or-move self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -340,7 +340,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -508,7 +508,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -582,7 +582,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -743,7 +743,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -760,7 +760,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -785,7 +785,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (not (nav-enemy-method-163 self)) (go-virtual traveling) ) @@ -863,7 +863,7 @@ 0.0 (until #f (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) @@ -902,7 +902,7 @@ (defstate failed (crocadog-escort) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -920,7 +920,7 @@ (logclear! (-> self bot-flags) (bot-flags bf19)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (when (not (logtest? (bot-flags bf19) (-> self bot-flags))) (logior! (-> self bot-flags) (bot-flags bf19)) (fail-mission! self) @@ -936,7 +936,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-task_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-task_REF.gc index 57429087c4..3ea25b5497 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc-task_REF.gc @@ -3,47 +3,43 @@ ;; definition for method 9 of type crocesct-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! crocesct-wait-spot ((obj crocesct-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! crocesct-wait-spot ((this crocesct-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type crocesct-wait-spot ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 crocesct-wait-spot ((obj crocesct-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 crocesct-wait-spot ((this crocesct-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as crocadog-escort arg0)) + ((-> this check-done) this (the-as crocadog-escort arg0)) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc index f10baf08c7..1a76b7adac 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/crocesc_REF.gc @@ -177,39 +177,39 @@ (set! (-> *crocadog-escort-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type crocadog-escort -(defmethod general-event-handler crocadog-escort ((obj crocadog-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler crocadog-escort ((this crocadog-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) #f ) (('nav-mesh-kill) - (change-to *default-nav-mesh* obj) + (change-to *default-nav-mesh* this) #t ) (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 59 of type crocadog-escort -(defmethod get-penetrate-info crocadog-escort ((obj crocadog-escort)) +(defmethod get-penetrate-info crocadog-escort ((this crocadog-escort)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" - (let ((v1-1 ((method-of-type bot get-penetrate-info) obj))) + (let ((v1-1 ((method-of-type bot get-penetrate-info) this))) (logior (penetrate jak-yellow-shot jak-red-shot jak-blue-shot) v1-1) ) ) ;; definition for method 193 of type crocadog-escort -(defmethod bot-method-193 crocadog-escort ((obj crocadog-escort)) +(defmethod bot-method-193 crocadog-escort ((this crocadog-escort)) (let* ((t9-0 (method-of-type bot bot-method-193)) - (v0-0 (t9-0 obj)) + (v0-0 (t9-0 this)) ) - (if (and (not v0-0) (logtest? #x1c00000 (-> obj incoming penetrate-using))) + (if (and (not v0-0) (logtest? #x1c00000 (-> this incoming penetrate-using))) (set! v0-0 #t) ) v0-0 @@ -217,7 +217,7 @@ ) ;; definition for method 79 of type crocadog-escort -(defmethod enemy-method-79 crocadog-escort ((obj crocadog-escort) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 crocadog-escort ((this crocadog-escort) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (gp-0 symbol)) (case arg0 ((3) @@ -226,7 +226,7 @@ (if (>= (ja-aframe-num 0) 4.0) (set! f30-0 0.25) ) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) f30-0) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) @@ -234,7 +234,7 @@ ) ) (else - (set! gp-0 ((method-of-type bot enemy-method-79) obj arg0 arg1)) + (set! gp-0 ((method-of-type bot enemy-method-79) this arg0 arg1)) ) ) gp-0 @@ -242,23 +242,23 @@ ;; definition for method 234 of type crocadog-escort ;; INFO: Used lq/sq -(defmethod want-exit-vehicle? crocadog-escort ((obj crocadog-escort) (arg0 vector)) - (let ((s3-0 (handle->process (-> obj vehicle-handle)))) - (if (or (not s3-0) (not (-> obj nav))) +(defmethod want-exit-vehicle? crocadog-escort ((this crocadog-escort) (arg0 vector)) + (let ((s3-0 (handle->process (-> this vehicle-handle)))) + (if (or (not s3-0) (not (-> this nav))) (return #f) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (compute-seat-position (the-as vehicle s3-0) s4-0 (-> obj vehicle-seat-index)) + (compute-seat-position (the-as vehicle s3-0) s4-0 (-> this vehicle-seat-index)) (vector-! s4-0 s4-0 (-> (the-as vehicle s3-0) root trans)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 (+ 12288.0 (vector-length s4-0))) (vector+! s4-0 s4-0 (-> (the-as vehicle s3-0) root trans)) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (when (enemy-above-ground? obj s3-1 s4-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (when (enemy-above-ground? this s3-1 s4-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s4-0 y) (-> s3-1 best-other-tri intersect y)) (let ((s3-2 (new 'stack-no-clear 'vector))) - (do-navigation-to-destination (-> obj nav state) (-> obj root trans)) - (when (cloest-point-on-mesh (-> obj nav) s3-2 s4-0 (the-as nav-poly #f)) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) + (when (cloest-point-on-mesh (-> this nav) s3-2 s4-0 (the-as nav-poly #f)) (let ((f0-4 2048.0)) (when (>= (* f0-4 f0-4) (vector-vector-xz-distance-squared s3-2 s4-0)) (set! (-> arg0 quad) (-> s3-2 quad)) @@ -274,33 +274,33 @@ ) ;; definition for method 12 of type crocadog-escort -(defmethod run-logic? crocadog-escort ((obj crocadog-escort)) +(defmethod run-logic? crocadog-escort ((this crocadog-escort)) (or (not (logtest? (process-mask enemy) (-> *setting-control* user-current process-mask))) - (logtest? (-> obj bot-flags) (bot-flags bf09)) + (logtest? (-> this bot-flags) (bot-flags bf09)) ) ) ;; definition for method 97 of type crocadog-escort -(defmethod enemy-method-97 crocadog-escort ((obj crocadog-escort)) - (let* ((s4-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 crocadog-escort ((this crocadog-escort)) + (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) ) (when s5-0 - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 3)) + (when (time-elapsed? (-> this attacker-time) (seconds 3)) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) - (handle->process (-> obj kid-handle)) + (handle->process (-> this kid-handle)) (cond (s5-0 (empty) ) ((begin - (let ((s4-1 (handle->process (-> obj poi-handle)))) + (let ((s4-1 (handle->process (-> this poi-handle)))) (set! s5-0 (if (type? s4-1 process-focusable) s4-1 ) @@ -311,13 +311,13 @@ (empty) ) (else - (set! s5-0 (select-focus! obj)) + (set! s5-0 (select-focus! this)) (cond (s5-0 (empty) ) (else - (let ((s4-2 (handle->process (-> obj kid-handle)))) + (let ((s4-2 (handle->process (-> this kid-handle)))) (set! s5-0 (if (type? s4-2 process-focusable) s4-2 ) @@ -325,10 +325,10 @@ ) *target* (let ((f30-0 -1.0) - (f28-0 (vector-vector-distance (target-pos 0) (-> obj root trans))) + (f28-0 (vector-vector-distance (target-pos 0) (-> this root trans))) ) (if s5-0 - (set! f30-0 (vector-vector-distance (get-trans (the-as process-focusable s5-0) 0) (-> obj root trans))) + (set! f30-0 (vector-vector-distance (get-trans (the-as process-focusable s5-0) 0) (-> this root trans))) ) (if (and s5-0 (>= (* 2.0 f28-0) f30-0)) (empty) @@ -341,14 +341,14 @@ ) (cond (s5-0 - (try-update-focus (-> obj focus) (the-as process-focusable s5-0) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s5-0 type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s5-0) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s5-0 type) target)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s5-0 @@ -357,34 +357,34 @@ ;; definition for method 183 of type crocadog-escort ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? crocadog-escort ((obj crocadog-escort)) +(defmethod alive? crocadog-escort ((this crocadog-escort)) (let ((t9-0 (method-of-type bot alive?))) - (the-as symbol (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) - ) + (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) + ) ) ) ) ) ;; definition for method 11 of type crocadog-escort -(defmethod init-from-entity! crocadog-escort ((obj crocadog-escort) (arg0 entity-actor)) +(defmethod init-from-entity! crocadog-escort ((this crocadog-escort) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - ((method-of-type bot init-from-entity!) obj arg0) + (stack-size-set! (-> this main-thread) 512) + ((method-of-type bot init-from-entity!) this arg0) (none) ) ;; definition for method 114 of type crocadog-escort ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! crocadog-escort ((obj crocadog-escort)) +(defmethod init-enemy-collision! crocadog-escort ((this crocadog-escort)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -433,7 +433,7 @@ This commonly includes things such as: ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 1)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -441,38 +441,38 @@ This commonly includes things such as: ;; definition for method 210 of type crocadog-escort ;; WARN: Return type mismatch int vs none. -(defmethod init! crocadog-escort ((obj crocadog-escort)) +(defmethod init! crocadog-escort ((this crocadog-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj min-speed) 9011.2) - (set! (-> obj max-speed) 28672.0) - (set! (-> obj channel) (the-as uint 31)) - (set! (-> obj notice-enemy-dist) 24576.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 0.0) - (set-vector! (-> obj root scale) 1.2 1.2 1.2 1.0) - (set! (-> obj spot-color) (the-as uint #x5000ff00)) - (set! (-> obj kid-handle) (the-as handle #f)) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (set-vector! (-> obj local-seat-pos) 0.0 819.2 -1638.4 1.0) + (set! (-> this min-speed) 9011.2) + (set! (-> this max-speed) 28672.0) + (set! (-> this channel) (the-as uint 31)) + (set! (-> this notice-enemy-dist) 24576.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 0.0) + (set-vector! (-> this root scale) 1.2 1.2 1.2 1.0) + (set! (-> this spot-color) (the-as uint #x5000ff00)) + (set! (-> this kid-handle) (the-as handle #f)) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set-vector! (-> this local-seat-pos) 0.0 819.2 -1638.4 1.0) 0 (none) ) ;; definition for method 115 of type crocadog-escort ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! crocadog-escort ((obj crocadog-escort)) +(defmethod init-enemy! crocadog-escort ((this crocadog-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) + (init! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crocadog-escort" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *crocadog-escort-nav-enemy-info*) - (let ((v1-7 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *crocadog-escort-nav-enemy-info*) + (let ((v1-7 (-> this neck))) (set! (-> v1-7 up) (the-as uint 1)) (set! (-> v1-7 nose) (the-as uint 2)) (set! (-> v1-7 ear) (the-as uint 0)) @@ -480,57 +480,57 @@ This commonly includes things such as: (set! (-> v1-7 ignore-angle) 30947.555) ) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (let ((v1-10 (-> obj nav))) + (let ((v1-10 (-> this nav))) (set! (-> v1-10 sphere-mask) (the-as uint 126)) ) 0 - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) ;; definition for method 214 of type crocadog-escort -(defmethod bot-method-214 crocadog-escort ((obj crocadog-escort)) +(defmethod bot-method-214 crocadog-escort ((this crocadog-escort)) #f ) ;; definition for method 237 of type crocadog-escort ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod check-vehicle-exit crocadog-escort ((obj crocadog-escort)) +(defmethod check-vehicle-exit crocadog-escort ((this crocadog-escort)) (local-vars (v1-22 enemy-flag)) - (when (focus-test? obj pilot) - (let ((v1-4 (handle->process (-> obj vehicle-handle)))) + (when (focus-test? this pilot) + (let ((v1-4 (handle->process (-> this vehicle-handle)))) (when (or (not v1-4) (logtest? (-> (the-as vehicle v1-4) flags) (rigid-body-object-flag dead))) - (logior! (-> obj bot-flags) (bot-flags bf17)) - (logclear! (-> obj bot-flags) (bot-flags bf15)) - (logclear! (-> obj focus-status) (focus-status pilot-riding pilot)) - (set! (-> obj vehicle-seat-index) -1) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (logior! (-> obj root nav-flags) (nav-flags has-root-sphere)) - (let* ((s5-0 (-> obj root quat)) + (logior! (-> this bot-flags) (bot-flags bf17)) + (logclear! (-> this bot-flags) (bot-flags bf15)) + (logclear! (-> this focus-status) (focus-status pilot-riding pilot)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this vehicle-handle) (the-as handle #f)) + (logior! (-> this root nav-flags) (nav-flags has-root-sphere)) + (let* ((s5-0 (-> this root quat)) (f30-0 (quaternion-y-angle s5-0)) ) (quaternion-identity! s5-0) (quaternion-rotate-y! s5-0 s5-0 f30-0) ) - (let ((v1-21 (-> obj enemy-flags))) + (let ((v1-21 (-> this enemy-flags))) (if (logtest? v1-21 (enemy-flag checking-water)) (set! v1-22 (logior v1-21 (enemy-flag enable-on-active))) (set! v1-22 (logclear v1-21 (enemy-flag enable-on-active))) ) ) - (set! (-> obj enemy-flags) v1-22) - (let ((f30-2 (+ 16384.0 (quaternion-y-angle (-> obj root quat)))) + (set! (-> this enemy-flags) v1-22) + (let ((f30-2 (+ 16384.0 (quaternion-y-angle (-> this root quat)))) (s5-1 (new 'stack-no-clear 'vector)) ) (set-vector! s5-1 (sin f30-2) 0.0 (cos f30-2) 1.0) (vector-normalize! s5-1 65536.0) (send-event - obj + this 'attack #f (static-attack-info ((id (new-attack-id)) (vector s5-1) (attacker-velocity s5-1) (knock (the-as uint 8)))) @@ -544,99 +544,99 @@ This commonly includes things such as: ) ;; definition for method 70 of type crocadog-escort -(defmethod go-hostile crocadog-escort ((obj crocadog-escort)) +(defmethod go-hostile crocadog-escort ((this crocadog-escort)) (cond - ((logtest? (bot-flags bf17) (-> obj bot-flags)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (logior! (-> obj focus-status) (focus-status disable)) - (go (method-of-object obj knocked-off-vehicle)) + ((logtest? (bot-flags bf17) (-> this bot-flags)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag check-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (logior! (-> this focus-status) (focus-status disable)) + (go (method-of-object this knocked-off-vehicle)) ) (else - (react-to-focus obj) + (react-to-focus this) ) ) ) ;; definition for method 72 of type crocadog-escort ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus crocadog-escort ((obj crocadog-escort)) +(defmethod react-to-focus crocadog-escort ((this crocadog-escort)) "@TODO - flesh out docs" - (go-idle-or-move obj) + (go-idle-or-move this) ) ;; definition for method 236 of type crocadog-escort ;; WARN: Return type mismatch object vs none. -(defmethod go-waiting-turn crocadog-escort ((obj crocadog-escort)) - (go (method-of-object obj waiting-turn)) +(defmethod go-waiting-turn crocadog-escort ((this crocadog-escort)) + (go (method-of-object this waiting-turn)) (none) ) ;; definition for method 235 of type crocadog-escort ;; WARN: Return type mismatch object vs none. -(defmethod go-idle-or-move crocadog-escort ((obj crocadog-escort)) - (if (logtest? (-> obj bot-flags) (bot-flags bf15)) - (go (method-of-object obj move-to-vehicle)) - (go (method-of-object obj waiting-idle)) +(defmethod go-idle-or-move crocadog-escort ((this crocadog-escort)) + (if (logtest? (-> this bot-flags) (bot-flags bf15)) + (go (method-of-object this move-to-vehicle)) + (go (method-of-object this waiting-idle)) ) (none) ) ;; definition for method 238 of type crocadog-escort ;; WARN: Return type mismatch int vs none. -(defmethod play-walk-anim crocadog-escort ((obj crocadog-escort)) +(defmethod play-walk-anim crocadog-escort ((this crocadog-escort)) (with-pp - (let ((f30-0 (-> obj nav state speed))) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 9011.2 28672.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-7 (= v1-7 (-> obj draw art-group data 7))) - (let ((v1-12 (-> obj skel root-channel 1))) + ((and v1-7 (= v1-7 (-> this draw art-group data 7))) + (let ((v1-12 (-> this skel root-channel 1))) (set! (-> v1-12 frame-interp 1) f28-0) (set! (-> v1-12 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 28672.0 (* 0.15707962 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 7.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) - (a0-10 (-> obj skel root-channel 0)) + (a0-10 (-> this skel root-channel 0)) ) (set! (-> a0-10 param 0) f0-11) (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-11 (-> obj skel root-channel 1))) + (let ((a0-11 (-> this skel root-channel 1))) (set! (-> a0-11 param 0) 0.0) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 dist) 4206.592) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 7))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 7))) (set! (-> a0-13 param 0) 1.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 7)) num-func-loop!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 7)) num-func-loop!) ) - (let ((a0-14 (-> obj skel root-channel 1))) + (let ((a0-14 (-> this skel root-channel 1))) (set! (-> a0-14 frame-interp 1) f28-0) (set! (-> a0-14 frame-interp 0) f28-0) (set! (-> a0-14 dist) 13393.92) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 8))) (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 8)) num-func-chan) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 8)) num-func-chan) ) ) ) @@ -647,21 +647,21 @@ This commonly includes things such as: ) ;; definition for method 56 of type crocadog-escort -(defmethod damage-amount-from-attack crocadog-escort ((obj crocadog-escort) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack crocadog-escort ((this crocadog-escort) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) ;; definition for method 190 of type crocadog-escort -(defmethod bot-method-190 crocadog-escort ((obj crocadog-escort)) +(defmethod bot-method-190 crocadog-escort ((this crocadog-escort)) #t ) ;; definition for method 78 of type crocadog-escort -(defmethod enemy-method-78 crocadog-escort ((obj crocadog-escort) (arg0 (pointer float))) +(defmethod enemy-method-78 crocadog-escort ((this crocadog-escort) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -673,14 +673,15 @@ This commonly includes things such as: ) ;; definition for method 116 of type crocadog-escort -(defmethod go-idle crocadog-escort ((obj crocadog-escort)) +;; WARN: Return type mismatch object vs none. +(defmethod go-idle crocadog-escort ((this crocadog-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go-idle-or-move obj) + (go-idle-or-move this) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc index f2886ea781..4455e5c87d 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/hal4-course_REF.gc @@ -11,28 +11,28 @@ ) ;; definition for method 3 of type hal4-course -(defmethod inspect hal4-course ((obj hal4-course)) - (when (not obj) - (set! obj obj) +(defmethod inspect hal4-course ((this hal4-course)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcourse-id: ~D~%" (-> obj course-id)) - (format #t "~1Tspeech-count: ~D~%" (-> obj speech-count)) - (format #t "~1Tspot-count: ~D~%" (-> obj spot-count)) - (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) - (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> obj too-far-warn-speeches)) - (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> obj too-far-fail-speeches)) - (format #t "~1Tattack-player-speeches: ~A~%" (-> obj attack-player-speeches)) - (format #t "~1Tdefault-check-too-far: ~A~%" (-> obj default-check-too-far)) - (format #t "~1Twaypoints: ~A~%" (-> obj waypoints)) - (format #t "~1Tspeeches: #x~X~%" (-> obj speeches)) - (format #t "~1Tspeech-tunings: #x~X~%" (-> obj speech-tunings)) - (format #t "~1Tdirs: #x~X~%" (-> obj dirs)) - (format #t "~1Tspots: #x~X~%" (-> obj spots)) - (format #t "~1Tdefend-speeches: ~A~%" (-> obj defend-speeches)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse-id: ~D~%" (-> this course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> this speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> this spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> this too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> this too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> this attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> this default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> this waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> this speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> this speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> this dirs)) + (format #t "~1Tspots: #x~X~%" (-> this spots)) + (format #t "~1Tdefend-speeches: ~A~%" (-> this defend-speeches)) (label cfg-4) - obj + this ) ;; definition of type hal-escort @@ -66,37 +66,37 @@ ) ;; definition for method 3 of type hal-escort -(defmethod inspect hal-escort ((obj hal-escort)) - (when (not obj) - (set! obj obj) +(defmethod inspect hal-escort ((this hal-escort)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hal inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tvehicle-handle: ~D~%" (-> obj vehicle-handle)) - (format #t "~2Tarrow-handle: ~D~%" (-> obj arrow-handle)) - (format #t "~2Tarrestor-handle: ~D~%" (-> obj arrestor-handle)) - (format #t "~2Tarrestor-time: ~D~%" (-> obj arrestor-time)) - (format #t "~2Tlocked-player-time: ~D~%" (-> obj locked-player-time)) - (format #t "~2Tdont-fail-until: ~D~%" (-> obj dont-fail-until)) - (format #t "~2Tplayed-defend-time: ~D~%" (-> obj played-defend-time)) - (format #t "~2Tplayed-get-in-time: ~D~%" (-> obj played-get-in-time)) - (format #t "~2Tnotice-plane: #~%" (-> obj notice-plane)) + (format #t "~2Tvehicle-handle: ~D~%" (-> this vehicle-handle)) + (format #t "~2Tarrow-handle: ~D~%" (-> this arrow-handle)) + (format #t "~2Tarrestor-handle: ~D~%" (-> this arrestor-handle)) + (format #t "~2Tarrestor-time: ~D~%" (-> this arrestor-time)) + (format #t "~2Tlocked-player-time: ~D~%" (-> this locked-player-time)) + (format #t "~2Tdont-fail-until: ~D~%" (-> this dont-fail-until)) + (format #t "~2Tplayed-defend-time: ~D~%" (-> this played-defend-time)) + (format #t "~2Tplayed-get-in-time: ~D~%" (-> this played-get-in-time)) + (format #t "~2Tnotice-plane: #~%" (-> this notice-plane)) (label cfg-4) - obj + this ) ;; definition for method 116 of type hal-escort ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hal-escort ((obj hal-escort)) +(defmethod go-idle hal-escort ((this hal-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -104,63 +104,63 @@ ;; definition for method 210 of type hal-escort ;; WARN: Return type mismatch int vs none. -(defmethod init! hal-escort ((obj hal-escort)) +(defmethod init! hal-escort ((this hal-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type hal init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) - (set! (-> obj arrow-handle) (the-as handle #f)) - (set! (-> obj too-far-warn-dist-default) 61440.0) - (set! (-> obj too-far-fail-dist-delta-default) 2048000.0) - (set! (-> obj warn-to-fail-timeout) (the-as uint #x1b7740)) - (set! (-> obj warn-min-delay) (the-as uint 1200)) - (set! (-> obj warn-max-delay) (the-as uint 2100)) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set! (-> this arrestor-handle) (the-as handle #f)) + (set! (-> this arrow-handle) (the-as handle #f)) + (set! (-> this too-far-warn-dist-default) 61440.0) + (set! (-> this too-far-fail-dist-delta-default) 2048000.0) + (set! (-> this warn-to-fail-timeout) (the-as uint #x1b7740)) + (set! (-> this warn-min-delay) (the-as uint 1200)) + (set! (-> this warn-max-delay) (the-as uint 2100)) 0 (none) ) ;; definition for method 74 of type hal-escort -(defmethod general-event-handler hal-escort ((obj hal-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler hal-escort ((this hal-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('notify) (case (-> arg3 param 0) (('arrest) - (set! (-> obj arrestor-handle) (process->handle (the-as process (-> arg3 param 1)))) + (set! (-> this arrestor-handle) (process->handle (the-as process (-> arg3 param 1)))) (let ((v0-0 (the-as object (current-time)))) - (set! (-> obj arrestor-time) (the-as time-frame v0-0)) + (set! (-> this arrestor-time) (the-as time-frame v0-0)) v0-0 ) ) (else - ((method-of-type hal general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hal general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type hal general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hal general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 115 of type hal-escort ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! hal-escort ((obj hal-escort)) +(defmethod init-enemy! hal-escort ((this hal-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type hal init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj channel) (the-as uint 20)) + (set! (-> this channel) (the-as uint 20)) 0 (none) ) ;; definition for method 235 of type hal-escort -(defmethod hal-escort-method-235 hal-escort ((obj hal-escort)) - (let* ((s5-0 (handle->process (-> obj arrestor-handle))) +(defmethod hal-escort-method-235 hal-escort ((this hal-escort)) + (let* ((s5-0 (handle->process (-> this arrestor-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 ) @@ -168,54 +168,52 @@ ) (when v1-3 (cond - ((>= (- (current-time) (-> obj arrestor-time)) (seconds 4)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + ((time-elapsed? (-> this arrestor-time) (seconds 4)) + (set! (-> this arrestor-handle) (the-as handle #f)) ) ((focus-test? (the-as process-focusable v1-3) hit) - (when (and (>= (- (current-time) (-> obj played-defend-time)) (seconds 6)) - (not (channel-active? obj (the-as uint 0))) - ) + (when (and (time-elapsed? (-> this played-defend-time) (seconds 6)) (not (channel-active? this (the-as uint 0)))) (let ((a1-5 (bot-speech-list-method-9 - (-> obj hal4-course defend-speeches) - obj - (-> obj hal4-course speeches) + (-> this hal4-course defend-speeches) + this + (-> this hal4-course speeches) (speech-flags) ) ) ) (when (>= a1-5 0) - (play-speech obj a1-5) - (set! (-> obj played-defend-time) (current-time)) + (play-speech this a1-5) + (set-time! (-> this played-defend-time)) ) ) ) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this arrestor-handle) (the-as handle #f)) ) ) ) ) - (if (and (not (speech-playing? obj 30)) - (nonzero? (-> obj played-defend-time)) - (>= (- (current-time) (-> obj played-defend-time)) (seconds 3)) - (not (channel-active? obj (the-as uint 0))) + (if (and (not (speech-playing? this 30)) + (nonzero? (-> this played-defend-time)) + (time-elapsed? (-> this played-defend-time) (seconds 3)) + (not (channel-active? this (the-as uint 0))) ) - (play-speech obj 30) + (play-speech this 30) ) (none) ) ;; definition for method 236 of type hal-escort -(defmethod vehicle-destroyed? hal-escort ((obj hal-escort)) - (let ((v1-1 (handle->process (-> obj vehicle-handle)))) +(defmethod vehicle-destroyed? hal-escort ((this hal-escort)) + (let ((v1-1 (handle->process (-> this vehicle-handle)))) (or (not v1-1) (logtest? (-> (the-as vehicle v1-1) flags) (rigid-body-object-flag dead))) ) ) ;; definition for method 227 of type hal-escort -(defmethod hal-escort-method-227 hal-escort ((obj hal-escort)) +(defmethod hal-escort-method-227 hal-escort ((this hal-escort)) (let ((s5-0 *target*)) (when (focus-test? s5-0 pilot-riding pilot) - (let* ((a0-2 (-> obj actor-group 0 data 1 actor)) + (let* ((a0-2 (-> this actor-group 0 data 1 actor)) (v1-5 (when a0-2 (let ((s4-0 (-> a0-2 extra process))) (if (type? s4-0 process-focusable) @@ -226,7 +224,7 @@ ) ) (when (focus-test? (the-as process-focusable v1-5) pilot-riding pilot) - (let* ((v1-12 (-> obj actor-group 0 data 2 actor)) + (let* ((v1-12 (-> this actor-group 0 data 2 actor)) (a0-5 (when v1-12 (let ((s4-1 (-> v1-12 extra process))) (if (type? s4-1 process-focusable) @@ -241,7 +239,7 @@ (and (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-5) 0) (get-trans s5-0 0)) ) - (>= (current-time) (-> obj dont-fail-until)) + (>= (current-time) (-> this dont-fail-until)) ) ) ) @@ -254,8 +252,8 @@ ;; definition for method 228 of type hal-escort ;; WARN: Return type mismatch object vs symbol. -(defmethod hal-escort-method-228 hal-escort ((obj hal-escort)) - (let* ((v1-3 (-> obj actor-group 0 data 1 actor)) +(defmethod hal-escort-method-228 hal-escort ((this hal-escort)) + (let* ((v1-3 (-> this actor-group 0 data 1 actor)) (a0-1 (when v1-3 (let ((s5-0 (-> v1-3 extra process))) (if (type? s5-0 process-focusable) @@ -274,7 +272,7 @@ (and (< (* f0-0 f0-0) (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-1) 0) (get-trans s5-1 0)) ) - (>= (current-time) (-> obj dont-fail-until)) + (>= (current-time) (-> this dont-fail-until)) ) ) ) @@ -285,9 +283,9 @@ ;; definition for method 234 of type hal-escort ;; INFO: Used lq/sq -(defmethod hal-escort-method-234 hal-escort ((obj hal-escort) (arg0 nav-mesh)) +(defmethod hal-escort-method-234 hal-escort ((this hal-escort) (arg0 nav-mesh)) (let ((s2-0 (the-as process #f))) - (let* ((v1-3 (-> obj actor-group 0 data 1 actor)) + (let* ((v1-3 (-> this actor-group 0 data 1 actor)) (gp-0 (when v1-3 (let ((s5-0 (-> v1-3 extra process))) (if (type? s5-0 process-focusable) @@ -324,7 +322,7 @@ (set! (-> s2-2 nav-mesh) arg0) (set! (-> s2-2 nav-branch) #f) (set! (-> s2-2 proc) #f) - (let ((v1-25 (-> obj actor-group 0 data 1 actor))) + (let ((v1-25 (-> this actor-group 0 data 1 actor))) (set! (-> s2-2 handle) (process->handle (when v1-25 (let ((s4-1 (-> v1-25 extra process))) (if (type? s4-1 process-focusable) @@ -354,10 +352,10 @@ ) ;; definition for method 229 of type hal-escort -(defmethod try-enter-vehicle hal-escort ((obj hal-escort)) +(defmethod try-enter-vehicle hal-escort ((this hal-escort)) "Returns seat index" - (let* ((gp-0 (handle->process (-> obj vehicle-handle))) - (v1-6 (-> obj actor-group 0 data 1 actor)) + (let* ((gp-0 (handle->process (-> this vehicle-handle))) + (v1-6 (-> this actor-group 0 data 1 actor)) (s5-0 (when v1-6 (let ((s4-0 (-> v1-6 extra process))) (if (type? s4-0 process-focusable) @@ -387,9 +385,9 @@ ;; definition for method 232 of type hal-escort ;; WARN: Return type mismatch int vs none. -(defmethod hal-escort-method-232 hal-escort ((obj hal-escort)) +(defmethod hal-escort-method-232 hal-escort ((this hal-escort)) (let* ((target *target*) - (v1-3 (-> obj actor-group 0 data 1 actor)) + (v1-3 (-> this actor-group 0 data 1 actor)) (s5-0 (when v1-3 (let ((s3-0 (-> v1-3 extra process))) (if (type? s3-0 process-focusable) @@ -398,7 +396,7 @@ ) ) ) - (a0-2 (-> obj actor-group 0 data 2 actor)) + (a0-2 (-> this actor-group 0 data 2 actor)) (v1-8 (when a0-2 (let ((s3-1 (-> a0-2 extra process))) (if (type? s3-1 process-focusable) @@ -415,7 +413,7 @@ v1-8 (not (focus-test? (the-as process-focusable s5-0) pilot-riding)) (not (focus-test? (the-as process-focusable v1-8) pilot-riding)) - (>= (- (current-time) (-> obj locked-player-time)) (seconds 10)) + (time-elapsed? (-> this locked-player-time) (seconds 10)) ) (remove-setting! 'pilot-exit) (set-setting! 'pilot #f 0.0 0) @@ -424,7 +422,7 @@ ) ((focus-test? target pilot-riding) (when (and (nonzero? (-> target pilot)) - (and (= (handle->process (-> target pilot vehicle)) (handle->process (-> obj vehicle-handle))) + (and (= (handle->process (-> target pilot vehicle)) (handle->process (-> this vehicle-handle))) (or (and s5-0 (focus-test? (the-as process-focusable s5-0) pilot)) (and v1-8 (focus-test? (the-as process-focusable v1-8) pilot)) ) @@ -432,7 +430,7 @@ ) (set-setting! 'pilot-exit #f 0.0 0) (apply-settings *setting-control*) - (set! (-> obj locked-player-time) (current-time)) + (set-time! (-> this locked-player-time)) ) ) ) @@ -445,7 +443,7 @@ ;; definition for method 231 of type hal-escort ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-traffic-params! hal-escort ((obj hal-escort) (arg0 symbol)) +(defmethod init-traffic-params! hal-escort ((this hal-escort) (arg0 symbol)) (let ((gp-0 *traffic-manager*)) (send-event gp-0 'deactivate-all) (send-event gp-0 'set-guard-multi-focus #t) @@ -459,7 +457,7 @@ (when arg0 (send-event gp-0 'set-guard-force-visible #t) (let ((s4-1 (new 'stack 'traffic-object-spawn-params))) - (let ((v1-51 (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 0))) + (let ((v1-51 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))) (set! (-> s4-1 object-type) (traffic-type crimson-guard-1)) (set! (-> s4-1 behavior) (the-as uint 3)) (set! (-> s4-1 id) (the-as uint 0)) @@ -472,7 +470,7 @@ (set! (-> s4-1 flags) (traffic-spawn-flags)) (set! (-> s4-1 guard-type) (the-as uint 7)) (vector-reset! (-> s4-1 velocity)) - (set! (-> s4-1 position quad) (-> obj hal4-course spots 5 center quad)) + (set! (-> s4-1 position quad) (-> this hal4-course spots 5 center quad)) (quaternion-identity! (-> s4-1 rotation)) (send-event gp-0 'activate-object s4-1) ) @@ -484,7 +482,7 @@ ;; definition for method 233 of type hal-escort ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-traffic-danger! hal-escort ((obj hal-escort)) +(defmethod set-traffic-danger! hal-escort ((this hal-escort)) (let ((a0-1 *target*)) (when a0-1 (let ((gp-0 (new 'stack-no-clear 'traffic-danger-info))) @@ -506,7 +504,7 @@ ;; definition for method 230 of type hal-escort ;; INFO: Used lq/sq -(defmethod hal-escort-method-230 hal-escort ((obj hal-escort)) +(defmethod hal-escort-method-230 hal-escort ((this hal-escort)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) @@ -515,7 +513,7 @@ (let ((gp-0 (new 'stack-no-clear 'matrix)) (s5-0 528) ) - (let ((v1-2 (-> obj hal4-course spots 9))) + (let ((v1-2 (-> this hal4-course spots 9))) (set! (-> gp-0 vector 1 quad) (-> v1-2 center quad)) (set! (-> gp-0 vector 1 w) (+ 81920.0 (-> v1-2 center w))) ) @@ -635,10 +633,10 @@ ) ;; definition for method 204 of type hal-escort -(defmethod play-too-far-warn-speech hal-escort ((obj hal-escort)) - (when (not (channel-active? obj (the-as uint 0))) +(defmethod play-too-far-warn-speech hal-escort ((this hal-escort)) + (when (not (channel-active? this (the-as uint 0))) (let ((s5-0 0)) - (let* ((v1-5 (-> obj actor-group 0 data 1 actor)) + (let* ((v1-5 (-> this actor-group 0 data 1 actor)) (s4-0 (when v1-5 (let ((s3-0 (-> v1-5 extra process))) (if (type? s3-0 process-focusable) @@ -648,7 +646,7 @@ ) ) ) - (let* ((a0-3 (-> obj actor-group 0 data 2 actor)) + (let* ((a0-3 (-> this actor-group 0 data 2 actor)) (v1-10 (when a0-3 (let ((s3-1 (-> a0-3 extra process))) (if (type? s3-1 process-focusable) @@ -665,7 +663,7 @@ ) ) (let ((s3-2 #f)) - (when (and (>= (-> obj waypoint waypoint-id) 19) *target*) + (when (and (>= (-> this waypoint waypoint-id) 19) *target*) (let* ((f30-0 (-> (get-trans (the-as process-focusable s4-0) 1) y)) (f0-1 (- (-> (get-trans *target* 1) y) f30-0)) ) @@ -685,7 +683,7 @@ (let ((s3-3 (new 'stack-no-clear 'vector))) (vector-! s3-3 (target-pos 0) (-> (the-as process-focusable s4-0) root trans)) (vector-normalize! s3-3 1.0) - (if (>= (vector-dot s3-3 (-> obj follow-dir)) 0.0) + (if (>= (vector-dot s3-3 (-> this follow-dir)) 0.0) (set! s5-0 (logior s5-0 8)) (set! s5-0 (logior s5-0 16)) ) @@ -694,15 +692,15 @@ ) ) (let ((a1-7 (bot-speech-list-method-9 - (-> obj hal4-course too-far-warn-speeches) - obj - (-> obj hal4-course speeches) + (-> this hal4-course too-far-warn-speeches) + this + (-> this hal4-course speeches) (the-as speech-flags s5-0) ) ) ) (when (>= a1-7 0) - (play-speech obj a1-7) + (play-speech this a1-7) #t ) ) @@ -1015,7 +1013,7 @@ (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-escort)) (if (and (not (speech-playing? arg1 3)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1)) (not (channel-active? arg1 (the-as uint 0))) ) (play-speech arg1 3) @@ -1266,7 +1264,7 @@ ) (if (and (not (speech-playing? arg1 14)) (not (-> *setting-control* user-current pilot-exit)) - (>= (- (current-time) (-> arg1 locked-player-time)) (seconds 1.5)) + (time-elapsed? (-> arg1 locked-player-time) (seconds 1.5)) ) (play-speech arg1 14) ) @@ -1368,7 +1366,7 @@ ) (when (and (zero? (-> arg0 locked-player-time)) (or (not (speech-playing? arg0 33)) (not (speech-playing? arg0 34))) - (>= (- (current-time) (-> arg0 played-get-in-time)) (seconds 6)) + (time-elapsed? (-> arg0 played-get-in-time) (seconds 6)) (not (channel-active? arg0 (the-as uint 0))) ) (let ((a0-18 (handle->process (-> arg0 vehicle-handle)))) @@ -1380,7 +1378,7 @@ 33 ) ) - (set! (-> arg0 played-get-in-time) (current-time)) + (set-time! (-> arg0 played-get-in-time)) ) ) ) @@ -1401,44 +1399,42 @@ (set! (-> v1-1 bytes 6) 7) (set! (-> v1-1 bytes 4) 0) (set! (-> (the-as halt-wait-spot v1-1) check-done) - (the-as - (function halt-wait-spot hal symbol) - (lambda ((arg0 object) (arg1 hal-escort)) - (if (!= (level-status *level* 'ctyinda) 'active) - (set! (-> arg1 waypoint-time0) (current-time)) + (the-as (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-escort)) + (if (!= (level-status *level* 'ctyinda) 'active) + (set-time! (-> arg1 waypoint-time0)) + ) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.25)) + (let* ((v1-11 (-> arg1 actor-group 0 data 2 actor)) + (s5-1 (when v1-11 + (let ((s4-0 (-> v1-11 extra process))) + (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + ) + (v1-16 (-> arg1 actor-group 0 data 1 actor)) + (s4-1 (when v1-16 + (let ((s3-0 (-> v1-16 extra process))) + (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + ) + ) + (send-event s5-1 'hide #f) + (send-event s4-1 'hide #f) + (send-event s5-1 'skip) + (send-event s4-1 'skip) + ) + (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) + (go-to-waypoint! arg1 19 #f) + (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) + #t + ) + ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.25)) - (let* ((v1-11 (-> arg1 actor-group 0 data 2 actor)) - (s5-1 (when v1-11 - (let ((s4-0 (-> v1-11 extra process))) - (if (type? s4-0 process-focusable) - s4-0 - ) - ) - ) - ) - (v1-16 (-> arg1 actor-group 0 data 1 actor)) - (s4-1 (when v1-16 - (let ((s3-0 (-> v1-16 extra process))) - (if (type? s3-0 process-focusable) - s3-0 - ) - ) - ) - ) - ) - (send-event s5-1 'hide #f) - (send-event s4-1 'hide #f) - (send-event s5-1 'skip) - (send-event s4-1 'skip) - ) - (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) - (go-to-waypoint! arg1 19 #f) - (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) - #t - ) - ) - ) ) ) (none) @@ -1502,7 +1498,7 @@ (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-escort)) (when (and (not (speech-playing? arg1 4)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (not (channel-active? arg1 (the-as uint 0))) ) (play-speech arg1 15) @@ -1740,7 +1736,7 @@ ) ) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.75)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.75)) ) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let ((s5-0 *traffic-manager*)) @@ -1751,7 +1747,7 @@ ) ) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.2)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.2)) ) (let* ((v1-55 (-> arg1 actor-group 0 data 2 actor)) (s5-1 (when v1-55 @@ -1779,7 +1775,7 @@ (send-event s5-1 'request 'waypoint 26) ) ) - (when (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (not (channel-active? arg1 (the-as uint 0))) (scene-play arg1 "dig-knock-down-scaffolding-intro" #t) ) @@ -1881,7 +1877,7 @@ (function halt-wait-spot hal symbol) (lambda ((arg0 object) (arg1 hal-escort)) (with-pp - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-h_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-h_REF.gc index 6788f10de7..e24409f97e 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-h_REF.gc @@ -33,21 +33,21 @@ ) ;; definition for method 3 of type kid-escort -(defmethod inspect kid-escort ((obj kid-escort)) - (when (not obj) - (set! obj obj) +(defmethod inspect kid-escort ((this kid-escort)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttravel-anim-interp: ~f~%" (-> obj travel-anim-interp)) - (format #t "~2Tarrest-attempt-time: ~D~%" (-> obj arrest-attempt-time)) - (format #t "~2Tarrestor-handle: ~D~%" (-> obj arrestor-handle)) - (format #t "~2Tcrocadog-handle: ~D~%" (-> obj crocadog-handle)) - (format #t "~2Texit-vehicle-dest: ~`vector`P~%" (-> obj exit-vehicle-dest)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> this travel-anim-interp)) + (format #t "~2Tarrest-attempt-time: ~D~%" (-> this arrest-attempt-time)) + (format #t "~2Tarrestor-handle: ~D~%" (-> this arrestor-handle)) + (format #t "~2Tcrocadog-handle: ~D~%" (-> this crocadog-handle)) + (format #t "~2Texit-vehicle-dest: ~`vector`P~%" (-> this exit-vehicle-dest)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -71,23 +71,23 @@ ) ;; definition for method 3 of type kidesct-wait-spot -(defmethod inspect kidesct-wait-spot ((obj kidesct-wait-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect kidesct-wait-spot ((this kidesct-wait-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> obj spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> this spot-indexes)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-states_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-states_REF.gc index 5d74cfe679..b29a651632 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-states_REF.gc @@ -6,7 +6,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -82,7 +82,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -133,7 +133,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -165,10 +165,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (check-arrest self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -200,7 +200,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -236,10 +236,10 @@ (logclear! (-> self bot-flags) (bot-flags bf15)) (check-arrest self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -294,7 +294,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -443,7 +443,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -526,7 +526,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -681,7 +681,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -705,7 +705,7 @@ ) (go-virtual arrested) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (if (logtest? (-> self bot-flags) (bot-flags bf15)) (go-virtual move-to-vehicle) (go-virtual traveling) @@ -742,7 +742,7 @@ (go-virtual arrested) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (when (not (nav-enemy-method-163 self)) (if (logtest? (-> self bot-flags) (bot-flags bf15)) (go-virtual move-to-vehicle) @@ -813,7 +813,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -891,7 +891,7 @@ (when (not (logtest? (bot-flags bf19) (-> self bot-flags))) (until #f (until (ja-done? 0) - (if (>= (- (current-time) (-> self state-time)) (seconds 2.5)) + (if (time-elapsed? (-> self state-time) (seconds 2.5)) (goto cfg-27) ) (suspend) @@ -913,11 +913,11 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) @@ -956,7 +956,7 @@ (until #f (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) @@ -991,7 +991,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-task_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-task_REF.gc index 2f0f533f49..315a7006a1 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc-task_REF.gc @@ -3,47 +3,43 @@ ;; definition for method 9 of type kidesct-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! kidesct-wait-spot ((obj kidesct-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! kidesct-wait-spot ((this kidesct-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type kidesct-wait-spot ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kidesct-wait-spot ((obj kidesct-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 kidesct-wait-spot ((this kidesct-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as kid-escort arg0)) + ((-> this check-done) this (the-as kid-escort arg0)) (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc4-course_REF.gc index bd3160180e..ac8a384ddf 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc4-course_REF.gc @@ -361,7 +361,7 @@ (the-as (function kidesct-wait-spot kid-escort symbol) (lambda ((arg0 object) (arg1 kid-escort)) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (let ((v1-4 (-> arg1 spot))) (set! (-> v1-4 center quad) (-> arg1 root trans quad)) (set! (-> v1-4 center w) 20480.0) diff --git a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc index ce6aa6d266..d6e0af6ce1 100644 --- a/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiddogescort/kidesc_REF.gc @@ -177,78 +177,75 @@ (set! (-> *kid-escort-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type kid-escort -(defmethod general-event-handler kid-escort ((obj kid-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler kid-escort ((this kid-escort) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('arrest) - (let* ((s4-0 (handle->process (-> obj arrestor-handle))) + (let* ((s4-0 (handle->process (-> this arrestor-handle))) (v1-4 (if (type? s4-0 process-focusable) s4-0 ) ) ) - (when (or (not v1-4) - (= v1-4 arg0) - (and (!= v1-4 arg0) (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.1))) - ) - (set! (-> obj arrestor-handle) (process->handle arg0)) - (set! (-> obj arrest-attempt-time) (current-time)) + (when (or (not v1-4) (= v1-4 arg0) (and (!= v1-4 arg0) (time-elapsed? (-> this arrest-attempt-time) (seconds 0.1)))) + (set! (-> this arrestor-handle) (process->handle arg0)) + (set-time! (-> this arrest-attempt-time)) (if (!= v1-4 arg0) - (send-event (handle->process (-> obj master-handle)) 'notify 'arrest arg0) + (send-event (handle->process (-> this master-handle)) 'notify 'arrest arg0) ) ) ) #t ) (('instant-arrest) - (logior! (-> obj bot-flags) (bot-flags bf19)) + (logior! (-> this bot-flags) (bot-flags bf19)) (let ((s5-1 (the-as crimson-guard (-> arg3 param 0)))) - (set! (-> obj arrestor-handle) (process->handle s5-1)) - (set! (-> obj arrest-attempt-time) (current-time)) + (set! (-> this arrestor-handle) (process->handle s5-1)) + (set-time! (-> this arrest-attempt-time)) (let ((a1-11 (new 'stack-no-clear 'vector))) - (vector-! a1-11 (-> s5-1 root trans) (-> obj root trans)) + (vector-! a1-11 (-> s5-1 root trans) (-> this root trans)) (set! (-> a1-11 y) 0.0) - (forward-up->quaternion (-> obj root quat) a1-11 *up-vector*) + (forward-up->quaternion (-> this root quat) a1-11 *up-vector*) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (send-event (handle->process (-> obj master-handle)) 'notify 'arrest s5-1) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (send-event (handle->process (-> this master-handle)) 'notify 'arrest s5-1) ) - (go (method-of-object obj arrested)) + (go (method-of-object this arrested)) ) (('attack) - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) #f ) (('nav-mesh-kill) - (change-to *default-nav-mesh* obj) + (change-to *default-nav-mesh* this) #t ) (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 12 of type kid-escort -(defmethod run-logic? kid-escort ((obj kid-escort)) +(defmethod run-logic? kid-escort ((this kid-escort)) (or (not (logtest? (process-mask enemy) (-> *setting-control* user-current process-mask))) - (logtest? (-> obj bot-flags) (bot-flags bf09)) + (logtest? (-> this bot-flags) (bot-flags bf09)) ) ) ;; definition for method 97 of type kid-escort -(defmethod enemy-method-97 kid-escort ((obj kid-escort)) - (let* ((s4-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 kid-escort ((this kid-escort)) + (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) - (s3-0 (handle->process (-> obj arrestor-handle))) + (s3-0 (handle->process (-> this arrestor-handle))) (s4-1 (if (type? s3-0 process-focusable) s3-0 ) @@ -257,33 +254,33 @@ (when s5-0 (cond ((= (-> s5-0 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 1.5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 6)) + (when (time-elapsed? (-> this attacker-time) (seconds 6)) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) (when s4-1 - (when (or (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.5)) + (when (or (time-elapsed? (-> this arrest-attempt-time) (seconds 0.5)) (focus-test? (the-as process-focusable s4-1) dead hit) ) (set! s4-1 (the-as process #f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this arrestor-handle) (the-as handle #f)) ) ) - (let ((v1-34 (-> obj focus-mode)) + (let ((v1-34 (-> this focus-mode)) (s3-1 (the-as process #f)) ) (cond @@ -295,11 +292,11 @@ (s5-0 (set! s3-1 s5-0) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else - (let ((s5-1 (handle->process (-> obj poi-handle)))) + (let ((s5-1 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-1 process-focusable) s5-1 ) @@ -321,7 +318,7 @@ (set! s3-1 s5-0) ) (else - (let ((s5-2 (handle->process (-> obj poi-handle)))) + (let ((s5-2 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-2 process-focusable) s5-2 ) @@ -331,7 +328,7 @@ (s3-1 (empty) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else @@ -344,14 +341,14 @@ ) (cond (s3-1 - (try-update-focus (-> obj focus) (the-as process-focusable s3-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s3-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s3-1 @@ -361,34 +358,34 @@ ;; definition for method 183 of type kid-escort ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? kid-escort ((obj kid-escort)) +(defmethod alive? kid-escort ((this kid-escort)) (let ((t9-0 (method-of-type bot alive?))) - (the-as symbol (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) - ) + (the-as symbol (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'waiting-idle) (= v1-3 'waiting-turn)) + ) ) ) ) ) ;; definition for method 11 of type kid-escort -(defmethod init-from-entity! kid-escort ((obj kid-escort) (arg0 entity-actor)) +(defmethod init-from-entity! kid-escort ((this kid-escort) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - ((method-of-type bot init-from-entity!) obj arg0) + (stack-size-set! (-> this main-thread) 512) + ((method-of-type bot init-from-entity!) this arg0) (none) ) ;; definition for method 114 of type kid-escort ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! kid-escort ((obj kid-escort)) +(defmethod init-enemy-collision! kid-escort ((this kid-escort)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -453,7 +450,7 @@ This commonly includes things such as: ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -461,37 +458,37 @@ This commonly includes things such as: ;; definition for method 210 of type kid-escort ;; WARN: Return type mismatch int vs none. -(defmethod init! kid-escort ((obj kid-escort)) +(defmethod init! kid-escort ((this kid-escort)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj min-speed) 18022.4) - (set! (-> obj max-speed) 18432.0) - (set! (-> obj channel) (the-as uint 26)) - (set! (-> obj notice-enemy-dist) 122880.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 0.0) - (set-vector! (-> obj root scale) 1.2 1.2 1.2 1.0) - (set! (-> obj spot-color) (the-as uint #x60004f8f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) - (set! (-> obj crocadog-handle) (the-as handle #f)) + (set! (-> this min-speed) 18022.4) + (set! (-> this max-speed) 18432.0) + (set! (-> this channel) (the-as uint 26)) + (set! (-> this notice-enemy-dist) 122880.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 0.0) + (set-vector! (-> this root scale) 1.2 1.2 1.2 1.0) + (set! (-> this spot-color) (the-as uint #x60004f8f)) + (set! (-> this arrestor-handle) (the-as handle #f)) + (set! (-> this crocadog-handle) (the-as handle #f)) 0 (none) ) ;; definition for method 115 of type kid-escort ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! kid-escort ((obj kid-escort)) +(defmethod init-enemy! kid-escort ((this kid-escort)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) + (init! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-kid-escort" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *kid-escort-nav-enemy-info*) - (let ((v1-7 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *kid-escort-nav-enemy-info*) + (let ((v1-7 (-> this neck))) (set! (-> v1-7 up) (the-as uint 1)) (set! (-> v1-7 nose) (the-as uint 2)) (set! (-> v1-7 ear) (the-as uint 0)) @@ -499,52 +496,52 @@ This commonly includes things such as: (set! (-> v1-7 ignore-angle) 30947.555) ) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (let ((v1-10 (-> obj nav))) + (let ((v1-10 (-> this nav))) (set! (-> v1-10 sphere-mask) (the-as uint 126)) ) 0 - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) ;; definition for method 214 of type kid-escort -(defmethod bot-method-214 kid-escort ((obj kid-escort)) +(defmethod bot-method-214 kid-escort ((this kid-escort)) #f ) ;; definition for method 72 of type kid-escort ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kid-escort ((obj kid-escort)) +(defmethod react-to-focus kid-escort ((this kid-escort)) "@TODO - flesh out docs" - (check-arrest obj) + (check-arrest this) ) ;; definition for method 237 of type kid-escort ;; WARN: Return type mismatch object vs none. -(defmethod go-waiting-turn kid-escort ((obj kid-escort)) - (go (method-of-object obj waiting-turn)) +(defmethod go-waiting-turn kid-escort ((this kid-escort)) + (go (method-of-object this waiting-turn)) (none) ) ;; definition for method 236 of type kid-escort ;; WARN: Return type mismatch object vs none. -(defmethod check-arrest kid-escort ((obj kid-escort)) - (let ((s5-0 (handle->process (-> obj arrestor-handle)))) +(defmethod check-arrest kid-escort ((this kid-escort)) + (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) s5-0 ) - (go (method-of-object obj arrested)) + (go (method-of-object this arrested)) ) - ((logtest? (-> obj bot-flags) (bot-flags bf15)) - (go (method-of-object obj move-to-vehicle)) + ((logtest? (-> this bot-flags) (bot-flags bf15)) + (go (method-of-object this move-to-vehicle)) ) (else - (go (method-of-object obj waiting-idle)) + (go (method-of-object this waiting-idle)) ) ) ) @@ -553,22 +550,22 @@ This commonly includes things such as: ;; definition for method 239 of type kid-escort ;; WARN: Return type mismatch int vs none. -(defmethod play-walk-anim kid-escort ((obj kid-escort)) +(defmethod play-walk-anim kid-escort ((this kid-escort)) (with-pp - (let ((f30-0 (-> obj nav state speed)) - (v1-5 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f30-0 (-> this nav state speed)) + (v1-5 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-5 (= v1-5 (-> obj draw art-group data 4))) - (let* ((f28-0 (current-cycle-distance (-> obj skel))) - (f0-1 (quaternion-y-angle (-> obj root quat))) - (f1-0 (deg- f0-1 (-> obj travel-prev-ry))) + ((and v1-5 (= v1-5 (-> this draw art-group data 4))) + (let* ((f28-0 (current-cycle-distance (-> this skel))) + (f0-1 (quaternion-y-angle (-> this root quat))) + (f1-0 (deg- f0-1 (-> this travel-prev-ry))) (f0-4 (fmin 18432.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-0)))) (f0-7 (/ (* 8.0 (fmax f30-0 f0-4)) (* 15.0 f28-0))) - (a0-8 (-> obj skel root-channel 0)) + (a0-8 (-> this skel root-channel 0)) ) (set! (-> a0-8 param 0) f0-7) (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) @@ -576,11 +573,11 @@ This commonly includes things such as: ) (else (ja-channel-push! 1 (seconds 0.15)) - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 dist) 6553.6) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-10 param 0) 1.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-loop!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-loop!) ) ) ) @@ -590,21 +587,21 @@ This commonly includes things such as: ) ;; definition for method 56 of type kid-escort -(defmethod damage-amount-from-attack kid-escort ((obj kid-escort) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack kid-escort ((this kid-escort) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) ;; definition for method 190 of type kid-escort -(defmethod bot-method-190 kid-escort ((obj kid-escort)) +(defmethod bot-method-190 kid-escort ((this kid-escort)) #t ) ;; definition for method 78 of type kid-escort -(defmethod enemy-method-78 kid-escort ((obj kid-escort) (arg0 (pointer float))) +(defmethod enemy-method-78 kid-escort ((this kid-escort) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -617,39 +614,39 @@ This commonly includes things such as: ;; definition for method 198 of type kid-escort ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kid-escort ((obj kid-escort) (arg0 vector)) +(defmethod set-cam-height! kid-escort ((this kid-escort) (arg0 vector)) (the-as meters (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'arrested)) + ((and (-> this next-state) (= (-> this next-state name) 'arrested)) (set-vector! arg0 49152.0 12288.0 49152.0 1.0) - (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) - (if (focus-test? obj under-water) - (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) ) ) (else - ((method-of-type bot set-cam-height!) obj arg0) + ((method-of-type bot set-cam-height!) this arg0) ) ) ) ) ;; definition for method 59 of type kid-escort -(defmethod get-penetrate-info kid-escort ((obj kid-escort)) +(defmethod get-penetrate-info kid-escort ((this kid-escort)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" - (let ((v1-1 ((method-of-type bot get-penetrate-info) obj))) + (let ((v1-1 ((method-of-type bot get-penetrate-info) this))) (logior (penetrate jak-yellow-shot jak-red-shot jak-blue-shot) v1-1) ) ) ;; definition for method 193 of type kid-escort -(defmethod bot-method-193 kid-escort ((obj kid-escort)) +(defmethod bot-method-193 kid-escort ((this kid-escort)) (let* ((t9-0 (method-of-type bot bot-method-193)) - (v0-0 (t9-0 obj)) + (v0-0 (t9-0 this)) ) - (if (and (not v0-0) (logtest? #x1c00000 (-> obj incoming penetrate-using))) + (if (and (not v0-0) (logtest? #x1c00000 (-> this incoming penetrate-using))) (set! v0-0 #t) ) v0-0 @@ -657,7 +654,7 @@ This commonly includes things such as: ) ;; definition for method 79 of type kid-escort -(defmethod enemy-method-79 kid-escort ((obj kid-escort) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 kid-escort ((this kid-escort) (arg0 int) (arg1 enemy-knocked-info)) (local-vars (gp-0 symbol)) (case arg0 ((3) @@ -666,7 +663,7 @@ This commonly includes things such as: (if (>= (ja-aframe-num 0) 5.0) (set! f30-0 0.28) ) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) f30-0) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) @@ -674,7 +671,7 @@ This commonly includes things such as: ) ) (else - (set! gp-0 ((method-of-type bot enemy-method-79) obj arg0 arg1)) + (set! gp-0 ((method-of-type bot enemy-method-79) this arg0 arg1)) ) ) gp-0 @@ -682,23 +679,23 @@ This commonly includes things such as: ;; definition for method 235 of type kid-escort ;; INFO: Used lq/sq -(defmethod want-exit-vehicle? kid-escort ((obj kid-escort) (arg0 vector)) - (let ((s3-0 (handle->process (-> obj vehicle-handle)))) - (if (or (not s3-0) (not (-> obj nav))) +(defmethod want-exit-vehicle? kid-escort ((this kid-escort) (arg0 vector)) + (let ((s3-0 (handle->process (-> this vehicle-handle)))) + (if (or (not s3-0) (not (-> this nav))) (return #f) ) (let ((s4-0 (new 'stack-no-clear 'vector))) - (compute-seat-position (the-as vehicle s3-0) s4-0 (-> obj vehicle-seat-index)) + (compute-seat-position (the-as vehicle s3-0) s4-0 (-> this vehicle-seat-index)) (vector-! s4-0 s4-0 (-> (the-as vehicle s3-0) root trans)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 (+ 14336.0 (vector-length s4-0))) (vector+! s4-0 s4-0 (-> (the-as vehicle s3-0) root trans)) (let ((s3-1 (new 'stack-no-clear 'collide-query))) - (when (enemy-above-ground? obj s3-1 s4-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (when (enemy-above-ground? this s3-1 s4-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s4-0 y) (-> s3-1 best-other-tri intersect y)) (let ((s3-2 (new 'stack-no-clear 'vector))) - (do-navigation-to-destination (-> obj nav state) (-> obj root trans)) - (when (cloest-point-on-mesh (-> obj nav) s3-2 s4-0 (the-as nav-poly #f)) + (do-navigation-to-destination (-> this nav state) (-> this root trans)) + (when (cloest-point-on-mesh (-> this nav) s3-2 s4-0 (the-as nav-poly #f)) (let ((f0-4 2048.0)) (when (>= (* f0-4 f0-4) (vector-vector-xz-distance-squared s3-2 s4-0)) (set! (-> arg0 quad) (-> s3-2 quad)) @@ -716,37 +713,37 @@ This commonly includes things such as: ;; definition for method 238 of type kid-escort ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod check-vehicle-exit kid-escort ((obj kid-escort)) +(defmethod check-vehicle-exit kid-escort ((this kid-escort)) (local-vars (v1-25 enemy-flag)) - (when (focus-test? obj pilot) - (let ((s5-0 (handle->process (-> obj vehicle-handle)))) + (when (focus-test? this pilot) + (let ((s5-0 (handle->process (-> this vehicle-handle)))) (when (or (not s5-0) (logtest? (-> (the-as vehicle s5-0) flags) (rigid-body-object-flag dead))) - (logior! (-> obj bot-flags) (bot-flags bf17)) - (logclear! (-> obj bot-flags) (bot-flags bf15)) - (logclear! (-> obj focus-status) (focus-status pilot-riding pilot)) + (logior! (-> this bot-flags) (bot-flags bf17)) + (logclear! (-> this bot-flags) (bot-flags bf15)) + (logclear! (-> this focus-status) (focus-status pilot-riding pilot)) (if (the-as vehicle s5-0) - (remove-rider (the-as vehicle s5-0) obj) + (remove-rider (the-as vehicle s5-0) this) ) - (set! (-> obj vehicle-seat-index) -1) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (logior! (-> obj root nav-flags) (nav-flags has-root-sphere)) - (let* ((s4-0 (-> obj root quat)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this vehicle-handle) (the-as handle #f)) + (logior! (-> this root nav-flags) (nav-flags has-root-sphere)) + (let* ((s4-0 (-> this root quat)) (f30-0 (quaternion-y-angle s4-0)) ) (quaternion-identity! s4-0) (quaternion-rotate-y! s4-0 s4-0 f30-0) ) - (let ((v1-24 (-> obj enemy-flags))) + (let ((v1-24 (-> this enemy-flags))) (if (logtest? v1-24 (enemy-flag checking-water)) (set! v1-25 (logior v1-24 (enemy-flag enable-on-active))) (set! v1-25 (logclear v1-24 (enemy-flag enable-on-active))) ) ) - (set! (-> obj enemy-flags) v1-25) - (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> (the-as vehicle s5-0) root trans)))) + (set! (-> this enemy-flags) v1-25) + (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> (the-as vehicle s5-0) root trans)))) (vector-normalize! s4-2 57344.0) (send-event - obj + this 'attack #f (static-attack-info ((id (new-attack-id)) (vector s4-2) (attacker-velocity s4-2) (knock (the-as uint 8)))) @@ -760,43 +757,44 @@ This commonly includes things such as: ) ;; definition for method 70 of type kid-escort -(defmethod go-hostile kid-escort ((obj kid-escort)) +(defmethod go-hostile kid-escort ((this kid-escort)) (cond - ((logtest? (bot-flags bf17) (-> obj bot-flags)) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (logior! (-> obj focus-status) (focus-status disable)) - (go (method-of-object obj knocked-off-vehicle)) + ((logtest? (bot-flags bf17) (-> this bot-flags)) + (logior! (-> this bot-flags) (bot-flags bf09)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag check-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (logior! (-> this focus-status) (focus-status disable)) + (go (method-of-object this knocked-off-vehicle)) ) (else - (react-to-focus obj) + (react-to-focus this) ) ) ) ;; definition for method 102 of type kid-escort -(defmethod enemy-method-102 kid-escort ((obj kid-escort)) - (if (logtest? (bot-flags bf19) (-> obj bot-flags)) +(defmethod enemy-method-102 kid-escort ((this kid-escort)) + (if (logtest? (bot-flags bf19) (-> this bot-flags)) #f - ((method-of-type bot enemy-method-102) obj) + ((method-of-type bot enemy-method-102) this) ) ) ;; definition for method 116 of type kid-escort -(defmethod go-idle kid-escort ((obj kid-escort)) +;; WARN: Return type mismatch object vs none. +(defmethod go-idle kid-escort ((this kid-escort)) (cond ((task-node-closed? (game-task-node city-escort-kid-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (check-arrest obj) + (check-arrest this) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/city/kiosk/kiosk-part_REF.gc b/test/decompiler/reference/jak2/levels/city/kiosk/kiosk-part_REF.gc index 19925b88d4..2c045973ef 100644 --- a/test/decompiler/reference/jak2/levels/city/kiosk/kiosk-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/kiosk/kiosk-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type kiosk-part -(defmethod inspect kiosk-part ((obj kiosk-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect kiosk-part ((this kiosk-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc index e0b0b4640e..7f1424344e 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ashelin/ash4-course_REF.gc @@ -15,29 +15,29 @@ ) ;; definition for method 3 of type ashelin-tanker -(defmethod inspect ashelin-tanker ((obj ashelin-tanker)) - (when (not obj) - (set! obj obj) +(defmethod inspect ashelin-tanker ((this ashelin-tanker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type ashelin inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsuppress: #~%" (-> obj suppress)) + (format #t "~2Tsuppress: #~%" (-> this suppress)) (label cfg-4) - obj + this ) ;; definition for method 116 of type ashelin-tanker ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ashelin-tanker ((obj ashelin-tanker)) +(defmethod go-idle ashelin-tanker ((this ashelin-tanker)) (cond ((task-node-closed? (game-task-node city-intercept-tanker-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj hidden)) + (go (method-of-object this hidden)) ) ) (none) @@ -45,12 +45,12 @@ ;; definition for method 210 of type ashelin-tanker ;; WARN: Return type mismatch vector vs none. -(defmethod init! ashelin-tanker ((obj ashelin-tanker)) +(defmethod init! ashelin-tanker ((this ashelin-tanker)) "Set defaults for various fields." (let ((t9-0 (method-of-type ashelin init!))) - (t9-0 obj) + (t9-0 this) ) - (let ((v1-1 (-> obj suppress))) + (let ((v1-1 (-> this suppress))) (set! (-> v1-1 duration) (seconds 1)) (set! (-> v1-1 id) -1) (let ((a0-4 (-> v1-1 bbox))) @@ -66,7 +66,7 @@ ;; definition for method 251 of type ashelin-tanker ;; INFO: Used lq/sq -(defmethod suppress-traffic ashelin-tanker ((obj ashelin-tanker)) +(defmethod suppress-traffic ashelin-tanker ((this ashelin-tanker)) (when *traffic-manager* (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) (set! (-> a1-0 sphere quad) (-> (new 'static 'vector :x 1837465.6 :y 34406.4 :z 1868103.6 :w 225280.0) quad)) @@ -342,7 +342,7 @@ :nav-mesh-index -1 :skip-to -1 :on-set (lambda ((arg0 ashelin-tanker)) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) (ashelin-method-250 arg0 #f) (task-node-close! (game-task-node city-intercept-tanker-battle)) (remove-setting! 'sound-mode) diff --git a/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc index 3a23bfde0d..f2ef1e1cd1 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ashelin/ctyasha-obs_REF.gc @@ -909,78 +909,78 @@ ) ;; definition for method 3 of type tanker-grunt -(defmethod inspect tanker-grunt ((obj tanker-grunt)) - (when (not obj) - (set! obj obj) +(defmethod inspect tanker-grunt ((this tanker-grunt)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type grunt inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Texpensive-gnd-collide?: ~A~%" (-> obj expensive-gnd-collide?)) + (format #t "~2Texpensive-gnd-collide?: ~A~%" (-> this expensive-gnd-collide?)) (label cfg-4) - obj + this ) ;; definition for method 74 of type tanker-grunt -(defmethod general-event-handler tanker-grunt ((obj tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler tanker-grunt ((this tanker-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('skip-intro) - (when (and (-> obj next-state) - (let ((v1-4 (-> obj next-state name))) + (when (and (-> this next-state) + (let ((v1-4 (-> this next-state name))) (or (= v1-4 'ambush) (= v1-4 'jumping-ambush) (= v1-4 'dormant) (= v1-4 'jump) (= v1-4 'jump-blocked)) ) ) - (let ((s5-0 (-> obj intro-path))) + (let ((s5-0 (-> this intro-path))) (when (nonzero? s5-0) (let ((f30-0 (get-num-segments s5-0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (get-point-at-percent-along-path! s5-0 (-> obj root trans) f30-0 'interp) + (get-point-at-percent-along-path! s5-0 (-> this root trans) f30-0 'interp) (displacement-between-points-at-percent-normalized! s5-0 s4-0 f30-0) - (forward-up->quaternion (-> obj root quat) s4-0 *up-vector*) + (forward-up->quaternion (-> this root quat) s4-0 *up-vector*) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (set-vector! (-> obj root scale) 1.0 1.0 1.0 1.0) - (go-hostile obj) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (go-hostile this) #t ) ) ) ) (else - ((method-of-type grunt general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type grunt general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 115 of type tanker-grunt ;; WARN: Return type mismatch vector vs none. -(defmethod init-enemy! tanker-grunt ((obj tanker-grunt)) +(defmethod init-enemy! tanker-grunt ((this tanker-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (set! (-> obj expensive-gnd-collide?) #t) + (set! (-> this expensive-gnd-collide?) #t) (let ((t9-0 (method-of-type grunt init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set-vector! (-> obj root scale) 0.0 0.0 0.0 1.0) + (set-vector! (-> this root scale) 0.0 0.0 0.0 1.0) (none) ) ;; definition for method 124 of type tanker-grunt ;; WARN: Return type mismatch uint vs collide-spec. -(defmethod enemy-method-124 tanker-grunt ((obj tanker-grunt)) +(defmethod enemy-method-124 tanker-grunt ((this tanker-grunt)) "TODO" (let ((t9-0 (method-of-type grunt enemy-method-124))) - (t9-0 obj) + (t9-0 this) ) - (the-as collide-spec (when (-> obj expensive-gnd-collide?) - (let ((v0-1 (logior (-> obj gnd-collide) 577))) - (set! (-> obj gnd-collide) v0-1) + (the-as collide-spec (when (-> this expensive-gnd-collide?) + (let ((v0-1 (logior (-> this gnd-collide) 577))) + (set! (-> this gnd-collide) v0-1) v0-1 ) ) @@ -988,10 +988,10 @@ ) ;; definition for method 70 of type tanker-grunt -(defmethod go-hostile tanker-grunt ((obj tanker-grunt)) - (set! (-> obj expensive-gnd-collide?) #f) - (enemy-method-124 obj) - ((method-of-type grunt go-hostile) obj) +(defmethod go-hostile tanker-grunt ((this tanker-grunt)) + (set! (-> this expensive-gnd-collide?) #f) + (enemy-method-124 this) + ((method-of-type grunt go-hostile) this) ) ;; failed to figure out what this is: @@ -1031,77 +1031,77 @@ ) ;; definition for method 3 of type tanker-juicer -(defmethod inspect tanker-juicer ((obj tanker-juicer)) - (when (not obj) - (set! obj obj) +(defmethod inspect tanker-juicer ((this tanker-juicer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type juicer inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Texpensive-gnd-collide?: ~A~%" (-> obj expensive-gnd-collide?)) + (format #t "~2Texpensive-gnd-collide?: ~A~%" (-> this expensive-gnd-collide?)) (label cfg-4) - obj + this ) ;; definition for method 74 of type tanker-juicer -(defmethod general-event-handler tanker-juicer ((obj tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler tanker-juicer ((this tanker-juicer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('skip-intro) - (when (and (-> obj next-state) (let ((v1-4 (-> obj next-state name))) - (or (= v1-4 'ambush) (= v1-4 'dormant) (= v1-4 'jump) (= v1-4 'jump-blocked)) - ) + (when (and (-> this next-state) (let ((v1-4 (-> this next-state name))) + (or (= v1-4 'ambush) (= v1-4 'dormant) (= v1-4 'jump) (= v1-4 'jump-blocked)) + ) ) - (let ((s5-0 (-> obj intro-path))) + (let ((s5-0 (-> this intro-path))) (when (nonzero? s5-0) (let ((f30-0 (get-num-segments s5-0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (get-point-at-percent-along-path! s5-0 (-> obj root trans) f30-0 'interp) + (get-point-at-percent-along-path! s5-0 (-> this root trans) f30-0 'interp) (displacement-between-points-at-percent-normalized! s5-0 s4-0 f30-0) - (forward-up->quaternion (-> obj root quat) s4-0 *up-vector*) + (forward-up->quaternion (-> this root quat) s4-0 *up-vector*) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (set-vector! (-> obj root scale) 1.0 1.0 1.0 1.0) - (go-hostile obj) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (go-hostile this) #t ) ) ) ) (else - ((method-of-type juicer general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type juicer general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 115 of type tanker-juicer ;; WARN: Return type mismatch vector vs none. -(defmethod init-enemy! tanker-juicer ((obj tanker-juicer)) +(defmethod init-enemy! tanker-juicer ((this tanker-juicer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (set! (-> obj expensive-gnd-collide?) #t) + (set! (-> this expensive-gnd-collide?) #t) (let ((t9-0 (method-of-type juicer init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set-vector! (-> obj root scale) 0.0 0.0 0.0 1.0) + (set-vector! (-> this root scale) 0.0 0.0 0.0 1.0) (none) ) ;; definition for method 124 of type tanker-juicer ;; WARN: Return type mismatch uint vs collide-spec. -(defmethod enemy-method-124 tanker-juicer ((obj tanker-juicer)) +(defmethod enemy-method-124 tanker-juicer ((this tanker-juicer)) "TODO" (let ((t9-0 (method-of-type juicer enemy-method-124))) - (t9-0 obj) + (t9-0 this) ) - (the-as collide-spec (when (-> obj expensive-gnd-collide?) - (let ((v0-1 (logior (-> obj gnd-collide) 577))) - (set! (-> obj gnd-collide) v0-1) + (the-as collide-spec (when (-> this expensive-gnd-collide?) + (let ((v0-1 (logior (-> this gnd-collide) 577))) + (set! (-> this gnd-collide) v0-1) v0-1 ) ) @@ -1109,10 +1109,10 @@ ) ;; definition for method 70 of type tanker-juicer -(defmethod go-hostile tanker-juicer ((obj tanker-juicer)) - (set! (-> obj expensive-gnd-collide?) #f) - (enemy-method-124 obj) - ((method-of-type juicer go-hostile) obj) +(defmethod go-hostile tanker-juicer ((this tanker-juicer)) + (set! (-> this expensive-gnd-collide?) #f) + (enemy-method-124 this) + ((method-of-type juicer go-hostile) this) ) ;; failed to figure out what this is: @@ -1157,28 +1157,28 @@ ) ;; definition for method 3 of type tanker-container -(defmethod inspect tanker-container ((obj tanker-container)) - (when (not obj) - (set! obj obj) +(defmethod inspect tanker-container ((this tanker-container)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 22 of type tanker-container ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod tanker-container-method-22 tanker-container ((obj tanker-container)) +(defmethod tanker-container-method-22 tanker-container ((this tanker-container)) (process-spawn simple-nav-sphere #x46733333 (new 'static 'vector :x 1719500.8 :y 35225.6 :z 1837465.6 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1186,7 +1186,7 @@ (new 'static 'vector :x 1730560.0 :y 35225.6 :z 1855488.0 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1194,7 +1194,7 @@ (new 'static 'vector :x 1738752.0 :y 35225.6 :z 1884160.0 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1202,7 +1202,7 @@ (new 'static 'vector :x 1751040.0 :y 35225.6 :z 1910374.4 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1210,7 +1210,7 @@ (new 'static 'vector :x 1763737.6 :y 35225.6 :z 1936588.8 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1218,7 +1218,7 @@ (new 'static 'vector :x 1853849.6 :y 35225.6 :z 1918566.4 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1226,7 +1226,7 @@ (new 'static 'vector :x 1867776.0 :y 35225.6 :z 1934131.2 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1234,7 +1234,7 @@ (new 'static 'vector :x 1962803.2 :y 35225.6 :z 1739980.8 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1242,7 +1242,7 @@ (new 'static 'vector :x 1916108.8 :y 35225.6 :z 1705164.8 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1250,7 +1250,7 @@ (new 'static 'vector :x 1863270.4 :y 35225.6 :z 1699430.4 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1258,7 +1258,7 @@ (new 'static 'vector :x 1862860.8 :y 35225.6 :z 1814118.4 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1266,7 +1266,7 @@ (new 'static 'vector :x 1810841.6 :y 35225.6 :z 1800192.0 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1274,7 +1274,7 @@ (new 'static 'vector :x 1781350.4 :y 35225.6 :z 1774387.2 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1282,7 +1282,7 @@ (new 'static 'vector :x 1771110.4 :y 35225.6 :z 1799782.4 :w 1.0) #f -1 - :to obj + :to this ) (process-spawn simple-nav-sphere @@ -1290,7 +1290,7 @@ (new 'static 'vector :x 1784217.6 :y 35225.6 :z 1828864.0 :w 1.0) #f -1 - :to obj + :to this ) (none) ) @@ -1342,14 +1342,14 @@ ;; definition for method 11 of type tanker-container ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tanker-container ((obj tanker-container) (arg0 entity-actor)) +(defmethod init-from-entity! tanker-container ((this tanker-container) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1381,33 +1381,33 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tanker-container" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (transform-post) - (let ((v1-26 (-> obj root root-prim))) + (let ((v1-26 (-> this root root-prim))) (set! (-> v1-26 prim-core collide-as) (collide-spec)) (set! (-> v1-26 prim-core collide-with) (collide-spec)) ) 0 - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (if (task-node-closed? (game-task-node city-intercept-tanker-introduction)) - (go (method-of-object obj idle)) - (go (method-of-object obj dormant)) + (go (method-of-object this idle)) + (go (method-of-object this dormant)) ) (none) ) @@ -1434,16 +1434,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type tanker-crash -(defmethod inspect tanker-crash ((obj tanker-crash)) - (when (not obj) - (set! obj obj) +(defmethod inspect tanker-crash ((this tanker-crash)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1480,14 +1480,14 @@ This commonly includes things such as: ;; definition for method 11 of type tanker-crash ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tanker-crash ((obj tanker-crash) (arg0 entity-actor)) +(defmethod init-from-entity! tanker-crash ((this tanker-crash) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1519,33 +1519,33 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tanker-crash" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (transform-post) - (let ((v1-26 (-> obj root root-prim))) + (let ((v1-26 (-> this root root-prim))) (set! (-> v1-26 prim-core collide-as) (collide-spec)) (set! (-> v1-26 prim-core collide-with) (collide-spec)) ) 0 - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (if (task-node-closed? (game-task-node city-intercept-tanker-introduction)) - (go (method-of-object obj idle)) - (go (method-of-object obj dormant)) + (go (method-of-object this idle)) + (go (method-of-object this dormant)) ) (none) ) @@ -1569,24 +1569,24 @@ This commonly includes things such as: ) ;; definition for method 3 of type tanker-deadly -(defmethod inspect tanker-deadly ((obj tanker-deadly)) - (when (not obj) - (set! obj obj) +(defmethod inspect tanker-deadly ((this tanker-deadly)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttrack-joint: ~D~%" (-> obj track-joint)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tdie-time: ~D~%" (-> obj die-time)) - (format #t "~2Tprev-pos: #~%" (-> obj prev-pos)) + (format #t "~2Ttrack-joint: ~D~%" (-> this track-joint)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tdie-time: ~D~%" (-> this die-time)) + (format #t "~2Tprev-pos: #~%" (-> this prev-pos)) (label cfg-4) - obj + this ) ;; definition for method 12 of type tanker-deadly -(defmethod run-logic? tanker-deadly ((obj tanker-deadly)) +(defmethod run-logic? tanker-deadly ((this tanker-deadly)) #t ) diff --git a/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc index 2a6aacab6f..3967bd2859 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ctymark-obs_REF.gc @@ -1031,18 +1031,18 @@ ) ;; definition for method 3 of type market-object -(defmethod inspect market-object ((obj market-object)) - (when (not obj) - (set! obj obj) +(defmethod inspect market-object ((this market-object)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpart-explode: ~A~%" (-> obj part-explode)) - (format #t "~2Texplode-matrix: #~%" (-> obj explode-matrix)) + (format #t "~2Tpart-explode: ~A~%" (-> this part-explode)) + (format #t "~2Texplode-matrix: #~%" (-> this explode-matrix)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1100,7 +1100,7 @@ ) (process-entity-status! self (entity-perm-status dead) #t) (let ((frame (current-time))) - (until (>= (- (current-time) frame) (seconds 5)) + (until (time-elapsed? frame (seconds 5)) (suspend) ) ) @@ -1123,16 +1123,16 @@ ) ;; definition for method 3 of type market-basket-a -(defmethod inspect market-basket-a ((obj market-basket-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect market-basket-a ((this market-basket-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type market-object inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1145,14 +1145,14 @@ ;; definition for method 11 of type market-basket-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-basket-a ((obj market-basket-a) (arg0 entity-actor)) +(defmethod init-from-entity! market-basket-a ((this market-basket-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) (set! (-> prim-mesh prim-core action) (collide-action solid)) @@ -1186,20 +1186,20 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask crate)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask crate)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-market-basket-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part-explode) (-> *part-group-id-table* 1007)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this part-explode) (-> *part-group-id-table* 1007)) + (set! (-> this draw light-index) (the-as uint 10)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1219,16 +1219,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type market-basket-b -(defmethod inspect market-basket-b ((obj market-basket-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect market-basket-b ((this market-basket-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type market-object inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1241,14 +1241,14 @@ This commonly includes things such as: ;; definition for method 11 of type market-basket-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-basket-b ((obj market-basket-b) (arg0 entity-actor)) +(defmethod init-from-entity! market-basket-b ((this market-basket-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) (set! (-> prim-mesh prim-core action) (collide-action solid)) @@ -1282,20 +1282,20 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask crate)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask crate)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-market-basket-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part-explode) (-> *part-group-id-table* 1008)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this part-explode) (-> *part-group-id-table* 1008)) + (set! (-> this draw light-index) (the-as uint 10)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1315,16 +1315,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type market-crate -(defmethod inspect market-crate ((obj market-crate)) - (when (not obj) - (set! obj obj) +(defmethod inspect market-crate ((this market-crate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type market-object inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1337,14 +1337,14 @@ This commonly includes things such as: ;; definition for method 11 of type market-crate ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-crate ((obj market-crate) (arg0 entity-actor)) +(defmethod init-from-entity! market-crate ((this market-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) (set! (-> prim-mesh prim-core action) (collide-action solid)) @@ -1378,20 +1378,20 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask crate)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask crate)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-market-crate" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part-explode) (-> *part-group-id-table* 1006)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this part-explode) (-> *part-group-id-table* 1006)) + (set! (-> this draw light-index) (the-as uint 10)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1411,16 +1411,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type market-sack-a -(defmethod inspect market-sack-a ((obj market-sack-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect market-sack-a ((this market-sack-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type market-object inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1433,14 +1433,14 @@ This commonly includes things such as: ;; definition for method 11 of type market-sack-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-sack-a ((obj market-sack-a) (arg0 entity-actor)) +(defmethod init-from-entity! market-sack-a ((this market-sack-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) (set! (-> prim-mesh prim-core action) (collide-action solid)) @@ -1474,20 +1474,20 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask crate)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask crate)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-market-sack-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part-explode) (-> *part-group-id-table* 1009)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this part-explode) (-> *part-group-id-table* 1009)) + (set! (-> this draw light-index) (the-as uint 10)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1507,16 +1507,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type market-sack-b -(defmethod inspect market-sack-b ((obj market-sack-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect market-sack-b ((this market-sack-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type market-object inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1529,14 +1529,14 @@ This commonly includes things such as: ;; definition for method 11 of type market-sack-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! market-sack-b ((obj market-sack-b) (arg0 entity-actor)) +(defmethod init-from-entity! market-sack-b ((this market-sack-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec crate)) (set! (-> prim-mesh prim-core action) (collide-action solid)) @@ -1570,20 +1570,20 @@ This commonly includes things such as: knocked ) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask crate)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask crate)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-market-sack-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part-explode) (-> *part-group-id-table* 1010)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this part-explode) (-> *part-group-id-table* 1010)) + (set! (-> this draw light-index) (the-as uint 10)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/market/ctymarka-part_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ctymarka-part_REF.gc index 5e3f60e497..c439bd7fc8 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ctymarka-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ctymarka-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctymarka-part -(defmethod inspect ctymarka-part ((obj ctymarka-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctymarka-part ((this ctymarka-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/market/ctymarkb-part_REF.gc b/test/decompiler/reference/jak2/levels/city/market/ctymarkb-part_REF.gc index d4717b49e6..b0ac34cb2e 100644 --- a/test/decompiler/reference/jak2/levels/city/market/ctymarkb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/market/ctymarkb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctymarkb-part -(defmethod inspect ctymarkb-part ((obj ctymarkb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctymarkb-part ((this ctymarkb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc b/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc index 8976e46114..2e3286267f 100644 --- a/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/meet-brutter/meet-brutter_REF.gc @@ -3,43 +3,43 @@ ;; definition for method 15 of type hud-lurker ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-lurker ((obj hud-lurker)) +(defmethod draw hud-lurker ((this hud-lurker)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 205 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 27) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -19 27) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-lurker ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-lurker ((obj hud-lurker)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-lurker ((this hud-lurker)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-lurker ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-lurker ((obj hud-lurker)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-lurker ((this hud-lurker)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x679))) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x679))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -249,23 +249,23 @@ ) ;; definition for method 3 of type paddywagon -(defmethod inspect paddywagon ((obj paddywagon)) - (when (not obj) - (set! obj obj) +(defmethod inspect paddywagon ((this paddywagon)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-guard inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcurrent-level: ~A~%" (-> obj current-level)) + (format #t "~2Tcurrent-level: ~A~%" (-> this current-level)) (label cfg-4) - obj + this ) ;; definition for method 32 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape paddywagon ((obj paddywagon)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape paddywagon ((this paddywagon)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -313,7 +313,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -333,19 +333,19 @@ ) ;; definition for method 3 of type pw-iter-seg -(defmethod inspect pw-iter-seg ((obj pw-iter-seg)) - (when (not obj) - (set! obj obj) +(defmethod inspect pw-iter-seg ((this pw-iter-seg)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pw-iter-seg) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tdesired-dir: #~%" (-> obj desired-dir)) - (format #t "~1Tscore: ~f~%" (-> obj score)) - (format #t "~1Tseg: #~%" (-> obj seg)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "[~8x] ~A~%" this 'pw-iter-seg) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tdesired-dir: #~%" (-> this desired-dir)) + (format #t "~1Tscore: ~f~%" (-> this score)) + (format #t "~1Tseg: #~%" (-> this seg)) + (format #t "~1Tlevel: ~A~%" (-> this level)) (label cfg-4) - obj + this ) ;; definition for function pw-iter-seg-new-dir-level @@ -471,20 +471,20 @@ ;; definition for method 33 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body paddywagon ((obj paddywagon)) +(defmethod init-skel-and-rigid-body paddywagon ((this paddywagon)) (with-pp (set! (-> pp level) (level-get *level* 'lmeetbrt)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-paddywagon" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *paddywagon-constants*) - (set! (-> obj draw lod-set lod 0 dist) 819200.0) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag no-hijack) (-> obj flags))) + (alloc-and-init-rigid-body-control this *paddywagon-constants*) + (set! (-> this draw lod-set lod 0 dist) 819200.0) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag no-hijack) (-> this flags))) ) - (set! (-> obj controller choose-branch-callback) choose-next-branch-no-exit-level) + (set! (-> this controller choose-branch-callback) choose-next-branch-no-exit-level) 0 (none) ) @@ -492,70 +492,70 @@ ;; definition for method 120 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-120 paddywagon ((obj paddywagon)) +(defmethod vehicle-method-120 paddywagon ((this paddywagon)) (let ((t9-0 (method-of-type vehicle-guard vehicle-method-120))) - (t9-0 obj) + (t9-0 this) ) - (if (logtest? (-> obj controller flags) (vehicle-controller-flag attached)) - (set! (-> obj current-level) (-> obj controller branch dest-node level)) - (set! (-> obj current-level) #f) + (if (logtest? (-> this controller flags) (vehicle-controller-flag attached)) + (set! (-> this current-level) (-> this controller branch dest-node level)) + (set! (-> this current-level) #f) ) - (vehicle-method-119 obj) + (vehicle-method-119 this) 0 (none) ) ;; definition for method 128 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-128 paddywagon ((obj paddywagon)) +(defmethod vehicle-method-128 paddywagon ((this paddywagon)) (let ((t9-0 (method-of-type vehicle vehicle-method-128))) - (t9-0 obj) + (t9-0 this) ) - (logior! (-> obj flags) (rigid-body-object-flag persistent)) + (logior! (-> this flags) (rigid-body-object-flag persistent)) 0 (none) ) ;; definition for method 127 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-127 paddywagon ((obj paddywagon)) - ((method-of-type vehicle vehicle-method-127) obj) +(defmethod vehicle-method-127 paddywagon ((this paddywagon)) + ((method-of-type vehicle vehicle-method-127) this) 0 (none) ) ;; definition for method 129 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-129 paddywagon ((obj paddywagon)) - ((method-of-type vehicle vehicle-method-129) obj) +(defmethod vehicle-method-129 paddywagon ((this paddywagon)) + ((method-of-type vehicle vehicle-method-129) this) 0 (none) ) ;; definition for method 134 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-134 paddywagon ((obj paddywagon) (arg0 process)) +(defmethod vehicle-method-134 paddywagon ((this paddywagon) (arg0 process)) "Stubbed" - (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others)) - (set! (-> obj controller target-speed-offset) 81920.0) - (set! (-> obj pursuit-target) (process->handle arg0)) - (logior! (-> obj flags) (rigid-body-object-flag alert)) + (logior! (-> this controller flags) (vehicle-controller-flag ignore-others)) + (set! (-> this controller target-speed-offset) 81920.0) + (set! (-> this pursuit-target) (process->handle arg0)) + (logior! (-> this flags) (rigid-body-object-flag alert)) (if (task-node-open? (game-task-node city-save-lurkers-save-lurkers)) - (vehicle-method-111 obj 1 (the-as target arg0)) - (vehicle-method-111 obj 2 (the-as target arg0)) + (vehicle-method-111 this 1 (the-as target arg0)) + (vehicle-method-111 this 2 (the-as target arg0)) ) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) 0 (none) ) ;; definition for method 108 of type paddywagon ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-108 paddywagon ((obj paddywagon)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> obj flags))) +(defmethod vehicle-method-108 paddywagon ((this paddywagon)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> this flags))) ) - (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others)) + (logior! (-> this controller flags) (vehicle-controller-flag ignore-others)) 0 (none) ) @@ -824,27 +824,27 @@ ) ;; definition for method 3 of type city-lurker -(defmethod inspect city-lurker ((obj city-lurker)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-lurker ((this city-lurker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type civilian inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnav-mesh-aid: ~D~%" (-> obj nav-mesh-aid)) - (format #t "~2Tindex: ~D~%" (-> obj index)) - (format #t "~2Tleft-right-interp: ~f~%" (-> obj left-right-interp)) - (format #t "~2Tfront-back-interp: ~f~%" (-> obj front-back-interp)) - (format #t "~2Tv-speed: #~%" (-> obj v-speed)) - (format #t "~2Tend-pos: #~%" (-> obj end-pos)) - (format #t "~2Ttask-done?: ~A~%" (-> obj task-done?)) - (format #t "~2Ttask-node: ~D~%" (-> obj task-node)) - (format #t "~2Tjump-in-pipe?: ~A~%" (-> obj jump-in-pipe?)) - (format #t "~2Tpipe-name: ~A~%" (-> obj pipe-name)) - (format #t "~2Tcoming-from-pw: ~A~%" (-> obj coming-from-pw)) + (format #t "~2Tnav-mesh-aid: ~D~%" (-> this nav-mesh-aid)) + (format #t "~2Tindex: ~D~%" (-> this index)) + (format #t "~2Tleft-right-interp: ~f~%" (-> this left-right-interp)) + (format #t "~2Tfront-back-interp: ~f~%" (-> this front-back-interp)) + (format #t "~2Tv-speed: #~%" (-> this v-speed)) + (format #t "~2Tend-pos: #~%" (-> this end-pos)) + (format #t "~2Ttask-done?: ~A~%" (-> this task-done?)) + (format #t "~2Ttask-node: ~D~%" (-> this task-node)) + (format #t "~2Tjump-in-pipe?: ~A~%" (-> this jump-in-pipe?)) + (format #t "~2Tpipe-name: ~A~%" (-> this pipe-name)) + (format #t "~2Tcoming-from-pw: ~A~%" (-> this coming-from-pw)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1054,7 +1054,7 @@ ) ;; definition for method 26 of type city-lurker -(defmethod get-inv-mass city-lurker ((obj city-lurker)) +(defmethod get-inv-mass city-lurker ((this city-lurker)) 0.25 ) @@ -1266,7 +1266,7 @@ (set! (-> self gnd-height) (-> self root gspot-pos y)) (logior! (-> self flags) (citizen-flag persistent)) (logior! (-> self focus-status) (focus-status pilot-riding pilot)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-31 (-> self root root-prim))) (set! (-> v1-31 prim-core collide-as) (collide-spec)) (set! (-> v1-31 prim-core collide-with) (collide-spec)) @@ -1317,14 +1317,14 @@ ) (let ((s5-3 (new 'stack-no-clear 'vector))) (let ((s4-0 (new 'stack-no-clear 'quaternion))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while (not (civilian-method-217 self s5-3)) (let ((s3-0 (handle->process (-> self vehicle)))) (new 'stack-no-clear 'vector) (quaternion-copy! (-> self root quat) (-> (the-as vehicle s3-0) root quat)) (compute-seat-position (the-as vehicle s3-0) (-> self root trans) (-> self seat)) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (go-virtual ride) ) (suspend) @@ -1385,7 +1385,7 @@ ) ) (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-15 (-> self nav))) (set! (-> v1-15 target-speed) (* (-> self speed-scale) (-> self speed-run))) @@ -1513,7 +1513,7 @@ :event enemy-event-handler :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-6 (-> self nav))) (set! (-> v1-6 target-speed) (* (-> self speed-scale) (-> self speed-run))) @@ -1567,7 +1567,7 @@ (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag vulnerable)))) (send-event self 'jump 0 (-> self end-pos)) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (logtest? (-> self nav state flags) (nav-state-flag at-target)) ) (go-virtual wait-at-end) @@ -1604,7 +1604,7 @@ :event enemy-event-handler :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-6 (-> self nav))) (set! (-> v1-6 target-speed) (* (-> self speed-scale) (-> self speed-run))) @@ -1693,49 +1693,49 @@ ) ;; definition for method 86 of type city-lurker -(defmethod enemy-method-86 city-lurker ((obj city-lurker)) - (let ((gp-0 (-> obj root))) +(defmethod enemy-method-86 city-lurker ((this city-lurker)) + (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) - (when (and (< (-> gp-0 trans y) (+ 8192.0 (-> obj end-pos y))) (-> obj jump-in-pipe?)) - (send-event (process-by-name (-> obj pipe-name) *active-pool*) 'spin) - (set! (-> obj jump-in-pipe?) #f) + (when (and (< (-> gp-0 trans y) (+ 8192.0 (-> this end-pos y))) (-> this jump-in-pipe?)) + (send-event (process-by-name (-> this pipe-name) *active-pool*) 'spin) + (set! (-> this jump-in-pipe?) #f) ) - (>= (-> obj end-pos y) (-> gp-0 trans y)) + (>= (-> this end-pos y) (-> gp-0 trans y)) ) ) ) ;; definition for method 93 of type city-lurker ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 city-lurker ((obj city-lurker)) - (go (method-of-object obj inactive)) +(defmethod enemy-method-93 city-lurker ((this city-lurker)) + (go (method-of-object this inactive)) (none) ) ;; definition for method 89 of type city-lurker -(defmethod enemy-method-89 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) #f ) ;; definition for method 87 of type city-lurker -(defmethod enemy-method-87 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-87 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((s5-0 (-> obj skel root-channel 0))) - (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (let ((s5-0 (-> this skel root-channel 0))) + (set! (-> s5-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) (set! (-> s5-0 param 0) (ja-aframe 6.0 0)) (set! (-> s5-0 param 1) 0.5) (set! (-> s5-0 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) ) #t ) ;; definition for method 88 of type city-lurker -(defmethod enemy-method-88 city-lurker ((obj city-lurker) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 city-lurker ((this city-lurker) (arg0 enemy-jump-info)) #f ) @@ -1745,7 +1745,7 @@ :event enemy-event-handler :enter (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 self)) (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) @@ -1799,13 +1799,13 @@ ) ;; definition for method 60 of type city-lurker -(defmethod coin-flip? city-lurker ((obj city-lurker)) +(defmethod coin-flip? city-lurker ((this city-lurker)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 56 of type city-lurker -(defmethod damage-amount-from-attack city-lurker ((obj city-lurker) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack city-lurker ((this city-lurker) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) @@ -1872,7 +1872,7 @@ (citizen-init! self) (set! (-> self hit-points) 100) (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-8 (-> self root root-prim))) (set! (-> v1-8 prim-core collide-as) (collide-spec)) (set! (-> v1-8 prim-core collide-with) (collide-spec)) @@ -1987,29 +1987,29 @@ ;; definition for method 199 of type city-lurker ;; WARN: Return type mismatch int vs none. -(defmethod set-behavior! city-lurker ((obj city-lurker) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! city-lurker ((this city-lurker) (arg0 traffic-object-spawn-params)) (format #t "go-traffic-startup ~D~%" (-> arg0 behavior)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-0 2) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ((= v1-0 3) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) ((= v1-0 6) - (logior! (-> obj flags) (citizen-flag persistent)) - (go (method-of-object obj idle)) + (logior! (-> this flags) (citizen-flag persistent)) + (go (method-of-object this idle)) ) ((= v1-0 7) - (logior! (-> obj flags) (citizen-flag persistent)) - (go (method-of-object obj wait-for-ride)) + (logior! (-> this flags) (citizen-flag persistent)) + (go (method-of-object this wait-for-ride)) ) (else - (go-inactive obj) + (go-inactive this) ) ) ) @@ -2019,12 +2019,12 @@ ;; definition for method 181 of type city-lurker ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! city-lurker ((obj city-lurker)) +(defmethod citizen-init! city-lurker ((this city-lurker)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (let ((v1-1 (-> obj nav))) + (let ((v1-1 (-> this nav))) (set! (-> v1-1 sphere-mask) (the-as uint #x800fe)) ) 0 @@ -2033,9 +2033,9 @@ ;; definition for method 114 of type city-lurker ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! city-lurker ((obj city-lurker)) +(defmethod init-enemy-collision! city-lurker ((this city-lurker)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2091,7 +2091,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -2099,63 +2099,63 @@ ;; definition for method 115 of type city-lurker ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! city-lurker ((obj city-lurker)) +(defmethod init-enemy! city-lurker ((this city-lurker)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-city-lurker" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *city-lurker-nav-enemy-info*) - (set! (-> obj info) *city-lurker-global-info*) - (let ((v1-6 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *city-lurker-nav-enemy-info*) + (set! (-> this info) *city-lurker-global-info*) + (let ((v1-6 (-> this nav))) (set! (-> v1-6 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 409600.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (set! (-> obj speed-run) 20480.0) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (set! (-> obj water-anim) 20) - (set! (-> obj jump-in-pipe?) #f) - (set! (-> obj task-done?) #f) - (set! (-> obj coming-from-pw) #f) + (set! (-> this draw lod-set lod 0 dist) 409600.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this speed-run) 20480.0) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (set! (-> this water-anim) 20) + (set! (-> this jump-in-pipe?) #f) + (set! (-> this task-done?) #f) + (set! (-> this coming-from-pw) #f) 0 (none) ) ;; definition for method 74 of type city-lurker ;; INFO: Used lq/sq -(defmethod general-event-handler city-lurker ((obj city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler city-lurker ((this city-lurker) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('nav-mesh-kill) - (format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> obj name) arg2) - (change-to *default-nav-mesh* obj) + (format 0 "nav-mesh-kill event recieved by ~s ~d~%" (-> this name) arg2) + (change-to *default-nav-mesh* this) #t ) (('traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (set! (-> this controller traffic) (the-as traffic-engine (-> arg3 param 1))) (let ((s5-0 (the-as object (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-0) position quad)) - (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-0) rotation)) - (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-0) velocity quad)) + (set! (-> this root trans quad) (-> (the-as traffic-object-spawn-params s5-0) position quad)) + (quaternion-copy! (-> this root quat) (-> (the-as traffic-object-spawn-params s5-0) rotation)) + (set! (-> this root transv quad) (-> (the-as traffic-object-spawn-params s5-0) velocity quad)) (let ((a0-10 (-> (the-as traffic-object-spawn-params s5-0) nav-mesh))) (when a0-10 - (change-to a0-10 obj) - (if (not (-> obj nav)) - (go-inactive obj) + (change-to a0-10 this) + (if (not (-> this nav)) + (go-inactive this) ) - (let ((v1-17 (-> obj nav state))) + (let ((v1-17 (-> this nav state))) (set! (-> v1-17 current-poly) (the-as nav-poly #f)) ) 0 (let ((a1-5 (-> (the-as traffic-object-spawn-params s5-0) nav-branch))) (when a1-5 - (vehicle-controller-method-13 (-> obj controller) a1-5 (-> obj root trans)) - (let ((a0-14 (-> obj nav state)) - (v1-24 (-> obj controller turn-exit-point)) + (vehicle-controller-method-13 (-> this controller) a1-5 (-> this root trans)) + (let ((a0-14 (-> this nav state)) + (v1-24 (-> this controller turn-exit-point)) ) (logclear! (-> a0-14 flags) (nav-state-flag directional-mode)) (logior! (-> a0-14 flags) (nav-state-flag target-poly-dirty)) @@ -2164,13 +2164,13 @@ 0 ) ) - (citizen-nav-init! obj) - (citizen-init! obj) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) - (set! (-> obj gnd-height) (-> obj root gspot-pos y)) + (citizen-nav-init! this) + (citizen-init! this) + (enemy-method-127 this 40960.0 40960.0 #t (the-as collide-spec (-> this gnd-collide))) + (set! (-> this gnd-height) (-> this root gspot-pos y)) ) ) - (set-behavior! obj (the-as traffic-object-spawn-params s5-0)) + (set-behavior! this (the-as traffic-object-spawn-params s5-0)) ) ) (('traffic-off) @@ -2183,10 +2183,10 @@ #f ) (('hit 'hit-flinch 'hit-knocked) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type civilian general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type civilian general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -2204,18 +2204,18 @@ ) ;; definition for method 3 of type city-meet-brutter-info -(defmethod inspect city-meet-brutter-info ((obj city-meet-brutter-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-meet-brutter-info ((this city-meet-brutter-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-meet-brutter-info) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tnav-mesh-id: ~D~%" (-> obj nav-mesh-id)) - (format #t "~1Tend-pos: #~%" (-> obj end-pos)) + (format #t "[~8x] ~A~%" this 'city-meet-brutter-info) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tnav-mesh-id: ~D~%" (-> this nav-mesh-id)) + (format #t "~1Tend-pos: #~%" (-> this end-pos)) (label cfg-4) - obj + this ) ;; definition for symbol *city-meet-brutter-vehicle-info*, type (inline-array city-meet-brutter-info) @@ -2718,8 +2718,8 @@ (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) (suspend) (send-event *traffic-manager* 'set-target-level 0.75) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (none) @@ -2744,8 +2744,8 @@ (send-event *traffic-manager* 'decrease-alert-level 0) (send-event *traffic-manager* 'set-alert-duration (seconds 30)) (send-event *target* 'end-mode) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (task-node-close! (game-task-node city-meet-brutter-meet-brutter)) @@ -2767,19 +2767,19 @@ ) ;; definition for method 3 of type city-save-lurkers-info -(defmethod inspect city-save-lurkers-info ((obj city-save-lurkers-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-save-lurkers-info ((this city-save-lurkers-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-save-lurkers-info) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tnav-mesh-id: ~D~%" (-> obj nav-mesh-id)) - (format #t "~1Tend-pos: #~%" (-> obj end-pos)) - (format #t "~1Tpipe-name: ~A~%" (-> obj pipe-name)) + (format #t "[~8x] ~A~%" this 'city-save-lurkers-info) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tnav-mesh-id: ~D~%" (-> this nav-mesh-id)) + (format #t "~1Tend-pos: #~%" (-> this end-pos)) + (format #t "~1Tpipe-name: ~A~%" (-> this pipe-name)) (label cfg-4) - obj + this ) ;; definition for symbol *city-save-lurkers-pipe-info*, type (array city-save-lurkers-info) @@ -3310,8 +3310,8 @@ (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-lurker :init hud-init-by-other :to self))) (suspend) (send-event *traffic-manager* 'set-target-level 0.75) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (none) @@ -3333,7 +3333,7 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (let ((v1-2 0)) (dotimes (a0-0 6) diff --git a/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc b/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc index 170016c0ff..eed73ac822 100644 --- a/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/onintent/onin-game_REF.gc @@ -19,22 +19,22 @@ ) ;; definition for method 3 of type onin-game-event -(defmethod inspect onin-game-event ((obj onin-game-event)) - (when (not obj) - (set! obj obj) +(defmethod inspect onin-game-event ((this onin-game-event)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'onin-game-event) - (format #t "~1Tmin-count: ~D~%" (-> obj min-count)) - (format #t "~1Tmax-count: ~D~%" (-> obj max-count)) - (format #t "~1Tmin-event: ~D~%" (-> obj min-event)) - (format #t "~1Tmax-event: ~D~%" (-> obj max-event)) - (format #t "~1Twave-delay: ~D~%" (-> obj wave-delay)) - (format #t "~1Tmin-wave: ~D~%" (-> obj min-wave)) - (format #t "~1Tmax-wave: ~D~%" (-> obj max-wave)) - (format #t "~1Tgravity: (meters ~m)~%" (-> obj gravity)) + (format #t "[~8x] ~A~%" this 'onin-game-event) + (format #t "~1Tmin-count: ~D~%" (-> this min-count)) + (format #t "~1Tmax-count: ~D~%" (-> this max-count)) + (format #t "~1Tmin-event: ~D~%" (-> this min-event)) + (format #t "~1Tmax-event: ~D~%" (-> this max-event)) + (format #t "~1Twave-delay: ~D~%" (-> this wave-delay)) + (format #t "~1Tmin-wave: ~D~%" (-> this min-wave)) + (format #t "~1Tmax-wave: ~D~%" (-> this max-wave)) + (format #t "~1Tgravity: (meters ~m)~%" (-> this gravity)) (label cfg-4) - obj + this ) ;; definition for symbol *onin-game-data*, type (array object) @@ -1878,22 +1878,22 @@ ) ;; definition for method 3 of type onin-game-bubble -(defmethod inspect onin-game-bubble ((obj onin-game-bubble)) - (when (not obj) - (set! obj obj) +(defmethod inspect onin-game-bubble ((this onin-game-bubble)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbubble-type: ~D~%" (-> obj bubble-type)) - (format #t "~2Tbubble-start-time: ~D~%" (-> obj bubble-start-time)) - (format #t "~2Tgravity: (meters ~m)~%" (-> obj gravity)) - (format #t "~2Tdead?: ~A~%" (-> obj dead?)) - (format #t "~2Tangle: ~f~%" (-> obj angle)) - (format #t "~2Theight: ~f~%" (-> obj height)) + (format #t "~2Tbubble-type: ~D~%" (-> this bubble-type)) + (format #t "~2Tbubble-start-time: ~D~%" (-> this bubble-start-time)) + (format #t "~2Tgravity: (meters ~m)~%" (-> this gravity)) + (format #t "~2Tdead?: ~A~%" (-> this dead?)) + (format #t "~2Tangle: ~f~%" (-> this angle)) + (format #t "~2Theight: ~f~%" (-> this height)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1963,7 +1963,7 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.25)) + (until (time-elapsed? gp-1 (seconds 0.25)) (suspend) ) ) @@ -2122,7 +2122,7 @@ (defbehavior onin-game-bubble-init onin-game-bubble ((arg0 vector) (arg1 int) (arg2 meters) (arg3 float) (arg4 float)) "TODO - bubble type enum" (sound-play "onin-launch") - (set! (-> self bubble-start-time) (current-time)) + (set-time! (-> self bubble-start-time)) (set! (-> self bubble-type) arg1) (set! (-> self gravity) arg2) (set! (-> self angle) arg3) @@ -2195,37 +2195,37 @@ ) ;; definition for method 3 of type onin-game -(defmethod inspect onin-game ((obj onin-game)) - (when (not obj) - (set! obj obj) +(defmethod inspect onin-game ((this onin-game)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Twave: ~D~%" (-> obj wave)) - (format #t "~2Tevent: ~D~%" (-> obj event)) - (format #t "~2Twave-time: ~D~%" (-> obj wave-time)) - (format #t "~2Twave-delay-time: ~D~%" (-> obj wave-delay-time)) - (format #t "~2Twave-length: ~D~%" (-> obj wave-length)) - (format #t "~2Tevent-time: ~D~%" (-> obj event-time)) - (format #t "~2Tevent-length: ~D~%" (-> obj event-length)) - (format #t "~2Thud-score: ~D~%" (-> obj hud-score)) - (format #t "~2Thud-goal: ~D~%" (-> obj hud-goal)) - (format #t "~2Thud-miss: ~D~%" (-> obj hud-miss)) - (format #t "~2Tscore: ~f~%" (-> obj score)) - (format #t "~2Tscore-time: ~D~%" (-> obj score-time)) - (format #t "~2Tgame: #x~X~%" (-> obj game)) - (format #t "~2Tmiss-max: ~D~%" (-> obj miss-max)) - (format #t "~2Tmiss-count: ~D~%" (-> obj miss-count)) - (format #t "~2Tpoint-win: ~f~%" (-> obj point-win)) - (format #t "~2Tgame-start-time: ~D~%" (-> obj game-start-time)) - (format #t "~2Tlast-type: ~D~%" (-> obj last-type)) - (format #t "~2Tcurrent-bonus: ~f~%" (-> obj current-bonus)) - (format #t "~2Tlast-angle: ~f~%" (-> obj last-angle)) - (format #t "~2Twave-start-miss: ~D~%" (-> obj wave-start-miss)) + (format #t "~2Twave: ~D~%" (-> this wave)) + (format #t "~2Tevent: ~D~%" (-> this event)) + (format #t "~2Twave-time: ~D~%" (-> this wave-time)) + (format #t "~2Twave-delay-time: ~D~%" (-> this wave-delay-time)) + (format #t "~2Twave-length: ~D~%" (-> this wave-length)) + (format #t "~2Tevent-time: ~D~%" (-> this event-time)) + (format #t "~2Tevent-length: ~D~%" (-> this event-length)) + (format #t "~2Thud-score: ~D~%" (-> this hud-score)) + (format #t "~2Thud-goal: ~D~%" (-> this hud-goal)) + (format #t "~2Thud-miss: ~D~%" (-> this hud-miss)) + (format #t "~2Tscore: ~f~%" (-> this score)) + (format #t "~2Tscore-time: ~D~%" (-> this score-time)) + (format #t "~2Tgame: #x~X~%" (-> this game)) + (format #t "~2Tmiss-max: ~D~%" (-> this miss-max)) + (format #t "~2Tmiss-count: ~D~%" (-> this miss-count)) + (format #t "~2Tpoint-win: ~f~%" (-> this point-win)) + (format #t "~2Tgame-start-time: ~D~%" (-> this game-start-time)) + (format #t "~2Tlast-type: ~D~%" (-> this last-type)) + (format #t "~2Tcurrent-bonus: ~f~%" (-> this current-bonus)) + (format #t "~2Tlast-angle: ~f~%" (-> this last-angle)) + (format #t "~2Twave-start-miss: ~D~%" (-> this wave-start-miss)) (label cfg-4) - obj + this ) ;; definition for method 25 of type onin-game @@ -2239,7 +2239,7 @@ ;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 112 mismatch: defined as size 4, got size 16 ;; WARN: Return type mismatch int vs none. -(defmethod onin-game-method-25 onin-game ((obj onin-game)) +(defmethod onin-game-method-25 onin-game ((this onin-game)) (local-vars (v0-18 int) (sv-32 process) @@ -2249,10 +2249,10 @@ (sv-96 meters) (sv-112 float) ) - (when (>= (- (current-time) (-> obj game-start-time)) (seconds 2)) - (let ((s5-0 (-> obj game (-> obj wave)))) - (when (>= (- (current-time) (the-as int (-> obj wave-length))) (-> obj wave-time)) - (let ((s4-0 (-> obj child))) + (when (time-elapsed? (-> this game-start-time) (seconds 2)) + (let ((s5-0 (-> this game (-> this wave)))) + (when (time-elapsed? (the-as int (-> this wave-length)) (-> this wave-time)) + (let ((s4-0 (-> this child))) (while s4-0 (if (type? (ppointer->process s4-0) onin-game-bubble) (goto cfg-58) @@ -2260,27 +2260,27 @@ (set! s4-0 (-> s4-0 0 brother)) ) ) - (if (zero? (-> obj wave-delay-time)) - (set! (-> obj wave-delay-time) (current-time)) + (if (zero? (-> this wave-delay-time)) + (set-time! (-> this wave-delay-time)) ) - (if (< (- (current-time) (-> obj wave-delay-time)) (the-as time-frame (-> s5-0 wave-delay))) + (if (not (time-elapsed? (-> this wave-delay-time) (the-as time-frame (-> s5-0 wave-delay)))) (goto cfg-58) ) - (set! (-> obj event-length) (the-as uint 0)) - (+! (-> obj wave) 1) - (set! s5-0 (-> obj game (-> obj wave))) + (set! (-> this event-length) (the-as uint 0)) + (+! (-> this wave) 1) + (set! s5-0 (-> this game (-> this wave))) (when (zero? (-> s5-0 min-count)) - (set! (-> obj wave) (the-as int (-> s5-0 max-count))) - (set! s5-0 (-> obj game (-> obj wave))) + (set! (-> this wave) (the-as int (-> s5-0 max-count))) + (set! s5-0 (-> this game (-> this wave))) ) - (set! (-> obj wave-time) (current-time)) - (set! (-> obj wave-length) + (set-time! (-> this wave-time)) + (set! (-> this wave-length) (the-as uint (rand-vu-int-range (the-as int (-> s5-0 min-wave)) (the-as int (-> s5-0 max-wave)))) ) - (set! (-> obj wave-delay-time) 0) - (when (< 1 (-> obj wave)) + (set! (-> this wave-delay-time) 0) + (when (< 1 (-> this wave)) (cond - ((< 4 (- (-> obj miss-count) (-> obj wave-start-miss))) + ((< 4 (- (-> this miss-count) (-> this wave-start-miss))) (let ((v0-2 (rand-vu-int-count 5))) (cond ((zero? v0-2) @@ -2301,7 +2301,7 @@ ) ) ) - ((>= 1 (- (-> obj miss-count) (-> obj wave-start-miss))) + ((>= 1 (- (-> this miss-count) (-> this wave-start-miss))) (let ((v0-9 (rand-vu-int-count 7))) (cond ((zero? v0-9) @@ -2330,27 +2330,27 @@ ) ) ) - (set! (-> obj wave-start-miss) (-> obj miss-count)) + (set! (-> this wave-start-miss) (-> this miss-count)) ) (set! v0-18 - (when (>= (- (current-time) (-> obj event-time)) (the-as time-frame (-> obj event-length))) - (set! (-> obj event-time) (current-time)) - (let ((s4-14 (vector+! (new 'stack-no-clear 'vector) (-> obj root trans) (new 'static 'vector :w 1.0))) + (when (time-elapsed? (-> this event-time) (the-as time-frame (-> this event-length))) + (set-time! (-> this event-time)) + (let ((s4-14 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (new 'static 'vector :w 1.0))) (s3-12 (rand-vu-int-range (the-as int (-> s5-0 min-count)) (the-as int (-> s5-0 max-count)))) ) (dotimes (s2-12 s3-12) - (let ((f0-0 (-> obj last-angle))) - (while (< (fabs (- (-> obj last-angle) f0-0)) 819.2) + (let ((f0-0 (-> this last-angle))) + (while (< (fabs (- (-> this last-angle) f0-0)) 819.2) (set! f0-0 (rand-vu-float-range -1720.32 1720.32)) ) - (set! (-> obj last-angle) f0-0) + (set! (-> this last-angle) f0-0) ) (let ((s1-0 (get-process *default-dead-pool* onin-game-bubble #x4000))) (when s1-0 (let ((t9-31 (method-of-type onin-game-bubble activate))) (t9-31 (the-as onin-game-bubble s1-0) - obj + this (symbol->string (-> onin-game-bubble symbol)) (the-as pointer #x70004000) ) @@ -2361,7 +2361,7 @@ (set! sv-64 s4-14) (set! sv-80 (rand-vu-int-range 0 3)) (set! sv-96 (-> s5-0 gravity)) - (set! sv-112 (-> obj last-angle)) + (set! sv-112 (-> this last-angle)) (let ((t2-0 (rand-vu-float-range 4096.0 7372.8))) ((the-as (function object object object object object object object none) s0-0) sv-32 @@ -2380,43 +2380,43 @@ ) ) (set! v0-18 (rand-vu-int-range (the-as int (-> s5-0 min-event)) (the-as int (-> s5-0 max-event)))) - (set! (-> obj event-length) (the-as uint v0-18)) + (set! (-> this event-length) (the-as uint v0-18)) v0-18 ) ) ) ) (label cfg-58) - (onin-game-method-26 obj) + (onin-game-method-26 this) 0 (none) ) ;; definition for method 26 of type onin-game ;; WARN: Return type mismatch int vs none. -(defmethod onin-game-method-26 onin-game ((obj onin-game)) +(defmethod onin-game-method-26 onin-game ((this onin-game)) (cond - ((>= (-> *game-info* score) (-> obj score)) - (set! (-> *game-info* score) (-> obj score)) + ((>= (-> *game-info* score) (-> this score)) + (set! (-> *game-info* score) (-> this score)) ) - ((and (< (-> *game-info* score) (-> obj score)) (>= (- (current-time) (-> obj score-time)) (seconds 0.1))) + ((and (< (-> *game-info* score) (-> this score)) (time-elapsed? (-> this score-time) (seconds 0.1))) (sound-play "onin-score") - (seek! (-> *game-info* score) (-> obj score) 1.0) - (set! (-> obj score-time) (current-time)) + (seek! (-> *game-info* score) (-> this score) 1.0) + (set-time! (-> this score-time)) ) ) - (set! (-> *game-info* miss) (the float (-> obj miss-count))) + (set! (-> *game-info* miss) (the float (-> this miss-count))) 0 (none) ) ;; definition for method 27 of type onin-game ;; WARN: Return type mismatch number vs none. -(defmethod onin-game-method-27 onin-game ((obj onin-game) (arg0 int)) +(defmethod onin-game-method-27 onin-game ((this onin-game) (arg0 int)) "TODO - bubble type" (let ((s4-0 (the-as onin-game-bubble #f))) (let ((s3-0 0) - (s2-0 (-> obj child)) + (s2-0 (-> this child)) ) (while s2-0 (let* ((s1-0 (ppointer->process s2-0)) @@ -2437,24 +2437,24 @@ (s4-0 (when (send-event s4-0 'attack #f) (cond - ((= arg0 (-> obj last-type)) - (+! (-> obj current-bonus) (-> obj current-bonus)) - (if (>= (-> obj current-bonus) 16.0) - (set! (-> obj current-bonus) 16.0) + ((= arg0 (-> this last-type)) + (+! (-> this current-bonus) (-> this current-bonus)) + (if (>= (-> this current-bonus) 16.0) + (set! (-> this current-bonus) 16.0) ) ) (else - (set! (-> obj current-bonus) 1.0) + (set! (-> this current-bonus) 1.0) ) ) - (set! (-> obj last-type) arg0) - (+! (-> obj score) (-> obj current-bonus)) + (set! (-> this last-type) arg0) + (+! (-> this score) (-> this current-bonus)) ) ) (else (sound-play "onin-wrong") - (set! (-> obj last-type) -1) - (+! (-> obj miss-count) 1) + (set! (-> this last-type) -1) + (+! (-> this miss-count) 1) (let ((v1-20 (rand-vu-int-count 4))) (cond ((zero? v1-20) @@ -2565,7 +2565,7 @@ (set! (-> self hud-score) (ppointer->handle (process-spawn hud-big-score :init hud-init-by-other :to self))) (set! (-> self hud-goal) (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :to self))) (set! (-> self hud-miss) (ppointer->handle (process-spawn hud-miss :init hud-init-by-other :to self))) - (set! (-> self game-start-time) (current-time)) + (set-time! (-> self game-start-time)) (send-event *target* 'draw #f) (set-setting! 'gun #f 0.0 0) (set-setting! 'calm #t 0.0 0) @@ -2711,7 +2711,7 @@ :code (behavior ((arg0 symbol)) (ja-channel-set! 0) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -2809,7 +2809,7 @@ (not (task-node-closed? (game-task-node city-play-onin-game-skill))) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -2835,7 +2835,7 @@ (suspend) ) (let ((s5-3 (current-time))) - (until (>= (- (current-time) s5-3) (seconds 2)) + (until (time-elapsed? s5-3 (seconds 2)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/onintent/onintent-part_REF.gc b/test/decompiler/reference/jak2/levels/city/onintent/onintent-part_REF.gc index fb160a0b1f..dfae82bf6e 100644 --- a/test/decompiler/reference/jak2/levels/city/onintent/onintent-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/onintent/onintent-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type onintent-part -(defmethod inspect onintent-part ((obj onintent-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect onintent-part ((this onintent-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/oracle/oracle-part_REF.gc b/test/decompiler/reference/jak2/levels/city/oracle/oracle-part_REF.gc index 48a3e70e63..01594f3085 100644 --- a/test/decompiler/reference/jak2/levels/city/oracle/oracle-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/oracle/oracle-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type oracle-part -(defmethod inspect oracle-part ((obj oracle-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect oracle-part ((this oracle-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/oracle/oracle-scenes_REF.gc b/test/decompiler/reference/jak2/levels/city/oracle/oracle-scenes_REF.gc index 365a9f7e59..64985ec693 100644 --- a/test/decompiler/reference/jak2/levels/city/oracle/oracle-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/oracle/oracle-scenes_REF.gc @@ -831,24 +831,24 @@ ) ;; definition for method 3 of type oracle-npc -(defmethod inspect oracle-npc ((obj oracle-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect oracle-npc ((this oracle-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type oracle-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! oracle-npc ((obj oracle-npc)) +(defmethod init-art! oracle-npc ((this oracle-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sidekick-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -857,14 +857,14 @@ ) ;; definition for method 35 of type oracle-npc -(defmethod get-art-elem oracle-npc ((obj oracle-npc)) +(defmethod get-art-elem oracle-npc ((this oracle-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) - (let ((root-prim (-> obj root root-prim))) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) diff --git a/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc b/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc index 58d568d6cb..f825c0536f 100644 --- a/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/oracle/oracle-training_REF.gc @@ -210,7 +210,7 @@ (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) ) (send-event *target* 'get-notify self) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (none) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc b/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc index 90bc937247..68d205f26b 100644 --- a/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/package/delivery-task_REF.gc @@ -25,43 +25,43 @@ ) ;; definition for method 3 of type krew-package -(defmethod inspect krew-package ((obj krew-package)) - (when (not obj) - (set! obj obj) +(defmethod inspect krew-package ((this krew-package)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tattach-object: ~D~%" (-> obj attach-object)) - (format #t "~2Tscale: ~f~%" (-> obj scale)) + (format #t "~2Tattach-object: ~D~%" (-> this attach-object)) + (format #t "~2Tscale: ~f~%" (-> this scale)) (label cfg-4) - obj + this ) ;; definition for method 22 of type krew-package ;; WARN: Return type mismatch int vs none. -(defmethod krew-package-method-22 krew-package ((obj krew-package)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod krew-package-method-22 krew-package ((this krew-package)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) ;; definition for method 23 of type krew-package ;; WARN: Return type mismatch int vs none. -(defmethod krew-package-method-23 krew-package ((obj krew-package)) +(defmethod krew-package-method-23 krew-package ((this krew-package)) (with-pp (set! (-> pp level) (level-get *level* 'lpackage)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-krew-package" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj scale) 1.0) - (set! (-> obj draw lod-set lod 0 dist) 81920.0) - (set! (-> obj draw lod-set lod 1 dist) 204800.0) - (set! (-> obj draw lod-set lod 1 dist) 327680.0) - (logior! (-> obj skel status) (joint-control-status sync-math)) + (set! (-> this scale) 1.0) + (set! (-> this draw lod-set lod 0 dist) 81920.0) + (set! (-> this draw lod-set lod 1 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 327680.0) + (logior! (-> this skel status) (joint-control-status sync-math)) 0 (none) ) @@ -106,14 +106,14 @@ ;; definition for method 11 of type krew-package ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! krew-package ((obj krew-package) (arg0 entity-actor)) +(defmethod init-from-entity! krew-package ((this krew-package) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -546,8 +546,8 @@ This commonly includes things such as: (send-event *target* 'change-mode 'normal) ) (set-setting! 'pilot #f 0.0 0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (none) diff --git a/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc index d939501b5c..262f1048e5 100644 --- a/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/palace/ctypal-obs_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type water-anim-ctypal -(defmethod inspect water-anim-ctypal ((obj water-anim-ctypal)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-anim-ctypal ((this water-anim-ctypal)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol ripple-for-water-anim-ctypal, type ripple-wave-set @@ -53,19 +53,19 @@ ;; definition for method 24 of type water-anim-ctypal ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-ctypal ((obj water-anim-ctypal)) +(defmethod init-water! water-anim-ctypal ((this water-anim-ctypal)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) (set! (-> v1-2 waveform) ripple-for-water-anim-ctypal) - (case (-> obj look) + (case (-> this look) ((32 30) (set! (-> v1-2 waveform) ripple-ctypal-smlground-pool) ) @@ -90,28 +90,28 @@ ) ;; definition for method 3 of type palace-door -(defmethod inspect palace-door ((obj palace-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect palace-door ((this palace-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type palace-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! palace-door ((obj palace-door) (arg0 entity-actor)) +(defmethod init-from-entity! palace-door ((this palace-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -137,24 +137,24 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-palace-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj pre-open-frame) 48.0) - (set! (-> obj lock-frame) 60.0) - (set! (-> obj open-frame) 60.0) - (set! (-> obj sound-pre-open) (static-sound-spec "pal-door-open-1")) - (set! (-> obj sound-open) (static-sound-spec "pal-door-open-2")) - (set! (-> obj sound-close) (static-sound-spec "pal-door-close")) - (set! (-> obj sound-post-close) (static-sound-spec "pal-door-close2")) - (set! (-> obj sound-behind?) #t) - (set! (-> obj door-radius) 40960.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this pre-open-frame) 48.0) + (set! (-> this lock-frame) 60.0) + (set! (-> this open-frame) 60.0) + (set! (-> this sound-pre-open) (static-sound-spec "pal-door-open-1")) + (set! (-> this sound-open) (static-sound-spec "pal-door-open-2")) + (set! (-> this sound-close) (static-sound-spec "pal-door-close")) + (set! (-> this sound-post-close) (static-sound-spec "pal-door-close2")) + (set! (-> this sound-behind?) #t) + (set! (-> this door-radius) 40960.0) + (go (method-of-object this close) #t) (none) ) @@ -173,17 +173,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type ctypal-broke-wall -(defmethod inspect ctypal-broke-wall ((obj ctypal-broke-wall)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctypal-broke-wall ((this ctypal-broke-wall)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tent: ~A~%" (-> obj ent)) + (format #t "~2Tent: ~A~%" (-> this ent)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -219,15 +219,15 @@ This commonly includes things such as: ;; definition for method 11 of type ctypal-broke-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctypal-broke-wall ((obj ctypal-broke-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ctypal-broke-wall ((this ctypal-broke-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (format #t "~A initialising~%" (-> obj name)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (format #t "~A initialising~%" (-> this name)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -242,14 +242,14 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ctypal-broke-wall" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-10 (-> obj root))) + (let ((v1-10 (-> this root))) (format 0 "trans ~F ~F ~F~%" @@ -258,8 +258,8 @@ This commonly includes things such as: (* 0.00024414062 (-> v1-10 trans z)) ) ) - (set! (-> obj ent) arg0) - (go (method-of-object obj idle)) + (set! (-> this ent) arg0) + (go (method-of-object this idle)) (none) ) @@ -276,16 +276,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type ctypal-baron-statue-broken -(defmethod inspect ctypal-baron-statue-broken ((obj ctypal-baron-statue-broken)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctypal-baron-statue-broken ((this ctypal-baron-statue-broken)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -295,7 +295,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type ctypal-baron-statue-broken -(defmethod run-logic? ctypal-baron-statue-broken ((obj ctypal-baron-statue-broken)) +(defmethod run-logic? ctypal-baron-statue-broken ((this ctypal-baron-statue-broken)) #t ) @@ -307,17 +307,17 @@ This commonly includes things such as: ;; definition for method 11 of type ctypal-baron-statue-broken ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ctypal-baron-statue-broken ((obj ctypal-baron-statue-broken) (arg0 entity-actor)) +(defmethod init-from-entity! ctypal-baron-statue-broken ((this ctypal-baron-statue-broken) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ctypal-baron-statue-broken" (the-as (pointer uint32) #f)) @@ -325,9 +325,9 @@ This commonly includes things such as: (the-as pair 0) ) (if (not (task-node-closed? (game-task-node canyon-insert-items-resolution))) - (logior! (-> obj draw status) (draw-control-status no-draw)) + (logior! (-> this draw status) (draw-control-status no-draw)) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/palace/ctypal-part_REF.gc b/test/decompiler/reference/jak2/levels/city/palace/ctypal-part_REF.gc index d4d4f97bab..a31945093a 100644 --- a/test/decompiler/reference/jak2/levels/city/palace/ctypal-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/palace/ctypal-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctypal-part -(defmethod inspect ctypal-part ((obj ctypal-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctypal-part ((this ctypal-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc b/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc index 694280bf6d..31b0a8d33b 100644 --- a/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/ctyport-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctyport-part -(defmethod inspect ctyport-part ((obj ctyport-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyport-part ((this ctyport-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3556,61 +3556,61 @@ ) ;; definition for method 3 of type hiphog-exterior-marquee -(defmethod inspect hiphog-exterior-marquee ((obj hiphog-exterior-marquee)) - (when (not obj) - (set! obj obj) +(defmethod inspect hiphog-exterior-marquee ((this hiphog-exterior-marquee)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trot: ~`vector`P~%" (-> obj rot)) - (format #t "~2Tmaster-enable: ~D~%" (-> obj master-enable)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tmode: ~D~%" (-> obj mode)) - (format #t "~2Tcounter: ~D~%" (-> obj counter)) - (format #t "~2Tparts[1] @ #x~X~%" (-> obj parts)) + (format #t "~2Trot: ~`vector`P~%" (-> this rot)) + (format #t "~2Tmaster-enable: ~D~%" (-> this master-enable)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tmode: ~D~%" (-> this mode)) + (format #t "~2Tcounter: ~D~%" (-> this counter)) + (format #t "~2Tparts[1] @ #x~X~%" (-> this parts)) (label cfg-4) - obj + this ) ;; definition for method 10 of type hiphog-exterior-marquee -(defmethod deactivate hiphog-exterior-marquee ((obj hiphog-exterior-marquee)) +(defmethod deactivate hiphog-exterior-marquee ((this hiphog-exterior-marquee)) (dotimes (s5-0 1) - (let ((a0-1 (-> obj parts s5-0))) + (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type hiphog-exterior-marquee ;; WARN: Return type mismatch process-drawable vs hiphog-exterior-marquee. -(defmethod relocate hiphog-exterior-marquee ((obj hiphog-exterior-marquee) (arg0 int)) +(defmethod relocate hiphog-exterior-marquee ((this hiphog-exterior-marquee) (arg0 int)) (dotimes (v1-0 1) - (if (nonzero? (-> obj parts v1-0)) - (&+! (-> obj parts v1-0) arg0) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) arg0) ) ) - (the-as hiphog-exterior-marquee ((method-of-type process-drawable relocate) obj arg0)) + (the-as hiphog-exterior-marquee ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 21 of type hiphog-exterior-marquee ;; WARN: Return type mismatch symbol vs none. -(defmethod hiphog-exterior-marquee-method-21 hiphog-exterior-marquee ((obj hiphog-exterior-marquee)) - (+! (-> obj parts 0 state-counter) 1) - (when (!= (-> obj parts 0 state-mode 0) (-> obj mode)) - (set! (-> obj parts 0 state-mode 0) (-> obj mode)) - (set! (-> obj parts 0 state-counter) (the-as uint 0)) +(defmethod hiphog-exterior-marquee-method-21 hiphog-exterior-marquee ((this hiphog-exterior-marquee)) + (+! (-> this parts 0 state-counter) 1) + (when (!= (-> this parts 0 state-mode 0) (-> this mode)) + (set! (-> this parts 0 state-mode 0) (-> this mode)) + (set! (-> this parts 0 state-counter) (the-as uint 0)) 0 ) - (let ((s5-0 (-> obj master-enable))) + (let ((s5-0 (-> this master-enable))) (dotimes (s4-0 1) (if (logtest? s5-0 1) - (spawn (-> obj parts s4-0) (-> obj root trans)) + (spawn (-> this parts s4-0) (-> this root trans)) ) (set! s5-0 (shr s5-0 1)) ) @@ -3649,19 +3649,19 @@ ;; definition for method 11 of type hiphog-exterior-marquee ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hiphog-exterior-marquee ((obj hiphog-exterior-marquee) (arg0 entity-actor)) +(defmethod init-from-entity! hiphog-exterior-marquee ((this hiphog-exterior-marquee) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause enemy)) - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj master-enable) (the-as uint -1)) - (set! (-> obj mode) (the-as uint (rand-vu-int-count 8))) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause enemy)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this master-enable) (the-as uint -1)) + (set! (-> this mode) (the-as uint (rand-vu-int-count 8))) (let ((s5-1 (if (task-node-closed? (game-task-node nest-boss-resolution)) *hiphog-exterior-marquee-daxter-group-ids* *hiphog-exterior-marquee-group-ids* @@ -3669,10 +3669,10 @@ This commonly includes things such as: ) ) (dotimes (s4-0 1) - (set! (-> obj parts s4-0) (create-launch-control (-> *part-group-id-table* (-> s5-1 s4-0)) obj)) + (set! (-> this parts s4-0) (create-launch-control (-> *part-group-id-table* (-> s5-1 s4-0)) this)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3738,16 +3738,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type farthy -(defmethod inspect farthy ((obj farthy)) - (when (not obj) - (set! obj obj) +(defmethod inspect farthy ((this farthy)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3786,34 +3786,34 @@ This commonly includes things such as: ;; definition for method 11 of type farthy ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! farthy ((obj farthy) (arg0 entity-actor)) +(defmethod init-from-entity! farthy ((this farthy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj root pause-adjust-distance) 1228800.0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this root pause-adjust-distance) 1228800.0) (cond ((task-node-closed? (game-task-node nest-boss-resolution)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mecha-daxter" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) (else (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-farthy" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 969) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 969) this)) ) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc b/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc index d0a2a77e2b..27fe8ee259 100644 --- a/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/portrun/portrun_REF.gc @@ -191,43 +191,43 @@ ;; definition for method 15 of type hud-cargo ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-cargo ((obj hud-cargo)) +(defmethod draw hud-cargo ((this hud-cargo)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 205 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 27) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -19 27) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-cargo ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-cargo ((obj hud-cargo)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-cargo ((this hud-cargo)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-cargo ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-cargo ((obj hud-cargo)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-cargo ((this hud-cargo)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x679))) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x679))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -239,11 +239,11 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) - (while (or (< (- (current-time) (-> self state-time)) (seconds 30)) + (set-time! (-> self state-time)) + (while (or (not (time-elapsed? (-> self state-time) (seconds 30))) (let ((a0-3 (level-get-target-inside *level*))) (when (not (and a0-3 (logtest? (-> a0-3 info level-flags) 1))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) #t ) ) @@ -279,28 +279,28 @@ ) ;; definition for method 3 of type city-port-run-mine-info -(defmethod inspect city-port-run-mine-info ((obj city-port-run-mine-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-port-run-mine-info ((this city-port-run-mine-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-port-run-mine-info) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tpos1-x: ~f~%" (-> obj pos1-x)) - (format #t "~1Tpos1-y: ~f~%" (-> obj pos1-y)) - (format #t "~1Tpos1-z: ~f~%" (-> obj pos1-z)) - (format #t "~1Ttype: ~D~%" (-> obj type)) - (format #t "~1Tpos2-x: ~f~%" (-> obj pos2-x)) - (format #t "~1Tpos2-y: ~f~%" (-> obj pos2-y)) - (format #t "~1Tpos2-z: ~f~%" (-> obj pos2-z)) - (format #t "~1Tspeed: ~f~%" (-> obj speed)) - (format #t "~1Toffset: ~f~%" (-> obj offset)) - (format #t "~1Tcenter-x: ~f~%" (-> obj pos1-x)) - (format #t "~1Tcenter-y: ~f~%" (-> obj pos1-y)) - (format #t "~1Tcenter-z: ~f~%" (-> obj pos1-z)) - (format #t "~1Tradius: ~f~%" (-> obj pos2-x)) + (format #t "[~8x] ~A~%" this 'city-port-run-mine-info) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tpos1-x: ~f~%" (-> this pos1-x)) + (format #t "~1Tpos1-y: ~f~%" (-> this pos1-y)) + (format #t "~1Tpos1-z: ~f~%" (-> this pos1-z)) + (format #t "~1Ttype: ~D~%" (-> this type)) + (format #t "~1Tpos2-x: ~f~%" (-> this pos2-x)) + (format #t "~1Tpos2-y: ~f~%" (-> this pos2-y)) + (format #t "~1Tpos2-z: ~f~%" (-> this pos2-z)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Toffset: ~f~%" (-> this offset)) + (format #t "~1Tcenter-x: ~f~%" (-> this pos1-x)) + (format #t "~1Tcenter-y: ~f~%" (-> this pos1-y)) + (format #t "~1Tcenter-z: ~f~%" (-> this pos1-z)) + (format #t "~1Tradius: ~f~%" (-> this pos2-x)) (label cfg-4) - obj + this ) ;; definition for symbol *city-port-run-mine-info*, type (array city-port-run-mine-info) @@ -903,32 +903,32 @@ ) ;; definition for method 3 of type ctyport-mine -(defmethod inspect ctyport-mine ((obj ctyport-mine)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyport-mine ((this ctyport-mine)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: #~%" (-> obj info)) - (format #t "~2Tbase-height: ~f~%" (-> obj base-height)) - (format #t "~2Tcenter: #~%" (-> obj center)) - (format #t "~2Ttime-skew: ~D~%" (-> obj time-skew)) - (format #t "~2Tperiod: ~f~%" (-> obj period)) - (format #t "~2Ttrans-y: ~f~%" (-> obj trans-y)) - (format #t "~2Tspeed-y: ~f~%" (-> obj speed-y)) - (format #t "~2Tacc-y: ~f~%" (-> obj acc-y)) - (format #t "~2Tbeep: ~A~%" (-> obj beep)) - (format #t "~2Tbeep-time: ~D~%" (-> obj beep-time)) - (format #t "~2Tbeep-color: #~%" (-> obj beep-color)) + (format #t "~2Tinfo: #~%" (-> this info)) + (format #t "~2Tbase-height: ~f~%" (-> this base-height)) + (format #t "~2Tcenter: #~%" (-> this center)) + (format #t "~2Ttime-skew: ~D~%" (-> this time-skew)) + (format #t "~2Tperiod: ~f~%" (-> this period)) + (format #t "~2Ttrans-y: ~f~%" (-> this trans-y)) + (format #t "~2Tspeed-y: ~f~%" (-> this speed-y)) + (format #t "~2Tacc-y: ~f~%" (-> this acc-y)) + (format #t "~2Tbeep: ~A~%" (-> this beep)) + (format #t "~2Tbeep-time: ~D~%" (-> this beep-time)) + (format #t "~2Tbeep-color: #~%" (-> this beep-color)) (label cfg-4) - obj + this ) ;; definition for method 23 of type ctyport-mine ;; WARN: Return type mismatch float vs none. -(defmethod ctyport-mine-method-23 ctyport-mine ((obj ctyport-mine)) +(defmethod ctyport-mine-method-23 ctyport-mine ((this ctyport-mine)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -938,17 +938,17 @@ ) (init-vf0-vector) (get-base-height *ocean-map-city*) - (let ((f0-1 (-> obj period)) + (let ((f0-1 (-> this period)) (t9-1 sin-rad) (f1-0 -3.1415925) (f2-0 6.283185) - (f3-1 (the float (+ (current-time) (the-as time-frame (-> obj time-skew))))) + (f3-1 (the float (+ (current-time) (the-as time-frame (-> this time-skew))))) ) (t9-1 (+ f1-0 (* f2-0 (/ (- f3-1 (* (the float (the int (/ f3-1 f0-1))) f0-1)) f0-1)))) ) - (let ((s5-0 (-> obj info))) + (let ((s5-0 (-> this info))) (cond - ((zero? (-> obj info type)) + ((zero? (-> this info type)) (let* ((f0-8 (+ (* 2.0 (-> s5-0 offset)) (/ (* 0.0033333334 (the float (current-time))) (-> s5-0 speed)))) (f0-9 (- f0-8 (* (the float (the int (/ f0-8 2.0))) 2.0))) ) @@ -956,7 +956,7 @@ (set! f0-9 (- 2.0 f0-9)) ) (let ((f0-13 (* 0.5 (- 1.0 (cos (* 32768.0 f0-9)))))) - (let ((v1-23 (-> obj root trans)) + (let ((v1-23 (-> this root trans)) (a0-5 (new 'stack-no-clear 'vector)) ) (set! (-> a0-5 x) (-> s5-0 pos1-x)) @@ -965,8 +965,8 @@ (set! (-> a0-5 w) 1.0) (vector-float*! v1-23 a0-5 f0-13) ) - (let ((s4-0 (-> obj root trans))) - (let ((v1-27 (-> obj root trans))) + (let ((s4-0 (-> this root trans))) + (let ((v1-27 (-> this root trans))) (let ((a0-6 (new 'stack-no-clear 'vector))) (set! (-> a0-6 x) (-> s5-0 pos2-x)) (set! (-> a0-6 y) (-> s5-0 pos2-y)) @@ -988,7 +988,7 @@ ) ) (else - (let ((s4-1 (-> obj root trans))) + (let ((s4-1 (-> this root trans))) (let ((s3-0 (new 'stack-no-clear 'vector))) (set! (-> s3-0 x) (-> s5-0 pos1-x)) (set! (-> s3-0 y) (-> s5-0 pos1-y)) @@ -1017,13 +1017,13 @@ ) ) ) - (+! (-> obj speed-y) - (* 10.0 (seconds-per-frame) (- (get-height *ocean* (-> obj root trans) #t) (-> obj trans-y))) + (+! (-> this speed-y) + (* 10.0 (seconds-per-frame) (- (get-height *ocean* (-> this root trans) #t) (-> this trans-y))) ) - (set! (-> obj speed-y) (- (-> obj speed-y) (* (-> obj speed-y) (seconds-per-frame)))) - (set! (-> obj speed-y) (- (-> obj speed-y) (* 4096.0 (seconds-per-frame)))) - (+! (-> obj trans-y) (* (-> obj speed-y) (seconds-per-frame))) - (set! (-> obj root trans y) (+ 2048.0 (-> obj trans-y))) + (set! (-> this speed-y) (- (-> this speed-y) (* (-> this speed-y) (seconds-per-frame)))) + (set! (-> this speed-y) (- (-> this speed-y) (* 4096.0 (seconds-per-frame)))) + (+! (-> this trans-y) (* (-> this speed-y) (seconds-per-frame))) + (set! (-> this root trans y) (+ 2048.0 (-> this trans-y))) (none) ) ) @@ -1032,13 +1032,13 @@ (defstate die (ctyport-mine) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self beep-time) 0) 0 ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 3)) + (until (time-elapsed? gp-0 (seconds 3)) (suspend) ) ) @@ -1046,7 +1046,7 @@ ) :post (behavior () (cond - ((and (-> self beep) (< (- (current-time) (-> self state-time)) (seconds 1))) + ((and (-> self beep) (not (time-elapsed? (-> self state-time) (seconds 1)))) (vector-seek! (-> self beep-color) *null-vector* (* 4.0 (seconds-per-frame))) (when (< (-> self beep-time) (current-time)) (sound-play "cargo-beep") @@ -1257,17 +1257,17 @@ ) ;; definition for method 3 of type ctyport-spy -(defmethod inspect ctyport-spy ((obj ctyport-spy)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyport-spy ((this ctyport-spy)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttrans-y: ~f~%" (-> obj trans-y)) + (format #t "~2Ttrans-y: ~f~%" (-> this trans-y)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1280,10 +1280,10 @@ (defstate idle (ctyport-spy) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.3)) + (when (time-elapsed? (-> self state-time) (seconds 0.3)) (+! (-> self trans-y) (* (-> self root transv y) (seconds-per-frame))) (+! (-> self root transv y) (* -8.0 (seconds-per-frame) (-> self root transv y))) (set! (-> self root trans y) @@ -1375,19 +1375,19 @@ ) ;; definition for method 3 of type ctyport-cargo -(defmethod inspect ctyport-cargo ((obj ctyport-cargo)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyport-cargo ((this ctyport-cargo)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tminimap: #~%" (-> obj minimap)) - (format #t "~2Ttrans-y: ~f~%" (-> obj trans-y)) - (format #t "~2Tspeed-y: ~f~%" (-> obj speed-y)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Ttrans-y: ~f~%" (-> this trans-y)) + (format #t "~2Tspeed-y: ~f~%" (-> this speed-y)) (label cfg-4) - obj + this ) ;; definition for symbol *city-port-position*, type vector @@ -1548,10 +1548,10 @@ ;; definition for method 30 of type ctyport-cargo ;; WARN: Return type mismatch int vs none. -(defmethod ctyport-cargo-method-30 ctyport-cargo ((obj ctyport-cargo)) - (send-event *camera* 'change-target obj) +(defmethod ctyport-cargo-method-30 ctyport-cargo ((this ctyport-cargo)) + (send-event *camera* 'change-target this) (let ((gp-0 (new 'stack 'transformq))) - (vector+! (-> gp-0 trans) (-> obj root trans) (new 'static 'vector :y 16384.0 :z 28672.0 :w 1.0)) + (vector+! (-> gp-0 trans) (-> this root trans) (new 'static 'vector :y 16384.0 :z 28672.0 :w 1.0)) (set-vector! (-> gp-0 scale) 1.0 1.0 1.0 1.0) (quaternion-zxy! (-> gp-0 quat) (new 'static 'vector :x 1820.4445 :y 32768.0 :w 1.0)) (send-event *camera* 'teleport-to-transformq gp-0) @@ -1601,7 +1601,7 @@ :virtual #t :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1693,15 +1693,15 @@ ) ;; definition for method 3 of type city-port-run-cargo-info -(defmethod inspect city-port-run-cargo-info ((obj city-port-run-cargo-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-port-run-cargo-info ((this city-port-run-cargo-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-port-run-cargo-info) - (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this 'city-port-run-cargo-info) + (format #t "~1Tpos: #~%" (-> this pos)) (label cfg-4) - obj + this ) ;; definition for symbol *city-port-run-cargo-info*, type (array city-port-run-cargo-info) @@ -1889,7 +1889,7 @@ ) (cond ((and (= (-> self count) (-> self max-count)) (zero? (-> self data-int32 22))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ((and (or (and (zero? (-> self data-int32 20)) (= (-> self count) (+ (-> self max-count) -1))) (= (-> self data-int32 22) 1) @@ -1900,7 +1900,7 @@ (set! (-> self data-int32 20) 1) (+! (-> self data-int32 22) 1) (set! (-> self time-limit) (seconds 135)) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-cargo :init hud-init-by-other :to self))) ) ) @@ -1975,8 +1975,8 @@ (lambda :behavior task-manager () (send-event *traffic-manager* 'set-target-level 1.0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (send-event *traffic-manager* 'set-alert-level 1) @@ -2014,7 +2014,7 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 2)) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) @@ -2030,8 +2030,8 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (suspend) ) (task-node-close! (game-task-node city-port-run-post-win)) diff --git a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc index 775f3addbb..07faa2a0cf 100644 --- a/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/port/race/errol-chal_REF.gc @@ -398,17 +398,17 @@ ) ;; definition for method 3 of type errol-racer -(defmethod inspect errol-racer ((obj errol-racer)) - (when (not obj) - (set! obj obj) +(defmethod inspect errol-racer ((this errol-racer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-rider inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tminimap: #~%" (-> obj minimap)) + (format #t "~2Tminimap: #~%" (-> this minimap)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -419,31 +419,31 @@ ;; definition for method 31 of type errol-racer ;; WARN: Return type mismatch int vs none. -(defmethod initialize-collision errol-racer ((obj errol-racer)) - (set! (-> obj level) (level-get *level* 'lerlchal)) - (stack-size-set! (-> obj main-thread) 256) - (when (not (-> obj level)) +(defmethod initialize-collision errol-racer ((this errol-racer)) + (set! (-> this level) (level-get *level* 'lerlchal)) + (stack-size-set! (-> this main-thread) 256) + (when (not (-> this level)) (format 0 "errol-racer::initialize-collision: ERROR, no lerlchal level~%") (go process-drawable-art-error "no lerlchal level") ) - (set! (-> obj root) (the-as collide-shape (new 'process 'trsqv))) + (set! (-> this root) (the-as collide-shape (new 'process 'trsqv))) 0 (none) ) ;; definition for method 32 of type errol-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-32 errol-racer ((obj errol-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 errol-racer ((this errol-racer) (arg0 traffic-object-spawn-params)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-errol-racer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj flags) 1) - (set! (-> obj draw lod-set lod 0 dist) 286720.0) - (vehicle-rider-method-33 obj) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 38) (the-as int #f) (the-as vector #t) 0)) - (set! (-> obj riding-anim) 4) + (logior! (-> this flags) 1) + (set! (-> this draw lod-set lod 0 dist) 286720.0) + (vehicle-rider-method-33 this) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 38) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this riding-anim) 4) 0 (none) ) @@ -506,34 +506,34 @@ ) ;; definition for method 3 of type vehicle-city-racer -(defmethod inspect vehicle-city-racer ((obj vehicle-city-racer)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-city-racer ((this vehicle-city-racer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-racer inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 117 of type vehicle-city-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-117 vehicle-city-racer ((obj vehicle-city-racer) (arg0 vector) (arg1 int) (arg2 int)) - ((method-of-type vehicle vehicle-method-117) obj arg0 arg1 arg2) +(defmethod vehicle-method-117 vehicle-city-racer ((this vehicle-city-racer) (arg0 vector) (arg1 int) (arg2 int)) + ((method-of-type vehicle vehicle-method-117) this arg0 arg1 arg2) 0 (none) ) ;; definition for method 137 of type vehicle-city-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-137 vehicle-city-racer ((obj vehicle-city-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 vehicle-city-racer ((this vehicle-city-racer) (arg0 traffic-object-spawn-params)) (let ((t9-0 vehicle-rider-spawn) (v1-0 (-> arg0 user-data)) ) (t9-0 - obj + this (if (= v1-0 2) errol-racer citizen-norm-rider @@ -547,33 +547,33 @@ ;; definition for method 154 of type vehicle-city-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-racer-method-154 vehicle-city-racer ((obj vehicle-city-racer)) +(defmethod vehicle-racer-method-154 vehicle-city-racer ((this vehicle-city-racer)) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (let ((f0-0 368640.0)) - (if (or (< (* f0-0 f0-0) (-> obj player-dist2)) + (if (or (< (* f0-0 f0-0) (-> this player-dist2)) (let ((f0-3 102400.0)) - (and (< (* f0-3 f0-3) (-> obj player-dist2)) - (not (logtest? (-> obj draw status) (draw-control-status on-screen))) + (and (< (* f0-3 f0-3) (-> this player-dist2)) + (not (logtest? (-> this draw status) (draw-control-status on-screen))) ) ) ) - (rigid-body-object-method-39 obj) + (rigid-body-object-method-39 this) ) ) ) (else - (let ((f0-6 (-> obj player-dist2)) + (let ((f0-6 (-> this player-dist2)) (f1-2 348160.0) ) (if (and (< f0-6 (* f1-2 f1-2)) - (let ((f0-7 (-> obj player-dist2)) + (let ((f0-7 (-> this player-dist2)) (f1-5 81920.0) ) - (or (< f0-7 (* f1-5 f1-5)) (logtest? (-> obj draw status) (draw-control-status on-screen))) + (or (< f0-7 (* f1-5 f1-5)) (logtest? (-> this draw status) (draw-control-status on-screen))) ) ) - (rigid-body-object-method-38 obj) + (rigid-body-object-method-38 this) ) ) ) @@ -592,28 +592,28 @@ ) ;; definition for method 3 of type race-bike-a -(defmethod inspect race-bike-a ((obj race-bike-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-bike-a ((this race-bike-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-city-racer inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 7 of type race-bike-a ;; WARN: Return type mismatch vehicle-city-racer vs race-bike-a. -(defmethod relocate race-bike-a ((obj race-bike-a) (arg0 int)) - (the-as race-bike-a ((method-of-type vehicle-city-racer relocate) obj arg0)) +(defmethod relocate race-bike-a ((this race-bike-a) (arg0 int)) + (the-as race-bike-a ((method-of-type vehicle-city-racer relocate) this arg0)) ) ;; definition for method 32 of type race-bike-a ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape race-bike-a ((obj race-bike-a)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape race-bike-a ((this race-bike-a)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -659,7 +659,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -667,15 +667,15 @@ ;; definition for method 33 of type race-bike-a ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body race-bike-a ((obj race-bike-a)) +(defmethod init-skel-and-rigid-body race-bike-a ((this race-bike-a)) (lwide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj rider-hand-joint) 0) - (alloc-and-init-rigid-body-control obj *race-bike-a-constants*) + (set! (-> this rider-hand-joint) 0) + (alloc-and-init-rigid-body-control this *race-bike-a-constants*) 0 (none) ) @@ -690,28 +690,28 @@ ) ;; definition for method 3 of type race-bike-b -(defmethod inspect race-bike-b ((obj race-bike-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-bike-b ((this race-bike-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-city-racer inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 7 of type race-bike-b ;; WARN: Return type mismatch vehicle-racer vs race-bike-b. -(defmethod relocate race-bike-b ((obj race-bike-b) (arg0 int)) - (the-as race-bike-b ((method-of-type vehicle-racer relocate) obj arg0)) +(defmethod relocate race-bike-b ((this race-bike-b) (arg0 int)) + (the-as race-bike-b ((method-of-type vehicle-racer relocate) this arg0)) ) ;; definition for method 32 of type race-bike-b ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape race-bike-b ((obj race-bike-b)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape race-bike-b ((this race-bike-b)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -757,7 +757,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -765,15 +765,15 @@ ;; definition for method 33 of type race-bike-b ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body race-bike-b ((obj race-bike-b)) +(defmethod init-skel-and-rigid-body race-bike-b ((this race-bike-b)) (lwide-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikeb" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj rider-hand-joint) 0) - (alloc-and-init-rigid-body-control obj *race-bike-b-constants*) + (set! (-> this rider-hand-joint) 0) + (alloc-and-init-rigid-body-control this *race-bike-b-constants*) 0 (none) ) @@ -805,25 +805,25 @@ ) ;; definition for method 3 of type turbo-ring -(defmethod inspect turbo-ring ((obj turbo-ring)) - (when (not obj) - (set! obj obj) +(defmethod inspect turbo-ring ((this turbo-ring)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttouch-time: ~D~%" (-> obj touch-time)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) - (format #t "~2Tplayer-got: ~A~%" (-> obj player-got)) - (format #t "~2Tpersistent: ~A~%" (-> obj persistent)) - (format #t "~2Tid: ~D~%" (-> obj id)) - (format #t "~2Tboost: ~f~%" (-> obj boost)) - (format #t "~2Tplane: #~%" (-> obj plane)) - (format #t "~2Tpart-track: ~D~%" (-> obj part-track)) - (format #t "~2Tmat: #~%" (-> obj mat)) + (format #t "~2Ttouch-time: ~D~%" (-> this touch-time)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tplayer-got: ~A~%" (-> this player-got)) + (format #t "~2Tpersistent: ~A~%" (-> this persistent)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Tboost: ~f~%" (-> this boost)) + (format #t "~2Tplane: #~%" (-> this plane)) + (format #t "~2Tpart-track: ~D~%" (-> this part-track)) + (format #t "~2Tmat: #~%" (-> this mat)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -856,7 +856,7 @@ (when (< f0-5 (* f1-0 f1-0)) (when (or (and (< f30-0 0.0) (>= f28-0 0.0)) (and (< f28-0 0.0) (>= f30-0 0.0))) (send-event proc 'turbo-ring (-> self boost)) - (set! (-> self touch-time) (current-time)) + (set-time! (-> self touch-time)) (process-spawn part-tracker :init part-tracker-init @@ -887,7 +887,7 @@ :code sleep-code :post (behavior () (if (and (-> self player-got) - (>= (- (current-time) (-> self touch-time)) (seconds 3)) + (time-elapsed? (-> self touch-time) (seconds 3)) (or (not *target*) (or (< 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) (focus-test? *target* teleporting) ) @@ -905,13 +905,13 @@ (defstate die (turbo-ring) :virtual #t :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-3 (-> self root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) 0 - (until (>= (- (current-time) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (suspend) ) ) @@ -919,8 +919,8 @@ ;; definition for method 22 of type turbo-ring ;; WARN: Return type mismatch int vs none. -(defmethod turbo-ring-method-22 turbo-ring ((obj turbo-ring)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod turbo-ring-method-22 turbo-ring ((this turbo-ring)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrate-using) (the-as penetrate -1)) (set! (-> s5-0 penetrated-by) (the-as penetrate -1)) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) @@ -935,7 +935,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-7 prim-core collide-with)) ) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -944,23 +944,23 @@ ;; definition for method 23 of type turbo-ring ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod turbo-ring-method-23 turbo-ring ((obj turbo-ring)) - (let ((s5-0 (-> obj mat))) +(defmethod turbo-ring-method-23 turbo-ring ((this turbo-ring)) + (let ((s5-0 (-> this mat))) (let ((s4-0 (new 'stack-no-clear 'quaternion))) - (quaternion-rotate-local-y! s4-0 (-> obj root quat) 16384.0) + (quaternion-rotate-local-y! s4-0 (-> this root quat) 16384.0) (quaternion->matrix s5-0 s4-0) ) - (set! (-> s5-0 trans quad) (-> obj root trans quad)) - (set! (-> obj plane quad) (-> s5-0 vector 0 quad)) + (set! (-> s5-0 trans quad) (-> this root trans quad)) + (set! (-> this plane quad) (-> s5-0 vector 0 quad)) ) - (set! (-> obj plane w) (- (vector-dot (-> obj plane) (-> obj root trans)))) - (update-transforms (-> obj root)) - (set! (-> obj player-got) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1058) obj)) - (if (not (-> obj persistent)) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 15) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this plane w) (- (vector-dot (-> this plane) (-> this root trans)))) + (update-transforms (-> this root)) + (set! (-> this player-got) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1058) this)) + (if (not (-> this persistent)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 15) (the-as int #f) (the-as vector #t) 0)) ) - (set! (-> obj touch-time) (current-time)) + (set-time! (-> this touch-time)) 0 (none) ) @@ -1340,7 +1340,7 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while (not (logtest? (-> *race-state* flags) (race-flags begun))) (let ((f0-0 (-> self begin-pos w))) (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) @@ -1548,7 +1548,7 @@ TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while (not (logtest? (-> *race-state* flags) (race-flags begun))) (let ((f0-0 (-> self begin-pos w))) (if (< (* f0-0 f0-0) (vector-vector-distance-squared (-> self begin-pos) (target-pos 0))) diff --git a/test/decompiler/reference/jak2/levels/city/power/ctypower_REF.gc b/test/decompiler/reference/jak2/levels/city/power/ctypower_REF.gc index 16b00e8e4d..cfced2d22d 100644 --- a/test/decompiler/reference/jak2/levels/city/power/ctypower_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/power/ctypower_REF.gc @@ -3,43 +3,43 @@ ;; definition for method 15 of type hud-turret ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-turret ((obj hud-turret)) +(defmethod draw hud-turret ((this hud-turret)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 205 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -19 22) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -19 22) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-turret ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-turret ((obj hud-turret)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-turret ((this hud-turret)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-turret ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-turret ((obj hud-turret)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-turret ((this hud-turret)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x679))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x679))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -117,7 +117,7 @@ ) ) (if (= (-> self count) (-> self max-count)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (set! (-> *game-info* counter) (the float (-> self count))) ) @@ -158,8 +158,8 @@ () (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-turret :init hud-init-by-other :to self))) (send-event *traffic-manager* 'set-target-level 1.0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (send-event *traffic-manager* 'set-alert-level 1) @@ -193,8 +193,8 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (suspend) ) (task-node-close! (game-task-node city-power-post-win)) diff --git a/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc b/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc index 793434f5da..f86fc3706e 100644 --- a/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/protect/protect_REF.gc @@ -26,42 +26,42 @@ ) ;; definition for method 3 of type seal-of-mar -(defmethod inspect seal-of-mar ((obj seal-of-mar)) - (when (not obj) - (set! obj obj) +(defmethod inspect seal-of-mar ((this seal-of-mar)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tattach-object: ~D~%" (-> obj attach-object)) - (format #t "~2Tscale: ~f~%" (-> obj scale)) - (format #t "~2Ttrans-y: ~f~%" (-> obj trans-y)) + (format #t "~2Tattach-object: ~D~%" (-> this attach-object)) + (format #t "~2Tscale: ~f~%" (-> this scale)) + (format #t "~2Ttrans-y: ~f~%" (-> this trans-y)) (label cfg-4) - obj + this ) ;; definition for method 22 of type seal-of-mar ;; WARN: Return type mismatch int vs none. -(defmethod seal-of-mar-method-22 seal-of-mar ((obj seal-of-mar)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod seal-of-mar-method-22 seal-of-mar ((this seal-of-mar)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) ;; definition for method 23 of type seal-of-mar ;; WARN: Return type mismatch int vs none. -(defmethod seal-of-mar-method-23 seal-of-mar ((obj seal-of-mar)) +(defmethod seal-of-mar-method-23 seal-of-mar ((this seal-of-mar)) (with-pp (set! (-> pp level) (level-get *level* 'lprotect)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-seal-of-mar-game" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw force-lod) 0) - (set! (-> obj scale) 1.0) - (set! (-> obj draw lod-set lod 0 dist) 409600.0) + (set! (-> this draw force-lod) 0) + (set! (-> this scale) 1.0) + (set! (-> this draw lod-set lod 0 dist) 409600.0) 0 (none) ) @@ -87,14 +87,14 @@ ;; definition for method 11 of type seal-of-mar ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! seal-of-mar ((obj seal-of-mar) (arg0 entity-actor)) +(defmethod init-from-entity! seal-of-mar ((this seal-of-mar) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -138,21 +138,21 @@ This commonly includes things such as: ) ;; definition for method 3 of type city-slums-transport-info -(defmethod inspect city-slums-transport-info ((obj city-slums-transport-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-slums-transport-info ((this city-slums-transport-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-slums-transport-info) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tspawned: ~A~%" (-> obj spawned)) - (format #t "~1Tplane-pos: #~%" (-> obj plane-pos)) - (format #t "~1Tplane-quat: #~%" (-> obj plane-quat)) - (format #t "~1Tt-pos: #~%" (-> obj t-pos)) - (format #t "~1Tt-quat: #~%" (-> obj t-quat)) - (format #t "~1Tnum-guard: ~D~%" (-> obj num-guard)) + (format #t "[~8x] ~A~%" this 'city-slums-transport-info) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tspawned: ~A~%" (-> this spawned)) + (format #t "~1Tplane-pos: #~%" (-> this plane-pos)) + (format #t "~1Tplane-quat: #~%" (-> this plane-quat)) + (format #t "~1Tt-pos: #~%" (-> this t-pos)) + (format #t "~1Tt-quat: #~%" (-> this t-quat)) + (format #t "~1Tnum-guard: ~D~%" (-> this num-guard)) (label cfg-4) - obj + this ) ;; definition for symbol *city-slums-transport-info*, type (array city-slums-transport-info) @@ -572,8 +572,8 @@ This commonly includes things such as: (lambda :behavior task-manager () (send-event (handle->process (-> self arrow)) 'leave) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (talker-spawn-func (-> *talker-speech* 185) *entity-pool* (target-pos 0) (the-as region #f)) diff --git a/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc b/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc index c465244f87..ec52aea57f 100644 --- a/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/sack/collection-task_REF.gc @@ -3,43 +3,43 @@ ;; definition for method 15 of type hud-moneybag ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-moneybag ((obj hud-moneybag)) +(defmethod draw hud-moneybag ((this hud-moneybag)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 462.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 462.0 (* 130.0 (-> this offset)))) 210 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -25 25) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -25 25) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-moneybag ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-moneybag ((obj hud-moneybag)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-moneybag ((this hud-moneybag)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-moneybag ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-moneybag ((obj hud-moneybag)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-moneybag ((this hud-moneybag)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x7 :page #x679))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x7 :page #x679))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -66,26 +66,26 @@ ) ;; definition for method 3 of type krew-collection-item -(defmethod inspect krew-collection-item ((obj krew-collection-item)) - (when (not obj) - (set! obj obj) +(defmethod inspect krew-collection-item ((this krew-collection-item)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 22 of type krew-collection-item ;; INFO: Used lq/sq -(defmethod find-ground krew-collection-item ((obj krew-collection-item)) +(defmethod find-ground krew-collection-item ((this krew-collection-item)) "TODO - understand the collision query stuff more @returns whether or not the [[self]] is above the ground" (let ((on-ground? #f)) (let ((query (new 'stack-no-clear 'collide-query-with-2vec))) - (set! (-> query vec quad) (-> obj root trans quad)) + (set! (-> query vec quad) (-> this root trans quad)) (set! (-> query cquery start-pos quad) (-> query vec quad)) (vector-reset! (-> query vec2)) (set! (-> query vec2 y) 1.0) @@ -109,8 +109,8 @@ (format #t "krew-collection-item::find-ground: ground y ~M~%" (-> query vec y)) ) ) - (set! (-> obj root trans quad) (-> query vec quad)) - (forward-up-nopitch->quaternion (-> obj root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> query vec2)) + (set! (-> this root trans quad) (-> query vec quad)) + (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> query vec2)) ) on-ground? ) @@ -331,7 +331,7 @@ (when krew-item (set! (-> self slave 0) (process->handle krew-item)) (set! (-> self time-limit) (the-as time-frame (-> self data-int32 task-count))) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (+! (-> self count) 1) ) ) @@ -372,8 +372,8 @@ (ppointer->handle (process-spawn hud-moneybag :init hud-init-by-other :to *target*)) ) (send-event *traffic-manager* 'set-target-level 1.0) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (send-event *traffic-manager* 'set-alert-level 2) @@ -398,8 +398,8 @@ () (send-event *traffic-manager* 'decrease-alert-level 0) (send-event *traffic-manager* 'set-alert-duration (seconds 30)) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 2))) (suspend) ) (talker-spawn-func (-> *talker-speech* 88) *entity-pool* (target-pos 0) (the-as region #f)) diff --git a/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc b/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc index 255e469a7d..510398a651 100644 --- a/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/shuttle/shuttle_REF.gc @@ -3,43 +3,43 @@ ;; definition for method 15 of type hud-citizen ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-citizen ((obj hud-citizen)) +(defmethod draw hud-citizen ((this hud-citizen)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 452.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 452.0 (* 130.0 (-> this offset)))) 195 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -15 47) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -15 47) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-citizen ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-citizen ((obj hud-citizen)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-citizen ((this hud-citizen)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-citizen ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-citizen ((obj hud-citizen)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-citizen ((this hud-citizen)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x679))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.9) - (set! (-> obj sprites 0 scale-y) 0.9) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x679))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.9) + (set! (-> this sprites 0 scale-y) 0.9) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -266,34 +266,34 @@ ) ;; definition for method 3 of type citizen-rebel -(defmethod inspect citizen-rebel ((obj citizen-rebel)) - (when (not obj) - (set! obj obj) +(defmethod inspect citizen-rebel ((this citizen-rebel)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type citizen-norm inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnav-mesh-aid: ~D~%" (-> obj nav-mesh-aid)) - (format #t "~2Tdone?: ~A~%" (-> obj done?)) - (format #t "~2Ttask-node: ~D~%" (-> obj task-node)) - (format #t "~2Tend-pos: #~%" (-> obj end-pos)) - (format #t "~2Tindex: ~D~%" (-> obj index)) - (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) + (format #t "~2Tnav-mesh-aid: ~D~%" (-> this nav-mesh-aid)) + (format #t "~2Tdone?: ~A~%" (-> this done?)) + (format #t "~2Ttask-node: ~D~%" (-> this task-node)) + (format #t "~2Tend-pos: #~%" (-> this end-pos)) + (format #t "~2Tindex: ~D~%" (-> this index)) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) (label cfg-4) - obj + this ) ;; definition for method 17 of type citizen-rebel -(defmethod cleanup-for-death citizen-rebel ((obj citizen-rebel)) +(defmethod cleanup-for-death citizen-rebel ((this citizen-rebel)) (with-pp - (when (and (zero? (-> obj hit-points)) (not (-> obj done?))) + (when (and (zero? (-> this hit-points)) (not (-> this done?))) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'fail) (let ((t9-0 send-event-function) - (v1-9 (-> *game-info* sub-task-list (-> obj task-node))) + (v1-9 (-> *game-info* sub-task-list (-> this task-node))) ) (t9-0 (handle->process (if (-> v1-9 info) @@ -306,7 +306,7 @@ ) ) ) - ((method-of-type citizen-norm cleanup-for-death) obj) + ((method-of-type citizen-norm cleanup-for-death) this) (none) ) ) @@ -419,7 +419,7 @@ (set! (-> self gnd-height) (-> self root gspot-pos y)) (logior! (-> self flags) (citizen-flag persistent)) (logior! (-> self focus-status) (focus-status pilot-riding pilot)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-31 (-> self root root-prim))) (set! (-> v1-31 prim-core collide-as) (collide-spec)) (set! (-> v1-31 prim-core collide-with) (collide-spec)) @@ -449,7 +449,7 @@ (let ((gp-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'quaternion)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (while (not (civilian-method-217 self gp-0)) (let ((s4-0 (handle->process (-> self vehicle))) (s3-0 (new 'stack-no-clear 'quaternion)) @@ -458,7 +458,7 @@ (compute-seat-position (the-as vehicle s4-0) (-> self root trans) (-> self seat)) (quaternion-copy! (-> self root quat) s3-0) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 2)) + (when (time-elapsed? (-> self state-time) (seconds 2)) (put-rider-in-seat (the-as vehicle (handle->process (-> self vehicle))) (-> self seat) self) (go-virtual ride) ) @@ -674,60 +674,60 @@ ;; definition for method 74 of type citizen-rebel ;; WARN: disable def twice: 51. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler citizen-rebel ((obj citizen-rebel) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler citizen-rebel ((this citizen-rebel) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) - (when (nonzero? (-> obj gui-id)) + (when (nonzero? (-> this gui-id)) (set-action! *gui-control* (gui-action stop) - (-> obj gui-id) + (-> this gui-id) (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj gui-id) (new 'static 'sound-id)) + (set! (-> this gui-id) (new 'static 'sound-id)) 0 ) - ((method-of-type civilian general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type civilian general-event-handler) this arg0 arg1 arg2 arg3) ) (('play-speech) (let ((s5-1 (-> arg3 param 0))) - (when (= (get-status *gui-control* (-> obj gui-id)) (gui-status unknown)) + (when (= (get-status *gui-control* (-> this gui-id)) (gui-status unknown)) (let ((v0-1 (the-as object - (add-process *gui-control* obj (gui-channel citizen) (gui-action play) (the-as string s5-1) -99.0 0) + (add-process *gui-control* this (gui-channel citizen) (gui-action play) (the-as string s5-1) -99.0 0) ) ) ) - (set! (-> obj gui-id) (the-as sound-id v0-1)) + (set! (-> this gui-id) (the-as sound-id v0-1)) v0-1 ) ) ) ) (('nav-mesh-kill) - (format 0 "nav-mesh-kill event recieved by ~s~%" (-> obj name)) - (set! (-> obj nav-mesh-aid) (the-as actor-id (-> obj nav state mesh entity aid))) - (change-to *default-nav-mesh* obj) + (format 0 "nav-mesh-kill event recieved by ~s~%" (-> this name)) + (set! (-> this nav-mesh-aid) (the-as actor-id (-> this nav state mesh entity aid))) + (change-to *default-nav-mesh* this) #t ) (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 58 of type citizen-rebel -(defmethod enemy-method-58 citizen-rebel ((obj citizen-rebel) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 citizen-rebel ((this citizen-rebel) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (if (logtest? #x4000000 (-> obj incoming penetrate-using)) + (if (logtest? #x4000000 (-> this incoming penetrate-using)) (set! v0-0 #f) ) v0-0 @@ -735,10 +735,10 @@ ) ;; definition for method 59 of type citizen-rebel -(defmethod get-penetrate-info citizen-rebel ((obj citizen-rebel)) +(defmethod get-penetrate-info citizen-rebel ((this citizen-rebel)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" - (let ((v1-1 ((method-of-type nav-enemy get-penetrate-info) obj))) + (let ((v1-1 ((method-of-type nav-enemy get-penetrate-info) this))) (logior (penetrate enemy-yellow-shot) v1-1) ) ) @@ -800,96 +800,96 @@ ;; definition for method 115 of type citizen-rebel ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! citizen-rebel ((obj citizen-rebel)) +(defmethod init-enemy! citizen-rebel ((this citizen-rebel)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-rebel" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *citizen-rebel-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *citizen-rebel-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 491520.0) - (try-update-focus (-> obj focus) *target* obj) - (-> obj neck) - (set! (-> obj info) *citizen-rebel-global-info*) - (set! (-> obj anim-shuffle) 10) - (let ((v1-16 (get-rand-int obj 3))) + (set! (-> this draw lod-set lod 0 dist) 491520.0) + (try-update-focus (-> this focus) *target* this) + (-> this neck) + (set! (-> this info) *citizen-rebel-global-info*) + (set! (-> this anim-shuffle) 10) + (let ((v1-16 (get-rand-int this 3))) (cond ((zero? v1-16) - (set! (-> obj anim-walk) 11) - (set! (-> obj dist-walk-anim) 8736.768) - (set! (-> obj speed-walk) 10240.0) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 8736.768) + (set! (-> this speed-walk) 10240.0) ) ((= v1-16 1) - (set! (-> obj anim-walk) 12) - (set! (-> obj dist-walk-anim) 13107.2) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 12) + (set! (-> this dist-walk-anim) 13107.2) + (set! (-> this speed-walk) 12288.0) ) ((= v1-16 2) - (set! (-> obj anim-walk) 13) - (set! (-> obj dist-walk-anim) 4370.432) - (set! (-> obj speed-walk) 4096.0) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 4370.432) + (set! (-> this speed-walk) 4096.0) ) ) ) - (let ((v1-31 (get-rand-int obj 3))) + (let ((v1-31 (get-rand-int this 3))) (cond ((zero? v1-31) - (set! (-> obj anim-panic-run) 17) + (set! (-> this anim-panic-run) 17) ) ((= v1-31 1) - (set! (-> obj anim-panic-run) 18) + (set! (-> this anim-panic-run) 18) ) ((= v1-31 2) - (set! (-> obj anim-panic-run) 14) + (set! (-> this anim-panic-run) 14) ) ) ) - (set! (-> obj dist-run-anim) 28672.0) - (let ((v1-38 (get-rand-int obj 3))) + (set! (-> this dist-run-anim) 28672.0) + (let ((v1-38 (get-rand-int this 3))) (cond ((zero? v1-38) - (set! (-> obj anim-run) 14) + (set! (-> this anim-run) 14) ) ((= v1-38 1) - (set! (-> obj anim-run) 15) + (set! (-> this anim-run) 15) ) ((= v1-38 2) - (set! (-> obj anim-run) 16) + (set! (-> this anim-run) 16) ) ) ) - (set! (-> obj speed-run) 49152.0) - (set! (-> obj anim-on-ground) 20) - (set! (-> obj anim-dive) 19) - (set! (-> obj anim-get-up-front) 25) - (set! (-> obj anim-get-up-back) 26) - (let ((f30-0 (get-rand-float-range obj 1.0 1.25)) - (f0-10 (get-rand-float-range obj 1.0 1.25)) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-on-ground) 20) + (set! (-> this anim-dive) 19) + (set! (-> this anim-get-up-front) 25) + (set! (-> this anim-get-up-back) 26) + (let ((f30-0 (get-rand-float-range this 1.0 1.25)) + (f0-10 (get-rand-float-range this 1.0 1.25)) ) - (set-vector! (-> obj root scale) f0-10 f30-0 f0-10 1.0) + (set-vector! (-> this root scale) f0-10 f30-0 f0-10 1.0) ) - (let ((f0-12 (get-rand-float-range obj 0.9 1.0))) - (set-vector! (-> obj draw color-mult) f0-12 f0-12 f0-12 1.0) + (let ((f0-12 (get-rand-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-12 f0-12 f0-12 1.0) ) - (set! (-> obj water-anim) 32) - (set! (-> obj water) (new 'process 'water-control obj 5 0.0 8192.0 2048.0)) - (set! (-> obj water flags) (water-flags active part-splash part-rings part-water)) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 12288.0) + (set! (-> this water-anim) 32) + (set! (-> this water) (new 'process 'water-control this 5 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags active part-splash part-rings part-water)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 12288.0) 0 (none) ) ;; definition for method 114 of type citizen-rebel ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! citizen-rebel ((obj citizen-rebel)) +(defmethod init-enemy-collision! citizen-rebel ((this citizen-rebel)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -945,7 +945,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -953,41 +953,41 @@ ;; definition for method 181 of type citizen-rebel ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen-rebel ((obj citizen-rebel)) +(defmethod citizen-init! citizen-rebel ((this citizen-rebel)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj dive-reaction) (+ 0.09 (* 0.15 (rand-vu)))) - (logclear! (-> obj mask) (process-mask enemy)) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 4 0) - (setup-masks (-> obj draw) 16 0) - (setup-masks (-> obj draw) 64 0) - (let ((v1-14 (get-rand-int obj 3))) + (set! (-> this dive-reaction) (+ 0.09 (* 0.15 (rand-vu)))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 4 0) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 64 0) + (let ((v1-14 (get-rand-int this 3))) (cond ((zero? v1-14) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) ((= v1-14 1) - (setup-masks (-> obj draw) 8 0) + (setup-masks (-> this draw) 8 0) ) ((= v1-14 2) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ) ) - (let ((v1-23 (get-rand-int obj 2))) + (let ((v1-23 (get-rand-int this 2))) (cond ((zero? v1-23) - (setup-masks (-> obj draw) 32 0) + (setup-masks (-> this draw) 32 0) ) ((= v1-23 1) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ) ) - (let ((v1-29 (-> obj nav))) + (let ((v1-29 (-> this nav))) (set! (-> v1-29 sphere-mask) (the-as uint #x800fe)) ) 0 @@ -1008,18 +1008,18 @@ ) ;; definition for method 3 of type city-shuttle-info -(defmethod inspect city-shuttle-info ((obj city-shuttle-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-shuttle-info ((this city-shuttle-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-shuttle-info) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tnav-mesh-id: ~D~%" (-> obj nav-mesh-id)) - (format #t "~1Ttime: ~D~%" (-> obj time)) + (format #t "[~8x] ~A~%" this 'city-shuttle-info) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tnav-mesh-id: ~D~%" (-> this nav-mesh-id)) + (format #t "~1Ttime: ~D~%" (-> this time)) (label cfg-4) - obj + this ) ;; definition for function shuttle-init @@ -1100,7 +1100,7 @@ (check-time arg0) ) (else - (set! (-> arg0 start-time) (current-time)) + (set-time! (-> arg0 start-time)) (when (< (vector-vector-xz-distance (target-pos 0) (-> arg0 begin-pos)) 102400.0) (set-setting! 'airlock #f 0.0 0) (set! (-> arg0 data-int32 9) 1) @@ -1352,7 +1352,7 @@ (when (zero? (-> arg0 data-int32 s3-2)) (send-event (handle->process (-> arg0 arrow)) 'set-position (-> arg1 s3-2 pos)) (set! (-> arg0 time-limit) (-> arg1 s3-2 time)) - (set! (-> arg0 start-time) (current-time)) + (set-time! (-> arg0 start-time)) (set! (-> arg0 data-int32 s3-2) 1) ) (let ((s1-2 (find-nearest-nav-mesh (-> arg1 s3-2 pos) (the-as float #x7f800000)))) @@ -1582,8 +1582,8 @@ (while (zero? (-> self sub-state)) (suspend) ) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (send-event *traffic-manager* 'set-alert-level 2) @@ -1607,7 +1607,7 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (talker-spawn-func (-> *talker-speech* 97) *entity-pool* (target-pos 0) (the-as region #f)) (let ((gp-1 (current-time))) (until #f @@ -1619,7 +1619,7 @@ ) ) ) - (if (or (>= v1-4 4) (>= (- (current-time) gp-1) (seconds 10))) + (if (or (>= v1-4 4) (time-elapsed? gp-1 (seconds 10))) (goto cfg-23) ) ) @@ -1761,8 +1761,8 @@ (while (zero? (-> self sub-state)) (suspend) ) - (set! (-> self state-time) (current-time)) - (while (< (- (current-time) (-> self state-time)) (seconds 5)) + (set-time! (-> self state-time)) + (while (not (time-elapsed? (-> self state-time) (seconds 5))) (suspend) ) (send-event *traffic-manager* 'set-alert-level 2) @@ -1786,7 +1786,7 @@ TASK_MANAGER_COMPLETE_HOOK (lambda :behavior task-manager () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (let ((v1-2 0)) (dotimes (a0-0 4) diff --git a/test/decompiler/reference/jak2/levels/city/slums/ctysluma-part_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/ctysluma-part_REF.gc index 2b1826ffad..eea8331b0e 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/ctysluma-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/ctysluma-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctysluma-part -(defmethod inspect ctysluma-part ((obj ctysluma-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctysluma-part ((this ctysluma-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/slums/ctyslumb-part_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/ctyslumb-part_REF.gc index af0f624320..5fb05dd4d3 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/ctyslumb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/ctyslumb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctyslumb-part -(defmethod inspect ctyslumb-part ((obj ctyslumb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyslumb-part ((this ctyslumb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/slums/ctyslumc-part_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/ctyslumc-part_REF.gc index 78d16017df..be094d02cd 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/ctyslumc-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/ctyslumc-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ctyslumc-part -(defmethod inspect ctyslumc-part ((obj ctyslumc-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ctyslumc-part ((this ctyslumc-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-h_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-h_REF.gc index 0b85aaec29..a941cb0f84 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-h_REF.gc @@ -26,19 +26,19 @@ ) ;; definition for method 3 of type kid -(defmethod inspect kid ((obj kid)) - (when (not obj) - (set! obj obj) +(defmethod inspect kid ((this kid)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttravel-anim-interp: ~f~%" (-> obj travel-anim-interp)) - (format #t "~2Tarrest-attempt-time: ~D~%" (-> obj arrest-attempt-time)) - (format #t "~2Tarrestor-handle: ~D~%" (-> obj arrestor-handle)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> this travel-anim-interp)) + (format #t "~2Tarrest-attempt-time: ~D~%" (-> this arrest-attempt-time)) + (format #t "~2Tarrestor-handle: ~D~%" (-> this arrestor-handle)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -62,23 +62,23 @@ ) ;; definition for method 3 of type kidt-wait-spot -(defmethod inspect kidt-wait-spot ((obj kidt-wait-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect kidt-wait-spot ((this kidt-wait-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> obj spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> this spot-indexes)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc index ef55f7f840..62678b901a 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-states_REF.gc @@ -6,7 +6,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -77,7 +77,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -231,7 +231,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -302,7 +302,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -331,10 +331,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (kid-method-232 self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -366,7 +366,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -390,7 +390,7 @@ ) (go-virtual arrested) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -424,7 +424,7 @@ (go-virtual arrested) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (not (nav-enemy-method-163 self)) (go-virtual traveling) ) @@ -498,7 +498,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -566,12 +566,12 @@ (ja-channel-push! 1 (seconds 0.1)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (ja-no-eval :group! (-> self draw art-group data 16) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 4)) + (time-elapsed? (-> self state-time) (seconds 4)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-task_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-task_REF.gc index e467281d17..d22fc2b4f2 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid-task_REF.gc @@ -3,43 +3,43 @@ ;; definition for method 9 of type kidt-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! kidt-wait-spot ((obj kidt-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! kidt-wait-spot ((this kidt-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type kidt-wait-spot ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kidt-wait-spot ((obj kidt-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 kidt-wait-spot ((this kidt-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as kid arg0)) + ((-> this check-done) this (the-as kid arg0)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc index 852baa1857..5ce9edd4c7 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kid_REF.gc @@ -177,65 +177,62 @@ (set! (-> *kid-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type kid -(defmethod general-event-handler kid ((obj kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler kid ((this kid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('arrest) - (let* ((s4-0 (handle->process (-> obj arrestor-handle))) + (let* ((s4-0 (handle->process (-> this arrestor-handle))) (v1-4 (if (type? s4-0 process-focusable) s4-0 ) ) ) - (when (or (not v1-4) - (= v1-4 arg0) - (and (!= v1-4 arg0) (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.1))) - ) - (set! (-> obj arrestor-handle) (process->handle arg0)) - (set! (-> obj arrest-attempt-time) (current-time)) + (when (or (not v1-4) (= v1-4 arg0) (and (!= v1-4 arg0) (time-elapsed? (-> this arrest-attempt-time) (seconds 0.1)))) + (set! (-> this arrestor-handle) (process->handle arg0)) + (set-time! (-> this arrest-attempt-time)) 0 ) ) #t ) (('instant-arrest) - (logior! (-> obj bot-flags) (bot-flags bf20)) + (logior! (-> this bot-flags) (bot-flags bf20)) (let ((v1-18 (the-as object (-> arg3 param 0)))) - (set! (-> obj arrestor-handle) (process->handle (the-as process v1-18))) - (set! (-> obj arrest-attempt-time) (current-time)) + (set! (-> this arrestor-handle) (process->handle (the-as process v1-18))) + (set-time! (-> this arrest-attempt-time)) (let ((a1-8 (new 'stack-no-clear 'vector))) - (vector-! a1-8 (-> (the-as process-drawable v1-18) root trans) (-> obj root trans)) + (vector-! a1-8 (-> (the-as process-drawable v1-18) root trans) (-> this root trans)) (set! (-> a1-8 y) 0.0) - (forward-up->quaternion (-> obj root quat) a1-8 *up-vector*) + (forward-up->quaternion (-> this root quat) a1-8 *up-vector*) ) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (send-event (handle->process (-> obj master-handle)) 'notify 'arrest #f) - (go (method-of-object obj arrested)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (send-event (handle->process (-> this master-handle)) 'notify 'arrest #f) + (go (method-of-object this arrested)) ) (('attack) - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) #f ) (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 97 of type kid -(defmethod enemy-method-97 kid ((obj kid)) - (let* ((s4-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 kid ((this kid)) + (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) - (s3-0 (handle->process (-> obj arrestor-handle))) + (s3-0 (handle->process (-> this arrestor-handle))) (s4-1 (if (type? s3-0 process-focusable) s3-0 ) @@ -244,33 +241,33 @@ (when s5-0 (cond ((= (-> s5-0 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 1.5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 6)) + (when (time-elapsed? (-> this attacker-time) (seconds 6)) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) (when s4-1 - (when (or (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.5)) + (when (or (time-elapsed? (-> this arrest-attempt-time) (seconds 0.5)) (focus-test? (the-as process-focusable s4-1) dead hit) ) (set! s4-1 (the-as process #f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this arrestor-handle) (the-as handle #f)) ) ) - (let ((v1-34 (-> obj focus-mode)) + (let ((v1-34 (-> this focus-mode)) (s3-1 (the-as process #f)) ) (cond @@ -282,11 +279,11 @@ (s5-0 (set! s3-1 s5-0) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else - (let ((s5-1 (handle->process (-> obj poi-handle)))) + (let ((s5-1 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-1 process-focusable) s5-1 ) @@ -308,7 +305,7 @@ (set! s3-1 s5-0) ) (else - (let ((s5-2 (handle->process (-> obj poi-handle)))) + (let ((s5-2 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-2 process-focusable) s5-2 ) @@ -318,7 +315,7 @@ (s3-1 (empty) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else @@ -331,14 +328,14 @@ ) (cond (s3-1 - (try-update-focus (-> obj focus) (the-as process-focusable s3-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s3-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s3-1 @@ -347,24 +344,24 @@ ) ;; definition for method 183 of type kid -(defmethod alive? kid ((obj kid)) +(defmethod alive? kid ((this kid)) (let ((t9-0 (method-of-type bot alive?))) - (and (t9-0 obj) - (not (and (-> obj next-state) (let ((v1-4 (-> obj next-state name))) - (or (= v1-4 'arrested) (= v1-4 'die) (= v1-4 'die-falling)) - ) + (and (t9-0 this) + (not (and (-> this next-state) (let ((v1-4 (-> this next-state name))) + (or (= v1-4 'arrested) (= v1-4 'die) (= v1-4 'die-falling)) + ) ) ) - (not (logtest? (bot-flags bf20) (-> obj bot-flags))) + (not (logtest? (bot-flags bf20) (-> this bot-flags))) ) ) ) ;; definition for method 114 of type kid ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! kid ((obj kid)) +(defmethod init-enemy-collision! kid ((this kid)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -429,7 +426,7 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -437,36 +434,36 @@ ;; definition for method 210 of type kid ;; WARN: Return type mismatch int vs none. -(defmethod init! kid ((obj kid)) +(defmethod init! kid ((this kid)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj min-speed) 6144.0) - (set! (-> obj max-speed) 22528.0) - (set! (-> obj channel) (the-as uint 26)) - (set! (-> obj notice-enemy-dist) 122880.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 0.0) - (set-vector! (-> obj root scale) 1.2 1.2 1.2 1.0) - (set! (-> obj spot-color) (the-as uint #x60004f8f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this min-speed) 6144.0) + (set! (-> this max-speed) 22528.0) + (set! (-> this channel) (the-as uint 26)) + (set! (-> this notice-enemy-dist) 122880.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 0.0) + (set-vector! (-> this root scale) 1.2 1.2 1.2 1.0) + (set! (-> this spot-color) (the-as uint #x60004f8f)) + (set! (-> this arrestor-handle) (the-as handle #f)) 0 (none) ) ;; definition for method 115 of type kid ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! kid ((obj kid)) +(defmethod init-enemy! kid ((this kid)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) + (init! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-kid" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *kid-nav-enemy-info*) - (let ((v1-7 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *kid-nav-enemy-info*) + (let ((v1-7 (-> this neck))) (set! (-> v1-7 up) (the-as uint 1)) (set! (-> v1-7 nose) (the-as uint 2)) (set! (-> v1-7 ear) (the-as uint 0)) @@ -474,53 +471,53 @@ (set! (-> v1-7 ignore-angle) 30947.555) ) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) 0 (none) ) ;; definition for method 214 of type kid -(defmethod bot-method-214 kid ((obj kid)) +(defmethod bot-method-214 kid ((this kid)) #f ) ;; definition for method 70 of type kid ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile kid ((obj kid)) - (kid-method-232 obj) +(defmethod go-hostile kid ((this kid)) + (kid-method-232 this) ) ;; definition for method 72 of type kid ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kid ((obj kid)) +(defmethod react-to-focus kid ((this kid)) "@TODO - flesh out docs" - (kid-method-232 obj) + (kid-method-232 this) ) ;; definition for method 233 of type kid ;; WARN: Return type mismatch object vs none. -(defmethod kid-method-233 kid ((obj kid)) - (go (method-of-object obj waiting-turn)) +(defmethod kid-method-233 kid ((this kid)) + (go (method-of-object this waiting-turn)) (none) ) ;; definition for method 232 of type kid ;; WARN: Return type mismatch object vs none. -(defmethod kid-method-232 kid ((obj kid)) - (let ((s5-0 (handle->process (-> obj arrestor-handle)))) +(defmethod kid-method-232 kid ((this kid)) + (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) s5-0 ) - (go (method-of-object obj arrested)) + (go (method-of-object this arrested)) ) - ((logtest? (bot-flags bf19) (-> obj bot-flags)) - (go (method-of-object obj scared-idle)) + ((logtest? (bot-flags bf19) (-> this bot-flags)) + (go (method-of-object this scared-idle)) ) (else - (go (method-of-object obj waiting-idle)) + (go (method-of-object this waiting-idle)) ) ) ) @@ -529,54 +526,54 @@ ;; definition for method 234 of type kid ;; WARN: Return type mismatch int vs none. -(defmethod kid-method-234 kid ((obj kid)) +(defmethod kid-method-234 kid ((this kid)) (with-pp - (let ((f30-0 (-> obj nav state speed))) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 6144.0 22528.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-7 (= v1-7 (-> obj draw art-group data 5))) - (let ((v1-12 (-> obj skel root-channel 1))) + ((and v1-7 (= v1-7 (-> this draw art-group data 5))) + (let ((v1-12 (-> this skel root-channel 1))) (set! (-> v1-12 frame-interp 1) f28-0) (set! (-> v1-12 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 22528.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 8.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) - (a0-10 (-> obj skel root-channel 0)) + (a0-10 (-> this skel root-channel 0)) ) (set! (-> a0-10 param 0) f0-11) (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-11 (-> obj skel root-channel 1))) + (let ((a0-11 (-> this skel root-channel 1))) (set! (-> a0-11 param 0) 0.0) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 dist) 3276.8) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 5))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) (set! (-> a0-13 param 0) 1.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 5)) num-func-loop!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-loop!) ) - (let ((a0-14 (-> obj skel root-channel 1))) + (let ((a0-14 (-> this skel root-channel 1))) (set! (-> a0-14 frame-interp 1) f28-0) (set! (-> a0-14 frame-interp 0) f28-0) (set! (-> a0-14 dist) 8737.997) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-chan) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 6)) num-func-chan) ) ) ) @@ -587,24 +584,24 @@ ) ;; definition for method 56 of type kid -(defmethod damage-amount-from-attack kid ((obj kid) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack kid ((this kid) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" - (if (= (-> obj course course-id) 7) + (if (= (-> this course course-id) 7) 0 - ((method-of-type bot damage-amount-from-attack) obj arg0 arg1) + ((method-of-type bot damage-amount-from-attack) this arg0 arg1) ) ) ;; definition for method 190 of type kid -(defmethod bot-method-190 kid ((obj kid)) +(defmethod bot-method-190 kid ((this kid)) #t ) ;; definition for method 78 of type kid -(defmethod enemy-method-78 kid ((obj kid) (arg0 (pointer float))) +(defmethod enemy-method-78 kid ((this kid) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -617,49 +614,49 @@ ;; definition for method 198 of type kid ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kid ((obj kid) (arg0 vector)) +(defmethod set-cam-height! kid ((this kid) (arg0 vector)) (the-as meters (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'arrested)) + ((and (-> this next-state) (= (-> this next-state name) 'arrested)) (set-vector! arg0 49152.0 12288.0 49152.0 1.0) - (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) - (if (focus-test? obj under-water) - (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) ) ) (else - ((method-of-type bot set-cam-height!) obj arg0) + ((method-of-type bot set-cam-height!) this arg0) ) ) ) ) ;; definition for method 102 of type kid -(defmethod enemy-method-102 kid ((obj kid)) - (if (logtest? (bot-flags bf20) (-> obj bot-flags)) +(defmethod enemy-method-102 kid ((this kid)) + (if (logtest? (bot-flags bf20) (-> this bot-flags)) #f - ((method-of-type bot enemy-method-102) obj) + ((method-of-type bot enemy-method-102) this) ) ) ;; definition for method 116 of type kid ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kid ((obj kid)) +(defmethod go-idle kid ((this kid)) (cond - ((= (-> obj course course-id) 7) + ((= (-> this course course-id) 7) (cond ((task-node-closed? (game-task-node city-help-kid-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj waiting-with-kor)) + (go (method-of-object this waiting-with-kor)) ) ) ) (else - (go (method-of-object obj waiting-idle)) + (go (method-of-object this waiting-idle)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-h_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-h_REF.gc index 684763c650..c250494545 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-h_REF.gc @@ -26,19 +26,19 @@ ) ;; definition for method 3 of type kor -(defmethod inspect kor ((obj kor)) - (when (not obj) - (set! obj obj) +(defmethod inspect kor ((this kor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttravel-anim-interp: ~f~%" (-> obj travel-anim-interp)) - (format #t "~2Tarrest-attempt-time: ~D~%" (-> obj arrest-attempt-time)) - (format #t "~2Tarrestor-handle: ~D~%" (-> obj arrestor-handle)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> this travel-anim-interp)) + (format #t "~2Tarrest-attempt-time: ~D~%" (-> this arrest-attempt-time)) + (format #t "~2Tarrestor-handle: ~D~%" (-> this arrestor-handle)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -62,23 +62,23 @@ ) ;; definition for method 3 of type kort-wait-spot -(defmethod inspect kort-wait-spot ((obj kort-wait-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect kort-wait-spot ((this kort-wait-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> obj spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> this spot-indexes)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc index 7fdbaef094..cc0aed1c33 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-states_REF.gc @@ -6,7 +6,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -77,7 +77,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -242,7 +242,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -313,7 +313,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -342,10 +342,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (kor-method-232 self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -377,7 +377,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -401,7 +401,7 @@ ) (go-virtual arrested) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -435,7 +435,7 @@ (go-virtual arrested) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (not (nav-enemy-method-163 self)) (go-virtual traveling) ) @@ -509,7 +509,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -556,7 +556,7 @@ (ja-channel-push! 1 (seconds 0.25)) (cond ((and (not (logtest? (bot-flags bf20) (-> self bot-flags))) - (< (- (current-time) (-> self arrest-attempt-time)) (seconds 0.8)) + (not (time-elapsed? (-> self arrest-attempt-time) (seconds 0.8))) ) (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) @@ -589,12 +589,12 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (ja-no-eval :group! (-> self draw art-group data 18) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-task_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-task_REF.gc index 2795920294..a9b6f2631a 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor-task_REF.gc @@ -3,43 +3,43 @@ ;; definition for method 9 of type kort-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! kort-wait-spot ((obj kort-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! kort-wait-spot ((this kort-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type kort-wait-spot ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 kort-wait-spot ((obj kort-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 kort-wait-spot ((this kort-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as kor arg0)) + ((-> this check-done) this (the-as kor arg0)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc index 1793d002e8..7f57833434 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/kor/kor_REF.gc @@ -11,15 +11,15 @@ ) ;; definition for method 3 of type kor-anim-info -(defmethod inspect kor-anim-info ((obj kor-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect kor-anim-info ((this kor-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'kor-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "[~8x] ~A~%" this 'kor-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) (label cfg-4) - obj + this ) ;; definition for symbol *kor-nav-enemy-info*, type nav-enemy-info @@ -198,60 +198,57 @@ (set! (-> *kor-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type kor -(defmethod general-event-handler kor ((obj kor) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler kor ((this kor) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('arrest) - (let* ((s4-0 (handle->process (-> obj arrestor-handle))) + (let* ((s4-0 (handle->process (-> this arrestor-handle))) (v1-4 (if (type? s4-0 process-focusable) s4-0 ) ) ) - (when (or (not v1-4) - (= v1-4 arg0) - (and (!= v1-4 arg0) (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.1))) - ) - (set! (-> obj arrestor-handle) (process->handle arg0)) - (set! (-> obj arrest-attempt-time) (current-time)) + (when (or (not v1-4) (= v1-4 arg0) (and (!= v1-4 arg0) (time-elapsed? (-> this arrest-attempt-time) (seconds 0.1)))) + (set! (-> this arrestor-handle) (process->handle arg0)) + (set-time! (-> this arrest-attempt-time)) 0 ) ) #t ) (('instant-arrest) - (logior! (-> obj bot-flags) (bot-flags bf20)) + (logior! (-> this bot-flags) (bot-flags bf20)) (let ((v1-18 (the-as object (-> arg3 param 0)))) - (set! (-> obj arrestor-handle) (process->handle (the-as process v1-18))) - (set! (-> obj arrest-attempt-time) (current-time)) + (set! (-> this arrestor-handle) (process->handle (the-as process v1-18))) + (set-time! (-> this arrest-attempt-time)) (let ((a1-8 (new 'stack-no-clear 'vector))) - (vector-! a1-8 (-> (the-as process-drawable v1-18) root trans) (-> obj root trans)) + (vector-! a1-8 (-> (the-as process-drawable v1-18) root trans) (-> this root trans)) (set! (-> a1-8 y) 0.0) - (forward-up->quaternion (-> obj root quat) a1-8 *up-vector*) + (forward-up->quaternion (-> this root quat) a1-8 *up-vector*) ) ) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (go (method-of-object obj arrested)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (go (method-of-object this arrested)) ) (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 97 of type kor -(defmethod enemy-method-97 kor ((obj kor)) - (let* ((s4-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 kor ((this kor)) + (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) - (s3-0 (handle->process (-> obj arrestor-handle))) + (s3-0 (handle->process (-> this arrestor-handle))) (s4-1 (if (type? s3-0 process-focusable) s3-0 ) @@ -260,33 +257,33 @@ (when s5-0 (cond ((= (-> s5-0 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 1.5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 6)) + (when (time-elapsed? (-> this attacker-time) (seconds 6)) (set! s5-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) (when s4-1 - (when (or (>= (- (current-time) (-> obj arrest-attempt-time)) (seconds 0.5)) + (when (or (time-elapsed? (-> this arrest-attempt-time) (seconds 0.5)) (focus-test? (the-as process-focusable s4-1) dead hit) ) (set! s4-1 (the-as process #f)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this arrestor-handle) (the-as handle #f)) ) ) - (let ((v1-34 (-> obj focus-mode)) + (let ((v1-34 (-> this focus-mode)) (s3-1 (the-as process #f)) ) (cond @@ -298,11 +295,11 @@ (s5-0 (set! s3-1 s5-0) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else - (let ((s5-1 (handle->process (-> obj poi-handle)))) + (let ((s5-1 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-1 process-focusable) s5-1 ) @@ -324,7 +321,7 @@ (set! s3-1 s5-0) ) (else - (let ((s5-2 (handle->process (-> obj poi-handle)))) + (let ((s5-2 (handle->process (-> this poi-handle)))) (set! s3-1 (if (type? s5-2 process-focusable) s5-2 ) @@ -334,7 +331,7 @@ (s3-1 (empty) ) - ((begin (set! s3-1 (select-focus! obj)) s3-1) + ((begin (set! s3-1 (select-focus! this)) s3-1) (empty) ) (else @@ -347,14 +344,14 @@ ) (cond (s3-1 - (try-update-focus (-> obj focus) (the-as process-focusable s3-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s3-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s3-1 type) target)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s3-1 @@ -363,24 +360,24 @@ ) ;; definition for method 183 of type kor -(defmethod alive? kor ((obj kor)) +(defmethod alive? kor ((this kor)) (let ((t9-0 (method-of-type bot alive?))) - (and (t9-0 obj) - (not (and (-> obj next-state) (let ((v1-4 (-> obj next-state name))) - (or (= v1-4 'arrested) (= v1-4 'die) (= v1-4 'die-falling)) - ) + (and (t9-0 this) + (not (and (-> this next-state) (let ((v1-4 (-> this next-state name))) + (or (= v1-4 'arrested) (= v1-4 'die) (= v1-4 'die-falling)) + ) ) ) - (not (logtest? (bot-flags bf20) (-> obj bot-flags))) + (not (logtest? (bot-flags bf20) (-> this bot-flags))) ) ) ) ;; definition for method 114 of type kor ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! kor ((obj kor)) +(defmethod init-enemy-collision! kor ((this kor)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -445,7 +442,7 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 2)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -453,36 +450,36 @@ ;; definition for method 210 of type kor ;; WARN: Return type mismatch int vs none. -(defmethod init! kor ((obj kor)) +(defmethod init! kor ((this kor)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj min-speed) 6144.0) - (set! (-> obj max-speed) 20889.6) - (set! (-> obj channel) (the-as uint 27)) - (set! (-> obj notice-enemy-dist) 122880.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 0.0) - (set-vector! (-> obj root scale) 1.2 1.2 1.2 1.0) - (set! (-> obj spot-color) (the-as uint #x508f2f00)) - (set! (-> obj arrestor-handle) (the-as handle #f)) + (set! (-> this min-speed) 6144.0) + (set! (-> this max-speed) 20889.6) + (set! (-> this channel) (the-as uint 27)) + (set! (-> this notice-enemy-dist) 122880.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 0.0) + (set-vector! (-> this root scale) 1.2 1.2 1.2 1.0) + (set! (-> this spot-color) (the-as uint #x508f2f00)) + (set! (-> this arrestor-handle) (the-as handle #f)) 0 (none) ) ;; definition for method 115 of type kor ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! kor ((obj kor)) +(defmethod init-enemy! kor ((this kor)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) + (init! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-kor" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *kor-nav-enemy-info*) - (let ((v1-7 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *kor-nav-enemy-info*) + (let ((v1-7 (-> this neck))) (set! (-> v1-7 up) (the-as uint 1)) (set! (-> v1-7 nose) (the-as uint 2)) (set! (-> v1-7 ear) (the-as uint 0)) @@ -490,53 +487,53 @@ (set! (-> v1-7 ignore-angle) 30947.555) ) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) 0 (none) ) ;; definition for method 214 of type kor -(defmethod bot-method-214 kor ((obj kor)) +(defmethod bot-method-214 kor ((this kor)) #f ) ;; definition for method 70 of type kor ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile kor ((obj kor)) - (kor-method-232 obj) +(defmethod go-hostile kor ((this kor)) + (kor-method-232 this) ) ;; definition for method 72 of type kor ;; WARN: Return type mismatch none vs object. -(defmethod react-to-focus kor ((obj kor)) +(defmethod react-to-focus kor ((this kor)) "@TODO - flesh out docs" - (kor-method-232 obj) + (kor-method-232 this) ) ;; definition for method 233 of type kor ;; WARN: Return type mismatch object vs none. -(defmethod kor-method-233 kor ((obj kor)) - (go (method-of-object obj waiting-turn)) +(defmethod kor-method-233 kor ((this kor)) + (go (method-of-object this waiting-turn)) (none) ) ;; definition for method 232 of type kor ;; WARN: Return type mismatch object vs none. -(defmethod kor-method-232 kor ((obj kor)) - (let ((s5-0 (handle->process (-> obj arrestor-handle)))) +(defmethod kor-method-232 kor ((this kor)) + (let ((s5-0 (handle->process (-> this arrestor-handle)))) (cond ((if (type? s5-0 process-focusable) s5-0 ) - (go (method-of-object obj arrested)) + (go (method-of-object this arrested)) ) - ((logtest? (bot-flags bf19) (-> obj bot-flags)) - (go (method-of-object obj scared-idle)) + ((logtest? (bot-flags bf19) (-> this bot-flags)) + (go (method-of-object this scared-idle)) ) (else - (go (method-of-object obj waiting-idle)) + (go (method-of-object this waiting-idle)) ) ) ) @@ -545,54 +542,54 @@ ;; definition for method 234 of type kor ;; WARN: Return type mismatch int vs none. -(defmethod kor-method-234 kor ((obj kor)) +(defmethod kor-method-234 kor ((this kor)) (with-pp - (let ((f30-0 (-> obj nav state speed))) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 6144.0 20889.6))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-7 (= v1-7 (-> obj draw art-group data 5))) - (let ((v1-12 (-> obj skel root-channel 1))) + ((and v1-7 (= v1-7 (-> this draw art-group data 5))) + (let ((v1-12 (-> this skel root-channel 1))) (set! (-> v1-12 frame-interp 1) f28-0) (set! (-> v1-12 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f0-7 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f0-7 (deg- f0-5 (-> this travel-prev-ry))) (f0-10 (fmin 20889.6 (* 0.35342914 (-> pp clock frames-per-second) (fabs f0-7)))) (f0-13 (/ (* 24.0 (fmax f30-0 f0-10)) (* 15.0 f28-1))) - (a0-10 (-> obj skel root-channel 0)) + (a0-10 (-> this skel root-channel 0)) ) (set! (-> a0-10 param 0) f0-13) (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-11 (-> obj skel root-channel 1))) + (let ((a0-11 (-> this skel root-channel 1))) (set! (-> a0-11 param 0) 0.0) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.3)) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 dist) 9830.4) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 5))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) (set! (-> a0-13 param 0) 1.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 5)) num-func-loop!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-loop!) ) - (let ((a0-14 (-> obj skel root-channel 1))) + (let ((a0-14 (-> this skel root-channel 1))) (set! (-> a0-14 frame-interp 1) f28-0) (set! (-> a0-14 frame-interp 0) f28-0) (set! (-> a0-14 dist) 19660.8) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-chan) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 6)) num-func-chan) ) ) ) @@ -603,21 +600,21 @@ ) ;; definition for method 56 of type kor -(defmethod damage-amount-from-attack kor ((obj kor) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack kor ((this kor) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) ;; definition for method 190 of type kor -(defmethod bot-method-190 kor ((obj kor)) +(defmethod bot-method-190 kor ((this kor)) #t ) ;; definition for method 78 of type kor -(defmethod enemy-method-78 kor ((obj kor) (arg0 (pointer float))) +(defmethod enemy-method-78 kor ((this kor) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -630,49 +627,49 @@ ;; definition for method 198 of type kor ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! kor ((obj kor) (arg0 vector)) +(defmethod set-cam-height! kor ((this kor) (arg0 vector)) (the-as meters (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'arrested)) + ((and (-> this next-state) (= (-> this next-state name) 'arrested)) (set-vector! arg0 49152.0 12288.0 49152.0 1.0) - (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) - (if (focus-test? obj under-water) - (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) ) ) (else - ((method-of-type bot set-cam-height!) obj arg0) + ((method-of-type bot set-cam-height!) this arg0) ) ) ) ) ;; definition for method 102 of type kor -(defmethod enemy-method-102 kor ((obj kor)) - (if (logtest? (bot-flags bf20) (-> obj bot-flags)) +(defmethod enemy-method-102 kor ((this kor)) + (if (logtest? (bot-flags bf20) (-> this bot-flags)) #f - ((method-of-type bot enemy-method-102) obj) + ((method-of-type bot enemy-method-102) this) ) ) ;; definition for method 116 of type kor ;; WARN: Return type mismatch object vs none. -(defmethod go-idle kor ((obj kor)) +(defmethod go-idle kor ((this kor)) (cond - ((= (-> obj course course-id) 8) + ((= (-> this course course-id) 8) (cond ((task-node-closed? (game-task-node city-help-kid-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj waiting-with-kid)) + (go (method-of-object this waiting-with-kid)) ) ) ) (else - (go (method-of-object obj waiting-idle)) + (go (method-of-object this waiting-idle)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc b/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc index db6d511f6e..f1b19e64da 100644 --- a/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/slums/neon-baron-part_REF.gc @@ -3276,62 +3276,62 @@ ) ;; definition for method 3 of type neon-baron -(defmethod inspect neon-baron ((obj neon-baron)) - (when (not obj) - (set! obj obj) +(defmethod inspect neon-baron ((this neon-baron)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tmaster-enable: ~D~%" (-> obj master-enable)) - (format #t "~2Tmode: ~D~%" (-> obj mode)) - (format #t "~2Tsign: ~A~%" (-> obj sign)) - (format #t "~2Tparts[1] @ #x~X~%" (-> obj parts)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tmat: #~%" (-> obj mat)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tmaster-enable: ~D~%" (-> this master-enable)) + (format #t "~2Tmode: ~D~%" (-> this mode)) + (format #t "~2Tsign: ~A~%" (-> this sign)) + (format #t "~2Tparts[1] @ #x~X~%" (-> this parts)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tmat: #~%" (-> this mat)) (label cfg-4) - obj + this ) ;; definition for method 10 of type neon-baron -(defmethod deactivate neon-baron ((obj neon-baron)) +(defmethod deactivate neon-baron ((this neon-baron)) (dotimes (s5-0 1) - (let ((a0-1 (-> obj parts s5-0))) + (let ((a0-1 (-> this parts s5-0))) (if (nonzero? a0-1) (kill-and-free-particles a0-1) ) ) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; definition for method 7 of type neon-baron ;; WARN: Return type mismatch process vs neon-baron. -(defmethod relocate neon-baron ((obj neon-baron) (arg0 int)) +(defmethod relocate neon-baron ((this neon-baron) (arg0 int)) (dotimes (v1-0 1) - (if (nonzero? (-> obj parts v1-0)) - (&+! (-> obj parts v1-0) arg0) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) arg0) ) ) - (the-as neon-baron ((method-of-type process relocate) obj arg0)) + (the-as neon-baron ((method-of-type process relocate) this arg0)) ) ;; definition for method 15 of type neon-baron ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-parts neon-baron ((obj neon-baron)) - (+! (-> obj parts 0 state-counter) 1) - (when (!= (-> obj parts 0 state-mode 0) (-> obj flags)) - (set! (-> obj parts 0 state-mode 0) (the-as uint (-> obj flags))) - (set! (-> obj parts 0 state-counter) (the-as uint 0)) +(defmethod spawn-parts neon-baron ((this neon-baron)) + (+! (-> this parts 0 state-counter) 1) + (when (!= (-> this parts 0 state-mode 0) (-> this flags)) + (set! (-> this parts 0 state-mode 0) (the-as uint (-> this flags))) + (set! (-> this parts 0 state-counter) (the-as uint 0)) 0 ) - (let ((s5-0 (-> obj master-enable))) + (let ((s5-0 (-> this master-enable))) (dotimes (s4-0 1) (if (logtest? s5-0 1) - (spawn-with-matrix (-> obj parts s4-0) (-> obj mat)) + (spawn-with-matrix (-> this parts s4-0) (-> this mat)) ) (set! s5-0 (/ s5-0 2)) ) @@ -3341,8 +3341,8 @@ ;; definition for method 16 of type neon-baron ;; WARN: Return type mismatch int vs none. -(defmethod update-mode neon-baron ((obj neon-baron)) - (set! (-> obj mode) (rand-vu-int-count-excluding 12 (ash 1 (-> obj mode)))) +(defmethod update-mode neon-baron ((this neon-baron)) + (set! (-> this mode) (rand-vu-int-count-excluding 12 (ash 1 (-> this mode)))) (none) ) @@ -3406,16 +3406,16 @@ 600 (dotimes (gp-0 19) (let ((s5-0 (-> *neon-baron-flashing-acc* (* gp-0 2)))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 8) - (until (>= (- (current-time) (-> self state-time)) (the-as time-frame s5-0)) + (until (time-elapsed? (-> self state-time) (the-as time-frame s5-0)) (suspend) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 9) (let ((s5-1 (-> *neon-baron-flashing-acc* (+ (* gp-0 2) 1)))) - (until (>= (- (current-time) (-> self state-time)) (the-as time-frame s5-1)) + (until (time-elapsed? (-> self state-time) (the-as time-frame s5-1)) (suspend) ) ) @@ -3423,28 +3423,28 @@ ) ((zero? v1-2) (dotimes (gp-1 3) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 8) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 9) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) ) ((= v1-2 1) (dotimes (gp-2 3) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 8) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 9) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) ) @@ -3453,16 +3453,16 @@ 600 (dotimes (gp-3 19) (let ((s5-2 (-> *neon-baron-flashing-acc* (* gp-3 2)))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 3) - (until (>= (- (current-time) (-> self state-time)) (the-as time-frame s5-2)) + (until (time-elapsed? (-> self state-time) (the-as time-frame s5-2)) (suspend) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 2) (let ((s5-3 (-> *neon-baron-flashing-acc* (+ (* gp-3 2) 1)))) - (until (>= (- (current-time) (-> self state-time)) (the-as time-frame s5-3)) + (until (time-elapsed? (-> self state-time) (the-as time-frame s5-3)) (suspend) ) ) @@ -3470,28 +3470,28 @@ ) ((= v1-2 8) (dotimes (gp-4 3) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 3) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 2) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) ) ((= v1-2 9) (dotimes (gp-5 3) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 3) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) 2) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) ) @@ -3575,8 +3575,8 @@ (set! (-> self flags) 1) (let ((gp-11 (rand-vu-int-range 3 6))) (dotimes (s5-9 gp-11) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) @@ -3592,26 +3592,26 @@ ;; definition for method 11 of type neon-baron ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! neon-baron ((obj neon-baron) (arg0 entity-actor)) +(defmethod init-from-entity! neon-baron ((this neon-baron) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (matrix-rotate-y! (-> obj mat) (quaternion-y-angle (-> arg0 quat))) - (set! (-> obj mat trans quad) (-> arg0 extra trans quad)) - (set! (-> obj master-enable) -1) - (set! (-> obj flags) 9) - (set! (-> obj mode) 0) - (set! (-> obj sign) *baron-neon-skull*) + (matrix-rotate-y! (-> this mat) (quaternion-y-angle (-> arg0 quat))) + (set! (-> this mat trans quad) (-> arg0 extra trans quad)) + (set! (-> this master-enable) -1) + (set! (-> this flags) 9) + (set! (-> this mode) 0) + (set! (-> this sign) *baron-neon-skull*) (let ((s5-1 *city-baron-group-ids*)) (dotimes (s4-1 1) - (set! (-> obj parts s4-1) (create-launch-control (-> *part-group-id-table* (-> s5-1 s4-1)) obj)) + (set! (-> this parts s4-1) (create-launch-control (-> *part-group-id-table* (-> s5-1 s4-1)) this)) ) ) - (update-mode obj) - (go (method-of-object obj idle)) + (update-mode this) + (go (method-of-object this idle)) (none) ) @@ -3631,28 +3631,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type hide-door-a -(defmethod inspect hide-door-a ((obj hide-door-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect hide-door-a ((this hide-door-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type hide-door-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-door-a ((obj hide-door-a) (arg0 entity-actor)) +(defmethod init-from-entity! hide-door-a ((this hide-door-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) (set! (-> s5-0 total-prims) (the-as uint 2)) @@ -3675,19 +3675,19 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hide-door-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "hide-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "hide-door-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "hide-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "hide-door-hit")) - (set! (-> obj door-radius) 12288.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "hide-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "hide-door-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "hide-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "hide-door-hit")) + (set! (-> this door-radius) 12288.0) + (go (method-of-object this close) #t) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc index a4823c748e..701adeb6fa 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-chick_REF.gc @@ -44,16 +44,16 @@ ) ;; definition for method 3 of type citizen-chick -(defmethod inspect citizen-chick ((obj citizen-chick)) - (when (not obj) - (set! obj obj) +(defmethod inspect citizen-chick ((this citizen-chick)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type civilian inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol *citizen-chick-nav-enemy-info*, type nav-enemy-info @@ -231,22 +231,22 @@ (set! (-> *citizen-chick-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 26 of type citizen-chick -(defmethod get-inv-mass citizen-chick ((obj citizen-chick)) +(defmethod get-inv-mass citizen-chick ((this citizen-chick)) 0.5 ) ;; definition for method 51 of type citizen-chick ;; INFO: Used lq/sq -(defmethod enemy-method-51 citizen-chick ((obj citizen-chick)) - (let ((f30-0 (quaternion-y-angle (-> obj root quat)))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-51 citizen-chick ((this citizen-chick)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (let ((a0-5 (handle->process (-> obj focus handle)))) + (let ((a0-5 (handle->process (-> this focus handle)))) (when a0-5 (get-trans (the-as process-focusable a0-5) 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root transv quad)) - (if (< (vector-dot (-> obj root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) (vector-negate-in-place! s5-0) @@ -258,14 +258,14 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> obj root transv quad)) - (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) 0.0) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) (f1-2 (deg- f30-0 f28-0)) (f2-0 (fabs f1-2)) - (f0-8 (-> obj enemy-info knocked-seek-ry-clamp)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) ) (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) (set! f30-0 (+ (cond @@ -298,26 +298,26 @@ ) ;; definition for method 79 of type citizen-chick -(defmethod enemy-method-79 citizen-chick ((obj citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 citizen-chick ((this citizen-chick) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let ((s5-0 (ja-done? 0))) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) ) (when s5-0 (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-6 (-> obj skel root-channel 0))) + (let ((a0-6 (-> this skel root-channel 0))) (set! (-> a0-6 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) ) (set! (-> a0-6 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) frames num-frames ) @@ -329,7 +329,7 @@ (set! (-> a0-6 frame-num) 3.0) (joint-control-channel-group! a0-6 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) num-func-seek! ) ) @@ -338,29 +338,29 @@ ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) ;; definition for method 77 of type citizen-chick -(defmethod enemy-method-77 citizen-chick ((obj citizen-chick) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 citizen-chick ((this citizen-chick) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.01)) - (let* ((a2-0 (ash 1 (-> obj info prev-yellow-hit))) - (v1-3 (enemy-method-120 obj 1 a2-0)) + (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) + (v1-3 (enemy-method-120 this 1 a2-0)) (a1-7 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-3 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-3 8)) (the-as uint (-> this info)))) yellow-hit-anim 0 anim-index-front @@ -368,8 +368,8 @@ ) ) ) - (set! (-> obj info prev-yellow-hit) v1-3) - (let ((a0-15 (-> obj skel root-channel 0))) + (set! (-> this info prev-yellow-hit) v1-3) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) (set! (-> a0-15 param 1) (-> arg0 0)) @@ -380,14 +380,14 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let* ((a2-2 (ash 1 (-> obj info prev-blue-hit))) - (v1-12 (enemy-method-120 obj 3 a2-2)) + (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) + (v1-12 (enemy-method-120 this 3 a2-2)) (a1-14 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-12 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-12 8)) (the-as uint (-> this info)))) blue-hit-anim 0 anim-index-front @@ -395,8 +395,8 @@ ) ) ) - (set! (-> obj info prev-blue-hit) v1-12) - (let ((a0-30 (-> obj skel root-channel 0))) + (set! (-> this info prev-blue-hit) v1-12) + (let ((a0-30 (-> this skel root-channel 0))) (set! (-> a0-30 frame-group) (the-as art-joint-anim a1-14)) (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim a1-14) frames num-frames) -1))) (set! (-> a0-30 param 1) 1.0) @@ -406,14 +406,14 @@ ) ) (else - (let ((s4-0 (if (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) ) ) ) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-39 (-> obj skel root-channel 0))) + (let ((a0-39 (-> this skel root-channel 0))) (set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-39 param 1) (-> arg0 0)) @@ -427,15 +427,15 @@ ) ;; definition for method 78 of type citizen-chick -(defmethod enemy-method-78 citizen-chick ((obj citizen-chick) (arg0 (pointer float))) +(defmethod enemy-method-78 citizen-chick ((this citizen-chick) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) ) (set! (-> a0-2 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) frames num-frames ) @@ -447,7 +447,7 @@ (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) num-func-seek! ) ) @@ -533,9 +533,9 @@ ;; definition for method 114 of type citizen-chick ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! citizen-chick ((obj citizen-chick)) +(defmethod init-enemy-collision! citizen-chick ((this citizen-chick)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -585,7 +585,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -593,176 +593,176 @@ ;; definition for method 115 of type citizen-chick ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! citizen-chick ((obj citizen-chick)) +(defmethod init-enemy! citizen-chick ((this citizen-chick)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-chick" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *citizen-chick-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *citizen-chick-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 204800.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (set! (-> obj info) *citizen-chick-global-info*) - (try-update-focus (-> obj focus) *target* obj) - (set-vector! (-> obj neck twist-max) 10922.667 18204.445 0.0 1.0) - (set! (-> obj anim-shuffle) 26) - (let ((v1-18 (get-rand-int obj 3))) + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this info) *citizen-chick-global-info*) + (try-update-focus (-> this focus) *target* this) + (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) + (set! (-> this anim-shuffle) 26) + (let ((v1-18 (get-rand-int this 3))) (cond ((zero? v1-18) - (set! (-> obj anim-walk) 4) - (set! (-> obj dist-walk-anim) 15728.64) - (set! (-> obj speed-walk) 14745.6) + (set! (-> this anim-walk) 4) + (set! (-> this dist-walk-anim) 15728.64) + (set! (-> this speed-walk) 14745.6) ) ((= v1-18 1) - (set! (-> obj anim-walk) 5) - (set! (-> obj dist-walk-anim) 8736.768) - (set! (-> obj speed-walk) 8192.0) + (set! (-> this anim-walk) 5) + (set! (-> this dist-walk-anim) 8736.768) + (set! (-> this speed-walk) 8192.0) ) ((= v1-18 2) - (set! (-> obj anim-walk) 6) - (set! (-> obj dist-walk-anim) 15728.64) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 6) + (set! (-> this dist-walk-anim) 15728.64) + (set! (-> this speed-walk) 12288.0) ) ) ) - (let ((v1-33 (get-rand-int obj 3))) + (let ((v1-33 (get-rand-int this 3))) (cond ((zero? v1-33) - (set! (-> obj anim-panic-run) 11) + (set! (-> this anim-panic-run) 11) ) ((= v1-33 1) - (set! (-> obj anim-panic-run) 11) + (set! (-> this anim-panic-run) 11) ) ((= v1-33 2) - (set! (-> obj anim-panic-run) 7) + (set! (-> this anim-panic-run) 7) ) ) ) - (let ((v1-39 (get-rand-int obj 3))) + (let ((v1-39 (get-rand-int this 3))) (cond ((zero? v1-39) - (set! (-> obj dist-run-anim) 26214.4) - (set! (-> obj anim-run) 7) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 7) ) ((= v1-39 1) - (set! (-> obj dist-run-anim) 28385.28) - (set! (-> obj anim-run) 8) + (set! (-> this dist-run-anim) 28385.28) + (set! (-> this anim-run) 8) ) ((= v1-39 2) - (set! (-> obj dist-run-anim) 26214.4) - (set! (-> obj anim-run) 9) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 9) ) ) ) - (set! (-> obj speed-run) 49152.0) - (set! (-> obj anim-on-ground) 13) - (set! (-> obj anim-dive) 17) - (set! (-> obj anim-get-up-back) 25) - (set! (-> obj anim-get-up-front) 24) - (let ((f30-0 (get-rand-float-range obj 1.0 1.25)) - (f0-17 (get-rand-float-range obj 1.0 1.25)) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-on-ground) 13) + (set! (-> this anim-dive) 17) + (set! (-> this anim-get-up-back) 25) + (set! (-> this anim-get-up-front) 24) + (let ((f30-0 (get-rand-float-range this 1.0 1.25)) + (f0-17 (get-rand-float-range this 1.0 1.25)) ) - (set-vector! (-> obj root scale) f0-17 f30-0 f0-17 1.0) + (set-vector! (-> this root scale) f0-17 f30-0 f0-17 1.0) ) - (let ((f0-19 (get-rand-float-range obj 0.9 1.0))) - (set-vector! (-> obj draw color-mult) f0-19 f0-19 f0-19 1.0) + (let ((f0-19 (get-rand-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-19 f0-19 f0-19 1.0) ) - (set! (-> obj water-anim) 12) - (logior! (-> obj flags) (citizen-flag female)) + (set! (-> this water-anim) 12) + (logior! (-> this flags) (citizen-flag female)) 0 (none) ) ;; definition for method 181 of type citizen-chick ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen-chick ((obj citizen-chick)) +(defmethod citizen-init! citizen-chick ((this citizen-chick)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj dive-reaction) (* 0.2 (rand-vu))) - (logclear! (-> obj mask) (process-mask enemy)) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 16 0) - (setup-masks (-> obj draw) 8 0) - (let ((v1-11 (get-rand-int obj 3))) + (set! (-> this dive-reaction) (* 0.2 (rand-vu))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 8 0) + (let ((v1-11 (get-rand-int this 3))) (cond ((zero? v1-11) - (setup-masks (-> obj draw) 32 0) + (setup-masks (-> this draw) 32 0) ) ((= v1-11 1) - (setup-masks (-> obj draw) #x4000 0) + (setup-masks (-> this draw) #x4000 0) ) ((= v1-11 2) - (setup-masks (-> obj draw) #x8000 0) + (setup-masks (-> this draw) #x8000 0) ) ) ) - (let ((v1-20 (get-rand-int obj 3))) + (let ((v1-20 (get-rand-int this 3))) (cond ((zero? v1-20) - (setup-masks (-> obj draw) 64 0) + (setup-masks (-> this draw) 64 0) ) ((= v1-20 1) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) ((= v1-20 2) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ) ) - (let ((v1-29 (get-rand-int obj 3))) + (let ((v1-29 (get-rand-int this 3))) (cond ((zero? v1-29) - (setup-masks (-> obj draw) 4 0) + (setup-masks (-> this draw) 4 0) ) ((= v1-29 1) - (setup-masks (-> obj draw) 512 0) + (setup-masks (-> this draw) 512 0) ) ((= v1-29 2) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ) ) - (let ((v1-38 (get-rand-int obj 3))) + (let ((v1-38 (get-rand-int this 3))) (cond ((zero? v1-38) - (setup-masks (-> obj draw) 2 0) - (let ((v1-42 (get-rand-int obj 2))) + (setup-masks (-> this draw) 2 0) + (let ((v1-42 (get-rand-int this 2))) (cond ((zero? v1-42) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-42 1) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ) ) ) ((= v1-38 1) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ((= v1-38 2) - (setup-masks (-> obj draw) 2048 0) - (let ((v1-54 (get-rand-int obj 2))) + (setup-masks (-> this draw) 2048 0) + (let ((v1-54 (get-rand-int this 2))) (cond ((zero? v1-54) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-54 1) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ) ) ) ) ) - (logior! (-> obj flags) (citizen-flag female)) + (logior! (-> this flags) (citizen-flag female)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc index d16c2460e8..0898097ae1 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-enemy_REF.gc @@ -17,57 +17,57 @@ ) ;; definition for method 3 of type citizen-enemy -(defmethod inspect citizen-enemy ((obj citizen-enemy)) - (when (not obj) - (set! obj obj) +(defmethod inspect citizen-enemy ((this citizen-enemy)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type citizen inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnext-update-target: ~D~%" (-> obj next-update-target)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) + (format #t "~2Tnext-update-target: ~D~%" (-> this next-update-target)) + (format #t "~2Tminimap: #~%" (-> this minimap)) (label cfg-4) - obj + this ) ;; definition for method 55 of type citizen-enemy -(defmethod track-target! citizen-enemy ((obj citizen-enemy)) +(defmethod track-target! citizen-enemy ((this citizen-enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((a1-0 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-0 options) (overlaps-others-options)) - (set! (-> a1-0 collide-with-filter) (-> obj enemy-info overlaps-others-collide-with-filter)) + (set! (-> a1-0 collide-with-filter) (-> this enemy-info overlaps-others-collide-with-filter)) (set! (-> a1-0 tlist) *touching-list*) - (find-overlapping-shapes (-> obj root) a1-0) + (find-overlapping-shapes (-> this root) a1-0) ) - (when (and (not (focus-test? obj disable dead ignore inactive)) - (< (-> obj next-update-target) (current-time)) - (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (-> obj next-state) - (= (-> obj next-state name) 'active) + (when (and (not (focus-test? this disable dead ignore inactive)) + (< (-> this next-update-target) (current-time)) + (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) + (-> this next-state) + (= (-> this next-state name) 'active) ) - (citizen-enemy-method-202 obj) - (set! (-> obj next-update-target) (+ (current-time) (seconds 0.2))) - (traffic-danger-init! obj) + (citizen-enemy-method-202 this) + (set! (-> this next-update-target) (+ (current-time) (seconds 0.2))) + (traffic-danger-init! this) ) - ((method-of-type citizen track-target!) obj) + ((method-of-type citizen track-target!) this) (none) ) ;; definition for method 76 of type citizen-enemy ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 citizen-enemy ((obj citizen-enemy) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 citizen-enemy ((this citizen-enemy) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond - ((and (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'knocked) (= v1-3 'jump)) - ) + ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) ) - ((method-of-type citizen enemy-method-76) obj arg0 arg1) + ((method-of-type citizen enemy-method-76) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -79,30 +79,30 @@ ) ) (cond - ((and (focus-test? obj dangerous) + ((and (focus-test? this dangerous) (logtest? (process-mask guard civilian) (-> arg0 mask)) (and v1-6 (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) ) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s3-0) - (-> obj root) + (-> this root) (collide-action deadly) (collide-action) ) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry s3-0) - (-> obj root) + (-> this root) (collide-action persistent-attack) (collide-action) ) - (-> obj persistent-attack-id) - (-> obj attack-id) + (-> this persistent-attack-id) + (-> this attack-id) ) ) ) - (enemy-method-104 obj arg0 (the-as touching-shapes-entry s3-0) a3-2) + (enemy-method-104 this arg0 (the-as touching-shapes-entry s3-0) a3-2) ) ) (else @@ -117,7 +117,7 @@ ) ;; definition for method 74 of type citizen-enemy -(defmethod general-event-handler citizen-enemy ((obj citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler citizen-enemy ((this citizen-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -128,11 +128,11 @@ (case (-> arg3 param 0) (('death-default) (cond - ((> (-> obj hit-points) 0) + ((> (-> this hit-points) 0) #t ) (else - (let ((v1-4 (-> obj root root-prim))) + (let ((v1-4 (-> this root root-prim))) (set! (-> v1-4 prim-core collide-as) (collide-spec)) (set! (-> v1-4 prim-core collide-with) (collide-spec)) ) @@ -147,13 +147,13 @@ ) ) (('end-task) - (let ((v0-0 (the-as object (logclear (-> obj flags) (citizen-flag persistent))))) - (set! (-> obj flags) (the-as citizen-flag v0-0)) + (let ((v0-0 (the-as object (logclear (-> this flags) (citizen-flag persistent))))) + (set! (-> this flags) (the-as citizen-flag v0-0)) v0-0 ) ) (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -161,18 +161,18 @@ ;; definition for method 201 of type citizen-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod traffic-danger-init! citizen-enemy ((obj citizen-enemy)) +(defmethod traffic-danger-init! citizen-enemy ((this citizen-enemy)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) - (set! (-> a1-0 sphere quad) (-> obj root trans quad)) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> obj root transv quad)) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) (set! (-> a1-0 decay-rate) 0.0) (set! (-> a1-0 flags) (traffic-danger-flags tdf0)) (set! (-> a1-0 danger-type) (traffic-danger-type tdt7)) - (set! (-> a1-0 handle) (process->handle obj)) - (add-danger (-> obj controller traffic) a1-0) + (set! (-> a1-0 handle) (process->handle this)) + (add-danger (-> this controller traffic) a1-0) ) 0 (none) @@ -181,9 +181,9 @@ ;; definition for method 202 of type citizen-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod citizen-enemy-method-202 citizen-enemy ((obj citizen-enemy)) +(defmethod citizen-enemy-method-202 citizen-enemy ((this citizen-enemy)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root trans quad)) + (set! (-> s5-0 quad) (-> this root trans quad)) (set! (-> s5-0 w) 122880.0) (let ((s4-0 (the-as process-drawable #f))) (let ((f30-0 122880.0)) @@ -203,7 +203,7 @@ ) ) (when (and s1-1 - (!= obj s1-1) + (!= this s1-1) (not (focus-test? (the-as process-focusable s1-1) inactive)) (not (focus-test? (the-as process-focusable s1-1) disable)) (not (logtest? (process-mask enemy) (-> s1-1 mask))) @@ -212,7 +212,7 @@ s1-1 (not (logtest? (-> (the-as process-focusable s1-1) focus-status) (focus-status disable dead ignore grabbed))) ) - (let ((f0-1 (vector-vector-xz-distance (-> obj root trans) (-> s1-1 root trans)))) + (let ((f0-1 (vector-vector-xz-distance (-> this root trans) (-> s1-1 root trans)))) (when (or (not s4-0) (< f0-1 f30-0)) (set! s4-0 s1-1) (set! f30-0 f0-1) @@ -229,8 +229,8 @@ ) ) (when s4-0 - (try-update-focus (-> obj focus) (the-as process-focusable s4-0) obj) - (go-hostile obj) + (try-update-focus (-> this focus) (the-as process-focusable s4-0) this) + (go-hostile this) ) ) ) @@ -277,37 +277,37 @@ ;; definition for method 181 of type citizen-enemy ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen-enemy ((obj citizen-enemy)) +(defmethod citizen-init! citizen-enemy ((this citizen-enemy)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (if (-> obj skel effect) - (logior! (-> obj skel effect flags) (effect-control-flag ecf0)) + (if (-> this skel effect) + (logior! (-> this skel effect flags) (effect-control-flag ecf0)) ) - (logior! (-> obj mask) (process-mask enemy)) - (reset-to-collide-spec (-> obj focus) (collide-spec jak civilian player-list bot-targetable jak-vehicle)) - (let ((v1-12 (-> obj nav))) + (logior! (-> this mask) (process-mask enemy)) + (reset-to-collide-spec (-> this focus) (collide-spec jak civilian player-list bot-targetable jak-vehicle)) + (let ((v1-12 (-> this nav))) (set! (-> v1-12 sphere-mask) (the-as uint #x800e8)) ) 0 - (set! (-> obj anim-shuffle) (-> obj enemy-info walk-anim)) - (set! (-> obj anim-walk) (-> obj enemy-info walk-anim)) - (set! (-> obj speed-walk) (-> obj enemy-info walk-travel-speed)) - (set! (-> obj dist-walk-anim) (-> obj enemy-info walk-travel-speed)) - (set! (-> obj anim-run) (-> obj enemy-info run-anim)) - (set! (-> obj dist-run-anim) (-> obj enemy-info run-travel-speed)) - (set! (-> obj speed-run) (-> obj enemy-info walk-travel-speed)) - (set! (-> obj fated-time) 0) - (logior! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logior! (-> obj enemy-flags) (enemy-flag check-water)) - (logior! (-> obj enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) - (logclear! (-> obj focus-status) (focus-status dead)) - (logior! (-> obj mask) (process-mask collectable)) - (logior! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (if (not (-> obj minimap)) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this anim-shuffle) (-> this enemy-info walk-anim)) + (set! (-> this anim-walk) (-> this enemy-info walk-anim)) + (set! (-> this speed-walk) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-walk-anim) (-> this enemy-info walk-travel-speed)) + (set! (-> this anim-run) (-> this enemy-info run-anim)) + (set! (-> this dist-run-anim) (-> this enemy-info run-travel-speed)) + (set! (-> this speed-run) (-> this enemy-info walk-travel-speed)) + (set! (-> this fated-time) 0) + (logior! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag check-water)) + (logior! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) + (logclear! (-> this focus-status) (focus-status dead)) + (logior! (-> this mask) (process-mask collectable)) + (logior! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) ) (ja-channel-set! 0) 0 @@ -315,19 +315,19 @@ ) ;; definition for method 73 of type citizen-enemy -(defmethod kill-prefer-falling citizen-enemy ((obj citizen-enemy)) +(defmethod kill-prefer-falling citizen-enemy ((this citizen-enemy)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - ((method-of-type nav-enemy kill-prefer-falling) obj) + ((method-of-type nav-enemy kill-prefer-falling) this) ) ;; definition for method 70 of type citizen-enemy -(defmethod go-hostile citizen-enemy ((obj citizen-enemy)) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'hostile))) - (go (method-of-object obj hostile)) +(defmethod go-hostile citizen-enemy ((this citizen-enemy)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (go (method-of-object this hostile)) ) ) ;; definition for method 67 of type citizen-enemy -(defmethod go-stare citizen-enemy ((obj citizen-enemy)) - (go (method-of-object obj active)) +(defmethod go-stare citizen-enemy ((this citizen-enemy)) + (go (method-of-object this active)) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc index 2bcdf493bc..4828bd60fc 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-fat_REF.gc @@ -44,16 +44,16 @@ ) ;; definition for method 3 of type citizen-fat -(defmethod inspect citizen-fat ((obj citizen-fat)) - (when (not obj) - (set! obj obj) +(defmethod inspect citizen-fat ((this citizen-fat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type civilian inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol *citizen-fat-nav-enemy-info*, type nav-enemy-info @@ -231,22 +231,22 @@ (set! (-> *citizen-fat-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 26 of type citizen-fat -(defmethod get-inv-mass citizen-fat ((obj citizen-fat)) +(defmethod get-inv-mass citizen-fat ((this citizen-fat)) 0.5 ) ;; definition for method 51 of type citizen-fat ;; INFO: Used lq/sq -(defmethod enemy-method-51 citizen-fat ((obj citizen-fat)) - (let ((f30-0 (quaternion-y-angle (-> obj root quat)))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-51 citizen-fat ((this citizen-fat)) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (let ((a0-5 (handle->process (-> obj focus handle)))) + (let ((a0-5 (handle->process (-> this focus handle)))) (when a0-5 (get-trans (the-as process-focusable a0-5) 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root transv quad)) - (if (< (vector-dot (-> obj root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) (vector-negate-in-place! s5-0) @@ -258,14 +258,14 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> obj root transv quad)) - (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) 0.0) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) (f1-2 (deg- f30-0 f28-0)) (f2-0 (fabs f1-2)) - (f0-8 (-> obj enemy-info knocked-seek-ry-clamp)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) ) (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) (set! f30-0 (+ (cond @@ -298,26 +298,26 @@ ) ;; definition for method 79 of type citizen-fat -(defmethod enemy-method-79 citizen-fat ((obj citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 citizen-fat ((this citizen-fat) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let ((s5-0 (ja-done? 0))) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) ) (when s5-0 (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-6 (-> obj skel root-channel 0))) + (let ((a0-6 (-> this skel root-channel 0))) (set! (-> a0-6 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) ) (set! (-> a0-6 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) frames num-frames ) @@ -329,7 +329,7 @@ (set! (-> a0-6 frame-num) 3.0) (joint-control-channel-group! a0-6 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) num-func-seek! ) ) @@ -338,29 +338,29 @@ ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) ;; definition for method 77 of type citizen-fat -(defmethod enemy-method-77 citizen-fat ((obj citizen-fat) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 citizen-fat ((this citizen-fat) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.01)) - (let* ((a2-0 (ash 1 (-> obj info prev-yellow-hit))) - (v1-3 (enemy-method-120 obj 1 a2-0)) + (let* ((a2-0 (ash 1 (-> this info prev-yellow-hit))) + (v1-3 (enemy-method-120 this 1 a2-0)) (a1-7 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-3 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-3 8)) (the-as uint (-> this info)))) yellow-hit-anim 0 anim-index-front @@ -368,8 +368,8 @@ ) ) ) - (set! (-> obj info prev-yellow-hit) v1-3) - (let ((a0-15 (-> obj skel root-channel 0))) + (set! (-> this info prev-yellow-hit) v1-3) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-7)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) (set! (-> a0-15 param 1) (-> arg0 0)) @@ -380,14 +380,14 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let* ((a2-2 (ash 1 (-> obj info prev-blue-hit))) - (v1-12 (enemy-method-120 obj 3 a2-2)) + (let* ((a2-2 (ash 1 (-> this info prev-blue-hit))) + (v1-12 (enemy-method-120 this 3 a2-2)) (a1-14 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-12 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-12 8)) (the-as uint (-> this info)))) blue-hit-anim 0 anim-index-front @@ -395,8 +395,8 @@ ) ) ) - (set! (-> obj info prev-blue-hit) v1-12) - (let ((a0-30 (-> obj skel root-channel 0))) + (set! (-> this info prev-blue-hit) v1-12) + (let ((a0-30 (-> this skel root-channel 0))) (set! (-> a0-30 frame-group) (the-as art-joint-anim a1-14)) (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim a1-14) frames num-frames) -1))) (set! (-> a0-30 param 1) 1.0) @@ -406,14 +406,14 @@ ) ) (else - (let ((s4-0 (if (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) ) ) ) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-39 (-> obj skel root-channel 0))) + (let ((a0-39 (-> this skel root-channel 0))) (set! (-> a0-39 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-39 param 1) (-> arg0 0)) @@ -427,15 +427,15 @@ ) ;; definition for method 78 of type citizen-fat -(defmethod enemy-method-78 citizen-fat ((obj citizen-fat) (arg0 (pointer float))) +(defmethod enemy-method-78 citizen-fat ((this citizen-fat) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) ) (set! (-> a0-2 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) frames num-frames ) @@ -447,7 +447,7 @@ (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) num-func-seek! ) ) @@ -570,9 +570,9 @@ ;; definition for method 114 of type citizen-fat ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! citizen-fat ((obj citizen-fat)) +(defmethod init-enemy-collision! citizen-fat ((this citizen-fat)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -622,7 +622,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -630,218 +630,218 @@ ;; definition for method 115 of type citizen-fat ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! citizen-fat ((obj citizen-fat)) +(defmethod init-enemy! citizen-fat ((this citizen-fat)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-fat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *citizen-fat-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *citizen-fat-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 204800.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (set! (-> obj info) *citizen-fat-global-info*) - (try-update-focus (-> obj focus) *target* obj) - (set-vector! (-> obj neck twist-max) 10922.667 18204.445 0.0 1.0) - (set! (-> obj anim-shuffle) 12) - (let ((v1-18 (get-rand-int obj 3))) + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this info) *citizen-fat-global-info*) + (try-update-focus (-> this focus) *target* this) + (set-vector! (-> this neck twist-max) 10922.667 18204.445 0.0 1.0) + (set! (-> this anim-shuffle) 12) + (let ((v1-18 (get-rand-int this 3))) (cond ((zero? v1-18) - (set! (-> obj anim-walk) 11) - (set! (-> obj dist-walk-anim) 16384.0) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) ) ((= v1-18 1) - (set! (-> obj anim-walk) 13) - (set! (-> obj dist-walk-anim) 16384.0) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) ) ((= v1-18 2) - (set! (-> obj anim-walk) 14) - (set! (-> obj dist-walk-anim) 16384.0) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 14) + (set! (-> this dist-walk-anim) 16384.0) + (set! (-> this speed-walk) 12288.0) ) ) ) - (let ((v1-33 (get-rand-int obj 3))) + (let ((v1-33 (get-rand-int this 3))) (cond ((zero? v1-33) - (set! (-> obj anim-panic-run) 17) + (set! (-> this anim-panic-run) 17) ) ((= v1-33 1) - (set! (-> obj anim-panic-run) 17) + (set! (-> this anim-panic-run) 17) ) ((= v1-33 2) - (set! (-> obj anim-panic-run) 15) + (set! (-> this anim-panic-run) 15) ) ) ) - (set! (-> obj dist-run-anim) 20480.0) - (let ((v1-40 (get-rand-int obj 3))) + (set! (-> this dist-run-anim) 20480.0) + (let ((v1-40 (get-rand-int this 3))) (cond ((zero? v1-40) - (set! (-> obj anim-run) 15) + (set! (-> this anim-run) 15) ) ((= v1-40 1) - (set! (-> obj anim-run) 16) + (set! (-> this anim-run) 16) ) ((= v1-40 2) - (set! (-> obj anim-run) 16) + (set! (-> this anim-run) 16) ) ) ) - (set! (-> obj speed-run) 32768.0) - (set! (-> obj anim-on-ground) 19) - (set! (-> obj anim-dive) 18) - (set! (-> obj anim-get-up-back) 25) - (set! (-> obj anim-get-up-front) 24) - (let ((f30-0 (get-rand-float-range obj 1.0 1.25)) - (f0-15 (get-rand-float-range obj 1.0 1.25)) + (set! (-> this speed-run) 32768.0) + (set! (-> this anim-on-ground) 19) + (set! (-> this anim-dive) 18) + (set! (-> this anim-get-up-back) 25) + (set! (-> this anim-get-up-front) 24) + (let ((f30-0 (get-rand-float-range this 1.0 1.25)) + (f0-15 (get-rand-float-range this 1.0 1.25)) ) - (set-vector! (-> obj root scale) f0-15 f30-0 f0-15 1.0) + (set-vector! (-> this root scale) f0-15 f30-0 f0-15 1.0) ) - (let ((f0-17 (get-rand-float-range obj 0.9 1.0))) - (set-vector! (-> obj draw color-mult) f0-17 f0-17 f0-17 1.0) + (let ((f0-17 (get-rand-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-17 f0-17 f0-17 1.0) ) - (set! (-> obj water-anim) 32) + (set! (-> this water-anim) 32) 0 (none) ) ;; definition for method 181 of type citizen-fat ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen-fat ((obj citizen-fat)) +(defmethod citizen-init! citizen-fat ((this citizen-fat)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj dive-reaction) (* 0.2 (rand-vu))) - (logclear! (-> obj mask) (process-mask enemy)) - (setup-masks (-> obj draw) 0 -1) - (let ((v1-7 (get-rand-int obj 2))) + (set! (-> this dive-reaction) (* 0.2 (rand-vu))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (let ((v1-7 (get-rand-int this 2))) (cond ((zero? v1-7) - (setup-masks (-> obj draw) 8 0) - (let ((v1-11 (get-rand-int obj 3))) + (setup-masks (-> this draw) 8 0) + (let ((v1-11 (get-rand-int this 3))) (cond ((zero? v1-11) - (setup-masks (-> obj draw) 4 0) + (setup-masks (-> this draw) 4 0) ) ((= v1-11 1) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ((= v1-11 2) - (setup-masks (-> obj draw) #x8000 0) + (setup-masks (-> this draw) #x8000 0) ) ) ) - (let ((v1-20 (get-rand-int obj 4))) + (let ((v1-20 (get-rand-int this 4))) (cond ((zero? v1-20) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) ((= v1-20 1) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-20 2) - (setup-masks (-> obj draw) 130 0) + (setup-masks (-> this draw) 130 0) ) ) ) - (setup-masks (-> obj draw) 512 0) - (let ((v1-31 (get-rand-int obj 3))) + (setup-masks (-> this draw) 512 0) + (let ((v1-31 (get-rand-int this 3))) (cond ((zero? v1-31) - (setup-masks (-> obj draw) 64 0) + (setup-masks (-> this draw) 64 0) ) ((= v1-31 1) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ((= v1-31 2) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ) ) - (let ((v1-40 (get-rand-int obj 3))) + (let ((v1-40 (get-rand-int this 3))) (cond ((zero? v1-40) - (setup-masks (-> obj draw) 32 0) + (setup-masks (-> this draw) 32 0) ) ((= v1-40 1) - (setup-masks (-> obj draw) 2048 0) + (setup-masks (-> this draw) 2048 0) ) ((= v1-40 2) - (setup-masks (-> obj draw) #x20000 0) + (setup-masks (-> this draw) #x20000 0) ) ) ) - (let ((v1-49 (get-rand-int obj 3))) + (let ((v1-49 (get-rand-int this 3))) (cond ((zero? v1-49) - (setup-masks (-> obj draw) 16 0) + (setup-masks (-> this draw) 16 0) ) ((= v1-49 1) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) ((= v1-49 2) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ) ) ) ((= v1-7 1) - (setup-masks (-> obj draw) #x400000 0) - (setup-masks (-> obj draw) #x200000 0) - (let ((v1-63 (get-rand-int obj 2))) + (setup-masks (-> this draw) #x400000 0) + (setup-masks (-> this draw) #x200000 0) + (let ((v1-63 (get-rand-int this 2))) (cond ((zero? v1-63) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ((= v1-63 1) - (setup-masks (-> obj draw) #x80000 0) + (setup-masks (-> this draw) #x80000 0) ) ) ) - (let ((v1-70 (get-rand-int obj 2))) + (let ((v1-70 (get-rand-int this 2))) (cond ((zero? v1-70) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ((= v1-70 1) - (setup-masks (-> obj draw) #x100000 0) + (setup-masks (-> this draw) #x100000 0) ) ) ) - (let ((v1-77 (get-rand-int obj 4))) + (let ((v1-77 (get-rand-int this 4))) (cond ((zero? v1-77) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) ((= v1-77 1) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-77 2) - (setup-masks (-> obj draw) 130 0) + (setup-masks (-> this draw) 130 0) ) ) ) - (if (zero? (get-rand-int obj 1)) - (setup-masks (-> obj draw) #x20000 0) + (if (zero? (get-rand-int this 1)) + (setup-masks (-> this draw) #x20000 0) ) - (let ((v1-91 (get-rand-int obj 3))) + (let ((v1-91 (get-rand-int this 3))) (cond ((zero? v1-91) - (setup-masks (-> obj draw) 16 0) + (setup-masks (-> this draw) 16 0) ) ((= v1-91 1) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) ((= v1-91 2) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-h_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-h_REF.gc index 7a03b11714..02bb3df96a 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-h_REF.gc @@ -66,16 +66,16 @@ ) ;; definition for method 3 of type citizen -(defmethod inspect citizen ((obj citizen)) - (when (not obj) - (set! obj obj) +(defmethod inspect citizen ((this citizen)) + (when (not this) + (set! this this) (goto cfg-26) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tflags: #x~X : (citizen-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "~2Tflags: #x~X : (citizen-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (citizen-flag female)) (citizen-flag female)) (format #t "female ") ) @@ -111,43 +111,39 @@ ) ) (format #t ")~%") - (format #t "~2Ttraffic-id: ~D~%" (-> obj traffic-id)) - (format #t "~2Thit-by-player-count: ~D~%" (-> obj hit-by-player-count)) - (format #t "~2Tgnd-height: ~f~%" (-> obj gnd-height)) - (format #t "~2Tspeed-scale: ~f~%" (-> obj speed-scale)) - (format #t "~2Tcontroller: #~%" (-> obj controller)) - (format #t "~2Tdanger-pos: #~%" (-> obj danger-pos)) - (format #t "~2Tdest-point: #~%" (-> obj controller turn-exit-point)) - (format #t "~2Tvehicle: ~D~%" (-> obj vehicle)) - (format #t "~2Tanim-shuffle: ~D~%" (-> obj anim-shuffle)) - (format #t "~2Tdist-walk-anim: ~f~%" (-> obj dist-walk-anim)) - (format #t "~2Tspeed-walk: ~f~%" (-> obj speed-walk)) - (format #t "~2Tanim-walk: ~D~%" (-> obj anim-walk)) - (format #t "~2Tdist-run-anim: ~f~%" (-> obj dist-run-anim)) - (format #t "~2Tspeed-run: ~f~%" (-> obj speed-run)) - (format #t "~2Tanim-run: ~D~%" (-> obj anim-run)) - (format #t "~2Twater-anim: ~D~%" (-> obj water-anim)) - (format #t "~2Tinterp: ~f~%" (-> obj interp)) - (format #t "~2Tlast-danger-time: ~D~%" (-> obj last-danger-time)) - (format #t "~2Tnext-time-look-at: ~D~%" (-> obj next-time-look-at)) - (format #t "~2Tstop-time-look-at: ~D~%" (-> obj stop-time-look-at)) - (format #t "~2Twait-return-state: ~A~%" (-> obj wait-return-state)) - (format #t "~2Twait-time: ~D~%" (-> obj wait-time)) - (format #t "~2Tcp-valid?: ~A~%" (-> obj cp-valid?)) - (format #t "~2Tcp-sphere: #~%" (-> obj cp-sphere)) - (format #t "~2Tcp-vec: #~%" (-> obj cp-vec)) - (format #t "~2Tcp-next-time: ~D~%" (-> obj cp-next-time)) - (format #t "~2Tcp-exit-time: ~D~%" (-> obj cp-exit-time)) - (format #t "~2Tcp-force: #~%" (-> obj cp-force)) - (format #t "~2Tcp-plane: #~%" (-> obj cp-plane)) - (format #t "~2Tcp-factor: ~f~%" (-> obj cp-factor)) + (format #t "~2Ttraffic-id: ~D~%" (-> this traffic-id)) + (format #t "~2Thit-by-player-count: ~D~%" (-> this hit-by-player-count)) + (format #t "~2Tgnd-height: ~f~%" (-> this gnd-height)) + (format #t "~2Tspeed-scale: ~f~%" (-> this speed-scale)) + (format #t "~2Tcontroller: #~%" (-> this controller)) + (format #t "~2Tdanger-pos: #~%" (-> this danger-pos)) + (format #t "~2Tdest-point: #~%" (-> this controller turn-exit-point)) + (format #t "~2Tvehicle: ~D~%" (-> this vehicle)) + (format #t "~2Tanim-shuffle: ~D~%" (-> this anim-shuffle)) + (format #t "~2Tdist-walk-anim: ~f~%" (-> this dist-walk-anim)) + (format #t "~2Tspeed-walk: ~f~%" (-> this speed-walk)) + (format #t "~2Tanim-walk: ~D~%" (-> this anim-walk)) + (format #t "~2Tdist-run-anim: ~f~%" (-> this dist-run-anim)) + (format #t "~2Tspeed-run: ~f~%" (-> this speed-run)) + (format #t "~2Tanim-run: ~D~%" (-> this anim-run)) + (format #t "~2Twater-anim: ~D~%" (-> this water-anim)) + (format #t "~2Tinterp: ~f~%" (-> this interp)) + (format #t "~2Tlast-danger-time: ~D~%" (-> this last-danger-time)) + (format #t "~2Tnext-time-look-at: ~D~%" (-> this next-time-look-at)) + (format #t "~2Tstop-time-look-at: ~D~%" (-> this stop-time-look-at)) + (format #t "~2Twait-return-state: ~A~%" (-> this wait-return-state)) + (format #t "~2Twait-time: ~D~%" (-> this wait-time)) + (format #t "~2Tcp-valid?: ~A~%" (-> this cp-valid?)) + (format #t "~2Tcp-sphere: #~%" (-> this cp-sphere)) + (format #t "~2Tcp-vec: #~%" (-> this cp-vec)) + (format #t "~2Tcp-next-time: ~D~%" (-> this cp-next-time)) + (format #t "~2Tcp-exit-time: ~D~%" (-> this cp-exit-time)) + (format #t "~2Tcp-force: #~%" (-> this cp-force)) + (format #t "~2Tcp-plane: #~%" (-> this cp-plane)) + (format #t "~2Tcp-factor: ~f~%" (-> this cp-factor)) (label cfg-26) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc index a6e6c56ae1..9060bd4a37 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen-norm_REF.gc @@ -51,16 +51,16 @@ ) ;; definition for method 3 of type citizen-norm -(defmethod inspect citizen-norm ((obj citizen-norm)) - (when (not obj) - (set! obj obj) +(defmethod inspect citizen-norm ((this citizen-norm)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type civilian inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol *citizen-norm-nav-enemy-info*, type nav-enemy-info @@ -241,21 +241,21 @@ ;; definition for method 51 of type citizen-norm ;; INFO: Used lq/sq -(defmethod enemy-method-51 citizen-norm ((obj citizen-norm)) +(defmethod enemy-method-51 citizen-norm ((this citizen-norm)) (cond - ((logtest? (-> obj flags) (citizen-flag knocked-out-car knocked-out-bike)) - ((method-of-type nav-enemy enemy-method-51) obj) + ((logtest? (-> this flags) (citizen-flag knocked-out-car knocked-out-bike)) + ((method-of-type nav-enemy enemy-method-51) this) ) (else - (let ((f30-0 (quaternion-y-angle (-> obj root quat)))) - (case (-> obj incoming knocked-type) + (let ((f30-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (let ((a0-6 (handle->process (-> obj focus handle)))) + (let ((a0-6 (handle->process (-> this focus handle)))) (when a0-6 (get-trans (the-as process-focusable a0-6) 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root transv quad)) - (if (< (vector-dot (-> obj root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) (vector-negate-in-place! s5-0) @@ -267,14 +267,14 @@ ) (else (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> obj root transv quad)) - (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) 0.0) + (set! (-> s5-1 quad) (-> this root transv quad)) + (if (< (vector-dot s5-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0) (vector-negate-in-place! s5-1) ) (let* ((f28-0 (atan (-> s5-1 x) (-> s5-1 z))) (f1-2 (deg- f30-0 f28-0)) (f2-0 (fabs f1-2)) - (f0-8 (-> obj enemy-info knocked-seek-ry-clamp)) + (f0-8 (-> this enemy-info knocked-seek-ry-clamp)) ) (when (and (< f0-8 f2-0) (< f2-0 (- 32768.0 f0-8))) (set! f30-0 (+ (cond @@ -309,26 +309,26 @@ ) ;; definition for method 79 of type citizen-norm -(defmethod enemy-method-79 citizen-norm ((obj citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 citizen-norm ((this citizen-norm) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((1) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let ((s5-0 (ja-done? 0))) - (let ((a0-4 (-> obj skel root-channel 0))) + (let ((a0-4 (-> this skel root-channel 0))) (set! (-> a0-4 param 0) (the float (+ (-> a0-4 frame-group frames num-frames) -1))) (set! (-> a0-4 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-4 (the-as art-joint-anim #f) num-func-seek!) ) (when s5-0 (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-6 (-> obj skel root-channel 0))) + (let ((a0-6 (-> this skel root-channel 0))) (set! (-> a0-6 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) ) (set! (-> a0-6 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) frames num-frames ) @@ -340,7 +340,7 @@ (set! (-> a0-6 frame-num) 3.0) (joint-control-channel-group! a0-6 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked (-> this hit-face)))) num-func-seek! ) ) @@ -349,56 +349,56 @@ ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) ;; definition for method 77 of type citizen-norm -(defmethod enemy-method-77 citizen-norm ((obj citizen-norm) (arg0 (pointer float))) +(defmethod enemy-method-77 citizen-norm ((this citizen-norm) (arg0 (pointer float))) (local-vars (v1-36 knocked-type)) (cond - ((logtest? (-> obj flags) (citizen-flag knocked-out-car)) + ((logtest? (-> this flags) (citizen-flag knocked-out-car)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 33))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 33)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 33)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) ) - (logclear! (-> obj flags) (citizen-flag knocked-out-car)) + (logclear! (-> this flags) (citizen-flag knocked-out-car)) ) - ((logtest? (-> obj flags) (citizen-flag knocked-out-bike)) + ((logtest? (-> this flags) (citizen-flag knocked-out-bike)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 34))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 34))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 34)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 34)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 34)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 34)) num-func-seek!) ) - (logclear! (-> obj flags) (citizen-flag knocked-out-bike)) + (logclear! (-> this flags) (citizen-flag knocked-out-bike)) ) - ((begin (set! v1-36 (-> obj incoming knocked-type)) (= v1-36 (knocked-type knocked-type-4))) + ((begin (set! v1-36 (-> this incoming knocked-type)) (= v1-36 (knocked-type knocked-type-4))) (ja-channel-push! 1 (seconds 0.1)) - (let* ((a2-2 (ash 1 (-> obj info prev-yellow-hit))) - (v1-39 (enemy-method-120 obj 1 a2-2)) + (let* ((a2-2 (ash 1 (-> this info prev-yellow-hit))) + (v1-39 (enemy-method-120 this 1 a2-2)) (a1-11 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-39 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-39 8)) (the-as uint (-> this info)))) yellow-hit-anim 0 anim-index-front @@ -406,8 +406,8 @@ ) ) ) - (set! (-> obj info prev-yellow-hit) v1-39) - (let ((a0-21 (-> obj skel root-channel 0))) + (set! (-> this info prev-yellow-hit) v1-39) + (let ((a0-21 (-> this skel root-channel 0))) (set! (-> a0-21 frame-group) (the-as art-joint-anim a1-11)) (set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1))) (set! (-> a0-21 param 1) (-> arg0 0)) @@ -418,14 +418,14 @@ ) ((= v1-36 (knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let* ((a2-4 (ash 1 (-> obj info prev-blue-hit))) - (v1-48 (enemy-method-120 obj 3 a2-4)) + (let* ((a2-4 (ash 1 (-> this info prev-blue-hit))) + (v1-48 (enemy-method-120 this 3 a2-4)) (a1-18 - (-> obj + (-> this draw art-group data - (-> (the-as civilian-global-info (+ (+ (* (-> obj hit-face) 4) (* v1-48 8)) (the-as uint (-> obj info)))) + (-> (the-as civilian-global-info (+ (+ (* (-> this hit-face) 4) (* v1-48 8)) (the-as uint (-> this info)))) blue-hit-anim 0 anim-index-front @@ -433,8 +433,8 @@ ) ) ) - (set! (-> obj info prev-blue-hit) v1-48) - (let ((a0-36 (-> obj skel root-channel 0))) + (set! (-> this info prev-blue-hit) v1-48) + (let ((a0-36 (-> this skel root-channel 0))) (set! (-> a0-36 frame-group) (the-as art-joint-anim a1-18)) (set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-18) frames num-frames) -1))) (set! (-> a0-36 param 1) 1.0) @@ -444,19 +444,19 @@ ) ) (else - (let ((s4-0 (if (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) - (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))) + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) + (-> this draw art-group data (-> this info knocked (-> this hit-face))) ) ) ) (ja-channel-push! 1 (seconds 0.1)) - (if (or (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (= (-> obj incoming knocked-type) (knocked-type knocked-type-3)) + (if (or (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (= (-> this incoming knocked-type) (knocked-type knocked-type-3)) ) (set! (-> arg0 0) (* 0.5 (-> arg0 0))) ) - (let ((a0-47 (-> obj skel root-channel 0))) + (let ((a0-47 (-> this skel root-channel 0))) (set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-47 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-47 param 1) (-> arg0 0)) @@ -470,16 +470,16 @@ ) ;; definition for method 78 of type citizen-norm -(defmethod enemy-method-78 citizen-norm ((obj citizen-norm) (arg0 (pointer float))) +(defmethod enemy-method-78 citizen-norm ((this citizen-norm) (arg0 (pointer float))) (ja-channel-push! 1 (seconds 0.1)) (set! (-> arg0 0) 1.0) - (let ((a0-2 (-> obj skel root-channel 0))) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) ) (set! (-> a0-2 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) frames num-frames ) @@ -491,7 +491,7 @@ (set! (-> a0-2 frame-num) 0.0) (joint-control-channel-group! a0-2 - (the-as art-joint-anim (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) + (the-as art-joint-anim (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) num-func-seek! ) ) @@ -615,82 +615,82 @@ ;; definition for method 199 of type citizen-norm ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-behavior! citizen-norm ((obj citizen-norm) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! citizen-norm ((this citizen-norm) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((11) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-22)) - (set! (-> obj root trans quad) (-> arg0 position quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 rotation)) - (set! (-> obj vehicle) (-> arg0 handle)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-22)) + (set! (-> this root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> this root quat) (-> arg0 rotation)) + (set! (-> this vehicle) (-> arg0 handle)) (ja-channel-set! 1) - (case (-> (the-as vehicle (handle->process (-> obj vehicle))) info object-type) + (case (-> (the-as vehicle (handle->process (-> this vehicle))) info object-type) ((11 12 13) - (logior! (-> obj flags) (citizen-flag knocked-out-bike)) - (let ((v1-16 (-> obj skel root-channel 0))) - (set! (-> v1-16 frame-group) (the-as art-joint-anim (-> obj draw art-group data 30))) + (logior! (-> this flags) (citizen-flag knocked-out-bike)) + (let ((v1-16 (-> this skel root-channel 0))) + (set! (-> v1-16 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) ) ) ((14 15 16) - (logior! (-> obj flags) (citizen-flag knocked-out-car)) - (let ((v1-22 (-> obj skel root-channel 0))) - (set! (-> v1-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 31))) + (logior! (-> this flags) (citizen-flag knocked-out-car)) + (let ((v1-22 (-> this skel root-channel 0))) + (set! (-> v1-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 31))) ) ) ) (ja-post) - (setup-masks (-> obj draw) 0 -1) + (setup-masks (-> this draw) 0 -1) (let ((s5-1 (-> arg0 user-data))) (if (not (logtest? s5-1 32)) - (setup-masks (-> obj draw) 32 0) + (setup-masks (-> this draw) 32 0) ) (if (not (logtest? s5-1 16)) - (setup-masks (-> obj draw) 16 0) + (setup-masks (-> this draw) 16 0) ) (if (not (logtest? s5-1 2)) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) (if (not (logtest? s5-1 4096)) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) (if (not (logtest? s5-1 8)) - (setup-masks (-> obj draw) 8 0) + (setup-masks (-> this draw) 8 0) ) (if (not (logtest? s5-1 512)) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) (if (not (logtest? s5-1 #x4000)) - (setup-masks (-> obj draw) #x8000 0) + (setup-masks (-> this draw) #x8000 0) ) (if (not (logtest? s5-1 4)) - (setup-masks (-> obj draw) 4 0) + (setup-masks (-> this draw) 4 0) ) (if (not (logtest? s5-1 256)) - (setup-masks (-> obj draw) 512 0) + (setup-masks (-> this draw) 512 0) ) (if (not (logtest? s5-1 8192)) - (setup-masks (-> obj draw) #x4000 0) + (setup-masks (-> this draw) #x4000 0) ) (if (not (logtest? s5-1 64)) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) (if (not (logtest? s5-1 2048)) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) (if (not (logtest? #x10000 s5-1)) - (setup-masks (-> obj draw) #x20000 0) + (setup-masks (-> this draw) #x20000 0) ) (if (not (logtest? s5-1 128)) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) (if (logtest? #x40000 s5-1) - (setup-masks (-> obj draw) 2048 0) - (setup-masks (-> obj draw) 2048 0) + (setup-masks (-> this draw) 2048 0) + (setup-masks (-> this draw) 2048 0) ) ) - (go (method-of-object obj knocked-off-vehicle)) + (go (method-of-object this knocked-off-vehicle)) ) (else - ((method-of-type civilian set-behavior!) obj arg0) + ((method-of-type civilian set-behavior!) this arg0) ) ) 0 @@ -712,9 +712,9 @@ ;; definition for method 114 of type citizen-norm ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! citizen-norm ((obj citizen-norm)) +(defmethod init-enemy-collision! citizen-norm ((this citizen-norm)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -770,7 +770,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -778,184 +778,184 @@ ;; definition for method 115 of type citizen-norm ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! citizen-norm ((obj citizen-norm)) +(defmethod init-enemy! citizen-norm ((this citizen-norm)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *citizen-norm-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *citizen-norm-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 204800.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (try-update-focus (-> obj focus) *target* obj) - (-> obj neck) - (set! (-> obj info) *citizen-norm-global-info*) - (set! (-> obj anim-shuffle) 11) - (let ((v1-18 (get-rand-int obj 3))) + (set! (-> this draw lod-set lod 0 dist) 204800.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (try-update-focus (-> this focus) *target* this) + (-> this neck) + (set! (-> this info) *citizen-norm-global-info*) + (set! (-> this anim-shuffle) 11) + (let ((v1-18 (get-rand-int this 3))) (cond ((zero? v1-18) - (set! (-> obj anim-walk) 12) - (set! (-> obj dist-walk-anim) 8736.768) - (set! (-> obj speed-walk) 10240.0) + (set! (-> this anim-walk) 12) + (set! (-> this dist-walk-anim) 8736.768) + (set! (-> this speed-walk) 10240.0) ) ((= v1-18 1) - (set! (-> obj anim-walk) 13) - (set! (-> obj dist-walk-anim) 13107.2) - (set! (-> obj speed-walk) 12288.0) + (set! (-> this anim-walk) 13) + (set! (-> this dist-walk-anim) 13107.2) + (set! (-> this speed-walk) 12288.0) ) ((= v1-18 2) - (set! (-> obj anim-walk) 11) - (set! (-> obj dist-walk-anim) 4370.432) - (set! (-> obj speed-walk) 4096.0) + (set! (-> this anim-walk) 11) + (set! (-> this dist-walk-anim) 4370.432) + (set! (-> this speed-walk) 4096.0) ) ) ) - (let ((v1-33 (get-rand-int obj 3))) + (let ((v1-33 (get-rand-int this 3))) (cond ((zero? v1-33) - (set! (-> obj anim-panic-run) 15) + (set! (-> this anim-panic-run) 15) ) ((= v1-33 1) - (set! (-> obj anim-panic-run) 15) + (set! (-> this anim-panic-run) 15) ) ((= v1-33 2) - (set! (-> obj anim-panic-run) 14) + (set! (-> this anim-panic-run) 14) ) ) ) - (set! (-> obj dist-run-anim) 28672.0) - (let ((v1-40 (get-rand-int obj 3))) + (set! (-> this dist-run-anim) 28672.0) + (let ((v1-40 (get-rand-int this 3))) (cond ((zero? v1-40) - (set! (-> obj anim-run) 14) + (set! (-> this anim-run) 14) ) ((= v1-40 1) - (set! (-> obj anim-run) 14) + (set! (-> this anim-run) 14) ) ((= v1-40 2) - (set! (-> obj anim-run) 14) + (set! (-> this anim-run) 14) ) ) ) - (set! (-> obj speed-run) 49152.0) - (set! (-> obj anim-on-ground) 17) - (set! (-> obj anim-dive) 16) - (set! (-> obj anim-get-up-front) 22) - (set! (-> obj anim-get-up-back) 23) - (let ((f30-0 (get-rand-float-range obj 1.0 1.25)) - (f0-11 (get-rand-float-range obj 1.0 1.25)) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-on-ground) 17) + (set! (-> this anim-dive) 16) + (set! (-> this anim-get-up-front) 22) + (set! (-> this anim-get-up-back) 23) + (let ((f30-0 (get-rand-float-range this 1.0 1.25)) + (f0-11 (get-rand-float-range this 1.0 1.25)) ) - (set-vector! (-> obj root scale) f0-11 f30-0 f0-11 1.0) + (set-vector! (-> this root scale) f0-11 f30-0 f0-11 1.0) ) - (let ((f0-13 (get-rand-float-range obj 0.9 1.0))) - (set-vector! (-> obj draw color-mult) f0-13 f0-13 f0-13 1.0) + (let ((f0-13 (get-rand-float-range this 0.9 1.0))) + (set-vector! (-> this draw color-mult) f0-13 f0-13 f0-13 1.0) ) - (set! (-> obj water-anim) 29) + (set! (-> this water-anim) 29) 0 (none) ) ;; definition for method 181 of type citizen-norm ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen-norm ((obj citizen-norm)) +(defmethod citizen-init! citizen-norm ((this citizen-norm)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type civilian citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj dive-reaction) (+ 0.09 (* 0.15 (rand-vu)))) - (logclear! (-> obj mask) (process-mask enemy)) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 32 0) - (let ((v1-10 (get-rand-int obj 4))) + (set! (-> this dive-reaction) (+ 0.09 (* 0.15 (rand-vu)))) + (logclear! (-> this mask) (process-mask enemy)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 32 0) + (let ((v1-10 (get-rand-int this 4))) (cond ((zero? v1-10) - (setup-masks (-> obj draw) 64 0) + (setup-masks (-> this draw) 64 0) ) ((= v1-10 1) - (setup-masks (-> obj draw) 2048 0) + (setup-masks (-> this draw) 2048 0) ) ((= v1-10 2) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ((= v1-10 3) - (setup-masks (-> obj draw) #x200000 0) + (setup-masks (-> this draw) #x200000 0) ) ) ) - (let ((v1-21 (get-rand-int obj 3))) + (let ((v1-21 (get-rand-int this 3))) (cond ((zero? v1-21) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) ((= v1-21 1) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ((= v1-21 2) - (setup-masks (-> obj draw) #x40000 0) + (setup-masks (-> this draw) #x40000 0) ) ) ) - (let ((v1-30 (get-rand-int obj 4))) + (let ((v1-30 (get-rand-int this 4))) (cond ((zero? v1-30) - (setup-masks (-> obj draw) 8 0) + (setup-masks (-> this draw) 8 0) ) ((= v1-30 1) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) ((= v1-30 2) - (setup-masks (-> obj draw) #x8000 0) + (setup-masks (-> this draw) #x8000 0) ) ((= v1-30 3) - (setup-masks (-> obj draw) #x100000 0) + (setup-masks (-> this draw) #x100000 0) ) ) ) - (let ((v1-41 (get-rand-int obj 5))) + (let ((v1-41 (get-rand-int this 5))) (cond ((zero? v1-41) - (setup-masks (-> obj draw) 4 0) + (setup-masks (-> this draw) 4 0) ) ((= v1-41 1) - (setup-masks (-> obj draw) 512 0) + (setup-masks (-> this draw) 512 0) ) ((= v1-41 2) - (setup-masks (-> obj draw) #x4000 0) + (setup-masks (-> this draw) #x4000 0) ) ((= v1-41 3) - (setup-masks (-> obj draw) #x80000 0) + (setup-masks (-> this draw) #x80000 0) ) ) ) - (let ((v1-52 (get-rand-int obj 4))) + (let ((v1-52 (get-rand-int this 4))) (cond ((zero? v1-52) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-52 1) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ((= v1-52 2) - (setup-masks (-> obj draw) #x20000 0) + (setup-masks (-> this draw) #x20000 0) ) ((= v1-52 3) - (setup-masks (-> obj draw) #x400000 0) + (setup-masks (-> this draw) #x400000 0) ) ) ) - (setup-masks (-> obj draw) 16 0) - (let ((v1-65 (get-rand-int obj 4))) + (setup-masks (-> this draw) 16 0) + (let ((v1-65 (get-rand-int this 4))) (cond ((zero? v1-65) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ((= v1-65 1) - (setup-masks (-> obj draw) #x800000 0) + (setup-masks (-> this draw) #x800000 0) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc index 646b7971f5..b164d0ec06 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/citizen_REF.gc @@ -6,12 +6,12 @@ ;; definition for method 182 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod citizen-nav-init! citizen ((obj citizen)) +(defmethod citizen-nav-init! citizen ((this citizen)) "Initialize nav related fields." - (let ((v1-0 (-> obj nav))) + (let ((v1-0 (-> this nav))) (logclear! (-> v1-0 flags) (nav-control-flag limit-rotation-rate output-sphere-hash)) - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43)))) (let ((a1-6 v1-0)) (set! (-> a1-6 sphere-mask) (the-as uint #x800fe)) ) @@ -22,8 +22,8 @@ 0 (logclear! (-> v1-0 flags) (nav-control-flag output-sphere-hash)) ) - (set! (-> obj enemy-info callback-info) *nav-enemy-physics-callback-info*) - (let ((v1-2 obj)) + (set! (-> this enemy-info callback-info) *nav-enemy-physics-callback-info*) + (let ((v1-2 this)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) ) @@ -37,70 +37,70 @@ ;; definition for method 181 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! citizen ((obj citizen)) +(defmethod citizen-init! citizen ((this citizen)) "Initialize [[citizen]] defaults." - (logior! (-> obj fact enemy-options) (enemy-option knocked-into-water)) - (if (-> obj skel effect) - (logclear! (-> obj skel effect flags) (effect-control-flag ecf2)) + (logior! (-> this fact enemy-options) (enemy-option knocked-into-water)) + (if (-> this skel effect) + (logclear! (-> this skel effect flags) (effect-control-flag ecf2)) ) - (set! (-> obj draw death-draw-overlap) (the-as uint 0)) - (set! (-> obj draw death-timer) (the-as uint 0)) - (set! (-> obj draw death-timer-org) (the-as uint 0)) - (set! (-> obj draw death-vertex-skip) (the-as uint 0)) - (set! (-> obj draw death-effect) (the-as uint 0)) - (logclear! (-> obj focus-status) (focus-status disable dead inactive hit)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (clear-focused (-> obj focus)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logand (enemy-flag dislike-combo) (-> obj enemy-flags)))) - (logclear! (-> obj draw status) (draw-control-status no-draw lod-set)) - (set! (-> obj draw death-timer) (the-as uint 0)) - (logior! (-> obj root nav-flags) (nav-flags has-root-sphere)) - (let ((v1-28 (-> obj root root-prim))) - (set! (-> v1-28 prim-core collide-as) (-> obj root backup-collide-as)) - (set! (-> v1-28 prim-core collide-with) (-> obj root backup-collide-with)) + (set! (-> this draw death-draw-overlap) (the-as uint 0)) + (set! (-> this draw death-timer) (the-as uint 0)) + (set! (-> this draw death-timer-org) (the-as uint 0)) + (set! (-> this draw death-vertex-skip) (the-as uint 0)) + (set! (-> this draw death-effect) (the-as uint 0)) + (logclear! (-> this focus-status) (focus-status disable dead inactive hit)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (clear-focused (-> this focus)) + (set! (-> this enemy-flags) (the-as enemy-flag (logand (enemy-flag dislike-combo) (-> this enemy-flags)))) + (logclear! (-> this draw status) (draw-control-status no-draw lod-set)) + (set! (-> this draw death-timer) (the-as uint 0)) + (logior! (-> this root nav-flags) (nav-flags has-root-sphere)) + (let ((v1-28 (-> this root root-prim))) + (set! (-> v1-28 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-28 prim-core collide-with) (-> this root backup-collide-with)) ) - (set! (-> obj root penetrated-by) (penetrate - generic-attack - lunge - flop - punch - spin - roll - uppercut - bonk - tube - vehicle - flut-attack - board - mech-punch - dark-punch - dark-giant - ) + (set! (-> this root penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + dark-punch + dark-giant + ) ) - (logior! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logior! (-> obj enemy-flags) (enemy-flag check-water)) - (logior! (-> obj enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) - (logior! (-> obj mask) (process-mask collectable)) - (logior! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (set! (-> obj hit-points) (-> obj enemy-info default-hit-points)) - (set! (-> obj fated-time) 0) - (set! (-> obj hit-by-player-count) 0) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj draw color-emissive) 0.0 0.0 0.0 1.0) - (update-transforms (-> obj root)) + (logior! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag check-water)) + (logior! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) + (logior! (-> this mask) (process-mask collectable)) + (logior! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) + (set! (-> this fated-time) 0) + (set! (-> this hit-by-player-count) 0) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 0.0 0.0 1.0) + (update-transforms (-> this root)) 0 (none) ) ;; definition for method 57 of type citizen ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! citizen ((obj citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! citizen ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" (when arg1 - (let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> obj root trans)))) + (let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans)))) (when (< f0-0 (-> arg1 rating)) (set! (-> arg1 rating) f0-0) (set! (-> arg1 proc) arg0) @@ -112,64 +112,64 @@ ) ;; definition for method 61 of type citizen -(defmethod enemy-method-61 citizen ((obj citizen) (arg0 int)) +(defmethod enemy-method-61 citizen ((this citizen) (arg0 int)) 3 ) ;; definition for method 67 of type citizen -(defmethod go-stare citizen ((obj citizen)) - (go (method-of-object obj flee)) +(defmethod go-stare citizen ((this citizen)) + (go (method-of-object this flee)) ) ;; definition for method 70 of type citizen ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile citizen ((obj citizen)) - (go-inactive obj) +(defmethod go-hostile citizen ((this citizen)) + (go-inactive this) ) ;; definition for method 71 of type citizen -(defmethod go-flee citizen ((obj citizen)) - (go (method-of-object obj flee)) +(defmethod go-flee citizen ((this citizen)) + (go (method-of-object this flee)) ) ;; definition for method 72 of type citizen -(defmethod react-to-focus citizen ((obj citizen)) +(defmethod react-to-focus citizen ((this citizen)) "@TODO - flesh out docs" - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ;; definition for method 73 of type citizen ;; WARN: Return type mismatch none vs object. -(defmethod kill-prefer-falling citizen ((obj citizen)) +(defmethod kill-prefer-falling citizen ((this citizen)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (logclear! (-> obj flags) (citizen-flag persistent)) - (send-event (ppointer->process (-> obj parent)) 'child-killed) - (go-inactive obj) + (logclear! (-> this flags) (citizen-flag persistent)) + (send-event (ppointer->process (-> this parent)) 'child-killed) + (go-inactive this) ) ;; definition for method 17 of type citizen -(defmethod cleanup-for-death citizen ((obj citizen)) - (logclear! (-> obj flags) (citizen-flag persistent)) - (send-event (ppointer->process (-> obj parent)) 'child-killed) - (go-inactive obj) +(defmethod cleanup-for-death citizen ((this citizen)) + (logclear! (-> this flags) (citizen-flag persistent)) + (send-event (ppointer->process (-> this parent)) 'child-killed) + (go-inactive this) (none) ) ;; definition for method 183 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod go-inactive citizen ((obj citizen)) - (vehicle-controller-method-11 (-> obj controller)) - (logior! (-> obj focus-status) (focus-status inactive)) - (set! (-> obj event-hook) (-> (method-of-object obj inactive) event)) - (go (method-of-object obj inactive)) +(defmethod go-inactive citizen ((this citizen)) + (vehicle-controller-method-11 (-> this controller)) + (logior! (-> this focus-status) (focus-status inactive)) + (set! (-> this event-hook) (-> (method-of-object this inactive) event)) + (go (method-of-object this inactive)) 0 (none) ) ;; definition for method 197 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod trigger-alert citizen ((obj citizen) (arg0 int) (arg1 target)) - (let ((a0-1 (-> obj controller traffic))) +(defmethod trigger-alert citizen ((this citizen) (arg0 int) (arg1 target)) + (let ((a0-1 (-> this controller traffic))) (when (and (nonzero? a0-1) arg1) (if #t (increase-alert-level a0-1 arg0 arg1) @@ -182,8 +182,8 @@ ;; definition for method 198 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod decrease-alert citizen ((obj citizen) (arg0 object)) - (let ((a0-1 (-> obj controller traffic))) +(defmethod decrease-alert citizen ((this citizen) (arg0 object)) + (let ((a0-1 (-> this controller traffic))) (if (nonzero? a0-1) (decrease-alert-level a0-1 (the-as int arg0)) ) @@ -193,41 +193,41 @@ ) ;; definition for method 26 of type citizen -(defmethod get-inv-mass citizen ((obj citizen)) +(defmethod get-inv-mass citizen ((this citizen)) 1.0 ) ;; definition for method 184 of type citizen -(defmethod find-segment citizen ((obj citizen) (arg0 vector) (arg1 vector)) - (find-best-segment (-> obj controller traffic) arg0 arg1 1) +(defmethod find-segment citizen ((this citizen) (arg0 vector) (arg1 vector)) + (find-best-segment (-> this controller traffic) arg0 arg1 1) ) ;; definition for method 185 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod nav-segment-callback citizen ((obj citizen) +(defmethod nav-segment-callback citizen ((this citizen) (arg0 vector) (arg1 traffic-find-segment-struct) (arg2 (function traffic-find-segment-struct nav-segment none)) ) - (callback-on-nav-segments-in-sphere (-> obj controller traffic) arg0 1 arg1 arg2) + (callback-on-nav-segments-in-sphere (-> this controller traffic) arg0 1 arg1 arg2) 0 (none) ) ;; definition for method 186 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod citizen-method-186 citizen ((obj citizen) (arg0 nav-segment)) - (vehicle-controller-method-11 (-> obj controller)) - (vehicle-controller-method-13 (-> obj controller) (-> arg0 branch) (the-as vector (-> arg0 vertex))) +(defmethod citizen-method-186 citizen ((this citizen) (arg0 nav-segment)) + (vehicle-controller-method-11 (-> this controller)) + (vehicle-controller-method-13 (-> this controller) (-> arg0 branch) (the-as vector (-> arg0 vertex))) 0 (none) ) ;; definition for method 187 of type citizen -(defmethod citizen-method-187 citizen ((obj citizen)) - (let* ((v1-0 (-> obj controller)) +(defmethod citizen-method-187 citizen ((this citizen)) + (let* ((v1-0 (-> this controller)) (gp-1 (vector-! (new 'stack-no-clear 'vector) (-> v1-0 turn-exit-point) (-> v1-0 path-prev-point))) - (s5-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> v1-0 turn-exit-point))) + (s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> v1-0 turn-exit-point))) ) (set! (-> s5-1 y) 0.0) (set! (-> gp-1 y) 0.0) @@ -238,20 +238,20 @@ ;; definition for method 199 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod set-behavior! citizen ((obj citizen) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! citizen ((this citizen) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-0 2) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ((= v1-0 3) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) (else - (go-inactive obj) + (go-inactive this) ) ) ) @@ -261,13 +261,13 @@ ;; definition for method 74 of type citizen ;; INFO: Used lq/sq -(defmethod general-event-handler citizen ((obj citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler citizen ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) (let ((v1-1 #f)) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6) (knocked-type knocked-type-5) @@ -276,54 +276,54 @@ (set! v1-1 #t) ) (((knocked-type knocked-type-0)) - (+! (-> obj hit-by-player-count) 1) - (set! v1-1 (>= (-> obj hit-by-player-count) 2)) + (+! (-> this hit-by-player-count) 1) + (set! v1-1 (>= (-> this hit-by-player-count) 2)) ) ) (when v1-1 - (let* ((s5-0 (handle->process (-> obj incoming attacker-handle))) + (let* ((s5-0 (handle->process (-> this incoming attacker-handle))) (a2-5 (if (type? s5-0 process-focusable) s5-0 ) ) ) (if a2-5 - (trigger-alert obj 1 (the-as target a2-5)) + (trigger-alert this 1 (the-as target a2-5)) ) ) ) ) - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) (('traffic-off) - (if (not (logtest? (-> obj flags) (citizen-flag persistent))) - (go-inactive obj) + (if (not (logtest? (-> this flags) (citizen-flag persistent))) + (go-inactive this) ) ) (('traffic-off-force) - (go-inactive obj) + (go-inactive this) ) (('traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (set! (-> this controller traffic) (the-as traffic-engine (-> arg3 param 1))) (let ((s5-1 (the-as object (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> (the-as traffic-object-spawn-params s5-1) position quad)) - (quaternion-copy! (-> obj root quat) (-> (the-as traffic-object-spawn-params s5-1) rotation)) - (set! (-> obj root transv quad) (-> (the-as traffic-object-spawn-params s5-1) velocity quad)) + (set! (-> this root trans quad) (-> (the-as traffic-object-spawn-params s5-1) position quad)) + (quaternion-copy! (-> this root quat) (-> (the-as traffic-object-spawn-params s5-1) rotation)) + (set! (-> this root transv quad) (-> (the-as traffic-object-spawn-params s5-1) velocity quad)) (let ((a0-24 (-> (the-as traffic-object-spawn-params s5-1) nav-mesh))) (when a0-24 - (change-to a0-24 obj) - (if (not (-> obj nav)) - (go-inactive obj) + (change-to a0-24 this) + (if (not (-> this nav)) + (go-inactive this) ) - (let ((v1-31 (-> obj nav state))) + (let ((v1-31 (-> this nav state))) (set! (-> v1-31 current-poly) (the-as nav-poly #f)) ) 0 (let ((a1-11 (-> (the-as traffic-object-spawn-params s5-1) nav-branch))) (when a1-11 - (vehicle-controller-method-13 (-> obj controller) a1-11 (-> obj root trans)) - (let ((a0-28 (-> obj nav state)) - (v1-38 (-> obj controller turn-exit-point)) + (vehicle-controller-method-13 (-> this controller) a1-11 (-> this root trans)) + (let ((a0-28 (-> this nav state)) + (v1-38 (-> this controller turn-exit-point)) ) (logclear! (-> a0-28 flags) (nav-state-flag directional-mode)) (logior! (-> a0-28 flags) (nav-state-flag target-poly-dirty)) @@ -332,41 +332,41 @@ 0 ) ) - (citizen-nav-init! obj) - (citizen-init! obj) - (enemy-method-127 obj 40960.0 40960.0 #t (the-as collide-spec (-> obj gnd-collide))) - (set! (-> obj gnd-height) (-> obj root gspot-pos y)) - (set-behavior! obj (the-as traffic-object-spawn-params s5-1)) + (citizen-nav-init! this) + (citizen-init! this) + (enemy-method-127 this 40960.0 40960.0 #t (the-as collide-spec (-> this gnd-collide))) + (set! (-> this gnd-height) (-> this root gspot-pos y)) + (set-behavior! this (the-as traffic-object-spawn-params s5-1)) ) ) ) ) (('nav-mesh-kill) - (remove-process-drawable (-> obj nav state mesh) obj) - (set! (-> obj nav) #f) - (go-inactive obj) + (remove-process-drawable (-> this nav state mesh) this) + (set! (-> this nav) #f) + (go-inactive this) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 200 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod citizen-method-200 citizen ((obj citizen)) - (set! (-> obj root transv x) 0.0) - (set! (-> obj root transv z) 0.0) - (when (-> obj enemy-info move-to-ground) - (if (focus-test? obj under-water) - (enemy-method-47 obj (-> obj root transv)) - (+! (-> obj root transv y) (* (-> obj enemy-info movement-gravity) (seconds-per-frame))) +(defmethod citizen-method-200 citizen ((this citizen)) + (set! (-> this root transv x) 0.0) + (set! (-> this root transv z) 0.0) + (when (-> this enemy-info move-to-ground) + (if (focus-test? this under-water) + (enemy-method-47 this (-> this root transv)) + (+! (-> this root transv y) (* (-> this enemy-info movement-gravity) (seconds-per-frame))) ) ) (let ((a2-0 (new 'stack-no-clear 'move-above-ground-params))) - (let ((v1-15 (-> obj enemy-info))) - (set! (-> a2-0 gnd-collide-with) (the-as collide-spec (-> obj gnd-collide))) + (let ((v1-15 (-> this enemy-info))) + (set! (-> a2-0 gnd-collide-with) (the-as collide-spec (-> this gnd-collide))) (set! (-> a2-0 popup) 8192.0) (set! (-> a2-0 dont-move-if-overlaps?) #t) (set! (-> a2-0 hover-if-no-ground?) (-> v1-15 hover-if-no-ground)) @@ -375,7 +375,7 @@ ) (set! (-> a2-0 overlaps-params tlist) *touching-list*) (-> a2-0 overlaps-params) - (enemy-method-128 obj (-> obj root transv) a2-0) + (enemy-method-128 this (-> this root transv) a2-0) ) 0 (none) @@ -384,56 +384,56 @@ ;; definition for method 55 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! citizen ((obj citizen)) +(defmethod track-target! citizen ((this citizen)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (when (< (-> obj next-time-look-at) (current-time)) - (when (nonzero? (-> obj neck)) - (let ((a0-4 (handle->process (-> obj focus handle)))) + (when (< (-> this next-time-look-at) (current-time)) + (when (nonzero? (-> this neck)) + (let ((a0-4 (handle->process (-> this focus handle)))) (when a0-4 (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-4) 2) quad)) - (if (and (-> obj next-state) (= (-> obj next-state name) 'flee)) - (set! (-> s5-0 quad) (-> obj danger-pos quad)) + (if (and (-> this next-state) (= (-> this next-state name) 'flee)) + (set! (-> s5-0 quad) (-> this danger-pos quad)) ) - (when (< (vector-vector-distance s5-0 (-> obj root trans)) 122880.0) - (look-at-target! obj (enemy-flag lock-focus)) - (target-set! (-> obj neck) s5-0) + (when (< (vector-vector-distance s5-0 (-> this root trans)) 122880.0) + (look-at-target! this (enemy-flag lock-focus)) + (target-set! (-> this neck) s5-0) ) ) ) ) - (when (< (-> obj stop-time-look-at) (current-time)) - (shut-down (-> obj neck)) - (set! (-> obj next-time-look-at) (+ (current-time) (the int (* 300.0 (get-rand-float-range obj 0.0 20.0))))) - (set! (-> obj stop-time-look-at) - (+ (-> obj next-time-look-at) (the int (* 300.0 (get-rand-float-range obj 5.0 10.0)))) + (when (< (-> this stop-time-look-at) (current-time)) + (shut-down (-> this neck)) + (set! (-> this next-time-look-at) (+ (current-time) (the int (* 300.0 (get-rand-float-range this 0.0 20.0))))) + (set! (-> this stop-time-look-at) + (+ (-> this next-time-look-at) (the int (* 300.0 (get-rand-float-range this 5.0 10.0)))) ) ) ) ) - (let ((a0-18 (-> obj enemy-flags))) + (let ((a0-18 (-> this enemy-flags))) (when (and (logtest? a0-18 (enemy-flag attackable-backup)) - (>= (- (current-time) (-> obj auto-reset-penetrate-time)) (seconds 0.1)) + (time-elapsed? (-> this auto-reset-penetrate-time) (seconds 0.1)) ) - (set! (-> obj enemy-flags) (logclear a0-18 (enemy-flag attackable-backup))) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) + (set! (-> this enemy-flags) (logclear a0-18 (enemy-flag attackable-backup))) + (set! (-> this root penetrated-by) (get-penetrate-info this)) (let ((v1-50 0)) - (if (logtest? (penetrate knocked) (-> obj root penetrate-using)) + (if (logtest? (penetrate knocked) (-> this root penetrate-using)) (set! v1-50 (logior (shl 1 32) v1-50)) ) - (set! (-> obj root penetrate-using) (the-as penetrate v1-50)) + (set! (-> this root penetrate-using) (the-as penetrate v1-50)) ) ) ) - (if (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-control-status on-screen))) - (set! (-> obj last-draw-time) (current-time)) + (if (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status on-screen))) + (set-time! (-> this last-draw-time)) ) - (let ((s5-3 (-> obj draw shadow-ctrl))) + (let ((s5-3 (-> this draw shadow-ctrl))) (when (!= *nav-enemy-dummy-shadow-control* s5-3) - (let ((f0-7 (vector-vector-distance (camera-pos) (-> obj root trans)))) + (let ((f0-7 (vector-vector-distance (camera-pos) (-> this root trans)))) (cond ((< 163840.0 f0-7) (logior! (-> s5-3 settings flags) (shadow-flags disable-draw)) @@ -454,12 +454,12 @@ ) ) ) - (when (logtest? (enemy-flag trackable-backup directed-ready) (-> obj enemy-flags)) - (enemy-method-54 obj) - (when (and (focus-test? obj touch-water) (< (-> obj root trans y) (+ -11468.8 (-> obj water-surface-height)))) - (set! (-> obj root trans y) (+ -11468.8 (-> obj water-surface-height))) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'in-ditch))) - (go (method-of-object obj in-ditch)) + (when (logtest? (enemy-flag trackable-backup directed-ready) (-> this enemy-flags)) + (enemy-method-54 this) + (when (and (focus-test? this touch-water) (< (-> this root trans y) (+ -11468.8 (-> this water-surface-height)))) + (set! (-> this root trans y) (+ -11468.8 (-> this water-surface-height))) + (if (not (and (-> this next-state) (= (-> this next-state name) 'in-ditch))) + (go (method-of-object this in-ditch)) ) ) ) @@ -471,7 +471,7 @@ ;; definition for method 128 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-128 citizen ((obj citizen) (arg0 vector) (arg1 move-above-ground-params)) +(defmethod enemy-method-128 citizen ((this citizen) (arg0 vector) (arg1 move-above-ground-params)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -480,7 +480,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((gp-0 (-> obj root))) + (let ((gp-0 (-> this root))) (set! (-> arg1 on-ground?) #f) (set! (-> arg1 do-move?) #t) (set! (-> arg1 old-gspot-pos quad) (-> gp-0 gspot-pos quad)) @@ -491,10 +491,10 @@ (set! (-> gp-0 prev-status) (-> gp-0 status)) (vector-v+! (-> gp-0 trans) (-> gp-0 trans) arg0) (set! (-> arg1 new-pos quad) (-> gp-0 trans quad)) - (when (= (-> obj controller traffic sync-mask-8) (ash 1 (logand (-> obj traffic-id) 7))) + (when (= (-> this controller traffic sync-mask-8) (ash 1 (logand (-> this traffic-id) 7))) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (logclear! (-> gp-0 status) (collide-status on-ground)) - (let* ((a0-14 obj) + (let* ((a0-14 this) (t9-1 (method-of-object a0-14 enemy-above-ground?)) (a1-2 s2-0) (a2-2 (new 'stack-no-clear 'vector)) @@ -521,18 +521,18 @@ ) ) ) - (set! (-> obj gnd-height) (-> gp-0 gspot-pos y)) + (set! (-> this gnd-height) (-> gp-0 gspot-pos y)) (set! (-> gp-0 gspot-pos y) (-> arg1 old-gspot-pos y)) ) - (let ((f0-5 (- (-> obj gnd-height) (-> gp-0 gspot-pos y)))) + (let ((f0-5 (- (-> this gnd-height) (-> gp-0 gspot-pos y)))) (cond ((< 0.0 f0-5) (+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5)) ) (else (+! (-> gp-0 gspot-pos y) (* 10.0 (seconds-per-frame) f0-5)) - (if (< (-> gp-0 gspot-pos y) (-> obj gnd-height)) - (set! (-> gp-0 gspot-pos y) (-> obj gnd-height)) + (if (< (-> gp-0 gspot-pos y) (-> this gnd-height)) + (set! (-> gp-0 gspot-pos y) (-> this gnd-height)) ) ) ) @@ -602,7 +602,7 @@ ;; definition for method 142 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 citizen ((obj citizen) (arg0 nav-control)) +(defmethod nav-enemy-method-142 citizen ((this citizen) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) (let ((a1-1 (-> arg0 state))) (set! (-> s3-0 quad) (-> a1-1 heading quad)) @@ -610,7 +610,7 @@ (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (let ((gp-0 (new 'stack-no-clear 'quaternion)) - (s5-1 (-> obj root quat)) + (s5-1 (-> this root quat)) ) (quaternion-set! gp-0 0.0 (-> s3-0 x) 0.0 (+ 1.0 (-> s3-0 z))) (quaternion-normalize! gp-0) @@ -629,52 +629,52 @@ ;; definition for method 176 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-176 citizen ((obj citizen)) - (nav-enemy-method-177 obj) - (let ((a0-2 obj)) +(defmethod nav-enemy-method-176 citizen ((this citizen)) + (nav-enemy-method-177 this) + (let ((a0-2 this)) (when (logtest? (enemy-flag enemy-flag36) (-> a0-2 enemy-flags)) (cond - ((logtest? (enemy-flag enemy-flag38) (-> obj enemy-flags)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag38)))) - (set! (-> obj root gspot-pos quad) (-> obj root trans quad)) - (set! (-> obj gnd-height) (-> obj root gspot-pos y)) + ((logtest? (enemy-flag enemy-flag38) (-> this enemy-flags)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag38)))) + (set! (-> this root gspot-pos quad) (-> this root trans quad)) + (set! (-> this gnd-height) (-> this root gspot-pos y)) ) (else - (nav-enemy-method-142 obj (-> obj nav)) - (nav-enemy-method-143 obj (-> obj nav)) + (nav-enemy-method-142 this (-> this nav)) + (nav-enemy-method-143 this (-> this nav)) ) ) ) ) - (track-target! obj) - (update-transforms (-> obj root)) + (track-target! this) + (update-transforms (-> this root)) 0 (none) ) ;; definition for method 116 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod go-idle citizen ((obj citizen)) - (go (method-of-object obj active)) +(defmethod go-idle citizen ((this citizen)) + (go (method-of-object this active)) 0 (none) ) ;; definition for method 113 of type citizen ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-behaviour-and-stats! citizen ((obj citizen) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! citizen ((this citizen) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-behaviour-and-stats!))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj speed-scale) (get-rand-float-range obj 0.9 1.1)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (vehicle-controller-method-9 (-> obj controller)) - (citizen-init! obj) - (if (zero? (-> obj draw light-index)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this speed-scale) (get-rand-float-range this 0.9 1.1)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (vehicle-controller-method-9 (-> this controller)) + (citizen-init! this) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) ) 0 (none) @@ -682,14 +682,14 @@ ;; definition for method 11 of type citizen ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! citizen ((obj citizen) (arg0 entity-actor)) +(defmethod init-from-entity! citizen ((this citizen) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -718,8 +718,8 @@ This commonly includes things such as: ) ;; definition for method 196 of type citizen -(defmethod get-run-anim citizen ((obj citizen)) - (-> obj anim-run) +(defmethod get-run-anim citizen ((this citizen)) + (-> this anim-run) ) ;; definition for function citizen-travel-anim @@ -827,29 +827,29 @@ This commonly includes things such as: ;; definition for method 188 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod citizen-method-188 citizen ((obj citizen) (arg0 vector)) +(defmethod citizen-method-188 citizen ((this citizen) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) ) - (let ((s1-0 (-> obj nav state current-poly))) - (let ((a1-2 (-> obj nav state))) + (let ((s1-0 (-> this nav state current-poly))) + (let ((a1-2 (-> this nav state))) (set! (-> s5-0 quad) (-> a1-2 heading quad)) ) (set! (-> s5-0 y) 0.0) (vector-xz-normalize! s5-0 20480.0) (set! (-> s4-0 quad) (-> s5-0 quad)) - (clamp-vector-to-mesh-no-gaps (-> obj nav) (-> obj root trans) s1-0 s4-0 s2-0) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) s1-0 s4-0 s2-0) ) (cond ((-> s2-0 found-boundary) (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) - (-> obj controller turn-exit-point) - (-> obj controller path-prev-point) + (-> this controller turn-exit-point) + (-> this controller path-prev-point) ) ) - (s0-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 intersection) (-> obj controller path-prev-point))) + (s0-1 (vector-! (new 'stack-no-clear 'vector) (-> s2-0 intersection) (-> this controller path-prev-point))) ) (vector-! (new 'stack-no-clear 'vector) s5-0 s4-0) (set! (-> s1-2 y) 0.0) @@ -874,12 +874,12 @@ This commonly includes things such as: ;; definition for method 189 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod calc-danger-vec citizen ((obj citizen) (arg0 vector) (arg1 vector)) +(defmethod calc-danger-vec citizen ((this citizen) (arg0 vector) (arg1 vector)) (let ((s2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> obj root trans quad)) - (let ((a1-1 (-> obj nav state))) + (set! (-> s5-0 quad) (-> this root trans quad)) + (let ((a1-1 (-> this nav state))) (set! (-> s2-0 quad) (-> a1-1 heading quad)) ) (set! (-> s2-0 y) 0.0) @@ -893,11 +893,11 @@ This commonly includes things such as: 0.0 (let ((s2-2 (vector-! (new 'stack-no-clear 'vector) - (-> obj controller turn-exit-point) - (-> obj controller path-prev-point) + (-> this controller turn-exit-point) + (-> this controller path-prev-point) ) ) - (s1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj controller path-prev-point))) + (s1-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this controller path-prev-point))) ) (set! (-> s2-2 y) 0.0) (vector-xz-normalize! s2-2 1.0) @@ -939,35 +939,35 @@ This commonly includes things such as: ;; definition for method 190 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod citizen-method-190 citizen ((obj citizen) (arg0 vector)) +(defmethod citizen-method-190 citizen ((this citizen) (arg0 vector)) (local-vars (sv-288 nav-poly) (sv-304 clamp-travel-vector-to-mesh-return-info) (sv-320 vector)) - (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (the-as vector (-> obj cp-sphere)))) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (the-as vector (-> this cp-sphere)))) (s4-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) ) 0.0 (set! (-> arg0 quad) (the-as uint128 0)) - (when (-> obj cp-valid?) - (set! (-> obj cp-valid?) #f) - (set! (-> s2-0 quad) (-> obj cp-vec quad)) + (when (-> this cp-valid?) + (set! (-> this cp-valid?) #f) + (set! (-> s2-0 quad) (-> this cp-vec quad)) (set! (-> s2-0 y) 0.0) (vector-xz-normalize! s2-0 1.0) (vector-rotate90-around-y! s2-0 s2-0) (set! (-> s3-1 y) 0.0) (vector-*! s4-0 s3-1 s2-0 (vector-dot s3-1 s2-0)) - (let ((f30-0 (- 1.0 (/ (vector-length s4-0) (vector-length (-> obj cp-vec)))))) - (vector+! s4-0 s4-0 (the-as vector (-> obj cp-sphere))) + (let ((f30-0 (- 1.0 (/ (vector-length s4-0) (vector-length (-> this cp-vec)))))) + (vector+! s4-0 s4-0 (the-as vector (-> this cp-sphere))) (let ((s0-0 (new 'stack-no-clear 'vector))) (set! sv-320 (new 'stack-no-clear 'vector)) (let ((s1-0 (new 'stack-no-clear 'vector))) (set! sv-304 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) - (set! sv-288 (-> obj nav state current-poly)) - (let ((f28-0 (+ (-> obj cp-sphere r) (-> obj nav-radius-backup)))) + (set! sv-288 (-> this nav state current-poly)) + (let ((f28-0 (+ (-> this cp-sphere r) (-> this nav-radius-backup)))) (when sv-288 (vector-normalize-copy! s0-0 s2-0 f28-0) (vector-normalize-copy! sv-320 s2-0 (- f28-0)) - (clamp-vector-to-mesh-no-gaps (-> obj nav) s4-0 sv-288 s0-0 sv-304) - (let ((a0-12 (-> obj nav)) + (clamp-vector-to-mesh-no-gaps (-> this nav) s4-0 sv-288 s0-0 sv-304) + (let ((a0-12 (-> this nav)) (t9-7 (method-of-type nav-control clamp-vector-to-mesh-no-gaps)) (a1-10 s4-0) (a3-3 sv-320) @@ -996,13 +996,13 @@ This commonly includes things such as: ) (set! (-> arg0 quad) (-> s1-0 quad)) (let ((a1-11 (new 'stack-no-clear 'vector))) - (set! (-> a1-11 quad) (-> obj root trans quad)) + (set! (-> a1-11 quad) (-> this root trans quad)) (set! (-> a1-11 y) 0.0) (let ((f0-15 (- f28-0 (vector-vector-xz-distance s4-0 a1-11)))) (if (< f0-15 0.0) (set! f0-15 0.0) ) - (vector-normalize! arg0 (* (-> obj cp-factor) f0-15 f30-0)) + (vector-normalize! arg0 (* (-> this cp-factor) f0-15 f30-0)) ) ) ) @@ -1030,19 +1030,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type iter-seg -(defmethod inspect iter-seg ((obj iter-seg)) - (when (not obj) - (set! obj obj) +(defmethod inspect iter-seg ((this iter-seg)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'iter-seg) - (format #t "~1Tself: ~A~%" (-> obj self)) - (format #t "~1Tscore: ~f~%" (-> obj score)) - (format #t "~1Tseg: #~%" (-> obj seg)) - (format #t "~1Tcp-plane: #~%" (-> obj cp-plane)) - (format #t "~1Tdesired-dir: #~%" (-> obj desired-dir)) + (format #t "[~8x] ~A~%" this 'iter-seg) + (format #t "~1Tself: ~A~%" (-> this self)) + (format #t "~1Tscore: ~f~%" (-> this score)) + (format #t "~1Tseg: #~%" (-> this seg)) + (format #t "~1Tcp-plane: #~%" (-> this cp-plane)) + (format #t "~1Tdesired-dir: #~%" (-> this desired-dir)) (label cfg-4) - obj + this ) ;; definition for function iter-seg-clear-path @@ -1137,13 +1137,13 @@ This commonly includes things such as: ;; definition for method 191 of type citizen ;; INFO: Used lq/sq -(defmethod gen-clear-path citizen ((obj citizen)) +(defmethod gen-clear-path citizen ((this citizen)) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'iter-seg)) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> obj cp-vec quad)) - (set! (-> s4-0 quad) (-> obj root trans quad)) + (set! (-> s3-0 quad) (-> this cp-vec quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) (set! (-> s4-0 w) 81920.0) (set! (-> gp-0 seg) #f) (set! (-> gp-0 score) 0.0) @@ -1151,17 +1151,17 @@ This commonly includes things such as: (vector-rotate90-around-y! s3-0 s3-0) (vector-normalize! s3-0 1.0) (set! (-> gp-0 cp-plane quad) (-> s3-0 quad)) - (set! (-> gp-0 cp-plane w) (- (vector-dot s3-0 (the-as vector (-> obj cp-sphere))))) + (set! (-> gp-0 cp-plane w) (- (vector-dot s3-0 (the-as vector (-> this cp-sphere))))) ) - (when (< (vector4-dot (the-as vector (-> gp-0 cp-plane)) (-> obj root trans)) 0.0) + (when (< (vector4-dot (the-as vector (-> gp-0 cp-plane)) (-> this root trans)) 0.0) (set! (-> gp-0 cp-plane x) (- (-> gp-0 cp-plane x))) (set! (-> gp-0 cp-plane y) (- (-> gp-0 cp-plane y))) (set! (-> gp-0 cp-plane z) (- (-> gp-0 cp-plane z))) (set! (-> gp-0 cp-plane w) (- (-> gp-0 cp-plane w))) ) - (set! (-> gp-0 self) obj) + (set! (-> gp-0 self) this) (nav-segment-callback - obj + this s4-0 (the-as traffic-find-segment-struct gp-0) (the-as (function traffic-find-segment-struct nav-segment none) iter-seg-clear-path) @@ -1186,12 +1186,12 @@ This commonly includes things such as: ;; definition for method 192 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod citizen-method-192 citizen ((obj citizen)) - (when (-> obj cp-valid?) +(defmethod citizen-method-192 citizen ((this citizen)) + (when (-> this cp-valid?) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj cp-force quad)) + (set! (-> s4-0 quad) (-> this cp-force quad)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (let ((a1-0 (-> obj nav state))) + (let ((a1-0 (-> this nav state))) (set! (-> s5-0 quad) (-> a1-0 heading quad)) ) (set! (-> s5-0 y) 0.0) @@ -1199,9 +1199,9 @@ This commonly includes things such as: (vector-xz-normalize! s4-0 1.0) (when (< (fabs (vector-dot s4-0 s5-0)) (cos 14563.556)) (vector-negate! (new 'stack-no-clear 'vector) s5-0) - (let ((a1-6 (gen-clear-path obj))) + (let ((a1-6 (gen-clear-path this))) (if a1-6 - (citizen-method-186 obj a1-6) + (citizen-method-186 this a1-6) ) ) ) @@ -1248,20 +1248,20 @@ This commonly includes things such as: ;; definition for method 194 of type citizen ;; INFO: Used lq/sq -(defmethod gen-new-dir citizen ((obj citizen) (arg0 vector) (arg1 float)) +(defmethod gen-new-dir citizen ((this citizen) (arg0 vector) (arg1 float)) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'iter-seg)) ) - (set! (-> (new 'stack-no-clear 'vector) quad) (-> obj cp-vec quad)) - (set! (-> s4-0 quad) (-> obj root trans quad)) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> this cp-vec quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) (set! (-> s4-0 w) arg1) (set! (-> gp-0 seg) #f) (set! (-> gp-0 score) 0.0) (set! (-> gp-0 desired-dir quad) (-> arg0 quad)) (vector-normalize! (-> gp-0 desired-dir) 1.0) - (set! (-> gp-0 self) obj) + (set! (-> gp-0 self) this) (nav-segment-callback - obj + this s4-0 (the-as traffic-find-segment-struct gp-0) (the-as (function traffic-find-segment-struct nav-segment none) iter-seg-new-dir) @@ -1285,11 +1285,11 @@ This commonly includes things such as: ;; definition for method 195 of type citizen ;; WARN: Return type mismatch int vs symbol. -(defmethod citizen-method-195 citizen ((obj citizen) (arg0 vector)) +(defmethod citizen-method-195 citizen ((this citizen) (arg0 vector)) (dotimes (s4-0 6) - (let ((a1-2 (gen-new-dir obj arg0 (* 81920.0 (the float (+ s4-0 1)))))) + (let ((a1-2 (gen-new-dir this arg0 (* 81920.0 (the float (+ s4-0 1)))))) (when a1-2 - (citizen-method-186 obj a1-2) + (citizen-method-186 this a1-2) (return (the-as symbol #f)) ) ) @@ -1300,14 +1300,14 @@ This commonly includes things such as: ;; definition for method 193 of type citizen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod throw-off-vehicle citizen ((obj citizen)) - (let ((s4-0 (handle->process (-> obj vehicle)))) - (let ((v1-4 (-> obj root root-prim))) - (set! (-> v1-4 prim-core collide-as) (-> obj root backup-collide-as)) - (set! (-> v1-4 prim-core collide-with) (-> obj root backup-collide-with)) +(defmethod throw-off-vehicle citizen ((this citizen)) + (let ((s4-0 (handle->process (-> this vehicle)))) + (let ((v1-4 (-> this root root-prim))) + (set! (-> v1-4 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-4 prim-core collide-with) (-> this root backup-collide-with)) ) (when s4-0 - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> (the-as vehicle s4-0) root trans)))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> (the-as vehicle s4-0) root trans)))) (let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> (the-as vehicle s4-0) root quat))) (v1-10 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as vehicle s4-0) root quat))) ) @@ -1319,7 +1319,7 @@ This commonly includes things such as: (vector-normalize! s5-1 32768.0) (set! (-> s5-1 y) 71680.0) (vector+! s5-1 s5-1 (-> (the-as vehicle s4-0) root transv)) - (send-event obj 'attack #f (static-attack-info ((id (new-attack-id)) (vector s5-1) (knock (the-as uint 7))))) + (send-event this 'attack #f (static-attack-info ((id (new-attack-id)) (vector s5-1) (knock (the-as uint 7))))) ) ) ) @@ -1332,7 +1332,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1405,7 +1405,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1420,7 +1420,7 @@ This commonly includes things such as: '() ) :trans (behavior () - (if (and (-> self wait-return-state) (>= (- (current-time) (-> self state-time)) (-> self wait-time))) + (if (and (-> self wait-return-state) (time-elapsed? (-> self state-time) (-> self wait-time))) (go (-> self wait-return-state)) ) ) @@ -1451,7 +1451,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1489,13 +1489,13 @@ This commonly includes things such as: '() ) :trans (behavior () - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) (< (-> self root trans y) 4096.0) ) (go-virtual in-ditch) ) - (when (>= (- (current-time) (-> self state-time)) (-> self wait-time)) + (when (time-elapsed? (-> self state-time) (-> self wait-time)) (let ((f0-2 (-> self nav state speed))) (set! (-> self nav target-speed) (seek f0-2 0.0 (* 12288.0 (seconds-per-frame)))) ) @@ -1510,7 +1510,7 @@ This commonly includes things such as: (v1-36 (-> self root transv)) ) (if (< f0-8 (sqrtf (+ (* (-> v1-36 x) (-> v1-36 x)) (* (-> v1-36 z) (-> v1-36 z))))) - (set! (-> self cp-next-time) (current-time)) + (set-time! (-> self cp-next-time)) ) ) (when (< (+ (-> self cp-next-time) (seconds 2)) (current-time)) @@ -1521,7 +1521,7 @@ This commonly includes things such as: ) ) ) - (set! (-> self cp-next-time) (current-time)) + (set-time! (-> self cp-next-time)) (citizen-method-195 self a1-3) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc index eb317eb738..4374879d42 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/civilian_REF.gc @@ -14,17 +14,17 @@ ) ;; definition for method 3 of type civilian-anim-info -(defmethod inspect civilian-anim-info ((obj civilian-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect civilian-anim-info ((this civilian-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'civilian-anim-info) - (format #t "~1Tanim-index[2] @ #x~X~%" (-> obj anim-index)) - (format #t "~1Tanim-index-front: ~D~%" (-> obj anim-index-front)) - (format #t "~1Tanim-index-back: ~D~%" (-> obj anim-index-back)) + (format #t "[~8x] ~A~%" this 'civilian-anim-info) + (format #t "~1Tanim-index[2] @ #x~X~%" (-> this anim-index)) + (format #t "~1Tanim-index-front: ~D~%" (-> this anim-index-front)) + (format #t "~1Tanim-index-back: ~D~%" (-> this anim-index-back)) (label cfg-4) - obj + this ) ;; definition of type civilian-global-info @@ -62,40 +62,40 @@ ) ;; definition for method 3 of type civilian-global-info -(defmethod inspect civilian-global-info ((obj civilian-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect civilian-global-info ((this civilian-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-yellow-hit: ~D~%" (-> obj prev-yellow-hit)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tknocked[2] @ #x~X~%" (-> obj knocked)) - (format #t "~1Tanim-knocked-front: ~D~%" (-> obj anim-knocked-front)) - (format #t "~1Tanim-knocked-back: ~D~%" (-> obj anim-knocked-back)) - (format #t "~1Tknocked-land[2] @ #x~X~%" (-> obj knocked-land)) - (format #t "~1Tanim-knocked-front-land: ~D~%" (-> obj anim-knocked-front-land)) - (format #t "~1Tanim-knocked-back-land: ~D~%" (-> obj anim-knocked-back-land)) - (format #t "~1Tyellow-hit-anim[1] @ #x~X~%" (-> obj yellow-hit-anim)) - (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim)) - (format #t "~1Tanim-cover-head-start: ~D~%" (-> obj anim-cover-head-start)) - (format #t "~1Tanim-cover-head-loop: ~D~%" (-> obj anim-cover-head-loop)) - (format #t "~1Tanim-cover-head-end: ~D~%" (-> obj anim-cover-head-end)) - (format #t "~1Tcar-stance-anim: ~D~%" (-> obj car-stance-anim)) - (format #t "~1Tbike-stance-anim: ~D~%" (-> obj bike-stance-anim)) - (format #t "~1Tget-in-car-anim: ~D~%" (-> obj get-in-car-anim)) - (format #t "~1Tget-on-bike-anim: ~D~%" (-> obj get-on-bike-anim)) - (format #t "~1Tseat-flag: ~D~%" (-> obj seat-flag)) - (format #t "~1Tspeech-ambient: ~D~%" (-> obj speech-ambient)) - (format #t "~1Tspeech-alert: ~D~%" (-> obj speech-alert)) - (format #t "~1Tspeech-cower: ~D~%" (-> obj speech-cower)) - (format #t "~1Tspeech-touched-by-player: ~D~%" (-> obj speech-touched-by-player)) - (format #t "~1Tspeech-shot-by-player: ~D~%" (-> obj speech-shot-by-player)) - (format #t "~1Tspeech-avoiding-player-vehicle: ~D~%" (-> obj speech-avoiding-player-vehicle)) - (format #t "~1Tspeech-hit-by-player-vehicle: ~D~%" (-> obj speech-hit-by-player-vehicle)) - (format #t "~1Tspeech-player-stealing-vehicle: ~D~%" (-> obj speech-player-stealing-vehicle)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tknocked[2] @ #x~X~%" (-> this knocked)) + (format #t "~1Tanim-knocked-front: ~D~%" (-> this anim-knocked-front)) + (format #t "~1Tanim-knocked-back: ~D~%" (-> this anim-knocked-back)) + (format #t "~1Tknocked-land[2] @ #x~X~%" (-> this knocked-land)) + (format #t "~1Tanim-knocked-front-land: ~D~%" (-> this anim-knocked-front-land)) + (format #t "~1Tanim-knocked-back-land: ~D~%" (-> this anim-knocked-back-land)) + (format #t "~1Tyellow-hit-anim[1] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) + (format #t "~1Tanim-cover-head-start: ~D~%" (-> this anim-cover-head-start)) + (format #t "~1Tanim-cover-head-loop: ~D~%" (-> this anim-cover-head-loop)) + (format #t "~1Tanim-cover-head-end: ~D~%" (-> this anim-cover-head-end)) + (format #t "~1Tcar-stance-anim: ~D~%" (-> this car-stance-anim)) + (format #t "~1Tbike-stance-anim: ~D~%" (-> this bike-stance-anim)) + (format #t "~1Tget-in-car-anim: ~D~%" (-> this get-in-car-anim)) + (format #t "~1Tget-on-bike-anim: ~D~%" (-> this get-on-bike-anim)) + (format #t "~1Tseat-flag: ~D~%" (-> this seat-flag)) + (format #t "~1Tspeech-ambient: ~D~%" (-> this speech-ambient)) + (format #t "~1Tspeech-alert: ~D~%" (-> this speech-alert)) + (format #t "~1Tspeech-cower: ~D~%" (-> this speech-cower)) + (format #t "~1Tspeech-touched-by-player: ~D~%" (-> this speech-touched-by-player)) + (format #t "~1Tspeech-shot-by-player: ~D~%" (-> this speech-shot-by-player)) + (format #t "~1Tspeech-avoiding-player-vehicle: ~D~%" (-> this speech-avoiding-player-vehicle)) + (format #t "~1Tspeech-hit-by-player-vehicle: ~D~%" (-> this speech-hit-by-player-vehicle)) + (format #t "~1Tspeech-player-stealing-vehicle: ~D~%" (-> this speech-player-stealing-vehicle)) (label cfg-4) - obj + this ) ;; definition of type civilian @@ -142,83 +142,83 @@ ) ;; definition for method 3 of type civilian -(defmethod inspect civilian ((obj civilian)) - (when (not obj) - (set! obj obj) +(defmethod inspect civilian ((this civilian)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type citizen inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: ~A~%" (-> obj info)) - (format #t "~2Tanim-panic-run: ~D~%" (-> obj anim-panic-run)) - (format #t "~2Tanim-on-ground: ~D~%" (-> obj anim-on-ground)) - (format #t "~2Tanim-dive: ~D~%" (-> obj anim-dive)) - (format #t "~2Tanim-get-up-front: ~D~%" (-> obj anim-get-up-front)) - (format #t "~2Tanim-get-up-back: ~D~%" (-> obj anim-get-up-back)) - (format #t "~2Tlast-second-pos: #~%" (-> obj last-second-pos)) - (format #t "~2Tlast-distance: ~f~%" (-> obj last-distance)) - (format #t "~2Tnext-time: ~D~%" (-> obj next-time)) - (format #t "~2Tdive-target-point: #~%" (-> obj dive-target-point)) - (format #t "~2Tdive-reaction: ~f~%" (-> obj dive-reaction)) - (format #t "~2Tallow-dive: ~A~%" (-> obj allow-dive)) - (format #t "~2Tdive-finished?: ~A~%" (-> obj dive-finished?)) - (format #t "~2Thit-face: ~D~%" (-> obj hit-face)) - (format #t "~2Tseat: ~D~%" (-> obj seat)) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Tanim-panic-run: ~D~%" (-> this anim-panic-run)) + (format #t "~2Tanim-on-ground: ~D~%" (-> this anim-on-ground)) + (format #t "~2Tanim-dive: ~D~%" (-> this anim-dive)) + (format #t "~2Tanim-get-up-front: ~D~%" (-> this anim-get-up-front)) + (format #t "~2Tanim-get-up-back: ~D~%" (-> this anim-get-up-back)) + (format #t "~2Tlast-second-pos: #~%" (-> this last-second-pos)) + (format #t "~2Tlast-distance: ~f~%" (-> this last-distance)) + (format #t "~2Tnext-time: ~D~%" (-> this next-time)) + (format #t "~2Tdive-target-point: #~%" (-> this dive-target-point)) + (format #t "~2Tdive-reaction: ~f~%" (-> this dive-reaction)) + (format #t "~2Tallow-dive: ~A~%" (-> this allow-dive)) + (format #t "~2Tdive-finished?: ~A~%" (-> this dive-finished?)) + (format #t "~2Thit-face: ~D~%" (-> this hit-face)) + (format #t "~2Tseat: ~D~%" (-> this seat)) (label cfg-4) - obj + this ) ;; definition for method 196 of type civilian -(defmethod get-run-anim civilian ((obj civilian)) - (if (and (-> obj next-state) (= (-> obj next-state name) 'flee)) - (-> obj anim-panic-run) - (-> obj anim-run) +(defmethod get-run-anim civilian ((this civilian)) + (if (and (-> this next-state) (= (-> this next-state name) 'flee)) + (-> this anim-panic-run) + (-> this anim-run) ) ) ;; definition for method 81 of type civilian -(defmethod enemy-method-81 civilian ((obj civilian)) +(defmethod enemy-method-81 civilian ((this civilian)) #f ) ;; definition for method 17 of type civilian ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod cleanup-for-death civilian ((obj civilian)) +(defmethod cleanup-for-death civilian ((this civilian)) (cond - ((zero? (-> obj hit-points)) - (logclear! (-> obj flags) (citizen-flag persistent)) - (send-event (ppointer->process (-> obj parent)) 'child-killed) + ((zero? (-> this hit-points)) + (logclear! (-> this flags) (citizen-flag persistent)) + (send-event (ppointer->process (-> this parent)) 'child-killed) (let ((a1-1 (new 'stack-no-clear 'traffic-danger-info))) - (set! (-> a1-1 sphere quad) (-> obj root trans quad)) + (set! (-> a1-1 sphere quad) (-> this root trans quad)) (set! (-> a1-1 sphere r) 40960.0) - (set! (-> a1-1 velocity quad) (-> obj root transv quad)) + (set! (-> a1-1 velocity quad) (-> this root transv quad)) (set! (-> a1-1 notify-radius) 122880.0) (set! (-> a1-1 danger-level) 1.0) (set! (-> a1-1 decay-rate) 0.0) (set! (-> a1-1 flags) (traffic-danger-flags tdf0)) (set! (-> a1-1 danger-type) (traffic-danger-type tdt7)) - (set! (-> a1-1 handle) (process->handle obj)) + (set! (-> a1-1 handle) (process->handle this)) (set! (-> a1-1 handle) (the-as handle #f)) - (add-danger (-> obj controller traffic) a1-1) + (add-danger (-> this controller traffic) a1-1) ) - (go-inactive obj) + (go-inactive this) ) (else - (set! (-> obj hit-points) (-> obj enemy-info default-hit-points)) - (set! (-> obj hit-points) (rand-vu-int-range 1 4)) - (set! (-> obj fated-time) 0) - (logior! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logior! (-> obj enemy-flags) (enemy-flag check-water)) - (logior! (-> obj enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) - (logclear! (-> obj focus-status) (focus-status dead)) - (logior! (-> obj mask) (process-mask collectable)) - (logior! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (if (zero? (-> obj hit-face)) - (go (method-of-object obj get-up-front)) - (go (method-of-object obj get-up-back)) + (set! (-> this hit-points) (-> this enemy-info default-hit-points)) + (set! (-> this hit-points) (rand-vu-int-range 1 4)) + (set! (-> this fated-time) 0) + (logior! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag check-water)) + (logior! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) + (logclear! (-> this focus-status) (focus-status dead)) + (logior! (-> this mask) (process-mask collectable)) + (logior! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (if (zero? (-> this hit-face)) + (go (method-of-object this get-up-front)) + (go (method-of-object this get-up-back)) ) ) ) @@ -226,7 +226,7 @@ ) ;; definition for method 56 of type civilian -(defmethod damage-amount-from-attack civilian ((obj civilian) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack civilian ((this civilian) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (cond ((= (scf-get-territory) 2) @@ -243,7 +243,7 @@ 0 ) ((or (logtest? (process-mask enemy) (-> v1-0 mask)) (logtest? (process-mask guard) (-> v1-0 mask))) - ((method-of-type nav-enemy damage-amount-from-attack) obj arg0 arg1) + ((method-of-type nav-enemy damage-amount-from-attack) this arg0 arg1) ) (else 0 @@ -263,49 +263,49 @@ ) ) (else - ((method-of-type nav-enemy damage-amount-from-attack) obj arg0 arg1) + ((method-of-type nav-enemy damage-amount-from-attack) this arg0 arg1) ) ) ) ;; definition for method 108 of type civilian -(defmethod enemy-method-108 civilian ((obj civilian) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 civilian ((this civilian) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; definition for method 70 of type civilian ;; WARN: Return type mismatch none vs object. -(defmethod go-hostile civilian ((obj civilian)) - (cleanup-for-death obj) +(defmethod go-hostile civilian ((this civilian)) + (cleanup-for-death this) ) ;; definition for method 73 of type civilian ;; WARN: Return type mismatch none vs object. -(defmethod kill-prefer-falling civilian ((obj civilian)) +(defmethod kill-prefer-falling civilian ((this civilian)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - (cleanup-for-death obj) + (cleanup-for-death this) ) ;; definition for method 199 of type civilian ;; WARN: Return type mismatch int vs none. -(defmethod set-behavior! civilian ((obj civilian) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! civilian ((this civilian) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-0 2) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ((= v1-0 3) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) ((= v1-0 7) - (logior! (-> obj flags) (citizen-flag persistent)) - (go (method-of-object obj wait-for-ride)) + (logior! (-> this flags) (citizen-flag persistent)) + (go (method-of-object this wait-for-ride)) ) (else - (go-inactive obj) + (go-inactive this) ) ) ) @@ -315,17 +315,17 @@ ;; definition for method 181 of type civilian ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! civilian ((obj civilian)) +(defmethod citizen-init! civilian ((this civilian)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj mask) (the-as process-mask (logior (process-mask civilian) (-> obj mask)))) - (set! (-> obj hit-points) (rand-vu-int-range 1 4)) - (set! (-> obj hit-points) 4) - (set! (-> obj fact pickup-type) (pickup-type none)) - (set! (-> obj fact pickup-amount) 0.0) - (set! (-> obj fact pickup-spawn-amount) 0.0) + (set! (-> this mask) (the-as process-mask (logior (process-mask civilian) (-> this mask)))) + (set! (-> this hit-points) (rand-vu-int-range 1 4)) + (set! (-> this hit-points) 4) + (set! (-> this fact pickup-type) (pickup-type none)) + (set! (-> this fact pickup-amount) 0.0) + (set! (-> this fact pickup-spawn-amount) 0.0) 0 (none) ) @@ -333,13 +333,13 @@ ;; definition for method 215 of type civilian ;; INFO: Used lq/sq ;; WARN: Return type mismatch nav-segment vs none. -(defmethod civilian-method-215 civilian ((obj civilian) (arg0 vector)) +(defmethod civilian-method-215 civilian ((this civilian) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> obj root trans quad)) + (set! (-> v1-0 quad) (-> this root trans quad)) (set! (-> v1-0 w) 81920.0) - (let ((s5-0 (find-segment obj v1-0 arg0))) + (let ((s5-0 (find-segment this v1-0 arg0))) (if s5-0 - (citizen-method-186 obj s5-0) + (citizen-method-186 this s5-0) ) ) ) @@ -348,7 +348,7 @@ ;; definition for method 74 of type civilian ;; INFO: Used lq/sq -(defmethod general-event-handler civilian ((obj civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler civilian ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -359,111 +359,111 @@ #f ) (('touched) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) (('panic) (let ((a0-6 (-> arg3 param 0))) - (set! (-> obj danger-pos quad) (-> (the-as sphere (+ a0-6 0)) quad)) + (set! (-> this danger-pos quad) (-> (the-as sphere (+ a0-6 0)) quad)) ) - (if (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) - (or (= v1-6 'active) (= v1-6 'wait) (= v1-6 'avoid-danger)) - ) + (if (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'active) (= v1-6 'wait) (= v1-6 'avoid-danger)) + ) ) - (go (method-of-object obj flee)) + (go (method-of-object this flee)) ) ) (('event-death) - (if (zero? (-> obj hit-points)) - (do-effect (-> obj skel effect) 'death-default 0.0 -1) + (if (zero? (-> this hit-points)) + (do-effect (-> this skel effect) 'death-default 0.0 -1) ) ) (('avoid) - (set! (-> obj last-danger-time) (current-time)) + (set-time! (-> this last-danger-time)) (let ((a0-15 (-> arg3 param 0))) - (set! (-> obj danger-pos quad) (-> (the-as vector (+ a0-15 0)) quad)) + (set! (-> this danger-pos quad) (-> (the-as vector (+ a0-15 0)) quad)) ) - (if (and (-> obj next-state) (let ((v1-18 (-> obj next-state name))) - (or (= v1-18 'active) (= v1-18 'wait)) - ) + (if (and (-> this next-state) (let ((v1-18 (-> this next-state name))) + (or (= v1-18 'active) (= v1-18 'wait)) + ) ) - (go (method-of-object obj avoid-danger)) + (go (method-of-object this avoid-danger)) ) ) (('clear-path) - (set! (-> obj last-danger-time) (current-time)) + (set-time! (-> this last-danger-time)) (let ((v1-23 (the-as traffic-danger-info (-> arg3 param 0)))) - (set! (-> obj cp-valid?) #t) - (set! (-> obj cp-sphere quad) (-> v1-23 sphere quad)) - (set! (-> obj cp-vec quad) (-> v1-23 velocity quad)) + (set! (-> this cp-valid?) #t) + (set! (-> this cp-sphere quad) (-> v1-23 sphere quad)) + (set! (-> this cp-vec quad) (-> v1-23 velocity quad)) (case (-> v1-23 danger-type) (((traffic-danger-type tdt0)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 20.0) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 20.0) ) (((traffic-danger-type tdt1)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 20.0) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 20.0) ) (((traffic-danger-type tdt2)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) ) (((traffic-danger-type tdt3)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) ) (((traffic-danger-type tdt4)) - (set! (-> obj allow-dive) #f) - (set! (-> obj cp-factor) 2.0) + (set! (-> this allow-dive) #f) + (set! (-> this cp-factor) 2.0) ) (((traffic-danger-type tdt5)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) ) (((traffic-danger-type tdt6)) - (set! (-> obj allow-dive) #t) - (set! (-> obj cp-factor) 50.0) + (set! (-> this allow-dive) #t) + (set! (-> this cp-factor) 50.0) ) ) ) - (let ((s5-1 (-> obj cp-plane))) - (set! (-> s5-1 quad) (-> obj cp-vec quad)) + (let ((s5-1 (-> this cp-plane))) + (set! (-> s5-1 quad) (-> this cp-vec quad)) (set! (-> s5-1 y) 0.0) (vector-rotate90-around-y! s5-1 s5-1) (vector-normalize! s5-1 1.0) - (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> obj cp-sphere))))) + (set! (-> s5-1 w) (- (vector-dot (the-as vector s5-1) (the-as vector (-> this cp-sphere))))) ) - (set! (-> obj cp-exit-time) (+ (current-time) (seconds 4))) - (if (and (-> obj next-state) (let ((v1-54 (-> obj next-state name))) - (or (= v1-54 'active) (= v1-54 'wait) (= v1-54 'avoid-danger)) - ) + (set! (-> this cp-exit-time) (+ (current-time) (seconds 4))) + (if (and (-> this next-state) (let ((v1-54 (-> this next-state name))) + (or (= v1-54 'active) (= v1-54 'wait) (= v1-54 'avoid-danger)) + ) ) - (go (method-of-object obj clear-path)) + (go (method-of-object this clear-path)) ) ) (('hit 'hit-flinch 'hit-knocked) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (if (logtest? (-> obj flags) (citizen-flag female)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-27)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-19)) + (speech-control-method-13 *speech-control* (the-as handle this)) + (if (logtest? (-> this flags) (citizen-flag female)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-27)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-19)) ) - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) (('end-task) - (let ((v0-0 (the-as object (logclear (-> obj flags) (citizen-flag persistent))))) - (set! (-> obj flags) (the-as citizen-flag v0-0)) + (let ((v0-0 (the-as object (logclear (-> this flags) (citizen-flag persistent))))) + (set! (-> this flags) (the-as citizen-flag v0-0)) v0-0 ) ) (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 214 of type civilian ;; INFO: Used lq/sq -(defmethod civilian-method-214 civilian ((obj civilian) (arg0 nav-branch) (arg1 int) (arg2 vector) (arg3 float)) +(defmethod civilian-method-214 civilian ((this civilian) (arg0 nav-branch) (arg1 int) (arg2 vector) (arg3 float)) (when (nonzero? arg1) (-> arg0 src-node) (let* ((s3-0 (-> arg0 dest-node)) @@ -479,7 +479,7 @@ (f30-0 0.0) ) (dotimes (s0-0 s2-0) - (+! f30-0 (civilian-method-214 obj (-> s3-0 branch-array s0-0) (+ arg1 -1) arg2 s1-0)) + (+! f30-0 (civilian-method-214 this (-> s3-0 branch-array s0-0) (+ arg1 -1) arg2 s1-0)) ) (set! arg3 (+ s1-0 (the float (/ (the int f30-0) s2-0)))) ) @@ -593,7 +593,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -638,7 +638,7 @@ (speech-control-method-12 *speech-control* self (speech-type speech-type-16)) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.1)) (not (logtest? (-> self nav state flags) (nav-state-flag in-mesh))) (< (-> self root trans y) 4096.0) ) @@ -810,7 +810,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -992,7 +992,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1080,10 +1080,10 @@ ;; definition for method 216 of type civilian ;; WARN: Return type mismatch object vs none. -(defmethod go-dive civilian ((obj civilian)) - (if (< (-> obj nav state speed) 8192.0) - (go (method-of-object obj on-ground)) - (go (method-of-object obj dive)) +(defmethod go-dive civilian ((this civilian)) + (if (< (-> this nav state speed) 8192.0) + (go (method-of-object this on-ground)) + (go (method-of-object this dive)) ) (none) ) @@ -1093,7 +1093,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1153,7 +1153,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1252,7 +1252,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1345,7 +1345,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1397,7 +1397,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1493,7 +1493,7 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (let ((v1-1 (-> self root root-prim))) @@ -1538,7 +1538,7 @@ ) :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 self)) (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) @@ -1592,17 +1592,17 @@ ) ;; definition for method 217 of type civilian -(defmethod civilian-method-217 civilian ((obj civilian) (arg0 vector)) - (let ((s3-0 (handle->process (-> obj vehicle))) +(defmethod civilian-method-217 civilian ((this civilian) (arg0 vector)) + (let ((s3-0 (handle->process (-> this vehicle))) (s4-0 (new 'stack 'collide-query)) ) - (compute-seat-position (the-as vehicle s3-0) arg0 (-> obj seat)) + (compute-seat-position (the-as vehicle s3-0) arg0 (-> this seat)) (vector-! arg0 arg0 (-> (the-as vehicle s3-0) root trans)) (vector-normalize! arg0 (+ 14336.0 (vector-length arg0))) (vector+! arg0 arg0 (-> (the-as vehicle s3-0) root trans)) - (when (enemy-above-ground? obj s4-0 arg0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (when (enemy-above-ground? this s4-0 arg0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> arg0 y) (-> s4-0 best-other-tri intersect y)) - (let ((v1-14 (-> obj nav)) + (let ((v1-14 (-> this nav)) (a1-10 (new 'stack-no-clear 'nav-find-poly-parms)) ) (vector-! (-> a1-10 point) arg0 (-> v1-14 state mesh bounds)) @@ -1694,7 +1694,7 @@ ) :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-4 enemy-flags))) (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-4 enemy-flags)))) @@ -1808,7 +1808,7 @@ ) :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-5 (-> self root root-prim))) (set! (-> v1-5 prim-core collide-as) (collide-spec)) (set! (-> v1-5 prim-core collide-with) (collide-spec)) @@ -1935,7 +1935,7 @@ (let ((a0-1 (the-as object (-> block param 0)))) (set! (-> self event-param-point quad) (-> (the-as vector a0-1) quad)) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (go-virtual exit-vehicle) ) ) @@ -1949,7 +1949,7 @@ ) :enter (behavior () (logior! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-5 (-> self root root-prim))) (set! (-> v1-5 prim-core collide-as) (collide-spec)) (set! (-> v1-5 prim-core collide-with) (collide-spec)) @@ -2026,7 +2026,7 @@ (set! (-> self gnd-height) (-> self root gspot-pos y)) (logior! (-> self flags) (citizen-flag persistent)) (logior! (-> self focus-status) (focus-status pilot-riding pilot)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-28 (-> self root root-prim))) (set! (-> v1-28 prim-core collide-as) (collide-spec)) (set! (-> v1-28 prim-core collide-with) (collide-spec)) @@ -2153,7 +2153,7 @@ :event enemy-event-handler :enter (behavior () (logclear! (-> self flags) (citizen-flag persistent)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 self)) (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) 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 0353f772a2..0eb5f13e94 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 @@ -22,17 +22,17 @@ ) ;; definition for method 3 of type guard-anim-info -(defmethod inspect guard-anim-info ((obj guard-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect guard-anim-info ((this guard-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'guard-anim-info) - (format #t "~1Tanim-index[2] @ #x~X~%" (-> obj anim-index)) - (format #t "~1Tanim-index-front: ~D~%" (-> obj anim-index-front)) - (format #t "~1Tanim-index-back: ~D~%" (-> obj anim-index-back)) + (format #t "[~8x] ~A~%" this 'guard-anim-info) + (format #t "~1Tanim-index[2] @ #x~X~%" (-> this anim-index)) + (format #t "~1Tanim-index-front: ~D~%" (-> this anim-index-front)) + (format #t "~1Tanim-index-back: ~D~%" (-> this anim-index-back)) (label cfg-4) - obj + this ) ;; definition of type guard-global-info @@ -55,25 +55,25 @@ ) ;; definition for method 3 of type guard-global-info -(defmethod inspect guard-global-info ((obj guard-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect guard-global-info ((this guard-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-yellow-hit: ~D~%" (-> obj prev-yellow-hit)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tknocked[2] @ #x~X~%" (-> obj knocked)) - (format #t "~1Tknocked-land[2] @ #x~X~%" (-> obj knocked-land)) - (format #t "~1Tanim-knocked-front: ~D~%" (-> obj anim-knocked-front)) - (format #t "~1Tanim-knocked-back: ~D~%" (-> obj anim-knocked-back)) - (format #t "~1Tanim-knocked-front-land: ~D~%" (-> obj anim-knocked-front-land)) - (format #t "~1Tanim-knocked-back-land: ~D~%" (-> obj anim-knocked-back-land)) - (format #t "~1Tyellow-hit-anim[2] @ #x~X~%" (-> obj yellow-hit-anim)) - (format #t "~1Tyellow-land-anim[2] @ #x~X~%" (-> obj yellow-land-anim)) - (format #t "~1Tblue-hit-anim[1] @ #x~X~%" (&-> obj blue-hit-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tknocked[2] @ #x~X~%" (-> this knocked)) + (format #t "~1Tknocked-land[2] @ #x~X~%" (-> this knocked-land)) + (format #t "~1Tanim-knocked-front: ~D~%" (-> this anim-knocked-front)) + (format #t "~1Tanim-knocked-back: ~D~%" (-> this anim-knocked-back)) + (format #t "~1Tanim-knocked-front-land: ~D~%" (-> this anim-knocked-front-land)) + (format #t "~1Tanim-knocked-back-land: ~D~%" (-> this anim-knocked-back-land)) + (format #t "~1Tyellow-hit-anim[2] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tyellow-land-anim[2] @ #x~X~%" (-> this yellow-land-anim)) + (format #t "~1Tblue-hit-anim[1] @ #x~X~%" (&-> this blue-hit-anim)) (label cfg-4) - obj + this ) ;; definition of type guard-shoot-info @@ -89,17 +89,17 @@ ) ;; definition for method 3 of type guard-shoot-info -(defmethod inspect guard-shoot-info ((obj guard-shoot-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect guard-shoot-info ((this guard-shoot-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'guard-shoot-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) - (format #t "~1Tstart: ~f~%" (-> obj start)) - (format #t "~1Tend: ~f~%" (-> obj end)) + (format #t "[~8x] ~A~%" this 'guard-shoot-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~1Tstart: ~f~%" (-> this start)) + (format #t "~1Tend: ~f~%" (-> this end)) (label cfg-4) - obj + this ) ;; definition for symbol *crimson-guard-global-info*, type guard-global-info @@ -373,59 +373,59 @@ ) ;; definition for method 3 of type crimson-guard -(defmethod inspect crimson-guard ((obj crimson-guard)) - (when (not obj) - (set! obj obj) +(defmethod inspect crimson-guard ((this crimson-guard)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type citizen inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: ~A~%" (-> obj info)) - (format #t "~2Thit-face: ~D~%" (-> obj hit-face)) - (format #t "~2Tanim-get-up-front: ~D~%" (-> obj anim-get-up-front)) - (format #t "~2Tanim-get-up-back: ~D~%" (-> obj anim-get-up-back)) - (format #t "~2Tsmall-hit: ~D~%" (-> obj small-hit)) - (format #t "~2Tyellow-anim: ~D~%" (-> obj yellow-anim)) - (format #t "~2Tguard-type: ~D~%" (-> obj guard-type)) - (format #t "~2Tsettings: #~%" (-> obj settings)) - (format #t "~2Tnext-time: ~D~%" (-> obj next-time)) - (format #t "~2Tlast-time-see-target: ~D~%" (-> obj last-time-see-target)) - (format #t "~2Tjoint: ~A~%" (-> obj joint)) - (format #t "~2Tjoint-enable: ~A~%" (-> obj joint-enable)) - (format #t "~2Talready-shot: ~A~%" (-> obj already-shot)) - (format #t "~2Tmiss-amount: ~f~%" (-> obj miss-amount)) - (format #t "~2Tl-control: ~A~%" (-> obj l-control)) - (format #t "~2Tnext-shot: ~D~%" (-> obj next-shot)) - (format #t "~2Tanim-shoot[3] @ #x~X~%" (-> obj anim-shoot)) - (format #t "~2Ttransport: ~D~%" (-> obj transport)) - (format #t "~2Ttransport-side: ~D~%" (-> obj transport-side)) - (format #t "~2Ttarget-flags: ~D~%" (-> obj target-flags)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Ttarget-pos-predict: #~%" (-> obj target-pos-predict)) - (format #t "~2Ttarget-pos-predict-miss: #~%" (-> obj target-pos-predict-miss)) - (format #t "~2Ttarget-vel-vec: #~%" (-> obj target-vel-vec)) - (format #t "~2Ttarget-vel: ~f~%" (-> obj target-vel)) - (format #t "~2Ttarget-self: #~%" (-> obj target-self)) - (format #t "~2Ttarget-self-xz: #~%" (-> obj target-self-xz)) - (format #t "~2Ttarget-self-dist: ~f~%" (-> obj target-self-dist)) - (format #t "~2Ttarget-self-xz-dist: ~f~%" (-> obj target-self-xz-dist)) - (format #t "~2Ttarget-y-angle: ~f~%" (-> obj target-y-angle)) - (format #t "~2Tlast-visible-target-pos: #~%" (-> obj last-visible-target-pos)) - (format #t "~2Tlazer-sound: ~D~%" (-> obj lazer-sound)) - (format #t "~2Tmove-position: #~%" (-> obj move-position)) - (format #t "~2Tmove-index: ~D~%" (-> obj move-index)) - (format #t "~2Ttraffic-target-status: #~%" (-> obj traffic-target-status)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) - (format #t "~2Tother-side: ~A~%" (-> obj other-side)) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Thit-face: ~D~%" (-> this hit-face)) + (format #t "~2Tanim-get-up-front: ~D~%" (-> this anim-get-up-front)) + (format #t "~2Tanim-get-up-back: ~D~%" (-> this anim-get-up-back)) + (format #t "~2Tsmall-hit: ~D~%" (-> this small-hit)) + (format #t "~2Tyellow-anim: ~D~%" (-> this yellow-anim)) + (format #t "~2Tguard-type: ~D~%" (-> this guard-type)) + (format #t "~2Tsettings: #~%" (-> this settings)) + (format #t "~2Tnext-time: ~D~%" (-> this next-time)) + (format #t "~2Tlast-time-see-target: ~D~%" (-> this last-time-see-target)) + (format #t "~2Tjoint: ~A~%" (-> this joint)) + (format #t "~2Tjoint-enable: ~A~%" (-> this joint-enable)) + (format #t "~2Talready-shot: ~A~%" (-> this already-shot)) + (format #t "~2Tmiss-amount: ~f~%" (-> this miss-amount)) + (format #t "~2Tl-control: ~A~%" (-> this l-control)) + (format #t "~2Tnext-shot: ~D~%" (-> this next-shot)) + (format #t "~2Tanim-shoot[3] @ #x~X~%" (-> this anim-shoot)) + (format #t "~2Ttransport: ~D~%" (-> this transport)) + (format #t "~2Ttransport-side: ~D~%" (-> this transport-side)) + (format #t "~2Ttarget-flags: ~D~%" (-> this target-flags)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Ttarget-pos-predict: #~%" (-> this target-pos-predict)) + (format #t "~2Ttarget-pos-predict-miss: #~%" (-> this target-pos-predict-miss)) + (format #t "~2Ttarget-vel-vec: #~%" (-> this target-vel-vec)) + (format #t "~2Ttarget-vel: ~f~%" (-> this target-vel)) + (format #t "~2Ttarget-self: #~%" (-> this target-self)) + (format #t "~2Ttarget-self-xz: #~%" (-> this target-self-xz)) + (format #t "~2Ttarget-self-dist: ~f~%" (-> this target-self-dist)) + (format #t "~2Ttarget-self-xz-dist: ~f~%" (-> this target-self-xz-dist)) + (format #t "~2Ttarget-y-angle: ~f~%" (-> this target-y-angle)) + (format #t "~2Tlast-visible-target-pos: #~%" (-> this last-visible-target-pos)) + (format #t "~2Tlazer-sound: ~D~%" (-> this lazer-sound)) + (format #t "~2Tmove-position: #~%" (-> this move-position)) + (format #t "~2Tmove-index: ~D~%" (-> this move-index)) + (format #t "~2Ttraffic-target-status: #~%" (-> this traffic-target-status)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tother-side: ~A~%" (-> this other-side)) (label cfg-4) - obj + this ) ;; definition for method 218 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-218 crimson-guard ((obj crimson-guard) (arg0 vector)) +(defmethod crimson-guard-method-218 crimson-guard ((this crimson-guard) (arg0 vector)) (local-vars (sv-240 vector) (sv-256 (function vector vector vector)) @@ -444,7 +444,7 @@ (init-vf0-vector) (set! sv-240 arg0) (let ((s0-0 (new 'stack-no-clear 'vector))) - (let ((v1-1 (-> obj root trans))) + (let ((v1-1 (-> this root trans))) (let ((a0-1 *y-vector*)) (let ((a1-2 8192.0)) (.mov vf7 a1-2) @@ -463,14 +463,14 @@ (s2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (-> obj node-list data 4 bone transform) - (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (-> this node-list data 4 bone transform) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) - (set! (-> s0-0 quad) (-> obj root trans quad)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (set! (-> s0-0 quad) (-> this root trans quad)) (cond - ((logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + ((logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) (let ((a1-6 s0-0)) (let ((v1-14 s0-0)) (let ((a0-9 s4-0)) @@ -533,7 +533,7 @@ (vector+! sv-288 sv-288 v0-5) ) (vector-normalize! (vector-! sv-320 sv-288 s0-0) 1.0) - (vector-z-quaternion! sv-304 (-> obj root quat)) + (vector-z-quaternion! sv-304 (-> this root quat)) (rot-zxy-from-vector! s2-0 sv-304) (rot-zxy-from-vector! s1-0 sv-320) (set! (-> s5-0 x) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 x) (-> s2-0 x))))) @@ -545,7 +545,7 @@ (quaternion-vector-angle! s1-1 s3-0 (-> s5-0 y)) (quaternion*! s2-1 s1-1 s2-1) ) - (quaternion-pseudo-seek (-> obj joint quat) (-> obj joint quat) s2-1 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) s2-1 (seconds-per-frame)) ) ) ) @@ -557,8 +557,8 @@ ;; definition for method 219 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-219 crimson-guard ((obj crimson-guard)) - (quaternion-pseudo-seek (-> obj joint quat) (-> obj joint quat) *unity-quaternion* (seconds-per-frame)) +(defmethod crimson-guard-method-219 crimson-guard ((this crimson-guard)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) *unity-quaternion* (seconds-per-frame)) 0 (none) ) @@ -567,44 +567,44 @@ (define *guard-min-id-hack* 255) ;; definition for method 55 of type crimson-guard -(defmethod track-target! crimson-guard ((obj crimson-guard)) +(defmethod track-target! crimson-guard ((this crimson-guard)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type citizen track-target!))) - (t9-0 obj) + (t9-0 this) ) - (update-transforms (-> obj root)) - (if (< (-> obj traffic-id) *guard-min-id-hack*) - (set! *guard-min-id-hack* (-> obj traffic-id)) + (update-transforms (-> this root)) + (if (< (-> this traffic-id) *guard-min-id-hack*) + (set! *guard-min-id-hack* (-> this traffic-id)) ) - (if (-> obj joint-enable) - (crimson-guard-method-218 obj (-> obj target-pos-predict-miss)) - (crimson-guard-method-219 obj) + (if (-> this joint-enable) + (crimson-guard-method-218 this (-> this target-pos-predict-miss)) + (crimson-guard-method-219 this) ) (none) ) ;; definition for method 73 of type crimson-guard -(defmethod kill-prefer-falling crimson-guard ((obj crimson-guard)) +(defmethod kill-prefer-falling crimson-guard ((this crimson-guard)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" - ((method-of-type nav-enemy kill-prefer-falling) obj) + ((method-of-type nav-enemy kill-prefer-falling) this) ) ;; definition for method 72 of type crimson-guard -(defmethod react-to-focus crimson-guard ((obj crimson-guard)) +(defmethod react-to-focus crimson-guard ((this crimson-guard)) "@TODO - flesh out docs" - (if (not (logtest? (-> obj flags) (citizen-flag hostile))) - (go (method-of-object obj active)) - (go-hostile obj) + (if (not (logtest? (-> this flags) (citizen-flag hostile))) + (go (method-of-object this active)) + (go-hostile this) ) ) ;; definition for method 56 of type crimson-guard -(defmethod damage-amount-from-attack crimson-guard ((obj crimson-guard) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack crimson-guard ((this crimson-guard) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" - (let ((v0-0 ((method-of-type nav-enemy damage-amount-from-attack) obj arg0 arg1))) + (let ((v0-0 ((method-of-type nav-enemy damage-amount-from-attack) this arg0 arg1))) (-> arg1 param 1) v0-0 ) @@ -613,61 +613,61 @@ ;; definition for method 74 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: disable def twice: 122. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler crimson-guard ((obj crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler crimson-guard ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (logior! (-> obj flags) (citizen-flag hostile)) - (let* ((s0-0 (handle->process (-> obj incoming attacker-handle))) + (speech-control-method-13 *speech-control* (the-as handle this)) + (logior! (-> this flags) (citizen-flag hostile)) + (let* ((s0-0 (handle->process (-> this incoming attacker-handle))) (s1-0 (if (type? s0-0 process-focusable) s0-0 ) ) ) (when s1-0 - (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) - (trigger-alert obj 1 (the-as target s1-0)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-11)) + (trigger-alert this 1 (the-as target s1-0)) ) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('event-death) - (if (zero? (-> obj hit-points)) - (do-effect (-> obj skel effect) 'death-default 0.0 -1) + (if (zero? (-> this hit-points)) + (do-effect (-> this skel effect) 'death-default 0.0 -1) ) ) (('bouncing-off) - (when (or (and (-> obj next-state) (= (-> obj next-state name) 'active)) - (and (-> obj next-state) (= (-> obj next-state name) 'wait)) + (when (or (and (-> this next-state) (= (-> this next-state name) 'active)) + (and (-> this next-state) (= (-> this next-state name) 'wait)) ) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-14)) - (go (method-of-object obj close-attack-active)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-14)) + (go (method-of-object this close-attack-active)) ) ) (('combo) - (and (not (and (-> obj next-state) (= (-> obj next-state name) 'inactive))) - (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) + (and (not (and (-> this next-state) (= (-> this next-state name) 'inactive))) + (and (not (logtest? (enemy-flag multi-focus) (-> this enemy-flags))) (nonzero? (-> this hit-points))) ) ) (('avoid) #f ) (('panic) - (set! (-> obj last-danger-time) (current-time)) + (set-time! (-> this last-danger-time)) (let ((v1-38 (the-as traffic-danger-info (-> arg3 param 0)))) (case (-> v1-38 danger-type) (((traffic-danger-type tdt7)) - (set! (-> obj cp-factor) 20.0) - (let ((s5-1 (method-of-object obj trigger-alert)) + (set! (-> this cp-factor) 20.0) + (let ((s5-1 (method-of-object this trigger-alert)) (s4-1 1) (s3-1 (handle->process (-> v1-38 handle))) ) - (s5-1 obj s4-1 (the-as target (if (type? s3-1 process-focusable) - s3-1 - ) - ) + (s5-1 this s4-1 (the-as target (if (type? s3-1 process-focusable) + s3-1 + ) + ) ) ) ) @@ -675,14 +675,14 @@ ) ) (('clear-path) - (set! (-> obj last-danger-time) (current-time)) + (set-time! (-> this last-danger-time)) (let ((v1-44 (the-as traffic-danger-info (-> arg3 param 0)))) - (set! (-> obj cp-valid?) #t) - (set! (-> obj cp-sphere quad) (-> v1-44 sphere quad)) - (set! (-> obj cp-vec quad) (-> v1-44 velocity quad)) + (set! (-> this cp-valid?) #t) + (set! (-> this cp-sphere quad) (-> v1-44 sphere quad)) + (set! (-> this cp-vec quad) (-> v1-44 velocity quad)) (case (-> v1-44 danger-type) (((traffic-danger-type tdt0)) - (trigger-alert obj 1 *target*) + (trigger-alert this 1 *target*) ) (((traffic-danger-type tdt1)) ) @@ -697,58 +697,58 @@ (((traffic-danger-type tdt6)) ) (((traffic-danger-type tdt7)) - (trigger-alert obj 1 *target*) + (trigger-alert this 1 *target*) ) ) ) - (let ((s5-2 (-> obj cp-plane))) - (set! (-> s5-2 quad) (-> obj cp-vec quad)) + (let ((s5-2 (-> this cp-plane))) + (set! (-> s5-2 quad) (-> this cp-vec quad)) (set! (-> s5-2 y) 0.0) (vector-rotate90-around-y! s5-2 s5-2) (vector-normalize! s5-2 1.0) - (set! (-> s5-2 w) (- (vector-dot (the-as vector s5-2) (the-as vector (-> obj cp-sphere))))) + (set! (-> s5-2 w) (- (vector-dot (the-as vector s5-2) (the-as vector (-> this cp-sphere))))) ) (let ((v0-4 (the-as object (+ (current-time) (seconds 1))))) - (set! (-> obj cp-exit-time) (the-as time-frame v0-4)) + (set! (-> this cp-exit-time) (the-as time-frame v0-4)) v0-4 ) ) (('end-pursuit) (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> obj pid)) + (when (focus-test? this inactive) + (format 0 "guard::event end-pursuit recieved by inactive process ~d~%" (-> this pid)) (break!) 0 ) ) - (when (not (focus-test? obj dead)) - (when (logtest? (-> obj flags) (citizen-flag hostile)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (go (method-of-object obj active)) + (when (not (focus-test? this dead)) + (when (logtest? (-> this flags) (citizen-flag hostile)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (citizen-method-195 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) ) ) ) (('alert-begin) (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> obj pid)) + (when (focus-test? this inactive) + (format 0 "guard::event alert-begin recieved by inactive process ~d~%" (-> this pid)) (break!) 0 ) ) - (when (not (focus-test? obj dead)) - (when (not (logtest? (-> obj flags) (citizen-flag hostile))) + (when (not (focus-test? this dead)) + (when (not (logtest? (-> this flags) (citizen-flag hostile))) (let ((a1-27 (the-as object (-> arg3 param 0)))) (when (and (the-as uint a1-27) (not (logtest? (-> (the-as process-focusable a1-27) focus-status) (focus-status disable dead inactive))) ) - (set! (-> obj traffic-target-status handle) (process->handle (the-as process-focusable a1-27))) - (try-update-focus (-> obj focus) (the-as process-focusable a1-27) obj) - (if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'jump))) - (not (and (-> obj next-state) (= (-> obj next-state name) 'exit-transport))) + (set! (-> this traffic-target-status handle) (process->handle (the-as process-focusable a1-27))) + (try-update-focus (-> this focus) (the-as process-focusable a1-27) this) + (if (and (not (and (-> this next-state) (= (-> this next-state name) 'jump))) + (not (and (-> this next-state) (= (-> this next-state name) 'exit-transport))) ) - (go-hostile obj) + (go-hostile this) ) ) ) @@ -757,25 +757,25 @@ ) (('alert-end) (when *debug-segment* - (when (focus-test? obj inactive) - (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> obj pid)) + (when (focus-test? this inactive) + (format 0 "guard::event alert-end recieved by inactive process ~d~%" (-> this pid)) (break!) 0 ) ) - (when (not (focus-test? obj dead)) - (when (logtest? (-> obj flags) (citizen-flag hostile)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-5)) - (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (go (method-of-object obj active)) + (when (not (focus-test? this dead)) + (when (logtest? (-> this flags) (citizen-flag hostile)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-5)) + (citizen-method-195 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) ) ) ) (('track) - (if (and (-> obj next-state) (let ((v1-129 (-> obj next-state name))) - (or (= v1-129 'exit-transport) (= v1-129 'jump)) - ) + (if (and (-> this next-state) (let ((v1-129 (-> this next-state name))) + (or (= v1-129 'exit-transport) (= v1-129 'jump)) + ) ) #f #t @@ -789,20 +789,20 @@ (when (logtest? (-> (the-as process-focusable v1-130) mask) (process-mask target)) (when (focus-test? (the-as process-focusable v1-130) dead) (format #t "guard killed player~%") - (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-10)) ) ) ) ) ) (else - ((method-of-type citizen general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 26 of type crimson-guard -(defmethod get-inv-mass crimson-guard ((obj crimson-guard)) +(defmethod get-inv-mass crimson-guard ((this crimson-guard)) 0.6666667 ) @@ -811,7 +811,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -873,7 +873,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -983,51 +983,51 @@ ) ;; definition for method 77 of type crimson-guard -(defmethod enemy-method-77 crimson-guard ((obj crimson-guard) (arg0 (pointer float))) +(defmethod enemy-method-77 crimson-guard ((this crimson-guard) (arg0 (pointer float))) (cond - ((logtest? (-> obj flags) (citizen-flag knocked-out-car)) + ((logtest? (-> this flags) (citizen-flag knocked-out-car)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 42))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 42))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 42)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 42)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 42)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 42)) num-func-seek!) ) - (logclear! (-> obj flags) (citizen-flag knocked-out-car)) + (logclear! (-> this flags) (citizen-flag knocked-out-car)) ) - ((logtest? (-> obj flags) (citizen-flag knocked-out-bike)) + ((logtest? (-> this flags) (citizen-flag knocked-out-bike)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 43))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 43))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 43)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 43)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 43)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 43)) num-func-seek!) ) - (logclear! (-> obj flags) (citizen-flag knocked-out-bike)) + (logclear! (-> this flags) (citizen-flag knocked-out-bike)) ) ((begin - (let ((v1-37 (-> obj root transv))) + (let ((v1-37 (-> this root transv))) (cond ((< (sqrtf (+ (* (-> v1-37 x) (-> v1-37 x)) (* (-> v1-37 z) (-> v1-37 z)))) 32768.0) - (set! (-> obj small-hit) 1) + (set! (-> this small-hit) 1) ) (else - (set! (-> obj small-hit) 0) + (set! (-> this small-hit) 0) 0 ) ) ) - (<= (-> obj hit-points) 0) + (<= (-> this hit-points) 0) ) (ja-channel-push! 1 (seconds 0.01)) - (let ((a1-6 (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) - (a0-11 (-> obj skel root-channel 0)) + (let ((a1-6 (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + (a0-11 (-> this skel root-channel 0)) ) (set! (-> a0-11 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-11 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) @@ -1037,19 +1037,19 @@ ) ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-5) (knocked-type knocked-type-7)) (ja-channel-push! 1 (seconds 0.01)) (cond - ((= (-> obj small-hit) 1) - (set! (-> obj yellow-anim) (the-as uint (get-rand-int obj 2))) - (let ((a1-12 (-> obj + ((= (-> this small-hit) 1) + (set! (-> this yellow-anim) (the-as uint (get-rand-int this 2))) + (let ((a1-12 (-> this draw art-group data (-> (the-as guard-global-info - (+ (+ (* (-> obj hit-face) 4) (* (-> obj yellow-anim) 8)) (the-as uint (-> obj info))) + (+ (+ (* (-> this hit-face) 4) (* (-> this yellow-anim) 8)) (the-as uint (-> this info))) ) yellow-hit-anim 0 @@ -1057,7 +1057,7 @@ ) ) ) - (a0-23 (-> obj skel root-channel 0)) + (a0-23 (-> this skel root-channel 0)) ) (set! (-> a0-23 frame-group) (the-as art-joint-anim a1-12)) (set! (-> a0-23 param 0) (the float (+ (-> (the-as art-joint-anim a1-12) frames num-frames) -1))) @@ -1067,8 +1067,8 @@ ) ) (else - (let ((a1-13 (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) - (a0-27 (-> obj skel root-channel 0)) + (let ((a1-13 (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + (a0-27 (-> this skel root-channel 0)) ) (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-13)) (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-13) frames num-frames) -1))) @@ -1081,21 +1081,21 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-30 (-> obj skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> obj draw art-group data 10))) + (let ((a0-30 (-> this skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> this draw art-group data 10))) (set! (-> a0-30 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 10)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1)) ) (set! (-> a0-30 param 1) (-> arg0 0)) (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> obj draw art-group data 10)) num-func-seek!) + (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!) ) ) (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-17 (-> obj draw art-group data (-> obj info knocked (-> obj hit-face))))) + (let ((a1-17 (-> this draw art-group data (-> this info knocked (-> this hit-face))))) (set! (-> arg0 0) (* 0.5 (-> arg0 0))) - (let ((a0-36 (-> obj skel root-channel 0))) + (let ((a0-36 (-> this skel root-channel 0))) (set! (-> a0-36 frame-group) (the-as art-joint-anim a1-17)) (set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-17) frames num-frames) -1))) (set! (-> a0-36 param 1) (-> arg0 0)) @@ -1106,8 +1106,8 @@ ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-19 (-> obj draw art-group data (-> obj info knocked (-> obj hit-face)))) - (a0-41 (-> obj skel root-channel 0)) + (let ((a1-19 (-> this draw art-group data (-> this info knocked (-> this hit-face)))) + (a0-41 (-> this skel root-channel 0)) ) (set! (-> a0-41 frame-group) (the-as art-joint-anim a1-19)) (set! (-> a0-41 param 0) (the float (+ (-> (the-as art-joint-anim a1-19) frames num-frames) -1))) @@ -1123,12 +1123,12 @@ ) ;; definition for method 78 of type crimson-guard -(defmethod enemy-method-78 crimson-guard ((obj crimson-guard) (arg0 (pointer float))) +(defmethod enemy-method-78 crimson-guard ((this crimson-guard) (arg0 (pointer float))) (cond - ((<= (-> obj hit-points) 0) + ((<= (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) - (a0-5 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + (a0-5 (-> this skel root-channel 0)) ) (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -1136,22 +1136,22 @@ (set! (-> a0-5 frame-num) 0.0) (joint-control-channel-group! a0-5 (the-as art-joint-anim a1-2) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-5) (knocked-type knocked-type-7)) (ja-channel-push! 1 (seconds 0.1)) (cond - ((= (-> obj small-hit) 1) - (let ((a1-7 (-> obj + ((= (-> this small-hit) 1) + (let ((a1-7 (-> this draw art-group data (-> (the-as guard-global-info - (+ (+ (* (-> obj hit-face) 4) (* (-> obj yellow-anim) 8)) (the-as uint (-> obj info))) + (+ (+ (* (-> this hit-face) 4) (* (-> this yellow-anim) 8)) (the-as uint (-> this info))) ) yellow-land-anim 0 @@ -1159,7 +1159,7 @@ ) ) ) - (a0-16 (-> obj skel root-channel 0)) + (a0-16 (-> this skel root-channel 0)) ) (set! (-> a0-16 frame-group) (the-as art-joint-anim a1-7)) (set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) @@ -1167,12 +1167,12 @@ (set! (-> a0-16 frame-num) 0.0) (joint-control-channel-group! a0-16 (the-as art-joint-anim a1-7) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else - (let ((a1-8 (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face)))) - (a0-20 (-> obj skel root-channel 0)) + (let ((a1-8 (-> this draw art-group data (-> this info knocked-land (-> this hit-face)))) + (a0-20 (-> this skel root-channel 0)) ) (set! (-> a0-20 frame-group) (the-as art-joint-anim a1-8)) (set! (-> a0-20 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1))) @@ -1186,23 +1186,23 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-23 (-> obj skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> obj draw art-group data 11))) + (let ((a0-23 (-> this skel root-channel 0))) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) (set! (-> a0-23 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 11)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) ) (set! (-> a0-23 param 1) (-> arg0 0)) (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> obj draw art-group data 11)) num-func-seek!) + (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-12 (-> obj draw art-group data (-> obj info knocked-land (-> obj hit-face))))) + (let ((a1-12 (-> this draw art-group data (-> this info knocked-land (-> this hit-face))))) (set! (-> arg0 0) 1.0) - (let ((a0-28 (-> obj skel root-channel 0))) + (let ((a0-28 (-> this skel root-channel 0))) (set! (-> a0-28 frame-group) (the-as art-joint-anim a1-12)) (set! (-> a0-28 param 0) (the float (+ (-> (the-as art-joint-anim a1-12) frames num-frames) -1))) (set! (-> a0-28 param 1) (-> arg0 0)) @@ -1220,16 +1220,16 @@ ;; definition for method 199 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-behavior! crimson-guard ((obj crimson-guard) (arg0 traffic-object-spawn-params)) +(defmethod set-behavior! crimson-guard ((this crimson-guard) (arg0 traffic-object-spawn-params)) (let ((a1-1 (-> arg0 guard-type))) - (if (or (and (!= a1-1 7) (!= a1-1 (-> obj guard-type))) (= (-> arg0 behavior) 11)) - (crimson-guard-method-225 obj a1-1 (= (-> arg0 behavior) 11)) + (if (or (and (!= a1-1 7) (!= a1-1 (-> this guard-type))) (= (-> arg0 behavior) 11)) + (crimson-guard-method-225 this a1-1 (= (-> arg0 behavior) 11)) ) ) (case (-> arg0 behavior) ((5) - (logior! (-> obj flags) (citizen-flag persistent hostile)) - (let ((s4-0 (-> obj focus)) + (logior! (-> this flags) (citizen-flag persistent hostile)) + (let ((s4-0 (-> this focus)) (s3-0 (method-of-type enemy-focus enemy-focus-method-13)) (s5-1 (handle->process (-> arg0 handle))) ) @@ -1242,58 +1242,58 @@ (enemy-aware enemy-aware-3) ) ) - (go (method-of-object obj arrest)) + (go (method-of-object this arrest)) ) ((6) - (logior! (-> obj flags) (citizen-flag persistent)) - (logior! (-> obj flags) (citizen-flag hostile)) - (set! (-> obj transport) (-> arg0 handle)) - (set! (-> obj transport-side) (-> arg0 user-data)) - (crimson-guard-method-223 obj 0.0) - (let* ((s4-1 (-> obj controller traffic)) + (logior! (-> this flags) (citizen-flag persistent)) + (logior! (-> this flags) (citizen-flag hostile)) + (set! (-> this transport) (-> arg0 handle)) + (set! (-> this transport-side) (-> arg0 user-data)) + (crimson-guard-method-223 this 0.0) + (let* ((s4-1 (-> this controller traffic)) (s5-2 (get-target s4-1)) ) (if (and (>= (the-as uint (get-alert-level s4-1)) (the-as uint 1)) s5-2) - (try-update-focus (-> obj focus) s5-2 obj) + (try-update-focus (-> this focus) s5-2 this) ) ) - (go (method-of-object obj exit-transport)) + (go (method-of-object this exit-transport)) ) ((9) - (logior! (-> obj flags) (citizen-flag persistent)) - (set! (-> obj focus handle) (-> arg0 handle)) - (set! (-> obj traffic-target-status handle) (-> arg0 handle)) - (go (method-of-object obj waiting-ambush)) + (logior! (-> this flags) (citizen-flag persistent)) + (set! (-> this focus handle) (-> arg0 handle)) + (set! (-> this traffic-target-status handle) (-> arg0 handle)) + (go (method-of-object this waiting-ambush)) ) ((3) - (set! (-> obj focus handle) (-> arg0 handle)) - (set! (-> obj traffic-target-status handle) (-> arg0 handle)) - (go (method-of-object obj hostile)) + (set! (-> this focus handle) (-> arg0 handle)) + (set! (-> this traffic-target-status handle) (-> arg0 handle)) + (go (method-of-object this hostile)) ) ((11) - (set! (-> obj root trans quad) (-> arg0 position quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 rotation)) - (set! (-> obj vehicle) (-> arg0 handle)) + (set! (-> this root trans quad) (-> arg0 position quad)) + (quaternion-copy! (-> this root quat) (-> arg0 rotation)) + (set! (-> this vehicle) (-> arg0 handle)) (ja-channel-set! 1) - (case (-> (the-as vehicle (handle->process (-> obj vehicle))) info object-type) + (case (-> (the-as vehicle (handle->process (-> this vehicle))) info object-type) ((11 12 13 18) - (logior! (-> obj flags) (citizen-flag knocked-out-bike)) - (let ((v1-64 (-> obj skel root-channel 0))) - (set! (-> v1-64 frame-group) (the-as art-joint-anim (-> obj draw art-group data 35))) + (logior! (-> this flags) (citizen-flag knocked-out-bike)) + (let ((v1-64 (-> this skel root-channel 0))) + (set! (-> v1-64 frame-group) (the-as art-joint-anim (-> this draw art-group data 35))) ) ) ((14 15 16 19) - (logior! (-> obj flags) (citizen-flag knocked-out-car)) - (let ((v1-70 (-> obj skel root-channel 0))) - (set! (-> v1-70 frame-group) (the-as art-joint-anim (-> obj draw art-group data 36))) + (logior! (-> this flags) (citizen-flag knocked-out-car)) + (let ((v1-70 (-> this skel root-channel 0))) + (set! (-> v1-70 frame-group) (the-as art-joint-anim (-> this draw art-group data 36))) ) ) ) (ja-post) - (go (method-of-object obj knocked-off-vehicle)) + (go (method-of-object this knocked-off-vehicle)) ) (else - ((method-of-type citizen set-behavior!) obj arg0) + ((method-of-type citizen set-behavior!) this arg0) ) ) 0 @@ -1315,26 +1315,26 @@ ;; definition for method 70 of type crimson-guard ;; WARN: Return type mismatch int vs object. -(defmethod go-hostile crimson-guard ((obj crimson-guard)) +(defmethod go-hostile crimson-guard ((this crimson-guard)) (cond - ((handle->process (-> obj focus handle)) - (logior! (-> obj flags) (citizen-flag hostile)) - (let ((v1-6 (-> obj hit-face))) + ((handle->process (-> this focus handle)) + (logior! (-> this flags) (citizen-flag hostile)) + (let ((v1-6 (-> this hit-face))) (cond ((zero? v1-6) - (go (method-of-object obj get-up-front)) + (go (method-of-object this get-up-front)) ) ((= v1-6 1) - (go (method-of-object obj get-up-back)) + (go (method-of-object this get-up-back)) ) (else - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) ) ) ) (else - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ) 0 @@ -1343,19 +1343,19 @@ ;; definition for method 214 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-214 crimson-guard ((obj crimson-guard)) - (let* ((s4-0 (-> obj target-pos-predict-miss)) - (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) +(defmethod crimson-guard-method-214 crimson-guard ((this crimson-guard)) + (let* ((s4-0 (-> this target-pos-predict-miss)) + (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (v1-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v1-2) 1.0)) (s4-1 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (set! (-> s4-1 ent) (-> obj entity)) + (set! (-> s4-1 ent) (-> this entity)) (set! (-> s4-1 charge) 1.0) (set! (-> s4-1 options) (projectile-options)) - (set! (-> s4-1 notify-handle) (process->handle obj)) + (set! (-> s4-1 notify-handle) (process->handle this)) (set! (-> s4-1 owner-handle) (the-as handle #f)) - (set! (-> s4-1 ignore-handle) (process->handle obj)) + (set! (-> s4-1 ignore-handle) (process->handle this)) (let* ((a0-13 *game-info*) (a1-12 (+ (-> a0-13 attack-id) 1)) ) @@ -1366,7 +1366,7 @@ (set! (-> s4-1 pos quad) (-> s5-0 quad)) (set! (-> s4-1 vel quad) (-> v1-3 quad)) (vector-normalize! (-> s4-1 vel) 819200.0) - (spawn-projectile guard-shot s4-1 obj *default-dead-pool*) + (spawn-projectile guard-shot s4-1 this *default-dead-pool*) ) 0 (none) @@ -1489,7 +1489,7 @@ ;; definition for method 217 of type crimson-guard ;; INFO: Used lq/sq -(defmethod crimson-guard-method-217 crimson-guard ((obj crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod crimson-guard-method-217 crimson-guard ((this crimson-guard) (arg0 vector) (arg1 vector) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1507,8 +1507,8 @@ (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) (set! (-> v1-4 collide-with) (collide-spec backgnd)) - (set! (-> v1-4 ignore-process0) obj) - (set! (-> v1-4 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) ) @@ -1566,8 +1566,8 @@ (let ((v1-17 s5-0)) (set! (-> v1-17 radius) f30-0) (set! (-> v1-17 collide-with) (collide-spec civilian enemy obstacle hit-by-player-list hit-by-others-list)) - (set! (-> v1-17 ignore-process0) obj) - (set! (-> v1-17 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-17 ignore-process0) this) + (set! (-> v1-17 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-17 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-17 action-mask) (collide-action solid)) ) @@ -1601,7 +1601,7 @@ ;; definition for method 220 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-220 crimson-guard ((obj crimson-guard)) +(defmethod crimson-guard-method-220 crimson-guard ((this crimson-guard)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1611,43 +1611,47 @@ ) (init-vf0-vector) (cond - ((logtest? (-> obj controller traffic alert-state flags) (traffic-alert-flag guard-multi-focus)) - (logior! (-> obj enemy-flags) (enemy-flag trackable)) - (when (not (logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags))) - (let ((a0-4 (find-closest-to-with-collide-lists (-> obj controller traffic) obj (-> obj focus collide-with)))) + ((logtest? (-> this controller traffic alert-state flags) (traffic-alert-flag guard-multi-focus)) + (logior! (-> this enemy-flags) (enemy-flag trackable)) + (when (not (logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags))) + (let ((a0-4 (find-closest-to-with-collide-lists (-> this controller traffic) this (-> this focus collide-with)))) (if a0-4 - (set! (-> obj traffic-target-status handle) (process->handle a0-4)) - (set! (-> obj traffic-target-status handle) (the-as handle #f)) + (set! (-> this traffic-target-status handle) (process->handle a0-4)) + (set! (-> this traffic-target-status handle) (the-as handle #f)) ) ) ) ) (else - (when (logtest? (enemy-flag trackable) (-> obj enemy-flags)) - (logclear! (-> obj enemy-flags) (enemy-flag trackable)) - (let* ((s5-0 (handle->process (-> obj traffic-target-status handle))) + (when (logtest? (enemy-flag trackable) (-> this enemy-flags)) + (logclear! (-> this enemy-flags) (enemy-flag trackable)) + (let* ((s5-0 (handle->process (-> this traffic-target-status handle))) (v1-21 (if (type? s5-0 process-focusable) s5-0 ) ) ) (if (and v1-21 (!= (-> v1-21 type) target)) - (set! (-> obj traffic-target-status handle) (the-as handle #f)) + (set! (-> this traffic-target-status handle) (the-as handle #f)) ) ) ) ) ) (let ((a1-3 (new 'stack-no-clear 'vector))) - (set! (-> a1-3 quad) (-> obj root trans quad)) + (set! (-> a1-3 quad) (-> this root trans quad)) (+! (-> a1-3 y) 8192.0) - (let ((s5-1 - (traffic-engine-method-49 (-> obj controller traffic) a1-3 (-> obj traffic-id) (-> obj traffic-target-status)) - ) + (let ((s5-1 (traffic-engine-method-49 + (-> this controller traffic) + a1-3 + (-> this traffic-id) + (-> this traffic-target-status) + ) + ) ) - (let* ((s4-0 obj) + (let* ((s4-0 this) (s3-0 (method-of-object s4-0 enemy-method-63)) - (s2-0 (handle->process (-> obj traffic-target-status handle))) + (s2-0 (handle->process (-> this traffic-target-status handle))) ) (s3-0 s4-0 @@ -1658,28 +1662,28 @@ (the-as enemy-aware #f) ) ) - (let ((s4-1 (handle->process (-> obj focus handle)))) + (let ((s4-1 (handle->process (-> this focus handle)))) (cond ((and s4-1 (not (logtest? (-> (the-as process-focusable s4-1) focus-status) (focus-status disable dead inactive))) ) (when (logtest? (-> s5-1 flags) (traffic-target-flag updated)) - (logclear! (-> obj flags) (citizen-flag target-in-sight)) - (if (crimson-guard-method-215 obj) - (logior! (-> obj flags) (citizen-flag target-in-sight)) + (logclear! (-> this flags) (citizen-flag target-in-sight)) + (if (crimson-guard-method-215 this) + (logior! (-> this flags) (citizen-flag target-in-sight)) ) ) - (set! (-> obj target-flags) (the-as uint (-> s5-1 flags))) - (set! (-> obj target-pos quad) (-> (get-trans (the-as process-focusable s4-1) 3) quad)) - (set! (-> obj target-vel-vec quad) (-> (the-as process-focusable s4-1) root transv quad)) - (set! (-> obj target-vel) (vector-length (-> obj target-vel-vec))) - (let ((s5-4 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> obj target-pos)))) + (set! (-> this target-flags) (the-as uint (-> s5-1 flags))) + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable s4-1) 3) quad)) + (set! (-> this target-vel-vec quad) (-> (the-as process-focusable s4-1) root transv quad)) + (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) + (let ((s5-4 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this target-pos)))) (let* ((f0-3 (vector-length s5-4)) (f0-4 (* 0.0000012207031 f0-3)) - (a1-9 (-> obj target-pos-predict)) + (a1-9 (-> this target-pos-predict)) ) - (let ((v1-62 (-> obj target-pos))) - (let ((a0-36 (-> obj target-vel-vec))) + (let ((v1-62 (-> this target-pos))) + (let ((a0-36 (-> this target-vel-vec))) (let ((a2-3 f0-4)) (.mov vf7 a2-3) ) @@ -1694,26 +1698,26 @@ ) (set! (-> s5-4 y) 0.0) (vector-rotate90-around-y! s5-4 s5-4) - (if (-> obj other-side) + (if (-> this other-side) (vector-negate! s5-4 s5-4) ) - (vector-normalize! s5-4 (-> obj miss-amount)) - (vector+! (-> obj target-pos-predict-miss) (-> obj target-pos-predict) s5-4) + (vector-normalize! s5-4 (-> this miss-amount)) + (vector+! (-> this target-pos-predict-miss) (-> this target-pos-predict) s5-4) ) - (vector-! (-> obj target-self) (-> obj target-pos) (-> obj root trans)) - (set! (-> obj target-self-xz quad) (-> obj target-self quad)) - (set! (-> obj target-self-xz y) 0.0) - (set! (-> obj target-self-dist) (vector-length (-> obj target-self))) - (set! (-> obj target-self-xz-dist) (vector-length (-> obj target-self-xz))) - (set! (-> obj target-y-angle) - (deg-diff (quaternion-y-angle (-> obj root quat)) (vector-y-angle (-> obj target-self))) + (vector-! (-> this target-self) (-> this target-pos) (-> this root trans)) + (set! (-> this target-self-xz quad) (-> this target-self quad)) + (set! (-> this target-self-xz y) 0.0) + (set! (-> this target-self-dist) (vector-length (-> this target-self))) + (set! (-> this target-self-xz-dist) (vector-length (-> this target-self-xz))) + (set! (-> this target-y-angle) + (deg-diff (quaternion-y-angle (-> this root quat)) (vector-y-angle (-> this target-self))) ) ) (else - (set! (-> obj traffic-target-status handle) (the-as handle #f)) - (logclear! (-> obj flags) (citizen-flag persistent in-pursuit hostile)) - (citizen-method-195 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (go (method-of-object obj active)) + (set! (-> this traffic-target-status handle) (the-as handle #f)) + (logclear! (-> this flags) (citizen-flag persistent in-pursuit hostile)) + (citizen-method-195 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (go (method-of-object this active)) ) ) ) @@ -1726,47 +1730,47 @@ ;; definition for method 221 of type crimson-guard ;; INFO: Used lq/sq -(defmethod crimson-guard-method-221 crimson-guard ((obj crimson-guard)) +(defmethod crimson-guard-method-221 crimson-guard ((this crimson-guard)) (let ((a1-0 (new 'stack-no-clear 'traffic-danger-info))) - (set! (-> a1-0 sphere quad) (-> obj root trans quad)) + (set! (-> a1-0 sphere quad) (-> this root trans quad)) (set! (-> a1-0 sphere r) 40960.0) - (set! (-> a1-0 velocity quad) (-> obj root transv quad)) + (set! (-> a1-0 velocity quad) (-> this root transv quad)) (set! (-> a1-0 notify-radius) 122880.0) (set! (-> a1-0 danger-level) 1.0) (set! (-> a1-0 decay-rate) 0.0) (set! (-> a1-0 flags) (traffic-danger-flags tdf0)) (set! (-> a1-0 danger-type) (traffic-danger-type tdt0)) - (add-danger (-> obj controller traffic) a1-0) + (add-danger (-> this controller traffic) a1-0) ) (none) ) ;; definition for method 215 of type crimson-guard ;; INFO: Used lq/sq -(defmethod crimson-guard-method-215 crimson-guard ((obj crimson-guard)) - (let ((s5-0 (get-trans obj 3)) +(defmethod crimson-guard-method-215 crimson-guard ((this crimson-guard)) + (let ((s5-0 (get-trans this 3)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> obj target-pos quad)) + (set! (-> s4-0 quad) (-> this target-pos quad)) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0))) (vector-normalize! s3-1 409600.0) - (zero? (crimson-guard-method-217 obj s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s3-1) s4-0)) + (zero? (crimson-guard-method-217 this s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s3-1) s4-0)) ) ) ) ;; definition for method 216 of type crimson-guard ;; INFO: Used lq/sq -(defmethod crimson-guard-method-216 crimson-guard ((obj crimson-guard)) +(defmethod crimson-guard-method-216 crimson-guard ((this crimson-guard)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj target-pos-predict-miss quad)) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) + (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a0-3)) ) (vector-normalize! s3-1 409600.0) - (and (crimson-guard-method-215 obj) - (zero? (crimson-guard-method-217 obj s4-0 (vector+! (new 'stack-no-clear 'vector) s4-0 s3-1) s5-0)) + (and (crimson-guard-method-215 this) + (zero? (crimson-guard-method-217 this s4-0 (vector+! (new 'stack-no-clear 'vector) s4-0 s3-1) s5-0)) ) ) ) @@ -1777,7 +1781,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1926,7 +1930,7 @@ (t9-1) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-11 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-11 enemy-flags))) (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-11 enemy-flags)))) @@ -2020,7 +2024,7 @@ (when (and (< (-> self target-self-xz-dist) 163840.0) (or (< 40960.0 (-> self target-self-xz-dist)) (>= 2 (the-as int (-> self focus aware)))) ) - (if (and (>= (- (current-time) (-> self state-time)) (the int (* 300.0 (get-rand-float-range self 1.0 3.0)))) + (if (and (time-elapsed? (-> self state-time) (the int (* 300.0 (get-rand-float-range self 1.0 3.0)))) (logtest? (-> self flags) (citizen-flag target-in-sight)) ) (go-virtual gun-shoot) @@ -2212,8 +2216,8 @@ (set! (-> a0-9 velocity quad) (-> v1-15 quad)) ) 0 - (set! (-> self state-time) (current-time)) - (set! (-> self last-time-see-target) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-time-see-target)) (crimson-guard-method-220 self) (set! (-> self miss-amount) (lerp-scale 0.0 16384.0 (-> self target-self-dist) 40960.0 122880.0)) (set! (-> self miss-amount) 16384.0) @@ -2248,7 +2252,7 @@ ) (go-virtual close-attack) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (or (not (logtest? (-> self flags) (citizen-flag target-in-sight))) (< 184320.0 (-> self target-self-xz-dist)) (< 10922.667 (fabs (-> self target-y-angle))) @@ -2279,7 +2283,7 @@ (set! v1-35 #t) (goto cfg-10) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (set! v1-35 #f) (goto cfg-10) ) @@ -2287,7 +2291,7 @@ (b! (not #f) cfg-3 :delay (set! v1-35 #f)) (label cfg-10) (when v1-35 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 3)) (until #f (ja-channel-push! 1 (seconds 0.1)) @@ -2352,9 +2356,9 @@ ;; definition for method 226 of type crimson-guard ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-method-226 crimson-guard ((obj crimson-guard)) - (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s5-0 (-> obj root)) +(defmethod crimson-guard-method-226 crimson-guard ((this crimson-guard)) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (-> this root)) (s3-0 (lambda ((arg0 crimson-guard) (arg1 collide-shape-moving) (arg2 vector)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -2396,14 +2400,14 @@ ) ) (cond - ((s3-0 obj s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 24576.0)) - (go (method-of-object obj roll-right)) + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 24576.0)) + (go (method-of-object this roll-right)) ) - ((s3-0 obj s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 -24576.0)) - (go (method-of-object obj roll-left)) + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 -24576.0)) + (go (method-of-object this roll-left)) ) (else - (go-hostile obj) + (go-hostile this) ) ) ) @@ -2637,8 +2641,8 @@ (set! (-> a0-9 velocity quad) (-> v1-12 quad)) ) 0 - (set! (-> self state-time) (current-time)) - (set! (-> self last-time-see-target) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-time-see-target)) (set! (-> self miss-amount) 0.0) (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) @@ -2718,7 +2722,7 @@ (set! (-> a0-9 velocity quad) (-> v1-12 quad)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self miss-amount) 0.0) (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self joint-enable) #t) @@ -2917,7 +2921,7 @@ ;; definition for method 222 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-method-222 crimson-guard ((obj crimson-guard)) +(defmethod crimson-guard-method-222 crimson-guard ((this crimson-guard)) (local-vars (sv-800 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2927,11 +2931,11 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (s2-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v0-1) 16384.0)) (s1-0 - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj target-pos-predict-miss) s4-0) 16384.0) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict-miss) s4-0) 16384.0) ) (s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'collide-query)) @@ -2969,7 +2973,7 @@ ) (set! (-> s3-0 start-pos quad) (-> s4-0 quad)) (set! (-> s3-0 move-dist quad) (-> s1-0 quad)) - (set! (-> obj l-control state points-to-draw) 0) + (set! (-> this l-control state points-to-draw) 0) (let ((f0-3 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) (s2-1 (new 'stack-no-clear 'vector)) ) @@ -2992,7 +2996,7 @@ (let ((s1-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s1-2 (let ((t9-14 (method-of-type part-tracker activate))) - (t9-14 (the-as part-tracker s1-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-14 (the-as part-tracker s1-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-15 run-function-in-process) (a0-33 s1-2) @@ -3022,7 +3026,7 @@ (let ((s1-3 (get-process *default-dead-pool* part-tracker #x4000))) (when s1-3 (let ((t9-17 (method-of-type part-tracker activate))) - (t9-17 (the-as part-tracker s1-3) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-17 (the-as part-tracker s1-3) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-18 run-function-in-process) (a0-36 s1-3) @@ -3049,10 +3053,10 @@ (-> s1-3 ppointer) ) ) - (set-point! (-> obj l-control) 0 s4-0) - (set-point! (-> obj l-control) 1 s5-0) - (set! (-> obj l-control spec) (-> *lightning-spec-id-table* 13)) - (+! (-> obj l-control state points-to-draw) 2) + (set-point! (-> this l-control) 0 s4-0) + (set-point! (-> this l-control) 1 s5-0) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 13)) + (+! (-> this l-control state points-to-draw) 2) (let* ((s1-4 (-> s3-0 best-other-tri collide-ptr)) (v1-43 (if (type? s1-4 collide-shape-prim) s1-4 @@ -3063,28 +3067,28 @@ (when v1-43 (set! s1-5 #f) (let ((s0-1 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> s0-1 ent) (-> obj entity)) + (set! (-> s0-1 ent) (-> this entity)) (set! (-> s0-1 charge) 1.0) (set! (-> s0-1 options) (projectile-options)) - (set! (-> s0-1 notify-handle) (process->handle obj)) + (set! (-> s0-1 notify-handle) (process->handle this)) (set! (-> s0-1 owner-handle) (the-as handle #f)) - (set! (-> s0-1 ignore-handle) (process->handle obj)) - (set! (-> s0-1 attack-id) (-> obj attack-id)) + (set! (-> s0-1 ignore-handle) (process->handle this)) + (set! (-> s0-1 attack-id) (-> this attack-id)) (set! (-> s0-1 timeout) (seconds 4)) (set! (-> s0-1 pos quad) (-> s4-0 quad)) (vector-! (-> s0-1 vel) s5-0 s4-0) (vector-normalize! (-> s0-1 vel) 131072.0) - (spawn-projectile guard-lazer-shot s0-1 obj *default-dead-pool*) + (spawn-projectile guard-lazer-shot s0-1 this *default-dead-pool*) ) ) ) - (spread-lightning-lazer (-> obj l-control) s5-0 s2-1 (-> s3-0 best-other-tri normal)) + (spread-lightning-lazer (-> this l-control) s5-0 s2-1 (-> s3-0 best-other-tri normal)) ) (else (let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s3-1 (let ((t9-26 (method-of-type part-tracker activate))) - (t9-26 (the-as part-tracker s3-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-26 (the-as part-tracker s3-1) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-27 run-function-in-process) (a0-59 s3-1) @@ -3114,7 +3118,7 @@ (let ((s3-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s3-2 (let ((t9-29 (method-of-type part-tracker activate))) - (t9-29 (the-as part-tracker s3-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-29 (the-as part-tracker s3-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-30 run-function-in-process) (a0-62 s3-2) @@ -3141,12 +3145,12 @@ (-> s3-2 ppointer) ) ) - (set! (-> obj l-control state points-to-draw) 9) - (set! (-> obj l-control spec) (-> *lightning-spec-id-table* 14)) + (set! (-> this l-control state points-to-draw) 9) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 14)) (let ((v1-77 s4-0)) - (set! (-> obj l-control state meet data 0 quad) (-> v1-77 quad)) + (set! (-> this l-control state meet data 0 quad) (-> v1-77 quad)) ) - (let ((a0-68 (-> obj l-control)) + (let ((a0-68 (-> this l-control)) (v1-79 s5-0) ) (set! (-> a0-68 state meet data (+ (-> a0-68 state points-to-draw) -1) quad) (-> v1-79 quad)) @@ -3177,7 +3181,7 @@ ) 0 (set! (-> self miss-amount) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self lazer-sound) (new 'static 'sound-id)) 0 ) @@ -3216,7 +3220,7 @@ ) :trans (behavior () (crimson-guard-method-220 self) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (or (< 32768.0 (-> self target-self-xz-dist)) (not (logtest? (-> self flags) (citizen-flag target-in-sight)))) ) (go-hostile self) @@ -3360,7 +3364,7 @@ (f30-1 1.0) ) (ja-no-eval :group! (-> self draw art-group data 22) :num! (loop! f30-1) :frame-num 0.0) - (until (>= (- (current-time) s5-1) s4-1) + (until (time-elapsed? s5-1 s4-1) (crimson-guard-method-222 self) (suspend) (ja :num! (loop! f30-1)) @@ -3413,8 +3417,8 @@ ;; definition for method 223 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-223 crimson-guard ((obj crimson-guard) (arg0 float)) - (let* ((s3-0 (handle->process (-> obj transport))) +(defmethod crimson-guard-method-223 crimson-guard ((this crimson-guard) (arg0 float)) + (let* ((s3-0 (handle->process (-> this transport))) (s4-0 (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) ) @@ -3424,7 +3428,7 @@ (let ((s2-0 (matrix<-transformq! (new 'stack-no-clear 'matrix) (the-as transformq (-> s4-0 root trans)))) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 x) (if (zero? (-> obj transport-side)) + (set! (-> s3-1 x) (if (zero? (-> this transport-side)) -8192.0 8192.0 ) @@ -3432,13 +3436,13 @@ (set! (-> s3-1 y) 12288.0) (set! (-> s3-1 z) (lerp-scale -16384.0 -49152.0 arg0 0.0 1.0)) (set! (-> s3-1 w) 1.0) - (quaternion-rotate-local-y! (-> obj root quat) (-> s4-0 root quat) 32768.0) - (vector-matrix*! (-> obj root trans) s3-1 s2-0) + (quaternion-rotate-local-y! (-> this root quat) (-> s4-0 root quat) 32768.0) + (vector-matrix*! (-> this root trans) s3-1 s2-0) ) ) ) (let ((f0-5 (fmax 0.0 (fmin 1.0 (* 3.3333333 arg0))))) - (set-vector! (-> obj draw color-mult) f0-5 f0-5 f0-5 1.0) + (set-vector! (-> this draw color-mult) f0-5 f0-5 f0-5 1.0) ) 0 (none) @@ -3449,7 +3453,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod crimson-guard-method-224 crimson-guard ((obj crimson-guard) (arg0 vector)) +(defmethod crimson-guard-method-224 crimson-guard ((this crimson-guard) (arg0 vector)) (local-vars (f0-8 float) (sv-768 vector) @@ -3466,7 +3470,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (f30-0 0.0) ) (dotimes (s3-0 2) @@ -3478,7 +3482,7 @@ ) (vector-rotate-around-y! sv-768 s4-0 (* 182.04445 (the float (+ (* 23 s2-0) -70)))) (let ((v1-10 s1-0)) - (let ((a0-6 (-> obj root trans))) + (let ((a0-6 (-> this root trans))) (let ((a1-5 sv-768)) (let ((a2-2 1.0)) (.mov vf7 a2-2) @@ -3492,10 +3496,10 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-10 quad) vf6) ) - (if (enemy-above-ground? obj s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) ) - (let ((v1-14 (-> obj nav)) + (let ((v1-14 (-> this nav)) (a0-8 s1-0) (a1-7 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -3522,12 +3526,12 @@ (let ((a1-8 (new 'stack-no-clear 'vector))) (set! (-> a1-8 quad) (-> s1-0 quad)) (set! (-> a1-8 w) 8192.0) - (when (not (add-root-sphere-to-hash! (-> obj nav) a1-8 32)) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-8 32)) (when (< f30-0 f28-0) (set! f30-0 f28-0) (set! sv-784 (new 'stack-no-clear 'vector)) (let ((a3-3 (new 'stack-no-clear 'vector))) - (set! sv-800 (-> obj nav)) + (set! sv-800 (-> this nav)) (set! sv-832 sv-784) (let* ((v1-29 s1-0) (a0-18 (-> sv-800 state mesh)) @@ -3549,7 +3553,7 @@ ) 0 (set! (-> s1-0 y) (-> sv-784 y)) - (if (enemy-above-ground? obj s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) ) (set! (-> arg0 quad) (-> s1-0 quad)) @@ -3569,82 +3573,82 @@ ;; definition for method 93 of type crimson-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 crimson-guard ((obj crimson-guard)) - (let ((s5-0 (-> obj nav state)) - (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) +(defmethod enemy-method-93 crimson-guard ((this crimson-guard)) + (let ((s5-0 (-> this nav state)) + (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (set! (-> s5-0 heading quad) (-> v1-2 quad)) ) 0 - (let ((s5-1 (-> obj nav state)) - (v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s5-1 (-> this nav state)) + (v1-7 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (logior! (-> s5-1 flags) (nav-state-flag directional-mode)) (set! (-> s5-1 travel quad) (-> v1-7 quad)) ) 0 - (let ((s5-2 (-> obj nav state)) - (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s5-2 (-> this nav state)) + (v1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (set! (-> s5-2 velocity quad) (-> v1-12 quad)) ) 0 - (crimson-guard-method-220 obj) - (set! (-> obj move-position quad) (-> obj target-pos quad)) - (go (method-of-object obj hostile)) + (crimson-guard-method-220 this) + (set! (-> this move-position quad) (-> this target-pos quad)) + (go (method-of-object this hostile)) (none) ) ;; definition for method 89 of type crimson-guard -(defmethod enemy-method-89 crimson-guard ((obj crimson-guard) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) #f ) ;; definition for method 87 of type crimson-guard -(defmethod enemy-method-87 crimson-guard ((obj crimson-guard) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-87 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((s4-0 (-> obj skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 38))) + (let ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) (set! (-> s4-0 param 0) (ja-aframe 3.0 0)) (set! (-> s4-0 param 1) (-> arg0 anim-speed)) (set! (-> s4-0 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> obj draw art-group data 38)) num-func-seek!) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) ) #t ) ;; definition for method 88 of type crimson-guard -(defmethod enemy-method-88 crimson-guard ((obj crimson-guard) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-88 crimson-guard ((this crimson-guard) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.01)) - (let ((s4-0 (-> obj skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 38))) + (let ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) (set! (-> s4-0 param 0) (ja-aframe 9.0 0)) (set! (-> s4-0 param 1) (-> arg0 anim-speed)) (set! (-> s4-0 frame-num) (ja-aframe 4.0 0)) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> obj draw art-group data 38)) num-func-seek!) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) ) #t ) ;; definition for method 90 of type crimson-guard -(defmethod enemy-method-90 crimson-guard ((obj crimson-guard) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 crimson-guard ((this crimson-guard) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (not (enemy-method-89 obj arg1)) + (not (enemy-method-89 this arg1)) ) ((= v1-0 1) (set! s5-0 (ja-done? 0)) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) (set! (-> s4-1 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) @@ -3653,12 +3657,12 @@ s5-0 ) ((= v1-0 2) - (enemy-method-87 obj arg1) + (enemy-method-87 this arg1) #f ) ((= v1-0 3) (set! s5-0 (ja-done? 0)) - (let ((s4-2 (-> obj skel root-channel 0))) + (let ((s4-2 (-> this skel root-channel 0))) (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) (set! (-> s4-2 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) @@ -3667,11 +3671,11 @@ s5-0 ) ((= v1-0 4) - (not (enemy-method-88 obj arg1)) + (not (enemy-method-88 this arg1)) ) ((= v1-0 5) (set! s5-0 (ja-done? 0)) - (let ((s4-3 (-> obj skel root-channel 0))) + (let ((s4-3 (-> this skel root-channel 0))) (set! (-> s4-3 param 0) (ja-aframe 9.0 0)) (set! (-> s4-3 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim #f) num-func-seek!) @@ -3691,7 +3695,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) (logclear! (-> self flags) (citizen-flag hostile)) (nav-enemy-method-166 self) @@ -3766,14 +3770,14 @@ (while (not (-> self already-shot)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (ja-channel-set! 1) (let ((gp-0 (current-time)) (s5-0 150) (f30-0 2.0) ) (ja-no-eval :group! (-> self draw art-group data 6) :num! (loop! f30-0) :frame-num 0.0) - (until (>= (- (current-time) gp-0) s5-0) + (until (time-elapsed? gp-0 s5-0) (crimson-guard-method-223 self (* 0.006666667 (the float (- (current-time) (-> self state-time))))) (suspend) (ja :num! (loop! f30-0)) @@ -3793,9 +3797,9 @@ ;; definition for method 114 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! crimson-guard ((obj crimson-guard)) +(defmethod init-enemy-collision! crimson-guard ((this crimson-guard)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -3859,7 +3863,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -3867,78 +3871,78 @@ ;; definition for method 7 of type crimson-guard ;; WARN: Return type mismatch process-drawable vs crimson-guard. -(defmethod relocate crimson-guard ((obj crimson-guard) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(defmethod relocate crimson-guard ((this crimson-guard) (arg0 int)) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) arg0) ) - (if (nonzero? (-> obj l-control)) - (&+! (-> obj l-control) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method crimson-guard 7)) this arg0) ) ) ;; definition for method 115 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! crimson-guard ((obj crimson-guard)) +(defmethod init-enemy! crimson-guard ((this crimson-guard)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) obj 4)) - (set! (-> obj info) *crimson-guard-global-info*) - (init-enemy-behaviour-and-stats! obj *crimson-guard-nav-enemy-info*) - (let ((v1-7 (-> obj nav))) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 4)) + (set! (-> this info) *crimson-guard-global-info*) + (init-enemy-behaviour-and-stats! this *crimson-guard-nav-enemy-info*) + (let ((v1-7 (-> this nav))) (set! (-> v1-7 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 143360.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (set! (-> obj anim-shuffle) 5) - (set! (-> obj anim-walk) 5) - (set! (-> obj speed-walk) 12288.0) - (set! (-> obj dist-walk-anim) 12288.0) - (set! (-> obj dist-run-anim) 34078.72) - (set! (-> obj anim-run) 6) - (set! (-> obj speed-run) 49152.0) - (set! (-> obj anim-get-up-front) 33) - (set! (-> obj anim-get-up-back) 34) - (set! (-> obj l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 13) obj 0.0)) - (set! (-> obj l-control state points-to-draw) 0) - (set! (-> obj water-anim) -1) - (set! (-> obj minimap) #f) + (set! (-> this draw lod-set lod 0 dist) 143360.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this anim-shuffle) 5) + (set! (-> this anim-walk) 5) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 12288.0) + (set! (-> this dist-run-anim) 34078.72) + (set! (-> this anim-run) 6) + (set! (-> this speed-run) 49152.0) + (set! (-> this anim-get-up-front) 33) + (set! (-> this anim-get-up-back) 34) + (set! (-> this l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 13) this 0.0)) + (set! (-> this l-control state points-to-draw) 0) + (set! (-> this water-anim) -1) + (set! (-> this minimap) #f) 0 (none) ) ;; definition for method 225 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-method-225 crimson-guard ((obj crimson-guard) (arg0 uint) (arg1 symbol)) - (set! (-> obj guard-type) arg0) - (set! (-> obj settings) - (get-traffic-guard-type-settings (-> obj controller traffic) (the-as int (-> obj guard-type))) +(defmethod crimson-guard-method-225 crimson-guard ((this crimson-guard) (arg0 uint) (arg1 symbol)) + (set! (-> this guard-type) arg0) + (set! (-> this settings) + (get-traffic-guard-type-settings (-> this controller traffic) (the-as int (-> this guard-type))) ) - (setup-masks (-> obj draw) 0 30) + (setup-masks (-> this draw) 0 30) (cond - ((zero? (-> obj guard-type)) - (setup-masks (-> obj draw) 16 0) - (set! (-> obj root nav-radius) 8192.0) + ((zero? (-> this guard-type)) + (setup-masks (-> this draw) 16 0) + (set! (-> this root nav-radius) 8192.0) ) (else - (setup-masks (-> obj draw) 8 0) - (set! (-> obj root nav-radius) 6144.0) + (setup-masks (-> this draw) 8 0) + (set! (-> this root nav-radius) 6144.0) ) ) (cond - ((and (not arg1) (logtest? (-> obj flags) (citizen-flag dark-guard))) - (setup-masks (-> obj draw) 5 0) - (set-vector! (-> obj root scale) 1.1 1.1 1.1 1.0) - (set-vector! (-> obj joint scale) 1.1 1.0 1.1 1.0) - (let* ((a0-16 (-> obj neck)) + ((and (not arg1) (logtest? (-> this flags) (citizen-flag dark-guard))) + (setup-masks (-> this draw) 5 0) + (set-vector! (-> this root scale) 1.1 1.1 1.1 1.0) + (set-vector! (-> this joint scale) 1.1 1.0 1.1 1.0) + (let* ((a0-16 (-> this neck)) (t9-5 (method-of-object a0-16 trs-set!)) (a1-6 #f) (a2-5 #f) @@ -3950,15 +3954,15 @@ (set! (-> a3-0 w) 1.0) (t9-5 a0-16 (the-as vector a1-6) (the-as quaternion a2-5) a3-0) ) - (mode-set! (-> obj neck) (joint-mod-mode rotate2)) - (set! (-> obj joint parented-scale?) #t) - (set! (-> obj neck parented-scale?) #t) + (mode-set! (-> this neck) (joint-mod-mode rotate2)) + (set! (-> this joint parented-scale?) #t) + (set! (-> this neck parented-scale?) #t) ) (else - (setup-masks (-> obj draw) 3 0) - (set-vector! (-> obj root scale) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj joint scale) 1.0 1.0 1.0 1.0) - (let* ((a0-29 (-> obj neck)) + (setup-masks (-> this draw) 3 0) + (set-vector! (-> this root scale) 1.0 1.0 1.0 1.0) + (set-vector! (-> this joint scale) 1.0 1.0 1.0 1.0) + (let* ((a0-29 (-> this neck)) (t9-8 (method-of-object a0-29 trs-set!)) (a1-9 #f) (a2-7 #f) @@ -3970,7 +3974,7 @@ (set! (-> a3-1 w) 1.0) (t9-8 a0-29 (the-as vector a1-9) (the-as quaternion a2-7) a3-1) ) - (mode-set! (-> obj neck) (joint-mod-mode reset)) + (mode-set! (-> this neck) (joint-mod-mode reset)) ) ) 0 @@ -3979,65 +3983,65 @@ ;; definition for method 181 of type crimson-guard ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! crimson-guard ((obj crimson-guard)) +(defmethod citizen-init! crimson-guard ((this crimson-guard)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (if (logtest? (-> obj flags) (citizen-flag dark-guard)) - (set! (-> obj hit-points) (the int (* 2.0 (the float (-> obj enemy-info default-hit-points))))) + (if (logtest? (-> this flags) (citizen-flag dark-guard)) + (set! (-> this hit-points) (the int (* 2.0 (the float (-> this enemy-info default-hit-points))))) ) - (set! (-> obj hit-face) (the-as uint -1)) - (crimson-guard-method-225 obj (get-guard-type-for-traffic-obj (-> obj controller traffic) 6) #f) - (let ((v1-12 (-> obj nav))) + (set! (-> this hit-face) (the-as uint -1)) + (crimson-guard-method-225 this (get-guard-type-for-traffic-obj (-> this controller traffic) 6) #f) + (let ((v1-12 (-> this nav))) (set! (-> v1-12 sphere-mask) (the-as uint #x800de)) ) 0 - (set! (-> obj joint-enable) #f) - (logclear! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask guard)) - (set! (-> obj fact pickup-type) (pickup-type ammo-random)) - (set! (-> obj fact pickup-amount) 10.0) - (set! (-> obj fact pickup-spawn-amount) 1.0) - (set! (-> obj traffic-target-status handle) (the-as handle #f)) - (let ((v1-24 (get-rand-int obj 2))) + (set! (-> this joint-enable) #f) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask guard)) + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + (set! (-> this fact pickup-amount) 10.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this traffic-target-status handle) (the-as handle #f)) + (let ((v1-24 (get-rand-int this 2))) (cond ((zero? v1-24) - (set! (-> obj anim-shoot 0 anim-index) 19) - (set! (-> obj anim-shoot 0 start) 1.0) - (set! (-> obj anim-shoot 0 end) 12.0) - (set! (-> obj anim-shoot 1 anim-index) 26) - (set! (-> obj anim-shoot 1 start) 12.0) - (set! (-> obj anim-shoot 1 end) 22.0) - (set! (-> obj anim-shoot 2 anim-index) 24) - (set! (-> obj anim-shoot 2 start) 20.0) - (set! (-> obj anim-shoot 2 end) 30.0) + (set! (-> this anim-shoot 0 anim-index) 19) + (set! (-> this anim-shoot 0 start) 1.0) + (set! (-> this anim-shoot 0 end) 12.0) + (set! (-> this anim-shoot 1 anim-index) 26) + (set! (-> this anim-shoot 1 start) 12.0) + (set! (-> this anim-shoot 1 end) 22.0) + (set! (-> this anim-shoot 2 anim-index) 24) + (set! (-> this anim-shoot 2 start) 20.0) + (set! (-> this anim-shoot 2 end) 30.0) ) ((= v1-24 1) - (set! (-> obj anim-shoot 0 anim-index) 27) - (set! (-> obj anim-shoot 0 start) 2.0) - (set! (-> obj anim-shoot 0 end) 9.0) - (set! (-> obj anim-shoot 1 anim-index) 29) - (set! (-> obj anim-shoot 1 start) 18.0) - (set! (-> obj anim-shoot 1 end) 26.0) - (set! (-> obj anim-shoot 2 anim-index) 30) - (set! (-> obj anim-shoot 2 start) 26.0) - (set! (-> obj anim-shoot 2 end) 35.0) + (set! (-> this anim-shoot 0 anim-index) 27) + (set! (-> this anim-shoot 0 start) 2.0) + (set! (-> this anim-shoot 0 end) 9.0) + (set! (-> this anim-shoot 1 anim-index) 29) + (set! (-> this anim-shoot 1 start) 18.0) + (set! (-> this anim-shoot 1 end) 26.0) + (set! (-> this anim-shoot 2 anim-index) 30) + (set! (-> this anim-shoot 2 start) 26.0) + (set! (-> this anim-shoot 2 end) 35.0) ) ) ) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (if (logtest? (-> obj controller traffic alert-state flags) (traffic-alert-flag target-jak)) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (if (logtest? (-> this controller traffic alert-state flags) (traffic-alert-flag target-jak)) (reset-to-collide-spec - (-> obj focus) + (-> this focus) (collide-spec jak enemy hit-by-others-list player-list bot-targetable jak-vehicle) ) - (reset-to-collide-spec (-> obj focus) (collide-spec enemy hit-by-others-list bot-targetable)) + (reset-to-collide-spec (-> this focus) (collide-spec enemy hit-by-others-list bot-targetable)) ) - (if (not (-> obj minimap)) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 32) (the-as int #f) (the-as vector #t) 0)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 32) (the-as int #f) (the-as vector #t) 0)) ) - (set! (-> obj move-index) -1) + (set! (-> this move-index) -1) (ja-channel-set! 0) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc index 22cf4dc34d..39a5b30465 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-flitter_REF.gc @@ -30,26 +30,26 @@ ) ;; definition for method 3 of type metalhead-flitter -(defmethod inspect metalhead-flitter ((obj metalhead-flitter)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalhead-flitter ((this metalhead-flitter)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type citizen-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tmove-angle: ~f~%" (-> obj move-angle)) - (format #t "~2Theading: ~A~%" (-> obj heading)) - (format #t "~2Tchange-dir-time: ~D~%" (-> obj change-dir-time)) - (format #t "~2Tlast-change-dir: ~D~%" (-> obj last-change-dir)) - (format #t "~2Toff-screen-timer: ~D~%" (-> obj off-screen-timer)) - (format #t "~2Tamb-sound-timer: ~D~%" (-> obj amb-sound-timer)) - (format #t "~2Tattack-time: ~D~%" (-> obj attack-time)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Tattack-pos: #~%" (-> obj attack-pos)) - (format #t "~2Tbase-height: ~f~%" (-> obj base-height)) + (format #t "~2Tmove-angle: ~f~%" (-> this move-angle)) + (format #t "~2Theading: ~A~%" (-> this heading)) + (format #t "~2Tchange-dir-time: ~D~%" (-> this change-dir-time)) + (format #t "~2Tlast-change-dir: ~D~%" (-> this last-change-dir)) + (format #t "~2Toff-screen-timer: ~D~%" (-> this off-screen-timer)) + (format #t "~2Tamb-sound-timer: ~D~%" (-> this amb-sound-timer)) + (format #t "~2Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tattack-pos: #~%" (-> this attack-pos)) + (format #t "~2Tbase-height: ~f~%" (-> this base-height)) (label cfg-4) - obj + this ) ;; definition for symbol *metalhead-flitter-nav-enemy-info*, type nav-enemy-info @@ -209,13 +209,13 @@ (set! (-> *metalhead-flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 207 of type metalhead-flitter -(defmethod metalhead-flitter-method-207 metalhead-flitter ((obj metalhead-flitter) (arg0 process-focusable)) - (and (logtest? (-> obj draw status) (draw-control-status on-screen)) +(defmethod metalhead-flitter-method-207 metalhead-flitter ((this metalhead-flitter) (arg0 process-focusable)) + (and (logtest? (-> this draw status) (draw-control-status on-screen)) (let ((s4-0 (camera-matrix))) (camera-pos) (let* ((s3-0 (get-trans arg0 0)) (s5-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 vector 2) 1.0)) - (v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) s3-0) 1.0)) + (v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s3-0) 1.0)) ) (< 0.0 (vector-dot s5-1 v1-7)) ) @@ -224,76 +224,76 @@ ) ;; definition for method 77 of type metalhead-flitter -(defmethod enemy-method-77 metalhead-flitter ((obj metalhead-flitter) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 metalhead-flitter ((this metalhead-flitter) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) #t ) (((knocked-type knocked-type-6)) - (let ((v1-17 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-17 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-17 (= v1-17 (-> obj draw art-group data 21))) + (if (and v1-17 (= v1-17 (-> this draw art-group data 21))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) 1.0) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) #t ) (else - ((method-of-type nav-enemy enemy-method-77) obj arg0) + ((method-of-type nav-enemy enemy-method-77) this arg0) ) ) ) ;; definition for method 78 of type metalhead-flitter -(defmethod enemy-method-78 metalhead-flitter ((obj metalhead-flitter) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 metalhead-flitter ((this metalhead-flitter) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((v1-4 (-> obj skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> v1-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> v1-4 param 1) 1.0) (set! (-> v1-4 frame-num) 0.0) - (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) ) (else - ((method-of-type citizen-enemy enemy-method-78) obj arg0) + ((method-of-type citizen-enemy enemy-method-78) this arg0) ) ) ) ;; definition for method 68 of type metalhead-flitter -(defmethod go-stare2 metalhead-flitter ((obj metalhead-flitter)) - (if (and (= (-> obj focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 obj))) - (go (method-of-object obj pacing)) - (go (method-of-object obj stare)) +(defmethod go-stare2 metalhead-flitter ((this metalhead-flitter)) + (if (and (= (-> this focus aware) (enemy-aware enemy-aware-2)) (not (nav-enemy-method-163 this))) + (go (method-of-object this pacing)) + (go (method-of-object this stare)) ) ) @@ -409,14 +409,14 @@ ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.6)) + (until (time-elapsed? gp-2 (seconds 0.6)) (suspend) ) ) (+! (-> self root trans y) -8192.0) (logior! (-> self draw status) (draw-control-status no-draw)) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) + (until (time-elapsed? gp-3 (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) (suspend) ) ) @@ -443,7 +443,7 @@ ) 0 (look-at-target! self (enemy-flag lock-focus)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self root))) (vector-reset! (-> gp-0 transv)) (set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 34.0 38.0))) @@ -541,15 +541,15 @@ ) ;; definition for method 99 of type metalhead-flitter -(defmethod enemy-method-99 metalhead-flitter ((obj metalhead-flitter) (arg0 process-focusable)) +(defmethod enemy-method-99 metalhead-flitter ((this metalhead-flitter) (arg0 process-focusable)) (focus-test? arg0 mech) ) ;; definition for method 205 of type metalhead-flitter ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-flitter-method-205 metalhead-flitter ((obj metalhead-flitter)) - (let* ((s5-0 (handle->process (-> obj focus handle))) +(defmethod metalhead-flitter-method-205 metalhead-flitter ((this metalhead-flitter)) + (let* ((s5-0 (handle->process (-> this focus handle))) (s3-0 (if (type? s5-0 process-focusable) s5-0 ) @@ -557,55 +557,55 @@ ) (when s3-0 (let* ((s5-1 (get-trans (the-as process-focusable s3-0) 0)) - (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> obj root trans))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this root trans))) (f30-0 (vector-length s4-1)) ) (cond - ((enemy-method-99 obj (the-as process-focusable s3-0)) - (go-flee obj) + ((enemy-method-99 this (the-as process-focusable s3-0)) + (go-flee this) ) - ((and (< f30-0 32768.0) (not (metalhead-flitter-method-207 obj (the-as process-focusable s3-0)))) - (go (method-of-object obj circling)) + ((and (< f30-0 32768.0) (not (metalhead-flitter-method-207 this (the-as process-focusable s3-0)))) + (go (method-of-object this circling)) ) - ((< f30-0 (-> obj enemy-info notice-nav-radius)) - (set! (-> obj target-pos quad) (-> s5-1 quad)) + ((< f30-0 (-> this enemy-info notice-nav-radius)) + (set! (-> this target-pos quad) (-> s5-1 quad)) (let ((s3-1 (new 'stack-no-clear 'vector))) (set! (-> s3-1 quad) (-> s4-1 quad)) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> obj root transv quad)) + (set! (-> s5-2 quad) (-> this root transv quad)) (vector-normalize! s5-2 f30-0) (if (>= (vector-dot s3-1 s5-2) 0.98) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) ) ) ) ((< f30-0 32768.0) - (set! (-> obj target-pos quad) (-> s5-1 quad)) + (set! (-> this target-pos quad) (-> s5-1 quad)) ) - ((or (>= (- (current-time) (the-as int (-> obj last-change-dir))) (-> obj change-dir-time)) - (< (vector-vector-distance-squared (-> obj root trans) (-> obj target-pos)) 0.1) + ((or (time-elapsed? (the-as int (-> this last-change-dir)) (-> this change-dir-time)) + (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1) ) - (set! (-> obj last-change-dir) (the-as uint (current-time))) - (set! (-> obj change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) + (set! (-> this last-change-dir) (the-as uint (current-time))) + (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> obj move-angle)))) + (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) - (if (-> obj heading) + (if (-> this heading) (set-vector! s3-2 (-> s4-1 z) (-> s4-1 y) (- (-> s4-1 x)) 1.0) (set-vector! s3-2 (- (-> s4-1 z)) (-> s4-1 y) (-> s4-1 x) 1.0) ) - (set! (-> obj heading) (not (-> obj heading))) + (set! (-> this heading) (not (-> this heading))) (let ((f28-1 (rand-vu-float-range (* 0.75 f0-9) f0-9)) (s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 (* -0.6 f30-0))) ) (vector-normalize! s3-2 f28-1) (vector+! s3-2 s3-2 s4-2) ) - (clamp-vector-to-mesh-cross-gaps (-> obj nav state) s3-2) + (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) (vector+! s2-0 s5-1 s3-2) - (set! (-> obj target-pos quad) (-> s2-0 quad)) + (set! (-> this target-pos quad) (-> s2-0 quad)) ) ) ) @@ -619,12 +619,10 @@ ;; definition for method 206 of type metalhead-flitter ;; WARN: Return type mismatch time-frame vs none. -(defmethod metalhead-flitter-method-206 metalhead-flitter ((obj metalhead-flitter)) - (when (>= (- (current-time) (the-as int (-> obj amb-sound-timer))) - (the int (* 300.0 (rand-vu-float-range 1.5 3.0))) - ) - (sound-play "flitter-amb" :position (-> obj root trans)) - (set! (-> obj amb-sound-timer) (the-as uint (current-time))) +(defmethod metalhead-flitter-method-206 metalhead-flitter ((this metalhead-flitter)) + (when (time-elapsed? (the-as int (-> this amb-sound-timer)) (the int (* 300.0 (rand-vu-float-range 1.5 3.0)))) + (sound-play "flitter-amb" :position (-> this root trans)) + (set! (-> this amb-sound-timer) (the-as uint (current-time))) ) (none) ) @@ -643,7 +641,7 @@ ) (set! (-> self root transv y) 33775.48) (ja :num-func num-func-identity :frame-num 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) (until v1-29 (let ((f0-2 102400.0)) @@ -652,7 +650,7 @@ ) (suspend) (ja :num! (seek! max arg1)) - (set! v1-29 (or (ja-done? 0) (>= (- (current-time) (-> self state-time)) arg2))) + (set! v1-29 (or (ja-done? 0) (time-elapsed? (-> self state-time) arg2))) ) ) ) @@ -788,8 +786,8 @@ ) ;; definition for method 209 of type metalhead-flitter -(defmethod metalhead-flitter-method-209 metalhead-flitter ((obj metalhead-flitter)) - (lerp-scale 0.0 1.0 (- (-> obj attack-pos y) (-> obj root trans y)) 13926.4 25600.0) +(defmethod metalhead-flitter-method-209 metalhead-flitter ((this metalhead-flitter)) + (lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0) ) ;; failed to figure out what this is: @@ -797,7 +795,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -834,7 +832,7 @@ (set! s5-2 (cond ((and gp-0 - (< (- (current-time) (-> self state-time)) (seconds 1.5)) + (not (time-elapsed? (-> self state-time) (seconds 1.5))) gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) @@ -984,7 +982,7 @@ (if gp-0 (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-11 (-> self focus aware))) (cond ((= v1-11 (enemy-aware enemy-aware-3)) @@ -1001,7 +999,7 @@ ) ) ) - (if (and (get-enemy-target self) (>= (- (current-time) (the-as int (-> self off-screen-timer))) (seconds 0.3))) + (if (and (get-enemy-target self) (time-elapsed? (the-as int (-> self off-screen-timer)) (seconds 0.3))) (go-hostile self) ) ) @@ -1043,8 +1041,8 @@ ;; definition for method 208 of type metalhead-flitter ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-flitter-method-208 metalhead-flitter ((obj metalhead-flitter) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod metalhead-flitter-method-208 metalhead-flitter ((this metalhead-flitter) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) (if arg0 @@ -1060,9 +1058,9 @@ ;; definition for method 114 of type metalhead-flitter ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! metalhead-flitter ((obj metalhead-flitter)) +(defmethod init-enemy-collision! metalhead-flitter ((this metalhead-flitter)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1107,7 +1105,7 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 8)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1115,55 +1113,55 @@ ;; definition for method 115 of type metalhead-flitter ;; WARN: Return type mismatch symbol vs none. -(defmethod init-enemy! metalhead-flitter ((obj metalhead-flitter)) +(defmethod init-enemy! metalhead-flitter ((this metalhead-flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flitter" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *metalhead-flitter-nav-enemy-info*) - (set! (-> obj move-angle) 10922.667) - (set! (-> obj heading) (if (= (rand-vu-int-range 0 1) 1) - #t - #f - ) + (init-enemy-behaviour-and-stats! this *metalhead-flitter-nav-enemy-info*) + (set! (-> this move-angle) 10922.667) + (set! (-> this heading) (if (= (rand-vu-int-range 0 1) 1) + #t + #f + ) ) - (set! (-> obj change-dir-time) 0) - (set! (-> obj off-screen-timer) (the-as uint 0)) - (set! (-> obj amb-sound-timer) (the-as uint 0)) + (set! (-> this change-dir-time) 0) + (set! (-> this off-screen-timer) (the-as uint 0)) + (set! (-> this amb-sound-timer) (the-as uint 0)) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x 942.08 :y -860.16 :z 1269.76 :w 163840.0) ) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x -942.08 :y -860.16 :z 1269.76 :w 163840.0) ) - (set-gravity-length (-> obj root dynam) 491520.0) - (set! (-> obj minimap) #f) + (set-gravity-length (-> this root dynam) 491520.0) + (set! (-> this minimap) #f) (none) ) ;; definition for method 181 of type metalhead-flitter ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! metalhead-flitter ((obj metalhead-flitter)) +(defmethod citizen-init! metalhead-flitter ((this metalhead-flitter)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen-enemy citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj speed-walk) (-> obj enemy-info walk-travel-speed)) - (set! (-> obj dist-walk-anim) (-> obj enemy-info walk-travel-speed)) - (set! (-> obj dist-run-anim) (-> obj enemy-info run-travel-speed)) - (set! (-> obj speed-run) (-> obj enemy-info walk-travel-speed)) + (set! (-> this speed-walk) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-walk-anim) (-> this enemy-info walk-travel-speed)) + (set! (-> this dist-run-anim) (-> this enemy-info run-travel-speed)) + (set! (-> this speed-run) (-> this enemy-info walk-travel-speed)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc index 537ddf88af..6213e78988 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/citizen/metalhead-grunt_REF.gc @@ -251,106 +251,106 @@ ) ;; definition for method 3 of type metalhead-grunt -(defmethod inspect metalhead-grunt ((obj metalhead-grunt)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalhead-grunt ((this metalhead-grunt)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type citizen-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpatrol-anim: #~%" (-> obj patrol-anim)) - (format #t "~2Tcharge-anim: #~%" (-> obj charge-anim)) - (format #t "~2Tattack-anim: #~%" (-> obj attack-anim)) - (format #t "~2Tknocked-anim: #~%" (-> obj knocked-anim)) - (format #t "~2Tyellow-hit-anim: #~%" (-> obj yellow-hit-anim)) - (format #t "~2Tblue-hit-anim: #~%" (-> obj blue-hit-anim)) - (format #t "~2Tintro-path: ~A~%" (-> obj intro-path)) - (format #t "~2Tcircle-radial-dist: ~f~%" (-> obj desired-angle)) - (format #t "~2Tuse-charge-anim-index: ~D~%" (-> obj use-charge-anim-index)) - (format #t "~2Tknocked-anim-index: ~D~%" (-> obj knocked-anim-index)) - (format #t "~2Tjumping-ambush-path-pt: ~D~%" (-> obj jumping-ambush-path-pt)) - (format #t "~2Tgrunt-flags: ~D~%" (-> obj grunt-flags)) - (format #t "~2Tstate-timeout2: ~D~%" (-> obj state-timeout2)) - (format #t "~2Tnext-warn-time: ~D~%" (-> obj next-warn-time)) - (format #t "~2Tdest: #~%" (-> obj dest)) - (format #t "~2Tfocus-pos: #~%" (-> obj focus-pos)) + (format #t "~2Tpatrol-anim: #~%" (-> this patrol-anim)) + (format #t "~2Tcharge-anim: #~%" (-> this charge-anim)) + (format #t "~2Tattack-anim: #~%" (-> this attack-anim)) + (format #t "~2Tknocked-anim: #~%" (-> this knocked-anim)) + (format #t "~2Tyellow-hit-anim: #~%" (-> this yellow-hit-anim)) + (format #t "~2Tblue-hit-anim: #~%" (-> this blue-hit-anim)) + (format #t "~2Tintro-path: ~A~%" (-> this intro-path)) + (format #t "~2Tcircle-radial-dist: ~f~%" (-> this desired-angle)) + (format #t "~2Tuse-charge-anim-index: ~D~%" (-> this use-charge-anim-index)) + (format #t "~2Tknocked-anim-index: ~D~%" (-> this knocked-anim-index)) + (format #t "~2Tjumping-ambush-path-pt: ~D~%" (-> this jumping-ambush-path-pt)) + (format #t "~2Tgrunt-flags: ~D~%" (-> this grunt-flags)) + (format #t "~2Tstate-timeout2: ~D~%" (-> this state-timeout2)) + (format #t "~2Tnext-warn-time: ~D~%" (-> this next-warn-time)) + (format #t "~2Tdest: #~%" (-> this dest)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) (label cfg-4) - obj + this ) ;; definition for method 74 of type metalhead-grunt -(defmethod general-event-handler metalhead-grunt ((obj metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler metalhead-grunt ((this metalhead-grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (let ((s5-1 (-> obj incoming knocked-type))) + ((zero? (-> this hit-points)) + (let ((s5-1 (-> this incoming knocked-type))) (cond ((and (= s5-1 (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-33 (-> obj next-state name))) - (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) - ) + (not (and (-> this next-state) (let ((v1-33 (-> this next-state name))) + (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ((or (= s5-1 (knocked-type knocked-type-4)) (= s5-1 (knocked-type knocked-type-6))) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - (go (method-of-object obj knocked)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) + (go (method-of-object this knocked)) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t ) (else - ((method-of-type citizen-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 66 of type metalhead-grunt -(defmethod go-ambush metalhead-grunt ((obj metalhead-grunt)) +(defmethod go-ambush metalhead-grunt ((this metalhead-grunt)) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user10)) - (go (method-of-object obj falling-ambush)) + ((logtest? (-> this fact enemy-options) (enemy-option user10)) + (go (method-of-object this falling-ambush)) ) - ((logtest? (-> obj fact enemy-options) (enemy-option user11)) - (go (method-of-object obj jumping-ambush)) + ((logtest? (-> this fact enemy-options) (enemy-option user11)) + (go (method-of-object this jumping-ambush)) ) (else - (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> obj name)) - (go-hostile obj) + (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> this name)) + (go-hostile this) ) ) ) @@ -408,13 +408,13 @@ ;; definition for method 93 of type metalhead-grunt ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 metalhead-grunt ((obj metalhead-grunt)) - (case (-> obj jump-why) +(defmethod enemy-method-93 metalhead-grunt ((this metalhead-grunt)) + (case (-> this jump-why) ((2) - (go (method-of-object obj jumping-ambush-cont)) + (go (method-of-object this jumping-ambush-cont)) ) (else - ((method-of-type citizen-enemy enemy-method-93) obj) + ((method-of-type citizen-enemy enemy-method-93) this) ) ) (none) @@ -608,7 +608,7 @@ ) ;; definition for method 209 of type metalhead-grunt -(defmethod metalhead-grunt-method-209 metalhead-grunt ((obj metalhead-grunt) (arg0 float)) +(defmethod metalhead-grunt-method-209 metalhead-grunt ((this metalhead-grunt) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -616,12 +616,12 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((gp-0 (get-enemy-target obj))) + (let ((gp-0 (get-enemy-target this))) (when gp-0 (let ((v1-3 (get-trans gp-0 0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector-! s4-0 v1-3 (-> obj root trans)) + (vector-! s4-0 v1-3 (-> this root trans)) (.lvf vf1 (&-> s4-0 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -635,18 +635,18 @@ (f0-2 12288.0) ) (when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0)) - (let ((f26-0 (quaternion-y-angle (-> obj root quat))) + (let ((f26-0 (quaternion-y-angle (-> this root quat))) (f0-7 (atan (-> s4-0 x) (-> s4-0 z))) (f1-0 1228.8) ) (cond ((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7)))) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) ((let ((f0-10 12288.0)) (< f30-0 (* f0-10 f0-10)) ) - (go (method-of-object obj spin-attack)) + (go (method-of-object this spin-attack)) ) ) ) @@ -967,39 +967,39 @@ ) ;; definition for method 77 of type metalhead-grunt -(defmethod enemy-method-77 metalhead-grunt ((obj metalhead-grunt) (arg0 (pointer float))) +(defmethod enemy-method-77 metalhead-grunt ((this metalhead-grunt) (arg0 (pointer float))) (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (let ((v1-2 (ash 1 (-> *grunt-global-info* prev-yellow-hit-anim-index))) - (a0-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (a0-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and a0-7 (or (= a0-7 (-> obj draw art-group data 16)) - (= a0-7 (-> obj draw art-group data 38)) - (= a0-7 (-> obj draw art-group data 39)) - (= a0-7 (-> obj draw art-group data 40)) + (if (and a0-7 (or (= a0-7 (-> this draw art-group data 16)) + (= a0-7 (-> this draw art-group data 38)) + (= a0-7 (-> this draw art-group data 39)) + (= a0-7 (-> this draw art-group data 40)) ) ) (set! a2-3 (logior v1-2 4)) (set! a2-3 (logior v1-2 8)) ) ) - (let ((s4-0 (enemy-method-120 obj 4 a2-3))) + (let ((s4-0 (enemy-method-120 this 4 a2-3))) (set! (-> *grunt-global-info* prev-yellow-hit-anim-index) s4-0) - (set! (-> obj yellow-hit-anim) (-> *grunt-global-info* yellow-hit-anim s4-0)) - (let ((v1-11 (get-rand-int obj 3))) + (set! (-> this yellow-hit-anim) (-> *grunt-global-info* yellow-hit-anim s4-0)) + (let ((v1-11 (get-rand-int this 3))) (if (= s4-0 3) (set! v1-11 2) ) - (set! (-> obj use-charge-anim-index) v1-11) + (set! (-> this use-charge-anim-index) v1-11) ) ) - (let ((s4-1 (-> obj draw art-group data (-> obj yellow-hit-anim anim-index)))) + (let ((s4-1 (-> this draw art-group data (-> this yellow-hit-anim anim-index)))) (ja-channel-push! 1 0) - (let ((a0-19 (-> obj skel root-channel 0))) + (let ((a0-19 (-> this skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-19 param 1) (-> arg0 0)) @@ -1010,33 +1010,33 @@ #t ) (((knocked-type knocked-type-6)) - (let* ((v1-24 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let* ((v1-24 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) - (s4-2 (and v1-24 (or (= v1-24 (-> obj draw art-group data 16)) - (= v1-24 (-> obj draw art-group data 38)) - (= v1-24 (-> obj draw art-group data 39)) - (= v1-24 (-> obj draw art-group data 40)) + (s4-2 (and v1-24 (or (= v1-24 (-> this draw art-group data 16)) + (= v1-24 (-> this draw art-group data 38)) + (= v1-24 (-> this draw art-group data 39)) + (= v1-24 (-> this draw art-group data 40)) ) ) ) ) - (if (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (logior! (-> obj grunt-flags) 2) + (if (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (logior! (-> this grunt-flags) 2) ) (cond - ((and (not s4-2) (logtest? (-> obj grunt-flags) 2)) + ((and (not s4-2) (logtest? (-> this grunt-flags) 2)) (set! s4-2 #t) (ja-channel-push! 1 (seconds 0.17)) ) (else - (let ((v1-36 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-36 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-36 (= v1-36 (-> obj draw art-group data 44))) + (if (and v1-36 (= v1-36 (-> this draw art-group data 44))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) @@ -1049,22 +1049,22 @@ (set! a2-5 (logior v1-42 7)) ) ) - (let ((v1-46 (enemy-method-120 obj 6 a2-5))) + (let ((v1-46 (enemy-method-120 this 6 a2-5))) (set! (-> *grunt-global-info* prev-blue-hit-anim-index) v1-46) - (set! (-> obj blue-hit-anim) (-> *grunt-global-info* blue-hit-anim v1-46)) + (set! (-> this blue-hit-anim) (-> *grunt-global-info* blue-hit-anim v1-46)) ) (let ((a2-6 0)) - (when (not (logtest? (-> obj grunt-flags) 2)) + (when (not (logtest? (-> this grunt-flags) 2)) (if s4-2 (set! a2-6 (logior a2-6 3)) (set! a2-6 (logior a2-6 4)) ) ) - (set! (-> obj use-charge-anim-index) (enemy-method-120 obj 3 a2-6)) + (set! (-> this use-charge-anim-index) (enemy-method-120 this 3 a2-6)) ) ) - (let ((a1-26 (-> obj draw art-group data (-> obj blue-hit-anim anim-index))) - (a0-51 (-> obj skel root-channel 0)) + (let ((a1-26 (-> this draw art-group data (-> this blue-hit-anim anim-index))) + (a0-51 (-> this skel root-channel 0)) ) (set! (-> a0-51 frame-group) (the-as art-joint-anim a1-26)) (set! (-> a0-51 param 0) (the float (+ (-> (the-as art-joint-anim a1-26) frames num-frames) -1))) @@ -1077,28 +1077,28 @@ (else 0 (cond - ((or (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (= (-> obj incoming knocked-type) (knocked-type knocked-type-3)) + ((or (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (= (-> this incoming knocked-type) (knocked-type knocked-type-3)) ) (set! v1-72 3) ) (else (let ((s4-3 (ash 1 (-> *grunt-global-info* prev-knocked-anim-index)))) - (let ((s3-0 (-> obj root))) + (let ((s3-0 (-> this root))) (if (>= 16384.0 (fabs (deg- (quaternion-y-angle (-> s3-0 quat)) (atan (-> s3-0 transv x) (-> s3-0 transv z))))) (set! s4-3 (logior s4-3 4)) ) ) - (set! v1-72 (enemy-method-120 obj 3 s4-3)) + (set! v1-72 (enemy-method-120 this 3 s4-3)) ) ) ) (set! (-> *grunt-global-info* prev-knocked-anim-index) v1-72) - (set! (-> obj knocked-anim-index) v1-72) - (set! (-> obj knocked-anim) (-> *grunt-global-info* knocked-anim v1-72)) - (let ((s4-4 (-> obj draw art-group data (-> obj knocked-anim anim-index)))) + (set! (-> this knocked-anim-index) v1-72) + (set! (-> this knocked-anim) (-> *grunt-global-info* knocked-anim v1-72)) + (let ((s4-4 (-> this draw art-group data (-> this knocked-anim anim-index)))) (ja-channel-push! 1 0) - (let ((a0-68 (-> obj skel root-channel 0))) + (let ((a0-68 (-> this skel root-channel 0))) (set! (-> a0-68 frame-group) (the-as art-joint-anim s4-4)) (set! (-> a0-68 param 0) (the float (+ (-> (the-as art-joint-anim s4-4) frames num-frames) -1))) (set! (-> a0-68 param 1) (-> arg0 0)) @@ -1112,26 +1112,26 @@ ) ;; definition for method 78 of type metalhead-grunt -(defmethod enemy-method-78 metalhead-grunt ((obj metalhead-grunt) (arg0 (pointer float))) +(defmethod enemy-method-78 metalhead-grunt ((this metalhead-grunt) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (or (logtest? (-> obj grunt-flags) 2) (let ((v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) - ) - ) - (not (and v1-7 (or (= v1-7 (-> obj draw art-group data 16)) - (= v1-7 (-> obj draw art-group data 38)) - (= v1-7 (-> obj draw art-group data 39)) - (= v1-7 (-> obj draw art-group data 40)) - ) - ) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (or (logtest? (-> this grunt-flags) 2) (let ((v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) ) - ) + (not (and v1-7 (or (= v1-7 (-> this draw art-group data 16)) + (= v1-7 (-> this draw art-group data 38)) + (= v1-7 (-> this draw art-group data 39)) + (= v1-7 (-> this draw art-group data 40)) + ) + ) + ) + ) ) - (let ((s4-0 (-> obj draw art-group data 44))) + (let ((s4-0 (-> this draw art-group data 44))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-16 (-> obj skel root-channel 0))) + (let ((a0-16 (-> this skel root-channel 0))) (set! (-> a0-16 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-16 param 1) (-> arg0 0)) @@ -1139,15 +1139,19 @@ (joint-control-channel-group! a0-16 (the-as art-joint-anim s4-0) num-func-seek!) ) ) - (logand! (-> obj grunt-flags) -3) + (logand! (-> this grunt-flags) -3) #t ) ) - ((!= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (let ((a1-6 - (-> obj draw art-group data (-> *grunt-global-info* knocked-land-anim (-> obj knocked-anim-index) anim-index)) - ) - (a0-23 (-> obj skel root-channel 0)) + ((!= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (let ((a1-6 (-> this + draw + art-group + data + (-> *grunt-global-info* knocked-land-anim (-> this knocked-anim-index) anim-index) + ) + ) + (a0-23 (-> this skel root-channel 0)) ) (set! (-> a0-23 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-23 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) @@ -1210,25 +1214,25 @@ ;; definition for method 211 of type metalhead-grunt ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-grunt-method-211 metalhead-grunt ((obj metalhead-grunt)) +(defmethod metalhead-grunt-method-211 metalhead-grunt ((this metalhead-grunt)) 0 (none) ) ;; definition for method 7 of type metalhead-grunt ;; WARN: Return type mismatch citizen-enemy vs metalhead-grunt. -(defmethod relocate metalhead-grunt ((obj metalhead-grunt) (arg0 int)) - (if (nonzero? (-> obj intro-path)) - (&+! (-> obj intro-path) arg0) +(defmethod relocate metalhead-grunt ((this metalhead-grunt) (arg0 int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) arg0) ) - (the-as metalhead-grunt ((method-of-type citizen-enemy relocate) obj arg0)) + (the-as metalhead-grunt ((method-of-type citizen-enemy relocate) this arg0)) ) ;; definition for method 114 of type metalhead-grunt ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! metalhead-grunt ((obj metalhead-grunt)) +(defmethod init-enemy-collision! metalhead-grunt ((this metalhead-grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1315,70 +1319,70 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 8)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 210 of type metalhead-grunt -(defmethod get-nav-info metalhead-grunt ((obj metalhead-grunt)) +(defmethod get-nav-info metalhead-grunt ((this metalhead-grunt)) *metalhead-grunt-nav-enemy-info* ) ;; definition for method 115 of type metalhead-grunt ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! metalhead-grunt ((obj metalhead-grunt)) +(defmethod init-enemy! metalhead-grunt ((this metalhead-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj (get-nav-info obj)) - (let ((v1-6 (-> obj neck))) + (init-enemy-behaviour-and-stats! this (get-nav-info this)) + (let ((v1-6 (-> this neck))) (set! (-> v1-6 up) (the-as uint 1)) (set! (-> v1-6 nose) (the-as uint 2)) (set! (-> v1-6 ear) (the-as uint 0)) (set-vector! (-> v1-6 twist-max) 11832.889 11832.889 0.0 1.0) (set! (-> v1-6 ignore-angle) 30947.555) ) - (let ((v1-8 (-> obj nav))) + (let ((v1-8 (-> this nav))) (set! (-> v1-8 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) + (set-gravity-length (-> this root dynam) 573440.0) (let ((s5-2 *grunt-global-info*)) - (set! (-> obj patrol-anim) (-> s5-2 patrol-anim (get-rand-int obj 4))) - (set! (-> obj charge-anim) (-> s5-2 charge-anim (get-rand-int obj 3))) - (set! (-> obj attack-anim) (-> s5-2 attack-anim (get-rand-int obj 2))) + (set! (-> this patrol-anim) (-> s5-2 patrol-anim (get-rand-int this 4))) + (set! (-> this charge-anim) (-> s5-2 charge-anim (get-rand-int this 3))) + (set! (-> this attack-anim) (-> s5-2 attack-anim (get-rand-int this 2))) ) - (set! (-> obj use-charge-anim-index) -1) - (if (zero? (get-rand-int obj 2)) - (logior! (-> obj grunt-flags) 1) + (set! (-> this use-charge-anim-index) -1) + (if (zero? (get-rand-int this 2)) + (logior! (-> this grunt-flags) 1) ) - (if (zero? (get-rand-int obj 2)) - (logior! (-> obj grunt-flags) 4) + (if (zero? (get-rand-int this 2)) + (logior! (-> this grunt-flags) 4) ) - (set! (-> obj intro-path) (new 'process 'path-control obj 'intro 0.0 (the-as entity #f) #t)) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x 1433.6 :y 2785.28 :z -1761.28 :w 163840.0) ) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x -1433.6 :y 2785.28 :z -1761.28 :w 163840.0) ) - (set! (-> obj water-anim) -1) - (set! (-> obj minimap) #f) + (set! (-> this water-anim) -1) + (set! (-> this minimap) #f) 0 (none) ) 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 7ad59b7884..f629f01cc7 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 @@ -11,32 +11,32 @@ ) ;; definition for method 3 of type metalhead-predator-shot -(defmethod inspect metalhead-predator-shot ((obj metalhead-predator-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalhead-predator-shot ((this metalhead-predator-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type metalhead-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 28 of type metalhead-predator-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound metalhead-predator-shot ((obj metalhead-predator-shot) (arg0 projectile-options)) +(defmethod play-impact-sound metalhead-predator-shot ((this metalhead-predator-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "pred-shot-hit") ) (((projectile-options lose-altitude proj-options-2)) - (let ((f0-0 (doppler-pitch-shift (-> obj root trans) (-> obj root transv))) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) (a0-8 (static-sound-spec "pred-shot-loop" :volume 0.0 :mask (pitch reg0))) ) (set! (-> a0-8 volume) 1024) (set! (-> a0-8 pitch-mod) (the int (* 1524.0 f0-0))) - (sound-play-by-spec a0-8 (-> obj sound-id) (-> obj root trans)) + (sound-play-by-spec a0-8 (-> this sound-id) (-> this root trans)) ) ) ) @@ -45,9 +45,9 @@ ;; definition for method 30 of type metalhead-predator-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! metalhead-predator-shot ((obj metalhead-predator-shot)) +(defmethod init-proj-collision! metalhead-predator-shot ((this metalhead-predator-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -89,9 +89,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) @@ -99,16 +99,16 @@ ;; definition for method 31 of type metalhead-predator-shot ;; INFO: Used lq/sq -(defmethod init-proj-settings! metalhead-predator-shot ((obj metalhead-predator-shot)) +(defmethod init-proj-settings! metalhead-predator-shot ((this metalhead-predator-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'predator-shot) - (set! (-> obj max-speed) 532480.0) - (set! (-> obj move) metalhead-shot-move) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj timeout) (seconds 0.767)) - (set! (-> obj sound-id) (new-sound-id)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'predator-shot) + (set! (-> this max-speed) 532480.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.767)) + (set! (-> this sound-id) (new-sound-id)) + (set-gravity-length (-> this root dynam) 573440.0) (none) ) @@ -325,29 +325,29 @@ ) ;; definition for method 3 of type metalhead-predator -(defmethod inspect metalhead-predator ((obj metalhead-predator)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalhead-predator ((this metalhead-predator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type citizen-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlos: #~%" (-> obj los)) - (format #t "~2Twant-stop: ~A~%" (-> obj want-stop)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Tcurr-node: ~D~%" (-> obj curr-node)) - (format #t "~2Thide-pos: #~%" (-> obj hide-pos)) - (format #t "~2Tnext-change: ~D~%" (-> obj next-change)) - (format #t "~2Tshoot-angle: ~f~%" (-> obj shoot-angle)) - (format #t "~2Tmiss-amount: ~f~%" (-> obj miss-amount)) - (format #t "~2Tambient-sound-id: ~D~%" (-> obj ambient-sound-id)) - (format #t "~2Tshock-effect-time: ~D~%" (-> obj shock-effect-time)) - (format #t "~2Tshock-effect-end: ~D~%" (-> obj shock-effect-end)) - (format #t "~2Tfade: ~f~%" (-> obj fade)) - (format #t "~2Tdest-fade: ~f~%" (-> obj dest-fade)) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Twant-stop: ~A~%" (-> this want-stop)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tcurr-node: ~D~%" (-> this curr-node)) + (format #t "~2Thide-pos: #~%" (-> this hide-pos)) + (format #t "~2Tnext-change: ~D~%" (-> this next-change)) + (format #t "~2Tshoot-angle: ~f~%" (-> this shoot-angle)) + (format #t "~2Tmiss-amount: ~f~%" (-> this miss-amount)) + (format #t "~2Tambient-sound-id: ~D~%" (-> this ambient-sound-id)) + (format #t "~2Tshock-effect-time: ~D~%" (-> this shock-effect-time)) + (format #t "~2Tshock-effect-end: ~D~%" (-> this shock-effect-end)) + (format #t "~2Tfade: ~f~%" (-> this fade)) + (format #t "~2Tdest-fade: ~f~%" (-> this dest-fade)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -374,47 +374,47 @@ ;; definition for method 208 of type metalhead-predator ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-predator-method-208 metalhead-predator ((obj metalhead-predator)) +(defmethod metalhead-predator-method-208 metalhead-predator ((this metalhead-predator)) (cond - ((< (-> obj hit-points) 2) - (when (!= (-> obj dest-fade) 128.0) + ((< (-> this hit-points) 2) + (when (!= (-> this dest-fade) 128.0) (sound-play "pred-uncloak") - (set! (-> obj sound) (the-as ambient-sound 0)) + (set! (-> this sound) (the-as ambient-sound 0)) 0 ) - (set! (-> obj dest-fade) 128.0) + (set! (-> this dest-fade) 128.0) ) (else - (set! (-> obj dest-fade) 0.0) + (set! (-> this dest-fade) 0.0) ) ) - (seek! (-> obj fade) (-> obj dest-fade) (* 60.0 (seconds-per-frame))) - (set! (-> obj draw force-fade) (the-as uint (the int (-> obj fade)))) + (seek! (-> this fade) (-> this dest-fade) (* 60.0 (seconds-per-frame))) + (set! (-> this draw force-fade) (the-as uint (the int (-> this fade)))) (cond - ((zero? (-> obj draw force-fade)) - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 0 4) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((zero? (-> this draw force-fade)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 0 4) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) - ((= (-> obj draw force-fade) 128) - (setup-masks (-> obj draw) 0 8) - (setup-masks (-> obj draw) 4 0) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((= (-> this draw force-fade) 128) + (setup-masks (-> this draw) 0 8) + (setup-masks (-> this draw) 4 0) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) (else - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 4 0) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 4 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) ) - (if (< 245760.0 (vector-vector-distance (-> obj root trans) (camera-pos))) - (setup-masks (-> obj draw) 0 8) + (if (< 245760.0 (vector-vector-distance (-> this root trans) (camera-pos))) + (setup-masks (-> this draw) 0 8) ) - (when (< (current-time) (-> obj shock-effect-end)) - (when (>= (- (current-time) (-> obj shock-effect-time)) (seconds 0.04)) - (set! (-> obj shock-effect-time) (current-time)) + (when (< (current-time) (-> this shock-effect-end)) + (when (time-elapsed? (-> this shock-effect-time) (seconds 0.04)) + (set-time! (-> this shock-effect-time)) (process-drawable-shock-skel-effect - obj + this (-> *lightning-spec-id-table* 15) lightning-probe-callback (-> *part-id-table* 166) @@ -429,99 +429,99 @@ ) ;; definition for method 55 of type metalhead-predator -(defmethod track-target! metalhead-predator ((obj metalhead-predator)) +(defmethod track-target! metalhead-predator ((this metalhead-predator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type citizen-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (metalhead-predator-method-208 obj) - (set-dst-proc! (-> obj los) (-> obj focus handle)) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (metalhead-predator-method-208 this) + (set-dst-proc! (-> this los) (-> this focus handle)) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) (none) ) ;; definition for method 74 of type metalhead-predator ;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler metalhead-predator ((obj metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler metalhead-predator ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) - (set! (-> obj shock-effect-end) (the-as int (+ (current-time) (seconds 1)))) - ((method-of-type citizen-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (set! (-> this shock-effect-end) (the-as int (+ (current-time) (seconds 1)))) + ((method-of-type citizen-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('combo) - (and (not (and (-> obj next-state) (= (-> obj next-state name) 'inactive))) - (and (not (logtest? (enemy-flag multi-focus) (-> obj enemy-flags))) (nonzero? (-> obj hit-points))) + (and (not (and (-> this next-state) (= (-> this next-state name) 'inactive))) + (and (not (logtest? (enemy-flag multi-focus) (-> this enemy-flags))) (nonzero? (-> this hit-points))) ) ) (else - ((method-of-type citizen-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type citizen-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 77 of type metalhead-predator -(defmethod enemy-method-77 metalhead-predator ((obj metalhead-predator) (arg0 (pointer float))) +(defmethod enemy-method-77 metalhead-predator ((this metalhead-predator) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + ((zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 14))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 14)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 14)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!) ) ) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((v1-32 (get-rand-int obj 2))) + (let ((v1-32 (get-rand-int this 2))) (cond ((zero? v1-32) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 21)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) (-> arg0 0)) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) ) ) ((= v1-32 1) - (let ((a0-12 (-> obj skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-12 param 1) (-> arg0 0)) (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) ) ) @@ -529,26 +529,26 @@ ) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-15 (-> obj skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-15 param 1) (-> arg0 0)) (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-17 (-> obj skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (let ((a0-17 (-> this skel root-channel 0))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) ) (set! (-> a0-17 param 1) (-> arg0 0)) (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) ) ) ) @@ -558,73 +558,73 @@ ) ;; definition for method 78 of type metalhead-predator -(defmethod enemy-method-78 metalhead-predator ((obj metalhead-predator) (arg0 (pointer float))) +(defmethod enemy-method-78 metalhead-predator ((this metalhead-predator) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + ((zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 15))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 15)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 15)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) ) ) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) (-> arg0 0)) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) ) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-11 (-> obj skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19))) + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) ) (set! (-> a0-11 param 1) (-> arg0 0)) (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-13 (-> obj skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 13))) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 13)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) ) (set! (-> a0-13 param 1) (-> arg0 0)) (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 13)) num-func-seek!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) ) ) ) @@ -634,13 +634,13 @@ ) ;; definition for method 26 of type metalhead-predator -(defmethod get-inv-mass metalhead-predator ((obj metalhead-predator)) +(defmethod get-inv-mass metalhead-predator ((this metalhead-predator)) 0.5 ) ;; definition for method 207 of type metalhead-predator ;; INFO: Used lq/sq -(defmethod metalhead-predator-method-207 metalhead-predator ((obj metalhead-predator) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod metalhead-predator-method-207 metalhead-predator ((this metalhead-predator) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f0-0 1228.8) (f30-0 6144.0) @@ -650,8 +650,8 @@ (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) (set! (-> v1-4 collide-with) (collide-spec backgnd)) - (set! (-> v1-4 ignore-process0) obj) - (set! (-> v1-4 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) ) @@ -680,8 +680,8 @@ (let ((v1-14 s5-0)) (set! (-> v1-14 radius) f30-0) (set! (-> v1-14 collide-with) (collide-spec enemy hit-by-player-list hit-by-others-list)) - (set! (-> v1-14 ignore-process0) obj) - (set! (-> v1-14 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-14 ignore-process0) this) + (set! (-> v1-14 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-14 action-mask) (collide-action solid)) ) @@ -713,7 +713,7 @@ ;; definition for method 206 of type metalhead-predator ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-predator-method-206 metalhead-predator ((obj metalhead-predator) (arg0 int) (arg1 float)) +(defmethod metalhead-predator-method-206 metalhead-predator ((this metalhead-predator) (arg0 int) (arg1 float)) (local-vars (sv-240 vector) (sv-256 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -723,15 +723,15 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((a1-1 (-> obj node-list data arg0)) + (let ((a1-1 (-> this node-list data arg0)) (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options)) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (let* ((v1-10 *game-info*) (a0-11 (+ (-> v1-10 attack-id) 1)) ) @@ -740,11 +740,11 @@ ) (set! (-> s5-0 timeout) (seconds 4)) (vector<-cspace! (-> s5-0 pos) a1-1) - (let ((s3-0 (handle->process (-> obj focus handle))) + (let ((s3-0 (handle->process (-> this focus handle))) (s2-0 (new 'stack-no-clear 'vector)) ) (when s3-0 - (seek! (-> obj miss-amount) (* 0.2 (vector-length (-> (the-as process-drawable s3-0) root transv))) 4096.0) + (seek! (-> this miss-amount) (* 0.2 (vector-length (-> (the-as process-drawable s3-0) root transv))) 4096.0) (set! (-> s2-0 quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) (set! sv-240 (new 'stack-no-clear 'vector)) (let ((v1-25 (-> s5-0 pos)) @@ -783,19 +783,19 @@ (vector-normalize! sv-256 1.0) (vector-cross! s0-0 sv-240 sv-256) (vector-normalize! s0-0 1.0) - (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-240 (-> obj shoot-angle)))) + (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-240 (-> this shoot-angle)))) (vector-orient-by-quat! sv-256 sv-256 a2-5) ) (let* ((t9-9 quaternion-vector-angle!) (a0-27 (new 'stack-no-clear 'quaternion)) - (a2-6 (-> obj shoot-angle)) + (a2-6 (-> this shoot-angle)) (a2-7 (t9-9 a0-27 sv-240 a2-6)) ) (vector-orient-by-quat! s0-0 s0-0 a2-7) ) (let ((a0-29 s1-1)) (let ((v1-33 s2-0)) - (let ((a1-17 (-> obj miss-amount))) + (let ((a1-17 (-> this miss-amount))) (.mov vf7 a1-17) ) (.lvf vf5 (&-> sv-256 quad)) @@ -807,7 +807,7 @@ (.svf (&-> a0-29 quad) vf6) ) (let ((v1-34 s2-0)) - (let ((a0-30 (* arg1 (-> obj miss-amount)))) + (let ((a0-30 (* arg1 (-> this miss-amount)))) (.mov vf7 a0-30) ) (.lvf vf5 (&-> s0-0 quad)) @@ -822,13 +822,13 @@ (vector-! (-> s5-0 vel) s2-0 (-> s5-0 pos)) (vector-normalize! (-> s5-0 vel) 409600.0) (when (metalhead-predator-method-207 - obj + this (-> s5-0 pos) (vector+! (new 'stack-no-clear 'vector) (-> s5-0 pos) (-> s5-0 vel)) (get-trans (the-as process-focusable s3-0) 3) ) (vector-normalize! (-> s5-0 vel) 532480.0) - (spawn-projectile metalhead-predator-shot s5-0 obj *default-dead-pool*) + (spawn-projectile metalhead-predator-shot s5-0 this *default-dead-pool*) ) ) ) @@ -868,7 +868,7 @@ ) ) (set! (-> self want-stop) #f) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self next-change) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 4.0 8.0)))))) (if (zero? (get-rand-int self 3)) (sound-play "pred-talk") @@ -891,7 +891,7 @@ (go-virtual active) ) (when (get-enemy-target self) - (when (and gp-0 (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + (when (and gp-0 (time-elapsed? (-> self state-time) (-> self reaction-time))) (cond ((< (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)) 16384.0) (go-virtual close-attack) @@ -1061,8 +1061,8 @@ ;; definition for method 205 of type metalhead-predator ;; WARN: Return type mismatch int vs none. -(defmethod metalhead-predator-method-205 metalhead-predator ((obj metalhead-predator) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod metalhead-predator-method-205 metalhead-predator ((this metalhead-predator) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (+ (-> v1-1 specific 0) -2))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child (+ a0-1 2)))) (if arg0 @@ -1078,9 +1078,9 @@ ;; definition for method 114 of type metalhead-predator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! metalhead-predator ((obj metalhead-predator)) +(defmethod init-enemy-collision! metalhead-predator ((this metalhead-predator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1152,7 +1152,7 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 8)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1160,62 +1160,72 @@ ;; definition for method 7 of type metalhead-predator ;; WARN: Return type mismatch process-drawable vs metalhead-predator. -(defmethod relocate metalhead-predator ((obj metalhead-predator) (arg0 int)) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method metalhead-predator 7)) + this + arg0 + ) ) ) ;; definition for method 115 of type metalhead-predator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! metalhead-predator ((obj metalhead-predator)) +(defmethod init-enemy! metalhead-predator ((this metalhead-predator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-metalhead-predator" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *metalhead-predator-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *metalhead-predator-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 491520.0) - (set! (-> obj draw lod-set lod 1 dist) 573440.0) - (set! (-> obj anim-shuffle) 6) - (set! (-> obj anim-walk) 6) - (set! (-> obj speed-walk) 12288.0) - (set! (-> obj dist-walk-anim) 16179.2) - (set! (-> obj dist-run-anim) 26214.4) - (set! (-> obj anim-run) 7) - (set! (-> obj speed-run) 49152.0) - (set! (-> obj water-anim) -1) - (add-connection *part-engine* obj 8 obj 318 (new 'static 'vector :x 1228.8 :y 450.56 :z 983.04 :w 614400.0)) - (add-connection *part-engine* obj 8 obj 318 (new 'static 'vector :x -1228.8 :y 450.56 :z 983.04 :w 614400.0)) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd obstacle)) - (set! (-> obj minimap) #f) + (set! (-> this draw lod-set lod 0 dist) 491520.0) + (set! (-> this draw lod-set lod 1 dist) 573440.0) + (set! (-> this anim-shuffle) 6) + (set! (-> this anim-walk) 6) + (set! (-> this speed-walk) 12288.0) + (set! (-> this dist-walk-anim) 16179.2) + (set! (-> this dist-run-anim) 26214.4) + (set! (-> this anim-run) 7) + (set! (-> this speed-run) 49152.0) + (set! (-> this water-anim) -1) + (add-connection *part-engine* this 8 this 318 (new 'static 'vector :x 1228.8 :y 450.56 :z 983.04 :w 614400.0)) + (add-connection + *part-engine* + this + 8 + this + 318 + (new 'static 'vector :x -1228.8 :y 450.56 :z 983.04 :w 614400.0) + ) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle)) + (set! (-> this minimap) #f) 0 (none) ) ;; definition for method 181 of type metalhead-predator ;; WARN: Return type mismatch int vs none. -(defmethod citizen-init! metalhead-predator ((obj metalhead-predator)) +(defmethod citizen-init! metalhead-predator ((this metalhead-predator)) "Initialize [[citizen]] defaults." (let ((t9-0 (method-of-type citizen-enemy citizen-init!))) - (t9-0 obj) + (t9-0 this) ) - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 0 4) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) - (set! (-> obj draw force-fade) (the-as uint 0)) - (set! (-> obj fade) 0.0) - (set! (-> obj dest-fade) 0.0) - (set! (-> obj curr-node) -1) - (set! (-> obj next-change) 0) - (set! (-> obj miss-amount) 16384.0) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 0 4) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> this draw force-fade) (the-as uint 0)) + (set! (-> this fade) 0.0) + (set! (-> this dest-fade) 0.0) + (set! (-> this curr-node) -1) + (set! (-> this next-change) 0) + (set! (-> this miss-amount) 16384.0) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine-h_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine-h_REF.gc index 1157331fa7..6d465ec3ee 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine-h_REF.gc @@ -20,24 +20,24 @@ ) ;; definition for method 3 of type nav-segment -(defmethod inspect nav-segment ((obj nav-segment)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-segment ((this nav-segment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-segment) - (format #t "~1Tvertex[2] @ #x~X~%" (-> obj vertex)) - (format #t "~1Tlength: ~f~%" (-> obj length)) - (format #t "~1Tspawn-spacing: ~f~%" (-> obj spawn-spacing)) - (format #t "~1Tbranch: #~%" (-> obj branch)) - (format #t "~1Tnav-mesh-id: ~D~%" (-> obj nav-mesh-id)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tcell-id: ~D~%" (-> obj cell-id)) - (format #t "~1Tfrom-cell-id: ~D~%" (-> obj from-cell-id)) - (format #t "~1Ttracker-id: ~D~%" (-> obj tracker-id)) - (format #t "~1Tpad0: ~D~%" (-> obj pad0)) + (format #t "[~8x] ~A~%" this 'nav-segment) + (format #t "~1Tvertex[2] @ #x~X~%" (-> this vertex)) + (format #t "~1Tlength: ~f~%" (-> this length)) + (format #t "~1Tspawn-spacing: ~f~%" (-> this spawn-spacing)) + (format #t "~1Tbranch: #~%" (-> this branch)) + (format #t "~1Tnav-mesh-id: ~D~%" (-> this nav-mesh-id)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tcell-id: ~D~%" (-> this cell-id)) + (format #t "~1Tfrom-cell-id: ~D~%" (-> this from-cell-id)) + (format #t "~1Ttracker-id: ~D~%" (-> this tracker-id)) + (format #t "~1Tpad0: ~D~%" (-> this pad0)) (label cfg-4) - obj + this ) ;; definition of type vis-cell @@ -63,20 +63,20 @@ ) ;; definition for method 3 of type vis-cell -(defmethod inspect vis-cell ((obj vis-cell)) - (when (not obj) - (set! obj obj) +(defmethod inspect vis-cell ((this vis-cell)) + (when (not this) + (set! this this) (goto cfg-16) ) - (format #t "[~8x] ~A~%" obj 'vis-cell) - (format #t "~1Tsphere: #~%" (-> obj sphere)) - (format #t "~1Tsegment-array: #x~X~%" (-> obj segment-array)) - (format #t "~1Tvis-id: ~D~%" (-> obj vis-id)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tincoming-segment-count: ~D~%" (-> obj incoming-segment-count)) - (format #t "~1Tsegment-count: ~D~%" (-> obj segment-count)) - (format #t "~1Tflags: #x~X : (vis-cell-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'vis-cell) + (format #t "~1Tsphere: #~%" (-> this sphere)) + (format #t "~1Tsegment-array: #x~X~%" (-> this segment-array)) + (format #t "~1Tvis-id: ~D~%" (-> this vis-id)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tincoming-segment-count: ~D~%" (-> this incoming-segment-count)) + (format #t "~1Tsegment-count: ~D~%" (-> this segment-count)) + (format #t "~1Tflags: #x~X : (vis-cell-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (vis-cell-flag active-pedestrian)) (vis-cell-flag active-pedestrian)) (format #t "active-pedestrian ") ) @@ -88,8 +88,8 @@ ) ) (format #t ")~%") - (format #t "~1Tprev-flags: #x~X : (vis-cell-flag " (-> obj prev-flags)) - (let ((s5-1 (-> obj prev-flags))) + (format #t "~1Tprev-flags: #x~X : (vis-cell-flag " (-> this prev-flags)) + (let ((s5-1 (-> this prev-flags))) (if (= (logand s5-1 (vis-cell-flag active-pedestrian)) (vis-cell-flag active-pedestrian)) (format #t "active-pedestrian ") ) @@ -101,10 +101,10 @@ ) ) (format #t ")~%") - (format #t "~1Talloc-segment-count: ~D~%" (-> obj alloc-segment-count)) - (format #t "~1Tpad0: ~D~%" (-> obj pad0)) + (format #t "~1Talloc-segment-count: ~D~%" (-> this alloc-segment-count)) + (format #t "~1Tpad0: ~D~%" (-> this pad0)) (label cfg-16) - obj + this ) ;; definition of type vis-grid-pos @@ -121,18 +121,18 @@ ) ;; definition for method 3 of type vis-grid-pos -(defmethod inspect vis-grid-pos ((obj vis-grid-pos)) - (when (not obj) - (set! obj obj) +(defmethod inspect vis-grid-pos ((this vis-grid-pos)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vis-grid-pos) - (format #t "~1Tdata[3] @ #x~X~%" (&-> obj x)) - (format #t "~1Tx: ~D~%" (-> obj x)) - (format #t "~1Ty: ~D~%" (-> obj y)) - (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "[~8x] ~A~%" this 'vis-grid-pos) + (format #t "~1Tdata[3] @ #x~X~%" (&-> this x)) + (format #t "~1Tx: ~D~%" (-> this x)) + (format #t "~1Ty: ~D~%" (-> this y)) + (format #t "~1Tz: ~D~%" (-> this z)) (label cfg-4) - obj + this ) ;; definition of type vis-grid-box @@ -146,16 +146,16 @@ ) ;; definition for method 3 of type vis-grid-box -(defmethod inspect vis-grid-box ((obj vis-grid-box)) - (when (not obj) - (set! obj obj) +(defmethod inspect vis-grid-box ((this vis-grid-box)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vis-grid-box) - (format #t "~1Tmin: #~%" (-> obj min)) - (format #t "~1Tmax: #~%" (-> obj max)) + (format #t "[~8x] ~A~%" this 'vis-grid-box) + (format #t "~1Tmin: #~%" (-> this min)) + (format #t "~1Tmax: #~%" (-> this max)) (label cfg-4) - obj + this ) ;; definition of type vis-ray @@ -174,21 +174,21 @@ ) ;; definition for method 3 of type vis-ray -(defmethod inspect vis-ray ((obj vis-ray)) - (when (not obj) - (set! obj obj) +(defmethod inspect vis-ray ((this vis-ray)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vis-ray) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tdir: #~%" (-> obj dir)) - (format #t "~1Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~1Tplane: #~%" (-> obj plane)) - (format #t "~1Tgrid-pos: #~%" (-> obj grid-pos)) - (format #t "~1Tlen: ~f~%" (-> obj len)) - (format #t "~1Tcell: #~%" (-> obj cell)) + (format #t "[~8x] ~A~%" this 'vis-ray) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~1Tplane: #~%" (-> this plane)) + (format #t "~1Tgrid-pos: #~%" (-> this grid-pos)) + (format #t "~1Tlen: ~f~%" (-> this len)) + (format #t "~1Tcell: #~%" (-> this cell)) (label cfg-4) - obj + this ) ;; definition of type grid-info @@ -212,19 +212,19 @@ ) ;; definition for method 3 of type grid-info -(defmethod inspect grid-info ((obj grid-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect grid-info ((this grid-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'grid-info) - (format #t "~1Taxis-scale[3] @ #x~X~%" (-> obj axis-scale)) - (format #t "~1Tdimension-array[3] @ #x~X~%" (-> obj dimension-array)) - (format #t "~1Tpad0[1] @ #x~X~%" (-> obj pad0)) - (format #t "~1Tbox: #~%" (-> obj box)) - (format #t "~1Tcell-size: #~%" (-> obj cell-size)) + (format #t "[~8x] ~A~%" this 'grid-info) + (format #t "~1Taxis-scale[3] @ #x~X~%" (-> this axis-scale)) + (format #t "~1Tdimension-array[3] @ #x~X~%" (-> this dimension-array)) + (format #t "~1Tpad0[1] @ #x~X~%" (-> this pad0)) + (format #t "~1Tbox: #~%" (-> this box)) + (format #t "~1Tcell-size: #~%" (-> this cell-size)) (label cfg-4) - obj + this ) ;; definition of type city-level-info @@ -256,22 +256,22 @@ ) ;; definition for method 3 of type city-level-info -(defmethod inspect city-level-info ((obj city-level-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect city-level-info ((this city-level-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'city-level-info) - (format #t "~1Tgrid-info: #~%" (-> obj grid-info)) - (format #t "~1Tcell-array: #x~X~%" (-> obj cell-array)) - (format #t "~1Tsegment-count: ~D~%" (-> obj segment-count)) - (format #t "~1Tcell-count: ~D~%" (-> obj cell-count)) - (format #t "~1Tsegment-array: #x~X~%" (-> obj segment-array)) - (format #t "~1Tnav-graph: ~A~%" (-> obj nav-graph)) - (format #t "~1Tcamera-ceiling: (meters ~m)~%" (-> obj camera-ceiling)) - (format #t "~1Tpad-array[56] @ #x~X~%" (-> obj pad-array)) + (format #t "[~8x] ~A~%" this 'city-level-info) + (format #t "~1Tgrid-info: #~%" (-> this grid-info)) + (format #t "~1Tcell-array: #x~X~%" (-> this cell-array)) + (format #t "~1Tsegment-count: ~D~%" (-> this segment-count)) + (format #t "~1Tcell-count: ~D~%" (-> this cell-count)) + (format #t "~1Tsegment-array: #x~X~%" (-> this segment-array)) + (format #t "~1Tnav-graph: ~A~%" (-> this nav-graph)) + (format #t "~1Tcamera-ceiling: (meters ~m)~%" (-> this camera-ceiling)) + (format #t "~1Tpad-array[56] @ #x~X~%" (-> this pad-array)) (label cfg-4) - obj + this ) ;; definition of type traffic-level-data @@ -297,20 +297,20 @@ ) ;; definition for method 3 of type traffic-level-data -(defmethod inspect traffic-level-data ((obj traffic-level-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-level-data ((this traffic-level-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-level-data) - (format #t "~1Tcity-info: #~%" (-> obj city-info)) - (format #t "~1Tactive-cell-count: ~D~%" (-> obj active-cell-count)) - (format #t "~1Tnewly-active-cell-count: ~D~%" (-> obj newly-active-cell-count)) - (format #t "~1Tactive-cell-list[255] @ #x~X~%" (-> obj active-cell-list)) - (format #t "~1Tnewly-active-cell-list[255] @ #x~X~%" (-> obj newly-active-cell-list)) - (format #t "~1Tactive-cell-box: #~%" (-> obj active-cell-box)) + (format #t "[~8x] ~A~%" this 'traffic-level-data) + (format #t "~1Tcity-info: #~%" (-> this city-info)) + (format #t "~1Tactive-cell-count: ~D~%" (-> this active-cell-count)) + (format #t "~1Tnewly-active-cell-count: ~D~%" (-> this newly-active-cell-count)) + (format #t "~1Tactive-cell-list[255] @ #x~X~%" (-> this active-cell-list)) + (format #t "~1Tnewly-active-cell-list[255] @ #x~X~%" (-> this newly-active-cell-list)) + (format #t "~1Tactive-cell-box: #~%" (-> this active-cell-box)) (label cfg-4) - obj + this ) ;; definition of type traffic-suppression-box @@ -326,18 +326,18 @@ ) ;; definition for method 3 of type traffic-suppression-box -(defmethod inspect traffic-suppression-box ((obj traffic-suppression-box)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-suppression-box ((this traffic-suppression-box)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-suppression-box) - (format #t "~1Tdata[32] @ #x~X~%" (-> obj bbox)) - (format #t "~1Tbbox: #~%" (-> obj bbox)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tduration: ~D~%" (-> obj duration)) + (format #t "[~8x] ~A~%" this 'traffic-suppression-box) + (format #t "~1Tdata[32] @ #x~X~%" (-> this bbox)) + (format #t "~1Tbbox: #~%" (-> this bbox)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tduration: ~D~%" (-> this duration)) (label cfg-4) - obj + this ) ;; definition of type traffic-guard-type-info @@ -355,20 +355,20 @@ ) ;; definition for method 3 of type traffic-guard-type-info -(defmethod inspect traffic-guard-type-info ((obj traffic-guard-type-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-guard-type-info ((this traffic-guard-type-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-guard-type-info) - (format #t "~1Tobject-type: ~D~%" (-> obj object-type)) - (format #t "~1Tmax-target-count: ~D~%" (-> obj max-target-count)) - (format #t "~1Tmin-target-count: ~D~%" (-> obj min-target-count)) - (format #t "~1Ttarget-count: ~D~%" (-> obj target-count)) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tchange-to-type: ~D~%" (-> obj change-to-type)) + (format #t "[~8x] ~A~%" this 'traffic-guard-type-info) + (format #t "~1Tobject-type: ~D~%" (-> this object-type)) + (format #t "~1Tmax-target-count: ~D~%" (-> this max-target-count)) + (format #t "~1Tmin-target-count: ~D~%" (-> this min-target-count)) + (format #t "~1Ttarget-count: ~D~%" (-> this target-count)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tchange-to-type: ~D~%" (-> this change-to-type)) (label cfg-4) - obj + this ) ;; definition of type traffic-guard-type-settings @@ -387,21 +387,21 @@ ) ;; definition for method 3 of type traffic-guard-type-settings -(defmethod inspect traffic-guard-type-settings ((obj traffic-guard-type-settings)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-guard-type-settings ((this traffic-guard-type-settings)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-guard-type-settings) - (format #t "~1Ttarget-count: ~D~%" (-> obj target-count)) - (format #t "~1Tinaccuracy: ~f~%" (-> obj inaccuracy)) - (format #t "~1Tacquire-delay: ~D~%" (-> obj acquire-delay)) - (format #t "~1Tshot-delay: ~D~%" (-> obj shot-delay)) - (format #t "~1Tburst-delay: ~D~%" (-> obj burst-delay)) - (format #t "~1Tshot-count: ~D~%" (-> obj shot-count)) - (format #t "~1Trand-shot-count: ~D~%" (-> obj rand-shot-count)) + (format #t "[~8x] ~A~%" this 'traffic-guard-type-settings) + (format #t "~1Ttarget-count: ~D~%" (-> this target-count)) + (format #t "~1Tinaccuracy: ~f~%" (-> this inaccuracy)) + (format #t "~1Tacquire-delay: ~D~%" (-> this acquire-delay)) + (format #t "~1Tshot-delay: ~D~%" (-> this shot-delay)) + (format #t "~1Tburst-delay: ~D~%" (-> this burst-delay)) + (format #t "~1Tshot-count: ~D~%" (-> this shot-count)) + (format #t "~1Trand-shot-count: ~D~%" (-> this rand-shot-count)) (label cfg-4) - obj + this ) ;; definition of type traffic-alert-state-settings @@ -420,21 +420,21 @@ ) ;; definition for method 3 of type traffic-alert-state-settings -(defmethod inspect traffic-alert-state-settings ((obj traffic-alert-state-settings)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-alert-state-settings ((this traffic-alert-state-settings)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-alert-state-settings) - (format #t "~1Tguard-settings-array[6] @ #x~X~%" (-> obj ped-tazer)) - (format #t "~1Tped-tazer: #~%" (-> obj ped-tazer)) - (format #t "~1Tped-rifle: #~%" (-> obj ped-rifle)) - (format #t "~1Tped-grenade: #~%" (-> obj ped-grenade)) - (format #t "~1Tped-roboguard: #~%" (-> obj ped-roboguard)) - (format #t "~1Tbike-turret: #~%" (-> obj bike-turret)) - (format #t "~1Thellcat-turret: #~%" (-> obj hellcat-turret)) + (format #t "[~8x] ~A~%" this 'traffic-alert-state-settings) + (format #t "~1Tguard-settings-array[6] @ #x~X~%" (-> this ped-tazer)) + (format #t "~1Tped-tazer: #~%" (-> this ped-tazer)) + (format #t "~1Tped-rifle: #~%" (-> this ped-rifle)) + (format #t "~1Tped-grenade: #~%" (-> this ped-grenade)) + (format #t "~1Tped-roboguard: #~%" (-> this ped-roboguard)) + (format #t "~1Tbike-turret: #~%" (-> this bike-turret)) + (format #t "~1Thellcat-turret: #~%" (-> this hellcat-turret)) (label cfg-4) - obj + this ) ;; definition of type traffic-target-status @@ -452,14 +452,14 @@ ) ;; definition for method 3 of type traffic-target-status -(defmethod inspect traffic-target-status ((obj traffic-target-status)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-target-status ((this traffic-target-status)) + (when (not this) + (set! this this) (goto cfg-14) ) - (format #t "[~8x] ~A~%" obj 'traffic-target-status) - (format #t "~1Tflags: #x~X : (traffic-target-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'traffic-target-status) + (format #t "~1Tflags: #x~X : (traffic-target-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (traffic-target-flag visible-now)) (traffic-target-flag visible-now)) (format #t "visible-now ") ) @@ -477,13 +477,13 @@ ) ) (format #t ")~%") - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tlast-seen-time: ~D~%" (-> obj last-seen-time)) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) - (format #t "~1Tmove-position: #~%" (-> obj move-position)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tlast-seen-time: ~D~%" (-> this last-seen-time)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Tmove-position: #~%" (-> this move-position)) (label cfg-14) - obj + this ) ;; definition of type traffic-alert-state @@ -513,14 +513,14 @@ ) ;; definition for method 3 of type traffic-alert-state -(defmethod inspect traffic-alert-state ((obj traffic-alert-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-alert-state ((this traffic-alert-state)) + (when (not this) + (set! this this) (goto cfg-16) ) - (format #t "[~8x] ~A~%" obj 'traffic-alert-state) - (format #t "~1Tflags: #x~X : (traffic-alert-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'traffic-alert-state) + (format #t "~1Tflags: #x~X : (traffic-alert-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (traffic-alert-flag disable-pursuit-control)) (traffic-alert-flag disable-pursuit-control)) (format #t "disable-pursuit-control ") ) @@ -541,22 +541,22 @@ ) ) (format #t ")~%") - (format #t "~1Tlevel: ~D~%" (-> obj level)) - (format #t "~1Tmax-level: ~D~%" (-> obj max-level)) - (format #t "~1Tguards-in-sight-of-target: ~D~%" (-> obj guards-in-sight-of-target)) - (format #t "~1Tguard-aim-count: ~D~%" (-> obj guard-aim-count)) - (format #t "~1Tguard-inaccuracy-factor: ~f~%" (-> obj guard-inaccuracy-factor)) - (format #t "~1Tguard-target-level: ~f~%" (-> obj guard-target-level)) - (format #t "~1Tduration: ~D~%" (-> obj duration)) - (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~1Tnotify-time: ~D~%" (-> obj notify-time)) - (format #t "~1Talarm-sound-id: ~D~%" (-> obj alarm-sound-id)) - (format #t "~1Ttarget-status-array[3] @ #x~X~%" (-> obj target-status-array)) - (format #t "~1Tsettings: #~%" (-> obj settings)) - (format #t "~1Tguard-type-info-array[6] @ #x~X~%" (-> obj guard-type-info-array)) - (format #t "~1Tguard-type-mask-from-object-type[126] @ #x~X~%" (-> obj guard-type-mask-from-object-type)) + (format #t "~1Tlevel: ~D~%" (-> this level)) + (format #t "~1Tmax-level: ~D~%" (-> this max-level)) + (format #t "~1Tguards-in-sight-of-target: ~D~%" (-> this guards-in-sight-of-target)) + (format #t "~1Tguard-aim-count: ~D~%" (-> this guard-aim-count)) + (format #t "~1Tguard-inaccuracy-factor: ~f~%" (-> this guard-inaccuracy-factor)) + (format #t "~1Tguard-target-level: ~f~%" (-> this guard-target-level)) + (format #t "~1Tduration: ~D~%" (-> this duration)) + (format #t "~1Tstart-time: ~D~%" (-> this start-time)) + (format #t "~1Tnotify-time: ~D~%" (-> this notify-time)) + (format #t "~1Talarm-sound-id: ~D~%" (-> this alarm-sound-id)) + (format #t "~1Ttarget-status-array[3] @ #x~X~%" (-> this target-status-array)) + (format #t "~1Tsettings: #~%" (-> this settings)) + (format #t "~1Tguard-type-info-array[6] @ #x~X~%" (-> this guard-type-info-array)) + (format #t "~1Tguard-type-mask-from-object-type[126] @ #x~X~%" (-> this guard-type-mask-from-object-type)) (label cfg-16) - obj + this ) ;; definition of type traffic-object-type-info @@ -580,26 +580,26 @@ ) ;; definition for method 3 of type traffic-object-type-info -(defmethod inspect traffic-object-type-info ((obj traffic-object-type-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-object-type-info ((this traffic-object-type-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-object-type-info) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Ttarget-count: ~D~%" (-> obj target-count)) - (format #t "~1Tactive-count: ~D~%" (-> obj active-count)) - (format #t "~1Tinactive-count: ~D~%" (-> obj inactive-count)) - (format #t "~1Treserve-count: ~D~%" (-> obj reserve-count)) - (format #t "~1Tkilled-count: ~D~%" (-> obj killed-count)) - (format #t "~1Twant-count: ~D~%" (-> obj want-count)) - (format #t "~1Ttracker-index: ~D~%" (-> obj tracker-index)) - (format #t "~1Tparking-spot-prob: ~D~%" (-> obj parking-spot-prob)) - (format #t "~1Tguard-type: ~D~%" (-> obj guard-type)) - (format #t "~1Tarray: #x~X~%" (-> obj array)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "[~8x] ~A~%" this 'traffic-object-type-info) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Ttarget-count: ~D~%" (-> this target-count)) + (format #t "~1Tactive-count: ~D~%" (-> this active-count)) + (format #t "~1Tinactive-count: ~D~%" (-> this inactive-count)) + (format #t "~1Treserve-count: ~D~%" (-> this reserve-count)) + (format #t "~1Tkilled-count: ~D~%" (-> this killed-count)) + (format #t "~1Twant-count: ~D~%" (-> this want-count)) + (format #t "~1Ttracker-index: ~D~%" (-> this tracker-index)) + (format #t "~1Tparking-spot-prob: ~D~%" (-> this parking-spot-prob)) + (format #t "~1Tguard-type: ~D~%" (-> this guard-type)) + (format #t "~1Tarray: #x~X~%" (-> this array)) + (format #t "~1Tlevel: ~A~%" (-> this level)) (label cfg-4) - obj + this ) ;; definition of type traffic-suppressor @@ -621,17 +621,17 @@ ) ;; definition for method 3 of type traffic-suppressor -(defmethod inspect traffic-suppressor ((obj traffic-suppressor)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-suppressor ((this traffic-suppressor)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-suppressor) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tbbox: #~%" (-> obj bbox)) - (format #t "~1Tarray[16] @ #x~X~%" (-> obj array)) + (format #t "[~8x] ~A~%" this 'traffic-suppressor) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tbbox: #~%" (-> this bbox)) + (format #t "~1Tarray[16] @ #x~X~%" (-> this array)) (label cfg-4) - obj + this ) ;; definition of type traffic-tracker @@ -671,22 +671,22 @@ ) ;; definition for method 3 of type traffic-tracker -(defmethod inspect traffic-tracker ((obj traffic-tracker)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-tracker ((this traffic-tracker)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-tracker) - (format #t "~1Ttraffic: ~A~%" (-> obj traffic)) - (format #t "~1Tobject-hash: ~A~%" (-> obj object-hash)) - (format #t "~1Trand: ~f~%" (-> obj rand)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tactive-object-count: ~D~%" (-> obj active-object-count)) - (format #t "~1Tinactive-object-count: ~D~%" (-> obj inactive-object-count)) - (format #t "~1Tactive-object-list[126] @ #x~X~%" (-> obj active-object-list)) - (format #t "~1Tactive-object-type-list[126] @ #x~X~%" (-> obj active-object-type-list)) + (format #t "[~8x] ~A~%" this 'traffic-tracker) + (format #t "~1Ttraffic: ~A~%" (-> this traffic)) + (format #t "~1Tobject-hash: ~A~%" (-> this object-hash)) + (format #t "~1Trand: ~f~%" (-> this rand)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tactive-object-count: ~D~%" (-> this active-object-count)) + (format #t "~1Tinactive-object-count: ~D~%" (-> this inactive-object-count)) + (format #t "~1Tactive-object-list[126] @ #x~X~%" (-> this active-object-list)) + (format #t "~1Tactive-object-type-list[126] @ #x~X~%" (-> this active-object-type-list)) (label cfg-4) - obj + this ) ;; definition of type traffic-engine @@ -786,31 +786,31 @@ ) ;; definition for method 3 of type traffic-engine -(defmethod inspect traffic-engine ((obj traffic-engine)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-engine ((this traffic-engine)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tobject-hash: ~A~%" (-> obj object-hash)) - (format #t "~1Tmanager: ~D~%" (-> obj manager)) - (format #t "~1Tinv-density-factor: ~f~%" (-> obj inv-density-factor)) - (format #t "~1Tsync-clock: ~D~%" (-> obj sync-clock)) - (format #t "~1Tsync-mask-8: ~D~%" (-> obj sync-mask-8)) - (format #t "~1Tsync-mask-16: ~D~%" (-> obj sync-mask-16)) - (format #t "~1Tsync-mask-32: ~D~%" (-> obj sync-mask-32)) - (format #t "~1Tsync-array[4] @ #x~X~%" (-> obj sync-array)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Talert-state: #~%" (-> obj alert-state)) - (format #t "~1Tlevel-data-array[2] @ #x~X~%" (-> obj level-data-array)) - (format #t "~1Tobject-type-info-array[21] @ #x~X~%" (-> obj object-type-info-array)) - (format #t "~1Ttracker-array[2] @ #x~X~%" (-> obj citizen-tracker-array)) - (format #t "~1Tinactive-object-array[420] @ #x~X~%" (-> obj inactive-object-array)) - (format #t "~1Tsuppressor: #~%" (-> obj suppressor)) - (format #t "~1Tdanger-sphere-count: ~D~%" (-> obj danger-sphere-count)) - (format #t "~1Tdanger-sphere-array[4] @ #x~X~%" (-> obj danger-sphere-array)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tobject-hash: ~A~%" (-> this object-hash)) + (format #t "~1Tmanager: ~D~%" (-> this manager)) + (format #t "~1Tinv-density-factor: ~f~%" (-> this inv-density-factor)) + (format #t "~1Tsync-clock: ~D~%" (-> this sync-clock)) + (format #t "~1Tsync-mask-8: ~D~%" (-> this sync-mask-8)) + (format #t "~1Tsync-mask-16: ~D~%" (-> this sync-mask-16)) + (format #t "~1Tsync-mask-32: ~D~%" (-> this sync-mask-32)) + (format #t "~1Tsync-array[4] @ #x~X~%" (-> this sync-array)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Talert-state: #~%" (-> this alert-state)) + (format #t "~1Tlevel-data-array[2] @ #x~X~%" (-> this level-data-array)) + (format #t "~1Tobject-type-info-array[21] @ #x~X~%" (-> this object-type-info-array)) + (format #t "~1Ttracker-array[2] @ #x~X~%" (-> this citizen-tracker-array)) + (format #t "~1Tinactive-object-array[420] @ #x~X~%" (-> this inactive-object-array)) + (format #t "~1Tsuppressor: #~%" (-> this suppressor)) + (format #t "~1Tdanger-sphere-count: ~D~%" (-> this danger-sphere-count)) + (format #t "~1Tdanger-sphere-array[4] @ #x~X~%" (-> this danger-sphere-array)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc index c8d2f6916d..30ca88c409 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/traffic-engine_REF.gc @@ -39,9 +39,9 @@ ;; definition for method 10 of type vis-cell ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw vis-cell ((obj vis-cell)) - (dotimes (s5-0 (-> obj segment-count)) - (let ((s4-0 (-> obj segment-array s5-0))) +(defmethod debug-draw vis-cell ((this vis-cell)) + (dotimes (s5-0 (-> this segment-count)) + (let ((s4-0 (-> this segment-array s5-0))) (add-debug-line #t (bucket-id debug2) @@ -60,27 +60,27 @@ ;; definition for method 9 of type vis-cell ;; WARN: Return type mismatch int vs none. -(defmethod reset-segment-counts vis-cell ((obj vis-cell)) - (set! (-> obj incoming-segment-count) 0) - (set! (-> obj segment-count) 0) +(defmethod reset-segment-counts vis-cell ((this vis-cell)) + (set! (-> this incoming-segment-count) 0) + (set! (-> this segment-count) 0) 0 (none) ) ;; definition for method 9 of type grid-info ;; WARN: Return type mismatch int vs none. -(defmethod setup-grid-from-bounding-box grid-info ((obj grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int)) +(defmethod setup-grid-from-bounding-box grid-info ((this grid-info) (arg0 (pointer bounding-box)) (arg1 int) (arg2 int)) "Set up a grid which fills the given bounding box" - (mem-copy! (the-as pointer (-> obj box)) arg0 32) + (mem-copy! (the-as pointer (-> this box)) arg0 32) (let ((v1-0 (new 'stack-no-clear 'vector))) (dotimes (a0-2 3) - (set! (-> v1-0 data a0-2) (- (-> obj box max data a0-2) (-> obj box min data a0-2))) + (set! (-> v1-0 data a0-2) (- (-> this box max data a0-2) (-> this box min data a0-2))) ) (let ((f0-5 (sqrtf (/ (the float arg1) (* (-> v1-0 x) (-> v1-0 z) (the float arg2)))))) (let ((a0-6 (min 126 (+ arg1 -1)))) - (set! (-> obj dimension-array 0) (max 1 (min (the int (* f0-5 (-> v1-0 x))) a0-6))) - (set! (-> obj dimension-array 1) arg2) - (set! (-> obj dimension-array 2) (max 1 (min (the int (* f0-5 (-> v1-0 z))) a0-6))) + (set! (-> this dimension-array 0) (max 1 (min (the int (* f0-5 (-> v1-0 x))) a0-6))) + (set! (-> this dimension-array 1) arg2) + (set! (-> this dimension-array 2) (max 1 (min (the int (* f0-5 (-> v1-0 z))) a0-6))) ) (let* ((f1-11 (* f0-5 (-> v1-0 z))) (f1-13 (- f1-11 (the float (the int f1-11)))) @@ -88,21 +88,21 @@ ) (cond ((< f1-13 (- f0-6 (the float (the int f0-6)))) - (if (>= arg1 (* (* (+ (-> obj dimension-array 0) 1) (-> obj dimension-array 1)) (-> obj dimension-array 2))) - (+! (-> obj dimension-array 0) 1) + (if (>= arg1 (* (* (+ (-> this dimension-array 0) 1) (-> this dimension-array 1)) (-> this dimension-array 2))) + (+! (-> this dimension-array 0) 1) ) ) (else - (if (>= arg1 (* (* (-> obj dimension-array 0) (-> obj dimension-array 1)) (+ (-> obj dimension-array 2) 1))) - (+! (-> obj dimension-array 2) 1) + (if (>= arg1 (* (* (-> this dimension-array 0) (-> this dimension-array 1)) (+ (-> this dimension-array 2) 1))) + (+! (-> this dimension-array 2) 1) ) ) ) ) ) (dotimes (a0-24 3) - (set! (-> obj axis-scale a0-24) (/ (the float (-> obj dimension-array a0-24)) (-> v1-0 data a0-24))) - (set! (-> obj cell-size data a0-24) (/ (-> v1-0 data a0-24) (the float (-> obj dimension-array a0-24)))) + (set! (-> this axis-scale a0-24) (/ (the float (-> this dimension-array a0-24)) (-> v1-0 data a0-24))) + (set! (-> this cell-size data a0-24) (/ (-> v1-0 data a0-24) (the float (-> this dimension-array a0-24)))) ) ) 0 @@ -111,25 +111,25 @@ ;; definition for method 10 of type grid-info ;; WARN: Return type mismatch int vs none. -(defmethod lookup-cell-for-point grid-info ((obj grid-info) (arg0 vis-grid-pos) (arg1 vector)) +(defmethod lookup-cell-for-point grid-info ((this grid-info) (arg0 vis-grid-pos) (arg1 vector)) "Get the grid cell containing the point (or closest, if outside the grid)" - (set! (-> arg0 x) - (max - 0 - (min (the int (* (- (-> arg1 x) (-> obj box min x)) (-> obj axis-scale 0))) (+ (-> obj dimension-array 0) -1)) - ) + (set! (-> arg0 x) (max 0 (min + (the int (* (- (-> arg1 x) (-> this box min x)) (-> this axis-scale 0))) + (+ (-> this dimension-array 0) -1) + ) + ) ) - (set! (-> arg0 y) - (max - 0 - (min (the int (* (- (-> arg1 y) (-> obj box min y)) (-> obj axis-scale 1))) (+ (-> obj dimension-array 1) -1)) - ) + (set! (-> arg0 y) (max 0 (min + (the int (* (- (-> arg1 y) (-> this box min y)) (-> this axis-scale 1))) + (+ (-> this dimension-array 1) -1) + ) + ) ) - (set! (-> arg0 z) - (max - 0 - (min (the int (* (- (-> arg1 z) (-> obj box min z)) (-> obj axis-scale 2))) (+ (-> obj dimension-array 2) -1)) - ) + (set! (-> arg0 z) (max 0 (min + (the int (* (- (-> arg1 z) (-> this box min z)) (-> this axis-scale 2))) + (+ (-> this dimension-array 2) -1) + ) + ) ) 0 (none) @@ -137,7 +137,7 @@ ;; definition for method 11 of type grid-info ;; WARN: Return type mismatch int vs none. -(defmethod lookup-box-for-sphere grid-info ((obj grid-info) (arg0 vis-grid-box) (arg1 vector)) +(defmethod lookup-box-for-sphere grid-info ((this grid-info) (arg0 vis-grid-box) (arg1 vector)) "Get the box of cells containing the given sphere" (rlet ((vf0 :class vf) (vf4 :class vf) @@ -168,8 +168,8 @@ (.add.x.vf vf5 vf4 vf6 :mask #b111) (.svf (&-> a0-2 quad) vf5) ) - (lookup-cell-for-point obj (-> arg0 min) (-> s5-0 min)) - (lookup-cell-for-point obj (-> arg0 max) (-> s5-0 max)) + (lookup-cell-for-point this (-> arg0 min) (-> s5-0 min)) + (lookup-cell-for-point this (-> arg0 max) (-> s5-0 max)) ) 0 (none) @@ -178,14 +178,14 @@ ;; definition for method 13 of type grid-info ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-cell grid-info ((obj grid-info) (arg0 vis-grid-pos) (arg1 rgba)) +(defmethod debug-draw-cell grid-info ((this grid-info) (arg0 vis-grid-pos) (arg1 rgba)) (let ((v1-0 (new 'stack-no-clear 'bounding-box))) (dotimes (a3-0 3) (set! (-> v1-0 min data a3-0) - (+ (-> obj box min data a3-0) (* (the float (-> arg0 data a3-0)) (-> obj cell-size data a3-0))) + (+ (-> this box min data a3-0) (* (the float (-> arg0 data a3-0)) (-> this cell-size data a3-0))) ) ) - (vector+! (-> v1-0 max) (-> v1-0 min) (-> obj cell-size)) + (vector+! (-> v1-0 max) (-> v1-0 min) (-> this cell-size)) (add-debug-box #t (bucket-id debug2) (-> v1-0 min) (-> v1-0 max) arg1) ) 0 @@ -194,19 +194,19 @@ ;; definition for method 12 of type grid-info ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-grid grid-info ((obj grid-info) (arg0 rgba)) - (draw-grid (the-as vector (-> obj box)) (-> obj box max) (-> obj dimension-array) arg0) +(defmethod debug-draw-grid grid-info ((this grid-info) (arg0 rgba)) + (draw-grid (the-as vector (-> this box)) (-> this box max) (-> this dimension-array) arg0) 0 (none) ) ;; definition for method 9 of type traffic-suppression-params -(defmethod try-creating-new-suppression-box traffic-suppression-params ((obj traffic-suppression-params)) +(defmethod try-creating-new-suppression-box traffic-suppression-params ((this traffic-suppression-params)) "Try getting new suppression box, return if it succeeded. ID is stored in the params." (cond - ((= (-> obj id) -1) - (send-event *traffic-manager* 'new-suppression-box obj) - (!= (-> obj id) -1) + ((= (-> this id) -1) + (send-event *traffic-manager* 'new-suppression-box this) + (!= (-> this id) -1) ) (else #t @@ -215,15 +215,15 @@ ) ;; definition for method 10 of type traffic-suppression-params -(defmethod create-or-update-suppression-box traffic-suppression-params ((obj traffic-suppression-params)) +(defmethod create-or-update-suppression-box traffic-suppression-params ((this traffic-suppression-params)) "If the params are already associated with a box, update. Otherwise, attempt to create a new one." (cond - ((= (-> obj id) -1) - (send-event *traffic-manager* 'new-suppression-box obj) - (!= (-> obj id) -1) + ((= (-> this id) -1) + (send-event *traffic-manager* 'new-suppression-box this) + (!= (-> this id) -1) ) (else - (send-event *traffic-manager* 'update-suppression-box obj) + (send-event *traffic-manager* 'update-suppression-box this) #t ) ) @@ -231,26 +231,26 @@ ;; definition for method 12 of type traffic-suppression-params ;; WARN: Return type mismatch int vs none. -(defmethod kill-suppression-box traffic-suppression-params ((obj traffic-suppression-params)) +(defmethod kill-suppression-box traffic-suppression-params ((this traffic-suppression-params)) "Kill a suppression box, and inform the traffic manager by setting duration to 0." - (when (!= (-> obj id) -1) - (let ((s5-0 (-> obj duration))) - (set! (-> obj duration) 0) - (send-event *traffic-manager* 'update-suppression-box obj) - (set! (-> obj duration) s5-0) + (when (!= (-> this id) -1) + (let ((s5-0 (-> this duration))) + (set! (-> this duration) 0) + (send-event *traffic-manager* 'update-suppression-box this) + (set! (-> this duration) s5-0) ) - (set! (-> obj id) -1) + (set! (-> this id) -1) ) (none) ) ;; definition for method 9 of type traffic-suppressor ;; WARN: Return type mismatch int vs none. -(defmethod reset-boxes traffic-suppressor ((obj traffic-suppressor)) +(defmethod reset-boxes traffic-suppressor ((this traffic-suppressor)) "Clears some flags, mark all boxes as disabled." - (logclear! (-> obj flags) (traffic-suppression-flags tfs0 needs-update)) + (logclear! (-> this flags) (traffic-suppression-flags tfs0 needs-update)) (dotimes (v1-2 16) - (let ((a1-3 (-> obj array v1-2))) + (let ((a1-3 (-> this array v1-2))) (logclear! (-> a1-3 flags) (traffic-suppression-box-flags in-use tfsb1)) ) ) @@ -260,19 +260,19 @@ ;; definition for method 10 of type traffic-suppressor ;; WARN: Return type mismatch int vs none. -(defmethod add-new-supression-box traffic-suppressor ((obj traffic-suppressor) (arg0 traffic-suppression-params)) +(defmethod add-new-supression-box traffic-suppressor ((this traffic-suppressor) (arg0 traffic-suppression-params)) "Create a suppression box for these params. The param object is updated with the ID of the box and can be later used with update-box-from-params." (set! (-> arg0 id) -1) (let ((v1-1 0)) (b! #t cfg-4 :delay (nop!)) (label cfg-1) - (let ((a2-2 (-> obj array v1-1))) + (let ((a2-2 (-> this array v1-1))) (b! (logtest? (-> a2-2 flags) (traffic-suppression-box-flags in-use)) cfg-3 :delay (empty-form)) (set! (-> arg0 id) v1-1) (set! (-> a2-2 flags) (traffic-suppression-box-flags in-use)) ) - (update-box-from-params obj arg0) + (update-box-from-params this arg0) (b! #t cfg-6 :delay (nop!)) (label cfg-3) (+! v1-1 1) @@ -286,11 +286,11 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 11 of type traffic-suppressor ;; WARN: Return type mismatch int vs none. -(defmethod remove-box-by-id traffic-suppressor ((obj traffic-suppressor) (arg0 int)) +(defmethod remove-box-by-id traffic-suppressor ((this traffic-suppressor) (arg0 int)) "Remove a box that was previously added, by its ID." (when (!= arg0 -1) - (logior! (-> obj flags) (traffic-suppression-flags needs-update)) - (let ((v1-6 (-> obj array arg0))) + (logior! (-> this flags) (traffic-suppression-flags needs-update)) + (let ((v1-6 (-> this array arg0))) (logclear! (-> v1-6 flags) (traffic-suppression-box-flags in-use)) ) ) @@ -300,12 +300,12 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 12 of type traffic-suppressor ;; WARN: Return type mismatch int vs none. -(defmethod update-box-from-params traffic-suppressor ((obj traffic-suppressor) (arg0 traffic-suppression-params)) +(defmethod update-box-from-params traffic-suppressor ((this traffic-suppressor) (arg0 traffic-suppression-params)) "Update a box that was previously added" (let ((v1-0 (-> arg0 id))) (when (!= v1-0 -1) - (logior! (-> obj flags) (traffic-suppression-flags needs-update)) - (let* ((s5-0 (-> obj array v1-0)) + (logior! (-> this flags) (traffic-suppression-flags needs-update)) + (let* ((s5-0 (-> this array v1-0)) (s4-1 (logior (-> s5-0 flags) (traffic-suppression-box-flags tfsb1))) ) (mem-copy! (the-as pointer (-> s5-0 bbox)) (the-as pointer (-> arg0 bbox)) 32) @@ -321,12 +321,12 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 13 of type traffic-suppressor ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw traffic-suppressor ((obj traffic-suppressor)) +(defmethod debug-draw traffic-suppressor ((this traffic-suppressor)) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) (new 'stack-no-clear 'vector4w) (let ((s4-0 *color-red*)) (dotimes (s3-0 16) - (let ((v1-3 (-> obj array s3-0))) + (let ((v1-3 (-> this array s3-0))) (when (logtest? (-> v1-3 flags) (traffic-suppression-box-flags in-use)) (set! (-> s5-0 min quad) (-> v1-3 bbox min quad)) (set! (-> s5-0 max quad) (-> v1-3 bbox max quad)) @@ -344,12 +344,12 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 25 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod for-all-active-processes traffic-tracker ((obj traffic-tracker) (arg0 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes traffic-tracker ((this traffic-tracker) (arg0 (function process-focusable traffic-object-type-info none))) "Call the given function on all active processes." - (let ((s4-0 (-> obj traffic))) - (countdown (s3-0 (-> obj active-object-count)) - (let ((a1-1 (-> s4-0 object-type-info-array (-> obj active-object-type-list s3-0))) - (a0-2 (handle->process (-> obj active-object-list s3-0))) + (let ((s4-0 (-> this traffic))) + (countdown (s3-0 (-> this active-object-count)) + (let ((a1-1 (-> s4-0 object-type-info-array (-> this active-object-type-list s3-0))) + (a0-2 (handle->process (-> this active-object-list s3-0))) ) (if (not (focus-test? (the-as process-focusable a0-2) inactive)) (arg0 (the-as process-focusable a0-2) a1-1) @@ -363,14 +363,14 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 26 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod for-all-active-processes-of-type traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes-of-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 (function process-focusable traffic-object-type-info none))) "Call the given function on all active processes matching the given type." - (let ((s3-0 (-> obj traffic))) - (countdown (s2-0 (-> obj active-object-count)) - (let ((a0-1 (-> obj active-object-type-list s2-0))) + (let ((s3-0 (-> this traffic))) + (countdown (s2-0 (-> this active-object-count)) + (let ((a0-1 (-> this active-object-type-list s2-0))) (when (= a0-1 arg0) (let ((a1-1 (-> s3-0 object-type-info-array a0-1)) - (a0-3 (handle->process (-> obj active-object-list s2-0))) + (a0-3 (handle->process (-> this active-object-list s2-0))) ) (if (not (focus-test? (the-as process-focusable a0-3) inactive)) (arg1 (the-as process-focusable a0-3) a1-1) @@ -386,14 +386,14 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 12 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod add-active-process traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod add-active-process traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Add a process as active." - (let ((v1-0 (-> obj active-object-count))) + (let ((v1-0 (-> this active-object-count))) (when (< v1-0 (the-as uint 126)) - (set! (-> obj active-object-list v1-0) arg1) - (set! (-> obj active-object-type-list v1-0) arg0) - (+! (-> obj active-object-count) 1) - (let ((v1-6 (-> obj traffic object-type-info-array arg0))) + (set! (-> this active-object-list v1-0) arg1) + (set! (-> this active-object-type-list v1-0) arg0) + (+! (-> this active-object-count) 1) + (let ((v1-6 (-> this traffic object-type-info-array arg0))) (+! (-> v1-6 active-count) 1) ) ) @@ -403,17 +403,17 @@ The param object is updated with the ID of the box and can be later used with up ) ;; definition for method 13 of type traffic-tracker -(defmethod remove-active-process traffic-tracker ((obj traffic-tracker) (arg0 int)) +(defmethod remove-active-process traffic-tracker ((this traffic-tracker) (arg0 int)) "Remove a process from the tracking list." - (let ((v0-0 (-> obj active-object-list arg0))) - (let ((v1-3 (-> obj active-object-type-list arg0)) - (a2-1 (+ (-> obj active-object-count) -1)) + (let ((v0-0 (-> this active-object-list arg0))) + (let ((v1-3 (-> this active-object-type-list arg0)) + (a2-1 (+ (-> this active-object-count) -1)) ) (when (>= a2-1 0) - (set! (-> obj active-object-list arg0) (-> obj active-object-list a2-1)) - (set! (-> obj active-object-type-list arg0) (-> obj active-object-type-list a2-1)) - (+! (-> obj active-object-count) -1) - (let ((v1-6 (-> obj traffic object-type-info-array v1-3))) + (set! (-> this active-object-list arg0) (-> this active-object-list a2-1)) + (set! (-> this active-object-type-list arg0) (-> this active-object-type-list a2-1)) + (+! (-> this active-object-count) -1) + (let ((v1-6 (-> this traffic object-type-info-array v1-3))) (+! (-> v1-6 active-count) -1) ) ) @@ -424,16 +424,16 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 14 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod add-reserved-process traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod add-reserved-process traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Add a process to the reserve list for a type. This process is allocated, but not yet activated." - (let* ((v1-2 (-> obj traffic object-type-info-array arg0)) + (let* ((v1-2 (-> this traffic object-type-info-array arg0)) (a1-2 (-> v1-2 inactive-count)) ) (when (< a1-2 20) (set! (-> v1-2 array a1-2) arg1) (+! (-> v1-2 inactive-count) 1) (+! (-> v1-2 reserve-count) 1) - (+! (-> obj inactive-object-count) 1) + (+! (-> this inactive-object-count) 1) ) ) 0 @@ -441,9 +441,9 @@ The param object is updated with the ID of the box and can be later used with up ) ;; definition for method 15 of type traffic-tracker -(defmethod get-from-inactive-by-type traffic-tracker ((obj traffic-tracker) (arg0 traffic-type)) +(defmethod get-from-inactive-by-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type)) "Get any handle from the inactive list of this type, and remove it from the list." - (let ((v1-2 (-> obj traffic object-type-info-array arg0)) + (let ((v1-2 (-> this traffic object-type-info-array arg0)) (a1-2 0) (v0-0 (the-as handle #f)) ) @@ -453,7 +453,7 @@ The param object is updated with the ID of the box and can be later used with up (set! (-> v1-2 array a1-2) (-> v1-2 array a2-1)) (+! (-> v1-2 inactive-count) -1) (+! (-> v1-2 reserve-count) -1) - (+! (-> obj inactive-object-count) -1) + (+! (-> this inactive-object-count) -1) ) ) v0-0 @@ -461,9 +461,9 @@ The param object is updated with the ID of the box and can be later used with up ) ;; definition for method 16 of type traffic-tracker -(defmethod get-from-inactive-by-handle traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 handle)) +(defmethod get-from-inactive-by-handle traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 handle)) "Remove the given handle from the inactive list of the given type." - (let ((v1-2 (-> obj traffic object-type-info-array arg0)) + (let ((v1-2 (-> this traffic object-type-info-array arg0)) (v0-0 (the-as handle #f)) ) (let* ((a3-0 (+ (-> v1-2 inactive-count) -1)) @@ -476,7 +476,7 @@ The param object is updated with the ID of the box and can be later used with up (set! v0-0 (-> v1-2 array a1-3)) (set! (-> v1-2 array a1-3) (-> v1-2 array a3-0)) (+! (-> v1-2 inactive-count) -1) - (+! (-> obj inactive-object-count) -1) + (+! (-> this inactive-object-count) -1) ) ) v0-0 @@ -485,13 +485,13 @@ The param object is updated with the ID of the box and can be later used with up ;; definition for method 17 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-object traffic-tracker ((obj traffic-tracker) (arg0 int) (arg1 symbol)) +(defmethod deactivate-object traffic-tracker ((this traffic-tracker) (arg0 int) (arg1 symbol)) "Send a traffic-off event (or traffic-off-force) to deactivate an object, specified by index in active object array. Process is recycled and moved to reserved, if it deactivates." (with-pp - (let* ((s3-0 (-> obj active-object-type-list arg0)) + (let* ((s3-0 (-> this active-object-type-list arg0)) (gp-0 'traffic-off) - (s2-0 (remove-active-process obj arg0)) + (s2-0 (remove-active-process this arg0)) (s1-0 (handle->process s2-0)) (v1-5 (the-as object #t)) ) @@ -509,10 +509,10 @@ Process is recycled and moved to reserved, if it deactivates." ) (cond (v1-5 - (add-reserved-process obj s3-0 s2-0) + (add-reserved-process this s3-0 s2-0) ) (else - (add-active-process obj s3-0 s2-0) + (add-active-process this s3-0 s2-0) (when *debug-segment* (when arg1 (format 0 "traffic-engine::deactivate-object: ~s event refused~%" gp-0) @@ -530,7 +530,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 18 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod set-process-to-killed traffic-tracker ((obj traffic-tracker) (arg0 process)) +(defmethod set-process-to-killed traffic-tracker ((this traffic-tracker) (arg0 process)) "Move from active to killed. Separate from reserve." (let ((v1-0 -1)) (let ((a0-1 (process->ppointer arg0))) @@ -541,12 +541,12 @@ Process is recycled and moved to reserved, if it deactivates." (set! a1-3 (new 'static 'handle)) (label cfg-5) (let ((a0-3 (logior a1-3 (new 'static 'handle :process a0-1))) - (a1-4 (-> obj active-object-count)) + (a1-4 (-> this active-object-count)) ) (b! #t cfg-8 :delay (nop!)) (label cfg-6) (+! a1-4 -1) - (b! (!= (-> obj active-object-list a1-4) a0-3) cfg-8 :delay (empty-form)) + (b! (!= (-> this active-object-list a1-4) a0-3) cfg-8 :delay (empty-form)) (set! v1-0 (the-as int a1-4)) (b! #t cfg-10 :delay (nop!)) (label cfg-8) @@ -556,11 +556,11 @@ Process is recycled and moved to reserved, if it deactivates." ) (label cfg-10) (when (!= v1-0 -1) - (let ((s5-0 (-> obj active-object-type-list v1-0))) - (let ((a2-4 (remove-active-process obj v1-0))) - (add-reserved-process obj s5-0 a2-4) + (let ((s5-0 (-> this active-object-type-list v1-0))) + (let ((a2-4 (remove-active-process this v1-0))) + (add-reserved-process this s5-0 a2-4) ) - (let ((v1-5 (-> obj traffic object-type-info-array s5-0))) + (let ((v1-5 (-> this traffic object-type-info-array s5-0))) (+! (-> v1-5 killed-count) 1) (+! (-> v1-5 reserve-count) -1) ) @@ -574,11 +574,11 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 20 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-all-of-type traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 symbol)) +(defmethod deactivate-all-of-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 symbol)) "Deactivate all processes of given type" - (countdown (s3-0 (-> obj active-object-count)) - (if (= (-> obj active-object-type-list s3-0) arg0) - (deactivate-object obj (the-as int s3-0) arg1) + (countdown (s3-0 (-> this active-object-count)) + (if (= (-> this active-object-type-list s3-0) arg0) + (deactivate-object this (the-as int s3-0) arg1) ) ) 0 @@ -587,10 +587,10 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 19 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-all traffic-tracker ((obj traffic-tracker) (arg0 symbol)) +(defmethod deactivate-all traffic-tracker ((this traffic-tracker) (arg0 symbol)) "Deactivate all processes that are tracked" - (countdown (s4-0 (-> obj active-object-count)) - (deactivate-object obj (the-as int s4-0) arg0) + (countdown (s4-0 (-> this active-object-count)) + (deactivate-object this (the-as int s4-0) arg0) ) 0 (none) @@ -598,24 +598,24 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 21 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod activate-from-params traffic-tracker ((obj traffic-tracker) (arg0 traffic-object-spawn-params)) +(defmethod activate-from-params traffic-tracker ((this traffic-tracker) (arg0 traffic-object-spawn-params)) "Get a reserved process, and activate with the given params." (local-vars (sv-16 handle)) (let ((gp-0 (-> arg0 object-type))) (set! (-> arg0 proc) #f) - (let ((v1-2 (-> obj traffic object-type-info-array gp-0))) + (let ((v1-2 (-> this traffic object-type-info-array gp-0))) (when (and (> (-> v1-2 inactive-count) 0) (> (-> v1-2 reserve-count) 0)) - (set! sv-16 (get-from-inactive-by-type obj gp-0)) + (set! sv-16 (get-from-inactive-by-type this gp-0)) (let ((s3-0 (handle->process sv-16))) (when s3-0 (cond - ((send-event s3-0 'traffic-activate arg0 (-> obj traffic)) + ((send-event s3-0 'traffic-activate arg0 (-> this traffic)) (set! (-> arg0 proc) s3-0) - (add-active-process obj gp-0 sv-16) + (add-active-process this gp-0 sv-16) 0 ) (else - (add-reserved-process obj gp-0 sv-16) + (add-reserved-process this gp-0 sv-16) ) ) ) @@ -630,16 +630,16 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 22 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod activate-by-type traffic-tracker ((obj traffic-tracker) (arg0 traffic-type) (arg1 nav-segment) (arg2 float)) +(defmethod activate-by-type traffic-tracker ((this traffic-tracker) (arg0 traffic-type) (arg1 nav-segment) (arg2 float)) "If possible, activate a process of the given type." - (let ((v1-2 (-> obj traffic object-type-info-array arg0))) + (let ((v1-2 (-> this traffic object-type-info-array arg0))) (when (and (> (-> v1-2 inactive-count) 0) (> (-> v1-2 reserve-count) 0) (< (-> v1-2 active-count) (-> v1-2 target-count)) (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-2)) (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-3)) (or (not (logtest? (-> v1-2 flags) (traffic-type-flags trtflags-0))) - (not (logtest? (-> obj traffic alert-state flags) (traffic-alert-flag alert-ending))) + (not (logtest? (-> this traffic alert-state flags) (traffic-alert-flag alert-ending))) ) ) (let ((s4-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params))) @@ -663,12 +663,13 @@ Process is recycled and moved to reserved, if it deactivates." (+! (-> s4-0 params position z) (* (-> s4-0 vector 0 x) f0-6)) ) ) - (set! (-> s4-0 vector 2 y) - (+ (* 0.5 (-> s4-0 vector 2 x)) (* (-> obj rand) (-> obj traffic inv-density-factor) (-> arg1 spawn-spacing))) + (set! (-> s4-0 vector 2 y) (+ (* 0.5 (-> s4-0 vector 2 x)) + (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing)) + ) ) (vector-float*! (-> s4-0 params velocity) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 x)) (vector-float*! (-> s4-0 vector 1) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 y)) - (when (not (sphere-hash-method-32 (-> obj object-hash) (-> s4-0 params position) (-> s4-0 vector 1) 20480.0 -1)) + (when (not (sphere-hash-method-32 (-> this object-hash) (-> s4-0 params position) (-> s4-0 vector 1) 20480.0 -1)) (set! (-> s4-0 params behavior) (the-as uint 2)) (set! (-> s4-0 params nav-mesh) #f) (-> arg1 nav-mesh-id) @@ -680,8 +681,8 @@ Process is recycled and moved to reserved, if it deactivates." (the-as vector (-> s4-0 vector)) (new 'static 'vector :y 1.0 :w 1.0) ) - (set! (-> obj rand) (rand-vu)) - (activate-from-params obj (-> s4-0 params)) + (set! (-> this rand) (rand-vu)) + (activate-from-params this (-> s4-0 params)) ) ) ) @@ -692,23 +693,23 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 23 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod activate-by-handle traffic-tracker ((obj traffic-tracker) (arg0 traffic-object-spawn-params)) +(defmethod activate-by-handle traffic-tracker ((this traffic-tracker) (arg0 traffic-object-spawn-params)) "Activate, using the handle in the params." (local-vars (sv-16 handle)) (let ((gp-0 (-> arg0 object-type))) (set! (-> arg0 proc) #f) - (when (> (-> obj traffic object-type-info-array gp-0 inactive-count) 0) - (set! sv-16 (get-from-inactive-by-handle obj gp-0 (-> arg0 handle))) + (when (> (-> this traffic object-type-info-array gp-0 inactive-count) 0) + (set! sv-16 (get-from-inactive-by-handle this gp-0 (-> arg0 handle))) (let ((s3-0 (handle->process sv-16))) (when s3-0 (cond - ((send-event s3-0 'traffic-activate arg0 (-> obj traffic)) + ((send-event s3-0 'traffic-activate arg0 (-> this traffic)) (set! (-> arg0 proc) s3-0) - (add-active-process obj gp-0 sv-16) + (add-active-process this gp-0 sv-16) 0 ) (else - (add-reserved-process obj gp-0 sv-16) + (add-reserved-process this gp-0 sv-16) ) ) ) @@ -722,54 +723,54 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 9 of type traffic-level-data ;; WARN: Return type mismatch int vs none. -(defmethod reset traffic-level-data ((obj traffic-level-data)) - (set! (-> obj city-info) (the-as city-level-info 0)) - (set! (-> obj active-cell-count) (the-as uint 0)) - (set! (-> obj newly-active-cell-count) (the-as uint 0)) +(defmethod reset traffic-level-data ((this traffic-level-data)) + (set! (-> this city-info) (the-as city-level-info 0)) + (set! (-> this active-cell-count) (the-as uint 0)) + (set! (-> this newly-active-cell-count) (the-as uint 0)) 0 (none) ) ;; definition for method 24 of type traffic-tracker ;; WARN: Return type mismatch int vs none. -(defmethod reset traffic-tracker ((obj traffic-tracker) (arg0 uint) (arg1 traffic-engine)) - (set! (-> obj traffic) arg1) - (set! (-> obj object-hash) (-> arg1 object-hash)) - (set! (-> obj rand) 0.5) - (set! (-> obj id) arg0) - (set! (-> obj active-object-count) (the-as uint 0)) - (set! (-> obj inactive-object-count) 0) +(defmethod reset traffic-tracker ((this traffic-tracker) (arg0 uint) (arg1 traffic-engine)) + (set! (-> this traffic) arg1) + (set! (-> this object-hash) (-> arg1 object-hash)) + (set! (-> this rand) 0.5) + (set! (-> this id) arg0) + (set! (-> this active-object-count) (the-as uint 0)) + (set! (-> this inactive-object-count) 0) 0 (none) ) ;; definition for method 9 of type traffic-alert-state ;; WARN: Return type mismatch int vs none. -(defmethod reset traffic-alert-state ((obj traffic-alert-state)) - (set! (-> obj flags) (traffic-alert-flag)) - (set! (-> obj level) (the-as uint 0)) - (set! (-> obj duration) (the-as uint 9000)) - (set! (-> obj alarm-sound-id) (new-sound-id)) - (set! (-> obj guard-inaccuracy-factor) 1.0) +(defmethod reset traffic-alert-state ((this traffic-alert-state)) + (set! (-> this flags) (traffic-alert-flag)) + (set! (-> this level) (the-as uint 0)) + (set! (-> this duration) (the-as uint 9000)) + (set! (-> this alarm-sound-id) (new-sound-id)) + (set! (-> this guard-inaccuracy-factor) 1.0) (dotimes (v1-2 3) - (let ((a0-4 (-> obj target-status-array v1-2))) + (let ((a0-4 (-> this target-status-array v1-2))) (set! (-> a0-4 flags) (traffic-target-flag)) (set! (-> a0-4 handle) (the-as handle #f)) ) ) - (set! (-> obj guard-type-info-array 0 object-type) (traffic-type crimson-guard-1)) - (set! (-> obj guard-type-info-array 1 object-type) (traffic-type crimson-guard-1)) - (set! (-> obj guard-type-info-array 2 object-type) (traffic-type crimson-guard-1)) - (set! (-> obj guard-type-info-array 3 object-type) (traffic-type crimson-guard-2)) - (set! (-> obj guard-type-info-array 4 object-type) (traffic-type guard-bike)) - (set! (-> obj guard-type-info-array 5 object-type) (traffic-type hellcat)) + (set! (-> this guard-type-info-array 0 object-type) (traffic-type crimson-guard-1)) + (set! (-> this guard-type-info-array 1 object-type) (traffic-type crimson-guard-1)) + (set! (-> this guard-type-info-array 2 object-type) (traffic-type crimson-guard-1)) + (set! (-> this guard-type-info-array 3 object-type) (traffic-type crimson-guard-2)) + (set! (-> this guard-type-info-array 4 object-type) (traffic-type guard-bike)) + (set! (-> this guard-type-info-array 5 object-type) (traffic-type hellcat)) (dotimes (v1-11 21) - (set! (-> obj guard-type-mask-from-object-type v1-11) (the-as uint 0)) + (set! (-> this guard-type-mask-from-object-type v1-11) (the-as uint 0)) ) (dotimes (v1-14 6) - (let ((a0-10 (-> obj guard-type-info-array v1-14 object-type))) - (set! (-> obj guard-type-mask-from-object-type a0-10) - (the-as uint (logior (ash 1 v1-14) (-> obj guard-type-mask-from-object-type a0-10))) + (let ((a0-10 (-> this guard-type-info-array v1-14 object-type))) + (set! (-> this guard-type-mask-from-object-type a0-10) + (the-as uint (logior (ash 1 v1-14) (-> this guard-type-mask-from-object-type a0-10))) ) ) ) @@ -780,15 +781,15 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 10 of type traffic-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod reset-and-init-from-manager traffic-engine ((obj traffic-engine) (arg0 process)) +(defmethod reset-and-init-from-manager traffic-engine ((this traffic-engine) (arg0 process)) "Reset the traffic engine" - (set! (-> obj manager) (process->handle arg0)) - (set! (-> obj flags) (the-as uint 0)) - (set! (-> obj danger-sphere-count) 0) + (set! (-> this manager) (process->handle arg0)) + (set! (-> this flags) (the-as uint 0)) + (set! (-> this danger-sphere-count) 0) (set! (-> *game-info* wanted-flash) #f) - (let ((v1-4 (-> obj inactive-object-array))) + (let ((v1-4 (-> this inactive-object-array))) (dotimes (a0-5 21) - (let ((a1-3 (-> obj object-type-info-array a0-5))) + (let ((a1-3 (-> this object-type-info-array a0-5))) (set! (-> a1-3 flags) (traffic-type-flags trtflags-1 trtflags-2)) (set! (-> a1-3 inactive-count) 0) (set! (-> a1-3 active-count) 0) @@ -801,26 +802,26 @@ Process is recycled and moved to reserved, if it deactivates." (set! v1-4 (&-> v1-4 20)) ) ) - (set! (-> obj object-type-info-array 6 guard-type) (the-as uint 0)) - (set! (-> obj object-type-info-array 20 level) 'ctywide) + (set! (-> this object-type-info-array 6 guard-type) (the-as uint 0)) + (set! (-> this object-type-info-array 20 level) 'ctywide) (let ((v1-8 11)) (dotimes (a0-6 10) - (set! (-> obj object-type-info-array v1-8 tracker-index) (the-as uint 0)) + (set! (-> this object-type-info-array v1-8 tracker-index) (the-as uint 0)) (+! v1-8 1) ) ) (let ((v1-11 0)) (dotimes (a0-7 11) - (set! (-> obj object-type-info-array v1-11 tracker-index) (the-as uint 1)) + (set! (-> this object-type-info-array v1-11 tracker-index) (the-as uint 1)) (+! v1-11 1) ) ) (dotimes (s5-0 2) - (reset (-> obj tracker-array s5-0) (the-as uint s5-0) obj) + (reset (-> this tracker-array s5-0) (the-as uint s5-0) this) ) - (reset-boxes (-> obj suppressor)) - (set! (-> obj object-hash object-count) 0) - (let* ((v1-24 (-> obj object-hash)) + (reset-boxes (-> this suppressor)) + (set! (-> this object-hash object-count) 0) + (let* ((v1-24 (-> this object-hash)) (a0-15 (/ (+ (* (* (* (-> v1-24 dimension-array 0) (-> v1-24 dimension-array 1)) (-> v1-24 dimension-array 2)) (-> v1-24 bucket-size) @@ -840,31 +841,31 @@ Process is recycled and moved to reserved, if it deactivates." ) 0 (dotimes (s5-1 2) - (reset (-> obj level-data-array s5-1)) + (reset (-> this level-data-array s5-1)) ) (dotimes (s5-2 (-> *level* length)) (let ((a1-12 (-> *level* level s5-2))) (if (= (-> a1-12 status) 'active) - (level-link obj a1-12) + (level-link this a1-12) ) ) ) - (reset (-> obj alert-state)) + (reset (-> this alert-state)) 0 (none) ) ;; definition for method 11 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod stop-alarm-sound traffic-engine ((obj traffic-engine)) - (sound-stop (-> obj alert-state alarm-sound-id)) +(defmethod stop-alarm-sound traffic-engine ((this traffic-engine)) + (sound-stop (-> this alert-state alarm-sound-id)) 0 (none) ) ;; definition for method 61 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod level-link traffic-engine ((obj traffic-engine) (arg0 level)) +(defmethod level-link traffic-engine ((this traffic-engine) (arg0 level)) "Call after loading a level to patch the data in the bsp" (format #t "traffic-engine: level birth ~S~%" (-> arg0 nickname)) (cond @@ -949,7 +950,7 @@ Process is recycled and moved to reserved, if it deactivates." ) (let ((s4-1 (the-as traffic-level-data #f))) (dotimes (v1-31 2) - (let ((a0-34 (-> obj level-data-array v1-31))) + (let ((a0-34 (-> this level-data-array v1-31))) (if (zero? (-> a0-34 city-info)) (set! s4-1 a0-34) ) @@ -998,11 +999,11 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 62 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod level-unlink traffic-engine ((obj traffic-engine) (arg0 level)) +(defmethod level-unlink traffic-engine ((this traffic-engine) (arg0 level)) "Call after removing a level. Kills processes and unlinks nav" (let ((s4-0 (-> arg0 bsp city-level-info nav-graph))) (dotimes (v1-2 2) - (let ((a0-4 (-> obj level-data-array v1-2))) + (let ((a0-4 (-> this level-data-array v1-2))) (when (= (-> a0-4 city-info) (-> arg0 bsp city-level-info)) (set! (-> a0-4 city-info) (the-as city-level-info 0)) 0 @@ -1043,16 +1044,16 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (deactivate-all-from-level obj (-> arg0 name)) + (deactivate-all-from-level this (-> arg0 name)) 0 (none) ) ;; definition for method 51 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod for-all-active-processes traffic-engine ((obj traffic-engine) (arg0 (function process-focusable traffic-object-type-info none))) +(defmethod for-all-active-processes traffic-engine ((this traffic-engine) (arg0 (function process-focusable traffic-object-type-info none))) (dotimes (s4-0 2) - (for-all-active-processes (-> obj tracker-array s4-0) arg0) + (for-all-active-processes (-> this tracker-array s4-0) arg0) ) 0 (none) @@ -1060,9 +1061,9 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 13 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod add-object traffic-engine ((obj traffic-engine) (arg0 traffic-type) (arg1 process)) +(defmethod add-object traffic-engine ((this traffic-engine) (arg0 traffic-type) (arg1 process)) (add-reserved-process - (-> obj tracker-array (-> obj object-type-info-array arg0 tracker-index)) + (-> this tracker-array (-> this object-type-info-array arg0 tracker-index)) arg0 (process->handle arg1) ) @@ -1072,14 +1073,14 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 18 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod child-killed traffic-engine ((obj traffic-engine) (arg0 process)) +(defmethod child-killed traffic-engine ((this traffic-engine) (arg0 process)) "handle killing a child process" (cond ((type? arg0 citizen) - (set-process-to-killed (-> obj vehicle-tracker-array) arg0) + (set-process-to-killed (-> this vehicle-tracker-array) arg0) ) ((type? arg0 vehicle) - (set-process-to-killed (-> obj citizen-tracker-array) arg0) + (set-process-to-killed (-> this citizen-tracker-array) arg0) ) (else 0 @@ -1091,9 +1092,9 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 15 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod activate-one-citizen traffic-engine ((obj traffic-engine) (arg0 nav-segment) (arg1 float)) +(defmethod activate-one-citizen traffic-engine ((this traffic-engine) (arg0 nav-segment) (arg1 float)) (let ((a1-1 (+ (rand-vu-int-count 10) 11))) - (activate-by-type (-> obj citizen-tracker-array) (the-as traffic-type a1-1) arg0 arg1) + (activate-by-type (-> this citizen-tracker-array) (the-as traffic-type a1-1) arg0 arg1) ) 0 (none) @@ -1101,15 +1102,15 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 16 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod activate-one-vehicle traffic-engine ((obj traffic-engine) (arg0 nav-segment) (arg1 float)) +(defmethod activate-one-vehicle traffic-engine ((this traffic-engine) (arg0 nav-segment) (arg1 float)) (let ((a1-1 0)) (dotimes (v1-0 11) - (if (zero? (-> obj object-type-info-array v1-0 inactive-count)) + (if (zero? (-> this object-type-info-array v1-0 inactive-count)) (set! a1-1 (logior a1-1 (ash 1 v1-0))) ) ) (let ((a1-2 (rand-vu-int-count-excluding 11 a1-1))) - (activate-by-type (-> obj vehicle-tracker-array) (the-as traffic-type a1-2) arg0 arg1) + (activate-by-type (-> this vehicle-tracker-array) (the-as traffic-type a1-2) arg0 arg1) ) ) 0 @@ -1118,42 +1119,42 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 65 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod handle-new-vis-cell traffic-engine ((obj traffic-engine) (arg0 vis-cell)) +(defmethod handle-new-vis-cell traffic-engine ((this traffic-engine) (arg0 vis-cell)) (dotimes (s4-0 (-> arg0 segment-count)) (let* ((s3-0 (-> arg0 segment-array s4-0)) (s1-0 (-> s3-0 tracker-id)) ) (when (and (logtest? (logxor (-> arg0 flags) (the-as uint (-> arg0 prev-flags))) (ash 1 s1-0)) (and (not (logtest? (-> arg0 flags) (vis-cell-flag suppress))) - (not (or (can-dest-be-used? obj (-> s3-0 branch)) (let ((a0-7 (-> s3-0 branch))) - (>= (-> a0-7 user-count) (-> a0-7 max-user-count)) - ) + (not (or (can-dest-be-used? this (-> s3-0 branch)) (let ((a0-7 (-> s3-0 branch))) + (>= (-> a0-7 user-count) (-> a0-7 max-user-count)) + ) ) ) ) ) - (let* ((s2-0 (-> obj tracker-array s1-0)) - (f30-0 (* (-> s2-0 rand) (-> obj inv-density-factor) (-> s3-0 spawn-spacing))) + (let* ((s2-0 (-> this tracker-array s1-0)) + (f30-0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing))) ) (cond ((= s1-0 1) (when (nonzero? (-> s3-0 nav-mesh-id)) (while (and (< f30-0 (-> s3-0 length)) (> (-> s2-0 inactive-object-count) 0)) - (activate-one-vehicle obj s3-0 f30-0) - (set! f30-0 (+ 24576.0 (* (-> s2-0 rand) (-> obj inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) + (activate-one-vehicle this s3-0 f30-0) + (set! f30-0 (+ 24576.0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) ) ) ) (else (while (and (< f30-0 (-> s3-0 length)) (> (-> s2-0 inactive-object-count) 0)) - (activate-one-citizen obj s3-0 f30-0) - (set! f30-0 (+ 49152.0 (* (-> s2-0 rand) (-> obj inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) + (activate-one-citizen this s3-0 f30-0) + (set! f30-0 (+ 49152.0 (* (-> s2-0 rand) (-> this inv-density-factor) (-> s3-0 spawn-spacing)) f30-0)) ) ) ) (if (>= f30-0 (-> s3-0 length)) (set! (-> s2-0 rand) - (fmax 0.0 (- (-> s2-0 rand) (/ (-> s3-0 length) (* (-> s3-0 spawn-spacing) (-> obj inv-density-factor))))) + (fmax 0.0 (- (-> s2-0 rand) (/ (-> s3-0 length) (* (-> s3-0 spawn-spacing) (-> this inv-density-factor))))) ) ) ) @@ -1167,18 +1168,18 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 14 of type traffic-level-data ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw traffic-level-data ((obj traffic-level-data)) +(defmethod debug-draw traffic-level-data ((this traffic-level-data)) (local-vars (sv-16 nav-node) (sv-20 nav-branch) (sv-80 nav-node) (sv-84 vector) (sv-88 vector) (sv-92 vector)) - (when (and (nonzero? (-> obj city-info)) (nonzero? (-> obj city-info nav-graph))) - (let ((s5-0 (-> obj city-info nav-graph))) + (when (and (nonzero? (-> this city-info)) (nonzero? (-> this city-info nav-graph))) + (let ((s5-0 (-> this city-info nav-graph))) (let ((v1-6 (-> s5-0 node-array 0))) (countdown (a0-3 (-> s5-0 node-count)) (logclear! (-> v1-6 flags) (nav-node-flag-byte visited)) (&+! v1-6 32) ) ) - (dotimes (s4-0 (the-as int (-> obj active-cell-count))) - (let ((a0-4 (-> obj active-cell-list s4-0))) + (dotimes (s4-0 (the-as int (-> this active-cell-count))) + (let ((a0-4 (-> this active-cell-list s4-0))) (dotimes (v1-11 (-> a0-4 segment-count)) (let ((a1-5 (-> a0-4 segment-array v1-11 branch src-node))) (logior! (-> a1-5 flags) (nav-node-flag-byte visited)) @@ -1241,7 +1242,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 12 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod debug-unused traffic-engine ((obj traffic-engine)) +(defmethod debug-unused traffic-engine ((this traffic-engine)) (dotimes (v1-0 (-> *level* length)) (let ((a0-4 (-> *level* level v1-0))) (when (= (-> a0-4 status) 'active) @@ -1257,9 +1258,9 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 14 of type traffic-engine -(defmethod sphere-in-loaded-city-infos? traffic-engine ((obj traffic-engine) (arg0 vector) (arg1 int)) +(defmethod sphere-in-loaded-city-infos? traffic-engine ((this traffic-engine) (arg0 vector) (arg1 int)) (dotimes (s3-0 2) - (let ((v1-3 (-> obj level-data-array s3-0))) + (let ((v1-3 (-> this level-data-array s3-0))) (when (nonzero? (-> v1-3 city-info)) (if (sphere-in-grid? (-> v1-3 city-info) arg0 arg1) (return #t) @@ -1271,7 +1272,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 17 of type traffic-engine -(defmethod can-dest-be-used? traffic-engine ((obj traffic-engine) (arg0 nav-branch)) +(defmethod can-dest-be-used? traffic-engine ((this traffic-engine) (arg0 nav-branch)) (let ((v1-0 (-> arg0 src-node))) (or (logtest? (-> arg0 flags) (nav-branch-flags nabflags-0)) (logtest? (-> v1-0 flags) (nav-node-flag-byte blocked)) @@ -1283,83 +1284,83 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 66 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-sync-from-frame-counter traffic-engine ((obj traffic-engine)) - (+! (-> obj sync-clock) 1) - (set! (-> obj sync-mask-8) (the-as uint (ash 1 (logand (-> obj sync-clock) 7)))) - (set! (-> obj sync-mask-16) (the-as uint (ash 1 (logand (-> obj sync-clock) 15)))) - (set! (-> obj sync-mask-32) (the-as uint (ash 1 (logand (-> obj sync-clock) 31)))) +(defmethod update-sync-from-frame-counter traffic-engine ((this traffic-engine)) + (+! (-> this sync-clock) 1) + (set! (-> this sync-mask-8) (the-as uint (ash 1 (logand (-> this sync-clock) 7)))) + (set! (-> this sync-mask-16) (the-as uint (ash 1 (logand (-> this sync-clock) 15)))) + (set! (-> this sync-mask-32) (the-as uint (ash 1 (logand (-> this sync-clock) 31)))) (let ((v1-10 (/ (current-time) 300))) - (set! (-> obj sync-array 0) (the-as uint 255)) + (set! (-> this sync-array 0) (the-as uint 255)) (let ((a1-12 (mod v1-10 20))) - (set! (-> obj sync-array 1) (the-as uint (cond - ((>= 6 a1-12) - 1 - ) - ((>= 9 a1-12) - 2 - ) - ((>= 16 a1-12) - 4 - ) - (else - 8 + (set! (-> this sync-array 1) (the-as uint (cond + ((>= 6 a1-12) + 1 ) - ) - ) + ((>= 9 a1-12) + 2 + ) + ((>= 16 a1-12) + 4 + ) + (else + 8 + ) + ) + ) ) ) (let ((a1-15 (mod v1-10 30))) - (set! (-> obj sync-array 2) (the-as uint (cond - ((>= 6 a1-15) - 1 - ) - ((>= 9 a1-15) - 2 - ) - ((>= 16 a1-15) - 4 - ) - ((>= 19 a1-15) - 8 - ) - ((>= 26 a1-15) - 16 - ) - (else - 32 + (set! (-> this sync-array 2) (the-as uint (cond + ((>= 6 a1-15) + 1 ) - ) - ) + ((>= 9 a1-15) + 2 + ) + ((>= 16 a1-15) + 4 + ) + ((>= 19 a1-15) + 8 + ) + ((>= 26 a1-15) + 16 + ) + (else + 32 + ) + ) + ) ) ) (let ((v1-11 (mod v1-10 40))) - (set! (-> obj sync-array 3) (the-as uint (cond - ((>= 6 v1-11) - 1 - ) - ((>= 9 v1-11) - 2 - ) - ((>= 16 v1-11) - 4 - ) - ((>= 19 v1-11) - 8 - ) - ((>= 26 v1-11) - 16 - ) - ((>= 29 v1-11) - 32 - ) - ((>= 36 v1-11) - 64 - ) - (else - 128 + (set! (-> this sync-array 3) (the-as uint (cond + ((>= 6 v1-11) + 1 ) - ) - ) + ((>= 9 v1-11) + 2 + ) + ((>= 16 v1-11) + 4 + ) + ((>= 19 v1-11) + 8 + ) + ((>= 26 v1-11) + 16 + ) + ((>= 29 v1-11) + 32 + ) + ((>= 36 v1-11) + 64 + ) + (else + 128 + ) + ) + ) ) ) ) @@ -1370,7 +1371,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 70 of type traffic-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-danger-from-target traffic-engine ((obj traffic-engine)) +(defmethod update-danger-from-target traffic-engine ((this traffic-engine)) "make people run away from jak when he is dangerous." (local-vars (v1-20 float) (v1-32 float)) (rlet ((acc :class vf) @@ -1381,7 +1382,7 @@ Process is recycled and moved to reserved, if it deactivates." (init-vf0-vector) (let ((s5-0 *target*)) (when s5-0 - (let ((v1-1 (-> obj danger-sphere-array))) + (let ((v1-1 (-> this danger-sphere-array))) (set! (-> v1-1 0 handle) (process->handle s5-0)) (let ((a0-4 (-> s5-0 focus-status)) (notify-radius 0.0) @@ -1512,7 +1513,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> s2-1 sphere r) f30-0) (set! (-> s2-1 velocity quad) (-> s4-0 0 bbox min quad)) (let ((gp-1 (fill-actor-list-for-line-sphere - (-> obj object-hash) + (-> this object-hash) (-> s2-1 sphere) (-> s2-1 velocity) (-> s2-1 sphere r) @@ -1548,18 +1549,18 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 69 of type traffic-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-danger traffic-engine ((obj traffic-engine)) +(defmethod update-danger traffic-engine ((this traffic-engine)) "see what's dangerous and make people avoid it." - (update-danger-from-target obj) - (dotimes (s5-0 (-> obj danger-sphere-count)) - (let ((s4-0 (-> obj danger-sphere-array s5-0))) + (update-danger-from-target this) + (dotimes (s5-0 (-> this danger-sphere-count)) + (let ((s4-0 (-> this danger-sphere-array s5-0))) (when (< 0.0 (-> s4-0 danger-level)) (let ((s3-0 (new 'stack-no-clear 'array 'collide-shape 40)) (a1-0 (new 'stack-no-clear 'sphere)) ) (set! (-> a1-0 quad) (-> s4-0 sphere quad)) (set! (-> a1-0 r) (-> s4-0 notify-radius)) - (let ((s2-0 (fill-actor-list-for-sphere (-> obj object-hash) a1-0 s3-0 40))) + (let ((s2-0 (fill-actor-list-for-sphere (-> this object-hash) a1-0 s3-0 40))) (dotimes (s1-0 s2-0) (let* ((s0-0 (-> s3-0 s1-0)) (a0-6 (if (type? s0-0 citizen) @@ -1584,14 +1585,14 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (set! (-> obj danger-sphere-count) 1) + (set! (-> this danger-sphere-count) 1) 0 (none) ) ;; definition for method 22 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod add-danger traffic-engine ((obj traffic-engine) (arg0 traffic-danger-info)) +(defmethod add-danger traffic-engine ((this traffic-engine) (arg0 traffic-danger-info)) "Add a danger sphere and suppression box." (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1623,14 +1624,14 @@ Process is recycled and moved to reserved, if it deactivates." (.svf (&-> a0-2 quad) vf5) ) (set! (-> a1-1 duration) (seconds 5)) - (new-suppression-box obj a1-1) + (new-suppression-box this a1-1) ) - (let ((v1-5 (-> obj danger-sphere-count))) + (let ((v1-5 (-> this danger-sphere-count))) (when (< v1-5 4) - (let ((a0-5 (-> obj danger-sphere-array v1-5))) + (let ((a0-5 (-> this danger-sphere-array v1-5))) (mem-copy! (the-as pointer a0-5) (the-as pointer arg0) 54) ) - (+! (-> obj danger-sphere-count) 1) + (+! (-> this danger-sphere-count) 1) ) ) 0 @@ -1640,7 +1641,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 60 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod kill-traffic-sphere traffic-engine ((obj traffic-engine) (arg0 sphere)) +(defmethod kill-traffic-sphere traffic-engine ((this traffic-engine) (arg0 sphere)) "Kill everything in the sphere with a traffic-off-force." (let ((gp-0 (new 'stack-no-clear 'array 'collide-shape 64))) (countdown (s5-0 (fill-actor-list-for-sphere *actor-hash* arg0 gp-0 64)) @@ -1663,11 +1664,11 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 68 of type traffic-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-traffic-amount traffic-engine ((obj traffic-engine)) +(defmethod update-traffic-amount traffic-engine ((this traffic-engine)) "kills inactive traffic and spawns more if needed." (local-vars (sv-48 int) (sv-64 nav-segment)) - (set! (-> obj object-hash object-count) 0) - (let* ((v1-1 (-> obj object-hash)) + (set! (-> this object-hash object-count) 0) + (let* ((v1-1 (-> this object-hash)) (a0-6 (/ (+ (* (* (* (-> v1-1 dimension-array 0) (-> v1-1 dimension-array 1)) (-> v1-1 dimension-array 2)) (-> v1-1 bucket-size) ) @@ -1695,7 +1696,7 @@ Process is recycled and moved to reserved, if it deactivates." (let ((a2-1 (handle->process (-> a2-0 pilot vehicle)))) (when a2-1 (set! (-> s5-0 quad) (-> (the-as process-focusable a2-1) root root-prim prim-core world-sphere quad)) - (spatial-hash-method-39 (-> obj object-hash) s5-0 (the-as hash-object-info a2-1)) + (spatial-hash-method-39 (-> this object-hash) s5-0 (the-as hash-object-info a2-1)) ) ) ) @@ -1703,80 +1704,80 @@ Process is recycled and moved to reserved, if it deactivates." (else (set! (-> s5-0 quad) (-> a2-0 control trans quad)) (set! (-> s5-0 w) 20480.0) - (spatial-hash-method-39 (-> obj object-hash) s5-0 (the-as hash-object-info a2-0)) + (spatial-hash-method-39 (-> this object-hash) s5-0 (the-as hash-object-info a2-0)) ) ) ) ) - (countdown (s4-0 (-> obj citizen-tracker-array active-object-count)) - (let ((s3-0 (handle->process (-> obj citizen-tracker-array active-object-list s4-0)))) + (countdown (s4-0 (-> this citizen-tracker-array active-object-count)) + (let ((s3-0 (handle->process (-> this citizen-tracker-array active-object-list s4-0)))) (cond (s3-0 (cond ((focus-test? (the-as vehicle s3-0) inactive) - (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #f) + (deactivate-object (-> this citizen-tracker-array) (the-as int s4-0) #f) ) ((begin (let ((v1-33 (-> (the-as vehicle s3-0) root))) (set! (-> s5-0 quad) (-> v1-33 trans quad)) (set! (-> s5-0 w) (-> v1-33 root-prim prim-core world-sphere w)) ) - (sphere-in-loaded-city-infos? obj s5-0 0) + (sphere-in-loaded-city-infos? this s5-0 0) ) (set! (-> (the-as vehicle s3-0) traffic-hash-id) - (spatial-hash-method-39 (-> obj object-hash) s5-0 (the-as hash-object-info s3-0)) + (spatial-hash-method-39 (-> this object-hash) s5-0 (the-as hash-object-info s3-0)) ) ) (else - (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #f) + (deactivate-object (-> this citizen-tracker-array) (the-as int s4-0) #f) ) ) ) (else - (remove-active-process (-> obj citizen-tracker-array) (the-as int s4-0)) + (remove-active-process (-> this citizen-tracker-array) (the-as int s4-0)) ) ) ) ) - (countdown (s4-1 (-> obj vehicle-tracker-array active-object-count)) - (let ((s3-1 (handle->process (-> obj vehicle-tracker-array active-object-list s4-1)))) + (countdown (s4-1 (-> this vehicle-tracker-array active-object-count)) + (let ((s3-1 (handle->process (-> this vehicle-tracker-array active-object-list s4-1)))) (cond (s3-1 (cond ((focus-test? (the-as process-focusable s3-1) inactive) - (deactivate-object (-> obj vehicle-tracker-array) (the-as int s4-1) #f) + (deactivate-object (-> this vehicle-tracker-array) (the-as int s4-1) #f) ) ((begin (let ((v1-54 (-> (the-as process-focusable s3-1) root))) (set! (-> s5-0 quad) (-> v1-54 trans quad)) (set! (-> s5-0 w) (-> v1-54 root-prim prim-core world-sphere w)) ) - (sphere-in-loaded-city-infos? obj s5-0 1) + (sphere-in-loaded-city-infos? this s5-0 1) ) - (spatial-hash-method-39 (-> obj object-hash) s5-0 (the-as hash-object-info s3-1)) + (spatial-hash-method-39 (-> this object-hash) s5-0 (the-as hash-object-info s3-1)) ) (else - (deactivate-object (-> obj vehicle-tracker-array) (the-as int s4-1) #f) + (deactivate-object (-> this vehicle-tracker-array) (the-as int s4-1) #f) ) ) ) (else - (remove-active-process (-> obj vehicle-tracker-array) (the-as int s4-1)) + (remove-active-process (-> this vehicle-tracker-array) (the-as int s4-1)) ) ) ) ) ) (dotimes (s5-1 2) - (let ((s4-2 (-> obj level-data-array s5-1))) + (let ((s4-2 (-> this level-data-array s5-1))) (when (nonzero? (-> s4-2 city-info)) (dotimes (s3-2 (the-as int (-> s4-2 newly-active-cell-count))) (let ((a1-22 (-> s4-2 newly-active-cell-list s3-2))) - (handle-new-vis-cell obj a1-22) + (handle-new-vis-cell this a1-22) ) ) (dotimes (s3-3 2) - (when (> (-> obj tracker-array s3-3 inactive-object-count) 0) + (when (> (-> this tracker-array s3-3 inactive-object-count) 0) (let ((s2-0 (the-as nav-segment #f))) (let ((f30-0 10000000000000000000000000000000000000.0)) (dotimes (s1-0 (the-as int (-> s4-2 active-cell-count))) @@ -1803,15 +1804,15 @@ Process is recycled and moved to reserved, if it deactivates." ) (when s2-0 (let ((a0-51 (-> s2-0 branch))) - (when (not (or (>= (-> a0-51 user-count) (-> a0-51 max-user-count)) (can-dest-be-used? obj (-> s2-0 branch)))) + (when (not (or (>= (-> a0-51 user-count) (-> a0-51 max-user-count)) (can-dest-be-used? this (-> s2-0 branch)))) (cond ((= s3-3 1) (if (nonzero? (-> s2-0 nav-mesh-id)) - (activate-one-vehicle obj s2-0 0.0) + (activate-one-vehicle this s2-0 0.0) ) ) (else - (activate-one-citizen obj s2-0 0.0) + (activate-one-citizen this s2-0 0.0) ) ) ) @@ -1829,9 +1830,9 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 9 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-traffic traffic-engine ((obj traffic-engine)) - (update-sync-from-frame-counter obj) - (update-suppressor obj) +(defmethod update-traffic traffic-engine ((this traffic-engine)) + (update-sync-from-frame-counter this) + (update-suppressor this) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) (set-vector! (-> s5-0 min) @@ -1848,7 +1849,7 @@ Process is recycled and moved to reserved, if it deactivates." 1.0 ) (dotimes (s4-0 2) - (let ((s3-0 (-> obj level-data-array s4-0))) + (let ((s3-0 (-> this level-data-array s4-0))) (when (nonzero? (-> s3-0 city-info)) (per-frame-cell-update s3-0) (add-box! s5-0 (-> s3-0 active-cell-box)) @@ -1856,27 +1857,27 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (update-grid-for-objects-in-box (-> obj object-hash) 253 (-> s5-0 min) (-> s5-0 max)) + (update-grid-for-objects-in-box (-> this object-hash) 253 (-> s5-0 min) (-> s5-0 max)) ) - (update-traffic-amount obj) - (set! (-> obj alert-state guard-aim-count) 0) - (update-alert-state obj) - (update-guards obj) - (update-danger obj) + (update-traffic-amount this) + (set! (-> this alert-state guard-aim-count) 0) + (update-alert-state this) + (update-guards this) + (update-danger this) 0 (none) ) ;; definition for method 21 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod callback-on-nav-segments-in-sphere traffic-engine ((obj traffic-engine) +(defmethod callback-on-nav-segments-in-sphere traffic-engine ((this traffic-engine) (arg0 vector) (arg1 int) (arg2 traffic-find-segment-struct) (arg3 (function traffic-find-segment-struct nav-segment none)) ) (dotimes (s1-0 2) - (let ((v1-3 (-> obj level-data-array s1-0))) + (let ((v1-3 (-> this level-data-array s1-0))) (if (nonzero? (-> v1-3 city-info)) (callback-on-nav-segments-in-sphere (-> v1-3 city-info) arg0 arg1 arg2 arg3) ) @@ -1898,28 +1899,28 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 3 of type traffic-find-segment-struct -(defmethod inspect traffic-find-segment-struct ((obj traffic-find-segment-struct)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-find-segment-struct ((this traffic-find-segment-struct)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'traffic-find-segment-struct) - (format #t "~1Tbest-seg: #~%" (-> obj best-seg)) - (format #t "~1Tbest-rating: ~f~%" (-> obj best-rating)) - (format #t "~1Tdir: #~%" (-> obj dir)) + (format #t "[~8x] ~A~%" this 'traffic-find-segment-struct) + (format #t "~1Tbest-seg: #~%" (-> this best-seg)) + (format #t "~1Tbest-rating: ~f~%" (-> this best-rating)) + (format #t "~1Tdir: #~%" (-> this dir)) (label cfg-4) - obj + this ) ;; definition for method 20 of type traffic-engine ;; INFO: Used lq/sq -(defmethod find-best-segment traffic-engine ((obj traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod find-best-segment traffic-engine ((this traffic-engine) (arg0 vector) (arg1 vector) (arg2 int)) (let ((gp-0 (new 'stack-no-clear 'traffic-find-segment-struct))) (set! (-> gp-0 dir quad) (-> arg1 quad)) (set! (-> gp-0 best-rating) -10000000000000000000000000000000000000.0) (set! (-> gp-0 best-seg) #f) (callback-on-nav-segments-in-sphere - obj + this arg0 arg2 gp-0 @@ -1947,25 +1948,25 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 28 of type traffic-engine -(defmethod maybe-increase-guard-aim-count traffic-engine ((obj traffic-engine)) - (when (< (-> obj alert-state guard-aim-count) 2) - (+! (-> obj alert-state guard-aim-count) 1) +(defmethod maybe-increase-guard-aim-count traffic-engine ((this traffic-engine)) + (when (< (-> this alert-state guard-aim-count) 2) + (+! (-> this alert-state guard-aim-count) 1) #t ) ) ;; definition for method 30 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod increase-alert-level traffic-engine ((obj traffic-engine) (arg0 int) (arg1 target)) - (when (and (logtest? (-> obj alert-state flags) (traffic-alert-flag target-jak)) +(defmethod increase-alert-level traffic-engine ((this traffic-engine) (arg0 int) (arg1 target)) + (when (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) (logtest? (-> arg1 mask) (process-mask target)) ) - (let ((v1-6 (min arg0 (the-as int (-> obj alert-state max-level))))) + (let ((v1-6 (min arg0 (the-as int (-> this alert-state max-level))))) (when #t - (set! (-> obj alert-state start-time) (current-time)) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) + (set-time! (-> this alert-state start-time)) + (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) ) - (set! (-> obj alert-state level) (the-as uint (max (the-as int (-> obj alert-state level)) v1-6))) + (set! (-> this alert-state level) (the-as uint (max (the-as int (-> this alert-state level)) v1-6))) ) ) 0 @@ -1974,9 +1975,9 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 31 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod decrease-alert-level traffic-engine ((obj traffic-engine) (arg0 int)) - (if (logtest? (-> obj alert-state flags) (traffic-alert-flag target-jak)) - (set! (-> obj alert-state level) (the-as uint (min (the-as int (-> obj alert-state level)) arg0))) +(defmethod decrease-alert-level traffic-engine ((this traffic-engine) (arg0 int)) + (if (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) + (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) ) 0 (none) @@ -1984,31 +1985,31 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 32 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-alert-level traffic-engine ((obj traffic-engine) (arg0 int)) - (set! (-> obj alert-state level) (the-as uint arg0)) - (set! (-> obj alert-state start-time) (current-time)) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) +(defmethod set-alert-level traffic-engine ((this traffic-engine) (arg0 int)) + (set! (-> this alert-state level) (the-as uint arg0)) + (set-time! (-> this alert-state start-time)) + (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) 0 (none) ) ;; definition for method 33 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-max-alert-level traffic-engine ((obj traffic-engine) (arg0 int)) - (set! (-> obj alert-state max-level) (the-as uint arg0)) - (set! (-> obj alert-state level) (the-as uint (min (the-as int (-> obj alert-state level)) arg0))) +(defmethod set-max-alert-level traffic-engine ((this traffic-engine) (arg0 int)) + (set! (-> this alert-state max-level) (the-as uint arg0)) + (set! (-> this alert-state level) (the-as uint (min (the-as int (-> this alert-state level)) arg0))) 0 (none) ) ;; definition for method 35 of type traffic-engine ;; WARN: Return type mismatch uint vs int. -(defmethod get-alert-level traffic-engine ((obj traffic-engine)) - (the-as int (-> obj alert-state level)) +(defmethod get-alert-level traffic-engine ((this traffic-engine)) + (the-as int (-> this alert-state level)) ) ;; definition for method 36 of type traffic-engine -(defmethod get-target traffic-engine ((obj traffic-engine)) +(defmethod get-target traffic-engine ((this traffic-engine)) "@returns [[*target*]]" *target* ) @@ -2169,7 +2170,7 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 50 of type traffic-engine -(defmethod find-closest-to-with-collide-lists traffic-engine ((obj traffic-engine) (arg0 process-drawable) (arg1 collide-spec)) +(defmethod find-closest-to-with-collide-lists traffic-engine ((this traffic-engine) (arg0 process-drawable) (arg1 collide-spec)) "Iterate through collide lists, find the closest thing to the given process." (let ((gp-0 (the-as process-focusable #f))) (let ((f30-0 (the-as float #x7f800000))) @@ -2282,7 +2283,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; WARN: Stack slot offset 216 signed mismatch ;; WARN: Stack slot offset 216 signed mismatch ;; WARN: Stack slot offset 216 signed mismatch -(defmethod traffic-engine-method-49 traffic-engine ((obj traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status)) +(defmethod traffic-engine-method-49 traffic-engine ((this traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status)) (local-vars (guards (array crimson-guard)) (guard-target-dists (array float)) @@ -2292,7 +2293,7 @@ Process is recycled and moved to reserved, if it deactivates." ) (logclear! (-> target-status flags) (traffic-target-flag visible-now updated)) (cond - ((= (-> obj sync-mask-16) (ash 1 (logand arg2 15))) + ((= (-> this sync-mask-16) (ash 1 (logand arg2 15))) (logior! (-> target-status flags) (traffic-target-flag updated)) (let ((target-proc (handle->process (-> target-status handle))) (target-pos (new 'stack-no-clear 'vector)) @@ -2301,18 +2302,18 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> target-pos quad) (-> (get-trans (the-as process-focusable target-proc) 3) quad)) (cond ((= (-> (the-as process-focusable target-proc) type) target) - (let ((s1-1 (-> obj alert-state target-status-array))) + (let ((s1-1 (-> this alert-state target-status-array))) (logclear! (-> s1-1 0 flags) (traffic-target-flag visible-now updated)) (logior! (-> s1-1 0 flags) (traffic-target-flag updated)) (cond ((or (logtest? (-> s1-1 0 flags) (traffic-target-flag force-visible)) (traffic-los-clear? los target-pos)) (logior! (-> s1-1 0 flags) (traffic-target-flag visible-now visible-recently visible-ever)) - (set! (-> s1-1 0 last-seen-time) (current-time)) + (set-time! (-> s1-1 0 last-seen-time)) (set! (-> s1-1 0 position quad) (-> target-pos quad)) (set! (-> s1-1 0 velocity quad) (-> (get-transv (the-as process-focusable target-proc)) quad)) ) (else - (if (>= (- (current-time) (-> s1-1 0 last-seen-time)) (seconds 2)) + (if (time-elapsed? (-> s1-1 0 last-seen-time) (seconds 2)) (logclear! (-> s1-1 0 flags) (traffic-target-flag visible-recently)) ) ) @@ -2323,7 +2324,7 @@ Process is recycled and moved to reserved, if it deactivates." ) (else (logior! (-> target-status flags) (traffic-target-flag visible-now visible-recently visible-ever)) - (set! (-> target-status last-seen-time) (current-time)) + (set-time! (-> target-status last-seen-time)) (set! (-> target-status position quad) (-> target-pos quad)) (set! (-> target-status velocity quad) (-> (get-transv (the-as process-focusable target-proc)) quad)) ) @@ -2335,10 +2336,10 @@ Process is recycled and moved to reserved, if it deactivates." (set! guards (the-as (array crimson-guard) (new 'stack 'array crimson-guard 16))) (set! guard-target-dists (the-as (array float) (new 'stack 'array float 16))) (set! guard-idx 0) - (dotimes (guard-count (the-as int (-> obj vehicle-tracker-array active-object-count))) - (case (-> obj vehicle-tracker-array active-object-type-list guard-count) + (dotimes (guard-count (the-as int (-> this vehicle-tracker-array active-object-count))) + (case (-> this vehicle-tracker-array active-object-type-list guard-count) (((traffic-type crimson-guard-1)) - (let ((guard (handle->process (-> obj vehicle-tracker-array active-object-list guard-count)))) + (let ((guard (handle->process (-> this vehicle-tracker-array active-object-list guard-count)))) (when (and guard (not (focus-test? (the-as process-focusable guard) dead inactive)) (= (-> (the-as crimson-guard guard) traffic-target-status handle) (-> target-status handle)) @@ -2413,7 +2414,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> s3-3 quad) (-> (get-trans (the-as process-focusable s5-1) 3) quad)) (cond ((= (-> s5-1 type) target) - (mem-copy! (the-as pointer target-status) (the-as pointer (-> obj alert-state target-status-array)) 80) + (mem-copy! (the-as pointer target-status) (the-as pointer (-> this alert-state target-status-array)) 80) ) (else ) @@ -2428,17 +2429,17 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 34 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-alert-duration traffic-engine ((obj traffic-engine) (arg0 time-frame)) - (set! (-> obj alert-state duration) (the-as uint arg0)) +(defmethod set-alert-duration traffic-engine ((this traffic-engine) (arg0 time-frame)) + (set! (-> this alert-state duration) (the-as uint arg0)) 0 (none) ) ;; definition for method 23 of type traffic-engine -(defmethod guard-count traffic-engine ((obj traffic-engine)) +(defmethod guard-count traffic-engine ((this traffic-engine)) (let ((v0-0 0)) (dotimes (v1-0 6) - (+! v0-0 (-> obj alert-state guard-type-info-array v1-0 count)) + (+! v0-0 (-> this alert-state guard-type-info-array v1-0 count)) ) v0-0 ) @@ -2446,9 +2447,9 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 53 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod end-pursuit-by-type traffic-engine ((obj traffic-engine) (arg0 traffic-type)) +(defmethod end-pursuit-by-type traffic-engine ((this traffic-engine) (arg0 traffic-type)) (for-all-active-processes-of-type - (-> obj tracker-array (-> obj object-type-info-array arg0 tracker-index)) + (-> this tracker-array (-> this object-type-info-array arg0 tracker-index)) arg0 (the-as (function process-focusable traffic-object-type-info none) @@ -2461,10 +2462,10 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 24 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-target-level traffic-engine ((obj traffic-engine) (arg0 float)) - (set! (-> obj alert-state guard-target-level) arg0) +(defmethod set-target-level traffic-engine ((this traffic-engine) (arg0 float)) + (set! (-> this alert-state guard-target-level) arg0) (dotimes (v1-0 21) - (let ((a2-2 (-> obj object-type-info-array v1-0))) + (let ((a2-2 (-> this object-type-info-array v1-0))) (set! (-> a2-2 target-count) (the int (* arg0 (the float (max 0 (+ (-> a2-2 want-count) -1)))))) ) ) @@ -2474,8 +2475,8 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 25 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-guard-target-level traffic-engine ((obj traffic-engine) (arg0 float)) - (set! (-> obj alert-state guard-target-level) arg0) +(defmethod set-guard-target-level traffic-engine ((this traffic-engine) (arg0 float)) + (set! (-> this alert-state guard-target-level) arg0) 0 (none) ) @@ -2736,28 +2737,28 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 54 of type traffic-engine -(defmethod get-traffic-guard-type-settings traffic-engine ((obj traffic-engine) (arg0 int)) +(defmethod get-traffic-guard-type-settings traffic-engine ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" - (-> obj alert-state settings guard-settings-array arg0) + (-> this alert-state settings guard-settings-array arg0) ) ;; definition for method 55 of type traffic-engine -(defmethod get-guard-type-for-traffic-obj traffic-engine ((obj traffic-engine) (arg0 int)) +(defmethod get-guard-type-for-traffic-obj traffic-engine ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" - (-> obj object-type-info-array arg0 guard-type) + (-> this object-type-info-array arg0 guard-type) ) ;; definition for method 56 of type traffic-engine -(defmethod get-traffic-guard-change-to-type traffic-engine ((obj traffic-engine) (arg0 int)) +(defmethod get-traffic-guard-change-to-type traffic-engine ((this traffic-engine) (arg0 int)) "TODO - guard-type should be an enum" - (-> obj alert-state guard-type-info-array arg0 change-to-type) + (-> this alert-state guard-type-info-array arg0 change-to-type) ) ;; definition for method 67 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-guards traffic-engine ((obj traffic-engine)) +(defmethod update-guards traffic-engine ((this traffic-engine)) (dotimes (v1-0 6) - (set! (-> obj alert-state guard-type-info-array v1-0 count) 0) + (set! (-> this alert-state guard-type-info-array v1-0 count) 0) ) (let* ((f0-0 122880.0) (f0-2 (* f0-0 f0-0)) @@ -2765,16 +2766,16 @@ Process is recycled and moved to reserved, if it deactivates." (v1-5 0) ) (let ((a1-0 0)) - (dotimes (a2-0 (the-as int (-> obj citizen-tracker-array active-object-count))) - (case (-> obj citizen-tracker-array active-object-type-list a2-0) + (dotimes (a2-0 (the-as int (-> this citizen-tracker-array active-object-count))) + (case (-> this citizen-tracker-array active-object-type-list a2-0) (((traffic-type guard-bike) (traffic-type hellcat)) - (let ((a3-6 (handle->process (-> obj citizen-tracker-array active-object-list a2-0)))) + (let ((a3-6 (handle->process (-> this citizen-tracker-array active-object-list a2-0)))) (when (and a3-6 (not (focus-test? (the-as vehicle a3-6) dead inactive)) (logtest? (rigid-body-object-flag alert) (-> (the-as vehicle a3-6) flags)) ) (let ((t0-13 (-> (the-as vehicle a3-6) info guard-type))) - (+! (-> obj alert-state guard-type-info-array t0-13 count) 1) + (+! (-> this alert-state guard-type-info-array t0-13 count) 1) ) (when (and (logtest? (rigid-body-object-flag in-pursuit) (-> (the-as vehicle a3-6) flags)) (logtest? (rigid-body-object-flag target-in-sight) (-> (the-as vehicle a3-6) flags)) @@ -2795,10 +2796,10 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (set! (-> obj alert-state guards-in-sight-of-target) a1-0) + (set! (-> this alert-state guards-in-sight-of-target) a1-0) ) (when (< 2 v1-5) - (if (not (logtest? (-> obj alert-state flags) (traffic-alert-flag disable-pursuit-control))) + (if (not (logtest? (-> this alert-state flags) (traffic-alert-flag disable-pursuit-control))) (send-event a0-3 'end-pursuit) ) ) @@ -2809,10 +2810,10 @@ Process is recycled and moved to reserved, if it deactivates." ) (let ((s3-0 0)) (let ((s2-0 0)) - (dotimes (s1-0 (the-as int (-> obj vehicle-tracker-array active-object-count))) - (case (-> obj vehicle-tracker-array active-object-type-list s1-0) + (dotimes (s1-0 (the-as int (-> this vehicle-tracker-array active-object-count))) + (case (-> this vehicle-tracker-array active-object-type-list s1-0) (((traffic-type crimson-guard-1)) - (let ((s0-0 (handle->process (-> obj vehicle-tracker-array active-object-list s1-0)))) + (let ((s0-0 (handle->process (-> this vehicle-tracker-array active-object-list s1-0)))) (when (and s0-0 (not (logtest? (-> (the-as crimson-guard s0-0) focus-status) (focus-status dead inactive)))) (when (and (logtest? (-> (the-as crimson-guard s0-0) flags) (citizen-flag in-pursuit)) (logtest? (-> (the-as crimson-guard s0-0) flags) (citizen-flag target-in-sight)) @@ -2826,7 +2827,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! s5-0 (the-as crimson-guard s0-0)) ) (if (and (< 327680.0 f0-3) - (not (logtest? (-> obj alert-state flags) (traffic-alert-flag disable-pursuit-control))) + (not (logtest? (-> this alert-state flags) (traffic-alert-flag disable-pursuit-control))) ) (send-event (the-as crimson-guard s0-0) 'end-pursuit) ) @@ -2836,7 +2837,7 @@ Process is recycled and moved to reserved, if it deactivates." (let ((v1-42 (-> s0-0 stack 860))) (when (< v1-42 (the-as uint 6)) (+! s2-0 1) - (+! (-> obj alert-state guard-type-info-array v1-42 count) 1) + (+! (-> this alert-state guard-type-info-array v1-42 count) 1) ) ) ) @@ -2845,10 +2846,10 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (+! (-> obj alert-state guards-in-sight-of-target) s3-0) + (+! (-> this alert-state guards-in-sight-of-target) s3-0) ) (when (< 2 s4-0) - (if (not (logtest? (-> obj alert-state flags) (traffic-alert-flag disable-pursuit-control))) + (if (not (logtest? (-> this alert-state flags) (traffic-alert-flag disable-pursuit-control))) (send-event s5-0 'end-pursuit) ) ) @@ -2860,8 +2861,8 @@ Process is recycled and moved to reserved, if it deactivates." (a2-4 9) ) (dotimes (a3-9 6) - (when (= (-> obj alert-state guard-type-info-array a3-9 object-type) (traffic-type crimson-guard-1)) - (let ((t1-15 (-> obj alert-state guard-type-info-array a3-9))) + (when (= (-> this alert-state guard-type-info-array a3-9 object-type) (traffic-type crimson-guard-1)) + (let ((t1-15 (-> this alert-state guard-type-info-array a3-9))) (set! (-> t1-15 change-to-type) (the-as uint a3-9)) (let ((t0-33 (- (-> t1-15 target-count) (-> t1-15 count)))) (when (< a1-6 t0-33) @@ -2878,8 +2879,8 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (when (and (!= v1-58 -1) (!= a0-25 -1)) - (set! (-> obj alert-state guard-type-info-array a0-25 change-to-type) (the-as uint v1-58)) - (set! (-> obj object-type-info-array 6 guard-type) (the-as uint v1-58)) + (set! (-> this alert-state guard-type-info-array a0-25 change-to-type) (the-as uint v1-58)) + (set! (-> this object-type-info-array 6 guard-type) (the-as uint v1-58)) ) ) 0 @@ -2889,22 +2890,22 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 71 of type traffic-engine ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-alert-state traffic-engine ((obj traffic-engine)) - (if (and (logtest? (-> obj alert-state flags) (traffic-alert-flag target-jak)) *target*) - (set! (-> obj alert-state target-status-array 0 handle) (process->handle *target*)) +(defmethod update-alert-state traffic-engine ((this traffic-engine)) + (if (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) *target*) + (set! (-> this alert-state target-status-array 0 handle) (process->handle *target*)) ) (when #t (mem-copy! - (the-as pointer (-> obj alert-state settings)) - (the-as pointer (-> *alert-level-settings* (-> obj alert-state level))) + (the-as pointer (-> this alert-state settings)) + (the-as pointer (-> *alert-level-settings* (-> this alert-state level))) 96 ) (dotimes (v1-10 6) - (let ((a1-3 (-> obj alert-state settings guard-settings-array v1-10)) - (a0-10 (-> obj alert-state guard-type-info-array v1-10)) + (let ((a1-3 (-> this alert-state settings guard-settings-array v1-10)) + (a0-10 (-> this alert-state guard-type-info-array v1-10)) ) (set! (-> a1-3 inaccuracy) - (fmax 0.0 (fmin 1.0 (* (-> a1-3 inaccuracy) (-> obj alert-state guard-inaccuracy-factor)))) + (fmax 0.0 (fmin 1.0 (* (-> a1-3 inaccuracy) (-> this alert-state guard-inaccuracy-factor)))) ) (when *target* (when (focus-test? *target* pilot) @@ -2916,7 +2917,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> a0-10 target-count) (max (min - (the int (* (the float (-> a1-3 target-count)) (-> obj alert-state guard-target-level))) + (the int (* (the float (-> a1-3 target-count)) (-> this alert-state guard-target-level))) (-> a0-10 max-target-count) ) (-> a0-10 min-target-count) @@ -2926,49 +2927,49 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (dotimes (v1-13 21) - (let ((a1-8 (-> obj alert-state guard-type-mask-from-object-type v1-13))) + (let ((a1-8 (-> this alert-state guard-type-mask-from-object-type v1-13))) (when (nonzero? a1-8) (let ((a2-18 0) (a0-14 0) ) (while (nonzero? a1-8) (if (logtest? a1-8 1) - (+! a0-14 (-> obj alert-state guard-type-info-array a2-18 target-count)) + (+! a0-14 (-> this alert-state guard-type-info-array a2-18 target-count)) ) (+! a2-18 1) (set! a1-8 (shr a1-8 1)) ) - (set! (-> obj object-type-info-array v1-13 target-count) a0-14) + (set! (-> this object-type-info-array v1-13 target-count) a0-14) ) ) ) ) (let ((s5-0 #f)) (when *traffic-alert-level-force* - (set! (-> obj alert-state level) (the-as uint 3)) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) - (set! (-> obj alert-state start-time) (current-time)) + (set! (-> this alert-state level) (the-as uint 3)) + (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) + (set-time! (-> this alert-state start-time)) ) - (when (>= (-> obj alert-state level) (the-as uint 1)) + (when (>= (-> this alert-state level) (the-as uint 1)) (set! s5-0 #t) (cond - ((logtest? (-> obj alert-state flags) (traffic-alert-flag alert-ending)) + ((logtest? (-> this alert-state flags) (traffic-alert-flag alert-ending)) (cond - ((> (guard-count obj) 0) - (set! (-> obj alert-state start-time) (current-time)) + ((> (guard-count this) 0) + (set-time! (-> this alert-state start-time)) ) (else - (when (>= (- (current-time) (-> obj alert-state start-time)) (seconds 3)) + (when (time-elapsed? (-> this alert-state start-time) (seconds 3)) (set! s5-0 #f) - (set! (-> obj alert-state level) (the-as uint 0)) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) + (set! (-> this alert-state level) (the-as uint 0)) + (logclear! (-> this alert-state flags) (traffic-alert-flag alert-ending)) ) ) ) ) (else (let ((v1-39 - (+ (- (-> obj alert-state start-time) (current-time)) (the-as time-frame (-> obj alert-state duration))) + (+ (- (-> this alert-state start-time) (current-time)) (the-as time-frame (-> this alert-state duration))) ) ) (if (and *target* (-> *target* next-state) (= (-> *target* next-state name) 'target-hide)) @@ -2976,7 +2977,7 @@ Process is recycled and moved to reserved, if it deactivates." ) (if (> v1-39 0) 0 - (logior! (-> obj alert-state flags) (traffic-alert-flag alert-ending)) + (logior! (-> this alert-state flags) (traffic-alert-flag alert-ending)) ) ) ) @@ -2984,8 +2985,8 @@ Process is recycled and moved to reserved, if it deactivates." ) (cond (s5-0 - (when (not (logtest? (-> obj alert-state flags) (traffic-alert-flag alarm-on))) - (logior! (-> obj alert-state flags) (traffic-alert-flag alarm-on)) + (when (not (logtest? (-> this alert-state flags) (traffic-alert-flag alarm-on))) + (logior! (-> this alert-state flags) (traffic-alert-flag alarm-on)) (set! (-> *game-info* wanted-flash) #t) (if (= (-> *setting-control* user-current music) 'city1) (set-setting! 'sound-mode #f 0.0 1) @@ -2996,39 +2997,39 @@ Process is recycled and moved to reserved, if it deactivates." (if (or (= (-> *setting-control* user-default music-volume) 0.0) (!= (-> *setting-control* user-current music) 'city1) ) - (sound-play "city-alarm" :id (-> obj alert-state alarm-sound-id) :position s5-1) + (sound-play "city-alarm" :id (-> this alert-state alarm-sound-id) :position s5-1) ) ) (if #t - (send-alert-events obj) + (send-alert-events this) ) (let ((v1-67 0)) (dotimes (a0-45 21) - (let ((a1-19 (-> obj object-type-info-array a0-45))) + (let ((a1-19 (-> this object-type-info-array a0-45))) (if #t (+! v1-67 (-> a1-19 killed-count)) ) ) ) - (if (and (>= v1-67 (the-as int (* (-> obj alert-state level) 8))) - (< (-> obj alert-state level) (-> obj alert-state max-level)) + (if (and (>= v1-67 (the-as int (* (-> this alert-state level) 8))) + (< (-> this alert-state level) (-> this alert-state max-level)) ) - (set-alert-level obj (the-as int (+ (-> obj alert-state level) 1))) + (set-alert-level this (the-as int (+ (-> this alert-state level) 1))) ) ) ) (else - (when (logtest? (-> obj alert-state flags) (traffic-alert-flag alarm-on)) - (logclear! (-> obj alert-state flags) (traffic-alert-flag alarm-on)) + (when (logtest? (-> this alert-state flags) (traffic-alert-flag alarm-on)) + (logclear! (-> this alert-state flags) (traffic-alert-flag alarm-on)) (set! (-> *game-info* wanted-flash) #f) (remove-setting! 'sound-mode) - (sound-stop (-> obj alert-state alarm-sound-id)) - (send-alert-events obj) - (let ((v1-84 (-> obj alert-state target-status-array))) + (sound-stop (-> this alert-state alarm-sound-id)) + (send-alert-events this) + (let ((v1-84 (-> this alert-state target-status-array))) (logclear! (-> v1-84 0 flags) (traffic-target-flag visible-now visible-recently visible-ever)) ) (dotimes (v1-85 21) - (set! (-> obj object-type-info-array v1-85 killed-count) (the-as uint 0)) + (set! (-> this object-type-info-array v1-85 killed-count) (the-as uint 0)) 0 ) ) @@ -3041,30 +3042,30 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 52 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod send-alert-events traffic-engine ((obj traffic-engine)) - (set! (-> obj alert-state notify-time) (current-time)) +(defmethod send-alert-events traffic-engine ((this traffic-engine)) + (set-time! (-> this alert-state notify-time)) (cond - ((> (-> obj alert-state level) 0) - (if (and (logtest? (-> obj alert-state flags) (traffic-alert-flag target-jak)) - (not (logtest? (-> obj alert-state flags) (traffic-alert-flag alert-ending))) + ((> (-> this alert-state level) 0) + (if (and (logtest? (-> this alert-state flags) (traffic-alert-flag target-jak)) + (not (logtest? (-> this alert-state flags) (traffic-alert-flag alert-ending))) *target* ) - (for-all-active-processes obj (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) - (if (logtest? (-> arg1 flags) (traffic-type-flags trtflags-0)) - (send-event arg0 'alert-begin *target*) - ) - (none) - ) + (for-all-active-processes this (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) + (if (logtest? (-> arg1 flags) (traffic-type-flags trtflags-0)) + (send-event arg0 'alert-begin *target*) + ) + (none) + ) ) ) ) (else - (for-all-active-processes obj (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) - (if (logtest? (-> arg1 flags) (traffic-type-flags trtflags-0)) - (send-event arg0 'alert-end) - ) - (none) - ) + (for-all-active-processes this (lambda ((arg0 process-focusable) (arg1 traffic-object-type-info)) + (if (logtest? (-> arg1 flags) (traffic-type-flags trtflags-0)) + (send-event arg0 'alert-end) + ) + (none) + ) ) ) ) @@ -3074,25 +3075,25 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 29 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod restore-default-settings traffic-engine ((obj traffic-engine)) +(defmethod restore-default-settings traffic-engine ((this traffic-engine)) (restore-city-speeches) (logclear! - (-> obj alert-state flags) + (-> this alert-state flags) (traffic-alert-flag guard-multi-focus sticky-guard-settings disable-pursuit-control) ) - (set! (-> obj inv-density-factor) 5.0) + (set! (-> this inv-density-factor) 5.0) (if (demo?) - (set! (-> obj inv-density-factor) 1.25) + (set! (-> this inv-density-factor) 1.25) ) - (let ((v1-6 (-> obj alert-state target-status-array))) + (let ((v1-6 (-> this alert-state target-status-array))) (logclear! (-> v1-6 0 flags) (traffic-target-flag force-visible)) ) - (set-target-level obj 1.0) - (set-alert-duration obj (seconds 30)) - (set-max-alert-level obj 4) + (set-target-level this 1.0) + (set-alert-duration this (seconds 30)) + (set-max-alert-level this 4) (let ((v1-13 42)) (dotimes (a0-7 21) - (let ((a1-6 (-> obj object-type-info-array a0-7))) + (let ((a1-6 (-> this object-type-info-array a0-7))) (set! (-> a1-6 flags) (traffic-type-flags trtflags-1 trtflags-2)) (set! (-> a1-6 reserve-count) (the-as uint (max 1000 (min #xfde8 (* 1000 (-> a1-6 want-count)))))) (set! (-> a1-6 killed-count) (the-as uint 0)) @@ -3108,39 +3109,39 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (let ((v1-16 (-> obj object-type-info-array 6))) + (let ((v1-16 (-> this object-type-info-array 6))) (logior! (-> v1-16 flags) (traffic-type-flags trtflags-0)) ) - (let ((v1-17 (-> obj object-type-info-array 7))) + (let ((v1-17 (-> this object-type-info-array 7))) (logior! (-> v1-17 flags) (traffic-type-flags trtflags-0)) ) - (let ((v1-18 (-> obj object-type-info-array 18))) + (let ((v1-18 (-> this object-type-info-array 18))) (logior! (-> v1-18 flags) (traffic-type-flags trtflags-0)) ) - (let ((v1-19 (-> obj object-type-info-array 19))) + (let ((v1-19 (-> this object-type-info-array 19))) (logior! (-> v1-19 flags) (traffic-type-flags trtflags-0)) ) - (let ((v1-20 (-> obj object-type-info-array 20))) + (let ((v1-20 (-> this object-type-info-array 20))) (logior! (-> v1-20 flags) (traffic-type-flags trtflags-0)) ) - (let ((v1-21 (-> obj object-type-info-array 5))) + (let ((v1-21 (-> this object-type-info-array 5))) (set! (-> v1-21 target-count) 0) (logclear! (-> v1-21 flags) (traffic-type-flags trtflags-1 trtflags-2)) ) - (let ((v1-22 (-> obj object-type-info-array 3))) + (let ((v1-22 (-> this object-type-info-array 3))) (set! (-> v1-22 target-count) 0) (logclear! (-> v1-22 flags) (traffic-type-flags trtflags-2)) ) - (let ((v1-23 (-> obj object-type-info-array 4))) + (let ((v1-23 (-> this object-type-info-array 4))) (set! (-> v1-23 target-count) 0) (logclear! (-> v1-23 flags) (traffic-type-flags trtflags-2)) ) - (let ((v1-24 (-> obj object-type-info-array 17))) + (let ((v1-24 (-> this object-type-info-array 17))) (set! (-> v1-24 target-count) 0) (logclear! (-> v1-24 flags) (traffic-type-flags trtflags-1 trtflags-2)) ) (dotimes (v1-25 6) - (let ((a0-28 (-> obj alert-state guard-type-info-array v1-25))) + (let ((a0-28 (-> this alert-state guard-type-info-array v1-25))) (set! (-> a0-28 min-target-count) 0) (set! (-> a0-28 max-target-count) 127) ) @@ -3151,18 +3152,18 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 26 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-all traffic-engine ((obj traffic-engine)) - (deactivate-all (-> obj citizen-tracker-array) #t) - (deactivate-all (-> obj vehicle-tracker-array) #t) +(defmethod deactivate-all traffic-engine ((this traffic-engine)) + (deactivate-all (-> this citizen-tracker-array) #t) + (deactivate-all (-> this vehicle-tracker-array) #t) 0 (none) ) ;; definition for method 27 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-by-type traffic-engine ((obj traffic-engine) (arg0 traffic-type)) - (let ((a2-0 (-> obj object-type-info-array arg0))) - (deactivate-all-of-type (-> obj tracker-array (-> a2-0 tracker-index)) arg0 #t) +(defmethod deactivate-by-type traffic-engine ((this traffic-engine) (arg0 traffic-type)) + (let ((a2-0 (-> this object-type-info-array arg0))) + (deactivate-all-of-type (-> this tracker-array (-> a2-0 tracker-index)) arg0 #t) ) 0 (none) @@ -3170,21 +3171,21 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 19 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod deactivate-all-from-level traffic-engine ((obj traffic-engine) (arg0 symbol)) +(defmethod deactivate-all-from-level traffic-engine ((this traffic-engine) (arg0 symbol)) (local-vars (v1-6 nav-branch)) - (countdown (s4-0 (-> obj citizen-tracker-array active-object-count)) - (let ((v1-3 (handle->process (-> obj citizen-tracker-array active-object-list s4-0)))) + (countdown (s4-0 (-> this citizen-tracker-array active-object-count)) + (let ((v1-3 (handle->process (-> this citizen-tracker-array active-object-list s4-0)))) (when v1-3 (cond ((focus-test? (the-as process-focusable v1-3) inactive) - (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #f) + (deactivate-object (-> this citizen-tracker-array) (the-as int s4-0) #f) ) ((begin (set! v1-6 (-> (the-as vehicle v1-3) controller branch)) (and v1-6 (nonzero? v1-6))) (let ((v1-7 (-> v1-6 dest-node))) (cond (v1-7 (if (= arg0 (-> v1-7 level)) - (deactivate-object (-> obj citizen-tracker-array) (the-as int s4-0) #t) + (deactivate-object (-> this citizen-tracker-array) (the-as int s4-0) #t) ) ) (else @@ -3206,8 +3207,8 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 58 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-object-auto-activate traffic-engine ((obj traffic-engine) (arg0 int) (arg1 object)) - (let ((v1-2 (-> obj object-type-info-array arg0))) +(defmethod set-object-auto-activate traffic-engine ((this traffic-engine) (arg0 int) (arg1 object)) + (let ((v1-2 (-> this object-type-info-array arg0))) (if arg1 (logior! (-> v1-2 flags) (traffic-type-flags trtflags-2)) (logclear! (-> v1-2 flags) (traffic-type-flags trtflags-2)) @@ -3219,8 +3220,8 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 37 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-object-target-level traffic-engine ((obj traffic-engine) (arg0 int) (arg1 float)) - (let ((v1-2 (-> obj object-type-info-array arg0))) +(defmethod set-object-target-level traffic-engine ((this traffic-engine) (arg0 int) (arg1 float)) + (let ((v1-2 (-> this object-type-info-array arg0))) (set! (-> v1-2 target-count) (the int (* arg1 (the float (max 0 (+ (-> v1-2 want-count) -1)))))) ) 0 @@ -3229,16 +3230,16 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 38 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-object-target-count traffic-engine ((obj traffic-engine) (arg0 int) (arg1 int)) - (set! (-> obj object-type-info-array arg0 target-count) arg1) +(defmethod set-object-target-count traffic-engine ((this traffic-engine) (arg0 int) (arg1 int)) + (set! (-> this object-type-info-array arg0 target-count) arg1) 0 (none) ) ;; definition for method 57 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-guard-target-count-range traffic-engine ((obj traffic-engine) (arg0 int) (arg1 int) (arg2 int)) - (let ((v1-2 (-> obj alert-state guard-type-info-array arg0))) +(defmethod set-guard-target-count-range traffic-engine ((this traffic-engine) (arg0 int) (arg1 int) (arg2 int)) + (let ((v1-2 (-> this alert-state guard-type-info-array arg0))) (set! (-> v1-2 min-target-count) (max 0 (min 127 arg1))) (set! (-> v1-2 max-target-count) (max 0 (min 127 arg2))) ) @@ -3248,29 +3249,29 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 39 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-object-reserve-count traffic-engine ((obj traffic-engine) (arg0 int) (arg1 uint)) - (set! (-> obj object-type-info-array arg0 reserve-count) arg1) +(defmethod set-object-reserve-count traffic-engine ((this traffic-engine) (arg0 int) (arg1 uint)) + (set! (-> this object-type-info-array arg0 reserve-count) arg1) 0 (none) ) ;; definition for method 40 of type traffic-engine ;; WARN: Return type mismatch uint vs int. -(defmethod get-object-reserve-count traffic-engine ((obj traffic-engine) (arg0 int)) - (the-as int (-> obj object-type-info-array arg0 reserve-count)) +(defmethod get-object-reserve-count traffic-engine ((this traffic-engine) (arg0 int)) + (the-as int (-> this object-type-info-array arg0 reserve-count)) ) ;; definition for method 41 of type traffic-engine -(defmethod get-object-remaining-count traffic-engine ((obj traffic-engine) (arg0 int)) - (let ((a0-1 (-> obj object-type-info-array arg0))) +(defmethod get-object-remaining-count traffic-engine ((this traffic-engine) (arg0 int)) + (let ((a0-1 (-> this object-type-info-array arg0))) (+ (-> a0-1 active-count) (-> a0-1 reserve-count)) ) ) ;; definition for method 44 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod set-parking-spot-prob traffic-engine ((obj traffic-engine) (arg0 int) (arg1 float)) - (let ((v1-2 (-> obj object-type-info-array arg0))) +(defmethod set-parking-spot-prob traffic-engine ((this traffic-engine) (arg0 int) (arg1 float)) + (let ((v1-2 (-> this object-type-info-array arg0))) (set! (-> v1-2 parking-spot-prob) (the-as uint (min 255 (the int (* 256.0 arg1))))) ) 0 @@ -3279,13 +3280,13 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 45 of type traffic-engine ;; WARN: Return type mismatch int vs traffic-type. -(defmethod get-random-parking-spot-type traffic-engine ((obj traffic-engine)) +(defmethod get-random-parking-spot-type traffic-engine ((this traffic-engine)) (let ((s5-0 11)) (let ((s4-0 (the int (* 256.0 (rand-vu)))) (s3-0 0) ) (while (< (the-as uint s5-0) (the-as uint 21)) - (let ((s2-0 (-> obj object-type-info-array s5-0))) + (let ((s2-0 (-> this object-type-info-array s5-0))) (when (and (logtest? (-> s2-0 flags) (traffic-type-flags trtflags-3)) (= (level-status *level* (-> s2-0 level)) 'active) ) @@ -3304,9 +3305,9 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 42 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod activate-object traffic-engine ((obj traffic-engine) (arg0 traffic-object-spawn-params)) - (let ((a2-0 (-> obj object-type-info-array (-> arg0 object-type)))) - (activate-from-params (-> obj tracker-array (-> a2-0 tracker-index)) arg0) +(defmethod activate-object traffic-engine ((this traffic-engine) (arg0 traffic-object-spawn-params)) + (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) + (activate-from-params (-> this tracker-array (-> a2-0 tracker-index)) arg0) ) 0 (none) @@ -3314,44 +3315,44 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 43 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod activate-by-handle traffic-engine ((obj traffic-engine) (arg0 traffic-object-spawn-params)) - (let ((a2-0 (-> obj object-type-info-array (-> arg0 object-type)))) - (activate-by-handle (-> obj tracker-array (-> a2-0 tracker-index)) arg0) +(defmethod activate-by-handle traffic-engine ((this traffic-engine) (arg0 traffic-object-spawn-params)) + (let ((a2-0 (-> this object-type-info-array (-> arg0 object-type)))) + (activate-by-handle (-> this tracker-array (-> a2-0 tracker-index)) arg0) ) 0 (none) ) ;; definition for method 46 of type traffic-engine -(defmethod new-suppression-box traffic-engine ((obj traffic-engine) (arg0 traffic-suppression-params)) - (add-new-supression-box (-> obj suppressor) arg0) +(defmethod new-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) + (add-new-supression-box (-> this suppressor) arg0) (none) ) ;; definition for method 47 of type traffic-engine -(defmethod remove-suppression-box traffic-engine ((obj traffic-engine) (arg0 traffic-suppression-params)) - (remove-box-by-id (-> obj suppressor) (the-as int arg0)) +(defmethod remove-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) + (remove-box-by-id (-> this suppressor) (the-as int arg0)) (none) ) ;; definition for method 48 of type traffic-engine -(defmethod update-suppression-box traffic-engine ((obj traffic-engine) (arg0 traffic-suppression-params)) - (update-box-from-params (-> obj suppressor) arg0) +(defmethod update-suppression-box traffic-engine ((this traffic-engine) (arg0 traffic-suppression-params)) + (update-box-from-params (-> this suppressor) arg0) (none) ) ;; definition for method 72 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod update-suppressor traffic-engine ((obj traffic-engine)) +(defmethod update-suppressor traffic-engine ((this traffic-engine)) (let ((v1-3 (- (-> *display* game-clock frame-counter) (-> *display* game-clock old-frame-counter)))) (dotimes (a1-3 16) - (let ((a2-2 (-> obj suppressor array a1-3))) + (let ((a2-2 (-> this suppressor array a1-3))) (when (logtest? (-> a2-2 flags) (traffic-suppression-box-flags in-use)) (let ((a3-3 (the-as int (-> a2-2 duration)))) (cond ((< (the-as uint a3-3) (the-as uint v1-3)) (logclear! (-> a2-2 flags) (traffic-suppression-box-flags in-use)) - (logior! (-> obj suppressor flags) (traffic-suppression-flags needs-update)) + (logior! (-> this suppressor flags) (traffic-suppression-flags needs-update)) ) (else (set! (-> a2-2 duration) (the-as uint (- (the-as time-frame a3-3) v1-3))) @@ -3362,9 +3363,9 @@ Process is recycled and moved to reserved, if it deactivates." ) ) ) - (when (logtest? (-> obj suppressor flags) (traffic-suppression-flags needs-update)) - (logclear! (-> obj suppressor flags) (traffic-suppression-flags needs-update)) - (recompute-supressions obj) + (when (logtest? (-> this suppressor flags) (traffic-suppression-flags needs-update)) + (logclear! (-> this suppressor flags) (traffic-suppression-flags needs-update)) + (recompute-supressions this) ) 0 (none) @@ -3372,11 +3373,11 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 73 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod recompute-supressions traffic-engine ((obj traffic-engine)) +(defmethod recompute-supressions traffic-engine ((this traffic-engine)) (dotimes (s5-0 2) - (let ((v1-3 (-> obj level-data-array s5-0))) + (let ((v1-3 (-> this level-data-array s5-0))) (if (nonzero? (-> v1-3 city-info)) - (update-suppressions-from-traffic-engine (-> v1-3 city-info) obj) + (update-suppressions-from-traffic-engine (-> v1-3 city-info) this) ) ) ) @@ -3393,23 +3394,23 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 14 of type city-level-info -(defmethod get-first-cell-in-box city-level-info ((obj city-level-info) (arg0 vis-grid-box)) - (-> obj +(defmethod get-first-cell-in-box city-level-info ((this city-level-info) (arg0 vis-grid-box)) + (-> this cell-array (+ (-> arg0 min x) - (* (-> arg0 min z) (-> obj grid-info dimension-array 0)) - (* (* (-> arg0 min y) (-> obj grid-info dimension-array 0)) (-> obj grid-info dimension-array 2)) + (* (-> arg0 min z) (-> this grid-info dimension-array 0)) + (* (* (-> arg0 min y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) ) ) ) ;; definition for method 15 of type city-level-info -(defmethod sphere-in-grid? city-level-info ((obj city-level-info) (arg0 vector) (arg1 int)) +(defmethod sphere-in-grid? city-level-info ((this city-level-info) (arg0 vector) (arg1 int)) (let ((gp-0 #f)) (let ((s3-0 (new 'stack-no-clear 'vis-grid-box)) (s2-0 (new 'stack-no-clear 'vis-grid-box)) ) - (lookup-box-for-sphere (-> obj grid-info) s2-0 arg0) + (lookup-box-for-sphere (-> this grid-info) s2-0 arg0) (set! (-> s3-0 min y) (-> s2-0 min y)) (let ((v1-6 (+ (- 1 (-> s2-0 min y)) (-> s2-0 max y)))) (b! #t cfg-13 :delay (nop!)) @@ -3425,7 +3426,7 @@ Process is recycled and moved to reserved, if it deactivates." (b! #t cfg-9 :delay (nop!)) (label cfg-3) (+! a1-7 -1) - (let ((a3-0 obj) + (let ((a3-0 this) (t1-0 s3-0) ) (b! @@ -3477,7 +3478,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; WARN: Stack slot offset 28 signed mismatch ;; WARN: Stack slot offset 24 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod callback-on-nav-segments-in-sphere city-level-info ((obj city-level-info) +(defmethod callback-on-nav-segments-in-sphere city-level-info ((this city-level-info) (arg0 vector) (arg1 int) (arg2 traffic-find-segment-struct) @@ -3492,7 +3493,7 @@ Process is recycled and moved to reserved, if it deactivates." (sv-80 vis-grid-box) (sv-84 vis-grid-box) ) - (set! sv-16 obj) + (set! sv-16 this) (set! sv-20 arg0) (set! sv-24 arg1) (set! sv-28 arg2) @@ -3540,10 +3541,10 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 17 of type city-level-info ;; WARN: Return type mismatch int vs none. -(defmethod update-suppressions-from-traffic-engine city-level-info ((obj city-level-info) (arg0 traffic-engine)) - (let ((v1-0 (-> obj cell-count))) +(defmethod update-suppressions-from-traffic-engine city-level-info ((this city-level-info) (arg0 traffic-engine)) + (let ((v1-0 (-> this cell-count))) (dotimes (a0-1 (the-as int v1-0)) - (let ((a1-2 (-> obj cell-array a0-1))) + (let ((a1-2 (-> this cell-array a0-1))) (logclear! (-> a1-2 flags) (vis-cell-flag suppress)) ) ) @@ -3552,15 +3553,15 @@ Process is recycled and moved to reserved, if it deactivates." (dotimes (s3-0 16) (let ((s2-0 (-> arg0 suppressor array s3-0))) (when (logtest? (-> s2-0 flags) (traffic-suppression-box-flags in-use)) - (lookup-cell-for-point (-> obj grid-info) (-> s4-0 1) (the-as vector (-> s2-0 bbox))) - (lookup-cell-for-point (-> obj grid-info) (-> s4-0 2) (-> s2-0 bbox max)) + (lookup-cell-for-point (-> this grid-info) (-> s4-0 1) (the-as vector (-> s2-0 bbox))) + (lookup-cell-for-point (-> this grid-info) (-> s4-0 2) (-> s2-0 bbox max)) (set! (-> s4-0 0 y) (-> s4-0 1 y)) (countdown (v1-15 (+ (- 1 (-> s4-0 1 y)) (-> s4-0 2 y))) (set! (-> s4-0 0 z) (-> s4-0 1 z)) (countdown (a0-9 (+ (- 1 (-> s4-0 1 z)) (-> s4-0 2 z))) (set! (-> s4-0 0 x) (-> s4-0 1 x)) (countdown (a1-10 (+ (- 1 (-> s4-0 1 x)) (-> s4-0 2 x))) - (let* ((a3-1 obj) + (let* ((a3-1 this) (t1-0 (-> s4-0 0)) (a2-8 (-> a3-1 cell-array @@ -3589,11 +3590,11 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 10 of type traffic-level-data ;; WARN: Return type mismatch int vs none. -(defmethod add-active-cell traffic-level-data ((obj traffic-level-data) (arg0 vis-cell)) - (let ((v1-0 (-> obj active-cell-count))) +(defmethod add-active-cell traffic-level-data ((this traffic-level-data) (arg0 vis-cell)) + (let ((v1-0 (-> this active-cell-count))) (when (< v1-0 (the-as uint 255)) - (set! (-> obj active-cell-list v1-0) arg0) - (+! (-> obj active-cell-count) 1) + (set! (-> this active-cell-list v1-0) arg0) + (+! (-> this active-cell-count) 1) ) ) 0 @@ -3602,11 +3603,11 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 11 of type traffic-level-data ;; WARN: Return type mismatch int vs none. -(defmethod remove-active-cell traffic-level-data ((obj traffic-level-data) (arg0 int)) - (let ((v1-1 (+ (-> obj active-cell-count) -1))) +(defmethod remove-active-cell traffic-level-data ((this traffic-level-data) (arg0 int)) + (let ((v1-1 (+ (-> this active-cell-count) -1))) (when (>= v1-1 0) - (set! (-> obj active-cell-list arg0) (-> obj active-cell-list v1-1)) - (+! (-> obj active-cell-count) -1) + (set! (-> this active-cell-list arg0) (-> this active-cell-list v1-1)) + (+! (-> this active-cell-count) -1) ) ) 0 @@ -3615,11 +3616,11 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 12 of type traffic-level-data ;; WARN: Return type mismatch int vs none. -(defmethod add-newly-active-cell traffic-level-data ((obj traffic-level-data) (arg0 vis-cell)) - (let ((v1-0 (-> obj newly-active-cell-count))) +(defmethod add-newly-active-cell traffic-level-data ((this traffic-level-data) (arg0 vis-cell)) + (let ((v1-0 (-> this newly-active-cell-count))) (when (< v1-0 (the-as uint 255)) - (set! (-> obj newly-active-cell-list v1-0) arg0) - (+! (-> obj newly-active-cell-count) 1) + (set! (-> this newly-active-cell-list v1-0) arg0) + (+! (-> this newly-active-cell-count) 1) ) ) 0 @@ -3628,10 +3629,10 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 13 of type traffic-level-data ;; WARN: Return type mismatch int vs none. -(defmethod per-frame-cell-update traffic-level-data ((obj traffic-level-data)) - (set! (-> obj newly-active-cell-count) (the-as uint 0)) - (dotimes (v1-0 (the-as int (-> obj active-cell-count))) - (let ((a0-3 (-> obj active-cell-list v1-0))) +(defmethod per-frame-cell-update traffic-level-data ((this traffic-level-data)) + (set! (-> this newly-active-cell-count) (the-as uint 0)) + (dotimes (v1-0 (the-as int (-> this active-cell-count))) + (let ((a0-3 (-> this active-cell-list v1-0))) (set! (-> a0-3 prev-flags) (-> a0-3 flags)) ) ) @@ -3640,8 +3641,8 @@ Process is recycled and moved to reserved, if it deactivates." (f28-0 819200.0) (f26-0 491520.0) ) - (dotimes (s4-0 (the-as int (-> obj city-info cell-count))) - (let ((s3-0 (-> obj city-info cell-array s4-0))) + (dotimes (s4-0 (the-as int (-> this city-info cell-count))) + (let ((s3-0 (-> this city-info cell-array s4-0))) (let ((f24-0 (vector-vector-distance-squared (-> s3-0 sphere) s5-0)) (f0-1 (+ (-> s3-0 sphere r) f28-0)) ) @@ -3667,25 +3668,25 @@ Process is recycled and moved to reserved, if it deactivates." (if (< (the-as uint (logand (-> s3-0 prev-flags) (vis-cell-flag active-vehicle active-pedestrian))) (the-as uint (logand (-> s3-0 flags) (vis-cell-flag active-vehicle active-pedestrian))) ) - (add-newly-active-cell obj s3-0) + (add-newly-active-cell this s3-0) ) ) ) ) - (countdown (s5-1 (-> obj active-cell-count)) - (let ((v1-32 (-> obj active-cell-list s5-1))) + (countdown (s5-1 (-> this active-cell-count)) + (let ((v1-32 (-> this active-cell-list s5-1))) (when (not (logtest? (-> v1-32 flags) (vis-cell-flag active-vehicle active-pedestrian))) (logclear! (-> v1-32 prev-flags) (vis-cell-flag active-vehicle active-pedestrian)) - (remove-active-cell obj (the-as int s5-1)) + (remove-active-cell this (the-as int s5-1)) ) ) ) - (dotimes (s5-2 (the-as int (-> obj newly-active-cell-count))) - (let ((a1-5 (-> obj newly-active-cell-list s5-2))) - (add-active-cell obj a1-5) + (dotimes (s5-2 (the-as int (-> this newly-active-cell-count))) + (let ((a1-5 (-> this newly-active-cell-list s5-2))) + (add-active-cell this a1-5) ) ) - (let ((v1-43 (-> obj active-cell-box))) + (let ((v1-43 (-> this active-cell-box))) (set-vector! (-> v1-43 min) 10000000000000000000000000000000000000.0 @@ -3700,8 +3701,8 @@ Process is recycled and moved to reserved, if it deactivates." -10000000000000000000000000000000000000.0 1.0 ) - (countdown (a0-23 (-> obj active-cell-count)) - (let ((a1-16 (-> obj active-cell-list a0-23))) + (countdown (a0-23 (-> this active-cell-count)) + (let ((a1-16 (-> this active-cell-list a0-23))) (set! (-> v1-43 min x) (fmin (-> v1-43 min x) (- (-> a1-16 sphere x) (-> a1-16 sphere r)))) (set! (-> v1-43 min y) (fmin (-> v1-43 min y) (- (-> a1-16 sphere y) (-> a1-16 sphere r)))) (set! (-> v1-43 min z) (fmin (-> v1-43 min z) (- (-> a1-16 sphere z) (-> a1-16 sphere r)))) @@ -3716,14 +3717,14 @@ Process is recycled and moved to reserved, if it deactivates." ) ;; definition for method 13 of type city-level-info -(defmethod lookup-cell-by-position city-level-info ((obj city-level-info) (arg0 vector)) +(defmethod lookup-cell-by-position city-level-info ((this city-level-info) (arg0 vector)) (let ((s5-0 (new 'stack-no-clear 'vis-grid-pos))) - (lookup-cell-for-point (-> obj grid-info) s5-0 arg0) - (-> obj + (lookup-cell-for-point (-> this grid-info) s5-0 arg0) + (-> this cell-array (+ (-> s5-0 x) - (* (-> s5-0 z) (-> obj grid-info dimension-array 0)) - (* (* (-> s5-0 y) (-> obj grid-info dimension-array 0)) (-> obj grid-info dimension-array 2)) + (* (-> s5-0 z) (-> this grid-info dimension-array 0)) + (* (* (-> s5-0 y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) ) ) ) @@ -3732,7 +3733,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 10 of type city-level-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-vis-ray city-level-info ((obj city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) +(defmethod init-vis-ray city-level-info ((this city-level-info) (arg0 vis-ray) (arg1 vector) (arg2 vector)) (set! (-> arg0 pos quad) (-> arg1 quad)) (set! (-> arg0 dest-pos quad) (-> arg2 quad)) (let ((v1-2 (new 'stack-no-clear 'vector))) @@ -3744,8 +3745,8 @@ Process is recycled and moved to reserved, if it deactivates." (vector-float*! a0-9 v1-2 (/ 1.0 f0-1)) ) ) - (lookup-cell-for-point (-> obj grid-info) (-> arg0 grid-pos) arg1) - (set! (-> arg0 cell) (lookup-cell-by-position obj arg1)) + (lookup-cell-for-point (-> this grid-info) (-> arg0 grid-pos) arg1) + (set! (-> arg0 cell) (lookup-cell-by-position this arg1)) 0 (none) ) @@ -3753,7 +3754,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 11 of type city-level-info ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod city-level-info-method-11 city-level-info ((obj city-level-info) (arg0 vis-ray)) +(defmethod city-level-info-method-11 city-level-info ((this city-level-info) (arg0 vis-ray)) (local-vars (a3-3 int)) (let ((f0-0 (-> arg0 len)) (s4-0 -1) @@ -3764,7 +3765,7 @@ Process is recycled and moved to reserved, if it deactivates." ) (set! (-> a1-1 quad) (the-as uint128 0)) (set! (-> a1-1 data a0-1) -1.0) - (let ((f1-1 (-> obj grid-info box min data a0-1)) + (let ((f1-1 (-> this grid-info box min data a0-1)) (a2-6 1) ) (let ((a3-2 (-> arg0 dir data a0-1))) @@ -3773,7 +3774,7 @@ Process is recycled and moved to reserved, if it deactivates." (set! (-> a1-1 w) (+ f1-1 (* (the float (+ (- a2-6 (logand a3-3 1)) (-> (the-as (pointer int8) (+ a0-1 (the-as int arg0))) 64))) - (-> obj grid-info cell-size data a0-1) + (-> this grid-info cell-size data a0-1) ) ) ) @@ -3804,11 +3805,11 @@ Process is recycled and moved to reserved, if it deactivates." ) (let ((a1-4 (-> arg0 grid-pos))) (set! (-> arg0 cell) - (-> obj + (-> this cell-array (+ (-> a1-4 x) - (* (-> a1-4 z) (-> obj grid-info dimension-array 0)) - (* (* (-> a1-4 y) (-> obj grid-info dimension-array 0)) (-> obj grid-info dimension-array 2)) + (* (-> a1-4 z) (-> this grid-info dimension-array 0)) + (* (* (-> a1-4 y) (-> this grid-info dimension-array 0)) (-> this grid-info dimension-array 2)) ) ) ) @@ -3822,7 +3823,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 12 of type city-level-info ;; INFO: Used lq/sq -(defmethod city-level-info-method-12 city-level-info ((obj city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector)) +(defmethod city-level-info-method-12 city-level-info ((this city-level-info) (arg0 vector) (arg1 nav-branch) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -3950,10 +3951,10 @@ Process is recycled and moved to reserved, if it deactivates." ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Stack slot offset 48 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod city-level-info-method-18 city-level-info ((obj city-level-info)) +(defmethod city-level-info-method-18 city-level-info ((this city-level-info)) (local-vars (sv-48 int)) (let ((gp-0 (new 'stack-no-clear 'bounding-box)) - (s5-0 (-> obj nav-graph)) + (s5-0 (-> this nav-graph)) ) (set! sv-48 (-> s5-0 node-count)) (dotimes (s4-0 sv-48) @@ -4012,7 +4013,7 @@ Process is recycled and moved to reserved, if it deactivates." ;; WARN: Stack slot offset 100 signed mismatch ;; WARN: Stack slot offset 100 signed mismatch ;; WARN: Return type mismatch object vs symbol. -(defmethod city-level-info-method-9 city-level-info ((obj city-level-info)) +(defmethod city-level-info-method-9 city-level-info ((this city-level-info)) (local-vars (sv-96 (inline-array nav-node)) (sv-100 int) @@ -4032,22 +4033,22 @@ Process is recycled and moved to reserved, if it deactivates." (sv-260 vis-cell) (sv-264 int) ) - (set! (-> obj cell-count) - (the-as uint (* (* (-> obj grid-info dimension-array 0) (-> obj grid-info dimension-array 1)) - (-> obj grid-info dimension-array 2) + (set! (-> this cell-count) + (the-as uint (* (* (-> this grid-info dimension-array 0) (-> this grid-info dimension-array 1)) + (-> this grid-info dimension-array 2) ) ) ) - (let ((s5-0 (-> obj cell-count))) + (let ((s5-0 (-> this cell-count))) (dotimes (s4-0 (the-as int s5-0)) - (reset-segment-counts (-> obj cell-array s4-0)) + (reset-segment-counts (-> this cell-array s4-0)) ) - (when (< 0.01 (-> obj grid-info axis-scale 0)) + (when (< 0.01 (-> this grid-info axis-scale 0)) (format 0 "segments not generates~%") (return (the-as symbol #t)) ) - (set! sv-96 (-> obj nav-graph node-array)) - (set! sv-100 (-> obj nav-graph node-count)) + (set! sv-96 (-> this nav-graph node-array)) + (set! sv-100 (-> this nav-graph node-count)) (set! sv-104 (new 'stack-no-clear 'vis-ray)) (set! sv-112 0) (dotimes (s4-1 sv-100) @@ -4079,13 +4080,13 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (else - (city-level-info-method-12 obj sv-168 a2-0 sv-164) + (city-level-info-method-12 this sv-168 a2-0 sv-164) ) ) - (init-vis-ray obj sv-104 sv-168 sv-164) + (init-vis-ray this sv-104 sv-168 sv-164) (while (< 0.0 (-> sv-104 len)) (set! sv-172 (-> sv-104 cell)) - (city-level-info-method-11 obj sv-104) + (city-level-info-method-11 this sv-104) (+! (-> sv-172 segment-count) 1) (set! sv-112 (+ sv-112 1)) (if (> sv-176 0) @@ -4099,14 +4100,14 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (format 0 "~d segments were generated~%" sv-112) - (set! (-> obj segment-array) (the-as (inline-array nav-segment) (malloc 'debug (* 48 sv-112)))) + (set! (-> this segment-array) (the-as (inline-array nav-segment) (malloc 'debug (* 48 sv-112)))) (let ((v1-59 0)) (dotimes (a0-20 (the-as int s5-0)) - (let ((a1-14 (-> obj cell-array a0-20))) + (let ((a1-14 (-> this cell-array a0-20))) (set! (-> a1-14 id) (the-as uint a0-20)) (set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) #f)) (when (> (-> a1-14 segment-count) 0) - (set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) (-> obj segment-array v1-59))) + (set! (-> a1-14 segment-array) (the-as (inline-array nav-segment) (-> this segment-array v1-59))) (dotimes (a2-8 (-> a1-14 segment-count)) (let ((a3-5 (-> a1-14 segment-array a2-8))) (set! (-> a3-5 id) (the-as uint v1-59)) @@ -4121,7 +4122,7 @@ Process is recycled and moved to reserved, if it deactivates." ) 0 ) - (set! (-> obj segment-count) v1-59) + (set! (-> this segment-count) v1-59) ) ) (dotimes (s5-1 sv-100) @@ -4155,14 +4156,14 @@ Process is recycled and moved to reserved, if it deactivates." ) ) (else - (city-level-info-method-12 obj sv-244 sv-184 sv-252) + (city-level-info-method-12 this sv-244 sv-184 sv-252) ) ) - (init-vis-ray obj sv-104 sv-244 sv-252) + (init-vis-ray this sv-104 sv-244 sv-252) (while (< 0.0 (-> sv-104 len)) (set! (-> sv-248 quad) (-> sv-104 pos quad)) (set! sv-260 (-> sv-104 cell)) - (city-level-info-method-11 obj sv-104) + (city-level-info-method-11 this sv-104) (let ((a2-14 (-> sv-260 incoming-segment-count))) (if (zero? sv-264) (set! a2-14 @@ -4224,8 +4225,8 @@ Process is recycled and moved to reserved, if it deactivates." ;; definition for method 59 of type traffic-engine ;; WARN: Return type mismatch int vs none. -(defmethod debug-check-proc-in-tracker traffic-engine ((obj traffic-engine) (arg0 process) (arg1 int)) - (let ((v1-3 (-> obj tracker-array arg1)) +(defmethod debug-check-proc-in-tracker traffic-engine ((this traffic-engine) (arg0 process) (arg1 int)) + (let ((v1-3 (-> this tracker-array arg1)) (a0-3 (process->handle arg0)) (a3-4 0) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc index f0e95dfba9..583f3407ea 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/traffic-manager_REF.gc @@ -31,20 +31,20 @@ ) ;; definition for method 3 of type traffic-manager -(defmethod inspect traffic-manager ((obj traffic-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect traffic-manager ((this traffic-manager)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttraffic-engine: ~A~%" (-> obj traffic-engine)) - (format #t "~2Tfast-spawn: ~A~%" (-> obj fast-spawn)) - (format #t "~2Tdark-guard-ratio: ~D~%" (-> obj dark-guard-ratio)) - (format #t "~2Tspawn-params: #~%" (-> obj spawn-params)) + (format #t "~2Ttraffic-engine: ~A~%" (-> this traffic-engine)) + (format #t "~2Tfast-spawn: ~A~%" (-> this fast-spawn)) + (format #t "~2Tdark-guard-ratio: ~D~%" (-> this dark-guard-ratio)) + (format #t "~2Tspawn-params: #~%" (-> this spawn-params)) (label cfg-4) - obj + this ) ;; definition for function draw-city-info @@ -71,12 +71,12 @@ ;; definition for method 16 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod update traffic-manager ((obj traffic-manager)) - (update-traffic (-> obj traffic-engine)) - (kill-excess-once obj) - (spawn-all obj) +(defmethod update traffic-manager ((this traffic-manager)) + (update-traffic (-> this traffic-engine)) + (kill-excess-once this) + (spawn-all this) (if *debug-segment* - (debug-unused (-> obj traffic-engine)) + (debug-unused (-> this traffic-engine)) ) (if *display-traffic-height-map* (debug-draw *traffic-height-map* (target-pos 0)) @@ -94,15 +94,15 @@ ;; definition for method 18 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod kill-excess-once traffic-manager ((obj traffic-manager)) +(defmethod kill-excess-once traffic-manager ((this traffic-manager)) (let ((type-i 0)) (while (< (the-as uint type-i) (the-as uint 21)) - (let ((traffic (-> obj traffic-engine object-type-info-array type-i))) + (let ((traffic (-> this traffic-engine object-type-info-array type-i))) (when (logtest? (-> traffic flags) (traffic-type-flags trtflags-1)) (let ((total-count (+ (-> traffic active-count) (-> traffic inactive-count)))) (when (< (-> traffic want-count) total-count) (let ((a0-10 (handle->process (get-from-inactive-by-type - (-> obj traffic-engine tracker-array (-> traffic tracker-index)) + (-> this traffic-engine tracker-array (-> traffic tracker-index)) (the-as traffic-type type-i) ) ) @@ -125,13 +125,13 @@ ;; definition for method 19 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod kill-all-inactive traffic-manager ((obj traffic-manager)) +(defmethod kill-all-inactive traffic-manager ((this traffic-manager)) (let ((s5-0 0)) (while (< (the-as uint s5-0) (the-as uint 21)) - (let ((s4-0 (-> obj traffic-engine object-type-info-array s5-0))) + (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) (countdown (s3-0 (-> s4-0 inactive-count)) (let ((a0-6 (handle->process (get-from-inactive-by-type - (-> obj traffic-engine tracker-array (-> s4-0 tracker-index)) + (-> this traffic-engine tracker-array (-> s4-0 tracker-index)) (the-as traffic-type s5-0) ) ) @@ -152,11 +152,11 @@ ;; definition for method 17 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod spawn-all traffic-manager ((obj traffic-manager)) +(defmethod spawn-all traffic-manager ((this traffic-manager)) (let ((s5-0 0)) (b! #t cfg-4 :delay (nop!)) (label cfg-1) - (let ((s4-0 (-> obj traffic-engine object-type-info-array s5-0))) + (let ((s4-0 (-> this traffic-engine object-type-info-array s5-0))) (logclear! (-> s4-0 flags) (traffic-type-flags trtflags-3)) (if (= (level-status *level* (-> s4-0 level)) 'active) (logior! (-> s4-0 flags) (traffic-type-flags trtflags-3)) @@ -170,16 +170,16 @@ (s4-1 0) (s3-1 #x1fffff) ) - (if (-> obj fast-spawn) + (if (-> this fast-spawn) (set! s5-1 120) ) (b! #t cfg-36 :delay (nop!)) (label cfg-8) - (let* ((s2-0 (-> obj spawn-params)) + (let* ((s2-0 (-> this spawn-params)) (s1-0 (-> s2-0 object-type)) ) (when (logtest? s3-1 (ash 1 s1-0)) - (let ((s0-0 (-> obj traffic-engine object-type-info-array s1-0))) + (let ((s0-0 (-> this traffic-engine object-type-info-array s1-0))) (let ((v1-21 (+ (-> s0-0 active-count) (-> s0-0 inactive-count)))) (b! (not (and (logtest? (-> s0-0 flags) (traffic-type-flags trtflags-1)) @@ -193,8 +193,8 @@ (logclear! (-> s2-0 flags) (traffic-spawn-flags dark-guard)) (b! (not (and (= (-> s2-0 object-type) (traffic-type crimson-guard-1)) - (> (-> obj dark-guard-ratio) 0) - (zero? (mod v1-21 (-> obj dark-guard-ratio))) + (> (-> this dark-guard-ratio) 0) + (zero? (mod v1-21 (-> this dark-guard-ratio))) ) ) cfg-25 @@ -203,9 +203,9 @@ ) (logior! (-> s2-0 flags) (traffic-spawn-flags dark-guard)) (label cfg-25) - (let ((a2-0 (traffic-object-spawn obj s2-0))) + (let ((a2-0 (traffic-object-spawn this s2-0))) (b! (not a2-0) cfg-27 :delay (nop!)) - (add-object (-> obj traffic-engine) s1-0 a2-0) + (add-object (-> this traffic-engine) s1-0 a2-0) ) (+! (-> s0-0 reserve-count) -1) ) @@ -232,7 +232,7 @@ (b! (and (< s4-1 s5-1) (nonzero? s3-1)) cfg-8 :delay (nop!)) ) (label cfg-41) - (set! (-> obj fast-spawn) #f) + (set! (-> this fast-spawn) #f) 0 0 (none) @@ -389,9 +389,9 @@ ;; definition for method 20 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod reset-and-init traffic-manager ((obj traffic-manager)) - (set! (-> obj traffic-engine) *traffic-engine*) - (reset-and-init-from-manager (-> obj traffic-engine) obj) +(defmethod reset-and-init traffic-manager ((this traffic-manager)) + (set! (-> this traffic-engine) *traffic-engine*) + (reset-and-init-from-manager (-> this traffic-engine) this) (restore-city-speeches) 0 (none) @@ -399,28 +399,28 @@ ;; definition for method 7 of type traffic-manager ;; WARN: Return type mismatch process vs traffic-manager. -(defmethod relocate traffic-manager ((obj traffic-manager) (arg0 int)) - (set! *traffic-manager* obj) +(defmethod relocate traffic-manager ((this traffic-manager) (arg0 int)) + (set! *traffic-manager* this) (if *traffic-manager* (set! *traffic-manager* (&+ *traffic-manager* arg0)) ) - (the-as traffic-manager ((method-of-type process relocate) obj arg0)) + (the-as traffic-manager ((method-of-type process relocate) this arg0)) ) ;; definition for method 10 of type traffic-manager -(defmethod deactivate traffic-manager ((obj traffic-manager)) - (stop-alarm-sound (-> obj traffic-engine)) +(defmethod deactivate traffic-manager ((this traffic-manager)) + (stop-alarm-sound (-> this traffic-engine)) (set! *traffic-manager* #f) - (remove-setting *setting-control* obj 'task-mask) + (remove-setting *setting-control* this 'task-mask) (apply-settings *setting-control*) (speech-control-method-9 *speech-control*) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; definition for method 21 of type traffic-manager ;; WARN: Return type mismatch int vs none. -(defmethod init-params traffic-manager ((obj traffic-manager)) +(defmethod init-params traffic-manager ((this traffic-manager)) (let ((traffic-want-counts (new 'stack-no-clear 'array 'int8 21))) (set! (-> traffic-want-counts 11) 8) (set! (-> traffic-want-counts 12) 8) @@ -441,15 +441,15 @@ (set! (-> traffic-want-counts 8) 14) (set! (-> traffic-want-counts 9) 14) (set! (-> traffic-want-counts 10) 14) - (set! (-> obj fast-spawn) *traffic-fast-spawn*) - (reset-and-init obj) - (let ((v1-20 (-> obj traffic-engine))) + (set! (-> this fast-spawn) *traffic-fast-spawn*) + (reset-and-init this) + (let ((v1-20 (-> this traffic-engine))) (dotimes (a0-2 21) (set! (-> v1-20 object-type-info-array a0-2 want-count) (-> traffic-want-counts a0-2)) ) ) ) - (let ((params (-> obj spawn-params))) + (let ((params (-> this spawn-params))) (set! (-> params object-type) (traffic-type crimson-guard-1)) (set! (-> params behavior) (the-as uint 1)) (set! (-> params id) (the-as uint 0)) @@ -469,13 +469,13 @@ ) (set! (-> params id) (the-as uint 1)) ) - (set! (-> obj dark-guard-ratio) (if (task-node-closed? (game-task-node tomb-boss-resolution)) - 5 - 0 - ) + (set! (-> this dark-guard-ratio) (if (task-node-closed? (game-task-node tomb-boss-resolution)) + 5 + 0 + ) ) - (restore-default-settings (-> obj traffic-engine)) - (set! *traffic-manager* obj) + (restore-default-settings (-> this traffic-engine)) + (set! *traffic-manager* this) 0 (none) ) 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 8dd908e500..b3f33005dd 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 @@ -927,32 +927,32 @@ ) ;; definition for method 3 of type bike-base -(defmethod inspect bike-base ((obj bike-base)) - (when (not obj) - (set! obj obj) +(defmethod inspect bike-base ((this bike-base)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 36 of type bike-base ;; WARN: Return type mismatch int vs none. -(defmethod do-engine-sounds bike-base ((obj bike-base)) - ((the-as (function object none) (find-parent-method bike-base 36)) obj) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (if (zero? (-> obj roll-sound-id)) - (set! (-> obj roll-sound-id) (new-sound-id)) +(defmethod do-engine-sounds bike-base ((this bike-base)) + ((the-as (function object none) (find-parent-method bike-base 36)) 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)) ) (let* ((f0-4 (* 4.0 - (-> obj force-scale) - (-> obj sputter-sound-envelope) - (-> obj info inv-max-engine-thrust) - (+ (-> obj roll-thrust 0) (-> obj roll-thrust 1)) + (-> this force-scale) + (-> this sputter-sound-envelope) + (-> this info inv-max-engine-thrust) + (+ (-> this roll-thrust 0) (-> this roll-thrust 1)) ) ) (f1-6 (* 0.32 f0-4)) @@ -960,7 +960,7 @@ ) (sound-play-by-name (static-sound-name "bike-thrust") - (-> obj roll-sound-id) + (-> this roll-sound-id) (the int (* 1024.0 f1-6)) (the int (* 1524.0 f0-5)) 0 @@ -976,12 +976,12 @@ ;; definition for method 85 of type bike-base ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-thrusters bike-base ((obj bike-base)) - ((the-as (function object none) (find-parent-method bike-base 85)) obj) - (when (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) +(defmethod draw-thrusters bike-base ((this bike-base)) + ((the-as (function object none) (find-parent-method bike-base 85)) 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))) - (a3-0 (-> obj node-list data 0 bone transform)) + (a3-0 (-> this node-list data 0 bone transform)) (a0-5 (-> a3-0 quad 0)) (a1-1 (-> a3-0 quad 1)) (a2-0 (-> a3-0 quad 2)) @@ -1006,23 +1006,23 @@ ) ) (dotimes (s2-0 2) - (when (< 0.0 (-> obj roll-thrust s2-0)) + (when (< 0.0 (-> this roll-thrust s2-0)) (vector-rotate*! (-> s5-0 0 vector 1) (-> s3-0 s2-0) (the-as matrix (-> s5-0 0 vector 2))) (vector-matrix*! (the-as vector (-> s5-0 0)) (-> s4-0 s2-0) (the-as matrix (-> s5-0 0 vector 2))) - (let* ((a0-11 obj) + (let* ((a0-11 this) (t9-5 (method-of-object a0-11 draw-thruster)) (a1-5 (-> s5-0 0)) (a2-4 (-> s5-0 0 vector 1)) (a3-2 1638.4) (f0-5 12288.0) - (f1-1 (-> obj info extra gravity)) + (f1-1 (-> this info extra gravity)) ) (t9-5 a0-11 (the-as vector a1-5) a2-4 a3-2 - (* f0-5 (/ 1.0 f1-1) (-> obj info info inv-mass) (-> obj force-scale) (-> obj roll-thrust s2-0)) + (* f0-5 (/ 1.0 f1-1) (-> this info info inv-mass) (-> this force-scale) (-> this roll-thrust s2-0)) ) ) ) @@ -1051,55 +1051,55 @@ ) ;; definition for method 3 of type bikea -(defmethod inspect bikea ((obj bikea)) - (when (not obj) - (set! obj obj) +(defmethod inspect bikea ((this bikea)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bike-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfin-fl: ~A~%" (-> obj fin-fl)) - (format #t "~2Tfin-fr: ~A~%" (-> obj fin-fr)) - (format #t "~2Tfin-rl: ~A~%" (-> obj fin-rl)) - (format #t "~2Tfin-rr: ~A~%" (-> obj fin-rr)) - (format #t "~2Trudder: ~A~%" (-> obj rudder)) - (format #t "~2Tbrake-l: ~A~%" (-> obj brake-l)) - (format #t "~2Tbrake-r: ~A~%" (-> obj brake-r)) + (format #t "~2Tfin-fl: ~A~%" (-> this fin-fl)) + (format #t "~2Tfin-fr: ~A~%" (-> this fin-fr)) + (format #t "~2Tfin-rl: ~A~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: ~A~%" (-> this fin-rr)) + (format #t "~2Trudder: ~A~%" (-> this rudder)) + (format #t "~2Tbrake-l: ~A~%" (-> this brake-l)) + (format #t "~2Tbrake-r: ~A~%" (-> this brake-r)) (label cfg-4) - obj + this ) ;; definition for method 7 of type bikea -(defmethod relocate bikea ((obj bikea) (arg0 int)) - (if (nonzero? (-> obj fin-fl)) - (&+! (-> obj fin-fl) arg0) +(defmethod relocate bikea ((this bikea) (arg0 int)) + (if (nonzero? (-> this fin-fl)) + (&+! (-> this fin-fl) arg0) ) - (if (nonzero? (-> obj fin-fr)) - (&+! (-> obj fin-fr) arg0) + (if (nonzero? (-> this fin-fr)) + (&+! (-> this fin-fr) arg0) ) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - (if (nonzero? (-> obj rudder)) - (&+! (-> obj rudder) arg0) + (if (nonzero? (-> this rudder)) + (&+! (-> this rudder) arg0) ) - (if (nonzero? (-> obj brake-l)) - (&+! (-> obj brake-l) arg0) + (if (nonzero? (-> this brake-l)) + (&+! (-> this brake-l) arg0) ) - (if (nonzero? (-> obj brake-r)) - (&+! (-> obj brake-r) arg0) + (if (nonzero? (-> this brake-r)) + (&+! (-> this brake-r) arg0) ) - ((the-as (function object int bikea) (find-parent-method bikea 7)) obj arg0) + ((the-as (function object int bikea) (find-parent-method bikea 7)) this arg0) ) ;; definition for method 32 of type bikea ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape bikea ((obj bikea)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape bikea ((this bikea)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1145,7 +1145,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1153,19 +1153,19 @@ ;; definition for method 86 of type bikea ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods bikea ((obj bikea)) - (let ((f30-0 (* 5461.3335 (-> obj controls steering))) - (f26-0 (* -5461.3335 (-> obj controls lean-z))) - (f28-0 (* -13653.333 (-> obj controls brake))) +(defmethod update-joint-mods bikea ((this bikea)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f26-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* -13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin-fl rotation) s5-0 (- (* -0.2 f26-0) f30-0)) - (quaternion-vector-angle! (-> obj fin-fr rotation) s5-0 (- (* 0.2 f26-0) f30-0)) - (quaternion-vector-angle! (-> obj rudder rotation) s5-0 f30-0) - (quaternion-vector-angle! (-> obj brake-l rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj brake-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (* -0.2 f26-0) f30-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (* 0.2 f26-0) f30-0)) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) ) 0 (none) @@ -1173,20 +1173,20 @@ ;; definition for method 33 of type bikea ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body bikea ((obj bikea)) +(defmethod init-skel-and-rigid-body bikea ((this bikea)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *bikea-constants*) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj brake-l) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj brake-r) (new 'process 'joint-mod-rotate-local obj 10 #t)) + (alloc-and-init-rigid-body-control this *bikea-constants*) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 10 #t)) 0 (none) ) @@ -1209,59 +1209,59 @@ ) ;; definition for method 3 of type bikeb -(defmethod inspect bikeb ((obj bikeb)) - (when (not obj) - (set! obj obj) +(defmethod inspect bikeb ((this bikeb)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bike-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfin-rl: ~A~%" (-> obj fin-rl)) - (format #t "~2Tfin-rr: ~A~%" (-> obj fin-rr)) - (format #t "~2Trudder: ~A~%" (-> obj rudder)) - (format #t "~2Trudder-f: ~A~%" (-> obj rudder-f)) - (format #t "~2Tbrake-l: ~A~%" (-> obj brake-l)) - (format #t "~2Tbrake-r: ~A~%" (-> obj brake-r)) - (format #t "~2Tflap-l: ~A~%" (-> obj flap-l)) - (format #t "~2Tflap-r: ~A~%" (-> obj flap-r)) + (format #t "~2Tfin-rl: ~A~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: ~A~%" (-> this fin-rr)) + (format #t "~2Trudder: ~A~%" (-> this rudder)) + (format #t "~2Trudder-f: ~A~%" (-> this rudder-f)) + (format #t "~2Tbrake-l: ~A~%" (-> this brake-l)) + (format #t "~2Tbrake-r: ~A~%" (-> this brake-r)) + (format #t "~2Tflap-l: ~A~%" (-> this flap-l)) + (format #t "~2Tflap-r: ~A~%" (-> this flap-r)) (label cfg-4) - obj + this ) ;; definition for method 7 of type bikeb -(defmethod relocate bikeb ((obj bikeb) (arg0 int)) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) +(defmethod relocate bikeb ((this bikeb) (arg0 int)) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - (if (nonzero? (-> obj rudder)) - (&+! (-> obj rudder) arg0) + (if (nonzero? (-> this rudder)) + (&+! (-> this rudder) arg0) ) - (if (nonzero? (-> obj rudder-f)) - (&+! (-> obj rudder-f) arg0) + (if (nonzero? (-> this rudder-f)) + (&+! (-> this rudder-f) arg0) ) - (if (nonzero? (-> obj brake-l)) - (&+! (-> obj brake-l) arg0) + (if (nonzero? (-> this brake-l)) + (&+! (-> this brake-l) arg0) ) - (if (nonzero? (-> obj brake-r)) - (&+! (-> obj brake-r) arg0) + (if (nonzero? (-> this brake-r)) + (&+! (-> this brake-r) arg0) ) - (if (nonzero? (-> obj flap-l)) - (&+! (-> obj flap-l) arg0) + (if (nonzero? (-> this flap-l)) + (&+! (-> this flap-l) arg0) ) - (if (nonzero? (-> obj flap-r)) - (&+! (-> obj flap-r) arg0) + (if (nonzero? (-> this flap-r)) + (&+! (-> this flap-r) arg0) ) - ((the-as (function object int bikeb) (find-parent-method bikeb 7)) obj arg0) + ((the-as (function object int bikeb) (find-parent-method bikeb 7)) this arg0) ) ;; definition for method 32 of type bikeb ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape bikeb ((obj bikeb)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape bikeb ((this bikeb)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1307,7 +1307,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1315,20 +1315,20 @@ ;; definition for method 86 of type bikeb ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods bikeb ((obj bikeb)) - (let ((f30-0 (* 5461.3335 (-> obj controls steering))) - (f26-0 (* -5461.3335 (-> obj controls lean-z))) - (f28-0 (* 13653.333 (-> obj controls brake))) +(defmethod update-joint-mods bikeb ((this bikeb)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f26-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj rudder rotation) s5-0 f30-0) - (quaternion-vector-angle! (-> obj rudder-f rotation) s5-0 (- f30-0)) - (quaternion-vector-angle! (-> obj brake-l rotation) s5-0 (- f28-0)) - (quaternion-vector-angle! (-> obj brake-r rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj flap-l rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj flap-r rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this rudder-f rotation) s5-0 (- f30-0)) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this flap-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this flap-r rotation) s5-0 (- f28-0)) ) 0 (none) @@ -1336,21 +1336,21 @@ ;; definition for method 33 of type bikeb ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body bikeb ((obj bikeb)) +(defmethod init-skel-and-rigid-body bikeb ((this bikeb)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikeb" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *bikeb-constants*) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj rudder-f) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj brake-l) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj brake-r) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj flap-l) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj flap-r) (new 'process 'joint-mod-rotate-local obj 11 #t)) + (alloc-and-init-rigid-body-control this *bikeb-constants*) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this rudder-f) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this flap-l) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this flap-r) (new 'process 'joint-mod-rotate-local this 11 #t)) 0 (none) ) @@ -1376,71 +1376,71 @@ ) ;; definition for method 3 of type bikec -(defmethod inspect bikec ((obj bikec)) - (when (not obj) - (set! obj obj) +(defmethod inspect bikec ((this bikec)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bike-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfin-fl: ~A~%" (-> obj fin-fl)) - (format #t "~2Tfin-fr: ~A~%" (-> obj fin-fr)) - (format #t "~2Tfin-rl: ~A~%" (-> obj fin-rl)) - (format #t "~2Tfin-rr: ~A~%" (-> obj fin-rr)) - (format #t "~2Tfin2-fl: ~A~%" (-> obj fin2-fl)) - (format #t "~2Tfin2-fr: ~A~%" (-> obj fin2-fr)) - (format #t "~2Trudder: ~A~%" (-> obj rudder)) - (format #t "~2Tbrake-l: ~A~%" (-> obj brake-l)) - (format #t "~2Tbrake-r: ~A~%" (-> obj brake-r)) - (format #t "~2Tspoiler-l: ~A~%" (-> obj spoiler-l)) - (format #t "~2Tspoiler-r: ~A~%" (-> obj spoiler-r)) + (format #t "~2Tfin-fl: ~A~%" (-> this fin-fl)) + (format #t "~2Tfin-fr: ~A~%" (-> this fin-fr)) + (format #t "~2Tfin-rl: ~A~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: ~A~%" (-> this fin-rr)) + (format #t "~2Tfin2-fl: ~A~%" (-> this fin2-fl)) + (format #t "~2Tfin2-fr: ~A~%" (-> this fin2-fr)) + (format #t "~2Trudder: ~A~%" (-> this rudder)) + (format #t "~2Tbrake-l: ~A~%" (-> this brake-l)) + (format #t "~2Tbrake-r: ~A~%" (-> this brake-r)) + (format #t "~2Tspoiler-l: ~A~%" (-> this spoiler-l)) + (format #t "~2Tspoiler-r: ~A~%" (-> this spoiler-r)) (label cfg-4) - obj + this ) ;; definition for method 7 of type bikec -(defmethod relocate bikec ((obj bikec) (arg0 int)) - (if (nonzero? (-> obj fin-fl)) - (&+! (-> obj fin-fl) arg0) +(defmethod relocate bikec ((this bikec) (arg0 int)) + (if (nonzero? (-> this fin-fl)) + (&+! (-> this fin-fl) arg0) ) - (if (nonzero? (-> obj fin-fr)) - (&+! (-> obj fin-fr) arg0) + (if (nonzero? (-> this fin-fr)) + (&+! (-> this fin-fr) arg0) ) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - (if (nonzero? (-> obj fin2-fl)) - (&+! (-> obj fin2-fl) arg0) + (if (nonzero? (-> this fin2-fl)) + (&+! (-> this fin2-fl) arg0) ) - (if (nonzero? (-> obj fin2-fr)) - (&+! (-> obj fin2-fr) arg0) + (if (nonzero? (-> this fin2-fr)) + (&+! (-> this fin2-fr) arg0) ) - (if (nonzero? (-> obj rudder)) - (&+! (-> obj rudder) arg0) + (if (nonzero? (-> this rudder)) + (&+! (-> this rudder) arg0) ) - (if (nonzero? (-> obj brake-l)) - (&+! (-> obj brake-l) arg0) + (if (nonzero? (-> this brake-l)) + (&+! (-> this brake-l) arg0) ) - (if (nonzero? (-> obj brake-r)) - (&+! (-> obj brake-r) arg0) + (if (nonzero? (-> this brake-r)) + (&+! (-> this brake-r) arg0) ) - (if (nonzero? (-> obj spoiler-l)) - (&+! (-> obj spoiler-l) arg0) + (if (nonzero? (-> this spoiler-l)) + (&+! (-> this spoiler-l) arg0) ) - (if (nonzero? (-> obj spoiler-r)) - (&+! (-> obj spoiler-r) arg0) + (if (nonzero? (-> this spoiler-r)) + (&+! (-> this spoiler-r) arg0) ) - ((the-as (function object int bikec) (find-parent-method bikec 7)) obj arg0) + ((the-as (function object int bikec) (find-parent-method bikec 7)) this arg0) ) ;; definition for method 32 of type bikec ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape bikec ((obj bikec)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape bikec ((this bikec)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1486,7 +1486,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1494,23 +1494,23 @@ ;; definition for method 86 of type bikec ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods bikec ((obj bikec)) - (let ((f30-0 (* 5461.3335 (-> obj controls steering))) - (f26-0 (* -5461.3335 (-> obj controls lean-z))) - (f28-0 (* 13653.333 (-> obj controls brake))) +(defmethod update-joint-mods bikec ((this bikec)) + (let ((f30-0 (* 5461.3335 (-> this controls steering))) + (f26-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 13653.333 (-> this controls brake))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj fin-fl rotation) s5-0 (- f26-0)) - (quaternion-vector-angle! (-> obj fin-fr rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> obj fin2-fl rotation) s5-0 (- f26-0)) - (quaternion-vector-angle! (-> obj fin2-fr rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> obj fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) - (quaternion-vector-angle! (-> obj rudder rotation) s5-0 f30-0) - (quaternion-vector-angle! (-> obj brake-l rotation) s5-0 (- f28-0)) - (quaternion-vector-angle! (-> obj brake-r rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj spoiler-l rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj spoiler-r rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin2-fl rotation) s5-0 (- f26-0)) + (quaternion-vector-angle! (-> this fin2-fr rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0))) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this spoiler-l rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this spoiler-r rotation) s5-0 (- f28-0)) ) 0 (none) @@ -1518,24 +1518,24 @@ ;; definition for method 33 of type bikec ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body bikec ((obj bikec)) +(defmethod init-skel-and-rigid-body bikec ((this bikec)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikec" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *bikec-constants*) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj fin2-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin2-fr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj brake-l) (new 'process 'joint-mod-rotate-local obj 11 #t)) - (set! (-> obj brake-r) (new 'process 'joint-mod-rotate-local obj 12 #t)) - (set! (-> obj spoiler-l) (new 'process 'joint-mod-rotate-local obj 13 #t)) - (set! (-> obj spoiler-r) (new 'process 'joint-mod-rotate-local obj 14 #t)) + (alloc-and-init-rigid-body-control this *bikec-constants*) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this fin2-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin2-fr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 11 #t)) + (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 12 #t)) + (set! (-> this spoiler-l) (new 'process 'joint-mod-rotate-local this 13 #t)) + (set! (-> this spoiler-r) (new 'process 'joint-mod-rotate-local this 14 #t)) 0 (none) ) @@ -1573,43 +1573,43 @@ ) ;; definition for method 3 of type guard-bike -(defmethod inspect guard-bike ((obj guard-bike)) - (when (not obj) - (set! obj obj) +(defmethod inspect guard-bike ((this guard-bike)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-guard inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tturret-jm: ~A~%" (-> obj turret-jm)) + (format #t "~2Tturret-jm: ~A~%" (-> this turret-jm)) (label cfg-4) - obj + this ) ;; definition for method 7 of type guard-bike -(defmethod relocate guard-bike ((obj guard-bike) (arg0 int)) - (if (nonzero? (-> obj turret-jm)) - (&+! (-> obj turret-jm) arg0) +(defmethod relocate guard-bike ((this guard-bike) (arg0 int)) + (if (nonzero? (-> this turret-jm)) + (&+! (-> this turret-jm) arg0) ) - ((the-as (function object int guard-bike) (find-parent-method guard-bike 7)) obj arg0) + ((the-as (function object int guard-bike) (find-parent-method guard-bike 7)) this arg0) ) ;; definition for method 65 of type guard-bike ;; WARN: Return type mismatch int vs none. -(defmethod start-jump guard-bike ((obj guard-bike)) - (when (not (logtest? (rigid-body-object-flag jump-sound) (-> obj flags))) - (logior! (-> obj flags) (rigid-body-object-flag jump-sound)) +(defmethod start-jump guard-bike ((this guard-bike)) + (when (not (logtest? (rigid-body-object-flag jump-sound) (-> this flags))) + (logior! (-> this flags) (rigid-body-object-flag jump-sound)) (sound-play "bike-hop") ) - (logior! (-> obj flags) (rigid-body-object-flag jump)) + (logior! (-> this flags) (rigid-body-object-flag jump)) 0 (none) ) ;; definition for method 32 of type guard-bike ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape guard-bike ((obj guard-bike)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape guard-bike ((this guard-bike)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1655,7 +1655,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1663,23 +1663,23 @@ ;; definition for method 86 of type guard-bike ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods guard-bike ((obj guard-bike)) - (update-joint-mod (-> obj turret) (-> obj turret-jm)) +(defmethod update-joint-mods guard-bike ((this guard-bike)) + (update-joint-mod (-> this turret) (-> this turret-jm)) 0 (none) ) ;; definition for method 33 of type guard-bike ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body guard-bike ((obj guard-bike)) +(defmethod init-skel-and-rigid-body guard-bike ((this guard-bike)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-guard-bike" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *guard-bike-constants*) - (set-info (-> obj turret) *guard-bike-turret-control-info*) - (set! (-> obj turret-jm) (new 'process 'joint-mod-rotate-local obj (-> obj turret info joint-index) #t)) + (alloc-and-init-rigid-body-control this *guard-bike-constants*) + (set-info (-> this turret) *guard-bike-turret-control-info*) + (set! (-> this turret-jm) (new 'process 'joint-mod-rotate-local this (-> this turret info joint-index) #t)) 0 (none) ) 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 69fd6ed4ff..af300f88bc 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 @@ -1122,26 +1122,26 @@ ) ;; definition for method 3 of type car-base -(defmethod inspect car-base ((obj car-base)) - (when (not obj) - (set! obj obj) +(defmethod inspect car-base ((this car-base)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trider-hand-joint-array[2] @ #x~X~%" (-> obj rider-hand-joint-array)) + (format #t "~2Trider-hand-joint-array[2] @ #x~X~%" (-> this rider-hand-joint-array)) (label cfg-4) - obj + this ) ;; definition for method 117 of type car-base ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-117 car-base ((obj car-base) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 car-base ((this car-base) (arg0 vector) (arg1 int) (arg2 int)) (vector-matrix*! arg0 - (-> obj info rider-hand-offset arg2) - (-> obj node-list data (-> obj rider-hand-joint-array arg1) bone transform) + (-> this info rider-hand-offset arg2) + (-> this node-list data (-> this rider-hand-joint-array arg1) bone transform) ) 0 (none) @@ -1166,63 +1166,63 @@ ) ;; definition for method 3 of type cara -(defmethod inspect cara ((obj cara)) - (when (not obj) - (set! obj obj) +(defmethod inspect cara ((this cara)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type car-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsteering-wheel-l: ~A~%" (-> obj steering-wheel-l)) - (format #t "~2Tsteering-wheel-r: ~A~%" (-> obj steering-wheel-r)) - (format #t "~2Tfin-fl: ~A~%" (-> obj fin-fl)) - (format #t "~2Tfin-fr: ~A~%" (-> obj fin-fr)) - (format #t "~2Tfin-rl: ~A~%" (-> obj fin-rl)) - (format #t "~2Tfin-rr: ~A~%" (-> obj fin-rr)) - (format #t "~2Trudder-l: ~A~%" (-> obj rudder-l)) - (format #t "~2Trudder-r: ~A~%" (-> obj rudder-r)) - (format #t "~2Trudder: ~A~%" (-> obj rudder)) + (format #t "~2Tsteering-wheel-l: ~A~%" (-> this steering-wheel-l)) + (format #t "~2Tsteering-wheel-r: ~A~%" (-> this steering-wheel-r)) + (format #t "~2Tfin-fl: ~A~%" (-> this fin-fl)) + (format #t "~2Tfin-fr: ~A~%" (-> this fin-fr)) + (format #t "~2Tfin-rl: ~A~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: ~A~%" (-> this fin-rr)) + (format #t "~2Trudder-l: ~A~%" (-> this rudder-l)) + (format #t "~2Trudder-r: ~A~%" (-> this rudder-r)) + (format #t "~2Trudder: ~A~%" (-> this rudder)) (label cfg-4) - obj + this ) ;; definition for method 7 of type cara -(defmethod relocate cara ((obj cara) (arg0 int)) - (if (nonzero? (-> obj steering-wheel-l)) - (&+! (-> obj steering-wheel-l) arg0) +(defmethod relocate cara ((this cara) (arg0 int)) + (if (nonzero? (-> this steering-wheel-l)) + (&+! (-> this steering-wheel-l) arg0) ) - (if (nonzero? (-> obj steering-wheel-r)) - (&+! (-> obj steering-wheel-r) arg0) + (if (nonzero? (-> this steering-wheel-r)) + (&+! (-> this steering-wheel-r) arg0) ) - (if (nonzero? (-> obj fin-fl)) - (&+! (-> obj fin-fl) arg0) + (if (nonzero? (-> this fin-fl)) + (&+! (-> this fin-fl) arg0) ) - (if (nonzero? (-> obj fin-fr)) - (&+! (-> obj fin-fr) arg0) + (if (nonzero? (-> this fin-fr)) + (&+! (-> this fin-fr) arg0) ) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - (if (nonzero? (-> obj rudder)) - (&+! (-> obj rudder) arg0) + (if (nonzero? (-> this rudder)) + (&+! (-> this rudder) arg0) ) - (if (nonzero? (-> obj rudder-l)) - (&+! (-> obj rudder-l) arg0) + (if (nonzero? (-> this rudder-l)) + (&+! (-> this rudder-l) arg0) ) - (if (nonzero? (-> obj rudder-r)) - (&+! (-> obj rudder-r) arg0) + (if (nonzero? (-> this rudder-r)) + (&+! (-> this rudder-r) arg0) ) - ((the-as (function object object cara) (find-parent-method cara 7)) obj arg0) + ((the-as (function object object cara) (find-parent-method cara 7)) this arg0) ) ;; definition for method 32 of type cara ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape cara ((obj cara)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape cara ((this cara)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1278,7 +1278,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1286,19 +1286,19 @@ ;; definition for method 86 of type cara ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods cara ((obj cara)) - (let ((f30-0 (* 3640.889 (-> obj controls steering))) - (f26-0 (* 9102.223 (-> obj controls steering))) - (f28-0 (* -3640.889 (-> obj controls lean-z))) +(defmethod update-joint-mods cara ((this cara)) + (let ((f30-0 (* 3640.889 (-> this controls steering))) + (f26-0 (* 9102.223 (-> this controls steering))) + (f28-0 (* -3640.889 (-> this controls lean-z))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj steering-wheel-l rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> obj steering-wheel-r rotation) s5-0 f26-0) - (quaternion-vector-angle! (-> obj fin-fl rotation) s5-0 (- f28-0)) - (quaternion-vector-angle! (-> obj fin-fr rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj fin-rl rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj fin-rr rotation) s5-0 (- f28-0)) - (quaternion-vector-angle! (-> obj rudder rotation) s5-0 f30-0) + (quaternion-vector-angle! (-> this steering-wheel-l rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this steering-wheel-r rotation) s5-0 f26-0) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0) ) 0 (none) @@ -1306,24 +1306,24 @@ ;; definition for method 33 of type cara ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body cara ((obj cara)) +(defmethod init-skel-and-rigid-body cara ((this cara)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cara" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *cara-constants*) - (set! (-> obj rider-hand-joint-array 0) 11) - (set! (-> obj rider-hand-joint-array 1) 12) - (set! (-> obj steering-wheel-l) (new 'process 'joint-mod-rotate-local obj 11 #t)) - (set! (-> obj steering-wheel-r) (new 'process 'joint-mod-rotate-local obj 12 #t)) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj rudder-l) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj rudder-r) (new 'process 'joint-mod-rotate-local obj 9 #t)) + (alloc-and-init-rigid-body-control this *cara-constants*) + (set! (-> this rider-hand-joint-array 0) 11) + (set! (-> this rider-hand-joint-array 1) 12) + (set! (-> this steering-wheel-l) (new 'process 'joint-mod-rotate-local this 11 #t)) + (set! (-> this steering-wheel-r) (new 'process 'joint-mod-rotate-local this 12 #t)) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this rudder-l) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this rudder-r) (new 'process 'joint-mod-rotate-local this 9 #t)) 0 (none) ) @@ -1344,51 +1344,51 @@ ) ;; definition for method 3 of type carb -(defmethod inspect carb ((obj carb)) - (when (not obj) - (set! obj obj) +(defmethod inspect carb ((this carb)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type car-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsteering-wheel-l: ~A~%" (-> obj steering-wheel-l)) - (format #t "~2Tsteering-wheel-r: ~A~%" (-> obj steering-wheel-r)) - (format #t "~2Tfin-fl: ~A~%" (-> obj fin-fl)) - (format #t "~2Tfin-fr: ~A~%" (-> obj fin-fr)) - (format #t "~2Tfin-rl: ~A~%" (-> obj fin-rl)) - (format #t "~2Tfin-rr: ~A~%" (-> obj fin-rr)) + (format #t "~2Tsteering-wheel-l: ~A~%" (-> this steering-wheel-l)) + (format #t "~2Tsteering-wheel-r: ~A~%" (-> this steering-wheel-r)) + (format #t "~2Tfin-fl: ~A~%" (-> this fin-fl)) + (format #t "~2Tfin-fr: ~A~%" (-> this fin-fr)) + (format #t "~2Tfin-rl: ~A~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: ~A~%" (-> this fin-rr)) (label cfg-4) - obj + this ) ;; definition for method 7 of type carb -(defmethod relocate carb ((obj carb) (arg0 int)) - (if (nonzero? (-> obj steering-wheel-l)) - (&+! (-> obj steering-wheel-l) arg0) +(defmethod relocate carb ((this carb) (arg0 int)) + (if (nonzero? (-> this steering-wheel-l)) + (&+! (-> this steering-wheel-l) arg0) ) - (if (nonzero? (-> obj steering-wheel-r)) - (&+! (-> obj steering-wheel-r) arg0) + (if (nonzero? (-> this steering-wheel-r)) + (&+! (-> this steering-wheel-r) arg0) ) - (if (nonzero? (-> obj fin-fl)) - (&+! (-> obj fin-fl) arg0) + (if (nonzero? (-> this fin-fl)) + (&+! (-> this fin-fl) arg0) ) - (if (nonzero? (-> obj fin-fr)) - (&+! (-> obj fin-fr) arg0) + (if (nonzero? (-> this fin-fr)) + (&+! (-> this fin-fr) arg0) ) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - ((the-as (function object object carb) (find-parent-method carb 7)) obj arg0) + ((the-as (function object object carb) (find-parent-method carb 7)) this arg0) ) ;; definition for method 32 of type carb ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape carb ((obj carb)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape carb ((this carb)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1444,7 +1444,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1452,17 +1452,17 @@ ;; definition for method 86 of type carb ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods carb ((obj carb)) - (let ((f30-0 (* -5461.3335 (-> obj controls lean-z))) - (f28-0 (* 9102.223 (-> obj controls steering))) +(defmethod update-joint-mods carb ((this carb)) + (let ((f30-0 (* -5461.3335 (-> this controls lean-z))) + (f28-0 (* 9102.223 (-> this controls steering))) (gp-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj steering-wheel-l rotation) gp-0 f28-0) - (quaternion-vector-angle! (-> obj steering-wheel-r rotation) gp-0 f28-0) - (quaternion-vector-angle! (-> obj fin-fl rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) - (quaternion-vector-angle! (-> obj fin-fr rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) - (quaternion-vector-angle! (-> obj fin-rl rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) - (quaternion-vector-angle! (-> obj fin-rr rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this steering-wheel-l rotation) gp-0 f28-0) + (quaternion-vector-angle! (-> this steering-wheel-r rotation) gp-0 f28-0) + (quaternion-vector-angle! (-> this fin-fl rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-fr rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-rl rotation) gp-0 (+ (* 0.8 f30-0) (* 0.4 f28-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) gp-0 (+ (* -0.8 f30-0) (* 0.4 f28-0))) ) 0 (none) @@ -1470,21 +1470,21 @@ ;; definition for method 33 of type carb ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body carb ((obj carb)) +(defmethod init-skel-and-rigid-body carb ((this carb)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-carb" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *carb-constants*) - (set! (-> obj rider-hand-joint-array 0) 8) - (set! (-> obj rider-hand-joint-array 1) 9) - (set! (-> obj steering-wheel-l) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj steering-wheel-r) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 7 #t)) + (alloc-and-init-rigid-body-control this *carb-constants*) + (set! (-> this rider-hand-joint-array 0) 8) + (set! (-> this rider-hand-joint-array 1) 9) + (set! (-> this steering-wheel-l) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this steering-wheel-r) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 7 #t)) 0 (none) ) @@ -1506,56 +1506,56 @@ ) ;; definition for method 3 of type carc -(defmethod inspect carc ((obj carc)) - (when (not obj) - (set! obj obj) +(defmethod inspect carc ((this carc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type car-base inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsteering-wheel: ~A~%" (-> obj steering-wheel)) - (format #t "~2Tfin-fl: ~A~%" (-> obj fin-fl)) - (format #t "~2Tfin-fr: ~A~%" (-> obj fin-fr)) - (format #t "~2Tfin-rl: ~A~%" (-> obj fin-rl)) - (format #t "~2Tfin-rr: ~A~%" (-> obj fin-rr)) - (format #t "~2Tfin2-rl: ~A~%" (-> obj fin2-rl)) - (format #t "~2Tfin2-rr: ~A~%" (-> obj fin2-rr)) + (format #t "~2Tsteering-wheel: ~A~%" (-> this steering-wheel)) + (format #t "~2Tfin-fl: ~A~%" (-> this fin-fl)) + (format #t "~2Tfin-fr: ~A~%" (-> this fin-fr)) + (format #t "~2Tfin-rl: ~A~%" (-> this fin-rl)) + (format #t "~2Tfin-rr: ~A~%" (-> this fin-rr)) + (format #t "~2Tfin2-rl: ~A~%" (-> this fin2-rl)) + (format #t "~2Tfin2-rr: ~A~%" (-> this fin2-rr)) (label cfg-4) - obj + this ) ;; definition for method 7 of type carc ;; WARN: Return type mismatch carb vs carc. -(defmethod relocate carc ((obj carc) (arg0 int)) - (if (nonzero? (-> obj steering-wheel)) - (&+! (-> obj steering-wheel) arg0) +(defmethod relocate carc ((this carc) (arg0 int)) + (if (nonzero? (-> this steering-wheel)) + (&+! (-> this steering-wheel) arg0) ) - (if (nonzero? (-> obj fin-fl)) - (&+! (-> obj fin-fl) arg0) + (if (nonzero? (-> this fin-fl)) + (&+! (-> this fin-fl) arg0) ) - (if (nonzero? (-> obj fin-fr)) - (&+! (-> obj fin-fr) arg0) + (if (nonzero? (-> this fin-fr)) + (&+! (-> this fin-fr) arg0) ) - (if (nonzero? (-> obj fin-rl)) - (&+! (-> obj fin-rl) arg0) + (if (nonzero? (-> this fin-rl)) + (&+! (-> this fin-rl) arg0) ) - (if (nonzero? (-> obj fin-rr)) - (&+! (-> obj fin-rr) arg0) + (if (nonzero? (-> this fin-rr)) + (&+! (-> this fin-rr) arg0) ) - (if (nonzero? (-> obj fin2-rl)) - (&+! (-> obj fin2-rl) arg0) + (if (nonzero? (-> this fin2-rl)) + (&+! (-> this fin2-rl) arg0) ) - (if (nonzero? (-> obj fin2-rr)) - (&+! (-> obj fin2-rr) arg0) + (if (nonzero? (-> this fin2-rr)) + (&+! (-> this fin2-rr) arg0) ) - (the-as carc ((the-as (function object object carb) (find-parent-method carc 7)) obj arg0)) + (the-as carc ((the-as (function object object carb) (find-parent-method carc 7)) this arg0)) ) ;; definition for method 32 of type carc ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape carc ((obj carc)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape carc ((this carc)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1606,7 +1606,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1614,19 +1614,19 @@ ;; definition for method 86 of type carc ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods carc ((obj carc)) - (let ((f30-0 (* -5461.3335 (-> obj controls steering))) - (f28-0 (* -5461.3335 (-> obj controls lean-z))) - (f0-3 (* 9102.223 (-> obj controls steering))) +(defmethod update-joint-mods carc ((this carc)) + (let ((f30-0 (* -5461.3335 (-> this controls steering))) + (f28-0 (* -5461.3335 (-> this controls lean-z))) + (f0-3 (* 9102.223 (-> this controls steering))) (s5-0 (new 'static 'vector :x 1.0 :w 1.0)) ) - (quaternion-vector-angle! (-> obj steering-wheel rotation) s5-0 f0-3) - (quaternion-vector-angle! (-> obj fin-fl rotation) s5-0 (- f28-0)) - (quaternion-vector-angle! (-> obj fin-fr rotation) s5-0 f28-0) - (quaternion-vector-angle! (-> obj fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) - (quaternion-vector-angle! (-> obj fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) - (quaternion-vector-angle! (-> obj fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this steering-wheel rotation) s5-0 f0-3) + (quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0)) + (quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0) + (quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0))) + (quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0))) + (quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0))) + (quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0))) ) 0 (none) @@ -1634,21 +1634,21 @@ ;; definition for method 33 of type carc ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body carc ((obj carc)) +(defmethod init-skel-and-rigid-body carc ((this carc)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-carc" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *carc-constants*) - (set! (-> obj rider-hand-joint-array 0) 10) - (set! (-> obj steering-wheel) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj fin2-rl) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin2-rr) (new 'process 'joint-mod-rotate-local obj 7 #t)) + (alloc-and-init-rigid-body-control this *carc-constants*) + (set! (-> this rider-hand-joint-array 0) 10) + (set! (-> this steering-wheel) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this fin2-rl) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin2-rr) (new 'process 'joint-mod-rotate-local this 7 #t)) 0 (none) ) @@ -1686,31 +1686,31 @@ ) ;; definition for method 3 of type hellcat -(defmethod inspect hellcat ((obj hellcat)) - (when (not obj) - (set! obj obj) +(defmethod inspect hellcat ((this hellcat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-guard inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tturret-jm: ~A~%" (-> obj turret-jm)) + (format #t "~2Tturret-jm: ~A~%" (-> this turret-jm)) (label cfg-4) - obj + this ) ;; definition for method 7 of type hellcat -(defmethod relocate hellcat ((obj hellcat) (arg0 int)) - (if (nonzero? (-> obj turret-jm)) - (&+! (-> obj turret-jm) arg0) +(defmethod relocate hellcat ((this hellcat) (arg0 int)) + (if (nonzero? (-> this turret-jm)) + (&+! (-> this turret-jm) arg0) ) - ((the-as (function object object hellcat) (find-parent-method hellcat 7)) obj arg0) + ((the-as (function object object hellcat) (find-parent-method hellcat 7)) this arg0) ) ;; definition for method 32 of type hellcat ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape hellcat ((obj hellcat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape hellcat ((this hellcat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1765,7 +1765,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1773,27 +1773,23 @@ ;; definition for method 86 of type hellcat ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods hellcat ((obj hellcat)) - (update-joint-mod (-> obj turret) (-> obj turret-jm)) +(defmethod update-joint-mods hellcat ((this hellcat)) + (update-joint-mod (-> this turret) (-> this turret-jm)) 0 (none) ) ;; definition for method 33 of type hellcat ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body hellcat ((obj hellcat)) +(defmethod init-skel-and-rigid-body hellcat ((this hellcat)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hellcat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *hellcat-constants*) - (set-info (-> obj turret) *hellcat-front-turret-control-info*) - (set! (-> obj turret-jm) (new 'process 'joint-mod-rotate-local obj (-> obj turret info joint-index) #t)) + (alloc-and-init-rigid-body-control this *hellcat-constants*) + (set-info (-> this turret) *hellcat-front-turret-control-info*) + (set! (-> this turret-jm) (new 'process 'joint-mod-rotate-local this (-> this turret info joint-index) #t)) 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-bike_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-bike_REF.gc index 7654f6b617..bd45031098 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-bike_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-bike_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type test-bike -(defmethod inspect test-bike ((obj test-bike)) - (when (not obj) - (set! obj obj) +(defmethod inspect test-bike ((this test-bike)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bikec inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol *test-bike-constants*, type rigid-body-vehicle-constants @@ -233,24 +233,24 @@ ;; definition for method 33 of type test-bike ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body test-bike ((obj test-bike)) +(defmethod init-skel-and-rigid-body test-bike ((this test-bike)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikec" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *test-bike-constants*) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj fin2-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin2-fr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj brake-l) (new 'process 'joint-mod-rotate-local obj 11 #t)) - (set! (-> obj brake-r) (new 'process 'joint-mod-rotate-local obj 12 #t)) - (set! (-> obj spoiler-l) (new 'process 'joint-mod-rotate-local obj 13 #t)) - (set! (-> obj spoiler-r) (new 'process 'joint-mod-rotate-local obj 14 #t)) + (alloc-and-init-rigid-body-control this *test-bike-constants*) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this fin2-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin2-fr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 11 #t)) + (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 12 #t)) + (set! (-> this spoiler-l) (new 'process 'joint-mod-rotate-local this 13 #t)) + (set! (-> this spoiler-r) (new 'process 'joint-mod-rotate-local this 14 #t)) 0 (none) ) @@ -265,16 +265,16 @@ ) ;; definition for method 3 of type evan-test-bike -(defmethod inspect evan-test-bike ((obj evan-test-bike)) - (when (not obj) - (set! obj obj) +(defmethod inspect evan-test-bike ((this evan-test-bike)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bikea inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol *evan-test-bike-constants*, type rigid-body-vehicle-constants @@ -485,24 +485,20 @@ ;; definition for method 33 of type evan-test-bike ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body evan-test-bike ((obj evan-test-bike)) +(defmethod init-skel-and-rigid-body evan-test-bike ((this evan-test-bike)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bikea" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *evan-test-bike-constants*) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj brake-l) (new 'process 'joint-mod-rotate-local obj 9 #t)) - (set! (-> obj brake-r) (new 'process 'joint-mod-rotate-local obj 10 #t)) + (alloc-and-init-rigid-body-control this *evan-test-bike-constants*) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this brake-l) (new 'process 'joint-mod-rotate-local this 9 #t)) + (set! (-> this brake-r) (new 'process 'joint-mod-rotate-local this 10 #t)) 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-car_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-car_REF.gc index ae9ba32aa6..75f185c075 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-car_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/test-car_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type test-car -(defmethod inspect test-car ((obj test-car)) - (when (not obj) - (set! obj obj) +(defmethod inspect test-car ((this test-car)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type cara inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol *test-car-constants*, type rigid-body-vehicle-constants @@ -277,24 +277,24 @@ ;; definition for method 33 of type test-car ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body test-car ((obj test-car)) +(defmethod init-skel-and-rigid-body test-car ((this test-car)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cara" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *test-car-constants*) - (set! (-> obj rider-hand-joint-array 0) 11) - (set! (-> obj rider-hand-joint-array 1) 12) - (set! (-> obj steering-wheel-l) (new 'process 'joint-mod-rotate-local obj 11 #t)) - (set! (-> obj steering-wheel-r) (new 'process 'joint-mod-rotate-local obj 12 #t)) - (set! (-> obj fin-fl) (new 'process 'joint-mod-rotate-local obj 4 #t)) - (set! (-> obj fin-fr) (new 'process 'joint-mod-rotate-local obj 5 #t)) - (set! (-> obj fin-rl) (new 'process 'joint-mod-rotate-local obj 6 #t)) - (set! (-> obj fin-rr) (new 'process 'joint-mod-rotate-local obj 8 #t)) - (set! (-> obj rudder) (new 'process 'joint-mod-rotate-local obj 10 #t)) - (set! (-> obj rudder-l) (new 'process 'joint-mod-rotate-local obj 7 #t)) - (set! (-> obj rudder-r) (new 'process 'joint-mod-rotate-local obj 9 #t)) + (alloc-and-init-rigid-body-control this *test-car-constants*) + (set! (-> this rider-hand-joint-array 0) 11) + (set! (-> this rider-hand-joint-array 1) 12) + (set! (-> this steering-wheel-l) (new 'process 'joint-mod-rotate-local this 11 #t)) + (set! (-> this steering-wheel-r) (new 'process 'joint-mod-rotate-local this 12 #t)) + (set! (-> this fin-fl) (new 'process 'joint-mod-rotate-local this 4 #t)) + (set! (-> this fin-fr) (new 'process 'joint-mod-rotate-local this 5 #t)) + (set! (-> this fin-rl) (new 'process 'joint-mod-rotate-local this 6 #t)) + (set! (-> this fin-rr) (new 'process 'joint-mod-rotate-local this 8 #t)) + (set! (-> this rudder) (new 'process 'joint-mod-rotate-local this 10 #t)) + (set! (-> this rudder-l) (new 'process 'joint-mod-rotate-local this 7 #t)) + (set! (-> this rudder-r) (new 'process 'joint-mod-rotate-local this 9 #t)) 0 (none) ) 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 f8fe8ef29d..f2054df471 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 @@ -39,25 +39,25 @@ ) ;; definition for method 3 of type vehicle-turret -(defmethod inspect vehicle-turret ((obj vehicle-turret)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-turret ((this vehicle-turret)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tturret-jm: ~A~%" (-> obj turret-jm)) - (format #t "~2Tturret: #~%" (-> obj turret)) - (format #t "~2Ttarget: ~D~%" (-> obj target)) + (format #t "~2Tturret-jm: ~A~%" (-> this turret-jm)) + (format #t "~2Tturret: #~%" (-> this turret)) + (format #t "~2Ttarget: ~D~%" (-> this target)) (label cfg-4) - obj + this ) ;; definition for method 29 of type vehicle-turret ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-turret-method-29 vehicle-turret ((obj vehicle-turret)) - (let* ((s4-0 (ppointer->process (-> obj parent))) +(defmethod vehicle-turret-method-29 vehicle-turret ((this vehicle-turret)) + (let* ((s4-0 (ppointer->process (-> this parent))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) @@ -70,9 +70,9 @@ ) ) ) - (vector-matrix*! (-> obj root trans) (new 'static 'vector :y 8601.6 :z 12288.0 :w 1.0) a2-0) + (vector-matrix*! (-> this root trans) (new 'static 'vector :y 8601.6 :z 12288.0 :w 1.0) a2-0) ) - (quaternion-copy! (-> obj root quat) (-> (the-as process-drawable s5-0) root quat)) + (quaternion-copy! (-> this root quat) (-> (the-as process-drawable s5-0) root quat)) ) ) 0 @@ -104,8 +104,8 @@ ;; definition for method 28 of type vehicle-turret ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-turret-method-28 vehicle-turret ((obj vehicle-turret)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod vehicle-turret-method-28 vehicle-turret ((this vehicle-turret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -126,7 +126,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -134,21 +134,21 @@ ;; definition for method 7 of type vehicle-turret ;; WARN: Return type mismatch process-drawable vs vehicle-turret. -(defmethod relocate vehicle-turret ((obj vehicle-turret) (arg0 int)) - (if (nonzero? (-> obj turret-jm)) - (&+! (-> obj turret-jm) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method vehicle-turret 7)) this arg0) ) ) ;; definition for method 30 of type vehicle-turret ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-turret-method-30 vehicle-turret ((obj vehicle-turret)) - (set! (-> obj turret-jm) - (the-as joint-mod (new 'process 'joint-mod-rotate-local obj (-> obj turret info joint-index) #t)) +(defmethod vehicle-turret-method-30 vehicle-turret ((this vehicle-turret)) + (set! (-> this turret-jm) + (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this turret info joint-index) #t)) ) 0 (none) @@ -213,21 +213,21 @@ ) ;; definition for method 3 of type transport-params -(defmethod inspect transport-params ((obj transport-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect transport-params ((this transport-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'transport-params) - (format #t "~1Tspawn-pos: #~%" (-> obj spawn-pos)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Tnav-mesh: ~A~%" (-> obj nav-mesh)) - (format #t "~1Tmax-guard: ~D~%" (-> obj max-guard)) - (format #t "~1Tmax-time: ~f~%" (-> obj max-time)) - (format #t "~1Tturret?: ~A~%" (-> obj turret?)) - (format #t "~1Tspeeches?: ~A~%" (-> obj speeches?)) + (format #t "[~8x] ~A~%" this 'transport-params) + (format #t "~1Tspawn-pos: #~%" (-> this spawn-pos)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~1Tmax-guard: ~D~%" (-> this max-guard)) + (format #t "~1Tmax-time: ~f~%" (-> this max-time)) + (format #t "~1Tturret?: ~A~%" (-> this turret?)) + (format #t "~1Tspeeches?: ~A~%" (-> this speeches?)) (label cfg-4) - obj + this ) ;; definition of type transport @@ -262,27 +262,27 @@ ) ;; definition for method 3 of type transport -(defmethod inspect transport ((obj transport)) - (when (not obj) - (set! obj obj) +(defmethod inspect transport ((this transport)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ty-dest: ~f~%" (-> obj y-dest)) - (format #t "~2Tlast-guard-spawn-time: ~D~%" (-> obj last-guard-spawn-time)) - (format #t "~2Tnav-mesh: ~A~%" (-> obj nav-mesh)) - (format #t "~2Tspawn-side: ~D~%" (-> obj spawn-side)) - (format #t "~2Tspawn?: ~A~%" (-> obj spawn?)) - (format #t "~2Tleave-time: ~D~%" (-> obj leave-time)) - (format #t "~2Tmax-guard: ~D~%" (-> obj max-guard)) - (format #t "~2Tcount-guard: ~D~%" (-> obj count-guard)) - (format #t "~2Tmax-time: ~f~%" (-> obj max-time)) - (format #t "~2Tambient-sound-id: ~D~%" (-> obj ambient-sound-id)) - (format #t "~2Tturret: ~D~%" (-> obj turret)) + (format #t "~2Ty-dest: ~f~%" (-> this y-dest)) + (format #t "~2Tlast-guard-spawn-time: ~D~%" (-> this last-guard-spawn-time)) + (format #t "~2Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~2Tspawn-side: ~D~%" (-> this spawn-side)) + (format #t "~2Tspawn?: ~A~%" (-> this spawn?)) + (format #t "~2Tleave-time: ~D~%" (-> this leave-time)) + (format #t "~2Tmax-guard: ~D~%" (-> this max-guard)) + (format #t "~2Tcount-guard: ~D~%" (-> this count-guard)) + (format #t "~2Tmax-time: ~f~%" (-> this max-time)) + (format #t "~2Tambient-sound-id: ~D~%" (-> this ambient-sound-id)) + (format #t "~2Tturret: ~D~%" (-> this turret)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -317,29 +317,29 @@ ) ;; definition for method 12 of type transport -(defmethod run-logic? transport ((obj transport)) +(defmethod run-logic? transport ((this transport)) #t ) ;; definition for method 35 of type transport ;; WARN: Return type mismatch int vs none. -(defmethod transport-method-35 transport ((obj transport)) - (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> obj root transv y)) 0.0 122880.0)) - (f0-4 (lerp-scale 0.0 1.0 (- (-> obj root trans y) (-> obj y-dest)) 143360.0 20480.0)) +(defmethod transport-method-35 transport ((this transport)) + (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> this root transv y)) 0.0 122880.0)) + (f0-4 (lerp-scale 0.0 1.0 (- (-> this root trans y) (-> this y-dest)) 143360.0 20480.0)) (a0-3 (static-sound-spec "transport" :volume 0.0 :mask (pitch reg0))) ) (set! (-> a0-3 volume) (the int (* 1024.0 f0-4))) (set! (-> a0-3 pitch-mod) (the int (* 1524.0 f30-0))) - (sound-play-by-spec a0-3 (-> obj ambient-sound-id) (-> obj root trans)) + (sound-play-by-spec a0-3 (-> this ambient-sound-id) (-> this root trans)) ) 0 (none) ) ;; definition for method 10 of type transport -(defmethod deactivate transport ((obj transport)) - (sound-stop (-> obj ambient-sound-id)) - ((the-as (function process-drawable none) (find-parent-method transport 10)) obj) +(defmethod deactivate transport ((this transport)) + (sound-stop (-> this ambient-sound-id)) + ((the-as (function process-drawable none) (find-parent-method transport 10)) this) (none) ) @@ -348,8 +348,8 @@ :virtual #t :event transport-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) - (set! (-> self last-guard-spawn-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-guard-spawn-time)) ) :code (behavior () (ja-channel-push! 1 0) @@ -377,7 +377,7 @@ :virtual #t :event transport-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root transv y) 0.0) (set! (-> self last-guard-spawn-time) 0) 0 @@ -448,7 +448,7 @@ :virtual #t :event transport-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root transv y) 0.0) ) :code (behavior () @@ -479,36 +479,36 @@ ;; definition for method 33 of type transport ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod transport-method-33 transport ((obj transport)) - (when (>= (- (current-time) (-> obj last-guard-spawn-time)) 0) +(defmethod transport-method-33 transport ((this transport)) + (when (>= (- (current-time) (-> this last-guard-spawn-time)) 0) (let ((s5-0 (new 'stack 'traffic-object-spawn-params))) (set! (-> s5-0 object-type) (traffic-type crimson-guard-1)) (set! (-> s5-0 behavior) (the-as uint 6)) (set! (-> s5-0 id) (the-as uint 0)) - (set! (-> s5-0 nav-mesh) (-> obj nav-mesh)) + (set! (-> s5-0 nav-mesh) (-> this nav-mesh)) (set! (-> s5-0 nav-branch) #f) (set! (-> s5-0 proc) #f) - (set! (-> s5-0 handle) (process->handle obj)) - (set! (-> s5-0 user-data) (-> obj spawn-side)) + (set! (-> s5-0 handle) (process->handle this)) + (set! (-> s5-0 user-data) (-> this spawn-side)) (set! (-> s5-0 flags) (traffic-spawn-flags)) (set! (-> s5-0 guard-type) (the-as uint 7)) (vector-reset! (-> s5-0 velocity)) - (set! (-> s5-0 position quad) (-> obj root trans quad)) + (set! (-> s5-0 position quad) (-> this root trans quad)) (+! (-> s5-0 position y) 8192.0) - (quaternion-rotate-local-y! (-> s5-0 rotation) (-> obj root quat) 32768.0) + (quaternion-rotate-local-y! (-> s5-0 rotation) (-> this root quat) 32768.0) (send-event *traffic-manager* 'activate-object s5-0) (when (-> s5-0 proc) - (set! (-> obj spawn-side) (- 1 (the-as int (-> obj spawn-side)))) - (if (logtest? (-> obj draw status) (draw-control-status on-screen)) - (set! (-> obj last-guard-spawn-time) (+ (current-time) (seconds 1))) - (set! (-> obj last-guard-spawn-time) (+ (current-time) (seconds 2))) + (set! (-> this spawn-side) (- 1 (the-as int (-> this spawn-side)))) + (if (logtest? (-> this draw status) (draw-control-status on-screen)) + (set! (-> this last-guard-spawn-time) (+ (current-time) (seconds 1))) + (set! (-> this last-guard-spawn-time) (+ (current-time) (seconds 2))) ) - (+! (-> obj count-guard) 1) + (+! (-> this count-guard) 1) ) (when (not (-> s5-0 proc)) - (if (logtest? (-> obj draw status) (draw-control-status on-screen)) - (set! (-> obj last-guard-spawn-time) (+ (current-time) (seconds 0.1))) - (set! (-> obj last-guard-spawn-time) (+ (current-time) (seconds 1))) + (if (logtest? (-> this draw status) (draw-control-status on-screen)) + (set! (-> this last-guard-spawn-time) (+ (current-time) (seconds 0.1))) + (set! (-> this last-guard-spawn-time) (+ (current-time) (seconds 1))) ) ) ) @@ -518,8 +518,8 @@ ;; definition for method 34 of type transport ;; WARN: Return type mismatch int vs none. -(defmethod transport-method-34 transport ((obj transport) (arg0 process)) - (let ((v1-1 (handle->process (-> obj turret)))) +(defmethod transport-method-34 transport ((this transport) (arg0 process)) + (let ((v1-1 (handle->process (-> this turret)))) (if v1-1 (set! (-> (the-as vehicle-turret v1-1) target) (process->handle arg0)) ) @@ -530,8 +530,8 @@ ;; definition for method 31 of type transport ;; WARN: Return type mismatch int vs none. -(defmethod transport-method-31 transport ((obj transport)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod transport-method-31 transport ((this transport)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -565,7 +565,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -573,8 +573,8 @@ ;; definition for method 32 of type transport ;; WARN: Return type mismatch int vs none. -(defmethod transport-method-32 transport ((obj transport)) - (set! (-> obj spawn-side) (the-as uint 0)) +(defmethod transport-method-32 transport ((this transport)) + (set! (-> this spawn-side) (the-as uint 0)) 0 (none) ) @@ -614,22 +614,22 @@ ;; definition for method 11 of type transport ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! transport ((obj transport) (arg0 entity-actor)) +(defmethod init-from-entity! transport ((this transport) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (transport-method-31 obj) - (process-drawable-from-entity! obj arg0) + (transport-method-31 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-transport" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (transport-method-32 obj) - (set! (-> obj spawn?) #t) - (go (method-of-object obj come-down)) + (transport-method-32 this) + (set! (-> this spawn?) #t) + (go (method-of-object this come-down)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-control_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-control_REF.gc index a75667ca05..d03d1c0ab4 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-control_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-control_REF.gc @@ -6,9 +6,9 @@ ;; definition for method 21 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-21 vehicle-controller ((obj vehicle-controller)) - (when (logtest? (-> obj flags) (vehicle-controller-flag attached)) - (let ((v1-3 (-> obj branch))) +(defmethod vehicle-controller-method-21 vehicle-controller ((this vehicle-controller)) + (when (logtest? (-> this flags) (vehicle-controller-flag attached)) + (let ((v1-3 (-> this branch))) (when (or (not v1-3) (zero? v1-3)) (break!) 0 @@ -36,7 +36,7 @@ ;; definition for method 20 of type vehicle-controller ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-20 vehicle-controller ((obj vehicle-controller) (arg0 object) (arg1 float)) +(defmethod vehicle-controller-method-20 vehicle-controller ((this vehicle-controller) (arg0 object) (arg1 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -45,19 +45,19 @@ (vf7 :class vf) ) (init-vf0-vector) - (set! (-> obj max-turn-speed) (sqrtf (* (fmax 16384.0 arg1) (-> obj turn-accel)))) + (set! (-> this max-turn-speed) (sqrtf (* (fmax 16384.0 arg1) (-> this turn-accel)))) (let ((v1-1 (new 'stack-no-clear 'vehicle-control-point))) - (vector-! (-> v1-1 normal) (-> obj turn-exit-point) (the-as vector arg0)) - (set! (-> v1-1 local-pos quad) (-> obj turn-exit-dir quad)) - (set! (-> v1-1 local-pos x) (-> obj turn-exit-dir z)) - (set! (-> v1-1 local-pos z) (- (-> obj turn-exit-dir x))) - (logior! (-> obj flags) (vehicle-controller-flag left-turn)) + (vector-! (-> v1-1 normal) (-> this turn-exit-point) (the-as vector arg0)) + (set! (-> v1-1 local-pos quad) (-> this turn-exit-dir quad)) + (set! (-> v1-1 local-pos x) (-> this turn-exit-dir z)) + (set! (-> v1-1 local-pos z) (- (-> this turn-exit-dir x))) + (logior! (-> this flags) (vehicle-controller-flag left-turn)) (when (< 0.0 (vector-dot (-> v1-1 normal) (-> v1-1 local-pos))) - (logclear! (-> obj flags) (vehicle-controller-flag left-turn)) + (logclear! (-> this flags) (vehicle-controller-flag left-turn)) (vector-float*! (-> v1-1 local-pos) (-> v1-1 local-pos) -1.0) ) - (let ((a1-6 (-> obj dest-circle))) - (let ((a0-12 (-> obj turn-exit-point))) + (let ((a1-6 (-> this dest-circle))) + (let ((a0-12 (-> this turn-exit-point))) (let ((v1-2 (-> v1-1 local-pos))) (let ((a3-3 arg1)) (.mov vf7 a3-3) @@ -72,21 +72,21 @@ (.svf (&-> a1-6 quad) vf6) ) ) - (set! (-> obj dest-circle w) arg1) + (set! (-> this dest-circle w) arg1) 0 - (vehicle-controller-method-16 obj (-> obj path-prev-point) (-> obj turn-enter-point)) - (set! (-> obj target-point quad) (-> obj turn-enter-point quad)) - (vector-! (-> obj turn-enter-dir) (-> obj turn-enter-point) (-> obj path-prev-point)) - (set! (-> obj turn-enter-dir y) 0.0) - (vector-normalize! (-> obj turn-enter-dir) 1.0) + (vehicle-controller-method-16 this (-> this path-prev-point) (-> this turn-enter-point)) + (set! (-> this target-point quad) (-> this turn-enter-point quad)) + (vector-! (-> this turn-enter-dir) (-> this turn-enter-point) (-> this path-prev-point)) + (set! (-> this turn-enter-dir y) 0.0) + (vector-normalize! (-> this turn-enter-dir) 1.0) (let ((f0-12 (cos 8192.0)) - (f30-0 (vector-dot (-> obj turn-enter-dir) (-> obj turn-exit-dir))) + (f30-0 (vector-dot (-> this turn-enter-dir) (-> this turn-exit-dir))) ) - (set! (-> obj max-turn-speed) - (* (-> obj max-turn-speed) (+ 1.0 (fmax 0.0 (/ (- f30-0 f0-12) (- 1.0 f0-12))))) + (set! (-> this max-turn-speed) + (* (-> this max-turn-speed) (+ 1.0 (fmax 0.0 (/ (- f30-0 f0-12) (- 1.0 f0-12))))) ) (if (>= f30-0 (cos 1820.4445)) - (set! (-> obj max-turn-speed) 409600.0) + (set! (-> this max-turn-speed) 409600.0) ) ) 0 @@ -97,16 +97,16 @@ ;; definition for method 19 of type vehicle-controller ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-19 vehicle-controller ((obj vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector)) - (set! (-> obj path-prev-point quad) (-> arg0 quad)) +(defmethod vehicle-controller-method-19 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 object) (arg2 vector) (arg3 vector)) + (set! (-> this path-prev-point quad) (-> arg0 quad)) (vector-vector-distance arg0 arg2) - (set! (-> obj target-speed) (vector-length arg3)) - (set! (-> obj turn-exit-point quad) (-> arg2 quad)) - (set! (-> obj turn-exit-dir quad) (-> arg3 quad)) - (set! (-> obj turn-exit-dir y) 0.0) - (vector-normalize! (-> obj turn-exit-dir) 1.0) - (vehicle-controller-method-20 obj arg0 (the-as float arg1)) - (logior! (-> obj flags) (vehicle-controller-flag on-straightaway)) + (set! (-> this target-speed) (vector-length arg3)) + (set! (-> this turn-exit-point quad) (-> arg2 quad)) + (set! (-> this turn-exit-dir quad) (-> arg3 quad)) + (set! (-> this turn-exit-dir y) 0.0) + (vector-normalize! (-> this turn-exit-dir) 1.0) + (vehicle-controller-method-20 this arg0 (the-as float arg1)) + (logior! (-> this flags) (vehicle-controller-flag on-straightaway)) 0 (none) ) @@ -114,22 +114,22 @@ ;; definition for method 13 of type vehicle-controller ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-13 vehicle-controller ((obj vehicle-controller) (arg0 nav-branch) (arg1 vector)) - (vehicle-controller-method-10 obj (the-as traffic-tracker arg0)) - (set! (-> obj path-prev-point quad) (-> arg1 quad)) - (set! (-> obj branch) arg0) +(defmethod vehicle-controller-method-13 vehicle-controller ((this vehicle-controller) (arg0 nav-branch) (arg1 vector)) + (vehicle-controller-method-10 this (the-as traffic-tracker arg0)) + (set! (-> this path-prev-point quad) (-> arg1 quad)) + (set! (-> this branch) arg0) (let ((v1-3 arg0)) - (set! (-> obj target-speed) (* 1024.0 (the float (-> v1-3 speed-limit)))) + (set! (-> this target-speed) (* 1024.0 (the float (-> v1-3 speed-limit)))) ) (let ((s4-1 (-> arg0 dest-node))) (let ((a1-2 s4-1) - (v1-6 (-> obj turn-exit-point)) + (v1-6 (-> this turn-exit-point)) ) (set! (-> v1-6 quad) (-> a1-2 position quad)) (set! (-> v1-6 w) 1.0) ) (let ((v1-7 s4-1) - (s3-0 (-> obj turn-exit-dir)) + (s3-0 (-> this turn-exit-dir)) ) (let ((f0-5 (the float (-> v1-7 angle))) (s2-0 (new 'stack-no-clear 'vector)) @@ -141,17 +141,17 @@ ) (set! (-> s3-0 w) 1.0) ) - (vehicle-controller-method-20 obj arg1 (* 1024.0 (the float (-> s4-1 radius)))) + (vehicle-controller-method-20 this arg1 (* 1024.0 (the float (-> s4-1 radius)))) ) - (logior! (-> obj flags) (vehicle-controller-flag on-straightaway)) + (logior! (-> this flags) (vehicle-controller-flag on-straightaway)) 0 (none) ) ;; definition for method 15 of type vehicle-controller -(defmethod vehicle-controller-method-15 vehicle-controller ((obj vehicle-controller)) +(defmethod vehicle-controller-method-15 vehicle-controller ((this vehicle-controller)) (let ((gp-0 (the-as nav-branch #f))) - (let* ((s5-0 (-> obj branch dest-node)) + (let* ((s5-0 (-> this branch dest-node)) (s4-0 (-> s5-0 branch-count)) ) (b! (!= s4-0 1) cfg-4 :delay (empty-form)) @@ -191,14 +191,14 @@ ;; definition for method 14 of type vehicle-controller ;; INFO: Used lq/sq -(defmethod vehicle-controller-method-14 vehicle-controller ((obj vehicle-controller) (arg0 vehicle)) +(defmethod vehicle-controller-method-14 vehicle-controller ((this vehicle-controller) (arg0 vehicle)) (let ((s4-0 (new 'stack-no-clear 'vector)) - (gp-0 ((-> obj choose-branch-callback) obj arg0)) + (gp-0 ((-> this choose-branch-callback) this arg0)) ) (when gp-0 - (vehicle-controller-method-11 obj) - (set! (-> s4-0 quad) (-> obj turn-exit-point quad)) - (vehicle-controller-method-13 obj gp-0 s4-0) + (vehicle-controller-method-11 this) + (set! (-> s4-0 quad) (-> this turn-exit-point quad)) + (vehicle-controller-method-13 this gp-0 s4-0) ) gp-0 ) @@ -207,7 +207,7 @@ ;; definition for method 16 of type vehicle-controller ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-16 vehicle-controller ((obj vehicle-controller) (arg0 vector) (arg1 vector)) +(defmethod vehicle-controller-method-16 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -217,17 +217,17 @@ ) (init-vf0-vector) (let ((s4-0 (new 'stack-no-clear 'vehicle-control-point))) - (vector-! (-> s4-0 local-pos) (-> obj dest-circle) arg0) + (vector-! (-> s4-0 local-pos) (-> this dest-circle) arg0) (set! (-> s4-0 local-pos y) 0.0) (let* ((v1-1 (-> s4-0 local-pos)) (f30-0 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) - (f28-0 (-> obj dest-circle w)) + (f28-0 (-> this dest-circle w)) ) (vector-xz-normalize! (-> s4-0 local-pos) 1.0) (set! (-> s4-0 normal x) (-> s4-0 local-pos z)) (set! (-> s4-0 normal y) 0.0) (set! (-> s4-0 normal z) (- (-> s4-0 local-pos x))) - (if (logtest? (-> obj flags) (vehicle-controller-flag left-turn)) + (if (logtest? (-> this flags) (vehicle-controller-flag left-turn)) (vector-float*! (-> s4-0 normal) (-> s4-0 normal) -1.0) ) (let* ((f0-10 f30-0) @@ -272,7 +272,7 @@ ) ) ) - (set! (-> arg1 y) (-> obj turn-exit-point y)) + (set! (-> arg1 y) (-> this turn-exit-point y)) 0 (none) ) @@ -317,7 +317,7 @@ ;; WARN: Stack slot offset 24 signed mismatch ;; WARN: Stack slot offset 20 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-18 vehicle-controller ((obj vehicle-controller) (arg0 vector) (arg1 vector) (arg2 vehicle) (arg3 float)) +(defmethod vehicle-controller-method-18 vehicle-controller ((this vehicle-controller) (arg0 vector) (arg1 vector) (arg2 vehicle) (arg3 float)) (local-vars (v1-24 float) (v1-88 float) @@ -356,22 +356,22 @@ (set! sv-20 arg3) (set! sv-24 (-> arg2 info info inv-mass)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 16))) - (set! (-> gp-0 15 x) (+ (-> obj target-speed) (-> obj target-speed-offset))) + (set! (-> gp-0 15 x) (+ (-> this target-speed) (-> this target-speed-offset))) (set! (-> gp-0 1 quad) (-> arg1 quad)) (set! (-> gp-0 0 quad) (-> arg2 root trans quad)) (vector-z-quaternion! (-> gp-0 3) (-> arg2 root quat)) (vector-reset! (-> gp-0 2)) (cond - ((logtest? (-> obj flags) (vehicle-controller-flag on-straightaway)) - (vector-! (-> gp-0 6) (-> obj turn-enter-point) (-> gp-0 0)) - (let ((f0-5 (vector-dot (-> gp-0 6) (-> obj turn-enter-dir)))) - (vector+float*! (-> gp-0 4) (-> obj turn-enter-point) (-> obj turn-enter-dir) (- f0-5)) - (set! (-> gp-0 5 quad) (-> obj turn-enter-dir quad)) + ((logtest? (-> this flags) (vehicle-controller-flag on-straightaway)) + (vector-! (-> gp-0 6) (-> this turn-enter-point) (-> gp-0 0)) + (let ((f0-5 (vector-dot (-> gp-0 6) (-> this turn-enter-dir)))) + (vector+float*! (-> gp-0 4) (-> this turn-enter-point) (-> this turn-enter-dir) (- f0-5)) + (set! (-> gp-0 5 quad) (-> this turn-enter-dir quad)) (if (>= 0.0 f0-5) - (logclear! (-> obj flags) (vehicle-controller-flag on-straightaway)) + (logclear! (-> this flags) (vehicle-controller-flag on-straightaway)) ) - (when (not (logtest? (-> obj flags) (vehicle-controller-flag no-slowing-for-turns))) - (let ((f1-4 (* 0.5 (/ 1.0 (-> obj turn-accel))))) + (when (not (logtest? (-> this flags) (vehicle-controller-flag no-slowing-for-turns))) + (let ((f1-4 (* 0.5 (/ 1.0 (-> this turn-accel))))) (.lvf vf1 (&-> arg1 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -380,10 +380,10 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-24 vf1) (let ((f2-2 v1-24) - (f3-1 (-> obj max-turn-speed)) + (f3-1 (-> this max-turn-speed)) ) (if (>= (* f1-4 (- f2-2 (* f3-1 f3-1))) f0-5) - (set! (-> gp-0 15 x) (fmin (-> gp-0 15 x) (-> obj max-turn-speed))) + (set! (-> gp-0 15 x) (fmin (-> gp-0 15 x) (-> this max-turn-speed))) ) ) ) @@ -391,25 +391,25 @@ ) ) (else - (if (not (logtest? (-> obj flags) (vehicle-controller-flag no-slowing-for-turns))) - (set! (-> gp-0 15 x) (fmin (-> gp-0 15 x) (-> obj max-turn-speed))) + (if (not (logtest? (-> this flags) (vehicle-controller-flag no-slowing-for-turns))) + (set! (-> gp-0 15 x) (fmin (-> gp-0 15 x) (-> this max-turn-speed))) ) - (vector-! (-> gp-0 6) (-> gp-0 0) (-> obj dest-circle)) + (vector-! (-> gp-0 6) (-> gp-0 0) (-> this dest-circle)) (vector-normalize! (-> gp-0 6) 1.0) (set! (-> gp-0 5 x) (- (-> gp-0 6 z))) (set! (-> gp-0 5 y) 0.0) (set! (-> gp-0 5 z) (-> gp-0 6 x)) - (if (logtest? (-> obj flags) (vehicle-controller-flag left-turn)) + (if (logtest? (-> this flags) (vehicle-controller-flag left-turn)) (vector-float*! (-> gp-0 5) (-> gp-0 5) -1.0) ) - (vector-float*! (-> gp-0 6) (-> gp-0 6) (-> obj dest-circle w)) - (vector+! (-> gp-0 4) (-> obj dest-circle) (-> gp-0 6)) - (when (logtest? (-> obj flags) (vehicle-controller-flag attached)) - (vector-! (-> gp-0 9) (-> obj turn-exit-point) (-> gp-0 0)) - (when (and (< (vector-dot (-> obj turn-exit-dir) (-> gp-0 9)) 0.0) - (>= (vector-dot (-> obj turn-exit-dir) (-> gp-0 3)) (cos 8192.0)) + (vector-float*! (-> gp-0 6) (-> gp-0 6) (-> this dest-circle w)) + (vector+! (-> gp-0 4) (-> this dest-circle) (-> gp-0 6)) + (when (logtest? (-> this flags) (vehicle-controller-flag attached)) + (vector-! (-> gp-0 9) (-> this turn-exit-point) (-> gp-0 0)) + (when (and (< (vector-dot (-> this turn-exit-dir) (-> gp-0 9)) 0.0) + (>= (vector-dot (-> this turn-exit-dir) (-> gp-0 3)) (cos 8192.0)) ) - (if (not (vehicle-controller-method-14 obj arg2)) + (if (not (vehicle-controller-method-14 this arg2)) (set! (-> gp-0 15 x) 0.0) ) ) @@ -417,8 +417,8 @@ ) ) (set! (-> gp-0 4 y) (-> gp-0 0 y)) - (when (and (nonzero? (-> obj traffic)) - (not (logtest? (-> obj flags) (vehicle-controller-flag ignore-others))) + (when (and (nonzero? (-> this traffic)) + (not (logtest? (-> this flags) (vehicle-controller-flag ignore-others))) (let ((f0-22 (-> arg2 camera-dist2)) (f1-9 1228800.0) ) @@ -429,7 +429,7 @@ (f30-1 (-> arg2 root root-prim prim-core world-sphere w)) ) (countdown (s4-1 (fill-actor-list-for-line-sphere - (-> obj traffic object-hash) + (-> this traffic object-hash) (-> gp-0 0) (-> gp-0 1) (* 1.5 f30-1) @@ -499,7 +499,7 @@ ) ) ) - (when (not (logtest? (-> obj flags) (vehicle-controller-flag ignore-others))) + (when (not (logtest? (-> this flags) (vehicle-controller-flag ignore-others))) (vector-! (-> gp-0 6) (-> gp-0 4) (-> gp-0 0)) (.lvf vf1 (&-> (-> gp-0 6) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -509,10 +509,10 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-88 vf1) (let ((f0-39 v1-88)) - (logclear! (-> obj flags) (vehicle-controller-flag off-path)) + (logclear! (-> this flags) (vehicle-controller-flag off-path)) (let ((f1-23 4096.0)) (when (< (* f1-23 f1-23) f0-39) - (logior! (-> obj flags) (vehicle-controller-flag off-path)) + (logior! (-> this flags) (vehicle-controller-flag off-path)) (let ((t9-8 vector-normalize!) (a0-69 (-> gp-0 6)) (f1-26 12288.0) @@ -528,8 +528,8 @@ (vector-! (-> gp-0 2) (-> gp-0 2) (-> gp-0 6)) ) (cond - ((logtest? (-> obj flags) (vehicle-controller-flag direct-mode)) - (vector-! (-> gp-0 7) (-> obj turn-exit-point) (-> gp-0 0)) + ((logtest? (-> this flags) (vehicle-controller-flag direct-mode)) + (vector-! (-> gp-0 7) (-> this turn-exit-point) (-> gp-0 0)) (vector-normalize! (-> gp-0 7) (-> gp-0 15 x)) (vector-! (-> gp-0 6) (-> gp-0 7) (-> gp-0 1)) (vector-float*! (-> gp-0 6) (-> gp-0 6) 3.0) @@ -541,25 +541,25 @@ ) (else (vector+float*! (-> gp-0 8) (-> gp-0 0) (-> gp-0 1) 0.4) - (vector-! (-> gp-0 6) (-> gp-0 8) (-> obj turn-enter-point)) + (vector-! (-> gp-0 6) (-> gp-0 8) (-> this turn-enter-point)) (cond - ((< (vector-dot (-> gp-0 6) (-> obj turn-enter-dir)) 0.0) - (vector-! (-> gp-0 7) (-> obj turn-enter-point) (-> gp-0 0)) + ((< (vector-dot (-> gp-0 6) (-> this turn-enter-dir)) 0.0) + (vector-! (-> gp-0 7) (-> this turn-enter-point) (-> gp-0 0)) ) ((begin - (vector-! (-> gp-0 6) (-> gp-0 8) (-> obj turn-exit-point)) - (< (vector-dot (-> gp-0 6) (-> obj turn-exit-dir)) 0.0) + (vector-! (-> gp-0 6) (-> gp-0 8) (-> this turn-exit-point)) + (< (vector-dot (-> gp-0 6) (-> this turn-exit-dir)) 0.0) ) - (vector-! (-> gp-0 6) (-> gp-0 8) (-> obj dest-circle)) + (vector-! (-> gp-0 6) (-> gp-0 8) (-> this dest-circle)) (set! (-> gp-0 7 x) (- (-> gp-0 6 z))) (set! (-> gp-0 7 y) 0.0) (set! (-> gp-0 7 z) (-> gp-0 6 x)) - (if (logtest? (-> obj flags) (vehicle-controller-flag left-turn)) + (if (logtest? (-> this flags) (vehicle-controller-flag left-turn)) (vector-float*! (-> gp-0 7) (-> gp-0 7) -1.0) ) ) (else - (set! (-> gp-0 7 quad) (-> obj turn-exit-dir quad)) + (set! (-> gp-0 7 quad) (-> this turn-exit-dir quad)) ) ) (let ((f0-60 (vector-length (-> gp-0 7)))) @@ -593,9 +593,9 @@ ;; definition for method 10 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-10 vehicle-controller ((obj vehicle-controller) (arg0 traffic-tracker)) - (when (not (logtest? (-> obj flags) (vehicle-controller-flag attached))) - (logior! (-> obj flags) (vehicle-controller-flag attached)) +(defmethod vehicle-controller-method-10 vehicle-controller ((this vehicle-controller) (arg0 traffic-tracker)) + (when (not (logtest? (-> this flags) (vehicle-controller-flag attached))) + (logior! (-> this flags) (vehicle-controller-flag attached)) (+! (-> arg0 active-object-count) 1) ) 0 @@ -604,21 +604,21 @@ ;; definition for method 11 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-11 vehicle-controller ((obj vehicle-controller)) - (when (logtest? (-> obj flags) (vehicle-controller-flag attached)) - (logclear! (-> obj flags) (vehicle-controller-flag attached)) - (let ((v1-5 (-> obj branch))) +(defmethod vehicle-controller-method-11 vehicle-controller ((this vehicle-controller)) + (when (logtest? (-> this flags) (vehicle-controller-flag attached)) + (logclear! (-> this flags) (vehicle-controller-flag attached)) + (let ((v1-5 (-> this branch))) (if (> (-> v1-5 user-count) 0) (+! (-> v1-5 user-count) -1) ) ) - (when (logtest? (-> obj flags) (vehicle-controller-flag blocking-dest-node)) - (logclear! (-> obj flags) (vehicle-controller-flag blocking-dest-node)) - (logclear! (-> obj branch dest-node flags) (nav-node-flag-byte blocked)) + (when (logtest? (-> this flags) (vehicle-controller-flag blocking-dest-node)) + (logclear! (-> this flags) (vehicle-controller-flag blocking-dest-node)) + (logclear! (-> this branch dest-node flags) (nav-node-flag-byte blocked)) ) ) - (set! (-> obj branch) (the-as nav-branch 0)) - (if (logtest? (-> obj flags) (vehicle-controller-flag blocking-dest-node)) + (set! (-> this branch) (the-as nav-branch 0)) + (if (logtest? (-> this flags) (vehicle-controller-flag blocking-dest-node)) (format #t "blocking-dest-node bit set after detach~%") ) 0 @@ -628,7 +628,7 @@ ;; definition for method 12 of type vehicle-controller ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-12 vehicle-controller ((obj vehicle-controller) +(defmethod vehicle-controller-method-12 vehicle-controller ((this vehicle-controller) (arg0 rigid-body-vehicle-constants) (arg1 vector) (arg2 float) @@ -653,7 +653,7 @@ ) (else (set! (-> arg0 sample-index) arg3) - (set! (-> arg0 sample-time) (current-time)) + (set-time! (-> arg0 sample-time)) (set! (-> arg0 sample-dir quad) (-> s3-0 quad)) ) ) @@ -664,35 +664,35 @@ ;; definition for method 17 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod draw-debug-info vehicle-controller ((obj vehicle-controller)) - (add-debug-sphere #t (bucket-id debug2) (-> obj dest-circle) (-> obj dest-circle w) *color-green*) - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj target-point) *color-white*) +(defmethod draw-debug-info vehicle-controller ((this vehicle-controller)) + (add-debug-sphere #t (bucket-id debug2) (-> this dest-circle) (-> this dest-circle w) *color-green*) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this target-point) *color-white*) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj turn-exit-point) - (-> obj turn-exit-dir) + (-> this turn-exit-point) + (-> this turn-exit-dir) (meters 2) *color-red* ) - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj turn-enter-point) *color-dark-red*) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this turn-enter-point) *color-dark-red*) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj turn-enter-point) - (-> obj turn-enter-dir) + (-> this turn-enter-point) + (-> this turn-enter-dir) (meters 2) *color-dark-red* ) - (when (logtest? (-> obj flags) (vehicle-controller-flag on-straightaway)) + (when (logtest? (-> this flags) (vehicle-controller-flag on-straightaway)) (let ((a3-5 (new 'stack-no-clear 'vector))) - (vector-! a3-5 (-> obj target-point) (-> obj path-prev-point)) + (vector-! a3-5 (-> this target-point) (-> this path-prev-point)) (add-debug-line-sphere #t (bucket-id debug2) - (-> obj path-prev-point) + (-> this path-prev-point) a3-5 - (-> obj dest-circle w) + (-> this dest-circle w) *color-yellow* ) ) @@ -703,14 +703,14 @@ ;; definition for method 9 of type vehicle-controller ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-controller-method-9 vehicle-controller ((obj vehicle-controller)) - (set! (-> obj traffic) *traffic-engine*) - (set! (-> obj choose-branch-callback) (the-as - (function vehicle-controller vehicle nav-branch) - (method-of-type vehicle-controller vehicle-controller-method-15) - ) +(defmethod vehicle-controller-method-9 vehicle-controller ((this vehicle-controller)) + (set! (-> this traffic) *traffic-engine*) + (set! (-> this choose-branch-callback) (the-as + (function vehicle-controller vehicle nav-branch) + (method-of-type vehicle-controller vehicle-controller-method-15) + ) ) - (set! (-> obj turn-accel) 49152.0) + (set! (-> this turn-accel) 49152.0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc index b26d9a9ded..c0e73b176b 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-effects_REF.gc @@ -4,7 +4,7 @@ ;; definition for method 36 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod do-engine-sounds vehicle ((obj vehicle)) +(defmethod do-engine-sounds vehicle ((this vehicle)) (local-vars (v1-36 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -12,59 +12,60 @@ (vf2 :class vf) ) (init-vf0-vector) - (if (logtest? (rigid-body-object-flag ignition) (-> obj flags)) - (seek! (-> obj engine-sound-envelope) 1.0 (* 2.0 (seconds-per-frame))) - (seek! (-> obj engine-sound-envelope) 0.0 (seconds-per-frame)) + (if (logtest? (rigid-body-object-flag ignition) (-> this flags)) + (seek! (-> this engine-sound-envelope) 1.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this engine-sound-envelope) 0.0 (seconds-per-frame)) ) (cond - ((< 0.0 (-> obj scrape-sound-envelope)) - (if (zero? (-> obj scrape-sound-id)) - (set! (-> obj scrape-sound-id) (new-sound-id)) + ((< 0.0 (-> this scrape-sound-envelope)) + (if (zero? (-> this scrape-sound-id)) + (set! (-> this scrape-sound-id) (new-sound-id)) ) (sound-play-by-name - (-> obj info scrape-sound) - (-> obj scrape-sound-id) - (the int (* 1024.0 (-> obj scrape-sound-envelope))) + (-> this info scrape-sound) + (-> this scrape-sound-id) + (the int (* 1024.0 (-> this scrape-sound-envelope))) 0 0 (sound-group sfx) - (-> obj impact-pos) + (-> this impact-pos) ) ) (else - (when (nonzero? (-> obj scrape-sound-id)) - (sound-stop (-> obj scrape-sound-id)) - (set! (-> obj scrape-sound-id) (new 'static 'sound-id)) + (when (nonzero? (-> this scrape-sound-id)) + (sound-stop (-> this scrape-sound-id)) + (set! (-> this scrape-sound-id) (new 'static 'sound-id)) 0 ) ) ) (cond - ((< 0.0 (* (-> obj force-scale) (-> obj engine-sound-envelope))) - (when (zero? (-> obj engine-sound-id)) - (set! (-> obj engine-sound-id) (new-sound-id)) - (set! (-> obj extra-sound-id) (new-sound-id)) + ((< 0.0 (* (-> this force-scale) (-> this engine-sound-envelope))) + (when (zero? (-> this engine-sound-id)) + (set! (-> this engine-sound-id) (new-sound-id)) + (set! (-> this extra-sound-id) (new-sound-id)) ) - (let* ((f30-0 (fabs (* (-> obj engine-thrust) (-> obj power-level) (-> obj force-scale)))) - (f28-0 (* (-> obj engine-sound-envelope) (+ 0.6 (* 0.4 f30-0)))) - (f26-0 (doppler-pitch-shift (-> obj root trans) (-> obj root transv))) - (f0-22 - (+ (-> obj info engine-pitch-offset) - (* (-> obj info engine-pitch-scale) f30-0) - (* (-> obj info engine-pitch-mod-amp) (sin (* 109.22667 (the float (- (current-time) (-> obj state-time)))))) - f26-0 - ) - ) + (let* ((f30-0 (fabs (* (-> this engine-thrust) (-> this power-level) (-> this force-scale)))) + (f28-0 (* (-> this engine-sound-envelope) (+ 0.6 (* 0.4 f30-0)))) + (f26-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (f0-22 (+ (-> this info engine-pitch-offset) + (* (-> this info engine-pitch-scale) f30-0) + (* (-> this info engine-pitch-mod-amp) + (sin (* 109.22667 (the float (- (current-time) (-> this state-time))))) + ) + f26-0 + ) + ) (a0-9 (static-sound-spec "vehicle-engine" :volume 0.0 :mask (pitch reg0))) ) - (set! (-> a0-9 sound-name) (-> obj info engine-sound)) - (set! (-> obj engine-sound-factor) f30-0) + (set! (-> a0-9 sound-name) (-> this info engine-sound)) + (set! (-> this engine-sound-factor) f30-0) (cond (#f (let* ((f0-23 40960.0) (f0-25 (* f0-23 f0-23)) ) - (.lvf vf1 (&-> (-> obj rbody state lin-velocity) quad)) + (.lvf vf1 (&-> (-> this rbody state lin-velocity) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -73,28 +74,28 @@ (.mov v1-36 vf1) (cond ((< f0-25 v1-36) - (format *stdcon* "accel-to-steady ~d~%" (-> obj engine-sound-id)) - (when (logtest? (rigid-body-object-flag idle-sound) (-> obj flags)) + (format *stdcon* "accel-to-steady ~d~%" (-> this engine-sound-id)) + (when (logtest? (rigid-body-object-flag idle-sound) (-> this flags)) (format *stdcon* "new engine sound~%") - (sound-stop (-> obj engine-sound-id)) - (set! (-> obj engine-sound-id) (new-sound-id)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag idle-sound))) + (sound-stop (-> this engine-sound-id)) + (set! (-> this engine-sound-id) (new-sound-id)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag idle-sound))) ) ) - (sound-play "accel-to-steady" :id (-> obj engine-sound-id) :position (-> obj root trans)) + (sound-play "accel-to-steady" :id (-> this engine-sound-id) :position (-> this root trans)) ) (else - (format *stdcon* "decel-to-idle id ~d~%" (-> obj engine-sound-id)) - (when (not (logtest? (rigid-body-object-flag idle-sound) (-> obj flags))) + (format *stdcon* "decel-to-idle id ~d~%" (-> this engine-sound-id)) + (when (not (logtest? (rigid-body-object-flag idle-sound) (-> this flags))) (format *stdcon* "new engine sound~%") - (sound-stop (-> obj engine-sound-id)) - (set! (-> obj engine-sound-id) (new-sound-id)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag idle-sound) (-> obj flags))) + (sound-stop (-> this engine-sound-id)) + (set! (-> this engine-sound-id) (new-sound-id)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag idle-sound) (-> this flags))) ) ) - (sound-play "decel-to-idle" :id (-> obj engine-sound-id) :position (-> obj root trans)) + (sound-play "decel-to-idle" :id (-> this engine-sound-id) :position (-> this root trans)) ) ) ) @@ -102,45 +103,45 @@ (else (set! (-> a0-9 volume) (the int (* 1024.0 f28-0))) (set! (-> a0-9 pitch-mod) (the int (* 1524.0 f0-22))) - (set! (-> a0-9 reg 0) (the-as uint (-> obj info engine-sound-select))) - (set! (-> a0-9 reg 1) (the-as uint (the int (* 127.0 (-> obj hit-points))))) - (sound-play-by-spec a0-9 (-> obj engine-sound-id) (-> obj root trans)) + (set! (-> a0-9 reg 0) (the-as uint (-> this info engine-sound-select))) + (set! (-> a0-9 reg 1) (the-as uint (the int (* 127.0 (-> this hit-points))))) + (sound-play-by-spec a0-9 (-> this engine-sound-id) (-> this root trans)) ) ) ) 0 ) (else - (when (nonzero? (-> obj engine-sound-id)) - (sound-stop (-> obj engine-sound-id)) - (set! (-> obj engine-sound-id) (new 'static 'sound-id)) + (when (nonzero? (-> this engine-sound-id)) + (sound-stop (-> this engine-sound-id)) + (set! (-> this engine-sound-id) (new 'static 'sound-id)) 0 ) ) ) - (when (or (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (nonzero? (-> obj thrust-sound-id))) - (if (zero? (-> obj thrust-sound-id)) - (set! (-> obj thrust-sound-id) (new-sound-id)) + (when (or (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (nonzero? (-> this thrust-sound-id))) + (if (zero? (-> this thrust-sound-id)) + (set! (-> this thrust-sound-id) (new-sound-id)) ) - (seek! (-> obj sputter-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this sputter-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) (cond - ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> obj sputter-sound-envelope) (fmax (-> obj sputter-sound-envelope) (-> obj power-level))) + ((logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (set! (-> this sputter-sound-envelope) (fmax (-> this sputter-sound-envelope) (-> this power-level))) (let ((f1-25 (fmin 1.0 (* 0.7 - (-> obj force-scale) - (-> obj sputter-sound-envelope) - (+ (-> obj engine-sound-factor) (-> obj jump-thrust)) + (-> this force-scale) + (-> this sputter-sound-envelope) + (+ (-> this engine-sound-factor) (-> this jump-thrust)) ) ) ) (f0-38 0.0) ) (sound-play-by-name - (-> obj info thrust-sound) - (-> obj thrust-sound-id) + (-> this info thrust-sound) + (-> this thrust-sound-id) (the int (* 1024.0 f1-25)) (the int (* 1524.0 f0-38)) 0 @@ -150,16 +151,16 @@ ) ) (else - (when (= (-> obj sputter-sound-envelope) 0.0) - (sound-stop (-> obj thrust-sound-id)) - (set! (-> obj thrust-sound-id) (new 'static 'sound-id)) + (when (= (-> this sputter-sound-envelope) 0.0) + (sound-stop (-> this thrust-sound-id)) + (set! (-> this thrust-sound-id) (new 'static 'sound-id)) 0 ) ) ) ) - (if (< (rand-vu) (-> obj power-fluctuation-factor)) - (sound-play "damage-pops" :id (-> obj damage-pop-sound-id)) + (if (< (rand-vu) (-> this power-fluctuation-factor)) + (sound-play "damage-pops" :id (-> this damage-pop-sound-id)) ) 0 (none) @@ -222,7 +223,7 @@ ;; definition for method 84 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-thruster vehicle ((obj vehicle) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) +(defmethod draw-thruster vehicle ((this vehicle) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -235,7 +236,7 @@ (s4-1 (* arg3 f0-0)) (s0-0 (fmin (* arg2 f0-0) (* 0.5 s4-1))) (s3-1 (new 'stack-no-clear 'inline-array 'vehicle-control-point 3)) - (s2-0 (-> obj info)) + (s2-0 (-> this info)) ) (let ((a1-2 (-> s3-1 0 normal))) (let ((v1-2 arg0)) @@ -261,9 +262,9 @@ (set! (-> v1-3 local-pos w) f0-5) ) 0 - (let ((f28-0 (/ s4-1 (-> obj info thruster-flame-length)))) + (let ((f28-0 (/ s4-1 (-> this info thruster-flame-length)))) (set! (-> s3-1 2 local-pos y) (rand-vu-float-range 0.0 64.0)) - (set! (-> s3-1 2 local-pos w) (* (-> obj fog-fade) (+ (* 16.0 f28-0) (* 4.0 (rand-vu))))) + (set! (-> s3-1 2 local-pos w) (* (-> this fog-fade) (+ (* 16.0 f28-0) (* 4.0 (rand-vu))))) ) (let ((f0-14 (* 4.0 s0-0))) (set! (-> s3-1 1 local-pos w) f0-14) @@ -271,7 +272,7 @@ (set! (-> s3-1 1 normal x) (* 0.025 f0-14)) ) (add! *simple-sprite-system* (the-as sprite-glow-data (-> s3-1 1))) - (forward-up->quaternion (the-as quaternion (-> s3-1 0)) arg1 (the-as vector (-> obj rbody state matrix))) + (forward-up->quaternion (the-as quaternion (-> s3-1 0)) arg1 (the-as vector (-> this rbody state matrix))) (quaternion-rotate-local-x! (the-as quaternion (-> s3-1 0)) (the-as quaternion (-> s3-1 0)) 32768.0) (let ((v1-16 (-> s3-1 0 normal))) (let ((a0-10 (* 0.5 s4-1))) @@ -314,45 +315,45 @@ ;; definition for method 85 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-thrusters vehicle ((obj vehicle)) +(defmethod draw-thrusters vehicle ((this vehicle)) (local-vars (sv-272 sparticle-launcher) (sv-276 sparticle-launcher)) - (when (= (-> obj controller traffic sync-mask-32) (ash 1 (logand (-> obj traffic-priority-id) 31))) + (when (= (-> this controller traffic sync-mask-32) (ash 1 (logand (-> this traffic-priority-id) 31))) (let ((f0-1 - (+ (-> *time-of-day-context* time) (* 0.048387095 (the float (logand (-> obj traffic-priority-id) 31)))) + (+ (-> *time-of-day-context* time) (* 0.048387095 (the float (logand (-> this traffic-priority-id) 31)))) ) ) (cond - ((and (logtest? (-> obj flags) (rigid-body-object-flag riding)) (or (< f0-1 7.0) (< 19.0 f0-1))) - (if (not (logtest? (rigid-body-object-flag lights-on) (-> obj flags))) - (vehicle-method-131 obj) + ((and (logtest? (-> this flags) (rigid-body-object-flag riding)) (or (< f0-1 7.0) (< 19.0 f0-1))) + (if (not (logtest? (rigid-body-object-flag lights-on) (-> this flags))) + (vehicle-method-131 this) ) ) (else - (if (logtest? (rigid-body-object-flag lights-on) (-> obj flags)) - (vehicle-method-132 obj) + (if (logtest? (rigid-body-object-flag lights-on) (-> this flags)) + (vehicle-method-132 this) ) ) ) ) ) - (when (logtest? (rigid-body-object-flag lights-update) (-> obj flags)) - (let ((f30-0 (if (logtest? (rigid-body-object-flag lights-on) (-> obj flags)) + (when (logtest? (rigid-body-object-flag lights-update) (-> this flags)) + (let ((f30-0 (if (logtest? (rigid-body-object-flag lights-on) (-> this flags)) 1.0 0.0 ) ) ) - (seek! (-> obj lights-factor) f30-0 (* 2.0 (seconds-per-frame))) - (if (= (-> obj lights-factor) f30-0) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag lights-update))) + (seek! (-> this lights-factor) f30-0 (* 2.0 (seconds-per-frame))) + (if (= (-> this lights-factor) f30-0) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag lights-update))) ) ) ) ) (let ((s5-0 (new 'stack-no-clear 'inline-array 'matrix 2))) (let* ((v1-38 (-> s5-0 1)) - (a3-0 (-> obj node-list data 0 bone transform)) + (a3-0 (-> this node-list data 0 bone transform)) (a0-16 (-> a3-0 quad 0)) (a1-1 (-> a3-0 quad 1)) (a2-1 (-> a3-0 quad 2)) @@ -365,15 +366,15 @@ ) (set-vector! (-> s5-0 0 vector 1) 0.0 0.0 -1.0 1.0) (vector-rotate*! (-> s5-0 0 vector 1) (-> s5-0 0 vector 1) (-> s5-0 1)) - (set! (-> obj fog-fade) (calc-fade-from-fog (-> obj root trans))) - (let ((f30-1 (* (-> obj fog-fade) (-> obj lights-factor)))) + (set! (-> this fog-fade) (calc-fade-from-fog (-> this root trans))) + (let ((f30-1 (* (-> this fog-fade) (-> this lights-factor)))) (when (< 0.0 f30-1) (let ((s4-0 (new 'stack-no-clear 'sprite-glow-data)) (s3-0 *vehicle-headlight-glow-template*) ) - (dotimes (s2-0 (-> obj info headlight-count)) + (dotimes (s2-0 (-> this info headlight-count)) (quad-copy! (the-as pointer s4-0) (the-as pointer s3-0) 4) - (vector-matrix*! (the-as vector (-> s5-0 0)) (-> obj info headlight-local-pos s2-0) (-> s5-0 1)) + (vector-matrix*! (the-as vector (-> s5-0 0)) (-> this info headlight-local-pos s2-0) (-> s5-0 1)) (let* ((v1-44 s4-0) (a1-6 (-> s5-0 0)) (f0-14 (-> v1-44 position w)) @@ -387,7 +388,7 @@ (set! (-> s4-0 color y) (rand-vu-float-range 192.0 255.0)) (set! (-> s4-0 color w) (* f30-1 (rand-vu-float-range 16.0 18.0))) (add! *simple-sprite-system* s4-0) - (let ((f0-21 (-> obj camera-dist2)) + (let ((f0-21 (-> this camera-dist2)) (f1-6 245760.0) ) (when (< f0-21 (* f1-6 f1-6)) @@ -406,8 +407,8 @@ ) (let ((s4-1 (new 'stack-no-clear 'sprite-glow-data))) (quad-copy! (the-as pointer s4-1) (the-as pointer *vehicle-taillight-glow-template*) 4) - (dotimes (s3-1 (-> obj info taillight-count)) - (vector-matrix*! (the-as vector (-> s5-0 0)) (-> obj info taillight-local-pos s3-1) (-> s5-0 1)) + (dotimes (s3-1 (-> this info taillight-count)) + (vector-matrix*! (the-as vector (-> s5-0 0)) (-> this info taillight-local-pos s3-1) (-> s5-0 1)) (let* ((v1-66 s4-1) (a1-18 (-> s5-0 0)) (f0-28 (-> v1-66 position w)) @@ -424,26 +425,26 @@ ) ) ) - (when (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) + (when (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) (let* ((f30-2 (fmax 0.0 - (* (-> obj info thruster-flame-length) (-> obj power-level) (-> obj force-scale) (-> obj engine-thrust)) + (* (-> this info thruster-flame-length) (-> this power-level) (-> this force-scale) (-> this engine-thrust)) ) ) - (f28-3 (fmin (-> obj info thruster-flame-width) f30-2)) + (f28-3 (fmin (-> this info thruster-flame-width) f30-2)) ) (dotimes (s4-2 2) - (vector-matrix*! (the-as vector (-> s5-0 0)) (-> obj info thruster-local-pos s4-2) (-> s5-0 1)) - (draw-thruster obj (the-as vector (-> s5-0 0)) (-> s5-0 0 vector 1) f28-3 f30-2) + (vector-matrix*! (the-as vector (-> s5-0 0)) (-> this info thruster-local-pos s4-2) (-> s5-0 1)) + (draw-thruster this (the-as vector (-> s5-0 0)) (-> s5-0 0 vector 1) f28-3 f30-2) ) ) - (when (logtest? (rigid-body-object-flag ignition) (-> obj flags)) + (when (logtest? (rigid-body-object-flag ignition) (-> this flags)) (set! (-> *part-id-table* 776 init-specs 2 initial-valuef) - (* 6.0 (+ 0.25 (-> obj engine-power-factor)) (rand-vu)) + (* 6.0 (+ 0.25 (-> this engine-power-factor)) (rand-vu)) ) (let* ((f0-40 1.0) - (f1-15 (-> obj engine-power-factor)) + (f1-15 (-> this engine-power-factor)) (f0-41 (- f0-40 (* f1-15 f1-15))) ) (set! (-> *part-id-table* 776 init-specs 9 initial-valuef) (* 16.0 f0-41)) @@ -451,23 +452,23 @@ ) (let ((s4-3 (-> *part-id-table* 776))) (dotimes (s3-2 2) - (vector-matrix*! (the-as vector (-> s5-0 0)) (-> obj info exhaust-local-pos s3-2) (-> s5-0 1)) - (vector-rotate*! (-> s5-0 0 vector 1) (-> obj info exhaust-local-dir s3-2) (-> s5-0 1)) + (vector-matrix*! (the-as vector (-> s5-0 0)) (-> this info exhaust-local-pos s3-2) (-> s5-0 1)) + (vector-rotate*! (-> s5-0 0 vector 1) (-> this info exhaust-local-dir s3-2) (-> s5-0 1)) (vector+float*! - (-> obj info part-vel) - (-> obj rbody state lin-velocity) + (-> this info part-vel) + (-> this rbody state lin-velocity) (-> s5-0 0 vector 1) - (* 0.2 (-> obj info max-engine-thrust) (+ 0.5 (-> obj engine-power-factor))) + (* 0.2 (-> this info max-engine-thrust) (+ 0.5 (-> this engine-power-factor))) ) - (let ((v1-117 (-> obj info part-vel)) - (a0-45 (-> obj info part-vel)) + (let ((v1-117 (-> this info part-vel)) + (a0-45 (-> this info part-vel)) (f0-46 300.0) ) (vector-float*! v1-117 a0-45 (/ 1.0 f0-46)) ) - (set! (-> s4-3 birthaccum) (the-as float (-> obj exhaust-part-accum s3-2))) + (set! (-> s4-3 birthaccum) (the-as float (-> this exhaust-part-accum s3-2))) (let ((t9-25 sp-launch-particles-var) - (a0-46 (-> obj info particle-system-2d)) + (a0-46 (-> this info particle-system-2d)) (a1-34 s4-3) (a2-14 *launch-matrix*) ) @@ -481,11 +482,11 @@ 1.0 ) ) - (set! (-> obj exhaust-part-accum s3-2) (the-as basic (-> s4-3 birthaccum))) + (set! (-> this exhaust-part-accum s3-2) (the-as basic (-> s4-3 birthaccum))) ) ) ) - (when (< (-> obj hit-points) 0.75) + (when (< (-> this hit-points) 0.75) (let* ((f28-5 (+ -32768.0 (* 32768.0 (rand-vu)))) (f24-0 (* 65536.0 (rand-vu))) (f30-6 (cos f28-5)) @@ -499,11 +500,11 @@ (set! sv-272 (the-as sparticle-launcher #f)) (set! sv-276 (the-as sparticle-launcher #f)) (cond - ((< (-> obj hit-points) 0.25) + ((< (-> this hit-points) 0.25) (set! sv-272 (-> *part-id-table* 778)) (set! sv-276 (-> *part-id-table* 774)) ) - ((< (-> obj hit-points) 0.5) + ((< (-> this hit-points) 0.5) (set! sv-272 (-> *part-id-table* 781)) ) (else @@ -515,19 +516,19 @@ (when sv-272 (let ((s3-3 #f)) (dotimes (s4-4 2) - (vector-rotate*! (-> s5-0 0 vector 2) (-> obj info smoke-local-vel s4-4) (-> s5-0 1)) - (vector+! (-> s5-0 0 vector 2) (-> s5-0 0 vector 2) (-> obj rbody state lin-velocity)) + (vector-rotate*! (-> s5-0 0 vector 2) (-> this info smoke-local-vel s4-4) (-> s5-0 1)) + (vector+! (-> s5-0 0 vector 2) (-> s5-0 0 vector 2) (-> this rbody state lin-velocity)) (vector+float*! (-> s5-0 0 vector 2) (-> s5-0 0 vector 2) (-> s5-0 0 trans) (* 24576.0 (rand-vu))) - (let ((v1-152 (-> obj info part-vel)) + (let ((v1-152 (-> this info part-vel)) (a0-54 (-> s5-0 0 vector 2)) (f0-63 300.0) ) (vector-float*! v1-152 a0-54 (/ 1.0 f0-63)) ) - (vector-matrix*! (the-as vector (-> s5-0 0)) (-> obj info smoke-local-pos s4-4) (-> s5-0 1)) + (vector-matrix*! (the-as vector (-> s5-0 0)) (-> this info smoke-local-pos s4-4) (-> s5-0 1)) (when (and sv-276 (< (rand-vu) 0.005)) (let ((t9-37 sp-launch-particles-var) - (a0-56 (-> obj info particle-system-2d)) + (a0-56 (-> this info particle-system-2d)) (a1-44 sv-276) (a2-17 *launch-matrix*) ) @@ -543,9 +544,9 @@ ) (set! s3-3 #t) ) - (set! (-> sv-272 birthaccum) (the-as float (-> obj smoke-part-accum s4-4))) + (set! (-> sv-272 birthaccum) (the-as float (-> this smoke-part-accum s4-4))) (let ((t9-38 sp-launch-particles-var) - (a0-57 (-> obj info particle-system-2d)) + (a0-57 (-> this info particle-system-2d)) (a1-45 sv-272) (a2-18 *launch-matrix*) ) @@ -559,21 +560,21 @@ 1.0 ) ) - (set! (-> obj smoke-part-accum s4-4) (the-as basic (-> sv-272 birthaccum))) + (set! (-> this smoke-part-accum s4-4) (the-as basic (-> sv-272 birthaccum))) ) (if s3-3 - (sound-play "damage-zaps" :id (-> obj damage-zap-sound-id)) + (sound-play "damage-zaps" :id (-> this damage-zap-sound-id)) ) ) ) ) - (when (>= (-> obj scrape-sound-envelope) 0.75) + (when (>= (-> this scrape-sound-envelope) 0.75) (let ((a1-47 (-> *part-id-table* 773)) (t9-40 sp-launch-particles-var) - (a0-60 (-> obj info particle-system-2d)) + (a0-60 (-> this info particle-system-2d)) (a2-20 *launch-matrix*) ) - (set! (-> a2-20 trans quad) (-> obj impact-pos quad)) + (set! (-> a2-20 trans quad) (-> this impact-pos quad)) (t9-40 (the-as sparticle-system a0-60) a1-47 diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc index 59e85f6bf4..13e4358551 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-guard_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type turret-barrel-info -(defmethod inspect turret-barrel-info ((obj turret-barrel-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect turret-barrel-info ((this turret-barrel-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'turret-barrel-info) - (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~1Tlocal-dir: #~%" (-> obj local-dir)) + (format #t "[~8x] ~A~%" this 'turret-barrel-info) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tlocal-dir: #~%" (-> this local-dir)) (label cfg-4) - obj + this ) ;; definition of type turret-control-info @@ -46,27 +46,27 @@ ) ;; definition for method 3 of type turret-control-info -(defmethod inspect turret-control-info ((obj turret-control-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect turret-control-info ((this turret-control-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'turret-control-info) - (format #t "~1Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~1Tbarrel-count: ~D~%" (-> obj barrel-count)) - (format #t "~1Tshot-speed: ~f~%" (-> obj shot-speed)) - (format #t "~1Tattack-range: ~f~%" (-> obj attack-range)) - (format #t "~1Trot-min[2] @ #x~X~%" (-> obj rot-min)) - (format #t "~1Trot-max[2] @ #x~X~%" (-> obj rot-max)) - (format #t "~1Trot-x-min: ~f~%" (-> obj rot-x-min)) - (format #t "~1Trot-x-max: ~f~%" (-> obj rot-x-max)) - (format #t "~1Trot-y-min: ~f~%" (-> obj rot-y-min)) - (format #t "~1Trot-y-max: ~f~%" (-> obj rot-y-max)) - (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~1Tlocal-dir: #~%" (-> obj local-dir)) - (format #t "~1Tbarrel-array[4] @ #x~X~%" (-> obj barrel-array)) + (format #t "[~8x] ~A~%" this 'turret-control-info) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~1Tbarrel-count: ~D~%" (-> this barrel-count)) + (format #t "~1Tshot-speed: ~f~%" (-> this shot-speed)) + (format #t "~1Tattack-range: ~f~%" (-> this attack-range)) + (format #t "~1Trot-min[2] @ #x~X~%" (-> this rot-min)) + (format #t "~1Trot-max[2] @ #x~X~%" (-> this rot-max)) + (format #t "~1Trot-x-min: ~f~%" (-> this rot-x-min)) + (format #t "~1Trot-x-max: ~f~%" (-> this rot-x-max)) + (format #t "~1Trot-y-min: ~f~%" (-> this rot-y-min)) + (format #t "~1Trot-y-max: ~f~%" (-> this rot-y-max)) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tlocal-dir: #~%" (-> this local-dir)) + (format #t "~1Tbarrel-array[4] @ #x~X~%" (-> this barrel-array)) (label cfg-4) - obj + this ) ;; definition of type turret-control @@ -109,16 +109,16 @@ ) ;; definition for method 3 of type turret-control -(defmethod inspect turret-control ((obj turret-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect turret-control ((this turret-control)) + (when (not this) + (set! this this) (goto cfg-16) ) - (format #t "[~8x] ~A~%" obj 'turret-control) - (format #t "~1Tinfo: #~%" (-> obj info)) - (format #t "~1Tguard-settings: #~%" (-> obj guard-settings)) - (format #t "~1Tflags: #x~X : (turret-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'turret-control) + (format #t "~1Tinfo: #~%" (-> this info)) + (format #t "~1Tguard-settings: #~%" (-> this guard-settings)) + (format #t "~1Tflags: #x~X : (turret-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (turret-flag no-rot-y-clamp)) (turret-flag no-rot-y-clamp)) (format #t "no-rot-y-clamp ") ) @@ -139,41 +139,41 @@ ) ) (format #t ")~%") - (format #t "~1Tshot-count: ~D~%" (-> obj shot-count)) - (format #t "~1Tburst-count: ~D~%" (-> obj burst-count)) - (format #t "~1Ttarget-dist: ~f~%" (-> obj target-dist)) - (format #t "~1Tinaccuracy: ~f~%" (-> obj inaccuracy)) - (format #t "~1Taim-offset-angle: ~f~%" (-> obj aim-offset-angle)) - (format #t "~1Taim-rot[2] @ #x~X~%" (-> obj aim-rot)) - (format #t "~1Taim-rot-vel[2] @ #x~X~%" (-> obj aim-rot-vel)) - (format #t "~1Taim-rot-offset[2] @ #x~X~%" (-> obj aim-rot-offset)) - (format #t "~1Taim-rot-x: ~f~%" (-> obj aim-rot-x)) - (format #t "~1Taim-rot-y: ~f~%" (-> obj aim-rot-y)) - (format #t "~1Taim-rot-vel-x: ~f~%" (-> obj aim-rot-vel-x)) - (format #t "~1Taim-rot-vel-y: ~f~%" (-> obj aim-rot-vel-y)) - (format #t "~1Ttarget-in-sight-time: ~D~%" (-> obj target-in-sight-time)) - (format #t "~1Taim-acquire-time: ~D~%" (-> obj aim-acquire-time)) - (format #t "~1Tshoot-time: ~D~%" (-> obj shoot-time)) - (format #t "~1Towner-handle: ~D~%" (-> obj owner-handle)) + (format #t "~1Tshot-count: ~D~%" (-> this shot-count)) + (format #t "~1Tburst-count: ~D~%" (-> this burst-count)) + (format #t "~1Ttarget-dist: ~f~%" (-> this target-dist)) + (format #t "~1Tinaccuracy: ~f~%" (-> this inaccuracy)) + (format #t "~1Taim-offset-angle: ~f~%" (-> this aim-offset-angle)) + (format #t "~1Taim-rot[2] @ #x~X~%" (-> this aim-rot)) + (format #t "~1Taim-rot-vel[2] @ #x~X~%" (-> this aim-rot-vel)) + (format #t "~1Taim-rot-offset[2] @ #x~X~%" (-> this aim-rot-offset)) + (format #t "~1Taim-rot-x: ~f~%" (-> this aim-rot-x)) + (format #t "~1Taim-rot-y: ~f~%" (-> this aim-rot-y)) + (format #t "~1Taim-rot-vel-x: ~f~%" (-> this aim-rot-vel-x)) + (format #t "~1Taim-rot-vel-y: ~f~%" (-> this aim-rot-vel-y)) + (format #t "~1Ttarget-in-sight-time: ~D~%" (-> this target-in-sight-time)) + (format #t "~1Taim-acquire-time: ~D~%" (-> this aim-acquire-time)) + (format #t "~1Tshoot-time: ~D~%" (-> this shoot-time)) + (format #t "~1Towner-handle: ~D~%" (-> this owner-handle)) (label cfg-16) - obj + this ) ;; definition for method 15 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod set-info turret-control ((obj turret-control) (arg0 turret-control-info)) - (set! (-> obj info) arg0) - (set! (-> obj owner-handle) (the-as handle #f)) +(defmethod set-info turret-control ((this turret-control) (arg0 turret-control-info)) + (set! (-> this info) arg0) + (set! (-> this owner-handle) (the-as handle #f)) 0 (none) ) ;; definition for method 12 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mod turret-control ((obj turret-control) (arg0 joint-mod-rotate-local)) +(defmethod update-joint-mod turret-control ((this turret-control) (arg0 joint-mod-rotate-local)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 x) (- (-> obj aim-rot-x))) - (set! (-> v1-0 y) (-> obj aim-rot-y)) + (set! (-> v1-0 x) (- (-> this aim-rot-x))) + (set! (-> v1-0 y) (-> this aim-rot-y)) (set! (-> v1-0 z) 0.0) (quaternion-zxy! (-> arg0 rotation) v1-0) ) @@ -183,25 +183,26 @@ ;; definition for method 13 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-13 turret-control ((obj turret-control)) - (let ((f30-0 - (/ (* 298261630.0 (-> obj inaccuracy) (-> obj guard-settings inaccuracy)) (fmax 40960.0 (-> obj target-dist))) - ) +(defmethod turret-control-method-13 turret-control ((this turret-control)) + (let ((f30-0 (/ (* 298261630.0 (-> this inaccuracy) (-> this guard-settings inaccuracy)) + (fmax 40960.0 (-> this target-dist)) + ) + ) ) - (set! (-> obj aim-rot-offset 0) (* f30-0 (cos (-> obj aim-offset-angle)))) - (set! (-> obj aim-rot-offset 1) (* f30-0 (sin (-> obj aim-offset-angle)))) + (set! (-> this aim-rot-offset 0) (* f30-0 (cos (-> this aim-offset-angle)))) + (set! (-> this aim-rot-offset 1) (* f30-0 (sin (-> this aim-offset-angle)))) ) - (+! (-> obj aim-offset-angle) (* 32768.0 (rand-vu))) + (+! (-> this aim-offset-angle) (* 32768.0 (rand-vu))) 0 (none) ) ;; definition for method 14 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-14 turret-control ((obj turret-control)) - (logclear! (-> obj flags) (turret-flag firing aiming)) - (set! (-> obj burst-count) 0) - (set! (-> obj aim-offset-angle) (* 65536.0 (rand-vu))) +(defmethod turret-control-method-14 turret-control ((this turret-control)) + (logclear! (-> this flags) (turret-flag firing aiming)) + (set! (-> this burst-count) 0) + (set! (-> this aim-offset-angle) (* 65536.0 (rand-vu))) 0 (none) ) @@ -336,11 +337,11 @@ ;; definition for method 9 of type turret-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-9 turret-control ((obj turret-control) (arg0 vehicle) (arg1 vector) (arg2 vector)) +(defmethod turret-control-method-9 turret-control ((this turret-control) (arg0 vehicle) (arg1 vector) (arg2 vector)) (let ((gp-0 (new 'stack-no-clear 'turret-unknown-stack-structure))) (set! (-> gp-0 vec-12 x) (seconds-per-frame)) (let* ((v1-1 (-> gp-0 mat-1)) - (a3-1 (-> arg0 node-list data (-> obj info joint-index) bone transform)) + (a3-1 (-> arg0 node-list data (-> this info joint-index) bone transform)) (a0-4 (-> a3-1 quad 0)) (a1-4 (-> a3-1 quad 1)) (a2-1 (-> a3-1 quad 2)) @@ -351,15 +352,15 @@ (set! (-> v1-1 quad 2) a2-1) (set! (-> v1-1 trans quad) a3-2) ) - (set! (-> obj target-dist) (vector-vector-distance (-> gp-0 mat-1 trans) arg1)) - (let ((f0-3 (/ (-> obj target-dist) (-> obj info shot-speed)))) + (set! (-> this target-dist) (vector-vector-distance (-> gp-0 mat-1 trans) arg1)) + (let ((f0-3 (/ (-> this target-dist) (-> this info shot-speed)))) (vector+float*! (-> gp-0 vec-1) arg1 arg2 f0-3) ) - (when (not (logtest? (-> obj flags) (turret-flag aiming))) - (logior! (-> obj flags) (turret-flag aiming)) - (turret-control-method-13 obj) + (when (not (logtest? (-> this flags) (turret-flag aiming))) + (logior! (-> this flags) (turret-flag aiming)) + (turret-control-method-13 this) ) - (vector-matrix*! (-> gp-0 vec-6) (-> obj info local-pos) (-> gp-0 mat-1)) + (vector-matrix*! (-> gp-0 vec-6) (-> this info local-pos) (-> gp-0 mat-1)) (vector-! (-> gp-0 vec-5) (-> gp-0 vec-1) (-> gp-0 vec-6)) (let* ((v1-14 (-> gp-0 mat-1)) (a3-3 (-> arg0 node-list data 0 bone transform)) @@ -381,47 +382,47 @@ ) (set! (-> gp-0 vec-4 x) (atan (-> gp-0 vec-3 y) f0-11)) ) - (+! (-> gp-0 vec-4 x) (-> obj aim-rot-offset 0)) - (+! (-> gp-0 vec-4 y) (-> obj aim-rot-offset 1)) + (+! (-> gp-0 vec-4 x) (-> this aim-rot-offset 0)) + (+! (-> gp-0 vec-4 y) (-> this aim-rot-offset 1)) (dotimes (s3-1 2) - (+! (-> obj aim-rot-vel s3-1) + (+! (-> this aim-rot-vel s3-1) (* 5.0 - (- (* 8.0 (if (or (zero? s3-1) (not (logtest? (-> obj flags) (turret-flag no-rot-y-clamp)))) - (- (-> gp-0 vec-4 data s3-1) (-> obj aim-rot s3-1)) - (deg- (-> gp-0 vec-4 data s3-1) (-> obj aim-rot s3-1)) + (- (* 8.0 (if (or (zero? s3-1) (not (logtest? (-> this flags) (turret-flag no-rot-y-clamp)))) + (- (-> gp-0 vec-4 data s3-1) (-> this aim-rot s3-1)) + (deg- (-> gp-0 vec-4 data s3-1) (-> this aim-rot s3-1)) ) ) - (-> obj aim-rot-vel s3-1) + (-> this aim-rot-vel s3-1) ) (-> gp-0 vec-12 x) ) ) - (set! (-> obj aim-rot-vel s3-1) (* (-> obj aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) - (+! (-> obj aim-rot s3-1) (* (-> obj aim-rot-vel s3-1) (-> gp-0 vec-12 x))) - (when (or (zero? s3-1) (not (logtest? (-> obj flags) (turret-flag no-rot-y-clamp)))) - (let ((f0-31 (-> obj info rot-min s3-1))) - (when (< (-> obj aim-rot s3-1) f0-31) - (set! (-> obj aim-rot s3-1) f0-31) - (set! (-> obj aim-rot-vel s3-1) 0.0) + (set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x)))))) + (+! (-> this aim-rot s3-1) (* (-> this aim-rot-vel s3-1) (-> gp-0 vec-12 x))) + (when (or (zero? s3-1) (not (logtest? (-> this flags) (turret-flag no-rot-y-clamp)))) + (let ((f0-31 (-> this info rot-min s3-1))) + (when (< (-> this aim-rot s3-1) f0-31) + (set! (-> this aim-rot s3-1) f0-31) + (set! (-> this aim-rot-vel s3-1) 0.0) ) ) - (let ((f0-33 (-> obj info rot-max s3-1))) - (when (< f0-33 (-> obj aim-rot s3-1)) - (set! (-> obj aim-rot s3-1) f0-33) - (set! (-> obj aim-rot-vel s3-1) 0.0) + (let ((f0-33 (-> this info rot-max s3-1))) + (when (< f0-33 (-> this aim-rot s3-1)) + (set! (-> this aim-rot s3-1) f0-33) + (set! (-> this aim-rot-vel s3-1) 0.0) ) ) ) ) - (logclear! (-> obj flags) (turret-flag should-shoot)) - (when (and (< (fabs (deg- (-> obj aim-rot-x) (-> gp-0 vec-4 x))) 2912.7112) - (< (fabs (deg- (-> obj aim-rot-y) (-> gp-0 vec-4 y))) 2912.7112) - (< (-> obj target-dist) (-> obj info attack-range)) + (logclear! (-> this flags) (turret-flag should-shoot)) + (when (and (< (fabs (deg- (-> this aim-rot-x) (-> gp-0 vec-4 x))) 2912.7112) + (< (fabs (deg- (-> this aim-rot-y) (-> gp-0 vec-4 y))) 2912.7112) + (< (-> this target-dist) (-> this info attack-range)) ) - (logior! (-> obj flags) (turret-flag should-shoot)) - (when (logtest? (-> obj flags) (turret-flag targetting-laser)) + (logior! (-> this flags) (turret-flag should-shoot)) + (when (logtest? (-> this flags) (turret-flag targetting-laser)) (let* ((v1-88 (-> gp-0 mat-1)) - (a3-5 (-> arg0 node-list data (-> obj info joint-index) bone transform)) + (a3-5 (-> arg0 node-list data (-> this info joint-index) bone transform)) (a0-29 (-> a3-5 quad 0)) (a1-20 (-> a3-5 quad 1)) (a2-5 (-> a3-5 quad 2)) @@ -435,7 +436,7 @@ (set! (-> gp-0 vec-7 quad) (-> gp-0 mat-1 vector 2 quad)) (let ((s3-2 (new 'stack-no-clear 'collide-query))) (set! (-> s3-2 start-pos quad) (-> gp-0 vec-6 quad)) - (vector-float*! (-> s3-2 move-dist) (-> gp-0 vec-7) (-> obj info attack-range)) + (vector-float*! (-> s3-2 move-dist) (-> gp-0 vec-7) (-> this info attack-range)) (let ((v1-93 s3-2)) (set! (-> v1-93 radius) 409.6) (set! (-> v1-93 collide-with) @@ -488,39 +489,39 @@ ;; definition for method 10 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-10 turret-control ((obj turret-control) (arg0 vehicle)) +(defmethod turret-control-method-10 turret-control ((this turret-control) (arg0 vehicle)) (cond - ((logtest? (-> obj flags) (turret-flag should-shoot)) + ((logtest? (-> this flags) (turret-flag should-shoot)) (cond - ((logtest? (-> obj flags) (turret-flag firing)) + ((logtest? (-> this flags) (turret-flag firing)) (cond - ((> (-> obj shot-count) 0) - (if (>= (- (current-time) (-> obj shoot-time)) (the-as time-frame (-> obj guard-settings shot-delay))) - (turret-control-method-17 obj arg0) + ((> (-> this shot-count) 0) + (if (time-elapsed? (-> this shoot-time) (the-as time-frame (-> this guard-settings shot-delay))) + (turret-control-method-17 this arg0) ) ) (else - (logclear! (-> obj flags) (turret-flag firing)) - (+! (-> obj burst-count) 1) - (turret-control-method-13 obj) + (logclear! (-> this flags) (turret-flag firing)) + (+! (-> this burst-count) 1) + (turret-control-method-13 this) ) ) ) (else - (when (and (>= (- (current-time) (-> obj shoot-time)) (the-as time-frame (-> obj guard-settings burst-delay))) - (>= (- (current-time) (-> obj aim-acquire-time)) (the-as time-frame (-> obj guard-settings acquire-delay))) + (when (and (time-elapsed? (-> this shoot-time) (the-as time-frame (-> this guard-settings burst-delay))) + (time-elapsed? (-> this aim-acquire-time) (the-as time-frame (-> this guard-settings acquire-delay))) ) - (set! (-> obj shot-count) - (+ (-> obj guard-settings shot-count) (rand-vu-int-count (+ (-> obj guard-settings rand-shot-count) 1))) + (set! (-> this shot-count) + (+ (-> this guard-settings shot-count) (rand-vu-int-count (+ (-> this guard-settings rand-shot-count) 1))) ) - (logior! (-> obj flags) (turret-flag firing)) + (logior! (-> this flags) (turret-flag firing)) ) ) ) ) (else - (set! (-> obj aim-acquire-time) (current-time)) - (turret-control-method-14 obj) + (set-time! (-> this aim-acquire-time)) + (turret-control-method-14 this) ) ) 0 @@ -529,11 +530,11 @@ ;; definition for method 11 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-11 turret-control ((obj turret-control) (arg0 object) (arg1 object) (arg2 vector)) - (when (nonzero? (-> obj info)) - (set! (-> obj inaccuracy) (* 0.000012207031 (+ 20480.0 (vector-length arg2)))) - (turret-control-method-9 obj (the-as vehicle arg0) (the-as vector arg1) arg2) - (turret-control-method-10 obj (the-as vehicle arg0)) +(defmethod turret-control-method-11 turret-control ((this turret-control) (arg0 object) (arg1 object) (arg2 vector)) + (when (nonzero? (-> this info)) + (set! (-> this inaccuracy) (* 0.000012207031 (+ 20480.0 (vector-length arg2)))) + (turret-control-method-9 this (the-as vehicle arg0) (the-as vector arg1) arg2) + (turret-control-method-10 this (the-as vehicle arg0)) ) 0 (none) @@ -542,13 +543,13 @@ ;; definition for method 17 of type turret-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-17 turret-control ((obj turret-control) (arg0 vehicle)) +(defmethod turret-control-method-17 turret-control ((this turret-control) (arg0 vehicle)) (let ((s4-0 (new 'stack-no-clear 'turret-unknown-stack-structure2))) (set! (-> s4-0 proj-params ent) (-> arg0 entity)) (set! (-> s4-0 proj-params charge) 1.0) (set! (-> s4-0 proj-params options) (projectile-options)) (set! (-> s4-0 proj-params notify-handle) (process->handle arg0)) - (set! (-> s4-0 proj-params owner-handle) (process->handle (handle->process (-> obj owner-handle)))) + (set! (-> s4-0 proj-params owner-handle) (process->handle (handle->process (-> this owner-handle)))) (set! (-> s4-0 proj-params ignore-handle) (process->handle arg0)) (let* ((v1-14 *game-info*) (a0-16 (+ (-> v1-14 attack-id) 1)) @@ -558,7 +559,7 @@ ) (set! (-> s4-0 proj-params timeout) (seconds 4)) (let* ((v1-16 (-> s4-0 mat-1)) - (a3-0 (-> arg0 node-list data (-> obj info joint-index) bone transform)) + (a3-0 (-> arg0 node-list data (-> this info joint-index) bone transform)) (a0-20 (-> a3-0 quad 0)) (a1-6 (-> a3-0 quad 1)) (a2-0 (-> a3-0 quad 2)) @@ -569,38 +570,38 @@ (set! (-> v1-16 quad 2) a2-0) (set! (-> v1-16 trans quad) a3-1) ) - (dotimes (s3-0 (-> obj info barrel-count)) - (vector-matrix*! (-> s4-0 vec-1) (the-as vector (-> obj info barrel-array s3-0)) (-> s4-0 mat-1)) + (dotimes (s3-0 (-> this info barrel-count)) + (vector-matrix*! (-> s4-0 vec-1) (the-as vector (-> this info barrel-array s3-0)) (-> s4-0 mat-1)) (set! (-> s4-0 vec-2 quad) (-> s4-0 mat-1 vector 2 quad)) (set! (-> s4-0 proj-params pos quad) (-> s4-0 vec-1 quad)) - (vector-float*! (-> s4-0 proj-params vel) (-> s4-0 vec-2) (-> obj info shot-speed)) + (vector-float*! (-> s4-0 proj-params vel) (-> s4-0 vec-2) (-> this info shot-speed)) (spawn-projectile guard-shot (-> s4-0 proj-params) arg0 *default-dead-pool*) ) ) - (set! (-> obj shoot-time) (current-time)) - (+! (-> obj shot-count) -1) + (set-time! (-> this shoot-time)) + (+! (-> this shot-count) -1) 0 (none) ) ;; definition for method 16 of type turret-control ;; WARN: Return type mismatch int vs none. -(defmethod turret-control-method-16 turret-control ((obj turret-control) (arg0 float) (arg1 float)) +(defmethod turret-control-method-16 turret-control ((this turret-control) (arg0 float) (arg1 float)) (let ((f0-0 (seconds-per-frame))) - (set! (-> obj aim-rot-vel-x) arg1) - (set! (-> obj aim-rot-vel-y) arg0) + (set! (-> this aim-rot-vel-x) arg1) + (set! (-> this aim-rot-vel-y) arg0) (dotimes (v1-1 2) - (+! (-> obj aim-rot v1-1) (* f0-0 (-> obj aim-rot-vel v1-1))) - (let ((f1-4 (-> obj info rot-min v1-1))) - (when (< (-> obj aim-rot v1-1) f1-4) - (set! (-> obj aim-rot v1-1) f1-4) - (set! (-> obj aim-rot-vel v1-1) 0.0) + (+! (-> this aim-rot v1-1) (* f0-0 (-> this aim-rot-vel v1-1))) + (let ((f1-4 (-> this info rot-min v1-1))) + (when (< (-> this aim-rot v1-1) f1-4) + (set! (-> this aim-rot v1-1) f1-4) + (set! (-> this aim-rot-vel v1-1) 0.0) ) ) - (let ((f1-6 (-> obj info rot-max v1-1))) - (when (< f1-6 (-> obj aim-rot v1-1)) - (set! (-> obj aim-rot v1-1) f1-6) - (set! (-> obj aim-rot-vel v1-1) 0.0) + (let ((f1-6 (-> this info rot-max v1-1))) + (when (< f1-6 (-> this aim-rot v1-1)) + (set! (-> this aim-rot v1-1) f1-6) + (set! (-> this aim-rot-vel v1-1) 0.0) ) ) ) @@ -631,27 +632,27 @@ ) ;; definition for method 3 of type vehicle-guard-target-data -(defmethod inspect vehicle-guard-target-data ((obj vehicle-guard-target-data)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-guard-target-data ((this vehicle-guard-target-data)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-guard-target-data) - (format #t "~1Ttpos: #~%" (-> obj tpos)) - (format #t "~1Tspos: #~%" (-> obj spos)) - (format #t "~1Ttvel: #~%" (-> obj tvel)) - (format #t "~1Tsvel: #~%" (-> obj svel)) - (format #t "~1Ttdir: #~%" (-> obj tdir)) - (format #t "~1Tsdir: #~%" (-> obj sdir)) - (format #t "~1Tto-target: #~%" (-> obj to-target)) - (format #t "~1Tto-target-dir: #~%" (-> obj to-target-dir)) - (format #t "~1Ttemp: #~%" (-> obj temp)) - (format #t "~1Ttarget: ~A~%" (-> obj target)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) - (format #t "~1Tinv-dist: ~f~%" (-> obj inv-dist)) - (format #t "~1Tattack-range: ~f~%" (-> obj attack-range)) + (format #t "[~8x] ~A~%" this 'vehicle-guard-target-data) + (format #t "~1Ttpos: #~%" (-> this tpos)) + (format #t "~1Tspos: #~%" (-> this spos)) + (format #t "~1Ttvel: #~%" (-> this tvel)) + (format #t "~1Tsvel: #~%" (-> this svel)) + (format #t "~1Ttdir: #~%" (-> this tdir)) + (format #t "~1Tsdir: #~%" (-> this sdir)) + (format #t "~1Tto-target: #~%" (-> this to-target)) + (format #t "~1Tto-target-dir: #~%" (-> this to-target-dir)) + (format #t "~1Ttemp: #~%" (-> this temp)) + (format #t "~1Ttarget: ~A~%" (-> this target)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tinv-dist: ~f~%" (-> this inv-dist)) + (format #t "~1Tattack-range: ~f~%" (-> this attack-range)) (label cfg-4) - obj + this ) ;; definition of type vehicle-guard @@ -691,18 +692,18 @@ ) ;; definition for method 3 of type vehicle-guard -(defmethod inspect vehicle-guard ((obj vehicle-guard)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-guard ((this vehicle-guard)) + (when (not this) + (set! this this) (goto cfg-14) ) (let ((t9-0 (method-of-type vehicle inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tai-hook: ~A~%" (-> obj ai-hook)) - (format #t "~2Tturret: #~%" (-> obj turret)) - (format #t "~2Ttarget-flags: #x~X : (traffic-target-flag " (-> obj target-flags)) - (let ((s5-0 (-> obj target-flags))) + (format #t "~2Tai-hook: ~A~%" (-> this ai-hook)) + (format #t "~2Tturret: #~%" (-> this turret)) + (format #t "~2Ttarget-flags: #x~X : (traffic-target-flag " (-> this target-flags)) + (let ((s5-0 (-> this target-flags))) (if (= (logand s5-0 (turret-flag firing)) (turret-flag firing)) (format #t "visible-now ") ) @@ -720,22 +721,22 @@ ) ) (format #t ")~%") - (format #t "~2Ttarget-in-sight-time: ~D~%" (-> obj target-in-sight-time)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) - (format #t "~2Ttraffic-target-status: #~%" (&-> obj traffic-target-status)) - (format #t "~2Tpursuit-target: ~D~%" (-> obj pursuit-target)) - (format #t "~2Tlod2: ~A~%" (-> obj lod2)) + (format #t "~2Ttarget-in-sight-time: ~D~%" (-> this target-in-sight-time)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Ttraffic-target-status: #~%" (&-> this traffic-target-status)) + (format #t "~2Tpursuit-target: ~D~%" (-> this pursuit-target)) + (format #t "~2Tlod2: ~A~%" (-> this lod2)) (label cfg-14) - obj + this ) ;; definition for method 153 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-153 vehicle-guard ((obj vehicle-guard) (arg0 target)) +(defmethod vehicle-guard-method-153 vehicle-guard ((this vehicle-guard) (arg0 target)) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans arg0 3) quad)) - (turret-control-method-11 (-> obj turret) obj s5-0 (-> arg0 control transv)) + (turret-control-method-11 (-> this turret) this s5-0 (-> arg0 control transv)) ) 0 (none) @@ -744,14 +745,14 @@ ;; definition for method 151 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-151 vehicle-guard ((obj vehicle-guard) (arg0 vehicle-guard-target-data)) - (let ((s5-0 (handle->process (-> obj pursuit-target)))) +(defmethod vehicle-guard-method-151 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) + (let ((s5-0 (handle->process (-> this pursuit-target)))) (set! (-> arg0 target) (the-as target s5-0)) (when s5-0 (set! (-> arg0 tpos quad) (-> (the-as process-drawable s5-0) root trans quad)) - (set! (-> arg0 spos quad) (-> obj root trans quad)) + (set! (-> arg0 spos quad) (-> this root trans quad)) (set! (-> arg0 tvel quad) (-> (the-as process-drawable s5-0) root transv quad)) - (set! (-> arg0 svel quad) (-> obj root transv quad)) + (set! (-> arg0 svel quad) (-> this root transv quad)) (vector-normalize-copy! (-> arg0 tdir) (-> arg0 tvel) 1.0) (vector-normalize-copy! (-> arg0 sdir) (-> arg0 svel) 1.0) (+! (-> arg0 tpos y) 4096.0) @@ -778,13 +779,13 @@ ;; definition for method 152 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-152 vehicle-guard ((obj vehicle-guard) (arg0 vehicle-guard-target-data)) - (let ((s4-0 (handle->process (-> obj pursuit-target)))) +(defmethod vehicle-guard-method-152 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) + (let ((s4-0 (handle->process (-> this pursuit-target)))) (cond - ((logtest? (rigid-body-object-flag target-in-sight) (-> obj flags)) - (logclear! (-> obj controller flags) (vehicle-controller-flag direct-mode)) + ((logtest? (rigid-body-object-flag target-in-sight) (-> this flags)) + (logclear! (-> this controller flags) (vehicle-controller-flag direct-mode)) (when (>= (- (vector-dot (-> arg0 to-target-dir) (-> arg0 tdir))) (cos 21845.334)) - (logior! (-> obj controller flags) (vehicle-controller-flag direct-mode)) + (logior! (-> this controller flags) (vehicle-controller-flag direct-mode)) (vector-! (-> arg0 temp) (-> arg0 svel) (-> arg0 tvel)) (let* ((f2-0 (vector-dot (-> arg0 temp) (-> arg0 to-target-dir))) (f0-5 (fmax 0.0 (fmin 1.0 (/ (-> arg0 dist) (fmax 4096.0 f2-0))))) @@ -802,23 +803,23 @@ ) ) ) - (vehicle-controller-method-19 (-> obj controller) (-> arg0 spos) #x43cccccd (-> arg0 tpos) (-> arg0 tvel)) - (vector-! (-> arg0 to-target) (-> obj controller target-point) (-> arg0 spos)) + (vehicle-controller-method-19 (-> this controller) (-> arg0 spos) #x43cccccd (-> arg0 tpos) (-> arg0 tvel)) + (vector-! (-> arg0 to-target) (-> this controller target-point) (-> arg0 spos)) (vector-normalize-copy! (-> arg0 to-target-dir) (-> arg0 to-target) 1.0) (cond ((< -12288.0 (- (-> arg0 tpos y) (-> arg0 spos y))) - (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others no-slowing-for-turns)) - (let* ((f0-9 (* 2.0 (-> obj info max-xz-speed))) + (logior! (-> this controller flags) (vehicle-controller-flag ignore-others no-slowing-for-turns)) + (let* ((f0-9 (* 2.0 (-> this info max-xz-speed))) (f1-8 (fmax 0.0 (vector-dot (-> arg0 sdir) (-> arg0 to-target-dir)))) (f0-10 (* f0-9 (* f1-8 f1-8))) ) - (+! (-> obj controller target-speed) f0-10) + (+! (-> this controller target-speed) f0-10) ) ) (else - (logclear! (-> obj controller flags) (vehicle-controller-flag ignore-others no-slowing-for-turns)) - (let ((f0-13 (* (-> obj info max-xz-speed) (fmax 0.0 (vector-dot (-> arg0 sdir) (-> arg0 to-target-dir)))))) - (+! (-> obj controller target-speed) f0-13) + (logclear! (-> this controller flags) (vehicle-controller-flag ignore-others no-slowing-for-turns)) + (let ((f0-13 (* (-> this info max-xz-speed) (fmax 0.0 (vector-dot (-> arg0 sdir) (-> arg0 to-target-dir)))))) + (+! (-> this controller target-speed) f0-13) ) ) ) @@ -834,53 +835,53 @@ ;; definition for method 150 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-150 vehicle-guard ((obj vehicle-guard)) +(defmethod vehicle-guard-method-150 vehicle-guard ((this vehicle-guard)) (cond - ((handle->process (-> obj pursuit-target)) + ((handle->process (-> this pursuit-target)) (let ((v1-3 (new 'stack-no-clear 'vehicle-control-point))) - (set! (-> v1-3 local-pos quad) (-> obj root trans quad)) + (set! (-> v1-3 local-pos quad) (-> this root trans quad)) (let ((v1-4 (traffic-engine-method-49 - (-> obj controller traffic) + (-> this controller traffic) (-> v1-3 local-pos) - (-> obj traffic-priority-id) - (the-as traffic-target-status (&-> obj traffic-target-status)) + (-> this traffic-priority-id) + (the-as traffic-target-status (&-> this traffic-target-status)) ) ) ) (when (logtest? (-> v1-4 flags) (traffic-target-flag updated)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag target-in-sight))) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag target-in-sight))) ) (when (logtest? (-> v1-4 flags) (traffic-target-flag visible-now)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag target-in-sight) (-> obj flags))) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag target-in-sight) (-> this flags))) ) - (set! (-> obj target-in-sight-time) (current-time)) + (set-time! (-> this target-in-sight-time)) ) ) - (set! (-> obj target-flags) (the-as turret-flag (-> v1-4 flags))) + (set! (-> this target-flags) (the-as turret-flag (-> v1-4 flags))) ) ) - (when (not (logtest? (rigid-body-object-flag in-pursuit) (-> obj flags))) - (if (logtest? (rigid-body-object-flag target-in-sight) (-> obj flags)) - (vehicle-method-108 obj) + (when (not (logtest? (rigid-body-object-flag in-pursuit) (-> this flags))) + (if (logtest? (rigid-body-object-flag target-in-sight) (-> this flags)) + (vehicle-method-108 this) ) ) ) (else - (vehicle-method-109 obj) + (vehicle-method-109 this) ) ) - (let ((v1-22 (if (logtest? (rigid-body-object-flag in-pursuit) (-> obj flags)) - (-> obj draw lod-set lod 1 geo) - (-> obj lod2) + (let ((v1-22 (if (logtest? (rigid-body-object-flag in-pursuit) (-> this flags)) + (-> this draw lod-set lod 1 geo) + (-> this lod2) ) ) ) - (when (!= v1-22 (-> obj draw lod-set lod 2 geo)) - (set! (-> obj draw lod-set lod 2 geo) (the-as merc-ctrl v1-22)) - (set! (-> obj draw cur-lod) -1) - (lod-set! (-> obj draw) (-> obj draw desired-lod)) + (when (!= v1-22 (-> this draw lod-set lod 2 geo)) + (set! (-> this draw lod-set lod 2 geo) (the-as merc-ctrl v1-22)) + (set! (-> this draw cur-lod) -1) + (lod-set! (-> this draw) (-> this draw desired-lod)) ) ) 0 @@ -890,26 +891,26 @@ ;; definition for method 155 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-155 vehicle-guard ((obj vehicle-guard) (arg0 vector) (arg1 vector)) +(defmethod vehicle-guard-method-155 vehicle-guard ((this vehicle-guard) (arg0 vector) (arg1 vector)) (cond (#f (let ((s5-0 (new 'stack-no-clear 'traj3d-params))) (let ((f0-2 (+ 0.5 (* 0.5 (rand-vu))))) - (set! (-> s5-0 src quad) (-> obj root trans quad)) + (set! (-> s5-0 src quad) (-> this root trans quad)) (vector+float*! (-> s5-0 dest) arg0 arg1 f0-2) ) (set! (-> s5-0 initial-tilt) 8192.0) (set! (-> s5-0 gravity) 184320.0) (when (traj3d-calc-initial-velocity-using-tilt s5-0) (let ((a1-1 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> a1-1 ent) (-> obj entity)) + (set! (-> a1-1 ent) (-> this entity)) (set! (-> a1-1 charge) 1.0) (set! (-> a1-1 options) (projectile-options)) (set! (-> a1-1 pos quad) (-> s5-0 src quad)) (set! (-> a1-1 vel quad) (-> s5-0 initial-velocity quad)) (set! (-> a1-1 notify-handle) (the-as handle #f)) (set! (-> a1-1 owner-handle) (the-as handle #f)) - (set! (-> a1-1 ignore-handle) (process->handle obj)) + (set! (-> a1-1 ignore-handle) (process->handle this)) (let* ((v1-15 *game-info*) (a0-14 (+ (-> v1-15 attack-id) 1)) ) @@ -917,10 +918,10 @@ (set! (-> a1-1 attack-id) a0-14) ) (set! (-> a1-1 timeout) (seconds 4)) - (spawn-projectile vehicle-grenade a1-1 obj *default-dead-pool*) + (spawn-projectile vehicle-grenade a1-1 this *default-dead-pool*) ) (let ((a1-2 (new 'stack-no-clear 'traffic-danger-info))) - (set! (-> a1-2 sphere quad) (-> obj root trans quad)) + (set! (-> a1-2 sphere quad) (-> this root trans quad)) (set! (-> a1-2 sphere r) 40960.0) (set! (-> a1-2 velocity quad) (-> s5-0 initial-velocity quad)) (set! (-> a1-2 notify-radius) 122880.0) @@ -929,22 +930,22 @@ (set! (-> a1-2 flags) (traffic-danger-flags tdf0)) (set! (-> a1-2 danger-type) (traffic-danger-type tdt6)) (set! (-> a1-2 handle) (the-as handle #f)) - (add-danger (-> obj controller traffic) a1-2) + (add-danger (-> this controller traffic) a1-2) ) ) ) ) (else (let ((s5-1 (new 'stack-no-clear 'turret-unknown-stack-structure2))) - (set! (-> s5-1 mat-1 quad 0) (-> obj root trans quad)) + (set! (-> s5-1 mat-1 quad 0) (-> this root trans quad)) (vector-! (-> s5-1 mat-1 vector 1) arg0 (the-as vector (-> s5-1 mat-1))) (vector-normalize! (-> s5-1 mat-1 vector 1) 1.0) - (set! (-> s5-1 proj-params ent) (-> obj entity)) + (set! (-> s5-1 proj-params ent) (-> this entity)) (set! (-> s5-1 proj-params charge) 1.0) (set! (-> s5-1 proj-params options) (projectile-options)) - (set! (-> s5-1 proj-params notify-handle) (process->handle obj)) + (set! (-> s5-1 proj-params notify-handle) (process->handle this)) (set! (-> s5-1 proj-params owner-handle) (the-as handle #f)) - (set! (-> s5-1 proj-params ignore-handle) (process->handle obj)) + (set! (-> s5-1 proj-params ignore-handle) (process->handle this)) (let* ((v1-38 *game-info*) (a0-36 (+ (-> v1-38 attack-id) 1)) ) @@ -954,7 +955,7 @@ (set! (-> s5-1 proj-params timeout) (seconds 4)) (vector+float*! (-> s5-1 proj-params pos) (the-as vector (-> s5-1 mat-1)) (-> s5-1 mat-1 vector 1) 16384.0) (vector-float*! (-> s5-1 proj-params vel) (-> s5-1 mat-1 vector 1) 819200.0) - (spawn-projectile guard-shot (-> s5-1 proj-params) obj *default-dead-pool*) + (spawn-projectile guard-shot (-> s5-1 proj-params) this *default-dead-pool*) ) ) ) @@ -964,97 +965,101 @@ ;; definition for method 134 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-134 vehicle-guard ((obj vehicle-guard) (arg0 process)) +(defmethod vehicle-method-134 vehicle-guard ((this vehicle-guard) (arg0 process)) "Stubbed" - (set! (-> obj pursuit-target) (process->handle arg0)) - (logior! (-> obj flags) (rigid-body-object-flag alert)) - (vehicle-method-111 obj 2 (the-as target arg0)) + (set! (-> this pursuit-target) (process->handle arg0)) + (logior! (-> this flags) (rigid-body-object-flag alert)) + (vehicle-method-111 this 2 (the-as target arg0)) 0 (none) ) ;; definition for method 46 of type vehicle-guard ;; WARN: disable def twice: 112. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod rigid-body-object-method-46 vehicle-guard ((obj vehicle-guard) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 vehicle-guard ((this vehicle-guard) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('impact-impulse) (let ((s5-1 (the-as matrix (-> arg3 param 0)))) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (when (not (logtest? (-> this flags) (rigid-body-object-flag player-driving))) (let ((a1-2 (find-offending-process-focusable arg0 (the-as attack-info #f)))) (when a1-2 (cond - ((logtest? (rigid-body-object-flag in-pursuit) (-> obj flags)) - (if (= (handle->process (-> obj pursuit-target)) a1-2) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag rammed-target) (-> obj flags))) + ((logtest? (rigid-body-object-flag in-pursuit) (-> this flags)) + (if (= (handle->process (-> this pursuit-target)) a1-2) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag rammed-target) (-> this flags))) ) ) ) (else - (if (and (< (* 49152.0 (-> obj info info mass)) (-> s5-1 trans x)) + (if (and (< (* 49152.0 (-> this info info mass)) (-> s5-1 trans x)) (logtest? (-> a1-2 mask) (process-mask target)) ) - (vehicle-method-134 obj a1-2) + (vehicle-method-134 this a1-2) ) ) ) ) ) ) - (rigid-body-object-method-42 obj) - (rigid-body-object-method-45 obj (the-as rigid-body-impact s5-1)) + (rigid-body-object-method-42 this) + (rigid-body-object-method-45 this (the-as rigid-body-impact s5-1)) ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (go (method-of-object obj waiting)) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (go (method-of-object this waiting)) ) ) (('track) - (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (not (logtest? (-> this flags) (rigid-body-object-flag player-driving))) ) (('alert-begin) - (when (and (not (focus-test? obj dead)) - (not (logtest? (rigid-body-object-flag alert) (-> obj flags))) - (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) - (>= (the-as uint (get-alert-level (-> obj controller traffic))) (the-as uint 2)) + (when (and (not (focus-test? this dead)) + (not (logtest? (rigid-body-object-flag alert) (-> this flags))) + (logtest? (rigid-body-object-flag ai-driving) (-> this flags)) + (>= (the-as uint (get-alert-level (-> this controller traffic))) (the-as uint 2)) ) - (logior! (-> obj flags) (rigid-body-object-flag alert)) + (logior! (-> this flags) (rigid-body-object-flag alert)) (let ((v0-4 (the-as object (process->handle (the-as process (-> arg3 param 0)))))) - (set! (-> obj pursuit-target) (the-as handle v0-4)) + (set! (-> this pursuit-target) (the-as handle v0-4)) v0-4 ) ) ) (('alert-end) - (when (not (focus-test? obj dead)) - (when (logtest? (rigid-body-object-flag alert) (-> obj flags)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag persistent alert in-pursuit))) + (when (not (focus-test? this dead)) + (when (logtest? (rigid-body-object-flag alert) (-> this flags)) + (set! (-> this flags) (the-as + rigid-body-object-flag + (logclear (-> this flags) (rigid-body-object-flag persistent alert in-pursuit)) + ) ) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-5)) - (vehicle-method-109 obj) - (go (method-of-object obj active)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-5)) + (vehicle-method-109 this) + (go (method-of-object this active)) ) ) ) (('end-pursuit) - (when (logtest? (rigid-body-object-flag alert) (-> obj flags)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag persistent alert in-pursuit))) + (when (logtest? (rigid-body-object-flag alert) (-> this flags)) + (set! (-> this flags) (the-as + rigid-body-object-flag + (logclear (-> this flags) (rigid-body-object-flag persistent alert in-pursuit)) + ) ) - (vehicle-method-109 obj) - (go (method-of-object obj active)) + (vehicle-method-109 this) + (go (method-of-object this active)) ) ) (else - ((method-of-type vehicle rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) + ((method-of-type vehicle rigid-body-object-method-46) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 137 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-137 vehicle-guard ((obj vehicle-guard) (arg0 traffic-object-spawn-params)) - (vehicle-rider-spawn obj crimson-guard-rider arg0) +(defmethod vehicle-method-137 vehicle-guard ((this vehicle-guard) (arg0 traffic-object-spawn-params)) + (vehicle-rider-spawn this crimson-guard-rider arg0) 0 (none) ) @@ -1104,79 +1109,79 @@ ;; definition for method 31 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod alloc-and-init-rigid-body-control vehicle-guard ((obj vehicle-guard) (arg0 rigid-body-vehicle-constants)) +(defmethod alloc-and-init-rigid-body-control vehicle-guard ((this vehicle-guard) (arg0 rigid-body-vehicle-constants)) (let ((t9-0 (method-of-type vehicle alloc-and-init-rigid-body-control))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (logior! (-> obj mask) (process-mask enemy guard)) - (set! (-> obj pursuit-target) (the-as handle #f)) - (set! (-> obj minimap) #f) - (set! (-> obj lod2) (the-as symbol (-> obj draw lod-set lod 2 geo))) - (set! (-> obj controller choose-branch-callback) vehicle-guard-choose-branch) + (logior! (-> this mask) (process-mask enemy guard)) + (set! (-> this pursuit-target) (the-as handle #f)) + (set! (-> this minimap) #f) + (set! (-> this lod2) (the-as symbol (-> this draw lod-set lod 2 geo))) + (set! (-> this controller choose-branch-callback) vehicle-guard-choose-branch) 0 (none) ) ;; definition for method 82 of type vehicle-guard ;; WARN: Return type mismatch traffic-guard-type-settings vs none. -(defmethod vehicle-method-82 vehicle-guard ((obj vehicle-guard)) +(defmethod vehicle-method-82 vehicle-guard ((this vehicle-guard)) (let ((t9-0 (method-of-type vehicle vehicle-method-82))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj turret guard-settings) - (get-traffic-guard-type-settings (-> obj controller traffic) (the-as int (-> obj info guard-type))) + (set! (-> this turret guard-settings) + (get-traffic-guard-type-settings (-> this controller traffic) (the-as int (-> this info guard-type))) ) (none) ) ;; definition for method 128 of type vehicle-guard -(defmethod vehicle-method-128 vehicle-guard ((obj vehicle-guard)) - (if (not (-> obj minimap)) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 14) (the-as int #f) (the-as vector #t) 0)) +(defmethod vehicle-method-128 vehicle-guard ((this vehicle-guard)) + (if (not (-> this minimap)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 14) (the-as int #f) (the-as vector #t) 0)) ) - ((method-of-type vehicle vehicle-method-128) obj) + ((method-of-type vehicle vehicle-method-128) this) (none) ) ;; definition for method 127 of type vehicle-guard -(defmethod vehicle-method-127 vehicle-guard ((obj vehicle-guard)) - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) +(defmethod vehicle-method-127 vehicle-guard ((this vehicle-guard)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) - ((method-of-type vehicle vehicle-method-127) obj) + ((method-of-type vehicle vehicle-method-127) this) (none) ) ;; definition for method 129 of type vehicle-guard -(defmethod vehicle-method-129 vehicle-guard ((obj vehicle-guard)) - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) +(defmethod vehicle-method-129 vehicle-guard ((this vehicle-guard)) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) - ((method-of-type vehicle vehicle-method-129) obj) + ((method-of-type vehicle vehicle-method-129) this) (none) ) ;; definition for method 130 of type vehicle-guard ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-130 vehicle-guard ((obj vehicle-guard) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-130 vehicle-guard ((this vehicle-guard) (arg0 traffic-object-spawn-params)) (case (-> arg0 behavior) ((9) - (vehicle-method-128 obj) - (logior! (-> obj flags) (rigid-body-object-flag persistent alert)) - (set! (-> obj pursuit-target) (-> arg0 handle)) - (go (method-of-object obj waiting-ambush)) + (vehicle-method-128 this) + (logior! (-> this flags) (rigid-body-object-flag persistent alert)) + (set! (-> this pursuit-target) (-> arg0 handle)) + (go (method-of-object this waiting-ambush)) ) (else - ((method-of-type vehicle vehicle-method-130) obj arg0) + ((method-of-type vehicle vehicle-method-130) this arg0) ) ) (none) ) ;; definition for method 157 of type vehicle-guard -(defmethod vehicle-guard-method-157 vehicle-guard ((obj vehicle-guard) (arg0 vehicle-guard-target-data)) +(defmethod vehicle-guard-method-157 vehicle-guard ((this vehicle-guard) (arg0 vehicle-guard-target-data)) (local-vars (v1-11 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1184,9 +1189,9 @@ (vf2 :class vf) ) (init-vf0-vector) - (and (logtest? (rigid-body-object-flag target-in-sight) (-> obj flags)) + (and (logtest? (rigid-body-object-flag target-in-sight) (-> this flags)) (or (and (not (logtest? (focus-status pilot) (-> arg0 target focus-status))) (< (-> arg0 dist) 184320.0)) - (and (< (-> arg0 tpos y) (+ -16384.0 (-> obj root trans y))) + (and (< (-> arg0 tpos y) (+ -16384.0 (-> this root trans y))) (begin (.lvf vf1 (&-> (-> arg0 tvel) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -1210,33 +1215,33 @@ ;; definition for method 156 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-156 vehicle-guard ((obj vehicle-guard)) +(defmethod vehicle-guard-method-156 vehicle-guard ((this vehicle-guard)) (let ((f30-0 (seconds-per-frame))) - (seek! (-> obj controls throttle) 0.0 (* 4.0 f30-0)) - (+! (-> obj controls brake) (* (- 1.0 (-> obj controls brake)) (fmin 1.0 (* 8.0 f30-0)))) - (let ((s4-0 (-> obj rbody state matrix)) - (s3-0 (-> obj rbody state matrix vector 2)) + (seek! (-> this controls throttle) 0.0 (* 4.0 f30-0)) + (+! (-> this controls brake) (* (- 1.0 (-> this controls brake)) (fmin 1.0 (* 8.0 f30-0)))) + (let ((s4-0 (-> this rbody state matrix)) + (s3-0 (-> this rbody state matrix vector 2)) (s5-0 (new 'stack-no-clear 'vector)) ) (vector-reset! s5-0) - (let ((v1-9 (handle->process (-> obj pursuit-target))) + (let ((v1-9 (handle->process (-> this pursuit-target))) (f28-0 0.0) ) - (when (and v1-9 (logtest? (rigid-body-object-flag target-in-sight) (-> obj flags))) - (vector-! s5-0 (-> (the-as process-drawable v1-9) root trans) (-> obj root trans)) + (when (and v1-9 (logtest? (rigid-body-object-flag target-in-sight) (-> this flags))) + (vector-! s5-0 (-> (the-as process-drawable v1-9) root trans) (-> this root trans)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) (if (< (vector-dot s3-0 s5-0) (cos 2730.6667)) (set! f28-0 (vector-dot (the-as vector s4-0) s5-0)) ) ) - (+! (-> obj controls steering) (* (- f28-0 (-> obj controls steering)) (fmin 1.0 (* 8.0 f30-0)))) + (+! (-> this controls steering) (* (- f28-0 (-> this controls steering)) (fmin 1.0 (* 8.0 f30-0)))) ) ) ) - (when (zero? (-> obj flight-level-index)) - (if (logtest? (-> obj flags) (rigid-body-object-flag riding)) - (vehicle-method-80 obj) + (when (zero? (-> this flight-level-index)) + (if (logtest? (-> this flags) (rigid-body-object-flag riding)) + (vehicle-method-80 this) ) ) 0 @@ -1245,27 +1250,27 @@ ;; definition for method 154 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-154 vehicle-guard ((obj vehicle-guard)) - (if (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) - (rigid-body-object-method-38 obj) +(defmethod vehicle-guard-method-154 vehicle-guard ((this vehicle-guard)) + (if (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) + (rigid-body-object-method-38 this) ) - (set! (-> obj camera-dist2) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (vehicle-controller-method-18 - (-> obj controller) - (-> obj target-acceleration) - (-> obj root transv) - obj + (-> this controller) + (-> this target-acceleration) + (-> this root transv) + this (/ 1.0 (seconds-per-frame)) ) - ((-> obj ai-hook) obj) - (vehicle-method-121 obj) - (vehicle-method-106 obj) - (when (not (logtest? (rigid-body-object-flag in-pursuit) (-> obj flags))) - (if (not (logtest? (-> obj target-flags) (turret-flag aiming))) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-2)) + ((-> this ai-hook) this) + (vehicle-method-121 this) + (vehicle-method-106 this) + (when (not (logtest? (rigid-body-object-flag in-pursuit) (-> this flags))) + (if (not (logtest? (-> this target-flags) (turret-flag aiming))) + (speech-control-method-12 *speech-control* this (speech-type speech-type-2)) ) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) 0 (none) @@ -1273,31 +1278,31 @@ ;; definition for method 158 of type vehicle-guard ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-guard-method-158 vehicle-guard ((obj vehicle-guard)) - (vehicle-guard-method-150 obj) +(defmethod vehicle-guard-method-158 vehicle-guard ((this vehicle-guard)) + (vehicle-guard-method-150 this) (let ((s5-0 (new 'stack-no-clear 'vehicle-guard-target-data))) - (vehicle-guard-method-151 obj s5-0) + (vehicle-guard-method-151 this s5-0) (let ((a1-1 (-> s5-0 target))) (when a1-1 (cond - ((logtest? (rigid-body-object-flag target-in-sight) (-> obj flags)) - (vehicle-guard-method-153 obj a1-1) - (speech-control-method-15 *speech-control* obj) + ((logtest? (rigid-body-object-flag target-in-sight) (-> this flags)) + (vehicle-guard-method-153 this a1-1) + (speech-control-method-15 *speech-control* this) ) (else - (if (and (>= (- (current-time) (-> obj target-in-sight-time)) (seconds 4)) (< 368640.0 (-> s5-0 dist))) - (vehicle-method-109 obj) + (if (and (time-elapsed? (-> this target-in-sight-time) (seconds 4)) (< 368640.0 (-> s5-0 dist))) + (vehicle-method-109 this) ) ) ) ) ) ) - (if (not (logtest? (rigid-body-object-flag in-pursuit) (-> obj flags))) - (go (method-of-object obj active)) + (if (not (logtest? (rigid-body-object-flag in-pursuit) (-> this flags))) + (go (method-of-object this active)) ) - (rigid-body-object-method-42 obj) - (vehicle-method-122 obj) + (rigid-body-object-method-42 this) + (vehicle-method-122 this) 0 (none) ) @@ -1305,7 +1310,7 @@ ;; definition for method 94 of type vehicle-guard ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-94 vehicle-guard ((obj vehicle-guard)) +(defmethod vehicle-method-94 vehicle-guard ((this vehicle-guard)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1316,7 +1321,7 @@ (init-vf0-vector) (let ((v1-0 (new 'stack-no-clear 'camera-free-floating-move-info))) (let* ((a0-1 (-> v1-0 tm)) - (t0-0 (-> obj rbody state matrix)) + (t0-0 (-> this rbody state matrix)) (a1-1 (-> t0-0 quad 0)) (a2-0 (-> t0-0 quad 1)) (a3-0 (-> t0-0 quad 2)) @@ -1328,7 +1333,7 @@ (set! (-> a0-1 trans quad) t0-1) ) (let ((a0-2 (-> v1-0 rv))) - (let ((a1-3 (-> obj rbody state position))) + (let ((a1-3 (-> this rbody state position))) (let ((a2-1 (-> v1-0 tm vector 2))) (let ((a3-2 163840.0)) (.mov vf7 a3-2) @@ -1343,17 +1348,17 @@ (.svf (&-> a0-2 quad) vf6) ) (vector-reset! (-> v1-0 up)) - (set! (-> obj turret inaccuracy) 0.0) - (turret-control-method-9 (-> obj turret) obj (-> v1-0 rv) (-> v1-0 up)) + (set! (-> this turret inaccuracy) 0.0) + (turret-control-method-9 (-> this turret) this (-> v1-0 rv) (-> v1-0 up)) ) (when (cpad-hold? 0 r1) - (when (>= (- (current-time) (-> obj turret shoot-time)) (seconds 0.35)) - (set! (-> obj turret owner-handle) (process->handle *target*)) - (turret-control-method-17 (-> obj turret) obj) - (set! (-> obj turret owner-handle) (the-as handle #f)) + (when (time-elapsed? (-> this turret shoot-time) (seconds 0.35)) + (set! (-> this turret owner-handle) (process->handle *target*)) + (turret-control-method-17 (-> this turret) this) + (set! (-> this turret owner-handle) (the-as handle #f)) ) ) - ((method-of-type vehicle vehicle-method-94) obj) + ((method-of-type vehicle vehicle-method-94) this) 0 (none) ) @@ -1395,9 +1400,9 @@ (go-virtual hostile) ) (speech-control-method-12 *speech-control* self (speech-type speech-type-4)) - (if (or (>= (- (current-time) (-> self state-time)) (seconds 8)) (let ((f0-0 409600.0)) - (< (* f0-0 f0-0) (-> self player-dist2)) - ) + (if (or (time-elapsed? (-> self state-time) (seconds 8)) (let ((f0-0 409600.0)) + (< (* f0-0 f0-0) (-> self player-dist2)) + ) ) (logclear! (-> self flags) (rigid-body-object-flag persistent alert)) ) @@ -1423,9 +1428,9 @@ :post (behavior () (vehicle-guard-method-150 self) (when (logtest? (rigid-body-object-flag in-pursuit) (-> self flags)) - (if (or (>= (- (current-time) (-> self target-in-sight-time)) (seconds 8)) + (if (or (time-elapsed? (-> self target-in-sight-time) (seconds 8)) (and (>= (-> self controller traffic alert-state guards-in-sight-of-target) 2) - (>= (- (current-time) (-> self target-in-sight-time)) (seconds 0.5)) + (time-elapsed? (-> self target-in-sight-time) (seconds 0.5)) ) ) (vehicle-method-109 self) @@ -1493,7 +1498,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self ai-hook) (method-of-object self vehicle-guard-method-156)) ) :trans #f @@ -1506,7 +1511,7 @@ (when gp-0 (when (or (< (-> s5-0 attack-range) (-> s5-0 dist)) (not (logtest? (rigid-body-object-flag target-in-sight) (-> self flags))) - (>= (- (current-time) (-> self state-time)) (seconds 2)) + (time-elapsed? (-> self state-time) (seconds 2)) ) (set! (-> self flags) (the-as rigid-body-object-flag (logclear (-> self flags) (rigid-body-object-flag rammed-target))) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc index 2d69b7b11d..787fdd0810 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-h_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type vehicle-lookup-info -(defmethod inspect vehicle-lookup-info ((obj vehicle-lookup-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-lookup-info ((this vehicle-lookup-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-lookup-info) - (format #t "~1Tturn-radius: (meters ~m)~%" (-> obj turn-radius)) - (format #t "~1Tthrottle-turning: ~f~%" (-> obj throttle-turning)) - (format #t "~1Tthrottle-straight: ~f~%" (-> obj throttle-straight)) + (format #t "[~8x] ~A~%" this 'vehicle-lookup-info) + (format #t "~1Tturn-radius: (meters ~m)~%" (-> this turn-radius)) + (format #t "~1Tthrottle-turning: ~f~%" (-> this throttle-turning)) + (format #t "~1Tthrottle-straight: ~f~%" (-> this throttle-straight)) (label cfg-4) - obj + this ) ;; definition of type vehicle-control-point @@ -37,16 +37,16 @@ ) ;; definition for method 3 of type vehicle-control-point -(defmethod inspect vehicle-control-point ((obj vehicle-control-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-control-point ((this vehicle-control-point)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-control-point) - (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~1Tnormal: #~%" (-> obj normal)) + (format #t "[~8x] ~A~%" this 'vehicle-control-point) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tnormal: #~%" (-> this normal)) (label cfg-4) - obj + this ) ;; definition of type vehicle-section-info @@ -60,16 +60,16 @@ ) ;; definition for method 3 of type vehicle-section-info -(defmethod inspect vehicle-section-info ((obj vehicle-section-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-section-info ((this vehicle-section-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-section-info) - (format #t "~1Tdamage-seg-array[3] @ #x~X~%" (-> obj damage-seg-array)) - (format #t "~1Tdamage-seg-count: ~D~%" (-> obj damage-seg-count)) + (format #t "[~8x] ~A~%" this 'vehicle-section-info) + (format #t "~1Tdamage-seg-array[3] @ #x~X~%" (-> this damage-seg-array)) + (format #t "~1Tdamage-seg-count: ~D~%" (-> this damage-seg-count)) (label cfg-4) - obj + this ) ;; definition of type vehicle-seat-info @@ -88,21 +88,21 @@ ) ;; definition for method 3 of type vehicle-seat-info -(defmethod inspect vehicle-seat-info ((obj vehicle-seat-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-seat-info ((this vehicle-seat-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-seat-info) - (format #t "~1Tdata[16] @ #x~X~%" (-> obj position)) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tpos-x: ~f~%" (-> obj position x)) - (format #t "~1Tpos-y: ~f~%" (-> obj position y)) - (format #t "~1Tpos-z: ~f~%" (-> obj position z)) - (format #t "~1Tangle: ~D~%" (-> obj angle)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "[~8x] ~A~%" this 'vehicle-seat-info) + (format #t "~1Tdata[16] @ #x~X~%" (-> this position)) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tpos-x: ~f~%" (-> this position x)) + (format #t "~1Tpos-y: ~f~%" (-> this position y)) + (format #t "~1Tpos-z: ~f~%" (-> this position z)) + (format #t "~1Tangle: ~D~%" (-> this angle)) + (format #t "~1Tflags: ~D~%" (-> this flags)) (label cfg-4) - obj + this ) ;; definition of type vehicle-explosion-info @@ -117,20 +117,20 @@ ) ;; definition for method 3 of type vehicle-explosion-info -(defmethod inspect vehicle-explosion-info ((obj vehicle-explosion-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-explosion-info ((this vehicle-explosion-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tjoints: ~A~%" (-> obj joints)) - (format #t "~1Tcollide-spec: ~D~%" (-> obj collide-spec)) - (format #t "~1Tart-level: ~A~%" (-> obj art-level)) - (format #t "~1Tskel: ~A~%" (-> obj skel)) - (format #t "~1Tskel-name: ~A~%" (-> obj skel-name)) - (format #t "~1Tanim: ~D~%" (-> obj anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tjoints: ~A~%" (-> this joints)) + (format #t "~1Tcollide-spec: ~D~%" (-> this collide-spec)) + (format #t "~1Tart-level: ~A~%" (-> this art-level)) + (format #t "~1Tskel: ~A~%" (-> this skel)) + (format #t "~1Tskel-name: ~A~%" (-> this skel-name)) + (format #t "~1Tanim: ~D~%" (-> this anim)) (label cfg-4) - obj + this ) ;; definition of type vehicle-grab-rail-info @@ -144,16 +144,16 @@ ) ;; definition for method 3 of type vehicle-grab-rail-info -(defmethod inspect vehicle-grab-rail-info ((obj vehicle-grab-rail-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-grab-rail-info ((this vehicle-grab-rail-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-grab-rail-info) - (format #t "~1Tlocal-pos[2] @ #x~X~%" (-> obj local-pos)) - (format #t "~1Tnormal: #~%" (-> obj normal)) + (format #t "[~8x] ~A~%" this 'vehicle-grab-rail-info) + (format #t "~1Tlocal-pos[2] @ #x~X~%" (-> this local-pos)) + (format #t "~1Tnormal: #~%" (-> this normal)) (label cfg-4) - obj + this ) ;; definition of type rigid-body-vehicle-constants @@ -286,148 +286,148 @@ ;; definition for method 3 of type rigid-body-vehicle-constants ;; INFO: Used lq/sq -(defmethod inspect rigid-body-vehicle-constants ((obj rigid-body-vehicle-constants)) - (when (not obj) - (set! obj obj) +(defmethod inspect rigid-body-vehicle-constants ((this rigid-body-vehicle-constants)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rigid-body-vehicle-constants) - (format #t "~1Tinfo: #~%" (-> obj info)) - (format #t "~1Tmass: ~f~%" (-> obj info mass)) - (format #t "~1Tinv-mass: ~f~%" (-> obj info inv-mass)) - (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> obj info cm-offset-joint x)) - (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> obj info cm-offset-joint y)) - (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> obj info cm-offset-joint z)) - (format #t "~1Tlinear-damping: ~f~%" (-> obj info linear-damping)) - (format #t "~1Tangular-damping: ~f~%" (-> obj info angular-damping)) - (format #t "~1Tbounce-factor: ~f~%" (-> obj info bounce-factor)) - (format #t "~1Tfriction-factor: ~f~%" (-> obj info friction-factor)) - (format #t "~1Tinertial-tensor-x: (meters ~m)~%" (-> obj inertial-tensor-x)) - (format #t "~1Tinertial-tensor-y: (meters ~m)~%" (-> obj inertial-tensor-y)) - (format #t "~1Tinertial-tensor-z: (meters ~m)~%" (-> obj inertial-tensor-z)) - (format #t "~1Textra: #~%" (-> obj extra)) - (format #t "~1Tmax-time-step: ~f~%" (-> obj extra max-time-step)) - (format #t "~1Tgravity: (meters ~m)~%" (-> obj extra gravity)) - (format #t "~1Tidle-distance: (meters ~m)~%" (-> obj extra idle-distance)) - (format #t "~1Tattack-force-scale: ~f~%" (-> obj extra attack-force-scale)) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tobject-type: ~D~%" (-> obj object-type)) - (format #t "~1Tguard-type: ~D~%" (-> obj guard-type)) - (format #t "~1Tmax-engine-thrust: (meters ~m)~%" (-> obj max-engine-thrust)) - (format #t "~1Tinv-max-engine-thrust: ~f~%" (-> obj inv-max-engine-thrust)) - (format #t "~1Tengine-response-rate: ~f~%" (-> obj engine-response-rate)) - (format #t "~1Tengine-intake-factor: ~f~%" (-> obj engine-intake-factor)) - (format #t "~1Tbrake-factor: ~f~%" (-> obj brake-factor)) - (format #t "~1Tturbo-boost-factor: ~f~%" (-> obj turbo-boost-factor)) - (format #t "~1Tmax-xz-speed: (meters ~m)~%" (-> obj max-xz-speed)) - (format #t "~1Tground-probe-distance: (meters ~m)~%" (-> obj ground-probe-distance)) - (format #t "~1Tground-probe-offset: (meters ~m)~%" (-> obj ground-probe-offset)) - (format #t "~1Tcos-ground-effect-angle: ~f~%" (-> obj cos-ground-effect-angle)) - (format #t "~1Tspring-lift-factor: ~f~%" (-> obj spring-lift-factor)) - (format #t "~1Tair-steering-factor: ~f~%" (-> obj air-steering-factor)) - (format #t "~1Tair-drag-factor: ~f~%" (-> obj air-drag-factor)) - (format #t "~1Tsteering-fin-angle: ~f~%" (-> obj steering-fin-angle)) - (format #t "~1Tsteering-thruster-factor: ~f~%" (-> obj steering-thruster-factor)) - (format #t "~1Tsteering-thruster-max-gain: ~f~%" (-> obj steering-thruster-max-gain)) - (format #t "~1Tsteering-thruster-half-gain-speed: (meters ~m)~%" (-> obj steering-thruster-half-gain-speed)) - (format #t "~1Ttire-steering-angle: ~f~%" (-> obj tire-steering-angle)) - (format #t "~1Ttire-friction-factor: ~f~%" (-> obj tire-friction-factor)) - (format #t "~1Ttire-static-friction: ~f~%" (-> obj tire-static-friction)) - (format #t "~1Ttire-static-friction-speed: (meters ~m)~%" (-> obj tire-static-friction-speed)) - (format #t "~1Ttire-dynamic-friction: ~f~%" (-> obj tire-dynamic-friction)) - (format #t "~1Ttire-dynamic-friction-speed: (meters ~m)~%" (-> obj tire-dynamic-friction-speed)) - (format #t "~1Ttire-inv-max-friction-speed: ~f~%" (-> obj tire-inv-max-friction-speed)) - (format #t "~1Tairfoil-factor: ~f~%" (-> obj airfoil-factor)) - (format #t "~1Tdrag-force-factor: ~f~%" (-> obj drag-force-factor)) - (format #t "~1Tspeed-scrubbing-drag: ~f~%" (-> obj speed-scrubbing-drag)) - (format #t "~1Tspeed-limiting-drag: ~f~%" (-> obj speed-limiting-drag)) - (format #t "~1Tpitch-control-factor: ~f~%" (-> obj pitch-control-factor)) - (format #t "~1Troll-control-factor: ~f~%" (-> obj roll-control-factor)) - (format #t "~1Troll-angle: ~f~%" (-> obj roll-angle)) - (format #t "~1Tjump-thrust-factor: ~f~%" (-> obj jump-thrust-factor)) - (format #t "~1Tbuoyancy-factor: ~f~%" (-> obj buoyancy-factor)) - (format #t "~1Tplayer-weight: ~f~%" (-> obj player-weight)) - (format #t "~1Tplayer-shift-x: (meters ~m)~%" (-> obj player-shift-x)) - (format #t "~1Tplayer-shift-z: (meters ~m)~%" (-> obj player-shift-z)) - (format #t "~1Ttarget-speed-offset: (meters ~m)~%" (-> obj target-speed-offset)) - (format #t "~1Tturning-accel: (meters ~m)~%" (-> obj turning-accel)) - (format #t "~1Ttoughness-factor: ~f~%" (-> obj toughness-factor)) - (format #t "~1Tdamage-factor: ~f~%" (-> obj damage-factor)) - (format #t "~1Tcamera-string-min-height: (meters ~m)~%" (-> obj camera-string-min-height)) - (format #t "~1Tcamera-string-max-height: (meters ~m)~%" (-> obj camera-string-max-height)) - (format #t "~1Tcamera-string-min-length: (meters ~m)~%" (-> obj camera-string-min-length)) - (format #t "~1Tcamera-string-max-length: (meters ~m)~%" (-> obj camera-string-max-length)) - (format #t "~1Tcamera-min-fov: ~f~%" (-> obj camera-min-fov)) - (format #t "~1Tcamera-max-fov: ~f~%" (-> obj camera-max-fov)) - (format #t "~1Tcamera-head-offset: ~f~%" (-> obj camera-head-offset)) - (format #t "~1Tcamera-foot-offset: ~f~%" (-> obj camera-foot-offset)) - (format #t "~1Tcamera-normal-max-angle-offset: ~f~%" (-> obj camera-normal-max-angle-offset)) - (format #t "~1Tcamera-air-max-angle-offset: ~f~%" (-> obj camera-air-max-angle-offset)) - (format #t "~1Tcamera-max-lookaround-speed: ~f~%" (-> obj camera-max-lookaround-speed)) - (format #t "~1Tseat-count: ~D~%" (-> obj seat-count)) - (format #t "~1Tsection-count: ~D~%" (-> obj section-count)) - (format #t "~1Trider-stance: ~D~%" (-> obj rider-stance)) - (format #t "~1Tgrab-rail-count: ~D~%" (-> obj grab-rail-count)) - (format #t "~1Tgrab-rail-array: #x~X~%" (-> obj grab-rail-array)) - (format #t "~1Tseat-array[4] @ #x~X~%" (-> obj seat-array)) - (format #t "~1Trider-hand-offset[2] @ #x~X~%" (-> obj rider-hand-offset)) - (format #t "~1Tsection-array[4] @ #x~X~%" (-> obj section-bike-front)) - (format #t "~1Tsection-bike-front: #~%" (-> obj section-bike-front)) - (format #t "~1Tsection-bike-rear: #~%" (-> obj section-bike-rear)) - (format #t "~1Tsection-car-front-left: #~%" (-> obj section-bike-front)) - (format #t "~1Tsection-car-rear-left: #~%" (-> obj section-bike-rear)) - (format #t "~1Tsection-car-front-right: #~%" (-> obj section-car-front-right)) - (format #t "~1Tsection-car-rear-right: #~%" (-> obj section-car-rear-right)) - (format #t "~1Texplosion: ~A~%" (-> obj explosion)) - (format #t "~1Tengine-pitch-scale: ~f~%" (-> obj engine-pitch-scale)) - (format #t "~1Tengine-pitch-offset: ~f~%" (-> obj engine-pitch-offset)) - (format #t "~1Tengine-pitch-mod-amp: ~f~%" (-> obj engine-pitch-mod-amp)) - (format #t "~1Tengine-sound-select: ~D~%" (-> obj engine-sound-select)) - (format #t "~1Tengine-sound: ~D~%" (-> obj engine-sound)) - (format #t "~1Tthrust-sound: ~D~%" (-> obj thrust-sound)) - (format #t "~1Tscrape-sound: ~D~%" (-> obj scrape-sound)) - (format #t "~1Tglance-sound: ~D~%" (-> obj glance-sound)) - (format #t "~1Timpact-sound: ~D~%" (-> obj impact-sound)) - (format #t "~1Textra-sound: ~D~%" (-> obj extra-sound)) - (format #t "~1Texplosion-part: ~D~%" (-> obj explosion-part)) - (format #t "~1Theadlight-count: ~D~%" (-> obj headlight-count)) - (format #t "~1Ttaillight-count: ~D~%" (-> obj taillight-count)) - (format #t "~1Tthruster-flame-width: (meters ~m)~%" (-> obj thruster-flame-width)) - (format #t "~1Tthruster-flame-length: (meters ~m)~%" (-> obj thruster-flame-length)) - (format #t "~1Tthruster-local-pos[2] @ #x~X~%" (-> obj thruster-local-pos)) - (format #t "~1Texhaust-local-pos[2] @ #x~X~%" (-> obj exhaust-local-pos)) - (format #t "~1Texhaust-local-dir[2] @ #x~X~%" (-> obj exhaust-local-dir)) - (format #t "~1Tsmoke-local-pos[2] @ #x~X~%" (-> obj smoke-local-pos)) - (format #t "~1Tsmoke-local-vel[2] @ #x~X~%" (-> obj smoke-local-vel)) - (format #t "~1Theadlight-local-pos[3] @ #x~X~%" (-> obj headlight-local-pos)) - (format #t "~1Ttaillight-local-pos[2] @ #x~X~%" (-> obj taillight-local-pos)) - (format #t "~1Tlift-thruster-count: ~D~%" (-> obj lift-thruster-count)) - (format #t "~1Troll-thruster-count: ~D~%" (-> obj roll-thruster-count)) - (format #t "~1Tsteering-thruster-count: ~D~%" (-> obj steering-thruster-count)) - (format #t "~1Tstabilizer-count: ~D~%" (-> obj stabilizer-count)) - (format #t "~1Tinv-lift-thruster-count: ~f~%" (-> obj inv-lift-thruster-count)) - (format #t "~1Tlift-thruster-array[2] @ #x~X~%" (-> obj lift-thruster-array)) - (format #t "~1Troll-thruster-array[2] @ #x~X~%" (-> obj roll-thruster-array)) - (format #t "~1Tsteering-thruster-array[2] @ #x~X~%" (-> obj steering-thruster-array)) - (format #t "~1Tstabilizer-array[6] @ #x~X~%" (-> obj stabilizer-array)) - (format #t "~1Tengine-thrust-local-pos: #~%" (-> obj engine-thrust-local-pos)) - (format #t "~1Tbrake-local-pos: #~%" (-> obj brake-local-pos)) - (format #t "~1Tparticle-system-2d: ~A~%" (-> obj particle-system-2d)) - (format #t "~1Tparticle-system-3d: ~A~%" (-> obj particle-system-3d)) - (format #t "~1Tpart-thruster: ~A~%" (-> obj part-thruster)) - (format #t "~1Tpart-thruster-scale-x: #~%" (-> obj part-thruster-scale-x)) - (format #t "~1Tpart-thruster-scale-y: #~%" (-> obj part-thruster-scale-y)) - (format #t "~1Tpart-quat: #~%" (-> obj part-quat)) - (format #t "~1Tpart-vel: #~%" (-> obj part-vel)) - (format #t "~1Tcolor-option-count: ~D~%" (-> obj color-option-count)) - (format #t "~1Tcolor-option-select: ~D~%" (-> obj color-option-select)) - (format #t "~1Tcolor-option-array: #x~X~%" (-> obj color-option-array)) - (format #t "~1Tsample-dir: #~%" (-> obj sample-dir)) - (format #t "~1Tsample-time: ~D~%" (-> obj sample-time)) - (format #t "~1Tsample-index: ~D~%" (-> obj sample-index)) + (format #t "[~8x] ~A~%" this 'rigid-body-vehicle-constants) + (format #t "~1Tinfo: #~%" (-> this info)) + (format #t "~1Tmass: ~f~%" (-> this info mass)) + (format #t "~1Tinv-mass: ~f~%" (-> this info inv-mass)) + (format #t "~1Tcm-joint-x: (meters ~m)~%" (-> this info cm-offset-joint x)) + (format #t "~1Tcm-joint-y: (meters ~m)~%" (-> this info cm-offset-joint y)) + (format #t "~1Tcm-joint-z: (meters ~m)~%" (-> this info cm-offset-joint z)) + (format #t "~1Tlinear-damping: ~f~%" (-> this info linear-damping)) + (format #t "~1Tangular-damping: ~f~%" (-> this info angular-damping)) + (format #t "~1Tbounce-factor: ~f~%" (-> this info bounce-factor)) + (format #t "~1Tfriction-factor: ~f~%" (-> this info friction-factor)) + (format #t "~1Tinertial-tensor-x: (meters ~m)~%" (-> this inertial-tensor-x)) + (format #t "~1Tinertial-tensor-y: (meters ~m)~%" (-> this inertial-tensor-y)) + (format #t "~1Tinertial-tensor-z: (meters ~m)~%" (-> this inertial-tensor-z)) + (format #t "~1Textra: #~%" (-> this extra)) + (format #t "~1Tmax-time-step: ~f~%" (-> this extra max-time-step)) + (format #t "~1Tgravity: (meters ~m)~%" (-> this extra gravity)) + (format #t "~1Tidle-distance: (meters ~m)~%" (-> this extra idle-distance)) + (format #t "~1Tattack-force-scale: ~f~%" (-> this extra attack-force-scale)) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tobject-type: ~D~%" (-> this object-type)) + (format #t "~1Tguard-type: ~D~%" (-> this guard-type)) + (format #t "~1Tmax-engine-thrust: (meters ~m)~%" (-> this max-engine-thrust)) + (format #t "~1Tinv-max-engine-thrust: ~f~%" (-> this inv-max-engine-thrust)) + (format #t "~1Tengine-response-rate: ~f~%" (-> this engine-response-rate)) + (format #t "~1Tengine-intake-factor: ~f~%" (-> this engine-intake-factor)) + (format #t "~1Tbrake-factor: ~f~%" (-> this brake-factor)) + (format #t "~1Tturbo-boost-factor: ~f~%" (-> this turbo-boost-factor)) + (format #t "~1Tmax-xz-speed: (meters ~m)~%" (-> this max-xz-speed)) + (format #t "~1Tground-probe-distance: (meters ~m)~%" (-> this ground-probe-distance)) + (format #t "~1Tground-probe-offset: (meters ~m)~%" (-> this ground-probe-offset)) + (format #t "~1Tcos-ground-effect-angle: ~f~%" (-> this cos-ground-effect-angle)) + (format #t "~1Tspring-lift-factor: ~f~%" (-> this spring-lift-factor)) + (format #t "~1Tair-steering-factor: ~f~%" (-> this air-steering-factor)) + (format #t "~1Tair-drag-factor: ~f~%" (-> this air-drag-factor)) + (format #t "~1Tsteering-fin-angle: ~f~%" (-> this steering-fin-angle)) + (format #t "~1Tsteering-thruster-factor: ~f~%" (-> this steering-thruster-factor)) + (format #t "~1Tsteering-thruster-max-gain: ~f~%" (-> this steering-thruster-max-gain)) + (format #t "~1Tsteering-thruster-half-gain-speed: (meters ~m)~%" (-> this steering-thruster-half-gain-speed)) + (format #t "~1Ttire-steering-angle: ~f~%" (-> this tire-steering-angle)) + (format #t "~1Ttire-friction-factor: ~f~%" (-> this tire-friction-factor)) + (format #t "~1Ttire-static-friction: ~f~%" (-> this tire-static-friction)) + (format #t "~1Ttire-static-friction-speed: (meters ~m)~%" (-> this tire-static-friction-speed)) + (format #t "~1Ttire-dynamic-friction: ~f~%" (-> this tire-dynamic-friction)) + (format #t "~1Ttire-dynamic-friction-speed: (meters ~m)~%" (-> this tire-dynamic-friction-speed)) + (format #t "~1Ttire-inv-max-friction-speed: ~f~%" (-> this tire-inv-max-friction-speed)) + (format #t "~1Tairfoil-factor: ~f~%" (-> this airfoil-factor)) + (format #t "~1Tdrag-force-factor: ~f~%" (-> this drag-force-factor)) + (format #t "~1Tspeed-scrubbing-drag: ~f~%" (-> this speed-scrubbing-drag)) + (format #t "~1Tspeed-limiting-drag: ~f~%" (-> this speed-limiting-drag)) + (format #t "~1Tpitch-control-factor: ~f~%" (-> this pitch-control-factor)) + (format #t "~1Troll-control-factor: ~f~%" (-> this roll-control-factor)) + (format #t "~1Troll-angle: ~f~%" (-> this roll-angle)) + (format #t "~1Tjump-thrust-factor: ~f~%" (-> this jump-thrust-factor)) + (format #t "~1Tbuoyancy-factor: ~f~%" (-> this buoyancy-factor)) + (format #t "~1Tplayer-weight: ~f~%" (-> this player-weight)) + (format #t "~1Tplayer-shift-x: (meters ~m)~%" (-> this player-shift-x)) + (format #t "~1Tplayer-shift-z: (meters ~m)~%" (-> this player-shift-z)) + (format #t "~1Ttarget-speed-offset: (meters ~m)~%" (-> this target-speed-offset)) + (format #t "~1Tturning-accel: (meters ~m)~%" (-> this turning-accel)) + (format #t "~1Ttoughness-factor: ~f~%" (-> this toughness-factor)) + (format #t "~1Tdamage-factor: ~f~%" (-> this damage-factor)) + (format #t "~1Tcamera-string-min-height: (meters ~m)~%" (-> this camera-string-min-height)) + (format #t "~1Tcamera-string-max-height: (meters ~m)~%" (-> this camera-string-max-height)) + (format #t "~1Tcamera-string-min-length: (meters ~m)~%" (-> this camera-string-min-length)) + (format #t "~1Tcamera-string-max-length: (meters ~m)~%" (-> this camera-string-max-length)) + (format #t "~1Tcamera-min-fov: ~f~%" (-> this camera-min-fov)) + (format #t "~1Tcamera-max-fov: ~f~%" (-> this camera-max-fov)) + (format #t "~1Tcamera-head-offset: ~f~%" (-> this camera-head-offset)) + (format #t "~1Tcamera-foot-offset: ~f~%" (-> this camera-foot-offset)) + (format #t "~1Tcamera-normal-max-angle-offset: ~f~%" (-> this camera-normal-max-angle-offset)) + (format #t "~1Tcamera-air-max-angle-offset: ~f~%" (-> this camera-air-max-angle-offset)) + (format #t "~1Tcamera-max-lookaround-speed: ~f~%" (-> this camera-max-lookaround-speed)) + (format #t "~1Tseat-count: ~D~%" (-> this seat-count)) + (format #t "~1Tsection-count: ~D~%" (-> this section-count)) + (format #t "~1Trider-stance: ~D~%" (-> this rider-stance)) + (format #t "~1Tgrab-rail-count: ~D~%" (-> this grab-rail-count)) + (format #t "~1Tgrab-rail-array: #x~X~%" (-> this grab-rail-array)) + (format #t "~1Tseat-array[4] @ #x~X~%" (-> this seat-array)) + (format #t "~1Trider-hand-offset[2] @ #x~X~%" (-> this rider-hand-offset)) + (format #t "~1Tsection-array[4] @ #x~X~%" (-> this section-bike-front)) + (format #t "~1Tsection-bike-front: #~%" (-> this section-bike-front)) + (format #t "~1Tsection-bike-rear: #~%" (-> this section-bike-rear)) + (format #t "~1Tsection-car-front-left: #~%" (-> this section-bike-front)) + (format #t "~1Tsection-car-rear-left: #~%" (-> this section-bike-rear)) + (format #t "~1Tsection-car-front-right: #~%" (-> this section-car-front-right)) + (format #t "~1Tsection-car-rear-right: #~%" (-> this section-car-rear-right)) + (format #t "~1Texplosion: ~A~%" (-> this explosion)) + (format #t "~1Tengine-pitch-scale: ~f~%" (-> this engine-pitch-scale)) + (format #t "~1Tengine-pitch-offset: ~f~%" (-> this engine-pitch-offset)) + (format #t "~1Tengine-pitch-mod-amp: ~f~%" (-> this engine-pitch-mod-amp)) + (format #t "~1Tengine-sound-select: ~D~%" (-> this engine-sound-select)) + (format #t "~1Tengine-sound: ~D~%" (-> this engine-sound)) + (format #t "~1Tthrust-sound: ~D~%" (-> this thrust-sound)) + (format #t "~1Tscrape-sound: ~D~%" (-> this scrape-sound)) + (format #t "~1Tglance-sound: ~D~%" (-> this glance-sound)) + (format #t "~1Timpact-sound: ~D~%" (-> this impact-sound)) + (format #t "~1Textra-sound: ~D~%" (-> this extra-sound)) + (format #t "~1Texplosion-part: ~D~%" (-> this explosion-part)) + (format #t "~1Theadlight-count: ~D~%" (-> this headlight-count)) + (format #t "~1Ttaillight-count: ~D~%" (-> this taillight-count)) + (format #t "~1Tthruster-flame-width: (meters ~m)~%" (-> this thruster-flame-width)) + (format #t "~1Tthruster-flame-length: (meters ~m)~%" (-> this thruster-flame-length)) + (format #t "~1Tthruster-local-pos[2] @ #x~X~%" (-> this thruster-local-pos)) + (format #t "~1Texhaust-local-pos[2] @ #x~X~%" (-> this exhaust-local-pos)) + (format #t "~1Texhaust-local-dir[2] @ #x~X~%" (-> this exhaust-local-dir)) + (format #t "~1Tsmoke-local-pos[2] @ #x~X~%" (-> this smoke-local-pos)) + (format #t "~1Tsmoke-local-vel[2] @ #x~X~%" (-> this smoke-local-vel)) + (format #t "~1Theadlight-local-pos[3] @ #x~X~%" (-> this headlight-local-pos)) + (format #t "~1Ttaillight-local-pos[2] @ #x~X~%" (-> this taillight-local-pos)) + (format #t "~1Tlift-thruster-count: ~D~%" (-> this lift-thruster-count)) + (format #t "~1Troll-thruster-count: ~D~%" (-> this roll-thruster-count)) + (format #t "~1Tsteering-thruster-count: ~D~%" (-> this steering-thruster-count)) + (format #t "~1Tstabilizer-count: ~D~%" (-> this stabilizer-count)) + (format #t "~1Tinv-lift-thruster-count: ~f~%" (-> this inv-lift-thruster-count)) + (format #t "~1Tlift-thruster-array[2] @ #x~X~%" (-> this lift-thruster-array)) + (format #t "~1Troll-thruster-array[2] @ #x~X~%" (-> this roll-thruster-array)) + (format #t "~1Tsteering-thruster-array[2] @ #x~X~%" (-> this steering-thruster-array)) + (format #t "~1Tstabilizer-array[6] @ #x~X~%" (-> this stabilizer-array)) + (format #t "~1Tengine-thrust-local-pos: #~%" (-> this engine-thrust-local-pos)) + (format #t "~1Tbrake-local-pos: #~%" (-> this brake-local-pos)) + (format #t "~1Tparticle-system-2d: ~A~%" (-> this particle-system-2d)) + (format #t "~1Tparticle-system-3d: ~A~%" (-> this particle-system-3d)) + (format #t "~1Tpart-thruster: ~A~%" (-> this part-thruster)) + (format #t "~1Tpart-thruster-scale-x: #~%" (-> this part-thruster-scale-x)) + (format #t "~1Tpart-thruster-scale-y: #~%" (-> this part-thruster-scale-y)) + (format #t "~1Tpart-quat: #~%" (-> this part-quat)) + (format #t "~1Tpart-vel: #~%" (-> this part-vel)) + (format #t "~1Tcolor-option-count: ~D~%" (-> this color-option-count)) + (format #t "~1Tcolor-option-select: ~D~%" (-> this color-option-select)) + (format #t "~1Tcolor-option-array: #x~X~%" (-> this color-option-array)) + (format #t "~1Tsample-dir: #~%" (-> this sample-dir)) + (format #t "~1Tsample-time: ~D~%" (-> this sample-time)) + (format #t "~1Tsample-index: ~D~%" (-> this sample-index)) (label cfg-4) - obj + this ) ;; definition of type vehicle-controller @@ -470,14 +470,14 @@ ) ;; definition for method 3 of type vehicle-controller -(defmethod inspect vehicle-controller ((obj vehicle-controller)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-controller ((this vehicle-controller)) + (when (not this) + (set! this this) (goto cfg-28) ) - (format #t "[~8x] ~A~%" obj 'vehicle-controller) - (format #t "~1Tflags: #x~X : (vehicle-controller-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'vehicle-controller) + (format #t "~1Tflags: #x~X : (vehicle-controller-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (vehicle-controller-flag do-turn)) (vehicle-controller-flag do-turn)) (format #t "do-turn ") ) @@ -518,23 +518,23 @@ ) ) (format #t ")~%") - (format #t "~1Ttraffic: ~A~%" (-> obj traffic)) - (format #t "~1Tbranch: #~%" (-> obj branch)) - (format #t "~1Ttarget-speed-offset: (meters ~m)~%" (-> obj target-speed-offset)) - (format #t "~1Ttarget-speed: (meters ~m)~%" (-> obj target-speed)) - (format #t "~1Tchoose-branch-callback: ~A~%" (-> obj choose-branch-callback)) - (format #t "~1Tturn-accel: (meters ~m)~%" (-> obj turn-accel)) - (format #t "~1Tmax-turn-speed: (meters ~m)~%" (-> obj max-turn-speed)) - (format #t "~1Tpath-prev-point: ~`vector`P~%" (-> obj path-prev-point)) - (format #t "~1Tturn-enter-point: ~`vector`P~%" (-> obj turn-enter-point)) - (format #t "~1Tturn-exit-point: ~`vector`P~%" (-> obj turn-exit-point)) - (format #t "~1Tpath-dest-point: #~%" (-> obj turn-exit-point)) - (format #t "~1Tturn-enter-dir: ~`vector`P~%" (-> obj turn-enter-dir)) - (format #t "~1Tturn-exit-dir: ~`vector`P~%" (-> obj turn-exit-dir)) - (format #t "~1Tdest-circle: ~`vector`P~%" (-> obj dest-circle)) - (format #t "~1Ttarget-point: ~`vector`P~%" (-> obj target-point)) + (format #t "~1Ttraffic: ~A~%" (-> this traffic)) + (format #t "~1Tbranch: #~%" (-> this branch)) + (format #t "~1Ttarget-speed-offset: (meters ~m)~%" (-> this target-speed-offset)) + (format #t "~1Ttarget-speed: (meters ~m)~%" (-> this target-speed)) + (format #t "~1Tchoose-branch-callback: ~A~%" (-> this choose-branch-callback)) + (format #t "~1Tturn-accel: (meters ~m)~%" (-> this turn-accel)) + (format #t "~1Tmax-turn-speed: (meters ~m)~%" (-> this max-turn-speed)) + (format #t "~1Tpath-prev-point: ~`vector`P~%" (-> this path-prev-point)) + (format #t "~1Tturn-enter-point: ~`vector`P~%" (-> this turn-enter-point)) + (format #t "~1Tturn-exit-point: ~`vector`P~%" (-> this turn-exit-point)) + (format #t "~1Tpath-dest-point: #~%" (-> this turn-exit-point)) + (format #t "~1Tturn-enter-dir: ~`vector`P~%" (-> this turn-enter-dir)) + (format #t "~1Tturn-exit-dir: ~`vector`P~%" (-> this turn-exit-dir)) + (format #t "~1Tdest-circle: ~`vector`P~%" (-> this dest-circle)) + (format #t "~1Ttarget-point: ~`vector`P~%" (-> this target-point)) (label cfg-28) - obj + this ) ;; definition of type vehicle-section @@ -547,15 +547,15 @@ ) ;; definition for method 3 of type vehicle-section -(defmethod inspect vehicle-section ((obj vehicle-section)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-section ((this vehicle-section)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-section) - (format #t "~1Tdamage: ~f~%" (-> obj damage)) + (format #t "[~8x] ~A~%" this 'vehicle-section) + (format #t "~1Tdamage: ~f~%" (-> this damage)) (label cfg-4) - obj + this ) ;; definition of type vehicle @@ -732,16 +732,16 @@ ) ;; definition for method 3 of type vehicle -(defmethod inspect vehicle ((obj vehicle)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle ((this vehicle)) + (when (not this) + (set! this this) (goto cfg-92) ) (let ((t9-0 (method-of-type rigid-body-object inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tflags: #x~X : (vehicle-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "~2Tflags: #x~X : (vehicle-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand (rigid-body-object-flag lights-update) s5-0) (shl 64 32)) (format #t "lights-update ") ) @@ -882,74 +882,74 @@ ) ) (format #t ")~%") - (format #t "~2Tcontrols: #~%" (-> obj controls)) - (format #t "~2Tprev-controls: #~%" (-> obj prev-controls)) - (format #t "~2Tup-dir: #~%" (-> obj up-dir)) - (format #t "~2Tjump-time: ~f~%" (-> obj jump-time)) - (format #t "~2Tjump-thrust: ~f~%" (-> obj jump-thrust)) - (format #t "~2Tengine-thrust: ~f~%" (-> obj engine-thrust)) - (format #t "~2Tengine-power-factor: ~f~%" (-> obj engine-power-factor)) - (format #t "~2Tforce-scale: ~f~%" (-> obj force-scale)) - (format #t "~2Ttarget-distance2: (meters ~m)~%" (-> obj target-distance2)) - (format #t "~2Tpad0: ~D~%" (-> obj pad0)) - (format #t "~2Ttarget-acceleration: #~%" (-> obj target-acceleration)) - (format #t "~2Timpact-pos: #~%" (-> obj impact-pos)) - (format #t "~2Tlin-acceleration: #~%" (-> obj lin-acceleration)) - (format #t "~2Thit-points: ~f~%" (-> obj hit-points)) - (format #t "~2Tdamage-factor: ~f~%" (-> obj damage-factor)) - (format #t "~2Tcrash-level: ~D~%" (-> obj crash-level)) - (format #t "~2Tforce-level: ~D~%" (-> obj force-level)) - (format #t "~2Ttraffic-hash-id: ~D~%" (-> obj traffic-hash-id)) - (format #t "~2Ttraffic-priority-id: ~D~%" (-> obj traffic-priority-id)) - (format #t "~2Tpower-fluctuation-factor: ~f~%" (-> obj power-fluctuation-factor)) - (format #t "~2Tpower-level: ~f~%" (-> obj power-level)) - (format #t "~2Tflight-level-index: ~D~%" (-> obj flight-level-index)) - (format #t "~2Tflight-level-index-prev: ~D~%" (-> obj flight-level-index-prev)) - (format #t "~2Toverlap-player-counter: ~D~%" (-> obj overlap-player-counter)) - (format #t "~2Tphysics-counter: ~D~%" (-> obj physics-counter)) - (format #t "~2Tflight-level: ~f~%" (-> obj flight-level)) - (format #t "~2Tbrake-factor: ~f~%" (-> obj brake-factor)) - (format #t "~2Tcam-speed-interp: ~f~%" (-> obj cam-speed-interp)) - (format #t "~2Tcamera-dist2: ~f~%" (-> obj camera-dist2)) - (format #t "~2Tplayer-dist2: ~f~%" (-> obj player-dist2)) - (format #t "~2Tbound-radius: ~f~%" (-> obj bound-radius)) - (format #t "~2Trider-array[4] @ #x~X~%" (-> obj rider-array)) - (format #t "~2Tlift-thrust[2] @ #x~X~%" (-> obj lift-thrust)) - (format #t "~2Troll-thrust[2] @ #x~X~%" (-> obj roll-thrust)) - (format #t "~2Tsent-attack-time: ~D~%" (-> obj sent-attack-time)) - (format #t "~2Tair-time: ~D~%" (-> obj air-time)) - (format #t "~2Tturn-time: ~D~%" (-> obj turn-time)) - (format #t "~2Tcrash-time: ~D~%" (-> obj crash-time)) - (format #t "~2Ttransition-time: ~D~%" (-> obj transition-time)) - (format #t "~2Ttransition-end-time: ~D~%" (-> obj transition-end-time)) - (format #t "~2Tturbo-boost-time: ~D~%" (-> obj turbo-boost-time)) - (format #t "~2Tcrash-duration: ~D~%" (-> obj crash-duration)) - (format #t "~2Tturbo-boost-duration: ~D~%" (-> obj turbo-boost-duration)) - (format #t "~2Tturbo-boost-factor: ~f~%" (-> obj turbo-boost-factor)) - (format #t "~2Tcrash-impulse: ~f~%" (-> obj crash-impulse)) - (format #t "~2Twater-height: ~f~%" (-> obj water-height)) - (format #t "~2Tlights-factor: ~f~%" (-> obj lights-factor)) - (format #t "~2Toutgoing-attack-id: ~D~%" (-> obj outgoing-attack-id)) - (format #t "~2Tscrape-sound-id: ~D~%" (-> obj scrape-sound-id)) - (format #t "~2Tengine-sound-id: ~D~%" (-> obj engine-sound-id)) - (format #t "~2Tthrust-sound-id: ~D~%" (-> obj thrust-sound-id)) - (format #t "~2Troll-sound-id: ~D~%" (-> obj roll-sound-id)) - (format #t "~2Tdamage-pop-sound-id: ~D~%" (-> obj damage-pop-sound-id)) - (format #t "~2Tdamage-zap-sound-id: ~D~%" (-> obj damage-zap-sound-id)) - (format #t "~2Textra-sound-id: ~D~%" (-> obj extra-sound-id)) - (format #t "~2Tfog-fade: ~f~%" (-> obj fog-fade)) - (format #t "~2Tscrape-sound-envelope: ~f~%" (-> obj scrape-sound-envelope)) - (format #t "~2Tengine-sound-envelope: ~f~%" (-> obj engine-sound-envelope)) - (format #t "~2Tengine-sound-factor: ~f~%" (-> obj engine-sound-factor)) - (format #t "~2Tsputter-sound-envelope: ~f~%" (-> obj sputter-sound-envelope)) - (format #t "~2Trudder-sound-envelope: ~f~%" (-> obj rudder-sound-envelope)) - (format #t "~2Tfins-sound-envelope: ~f~%" (-> obj fins-sound-envelope)) - (format #t "~2Texhaust-part-accum[2] @ #x~X~%" (-> obj exhaust-part-accum)) - (format #t "~2Tsmoke-part-accum[2] @ #x~X~%" (-> obj smoke-part-accum)) - (format #t "~2Tcontroller: #~%" (-> obj controller)) - (format #t "~2Tsection-array[4] @ #x~X~%" (-> obj section-array)) + (format #t "~2Tcontrols: #~%" (-> this controls)) + (format #t "~2Tprev-controls: #~%" (-> this prev-controls)) + (format #t "~2Tup-dir: #~%" (-> this up-dir)) + (format #t "~2Tjump-time: ~f~%" (-> this jump-time)) + (format #t "~2Tjump-thrust: ~f~%" (-> this jump-thrust)) + (format #t "~2Tengine-thrust: ~f~%" (-> this engine-thrust)) + (format #t "~2Tengine-power-factor: ~f~%" (-> this engine-power-factor)) + (format #t "~2Tforce-scale: ~f~%" (-> this force-scale)) + (format #t "~2Ttarget-distance2: (meters ~m)~%" (-> this target-distance2)) + (format #t "~2Tpad0: ~D~%" (-> this pad0)) + (format #t "~2Ttarget-acceleration: #~%" (-> this target-acceleration)) + (format #t "~2Timpact-pos: #~%" (-> this impact-pos)) + (format #t "~2Tlin-acceleration: #~%" (-> this lin-acceleration)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tdamage-factor: ~f~%" (-> this damage-factor)) + (format #t "~2Tcrash-level: ~D~%" (-> this crash-level)) + (format #t "~2Tforce-level: ~D~%" (-> this force-level)) + (format #t "~2Ttraffic-hash-id: ~D~%" (-> this traffic-hash-id)) + (format #t "~2Ttraffic-priority-id: ~D~%" (-> this traffic-priority-id)) + (format #t "~2Tpower-fluctuation-factor: ~f~%" (-> this power-fluctuation-factor)) + (format #t "~2Tpower-level: ~f~%" (-> this power-level)) + (format #t "~2Tflight-level-index: ~D~%" (-> this flight-level-index)) + (format #t "~2Tflight-level-index-prev: ~D~%" (-> this flight-level-index-prev)) + (format #t "~2Toverlap-player-counter: ~D~%" (-> this overlap-player-counter)) + (format #t "~2Tphysics-counter: ~D~%" (-> this physics-counter)) + (format #t "~2Tflight-level: ~f~%" (-> this flight-level)) + (format #t "~2Tbrake-factor: ~f~%" (-> this brake-factor)) + (format #t "~2Tcam-speed-interp: ~f~%" (-> this cam-speed-interp)) + (format #t "~2Tcamera-dist2: ~f~%" (-> this camera-dist2)) + (format #t "~2Tplayer-dist2: ~f~%" (-> this player-dist2)) + (format #t "~2Tbound-radius: ~f~%" (-> this bound-radius)) + (format #t "~2Trider-array[4] @ #x~X~%" (-> this rider-array)) + (format #t "~2Tlift-thrust[2] @ #x~X~%" (-> this lift-thrust)) + (format #t "~2Troll-thrust[2] @ #x~X~%" (-> this roll-thrust)) + (format #t "~2Tsent-attack-time: ~D~%" (-> this sent-attack-time)) + (format #t "~2Tair-time: ~D~%" (-> this air-time)) + (format #t "~2Tturn-time: ~D~%" (-> this turn-time)) + (format #t "~2Tcrash-time: ~D~%" (-> this crash-time)) + (format #t "~2Ttransition-time: ~D~%" (-> this transition-time)) + (format #t "~2Ttransition-end-time: ~D~%" (-> this transition-end-time)) + (format #t "~2Tturbo-boost-time: ~D~%" (-> this turbo-boost-time)) + (format #t "~2Tcrash-duration: ~D~%" (-> this crash-duration)) + (format #t "~2Tturbo-boost-duration: ~D~%" (-> this turbo-boost-duration)) + (format #t "~2Tturbo-boost-factor: ~f~%" (-> this turbo-boost-factor)) + (format #t "~2Tcrash-impulse: ~f~%" (-> this crash-impulse)) + (format #t "~2Twater-height: ~f~%" (-> this water-height)) + (format #t "~2Tlights-factor: ~f~%" (-> this lights-factor)) + (format #t "~2Toutgoing-attack-id: ~D~%" (-> this outgoing-attack-id)) + (format #t "~2Tscrape-sound-id: ~D~%" (-> this scrape-sound-id)) + (format #t "~2Tengine-sound-id: ~D~%" (-> this engine-sound-id)) + (format #t "~2Tthrust-sound-id: ~D~%" (-> this thrust-sound-id)) + (format #t "~2Troll-sound-id: ~D~%" (-> this roll-sound-id)) + (format #t "~2Tdamage-pop-sound-id: ~D~%" (-> this damage-pop-sound-id)) + (format #t "~2Tdamage-zap-sound-id: ~D~%" (-> this damage-zap-sound-id)) + (format #t "~2Textra-sound-id: ~D~%" (-> this extra-sound-id)) + (format #t "~2Tfog-fade: ~f~%" (-> this fog-fade)) + (format #t "~2Tscrape-sound-envelope: ~f~%" (-> this scrape-sound-envelope)) + (format #t "~2Tengine-sound-envelope: ~f~%" (-> this engine-sound-envelope)) + (format #t "~2Tengine-sound-factor: ~f~%" (-> this engine-sound-factor)) + (format #t "~2Tsputter-sound-envelope: ~f~%" (-> this sputter-sound-envelope)) + (format #t "~2Trudder-sound-envelope: ~f~%" (-> this rudder-sound-envelope)) + (format #t "~2Tfins-sound-envelope: ~f~%" (-> this fins-sound-envelope)) + (format #t "~2Texhaust-part-accum[2] @ #x~X~%" (-> this exhaust-part-accum)) + (format #t "~2Tsmoke-part-accum[2] @ #x~X~%" (-> this smoke-part-accum)) + (format #t "~2Tcontroller: #~%" (-> this controller)) + (format #t "~2Tsection-array[4] @ #x~X~%" (-> this section-array)) (label cfg-92) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc index ca1254fbb6..739142f89e 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-physics_REF.gc @@ -4,12 +4,12 @@ ;; definition for method 99 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-99 vehicle ((obj vehicle) (arg0 float)) +(defmethod vehicle-method-99 vehicle ((this vehicle) (arg0 float)) (let ((s4-0 (new 'stack-no-clear 'vehicle-grab-rail-info)) - (s3-0 (-> obj root root-prim)) + (s3-0 (-> this root root-prim)) (s2-0 1) ) - (when (< (-> obj rbody state position y) (+ (-> obj water-height) (-> s3-0 local-sphere w))) + (when (< (-> this rbody state position y) (+ (-> this water-height) (-> s3-0 local-sphere w))) (when (= (-> s3-0 prim-core prim-type) (prim-type group)) (let ((v1-5 (the-as collide-shape-prim-group s3-0))) (set! s3-0 (-> v1-5 child 0)) @@ -21,15 +21,15 @@ (let* ((s0-0 (-> s3-0 prim-core)) (f0-2 (- (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))) ) - (when (< f0-2 (-> obj water-height)) + (when (< f0-2 (-> this water-height)) (set! (-> s4-0 local-pos 0 quad) (-> s0-0 world-sphere quad)) - (let ((f1-5 (fmin (-> obj water-height) (+ (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))))) + (let ((f1-5 (fmin (-> this water-height) (+ (-> s0-0 world-sphere y) (-> s0-0 world-sphere w))))) 0.0 - (let* ((f2-5 (fmax -1.0 (fmin 1.0 (/ (- (-> obj water-height) (-> s0-0 world-sphere y)) (-> s0-0 world-sphere w))))) + (let* ((f2-5 (fmax -1.0 (fmin 1.0 (/ (- (-> this water-height) (-> s0-0 world-sphere y)) (-> s0-0 world-sphere w))))) (f30-0 (+ 0.5 (* -0.25 f2-5 f2-5 f2-5) (* 0.75 f2-5))) ) (set! (-> s4-0 local-pos 0 y) (* 0.5 (+ f0-2 f1-5))) - (let ((v1-18 (-> obj rbody)) + (let ((v1-18 (-> this rbody)) (a1-1 (-> s4-0 local-pos)) (a2-0 (-> s4-0 normal)) ) @@ -40,11 +40,11 @@ (f0-8 (* f0-7 (* f1-8 f1-8))) (f1-11 4096.0) (f1-13 (* f1-11 f1-11)) - (f0-10 (fmin (* f0-8 (/ 1.0 f1-13)) (/ (-> obj info info mass) (* 2.0 arg0 (the float s2-0))))) + (f0-10 (fmin (* f0-8 (/ 1.0 f1-13)) (/ (-> this info info mass) (* 2.0 arg0 (the float s2-0))))) ) (vector-float*! (-> s4-0 local-pos 1) (-> s4-0 normal) (* -1.0 f0-10)) ) - (let ((v1-34 (-> obj rbody)) + (let ((v1-34 (-> this rbody)) (a1-3 (-> s4-0 local-pos)) (a2-1 (-> s4-0 local-pos 1)) ) @@ -55,14 +55,14 @@ (f1-19 4096.0) (f2-13 4096.0) (f1-20 (* f1-19 (* f2-13 f2-13))) - (f0-16 (* f0-12 (/ 1.0 f1-20) (-> obj info buoyancy-factor) f30-0 (-> s0-0 world-sphere w))) + (f0-16 (* f0-12 (/ 1.0 f1-20) (-> this info buoyancy-factor) f30-0 (-> s0-0 world-sphere w))) (f1-25 (-> s0-0 world-sphere w)) ) (set! (-> s4-0 local-pos 1 y) (* f0-16 (* f1-25 f1-25))) ) ) ) - (let ((v1-46 (-> obj rbody)) + (let ((v1-46 (-> this rbody)) (a1-4 (-> s4-0 local-pos)) (a2-2 (-> s4-0 local-pos 1)) ) @@ -98,24 +98,24 @@ ) ;; definition for method 3 of type vehicle-probe-work -(defmethod inspect vehicle-probe-work ((obj vehicle-probe-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-probe-work ((this vehicle-probe-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-probe-work) - (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~1Tlocal-normal: #~%" (-> obj local-normal)) - (format #t "~1Tworld-pos: #~%" (-> obj world-pos)) - (format #t "~1Tworld-normal: #~%" (-> obj world-normal)) - (format #t "~1Tprobe-pos: #~%" (-> obj probe-pos)) - (format #t "~1Tground-pos: #~%" (-> obj ground-pos)) - (format #t "~1Tground-normal: #~%" (-> obj ground-normal)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) - (format #t "~1Ttire-force: #~%" (-> obj tire-force)) - (format #t "~1Twheel-axis: #~%" (-> obj wheel-axis)) + (format #t "[~8x] ~A~%" this 'vehicle-probe-work) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tlocal-normal: #~%" (-> this local-normal)) + (format #t "~1Tworld-pos: #~%" (-> this world-pos)) + (format #t "~1Tworld-normal: #~%" (-> this world-normal)) + (format #t "~1Tprobe-pos: #~%" (-> this probe-pos)) + (format #t "~1Tground-pos: #~%" (-> this ground-pos)) + (format #t "~1Tground-normal: #~%" (-> this ground-normal)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Ttire-force: #~%" (-> this tire-force)) + (format #t "~1Twheel-axis: #~%" (-> this wheel-axis)) (label cfg-4) - obj + this ) ;; definition of type vehicle-physics-work @@ -146,39 +146,39 @@ ) ;; definition for method 3 of type vehicle-physics-work -(defmethod inspect vehicle-physics-work ((obj vehicle-physics-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-physics-work ((this vehicle-physics-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-physics-work) - (format #t "~1Tmat: #~%" (-> obj mat)) - (format #t "~1Tforce: #~%" (-> obj force)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) - (format #t "~1Tworld-pos: #~%" (-> obj world-pos)) - (format #t "~1Tworld-normal: #~%" (-> obj world-normal)) - (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) - (format #t "~1Tsteering-axis: #~%" (-> obj steering-axis)) - (format #t "~1Tlift-dir: #~%" (-> obj lift-dir)) - (format #t "~1Tnormal: #~%" (-> obj normal)) - (format #t "~1Ttmp: #~%" (-> obj tmp)) - (format #t "~1Tp-body: #~%" (-> obj p-body)) - (format #t "~1Taxis: #~%" (-> obj axis)) - (format #t "~1Tdir: #~%" (-> obj dir)) - (format #t "~1Tground-normal: #~%" (-> obj ground-normal)) - (format #t "~1Timpulse: ~f~%" (-> obj impulse)) - (format #t "~1Tvel-dot-norm: ~f~%" (-> obj vel-dot-norm)) - (format #t "~1Tfriction-coef: ~f~%" (-> obj friction-coef)) - (format #t "~1Tspeed-factor: ~f~%" (-> obj speed-factor)) - (format #t "~1Tprobe-work-array[2] @ #x~X~%" (-> obj probe-work-array)) + (format #t "[~8x] ~A~%" this 'vehicle-physics-work) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Tforce: #~%" (-> this force)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Tworld-pos: #~%" (-> this world-pos)) + (format #t "~1Tworld-normal: #~%" (-> this world-normal)) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tsteering-axis: #~%" (-> this steering-axis)) + (format #t "~1Tlift-dir: #~%" (-> this lift-dir)) + (format #t "~1Tnormal: #~%" (-> this normal)) + (format #t "~1Ttmp: #~%" (-> this tmp)) + (format #t "~1Tp-body: #~%" (-> this p-body)) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Tground-normal: #~%" (-> this ground-normal)) + (format #t "~1Timpulse: ~f~%" (-> this impulse)) + (format #t "~1Tvel-dot-norm: ~f~%" (-> this vel-dot-norm)) + (format #t "~1Tfriction-coef: ~f~%" (-> this friction-coef)) + (format #t "~1Tspeed-factor: ~f~%" (-> this speed-factor)) + (format #t "~1Tprobe-work-array[2] @ #x~X~%" (-> this probe-work-array)) (label cfg-4) - obj + this ) ;; definition for method 100 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-100 vehicle ((obj vehicle) (arg0 float) (arg1 vehicle-physics-work)) +(defmethod vehicle-method-100 vehicle ((this vehicle) (arg0 float) (arg1 vehicle-physics-work)) (local-vars (v1-81 float) (v1-184 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -190,10 +190,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (+! (-> obj physics-counter) 1) - (let ((s3-0 (-> obj rbody))) + (+! (-> this physics-counter) 1) + (let ((s3-0 (-> this rbody))) (mem-copy! (the-as pointer (-> arg1 mat)) (the-as pointer (-> s3-0 state matrix)) 64) - (let* ((f28-0 (* -1.0 (-> obj controls steering) (-> obj info tire-steering-angle))) + (let* ((f28-0 (* -1.0 (-> this controls steering) (-> this info tire-steering-angle))) (f30-0 (cos f28-0)) (f0-2 (sin f28-0)) ) @@ -202,18 +202,18 @@ (set! (-> arg1 steering-axis z) f0-2) ) (vector-rotate*! (-> arg1 steering-axis) (-> arg1 steering-axis) (-> arg1 mat)) - (logior! (-> obj flags) (rigid-body-object-flag in-air)) - (logclear! (-> obj flags) (rigid-body-object-flag on-ground on-flight-level)) + (logior! (-> this flags) (rigid-body-object-flag in-air)) + (logclear! (-> this flags) (rigid-body-object-flag on-ground on-flight-level)) (vector-reset! (-> arg1 ground-normal)) (set! (-> arg1 ground-normal y) 1.0) - (let ((f30-1 (-> obj info ground-probe-distance))) + (let ((f30-1 (-> this info ground-probe-distance))) (let ((s2-0 (new 'stack-no-clear 'collide-query))) (vector-reset! (-> arg1 lift-dir)) (set! (-> arg1 lift-dir y) -1.0) (set! (-> arg1 speed-factor) (fmax 0.0 (fmin 0.9 (* 0.000008138021 (+ -40960.0 (vector-length (-> s3-0 state lin-velocity)))))) ) - (when (logtest? (-> obj info flags) 1) + (when (logtest? (-> this info flags) 1) (vector-float*! (-> arg1 tmp) (-> arg1 mat vector 1) -1.0) (let ((t9-4 vector-lerp!) (a0-7 (-> arg1 lift-dir)) @@ -245,8 +245,8 @@ (set! (-> v1-28 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) (set! (-> v1-28 action-mask) (collide-action solid)) ) - (dotimes (s1-0 (-> obj info lift-thruster-count)) - (let ((v1-31 (-> obj info lift-thruster-array s1-0)) + (dotimes (s1-0 (-> this info lift-thruster-count)) + (let ((v1-31 (-> this info lift-thruster-array s1-0)) (s0-0 (-> arg1 probe-work-array s1-0)) ) (vector-reset! (-> s0-0 tire-force)) @@ -256,7 +256,7 @@ (let ((a1-9 (-> s0-0 probe-pos))) (let ((v1-34 (-> s0-0 world-pos))) (let ((a0-22 (-> arg1 mat vector 1))) - (let ((a2-6 (-> obj info ground-probe-offset))) + (let ((a2-6 (-> this info ground-probe-offset))) (.mov vf7 a2-6) ) (.lvf vf5 (&-> a0-22 quad)) @@ -285,13 +285,13 @@ (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) (set! (-> s0-0 ground-pos y) 0.0) (vector-reset! (-> s0-0 ground-normal)) - (when (logtest? (-> obj flags) (rigid-body-object-flag enable-collision)) + (when (logtest? (-> this flags) (rigid-body-object-flag enable-collision)) (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) (cond ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) - (logclear! (-> obj flags) (rigid-body-object-flag in-air)) - (logior! (-> obj flags) (rigid-body-object-flag on-ground)) + (logclear! (-> this flags) (rigid-body-object-flag in-air)) + (logior! (-> this flags) (rigid-body-object-flag on-ground)) (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) @@ -306,23 +306,23 @@ ) ) ) - (set! (-> obj lift-thrust 0) 0.0) - (set! (-> obj lift-thrust 1) 0.0) - (set! (-> obj roll-thrust 0) 0.0) - (set! (-> obj roll-thrust 1) 0.0) - (set! (-> obj roll-thrust 0) 0.0) - (set! (-> obj roll-thrust 1) 0.0) - (when (>= 1 (-> obj force-level)) - (dotimes (s2-1 (-> obj info lift-thruster-count)) + (set! (-> this lift-thrust 0) 0.0) + (set! (-> this lift-thrust 1) 0.0) + (set! (-> this roll-thrust 0) 0.0) + (set! (-> this roll-thrust 1) 0.0) + (set! (-> this roll-thrust 0) 0.0) + (set! (-> this roll-thrust 1) 0.0) + (when (>= 1 (-> this force-level)) + (dotimes (s2-1 (-> this info lift-thruster-count)) (let ((s1-1 (-> arg1 probe-work-array s2-1))) (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) (let ((f28-1 (-> s1-1 probe-pos y))) - (when (> (-> obj flight-level-index) 0) - (set! f28-1 (- f28-1 (+ 6144.0 (-> obj flight-level)))) + (when (> (-> this flight-level-index) 0) + (set! f28-1 (- f28-1 (+ 6144.0 (-> this flight-level)))) (when (>= 0.0 f28-1) - (logclear! (-> obj flags) (rigid-body-object-flag in-air)) - (logior! (-> obj flags) (rigid-body-object-flag on-flight-level)) + (logclear! (-> this flags) (rigid-body-object-flag in-air)) + (logior! (-> this flags) (rigid-body-object-flag on-flight-level)) (.lvf vf1 (&-> (-> s1-1 ground-normal) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -335,18 +335,18 @@ ) ) ) - (when (or (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (and (> (-> obj flight-level-index) 0) (< f28-1 0.0)) + (when (or (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) + (and (> (-> this flight-level-index) 0) (< f28-1 0.0)) ) - (if (zero? (-> obj flight-level-index)) + (if (zero? (-> this flight-level-index)) (set! f28-1 40960.0) ) (let* ((f0-37 (* -1.0 - (-> obj force-scale) - (-> obj info inv-lift-thruster-count) - (-> obj info info mass) - (-> obj info extra gravity) - (+ 1.0 (* 2.0 (the float (-> obj flight-level-index)))) + (-> this force-scale) + (-> this info inv-lift-thruster-count) + (-> this info info mass) + (-> this info extra gravity) + (+ 1.0 (* 2.0 (the float (-> this flight-level-index)))) ) ) (f1-17 -1.0) @@ -358,10 +358,10 @@ (f0-38 (* f0-37 (fmax f1-17 (fmin f2-4 (+ f3-7 (* f4-2 (/ 1.0 f5-0) (-> arg1 velocity y))))))) ) (let ((f1-20 (fmax 0.0 f0-38))) - (+! (-> obj lift-thrust s2-1) f1-20) - (when (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (+! (-> obj roll-thrust 0) (* 0.05 f1-20)) - (+! (-> obj roll-thrust 1) (* 0.05 f1-20)) + (+! (-> this lift-thrust s2-1) f1-20) + (when (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) + (+! (-> this roll-thrust 0) (* 0.05 f1-20)) + (+! (-> this roll-thrust 1) (* 0.05 f1-20)) ) ) (vector-reset! (-> arg1 force)) @@ -376,17 +376,17 @@ (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) ) (let ((f0-40 (+ 4096.0 f28-1))) - (when (or (and (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) + (when (or (and (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) (< 0.0 f0-40) (< 0.0 (-> arg1 velocity y)) ) - (and (> (-> obj flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) + (and (> (-> this flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0)) ) (vector-reset! (-> arg1 force)) - (let ((f0-43 (* -0.25 (-> obj info inv-lift-thruster-count))) + (let ((f0-43 (* -0.25 (-> this info inv-lift-thruster-count))) (f1-28 arg0) ) - (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> obj info info mass) (-> arg1 velocity y))) + (set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> this info info mass) (-> arg1 velocity y))) ) (let ((v1-140 s3-0) (a1-16 (-> arg1 world-pos)) @@ -401,7 +401,7 @@ (let* ((f1-36 (fmax 4096.0 (fmin (- (-> s1-1 probe-pos y) (-> s1-1 ground-pos y)) f30-1))) (f28-2 (- 1.0 (/ (+ -4096.0 f1-36) (+ -4096.0 f30-1)))) ) - (if (>= (-> obj info cos-ground-effect-angle) (vector-dot (-> s1-1 ground-normal) (-> arg1 mat vector 1))) + (if (>= (-> this info cos-ground-effect-angle) (vector-dot (-> s1-1 ground-normal) (-> arg1 mat vector 1))) (set! f28-2 0.0) ) (set! (-> arg1 tmp y) 0.0) @@ -421,8 +421,8 @@ ) (vector-float*! v1-155 a0-55 (* f0-58 (/ 1.0 f1-41) - (-> obj info inv-lift-thruster-count) - (-> obj info info mass) + (-> this info inv-lift-thruster-count) + (-> this info info mass) (fmax 0.0 (- (vector-dot (-> arg1 velocity) (-> arg1 normal)))) ) ) @@ -434,17 +434,18 @@ (rigid-body-method-18 (-> v1-157 state) a1-28 a2-13) ) (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - (let ((f0-72 - (* 8.0 - (-> obj info info mass) - (-> obj info extra gravity) - (-> obj info inv-lift-thruster-count) - (+ (* (-> obj info spring-lift-factor) f28-2) (* 0.75 (-> obj jump-thrust) (-> obj info jump-thrust-factor))) - (- (+ 1.0 (* 2.0 (rand-vu) (-> obj power-fluctuation-factor))) (-> obj power-fluctuation-factor)) - ) - ) + (let ((f0-72 (* 8.0 + (-> this info info mass) + (-> this info extra gravity) + (-> this info inv-lift-thruster-count) + (+ (* (-> this info spring-lift-factor) f28-2) + (* 0.75 (-> this jump-thrust) (-> this info jump-thrust-factor)) + ) + (- (+ 1.0 (* 2.0 (rand-vu) (-> this power-fluctuation-factor))) (-> this power-fluctuation-factor)) + ) + ) ) - (+! (-> obj lift-thrust s2-1) f0-72) + (+! (-> this lift-thrust s2-1) f0-72) (vector-float*! (-> arg1 force) (-> arg1 lift-dir) (* -1.0 f0-72)) ) ) @@ -455,16 +456,16 @@ (rigid-body-method-18 (-> v1-176 state) a1-32 a2-14) ) (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) - (when (and (< 0.0 (-> obj info tire-friction-factor)) (let ((f0-75 0.0)) - (.lvf vf1 (&-> (-> s1-1 ground-normal) quad)) - (.add.w.vf vf2 vf0 vf0 :mask #b1) - (.mul.vf vf1 vf1 vf1) - (.mul.x.vf acc vf2 vf1 :mask #b1) - (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) - (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) - (.mov v1-184 vf1) - (< f0-75 v1-184) - ) + (when (and (< 0.0 (-> this info tire-friction-factor)) (let ((f0-75 0.0)) + (.lvf vf1 (&-> (-> s1-1 ground-normal) quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-184 vf1) + (< f0-75 v1-184) + ) ) (vector+float*! (-> arg1 normal) @@ -483,20 +484,20 @@ (let ((f0-82 (fabs (-> arg1 vel-dot-norm)))) (set! (-> arg1 friction-coef) (smooth-interp - (-> obj info tire-static-friction) - (-> obj info tire-dynamic-friction) + (-> this info tire-static-friction) + (-> this info tire-dynamic-friction) f0-82 - (-> obj info tire-static-friction-speed) - (-> obj info tire-dynamic-friction-speed) + (-> this info tire-static-friction-speed) + (-> this info tire-dynamic-friction-speed) ) ) ) (set! (-> arg1 friction-coef) - (* (-> arg1 friction-coef) (+ 1.0 (* -0.75 (fmax 0.0 (fmin 1.0 (-> obj engine-thrust)))))) + (* (-> arg1 friction-coef) (+ 1.0 (* -0.75 (fmax 0.0 (fmin 1.0 (-> this engine-thrust)))))) ) (let ((f0-90 (* (-> arg1 friction-coef) - (-> obj info tire-friction-factor) + (-> this info tire-friction-factor) (fmax 0.0 (vector-dot (-> s1-1 ground-normal) (-> s1-1 tire-force))) ) ) @@ -541,18 +542,18 @@ ;; WARN: Stack slot offset 724 signed mismatch ;; WARN: Stack slot offset 720 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 vehicle ((obj vehicle) (arg0 float)) +(defmethod rigid-body-object-method-29 vehicle ((this vehicle) (arg0 float)) (local-vars (sv-624 float) (sv-720 float) (sv-724 float)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((gp-0 (new 'stack-no-clear 'inline-array 'matrix 9)) - (s5-0 (-> obj rbody)) - (s4-0 (-> obj info)) + (s5-0 (-> this rbody)) + (s4-0 (-> this info)) ) (mem-copy! (the-as pointer (-> gp-0 0)) (the-as pointer (-> s5-0 state matrix)) 64) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) - (vehicle-method-100 obj arg0 (the-as vehicle-physics-work gp-0)) - (when (>= 1 (-> obj force-level)) + (when (not (logtest? (-> this flags) (rigid-body-object-flag dead))) + (vehicle-method-100 this arg0 (the-as vehicle-physics-work gp-0)) + (when (>= 1 (-> this force-level)) (set! sv-624 (* (-> s4-0 info mass) (-> s4-0 extra gravity))) (when (!= (-> s4-0 pitch-control-factor) 0.0) (set! (-> gp-0 3 vector 2 quad) (-> gp-0 0 quad 0)) @@ -593,8 +594,8 @@ ) ) (let ((s1-1 (new 'stack-no-clear 'inline-array 'vector 5))) - (let ((f0-12 (* -1.0 (-> obj controls steering) (-> gp-0 4 vector 1 w) (-> s4-0 roll-angle)))) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) + (let ((f0-12 (* -1.0 (-> this controls steering) (-> gp-0 4 vector 1 w) (-> s4-0 roll-angle)))) + (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) (set! f0-12 0.0) ) (quaternion-vector-angle! (the-as quaternion (-> s1-1 0)) (-> gp-0 0 vector 2) f0-12) @@ -624,13 +625,13 @@ ) (when (< 0.0 f30-1) (let ((f30-2 - (* (+ f30-1 (+ (- (-> obj power-fluctuation-factor)) (* 2.0 (rand-vu) (-> obj power-fluctuation-factor)))) + (* (+ f30-1 (+ (- (-> this power-fluctuation-factor)) (* 2.0 (rand-vu) (-> this power-fluctuation-factor)))) (-> s4-0 roll-control-factor) sv-720 ) ) ) - (+! (-> obj roll-thrust s1-2) (fmax 0.0 f30-2)) + (+! (-> this roll-thrust s1-2) (fmax 0.0 f30-2)) (vector-matrix*! (-> gp-0 1 vector 2) (-> s0-1 local-pos) (-> gp-0 0)) (vector-rotate*! (-> gp-0 1 trans) (-> s0-1 normal) (-> gp-0 0)) (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) (* -1.0 f30-2)) @@ -647,19 +648,19 @@ ) ) (when #t - (let* ((f0-30 (-> obj controls steering)) + (let* ((f0-30 (-> this controls steering)) (f1-23 (-> s4-0 steering-thruster-half-gain-speed)) (f2-10 (-> s4-0 steering-thruster-half-gain-speed)) (v1-65 (-> s5-0 state lin-velocity)) (f2-12 (/ f1-23 (+ f2-10 (sqrtf (+ (* (-> v1-65 x) (-> v1-65 x)) (* (-> v1-65 z) (-> v1-65 z))))))) ) - (if (< (-> obj controls throttle) 0.0) + (if (< (-> this controls throttle) 0.0) (set! f0-30 (* -1.0 f0-30)) ) (set! (-> gp-0 3 vector 2 quad) (-> gp-0 0 vector 1 quad)) (let ((f30-3 (* 8192.0 (-> s4-0 info mass) - (-> obj power-level) + (-> this power-level) (- (* f0-30 f2-12 (-> s4-0 steering-thruster-max-gain)) (vector-dot (-> gp-0 3 vector 2) (-> s5-0 state ang-velocity)) ) @@ -667,7 +668,7 @@ ) ) ) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) + (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) (set! f30-3 (* f30-3 (-> s4-0 air-steering-factor))) ) (let ((s1-3 (the-as object (-> s4-0 steering-thruster-array)))) @@ -691,15 +692,15 @@ ) ) ) - (seek! (-> obj jump-thrust) 0.0 (* 6.0 arg0)) - (when (logtest? (rigid-body-object-flag ignition) (-> obj flags)) + (seek! (-> this jump-thrust) 0.0 (* 6.0 arg0)) + (when (logtest? (rigid-body-object-flag ignition) (-> this flags)) (vector-matrix*! (-> gp-0 1 vector 2) (-> s4-0 engine-thrust-local-pos) (-> gp-0 0)) (set! (-> gp-0 3 trans quad) (-> gp-0 0 vector 2 quad)) - (let ((f0-45 (* (-> obj engine-thrust) + (let ((f0-45 (* (-> this engine-thrust) (-> s4-0 max-engine-thrust) (-> s4-0 info mass) - (-> obj power-level) - (-> obj force-scale) + (-> this power-level) + (-> this force-scale) ) ) ) @@ -714,7 +715,7 @@ ) ) ) - (let ((f30-4 (-> obj controls brake))) + (let ((f30-4 (-> this controls brake))) (when (< 0.0 f30-4) (vector-matrix*! (-> gp-0 1 vector 2) (-> s4-0 brake-local-pos) (-> gp-0 0)) (let ((v1-98 s5-0) @@ -747,18 +748,18 @@ (* (-> s4-0 stabilizer-count) 2) ) (let ((s0-3 (-> s1-4 3 normal))) - (let ((f0-57 (* -3640.889 (-> obj controls lean-z)))) + (let ((f0-57 (* -3640.889 (-> this controls lean-z)))) (vector-rotate-around-x! s0-3 s0-3 f0-57) ) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) + (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) (set! (-> s0-3 w) (* 10.0 (-> s0-3 w))) ) - (if (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) + (if (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) (set! (-> s0-3 w) 0.0) ) ) - (let ((f30-5 (* -0.0000006103516 (-> obj force-scale) (-> s4-0 info mass) (-> s4-0 drag-force-factor)))) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) + (let ((f30-5 (* -0.0000006103516 (-> this force-scale) (-> s4-0 info mass) (-> s4-0 drag-force-factor)))) + (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) (set! f30-5 (* f30-5 (-> s4-0 air-drag-factor))) ) (let ((s1-5 (-> s1-4 0))) @@ -775,7 +776,7 @@ (* -0.06125 (vector-dot (-> gp-0 1 trans) (-> gp-0 1 vector 1)) (-> s1-5 normal w) - (-> obj force-scale) + (-> this force-scale) (-> s4-0 info mass) (-> s4-0 airfoil-factor) ) @@ -783,7 +784,7 @@ ) (vector-float*! (the-as vector (-> gp-0 1)) (-> gp-0 1 trans) f0-70) ) - (when (<= (-> obj force-level) 0) + (when (<= (-> this force-level) 0) (let ((v1-138 s5-0) (a1-29 (-> gp-0 1 vector 2)) (a2-23 (-> gp-0 1)) @@ -799,7 +800,7 @@ (+ (* 0.15 (vector-length (-> gp-0 1 vector 1))) (fabs (vector-dot (-> gp-0 1 trans) (-> gp-0 1 vector 1)))) ) ) - (when (<= (-> obj force-level) 0) + (when (<= (-> this force-level) 0) (let ((v1-145 s5-0) (a1-35 (-> gp-0 1 vector 2)) (a2-25 (-> gp-0 1)) @@ -815,7 +816,7 @@ (.svf (&-> (-> gp-0 1) quad 0) vf0) (set! (-> gp-0 1 vector 0 y) (* -1.0 (-> s4-0 extra gravity) - (if (< 1 (-> obj force-level)) + (if (< 1 (-> this force-level)) 2.0 1.0 ) @@ -827,10 +828,10 @@ ) (rigid-body-method-20 (-> v1-154 state) (the-as vector a1-36)) ) - (when (logtest? (-> obj flags) (rigid-body-object-flag riding)) + (when (logtest? (-> this flags) (rigid-body-object-flag riding)) (set! (-> gp-0 2 quad 0) (-> s4-0 info cm-offset-joint quad)) - (+! (-> gp-0 2 vector 0 x) (* (-> obj controls steering) (-> s4-0 player-shift-x))) - (+! (-> gp-0 2 vector 0 z) (* (-> obj controls lean-z) (-> s4-0 player-shift-z))) + (+! (-> gp-0 2 vector 0 x) (* (-> this controls steering) (-> s4-0 player-shift-x))) + (+! (-> gp-0 2 vector 0 z) (* (-> this controls lean-z) (-> s4-0 player-shift-z))) (vector-matrix*! (-> gp-0 1 vector 2) (the-as vector (-> gp-0 2)) (-> gp-0 0)) (.svf (&-> (-> gp-0 1) quad 0) vf0) (set! (-> gp-0 1 vector 0 y) (- (-> s4-0 player-weight))) @@ -842,9 +843,9 @@ ) 0 ) - (rigid-body-object-method-50 obj arg0) - (vehicle-method-99 obj arg0) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) + (rigid-body-object-method-50 this arg0) + (vehicle-method-99 this arg0) + (when (not (logtest? (-> this flags) (rigid-body-object-flag dead))) (set! (-> gp-0 1 trans quad) (-> s5-0 state lin-momentum quad)) (set! (-> gp-0 1 trans y) 0.0) (vector-normalize! (-> gp-0 1 trans) 1.0) @@ -855,7 +856,7 @@ (f1-67 -1.0) (f2-29 (* (-> s4-0 speed-limiting-drag) (vector-dot (-> s5-0 state force) (-> gp-0 1 trans)))) (f3-19 - (* (fabs (-> obj engine-thrust)) (-> s4-0 speed-scrubbing-drag) (vector-length (-> s5-0 state lin-momentum))) + (* (fabs (-> this engine-thrust)) (-> s4-0 speed-scrubbing-drag) (vector-length (-> s5-0 state lin-momentum))) ) (f4-6 (- 1.0 (fabs (vector-dot (-> s5-0 state matrix vector 2) (-> gp-0 1 trans))))) ) @@ -872,13 +873,13 @@ ) ;; definition for method 125 of type vehicle -(defmethod vehicle-method-125 vehicle ((obj vehicle) (arg0 float)) - (rigid-body-object-method-29 obj arg0) +(defmethod vehicle-method-125 vehicle ((this vehicle) (arg0 float)) + (rigid-body-object-method-29 this arg0) (none) ) ;; definition for method 126 of type vehicle -(defmethod vehicle-method-126 vehicle ((obj vehicle) (arg0 float)) - (rigid-body-object-method-29 obj arg0) +(defmethod vehicle-method-126 vehicle ((this vehicle) (arg0 float)) + (rigid-body-object-method-29 this arg0) (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 f072156b2a..b09bcc68bf 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 @@ -28,105 +28,105 @@ ) ;; definition for method 3 of type vehicle-rider -(defmethod inspect vehicle-rider ((obj vehicle-rider)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-rider ((this vehicle-rider)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Triding-anim: ~D~%" (-> obj riding-anim)) - (format #t "~2Tanim-t: ~f~%" (-> obj anim-t)) - (format #t "~2Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~2Tseat-index: ~D~%" (-> obj seat-index)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Triding-anim: ~D~%" (-> this riding-anim)) + (format #t "~2Tanim-t: ~f~%" (-> this anim-t)) + (format #t "~2Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~2Tseat-index: ~D~%" (-> this seat-index)) (label cfg-4) - obj + this ) ;; definition for method 20 of type vehicle-rider -(defmethod get-trans vehicle-rider ((obj vehicle-rider) (arg0 int)) +(defmethod get-trans vehicle-rider ((this vehicle-rider) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (-> obj root trans) + (-> this root trans) ) ;; definition for method 33 of type vehicle-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-33 vehicle-rider ((obj vehicle-rider)) - (let* ((s4-0 (ppointer->process (-> obj parent))) +(defmethod vehicle-rider-method-33 vehicle-rider ((this vehicle-rider)) + (let* ((s4-0 (ppointer->process (-> this parent))) (s5-0 (if (type? s4-0 vehicle) s4-0 ) ) ) - (logand! (-> obj flags) -5) + (logand! (-> this flags) -5) (if (and s5-0 (nonzero? (vehicle-method-72 s5-0))) - (logior! (-> obj flags) 4) + (logior! (-> this flags) 4) ) - (put-rider-in-seat s5-0 (-> obj seat-index) obj) + (put-rider-in-seat s5-0 (-> this seat-index) this) ) - (set! (-> obj anim-speed) (rand-vu-float-range 0.8 1.2)) + (set! (-> this anim-speed) (rand-vu-float-range 0.8 1.2)) 0 (none) ) ;; definition for method 35 of type vehicle-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-35 vehicle-rider ((obj vehicle-rider)) - (logior! (-> obj draw status) (draw-control-status no-draw)) +(defmethod vehicle-rider-method-35 vehicle-rider ((this vehicle-rider)) + (logior! (-> this draw status) (draw-control-status no-draw)) (put-rider-in-seat - (the-as vehicle (ppointer->process (-> obj parent))) - (-> obj seat-index) + (the-as vehicle (ppointer->process (-> this parent))) + (-> this seat-index) (the-as process-focusable #f) ) - (go (method-of-object obj inactive)) + (go (method-of-object this inactive)) 0 (none) ) ;; definition for method 31 of type vehicle-rider ;; WARN: Return type mismatch int vs none. -(defmethod initialize-collision vehicle-rider ((obj vehicle-rider)) - (stack-size-set! (-> obj main-thread) 16) +(defmethod initialize-collision vehicle-rider ((this vehicle-rider)) + (stack-size-set! (-> this main-thread) 16) (lwide-entity-hack) - (when (not (-> obj entity)) + (when (not (-> this entity)) (format 0 "vehicle-rider::initialize-collision: ERROR, no lwide entity found~%") - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (go process-drawable-art-error "no lwide entity found") ) - (set! (-> obj root) (the-as collide-shape (new 'process 'trsqv))) + (set! (-> this root) (the-as collide-shape (new 'process 'trsqv))) 0 (none) ) ;; definition for method 32 of type vehicle-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-32 vehicle-rider ((obj vehicle-rider) (arg0 traffic-object-spawn-params)) - (logior! (-> obj flags) 1) - (set! (-> obj draw lod-set lod 0 dist) 40960.0) - (set! (-> obj draw lod-set lod 1 dist) 122880.0) - (set! (-> obj draw lod-set lod 2 dist) 245760.0) - (set! (-> obj draw lod-set lod 3 dist) 614400.0) - (set! (-> obj seat-index) 0) - (set! (-> obj anim-t) (* 65536.0 (rand-vu))) - (vehicle-rider-method-33 obj) +(defmethod vehicle-rider-method-32 vehicle-rider ((this vehicle-rider) (arg0 traffic-object-spawn-params)) + (logior! (-> this flags) 1) + (set! (-> this draw lod-set lod 0 dist) 40960.0) + (set! (-> this draw lod-set lod 1 dist) 122880.0) + (set! (-> this draw lod-set lod 2 dist) 245760.0) + (set! (-> this draw lod-set lod 3 dist) 614400.0) + (set! (-> this seat-index) 0) + (set! (-> this anim-t) (* 65536.0 (rand-vu))) + (vehicle-rider-method-33 this) 0 (none) ) ;; definition for method 34 of type vehicle-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-34 vehicle-rider ((obj vehicle-rider)) - (let ((a0-1 (ppointer->process (-> obj parent)))) +(defmethod vehicle-rider-method-34 vehicle-rider ((this vehicle-rider)) + (let ((a0-1 (ppointer->process (-> this parent)))) (when a0-1 - (+! (-> obj anim-t) (* 41870.223 (-> obj anim-speed) (seconds-per-frame))) - (if (< 65536.0 (-> obj anim-t)) - (+! (-> obj anim-t) -65536.0) + (+! (-> this anim-t) (* 41870.223 (-> this anim-speed) (seconds-per-frame))) + (if (< 65536.0 (-> this anim-t)) + (+! (-> this anim-t) -65536.0) ) (let* ((f0-5 (vehicle-method-75 a0-1)) - (f0-9 (+ (* 5.0 (- 1.0 f0-5)) (sin (-> obj anim-t)))) - (gp-1 (-> obj skel root-channel 0)) + (f0-9 (+ (* 5.0 (- 1.0 f0-5)) (sin (-> this anim-t)))) + (gp-1 (-> this skel root-channel 0)) ) (set! (-> gp-1 num-func) num-func-identity) (set! (-> gp-1 frame-num) (ja-aframe f0-9 0)) @@ -260,14 +260,14 @@ ;; definition for method 11 of type vehicle-rider ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! vehicle-rider ((obj vehicle-rider) (arg0 entity-actor)) +(defmethod init-from-entity! vehicle-rider ((this vehicle-rider) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -323,16 +323,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type citizen-norm-rider -(defmethod inspect citizen-norm-rider ((obj citizen-norm-rider)) - (when (not obj) - (set! obj obj) +(defmethod inspect citizen-norm-rider ((this citizen-norm-rider)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-rider inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -343,72 +343,72 @@ 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 ((obj citizen-norm-rider)) - ((the-as (function vehicle-rider none) (find-parent-method citizen-norm-rider 33)) obj) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 32 0) +(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) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 32 0) (cond - ((logtest? (-> obj flags) 4) - (set! (-> obj riding-anim) 5) - (setup-masks (-> obj draw) #x40000 0) + ((logtest? (-> this flags) 4) + (set! (-> this riding-anim) 5) + (setup-masks (-> this draw) #x40000 0) ) (else - (set! (-> obj riding-anim) 4) - (setup-masks (-> obj draw) #x20000 0) + (set! (-> this riding-anim) 4) + (setup-masks (-> this draw) #x20000 0) ) ) (let ((v1-12 (rand-vu-int-count 2))) (cond ((zero? v1-12) - (setup-masks (-> obj draw) 2 0) + (setup-masks (-> this draw) 2 0) ) ((= v1-12 1) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ) ) (let ((v1-18 (rand-vu-int-count 3))) (cond ((zero? v1-18) - (setup-masks (-> obj draw) 8 0) + (setup-masks (-> this draw) 8 0) ) ((= v1-18 1) - (setup-masks (-> obj draw) 512 0) + (setup-masks (-> this draw) 512 0) ) ((= v1-18 2) - (setup-masks (-> obj draw) #x4000 0) + (setup-masks (-> this draw) #x4000 0) ) ) ) (let ((v1-26 (rand-vu-int-count 4))) (cond ((zero? v1-26) - (setup-masks (-> obj draw) 4 0) + (setup-masks (-> this draw) 4 0) ) ((= v1-26 1) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ((= v1-26 2) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ) ) (let ((v1-34 (rand-vu-int-count 3))) (cond ((zero? v1-34) - (setup-masks (-> obj draw) 64 0) + (setup-masks (-> this draw) 64 0) ) ((= v1-34 1) - (setup-masks (-> obj draw) 2048 0) + (setup-masks (-> this draw) 2048 0) ) ((= v1-34 2) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ) ) - (setup-masks (-> obj draw) 16 0) + (setup-masks (-> this draw) 16 0) (if (zero? (rand-vu-int-count 3)) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) 0 (none) @@ -416,16 +416,16 @@ This commonly includes things such as: ;; definition for method 32 of type citizen-norm-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-32 citizen-norm-rider ((obj citizen-norm-rider) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 citizen-norm-rider ((this citizen-norm-rider) (arg0 traffic-object-spawn-params)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-citizen-norm-rider" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj flags) 1) - (set! (-> obj draw lod-set lod 0 dist) 122880.0) - (set! (-> obj draw lod-set lod 1 dist) 286720.0) - (vehicle-rider-method-33 obj) + (logior! (-> this flags) 1) + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 286720.0) + (vehicle-rider-method-33 this) 0 (none) ) @@ -440,16 +440,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type crimson-guard-rider -(defmethod inspect crimson-guard-rider ((obj crimson-guard-rider)) - (when (not obj) - (set! obj obj) +(defmethod inspect crimson-guard-rider ((this crimson-guard-rider)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-rider inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -460,13 +460,13 @@ 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 ((obj crimson-guard-rider)) - ((the-as (function vehicle-rider none) (find-parent-method crimson-guard-rider 33)) obj) - (setup-masks (-> obj draw) 0 28) - (setup-masks (-> obj draw) 3 0) - (if (logtest? (-> obj flags) 4) - (set! (-> obj riding-anim) 36) - (set! (-> obj riding-anim) 35) +(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) + (setup-masks (-> this draw) 0 28) + (setup-masks (-> this draw) 3 0) + (if (logtest? (-> this flags) 4) + (set! (-> this riding-anim) 36) + (set! (-> this riding-anim) 35) ) 0 (none) @@ -474,19 +474,19 @@ This commonly includes things such as: ;; definition for method 32 of type crimson-guard-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-32 crimson-guard-rider ((obj crimson-guard-rider) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 crimson-guard-rider ((this crimson-guard-rider) (arg0 traffic-object-spawn-params)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard-rider" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj flags) 9) - (set! (-> obj draw lod-set lod 0 dist) 122880.0) - (set! (-> obj draw lod-set lod 1 dist) 286720.0) - (vehicle-rider-method-33 obj) + (logior! (-> this flags) 9) + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 286720.0) + (vehicle-rider-method-33 this) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-states_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-states_REF.gc index 44720eeefb..b38776794e 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle-states_REF.gc @@ -11,7 +11,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (rigid-body-object-method-39 self) (go-virtual waiting) ) @@ -51,7 +51,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (vehicle-method-139 self) (logior! (-> self flags) (rigid-body-object-flag riding ai-driving)) (vehicle-method-142 self) @@ -73,7 +73,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (vehicle-method-140 self) (set! (-> self flags) (the-as rigid-body-object-flag @@ -129,7 +129,7 @@ :event vehicle-event-handler :enter (behavior () (set-setting! 'sound-flava #f 31.0 5) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (iterate-prims (-> self root) (lambda ((arg0 collide-shape-prim)) (when (!= (-> arg0 prim-core prim-type) (prim-type mesh)) (logior! (-> arg0 prim-core collide-as) (collide-spec jak)) @@ -180,7 +180,7 @@ (remove-setting! 'sound-flava) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (not *target*) (go-virtual waiting) ) @@ -239,7 +239,7 @@ :event vehicle-event-handler :enter (behavior () (logclear! (-> self flags) (rigid-body-object-flag player-driving)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (vehicle-method-129 self) (set! (-> self crash-level) 3) (vehicle-method-88 self) @@ -249,7 +249,7 @@ ) :trans (behavior () (set! (-> self hit-points) (- (-> self hit-points) (* 0.5 (seconds-per-frame)))) - (if (and (>= (- (current-time) (-> self state-time)) 1) (< (-> self hit-points) -0.25)) + (if (and (time-elapsed? (-> self state-time) 1) (< (-> self hit-points) -0.25)) (go-virtual explode) ) ) @@ -274,12 +274,12 @@ (set! (-> self player-dist2) (vector-vector-distance-squared (-> self root trans) (target-pos 0))) (cond ((logtest? (-> self draw status) (draw-control-status on-screen)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (else - (if (or (>= (- (current-time) (-> self state-time)) (seconds 5)) (let ((f0-2 409600.0)) - (< (* f0-2 f0-2) (-> self camera-dist2)) - ) + (if (or (time-elapsed? (-> self state-time) (seconds 5)) (let ((f0-2 409600.0)) + (< (* f0-2 f0-2) (-> self camera-dist2)) + ) ) (go-virtual die) ) @@ -447,7 +447,7 @@ ) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) :code sleep-code 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 981866b306..a6d974f149 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 @@ -3,14 +3,14 @@ ;; definition for method 9 of type rigid-body-vehicle-constants ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-vehicle-constants-method-9 rigid-body-vehicle-constants ((obj rigid-body-vehicle-constants)) - (set! (-> obj particle-system-2d) *sp-particle-system-2d*) - (set! (-> obj particle-system-3d) *sp-particle-system-3d*) - (set! (-> obj part-quat) *particle-quat*) - (set! (-> obj part-vel) *particle-vel*) - (set! (-> obj part-thruster) (-> *part-id-table* 775)) - (set! (-> obj part-thruster-scale-x) (-> *part-id-table* 775 init-specs 3)) - (set! (-> obj part-thruster-scale-y) (-> *part-id-table* 775 init-specs 4)) +(defmethod rigid-body-vehicle-constants-method-9 rigid-body-vehicle-constants ((this rigid-body-vehicle-constants)) + (set! (-> this particle-system-2d) *sp-particle-system-2d*) + (set! (-> this particle-system-3d) *sp-particle-system-3d*) + (set! (-> this part-quat) *particle-quat*) + (set! (-> this part-vel) *particle-vel*) + (set! (-> this part-thruster) (-> *part-id-table* 775)) + (set! (-> this part-thruster-scale-x) (-> *part-id-table* 775 init-specs 3)) + (set! (-> this part-thruster-scale-y) (-> *part-id-table* 775 init-specs 4)) 0 (none) ) @@ -35,17 +35,17 @@ ) ;; definition for method 3 of type vehicle-hud-request -(defmethod inspect vehicle-hud-request ((obj vehicle-hud-request)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-hud-request ((this vehicle-hud-request)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-hud-request) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Thack-handle-init: ~A~%" (-> obj hack-handle-init)) - (format #t "~1Tpriority: ~f~%" (-> obj priority)) + (format #t "[~8x] ~A~%" this 'vehicle-hud-request) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Thack-handle-init: ~A~%" (-> this hack-handle-init)) + (format #t "~1Tpriority: ~f~%" (-> this priority)) (label cfg-4) - obj + this ) ;; definition of type vehicle-hud-requests @@ -65,23 +65,23 @@ ) ;; definition for method 3 of type vehicle-hud-requests -(defmethod inspect vehicle-hud-requests ((obj vehicle-hud-requests)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-hud-requests ((this vehicle-hud-requests)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-hud-requests) - (format #t "~1Ttime: ~D~%" (-> obj time)) - (format #t "~1Trequests[4] @ #x~X~%" (-> obj requests)) + (format #t "[~8x] ~A~%" this 'vehicle-hud-requests) + (format #t "~1Ttime: ~D~%" (-> this time)) + (format #t "~1Trequests[4] @ #x~X~%" (-> this requests)) (label cfg-4) - obj + this ) ;; definition for method 9 of type vehicle-hud-requests ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-hud-requests-method-9 vehicle-hud-requests ((obj vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-9 vehicle-hud-requests ((this vehicle-hud-requests)) (dotimes (v1-0 4) - (let ((a1-2 (-> obj requests v1-0))) + (let ((a1-2 (-> this requests v1-0))) (set! (-> a1-2 handle) (the-as handle #f)) (set! (-> a1-2 priority) 0.0) ) @@ -91,11 +91,11 @@ ) ;; definition for method 10 of type vehicle-hud-requests -(defmethod vehicle-hud-requests-method-10 vehicle-hud-requests ((obj vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-10 vehicle-hud-requests ((this vehicle-hud-requests)) (let ((v1-0 0)) (let ((f0-0 0.0)) (countdown (a1-0 4) - (let ((a2-2 (-> obj requests a1-0))) + (let ((a2-2 (-> this requests a1-0))) (when (and (handle->process (-> a2-2 handle)) (< f0-0 (-> a2-2 priority))) (set! v1-0 a1-0) (set! f0-0 (-> a2-2 priority)) @@ -103,12 +103,12 @@ ) ) ) - (-> obj requests v1-0) + (-> this requests v1-0) ) ) ;; definition for method 11 of type vehicle-hud-requests -(defmethod vehicle-hud-requests-method-11 vehicle-hud-requests ((obj vehicle-hud-requests)) +(defmethod vehicle-hud-requests-method-11 vehicle-hud-requests ((this vehicle-hud-requests)) (let ((v1-0 0)) (let ((f0-0 (the-as float #x7f800000)) (a1-1 4) @@ -116,7 +116,7 @@ (b! #t cfg-10 :delay (nop!)) (label cfg-1) (+! a1-1 -1) - (let ((a2-2 (-> obj requests a1-1))) + (let ((a2-2 (-> this requests a1-1))) (b! (handle->process (-> a2-2 handle)) cfg-8 :delay (empty-form)) (set! v1-0 a1-1) (set! (-> a2-2 priority) 0.0) @@ -131,7 +131,7 @@ (b! (nonzero? a1-1) cfg-1 :delay (nop!)) ) (label cfg-12) - (-> obj requests v1-0) + (-> this requests v1-0) ) ) @@ -149,38 +149,38 @@ ) ;; definition for method 3 of type vehicle-hud-chooser -(defmethod inspect vehicle-hud-chooser ((obj vehicle-hud-chooser)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-hud-chooser ((this vehicle-hud-chooser)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vehicle-hud-chooser) - (format #t "~1Tcur: #~%" (-> obj cur)) - (format #t "~1Tlast: #~%" (-> obj last)) + (format #t "[~8x] ~A~%" this 'vehicle-hud-chooser) + (format #t "~1Tcur: #~%" (-> this cur)) + (format #t "~1Tlast: #~%" (-> this last)) (label cfg-4) - obj + this ) ;; definition for method 9 of type vehicle-hud-chooser -(defmethod vehicle-hud-chooser-method-9 vehicle-hud-chooser ((obj vehicle-hud-chooser) (arg0 handle) (arg1 float)) +(defmethod vehicle-hud-chooser-method-9 vehicle-hud-chooser ((this vehicle-hud-chooser) (arg0 handle) (arg1 float)) (let ((s3-0 (current-time))) - (when (!= s3-0 (-> obj cur time)) - (if (zero? (-> obj cur time)) - (vehicle-hud-requests-method-9 (-> obj cur)) + (when (!= s3-0 (-> this cur time)) + (if (zero? (-> this cur time)) + (vehicle-hud-requests-method-9 (-> this cur)) ) - (mem-copy! (the-as pointer (-> obj last)) (the-as pointer (-> obj cur)) 72) - (set! (-> obj cur time) s3-0) - (vehicle-hud-requests-method-9 (-> obj cur)) + (mem-copy! (the-as pointer (-> this last)) (the-as pointer (-> this cur)) 72) + (set! (-> this cur time) s3-0) + (vehicle-hud-requests-method-9 (-> this cur)) ) ) - (let ((v1-10 (vehicle-hud-requests-method-11 (-> obj cur)))) + (let ((v1-10 (vehicle-hud-requests-method-11 (-> this cur)))) (when (< (-> v1-10 priority) arg1) (set! (-> v1-10 handle) arg0) (set! (-> v1-10 priority) arg1) ) ) (let ((s4-1 #f)) - (let ((v1-12 (vehicle-hud-requests-method-10 (-> obj last)))) + (let ((v1-12 (vehicle-hud-requests-method-10 (-> this last)))) (if (and (handle->process arg0) (= (-> v1-12 handle) arg0)) (set! s4-1 #t) ) @@ -196,60 +196,60 @@ (define *pilot-edge-grab-info* (new 'static 'pilot-edge-grab-info)) ;; definition for method 10 of type vehicle -(defmethod deactivate vehicle ((obj vehicle)) - (vehicle-method-110 obj) - ((the-as (function rigid-body-object none) (find-parent-method vehicle 10)) obj) +(defmethod deactivate vehicle ((this vehicle)) + (vehicle-method-110 this) + ((the-as (function rigid-body-object none) (find-parent-method vehicle 10)) this) (none) ) ;; definition for method 11 of type vehicle ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! vehicle ((obj vehicle) (arg0 entity-actor)) +(defmethod init-from-entity! vehicle ((this vehicle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) ;; definition for method 35 of type vehicle -(defmethod rigid-body-object-method-35 vehicle ((obj vehicle)) +(defmethod rigid-body-object-method-35 vehicle ((this vehicle)) (let ((t9-0 (method-of-type rigid-body-object rigid-body-object-method-35))) - (t9-0 obj) + (t9-0 this) ) (cond - ((logtest? (-> obj info flags) 2048) - (set! (-> obj rbody state force-callback) (method-of-object obj vehicle-method-125)) + ((logtest? (-> this info flags) 2048) + (set! (-> this rbody state force-callback) (method-of-object this vehicle-method-125)) ) - ((logtest? (-> obj info flags) 4096) - (set! (-> obj rbody state force-callback) (method-of-object obj vehicle-method-126)) + ((logtest? (-> this info flags) 4096) + (set! (-> this rbody state force-callback) (method-of-object this vehicle-method-126)) ) ) - (rigid-body-vehicle-constants-method-9 (-> obj info)) + (rigid-body-vehicle-constants-method-9 (-> this info)) (none) ) ;; definition for method 133 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod check-player-get-on vehicle ((obj vehicle)) +(defmethod check-player-get-on vehicle ((this vehicle)) (with-pp - (let ((f0-0 (-> obj player-dist2)) + (let ((f0-0 (-> this player-dist2)) (f1-0 102400.0) ) (when (< f0-0 (* f1-0 f1-0)) (let ((s5-0 (new 'stack-no-clear 'mystery-vehicle-type))) - (set! (-> s5-0 floats 4) (+ 8192.0 (-> obj root root-prim local-sphere w))) - (if (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) + (set! (-> s5-0 floats 4) (+ 8192.0 (-> this root root-prim local-sphere w))) + (if (logtest? (rigid-body-object-flag ai-driving) (-> this flags)) (set! (-> s5-0 floats 4) (* 1.5 (-> s5-0 floats 4))) ) (set! (-> s5-0 matrices 0 vector 1 quad) (-> (target-pos 0) quad)) (+! (-> s5-0 matrices 0 vector 1 y) 8192.0) (let* ((v1-14 (-> s5-0 matrices 1)) - (a3-0 (-> obj node-list data 0 bone transform)) + (a3-0 (-> this node-list data 0 bone transform)) (a0-5 (-> a3-0 quad 0)) (a1-0 (-> a3-0 quad 1)) (a2-0 (-> a3-0 quad 2)) @@ -271,7 +271,7 @@ This commonly includes things such as: *target* (not (focus-test? *target* dead grabbed in-head under-water pole flut tube pilot dark)) (or (not (focus-test? *target* edge-grab)) - (logtest? (-> obj flags) (rigid-body-object-flag player-edge-grabbing)) + (logtest? (-> this flags) (rigid-body-object-flag player-edge-grabbing)) ) (-> *setting-control* user-current pilot) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -281,7 +281,7 @@ This commonly includes things such as: (set! (-> a1-2 param 0) (the-as uint 'mode)) (let ((v1-37 (send-event-function *target* a1-2))) (and (or (= v1-37 #f) (= v1-37 'board)) - (or (logtest? (-> obj flags) (rigid-body-object-flag waiting-for-player)) + (or (logtest? (-> this flags) (rigid-body-object-flag waiting-for-player)) (-> *setting-control* user-current vehicle-hijacking) ) ) @@ -292,9 +292,9 @@ This commonly includes things such as: (s4-1 #f) (s3-0 #f) ) - (let ((a2-2 (get-best-seat-for-vehicle obj (-> s5-0 matrices 0 vector 1) 1 0))) + (let ((a2-2 (get-best-seat-for-vehicle this (-> s5-0 matrices 0 vector 1) 1 0))) (when (!= a2-2 -1) - (compute-seat-position obj (-> s5-0 matrices 0 vector 2) a2-2) + (compute-seat-position this (-> s5-0 matrices 0 vector 2) a2-2) (vector+float*! (-> s5-0 matrices 0 vector 2) (-> s5-0 matrices 0 vector 2) @@ -331,7 +331,7 @@ This commonly includes things such as: obstacle-for-jak ) ) - (set! (-> v1-54 ignore-process0) obj) + (set! (-> v1-54 ignore-process0) this) (set! (-> v1-54 ignore-process1) #f) (set! (-> v1-54 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-54 action-mask) (collide-action solid)) @@ -341,11 +341,11 @@ This commonly includes things such as: ) ) (when s2-0 - (when (and (or (< -14336.0 (-> s5-0 floats 2)) (logtest? (-> obj flags) (rigid-body-object-flag player-edge-grabbing))) - (not (logtest? (rigid-body-object-flag no-hijack) (-> obj flags))) + (when (and (or (< -14336.0 (-> s5-0 floats 2)) (logtest? (-> this flags) (rigid-body-object-flag player-edge-grabbing))) + (not (logtest? (rigid-body-object-flag no-hijack) (-> this flags))) ) (set! s4-1 #t) - (set! (-> s5-0 floats 3) (* (-> obj hit-points) (/ 40960.0 (sqrtf (-> s5-0 floats 1))))) + (set! (-> s5-0 floats 3) (* (-> this hit-points) (/ 40960.0 (sqrtf (-> s5-0 floats 1))))) ) (when (and (not s4-1) (and (< (-> s5-0 floats 2) -8192.0) (not (logtest? (-> *target* focus-status) (focus-status edge-grab)))) @@ -353,8 +353,8 @@ This commonly includes things such as: (matrix-4x4-inverse! (-> s5-0 matrices 2) (-> s5-0 matrices 1)) (vector-matrix*! (the-as vector (-> s5-0 matrices)) (-> s5-0 matrices 0 vector 1) (-> s5-0 matrices 2)) (set! (-> s5-0 floats 0) 81920.0) - (dotimes (s2-1 (-> obj info grab-rail-count)) - (let ((s1-0 (-> obj info grab-rail-array s2-1))) + (dotimes (s2-1 (-> this info grab-rail-count)) + (let ((s1-0 (-> this info grab-rail-array s2-1))) (vector-! (-> s5-0 matrices 0 trans) (the-as vector (-> s5-0 matrices)) (the-as vector (-> s1-0 local-pos))) (when #t (let ((f30-0 (vector-segment-distance-point! @@ -371,7 +371,7 @@ This commonly includes things such as: (vector-! (-> s5-0 vectors 1) (-> s1-0 local-pos 1) (the-as vector (-> s1-0 local-pos))) (vector-normalize! (-> s5-0 vectors 1) 1.0) (set! s3-0 #t) - (set! (-> s5-0 floats 3) (* (-> obj hit-points) (/ 40960.0 f30-0))) + (set! (-> s5-0 floats 3) (* (-> this hit-points) (/ 40960.0 f30-0))) ) ) ) @@ -380,8 +380,8 @@ This commonly includes things such as: ) ) (set! s3-0 (or s4-1 s3-0)) - (when (and s3-0 (and (vehicle-hud-chooser-method-9 *vehicle-hud-chooser* (process->handle obj) (-> s5-0 floats 3)) - (can-display-query? obj (the-as string #f) (/ 1.0 (-> s5-0 floats 3))) + (when (and s3-0 (and (vehicle-hud-chooser-method-9 *vehicle-hud-chooser* (process->handle this) (-> s5-0 floats 3)) + (can-display-query? this (the-as string #f) (/ 1.0 (-> s5-0 floats 3))) ) ) (let ((s3-1 @@ -409,14 +409,14 @@ This commonly includes things such as: (when (cpad-pressed? 0 triangle) (cond (s4-1 - (when (send-event *target* 'change-mode 'pilot obj 0 #f) - (logior! (-> obj flags) (rigid-body-object-flag player-driving)) - (logclear! (-> obj flags) (rigid-body-object-flag ai-driving)) - (vehicle-method-87 obj) + (when (send-event *target* 'change-mode 'pilot this 0 #f) + (logior! (-> this flags) (rigid-body-object-flag player-driving)) + (logclear! (-> this flags) (rigid-body-object-flag ai-driving)) + (vehicle-method-87 this) ) ) (else - (set! (-> s5-0 handles 0) (process->handle obj)) + (set! (-> s5-0 handles 0) (process->handle this)) (mem-copy! (the-as pointer *pilot-edge-grab-info*) (the-as pointer (-> s5-0 vectors)) 40) (if (send-event *target* 'pilot-edge-grab *pilot-edge-grab-info*) (format 0 "vehicle::check-player-get-on: (send-event *target* 'pilot-edge-grab self)~%") @@ -433,14 +433,14 @@ This commonly includes things such as: ) ) (cond - ((and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) *target* (!= (-> obj crash-level) 3)) + ((and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) *target* (!= (-> this crash-level) 3)) (when (focus-test? *target* pilot-riding) - (vehicle-controller-method-11 (-> obj controller)) - (vehicle-method-138 obj) + (vehicle-controller-method-11 (-> this controller)) + (vehicle-method-138 this) ) ) (else - (vehicle-method-88 obj) + (vehicle-method-88 this) ) ) 0 @@ -450,21 +450,21 @@ This commonly includes things such as: ;; definition for method 110 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-110 vehicle ((obj vehicle)) - (sound-stop (-> obj scrape-sound-id)) - (sound-stop (-> obj engine-sound-id)) - (sound-stop (-> obj thrust-sound-id)) - (set! (-> obj scrape-sound-envelope) 0.0) - (set! (-> obj engine-sound-envelope) 0.0) +(defmethod vehicle-method-110 vehicle ((this vehicle)) + (sound-stop (-> this scrape-sound-id)) + (sound-stop (-> this engine-sound-id)) + (sound-stop (-> this thrust-sound-id)) + (set! (-> this scrape-sound-envelope) 0.0) + (set! (-> this engine-sound-envelope) 0.0) 0 (none) ) ;; definition for method 62 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-62 vehicle ((obj vehicle) (arg0 float)) - (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> obj flags))) - (set! (-> obj controls steering) (fmax -1.0 (fmin 1.0 arg0))) +(defmethod vehicle-method-62 vehicle ((this vehicle) (arg0 float)) + (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> this flags))) + (set! (-> this controls steering) (fmax -1.0 (fmin 1.0 arg0))) ) 0 (none) @@ -472,9 +472,9 @@ This commonly includes things such as: ;; definition for method 63 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-63 vehicle ((obj vehicle) (arg0 float)) - (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> obj flags))) - (set! (-> obj controls throttle) (fmax -0.5 (fmin 1.0 arg0))) +(defmethod vehicle-method-63 vehicle ((this vehicle) (arg0 float)) + (if (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> this flags))) + (set! (-> this controls throttle) (fmax -0.5 (fmin 1.0 arg0))) ) 0 (none) @@ -482,13 +482,13 @@ This commonly includes things such as: ;; definition for method 98 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-98 vehicle ((obj vehicle) (arg0 float)) - (let* ((v1-1 (-> obj rbody state lin-velocity)) +(defmethod vehicle-method-98 vehicle ((this vehicle) (arg0 float)) + (let* ((v1-1 (-> this rbody state lin-velocity)) (f0-4 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z))))) (f0-6 (/ (- arg0 f0-4) arg0)) (f1-6 (* 0.005 f0-6)) ) - (set! (-> obj controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> obj controls throttle) f1-6)))) + (set! (-> this controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) f1-6)))) ) 0 (none) @@ -496,13 +496,13 @@ This commonly includes things such as: ;; definition for method 65 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod start-jump vehicle ((obj vehicle)) - (when (logtest? (-> obj info flags) 16) - (when (not (logtest? (rigid-body-object-flag jump-sound) (-> obj flags))) - (logior! (-> obj flags) (rigid-body-object-flag jump-sound)) +(defmethod start-jump vehicle ((this vehicle)) + (when (logtest? (-> this info flags) 16) + (when (not (logtest? (rigid-body-object-flag jump-sound) (-> this flags))) + (logior! (-> this flags) (rigid-body-object-flag jump-sound)) (sound-play "bike-hop") ) - (logior! (-> obj flags) (rigid-body-object-flag jump)) + (logior! (-> this flags) (rigid-body-object-flag jump)) ) 0 (none) @@ -510,45 +510,45 @@ This commonly includes things such as: ;; definition for method 66 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-66 vehicle ((obj vehicle)) +(defmethod vehicle-method-66 vehicle ((this vehicle)) 0 (none) ) ;; definition for method 67 of type vehicle -(defmethod get-seat-count vehicle ((obj vehicle)) - (-> obj info seat-count) +(defmethod get-seat-count vehicle ((this vehicle)) + (-> this info seat-count) ) ;; definition for method 68 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod compute-seat-position vehicle ((obj vehicle) (arg0 vector) (arg1 int)) +(defmethod compute-seat-position vehicle ((this vehicle) (arg0 vector) (arg1 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (set! (-> v1-0 quad) (-> obj info seat-array arg1 position quad)) + (set! (-> v1-0 quad) (-> this info seat-array arg1 position quad)) (set! (-> v1-0 w) 1.0) - (vector-matrix*! arg0 v1-0 (-> obj node-list data 0 bone transform)) + (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) ) 0 (none) ) ;; definition for method 69 of type vehicle -(defmethod get-rider-in-seat vehicle ((obj vehicle) (arg0 int)) +(defmethod get-rider-in-seat vehicle ((this vehicle) (arg0 int)) (let ((v0-0 (the-as process #f))) - (if (< arg0 (-> obj info seat-count)) - (set! v0-0 (handle->process (-> obj rider-array arg0))) + (if (< arg0 (-> this info seat-count)) + (set! v0-0 (handle->process (-> this rider-array arg0))) ) v0-0 ) ) ;; definition for method 70 of type vehicle -(defmethod vehicle-method-70 vehicle ((obj vehicle)) +(defmethod vehicle-method-70 vehicle ((this vehicle)) (let ((gp-0 (the-as process #f))) - (countdown (s4-0 (-> obj info seat-count)) - (when (logtest? (-> obj info seat-array s4-0 flags) 1) - (let ((v1-7 (get-rider-in-seat obj s4-0))) + (countdown (s4-0 (-> this info seat-count)) + (when (logtest? (-> this info seat-array s4-0 flags) 1) + (let ((v1-7 (get-rider-in-seat this s4-0))) (if v1-7 (set! gp-0 v1-7) ) @@ -560,29 +560,29 @@ This commonly includes things such as: ) ;; definition for method 73 of type vehicle -(defmethod get-best-seat-for-vehicle vehicle ((obj vehicle) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod get-best-seat-for-vehicle vehicle ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) (let ((gp-0 -1)) (let ((f30-0 (the-as float #x7f800000)) (s1-0 (new 'stack-no-clear 'vector)) ) - (countdown (s0-0 (-> obj info seat-count)) - (when (logtest? arg1 (-> obj info seat-array s0-0 flags)) + (countdown (s0-0 (-> this info seat-count)) + (when (logtest? arg1 (-> this info seat-array s0-0 flags)) (let ((v1-7 arg2)) (when (cond ((zero? v1-7) #t ) ((= v1-7 1) - (not (get-rider-in-seat obj s0-0)) + (not (get-rider-in-seat this s0-0)) ) ((= v1-7 2) - (get-rider-in-seat obj s0-0) + (get-rider-in-seat this s0-0) ) (else #f ) ) - (compute-seat-position obj s1-0 s0-0) + (compute-seat-position this s1-0 s0-0) (let ((f0-0 (vector-vector-distance-squared arg0 s1-0))) (when (< f0-0 f30-0) (set! f30-0 f0-0) @@ -600,11 +600,11 @@ This commonly includes things such as: ;; definition for method 74 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod remove-rider vehicle ((obj vehicle) (arg0 process)) - (let ((v1-1 (-> obj info seat-count))) +(defmethod remove-rider vehicle ((this vehicle) (arg0 process)) + (let ((v1-1 (-> this info seat-count))) (dotimes (a2-0 v1-1) - (if (= arg0 (handle->process (-> obj rider-array a2-0))) - (set! (-> obj rider-array a2-0) (the-as handle #f)) + (if (= arg0 (handle->process (-> this rider-array a2-0))) + (set! (-> this rider-array a2-0) (the-as handle #f)) ) ) ) @@ -614,9 +614,9 @@ This commonly includes things such as: ;; definition for method 71 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod put-rider-in-seat vehicle ((obj vehicle) (arg0 int) (arg1 process-focusable)) - (if (< arg0 (-> obj info seat-count)) - (set! (-> obj rider-array arg0) (process->handle arg1)) +(defmethod put-rider-in-seat vehicle ((this vehicle) (arg0 int) (arg1 process-focusable)) + (if (< arg0 (-> this info seat-count)) + (set! (-> this rider-array arg0) (process->handle arg1)) ) 0 (none) @@ -624,45 +624,45 @@ This commonly includes things such as: ;; definition for method 117 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-117 vehicle ((obj vehicle) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 vehicle ((this vehicle) (arg0 vector) (arg1 int) (arg2 int)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector+! v1-0 (-> obj info seat-array arg1 position) (-> obj info rider-hand-offset arg2)) - (vector-matrix*! arg0 v1-0 (-> obj node-list data 0 bone transform)) + (vector+! v1-0 (-> this info seat-array arg1 position) (-> this info rider-hand-offset arg2)) + (vector-matrix*! arg0 v1-0 (-> this node-list data 0 bone transform)) ) 0 (none) ) ;; definition for method 72 of type vehicle -(defmethod vehicle-method-72 vehicle ((obj vehicle)) - (-> obj info rider-stance) +(defmethod vehicle-method-72 vehicle ((this vehicle)) + (-> this info rider-stance) ) ;; definition for method 75 of type vehicle -(defmethod vehicle-method-75 vehicle ((obj vehicle)) - (-> obj controls steering) +(defmethod vehicle-method-75 vehicle ((this vehicle)) + (-> this controls steering) ) ;; definition for method 115 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-115 vehicle ((obj vehicle) (arg0 vector)) - (set! (-> arg0 quad) (-> obj lin-acceleration quad)) +(defmethod vehicle-method-115 vehicle ((this vehicle) (arg0 vector)) + (set! (-> arg0 quad) (-> this lin-acceleration quad)) 0 (none) ) ;; definition for method 116 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-116 vehicle ((obj vehicle) (arg0 (pointer vehicle-controls))) - (mem-copy! arg0 (the-as pointer (-> obj controls)) 16) +(defmethod vehicle-method-116 vehicle ((this vehicle) (arg0 (pointer vehicle-controls))) + (mem-copy! arg0 (the-as pointer (-> this controls)) 16) 0 (none) ) ;; definition for method 44 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod apply-damage vehicle ((obj vehicle) (arg0 float) (arg1 rigid-body-impact)) +(defmethod apply-damage vehicle ((this vehicle) (arg0 float) (arg1 rigid-body-impact)) (cond (#f ) @@ -673,16 +673,16 @@ This commonly includes things such as: (format #t "vehicle::apply-damage: hit melt (damage ~f)~%" arg0) ) ) - (set! (-> obj hit-points) (- (-> obj hit-points) (* arg0 (-> obj damage-factor)))) + (set! (-> this hit-points) (- (-> this hit-points) (* arg0 (-> this damage-factor)))) (let ((s4-1 (-> arg1 prim-id)) (s3-0 0) ) (while (nonzero? s4-1) - (when (and (logtest? s4-1 1) (< s3-0 (-> obj info section-count))) - (let ((v1-14 (-> obj section-array s3-0))) - (+! (-> v1-14 damage) (* 4.0 (-> obj damage-factor) arg0)) + (when (and (logtest? s4-1 1) (< s3-0 (-> this info section-count))) + (let ((v1-14 (-> this section-array s3-0))) + (+! (-> v1-14 damage) (* 4.0 (-> this damage-factor) arg0)) ) - (vehicle-method-118 obj s3-0) + (vehicle-method-118 this s3-0) ) (set! s4-1 (shr s4-1 1)) (+! s3-0 1) @@ -696,9 +696,9 @@ This commonly includes things such as: ;; definition for method 118 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-118 vehicle ((obj vehicle) (arg0 int)) - (let* ((v1-2 (-> obj section-array arg0)) - (s4-0 (-> obj info section-array arg0)) +(defmethod vehicle-method-118 vehicle ((this vehicle) (arg0 int)) + (let* ((v1-2 (-> this section-array arg0)) + (s4-0 (-> this info section-array arg0)) (s5-1 (max 0 @@ -712,17 +712,17 @@ This commonly includes things such as: (set! a2-0 (logior a2-0 (-> s4-0 damage-seg-array v1-6))) ) ) - (setup-masks (-> obj draw) 0 a2-0) + (setup-masks (-> this draw) 0 a2-0) ) - (setup-masks (-> obj draw) (the-as int (-> s4-0 damage-seg-array s5-1)) 0) + (setup-masks (-> this draw) (the-as int (-> s4-0 damage-seg-array s5-1)) 0) (when (> s5-1 0) - (if (not (logtest? (rigid-body-object-flag lights-dead) (-> obj flags))) + (if (not (logtest? (rigid-body-object-flag lights-dead) (-> this flags))) (sound-play "headlight-pop") ) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-dead) (-> obj flags))) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-dead) (-> this flags))) ) - (vehicle-method-132 obj) + (vehicle-method-132 this) ) ) 0 @@ -732,67 +732,67 @@ This commonly includes things such as: ;; definition for method 82 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-82 vehicle ((obj vehicle)) - (set! (-> obj flags) (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag - disturbed - damaged - dead - player-touching - player-edge-grabbing - player-standing-on - persistent - in-air - riding - player-driving - waiting-for-player - ignition - turbo-boost - reverse-gear - slide - hard-turn - jump - ai-driving - flight-level-transition - alert - in-pursuit - target-in-sight - rammed-target - lights-on - lights-update - lights-dead - ) - ) - ) +(defmethod vehicle-method-82 vehicle ((this vehicle)) + (set! (-> this flags) (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag + disturbed + damaged + dead + player-touching + player-edge-grabbing + player-standing-on + persistent + in-air + riding + player-driving + waiting-for-player + ignition + turbo-boost + reverse-gear + slide + hard-turn + jump + ai-driving + flight-level-transition + alert + in-pursuit + target-in-sight + rammed-target + lights-on + lights-update + lights-dead + ) + ) + ) ) - (set! (-> obj vehicle-jkhn1b23jn1) (the-as int (-> obj flags))) - (logior! (-> obj rbody state flags) (rigid-body-flag active)) - (logclear! (-> obj focus-status) (focus-status disable dead inactive)) - (rigid-body-object-method-35 obj) - (rigid-body-object-method-39 obj) - (vehicle-method-103 obj) - (set! (-> obj hit-points) 1.0) - (set! (-> obj damage-factor) (-> obj info damage-factor)) - (set! (-> obj crash-level) 0) - (set! (-> obj power-fluctuation-factor) 0.02) - (set! (-> obj power-level) 1.0) - (set! (-> obj flight-level-index) 0) - (let ((a1-0 (-> obj root trans))) - (set! (-> obj flight-level) (get-height-at-point *traffic-height-map* a1-0)) + (set! (-> this vehicle-jkhn1b23jn1) (the-as int (-> this flags))) + (logior! (-> this rbody state flags) (rigid-body-flag active)) + (logclear! (-> this focus-status) (focus-status disable dead inactive)) + (rigid-body-object-method-35 this) + (rigid-body-object-method-39 this) + (vehicle-method-103 this) + (set! (-> this hit-points) 1.0) + (set! (-> this damage-factor) (-> this info damage-factor)) + (set! (-> this crash-level) 0) + (set! (-> this power-fluctuation-factor) 0.02) + (set! (-> this power-level) 1.0) + (set! (-> this flight-level-index) 0) + (let ((a1-0 (-> this root trans))) + (set! (-> this flight-level) (get-height-at-point *traffic-height-map* a1-0)) ) - (set! (-> obj lights-factor) 0.0) - (let ((a0-8 (-> obj info color-option-select))) - (set! (-> obj draw color-mult quad) (-> obj info color-option-array a0-8 quad)) + (set! (-> this lights-factor) 0.0) + (let ((a0-8 (-> this info color-option-select))) + (set! (-> this draw color-mult quad) (-> this info color-option-array a0-8 quad)) ) - (+! (-> obj info color-option-select) 1) - (when (>= (-> obj info color-option-select) (-> obj info color-option-count)) - (set! (-> obj info color-option-select) 0) + (+! (-> this info color-option-select) 1) + (when (>= (-> this info color-option-select) (-> this info color-option-count)) + (set! (-> this info color-option-select) 0) 0 ) - (dotimes (s5-0 (-> obj info section-count)) - (let ((v1-34 (-> obj section-array s5-0))) + (dotimes (s5-0 (-> this info section-count)) + (let ((v1-34 (-> this section-array s5-0))) (set! (-> v1-34 damage) 0.0) ) - (vehicle-method-118 obj s5-0) + (vehicle-method-118 this s5-0) ) 0 (none) @@ -800,15 +800,15 @@ This commonly includes things such as: ;; definition for method 101 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-101 vehicle ((obj vehicle)) - (set! (-> obj hit-points) 1.0) +(defmethod vehicle-method-101 vehicle ((this vehicle)) + (set! (-> this hit-points) 1.0) 0 (none) ) ;; definition for method 134 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-134 vehicle ((obj vehicle) (arg0 process)) +(defmethod vehicle-method-134 vehicle ((this vehicle) (arg0 process)) "Stubbed" 0 (none) @@ -816,22 +816,22 @@ This commonly includes things such as: ;; definition for method 76 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-76 vehicle ((obj vehicle) (arg0 int) (arg1 uint)) - (when (< (-> obj crash-level) arg0) - (set! (-> obj crash-level) arg0) - (set! (-> obj crash-duration) arg1) - (set! (-> obj crash-time) (current-time)) - (set! (-> obj force-scale) 0.0) - (when (>= (-> obj crash-level) 2) +(defmethod vehicle-method-76 vehicle ((this vehicle) (arg0 int) (arg1 uint)) + (when (< (-> this crash-level) arg0) + (set! (-> this crash-level) arg0) + (set! (-> this crash-duration) arg1) + (set-time! (-> this crash-time)) + (set! (-> this force-scale) 0.0) + (when (>= (-> this crash-level) 2) (sound-play "bike-engine-off") - (vehicle-method-83 obj) + (vehicle-method-83 this) ) ) - (when (and (>= 0.0 (-> obj hit-points)) (!= (-> obj crash-level) 3)) - (logior! (-> obj flags) (rigid-body-object-flag dead)) - (set! (-> obj crash-level) 3) - (set! (-> obj crash-duration) (the-as uint 1500)) - (set! (-> obj crash-time) (current-time)) + (when (and (>= 0.0 (-> this hit-points)) (!= (-> this crash-level) 3)) + (logior! (-> this flags) (rigid-body-object-flag dead)) + (set! (-> this crash-level) 3) + (set! (-> this crash-duration) (the-as uint 1500)) + (set-time! (-> this crash-time)) ) 0 (none) @@ -839,41 +839,41 @@ This commonly includes things such as: ;; definition for method 77 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-77 vehicle ((obj vehicle)) - (set! (-> obj crash-level) 0) +(defmethod vehicle-method-77 vehicle ((this vehicle)) + (set! (-> this crash-level) 0) 0 (none) ) ;; definition for method 78 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-78 vehicle ((obj vehicle) (arg0 int)) - (set! (-> obj flight-level-index-prev) (-> obj flight-level-index)) - (set! (-> obj flight-level-index) arg0) - (logior! (-> obj flags) (rigid-body-object-flag flight-level-transition camera-rapid-track-mode)) - (logclear! (-> obj flags) (rigid-body-object-flag flight-level-transition-ending)) - (set! (-> obj transition-time) (current-time)) - (vehicle-method-91 obj) +(defmethod vehicle-method-78 vehicle ((this vehicle) (arg0 int)) + (set! (-> this flight-level-index-prev) (-> this flight-level-index)) + (set! (-> this flight-level-index) arg0) + (logior! (-> this flags) (rigid-body-object-flag flight-level-transition camera-rapid-track-mode)) + (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) + (set-time! (-> this transition-time)) + (vehicle-method-91 this) 0 (none) ) ;; definition for method 79 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-79 vehicle ((obj vehicle)) - (logclear! (-> obj flags) (rigid-body-object-flag flight-level-transition)) - (logior! (-> obj flags) (rigid-body-object-flag flight-level-transition-ending)) - (set! (-> obj transition-end-time) (current-time)) +(defmethod vehicle-method-79 vehicle ((this vehicle)) + (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition)) + (logior! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) + (set-time! (-> this transition-end-time)) 0 (none) ) ;; definition for method 131 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-131 vehicle ((obj vehicle)) - (if (not (logtest? (rigid-body-object-flag lights-dead) (-> obj flags))) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-on lights-update) (-> obj flags))) +(defmethod vehicle-method-131 vehicle ((this vehicle)) + (if (not (logtest? (rigid-body-object-flag lights-dead) (-> this flags))) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-on lights-update) (-> this flags))) ) ) 0 @@ -882,12 +882,12 @@ This commonly includes things such as: ;; definition for method 132 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-132 vehicle ((obj vehicle)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag lights-on))) +(defmethod vehicle-method-132 vehicle ((this vehicle)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag lights-on))) ) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-update) (-> obj flags))) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag lights-update) (-> this flags))) ) 0 (none) @@ -896,18 +896,18 @@ This commonly includes things such as: ;; definition for method 139 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-139 vehicle ((obj vehicle)) - (when (not (logtest? (rigid-body-object-flag ignition) (-> obj flags))) - (logior! (-> obj flags) (rigid-body-object-flag ignition)) +(defmethod vehicle-method-139 vehicle ((this vehicle)) + (when (not (logtest? (rigid-body-object-flag ignition) (-> this flags))) + (logior! (-> this flags) (rigid-body-object-flag ignition)) (sound-play "vehicl-ignition") - (let ((s5-1 (-> obj node-list data 0 bone transform)) + (let ((s5-1 (-> this node-list data 0 bone transform)) (s4-1 (new 'stack-no-clear 'merc-matrix)) ) (set-vector! (-> s4-1 vector 2) 0.0 1.0 0.0 1.0) (mem-copy! (the-as pointer (-> s4-1 vector 4)) (the-as pointer s5-1) 64) (dotimes (s3-0 2) - (vector-matrix*! (the-as vector (-> s4-1 vector)) (-> obj info exhaust-local-pos s3-0) s5-1) - (vector-rotate*! (-> s4-1 vector 1) (-> obj info exhaust-local-dir s3-0) s5-1) + (vector-matrix*! (the-as vector (-> s4-1 vector)) (-> this info exhaust-local-pos s3-0) s5-1) + (vector-rotate*! (-> s4-1 vector 1) (-> this info exhaust-local-dir s3-0) s5-1) (vector-cross! (-> s4-1 vector 3) (-> s4-1 vector 1) (-> s4-1 vector 2)) (vector-normalize! (-> s4-1 vector 3) 1.0) (vector-cross! (-> s4-1 vector 6) (-> s4-1 vector 3) (-> s4-1 vector 1)) @@ -935,9 +935,9 @@ This commonly includes things such as: ;; definition for method 140 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-140 vehicle ((obj vehicle)) - (if (logtest? (rigid-body-object-flag ignition) (-> obj flags)) - (logclear! (-> obj flags) (rigid-body-object-flag ignition)) +(defmethod vehicle-method-140 vehicle ((this vehicle)) + (if (logtest? (rigid-body-object-flag ignition) (-> this flags)) + (logclear! (-> this flags) (rigid-body-object-flag ignition)) ) 0 (none) @@ -945,11 +945,11 @@ This commonly includes things such as: ;; definition for method 141 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-141 vehicle ((obj vehicle)) - (let ((a0-2 (find-nearest-nav-mesh (-> obj root trans) (the-as float #x7f800000)))) +(defmethod vehicle-method-141 vehicle ((this vehicle)) + (let ((a0-2 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) (when a0-2 - (add-process-drawable-to-navmesh a0-2 obj #t) - (logclear! (-> obj nav flags) (nav-control-flag output-sphere-hash)) + (add-process-drawable-to-navmesh a0-2 this #t) + (logclear! (-> this nav flags) (nav-control-flag output-sphere-hash)) ) ) 0 @@ -958,11 +958,11 @@ This commonly includes things such as: ;; definition for method 142 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-142 vehicle ((obj vehicle)) - (let ((v1-0 (-> obj nav))) +(defmethod vehicle-method-142 vehicle ((this vehicle)) + (let ((v1-0 (-> this nav))) (when v1-0 - (remove-process-drawable (-> v1-0 state mesh) obj) - (set! (-> obj nav) #f) + (remove-process-drawable (-> v1-0 state mesh) this) + (set! (-> this nav) #f) ) ) 0 @@ -971,37 +971,37 @@ This commonly includes things such as: ;; definition for method 143 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-143 vehicle ((obj vehicle)) - (let ((v1-2 (or (logtest? (-> obj flags) (rigid-body-object-flag dead waiting-for-player)) - (and (logtest? (rigid-body-object-flag player-driving ai-driving) (-> obj flags)) - (not (logtest? (-> obj flags) (rigid-body-object-flag on-flight-level))) +(defmethod vehicle-method-143 vehicle ((this vehicle)) + (let ((v1-2 (or (logtest? (-> this flags) (rigid-body-object-flag dead waiting-for-player)) + (and (logtest? (rigid-body-object-flag player-driving ai-driving) (-> this flags)) + (not (logtest? (-> this flags) (rigid-body-object-flag on-flight-level))) ) ) ) - (s5-0 (-> obj nav)) + (s5-0 (-> this nav)) ) (cond (v1-2 (cond (s5-0 - (do-navigation-to-destination (-> s5-0 state) (-> obj root trans)) + (do-navigation-to-destination (-> s5-0 state) (-> this root trans)) (when (not (logtest? (-> s5-0 state flags) (nav-state-flag in-mesh))) - (let ((a0-6 (find-nearest-nav-mesh (-> obj root trans) (the-as float #x7f800000)))) + (let ((a0-6 (find-nearest-nav-mesh (-> this root trans) (the-as float #x7f800000)))) (when (and a0-6 (!= a0-6 (-> s5-0 state mesh))) - (change-to a0-6 obj) - (logclear! (-> obj nav flags) (nav-control-flag output-sphere-hash)) + (change-to a0-6 this) + (logclear! (-> this nav flags) (nav-control-flag output-sphere-hash)) ) ) ) ) (else - (vehicle-method-141 obj) + (vehicle-method-141 this) ) ) ) (else (if s5-0 - (vehicle-method-142 obj) + (vehicle-method-142 this) ) ) ) @@ -1012,20 +1012,20 @@ This commonly includes things such as: ;; definition for method 87 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-87 vehicle ((obj vehicle)) - (when (not (logtest? (rigid-body-object-flag camera) (-> obj flags))) - (logior! (-> obj flags) (rigid-body-object-flag camera)) - (set! (-> obj cam-speed-interp) 0.0) - (set-setting! 'string-min-height 'abs (-> obj info camera-string-min-height) 0) - (set-setting! 'string-max-height 'abs (-> obj info camera-string-max-height) 0) - (set-setting! 'head-offset 'abs (-> obj info camera-head-offset) 0) - (set-setting! 'foot-offset 'abs (-> obj info camera-foot-offset) 0) +(defmethod vehicle-method-87 vehicle ((this vehicle)) + (when (not (logtest? (rigid-body-object-flag camera) (-> this flags))) + (logior! (-> this flags) (rigid-body-object-flag camera)) + (set! (-> this cam-speed-interp) 0.0) + (set-setting! 'string-min-height 'abs (-> this info camera-string-min-height) 0) + (set-setting! 'string-max-height 'abs (-> this info camera-string-max-height) 0) + (set-setting! 'head-offset 'abs (-> this info camera-head-offset) 0) + (set-setting! 'foot-offset 'abs (-> this info camera-foot-offset) 0) (set-setting! 'target-height 'abs (meters 0) 0) - (vehicle-method-92 obj) - (vehicle-method-89 obj) + (vehicle-method-92 this) + (vehicle-method-89 this) (persist-with-delay *setting-control* 'mode-name (seconds 0.2) 'mode-name 'cam-fixed 0.0 0) (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) - (let ((v1-27 (process->ppointer obj))) + (let ((v1-27 (process->ppointer this))) (persist-with-delay *setting-control* 'butt-handle @@ -1043,10 +1043,10 @@ This commonly includes things such as: ;; definition for method 88 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-88 vehicle ((obj vehicle)) - (when (logtest? (rigid-body-object-flag camera) (-> obj flags)) - (vehicle-method-92 obj) - (vehicle-method-90 obj) +(defmethod vehicle-method-88 vehicle ((this vehicle)) + (when (logtest? (rigid-body-object-flag camera) (-> this flags)) + (vehicle-method-92 this) + (vehicle-method-90 this) (remove-setting! 'rapid-tracking) (remove-setting! 'fov) (remove-setting! 'string-camera-ceiling) @@ -1072,7 +1072,7 @@ This commonly includes things such as: 0.0 0 ) - (logclear! (-> obj flags) (rigid-body-object-flag camera)) + (logclear! (-> this flags) (rigid-body-object-flag camera)) ) 0 (none) @@ -1080,9 +1080,9 @@ This commonly includes things such as: ;; definition for method 89 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-89 vehicle ((obj vehicle)) - (when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> obj flags))) - (logior! (-> obj flags) (rigid-body-object-flag camera-bike-mode)) +(defmethod vehicle-method-89 vehicle ((this vehicle)) + (when (not (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags))) + (logior! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (set-setting! 'bike-mode #f 0.0 0) ) 0 @@ -1091,9 +1091,9 @@ This commonly includes things such as: ;; definition for method 90 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-90 vehicle ((obj vehicle)) - (when (logtest? (rigid-body-object-flag camera-bike-mode) (-> obj flags)) - (logclear! (-> obj flags) (rigid-body-object-flag camera-bike-mode)) +(defmethod vehicle-method-90 vehicle ((this vehicle)) + (when (logtest? (rigid-body-object-flag camera-bike-mode) (-> this flags)) + (logclear! (-> this flags) (rigid-body-object-flag camera-bike-mode)) (remove-setting! 'bike-mode) ) 0 @@ -1102,9 +1102,9 @@ This commonly includes things such as: ;; definition for method 91 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-91 vehicle ((obj vehicle)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (logior! (-> obj flags) (rigid-body-object-flag camera-rapid-track-mode)) +(defmethod vehicle-method-91 vehicle ((this vehicle)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (logior! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (set-setting! 'rapid-tracking #f 0.0 0) ) 0 @@ -1113,9 +1113,9 @@ This commonly includes things such as: ;; definition for method 92 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-92 vehicle ((obj vehicle)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (logclear! (-> obj flags) (rigid-body-object-flag camera-rapid-track-mode)) +(defmethod vehicle-method-92 vehicle ((this vehicle)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (logclear! (-> this flags) (rigid-body-object-flag camera-rapid-track-mode)) (remove-setting! 'rapid-tracking) ) 0 @@ -1124,11 +1124,11 @@ This commonly includes things such as: ;; definition for method 40 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-40 vehicle ((obj vehicle)) - (logior! (-> obj flags) (rigid-body-object-flag enable-collision)) - (let ((v1-3 (-> obj root root-prim))) - (set! (-> v1-3 prim-core collide-as) (-> obj root backup-collide-as)) - (set! (-> v1-3 prim-core collide-with) (-> obj root backup-collide-with)) +(defmethod rigid-body-object-method-40 vehicle ((this vehicle)) + (logior! (-> this flags) (rigid-body-object-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> this root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> this root backup-collide-with)) ) 0 (none) @@ -1136,9 +1136,9 @@ This commonly includes things such as: ;; definition for method 41 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-41 vehicle ((obj vehicle)) - (logclear! (-> obj flags) (rigid-body-object-flag enable-collision)) - (let ((v1-3 (-> obj root root-prim))) +(defmethod rigid-body-object-method-41 vehicle ((this vehicle)) + (logclear! (-> this flags) (rigid-body-object-flag enable-collision)) + (let ((v1-3 (-> this root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) @@ -1149,8 +1149,8 @@ This commonly includes things such as: ;; definition for method 102 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-102 vehicle ((obj vehicle)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod vehicle-method-102 vehicle ((this vehicle)) + (let ((v1-1 (-> this draw shadow-ctrl))) (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 @@ -1160,8 +1160,8 @@ This commonly includes things such as: ;; definition for method 103 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-103 vehicle ((obj vehicle)) - (let ((v1-1 (-> obj draw shadow-ctrl))) +(defmethod vehicle-method-103 vehicle ((this vehicle)) + (let ((v1-1 (-> this draw shadow-ctrl))) (logior! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 @@ -1171,13 +1171,13 @@ This commonly includes things such as: ;; definition for method 38 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-38 vehicle ((obj vehicle)) - (when (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (rigid-body-method-26 (-> obj rbody state) (-> obj root trans) (-> obj root quat)) - (vector-float*! (-> obj rbody state lin-momentum) (-> obj root transv) (-> obj info info mass)) - (vector-reset! (-> obj rbody state ang-momentum)) - (vector-reset! (-> obj lin-acceleration)) +(defmethod rigid-body-object-method-38 vehicle ((this vehicle)) + (when (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) + (logior! (-> this rbody state flags) (rigid-body-flag enable-physics)) + (rigid-body-method-26 (-> this rbody state) (-> this root trans) (-> this root quat)) + (vector-float*! (-> this rbody state lin-momentum) (-> this root transv) (-> this info info mass)) + (vector-reset! (-> this rbody state ang-momentum)) + (vector-reset! (-> this lin-acceleration)) ) 0 (none) @@ -1185,18 +1185,18 @@ This commonly includes things such as: ;; definition for method 39 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-39 vehicle ((obj vehicle)) - (set! (-> obj force-scale) 1.0) - (logclear! (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (vehicle-method-110 obj) +(defmethod rigid-body-object-method-39 vehicle ((this vehicle)) + (set! (-> this force-scale) 1.0) + (logclear! (-> this rbody state flags) (rigid-body-flag enable-physics)) + (vehicle-method-110 this) 0 (none) ) ;; definition for method 111 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-111 vehicle ((obj vehicle) (arg0 object) (arg1 target)) - (let ((a0-1 (-> obj controller traffic))) +(defmethod vehicle-method-111 vehicle ((this vehicle) (arg0 object) (arg1 target)) + (let ((a0-1 (-> this controller traffic))) (when (and (nonzero? a0-1) arg1) (if #t (increase-alert-level a0-1 (the-as int arg0) arg1) @@ -1208,23 +1208,23 @@ This commonly includes things such as: ) ;; definition for method 112 of type vehicle -(defmethod decrease-traffic-alert-level vehicle ((obj vehicle) (arg0 int)) - (decrease-alert-level (-> obj controller traffic) arg0) +(defmethod decrease-traffic-alert-level vehicle ((this vehicle) (arg0 int)) + (decrease-alert-level (-> this controller traffic) arg0) 0 ) ;; definition for method 80 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-80 vehicle ((obj vehicle)) - (when (and (logtest? (-> obj info flags) 64) (< (-> obj flight-level-index) 1)) +(defmethod vehicle-method-80 vehicle ((this vehicle)) + (when (and (logtest? (-> this info flags) 64) (< (-> this flight-level-index) 1)) 1 (cond - ((< (+ 8192.0 (-> obj rbody state position y)) (-> obj flight-level)) + ((< (+ 8192.0 (-> this rbody state position y)) (-> this flight-level)) (sound-play "bike-up") - (vehicle-method-78 obj 1) + (vehicle-method-78 this 1) ) (else - (set! (-> obj flight-level-index) 1) + (set! (-> this flight-level-index) 1) ) ) ) @@ -1234,10 +1234,10 @@ This commonly includes things such as: ;; definition for method 81 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-81 vehicle ((obj vehicle)) - (when (and (logtest? (-> obj info flags) 64) (> (-> obj flight-level-index) 0)) +(defmethod vehicle-method-81 vehicle ((this vehicle)) + (when (and (logtest? (-> this info flags) 64) (> (-> this flight-level-index) 0)) (sound-play "bike-down") - (vehicle-method-78 obj 0) + (vehicle-method-78 this 0) ) 0 (none) @@ -1245,43 +1245,45 @@ This commonly includes things such as: ;; definition for method 83 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-83 vehicle ((obj vehicle)) - (logclear! (-> obj flags) (rigid-body-object-flag flight-level-transition)) - (vehicle-method-92 obj) - (set! (-> obj flight-level-index) 0) +(defmethod vehicle-method-83 vehicle ((this vehicle)) + (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition)) + (vehicle-method-92 this) + (set! (-> this flight-level-index) 0) 0 (none) ) ;; definition for method 108 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-108 vehicle ((obj vehicle)) - (vehicle-controller-method-11 (-> obj controller)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> obj flags))) +(defmethod vehicle-method-108 vehicle ((this vehicle)) + (vehicle-controller-method-11 (-> this controller)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent in-pursuit) (-> this flags))) ) - (logior! (-> obj controller flags) (vehicle-controller-flag ignore-others)) + (logior! (-> this controller flags) (vehicle-controller-flag ignore-others)) 0 (none) ) ;; definition for method 109 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-109 vehicle ((obj vehicle)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag in-pursuit))) +(defmethod vehicle-method-109 vehicle ((this vehicle)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag in-pursuit))) ) - (logclear! (-> obj controller flags) (vehicle-controller-flag ignore-others direct-mode)) - (vehicle-method-107 obj) + (logclear! (-> this controller flags) (vehicle-controller-flag ignore-others direct-mode)) + (vehicle-method-107 this) 0 (none) ) ;; definition for method 42 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-42 vehicle ((obj vehicle)) - (if (and (not (focus-test? obj inactive)) (not (and (-> obj next-state) (= (-> obj next-state name) 'explode)))) - ((method-of-type rigid-body-object rigid-body-object-method-42) obj) +(defmethod rigid-body-object-method-42 vehicle ((this vehicle)) + (if (and (not (focus-test? this inactive)) + (not (and (-> this next-state) (= (-> this next-state name) 'explode))) + ) + ((method-of-type rigid-body-object rigid-body-object-method-42) this) ) 0 (none) @@ -1289,68 +1291,68 @@ This commonly includes things such as: ;; definition for method 113 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-113 vehicle ((obj vehicle)) - (vehicle-method-127 obj) - (logior! (-> obj focus-status) (focus-status inactive)) - (set! (-> obj event-hook) (-> (method-of-object obj inactive) event)) - (go (method-of-object obj inactive)) +(defmethod vehicle-method-113 vehicle ((this vehicle)) + (vehicle-method-127 this) + (logior! (-> this focus-status) (focus-status inactive)) + (set! (-> this event-hook) (-> (method-of-object this inactive) event)) + (go (method-of-object this inactive)) 0 (none) ) ;; definition for method 114 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-114 vehicle ((obj vehicle)) - (if (focus-test? obj inactive) - (vehicle-method-128 obj) +(defmethod vehicle-method-114 vehicle ((this vehicle)) + (if (focus-test? this inactive) + (vehicle-method-128 this) ) - (go (method-of-object obj active)) + (go (method-of-object this active)) 0 (none) ) ;; definition for method 43 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-43 vehicle ((obj vehicle)) - (go (method-of-object obj waiting)) +(defmethod rigid-body-object-method-43 vehicle ((this vehicle)) + (go (method-of-object this waiting)) 0 (none) ) ;; definition for method 138 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-138 vehicle ((obj vehicle)) - (go (method-of-object obj player-control)) +(defmethod vehicle-method-138 vehicle ((this vehicle)) + (go (method-of-object this player-control)) 0 (none) ) ;; definition for method 130 of type vehicle ;; WARN: Return type mismatch object vs none. -(defmethod vehicle-method-130 vehicle ((obj vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-130 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((zero? v1-0) - (vehicle-method-82 obj) - (logior! (-> obj flags) (rigid-body-object-flag persistent)) - (logclear! (-> obj draw status) (draw-control-status no-draw)) - (logior! (-> obj skel status) (joint-control-status sync-math)) + (vehicle-method-82 this) + (logior! (-> this flags) (rigid-body-object-flag persistent)) + (logclear! (-> this draw status) (draw-control-status no-draw)) + (logior! (-> this skel status) (joint-control-status sync-math)) (ja-post) - (update-transforms (-> obj root)) - (logclear! (-> obj skel status) (joint-control-status sync-math)) - (go (method-of-object obj idle)) + (update-transforms (-> this root)) + (logclear! (-> this skel status) (joint-control-status sync-math)) + (go (method-of-object this idle)) ) ((= v1-0 2) (let ((a1-1 (-> arg0 nav-branch))) (if a1-1 - (vehicle-controller-method-13 (-> obj controller) a1-1 (-> obj root trans)) + (vehicle-controller-method-13 (-> this controller) a1-1 (-> this root trans)) ) ) - (vehicle-method-128 obj) - (go (method-of-object obj active)) + (vehicle-method-128 this) + (go (method-of-object this active)) ) (else - (vehicle-method-113 obj) + (vehicle-method-113 this) ) ) ) @@ -1359,21 +1361,21 @@ This commonly includes things such as: ;; definition for method 136 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-136 vehicle ((obj vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-136 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) (let ((v1-0 (-> arg0 behavior))) (cond ((= v1-0 1) - (vehicle-method-135 obj arg0) - (vehicle-method-113 obj) + (vehicle-method-135 this arg0) + (vehicle-method-113 this) ) ((zero? v1-0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-0 4) - (go (method-of-object obj player-control)) + (go (method-of-object this player-control)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) ) @@ -1383,30 +1385,30 @@ This commonly includes things such as: ;; definition for method 127 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-127 vehicle ((obj vehicle)) - (let ((s5-0 (-> obj child))) +(defmethod vehicle-method-127 vehicle ((this vehicle)) + (let ((s5-0 (-> this child))) (while s5-0 (send-event (ppointer->process s5-0) 'traffic-off) (set! s5-0 (-> s5-0 0 brother)) ) ) - (dotimes (s5-1 (-> obj info seat-count)) - (put-rider-in-seat obj s5-1 (the-as process-focusable #f)) + (dotimes (s5-1 (-> this info seat-count)) + (put-rider-in-seat this s5-1 (the-as process-focusable #f)) ) - (vehicle-method-142 obj) - (vehicle-controller-method-11 (-> obj controller)) - (vehicle-method-110 obj) + (vehicle-method-142 this) + (vehicle-controller-method-11 (-> this controller)) + (vehicle-method-110 this) 0 (none) ) ;; definition for method 128 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-128 vehicle ((obj vehicle)) - (vehicle-method-82 obj) - (set! (-> obj root trans y) (-> obj flight-level)) - (logior! (-> obj flags) (rigid-body-object-flag ignition ai-driving)) - (let ((gp-1 (-> obj child))) +(defmethod vehicle-method-128 vehicle ((this vehicle)) + (vehicle-method-82 this) + (set! (-> this root trans y) (-> this flight-level)) + (logior! (-> this flags) (rigid-body-object-flag ignition ai-driving)) + (let ((gp-1 (-> this child))) (while gp-1 (send-event (ppointer->process gp-1) 'traffic-on) (set! gp-1 (-> gp-1 0 brother)) @@ -1418,42 +1420,42 @@ This commonly includes things such as: ;; definition for method 129 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-129 vehicle ((obj vehicle)) - (if (= obj *debug-actor*) +(defmethod vehicle-method-129 vehicle ((this vehicle)) + (if (= this *debug-actor*) (format #t "hook-dead~%") ) - (logior! (-> obj focus-status) (focus-status dead)) - (vehicle-controller-method-11 (-> obj controller)) - (vehicle-method-140 obj) - (set! (-> obj flags) + (logior! (-> this focus-status) (focus-status dead)) + (vehicle-controller-method-11 (-> this controller)) + (vehicle-method-140 this) + (set! (-> this flags) (the-as rigid-body-object-flag - (logclear (-> obj flags) (rigid-body-object-flag riding player-driving in-pursuit target-in-sight)) + (logclear (-> this flags) (rigid-body-object-flag riding player-driving in-pursuit target-in-sight)) ) ) - (set! (-> obj controls throttle) 0.0) - (set! (-> obj controls steering) 0.0) - (vehicle-method-83 obj) + (set! (-> this controls throttle) 0.0) + (set! (-> this controls steering) 0.0) + (vehicle-method-83 this) 0 (none) ) ;; definition for method 137 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-137 vehicle ((obj vehicle) (arg0 traffic-object-spawn-params)) - (vehicle-rider-spawn obj citizen-norm-rider arg0) +(defmethod vehicle-method-137 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) + (vehicle-rider-spawn this citizen-norm-rider arg0) 0 (none) ) ;; definition for method 105 of type vehicle -(defmethod vehicle-method-105 vehicle ((obj vehicle)) - (logtest? (rigid-body-object-flag disturbed player-touching player-driving in-pursuit) (-> obj flags)) +(defmethod vehicle-method-105 vehicle ((this vehicle)) + (logtest? (rigid-body-object-flag disturbed player-touching player-driving in-pursuit) (-> this flags)) ) ;; definition for method 106 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-106 vehicle ((obj vehicle)) +(defmethod vehicle-method-106 vehicle ((this vehicle)) (local-vars (v1-13 float) (v1-25 float) (v1-30 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1461,13 +1463,13 @@ This commonly includes things such as: (vf2 :class vf) ) (init-vf0-vector) - (when (>= (- (current-time) (-> obj disturbed-time)) (seconds 2)) + (when (time-elapsed? (-> this disturbed-time) (seconds 2)) (cond - ((logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) - (when (and (not (logtest? (-> obj controller flags) (vehicle-controller-flag off-path))) - (>= (-> obj rbody state matrix vector 1 y) (cos 910.2222)) + ((logtest? (rigid-body-object-flag ai-driving) (-> this flags)) + (when (and (not (logtest? (-> this controller flags) (vehicle-controller-flag off-path))) + (>= (-> this rbody state matrix vector 1 y) (cos 910.2222)) ) - (.lvf vf1 (&-> (-> obj rbody state ang-velocity) quad)) + (.lvf vf1 (&-> (-> this rbody state ang-velocity) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -1478,18 +1480,18 @@ This commonly includes things such as: (f1-0 0.5) ) (if (< f0-1 (* f1-0 f1-0)) - (logclear! (-> obj flags) (rigid-body-object-flag disturbed)) + (logclear! (-> this flags) (rigid-body-object-flag disturbed)) ) ) ) ) (else - (when (>= (-> obj rbody state matrix vector 1 y) (cos 910.2222)) - (let* ((f0-3 (-> obj camera-dist2)) + (when (>= (-> this rbody state matrix vector 1 y) (cos 910.2222)) + (let* ((f0-3 (-> this camera-dist2)) (f1-3 0.000024414063) (f0-4 (* f0-3 (* f1-3 f1-3))) ) - (.lvf vf1 (&-> (-> obj rbody state ang-velocity) quad)) + (.lvf vf1 (&-> (-> this rbody state ang-velocity) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -1497,7 +1499,7 @@ This commonly includes things such as: (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-25 vf1) (when (and (< v1-25 f0-4) (begin - (.lvf vf1 (&-> (-> obj rbody state lin-velocity) quad)) + (.lvf vf1 (&-> (-> this rbody state lin-velocity) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -1511,8 +1513,8 @@ This commonly includes things such as: ) ) ) - (logclear! (-> obj flags) (rigid-body-object-flag disturbed)) - (clear-momentum! (-> obj rbody state)) + (logclear! (-> this flags) (rigid-body-object-flag disturbed)) + (clear-momentum! (-> this rbody state)) ) ) ) @@ -1526,7 +1528,7 @@ This commonly includes things such as: ;; definition for method 86 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods vehicle ((obj vehicle)) +(defmethod update-joint-mods vehicle ((this vehicle)) 0 (none) ) @@ -1535,23 +1537,23 @@ This commonly includes things such as: ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-107 vehicle ((obj vehicle)) - (logclear! (-> obj controller flags) (vehicle-controller-flag ignore-others direct-mode)) +(defmethod vehicle-method-107 vehicle ((this vehicle)) + (logclear! (-> this controller flags) (vehicle-controller-flag ignore-others direct-mode)) (let ((s5-0 (new 'stack-no-clear 'vehicle-control-point))) - (set! (-> s5-0 local-pos quad) (-> obj root trans quad)) - (set! (-> s5-0 normal quad) (-> obj root transv quad)) + (set! (-> s5-0 local-pos quad) (-> this root trans quad)) + (set! (-> s5-0 normal quad) (-> this root transv quad)) (set! (-> s5-0 local-pos w) 40960.0) (let ((s4-0 0)) (label cfg-1) - (let ((v1-7 (find-best-segment (-> obj controller traffic) (-> s5-0 local-pos) (-> s5-0 normal) 0))) + (let ((v1-7 (find-best-segment (-> this controller traffic) (-> s5-0 local-pos) (-> s5-0 normal) 0))) (when (and (not v1-7) (< s4-0 3)) (+! (-> s5-0 local-pos w) 40960.0) (+! s4-0 1) (goto cfg-1) ) (if v1-7 - (vehicle-controller-method-13 (-> obj controller) (-> v1-7 branch) (-> obj root trans)) - (vehicle-method-113 obj) + (vehicle-controller-method-13 (-> this controller) (-> v1-7 branch) (-> this root trans)) + (vehicle-method-113 this) ) ) ) @@ -1563,14 +1565,14 @@ This commonly includes things such as: ;; definition for method 119 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-119 vehicle ((obj vehicle)) - (dotimes (s5-0 (-> obj info seat-count)) - (let ((s4-0 (handle->process (-> obj rider-array s5-0)))) +(defmethod vehicle-method-119 vehicle ((this vehicle)) + (dotimes (s5-0 (-> this info seat-count)) + (let ((s4-0 (handle->process (-> this rider-array s5-0)))) (when (and s4-0 (focus-test? (the-as vehicle-rider s4-0) pilot-riding)) - (compute-seat-position obj (-> (the-as vehicle-rider s4-0) root trans) s5-0) - (set! (-> (the-as vehicle-rider s4-0) root transv quad) (-> obj root transv quad)) - (let ((f0-1 (the float (-> obj info seat-array s5-0 angle)))) - (quaternion-rotate-local-y! (-> (the-as vehicle-rider s4-0) root quat) (-> obj root quat) f0-1) + (compute-seat-position this (-> (the-as vehicle-rider s4-0) root trans) s5-0) + (set! (-> (the-as vehicle-rider s4-0) root transv quad) (-> this root transv quad)) + (let ((f0-1 (the float (-> this info seat-array s5-0 angle)))) + (quaternion-rotate-local-y! (-> (the-as vehicle-rider s4-0) root quat) (-> this root quat) f0-1) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc index 307a152a7c..af3d9d49a0 100644 --- a/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/traffic/vehicle/vehicle_REF.gc @@ -44,18 +44,18 @@ ) ;; definition for method 3 of type debug-vehicle-work -(defmethod inspect debug-vehicle-work ((obj debug-vehicle-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect debug-vehicle-work ((this debug-vehicle-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Timpact-time: ~D~%" (-> obj impact-time)) - (format #t "~1Timpact: #~%" (-> obj impact)) - (format #t "~1Tprim-sphere1: #~%" (-> obj prim-sphere1)) - (format #t "~1Tprim-sphere2: #~%" (-> obj prim-sphere2)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Timpact-time: ~D~%" (-> this impact-time)) + (format #t "~1Timpact: #~%" (-> this impact)) + (format #t "~1Tprim-sphere1: #~%" (-> this prim-sphere1)) + (format #t "~1Tprim-sphere2: #~%" (-> this prim-sphere2)) (label cfg-4) - obj + this ) ;; definition for symbol *debug-vehicle-work*, type debug-vehicle-work @@ -92,7 +92,7 @@ ;; definition for method 45 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-45 vehicle ((obj vehicle) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 vehicle ((this vehicle) (arg0 rigid-body-impact)) (local-vars (v1-63 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -100,35 +100,35 @@ (vf2 :class vf) ) (init-vf0-vector) - (set! (-> obj impact-pos quad) (-> arg0 point quad)) + (set! (-> this impact-pos quad) (-> arg0 point quad)) (let* ((f0-0 1.0) (f1-0 (-> arg0 impulse)) (f2-0 61440.0) - (f30-0 (fmin f0-0 (* f1-0 (/ 1.0 f2-0) (-> obj info info inv-mass)))) - (f28-0 (* (-> obj info info mass) (-> obj info toughness-factor))) + (f30-0 (fmin f0-0 (* f1-0 (/ 1.0 f2-0) (-> this info info inv-mass)))) + (f28-0 (* (-> this info info mass) (-> this info toughness-factor))) ) - (set! (-> obj crash-impulse) (-> arg0 impulse)) + (set! (-> this crash-impulse) (-> arg0 impulse)) (cond ((< (* 286720.0 f28-0) (-> arg0 impulse)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 1)) ) - (apply-damage obj 1.0 arg0) - (vehicle-method-76 obj 2 (the-as uint 300)) + (apply-damage this 1.0 arg0) + (vehicle-method-76 this 2 (the-as uint 300)) ) ((< (* 131072.0 f28-0) (-> arg0 impulse)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.5)) ) - (apply-damage obj 0.25 arg0) - (vehicle-method-76 obj 1 (the-as uint 75)) + (apply-damage this 0.25 arg0) + (vehicle-method-76 this 1 (the-as uint 75)) ) ((< (* 102400.0 f28-0) (-> arg0 impulse)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.25)) ) - (apply-damage obj 0.125 arg0) - (vehicle-method-76 obj 1 (the-as uint 75)) + (apply-damage this 0.125 arg0) + (vehicle-method-76 this 1 (the-as uint 75)) ) (else (let* ((f0-9 0.0) @@ -136,16 +136,16 @@ (f2-5 (* 16384000.0 f28-0)) (f0-10 (fmax f0-9 (* f1-7 (/ 1.0 f2-5)))) ) - (apply-damage obj f0-10 arg0) + (apply-damage this f0-10 arg0) ) (when (< (* 32768.0 f28-0) (-> arg0 impulse)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1)) ) ) (if (< 0.1 f30-0) (sound-play-by-name - (-> obj info glance-sound) + (-> this info glance-sound) (new-sound-id) (the int (* 1024.0 f30-0)) 0 @@ -158,7 +158,7 @@ ) (when (< (* 102400.0 f28-0) (-> arg0 impulse)) (sound-play-by-name - (-> obj info impact-sound) + (-> this info impact-sound) (new-sound-id) (the int (* 1024.0 f30-0)) 0 @@ -166,7 +166,7 @@ (sound-group sfx) #t ) - (logclear! (-> obj flags) (rigid-body-object-flag turbo-boost)) + (logclear! (-> this flags) (rigid-body-object-flag turbo-boost)) ) ) (let ((a0-17 (new 'stack-no-clear 'vector))) @@ -188,14 +188,14 @@ (f1-11 12288.0) ) (when (< (* f1-11 f1-11) f0-25) - (set! (-> obj scrape-sound-envelope) 1.0) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (set! (-> this scrape-sound-envelope) 1.0) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 255 (seconds 0.05)) ) ) ) - (if (>= 0.0 (-> obj hit-points)) - (vehicle-method-76 obj 2 (the-as uint 300)) + (if (>= 0.0 (-> this hit-points)) + (vehicle-method-76 this 2 (the-as uint 300)) ) 0 (none) @@ -204,23 +204,23 @@ ;; definition for method 104 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-104 vehicle ((obj vehicle)) - (when (= (-> obj controller traffic sync-mask-8) (ash 1 (logand (-> obj traffic-priority-id) 7))) - (let ((a1-0 (-> obj root trans))) - (set! (-> obj flight-level) (get-height-at-point *traffic-height-map* a1-0)) +(defmethod vehicle-method-104 vehicle ((this vehicle)) + (when (= (-> this controller traffic sync-mask-8) (ash 1 (logand (-> this traffic-priority-id) 7))) + (let ((a1-0 (-> this root trans))) + (set! (-> this flight-level) (get-height-at-point *traffic-height-map* a1-0)) ) ) - (set! (-> obj target-acceleration y) - (- (* 8.0 (- (-> obj flight-level) (-> obj root trans y))) (-> obj root transv y)) + (set! (-> this target-acceleration y) + (- (* 8.0 (- (-> this flight-level) (-> this root trans y))) (-> this root transv y)) ) - (vector-v++! (-> obj root transv) (-> obj target-acceleration)) - (vector-v++! (-> obj root trans) (-> obj root transv)) - (let* ((v1-14 (-> obj root transv)) + (vector-v++! (-> this root transv) (-> this target-acceleration)) + (vector-v++! (-> this root trans) (-> this root transv)) + (let* ((v1-14 (-> this root transv)) (f30-0 (sqrtf (+ (* (-> v1-14 x) (-> v1-14 x)) (* (-> v1-14 z) (-> v1-14 z))))) (s5-0 (new 'stack-no-clear 'vehicle-control-point)) ) (when (< 40.96 f30-0) - (vector-float*! (-> s5-0 normal) (-> obj root transv) (/ 1.0 f30-0)) + (vector-float*! (-> s5-0 normal) (-> this root transv) (/ 1.0 f30-0)) (quaternion-set! (the-as quaternion (-> s5-0 local-pos)) 0.0 @@ -232,11 +232,11 @@ (quaternion-rotate-local-z! (the-as quaternion (-> s5-0 local-pos)) (the-as quaternion (-> s5-0 local-pos)) - (* -0.08886719 (-> obj controls steering) (fmin 81920.0 f30-0)) + (* -0.08886719 (-> this controls steering) (fmin 81920.0 f30-0)) ) (quaternion-smooth-seek! - (-> obj root quat) - (-> obj root quat) + (-> this root quat) + (-> this root quat) (the-as quaternion (-> s5-0 local-pos)) (* 0.00014686584 (seconds-per-frame) f30-0) ) @@ -249,35 +249,35 @@ ;; definition for method 93 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-93 vehicle ((obj vehicle)) +(defmethod vehicle-method-93 vehicle ((this vehicle)) (let ((s5-0 (new 'stack-no-clear 'matrix))) - (set! (-> s5-0 vector 2 quad) (-> obj rbody state matrix quad 0)) - (set! (-> s5-0 trans quad) (-> obj rbody state matrix vector 2 quad)) - (let ((f28-0 (* (-> obj rbody state ang-velocity y) (vector-length (-> obj rbody state lin-velocity)))) + (set! (-> s5-0 vector 2 quad) (-> this rbody state matrix quad 0)) + (set! (-> s5-0 trans quad) (-> this rbody state matrix vector 2 quad)) + (let ((f28-0 (* (-> this rbody state ang-velocity y) (vector-length (-> this rbody state lin-velocity)))) (f30-0 (seconds-per-frame)) ) - (when (zero? (-> obj flight-level-index)) - (if (logtest? (-> obj flags) (rigid-body-object-flag riding)) - (vehicle-method-80 obj) + (when (zero? (-> this flight-level-index)) + (if (logtest? (-> this flags) (rigid-body-object-flag riding)) + (vehicle-method-80 this) ) ) - (vector-! (-> s5-0 vector 1) (-> obj target-acceleration) (-> obj lin-acceleration)) + (vector-! (-> s5-0 vector 1) (-> this target-acceleration) (-> this lin-acceleration)) (let ((f0-3 (* 0.00006 (vector-dot (-> s5-0 trans) (-> s5-0 vector 1)) f30-0))) (set! (-> s5-0 vector 0 y) (fmax 0.0 (fmin 1.0 (* 20.0 f0-3)))) (set! (-> s5-0 vector 0 z) (fmax 0.0 (fmin 1.0 (* -40.0 f0-3)))) - (if (= obj *debug-actor*) + (if (= this *debug-actor*) (format *stdcon* "delta-throttle ~f~%" f0-3) ) ) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-edge-grabbing)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-edge-grabbing)) (set! (-> s5-0 vector 0 y) 0.0) (set! (-> s5-0 vector 0 z) 1.0) - (logclear! (-> obj flags) (rigid-body-object-flag reverse-gear)) + (logclear! (-> this flags) (rigid-body-object-flag reverse-gear)) ) (let ((f0-7 (* 6.0 f30-0)) (f4-0 (* 0.00018024445 - (- (vector-dot (-> s5-0 vector 2) (-> obj target-acceleration)) f28-0) - (if (< (-> obj controls throttle) 0.0) + (- (vector-dot (-> s5-0 vector 2) (-> this target-acceleration)) f28-0) + (if (< (-> this controls throttle) 0.0) -1.0 1.0 ) @@ -286,17 +286,17 @@ ) ) (set! (-> s5-0 vector 0 x) - (fmax -1.0 (fmin 1.0 (+ (-> obj controls steering) (fmax (fmin f4-0 f0-7) (- f0-7))))) + (fmax -1.0 (fmin 1.0 (+ (-> this controls steering) (fmax (fmin f4-0 f0-7) (- f0-7))))) ) ) ) (set! (-> s5-0 vector 0 w) 0.0) - (vehicle-method-95 obj (the-as vector (-> s5-0 vector))) - (when (= obj *debug-actor*) + (vehicle-method-95 this (the-as vector (-> s5-0 vector))) + (when (= this *debug-actor*) (let ((v1-43 (-> s5-0 vector))) (format *stdcon* "steer ~f, throttle ~f, brake ~f~%" (-> v1-43 0 x) (-> v1-43 0 y) (-> v1-43 0 z)) ) - (let ((v1-45 (-> obj controls))) + (let ((v1-45 (-> this controls))) (format *stdcon* "steer ~f, throttle ~f, brake ~f~%" (-> v1-45 steering) (-> v1-45 throttle) (-> v1-45 brake)) ) ) @@ -307,26 +307,26 @@ ;; definition for method 95 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-95 vehicle ((obj vehicle) (arg0 vector)) - (seek! (-> obj controls steering) (-> arg0 x) (* 8.0 (seconds-per-frame))) - (seek! (-> obj controls lean-z) (-> arg0 w) (* 8.0 (seconds-per-frame))) - (logclear! (-> obj flags) (rigid-body-object-flag slide)) +(defmethod vehicle-method-95 vehicle ((this vehicle) (arg0 vector)) + (seek! (-> this controls steering) (-> arg0 x) (* 8.0 (seconds-per-frame))) + (seek! (-> this controls lean-z) (-> arg0 w) (* 8.0 (seconds-per-frame))) + (logclear! (-> this flags) (rigid-body-object-flag slide)) (let ((f0-10 (-> arg0 y)) (f30-0 (-> arg0 z)) ) (set! f30-0 (cond ((< 0.0 f0-10) - (logclear! (-> obj flags) (rigid-body-object-flag reverse-gear)) + (logclear! (-> this flags) (rigid-body-object-flag reverse-gear)) (when (< 0.0 f30-0) (set! f30-0 0.25) - (logior! (-> obj flags) (rigid-body-object-flag slide)) + (logior! (-> this flags) (rigid-body-object-flag slide)) ) f30-0 ) ((< 0.0 f30-0) (cond - ((logtest? (rigid-body-object-flag reverse-gear) (-> obj flags)) + ((logtest? (rigid-body-object-flag reverse-gear) (-> this flags)) (let ((f0-11 -0.5) (f1-5 0.0) (f2-0 -40960.0) @@ -334,23 +334,25 @@ (set! f0-10 (fmax f0-11 - (fmin f1-5 (* (/ 1.0 f2-0) - f30-0 - (- 8192.0 (vector-dot (-> obj rbody state lin-velocity) (-> obj rbody state matrix vector 2))) - ) - ) + (fmin + f1-5 + (* (/ 1.0 f2-0) + f30-0 + (- 8192.0 (vector-dot (-> this rbody state lin-velocity) (-> this rbody state matrix vector 2))) + ) + ) ) ) ) 0.0 ) (else - (let* ((v1-25 (-> obj rbody state lin-velocity)) + (let* ((v1-25 (-> this rbody state lin-velocity)) (f1-10 (+ (* (-> v1-25 x) (-> v1-25 x)) (* (-> v1-25 z) (-> v1-25 z)))) (f2-8 8192.0) ) (if (< f1-10 (* f2-8 f2-8)) - (logior! (-> obj flags) (rigid-body-object-flag reverse-gear)) + (logior! (-> this flags) (rigid-body-object-flag reverse-gear)) ) ) f30-0 @@ -358,13 +360,13 @@ ) ) (else - (logclear! (-> obj flags) (rigid-body-object-flag reverse-gear)) + (logclear! (-> this flags) (rigid-body-object-flag reverse-gear)) f30-0 ) ) ) - (seek! (-> obj controls throttle) f0-10 (* 4.0 (seconds-per-frame))) - (+! (-> obj controls brake) (* (- f30-0 (-> obj controls brake)) (fmin 1.0 (* 8.0 (seconds-per-frame))))) + (seek! (-> this controls throttle) f0-10 (* 4.0 (seconds-per-frame))) + (+! (-> this controls brake) (* (- f30-0 (-> this controls brake)) (fmin 1.0 (* 8.0 (seconds-per-frame))))) ) 0 (none) @@ -372,31 +374,31 @@ ;; definition for method 94 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-94 vehicle ((obj vehicle)) +(defmethod vehicle-method-94 vehicle ((this vehicle)) (cond - ((or (logtest? (rigid-body-object-flag player-grabbed) (-> obj flags)) + ((or (logtest? (rigid-body-object-flag player-grabbed) (-> this flags)) (and *target* (focus-test? *target* dead grabbed)) ) (let ((v1-7 (new 'stack-no-clear 'vector))) (set! (-> v1-7 x) 0.0) (set! (-> v1-7 w) 0.0) (set! (-> v1-7 y) 0.0) - (set! (-> v1-7 z) (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) + (set! (-> v1-7 z) (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) 0.0 1.0 ) ) - (logclear! (-> obj flags) (rigid-body-object-flag reverse-gear)) - (vehicle-method-95 obj (the-as vector (&-> v1-7 x))) + (logclear! (-> this flags) (rigid-body-object-flag reverse-gear)) + (vehicle-method-95 this (the-as vector (&-> v1-7 x))) ) ) - ((and (zero? (-> obj crash-level)) - (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> obj flags))) + ((and (zero? (-> this crash-level)) + (not (logtest? (rigid-body-object-flag ai-driving measure-control-parameters) (-> this flags))) ) (when (and (cpad-pressed? 0 r2) (not *pause-lock*)) - (if (zero? (-> obj flight-level-index)) - (vehicle-method-80 obj) - (vehicle-method-81 obj) + (if (zero? (-> this flight-level-index)) + (vehicle-method-80 this) + (vehicle-method-81 this) ) ) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -404,13 +406,13 @@ (set! (-> s5-0 w) (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) (set! (-> s5-0 y) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 6))))) (set! (-> s5-0 z) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 7))))) - (vehicle-method-95 obj (the-as vector (&-> s5-0 x))) + (vehicle-method-95 this (the-as vector (&-> s5-0 x))) ) - (if (or (cpad-hold? 0 l1) (and (logtest? (-> obj info flags) 512) (cpad-hold? 0 r1))) - (start-jump obj) + (if (or (cpad-hold? 0 l1) (and (logtest? (-> this info flags) 512) (cpad-hold? 0 r1))) + (start-jump this) ) (if (cpad-pressed? 0 circle) - (vehicle-method-66 obj) + (vehicle-method-66 this) ) ) ) @@ -420,161 +422,161 @@ ;; definition for method 96 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-96 vehicle ((obj vehicle)) - (when (and *target* (logtest? (rigid-body-object-flag ignition) (-> obj flags))) - (when (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (zero? (-> obj root num-riders)) - (or (not *target*) (or (< 32768.0 (vector-vector-distance (-> obj root trans) (-> *target* control trans))) +(defmethod vehicle-method-96 vehicle ((this vehicle)) + (when (and *target* (logtest? (rigid-body-object-flag ignition) (-> this flags))) + (when (and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (zero? (-> this root num-riders)) + (or (not *target*) (or (< 32768.0 (vector-vector-distance (-> this root trans) (-> *target* control trans))) (focus-test? *target* teleporting) ) ) ) - (set! (-> obj controls throttle) 0.0) - (set! (-> obj controls steering) 0.0) - (set! (-> obj controls lean-z) 0.0) - (mem-copy! (the-as pointer (-> obj prev-controls)) (the-as pointer (-> obj controls)) 16) + (set! (-> this controls throttle) 0.0) + (set! (-> this controls steering) 0.0) + (set! (-> this controls lean-z) 0.0) + (mem-copy! (the-as pointer (-> this prev-controls)) (the-as pointer (-> this controls)) 16) ) ) (cond - ((zero? (-> obj crash-level)) - (seek! (-> obj force-scale) 1.0 (seconds-per-frame)) + ((zero? (-> this crash-level)) + (seek! (-> this force-scale) 1.0 (seconds-per-frame)) ) - ((< (-> obj crash-level) 3) - (when (>= (- (current-time) (-> obj crash-time)) (the-as time-frame (-> obj crash-duration))) - (if (or (>= (-> obj rbody state matrix vector 1 y) (cos 18204.445)) - (>= (- (current-time) (-> obj crash-time)) (seconds 3)) + ((< (-> this crash-level) 3) + (when (time-elapsed? (-> this crash-time) (the-as time-frame (-> this crash-duration))) + (if (or (>= (-> this rbody state matrix vector 1 y) (cos 18204.445)) + (time-elapsed? (-> this crash-time) (seconds 3)) ) - (vehicle-method-77 obj) + (vehicle-method-77 this) ) ) ) ) - (set! (-> obj force-level) (-> obj crash-level)) + (set! (-> this force-level) (-> this crash-level)) (cond - ((>= (-> obj hit-points) 0.9) - (set! (-> obj power-fluctuation-factor) 0.01) + ((>= (-> this hit-points) 0.9) + (set! (-> this power-fluctuation-factor) 0.01) ) - ((>= (-> obj hit-points) 0.75) - (set! (-> obj power-fluctuation-factor) 0.02) + ((>= (-> this hit-points) 0.75) + (set! (-> this power-fluctuation-factor) 0.02) ) - ((>= (-> obj hit-points) 0.5) - (set! (-> obj power-fluctuation-factor) 0.04) + ((>= (-> this hit-points) 0.5) + (set! (-> this power-fluctuation-factor) 0.04) ) - ((>= (-> obj hit-points) 0.3) - (set! (-> obj power-fluctuation-factor) 0.08) + ((>= (-> this hit-points) 0.3) + (set! (-> this power-fluctuation-factor) 0.08) ) - ((>= (-> obj hit-points) 0.15) - (set! (-> obj power-fluctuation-factor) 0.16) + ((>= (-> this hit-points) 0.15) + (set! (-> this power-fluctuation-factor) 0.16) ) - ((>= (-> obj hit-points) 0.05) - (set! (-> obj power-fluctuation-factor) 0.32) + ((>= (-> this hit-points) 0.05) + (set! (-> this power-fluctuation-factor) 0.32) ) (else - (set! (-> obj power-fluctuation-factor) 0.7) + (set! (-> this power-fluctuation-factor) 0.7) ) ) (let ((f1-6 0.0)) - (when (logtest? (rigid-body-object-flag ignition) (-> obj flags)) - (let ((f0-23 (- 1.0 (* (rand-vu) (-> obj power-fluctuation-factor))))) + (when (logtest? (rigid-body-object-flag ignition) (-> this flags)) + (let ((f0-23 (- 1.0 (* (rand-vu) (-> this power-fluctuation-factor))))) (set! f1-6 (* f0-23 f0-23)) ) - (if (not (logtest? (-> obj flags) (rigid-body-object-flag riding))) + (if (not (logtest? (-> this flags) (rigid-body-object-flag riding))) (set! f1-6 (* 0.5 f1-6)) ) ) - (+! (-> obj power-level) - (* (- f1-6 (-> obj power-level)) - (fmin 1.0 (* (+ 1.0 (* 50.0 (-> obj power-fluctuation-factor))) (seconds-per-frame))) + (+! (-> this power-level) + (* (- f1-6 (-> this power-level)) + (fmin 1.0 (* (+ 1.0 (* 50.0 (-> this power-fluctuation-factor))) (seconds-per-frame))) ) ) ) - (when (logtest? (rigid-body-object-flag turbo-boost) (-> obj flags)) - (if (or (>= (- (current-time) (-> obj turbo-boost-time)) (the-as time-frame (-> obj turbo-boost-duration))) - (and (>= (- (current-time) (-> obj turbo-boost-time)) (seconds 0.1)) (>= (-> obj controls brake) 0.75)) + (when (logtest? (rigid-body-object-flag turbo-boost) (-> this flags)) + (if (or (time-elapsed? (-> this turbo-boost-time) (the-as time-frame (-> this turbo-boost-duration))) + (and (time-elapsed? (-> this turbo-boost-time) (seconds 0.1)) (>= (-> this controls brake) 0.75)) ) - (logclear! (-> obj flags) (rigid-body-object-flag turbo-boost)) + (logclear! (-> this flags) (rigid-body-object-flag turbo-boost)) ) ) (cond - ((logtest? (rigid-body-object-flag ignition) (-> obj flags)) - (-> obj controls throttle) + ((logtest? (rigid-body-object-flag ignition) (-> this flags)) + (-> this controls throttle) (let* ((f1-13 (fmax 0.0 - (fmin 1.0 (/ (* (vector-length (-> obj rbody state lin-velocity)) (-> obj info engine-intake-factor)) - (-> obj info max-xz-speed) + (fmin 1.0 (/ (* (vector-length (-> this rbody state lin-velocity)) (-> this info engine-intake-factor)) + (-> this info max-xz-speed) ) ) ) ) - (f1-16 (fmin (-> obj controls throttle) (* 0.83333 (+ 0.5 f1-13)))) + (f1-16 (fmin (-> this controls throttle) (* 0.83333 (+ 0.5 f1-13)))) ) 0 - (if (logtest? (rigid-body-object-flag turbo-boost) (-> obj flags)) - (set! f1-16 (+ 1.0 (* (-> obj turbo-boost-factor) (-> obj info turbo-boost-factor)))) + (if (logtest? (rigid-body-object-flag turbo-boost) (-> this flags)) + (set! f1-16 (+ 1.0 (* (-> this turbo-boost-factor) (-> this info turbo-boost-factor)))) ) - (if (< (-> obj engine-thrust) f1-16) - (+! (-> obj engine-thrust) - (* (- f1-16 (-> obj engine-thrust)) (fmin 1.0 (* (-> obj info engine-response-rate) (seconds-per-frame)))) + (if (< (-> this engine-thrust) f1-16) + (+! (-> this engine-thrust) + (* (- f1-16 (-> this engine-thrust)) (fmin 1.0 (* (-> this info engine-response-rate) (seconds-per-frame)))) ) - (seek! (-> obj engine-thrust) f1-16 (seconds-per-frame)) + (seek! (-> this engine-thrust) f1-16 (seconds-per-frame)) ) ) ) (else - (set! (-> obj engine-thrust) 0.0) + (set! (-> this engine-thrust) 0.0) ) ) - (set! (-> obj engine-power-factor) (fabs (-> obj engine-thrust))) - (if (and (logtest? (rigid-body-object-flag jump) (-> obj flags)) (< 0.0 (-> obj jump-time))) - (set! (-> obj jump-thrust) 1.0) - (set! (-> obj jump-thrust) 0.0) + (set! (-> this engine-power-factor) (fabs (-> this engine-thrust))) + (if (and (logtest? (rigid-body-object-flag jump) (-> this flags)) (< 0.0 (-> this jump-time))) + (set! (-> this jump-thrust) 1.0) + (set! (-> this jump-thrust) 0.0) ) (cond - ((logtest? (rigid-body-object-flag jump) (-> obj flags)) - (seek! (-> obj jump-time) 0.0 (seconds-per-frame)) + ((logtest? (rigid-body-object-flag jump) (-> this flags)) + (seek! (-> this jump-time) 0.0 (seconds-per-frame)) ) - ((not (logtest? (-> obj flags) (rigid-body-object-flag in-air))) - (if (< 0.0 (-> obj jump-time)) - (logclear! (-> obj flags) (rigid-body-object-flag jump-sound)) + ((not (logtest? (-> this flags) (rigid-body-object-flag in-air))) + (if (< 0.0 (-> this jump-time)) + (logclear! (-> this flags) (rigid-body-object-flag jump-sound)) ) - (seek! (-> obj jump-time) 0.1 (* 0.5 (seconds-per-frame))) + (seek! (-> this jump-time) 0.1 (* 0.5 (seconds-per-frame))) ) ) - (when (and (logtest? (rigid-body-object-flag jump) (-> obj flags)) - (not (logtest? (-> obj flags) (rigid-body-object-flag in-air))) - (logtest? (-> obj vehicle-jkhn1b23jn1) 1024) + (when (and (logtest? (rigid-body-object-flag jump) (-> this flags)) + (not (logtest? (-> this flags) (rigid-body-object-flag in-air))) + (logtest? (-> this vehicle-jkhn1b23jn1) 1024) ) - (logior! (-> obj flags) (rigid-body-object-flag hard-turn)) - (set! (-> obj turn-time) (current-time)) + (logior! (-> this flags) (rigid-body-object-flag hard-turn)) + (set-time! (-> this turn-time)) ) - (if (or (not (logtest? (rigid-body-object-flag jump) (-> obj flags))) - (>= (- (current-time) (-> obj turn-time)) (seconds 1)) + (if (or (not (logtest? (rigid-body-object-flag jump) (-> this flags))) + (time-elapsed? (-> this turn-time) (seconds 1)) ) - (logclear! (-> obj flags) (rigid-body-object-flag hard-turn)) + (logclear! (-> this flags) (rigid-body-object-flag hard-turn)) ) - (if (logtest? (-> obj flags) (rigid-body-object-flag on-ground on-flight-level)) - (set! (-> obj air-time) (current-time)) + (if (logtest? (-> this flags) (rigid-body-object-flag on-ground on-flight-level)) + (set-time! (-> this air-time)) ) - (when (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags)) - (if (or (and (> (-> obj flight-level-index) 0) - (< (fabs (- (-> obj flight-level) (-> obj rbody state position y))) 8192.0) - (< (fabs (-> obj rbody state lin-velocity y)) 8192.0) + (when (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags)) + (if (or (and (> (-> this flight-level-index) 0) + (< (fabs (- (-> this flight-level) (-> this rbody state position y))) 8192.0) + (< (fabs (-> this rbody state lin-velocity y)) 8192.0) ) - (and (zero? (-> obj flight-level-index)) (logtest? (-> obj flags) (rigid-body-object-flag on-ground))) + (and (zero? (-> this flight-level-index)) (logtest? (-> this flags) (rigid-body-object-flag on-ground))) ) - (vehicle-method-79 obj) + (vehicle-method-79 this) ) - (when (and (> (-> obj flight-level-index) 0) (>= (- (current-time) (-> obj transition-time)) (seconds 2))) - (vehicle-method-79 obj) - (vehicle-method-83 obj) + (when (and (> (-> this flight-level-index) 0) (time-elapsed? (-> this transition-time) (seconds 2))) + (vehicle-method-79 this) + (vehicle-method-83 this) ) ) - (when (and (logtest? (rigid-body-object-flag flight-level-transition-ending) (-> obj flags)) - (>= (- (current-time) (-> obj transition-end-time)) (seconds 1)) + (when (and (logtest? (rigid-body-object-flag flight-level-transition-ending) (-> this flags)) + (time-elapsed? (-> this transition-end-time) (seconds 1)) ) - (logclear! (-> obj flags) (rigid-body-object-flag flight-level-transition-ending)) - (vehicle-method-92 obj) + (logclear! (-> this flags) (rigid-body-object-flag flight-level-transition-ending)) + (vehicle-method-92 this) ) 0 (none) @@ -583,7 +585,7 @@ ;; definition for method 97 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-97 vehicle ((obj vehicle)) +(defmethod vehicle-method-97 vehicle ((this vehicle)) (local-vars (v1-88 float) (v1-98 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -591,7 +593,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (when (logtest? (rigid-body-object-flag camera) (-> obj flags)) + (when (logtest? (rigid-body-object-flag camera) (-> this flags)) (let ((f0-0 -4096000.0)) (dotimes (v1-4 (-> *level* length)) (let ((a0-5 (-> *level* level v1-4))) @@ -612,64 +614,64 @@ (set-setting! 'string-camera-ceiling 'abs f0-0 0) ) (cond - ((logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (when (or (< 55296.0 (-> obj rbody state lin-velocity y)) (>= (- (current-time) (-> obj air-time)) (seconds 0.75))) + ((logtest? (-> this flags) (rigid-body-object-flag in-air)) + (when (or (< 55296.0 (-> this rbody state lin-velocity y)) (time-elapsed? (-> this air-time) (seconds 0.75))) (set-setting! 'extra-follow-height 'abs (meters -4) 0) - (send-event *camera* 'set-max-angle-offset (-> obj info camera-air-max-angle-offset)) + (send-event *camera* 'set-max-angle-offset (-> this info camera-air-max-angle-offset)) ) ) (else (remove-setting! 'extra-follow-height) - (send-event *camera* 'set-max-angle-offset (-> obj info camera-normal-max-angle-offset)) + (send-event *camera* 'set-max-angle-offset (-> this info camera-normal-max-angle-offset)) ) ) - (let ((f0-5 (vector-dot (-> obj rbody state lin-velocity) (-> obj rbody state matrix vector 2)))) + (let ((f0-5 (vector-dot (-> this rbody state lin-velocity) (-> this rbody state matrix vector 2)))) (cond - ((= (-> obj crash-level) 2) - (vehicle-method-90 obj) + ((= (-> this crash-level) 2) + (vehicle-method-90 this) ) - ((< f0-5 (-> obj info camera-max-lookaround-speed)) - (vehicle-method-90 obj) + ((< f0-5 (-> this info camera-max-lookaround-speed)) + (vehicle-method-90 this) ) - ((< (+ 4096.0 (-> obj info camera-max-lookaround-speed)) f0-5) - (vehicle-method-89 obj) + ((< (+ 4096.0 (-> this info camera-max-lookaround-speed)) f0-5) + (vehicle-method-89 this) ) ) ) - (when (not (logtest? (rigid-body-object-flag flight-level-transition) (-> obj flags))) + (when (not (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags))) (let* ((f0-6 1.0) - (v1-57 (-> obj rbody state lin-velocity)) + (v1-57 (-> this rbody state lin-velocity)) (f0-7 (fmin f0-6 - (/ (sqrtf (+ (* (-> v1-57 x) (-> v1-57 x)) (* (-> v1-57 z) (-> v1-57 z)))) (-> obj info max-xz-speed)) + (/ (sqrtf (+ (* (-> v1-57 x) (-> v1-57 x)) (* (-> v1-57 z) (-> v1-57 z)))) (-> this info max-xz-speed)) ) ) ) - (seek! (-> obj cam-speed-interp) f0-7 (* 0.1 (seconds-per-frame))) + (seek! (-> this cam-speed-interp) f0-7 (* 0.1 (seconds-per-frame))) ) - (let ((f30-0 (-> obj cam-speed-interp))) + (let ((f30-0 (-> this cam-speed-interp))) (if #f (set! f30-0 (fmax 0.0 (fmin 1.0 (analog-input (the-as int (-> *cpad-list* cpads 1 righty)) 128.0 48.0 110.0 -1.0))) ) ) - (let ((f0-15 (lerp-scale (-> obj info camera-min-fov) (-> obj info camera-max-fov) f30-0 0.0 1.0))) + (let ((f0-15 (lerp-scale (-> this info camera-min-fov) (-> this info camera-max-fov) f30-0 0.0 1.0))) (set-setting! 'fov 'abs f0-15 0) ) (let ((f30-2 (lerp-scale 1.0 0.6 f30-0 0.0 1.0))) - (set-setting! 'string-min-length 'abs (* f30-2 (-> obj info camera-string-min-length)) 0) - (set-setting! 'string-max-length 'abs (* f30-2 (-> obj info camera-string-max-length)) 0) + (set-setting! 'string-min-length 'abs (* f30-2 (-> this info camera-string-min-length)) 0) + (set-setting! 'string-max-length 'abs (* f30-2 (-> this info camera-string-max-length)) 0) ) ) ) (when *target* (let ((v1-83 (-> *target* draw shadow-ctrl settings shadow-dir quad))) - (set! (-> obj draw shadow-ctrl settings shadow-dir quad) v1-83) + (set! (-> this draw shadow-ctrl settings shadow-dir quad) v1-83) ) (cond - ((logtest? (rigid-body-object-flag camera-rapid-track-mode) (-> obj flags)) - (.lvf vf1 (&-> (-> obj root transv) quad)) + ((logtest? (rigid-body-object-flag camera-rapid-track-mode) (-> this flags)) + (.lvf vf1 (&-> (-> this root transv) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -680,7 +682,7 @@ (f1-13 122880.0) ) (if (< f0-20 (* f1-13 f1-13)) - (vehicle-method-92 obj) + (vehicle-method-92 this) ) ) ) @@ -688,7 +690,7 @@ (let* ((f0-21 143360.0) (f0-23 (* f0-21 f0-21)) ) - (.lvf vf1 (&-> (-> obj root transv) quad)) + (.lvf vf1 (&-> (-> this root transv) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -696,7 +698,7 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-98 vf1) (if (< f0-23 v1-98) - (vehicle-method-91 obj) + (vehicle-method-91 this) ) ) ) @@ -716,7 +718,7 @@ (set-setting! 'vertical-follow-matches-camera #f 0.0 0) ) (else - (if (< (fabs (-> obj root transv y)) 8192.0) + (if (< (fabs (-> this root transv y)) 8192.0) (remove-setting! 'vertical-follow-matches-camera) ) ) @@ -734,20 +736,20 @@ ;; definition for method 120 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-120 vehicle ((obj vehicle)) - (let ((s5-0 (-> obj draw shadow-ctrl))) +(defmethod vehicle-method-120 vehicle ((this vehicle)) + (let ((s5-0 (-> this draw shadow-ctrl))) (when (!= *vehicle-shadow-control-disabled* s5-0) - (let ((f30-0 (vector-vector-xz-distance (camera-pos) (-> obj root trans)))) + (let ((f30-0 (vector-vector-xz-distance (camera-pos) (-> this root trans)))) (cond ((< 245760.0 f30-0) (logior! (-> s5-0 settings flags) (shadow-flags disable-draw)) 0 - (set! (-> obj draw bounds w) (-> obj bound-radius)) + (set! (-> this draw bounds w) (-> this bound-radius)) ) (else - (let ((s4-1 (-> obj root))) + (let ((s4-1 (-> this root))) (when (or (logtest? (-> s5-0 settings flags) (shadow-flags disable-draw)) - (= (-> obj controller traffic sync-mask-8) (ash 1 (logand (-> obj traffic-priority-id) 7))) + (= (-> this controller traffic sync-mask-8) (ash 1 (logand (-> this traffic-priority-id) 7))) ) (let ((s3-0 (new 'stack-no-clear 'collide-query))) (logclear! (-> s4-1 status) (collide-status on-ground)) @@ -758,8 +760,8 @@ (set! (-> s4-1 gspot-normal quad) (-> s3-0 best-other-tri normal quad)) (set! (-> s4-1 ground-pat) (-> s3-0 best-other-tri pat)) (when (logtest? (-> s5-0 settings flags) (shadow-flags disable-draw)) - (set! (-> s5-0 settings top-plane w) (- (-> s5-0 settings center y) (-> obj root gspot-pos y))) - (set! (-> s5-0 settings bot-plane w) (- (-> s5-0 settings center y) (-> obj root gspot-pos y))) + (set! (-> s5-0 settings top-plane w) (- (-> s5-0 settings center y) (-> this root gspot-pos y))) + (set! (-> s5-0 settings bot-plane w) (- (-> s5-0 settings center y) (-> this root gspot-pos y))) ) (let ((v1-29 s5-0)) (logclear! (-> v1-29 settings flags) (shadow-flags disable-draw)) @@ -776,20 +778,20 @@ ) ) ) - (set! (-> obj draw bounds w) (lerp-scale - (- (-> s5-0 settings center y) (-> obj root gspot-pos y)) - (-> obj bound-radius) - f30-0 - 81920.0 - 122880.0 - ) + (set! (-> this draw bounds w) (lerp-scale + (- (-> s5-0 settings center y) (-> this root gspot-pos y)) + (-> this bound-radius) + f30-0 + 81920.0 + 122880.0 + ) ) - (if (< (-> obj draw bounds w) (-> obj bound-radius)) - (set! (-> obj draw bounds w) (-> obj bound-radius)) + (if (< (-> this draw bounds w) (-> this bound-radius)) + (set! (-> this draw bounds w) (-> this bound-radius)) ) (let* ((f0-13 (lerp-scale 0.0 1.0 f30-0 245760.0 40960.0)) - (f30-1 (* 4096.0 (+ 5.0 (* 5.0 (- 1.0 (-> obj root gspot-normal y)))))) - (f28-0 (- (-> s5-0 settings center y) (-> obj root gspot-pos y))) + (f30-1 (* 4096.0 (+ 5.0 (* 5.0 (- 1.0 (-> this root gspot-normal y)))))) + (f28-0 (- (-> s5-0 settings center y) (-> this root gspot-pos y))) (f0-16 (fmax 0.01 (+ (* -2.0 f0-13 f0-13 f0-13) (* 3.0 f0-13 f0-13)))) ) (set! (-> s5-0 settings shadow-dir w) (+ 20480.0 (* 409600.0 f0-16) f28-0)) @@ -803,7 +805,7 @@ ) ) ) - (set! (-> obj vehicle-jkhn1b23jn1) (the-as int (-> obj flags))) + (set! (-> this vehicle-jkhn1b23jn1) (the-as int (-> this flags))) (ja-post) 0 (none) @@ -812,46 +814,47 @@ ;; definition for method 51 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-51 vehicle ((obj vehicle)) +(defmethod rigid-body-object-method-51 vehicle ((this vehicle)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f30-0 -4096000.0)) - (set! (-> s5-0 start-pos quad) (-> obj rbody state position quad)) - (vector-float*! (-> s5-0 move-dist) (-> obj rbody state lin-velocity) (seconds-per-frame)) + (set! (-> s5-0 start-pos quad) (-> this rbody state position quad)) + (vector-float*! (-> s5-0 move-dist) (-> this rbody state lin-velocity) (seconds-per-frame)) (let ((v1-4 s5-0)) - (set! (-> v1-4 radius) (+ 4096.0 (-> obj root root-prim local-sphere w))) - (set! (-> v1-4 collide-with) (collide-spec - backgnd - crate - civilian - enemy - obstacle - vehicle-sphere - hit-by-player-list - hit-by-others-list - collectable - blocking-plane - pusher - vehicle-mesh-probeable - ) + (set! (-> v1-4 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) + (set! (-> v1-4 collide-with) + (collide-spec + backgnd + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + collectable + blocking-plane + pusher + vehicle-mesh-probeable + ) ) - (set! (-> v1-4 ignore-process0) obj) + (set! (-> v1-4 ignore-process0) this) (set! (-> v1-4 ignore-process1) #f) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) ) - (if (focus-test? obj dead) + (if (focus-test? this dead) (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) ) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-touching)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-touching)) (logclear! (-> s5-0 collide-with) (collide-spec jak player-list)) ) (let ((s4-0 (new 'stack-no-clear 'water-info))) - (water-info-init! (-> obj root) s4-0 (collide-action solid semi-solid)) + (water-info-init! (-> this root) s4-0 (collide-action solid semi-solid)) (if (and (logtest? (-> s4-0 flags) (water-flags active)) (logtest? (water-flags over-water) (-> s4-0 flags))) (set! f30-0 (-> s4-0 base-height)) ) ) - (set! (-> obj water-height) f30-0) + (set! (-> this water-height) f30-0) (when (< (- (+ (-> s5-0 start-pos y) (fmin 0.0 (-> s5-0 move-dist y))) (-> s5-0 radius)) f30-0) (let ((v1-23 (new 'static 'water-control :flags (water-flags active swim-ground can-ground over-water) :joint-index 3) @@ -860,15 +863,20 @@ (logior! (-> s5-0 collide-with) (collide-spec water)) (set! (-> v1-23 height) f30-0) (set! (-> v1-23 collide-height) f30-0) - (set! (-> obj water) v1-23) + (set! (-> this water) v1-23) ) ) ) (fill-using-line-sphere *collide-cache* s5-0) ) - (set! (-> obj water) (the-as water-control 0)) + (set! (-> this water) (the-as water-control 0)) 0 - (rigid-body-control-method-10 (-> obj rbody) obj (-> obj rbody state time-remaining) (-> obj max-time-step)) + (rigid-body-control-method-10 + (-> this rbody) + this + (-> this rbody state time-remaining) + (-> this max-time-step) + ) 0 (none) ) @@ -876,22 +884,22 @@ ;; definition for method 52 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-52 vehicle ((obj vehicle)) +(defmethod rigid-body-object-method-52 vehicle ((this vehicle)) (with-pp (let ((v1-0 (new 'stack-no-clear 'vehicle-control-point))) - (set! (-> v1-0 local-pos quad) (-> obj root transv quad)) - (vector-! (-> v1-0 normal) (-> obj rbody state lin-velocity) (-> v1-0 local-pos)) - (vector-float*! (-> obj lin-acceleration) (-> v1-0 normal) (-> pp clock frames-per-second)) + (set! (-> v1-0 local-pos quad) (-> this root transv quad)) + (vector-! (-> v1-0 normal) (-> this rbody state lin-velocity) (-> v1-0 local-pos)) + (vector-float*! (-> this lin-acceleration) (-> v1-0 normal) (-> pp clock frames-per-second)) ) - (set! (-> obj root transv quad) (-> obj rbody state lin-velocity quad)) - (quaternion-copy! (-> obj root quat) (-> obj rbody state rotation)) - (let ((v1-6 (-> obj rbody)) - (a1-7 (-> obj root trans)) + (set! (-> this root transv quad) (-> this rbody state lin-velocity quad)) + (quaternion-copy! (-> this root quat) (-> this rbody state rotation)) + (let ((v1-6 (-> this rbody)) + (a1-7 (-> this root trans)) ) (rigid-body-method-23 (-> v1-6 state) a1-7) ) - (let* ((v1-11 (-> obj node-list data 0 bone transform)) - (a3-0 (-> obj rbody state matrix)) + (let* ((v1-11 (-> this node-list data 0 bone transform)) + (a3-0 (-> this rbody state matrix)) (a0-13 (-> a3-0 quad 0)) (a1-8 (-> a3-0 quad 1)) (a2-1 (-> a3-0 quad 2)) @@ -902,66 +910,66 @@ (set! (-> v1-11 quad 2) a2-1) (set! (-> v1-11 trans quad) a3-1) ) - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) - (vehicle-method-119 obj) - (let ((f0-1 (-> obj player-dist2)) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (vehicle-method-119 this) + (let ((f0-1 (-> this player-dist2)) (f1-0 245760.0) ) (if (< f0-1 (* f1-0 f1-0)) - (do-engine-sounds obj) + (do-engine-sounds this) ) ) - (when (logtest? (-> obj draw status) (draw-control-status on-screen)) + (when (logtest? (-> this draw status) (draw-control-status on-screen)) (if #t - (draw-thrusters obj) + (draw-thrusters this) ) - (let ((f0-2 (-> obj camera-dist2)) + (let ((f0-2 (-> this camera-dist2)) (f1-3 245760.0) ) (if (< f0-2 (* f1-3 f1-3)) - (update-joint-mods obj) + (update-joint-mods this) ) ) ) - (vehicle-method-120 obj) - (let ((s5-0 (-> obj root))) + (vehicle-method-120 this) + (let ((s5-0 (-> this root))) (update-transforms s5-0) - (when (and (logtest? (-> obj flags) (rigid-body-object-flag player-touching)) - (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (when (and (logtest? (-> this flags) (rigid-body-object-flag player-touching)) + (not (logtest? (-> this flags) (rigid-body-object-flag player-driving))) ) (pull-riders! s5-0) (cond ((logtest? (do-push-aways s5-0) (collide-spec jak)) - (+! (-> obj overlap-player-counter) 1) - (when (< (the-as uint 60) (-> obj overlap-player-counter)) + (+! (-> this overlap-player-counter) 1) + (when (< (the-as uint 60) (-> this overlap-player-counter)) (send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'smush) (damage 1000.0))) ) - (set! (-> obj overlap-player-counter) (the-as uint 0)) + (set! (-> this overlap-player-counter) (the-as uint 0)) 0 ) ) (else - (set! (-> obj overlap-player-counter) (the-as uint 0)) + (set! (-> this overlap-player-counter) (the-as uint 0)) 0 ) ) ) ) - (if (and (logtest? (-> obj flags) (rigid-body-object-flag dead)) - (not (logtest? (-> obj focus-status) (focus-status dead))) + (if (and (logtest? (-> this flags) (rigid-body-object-flag dead)) + (not (logtest? (-> this focus-status) (focus-status dead))) ) - (go (method-of-object obj crash)) + (go (method-of-object this crash)) ) - (if (logtest? (rigid-body-object-flag nav-spheres) (-> obj flags)) - (vehicle-method-143 obj) + (if (logtest? (rigid-body-object-flag nav-spheres) (-> this flags)) + (vehicle-method-143 this) ) - (seek! (-> obj scrape-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) - (mem-copy! (the-as pointer (-> obj prev-controls)) (the-as pointer (-> obj controls)) 16) - (logclear! (-> obj flags) (rigid-body-object-flag player-impulse-force player-contact-force jump)) + (seek! (-> this scrape-sound-envelope) 0.0 (* 2.0 (seconds-per-frame))) + (mem-copy! (the-as pointer (-> this prev-controls)) (the-as pointer (-> this controls)) 16) + (logclear! (-> this flags) (rigid-body-object-flag player-impulse-force player-contact-force jump)) 0 (none) ) @@ -969,21 +977,21 @@ ;; definition for method 121 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-121 vehicle ((obj vehicle)) - (if (>= (- (current-time) (-> obj player-touch-time)) (seconds 0.1)) - (logclear! (-> obj flags) (rigid-body-object-flag player-touching player-edge-grabbing player-standing-on)) +(defmethod vehicle-method-121 vehicle ((this vehicle)) + (if (time-elapsed? (-> this player-touch-time) (seconds 0.1)) + (logclear! (-> this flags) (rigid-body-object-flag player-touching player-edge-grabbing player-standing-on)) ) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-touching)) - (detect-riders! (-> obj root)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-touching)) + (detect-riders! (-> this root)) 0 ) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-touching player-driving)) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (logclear! (-> obj skel status) (joint-control-status sync-math)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-touching player-driving)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (logclear! (-> this skel status) (joint-control-status sync-math)) ) - (vehicle-method-96 obj) - (let ((a1-0 (-> obj rbody state position))) - (set! (-> obj flight-level) (get-height-at-point *traffic-height-map* a1-0)) + (vehicle-method-96 this) + (let ((a1-0 (-> this rbody state position))) + (set! (-> this flight-level) (get-height-at-point *traffic-height-map* a1-0)) ) 0 (none) @@ -991,7 +999,7 @@ ;; definition for method 37 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-37 vehicle ((obj vehicle)) +(defmethod rigid-body-object-method-37 vehicle ((this vehicle)) (local-vars (a0-14 int) (a0-16 int) (a0-19 int) (a0-21 int)) (let* ((v1-1 (-> *perf-stats* data 37)) (a0-1 (-> v1-1 ctrl)) @@ -1011,24 +1019,24 @@ (.sync.p) (label cfg-2) 0 - (set! (-> obj camera-dist2) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (if (not (vehicle-method-105 obj)) - (rigid-body-object-method-39 obj) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (if (not (vehicle-method-105 this)) + (rigid-body-object-method-39 this) ) ) (else - (if (vehicle-method-105 obj) - (rigid-body-object-method-38 obj) + (if (vehicle-method-105 this) + (rigid-body-object-method-38 this) ) ) ) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (vehicle-method-121 obj) - (vehicle-method-106 obj) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (vehicle-method-121 this) + (vehicle-method-106 this) ) (else (let* ((v1-26 (-> *perf-stats* data 20)) @@ -1049,7 +1057,7 @@ (.sync.p) (label cfg-12) 0 - (vehicle-method-120 obj) + (vehicle-method-120 this) (let ((v1-31 (-> *perf-stats* data 20))) (b! (zero? (-> v1-31 ctrl)) cfg-14 :delay (nop!)) (.mtc0 Perf 0) @@ -1082,25 +1090,25 @@ ;; definition for method 123 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-123 vehicle ((obj vehicle)) +(defmethod vehicle-method-123 vehicle ((this vehicle)) (local-vars (v1-4 symbol) (a0-21 int) (a0-23 int)) - (set! (-> obj camera-dist2) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (b! - (not (logtest? (rigid-body-object-flag traffic-managed) (-> obj flags))) + (not (logtest? (rigid-body-object-flag traffic-managed) (-> this flags))) cfg-3 :likely-delay (set! v1-4 #f) ) - (set! v1-4 (not (logtest? (-> obj flags) (rigid-body-object-flag persistent)))) + (set! v1-4 (not (logtest? (-> this flags) (rigid-body-object-flag persistent)))) (label cfg-3) (b! (not v1-4) cfg-20 :delay (empty-form)) - (let ((f0-3 (fmin (-> obj player-dist2) (-> obj camera-dist2)))) + (let ((f0-3 (fmin (-> this player-dist2) (-> this camera-dist2)))) (let ((f1-1 819200.0)) (b! (>= (* f1-1 f1-1) f0-3) cfg-8) ) (let ((f1-4 819200.0)) (if (< (* f1-4 f1-4) f0-3) - (vehicle-method-113 obj) + (vehicle-method-113 this) ) ) (b! #t cfg-19 :delay (nop!)) @@ -1108,44 +1116,44 @@ (let ((f1-7 81920.0)) (b! (>= (* f1-7 f1-7) f0-3) cfg-18) ) - (b! (not (logtest? (-> obj draw status) (draw-control-status on-screen))) cfg-11 :delay (nop!)) - (set! (-> obj state-time) (current-time)) + (b! (not (logtest? (-> this draw status) (draw-control-status on-screen))) cfg-11 :delay (nop!)) + (set-time! (-> this state-time)) (b! #t cfg-17 :delay (nop!)) (label cfg-11) - (if (or (>= (- (current-time) (-> obj state-time)) (seconds 10)) (let ((f1-10 409600.0)) - (< (* f1-10 f1-10) f0-3) - ) + (if (or (time-elapsed? (-> this state-time) (seconds 10)) (let ((f1-10 409600.0)) + (< (* f1-10 f1-10) f0-3) + ) ) - (vehicle-method-113 obj) + (vehicle-method-113 this) ) ) (label cfg-17) (b! #t cfg-19 :delay (nop!)) (label cfg-18) - (set! (-> obj state-time) (current-time)) + (set-time! (-> this state-time)) (label cfg-19) 0 (label cfg-20) - (check-player-get-on obj) - (b! (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) cfg-24 :delay (nop!)) - (if (not (vehicle-method-105 obj)) - (rigid-body-object-method-39 obj) + (check-player-get-on this) + (b! (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) cfg-24 :delay (nop!)) + (if (not (vehicle-method-105 this)) + (rigid-body-object-method-39 this) ) (b! #t cfg-26 :delay (nop!)) (label cfg-24) - (if (vehicle-method-105 obj) - (rigid-body-object-method-38 obj) + (if (vehicle-method-105 this) + (rigid-body-object-method-38 this) ) (label cfg-26) - (b! (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) cfg-31 :delay (nop!)) - (vector-reset! (-> obj target-acceleration)) - (when (logtest? (-> obj flags) (rigid-body-object-flag disturbed)) - (if (logtest? (-> obj flags) (rigid-body-object-flag in-air)) - (set! (-> obj disturbed-time) (current-time)) + (b! (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) cfg-31 :delay (nop!)) + (vector-reset! (-> this target-acceleration)) + (when (logtest? (-> this flags) (rigid-body-object-flag disturbed)) + (if (logtest? (-> this flags) (rigid-body-object-flag in-air)) + (set-time! (-> this disturbed-time)) ) ) - (vehicle-method-121 obj) - (vehicle-method-106 obj) + (vehicle-method-121 this) + (vehicle-method-106 this) (b! #t cfg-36 :delay (nop!)) (label cfg-31) (let* ((v1-65 (-> *perf-stats* data 20)) @@ -1166,7 +1174,7 @@ (.sync.p) (label cfg-33) 0 - (vehicle-method-120 obj) + (vehicle-method-120 this) (let ((v1-70 (-> *perf-stats* data 20))) (b! (zero? (-> v1-70 ctrl)) cfg-35 :delay (nop!)) (.mtc0 Perf 0) @@ -1187,7 +1195,7 @@ ;; definition for method 122 of type vehicle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-122 vehicle ((obj vehicle)) +(defmethod vehicle-method-122 vehicle ((this vehicle)) (local-vars (a0-23 int) (a0-25 int) (a0-35 int) (a0-37 int) (a0-40 int) (a0-42 int)) (let* ((v1-1 (-> *perf-stats* data 37)) (a0-1 (-> v1-1 ctrl)) @@ -1207,42 +1215,42 @@ (.sync.p) (label cfg-2) 0 - (set! (-> obj camera-dist2) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (set! (-> this camera-dist2) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (vehicle-controller-method-18 - (-> obj controller) - (-> obj target-acceleration) - (-> obj root transv) - obj + (-> this controller) + (-> this target-acceleration) + (-> this root transv) + this (/ 1.0 (seconds-per-frame)) ) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (if (not (vehicle-method-105 obj)) - (rigid-body-object-method-39 obj) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (if (not (vehicle-method-105 this)) + (rigid-body-object-method-39 this) ) ) (else - (if (vehicle-method-105 obj) - (rigid-body-object-method-38 obj) + (if (vehicle-method-105 this) + (rigid-body-object-method-38 this) ) ) ) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (vehicle-method-93 obj) - (vehicle-method-106 obj) - (vehicle-method-121 obj) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (vehicle-method-93 this) + (vehicle-method-106 this) + (vehicle-method-121 this) ) (else (let ((f1-3 (* 0.000024414063 - (vector-dot (the-as vector (-> obj node-list data 0 bone transform)) (-> obj target-acceleration)) + (vector-dot (the-as vector (-> this node-list data 0 bone transform)) (-> this target-acceleration)) ) ) ) - (+! (-> obj controls steering) (* 0.1 (- f1-3 (-> obj controls steering)))) + (+! (-> this controls steering) (* 0.1 (- f1-3 (-> this controls steering)))) ) - (set! (-> obj controls steering) (fmax -1.0 (fmin 1.0 (-> obj controls steering)))) + (set! (-> this controls steering) (fmax -1.0 (fmin 1.0 (-> this controls steering)))) (let* ((v1-42 (-> *perf-stats* data 19)) (a0-14 (-> v1-42 ctrl)) ) @@ -1261,21 +1269,21 @@ (.sync.p) (label cfg-12) 0 - (vehicle-method-104 obj) - (let ((f0-9 (-> obj player-dist2)) + (vehicle-method-104 this) + (let ((f0-9 (-> this player-dist2)) (f1-8 245760.0) ) (when (< f0-9 (* f1-8 f1-8)) - (let ((f0-10 (vector-length (-> obj root transv)))) - (seek! (-> obj engine-power-factor) (* 0.000016276043 f0-10) (* 6.0 (seconds-per-frame))) + (let ((f0-10 (vector-length (-> this root transv)))) + (seek! (-> this engine-power-factor) (* 0.000016276043 f0-10) (* 6.0 (seconds-per-frame))) ) - (do-engine-sounds obj) + (do-engine-sounds this) ) ) - (when (logtest? (-> obj draw status) (draw-control-status on-screen)) + (when (logtest? (-> this draw status) (draw-control-status on-screen)) (when #t - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) - (draw-thrusters obj) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (draw-thrusters this) ) ) (let ((v1-70 (-> *perf-stats* data 19))) @@ -1308,10 +1316,10 @@ (.sync.p) (label cfg-21) 0 - (vehicle-method-120 obj) - (update-transforms (-> obj root)) - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) - (vehicle-method-119 obj) + (vehicle-method-120 this) + (update-transforms (-> this root)) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) + (vehicle-method-119 this) (let ((v1-85 (-> *perf-stats* data 20))) (b! (zero? (-> v1-85 ctrl)) cfg-23 :delay (nop!)) (.mtc0 Perf 0) @@ -1344,20 +1352,20 @@ ;; definition for method 124 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-124 vehicle ((obj vehicle)) - (vehicle-method-94 obj) - (vehicle-method-121 obj) - (vehicle-method-97 obj) +(defmethod vehicle-method-124 vehicle ((this vehicle)) + (vehicle-method-94 this) + (vehicle-method-121 this) + (vehicle-method-97 this) 0 (none) ) ;; definition for method 31 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod alloc-and-init-rigid-body-control vehicle ((obj vehicle) (arg0 rigid-body-vehicle-constants)) +(defmethod alloc-and-init-rigid-body-control vehicle ((this vehicle) (arg0 rigid-body-vehicle-constants)) (if (logtest? (-> arg0 flags) 8) (iterate-prims - (-> obj root) + (-> this root) (lambda ((arg0 collide-shape-prim)) (case (-> arg0 prim-core prim-type) (((prim-type sphere)) @@ -1405,7 +1413,7 @@ ) ) (iterate-prims - (-> obj root) + (-> this root) (lambda ((arg0 collide-shape-prim)) (set! (-> arg0 prim-core collide-with) (collide-spec backgnd @@ -1427,61 +1435,61 @@ ) ) ) - (set! (-> obj bound-radius) (-> obj draw bounds w)) - (if (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) + (set! (-> this bound-radius) (-> this draw bounds w)) + (if (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -2048.0 -61440.0 69632.0 (shadow-flags shdf03) 245760.0) ) - (set! (-> obj draw shadow-ctrl) *vehicle-shadow-control-disabled*) + (set! (-> this draw shadow-ctrl) *vehicle-shadow-control-disabled*) ) - (logior! (-> obj root root-prim prim-core action) (collide-action pull-rider-can-collide)) - (set! (-> obj root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) - (set! (-> obj root event-self) 'touched) + (logior! (-> this root root-prim prim-core action) (collide-action pull-rider-can-collide)) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nopilot #x1 :probe #x1)) + (set! (-> this root event-self) 'touched) (let ((t9-3 (method-of-type rigid-body-object alloc-and-init-rigid-body-control))) - (t9-3 obj arg0) + (t9-3 this arg0) ) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-collision)) - (set! (-> obj root max-iteration-count) (the-as uint 8)) - (set! (-> obj max-time-step) 0.033333335) - (logior! (-> obj mask) (process-mask vehicle)) - (logclear! (-> obj mask) (process-mask actor-pause movie)) - (logclear! (-> obj skel status) (joint-control-status sync-math)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj nav) #f) - (let ((v1-32 (-> obj root root-prim))) - (set! (-> obj root backup-collide-as) (-> v1-32 prim-core collide-as)) - (set! (-> obj root backup-collide-with) (-> v1-32 prim-core collide-with)) + (logior! (-> this rbody state flags) (rigid-body-flag enable-collision)) + (set! (-> this root max-iteration-count) (the-as uint 8)) + (set! (-> this max-time-step) 0.033333335) + (logior! (-> this mask) (process-mask vehicle)) + (logclear! (-> this mask) (process-mask actor-pause movie)) + (logclear! (-> this skel status) (joint-control-status sync-math)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this nav) #f) + (let ((v1-32 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-32 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-32 prim-core collide-with)) ) - (rigid-body-object-method-40 obj) - (vehicle-controller-method-9 (-> obj controller)) - (vehicle-method-82 obj) - (set! (-> obj power-level) 0.5) - (set! (-> obj lights-factor) 0.0) - (set! (-> obj jump-thrust) 1.0) - (set! (-> obj turbo-boost-factor) 1.0) + (rigid-body-object-method-40 this) + (vehicle-controller-method-9 (-> this controller)) + (vehicle-method-82 this) + (set! (-> this power-level) 0.5) + (set! (-> this lights-factor) 0.0) + (set! (-> this jump-thrust) 1.0) + (set! (-> this turbo-boost-factor) 1.0) (dotimes (v1-43 4) - (set! (-> obj rider-array v1-43) (the-as handle #f)) + (set! (-> this rider-array v1-43) (the-as handle #f)) ) - (set! (-> obj engine-sound-id) (new 'static 'sound-id)) - (set! (-> obj thrust-sound-id) (new 'static 'sound-id)) - (set! (-> obj roll-sound-id) (new 'static 'sound-id)) - (set! (-> obj scrape-sound-id) (new 'static 'sound-id)) - (set! (-> obj extra-sound-id) (new 'static 'sound-id)) - (set! (-> obj damage-zap-sound-id) (new-sound-id)) - (set! (-> obj damage-pop-sound-id) (new-sound-id)) - (set! (-> obj controller target-speed-offset) (* (rand-vu) (-> arg0 target-speed-offset))) - (set! (-> obj draw lod-set lod 0 dist) 122880.0) - (set! (-> obj draw lod-set lod 1 dist) 204800.0) - (set! (-> obj draw lod-set lod 2 dist) 819200.0) - (if (zero? (-> obj draw light-index)) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this engine-sound-id) (new 'static 'sound-id)) + (set! (-> this thrust-sound-id) (new 'static 'sound-id)) + (set! (-> this roll-sound-id) (new 'static 'sound-id)) + (set! (-> this scrape-sound-id) (new 'static 'sound-id)) + (set! (-> this extra-sound-id) (new 'static 'sound-id)) + (set! (-> this damage-zap-sound-id) (new-sound-id)) + (set! (-> this damage-pop-sound-id) (new-sound-id)) + (set! (-> this controller target-speed-offset) (* (rand-vu) (-> arg0 target-speed-offset))) + (set! (-> this draw lod-set lod 0 dist) 122880.0) + (set! (-> this draw lod-set lod 1 dist) 204800.0) + (set! (-> this draw lod-set lod 2 dist) 819200.0) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 10)) ) (rigid-body-queue-method-11 - (if (logtest? (-> obj info flags) 1024) + (if (logtest? (-> this info flags) 1024) *race-rigid-body-queue* *traffic-rigid-body-queue* ) - obj + this ) 0 (none) @@ -1489,7 +1497,7 @@ ;; definition for method 47 of type vehicle ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-47 vehicle ((obj vehicle) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) +(defmethod rigid-body-object-method-47 vehicle ((this vehicle) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) (arg3 penetrate)) (local-vars (f0-2 float) (sv-96 vector)) (rlet ((vf0 :class vf) (vf4 :class vf) @@ -1498,7 +1506,7 @@ ) (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'matrix))) - (rigid-body-object-method-49 obj (the-as rigid-body-impact s5-0) arg2) + (rigid-body-object-method-49 this (the-as rigid-body-impact s5-0) arg2) (cond ((logtest? (attack-mask attacker-velocity) (-> arg1 mask)) (set! (-> s5-0 vector 2 quad) (-> arg1 attacker-velocity quad)) @@ -1538,14 +1546,14 @@ (and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'eco-dark)) ) (set! (-> s5-0 vector 2 y) (* 0.1 (-> s5-0 vector 2 y))) - (set! f0-2 (* 409600.0 (-> obj info info mass))) - (/ 0.4 (-> obj info damage-factor)) + (set! f0-2 (* 409600.0 (-> this info info mass))) + (/ 0.4 (-> this info damage-factor)) ) ((or (logtest? (penetrate dark-punch dark-bomb) arg3) (and (logtest? (penetrate dark-skin) arg3) (logtest? arg3 (penetrate punch spin))) ) - (set! f0-2 (* 204800.0 (-> obj info info mass))) - (/ 0.2 (-> obj info damage-factor)) + (set! f0-2 (* 204800.0 (-> this info info mass))) + (/ 0.2 (-> this info damage-factor)) ) ((logtest? (penetrate enemy-yellow-shot) arg3) (set! f0-2 49152.0) @@ -1594,27 +1602,27 @@ ) ) (set! (-> s5-0 trans x) f0-2) - (apply-damage obj (* 0.667 f1-0) (the-as rigid-body-impact s5-0)) + (apply-damage this (* 0.667 f1-0) (the-as rigid-body-impact s5-0)) ) - (rigid-body-object-method-42 obj) + (rigid-body-object-method-42 this) (let ((s3-1 (new 'stack-no-clear 'vector))) (set! (-> s3-1 quad) (-> s5-0 vector 2 quad)) (vector-normalize! s3-1 1.0) (vector-float*! s3-1 s3-1 (-> s5-0 trans x)) - (let ((v1-90 (-> obj rbody)) + (let ((v1-90 (-> this rbody)) (a1-11 (-> s5-0 vector)) (a2-3 s3-1) ) (rigid-body-method-18 (-> v1-90 state) (the-as vector a1-11) a2-3) ) - (let ((v1-93 (-> obj rbody)) + (let ((v1-93 (-> this rbody)) (f0-10 1.0) ) (rigid-body-method-12 (-> v1-93 state) f0-10) ) - (rigid-body-method-13 (-> obj rbody state)) + (rigid-body-method-13 (-> this rbody state)) (when #f - (set! (-> *debug-vehicle-work* impact-time) (current-time)) + (set-time! (-> *debug-vehicle-work* impact-time)) (mem-copy! (the-as pointer (-> *debug-vehicle-work* impact)) (the-as pointer s5-0) 64) (let ((v1-103 (-> arg2 head))) (set! (-> *debug-vehicle-work* prim-sphere1 quad) (-> v1-103 prim1 cprim prim-core world-sphere quad)) @@ -1631,10 +1639,10 @@ ) ) ) - (rigid-body-object-method-45 obj (the-as rigid-body-impact s5-0)) + (rigid-body-object-method-45 this (the-as rigid-body-impact s5-0)) ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'idle)) - (go (method-of-object obj waiting)) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (go (method-of-object this waiting)) ) #t ) @@ -1642,7 +1650,7 @@ ;; definition for method 48 of type vehicle ;; INFO: Used lq/sq -(defmethod rigid-body-object-method-48 vehicle ((obj vehicle) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod rigid-body-object-method-48 vehicle ((this vehicle) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (v1-2 symbol) (v1-30 symbol) (a0-19 object)) (with-pp (b! @@ -1657,10 +1665,10 @@ (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact))) (let ((s2-0 (new 'stack-no-clear 'vector))) (let ((f30-0 (get-inv-mass arg0))) - (rigid-body-object-method-49 obj s5-0 arg1) + (rigid-body-object-method-49 this s5-0 arg1) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (let ((v1-14 (-> obj rbody)) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (let ((v1-14 (-> this rbody)) (a1-3 (-> s5-0 point)) (a2-2 (-> s5-0 velocity)) ) @@ -1668,7 +1676,7 @@ ) ) (else - (set! (-> s5-0 velocity quad) (-> obj root transv quad)) + (set! (-> s5-0 velocity quad) (-> this root transv quad)) ) ) (let ((v1-18 (-> arg0 root))) @@ -1677,22 +1685,22 @@ ) (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) (b! (>= f0-1 0.0) cfg-32 :delay #f) - (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> obj info info inv-mass)))) + (set! (-> s5-0 impulse) (/ f0-1 (+ f30-0 (-> this info info inv-mass)))) ) (vector+float*! s2-0 s2-0 (-> s5-0 normal) (* -3.1 f30-0 (-> s5-0 impulse))) (set! (-> s2-0 y) (fmax (* 49152.0 f30-0) (-> s2-0 y))) ) - (b! (logtest? (rigid-body-object-flag in-pursuit) (-> obj flags)) cfg-13 :likely-delay (set! v1-30 #t)) + (b! (logtest? (rigid-body-object-flag in-pursuit) (-> this flags)) cfg-13 :likely-delay (set! v1-30 #t)) (set! v1-30 (!= arg0 *target*)) (label cfg-13) (b! (not v1-30) cfg-25 :delay (empty-form)) - (when (>= (- (current-time) (-> obj sent-attack-time)) (seconds 0.5)) - (set! (-> obj sent-attack-time) (current-time)) + (when (time-elapsed? (-> this sent-attack-time) (seconds 0.5)) + (set-time! (-> this sent-attack-time)) (let* ((v1-39 *game-info*) (a0-18 (+ (-> v1-39 attack-id) 1)) ) (set! (-> v1-39 attack-id) a0-18) - (set! (-> obj outgoing-attack-id) a0-18) + (set! (-> this outgoing-attack-id) a0-18) ) ) (let ((f30-1 (+ 0.5 (* 0.000024414063 (- (-> s5-0 impulse))))) @@ -1708,8 +1716,8 @@ (set! (-> s1-0 message) 'attack) (set! (-> s1-0 param 0) (the-as uint arg1)) (set! (-> s1-0 param 1) - (the-as uint (static-attack-info ((id (-> obj outgoing-attack-id)) - (attacker (process->handle (vehicle-method-70 obj))) + (the-as uint (static-attack-info ((id (-> this outgoing-attack-id)) + (attacker (process->handle (vehicle-method-70 this))) (mode 'vehicle) (vector s2-0) (penetrate-using (penetrate vehicle)) @@ -1722,23 +1730,23 @@ ) ) (label cfg-25) - (rigid-body-object-method-42 obj) + (rigid-body-object-method-42 this) (let ((a2-4 (new 'stack-no-clear 'vector))) (vector-float*! a2-4 (-> s5-0 normal) (-> s5-0 impulse)) - (let ((v1-60 (-> obj rbody)) + (let ((v1-60 (-> this rbody)) (a1-9 (-> s5-0 point)) ) (rigid-body-method-18 (-> v1-60 state) a1-9 a2-4) ) ) - (let ((v1-63 (-> obj rbody)) + (let ((v1-63 (-> this rbody)) (f0-11 1.0) ) (rigid-body-method-12 (-> v1-63 state) f0-11) ) - (rigid-body-method-13 (-> obj rbody state)) + (rigid-body-method-13 (-> this rbody state)) (when #f - (set! (-> *debug-vehicle-work* impact-time) (current-time)) + (set-time! (-> *debug-vehicle-work* impact-time)) (mem-copy! (the-as pointer (-> *debug-vehicle-work* impact)) (the-as pointer s5-0) 64) (let ((v1-73 (-> arg1 head))) (set! (-> *debug-vehicle-work* prim-sphere1 quad) (-> v1-73 prim1 cprim prim-core world-sphere quad)) @@ -1754,10 +1762,10 @@ *color-blue* ) ) - (rigid-body-object-method-45 obj s5-0) + (rigid-body-object-method-45 this s5-0) ) - (b! (not (and (-> obj next-state) (= (-> obj next-state name) 'idle))) cfg-32 :delay (empty-form)) - (go (method-of-object obj waiting)) + (b! (not (and (-> this next-state) (= (-> this next-state name) 'idle))) cfg-32 :delay (empty-form)) + (go (method-of-object this waiting)) (label cfg-32) #t ) @@ -1765,17 +1773,7 @@ ;; definition for method 46 of type vehicle ;; INFO: Used lq/sq -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 71] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 182] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 215] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 222] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 257] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 273] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 323] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 290] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 307] -(defmethod rigid-body-object-method-46 vehicle ((obj vehicle) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 vehicle ((this vehicle) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (when (and (= arg2 'touched) arg0 (logtest? (process-mask bit18) (-> arg0 mask))) (dotimes (s1-0 4) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) @@ -1788,71 +1786,71 @@ (set! (-> a1-2 param 3) (-> arg3 param 3)) (set! (-> a1-2 param 4) (-> arg3 param 4)) (set! (-> a1-2 param 5) (-> arg3 param 5)) - (send-event-function (handle->process (-> obj rider-array s1-0)) a1-2) + (send-event-function (handle->process (-> this rider-array s1-0)) a1-2) ) ) ) (case arg2 (('traffic-off) - (when (not (logtest? (-> obj flags) (rigid-body-object-flag persistent))) + (when (not (logtest? (-> this flags) (rigid-body-object-flag persistent))) (cond - ((logtest? (-> obj flags) (rigid-body-object-flag dead)) - (go (method-of-object obj die)) + ((logtest? (-> this flags) (rigid-body-object-flag dead)) + (go (method-of-object this die)) ) (else - (if (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) - (vehicle-method-113 obj) + (if (logtest? (rigid-body-object-flag ai-driving) (-> this flags)) + (vehicle-method-113 this) ) ) ) ) ) (('traffic-off-force) - (vehicle-method-113 obj) + (vehicle-method-113 this) ) (('traffic-activate) - (set! (-> obj controller traffic) (the-as traffic-engine (-> arg3 param 1))) - (logior! (-> obj flags) (rigid-body-object-flag traffic-managed)) + (set! (-> this controller traffic) (the-as traffic-engine (-> arg3 param 1))) + (logior! (-> this flags) (rigid-body-object-flag traffic-managed)) (let ((s5-1 (the-as traffic-object-spawn-params (-> arg3 param 0)))) - (set! (-> obj root trans quad) (-> s5-1 position quad)) - (quaternion-copy! (-> obj root quat) (-> s5-1 rotation)) - (set! (-> obj root transv quad) (-> s5-1 velocity quad)) - (vehicle-method-130 obj s5-1) + (set! (-> this root trans quad) (-> s5-1 position quad)) + (quaternion-copy! (-> this root quat) (-> s5-1 rotation)) + (set! (-> this root transv quad) (-> s5-1 velocity quad)) + (vehicle-method-130 this s5-1) ) ) (('attack) (let ((s3-1 (the-as attack-info (-> arg3 param 1))) (s2-1 (get-penetrate-using-from-attack-event arg0 arg3)) ) - (when (and (!= (-> s3-1 id) (-> obj incoming-attack-id)) - (not (logtest? (-> obj flags) (rigid-body-object-flag dead))) - (or (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) + (when (and (!= (-> s3-1 id) (-> this incoming-attack-id)) + (not (logtest? (-> this flags) (rigid-body-object-flag dead))) + (or (not (logtest? (-> this flags) (rigid-body-object-flag player-driving))) (not (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) s2-1)) ) ) - (set! (-> obj incoming-attack-id) (-> s3-1 id)) - (when (and (logtest? (-> obj info flags) 4) (logtest? (rigid-body-object-flag ai-driving) (-> obj flags))) + (set! (-> this incoming-attack-id) (-> s3-1 id)) + (when (and (logtest? (-> this info flags) 4) (logtest? (rigid-body-object-flag ai-driving) (-> this flags))) (let ((a1-8 (find-offending-process-focusable arg0 s3-1))) (if (and a1-8 (logtest? (-> a1-8 mask) (process-mask target))) - (vehicle-method-134 obj a1-8) + (vehicle-method-134 this a1-8) ) ) ) - (rigid-body-object-method-47 obj arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) s2-1) + (rigid-body-object-method-47 this arg0 s3-1 (the-as touching-shapes-entry (-> arg3 param 0)) s2-1) ) ) ) (('turbo-ring) - (set! (-> obj turbo-boost-factor) (the-as float (-> arg3 param 0))) - (set! (-> obj turbo-boost-time) (current-time)) - (set! (-> obj turbo-boost-duration) (the-as uint 75)) - (logior! (-> obj flags) (rigid-body-object-flag turbo-boost)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (set! (-> this turbo-boost-factor) (the-as float (-> arg3 param 0))) + (set-time! (-> this turbo-boost-time)) + (set! (-> this turbo-boost-duration) (the-as uint 75)) + (logior! (-> this flags) (rigid-body-object-flag turbo-boost)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (sound-play "boost-ring") ) ) (('get-offending-focusable) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) *target* ) ) @@ -1865,39 +1863,39 @@ ) ) (when s5-3 - (format #t "vehicle::event-handler: pilot-on (pid ~d) from pid ~d~%" (-> obj pid) (-> arg0 pid)) - (logior! (-> obj flags) (rigid-body-object-flag riding)) - (put-rider-in-seat obj (the-as int s3-2) (the-as process-focusable s5-3)) + (format #t "vehicle::event-handler: pilot-on (pid ~d) from pid ~d~%" (-> this pid) (-> arg0 pid)) + (logior! (-> this flags) (rigid-body-object-flag riding)) + (put-rider-in-seat this (the-as int s3-2) (the-as process-focusable s5-3)) (if (logtest? (-> s5-3 mask) (process-mask target)) - (logior! (-> obj flags) (rigid-body-object-flag player-driving)) + (logior! (-> this flags) (rigid-body-object-flag player-driving)) ) #t ) ) ) (('player-get-off) - (if (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) (!= (-> obj crash-level) 3)) - (go (method-of-object obj waiting)) + (if (and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (!= (-> this crash-level) 3)) + (go (method-of-object this waiting)) ) ) (('rider-off) - (send-event (ppointer->process (-> obj child)) 'rider-off) + (send-event (ppointer->process (-> this child)) 'rider-off) ) (('rider-on) - (send-event (ppointer->process (-> obj child)) 'rider-on) + (send-event (ppointer->process (-> this child)) 'rider-on) ) (('nav-mesh-kill) - (vehicle-method-142 obj) + (vehicle-method-142 this) ) (else - ((method-of-type rigid-body-object rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) + ((method-of-type rigid-body-object rigid-body-object-method-46) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 135 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-135 vehicle ((obj vehicle) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-135 vehicle ((this vehicle) (arg0 traffic-object-spawn-params)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc index e15a4c0d99..e1b2e25f60 100644 --- a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-obs_REF.gc @@ -19,20 +19,20 @@ ) ;; definition for method 3 of type vin-turbine -(defmethod inspect vin-turbine ((obj vin-turbine)) - (when (not obj) - (set! obj obj) +(defmethod inspect vin-turbine ((this vin-turbine)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tdont-draw-outside?: ~A~%" (-> obj dont-draw-outside?)) - (format #t "~2Tlightning-timer: ~D~%" (-> obj lightning-timer)) - (format #t "~2Toutside-plane: #~%" (-> obj outside-plane)) - (format #t "~2Tlightning-plane: #~%" (-> obj lightning-plane)) + (format #t "~2Tdont-draw-outside?: ~A~%" (-> this dont-draw-outside?)) + (format #t "~2Tlightning-timer: ~D~%" (-> this lightning-timer)) + (format #t "~2Toutside-plane: #~%" (-> this outside-plane)) + (format #t "~2Tlightning-plane: #~%" (-> this lightning-plane)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -211,32 +211,32 @@ ;; definition for method 11 of type vin-turbine ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-turbine ((obj vin-turbine) (arg0 entity-actor)) +(defmethod init-from-entity! vin-turbine ((this vin-turbine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-turbine" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set-vector! (-> obj outside-plane) 0.707 0.0 0.707 -6377922.5) - (set! (-> obj lightning-plane quad) (-> obj outside-plane quad)) - (set! (-> obj lightning-plane w) -6419865.5) - (set! (-> obj dont-draw-outside?) - (nonzero? (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0)) + (set-vector! (-> this outside-plane) 0.707 0.0 0.707 -6377922.5) + (set! (-> this lightning-plane quad) (-> this outside-plane quad)) + (set! (-> this lightning-plane w) -6419865.5) + (set! (-> this dont-draw-outside?) + (nonzero? (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0)) ) - (set! (-> obj lightning-timer) (the-as uint 0)) - (if (and (-> obj dont-draw-outside?) - (< (vector4-dot (the-as vector (-> obj outside-plane)) (math-camera-pos)) 0.0) + (set! (-> this lightning-timer) (the-as uint 0)) + (if (and (-> this dont-draw-outside?) + (< (vector4-dot (the-as vector (-> this outside-plane)) (math-camera-pos)) 0.0) ) - (go (method-of-object obj dormant)) - (go (method-of-object obj idle)) + (go (method-of-object this dormant)) + (go (method-of-object this idle)) ) (none) ) @@ -257,28 +257,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type vin-door -(defmethod inspect vin-door ((obj vin-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect vin-door ((this vin-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type vin-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-door ((obj vin-door) (arg0 entity-actor)) +(defmethod init-from-entity! vin-door ((this vin-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -307,19 +307,19 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (set! (-> obj door-radius) 12288.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> this door-radius) 12288.0) + (go (method-of-object this close) #t) (none) ) diff --git a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-part_REF.gc b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-part_REF.gc index b00f0a3ab5..5e089f3c7d 100644 --- a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type vinroom-part -(defmethod inspect vinroom-part ((obj vinroom-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect vinroom-part ((this vinroom-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-scenes_REF.gc b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-scenes_REF.gc index 599b11a57f..d7a47f2348 100644 --- a/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/city/vinroom/vinroom-scenes_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type vin-npc -(defmethod inspect vin-npc ((obj vin-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect vin-npc ((this vin-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -33,10 +33,10 @@ ;; definition for method 33 of type vin-npc ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! vin-npc ((obj vin-npc)) +(defmethod init-art! vin-npc ((this vin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vin" (the-as (pointer uint32) #f))) (the-as pair 0) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc index a1ba504a59..e261ca74d7 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ai-task-h_REF.gc @@ -20,19 +20,19 @@ ) ;; definition for method 3 of type ai-task -(defmethod inspect ai-task ((obj ai-task)) - (when (not obj) - (set! obj obj) +(defmethod inspect ai-task ((this ai-task)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) (label cfg-4) - obj + this ) ;; definition of type ai-task-pool @@ -53,18 +53,18 @@ ) ;; definition for method 3 of type ai-task-pool -(defmethod inspect ai-task-pool ((obj ai-task-pool)) - (when (not obj) - (set! obj obj) +(defmethod inspect ai-task-pool ((this ai-task-pool)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tanchor: ~A~%" (-> obj anchor)) - (format #t "~1Ttasks: #x~X~%" (-> obj tasks)) - (format #t "~1Ttasks-length: ~D~%" (-> obj tasks-length)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tanchor: ~A~%" (-> this anchor)) + (format #t "~1Ttasks: #x~X~%" (-> this tasks)) + (format #t "~1Ttasks-length: ~D~%" (-> this tasks-length)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) (label cfg-4) - obj + this ) ;; definition of type ai-task-control @@ -90,51 +90,51 @@ ) ;; definition for method 3 of type ai-task-control -(defmethod inspect ai-task-control ((obj ai-task-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect ai-task-control ((this ai-task-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tanchor: ~A~%" (-> obj anchor)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tanchor: ~A~%" (-> this anchor)) + (format #t "~1Tpool: ~A~%" (-> this pool)) (label cfg-4) - obj + this ) ;; definition for method 11 of type ai-task ;; WARN: Return type mismatch int vs none. -(defmethod ai-task-method-11 ai-task ((obj ai-task) (arg0 bot)) +(defmethod ai-task-method-11 ai-task ((this ai-task) (arg0 bot)) 0 (none) ) ;; definition for method 10 of type ai-task ;; WARN: Return type mismatch int vs none. -(defmethod ai-task-method-10 ai-task ((obj ai-task) (arg0 bot)) +(defmethod ai-task-method-10 ai-task ((this ai-task) (arg0 bot)) 0 (none) ) ;; definition for method 9 of type ai-task ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! ai-task ((obj ai-task)) +(defmethod reset-task! ai-task ((this ai-task)) 0 (none) ) ;; definition for method 11 of type ai-task-pool ;; WARN: Return type mismatch (pointer uint32) vs ai-task. -(defmethod ai-task-pool-method-11 ai-task-pool ((obj ai-task-pool)) - (set! (-> obj unique-id) (the-as uint 0)) +(defmethod ai-task-pool-method-11 ai-task-pool ((this ai-task-pool)) + (set! (-> this unique-id) (the-as uint 0)) (let ((t0-0 (the-as (pointer uint32) #f)) (a1-0 (the-as (pointer uint32) #f)) - (v1-0 (-> obj tasks)) + (v1-0 (-> this tasks)) ) - (let ((a2-0 (-> obj tasks-length))) + (let ((a2-0 (-> this tasks-length))) (dotimes (a3-0 (the-as int a2-0)) (set! a1-0 (&+ v1-0 (* 48 a3-0))) - (set! (-> a1-0 2) (the-as uint obj)) + (set! (-> a1-0 2) (the-as uint this)) (set! (-> a1-0 3) (the-as uint 0)) (set! (-> a1-0 1) (the-as uint t0-0)) (if t0-0 @@ -145,27 +145,27 @@ ) (set! (-> a1-0 0) (the-as uint #f)) (let ((v0-0 (&-> v1-0 0))) - (set! (-> obj anchor) (the-as ai-task v0-0)) + (set! (-> this anchor) (the-as ai-task v0-0)) (the-as ai-task v0-0) ) ) ) ;; definition for method 9 of type ai-task-pool -(defmethod assign-ids! ai-task-pool ((obj ai-task-pool) (arg0 type)) +(defmethod assign-ids! ai-task-pool ((this ai-task-pool) (arg0 type)) "Assign unique IDs to the [[ai-task-pool]] and its `anchor`s `next`" - (let ((v1-1 (-> obj anchor next))) + (let ((v1-1 (-> this anchor next))) (when v1-1 (let ((a2-0 (-> v1-1 prev)) (a3-0 (-> v1-1 next)) ) (set! (-> v1-1 prev) #f) (set! (-> v1-1 next) #f) - (let ((t0-1 (the-as int (+ (-> obj unique-id) 1)))) + (let ((t0-1 (the-as int (+ (-> this unique-id) 1)))) (if (zero? (the-as uint t0-1)) (set! t0-1 1) ) - (set! (-> obj unique-id) (the-as uint t0-1)) + (set! (-> this unique-id) (the-as uint t0-1)) (set! (-> v1-1 unique-id) (the-as uint t0-1)) ) (set! (-> a2-0 next) a3-0) @@ -181,9 +181,9 @@ ;; definition for method 10 of type ai-task-pool ;; WARN: Return type mismatch ai-task vs none. -(defmethod set-next-task! ai-task-pool ((obj ai-task-pool) (arg0 ai-task)) +(defmethod set-next-task! ai-task-pool ((this ai-task-pool) (arg0 ai-task)) "Set the next task in the [[ai-task-pool]] to the specified [[ai-task]]." - (let* ((v1-0 (-> obj anchor)) + (let* ((v1-0 (-> this anchor)) (v0-0 (-> v1-0 next)) ) (set! (-> v1-0 next) arg0) @@ -203,9 +203,9 @@ ) ;; definition for method 12 of type ai-task-control -(defmethod ai-task-control-method-12 ai-task-control ((obj ai-task-control) (arg0 bot)) - (let ((gp-0 (-> obj anchor))) - (let ((s3-0 (-> obj anchor next))) +(defmethod ai-task-control-method-12 ai-task-control ((this ai-task-control) (arg0 bot)) + (let ((gp-0 (-> this anchor))) + (let ((s3-0 (-> this anchor next))) (while s3-0 (let ((s4-0 (-> s3-0 next))) (if arg0 @@ -224,21 +224,21 @@ ;; definition for method 9 of type ai-task-control ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-control-method-9 ai-task-control ((obj ai-task-control)) - (ai-task-control-method-12 obj (the-as bot #f)) - (let ((a1-1 (-> obj anchor))) +(defmethod ai-task-control-method-9 ai-task-control ((this ai-task-control)) + (ai-task-control-method-12 this (the-as bot #f)) + (let ((a1-1 (-> this anchor))) (when a1-1 (set-next-task! (-> a1-1 pool) a1-1) - (set! (-> obj anchor) #f) + (set! (-> this anchor) #f) ) ) (none) ) ;; definition for method 15 of type ai-task-control -(defmethod init-task! ai-task-control ((obj ai-task-control) (arg0 type) (arg1 bot)) +(defmethod init-task! ai-task-control ((this ai-task-control) (arg0 type) (arg1 bot)) "Initialize a task of the given type in the [[ai-task-control]]'s pool." - (let ((s5-0 (assign-ids! (-> obj pool) arg0))) + (let ((s5-0 (assign-ids! (-> this pool) arg0))) (if s5-0 (reset-task! s5-0) ) @@ -248,9 +248,9 @@ ;; definition for method 17 of type ai-task-control ;; WARN: Return type mismatch ai-task vs none. -(defmethod set-next-task! ai-task-control ((obj ai-task-control) (arg0 ai-task)) +(defmethod set-next-task! ai-task-control ((this ai-task-control) (arg0 ai-task)) "Set `next` of this [[ai-task-control]]'s `anchor` to the given [[ai-task]]." - (let* ((v1-0 (-> obj anchor)) + (let* ((v1-0 (-> this anchor)) (a0-1 (-> v1-0 next)) ) (set! (-> v1-0 next) arg0) @@ -261,30 +261,30 @@ ) ;; definition for method 16 of type ai-task-control -(defmethod set-next-task-for-pool! ai-task-control ((obj ai-task-control) (arg0 ai-task)) - (set-next-task! (-> obj pool) arg0) +(defmethod set-next-task-for-pool! ai-task-control ((this ai-task-control) (arg0 ai-task)) + (set-next-task! (-> this pool) arg0) (none) ) ;; definition for method 11 of type ai-task-control -(defmethod get-task-by-type ai-task-control ((obj ai-task-control) (arg0 type) (arg1 bot)) - (let ((s5-0 (init-task! obj arg0 arg1))) +(defmethod get-task-by-type ai-task-control ((this ai-task-control) (arg0 type) (arg1 bot)) + (let ((s5-0 (init-task! this arg0 arg1))) (if s5-0 - (set-next-task! obj s5-0) + (set-next-task! this s5-0) ) s5-0 ) ) ;; definition for method 13 of type ai-task-control -(defmethod ai-task-control-method-13 ai-task-control ((obj ai-task-control) (arg0 ai-task) (arg1 bot)) +(defmethod ai-task-control-method-13 ai-task-control ((this ai-task-control) (arg0 ai-task) (arg1 bot)) (let ((gp-0 (-> arg0 prev)) (s5-0 (-> arg0 next)) ) (if arg1 (ai-task-method-10 arg0 arg1) ) - (set-next-task! (-> obj pool) arg0) + (set-next-task! (-> this pool) arg0) (if gp-0 (set! (-> gp-0 next) s5-0) ) @@ -296,8 +296,8 @@ ) ;; definition for method 10 of type ai-task-control -(defmethod ai-task-control-method-10 ai-task-control ((obj ai-task-control) (arg0 bot)) - (let ((a0-1 (-> obj anchor next))) +(defmethod ai-task-control-method-10 ai-task-control ((this ai-task-control) (arg0 bot)) + (let ((a0-1 (-> this anchor next))) (if a0-1 (ai-task-method-11 a0-1 arg0) ) @@ -306,8 +306,8 @@ ) ;; definition for method 14 of type ai-task-control -(defmethod ai-task-control-method-14 ai-task-control ((obj ai-task-control) (arg0 ai-task) (arg1 bot)) - (let ((a0-1 (ai-task-control-method-13 obj arg0 arg1))) +(defmethod ai-task-control-method-14 ai-task-control ((this ai-task-control) (arg0 ai-task) (arg1 bot)) + (let ((a0-1 (ai-task-control-method-13 this arg0 arg1))) (if a0-1 (ai-task-method-11 a0-1 arg1) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-h_REF.gc index e291b8343a..4273ffc5bd 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-h_REF.gc @@ -12,29 +12,29 @@ ) ;; definition for method 3 of type ashelin-course -(defmethod inspect ashelin-course ((obj ashelin-course)) - (when (not obj) - (set! obj obj) +(defmethod inspect ashelin-course ((this ashelin-course)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcourse-id: ~D~%" (-> obj course-id)) - (format #t "~1Tspeech-count: ~D~%" (-> obj speech-count)) - (format #t "~1Tspot-count: ~D~%" (-> obj spot-count)) - (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) - (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> obj too-far-warn-speeches)) - (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> obj too-far-fail-speeches)) - (format #t "~1Tattack-player-speeches: ~A~%" (-> obj attack-player-speeches)) - (format #t "~1Tdefault-check-too-far: ~A~%" (-> obj default-check-too-far)) - (format #t "~1Twaypoints: ~A~%" (-> obj waypoints)) - (format #t "~1Tspeeches: #x~X~%" (-> obj speeches)) - (format #t "~1Tspeech-tunings: #x~X~%" (-> obj speech-tunings)) - (format #t "~1Tdirs: #x~X~%" (-> obj dirs)) - (format #t "~1Tspots: #x~X~%" (-> obj spots)) - (format #t "~1Touch-speeches: ~A~%" (-> obj ouch-speeches)) - (format #t "~1Tvictory-speeches: ~A~%" (-> obj victory-speeches)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse-id: ~D~%" (-> this course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> this speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> this spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> this too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> this too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> this attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> this default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> this waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> this speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> this speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> this dirs)) + (format #t "~1Tspots: #x~X~%" (-> this spots)) + (format #t "~1Touch-speeches: ~A~%" (-> this ouch-speeches)) + (format #t "~1Tvictory-speeches: ~A~%" (-> this victory-speeches)) (label cfg-4) - obj + this ) ;; definition of type ashelin @@ -82,22 +82,22 @@ ) ;; definition for method 3 of type ashelin -(defmethod inspect ashelin ((obj ashelin)) - (when (not obj) - (set! obj obj) +(defmethod inspect ashelin ((this ashelin)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tknocked-anim: ~A~%" (-> obj knocked-anim)) - (format #t "~2Ttravel-anim-interp: ~f~%" (-> obj travel-anim-interp)) - (format #t "~2Tfired-gun-count: ~D~%" (-> obj fired-gun-count)) - (format #t "~2Tlast-fire-time: ~D~%" (-> obj last-fire-time)) - (format #t "~2Tvictory-speech-time: ~D~%" (-> obj victory-speech-time)) - (format #t "~2Tfrontline: #~%" (-> obj frontline)) + (format #t "~2Tknocked-anim: ~A~%" (-> this knocked-anim)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> this travel-anim-interp)) + (format #t "~2Tfired-gun-count: ~D~%" (-> this fired-gun-count)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Tvictory-speech-time: ~D~%" (-> this victory-speech-time)) + (format #t "~2Tfrontline: #~%" (-> this frontline)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -121,23 +121,23 @@ ) ;; definition for method 3 of type asht-wait-spot -(defmethod inspect asht-wait-spot ((obj asht-wait-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect asht-wait-spot ((this asht-wait-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> obj spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> this spot-indexes)) (label cfg-4) - obj + this ) ;; definition of type asht-fight-focus @@ -149,19 +149,19 @@ ) ;; definition for method 3 of type asht-fight-focus -(defmethod inspect asht-fight-focus ((obj asht-fight-focus)) - (when (not obj) - (set! obj obj) +(defmethod inspect asht-fight-focus ((this asht-fight-focus)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 af14bf1337..9fe8cc5a73 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 @@ -264,25 +264,25 @@ ) ;; definition for method 3 of type ashelin-shot -(defmethod inspect ashelin-shot ((obj ashelin-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect ashelin-shot ((this ashelin-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttail-pos: #~%" (-> obj tail-pos)) - (format #t "~2Thit-pos: #~%" (-> obj hit-pos)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (format #t "~2Thit-pos: #~%" (-> this hit-pos)) (label cfg-4) - obj + this ) ;; definition for method 24 of type ashelin-shot ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight ashelin-shot ((obj ashelin-shot)) +(defmethod draw-laser-sight ashelin-shot ((this ashelin-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 675) (-> obj tail-pos) (-> obj starting-dir) #f #t) + (draw-beam (-> *part-id-table* 675) (-> this tail-pos) (-> this starting-dir) #f #t) 0 (none) ) @@ -290,7 +290,7 @@ ;; definition for method 25 of type ashelin-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles ashelin-shot ((obj ashelin-shot)) +(defmethod spawn-impact-particles ashelin-shot ((this ashelin-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -300,8 +300,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((v1-1 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((v1-1 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -348,7 +348,7 @@ ;; definition for method 26 of type ashelin-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles ashelin-shot ((obj ashelin-shot)) +(defmethod spawn-shell-particles ashelin-shot ((this ashelin-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -370,7 +370,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -390,7 +390,8 @@ ) ;; definition for method 28 of type ashelin-shot -(defmethod play-impact-sound ashelin-shot ((obj ashelin-shot) (arg0 projectile-options)) +;; WARN: Return type mismatch object vs none. +(defmethod play-impact-sound ashelin-shot ((this ashelin-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -400,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)) obj arg0) + ((the-as (function projectile projectile-options none) (find-parent-method ashelin-shot 28)) this arg0) ) ) ) @@ -408,16 +409,16 @@ ) ;; definition for method 38 of type ashelin-shot -(defmethod made-impact? ashelin-shot ((obj ashelin-shot)) +(defmethod made-impact? ashelin-shot ((this ashelin-shot)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a1-0 t1-0)) (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a1-0 ignore-process0) obj) - (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-0 action-mask) (collide-action solid)) ) @@ -457,9 +458,9 @@ ;; definition for method 30 of type ashelin-shot ;; WARN: Return type mismatch symbol vs none. -(defmethod init-proj-collision! ashelin-shot ((obj ashelin-shot)) +(defmethod init-proj-collision! ashelin-shot ((this ashelin-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -500,12 +501,12 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) - (let ((v1-23 (-> obj parent))) + (let ((v1-23 (-> this parent))) (when (not (logtest? (-> (the-as ashelin (if v1-23 (the-as ashelin (-> v1-23 0 self)) ) @@ -515,7 +516,7 @@ (bot-flags attacked) ) ) - (let* ((a0-17 (-> obj root)) + (let* ((a0-17 (-> this root)) (v1-27 (-> a0-17 root-prim)) ) (countdown (a0-18 (-> a0-17 total-prims)) @@ -531,12 +532,12 @@ ;; definition for method 31 of type ashelin-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! ashelin-shot ((obj ashelin-shot)) +(defmethod init-proj-settings! ashelin-shot ((this ashelin-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj max-speed) 307200.0) - (set! (-> obj move) ashelin-shot-move) - (set! (-> obj timeout) (seconds 1.335)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this max-speed) 307200.0) + (set! (-> this move) ashelin-shot-move) + (set! (-> this timeout) (seconds 1.335)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-states_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-states_REF.gc index 1cf0c7be8a..ca7d0da5f0 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash-states_REF.gc @@ -6,7 +6,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -96,7 +96,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -155,7 +155,7 @@ (ashelin-method-240 self a1-6) ) (else - (if (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) (ashelin-method-247 self)) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (ashelin-method-247 self)) (go-virtual chase) ) ) @@ -173,7 +173,7 @@ ) ) (else - (if (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (if (time-elapsed? (-> self state-time) (-> self reaction-time)) (ashelin-method-239 self) ) ) @@ -236,7 +236,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -321,7 +321,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -350,10 +350,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (ashelin-method-239 self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -384,7 +384,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -404,7 +404,7 @@ ((bot-method-214 self) (go-hostile self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -430,7 +430,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (when (bot-method-214 self) (if (ashelin-method-238 self #t #f) (go-virtual standing-idle) @@ -512,14 +512,14 @@ :trans (behavior () (bot-method-223 self #t) (cond - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ((not (bot-method-214 self)) (go-virtual traveling) ) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (or (ashelin-method-238 self #t #f) (ashelin-method-248 self)) (go-virtual standing-idle) ) @@ -561,7 +561,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -691,7 +691,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -814,7 +814,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc index 22c24ba9e4..6a00a1f993 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ashelin/ash_REF.gc @@ -12,15 +12,15 @@ ) ;; definition for method 3 of type ashelin-anim-info -(defmethod inspect ashelin-anim-info ((obj ashelin-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect ashelin-anim-info ((this ashelin-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ashelin-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "[~8x] ~A~%" this 'ashelin-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) (label cfg-4) - obj + this ) ;; definition of type ashelin-global-info @@ -35,17 +35,17 @@ ) ;; definition for method 3 of type ashelin-global-info -(defmethod inspect ashelin-global-info ((obj ashelin-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect ashelin-global-info ((this ashelin-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> obj blue-hit-anim)) - (format #t "~1Tblue-hit-land-anim[6] @ #x~X~%" (-> obj blue-hit-land-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> this blue-hit-anim)) + (format #t "~1Tblue-hit-land-anim[6] @ #x~X~%" (-> this blue-hit-land-anim)) (label cfg-4) - obj + this ) ;; definition for symbol *ashelin-global-info*, type ashelin-global-info @@ -233,13 +233,13 @@ (set! (-> *ashelin-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 59 of type ashelin -(defmethod get-penetrate-info ashelin ((obj ashelin)) +(defmethod get-penetrate-info ashelin ((this ashelin)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (let* ((t9-0 (method-of-type bot get-penetrate-info)) - (v0-0 (t9-0 obj)) + (v0-0 (t9-0 this)) ) - (if (logtest? (bot-flags bf22) (-> obj bot-flags)) + (if (logtest? (bot-flags bf22) (-> this bot-flags)) (set! v0-0 (logior (penetrate jak-yellow-shot) v0-0)) ) v0-0 @@ -248,25 +248,25 @@ ;; definition for method 250 of type ashelin ;; WARN: Return type mismatch penetrate vs none. -(defmethod ashelin-method-250 ashelin ((obj ashelin) (arg0 symbol)) +(defmethod ashelin-method-250 ashelin ((this ashelin) (arg0 symbol)) (if arg0 - (logior! (-> obj bot-flags) (bot-flags bf22)) - (logclear! (-> obj bot-flags) (bot-flags bf22)) + (logior! (-> this bot-flags) (bot-flags bf22)) + (logclear! (-> this bot-flags) (bot-flags bf22)) ) - (set! (-> obj root penetrated-by) (get-penetrate-info obj)) + (set! (-> this root penetrated-by) (get-penetrate-info this)) (none) ) ;; definition for method 193 of type ashelin -(defmethod bot-method-193 ashelin ((obj ashelin)) +(defmethod bot-method-193 ashelin ((this ashelin)) (let* ((t9-0 (method-of-type bot bot-method-193)) - (v0-0 (t9-0 obj)) + (v0-0 (t9-0 this)) ) - (when (and (not v0-0) (logtest? #x400000 (-> obj incoming penetrate-using))) - (if (logtest? (bot-flags bf22) (-> obj bot-flags)) + (when (and (not v0-0) (logtest? #x400000 (-> this incoming penetrate-using))) + (if (logtest? (bot-flags bf22) (-> this bot-flags)) (set! v0-0 #t) ) - (logior! (-> obj bot-flags) (bot-flags bf21)) + (logior! (-> this bot-flags) (bot-flags bf21)) ) v0-0 ) @@ -274,32 +274,32 @@ ;; definition for method 106 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-106 ashelin ((obj ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 ashelin ((this ashelin) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type bot enemy-method-106))) - (t9-0 obj arg0 arg1 arg2 arg3) + (t9-0 this arg0 arg1 arg2 arg3) ) - (if (!= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-1)) + (if (!= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-1)) ) (none) ) ;; definition for method 104 of type ashelin -(defmethod enemy-method-104 ashelin ((obj ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 ashelin ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (if (and (= (-> arg0 type) target) - (-> obj next-state) - (let ((v1-4 (-> obj next-state name))) + (-> this next-state) + (let ((v1-4 (-> this next-state name))) (or (= v1-4 'back-spring) (= v1-4 'cartwheel-left) (= v1-4 'tumble-right)) ) ) #f - ((method-of-type bot enemy-method-104) obj arg0 arg1 arg2) + ((method-of-type bot enemy-method-104) this arg0 arg1 arg2) ) ) ;; definition for method 97 of type ashelin -(defmethod enemy-method-97 ashelin ((obj ashelin)) - (let* ((s5-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 ashelin ((this ashelin)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 ) @@ -308,25 +308,25 @@ (when v1-3 (cond ((= (-> v1-3 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! v1-3 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 2.5)) + (when (time-elapsed? (-> this attacker-time) (seconds 2.5)) (set! v1-3 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) - (let ((a0-21 (-> obj focus-mode)) + (let ((a0-21 (-> this focus-mode)) (s5-1 (the-as process #f)) ) (cond @@ -335,11 +335,11 @@ (v1-3 (set! s5-1 v1-3) ) - ((begin (set! s5-1 (select-focus! obj)) s5-1) + ((begin (set! s5-1 (select-focus! this)) s5-1) (empty) ) (else - (let ((s4-0 (handle->process (-> obj poi-handle)))) + (let ((s4-0 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-0 process-focusable) s4-0 ) @@ -358,7 +358,7 @@ (set! s5-1 v1-3) ) (else - (let ((s4-1 (handle->process (-> obj poi-handle)))) + (let ((s4-1 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-1 process-focusable) s4-1 ) @@ -368,7 +368,7 @@ (s5-1 (empty) ) - ((begin (set! s5-1 (select-focus! obj)) s5-1) + ((begin (set! s5-1 (select-focus! this)) s5-1) (empty) ) (else @@ -381,14 +381,14 @@ ) (cond (s5-1 - (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> s5-1 type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) (!= (-> s5-1 type) target)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s5-1 @@ -398,13 +398,13 @@ ;; definition for method 183 of type ashelin ;; WARN: Return type mismatch object vs symbol. -(defmethod alive? ashelin ((obj ashelin)) +(defmethod alive? ashelin ((this ashelin)) (let ((t9-0 (method-of-type bot alive?))) (the-as symbol - (and (t9-0 obj) (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'waiting-idle) (= v1-3 'hidden) (= v1-3 'traveling)) - ) + (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'waiting-idle) (= v1-3 'hidden) (= v1-3 'traveling)) + ) ) ) ) @@ -412,9 +412,9 @@ ;; definition for method 114 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! ashelin ((obj ashelin)) +(defmethod init-enemy-collision! ashelin ((this ashelin)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -461,7 +461,7 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 7)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -469,21 +469,21 @@ ;; definition for method 115 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! ashelin ((obj ashelin)) +(defmethod init-enemy! ashelin ((this ashelin)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) - (set! (-> obj channel) (the-as uint 22)) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 204800.0) - (set! (-> obj hit-invuln-ignore-me-delay) (the-as uint 0)) - (set! (-> obj hit-invuln-focus-disable-delay) (the-as uint 750)) + (init! this) + (set! (-> this channel) (the-as uint 22)) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 204800.0) + (set! (-> this hit-invuln-ignore-me-delay) (the-as uint 0)) + (set! (-> this hit-invuln-focus-disable-delay) (the-as uint 750)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ashelin" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *ashelin-nav-enemy-info*) - (let ((v1-10 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *ashelin-nav-enemy-info*) + (let ((v1-10 (-> this neck))) (set! (-> v1-10 up) (the-as uint 1)) (set! (-> v1-10 nose) (the-as uint 2)) (set! (-> v1-10 ear) (the-as uint 0)) @@ -491,18 +491,18 @@ (set! (-> v1-10 ignore-angle) 30947.555) ) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) 0 (none) ) ;; definition for method 238 of type ashelin ;; WARN: disable def twice: 25. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod ashelin-method-238 ashelin ((obj ashelin) (arg0 symbol) (arg1 symbol)) +(defmethod ashelin-method-238 ashelin ((this ashelin) (arg0 symbol) (arg1 symbol)) (cond - ((and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target)) + ((and (logtest? (-> this bot-flags) (bot-flags attacked)) (= (-> this focus-info fproc type) target)) #t ) (else @@ -510,8 +510,8 @@ (if arg1 (set! f0-0 (+ 6144.0 f0-0)) ) - (when (>= f0-0 (-> obj focus-info bullseye-xz-dist)) - (let ((v1-9 (-> obj focus-info los))) + (when (>= f0-0 (-> this focus-info bullseye-xz-dist)) + (let ((v1-9 (-> this focus-info los))) (if arg0 (or (= v1-9 1) (= v1-9 4)) (= v1-9 1) @@ -524,31 +524,31 @@ ) ;; definition for method 235 of type ashelin -(defmethod ashelin-method-235 ashelin ((obj ashelin) (arg0 symbol)) - (and (>= (- (current-time) (-> obj last-fire-time)) (seconds 1)) - (and (>= 8556.089 (fabs (-> obj focus-info ry-diff))) (ashelin-method-238 obj arg0 #t)) +(defmethod ashelin-method-235 ashelin ((this ashelin) (arg0 symbol)) + (and (time-elapsed? (-> this last-fire-time) (seconds 1)) + (and (>= 8556.089 (fabs (-> this focus-info ry-diff))) (ashelin-method-238 this arg0 #t)) ) ) ;; definition for method 243 of type ashelin -(defmethod ashelin-method-243 ashelin ((obj ashelin) (arg0 float)) - (let ((f30-0 (deg- arg0 (-> obj focus-info my-facing-ry)))) +(defmethod ashelin-method-243 ashelin ((this ashelin) (arg0 float)) + (let ((f30-0 (deg- arg0 (-> this focus-info my-facing-ry)))) (when (>= 16384.0 (fabs f30-0)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (when (ashelin-method-236 obj s5-0 (+ 32768.0 arg0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s5-0 (-> obj root trans)) + (when (ashelin-method-236 this s5-0 (+ 32768.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) (return 1) ) (cond ((< 0.0 f30-0) - (when (ashelin-method-236 obj s5-0 (+ -16384.0 arg0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s5-0 (-> obj root trans)) + (when (ashelin-method-236 this s5-0 (+ -16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) (return 2) ) ) (else - (when (ashelin-method-236 obj s5-0 (+ 16384.0 arg0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s5-0 (-> obj root trans)) + (when (ashelin-method-236 this s5-0 (+ 16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) (return 3) ) ) @@ -560,17 +560,17 @@ ) ;; definition for method 246 of type ashelin -(defmethod ashelin-method-246 ashelin ((obj ashelin)) - (when (>= 32768.0 (-> obj focus-info bullseye-xz-dist)) - (let ((f0-1 (-> obj focus-info bullseye-ry))) - (return (ashelin-method-243 obj f0-1)) +(defmethod ashelin-method-246 ashelin ((this ashelin)) + (when (>= 32768.0 (-> this focus-info bullseye-xz-dist)) + (let ((f0-1 (-> this focus-info bullseye-ry))) + (return (ashelin-method-243 this f0-1)) ) ) - (when (logtest? (bot-flags bf20) (-> obj bot-flags)) - (set! (-> obj root trans w) 1.0) - (when (>= (vector4-dot (the-as vector (-> obj frontline)) (-> obj root trans)) 12288.0) - (let ((f0-7 (atan (-> obj frontline x) (-> obj frontline z)))) - (return (ashelin-method-243 obj f0-7)) + (when (logtest? (bot-flags bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (when (>= (vector4-dot (the-as vector (-> this frontline)) (-> this root trans)) 12288.0) + (let ((f0-7 (atan (-> this frontline x) (-> this frontline z)))) + (return (ashelin-method-243 this f0-7)) ) ) ) @@ -578,30 +578,30 @@ ) ;; definition for method 241 of type ashelin -(defmethod ashelin-method-241 ashelin ((obj ashelin)) +(defmethod ashelin-method-241 ashelin ((this ashelin)) (let* ((v1-0 (target-pos 0)) - (a1-0 (-> obj root trans)) + (a1-0 (-> this root trans)) (f30-0 (atan (- (-> a1-0 x) (-> v1-0 x)) (- (-> a1-0 z) (-> v1-0 z)))) - (f0-5 (deg- f30-0 (-> obj focus-info my-facing-ry))) + (f0-5 (deg- f30-0 (-> this focus-info my-facing-ry))) (s5-0 0) ) (cond ((or (>= 8192.0 (fabs f0-5)) (>= (fabs f0-5) 24576.0)) - (let ((s3-1 (zero? (get-rand-int obj 2))) + (let ((s3-1 (zero? (get-rand-int this 2))) (s4-0 (new 'stack-no-clear 'vector)) ) (countdown (s2-0 2) (cond (s3-1 - (when (ashelin-method-236 obj s4-0 (+ 16384.0 f30-0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s4-0 (-> obj root trans)) + (when (ashelin-method-236 this s4-0 (+ 16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) (set! s5-0 3) (goto cfg-20) ) ) (else - (when (ashelin-method-236 obj s4-0 (+ -16384.0 f30-0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s4-0 (-> obj root trans)) + (when (ashelin-method-236 this s4-0 (+ -16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) (set! s5-0 2) (goto cfg-20) ) @@ -614,8 +614,8 @@ ) (else (let ((s4-1 (new 'stack-no-clear 'vector))) - (when (ashelin-method-236 obj s4-1 (+ 32768.0 f30-0) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s4-1 (-> obj root trans)) + (when (ashelin-method-236 this s4-1 (+ 32768.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-1 (-> this root trans)) (set! s5-0 1) ) ) @@ -626,24 +626,24 @@ ) ;; definition for method 242 of type ashelin -(defmethod ashelin-method-242 ashelin ((obj ashelin)) +(defmethod ashelin-method-242 ashelin ((this ashelin)) (let ((s5-0 0)) (cond - ((zero? (get-rand-int obj 2)) - (when (>= 16384.0 (fabs (-> obj focus-info ry-diff))) + ((zero? (get-rand-int this 2)) + (when (>= 16384.0 (fabs (-> this focus-info ry-diff))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (when (ashelin-method-236 obj s4-0 (+ 16384.0 (-> obj focus-info bullseye-ry)) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s4-0 (-> obj root trans)) + (when (ashelin-method-236 this s4-0 (+ 16384.0 (-> this focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) (set! s5-0 3) ) ) ) ) (else - (when (>= 16384.0 (fabs (-> obj focus-info ry-diff))) + (when (>= 16384.0 (fabs (-> this focus-info ry-diff))) (let ((s4-1 (new 'stack-no-clear 'vector))) - (when (ashelin-method-236 obj s4-1 (+ -16384.0 (-> obj focus-info bullseye-ry)) 8192.0 40707.93 34563.93) - (vector+! (-> obj move-dest) s4-1 (-> obj root trans)) + (when (ashelin-method-236 this s4-1 (+ -16384.0 (-> this focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-1 (-> this root trans)) (set! s5-0 2) ) ) @@ -656,16 +656,16 @@ ;; definition for method 240 of type ashelin ;; WARN: Return type mismatch object vs none. -(defmethod ashelin-method-240 ashelin ((obj ashelin) (arg0 int)) +(defmethod ashelin-method-240 ashelin ((this ashelin) (arg0 int)) (case arg0 ((3) - (go (method-of-object obj cartwheel-left)) + (go (method-of-object this cartwheel-left)) ) ((2) - (go (method-of-object obj tumble-right)) + (go (method-of-object this tumble-right)) ) (else - (go (method-of-object obj back-spring)) + (go (method-of-object this back-spring)) ) ) (none) @@ -673,22 +673,22 @@ ;; definition for method 247 of type ashelin ;; INFO: Used lq/sq -(defmethod ashelin-method-247 ashelin ((obj ashelin)) +(defmethod ashelin-method-247 ashelin ((this ashelin)) (cond - ((logtest? (bot-flags bf20) (-> obj bot-flags)) - (set! (-> obj root trans w) 1.0) - (set! (-> obj focus-info bullseye w) 1.0) - (let ((f30-0 (vector4-dot (the-as vector (-> obj frontline)) (-> obj root trans)))) - (let ((f0-4 (vector4-dot (the-as vector (-> obj frontline)) (-> obj focus-info bullseye)))) + ((logtest? (bot-flags bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (set! (-> this focus-info bullseye w) 1.0) + (let ((f30-0 (vector4-dot (the-as vector (-> this frontline)) (-> this root trans)))) + (let ((f0-4 (vector4-dot (the-as vector (-> this frontline)) (-> this focus-info bullseye)))) (if (or (>= 0.0 f0-4) (>= -8192.0 f30-0)) (return #t) ) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> obj focus-info bullseye) (-> obj root trans)) + (vector-! s5-0 (-> this focus-info bullseye) (-> this root trans)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) - (if (>= -0.342 (vector-dot s5-0 (the-as vector (-> obj frontline)))) + (if (>= -0.342 (vector-dot s5-0 (the-as vector (-> this frontline)))) (return #t) ) (if (>= f30-0 0.0) @@ -697,10 +697,10 @@ (let ((a2-0 (new 'stack-no-clear 'vector)) (a0-8 (new 'stack-no-clear 'vector)) ) - (vector-float*! a2-0 (the-as vector (-> obj frontline)) (- (-> obj frontline w))) - (set! (-> a0-8 quad) (-> obj root trans quad)) + (vector-float*! a2-0 (the-as vector (-> this frontline)) (- (-> this frontline w))) + (set! (-> a0-8 quad) (-> this root trans quad)) (set! (-> a0-8 y) 0.0) - (>= (intersect-ray-plane a0-8 s5-0 a2-0 (-> obj frontline)) 8192.0) + (>= (intersect-ray-plane a0-8 s5-0 a2-0 (-> this frontline)) 8192.0) ) ) ) @@ -712,19 +712,19 @@ ) ;; definition for method 248 of type ashelin -(defmethod ashelin-method-248 ashelin ((obj ashelin)) - (when (logtest? (bot-flags bf20) (-> obj bot-flags)) - (set! (-> obj root trans w) 1.0) - (set! (-> obj focus-info bullseye w) 1.0) - (let ((f0-3 (vector4-dot (the-as vector (-> obj frontline)) (-> obj root trans))) - (f1-1 (vector4-dot (the-as vector (-> obj frontline)) (-> obj focus-info bullseye))) +(defmethod ashelin-method-248 ashelin ((this ashelin)) + (when (logtest? (bot-flags bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (set! (-> this focus-info bullseye w) 1.0) + (let ((f0-3 (vector4-dot (the-as vector (-> this frontline)) (-> this root trans))) + (f1-1 (vector4-dot (the-as vector (-> this frontline)) (-> this focus-info bullseye))) ) (when (and (< 0.0 f1-1) (< 0.0 f0-3)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 (-> obj focus-info bullseye) (-> obj root trans)) + (vector-! s5-0 (-> this focus-info bullseye) (-> this root trans)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) - (>= (vector-dot s5-0 (the-as vector (-> obj frontline))) 0.0) + (>= (vector-dot s5-0 (the-as vector (-> this frontline))) 0.0) ) ) ) @@ -732,65 +732,63 @@ ) ;; definition for method 70 of type ashelin -(defmethod go-hostile ashelin ((obj ashelin)) - (bot-method-223 obj #t) +(defmethod go-hostile ashelin ((this ashelin)) + (bot-method-223 this #t) (cond - ((not (bot-method-214 obj)) - (react-to-focus obj) + ((not (bot-method-214 this)) + (react-to-focus this) ) - ((ashelin-method-238 obj #t #f) - (go (method-of-object obj standing-idle)) + ((ashelin-method-238 this #t #f) + (go (method-of-object this standing-idle)) ) - ((ashelin-method-247 obj) - (go (method-of-object obj chase)) + ((ashelin-method-247 this) + (go (method-of-object this chase)) ) (else - (go (method-of-object obj standing-idle)) + (go (method-of-object this standing-idle)) ) ) ) ;; definition for method 72 of type ashelin -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 10] -(defmethod react-to-focus ashelin ((obj ashelin)) +(defmethod react-to-focus ashelin ((this ashelin)) "@TODO - flesh out docs" - (if (bot-method-214 obj) - (go-hostile obj) - (ashelin-method-239 obj) + (if (bot-method-214 this) + (go-hostile this) + (ashelin-method-239 this) ) ) ;; definition for method 239 of type ashelin ;; WARN: Return type mismatch object vs none. -(defmethod ashelin-method-239 ashelin ((obj ashelin)) - (if (bot-method-214 obj) - (go (method-of-object obj standing-idle)) - (go (method-of-object obj waiting-idle)) +(defmethod ashelin-method-239 ashelin ((this ashelin)) + (if (bot-method-214 this) + (go (method-of-object this standing-idle)) + (go (method-of-object this waiting-idle)) ) (none) ) ;; definition for method 116 of type ashelin ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ashelin ((obj ashelin)) - (go (method-of-object obj hidden)) +(defmethod go-idle ashelin ((this ashelin)) + (go (method-of-object this hidden)) (none) ) ;; definition for method 237 of type ashelin ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fire-projectile ashelin ((obj ashelin) (arg0 vector)) - (set! (-> obj last-fire-time) (current-time)) - (+! (-> obj fired-gun-count) 1) +(defmethod fire-projectile ashelin ((this ashelin) (arg0 vector)) + (set-time! (-> this last-fire-time)) + (+! (-> this fired-gun-count) 1) (let ((s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> s4-0 ent) (-> obj entity)) + (set! (-> s4-0 ent) (-> this entity)) (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options account-for-target-velocity proj-options-8000)) - (set! (-> s4-0 notify-handle) (process->handle obj)) + (set! (-> s4-0 notify-handle) (process->handle this)) (set! (-> s4-0 owner-handle) (the-as handle #f)) - (set! (-> s4-0 ignore-handle) (process->handle obj)) + (set! (-> s4-0 ignore-handle) (process->handle this)) (let* ((v1-13 *game-info*) (a0-10 (+ (-> v1-13 attack-id) 1)) ) @@ -798,42 +796,42 @@ (set! (-> s4-0 attack-id) a0-10) ) (set! (-> s4-0 timeout) (seconds 4)) - (vector<-cspace! (-> s4-0 pos) (-> obj node-list data 22)) + (vector<-cspace! (-> s4-0 pos) (-> this node-list data 22)) (set! (-> s4-0 vel quad) (-> arg0 quad)) (vector-! (-> s4-0 vel) (-> s4-0 vel) (-> s4-0 pos)) (vector-normalize! (-> s4-0 vel) 307200.0) - (spawn-projectile ashelin-shot s4-0 obj *default-dead-pool*) + (spawn-projectile ashelin-shot s4-0 this *default-dead-pool*) ) (none) ) ;; definition for method 249 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod ashelin-method-249 ashelin ((obj ashelin)) +(defmethod ashelin-method-249 ashelin ((this ashelin)) (with-pp - (let* ((f30-0 (-> obj nav state speed)) + (let* ((f30-0 (-> this nav state speed)) (f0-1 (lerp-scale 0.0 2.0 f30-0 12288.0 40960.0)) - (f1-0 (-> obj travel-anim-interp)) - (v1-5 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (f1-0 (-> this travel-anim-interp)) + (v1-5 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-5 (= v1-5 (-> obj draw art-group data 5))) + ((and v1-5 (= v1-5 (-> this draw art-group data 5))) (let ((f28-0 f1-0) (f0-4 (seek f1-0 f0-1 (* 4.0 (seconds-per-frame)))) ) (cond - ((logtest? (bot-flags bf19) (-> obj bot-flags)) + ((logtest? (bot-flags bf19) (-> this bot-flags)) (if (< f0-4 1.0) (set! f0-4 (cond ((= f28-0 1.0) - (let ((v1-17 (-> obj skel root-channel 1))) + (let ((v1-17 (-> this skel root-channel 1))) (set! (-> v1-17 dist) 13107.2) - (set! (-> v1-17 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (set! (-> v1-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) ) - (logclear! (-> obj bot-flags) (bot-flags bf19)) + (logclear! (-> this bot-flags) (bot-flags bf19)) f0-4 ) (else @@ -847,11 +845,11 @@ (if (< 1.0 f0-4) (set! f0-4 (cond ((= f28-0 1.0) - (let ((v1-27 (-> obj skel root-channel 1))) + (let ((v1-27 (-> this skel root-channel 1))) (set! (-> v1-27 dist) 43690.68) - (set! (-> v1-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + (set! (-> v1-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) ) - (logior! (-> obj bot-flags) (bot-flags bf19)) + (logior! (-> this bot-flags) (bot-flags bf19)) f0-4 ) (else @@ -862,69 +860,69 @@ ) ) ) - (set! (-> obj travel-anim-interp) f0-4) - (let ((f0-7 (if (logtest? (bot-flags bf19) (-> obj bot-flags)) + (set! (-> this travel-anim-interp) f0-4) + (let ((f0-7 (if (logtest? (bot-flags bf19) (-> this bot-flags)) (+ -1.0 f0-4) (- 1.0 f0-4) ) ) - (v1-39 (-> obj skel root-channel 1)) + (v1-39 (-> this skel root-channel 1)) ) (set! (-> v1-39 frame-interp 1) f0-7) (set! (-> v1-39 frame-interp 0) f0-7) ) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-8 (quaternion-y-angle (-> obj root quat))) - (f1-10 (deg- f0-8 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-8 (quaternion-y-angle (-> this root quat))) + (f1-10 (deg- f0-8 (-> this travel-prev-ry))) (f0-11 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-10)))) (f0-14 (/ (* 16.0 (fmax f30-0 f0-11)) (* 15.0 f28-1))) - (a0-22 (-> obj skel root-channel 0)) + (a0-22 (-> this skel root-channel 0)) ) (set! (-> a0-22 param 0) f0-14) (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-23 (-> obj skel root-channel 1))) + (let ((a0-23 (-> this skel root-channel 1))) (set! (-> a0-23 param 0) 0.0) (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-chan) ) ) (else (let ((f30-1 (seek f1-0 f0-1 (* 4.0 (seconds-per-frame))))) - (set! (-> obj travel-anim-interp) f30-1) + (set! (-> this travel-anim-interp) f30-1) (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-26 (-> obj skel root-channel 0))) + (let ((a0-26 (-> this skel root-channel 0))) (set! (-> a0-26 dist) 26214.4) - (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> obj draw art-group data 5))) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) (set! (-> a0-26 param 0) 1.0) - (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> obj draw art-group data 5)) num-func-loop!) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-loop!) ) (cond ((< f30-1 1.0) (let ((f0-22 (- 1.0 f30-1)) - (a0-27 (-> obj skel root-channel 1)) + (a0-27 (-> this skel root-channel 1)) ) (set! (-> a0-27 frame-interp 1) f0-22) (set! (-> a0-27 frame-interp 0) f0-22) (set! (-> a0-27 dist) 13107.2) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-27 param 0) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-chan) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-chan) ) - (logclear! (-> obj bot-flags) (bot-flags bf19)) + (logclear! (-> this bot-flags) (bot-flags bf19)) ) (else (let ((f0-26 (+ -1.0 f30-1)) - (a0-29 (-> obj skel root-channel 1)) + (a0-29 (-> this skel root-channel 1)) ) (set! (-> a0-29 frame-interp 1) f0-26) (set! (-> a0-29 frame-interp 0) f0-26) (set! (-> a0-29 dist) 43690.68) - (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> obj draw art-group data 6))) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) (set! (-> a0-29 param 0) 0.0) - (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> obj draw art-group data 6)) num-func-chan) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> this draw art-group data 6)) num-func-chan) ) - (logior! (-> obj bot-flags) (bot-flags bf19)) + (logior! (-> this bot-flags) (bot-flags bf19)) ) ) ) @@ -937,17 +935,17 @@ ;; definition for method 51 of type ashelin ;; INFO: Used lq/sq -(defmethod enemy-method-51 ashelin ((obj ashelin)) +(defmethod enemy-method-51 ashelin ((this ashelin)) (local-vars (v1-36 art-element)) - (let ((f28-0 (quaternion-y-angle (-> obj root quat)))) - (case (-> obj incoming knocked-type) + (let ((f28-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (let ((a0-4 (handle->process (-> obj focus handle)))) + (let ((a0-4 (handle->process (-> this focus handle)))) (when a0-4 (get-trans (the-as process-focusable a0-4) 0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj root transv quad)) - (if (< (vector-dot (-> obj root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) 0.0 ) (vector-negate-in-place! s5-0) @@ -961,9 +959,9 @@ (let ((s5-1 (new 'stack-no-clear 'vector))) 0.0 0.0 - (vector-z-quaternion! s5-1 (-> obj root quat)) + (vector-z-quaternion! s5-1 (-> this root quat)) (let ((f28-1 (atan (-> s5-1 x) (-> s5-1 z)))) - (enemy-method-50 obj s5-1) + (enemy-method-50 this s5-1) (let* ((f30-0 (atan (-> s5-1 x) (-> s5-1 z))) (f0-10 (deg- f30-0 f28-1)) ) @@ -974,24 +972,24 @@ ) (cond ((and (>= 8192.0 f0-10) (>= f0-10 -16384.0)) - (set! v1-36 (-> obj draw art-group data 10)) + (set! v1-36 (-> this draw art-group data 10)) ) ((>= f0-10 8192.0) - (set! v1-36 (-> obj draw art-group data 7)) + (set! v1-36 (-> this draw art-group data 7)) (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) ) - ((zero? (get-rand-int obj 3)) - (set! v1-36 (-> obj draw art-group data 10)) + ((zero? (get-rand-int this 3)) + (set! v1-36 (-> this draw art-group data 10)) ) (else - (set! v1-36 (-> obj draw art-group data 7)) + (set! v1-36 (-> this draw art-group data 7)) (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) ) ) ) ) ) - (set! (-> obj knocked-anim) (the-as art-joint-anim v1-36)) + (set! (-> this knocked-anim) (the-as art-joint-anim v1-36)) ) ) f28-0 @@ -999,18 +997,18 @@ ) ;; definition for method 77 of type ashelin -(defmethod enemy-method-77 ashelin ((obj ashelin) (arg0 (pointer float))) +(defmethod enemy-method-77 ashelin ((this ashelin) (arg0 (pointer float))) (local-vars (a2-0 int)) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let ((s5-1 (ash 1 (-> *ashelin-global-info* prev-blue-hit))) (s4-0 (new 'stack-no-clear 'vector)) ) 0.0 0.0 - (vector-z-quaternion! s4-0 (-> obj root quat)) + (vector-z-quaternion! s4-0 (-> this root quat)) (let ((f30-0 (atan (-> s4-0 x) (-> s4-0 z)))) - (enemy-method-50 obj s4-0) + (enemy-method-50 this s4-0) (let* ((f0-6 (atan (-> s4-0 x) (-> s4-0 z))) (f0-8 (fabs (deg- f0-6 f30-0))) ) @@ -1021,28 +1019,28 @@ ) ) ) - (let* ((v1-9 (enemy-method-120 obj 6 a2-0)) - (s5-2 (-> obj draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9))) + (let* ((v1-9 (enemy-method-120 this 6 a2-0)) + (s5-2 (-> this draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9))) ) (set! (-> *ashelin-global-info* prev-blue-hit) v1-9) - (let ((v1-12 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-12 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-12 (or (= v1-12 (-> obj draw art-group data 16)) - (= v1-12 (-> obj draw art-group data 17)) - (= v1-12 (-> obj draw art-group data 18)) - (= v1-12 (-> obj draw art-group data 22)) - (= v1-12 (-> obj draw art-group data 23)) - (= v1-12 (-> obj draw art-group data 24)) + (if (and v1-12 (or (= v1-12 (-> this draw art-group data 16)) + (= v1-12 (-> this draw art-group data 17)) + (= v1-12 (-> this draw art-group data 18)) + (= v1-12 (-> this draw art-group data 22)) + (= v1-12 (-> this draw art-group data 23)) + (= v1-12 (-> this draw art-group data 24)) ) ) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-38 (-> obj skel root-channel 0))) + (let ((a0-38 (-> this skel root-channel 0))) (set! (-> a0-38 frame-group) (the-as art-joint-anim s5-2)) (set! (-> a0-38 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) (set! (-> a0-38 param 1) 1.0) @@ -1054,12 +1052,12 @@ ) (else (ja-channel-push! 1 (seconds 0.03)) - (let ((a0-40 (-> obj skel root-channel 0))) - (set! (-> a0-40 frame-group) (-> obj knocked-anim)) - (set! (-> a0-40 param 0) (the float (+ (-> obj knocked-anim frames num-frames) -1))) + (let ((a0-40 (-> this skel root-channel 0))) + (set! (-> a0-40 frame-group) (-> this knocked-anim)) + (set! (-> a0-40 param 0) (the float (+ (-> this knocked-anim frames num-frames) -1))) (set! (-> a0-40 param 1) (-> arg0 0)) (set! (-> a0-40 frame-num) 0.0) - (joint-control-channel-group! a0-40 (-> obj knocked-anim) num-func-seek!) + (joint-control-channel-group! a0-40 (-> this knocked-anim) num-func-seek!) ) #t ) @@ -1067,14 +1065,14 @@ ) ;; definition for method 78 of type ashelin -(defmethod enemy-method-78 ashelin ((obj ashelin) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 ashelin ((this ashelin) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((v1-1 *ashelin-global-info*) - (s5-0 (-> obj draw art-group data (-> v1-1 blue-hit-land-anim (-> v1-1 prev-blue-hit)))) + (s5-0 (-> this draw art-group data (-> v1-1 blue-hit-land-anim (-> v1-1 prev-blue-hit)))) ) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-7 (-> obj skel root-channel 0))) + (let ((a0-7 (-> this skel root-channel 0))) (set! (-> a0-7 frame-group) (the-as art-joint-anim s5-0)) (set! (-> a0-7 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) (set! (-> a0-7 param 1) 1.0) @@ -1085,65 +1083,65 @@ #t ) (else - (let ((v1-15 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-15 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-15 (= v1-15 (-> obj draw art-group data 7))) + ((and v1-15 (= v1-15 (-> this draw art-group data 7))) (cond - ((or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) + ((or (zero? (-> this hit-points)) (nonzero? (-> this fated-time))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-14 (-> obj skel root-channel 0))) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 9))) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 9))) (set! (-> a0-14 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 9)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 9)) frames num-frames) -1)) ) (set! (-> a0-14 param 1) 1.0) (set! (-> a0-14 frame-num) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 9)) num-func-seek!) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 9)) num-func-seek!) ) #f ) (else (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-16 (-> obj skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (let ((a0-16 (-> this skel root-channel 0))) + (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> this draw art-group data 8))) (set! (-> a0-16 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 8)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 8)) frames num-frames) -1)) ) (set! (-> a0-16 param 1) 1.0) (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> obj draw art-group data 8)) num-func-seek!) + (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> this draw art-group data 8)) num-func-seek!) ) #t ) ) ) - ((and (or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) (nonzero? (get-rand-int obj 3))) + ((and (or (zero? (-> this hit-points)) (nonzero? (-> this fated-time))) (nonzero? (get-rand-int this 3))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-20 (-> obj skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (let ((a0-20 (-> this skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) ) (set! (-> a0-20 param 1) 1.0) (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) ) #f ) (else (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-22 (-> obj skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 11))) + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 11)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) ) (set! (-> a0-22 param 1) 1.0) (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 11)) num-func-seek!) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) ) #t ) @@ -1154,95 +1152,95 @@ ) ;; definition for method 79 of type ashelin -(defmethod enemy-method-79 ashelin ((obj ashelin) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 ashelin ((this ashelin) (arg0 int) (arg1 enemy-knocked-info)) (cond ((= arg0 3) (let ((s5-0 (ja-done? 0))) (cond - ((and s5-0 (let ((v1-4 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((and s5-0 (let ((v1-4 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-4 (or (= v1-4 (-> obj draw art-group data 16)) - (= v1-4 (-> obj draw art-group data 17)) - (= v1-4 (-> obj draw art-group data 18)) - (= v1-4 (-> obj draw art-group data 22)) - (= v1-4 (-> obj draw art-group data 23)) - (= v1-4 (-> obj draw art-group data 24)) + (and v1-4 (or (= v1-4 (-> this draw art-group data 16)) + (= v1-4 (-> this draw art-group data 17)) + (= v1-4 (-> this draw art-group data 18)) + (= v1-4 (-> this draw art-group data 22)) + (= v1-4 (-> this draw art-group data 23)) + (= v1-4 (-> this draw art-group data 24)) ) ) ) ) (ja-channel-push! 1 (seconds 0.03)) - (let ((a0-21 (-> obj skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> obj draw art-group data 25))) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 25))) (set! (-> a0-21 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 25)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 25)) frames num-frames) -1)) ) (set! (-> a0-21 param 1) 1.0) (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> obj draw art-group data 25)) num-func-seek!) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 25)) num-func-seek!) ) (set! s5-0 #f) ) (else - (let ((v1-25 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-25 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-25 (= v1-25 (-> obj draw art-group data 8))) + ((and v1-25 (= v1-25 (-> this draw art-group data 8))) (let ((f0-4 (ja-aframe-num 0))) (cond ((>= f0-4 22.0) - (when (focus-test? obj dangerous) - (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj focus-status) (focus-status dangerous)) + (when (focus-test? this dangerous) + (if (logtest? (-> this enemy-flags) (enemy-flag check-water)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this focus-status) (focus-status dangerous)) ) ) ) ((>= f0-4 16.0) - (when (not (focus-test? obj dangerous)) - (logior! (-> obj focus-status) (focus-status dangerous)) + (when (not (focus-test? this dangerous)) + (logior! (-> this focus-status) (focus-status dangerous)) (let* ((v1-42 *game-info*) (a0-34 (+ (-> v1-42 attack-id) 1)) ) (set! (-> v1-42 attack-id) a0-34) - (set! (-> obj attack-id) a0-34) + (set! (-> this attack-id) a0-34) ) ) ) ) ) ) - ((let ((v1-45 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((let ((v1-45 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-45 (= v1-45 (-> obj draw art-group data 11))) + (and v1-45 (= v1-45 (-> this draw art-group data 11))) ) (let ((f0-5 (ja-aframe-num 0))) (cond ((>= f0-5 32.0) - (when (focus-test? obj dangerous) - (if (logtest? (-> obj enemy-flags) (enemy-flag check-water)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj focus-status) (focus-status dangerous)) + (when (focus-test? this dangerous) + (if (logtest? (-> this enemy-flags) (enemy-flag check-water)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this focus-status) (focus-status dangerous)) ) ) ) ((>= f0-5 25.0) - (when (not (focus-test? obj dangerous)) - (logior! (-> obj focus-status) (focus-status dangerous)) + (when (not (focus-test? this dangerous)) + (logior! (-> this focus-status) (focus-status dangerous)) (let* ((v1-62 *game-info*) (a0-47 (+ (-> v1-62 attack-id) 1)) ) (set! (-> v1-62 attack-id) a0-47) - (set! (-> obj attack-id) a0-47) + (set! (-> this attack-id) a0-47) ) ) ) @@ -1251,7 +1249,7 @@ ) ) ) - (let ((a0-48 (-> obj skel root-channel 0))) + (let ((a0-48 (-> this skel root-channel 0))) (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group frames num-frames) -1))) (set! (-> a0-48 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-48 (the-as art-joint-anim #f) num-func-seek!) @@ -1262,14 +1260,14 @@ ) ) (else - ((method-of-type bot enemy-method-79) obj arg0 arg1) + ((method-of-type bot enemy-method-79) this arg0 arg1) ) ) ) ;; definition for method 236 of type ashelin ;; INFO: Used lq/sq -(defmethod ashelin-method-236 ashelin ((obj ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) +(defmethod ashelin-method-236 ashelin ((this ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) (local-vars (v1-23 float) (sv-272 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1277,7 +1275,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (let* ((v1-0 (-> obj nav)) + (let* ((v1-0 (-> this nav)) (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) (a1-1 (-> v1-0 sphere-id-array)) (a2-2 (-> v1-0 state mesh bounds)) @@ -1295,7 +1293,7 @@ ) 0 (let ((s0-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) - (vector-! (-> s0-0 current-pos) (-> obj root trans) (-> obj nav state mesh bounds)) + (vector-! (-> s0-0 current-pos) (-> this root trans) (-> this nav state mesh bounds)) (set! sv-272 (-> s0-0 travel)) (set! (-> sv-272 x) (sin arg1)) (set! (-> sv-272 y) 0.0) @@ -1303,13 +1301,13 @@ (set! (-> sv-272 w) 1.0) (vector-float*! (-> s0-0 travel) (-> s0-0 travel) arg3) (set! (-> s0-0 pref-dir quad) (-> s0-0 travel quad)) - (avoid-spheres-1! (-> obj nav) s0-0) + (avoid-spheres-1! (-> this nav) s0-0) (set! (-> arg0 quad) (-> s0-0 out-travel 0 quad)) ) 0 (when (>= arg2 (fabs (deg- arg1 (atan (-> arg0 x) (-> arg0 z))))) (let ((t0-2 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) - (clamp-vector-to-mesh-no-gaps (-> obj nav) (-> obj root trans) (-> obj nav state current-poly) arg0 t0-2) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) (-> this nav state current-poly) arg0 t0-2) ) (.lvf vf1 (&-> arg0 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) @@ -1328,49 +1326,49 @@ ) ;; definition for method 142 of type ashelin -(defmethod nav-enemy-method-142 ashelin ((obj ashelin) (arg0 nav-control)) - (if (not (and (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'back-spring) (= v1-3 'cartwheel-left) (= v1-3 'tumble-right)) - ) +(defmethod nav-enemy-method-142 ashelin ((this ashelin) (arg0 nav-control)) + (if (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'back-spring) (= v1-3 'cartwheel-left) (= v1-3 'tumble-right)) + ) ) ) - ((method-of-type bot nav-enemy-method-142) obj arg0) + ((method-of-type bot nav-enemy-method-142) this arg0) ) (none) ) ;; definition for method 216 of type ashelin ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-216 ashelin ((obj ashelin)) - (set! (-> obj health-handle) (ppointer->handle (process-spawn hud-ashelin :init hud-init-by-other :to obj))) +(defmethod bot-method-216 ashelin ((this ashelin)) + (set! (-> this health-handle) (ppointer->handle (process-spawn hud-ashelin :init hud-init-by-other :to this))) 0 (none) ) ;; definition for method 203 of type ashelin -(defmethod play-attacked-speech ashelin ((obj ashelin)) +(defmethod play-attacked-speech ashelin ((this ashelin)) (local-vars (v1-3 int) (a3-0 int)) - (when (not (channel-active? obj (the-as uint 0))) + (when (not (channel-active? this (the-as uint 0))) (let ((v1-2 0)) - (if (logtest? #x3c00000 (-> obj incoming penetrate-using)) + (if (logtest? #x3c00000 (-> this incoming penetrate-using)) (set! v1-3 (logior v1-2 128)) (set! v1-3 (logior v1-2 64)) ) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) (set! a3-0 (logior v1-3 256)) (set! a3-0 (logior v1-3 512)) ) (let ((a1-3 (bot-speech-list-method-9 - (-> obj ash-course attack-player-speeches) - obj - (-> obj ash-course speeches) + (-> this ash-course attack-player-speeches) + this + (-> this ash-course speeches) (the-as speech-flags a3-0) ) ) ) (if (>= a1-3 0) - (play-speech obj a1-3) + (play-speech this a1-3) ) ) ) @@ -1378,14 +1376,18 @@ ) ;; definition for method 244 of type ashelin -(defmethod ashelin-method-244 ashelin ((obj ashelin)) - (when (not (channel-active? obj (the-as uint 0))) - (let ((a1-2 - (bot-speech-list-method-9 (-> obj ash-course ouch-speeches) obj (-> obj ash-course speeches) (speech-flags)) - ) +(defmethod ashelin-method-244 ashelin ((this ashelin)) + (when (not (channel-active? this (the-as uint 0))) + (let ((a1-2 (bot-speech-list-method-9 + (-> this ash-course ouch-speeches) + this + (-> this ash-course speeches) + (speech-flags) + ) + ) ) (if (>= a1-2 0) - (play-speech obj a1-2) + (play-speech this a1-2) ) ) ) @@ -1393,19 +1395,21 @@ ) ;; definition for method 245 of type ashelin -(defmethod ashelin-method-245 ashelin ((obj ashelin)) - (when (and (not (channel-active? obj (the-as uint 0))) (>= (current-time) (-> obj victory-speech-time))) +(defmethod ashelin-method-245 ashelin ((this ashelin)) + (when (and (not (channel-active? this (the-as uint 0))) (>= (current-time) (-> this victory-speech-time))) (let ((s5-0 (bot-speech-list-method-9 - (-> obj ash-course victory-speeches) - obj - (-> obj ash-course speeches) + (-> this ash-course victory-speeches) + this + (-> this ash-course speeches) (speech-flags) ) ) ) (when (>= s5-0 0) - (set! (-> obj victory-speech-time) (the-as time-frame (+ (get-rand-int-range obj 1200 2100) (current-time)))) - (play-speech obj s5-0) + (set! (-> this victory-speech-time) + (the-as time-frame (+ (get-rand-int-range this 1200 2100) (current-time))) + ) + (play-speech this s5-0) ) ) ) @@ -1413,10 +1417,10 @@ ) ;; definition for method 136 of type ashelin -(defmethod enemy-method-136 ashelin ((obj ashelin)) - (when (>= (- (current-time) (-> obj hit-focus-time)) (seconds 2)) - (let ((v0-0 (logclear (-> obj enemy-flags) (enemy-flag look-at-focus)))) - (set! (-> obj enemy-flags) v0-0) +(defmethod enemy-method-136 ashelin ((this ashelin)) + (when (time-elapsed? (-> this hit-focus-time) (seconds 2)) + (let ((v0-0 (logclear (-> this enemy-flags) (enemy-flag look-at-focus)))) + (set! (-> this enemy-flags) v0-0) v0-0 ) ) @@ -1424,61 +1428,61 @@ ;; definition for method 206 of type ashelin ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod play-speech ashelin ((obj ashelin) (arg0 int)) +(defmethod play-speech ashelin ((this ashelin) (arg0 int)) (let ((t9-0 (method-of-type bot play-speech))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-focus)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-focus)) (none) ) ;; definition for method 15 of type hud-ashelin ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-ashelin ((obj hud-ashelin)) +(defmethod draw hud-ashelin ((this hud-ashelin)) (set-hud-piece-position! - (-> obj sprites 2) - (the int (+ 30.0 (* -130.0 (-> obj offset)))) - (the int (+ 30.0 (* -100.0 (-> obj offset)))) + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 8 2) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 8 2) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-ashelin ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-ashelin ((obj hud-ashelin)) - (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-ashelin ((this hud-ashelin)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-ashelin ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-ashelin ((obj hud-ashelin)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-ashelin ((this hud-ashelin)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 scale-x) 12.0) - (set! (-> obj sprites 0 scale-y) 11.2) - (set! (-> obj sprites 0 pos z) #xfffff2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 3 tex) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tex) (lookup-texture-by-name "hud-ashlyn-head" (the-as string #f) (the-as (pointer texture-page) #f)) ) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.4) - (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.4) + (set! (-> this sprites 3 pos z) #xffffff) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc index d4bae8bb2d..41e145f24f 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot-h_REF.gc @@ -22,26 +22,26 @@ ) ;; definition for method 3 of type bot-focus-info -(defmethod inspect bot-focus-info ((obj bot-focus-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot-focus-info ((this bot-focus-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bot-focus-info) - (format #t "~1Tmax-los-dist: ~f~%" (-> obj max-los-dist)) - (format #t "~1Tfproc: ~A~%" (-> obj fproc)) - (format #t "~1Tbullseye-xz-dist: ~f~%" (-> obj bullseye-xz-dist)) - (format #t "~1Try-diff: ~f~%" (-> obj ry-diff)) - (format #t "~1Tmy-facing-ry: ~f~%" (-> obj my-facing-ry)) - (format #t "~1Tbullseye-ry: ~f~%" (-> obj bullseye-ry)) - (format #t "~1Tlos: ~D~%" (-> obj los)) - (format #t "~1Tupdate-time: ~D~%" (-> obj update-time)) - (format #t "~1Tbullseye: #~%" (-> obj bullseye)) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tmy-facing-xz-dir: #~%" (-> obj my-facing-xz-dir)) - (format #t "~1Tbullseye-xz-dir: #~%" (-> obj bullseye-xz-dir)) + (format #t "[~8x] ~A~%" this 'bot-focus-info) + (format #t "~1Tmax-los-dist: ~f~%" (-> this max-los-dist)) + (format #t "~1Tfproc: ~A~%" (-> this fproc)) + (format #t "~1Tbullseye-xz-dist: ~f~%" (-> this bullseye-xz-dist)) + (format #t "~1Try-diff: ~f~%" (-> this ry-diff)) + (format #t "~1Tmy-facing-ry: ~f~%" (-> this my-facing-ry)) + (format #t "~1Tbullseye-ry: ~f~%" (-> this bullseye-ry)) + (format #t "~1Tlos: ~D~%" (-> this los)) + (format #t "~1Tupdate-time: ~D~%" (-> this update-time)) + (format #t "~1Tbullseye: #~%" (-> this bullseye)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tmy-facing-xz-dir: #~%" (-> this my-facing-xz-dir)) + (format #t "~1Tbullseye-xz-dir: #~%" (-> this bullseye-xz-dir)) (label cfg-4) - obj + this ) ;; definition of type bot-turn-info @@ -62,23 +62,23 @@ ) ;; definition for method 3 of type bot-turn-info -(defmethod inspect bot-turn-info ((obj bot-turn-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot-turn-info ((this bot-turn-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bot-turn-info) - (format #t "~1Tfacing-ry: ~f~%" (-> obj facing-ry)) - (format #t "~1Ttarg-ry: ~f~%" (-> obj targ-ry)) - (format #t "~1Try-diff: ~f~%" (-> obj ry-diff)) - (format #t "~1Tpredicted-ry-diff: ~f~%" (-> obj predicted-ry-diff)) - (format #t "~1Tpredicted-targ-ry: ~f~%" (-> obj predicted-targ-ry)) - (format #t "~1Tfacing-dir: #~%" (-> obj facing-dir)) - (format #t "~1Ttarg-pos: #~%" (-> obj targ-pos)) - (format #t "~1Tpredicted-targ-pos: #~%" (-> obj predicted-targ-pos)) - (format #t "~1Tsrc-quat: #~%" (-> obj src-quat)) + (format #t "[~8x] ~A~%" this 'bot-turn-info) + (format #t "~1Tfacing-ry: ~f~%" (-> this facing-ry)) + (format #t "~1Ttarg-ry: ~f~%" (-> this targ-ry)) + (format #t "~1Try-diff: ~f~%" (-> this ry-diff)) + (format #t "~1Tpredicted-ry-diff: ~f~%" (-> this predicted-ry-diff)) + (format #t "~1Tpredicted-targ-ry: ~f~%" (-> this predicted-targ-ry)) + (format #t "~1Tfacing-dir: #~%" (-> this facing-dir)) + (format #t "~1Ttarg-pos: #~%" (-> this targ-pos)) + (format #t "~1Tpredicted-targ-pos: #~%" (-> this predicted-targ-pos)) + (format #t "~1Tsrc-quat: #~%" (-> this src-quat)) (label cfg-4) - obj + this ) ;; definition of type bot-speech-tuning @@ -94,18 +94,18 @@ ) ;; definition for method 3 of type bot-speech-tuning -(defmethod inspect bot-speech-tuning ((obj bot-speech-tuning)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot-speech-tuning ((this bot-speech-tuning)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bot-speech-tuning) - (format #t "~1Tfo-min: ~D~%" (-> obj fo-min)) - (format #t "~1Tfo-max: ~D~%" (-> obj fo-max)) - (format #t "~1Tfo-curve: ~D~%" (-> obj fo-curve)) - (format #t "~1Ttrans?: ~A~%" (-> obj trans?)) + (format #t "[~8x] ~A~%" this 'bot-speech-tuning) + (format #t "~1Tfo-min: ~D~%" (-> this fo-min)) + (format #t "~1Tfo-max: ~D~%" (-> this fo-max)) + (format #t "~1Tfo-curve: ~D~%" (-> this fo-curve)) + (format #t "~1Ttrans?: ~A~%" (-> this trans?)) (label cfg-4) - obj + this ) ;; definition of type bot-speech-info @@ -122,19 +122,19 @@ ) ;; definition for method 3 of type bot-speech-info -(defmethod inspect bot-speech-info ((obj bot-speech-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot-speech-info ((this bot-speech-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bot-speech-info) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Thold-time: ~D~%" (-> obj hold-time)) - (format #t "~1Tslave-id: ~D~%" (-> obj slave-id)) - (format #t "~1Ttuning-id: ~D~%" (-> obj tuning-id)) - (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "[~8x] ~A~%" this 'bot-speech-info) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Thold-time: ~D~%" (-> this hold-time)) + (format #t "~1Tslave-id: ~D~%" (-> this slave-id)) + (format #t "~1Ttuning-id: ~D~%" (-> this tuning-id)) + (format #t "~1Tname: ~A~%" (-> this name)) (label cfg-4) - obj + this ) ;; definition of type bot-spot @@ -152,20 +152,20 @@ ) ;; definition for method 3 of type bot-spot -(defmethod inspect bot-spot ((obj bot-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot-spot ((this bot-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bot-spot) - (format #t "~1Tcenter: #~%" (-> obj center)) - (format #t "~1Tcenter-x: ~f~%" (-> obj center x)) - (format #t "~1Tcenter-y: ~f~%" (-> obj center y)) - (format #t "~1Tcenter-z: ~f~%" (-> obj center z)) - (format #t "~1Tinside-xz-dist: ~f~%" (-> obj center w)) - (format #t "~1Tblocked-xz-dist: ~f~%" (-> obj blocked-xz-dist)) + (format #t "[~8x] ~A~%" this 'bot-spot) + (format #t "~1Tcenter: #~%" (-> this center)) + (format #t "~1Tcenter-x: ~f~%" (-> this center x)) + (format #t "~1Tcenter-y: ~f~%" (-> this center y)) + (format #t "~1Tcenter-z: ~f~%" (-> this center z)) + (format #t "~1Tinside-xz-dist: ~f~%" (-> this center w)) + (format #t "~1Tblocked-xz-dist: ~f~%" (-> this blocked-xz-dist)) (label cfg-4) - obj + this ) ;; definition of type bot-waypoint @@ -186,23 +186,23 @@ ) ;; definition for method 3 of type bot-waypoint -(defmethod inspect bot-waypoint ((obj bot-waypoint)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot-waypoint ((this bot-waypoint)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Twaypoint-id: ~D~%" (-> obj waypoint-id)) - (format #t "~1Tnav-mesh-index: ~D~%" (-> obj nav-mesh-index)) - (format #t "~1Tskip-to: ~D~%" (-> obj skip-to)) - (format #t "~1Ton-set: ~A~%" (-> obj on-set)) - (format #t "~1Ton-update: ~A~%" (-> obj on-update)) - (format #t "~1Ton-skipping-here: ~A~%" (-> obj on-skipping-here)) - (format #t "~1Tcheck-too-far: ~A~%" (-> obj check-too-far)) - (format #t "~1Twarn-dist: ~f~%" (-> obj warn-dist)) - (format #t "~1Tfail-dist-delta: ~f~%" (-> obj fail-dist-delta)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twaypoint-id: ~D~%" (-> this waypoint-id)) + (format #t "~1Tnav-mesh-index: ~D~%" (-> this nav-mesh-index)) + (format #t "~1Tskip-to: ~D~%" (-> this skip-to)) + (format #t "~1Ton-set: ~A~%" (-> this on-set)) + (format #t "~1Ton-update: ~A~%" (-> this on-update)) + (format #t "~1Ton-skipping-here: ~A~%" (-> this on-skipping-here)) + (format #t "~1Tcheck-too-far: ~A~%" (-> this check-too-far)) + (format #t "~1Twarn-dist: ~f~%" (-> this warn-dist)) + (format #t "~1Tfail-dist-delta: ~f~%" (-> this fail-dist-delta)) (label cfg-4) - obj + this ) ;; definition of type bot-course @@ -227,27 +227,27 @@ ) ;; definition for method 3 of type bot-course -(defmethod inspect bot-course ((obj bot-course)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot-course ((this bot-course)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcourse-id: ~D~%" (-> obj course-id)) - (format #t "~1Tspeech-count: ~D~%" (-> obj speech-count)) - (format #t "~1Tspot-count: ~D~%" (-> obj spot-count)) - (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) - (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> obj too-far-warn-speeches)) - (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> obj too-far-fail-speeches)) - (format #t "~1Tattack-player-speeches: ~A~%" (-> obj attack-player-speeches)) - (format #t "~1Tdefault-check-too-far: ~A~%" (-> obj default-check-too-far)) - (format #t "~1Twaypoints: ~A~%" (-> obj waypoints)) - (format #t "~1Tspeeches: #x~X~%" (-> obj speeches)) - (format #t "~1Tspeech-tunings: #x~X~%" (-> obj speech-tunings)) - (format #t "~1Tdirs: #x~X~%" (-> obj dirs)) - (format #t "~1Tspots: #x~X~%" (-> obj spots)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse-id: ~D~%" (-> this course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> this speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> this spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> this too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> this too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> this attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> this default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> this waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> this speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> this speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> this dirs)) + (format #t "~1Tspots: #x~X~%" (-> this spots)) (label cfg-4) - obj + this ) ;; definition of type bot @@ -361,68 +361,68 @@ ) ;; definition for method 3 of type bot -(defmethod inspect bot ((obj bot)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot ((this bot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbot-flags: ~D~%" (-> obj bot-flags)) - (format #t "~2Tmin-speed: ~f~%" (-> obj min-speed)) - (format #t "~2Tmax-speed: ~f~%" (-> obj max-speed)) - (format #t "~2Tfollow-offset: ~f~%" (-> obj follow-offset)) - (format #t "~2Ttoo-far-warn-dist: ~f~%" (-> obj too-far-warn-dist)) - (format #t "~2Ttoo-far-fail-dist-delta: ~f~%" (-> obj too-far-fail-dist-delta)) - (format #t "~2Ttoo-far-warn-dist-default: ~f~%" (-> obj too-far-warn-dist-default)) - (format #t "~2Ttoo-far-fail-dist-delta-default: ~f~%" (-> obj too-far-fail-dist-delta-default)) - (format #t "~2Ttravel-prev-ry: ~f~%" (-> obj travel-prev-ry)) - (format #t "~2Ttravel-prev-ry1: ~f~%" (-> obj travel-prev-ry1)) - (format #t "~2Tplayer-blocking: ~f~%" (-> obj player-blocking)) - (format #t "~2Tai-ctrl: ~A~%" (-> obj ai-ctrl)) - (format #t "~2Tcourse: ~A~%" (-> obj course)) - (format #t "~2Twaypoint: ~A~%" (-> obj waypoint)) - (format #t "~2Twaypoint-bits: ~D~%" (-> obj waypoint-bits)) - (format #t "~2Twaypoint-int32a: ~D~%" (-> obj waypoint-int32a)) - (format #t "~2Tbot-task-bits: ~D~%" (-> obj bot-task-bits)) - (format #t "~2Thit-invuln-ignore-me-delay: ~D~%" (-> obj hit-invuln-ignore-me-delay)) - (format #t "~2Thit-invuln-focus-disable-delay: ~D~%" (-> obj hit-invuln-focus-disable-delay)) - (format #t "~2Twarn-to-fail-timeout: ~D~%" (-> obj warn-to-fail-timeout)) - (format #t "~2Twarn-min-delay: ~D~%" (-> obj warn-min-delay)) - (format #t "~2Twarn-max-delay: ~D~%" (-> obj warn-max-delay)) - (format #t "~2Tspot-color: ~D~%" (-> obj spot-color)) - (format #t "~2Twaypoint-request: ~D~%" (-> obj waypoint-request)) - (format #t "~2Thit-by-enemy-count: ~D~%" (-> obj hit-by-enemy-count)) - (format #t "~2Thit-by-player-count: ~D~%" (-> obj hit-by-player-count)) - (format #t "~2Tnotice-enemy-dist: ~f~%" (-> obj notice-enemy-dist)) - (format #t "~2Tchannel: ~D~%" (-> obj channel)) - (format #t "~2Tfocus-mode: ~D~%" (-> obj focus-mode)) - (format #t "~2Tnav-mesh-index: ~D~%" (-> obj nav-mesh-index)) - (format #t "~2Tdelay-too-far-check: ~D~%" (-> obj delay-too-far-check)) - (format #t "~2Tslave-id: ~D~%" (-> obj slave-id)) - (format #t "~2Tvehicle-seat-index: ~D~%" (-> obj vehicle-seat-index)) - (format #t "~2Tbot-health-index: ~D~%" (-> obj bot-health-index)) - (format #t "~2Ttask: ~A~%" (-> obj task)) - (format #t "~2Tswivel-joint-mod: ~A~%" (-> obj swivel-joint-mod)) - (format #t "~2Thealth-handle: ~D~%" (-> obj health-handle)) - (format #t "~2Tpoi-handle: ~D~%" (-> obj poi-handle)) - (format #t "~2Tmy-simple-focus: #x~X~%" (-> obj my-simple-focus)) - (format #t "~2Tattacker-handle: ~D~%" (-> obj attacker-handle)) - (format #t "~2Tscene-player-handle: ~D~%" (-> obj scene-player-handle)) - (format #t "~2Tmaster-handle: ~D~%" (-> obj master-handle)) - (format #t "~2Tvehicle-handle: ~D~%" (-> obj vehicle-handle)) - (format #t "~2Thit-invuln-starting-time: ~D~%" (-> obj hit-invuln-starting-time)) - (format #t "~2Tdanger-time: ~D~%" (-> obj danger-time)) - (format #t "~2Tattacker-time: ~D~%" (-> obj attacker-time)) - (format #t "~2Tstarted-warning-time: ~D~%" (-> obj started-warning-time)) - (format #t "~2Twaypoint-time0: ~D~%" (-> obj waypoint-time0)) - (format #t "~2Tnext-too-far-warn-time: ~D~%" (-> obj next-too-far-warn-time)) - (format #t "~2Tspot: #~%" (-> obj spot)) - (format #t "~2Tfollow-dir: #~%" (-> obj follow-dir)) - (format #t "~2Tfocus-info: #~%" (-> obj focus-info)) + (format #t "~2Tbot-flags: ~D~%" (-> this bot-flags)) + (format #t "~2Tmin-speed: ~f~%" (-> this min-speed)) + (format #t "~2Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~2Tfollow-offset: ~f~%" (-> this follow-offset)) + (format #t "~2Ttoo-far-warn-dist: ~f~%" (-> this too-far-warn-dist)) + (format #t "~2Ttoo-far-fail-dist-delta: ~f~%" (-> this too-far-fail-dist-delta)) + (format #t "~2Ttoo-far-warn-dist-default: ~f~%" (-> this too-far-warn-dist-default)) + (format #t "~2Ttoo-far-fail-dist-delta-default: ~f~%" (-> this too-far-fail-dist-delta-default)) + (format #t "~2Ttravel-prev-ry: ~f~%" (-> this travel-prev-ry)) + (format #t "~2Ttravel-prev-ry1: ~f~%" (-> this travel-prev-ry1)) + (format #t "~2Tplayer-blocking: ~f~%" (-> this player-blocking)) + (format #t "~2Tai-ctrl: ~A~%" (-> this ai-ctrl)) + (format #t "~2Tcourse: ~A~%" (-> this course)) + (format #t "~2Twaypoint: ~A~%" (-> this waypoint)) + (format #t "~2Twaypoint-bits: ~D~%" (-> this waypoint-bits)) + (format #t "~2Twaypoint-int32a: ~D~%" (-> this waypoint-int32a)) + (format #t "~2Tbot-task-bits: ~D~%" (-> this bot-task-bits)) + (format #t "~2Thit-invuln-ignore-me-delay: ~D~%" (-> this hit-invuln-ignore-me-delay)) + (format #t "~2Thit-invuln-focus-disable-delay: ~D~%" (-> this hit-invuln-focus-disable-delay)) + (format #t "~2Twarn-to-fail-timeout: ~D~%" (-> this warn-to-fail-timeout)) + (format #t "~2Twarn-min-delay: ~D~%" (-> this warn-min-delay)) + (format #t "~2Twarn-max-delay: ~D~%" (-> this warn-max-delay)) + (format #t "~2Tspot-color: ~D~%" (-> this spot-color)) + (format #t "~2Twaypoint-request: ~D~%" (-> this waypoint-request)) + (format #t "~2Thit-by-enemy-count: ~D~%" (-> this hit-by-enemy-count)) + (format #t "~2Thit-by-player-count: ~D~%" (-> this hit-by-player-count)) + (format #t "~2Tnotice-enemy-dist: ~f~%" (-> this notice-enemy-dist)) + (format #t "~2Tchannel: ~D~%" (-> this channel)) + (format #t "~2Tfocus-mode: ~D~%" (-> this focus-mode)) + (format #t "~2Tnav-mesh-index: ~D~%" (-> this nav-mesh-index)) + (format #t "~2Tdelay-too-far-check: ~D~%" (-> this delay-too-far-check)) + (format #t "~2Tslave-id: ~D~%" (-> this slave-id)) + (format #t "~2Tvehicle-seat-index: ~D~%" (-> this vehicle-seat-index)) + (format #t "~2Tbot-health-index: ~D~%" (-> this bot-health-index)) + (format #t "~2Ttask: ~A~%" (-> this task)) + (format #t "~2Tswivel-joint-mod: ~A~%" (-> this swivel-joint-mod)) + (format #t "~2Thealth-handle: ~D~%" (-> this health-handle)) + (format #t "~2Tpoi-handle: ~D~%" (-> this poi-handle)) + (format #t "~2Tmy-simple-focus: #x~X~%" (-> this my-simple-focus)) + (format #t "~2Tattacker-handle: ~D~%" (-> this attacker-handle)) + (format #t "~2Tscene-player-handle: ~D~%" (-> this scene-player-handle)) + (format #t "~2Tmaster-handle: ~D~%" (-> this master-handle)) + (format #t "~2Tvehicle-handle: ~D~%" (-> this vehicle-handle)) + (format #t "~2Thit-invuln-starting-time: ~D~%" (-> this hit-invuln-starting-time)) + (format #t "~2Tdanger-time: ~D~%" (-> this danger-time)) + (format #t "~2Tattacker-time: ~D~%" (-> this attacker-time)) + (format #t "~2Tstarted-warning-time: ~D~%" (-> this started-warning-time)) + (format #t "~2Twaypoint-time0: ~D~%" (-> this waypoint-time0)) + (format #t "~2Tnext-too-far-warn-time: ~D~%" (-> this next-too-far-warn-time)) + (format #t "~2Tspot: #~%" (-> this spot)) + (format #t "~2Tfollow-dir: #~%" (-> this follow-dir)) + (format #t "~2Tfocus-info: #~%" (-> this focus-info)) (label cfg-4) - obj + this ) ;; definition for symbol *bot-task-pool*, type ai-task-pool @@ -694,27 +694,27 @@ ) ;; definition for method 3 of type bot-speech-list -(defmethod inspect bot-speech-list ((obj bot-speech-list)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot-speech-list ((this bot-speech-list)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) - (format #t "~1Tlast-local-index: ~D~%" (-> obj last-local-index)) - (format #t "~1Tspeech-indexes: ~A~%" (-> obj speech-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Tlast-local-index: ~D~%" (-> this last-local-index)) + (format #t "~1Tspeech-indexes: ~A~%" (-> this speech-indexes)) (label cfg-4) - obj + this ) ;; definition for method 10 of type bot-speech-list ;; WARN: Return type mismatch int vs none. -(defmethod reset-index bot-speech-list ((obj bot-speech-list) (arg0 symbol)) +(defmethod reset-index bot-speech-list ((this bot-speech-list) (arg0 symbol)) (if arg0 - (logand! (-> obj flags) -2) + (logand! (-> this flags) -2) ) - (set! (-> obj last-local-index) -1) + (set! (-> this last-local-index) -1) (none) ) @@ -778,38 +778,38 @@ ) ;; definition for method 3 of type bot-speech-list-shuffle -(defmethod inspect bot-speech-list-shuffle ((obj bot-speech-list-shuffle)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot-speech-list-shuffle ((this bot-speech-list-shuffle)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) - (format #t "~1Tlast-local-index: ~D~%" (-> obj last-local-index)) - (format #t "~1Tspeech-indexes: ~A~%" (-> obj speech-indexes)) - (format #t "~1Thistory-mask: ~D~%" (-> obj history-mask)) - (format #t "~1Thistory-mask-full: ~D~%" (-> obj history-mask-full)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Tlast-local-index: ~D~%" (-> this last-local-index)) + (format #t "~1Tspeech-indexes: ~A~%" (-> this speech-indexes)) + (format #t "~1Thistory-mask: ~D~%" (-> this history-mask)) + (format #t "~1Thistory-mask-full: ~D~%" (-> this history-mask-full)) (label cfg-4) - obj + this ) ;; definition for method 10 of type bot-speech-list-shuffle ;; WARN: Return type mismatch int vs none. -(defmethod reset-index bot-speech-list-shuffle ((obj bot-speech-list-shuffle) (arg0 symbol)) +(defmethod reset-index bot-speech-list-shuffle ((this bot-speech-list-shuffle) (arg0 symbol)) (let ((t9-0 (method-of-type bot-speech-list reset-index))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (set! (-> obj history-mask) (the-as uint 0)) - (when (zero? (-> obj history-mask-full)) + (set! (-> this history-mask) (the-as uint 0)) + (when (zero? (-> this history-mask-full)) (let ((v0-2 0)) (let ((v1-2 1)) - (countdown (a0-3 (-> obj speech-indexes length)) + (countdown (a0-3 (-> this speech-indexes length)) (set! v0-2 (logior v0-2 v1-2)) (set! v1-2 (* v1-2 2)) ) ) - (set! (-> obj history-mask-full) (the-as uint v0-2)) + (set! (-> this history-mask-full) (the-as uint v0-2)) ) ) (none) @@ -834,50 +834,50 @@ ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: new jak 2 until loop case, check carefully -(defmethod bot-speech-list-method-9 bot-speech-list-shuffle ((obj bot-speech-list-shuffle) (bot bot) (sp-info (inline-array bot-speech-info)) (sp-flags speech-flags)) +(defmethod bot-speech-list-method-9 bot-speech-list-shuffle ((this bot-speech-list-shuffle) (bot bot) (sp-info (inline-array bot-speech-info)) (sp-flags speech-flags)) (local-vars (sv-16 int)) (let ((course-cookie (-> bot course retry-cookie))) - (when (!= course-cookie (-> obj retry-cookie)) - (set! (-> obj retry-cookie) (-> bot course retry-cookie)) - (reset-index obj #t) + (when (!= course-cookie (-> this retry-cookie)) + (set! (-> this retry-cookie) (-> bot course retry-cookie)) + (reset-index this #t) ) ) - (set! sv-16 (-> obj last-local-index)) + (set! sv-16 (-> this last-local-index)) (when (< sv-16 0) - (when (not (logtest? (-> obj flags) 1)) - (logior! (-> obj flags) 1) + (when (not (logtest? (-> this flags) 1)) + (logior! (-> this flags) 1) (set! sp-flags (logior sp-flags (speech-flags sf02))) ) - (reset-index obj #f) + (reset-index this #f) ) (let ((history-mask 0)) (if (>= sv-16 0) (set! history-mask (ash 1 sv-16)) ) - (if (logtest? (-> obj flags) 8) - (set! history-mask (logior history-mask (-> obj history-mask))) + (if (logtest? (-> this flags) 8) + (set! history-mask (logior history-mask (-> this history-mask))) ) (until #f - (when (and (= history-mask (-> obj history-mask-full)) (logtest? (-> obj flags) 8)) - (if (not (logtest? (-> obj flags) 2)) + (when (and (= history-mask (-> this history-mask-full)) (logtest? (-> this flags) 8)) + (if (not (logtest? (-> this flags) 2)) (return -1) ) - (reset-index obj #f) + (reset-index this #f) (if (>= sv-16 0) (set! history-mask (ash 1 sv-16)) (set! history-mask 0) ) ) - (let* ((last-idx (enemy-method-120 bot (-> obj speech-indexes length) history-mask)) - (speech-idx (-> obj speech-indexes last-idx)) + (let* ((last-idx (enemy-method-120 bot (-> this speech-indexes length) history-mask)) + (speech-idx (-> this speech-indexes last-idx)) (v1-47 (-> sp-info speech-idx flags)) ) (set! history-mask (logior history-mask (ash 1 last-idx))) (when (and (not (logtest? sp-flags v1-47)) (or (not (logtest? v1-47 (speech-flags sf11))) (not (speech-playing? bot speech-idx))) ) - (set! (-> obj last-local-index) last-idx) - (logior! (-> obj history-mask) (ash 1 last-idx)) + (set! (-> this last-local-index) last-idx) + (logior! (-> this history-mask) (ash 1 last-idx)) (return speech-idx) ) ) @@ -897,15 +897,15 @@ ) ;; definition for method 3 of type bot-course-table -(defmethod inspect bot-course-table ((obj bot-course-table)) - (when (not obj) - (set! obj obj) +(defmethod inspect bot-course-table ((this bot-course-table)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcourse[18] @ #x~X~%" (-> obj course)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse[18] @ #x~X~%" (-> this course)) (label cfg-4) - obj + this ) ;; definition for symbol *bot-course-table*, type bot-course-table diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc index 80a6b3c58c..8b01e2318b 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot-states_REF.gc @@ -78,7 +78,7 @@ (bot-method-191 self) (when (zero? (-> self hit-points)) (set! (-> self hit-points) 1) - (set! (-> self fated-time) (current-time)) + (set-time! (-> self fated-time)) ) (logclear! (-> self bot-flags) (bot-flags bf11)) (let ((t9-2 (-> (method-of-type nav-enemy knocked) enter))) @@ -194,7 +194,7 @@ :trans (behavior () ((-> (method-of-type bot die-falling) trans)) (if (channel-active? self (the-as uint 0)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) :code (behavior () @@ -206,7 +206,7 @@ (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) (until (ja-done? 0) (when (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) (reset? *fail-mission-control*) ) (cleanup-for-death self) diff --git a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc index 38a61e3e26..f6dc0427b7 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/bot_REF.gc @@ -2,21 +2,21 @@ (in-package goal) ;; definition for method 12 of type bot -(defmethod run-logic? bot ((obj bot)) +(defmethod run-logic? bot ((this bot)) #t ) ;; definition for method 185 of type bot ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-sphere bot ((obj bot) (arg0 vector) (arg1 rgba)) +(defmethod bot-debug-draw-sphere bot ((this bot) (arg0 vector) (arg1 rgba)) (add-debug-sphere #t (bucket-id debug2) (the-as vector (&-> arg0 x)) (-> arg0 w) arg1) (none) ) ;; definition for method 186 of type bot ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-spot-sphere bot ((obj bot) (arg0 int) (arg1 (pointer uint)) (arg2 int)) - (let* ((s2-0 (-> obj spot-color)) +(defmethod bot-debug-draw-spot-sphere bot ((this bot) (arg0 int) (arg1 (pointer uint)) (arg2 int)) + (let* ((s2-0 (-> this spot-color)) (s1-0 s2-0) ) (if (>= arg2 0) @@ -27,12 +27,12 @@ ) (dotimes (s0-0 arg0) (let* ((v1-5 (-> (the-as (pointer uint8) (&+ arg1 s0-0)))) - (a1-2 (-> obj course spots v1-5)) + (a1-2 (-> this course spots v1-5)) ) - (bot-debug-draw-sphere obj (the-as vector a1-2) (if (= v1-5 arg2) - (the-as rgba s2-0) - (the-as rgba s1-0) - ) + (bot-debug-draw-sphere this (the-as vector a1-2) (if (= v1-5 arg2) + (the-as rgba s2-0) + (the-as rgba s1-0) + ) ) ) ) @@ -42,11 +42,11 @@ ;; definition for method 184 of type bot ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-debug-draw-spot-id bot ((obj bot)) - (let ((course (-> obj course))) +(defmethod bot-debug-draw-spot-id bot ((this bot)) + (let ((course (-> this course))) (countdown (i (-> course spot-count)) (let ((spot (-> course spots i))) - (bot-debug-draw-sphere obj (the-as vector spot) (the-as rgba (-> obj spot-color))) + (bot-debug-draw-sphere this (the-as vector spot) (the-as rgba (-> this spot-color))) (format (clear *temp-string*) "~d" i) (let ((spot-id *temp-string*)) (add-debug-text-3d @@ -65,13 +65,13 @@ ) ;; definition for method 194 of type bot -(defmethod outside-spot-radius? bot ((obj bot) (spot bot-spot) (bot-trans vector) (arg3 symbol)) +(defmethod outside-spot-radius? bot ((this bot) (spot bot-spot) (bot-trans vector) (arg3 symbol)) "Are we outside of the given [[bot-spot]] radius?" (if (not spot) - (set! spot (-> obj spot)) + (set! spot (-> this spot)) ) (if (not bot-trans) - (set! bot-trans (-> obj root trans)) + (set! bot-trans (-> this root trans)) ) (let ((f0-0 (vector-vector-xz-distance (-> spot center) bot-trans))) (if arg3 @@ -82,22 +82,22 @@ ) ;; definition for method 219 of type bot -(defmethod player-blocking-spot? bot ((obj bot) (spot bot-spot)) +(defmethod player-blocking-spot? bot ((this bot) (spot bot-spot)) (let ((f0-0 (-> spot blocked-xz-dist))) (and (!= f0-0 0.0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> spot center)))) ) ) ;; definition for method 202 of type bot -(defmethod choose-spot bot ((obj bot) (num-spots int) (spot-indices (pointer uint))) +(defmethod choose-spot bot ((this bot) (num-spots int) (spot-indices (pointer uint))) "Choose the closest [[bot-spot]] that is not blocked by the player." (let ((spot-idx 0)) (let ((f30-0 -1.0) - (bot-trans (-> obj root trans)) + (bot-trans (-> this root trans)) ) (countdown (i num-spots) - (let ((spot (-> obj course spots (-> (the-as (pointer uint8) (&+ spot-indices i)))))) - (when (not (player-blocking-spot? obj spot)) + (let ((spot (-> this course spots (-> (the-as (pointer uint8) (&+ spot-indices i)))))) + (when (not (player-blocking-spot? this spot)) (let ((spot-dist (vector-vector-xz-distance bot-trans (-> spot center)))) (when (or (< f30-0 0.0) (< spot-dist f30-0)) (set! f30-0 spot-dist) @@ -113,43 +113,43 @@ ) ;; definition for method 108 of type bot -(defmethod enemy-method-108 bot ((obj bot) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 bot ((this bot) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; definition for method 187 of type bot ;; WARN: Return type mismatch symbol vs none. -(defmethod reset-attacker! bot ((obj bot)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) - (let* ((s5-0 (handle->process (-> obj attacker-handle))) +(defmethod reset-attacker! bot ((this bot)) + (logclear! (-> this bot-flags) (bot-flags attacked)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-5 (if (type? s5-0 process-focusable) s5-0 ) ) ) (if (and v1-5 (= (-> v1-5 type) target)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (none) ) ;; definition for method 193 of type bot -(defmethod bot-method-193 bot ((obj bot)) +(defmethod bot-method-193 bot ((this bot)) (let ((gp-0 #f)) - (let ((v1-0 (-> obj incoming penetrate-using))) + (let ((v1-0 (-> this incoming penetrate-using))) (cond ((logtest? #x800000 v1-0) (when *target* (let ((s5-0 (new 'stack-no-clear 'vector)) (s3-0 (-> *target* gun fire-dir-out)) ) - (vector-! s5-0 (-> obj root trans) (target-pos 0)) + (vector-! s5-0 (-> this root trans) (target-pos 0)) (set! (-> s5-0 y) 0.0) (vector-normalize! s5-0 1.0) (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) - (if (or (< 28672.0 (vector-vector-xz-distance (-> obj root trans) (target-pos 0))) + (if (or (< 28672.0 (vector-vector-xz-distance (-> this root trans) (target-pos 0))) (< (vector-dot s3-0 s5-0) (cos 3640.889)) ) (set! gp-0 #t) @@ -168,19 +168,19 @@ ;; definition for method 190 of type bot ;; INFO: Used lq/sq -(defmethod bot-method-190 bot ((obj bot)) +(defmethod bot-method-190 bot ((this bot)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) (cond - ((< 0.0 (-> obj notice-enemy-dist)) + ((< 0.0 (-> this notice-enemy-dist)) (let ((s5-0 (new 'stack-no-clear 'connection-pers)) (s4-0 544) ) - (set! (-> (the-as sphere (-> s5-0 param)) quad) (-> obj root trans quad)) - (set! (-> s5-0 param 3) (-> obj notice-enemy-dist)) + (set! (-> (the-as sphere (-> s5-0 param)) quad) (-> this root trans quad)) + (set! (-> s5-0 param 3) (-> this notice-enemy-dist)) (set! (-> s5-0 next) #f) (set! (-> s5-0 key) 409600000.0) (set! (-> s5-0 update-time) 0) @@ -282,7 +282,7 @@ ) ) (when a1-26 - (set-next-focus! obj (the-as enemy a1-26) (the-as enemy-best-focus (&-> s5-0 next))) + (set-next-focus! this (the-as enemy a1-26) (the-as enemy-best-focus (&-> s5-0 next))) (if (-> s5-0 next) (return #t) ) @@ -303,12 +303,12 @@ ;; definition for method 106 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-106 bot ((obj bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 bot ((this bot) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) - (t9-0 obj arg0 arg1 arg2 arg3) + (t9-0 this arg0 arg1 arg2 arg3) ) - (logclear! (-> obj bot-flags) (bot-flags bf03 bf04)) - (let* ((s3-0 (handle->process (-> obj incoming attacker-handle))) + (logclear! (-> this bot-flags) (bot-flags bf03 bf04)) + (let* ((s3-0 (handle->process (-> this incoming attacker-handle))) (s5-0 (if (type? s3-0 process-focusable) s3-0 ) @@ -317,22 +317,22 @@ (when s5-0 (cond ((= (-> s5-0 type) target) - (logior! (-> obj bot-flags) (bot-flags bf04)) + (logior! (-> this bot-flags) (bot-flags bf04)) (cond - ((bot-method-193 obj) - (logior! (-> obj bot-flags) (bot-flags bf03)) + ((bot-method-193 this) + (logior! (-> this bot-flags) (bot-flags bf03)) ) (else - (+! (-> obj hit-by-player-count) 1) - (when (not (bot-method-190 obj)) - (logior! (-> obj bot-flags) (bot-flags attacked)) + (+! (-> this hit-by-player-count) 1) + (when (not (bot-method-190 this)) + (logior! (-> this bot-flags) (bot-flags attacked)) (cond - ((attacked-by-player? obj (the-as process-focusable s5-0)) - (set! (-> obj attacker-handle) (process->handle s5-0)) - (set! (-> obj attacker-time) (current-time)) + ((attacked-by-player? this (the-as process-focusable s5-0)) + (set! (-> this attacker-handle) (process->handle s5-0)) + (set-time! (-> this attacker-time)) ) (else - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) ) @@ -340,13 +340,13 @@ ) ) ((type? s5-0 enemy) - (+! (-> obj hit-by-enemy-count) 1) - (when (attacked-by-player? obj (the-as process-focusable s5-0)) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (+! (-> this hit-by-enemy-count) 1) + (when (attacked-by-player? this (the-as process-focusable s5-0)) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) - (set! (-> obj attacker-handle) (process->handle s5-0)) - (set! (-> obj attacker-time) (current-time)) + (set! (-> this attacker-handle) (process->handle s5-0)) + (set-time! (-> this attacker-time)) ) ) ) @@ -356,21 +356,23 @@ ) ;; definition for method 56 of type bot -(defmethod damage-amount-from-attack bot ((obj bot) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack bot ((this bot) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (let ((v1-1 (-> obj bot-flags))) + (let ((v1-1 (-> this bot-flags))) (cond ((logtest? v1-1 (bot-flags bf03 too-far-fail bf09)) (set! v0-0 0) ) ((logtest? v1-1 (bot-flags bf10)) - (set! v0-0 (-> obj hit-points)) + (set! v0-0 (-> this hit-points)) ) (else - (if (and (logtest? (-> obj bot-flags) (bot-flags bf04)) (not (logtest? (-> obj bot-flags) (bot-flags attacked)))) + (if (and (logtest? (-> this bot-flags) (bot-flags bf04)) + (not (logtest? (-> this bot-flags) (bot-flags attacked))) + ) (set! v0-0 0) ) ) @@ -381,11 +383,11 @@ ) ;; definition for method 58 of type bot -(defmethod enemy-method-58 bot ((obj bot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 bot ((this bot) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (if (logtest? (-> obj bot-flags) (bot-flags bf03)) + (if (logtest? (-> this bot-flags) (bot-flags bf03)) (set! v0-0 #f) ) v0-0 @@ -393,23 +395,23 @@ ) ;; definition for method 180 of type bot -(defmethod clear-poi-and-focus! bot ((obj bot)) +(defmethod clear-poi-and-focus! bot ((this bot)) "Clear our point of interest and focus handles." - (let* ((s4-0 (handle->process (-> obj poi-handle))) + (let* ((s4-0 (handle->process (-> this poi-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) ) (when s5-0 - (set! (-> obj poi-handle) (the-as handle #f)) - (let ((s4-1 (handle->process (-> obj focus handle)))) + (set! (-> this poi-handle) (the-as handle #f)) + (let ((s4-1 (handle->process (-> this focus handle)))) (if (= (if (type? s4-1 process-focusable) s4-1 ) s5-0 ) - (clear-focused (-> obj focus)) + (clear-focused (-> this focus)) ) ) ) @@ -419,13 +421,13 @@ ;; definition for method 195 of type bot ;; WARN: Return type mismatch object vs symbol. -(defmethod attacked-by-player? bot ((obj bot) (fproc process-focusable)) +(defmethod attacked-by-player? bot ((this bot) (fproc process-focusable)) "Were we attacked by the player?" (the-as symbol (and (and fproc (not (logtest? (-> fproc focus-status) (focus-status disable dead ignore grabbed)))) (or (logtest? (process-mask enemy) (-> fproc mask)) - (and (logtest? (-> fproc mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked))) + (and (logtest? (-> fproc mask) (process-mask target)) (logtest? (-> this bot-flags) (bot-flags attacked))) ) ) ) @@ -433,7 +435,7 @@ ;; definition for method 57 of type bot ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! bot ((obj bot) (arg0 process-focusable) (arg1 enemy-best-focus)) +(defmethod update-target-awareness! bot ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! @TODO - flesh out docs @returns the value that sets `aware`" @@ -441,36 +443,36 @@ ) ;; definition for method 61 of type bot -(defmethod enemy-method-61 bot ((obj bot) (arg0 int)) +(defmethod enemy-method-61 bot ((this bot) (arg0 int)) 3 ) ;; definition for method 129 of type bot ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-129 bot ((obj bot)) +(defmethod enemy-method-129 bot ((this bot)) (local-vars (s5-1 process)) - (let ((s5-0 (-> obj focus))) + (let ((s5-0 (-> this focus))) (cond - ((logtest? (enemy-flag actor-pause-backup) (-> obj enemy-flags)) + ((logtest? (enemy-flag actor-pause-backup) (-> this enemy-flags)) (set! s5-1 (handle->process (-> s5-0 handle))) ) (else - (enemy-method-97 obj) + (enemy-method-97 this) (set! s5-1 (handle->process (-> s5-0 handle))) ) ) ) (let ((s4-0 #f)) - (when (or (logtest? (bot-flags bf18) (-> obj bot-flags)) - (and s5-1 (attacked-by-player? obj (the-as process-focusable s5-1))) + (when (or (logtest? (bot-flags bf18) (-> this bot-flags)) + (and s5-1 (attacked-by-player? this (the-as process-focusable s5-1))) ) - (set! (-> obj danger-time) (current-time)) + (set-time! (-> this danger-time)) (set! s4-0 #t) ) - (when (nonzero? (-> obj swivel-joint-mod)) - (if (and s4-0 s5-1 (logtest? (-> obj bot-flags) (bot-flags bf11))) - (bot-method-222 obj (get-trans (the-as process-focusable s5-1) 3)) - (bot-method-221 obj) + (when (nonzero? (-> this swivel-joint-mod)) + (if (and s4-0 s5-1 (logtest? (-> this bot-flags) (bot-flags bf11))) + (bot-method-222 this (get-trans (the-as process-focusable s5-1) 3)) + (bot-method-221 this) ) ) ) @@ -478,8 +480,8 @@ ) ;; definition for method 97 of type bot -(defmethod enemy-method-97 bot ((obj bot)) - (let* ((s5-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 bot ((this bot)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) (v1-3 (if (type? s5-0 process-focusable) s5-0 ) @@ -488,25 +490,25 @@ (when v1-3 (cond ((= (-> v1-3 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 1.5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! v1-3 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 6)) + (when (time-elapsed? (-> this attacker-time) (seconds 6)) (set! v1-3 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) - (let ((a0-21 (-> obj focus-mode)) + (let ((a0-21 (-> this focus-mode)) (s5-1 (the-as process #f)) ) (cond @@ -515,11 +517,11 @@ (v1-3 (set! s5-1 v1-3) ) - ((begin (set! s5-1 (select-focus! obj)) s5-1) + ((begin (set! s5-1 (select-focus! this)) s5-1) (empty) ) (else - (let ((s4-0 (handle->process (-> obj poi-handle)))) + (let ((s4-0 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-0 process-focusable) s4-0 ) @@ -538,7 +540,7 @@ (set! s5-1 v1-3) ) (else - (let ((s4-1 (handle->process (-> obj poi-handle)))) + (let ((s4-1 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-1 process-focusable) s4-1 ) @@ -548,7 +550,7 @@ (s5-1 (empty) ) - ((begin (set! s5-1 (select-focus! obj)) s5-1) + ((begin (set! s5-1 (select-focus! this)) s5-1) (empty) ) (else @@ -561,14 +563,16 @@ ) (cond (s5-1 - (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> (the-as process-focusable s5-1) type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) + (!= (-> (the-as process-focusable s5-1) type) target) + ) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s5-1 @@ -578,7 +582,7 @@ ;; definition for method 189 of type bot ;; INFO: Used lq/sq -(defmethod select-focus! bot ((obj bot)) +(defmethod select-focus! bot ((this bot)) "Find enemies around our `notice-enemy-dist` and choose a target." (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) @@ -589,14 +593,14 @@ (focus (new 'stack-no-clear 'enemy-best-focus)) ) (let ((sphere (new 'stack-no-clear 'sphere)) - (enemy-dist (-> obj notice-enemy-dist)) + (enemy-dist (-> this notice-enemy-dist)) ) (set! (-> focus proc) #f) (set! (-> focus rating) 409600000.0) (set! (-> focus aware) (enemy-aware enemy-aware-0)) (when (< 0.0 enemy-dist) - (set! (-> sphere quad) (-> obj root trans quad)) - (set! (-> sphere r) (-> obj notice-enemy-dist)) + (set! (-> sphere quad) (-> this root trans quad)) + (set! (-> sphere r) (-> this notice-enemy-dist)) (set! *actor-list-length* 0) (if (logtest? (the-as int coll-spec) (collide-spec hit-by-others-list)) (set! *actor-list-length* (fill-actor-list-for-sphere *actor-hash* sphere *actor-list* 256)) @@ -696,7 +700,7 @@ enemy (not (logtest? (-> (the-as process-focusable enemy) focus-status) (focus-status disable dead))) ) - (set-next-focus! obj (the-as enemy enemy) focus) + (set-next-focus! this (the-as enemy enemy) focus) ) ) ) @@ -711,11 +715,14 @@ ;; definition for method 201 of type bot ;; WARN: Return type mismatch enemy vs none. -(defmethod set-next-focus! bot ((obj bot) (enemy enemy) (arg2 enemy-best-focus)) +(defmethod set-next-focus! bot ((this bot) (enemy enemy) (arg2 enemy-best-focus)) (let ((enemy-dist (new 'stack-no-clear 'vector))) - (vector-! enemy-dist (-> enemy root trans) (-> obj root trans)) + (vector-! enemy-dist (-> enemy root trans) (-> this root trans)) (let ((rating (vector-length enemy-dist))) - (when (and (>= (-> obj notice-enemy-dist) rating) (< rating (-> arg2 rating)) (>= 24576.0 (fabs (-> enemy-dist y)))) + (when (and (>= (-> this notice-enemy-dist) rating) + (< rating (-> arg2 rating)) + (>= 24576.0 (fabs (-> enemy-dist y))) + ) (set! (-> arg2 rating) rating) (set! (-> arg2 proc) enemy) ) @@ -725,14 +732,14 @@ ) ;; definition for method 183 of type bot -(defmethod alive? bot ((obj bot)) - (and (not (focus-test? obj dead grabbed)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) +(defmethod alive? bot ((this bot)) + (and (not (focus-test? this dead grabbed)) (nonzero? (-> this hit-points)) (zero? (-> this fated-time))) ) ;; definition for method 74 of type bot ;; INFO: Used lq/sq ;; WARN: disable def twice: 280. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler bot ((obj bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler bot ((this bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v0-0 object)) @@ -746,43 +753,43 @@ (('query) (case (-> arg3 param 0) (('waypoint) - (-> obj waypoint waypoint-id) + (-> this waypoint waypoint-id) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('request) (case (-> arg3 param 0) (('waypoint) - (set! (-> obj waypoint-request) (the-as int (-> arg3 param 1))) + (set! (-> this waypoint-request) (the-as int (-> arg3 param 1))) #t ) (('health-meter) (cond ((-> arg3 param 1) - (set! v0-0 (logior (-> obj bot-flags) (bot-flags bf06))) - (set! (-> obj bot-flags) (the-as bot-flags v0-0)) + (set! v0-0 (logior (-> this bot-flags) (bot-flags bf06))) + (set! (-> this bot-flags) (the-as bot-flags v0-0)) ) (else - (set! v0-0 (logclear (-> obj bot-flags) (bot-flags bf06))) - (set! (-> obj bot-flags) (the-as bot-flags v0-0)) + (set! v0-0 (logclear (-> this bot-flags) (bot-flags bf06))) + (set! (-> this bot-flags) (the-as bot-flags v0-0)) ) ) v0-0 ) (('too-far-fail) - (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail bf09))) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (go (method-of-object obj failed)) + (when (not (logtest? (-> this bot-flags) (bot-flags too-far-fail bf09))) + (logior! (-> this bot-flags) (bot-flags bf09)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag check-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (go (method-of-object this failed)) ) ) (('move-to-vehicle) @@ -791,25 +798,25 @@ ((>= (the-as int a0-19) 0) (let ((v1-29 (the-as object (-> arg3 param 1)))) (cond - ((focus-test? obj pilot) - (if (= (-> obj vehicle-seat-index) a0-19) - (= (the-as uint v1-29) (handle->process (-> obj vehicle-handle))) + ((focus-test? this pilot) + (if (= (-> this vehicle-seat-index) a0-19) + (= (the-as uint v1-29) (handle->process (-> this vehicle-handle))) ) ) (else - (set! (-> obj vehicle-seat-index) (the-as int a0-19)) - (set! (-> obj vehicle-handle) (process->handle (the-as uint v1-29))) - (logior! (-> obj bot-flags) (bot-flags bf15)) + (set! (-> this vehicle-seat-index) (the-as int a0-19)) + (set! (-> this vehicle-handle) (process->handle (the-as uint v1-29))) + (logior! (-> this bot-flags) (bot-flags bf15)) #t ) ) ) ) (else - (when (not (focus-test? obj pilot)) - (set! (-> obj vehicle-seat-index) -1) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (logclear! (-> obj bot-flags) (bot-flags bf15)) + (when (not (focus-test? this pilot)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this vehicle-handle) (the-as handle #f)) + (logclear! (-> this bot-flags) (bot-flags bf15)) #t ) ) @@ -817,20 +824,20 @@ ) ) (('exit-vehicle) - (when (focus-test? obj pilot) + (when (focus-test? this pilot) (let ((v1-43 (-> arg3 param 1)) (s5-1 (-> arg3 param 2)) ) (cond (v1-43 - (logior! (-> obj bot-flags) (bot-flags bf16)) - (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> obj nav-mesh-index))) - (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor (the-as int s5-1)) obj) - (set! (-> obj nav-mesh-index) (the-as int s5-1)) + (logior! (-> this bot-flags) (bot-flags bf16)) + (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> this nav-mesh-index))) + (change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor (the-as int s5-1)) this) + (set! (-> this nav-mesh-index) (the-as int s5-1)) ) ) (else - (logclear! (-> obj bot-flags) (bot-flags bf16)) + (logclear! (-> this bot-flags) (bot-flags bf16)) ) ) ) @@ -838,11 +845,11 @@ ) ) (('slave-id) - (set! (-> obj slave-id) (the-as int (-> arg3 param 1))) + (set! (-> this slave-id) (the-as int (-> arg3 param 1))) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -853,64 +860,64 @@ (when (if (type? s5-2 process-focusable) s5-2 ) - (logior! (-> obj enemy-flags) (enemy-flag look-at-focus)) - (set! (-> obj hit-focus-time) (current-time)) + (logior! (-> this enemy-flags) (enemy-flag look-at-focus)) + (set-time! (-> this hit-focus-time)) ) ) #t ) (('mission-failed) - (logior! (-> obj bot-flags) (bot-flags bf09)) - (logclear! (-> obj bot-flags) (bot-flags bf06)) + (logior! (-> this bot-flags) (bot-flags bf09)) + (logclear! (-> this bot-flags) (bot-flags bf06)) #t ) (('follow-dir) - (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (set! (-> this follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('set-task) (let ((a1-11 (/ (the-as int (-> arg3 param 0)) 8))) - (logior! (-> obj bot-task-bits) (ash 1 a1-11)) + (logior! (-> this bot-task-bits) (ash 1 a1-11)) ) #t ) (('clear-task) (let ((a1-13 (/ (the-as int (-> arg3 param 0)) 8))) - (logclear! (-> obj bot-task-bits) (ash 1 a1-13)) + (logclear! (-> this bot-task-bits) (ash 1 a1-13)) ) #t ) (('skip) - (skip-waypoint obj) + (skip-waypoint this) ) (('change-mode) (when (= (-> arg3 param 0) 'grab) - (set! v0-0 (alive? obj)) + (set! v0-0 (alive? this)) (if (and (the-as symbol v0-0) (-> arg3 param 1)) - (logior! (-> obj focus-status) (focus-status grabbed)) + (logior! (-> this focus-status) (focus-status grabbed)) ) v0-0 ) ) (('end-mode) - (when (focus-test? obj grabbed) - (logclear! (-> obj focus-status) (focus-status grabbed)) + (when (focus-test? this grabbed) + (logclear! (-> this focus-status) (focus-status grabbed)) #t ) ) (('hide) (cond ((-> arg3 param 0) - (go (method-of-object obj hidden)) + (go (method-of-object this hidden)) ) (else - (if (and (-> obj next-state) (= (-> obj next-state name) 'hidden)) - (react-to-focus obj) + (if (and (-> this next-state) (= (-> this next-state name) 'hidden)) + (react-to-focus this) ) ) ) @@ -918,46 +925,46 @@ (('draw) (cond ((-> arg3 param 0) - (set! v0-0 (logclear (-> obj draw status) (draw-control-status no-draw))) - (set! (-> obj draw status) (the-as draw-control-status v0-0)) + (set! v0-0 (logclear (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) ) (else - (set! v0-0 (logior (-> obj draw status) (draw-control-status no-draw))) - (set! (-> obj draw status) (the-as draw-control-status v0-0)) + (set! v0-0 (logior (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) ) ) v0-0 ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 104 of type bot -(defmethod enemy-method-104 bot ((obj bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 bot ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (cond - ((and (= (-> arg0 type) target) (not (logtest? (-> obj bot-flags) (bot-flags attacked)))) + ((and (= (-> arg0 type) target) (not (logtest? (-> this bot-flags) (bot-flags attacked)))) (when (send-event arg0 'shove #f (static-attack-info ((id (new-attack-id)) (shove-back (meters 2)) (shove-up (meters 1.5)))) ) - (set! (-> obj root penetrated-by) (the-as penetrate -1)) - (enemy-method-49 obj) + (set! (-> this root penetrated-by) (the-as penetrate -1)) + (enemy-method-49 this) #t ) ) (else (when (send-event arg0 'attack arg1 (static-attack-info ((id arg2) - (shove-back (-> obj enemy-info attack-shove-back)) - (shove-up (-> obj enemy-info attack-shove-up)) - (mode (-> obj enemy-info attack-mode)) + (shove-back (-> this enemy-info attack-shove-back)) + (shove-up (-> this enemy-info attack-shove-up)) + (mode (-> this enemy-info attack-mode)) ) ) ) - (enemy-method-105 obj arg0) + (enemy-method-105 this arg0) #t ) ) @@ -966,15 +973,15 @@ ;; definition for method 76 of type bot ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 bot ((obj bot) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 bot ((this bot) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond - ((and (-> obj next-state) (let ((v1-3 (-> obj next-state name))) - (or (= v1-3 'knocked) (= v1-3 'jump)) - ) + ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) ) - ((method-of-type nav-enemy enemy-method-76) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-76) this arg0 arg1) ) (else (when (!= (-> arg0 type) target) @@ -986,30 +993,30 @@ ) ) (cond - ((and (focus-test? obj dangerous) + ((and (focus-test? this dangerous) (logtest? (process-mask enemy) (-> arg0 mask)) (and v1-6 (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) ) ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry touch-entry) - (-> obj root) + (-> this root) (collide-action deadly) (collide-action) ) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) (the-as touching-shapes-entry touch-entry) - (-> obj root) + (-> this root) (collide-action persistent-attack) (collide-action) ) - (-> obj persistent-attack-id) - (-> obj attack-id) + (-> this persistent-attack-id) + (-> this attack-id) ) ) ) - (enemy-method-104 obj arg0 (the-as touching-shapes-entry touch-entry) a3-2) + (enemy-method-104 this arg0 (the-as touching-shapes-entry touch-entry) a3-2) ) ) (else @@ -1041,14 +1048,18 @@ ) ;; definition for method 204 of type bot -(defmethod play-too-far-warn-speech bot ((obj bot)) - (when (not (channel-active? obj (the-as uint 0))) - (let ((idx - (bot-speech-list-method-9 (-> obj course too-far-warn-speeches) obj (-> obj course speeches) (speech-flags)) - ) +(defmethod play-too-far-warn-speech bot ((this bot)) + (when (not (channel-active? this (the-as uint 0))) + (let ((idx (bot-speech-list-method-9 + (-> this course too-far-warn-speeches) + this + (-> this course speeches) + (speech-flags) + ) + ) ) (when (>= idx 0) - (play-speech obj idx) + (play-speech this idx) #t ) ) @@ -1064,46 +1075,46 @@ ;; definition for method 224 of type bot ;; WARN: Using new Jak 2 rtype-of -(defmethod bot-check-too-far bot ((obj bot)) +(defmethod bot-check-too-far bot ((this bot)) "Call the current [[bot-waypoint]]'s `check-too-far` function if available, otherwise use the default `course` one. If the player is too far, play a warning speech." (let ((result 0)) - (let ((too-far-check (-> obj delay-too-far-check))) + (let ((too-far-check (-> this delay-too-far-check))) (cond ((> too-far-check 0) - (set! (-> obj delay-too-far-check) (+ too-far-check -1)) + (set! (-> this delay-too-far-check) (+ too-far-check -1)) ) - ((and (zero? too-far-check) *target* (not (logtest? (-> obj focus-status) (focus-status grabbed)))) - (let ((check-too-far-func (the-as object (-> obj waypoint check-too-far)))) + ((and (zero? too-far-check) *target* (not (logtest? (-> this focus-status) (focus-status grabbed)))) + (let ((check-too-far-func (the-as object (-> this waypoint check-too-far)))) (if (not (the-as symbol check-too-far-func)) - (set! check-too-far-func (-> obj course default-check-too-far)) + (set! check-too-far-func (-> this course default-check-too-far)) ) (when (the-as symbol check-too-far-func) (cond ((logtest? (the-as int check-too-far-func) 1) - (set! result ((the-as (function bot int) (-> (the-as symbol check-too-far-func) value)) obj)) + (set! result ((the-as (function bot int) (-> (the-as symbol check-too-far-func) value)) this)) ) ((= (rtype-of (the-as symbol check-too-far-func)) function) - (set! result ((the-as (function bot int) check-too-far-func) obj)) + (set! result ((the-as (function bot int) check-too-far-func) this)) ) ) ) ) (if (and (= result 1) - (nonzero? (-> obj started-warning-time)) - (>= (- (current-time) (-> obj started-warning-time)) (the-as time-frame (-> obj warn-to-fail-timeout))) + (nonzero? (-> this started-warning-time)) + (time-elapsed? (-> this started-warning-time) (the-as time-frame (-> this warn-to-fail-timeout))) ) (set! result 2) ) (case result ((1) - (if (zero? (-> obj started-warning-time)) - (set! (-> obj started-warning-time) (current-time)) + (if (zero? (-> this started-warning-time)) + (set-time! (-> this started-warning-time)) ) - (if (and (>= (current-time) (-> obj next-too-far-warn-time)) (play-too-far-warn-speech obj)) - (set! (-> obj next-too-far-warn-time) + (if (and (>= (current-time) (-> this next-too-far-warn-time)) (play-too-far-warn-speech this)) + (set! (-> this next-too-far-warn-time) (+ (current-time) - (get-rand-int-range obj (the-as int (-> obj warn-min-delay)) (the-as int (-> obj warn-max-delay))) + (get-rand-int-range this (the-as int (-> this warn-min-delay)) (the-as int (-> this warn-max-delay))) ) ) ) @@ -1113,7 +1124,7 @@ If the player is too far, play a warning speech." ) ) (when (zero? result) - (set! (-> obj started-warning-time) 0) + (set! (-> this started-warning-time) 0) 0 ) (= result 2) @@ -1122,84 +1133,84 @@ If the player is too far, play a warning speech." ;; definition for method 212 of type bot ;; WARN: Return type mismatch time-frame vs none. -(defmethod reset-warn-time! bot ((obj bot)) - (set! (-> obj started-warning-time) 0) - (set! (-> obj next-too-far-warn-time) +(defmethod reset-warn-time! bot ((this bot)) + (set! (-> this started-warning-time) 0) + (set! (-> this next-too-far-warn-time) (+ (current-time) - (get-rand-int-range obj (the-as int (-> obj warn-min-delay)) (the-as int (-> obj warn-max-delay))) + (get-rand-int-range this (the-as int (-> this warn-min-delay)) (the-as int (-> this warn-max-delay))) ) ) (none) ) ;; definition for method 55 of type bot -(defmethod track-target! bot ((obj bot)) +(defmethod track-target! bot ((this bot)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (set! (-> obj travel-prev-ry) (-> obj travel-prev-ry1)) - (set! (-> obj travel-prev-ry1) (quaternion-y-angle (-> obj root quat))) - (let ((f0-4 (/ (the float (-> obj hit-points)) (the float (-> obj enemy-info default-hit-points))))) - (if (nonzero? (-> obj fated-time)) + (set! (-> this travel-prev-ry) (-> this travel-prev-ry1)) + (set! (-> this travel-prev-ry1) (quaternion-y-angle (-> this root quat))) + (let ((f0-4 (/ (the float (-> this hit-points)) (the float (-> this enemy-info default-hit-points))))) + (if (nonzero? (-> this fated-time)) (set! f0-4 0.0) ) - (set! (-> *game-info* bot-health (-> obj bot-health-index)) f0-4) + (set! (-> *game-info* bot-health (-> this bot-health-index)) f0-4) ) (cond - ((logtest? (-> obj bot-flags) (bot-flags bf06)) - (if (and (not (handle->process (-> obj health-handle))) *target*) - (bot-method-216 obj) + ((logtest? (-> this bot-flags) (bot-flags bf06)) + (if (and (not (handle->process (-> this health-handle))) *target*) + (bot-method-216 this) ) ) (else - (send-event (handle->process (-> obj health-handle)) 'hide-and-die) + (send-event (handle->process (-> this health-handle)) 'hide-and-die) ) ) - (let ((a0-13 obj)) + (let ((a0-13 this)) (when (not (logtest? (enemy-flag enemy-flag36) (-> a0-13 enemy-flags))) (let ((a1-4 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-4 options) (overlaps-others-options)) (set! (-> a1-4 collide-with-filter) (the-as collide-spec -1)) (set! (-> a1-4 tlist) *touching-list*) - (find-overlapping-shapes (-> obj root) a1-4) + (find-overlapping-shapes (-> this root) a1-4) ) ) ) (let ((t9-4 (method-of-type nav-enemy track-target!))) - (t9-4 obj) + (t9-4 this) ) - (when (not (logtest? (-> obj bot-flags) (bot-flags bf09))) - (let ((t9-5 (-> obj waypoint on-update))) + (when (not (logtest? (-> this bot-flags) (bot-flags bf09))) + (let ((t9-5 (-> this waypoint on-update))) (if t9-5 - (t9-5 obj) + (t9-5 this) ) ) ) - (if (and (bot-check-too-far obj) (not (logtest? (-> obj bot-flags) (bot-flags bf09)))) - (go (method-of-object obj failed)) + (if (and (bot-check-too-far this) (not (logtest? (-> this bot-flags) (bot-flags bf09)))) + (go (method-of-object this failed)) ) - (if (not (logtest? (-> obj bot-flags) (bot-flags bf09))) - (ai-task-control-method-10 (-> obj ai-ctrl) obj) + (if (not (logtest? (-> this bot-flags) (bot-flags bf09))) + (ai-task-control-method-10 (-> this ai-ctrl) this) ) - (if (logtest? (-> obj bot-flags) (bot-flags bf02)) - (bot-method-192 obj) + (if (logtest? (-> this bot-flags) (bot-flags bf02)) + (bot-method-192 this) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc08)) - (bot-debug-draw-spot-id obj) + (bot-debug-draw-spot-id this) ) (none) ) ;; definition for method 205 of type bot -(defmethod scene-play bot ((obj bot) (scene string) (grab? symbol)) +(defmethod scene-play bot ((this bot) (scene string) (grab? symbol)) "Spawn a [[scene-player]] process for the given scene." - (when (and (process-grab? obj #t) (or grab? (process-grab? *target* #t))) - (process-grab? obj #f) + (when (and (process-grab? this #t) (or grab? (process-grab? *target* #t))) + (process-grab? this #f) (if (not grab?) (process-grab? *target* #f) ) - (set! (-> obj scene-player-handle) + (set! (-> this scene-player-handle) (ppointer->handle (process-spawn scene-player :init scene-player-init scene #t #f)) ) #t @@ -1207,19 +1218,19 @@ If the player is too far, play a warning speech." ) ;; definition for method 188 of type bot -(defmethod scene-release? bot ((obj bot)) - (when (not (handle->process (-> obj scene-player-handle))) - (process-release? obj) +(defmethod scene-release? bot ((this bot)) + (when (not (handle->process (-> this scene-player-handle))) + (process-release? this) #t ) ) ;; definition for method 211 of type bot ;; WARN: Return type mismatch symbol vs none. -(defmethod clear-speech-flags! bot ((obj bot)) +(defmethod clear-speech-flags! bot ((this bot)) "Clear the `playing` flag for all of our speeches." - (let ((speeches (-> obj course speeches))) - (countdown (i (-> obj course speech-count)) + (let ((speeches (-> this course speeches))) + (countdown (i (-> this course speech-count)) (let ((speech (-> speeches i))) (logclear! (-> speech flags) (speech-flags playing)) ) @@ -1230,8 +1241,8 @@ If the player is too far, play a warning speech." ;; definition for method 206 of type bot ;; WARN: Return type mismatch gui-connection vs none. -(defmethod play-speech bot ((obj bot) (idx int)) - (let* ((course (-> obj course)) +(defmethod play-speech bot ((this bot) (idx int)) + (let* ((course (-> this course)) (speech (-> course speeches idx)) ) (logior! (-> speech flags) (speech-flags playing)) @@ -1239,8 +1250,8 @@ If the player is too far, play a warning speech." (proc (add-process *gui-control* - obj - (the-as gui-channel (-> obj channel)) + this + (the-as gui-channel (-> this channel)) (gui-action play) (-> speech name) -99.0 @@ -1264,12 +1275,12 @@ If the player is too far, play a warning speech." ;; definition for method 207 of type bot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-death-sound bot ((obj bot) (sound string)) +(defmethod play-death-sound bot ((this bot) (sound string)) "Play one of our death sounds." (add-process *gui-control* - obj - (the-as gui-channel (-> obj channel)) + this + (the-as gui-channel (-> this channel)) (gui-action play) sound -99.0 @@ -1279,9 +1290,9 @@ If the player is too far, play a warning speech." ) ;; definition for method 217 of type bot -(defmethod speech-ended? bot ((obj bot) (idx int)) +(defmethod speech-ended? bot ((this bot) (idx int)) "Is the given speech active?" - (let ((speech (-> obj course speeches idx))) + (let ((speech (-> this course speeches idx))) (= (get-status *gui-control* (lookup-gui-connection-id *gui-control* (-> speech name) (gui-channel none) (gui-action none)) @@ -1292,18 +1303,18 @@ If the player is too far, play a warning speech." ) ;; definition for method 218 of type bot -(defmethod speech-playing? bot ((obj bot) (idx int)) +(defmethod speech-playing? bot ((this bot) (idx int)) "Is the given speech playing?" - (let ((v1-2 (-> obj course speeches idx))) + (let ((v1-2 (-> this course speeches idx))) (logtest? (-> v1-2 flags) (speech-flags playing)) ) ) ;; definition for method 209 of type bot -(defmethod channel-active? bot ((obj bot) (channel uint)) +(defmethod channel-active? bot ((this bot) (channel uint)) "Is the given [[gui-channel]] active?" (if (zero? channel) - (set! channel (-> obj channel)) + (set! channel (-> this channel)) ) (nonzero? (get-status *gui-control* @@ -1314,9 +1325,9 @@ If the player is too far, play a warning speech." ;; definition for method 220 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod stop-speech bot ((obj bot) (channel uint) (arg1 symbol)) +(defmethod stop-speech bot ((this bot) (channel uint) (arg1 symbol)) (if (zero? channel) - (set! channel (-> obj channel)) + (set! channel (-> this channel)) ) (if arg1 (set-action! @@ -1358,36 +1369,36 @@ If the player is too far, play a warning speech." ) ;; definition for method 213 of type bot -(defmethod go-to-waypoint! bot ((obj bot) (id int) (skipped? symbol)) +(defmethod go-to-waypoint! bot ((this bot) (id int) (skipped? symbol)) "Start moving to the given [[bot-waypoint]]." - (let* ((course (-> obj course)) + (let* ((course (-> this course)) (waypoint-count (-> course waypoints length)) ) (dotimes (i waypoint-count) (let ((waypoint (-> course waypoints i))) (when (= (-> waypoint waypoint-id) id) - (set! (-> obj waypoint) waypoint) - (set! (-> obj waypoint-bits) (waypoint-bits)) - (set! (-> obj waypoint-time0) (current-time)) - (set! (-> obj too-far-warn-dist) (-> obj too-far-warn-dist-default)) - (set! (-> obj too-far-fail-dist-delta) (-> obj too-far-fail-dist-delta-default)) + (set! (-> this waypoint) waypoint) + (set! (-> this waypoint-bits) (waypoint-bits)) + (set-time! (-> this waypoint-time0)) + (set! (-> this too-far-warn-dist) (-> this too-far-warn-dist-default)) + (set! (-> this too-far-fail-dist-delta) (-> this too-far-fail-dist-delta-default)) (let ((mesh-idx (-> waypoint nav-mesh-index))) - (when (and (>= mesh-idx 0) (!= (-> obj nav-mesh-index) mesh-idx)) - (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor mesh-idx) obj) - (set! (-> obj nav-mesh-index) mesh-idx) + (when (and (>= mesh-idx 0) (!= (-> this nav-mesh-index) mesh-idx)) + (change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor mesh-idx) this) + (set! (-> this nav-mesh-index) mesh-idx) ) ) (when skipped? (let ((on-skip (-> waypoint on-skipping-here))) (when on-skip - (process-entity-status! obj (entity-perm-status no-kill) #t) - (on-skip obj) + (process-entity-status! this (entity-perm-status no-kill) #t) + (on-skip this) ) ) ) (let ((on-set (-> waypoint on-set))) (if on-set - (on-set obj) + (on-set this) ) ) (return #f) @@ -1400,12 +1411,12 @@ If the player is too far, play a warning speech." ;; definition for method 215 of type bot ;; WARN: Return type mismatch object vs none. -(defmethod skip-waypoint bot ((obj bot)) - (let ((skip-id (-> obj waypoint skip-to))) +(defmethod skip-waypoint bot ((this bot)) + (let ((skip-id (-> this waypoint skip-to))) (when (>= skip-id 0) - (stop-speech obj (the-as uint 0) #f) - (set! (-> obj delay-too-far-check) 10) - (go-to-waypoint! obj skip-id #t) + (stop-speech this (the-as uint 0) #f) + (set! (-> this delay-too-far-check) 10) + (go-to-waypoint! this skip-id #t) ) ) (none) @@ -1413,95 +1424,96 @@ If the player is too far, play a warning speech." ;; definition for method 7 of type bot ;; WARN: Return type mismatch nav-enemy vs bot. -(defmethod relocate bot ((obj bot) (arg0 int)) - (if (nonzero? (-> obj ai-ctrl)) - (&+! (-> obj ai-ctrl) arg0) +(defmethod relocate bot ((this bot) (arg0 int)) + (if (nonzero? (-> this ai-ctrl)) + (&+! (-> this ai-ctrl) arg0) ) - (if (nonzero? (-> obj task)) - (&+! (-> obj task) arg0) + (if (nonzero? (-> this task)) + (&+! (-> this task) arg0) ) - (if (nonzero? (-> obj swivel-joint-mod)) - (&+! (-> obj swivel-joint-mod) arg0) + (if (nonzero? (-> this swivel-joint-mod)) + (&+! (-> this swivel-joint-mod) arg0) ) - (the-as bot ((method-of-type nav-enemy relocate) obj arg0)) + (the-as bot ((method-of-type nav-enemy relocate) this arg0)) ) ;; definition for method 10 of type bot -(defmethod deactivate bot ((obj bot)) - (send-event (handle->process (-> obj health-handle)) 'hide-and-die) - (if (nonzero? (-> obj ai-ctrl)) - (ai-task-control-method-9 (-> obj ai-ctrl)) +(defmethod deactivate bot ((this bot)) + (send-event (handle->process (-> this health-handle)) 'hide-and-die) + (if (nonzero? (-> this ai-ctrl)) + (ai-task-control-method-9 (-> this ai-ctrl)) ) - ((method-of-type nav-enemy deactivate) obj) + ((method-of-type nav-enemy deactivate) this) (none) ) ;; definition for method 210 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod init! bot ((obj bot)) +(defmethod init! bot ((this bot)) "Set defaults for various fields." - (set! (-> obj master-handle) (the-as handle #f)) - (set! (-> obj health-handle) (the-as handle #f)) - (set! (-> obj scene-player-handle) (the-as handle #f)) - (set! (-> obj poi-handle) (the-as handle #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) - (set! (-> obj vehicle-handle) (the-as handle #f)) - (set! (-> obj focus-mode) 0) - (set! (-> obj hit-invuln-ignore-me-delay) (the-as uint 180)) - (set! (-> obj warn-to-fail-timeout) (the-as uint #x34bc)) - (set! (-> obj warn-min-delay) (the-as uint 2400)) - (set! (-> obj warn-max-delay) (the-as uint 4200)) - (set! (-> obj vehicle-seat-index) -1) - (set! (-> obj nav-mesh-index) -1) - (set! (-> obj too-far-warn-dist-default) 184320.0) - (set! (-> obj too-far-fail-dist-delta-default) 122880.0) - (logior! (-> obj bot-flags) (bot-flags bf11)) - (set! (-> obj delay-too-far-check) 10) - (set! (-> obj focus collide-with) (collide-spec jak enemy hit-by-others-list player-list)) - (set! (-> obj spot-color) (the-as uint #x500000ff)) - (set-vector! (-> obj follow-dir) 0.0 0.0 1.0 1.0) + (set! (-> this master-handle) (the-as handle #f)) + (set! (-> this health-handle) (the-as handle #f)) + (set! (-> this scene-player-handle) (the-as handle #f)) + (set! (-> this poi-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set! (-> this focus-mode) 0) + (set! (-> this hit-invuln-ignore-me-delay) (the-as uint 180)) + (set! (-> this warn-to-fail-timeout) (the-as uint #x34bc)) + (set! (-> this warn-min-delay) (the-as uint 2400)) + (set! (-> this warn-max-delay) (the-as uint 4200)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this nav-mesh-index) -1) + (set! (-> this too-far-warn-dist-default) 184320.0) + (set! (-> this too-far-fail-dist-delta-default) 122880.0) + (logior! (-> this bot-flags) (bot-flags bf11)) + (set! (-> this delay-too-far-check) 10) + (set! (-> this focus collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> this spot-color) (the-as uint #x500000ff)) + (set-vector! (-> this follow-dir) 0.0 0.0 1.0 1.0) 0 (none) ) ;; definition for method 115 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! bot ((obj bot)) +(defmethod init-enemy! bot ((this bot)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (process-entity-status! obj (entity-perm-status bit-4) #t) - (set! (-> obj ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) - (logclear! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask bot)) - (logior! (-> obj enemy-flags) (enemy-flag use-notice-distance multi-focus)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logior! (-> obj focus-status) (focus-status disable)) - (let ((v1-13 (-> obj nav))) + (process-entity-status! this (entity-perm-status bit-4) #t) + (set! (-> this ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask bot)) + (logior! (-> this enemy-flags) (enemy-flag use-notice-distance multi-focus)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logior! (-> this focus-status) (focus-status disable)) + (let ((v1-13 (-> this nav))) (set! (-> v1-13 sphere-mask) (the-as uint 78)) ) 0 - (logclear! (-> obj root nav-flags) (nav-flags has-extra-sphere)) - (let ((v1-17 (-> obj nav))) + (logclear! (-> this root nav-flags) (nav-flags has-extra-sphere)) + (let ((v1-17 (-> this nav))) (set! (-> v1-17 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (let ((a2-3 (res-lump-value (-> obj entity) 'task-actor uint128 :time -1000000000.0))) + (set-gravity-length (-> this root dynam) 573440.0) + (let ((a2-3 (res-lump-value (-> this entity) 'task-actor uint128 :time -1000000000.0))) (if (nonzero? a2-3) - (set! (-> obj task) (new 'process 'game-task-control (the-as game-task-actor a2-3))) + (set! (-> this task) (new 'process 'game-task-control (the-as game-task-actor a2-3))) ) ) - (let ((s5-0 (res-lump-value (-> obj entity) 'bot-course uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (let ((s5-0 (res-lump-value (-> this entity) 'bot-course uint128 :default (the-as uint128 -1) :time -1000000000.0)) + ) (if (< (the-as int s5-0) 0) (go process-drawable-art-error "no course") ) (let ((s5-1 (-> *bot-course-table* course s5-0))) - (set! (-> obj course) s5-1) + (set! (-> this course) s5-1) (+! (-> s5-1 retry-cookie) 1) - (mem-copy! (the-as pointer (-> obj spot)) (the-as pointer (-> s5-1 spots 0)) 20) + (mem-copy! (the-as pointer (-> this spot)) (the-as pointer (-> s5-1 spots 0)) 20) (let ((v1-36 (-> s5-1 waypoints 0))) - (set! (-> obj nav-mesh-index) (-> v1-36 nav-mesh-index)) - (go-to-waypoint! obj (-> v1-36 waypoint-id) #f) + (set! (-> this nav-mesh-index) (-> v1-36 nav-mesh-index)) + (go-to-waypoint! this (-> v1-36 waypoint-id) #f) ) ) ) @@ -1511,13 +1523,13 @@ If the player is too far, play a warning speech." ;; definition for method 214 of type bot ;; WARN: Return type mismatch object vs symbol. -(defmethod bot-method-214 bot ((obj bot)) - (the-as symbol (when (logtest? (-> obj bot-flags) (bot-flags bf00)) - (let ((fproc (handle->process (-> obj focus handle)))) +(defmethod bot-method-214 bot ((this bot)) + (the-as symbol (when (logtest? (-> this bot-flags) (bot-flags bf00)) + (let ((fproc (handle->process (-> this focus handle)))) (and fproc - (= (-> obj focus aware) (enemy-aware enemy-aware-3)) - (attacked-by-player? obj (the-as process-focusable fproc)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (= (-> this focus aware) (enemy-aware enemy-aware-3)) + (attacked-by-player? this (the-as process-focusable fproc)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) ) ) @@ -1527,10 +1539,10 @@ If the player is too far, play a warning speech." ;; definition for method 223 of type bot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-223 bot ((obj bot) (arg0 symbol)) - (let ((focus (-> obj focus-info)) +(defmethod bot-method-223 bot ((this bot) (arg0 symbol)) + (let ((focus (-> this focus-info)) (timer (current-time)) - (focus-proc (handle->process (-> obj focus handle))) + (focus-proc (handle->process (-> this focus handle))) ) (when (or (!= timer (-> focus update-time)) (!= focus-proc (-> focus fproc))) (set! (-> focus update-time) timer) @@ -1539,11 +1551,11 @@ If the player is too far, play a warning speech." (when focus-proc (set! (-> focus pos quad) (-> (get-trans (the-as process-focusable focus-proc) 0) quad)) (set! (-> focus bullseye quad) (-> (get-trans (the-as process-focusable focus-proc) 3) quad)) - (vector-z-quaternion! (-> focus my-facing-xz-dir) (-> obj root quat)) + (vector-z-quaternion! (-> focus my-facing-xz-dir) (-> this root quat)) (set! (-> focus my-facing-xz-dir y) 0.0) (vector-normalize! (-> focus my-facing-xz-dir) 1.0) (set! (-> focus my-facing-ry) (atan (-> focus my-facing-xz-dir x) (-> focus my-facing-xz-dir z))) - (vector-! (-> focus bullseye-xz-dir) (-> focus bullseye) (-> obj root trans)) + (vector-! (-> focus bullseye-xz-dir) (-> focus bullseye) (-> this root trans)) (let ((v1-11 (-> focus bullseye-xz-dir))) (set! (-> focus bullseye-xz-dist) (sqrtf (+ (* (-> v1-11 x) (-> v1-11 x)) (* (-> v1-11 z) (-> v1-11 z))))) ) @@ -1555,7 +1567,7 @@ If the player is too far, play a warning speech." ) (when (and arg0 focus-proc (zero? (-> focus los))) (let ((cquery (new 'stack-no-clear 'collide-query))) - (set! (-> cquery start-pos quad) (-> obj root trans quad)) + (set! (-> cquery start-pos quad) (-> this root trans quad)) (+! (-> cquery start-pos y) 8192.0) (vector-! (-> cquery move-dist) (-> focus bullseye) (-> cquery start-pos)) (let ((f0-19 (fmax 1.0 (+ -1638.4 (vector-length (-> cquery move-dist)))))) @@ -1565,9 +1577,9 @@ If the player is too far, play a warning speech." (let ((v1-23 cquery)) (set! (-> v1-23 radius) 2048.0) (set! (-> v1-23 collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) - (set! (-> v1-23 ignore-process0) obj) + (set! (-> v1-23 ignore-process0) this) (set! (-> v1-23 ignore-process1) #f) - (set! (-> v1-23 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-23 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-23 action-mask) (collide-action solid)) ) (cond @@ -1577,7 +1589,7 @@ If the player is too far, play a warning speech." ) (else (let ((s3-3 1)) - (when (not (logtest? (-> obj bot-flags) (bot-flags attacked))) + (when (not (logtest? (-> this bot-flags) (bot-flags attacked))) (let ((a0-31 *target*)) (when a0-31 (vector+! (-> cquery move-dist) (-> cquery move-dist) (-> cquery start-pos)) @@ -1613,7 +1625,7 @@ If the player is too far, play a warning speech." ;; definition for method 182 of type bot ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod turn-to-target bot ((obj bot) (turn-info bot-turn-info) (proc process-focusable) (arg3 float)) +(defmethod turn-to-target bot ((this bot) (turn-info bot-turn-info) (proc process-focusable) (arg3 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1622,7 +1634,7 @@ If the player is too far, play a warning speech." (vf7 :class vf) ) (init-vf0-vector) - (let ((bot-root (-> obj root))) + (let ((bot-root (-> this root))) (quaternion-copy! (-> turn-info src-quat) (-> bot-root quat)) (vector-z-quaternion! (-> turn-info facing-dir) (-> bot-root quat)) (set! (-> turn-info facing-ry) (atan (-> turn-info facing-dir x) (-> turn-info facing-dir z))) @@ -1658,17 +1670,17 @@ If the player is too far, play a warning speech." ) ;; definition for method 208 of type bot -(defmethod bot-method-208 bot ((obj bot)) +(defmethod bot-method-208 bot ((this bot)) (let ((s5-0 #f)) (when *target* (let ((target-trans (-> *target* control trans)) - (bot-root (-> obj root)) + (bot-root (-> this root)) (f0-0 14336.0) ) (when (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> bot-root trans) target-trans)) (let ((v1-8 (-> *target* control transv))) (when (>= (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) 2048.0) - (if (logtest? (-> obj nav state flags) (nav-state-flag avoiding-sphere)) + (if (logtest? (-> this nav state flags) (nav-state-flag avoiding-sphere)) (set! s5-0 #t) ) ) @@ -1676,14 +1688,14 @@ If the player is too far, play a warning speech." ) ) ) - (let* ((f0-8 (-> obj player-blocking)) + (let* ((f0-8 (-> this player-blocking)) (f0-10 (if s5-0 (seek f0-8 1.0 (seconds-per-frame)) (seek f0-8 0.0 (seconds-per-frame)) ) ) ) - (set! (-> obj player-blocking) f0-10) + (set! (-> this player-blocking) f0-10) (= f0-10 1.0) ) ) @@ -1691,19 +1703,19 @@ If the player is too far, play a warning speech." ;; definition for method 82 of type bot ;; INFO: Used lq/sq -(defmethod enemy-method-82 bot ((obj bot) (arg0 enemy-jump-info)) +(defmethod enemy-method-82 bot ((this bot) (arg0 enemy-jump-info)) "@abstract" (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) - (set! (-> v1-0 w) (-> obj nav-radius-backup)) - (add-root-sphere-to-hash! (-> obj nav) v1-0 #x8006a) + (set! (-> v1-0 w) (-> this nav-radius-backup)) + (add-root-sphere-to-hash! (-> this nav) v1-0 #x8006a) ) ) ;; definition for method 222 of type bot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-222 bot ((obj bot) (arg0 vector)) +(defmethod bot-method-222 bot ((this bot) (arg0 vector)) (let ((s1-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (v1-0 (new 'stack-no-clear 'vector)) @@ -1711,11 +1723,11 @@ If the player is too far, play a warning speech." (s4-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> v1-0 quad) (-> obj root trans quad)) + (set! (-> v1-0 quad) (-> this root trans quad)) (+! (-> v1-0 y) 9216.0) (vector-! s1-0 arg0 v1-0) (vector-normalize! s1-0 1.0) - (vector-z-quaternion! s2-0 (-> obj root quat)) + (vector-z-quaternion! s2-0 (-> this root quat)) (rot-zxy-from-vector! s4-0 s2-0) (rot-zxy-from-vector! s3-0 s1-0) (set! (-> s5-0 x) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 x) (-> s4-0 x))))) @@ -1724,8 +1736,8 @@ If the player is too far, play a warning speech." (let ((s4-1 (new 'stack-no-clear 'quaternion))) (quaternion-zxy! s4-1 s5-0) (quaternion-pseudo-seek - (-> obj swivel-joint-mod quat) - (-> obj swivel-joint-mod quat) + (-> this swivel-joint-mod quat) + (-> this swivel-joint-mod quat) s4-1 (seconds-per-frame) ) @@ -1736,12 +1748,12 @@ If the player is too far, play a warning speech." ) ;; definition for method 221 of type bot -(defmethod bot-method-221 bot ((obj bot)) +(defmethod bot-method-221 bot ((this bot)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-identity! gp-0) (quaternion-pseudo-seek - (-> obj swivel-joint-mod quat) - (-> obj swivel-joint-mod quat) + (-> this swivel-joint-mod quat) + (-> this swivel-joint-mod quat) gp-0 (seconds-per-frame) ) @@ -1749,14 +1761,18 @@ If the player is too far, play a warning speech." ) ;; definition for method 203 of type bot -(defmethod play-attacked-speech bot ((obj bot)) - (when (not (channel-active? obj (the-as uint 0))) - (let ((idx - (bot-speech-list-method-9 (-> obj course attack-player-speeches) obj (-> obj course speeches) (speech-flags)) - ) +(defmethod play-attacked-speech bot ((this bot)) + (when (not (channel-active? this (the-as uint 0))) + (let ((idx (bot-speech-list-method-9 + (-> this course attack-player-speeches) + this + (-> this course speeches) + (speech-flags) + ) + ) ) (if (>= idx 0) - (play-speech obj idx) + (play-speech this idx) ) ) ) @@ -1765,22 +1781,22 @@ If the player is too far, play a warning speech." ;; definition for method 196 of type bot ;; WARN: Return type mismatch bot-flags vs none. -(defmethod bot-method-196 bot ((obj bot)) - (logior! (-> obj bot-flags) (bot-flags too-far-fail)) +(defmethod bot-method-196 bot ((this bot)) + (logior! (-> this bot-flags) (bot-flags too-far-fail)) (none) ) ;; definition for method 197 of type bot ;; WARN: Return type mismatch bot-flags vs none. -(defmethod fail-mission! bot ((obj bot)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (logclear! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj enemy-flags) (enemy-flag look-at-move-dest)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (logior! (-> obj bot-flags) (bot-flags bf09)) +(defmethod fail-mission! bot ((this bot)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (logclear! (-> this mask) (process-mask collectable)) + (logclear! (-> this enemy-flags) (enemy-flag look-at-move-dest)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (logior! (-> this bot-flags) (bot-flags bf09)) (let ((mission-failed? #t)) - (let ((master-handle (handle->process (-> obj master-handle)))) + (let ((master-handle (handle->process (-> this master-handle)))) (cond (master-handle (if (not (send-event master-handle 'notify 'mission-failed)) @@ -1804,31 +1820,31 @@ If the player is too far, play a warning speech." ) ) (if mission-failed? - (logior! (-> obj bot-flags) (bot-flags failed bf13)) + (logior! (-> this bot-flags) (bot-flags failed bf13)) ) ) (none) ) ;; definition for method 200 of type bot -(defmethod fail-falling bot ((obj bot)) - (if (logtest? (-> obj bot-flags) (bot-flags failed)) - (cam-move-to-bot obj) +(defmethod fail-falling bot ((this bot)) + (if (logtest? (-> this bot-flags) (bot-flags failed)) + (cam-move-to-bot this) ) (none) ) ;; definition for method 199 of type bot ;; WARN: Return type mismatch object vs none. -(defmethod cam-move-to-bot bot ((obj bot)) +(defmethod cam-move-to-bot bot ((this bot)) (cond - ((logtest? (-> obj bot-flags) (bot-flags bf13)) - (logclear! (-> obj bot-flags) (bot-flags bf13)) - (logior! (-> obj bot-flags) (bot-flags bf14)) - (let ((s4-0 (-> obj move-dest))) - (set-cam-height! obj s4-0) + ((logtest? (-> this bot-flags) (bot-flags bf13)) + (logclear! (-> this bot-flags) (bot-flags bf13)) + (logior! (-> this bot-flags) (bot-flags bf14)) + (let ((s4-0 (-> this move-dest))) + (set-cam-height! this s4-0) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-! s5-0 s4-0 (-> obj root trans)) + (vector-! s5-0 s4-0 (-> this root trans)) (set-setting! 'string-max-height 'abs (-> s5-0 y) 0) (set-setting! 'string-min-height 'abs (-> s5-0 y) 0) (let ((f30-0 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))) @@ -1840,10 +1856,10 @@ If the player is too far, play a warning speech." (set-setting! 'immediate-string-min-max #f 0.0 0) (set! (-> *ACTOR-bank* birth-max) 1000) ) - ((logtest? (-> obj bot-flags) (bot-flags bf14)) - (logclear! (-> obj bot-flags) (bot-flags bf14)) - (send-event *camera* 'change-target obj) - (send-event *camera* 'teleport-to-vector-start-string (-> obj move-dest)) + ((logtest? (-> this bot-flags) (bot-flags bf14)) + (logclear! (-> this bot-flags) (bot-flags bf14)) + (send-event *camera* 'change-target this) + (send-event *camera* 'teleport-to-vector-start-string (-> this move-dest)) ) ) (none) @@ -1851,49 +1867,49 @@ If the player is too far, play a warning speech." ;; definition for method 198 of type bot ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! bot ((obj bot) (arg0 vector)) +(defmethod set-cam-height! bot ((this bot) (arg0 vector)) (set-vector! arg0 0.0 12288.0 28672.0 1.0) - (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) (the-as meters - (if (focus-test? obj under-water) - (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) ) ) ) ;; definition for method 191 of type bot ;; WARN: Return type mismatch focus-status vs none. -(defmethod bot-method-191 bot ((obj bot)) - (logior! (-> obj bot-flags) (bot-flags bf02)) - (set! (-> obj hit-invuln-starting-time) (current-time)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active)) - (if (nonzero? (-> obj hit-invuln-ignore-me-delay)) - (logior! (-> obj focus-status) (focus-status ignore)) +(defmethod bot-method-191 bot ((this bot)) + (logior! (-> this bot-flags) (bot-flags bf02)) + (set-time! (-> this hit-invuln-starting-time)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active)) + (if (nonzero? (-> this hit-invuln-ignore-me-delay)) + (logior! (-> this focus-status) (focus-status ignore)) ) - (if (nonzero? (-> obj hit-invuln-focus-disable-delay)) - (logior! (-> obj focus-status) (focus-status disable)) + (if (nonzero? (-> this hit-invuln-focus-disable-delay)) + (logior! (-> this focus-status) (focus-status disable)) ) (none) ) ;; definition for method 192 of type bot ;; WARN: Return type mismatch bot-flags vs none. -(defmethod bot-method-192 bot ((obj bot)) +(defmethod bot-method-192 bot ((this bot)) (local-vars (a2-7 enemy-flag)) - (let ((a1-0 (-> obj hit-invuln-starting-time)) + (let ((a1-0 (-> this hit-invuln-starting-time)) (v1-0 #t) ) - (if (not (logtest? (-> obj enemy-flags) (enemy-flag enable-on-active))) + (if (not (logtest? (-> this enemy-flags) (enemy-flag enable-on-active))) (set! v1-0 (cond - ((>= (- (current-time) a1-0) (seconds 0.6)) - (let ((a2-6 (-> obj enemy-flags))) + ((time-elapsed? a1-0 (seconds 0.6)) + (let ((a2-6 (-> this enemy-flags))) (if (logtest? a2-6 (enemy-flag checking-water)) (set! a2-7 (logior a2-6 (enemy-flag enable-on-active))) (set! a2-7 (logclear a2-6 (enemy-flag enable-on-active))) ) ) - (set! (-> obj enemy-flags) a2-7) + (set! (-> this enemy-flags) a2-7) v1-0 ) (else @@ -1902,10 +1918,10 @@ If the player is too far, play a warning speech." ) ) ) - (if (focus-test? obj ignore) + (if (focus-test? this ignore) (set! v1-0 (cond - ((>= (- (current-time) a1-0) (the-as time-frame (-> obj hit-invuln-ignore-me-delay))) - (logclear! (-> obj focus-status) (focus-status ignore)) + ((time-elapsed? a1-0 (the-as time-frame (-> this hit-invuln-ignore-me-delay))) + (logclear! (-> this focus-status) (focus-status ignore)) v1-0 ) (else @@ -1914,10 +1930,10 @@ If the player is too far, play a warning speech." ) ) ) - (if (focus-test? obj disable) + (if (focus-test? this disable) (set! v1-0 (cond - ((>= (- (current-time) a1-0) (the-as time-frame (-> obj hit-invuln-focus-disable-delay))) - (logclear! (-> obj focus-status) (focus-status disable)) + ((time-elapsed? a1-0 (the-as time-frame (-> this hit-invuln-focus-disable-delay))) + (logclear! (-> this focus-status) (focus-status disable)) v1-0 ) (else @@ -1927,7 +1943,7 @@ If the player is too far, play a warning speech." ) ) (if v1-0 - (logclear! (-> obj bot-flags) (bot-flags bf02)) + (logclear! (-> this bot-flags) (bot-flags bf02)) ) ) (none) @@ -1935,20 +1951,20 @@ If the player is too far, play a warning speech." ;; definition for method 216 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-216 bot ((obj bot)) +(defmethod bot-method-216 bot ((this bot)) 0 (none) ) ;; definition for method 60 of type bot -(defmethod coin-flip? bot ((obj bot)) +(defmethod coin-flip? bot ((this bot)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 181 of type bot ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-181 bot ((obj bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) +(defmethod bot-method-181 bot ((this bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) diff --git a/test/decompiler/reference/jak2/levels/common/ai/halt/hal-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/halt/hal-h_REF.gc index fb5c883f0e..bcd5500795 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/halt/hal-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/halt/hal-h_REF.gc @@ -17,18 +17,18 @@ ) ;; definition for method 3 of type hal -(defmethod inspect hal ((obj hal)) - (when (not obj) - (set! obj obj) +(defmethod inspect hal ((this hal)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thandle-failed-slave-id: ~D~%" (-> obj handle-failed-slave-id)) - (format #t "~2Tslave-handle[3] @ #x~X~%" (-> obj slave-handle)) + (format #t "~2Thandle-failed-slave-id: ~D~%" (-> this handle-failed-slave-id)) + (format #t "~2Tslave-handle[3] @ #x~X~%" (-> this slave-handle)) (label cfg-4) - obj + this ) ;; definition of type halt-wait-spot @@ -44,23 +44,23 @@ ) ;; definition for method 3 of type halt-wait-spot -(defmethod inspect halt-wait-spot ((obj halt-wait-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect halt-wait-spot ((this halt-wait-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> obj spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> this spot-indexes)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/common/ai/halt/hal-task_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/halt/hal-task_REF.gc index 4ac67e9254..c35ac014bd 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/halt/hal-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/halt/hal-task_REF.gc @@ -3,33 +3,33 @@ ;; definition for method 9 of type halt-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! halt-wait-spot ((obj halt-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) 0) - (set! (-> obj num-spots) (the-as uint 1)) +(defmethod reset-task! halt-wait-spot ((this halt-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) 0) + (set! (-> this num-spots) (the-as uint 1)) (none) ) ;; definition for method 11 of type halt-wait-spot ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 halt-wait-spot ((obj halt-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 halt-wait-spot ((this halt-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (set! (-> arg0 root trans quad) (-> arg0 spot center quad)) - ((-> obj check-done) obj (the-as hal arg0)) + ((-> this check-done) this (the-as hal arg0)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc index 3a0c70633f..8f01ec40cf 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/halt/hal_REF.gc @@ -134,14 +134,14 @@ ) ;; definition for method 220 of type hal -(defmethod stop-speech hal ((obj hal) (arg0 uint) (arg1 symbol)) +(defmethod stop-speech hal ((this hal) (arg0 uint) (arg1 symbol)) (cond ((zero? arg0) (let ((t9-0 (method-of-type bot stop-speech))) - (t9-0 obj (-> obj channel) arg1) + (t9-0 this (-> this channel) arg1) ) (countdown (s4-0 3) - (let ((v1-4 (handle->process (-> obj slave-handle s4-0)))) + (let ((v1-4 (handle->process (-> this slave-handle s4-0)))) (when v1-4 (let ((t9-1 (method-of-type bot stop-speech))) (t9-1 (the-as bot v1-4) (-> v1-4 stack 580) arg1) @@ -151,7 +151,7 @@ ) ) (else - ((method-of-type bot stop-speech) obj arg0 arg1) + ((method-of-type bot stop-speech) this arg0 arg1) ) ) (none) @@ -159,16 +159,16 @@ ;; definition for method 206 of type hal ;; WARN: Return type mismatch gui-connection vs none. -(defmethod play-speech hal ((obj hal) (arg0 int)) - (let ((v1-2 (-> obj course speeches arg0))) +(defmethod play-speech hal ((this hal) (arg0 int)) + (let ((v1-2 (-> this course speeches arg0))) (logior! (-> v1-2 flags) (speech-flags playing)) (let ((a1-4 (-> v1-2 slave-id)) (t2-0 (-> v1-2 hold-time)) - (gp-0 (-> obj course speech-tunings (-> v1-2 tuning-id))) + (gp-0 (-> this course speech-tunings (-> v1-2 tuning-id))) ) (cond ((>= a1-4 0) - (let* ((a2-2 (handle->process (-> obj slave-handle a1-4))) + (let* ((a2-2 (handle->process (-> this slave-handle a1-4))) (a1-11 (add-process *gui-control* a2-2 @@ -186,8 +186,8 @@ (else (let ((a1-14 (add-process *gui-control* - obj - (the-as gui-channel (-> obj channel)) + this + (the-as gui-channel (-> this channel)) (gui-action play) (-> v1-2 name) -99.0 @@ -205,17 +205,17 @@ ) ;; definition for method 209 of type hal -(defmethod channel-active? hal ((obj hal) (arg0 uint)) +(defmethod channel-active? hal ((this hal) (arg0 uint)) "Is the given [[gui-channel]] active?" (cond ((zero? arg0) (let ((t9-0 (method-of-type bot channel-active?))) - (if (t9-0 obj (-> obj channel)) + (if (t9-0 this (-> this channel)) (return #t) ) ) (countdown (s5-0 3) - (let ((v1-7 (handle->process (-> obj slave-handle s5-0)))) + (let ((v1-7 (handle->process (-> this slave-handle s5-0)))) (when v1-7 (let ((t9-1 (method-of-type bot channel-active?))) (if (t9-1 (the-as bot v1-7) (-> v1-7 stack 580)) @@ -228,15 +228,15 @@ #f ) (else - ((method-of-type bot channel-active?) obj arg0) + ((method-of-type bot channel-active?) this arg0) ) ) ) ;; definition for method 226 of type hal -(defmethod hal-method-226 hal ((obj hal)) +(defmethod hal-method-226 hal ((this hal)) (countdown (s5-0 3) - (let ((a0-2 (handle->process (-> obj slave-handle s5-0)))) + (let ((a0-2 (handle->process (-> this slave-handle s5-0)))) (when a0-2 (if (not (send-event a0-2 'request 'slave-id s5-0)) (return #f) @@ -248,9 +248,9 @@ ) ;; definition for method 225 of type hal -(defmethod hal-method-225 hal ((obj hal)) +(defmethod hal-method-225 hal ((this hal)) (countdown (v1-0 3) - (if (handle->process (-> obj slave-handle v1-0)) + (if (handle->process (-> this slave-handle v1-0)) (return #f) ) ) @@ -259,13 +259,13 @@ ;; definition for method 196 of type hal ;; WARN: Return type mismatch symbol vs none. -(defmethod bot-method-196 hal ((obj hal)) - (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail))) +(defmethod bot-method-196 hal ((this hal)) + (when (not (logtest? (-> this bot-flags) (bot-flags too-far-fail))) (let ((t9-0 (method-of-type bot bot-method-196))) - (t9-0 obj) + (t9-0 this) ) (countdown (s5-0 3) - (let ((a0-3 (handle->process (-> obj slave-handle s5-0)))) + (let ((a0-3 (handle->process (-> this slave-handle s5-0)))) (if a0-3 (bot-method-196 (the-as bot a0-3)) ) @@ -277,9 +277,9 @@ ;; definition for method 114 of type hal ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! hal ((obj hal)) +(defmethod init-enemy-collision! hal ((this hal)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -296,7 +296,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -304,14 +304,14 @@ ;; definition for method 210 of type hal ;; WARN: Return type mismatch int vs none. -(defmethod init! hal ((obj hal)) +(defmethod init! hal ((this hal)) "Set defaults for various fields." (let ((t9-0 (method-of-type bot init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj handle-failed-slave-id) -1) + (set! (-> this handle-failed-slave-id) -1) (countdown (v1-2 3) - (set! (-> obj slave-handle v1-2) (the-as handle #f)) + (set! (-> this slave-handle v1-2) (the-as handle #f)) (nop!) ) 0 @@ -320,60 +320,60 @@ ;; definition for method 115 of type hal ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! hal ((obj hal)) +(defmethod init-enemy! hal ((this hal)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) + (init! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-scenecamera" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *hal-nav-enemy-info*) + (init-enemy-behaviour-and-stats! this *hal-nav-enemy-info*) (let ((t9-4 (method-of-type bot init-enemy!))) - (t9-4 obj) + (t9-4 this) ) - (set! (-> obj channel) (the-as uint 28)) - (set! (-> obj spot-color) (the-as uint #x5000ffff)) - (set! (-> obj notice-enemy-dist) 0.0) - (logior! (-> obj focus-status) (focus-status disable)) - (let ((v1-13 (-> obj root root-prim))) + (set! (-> this channel) (the-as uint 28)) + (set! (-> this spot-color) (the-as uint #x5000ffff)) + (set! (-> this notice-enemy-dist) 0.0) + (logior! (-> this focus-status) (focus-status disable)) + (let ((v1-13 (-> this root root-prim))) (set! (-> v1-13 prim-core collide-as) (collide-spec)) (set! (-> v1-13 prim-core collide-with) (collide-spec)) ) - (set! (-> obj root backup-collide-as) (collide-spec)) - (set! (-> obj root backup-collide-with) (collide-spec)) + (set! (-> this root backup-collide-as) (collide-spec)) + (set! (-> this root backup-collide-with) (collide-spec)) 0 - (logior! (-> obj draw status) (draw-control-status no-draw)) - (remove-process-drawable (-> obj nav state mesh) obj) - (set! (-> obj nav) #f) - (set! (-> obj nav-mesh-index) -1) + (logior! (-> this draw status) (draw-control-status no-draw)) + (remove-process-drawable (-> this nav state mesh) this) + (set! (-> this nav) #f) + (set! (-> this nav-mesh-index) -1) 0 (none) ) ;; definition for method 205 of type hal -(defmethod scene-play hal ((obj hal) (arg0 string) (arg1 symbol)) +(defmethod scene-play hal ((this hal) (arg0 string) (arg1 symbol)) "Spawn a [[scene-player]] process for the given scene." - (when (and (process-grab? obj #t) (or arg1 (process-grab? *target* #t))) + (when (and (process-grab? this #t) (or arg1 (process-grab? *target* #t))) (countdown (s3-0 3) - (let ((a0-4 (handle->process (-> obj slave-handle s3-0)))) + (let ((a0-4 (handle->process (-> this slave-handle s3-0)))) (if (and a0-4 (not (process-grab? a0-4 #t))) (return #f) ) ) ) - (process-grab? obj #f) + (process-grab? this #f) (if (not arg1) (process-grab? *target* #f) ) (countdown (s4-1 3) - (let ((a0-10 (handle->process (-> obj slave-handle s4-1)))) + (let ((a0-10 (handle->process (-> this slave-handle s4-1)))) (if a0-10 (process-grab? a0-10 #f) ) ) ) - (set! (-> obj scene-player-handle) + (set! (-> this scene-player-handle) (ppointer->handle (process-spawn scene-player :init scene-player-init arg0 #t #f)) ) #t @@ -381,11 +381,11 @@ ) ;; definition for method 188 of type hal -(defmethod scene-release? hal ((obj hal)) - (when (not (handle->process (-> obj scene-player-handle))) - (process-release? obj) +(defmethod scene-release? hal ((this hal)) + (when (not (handle->process (-> this scene-player-handle))) + (process-release? this) (countdown (s5-0 3) - (let ((a0-7 (handle->process (-> obj slave-handle s5-0)))) + (let ((a0-7 (handle->process (-> this slave-handle s5-0)))) (if a0-7 (process-release? a0-7) ) @@ -397,7 +397,7 @@ ;; definition for method 74 of type hal ;; INFO: Used lq/sq -(defmethod general-event-handler hal ((obj hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler hal ((this hal) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -412,8 +412,8 @@ ) (when v1-2 (when (= (-> (the-as process (-> arg3 param 1)) type) target) - (logior! (-> obj bot-flags) (ash 1 (+ (-> (the-as bot v1-2) slave-id) 19))) - (stop-speech obj (the-as uint 0) #t) + (logior! (-> this bot-flags) (ash 1 (+ (-> (the-as bot v1-2) slave-id) 19))) + (stop-speech this (the-as uint 0) #t) ) ) ) @@ -426,9 +426,9 @@ ) ) (when s5-1 - (when (not (logtest? (-> obj bot-flags) (bot-flags too-far-fail))) - (when (not (logtest? (-> obj bot-flags) (bot-flags bf09))) - (logior! (-> obj bot-flags) (bot-flags bf09)) + (when (not (logtest? (-> this bot-flags) (bot-flags too-far-fail))) + (when (not (logtest? (-> this bot-flags) (bot-flags bf09))) + (logior! (-> this bot-flags) (bot-flags bf09)) (let ((a1-7 (new 'stack-no-clear 'fail-mission-params))) (set! (-> a1-7 flags) (fail-mission-flags famflags-5)) (set! (-> a1-7 message) (fail-mission-message fammsg-0)) @@ -438,69 +438,69 @@ (set! (-> a1-7 task) (game-task none)) (set! (-> a1-7 fail-message) (text-id null)) (if (start! *fail-mission-control* a1-7) - (set! (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) + (set! (-> this handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) ) ) - (set! (-> obj delay-too-far-check) -1) - (stop-speech obj (the-as uint 0) #f) + (set! (-> this delay-too-far-check) -1) + (stop-speech this (the-as uint 0) #f) (countdown (s4-2 3) - (send-event (handle->process (-> obj slave-handle s4-2)) 'notify 'mission-failed) + (send-event (handle->process (-> this slave-handle s4-2)) 'notify 'mission-failed) ) ) - (= (-> obj handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) + (= (-> this handle-failed-slave-id) (-> (the-as bot s5-1) slave-id)) ) ) ) ) (('follow-dir) - (set! (-> obj follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + (set! (-> this follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) #t ) ) ) (('set-task) (let ((a1-10 (/ (the-as int (-> arg3 param 0)) 8))) - (logior! (-> obj bot-task-bits) (ash 1 a1-10)) + (logior! (-> this bot-task-bits) (ash 1 a1-10)) ) #t ) (('clear-task) (let ((a1-12 (/ (the-as int (-> arg3 param 0)) 8))) - (logclear! (-> obj bot-task-bits) (ash 1 a1-12)) + (logclear! (-> this bot-task-bits) (ash 1 a1-12)) ) #t ) (('change-mode) (when (= (-> arg3 param 0) 'grab) - (let ((v0-1 (the-as object (alive? obj)))) + (let ((v0-1 (the-as object (alive? this)))) (if (and (the-as symbol v0-1) (-> arg3 param 1)) - (logior! (-> obj focus-status) (focus-status grabbed)) + (logior! (-> this focus-status) (focus-status grabbed)) ) v0-1 ) ) ) (('end-mode) - (when (focus-test? obj grabbed) - (logclear! (-> obj focus-status) (focus-status grabbed)) + (when (focus-test? this grabbed) + (logclear! (-> this focus-status) (focus-status grabbed)) #t ) ) (('skip) - (skip-waypoint obj) + (skip-waypoint this) ) (('move-trans) - (move-to-point! (-> obj root) (the-as vector (-> arg3 param 0))) + (move-to-point! (-> this root) (the-as vector (-> arg3 param 0))) #t ) (('die-fast) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (('nav-mesh-kill) - (remove-process-drawable (-> obj nav state mesh) obj) - (set! (-> obj nav) #f) - (set! (-> obj nav-mesh-index) -1) + (remove-process-drawable (-> this nav state mesh) this) + (set! (-> this nav) #f) + (set! (-> this nav-mesh-index) -1) #t ) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-h_REF.gc index ed5c8d4c33..2f4651051a 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-h_REF.gc @@ -11,28 +11,28 @@ ) ;; definition for method 3 of type ruffian-course -(defmethod inspect ruffian-course ((obj ruffian-course)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruffian-course ((this ruffian-course)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcourse-id: ~D~%" (-> obj course-id)) - (format #t "~1Tspeech-count: ~D~%" (-> obj speech-count)) - (format #t "~1Tspot-count: ~D~%" (-> obj spot-count)) - (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) - (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> obj too-far-warn-speeches)) - (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> obj too-far-fail-speeches)) - (format #t "~1Tattack-player-speeches: ~A~%" (-> obj attack-player-speeches)) - (format #t "~1Tdefault-check-too-far: ~A~%" (-> obj default-check-too-far)) - (format #t "~1Twaypoints: ~A~%" (-> obj waypoints)) - (format #t "~1Tspeeches: #x~X~%" (-> obj speeches)) - (format #t "~1Tspeech-tunings: #x~X~%" (-> obj speech-tunings)) - (format #t "~1Tdirs: #x~X~%" (-> obj dirs)) - (format #t "~1Tspots: #x~X~%" (-> obj spots)) - (format #t "~1Touch-speeches: ~A~%" (-> obj ouch-speeches)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse-id: ~D~%" (-> this course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> this speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> this spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> this too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> this too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> this attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> this default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> this waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> this speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> this speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> this dirs)) + (format #t "~1Tspots: #x~X~%" (-> this spots)) + (format #t "~1Touch-speeches: ~A~%" (-> this ouch-speeches)) (label cfg-4) - obj + this ) ;; definition of type ruffian @@ -72,19 +72,19 @@ ) ;; definition for method 3 of type ruffian -(defmethod inspect ruffian ((obj ruffian)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruffian ((this ruffian)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttravel-anim-interp: ~f~%" (-> obj travel-anim-interp)) - (format #t "~2Tfired-gun-count: ~D~%" (-> obj fired-gun-count)) - (format #t "~2Tnext-fire-time: ~D~%" (-> obj next-fire-time)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> this travel-anim-interp)) + (format #t "~2Tfired-gun-count: ~D~%" (-> this fired-gun-count)) + (format #t "~2Tnext-fire-time: ~D~%" (-> this next-fire-time)) (label cfg-4) - obj + this ) ;; definition of type ruft-wait-spot @@ -100,23 +100,23 @@ ) ;; definition for method 3 of type ruft-wait-spot -(defmethod inspect ruft-wait-spot ((obj ruft-wait-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruft-wait-spot ((this ruft-wait-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> obj spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> this spot-indexes)) (label cfg-4) - obj + this ) ;; definition of type ruft-choose-jump @@ -137,24 +137,24 @@ ) ;; definition for method 3 of type ruft-choose-jump -(defmethod inspect ruft-choose-jump ((obj ruft-choose-jump)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruft-choose-jump ((this ruft-choose-jump)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tsrc-spot-indexes[4] @ #x~X~%" (-> obj src-spot-indexes)) - (format #t "~1Tdest-spot-indexes[4] @ #x~X~%" (-> obj dest-spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tsrc-spot-indexes[4] @ #x~X~%" (-> this src-spot-indexes)) + (format #t "~1Tdest-spot-indexes[4] @ #x~X~%" (-> this dest-spot-indexes)) (label cfg-4) - obj + this ) ;; definition of type ruft-fight-focus @@ -166,19 +166,19 @@ ) ;; definition for method 3 of type ruft-fight-focus -(defmethod inspect ruft-fight-focus ((obj ruft-fight-focus)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruft-fight-focus ((this ruft-fight-focus)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) (label cfg-4) - obj + this ) ;; definition of type ruft-plant-bomb @@ -195,24 +195,24 @@ ) ;; definition for method 3 of type ruft-plant-bomb -(defmethod inspect ruft-plant-bomb ((obj ruft-plant-bomb)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruft-plant-bomb ((this ruft-plant-bomb)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tstand-spot-indexes[2] @ #x~X~%" (-> obj stand-spot-indexes)) - (format #t "~1Tface-spot-indexes[2] @ #x~X~%" (-> obj face-spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tstand-spot-indexes[2] @ #x~X~%" (-> this stand-spot-indexes)) + (format #t "~1Tface-spot-indexes[2] @ #x~X~%" (-> this face-spot-indexes)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-states_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-states_REF.gc index a6b039451e..4ebcb37215 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-states_REF.gc @@ -6,7 +6,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -51,7 +51,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -90,7 +90,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -132,7 +132,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -173,7 +173,7 @@ :enter (-> (method-of-type ruffian scared-idle) enter) :trans (behavior () (bot-method-223 self #t) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (cond ((not (bot-method-214 self)) (react-to-focus self) @@ -199,7 +199,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -228,7 +228,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -254,10 +254,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (ruffian-method-240 self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -288,7 +288,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -308,7 +308,7 @@ ((bot-method-214 self) (go-hostile self) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -334,7 +334,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (bot-method-214 self) (go-hostile self) ) @@ -506,7 +506,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-task_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-task_REF.gc index 3985eee90a..8aa20ed160 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/ruffian/ruf-task_REF.gc @@ -3,43 +3,43 @@ ;; definition for method 9 of type ruft-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! ruft-wait-spot ((obj ruft-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! ruft-wait-spot ((this ruft-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type ruft-wait-spot -(defmethod ai-task-method-11 ruft-wait-spot ((obj ruft-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 ruft-wait-spot ((this ruft-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - (when (not ((-> obj check-done) obj (the-as ruffian arg0))) + (when (not ((-> this check-done) this (the-as ruffian arg0))) (let ((a1-10 (handle->process (-> arg0 focus handle)))) (when (and a1-10 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) @@ -55,7 +55,8 @@ ) ;; definition for method 11 of type ruft-fight-focus -(defmethod ai-task-method-11 ruft-fight-focus ((obj ruft-fight-focus) (arg0 bot)) +;; WARN: Return type mismatch object vs none. +(defmethod ai-task-method-11 ruft-fight-focus ((this ruft-fight-focus) (arg0 bot)) (let ((a1-1 (handle->process (-> arg0 focus handle)))) (if (and a1-1 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) @@ -63,7 +64,7 @@ (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (logior! (-> arg0 bot-flags) (bot-flags bf00)) - (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + (ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0) ) ) (none) @@ -71,24 +72,24 @@ ;; definition for method 10 of type ruft-fight-focus ;; WARN: Return type mismatch bot-flags vs none. -(defmethod ai-task-method-10 ruft-fight-focus ((obj ruft-fight-focus) (arg0 bot)) +(defmethod ai-task-method-10 ruft-fight-focus ((this ruft-fight-focus) (arg0 bot)) (logclear! (-> arg0 bot-flags) (bot-flags bf00)) (none) ) ;; definition for method 13 of type ruft-choose-jump -(defmethod ruft-choose-jump-method-13 ruft-choose-jump ((obj ruft-choose-jump) (arg0 ruffian)) +(defmethod ruft-choose-jump-method-13 ruft-choose-jump ((this ruft-choose-jump) (arg0 ruffian)) (let ((gp-0 0)) (let ((f30-0 -1.0) (s3-0 (-> arg0 root trans)) ) - (countdown (s2-0 (-> obj num-spots)) - (let* ((s1-0 (-> arg0 ruf-course spots (-> obj src-spot-indexes s2-0))) + (countdown (s2-0 (-> this num-spots)) + (let* ((s1-0 (-> arg0 ruf-course spots (-> this src-spot-indexes s2-0))) (f28-0 (vector-vector-xz-distance s3-0 (-> s1-0 center))) ) (when (and (or (< f30-0 0.0) (< f28-0 f30-0)) (and (not (player-blocking-spot? arg0 s1-0)) - (not (player-blocking-spot? arg0 (-> arg0 ruf-course spots (-> obj dest-spot-indexes s2-0)))) + (not (player-blocking-spot? arg0 (-> arg0 ruf-course spots (-> this dest-spot-indexes s2-0)))) ) ) (set! f30-0 f28-0) @@ -102,9 +103,9 @@ ) ;; definition for method 12 of type ruft-choose-jump -(defmethod ruft-choose-jump-method-12 ruft-choose-jump ((obj ruft-choose-jump) (arg0 ruffian)) - (let ((a1-5 (-> arg0 ruf-course spots (-> obj src-spot-indexes (-> obj which-spot)))) - (s5-0 (-> arg0 ruf-course spots (-> obj dest-spot-indexes (-> obj which-spot)))) +(defmethod ruft-choose-jump-method-12 ruft-choose-jump ((this ruft-choose-jump) (arg0 ruffian)) + (let ((a1-5 (-> arg0 ruf-course spots (-> this src-spot-indexes (-> this which-spot)))) + (s5-0 (-> arg0 ruf-course spots (-> this dest-spot-indexes (-> this which-spot)))) ) (when (and (outside-spot-radius? arg0 a1-5 (the-as vector #f) #f) (not (player-blocking-spot? arg0 s5-0))) (let ((v1-9 (-> arg0 nav))) @@ -122,76 +123,76 @@ ;; definition for method 9 of type ruft-choose-jump ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! ruft-choose-jump ((obj ruft-choose-jump)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! ruft-choose-jump ((this ruft-choose-jump)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type ruft-choose-jump ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 ruft-choose-jump ((obj ruft-choose-jump) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 ruft-choose-jump ((this ruft-choose-jump) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (or (< s4-0 0) - (player-blocking-spot? arg0 (-> arg0 course spots (-> obj src-spot-indexes s4-0))) - (player-blocking-spot? arg0 (-> arg0 course spots (-> obj dest-spot-indexes s4-0))) + (player-blocking-spot? arg0 (-> arg0 course spots (-> this src-spot-indexes s4-0))) + (player-blocking-spot? arg0 (-> arg0 course spots (-> this dest-spot-indexes s4-0))) ) - (set! s4-0 (ruft-choose-jump-method-13 obj (the-as ruffian arg0))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (ruft-choose-jump-method-13 this (the-as ruffian arg0))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj src-spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this src-spot-indexes s4-0))) 20 ) (send-event (ppointer->process (-> arg0 my-simple-focus)) 'move-trans - (-> arg0 course spots (-> obj dest-spot-indexes s4-0)) + (-> arg0 course spots (-> this dest-spot-indexes s4-0)) ) (set! (-> arg0 poi-handle) (ppointer->handle (-> arg0 my-simple-focus))) ) (when (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj src-spot-indexes)) - (the-as int (-> obj src-spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this src-spot-indexes)) + (the-as int (-> this src-spot-indexes s4-0)) ) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj dest-spot-indexes)) - (the-as int (-> obj dest-spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this dest-spot-indexes)) + (the-as int (-> this dest-spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as ruffian arg0)) + ((-> this check-done) this (the-as ruffian arg0)) (none) ) ;; definition for method 10 of type ruft-choose-jump -(defmethod ai-task-method-10 ruft-choose-jump ((obj ruft-choose-jump) (arg0 bot)) +(defmethod ai-task-method-10 ruft-choose-jump ((this ruft-choose-jump) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) ;; definition for method 9 of type ruft-plant-bomb ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! ruft-plant-bomb ((obj ruft-plant-bomb)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! ruft-plant-bomb ((this ruft-plant-bomb)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type ruft-plant-bomb -(defmethod ai-task-method-11 ruft-plant-bomb ((obj ruft-plant-bomb) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 ruft-plant-bomb ((this ruft-plant-bomb) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj stand-spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this stand-spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) @@ -199,23 +200,23 @@ ) (when (< s4-0 0) (set! s4-0 - (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj stand-spot-indexes))) + (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this stand-spot-indexes))) ) - (set! (-> obj which-spot) s4-0) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj stand-spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this stand-spot-indexes s4-0))) 20 ) (send-event (ppointer->process (-> arg0 my-simple-focus)) 'move-trans - (-> arg0 course spots (-> obj face-spot-indexes s4-0)) + (-> arg0 course spots (-> this face-spot-indexes s4-0)) ) ) (set! (-> arg0 poi-handle) (ppointer->handle (-> arg0 my-simple-focus))) (if (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) - (and (enemy-method-95 arg0 (the-as vector (-> arg0 course spots (-> obj face-spot-indexes s4-0))) 10012.445) + (and (enemy-method-95 arg0 (the-as vector (-> arg0 course spots (-> this face-spot-indexes s4-0))) 10012.445) (not (logtest? (bot-flags bf21) (-> arg0 bot-flags))) ) ) @@ -225,19 +226,19 @@ (when (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj stand-spot-indexes)) - (the-as int (-> obj stand-spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this stand-spot-indexes)) + (the-as int (-> this stand-spot-indexes s4-0)) ) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj face-spot-indexes)) - (the-as int (-> obj face-spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this face-spot-indexes)) + (the-as int (-> this face-spot-indexes s4-0)) ) ) ) - (when (not ((-> obj check-done) obj (the-as ruffian arg0))) + (when (not ((-> this check-done) this (the-as ruffian arg0))) (let ((a1-17 (handle->process (-> arg0 focus handle)))) (when (and a1-17 (= (-> arg0 focus aware) (enemy-aware enemy-aware-3)) @@ -253,7 +254,7 @@ ) ;; definition for method 10 of type ruft-plant-bomb -(defmethod ai-task-method-10 ruft-plant-bomb ((obj ruft-plant-bomb) (arg0 bot)) +(defmethod ai-task-method-10 ruft-plant-bomb ((this ruft-plant-bomb) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-h_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-h_REF.gc index 9f61768ec7..ec8771da41 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-h_REF.gc @@ -25,20 +25,20 @@ ) ;; definition for method 3 of type sig-plasma -(defmethod inspect sig-plasma ((obj sig-plasma)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig-plasma ((this sig-plasma)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sig-plasma) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tlevel: ~f~%" (-> obj level)) - (format #t "~1Tmin-level: ~f~%" (-> obj min-level)) - (format #t "~1Tcharge-speed: ~f~%" (-> obj charge-speed)) - (format #t "~1Tpowerup-sound-id: ~D~%" (-> obj powerup-sound-id)) - (format #t "~1Tplasma-sound-id: ~D~%" (-> obj plasma-sound-id)) + (format #t "[~8x] ~A~%" this 'sig-plasma) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tlevel: ~f~%" (-> this level)) + (format #t "~1Tmin-level: ~f~%" (-> this min-level)) + (format #t "~1Tcharge-speed: ~f~%" (-> this charge-speed)) + (format #t "~1Tpowerup-sound-id: ~D~%" (-> this powerup-sound-id)) + (format #t "~1Tplasma-sound-id: ~D~%" (-> this plasma-sound-id)) (label cfg-4) - obj + this ) ;; definition of type sig-path-sample @@ -215,16 +215,16 @@ ) ;; definition for method 3 of type sig-path -(defmethod inspect sig-path ((obj sig-path)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig-path ((this sig-path)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tsample-count: ~D~%" (-> obj sample-count)) - (format #t "~1Tsamples: #x~X~%" (-> obj samples)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tsample-count: ~D~%" (-> this sample-count)) + (format #t "~1Tsamples: #x~X~%" (-> this samples)) (label cfg-4) - obj + this ) ;; definition of type sig @@ -284,27 +284,27 @@ ) ;; definition for method 3 of type sig -(defmethod inspect sig ((obj sig)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig ((this sig)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfired-gun-count: ~D~%" (-> obj fired-gun-count)) - (format #t "~2Tsig-path: ~A~%" (-> obj sig-path)) - (format #t "~2Tsig-path-clock: ~A~%" (-> obj sig-path-clock)) - (format #t "~2Ttravel-anim-interp: ~f~%" (-> obj travel-anim-interp)) - (format #t "~2Tplatform-index: ~D~%" (-> obj platform-index)) - (format #t "~2Tplayed-unjam-time: ~D~%" (-> obj played-unjam-time)) - (format #t "~2Tsig-path-start-time: ~D~%" (-> obj sig-path-start-time)) - (format #t "~2Tsig-path-cur-time: ~D~%" (-> obj sig-path-cur-time)) - (format #t "~2Tsig-path-prev-time: ~D~%" (-> obj sig-path-prev-time)) - (format #t "~2Tplasma: #~%" (-> obj plasma)) - (format #t "~2Tsig-path-prev-pos: ~`vector`P~%" (-> obj event-param-point)) + (format #t "~2Tfired-gun-count: ~D~%" (-> this fired-gun-count)) + (format #t "~2Tsig-path: ~A~%" (-> this sig-path)) + (format #t "~2Tsig-path-clock: ~A~%" (-> this sig-path-clock)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> this travel-anim-interp)) + (format #t "~2Tplatform-index: ~D~%" (-> this platform-index)) + (format #t "~2Tplayed-unjam-time: ~D~%" (-> this played-unjam-time)) + (format #t "~2Tsig-path-start-time: ~D~%" (-> this sig-path-start-time)) + (format #t "~2Tsig-path-cur-time: ~D~%" (-> this sig-path-cur-time)) + (format #t "~2Tsig-path-prev-time: ~D~%" (-> this sig-path-prev-time)) + (format #t "~2Tplasma: #~%" (-> this plasma)) + (format #t "~2Tsig-path-prev-pos: ~`vector`P~%" (-> this event-param-point)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -328,23 +328,23 @@ ) ;; definition for method 3 of type sigt-wait-spot -(defmethod inspect sigt-wait-spot ((obj sigt-wait-spot)) - (when (not obj) - (set! obj obj) +(defmethod inspect sigt-wait-spot ((this sigt-wait-spot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> obj spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> this spot-indexes)) (label cfg-4) - obj + this ) ;; definition of type sigt-choose-piston @@ -366,24 +366,24 @@ ) ;; definition for method 3 of type sigt-choose-piston -(defmethod inspect sigt-choose-piston ((obj sigt-choose-piston)) - (when (not obj) - (set! obj obj) +(defmethod inspect sigt-choose-piston ((this sigt-choose-piston)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[4] @ #x~X~%" (-> obj spot-indexes)) - (format #t "~1Tactor-indexes[4] @ #x~X~%" (-> obj actor-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[4] @ #x~X~%" (-> this spot-indexes)) + (format #t "~1Tactor-indexes[4] @ #x~X~%" (-> this actor-indexes)) (label cfg-4) - obj + this ) ;; definition of type sigt-riding-piston @@ -402,23 +402,23 @@ ) ;; definition for method 3 of type sigt-riding-piston -(defmethod inspect sigt-riding-piston ((obj sigt-riding-piston)) - (when (not obj) - (set! obj obj) +(defmethod inspect sigt-riding-piston ((this sigt-riding-piston)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[4] @ #x~X~%" (-> obj spot-indexes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[4] @ #x~X~%" (-> this spot-indexes)) (label cfg-4) - obj + this ) ;; definition of type sigt-charge-plasma @@ -435,24 +435,24 @@ ) ;; definition for method 3 of type sigt-charge-plasma -(defmethod inspect sigt-charge-plasma ((obj sigt-charge-plasma)) - (when (not obj) - (set! obj obj) +(defmethod inspect sigt-charge-plasma ((this sigt-charge-plasma)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tcheck-done: ~A~%" (-> obj check-done)) - (format #t "~1Twhich-spot: ~D~%" (-> obj which-spot)) - (format #t "~1Tnum-spots: ~D~%" (-> obj num-spots)) - (format #t "~1Tspot-indexes[4] @ #x~X~%" (-> obj spot-indexes)) - (format #t "~1Tactor-index: ~D~%" (-> obj actor-index)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[4] @ #x~X~%" (-> this spot-indexes)) + (format #t "~1Tactor-index: ~D~%" (-> this actor-index)) (label cfg-4) - obj + this ) ;; definition of type sigt-fight-focus @@ -464,19 +464,19 @@ ) ;; definition for method 3 of type sigt-fight-focus -(defmethod inspect sigt-fight-focus ((obj sigt-fight-focus)) - (when (not obj) - (set! obj obj) +(defmethod inspect sigt-fight-focus ((this sigt-fight-focus)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) (label cfg-4) - obj + this ) ;; definition of type sigt-repair-gun @@ -488,19 +488,19 @@ ) ;; definition for method 3 of type sigt-repair-gun -(defmethod inspect sigt-repair-gun ((obj sigt-repair-gun)) - (when (not obj) - (set! obj obj) +(defmethod inspect sigt-repair-gun ((this sigt-repair-gun)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnext: ~A~%" (-> obj next)) - (format #t "~1Tprev: ~A~%" (-> obj prev)) - (format #t "~1Tpool: ~A~%" (-> obj pool)) - (format #t "~1Tunique-id: ~D~%" (-> obj unique-id)) - (format #t "~1Tbytes[16] @ #x~X~%" (-> obj bytes)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc index 75d6444c66..81f8b33e5f 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-plasma_REF.gc @@ -142,17 +142,18 @@ ) ;; definition for method 14 of type sig-plasma -(defmethod sig-plasma-method-14 sig-plasma ((obj sig-plasma) (arg0 process-focusable)) - (let* ((f0-0 (-> obj level)) +;; WARN: Return type mismatch object vs none. +(defmethod sig-plasma-method-14 sig-plasma ((this sig-plasma) (arg0 process-focusable)) + (let* ((f0-0 (-> this level)) (f30-0 (cond - ((logtest? (-> obj flags) (plasma-flags pf01)) - (seek f0-0 1.0 (* (-> obj charge-speed) (seconds-per-frame))) + ((logtest? (-> this flags) (plasma-flags pf01)) + (seek f0-0 1.0 (* (-> this charge-speed) (seconds-per-frame))) ) (else - (let ((f1-1 (-> obj min-level))) + (let ((f1-1 (-> this min-level))) (when (< f0-0 f1-1) (set! f1-1 f0-0) - (set! (-> obj min-level) f1-1) + (set! (-> this min-level) f1-1) ) (seek f0-0 f1-1 (* 0.25 (seconds-per-frame))) ) @@ -160,12 +161,12 @@ ) ) ) - (set! (-> obj level) f30-0) + (set! (-> this level) f30-0) (cond ((= f30-0 0.0) (let ((v1-9 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-9 command) (sound-command set-param)) - (set! (-> v1-9 id) (-> obj powerup-sound-id)) + (set! (-> v1-9 id) (-> this powerup-sound-id)) (set! (-> v1-9 params volume) -4) (set! (-> v1-9 auto-time) 24) (set! (-> v1-9 auto-from) 2) @@ -174,7 +175,7 @@ ) (let ((v1-11 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-11 command) (sound-command set-param)) - (set! (-> v1-11 id) (-> obj plasma-sound-id)) + (set! (-> v1-11 id) (-> this plasma-sound-id)) (set! (-> v1-11 params volume) -4) (set! (-> v1-11 auto-time) 24) (set! (-> v1-11 auto-from) 2) @@ -190,7 +191,7 @@ (let ((f28-0 (+ 0.25 (* 0.75 f30-0)))) (sound-play-by-name (static-sound-name "sig-gun-powerup") - (-> obj powerup-sound-id) + (-> this powerup-sound-id) (the int (* 1024.0 f28-0)) (the int (* 1524.0 (+ 0.5 (* 0.5 f30-0)))) 0 @@ -199,7 +200,7 @@ ) (sound-play-by-name (static-sound-name "sig-gun-plasma") - (-> obj plasma-sound-id) + (-> this plasma-sound-id) (the int (* 1024.0 f28-0)) (the int (* 1524.0 (rand-vu-float-range -1.0 1.0))) 0 @@ -228,50 +229,50 @@ ;; definition for method 12 of type sig-plasma ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-12 sig-plasma ((obj sig-plasma)) - (let ((f0-0 (-> obj level))) - (-> obj min-level) +(defmethod sig-plasma-method-12 sig-plasma ((this sig-plasma)) + (let ((f0-0 (-> this level))) + (-> this min-level) (when (>= f0-0 1.0) (set! f0-0 0.99) - (set! (-> obj level) f0-0) + (set! (-> this level) f0-0) ) - (set! (-> obj min-level) (fmax 0.0 (+ -0.5 f0-0))) + (set! (-> this min-level) (fmax 0.0 (+ -0.5 f0-0))) ) - (logclear! (-> obj flags) (plasma-flags pf01 pf02 pf04)) + (logclear! (-> this flags) (plasma-flags pf01 pf02 pf04)) (none) ) ;; definition for method 11 of type sig-plasma ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-11 sig-plasma ((obj sig-plasma) (arg0 symbol)) - (set! (-> obj min-level) 0.0) +(defmethod sig-plasma-method-11 sig-plasma ((this sig-plasma) (arg0 symbol)) + (set! (-> this min-level) 0.0) (cond (arg0 - (set! (-> obj level) 0.0) + (set! (-> this level) 0.0) ) (else - (if (>= (-> obj level) 1.0) - (set! (-> obj level) 0.99) + (if (>= (-> this level) 1.0) + (set! (-> this level) 0.99) ) ) ) - (logclear! (-> obj flags) (plasma-flags pf00 pf01 pf02 pf04)) + (logclear! (-> this flags) (plasma-flags pf00 pf01 pf02 pf04)) (none) ) ;; definition for method 9 of type sig-plasma ;; WARN: Return type mismatch plasma-flags vs none. -(defmethod sig-plasma-method-9 sig-plasma ((obj sig-plasma)) - (logior! (-> obj flags) (plasma-flags pf03)) +(defmethod sig-plasma-method-9 sig-plasma ((this sig-plasma)) + (logior! (-> this flags) (plasma-flags pf03)) (none) ) ;; definition for method 10 of type sig-plasma -(defmethod sig-plasma-method-10 sig-plasma ((obj sig-plasma)) - (logtest? (-> obj flags) (plasma-flags pf02)) +(defmethod sig-plasma-method-10 sig-plasma ((this sig-plasma)) + (logtest? (-> this flags) (plasma-flags pf02)) ) ;; definition for method 13 of type sig-plasma -(defmethod sig-plasma-method-13 sig-plasma ((obj sig-plasma)) - (and (logtest? (-> obj flags) (plasma-flags pf03)) (logtest? (-> obj flags) (plasma-flags pf04))) +(defmethod sig-plasma-method-13 sig-plasma ((this sig-plasma)) + (and (logtest? (-> this flags) (plasma-flags pf03)) (logtest? (-> this flags) (plasma-flags pf04))) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-shot_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-shot_REF.gc index 3ad6880f40..42d86a3fa2 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-shot_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-shot_REF.gc @@ -264,25 +264,25 @@ ) ;; definition for method 3 of type sig-shot -(defmethod inspect sig-shot ((obj sig-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig-shot ((this sig-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttail-pos: #~%" (-> obj tail-pos)) - (format #t "~2Thit-pos: #~%" (-> obj hit-pos)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (format #t "~2Thit-pos: #~%" (-> this hit-pos)) (label cfg-4) - obj + this ) ;; definition for method 24 of type sig-shot ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight sig-shot ((obj sig-shot)) +(defmethod draw-laser-sight sig-shot ((this sig-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 655) (-> obj tail-pos) (-> obj starting-dir) #f #t) + (draw-beam (-> *part-id-table* 655) (-> this tail-pos) (-> this starting-dir) #f #t) 0 (none) ) @@ -290,7 +290,7 @@ ;; definition for method 25 of type sig-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles sig-shot ((obj sig-shot)) +(defmethod spawn-impact-particles sig-shot ((this sig-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -300,8 +300,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((v1-1 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((v1-1 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) (gp-0 (new 'stack-no-clear 'vector)) ) @@ -348,7 +348,7 @@ ;; definition for method 26 of type sig-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles sig-shot ((obj sig-shot)) +(defmethod spawn-shell-particles sig-shot ((this sig-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -370,7 +370,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -391,7 +391,7 @@ ;; definition for method 28 of type sig-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound sig-shot ((obj sig-shot) (arg0 projectile-options)) +(defmethod play-impact-sound sig-shot ((this sig-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -407,16 +407,16 @@ ) ;; definition for method 38 of type sig-shot -(defmethod made-impact? sig-shot ((obj sig-shot)) +(defmethod made-impact? sig-shot ((this sig-shot)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a1-0 t1-0)) (set! (-> a1-0 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a1-0 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a1-0 ignore-process0) obj) - (set! (-> a1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a1-0 ignore-process0) this) + (set! (-> a1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-0 action-mask) (collide-action solid)) ) @@ -456,9 +456,9 @@ ;; definition for method 30 of type sig-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! sig-shot ((obj sig-shot)) +(defmethod init-proj-collision! sig-shot ((this sig-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -499,9 +499,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (let ((v1-22 (-> obj parent))) + (let ((v1-22 (-> this parent))) (when (not (logtest? (-> (the-as sig (if v1-22 (the-as sig (-> v1-22 0 self)) ) @@ -511,7 +511,7 @@ (bot-flags attacked) ) ) - (let* ((a0-16 (-> obj root)) + (let* ((a0-16 (-> this root)) (v1-27 (-> a0-16 root-prim)) ) (countdown (a0-17 (-> a0-16 total-prims)) @@ -521,7 +521,7 @@ ) ) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) @@ -530,12 +530,12 @@ ;; definition for method 31 of type sig-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! sig-shot ((obj sig-shot)) +(defmethod init-proj-settings! sig-shot ((this sig-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj max-speed) 307200.0) - (set! (-> obj move) sig-shot-move) - (set! (-> obj timeout) (seconds 1.335)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this max-speed) 307200.0) + (set! (-> this move) sig-shot-move) + (set! (-> this timeout) (seconds 1.335)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc index 74f1678af3..351298b9ba 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-states_REF.gc @@ -6,7 +6,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -60,7 +60,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -155,7 +155,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -197,7 +197,7 @@ ) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (or (not (-> self focus-info fproc)) (>= (-> self focus-info bullseye-xz-dist) 102400.0)) ) (go-virtual waiting-far) @@ -277,7 +277,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -457,7 +457,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -591,7 +591,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -621,7 +621,7 @@ ) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) (zero? (-> self played-unjam-time))) - (set! (-> self played-unjam-time) (current-time)) + (set-time! (-> self played-unjam-time)) (sound-play "sig-gun-unjam") ) ) @@ -641,7 +641,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -654,7 +654,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -666,7 +666,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -678,7 +678,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -690,7 +690,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -702,7 +702,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -715,7 +715,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -728,7 +728,7 @@ (ja :num! (seek!)) ) (when (and (logtest? (bot-flags bf21) (-> self bot-flags)) - (>= (- (current-time) (-> self played-unjam-time)) (seconds 0.35)) + (time-elapsed? (-> self played-unjam-time) (seconds 0.35)) ) (logclear! (-> self bot-flags) (bot-flags bf19 bf21)) (go-virtual waiting-close) @@ -744,7 +744,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -837,7 +837,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -870,10 +870,10 @@ ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) (go-virtual waiting-close) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (bot-method-208 self)) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-208 self)) (go-virtual traveling-blocked) ) - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ) @@ -904,7 +904,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -931,7 +931,7 @@ ((sig-method-255 self) (go-virtual repair-gun) ) - ((and (>= (- (current-time) (-> self state-time)) (seconds 1)) (not (bot-method-208 self))) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-208 self))) (go-virtual traveling) ) ) @@ -968,7 +968,7 @@ ) :trans (behavior () (bot-method-223 self #f) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (when (bot-method-214 self) (cond ((sig-method-246 self) @@ -1182,7 +1182,7 @@ (until (ja-done? 0) (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 131072.0 (seconds 0.05)) (bot-method-223 self #t) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.1)) (or (not (bot-method-214 self)) (not (sig-method-245 self))) ) (react-to-focus self) @@ -1224,7 +1224,7 @@ :trans (behavior () (bot-method-223 self #t) (cond - ((and (nav-enemy-method-163 self) (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + ((and (nav-enemy-method-163 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) (go-stare2 self) ) ((not (bot-method-214 self)) @@ -1292,7 +1292,7 @@ 0.0 #f ) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.167)) + (until (time-elapsed? (-> self state-time) (seconds 0.167)) (sig-method-258 self) (suspend) ) @@ -1322,7 +1322,7 @@ ) ) ) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.8)) + (until (time-elapsed? (-> self state-time) (seconds 0.8)) (sig-method-258 self) (suspend) ) @@ -1457,12 +1457,12 @@ (ja :num! (seek!)) ) (ja-channel-push! 1 (seconds 0.2)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) @@ -1480,7 +1480,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1540,7 +1540,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1569,7 +1569,7 @@ (if (logtest? s5-0 2) (go-virtual sig-path-shoot-jump) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.05)) (not (logtest? s5-0 4))) + (if (and (time-elapsed? (-> self state-time) (seconds 0.05)) (not (logtest? s5-0 4))) (go-virtual sig-path-jump-land) ) ) @@ -1607,7 +1607,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1668,7 +1668,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1698,7 +1698,7 @@ (if (and (logtest? s5-0 1) (logtest? (bot-flags bf25) (-> self bot-flags))) (go-virtual sig-path-jump) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.05)) (not (logtest? s5-0 4))) + (if (and (time-elapsed? (-> self state-time) (seconds 0.05)) (not (logtest? s5-0 4))) (go-virtual sig-path-shoot-jump-land) ) ) @@ -1741,7 +1741,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1802,7 +1802,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-task_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-task_REF.gc index dc41e025a8..4d6951daed 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig-task_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig-task_REF.gc @@ -3,43 +3,43 @@ ;; definition for method 9 of type sigt-wait-spot ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! sigt-wait-spot ((obj sigt-wait-spot)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! sigt-wait-spot ((this sigt-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type sigt-wait-spot -(defmethod ai-task-method-11 sigt-wait-spot ((obj sigt-wait-spot) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 sigt-wait-spot ((this sigt-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) (set! s4-0 -1) ) ) ) (when (< s4-0 0) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - (when (not ((-> obj check-done) obj (the-as sig arg0))) + (when (not ((-> this check-done) this (the-as sig arg0))) (let ((a1-10 (handle->process (-> arg0 focus handle)))) (cond ((and a1-10 @@ -60,14 +60,15 @@ ) ;; definition for method 11 of type sigt-fight-focus -(defmethod ai-task-method-11 sigt-fight-focus ((obj sigt-fight-focus) (arg0 bot)) +;; WARN: Return type mismatch object vs none. +(defmethod ai-task-method-11 sigt-fight-focus ((this sigt-fight-focus) (arg0 bot)) (let ((a1-1 (handle->process (-> arg0 focus handle)))) (if (and a1-1 (attacked-by-player? arg0 (the-as process-focusable a1-1)) (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) ) (logior! (-> arg0 bot-flags) (bot-flags bf00)) - (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + (ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0) ) ) (none) @@ -75,16 +76,16 @@ ;; definition for method 10 of type sigt-fight-focus ;; WARN: Return type mismatch bot-flags vs none. -(defmethod ai-task-method-10 sigt-fight-focus ((obj sigt-fight-focus) (arg0 bot)) +(defmethod ai-task-method-10 sigt-fight-focus ((this sigt-fight-focus) (arg0 bot)) (logclear! (-> arg0 bot-flags) (bot-flags bf00)) (none) ) ;; definition for method 11 of type sigt-repair-gun -(defmethod ai-task-method-11 sigt-repair-gun ((obj sigt-repair-gun) (arg0 bot)) +(defmethod ai-task-method-11 sigt-repair-gun ((this sigt-repair-gun) (arg0 bot)) (cond ((not (logtest? (bot-flags bf19) (-> arg0 bot-flags))) - (ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0) + (ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0) ) (else (let ((a1-4 (handle->process (-> arg0 focus handle)))) @@ -102,9 +103,9 @@ ) ;; definition for method 14 of type sigt-choose-piston -(defmethod sigt-choose-piston-method-14 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig) (arg1 int)) - (let* ((v1-2 (-> arg0 course spots (-> obj spot-indexes arg1))) - (a0-6 (-> arg0 actor-group 0 data (-> obj actor-indexes arg1) actor)) +(defmethod sigt-choose-piston-method-14 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig) (arg1 int)) + (let* ((v1-2 (-> arg0 course spots (-> this spot-indexes arg1))) + (a0-6 (-> arg0 actor-group 0 data (-> this actor-indexes arg1) actor)) (gp-0 (if a0-6 (-> a0-6 extra process) ) @@ -120,29 +121,29 @@ ;; definition for method 13 of type sigt-choose-piston ;; WARN: Return type mismatch int vs none. -(defmethod sigt-choose-piston-method-13 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig)) +(defmethod sigt-choose-piston-method-13 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig)) (let ((s4-0 0)) (let ((f30-0 -1.0) (s3-0 (-> arg0 root trans)) ) - (countdown (s2-0 (-> obj num-spots)) - (let* ((v1-3 (-> obj spot-indexes s2-0)) + (countdown (s2-0 (-> this num-spots)) + (let* ((v1-3 (-> this spot-indexes s2-0)) (f28-0 (vector-vector-xz-distance s3-0 (the-as vector (-> arg0 course spots v1-3)))) ) - (when (and (or (< f30-0 0.0) (< f28-0 f30-0)) (not (sigt-choose-piston-method-14 obj arg0 (the-as int s2-0)))) + (when (and (or (< f30-0 0.0) (< f28-0 f30-0)) (not (sigt-choose-piston-method-14 this arg0 (the-as int s2-0)))) (set! f30-0 f28-0) (set! s4-0 (the-as int s2-0)) ) ) ) ) - (set! (-> obj which-spot) s4-0) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> arg0 spot)) - (the-as pointer (-> arg0 course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) 20 ) - (let* ((v1-22 (-> arg0 actor-group 0 data (-> obj actor-indexes s4-0) actor)) + (let* ((v1-22 (-> arg0 actor-group 0 data (-> this actor-indexes s4-0) actor)) (a0-6 (if v1-22 (-> v1-22 extra process) ) @@ -158,12 +159,12 @@ ;; definition for method 12 of type sigt-choose-piston ;; INFO: Used lq/sq -(defmethod sigt-choose-piston-method-12 sigt-choose-piston ((obj sigt-choose-piston) (arg0 sig)) +(defmethod sigt-choose-piston-method-12 sigt-choose-piston ((this sigt-choose-piston) (arg0 sig)) (with-pp (when (and (outside-spot-radius? arg0 (the-as bot-spot #f) (the-as vector #f) #f) - (not (sigt-choose-piston-method-14 obj arg0 (-> obj which-spot))) + (not (sigt-choose-piston-method-14 this arg0 (-> this which-spot))) ) - (let* ((v1-12 (-> arg0 actor-group 0 data (-> obj actor-indexes (-> obj which-spot)) actor)) + (let* ((v1-12 (-> arg0 actor-group 0 data (-> this actor-indexes (-> this which-spot)) actor)) (s5-1 (if v1-12 (-> v1-12 extra process) ) @@ -211,35 +212,35 @@ ;; definition for method 9 of type sigt-choose-piston ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! sigt-choose-piston ((obj sigt-choose-piston)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! sigt-choose-piston ((this sigt-choose-piston)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type sigt-choose-piston -(defmethod ai-task-method-11 sigt-choose-piston ((obj sigt-choose-piston) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 sigt-choose-piston ((this sigt-choose-piston) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (cond ((< s4-0 0) - (sigt-choose-piston-method-13 obj (the-as sig arg0)) + (sigt-choose-piston-method-13 this (the-as sig arg0)) ) - ((sigt-choose-piston-method-14 obj (the-as sig arg0) s4-0) - (sigt-choose-piston-method-13 obj (the-as sig arg0)) + ((sigt-choose-piston-method-14 this (the-as sig arg0) s4-0) + (sigt-choose-piston-method-13 this (the-as sig arg0)) ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - (when (not ((-> obj check-done) obj (the-as sig arg0))) + (when (not ((-> this check-done) this (the-as sig arg0))) (let ((a1-6 (handle->process (-> arg0 focus handle)))) (when (and a1-6 (attacked-by-player? arg0 (the-as process-focusable a1-6)) @@ -254,15 +255,15 @@ ) ;; definition for method 10 of type sigt-choose-piston -(defmethod ai-task-method-10 sigt-choose-piston ((obj sigt-choose-piston) (arg0 bot)) +(defmethod ai-task-method-10 sigt-choose-piston ((this sigt-choose-piston) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) ;; definition for method 12 of type sigt-riding-piston -(defmethod sigt-riding-piston-method-12 sigt-riding-piston ((obj sigt-riding-piston) (arg0 sig)) +(defmethod sigt-riding-piston-method-12 sigt-riding-piston ((this sigt-riding-piston) (arg0 sig)) (with-pp - (when (not (player-blocking-spot? arg0 (-> arg0 course spots (-> obj spot-indexes (-> obj which-spot))))) + (when (not (player-blocking-spot? arg0 (-> arg0 course spots (-> this spot-indexes (-> this which-spot))))) (let* ((v1-9 (-> arg0 actor-group 0 data (-> arg0 platform-index) actor)) (a0-4 (if v1-9 (-> v1-9 extra process) @@ -285,7 +286,7 @@ (set! (-> v1-19 target-speed) 0.0) ) 0 - (let ((s5-1 (-> arg0 course spots (-> obj spot-indexes (-> obj which-spot))))) + (let ((s5-1 (-> arg0 course spots (-> this spot-indexes (-> this which-spot))))) (set! (-> arg0 enemy-flags) (the-as enemy-flag (logclear (-> arg0 enemy-flags) (enemy-flag vulnerable)))) (when (send-event arg0 'jump 0 (-> s5-1 center)) (mem-copy! (the-as pointer (-> arg0 spot)) (the-as pointer s5-1) 20) @@ -304,62 +305,62 @@ ;; definition for method 9 of type sigt-riding-piston ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! sigt-riding-piston ((obj sigt-riding-piston)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! sigt-riding-piston ((this sigt-riding-piston)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type sigt-riding-piston ;; WARN: Return type mismatch symbol vs none. -(defmethod ai-task-method-11 sigt-riding-piston ((obj sigt-riding-piston) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) - (when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> obj spot-indexes s4-0)))) - (set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes)))) - (set! (-> obj which-spot) s4-0) +(defmethod ai-task-method-11 sigt-riding-piston ((this sigt-riding-piston) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) + (when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> this spot-indexes s4-0)))) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (the-as (pointer uint) (-> this spot-indexes)))) + (set! (-> this which-spot) s4-0) (send-event (ppointer->process (-> arg0 my-simple-focus)) 'move-trans - (-> arg0 course spots (-> obj spot-indexes s4-0)) + (-> arg0 course spots (-> this spot-indexes s4-0)) ) (set! (-> arg0 poi-handle) (ppointer->handle (-> arg0 my-simple-focus))) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere arg0 - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) ) - ((-> obj check-done) obj (the-as sig arg0)) + ((-> this check-done) this (the-as sig arg0)) (none) ) ;; definition for method 10 of type sigt-riding-piston -(defmethod ai-task-method-10 sigt-riding-piston ((obj sigt-riding-piston) (arg0 bot)) +(defmethod ai-task-method-10 sigt-riding-piston ((this sigt-riding-piston) (arg0 bot)) (clear-poi-and-focus! arg0) (none) ) ;; definition for method 9 of type sigt-charge-plasma ;; WARN: Return type mismatch int vs none. -(defmethod reset-task! sigt-charge-plasma ((obj sigt-charge-plasma)) - (set! (-> obj check-done) #f) - (set! (-> obj which-spot) -1) - (set! (-> obj num-spots) (the-as uint 0)) +(defmethod reset-task! sigt-charge-plasma ((this sigt-charge-plasma)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type sigt-charge-plasma -(defmethod ai-task-method-11 sigt-charge-plasma ((obj sigt-charge-plasma) (arg0 bot)) - (let ((s4-0 (-> obj which-spot))) +(defmethod ai-task-method-11 sigt-charge-plasma ((this sigt-charge-plasma) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) (when (>= s4-0 0) - (let ((s3-0 (-> (the-as sig arg0) course spots (-> obj spot-indexes s4-0)))) + (let ((s3-0 (-> (the-as sig arg0) course spots (-> this spot-indexes s4-0)))) (if (and (not (outside-spot-radius? (the-as sig arg0) s3-0 (the-as vector #f) #f)) (player-blocking-spot? (the-as sig arg0) s3-0) ) @@ -369,24 +370,28 @@ ) (when (< s4-0 0) (set! s4-0 - (choose-spot (the-as sig arg0) (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes))) + (choose-spot + (the-as sig arg0) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + ) ) - (set! (-> obj which-spot) s4-0) + (set! (-> this which-spot) s4-0) (mem-copy! (the-as pointer (-> (the-as sig arg0) spot)) - (the-as pointer (-> (the-as sig arg0) course spots (-> obj spot-indexes s4-0))) + (the-as pointer (-> (the-as sig arg0) course spots (-> this spot-indexes s4-0))) 20 ) ) (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) (bot-debug-draw-spot-sphere (the-as sig arg0) - (the-as int (-> obj num-spots)) - (the-as (pointer uint) (-> obj spot-indexes)) - (the-as int (-> obj spot-indexes s4-0)) + (the-as int (-> this num-spots)) + (the-as (pointer uint) (-> this spot-indexes)) + (the-as int (-> this spot-indexes s4-0)) ) ) - (let* ((v1-24 (-> (the-as sig arg0) actor-group 0 data (-> obj actor-index) actor)) + (let* ((v1-24 (-> (the-as sig arg0) actor-group 0 data (-> this actor-index) actor)) (s3-1 (when v1-24 (let ((s2-0 (-> v1-24 extra process))) (if (type? s2-0 process-focusable) @@ -400,7 +405,7 @@ (s3-1 (set! (-> (the-as sig arg0) poi-handle) (process->handle s3-1)) (set! (-> (the-as sig arg0) focus-mode) 1) - (let ((a1-10 (-> (the-as sig arg0) course spots (-> obj spot-indexes s4-0)))) + (let ((a1-10 (-> (the-as sig arg0) course spots (-> this spot-indexes s4-0)))) (if (and (outside-spot-radius? (the-as sig arg0) a1-10 (the-as vector #f) #f) (enemy-method-95 (the-as sig arg0) (get-trans (the-as process-focusable s3-1) 3) 10012.445) ) @@ -418,7 +423,7 @@ ) ) ) - (when (not ((-> obj check-done) obj (the-as sig arg0))) + (when (not ((-> this check-done) this (the-as sig arg0))) (let ((a1-14 (handle->process (-> (the-as sig arg0) focus handle)))) (when (and a1-14 (attacked-by-player? (the-as sig arg0) (the-as process-focusable a1-14)) @@ -434,7 +439,7 @@ ;; definition for method 10 of type sigt-charge-plasma ;; WARN: Return type mismatch int vs none. -(defmethod ai-task-method-10 sigt-charge-plasma ((obj sigt-charge-plasma) (arg0 bot)) +(defmethod ai-task-method-10 sigt-charge-plasma ((this sigt-charge-plasma) (arg0 bot)) (clear-poi-and-focus! (the-as sig arg0)) (logclear! (-> (the-as sig arg0) plasma flags) (plasma-flags pf00)) (set! (-> (the-as sig arg0) focus-mode) 0) diff --git a/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc b/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc index 71dce694a3..8dc1e7888b 100644 --- a/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/ai/sig/sig_REF.gc @@ -12,15 +12,15 @@ ) ;; definition for method 3 of type sig-anim-info -(defmethod inspect sig-anim-info ((obj sig-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig-anim-info ((this sig-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'sig-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "[~8x] ~A~%" this 'sig-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) (label cfg-4) - obj + this ) ;; definition of type sig-global-info @@ -34,16 +34,16 @@ ) ;; definition for method 3 of type sig-global-info -(defmethod inspect sig-global-info ((obj sig-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig-global-info ((this sig-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) (label cfg-4) - obj + this ) ;; definition for symbol *sig-global-info*, type sig-global-info @@ -259,8 +259,8 @@ ) ;; definition for method 97 of type sig -(defmethod enemy-method-97 sig ((obj sig)) - (let* ((s5-0 (handle->process (-> obj attacker-handle))) +(defmethod enemy-method-97 sig ((this sig)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) (s4-0 (if (type? s5-0 process-focusable) s5-0 ) @@ -269,46 +269,46 @@ (when s4-0 (cond ((= (-> s4-0 type) target) - (when (or (not (logtest? (-> obj bot-flags) (bot-flags attacked))) - (>= (- (current-time) (-> obj attacker-time)) (seconds 1.5)) + (when (or (not (logtest? (-> this bot-flags) (bot-flags attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) ) - (if (logtest? (-> obj bot-flags) (bot-flags attacked)) - (reset-attacker! obj) + (if (logtest? (-> this bot-flags) (bot-flags attacked)) + (reset-attacker! this) ) (set! s4-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) (else - (when (>= (- (current-time) (-> obj attacker-time)) (seconds 6)) + (when (time-elapsed? (-> this attacker-time) (seconds 6)) (set! s4-0 (the-as process #f)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) ) ) - (let ((v1-23 (-> obj focus-mode)) + (let ((v1-23 (-> this focus-mode)) (s5-1 (the-as process #f)) ) (cond ((zero? v1-23) (cond (s4-0 - (if (or (not (logtest? (bot-flags bf19) (-> obj bot-flags))) - (>= 16384.0 (vector-vector-xz-distance (-> obj root trans) (get-trans (the-as process-focusable s4-0) 3))) + (if (or (not (logtest? (bot-flags bf19) (-> this bot-flags))) + (>= 16384.0 (vector-vector-xz-distance (-> this root trans) (get-trans (the-as process-focusable s4-0) 3))) ) (set! s5-1 s4-0) ) ) (else - (when (not (logtest? (bot-flags bf19) (-> obj bot-flags))) - (set! s5-1 (select-focus! obj)) + (when (not (logtest? (bot-flags bf19) (-> this bot-flags))) + (set! s5-1 (select-focus! this)) (cond (s5-1 (empty) ) (else - (let ((s4-1 (handle->process (-> obj poi-handle)))) + (let ((s4-1 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-1 process-focusable) s4-1 ) @@ -327,15 +327,15 @@ ((= v1-23 1) (cond (s4-0 - (if (or (not (logtest? (bot-flags bf19) (-> obj bot-flags))) - (>= 16384.0 (vector-vector-xz-distance (-> obj root trans) (get-trans (the-as process-focusable s4-0) 3))) + (if (or (not (logtest? (bot-flags bf19) (-> this bot-flags))) + (>= 16384.0 (vector-vector-xz-distance (-> this root trans) (get-trans (the-as process-focusable s4-0) 3))) ) (set! s5-1 s4-0) ) ) (else - (when (not (logtest? (bot-flags bf19) (-> obj bot-flags))) - (let ((s4-2 (handle->process (-> obj poi-handle)))) + (when (not (logtest? (bot-flags bf19) (-> this bot-flags))) + (let ((s4-2 (handle->process (-> this poi-handle)))) (set! s5-1 (if (type? s4-2 process-focusable) s4-2 ) @@ -345,7 +345,7 @@ (s5-1 (empty) ) - ((begin (set! s5-1 (select-focus! obj)) s5-1) + ((begin (set! s5-1 (select-focus! this)) s5-1) (empty) ) (else @@ -359,14 +359,16 @@ ) (cond (s5-1 - (try-update-focus (-> obj focus) (the-as process-focusable s5-1) obj) - (if (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (!= (-> (the-as process-focusable s5-1) type) target)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flags attacked)) + (!= (-> (the-as process-focusable s5-1) type) target) + ) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) (else - (clear-focused (-> obj focus)) - (logclear! (-> obj bot-flags) (bot-flags attacked)) + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flags attacked)) ) ) s5-1 @@ -375,47 +377,44 @@ ) ;; definition for method 74 of type sig -;; WARN: Return type mismatch none vs object. -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 33] -;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 38] -(defmethod general-event-handler sig ((obj sig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler sig ((this sig) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('untrigger) - (sig-plasma-method-11 (-> obj plasma) #t) + (sig-plasma-method-11 (-> this plasma) #t) ) (('sig-path) - (when (and (not (focus-test? obj dead)) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) + (when (and (not (focus-test? this dead)) (nonzero? (-> this hit-points)) (zero? (-> this fated-time))) (let ((a1-2 (-> arg3 param 0))) - (sig-method-249 obj (the-as sig-path a1-2)) + (sig-method-249 this (the-as sig-path a1-2)) ) - (go (method-of-object obj sig-path-run)) + (go (method-of-object this sig-path-run)) ) ) (else - ((method-of-type bot general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type bot general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 55 of type sig -(defmethod track-target! sig ((obj sig)) +(defmethod track-target! sig ((this sig)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (let ((v1-2 (-> obj skel top-anim frame-group))) + (let ((v1-2 (-> this skel top-anim frame-group))) (cond - ((>= (- (current-time) (-> obj danger-time)) (seconds 2)) + ((time-elapsed? (-> this danger-time) (seconds 2)) (cond ((not v1-2) - (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) + (set! (-> this skel top-anim base-anim) (-> this draw art-group data 42)) ) - ((= v1-2 (-> obj draw art-group data 44)) + ((= v1-2 (-> this draw art-group data 44)) (push-anim-to-targ - (-> obj skel top-anim) - (the-as art-joint-anim (-> obj draw art-group data 46)) + (-> this skel top-anim) + (the-as art-joint-anim (-> this draw art-group data 46)) 0.0 0 0 @@ -423,19 +422,19 @@ 0.0 #f ) - (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) + (set! (-> this skel top-anim base-anim) (-> this draw art-group data 42)) ) ) ) (else (cond ((not v1-2) - (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 44)) + (set! (-> this skel top-anim base-anim) (-> this draw art-group data 44)) ) - ((= v1-2 (-> obj draw art-group data 42)) + ((= v1-2 (-> this draw art-group data 42)) (push-anim-to-targ - (-> obj skel top-anim) - (the-as art-joint-anim (-> obj draw art-group data 43)) + (-> this skel top-anim) + (the-as art-joint-anim (-> this draw art-group data 43)) 0.0 0 0 @@ -443,40 +442,40 @@ 0.0 #f ) - (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 44)) + (set! (-> this skel top-anim base-anim) (-> this draw art-group data 44)) ) ) ) ) ) (let ((t9-2 (method-of-type bot track-target!))) - (t9-2 obj) + (t9-2 this) ) - (when (logtest? (-> obj bot-flags) (bot-flags too-far-fail)) - (let ((f0-0 (vector-vector-distance (-> obj root trans) (target-pos 0)))) - (when (or (>= f0-0 491520.0) (and (>= f0-0 102400.0) (>= (- (current-time) (-> obj last-draw-time)) (seconds 10)))) - (process-entity-status! obj (entity-perm-status no-kill) #f) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (when (logtest? (-> this bot-flags) (bot-flags too-far-fail)) + (let ((f0-0 (vector-vector-distance (-> this root trans) (target-pos 0)))) + (when (or (>= f0-0 491520.0) (and (>= f0-0 102400.0) (time-elapsed? (-> this last-draw-time) (seconds 10)))) + (process-entity-status! this (entity-perm-status no-kill) #f) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) ) ) - (sig-plasma-method-14 (-> obj plasma) obj) + (sig-plasma-method-14 (-> this plasma) this) (none) ) ;; definition for method 213 of type sig -(defmethod go-to-waypoint! sig ((obj sig) (arg0 int) (arg1 symbol)) +(defmethod go-to-waypoint! sig ((this sig) (arg0 int) (arg1 symbol)) "Start moving to the given [[bot-waypoint]]." - (set! (-> obj plasma charge-speed) 0.125) - ((method-of-type bot go-to-waypoint!) obj arg0 arg1) + (set! (-> this plasma charge-speed) 0.125) + ((method-of-type bot go-to-waypoint!) this arg0 arg1) ) ;; definition for method 10 of type sig -(defmethod deactivate sig ((obj sig)) +(defmethod deactivate sig ((this sig)) (let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-0 command) (sound-command set-param)) - (set! (-> v1-0 id) (-> obj plasma powerup-sound-id)) + (set! (-> v1-0 id) (-> this plasma powerup-sound-id)) (set! (-> v1-0 params volume) -4) (set! (-> v1-0 auto-time) 24) (set! (-> v1-0 auto-from) 2) @@ -485,25 +484,25 @@ ) (let ((v1-2 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-2 command) (sound-command set-param)) - (set! (-> v1-2 id) (-> obj plasma plasma-sound-id)) + (set! (-> v1-2 id) (-> this plasma plasma-sound-id)) (set! (-> v1-2 params volume) -4) (set! (-> v1-2 auto-time) 24) (set! (-> v1-2 auto-from) 2) (set! (-> v1-2 params mask) (the-as uint 17)) (-> v1-2 id) ) - ((method-of-type bot deactivate) obj) + ((method-of-type bot deactivate) this) (none) ) ;; definition for method 46 of type sig ;; WARN: Return type mismatch vector vs none. -(defmethod enemy-method-46 sig ((obj sig) (arg0 int)) +(defmethod enemy-method-46 sig ((this sig) (arg0 int)) "@abstract" (let ((v1-0 arg0)) (cond ((zero? v1-0) - (let ((v1-2 (-> obj root root-prim))) + (let ((v1-2 (-> this root root-prim))) (dotimes (a0-1 4) (let ((a1-3 (-> (the-as collide-shape-prim-group v1-2) child (+ a0-1 3)))) (set! (-> a1-3 prim-core collide-with) (collide-spec)) @@ -514,7 +513,7 @@ ) ) ((= v1-0 3) - (let ((v1-5 (the-as collide-shape-prim-group (-> obj root root-prim)))) + (let ((v1-5 (the-as collide-shape-prim-group (-> this root root-prim)))) (let ((a0-3 (-> v1-5 child 3))) (set! (-> a0-3 prim-core collide-as) (collide-spec bot bot-targetable)) (set! (-> a0-3 prim-core collide-with) @@ -556,9 +555,9 @@ ;; definition for method 114 of type sig ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! sig ((obj sig)) +(defmethod init-enemy-collision! sig ((this sig)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -639,42 +638,42 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 8)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (enemy-method-46 obj 0) + (enemy-method-46 this 0) 0 (none) ) ;; definition for method 115 of type sig ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! sig ((obj sig)) +(defmethod init-enemy! sig ((this sig)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) - (set! (-> obj channel) (the-as uint 21)) - (set! (-> obj notice-enemy-dist) 122880.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj plasma charge-speed) 0.125) - (set! (-> obj plasma powerup-sound-id) (new-sound-id)) - (set! (-> obj plasma plasma-sound-id) (new-sound-id)) - (set! (-> obj focus-info max-los-dist) 102400.0) - (set! (-> obj sig-path) #f) + (init! this) + (set! (-> this channel) (the-as uint 21)) + (set! (-> this notice-enemy-dist) 122880.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this plasma charge-speed) 0.125) + (set! (-> this plasma powerup-sound-id) (new-sound-id)) + (set! (-> this plasma plasma-sound-id) (new-sound-id)) + (set! (-> this focus-info max-los-dist) 102400.0) + (set! (-> this sig-path) #f) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sig" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *sig-nav-enemy-info*) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 147) obj)) - (add-connection *part-engine* obj 23 obj 671 (new 'static 'sphere :y 327.68 :z 7536.64 :r 163840.0)) - (set! (-> obj skel interp-select 0) (the-as int (the-as uint #x1ffc007ffff0))) - (set! (-> obj skel interp-select 1) 0) - (set! (-> obj skel top-anim) (new 'process 'top-anim-joint-control obj)) - (set! (-> obj skel interp-select 0) 0) - (set! (-> obj skel interp-select 1) 0) - (set! (-> obj skel top-anim base-anim) (-> obj draw art-group data 42)) - (set! (-> obj swivel-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4)) - (let ((v1-26 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *sig-nav-enemy-info*) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 147) this)) + (add-connection *part-engine* this 23 this 671 (new 'static 'sphere :y 327.68 :z 7536.64 :r 163840.0)) + (set! (-> this skel interp-select 0) (the-as int (the-as uint #x1ffc007ffff0))) + (set! (-> this skel interp-select 1) 0) + (set! (-> this skel top-anim) (new 'process 'top-anim-joint-control this)) + (set! (-> this skel interp-select 0) 0) + (set! (-> this skel interp-select 1) 0) + (set! (-> this skel top-anim base-anim) (-> this draw art-group data 42)) + (set! (-> this swivel-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) + (let ((v1-26 (-> this neck))) (set! (-> v1-26 up) (the-as uint 1)) (set! (-> v1-26 nose) (the-as uint 2)) (set! (-> v1-26 ear) (the-as uint 0)) @@ -682,128 +681,128 @@ (set! (-> v1-26 ignore-angle) 30947.555) ) (let ((t9-10 (method-of-type bot init-enemy!))) - (t9-10 obj) + (t9-10 this) ) - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) 0 (none) ) ;; definition for method 105 of type sig ;; WARN: Return type mismatch sound-id vs enemy-flag. -(defmethod enemy-method-105 sig ((obj sig) (arg0 process)) +(defmethod enemy-method-105 sig ((this sig) (arg0 process)) (let ((t9-0 (method-of-type bot enemy-method-105))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (the-as enemy-flag (if (and (-> obj next-state) (= (-> obj next-state name) 'whip)) + (the-as enemy-flag (if (and (-> this next-state) (= (-> this next-state name) 'whip)) (sound-play "sig-gun-strike") ) ) ) ;; definition for method 251 of type sig -(defmethod sig-method-251 sig ((obj sig)) - (logtest? (-> obj plasma flags) (plasma-flags pf00)) +(defmethod sig-method-251 sig ((this sig)) + (logtest? (-> this plasma flags) (plasma-flags pf00)) ) ;; definition for method 254 of type sig -(defmethod sig-method-254 sig ((obj sig)) - (logtest? (bot-flags bf22) (-> obj bot-flags)) +(defmethod sig-method-254 sig ((this sig)) + (logtest? (bot-flags bf22) (-> this bot-flags)) ) ;; definition for method 252 of type sig -(defmethod sig-method-252 sig ((obj sig)) - (logtest? (bot-flags bf20) (-> obj bot-flags)) +(defmethod sig-method-252 sig ((this sig)) + (logtest? (bot-flags bf20) (-> this bot-flags)) ) ;; definition for method 255 of type sig -(defmethod sig-method-255 sig ((obj sig)) - (logtest? (bot-flags bf19) (-> obj bot-flags)) +(defmethod sig-method-255 sig ((this sig)) + (logtest? (bot-flags bf19) (-> this bot-flags)) ) ;; definition for method 246 of type sig -(defmethod sig-method-246 sig ((obj sig)) - (>= 16384.0 (-> obj focus-info bullseye-xz-dist)) +(defmethod sig-method-246 sig ((this sig)) + (>= 16384.0 (-> this focus-info bullseye-xz-dist)) ) ;; definition for method 245 of type sig -(defmethod sig-method-245 sig ((obj sig)) - (and (or (and (logtest? (-> obj bot-flags) (bot-flags attacked)) (= (-> obj focus-info fproc type) target)) - (and (>= 40960.0 (-> obj focus-info bullseye-xz-dist)) (= (-> obj focus-info los) 1)) +(defmethod sig-method-245 sig ((this sig)) + (and (or (and (logtest? (-> this bot-flags) (bot-flags attacked)) (= (-> this focus-info fproc type) target)) + (and (>= 40960.0 (-> this focus-info bullseye-xz-dist)) (= (-> this focus-info los) 1)) ) - (not (logtest? (bot-flags bf19) (-> obj bot-flags))) + (not (logtest? (bot-flags bf19) (-> this bot-flags))) ) ) ;; definition for method 70 of type sig -(defmethod go-hostile sig ((obj sig)) - (bot-method-223 obj #t) +(defmethod go-hostile sig ((this sig)) + (bot-method-223 this #t) (cond - ((not (bot-method-214 obj)) - (react-to-focus obj) + ((not (bot-method-214 this)) + (react-to-focus this) ) - ((sig-method-246 obj) - (go (method-of-object obj whip)) + ((sig-method-246 this) + (go (method-of-object this whip)) ) - ((sig-method-245 obj) - (go (method-of-object obj blast)) + ((sig-method-245 this) + (go (method-of-object this blast)) ) (else - (go (method-of-object obj chase)) + (go (method-of-object this chase)) ) ) ) ;; definition for method 72 of type sig -(defmethod react-to-focus sig ((obj sig)) +(defmethod react-to-focus sig ((this sig)) "@TODO - flesh out docs" (cond - ((bot-method-214 obj) - (go-hostile obj) + ((bot-method-214 this) + (go-hostile this) ) - ((sig-method-252 obj) - (go (method-of-object obj gun-jam)) + ((sig-method-252 this) + (go (method-of-object this gun-jam)) ) - ((sig-method-255 obj) - (go (method-of-object obj repair-gun)) + ((sig-method-255 this) + (go (method-of-object this repair-gun)) ) - ((not (outside-spot-radius? obj (the-as bot-spot #f) (the-as vector #f) #f)) - (go (method-of-object obj traveling)) + ((not (outside-spot-radius? this (the-as bot-spot #f) (the-as vector #f) #f)) + (go (method-of-object this traveling)) ) - ((and (-> obj focus-info fproc) (>= (fabs (-> obj focus-info ry-diff)) 9102.223)) - (go (method-of-object obj waiting-turn)) + ((and (-> this focus-info fproc) (>= (fabs (-> this focus-info ry-diff)) 9102.223)) + (go (method-of-object this waiting-turn)) ) - ((sig-method-251 obj) - (go (method-of-object obj charge-plasma)) + ((sig-method-251 this) + (go (method-of-object this charge-plasma)) ) - ((sig-method-254 obj) - (go (method-of-object obj clean-gun)) + ((sig-method-254 this) + (go (method-of-object this clean-gun)) ) (else - (go (method-of-object obj waiting-close)) + (go (method-of-object this waiting-close)) ) ) ) ;; definition for method 116 of type sig ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig ((obj sig)) - (go (method-of-object obj waiting-far)) +(defmethod go-idle sig ((this sig)) + (go (method-of-object this waiting-far)) (none) ) ;; definition for method 247 of type sig ;; INFO: Used lq/sq -(defmethod fire-gun sig ((obj sig) (arg0 vector)) +(defmethod fire-gun sig ((this sig) (arg0 vector)) "Increase gun fired counter and spawn projectile." - (+! (-> obj fired-gun-count) 1) + (+! (-> this fired-gun-count) 1) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options account-for-target-velocity proj-options-8000)) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (let* ((v1-11 *game-info*) (a0-10 (+ (-> v1-11 attack-id) 1)) ) @@ -811,64 +810,64 @@ (set! (-> s5-0 attack-id) a0-10) ) (set! (-> s5-0 timeout) (seconds 4)) - (vector<-cspace! (-> s5-0 pos) (-> obj node-list data 24)) + (vector<-cspace! (-> s5-0 pos) (-> this node-list data 24)) (set! (-> s5-0 vel quad) (-> arg0 quad)) (vector-! (-> s5-0 vel) (-> s5-0 vel) (-> s5-0 pos)) (vector-normalize! (-> s5-0 vel) 307200.0) - (spawn-projectile sig-shot s5-0 obj *default-dead-pool*) + (spawn-projectile sig-shot s5-0 this *default-dead-pool*) ) ) ;; definition for method 258 of type sig ;; WARN: Return type mismatch int vs none. -(defmethod sig-method-258 sig ((obj sig)) +(defmethod sig-method-258 sig ((this sig)) (with-pp - (let ((f30-0 (-> obj nav state speed))) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 16384.0 28672.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-7 (= v1-7 (-> obj draw art-group data 3))) - (let ((v1-12 (-> obj skel root-channel 1))) + ((and v1-7 (= v1-7 (-> this draw art-group data 3))) + (let ((v1-12 (-> this skel root-channel 1))) (set! (-> v1-12 frame-interp 1) f28-0) (set! (-> v1-12 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 28672.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 24.0 (fmax f30-0 f0-8)) (* 30.0 f28-1))) - (a0-10 (-> obj skel root-channel 0)) + (a0-10 (-> this skel root-channel 0)) ) (set! (-> a0-10 param 0) f0-11) (joint-control-channel-group-eval! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-11 (-> obj skel root-channel 1))) + (let ((a0-11 (-> this skel root-channel 1))) (set! (-> a0-11 param 0) 0.0) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 dist) 13107.2) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-13 param 0) 1.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-loop!) ) - (let ((a0-14 (-> obj skel root-channel 1))) + (let ((a0-14 (-> this skel root-channel 1))) (set! (-> a0-14 frame-interp 1) f28-0) (set! (-> a0-14 frame-interp 0) f28-0) (set! (-> a0-14 dist) 22937.6) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 8))) (set! (-> a0-14 param 0) 0.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 8)) num-func-chan) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 8)) num-func-chan) ) ) ) @@ -879,24 +878,24 @@ ) ;; definition for method 77 of type sig -(defmethod enemy-method-77 sig ((obj sig) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 sig ((this sig) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (let* ((v1-3 (enemy-method-120 obj 3 (ash 1 (-> *sig-global-info* prev-blue-hit)))) - (s5-1 (-> obj draw art-group data (-> *sig-global-info* blue-hit-anim v1-3 anim-index))) + (let* ((v1-3 (enemy-method-120 this 3 (ash 1 (-> *sig-global-info* prev-blue-hit)))) + (s5-1 (-> this draw art-group data (-> *sig-global-info* blue-hit-anim v1-3 anim-index))) ) (set! (-> *sig-global-info* prev-blue-hit) v1-3) - (let ((v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-6 (= v1-6 (-> obj draw art-group data 22))) + (if (and v1-6 (= v1-6 (-> this draw art-group data 22))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-15 (-> obj skel root-channel 0))) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-15 param 1) 1.0) @@ -908,14 +907,14 @@ ) (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-18 (-> obj skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-18 (-> this skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-18 param 1) 1.0) (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) #t ) @@ -923,30 +922,30 @@ (let ((s4-0 (new 'stack-no-clear 'vector))) 0.0 0.0 - (vector-z-quaternion! s4-0 (-> obj root quat)) + (vector-z-quaternion! s4-0 (-> this root quat)) (let ((f30-0 (atan (-> s4-0 x) (-> s4-0 z)))) - (enemy-method-50 obj s4-0) + (enemy-method-50 this s4-0) (let* ((f0-14 (atan (-> s4-0 x) (-> s4-0 z))) (f0-15 (deg- f0-14 f30-0)) (f1-0 (fabs f0-15)) (s4-1 (cond ((>= 8192.0 f1-0) - (-> obj draw art-group data 16) + (-> this draw art-group data 16) ) ((>= f1-0 24576.0) - (-> obj draw art-group data 15) + (-> this draw art-group data 15) ) ((< f0-15 0.0) - (-> obj draw art-group data 17) + (-> this draw art-group data 17) ) (else - (-> obj draw art-group data 18) + (-> this draw art-group data 18) ) ) ) ) (ja-channel-push! 1 (seconds 0.03)) - (let ((a0-25 (-> obj skel root-channel 0))) + (let ((a0-25 (-> this skel root-channel 0))) (set! (-> a0-25 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-25 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-25 param 1) (-> arg0 0)) @@ -962,34 +961,34 @@ ) ;; definition for method 78 of type sig -(defmethod enemy-method-78 sig ((obj sig) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 sig ((this sig) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (-> obj draw art-group data 22) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (-> this draw art-group data 22) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) 1.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) ) (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 24))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 24))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 24)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 24)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) 1.0) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 24)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 24)) num-func-seek!) ) #t ) @@ -1000,21 +999,21 @@ ) ;; definition for method 84 of type sig -(defmethod enemy-method-84 sig ((obj sig) (arg0 enemy-jump-info)) - (logclear! (-> obj bot-flags) (bot-flags bf23)) +(defmethod enemy-method-84 sig ((this sig) (arg0 enemy-jump-info)) + (logclear! (-> this bot-flags) (bot-flags bf23)) (let ((f1-0 (vector-vector-xz-distance (-> arg0 dest-pos) (-> arg0 start-pos))) (f2-1 (- (-> arg0 dest-pos y) (-> arg0 start-pos y))) ) 2048.0 (let* ((f0-2 -245760.0) - (v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) (f1-4 (cond - ((or (not (and v1-6 (= v1-6 (-> obj draw art-group data 3)))) (or (= (-> obj jump-why) 4) (>= f2-1 8192.0))) - (logior! (-> obj bot-flags) (bot-flags bf23)) + ((or (not (and v1-6 (= v1-6 (-> this draw art-group data 3)))) (or (= (-> this jump-why) 4) (>= f2-1 8192.0))) + (logior! (-> this bot-flags) (bot-flags bf23)) (let ((f2-3 (fmax 12288.0 (* 0.5 f1-0))) (f1-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) ) @@ -1034,13 +1033,13 @@ ) ;; definition for method 86 of type sig -(defmethod enemy-method-86 sig ((obj sig)) +(defmethod enemy-method-86 sig ((this sig)) (let* ((t9-0 (method-of-type bot enemy-method-86)) - (v0-0 (t9-0 obj)) + (v0-0 (t9-0 this)) ) - (when (and (= (-> obj jump-why) 4) (not v0-0)) - (when (< (-> obj root transv y) 0.0) - (let* ((v1-11 (-> obj actor-group 0 data (-> obj platform-index) actor)) + (when (and (= (-> this jump-why) 4) (not v0-0)) + (when (< (-> this root transv y) 0.0) + (let* ((v1-11 (-> this actor-group 0 data (-> this platform-index) actor)) (a0-5 (if v1-11 (-> v1-11 extra process) ) @@ -1048,10 +1047,10 @@ ) (when a0-5 (let ((s4-0 (-> (the-as process-focusable a0-5) root trans)) - (s5-0 (-> obj root trans)) + (s5-0 (-> this root trans)) ) (when (< 2048.0 (- (-> s4-0 y) (-> s5-0 y))) - (vector-reset! (-> obj root transv)) + (vector-reset! (-> this root transv)) (let ((f30-0 9420.8)) (when (< f30-0 (vector-vector-xz-distance s4-0 s5-0)) (vector-! s5-0 s5-0 s4-0) @@ -1061,9 +1060,9 @@ ) ) (let ((a1-4 (new 'stack-no-clear 'collide-query))) - (find-ground (-> obj root) a1-4 (the-as collide-spec (-> obj gnd-collide)) 8192.0 81920.0 1024.0) + (find-ground (-> this root) a1-4 (the-as collide-spec (-> this gnd-collide)) 8192.0 81920.0 1024.0) ) - (set! (-> s5-0 y) (-> obj root gspot-pos y)) + (set! (-> s5-0 y) (-> this root gspot-pos y)) (set! v0-0 #t) ) ) @@ -1078,31 +1077,31 @@ ;; definition for method 85 of type sig ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs float. -(defmethod enemy-method-85 sig ((obj sig)) +(defmethod enemy-method-85 sig ((this sig)) (rlet ((vf0 :class vf)) (init-vf0-vector) (let ((t9-0 (method-of-type bot enemy-method-85))) - (t9-0 obj) + (t9-0 this) ) (let ((s5-0 (static-sound-spec "sig-jland" :mask (reg0)))) - (set! (-> s5-0 reg 0) (the-as uint (-> obj root ground-pat material))) + (set! (-> s5-0 reg 0) (the-as uint (-> this root ground-pat material))) (sound-play-by-spec s5-0 (new-sound-id) (the-as vector #t)) ) (the-as float (cond - ((logtest? (bot-flags bf23) (-> obj bot-flags)) - (let ((v0-3 (the-as object (-> obj root transv)))) + ((logtest? (bot-flags bf23) (-> this bot-flags)) + (let ((v0-3 (the-as object (-> this root transv)))) (.svf (&-> (the-as vector v0-3) quad) vf0) v0-3 ) ) (else - (let ((v1-9 obj)) + (let ((v1-9 this)) (set! (-> v1-9 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag37) (-> v1-9 enemy-flags)))) ) 0 - (let ((v1-11 obj)) + (let ((v1-11 this)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-11 enemy-flags))) (set! (-> v1-11 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-11 enemy-flags)))) ) @@ -1111,14 +1110,14 @@ ) 0 (let ((s5-1 (new 'stack-no-clear 'vector))) - (set! (-> s5-1 quad) (-> obj root transv quad)) + (set! (-> s5-1 quad) (-> this root transv quad)) (set! (-> s5-1 y) 0.0) - (let ((v1-18 (-> obj nav state))) - (set! (-> v1-18 speed) (fmin (vector-length s5-1) (-> obj nav target-speed))) + (let ((v1-18 (-> this nav state))) + (set! (-> v1-18 speed) (fmin (vector-length s5-1) (-> this nav target-speed))) ) 0 (vector-xz-normalize! s5-1 16384.0) - (let ((v1-21 (-> obj nav state))) + (let ((v1-21 (-> this nav state))) (logior! (-> v1-21 flags) (nav-state-flag directional-mode)) (set! (-> v1-21 travel quad) (-> s5-1 quad)) ) @@ -1132,17 +1131,17 @@ ;; definition for method 89 of type sig ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-89 sig ((obj sig) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 sig ((this sig) (arg0 enemy-jump-info)) (the-as symbol - (when (logtest? (bot-flags bf23) (-> obj bot-flags)) - (let ((a0-2 (-> obj skel root-channel 0))) + (when (logtest? (bot-flags bf23) (-> this bot-flags)) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 param 0) 1.0) (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info jump-wind-up-anim))) - (a0-6 (-> obj skel root-channel 0)) + (let ((a1-3 (-> this draw art-group data (-> this enemy-info jump-wind-up-anim))) + (a0-6 (-> this skel root-channel 0)) ) (set! (-> a0-6 frame-group) (the-as art-joint-anim a1-3)) (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) @@ -1156,17 +1155,17 @@ ;; definition for method 88 of type sig ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-88 sig ((obj sig) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 sig ((this sig) (arg0 enemy-jump-info)) (the-as symbol - (when (logtest? (bot-flags bf23) (-> obj bot-flags)) - (let ((a0-2 (-> obj skel root-channel 0))) + (when (logtest? (bot-flags bf23) (-> this bot-flags)) + (let ((a0-2 (-> this skel root-channel 0))) (set! (-> a0-2 param 0) 1.0) (joint-control-channel-group! a0-2 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-3 (-> obj draw art-group data (-> obj enemy-info jump-land-anim))) - (a0-6 (-> obj skel root-channel 0)) + (let ((a1-3 (-> this draw art-group data (-> this enemy-info jump-land-anim))) + (a0-6 (-> this skel root-channel 0)) ) (set! (-> a0-6 frame-group) (the-as art-joint-anim a1-3)) (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) @@ -1180,51 +1179,51 @@ ;; definition for method 198 of type sig ;; WARN: Return type mismatch float vs meters. -(defmethod set-cam-height! sig ((obj sig) (arg0 vector)) +(defmethod set-cam-height! sig ((this sig) (arg0 vector)) (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'failed)) + ((and (-> this next-state) (= (-> this next-state name) 'failed)) (set-vector! arg0 0.0 4096.0 28672.0 1.0) ) - ((focus-test? obj under-water) + ((focus-test? this under-water) (set-vector! arg0 0.0 12288.0 28672.0 1.0) ) (else (set-vector! arg0 0.0 20480.0 45056.0 1.0) ) ) - (vector<-cspace+vector! arg0 (-> obj node-list data 2) arg0) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) (the-as meters - (if (focus-test? obj under-water) - (set! (-> arg0 y) (+ (get-water-height obj) (-> *setting-control* cam-current target-height))) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) ) ) ) ;; definition for method 216 of type sig ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-216 sig ((obj sig)) - (set! (-> obj health-handle) (ppointer->handle (process-spawn hud-sig :init hud-init-by-other :to obj))) +(defmethod bot-method-216 sig ((this sig)) + (set! (-> this health-handle) (ppointer->handle (process-spawn hud-sig :init hud-init-by-other :to this))) 0 (none) ) ;; definition for method 249 of type sig ;; WARN: Return type mismatch enemy-flag vs none. -(defmethod sig-method-249 sig ((obj sig) (arg0 sig-path)) - (set! (-> obj sig-path) arg0) - (set! (-> obj sig-path-clock) (-> *display* user0-clock)) - (set! (-> obj sig-path-start-time) (-> obj sig-path-clock frame-counter)) - (set! (-> obj sig-path-cur-time) (-> obj sig-path-start-time)) - (set! (-> obj sig-path-prev-time) (-> obj sig-path-start-time)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) +(defmethod sig-method-249 sig ((this sig) (arg0 sig-path)) + (set! (-> this sig-path) arg0) + (set! (-> this sig-path-clock) (-> *display* user0-clock)) + (set! (-> this sig-path-start-time) (-> this sig-path-clock frame-counter)) + (set! (-> this sig-path-cur-time) (-> this sig-path-start-time)) + (set! (-> this sig-path-prev-time) (-> this sig-path-start-time)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) (none) ) ;; definition for method 248 of type sig ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod sig-method-248 sig ((obj sig) (arg0 sig-path-sample)) +(defmethod sig-method-248 sig ((this sig) (arg0 sig-path-sample)) (local-vars (at-0 int)) (with-pp (rlet ((vf0 :class vf) @@ -1232,16 +1231,16 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((a0-1 (-> obj sig-path-clock frame-counter))) - (when (!= (-> obj sig-path-cur-time) a0-1) - (set! (-> obj sig-path-prev-time) (-> obj sig-path-cur-time)) - (set! (-> obj sig-path-cur-time) a0-1) - (set! (-> obj event-param-point quad) (-> obj root trans quad)) + (let ((a0-1 (-> this sig-path-clock frame-counter))) + (when (!= (-> this sig-path-cur-time) a0-1) + (set! (-> this sig-path-prev-time) (-> this sig-path-cur-time)) + (set! (-> this sig-path-cur-time) a0-1) + (set! (-> this event-param-point quad) (-> this root trans quad)) ) ) - (let ((s3-0 (+ (-> obj sig-path sample-count) -1)) - (s2-0 (the int (* 0.05 (the float (- (-> obj sig-path-prev-time) (-> obj sig-path-start-time)))))) - (s4-0 (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))))) + (let ((s3-0 (+ (-> this sig-path sample-count) -1)) + (s2-0 (the int (* 0.05 (the float (- (-> this sig-path-prev-time) (-> this sig-path-start-time)))))) + (s4-0 (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time)))))) ) (if (< s3-0 s2-0) (set! s2-0 s3-0) @@ -1251,13 +1250,13 @@ ) (cond ((= s2-0 s4-0) - (mem-copy! (the-as pointer arg0) (the-as pointer (-> obj sig-path samples s2-0)) 64) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> this sig-path samples s2-0)) 64) ) (else - (mem-copy! (the-as pointer arg0) (the-as pointer (-> obj sig-path samples s4-0)) 64) + (mem-copy! (the-as pointer arg0) (the-as pointer (-> this sig-path samples s4-0)) 64) (let ((v1-22 0)) (countdown (a0-9 (- s4-0 s2-0)) - (set! v1-22 (logior v1-22 (logand (-> obj sig-path samples (+ a0-9 s2-0) flags) 3))) + (set! v1-22 (logior v1-22 (logand (-> this sig-path samples (+ a0-9 s2-0) flags) 3))) ) (logior! (-> arg0 flags) v1-22) ) @@ -1265,9 +1264,9 @@ ) (when (< s4-0 s3-0) (let* ((f0-6 0.05) - (f1-5 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))) + (f1-5 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time)))) (f30-0 (* f0-6 (- f1-5 (* (the float (the int (/ f1-5 20.0))) 20.0)))) - (v1-30 (-> obj sig-path samples)) + (v1-30 (-> this sig-path samples)) (s3-1 (-> v1-30 s4-0)) (s4-1 (-> v1-30 (+ s4-0 1))) (s2-1 (-> arg0 flags)) @@ -1276,9 +1275,9 @@ (quaternion-slerp! (-> arg0 quat) (-> s3-1 quat) (-> s4-1 quat) f30-0) (set! (-> arg0 flags) s2-1) ) - (vector-! (-> obj root transv) (-> arg0 pos) (-> obj event-param-point)) - (let ((v0-5 (-> obj root transv))) - (.lvf vf1 (&-> (-> obj root transv) quad)) + (vector-! (-> this root transv) (-> arg0 pos) (-> this event-param-point)) + (let ((v0-5 (-> this root transv))) + (.lvf vf1 (&-> (-> this root transv) quad)) (let ((f0-7 (-> pp clock frames-per-second))) (.mov at-0 f0-7) ) @@ -1296,9 +1295,9 @@ ;; definition for method 256 of type sig ;; WARN: Return type mismatch int vs none. -(defmethod sig-method-256 sig ((obj sig)) - (let* ((v1-3 (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time)))))) - (v1-4 (- (+ (-> obj sig-path sample-count) -1) v1-3)) +(defmethod sig-method-256 sig ((this sig)) + (let* ((v1-3 (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time)))))) + (v1-4 (- (+ (-> this sig-path sample-count) -1) v1-3)) ) (if (<= v1-4 0) 0 @@ -1309,24 +1308,24 @@ ) ;; definition for method 257 of type sig -(defmethod sig-method-257 sig ((obj sig)) - (>= (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time))))) - (+ (-> obj sig-path sample-count) -1) +(defmethod sig-method-257 sig ((this sig)) + (>= (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time))))) + (+ (-> this sig-path sample-count) -1) ) ) ;; definition for method 250 of type sig ;; INFO: Used lq/sq -(defmethod sig-method-250 sig ((obj sig)) +(defmethod sig-method-250 sig ((this sig)) (local-vars (a2-7 float) (a2-14 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) (let ((s5-0 (new 'stack-no-clear 'sphere))) - (let ((v1-4 (+ (the int (* 0.05 (the float (- (-> obj sig-path-cur-time) (-> obj sig-path-start-time))))) 2)) - (a0-3 (-> obj sig-path sample-count)) - (a1-1 (-> obj sig-path samples)) + (let ((v1-4 (+ (the int (* 0.05 (the float (- (-> this sig-path-cur-time) (-> this sig-path-start-time))))) 2)) + (a0-3 (-> this sig-path sample-count)) + (a1-1 (-> this sig-path samples)) ) (while (< v1-4 a0-3) (let ((a2-1 (-> a1-1 v1-4))) @@ -1455,7 +1454,7 @@ ) (cond (s4-0 - (fire-gun obj (get-trans (the-as process-focusable s4-0) 3)) + (fire-gun this (get-trans (the-as process-focusable s4-0) 3)) #t ) (else @@ -1469,51 +1468,51 @@ ;; definition for method 15 of type hud-sig ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-sig ((obj hud-sig)) +(defmethod draw hud-sig ((this hud-sig)) (set-hud-piece-position! - (-> obj sprites 2) - (the int (+ 30.0 (* -130.0 (-> obj offset)))) - (the int (+ 30.0 (* -100.0 (-> obj offset)))) + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 15 2) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 15 2) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-sig ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-sig ((obj hud-sig)) - (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-sig ((this hud-sig)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-sig ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-sig ((obj hud-sig)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-sig ((this hud-sig)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 scale-x) 12.0) - (set! (-> obj sprites 0 scale-y) 11.2) - (set! (-> obj sprites 0 pos z) #xfffff2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 3 tex) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tex) (lookup-texture-by-name "hud-sig-head" (the-as string #f) (the-as (pointer texture-page) #f)) ) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.4) - (set! (-> obj sprites 3 pos z) #xffffff) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.4) + (set! (-> this sprites 3 pos z) #xffffff) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc index cc89f45cca..3b68181281 100644 --- a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc @@ -59,101 +59,101 @@ ) ;; definition for method 3 of type com-airlock -(defmethod inspect com-airlock ((obj com-airlock)) - (when (not obj) - (set! obj obj) +(defmethod inspect com-airlock ((this com-airlock)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlevel-name: ~A~%" (-> obj level-name)) - (format #t "~2Topen-test: ~A~%" (-> obj open-test)) - (format #t "~2Twere-behind?: ~A~%" (-> obj were-behind?)) - (format #t "~2Tinner?: ~A~%" (-> obj inner?)) - (format #t "~2Tsound-behind?: ~A~%" (-> obj sound-behind?)) - (format #t "~2Tvisible-move?: ~A~%" (-> obj visible-move?)) - (format #t "~2Tsaw-pilot?: ~D~%" (-> obj saw-pilot?)) - (format #t "~2Tlast-distance: (meters ~m)~%" (-> obj last-distance)) - (format #t "~2Ty-height: #x~X~%" (-> obj y-height)) - (format #t "~2Tpre-open-speed: ~f~%" (-> obj pre-open-speed)) - (format #t "~2Tlatch-closed-time: ~D~%" (-> obj latch-closed-time)) - (format #t "~2Tlatch-open-time: ~D~%" (-> obj latch-open-time)) - (format #t "~2Tgear: ~A~%" (-> obj gear)) - (format #t "~2Tgear-rot: (deg ~r)~%" (-> obj gear-rot)) - (format #t "~2Tgear-rotv: (deg ~r)~%" (-> obj gear-rotv)) - (format #t "~2Topen-frame: ~f~%" (-> obj open-frame)) - (format #t "~2Tpre-open-frame: ~f~%" (-> obj pre-open-frame)) - (format #t "~2Tlock-frame: ~f~%" (-> obj lock-frame)) - (format #t "~2Topen-distance: (meters ~m)~%" (-> obj open-distance)) - (format #t "~2Tactive-distance: (meters ~m)~%" (-> obj active-distance)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tgear-sound-id: ~D~%" (-> obj gear-sound-id)) - (format #t "~2Tsound-gear: ~A~%" (-> obj sound-gear)) - (format #t "~2Tsound-pre-open: ~A~%" (-> obj sound-pre-open)) - (format #t "~2Tsound-pre-open-stop: ~A~%" (-> obj sound-pre-open-stop)) - (format #t "~2Tsound-lock-loop: ~A~%" (-> obj sound-lock-loop)) - (format #t "~2Tsound-lock-stop: ~A~%" (-> obj sound-lock-stop)) - (format #t "~2Tsound-open: ~A~%" (-> obj sound-open)) - (format #t "~2Tsound-open-loop: ~A~%" (-> obj sound-open-loop)) - (format #t "~2Tsound-open-stop: ~A~%" (-> obj sound-open-stop)) - (format #t "~2Tsound-close: ~A~%" (-> obj sound-close)) - (format #t "~2Tsound-close-loop: ~A~%" (-> obj sound-close-loop)) - (format #t "~2Tsound-close-stop: ~A~%" (-> obj sound-close-stop)) - (format #t "~2Tsound-post-close: ~A~%" (-> obj sound-post-close)) - (format #t "~2Tsound-post-close-stop: ~A~%" (-> obj sound-post-close-stop)) - (format #t "~2Tspool-sound-time: ~D~%" (-> obj spool-sound-time)) - (format #t "~2Tdoor-radius: (meters ~m)~%" (-> obj door-radius)) + (format #t "~2Tlevel-name: ~A~%" (-> this level-name)) + (format #t "~2Topen-test: ~A~%" (-> this open-test)) + (format #t "~2Twere-behind?: ~A~%" (-> this were-behind?)) + (format #t "~2Tinner?: ~A~%" (-> this inner?)) + (format #t "~2Tsound-behind?: ~A~%" (-> this sound-behind?)) + (format #t "~2Tvisible-move?: ~A~%" (-> this visible-move?)) + (format #t "~2Tsaw-pilot?: ~D~%" (-> this saw-pilot?)) + (format #t "~2Tlast-distance: (meters ~m)~%" (-> this last-distance)) + (format #t "~2Ty-height: #x~X~%" (-> this y-height)) + (format #t "~2Tpre-open-speed: ~f~%" (-> this pre-open-speed)) + (format #t "~2Tlatch-closed-time: ~D~%" (-> this latch-closed-time)) + (format #t "~2Tlatch-open-time: ~D~%" (-> this latch-open-time)) + (format #t "~2Tgear: ~A~%" (-> this gear)) + (format #t "~2Tgear-rot: (deg ~r)~%" (-> this gear-rot)) + (format #t "~2Tgear-rotv: (deg ~r)~%" (-> this gear-rotv)) + (format #t "~2Topen-frame: ~f~%" (-> this open-frame)) + (format #t "~2Tpre-open-frame: ~f~%" (-> this pre-open-frame)) + (format #t "~2Tlock-frame: ~f~%" (-> this lock-frame)) + (format #t "~2Topen-distance: (meters ~m)~%" (-> this open-distance)) + (format #t "~2Tactive-distance: (meters ~m)~%" (-> this active-distance)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tgear-sound-id: ~D~%" (-> this gear-sound-id)) + (format #t "~2Tsound-gear: ~A~%" (-> this sound-gear)) + (format #t "~2Tsound-pre-open: ~A~%" (-> this sound-pre-open)) + (format #t "~2Tsound-pre-open-stop: ~A~%" (-> this sound-pre-open-stop)) + (format #t "~2Tsound-lock-loop: ~A~%" (-> this sound-lock-loop)) + (format #t "~2Tsound-lock-stop: ~A~%" (-> this sound-lock-stop)) + (format #t "~2Tsound-open: ~A~%" (-> this sound-open)) + (format #t "~2Tsound-open-loop: ~A~%" (-> this sound-open-loop)) + (format #t "~2Tsound-open-stop: ~A~%" (-> this sound-open-stop)) + (format #t "~2Tsound-close: ~A~%" (-> this sound-close)) + (format #t "~2Tsound-close-loop: ~A~%" (-> this sound-close-loop)) + (format #t "~2Tsound-close-stop: ~A~%" (-> this sound-close-stop)) + (format #t "~2Tsound-post-close: ~A~%" (-> this sound-post-close)) + (format #t "~2Tsound-post-close-stop: ~A~%" (-> this sound-post-close-stop)) + (format #t "~2Tspool-sound-time: ~D~%" (-> this spool-sound-time)) + (format #t "~2Tdoor-radius: (meters ~m)~%" (-> this door-radius)) (label cfg-4) - obj + this ) ;; definition for method 10 of type com-airlock -(defmethod deactivate com-airlock ((obj com-airlock)) - (process-entity-status! obj (entity-perm-status subtask-complete) #f) - (if (nonzero? (-> obj sound-id)) - (sound-stop (-> obj sound-id)) +(defmethod deactivate com-airlock ((this com-airlock)) + (process-entity-status! this (entity-perm-status subtask-complete) #f) + (if (nonzero? (-> this sound-id)) + (sound-stop (-> this sound-id)) ) - (if (nonzero? (-> obj gear-sound-id)) - (sound-stop (-> obj gear-sound-id)) + (if (nonzero? (-> this gear-sound-id)) + (sound-stop (-> this gear-sound-id)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type com-airlock ;; WARN: Return type mismatch process-drawable vs com-airlock. -(defmethod relocate com-airlock ((obj com-airlock) (arg0 int)) - (if (nonzero? (-> obj gear)) - (&+! (-> obj gear) arg0) +(defmethod relocate com-airlock ((this com-airlock) (arg0 int)) + (if (nonzero? (-> this gear)) + (&+! (-> this gear) arg0) ) - (the-as com-airlock ((method-of-type process-drawable relocate) obj arg0)) + (the-as com-airlock ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 22 of type com-airlock -(defmethod init-airlock! com-airlock ((obj com-airlock)) - (process-entity-status! obj (entity-perm-status subtask-complete) #f) - (process-drawable-from-entity! obj (-> obj entity)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj were-behind?) #f) - (set! (-> obj inner?) - (logtest? (the-as int (res-lump-value (-> obj entity) 'options uint128 :time -1000000000.0)) 1) +(defmethod init-airlock! com-airlock ((this com-airlock)) + (process-entity-status! this (entity-perm-status subtask-complete) #f) + (process-drawable-from-entity! this (-> this entity)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this were-behind?) #f) + (set! (-> this inner?) + (logtest? (the-as int (res-lump-value (-> this entity) 'options uint128 :time -1000000000.0)) 1) ) - (set! (-> obj sound-behind?) #f) - (set! (-> obj saw-pilot?) (the-as handle #f)) - (set! (-> obj open-frame) 0.0) - (set! (-> obj pre-open-frame) 0.0) - (set! (-> obj lock-frame) 0.0) - (set! (-> obj pre-open-speed) 2.0) - (set! (-> obj open-distance) (res-lump-float (-> obj entity) 'distance :default 143360.0)) - (set! (-> obj active-distance) - (res-lump-float (-> obj entity) 'idle-distance :default (+ 143360.0 (-> obj open-distance))) + (set! (-> this sound-behind?) #f) + (set! (-> this saw-pilot?) (the-as handle #f)) + (set! (-> this open-frame) 0.0) + (set! (-> this pre-open-frame) 0.0) + (set! (-> this lock-frame) 0.0) + (set! (-> this pre-open-speed) 2.0) + (set! (-> this open-distance) (res-lump-float (-> this entity) 'distance :default 143360.0)) + (set! (-> this active-distance) + (res-lump-float (-> this entity) 'idle-distance :default (+ 143360.0 (-> this open-distance))) ) - (set! (-> obj y-height) (res-lump-data (-> obj entity) 'height vector)) - (set! (-> obj level-name) (res-lump-struct (-> obj entity) 'on-notice pair)) - (set! (-> obj open-test) + (set! (-> this y-height) (res-lump-data (-> this entity) 'height vector)) + (set! (-> this level-name) (res-lump-struct (-> this entity) 'on-notice pair)) + (set! (-> this open-test) (the-as pair ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'open-test 'interp -1000000000.0 @@ -163,49 +163,49 @@ ) ) ) - (set! (-> obj sound-gear) #f) - (set! (-> obj sound-pre-open) #f) - (set! (-> obj sound-pre-open-stop) #f) - (set! (-> obj sound-lock-loop) #f) - (set! (-> obj sound-lock-stop) #f) - (set! (-> obj sound-post-close) #f) - (set! (-> obj sound-post-close-stop) #f) - (set! (-> obj sound-open) #f) - (set! (-> obj sound-close) #f) - (set! (-> obj sound-open-loop) #f) - (set! (-> obj sound-close-loop) #f) - (set! (-> obj sound-open-stop) #f) - (set! (-> obj sound-close-stop) #f) - (set! (-> obj door-radius) 20480.0) - obj + (set! (-> this sound-gear) #f) + (set! (-> this sound-pre-open) #f) + (set! (-> this sound-pre-open-stop) #f) + (set! (-> this sound-lock-loop) #f) + (set! (-> this sound-lock-stop) #f) + (set! (-> this sound-post-close) #f) + (set! (-> this sound-post-close-stop) #f) + (set! (-> this sound-open) #f) + (set! (-> this sound-close) #f) + (set! (-> this sound-open-loop) #f) + (set! (-> this sound-close-loop) #f) + (set! (-> this sound-open-stop) #f) + (set! (-> this sound-close-stop) #f) + (set! (-> this door-radius) 20480.0) + this ) ;; definition for method 25 of type com-airlock -(defmethod check-crossing-distance com-airlock ((obj com-airlock) (arg0 vector) (arg1 symbol)) - (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj root trans))) +(defmethod check-crossing-distance com-airlock ((this com-airlock) (arg0 vector) (arg1 symbol)) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) ) (set! (-> s4-1 y) 0.0) (let ((f30-0 (vector-dot s4-1 s5-0))) (cond ((not arg1) ) - ((or (< (vector-vector-xz-distance (-> obj root trans) arg0) 40960.0) + ((or (< (vector-vector-xz-distance (-> this root trans) arg0) 40960.0) (< 0.7 (fabs (vector-dot s5-0 (vector-normalize! s4-1 1.0)))) ) - (when (and (< f30-0 0.0) (< 0.0 (-> obj last-distance))) - (let ((s5-1 (res-lump-struct (-> obj entity) 'on-cross structure))) + (when (and (< f30-0 0.0) (< 0.0 (-> this last-distance))) + (let ((s5-1 (res-lump-struct (-> this entity) 'on-cross structure))) (if s5-1 (script-eval (the-as pair s5-1)) ) ) ) - (set! (-> obj last-distance) f30-0) + (set! (-> this last-distance) f30-0) ) - ((< 0.0 (-> obj last-distance)) + ((< 0.0 (-> this last-distance)) (set! f30-0 (fmax 4096.0 f30-0)) ) - ((< (-> obj last-distance) 0.0) + ((< (-> this last-distance) 0.0) (set! f30-0 (fmin -4096.0 f30-0)) ) ) @@ -216,45 +216,45 @@ ;; definition for method 23 of type com-airlock ;; WARN: Return type mismatch object vs symbol. -(defmethod want-cross-airlock? com-airlock ((obj com-airlock)) +(defmethod want-cross-airlock? com-airlock ((this com-airlock)) (local-vars (a0-12 entity-actor)) (let* ((tgt (target-pos 0)) - (f30-0 (check-crossing-distance obj tgt #t)) - (s5-0 (>= (-> obj latch-open-time) (current-time))) + (f30-0 (check-crossing-distance this tgt #t)) + (s5-0 (>= (-> this latch-open-time) (current-time))) ) (the-as symbol - (and (or s5-0 (< (vector-vector-xz-distance (-> obj root trans) tgt) (-> obj active-distance))) - (or s5-0 (not (-> obj y-height)) (and (>= (-> tgt y) (- (-> obj root trans y) (-> obj y-height y))) - (< (-> tgt y) (+ (-> obj root trans y) (-> obj y-height x))) - ) + (and (or s5-0 (< (vector-vector-xz-distance (-> this root trans) tgt) (-> this active-distance))) + (or s5-0 (not (-> this y-height)) (and (>= (-> tgt y) (- (-> this root trans y) (-> this y-height y))) + (< (-> tgt y) (+ (-> this root trans y) (-> this y-height x))) + ) ) (begin - (if (and (not (-> obj were-behind?)) (and (< f30-0 0.0) (-> obj inner?))) - (set! (-> obj were-behind?) #t) + (if (and (not (-> this were-behind?)) (and (< f30-0 0.0) (-> this inner?))) + (set! (-> this were-behind?) #t) ) - (and (< (-> obj latch-closed-time) (current-time)) + (and (< (-> this latch-closed-time) (current-time)) (or (not (and *target* (focus-test? *target* pilot teleporting))) (< f30-0 -409.6)) - (or (and (< f30-0 (-> obj open-distance)) - (or (not (-> obj were-behind?)) (< f30-0 20480.0)) + (or (and (< f30-0 (-> this open-distance)) + (or (not (-> this were-behind?)) (< f30-0 20480.0)) (and (or (< 409.6 f30-0) (begin - (let ((a0-11 (-> obj entity))) + (let ((a0-11 (-> this entity))) (set! a0-12 (entity-actor-lookup a0-11 'next-actor 0)) ) (not a0-12) ) (logtest? (-> a0-12 extra perm status) (entity-perm-status subtask-complete)) ) - (and (script-eval (-> obj open-test)) (-> *setting-control* user-current airlock)) + (and (script-eval (-> this open-test)) (-> *setting-control* user-current airlock)) ) ) s5-0 - (let ((f0-8 (check-crossing-distance obj (camera-pos) #f))) + (let ((f0-8 (check-crossing-distance this (camera-pos) #f))) (and (or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status in-head)))) (or (< (* f30-0 f0-8) 0.0) (and (< (fabs f0-8) 4096.0) - (< (vector-vector-xz-distance (camera-pos) (-> obj root trans)) (-> obj door-radius)) + (< (vector-vector-xz-distance (camera-pos) (-> this root trans)) (-> this door-radius)) ) ) ) @@ -268,8 +268,8 @@ ) ;; definition for method 24 of type com-airlock -(defmethod destination-loaded? com-airlock ((obj com-airlock) (display? symbol)) - (let ((level-list (the-as pair (script-eval (-> obj level-name)))) +(defmethod destination-loaded? com-airlock ((this com-airlock) (display? symbol)) + (let ((level-list (the-as pair (script-eval (-> this level-name)))) (borrow-lev-name #f) ) (cond @@ -343,25 +343,25 @@ ) ;; definition for method 26 of type com-airlock -(defmethod rotate-gear! com-airlock ((obj com-airlock) (arg0 float)) - (when (nonzero? (-> obj gear)) - (if (and (zero? (-> obj gear-sound-id)) - (-> obj sound-gear) - (and (-> obj next-state) (= (-> obj next-state name) 'open)) - (>= (check-crossing-distance obj (target-pos 0) #f) 0.0) +(defmethod rotate-gear! com-airlock ((this com-airlock) (arg0 float)) + (when (nonzero? (-> this gear)) + (if (and (zero? (-> this gear-sound-id)) + (-> this sound-gear) + (and (-> this next-state) (= (-> this next-state name) 'open)) + (>= (check-crossing-distance this (target-pos 0) #f) 0.0) ) - (set! (-> obj gear-sound-id) (sound-play-by-spec (-> obj sound-gear) (new-sound-id) (the-as vector #t))) + (set! (-> this gear-sound-id) (sound-play-by-spec (-> this sound-gear) (new-sound-id) (the-as vector #t))) ) - (seek! (-> obj gear-rotv) arg0 (* 131072.0 (seconds-per-frame))) - (+! (-> obj gear-rot) (* (-> obj gear-rotv) (seconds-per-frame))) - (twist-set! (-> obj gear) (the-as float #f) (the-as float #f) (-> obj gear-rot)) + (seek! (-> this gear-rotv) arg0 (* 131072.0 (seconds-per-frame))) + (+! (-> this gear-rot) (* (-> this gear-rotv) (seconds-per-frame))) + (twist-set! (-> this gear) (the-as float #f) (the-as float #f) (-> this gear-rot)) ) - (-> obj gear-rotv) + (-> this gear-rotv) ) ;; definition for method 27 of type com-airlock ;; WARN: Return type mismatch int vs none. -(defmethod play-city-voice-sound com-airlock ((obj com-airlock) (arg0 symbol)) +(defmethod play-city-voice-sound com-airlock ((this com-airlock) (arg0 symbol)) (let ((gp-0 (the-as (array string) #f))) (case arg0 (('enter) @@ -372,11 +372,11 @@ ) ) (cond - ((and gp-0 (>= (- (current-time) (-> obj spool-sound-time)) (seconds 2))) - (set! (-> obj spool-sound-time) (current-time)) + ((and gp-0 (time-elapsed? (-> this spool-sound-time) (seconds 2))) + (set-time! (-> this spool-sound-time)) (add-process *gui-control* - obj + this (gui-channel alert) (gui-action play) (-> (the-as (array string) (+ (* (rand-vu-int-range 0 (+ (-> gp-0 length) -1)) 4) (the-as int gp-0))) 0) @@ -830,28 +830,28 @@ ) ;; definition for method 3 of type com-airlock-outer -(defmethod inspect com-airlock-outer ((obj com-airlock-outer)) - (when (not obj) - (set! obj obj) +(defmethod inspect com-airlock-outer ((this com-airlock-outer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type com-airlock-outer ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! com-airlock-outer ((obj com-airlock-outer) (arg0 entity-actor)) +(defmethod init-from-entity! com-airlock-outer ((this com-airlock-outer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -880,27 +880,27 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (init-airlock! obj) + (init-airlock! this) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-com-airlock-outer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj pre-open-frame) 35.0) - (set! (-> obj lock-frame) 45.0) - (set! (-> obj open-frame) 45.0) - (set! (-> obj sound-pre-open) (static-sound-spec "airlock-slider")) - (set! (-> obj sound-pre-open-stop) (static-sound-spec "airlock-slide-e")) - (set! (-> obj sound-open) (static-sound-spec "airlock-seal")) - (set! (-> obj sound-open-loop) (static-sound-spec "airlock-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "airlock-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "airlock-open")) - (set! (-> obj sound-close-stop) (static-sound-spec "airlock-hit")) - (set! (-> obj sound-post-close) (static-sound-spec "airlock-slider")) - (set! (-> obj sound-post-close-stop) (static-sound-spec "airlock-slide-e")) - (go (method-of-object obj close) #t) + (set! (-> this pre-open-frame) 35.0) + (set! (-> this lock-frame) 45.0) + (set! (-> this open-frame) 45.0) + (set! (-> this sound-pre-open) (static-sound-spec "airlock-slider")) + (set! (-> this sound-pre-open-stop) (static-sound-spec "airlock-slide-e")) + (set! (-> this sound-open) (static-sound-spec "airlock-seal")) + (set! (-> this sound-open-loop) (static-sound-spec "airlock-open")) + (set! (-> this sound-open-stop) (static-sound-spec "airlock-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "airlock-open")) + (set! (-> this sound-close-stop) (static-sound-spec "airlock-hit")) + (set! (-> this sound-post-close) (static-sound-spec "airlock-slider")) + (set! (-> this sound-post-close-stop) (static-sound-spec "airlock-slide-e")) + (go (method-of-object this close) #t) (none) ) @@ -914,28 +914,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type com-airlock-inner -(defmethod inspect com-airlock-inner ((obj com-airlock-inner)) - (when (not obj) - (set! obj obj) +(defmethod inspect com-airlock-inner ((this com-airlock-inner)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type com-airlock-inner ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! com-airlock-inner ((obj com-airlock-inner) (arg0 entity-actor)) +(defmethod init-from-entity! com-airlock-inner ((this com-airlock-inner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -964,35 +964,38 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-com-airlock-inner" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj lock-frame) 37.0) - (set! (-> obj pre-open-frame) 65.0) - (set! (-> obj open-frame) 75.0) - (set! (-> obj gear) (new 'process 'joint-mod (joint-mod-mode rotate) obj 12)) - (set! (-> obj inner?) - (logtest? (the-as int (res-lump-value (-> obj entity) 'options uint128 :default (the-as uint128 1) :time -1000000000.0)) + (init-airlock! this) + (set! (-> this lock-frame) 37.0) + (set! (-> this pre-open-frame) 65.0) + (set! (-> this open-frame) 75.0) + (set! (-> this gear) (new 'process 'joint-mod (joint-mod-mode rotate) this 12)) + (set! (-> this inner?) + (logtest? (the-as + int + (res-lump-value (-> this entity) 'options uint128 :default (the-as uint128 1) :time -1000000000.0) + ) 1 ) ) - (set! (-> obj pre-open-speed) 0.9) - (set! (-> obj sound-gear) (static-sound-spec "airlock-gear")) - (set! (-> obj sound-pre-open) (static-sound-spec "airlock-slider")) - (set! (-> obj sound-pre-open-stop) (static-sound-spec "airlock-slide-e")) - (set! (-> obj sound-lock-loop) (static-sound-spec "airlock-turn")) - (set! (-> obj sound-lock-stop) (static-sound-spec "airlock-unlock")) - (set! (-> obj sound-open) (static-sound-spec "airlock-seal")) - (set! (-> obj sound-open-loop) (static-sound-spec "airlock-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "airlock-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "airlock-open")) - (set! (-> obj sound-close-stop) (static-sound-spec "airlock-hit")) - (go (method-of-object obj close) #t) + (set! (-> this pre-open-speed) 0.9) + (set! (-> this sound-gear) (static-sound-spec "airlock-gear")) + (set! (-> this sound-pre-open) (static-sound-spec "airlock-slider")) + (set! (-> this sound-pre-open-stop) (static-sound-spec "airlock-slide-e")) + (set! (-> this sound-lock-loop) (static-sound-spec "airlock-turn")) + (set! (-> this sound-lock-stop) (static-sound-spec "airlock-unlock")) + (set! (-> this sound-open) (static-sound-spec "airlock-seal")) + (set! (-> this sound-open-loop) (static-sound-spec "airlock-open")) + (set! (-> this sound-open-stop) (static-sound-spec "airlock-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "airlock-open")) + (set! (-> this sound-close-stop) (static-sound-spec "airlock-hit")) + (go (method-of-object this close) #t) (none) ) @@ -1012,28 +1015,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-entry-gate -(defmethod inspect fort-entry-gate ((obj fort-entry-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-entry-gate ((this fort-entry-gate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type fort-entry-gate ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-entry-gate ((obj fort-entry-gate) (arg0 entity-actor)) +(defmethod init-from-entity! fort-entry-gate ((this fort-entry-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1062,19 +1065,19 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-entry-gate" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "door-stop-open")) - (set! (-> obj sound-close-loop) (static-sound-spec "door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "door-stop-close")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "door-stop-open")) + (set! (-> this sound-close-loop) (static-sound-spec "door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "door-stop-close")) + (go (method-of-object this close) #t) (none) ) @@ -1094,28 +1097,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type hip-door-a -(defmethod inspect hip-door-a ((obj hip-door-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-door-a ((this hip-door-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type hip-door-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-door-a ((obj hip-door-a) (arg0 entity-actor)) +(defmethod init-from-entity! hip-door-a ((this hip-door-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1144,20 +1147,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-door-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (set! (-> obj door-radius) 8192.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> this door-radius) 8192.0) + (go (method-of-object this close) #t) (none) ) @@ -1178,28 +1181,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-mar-door -(defmethod inspect tomb-mar-door ((obj tomb-mar-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-mar-door ((this tomb-mar-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type tomb-mar-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-mar-door ((obj tomb-mar-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-mar-door ((this tomb-mar-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -1215,19 +1218,19 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-mar-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wing-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wing-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wing-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wing-close-hit")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wing-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wing-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wing-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wing-close-hit")) + (go (method-of-object this close) #t) (none) ) @@ -1241,16 +1244,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type cas-front-door -(defmethod inspect cas-front-door ((obj cas-front-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect cas-front-door ((this cas-front-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock-outer inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1270,28 +1273,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-throne-door -(defmethod inspect pal-throne-door ((obj pal-throne-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-throne-door ((this pal-throne-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type pal-throne-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-throne-door ((obj pal-throne-door) (arg0 entity-actor)) +(defmethod init-from-entity! pal-throne-door ((this pal-throne-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1320,20 +1323,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-throne-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-slide")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-door-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-slide")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-door-hit")) - (set! (-> obj sound-behind?) #t) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-slide")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-door-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-slide")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-door-hit")) + (set! (-> this sound-behind?) #t) + (go (method-of-object this close) #t) (none) ) @@ -1353,28 +1356,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type vin-door-ctyinda -(defmethod inspect vin-door-ctyinda ((obj vin-door-ctyinda)) - (when (not obj) - (set! obj obj) +(defmethod inspect vin-door-ctyinda ((this vin-door-ctyinda)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type vin-door-ctyinda ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vin-door-ctyinda ((obj vin-door-ctyinda) (arg0 entity-actor)) +(defmethod init-from-entity! vin-door-ctyinda ((this vin-door-ctyinda) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1403,20 +1406,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vin-door-ctyinda" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (set! (-> obj door-radius) 8192.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> this door-radius) 8192.0) + (go (method-of-object this close) #t) (none) ) @@ -1436,28 +1439,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-door -(defmethod inspect under-door ((obj under-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-door ((this under-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type under-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-door ((obj under-door) (arg0 entity-actor)) +(defmethod init-from-entity! under-door ((this under-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1486,20 +1489,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (set! (-> obj door-radius) 8192.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> this door-radius) 8192.0) + (go (method-of-object this close) #t) (none) ) @@ -1519,28 +1522,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type oracle-door -(defmethod inspect oracle-door ((obj oracle-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect oracle-door ((this oracle-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type oracle-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! oracle-door ((obj oracle-door) (arg0 entity-actor)) +(defmethod init-from-entity! oracle-door ((this oracle-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1569,18 +1572,18 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-oracle-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (go (method-of-object this close) #t) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/battle_REF.gc b/test/decompiler/reference/jak2/levels/common/battle_REF.gc index 26e3722ea3..c3ea7908d8 100644 --- a/test/decompiler/reference/jak2/levels/common/battle_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/battle_REF.gc @@ -26,30 +26,30 @@ ) ;; definition for method 3 of type battle-info -(defmethod inspect battle-info ((obj battle-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect battle-info ((this battle-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Tnotice-spec: ~D~%" (-> obj notice-spec)) - (format #t "~1Tpick-logic: ~D~%" (-> obj pick-logic)) - (format #t "~1Tnotice-distance: ~f~%" (-> obj notice-distance)) - (format #t "~1Tdont-spawn-initial-until-notice?: ~A~%" (-> obj dont-spawn-initial-until-notice?)) - (format #t "~1Tplay-battle-music: ~A~%" (-> obj play-battle-music)) - (format #t "~1Tmin-battle-spawn-delay: ~D~%" (-> obj min-battle-spawn-delay)) - (format #t "~1Tmax-battle-spawn-delay: ~D~%" (-> obj max-battle-spawn-delay)) - (format #t "~1Tmin-spawner-notice-attack-delay: ~D~%" (-> obj min-spawner-notice-attack-delay)) - (format #t "~1Tmax-spawner-notice-attack-delay: ~D~%" (-> obj max-spawner-notice-attack-delay)) - (format #t "~1Tspawner-blocked-by-player-xz: ~f~%" (-> obj spawner-blocked-by-player-xz)) - (format #t "~1Tspawner-blocked-by-collide-radius: ~f~%" (-> obj spawner-blocked-by-collide-radius)) - (format #t "~1Tpick-spawner-max-dist: ~f~%" (-> obj pick-spawner-max-dist)) - (format #t "~1Tmax-count: ~D~%" (-> obj max-count)) - (format #t "~1Tdesired-alive-count: ~D~%" (-> obj desired-alive-count)) - (format #t "~1Tspawner-collide-with: ~D~%" (-> obj spawner-collide-with)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Tnotice-spec: ~D~%" (-> this notice-spec)) + (format #t "~1Tpick-logic: ~D~%" (-> this pick-logic)) + (format #t "~1Tnotice-distance: ~f~%" (-> this notice-distance)) + (format #t "~1Tdont-spawn-initial-until-notice?: ~A~%" (-> this dont-spawn-initial-until-notice?)) + (format #t "~1Tplay-battle-music: ~A~%" (-> this play-battle-music)) + (format #t "~1Tmin-battle-spawn-delay: ~D~%" (-> this min-battle-spawn-delay)) + (format #t "~1Tmax-battle-spawn-delay: ~D~%" (-> this max-battle-spawn-delay)) + (format #t "~1Tmin-spawner-notice-attack-delay: ~D~%" (-> this min-spawner-notice-attack-delay)) + (format #t "~1Tmax-spawner-notice-attack-delay: ~D~%" (-> this max-spawner-notice-attack-delay)) + (format #t "~1Tspawner-blocked-by-player-xz: ~f~%" (-> this spawner-blocked-by-player-xz)) + (format #t "~1Tspawner-blocked-by-collide-radius: ~f~%" (-> this spawner-blocked-by-collide-radius)) + (format #t "~1Tpick-spawner-max-dist: ~f~%" (-> this pick-spawner-max-dist)) + (format #t "~1Tmax-count: ~D~%" (-> this max-count)) + (format #t "~1Tdesired-alive-count: ~D~%" (-> this desired-alive-count)) + (format #t "~1Tspawner-collide-with: ~D~%" (-> this spawner-collide-with)) (label cfg-4) - obj + this ) ;; definition of type battle-ally @@ -62,15 +62,15 @@ ) ;; definition for method 3 of type battle-ally -(defmethod inspect battle-ally ((obj battle-ally)) - (when (not obj) - (set! obj obj) +(defmethod inspect battle-ally ((this battle-ally)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'battle-ally) - (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "[~8x] ~A~%" this 'battle-ally) + (format #t "~1Tentity: ~A~%" (-> this entity)) (label cfg-4) - obj + this ) ;; definition of type battle-ally-array @@ -83,17 +83,17 @@ ) ;; definition for method 3 of type battle-ally-array -(defmethod inspect battle-ally-array ((obj battle-ally-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect battle-ally-array ((this battle-ally-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -110,16 +110,16 @@ ) ;; definition for method 3 of type battle-breed -(defmethod inspect battle-breed ((obj battle-breed)) - (when (not obj) - (set! obj obj) +(defmethod inspect battle-breed ((this battle-breed)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'battle-breed) - (format #t "~1Tbreed-type: ~A~%" (-> obj breed-type)) - (format #t "~1Tpercent: ~f~%" (-> obj percent)) + (format #t "[~8x] ~A~%" this 'battle-breed) + (format #t "~1Tbreed-type: ~A~%" (-> this breed-type)) + (format #t "~1Tpercent: ~f~%" (-> this percent)) (label cfg-4) - obj + this ) ;; definition of type battle-breed-array @@ -132,17 +132,17 @@ ) ;; definition for method 3 of type battle-breed-array -(defmethod inspect battle-breed-array ((obj battle-breed-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect battle-breed-array ((this battle-breed-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -170,27 +170,27 @@ ) ;; definition for method 3 of type battle-spawner -(defmethod inspect battle-spawner ((obj battle-spawner)) - (when (not obj) - (set! obj obj) +(defmethod inspect battle-spawner ((this battle-spawner)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'battle-spawner) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tbreeds: ~A~%" (-> obj breeds)) - (format #t "~1Tcreature-index: ~D~%" (-> obj creature-index)) - (format #t "~1Tready-index: ~D~%" (-> obj ready-index)) - (format #t "~1Tattack-index: ~D~%" (-> obj attack-index)) - (format #t "~1Tmode: ~D~%" (-> obj mode)) - (format #t "~1Tintro-path: ~A~%" (-> obj intro-path)) - (format #t "~1Tnotice-attack-delay: ~D~%" (-> obj notice-attack-delay)) - (format #t "~1Tcreature: ~D~%" (-> obj creature)) - (format #t "~1Tlast-spawn-time: ~D~%" (-> obj last-spawn-time)) - (format #t "~1Tnoticed-attack-time: ~D~%" (-> obj noticed-attack-time)) - (format #t "~1Tattack-pos: #~%" (-> obj attack-pos)) + (format #t "[~8x] ~A~%" this 'battle-spawner) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tbreeds: ~A~%" (-> this breeds)) + (format #t "~1Tcreature-index: ~D~%" (-> this creature-index)) + (format #t "~1Tready-index: ~D~%" (-> this ready-index)) + (format #t "~1Tattack-index: ~D~%" (-> this attack-index)) + (format #t "~1Tmode: ~D~%" (-> this mode)) + (format #t "~1Tintro-path: ~A~%" (-> this intro-path)) + (format #t "~1Tnotice-attack-delay: ~D~%" (-> this notice-attack-delay)) + (format #t "~1Tcreature: ~D~%" (-> this creature)) + (format #t "~1Tlast-spawn-time: ~D~%" (-> this last-spawn-time)) + (format #t "~1Tnoticed-attack-time: ~D~%" (-> this noticed-attack-time)) + (format #t "~1Tattack-pos: #~%" (-> this attack-pos)) (label cfg-4) - obj + this ) ;; definition of type battle-spawner-array @@ -203,17 +203,17 @@ ) ;; definition for method 3 of type battle-spawner-array -(defmethod inspect battle-spawner-array ((obj battle-spawner-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect battle-spawner-array ((this battle-spawner-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -279,31 +279,31 @@ ) ;; definition for method 3 of type battle -(defmethod inspect battle ((obj battle)) - (when (not obj) - (set! obj obj) +(defmethod inspect battle ((this battle)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: ~A~%" (-> obj info)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tspawn-initial-creatures?: ~A~%" (-> obj spawn-initial-creatures?)) - (format #t "~2Tnext-spawn-delay: ~D~%" (-> obj next-spawn-delay)) - (format #t "~2Ton-notice: ~A~%" (-> obj on-notice)) - (format #t "~2Ton-hostile: ~A~%" (-> obj on-hostile)) - (format #t "~2Ton-beaten: ~A~%" (-> obj on-beaten)) - (format #t "~2Tmax-count: ~D~%" (-> obj max-count)) - (format #t "~2Tcount: ~D~%" (-> obj count)) - (format #t "~2Tdie-count: ~D~%" (-> obj die-count)) - (format #t "~2Tstat-child-count: ~D~%" (-> obj stat-child-count)) - (format #t "~2Tcant-spawn-time: ~D~%" (-> obj cant-spawn-time)) - (format #t "~2Tjammed-starting-time: ~D~%" (-> obj jammed-starting-time)) - (format #t "~2Tspawners: ~A~%" (-> obj spawners)) - (format #t "~2Tallies: ~A~%" (-> obj allies)) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tspawn-initial-creatures?: ~A~%" (-> this spawn-initial-creatures?)) + (format #t "~2Tnext-spawn-delay: ~D~%" (-> this next-spawn-delay)) + (format #t "~2Ton-notice: ~A~%" (-> this on-notice)) + (format #t "~2Ton-hostile: ~A~%" (-> this on-hostile)) + (format #t "~2Ton-beaten: ~A~%" (-> this on-beaten)) + (format #t "~2Tmax-count: ~D~%" (-> this max-count)) + (format #t "~2Tcount: ~D~%" (-> this count)) + (format #t "~2Tdie-count: ~D~%" (-> this die-count)) + (format #t "~2Tstat-child-count: ~D~%" (-> this stat-child-count)) + (format #t "~2Tcant-spawn-time: ~D~%" (-> this cant-spawn-time)) + (format #t "~2Tjammed-starting-time: ~D~%" (-> this jammed-starting-time)) + (format #t "~2Tspawners: ~A~%" (-> this spawners)) + (format #t "~2Tallies: ~A~%" (-> this allies)) (label cfg-4) - obj + this ) ;; definition for symbol *battles*, type (array battle-info) @@ -944,10 +944,10 @@ ;; definition for method 27 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-battle-marks battle ((obj battle)) +(defmethod draw-battle-marks battle ((this battle)) (local-vars (sv-16 string) (sv-32 string)) - (let ((s4-0 (-> obj root trans)) - (s5-0 (the-as int (-> obj max-count))) + (let ((s4-0 (-> this root trans)) + (s5-0 (the-as int (-> this max-count))) ) (if (= (the-as uint s5-0) #x20000000) (set! s5-0 0) @@ -960,17 +960,17 @@ (format (clear *temp-string*) "~%~S~%count ~d/~d~%child ~d~%ally ~d" - (-> obj name) - (-> obj count) + (-> this name) + (-> this count) s5-0 - (-> obj stat-child-count) - (-> obj allies length) + (-> this stat-child-count) + (-> this allies length) ) (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* s4-0 (font-color orange) (the-as vector2h #f)) ) ) - (dotimes (s5-1 (-> obj spawners length)) - (let ((s4-1 (-> obj spawners data s5-1))) + (dotimes (s5-1 (-> this spawners length)) + (let ((s4-1 (-> this spawners data s5-1))) (let ((a0-6 (-> s4-1 intro-path))) (if a0-6 (debug-draw a0-6) @@ -1011,18 +1011,18 @@ ;; definition for method 26 of type battle ;; INFO: Used lq/sq -(defmethod spawner-blocked-by-collide? battle ((obj battle) (arg0 battle-spawner)) +(defmethod spawner-blocked-by-collide? battle ((this battle) (arg0 battle-spawner)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) (let ((gp-0 (new 'stack-no-clear 'vector)) - (f0-0 (-> obj info spawner-blocked-by-collide-radius)) + (f0-0 (-> this info spawner-blocked-by-collide-radius)) ) (set! (-> gp-0 quad) (-> arg0 attack-pos quad)) (set! (-> gp-0 w) f0-0) - (let ((s5-0 (-> obj info spawner-collide-with)) + (let ((s5-0 (-> this info spawner-collide-with)) (f30-0 (* f0-0 f0-0)) ) (set! *actor-list-length* 0) @@ -1127,15 +1127,15 @@ ) ;; definition for method 25 of type battle -(defmethod spawner-blocked? battle ((obj battle) (arg0 battle-spawner)) - (when (not (logtest? (-> obj flags) (battle-flags no-spawner-block))) - (let ((f0-0 (-> obj info spawner-blocked-by-player-xz))) +(defmethod spawner-blocked? battle ((this battle) (arg0 battle-spawner)) + (when (not (logtest? (-> this flags) (battle-flags no-spawner-block))) + (let ((f0-0 (-> this info spawner-blocked-by-player-xz))) (if (and (< 0.0 f0-0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 attack-pos)))) (return #t) ) ) - (let ((f0-3 (-> obj info spawner-blocked-by-collide-radius))) - (if (and (< 0.0 f0-3) (spawner-blocked-by-collide? obj arg0)) + (let ((f0-3 (-> this info spawner-blocked-by-collide-radius))) + (if (and (< 0.0 f0-3) (spawner-blocked-by-collide? this arg0)) (return #t) ) ) @@ -1144,16 +1144,16 @@ ) ;; definition for method 37 of type battle -(defmethod spawner-free? battle ((obj battle) (arg0 battle-spawner)) +(defmethod spawner-free? battle ((this battle) (arg0 battle-spawner)) (and (not (handle->process (-> arg0 creature))) - (or (>= (-> arg0 ready-index) 0) (not (spawner-blocked? obj arg0))) + (or (>= (-> arg0 ready-index) 0) (not (spawner-blocked? this arg0))) ) ) ;; definition for method 36 of type battle -(defmethod get-best-spawner battle ((obj battle)) - (let ((s5-0 (-> obj spawners length)) - (v1-2 (-> obj info pick-logic)) +(defmethod get-best-spawner battle ((this battle)) + (let ((s5-0 (-> this spawners length)) + (v1-2 (-> this info pick-logic)) ) (if (not *target*) (set! v1-2 0) @@ -1162,8 +1162,8 @@ ((zero? v1-2) (let ((s3-0 (rand-vu-int-count s5-0))) (dotimes (s4-0 s5-0) - (let ((s2-0 (-> obj spawners data s3-0))) - (if (spawner-free? obj s2-0) + (let ((s2-0 (-> this spawners data s3-0))) + (if (spawner-free? this s2-0) (return s2-0) ) ) @@ -1177,10 +1177,10 @@ ) (while (nonzero? s5-0) (+! s5-0 -1) - (let ((s3-1 (-> obj spawners data s5-0))) - (when (spawner-free? obj s3-1) + (let ((s3-1 (-> this spawners data s5-0))) + (when (spawner-free? this s3-1) (let ((f0-0 (vector-vector-distance (target-pos 0) (-> s3-1 entity extra trans)))) - (when (and (>= (-> obj info pick-spawner-max-dist) f0-0) (or (< f30-0 0.0) (< f0-0 f30-0))) + (when (and (>= (-> this info pick-spawner-max-dist) f0-0) (or (< f30-0 0.0) (< f0-0 f30-0))) (set! s4-1 s5-0) (set! f30-0 f0-0) ) @@ -1189,7 +1189,7 @@ ) ) (if (< 0.0 f30-0) - (return (-> obj spawners data s4-1)) + (return (-> this spawners data s4-1)) ) ) ) @@ -1199,7 +1199,7 @@ ) ;; definition for method 41 of type battle -(defmethod get-random-breed battle ((obj battle) (arg0 battle-spawner)) +(defmethod get-random-breed battle ((this battle) (arg0 battle-spawner)) (let ((f0-0 (rand-vu)) (v1-0 0) ) @@ -1219,14 +1219,14 @@ ;; definition for method 38 of type battle ;; WARN: Return type mismatch int vs handle. -(defmethod spawn-from-breed battle ((obj battle) (arg0 battle-breed) (arg1 enemy-init-by-other-params)) +(defmethod spawn-from-breed battle ((this battle) (arg0 battle-breed) (arg1 enemy-init-by-other-params)) (let* ((s3-0 (-> arg0 breed-type)) (s4-0 (get-process *default-dead-pool* s3-0 #x4000)) (v1-1 (when s4-0 (let ((t9-1 (method-of-type process activate))) - (t9-1 s4-0 obj (symbol->string (-> s3-0 symbol)) (the-as pointer #x70004000)) + (t9-1 s4-0 this (symbol->string (-> s3-0 symbol)) (the-as pointer #x70004000)) ) - (run-now-in-process s4-0 enemy-init-by-other obj arg1) + (run-now-in-process s4-0 enemy-init-by-other this arg1) (-> s4-0 ppointer) ) ) @@ -1234,7 +1234,7 @@ (if (not v1-1) (return (the-as handle #f)) ) - (+! (-> obj count) 1) + (+! (-> this count) 1) (the-as handle (ppointer->handle v1-1)) ) ) @@ -1242,7 +1242,7 @@ ;; definition for method 39 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch handle vs none. -(defmethod spawn-from-spawner battle ((obj battle) (arg0 battle-spawner) (arg1 symbol)) +(defmethod spawn-from-spawner battle ((this battle) (arg0 battle-spawner) (arg1 symbol)) (let ((s3-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'quaternion)) (s2-0 (-> arg0 intro-path)) @@ -1283,18 +1283,18 @@ ) (let ((s1-1 (new 'stack-no-clear 'enemy-init-by-other-params)) (s2-1 (!= s2-0 #f)) - (s0-1 (get-random-breed obj arg0)) + (s0-1 (get-random-breed this arg0)) ) (set! (-> s1-1 trans quad) (-> s3-0 quad)) (quaternion-copy! (-> s1-1 quat) s4-0) (set! (-> s1-1 entity) (-> arg0 entity)) (set! (-> s1-1 directed?) #t) (set! (-> s1-1 no-initial-move-to-ground?) s2-1) - (let ((v0-7 (spawn-from-breed obj s0-1 s1-1))) + (let ((v0-7 (spawn-from-breed this s0-1 s1-1))) (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)) ) ) ) @@ -1303,15 +1303,15 @@ ) ;; definition for method 30 of type battle -(defmethod get-spawner-for-enemy battle ((obj battle) (arg0 process)) +(defmethod get-spawner-for-enemy battle ((this battle) (arg0 process)) (let ((v1-0 (if (type? arg0 nav-enemy) (the-as nav-enemy arg0) ) ) ) (when v1-0 - (dotimes (a0-3 (-> obj spawners length)) - (let* ((a1-5 (-> obj spawners data a0-3)) + (dotimes (a0-3 (-> this spawners length)) + (let* ((a1-5 (-> this spawners data a0-3)) (a2-2 (handle->process (-> a1-5 creature))) ) (when (and a2-2 (= a2-2 v1-0)) @@ -1329,15 +1329,15 @@ ) ;; definition for method 51 of type battle -(defmethod spawner-active? battle ((obj battle) (arg0 battle-spawner) (arg1 symbol)) - (when (and (logtest? (-> obj flags) (battle-flags active)) (not (logtest? (-> obj flags) (battle-flags beaten)))) +(defmethod spawner-active? battle ((this battle) (arg0 battle-spawner) (arg1 symbol)) + (when (and (logtest? (-> this flags) (battle-flags active)) (not (logtest? (-> this flags) (battle-flags beaten)))) (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)) ) ) @@ -1359,13 +1359,13 @@ ((zero? v1-20) (when (or (logtest? (enemy-flag victory) (-> (the-as enemy s4-0) enemy-flags)) (not arg1)) (cond - ((spawner-in-intro? obj arg0) - (if (not (spawner-try-jump obj arg0 (the-as enemy s4-0))) + ((spawner-in-intro? this arg0) + (if (not (spawner-try-jump this arg0 (the-as enemy s4-0))) (return #t) ) ) - ((spawner-hittable? obj arg0) - (spawner-hit obj arg0 (the-as enemy s4-0)) + ((spawner-hittable? this arg0) + (spawner-hit this arg0 (the-as enemy s4-0)) ) ) ) @@ -1378,7 +1378,7 @@ ) ;; definition for method 46 of type battle -(defmethod spawner-in-intro? battle ((obj battle) (arg0 battle-spawner)) +(defmethod spawner-in-intro? battle ((this battle) (arg0 battle-spawner)) (when (-> arg0 intro-path) (let ((v1-1 (-> arg0 creature-index)) (a0-1 (-> arg0 attack-index)) @@ -1389,11 +1389,11 @@ ) ;; definition for method 43 of type battle -(defmethod spawner-try-jump battle ((obj battle) (arg0 battle-spawner) (arg1 enemy)) +(defmethod spawner-try-jump battle ((this battle) (arg0 battle-spawner) (arg1 enemy)) (let ((s3-0 (+ (-> arg0 creature-index) 1)) (s4-0 (new 'stack-no-clear 'vector)) ) - (if (and (= s3-0 (-> arg0 attack-index)) (spawner-blocked? obj arg0)) + (if (and (= s3-0 (-> arg0 attack-index)) (spawner-blocked? this arg0)) (return #f) ) (get-point-in-path! (-> arg0 intro-path) s4-0 (the float s3-0) 'exact) @@ -1414,7 +1414,7 @@ ) ;; definition for method 45 of type battle -(defmethod spawner-hittable? battle ((obj battle) (arg0 battle-spawner)) +(defmethod spawner-hittable? battle ((this battle) (arg0 battle-spawner)) (when (logtest? (-> arg0 flags) (battle-spawner-flags hit)) (if (-> arg0 intro-path) (>= (-> arg0 creature-index) (-> arg0 attack-index)) @@ -1424,7 +1424,7 @@ ) ;; definition for method 42 of type battle -(defmethod spawner-hit battle ((obj battle) (arg0 battle-spawner) (arg1 process)) +(defmethod spawner-hit battle ((this battle) (arg0 battle-spawner) (arg1 process)) (let ((s5-0 (-> arg0 creature))) (set! (-> arg0 creature) (the-as handle #f)) (cond @@ -1440,20 +1440,20 @@ ) ;; definition for method 44 of type battle -(defmethod spawner-do-jump battle ((obj battle) (arg0 battle-spawner)) +(defmethod spawner-do-jump battle ((this battle) (arg0 battle-spawner)) (when (= (-> arg0 mode) 2) (+! (-> arg0 creature-index) 1) (set! (-> arg0 mode) (the-as uint 0)) - (spawner-active? obj arg0 #f) + (spawner-active? this arg0 #f) ) 0 ) ;; definition for method 52 of type battle -(defmethod spawner-active-count battle ((obj battle)) +(defmethod spawner-active-count battle ((this battle)) (let ((gp-0 0)) - (dotimes (s4-0 (-> obj spawners length)) - (if (spawner-active? obj (-> obj spawners data s4-0) #t) + (dotimes (s4-0 (-> this spawners length)) + (if (spawner-active? this (-> this spawners data s4-0) #t) (+! gp-0 1) ) ) @@ -1463,16 +1463,16 @@ ;; definition for method 40 of type battle ;; WARN: Return type mismatch int vs none. -(defmethod spawn-initial-creatures battle ((obj battle)) - (set! (-> obj spawn-initial-creatures?) #f) - (let ((s5-0 (-> obj spawners))) +(defmethod spawn-initial-creatures battle ((this battle)) + (set! (-> this spawn-initial-creatures?) #f) + (let ((s5-0 (-> this spawners))) (dotimes (s4-0 (-> s5-0 length)) (let ((s3-0 (-> s5-0 data s4-0))) - (when (spawner-free? obj s3-0) + (when (spawner-free? this s3-0) (let ((enm-options (res-lump-value (-> s3-0 entity) 'enemy-options enemy-option :time -1000000000.0))) (when (logtest? (enemy-option prespawned) enm-options) - (spawn-from-spawner obj s3-0 #t) - (+! (-> obj stat-child-count) 1) + (spawn-from-spawner this s3-0 #t) + (+! (-> this stat-child-count) 1) ) ) ) @@ -1484,8 +1484,8 @@ ) ;; definition for method 35 of type battle -(defmethod get-spawn-delay battle ((obj battle)) - (let ((v1-0 (-> obj info))) +(defmethod get-spawn-delay battle ((this battle)) + (let ((v1-0 (-> this info))) (rand-vu-int-range (the-as int (-> v1-0 min-battle-spawn-delay)) (the-as int (-> v1-0 max-battle-spawn-delay)) @@ -1535,7 +1535,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)) @@ -1561,16 +1561,16 @@ ) ;; definition for method 49 of type battle -(defmethod update-allies-list battle ((obj battle)) - (let ((v1-0 (-> obj allies)) - (gp-0 (-> obj allies length)) +(defmethod update-allies-list battle ((this battle)) + (let ((v1-0 (-> this allies)) + (gp-0 (-> this allies length)) ) (when (> gp-0 0) (let* ((a1-4 (mod (the-as int (-> self clock integral-frame-counter)) gp-0)) (a3-0 (-> v1-0 data a1-4)) ) (when (logtest? (-> a3-0 entity extra perm status) (entity-perm-status dead)) - (+! (-> obj die-count) 1) + (+! (-> this die-count) 1) (+! gp-0 -1) (set! (-> v1-0 length) gp-0) (if (and (nonzero? gp-0) (!= a1-4 gp-0)) @@ -1584,10 +1584,10 @@ ) ;; definition for method 50 of type battle -(defmethod beaten? battle ((obj battle)) - (let ((s5-0 (spawner-active-count obj)) - (v1-2 (update-allies-list obj)) - (a1-0 (-> obj child)) +(defmethod beaten? battle ((this battle)) + (let ((s5-0 (spawner-active-count this)) + (v1-2 (update-allies-list this)) + (a1-0 (-> this child)) (a0-3 0) ) (while a1-0 @@ -1596,59 +1596,59 @@ (nop!) (nop!) ) - (set! (-> obj stat-child-count) (the-as uint a0-3)) + (set! (-> this stat-child-count) (the-as uint a0-3)) (let ((a0-4 (+ v1-2 a0-3)) - (v1-4 (-> obj max-count)) + (v1-4 (-> this max-count)) ) (when (zero? a0-4) - (if (or (logtest? (-> obj flags) (battle-flags beaten)) (>= (-> obj die-count) v1-4)) + (if (or (logtest? (-> this flags) (battle-flags beaten)) (>= (-> this die-count) v1-4)) (return #t) ) ) - (logclear! (-> obj flags) (battle-flags no-spawner-block)) + (logclear! (-> this flags) (battle-flags no-spawner-block)) (cond - ((and (> s5-0 0) (>= s5-0 (the-as int (- v1-4 (-> obj die-count))))) - (let ((a1-14 (-> obj jammed-starting-time))) + ((and (> s5-0 0) (>= s5-0 (the-as int (- v1-4 (-> this die-count))))) + (let ((a1-14 (-> this jammed-starting-time))) (cond - ((zero? (-> obj jammed-starting-time)) - (set! (-> obj jammed-starting-time) (current-time)) + ((zero? (-> this jammed-starting-time)) + (set-time! (-> this jammed-starting-time)) ) (else - (if (>= (- (current-time) a1-14) (seconds 3.5)) - (logior! (-> obj flags) (battle-flags no-spawner-block)) + (if (time-elapsed? a1-14 (seconds 3.5)) + (logior! (-> this flags) (battle-flags no-spawner-block)) ) ) ) ) ) (else - (set! (-> obj jammed-starting-time) 0) + (set! (-> this jammed-starting-time) 0) 0 ) ) (cond - ((and (not (logtest? (-> obj flags) (battle-flags beaten))) - (> (-> obj spawners length) 0) - (< a0-4 (the-as int (-> obj info desired-alive-count))) - (< (-> obj count) v1-4) + ((and (not (logtest? (-> this flags) (battle-flags beaten))) + (> (-> this spawners length) 0) + (< a0-4 (the-as int (-> this info desired-alive-count))) + (< (-> this count) v1-4) ) - (when (>= (- (current-time) (-> obj cant-spawn-time)) (the-as time-frame (-> obj next-spawn-delay))) - (let ((a1-29 (get-best-spawner obj))) + (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 obj a1-29 #f) - (set! (-> obj next-spawn-delay) (the-as uint (get-spawn-delay obj))) - (set! (-> obj cant-spawn-time) (current-time)) + (spawn-from-spawner this a1-29 #f) + (set! (-> this next-spawn-delay) (the-as uint (get-spawn-delay this))) + (set-time! (-> this cant-spawn-time)) ) (else - (set! (-> obj cant-spawn-time) (current-time)) + (set-time! (-> this cant-spawn-time)) ) ) ) ) ) (else - (set! (-> obj cant-spawn-time) (current-time)) + (set-time! (-> this cant-spawn-time)) ) ) ) @@ -1661,7 +1661,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) @@ -1703,9 +1703,9 @@ ;; definition for method 47 of type battle ;; WARN: Return type mismatch battle-flags vs none. -(defmethod set-battle-music battle ((obj battle)) - (let ((a3-0 (-> obj info play-battle-music))) - (when (and a3-0 (not (logtest? (-> obj flags) (battle-flags battle-music-set)))) +(defmethod set-battle-music battle ((this battle)) + (let ((a3-0 (-> this info play-battle-music))) + (when (and a3-0 (not (logtest? (-> this flags) (battle-flags battle-music-set)))) (case a3-0 (('sound-mode) (set-setting! 'sound-mode #f 0.0 1) @@ -1714,7 +1714,7 @@ (set-setting! 'music a3-0 0.0 0) ) ) - (logior! (-> obj flags) (battle-flags battle-music-set)) + (logior! (-> this flags) (battle-flags battle-music-set)) ) ) (none) @@ -1722,8 +1722,8 @@ ;; definition for method 48 of type battle ;; WARN: Return type mismatch int vs none. -(defmethod unset-battle-music battle ((obj battle)) - (when (logtest? (-> obj flags) (battle-flags battle-music-set)) +(defmethod unset-battle-music battle ((this battle)) + (when (logtest? (-> this flags) (battle-flags battle-music-set)) (remove-setting! 'sound-mode) (remove-setting! 'music) ) @@ -1732,33 +1732,33 @@ ) ;; definition for method 7 of type battle-spawner-array -(defmethod relocate battle-spawner-array ((obj battle-spawner-array) (arg0 int)) - (dotimes (v1-0 (-> obj length)) - (let ((a2-3 (-> obj data v1-0))) +(defmethod relocate battle-spawner-array ((this battle-spawner-array) (arg0 int)) + (dotimes (v1-0 (-> this length)) + (let ((a2-3 (-> this data v1-0))) (&+! (-> a2-3 breeds) arg0) (if (-> a2-3 intro-path) (&+! (-> a2-3 intro-path) arg0) ) ) ) - obj + this ) ;; definition for method 7 of type battle ;; WARN: Return type mismatch process-drawable vs battle. -(defmethod relocate battle ((obj battle) (arg0 int)) - (&+! (-> obj spawners) arg0) - (&+! (-> obj allies) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method battle 7)) this arg0) ) ) ;; definition for method 29 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod initialize-spawner-breeds battle ((obj battle) (arg0 battle-spawner) (arg1 entity-actor)) +(defmethod initialize-spawner-breeds battle ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) (local-vars (sv-16 res-tag) (sv-32 res-tag)) (let ((s2-0 0) (s5-0 0) @@ -1845,7 +1845,7 @@ ;; definition for method 32 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod initialize-spawner battle ((obj battle) (arg0 battle-spawner) (arg1 entity-actor)) +(defmethod initialize-spawner battle ((this battle) (arg0 battle-spawner) (arg1 entity-actor)) (set! (-> arg0 flags) (battle-spawner-flags)) (set! (-> arg0 entity) arg1) (set! (-> arg0 creature-index) 0) @@ -1854,16 +1854,16 @@ (set! (-> arg0 intro-path) #f) (set! (-> arg0 notice-attack-delay) (the-as uint (rand-vu-int-range - (the-as int (-> obj info min-spawner-notice-attack-delay)) - (the-as int (-> obj info max-spawner-notice-attack-delay)) + (the-as int (-> this info min-spawner-notice-attack-delay)) + (the-as int (-> this info max-spawner-notice-attack-delay)) ) ) ) (set! (-> arg0 creature) (the-as handle #f)) (set! (-> arg0 last-spawn-time) 0) (set! (-> arg0 noticed-attack-time) 0) - (initialize-spawner-breeds obj arg0 arg1) - (let ((a0-4 (new 'process 'path-control obj 'intro 0.0 arg1 #t))) + (initialize-spawner-breeds this arg0 arg1) + (let ((a0-4 (new 'process 'path-control this 'intro 0.0 arg1 #t))) (cond ((nonzero? a0-4) (set! (-> arg0 intro-path) a0-4) @@ -1891,7 +1891,7 @@ ;; definition for method 31 of type battle ;; WARN: Return type mismatch int vs none. -(defmethod initialize-ally battle ((obj battle) (arg0 battle-ally) (arg1 entity-actor)) +(defmethod initialize-ally battle ((this battle) (arg0 battle-ally) (arg1 entity-actor)) (set! (-> arg0 entity) arg1) 0 (none) @@ -1900,10 +1900,10 @@ ;; definition for method 28 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod initialize-enemy-lists battle ((obj battle)) +(defmethod initialize-enemy-lists battle ((this battle)) (local-vars (v0-4 battle-ally-array) (sv-16 res-tag) (sv-32 entity)) (set! sv-16 (new 'static 'res-tag)) - (let ((v0-0 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v0-0 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (when (and v0-0 (nonzero? (-> sv-16 elt-count))) (let* ((s5-0 (-> (the-as (pointer actor-group) v0-0) 0)) (s4-0 (-> s5-0 length)) @@ -1924,8 +1924,8 @@ 0 ) (else - (let ((a1-2 (-> obj spawners data (+ s1-0 -1)))) - (initialize-spawner obj a1-2 (the-as entity-actor sv-32)) + (let ((a1-2 (-> this spawners data (+ s1-0 -1)))) + (initialize-spawner this a1-2 (the-as entity-actor sv-32)) ) ) ) @@ -1938,8 +1938,8 @@ 0 ) (else - (let ((a1-3 (-> obj allies data (+ s2-0 -1)))) - (initialize-ally obj a1-3 (the-as entity-actor sv-32)) + (let ((a1-3 (-> this allies data (+ s2-0 -1)))) + (initialize-ally this a1-3 (the-as entity-actor sv-32)) ) ) ) @@ -1950,9 +1950,9 @@ ) ) (set! v0-4 (when (zero? s3-0) - (set! (-> obj spawners) (new 'process 'battle-spawner-array s1-0)) + (set! (-> this spawners) (new 'process 'battle-spawner-array s1-0)) (set! v0-4 (new 'process 'battle-ally-array s2-0)) - (set! (-> obj allies) v0-4) + (set! (-> this allies) v0-4) v0-4 ) ) @@ -1967,18 +1967,18 @@ ;; definition for method 33 of type battle ;; WARN: Return type mismatch int vs none. -(defmethod initialize-battle battle ((obj battle)) - (set! (-> obj spawn-initial-creatures?) #t) - (set! (-> obj count) (the-as uint 0)) - (set! (-> obj die-count) (the-as uint 0)) - (set! (-> obj stat-child-count) (the-as uint 0)) - (let ((v1-2 (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0)) +(defmethod initialize-battle battle ((this battle)) + (set! (-> this spawn-initial-creatures?) #t) + (set! (-> this count) (the-as uint 0)) + (set! (-> this die-count) (the-as uint 0)) + (set! (-> this stat-child-count) (the-as uint 0)) + (let ((v1-2 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0)) (a0-2 *battles*) ) (dotimes (a1-1 (-> a0-2 length)) (let ((a2-3 (-> a0-2 a1-1))) (when (= (the-as uint v1-2) (-> a2-3 id)) - (set! (-> obj info) a2-3) + (set! (-> this info) a2-3) (goto cfg-7) ) ) @@ -1986,31 +1986,31 @@ ) (go process-drawable-art-error "bad battle id") (label cfg-7) - (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice basic)) - (set! (-> obj on-hostile) (res-lump-struct (-> obj entity) 'on-hostile basic)) - (set! (-> obj on-beaten) (res-lump-struct (-> obj entity) 'on-beaten basic)) - (initialize-enemy-lists obj) - (+! (-> obj count) (-> obj allies length)) - (let ((v1-16 (-> obj info max-count))) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice basic)) + (set! (-> this on-hostile) (res-lump-struct (-> this entity) 'on-hostile basic)) + (set! (-> this on-beaten) (res-lump-struct (-> this entity) 'on-beaten basic)) + (initialize-enemy-lists this) + (+! (-> this count) (-> this allies length)) + (let ((v1-16 (-> this info max-count))) (cond - ((and (= v1-16 #x20000000) (zero? (-> obj spawners length))) - (set! v1-16 (-> obj count)) + ((and (= v1-16 #x20000000) (zero? (-> this spawners length))) + (set! v1-16 (-> this count)) ) - ((< v1-16 (-> obj count)) - (set! v1-16 (-> obj count)) + ((< v1-16 (-> this count)) + (set! v1-16 (-> this count)) ) ) - (set! (-> obj max-count) v1-16) + (set! (-> this max-count) v1-16) ) 0 (none) ) ;; definition for method 34 of type battle -(defmethod init-go battle ((obj battle)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj beaten)) - (go (method-of-object obj idle)) +(defmethod init-go battle ((this battle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this beaten)) + (go (method-of-object this idle)) ) 0 ) @@ -2018,21 +2018,21 @@ ;; definition for method 11 of type battle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-from-entity! battle ((obj battle) (arg0 entity-actor)) +(defmethod init-from-entity! battle ((this battle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask enemy)) (let ((s4-0 (new 'process 'trsqv))) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) (set! (-> s4-0 trans quad) (-> arg0 extra trans quad)) (quaternion-copy! (-> s4-0 quat) (-> arg0 quat)) (vector-identity! (-> s4-0 scale)) ) - (initialize-battle obj) - (init-go obj) + (initialize-battle this) + (init-go this) (none) ) 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 f5ba875ca3..ca3d23c131 100644 --- a/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/elec-gate_REF.gc @@ -15,19 +15,19 @@ ) ;; definition for method 3 of type elec-gate-params -(defmethod inspect elec-gate-params ((obj elec-gate-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect elec-gate-params ((this elec-gate-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'elec-gate-params) - (format #t "~1Tbolt-spec: ~A~%" (-> obj bolt-spec)) - (format #t "~1Tring-spec: ~A~%" (-> obj ring-spec)) - (format #t "~1Tring-radius-min: ~f~%" (-> obj ring-radius-min)) - (format #t "~1Tring-radius-max: ~f~%" (-> obj ring-radius-max)) - (format #t "~1Tspeed-mult: ~f~%" (-> obj speed-mult)) + (format #t "[~8x] ~A~%" this 'elec-gate-params) + (format #t "~1Tbolt-spec: ~A~%" (-> this bolt-spec)) + (format #t "~1Tring-spec: ~A~%" (-> this ring-spec)) + (format #t "~1Tring-radius-min: ~f~%" (-> this ring-radius-min)) + (format #t "~1Tring-radius-max: ~f~%" (-> this ring-radius-max)) + (format #t "~1Tspeed-mult: ~f~%" (-> this speed-mult)) (label cfg-4) - obj + this ) ;; definition of type elec-gate-bolt @@ -43,18 +43,18 @@ ) ;; definition for method 3 of type elec-gate-bolt -(defmethod inspect elec-gate-bolt ((obj elec-gate-bolt)) - (when (not obj) - (set! obj obj) +(defmethod inspect elec-gate-bolt ((this elec-gate-bolt)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'elec-gate-bolt) - (format #t "~1Tring[2] @ #x~X~%" (-> obj ring)) - (format #t "~1Tbolt: ~A~%" (-> obj bolt)) - (format #t "~1Tring-radius: ~f~%" (-> obj ring-radius)) - (format #t "~1Tpos: ~f~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this 'elec-gate-bolt) + (format #t "~1Tring[2] @ #x~X~%" (-> this ring)) + (format #t "~1Tbolt: ~A~%" (-> this bolt)) + (format #t "~1Tring-radius: ~f~%" (-> this ring-radius)) + (format #t "~1Tpos: ~f~%" (-> this pos)) (label cfg-4) - obj + this ) ;; definition of type elec-wall @@ -68,16 +68,16 @@ ) ;; definition for method 3 of type elec-wall -(defmethod inspect elec-wall ((obj elec-wall)) - (when (not obj) - (set! obj obj) +(defmethod inspect elec-wall ((this elec-wall)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'elec-wall) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tdir: #~%" (-> obj dir)) + (format #t "[~8x] ~A~%" this 'elec-wall) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tdir: #~%" (-> this dir)) (label cfg-4) - obj + this ) ;; definition of type elec-gate @@ -118,32 +118,32 @@ ) ;; definition for method 3 of type elec-gate -(defmethod inspect elec-gate ((obj elec-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect elec-gate ((this elec-gate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tparams: #~%" (-> obj params)) - (format #t "~2Tpath-l: ~A~%" (-> obj path)) - (format #t "~2Tpath-r: ~A~%" (-> obj path-r)) - (format #t "~2Tl-bolt[5] @ #x~X~%" (-> obj l-bolt)) - (format #t "~2Tpart-on: ~A~%" (-> obj part)) - (format #t "~2Tpart-off: ~A~%" (-> obj part-off)) - (format #t "~2Tpart-spawner-left: ~A~%" (-> obj part-spawner-left)) - (format #t "~2Tpart-spawner-right: ~A~%" (-> obj part-spawner-right)) - (format #t "~2Ton-start: ~A~%" (-> obj on-start)) - (format #t "~2Ton-stop: ~A~%" (-> obj on-stop)) - (format #t "~2Tdividing-wall: #~%" (-> obj dividing-wall)) - (format #t "~2Tplane[2] @ #x~X~%" (-> obj plane)) - (format #t "~2Twall-y: ~f~%" (-> obj wall-y)) - (format #t "~2Twall-xz: ~f~%" (-> obj wall-xz)) - (format #t "~2Tlightning-quality: ~f~%" (-> obj lightning-quality)) - (format #t "~2Tquality-enabled?: ~A~%" (-> obj quality-enabled?)) + (format #t "~2Tparams: #~%" (-> this params)) + (format #t "~2Tpath-l: ~A~%" (-> this path)) + (format #t "~2Tpath-r: ~A~%" (-> this path-r)) + (format #t "~2Tl-bolt[5] @ #x~X~%" (-> this l-bolt)) + (format #t "~2Tpart-on: ~A~%" (-> this part)) + (format #t "~2Tpart-off: ~A~%" (-> this part-off)) + (format #t "~2Tpart-spawner-left: ~A~%" (-> this part-spawner-left)) + (format #t "~2Tpart-spawner-right: ~A~%" (-> this part-spawner-right)) + (format #t "~2Ton-start: ~A~%" (-> this on-start)) + (format #t "~2Ton-stop: ~A~%" (-> this on-stop)) + (format #t "~2Tdividing-wall: #~%" (-> this dividing-wall)) + (format #t "~2Tplane[2] @ #x~X~%" (-> this plane)) + (format #t "~2Twall-y: ~f~%" (-> this wall-y)) + (format #t "~2Twall-xz: ~f~%" (-> this wall-xz)) + (format #t "~2Tlightning-quality: ~f~%" (-> this lightning-quality)) + (format #t "~2Tquality-enabled?: ~A~%" (-> this quality-enabled?)) (label cfg-4) - obj + this ) ;; definition for symbol *default-elec-gate-params*, type elec-gate-params @@ -782,11 +782,11 @@ ;; definition for method 28 of type elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-elec-scale-if-close! elec-gate ((obj elec-gate) (arg0 float)) +(defmethod set-elec-scale-if-close! elec-gate ((this elec-gate) (arg0 float)) "If [[target]]'s position is within `80` [[meters]], set the scale to the value provided @see [[elec-gate::29]]" - (if (< (vector-vector-distance (-> obj root trans) (target-pos 0)) 327680.0) - (set-elec-scale! obj arg0) + (if (< (vector-vector-distance (-> this root trans) (target-pos 0)) 327680.0) + (set-elec-scale! this arg0) ) 0 (none) @@ -794,13 +794,13 @@ ;; definition for method 27 of type elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod spawn-particles elec-gate ((obj elec-gate) (sparticle-lc sparticle-launch-control)) +(defmethod spawn-particles elec-gate ((this elec-gate) (sparticle-lc sparticle-launch-control)) "TODO - Calls [[sparticle-launch-control::11]] on `part-spawner-left` and `part-spawner-right` if they are defined" - (if (-> obj part-spawner-left) - (spawn sparticle-lc (the-as vector (&-> (-> obj part-spawner-left child) 8))) + (if (-> this part-spawner-left) + (spawn sparticle-lc (the-as vector (&-> (-> this part-spawner-left child) 8))) ) - (if (-> obj part-spawner-right) - (spawn sparticle-lc (the-as vector (&-> (-> obj part-spawner-right child) 8))) + (if (-> this part-spawner-right) + (spawn sparticle-lc (the-as vector (&-> (-> this part-spawner-right child) 8))) ) 0 (none) @@ -808,9 +808,9 @@ ;; definition for method 7 of type elec-gate ;; WARN: Return type mismatch process-drawable vs elec-gate. -(defmethod relocate elec-gate ((obj elec-gate) (new-addr int)) +(defmethod relocate elec-gate ((this elec-gate) (new-addr int)) (dotimes (bolt-idx 5) - (let ((left-bolt (-> obj l-bolt bolt-idx))) + (let ((left-bolt (-> this l-bolt bolt-idx))) (if (nonzero? (-> left-bolt bolt)) (&+! (-> left-bolt bolt) new-addr) ) @@ -822,40 +822,40 @@ ) ) ) - (if (nonzero? (-> obj path-r)) - (&+! (-> obj path-r) new-addr) + (if (nonzero? (-> this path-r)) + (&+! (-> this path-r) new-addr) ) - (when (nonzero? (-> obj part-off)) - (if (nonzero? (-> obj part-off)) - (&+! (-> obj part-off) new-addr) + (when (nonzero? (-> this part-off)) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) new-addr) ) ) - (the-as elec-gate ((method-of-type process-drawable relocate) obj new-addr)) + (the-as elec-gate ((method-of-type process-drawable relocate) this new-addr)) ) ;; definition for method 10 of type elec-gate -(defmethod deactivate elec-gate ((obj elec-gate)) - (set-elec-scale-if-close! obj 0.0) - ((the-as (function process-drawable none) (find-parent-method elec-gate 10)) obj) +(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) (none) ) ;; definition for method 23 of type elec-gate -(defmethod get-params elec-gate ((obj elec-gate)) +(defmethod get-params elec-gate ((this elec-gate)) "@returns [[*default-elec-gate-params*]] by default" *default-elec-gate-params* ) ;; definition for method 24 of type elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod elec-gate-method-24 elec-gate ((obj elec-gate)) +(defmethod elec-gate-method-24 elec-gate ((this elec-gate)) 0 (none) ) ;; definition for method 25 of type elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-palette! elec-gate ((obj elec-gate)) +(defmethod set-palette! elec-gate ((this elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" 0 (none) @@ -863,16 +863,16 @@ ;; definition for method 26 of type elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-state! elec-gate ((obj elec-gate)) +(defmethod set-state! elec-gate ((this elec-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. Otherwise, the gate will be `active`." - (if (or (logtest? (actor-option user17) (-> obj fact options)) - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (if (or (logtest? (actor-option user17) (-> this fact options)) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) ) - (go (method-of-object obj idle)) - (go (method-of-object obj active)) + (go (method-of-object this idle)) + (go (method-of-object this active)) ) 0 (none) @@ -880,33 +880,33 @@ Otherwise, the gate will be `active`." ;; definition for method 11 of type elec-gate ;; INFO: Used lq/sq -(defmethod init-from-entity! elec-gate ((obj elec-gate) (arg0 entity-actor)) +(defmethod init-from-entity! elec-gate ((this elec-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj entity) arg0) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this entity) arg0) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj params) (get-params obj)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'path-control obj 'pathl 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-r) (new 'process 'path-control obj 'pathr 0.0 (the-as entity #f) #f)) - (logior! (-> obj path-r flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj part-spawner-left) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 0))) - (set! (-> obj part-spawner-right) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 1))) - (let ((params (-> obj params))) + (set! (-> this params) (get-params this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'path-control this 'pathl 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-r) (new 'process 'path-control this 'pathr 0.0 (the-as entity #f) #f)) + (logior! (-> this path-r flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this part-spawner-left) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 0))) + (set! (-> this part-spawner-right) (the-as part-spawner (entity-actor-lookup arg0 'alt-actor 1))) + (let ((params (-> this params))) (dotimes (bolt-idx 5) - (let ((left-bolt (-> obj l-bolt bolt-idx))) - (set! (-> left-bolt bolt) (new 'process 'lightning-control (-> params bolt-spec) obj 0.0)) - (set! (-> left-bolt ring 0) (new 'process 'lightning-control (-> params ring-spec) obj 0.0)) - (set! (-> left-bolt ring 1) (new 'process 'lightning-control (-> params ring-spec) obj 0.0)) + (let ((left-bolt (-> this l-bolt bolt-idx))) + (set! (-> left-bolt bolt) (new 'process 'lightning-control (-> params bolt-spec) this 0.0)) + (set! (-> left-bolt ring 0) (new 'process 'lightning-control (-> params ring-spec) this 0.0)) + (set! (-> left-bolt ring 1) (new 'process 'lightning-control (-> params ring-spec) this 0.0)) (set! (-> left-bolt ring-radius) (rand-vu-float-range (-> params ring-radius-min) (-> params ring-radius-max)) ) @@ -914,49 +914,49 @@ This commonly includes things such as: ) ) ) - (let* ((s4-1 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp)) - (v1-26 (get-point-in-path! (-> obj path-r) (new 'stack-no-clear 'vector) 0.0 'interp)) + (let* ((s4-1 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-26 (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp)) (a1-15 (vector-! (new 'stack-no-clear 'vector) v1-26 s4-1)) (s5-3 (vector+float*! (new 'stack-no-clear 'vector) s4-1 a1-15 0.5)) (v1-28 (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-15 1.0)) ) (vector-cross! v1-28 v1-28 *up-vector*) - (set! (-> obj dividing-wall pos quad) (-> s5-3 quad)) - (set! (-> obj dividing-wall dir quad) (-> v1-28 quad)) - (vector+float*! (the-as vector (-> obj plane)) s5-3 v1-28 12288.0) - (set! (-> (the-as vector (-> obj plane 0 dir)) quad) (-> v1-28 quad)) + (set! (-> this dividing-wall pos quad) (-> s5-3 quad)) + (set! (-> this dividing-wall dir quad) (-> v1-28 quad)) + (vector+float*! (the-as vector (-> this plane)) s5-3 v1-28 12288.0) + (set! (-> (the-as vector (-> this plane 0 dir)) quad) (-> v1-28 quad)) (vector-float*! v1-28 v1-28 -1.0) - (vector+float*! (the-as vector (-> obj plane 1)) s5-3 v1-28 12288.0) - (set! (-> (the-as vector (-> obj plane 1 dir)) quad) (-> v1-28 quad)) + (vector+float*! (the-as vector (-> this plane 1)) s5-3 v1-28 12288.0) + (set! (-> (the-as vector (-> this plane 1 dir)) quad) (-> v1-28 quad)) ) - (set! (-> obj wall-xz) + (set! (-> this wall-xz) (vector-vector-distance - (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp) - (get-point-in-path! (-> obj path-r) (new 'stack-no-clear 'vector) 0.0 'interp) + (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp) + (get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp) ) ) - (set! (-> obj wall-xz) (* 0.5 (-> obj wall-xz))) - (+! (-> obj wall-xz) 4096.0) - (set! (-> obj wall-y) + (set! (-> this wall-xz) (* 0.5 (-> this wall-xz))) + (+! (-> this wall-xz) 4096.0) + (set! (-> this wall-y) (fabs - (- (-> (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (get-num-segments (-> obj path)) 'interp) + (- (-> (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (get-num-segments (-> this path)) 'interp) y ) - (-> (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp) y) + (-> (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp) y) ) ) ) - (+! (-> obj wall-y) 4096.0) - (set! (-> obj quality-enabled?) #t) - (set! (-> obj lightning-quality) 1.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "electric-gate" :fo-max 70) (-> obj root trans)) + (+! (-> this wall-y) 4096.0) + (set! (-> this quality-enabled?) #t) + (set! (-> this lightning-quality) 1.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "electric-gate" :fo-max 70) (-> this root trans)) ) - (set! (-> obj on-start) (res-lump-struct (-> obj entity) 'on-start pair)) - (set! (-> obj on-stop) (res-lump-struct (-> obj entity) 'on-stop pair)) - (elec-gate-method-24 obj) - (set-palette! obj) - (set-state! obj) + (set! (-> this on-start) (res-lump-struct (-> this entity) 'on-start pair)) + (set! (-> this on-stop) (res-lump-struct (-> this entity) 'on-stop pair)) + (elec-gate-method-24 this) + (set-palette! this) + (set-state! this) (none) ) @@ -971,37 +971,37 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-elec-gate -(defmethod inspect fort-elec-gate ((obj fort-elec-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-elec-gate ((this fort-elec-gate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elec-gate inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpalette-id: ~D~%" (-> obj palette-id)) + (format #t "~2Tpalette-id: ~D~%" (-> this palette-id)) (label cfg-4) - obj + this ) ;; definition for method 29 of type fort-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-elec-scale! fort-elec-gate ((obj fort-elec-gate) (scale float)) +(defmethod set-elec-scale! fort-elec-gate ((this fort-elec-gate) (scale float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" (set-fordumpa-electricity-scale! scale) - (set-forresca-electricity-scale! scale (-> obj palette-id)) - (set-forrescb-electricity-scale! scale (-> obj palette-id)) + (set-forresca-electricity-scale! scale (-> this palette-id)) + (set-forrescb-electricity-scale! scale (-> this palette-id)) 0 (none) ) ;; definition for method 25 of type fort-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-palette! fort-elec-gate ((obj fort-elec-gate)) +(defmethod set-palette! fort-elec-gate ((this fort-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" - (set! (-> obj palette-id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) + (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 (none) ) @@ -1017,35 +1017,35 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-elec-gate -(defmethod inspect drill-elec-gate ((obj drill-elec-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-elec-gate ((this drill-elec-gate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elec-gate inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpalette-id: ~D~%" (-> obj palette-id)) + (format #t "~2Tpalette-id: ~D~%" (-> this palette-id)) (label cfg-4) - obj + this ) ;; definition for method 29 of type drill-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-elec-scale! drill-elec-gate ((obj drill-elec-gate) (arg0 float)) +(defmethod set-elec-scale! drill-elec-gate ((this drill-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" - (set-drill-electricity-scale! arg0 (-> obj palette-id)) + (set-drill-electricity-scale! arg0 (-> this palette-id)) 0 (none) ) ;; definition for method 25 of type drill-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-palette! drill-elec-gate ((obj drill-elec-gate)) +(defmethod set-palette! drill-elec-gate ((this drill-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" - (set! (-> obj palette-id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) + (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 (none) ) @@ -1060,16 +1060,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type caspad-elec-gate -(defmethod inspect caspad-elec-gate ((obj caspad-elec-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect caspad-elec-gate ((this caspad-elec-gate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elec-gate inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type castle-elec-gate @@ -1082,21 +1082,21 @@ This commonly includes things such as: ) ;; definition for method 3 of type castle-elec-gate -(defmethod inspect castle-elec-gate ((obj castle-elec-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect castle-elec-gate ((this castle-elec-gate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elec-gate inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 29 of type castle-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-elec-scale! castle-elec-gate ((obj castle-elec-gate) (arg0 float)) +(defmethod set-elec-scale! castle-elec-gate ((this castle-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" @@ -1151,7 +1151,7 @@ This commonly includes things such as: ) ;; definition for method 23 of type caspad-elec-gate -(defmethod get-params caspad-elec-gate ((obj caspad-elec-gate)) +(defmethod get-params caspad-elec-gate ((this caspad-elec-gate)) "@returns [[*default-elec-gate-params*]] by default" *caspad-elec-gate-params* ) @@ -1167,35 +1167,35 @@ This commonly includes things such as: ) ;; definition for method 3 of type palroof-elec-gate -(defmethod inspect palroof-elec-gate ((obj palroof-elec-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect palroof-elec-gate ((this palroof-elec-gate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elec-gate inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpalette-id: ~D~%" (-> obj palette-id)) + (format #t "~2Tpalette-id: ~D~%" (-> this palette-id)) (label cfg-4) - obj + this ) ;; definition for method 29 of type palroof-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-elec-scale! palroof-elec-gate ((obj palroof-elec-gate) (arg0 float)) +(defmethod set-elec-scale! palroof-elec-gate ((this palroof-elec-gate) (arg0 float)) "Calls associated mood functions to set the scale with the value provided @see mood-funcs @see mood-funcs2" - (set-palroof-electricity-scale! arg0 (-> obj palette-id)) + (set-palroof-electricity-scale! arg0 (-> this palette-id)) 0 (none) ) ;; definition for method 25 of type palroof-elec-gate ;; WARN: Return type mismatch int vs none. -(defmethod set-palette! palroof-elec-gate ((obj palroof-elec-gate)) +(defmethod set-palette! palroof-elec-gate ((this palroof-elec-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" - (set! (-> obj palette-id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) + (set! (-> this palette-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc index 835f3b2c72..83477c7d55 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/amphibian/amphibian_REF.gc @@ -21,25 +21,25 @@ ) ;; definition for method 3 of type amphibian-tongue-attack-info -(defmethod inspect amphibian-tongue-attack-info ((obj amphibian-tongue-attack-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect amphibian-tongue-attack-info ((this amphibian-tongue-attack-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'amphibian-tongue-attack-info) - (format #t "~1Ttarg-dist: ~f~%" (-> obj targ-dist)) - (format #t "~1Tmax-length: ~f~%" (-> obj max-length)) - (format #t "~1Tstart-pos: #~%" (-> obj start-pos)) - (format #t "~1Tbase-dir: #~%" (-> obj base-dir)) - (format #t "~1Tbase-rot: #~%" (-> obj base-rot)) - (format #t "~1Ttarg-pos: #~%" (-> obj targ-pos)) - (format #t "~1Ttarg-dir: #~%" (-> obj targ-dir)) - (format #t "~1Ttarg-rot: #~%" (-> obj targ-rot)) - (format #t "~1Tclamped-pos: #~%" (-> obj clamped-pos)) - (format #t "~1Tclamped-dir: #~%" (-> obj clamped-dir)) - (format #t "~1Tclamped-rot: #~%" (-> obj clamped-rot)) + (format #t "[~8x] ~A~%" this 'amphibian-tongue-attack-info) + (format #t "~1Ttarg-dist: ~f~%" (-> this targ-dist)) + (format #t "~1Tmax-length: ~f~%" (-> this max-length)) + (format #t "~1Tstart-pos: #~%" (-> this start-pos)) + (format #t "~1Tbase-dir: #~%" (-> this base-dir)) + (format #t "~1Tbase-rot: #~%" (-> this base-rot)) + (format #t "~1Ttarg-pos: #~%" (-> this targ-pos)) + (format #t "~1Ttarg-dir: #~%" (-> this targ-dir)) + (format #t "~1Ttarg-rot: #~%" (-> this targ-rot)) + (format #t "~1Tclamped-pos: #~%" (-> this clamped-pos)) + (format #t "~1Tclamped-dir: #~%" (-> this clamped-dir)) + (format #t "~1Tclamped-rot: #~%" (-> this clamped-rot)) (label cfg-4) - obj + this ) ;; definition of type amphibian-joint-mod @@ -59,18 +59,18 @@ ) ;; definition for method 3 of type amphibian-joint-mod -(defmethod inspect amphibian-joint-mod ((obj amphibian-joint-mod)) - (when (not obj) - (set! obj obj) +(defmethod inspect amphibian-joint-mod ((this amphibian-joint-mod)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~1Tproc: ~A~%" (-> obj proc)) - (format #t "~1Tmax-length: ~f~%" (-> obj max-length)) - (format #t "~1Ttarget: #~%" (-> obj target)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~1Tproc: ~A~%" (-> this proc)) + (format #t "~1Tmax-length: ~f~%" (-> this max-length)) + (format #t "~1Ttarget: #~%" (-> this target)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -90,15 +90,15 @@ ) ;; definition for method 3 of type amphibian-anim-info -(defmethod inspect amphibian-anim-info ((obj amphibian-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect amphibian-anim-info ((this amphibian-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'amphibian-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "[~8x] ~A~%" this 'amphibian-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) (label cfg-4) - obj + this ) ;; definition of type amphibian-global-info @@ -120,24 +120,24 @@ ) ;; definition for method 3 of type amphibian-global-info -(defmethod inspect amphibian-global-info ((obj amphibian-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect amphibian-global-info ((this amphibian-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tprev-knocked: ~D~%" (-> obj prev-knocked)) - (format #t "~1Tnotice-anim[2] @ #x~X~%" (-> obj notice-anim)) - (format #t "~1Trun-anim[2] @ #x~X~%" (-> obj run-anim)) - (format #t "~1Tknocked-anim[3] @ #x~X~%" (-> obj knocked-anim)) - (format #t "~1Tknocked-land-anim[3] @ #x~X~%" (-> obj knocked-land-anim)) - (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim)) - (format #t "~1Tjump-wind-up-anim[2] @ #x~X~%" (-> obj jump-wind-up-anim)) - (format #t "~1Tjump-in-air-anim[2] @ #x~X~%" (-> obj jump-in-air-anim)) - (format #t "~1Tjump-land-anim[2] @ #x~X~%" (-> obj jump-land-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tprev-knocked: ~D~%" (-> this prev-knocked)) + (format #t "~1Tnotice-anim[2] @ #x~X~%" (-> this notice-anim)) + (format #t "~1Trun-anim[2] @ #x~X~%" (-> this run-anim)) + (format #t "~1Tknocked-anim[3] @ #x~X~%" (-> this knocked-anim)) + (format #t "~1Tknocked-land-anim[3] @ #x~X~%" (-> this knocked-land-anim)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) + (format #t "~1Tjump-wind-up-anim[2] @ #x~X~%" (-> this jump-wind-up-anim)) + (format #t "~1Tjump-in-air-anim[2] @ #x~X~%" (-> this jump-in-air-anim)) + (format #t "~1Tjump-land-anim[2] @ #x~X~%" (-> this jump-land-anim)) (label cfg-4) - obj + this ) ;; definition of type amphibian @@ -171,25 +171,25 @@ ) ;; definition for method 3 of type amphibian -(defmethod inspect amphibian ((obj amphibian)) - (when (not obj) - (set! obj obj) +(defmethod inspect amphibian ((this amphibian)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttongue-scale: ~f~%" (-> obj tongue-scale)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tknocked-anim-index: ~D~%" (-> obj knocked-anim-index)) - (format #t "~2Tjump-anim-index: ~D~%" (-> obj jump-anim-index)) - (format #t "~2Ttongue-mode: ~D~%" (-> obj tongue-mode)) - (format #t "~2Ttongue-mod: ~A~%" (-> obj tongue-mod)) - (format #t "~2Tattacker-handle: ~D~%" (-> obj attacker-handle)) - (format #t "~2Tprev-ry: ~f~%" (-> obj prev-ry)) - (format #t "~2Tprev-ry1: ~f~%" (-> obj prev-ry1)) + (format #t "~2Ttongue-scale: ~f~%" (-> this tongue-scale)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tknocked-anim-index: ~D~%" (-> this knocked-anim-index)) + (format #t "~2Tjump-anim-index: ~D~%" (-> this jump-anim-index)) + (format #t "~2Ttongue-mode: ~D~%" (-> this tongue-mode)) + (format #t "~2Ttongue-mod: ~A~%" (-> this tongue-mod)) + (format #t "~2Tattacker-handle: ~D~%" (-> this attacker-handle)) + (format #t "~2Tprev-ry: ~f~%" (-> this prev-ry)) + (format #t "~2Tprev-ry1: ~f~%" (-> this prev-ry1)) (label cfg-4) - obj + this ) ;; definition for symbol *amphibian-global-info*, type amphibian-global-info @@ -348,53 +348,53 @@ (set! (-> *amphibian-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 7 of type amphibian-joint-mod -(defmethod relocate amphibian-joint-mod ((obj amphibian-joint-mod) (arg0 int)) - (&+! (-> obj proc) arg0) - obj +(defmethod relocate amphibian-joint-mod ((this amphibian-joint-mod) (arg0 int)) + (&+! (-> this proc) arg0) + this ) ;; definition for method 74 of type amphibian -(defmethod general-event-handler amphibian ((obj amphibian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler amphibian ((this amphibian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (when (= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + (when (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) 0 ) - (when (zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + (when (zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) 0 ) ) ) - (go (method-of-object obj knocked)) - (if (and (logtest? (-> obj incoming penetrate-using) 16) - (nonzero? (-> obj hit-points)) - (zero? (-> obj fated-time)) + (go (method-of-object this knocked)) + (if (and (logtest? (-> this incoming penetrate-using) 16) + (nonzero? (-> this hit-points)) + (zero? (-> this fated-time)) ) 'push #t ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -433,10 +433,10 @@ ;; definition for method 9 of type amphibian-joint-mod ;; WARN: Return type mismatch amphibian-joint-mod vs none. -(defmethod amphibian-joint-mod-method-9 amphibian-joint-mod ((obj amphibian-joint-mod)) - (let ((v1-3 (-> obj proc node-list data (-> obj joint-index)))) +(defmethod amphibian-joint-mod-method-9 amphibian-joint-mod ((this amphibian-joint-mod)) + (let ((v1-3 (-> this proc node-list data (-> this joint-index)))) (set! (-> v1-3 param0) amphibian-joint-mod-callback) - (set! (-> v1-3 param1) obj) + (set! (-> v1-3 param1) this) ) (none) ) @@ -452,14 +452,14 @@ ;; definition for method 106 of type amphibian ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-106 amphibian ((obj amphibian) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 amphibian ((this amphibian) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) - (t9-0 obj arg0 arg1 arg2 arg3) + (t9-0 this arg0 arg1 arg2 arg3) ) - (let ((a0-3 (enemy-method-134 obj arg0 arg3))) + (let ((a0-3 (enemy-method-134 this arg0 arg3))) (if a0-3 - (set! (-> obj attacker-handle) (process->handle a0-3)) - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (process->handle a0-3)) + (set! (-> this attacker-handle) (the-as handle #f)) ) ) 0 @@ -467,12 +467,12 @@ ) ;; definition for method 56 of type amphibian -(defmethod damage-amount-from-attack amphibian ((obj amphibian) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack amphibian ((this amphibian) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (let ((v1-1 (-> obj hit-points))) + (let ((v1-1 (-> this hit-points))) (if (> (- v1-1 v0-0) 0) (set! v0-0 (+ v1-1 -1)) ) @@ -482,20 +482,20 @@ ) ;; definition for method 51 of type amphibian -(defmethod enemy-method-51 amphibian ((obj amphibian)) +(defmethod enemy-method-51 amphibian ((this amphibian)) (local-vars (f0-1 float)) 0.0 (set! f0-1 (cond - ((or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) - ((method-of-type nav-enemy enemy-method-51) obj) + ((or (zero? (-> this hit-points)) (nonzero? (-> this fated-time))) + ((method-of-type nav-enemy enemy-method-51) this) ) (else - (set! f0-1 (quaternion-y-angle (-> obj root quat))) - (let ((a0-5 (handle->process (-> obj focus handle)))) + (set! f0-1 (quaternion-y-angle (-> this root quat))) + (let ((a0-5 (handle->process (-> this focus handle)))) (when a0-5 (let ((v1-12 (get-trans (the-as process-focusable a0-5) 0))) - (set! f0-1 (atan (- (-> v1-12 x) (-> obj root trans x)) (- (-> v1-12 z) (-> obj root trans z)))) + (set! f0-1 (atan (- (-> v1-12 x) (-> this root trans x)) (- (-> v1-12 z) (-> this root trans z)))) ) ) ) @@ -508,32 +508,32 @@ ;; definition for method 52 of type amphibian ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 amphibian ((obj amphibian) (arg0 vector)) +(defmethod enemy-method-52 amphibian ((this amphibian) (arg0 vector)) (cond - ((and (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time)) (!= (-> obj incoming knocked-type) 6)) - (enemy-method-50 obj arg0) - (let ((f30-0 (get-rand-float-range obj 0.0 1.0))) + ((and (nonzero? (-> this hit-points)) (zero? (-> this fated-time)) (!= (-> this incoming knocked-type) 6)) + (enemy-method-50 this arg0) + (let ((f30-0 (get-rand-float-range this 0.0 1.0))) (vector-float*! arg0 arg0 (lerp 43417.6 58982.4 f30-0)) (set! (-> arg0 y) (lerp 114688.0 116736.0 f30-0)) ) ) (else - ((method-of-type nav-enemy enemy-method-52) obj arg0) + ((method-of-type nav-enemy enemy-method-52) this arg0) ) ) (none) ) ;; definition for method 77 of type amphibian -(defmethod enemy-method-77 amphibian ((obj amphibian) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 amphibian ((this amphibian) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (let* ((v1-3 (enemy-method-120 obj 3 (ash 1 (-> *amphibian-global-info* prev-blue-hit)))) - (s5-1 (-> obj draw art-group data (-> *amphibian-global-info* blue-hit-anim v1-3))) + (let* ((v1-3 (enemy-method-120 this 3 (ash 1 (-> *amphibian-global-info* prev-blue-hit)))) + (s5-1 (-> this draw art-group data (-> *amphibian-global-info* blue-hit-anim v1-3))) ) (set! (-> *amphibian-global-info* prev-blue-hit) v1-3) (ja-channel-push! 1 (seconds 0.02)) - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-10 param 1) 1.0) @@ -544,16 +544,16 @@ ) (else (let ((v1-11 0)) - (when (or (zero? (-> obj hit-points)) (nonzero? (-> obj fated-time))) + (when (or (zero? (-> this hit-points)) (nonzero? (-> this fated-time))) (let ((a2-5 (logior (ash 1 (-> *amphibian-global-info* prev-knocked)) 1))) - (set! v1-11 (enemy-method-120 obj 3 a2-5)) + (set! v1-11 (enemy-method-120 this 3 a2-5)) ) ) (set! (-> *amphibian-global-info* prev-knocked) v1-11) - (set! (-> obj knocked-anim-index) v1-11) - (let ((s4-0 (-> obj draw art-group data (-> *amphibian-global-info* knocked-anim v1-11)))) + (set! (-> this knocked-anim-index) v1-11) + (let ((s4-0 (-> this draw art-group data (-> *amphibian-global-info* knocked-anim v1-11)))) (ja-channel-push! 1 0) - (let ((a0-25 (-> obj skel root-channel 0))) + (let ((a0-25 (-> this skel root-channel 0))) (set! (-> a0-25 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-25 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-25 param 1) (-> arg0 0)) @@ -568,31 +568,33 @@ ) ;; definition for method 78 of type amphibian -(defmethod enemy-method-78 amphibian ((obj amphibian) (arg0 (pointer float))) +(defmethod enemy-method-78 amphibian ((this amphibian) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) (ja-channel-push! 1 (seconds 0.015)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 25))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 25))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 25)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 25)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 25)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 25)) num-func-seek!) ) #t ) ) (else - (let ((s4-0 (-> obj draw art-group data (-> *amphibian-global-info* knocked-land-anim (-> obj knocked-anim-index)))) + (let ((s4-0 + (-> this draw art-group data (-> *amphibian-global-info* knocked-land-anim (-> this knocked-anim-index))) + ) ) - (if (zero? (-> obj knocked-anim-index)) + (if (zero? (-> this knocked-anim-index)) (ja-channel-push! 1 (seconds 0.07)) (ja-channel-push! 1 (seconds 0.15)) ) - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-10 param 1) (-> arg0 0)) @@ -606,17 +608,17 @@ ) ;; definition for method 89 of type amphibian -(defmethod enemy-method-89 amphibian ((obj amphibian) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-89 amphibian ((this amphibian) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) - (let* ((v1-5 (get-rand-int obj 2)) - (s4-0 (-> obj draw art-group data (-> *amphibian-global-info* jump-wind-up-anim v1-5))) + (let* ((v1-5 (get-rand-int this 2)) + (s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-wind-up-anim v1-5))) ) - (set! (-> obj jump-anim-index) v1-5) + (set! (-> this jump-anim-index) v1-5) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-9 (-> obj skel root-channel 0))) + (let ((a0-9 (-> this skel root-channel 0))) (set! (-> a0-9 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-9 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-9 param 1) (-> arg0 anim-speed)) @@ -628,10 +630,10 @@ ) ;; definition for method 87 of type amphibian -(defmethod enemy-method-87 amphibian ((obj amphibian) (arg0 enemy-jump-info)) - (let ((s4-0 (-> obj draw art-group data (-> *amphibian-global-info* jump-in-air-anim (-> obj jump-anim-index))))) +(defmethod enemy-method-87 amphibian ((this amphibian) (arg0 enemy-jump-info)) + (let ((s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-in-air-anim (-> this jump-anim-index))))) (ja-channel-push! 1 (seconds 0.07)) - (let ((a0-6 (-> obj skel root-channel 0))) + (let ((a0-6 (-> this skel root-channel 0))) (set! (-> a0-6 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-6 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-6 param 1) (-> arg0 anim-speed)) @@ -643,13 +645,13 @@ ) ;; definition for method 88 of type amphibian -(defmethod enemy-method-88 amphibian ((obj amphibian) (arg0 enemy-jump-info)) - (let ((s4-0 (-> obj draw art-group data (-> *amphibian-global-info* jump-land-anim (-> obj jump-anim-index))))) - (if (zero? (-> obj jump-anim-index)) +(defmethod enemy-method-88 amphibian ((this amphibian) (arg0 enemy-jump-info)) + (let ((s4-0 (-> this draw art-group data (-> *amphibian-global-info* jump-land-anim (-> this jump-anim-index))))) + (if (zero? (-> this jump-anim-index)) (ja-channel-push! 1 (seconds 0.07)) (ja-channel-push! 1 (seconds 0.04)) ) - (let ((a0-7 (-> obj skel root-channel 0))) + (let ((a0-7 (-> this skel root-channel 0))) (set! (-> a0-7 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-7 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-7 param 1) (-> arg0 anim-speed)) @@ -663,26 +665,26 @@ ;; definition for method 90 of type amphibian ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-90 amphibian ((obj amphibian) (arg0 int) (arg1 enemy-jump-info)) - (when (or (= (-> obj jump-why) 3) (= (-> obj jump-why) 2)) +(defmethod enemy-method-90 amphibian ((this amphibian) (arg0 int) (arg1 enemy-jump-info)) + (when (or (= (-> this jump-why) 3) (= (-> this jump-why) 2)) (cond ((zero? arg0) - (logior! (-> obj focus-status) (focus-status touch-water under-water)) + (logior! (-> this focus-status) (focus-status touch-water under-water)) ) (else - (when (focus-test? obj touch-water) + (when (focus-test? this touch-water) (let ((s3-0 (new 'stack-no-clear 'water-info))) - (water-info-init! (-> obj root) s3-0 (collide-action solid semi-solid)) + (water-info-init! (-> this root) s3-0 (collide-action solid semi-solid)) (let ((v1-12 #f)) (cond ((not (logtest? (water-flags touch-water) (-> s3-0 flags))) - (if (focus-test? obj under-water) + (if (focus-test? this under-water) (set! v1-12 #t) ) - (logclear! (-> obj focus-status) (focus-status touch-water under-water)) + (logclear! (-> this focus-status) (focus-status touch-water under-water)) ) - ((focus-test? obj under-water) - (let* ((a0-18 (-> obj root root-prim prim-core)) + ((focus-test? this under-water) + (let* ((a0-18 (-> this root root-prim prim-core)) (f0-1 (+ (-> a0-18 world-sphere y) (-> a0-18 world-sphere w))) ) (if (< (-> s3-0 trans y) f0-1) @@ -692,9 +694,9 @@ ) ) (when v1-12 - (logclear! (-> obj focus-status) (focus-status under-water)) + (logclear! (-> this focus-status) (focus-status under-water)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> obj root trans quad)) + (set! (-> s2-0 quad) (-> this root trans quad)) (when (logtest? (water-flags touch-water) (-> s3-0 flags)) (set! (-> s2-0 y) (-> s3-0 trans y)) (let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000))) @@ -745,30 +747,30 @@ (the-as symbol (cond - ((and (= arg0 3) (= (-> obj jump-anim-index) 1)) - (let* ((v1-35 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((and (= arg0 3) (= (-> this jump-anim-index) 1)) + (let* ((v1-35 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) - (s4-1 (and v1-35 (= v1-35 (-> obj draw art-group data 36)))) + (s4-1 (and v1-35 (= v1-35 (-> this draw art-group data 36)))) ) (cond - ((and (not s4-1) (< (-> obj root transv y) 0.0)) + ((and (not s4-1) (< (-> this root transv y) 0.0)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-37 (-> obj skel root-channel 0))) - (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> obj draw art-group data 36))) + (let ((a0-37 (-> this skel root-channel 0))) + (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> this draw art-group data 36))) (set! (-> a0-37 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 36)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 36)) frames num-frames) -1)) ) (set! (-> a0-37 param 1) (-> arg1 anim-speed)) (set! (-> a0-37 frame-num) 0.0) - (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> obj draw art-group data 36)) num-func-seek!) + (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> this draw art-group data 36)) num-func-seek!) ) #f ) (else (set! s4-1 (and (ja-done? 0) s4-1)) - (let ((a0-39 (-> obj skel root-channel 0))) + (let ((a0-39 (-> this skel root-channel 0))) (set! (-> a0-39 param 0) (the float (+ (-> a0-39 frame-group frames num-frames) -1))) (set! (-> a0-39 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-39 (the-as art-joint-anim #f) num-func-seek!) @@ -780,30 +782,33 @@ ) ) (else - ((method-of-type nav-enemy enemy-method-90) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-90) this arg0 arg1) ) ) ) ) ;; definition for method 184 of type amphibian -(defmethod amphibian-method-184 amphibian ((obj amphibian) (arg0 vector) (arg1 vector)) - (vector<-cspace! arg0 (-> obj node-list data 13)) - (vector-! arg1 (-> obj tongue-mod target) arg0) - (vector-normalize! arg1 (fmin (* (vector-length arg1) (-> obj tongue-scale)) (-> obj tongue-mod max-length))) +(defmethod amphibian-method-184 amphibian ((this amphibian) (arg0 vector) (arg1 vector)) + (vector<-cspace! arg0 (-> this node-list data 13)) + (vector-! arg1 (-> this tongue-mod target) arg0) + (vector-normalize! + arg1 + (fmin (* (vector-length arg1) (-> this tongue-scale)) (-> this tongue-mod max-length)) + ) (vector+! arg1 arg1 arg0) ) ;; definition for method 185 of type amphibian ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod amphibian-method-185 amphibian ((obj amphibian) (arg0 amphibian-tongue-attack-info)) - (let ((a0-1 (-> obj node-list data 11 bone transform))) +(defmethod amphibian-method-185 amphibian ((this amphibian) (arg0 amphibian-tongue-attack-info)) + (let ((a0-1 (-> this node-list data 11 bone transform))) (set! (-> arg0 base-dir quad) (-> a0-1 vector 2 quad)) ) (vector-normalize! (-> arg0 base-dir) 1.0) - (vector<-cspace! (-> arg0 start-pos) (-> obj node-list data 13)) - (let ((a0-7 (handle->process (-> obj focus handle)))) + (vector<-cspace! (-> arg0 start-pos) (-> this node-list data 13)) + (let ((a0-7 (handle->process (-> this focus handle)))) (cond (a0-7 (set! (-> arg0 targ-pos quad) (-> (get-trans (the-as process-focusable a0-7) 3) quad)) @@ -844,7 +849,7 @@ (let ((v1-32 s4-3)) (set! (-> v1-32 radius) 409.6) (set! (-> v1-32 collide-with) (collide-spec backgnd crate obstacle hit-by-others-list pusher)) - (set! (-> v1-32 ignore-process0) obj) + (set! (-> v1-32 ignore-process0) this) (set! (-> v1-32 ignore-process1) #f) (set! (-> v1-32 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-32 action-mask) (collide-action solid)) @@ -861,7 +866,7 @@ ;; definition for method 186 of type amphibian ;; INFO: Used lq/sq -(defmethod amphibian-method-186 amphibian ((obj amphibian) (arg0 vector) (arg1 vector)) +(defmethod amphibian-method-186 amphibian ((this amphibian) (arg0 vector) (arg1 vector)) (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s5-0 (new 'stack-no-clear 'vector)) ) @@ -871,7 +876,7 @@ (let ((v1-4 s4-0)) (set! (-> v1-4 radius) 409.6) (set! (-> v1-4 collide-with) (collide-spec jak bot enemy obstacle hit-by-others-list player-list pusher)) - (set! (-> v1-4 ignore-process0) obj) + (set! (-> v1-4 ignore-process0) this) (set! (-> v1-4 ignore-process1) #f) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) @@ -894,7 +899,7 @@ (vector s5-0) (shove-back (meters 4)) (shove-up (meters 3)) - (damage (the float (-> obj enemy-info attack-damage))) + (damage (the float (-> this enemy-info attack-damage))) ) ) ) @@ -907,109 +912,109 @@ ;; definition for method 76 of type amphibian ;; WARN: Return type mismatch int vs symbol. -(defmethod enemy-method-76 amphibian ((obj amphibian) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 amphibian ((this amphibian) (arg0 process) (arg1 event-message-block)) (let ((t9-0 (method-of-type nav-enemy enemy-method-76))) - (t9-0 obj (the-as process-focusable arg0) arg1) + (t9-0 this (the-as process-focusable arg0) arg1) ) (the-as symbol (when (and (logtest? (-> (the-as process-focusable arg0) root root-prim prim-core collide-as) (collide-spec jak bot)) - (-> obj next-state) - (let ((v1-8 (-> obj next-state name))) + (-> this next-state) + (let ((v1-8 (-> this next-state name))) (or (= v1-8 'stare) (= v1-8 'hostile)) ) ) - (go (method-of-object obj attack-spin)) + (go (method-of-object this attack-spin)) 0 ) ) ) ;; definition for method 67 of type amphibian -(defmethod go-stare amphibian ((obj amphibian)) - (let ((s5-0 (-> obj focus aware))) +(defmethod go-stare amphibian ((this amphibian)) + (let ((s5-0 (-> this focus aware))) (cond - ((or (and (-> obj enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> obj enemy-flags))) - (nav-enemy-method-163 obj) + ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) + (nav-enemy-method-163 this) ) - (go-stare2 obj) + (go-stare2 this) ) - ((and (= s5-0 (enemy-aware enemy-aware-3)) (-> obj enemy-info use-circling)) - (go (method-of-object obj circling)) + ((and (= s5-0 (enemy-aware enemy-aware-3)) (-> this enemy-info use-circling)) + (go (method-of-object this circling)) ) - ((and (= s5-0 (enemy-aware enemy-aware-2)) (-> obj enemy-info use-pacing)) - (go (method-of-object obj pacing)) + ((and (= s5-0 (enemy-aware enemy-aware-2)) (-> this enemy-info use-pacing)) + (go (method-of-object this pacing)) ) ((= s5-0 (enemy-aware unaware)) - (go (method-of-object obj flee)) + (go (method-of-object this flee)) ) (else - (go-stare2 obj) + (go-stare2 this) ) ) ) ) ;; definition for method 70 of type amphibian -(defmethod go-hostile amphibian ((obj amphibian)) - (let* ((s4-0 (handle->process (-> obj attacker-handle))) +(defmethod go-hostile amphibian ((this amphibian)) + (let* ((s4-0 (handle->process (-> this attacker-handle))) (s5-0 (if (type? s4-0 process-focusable) s4-0 ) ) ) (when s5-0 - (set! (-> obj attacker-handle) (the-as handle #f)) - (when (collide-check? (-> obj focus) (the-as process-focusable s5-0)) - (try-update-focus (-> obj focus) (the-as process-focusable s5-0) obj) - (go (method-of-object obj tongue-attack)) + (set! (-> this attacker-handle) (the-as handle #f)) + (when (collide-check? (-> this focus) (the-as process-focusable s5-0)) + (try-update-focus (-> this focus) (the-as process-focusable s5-0) this) + (go (method-of-object this tongue-attack)) ) ) ) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) ;; definition for method 55 of type amphibian -(defmethod track-target! amphibian ((obj amphibian)) +(defmethod track-target! amphibian ((this amphibian)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (set! (-> obj prev-ry) (-> obj prev-ry1)) - (set! (-> obj prev-ry1) (quaternion-y-angle (-> obj root quat))) - ((method-of-type nav-enemy track-target!) obj) + (set! (-> this prev-ry) (-> this prev-ry1)) + (set! (-> this prev-ry1) (quaternion-y-angle (-> this root quat))) + ((method-of-type nav-enemy track-target!) this) (none) ) ;; definition for method 187 of type amphibian ;; WARN: Return type mismatch int vs none. -(defmethod amphibian-method-187 amphibian ((obj amphibian)) +(defmethod amphibian-method-187 amphibian ((this amphibian)) (with-pp - (let* ((f30-0 (-> obj nav state speed)) + (let* ((f30-0 (-> this nav state speed)) (f26-0 0.0) - (f0-1 (quaternion-y-angle (-> obj root quat))) - (f28-0 (deg- f0-1 (-> obj prev-ry))) + (f0-1 (quaternion-y-angle (-> this root quat))) + (f28-0 (deg- f0-1 (-> this prev-ry))) ) (let ((s5-0 #f)) (let ((s4-0 #f)) - (let ((v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (set! f28-0 (cond - ((and v1-6 (or (= v1-6 (-> obj draw art-group data 26)) - (= v1-6 (-> obj draw art-group data 27)) - (= v1-6 (-> obj draw art-group data 16)) + ((and v1-6 (or (= v1-6 (-> this draw art-group data 26)) + (= v1-6 (-> this draw art-group data 27)) + (= v1-6 (-> this draw art-group data 16)) ) ) (set! f26-0 (ja-aframe-num 0)) - (when (= (-> obj skel root-channel 0) (-> obj skel channel)) + (when (= (-> this skel root-channel 0) (-> this skel channel)) (cond ((>= f26-0 13.0) (set! s4-0 #t) ) - ((and (>= 1.0 f26-0) (logtest? (-> obj flags) (amphibian-flags amflags-0))) + ((and (>= 1.0 f26-0) (logtest? (-> this flags) (amphibian-flags amflags-0))) (set! s5-0 #t) ) ) @@ -1023,67 +1028,67 @@ ) ) (if s4-0 - (logior! (-> obj flags) (amphibian-flags amflags-0)) - (logclear! (-> obj flags) (amphibian-flags amflags-0)) + (logior! (-> this flags) (amphibian-flags amflags-0)) + (logclear! (-> this flags) (amphibian-flags amflags-0)) ) ) (cond ((>= f30-0 18432.0) - (let ((v1-29 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-29 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-29 (= v1-29 (-> obj draw art-group data 26))) - (when (and s5-0 (zero? (get-rand-int obj 5))) + ((and v1-29 (= v1-29 (-> this draw art-group data 26))) + (when (and s5-0 (zero? (get-rand-int this 5))) (ja-channel-push! 1 (seconds 0.15)) - (let ((s5-3 (-> obj skel root-channel 0))) + (let ((s5-3 (-> this skel root-channel 0))) (set! (-> s5-3 dist) 12288.0) (joint-control-channel-group-eval! s5-3 - (the-as art-joint-anim (-> obj draw art-group data 27)) + (the-as art-joint-anim (-> this draw art-group data 27)) num-func-identity ) (set! (-> s5-3 frame-num) (ja-aframe f26-0 0)) ) - (logclear! (-> obj flags) (amphibian-flags amflags-0)) + (logclear! (-> this flags) (amphibian-flags amflags-0)) ) ) (else - (let ((v1-45 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-45 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-45 (= v1-45 (-> obj draw art-group data 27))) + ((and v1-45 (= v1-45 (-> this draw art-group data 27))) (when s5-0 (ja-channel-push! 1 (seconds 0.15)) - (let ((s5-4 (-> obj skel root-channel 0))) + (let ((s5-4 (-> this skel root-channel 0))) (set! (-> s5-4 dist) 12288.0) (joint-control-channel-group-eval! s5-4 - (the-as art-joint-anim (-> obj draw art-group data 26)) + (the-as art-joint-anim (-> this draw art-group data 26)) num-func-identity ) (set! (-> s5-4 frame-num) (ja-aframe f26-0 0)) ) - (logclear! (-> obj flags) (amphibian-flags amflags-0)) + (logclear! (-> this flags) (amphibian-flags amflags-0)) ) ) (else (ja-channel-push! 1 (seconds 0.15)) - (let ((s5-5 (-> obj skel root-channel 0))) + (let ((s5-5 (-> this skel root-channel 0))) (set! (-> s5-5 dist) 12288.0) (joint-control-channel-group-eval! s5-5 - (the-as art-joint-anim (-> obj draw art-group data 26)) + (the-as art-joint-anim (-> this draw art-group data 26)) num-func-identity ) (set! (-> s5-5 frame-num) (ja-aframe f26-0 0)) ) - (logclear! (-> obj flags) (amphibian-flags amflags-0)) + (logclear! (-> this flags) (amphibian-flags amflags-0)) ) ) ) @@ -1092,23 +1097,23 @@ ) ) (else - (let ((v1-67 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-67 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (when (not (and v1-67 (= v1-67 (-> obj draw art-group data 16)))) + (when (not (and v1-67 (= v1-67 (-> this draw art-group data 16)))) (ja-channel-push! 1 (seconds 0.1)) - (let ((s5-6 (-> obj skel root-channel 0))) + (let ((s5-6 (-> this skel root-channel 0))) (set! (-> s5-6 dist) 12288.0) (joint-control-channel-group-eval! s5-6 - (the-as art-joint-anim (-> obj draw art-group data 16)) + (the-as art-joint-anim (-> this draw art-group data 16)) num-func-identity ) (set! (-> s5-6 frame-num) (ja-aframe f26-0 0)) ) - (logclear! (-> obj flags) (amphibian-flags amflags-0)) + (logclear! (-> this flags) (amphibian-flags amflags-0)) ) ) ) @@ -1116,7 +1121,7 @@ ) (let* ((f0-15 (fmin 24576.0 (* 0.47123888 (-> pp clock frames-per-second) (fabs f28-0)))) (f0-17 (* 0.00008680556 (fmax f30-0 f0-15))) - (a0-49 (-> obj skel root-channel 0)) + (a0-49 (-> this skel root-channel 0)) ) (set! (-> a0-49 param 0) f0-17) (joint-control-channel-group-eval! a0-49 (the-as art-joint-anim #f) num-func-loop!) @@ -1132,8 +1137,8 @@ :virtual #t :code (behavior () (until #f - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1.067)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1.067)) (amphibian-method-187 self) (suspend) ) @@ -1169,7 +1174,7 @@ 0 (nav-enemy-method-165 self) (ja-no-eval :num! (loop!)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1.067)) + (until (time-elapsed? (-> self state-time) (seconds 1.067)) (amphibian-method-187 self) (suspend) ) @@ -1709,7 +1714,7 @@ :event enemy-event-handler :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 self)) (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-4 nav callback-info) *nav-enemy-null-callback-info*) @@ -1734,7 +1739,7 @@ (let ((v1-0 (-> self tongue-mode))) (cond ((zero? v1-0) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.8)) + (when (time-elapsed? (-> self state-time) (seconds 0.8)) (set! (-> self tongue-mode) (the-as uint 1)) (sound-play "tongue-attack") ) @@ -1793,18 +1798,18 @@ ;; definition for method 7 of type amphibian ;; WARN: Return type mismatch nav-enemy vs amphibian. -(defmethod relocate amphibian ((obj amphibian) (arg0 int)) - (if (nonzero? (-> obj tongue-mod)) - (&+! (-> obj tongue-mod) arg0) +(defmethod relocate amphibian ((this amphibian) (arg0 int)) + (if (nonzero? (-> this tongue-mod)) + (&+! (-> this tongue-mod) arg0) ) - (the-as amphibian ((method-of-type nav-enemy relocate) obj arg0)) + (the-as amphibian ((method-of-type nav-enemy relocate) this arg0)) ) ;; definition for method 114 of type amphibian ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! amphibian ((obj amphibian)) +(defmethod init-enemy-collision! amphibian ((this amphibian)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1874,7 +1879,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1882,30 +1887,30 @@ ;; definition for method 115 of type amphibian ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! amphibian ((obj amphibian)) +(defmethod init-enemy! amphibian ((this amphibian)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (set! (-> obj attacker-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-amphibian" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *amphibian-nav-enemy-info*) - (set! (-> obj tongue-mod) (new 'process 'amphibian-joint-mod obj 14)) - (let ((v1-6 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *amphibian-nav-enemy-info*) + (set! (-> this tongue-mod) (new 'process 'amphibian-joint-mod this 14)) + (let ((v1-6 (-> this neck))) (set! (-> v1-6 up) (the-as uint 1)) (set! (-> v1-6 nose) (the-as uint 2)) (set! (-> v1-6 ear) (the-as uint 0)) (set-vector! (-> v1-6 twist-max) 10012.444 10012.444 0.0 1.0) (set! (-> v1-6 ignore-angle) 20024.889) ) - (let ((v1-8 (-> obj nav))) + (let ((v1-8 (-> this nav))) (set! (-> v1-8 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (set! (-> obj prev-ry) (quaternion-y-angle (-> obj root quat))) - (set! (-> obj prev-ry1) (-> obj prev-ry)) + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this prev-ry) (quaternion-y-angle (-> this root quat))) + (set! (-> this prev-ry1) (-> this prev-ry)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc index ca0bba62e7..3af7e4a317 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/bouncer_REF.gc @@ -21,19 +21,19 @@ ) ;; definition for method 3 of type bouncer -(defmethod inspect bouncer ((obj bouncer)) - (when (not obj) - (set! obj obj) +(defmethod inspect bouncer ((this bouncer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspring-height: (meters ~m)~%" (-> obj spring-height)) - (format #t "~2Tsmush: ~f~%" (-> obj smush)) - (format #t "~2Tmods: ~A~%" (-> obj mods)) + (format #t "~2Tspring-height: (meters ~m)~%" (-> this spring-height)) + (format #t "~2Tsmush: ~f~%" (-> this smush)) + (format #t "~2Tmods: ~A~%" (-> this mods)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -147,7 +147,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('touch) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) #f ) (else @@ -156,10 +156,10 @@ ) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self smush) 0.0) (until #f - (if (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (if (time-elapsed? (-> self state-time) (seconds 0.2)) (ja :num! (seek! 0.0 0.1)) (ja :num! (seek! (lerp-scale @@ -203,9 +203,9 @@ ;; definition for method 23 of type bouncer ;; WARN: Return type mismatch int vs none. -(defmethod init-skeleton! bouncer ((obj bouncer)) +(defmethod init-skeleton! bouncer ((this bouncer)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-bouncer" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -215,9 +215,9 @@ ;; definition for method 24 of type bouncer ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 bouncer ((obj bouncer)) +(defmethod bouncer-method-24 bouncer ((this bouncer)) "TODO - collision stuff" - (let ((collision-shape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((collision-shape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((collision-mesh (new 'process 'collide-shape-prim-mesh collision-shape (the-as uint 0) (the-as uint 0)))) (set! (-> collision-mesh prim-core collide-as) (collide-spec crate)) (set! (-> collision-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -232,7 +232,7 @@ (set! (-> collision-shape backup-collide-as) (-> prim prim-core collide-as)) (set! (-> collision-shape backup-collide-with) (-> prim prim-core collide-with)) ) - (set! (-> obj root) collision-shape) + (set! (-> this root) collision-shape) ) 0 (none) @@ -240,19 +240,19 @@ ;; definition for method 11 of type bouncer ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! bouncer ((obj bouncer) (arg0 entity-actor)) +(defmethod init-from-entity! bouncer ((this bouncer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj mods) #f) - (bouncer-method-24 obj) - (process-drawable-from-entity! obj arg0) - (init-skeleton! obj) - (nav-mesh-connect-from-ent obj) - (set! (-> obj spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) - (go (method-of-object obj idle)) + (set! (-> this mods) #f) + (bouncer-method-24 this) + (process-drawable-from-entity! this arg0) + (init-skeleton! this) + (nav-mesh-connect-from-ent this) + (set! (-> this spring-height) (res-lump-float arg0 'spring-height :default 45056.0)) + (go (method-of-object this idle)) (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 4c896741aa..c23c7c08fa 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/centurion_REF.gc @@ -162,21 +162,21 @@ ) ;; definition for method 3 of type centurion-shot -(defmethod inspect centurion-shot ((obj centurion-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect centurion-shot ((this centurion-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type metalhead-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 28 of type centurion-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound centurion-shot ((obj centurion-shot) (arg0 projectile-options)) +(defmethod play-impact-sound centurion-shot ((this centurion-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -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)) obj arg0) + ((the-as (function projectile projectile-options sound-id) (find-parent-method centurion-shot 28)) this arg0) ) ) ) @@ -196,11 +196,11 @@ ;; definition for method 31 of type centurion-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! centurion-shot ((obj centurion-shot)) +(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)) obj) - (set! (-> obj max-speed) 327680.0) - (set! (-> obj timeout) (seconds 1.25)) + ((the-as (function projectile none) (find-parent-method centurion-shot 31)) this) + (set! (-> this max-speed) 327680.0) + (set! (-> this timeout) (seconds 1.25)) (none) ) @@ -233,28 +233,28 @@ ) ;; definition for method 3 of type centurion -(defmethod inspect centurion ((obj centurion)) - (when (not obj) - (set! obj obj) +(defmethod inspect centurion ((this centurion)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlos: #~%" (-> obj los)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Tcan-shoot?: ~A~%" (-> obj can-shoot?)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tcan-take-damage?: ~A~%" (-> obj can-take-damage?)) - (format #t "~2Tfirst-shoot?: ~A~%" (-> obj first-shoot?)) - (format #t "~2Tshoot-dir: #~%" (-> obj shoot-dir)) - (format #t "~2Ttar-pos: #~%" (-> obj tar-pos)) - (format #t "~2Tjoint: ~A~%" (-> obj joint)) - (format #t "~2Tjoint-enable: ~A~%" (-> obj joint-enable)) - (format #t "~2Tvictory-sound: ~D~%" (-> obj victory-sound)) - (format #t "~2Tshield-shot: ~D~%" (-> obj shield-shot)) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tcan-shoot?: ~A~%" (-> this can-shoot?)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tcan-take-damage?: ~A~%" (-> this can-take-damage?)) + (format #t "~2Tfirst-shoot?: ~A~%" (-> this first-shoot?)) + (format #t "~2Tshoot-dir: #~%" (-> this shoot-dir)) + (format #t "~2Ttar-pos: #~%" (-> this tar-pos)) + (format #t "~2Tjoint: ~A~%" (-> this joint)) + (format #t "~2Tjoint-enable: ~A~%" (-> this joint-enable)) + (format #t "~2Tvictory-sound: ~D~%" (-> this victory-sound)) + (format #t "~2Tshield-shot: ~D~%" (-> this shield-shot)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -274,15 +274,15 @@ ) ;; definition for method 3 of type centurion-anim-info -(defmethod inspect centurion-anim-info ((obj centurion-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect centurion-anim-info ((this centurion-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'centurion-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "[~8x] ~A~%" this 'centurion-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) (label cfg-4) - obj + this ) ;; definition of type centurion-global-info @@ -299,18 +299,18 @@ ) ;; definition for method 3 of type centurion-global-info -(defmethod inspect centurion-global-info ((obj centurion-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect centurion-global-info ((this centurion-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-yellow-hit: ~D~%" (-> obj prev-yellow-hit)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tyellow-hit-anim[1] @ #x~X~%" (-> obj yellow-hit-anim)) - (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tyellow-hit-anim[1] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) (label cfg-4) - obj + this ) ;; definition for symbol *centurion-global-info*, type centurion-global-info @@ -502,7 +502,7 @@ (set! (-> *centurion-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type centurion -(defmethod general-event-handler centurion ((obj centurion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler centurion ((this centurion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -511,7 +511,7 @@ ) (('touch) (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'attack)) + ((and (-> this next-state) (= (-> this next-state name) 'attack)) (let ((s4-1 (-> arg3 param 0))) (let ((s3-1 arg0)) (if (type? s3-1 process-focusable) @@ -523,8 +523,8 @@ 'attack-or-shove s4-1 (static-attack-info ((id (new-attack-id)) - (shove-back (* 2.0 (-> obj enemy-info attack-shove-back))) - (shove-up (* 2.0 (-> obj enemy-info attack-shove-up))) + (shove-back (* 2.0 (-> this enemy-info attack-shove-back))) + (shove-up (* 2.0 (-> this enemy-info attack-shove-up))) (mode 'deadly) ) ) @@ -532,36 +532,36 @@ ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('attack) (let ((v1-12 (the-as object (-> arg3 param 1)))) (cond - ((!= (-> (the-as attack-info v1-12) id) (-> obj incoming-attack-id)) - (set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-12) id)) + ((!= (-> (the-as attack-info v1-12) id) (-> this incoming-attack-id)) + (set! (-> this incoming-attack-id) (-> (the-as attack-info v1-12) id)) (cond - ((or (-> obj can-take-damage?) + ((or (-> this can-take-damage?) (logtest? (penetrate dark-skin dark-punch dark-bomb) (-> (the-as attack-info v1-12) penetrate-using)) ) (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'fire)) - (centurion-method-180 obj) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((and (-> this next-state) (= (-> this next-state name) 'fire)) + (centurion-method-180 this) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - (+! (-> obj shield-shot) 1) - (if (= (-> obj shield-shot) 4) + (+! (-> this shield-shot) 1) + (if (= (-> this shield-shot) 4) (talker-spawn-func (-> *talker-speech* 58) *entity-pool* (target-pos 0) (the-as region #f)) ) (set! (-> *part-id-table* 2102 init-specs 13 initial-valuef) 255.0) - (set! (-> obj state-time) (current-time)) + (set-time! (-> this state-time)) 'back ) ) @@ -573,21 +573,21 @@ ) ) (('victory) - (if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'victory))) - (and (> (-> obj hit-points) 0) - (zero? (-> obj fated-time)) - (not (logtest? (-> obj focus-status) (focus-status grabbed))) + (if (and (not (and (-> this next-state) (= (-> this next-state name) 'victory))) + (and (> (-> this hit-points) 0) + (zero? (-> this fated-time)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) ) ) - (go (method-of-object obj victory)) + (go (method-of-object this victory)) ) ) (('notify) - (let ((v1-47 (handle->process (-> obj focus handle)))) + (let ((v1-47 (handle->process (-> this focus handle)))) (when (and (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) v1-47) - (-> obj next-state) - (let ((v1-52 (-> obj next-state name))) + (-> this next-state) + (let ((v1-52 (-> this next-state name))) (or (= v1-52 'hostile) (= v1-52 'fire)) ) ) @@ -601,27 +601,27 @@ (set! (-> a1-13 param 3) (-> arg3 param 3)) (set! (-> a1-13 param 4) (-> arg3 param 4)) (set! (-> a1-13 param 5) (-> arg3 param 5)) - (send-event-function obj a1-13) + (send-event-function this a1-13) ) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 181 of type centurion ;; INFO: Used lq/sq -(defmethod centurion-method-181 centurion ((obj centurion) (arg0 vector)) +(defmethod centurion-method-181 centurion ((this centurion) (arg0 vector)) (local-vars (sv-224 vector) (sv-240 vector) (sv-256 vector)) - (if (not (-> obj joint-enable)) + (if (not (-> this joint-enable)) (return (the-as int #f)) ) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> arg0 quad)) - (let* ((v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 4))) + (let* ((v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) (s1-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 v0-1) 1.0)) (s3-0 (new 'stack-no-clear 'vector)) ) @@ -629,10 +629,10 @@ (let ((s5-1 (new 'stack-no-clear 'quaternion))) (vector-z-quaternion! (new 'stack-no-clear 'vector) - (quaternion*! (new 'stack-no-clear 'quaternion) (-> obj joint quat) (-> obj root quat)) + (quaternion*! (new 'stack-no-clear 'quaternion) (-> this joint quat) (-> this root quat)) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector-z-quaternion! s3-0 (-> obj root quat)) + (vector-z-quaternion! s3-0 (-> this root quat)) (let ((f30-0 (deg-diff (vector-y-angle s3-0) (vector-y-angle s1-0)))) 0.0 (new 'stack-no-clear 'vector) @@ -660,13 +660,13 @@ ) (quaternion-zxy! s5-1 s4-1) ) - (quaternion-pseudo-seek (-> obj joint quat) (-> obj joint quat) s5-1 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) s5-1 (seconds-per-frame)) ) ) ) (vector-z-quaternion! - (-> obj shoot-dir) - (quaternion*! (new 'stack-no-clear 'quaternion) (-> obj joint quat) (-> obj root quat)) + (-> this shoot-dir) + (quaternion*! (new 'stack-no-clear 'quaternion) (-> this joint quat) (-> this root quat)) ) 0 ) @@ -721,9 +721,9 @@ ) ;; definition for method 67 of type centurion -(defmethod go-stare centurion ((obj centurion)) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'hostile))) - (go (method-of-object obj hostile)) +(defmethod go-stare centurion ((this centurion)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (go (method-of-object this hostile)) ) ) @@ -756,7 +756,7 @@ ;; definition for method 180 of type centurion ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod centurion-method-180 centurion ((obj centurion)) +(defmethod centurion-method-180 centurion ((this centurion)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -765,20 +765,20 @@ (vf7 :class vf) ) (init-vf0-vector) - (when (-> obj can-shoot?) + (when (-> this can-shoot?) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) - (let* ((a1-0 (-> obj node-list data 29)) + (let* ((a1-0 (-> this node-list data 29)) (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) a1-0)) (s4-0 (new 'stack-no-clear 'vector)) ) (cond - ((-> obj first-shoot?) - (let ((s0-0 (handle->process (-> obj focus handle))) + ((-> this first-shoot?) + (let ((s0-0 (handle->process (-> this focus handle))) (s2-0 (new 'stack-no-clear 'vector)) ) (when s0-0 (set! (-> s2-0 quad) (-> (get-trans (the-as process-focusable s0-0) 3) quad)) - (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) s2-0))) + (let ((s1-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s2-0))) (let* ((f0-0 (vector-length s1-2)) (f0-1 (* 0.0000030517579 f0-0)) (a0-7 s2-0) @@ -807,19 +807,19 @@ ) ) (else - (vector-! s4-0 (-> obj target-pos) s3-0) + (vector-! s4-0 (-> this target-pos) s3-0) ) ) (vector-normalize! s4-0 327680.0) - (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options)) (set! (-> s5-0 pos quad) (-> s3-0 quad)) (set! (-> s5-0 vel quad) (-> s4-0 quad)) ) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (let* ((v1-32 *game-info*) (a0-26 (+ (-> v1-32 attack-id) 1)) ) @@ -827,9 +827,9 @@ (set! (-> s5-0 attack-id) a0-26) ) (set! (-> s5-0 timeout) (seconds 4)) - (spawn-projectile centurion-shot s5-0 obj *default-dead-pool*) + (spawn-projectile centurion-shot s5-0 this *default-dead-pool*) ) - (set! (-> obj can-shoot?) #f) + (set! (-> this can-shoot?) #f) ) 0 (none) @@ -980,16 +980,16 @@ ) ;; definition for method 132 of type centurion -(defmethod dispose! centurion ((obj centurion)) +(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)) obj) + ((the-as (function enemy none) (find-parent-method centurion 132)) this) (none) ) ;; definition for method 55 of type centurion ;; INFO: Used lq/sq -(defmethod track-target! centurion ((obj centurion)) +(defmethod track-target! centurion ((this centurion)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @@ -1052,7 +1052,7 @@ ) ) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user0)) + ((logtest? (-> this fact enemy-options) (enemy-option user0)) (set! (-> *part-id-table* 2101 init-specs 10 initial-valuef) 0.0) (set! (-> *part-id-table* 2101 init-specs 10 random-rangef) 0.0) (set! (-> *part-id-table* 2102 init-specs 10 initial-valuef) 0.0) @@ -1073,19 +1073,19 @@ (lerp (-> *part-id-table* 2102 init-specs 13 initial-valuef) 10.0 f30-0) ) ) - (let ((a0-11 (handle->process (-> obj focus handle)))) + (let ((a0-11 (handle->process (-> this focus handle)))) (if a0-11 - (centurion-method-181 obj (get-trans (the-as process-focusable a0-11) 3)) + (centurion-method-181 this (get-trans (the-as process-focusable a0-11) 3)) ) ) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (logior! (-> this skel status) (joint-control-status sync-math)) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) (let ((t9-12 (method-of-type nav-enemy track-target!))) - (t9-12 obj) + (t9-12 this) ) - (when (not (logtest? (-> obj draw status) (draw-control-status no-draw))) + (when (not (logtest? (-> this draw status) (draw-control-status no-draw))) (let ((s5-1 (new 'stack-no-clear 'matrix))) - (let* ((a2-10 (-> obj node-list data 12 bone transform)) + (let* ((a2-10 (-> this node-list data 12 bone transform)) (v1-131 (-> a2-10 quad 0)) (a0-18 (-> a2-10 quad 1)) (a1-13 (-> a2-10 quad 2)) @@ -1097,16 +1097,16 @@ (set! (-> s5-1 trans quad) a2-11) ) (let ((s4-1 (new 'stack-no-clear 'matrix))) - (if (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) (vector-negate-in-place! (the-as vector (-> s5-1 vector))) ) - (matrix-rotate-y! s4-1 (if (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (matrix-rotate-y! s4-1 (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) 2548.6223 -2548.6223 ) ) (matrix*! s5-1 s4-1 s5-1) - (matrix-rotate-z! s4-1 (if (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (matrix-rotate-z! s4-1 (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) 691.76886 -691.76886 ) @@ -1116,7 +1116,7 @@ (let ((a1-20 (-> s5-1 trans))) (let ((v1-143 (-> s5-1 trans))) (let ((a0-25 (-> s5-1 vector))) - (let ((a2-18 (the-as float (if (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (let ((a2-18 (the-as float (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) -997237719 #x43a3d70a ) @@ -1134,7 +1134,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-20 quad) vf6) ) - (spawn-with-matrix (-> obj part) s5-1) + (spawn-with-matrix (-> this part) s5-1) ) ) (none) @@ -1143,17 +1143,17 @@ ;; definition for method 142 of type centurion ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 centurion ((obj centurion) (arg0 nav-control)) +(defmethod nav-enemy-method-142 centurion ((this centurion) (arg0 nav-control)) 0 (none) ) ;; definition for method 182 of type centurion ;; INFO: Used lq/sq -(defmethod centurion-method-182 centurion ((obj centurion) (arg0 vector)) +(defmethod centurion-method-182 centurion ((this centurion) (arg0 vector)) (local-vars (sv-96 int) (sv-112 int)) - (when (nonzero? (-> obj path)) - (let ((s5-0 (-> obj path)) + (when (nonzero? (-> this path)) + (let ((s5-0 (-> this path)) (s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack-no-clear 'vector)) @@ -1201,7 +1201,7 @@ (t9-0) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-165 self) (set! (-> self joint-enable) #t) (set! (-> self can-shoot?) (the-as basic #t)) @@ -1255,14 +1255,14 @@ (else (when (-> self can-shoot?) (if (and (get-enemy-target self) - (>= (- (current-time) (-> self state-time)) (the int (+ 60.0 (* 0.0036621094 f30-0)))) + (time-elapsed? (-> self state-time) (the int (+ 60.0 (* 0.0036621094 f30-0)))) (check-los? (-> self los) 0) ) (go-virtual fire) ) ) (if (skip-check-los? (-> self los) 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -1379,31 +1379,31 @@ ) ;; definition for method 77 of type centurion -(defmethod enemy-method-77 centurion ((obj centurion) (arg0 (pointer float))) +(defmethod enemy-method-77 centurion ((this centurion) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 5))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 5)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 5)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 5)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-seek!) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-1 (ash 1 (-> *centurion-global-info* prev-yellow-hit))) - (v1-18 (enemy-method-120 obj 1 a2-1)) - (a1-8 (-> obj draw art-group data (-> *centurion-global-info* yellow-hit-anim v1-18))) + (v1-18 (enemy-method-120 this 1 a2-1)) + (a1-8 (-> this draw art-group data (-> *centurion-global-info* yellow-hit-anim v1-18))) ) (set! (-> *centurion-global-info* prev-yellow-hit) v1-18) - (let ((a0-15 (-> obj skel root-channel 0))) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-8)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1))) (set! (-> a0-15 param 1) (-> arg0 0)) @@ -1414,11 +1414,11 @@ ) (((knocked-type knocked-type-6)) (let* ((a2-3 (ash 1 (-> *centurion-global-info* prev-blue-hit))) - (v1-27 (enemy-method-120 obj 3 a2-3)) - (a1-13 (-> obj draw art-group data (-> *centurion-global-info* blue-hit-anim v1-27))) + (v1-27 (enemy-method-120 this 3 a2-3)) + (a1-13 (-> this draw art-group data (-> *centurion-global-info* blue-hit-anim v1-27))) ) (set! (-> *centurion-global-info* prev-blue-hit) v1-27) - (let ((a0-27 (-> obj skel root-channel 0))) + (let ((a0-27 (-> this skel root-channel 0))) (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-13)) (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-13) frames num-frames) -1))) (set! (-> a0-27 param 1) 1.0) @@ -1428,14 +1428,14 @@ ) ) (else - (let ((s4-0 (if (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (-> obj draw art-group data 21) - (-> obj draw art-group data 21) + (let ((s4-0 (if (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (-> this draw art-group data 21) + (-> this draw art-group data 21) ) ) ) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-30 (-> obj skel root-channel 0))) + (let ((a0-30 (-> this skel root-channel 0))) (set! (-> a0-30 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-30 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-30 param 1) (-> arg0 0)) @@ -1451,28 +1451,28 @@ ) ;; definition for method 78 of type centurion -(defmethod enemy-method-78 centurion ((obj centurion) (arg0 (pointer float))) +(defmethod enemy-method-78 centurion ((this centurion) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 33))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 33)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 33)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) ) #t ) (else (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((s4-0 (-> obj draw art-group data 8))) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 8))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) + (let ((a0-5 (-> this skel root-channel 0))) (set! (-> a0-5 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-5 param 1) (-> arg0 0)) @@ -1484,13 +1484,13 @@ ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-7 (-> obj skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-7 param 1) (-> arg0 0)) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) @@ -1501,17 +1501,17 @@ ) ;; definition for method 60 of type centurion -(defmethod coin-flip? centurion ((obj centurion)) +(defmethod coin-flip? centurion ((this centurion)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 63 of type centurion ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 centurion ((obj centurion) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 centurion ((this centurion) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 obj arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 this arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) @@ -1519,9 +1519,9 @@ ;; definition for method 114 of type centurion ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! centurion ((obj centurion)) +(defmethod init-enemy-collision! centurion ((this centurion)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1589,7 +1589,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-27 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1597,68 +1597,75 @@ ;; definition for method 7 of type centurion ;; WARN: Return type mismatch process-focusable vs centurion. -(defmethod relocate centurion ((obj centurion) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method centurion 7)) this arg0) ) ) ;; definition for method 115 of type centurion ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! centurion ((obj centurion)) +(defmethod init-enemy! centurion ((this centurion)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-centurion" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *centurion-nav-enemy-info*) - (set! (-> obj shield-shot) (the-as uint 0)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 474) obj)) - (let ((v1-11 (-> obj neck))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *centurion-nav-enemy-info*) + (set! (-> this shield-shot) (the-as uint 0)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 474) this)) + (let ((v1-11 (-> this neck))) (set! (-> v1-11 up) (the-as uint 1)) (set! (-> v1-11 nose) (the-as uint 2)) (set! (-> v1-11 ear) (the-as uint 3)) (set-vector! (-> v1-11 twist-max) 10922.667 12743.111 0.0 1.0) (set! (-> v1-11 ignore-angle) 18204.445) ) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd obstacle)) - (set! (-> obj can-take-damage?) #f) - (let ((v1-15 (-> obj nav))) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle)) + (set! (-> this can-take-damage?) #f) + (let ((v1-15 (-> this nav))) (set! (-> v1-15 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 327680.0) - (set! (-> obj joint-enable) #f) - (set! (-> obj joint) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4)) - (add-connection *part-engine* obj 8 obj 318 (new 'static 'vector :x 942.08 :y -163.84 :z 1392.64 :w 163840.0)) + (set-gravity-length (-> this root dynam) 327680.0) + (set! (-> this joint-enable) #f) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) (add-connection *part-engine* - obj + this 8 - obj + this + 318 + (new 'static 'vector :x 942.08 :y -163.84 :z 1392.64 :w 163840.0) + ) + (add-connection + *part-engine* + this + 8 + this 318 (new 'static 'vector :x -942.08 :y -163.84 :z 1392.64 :w 163840.0) ) - (if (logtest? (-> obj fact enemy-options) (enemy-option user0)) - (set! (-> obj hit-points) 1) + (if (logtest? (-> this fact enemy-options) (enemy-option user0)) + (set! (-> this hit-points) 1) ) - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) - (let ((s5-1 (-> obj nav state)) - (v1-36 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43)))) + (let ((s5-1 (-> this nav state)) + (v1-36 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (set! (-> s5-1 heading quad) (-> v1-36 quad)) ) 0 - (set! (-> obj first-shoot?) #t) + (set! (-> this first-shoot?) #t) 0 (none) ) 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 ad186e0249..7a03e2f894 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/flitter_REF.gc @@ -379,27 +379,27 @@ ) ;; definition for method 3 of type flitter -(defmethod inspect flitter ((obj flitter)) - (when (not obj) - (set! obj obj) +(defmethod inspect flitter ((this flitter)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tmove-angle: ~f~%" (-> obj move-angle)) - (format #t "~2Theading: ~A~%" (-> obj heading)) - (format #t "~2Tchange-dir-time: ~D~%" (-> obj change-dir-time)) - (format #t "~2Tlast-change-dir: ~D~%" (-> obj last-change-dir)) - (format #t "~2Toff-screen-timer: ~D~%" (-> obj off-screen-timer)) - (format #t "~2Tamb-sound-timer: ~D~%" (-> obj amb-sound-timer)) - (format #t "~2Tattack-time: ~D~%" (-> obj attack-time)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Tattack-pos: #~%" (-> obj attack-pos)) - (format #t "~2Tbase-height: ~f~%" (-> obj base-height)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) + (format #t "~2Tmove-angle: ~f~%" (-> this move-angle)) + (format #t "~2Theading: ~A~%" (-> this heading)) + (format #t "~2Tchange-dir-time: ~D~%" (-> this change-dir-time)) + (format #t "~2Tlast-change-dir: ~D~%" (-> this last-change-dir)) + (format #t "~2Toff-screen-timer: ~D~%" (-> this off-screen-timer)) + (format #t "~2Tamb-sound-timer: ~D~%" (-> this amb-sound-timer)) + (format #t "~2Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tattack-pos: #~%" (-> this attack-pos)) + (format #t "~2Tbase-height: ~f~%" (-> this base-height)) + (format #t "~2Tminimap: #~%" (-> this minimap)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -567,13 +567,13 @@ (set! (-> *flitter-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 182 of type flitter -(defmethod flitter-method-182 flitter ((obj flitter) (arg0 process-focusable)) - (and (logtest? (-> obj draw status) (draw-control-status on-screen)) +(defmethod flitter-method-182 flitter ((this flitter) (arg0 process-focusable)) + (and (logtest? (-> this draw status) (draw-control-status on-screen)) (let ((s4-0 (camera-matrix))) (camera-pos) (let* ((s3-0 (get-trans arg0 0)) (s5-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 vector 2) 1.0)) - (v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) s3-0) 1.0)) + (v1-7 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s3-0) 1.0)) ) (< 0.0 (vector-dot s5-1 v1-7)) ) @@ -582,79 +582,79 @@ ) ;; definition for method 77 of type flitter -(defmethod enemy-method-77 flitter ((obj flitter) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 flitter ((this flitter) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) #t ) (((knocked-type knocked-type-6)) - (let ((v1-17 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-17 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-17 (= v1-17 (-> obj draw art-group data 21))) + (if (and v1-17 (= v1-17 (-> this draw art-group data 21))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) 1.0) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) #t ) (else - ((method-of-type nav-enemy enemy-method-77) obj arg0) + ((method-of-type nav-enemy enemy-method-77) this arg0) ) ) ) ;; definition for method 78 of type flitter -(defmethod enemy-method-78 flitter ((obj flitter) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 flitter ((this flitter) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((v1-4 (-> obj skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> v1-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> v1-4 param 1) 1.0) (set! (-> v1-4 frame-num) 0.0) - (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) ) (else - ((method-of-type nav-enemy enemy-method-78) obj arg0) + ((method-of-type nav-enemy enemy-method-78) this arg0) ) ) ) ;; definition for method 68 of type flitter -(defmethod go-stare2 flitter ((obj flitter)) - (if (and (= (-> obj focus aware) (enemy-aware enemy-aware-2)) - (not (nav-enemy-method-163 obj)) - (not (and (-> obj next-state) (= (-> obj next-state name) 'pacing))) +(defmethod go-stare2 flitter ((this flitter)) + (if (and (= (-> this focus aware) (enemy-aware enemy-aware-2)) + (not (nav-enemy-method-163 this)) + (not (and (-> this next-state) (= (-> this next-state name) 'pacing))) ) - (go (method-of-object obj pacing)) - (go (method-of-object obj stare)) + (go (method-of-object this pacing)) + (go (method-of-object this stare)) ) ) @@ -715,7 +715,7 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.6)) + (until (time-elapsed? gp-1 (seconds 0.6)) (suspend) ) ) @@ -737,7 +737,7 @@ ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) + (until (time-elapsed? gp-3 (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) (suspend) ) ) @@ -764,7 +764,7 @@ ) 0 (look-at-target! self (enemy-flag lock-focus)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (-> self root))) (vector-reset! (-> gp-0 transv)) (set! (-> gp-0 transv y) (* 4096.0 (get-rand-float-range self 34.0 38.0))) @@ -862,15 +862,15 @@ ) ;; definition for method 99 of type flitter -(defmethod enemy-method-99 flitter ((obj flitter) (arg0 process-focusable)) +(defmethod enemy-method-99 flitter ((this flitter) (arg0 process-focusable)) (focus-test? arg0 mech) ) ;; definition for method 180 of type flitter ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod flitter-method-180 flitter ((obj flitter)) - (let* ((s5-0 (handle->process (-> obj focus handle))) +(defmethod flitter-method-180 flitter ((this flitter)) + (let* ((s5-0 (handle->process (-> this focus handle))) (s3-0 (if (type? s5-0 process-focusable) (the-as process-focusable s5-0) ) @@ -878,55 +878,55 @@ ) (when s3-0 (let* ((s5-1 (get-trans s3-0 0)) - (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> obj root trans))) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this root trans))) (f30-0 (vector-length s4-1)) ) (cond - ((enemy-method-99 obj s3-0) - (go-flee obj) + ((enemy-method-99 this s3-0) + (go-flee this) ) - ((and (< f30-0 32768.0) (not (flitter-method-182 obj s3-0))) - (go (method-of-object obj circling)) + ((and (< f30-0 32768.0) (not (flitter-method-182 this s3-0))) + (go (method-of-object this circling)) ) - ((< f30-0 (-> obj enemy-info notice-nav-radius)) - (set! (-> obj target-pos quad) (-> s5-1 quad)) + ((< f30-0 (-> this enemy-info notice-nav-radius)) + (set! (-> this target-pos quad) (-> s5-1 quad)) (let ((s3-1 (new 'stack-no-clear 'vector))) (set! (-> s3-1 quad) (-> s4-1 quad)) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> obj root transv quad)) + (set! (-> s5-2 quad) (-> this root transv quad)) (vector-normalize! s5-2 f30-0) (if (>= (vector-dot s3-1 s5-2) 0.98) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) ) ) ) ((< f30-0 32768.0) - (set! (-> obj target-pos quad) (-> s5-1 quad)) + (set! (-> this target-pos quad) (-> s5-1 quad)) ) - ((or (>= (- (current-time) (the-as int (-> obj last-change-dir))) (-> obj change-dir-time)) - (< (vector-vector-distance-squared (-> obj root trans) (-> obj target-pos)) 0.1) + ((or (time-elapsed? (the-as int (-> this last-change-dir)) (-> this change-dir-time)) + (< (vector-vector-distance-squared (-> this root trans) (-> this target-pos)) 0.1) ) - (set! (-> obj last-change-dir) (the-as uint (current-time))) - (set! (-> obj change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) + (set! (-> this last-change-dir) (the-as uint (current-time))) + (set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7))) (let ((s3-2 (new 'stack-no-clear 'vector)) - (f0-9 (* 0.5 f30-0 (tan (-> obj move-angle)))) + (f0-9 (* 0.5 f30-0 (tan (-> this move-angle)))) (s2-0 (new 'stack-no-clear 'vector)) ) - (if (-> obj heading) + (if (-> this heading) (set-vector! s3-2 (-> s4-1 z) (-> s4-1 y) (- (-> s4-1 x)) 1.0) (set-vector! s3-2 (- (-> s4-1 z)) (-> s4-1 y) (-> s4-1 x) 1.0) ) - (set! (-> obj heading) (the-as basic (not (-> obj heading)))) + (set! (-> this heading) (the-as basic (not (-> this heading)))) (let ((f28-1 (rand-vu-float-range (* 0.75 f0-9) f0-9)) (s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-1 (* -0.6 f30-0))) ) (vector-normalize! s3-2 f28-1) (vector+! s3-2 s3-2 s4-2) ) - (clamp-vector-to-mesh-cross-gaps (-> obj nav state) s3-2) + (clamp-vector-to-mesh-cross-gaps (-> this nav state) s3-2) (vector+! s2-0 s5-1 s3-2) - (set! (-> obj target-pos quad) (-> s2-0 quad)) + (set! (-> this target-pos quad) (-> s2-0 quad)) ) ) ) @@ -940,12 +940,10 @@ ;; definition for method 181 of type flitter ;; WARN: Return type mismatch time-frame vs none. -(defmethod flitter-method-181 flitter ((obj flitter)) - (when (>= (- (current-time) (the-as int (-> obj amb-sound-timer))) - (the int (* 300.0 (rand-vu-float-range 1.5 3.0))) - ) - (sound-play "flitter-amb" :position (-> obj root trans)) - (set! (-> obj amb-sound-timer) (the-as uint (current-time))) +(defmethod flitter-method-181 flitter ((this flitter)) + (when (time-elapsed? (the-as int (-> this amb-sound-timer)) (the int (* 300.0 (rand-vu-float-range 1.5 3.0)))) + (sound-play "flitter-amb" :position (-> this root trans)) + (set! (-> this amb-sound-timer) (the-as uint (current-time))) ) (none) ) @@ -964,7 +962,7 @@ ) (set! (-> self root transv y) 33775.48) (ja :num-func num-func-identity :frame-num 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self root status) (collide-status on-surface on-ground touch-surface)) (until v1-29 (let ((f0-2 102400.0)) @@ -973,7 +971,7 @@ ) (suspend) (ja :num! (seek! max arg1)) - (set! v1-29 (or (ja-done? 0) (>= (- (current-time) (-> self state-time)) arg2))) + (set! v1-29 (or (ja-done? 0) (time-elapsed? (-> self state-time) arg2))) ) ) ) @@ -1063,7 +1061,7 @@ (if gp-0 (set! (-> self focus-pos quad) (-> (get-trans (the-as process-focusable gp-0) 0) quad)) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-11 (-> self focus aware))) (cond ((= v1-11 (enemy-aware enemy-aware-3)) @@ -1080,7 +1078,7 @@ ) ) ) - (if (and (get-enemy-target self) (>= (- (current-time) (the-as int (-> self off-screen-timer))) (seconds 0.3))) + (if (and (get-enemy-target self) (time-elapsed? (the-as int (-> self off-screen-timer)) (seconds 0.3))) (go-hostile self) ) ) @@ -1178,8 +1176,8 @@ ) ;; definition for method 183 of type flitter -(defmethod flitter-method-183 flitter ((obj flitter)) - (lerp-scale 0.0 1.0 (- (-> obj attack-pos y) (-> obj root trans y)) 13926.4 25600.0) +(defmethod flitter-method-183 flitter ((this flitter)) + (lerp-scale 0.0 1.0 (- (-> this attack-pos y) (-> this root trans y)) 13926.4 25600.0) ) ;; failed to figure out what this is: @@ -1187,7 +1185,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1222,7 +1220,7 @@ ) (set! s5-2 (cond ((and gp-0 - (< (- (current-time) (-> self state-time)) (seconds 1.5)) + (not (time-elapsed? (-> self state-time) (seconds 1.5))) gp-0 (not (logtest? (-> gp-0 focus-status) (focus-status disable dead ignore grabbed))) ) @@ -1301,21 +1299,21 @@ ) ;; definition for method 132 of type flitter -(defmethod dispose! flitter ((obj flitter)) +(defmethod dispose! flitter ((this flitter)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) - ((the-as (function nav-enemy none) (find-parent-method flitter 132)) obj) + ((the-as (function nav-enemy none) (find-parent-method flitter 132)) this) (none) ) ;; definition for method 114 of type flitter ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! flitter ((obj flitter)) +(defmethod init-enemy-collision! flitter ((this flitter)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1359,7 +1357,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1367,43 +1365,43 @@ ;; definition for method 115 of type flitter ;; WARN: Return type mismatch connection-minimap vs none. -(defmethod init-enemy! flitter ((obj flitter)) +(defmethod init-enemy! flitter ((this flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flitter" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *flitter-nav-enemy-info*) - (set! (-> obj move-angle) 10922.667) - (set! (-> obj heading) (the-as basic (if (= (rand-vu-int-range 0 1) 1) - #t - #f - ) - ) + (init-enemy-behaviour-and-stats! this *flitter-nav-enemy-info*) + (set! (-> this move-angle) 10922.667) + (set! (-> this heading) (the-as basic (if (= (rand-vu-int-range 0 1) 1) + #t + #f + ) + ) ) - (set! (-> obj change-dir-time) 0) - (set! (-> obj off-screen-timer) (the-as uint 0)) - (set! (-> obj amb-sound-timer) (the-as uint 0)) + (set! (-> this change-dir-time) 0) + (set! (-> this off-screen-timer) (the-as uint 0)) + (set! (-> this amb-sound-timer) (the-as uint 0)) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x 942.08 :y -860.16 :z 1269.76 :w 163840.0) ) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x -942.08 :y -860.16 :z 1269.76 :w 163840.0) ) - (set-gravity-length (-> obj root dynam) 491520.0) + (set-gravity-length (-> this root dynam) 491520.0) (let* ((s4-1 "pebble1-ruins") - (v1-15 (-> obj level name)) + (v1-15 (-> this level name)) (s5-2 (cond ((= v1-15 'strip) @@ -1441,6 +1439,6 @@ (the-as float s5-2) ) ) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) (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 980a19812a..f0992882e2 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 @@ -20,15 +20,15 @@ ) ;; definition for method 3 of type fodder-anim-info -(defmethod inspect fodder-anim-info ((obj fodder-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect fodder-anim-info ((this fodder-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fodder-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "[~8x] ~A~%" this 'fodder-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) (label cfg-4) - obj + this ) ;; definition of type fodder-global-info @@ -42,16 +42,16 @@ ) ;; definition for method 3 of type fodder-global-info -(defmethod inspect fodder-global-info ((obj fodder-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect fodder-global-info ((this fodder-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) (label cfg-4) - obj + this ) ;; definition of type fodder @@ -81,26 +81,26 @@ ) ;; definition for method 3 of type fodder -(defmethod inspect fodder ((obj fodder)) - (when (not obj) - (set! obj obj) +(defmethod inspect fodder ((this fodder)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tleft-eye: ~A~%" (-> obj left-eye)) - (format #t "~2Tright-eye: ~A~%" (-> obj right-eye)) - (format #t "~2Tlook-at-other: ~D~%" (-> obj look-at-other)) - (format #t "~2Tneck-away-from: ~A~%" (-> obj neck-away-from)) - (format #t "~2Tlook-at-other-time: ~D~%" (-> obj look-at-other-time)) - (format #t "~2Tfocus-pos: #~%" (-> obj focus-pos)) - (format #t "~2Tslow-timer: ~D~%" (-> obj slow-timer)) - (format #t "~2Tfast-timer: ~D~%" (-> obj fast-timer)) - (format #t "~2Tattack-type: ~D~%" (-> obj attack-type)) - (format #t "~2Ttest-vec: #~%" (-> obj test-vec)) + (format #t "~2Tleft-eye: ~A~%" (-> this left-eye)) + (format #t "~2Tright-eye: ~A~%" (-> this right-eye)) + (format #t "~2Tlook-at-other: ~D~%" (-> this look-at-other)) + (format #t "~2Tneck-away-from: ~A~%" (-> this neck-away-from)) + (format #t "~2Tlook-at-other-time: ~D~%" (-> this look-at-other-time)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) + (format #t "~2Tslow-timer: ~D~%" (-> this slow-timer)) + (format #t "~2Tfast-timer: ~D~%" (-> this fast-timer)) + (format #t "~2Tattack-type: ~D~%" (-> this attack-type)) + (format #t "~2Ttest-vec: #~%" (-> this test-vec)) (label cfg-4) - obj + this ) ;; definition for symbol *fodder-global-info*, type fodder-global-info @@ -257,17 +257,17 @@ ;; definition for method 109 of type fodder ;; WARN: Return type mismatch int vs none. -(defmethod look-at-target! fodder ((obj fodder) (arg0 enemy-flag)) +(defmethod look-at-target! fodder ((this fodder) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" (let ((parent-method (method-of-type nav-enemy look-at-target!))) - (parent-method obj arg0) + (parent-method this arg0) ) - (if (nonzero? (-> obj left-eye)) - (mode-set! (-> obj left-eye) (joint-mod-mode polar-look-at)) + (if (nonzero? (-> this left-eye)) + (mode-set! (-> this left-eye) (joint-mod-mode polar-look-at)) ) - (if (nonzero? (-> obj right-eye)) - (mode-set! (-> obj right-eye) (joint-mod-mode polar-look-at)) + (if (nonzero? (-> this right-eye)) + (mode-set! (-> this right-eye) (joint-mod-mode polar-look-at)) ) 0 (none) @@ -275,56 +275,56 @@ ;; definition for method 110 of type fodder ;; WARN: Return type mismatch int vs none. -(defmethod stop-looking-at-target! fodder ((obj fodder)) +(defmethod stop-looking-at-target! fodder ((this fodder)) "Will unset [[enemy-flag::death-start]] and [[enemy-flag::lock-focus]] and call [[joint-mod::shut-down]] if applicable" (let ((parent-method (method-of-type nav-enemy stop-looking-at-target!))) - (parent-method obj) + (parent-method this) ) - (if (nonzero? (-> obj left-eye)) - (shut-down (-> obj left-eye)) + (if (nonzero? (-> this left-eye)) + (shut-down (-> this left-eye)) ) - (if (nonzero? (-> obj right-eye)) - (shut-down (-> obj right-eye)) + (if (nonzero? (-> this right-eye)) + (shut-down (-> this right-eye)) ) 0 (none) ) ;; definition for method 179 of type fodder -(defmethod look-at-position! fodder ((obj fodder) (position vector)) +(defmethod look-at-position! fodder ((this fodder) (position vector)) "Adjusts the eyes to look at particular position, or the focused target @param position If this is provided, it will be used with [[joint-mod::target-set!]] to adjust the eyes, otherwise the `focus` position is used @return TODO - unsure what the return value is, but it seems to make the eyes more lazy" (when (not position) - (let ((focus-proc (handle->process (-> obj focus handle)))) + (let ((focus-proc (handle->process (-> this focus handle)))) (if focus-proc (set! position (get-trans (the-as process-focusable focus-proc) 2)) (return 0.0) ) ) ) - (when (nonzero? (-> obj left-eye)) - (target-set! (-> obj left-eye) position) - (when (nonzero? (-> obj left-eye)) - (set! (-> obj left-eye polar-external-tilt-max) (-> obj right-eye polar-internal-tilt-max)) - (set! (-> obj left-eye polar-external-radius) (-> obj right-eye polar-internal-radius)) + (when (nonzero? (-> this left-eye)) + (target-set! (-> this left-eye) position) + (when (nonzero? (-> this left-eye)) + (set! (-> this left-eye polar-external-tilt-max) (-> this right-eye polar-internal-tilt-max)) + (set! (-> this left-eye polar-external-radius) (-> this right-eye polar-internal-radius)) ) ) - (when (nonzero? (-> obj right-eye)) - (target-set! (-> obj right-eye) position) - (when (nonzero? (-> obj right-eye)) - (set! (-> obj right-eye polar-external-tilt-max) (-> obj left-eye polar-internal-tilt-max)) - (set! (-> obj right-eye polar-external-radius) (-> obj left-eye polar-internal-radius)) + (when (nonzero? (-> this right-eye)) + (target-set! (-> this right-eye) position) + (when (nonzero? (-> this right-eye)) + (set! (-> this right-eye polar-external-tilt-max) (-> this left-eye polar-internal-tilt-max)) + (set! (-> this right-eye polar-external-radius) (-> this left-eye polar-internal-radius)) ) ) ) ;; definition for method 180 of type fodder -(defmethod fodder-method-180 fodder ((obj fodder)) +(defmethod fodder-method-180 fodder ((this fodder)) "@TODO no idea, never seems to do anything because the actor-group-count is always 0" - (when (>= (- (current-time) (-> obj look-at-other-time)) (seconds 0.25)) - (dotimes (group-idx (-> obj actor-group-count)) - (let ((group (-> obj actor-group group-idx))) + (when (time-elapsed? (-> this look-at-other-time) (seconds 0.25)) + (dotimes (group-idx (-> this actor-group-count)) + (let ((group (-> this actor-group group-idx))) (dotimes (actor-idx (-> group length)) (let* ((actor-proc (-> group data actor-idx actor extra process)) (fodder-proc (if (type? actor-proc fodder) @@ -332,37 +332,36 @@ ) ) ) - (when (and fodder-proc - (!= fodder-proc obj) - (>= (- (current-time) (-> fodder-proc look-at-other-time)) (seconds 0.25)) + (when (and fodder-proc (!= fodder-proc this) (time-elapsed? (-> fodder-proc look-at-other-time) (seconds 0.25))) + (let* ((dir-to-other-fodder + (vector-! (new 'stack-no-clear 'vector) (-> fodder-proc root trans) (-> this root trans)) ) - (let* ((dir-to-other-fodder (vector-! (new 'stack-no-clear 'vector) (-> fodder-proc root trans) (-> obj root trans))) (dir-length (vector-length dir-to-other-fodder)) ) (when (< dir-length 8192.0) (vector-float*! dir-to-other-fodder dir-to-other-fodder (/ 1.0 dir-length)) (let ((f30-0 (vector-dot dir-to-other-fodder - (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat)) vector 2) + (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)) vector 2) ) ) ) (when (< (cos 14563.556) f30-0) - (let ((channel (ja-channel-float! (the-as art-joint-anim (-> obj draw art-group data 15)) 0.0 0.0 0.0))) + (let ((channel (ja-channel-float! (the-as art-joint-anim (-> this draw art-group data 15)) 0.0 0.0 0.0))) (when channel - (set! (-> obj skel interp-select 0) #xe00010) - (set! (-> obj skel interp-select 1) 0) + (set! (-> this skel interp-select 0) #xe00010) + (set! (-> this skel interp-select 1) 0) (set! (-> channel param 0) 1.0) (set! (-> channel param 1) 1.0) (set! (-> channel param 2) 1.0) (set! (-> channel num-func) num-func-interp1-play!) ) ) - (set! (-> obj look-at-other-time) (current-time)) - (set! (-> obj look-at-other) (process->handle fodder-proc)) - (set! (-> obj neck-away-from) #f) - (set! (-> fodder-proc look-at-other-time) (current-time)) - (set! (-> fodder-proc look-at-other) (process->handle obj)) + (set-time! (-> this look-at-other-time)) + (set! (-> this look-at-other) (process->handle fodder-proc)) + (set! (-> this neck-away-from) #f) + (set-time! (-> fodder-proc look-at-other-time)) + (set! (-> fodder-proc look-at-other) (process->handle this)) (set! (-> fodder-proc neck-away-from) #t) ) ) @@ -379,19 +378,19 @@ ;; definition for method 55 of type fodder ;; WARN: Return type mismatch object vs none. -(defmethod track-target! fodder ((obj fodder)) +(defmethod track-target! fodder ((this fodder)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((parent-method (method-of-type nav-enemy track-target!))) - (parent-method obj) + (parent-method this) ) (let ((proc (the-as process-drawable #f))) (cond - ((and (< (- (current-time) (-> obj look-at-other-time)) (seconds 0.5)) + ((and (not (time-elapsed? (-> this look-at-other-time) (seconds 0.5))) (begin - (let ((other-proc (handle->process (-> obj look-at-other)))) + (let ((other-proc (handle->process (-> this look-at-other)))) (set! proc (if (type? other-proc process-drawable) (the-as process-drawable other-proc) ) @@ -401,27 +400,27 @@ ) ) (let ((s5-1 (vector<-cspace! (new 'static 'vector) (-> proc node-list data 5)))) - (look-at-position! obj s5-1) + (look-at-position! this s5-1) (cond - ((zero? (-> obj neck)) + ((zero? (-> this neck)) ) - ((-> obj neck-away-from) + ((-> this neck-away-from) (let ((s4-0 (new 'static 'vector))) - (let ((v1-11 (vector<-cspace! (new 'static 'vector) (-> obj node-list data 5)))) + (let ((v1-11 (vector<-cspace! (new 'static 'vector) (-> this node-list data 5)))) (vector-! s4-0 v1-11 s5-1) (vector+! s4-0 s4-0 v1-11) ) - (target-set! (-> obj neck) s4-0) + (target-set! (-> this neck) s4-0) ) ) (else - (target-set! (-> obj neck) s5-1) + (target-set! (-> this neck) s5-1) ) ) ) ) - ((logtest? (-> obj enemy-flags) (enemy-flag lock-focus)) - (look-at-position! obj (the-as vector #f)) + ((logtest? (-> this enemy-flags) (enemy-flag lock-focus)) + (look-at-position! this (the-as vector #f)) ) ) ) @@ -469,7 +468,7 @@ (set! (-> _self nav callback-info) *nav-enemy-null-callback-info*) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until (not #f) (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.25)) @@ -607,17 +606,17 @@ ) ;; definition for method 182 of type fodder -(defmethod fodder-method-182 fodder ((obj fodder)) +(defmethod fodder-method-182 fodder ((this fodder)) (ja-channel-push! 2 (seconds 0.2)) - (let ((s5-0 (-> obj skel root-channel 0))) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info hostile-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info hostile-anim))) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) - (let ((s5-1 (-> obj skel root-channel 1))) + (let ((s5-1 (-> this skel root-channel 1))) (let* ((v1-10 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-11 (the-as number (logior #x3f800000 v1-10))) (f0-3 (+ -1.0 (the-as float v1-11))) @@ -627,7 +626,7 @@ ) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 8)) + (the-as art-joint-anim (-> this draw art-group data 8)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) @@ -684,7 +683,7 @@ (set! (-> v1-22 turning-acceleration) 0.0) ) 0 - (set! (-> self slow-timer) (current-time)) + (set-time! (-> self slow-timer)) (ja-channel-push! 1 (seconds 0.08)) (ja :group! (-> self draw art-group data (-> self enemy-info idle-anim))) (ja :num-func num-func-identity :frame-num 0.0) @@ -704,9 +703,9 @@ ) (when (and (nonzero? (-> self slow-timer)) (zero? (-> self fast-timer)) - (>= (- (current-time) (-> self slow-timer)) (seconds 0.35)) + (time-elapsed? (-> self slow-timer) (seconds 0.35)) ) - (set! (-> self fast-timer) (current-time)) + (set-time! (-> self fast-timer)) (ja-channel-push! 1 (seconds 0.02)) (let ((v1-55 (-> self attack-type))) (cond @@ -762,7 +761,7 @@ ) ) (cond - ((>= (- (current-time) (-> self fast-timer)) v1-82) + ((time-elapsed? (-> self fast-timer) v1-82) (set! (-> self slow-timer) 0) (set! (-> self fast-timer) 0) (let ((v1-83 (-> self nav))) @@ -806,7 +805,7 @@ ) (when (zero? (-> self attack-type)) (let ((f0-20 20480.0)) - (when (and (< f30-0 (* f0-20 f0-20)) (>= (- (current-time) (-> self look-at-other-time)) (seconds 0.125))) + (when (and (< f30-0 (* f0-20 f0-20)) (time-elapsed? (-> self look-at-other-time) (seconds 0.125))) (let ((v1-117 (ja-channel-float! (the-as art-joint-anim fodder-snap-ja) 0.0 0.0 0.0))) (when v1-117 (set! (-> self skel interp-select 0) #xe00010) @@ -817,7 +816,7 @@ (set! (-> v1-117 num-func) num-func-interp1-play!) ) ) - (set! (-> self look-at-other-time) (current-time)) + (set-time! (-> self look-at-other-time)) ) ) ) @@ -945,25 +944,25 @@ ) ;; definition for method 77 of type fodder -(defmethod enemy-method-77 fodder ((obj fodder) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 fodder ((this fodder) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((a2-0 (ash 1 (-> *fodder-global-info* prev-blue-hit))) - (v1-3 (enemy-method-120 obj 3 a2-0)) - (s5-1 (-> obj draw art-group data (-> *fodder-global-info* blue-hit-anim v1-3 anim-index))) + (v1-3 (enemy-method-120 this 3 a2-0)) + (s5-1 (-> this draw art-group data (-> *fodder-global-info* blue-hit-anim v1-3 anim-index))) ) (set! (-> *fodder-global-info* prev-blue-hit) v1-3) - (let ((v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-6 (= v1-6 (-> obj draw art-group data 17))) + (if (and v1-6 (= v1-6 (-> this draw art-group data 17))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-18 (-> obj skel root-channel 0))) + (let ((a0-18 (-> this skel root-channel 0))) (set! (-> a0-18 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-18 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-18 param 1) 1.0) @@ -973,9 +972,9 @@ ) ) (else - (let ((s4-0 (-> obj draw art-group data 16))) + (let ((s4-0 (-> this draw art-group data 16))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-20 (-> obj skel root-channel 0))) + (let ((a0-20 (-> this skel root-channel 0))) (set! (-> a0-20 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-20 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-20 param 1) (-> arg0 0)) @@ -989,14 +988,14 @@ ) ;; definition for method 78 of type fodder -(defmethod enemy-method-78 fodder ((obj fodder) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 fodder ((this fodder) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) #f ) (else - (let ((v1-5 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-3 (-> obj skel root-channel 0)) + (let ((v1-5 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-3 (-> this skel root-channel 0)) ) (set! (-> a0-3 frame-group) (the-as art-joint-anim v1-5)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-5) frames num-frames) -1))) @@ -1011,8 +1010,8 @@ ;; definition for method 181 of type fodder ;; WARN: Return type mismatch int vs none. -(defmethod fodder-method-181 fodder ((obj fodder) (arg0 symbol)) - (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) +(defmethod fodder-method-181 fodder ((this fodder) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 (set! (-> v1-3 prim-core collide-as) (collide-spec enemy)) @@ -1029,16 +1028,16 @@ ) ;; definition for method 60 of type fodder -(defmethod coin-flip? fodder ((obj fodder)) +(defmethod coin-flip? fodder ((this fodder)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 114 of type fodder ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! fodder ((obj fodder)) +(defmethod init-enemy-collision! fodder ((this fodder)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1094,7 +1093,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1102,14 +1101,14 @@ ;; definition for method 7 of type fodder ;; WARN: Return type mismatch nav-enemy vs fodder. -(defmethod relocate fodder ((obj fodder) (arg0 int)) - (if (nonzero? (-> obj left-eye)) - (&+! (-> obj left-eye) arg0) +(defmethod relocate fodder ((this fodder) (arg0 int)) + (if (nonzero? (-> this left-eye)) + (&+! (-> this left-eye) arg0) ) - (if (nonzero? (-> obj right-eye)) - (&+! (-> obj right-eye) arg0) + (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)) obj arg0)) + (the-as fodder ((the-as (function nav-enemy int nav-enemy) (find-parent-method fodder 7)) this arg0)) ) ;; definition for function fodder-setup-eye-control @@ -1128,45 +1127,45 @@ ;; definition for method 115 of type fodder ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! fodder ((obj fodder)) +(defmethod init-enemy! fodder ((this fodder)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fodder" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *fodder-nav-enemy-info*) - (when (zero? (-> obj left-eye)) - (set! (-> obj left-eye) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 23)) - (fodder-setup-eye-control (-> obj left-eye)) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *fodder-nav-enemy-info*) + (when (zero? (-> this left-eye)) + (set! (-> this left-eye) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 23)) + (fodder-setup-eye-control (-> this left-eye)) ) - (when (zero? (-> obj right-eye)) - (set! (-> obj right-eye) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 24)) - (fodder-setup-eye-control (-> obj right-eye)) + (when (zero? (-> this right-eye)) + (set! (-> this right-eye) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 24)) + (fodder-setup-eye-control (-> this right-eye)) ) - (let ((v1-16 (-> obj neck))) + (let ((v1-16 (-> this neck))) (set! (-> v1-16 up) (the-as uint 1)) (set! (-> v1-16 nose) (the-as uint 2)) (set! (-> v1-16 ear) (the-as uint 0)) (set-vector! (-> v1-16 twist-max) 10922.667 7281.778 0.0 1.0) (set! (-> v1-16 ignore-angle) 18204.445) ) - (set! (-> obj look-at-other) (the-as handle #f)) - (set! (-> obj look-at-other-time) 0) - (set! (-> obj neck-away-from) #f) - (let ((v1-18 (-> obj nav))) + (set! (-> this look-at-other) (the-as handle #f)) + (set! (-> this look-at-other-time) 0) + (set! (-> this neck-away-from) #f) + (let ((v1-18 (-> this nav))) (set! (-> v1-18 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (fodder-method-181 obj #f) + (set-gravity-length (-> this root dynam) 573440.0) + (fodder-method-181 this #f) 0 (none) ) ;; definition for method 99 of type fodder -(defmethod enemy-method-99 fodder ((obj fodder) (arg0 process-focusable)) +(defmethod enemy-method-99 fodder ((this fodder) (arg0 process-focusable)) (focus-test? arg0 mech) ) 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 ee952963d2..c6764bfa52 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/grenadier_REF.gc @@ -57,18 +57,18 @@ ) ;; definition for method 3 of type bank-info -(defmethod inspect bank-info ((obj bank-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect bank-info ((this bank-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'bank-info) - (format #t "~1Tcircle: #~%" (-> obj circle)) - (format #t "~1Ttangent-pos: #~%" (-> obj tangent-pos)) - (format #t "~1Tfinal-pos: #~%" (-> obj final-pos)) - (format #t "~1Tfinal-dir: #~%" (-> obj final-dir)) + (format #t "[~8x] ~A~%" this 'bank-info) + (format #t "~1Tcircle: #~%" (-> this circle)) + (format #t "~1Ttangent-pos: #~%" (-> this tangent-pos)) + (format #t "~1Tfinal-pos: #~%" (-> this final-pos)) + (format #t "~1Tfinal-dir: #~%" (-> this final-dir)) (label cfg-4) - obj + this ) ;; definition of type grenadier @@ -98,25 +98,25 @@ ) ;; definition for method 3 of type grenadier -(defmethod inspect grenadier ((obj grenadier)) - (when (not obj) - (set! obj obj) +(defmethod inspect grenadier ((this grenadier)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tshot-trajectory: #~%" (-> obj shot-trajectory)) - (format #t "~2Thostile-path: ~A~%" (-> obj hostile-path)) - (format #t "~2Tbank: #~%" (-> obj bank)) - (format #t "~2Tjoint: ~A~%" (-> obj joint)) - (format #t "~2Theading: ~A~%" (-> obj heading)) - (format #t "~2Tmove-pos: #~%" (-> obj move-pos)) - (format #t "~2Tmove-angle: ~f~%" (-> obj move-angle)) - (format #t "~2Tstatus-flags: ~D~%" (-> obj status-flags)) - (format #t "~2Tsuppress-knockaside-timer: ~D~%" (-> obj suppress-knockaside-timer)) + (format #t "~2Tshot-trajectory: #~%" (-> this shot-trajectory)) + (format #t "~2Thostile-path: ~A~%" (-> this hostile-path)) + (format #t "~2Tbank: #~%" (-> this bank)) + (format #t "~2Tjoint: ~A~%" (-> this joint)) + (format #t "~2Theading: ~A~%" (-> this heading)) + (format #t "~2Tmove-pos: #~%" (-> this move-pos)) + (format #t "~2Tmove-angle: ~f~%" (-> this move-angle)) + (format #t "~2Tstatus-flags: ~D~%" (-> this status-flags)) + (format #t "~2Tsuppress-knockaside-timer: ~D~%" (-> this suppress-knockaside-timer)) (label cfg-4) - obj + this ) ;; definition for symbol *grenadier-nav-enemy-info*, type nav-enemy-info @@ -317,22 +317,22 @@ (set! (-> *grenadier-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type grenadier -(defmethod general-event-handler grenadier ((obj grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler grenadier ((this grenadier) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit-knocked) - (when (= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (if (and (< (- (current-time) (-> obj suppress-knockaside-timer)) (seconds 0.6)) - (and (-> obj next-state) (= (-> obj next-state name) 'attack)) - (nonzero? (-> obj hit-points)) + (when (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (if (and (not (time-elapsed? (-> this suppress-knockaside-timer) (seconds 0.6))) + (and (-> this next-state) (= (-> this next-state name) 'attack)) + (nonzero? (-> this hit-points)) ) (return #t) ) - (logior! (-> obj status-flags) (grenadier-flags grflags-0)) - (set! (-> obj suppress-knockaside-timer) (current-time)) + (logior! (-> this status-flags) (grenadier-flags grflags-0)) + (set-time! (-> this suppress-knockaside-timer)) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('notify) (cond @@ -347,16 +347,16 @@ (set! (-> v1-23 param 3) (-> arg3 param 3)) (set! (-> v1-23 param 4) (-> arg3 param 4)) (set! (-> v1-23 param 5) (-> arg3 param 5)) - (send-event-function obj v1-23) + (send-event-function this v1-23) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -374,28 +374,28 @@ ;; definition for method 182 of type grenadier ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod grenadier-method-182 grenadier ((obj grenadier) (arg0 vector)) - (cloest-point-on-mesh (-> obj nav) arg0 arg0 (the-as nav-poly #f)) - (set! (-> obj bank final-pos quad) (-> arg0 quad)) - (set! (-> obj bank tangent-pos quad) (-> arg0 quad)) - (set! (-> obj move-pos quad) (-> obj bank tangent-pos quad)) +(defmethod grenadier-method-182 grenadier ((this grenadier) (arg0 vector)) + (cloest-point-on-mesh (-> this nav) arg0 arg0 (the-as nav-poly #f)) + (set! (-> this bank final-pos quad) (-> arg0 quad)) + (set! (-> this bank tangent-pos quad) (-> arg0 quad)) + (set! (-> this move-pos quad) (-> this bank tangent-pos quad)) (none) ) ;; definition for method 181 of type grenadier ;; WARN: Return type mismatch int vs none. -(defmethod grenadier-method-181 grenadier ((obj grenadier)) - (let ((s5-0 (handle->process (-> obj focus handle)))) +(defmethod grenadier-method-181 grenadier ((this grenadier)) + (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 (cond - ((-> obj hostile-path) - (let* ((s4-0 (-> obj hostile-path)) + ((-> this hostile-path) + (let* ((s4-0 (-> this hostile-path)) (f30-0 (get-path-percentage-at-furthest-point s4-0 (get-trans (the-as process-focusable s5-0) 0))) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> obj heading) (not (-> obj heading))) + (set! (-> this heading) (not (-> this heading))) (let* ((f0-0 (rand-vu-float-range 0.2 0.45)) - (f0-1 (if (-> obj heading) + (f0-1 (if (-> this heading) (+ f30-0 f0-0) (- f30-0 f0-0) ) @@ -409,11 +409,11 @@ ) (get-point-at-percent-along-path! s4-0 s3-1 f0-1 'interp) ) - (grenadier-method-182 obj s3-1) + (grenadier-method-182 this s3-1) ) ) (else - (let* ((s4-1 (-> obj root)) + (let* ((s4-1 (-> this root)) (a0-10 (get-trans (the-as process-focusable s5-0) 0)) (v1-27 (vector-! (new 'stack-no-clear 'vector) a0-10 (-> s4-1 trans))) ) @@ -421,13 +421,13 @@ (let ((s3-2 (new 'stack-no-clear 'vector)) (s2-1 (new 'stack-no-clear 'vector)) ) - (set! (-> obj heading) (not (-> obj heading))) - (if (-> obj heading) + (set! (-> this heading) (not (-> this heading))) + (if (-> this heading) (set-vector! s3-2 (-> v1-27 z) (-> v1-27 y) (- (-> v1-27 x)) 1.0) (set-vector! s3-2 (- (-> v1-27 z)) (-> v1-27 y) (-> v1-27 x) 1.0) ) (vector-normalize! s3-2 (* 4096.0 (rand-vu-float-range 14.0 18.0))) - (grenadier-method-182 obj (vector+! s2-1 (-> s4-1 trans) s3-2)) + (grenadier-method-182 this (vector+! s2-1 (-> s4-1 trans) s3-2)) ) ) ) @@ -574,7 +574,7 @@ ) ) ) - (when (or (>= (- (current-time) (-> self state-time)) (rand-vu-int-range (seconds 3) (seconds 9))) + (when (or (time-elapsed? (-> self state-time) (rand-vu-int-range (seconds 3) (seconds 9))) (>= 8192.0 (vector-vector-xz-distance (-> self root trans) (-> self bank final-pos))) ) (if (and (handle->process (-> self focus handle)) @@ -635,7 +635,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -647,7 +647,7 @@ ) :trans (behavior () (let ((f0-0 (vector-vector-xz-distance (-> self root trans) (-> self move-pos)))) - (if (or (>= 12288.0 f0-0) (>= (- (current-time) (-> self state-time)) (seconds 6))) + (if (or (>= 12288.0 f0-0) (time-elapsed? (-> self state-time) (seconds 6))) (go-hostile self) ) ) @@ -680,7 +680,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -744,13 +744,13 @@ ;; ERROR: function was not converted to expressions. Cannot decompile. ;; definition for method 78 of type grenadier -(defmethod enemy-method-78 grenadier ((obj grenadier) (arg0 (pointer float))) +(defmethod enemy-method-78 grenadier ((this grenadier) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((s4-0 (-> obj draw art-group data 30))) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 30))) (ja-channel-push! 1 (seconds 0.067)) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-3 param 1) (-> arg0 0)) @@ -761,13 +761,13 @@ ) #t ) - ((or (= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) (zero? (-> obj incoming knocked-type))) + ((or (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) (zero? (-> this incoming knocked-type))) #f ) - ((> (-> obj hit-points) 0) + ((> (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.067)) - (let ((a1-4 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-9 (-> obj skel root-channel 0)) + (let ((a1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-9 (-> this skel root-channel 0)) ) (set! (-> a0-9 frame-group) (the-as art-joint-anim a1-4)) (set! (-> a0-9 param 0) (the float (+ (-> (the-as art-joint-anim a1-4) frames num-frames) -1))) @@ -779,14 +779,14 @@ ) (else (ja-channel-push! 1 (seconds 0.067)) - (let ((a0-11 (-> obj skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> obj draw art-group data 33))) + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 33)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) ) (set! (-> a0-11 param 1) (-> arg0 0)) (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> obj draw art-group data 33)) num-func-seek!) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) ) #t ) @@ -1095,19 +1095,19 @@ ) ;; definition for method 70 of type grenadier -(defmethod go-hostile grenadier ((obj grenadier)) - (if (and (and (-> obj next-state) (= (-> obj next-state name) 'knocked)) - (and (logtest? (-> obj status-flags) (grenadier-flags grflags-0)) - (handle->process (-> obj focus handle)) - (not (logtest? (-> (the-as process-focusable (handle->process (-> obj focus handle))) focus-status) +(defmethod go-hostile grenadier ((this grenadier)) + (if (and (and (-> this next-state) (= (-> this next-state name) 'knocked)) + (and (logtest? (-> this status-flags) (grenadier-flags grflags-0)) + (handle->process (-> this focus handle)) + (not (logtest? (-> (the-as process-focusable (handle->process (-> this focus handle))) focus-status) (focus-status disable dead ignore grabbed) ) ) ) ) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) - ((method-of-type nav-enemy go-hostile) obj) + ((method-of-type nav-enemy go-hostile) this) ) ;; failed to figure out what this is: @@ -1140,9 +1140,9 @@ ;; definition for method 142 of type grenadier ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 grenadier ((obj grenadier) (arg0 nav-control)) +(defmethod nav-enemy-method-142 grenadier ((this grenadier) (arg0 nav-control)) (local-vars (a0-4 int) (a0-6 int)) - (b! (logtest? (-> obj status-flags) (grenadier-flags grflags-1)) cfg-6 :delay (empty-form)) + (b! (logtest? (-> this status-flags) (grenadier-flags grflags-1)) cfg-6 :delay (empty-form)) (let ((v1-3 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) ) @@ -1169,7 +1169,7 @@ (.sync.p) (label cfg-3) 0 - (forward-up-nopitch->quaternion (-> obj root quat) v1-3 a2-0) + (forward-up-nopitch->quaternion (-> this root quat) v1-3 a2-0) ) (let ((v1-5 (-> *perf-stats* data 33))) (b! (zero? (-> v1-5 ctrl)) cfg-5 :delay (nop!)) @@ -1189,25 +1189,25 @@ ) ;; definition for method 55 of type grenadier -(defmethod track-target! grenadier ((obj grenadier)) +(defmethod track-target! grenadier ((this grenadier)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 34)))) - (spawn (-> obj part) a1-1) + (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 34)))) + (spawn (-> this part) a1-1) ) (none) ) ;; definition for method 114 of type grenadier ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! grenadier ((obj grenadier)) +(defmethod init-enemy-collision! grenadier ((this grenadier)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1286,7 +1286,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1294,32 +1294,32 @@ ;; definition for method 7 of type grenadier ;; WARN: Return type mismatch process-focusable vs grenadier. -(defmethod relocate grenadier ((obj grenadier) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(defmethod relocate grenadier ((this grenadier) (arg0 int)) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) arg0) ) - (when (-> obj hostile-path) - (if (nonzero? (-> obj hostile-path)) - (&+! (-> obj hostile-path) arg0) + (when (-> this hostile-path) + (if (nonzero? (-> this hostile-path)) + (&+! (-> this hostile-path) arg0) ) ) (the-as grenadier - ((the-as (function process-focusable int process-focusable) (find-parent-method grenadier 7)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method grenadier 7)) this arg0) ) ) ;; definition for method 115 of type grenadier ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! grenadier ((obj grenadier)) +(defmethod init-enemy! grenadier ((this grenadier)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grenadier" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *grenadier-nav-enemy-info*) - (let ((v1-5 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *grenadier-nav-enemy-info*) + (let ((v1-5 (-> this neck))) (when v1-5 (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) @@ -1328,36 +1328,43 @@ (set! (-> v1-5 ignore-angle) 30947.555) ) ) - (let ((v1-6 (-> obj nav))) + (let ((v1-6 (-> this nav))) (set! (-> v1-6 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (set! (-> obj heading) (if (rand-vu-percent? 0.5) - #t - #f - ) + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this heading) (if (rand-vu-percent? 0.5) + #t + #f + ) ) - (set! (-> obj move-angle) 5461.3335) - (set! (-> obj status-flags) (grenadier-flags)) - (set! (-> obj suppress-knockaside-timer) 0) - (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) - (set! (-> obj joint) (new 'process 'joint-mod-blend-world obj 17 #f 0.0)) - (logior! (-> obj joint blend-flags) (joint-mod-blend-flags rotation)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1150) obj)) - (set! (-> obj hostile-path) (new 'process 'path-control obj 'hostile 0.0 (-> obj entity) #t)) - (if (zero? (-> obj hostile-path)) - (set! (-> obj hostile-path) #f) + (set! (-> this move-angle) 5461.3335) + (set! (-> this status-flags) (grenadier-flags)) + (set! (-> this suppress-knockaside-timer) 0) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (set! (-> this joint) (new 'process 'joint-mod-blend-world this 17 #f 0.0)) + (logior! (-> this joint blend-flags) (joint-mod-blend-flags rotation)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1150) this)) + (set! (-> this hostile-path) (new 'process 'path-control this 'hostile 0.0 (-> this entity) #t)) + (if (zero? (-> this hostile-path)) + (set! (-> this hostile-path) #f) ) - (if (-> obj hostile-path) - (logior! (-> obj hostile-path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (-> this hostile-path) + (logior! (-> this hostile-path flags) (path-control-flag display draw-line draw-point draw-text)) ) - (add-connection *part-engine* obj 24 obj 318 (new 'static 'vector :x 532.48 :y -81.92 :z 1515.52 :w 163840.0)) (add-connection *part-engine* - obj + this 24 - obj + this + 318 + (new 'static 'vector :x 532.48 :y -81.92 :z 1515.52 :w 163840.0) + ) + (add-connection + *part-engine* + this + 24 + this 318 (new 'static 'vector :x -532.48 :y -81.92 :z 1515.52 :w 163840.0) ) 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 96b80f0042..e9884d097c 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/grunt_REF.gc @@ -21,16 +21,16 @@ ) ;; definition for method 3 of type grunt-anim-info -(defmethod inspect grunt-anim-info ((obj grunt-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt-anim-info ((this grunt-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'grunt-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) - (format #t "~1Ttravel-speed: (meters ~m)~%" (-> obj travel-speed)) + (format #t "[~8x] ~A~%" this 'grunt-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~1Ttravel-speed: (meters ~m)~%" (-> this travel-speed)) (label cfg-4) - obj + this ) ;; definition of type grunt-global-info @@ -52,24 +52,24 @@ ) ;; definition for method 3 of type grunt-global-info -(defmethod inspect grunt-global-info ((obj grunt-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt-global-info ((this grunt-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-knocked-anim-index: ~D~%" (-> obj prev-knocked-anim-index)) - (format #t "~1Tprev-yellow-hit-anim-index: ~D~%" (-> obj prev-yellow-hit-anim-index)) - (format #t "~1Tprev-blue-hit-anim-index: ~D~%" (-> obj prev-blue-hit-anim-index)) - (format #t "~1Tpatrol-anim[4] @ #x~X~%" (-> obj patrol-anim)) - (format #t "~1Tcharge-anim[3] @ #x~X~%" (-> obj charge-anim)) - (format #t "~1Tattack-anim[2] @ #x~X~%" (-> obj attack-anim)) - (format #t "~1Tknocked-anim[4] @ #x~X~%" (-> obj knocked-anim)) - (format #t "~1Tknocked-land-anim[4] @ #x~X~%" (-> obj knocked-land-anim)) - (format #t "~1Tyellow-hit-anim[4] @ #x~X~%" (-> obj yellow-hit-anim)) - (format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> obj blue-hit-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-knocked-anim-index: ~D~%" (-> this prev-knocked-anim-index)) + (format #t "~1Tprev-yellow-hit-anim-index: ~D~%" (-> this prev-yellow-hit-anim-index)) + (format #t "~1Tprev-blue-hit-anim-index: ~D~%" (-> this prev-blue-hit-anim-index)) + (format #t "~1Tpatrol-anim[4] @ #x~X~%" (-> this patrol-anim)) + (format #t "~1Tcharge-anim[3] @ #x~X~%" (-> this charge-anim)) + (format #t "~1Tattack-anim[2] @ #x~X~%" (-> this attack-anim)) + (format #t "~1Tknocked-anim[4] @ #x~X~%" (-> this knocked-anim)) + (format #t "~1Tknocked-land-anim[4] @ #x~X~%" (-> this knocked-land-anim)) + (format #t "~1Tyellow-hit-anim[4] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> this blue-hit-anim)) (label cfg-4) - obj + this ) ;; definition of type grunt @@ -111,33 +111,33 @@ ) ;; definition for method 3 of type grunt -(defmethod inspect grunt ((obj grunt)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt ((this grunt)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpatrol-anim: #~%" (-> obj patrol-anim)) - (format #t "~2Tcharge-anim: #~%" (-> obj charge-anim)) - (format #t "~2Tattack-anim: #~%" (-> obj attack-anim)) - (format #t "~2Tknocked-anim: #~%" (-> obj knocked-anim)) - (format #t "~2Tyellow-hit-anim: #~%" (-> obj yellow-hit-anim)) - (format #t "~2Tblue-hit-anim: #~%" (-> obj blue-hit-anim)) - (format #t "~2Tintro-path: ~A~%" (-> obj intro-path)) - (format #t "~2Tcircle-radial-dist: ~f~%" (-> obj desired-angle)) - (format #t "~2Tuse-charge-anim-index: ~D~%" (-> obj unknown-byte-n1k2n3)) - (format #t "~2Tknocked-anim-index: ~D~%" (-> obj unknown-byte-m2j342)) - (format #t "~2Tjumping-ambush-path-pt: ~D~%" (-> obj unknown-byte-1ji2n3)) - (format #t "~2Tgrunt-flags: ~D~%" (-> obj stack 511)) - (format #t "~2Tstate-timeout2: ~D~%" (-> obj state-timeout2)) - (format #t "~2Tnext-warn-time: ~D~%" (-> obj next-warn-time)) - (format #t "~2Tdest: #~%" (-> obj dest)) - (format #t "~2Tfocus-pos: #~%" (-> obj focus-pos)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) + (format #t "~2Tpatrol-anim: #~%" (-> this patrol-anim)) + (format #t "~2Tcharge-anim: #~%" (-> this charge-anim)) + (format #t "~2Tattack-anim: #~%" (-> this attack-anim)) + (format #t "~2Tknocked-anim: #~%" (-> this knocked-anim)) + (format #t "~2Tyellow-hit-anim: #~%" (-> this yellow-hit-anim)) + (format #t "~2Tblue-hit-anim: #~%" (-> this blue-hit-anim)) + (format #t "~2Tintro-path: ~A~%" (-> this intro-path)) + (format #t "~2Tcircle-radial-dist: ~f~%" (-> this desired-angle)) + (format #t "~2Tuse-charge-anim-index: ~D~%" (-> this unknown-byte-n1k2n3)) + (format #t "~2Tknocked-anim-index: ~D~%" (-> this unknown-byte-m2j342)) + (format #t "~2Tjumping-ambush-path-pt: ~D~%" (-> this unknown-byte-1ji2n3)) + (format #t "~2Tgrunt-flags: ~D~%" (-> this stack 511)) + (format #t "~2Tstate-timeout2: ~D~%" (-> this state-timeout2)) + (format #t "~2Tnext-warn-time: ~D~%" (-> this next-warn-time)) + (format #t "~2Tdest: #~%" (-> this dest)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) + (format #t "~2Tminimap: #~%" (-> this minimap)) (label cfg-4) - obj + this ) ;; definition for symbol *grunt-global-info*, type grunt-global-info @@ -400,77 +400,77 @@ (set! (-> *grunt-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type grunt -(defmethod general-event-handler grunt ((obj grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler grunt ((this grunt) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (let ((s5-1 (-> obj incoming knocked-type))) + ((zero? (-> this hit-points)) + (let ((s5-1 (-> this incoming knocked-type))) (cond ((and (= s5-1 (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-33 (-> obj next-state name))) - (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) - ) + (not (and (-> this next-state) (let ((v1-33 (-> this next-state name))) + (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ((or (= s5-1 (knocked-type knocked-type-4)) (= s5-1 (knocked-type knocked-type-6))) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - (go (method-of-object obj knocked)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) + (go (method-of-object this knocked)) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 66 of type grunt -(defmethod go-ambush grunt ((obj grunt)) +(defmethod go-ambush grunt ((this grunt)) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user10)) - (go (method-of-object obj falling-ambush)) + ((logtest? (-> this fact enemy-options) (enemy-option user10)) + (go (method-of-object this falling-ambush)) ) - ((logtest? (-> obj fact enemy-options) (enemy-option user11)) - (go (method-of-object obj jumping-ambush)) + ((logtest? (-> this fact enemy-options) (enemy-option user11)) + (go (method-of-object this jumping-ambush)) ) (else - (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> obj name)) - (go-hostile obj) + (format 0 "ERROR: ~A doesn't specify which ambush behavior to use.~%" (-> this name)) + (go-hostile this) ) ) ) @@ -524,7 +524,7 @@ ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.2)) + (until (time-elapsed? gp-0 (seconds 0.2)) (suspend) ) ) @@ -552,13 +552,13 @@ ;; definition for method 93 of type grunt ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-93 grunt ((obj grunt)) - (case (-> obj jump-why) +(defmethod enemy-method-93 grunt ((this grunt)) + (case (-> this jump-why) ((2) - (go (method-of-object obj jumping-ambush-cont)) + (go (method-of-object this jumping-ambush-cont)) ) (else - ((method-of-type nav-enemy enemy-method-93) obj) + ((method-of-type nav-enemy enemy-method-93) this) ) ) (none) @@ -745,7 +745,7 @@ ) ;; definition for method 184 of type grunt -(defmethod grunt-method-184 grunt ((obj grunt) (arg0 float)) +(defmethod grunt-method-184 grunt ((this grunt) (arg0 float)) (local-vars (v1-5 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -753,12 +753,12 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((gp-0 (get-enemy-target obj))) + (let ((gp-0 (get-enemy-target this))) (when gp-0 (let ((v1-3 (get-trans gp-0 0)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector-! s4-0 v1-3 (-> obj root trans)) + (vector-! s4-0 v1-3 (-> this root trans)) (.lvf vf1 (&-> s4-0 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -772,18 +772,18 @@ (f0-2 12288.0) ) (when (or (>= (* f0-2 f0-2) f30-0) (>= f28-0 f30-0)) - (let ((f26-0 (quaternion-y-angle (-> obj root quat))) + (let ((f26-0 (quaternion-y-angle (-> this root quat))) (f0-7 (atan (-> s4-0 x) (-> s4-0 z))) (f1-0 1228.8) ) (cond ((and (< (* f1-0 f1-0) f30-0) (>= f28-0 f30-0) (>= 8192.0 (fabs (deg- f26-0 f0-7)))) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) ((let ((f0-10 12288.0)) (< f30-0 (* f0-10 f0-10)) ) - (go (method-of-object obj spin-attack)) + (go (method-of-object this spin-attack)) ) ) ) @@ -1237,39 +1237,39 @@ ) ;; definition for method 77 of type grunt -(defmethod enemy-method-77 grunt ((obj grunt) (arg0 (pointer float))) +(defmethod enemy-method-77 grunt ((this grunt) (arg0 (pointer float))) (local-vars (v1-72 int) (a2-3 int) (a2-5 int)) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (let ((v1-2 (ash 1 (-> *grunt-global-info* prev-yellow-hit-anim-index))) - (a0-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (a0-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and a0-7 (or (= a0-7 (-> obj draw art-group data 16)) - (= a0-7 (-> obj draw art-group data 38)) - (= a0-7 (-> obj draw art-group data 39)) - (= a0-7 (-> obj draw art-group data 40)) + (if (and a0-7 (or (= a0-7 (-> this draw art-group data 16)) + (= a0-7 (-> this draw art-group data 38)) + (= a0-7 (-> this draw art-group data 39)) + (= a0-7 (-> this draw art-group data 40)) ) ) (set! a2-3 (logior v1-2 4)) (set! a2-3 (logior v1-2 8)) ) ) - (let ((s4-0 (enemy-method-120 obj 4 a2-3))) + (let ((s4-0 (enemy-method-120 this 4 a2-3))) (set! (-> *grunt-global-info* prev-yellow-hit-anim-index) s4-0) - (set! (-> obj yellow-hit-anim) (-> *grunt-global-info* yellow-hit-anim s4-0)) - (let ((v1-11 (get-rand-int obj 3))) + (set! (-> this yellow-hit-anim) (-> *grunt-global-info* yellow-hit-anim s4-0)) + (let ((v1-11 (get-rand-int this 3))) (if (= s4-0 3) (set! v1-11 2) ) - (set! (-> obj unknown-byte-n1k2n3) v1-11) + (set! (-> this unknown-byte-n1k2n3) v1-11) ) ) - (let ((s4-1 (-> obj draw art-group data (-> obj yellow-hit-anim anim-index)))) + (let ((s4-1 (-> this draw art-group data (-> this yellow-hit-anim anim-index)))) (ja-channel-push! 1 0) - (let ((a0-19 (-> obj skel root-channel 0))) + (let ((a0-19 (-> this skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-19 param 1) (-> arg0 0)) @@ -1280,33 +1280,33 @@ #t ) (((knocked-type knocked-type-6)) - (let* ((v1-24 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let* ((v1-24 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) - (s4-2 (and v1-24 (or (= v1-24 (-> obj draw art-group data 16)) - (= v1-24 (-> obj draw art-group data 38)) - (= v1-24 (-> obj draw art-group data 39)) - (= v1-24 (-> obj draw art-group data 40)) + (s4-2 (and v1-24 (or (= v1-24 (-> this draw art-group data 16)) + (= v1-24 (-> this draw art-group data 38)) + (= v1-24 (-> this draw art-group data 39)) + (= v1-24 (-> this draw art-group data 40)) ) ) ) ) - (if (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (set! (-> obj unknown-byte-n123n) (the-as int (logior (-> obj stack 511) 2))) + (if (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (set! (-> this unknown-byte-n123n) (the-as int (logior (-> this stack 511) 2))) ) (cond - ((and (not s4-2) (logtest? (-> obj stack 511) 2)) + ((and (not s4-2) (logtest? (-> this stack 511) 2)) (set! s4-2 #t) (ja-channel-push! 1 (seconds 0.17)) ) (else - (let ((v1-36 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-36 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-36 (= v1-36 (-> obj draw art-group data 44))) + (if (and v1-36 (= v1-36 (-> this draw art-group data 44))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) @@ -1319,22 +1319,22 @@ (set! a2-5 (logior v1-42 7)) ) ) - (let ((v1-46 (enemy-method-120 obj 6 a2-5))) + (let ((v1-46 (enemy-method-120 this 6 a2-5))) (set! (-> *grunt-global-info* prev-blue-hit-anim-index) v1-46) - (set! (-> obj blue-hit-anim) (-> *grunt-global-info* blue-hit-anim v1-46)) + (set! (-> this blue-hit-anim) (-> *grunt-global-info* blue-hit-anim v1-46)) ) (let ((a2-6 0)) - (when (not (logtest? (-> obj stack 511) 2)) + (when (not (logtest? (-> this stack 511) 2)) (if s4-2 (set! a2-6 (logior a2-6 3)) (set! a2-6 (logior a2-6 4)) ) ) - (set! (-> obj unknown-byte-n1k2n3) (enemy-method-120 obj 3 a2-6)) + (set! (-> this unknown-byte-n1k2n3) (enemy-method-120 this 3 a2-6)) ) ) - (let ((a1-26 (-> obj draw art-group data (-> obj blue-hit-anim anim-index))) - (a0-51 (-> obj skel root-channel 0)) + (let ((a1-26 (-> this draw art-group data (-> this blue-hit-anim anim-index))) + (a0-51 (-> this skel root-channel 0)) ) (set! (-> a0-51 frame-group) (the-as art-joint-anim a1-26)) (set! (-> a0-51 param 0) (the float (+ (-> (the-as art-joint-anim a1-26) frames num-frames) -1))) @@ -1347,28 +1347,28 @@ (else 0 (cond - ((or (= (-> obj incoming knocked-type) (knocked-type knocked-type-2)) - (= (-> obj incoming knocked-type) (knocked-type knocked-type-3)) + ((or (= (-> this incoming knocked-type) (knocked-type knocked-type-2)) + (= (-> this incoming knocked-type) (knocked-type knocked-type-3)) ) (set! v1-72 3) ) (else (let ((s4-3 (ash 1 (-> *grunt-global-info* prev-knocked-anim-index)))) - (let ((s3-0 (-> obj root))) + (let ((s3-0 (-> this root))) (if (>= 16384.0 (fabs (deg- (quaternion-y-angle (-> s3-0 quat)) (atan (-> s3-0 transv x) (-> s3-0 transv z))))) (set! s4-3 (logior s4-3 4)) ) ) - (set! v1-72 (enemy-method-120 obj 3 s4-3)) + (set! v1-72 (enemy-method-120 this 3 s4-3)) ) ) ) (set! (-> *grunt-global-info* prev-knocked-anim-index) v1-72) - (set! (-> obj unknown-byte-m2j342) v1-72) - (set! (-> obj knocked-anim) (-> *grunt-global-info* knocked-anim v1-72)) - (let ((s4-4 (-> obj draw art-group data (-> obj knocked-anim anim-index)))) + (set! (-> this unknown-byte-m2j342) v1-72) + (set! (-> this knocked-anim) (-> *grunt-global-info* knocked-anim v1-72)) + (let ((s4-4 (-> this draw art-group data (-> this knocked-anim anim-index)))) (ja-channel-push! 1 0) - (let ((a0-68 (-> obj skel root-channel 0))) + (let ((a0-68 (-> this skel root-channel 0))) (set! (-> a0-68 frame-group) (the-as art-joint-anim s4-4)) (set! (-> a0-68 param 0) (the float (+ (-> (the-as art-joint-anim s4-4) frames num-frames) -1))) (set! (-> a0-68 param 1) (-> arg0 0)) @@ -1382,26 +1382,26 @@ ) ;; definition for method 78 of type grunt -(defmethod enemy-method-78 grunt ((obj grunt) (arg0 (pointer float))) +(defmethod enemy-method-78 grunt ((this grunt) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (or (logtest? (-> obj stack 511) 2) (let ((v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) - ) - ) - (not (and v1-7 (or (= v1-7 (-> obj draw art-group data 16)) - (= v1-7 (-> obj draw art-group data 38)) - (= v1-7 (-> obj draw art-group data 39)) - (= v1-7 (-> obj draw art-group data 40)) - ) - ) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (or (logtest? (-> this stack 511) 2) (let ((v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) ) - ) + (not (and v1-7 (or (= v1-7 (-> this draw art-group data 16)) + (= v1-7 (-> this draw art-group data 38)) + (= v1-7 (-> this draw art-group data 39)) + (= v1-7 (-> this draw art-group data 40)) + ) + ) + ) + ) ) - (let ((s4-0 (-> obj draw art-group data 44))) + (let ((s4-0 (-> this draw art-group data 44))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-16 (-> obj skel root-channel 0))) + (let ((a0-16 (-> this skel root-channel 0))) (set! (-> a0-16 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-16 param 1) (-> arg0 0)) @@ -1409,19 +1409,19 @@ (joint-control-channel-group! a0-16 (the-as art-joint-anim s4-0) num-func-seek!) ) ) - (set! (-> obj unknown-byte-n123n) (the-as int (logand -3 (-> obj stack 511)))) + (set! (-> this unknown-byte-n123n) (the-as int (logand -3 (-> this stack 511)))) #t ) ) - ((!= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (let ((a1-6 (-> obj + ((!= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (let ((a1-6 (-> this draw art-group data - (-> *grunt-global-info* knocked-land-anim (-> obj unknown-byte-m2j342) anim-index) + (-> *grunt-global-info* knocked-land-anim (-> this unknown-byte-m2j342) anim-index) ) ) - (a0-23 (-> obj skel root-channel 0)) + (a0-23 (-> this skel root-channel 0)) ) (set! (-> a0-23 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-23 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) @@ -1483,30 +1483,30 @@ ) ;; definition for method 132 of type grunt -(defmethod dispose! grunt ((obj grunt)) +(defmethod dispose! grunt ((this grunt)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) - ((the-as (function nav-enemy none) (find-parent-method grunt 132)) obj) + ((the-as (function nav-enemy none) (find-parent-method grunt 132)) this) (none) ) ;; definition for method 7 of type grunt ;; WARN: Return type mismatch nav-enemy vs grunt. -(defmethod relocate grunt ((obj grunt) (arg0 int)) - (if (nonzero? (-> obj intro-path)) - (&+! (-> obj intro-path) arg0) +(defmethod relocate grunt ((this grunt) (arg0 int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) arg0) ) - (the-as grunt ((method-of-type nav-enemy relocate) obj arg0)) + (the-as grunt ((method-of-type nav-enemy relocate) this arg0)) ) ;; definition for method 114 of type grunt ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! grunt ((obj grunt)) +(defmethod init-enemy-collision! grunt ((this grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1594,80 +1594,80 @@ (set! (-> s5-0 backup-collide-with) (-> v1-27 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 185 of type grunt -(defmethod get-enemy-info grunt ((obj grunt)) +(defmethod get-enemy-info grunt ((this grunt)) "@returns the [[nav-enemy-info]] associated with this type of grunt" *grunt-nav-enemy-info* ) ;; definition for method 115 of type grunt ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! grunt ((obj grunt)) +(defmethod init-enemy! grunt ((this grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj (get-enemy-info obj)) - (let ((v1-6 (-> obj neck))) + (init-enemy-behaviour-and-stats! this (get-enemy-info this)) + (let ((v1-6 (-> this neck))) (set! (-> v1-6 up) (the-as uint 1)) (set! (-> v1-6 nose) (the-as uint 2)) (set! (-> v1-6 ear) (the-as uint 0)) (set-vector! (-> v1-6 twist-max) 11832.889 11832.889 0.0 1.0) (set! (-> v1-6 ignore-angle) 30947.555) ) - (let ((v1-8 (-> obj nav))) + (let ((v1-8 (-> this nav))) (set! (-> v1-8 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) + (set-gravity-length (-> this root dynam) 573440.0) (let ((s5-2 *grunt-global-info*)) - (set! (-> obj patrol-anim) (-> s5-2 patrol-anim (get-rand-int obj 4))) - (set! (-> obj charge-anim) (-> s5-2 charge-anim (get-rand-int obj 3))) - (set! (-> obj attack-anim) (-> s5-2 attack-anim (get-rand-int obj 2))) + (set! (-> this patrol-anim) (-> s5-2 patrol-anim (get-rand-int this 4))) + (set! (-> this charge-anim) (-> s5-2 charge-anim (get-rand-int this 3))) + (set! (-> this attack-anim) (-> s5-2 attack-anim (get-rand-int this 2))) ) - (set! (-> obj unknown-byte-n1k2n3) -1) - (if (zero? (get-rand-int obj 2)) - (set! (-> obj unknown-byte-n123n) (the-as int (logior (-> obj stack 511) 1))) + (set! (-> this unknown-byte-n1k2n3) -1) + (if (zero? (get-rand-int this 2)) + (set! (-> this unknown-byte-n123n) (the-as int (logior (-> this stack 511) 1))) ) - (if (zero? (get-rand-int obj 2)) - (set! (-> obj unknown-byte-n123n) (the-as int (logior (-> obj stack 511) 4))) + (if (zero? (get-rand-int this 2)) + (set! (-> this unknown-byte-n123n) (the-as int (logior (-> this stack 511) 4))) ) - (set! (-> obj intro-path) (new 'process 'path-control obj 'intro 0.0 (the-as entity #f) #t)) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (the-as entity #f) #t)) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x 1433.6 :y 2785.28 :z -1761.28 :w 163840.0) ) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x -1433.6 :y 2785.28 :z -1761.28 :w 163840.0) ) - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) 0 (none) ) ;; definition for method 116 of type grunt ;; WARN: Return type mismatch int vs none. -(defmethod go-idle grunt ((obj grunt)) - (if (logtest? (-> obj fact enemy-options) (enemy-option user9)) - (go (method-of-object obj wait-for-focus)) - (go (method-of-object obj idle)) +(defmethod go-idle grunt ((this grunt)) + (if (logtest? (-> this fact enemy-options) (enemy-option user9)) + (go (method-of-object this wait-for-focus)) + (go (method-of-object this idle)) ) 0 (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 4ca2072e1f..7f3478b29d 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 @@ -27,17 +27,17 @@ ) ;; definition for method 3 of type guard-level-anim-info -(defmethod inspect guard-level-anim-info ((obj guard-level-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect guard-level-anim-info ((this guard-level-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'guard-level-anim-info) - (format #t "~1Tanim-index[2] @ #x~X~%" (-> obj anim-index)) - (format #t "~1Tanim-index-front: ~D~%" (-> obj anim-index-front)) - (format #t "~1Tanim-index-back: ~D~%" (-> obj anim-index-back)) + (format #t "[~8x] ~A~%" this 'guard-level-anim-info) + (format #t "~1Tanim-index[2] @ #x~X~%" (-> this anim-index)) + (format #t "~1Tanim-index-front: ~D~%" (-> this anim-index-front)) + (format #t "~1Tanim-index-back: ~D~%" (-> this anim-index-back)) (label cfg-4) - obj + this ) ;; definition of type guard-level-global-info @@ -60,25 +60,25 @@ ) ;; definition for method 3 of type guard-level-global-info -(defmethod inspect guard-level-global-info ((obj guard-level-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect guard-level-global-info ((this guard-level-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-yellow-hit: ~D~%" (-> obj prev-yellow-hit)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tknocked[2] @ #x~X~%" (-> obj knocked)) - (format #t "~1Tknocked-land[2] @ #x~X~%" (-> obj knocked-land)) - (format #t "~1Tanim-knocked-front: ~D~%" (-> obj knocked anim-index-front)) - (format #t "~1Tanim-knocked-back: ~D~%" (-> obj knocked anim-index-back)) - (format #t "~1Tanim-knocked-front-land: ~D~%" (-> obj knocked-land anim-index-front)) - (format #t "~1Tanim-knocked-back-land: ~D~%" (-> obj knocked-land anim-index-back)) - (format #t "~1Tyellow-hit-anim[2] @ #x~X~%" (-> obj yellow-hit-anim)) - (format #t "~1Tyellow-land-anim[2] @ #x~X~%" (-> obj yellow-land-anim)) - (format #t "~1Tblue-hit-anim[1] @ #x~X~%" (-> obj blue-hit-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tknocked[2] @ #x~X~%" (-> this knocked)) + (format #t "~1Tknocked-land[2] @ #x~X~%" (-> this knocked-land)) + (format #t "~1Tanim-knocked-front: ~D~%" (-> this knocked anim-index-front)) + (format #t "~1Tanim-knocked-back: ~D~%" (-> this knocked anim-index-back)) + (format #t "~1Tanim-knocked-front-land: ~D~%" (-> this knocked-land anim-index-front)) + (format #t "~1Tanim-knocked-back-land: ~D~%" (-> this knocked-land anim-index-back)) + (format #t "~1Tyellow-hit-anim[2] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tyellow-land-anim[2] @ #x~X~%" (-> this yellow-land-anim)) + (format #t "~1Tblue-hit-anim[1] @ #x~X~%" (-> this blue-hit-anim)) (label cfg-4) - obj + this ) ;; definition of type guard-level-shoot-info @@ -94,17 +94,17 @@ ) ;; definition for method 3 of type guard-level-shoot-info -(defmethod inspect guard-level-shoot-info ((obj guard-level-shoot-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect guard-level-shoot-info ((this guard-level-shoot-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'guard-level-shoot-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) - (format #t "~1Tstart: ~f~%" (-> obj start)) - (format #t "~1Tend: ~f~%" (-> obj end)) + (format #t "[~8x] ~A~%" this 'guard-level-shoot-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) + (format #t "~1Tstart: ~f~%" (-> this start)) + (format #t "~1Tend: ~f~%" (-> this end)) (label cfg-4) - obj + this ) ;; definition for symbol *crimson-guard-level-global-info*, type guard-level-global-info @@ -1096,74 +1096,74 @@ ) ;; definition for method 3 of type crimson-guard-level -(defmethod inspect crimson-guard-level ((obj crimson-guard-level)) - (when (not obj) - (set! obj obj) +(defmethod inspect crimson-guard-level ((this crimson-guard-level)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: ~A~%" (-> obj info)) - (format #t "~2Thit-face: ~D~%" (-> obj hit-face)) - (format #t "~2Tanim-get-up-front: ~D~%" (-> obj anim-get-up-front)) - (format #t "~2Tanim-get-up-back: ~D~%" (-> obj anim-get-up-back)) - (format #t "~2Tsmall-hit: ~D~%" (-> obj small-hit)) - (format #t "~2Tyellow-anim: ~D~%" (-> obj yellow-anim unsigned-anim-index-front)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tweapon: ~D~%" (-> obj weapon)) - (format #t "~2Tlast-time-see-target: ~D~%" (-> obj last-time-see-target)) - (format #t "~2Tjoint: ~A~%" (-> obj joint)) - (format #t "~2Tjoint-enable: ~A~%" (-> obj joint-enable)) - (format #t "~2Tl-control: ~A~%" (-> obj l-control)) - (format #t "~2Talready-shot: ~A~%" (-> obj already-shot)) - (format #t "~2Tmiss-amount: ~f~%" (-> obj miss-amount)) - (format #t "~2Tnext-shot: ~D~%" (-> obj next-shot)) - (format #t "~2Tanim-shoot[3] @ #x~X~%" (-> obj anim-shoot)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Ttarget-pos-predict: #~%" (-> obj target-pos-predict)) - (format #t "~2Ttarget-pos-predict-miss: #~%" (-> obj target-pos-predict-miss)) - (format #t "~2Ttarget-vel-vec: #~%" (-> obj target-vel-vec)) - (format #t "~2Ttarget-vel: ~f~%" (-> obj target-vel)) - (format #t "~2Ttarget-self: #~%" (-> obj target-self)) - (format #t "~2Ttarget-self-xz: #~%" (-> obj target-self-xz)) - (format #t "~2Ttarget-self-dist: ~f~%" (-> obj target-self-dist)) - (format #t "~2Ttarget-self-xz-dist: ~f~%" (-> obj target-self-xz-dist)) - (format #t "~2Ttarget-y-angle: ~f~%" (-> obj target-y-angle)) - (format #t "~2Tlazer-sound: ~D~%" (-> obj lazer-sound)) - (format #t "~2Ttransport: ~D~%" (-> obj transport)) - (format #t "~2Ttransport-side: ~D~%" (-> obj transport-side)) - (format #t "~2Tother-side: ~A~%" (-> obj other-side)) - (format #t "~2Tstart-target-pos: #~%" (-> obj start-target-pos)) - (format #t "~2Tstart-target-vel: #~%" (-> obj start-target-vel)) - (format #t "~2Ttrigger: ~A~%" (-> obj trigger)) - (format #t "~2Treachable-target-pos: #~%" (-> obj reachable-target-pos)) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Thit-face: ~D~%" (-> this hit-face)) + (format #t "~2Tanim-get-up-front: ~D~%" (-> this anim-get-up-front)) + (format #t "~2Tanim-get-up-back: ~D~%" (-> this anim-get-up-back)) + (format #t "~2Tsmall-hit: ~D~%" (-> this small-hit)) + (format #t "~2Tyellow-anim: ~D~%" (-> this yellow-anim unsigned-anim-index-front)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tweapon: ~D~%" (-> this weapon)) + (format #t "~2Tlast-time-see-target: ~D~%" (-> this last-time-see-target)) + (format #t "~2Tjoint: ~A~%" (-> this joint)) + (format #t "~2Tjoint-enable: ~A~%" (-> this joint-enable)) + (format #t "~2Tl-control: ~A~%" (-> this l-control)) + (format #t "~2Talready-shot: ~A~%" (-> this already-shot)) + (format #t "~2Tmiss-amount: ~f~%" (-> this miss-amount)) + (format #t "~2Tnext-shot: ~D~%" (-> this next-shot)) + (format #t "~2Tanim-shoot[3] @ #x~X~%" (-> this anim-shoot)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Ttarget-pos-predict: #~%" (-> this target-pos-predict)) + (format #t "~2Ttarget-pos-predict-miss: #~%" (-> this target-pos-predict-miss)) + (format #t "~2Ttarget-vel-vec: #~%" (-> this target-vel-vec)) + (format #t "~2Ttarget-vel: ~f~%" (-> this target-vel)) + (format #t "~2Ttarget-self: #~%" (-> this target-self)) + (format #t "~2Ttarget-self-xz: #~%" (-> this target-self-xz)) + (format #t "~2Ttarget-self-dist: ~f~%" (-> this target-self-dist)) + (format #t "~2Ttarget-self-xz-dist: ~f~%" (-> this target-self-xz-dist)) + (format #t "~2Ttarget-y-angle: ~f~%" (-> this target-y-angle)) + (format #t "~2Tlazer-sound: ~D~%" (-> this lazer-sound)) + (format #t "~2Ttransport: ~D~%" (-> this transport)) + (format #t "~2Ttransport-side: ~D~%" (-> this transport-side)) + (format #t "~2Tother-side: ~A~%" (-> this other-side)) + (format #t "~2Tstart-target-pos: #~%" (-> this start-target-pos)) + (format #t "~2Tstart-target-vel: #~%" (-> this start-target-vel)) + (format #t "~2Ttrigger: ~A~%" (-> this trigger)) + (format #t "~2Treachable-target-pos: #~%" (-> this reachable-target-pos)) (label cfg-4) - obj + this ) ;; definition for method 72 of type crimson-guard-level -(defmethod react-to-focus crimson-guard-level ((obj crimson-guard-level)) +(defmethod react-to-focus crimson-guard-level ((this crimson-guard-level)) "@TODO - flesh out docs" - (let ((s5-0 (-> obj focus aware))) + (let ((s5-0 (-> this focus aware))) (cond - ((and (= s5-0 (enemy-aware enemy-aware-3)) (get-enemy-target obj)) - (go-hostile obj) + ((and (= s5-0 (enemy-aware enemy-aware-3)) (get-enemy-target this)) + (go-hostile this) ) - ((and (= s5-0 (enemy-aware enemy-aware-2)) (get-enemy-target obj)) - (go-hostile obj) + ((and (= s5-0 (enemy-aware enemy-aware-2)) (get-enemy-target this)) + (go-hostile this) ) ((<= (the-as int s5-0) 0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((>= 1 (the-as int s5-0)) - (go (method-of-object obj active)) + (go (method-of-object this active)) ) ((= s5-0 (enemy-aware unaware)) - (go-flee obj) + (go-flee this) ) (else - (go-stare obj) + (go-stare this) ) ) ) @@ -1197,7 +1197,7 @@ (defstate stare (crimson-guard-level) :virtual #t :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((gp-0 (-> self focus aware))) (cond ((>= 1 (the-as int gp-0)) @@ -1222,38 +1222,38 @@ ) ;; definition for method 74 of type crimson-guard-level -(defmethod general-event-handler crimson-guard-level ((obj crimson-guard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler crimson-guard-level ((this crimson-guard-level) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('event-death) - (when (<= (-> obj hit-points) 0) - (set! (-> obj root penetrated-by) (the-as penetrate -1)) - (do-effect (-> obj skel effect) 'death-default 0.0 -1) + (when (<= (-> this hit-points) 0) + (set! (-> this root penetrated-by) (the-as penetrate -1)) + (do-effect (-> this skel effect) 'death-default 0.0 -1) ) ) (('hit 'hit-flinch 'hit-knocked) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (let* ((s1-0 (handle->process (-> obj incoming attacker-handle))) + (speech-control-method-13 *speech-control* (the-as handle this)) + (let* ((s1-0 (handle->process (-> this incoming attacker-handle))) (a0-13 (if (type? s1-0 process-focusable) s1-0 ) ) ) (if (and a0-13 (logtest? (-> a0-13 mask) (process-mask target))) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-11)) ) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('trigger) (let ((v0-0 (the-as object #t))) - (set! (-> obj trigger) (the-as symbol v0-0)) + (set! (-> this trigger) (the-as symbol v0-0)) v0-0 ) ) (('untrigger) - (set! (-> obj trigger) #f) + (set! (-> this trigger) #f) #f ) (('notify) @@ -1263,34 +1263,34 @@ (when (= a0-21 'attack) (when (logtest? (-> (the-as process-focusable v1-16) mask) (process-mask target)) (if (focus-test? (the-as process-focusable v1-16) dead) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-10)) ) ) ) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 191 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-191 crimson-guard-level ((obj crimson-guard-level)) - (let* ((s4-0 (-> obj target-pos-predict-miss)) - (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) +(defmethod crimson-guard-level-method-191 crimson-guard-level ((this crimson-guard-level)) + (let* ((s4-0 (-> this target-pos-predict-miss)) + (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (v1-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v1-2) 1.0)) (s4-1 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (set! (-> s4-1 ent) (-> obj entity)) + (set! (-> s4-1 ent) (-> this entity)) (set! (-> s4-1 charge) 1.0) (set! (-> s4-1 options) (projectile-options)) - (set! (-> s4-1 notify-handle) (process->handle obj)) + (set! (-> s4-1 notify-handle) (process->handle this)) (set! (-> s4-1 owner-handle) (the-as handle #f)) - (set! (-> s4-1 ignore-handle) (process->handle obj)) + (set! (-> s4-1 ignore-handle) (process->handle this)) (let* ((a0-13 *game-info*) (a1-12 (+ (-> a0-13 attack-id) 1)) ) @@ -1301,13 +1301,13 @@ (set! (-> s4-1 pos quad) (-> s5-0 quad)) (set! (-> s4-1 vel quad) (-> v1-3 quad)) (vector-normalize! (-> s4-1 vel) 819200.0) - (spawn-projectile guard-shot s4-1 obj *default-dead-pool*) + (spawn-projectile guard-shot s4-1 this *default-dead-pool*) ) ) ;; definition for method 195 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-195 crimson-guard-level ((obj crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod crimson-guard-level-method-195 crimson-guard-level ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1325,8 +1325,8 @@ (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) (set! (-> v1-4 collide-with) (collide-spec backgnd)) - (set! (-> v1-4 ignore-process0) obj) - (set! (-> v1-4 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) @@ -1386,8 +1386,8 @@ (let ((v1-17 s5-0)) (set! (-> v1-17 radius) f30-0) (set! (-> v1-17 collide-with) (collide-spec enemy obstacle hit-by-player-list hit-by-others-list)) - (set! (-> v1-17 ignore-process0) obj) - (set! (-> v1-17 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-17 ignore-process0) this) + (set! (-> v1-17 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-17 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-17 action-mask) (collide-action solid)) ) @@ -1420,30 +1420,30 @@ ;; definition for method 193 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-193 crimson-guard-level ((obj crimson-guard-level)) - (let ((s5-0 (get-trans obj 3)) +(defmethod crimson-guard-level-method-193 crimson-guard-level ((this crimson-guard-level)) + (let ((s5-0 (get-trans this 3)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> obj target-pos quad)) + (set! (-> s4-0 quad) (-> this target-pos quad)) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 s5-0))) (vector-normalize! s3-1 409600.0) - (zero? (crimson-guard-level-method-195 obj s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s3-1) s4-0)) + (zero? (crimson-guard-level-method-195 this s5-0 (vector+! (new 'stack-no-clear 'vector) s5-0 s3-1) s4-0)) ) ) ) ;; definition for method 194 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-194 crimson-guard-level ((obj crimson-guard-level)) +(defmethod crimson-guard-level-method-194 crimson-guard-level ((this crimson-guard-level)) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj target-pos-predict-miss quad)) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) + (set! (-> s5-0 quad) (-> this target-pos-predict-miss quad)) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a0-3)) ) (vector-normalize! s3-1 409600.0) - (and (crimson-guard-level-method-193 obj) - (zero? (crimson-guard-level-method-195 obj s4-0 (vector+! (new 'stack-no-clear 'vector) s4-0 s3-1) s5-0)) + (and (crimson-guard-level-method-193 this) + (zero? (crimson-guard-level-method-195 this s4-0 (vector+! (new 'stack-no-clear 'vector) s4-0 s3-1) s5-0)) ) ) ) @@ -1452,7 +1452,7 @@ ;; definition for method 196 of type crimson-guard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-level-method-196 crimson-guard-level ((obj crimson-guard-level) (arg0 vector)) +(defmethod crimson-guard-level-method-196 crimson-guard-level ((this crimson-guard-level) (arg0 vector)) (local-vars (sv-240 vector) (sv-256 (function vector vector vector)) @@ -1471,7 +1471,7 @@ (init-vf0-vector) (set! sv-240 arg0) (let ((s0-0 (new 'stack-no-clear 'vector))) - (let ((v1-1 (-> obj root trans))) + (let ((v1-1 (-> this root trans))) (let ((a0-1 *y-vector*)) (let ((a1-2 8192.0)) (.mov vf7 a1-2) @@ -1490,14 +1490,14 @@ (s2-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (-> obj node-list data 4 bone transform) - (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (-> this node-list data 4 bone transform) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s3-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) - (set! (-> s0-0 quad) (-> obj root trans quad)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (set! (-> s0-0 quad) (-> this root trans quad)) (cond - ((logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + ((logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) (let ((a1-6 s0-0)) (let ((v1-14 s0-0)) (let ((a0-9 s4-0)) @@ -1560,7 +1560,7 @@ (vector+! sv-288 sv-288 v0-5) ) (vector-normalize! (vector-! sv-320 sv-288 s0-0) 1.0) - (vector-z-quaternion! sv-304 (-> obj root quat)) + (vector-z-quaternion! sv-304 (-> this root quat)) (rot-zxy-from-vector! s2-0 sv-304) (rot-zxy-from-vector! s1-0 sv-320) (set! (-> s5-0 x) (fmax -14563.556 (fmin 14563.556 (deg- (-> s1-0 x) (-> s2-0 x))))) @@ -1572,7 +1572,7 @@ (quaternion-vector-angle! s1-1 s3-0 (-> s5-0 y)) (quaternion*! s2-1 s1-1 s2-1) ) - (quaternion-pseudo-seek (-> obj joint quat) (-> obj joint quat) s2-1 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) s2-1 (seconds-per-frame)) ) ) ) @@ -1583,28 +1583,28 @@ ) ;; definition for method 197 of type crimson-guard-level -(defmethod crimson-guard-level-method-197 crimson-guard-level ((obj crimson-guard-level)) - (quaternion-pseudo-seek (-> obj joint quat) (-> obj joint quat) *unity-quaternion* (seconds-per-frame)) +(defmethod crimson-guard-level-method-197 crimson-guard-level ((this crimson-guard-level)) + (quaternion-pseudo-seek (-> this joint quat) (-> this joint quat) *unity-quaternion* (seconds-per-frame)) ) ;; definition for method 55 of type crimson-guard-level ;; WARN: Return type mismatch object vs none. -(defmethod track-target! crimson-guard-level ((obj crimson-guard-level)) +(defmethod track-target! crimson-guard-level ((this crimson-guard-level)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (if (-> obj joint-enable) - (crimson-guard-level-method-196 obj (-> obj target-pos-predict-miss)) - (crimson-guard-level-method-197 obj) + (if (-> this joint-enable) + (crimson-guard-level-method-196 this (-> this target-pos-predict-miss)) + (crimson-guard-level-method-197 this) ) - (case (-> obj root cur-pat event) + (case (-> this root cur-pat event) (((pat-event melt)) - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'die))) - (go (method-of-object obj die)) + (if (not (and (-> this next-state) (= (-> this next-state name) 'die))) + (go (method-of-object this die)) ) ) ) @@ -1613,7 +1613,7 @@ ;; definition for method 200 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-200 crimson-guard-level ((obj crimson-guard-level)) +(defmethod crimson-guard-level-method-200 crimson-guard-level ((this crimson-guard-level)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1622,25 +1622,25 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (handle->process (-> obj focus handle)))) + (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 - (set! (-> obj target-pos quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) - (if (= (-> obj focus aware) (enemy-aware enemy-aware-3)) - (cloest-point-on-mesh (-> obj nav) (-> obj reachable-target-pos) (-> obj target-pos) (the-as nav-poly #f)) + (set! (-> this target-pos quad) (-> (get-trans (the-as process-focusable s5-0) 3) quad)) + (if (= (-> this focus aware) (enemy-aware enemy-aware-3)) + (cloest-point-on-mesh (-> this nav) (-> this reachable-target-pos) (-> this target-pos) (the-as nav-poly #f)) ) - (set! (-> obj target-vel-vec quad) (-> (the-as process-focusable s5-0) root transv quad)) - (set! (-> obj target-vel) (vector-length (-> obj target-vel-vec))) - (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> obj target-pos)))) - (let ((f0-2 (/ (vector-length s5-2) (if (= (-> obj weapon) 3) + (set! (-> this target-vel-vec quad) (-> (the-as process-focusable s5-0) root transv quad)) + (set! (-> this target-vel) (vector-length (-> this target-vel-vec))) + (let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this target-pos)))) + (let ((f0-2 (/ (vector-length s5-2) (if (= (-> this weapon) 3) 90112.0 819200.0 ) ) ) - (a1-3 (-> obj target-pos-predict)) + (a1-3 (-> this target-pos-predict)) ) - (let ((v1-20 (-> obj target-pos))) - (let ((a0-12 (-> obj target-vel-vec))) + (let ((v1-20 (-> this target-pos))) + (let ((a0-12 (-> this target-vel-vec))) (let ((a2-1 f0-2)) (.mov vf7 a2-1) ) @@ -1655,19 +1655,19 @@ ) (set! (-> s5-2 y) 0.0) (vector-rotate90-around-y! s5-2 s5-2) - (if (-> obj other-side) + (if (-> this other-side) (vector-negate! s5-2 s5-2) ) - (vector-normalize! s5-2 (-> obj miss-amount)) - (vector+! (-> obj target-pos-predict-miss) (-> obj target-pos-predict) s5-2) + (vector-normalize! s5-2 (-> this miss-amount)) + (vector+! (-> this target-pos-predict-miss) (-> this target-pos-predict) s5-2) ) - (vector-! (-> obj target-self) (-> obj target-pos) (-> obj root trans)) - (set! (-> obj target-self-xz quad) (-> obj target-self quad)) - (set! (-> obj target-self-xz y) 0.0) - (set! (-> obj target-self-dist) (vector-length (-> obj target-self))) - (set! (-> obj target-self-xz-dist) (vector-length (-> obj target-self-xz))) - (set! (-> obj target-y-angle) - (deg-diff (quaternion-y-angle (-> obj root quat)) (vector-y-angle (-> obj target-self))) + (vector-! (-> this target-self) (-> this target-pos) (-> this root trans)) + (set! (-> this target-self-xz quad) (-> this target-self quad)) + (set! (-> this target-self-xz y) 0.0) + (set! (-> this target-self-dist) (vector-length (-> this target-self))) + (set! (-> this target-self-xz-dist) (vector-length (-> this target-self-xz))) + (set! (-> this target-y-angle) + (deg-diff (quaternion-y-angle (-> this root quat)) (vector-y-angle (-> this target-self))) ) ) ) @@ -1679,7 +1679,7 @@ :virtual #t :enter (behavior () (talker-spawn-func (-> *talker-speech* 10) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-4 (logior (-> self enemy-flags) (enemy-flag use-notice-distance)))) (set! (-> self enemy-flags) (logclear v1-4 (enemy-flag called-dying))) ) @@ -1754,7 +1754,7 @@ (t9-0) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (if (logtest? (-> self flags) 4) (go-virtual gun-shoot) ) @@ -1765,7 +1765,7 @@ ) :trans (behavior () (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((or (< (the-as int gp-0) 2) (not (get-enemy-target self))) (go-stare self) @@ -1840,7 +1840,7 @@ :event enemy-event-handler :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self reaction-time) (the-as time-frame (the int (* 300.0 (get-rand-float-range self 0.5 1.5))))) ) :exit (behavior () @@ -1848,7 +1848,7 @@ ) :trans (behavior () (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((or (>= 2 (the-as int gp-0)) (not (get-enemy-target self))) (go-stare self) @@ -1903,7 +1903,7 @@ :event enemy-event-handler :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-156 self) ) :exit (behavior () @@ -1911,7 +1911,7 @@ ) :trans (behavior () (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((or (< (the-as int gp-0) 2) (not (get-enemy-target self))) (go-stare self) @@ -1945,7 +1945,7 @@ ) (if (and (< (-> self target-self-xz-dist) 327680.0) (crimson-guard-level-method-193 self) - (>= (- (current-time) (-> self state-time)) (the int (* 300.0 (rand-vu-float-range 1.0 8.0)))) + (time-elapsed? (-> self state-time) (the int (* 300.0 (rand-vu-float-range 1.0 8.0)))) ) (go-virtual gun-shoot) ) @@ -1978,7 +1978,7 @@ :event enemy-event-handler :enter (behavior () ((-> (method-of-type nav-enemy hostile) enter)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-156 self) ) :exit (behavior () @@ -1986,7 +1986,7 @@ ) :trans (behavior () (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((or (< (the-as int gp-0) 2) (not (get-enemy-target self))) (go-stare self) @@ -2016,9 +2016,9 @@ ) (else (if (or (and (logtest? (-> self nav state flags) (nav-state-flag at-target)) - (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) - (>= (- (current-time) (-> self state-time)) (seconds 1)) + (time-elapsed? (-> self state-time) (seconds 1)) ) (go-virtual grenade-attack) ) @@ -2068,7 +2068,7 @@ (set! (-> a0-9 velocity quad) (-> v1-12 quad)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self last-time-see-target) (the-as int (current-time))) (set! (-> self miss-amount) 0.0) (set! (-> self next-shot) (the-as int (current-time))) @@ -2082,7 +2082,7 @@ :trans (behavior () (crimson-guard-level-method-200 self) (let ((v1-2 (-> self focus aware))) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (cond ((< (the-as int v1-2) 2) (go-stare self) @@ -2109,7 +2109,7 @@ ) ) (until #f - (if (or (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (if (or (time-elapsed? (-> self state-time) (-> self reaction-time)) (< 10922.667 (fabs (-> self target-y-angle))) ) (goto cfg-13) @@ -2169,7 +2169,7 @@ (set! (-> a0-8 velocity quad) (-> v1-13 quad)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self last-time-see-target) (the-as int (current-time))) (crimson-guard-level-method-200 self) (if (logtest? (-> self flags) 4) @@ -2218,7 +2218,7 @@ (set! (-> self start-target-vel quad) (-> (the-as process-drawable v1-31) root transv quad)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (label cfg-10) (when (crimson-guard-level-method-194 self) (when (or (not (logtest? (-> self flags) 256)) (and (logtest? (-> self flags) 256) (-> self trigger))) @@ -2226,7 +2226,7 @@ (goto cfg-23) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (set! v1-48 #f) (goto cfg-23) ) @@ -2234,7 +2234,7 @@ (b! (not #f) cfg-10 :delay (set! v1-48 #f)) (label cfg-23) (when v1-48 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 3)) (until #f (ja-channel-push! 1 (seconds 0.1)) @@ -2273,7 +2273,7 @@ ) (when (logtest? (-> self flags) 4) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) (seconds 1)) + (until (time-elapsed? s5-1 (seconds 1)) (suspend) ) ) @@ -2314,7 +2314,7 @@ ;; definition for method 199 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod crimson-guard-level-method-199 crimson-guard-level ((obj crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) +(defmethod crimson-guard-level-method-199 crimson-guard-level ((this crimson-guard-level) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (sv-672 vector) (sv-688 vector) (sv-704 vector) (sv-720 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2384,8 +2384,8 @@ (+! (-> sv-672 x) (rand-vu-float-range -819.2 819.2)) (+! (-> sv-672 y) (rand-vu-float-range -819.2 819.2)) (+! (-> sv-672 z) (rand-vu-float-range -819.2 819.2)) - (set-point! (-> obj l-control) (-> obj l-control state points-to-draw) sv-672) - (+! (-> obj l-control state points-to-draw) 1) + (set-point! (-> this l-control) (-> this l-control state points-to-draw) sv-672) + (+! (-> this l-control state points-to-draw) 1) (quaternion-from-two-vectors! (the-as quaternion sv-688) s2-0 (-> s1-0 best-other-tri normal)) (vector-orient-by-quat! s3-0 s3-0 (the-as quaternion sv-688)) (set! (-> s2-0 quad) (-> s1-0 best-other-tri normal quad)) @@ -2447,8 +2447,8 @@ (+! (-> sv-704 x) (rand-vu-float-range -819.2 819.2)) (+! (-> sv-704 y) (rand-vu-float-range -819.2 819.2)) (+! (-> sv-704 z) (rand-vu-float-range -819.2 819.2)) - (set-point! (-> obj l-control) (-> obj l-control state points-to-draw) sv-704) - (+! (-> obj l-control state points-to-draw) 1) + (set-point! (-> this l-control) (-> this l-control state points-to-draw) sv-704) + (+! (-> this l-control state points-to-draw) 1) (quaternion-from-two-vectors! (the-as quaternion sv-720) s2-0 (-> s1-0 best-other-tri normal)) (vector-orient-by-quat! s3-0 s3-0 (the-as quaternion sv-720)) (set! (-> s2-0 quad) (-> s1-0 best-other-tri normal quad)) @@ -2457,8 +2457,8 @@ (else (vector+! s4-0 s4-0 s3-0) (when (< s0-0 6) - (set-point! (-> obj l-control) (-> obj l-control state points-to-draw) s4-0) - (+! (-> obj l-control state points-to-draw) 1) + (set-point! (-> this l-control) (-> this l-control state points-to-draw) s4-0) + (+! (-> this l-control state points-to-draw) 1) ) ) ) @@ -2478,7 +2478,7 @@ ;; definition for method 198 of type crimson-guard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-level-method-198 crimson-guard-level ((obj crimson-guard-level)) +(defmethod crimson-guard-level-method-198 crimson-guard-level ((this crimson-guard-level)) (local-vars (sv-784 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -2488,11 +2488,11 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14))) - (v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15))) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14))) + (v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 15))) (s2-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v0-1) 16384.0)) (s1-0 - (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj target-pos-predict-miss) s4-0) 16384.0) + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict-miss) s4-0) 16384.0) ) (s5-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'collide-query)) @@ -2532,7 +2532,7 @@ (set! (-> s3-0 ignore-process1) #f) (set! (-> s3-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (fill-using-line-sphere *collide-cache* s3-0) - (set! (-> obj l-control state points-to-draw) 0) + (set! (-> this l-control state points-to-draw) 0) (let ((f0-3 (probe-using-line-sphere *collide-cache* s3-0)) (s2-1 (new 'stack-no-clear 'vector)) ) @@ -2555,7 +2555,7 @@ (let ((s1-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s1-2 (let ((t9-15 (method-of-type part-tracker activate))) - (t9-15 (the-as part-tracker s1-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-15 (the-as part-tracker s1-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-16 run-function-in-process) (a0-34 s1-2) @@ -2585,7 +2585,7 @@ (let ((s1-3 (get-process *default-dead-pool* part-tracker #x4000))) (when s1-3 (let ((t9-18 (method-of-type part-tracker activate))) - (t9-18 (the-as part-tracker s1-3) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-18 (the-as part-tracker s1-3) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-19 run-function-in-process) (a0-37 s1-3) @@ -2612,10 +2612,10 @@ (-> s1-3 ppointer) ) ) - (set-point! (-> obj l-control) 0 s4-0) - (set-point! (-> obj l-control) 1 s5-0) - (set! (-> obj l-control spec) (-> *lightning-spec-id-table* 13)) - (+! (-> obj l-control state points-to-draw) 2) + (set-point! (-> this l-control) 0 s4-0) + (set-point! (-> this l-control) 1 s5-0) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 13)) + (+! (-> this l-control state points-to-draw) 2) (let* ((s4-1 (-> s3-0 best-other-tri collide-ptr)) (v1-45 (if (type? s4-1 collide-shape-prim) (the-as collide-shape-prim s4-1) @@ -2629,14 +2629,14 @@ (send-event (-> v1-45 cshape process) 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'shock)))) ) ) - (crimson-guard-level-method-199 obj s5-0 s2-1 (-> s3-0 best-other-tri normal) (the-as float s4-2)) + (crimson-guard-level-method-199 this s5-0 s2-1 (-> s3-0 best-other-tri normal) (the-as float s4-2)) ) ) (else (let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s3-1 (let ((t9-26 (method-of-type part-tracker activate))) - (t9-26 (the-as part-tracker s3-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-26 (the-as part-tracker s3-1) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-27 run-function-in-process) (a0-56 s3-1) @@ -2666,7 +2666,7 @@ (let ((s3-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s3-2 (let ((t9-29 (method-of-type part-tracker activate))) - (t9-29 (the-as part-tracker s3-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-29 (the-as part-tracker s3-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-30 run-function-in-process) (a0-59 s3-2) @@ -2693,12 +2693,12 @@ (-> s3-2 ppointer) ) ) - (set! (-> obj l-control state points-to-draw) 9) - (set! (-> obj l-control spec) (-> *lightning-spec-id-table* 14)) + (set! (-> this l-control state points-to-draw) 9) + (set! (-> this l-control spec) (-> *lightning-spec-id-table* 14)) (let ((v1-67 s4-0)) - (set! (-> obj l-control state meet data 0 quad) (-> v1-67 quad)) + (set! (-> this l-control state meet data 0 quad) (-> v1-67 quad)) ) - (let ((a0-65 (-> obj l-control)) + (let ((a0-65 (-> this l-control)) (v1-69 s5-0) ) (set! (-> a0-65 state meet data (+ (-> a0-65 state points-to-draw) -1) quad) (-> v1-69 quad)) @@ -2762,11 +2762,11 @@ ;; definition for method 192 of type crimson-guard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-level-method-192 crimson-guard-level ((obj crimson-guard-level)) - (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14)))) +(defmethod crimson-guard-level-method-192 crimson-guard-level ((this crimson-guard-level)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 14)))) (new 'stack-no-clear 'vector) (let ((s5-0 (new 'stack-no-clear 'traj3d-params))) - (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> obj target-pos-predict) s4-0))) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this target-pos-predict) s4-0))) (set! (-> s3-1 y) 0.0) (vector-rotate-around-y! s3-1 s3-1 (* 182.04445 (+ (if (zero? (rand-vu-int-count 2)) 90.0 @@ -2776,25 +2776,27 @@ ) ) ) - (if (logtest? (-> obj draw status) (draw-control-status on-screen)) + (if (logtest? (-> this draw status) (draw-control-status on-screen)) (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 1.0 4.0))) (vector-normalize! s3-1 (* 4096.0 (rand-vu-float-range 4.0 15.0))) ) - (set! (-> s5-0 dest quad) (-> (vector+! (new 'stack-no-clear 'vector) s3-1 (-> obj target-pos-predict)) quad)) + (set! (-> s5-0 dest quad) + (-> (vector+! (new 'stack-no-clear 'vector) s3-1 (-> this target-pos-predict)) quad) + ) ) (set! (-> s5-0 src quad) (-> s4-0 quad)) (set! (-> s5-0 initial-tilt) 8192.0) (set! (-> s5-0 gravity) 184320.0) (when (traj3d-calc-initial-velocity-using-tilt s5-0) (let ((a1-9 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> a1-9 ent) (-> obj entity)) + (set! (-> a1-9 ent) (-> this entity)) (set! (-> a1-9 charge) 1.0) (set! (-> a1-9 options) (projectile-options)) (set! (-> a1-9 pos quad) (-> s5-0 src quad)) (set! (-> a1-9 vel quad) (-> s5-0 initial-velocity quad)) (set! (-> a1-9 notify-handle) (the-as handle #f)) (set! (-> a1-9 owner-handle) (the-as handle #f)) - (set! (-> a1-9 ignore-handle) (process->handle obj)) + (set! (-> a1-9 ignore-handle) (process->handle this)) (let* ((v1-24 *game-info*) (a0-23 (+ (-> v1-24 attack-id) 1)) ) @@ -2802,7 +2804,7 @@ (set! (-> a1-9 attack-id) a0-23) ) (set! (-> a1-9 timeout) (seconds 4)) - (spawn-projectile vehicle-grenade a1-9 obj *default-dead-pool*) + (spawn-projectile vehicle-grenade a1-9 this *default-dead-pool*) ) ) ) @@ -2854,7 +2856,7 @@ (ja :num! (seek! (ja-aframe 12.0 0))) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (the int (* 900.0 (you-suck-scale *game-info* #f)))) + (until (time-elapsed? gp-2 (the int (* 900.0 (you-suck-scale *game-info* #f)))) (ja-no-eval :group! (-> self draw art-group data 37) :num! (seek! (ja-aframe 12.0 0)) :frame-num (ja-aframe 12.0 0) @@ -2918,7 +2920,7 @@ ) 0 (set! (-> self miss-amount) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self next-shot) (the-as int (current-time))) (set! (-> self lazer-sound) (new 'static 'sound-id)) 0 @@ -2960,7 +2962,7 @@ ) :trans (behavior () (crimson-guard-level-method-200 self) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 1)) (< 32768.0 (-> self target-self-xz-dist))) + (if (and (time-elapsed? (-> self state-time) (seconds 1)) (< 32768.0 (-> self target-self-xz-dist))) (go-hostile self) ) ) @@ -3065,7 +3067,7 @@ (f30-0 1.0) ) (ja-no-eval :group! (-> self draw art-group data 22) :num! (loop! f30-0) :frame-num 0.0) - (until (>= (- (current-time) gp-4) s5-1) + (until (time-elapsed? gp-4 s5-1) (crimson-guard-level-method-198 self) (suspend) (ja :num! (loop! f30-0)) @@ -3130,7 +3132,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -3181,7 +3183,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -3229,9 +3231,9 @@ ;; definition for method 204 of type crimson-guard-level ;; WARN: Return type mismatch object vs none. -(defmethod crimson-guard-level-method-204 crimson-guard-level ((obj crimson-guard-level)) - (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s5-0 (-> obj root)) +(defmethod crimson-guard-level-method-204 crimson-guard-level ((this crimson-guard-level)) + (let ((s4-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (-> this root)) (s3-0 (lambda ((arg0 crimson-guard-level) (arg1 collide-shape-moving) (arg2 vector)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) @@ -3273,11 +3275,11 @@ ) ) (cond - ((s3-0 obj s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 24576.0)) - (go (method-of-object obj roll-right)) + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 24576.0)) + (go (method-of-object this roll-right)) ) - ((s3-0 obj s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 -24576.0)) - (go (method-of-object obj roll-left)) + ((s3-0 this s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 -24576.0)) + (go (method-of-object this roll-left)) ) ) ) @@ -3529,23 +3531,23 @@ ) ;; definition for method 77 of type crimson-guard-level -(defmethod enemy-method-77 crimson-guard-level ((obj crimson-guard-level) (arg0 (pointer float))) - (let ((v1-1 (-> obj root transv))) +(defmethod enemy-method-77 crimson-guard-level ((this crimson-guard-level) (arg0 (pointer float))) + (let ((v1-1 (-> this root transv))) (cond ((< (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))) 57344.0) - (set! (-> obj small-hit) 1) + (set! (-> this small-hit) 1) ) (else - (set! (-> obj small-hit) 0) + (set! (-> this small-hit) 0) 0 ) ) ) (cond - ((<= (-> obj hit-points) 0) + ((<= (-> this hit-points) 0) (ja-channel-push! 1 (seconds 0.01)) - (let ((a1-2 (-> obj draw art-group data (-> obj info knocked anim-index (-> obj hit-face)))) - (a0-5 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this info knocked anim-index (-> this hit-face)))) + (a0-5 (-> this skel root-channel 0)) ) (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -3555,26 +3557,26 @@ ) ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-5) (knocked-type knocked-type-7)) (ja-channel-push! 1 (seconds 0.01)) (cond - ((= (-> obj small-hit) 1) - (set! (-> obj yellow-anim anim-index-front) (get-rand-int obj 2)) + ((= (-> this small-hit) 1) + (set! (-> this yellow-anim anim-index-front) (get-rand-int this 2)) (let ((a1-8 - (-> obj + (-> this draw art-group data - (-> (the-as (array int32) (+ (+ (* (-> obj hit-face) 4) (* (-> obj yellow-anim unsigned-anim-index-front) 8)) - (the-as uint (-> obj info)) + (-> (the-as (array int32) (+ (+ (* (-> this hit-face) 4) (* (-> this yellow-anim unsigned-anim-index-front) 8)) + (the-as uint (-> this info)) ) ) 2 ) ) ) - (a0-17 (-> obj skel root-channel 0)) + (a0-17 (-> this skel root-channel 0)) ) (set! (-> a0-17 frame-group) (the-as art-joint-anim a1-8)) (set! (-> a0-17 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1))) @@ -3584,8 +3586,8 @@ ) ) (else - (let ((a1-9 (-> obj draw art-group data (-> obj info knocked anim-index (-> obj hit-face)))) - (a0-21 (-> obj skel root-channel 0)) + (let ((a1-9 (-> this draw art-group data (-> this info knocked anim-index (-> this hit-face)))) + (a0-21 (-> this skel root-channel 0)) ) (set! (-> a0-21 frame-group) (the-as art-joint-anim a1-9)) (set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-9) frames num-frames) -1))) @@ -3598,20 +3600,20 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-24 (-> obj skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> obj draw art-group data 10))) + (let ((a0-24 (-> this skel root-channel 0))) + (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> this draw art-group data 10))) (set! (-> a0-24 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 10)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1)) ) (set! (-> a0-24 param 1) (-> arg0 0)) (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> obj draw art-group data 10)) num-func-seek!) + (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-13 (-> obj draw art-group data (-> obj info knocked anim-index (-> obj hit-face)))) - (a0-29 (-> obj skel root-channel 0)) + (let ((a1-13 (-> this draw art-group data (-> this info knocked anim-index (-> this hit-face)))) + (a0-29 (-> this skel root-channel 0)) ) (set! (-> a0-29 frame-group) (the-as art-joint-anim a1-13)) (set! (-> a0-29 param 0) (the float (+ (-> (the-as art-joint-anim a1-13) frames num-frames) -1))) @@ -3627,37 +3629,37 @@ ) ;; definition for method 70 of type crimson-guard-level -(defmethod go-hostile crimson-guard-level ((obj crimson-guard-level)) - (let ((v1-0 (-> obj hit-face))) +(defmethod go-hostile crimson-guard-level ((this crimson-guard-level)) + (let ((v1-0 (-> this hit-face))) (cond ((zero? v1-0) - (go (method-of-object obj get-up-front)) + (go (method-of-object this get-up-front)) ) ((= v1-0 1) - (go (method-of-object obj get-up-back)) + (go (method-of-object this get-up-back)) ) - ((logtest? (-> obj flags) 1) - (go (method-of-object obj tazer-hostile)) + ((logtest? (-> this flags) 1) + (go (method-of-object this tazer-hostile)) ) - ((logtest? (-> obj flags) 2) - (go (method-of-object obj blast-hostile)) + ((logtest? (-> this flags) 2) + (go (method-of-object this blast-hostile)) ) - ((logtest? (-> obj flags) 8) - (go (method-of-object obj grenade-hostile)) + ((logtest? (-> this flags) 8) + (go (method-of-object this grenade-hostile)) ) (else - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) ) ) ) ;; definition for method 78 of type crimson-guard-level -(defmethod enemy-method-78 crimson-guard-level ((obj crimson-guard-level) (arg0 (pointer float))) +(defmethod enemy-method-78 crimson-guard-level ((this crimson-guard-level) (arg0 (pointer float))) (cond - ((<= (-> obj hit-points) 0) - (let ((a1-1 (-> obj draw art-group data (-> obj info knocked-land anim-index (-> obj hit-face)))) - (a0-4 (-> obj skel root-channel 0)) + ((<= (-> this hit-points) 0) + (let ((a1-1 (-> this draw art-group data (-> this info knocked-land anim-index (-> this hit-face)))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-1)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-1) frames num-frames) -1))) @@ -3665,29 +3667,29 @@ (set! (-> a0-4 frame-num) 0.0) (joint-control-channel-group! a0-4 (the-as art-joint-anim a1-1) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-5) (knocked-type knocked-type-7)) (ja-channel-push! 1 (seconds 0.1)) (cond - ((= (-> obj small-hit) 1) + ((= (-> this small-hit) 1) (let ((a1-6 - (-> obj + (-> this draw art-group data - (-> (the-as (array int32) (+ (+ (* (-> obj hit-face) 4) (* (-> obj yellow-anim unsigned-anim-index-front) 8)) - (the-as uint (-> obj info)) + (-> (the-as (array int32) (+ (+ (* (-> this hit-face) 4) (* (-> this yellow-anim unsigned-anim-index-front) 8)) + (the-as uint (-> this info)) ) ) 6 ) ) ) - (a0-15 (-> obj skel root-channel 0)) + (a0-15 (-> this skel root-channel 0)) ) (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) @@ -3695,12 +3697,12 @@ (set! (-> a0-15 frame-num) 0.0) (joint-control-channel-group! a0-15 (the-as art-joint-anim a1-6) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else - (let ((a1-7 (-> obj draw art-group data (-> obj info knocked-land anim-index (-> obj hit-face)))) - (a0-19 (-> obj skel root-channel 0)) + (let ((a1-7 (-> this draw art-group data (-> this info knocked-land anim-index (-> this hit-face)))) + (a0-19 (-> this skel root-channel 0)) ) (set! (-> a0-19 frame-group) (the-as art-joint-anim a1-7)) (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim a1-7) frames num-frames) -1))) @@ -3714,22 +3716,22 @@ ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-22 (-> obj skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 11))) + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 11)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) ) (set! (-> a0-22 param 1) (-> arg0 0)) (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 11)) num-func-seek!) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) ) - (set! (-> obj hit-face) (the-as uint -1)) + (set! (-> this hit-face) (the-as uint -1)) #t ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-11 (-> obj draw art-group data (-> obj info knocked-land anim-index (-> obj hit-face)))) - (a0-27 (-> obj skel root-channel 0)) + (let ((a1-11 (-> this draw art-group data (-> this info knocked-land anim-index (-> this hit-face)))) + (a0-27 (-> this skel root-channel 0)) ) (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-11)) (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1))) @@ -3857,8 +3859,8 @@ ;; definition for method 201 of type crimson-guard-level ;; WARN: Return type mismatch int vs none. -(defmethod crimson-guard-level-method-201 crimson-guard-level ((obj crimson-guard-level) (arg0 float)) - (let* ((s3-0 (handle->process (-> obj transport))) +(defmethod crimson-guard-level-method-201 crimson-guard-level ((this crimson-guard-level) (arg0 float)) + (let* ((s3-0 (handle->process (-> this transport))) (s4-0 (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) ) @@ -3868,7 +3870,7 @@ (let ((s2-0 (matrix<-transformq! (new 'stack-no-clear 'matrix) (the-as transformq (-> s4-0 root trans)))) (s3-1 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-1 x) (if (zero? (-> obj transport-side)) + (set! (-> s3-1 x) (if (zero? (-> this transport-side)) -8192.0 8192.0 ) @@ -3876,13 +3878,13 @@ (set! (-> s3-1 y) 12288.0) (set! (-> s3-1 z) (lerp-scale -16384.0 -49152.0 arg0 0.0 1.0)) (set! (-> s3-1 w) 1.0) - (quaternion-rotate-local-y! (-> obj root quat) (-> s4-0 root quat) 32768.0) - (vector-matrix*! (-> obj root trans) s3-1 s2-0) + (quaternion-rotate-local-y! (-> this root quat) (-> s4-0 root quat) 32768.0) + (vector-matrix*! (-> this root trans) s3-1 s2-0) ) ) ) (let ((f0-5 (fmax 0.0 (fmin 1.0 (* 3.3333333 arg0))))) - (set-vector! (-> obj draw color-mult) f0-5 f0-5 f0-5 1.0) + (set-vector! (-> this draw color-mult) f0-5 f0-5 f0-5 1.0) ) 0 (none) @@ -3893,7 +3895,7 @@ ;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3] ;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4] ;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5] -(defmethod crimson-guard-level-method-202 crimson-guard-level ((obj crimson-guard-level) (arg0 vector)) +(defmethod crimson-guard-level-method-202 crimson-guard-level ((this crimson-guard-level) (arg0 vector)) (local-vars (f0-8 float) (sv-768 vector) @@ -3910,7 +3912,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s4-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (f30-0 0.0) ) (dotimes (s3-0 2) @@ -3922,7 +3924,7 @@ ) (vector-rotate-around-y! sv-768 s4-0 (* 182.04445 (the float (+ (* 23 s2-0) -70)))) (let ((v1-10 s1-0)) - (let ((a0-6 (-> obj root trans))) + (let ((a0-6 (-> this root trans))) (let ((a1-5 sv-768)) (let ((a2-2 1.0)) (.mov vf7 a2-2) @@ -3936,10 +3938,10 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-10 quad) vf6) ) - (if (enemy-above-ground? obj s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) ) - (let ((v1-14 (-> obj nav)) + (let ((v1-14 (-> this nav)) (a0-8 s1-0) (a1-7 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -3967,12 +3969,12 @@ (let ((a1-8 (new 'stack-no-clear 'vector))) (set! (-> a1-8 quad) (-> s1-0 quad)) (set! (-> a1-8 w) 8192.0) - (when (not (add-root-sphere-to-hash! (-> obj nav) a1-8 32)) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-8 32)) (when (< f30-0 f28-0) (set! f30-0 f28-0) (set! sv-784 (new 'stack-no-clear 'vector)) (let ((a3-3 (new 'stack-no-clear 'vector))) - (set! sv-800 (-> obj nav)) + (set! sv-800 (-> this nav)) (set! sv-832 sv-784) (let* ((v1-30 s1-0) (a0-18 (-> sv-800 state mesh)) @@ -3994,7 +3996,7 @@ ) 0 (set! (-> s1-0 y) (-> sv-784 y)) - (if (enemy-above-ground? obj s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s0-0 s1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s1-0 y) (-> s0-0 best-other-tri intersect y)) ) (set! (-> arg0 quad) (-> s1-0 quad)) @@ -4013,76 +4015,78 @@ ;; definition for method 93 of type crimson-guard-level ;; INFO: Used lq/sq -(defmethod enemy-method-93 crimson-guard-level ((obj crimson-guard-level)) - (let ((s5-0 (-> obj nav state)) - (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) +(defmethod enemy-method-93 crimson-guard-level ((this crimson-guard-level)) + (let ((s5-0 (-> this nav state)) + (v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (set! (-> s5-0 heading quad) (-> v1-2 quad)) ) 0 - (let ((s5-1 (-> obj nav state))) - (set! (-> (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) quad) (-> s5-1 travel quad)) + (let ((s5-1 (-> this nav state))) + (set! (-> (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) quad) + (-> s5-1 travel quad) + ) ) - (let ((a0-5 (-> obj nav state)) + (let ((a0-5 (-> this nav state)) (v1-9 *null-vector*) ) (set! (-> a0-5 velocity quad) (-> v1-9 quad)) ) 0 - ((method-of-type nav-enemy enemy-method-93) obj) + ((method-of-type nav-enemy enemy-method-93) this) (none) ) ;; definition for method 89 of type crimson-guard-level -(defmethod enemy-method-89 crimson-guard-level ((obj crimson-guard-level) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) #f ) ;; definition for method 87 of type crimson-guard-level -(defmethod enemy-method-87 crimson-guard-level ((obj crimson-guard-level) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-87 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((s4-0 (-> obj skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 38))) + (let ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) (set! (-> s4-0 param 0) (ja-aframe 3.0 0)) (set! (-> s4-0 param 1) (-> arg0 anim-speed)) (set! (-> s4-0 frame-num) (ja-aframe 0.0 0)) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> obj draw art-group data 38)) num-func-seek!) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) ) #t ) ;; definition for method 88 of type crimson-guard-level -(defmethod enemy-method-88 crimson-guard-level ((obj crimson-guard-level) (arg0 enemy-jump-info)) - (let ((a0-1 (-> obj skel root-channel 0))) +(defmethod enemy-method-88 crimson-guard-level ((this crimson-guard-level) (arg0 enemy-jump-info)) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) (ja-channel-push! 1 (seconds 0.01)) - (let ((s4-0 (-> obj skel root-channel 0))) - (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> obj draw art-group data 38))) + (let ((s4-0 (-> this skel root-channel 0))) + (set! (-> s4-0 frame-group) (the-as art-joint-anim (-> this draw art-group data 38))) (set! (-> s4-0 param 0) (ja-aframe 9.0 0)) (set! (-> s4-0 param 1) (-> arg0 anim-speed)) (set! (-> s4-0 frame-num) (ja-aframe 4.0 0)) - (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> obj draw art-group data 38)) num-func-seek!) + (joint-control-channel-group! s4-0 (the-as art-joint-anim (-> this draw art-group data 38)) num-func-seek!) ) #t ) ;; definition for method 90 of type crimson-guard-level -(defmethod enemy-method-90 crimson-guard-level ((obj crimson-guard-level) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 crimson-guard-level ((this crimson-guard-level) (arg0 int) (arg1 enemy-jump-info)) (local-vars (s5-0 symbol)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (not (enemy-method-89 obj arg1)) + (not (enemy-method-89 this arg1)) ) ((= v1-0 1) (set! s5-0 (ja-done? 0)) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (set! (-> s4-1 param 0) (ja-aframe 3.0 0)) (set! (-> s4-1 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-1 (the-as art-joint-anim #f) num-func-seek!) @@ -4091,12 +4095,12 @@ s5-0 ) ((= v1-0 2) - (enemy-method-87 obj arg1) + (enemy-method-87 this arg1) #f ) ((= v1-0 3) (set! s5-0 (ja-done? 0)) - (let ((s4-2 (-> obj skel root-channel 0))) + (let ((s4-2 (-> this skel root-channel 0))) (set! (-> s4-2 param 0) (ja-aframe 3.0 0)) (set! (-> s4-2 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-2 (the-as art-joint-anim #f) num-func-seek!) @@ -4105,11 +4109,11 @@ s5-0 ) ((= v1-0 4) - (not (enemy-method-88 obj arg1)) + (not (enemy-method-88 this arg1)) ) ((= v1-0 5) (set! s5-0 (ja-done? 0)) - (let ((s4-3 (-> obj skel root-channel 0))) + (let ((s4-3 (-> this skel root-channel 0))) (set! (-> s4-3 param 0) (ja-aframe 9.0 0)) (set! (-> s4-3 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! s4-3 (the-as art-joint-anim #f) num-func-seek!) @@ -4129,7 +4133,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self nav flags) (nav-control-flag output-sphere-hash)) (nav-enemy-method-166 self) (let ((v1-7 (-> self nav))) @@ -4203,14 +4207,14 @@ (while (not (-> self already-shot)) (suspend) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (ja-channel-set! 1) (let ((gp-0 (current-time)) (s5-0 150) (f30-0 2.0) ) (ja-no-eval :group! (-> self draw art-group data 6) :num! (loop! f30-0) :frame-num 0.0) - (until (>= (- (current-time) gp-0) s5-0) + (until (time-elapsed? gp-0 s5-0) (crimson-guard-level-method-201 self (* 0.006666667 (the float (- (current-time) (-> self state-time))))) (suspend) (ja :num! (loop! f30-0)) @@ -4230,9 +4234,9 @@ ;; definition for method 114 of type crimson-guard-level ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! crimson-guard-level ((obj crimson-guard-level)) +(defmethod init-enemy-collision! crimson-guard-level ((this crimson-guard-level)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -4302,7 +4306,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -4310,38 +4314,38 @@ ;; definition for method 7 of type crimson-guard-level ;; WARN: Return type mismatch nav-enemy vs crimson-guard-level. -(defmethod relocate crimson-guard-level ((obj crimson-guard-level) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(defmethod relocate crimson-guard-level ((this crimson-guard-level) (arg0 int)) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) arg0) ) - (if (nonzero? (-> obj l-control)) - (&+! (-> obj l-control) arg0) + (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)) obj arg0) + ((the-as (function nav-enemy int nav-enemy) (find-parent-method crimson-guard-level 7)) this arg0) ) ) ;; definition for method 203 of type crimson-guard-level ;; WARN: Return type mismatch float vs none. -(defmethod crimson-guard-level-method-203 crimson-guard-level ((obj crimson-guard-level) (arg0 int)) +(defmethod crimson-guard-level-method-203 crimson-guard-level ((this crimson-guard-level) (arg0 int)) "TODO - probably a flag" (cond ((= arg0 1) - (setup-masks (-> obj draw) 16 0) - (set! (-> obj weapon) 1) - (set! (-> obj root nav-radius) 10240.0) + (setup-masks (-> this draw) 16 0) + (set! (-> this weapon) 1) + (set! (-> this root nav-radius) 10240.0) ) ((= arg0 3) - (setup-masks (-> obj draw) 16 0) - (set! (-> obj weapon) 3) - (set! (-> obj root nav-radius) 10240.0) + (setup-masks (-> this draw) 16 0) + (set! (-> this weapon) 3) + (set! (-> this root nav-radius) 10240.0) ) ((zero? arg0) - (setup-masks (-> obj draw) 8 0) - (set! (-> obj weapon) 0) - (set! (-> obj root nav-radius) 6144.0) + (setup-masks (-> this draw) 8 0) + (set! (-> this weapon) 0) + (set! (-> this root nav-radius) 6144.0) ) ) (none) @@ -4350,11 +4354,11 @@ ;; definition for method 156 of type crimson-guard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod nav-enemy-method-156 crimson-guard-level ((obj crimson-guard-level)) +(defmethod nav-enemy-method-156 crimson-guard-level ((this crimson-guard-level)) (cond - ((logtest? (-> obj flags) 36) - (let ((v1-3 (-> obj nav state)) - (a0-2 (-> obj root trans)) + ((logtest? (-> this flags) 36) + (let ((v1-3 (-> this nav state)) + (a0-2 (-> this root trans)) ) (logclear! (-> v1-3 flags) (nav-state-flag directional-mode)) (logior! (-> v1-3 flags) (nav-state-flag target-poly-dirty)) @@ -4363,7 +4367,7 @@ 0 ) (else - ((method-of-type nav-enemy nav-enemy-method-156) obj) + ((method-of-type nav-enemy nav-enemy-method-156) this) ) ) (none) @@ -4372,127 +4376,127 @@ ;; definition for method 115 of type crimson-guard-level ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! crimson-guard-level ((obj crimson-guard-level)) +(defmethod init-enemy! crimson-guard-level ((this crimson-guard-level)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 int)) - (let ((f0-0 (res-lump-float (-> obj entity) 'rotoffset))) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-0 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-0) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-0) ) ) (set! sv-16 0) - (let ((v1-6 (res-lump-data (-> obj entity) 'trans-offset vector :tag-ptr (the-as (pointer res-tag) (& sv-16))))) + (let ((v1-6 (res-lump-data (-> this entity) 'trans-offset vector :tag-ptr (the-as (pointer res-tag) (& sv-16))))) (when v1-6 - (+! (-> obj root trans x) (-> v1-6 x)) - (+! (-> obj root trans y) (-> v1-6 y)) - (+! (-> obj root trans z) (-> v1-6 z)) + (+! (-> this root trans x) (-> v1-6 x)) + (+! (-> this root trans y) (-> v1-6 y)) + (+! (-> this root trans z) (-> v1-6 z)) ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard-level" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (let ((a0-13 (-> obj entity))) - (set! (-> obj flags) (the-as int ((method-of-object a0-13 get-property-value) - a0-13 - 'crimson-guard-level-flags - 'interp - -1000000000.0 - (the-as uint128 1) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (let ((a0-13 (-> this entity))) + (set! (-> this flags) (the-as int ((method-of-object a0-13 get-property-value) + a0-13 + 'crimson-guard-level-flags + 'interp + -1000000000.0 + (the-as uint128 1) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) ) - (set! (-> obj info) *crimson-guard-level-global-info*) - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-info*) + (set! (-> this info) *crimson-guard-level-global-info*) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-info*) (cond - ((logtest? (-> obj flags) 1) - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-tazer-info*) + ((logtest? (-> this flags) 1) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-tazer-info*) ) - ((logtest? (-> obj flags) 4) - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-sniper-info*) + ((logtest? (-> this flags) 4) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-sniper-info*) ) - ((logtest? (-> obj flags) 2) - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-blast-info*) + ((logtest? (-> this flags) 2) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-blast-info*) ) - ((logtest? (-> obj flags) 8) - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-grenade-info*) + ((logtest? (-> this flags) 8) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-grenade-info*) ) (else - (init-enemy-behaviour-and-stats! obj *crimson-guard-level-info*) + (init-enemy-behaviour-and-stats! this *crimson-guard-level-info*) ) ) - (let ((v1-34 (-> obj nav))) + (let ((v1-34 (-> this nav))) (set! (-> v1-34 speed-scale) 1.0) ) 0 - (set! (-> obj draw lod-set lod 0 dist) 143360.0) - (set! (-> obj draw lod-set lod 1 dist) 491520.0) - (set! (-> obj joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) obj 4)) - (set! (-> obj l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 13) obj 0.0)) - (set! (-> obj l-control state points-to-draw) 0) - (let ((v1-45 (get-rand-int obj 2))) - (if (logtest? (-> obj flags) 4) + (set! (-> this draw lod-set lod 0 dist) 143360.0) + (set! (-> this draw lod-set lod 1 dist) 491520.0) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 4)) + (set! (-> this l-control) (new 'process 'lightning-control (-> *lightning-spec-id-table* 13) this 0.0)) + (set! (-> this l-control state points-to-draw) 0) + (let ((v1-45 (get-rand-int this 2))) + (if (logtest? (-> this flags) 4) (set! v1-45 0) ) (cond ((zero? v1-45) - (set! (-> obj anim-shoot 0 anim-index) 19) - (set! (-> obj anim-shoot 0 start) 1.0) - (set! (-> obj anim-shoot 0 end) 12.0) - (set! (-> obj anim-shoot 1 anim-index) 26) - (set! (-> obj anim-shoot 1 start) 12.0) - (set! (-> obj anim-shoot 1 end) 22.0) - (set! (-> obj anim-shoot 2 anim-index) 24) - (set! (-> obj anim-shoot 2 start) 20.0) - (set! (-> obj anim-shoot 2 end) 30.0) + (set! (-> this anim-shoot 0 anim-index) 19) + (set! (-> this anim-shoot 0 start) 1.0) + (set! (-> this anim-shoot 0 end) 12.0) + (set! (-> this anim-shoot 1 anim-index) 26) + (set! (-> this anim-shoot 1 start) 12.0) + (set! (-> this anim-shoot 1 end) 22.0) + (set! (-> this anim-shoot 2 anim-index) 24) + (set! (-> this anim-shoot 2 start) 20.0) + (set! (-> this anim-shoot 2 end) 30.0) ) ((= v1-45 1) - (set! (-> obj anim-shoot 0 anim-index) 27) - (set! (-> obj anim-shoot 0 start) 2.0) - (set! (-> obj anim-shoot 0 end) 9.0) - (set! (-> obj anim-shoot 1 anim-index) 29) - (set! (-> obj anim-shoot 1 start) 18.0) - (set! (-> obj anim-shoot 1 end) 26.0) - (set! (-> obj anim-shoot 2 anim-index) 30) - (set! (-> obj anim-shoot 2 start) 26.0) - (set! (-> obj anim-shoot 2 end) 35.0) + (set! (-> this anim-shoot 0 anim-index) 27) + (set! (-> this anim-shoot 0 start) 2.0) + (set! (-> this anim-shoot 0 end) 9.0) + (set! (-> this anim-shoot 1 anim-index) 29) + (set! (-> this anim-shoot 1 start) 18.0) + (set! (-> this anim-shoot 1 end) 26.0) + (set! (-> this anim-shoot 2 anim-index) 30) + (set! (-> this anim-shoot 2 start) 26.0) + (set! (-> this anim-shoot 2 end) 35.0) ) ) ) - (setup-masks (-> obj draw) 0 -1) + (setup-masks (-> this draw) 0 -1) (cond - ((logtest? (-> obj flags) 1) - (crimson-guard-level-method-203 obj 1) + ((logtest? (-> this flags) 1) + (crimson-guard-level-method-203 this 1) ) - ((logtest? (-> obj flags) 2) - (set! (-> obj fact trig-dist) 409600.0) - (crimson-guard-level-method-203 obj 0) + ((logtest? (-> this flags) 2) + (set! (-> this fact trig-dist) 409600.0) + (crimson-guard-level-method-203 this 0) ) - ((logtest? (-> obj flags) 4) - (crimson-guard-level-method-203 obj 0) + ((logtest? (-> this flags) 4) + (crimson-guard-level-method-203 this 0) ) - ((logtest? (-> obj flags) 8) - (set! (-> obj fact trig-dist) 819200.0) - (crimson-guard-level-method-203 obj 3) + ((logtest? (-> this flags) 8) + (set! (-> this fact trig-dist) 819200.0) + (crimson-guard-level-method-203 this 3) ) - ((logtest? (-> obj flags) 16) - (crimson-guard-level-method-203 obj 0) + ((logtest? (-> this flags) 16) + (crimson-guard-level-method-203 this 0) ) ) (cond - ((logtest? (-> obj flags) 128) - (setup-masks (-> obj draw) 5 0) - (set-vector! (-> obj root scale) 1.1 1.1 1.1 1.0) - (set! (-> obj hit-points) (* (-> obj hit-points) 2)) - (set-vector! (-> obj joint scale) 1.1 1.0 1.1 1.0) - (let* ((a0-45 (-> obj neck)) + ((logtest? (-> this flags) 128) + (setup-masks (-> this draw) 5 0) + (set-vector! (-> this root scale) 1.1 1.1 1.1 1.0) + (set! (-> this hit-points) (* (-> this hit-points) 2)) + (set-vector! (-> this joint scale) 1.1 1.0 1.1 1.0) + (let* ((a0-45 (-> this neck)) (t9-22 (method-of-object a0-45 trs-set!)) (a1-22 #f) (a2-10 #f) @@ -4504,23 +4508,23 @@ (set! (-> a3-5 w) 1.0) (t9-22 a0-45 (the-as vector a1-22) (the-as quaternion a2-10) a3-5) ) - (mode-set! (-> obj neck) (joint-mod-mode rotate2)) - (set! (-> obj joint parented-scale?) #t) - (set! (-> obj neck parented-scale?) #t) + (mode-set! (-> this neck) (joint-mod-mode rotate2)) + (set! (-> this joint parented-scale?) #t) + (set! (-> this neck parented-scale?) #t) ) (else - (setup-masks (-> obj draw) 3 0) + (setup-masks (-> this draw) 3 0) ) ) - (set! (-> obj hit-face) (the-as uint -1)) - (set! (-> obj anim-get-up-front) 33) - (set! (-> obj anim-get-up-back) 34) - (set! (-> obj joint-enable) #f) - (set! (-> obj fact pickup-type) (pickup-type ammo-random)) - (set! (-> obj fact pickup-amount) 10.0) - (set! (-> obj fact pickup-spawn-amount) 1.0) - (set! (-> obj trigger) #f) - (set! (-> obj root pause-adjust-distance) 409600.0) + (set! (-> this hit-face) (the-as uint -1)) + (set! (-> this anim-get-up-front) 33) + (set! (-> this anim-get-up-back) 34) + (set! (-> this joint-enable) #f) + (set! (-> this fact pickup-type) (pickup-type ammo-random)) + (set! (-> this fact pickup-amount) 10.0) + (set! (-> this fact pickup-spawn-amount) 1.0) + (set! (-> this trigger) #f) + (set! (-> this root pause-adjust-distance) 409600.0) (transform-post) 0 (none) @@ -4542,21 +4546,21 @@ ) ;; definition for method 3 of type crimson-guard-level-params -(defmethod inspect crimson-guard-level-params ((obj crimson-guard-level-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect crimson-guard-level-params ((this crimson-guard-level-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'crimson-guard-level-params) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Tnav-mesh: ~A~%" (-> obj nav-mesh)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Ttransport-side: ~D~%" (-> obj transport-side)) - (format #t "~1Tweapon: ~D~%" (-> obj weapon)) - (format #t "~1Tproc: ~A~%" (-> obj proc)) + (format #t "[~8x] ~A~%" this 'crimson-guard-level-params) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Ttransport-side: ~D~%" (-> this transport-side)) + (format #t "~1Tweapon: ~D~%" (-> this weapon)) + (format #t "~1Tproc: ~A~%" (-> this proc)) (label cfg-4) - obj + this ) ;; definition for function crimson-guard-level-init-by-other diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc index acf038072a..87bfd5e7e6 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type gconv-speech -(defmethod inspect gconv-speech ((obj gconv-speech)) - (when (not obj) - (set! obj obj) +(defmethod inspect gconv-speech ((this gconv-speech)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tname0: ~A~%" (-> obj name0)) - (format #t "~1Tname1: ~A~%" (-> obj name1)) - (format #t "~1Thold-time: ~D~%" (-> obj hold-time)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tname0: ~A~%" (-> this name0)) + (format #t "~1Tname1: ~A~%" (-> this name1)) + (format #t "~1Thold-time: ~D~%" (-> this hold-time)) (label cfg-4) - obj + this ) ;; definition of type gconv-dialogue @@ -36,15 +36,15 @@ ) ;; definition for method 3 of type gconv-dialogue -(defmethod inspect gconv-dialogue ((obj gconv-dialogue)) - (when (not obj) - (set! obj obj) +(defmethod inspect gconv-dialogue ((this gconv-dialogue)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tspeeches: ~A~%" (-> obj speeches)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tspeeches: ~A~%" (-> this speeches)) (label cfg-4) - obj + this ) ;; definition of type gconv-dialogues @@ -57,15 +57,15 @@ ) ;; definition for method 3 of type gconv-dialogues -(defmethod inspect gconv-dialogues ((obj gconv-dialogues)) - (when (not obj) - (set! obj obj) +(defmethod inspect gconv-dialogues ((this gconv-dialogues)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tdialogues: ~A~%" (-> obj dialogues)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tdialogues: ~A~%" (-> this dialogues)) (label cfg-4) - obj + this ) ;; definition for symbol *gconv-dialogues*, type gconv-dialogues @@ -235,34 +235,34 @@ ) ;; definition for method 3 of type guard-conversation -(defmethod inspect guard-conversation ((obj guard-conversation)) - (when (not obj) - (set! obj obj) +(defmethod inspect guard-conversation ((this guard-conversation)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttriggered?: ~A~%" (-> obj triggered?)) - (format #t "~2Tactor-group: ~A~%" (-> obj actor-group)) - (format #t "~2Tactor-count: ~D~%" (-> obj actor-count)) - (format #t "~2Tremaining: ~D~%" (-> obj remaining)) - (format #t "~2Tskip-mask: ~D~%" (-> obj skip-mask)) - (format #t "~2Tlast-playing-time: ~D~%" (-> obj last-playing-time)) + (format #t "~2Ttriggered?: ~A~%" (-> this triggered?)) + (format #t "~2Tactor-group: ~A~%" (-> this actor-group)) + (format #t "~2Tactor-count: ~D~%" (-> this actor-count)) + (format #t "~2Tremaining: ~D~%" (-> this remaining)) + (format #t "~2Tskip-mask: ~D~%" (-> this skip-mask)) + (format #t "~2Tlast-playing-time: ~D~%" (-> this last-playing-time)) (label cfg-4) - obj + this ) ;; definition for method 24 of type guard-conversation -(defmethod guard-conversation-method-24 guard-conversation ((obj guard-conversation)) - (let ((v1-0 (-> obj remaining))) +(defmethod guard-conversation-method-24 guard-conversation ((this guard-conversation)) + (let ((v1-0 (-> this remaining))) (when (> v1-0 0) - (set! (-> obj remaining) (+ v1-0 -1)) - (let* ((s3-0 (rand-vu-int-count-excluding 32 (the-as int (-> obj skip-mask)))) + (set! (-> this remaining) (+ v1-0 -1)) + (let* ((s3-0 (rand-vu-int-count-excluding 32 (the-as int (-> this skip-mask)))) (s5-0 (-> *gconv-dialogues* dialogues s3-0 speeches)) (s4-1 (zero? (rand-vu-int-count 2))) ) - (logior! (-> obj skip-mask) (ash 1 s3-0)) + (logior! (-> this skip-mask) (ash 1 s3-0)) (dotimes (s3-1 (-> s5-0 length)) (let* ((v1-9 (-> s5-0 s3-1)) (t0-0 (if s4-1 @@ -273,7 +273,7 @@ ) (add-process *gui-control* - obj + this (gui-channel guard) (gui-action play) (the-as string t0-0) @@ -353,9 +353,9 @@ (lookup-gui-connection-id *gui-control* (the-as string #f) (gui-channel guard) (gui-action none)) ) ) - (set! (-> self last-playing-time) (current-time)) + (set-time! (-> self last-playing-time)) ) - (if (and (-> self triggered?) (>= (- (current-time) (-> self last-playing-time)) (seconds 6))) + (if (and (-> self triggered?) (time-elapsed? (-> self last-playing-time) (seconds 6))) (guard-conversation-method-24 self) ) ) @@ -423,7 +423,7 @@ ;; definition for method 11 of type guard-conversation ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! guard-conversation ((obj guard-conversation) (arg0 entity-actor)) +(defmethod init-from-entity! guard-conversation ((this guard-conversation) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -431,10 +431,10 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj triggered?) #f) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (let ((v1-2 (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0))) + (set! (-> this triggered?) #f) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (let ((v1-2 (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0))) (let ((a1-4 (-> *gconv-dialogues* dialogues length)) (a0-6 0) ) @@ -446,21 +446,21 @@ This commonly includes things such as: ) ) ) - (set! (-> obj remaining) a0-6) + (set! (-> this remaining) a0-6) ) - (set! (-> obj skip-mask) (the-as uint (lognot v1-2))) + (set! (-> this skip-mask) (the-as uint (lognot v1-2))) ) - (let ((s5-1 (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))))) + (let ((s5-1 (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))))) (set! sv-16 (new 'static 'res-tag)) - (let ((s4-0 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((s4-0 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (if (or (not s4-0) (zero? (-> sv-16 elt-count))) (go process-drawable-art-error "missing actors") ) (let* ((s4-1 (-> s4-0 0)) (s3-0 (-> s4-1 length)) ) - (set! (-> obj actor-group) s4-1) - (set! (-> obj actor-count) s3-0) + (set! (-> this actor-group) s4-1) + (set! (-> this actor-count) s3-0) (if (!= s3-0 2) (go process-drawable-art-error "bad actor count") ) @@ -490,8 +490,8 @@ This commonly includes things such as: ) ) (if s5-1 - (go (method-of-object obj die)) - (go (method-of-object obj dormant)) + (go (method-of-object this die)) + (go (method-of-object this dormant)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc index 28d415deb0..8f0d5bc9b4 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/transport-level_REF.gc @@ -34,29 +34,29 @@ ) ;; definition for method 3 of type transport-level -(defmethod inspect transport-level ((obj transport-level)) - (when (not obj) - (set! obj obj) +(defmethod inspect transport-level ((this transport-level)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ty-dest: ~f~%" (-> obj y-dest)) - (format #t "~2Tlast-guard-spawn-time: ~D~%" (-> obj last-guard-spawn-time)) - (format #t "~2Tnav-mesh: ~A~%" (-> obj nav-mesh)) - (format #t "~2Tspawn-side: ~D~%" (-> obj spawn-side)) - (format #t "~2Tspawn?: ~A~%" (-> obj spawn?)) - (format #t "~2Tleave-time: ~D~%" (-> obj leave-time)) - (format #t "~2Tmax-guard: ~D~%" (-> obj max-guard)) - (format #t "~2Tcount-guard: ~D~%" (-> obj count-guard)) - (format #t "~2Tmax-time: ~f~%" (-> obj max-time)) - (format #t "~2Tspawn-time: ~D~%" (-> obj spawn-time)) - (format #t "~2Tambient-sound-id: ~D~%" (-> obj ambient-sound-id)) - (format #t "~2Tnum-wanted-guards: ~D~%" (-> obj num-wanted-guards)) - (format #t "~2Tguards[8] @ #x~X~%" (-> obj guards)) + (format #t "~2Ty-dest: ~f~%" (-> this y-dest)) + (format #t "~2Tlast-guard-spawn-time: ~D~%" (-> this last-guard-spawn-time)) + (format #t "~2Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~2Tspawn-side: ~D~%" (-> this spawn-side)) + (format #t "~2Tspawn?: ~A~%" (-> this spawn?)) + (format #t "~2Tleave-time: ~D~%" (-> this leave-time)) + (format #t "~2Tmax-guard: ~D~%" (-> this max-guard)) + (format #t "~2Tcount-guard: ~D~%" (-> this count-guard)) + (format #t "~2Tmax-time: ~f~%" (-> this max-time)) + (format #t "~2Tspawn-time: ~D~%" (-> this spawn-time)) + (format #t "~2Tambient-sound-id: ~D~%" (-> this ambient-sound-id)) + (format #t "~2Tnum-wanted-guards: ~D~%" (-> this num-wanted-guards)) + (format #t "~2Tguards[8] @ #x~X~%" (-> this guards)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -114,14 +114,14 @@ ;; definition for method 34 of type transport-level ;; WARN: Return type mismatch int vs none. -(defmethod transport-level-method-34 transport-level ((obj transport-level)) - (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> obj root transv y)) 0.0 122880.0)) - (f0-4 (lerp-scale 0.0 1.0 (- (-> obj root trans y) (-> obj y-dest)) 143360.0 20480.0)) +(defmethod transport-level-method-34 transport-level ((this transport-level)) + (let ((f30-0 (lerp-scale 0.0 2.0 (fabs (-> this root transv y)) 0.0 122880.0)) + (f0-4 (lerp-scale 0.0 1.0 (- (-> this root trans y) (-> this y-dest)) 143360.0 20480.0)) (a0-3 (static-sound-spec "transport" :volume 0.0 :mask (pitch reg0))) ) (set! (-> a0-3 volume) (the int (* 1024.0 f0-4))) (set! (-> a0-3 pitch-mod) (the int (* 1524.0 f30-0))) - (sound-play-by-spec a0-3 (-> obj ambient-sound-id) (-> obj root trans)) + (sound-play-by-spec a0-3 (-> this ambient-sound-id) (-> this root trans)) ) 0 (none) @@ -132,8 +132,8 @@ :virtual #t :event transport-level-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) - (set! (-> self last-guard-spawn-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-guard-spawn-time)) ) :code (behavior () (ja-channel-push! 1 0) @@ -161,7 +161,7 @@ :virtual #t :event transport-level-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root transv y) 0.0) (set! (-> self last-guard-spawn-time) 0) 0 @@ -231,7 +231,7 @@ :virtual #t :event transport-level-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root transv y) 0.0) ) :code (behavior () @@ -261,41 +261,41 @@ ;; definition for method 33 of type transport-level ;; INFO: Used lq/sq -(defmethod transport-level-method-33 transport-level ((obj transport-level)) +(defmethod transport-level-method-33 transport-level ((this transport-level)) (let ((v1-0 0)) (dotimes (a0-1 8) - (if (handle->process (-> obj guards a0-1)) + (if (handle->process (-> this guards a0-1)) (+! v1-0 1) ) ) - (when (zero? (-> obj count-guard)) - (set! (-> obj last-guard-spawn-time) 0) + (when (zero? (-> this count-guard)) + (set! (-> this last-guard-spawn-time) 0) 0 ) - (when (and (>= (- (current-time) (-> obj last-guard-spawn-time)) (-> obj spawn-time)) - (< v1-0 (the-as int (-> obj num-wanted-guards))) + (when (and (time-elapsed? (-> this last-guard-spawn-time) (-> this spawn-time)) + (< v1-0 (the-as int (-> this num-wanted-guards))) ) (let ((s5-0 (new 'stack-no-clear 'crimson-guard-level-params))) - (set! (-> s5-0 transport-side) (-> obj spawn-side)) - (set! (-> s5-0 nav-mesh) (-> obj nav-mesh)) - (set! (-> s5-0 pos quad) (-> obj root trans quad)) + (set! (-> s5-0 transport-side) (-> this spawn-side)) + (set! (-> s5-0 nav-mesh) (-> this nav-mesh)) + (set! (-> s5-0 pos quad) (-> this root trans quad)) (+! (-> s5-0 pos y) 8192.0) - (quaternion-rotate-local-y! (-> s5-0 quat) (-> obj root quat) 32768.0) - (set! (-> s5-0 handle) (the-as uint (process->handle obj))) + (quaternion-rotate-local-y! (-> s5-0 quat) (-> this root quat) 32768.0) + (set! (-> s5-0 handle) (the-as uint (process->handle this))) (set! (-> s5-0 weapon) 1) - (dotimes (s4-0 (the-as int (-> obj num-wanted-guards))) - (when (not (handle->process (-> obj guards s4-0))) - (set! (-> obj guards s4-0) (ppointer->handle (process-spawn crimson-guard-level s5-0 :to obj))) + (dotimes (s4-0 (the-as int (-> this num-wanted-guards))) + (when (not (handle->process (-> this guards s4-0))) + (set! (-> this guards s4-0) (ppointer->handle (process-spawn crimson-guard-level s5-0 :to this))) #t (goto cfg-38) ) ) (label cfg-38) (when (-> s5-0 proc) - (set! (-> obj spawn-side) (- 1 (the-as int (-> obj spawn-side)))) - (set! (-> obj last-guard-spawn-time) (current-time)) - (let ((v0-0 (+ (-> obj count-guard) 1))) - (set! (-> obj count-guard) v0-0) + (set! (-> this spawn-side) (- 1 (the-as int (-> this spawn-side)))) + (set-time! (-> this last-guard-spawn-time)) + (let ((v0-0 (+ (-> this count-guard) 1))) + (set! (-> this count-guard) v0-0) v0-0 ) ) @@ -306,8 +306,8 @@ ;; definition for method 31 of type transport-level ;; WARN: Return type mismatch int vs none. -(defmethod transport-level-method-31 transport-level ((obj transport-level)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod transport-level-method-31 transport-level ((this transport-level)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -341,7 +341,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -349,41 +349,41 @@ ;; definition for method 32 of type transport-level ;; WARN: Return type mismatch int vs none. -(defmethod transport-level-method-32 transport-level ((obj transport-level)) - (set! (-> obj spawn-side) (the-as uint 0)) +(defmethod transport-level-method-32 transport-level ((this transport-level)) + (set! (-> this spawn-side) (the-as uint 0)) 0 (none) ) ;; definition for method 11 of type transport-level ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! transport-level ((obj transport-level) (arg0 entity-actor)) +(defmethod init-from-entity! transport-level ((this transport-level) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (transport-level-method-31 obj) - (process-drawable-from-entity! obj arg0) + (transport-level-method-31 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-transport-level" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (transport-level-method-32 obj) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj spawn?) #t) - (set! (-> obj nav-mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) - (set! (-> obj num-wanted-guards) (the-as uint 4)) + (transport-level-method-32 this) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this spawn?) #t) + (set! (-> this nav-mesh) (nav-mesh-from-res-tag arg0 'nav-mesh-actor 0)) + (set! (-> this num-wanted-guards) (the-as uint 4)) (dotimes (v1-11 8) - (set! (-> obj guards v1-11) (the-as handle #f)) + (set! (-> this guards v1-11) (the-as handle #f)) ) - (set! (-> obj spawn-time) (seconds 4)) - (+! (-> obj root trans y) 40960.0) - (set! (-> obj y-dest) (-> obj root trans y)) - (+! (-> obj root trans y) 163840.0) - (go (method-of-object obj come-down)) + (set! (-> this spawn-time) (seconds 4)) + (+! (-> this root trans y) 40960.0) + (set! (-> this y-dest) (-> this root trans y)) + (+! (-> this root trans y) 163840.0) + (go (method-of-object this come-down)) (none) ) 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 dc63017099..7fc8ef454d 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hopper_REF.gc @@ -34,35 +34,35 @@ ) ;; definition for method 3 of type hopper -(defmethod inspect hopper ((obj hopper)) - (when (not obj) - (set! obj obj) +(defmethod inspect hopper ((this hopper)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspeed-y: ~f~%" (-> obj speed-y)) - (format #t "~2Taccel-y: ~f~%" (-> obj accel-y)) - (format #t "~2Tnext-jump-time: ~D~%" (-> obj next-jump-time)) - (format #t "~2Tpath-intro: ~A~%" (-> obj path-intro)) - (format #t "~2Tcan-go-knocked?: ~A~%" (-> obj can-go-knocked?)) - (format #t "~2Tland-anim-index: ~D~%" (-> obj land-anim-index)) - (format #t "~2Tstep-num: ~D~%" (-> obj step-num)) - (format #t "~2Tbest-point: #~%" (-> obj best-point)) - (format #t "~2Tbest-score: ~f~%" (-> obj best-score)) - (format #t "~2Torigin: #~%" (-> obj origin)) - (format #t "~2Tdirection: #~%" (-> obj direction)) - (format #t "~2Tjump-dist: ~f~%" (-> obj jump-dist)) - (format #t "~2Tside: ~f~%" (-> obj side)) - (format #t "~2Tjump-start-anim: ~D~%" (-> obj jump-start-anim)) - (format #t "~2Tjump-air-anim: ~D~%" (-> obj jump-air-anim)) - (format #t "~2Tjump-land-anim: ~D~%" (-> obj jump-land-anim)) - (format #t "~2Tjump-height-min: ~f~%" (-> obj jump-height-min)) - (format #t "~2Tjump-anim-start-frame: ~f~%" (-> obj jump-anim-start-frame)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) + (format #t "~2Tspeed-y: ~f~%" (-> this speed-y)) + (format #t "~2Taccel-y: ~f~%" (-> this accel-y)) + (format #t "~2Tnext-jump-time: ~D~%" (-> this next-jump-time)) + (format #t "~2Tpath-intro: ~A~%" (-> this path-intro)) + (format #t "~2Tcan-go-knocked?: ~A~%" (-> this can-go-knocked?)) + (format #t "~2Tland-anim-index: ~D~%" (-> this land-anim-index)) + (format #t "~2Tstep-num: ~D~%" (-> this step-num)) + (format #t "~2Tbest-point: #~%" (-> this best-point)) + (format #t "~2Tbest-score: ~f~%" (-> this best-score)) + (format #t "~2Torigin: #~%" (-> this origin)) + (format #t "~2Tdirection: #~%" (-> this direction)) + (format #t "~2Tjump-dist: ~f~%" (-> this jump-dist)) + (format #t "~2Tside: ~f~%" (-> this side)) + (format #t "~2Tjump-start-anim: ~D~%" (-> this jump-start-anim)) + (format #t "~2Tjump-air-anim: ~D~%" (-> this jump-air-anim)) + (format #t "~2Tjump-land-anim: ~D~%" (-> this jump-land-anim)) + (format #t "~2Tjump-height-min: ~f~%" (-> this jump-height-min)) + (format #t "~2Tjump-anim-start-frame: ~f~%" (-> this jump-anim-start-frame)) + (format #t "~2Tminimap: #~%" (-> this minimap)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -84,16 +84,16 @@ ) ;; definition for method 3 of type hopper-anim-info -(defmethod inspect hopper-anim-info ((obj hopper-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect hopper-anim-info ((this hopper-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hopper-anim-info) - (format #t "~1Thit-anim-index: ~D~%" (-> obj hit-anim-index)) - (format #t "~1Tland-anim-index: ~D~%" (-> obj land-anim-index)) + (format #t "[~8x] ~A~%" this 'hopper-anim-info) + (format #t "~1Thit-anim-index: ~D~%" (-> this hit-anim-index)) + (format #t "~1Tland-anim-index: ~D~%" (-> this land-anim-index)) (label cfg-4) - obj + this ) ;; definition of type hopper-global-info @@ -109,18 +109,18 @@ ) ;; definition for method 3 of type hopper-global-info -(defmethod inspect hopper-global-info ((obj hopper-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect hopper-global-info ((this hopper-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-yellow-hit: ~D~%" (-> obj prev-yellow-hit)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tyellow-hit-anim[3] @ #x~X~%" (-> obj yellow-hit-anim)) - (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tyellow-hit-anim[3] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) (label cfg-4) - obj + this ) ;; definition for symbol *hopper-global-info*, type hopper-global-info @@ -139,15 +139,15 @@ ) ;; definition for method 77 of type hopper -(defmethod enemy-method-77 hopper ((obj hopper) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 hopper ((this hopper) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (let* ((a2-0 (ash 1 (-> *hopper-global-info* prev-blue-hit))) - (v1-3 (enemy-method-120 obj 3 a2-0)) - (a1-5 (-> obj draw art-group data (-> *hopper-global-info* blue-hit-anim v1-3 hit-anim-index))) + (v1-3 (enemy-method-120 this 3 a2-0)) + (a1-5 (-> this draw art-group data (-> *hopper-global-info* blue-hit-anim v1-3 hit-anim-index))) ) (set! (-> *hopper-global-info* prev-blue-hit) v1-3) - (let ((a0-12 (-> obj skel root-channel 0))) + (let ((a0-12 (-> this skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim a1-5)) (set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim a1-5) frames num-frames) -1))) (set! (-> a0-12 param 1) 1.0) @@ -159,12 +159,12 @@ (else (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-2 (ash 1 (-> *hopper-global-info* prev-yellow-hit))) - (v1-13 (enemy-method-120 obj 3 a2-2)) - (a1-11 (-> obj draw art-group data (-> *hopper-global-info* yellow-hit-anim v1-13 hit-anim-index))) + (v1-13 (enemy-method-120 this 3 a2-2)) + (a1-11 (-> this draw art-group data (-> *hopper-global-info* yellow-hit-anim v1-13 hit-anim-index))) ) - (set! (-> obj land-anim-index) (-> *hopper-global-info* yellow-hit-anim v1-13 land-anim-index)) + (set! (-> this land-anim-index) (-> *hopper-global-info* yellow-hit-anim v1-13 land-anim-index)) (set! (-> *hopper-global-info* prev-yellow-hit) v1-13) - (let ((a0-27 (-> obj skel root-channel 0))) + (let ((a0-27 (-> this skel root-channel 0))) (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-11)) (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-11) frames num-frames) -1))) (set! (-> a0-27 param 1) (-> arg0 0)) @@ -178,13 +178,13 @@ ) ;; definition for method 78 of type hopper -(defmethod enemy-method-78 hopper ((obj hopper) (arg0 (pointer float))) +(defmethod enemy-method-78 hopper ((this hopper) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((s4-0 (-> obj draw art-group data 24))) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 24))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-3 param 1) (-> arg0 0)) @@ -198,18 +198,18 @@ ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data (-> obj land-anim-index)))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index)))) (set! (-> a0-5 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj land-anim-index))) frames num-frames) -1) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index))) frames num-frames) -1) ) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) (joint-control-channel-group! a0-5 - (the-as art-joint-anim (-> obj draw art-group data (-> obj land-anim-index))) + (the-as art-joint-anim (-> this draw art-group data (-> this land-anim-index))) num-func-seek! ) ) @@ -404,41 +404,41 @@ (set! (-> *hopper-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 73 of type hopper -(defmethod kill-prefer-falling hopper ((obj hopper)) +(defmethod kill-prefer-falling hopper ((this hopper)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond - ((-> obj can-go-knocked?) - (set! (-> obj can-go-knocked?) #f) - (go (method-of-object obj knocked)) + ((-> this can-go-knocked?) + (set! (-> this can-go-knocked?) #f) + (go (method-of-object this knocked)) ) (else - ((method-of-type nav-enemy kill-prefer-falling) obj) + ((method-of-type nav-enemy kill-prefer-falling) this) ) ) ) ;; definition for method 90 of type hopper ;; INFO: Used lq/sq -(defmethod enemy-method-90 hopper ((obj hopper) (arg0 int) (arg1 enemy-jump-info)) - (when (= (-> obj jump-why) 2) +(defmethod enemy-method-90 hopper ((this hopper) (arg0 int) (arg1 enemy-jump-info)) + (when (= (-> this jump-why) 2) (cond ((zero? arg0) - (logior! (-> obj focus-status) (focus-status touch-water under-water)) + (logior! (-> this focus-status) (focus-status touch-water under-water)) ) (else - (when (focus-test? obj touch-water) + (when (focus-test? this touch-water) (let ((s3-0 (new 'stack-no-clear 'water-info))) - (water-info-init! (-> obj root) s3-0 (collide-action solid semi-solid)) + (water-info-init! (-> this root) s3-0 (collide-action solid semi-solid)) (let ((v1-9 #f)) (cond ((not (logtest? (water-flags touch-water) (-> s3-0 flags))) - (if (focus-test? obj under-water) + (if (focus-test? this under-water) (set! v1-9 #t) ) - (logclear! (-> obj focus-status) (focus-status touch-water under-water)) + (logclear! (-> this focus-status) (focus-status touch-water under-water)) ) - ((focus-test? obj under-water) - (let ((f0-1 (+ 11264.0 (-> obj root trans y)))) + ((focus-test? this under-water) + (let ((f0-1 (+ 11264.0 (-> this root trans y)))) (if (< (-> s3-0 trans y) f0-1) (set! v1-9 #t) ) @@ -446,9 +446,9 @@ ) ) (when v1-9 - (logclear! (-> obj focus-status) (focus-status under-water)) + (logclear! (-> this focus-status) (focus-status under-water)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> obj root trans quad)) + (set! (-> s2-0 quad) (-> this root trans quad)) (when (logtest? (water-flags touch-water) (-> s3-0 flags)) (set! (-> s2-0 y) (-> s3-0 trans y)) (let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000))) @@ -496,14 +496,14 @@ ) ) ) - ((method-of-type nav-enemy enemy-method-90) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-90) this arg0 arg1) ) ;; definition for method 89 of type hopper -(defmethod enemy-method-89 hopper ((obj hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 hopper ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump-start-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump-start-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -515,10 +515,10 @@ ) ;; definition for method 87 of type hopper -(defmethod enemy-method-87 hopper ((obj hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 hopper ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump-air-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump-air-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -530,10 +530,10 @@ ) ;; definition for method 88 of type hopper -(defmethod enemy-method-88 hopper ((obj hopper) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 hopper ((this hopper) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.075)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -590,7 +590,7 @@ ;; definition for method 178 of type hopper ;; INFO: Used lq/sq -(defmethod hopper-method-178 hopper ((obj hopper)) +(defmethod hopper-method-178 hopper ((this hopper)) (local-vars (sv-752 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -600,17 +600,21 @@ (vf7 :class vf) ) (init-vf0-vector) - (+! (-> obj step-num) -1) + (+! (-> this step-num) -1) (cond - ((>= (-> obj step-num) 0) + ((>= (-> this step-num) 0) (let ((s3-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (vector-rotate-around-y! s3-0 (-> obj direction) (* 182.04445 (the float (+ (* (-> obj step-num) 16) -135)))) + (vector-rotate-around-y! + s3-0 + (-> this direction) + (* 182.04445 (the float (+ (* (-> this step-num) 16) -135))) + ) (let ((a1-1 s5-0)) - (let ((v1-7 (-> obj origin))) + (let ((v1-7 (-> this origin))) (let ((a0-2 s3-0)) - (let ((a2-1 (-> obj jump-dist))) + (let ((a2-1 (-> this jump-dist))) (.mov vf7 a2-1) ) (.lvf vf5 (&-> a0-2 quad)) @@ -622,7 +626,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a1-1 quad) vf6) ) - (let ((v1-8 (-> obj nav)) + (let ((v1-8 (-> this nav)) (a0-3 s5-0) (a1-2 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -631,18 +635,18 @@ (set! (-> a1-2 ignore) (the-as uint 2)) (let ((s4-0 (find-poly-containing-point-local (-> v1-8 state mesh) a1-2))) (when s4-0 - (let ((f30-0 (vector-dot s3-0 (-> obj direction)))) + (let ((f30-0 (vector-dot s3-0 (-> this direction)))) (new 'stack-no-clear 'vector) (let ((a1-3 (new 'stack-no-clear 'vector))) (set! (-> a1-3 quad) (-> s5-0 quad)) (set! (-> a1-3 w) 6144.0) - (when (not (add-root-sphere-to-hash! (-> obj nav) a1-3 #x8006c)) - (when (< (-> obj best-score) f30-0) - (set! (-> obj best-score) f30-0) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-3 #x8006c)) + (when (< (-> this best-score) f30-0) + (set! (-> this best-score) f30-0) (let ((s2-0 (new 'stack-no-clear 'vector))) (set! sv-752 (new 'stack-no-clear 'vector)) (let ((s3-1 (new 'stack 'collide-query))) - (let ((s0-0 (-> obj nav)) + (let ((s0-0 (-> this nav)) (s1-0 s2-0) ) (let* ((v1-21 s5-0) @@ -657,12 +661,12 @@ ) 0 (set! (-> s5-0 y) (-> s2-0 y)) - (if (enemy-above-ground? obj s3-1 s5-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s3-1 s5-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s5-0 y) (-> s3-1 best-other-tri intersect y)) ) ) ) - (set! (-> obj best-point quad) (-> s5-0 quad)) + (set! (-> this best-point quad) (-> s5-0 quad)) ) ) ) @@ -854,33 +858,33 @@ ) ;; definition for method 132 of type hopper -(defmethod dispose! hopper ((obj hopper)) +(defmethod dispose! hopper ((this hopper)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (-> obj minimap) - (logior! (-> obj minimap flags) (minimap-flag fade-out)) - (set! (-> obj minimap) #f) + (when (-> this minimap) + (logior! (-> this minimap flags) (minimap-flag fade-out)) + (set! (-> this minimap) #f) ) - ((the-as (function enemy none) (find-parent-method hopper 132)) obj) + ((the-as (function enemy none) (find-parent-method hopper 132)) this) (none) ) ;; definition for method 7 of type hopper ;; WARN: Return type mismatch process-focusable vs hopper. -(defmethod relocate hopper ((obj hopper) (arg0 int)) - (if (nonzero? (-> obj path-intro)) - (&+! (-> obj path-intro) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method hopper 7)) this arg0) ) ) ;; definition for method 114 of type hopper ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! hopper ((obj hopper)) +(defmethod init-enemy-collision! hopper ((this hopper)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -936,7 +940,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -944,50 +948,64 @@ ;; definition for method 115 of type hopper ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! hopper ((obj hopper)) +(defmethod init-enemy! hopper ((this hopper)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hopper" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *hopper-nav-enemy-info*) - (set! (-> obj can-go-knocked?) #t) - (let ((v1-9 (-> obj neck))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *hopper-nav-enemy-info*) + (set! (-> this can-go-knocked?) #t) + (let ((v1-9 (-> this neck))) (set! (-> v1-9 up) (the-as uint 1)) (set! (-> v1-9 nose) (the-as uint 2)) (set! (-> v1-9 ear) (the-as uint 0)) (set-vector! (-> v1-9 twist-max) 10922.667 12743.111 0.0 1.0) (set! (-> v1-9 ignore-angle) 18204.445) ) - (set! (-> obj jump-start-anim) (the-as uint 10)) - (set! (-> obj jump-air-anim) (the-as uint 13)) - (set! (-> obj jump-land-anim) (the-as uint 14)) - (set! (-> obj jump-height-min) 12288.0) - (set! (-> obj jump-anim-start-frame) 8.0) - (set! (-> obj land-anim-index) 26) - (set! (-> obj side) (get-rand-float-range obj -1.5 1.5)) - (when (logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (set! (-> obj path-intro) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (if (-> obj path-intro) - (logior! (-> obj path-intro flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this jump-start-anim) (the-as uint 10)) + (set! (-> this jump-air-anim) (the-as uint 13)) + (set! (-> this jump-land-anim) (the-as uint 14)) + (set! (-> this jump-height-min) 12288.0) + (set! (-> this jump-anim-start-frame) 8.0) + (set! (-> this land-anim-index) 26) + (set! (-> this side) (get-rand-float-range this -1.5 1.5)) + (when (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (set! (-> this path-intro) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (if (-> this path-intro) + (logior! (-> this path-intro flags) (path-control-flag display draw-line draw-point draw-text)) ) ) - (add-connection *part-engine* obj 5 obj 318 (new 'static 'vector :x 1392.64 :y 491.52 :z 1638.4 :w 163840.0)) - (add-connection *part-engine* obj 5 obj 318 (new 'static 'vector :x -1392.64 :y 491.52 :z 1638.4 :w 163840.0)) - (logior! (-> obj nav flags) (nav-control-flag output-sphere-hash)) - (let ((v1-34 (-> obj nav))) + (add-connection + *part-engine* + this + 5 + this + 318 + (new 'static 'vector :x 1392.64 :y 491.52 :z 1638.4 :w 163840.0) + ) + (add-connection + *part-engine* + this + 5 + this + 318 + (new 'static 'vector :x -1392.64 :y 491.52 :z 1638.4 :w 163840.0) + ) + (logior! (-> this nav flags) (nav-control-flag output-sphere-hash)) + (let ((v1-34 (-> this nav))) (set! (-> v1-34 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 327680.0) - (let ((v1-39 (-> obj nav))) + (set-gravity-length (-> this root dynam) 327680.0) + (let ((v1-39 (-> this nav))) (set! (-> v1-39 nav-cull-radius) 61440.0) ) 0 - (set! (-> obj minimap) (add-icon! *minimap* obj (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) + (set! (-> this minimap) (add-icon! *minimap* this (the-as uint 70) (the-as int #f) (the-as vector #t) 0)) 0 (none) ) 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 902e9de24d..7376f7a35e 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 @@ -450,26 +450,26 @@ ) ;; definition for method 3 of type crimson-guard-hover-shot -(defmethod inspect crimson-guard-hover-shot ((obj crimson-guard-hover-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect crimson-guard-hover-shot ((this crimson-guard-hover-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type guard-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 28 of type crimson-guard-hover-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound crimson-guard-hover-shot ((obj crimson-guard-hover-shot) (arg0 projectile-options)) +(defmethod play-impact-sound crimson-guard-hover-shot ((this crimson-guard-hover-shot) (arg0 projectile-options)) (cond ((zero? arg0) ) (else - ((method-of-type guard-shot play-impact-sound) obj arg0) + ((method-of-type guard-shot play-impact-sound) this arg0) ) ) 0 @@ -516,37 +516,37 @@ ) ;; definition for method 3 of type crimson-guard-hover -(defmethod inspect crimson-guard-hover ((obj crimson-guard-hover)) - (when (not obj) - (set! obj obj) +(defmethod inspect crimson-guard-hover ((this crimson-guard-hover)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hover-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tgun-jmod: ~A~%" (-> obj gun-jmod)) - (format #t "~2Thips-jmod: ~A~%" (-> obj hips-jmod)) - (format #t "~2Tentity-group: ~A~%" (-> obj entity-group)) - (format #t "~2Tlos: #~%" (-> obj los)) - (format #t "~2Tsmoke-part: ~A~%" (-> obj smoke-part)) - (format #t "~2Tengine-part: ~A~%" (-> obj engine-part)) - (format #t "~2Tlast-fire-time: ~D~%" (-> obj last-fire-time)) - (format #t "~2Tgun-x-angle: ~f~%" (-> obj gun-x-angle)) - (format #t "~2Tgun-x-angle-final: ~f~%" (-> obj gun-x-angle-final)) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) - (format #t "~2Tpath-du-final: ~f~%" (-> obj path-du-final)) - (format #t "~2Tpath-dest: ~f~%" (-> obj path-dest)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tknocked-recover-anim: ~D~%" (-> obj knocked-recover-anim)) - (format #t "~2Tattack-wait-min: ~f~%" (-> obj attack-wait-min)) - (format #t "~2Tattack-wait-max: ~f~%" (-> obj attack-wait-max)) - (format #t "~2Tattack-miss-dist-min: ~f~%" (-> obj attack-miss-dist-min)) - (format #t "~2Tattack-miss-dist-max: ~f~%" (-> obj attack-miss-dist-max)) - (format #t "~2Tattack-miss-dist-curr: ~f~%" (-> obj attack-miss-dist-curr)) - (format #t "~2Tshots-fired: ~D~%" (-> obj shots-fired)) + (format #t "~2Tgun-jmod: ~A~%" (-> this gun-jmod)) + (format #t "~2Thips-jmod: ~A~%" (-> this hips-jmod)) + (format #t "~2Tentity-group: ~A~%" (-> this entity-group)) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Tsmoke-part: ~A~%" (-> this smoke-part)) + (format #t "~2Tengine-part: ~A~%" (-> this engine-part)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Tgun-x-angle: ~f~%" (-> this gun-x-angle)) + (format #t "~2Tgun-x-angle-final: ~f~%" (-> this gun-x-angle-final)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-du: ~f~%" (-> this path-du)) + (format #t "~2Tpath-du-final: ~f~%" (-> this path-du-final)) + (format #t "~2Tpath-dest: ~f~%" (-> this path-dest)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tknocked-recover-anim: ~D~%" (-> this knocked-recover-anim)) + (format #t "~2Tattack-wait-min: ~f~%" (-> this attack-wait-min)) + (format #t "~2Tattack-wait-max: ~f~%" (-> this attack-wait-max)) + (format #t "~2Tattack-miss-dist-min: ~f~%" (-> this attack-miss-dist-min)) + (format #t "~2Tattack-miss-dist-max: ~f~%" (-> this attack-miss-dist-max)) + (format #t "~2Tattack-miss-dist-curr: ~f~%" (-> this attack-miss-dist-curr)) + (format #t "~2Tshots-fired: ~D~%" (-> this shots-fired)) (label cfg-4) - obj + this ) ;; definition for symbol *crimson-guard-hover-enemy-info*, type enemy-info @@ -664,10 +664,10 @@ ;; definition for method 135 of type crimson-guard-hover ;; WARN: Return type mismatch int vs sound-id. -(defmethod enemy-method-135 crimson-guard-hover ((obj crimson-guard-hover) (arg0 int)) - (if (and (zero? arg0) (logtest? #x4000000 (-> obj incoming penetrate-using))) +(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)) obj arg0) + ((the-as (function enemy int sound-id) (find-parent-method crimson-guard-hover 135)) this arg0) ) (the-as sound-id 0) ) @@ -756,7 +756,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) (let ((f0-1 (vector-vector-distance-squared (-> self root trans) (-> self focus-pos))) (f1-0 122880.0) @@ -769,7 +769,7 @@ 0 ) :exit (behavior () - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (set! (-> self restart-fly-anims) #t) ) :trans (behavior () @@ -855,10 +855,10 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 4)) + (if (time-elapsed? (-> self state-time) (seconds 4)) (go-hostile self) ) ) @@ -934,13 +934,13 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) (set! (-> self shots-fired) 0) 0 ) :exit (behavior () - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (set! (-> self restart-fly-anims) #t) ) :trans (behavior () @@ -1058,7 +1058,7 @@ (set! (-> self hit-points) 0) (do-effect (-> self skel effect) 'death-default 0.0 -1) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1185,7 +1185,7 @@ ) ;; definition for method 74 of type crimson-guard-hover -(defmethod general-event-handler crimson-guard-hover ((obj crimson-guard-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler crimson-guard-hover ((this crimson-guard-hover) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-15 enemy-flag)) @@ -1198,36 +1198,36 @@ ) ) (('hit 'hit-flinch 'hit-knocked) - (speech-control-method-13 *speech-control* (the-as handle obj)) - (when (and (-> obj next-state) (let ((v1-8 (-> obj next-state name))) - (or (= v1-8 'ambush-fly) (= v1-8 'ambush-attack)) - ) + (speech-control-method-13 *speech-control* (the-as handle this)) + (when (and (-> this next-state) (let ((v1-8 (-> this next-state name))) + (or (= v1-8 'ambush-fly) (= v1-8 'ambush-attack)) + ) ) - (hover-nav-control-method-20 (-> obj hover)) - (hover-enemy-method-140 obj #t) - (let ((v1-14 (-> obj enemy-flags))) + (hover-nav-control-method-20 (-> this hover)) + (hover-enemy-method-140 this #t) + (let ((v1-14 (-> this enemy-flags))) (if (logtest? v1-14 (enemy-flag checking-water)) (set! v1-15 (logior v1-14 (enemy-flag enable-on-active))) (set! v1-15 (logclear v1-14 (enemy-flag enable-on-active))) ) ) - (set! (-> obj enemy-flags) v1-15) - (hover-enemy-method-153 obj) + (set! (-> this enemy-flags) v1-15) + (hover-enemy-method-153 this) ) - (when (> (-> obj hit-points) 0) - (let* ((s1-0 (handle->process (-> obj incoming attacker-handle))) + (when (> (-> this hit-points) 0) + (let* ((s1-0 (handle->process (-> this incoming attacker-handle))) (v1-23 (if (type? s1-0 process-focusable) s1-0 ) ) ) - (if (and *target* v1-23 (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (-> obj focus-pos))) + (if (and *target* v1-23 (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> this focus-pos))) (f1-0 122880.0) ) (< f0-0 (* f1-0 f1-0)) ) ) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-11)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-11)) ) ) ) @@ -1235,7 +1235,7 @@ (function enemy process int symbol event-message-block object) (find-parent-method crimson-guard-hover 74) ) - obj + this arg0 arg1 arg2 @@ -1249,13 +1249,13 @@ (when (= (the-as symbol a0-27) 'attack) (when (logtest? (-> (the-as process-focusable v1-31) mask) (process-mask target)) (if (and (focus-test? (the-as process-focusable v1-31) dead) - (let ((f0-1 (vector-vector-distance-squared (-> obj root trans) (-> obj focus-pos))) + (let ((f0-1 (vector-vector-distance-squared (-> this root trans) (-> this focus-pos))) (f1-3 122880.0) ) (< f0-1 (* f1-3 f1-3)) ) ) - (speech-control-method-12 *speech-control* obj (speech-type speech-type-10)) + (speech-control-method-12 *speech-control* this (speech-type speech-type-10)) ) ) ) @@ -1264,7 +1264,7 @@ (function enemy process int symbol event-message-block object) (find-parent-method crimson-guard-hover 74) ) - obj + this arg0 arg1 arg2 @@ -1276,7 +1276,7 @@ (function enemy process int symbol event-message-block object) (find-parent-method crimson-guard-hover 74) ) - obj + this arg0 arg1 arg2 @@ -1288,13 +1288,13 @@ ;; definition for method 162 of type crimson-guard-hover ;; WARN: Return type mismatch object vs symbol. -(defmethod crimson-guard-hover-method-162 crimson-guard-hover ((obj crimson-guard-hover) (arg0 process-focusable)) - (let* ((v1-1 (vector+! (new 'stack-no-clear 'vector) (-> obj root trans) (-> obj root transv))) - (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> obj focus-pos))) +(defmethod crimson-guard-hover-method-162 crimson-guard-hover ((this crimson-guard-hover) (arg0 process-focusable)) + (let* ((v1-1 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) (-> this root transv))) + (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this focus-pos))) (f30-0 (vector-length s5-1)) (a0-4 (if arg0 arg0 - (handle->process (-> obj focus handle)) + (handle->process (-> this focus handle)) ) ) ) @@ -1305,14 +1305,15 @@ (s5-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-1 1.0)) ) (and (< 0.0 (vector-dot s4-1 s5-2)) - (and (>= (- (current-time) (-> obj last-fire-time)) - (the int (* 300.0 (rand-vu-float-range (-> obj attack-wait-min) (-> obj attack-wait-max)))) - ) - (get-enemy-target obj) + (and (time-elapsed? + (-> this last-fire-time) + (the int (* 300.0 (rand-vu-float-range (-> this attack-wait-min) (-> this attack-wait-max)))) + ) + (get-enemy-target this) (< f30-0 225280.0) (and (< (fabs (vector-x-angle s5-2)) 3640.889) - (enemy-method-95 obj (-> obj focus-pos) 5461.3335) - (check-los? (-> obj los) (seconds 0.4)) + (enemy-method-95 this (-> this focus-pos) 5461.3335) + (check-los? (-> this los) (seconds 0.4)) ) ) ) @@ -1324,7 +1325,7 @@ ;; definition for method 145 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-145 crimson-guard-hover ((obj crimson-guard-hover) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod hover-enemy-method-145 crimson-guard-hover ((this crimson-guard-hover) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) @@ -1333,45 +1334,45 @@ ) (let* ((f0-2 (- 1.0 arg1)) (a2-2 (- 1.0 (* f0-2 f0-2 f0-2))) - (a3-7 (-> obj skel root-channel arg0)) + (a3-7 (-> this skel root-channel arg0)) ) (let ((f0-6 (fabs a2-2))) (set! (-> a3-7 frame-interp 1) f0-6) (set! (-> a3-7 frame-interp 0) f0-6) ) - (set! (-> a3-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data v1-1))) + (set! (-> a3-7 frame-group) (the-as art-joint-anim (-> this draw art-group data v1-1))) (set! (-> a3-7 param 0) 0.0) - (set! (-> a3-7 frame-num) (-> obj skel root-channel 0 frame-num)) - (joint-control-channel-group! a3-7 (the-as art-joint-anim (-> obj draw art-group data v1-1)) num-func-chan) + (set! (-> a3-7 frame-num) (-> this skel root-channel 0 frame-num)) + (joint-control-channel-group! a3-7 (the-as art-joint-anim (-> this draw art-group data v1-1)) num-func-chan) ) (none) ) ;; definition for method 52 of type crimson-guard-hover ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 crimson-guard-hover ((obj crimson-guard-hover) (arg0 vector)) - (let ((s4-0 (-> obj root))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-52 crimson-guard-hover ((this crimson-guard-hover) (arg0 vector)) + (let ((s4-0 (-> this root))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-2)) - (let ((gp-1 (-> obj root transv))) - (let ((a1-1 (handle->process (-> obj incoming attacker-handle)))) + (let ((gp-1 (-> this root transv))) + (let ((a1-1 (handle->process (-> this incoming attacker-handle)))) (if a1-1 - (vector-! gp-1 (-> (the-as process-focusable a1-1) root trans) (-> obj root trans)) - (vector-! gp-1 (-> obj incoming attacker-pos) (-> obj root trans)) + (vector-! gp-1 (-> (the-as process-focusable a1-1) root trans) (-> this root trans)) + (vector-! gp-1 (-> this incoming attacker-pos) (-> this root trans)) ) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) (vector-rotate90-around-y! gp-1 gp-1) (if (< 0.0 (vector-dot - (vector-! (new 'stack-no-clear 'vector) (-> obj incoming attacker-pos) (-> s4-0 trans)) + (vector-! (new 'stack-no-clear 'vector) (-> this incoming attacker-pos) (-> s4-0 trans)) (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat)) ) ) (vector-negate! gp-1 gp-1) ) - (let ((f30-1 (get-rand-float-range obj 0.0 1.0)) - (s5-1 (-> obj enemy-info)) + (let ((f30-1 (get-rand-float-range this 0.0 1.0)) + (s5-1 (-> this enemy-info)) ) (vector-float*! gp-1 gp-1 (lerp (-> s5-1 knocked-hard-vxz-lo) (-> s5-1 knocked-hard-vxz-hi) f30-1)) (set! (-> gp-1 y) (lerp (-> s5-1 knocked-hard-vy-lo) (-> s5-1 knocked-hard-vy-hi) f30-1)) @@ -1379,7 +1380,7 @@ ) ) (else - ((the-as (function hover-enemy vector none) (find-parent-method crimson-guard-hover 52)) obj arg0) + ((the-as (function hover-enemy vector none) (find-parent-method crimson-guard-hover 52)) this arg0) ) ) ) @@ -1387,50 +1388,50 @@ ) ;; definition for method 77 of type crimson-guard-hover -(defmethod enemy-method-77 crimson-guard-hover ((obj crimson-guard-hover) (arg0 (pointer float))) +(defmethod enemy-method-77 crimson-guard-hover ((this crimson-guard-hover) (arg0 (pointer float))) (ja-channel-push! 1 0) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) ) - (set! (-> obj knocked-recover-anim) 13) + (set! (-> this knocked-recover-anim) 13) ) (else - (let ((a0-4 (-> obj skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 10))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 10))) (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 10)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1)) ) (set! (-> a0-4 param 1) (-> arg0 0)) (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> obj draw art-group data 10)) num-func-seek!) + (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!) ) - (set! (-> obj knocked-recover-anim) 11) + (set! (-> this knocked-recover-anim) 11) ) ) #t ) ;; definition for method 78 of type crimson-guard-hover -(defmethod enemy-method-78 crimson-guard-hover ((obj crimson-guard-hover) (arg0 (pointer float))) +(defmethod enemy-method-78 crimson-guard-hover ((this crimson-guard-hover) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.4)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) ) #t ) @@ -1442,13 +1443,13 @@ ;; definition for method 55 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod track-target! crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod track-target! crimson-guard-hover ((this crimson-guard-hover)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (seek! (-> obj gun-x-angle) (-> obj gun-x-angle-final) (* 21845.334 (seconds-per-frame))) - (let* ((s5-0 (hover-nav-control-method-16 (-> obj hover) (new 'stack-no-clear 'vector))) + (seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame))) + (let* ((s5-0 (hover-nav-control-method-16 (-> this hover) (new 'stack-no-clear 'vector))) (s4-0 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) @@ -1467,25 +1468,25 @@ ) (quaternion*! s5-1 a1-4 s4-0) (quaternion-slerp! - (the-as quaternion (-> obj hips-jmod target)) - (the-as quaternion (-> obj hips-jmod target)) + (the-as quaternion (-> this hips-jmod target)) + (the-as quaternion (-> this hips-jmod target)) s5-1 (* 2.0 (seconds-per-frame)) ) ) (let ((t9-6 (method-of-type hover-enemy track-target!))) - (t9-6 obj) + (t9-6 this) ) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) 0 (none) ) ;; definition for method 142 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-142 crimson-guard-hover ((obj crimson-guard-hover)) - (let ((s5-0 (-> obj main-joint-acc)) - (s4-0 (-> obj main-joint-vel)) +(defmethod hover-enemy-method-142 crimson-guard-hover ((this crimson-guard-hover)) + (let ((s5-0 (-> this main-joint-acc)) + (s4-0 (-> this main-joint-vel)) (gp-0 (lambda ((arg0 crimson-guard-hover) (arg1 cspace) (arg2 float) (arg3 float) (arg4 vector) (arg5 vector) (arg6 int)) (local-vars (sv-192 float) (sv-208 quaternion) (sv-224 vector)) @@ -1568,18 +1569,18 @@ ) ) (gp-0 - obj - (-> obj node-list data (-> obj hover-info engine-left)) - (-> obj hover-info thrust-rotate-left) + this + (-> this node-list data (-> this hover-info engine-left)) + (-> this hover-info thrust-rotate-left) -1.0 s5-0 s4-0 0 ) (gp-0 - obj - (-> obj node-list data (-> obj hover-info engine-right)) - (-> obj hover-info thrust-rotate-right) + this + (-> this node-list data (-> this hover-info engine-right)) + (-> this hover-info thrust-rotate-right) 1.0 s5-0 s4-0 @@ -1592,8 +1593,8 @@ ;; definition for method 143 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-143 crimson-guard-hover ((obj crimson-guard-hover) (arg0 int) (arg1 float)) - (let* ((s2-0 (-> obj node-list data arg0)) +(defmethod hover-enemy-method-143 crimson-guard-hover ((this crimson-guard-hover) (arg0 int) (arg1 float)) + (let* ((s2-0 (-> this node-list data arg0)) (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) s2-0)) (s5-0 (new 'stack-no-clear 'matrix)) ) @@ -1623,28 +1624,28 @@ (vector+! (-> s5-0 trans) s4-0 v1-29) ) ) - (spawn-with-matrix (-> obj engine-part) s5-0) + (spawn-with-matrix (-> this engine-part) s5-0) ) - (sound-play "hover-jets" :id (-> obj sound-id)) + (sound-play "hover-jets" :id (-> this sound-id)) 0 (none) ) ;; definition for method 161 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod shoot crimson-guard-hover ((obj crimson-guard-hover) +(defmethod shoot crimson-guard-hover ((this crimson-guard-hover) (arg0 vector) (arg1 projectile-init-by-other-params) (arg2 int) (arg3 int) (arg4 float) ) - (vector<-cspace! (-> arg1 pos) (-> obj node-list data arg2)) + (vector<-cspace! (-> arg1 pos) (-> this node-list data arg2)) (let ((s2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> obj node-list data arg2 bone transform vector 1) + (-> this node-list data arg2 bone transform vector 1) 1.0 ) (* 273.06668 arg4) @@ -1652,7 +1653,7 @@ ) (a1-8 (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> obj node-list data arg2 bone transform vector 2) + (-> this node-list data arg2 bone transform vector 2) 1.0 ) ) @@ -1660,33 +1661,33 @@ (vector-orient-by-quat! (-> arg1 vel) a1-8 s2-1) ) (vector-normalize! (-> arg1 vel) (* 819200.0 arg4)) - (spawn-projectile crimson-guard-hover-shot arg1 obj *default-dead-pool*) + (spawn-projectile crimson-guard-hover-shot arg1 this *default-dead-pool*) 0 (none) ) ;; definition for method 73 of type crimson-guard-hover -(defmethod kill-prefer-falling crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod kill-prefer-falling crimson-guard-hover ((this crimson-guard-hover)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'knocked)) - (go (method-of-object obj die-now)) + ((and (-> this next-state) (= (-> this next-state name) 'knocked)) + (go (method-of-object this die-now)) ) - ((-> obj enemy-info use-die-falling) - (go (method-of-object obj die-falling)) + ((-> this enemy-info use-die-falling) + (go (method-of-object this die-falling)) ) (else - (go (method-of-object obj die)) + (go (method-of-object this die)) ) ) ) ;; definition for method 63 of type crimson-guard-hover ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 crimson-guard-hover ((obj crimson-guard-hover) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 crimson-guard-hover ((this crimson-guard-hover) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 (the-as nav-enemy obj) arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 (the-as nav-enemy this) arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) @@ -1694,9 +1695,9 @@ ;; definition for method 149 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-149 crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod hover-enemy-method-149 crimson-guard-hover ((this crimson-guard-hover)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crimson-guard-hover" (the-as (pointer uint32) #f)) @@ -1709,9 +1710,9 @@ ;; definition for method 114 of type crimson-guard-hover ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod init-enemy-collision! crimson-guard-hover ((this crimson-guard-hover)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1801,19 +1802,19 @@ (set! (-> s5-0 backup-collide-with) (-> v1-31 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 150 of type crimson-guard-hover -(defmethod hover-enemy-method-150 crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod hover-enemy-method-150 crimson-guard-hover ((this crimson-guard-hover)) *crimson-guard-hover-enemy-info* ) ;; definition for method 151 of type crimson-guard-hover -(defmethod hover-enemy-method-151 crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod hover-enemy-method-151 crimson-guard-hover ((this crimson-guard-hover)) (new 'static 'hover-enemy-info :fly-forward-anim 7 :fly-backward-anim 8 @@ -1830,126 +1831,126 @@ ) ;; definition for method 152 of type crimson-guard-hover -(defmethod hover-enemy-method-152 crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod hover-enemy-method-152 crimson-guard-hover ((this crimson-guard-hover)) (new 'static 'hover-nav-params :max-speed 102400.0 :max-acceleration 143360.0 :friction 0.05) ) ;; definition for method 7 of type crimson-guard-hover ;; WARN: Return type mismatch hover-enemy vs crimson-guard-hover. -(defmethod relocate crimson-guard-hover ((obj crimson-guard-hover) (arg0 int)) - (if (nonzero? (-> obj gun-jmod)) - (&+! (-> obj gun-jmod) arg0) +(defmethod relocate crimson-guard-hover ((this crimson-guard-hover) (arg0 int)) + (if (nonzero? (-> this gun-jmod)) + (&+! (-> this gun-jmod) arg0) ) - (if (nonzero? (-> obj hips-jmod)) - (&+! (-> obj hips-jmod) arg0) + (if (nonzero? (-> this hips-jmod)) + (&+! (-> this hips-jmod) arg0) ) - (if (nonzero? (-> obj smoke-part)) - (&+! (-> obj smoke-part) arg0) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) arg0) ) - (if (nonzero? (-> obj engine-part)) - (&+! (-> obj engine-part) arg0) + (if (nonzero? (-> this engine-part)) + (&+! (-> this engine-part) arg0) ) - (the-as crimson-guard-hover ((method-of-type hover-enemy relocate) obj arg0)) + (the-as crimson-guard-hover ((method-of-type hover-enemy relocate) this arg0)) ) ;; definition for method 10 of type crimson-guard-hover -(defmethod deactivate crimson-guard-hover ((obj crimson-guard-hover)) - (if (nonzero? (-> obj smoke-part)) - (kill-and-free-particles (-> obj smoke-part)) +(defmethod deactivate crimson-guard-hover ((this crimson-guard-hover)) + (if (nonzero? (-> this smoke-part)) + (kill-and-free-particles (-> this smoke-part)) ) - (if (nonzero? (-> obj engine-part)) - (kill-and-free-particles (-> obj engine-part)) + (if (nonzero? (-> this engine-part)) + (kill-and-free-particles (-> this engine-part)) ) - (sound-stop (-> obj sound-id)) - ((method-of-type hover-enemy deactivate) obj) + (sound-stop (-> this sound-id)) + ((method-of-type hover-enemy deactivate) this) (none) ) ;; definition for method 115 of type crimson-guard-hover ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! crimson-guard-hover ((obj crimson-guard-hover)) +(defmethod init-enemy! crimson-guard-hover ((this crimson-guard-hover)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) - (hover-enemy-method-149 obj) - (init-enemy-behaviour-and-stats! obj (hover-enemy-method-150 obj)) - (hover-enemy-method-155 obj) - (new-source! (-> obj los) obj (seconds 2) (collide-spec backgnd enemy obstacle)) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj scale) 1.2) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj root dynam gravity y) 327680.0) - (set! (-> obj root dynam gravity-length) 327680.0) - (set! (-> obj root dynam gravity-max) 327680.0) - (set! (-> obj gun-jmod) - (the-as joint-mod (new 'process 'joint-mod-rotate-local obj (-> obj hover-info gun-base) #t)) + (hover-enemy-method-149 this) + (init-enemy-behaviour-and-stats! this (hover-enemy-method-150 this)) + (hover-enemy-method-155 this) + (new-source! (-> this los) this (seconds 2) (collide-spec backgnd enemy obstacle)) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this scale) 1.2) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this root dynam gravity y) 327680.0) + (set! (-> this root dynam gravity-length) 327680.0) + (set! (-> this root dynam gravity-max) 327680.0) + (set! (-> this gun-jmod) + (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this hover-info gun-base) #t)) ) - (set! (-> obj gun-x-angle) 0.0) - (set! (-> obj gun-x-angle-final) 0.0) - (set! (-> obj hips-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local obj 18 #t))) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (set! (-> this gun-x-angle) 0.0) + (set! (-> this gun-x-angle-final) 0.0) + (set! (-> this hips-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local this 18 #t))) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-30 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-30 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (if (and v1-30 (= (-> sv-16 elt-count) 1)) - (set! (-> obj entity-group) (-> v1-30 0)) - (set! (-> obj entity-group) #f) + (set! (-> this entity-group) (-> v1-30 0)) + (set! (-> this entity-group) #f) ) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-34 (res-lump-data (-> obj entity) 'timeout (pointer float) :tag-ptr (& sv-32)))) + (let ((v1-34 (res-lump-data (-> this entity) 'timeout (pointer float) :tag-ptr (& sv-32)))) (cond ((and v1-34 (= (-> sv-32 elt-count) 2)) - (set! (-> obj attack-wait-min) (-> v1-34 0)) - (set! (-> obj attack-wait-max) (-> v1-34 1)) + (set! (-> this attack-wait-min) (-> v1-34 0)) + (set! (-> this attack-wait-max) (-> v1-34 1)) ) (else - (set! (-> obj attack-wait-min) 1.0) - (set! (-> obj attack-wait-max) 3.0) + (set! (-> this attack-wait-min) 1.0) + (set! (-> this attack-wait-max) 3.0) ) ) ) (set! sv-48 (new 'static 'res-tag)) - (let ((v1-40 (res-lump-data (-> obj entity) 'min-max (pointer float) :tag-ptr (& sv-48)))) - (set! (-> obj attack-miss-dist-min) (if (and v1-40 (> (the-as int (-> sv-48 elt-count)) 0)) - (-> v1-40 0) - -40960.0 - ) + (let ((v1-40 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-48)))) + (set! (-> this attack-miss-dist-min) (if (and v1-40 (> (the-as int (-> sv-48 elt-count)) 0)) + (-> v1-40 0) + -40960.0 + ) ) ) (set! sv-64 (new 'static 'res-tag)) - (let ((v1-43 (res-lump-data (-> obj entity) 'min-max (pointer float) :tag-ptr (& sv-64)))) - (set! (-> obj attack-miss-dist-max) (if (and v1-43 (< 1 (the-as int (-> sv-64 elt-count)))) - (-> v1-43 1) - 40960.0 - ) + (let ((v1-43 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-64)))) + (set! (-> this attack-miss-dist-max) (if (and v1-43 (< 1 (the-as int (-> sv-64 elt-count)))) + (-> v1-43 1) + 40960.0 + ) ) ) - (set! (-> obj attack-miss-dist-curr) 0.0) - (set! (-> obj path) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (set! (-> obj path-u) 0.0) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj smoke-part) (create-launch-control (-> *part-group-id-table* 154) obj)) - (set! (-> obj engine-part) (create-launch-control (-> *part-group-id-table* 156) obj)) + (set! (-> this attack-miss-dist-curr) 0.0) + (set! (-> this path) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (set! (-> this path-u) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 154) this)) + (set! (-> this engine-part) (create-launch-control (-> *part-group-id-table* 156) this)) (add-connection *part-engine* - obj + this 26 - obj + this 318 (new 'static 'vector :x 1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) (add-connection *part-engine* - obj + this 26 - obj + this 318 (new 'static 'vector :x -1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) - (add-connection *part-engine* obj 26 obj 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) + (add-connection *part-engine* this 26 this 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) 0 (none) ) 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 396af96014..63c7ff49d9 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 @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type flying-formation -(defmethod inspect flying-formation ((obj flying-formation)) - (when (not obj) - (set! obj obj) +(defmethod inspect flying-formation ((this flying-formation)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hover-formation inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type flamer @@ -74,41 +74,41 @@ ) ;; definition for method 3 of type flamer -(defmethod inspect flamer ((obj flamer)) - (when (not obj) - (set! obj obj) +(defmethod inspect flamer ((this flamer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tshot-trajectory: #~%" (-> obj shot-trajectory)) - (format #t "~2Tlast-fire-time: ~D~%" (-> obj last-fire-time)) - (format #t "~2Tsync-off: ~D~%" (-> obj sync-off)) - (format #t "~2Tbase-pos: #~%" (-> obj base-pos)) - (format #t "~2Tidle-pos: #~%" (-> obj idle-pos)) - (format #t "~2Toffset: #~%" (-> obj offset)) - (format #t "~2Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~2Tzone-to-world: #~%" (-> obj zone-to-world)) - (format #t "~2Tworld-to-zone: #~%" (-> obj world-to-zone)) - (format #t "~2Tformation-entity: ~A~%" (-> obj formation-entity)) - (format #t "~2Tflit-joint: ~A~%" (-> obj flit-joint)) - (format #t "~2Tflit-angle: ~f~%" (-> obj flit-angle)) - (format #t "~2Tflit-timer: ~D~%" (-> obj flit-timer)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tsound-volume: ~f~%" (-> obj sound-volume)) - (format #t "~2Tscale: ~f~%" (-> obj scale)) - (format #t "~2Thit-surface?: ~A~%" (-> obj hit-surface?)) - (format #t "~2Tground-mode: ~D~%" (-> obj ground-mode)) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Tsurface-normal: #~%" (-> obj surface-normal)) - (format #t "~2Tmain-joint-pos: #~%" (-> obj main-joint-pos)) - (format #t "~2Tmain-joint-vel: #~%" (-> obj main-joint-vel)) - (format #t "~2Tmain-joint-acc: #~%" (-> obj main-joint-acc)) - (format #t "~2Tmain-acceleration: ~f~%" (-> obj main-acceleration)) - (format #t "~2Tfly-dir: #~%" (-> obj fly-dir)) + (format #t "~2Tshot-trajectory: #~%" (-> this shot-trajectory)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Tsync-off: ~D~%" (-> this sync-off)) + (format #t "~2Tbase-pos: #~%" (-> this base-pos)) + (format #t "~2Tidle-pos: #~%" (-> this idle-pos)) + (format #t "~2Toffset: #~%" (-> this offset)) + (format #t "~2Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~2Tzone-to-world: #~%" (-> this zone-to-world)) + (format #t "~2Tworld-to-zone: #~%" (-> this world-to-zone)) + (format #t "~2Tformation-entity: ~A~%" (-> this formation-entity)) + (format #t "~2Tflit-joint: ~A~%" (-> this flit-joint)) + (format #t "~2Tflit-angle: ~f~%" (-> this flit-angle)) + (format #t "~2Tflit-timer: ~D~%" (-> this flit-timer)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tsound-volume: ~f~%" (-> this sound-volume)) + (format #t "~2Tscale: ~f~%" (-> this scale)) + (format #t "~2Thit-surface?: ~A~%" (-> this hit-surface?)) + (format #t "~2Tground-mode: ~D~%" (-> this ground-mode)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tsurface-normal: #~%" (-> this surface-normal)) + (format #t "~2Tmain-joint-pos: #~%" (-> this main-joint-pos)) + (format #t "~2Tmain-joint-vel: #~%" (-> this main-joint-vel)) + (format #t "~2Tmain-joint-acc: #~%" (-> this main-joint-acc)) + (format #t "~2Tmain-acceleration: ~f~%" (-> this main-acceleration)) + (format #t "~2Tfly-dir: #~%" (-> this fly-dir)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -269,43 +269,43 @@ ;; definition for method 74 of type flamer ;; INFO: Used lq/sq -(defmethod general-event-handler flamer ((obj flamer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler flamer ((this flamer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) (('update-formation) - (let ((v0-3 (the-as object (-> obj offset)))) + (let ((v0-3 (the-as object (-> this offset)))) (set! (-> (the-as vector v0-3) quad) (-> (the-as vector (-> arg3 param 0)) quad)) v0-3 ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 189 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod flamer-method-189 flamer ((obj flamer)) +(defmethod flamer-method-189 flamer ((this flamer)) (with-pp - (let ((v1-0 (-> obj formation-entity))) + (let ((v1-0 (-> this formation-entity))) (when (if v1-0 (-> v1-0 extra process) ) @@ -314,7 +314,7 @@ (set! (-> a1-1 num-params) 0) (set! (-> a1-1 message) 'join) (let ((t9-0 send-event-function) - (v1-5 (-> obj formation-entity)) + (v1-5 (-> this formation-entity)) ) (t9-0 (if v1-5 @@ -333,9 +333,9 @@ ;; definition for method 190 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod flamer-method-190 flamer ((obj flamer)) +(defmethod flamer-method-190 flamer ((this flamer)) (with-pp - (let ((v1-0 (-> obj formation-entity))) + (let ((v1-0 (-> this formation-entity))) (when (if v1-0 (-> v1-0 extra process) ) @@ -344,7 +344,7 @@ (set! (-> a1-1 num-params) 0) (set! (-> a1-1 message) 'leave) (let ((t9-0 send-event-function) - (v1-5 (-> obj formation-entity)) + (v1-5 (-> this formation-entity)) ) (t9-0 (if v1-5 @@ -363,10 +363,10 @@ ;; definition for method 142 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 flamer ((obj flamer) (arg0 nav-control)) +(defmethod nav-enemy-method-142 flamer ((this flamer) (arg0 nav-control)) (let ((gp-0 (new 'stack-no-clear 'vector))) - (vector-! gp-0 (target-pos 0) (-> obj root trans)) - (seek-toward-heading-vec! (-> obj root) gp-0 131072.0 (seconds 0.5)) + (vector-! gp-0 (target-pos 0) (-> this root trans)) + (seek-toward-heading-vec! (-> this root) gp-0 131072.0 (seconds 0.5)) ) 0 (none) @@ -375,19 +375,19 @@ ;; definition for method 182 of type flamer ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod flamer-method-182 flamer ((obj flamer) (arg0 vector) (arg1 process-focusable)) +(defmethod flamer-method-182 flamer ((this flamer) (arg0 vector) (arg1 process-focusable)) (with-pp (set! arg0 (cond - ((and *target* (-> obj next-state) (let ((v1-4 (-> obj next-state name))) - (or (= v1-4 'hostile) (= v1-4 'attack) (= v1-4 'hit)) - ) + ((and *target* (-> this next-state) (let ((v1-4 (-> this next-state name))) + (or (= v1-4 'hostile) (= v1-4 'attack) (= v1-4 'hit)) + ) ) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) (process->ppointer pp)) (set! (-> a1-3 num-params) 0) (set! (-> a1-3 message) 'get-formation) (let* ((t9-0 send-event-function) - (v1-7 (-> obj formation-entity)) + (v1-7 (-> this formation-entity)) (s2-0 (the-as hover-formation-control (t9-0 (if v1-7 (-> v1-7 extra process) @@ -400,7 +400,7 @@ ) (cond ((and s2-0 (not (is-formation-type-in-range s2-0))) - (hover-formation-control-method-15 s2-0 arg0 (-> obj offset)) + (hover-formation-control-method-15 s2-0 arg0 (-> this offset)) ) (else (cond @@ -412,24 +412,24 @@ (set! (-> s1-0 quad) (-> (get-trans arg1 0) quad)) (let ((s3-1 (new 'stack-no-clear 'vector))) (let ((s2-1 (new 'stack-no-clear 'vector))) - (vector-! s3-1 s1-0 (-> obj root trans)) - (vector-flatten! s2-1 s3-1 (-> obj zone-to-world vector 2)) + (vector-! s3-1 s1-0 (-> this root trans)) + (vector-flatten! s2-1 s3-1 (-> this zone-to-world vector 2)) (vector-float*! s2-1 s2-1 -0.9) (vector+! s3-1 s3-1 s2-1) ) - (vector+! s4-0 (-> obj root trans) s3-1) + (vector+! s4-0 (-> this root trans) s3-1) ) ) ) ) - (vector-matrix*! arg0 s4-0 (-> obj world-to-zone)) - (vector+! arg0 arg0 (-> obj offset)) - (vector-matrix*! arg0 arg0 (-> obj zone-to-world)) + (vector-matrix*! arg0 s4-0 (-> this world-to-zone)) + (vector+! arg0 arg0 (-> this offset)) + (vector-matrix*! arg0 arg0 (-> this zone-to-world)) ) ) ) ) - (let* ((v1-30 (+ (current-time) (the-as time-frame (-> obj sync-off)))) + (let* ((v1-30 (+ (current-time) (the-as time-frame (-> this sync-off)))) (f0-5 (+ (-> arg0 x) (* 614.4 (cos (* 54.613335 (the float (mod v1-30 1200))))))) ) (set! (-> arg0 x) f0-5) @@ -437,7 +437,7 @@ ) ) (else - (set! (-> arg0 quad) (-> obj idle-pos quad)) + (set! (-> arg0 quad) (-> this idle-pos quad)) arg0 ) ) @@ -488,13 +488,13 @@ ;; definition for function flamer-flit-post (defbehavior flamer-flit-post flamer () - (when (>= (- (current-time) (-> self flit-timer)) (rand-vu-int-range (seconds 1.2) (seconds 3))) + (when (time-elapsed? (-> self flit-timer) (rand-vu-int-range (seconds 1.2) (seconds 3))) (set! (-> self flit-angle) (the float (sar (shl (the int (+ (-> self flit-angle) (* 182.04445 (rand-vu-float-range 160.0 200.0)))) 48) 48) ) ) - (set! (-> self flit-timer) (current-time)) + (set-time! (-> self flit-timer)) ) (flamer-attack-post) (none) @@ -504,14 +504,14 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 22. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. ;; WARN: disable def twice: 45. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod flamer-method-183 flamer ((obj flamer)) +(defmethod flamer-method-183 flamer ((this flamer)) (with-pp (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'get-formation) (let* ((t9-0 send-event-function) - (v1-2 (-> obj formation-entity)) + (v1-2 (-> this formation-entity)) (a0-3 (the-as hover-formation-control (t9-0 (if v1-2 (-> v1-2 extra process) @@ -525,14 +525,14 @@ symbol (cond (a0-3 - (and (hover-formation-control-method-16 a0-3) (>= (the-as int (-> obj focus aware)) 3)) + (and (hover-formation-control-method-16 a0-3) (>= (the-as int (-> this focus aware)) 3)) ) (*target* (let ((a1-1 (target-pos 0))) - (-> obj root trans) + (-> this root trans) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-matrix*! s5-0 a1-1 (-> obj world-to-zone)) - (and (>= (-> obj enemy-info notice-distance) (-> s5-0 z)) (>= (the-as int (-> obj focus aware)) 3)) + (vector-matrix*! s5-0 a1-1 (-> this world-to-zone)) + (and (>= (-> this enemy-info notice-distance) (-> s5-0 z)) (>= (the-as int (-> this focus aware)) 3)) ) ) ) @@ -548,22 +548,22 @@ ;; definition for method 188 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod flamer-method-188 flamer ((obj flamer) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod flamer-method-188 flamer ((this flamer) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) (set! v1-1 arg2) (set! v1-1 arg3) ) - (let ((a3-5 (-> obj skel root-channel arg0))) + (let ((a3-5 (-> this skel root-channel arg0))) (let ((f0-2 (fabs arg1))) (set! (-> a3-5 frame-interp 1) f0-2) (set! (-> a3-5 frame-interp 0) f0-2) ) - (set! (-> a3-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data v1-1))) + (set! (-> a3-5 frame-group) (the-as art-joint-anim (-> this draw art-group data v1-1))) (set! (-> a3-5 param 0) 0.0) - (set! (-> a3-5 frame-num) (-> obj skel root-channel 0 frame-num)) - (joint-control-channel-group! a3-5 (the-as art-joint-anim (-> obj draw art-group data v1-1)) num-func-chan) + (set! (-> a3-5 frame-num) (-> this skel root-channel 0 frame-num)) + (joint-control-channel-group! a3-5 (the-as art-joint-anim (-> this draw art-group data v1-1)) num-func-chan) ) (none) ) @@ -571,7 +571,7 @@ ;; definition for method 187 of type flamer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod flamer-method-187 flamer ((obj flamer)) +(defmethod flamer-method-187 flamer ((this flamer)) (local-vars (at-0 int) (at-1 int)) (with-pp (rlet ((vf0 :class vf) @@ -579,12 +579,12 @@ (vf2 :class vf) ) (init-vf0-vector) - (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3))) + (let ((a1-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 3))) (a0-2 (new 'stack-no-clear 'vector)) (v1-1 (new 'stack-no-clear 'vector)) ) (new 'stack-no-clear 'vector) - (vector-! a0-2 a1-1 (-> obj main-joint-pos)) + (vector-! a0-2 a1-1 (-> this main-joint-pos)) (let ((a2-2 a0-2)) (.lvf vf1 (&-> a0-2 quad)) (let ((f0-0 (-> pp clock frames-per-second))) @@ -595,7 +595,7 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> a2-2 quad) vf1) ) - (vector-! v1-1 a0-2 (-> obj main-joint-vel)) + (vector-! v1-1 a0-2 (-> this main-joint-vel)) (let ((a2-4 v1-1)) (.lvf vf1 (&-> v1-1 quad)) (let ((f0-1 (-> pp clock frames-per-second))) @@ -606,16 +606,16 @@ (.mul.x.vf vf1 vf1 vf2 :mask #b111) (.svf (&-> a2-4 quad) vf1) ) - (set! (-> obj main-joint-pos quad) (-> a1-1 quad)) + (set! (-> this main-joint-pos quad) (-> a1-1 quad)) (let* ((f0-2 0.4) (f1-1 (- 1.0 f0-2)) - (a1-5 (-> obj main-joint-vel)) + (a1-5 (-> this main-joint-vel)) ) (set! (-> a1-5 x) (+ (* f0-2 (-> a0-2 x)) (* f1-1 (-> a1-5 x)))) (set! (-> a1-5 y) (+ (* f0-2 (-> a0-2 y)) (* f1-1 (-> a1-5 y)))) (set! (-> a1-5 z) (+ (* f0-2 (-> a0-2 z)) (* f1-1 (-> a1-5 z)))) ) - (set! (-> obj main-joint-acc quad) (-> v1-1 quad)) + (set! (-> this main-joint-acc quad) (-> v1-1 quad)) ) 0 0 @@ -625,38 +625,38 @@ ) ;; definition for method 55 of type flamer -(defmethod track-target! flamer ((obj flamer)) +(defmethod track-target! flamer ((this flamer)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (update-vol! (-> obj sound) (-> obj sound-volume)) - (flamer-method-191 obj) - ((method-of-type nav-enemy track-target!) obj) + (update-vol! (-> this sound) (-> this sound-volume)) + (flamer-method-191 this) + ((method-of-type nav-enemy track-target!) this) (none) ) ;; definition for method 191 of type flamer ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod flamer-method-191 flamer ((obj flamer)) +(defmethod flamer-method-191 flamer ((this flamer)) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) ) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'collide-query)) - (gp-0 (-> obj draw shadow-ctrl settings shadow-dir)) + (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 122880.0) ) - (set! (-> s4-0 start-pos quad) (-> obj root trans quad)) + (set! (-> s4-0 start-pos quad) (-> this root trans quad)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-12 s4-0)) (set! (-> v1-12 radius) 3276.8) (set! (-> v1-12 collide-with) (collide-spec backgnd)) - (set! (-> v1-12 ignore-process0) obj) + (set! (-> v1-12 ignore-process0) this) (set! (-> v1-12 ignore-process1) #f) (set! (-> v1-12 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-12 action-mask) (collide-action solid)) @@ -664,16 +664,16 @@ (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) (cond ((>= f0-1 0.0) - (let ((v1-16 (-> obj draw shadow-ctrl))) + (let ((v1-16 (-> this draw shadow-ctrl))) (logclear! (-> v1-16 settings flags) (shadow-flags disable-draw)) ) 0 (-> s4-0 best-other-tri intersect) - (let ((a1-3 (-> obj root trans))) + (let ((a1-3 (-> this root trans))) (-> a1-3 y) (let ((f1-2 (* f0-1 f30-0))) (shadow-control-method-14 - (-> obj draw shadow-ctrl) + (-> this draw shadow-ctrl) a1-3 gp-0 (fmax 32768.0 (* 409600.0 f0-1)) @@ -684,7 +684,7 @@ ) ) (else - (let ((v1-27 (-> obj draw shadow-ctrl))) + (let ((v1-27 (-> this draw shadow-ctrl))) (logior! (-> v1-27 settings flags) (shadow-flags disable-draw)) ) 0 @@ -694,7 +694,7 @@ ) ) (else - (let ((v1-29 (-> obj draw shadow-ctrl))) + (let ((v1-29 (-> this draw shadow-ctrl))) (logior! (-> v1-29 settings flags) (shadow-flags disable-draw)) ) 0 @@ -752,21 +752,21 @@ ;; definition for method 184 of type flamer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod flamer-method-184 flamer ((obj flamer)) - (let ((v1-0 (-> obj ground-mode))) +(defmethod flamer-method-184 flamer ((this flamer)) + (let ((v1-0 (-> this ground-mode))) (cond ((= v1-0 1) - (seek! (-> obj base-pos y) (-> obj dest-pos y) (* 40960.0 (seconds-per-frame))) + (seek! (-> this base-pos y) (-> this dest-pos y) (* 40960.0 (seconds-per-frame))) ) ((zero? v1-0) (let ((a1-1 (new 'stack-no-clear 'collide-query))) (cond - ((enemy-method-125 obj a1-1 (collide-spec backgnd) 8192.0 26624.0 1024.0) - (set! (-> obj base-pos y) (+ 22528.0 (-> obj root gspot-pos y))) + ((enemy-method-125 this a1-1 (collide-spec backgnd) 8192.0 26624.0 1024.0) + (set! (-> this base-pos y) (+ 22528.0 (-> this root gspot-pos y))) ) (else - (let ((s4-0 (-> obj nav)) - (s3-0 (-> obj base-pos)) + (let ((s4-0 (-> this nav)) + (s3-0 (-> this base-pos)) (s5-0 (new 'stack 'nav-find-poly-parms)) ) (vector-! (-> s5-0 point) s3-0 (-> s4-0 state mesh bounds)) @@ -775,7 +775,7 @@ (find-nearest-poly-to-point-local (-> s4-0 state mesh) s5-0) (let ((v1-13 (-> s5-0 poly))) (if v1-13 - (set! (-> obj base-pos y) (+ 22528.0 (-> obj nav state mesh bounds y) (-> v1-13 vertex0 y))) + (set! (-> this base-pos y) (+ 22528.0 (-> this nav state mesh bounds y) (-> v1-13 vertex0 y))) ) ) ) @@ -785,28 +785,28 @@ ) ) ) - (let ((v1-16 (+ (current-time) (the-as time-frame (-> obj sync-off))))) + (let ((v1-16 (+ (current-time) (the-as time-frame (-> this sync-off))))) (seek! - (-> obj root trans y) - (+ (-> obj base-pos y) (* 1228.8 (cos (* 100.66974 (the float (mod v1-16 651)))))) + (-> this root trans y) + (+ (-> this base-pos y) (* 1228.8 (cos (* 100.66974 (the float (mod v1-16 651)))))) (* 16384.0 (seconds-per-frame)) ) ) (let ((s5-2 (new 'stack-no-clear 'vector))) (set! (-> s5-2 quad) (-> *up-vector* quad)) (vector-normalize! s5-2 6144.0) - (vector/! s5-2 s5-2 (-> obj root scale)) - (vector-rotate-around-z! s5-2 s5-2 (-> obj flit-angle)) - (vector-seek! (-> obj flit-joint target) s5-2 (* 32768.0 (seconds-per-frame))) + (vector/! s5-2 s5-2 (-> this root scale)) + (vector-rotate-around-z! s5-2 s5-2 (-> this flit-angle)) + (vector-seek! (-> this flit-joint target) s5-2 (* 32768.0 (seconds-per-frame))) ) - (update-trans! (-> obj sound) (-> obj root trans)) - (update! (-> obj sound)) + (update-trans! (-> this sound) (-> this root trans)) + (update! (-> this sound)) (none) ) ;; definition for method 67 of type flamer -(defmethod go-stare flamer ((obj flamer)) - (go-hostile obj) +(defmethod go-stare flamer ((this flamer)) + (go-hostile this) ) ;; failed to figure out what this is: @@ -856,7 +856,7 @@ (set! (-> self root trans quad) (-> self idle-pos quad)) ) :trans (behavior () - (when (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) (flamer-method-183 self)) + (when (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (flamer-method-183 self)) (if (logtest? (enemy-option ambush) (-> self fact enemy-options)) (go-virtual ambush) (go-virtual active) @@ -941,7 +941,7 @@ (vector-reset! (-> self fly-dir)) (sound-play "flamer-ambush") (quaternion-copy! (-> self root quat) (-> self init-quat)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy ambush) exit))) @@ -1039,7 +1039,7 @@ (set! (-> v1-3 enemy-flags) (the-as enemy-flag (logclear (-> v1-3 enemy-flags) (enemy-flag enemy-flag37)))) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) @@ -1070,9 +1070,9 @@ :code flamer-fly-code :post (behavior () (flamer-method-187 self) - (when (>= (- (current-time) (-> self flit-timer)) (rand-vu-int-range (seconds 1.2) (seconds 3))) + (when (time-elapsed? (-> self flit-timer) (rand-vu-int-range (seconds 1.2) (seconds 3))) (set! (-> self flit-angle) (* 182.04445 (rand-vu-float-range 0.0 360.0))) - (set! (-> self flit-timer) (current-time)) + (set-time! (-> self flit-timer)) ) (vector-seek! (-> self root trans) (-> self base-pos) (* 16384.0 (seconds-per-frame))) (flamer-method-184 self) @@ -1130,7 +1130,7 @@ ) (let ((gp-1 (get-enemy-target self))) (if (and gp-1 - (>= (- (current-time) (-> self last-fire-time)) (the int (* 300.0 (rand-vu-float-range 3.0 6.0)))) + (time-elapsed? (-> self last-fire-time) (the int (* 300.0 (rand-vu-float-range 3.0 6.0)))) (< (vector-vector-distance (get-trans gp-1 3) (-> self root trans)) 245760.0) ) (go-virtual attack) @@ -1189,7 +1189,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) @@ -1209,7 +1209,7 @@ ) ) ) - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (go-virtual hostile) ) :post flamer-attack-post @@ -1217,12 +1217,12 @@ ;; definition for method 46 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-46 flamer ((obj flamer) (arg0 int)) +(defmethod enemy-method-46 flamer ((this flamer) (arg0 int)) "@abstract" (let ((v1-0 arg0)) (cond ((= v1-0 1) - (let ((v1-2 (-> obj root root-prim))) + (let ((v1-2 (-> this root root-prim))) (let ((a0-1 v1-2)) (set! (-> a0-1 prim-core action) (collide-action solid deadly)) (set! (-> a0-1 prim-core collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list)) @@ -1234,7 +1234,7 @@ ) ) ((or (= v1-0 2) (zero? v1-0)) - (let ((v1-8 (-> obj root root-prim))) + (let ((v1-8 (-> this root root-prim))) (let ((a0-3 v1-8)) (set! (-> a0-3 prim-core action) (collide-action semi-solid deadly)) (set! (-> a0-3 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1254,8 +1254,8 @@ ;; definition for method 77 of type flamer ;; WARN: Return type mismatch object vs symbol. ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 flamer ((obj flamer) (arg0 (pointer float))) - (let ((v1-0 (-> obj incoming knocked-type))) +(defmethod enemy-method-77 flamer ((this flamer) (arg0 (pointer float))) + (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol (cond @@ -1265,21 +1265,21 @@ (s4-0 (new 'static 'array uint64 3 #x12 #x13 #x14)) (s3-0 (new 'static 'array int32 4 0 0 0 0)) (a2-0 (ash 1 (-> s3-0 0))) - (v1-6 (enemy-method-120 obj a1-3 a2-0)) - (s4-1 (-> obj draw art-group data (-> (the-as (pointer int32) (+ (* v1-6 8) (the-as int s4-0)))))) + (v1-6 (enemy-method-120 this a1-3 a2-0)) + (s4-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-6 8) (the-as int s4-0)))))) ) (set! (-> s3-0 0) v1-6) - (let ((v1-9 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-9 (= v1-9 (-> obj draw art-group data 16))) + (if (and v1-9 (= v1-9 (-> this draw art-group data 16))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-17 (-> obj skel root-channel 0))) + (let ((a0-17 (-> this skel root-channel 0))) (set! (-> a0-17 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-17 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-17 param 1) (-> arg0 0)) @@ -1290,8 +1290,8 @@ ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-10 (-> obj draw art-group data (-> obj enemy-info knocked-anim))) - (a0-21 (-> obj skel root-channel 0)) + (let ((a1-10 (-> this draw art-group data (-> this enemy-info knocked-anim))) + (a0-21 (-> this skel root-channel 0)) ) (set! (-> a0-21 frame-group) (the-as art-joint-anim a1-10)) (set! (-> a0-21 param 0) (the float (+ (-> (the-as art-joint-anim a1-10) frames num-frames) -1))) @@ -1337,7 +1337,7 @@ ) (when (and (nonzero? (-> self hit-points)) (zero? (-> self fated-time)) - (or (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (or (time-elapsed? (-> self state-time) (seconds 0.5)) (and (< (-> self root trans y) (+ 18432.0 (-> self root gspot-pos y))) (< (-> self root transv y) 0.0)) ) ) @@ -1386,23 +1386,23 @@ ) ;; definition for method 132 of type flamer -(defmethod dispose! flamer ((obj flamer)) +(defmethod dispose! flamer ((this flamer)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (let ((s5-1 (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags)))) + (let ((s5-1 (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags)))) (let ((t9-0 (method-of-type nav-enemy dispose!))) - (t9-0 obj) + (t9-0 this) ) (if (not s5-1) - (flamer-method-190 obj) + (flamer-method-190 this) ) ) (none) ) ;; definition for method 186 of type flamer -(defmethod flamer-method-186 flamer ((obj flamer) (arg0 float)) - (let ((f0-1 (* (-> obj scale) arg0)) - (v0-0 (-> obj root scale)) +(defmethod flamer-method-186 flamer ((this flamer) (arg0 float)) + (let ((f0-1 (* (-> this scale) arg0)) + (v0-0 (-> this root scale)) ) (set! (-> v0-0 x) f0-1) (set! (-> v0-0 y) f0-1) @@ -1413,16 +1413,16 @@ ) ;; definition for method 60 of type flamer -(defmethod coin-flip? flamer ((obj flamer)) +(defmethod coin-flip? flamer ((this flamer)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 114 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! flamer ((obj flamer)) +(defmethod init-enemy-collision! flamer ((this flamer)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1489,7 +1489,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1497,101 +1497,101 @@ ;; definition for method 7 of type flamer ;; WARN: Return type mismatch process-drawable vs flamer. -(defmethod relocate flamer ((obj flamer) (arg0 int)) - (if (nonzero? (-> obj flit-joint)) - (&+! (-> obj flit-joint) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method flamer 7)) this arg0) ) ) ;; definition for method 115 of type flamer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! flamer ((obj flamer)) +(defmethod init-enemy! flamer ((this flamer)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flamer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *flamer-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj scale) 1.6) - (flamer-method-186 obj 1.0) - (logclear! (-> obj nav flags) (nav-control-flag limit-rotation-rate)) - (set! (-> obj sync-off) (the-as uint (get-rand-int obj 600))) - (set! (-> obj flit-angle) 0.0) - (set! (-> obj flit-timer) 0) - (set! (-> obj root dynam gravity y) 225280.0) - (set! (-> obj root dynam gravity-length) 225280.0) - (set! (-> obj root dynam gravity-max) 225280.0) - (let ((v1-25 (-> obj root trans))) - (set! (-> obj base-pos quad) (-> v1-25 quad)) + (init-enemy-behaviour-and-stats! this *flamer-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this scale) 1.6) + (flamer-method-186 this 1.0) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate)) + (set! (-> this sync-off) (the-as uint (get-rand-int this 600))) + (set! (-> this flit-angle) 0.0) + (set! (-> this flit-timer) 0) + (set! (-> this root dynam gravity y) 225280.0) + (set! (-> this root dynam gravity-length) 225280.0) + (set! (-> this root dynam gravity-max) 225280.0) + (let ((v1-25 (-> this root trans))) + (set! (-> this base-pos quad) (-> v1-25 quad)) (+! (-> v1-25 y) 22528.0) - (set! (-> obj idle-pos quad) (-> v1-25 quad)) + (set! (-> this idle-pos quad) (-> v1-25 quad)) ) - (set! (-> obj flit-joint) (the-as joint-mod (new 'process 'joint-mod-set-local obj 3 #t #f #f))) - (set! (-> obj flit-joint twist-min-y) (the-as float #t)) - (let ((f0-7 (res-lump-float (-> obj entity) 'rotoffset))) + (set! (-> this flit-joint) (the-as joint-mod (new 'process 'joint-mod-set-local this 3 #t #f #f))) + (set! (-> this flit-joint twist-min-y) (the-as float #t)) + (let ((f0-7 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-7 0.0) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) f0-7) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-7) ) ) - (let ((f0-8 (quaternion-y-angle (-> obj root quat)))) - (matrix-rotate-y! (-> obj zone-to-world) f0-8) + (let ((f0-8 (quaternion-y-angle (-> this root quat)))) + (matrix-rotate-y! (-> this zone-to-world) f0-8) ) - (set! (-> obj zone-to-world trans quad) (-> obj root trans quad)) - (matrix-inverse-of-rot-trans! (-> obj world-to-zone) (-> obj zone-to-world)) - (set! (-> obj formation-entity) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set-vector! (-> obj offset) 0.0 0.0 94208.0 1.0) - (set! (-> obj path) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (set! (-> obj path-pos) 0.0) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "flamer-loop" :fo-max 80) (-> obj root trans)) + (set! (-> this zone-to-world trans quad) (-> this root trans quad)) + (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) + (set! (-> this formation-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set-vector! (-> this offset) 0.0 0.0 94208.0 1.0) + (set! (-> this path) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (set! (-> this path-pos) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "flamer-loop" :fo-max 80) (-> this root trans)) ) - (logior! (-> obj enemy-flags) (enemy-flag multi-focus)) - (let ((v1-45 (-> obj nav))) + (logior! (-> this enemy-flags) (enemy-flag multi-focus)) + (let ((v1-45 (-> this nav))) (set! (-> v1-45 sphere-mask) (the-as uint 0)) ) 0 - (let ((v1-47 (-> obj nav))) + (let ((v1-47 (-> this nav))) (set! (-> v1-47 nearest-y-threshold) 63488.0) ) 0 - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) + (quaternion-copy! (-> this init-quat) (-> this root quat)) (add-connection *part-engine* - obj + this 19 - obj + this 318 (new 'static 'vector :x 819.2 :y -1187.84 :z 2088.96 :w 163840.0) ) (add-connection *part-engine* - obj + this 19 - obj + this 318 (new 'static 'vector :x -819.2 :y -1187.84 :z 2088.96 :w 163840.0) ) - (add-connection *part-engine* obj 9 obj 768 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 9 this 768 (new 'static 'vector :w 163840.0)) 0 (none) ) ;; definition for method 116 of type flamer ;; WARN: Return type mismatch int vs none. -(defmethod go-idle flamer ((obj flamer)) - (if (-> obj formation-entity) - (go (method-of-object obj wait-for-formation)) - (go (method-of-object obj idle)) +(defmethod go-idle flamer ((this flamer)) + (if (-> this formation-entity) + (go (method-of-object this wait-for-formation)) + (go (method-of-object this idle)) ) 0 (none) 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 e66be0f393..7afa1b734c 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 @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type hover-enemy-battle-command -(defmethod inspect hover-enemy-battle-command ((obj hover-enemy-battle-command)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-enemy-battle-command ((this hover-enemy-battle-command)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hover-enemy-battle-command) - (format #t "~1Tcommand: ~A~%" (-> obj command)) - (format #t "~1Twave: ~D~%" (-> obj wave)) - (format #t "~1Ttime: ~D~%" (-> obj time)) - (format #t "~1Talive-count: ~D~%" (-> obj alive-count)) + (format #t "[~8x] ~A~%" this 'hover-enemy-battle-command) + (format #t "~1Tcommand: ~A~%" (-> this command)) + (format #t "~1Twave: ~D~%" (-> this wave)) + (format #t "~1Ttime: ~D~%" (-> this time)) + (format #t "~1Talive-count: ~D~%" (-> this alive-count)) (label cfg-4) - obj + this ) ;; definition of type hover-enemy-manager @@ -54,28 +54,28 @@ ) ;; definition for method 3 of type hover-enemy-manager -(defmethod inspect hover-enemy-manager ((obj hover-enemy-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-enemy-manager ((this hover-enemy-manager)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcommand-table: ~A~%" (-> obj command-table)) - (format #t "~2Tpath: ~A~%" (-> obj path)) - (format #t "~2Tformation: ~A~%" (-> obj formation)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tcommand-table: ~A~%" (-> this command-table)) + (format #t "~2Tpath: ~A~%" (-> this path)) + (format #t "~2Tformation: ~A~%" (-> this formation)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Ttotal-to-spawn: ~D~%" (-> obj total-to-spawn)) - (format #t "~2Tnum-spawned: ~D~%" (-> obj num-spawned)) - (format #t "~2Talive-count: ~D~%" (-> obj alive-count)) - (format #t "~2Tformation-timer: ~D~%" (-> obj formation-timer)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Ttotal-to-spawn: ~D~%" (-> this total-to-spawn)) + (format #t "~2Tnum-spawned: ~D~%" (-> this num-spawned)) + (format #t "~2Talive-count: ~D~%" (-> this alive-count)) + (format #t "~2Tformation-timer: ~D~%" (-> this formation-timer)) (label cfg-7) - obj + this ) ;; definition for function hover-enemy-manager-handler @@ -161,9 +161,9 @@ a0-0 ) ) - (when (and (logtest? (-> gp-0 flags) 2) (>= (- (current-time) (-> self formation-timer)) (seconds 0.2))) + (when (and (logtest? (-> gp-0 flags) 2) (time-elapsed? (-> self formation-timer) (seconds 0.2))) (hover-formation-control-method-11 gp-0) - (set! (-> self formation-timer) (current-time)) + (set-time! (-> self formation-timer)) ) ) ) @@ -221,7 +221,7 @@ ) ) (let ((s4-0 (current-time))) - (until (>= (- (current-time) s4-0) (-> gp-0 s5-0 time)) + (until (time-elapsed? s4-0 (-> gp-0 s5-0 time)) (suspend) ) ) @@ -231,7 +231,7 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 2)) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) @@ -255,10 +255,10 @@ ;; definition for method 18 of type hover-enemy-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-enemy hover-enemy-manager ((obj hover-enemy-manager) (arg0 uint)) - (when (< arg0 (the-as uint (-> obj actor-group-count))) - (dotimes (s4-0 (-> obj actor-group arg0 length)) - (let* ((s1-0 (-> obj actor-group arg0 data s4-0 actor)) +(defmethod spawn-enemy hover-enemy-manager ((this hover-enemy-manager) (arg0 uint)) + (when (< arg0 (the-as uint (-> this actor-group-count))) + (dotimes (s4-0 (-> this actor-group arg0 length)) + (let* ((s1-0 (-> this actor-group arg0 data s4-0 actor)) (s2-0 (-> (the-as entity-actor s1-0) etype)) (s3-0 (new 'stack-no-clear 'transformq)) ) @@ -270,13 +270,13 @@ (let ((s1-1 (get-process *default-dead-pool* s2-0 #x4000))) (when (when s1-1 (let ((t9-2 (method-of-type process activate))) - (t9-2 s1-1 obj (symbol->string (-> s2-0 symbol)) (the-as pointer #x70004000)) + (t9-2 s1-1 this (symbol->string (-> s2-0 symbol)) (the-as pointer #x70004000)) ) - (run-now-in-process s1-1 enemy-init-by-other obj s3-0) + (run-now-in-process s1-1 enemy-init-by-other this s3-0) (-> s1-1 ppointer) ) - (+! (-> obj alive-count) 1) - (+! (-> obj num-spawned) 1) + (+! (-> this alive-count) 1) + (+! (-> this num-spawned) 1) ) ) ) @@ -288,58 +288,58 @@ ;; definition for method 7 of type hover-enemy-manager ;; WARN: Return type mismatch process vs hover-enemy-manager. -(defmethod relocate hover-enemy-manager ((obj hover-enemy-manager) (arg0 int)) - (when (-> obj formation) - (if (nonzero? (-> obj formation)) - (&+! (-> obj formation) arg0) +(defmethod relocate hover-enemy-manager ((this hover-enemy-manager) (arg0 int)) + (when (-> this formation) + (if (nonzero? (-> this formation)) + (&+! (-> this formation) arg0) ) ) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) + (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)) obj arg0) + ((the-as (function process int process) (find-parent-method hover-enemy-manager 7)) this arg0) ) ) ;; definition for method 17 of type hover-enemy-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-manager-init! hover-enemy-manager ((obj hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) +(defmethod hover-enemy-manager-init! hover-enemy-manager ((this hover-enemy-manager) (arg0 (array hover-enemy-battle-command))) "Initialize this [[hover-enemy-manager]]." (local-vars (sv-16 res-tag)) - (set! (-> obj command-table) arg0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (-> obj entity) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this command-table) arg0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-5 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-5 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-5 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-5)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-5)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj total-to-spawn) 0) - (set! (-> obj num-spawned) 0) - (when (-> obj command-table) - (let ((v1-13 (-> obj command-table))) + (set! (-> this total-to-spawn) 0) + (set! (-> this num-spawned) 0) + (when (-> this command-table) + (let ((v1-13 (-> this command-table))) (dotimes (a0-6 (-> v1-13 length)) (if (= (-> v1-13 a0-6 command) 'spawn) - (+! (-> obj total-to-spawn) (-> obj actor-group (-> v1-13 a0-6 wave) length)) + (+! (-> this total-to-spawn) (-> this actor-group (-> v1-13 a0-6 wave) length)) ) ) ) ) - (set! (-> obj formation) #f) - (set! (-> obj formation-timer) (current-time)) - (set! (-> obj alive-count) 0) + (set! (-> this formation) #f) + (set-time! (-> this formation-timer)) + (set! (-> this alive-count) 0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-h_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-h_REF.gc index 1b8476b462..f93c7ce82b 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-enemy-h_REF.gc @@ -21,25 +21,25 @@ ) ;; definition for method 3 of type hover-enemy-info -(defmethod inspect hover-enemy-info ((obj hover-enemy-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-enemy-info ((this hover-enemy-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hover-enemy-info) - (format #t "~1Tfly-forward-anim: ~D~%" (-> obj fly-forward-anim)) - (format #t "~1Tfly-backward-anim: ~D~%" (-> obj fly-backward-anim)) - (format #t "~1Tfly-left-anim: ~D~%" (-> obj fly-left-anim)) - (format #t "~1Tfly-right-anim: ~D~%" (-> obj fly-right-anim)) - (format #t "~1Tshoot-anim: ~D~%" (-> obj shoot-anim)) - (format #t "~1Tmain-joint: ~D~%" (-> obj main-joint)) - (format #t "~1Tgun-base: ~D~%" (-> obj gun-base)) - (format #t "~1Tengine-left: ~D~%" (-> obj engine-left)) - (format #t "~1Tengine-right: ~D~%" (-> obj engine-right)) - (format #t "~1Tthrust-rotate-left: ~f~%" (-> obj thrust-rotate-left)) - (format #t "~1Tthrust-rotate-right: ~f~%" (-> obj thrust-rotate-right)) + (format #t "[~8x] ~A~%" this 'hover-enemy-info) + (format #t "~1Tfly-forward-anim: ~D~%" (-> this fly-forward-anim)) + (format #t "~1Tfly-backward-anim: ~D~%" (-> this fly-backward-anim)) + (format #t "~1Tfly-left-anim: ~D~%" (-> this fly-left-anim)) + (format #t "~1Tfly-right-anim: ~D~%" (-> this fly-right-anim)) + (format #t "~1Tshoot-anim: ~D~%" (-> this shoot-anim)) + (format #t "~1Tmain-joint: ~D~%" (-> this main-joint)) + (format #t "~1Tgun-base: ~D~%" (-> this gun-base)) + (format #t "~1Tengine-left: ~D~%" (-> this engine-left)) + (format #t "~1Tengine-right: ~D~%" (-> this engine-right)) + (format #t "~1Tthrust-rotate-left: ~f~%" (-> this thrust-rotate-left)) + (format #t "~1Tthrust-rotate-right: ~f~%" (-> this thrust-rotate-right)) (label cfg-4) - obj + this ) ;; definition of type hover-enemy @@ -99,42 +99,42 @@ ) ;; definition for method 3 of type hover-enemy -(defmethod inspect hover-enemy ((obj hover-enemy)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-enemy ((this hover-enemy)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thover: ~A~%" (-> obj hover)) - (format #t "~2Thover-info: #~%" (-> obj hover-info)) - (format #t "~2Tformation-entity: ~A~%" (-> obj formation-entity)) - (format #t "~2Tfly-anim-speed: ~f~%" (-> obj fly-anim-speed)) - (format #t "~2Trestart-fly-anims: ~A~%" (-> obj restart-fly-anims)) - (format #t "~2Tmain-joint-acc: #~%" (-> obj main-joint-acc)) - (format #t "~2Tmain-joint-vel: #~%" (-> obj main-joint-vel)) - (format #t "~2Tmain-joint-pos: #~%" (-> obj main-joint-pos)) - (format #t "~2Tthrust[2] @ #x~X~%" (-> obj thrust)) - (format #t "~2Trotation-vec: #~%" (-> obj rotation-vec)) - (format #t "~2Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~2Toffset: #~%" (-> obj offset)) - (format #t "~2Tsurface-normal: #~%" (-> obj surface-normal)) - (format #t "~2Tlocal-dir: #~%" (-> obj local-dir)) - (format #t "~2Tscale: ~f~%" (-> obj scale)) - (format #t "~2Tscale-timer: ~D~%" (-> obj scale-timer)) - (format #t "~2Thit-surface?: ~A~%" (-> obj hit-surface?)) - (format #t "~2Tknocked-start-level: ~f~%" (-> obj knocked-start-level)) - (format #t "~2Tknocked-fall-dist: ~f~%" (-> obj knocked-fall-dist)) - (format #t "~2Tflying-death-anim: ~D~%" (-> obj flying-death-anim)) - (format #t "~2Tflying-death-transv: #~%" (-> obj flying-death-transv)) - (format #t "~2Tflying-death-engine: ~D~%" (-> obj flying-death-engine)) - (format #t "~2Tflying-death-thrust-rotate: ~f~%" (-> obj flying-death-thrust-rotate)) - (format #t "~2Tflying-death-spin: ~f~%" (-> obj flying-death-spin)) - (format #t "~2Tflying-death-spin-dest: ~f~%" (-> obj flying-death-spin-dest)) - (format #t "~2Tflying-death-spin-axis: #~%" (-> obj flying-death-spin-axis)) + (format #t "~2Thover: ~A~%" (-> this hover)) + (format #t "~2Thover-info: #~%" (-> this hover-info)) + (format #t "~2Tformation-entity: ~A~%" (-> this formation-entity)) + (format #t "~2Tfly-anim-speed: ~f~%" (-> this fly-anim-speed)) + (format #t "~2Trestart-fly-anims: ~A~%" (-> this restart-fly-anims)) + (format #t "~2Tmain-joint-acc: #~%" (-> this main-joint-acc)) + (format #t "~2Tmain-joint-vel: #~%" (-> this main-joint-vel)) + (format #t "~2Tmain-joint-pos: #~%" (-> this main-joint-pos)) + (format #t "~2Tthrust[2] @ #x~X~%" (-> this thrust)) + (format #t "~2Trotation-vec: #~%" (-> this rotation-vec)) + (format #t "~2Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~2Toffset: #~%" (-> this offset)) + (format #t "~2Tsurface-normal: #~%" (-> this surface-normal)) + (format #t "~2Tlocal-dir: #~%" (-> this local-dir)) + (format #t "~2Tscale: ~f~%" (-> this scale)) + (format #t "~2Tscale-timer: ~D~%" (-> this scale-timer)) + (format #t "~2Thit-surface?: ~A~%" (-> this hit-surface?)) + (format #t "~2Tknocked-start-level: ~f~%" (-> this knocked-start-level)) + (format #t "~2Tknocked-fall-dist: ~f~%" (-> this knocked-fall-dist)) + (format #t "~2Tflying-death-anim: ~D~%" (-> this flying-death-anim)) + (format #t "~2Tflying-death-transv: #~%" (-> this flying-death-transv)) + (format #t "~2Tflying-death-engine: ~D~%" (-> this flying-death-engine)) + (format #t "~2Tflying-death-thrust-rotate: ~f~%" (-> this flying-death-thrust-rotate)) + (format #t "~2Tflying-death-spin: ~f~%" (-> this flying-death-spin)) + (format #t "~2Tflying-death-spin-dest: ~f~%" (-> this flying-death-spin-dest)) + (format #t "~2Tflying-death-spin-axis: #~%" (-> this flying-death-spin-axis)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 3a783dd857..78e22e96a9 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 @@ -3,7 +3,7 @@ ;; definition for method 74 of type hover-enemy ;; INFO: Used lq/sq -(defmethod general-event-handler hover-enemy ((obj hover-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler hover-enemy ((this hover-enemy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-41 float)) @@ -15,28 +15,28 @@ (init-vf0-vector) (case arg2 (('hit 'hit-knocked 'hit-flinch) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (if (rng-hit? obj 0.4) - (go (method-of-object obj flying-death)) - (go (method-of-object obj flying-death-explode)) + ((zero? (-> this hit-points)) + (if (rng-hit? this 0.4) + (go (method-of-object this flying-death)) + (go (method-of-object this flying-death-explode)) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t @@ -46,7 +46,7 @@ (let* ((f0-0 409.6) (f0-2 (* f0-0 f0-0)) ) - (.lvf vf1 (&-> (vector-! (new 'stack-no-clear 'vector) (the-as vector s5-1) (-> obj offset)) quad)) + (.lvf vf1 (&-> (vector-! (new 'stack-no-clear 'vector) (the-as vector s5-1) (-> this offset)) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) (.mul.x.vf acc vf2 vf1 :mask #b1) @@ -54,30 +54,30 @@ (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov v1-41 vf1) (if (< f0-2 v1-41) - (hover-nav-control-method-21 (-> obj hover)) + (hover-nav-control-method-21 (-> this hover)) ) ) - (let ((v0-7 (the-as object (-> obj offset)))) + (let ((v0-7 (the-as object (-> this offset)))) (set! (-> (the-as vector v0-7) quad) (-> (the-as vector s5-1) quad)) v0-7 ) ) ) (('get-hover-nav-sphere) - (if (not (and (-> obj next-state) (let ((v1-49 (-> obj next-state name))) - (or (= v1-49 'dormant) (= v1-49 'dormant-aware)) - ) + (if (not (and (-> this next-state) (let ((v1-49 (-> this next-state name))) + (or (= v1-49 'dormant) (= v1-49 'dormant-aware)) + ) ) ) - (-> (the-as collide-shape-prim-group (-> obj root root-prim)) + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child - (-> obj hover params nav-collide-prim-index) + (-> this hover params nav-collide-prim-index) prim-core ) ) ) (else - ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -206,15 +206,15 @@ ;; definition for method 142 of type hover-enemy ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-142 hover-enemy ((obj hover-enemy)) +(defmethod hover-enemy-method-142 hover-enemy ((this hover-enemy)) 0 (none) ) ;; definition for method 153 of type hover-enemy ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-153 hover-enemy ((obj hover-enemy)) - (let* ((v1-0 (-> obj formation-entity)) +(defmethod hover-enemy-method-153 hover-enemy ((this hover-enemy)) + (let* ((v1-0 (-> this formation-entity)) (a0-1 (if v1-0 (-> v1-0 extra process) ) @@ -230,8 +230,8 @@ ;; definition for method 154 of type hover-enemy ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-154 hover-enemy ((obj hover-enemy)) - (let* ((v1-0 (-> obj formation-entity)) +(defmethod hover-enemy-method-154 hover-enemy ((this hover-enemy)) + (let* ((v1-0 (-> this formation-entity)) (a0-1 (if v1-0 (-> v1-0 extra process) ) @@ -246,7 +246,7 @@ ) ;; definition for method 60 of type hover-enemy -(defmethod coin-flip? hover-enemy ((obj hover-enemy)) +(defmethod coin-flip? hover-enemy ((this hover-enemy)) "@returns The result of a 50/50 RNG roll" #f ) @@ -254,34 +254,34 @@ ;; definition for method 144 of type hover-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-144 hover-enemy ((obj hover-enemy)) - (set! (-> obj main-joint-pos quad) (-> obj root trans quad)) - (set! (-> obj main-joint-vel quad) (the-as uint128 0)) - (set! (-> obj main-joint-acc quad) (the-as uint128 0)) - (set! (-> obj thrust 0) 0.0) - (set! (-> obj thrust 1) 0.0) +(defmethod hover-enemy-method-144 hover-enemy ((this hover-enemy)) + (set! (-> this main-joint-pos quad) (-> this root trans quad)) + (set! (-> this main-joint-vel quad) (the-as uint128 0)) + (set! (-> this main-joint-acc quad) (the-as uint128 0)) + (set! (-> this thrust 0) 0.0) + (set! (-> this thrust 1) 0.0) 0 (none) ) ;; definition for method 145 of type hover-enemy ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-145 hover-enemy ((obj hover-enemy) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod hover-enemy-method-145 hover-enemy ((this hover-enemy) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) (set! v1-1 arg2) (set! v1-1 arg3) ) - (let ((a3-5 (-> obj skel root-channel arg0))) + (let ((a3-5 (-> this skel root-channel arg0))) (let ((f0-2 (fabs arg1))) (set! (-> a3-5 frame-interp 1) f0-2) (set! (-> a3-5 frame-interp 0) f0-2) ) - (set! (-> a3-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data v1-1))) + (set! (-> a3-5 frame-group) (the-as art-joint-anim (-> this draw art-group data v1-1))) (set! (-> a3-5 param 0) 0.0) - (set! (-> a3-5 frame-num) (-> obj skel root-channel 0 frame-num)) - (joint-control-channel-group! a3-5 (the-as art-joint-anim (-> obj draw art-group data v1-1)) num-func-chan) + (set! (-> a3-5 frame-num) (-> this skel root-channel 0 frame-num)) + (joint-control-channel-group! a3-5 (the-as art-joint-anim (-> this draw art-group data v1-1)) num-func-chan) ) (none) ) @@ -289,14 +289,14 @@ ;; definition for method 129 of type hover-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod enemy-method-129 hover-enemy ((obj hover-enemy)) +(defmethod enemy-method-129 hover-enemy ((this hover-enemy)) (local-vars (s5-0 vector)) (let ((t9-0 (method-of-type enemy enemy-method-129))) - (t9-0 obj) + (t9-0 this) ) - (let ((a0-3 (handle->process (-> obj focus handle)))) + (let ((a0-3 (handle->process (-> this focus handle)))) (set! s5-0 (when a0-3 - (set! s5-0 (-> obj focus-pos)) + (set! s5-0 (-> this focus-pos)) (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-3) 3) quad)) s5-0 ) @@ -306,38 +306,38 @@ ) ;; definition for method 55 of type hover-enemy -(defmethod track-target! hover-enemy ((obj hover-enemy)) +(defmethod track-target! hover-enemy ((this hover-enemy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (hover-enemy-method-148 obj) - (enemy-method-129 obj) + (hover-enemy-method-148 this) + (enemy-method-129 this) (let ((t9-2 (method-of-type enemy track-target!))) - (t9-2 obj) + (t9-2 this) ) - (hover-nav-control-method-13 (-> obj hover)) + (hover-nav-control-method-13 (-> this hover)) (none) ) ;; definition for method 148 of type hover-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-148 hover-enemy ((obj hover-enemy)) +(defmethod hover-enemy-method-148 hover-enemy ((this hover-enemy)) (cond - ((and (-> obj draw shadow) (logtest? (-> obj draw status) (draw-control-status on-screen))) + ((and (-> this draw shadow) (logtest? (-> this draw status) (draw-control-status on-screen))) (new 'stack-no-clear 'vector) (new 'stack-no-clear 'vector) (let ((s4-0 (new 'stack-no-clear 'collide-query)) - (gp-0 (-> obj draw shadow-ctrl settings shadow-dir)) + (gp-0 (-> this draw shadow-ctrl settings shadow-dir)) (f30-0 122880.0) ) - (set! (-> s4-0 start-pos quad) (-> obj root trans quad)) + (set! (-> s4-0 start-pos quad) (-> this root trans quad)) (vector-normalize-copy! (-> s4-0 move-dist) gp-0 f30-0) (let ((v1-10 s4-0)) (set! (-> v1-10 radius) 2048.0) (set! (-> v1-10 collide-with) (collide-spec backgnd)) - (set! (-> v1-10 ignore-process0) obj) + (set! (-> v1-10 ignore-process0) this) (set! (-> v1-10 ignore-process1) #f) (set! (-> v1-10 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-10 action-mask) (collide-action solid)) @@ -345,16 +345,16 @@ (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) (cond ((>= f0-1 0.0) - (let ((v1-14 (-> obj draw shadow-ctrl))) + (let ((v1-14 (-> this draw shadow-ctrl))) (logclear! (-> v1-14 settings flags) (shadow-flags disable-draw)) ) 0 (-> s4-0 best-other-tri intersect) - (let ((a1-3 (-> obj root trans))) + (let ((a1-3 (-> this root trans))) (-> a1-3 y) (let ((f0-2 (* f0-1 f30-0))) (shadow-control-method-14 - (-> obj draw shadow-ctrl) + (-> this draw shadow-ctrl) a1-3 gp-0 (- (+ 81920.0 f30-0)) @@ -365,7 +365,7 @@ ) ) (else - (let ((v1-25 (-> obj draw shadow-ctrl))) + (let ((v1-25 (-> this draw shadow-ctrl))) (logior! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 @@ -375,7 +375,7 @@ ) ) (else - (let ((v1-28 (-> obj draw shadow-ctrl))) + (let ((v1-28 (-> this draw shadow-ctrl))) (logior! (-> v1-28 settings flags) (shadow-flags disable-draw)) ) 0 @@ -523,7 +523,7 @@ ) (hover-enemy-method-144 self) (hover-nav-control-method-18 (-> self hover) (-> self path) -1 -1) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (local-vars (v1-5 enemy-flag)) @@ -656,7 +656,7 @@ ) (if (and (nonzero? (-> self hit-points)) (zero? (-> self fated-time)) - (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) (< (-> self root trans y) (- (-> self knocked-start-level) (-> self knocked-fall-dist))) ) (go-virtual knocked-recover) @@ -716,14 +716,14 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('touch 'touched 'attack) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (go-virtual flying-death-explode) ) ) ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (dispose! self) (stop-looking-at-target! self) (logior! (-> self enemy-flags) (enemy-flag actor-pause-backup)) @@ -775,13 +775,13 @@ (set! (-> self hover speed) 0.2) (set! (-> self flying-death-spin) 0.0) (enemy-method-103 self) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (or (logtest? (-> self root status) (collide-status touch-surface touch-wall touch-ceiling touch-actor impact-surface touch-background) ) - (>= (- (current-time) (-> self state-time)) (seconds 4)) + (time-elapsed? (-> self state-time) (seconds 4)) ) (go-virtual flying-death-explode) ) @@ -857,30 +857,30 @@ ) ;; definition for method 67 of type hover-enemy -(defmethod go-stare hover-enemy ((obj hover-enemy)) - (go-hostile obj) +(defmethod go-stare hover-enemy ((this hover-enemy)) + (go-hostile this) ) ;; definition for method 68 of type hover-enemy -(defmethod go-stare2 hover-enemy ((obj hover-enemy)) - (go-hostile obj) +(defmethod go-stare2 hover-enemy ((this hover-enemy)) + (go-hostile this) ) ;; definition for method 146 of type hover-enemy ;; WARN: Return type mismatch quaternion vs none. -(defmethod hover-enemy-method-146 hover-enemy ((obj hover-enemy)) +(defmethod hover-enemy-method-146 hover-enemy ((this hover-enemy)) (let ((gp-0 (new 'stack-no-clear 'matrix))) - (matrix-rotate-zxy! gp-0 (-> obj rotation-vec)) - (matrix->quaternion (-> obj root quat) gp-0) + (matrix-rotate-zxy! gp-0 (-> this rotation-vec)) + (matrix->quaternion (-> this root quat) gp-0) ) (none) ) ;; definition for method 147 of type hover-enemy ;; WARN: Return type mismatch float vs none. -(defmethod hover-enemy-method-147 hover-enemy ((obj hover-enemy)) - (let ((s5-0 (-> obj root quat)) - (gp-0 (-> obj rotation-vec)) +(defmethod hover-enemy-method-147 hover-enemy ((this hover-enemy)) + (let ((s5-0 (-> this root quat)) + (gp-0 (-> this rotation-vec)) ) (set! (-> gp-0 z) (quaternion-z-angle s5-0)) (set! (-> gp-0 y) (quaternion-y-angle s5-0)) @@ -891,9 +891,9 @@ ;; definition for method 140 of type hover-enemy ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-140 hover-enemy ((obj hover-enemy) (arg0 symbol)) +(defmethod hover-enemy-method-140 hover-enemy ((this hover-enemy) (arg0 symbol)) (let ((v1-0 0) - (a0-2 (-> obj root root-prim)) + (a0-2 (-> this root root-prim)) ) (if arg0 (set! v1-0 1) @@ -908,60 +908,60 @@ ;; definition for method 141 of type hover-enemy ;; WARN: Return type mismatch vector vs none. -(defmethod hover-enemy-method-141 hover-enemy ((obj hover-enemy) (arg0 float)) - (let ((f0-1 (* (-> obj scale) arg0))) - (set-vector! (-> obj root scale) (* 1.2 f0-1) (* 0.9 f0-1) f0-1 1.0) +(defmethod hover-enemy-method-141 hover-enemy ((this hover-enemy) (arg0 float)) + (let ((f0-1 (* (-> this scale) arg0))) + (set-vector! (-> this root scale) (* 1.2 f0-1) (* 0.9 f0-1) f0-1 1.0) ) (none) ) ;; definition for method 132 of type hover-enemy -(defmethod dispose! hover-enemy ((obj hover-enemy)) +(defmethod dispose! hover-enemy ((this hover-enemy)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" - (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) - (process-entity-status! obj (entity-perm-status subtask-complete) #t) - (send-event (ppointer->process (-> obj parent)) 'hover-die) - (hover-enemy-method-154 obj) - ((method-of-type enemy dispose!) obj) + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) + (process-entity-status! this (entity-perm-status subtask-complete) #t) + (send-event (ppointer->process (-> this parent)) 'hover-die) + (hover-enemy-method-154 this) + ((method-of-type enemy dispose!) this) ) (none) ) ;; definition for method 10 of type hover-enemy -(defmethod deactivate hover-enemy ((obj hover-enemy)) - (hover-nav-control-method-9 (-> obj hover)) - ((method-of-type enemy deactivate) obj) +(defmethod deactivate hover-enemy ((this hover-enemy)) + (hover-nav-control-method-9 (-> this hover)) + ((method-of-type enemy deactivate) this) (none) ) ;; definition for method 7 of type hover-enemy ;; WARN: Return type mismatch enemy vs hover-enemy. -(defmethod relocate hover-enemy ((obj hover-enemy) (arg0 int)) - (if (nonzero? (-> obj hover)) - (&+! (-> obj hover) arg0) +(defmethod relocate hover-enemy ((this hover-enemy) (arg0 int)) + (if (nonzero? (-> this hover)) + (&+! (-> this hover) arg0) ) - (the-as hover-enemy ((method-of-type enemy relocate) obj arg0)) + (the-as hover-enemy ((method-of-type enemy relocate) this arg0)) ) ;; definition for method 155 of type hover-enemy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-155 hover-enemy ((obj hover-enemy)) - (set! (-> obj hover-info) (hover-enemy-method-151 obj)) - (set! (-> obj fly-anim-speed) (get-rand-float-range obj 0.8 1.2)) - (vector-reset! (-> obj rotation-vec)) - (vector-reset! (-> obj dest-pos)) - (vector-reset! (-> obj local-dir)) - (set! (-> obj scale) 1.0) - (hover-enemy-method-141 obj 1.0) - (set! (-> obj formation-entity) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (let ((t0-0 (hover-enemy-method-152 obj))) - (set! (-> obj hover) (new 'process 'hover-nav-control obj (-> obj root) t0-0)) +(defmethod hover-enemy-method-155 hover-enemy ((this hover-enemy)) + (set! (-> this hover-info) (hover-enemy-method-151 this)) + (set! (-> this fly-anim-speed) (get-rand-float-range this 0.8 1.2)) + (vector-reset! (-> this rotation-vec)) + (vector-reset! (-> this dest-pos)) + (vector-reset! (-> this local-dir)) + (set! (-> this scale) 1.0) + (hover-enemy-method-141 this 1.0) + (set! (-> this formation-entity) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (let ((t0-0 (hover-enemy-method-152 this))) + (set! (-> this hover) (new 'process 'hover-nav-control this (-> this root) t0-0)) ) - (let ((s5-0 (-> obj offset)) + (let ((s5-0 (-> this offset)) (t9-6 (method-of-type res-lump get-property-struct)) - (a0-8 (-> obj entity)) + (a0-8 (-> this entity)) (a1-4 'trans-offset) (a2-3 'interp) (a3-1 -1000000000.0) @@ -975,8 +975,8 @@ (-> (the-as vector (t9-6 a0-8 a1-4 a2-3 a3-1 t0-1 (the-as (pointer res-tag) #f) *res-static-buf*)) quad) ) ) - (set! (-> obj restart-fly-anims) #t) - (set! (-> obj knocked-fall-dist) 8192.0) + (set! (-> this restart-fly-anims) #t) + (set! (-> this knocked-fall-dist) 8192.0) 0 (none) ) @@ -1025,39 +1025,39 @@ ) ;; definition for method 3 of type wasp -(defmethod inspect wasp ((obj wasp)) - (when (not obj) - (set! obj obj) +(defmethod inspect wasp ((this wasp)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hover-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tgun-jmod: ~A~%" (-> obj gun-jmod)) - (format #t "~2Tentity-group: ~A~%" (-> obj entity-group)) - (format #t "~2Tsmoke-part: ~A~%" (-> obj smoke-part)) - (format #t "~2Tengine-part: ~A~%" (-> obj engine-part)) - (format #t "~2Tknocked-start-level: ~f~%" (-> obj knocked-start-level)) - (format #t "~2Told-gravity: ~f~%" (-> obj old-gravity)) - (format #t "~2Tknocked-anim: ~D~%" (-> obj knocked-anim)) - (format #t "~2Tknocked-recover-anim: ~D~%" (-> obj knocked-recover-anim)) - (format #t "~2Tlast-fire-time: ~D~%" (-> obj last-fire-time)) - (format #t "~2Tbridge-index: ~D~%" (-> obj bridge-index)) - (format #t "~2Tgun-x-angle: ~f~%" (-> obj gun-x-angle)) - (format #t "~2Tgun-x-angle-final: ~f~%" (-> obj gun-x-angle-final)) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) - (format #t "~2Tpath-du-final: ~f~%" (-> obj path-du-final)) - (format #t "~2Tpath-dest: ~f~%" (-> obj path-dest)) - (format #t "~2Tplat-pos: #~%" (-> obj plat-pos)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tattack-wait-min: ~f~%" (-> obj attack-wait-min)) - (format #t "~2Tattack-wait-max: ~f~%" (-> obj attack-wait-max)) - (format #t "~2Tattack-miss-dist-min: ~f~%" (-> obj attack-miss-dist-min)) - (format #t "~2Tattack-miss-dist-max: ~f~%" (-> obj attack-miss-dist-max)) - (format #t "~2Tattack-miss-dist-curr: ~f~%" (-> obj attack-miss-dist-curr)) + (format #t "~2Tgun-jmod: ~A~%" (-> this gun-jmod)) + (format #t "~2Tentity-group: ~A~%" (-> this entity-group)) + (format #t "~2Tsmoke-part: ~A~%" (-> this smoke-part)) + (format #t "~2Tengine-part: ~A~%" (-> this engine-part)) + (format #t "~2Tknocked-start-level: ~f~%" (-> this knocked-start-level)) + (format #t "~2Told-gravity: ~f~%" (-> this old-gravity)) + (format #t "~2Tknocked-anim: ~D~%" (-> this knocked-anim)) + (format #t "~2Tknocked-recover-anim: ~D~%" (-> this knocked-recover-anim)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Tbridge-index: ~D~%" (-> this bridge-index)) + (format #t "~2Tgun-x-angle: ~f~%" (-> this gun-x-angle)) + (format #t "~2Tgun-x-angle-final: ~f~%" (-> this gun-x-angle-final)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-du: ~f~%" (-> this path-du)) + (format #t "~2Tpath-du-final: ~f~%" (-> this path-du-final)) + (format #t "~2Tpath-dest: ~f~%" (-> this path-dest)) + (format #t "~2Tplat-pos: #~%" (-> this plat-pos)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tattack-wait-min: ~f~%" (-> this attack-wait-min)) + (format #t "~2Tattack-wait-max: ~f~%" (-> this attack-wait-max)) + (format #t "~2Tattack-miss-dist-min: ~f~%" (-> this attack-miss-dist-min)) + (format #t "~2Tattack-miss-dist-max: ~f~%" (-> this attack-miss-dist-max)) + (format #t "~2Tattack-miss-dist-curr: ~f~%" (-> this attack-miss-dist-curr)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation-h_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation-h_REF.gc index 70949d5eea..a818fe9b66 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-formation-h_REF.gc @@ -19,23 +19,23 @@ ) ;; definition for method 3 of type form-search-info -(defmethod inspect form-search-info ((obj form-search-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect form-search-info ((this form-search-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'form-search-info) - (format #t "~1Tform: ~A~%" (-> obj form)) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tpos-table: #x~X~%" (-> obj pos-table)) - (format #t "~1Tactor-position[16] @ #x~X~%" (-> obj actor-position)) - (format #t "~1Tactor-valid?[16] @ #x~X~%" (-> obj actor-valid?)) - (format #t "~1Tindex-table[16] @ #x~X~%" (-> obj index-table)) - (format #t "~1Tdest-pos-table[16] @ #x~X~%" (-> obj dest-pos-table)) - (format #t "~1Tbest-mapping[16] @ #x~X~%" (-> obj best-mapping)) - (format #t "~1Tbest-cost: ~f~%" (-> obj best-cost)) + (format #t "[~8x] ~A~%" this 'form-search-info) + (format #t "~1Tform: ~A~%" (-> this form)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tpos-table: #x~X~%" (-> this pos-table)) + (format #t "~1Tactor-position[16] @ #x~X~%" (-> this actor-position)) + (format #t "~1Tactor-valid?[16] @ #x~X~%" (-> this actor-valid?)) + (format #t "~1Tindex-table[16] @ #x~X~%" (-> this index-table)) + (format #t "~1Tdest-pos-table[16] @ #x~X~%" (-> this dest-pos-table)) + (format #t "~1Tbest-mapping[16] @ #x~X~%" (-> this best-mapping)) + (format #t "~1Tbest-cost: ~f~%" (-> this best-cost)) (label cfg-4) - obj + this ) ;; definition of type hover-actor @@ -49,16 +49,16 @@ ) ;; definition for method 3 of type hover-actor -(defmethod inspect hover-actor ((obj hover-actor)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-actor ((this hover-actor)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hover-actor) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Toffset: #~%" (-> obj offset)) + (format #t "[~8x] ~A~%" this 'hover-actor) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Toffset: #~%" (-> this offset)) (label cfg-4) - obj + this ) ;; definition of type hover-formation-control @@ -98,27 +98,27 @@ ) ;; definition for method 3 of type hover-formation-control -(defmethod inspect hover-formation-control ((obj hover-formation-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-formation-control ((this hover-formation-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tsearch-info: #~%" (-> obj search-info)) - (format #t "~1Tentity: ~A~%" (-> obj entity)) - (format #t "~1Tanchor-proc: ~D~%" (-> obj anchor-proc)) - (format #t "~1Tactor-table[16] @ #x~X~%" (-> obj actor-table)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tformation-type: ~D~%" (-> obj formation-type)) - (format #t "~1Tcenter: #~%" (-> obj center)) - (format #t "~1Tzone-to-world: #~%" (-> obj zone-to-world)) - (format #t "~1Tworld-to-zone: #~%" (-> obj world-to-zone)) - (format #t "~1Toffset: #~%" (-> obj offset)) - (format #t "~1Tfocus-quat: #~%" (-> obj focus-quat)) - (format #t "~1Tnotice-dist: ~f~%" (-> obj notice-dist)) - (format #t "~1Trotation-inc: ~f~%" (-> obj rotation-inc)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tsearch-info: #~%" (-> this search-info)) + (format #t "~1Tentity: ~A~%" (-> this entity)) + (format #t "~1Tanchor-proc: ~D~%" (-> this anchor-proc)) + (format #t "~1Tactor-table[16] @ #x~X~%" (-> this actor-table)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tformation-type: ~D~%" (-> this formation-type)) + (format #t "~1Tcenter: #~%" (-> this center)) + (format #t "~1Tzone-to-world: #~%" (-> this zone-to-world)) + (format #t "~1Tworld-to-zone: #~%" (-> this world-to-zone)) + (format #t "~1Toffset: #~%" (-> this offset)) + (format #t "~1Tfocus-quat: #~%" (-> this focus-quat)) + (format #t "~1Tnotice-dist: ~f~%" (-> this notice-dist)) + (format #t "~1Trotation-inc: ~f~%" (-> this rotation-inc)) (label cfg-4) - obj + this ) ;; definition of type hover-formation @@ -138,19 +138,19 @@ ) ;; definition for method 3 of type hover-formation -(defmethod inspect hover-formation ((obj hover-formation)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-formation ((this hover-formation)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tformation: ~A~%" (-> obj formation)) - (format #t "~2Tpath: ~A~%" (-> obj path)) - (format #t "~2Tformation-timer: ~D~%" (-> obj formation-timer)) + (format #t "~2Tformation: ~A~%" (-> this formation)) + (format #t "~2Tpath: ~A~%" (-> this path)) + (format #t "~2Tformation-timer: ~D~%" (-> this formation-timer)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 b0b0acb78b..ad4381eba9 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 @@ -2,8 +2,8 @@ (in-package goal) ;; definition for method 12 of type hover-formation-control -(defmethod is-formation-type-in-range hover-formation-control ((obj hover-formation-control)) - (case (-> obj formation-type) +(defmethod is-formation-type-in-range hover-formation-control ((this hover-formation-control)) + (case (-> this formation-type) (((formation-type unknown-2) (formation-type unknown-3) (formation-type unknown-0)) #f ) @@ -14,11 +14,11 @@ ) ;; definition for method 16 of type hover-formation-control -(defmethod hover-formation-control-method-16 hover-formation-control ((obj hover-formation-control)) - (let ((gp-0 (hover-formation-control-method-13 obj (new 'stack-no-clear 'vector))) +(defmethod hover-formation-control-method-16 hover-formation-control ((this hover-formation-control)) + (let ((gp-0 (hover-formation-control-method-13 this (new 'stack-no-clear 'vector))) (s4-0 (cond - ((-> obj anchor-proc) - (let ((s3-0 (handle->process (-> obj anchor-proc)))) + ((-> this anchor-proc) + (let ((s3-0 (handle->process (-> this anchor-proc)))) (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) ) @@ -31,28 +31,28 @@ ) ) (and s4-0 - (< (vector-vector-distance gp-0 (get-trans s4-0 0)) (-> obj notice-dist)) - (or (not (logtest? (-> obj flags) 1)) (< (- (-> gp-0 y) (-> (get-trans s4-0 0) y)) 16384.0)) + (< (vector-vector-distance gp-0 (get-trans s4-0 0)) (-> this notice-dist)) + (or (not (logtest? (-> this flags) 1)) (< (- (-> gp-0 y) (-> (get-trans s4-0 0) y)) 16384.0)) ) ) ) ;; definition for method 9 of type hover-formation-control -(defmethod set-anchor-proc hover-formation-control ((obj hover-formation-control) (arg0 handle)) - (set! (-> obj anchor-proc) arg0) +(defmethod set-anchor-proc hover-formation-control ((this hover-formation-control) (arg0 handle)) + (set! (-> this anchor-proc) arg0) 0 ) ;; definition for method 13 of type hover-formation-control ;; INFO: Used lq/sq -(defmethod hover-formation-control-method-13 hover-formation-control ((obj hover-formation-control) (arg0 vector)) +(defmethod hover-formation-control-method-13 hover-formation-control ((this hover-formation-control) (arg0 vector)) (with-pp (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 0) (set! (-> a1-1 message) 'path) (let* ((t9-0 send-event-function) - (v1-2 (-> obj entity)) + (v1-2 (-> this entity)) (s5-0 (the-as path-control (t9-0 (if v1-2 (-> v1-2 extra process) @@ -62,8 +62,8 @@ ) ) (s3-0 (cond - ((-> obj anchor-proc) - (let ((s2-0 (handle->process (-> obj anchor-proc)))) + ((-> this anchor-proc) + (let ((s2-0 (handle->process (-> this anchor-proc)))) (if (type? s2-0 process-focusable) (the-as process-focusable s2-0) ) @@ -77,7 +77,7 @@ ) (cond ((not s3-0) - (set! (-> arg0 quad) (-> obj center quad)) + (set! (-> arg0 quad) (-> this center quad)) ) (s5-0 (let ((f0-0 (get-path-percentage-at-furthest-point s5-0 (get-trans s3-0 3)))) @@ -99,15 +99,15 @@ ;; definition for method 14 of type hover-formation-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-formation-control-method-14 hover-formation-control ((obj hover-formation-control)) +(defmethod hover-formation-control-method-14 hover-formation-control ((this hover-formation-control)) (with-pp - (when (not (logtest? (-> obj flags) 4)) + (when (not (logtest? (-> this flags) 4)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'path) (let* ((t9-0 send-event-function) - (v1-5 (-> obj entity)) + (v1-5 (-> this entity)) (s5-0 (the-as path-control (t9-0 (if v1-5 (-> v1-5 extra process) @@ -117,8 +117,8 @@ ) ) (a0-7 (cond - ((-> obj anchor-proc) - (let ((s4-0 (handle->process (-> obj anchor-proc)))) + ((-> this anchor-proc) + (let ((s4-0 (handle->process (-> this anchor-proc)))) (if (type? s4-0 process-focusable) (the-as process-focusable s4-0) ) @@ -138,7 +138,7 @@ (+ 0.1 (get-path-percentage-at-furthest-point s5-0 - (hover-formation-control-method-13 obj (new 'stack-no-clear 'vector)) + (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) ) ) ) @@ -146,26 +146,26 @@ ) (let ((s4-2 (new 'stack-no-clear 'vector))) (displacement-between-points-at-percent-normalized! s5-0 s4-2 f30-1) - (forward-up-nopitch->inv-matrix (-> obj zone-to-world) s4-2 *up-vector*) + (forward-up-nopitch->inv-matrix (-> this zone-to-world) s4-2 *up-vector*) ) - (set! (-> obj zone-to-world trans quad) + (set! (-> this zone-to-world trans quad) (-> (get-point-at-percent-along-path! s5-0 (new 'stack-no-clear 'vector) f30-1 'interp) quad) ) ) - (matrix-inverse-of-rot-trans! (-> obj world-to-zone) (-> obj zone-to-world)) + (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) (a0-7 (let* ((a1-11 - (quaternion-slerp! (-> obj focus-quat) (-> obj focus-quat) (get-quat a0-7 2) (* 0.8 (seconds-per-frame))) + (quaternion-slerp! (-> this focus-quat) (-> this focus-quat) (get-quat a0-7 2) (* 0.8 (seconds-per-frame))) ) (a1-12 (vector-z-quaternion! (new 'stack-no-clear 'vector) a1-11)) ) - (forward-up-nopitch->inv-matrix (-> obj zone-to-world) a1-12 *up-vector*) + (forward-up-nopitch->inv-matrix (-> this zone-to-world) a1-12 *up-vector*) ) - (set! (-> obj zone-to-world trans quad) - (-> (hover-formation-control-method-13 obj (new 'stack-no-clear 'vector)) quad) + (set! (-> this zone-to-world trans quad) + (-> (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) quad) ) - (matrix-inverse-of-rot-trans! (-> obj world-to-zone) (-> obj zone-to-world)) + (matrix-inverse-of-rot-trans! (-> this world-to-zone) (-> this zone-to-world)) ) ) ) @@ -177,14 +177,14 @@ ) ;; definition for method 15 of type hover-formation-control -(defmethod hover-formation-control-method-15 hover-formation-control ((obj hover-formation-control) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-control-method-15 hover-formation-control ((this hover-formation-control) (arg0 vector) (arg1 vector)) (vector-matrix*! arg0 - (hover-formation-control-method-13 obj (new 'stack-no-clear 'vector)) - (-> obj world-to-zone) + (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)) + (-> this world-to-zone) ) (vector+! arg0 arg0 arg1) - (vector-matrix*! arg0 arg0 (-> obj zone-to-world)) + (vector-matrix*! arg0 arg0 (-> this zone-to-world)) ) ;; definition for function odd? @@ -209,17 +209,17 @@ ) ;; definition for method 3 of type gen-perms-context -(defmethod inspect gen-perms-context ((obj gen-perms-context)) - (when (not obj) - (set! obj obj) +(defmethod inspect gen-perms-context ((this gen-perms-context)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gen-perms-context) - (format #t "~1Tnum: ~D~%" (-> obj num)) - (format #t "~1Ttable: #x~X~%" (-> obj table)) - (format #t "~1Titerate-count: ~D~%" (-> obj iterate-count)) + (format #t "[~8x] ~A~%" this 'gen-perms-context) + (format #t "~1Tnum: ~D~%" (-> this num)) + (format #t "~1Ttable: #x~X~%" (-> this table)) + (format #t "~1Titerate-count: ~D~%" (-> this iterate-count)) (label cfg-4) - obj + this ) ;; definition for function gen-perms @@ -311,13 +311,13 @@ ;; definition for method 10 of type hover-formation-control ;; INFO: Used lq/sq ;; WARN: disable def twice: 148. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod hover-formation-control-method-10 hover-formation-control ((obj hover-formation-control) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod hover-formation-control-method-10 hover-formation-control ((this hover-formation-control) (arg0 vector) (arg1 vector) (arg2 float)) (vector-rotate-y! arg0 arg1 arg2) (cond - ((logtest? (-> obj flags) 2) + ((logtest? (-> this flags) 2) (let ((s2-0 (cond - ((-> obj anchor-proc) - (let ((s4-0 (handle->process (-> obj anchor-proc)))) + ((-> this anchor-proc) + (let ((s4-0 (handle->process (-> this anchor-proc)))) (if (type? s4-0 process-focusable) (the-as process-focusable s4-0) ) @@ -328,12 +328,12 @@ ) ) ) - (s4-1 (hover-formation-control-method-15 obj (new 'stack-no-clear 'vector) arg0)) + (s4-1 (hover-formation-control-method-15 this (new 'stack-no-clear 'vector) arg0)) (s3-0 (new 'stack-no-clear 'vector)) ) (set! (-> s3-0 quad) (-> (if s2-0 (get-trans s2-0 3) - (-> obj center) + (-> this center) ) quad ) @@ -393,9 +393,9 @@ ;; definition for method 11 of type hover-formation-control ;; INFO: Used lq/sq -(defmethod hover-formation-control-method-11 hover-formation-control ((obj hover-formation-control)) - (let ((s5-0 (-> obj search-info))) - (set! (-> s5-0 form) (the-as uint obj)) +(defmethod hover-formation-control-method-11 hover-formation-control ((this hover-formation-control)) + (let ((s5-0 (-> this search-info))) + (set! (-> s5-0 form) (the-as uint this)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 16))) (dotimes (a0-1 16) (set! (-> v1-0 a0-1 quad) (the-as uint128 0)) @@ -405,7 +405,7 @@ (set! (-> s5-0 best-cost) -1.0) (set! (-> s5-0 count) 0) (dotimes (s4-0 16) - (let* ((s3-0 (handle->process (-> obj actor-table s4-0))) + (let* ((s3-0 (handle->process (-> this actor-table s4-0))) (a0-8 (if (type? s3-0 process-focusable) (the-as process-focusable s3-0) ) @@ -425,23 +425,23 @@ (set! (-> s5-0 index-table s4-0) (the-as uint s4-0)) (set! (-> s5-0 best-mapping s4-0) (the-as uint s4-0)) ) - (let* ((f30-0 (-> obj rotation-inc)) + (let* ((f30-0 (-> this rotation-inc)) (f28-0 f30-0) (s3-2 (+ (the int (/ 65536.0 f30-0)) 1)) (s4-1 0) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (when (hover-formation-control-method-10 obj s2-0 (-> obj offset) 0.0) + (when (hover-formation-control-method-10 this s2-0 (-> this offset) 0.0) (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) (+! s4-1 1) ) (let ((s1-0 0)) (while (not (or (>= s1-0 s3-2) (>= s4-1 (-> s5-0 count)))) - (when (hover-formation-control-method-10 obj s2-0 (-> obj offset) f28-0) + (when (hover-formation-control-method-10 this s2-0 (-> this offset) f28-0) (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) (+! s4-1 1) ) - (when (hover-formation-control-method-10 obj s2-0 (-> obj offset) (- f28-0)) + (when (hover-formation-control-method-10 this s2-0 (-> this offset) (- f28-0)) (set! (-> s5-0 pos-table s4-1 quad) (-> s2-0 quad)) (+! s4-1 1) ) @@ -453,7 +453,7 @@ (when (> (- (-> s5-0 count) s4-1) 0) (let ((f28-1 0.0)) (dotimes (s3-3 (- (-> s5-0 count) s4-1)) - (vector-rotate-y! (-> s5-0 pos-table s3-3) (-> obj offset) f28-1) + (vector-rotate-y! (-> s5-0 pos-table s3-3) (-> this offset) f28-1) (+! f28-1 (* (the float (+ s3-3 1)) f30-0)) (set! f30-0 (* -1.0 f30-0)) ) @@ -461,7 +461,7 @@ ) ) (dotimes (s4-2 (-> s5-0 count)) - (hover-formation-control-method-15 obj (-> s5-0 dest-pos-table s4-2) (-> s5-0 pos-table s4-2)) + (hover-formation-control-method-15 this (-> s5-0 dest-pos-table s4-2) (-> s5-0 pos-table s4-2)) ) (if (< 1 (-> s5-0 count)) (gen-perms @@ -499,7 +499,7 @@ ) (let ((s4-3 0)) (dotimes (s3-4 16) - (let ((v1-71 (-> obj actor-table s3-4))) + (let ((v1-71 (-> this actor-table s3-4))) (when v1-71 (send-event (handle->process v1-71) 'update-formation (-> s5-0 pos-table (-> s5-0 best-mapping s4-3))) (+! s4-3 1) @@ -512,17 +512,17 @@ ) ;; definition for method 17 of type hover-formation-control -(defmethod hover-formation-control-method-17 hover-formation-control ((obj hover-formation-control) (arg0 process)) +(defmethod hover-formation-control-method-17 hover-formation-control ((this hover-formation-control) (arg0 process)) (let ((v1-2 (process->handle arg0)) (a2-0 -1) (a1-4 -1) ) (dotimes (a3-0 16) - (when (= v1-2 (-> obj actor-table a3-0)) + (when (= v1-2 (-> this actor-table a3-0)) (set! a2-0 a3-0) (goto cfg-17) ) - (if (and (not (-> obj actor-table a3-0)) (= a1-4 -1)) + (if (and (not (-> this actor-table a3-0)) (= a1-4 -1)) (set! a1-4 a3-0) ) ) @@ -534,8 +534,8 @@ ) (else (when (!= a1-4 -1) - (set! (-> obj actor-table a1-4) (the-as handle v1-2)) - (hover-formation-control-method-11 obj) + (set! (-> this actor-table a1-4) (the-as handle v1-2)) + (hover-formation-control-method-11 this) ) ) ) @@ -545,12 +545,12 @@ ) ;; definition for method 18 of type hover-formation-control -(defmethod hover-formation-control-method-18 hover-formation-control ((obj hover-formation-control) (arg0 process)) +(defmethod hover-formation-control-method-18 hover-formation-control ((this hover-formation-control) (arg0 process)) (let ((v1-2 (process->handle arg0))) (dotimes (a1-4 16) - (when (= v1-2 (-> obj actor-table a1-4)) - (set! (-> obj actor-table a1-4) (the-as handle #f)) - (hover-formation-control-method-11 obj) + (when (= v1-2 (-> this actor-table a1-4)) + (set! (-> this actor-table a1-4) (the-as handle #f)) + (hover-formation-control-method-11 this) #t (goto cfg-12) ) @@ -561,10 +561,10 @@ ) ;; definition for method 19 of type hover-formation-control -(defmethod try-update-formation-type hover-formation-control ((obj hover-formation-control) (arg0 formation-type)) - (when (!= (-> obj formation-type) arg0) - (set! (-> obj formation-type) arg0) - (hover-formation-control-method-11 obj) +(defmethod try-update-formation-type hover-formation-control ((this hover-formation-control) (arg0 formation-type)) + (when (!= (-> this formation-type) arg0) + (set! (-> this formation-type) arg0) + (hover-formation-control-method-11 this) ) 0 ) @@ -669,7 +669,7 @@ (set-anchor-proc (-> self formation) (process->handle *target*)) (hover-formation-control-method-14 (-> self formation)) (when (and (logtest? (-> self formation flags) 2) - (>= (- (current-time) (the-as int (-> self formation-timer))) (seconds 0.2)) + (time-elapsed? (the-as int (-> self formation-timer)) (seconds 0.2)) ) (hover-formation-control-method-11 (-> self formation)) (set! (-> self formation-timer) (the-as uint (current-time))) @@ -682,25 +682,28 @@ ;; definition for method 7 of type hover-formation ;; WARN: Return type mismatch basic vs hover-formation. -(defmethod relocate hover-formation ((obj hover-formation) (arg0 int)) - (if (nonzero? (-> obj formation)) - (&+! (-> obj formation) arg0) +(defmethod relocate hover-formation ((this hover-formation) (arg0 int)) + (if (nonzero? (-> this formation)) + (&+! (-> this formation) arg0) ) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - (the-as hover-formation ((the-as (function basic int basic) (find-parent-method hover-formation 7)) obj arg0)) + (the-as + hover-formation + ((the-as (function basic int basic) (find-parent-method hover-formation 7)) this arg0) + ) ) ;; definition for method 15 of type hover-formation -(defmethod hover-formation-method-15 hover-formation ((obj hover-formation) (arg0 vector) (arg1 vector)) +(defmethod hover-formation-method-15 hover-formation ((this hover-formation) (arg0 vector) (arg1 vector)) 0 ) ;; definition for method 11 of type hover-formation ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hover-formation ((obj hover-formation) (arg0 entity-actor)) +(defmethod init-from-entity! hover-formation ((this hover-formation) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -708,22 +711,22 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-32 structure)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (-> obj entity) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let* ((s5-0 (method-of-type hover-formation-control new)) (s4-0 'process) (s3-0 hover-formation-control) - (s2-0 obj) - (v0-1 (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (s2-0 this) + (v0-1 (entity-actor-lookup (-> this entity) 'alt-actor 0)) (s1-0 (if v0-1 v0-1 - (-> obj entity) + (-> this entity) ) ) - (s0-0 (res-lump-float (-> obj entity) 'notice-dist :default 225280.0)) + (s0-0 (res-lump-float (-> this entity) 'notice-dist :default 225280.0)) ) (let ((t9-3 (method-of-type res-lump get-property-struct)) - (a0-5 (-> obj entity)) + (a0-5 (-> this entity)) (a1-4 'trans-offset) (a2-3 'interp) (a3-2 -1000000000.0) @@ -735,22 +738,22 @@ This commonly includes things such as: (set! (-> t0-2 w) 1.0) (set! sv-32 (t9-3 a0-5 a1-4 a2-3 a3-2 t0-2 (the-as (pointer res-tag) #f) *res-static-buf*)) ) - (let ((t2-4 (res-lump-float (-> obj entity) 'rotoffset :default 5461.3335)) + (let ((t2-4 (res-lump-float (-> this entity) 'rotoffset :default 5461.3335)) (t3-0 #f) ) - (set! (-> obj formation) (s5-0 s4-0 s3-0 s2-0 s1-0 s0-0 (the-as vector sv-32) t2-4 (the-as handle t3-0))) + (set! (-> this formation) (s5-0 s4-0 s3-0 s2-0 s1-0 s0-0 (the-as vector sv-32) t2-4 (the-as handle t3-0))) ) ) - (set! (-> obj formation-timer) (the-as uint (current-time))) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this formation-timer) (the-as uint (current-time))) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((t9-6 process-entity-status!) - (a0-9 obj) + (a0-9 this) (a1-7 8) (a2-6 #t) ) (t9-6 a0-9 (the-as entity-perm-status a1-7) a2-6) - (hover-formation-method-15 obj (the-as vector a1-7) (the-as vector a2-6)) + (hover-formation-method-15 this (the-as vector a1-7) (the-as vector a2-6)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc index 4a387e1600..3bac7318c8 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control-h_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type nav-network-adjacency -(defmethod inspect nav-network-adjacency ((obj nav-network-adjacency)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-network-adjacency ((this nav-network-adjacency)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-network-adjacency) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) + (format #t "[~8x] ~A~%" this 'nav-network-adjacency) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tdist: ~f~%" (-> this dist)) (label cfg-4) - obj + this ) ;; definition of type nav-network-adjacency-array @@ -34,17 +34,17 @@ ) ;; definition for method 3 of type nav-network-adjacency-array -(defmethod inspect nav-network-adjacency-array ((obj nav-network-adjacency-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-network-adjacency-array ((this nav-network-adjacency-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -61,16 +61,16 @@ ) ;; definition for method 3 of type list-node -(defmethod inspect list-node ((obj list-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect list-node ((this list-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'list-node) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tprev: #~%" (-> obj prev)) + (format #t "[~8x] ~A~%" this 'list-node) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) (label cfg-4) - obj + this ) ;; definition of type nav-network-path-node @@ -87,17 +87,17 @@ ) ;; definition for method 3 of type nav-network-path-node -(defmethod inspect nav-network-path-node ((obj nav-network-path-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-network-path-node ((this nav-network-path-node)) + (when (not this) + (set! this this) (goto cfg-8) ) - (format #t "[~8x] ~A~%" obj 'nav-network-path-node) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tprev: #~%" (-> obj prev)) - (format #t "~1Trow-index: ~D~%" (-> obj row-index)) - (format #t "~1Tstatus: #x~X : (net-path-node-status " (-> obj status)) - (let ((s5-0 (-> obj status))) + (format #t "[~8x] ~A~%" this 'nav-network-path-node) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) + (format #t "~1Trow-index: ~D~%" (-> this row-index)) + (format #t "~1Tstatus: #x~X : (net-path-node-status " (-> this status)) + (let ((s5-0 (-> this status))) (if (= (logand s5-0 (net-path-node-status closed)) (net-path-node-status closed)) (format #t "closed ") ) @@ -106,11 +106,11 @@ ) ) (format #t ")~%") - (format #t "~1Tparent: #~%" (-> obj parent)) - (format #t "~1Tcost-to-start: ~f~%" (-> obj cost-to-start)) - (format #t "~1Tcost-to-end: ~f~%" (-> obj cost-to-end)) + (format #t "~1Tparent: #~%" (-> this parent)) + (format #t "~1Tcost-to-start: ~f~%" (-> this cost-to-start)) + (format #t "~1Tcost-to-end: ~f~%" (-> this cost-to-end)) (label cfg-8) - obj + this ) ;; definition of type nav-network-info @@ -127,19 +127,19 @@ ) ;; definition for method 3 of type nav-network-info -(defmethod inspect nav-network-info ((obj nav-network-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-network-info ((this nav-network-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'nav-network-info) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tpath-node: #~%" (-> obj path-node)) - (format #t "~1Tcount: ~D~%" (-> obj count)) - (format #t "~1Tadjacency: #x~X~%" (-> obj adjacency)) + (format #t "[~8x] ~A~%" this 'nav-network-info) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tpath-node: #~%" (-> this path-node)) + (format #t "~1Tcount: ~D~%" (-> this count)) + (format #t "~1Tadjacency: #x~X~%" (-> this adjacency)) (label cfg-4) - obj + this ) ;; definition of type nav-network-info-array @@ -152,17 +152,17 @@ ) ;; definition for method 3 of type nav-network-info-array -(defmethod inspect nav-network-info-array ((obj nav-network-info-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-network-info-array ((this nav-network-info-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -180,19 +180,19 @@ ) ;; definition for method 3 of type hover-nav-sphere -(defmethod inspect hover-nav-sphere ((obj hover-nav-sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-nav-sphere ((this hover-nav-sphere)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hover-nav-sphere) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tprev: #~%" (-> obj prev)) - (format #t "~1Tsphere: #~%" (-> obj sphere)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Ttimer: ~D~%" (-> obj timer)) + (format #t "[~8x] ~A~%" this 'hover-nav-sphere) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) + (format #t "~1Tsphere: #~%" (-> this sphere)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Ttimer: ~D~%" (-> this timer)) (label cfg-4) - obj + this ) ;; definition of type hover-nav-path-segment @@ -211,26 +211,26 @@ ) ;; definition for method 3 of type hover-nav-path-segment -(defmethod inspect hover-nav-path-segment ((obj hover-nav-path-segment)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-nav-path-segment ((this hover-nav-path-segment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hover-nav-path-segment) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tprev: #~%" (-> obj prev)) - (format #t "~1Tcurve-matrix: #~%" (-> obj curve-matrix)) - (format #t "~1Tpos-index[2] @ #x~X~%" (-> obj pos-index)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) - (format #t "~1Tdu: ~f~%" (-> obj du)) + (format #t "[~8x] ~A~%" this 'hover-nav-path-segment) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) + (format #t "~1Tcurve-matrix: #~%" (-> this curve-matrix)) + (format #t "~1Tpos-index[2] @ #x~X~%" (-> this pos-index)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tdu: ~f~%" (-> this du)) (label cfg-4) - obj + this ) ;; definition for method 9 of type hover-nav-path-segment ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-path-segment-method-9 hover-nav-path-segment ((obj hover-nav-path-segment) (arg0 float)) - (set! (-> obj du) (/ arg0 (-> obj dist))) +(defmethod hover-nav-path-segment-method-9 hover-nav-path-segment ((this hover-nav-path-segment) (arg0 float)) + (set! (-> this du) (/ arg0 (-> this dist))) 0 (none) ) @@ -251,18 +251,18 @@ ) ;; definition for method 3 of type hover-nav-path-info -(defmethod inspect hover-nav-path-info ((obj hover-nav-path-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-nav-path-info ((this hover-nav-path-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hover-nav-path-info) - (format #t "~1Tsegment-list: #~%" (-> obj segment-list)) - (format #t "~1Ttail-segment: #~%" (-> obj tail-segment)) - (format #t "~1Tcurr-segment: #~%" (-> obj curr-segment)) - (format #t "~1Tcurr-u: ~f~%" (-> obj curr-u)) + (format #t "[~8x] ~A~%" this 'hover-nav-path-info) + (format #t "~1Tsegment-list: #~%" (-> this segment-list)) + (format #t "~1Ttail-segment: #~%" (-> this tail-segment)) + (format #t "~1Tcurr-segment: #~%" (-> this curr-segment)) + (format #t "~1Tcurr-u: ~f~%" (-> this curr-u)) (label cfg-4) - obj + this ) ;; definition of type path-index-array @@ -275,17 +275,17 @@ ) ;; definition for method 3 of type path-index-array -(defmethod inspect path-index-array ((obj path-index-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect path-index-array ((this path-index-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -338,30 +338,30 @@ ) ;; definition for method 3 of type nav-network -(defmethod inspect nav-network ((obj nav-network)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-network ((this nav-network)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tnetwork: ~A~%" (-> obj network)) - (format #t "~1Tdummy: #~%" (-> obj dummy)) - (format #t "~1Tcontrol-handle: ~D~%" (-> obj control-handle)) - (format #t "~1Tlist-table[5] @ #x~X~%" (-> obj list-table)) - (format #t "~1Topen-list: #~%" (-> obj open-list)) - (format #t "~1Tclosed-list: #~%" (-> obj closed-list)) - (format #t "~1Tsphere-list: #~%" (-> obj sphere-list)) - (format #t "~1Tfree-segment-list: #~%" (-> obj free-segment-list)) - (format #t "~1Tfree-sphere-list: #~%" (-> obj free-sphere-list)) - (format #t "~1Tsegment-pool: #x~X~%" (-> obj segment-pool)) - (format #t "~1Tsphere-pool: #x~X~%" (-> obj sphere-pool)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnetwork: ~A~%" (-> this network)) + (format #t "~1Tdummy: #~%" (-> this dummy)) + (format #t "~1Tcontrol-handle: ~D~%" (-> this control-handle)) + (format #t "~1Tlist-table[5] @ #x~X~%" (-> this list-table)) + (format #t "~1Topen-list: #~%" (-> this open-list)) + (format #t "~1Tclosed-list: #~%" (-> this closed-list)) + (format #t "~1Tsphere-list: #~%" (-> this sphere-list)) + (format #t "~1Tfree-segment-list: #~%" (-> this free-segment-list)) + (format #t "~1Tfree-sphere-list: #~%" (-> this free-sphere-list)) + (format #t "~1Tsegment-pool: #x~X~%" (-> this segment-pool)) + (format #t "~1Tsphere-pool: #x~X~%" (-> this sphere-pool)) (label cfg-4) - obj + this ) ;; definition for method 30 of type nav-network -(defmethod get-network nav-network ((obj nav-network)) - (-> obj network) +(defmethod get-network nav-network ((this nav-network)) + (-> this network) ) ;; definition of type hover-nav-params @@ -377,18 +377,18 @@ ) ;; definition for method 3 of type hover-nav-params -(defmethod inspect hover-nav-params ((obj hover-nav-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-nav-params ((this hover-nav-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hover-nav-params) - (format #t "~1Tmax-speed: ~f~%" (-> obj max-speed)) - (format #t "~1Tmax-acceleration: ~f~%" (-> obj max-acceleration)) - (format #t "~1Tfriction: ~f~%" (-> obj friction)) - (format #t "~1Tnav-collide-prim-index: ~D~%" (-> obj nav-collide-prim-index)) + (format #t "[~8x] ~A~%" this 'hover-nav-params) + (format #t "~1Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~1Tmax-acceleration: ~f~%" (-> this max-acceleration)) + (format #t "~1Tfriction: ~f~%" (-> this friction)) + (format #t "~1Tnav-collide-prim-index: ~D~%" (-> this nav-collide-prim-index)) (label cfg-4) - obj + this ) ;; definition of type hover-nav-control @@ -452,40 +452,40 @@ ) ;; definition for method 3 of type hover-nav-control -(defmethod inspect hover-nav-control ((obj hover-nav-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-nav-control ((this hover-nav-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Troot: ~A~%" (-> obj root)) - (format #t "~1Tnav: ~A~%" (-> obj nav)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tparams: #~%" (-> obj params)) - (format #t "~1Tpath-timer: ~D~%" (-> obj path-timer)) - (format #t "~1Ttransvv: #~%" (-> obj transvv)) - (format #t "~1Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~1Tdest-vel: #~%" (-> obj dest-vel)) - (format #t "~1Tdest-move-dir: #~%" (-> obj dest-move-dir)) - (format #t "~1Tdest-offset: #~%" (-> obj dest-offset)) - (format #t "~1Tmove-dir: #~%" (-> obj move-dir)) - (format #t "~1Tnav-collide-impulse: #~%" (-> obj nav-collide-impulse)) - (format #t "~1Tnav-collide-impulse-len: ~f~%" (-> obj nav-collide-impulse-len)) - (format #t "~1Tdest-speed: ~f~%" (-> obj dest-speed)) - (format #t "~1Tlocal-dist: ~f~%" (-> obj local-dist)) - (format #t "~1Tspeed: ~f~%" (-> obj speed)) - (format #t "~1Tmax-los-speed: ~f~%" (-> obj max-los-speed)) - (format #t "~1Ttarget-speed: ~f~%" (-> obj target-speed)) - (format #t "~1Ttarget-acceleration: ~f~%" (-> obj target-acceleration)) - (format #t "~1Tspeed-dest: ~f~%" (-> obj speed-dest)) - (format #t "~1Tpath-info: #~%" (-> obj path-info)) - (format #t "~1Tcurr-dest-pt: ~D~%" (-> obj curr-dest-pt)) - (format #t "~1Tlos-obstruction-distance: ~f~%" (-> obj los-obstruction-distance)) - (format #t "~1Tlos-last-clear-time: ~D~%" (-> obj los-last-clear-time)) - (format #t "~1Tmax-speed-multiplier: ~f~%" (-> obj max-speed-multiplier)) - (format #t "~1Tmax-acceleration-multiplier: ~f~%" (-> obj max-acceleration-multiplier)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Troot: ~A~%" (-> this root)) + (format #t "~1Tnav: ~A~%" (-> this nav)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tparams: #~%" (-> this params)) + (format #t "~1Tpath-timer: ~D~%" (-> this path-timer)) + (format #t "~1Ttransvv: #~%" (-> this transvv)) + (format #t "~1Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~1Tdest-vel: #~%" (-> this dest-vel)) + (format #t "~1Tdest-move-dir: #~%" (-> this dest-move-dir)) + (format #t "~1Tdest-offset: #~%" (-> this dest-offset)) + (format #t "~1Tmove-dir: #~%" (-> this move-dir)) + (format #t "~1Tnav-collide-impulse: #~%" (-> this nav-collide-impulse)) + (format #t "~1Tnav-collide-impulse-len: ~f~%" (-> this nav-collide-impulse-len)) + (format #t "~1Tdest-speed: ~f~%" (-> this dest-speed)) + (format #t "~1Tlocal-dist: ~f~%" (-> this local-dist)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Tmax-los-speed: ~f~%" (-> this max-los-speed)) + (format #t "~1Ttarget-speed: ~f~%" (-> this target-speed)) + (format #t "~1Ttarget-acceleration: ~f~%" (-> this target-acceleration)) + (format #t "~1Tspeed-dest: ~f~%" (-> this speed-dest)) + (format #t "~1Tpath-info: #~%" (-> this path-info)) + (format #t "~1Tcurr-dest-pt: ~D~%" (-> this curr-dest-pt)) + (format #t "~1Tlos-obstruction-distance: ~f~%" (-> this los-obstruction-distance)) + (format #t "~1Tlos-last-clear-time: ~D~%" (-> this los-last-clear-time)) + (format #t "~1Tmax-speed-multiplier: ~f~%" (-> this max-speed-multiplier)) + (format #t "~1Tmax-acceleration-multiplier: ~f~%" (-> this max-acceleration-multiplier)) (label cfg-4) - obj + this ) ;; definition for symbol *hover-nav-time-offset*, type int diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc index 4253c1cdeb..23a8ea0917 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-control_REF.gc @@ -18,17 +18,17 @@ ) ;; definition for method 3 of type nav-network-control -(defmethod inspect nav-network-control ((obj nav-network-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect nav-network-control ((this nav-network-control)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnav-network: ~A~%" (-> obj nav-network)) + (format #t "~2Tnav-network: ~A~%" (-> this nav-network)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -75,15 +75,15 @@ ;; definition for method 9 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-9 nav-network ((obj nav-network)) - (set! (-> obj segment-pool) (the-as (pointer hover-nav-path-segment) (malloc 'loading-level #x6000))) - (set! (-> obj free-segment-list) #f) +(defmethod nav-network-method-9 nav-network ((this nav-network)) + (set! (-> this segment-pool) (the-as (pointer hover-nav-path-segment) (malloc 'loading-level #x6000))) + (set! (-> this free-segment-list) #f) (dotimes (v1-0 256) - (let ((a0-3 (&+ (-> obj segment-pool) (* 96 v1-0)))) + (let ((a0-3 (&+ (-> this segment-pool) (* 96 v1-0)))) (set! (-> a0-3 0) #f) (set! (-> a0-3 1) #f) - (let ((a2-0 (-> obj free-segment-list)) - (a1-3 (&-> obj free-segment-list)) + (let ((a2-0 (-> this free-segment-list)) + (a1-3 (&-> this free-segment-list)) ) (when (zero? a0-3) (break!) @@ -113,14 +113,14 @@ ) ) ) - (set! (-> obj sphere-pool) (the-as (pointer hover-nav-sphere) (malloc 'loading-level 768))) - (set! (-> obj free-sphere-list) #f) + (set! (-> this sphere-pool) (the-as (pointer hover-nav-sphere) (malloc 'loading-level 768))) + (set! (-> this free-sphere-list) #f) (dotimes (v1-3 16) - (let ((a0-6 (&+ (-> obj sphere-pool) (* 48 v1-3)))) + (let ((a0-6 (&+ (-> this sphere-pool) (* 48 v1-3)))) (set! (-> a0-6 0) #f) (set! (-> a0-6 1) #f) - (let ((a2-4 (-> obj free-sphere-list)) - (a1-7 (&-> obj free-sphere-list)) + (let ((a2-4 (-> this free-sphere-list)) + (a1-7 (&-> this free-sphere-list)) ) (when (zero? a0-6) (break!) @@ -156,12 +156,12 @@ ;; definition for method 10 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-10 nav-network ((obj nav-network) (arg0 level) (arg1 (array nav-network-info))) - (set! (-> obj network) arg1) - (while (-> obj sphere-list) - (let ((v1-0 (-> obj sphere-list))) +(defmethod nav-network-method-10 nav-network ((this nav-network) (arg0 level) (arg1 (array nav-network-info))) + (set! (-> this network) arg1) + (while (-> this sphere-list) + (let ((v1-0 (-> this sphere-list))) (let ((a0-1 v1-0)) - (let ((a1-1 (&-> obj sphere-list))) + (let ((a1-1 (&-> this sphere-list))) (if (= (-> a1-1 0) a0-1) (set! (-> a1-1 0) (the-as hover-nav-sphere (-> a0-1 next))) ) @@ -175,8 +175,8 @@ (set! (-> a0-1 prev) #f) (set! (-> a0-1 next) #f) ) - (let ((a1-8 (-> obj free-sphere-list)) - (a0-3 (&-> obj free-sphere-list)) + (let ((a1-8 (-> this free-sphere-list)) + (a0-3 (&-> this free-sphere-list)) ) (when (zero? v1-0) (break!) @@ -206,9 +206,9 @@ ) ) ) - (if (not (handle->process (-> obj control-handle))) - (set! (-> obj control-handle) - (process->handle (ppointer->process (process-spawn nav-network-control obj arg0))) + (if (not (handle->process (-> this control-handle))) + (set! (-> this control-handle) + (process->handle (ppointer->process (process-spawn nav-network-control this arg0))) ) ) 0 @@ -217,10 +217,10 @@ ;; definition for method 12 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-12 nav-network ((obj nav-network)) - (set! (-> obj open-list) #f) - (set! (-> obj closed-list) #f) - (let ((v1-0 (-> obj network))) +(defmethod nav-network-method-12 nav-network ((this nav-network)) + (set! (-> this open-list) #f) + (set! (-> this closed-list) #f) + (let ((v1-0 (-> this network))) (when v1-0 (dotimes (a0-2 (-> v1-0 length)) (let ((a1-3 (-> v1-0 a0-2 path-node))) @@ -238,10 +238,10 @@ ;; definition for method 28 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-28 nav-network ((obj nav-network)) +(defmethod nav-network-method-28 nav-network ((this nav-network)) (dotimes (s5-0 2) (format #t "list ~d: ~%" s5-0) - (let ((a0-2 (-> obj list-table s5-0))) + (let ((a0-2 (-> this list-table s5-0))) (while a0-2 (let ((s4-0 (-> a0-2 next))) (inspect a0-2) @@ -256,9 +256,9 @@ ;; definition for method 29 of type nav-network ;; INFO: Used lq/sq -(defmethod nav-network-method-29 nav-network ((obj nav-network)) +(defmethod nav-network-method-29 nav-network ((this nav-network)) (when *display-nav-network* - (let ((gp-0 (-> obj network))) + (let ((gp-0 (-> this network))) (when gp-0 (dotimes (s5-0 (-> gp-0 length)) (let ((s4-0 (-> gp-0 s5-0))) @@ -293,7 +293,7 @@ ) ;; definition for method 15 of type nav-network -(defmethod nav-network-method-15 nav-network ((obj nav-network) (arg0 nav-network-path-node)) +(defmethod nav-network-method-15 nav-network ((this nav-network) (arg0 nav-network-path-node)) (local-vars (a2-4 list-node)) (when (nonzero? (-> arg0 status)) (break!) @@ -304,7 +304,7 @@ (break!) 0 ) - (let ((v1-8 (the-as list-node (-> obj open-list)))) + (let ((v1-8 (the-as list-node (-> this open-list)))) (while v1-8 (let ((a2-1 (-> v1-8 next))) (if (= v1-8 arg0) @@ -319,7 +319,7 @@ 0 ) (logior! (-> arg0 status) (net-path-node-status open)) - (let ((v1-17 (the-as list-node (-> obj open-list)))) + (let ((v1-17 (the-as list-node (-> this open-list)))) (while v1-17 (let ((a2-3 (-> v1-17 next))) (when (< f0-1 (+ (-> (the-as nav-network-path-node v1-17) cost-to-start) @@ -339,7 +339,7 @@ (cond (a2-4 (let ((v1-20 arg0) - (a0-1 (-> obj list-table)) + (a0-1 (-> this list-table)) ) (when (zero? v1-20) (break!) @@ -370,7 +370,7 @@ ) (else (let ((a2-8 (the-as list-node #f))) - (let ((v1-21 (the-as list-node (-> obj open-list)))) + (let ((v1-21 (the-as list-node (-> this open-list)))) (while v1-21 (let ((a3-22 (-> v1-21 next))) (set! a2-8 v1-21) @@ -379,7 +379,7 @@ ) ) (let ((v1-23 arg0) - (a0-2 (-> obj list-table)) + (a0-2 (-> this list-table)) ) (when (or (= v1-23 a2-8) (= v1-23 a0-2)) (break!) @@ -418,14 +418,14 @@ ;; definition for method 13 of type nav-network ;; WARN: Return type mismatch nav-network-path-node vs none. -(defmethod nav-network-method-13 nav-network ((obj nav-network) (arg0 int) (arg1 nav-network-path-node)) +(defmethod nav-network-method-13 nav-network ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) (when (nonzero? (-> arg1 status)) (break!) 0 ) (let ((v1-3 arg1) - (a3-2 (-> obj list-table arg0)) - (a0-2 (the-as object (&+ (-> obj list-table) (* arg0 4)))) + (a3-2 (-> this list-table arg0)) + (a0-2 (the-as object (&+ (-> this list-table) (* arg0 4)))) ) (when (zero? v1-3) (break!) @@ -457,9 +457,9 @@ ) ;; definition for method 14 of type nav-network -(defmethod nav-network-method-14 nav-network ((obj nav-network) (arg0 int) (arg1 nav-network-path-node)) +(defmethod nav-network-method-14 nav-network ((this nav-network) (arg0 int) (arg1 nav-network-path-node)) (let ((v1-0 arg1)) - (let ((a3-1 (the-as list-node (&+ (-> obj list-table) (* arg0 4))))) + (let ((a3-1 (the-as list-node (&+ (-> this list-table) (* arg0 4))))) (if (= (-> a3-1 next) v1-0) (set! (-> a3-1 next) (-> v1-0 next)) ) @@ -473,7 +473,7 @@ (set! (-> v1-0 prev) #f) (set! (-> v1-0 next) #f) ) - (let ((v1-4 (-> obj list-table arg0))) + (let ((v1-4 (-> this list-table arg0))) (while v1-4 (let ((a0-2 (-> v1-4 next))) (if (= v1-4 arg1) @@ -497,16 +497,16 @@ ;; definition for method 16 of type nav-network ;; WARN: Return type mismatch object vs none. -(defmethod nav-network-method-16 nav-network ((obj nav-network) (arg0 nav-network-path-node)) - (nav-network-method-14 obj 0 arg0) +(defmethod nav-network-method-16 nav-network ((this nav-network) (arg0 nav-network-path-node)) + (nav-network-method-14 this 0 arg0) (none) ) ;; definition for method 17 of type nav-network -(defmethod nav-network-method-17 nav-network ((obj nav-network)) - (let ((gp-0 (-> obj open-list))) +(defmethod nav-network-method-17 nav-network ((this nav-network)) + (let ((gp-0 (-> this open-list))) (if gp-0 - (nav-network-method-16 obj gp-0) + (nav-network-method-16 this gp-0) (set! gp-0 (the-as nav-network-path-node #f)) ) gp-0 @@ -515,23 +515,23 @@ ;; definition for method 18 of type nav-network ;; WARN: Return type mismatch net-path-node-status vs none. -(defmethod nav-network-method-18 nav-network ((obj nav-network) (arg0 nav-network-path-node)) - (nav-network-method-13 obj 1 arg0) +(defmethod nav-network-method-18 nav-network ((this nav-network) (arg0 nav-network-path-node)) + (nav-network-method-13 this 1 arg0) (logior! (-> arg0 status) (net-path-node-status closed)) (none) ) ;; definition for method 19 of type nav-network ;; WARN: Return type mismatch object vs none. -(defmethod nav-network-method-19 nav-network ((obj nav-network) (arg0 nav-network-path-node)) - (nav-network-method-14 obj 1 arg0) +(defmethod nav-network-method-19 nav-network ((this nav-network) (arg0 nav-network-path-node)) + (nav-network-method-14 this 1 arg0) (none) ) ;; definition for method 20 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-20 nav-network ((obj nav-network) (arg0 nav-network-path-node) (arg1 vector)) - (let* ((s3-0 (-> obj network)) +(defmethod nav-network-method-20 nav-network ((this nav-network) (arg0 nav-network-path-node) (arg1 vector)) + (let* ((s3-0 (-> this network)) (s2-0 (-> s3-0 (-> arg0 row-index))) ) (dotimes (s1-0 (-> s2-0 count)) @@ -550,35 +550,35 @@ (set! (-> s0-0 cost-to-end) (vector-vector-distance (-> v1-8 pos) arg1)) (cond ((logtest? (-> s0-0 status) (net-path-node-status open)) - (nav-network-method-16 obj s0-0) - (nav-network-method-15 obj s0-0) + (nav-network-method-16 this s0-0) + (nav-network-method-15 this s0-0) ) ((logtest? (-> s0-0 status) (net-path-node-status closed)) - (nav-network-method-19 obj s0-0) - (nav-network-method-15 obj s0-0) + (nav-network-method-19 this s0-0) + (nav-network-method-15 this s0-0) ) (else - (nav-network-method-15 obj s0-0) + (nav-network-method-15 this s0-0) ) ) ) ) ) ) - (nav-network-method-18 obj arg0) + (nav-network-method-18 this arg0) 0 (none) ) ;; definition for method 22 of type nav-network ;; INFO: Used lq/sq -(defmethod nav-network-method-22 nav-network ((obj nav-network) (arg0 hover-nav-path-info) (arg1 vector) (arg2 vector) (arg3 int) (arg4 int)) - (-> obj network) - (let ((gp-0 (-> obj free-segment-list))) +(defmethod nav-network-method-22 nav-network ((this nav-network) (arg0 hover-nav-path-info) (arg1 vector) (arg2 vector) (arg3 int) (arg4 int)) + (-> this network) + (let ((gp-0 (-> this free-segment-list))) (cond ((and gp-0 (nonzero? gp-0)) (let ((v1-2 gp-0)) - (let ((a0-1 (&-> obj free-segment-list))) + (let ((a0-1 (&-> this free-segment-list))) (if (= (-> a0-1 0) v1-2) (set! (-> a0-1 0) (the-as hover-nav-path-segment (-> v1-2 next))) ) @@ -644,16 +644,16 @@ ;; definition for method 21 of type nav-network ;; WARN: Return type mismatch hover-nav-path-segment vs none. -(defmethod nav-network-method-21 nav-network ((obj nav-network) (arg0 object) (arg1 int) (arg2 int)) - (let ((t0-0 (-> obj network))) - (nav-network-method-22 obj (the-as hover-nav-path-info arg0) (-> t0-0 arg1 pos) (-> t0-0 arg2 pos) arg1 arg2) +(defmethod nav-network-method-21 nav-network ((this nav-network) (arg0 object) (arg1 int) (arg2 int)) + (let ((t0-0 (-> this network))) + (nav-network-method-22 this (the-as hover-nav-path-info arg0) (-> t0-0 arg1 pos) (-> t0-0 arg2 pos) arg1 arg2) ) (none) ) ;; definition for method 23 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-23 nav-network ((obj nav-network) (arg0 hover-nav-path-info)) +(defmethod nav-network-method-23 nav-network ((this nav-network) (arg0 hover-nav-path-info)) (while (-> arg0 segment-list) (let ((v1-0 (-> arg0 segment-list))) (let ((a2-0 v1-0)) @@ -671,8 +671,8 @@ (set! (-> a2-0 prev) #f) (set! (-> a2-0 next) #f) ) - (let ((a3-7 (-> obj free-segment-list)) - (a2-2 (&-> obj free-segment-list)) + (let ((a3-7 (-> this free-segment-list)) + (a2-2 (&-> this free-segment-list)) ) (when (zero? v1-0) (break!) @@ -710,20 +710,20 @@ ;; definition for method 24 of type nav-network ;; WARN: new jak 2 until loop case, check carefully -(defmethod nav-network-method-24 nav-network ((obj nav-network) (arg0 hover-nav-path-info) (arg1 int) (arg2 int) (arg3 int)) +(defmethod nav-network-method-24 nav-network ((this nav-network) (arg0 hover-nav-path-info) (arg1 int) (arg2 int) (arg3 int)) (local-vars (s3-1 nav-network-path-node)) - (nav-network-method-12 obj) - (let ((s4-0 (-> obj network))) + (nav-network-method-12 this) + (let ((s4-0 (-> this network))) (let ((s2-0 (-> s4-0 arg1 path-node))) (set! (-> s2-0 row-index) arg1) (set! (-> s2-0 status) (net-path-node-status)) (set! (-> s2-0 parent) #f) (set! (-> s2-0 cost-to-start) 0.0) (set! (-> s2-0 cost-to-end) (vector-vector-distance (-> s4-0 arg1 pos) (-> s4-0 arg2 pos))) - (nav-network-method-15 obj s2-0) + (nav-network-method-15 this s2-0) ) (until #f - (let ((a1-3 (nav-network-method-17 obj))) + (let ((a1-3 (nav-network-method-17 this))) (when (not a1-3) (set! s3-1 (the-as nav-network-path-node #f)) (goto cfg-9) @@ -732,17 +732,17 @@ (set! s3-1 a1-3) (goto cfg-9) ) - (nav-network-method-20 obj a1-3 (-> s4-0 arg2 pos)) + (nav-network-method-20 this a1-3 (-> s4-0 arg2 pos)) ) ) #f - (set! s3-1 (nav-network-method-17 obj)) + (set! s3-1 (nav-network-method-17 this)) (label cfg-9) (while (and s3-1 (-> s3-1 parent)) (if *debug-hover* (add-debug-sphere #t (bucket-id debug-no-zbuf1) (-> s4-0 (-> s3-1 row-index) pos) (meters 0.5) *color-blue*) ) - (nav-network-method-21 obj arg0 (-> s3-1 parent row-index) (-> s3-1 row-index)) + (nav-network-method-21 this arg0 (-> s3-1 parent row-index) (-> s3-1 row-index)) (set! s3-1 (-> s3-1 parent)) ) ) @@ -752,10 +752,10 @@ ;; definition for method 25 of type nav-network ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-25 nav-network ((obj nav-network) (arg0 process) (arg1 collide-prim-core)) +(defmethod nav-network-method-25 nav-network ((this nav-network) (arg0 process) (arg1 collide-prim-core)) (local-vars (a3-2 hover-nav-sphere)) (let ((a1-4 (process->handle arg0))) - (let ((v1-2 (-> obj sphere-list))) + (let ((v1-2 (-> this sphere-list))) (while v1-2 (let ((a3-1 (-> v1-2 next))) (when (= (-> v1-2 handle) a1-4) @@ -769,10 +769,10 @@ (set! a3-2 (the-as hover-nav-sphere #f)) (label cfg-12) (when (not a3-2) - (let ((v1-6 (-> obj free-sphere-list))) + (let ((v1-6 (-> this free-sphere-list))) (when v1-6 (let ((a3-3 v1-6)) - (let ((t0-3 (&-> obj free-sphere-list))) + (let ((t0-3 (&-> this free-sphere-list))) (if (= (-> t0-3 0) a3-3) (set! (-> t0-3 0) (the-as hover-nav-sphere (-> a3-3 next))) ) @@ -788,8 +788,8 @@ ) (set! (-> v1-6 handle) (the-as handle a1-4)) (let ((a1-5 v1-6) - (a3-5 (-> obj sphere-list)) - (a0-1 (&-> obj sphere-list)) + (a3-5 (-> this sphere-list)) + (a0-1 (&-> this sphere-list)) ) (when (zero? a1-5) (break!) @@ -835,13 +835,13 @@ ;; definition for method 26 of type nav-network ;; INFO: Used lq/sq -(defmethod nav-network-method-26 nav-network ((obj nav-network) (arg0 vector) (arg1 process) (arg2 vector) (arg3 vector) (arg4 float)) +(defmethod nav-network-method-26 nav-network ((this nav-network) (arg0 vector) (arg1 process) (arg2 vector) (arg3 vector) (arg4 float)) (local-vars (sv-48 vector) (sv-64 sphere)) (vector-reset! arg0) (let ((s1-0 (process->handle arg1)) (s2-0 0) ) - (let ((v1-3 (the-as list-node (-> obj sphere-list)))) + (let ((v1-3 (the-as list-node (-> this sphere-list)))) (while v1-3 (let ((s0-0 (-> v1-3 next))) (when (!= (-> (the-as hover-nav-sphere v1-3) handle) s1-0) @@ -868,9 +868,9 @@ ;; definition for method 27 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-27 nav-network ((obj nav-network)) +(defmethod nav-network-method-27 nav-network ((this nav-network)) (with-pp - (let ((v1-0 (the-as list-node (-> obj sphere-list)))) + (let ((v1-0 (the-as list-node (-> this sphere-list)))) (while v1-0 (let ((a0-2 (-> v1-0 next))) (set! (-> (the-as hover-nav-sphere v1-0) timer) @@ -878,7 +878,7 @@ ) (when (<= (-> (the-as hover-nav-sphere v1-0) timer) 0) (let ((a1-4 v1-0)) - (let ((a2-3 (&-> obj sphere-list))) + (let ((a2-3 (&-> this sphere-list))) (if (= (-> a2-3 0) a1-4) (set! (-> a2-3 0) (the-as hover-nav-sphere (-> a1-4 next))) ) @@ -892,8 +892,8 @@ (set! (-> a1-4 prev) #f) (set! (-> a1-4 next) #f) ) - (let ((a2-10 (-> obj free-sphere-list)) - (a1-6 (&-> obj free-sphere-list)) + (let ((a2-10 (-> this free-sphere-list)) + (a1-6 (&-> this free-sphere-list)) ) (when (zero? v1-0) (break!) @@ -926,7 +926,7 @@ ) ) ) - (let ((v1-2 (the-as list-node (-> obj sphere-list)))) + (let ((v1-2 (the-as list-node (-> this sphere-list)))) (while v1-2 (let ((s5-0 (-> v1-2 next))) (let* ((s3-0 (handle->process (-> (the-as hover-nav-sphere v1-2) handle))) @@ -942,7 +942,7 @@ (set! (-> a1-9 message) 'get-hover-nav-sphere) (let ((a2-14 (send-event-function s4-0 a1-9))) (if a2-14 - (nav-network-method-25 obj s4-0 (the-as collide-prim-core a2-14)) + (nav-network-method-25 this s4-0 (the-as collide-prim-core a2-14)) ) ) ) @@ -959,16 +959,16 @@ ;; definition for method 31 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-31 nav-network ((obj nav-network) (arg0 bounding-box)) - (set-to-point! arg0 (-> obj network 0 pos)) - (let* ((s4-0 (-> obj network length)) +(defmethod nav-network-method-31 nav-network ((this nav-network) (arg0 bounding-box)) + (set-to-point! arg0 (-> this network 0 pos)) + (let* ((s4-0 (-> this network length)) (s3-0 0) - (v1-7 (-> obj network s3-0)) + (v1-7 (-> this network s3-0)) ) (while (< s3-0 s4-0) (add-point! arg0 (-> v1-7 pos)) (+! s3-0 1) - (set! v1-7 (-> obj network s3-0)) + (set! v1-7 (-> this network s3-0)) ) ) 0 @@ -977,12 +977,12 @@ ;; definition for method 32 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-32 nav-network ((obj nav-network) (arg0 string)) +(defmethod nav-network-method-32 nav-network ((this nav-network) (arg0 string)) (let ((gp-0 (new 'stack-no-clear 'bounding-box)) (s5-0 (entity-by-name arg0)) ) (when s5-0 - (nav-network-method-31 obj gp-0) + (nav-network-method-31 this gp-0) (vector-! (-> gp-0 min) (-> gp-0 min) (-> s5-0 extra trans)) (vector-! (-> gp-0 max) (-> gp-0 max) (-> s5-0 extra trans)) (format #t "~S ~m " (res-lump-struct s5-0 'name structure) (-> s5-0 extra vis-dist)) @@ -1007,7 +1007,7 @@ ;; definition for method 26 of type hover-nav-control ;; INFO: Used lq/sq -(defmethod hover-nav-control-method-26 hover-nav-control ((obj hover-nav-control) (arg0 vector) (arg1 vector) (arg2 float)) +(defmethod hover-nav-control-method-26 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0))) (set! (-> gp-0 start-pos quad) (-> arg0 quad)) @@ -1028,8 +1028,8 @@ ) ;; definition for method 27 of type hover-nav-control -(defmethod hover-nav-control-method-27 hover-nav-control ((obj hover-nav-control) (arg0 vector) (arg1 vector)) - (let ((s2-0 (-> obj nav network)) +(defmethod hover-nav-control-method-27 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector)) + (let ((s2-0 (-> this nav network)) (gp-0 (the-as int #f)) ) (let ((f30-0 0.0)) @@ -1041,7 +1041,7 @@ (if (< (vector-dot (vector-float*! (new 'stack-no-clear 'vector) v1-5 (/ 1.0 f28-0)) arg1) 0.0) (set! f28-0 (* 1.25 f28-0)) ) - (when (and (< f28-0 204800.0) (hover-nav-control-method-26 obj arg0 (-> s2-0 s1-0 pos) 0.0)) + (when (and (< f28-0 204800.0) (hover-nav-control-method-26 this arg0 (-> s2-0 s1-0 pos) 0.0)) (when (or (not gp-0) (< f28-0 f30-0)) (set! gp-0 s1-0) (set! f30-0 f28-0) @@ -1055,20 +1055,20 @@ ) ;; definition for method 22 of type hover-nav-control -(defmethod hover-nav-control-method-22 hover-nav-control ((obj hover-nav-control)) - (-> obj path-info curr-segment) +(defmethod hover-nav-control-method-22 hover-nav-control ((this hover-nav-control)) + (-> this path-info curr-segment) ) ;; definition for method 23 of type hover-nav-control -(defmethod hover-nav-control-method-23 hover-nav-control ((obj hover-nav-control)) - (and (-> obj path-info curr-segment) (>= (-> obj path-info curr-u) 1.0)) +(defmethod hover-nav-control-method-23 hover-nav-control ((this hover-nav-control)) + (and (-> this path-info curr-segment) (>= (-> this path-info curr-u) 1.0)) ) ;; definition for method 21 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-21 hover-nav-control ((obj hover-nav-control)) - (nav-network-method-23 (-> obj nav) (-> obj path-info)) - (set! (-> obj curr-dest-pt) -1) +(defmethod hover-nav-control-method-21 hover-nav-control ((this hover-nav-control)) + (nav-network-method-23 (-> this nav) (-> this path-info)) + (set! (-> this curr-dest-pt) -1) 0 (none) ) @@ -1096,18 +1096,18 @@ ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Stack slot offset 32 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-28 hover-nav-control ((obj hover-nav-control) (arg0 vector) (arg1 vector)) +(defmethod hover-nav-control-method-28 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector)) (local-vars (v0-15 symbol) (sv-32 int) (sv-48 (function hover-nav-control vector vector int))) - (let ((s4-0 (-> obj nav network)) - (s5-0 (-> obj path-info)) + (let ((s4-0 (-> this nav network)) + (s5-0 (-> this path-info)) (s1-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) arg0 arg1) 1.0)) ) - (set! sv-32 (hover-nav-control-method-27 obj arg1 s1-0)) + (set! sv-32 (hover-nav-control-method-27 this arg1 s1-0)) (set! v0-15 (cond (sv-32 - (when (or (!= sv-32 (-> obj curr-dest-pt)) (not (-> obj path-info segment-list))) - (let ((s0-0 obj)) + (when (or (!= sv-32 (-> this curr-dest-pt)) (not (-> this path-info segment-list))) + (let ((s0-0 this)) (set! sv-48 (method-of-object s0-0 hover-nav-control-method-27)) (let* ((a2-2 (vector-negate! s1-0 s1-0)) (s2-1 (sv-48 s0-0 arg0 a2-2)) @@ -1118,11 +1118,11 @@ (if *debug-hover* (add-debug-sphere #t (bucket-id debug-no-zbuf1) (-> s4-0 sv-32 pos) (meters 1) *color-dark-blue*) ) - (nav-network-method-22 (-> obj nav) s5-0 (-> s4-0 sv-32 pos) arg1 -1 -1) + (nav-network-method-22 (-> this nav) s5-0 (-> s4-0 sv-32 pos) arg1 -1 -1) (nav-network-method-22 - (-> obj nav) + (-> this nav) s5-0 - (the-as vector (hover-nav-control-method-17 obj)) + (the-as vector (hover-nav-control-method-17 this)) (-> s4-0 s2-1 pos) -1 -1 @@ -1133,7 +1133,7 @@ (add-debug-sphere #t (bucket-id debug-no-zbuf1) (-> s4-0 s2-1 pos) (meters 1) *color-green*) (add-debug-sphere #t (bucket-id debug-no-zbuf1) (-> s4-0 sv-32 pos) (meters 1) *color-cyan*) ) - (let* ((a0-14 (-> obj nav)) + (let* ((a0-14 (-> this nav)) (t9-10 (method-of-object a0-14 nav-network-method-22)) (a1-11 s5-0) (a2-8 (-> s4-0 sv-32 pos)) @@ -1141,22 +1141,22 @@ (t0-5 -1) ) (t9-10 a0-14 a1-11 a2-8 a3-5 t0-5 -1) - (nav-network-method-24 (-> obj nav) s5-0 s2-1 sv-32 t0-5) + (nav-network-method-24 (-> this nav) s5-0 s2-1 sv-32 t0-5) ) (nav-network-method-22 - (-> obj nav) + (-> this nav) s5-0 - (the-as vector (hover-nav-control-method-17 obj)) + (the-as vector (hover-nav-control-method-17 this)) (-> s4-0 s2-1 pos) -1 -1 ) ) ) - (hover-nav-control-method-29 obj (-> obj root transv)) + (hover-nav-control-method-29 this (-> this root transv)) (set! (-> s5-0 curr-segment) (-> s5-0 segment-list)) (set! (-> s5-0 curr-u) (/ 16384.0 (-> s5-0 curr-segment dist))) - (set! (-> obj curr-dest-pt) sv-32) + (set! (-> this curr-dest-pt) sv-32) ) ) ) @@ -1178,9 +1178,9 @@ ;; definition for method 29 of type hover-nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-29 hover-nav-control ((obj hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-29 hover-nav-control ((this hover-nav-control) (arg0 vector)) (let ((a0-1 (the-as list-node #f)) - (s4-0 (the-as list-node (-> obj path-info segment-list))) + (s4-0 (the-as list-node (-> this path-info segment-list))) ) (while s4-0 (cond @@ -1199,7 +1199,7 @@ (-> (the-as hover-nav-path-segment s4-0) curve-matrix vector 1) (the-as vector (-> (the-as hover-nav-path-segment s4-0) curve-matrix)) ) - (hover-nav-control-method-30 obj) + (hover-nav-control-method-30 this) ) ) ) @@ -1231,28 +1231,28 @@ ) ;; definition for method 30 of type hover-nav-control -(defmethod hover-nav-control-method-30 hover-nav-control ((obj hover-nav-control)) - (* (-> obj max-speed-multiplier) (-> obj params max-speed)) +(defmethod hover-nav-control-method-30 hover-nav-control ((this hover-nav-control)) + (* (-> this max-speed-multiplier) (-> this params max-speed)) ) ;; definition for method 31 of type hover-nav-control -(defmethod hover-nav-control-method-31 hover-nav-control ((obj hover-nav-control)) - (* (-> obj max-acceleration-multiplier) (-> obj params max-acceleration)) +(defmethod hover-nav-control-method-31 hover-nav-control ((this hover-nav-control)) + (* (-> this max-acceleration-multiplier) (-> this params max-acceleration)) ) ;; definition for method 14 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-14 hover-nav-control ((obj hover-nav-control) (arg0 float) (arg1 float)) - (set! (-> obj max-speed-multiplier) arg0) - (set! (-> obj max-acceleration-multiplier) arg1) +(defmethod hover-nav-control-method-14 hover-nav-control ((this hover-nav-control) (arg0 float) (arg1 float)) + (set! (-> this max-speed-multiplier) arg0) + (set! (-> this max-acceleration-multiplier) arg1) 0 (none) ) ;; definition for method 18 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-18 hover-nav-control ((obj hover-nav-control) (arg0 path-control) (arg1 int) (arg2 int)) - (hover-nav-control-method-21 obj) +(defmethod hover-nav-control-method-18 hover-nav-control ((this hover-nav-control) (arg0 path-control) (arg1 int) (arg2 int)) + (hover-nav-control-method-21 this) (set! arg2 (cond ((= arg2 -1) (+ (-> arg0 curve num-cverts) -2) @@ -1272,92 +1272,92 @@ (a3-3 (get-point-in-path! arg0 (new 'stack-no-clear 'vector) (the float (+ arg2 1)) 'interp)) ) (hover-nav-path-segment-method-9 - (nav-network-method-22 (-> obj nav) (-> obj path-info) s2-0 a3-3 -1 -1) - (hover-nav-control-method-30 obj) + (nav-network-method-22 (-> this nav) (-> this path-info) s2-0 a3-3 -1 -1) + (hover-nav-control-method-30 this) ) ) (+! arg2 -1) ) - (hover-nav-control-method-29 obj (the-as vector #f)) - (set! (-> obj path-info curr-segment) (-> obj path-info segment-list)) - (logior! (-> obj flags) (hover-nav-flags honflags-0)) + (hover-nav-control-method-29 this (the-as vector #f)) + (set! (-> this path-info curr-segment) (-> this path-info segment-list)) + (logior! (-> this flags) (hover-nav-flags honflags-0)) 0 (none) ) ;; definition for method 19 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-19 hover-nav-control ((obj hover-nav-control) (arg0 (inline-array vector)) (arg1 int)) - (hover-nav-control-method-21 obj) +(defmethod hover-nav-control-method-19 hover-nav-control ((this hover-nav-control) (arg0 (inline-array vector)) (arg1 int)) + (hover-nav-control-method-21 this) (let ((s4-1 (+ arg1 -2))) (while (>= s4-1 0) (hover-nav-path-segment-method-9 - (nav-network-method-22 (-> obj nav) (-> obj path-info) (-> arg0 s4-1) (-> arg0 (+ s4-1 1)) -1 -1) - (hover-nav-control-method-30 obj) + (nav-network-method-22 (-> this nav) (-> this path-info) (-> arg0 s4-1) (-> arg0 (+ s4-1 1)) -1 -1) + (hover-nav-control-method-30 this) ) (+! s4-1 -1) ) ) - (hover-nav-control-method-29 obj (the-as vector #f)) - (set! (-> obj path-info curr-segment) (-> obj path-info segment-list)) - (logior! (-> obj flags) (hover-nav-flags honflags-0)) + (hover-nav-control-method-29 this (the-as vector #f)) + (set! (-> this path-info curr-segment) (-> this path-info segment-list)) + (logior! (-> this flags) (hover-nav-flags honflags-0)) 0 (none) ) ;; definition for method 20 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-20 hover-nav-control ((obj hover-nav-control)) - (hover-nav-control-method-21 obj) - (logclear! (-> obj flags) (hover-nav-flags honflags-0)) +(defmethod hover-nav-control-method-20 hover-nav-control ((this hover-nav-control)) + (hover-nav-control-method-21 this) + (logclear! (-> this flags) (hover-nav-flags honflags-0)) 0 (none) ) ;; definition for method 17 of type hover-nav-control -(defmethod hover-nav-control-method-17 hover-nav-control ((obj hover-nav-control)) - (-> (the-as collide-shape-prim-group (-> obj root root-prim)) +(defmethod hover-nav-control-method-17 hover-nav-control ((this hover-nav-control)) + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child - (-> obj params nav-collide-prim-index) + (-> this params nav-collide-prim-index) prim-core ) ) ;; definition for method 15 of type hover-nav-control ;; WARN: Return type mismatch vector vs none. -(defmethod hover-nav-control-method-15 hover-nav-control ((obj hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-15 hover-nav-control ((this hover-nav-control) (arg0 vector)) (local-vars (sv-32 vector) (sv-36 collide-shape-moving)) (set! sv-32 (new 'stack-no-clear 'vector)) - (set! sv-36 (-> obj root)) + (set! sv-36 (-> this root)) (vector-inv-orient-by-quat! sv-32 (-> sv-36 transv) (-> sv-36 quat)) - (vector-float*! arg0 sv-32 (/ 1.0 (hover-nav-control-method-30 obj))) + (vector-float*! arg0 sv-32 (/ 1.0 (hover-nav-control-method-30 this))) (none) ) ;; definition for method 16 of type hover-nav-control -(defmethod hover-nav-control-method-16 hover-nav-control ((obj hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-16 hover-nav-control ((this hover-nav-control) (arg0 vector)) (local-vars (sv-32 vector)) (set! sv-32 (new 'stack-no-clear 'vector)) - (vector-inv-orient-by-quat! sv-32 (-> obj transvv) (-> obj root quat)) - (vector-float*! arg0 sv-32 (/ 1.0 (hover-nav-control-method-31 obj))) + (vector-inv-orient-by-quat! sv-32 (-> this transvv) (-> this root quat)) + (vector-float*! arg0 sv-32 (/ 1.0 (hover-nav-control-method-31 this))) ) ;; definition for method 10 of type hover-nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-10 hover-nav-control ((obj hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) - (set! (-> obj dest-pos quad) (-> arg0 quad)) +(defmethod hover-nav-control-method-10 hover-nav-control ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) + (set! (-> this dest-pos quad) (-> arg0 quad)) (cond (arg2 - (set! (-> obj dest-vel quad) (-> arg2 quad)) - (set! (-> obj root transv quad) (-> arg2 quad)) + (set! (-> this dest-vel quad) (-> arg2 quad)) + (set! (-> this root transv quad) (-> arg2 quad)) ) (else - (set! (-> obj dest-vel quad) (the-as uint128 0)) - (set! (-> obj root transv quad) (the-as uint128 0)) + (set! (-> this dest-vel quad) (the-as uint128 0)) + (set! (-> this root transv quad) (the-as uint128 0)) ) ) - (vector-normalize-copy! (-> obj dest-move-dir) arg1 1.0) + (vector-normalize-copy! (-> this dest-move-dir) arg1 1.0) 0 (none) ) @@ -1365,12 +1365,12 @@ ;; definition for method 24 of type hover-nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-24 hover-nav-control ((obj hover-nav-control)) - (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) +(defmethod hover-nav-control-method-24 hover-nav-control ((this hover-nav-control)) + (when (not (logtest? (-> this flags) (hover-nav-flags honflags-0))) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (-> obj params) - (let ((v1-5 (hover-nav-control-method-17 obj)) - (s4-0 (-> obj root transv)) + (-> this params) + (let ((v1-5 (hover-nav-control-method-17 this)) + (s4-0 (-> this root transv)) ) (when (< 0.0 (vector-length s4-0)) (set! (-> s5-0 start-pos quad) (-> v1-5 world-sphere quad)) @@ -1382,21 +1382,21 @@ ) (let ((a0-14 s5-0)) (set! (-> a0-14 radius) (-> v1-5 world-sphere w)) - (set! (-> a0-14 collide-with) (-> obj root root-prim prim-core collide-with)) - (set! (-> a0-14 ignore-process0) (-> obj root process)) + (set! (-> a0-14 collide-with) (-> this root root-prim prim-core collide-with)) + (set! (-> a0-14 ignore-process0) (-> this root process)) (set! (-> a0-14 ignore-process1) #f) - (set! (-> a0-14 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> a0-14 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> a0-14 action-mask) (collide-action solid)) ) (let ((f0-4 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) (cond ((>= f0-4 0.0) - (set! (-> obj los-obstruction-distance) (* f0-4 (vector-length s4-0))) - (logior! (-> obj flags) (hover-nav-flags honflags-1)) + (set! (-> this los-obstruction-distance) (* f0-4 (vector-length s4-0))) + (logior! (-> this flags) (hover-nav-flags honflags-1)) ) (else - (set! (-> obj los-last-clear-time) (current-time)) - (logclear! (-> obj flags) (hover-nav-flags honflags-1)) + (set-time! (-> this los-last-clear-time)) + (logclear! (-> this flags) (hover-nav-flags honflags-1)) ) ) ) @@ -1411,44 +1411,44 @@ ;; definition for method 11 of type hover-nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-11 hover-nav-control ((obj hover-nav-control) (arg0 vector)) +(defmethod hover-nav-control-method-11 hover-nav-control ((this hover-nav-control) (arg0 vector)) (local-vars (sv-288 vector) (sv-304 vector) (sv-320 vector) (sv-336 vector) (sv-352 int)) (with-pp (when *debug-hover* (if arg0 (add-debug-sphere #t (bucket-id debug2) arg0 (meters 0.9) *color-yellow*) ) - (if (!= (-> obj curr-dest-pt) -1) + (if (!= (-> this curr-dest-pt) -1) (add-debug-sphere #t (bucket-id debug-no-zbuf1) - (-> obj nav network (-> obj curr-dest-pt) pos) + (-> this nav network (-> this curr-dest-pt) pos) (meters 0.4) *color-blue* ) ) ) - (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) + (when (not (logtest? (-> this flags) (hover-nav-flags honflags-0))) (cond - ((and arg0 (and (< (vector-vector-distance arg0 (-> obj root trans)) 40960.0) - (>= (-> obj los-last-clear-time) (+ (current-time) (seconds -0.2))) + ((and arg0 (and (< (vector-vector-distance arg0 (-> this root trans)) 40960.0) + (>= (-> this los-last-clear-time) (+ (current-time) (seconds -0.2))) ) ) - (if (not (and (-> obj path-info curr-segment) (< (-> obj path-info curr-u) 1.0))) - (hover-nav-control-method-21 obj) + (if (not (and (-> this path-info curr-segment) (< (-> this path-info curr-u) 1.0))) + (hover-nav-control-method-21 this) ) ) - ((or (>= (- (current-time) (-> obj los-last-clear-time)) (seconds 1)) (not (-> obj path-info curr-segment))) - (hover-nav-control-method-21 obj) + ((or (time-elapsed? (-> this los-last-clear-time) (seconds 1)) (not (-> this path-info curr-segment))) + (hover-nav-control-method-21 this) (when arg0 (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj root transv quad)) - (if (>= (- (current-time) (-> obj los-last-clear-time)) (seconds 1)) - (vector-normalize! s4-0 (fmin (vector-length s4-0) (-> obj los-obstruction-distance))) + (set! (-> s4-0 quad) (-> this root transv quad)) + (if (time-elapsed? (-> this los-last-clear-time) (seconds 1)) + (vector-normalize! s4-0 (fmin (vector-length s4-0) (-> this los-obstruction-distance))) ) (hover-nav-control-method-28 - obj - (vector+! (new 'stack-no-clear 'vector) (the-as vector (hover-nav-control-method-17 obj)) s4-0) + this + (vector+! (new 'stack-no-clear 'vector) (the-as vector (hover-nav-control-method-17 this)) s4-0) arg0 ) ) @@ -1457,7 +1457,7 @@ ) ) (let ((s4-1 (new 'stack-no-clear 'vector))) - (let* ((s3-1 (-> obj path-info)) + (let* ((s3-1 (-> this path-info)) (s2-1 (-> s3-1 curr-segment)) ) (cond @@ -1517,9 +1517,9 @@ (if *debug-hover* (add-debug-sphere #t (bucket-id debug-no-zbuf1) s4-1 (meters 0.8) *color-magenta*) ) - (let ((f0-19 (+ 2048.0 (vector-length (-> obj root transv))))) - (if (logtest? (-> obj flags) (hover-nav-flags honflags-1)) - (set! f0-19 (fmin f0-19 (fmax 8192.0 (-> obj los-obstruction-distance)))) + (let ((f0-19 (+ 2048.0 (vector-length (-> this root transv))))) + (if (logtest? (-> this flags) (hover-nav-flags honflags-1)) + (set! f0-19 (fmin f0-19 (fmax 8192.0 (-> this los-obstruction-distance)))) ) (hover-nav-path-segment-method-9 s2-1 f0-19) ) @@ -1527,24 +1527,24 @@ (when (and (>= (-> s3-1 curr-u) 1.0) (-> s2-1 next)) (set! (-> s3-1 curr-segment) (the-as hover-nav-path-segment (-> s2-1 next))) (set! (-> s3-1 curr-u) 0.0) - (hover-nav-path-segment-method-9 (-> s3-1 curr-segment) (hover-nav-control-method-30 obj)) + (hover-nav-path-segment-method-9 (-> s3-1 curr-segment) (hover-nav-control-method-30 this)) ) ) (arg0 (set! (-> s4-1 quad) (-> arg0 quad)) ) (else - (set! (-> s4-1 quad) (-> (hover-nav-control-method-17 obj) world-sphere quad)) + (set! (-> s4-1 quad) (-> (hover-nav-control-method-17 this) world-sphere quad)) ) ) ) - (let ((v1-94 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> obj dest-pos)))) - (set! (-> obj dest-pos quad) (-> s4-1 quad)) - (vector-float*! (-> obj dest-vel) v1-94 (-> pp clock frames-per-second)) + (let ((v1-94 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this dest-pos)))) + (set! (-> this dest-pos quad) (-> s4-1 quad)) + (vector-float*! (-> this dest-vel) v1-94 (-> pp clock frames-per-second)) ) ) - (if (< 0.0 (vector-length (-> obj dest-vel))) - (vector-normalize-copy! (-> obj dest-move-dir) (-> obj dest-vel) 1.0) + (if (< 0.0 (vector-length (-> this dest-vel))) + (vector-normalize-copy! (-> this dest-move-dir) (-> this dest-vel) 1.0) ) 0 (none) @@ -1554,20 +1554,20 @@ ;; definition for method 25 of type hover-nav-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-25 hover-nav-control ((obj hover-nav-control)) +(defmethod hover-nav-control-method-25 hover-nav-control ((this hover-nav-control)) (let ((s5-0 (new 'stack-no-clear 'hover-nav-path-segment)) - (f28-0 (hover-nav-control-method-31 obj)) - (f30-0 (hover-nav-control-method-30 obj)) - (s3-0 (-> obj root transv)) + (f28-0 (hover-nav-control-method-31 this)) + (f30-0 (hover-nav-control-method-30 this)) + (s3-0 (-> this root transv)) ) - (-> obj transvv) - (let ((s4-0 (-> obj dest-offset))) + (-> this transvv) + (let ((s4-0 (-> this dest-offset))) (vector-normalize-copy! (-> s5-0 curve-matrix vector 2) s3-0 1.0) (vector-normalize-copy! (-> s5-0 curve-matrix trans) s4-0 1.0) (set! (-> s5-0 pos-index 0) (vector-dot s3-0 (-> s5-0 curve-matrix trans))) (set! (-> s5-0 pos-index 1) (/ (* 0.5 (-> s5-0 pos-index 0) (-> s5-0 pos-index 0)) (* 0.2 f28-0))) - (set! (-> s5-0 dist) (vector-dot (-> obj dest-vel) (-> s5-0 curve-matrix trans))) - (vector-normalize-copy! (-> s5-0 curve-matrix vector 1) s4-0 (-> obj target-speed)) + (set! (-> s5-0 dist) (vector-dot (-> this dest-vel) (-> s5-0 curve-matrix trans))) + (vector-normalize-copy! (-> s5-0 curve-matrix vector 1) s4-0 (-> this target-speed)) (vector-! (the-as vector (-> s5-0 curve-matrix)) (-> s5-0 curve-matrix vector 1) s3-0) (let ((f0-9 (vector-length (the-as vector (-> s5-0 curve-matrix))))) (if (< f28-0 f0-9) @@ -1576,13 +1576,13 @@ ) (vector+float*! (the-as vector (&-> s5-0 next)) - (-> obj root transv) + (-> this root transv) (the-as vector (-> s5-0 curve-matrix)) (seconds-per-frame) ) (let ((f0-12 (vector-length (the-as vector (&-> s5-0 next)))) - (f1-6 (if (logtest? (-> obj flags) (hover-nav-flags honflags-1)) - (fmax 8192.0 (* 0.8 (-> obj los-obstruction-distance))) + (f1-6 (if (logtest? (-> this flags) (hover-nav-flags honflags-1)) + (fmax 8192.0 (* 0.8 (-> this los-obstruction-distance))) f30-0 ) ) @@ -1591,22 +1591,22 @@ (vector-float*! (the-as vector (&-> s5-0 next)) (the-as vector (&-> s5-0 next)) (/ f1-6 f0-12)) ) ) - (set! (-> obj root transv quad) (-> (the-as vector (&-> s5-0 next)) quad)) - (set! (-> obj transvv quad) (-> s5-0 curve-matrix quad 0)) + (set! (-> this root transv quad) (-> (the-as vector (&-> s5-0 next)) quad)) + (set! (-> this transvv quad) (-> s5-0 curve-matrix quad 0)) (when *debug-hover* - (format *stdcon* " speed act: ~m target: ~m~%" (-> s5-0 pos-index 0) (-> obj target-speed)) + (format *stdcon* " speed act: ~m target: ~m~%" (-> s5-0 pos-index 0) (-> this target-speed)) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj root trans) - (-> obj root transv) + (-> this root trans) + (-> this root transv) (meters 0.00024414062) *color-yellow* ) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj root trans) + (-> this root trans) (-> s5-0 curve-matrix vector 1) (meters 0.00024414062) *color-cyan* @@ -1614,15 +1614,15 @@ (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj root trans) - (-> obj transvv) + (-> this root trans) + (-> this transvv) (meters 0.00024414062) *color-blue* ) (add-debug-x #t (bucket-id debug-no-zbuf1) - (vector+! (new 'stack-no-clear 'vector) (-> obj root trans) s4-0) + (vector+! (new 'stack-no-clear 'vector) (-> this root trans) s4-0) *color-green* ) ) @@ -1634,20 +1634,20 @@ ;; definition for method 12 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-12 hover-nav-control ((obj hover-nav-control)) +(defmethod hover-nav-control-method-12 hover-nav-control ((this hover-nav-control)) (local-vars (at-0 int)) (rlet ((vf0 :class vf) (vf1 :class vf) (vf2 :class vf) ) (init-vf0-vector) - (hover-nav-control-method-25 obj) - (hover-nav-control-method-24 obj) - (let ((v1-5 (-> obj root transv)) - (a0-4 (-> obj root transv)) + (hover-nav-control-method-25 this) + (hover-nav-control-method-24 this) + (let ((v1-5 (-> this root transv)) + (a0-4 (-> this root transv)) (a1-0 (new 'stack-no-clear 'vector)) ) - (.lvf vf1 (&-> (-> obj nav-collide-impulse) quad)) + (.lvf vf1 (&-> (-> this nav-collide-impulse) quad)) (let ((f0-0 (seconds-per-frame))) (.mov at-0 f0-0) ) @@ -1657,7 +1657,7 @@ (.svf (&-> a1-0 quad) vf1) (vector+! v1-5 a0-4 a1-0) ) - (let ((v1-7 (-> obj root)) + (let ((v1-7 (-> this root)) (a2-2 (new 'stack-no-clear 'collide-query)) ) (set! (-> a2-2 collide-with) (-> v1-7 root-prim prim-core collide-with)) @@ -1668,9 +1668,9 @@ (fill-cache-integrate-and-collide v1-7 (-> v1-7 transv) a2-2 (meters 0)) ) (vector-float*! - (-> obj root transv) - (-> obj root transv) - (- 1.0 (* (-> obj params friction) (seconds-per-frame))) + (-> this root transv) + (-> this root transv) + (- 1.0 (* (-> this params friction) (seconds-per-frame))) ) 0 (none) @@ -1689,29 +1689,29 @@ ;; ERROR: Stack slot load at 144 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 160 mismatch: defined as size 4, got size 16 ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-13 hover-nav-control ((obj hover-nav-control)) +(defmethod hover-nav-control-method-13 hover-nav-control ((this hover-nav-control)) (local-vars (sv-112 float) (sv-128 float) (sv-144 float) (sv-160 float)) - (let* ((s5-0 (-> obj root)) - (s3-0 (hover-nav-control-method-17 obj)) + (let* ((s5-0 (-> this root)) + (s3-0 (hover-nav-control-method-17 this)) (v1-2 (vector-! (new 'stack-no-clear 'vector) (the-as vector s3-0) (-> s5-0 trans))) - (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> obj dest-pos) v1-2)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this dest-pos) v1-2)) ) - (when (not (logtest? (-> obj flags) (hover-nav-flags honflags-0))) - (let* ((s2-0 (-> obj root transv)) + (when (not (logtest? (-> this flags) (hover-nav-flags honflags-0))) + (let* ((s2-0 (-> this root transv)) (f30-0 (vector-length s2-0)) (s1-0 lerp-scale) (s0-0 0.0) ) - (set! sv-112 (hover-nav-control-method-30 obj)) + (set! sv-112 (hover-nav-control-method-30 this)) (set! sv-128 (* 2.0 f30-0)) (set! sv-144 (the-as float 0.0)) - (let* ((t0-0 (hover-nav-control-method-30 obj)) + (let* ((t0-0 (hover-nav-control-method-30 this)) (f0-4 (s1-0 s0-0 sv-112 sv-128 sv-144 t0-0)) (t0-2 (vector+float*! (new 'stack-no-clear 'vector) (the-as vector s3-0) s2-0 (/ f0-4 f30-0))) (s2-1 (nav-network-method-26 - (-> obj nav) + (-> this nav) (new 'stack-no-clear 'vector) - (-> obj root process) + (-> this root process) (the-as vector s3-0) t0-2 (-> s3-0 world-sphere w) @@ -1720,14 +1720,14 @@ ) (let ((f0-7 (vector-length s2-1)) (s1-1 seek) - (s0-1 (-> obj nav-collide-impulse-len)) + (s0-1 (-> this nav-collide-impulse-len)) ) (set! sv-160 f0-7) - (let ((a2-2 (* (hover-nav-control-method-31 obj) (seconds-per-frame)))) - (set! (-> obj nav-collide-impulse-len) (s1-1 s0-1 sv-160 a2-2)) + (let ((a2-2 (* (hover-nav-control-method-31 this) (seconds-per-frame)))) + (set! (-> this nav-collide-impulse-len) (s1-1 s0-1 sv-160 a2-2)) ) ) - (vector-normalize-copy! (-> obj nav-collide-impulse) s2-1 (- (-> obj nav-collide-impulse-len))) + (vector-normalize-copy! (-> this nav-collide-impulse) s2-1 (- (-> this nav-collide-impulse-len))) ) ) (if *debug-hover* @@ -1735,39 +1735,39 @@ #t (bucket-id debug-no-zbuf1) (the-as vector s3-0) - (-> obj nav-collide-impulse) + (-> this nav-collide-impulse) (meters 0.00024414062) *color-red* ) ) ) - (let ((f30-1 (hover-nav-control-method-31 obj)) - (f28-0 (hover-nav-control-method-30 obj)) + (let ((f30-1 (hover-nav-control-method-31 this)) + (f28-0 (hover-nav-control-method-30 this)) ) - (vector-z-quaternion! (-> obj move-dir) (-> s5-0 quat)) - (set! (-> obj speed) (vector-length (-> s5-0 transv))) - (vector-! (-> obj dest-offset) s4-1 (-> s5-0 trans)) - (let ((s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj dest-offset) 1.0)) + (vector-z-quaternion! (-> this move-dir) (-> s5-0 quat)) + (set! (-> this speed) (vector-length (-> s5-0 transv))) + (vector-! (-> this dest-offset) s4-1 (-> s5-0 trans)) + (let ((s4-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this dest-offset) 1.0)) (v0-13 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 transv) 1.0)) ) - (set! (-> obj speed-dest) (vector-dot (-> s5-0 transv) s4-2)) - (set! (-> obj local-dist) (vector-dot v0-13 (-> obj dest-offset))) + (set! (-> this speed-dest) (vector-dot (-> s5-0 transv) s4-2)) + (set! (-> this local-dist) (vector-dot v0-13 (-> this dest-offset))) ) - (let* ((f0-20 (fmax 0.0 (+ -2048.0 (vector-length (-> obj dest-offset))))) + (let* ((f0-20 (fmax 0.0 (+ -2048.0 (vector-length (-> this dest-offset))))) (f1-5 (sqrtf (* 1.6 f0-20 f30-1))) (f0-23 0.0) ) - (seek! (-> obj target-speed) (fmax (fmin f1-5 f28-0) f0-23) (* 0.9 (seconds-per-frame) f30-1)) + (seek! (-> this target-speed) (fmax (fmin f1-5 f28-0) f0-23) (* 0.9 (seconds-per-frame) f30-1)) ) ) ) (when *debug-hover* - (add-debug-x #t (bucket-id debug-no-zbuf1) (-> obj dest-pos) *color-white*) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> this dest-pos) *color-white*) (add-debug-vector #t (bucket-id debug-no-zbuf1) - (-> obj dest-pos) - (-> obj dest-vel) + (-> this dest-pos) + (-> this dest-vel) (meters 0.00024414062) *color-white* ) @@ -1788,18 +1788,18 @@ ;; definition for method 9 of type hover-nav-control ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-control-method-9 hover-nav-control ((obj hover-nav-control)) - (hover-nav-control-method-21 obj) +(defmethod hover-nav-control-method-9 hover-nav-control ((this hover-nav-control)) + (hover-nav-control-method-21 this) 0 (none) ) ;; definition for method 7 of type hover-nav-control -(defmethod relocate hover-nav-control ((obj hover-nav-control) (arg0 int)) - (if (nonzero? (-> obj root)) - (&+! (-> obj root) arg0) +(defmethod relocate hover-nav-control ((this hover-nav-control) (arg0 int)) + (if (nonzero? (-> this root)) + (&+! (-> this root) arg0) ) - obj + this ) ;; definition for method 0 of type hover-nav-control @@ -1829,7 +1829,7 @@ (set! (-> s5-0 speed-dest) 0.0) (set! (-> s5-0 curr-dest-pt) -1) (set! (-> s5-0 los-obstruction-distance) 0.0) - (set! (-> s5-0 los-last-clear-time) (current-time)) + (set-time! (-> s5-0 los-last-clear-time)) (hover-nav-control-method-14 s5-0 1.0 1.0) (nav-network-method-25 (-> s5-0 nav) arg0 (the-as collide-prim-core #f)) s5-0 diff --git a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc index 0ad3c48b44..32f2c9ff99 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/hover/hover-nav-edit_REF.gc @@ -208,18 +208,18 @@ ) ;; definition for method 3 of type hover-nav-bsp-point -(defmethod inspect hover-nav-bsp-point ((obj hover-nav-bsp-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-nav-bsp-point ((this hover-nav-bsp-point)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hover-nav-bsp-point) - (format #t "~1Tnext: #~%" (-> obj next)) - (format #t "~1Tprev: #~%" (-> obj prev)) - (format #t "~1Tindex: ~D~%" (-> obj index)) - (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this 'hover-nav-bsp-point) + (format #t "~1Tnext: #~%" (-> this next)) + (format #t "~1Tprev: #~%" (-> this prev)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tpos: #~%" (-> this pos)) (label cfg-4) - obj + this ) ;; definition for method 0 of type hover-nav-bsp-point @@ -255,18 +255,18 @@ ) ;; definition for method 3 of type hover-nav-bsp-node -(defmethod inspect hover-nav-bsp-node ((obj hover-nav-bsp-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-nav-bsp-node ((this hover-nav-bsp-node)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hover-nav-bsp-node) - (format #t "~1Tsplit-plane: #~%" (-> obj split-plane)) - (format #t "~1Tpoint-list: #~%" (-> obj point-list)) - (format #t "~1Tleft: #~%" (-> obj left)) - (format #t "~1Tright: #~%" (-> obj right)) + (format #t "[~8x] ~A~%" this 'hover-nav-bsp-node) + (format #t "~1Tsplit-plane: #~%" (-> this split-plane)) + (format #t "~1Tpoint-list: #~%" (-> this point-list)) + (format #t "~1Tleft: #~%" (-> this left)) + (format #t "~1Tright: #~%" (-> this right)) (label cfg-4) - obj + this ) ;; definition for method 0 of type hover-nav-bsp-node @@ -295,24 +295,24 @@ ) ;; definition for method 3 of type hover-nav-bsp -(defmethod inspect hover-nav-bsp ((obj hover-nav-bsp)) - (when (not obj) - (set! obj obj) +(defmethod inspect hover-nav-bsp ((this hover-nav-bsp)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hover-nav-bsp) - (format #t "~1Troot: #~%" (-> obj root)) + (format #t "[~8x] ~A~%" this 'hover-nav-bsp) + (format #t "~1Troot: #~%" (-> this root)) (label cfg-4) - obj + this ) ;; definition for method 9 of type hover-nav-bsp-node ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-bsp-node-method-9 hover-nav-bsp-node ((obj hover-nav-bsp-node)) - (let ((v1-0 (-> obj split-plane))) +(defmethod hover-nav-bsp-node-method-9 hover-nav-bsp-node ((this hover-nav-bsp-node)) + (let ((v1-0 (-> this split-plane))) (format #t "((~,,1f ~,,1f ~,,1f ~m)~% " (-> v1-0 x) (-> v1-0 y) (-> v1-0 z) (-> v1-0 w)) ) - (let ((v1-2 (the-as list-node (-> obj point-list)))) + (let ((v1-2 (the-as list-node (-> this point-list)))) (while v1-2 (let ((s5-0 (-> v1-2 next))) (format @@ -327,11 +327,11 @@ ) ) ) - (if (-> obj left) - (hover-nav-bsp-node-method-9 (-> obj left)) + (if (-> this left) + (hover-nav-bsp-node-method-9 (-> this left)) ) - (if (-> obj right) - (hover-nav-bsp-node-method-9 (-> obj right)) + (if (-> this right) + (hover-nav-bsp-node-method-9 (-> this right)) ) (format #t ")~%") 0 @@ -341,13 +341,13 @@ ;; definition for method 10 of type hover-nav-bsp-node ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hover-nav-bsp-node-method-10 hover-nav-bsp-node ((obj hover-nav-bsp-node) (arg0 int)) - (when (-> obj point-list) +(defmethod hover-nav-bsp-node-method-10 hover-nav-bsp-node ((this hover-nav-bsp-node) (arg0 int)) + (when (-> this point-list) (format 0 "build-bsp: ") (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 0) ) - (let ((v1-2 (the-as list-node (-> obj point-list)))) + (let ((v1-2 (the-as list-node (-> this point-list)))) (while v1-2 (set! v1-2 (-> v1-2 next)) (+! s3-0 1) @@ -357,7 +357,7 @@ (when (< 1 s3-0) (vector-reset! s4-0) (let ((f0-1 (/ 1.0 (the float s3-0))) - (a2-1 (the-as list-node (-> obj point-list))) + (a2-1 (the-as list-node (-> this point-list))) ) (while a2-1 (let ((v1-9 (-> a2-1 next))) @@ -366,21 +366,21 @@ ) ) ) - (set! (-> obj split-plane quad) (-> *axes-table* arg0 quad)) - (set! (-> obj split-plane w) (- (vector-dot s4-0 (-> obj split-plane)))) - (let ((s3-1 (the-as list-node (-> obj point-list)))) + (set! (-> this split-plane quad) (-> *axes-table* arg0 quad)) + (set! (-> this split-plane w) (- (vector-dot s4-0 (-> this split-plane)))) + (let ((s3-1 (the-as list-node (-> this point-list)))) (while s3-1 (let ((s4-1 (-> s3-1 next))) - (let ((f0-7 (- (vector-dot (the-as vector (+ (the-as uint s3-1) 16)) (-> obj split-plane))))) + (let ((f0-7 (- (vector-dot (the-as vector (+ (the-as uint s3-1) 16)) (-> this split-plane))))) (cond - ((= f0-7 (-> obj split-plane w)) + ((= f0-7 (-> this split-plane w)) ) - ((< f0-7 (-> obj split-plane w)) - (if (not (-> obj left)) - (set! (-> obj left) (new 'global 'hover-nav-bsp-node)) + ((< f0-7 (-> this split-plane w)) + (if (not (-> this left)) + (set! (-> this left) (new 'global 'hover-nav-bsp-node)) ) (let ((v1-21 s3-1)) - (let ((a0-12 (&-> obj point-list))) + (let ((a0-12 (&-> this point-list))) (if (= (-> a0-12 0) v1-21) (set! (-> a0-12 0) (the-as hover-nav-bsp-point (-> v1-21 next))) ) @@ -394,8 +394,8 @@ (set! (-> v1-21 prev) #f) (set! (-> v1-21 next) #f) ) - (let ((a0-19 (-> obj left point-list)) - (v1-25 (&-> (-> obj left) point-list)) + (let ((a0-19 (-> this left point-list)) + (v1-25 (&-> (-> this left) point-list)) ) (when (zero? s3-1) (break!) @@ -425,11 +425,11 @@ ) ) (else - (if (not (-> obj right)) - (set! (-> obj right) (new 'global 'hover-nav-bsp-node)) + (if (not (-> this right)) + (set! (-> this right) (new 'global 'hover-nav-bsp-node)) ) (let ((v1-30 s3-1)) - (let ((a0-22 (&-> obj point-list))) + (let ((a0-22 (&-> this point-list))) (if (= (-> a0-22 0) v1-30) (set! (-> a0-22 0) (the-as hover-nav-bsp-point (-> v1-30 next))) ) @@ -444,8 +444,8 @@ (set! (-> v1-30 next) #f) ) (let ((v1-32 s3-1) - (a1-40 (-> obj right point-list)) - (a0-31 (&-> (-> obj right) point-list)) + (a1-40 (-> this right point-list)) + (a0-31 (&-> (-> this right) point-list)) ) (when (zero? v1-32) (break!) @@ -480,11 +480,11 @@ ) ) ) - (if (-> obj left) - (hover-nav-bsp-node-method-10 (-> obj left) (mod (+ arg0 1) 3)) + (if (-> this left) + (hover-nav-bsp-node-method-10 (-> this left) (mod (+ arg0 1) 3)) ) - (if (-> obj right) - (hover-nav-bsp-node-method-10 (-> obj right) (mod (+ arg0 1) 3)) + (if (-> this right) + (hover-nav-bsp-node-method-10 (-> this right) (mod (+ arg0 1) 3)) ) ) ) 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 03c24ccd36..10cc412ae9 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 @@ -317,21 +317,21 @@ ) ;; definition for method 3 of type wasp-shot -(defmethod inspect wasp-shot ((obj wasp-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect wasp-shot ((this wasp-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type metalhead-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 28 of type wasp-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound wasp-shot ((obj wasp-shot) (arg0 projectile-options)) +(defmethod play-impact-sound wasp-shot ((this wasp-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -349,13 +349,13 @@ ;; definition for method 31 of type wasp-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! wasp-shot ((obj wasp-shot)) +(defmethod init-proj-settings! wasp-shot ((this wasp-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'wasp-shot) - (set! (-> obj max-speed) 491520.0) - (set! (-> obj move) metalhead-shot-move) - (set! (-> obj timeout) (seconds 1.375)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'wasp-shot) + (set! (-> this max-speed) 491520.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this timeout) (seconds 1.375)) 0 (none) ) @@ -476,60 +476,60 @@ (set! (-> *wasp-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type wasp -(defmethod general-event-handler wasp ((obj wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler wasp ((this wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (if (zero? (-> obj hit-points)) - (go (method-of-object obj die-explode)) - (go (method-of-object obj knocked)) + (if (zero? (-> this hit-points)) + (go (method-of-object this die-explode)) + (go (method-of-object this knocked)) ) ) (else - ((method-of-type hover-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hover-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 52 of type wasp ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 wasp ((obj wasp) (arg0 vector)) - (let ((s4-0 (-> obj root))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-52 wasp ((this wasp) (arg0 vector)) + (let ((s4-0 (-> this root))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-2)) - (let ((gp-1 (-> obj root transv))) - (let ((a1-1 (handle->process (-> obj incoming attacker-handle)))) + (let ((gp-1 (-> this root transv))) + (let ((a1-1 (handle->process (-> this incoming attacker-handle)))) (if a1-1 - (vector-! gp-1 (-> (the-as process-focusable a1-1) root trans) (-> obj root trans)) - (vector-! gp-1 (-> obj incoming attacker-pos) (-> obj root trans)) + (vector-! gp-1 (-> (the-as process-focusable a1-1) root trans) (-> this root trans)) + (vector-! gp-1 (-> this incoming attacker-pos) (-> this root trans)) ) ) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 1.0) (vector-rotate90-around-y! gp-1 gp-1) (if (< 0.0 (vector-dot - (vector-! (new 'stack-no-clear 'vector) (-> obj incoming attacker-pos) (-> s4-0 trans)) + (vector-! (new 'stack-no-clear 'vector) (-> this incoming attacker-pos) (-> s4-0 trans)) (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat)) ) ) (vector-negate! gp-1 gp-1) ) - (let ((f30-1 (get-rand-float-range obj 0.0 1.0)) - (s5-1 (-> obj enemy-info)) + (let ((f30-1 (get-rand-float-range this 0.0 1.0)) + (s5-1 (-> this enemy-info)) ) (vector-float*! gp-1 gp-1 (lerp (-> s5-1 knocked-hard-vxz-lo) (-> s5-1 knocked-hard-vxz-hi) f30-1)) (set! (-> gp-1 y) (lerp (-> s5-1 knocked-hard-vy-lo) (-> s5-1 knocked-hard-vy-hi) f30-1)) @@ -537,7 +537,7 @@ ) ) (else - ((the-as (function enemy vector none) (find-parent-method wasp 52)) obj arg0) + ((the-as (function enemy vector none) (find-parent-method wasp 52)) this arg0) ) ) ) @@ -546,51 +546,51 @@ ;; definition for method 116 of type wasp ;; WARN: Return type mismatch object vs none. -(defmethod go-idle wasp ((obj wasp)) +(defmethod go-idle wasp ((this wasp)) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user0)) - (go (method-of-object obj shoot-bridge-wait)) + ((logtest? (-> this fact enemy-options) (enemy-option user0)) + (go (method-of-object this shoot-bridge-wait)) ) - ((logtest? (enemy-option ambush) (-> obj fact enemy-options)) - (go (method-of-object obj ambush)) + ((logtest? (enemy-option ambush) (-> this fact enemy-options)) + (go (method-of-object this ambush)) ) (else - (go (method-of-object obj notice)) + (go (method-of-object this notice)) ) ) (none) ) ;; definition for method 70 of type wasp -(defmethod go-hostile wasp ((obj wasp)) - (go (method-of-object obj hostile)) +(defmethod go-hostile wasp ((this wasp)) + (go (method-of-object this hostile)) ) ;; definition for method 72 of type wasp -(defmethod react-to-focus wasp ((obj wasp)) +(defmethod react-to-focus wasp ((this wasp)) "@TODO - flesh out docs" - (go-hostile obj) + (go-hostile this) ) ;; definition for method 129 of type wasp ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-129 wasp ((obj wasp)) - (if (logtest? (-> obj fact enemy-options) (enemy-option user0)) - (set! (-> obj focus-pos quad) (-> obj plat-pos quad)) - ((method-of-type hover-enemy enemy-method-129) obj) +(defmethod enemy-method-129 wasp ((this wasp)) + (if (logtest? (-> this fact enemy-options) (enemy-option user0)) + (set! (-> this focus-pos quad) (-> this plat-pos quad)) + ((method-of-type hover-enemy enemy-method-129) this) ) (none) ) ;; definition for method 55 of type wasp -(defmethod track-target! wasp ((obj wasp)) +(defmethod track-target! wasp ((this wasp)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (seek! (-> obj gun-x-angle) (-> obj gun-x-angle-final) (* 21845.334 (seconds-per-frame))) - ((method-of-type hover-enemy track-target!) obj) + (seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame))) + ((method-of-type hover-enemy track-target!) this) (none) ) @@ -666,7 +666,7 @@ ) (hover-enemy-method-146 self) (hover-nav-control-method-18 (-> self hover) (-> self path) -1 6) - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (set! (-> self bridge-index) 0) (logclear! (-> self enemy-flags) (enemy-flag enable-on-active checking-water)) (logclear! (-> self mask) (process-mask collectable)) @@ -805,7 +805,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) ) :code (behavior () @@ -819,7 +819,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (set! (-> self restart-fly-anims) #t) (go-virtual shoot-bridge-hostile) ) @@ -873,7 +873,7 @@ (the-as vector #t) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (when (< (vector-vector-distance @@ -913,9 +913,10 @@ ) ) ) - (if (and (>= (- (current-time) (-> self last-fire-time)) - (the int (* 300.0 (rand-vu-float-range (-> self attack-wait-min) (-> self attack-wait-max)))) - ) + (if (and (time-elapsed? + (-> self last-fire-time) + (the int (* 300.0 (rand-vu-float-range (-> self attack-wait-min) (-> self attack-wait-max)))) + ) (get-enemy-target self) ) (go-virtual attack) @@ -956,7 +957,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) ) :code (behavior () @@ -970,7 +971,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self last-fire-time) (current-time)) + (set-time! (-> self last-fire-time)) (set! (-> self restart-fly-anims) #t) (go-hostile self) ) @@ -1115,7 +1116,7 @@ (set! (-> self hit-points) 0) (do-effect (-> self skel effect) 'death-default 0.0 -1) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1127,15 +1128,15 @@ ;; definition for method 107 of type wasp ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target wasp ((obj wasp)) +(defmethod get-enemy-target wasp ((this wasp)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" - (let ((s5-0 (handle->process (-> obj focus handle)))) + (let ((s5-0 (handle->process (-> this focus handle)))) (the-as process-focusable (when s5-0 - (let* ((a0-4 (-> obj root)) + (let* ((a0-4 (-> this root)) (s4-1 (vector+! (new 'stack-no-clear 'vector) (-> a0-4 trans) (-> a0-4 transv))) - (s3-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> obj focus-pos))) + (s3-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this focus-pos))) (s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s5-0) 0))) (s3-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-1 1.0)) ) @@ -1143,8 +1144,8 @@ (not (logtest? (-> (the-as process-focusable s5-0) focus-status) (focus-status disable dead ignore grabbed))) ) (< 0.0 (vector-dot s2-1 s3-2)) - (< (vector-vector-distance s4-1 (-> obj focus-pos)) 225280.0) - (and (< (fabs (vector-x-angle s3-2)) 3640.889) (enemy-method-95 obj (-> obj focus-pos) 5461.3335)) + (< (vector-vector-distance s4-1 (-> this focus-pos)) 225280.0) + (and (< (fabs (vector-x-angle s3-2)) 3640.889) (enemy-method-95 this (-> this focus-pos) 5461.3335)) ) s5-0 ) @@ -1155,20 +1156,20 @@ ) ;; definition for method 77 of type wasp -(defmethod enemy-method-77 wasp ((obj wasp) (arg0 (pointer float))) +(defmethod enemy-method-77 wasp ((this wasp) (arg0 (pointer float))) (cond - ((rng-hit? obj 0.5) - (set! (-> obj knocked-anim) 10) - (set! (-> obj knocked-recover-anim) 11) + ((rng-hit? this 0.5) + (set! (-> this knocked-anim) 10) + (set! (-> this knocked-recover-anim) 11) ) (else - (set! (-> obj knocked-anim) 12) - (set! (-> obj knocked-recover-anim) 13) + (set! (-> this knocked-anim) 12) + (set! (-> this knocked-recover-anim) 13) ) ) (ja-channel-push! 1 0) - (let ((a1-3 (-> obj draw art-group data (-> obj knocked-anim))) - (a0-5 (-> obj skel root-channel 0)) + (let ((a1-3 (-> this draw art-group data (-> this knocked-anim))) + (a0-5 (-> this skel root-channel 0)) ) (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-3)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) @@ -1180,9 +1181,9 @@ ) ;; definition for method 78 of type wasp -(defmethod enemy-method-78 wasp ((obj wasp) (arg0 (pointer float))) - (let ((v1-4 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-3 (-> obj skel root-channel 0)) +(defmethod enemy-method-78 wasp ((this wasp) (arg0 (pointer float))) + (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-3 (-> this skel root-channel 0)) ) (set! (-> a0-3 frame-group) (the-as art-joint-anim v1-4)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-4) frames num-frames) -1))) @@ -1194,41 +1195,41 @@ ) ;; definition for method 80 of type wasp -(defmethod enemy-method-80 wasp ((obj wasp) (arg0 enemy-knocked-info)) - (-> obj root) +(defmethod enemy-method-80 wasp ((this wasp) (arg0 enemy-knocked-info)) + (-> this root) (>= (-> arg0 on-surface-count) 1) ) ;; definition for method 81 of type wasp -(defmethod enemy-method-81 wasp ((obj wasp)) +(defmethod enemy-method-81 wasp ((this wasp)) #f ) ;; definition for method 73 of type wasp -(defmethod kill-prefer-falling wasp ((obj wasp)) +(defmethod kill-prefer-falling wasp ((this wasp)) "If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]" (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'knocked)) - (go (method-of-object obj die-now)) + ((and (-> this next-state) (= (-> this next-state name) 'knocked)) + (go (method-of-object this die-now)) ) - ((-> obj enemy-info use-die-falling) - (go (method-of-object obj die-falling)) + ((-> this enemy-info use-die-falling) + (go (method-of-object this die-falling)) ) (else - (go (method-of-object obj die)) + (go (method-of-object this die)) ) ) ) ;; definition for method 165 of type wasp ;; WARN: Return type mismatch int vs none. -(defmethod spawn-wasp-shot wasp ((obj wasp) (arg0 projectile-init-by-other-params) (arg1 int) (arg2 float) (arg3 float)) - (vector<-cspace! (-> arg0 pos) (-> obj node-list data arg1)) +(defmethod spawn-wasp-shot wasp ((this wasp) (arg0 projectile-init-by-other-params) (arg1 int) (arg2 float) (arg3 float)) + (vector<-cspace! (-> arg0 pos) (-> this node-list data arg1)) (let ((s3-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> obj node-list data arg1 bone transform vector 1) + (-> this node-list data arg1 bone transform vector 1) 1.0 ) (* 273.06668 arg3) @@ -1236,7 +1237,7 @@ ) (a1-8 (vector-normalize-copy! (new 'stack-no-clear 'vector) - (-> obj node-list data arg1 bone transform vector 2) + (-> this node-list data arg1 bone transform vector 2) 1.0 ) ) @@ -1244,16 +1245,16 @@ (vector-orient-by-quat! (-> arg0 vel) a1-8 s3-1) ) (vector-normalize! (-> arg0 vel) 491520.0) - (spawn-projectile wasp-shot arg0 obj *default-dead-pool*) + (spawn-projectile wasp-shot arg0 this *default-dead-pool*) 0 (none) ) ;; definition for method 142 of type wasp ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-142 wasp ((obj wasp)) - (let ((s5-0 (-> obj main-joint-acc)) - (s4-0 (-> obj main-joint-vel)) +(defmethod hover-enemy-method-142 wasp ((this wasp)) + (let ((s5-0 (-> this main-joint-acc)) + (s4-0 (-> this main-joint-vel)) (gp-0 (lambda ((arg0 wasp) (arg1 cspace) (arg2 float) (arg3 float) (arg4 vector) (arg5 vector) (arg6 int)) (local-vars (sv-192 float) (sv-208 quaternion) (sv-224 vector)) @@ -1339,18 +1340,18 @@ ) ) (gp-0 - obj - (-> obj node-list data (-> obj hover-info engine-left)) - (-> obj hover-info thrust-rotate-left) + this + (-> this node-list data (-> this hover-info engine-left)) + (-> this hover-info thrust-rotate-left) -1.0 s5-0 s4-0 0 ) (gp-0 - obj - (-> obj node-list data (-> obj hover-info engine-right)) - (-> obj hover-info thrust-rotate-right) + this + (-> this node-list data (-> this hover-info engine-right)) + (-> this hover-info thrust-rotate-right) 1.0 s5-0 s4-0 @@ -1363,9 +1364,9 @@ ;; definition for method 114 of type wasp ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! wasp ((obj wasp)) +(defmethod init-enemy-collision! wasp ((this wasp)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1467,45 +1468,45 @@ (set! (-> s5-0 backup-collide-with) (-> v1-35 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 10 of type wasp -(defmethod deactivate wasp ((obj wasp)) - (if (nonzero? (-> obj smoke-part)) - (kill-and-free-particles (-> obj smoke-part)) +(defmethod deactivate wasp ((this wasp)) + (if (nonzero? (-> this smoke-part)) + (kill-and-free-particles (-> this smoke-part)) ) - (if (nonzero? (-> obj engine-part)) - (kill-and-free-particles (-> obj engine-part)) + (if (nonzero? (-> this engine-part)) + (kill-and-free-particles (-> this engine-part)) ) - (sound-stop (-> obj sound-id)) - ((method-of-type hover-enemy deactivate) obj) + (sound-stop (-> this sound-id)) + ((method-of-type hover-enemy deactivate) this) (none) ) ;; definition for method 7 of type wasp ;; WARN: Return type mismatch hover-enemy vs wasp. -(defmethod relocate wasp ((obj wasp) (arg0 int)) - (if (nonzero? (-> obj gun-jmod)) - (&+! (-> obj gun-jmod) arg0) +(defmethod relocate wasp ((this wasp) (arg0 int)) + (if (nonzero? (-> this gun-jmod)) + (&+! (-> this gun-jmod) arg0) ) - (if (nonzero? (-> obj smoke-part)) - (&+! (-> obj smoke-part) arg0) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) arg0) ) - (if (nonzero? (-> obj engine-part)) - (&+! (-> obj engine-part) arg0) + (if (nonzero? (-> this engine-part)) + (&+! (-> this engine-part) arg0) ) - (the-as wasp ((method-of-type hover-enemy relocate) obj arg0)) + (the-as wasp ((method-of-type hover-enemy relocate) this arg0)) ) ;; definition for method 149 of type wasp ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-149 wasp ((obj wasp)) +(defmethod hover-enemy-method-149 wasp ((this wasp)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-wasp" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1514,12 +1515,12 @@ ) ;; definition for method 150 of type wasp -(defmethod hover-enemy-method-150 wasp ((obj wasp)) +(defmethod hover-enemy-method-150 wasp ((this wasp)) *wasp-enemy-info* ) ;; definition for method 151 of type wasp -(defmethod hover-enemy-method-151 wasp ((obj wasp)) +(defmethod hover-enemy-method-151 wasp ((this wasp)) (new 'static 'hover-enemy-info :fly-forward-anim 7 :fly-backward-anim 8 @@ -1536,98 +1537,98 @@ ) ;; definition for method 152 of type wasp -(defmethod hover-enemy-method-152 wasp ((obj wasp)) +(defmethod hover-enemy-method-152 wasp ((this wasp)) (new 'static 'hover-nav-params :max-speed 73728.0 :max-acceleration 122880.0 :friction 0.05) ) ;; definition for method 115 of type wasp ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! wasp ((obj wasp)) +(defmethod init-enemy! wasp ((this wasp)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) - (hover-enemy-method-149 obj) - (init-enemy-behaviour-and-stats! obj (hover-enemy-method-150 obj)) - (hover-enemy-method-155 obj) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj scale) (get-rand-float-range obj 0.9 1.3)) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj root dynam gravity y) 327680.0) - (set! (-> obj root dynam gravity-length) 327680.0) - (set! (-> obj root dynam gravity-max) 327680.0) - (set! (-> obj gun-jmod) - (the-as joint-mod (new 'process 'joint-mod-rotate-local obj (-> obj hover-info gun-base) #t)) + (hover-enemy-method-149 this) + (init-enemy-behaviour-and-stats! this (hover-enemy-method-150 this)) + (hover-enemy-method-155 this) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this scale) (get-rand-float-range this 0.9 1.3)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this root dynam gravity y) 327680.0) + (set! (-> this root dynam gravity-length) 327680.0) + (set! (-> this root dynam gravity-max) 327680.0) + (set! (-> this gun-jmod) + (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this hover-info gun-base) #t)) ) - (set! (-> obj gun-x-angle) 0.0) - (set! (-> obj gun-x-angle-final) 0.0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (set! (-> this gun-x-angle) 0.0) + (set! (-> this gun-x-angle-final) 0.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-28 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-28 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (if (and v1-28 (= (-> sv-16 elt-count) 1)) - (set! (-> obj entity-group) (-> v1-28 0)) - (set! (-> obj entity-group) #f) + (set! (-> this entity-group) (-> v1-28 0)) + (set! (-> this entity-group) #f) ) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-32 (res-lump-data (-> obj entity) 'timeout (pointer float) :tag-ptr (& sv-32)))) + (let ((v1-32 (res-lump-data (-> this entity) 'timeout (pointer float) :tag-ptr (& sv-32)))) (cond ((and v1-32 (= (-> sv-32 elt-count) 2)) - (set! (-> obj attack-wait-min) (-> v1-32 0)) - (set! (-> obj attack-wait-max) (-> v1-32 1)) + (set! (-> this attack-wait-min) (-> v1-32 0)) + (set! (-> this attack-wait-max) (-> v1-32 1)) ) (else - (set! (-> obj attack-wait-min) 1.0) - (set! (-> obj attack-wait-max) 3.0) + (set! (-> this attack-wait-min) 1.0) + (set! (-> this attack-wait-max) 3.0) ) ) ) (let ((f30-0 4096.0)) (set! sv-48 (new 'static 'res-tag)) - (let ((v1-39 (res-lump-data (-> obj entity) 'min-max (pointer float) :tag-ptr (& sv-48)))) - (set! (-> obj attack-miss-dist-min) (* f30-0 (if (and v1-39 (> (the-as int (-> sv-48 elt-count)) 0)) - (-> v1-39 0) - -1.0 - ) - ) + (let ((v1-39 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-48)))) + (set! (-> this attack-miss-dist-min) (* f30-0 (if (and v1-39 (> (the-as int (-> sv-48 elt-count)) 0)) + (-> v1-39 0) + -1.0 + ) + ) ) ) ) (let ((f30-1 4096.0)) (set! sv-64 (new 'static 'res-tag)) - (let ((v1-43 (res-lump-data (-> obj entity) 'min-max (pointer float) :tag-ptr (& sv-64)))) - (set! (-> obj attack-miss-dist-max) (* f30-1 (if (and v1-43 (< 1 (the-as int (-> sv-64 elt-count)))) - (-> v1-43 1) - 1.0 - ) - ) + (let ((v1-43 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-64)))) + (set! (-> this attack-miss-dist-max) (* f30-1 (if (and v1-43 (< 1 (the-as int (-> sv-64 elt-count)))) + (-> v1-43 1) + 1.0 + ) + ) ) ) ) - (set! (-> obj path) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (set! (-> obj path-u) 0.0) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj smoke-part) (create-launch-control (-> *part-group-id-table* 154) obj)) - (set! (-> obj engine-part) (create-launch-control (-> *part-group-id-table* 156) obj)) + (set! (-> this path) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (set! (-> this path-u) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 154) this)) + (set! (-> this engine-part) (create-launch-control (-> *part-group-id-table* 156) this)) (add-connection *part-engine* - obj + this 7 - obj + this 318 (new 'static 'vector :x 1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) (add-connection *part-engine* - obj + this 7 - obj + this 318 (new 'static 'vector :x -1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) - (add-connection *part-engine* obj 7 obj 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) + (add-connection *part-engine* this 7 this 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) 0 (none) ) 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 33ba7d557b..6cc53de261 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/metalmonk_REF.gc @@ -19,15 +19,15 @@ ) ;; definition for method 3 of type metalmonk-anim-info -(defmethod inspect metalmonk-anim-info ((obj metalmonk-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalmonk-anim-info ((this metalmonk-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'metalmonk-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "[~8x] ~A~%" this 'metalmonk-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) (label cfg-4) - obj + this ) ;; definition of type metalmonk-global-info @@ -51,25 +51,25 @@ ) ;; definition for method 3 of type metalmonk-global-info -(defmethod inspect metalmonk-global-info ((obj metalmonk-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalmonk-global-info ((this metalmonk-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-yellow-hit: ~D~%" (-> obj prev-yellow-hit)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tidle-anim[3] @ #x~X~%" (-> obj idle-anim)) - (format #t "~1Tpatrol-anim[2] @ #x~X~%" (-> obj patrol-anim)) - (format #t "~1Tnotice-anim[2] @ #x~X~%" (-> obj notice-anim)) - (format #t "~1Tcharge-anim[2] @ #x~X~%" (-> obj charge-anim)) - (format #t "~1Tattack-anim[2] @ #x~X~%" (-> obj attack-anim)) - (format #t "~1Tknocked-anim[2] @ #x~X~%" (-> obj knocked-anim)) - (format #t "~1Tcelebrate-anim[2] @ #x~X~%" (-> obj celebrate-anim)) - (format #t "~1Tyellow-hit-anim[4] @ #x~X~%" (-> obj yellow-hit-anim)) - (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tidle-anim[3] @ #x~X~%" (-> this idle-anim)) + (format #t "~1Tpatrol-anim[2] @ #x~X~%" (-> this patrol-anim)) + (format #t "~1Tnotice-anim[2] @ #x~X~%" (-> this notice-anim)) + (format #t "~1Tcharge-anim[2] @ #x~X~%" (-> this charge-anim)) + (format #t "~1Tattack-anim[2] @ #x~X~%" (-> this attack-anim)) + (format #t "~1Tknocked-anim[2] @ #x~X~%" (-> this knocked-anim)) + (format #t "~1Tcelebrate-anim[2] @ #x~X~%" (-> this celebrate-anim)) + (format #t "~1Tyellow-hit-anim[4] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) (label cfg-4) - obj + this ) ;; definition of type metalmonk @@ -93,21 +93,21 @@ ) ;; definition for method 3 of type metalmonk -(defmethod inspect metalmonk ((obj metalmonk)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalmonk ((this metalmonk)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfocus-pos: #~%" (-> obj focus-pos)) - (format #t "~2Tnew-facing: #~%" (-> obj new-facing)) - (format #t "~2Told-facing: #~%" (-> obj old-facing)) - (format #t "~2Thigh-time: ~D~%" (-> obj high-time)) - (format #t "~2Tintro-path: ~A~%" (-> obj intro-path)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) + (format #t "~2Tnew-facing: #~%" (-> this new-facing)) + (format #t "~2Told-facing: #~%" (-> this old-facing)) + (format #t "~2Thigh-time: ~D~%" (-> this high-time)) + (format #t "~2Tintro-path: ~A~%" (-> this intro-path)) (label cfg-4) - obj + this ) ;; definition for symbol *metalmonk-global-info*, type metalmonk-global-info @@ -306,57 +306,59 @@ ;; definition for method 179 of type metalmonk ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod metalmonk-method-179 metalmonk ((obj metalmonk) (arg0 vector)) - (set! (-> arg0 quad) (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat)) vector 2 quad)) +(defmethod metalmonk-method-179 metalmonk ((this metalmonk) (arg0 vector)) + (set! (-> arg0 quad) + (-> (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)) vector 2 quad) + ) (none) ) ;; definition for method 181 of type metalmonk ;; WARN: Return type mismatch int vs none. -(defmethod metalmonk-method-181 metalmonk ((obj metalmonk) (arg0 float) (arg1 float)) - (let ((f28-0 (vector-dot (-> obj new-facing) (-> obj old-facing))) +(defmethod metalmonk-method-181 metalmonk ((this metalmonk) (arg0 float) (arg1 float)) + (let ((f28-0 (vector-dot (-> this new-facing) (-> this old-facing))) (f30-1 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) ) - (when (and (< f28-0 (cos (* 182.04445 arg0))) (let ((v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (and (< f28-0 (cos (* 182.04445 arg0))) (let ((v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (not (and v1-7 (= v1-7 (-> obj draw art-group data 13)))) + (not (and v1-7 (= v1-7 (-> this draw art-group data 13)))) ) ) (ja-channel-push! 1 (seconds 0.16)) - (let ((v1-13 (-> obj skel root-channel 0))) - (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 13))) + (let ((v1-13 (-> this skel root-channel 0))) + (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) ) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (set! (-> s4-1 num-func) num-func-identity) (set! (-> s4-1 frame-num) (* f30-1 (the float (ja-num-frames 0)))) ) - (set! (-> obj high-time) (current-time)) + (set-time! (-> this high-time)) ) - (let ((v1-22 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-22 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (when (or (not (and v1-22 (or (= v1-22 (-> obj draw art-group data 12)) (= v1-22 (-> obj draw art-group data 13))))) - (let ((v1-28 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (or (not (and v1-22 (or (= v1-22 (-> this draw art-group data 12)) (= v1-22 (-> this draw art-group data 13))))) + (let ((v1-28 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and (and v1-28 (= v1-28 (-> obj draw art-group data 13))) + (and (and v1-28 (= v1-28 (-> this draw art-group data 13))) (< (ja-frame-num 0) 3.0) - (and (< (cos (* 182.04445 arg1)) f28-0) (>= (- (current-time) (-> obj high-time)) (seconds 1))) + (and (< (cos (* 182.04445 arg1)) f28-0) (time-elapsed? (-> this high-time) (seconds 1))) ) ) ) (ja-channel-push! 1 (seconds 0.16)) - (let ((v1-41 (-> obj skel root-channel 0))) - (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (let ((v1-41 (-> this skel root-channel 0))) + (set! (-> v1-41 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) ) - (let ((gp-1 (-> obj skel root-channel 0))) + (let ((gp-1 (-> this skel root-channel 0))) (set! (-> gp-1 num-func) num-func-identity) (set! (-> gp-1 frame-num) (* f30-1 (the float (ja-num-frames 0)))) ) @@ -369,49 +371,49 @@ ;; definition for method 182 of type metalmonk ;; WARN: Return type mismatch int vs none. -(defmethod metalmonk-method-182 metalmonk ((obj metalmonk) (arg0 float) (arg1 float)) - (let ((f28-0 (vector-dot (-> obj new-facing) (-> obj old-facing))) +(defmethod metalmonk-method-182 metalmonk ((this metalmonk) (arg0 float) (arg1 float)) + (let ((f28-0 (vector-dot (-> this new-facing) (-> this old-facing))) (f30-1 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) ) - (when (and (< f28-0 (cos (* 182.04445 arg0))) (let ((v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (and (< f28-0 (cos (* 182.04445 arg0))) (let ((v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (not (and v1-7 (= v1-7 (-> obj draw art-group data 9)))) + (not (and v1-7 (= v1-7 (-> this draw art-group data 9)))) ) ) (ja-channel-push! 1 (seconds 0.16)) - (let ((v1-13 (-> obj skel root-channel 0))) - (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 9))) + (let ((v1-13 (-> this skel root-channel 0))) + (set! (-> v1-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 9))) ) - (let ((s4-1 (-> obj skel root-channel 0))) + (let ((s4-1 (-> this skel root-channel 0))) (set! (-> s4-1 num-func) num-func-identity) (set! (-> s4-1 frame-num) (* f30-1 (the float (ja-num-frames 0)))) ) - (set! (-> obj high-time) (current-time)) + (set-time! (-> this high-time)) ) - (let ((v1-22 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-22 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (when (or (not (and v1-22 (or (= v1-22 (-> obj draw art-group data 8)) (= v1-22 (-> obj draw art-group data 9))))) - (let ((v1-28 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (or (not (and v1-22 (or (= v1-22 (-> this draw art-group data 8)) (= v1-22 (-> this draw art-group data 9))))) + (let ((v1-28 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and (and v1-28 (= v1-28 (-> obj draw art-group data 9))) - (and (< (cos (* 182.04445 arg1)) f28-0) (>= (- (current-time) (-> obj high-time)) (seconds 1))) + (and (and v1-28 (= v1-28 (-> this draw art-group data 9))) + (and (< (cos (* 182.04445 arg1)) f28-0) (time-elapsed? (-> this high-time) (seconds 1))) ) ) ) (ja-channel-push! 1 (seconds 0.5)) - (let ((v1-39 (-> obj skel root-channel 0))) - (set! (-> v1-39 frame-group) (the-as art-joint-anim (-> obj draw art-group data 8))) + (let ((v1-39 (-> this skel root-channel 0))) + (set! (-> v1-39 frame-group) (the-as art-joint-anim (-> this draw art-group data 8))) ) - (let ((gp-1 (-> obj skel root-channel 0))) + (let ((gp-1 (-> this skel root-channel 0))) (set! (-> gp-1 num-func) num-func-identity) (set! (-> gp-1 frame-num) (* f30-1 (the float (ja-num-frames 0)))) ) @@ -425,83 +427,83 @@ ;; definition for method 55 of type metalmonk ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! metalmonk ((obj metalmonk)) +(defmethod track-target! metalmonk ((this metalmonk)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj old-facing quad) (-> obj new-facing quad)) - (metalmonk-method-179 obj (-> obj new-facing)) + (set! (-> this old-facing quad) (-> this new-facing quad)) + (metalmonk-method-179 this (-> this new-facing)) 0 (none) ) ;; definition for method 74 of type metalmonk -(defmethod general-event-handler metalmonk ((obj metalmonk) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler metalmonk ((this metalmonk) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked 'hit-flinch) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (let ((s5-1 (-> obj incoming knocked-type))) + ((zero? (-> this hit-points)) + (let ((s5-1 (-> this incoming knocked-type))) (cond ((and (= s5-1 (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-33 (-> obj next-state name))) - (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) - ) + (not (and (-> this next-state) (let ((v1-33 (-> this next-state name))) + (or (= v1-33 'knocked) (= v1-33 'jump) (= v1-33 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ((or (= s5-1 (knocked-type knocked-type-4)) (= s5-1 (knocked-type knocked-type-6))) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - (go (method-of-object obj knocked)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) + (go (method-of-object this knocked)) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 104 of type metalmonk ;; INFO: Used lq/sq -(defmethod enemy-method-104 metalmonk ((obj metalmonk) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 metalmonk ((this metalmonk) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (let* ((s3-0 arg0) (a0-2 (if (type? s3-0 process-focusable) s3-0 @@ -510,11 +512,11 @@ (s3-1 (new 'stack-no-clear 'vector)) ) (let ((s1-0 (new 'stack-no-clear 'vector))) - (vector-! s3-1 (get-trans (the-as process-focusable a0-2) 0) (-> obj root trans)) + (vector-! s3-1 (get-trans (the-as process-focusable a0-2) 0) (-> this root trans)) (set! (-> s3-1 y) 0.0) (vector-normalize! s3-1 1.0) (set-vector! s1-0 0.0 1.0 0.0 1.0) - (vector-cross! s1-0 s1-0 (-> obj old-facing)) + (vector-cross! s1-0 s1-0 (-> this old-facing)) (vector-normalize! s1-0 1.0) (let ((f0-6 (vector-dot s1-0 s3-1))) (cond @@ -529,24 +531,24 @@ ) ) ) - (vector-normalize! s3-1 (* 1.5 (-> obj enemy-info attack-shove-back))) - (set! (-> s3-1 y) (-> obj enemy-info attack-shove-up)) + (vector-normalize! s3-1 (* 1.5 (-> this enemy-info attack-shove-back))) + (set! (-> s3-1 y) (-> this enemy-info attack-shove-up)) (when (send-event arg0 'attack arg1 - (static-attack-info ((id arg2) (angle 'front) (vector s3-1) (mode (-> obj enemy-info attack-mode)))) + (static-attack-info ((id arg2) (angle 'front) (vector s3-1) (mode (-> this enemy-info attack-mode)))) ) - (enemy-method-105 obj arg0) + (enemy-method-105 this arg0) #t ) ) ) ;; definition for method 84 of type metalmonk -(defmethod enemy-method-84 metalmonk ((obj metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) (let* ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos))) - (f1-1 (fmax (-> obj enemy-info jump-height-min) (* (-> obj enemy-info jump-height-factor) f0-0))) + (f1-1 (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0))) (f0-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y))) (f0-4 (- (fmax (+ (fmin (-> arg0 start-pos y) (-> arg0 dest-pos y)) f1-1) (+ 10240.0 f0-3)) f0-3)) ) @@ -556,21 +558,21 @@ ) ;; definition for method 89 of type metalmonk -(defmethod enemy-method-89 metalmonk ((obj metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) #f ) ;; definition for method 87 of type metalmonk -(defmethod enemy-method-87 metalmonk ((obj metalmonk) (arg0 enemy-jump-info)) - (let ((s5-0 (-> obj draw art-group data (-> obj enemy-info run-anim))) - (v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) +(defmethod enemy-method-87 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) + (let ((s5-0 (-> this draw art-group data (-> this enemy-info run-anim))) + (v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (when (not (and v1-6 (= v1-6 s5-0))) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) + (let ((a0-5 (-> this skel root-channel 0))) (set! (-> a0-5 frame-group) (the-as art-joint-anim s5-0)) (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) (set! (-> a0-5 param 1) (-> arg0 anim-speed)) @@ -583,22 +585,22 @@ ) ;; definition for method 88 of type metalmonk -(defmethod enemy-method-88 metalmonk ((obj metalmonk) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 metalmonk ((this metalmonk) (arg0 enemy-jump-info)) #f ) ;; definition for method 90 of type metalmonk -(defmethod enemy-method-90 metalmonk ((obj metalmonk) (arg0 int) (arg1 enemy-jump-info)) +(defmethod enemy-method-90 metalmonk ((this metalmonk) (arg0 int) (arg1 enemy-jump-info)) (case arg0 ((3) - (let ((a0-1 (-> obj skel root-channel 0))) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) 1.0) (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-loop!) ) #f ) (else - ((method-of-type nav-enemy enemy-method-90) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-90) this arg0 arg1) ) ) ) @@ -666,7 +668,7 @@ ) ) (let ((gp-0 (handle->process (-> self focus handle)))) - (if (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (and gp-0 (or (and (< (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)) 20480.0) (let ((v1-19 (ja-group))) @@ -851,7 +853,7 @@ (t9-0) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy victory) trans))) @@ -861,7 +863,7 @@ ) (let ((a0-1 (handle->process (-> self focus handle)))) (if (and a0-1 - (and (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (and (time-elapsed? (-> self state-time) (seconds 0.05)) (let ((f0-0 (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-1) 0) (-> self root trans))) (f1-0 14336.0) ) @@ -973,16 +975,16 @@ ) ;; definition for method 77 of type metalmonk -(defmethod enemy-method-77 metalmonk ((obj metalmonk) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 metalmonk ((this metalmonk) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 0) (let* ((a2-0 (ash 1 (-> *metalmonk-global-info* prev-yellow-hit))) - (v1-3 (enemy-method-120 obj 4 a2-0)) - (a1-6 (-> obj draw art-group data (-> *metalmonk-global-info* yellow-hit-anim v1-3))) + (v1-3 (enemy-method-120 this 4 a2-0)) + (a1-6 (-> this draw art-group data (-> *metalmonk-global-info* yellow-hit-anim v1-3))) ) (set! (-> *metalmonk-global-info* prev-yellow-hit) v1-3) - (let ((a0-13 (-> obj skel root-channel 0))) + (let ((a0-13 (-> this skel root-channel 0))) (set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) (set! (-> a0-13 param 1) (-> arg0 0)) @@ -993,21 +995,21 @@ ) (((knocked-type knocked-type-6)) (let* ((a2-2 (ash 1 (-> *metalmonk-global-info* prev-blue-hit))) - (v1-12 (enemy-method-120 obj 3 a2-2)) - (s5-1 (-> obj draw art-group data (-> *metalmonk-global-info* blue-hit-anim v1-12))) + (v1-12 (enemy-method-120 this 3 a2-2)) + (s5-1 (-> this draw art-group data (-> *metalmonk-global-info* blue-hit-anim v1-12))) ) (set! (-> *metalmonk-global-info* prev-blue-hit) v1-12) - (let ((v1-15 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-15 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-15 (= v1-15 (-> obj draw art-group data 27))) + (if (and v1-15 (= v1-15 (-> this draw art-group data 27))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-31 (-> obj skel root-channel 0))) + (let ((a0-31 (-> this skel root-channel 0))) (set! (-> a0-31 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-31 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-31 param 1) 1.0) @@ -1018,16 +1020,16 @@ ) (else (let ((s4-1 - (if (< (vector-dot (the-as vector (metalmonk-method-179 obj (new 'stack-no-clear 'vector))) (-> obj root transv)) + (if (< (vector-dot (the-as vector (metalmonk-method-179 this (new 'stack-no-clear 'vector))) (-> this root transv)) 0.0 ) - (-> obj draw art-group data (-> *metalmonk-global-info* knocked-anim (get-rand-int obj 2))) - (-> obj draw art-group data 20) + (-> this draw art-group data (-> *metalmonk-global-info* knocked-anim (get-rand-int this 2))) + (-> this draw art-group data 20) ) ) ) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-38 (-> obj skel root-channel 0))) + (let ((a0-38 (-> this skel root-channel 0))) (set! (-> a0-38 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-38 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-38 param 1) (-> arg0 0)) @@ -1041,13 +1043,13 @@ ) ;; definition for method 78 of type metalmonk -(defmethod enemy-method-78 metalmonk ((obj metalmonk) (arg0 (pointer float))) +(defmethod enemy-method-78 metalmonk ((this metalmonk) (arg0 (pointer float))) (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (let ((s4-0 (-> obj draw art-group data 27))) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-6)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (let ((s4-0 (-> this draw art-group data 27))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-3 param 1) (-> arg0 0)) @@ -1058,24 +1060,24 @@ #t ) ) - ((!= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (let* ((v1-14 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((!= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (let* ((v1-14 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) (s4-1 (cond - ((and v1-14 (= v1-14 (-> obj draw art-group data 16))) - (-> obj draw art-group data 17) + ((and v1-14 (= v1-14 (-> this draw art-group data 16))) + (-> this draw art-group data 17) ) (else - (let ((v1-21 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-21 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-21 (= v1-21 (-> obj draw art-group data 18))) - (-> obj draw art-group data 19) - (-> obj draw art-group data 21) + (if (and v1-21 (= v1-21 (-> this draw art-group data 18))) + (-> this draw art-group data 19) + (-> this draw art-group data 21) ) ) ) @@ -1083,7 +1085,7 @@ ) ) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-14 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-14 param 1) (-> arg0 0)) @@ -1098,8 +1100,8 @@ ;; definition for method 180 of type metalmonk ;; WARN: Return type mismatch int vs none. -(defmethod metalmonk-method-180 metalmonk ((obj metalmonk) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod metalmonk-method-180 metalmonk ((this metalmonk) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 1) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) (if arg0 @@ -1115,9 +1117,9 @@ ;; definition for method 114 of type metalmonk ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! metalmonk ((obj metalmonk)) +(defmethod init-enemy-collision! metalmonk ((this metalmonk)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1218,75 +1220,75 @@ (set! (-> s5-0 backup-collide-with) (-> v1-31 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 60 of type metalmonk -(defmethod coin-flip? metalmonk ((obj metalmonk)) +(defmethod coin-flip? metalmonk ((this metalmonk)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 7 of type metalmonk ;; WARN: Return type mismatch process-focusable vs metalmonk. -(defmethod relocate metalmonk ((obj metalmonk) (arg0 int)) - (if (nonzero? (-> obj intro-path)) - (&+! (-> obj intro-path) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method metalmonk 7)) this arg0) ) ) ;; definition for method 115 of type metalmonk ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! metalmonk ((obj metalmonk)) +(defmethod init-enemy! metalmonk ((this metalmonk)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-metalmonk" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *metalmonk-nav-enemy-info*) - (let ((v1-8 (-> obj neck))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *metalmonk-nav-enemy-info*) + (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) (set! (-> v1-8 nose) (the-as uint 2)) (set! (-> v1-8 ear) (the-as uint 0)) (set-vector! (-> v1-8 twist-max) 10922.667 12743.111 0.0 1.0) (set! (-> v1-8 ignore-angle) 18204.445) ) - (let ((v1-10 (-> obj nav))) + (let ((v1-10 (-> this nav))) (set! (-> v1-10 speed-scale) 1.0) ) 0 - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (set-gravity-length (-> obj root dynam) 573440.0) - (set! (-> obj intro-path) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (metalmonk-method-180 obj #f) - (set! (-> obj high-time) 0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this intro-path) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (metalmonk-method-180 this #f) + (set! (-> this high-time) 0) (add-connection *part-engine* - obj + this 7 - obj + this 4986 (new 'static 'vector :x 1064.96 :y -450.56 :z 1146.88 :w 163840.0) ) (add-connection *part-engine* - obj + this 7 - obj + this 4987 (new 'static 'vector :x -1064.96 :y -450.56 :z 1146.88 :w 163840.0) ) - (add-connection *part-engine* obj 7 obj 4988 (new 'static 'vector :y 1556.48 :z 368.64 :w 163840.0)) + (add-connection *part-engine* this 7 this 4988 (new 'static 'vector :y 1556.48 :z 368.64 :w 163840.0)) 0 (none) ) 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 13f3cabad4..95e4e0a90f 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/spyder_REF.gc @@ -11,21 +11,21 @@ ) ;; definition for method 3 of type spyder-shot -(defmethod inspect spyder-shot ((obj spyder-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect spyder-shot ((this spyder-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type metalhead-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 28 of type spyder-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound spyder-shot ((obj spyder-shot) (arg0 projectile-options)) +(defmethod play-impact-sound spyder-shot ((this spyder-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -42,11 +42,11 @@ ;; definition for method 31 of type spyder-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! spyder-shot ((obj spyder-shot)) +(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)) obj) - (set! (-> obj max-speed) 307200.0) - (set! (-> obj timeout) (seconds 0.267)) + ((the-as (function projectile none) (find-parent-method spyder-shot 31)) this) + (set! (-> this max-speed) 307200.0) + (set! (-> this timeout) (seconds 0.267)) (none) ) @@ -93,32 +93,32 @@ ) ;; definition for method 3 of type spyder -(defmethod inspect spyder ((obj spyder)) - (when (not obj) - (set! obj obj) +(defmethod inspect spyder ((this spyder)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlos: #~%" (-> obj los)) - (format #t "~2Tjoint: ~A~%" (-> obj joint)) - (format #t "~2Tstart-pos: #~%" (-> obj start-pos)) - (format #t "~2Tfocus-pos: #~%" (-> obj focus-pos)) - (format #t "~2Tface-pos: #~%" (-> obj face-pos)) - (format #t "~2Tmy-up-vector: #~%" (-> obj my-up-vector)) - (format #t "~2Tstatus-flags: ~D~%" (-> obj status-flags)) - (format #t "~2Tchange-dir-timer: ~D~%" (-> obj change-dir-timer)) - (format #t "~2Tfire-info[2] @ #x~X~%" (-> obj fire-info)) - (format #t "~2Tjoint-ik[4] @ #x~X~%" (-> obj joint-ik)) - (format #t "~2Tdelta-y-ik[4] @ #x~X~%" (-> obj delta-y-ik)) - (format #t "~2Tpredator-effect?: ~A~%" (-> obj predator-effect?)) - (format #t "~2Tshock-effect-time: ~D~%" (-> obj shock-effect-time)) - (format #t "~2Tshock-effect-end: ~D~%" (-> obj shock-effect-end)) - (format #t "~2Tfade: ~f~%" (-> obj fade)) - (format #t "~2Tdest-fade: ~f~%" (-> obj dest-fade)) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Tjoint: ~A~%" (-> this joint)) + (format #t "~2Tstart-pos: #~%" (-> this start-pos)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) + (format #t "~2Tface-pos: #~%" (-> this face-pos)) + (format #t "~2Tmy-up-vector: #~%" (-> this my-up-vector)) + (format #t "~2Tstatus-flags: ~D~%" (-> this status-flags)) + (format #t "~2Tchange-dir-timer: ~D~%" (-> this change-dir-timer)) + (format #t "~2Tfire-info[2] @ #x~X~%" (-> this fire-info)) + (format #t "~2Tjoint-ik[4] @ #x~X~%" (-> this joint-ik)) + (format #t "~2Tdelta-y-ik[4] @ #x~X~%" (-> this delta-y-ik)) + (format #t "~2Tpredator-effect?: ~A~%" (-> this predator-effect?)) + (format #t "~2Tshock-effect-time: ~D~%" (-> this shock-effect-time)) + (format #t "~2Tshock-effect-end: ~D~%" (-> this shock-effect-end)) + (format #t "~2Tfade: ~f~%" (-> this fade)) + (format #t "~2Tdest-fade: ~f~%" (-> this dest-fade)) (label cfg-4) - obj + this ) ;; definition for symbol *spyder-nav-enemy-info*, type nav-enemy-info @@ -303,45 +303,45 @@ (set! (-> *spyder-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type spyder -(defmethod general-event-handler spyder ((obj spyder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler spyder ((this spyder) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (when (zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + (when (zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4) (knocked-type knocked-type-6)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) 0 ) ) ) - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) (('attack) (if (type? (-> arg0 parent 0) enemy) - (logior! (-> obj status-flags) (spyder-flags spflags-1)) + (logior! (-> this status-flags) (spyder-flags spflags-1)) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('notify) (cond ((= (-> arg3 param 0) 'attack) (cond - ((= (-> arg3 param 1) (handle->process (-> obj focus handle))) + ((= (-> arg3 param 1) (handle->process (-> this focus handle))) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) (process->ppointer arg0)) (set! (-> a1-6 num-params) arg1) @@ -352,64 +352,64 @@ (set! (-> a1-6 param 3) (-> arg3 param 3)) (set! (-> a1-6 param 4) (-> arg3 param 4)) (set! (-> a1-6 param 5) (-> arg3 param 5)) - (send-event-function obj a1-6) + (send-event-function this a1-6) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('uncloak) - (when (!= (-> obj dest-fade) 128.0) - (set! (-> obj shock-effect-end) (+ (current-time) (seconds 1))) - (set! (-> obj dest-fade) 128.0) + (when (!= (-> this dest-fade) 128.0) + (set! (-> this shock-effect-end) (+ (current-time) (seconds 1))) + (set! (-> this dest-fade) 128.0) (sound-play "spyder-uncloak") ) - (send-event obj 'cue-chase) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (send-event this 'cue-chase) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 180 of type spyder ;; WARN: Return type mismatch int vs none. -(defmethod spyder-method-180 spyder ((obj spyder)) - (seek! (-> obj fade) (-> obj dest-fade) (* 500.0 (seconds-per-frame))) - (set! (-> obj draw force-fade) (the-as uint (the int (-> obj fade)))) +(defmethod spyder-method-180 spyder ((this spyder)) + (seek! (-> this fade) (-> this dest-fade) (* 500.0 (seconds-per-frame))) + (set! (-> this draw force-fade) (the-as uint (the int (-> this fade)))) (cond - ((zero? (-> obj draw force-fade)) - (setup-masks (-> obj draw) 16 0) - (setup-masks (-> obj draw) 0 8) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((zero? (-> this draw force-fade)) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 0 8) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) - ((= (-> obj draw force-fade) 128) - (setup-masks (-> obj draw) 0 16) - (setup-masks (-> obj draw) 8 0) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((= (-> this draw force-fade) 128) + (setup-masks (-> this draw) 0 16) + (setup-masks (-> this draw) 8 0) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) (else - (setup-masks (-> obj draw) 16 0) - (setup-masks (-> obj draw) 8 0) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 8 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) ) - (if (< 245760.0 (vector-vector-distance (-> obj root trans) (camera-pos))) - (setup-masks (-> obj draw) 0 16) + (if (< 245760.0 (vector-vector-distance (-> this root trans) (camera-pos))) + (setup-masks (-> this draw) 0 16) ) - (when (< (current-time) (-> obj shock-effect-end)) - (when (>= (- (current-time) (-> obj shock-effect-time)) (seconds 0.04)) - (set! (-> obj shock-effect-time) (current-time)) + (when (< (current-time) (-> this shock-effect-end)) + (when (time-elapsed? (-> this shock-effect-time) (seconds 0.04)) + (set-time! (-> this shock-effect-time)) (process-drawable-shock-skel-effect - obj + this (-> *lightning-spec-id-table* 5) lightning-probe-callback (-> *part-id-table* 166) @@ -426,10 +426,10 @@ ;; definition for method 181 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spyder-method-181 spyder ((obj spyder)) - (let ((a0-2 (handle->process (-> obj focus handle)))) +(defmethod spyder-method-181 spyder ((this spyder)) + (let ((a0-2 (handle->process (-> this focus handle)))) (when a0-2 - (let* ((s5-0 (-> obj root trans)) + (let* ((s5-0 (-> this root trans)) (s2-1 (vector-! (new 'stack-no-clear 'vector) (get-trans (the-as process-focusable a0-2) 0) s5-0)) (f0-0 (vector-length s2-1)) (s4-0 (new 'stack-no-clear 'vector)) @@ -437,16 +437,16 @@ (cond ((>= 143360.0 f0-0) (let ((s3-0 (new 'stack-no-clear 'vector))) - (logxor! (-> obj status-flags) (spyder-flags spflags-4)) - (if (logtest? (-> obj status-flags) (spyder-flags spflags-4)) + (logxor! (-> this status-flags) (spyder-flags spflags-4)) + (if (logtest? (-> this status-flags) (spyder-flags spflags-4)) (set-vector! s3-0 (-> s2-1 z) (-> s2-1 y) (- (-> s2-1 x)) 1.0) (set-vector! s3-0 (- (-> s2-1 z)) (-> s2-1 y) (-> s2-1 x) 1.0) ) (vector-normalize! s3-0 (* 4096.0 (rand-vu-float-range 8.0 16.0))) (clamp-vector-to-mesh-cross-gaps - (-> obj nav) + (-> this nav) s5-0 - (-> obj nav state current-poly) + (-> this nav state current-poly) s3-0 204.8 #f @@ -460,8 +460,8 @@ (vector+! s4-0 s5-0 s2-1) ) ) - (set! (-> obj move-dest quad) (-> s5-0 quad)) - (cloest-point-on-mesh (-> obj nav) (-> obj move-dest) s4-0 (the-as nav-poly #f)) + (set! (-> this move-dest quad) (-> s5-0 quad)) + (cloest-point-on-mesh (-> this nav) (-> this move-dest) s4-0 (the-as nav-poly #f)) ) ) ) @@ -471,17 +471,17 @@ ;; definition for method 77 of type spyder ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 spyder ((obj spyder) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 spyder ((this spyder) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 15))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 15)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 15)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) ) #t ) @@ -491,21 +491,21 @@ (s5-0 (new 'static 'array uint64 3 #x11 #x12 #x13)) (s4-0 (new 'static 'array int32 4 0 0 0 0)) (a2-1 (ash 1 (-> s4-0 0))) - (v1-20 (enemy-method-120 obj a1-4 a2-1)) - (s5-1 (-> obj draw art-group data (-> (the-as (pointer int32) (+ (* v1-20 8) (the-as int s5-0)))))) + (v1-20 (enemy-method-120 this a1-4 a2-1)) + (s5-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-20 8) (the-as int s5-0)))))) ) (set! (-> s4-0 0) v1-20) - (let ((v1-23 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-23 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-23 (= v1-23 (-> obj draw art-group data 20))) + (if (and v1-23 (= v1-23 (-> this draw art-group data 20))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-19 (-> obj skel root-channel 0))) + (let ((a0-19 (-> this skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim s5-1)) (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s5-1) frames num-frames) -1))) (set! (-> a0-19 param 1) 1.0) @@ -517,43 +517,43 @@ ) (((knocked-type knocked-type-0)) (cond - ((zero? (-> obj hit-points)) - (let ((a0-20 (-> obj skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> obj draw art-group data 13))) + ((zero? (-> this hit-points)) + (let ((a0-20 (-> this skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 13)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) ) (set! (-> a0-20 param 1) (-> arg0 0)) (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> obj draw art-group data 13)) num-func-seek!) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) ) #t ) (else - ((method-of-type nav-enemy enemy-method-77) obj arg0) + ((method-of-type nav-enemy enemy-method-77) this arg0) ) ) ) (else - ((method-of-type nav-enemy enemy-method-77) obj arg0) + ((method-of-type nav-enemy enemy-method-77) this arg0) ) ) ) ;; definition for method 78 of type spyder -(defmethod enemy-method-78 spyder ((obj spyder) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 spyder ((this spyder) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (cond - ((zero? (-> obj hit-points)) - (let ((v1-4 (-> obj skel root-channel 0))) - (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + ((zero? (-> this hit-points)) + (let ((v1-4 (-> this skel root-channel 0))) + (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) (set! (-> v1-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) ) (set! (-> v1-4 param 1) 1.0) (set! (-> v1-4 frame-num) 0.0) - (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + (joint-control-channel-group! v1-4 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) ) #t ) @@ -563,31 +563,31 @@ ) ) (((knocked-type knocked-type-0)) - (if (zero? (-> obj hit-points)) + (if (zero? (-> this hit-points)) #t - ((method-of-type nav-enemy enemy-method-78) obj arg0) + ((method-of-type nav-enemy enemy-method-78) this arg0) ) ) (else - ((method-of-type nav-enemy enemy-method-78) obj arg0) + ((method-of-type nav-enemy enemy-method-78) this arg0) ) ) ) ;; definition for method 87 of type spyder -(defmethod enemy-method-87 spyder ((obj spyder) (arg0 enemy-jump-info)) - (let ((s5-0 (-> obj draw art-group data (-> obj enemy-info jump-in-air-anim)))) - (let ((v1-6 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) +(defmethod enemy-method-87 spyder ((this spyder) (arg0 enemy-jump-info)) + (let ((s5-0 (-> this draw art-group data (-> this enemy-info jump-in-air-anim)))) + (let ((v1-6 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-6 (= v1-6 (-> obj draw art-group data (-> obj enemy-info jump-wind-up-anim)))) + ((and v1-6 (= v1-6 (-> this draw art-group data (-> this enemy-info jump-wind-up-anim)))) (ja-channel-push! 1 0) ) (else - (let ((a0-10 (-> obj skel root-channel 0))) + (let ((a0-10 (-> this skel root-channel 0))) (set! (-> a0-10 param 0) 1.0) (joint-control-channel-group! a0-10 (the-as art-joint-anim #f) num-func-loop!) ) @@ -595,7 +595,7 @@ ) ) ) - (let ((a0-12 (-> obj skel root-channel 0))) + (let ((a0-12 (-> this skel root-channel 0))) (set! (-> a0-12 frame-group) (the-as art-joint-anim s5-0)) (set! (-> a0-12 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) (set! (-> a0-12 param 1) (-> arg0 anim-speed)) @@ -647,29 +647,29 @@ ;; definition for method 182 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spyder-method-182 spyder ((obj spyder)) +(defmethod spyder-method-182 spyder ((this spyder)) (cond - ((and (logtest? (-> obj status-flags) (spyder-flags spflags-2)) (!= (-> obj joint scale z) 1.0)) - (seek! (-> obj joint scale z) 1.0 (* 0.8 (seconds-per-frame))) + ((and (logtest? (-> this status-flags) (spyder-flags spflags-2)) (!= (-> this joint scale z) 1.0)) + (seek! (-> this joint scale z) 1.0 (* 0.8 (seconds-per-frame))) ) - ((and (not (logtest? (-> obj status-flags) (spyder-flags spflags-2))) (!= (-> obj joint scale z) 0.0)) - (seek! (-> obj joint scale z) 0.0 (* 0.8 (seconds-per-frame))) + ((and (not (logtest? (-> this status-flags) (spyder-flags spflags-2))) (!= (-> this joint scale z) 0.0)) + (seek! (-> this joint scale z) 0.0 (* 0.8 (seconds-per-frame))) ) ) (let ((s5-0 (new 'stack-no-clear 'quaternion))) - (let ((a1-2 (-> obj node-list data 37 bone transform))) + (let ((a1-2 (-> this node-list data 37 bone transform))) (matrix-with-scale->quaternion s5-0 a1-2) ) - (let ((a1-4 (quaternion-from-two-vectors! (new 'stack-no-clear 'quaternion) (-> obj my-up-vector) *up-vector*))) + (let ((a1-4 (quaternion-from-two-vectors! (new 'stack-no-clear 'quaternion) (-> this my-up-vector) *up-vector*))) (quaternion*! s5-0 a1-4 s5-0) ) - (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> obj face-pos) (-> obj root trans))) - (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this face-pos) (-> this root trans))) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) ) (cond - ((logtest? (-> obj status-flags) (spyder-flags spflags-3)) - (vector-! s4-1 (-> obj face-pos) (-> obj root trans)) - (logclear! (-> obj status-flags) (spyder-flags spflags-3)) + ((logtest? (-> this status-flags) (spyder-flags spflags-3)) + (vector-! s4-1 (-> this face-pos) (-> this root trans)) + (logclear! (-> this status-flags) (spyder-flags spflags-3)) ) (else (set! (-> s4-1 quad) (-> s3-0 quad)) @@ -684,8 +684,8 @@ ) ) (quaternion-slerp! - (the-as quaternion (-> obj joint twist)) - (the-as quaternion (-> obj joint twist)) + (the-as quaternion (-> this joint twist)) + (the-as quaternion (-> this joint twist)) s5-0 (* 10.0 (seconds-per-frame)) ) @@ -697,46 +697,46 @@ ;; definition for method 184 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spyder-method-184 spyder ((obj spyder) (arg0 vector)) - (when (not (logtest? (-> obj status-flags) (spyder-flags spflags-0))) +(defmethod spyder-method-184 spyder ((this spyder) (arg0 vector)) + (when (not (logtest? (-> this status-flags) (spyder-flags spflags-0))) (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> *up-vector* quad)) (let ((s3-0 (new 'stack-no-clear 'quaternion))) - (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> obj root gspot-normal) 4551.1113) + (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this root gspot-normal) 4551.1113) (vector-orient-by-quat! s4-0 s4-0 s3-0) ) - (let ((s3-1 (-> obj my-up-vector))) + (let ((s3-1 (-> this my-up-vector))) (vector-deg-seek s3-1 s3-1 s4-0 (* 16384.0 (seconds-per-frame))) (vector-normalize! s3-1 1.0) - (forward-up-nopitch->quaternion (-> obj root quat) arg0 s3-1) + (forward-up-nopitch->quaternion (-> this root quat) arg0 s3-1) ) ) - (logior! (-> obj status-flags) (spyder-flags spflags-0)) + (logior! (-> this status-flags) (spyder-flags spflags-0)) ) 0 (none) ) ;; definition for method 55 of type spyder -(defmethod track-target! spyder ((obj spyder)) +(defmethod track-target! spyder ((this spyder)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (spyder-method-185 obj) - (spyder-method-184 obj (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (update-trans! (-> obj sound) (-> obj root trans)) - (update! (-> obj sound)) - (spyder-method-182 obj) + (spyder-method-185 this) + (spyder-method-184 this (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (update-trans! (-> this sound) (-> this root trans)) + (update! (-> this sound)) + (spyder-method-182 this) (let ((t9-6 (method-of-type nav-enemy track-target!))) - (t9-6 obj) + (t9-6 this) ) - (logclear! (-> obj status-flags) (spyder-flags spflags-0)) - (if (logtest? (-> obj status-flags) (spyder-flags spflags-5)) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (logclear! (-> this status-flags) (spyder-flags spflags-0)) + (if (logtest? (-> this status-flags) (spyder-flags spflags-5)) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) ) - (if (-> obj predator-effect?) - (spyder-method-180 obj) + (if (-> this predator-effect?) + (spyder-method-180 this) ) (none) ) @@ -752,17 +752,16 @@ ) ;; definition for method 3 of type ik-setup -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect ik-setup ((obj ik-setup)) - (when (not obj) - (set! obj obj) +(defmethod inspect ik-setup ((this ik-setup)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ik-setup) - (format #t "~1Telbow-index: ~D~%" (-> obj elbow-index)) - (format #t "~1Thand-dist: ~f~%" (-> obj hand-dist)) + (format #t "[~8x] ~A~%" this 'ik-setup) + (format #t "~1Telbow-index: ~D~%" (-> this elbow-index)) + (format #t "~1Thand-dist: ~f~%" (-> this hand-dist)) (label cfg-4) - obj + this ) ;; definition for symbol *spyder-ik-setup*, type (inline-array ik-setup) @@ -808,7 +807,7 @@ ;; definition for method 185 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spyder-method-185 spyder ((obj spyder)) +(defmethod spyder-method-185 spyder ((this spyder)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -819,7 +818,7 @@ (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 (-> s5-0 bbox)) - (a0-2 (-> obj root trans)) + (a0-2 (-> this root trans)) (a1-0 (new 'stack-no-clear 'vector)) ) (set! (-> a1-0 x) 22528.0) @@ -829,7 +828,7 @@ (vector-! (the-as vector v1-0) a0-2 a1-0) ) (let ((v1-2 (-> s5-0 bbox max)) - (a0-4 (-> obj root trans)) + (a0-4 (-> this root trans)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 x) 22528.0) @@ -844,8 +843,8 @@ (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (fill-using-bounding-box *collide-cache* s5-0) (dotimes (s4-0 4) - (-> obj joint-ik s4-0 shoulder-matrix-no-ik) - (let ((a2-8 (-> obj joint-ik s4-0 elbow-matrix-no-ik)) + (-> this joint-ik s4-0 shoulder-matrix-no-ik) + (let ((a2-8 (-> this joint-ik s4-0 elbow-matrix-no-ik)) (s3-0 (new 'stack-no-clear 'vector)) ) (let ((v1-15 (new 'stack-no-clear 'vector))) @@ -855,7 +854,7 @@ (let ((a1-3 s3-0)) (let ((a0-9 (-> a2-8 trans))) (let ((a2-9 (-> a2-8 vector 1))) - (let ((a3-3 (-> obj joint-ik s4-0 hand-dist))) + (let ((a3-3 (-> this joint-ik s4-0 hand-dist))) (.mov vf7 a3-3) ) (.lvf vf5 (&-> a2-9 quad)) @@ -868,7 +867,7 @@ (.svf (&-> a1-3 quad) vf6) ) (set! (-> s2-0 quad) (-> s3-0 quad)) - (set! (-> s2-0 y) (-> obj root trans y)) + (set! (-> s2-0 y) (-> this root trans y)) (let ((a2-10 (-> s5-0 start-pos))) (let ((a0-12 s2-0)) (let ((a1-6 v1-15)) @@ -913,12 +912,12 @@ ) ) (let ((f0-15 (fmax -8192.0 (fmin 8192.0 (- (-> s2-0 y) (-> s3-0 y)))))) - (+! (-> obj delta-y-ik s4-0) (* 10.0 (seconds-per-frame) (- f0-15 (-> obj delta-y-ik s4-0)))) + (+! (-> this delta-y-ik s4-0) (* 10.0 (seconds-per-frame) (- f0-15 (-> this delta-y-ik s4-0)))) ) ) ) - (+! (-> s3-0 y) (-> obj delta-y-ik s4-0)) - (handle-copy! (-> obj joint-ik s4-0) s3-0) + (+! (-> s3-0 y) (-> this delta-y-ik s4-0)) + (handle-copy! (-> this joint-ik s4-0) s3-0) ) ) ) @@ -1002,7 +1001,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1014,7 +1013,7 @@ ) :trans (behavior () (let ((f0-0 (vector-vector-xz-distance (-> self root trans) (-> self move-dest)))) - (if (or (>= 4096.0 f0-0) (>= (- (current-time) (-> self state-time)) (seconds 6))) + (if (or (>= 4096.0 f0-0) (time-elapsed? (-> self state-time) (seconds 6))) (go-hostile self) ) ) @@ -1038,18 +1037,18 @@ ;; definition for method 183 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod spyder-method-183 spyder ((obj spyder) (arg0 matrix) (arg1 float)) +(defmethod spyder-method-183 spyder ((this spyder) (arg0 matrix) (arg1 float)) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((v1-0 (-> arg0 vector)) (a1-1 (-> arg0 vector 1)) ) - (set! (-> gp-0 ent) (-> obj entity)) + (set! (-> gp-0 ent) (-> this entity)) (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (set! (-> gp-0 pos quad) (-> v1-0 0 quad)) - (set! (-> gp-0 notify-handle) (process->handle obj)) + (set! (-> gp-0 notify-handle) (process->handle this)) (set! (-> gp-0 owner-handle) (the-as handle #f)) - (set! (-> gp-0 ignore-handle) (process->handle obj)) + (set! (-> gp-0 ignore-handle) (process->handle this)) (let* ((a0-10 *game-info*) (a3-11 (+ (-> a0-10 attack-id) 1)) ) @@ -1059,7 +1058,7 @@ (set! (-> gp-0 timeout) (seconds 4)) (vector-normalize! (vector-! (-> gp-0 vel) a1-1 (the-as vector v1-0)) arg1) ) - (spawn-projectile spyder-shot gp-0 obj *default-dead-pool*) + (spawn-projectile spyder-shot gp-0 this *default-dead-pool*) ) (none) ) @@ -1154,7 +1153,7 @@ (set! (-> self fire-info 1 quad) (-> s2-1 quad)) ) (let ((s3-1 (current-time))) - (until (>= (- (current-time) s3-1) (seconds 0.2)) + (until (time-elapsed? s3-1 (seconds 0.2)) (set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame))) (ja :num! (loop!)) (let ((a0-27 (-> self skel root-channel 1))) @@ -1206,16 +1205,16 @@ ) ;; definition for method 70 of type spyder -(defmethod go-hostile spyder ((obj spyder)) - (if (and (not (logtest? (-> obj status-flags) (spyder-flags spflags-1))) - (-> obj next-state) - (let ((v1-5 (-> obj next-state name))) +(defmethod go-hostile spyder ((this spyder)) + (if (and (not (logtest? (-> this status-flags) (spyder-flags spflags-1))) + (-> this next-state) + (let ((v1-5 (-> this next-state name))) (or (= v1-5 'notice) (= v1-5 'knocked)) ) ) - (go (method-of-object obj attack)) + (go (method-of-object this attack)) ) - (go (method-of-object obj hostile)) + (go (method-of-object this hostile)) ) ;; failed to figure out what this is: @@ -1261,30 +1260,30 @@ ;; definition for method 142 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 spyder ((obj spyder) (arg0 nav-control)) - (let ((t9-0 (method-of-object obj spyder-method-184)) +(defmethod nav-enemy-method-142 spyder ((this spyder) (arg0 nav-control)) + (let ((t9-0 (method-of-object this spyder-method-184)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 quad) (-> a2-0 heading quad)) - (t9-0 obj a1-1) + (t9-0 this a1-1) ) 0 (none) ) ;; definition for method 60 of type spyder -(defmethod coin-flip? spyder ((obj spyder)) +(defmethod coin-flip? spyder ((this spyder)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 63 of type spyder ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 spyder ((obj spyder) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 spyder ((this spyder) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 obj arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 this arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) @@ -1292,9 +1291,9 @@ ;; definition for method 114 of type spyder ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! spyder ((obj spyder)) +(defmethod init-enemy-collision! spyder ((this spyder)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1386,7 +1385,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-28 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1394,84 +1393,104 @@ ;; definition for method 7 of type spyder ;; WARN: Return type mismatch process-focusable vs spyder. -(defmethod relocate spyder ((obj spyder) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(defmethod relocate spyder ((this spyder) (arg0 int)) + (if (nonzero? (-> this joint)) + (&+! (-> this joint) arg0) ) (dotimes (v1-4 4) - (if (nonzero? (-> obj joint-ik v1-4)) - (&+! (-> obj joint-ik v1-4) arg0) + (if (nonzero? (-> this joint-ik v1-4)) + (&+! (-> this joint-ik v1-4) arg0) ) ) (the-as spyder - ((the-as (function process-focusable int process-focusable) (find-parent-method spyder 7)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method spyder 7)) this arg0) ) ) ;; definition for method 115 of type spyder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! spyder ((obj spyder)) +(defmethod init-enemy! spyder ((this spyder)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-spyder" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *spyder-nav-enemy-info*) - (let ((v1-5 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *spyder-nav-enemy-info*) + (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) (set! (-> v1-5 ear) (the-as uint 0)) (set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0) (set! (-> v1-5 ignore-angle) 30947.555) ) - (let ((v1-7 (-> obj nav))) + (let ((v1-7 (-> this nav))) (set! (-> v1-7 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) - (set! (-> obj my-up-vector quad) (-> *up-vector* quad)) - (set! (-> obj status-flags) (spyder-flags spflags-2)) + (set-gravity-length (-> this root dynam) 573440.0) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (set! (-> this my-up-vector quad) (-> *up-vector* quad)) + (set! (-> this status-flags) (spyder-flags spflags-2)) (if (rand-vu-percent? 0.5) - (logior! (-> obj status-flags) (spyder-flags spflags-4)) + (logior! (-> this status-flags) (spyder-flags spflags-4)) ) - (set! (-> obj start-pos quad) (-> obj root trans quad)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "spyder-talk" :fo-max 70) (-> obj root trans)) + (set! (-> this start-pos quad) (-> this root trans quad)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "spyder-talk" :fo-max 70) (-> this root trans)) ) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd obstacle)) - (set! (-> obj joint) (the-as joint-mod (new 'process 'joint-mod-blend-world obj 4 #t 1.0))) - (set! (-> obj joint scale x) (the-as float (logior (the-as int (-> obj joint scale x)) 4))) - (let ((f30-0 (-> obj root trans y))) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle)) + (set! (-> this joint) (the-as joint-mod (new 'process 'joint-mod-blend-world this 4 #t 1.0))) + (set! (-> this joint scale x) (the-as float (logior (the-as int (-> this joint scale x)) 4))) + (let ((f30-0 (-> this root trans y))) (dotimes (s5-1 4) - (set! (-> obj joint-ik s5-1) - (new 'process 'joint-mod-ik obj (-> *spyder-ik-setup* s5-1 elbow-index) (-> *spyder-ik-setup* s5-1 hand-dist)) + (set! (-> this joint-ik s5-1) + (new + 'process + 'joint-mod-ik + this + (-> *spyder-ik-setup* s5-1 elbow-index) + (-> *spyder-ik-setup* s5-1 hand-dist) + ) ) - (enable-set! (-> obj joint-ik s5-1) #f) - (set! (-> obj delta-y-ik 0) f30-0) + (enable-set! (-> this joint-ik s5-1) #f) + (set! (-> this delta-y-ik 0) f30-0) ) ) (cond - ((>= (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (setup-masks (-> obj draw) 16 0) - (setup-masks (-> obj draw) 8 0) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) - (set! (-> obj draw force-fade) (the-as uint 0)) - (set! (-> obj fade) 0.0) - (set! (-> obj dest-fade) 0.0) - (set! (-> obj predator-effect?) #t) + ((>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) + (setup-masks (-> this draw) 16 0) + (setup-masks (-> this draw) 8 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> this draw force-fade) (the-as uint 0)) + (set! (-> this fade) 0.0) + (set! (-> this dest-fade) 0.0) + (set! (-> this predator-effect?) #t) ) (else - (setup-masks (-> obj draw) 0 16) - (setup-masks (-> obj draw) 8 0) - (set! (-> obj predator-effect?) #f) + (setup-masks (-> this draw) 0 16) + (setup-masks (-> this draw) 8 0) + (set! (-> this predator-effect?) #f) ) ) - (add-connection *part-engine* obj 7 obj 318 (new 'static 'vector :x 901.12 :y -983.04 :z 942.08 :w 163840.0)) - (add-connection *part-engine* obj 7 obj 318 (new 'static 'vector :x -901.12 :y -983.04 :z 942.08 :w 163840.0)) + (add-connection + *part-engine* + this + 7 + this + 318 + (new 'static 'vector :x 901.12 :y -983.04 :z 942.08 :w 163840.0) + ) + (add-connection + *part-engine* + this + 7 + this + 318 + (new 'static 'vector :x -901.12 :y -983.04 :z 942.08 :w 163840.0) + ) 0 (none) ) 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 3a905aee71..e26aaf0f0a 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 @@ -17,19 +17,19 @@ ) ;; definition for method 3 of type com-elevator -(defmethod inspect com-elevator ((obj com-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect com-elevator ((this com-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcamera-startup[2] @ #x~X~%" (-> obj camera-startup)) - (format #t "~2Tuse-camera-startup?[2] @ #x~X~%" (-> obj use-camera-startup?)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tcamera-startup[2] @ #x~X~%" (-> this camera-startup)) + (format #t "~2Tuse-camera-startup?[2] @ #x~X~%" (-> this use-camera-startup?)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -39,25 +39,25 @@ ) ;; definition for method 30 of type com-elevator -(defmethod get-art-group com-elevator ((obj com-elevator)) +(defmethod get-art-group com-elevator ((this com-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-com-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 43 of type com-elevator -(defmethod move-between-points com-elevator ((obj com-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points com-elevator ((this com-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) ) ) @@ -65,7 +65,7 @@ ) ;; definition for method 45 of type com-elevator -(defmethod commited-to-ride? com-elevator ((obj com-elevator)) +(defmethod commited-to-ride? com-elevator ((this com-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) @@ -75,13 +75,13 @@ ) (and (when a0-2 (let* ((v1-2 (get-trans a0-2 0)) - (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-2 (-> obj root trans))) + (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-2 (-> this root trans))) ) - (vector-inv-orient-by-quat! s5-2 s5-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s5-2 s5-2 (-> this root quat)) (and (< (fabs (-> s5-2 x)) 20480.0) (< 0.0 (-> s5-2 z)) (< (-> s5-2 z) 40960.0)) ) ) - (let ((gp-1 (res-lump-struct (-> obj entity) 'on-notice structure))) + (let ((gp-1 (res-lump-struct (-> this entity) 'on-notice structure))) (not (if gp-1 (script-eval (the-as pair gp-1)) ) @@ -93,8 +93,8 @@ ;; definition for method 49 of type com-elevator ;; WARN: Return type mismatch int vs none. -(defmethod com-elevator-method-49 com-elevator ((obj com-elevator) (arg0 symbol)) - (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) +(defmethod com-elevator-method-49 com-elevator ((this com-elevator) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle pusher)) @@ -150,7 +150,7 @@ ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -181,54 +181,54 @@ ) ;; definition for method 40 of type com-elevator -(defmethod activate-elevator com-elevator ((obj com-elevator)) +(defmethod activate-elevator com-elevator ((this com-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (cond - ((logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) - (go (method-of-object obj dormant)) + ((logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this dormant)) ) - ((logtest? (-> obj params flags) (elevator-flags elevator-flags-6)) - (go (method-of-object obj arrived)) + ((logtest? (-> this params flags) (elevator-flags elevator-flags-6)) + (go (method-of-object this arrived)) ) (else - (go (method-of-object obj waiting)) + (go (method-of-object this waiting)) ) ) ) ;; definition for method 10 of type com-elevator -(defmethod deactivate com-elevator ((obj com-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method com-elevator 10)) obj) +(defmethod deactivate com-elevator ((this com-elevator)) + (sound-stop (-> this sound-id)) + ((the-as (function elevator none) (find-parent-method com-elevator 10)) this) (none) ) ;; definition for method 33 of type com-elevator ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! com-elevator ((obj com-elevator)) +(defmethod init-plat! com-elevator ((this com-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." - (dotimes (s5-0 (-> obj path curve num-cverts)) - (let ((a1-1 (res-lump-struct (-> obj entity) 'string-startup-vector structure :time (the float s5-0)))) + (dotimes (s5-0 (-> this path curve num-cverts)) + (let ((a1-1 (res-lump-struct (-> this entity) 'string-startup-vector structure :time (the float s5-0)))) (cond (a1-1 - (vector-normalize-copy! (-> obj camera-startup s5-0) (the-as vector a1-1) 1.0) - (set! (-> obj use-camera-startup? s5-0) #t) + (vector-normalize-copy! (-> this camera-startup s5-0) (the-as vector a1-1) 1.0) + (set! (-> this use-camera-startup? s5-0) #t) ) (else - (set! (-> obj use-camera-startup? s5-0) #f) + (set! (-> this use-camera-startup? s5-0) #f) ) ) ) ) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this sound-id) (new-sound-id)) (none) ) ;; definition for method 31 of type com-elevator -(defmethod init-plat-collision! com-elevator ((obj com-elevator)) +(defmethod init-plat-collision! com-elevator ((this com-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -261,9 +261,9 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (com-elevator-method-49 obj #f) + (com-elevator-method-49 this #f) (none) ) @@ -278,17 +278,17 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 3 of type tomb-trans-elevator -(defmethod inspect tomb-trans-elevator ((obj tomb-trans-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-trans-elevator ((this tomb-trans-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -318,7 +318,7 @@ For example for an elevator pre-compute the distance between the first and last ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -348,18 +348,18 @@ 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 ((obj tomb-trans-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 10)) obj) +(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) (none) ) ;; definition for method 33 of type tomb-trans-elevator ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! tomb-trans-elevator ((obj tomb-trans-elevator)) +(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)) obj) - (set! (-> obj sound-id) (new-sound-id)) + ((the-as (function com-elevator none) (find-parent-method tomb-trans-elevator 33)) this) + (set! (-> this sound-id) (new-sound-id)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc index 5aec2e9582..957b0a5f21 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/cty-guard-turret-button_REF.gc @@ -20,24 +20,24 @@ ) ;; definition for method 3 of type cty-guard-turret-button -(defmethod inspect cty-guard-turret-button ((obj cty-guard-turret-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect cty-guard-turret-button ((this cty-guard-turret-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type basebutton inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type cty-guard-turret-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 cty-guard-turret-button ((obj cty-guard-turret-button)) +(defmethod basebutton-method-33 cty-guard-turret-button ((this cty-guard-turret-button)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cty-guard-turret-button" (the-as (pointer uint32) #f)) @@ -46,23 +46,23 @@ ) (ja-channel-set! 1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) - (let ((s5-1 (-> obj skel root-channel 0))) + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) ) ) (else - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) @@ -75,9 +75,9 @@ ;; definition for method 34 of type cty-guard-turret-button ;; WARN: Return type mismatch collide-shape vs none. -(defmethod basebutton-method-34 cty-guard-turret-button ((obj cty-guard-turret-button)) +(defmethod basebutton-method-34 cty-guard-turret-button ((this cty-guard-turret-button)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) @@ -106,17 +106,17 @@ (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; definition for method 35 of type cty-guard-turret-button ;; WARN: Return type mismatch symbol vs none. -(defmethod prepare-trigger-event! cty-guard-turret-button ((obj cty-guard-turret-button)) +(defmethod prepare-trigger-event! cty-guard-turret-button ((this cty-guard-turret-button)) "Sets `event-going-down` to `'trigger`" - (logior! (-> obj button-status) (button-status button-status-4)) - (set! (-> obj event-going-down) 'trigger) + (logior! (-> this button-status) (button-status button-status-4)) + (set! (-> this event-going-down) 'trigger) (none) ) @@ -138,21 +138,21 @@ ) ;; definition for method 32 of type cty-guard-turret-button -(defmethod idle-state-transition cty-guard-turret-button ((obj cty-guard-turret-button)) +(defmethod idle-state-transition cty-guard-turret-button ((this cty-guard-turret-button)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" - (setup-masks (-> obj draw) 0 -1) + (setup-masks (-> this draw) 0 -1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) + ((logtest? (-> this button-status) (button-status pressed)) (format #t "off~%") - (setup-masks (-> obj draw) 4 0) - (setup-masks (-> obj draw) 1 0) - (go (method-of-object obj down-idle)) + (setup-masks (-> this draw) 4 0) + (setup-masks (-> this draw) 1 0) + (go (method-of-object this down-idle)) ) (else (format #t "on~%") - (setup-masks (-> obj draw) 4 0) - (setup-masks (-> obj draw) 2 0) - (go (method-of-object obj pop-up)) + (setup-masks (-> this draw) 4 0) + (setup-masks (-> this draw) 2 0) + (go (method-of-object this pop-up)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc index 4448f221df..700ce91237 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/fort-floor-spike_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type spike-row-info -(defmethod inspect spike-row-info ((obj spike-row-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect spike-row-info ((this spike-row-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'spike-row-info) - (format #t "~1Tsync: #~%" (-> obj sync)) - (format #t "~1Ttable-ptr: #x~X~%" (-> obj table-ptr)) - (format #t "~1Ton-ratio: ~f~%" (-> obj on-ratio)) - (format #t "~1Tstate: ~D~%" (-> obj state)) + (format #t "[~8x] ~A~%" this 'spike-row-info) + (format #t "~1Tsync: #~%" (-> this sync)) + (format #t "~1Ttable-ptr: #x~X~%" (-> this table-ptr)) + (format #t "~1Ton-ratio: ~f~%" (-> this on-ratio)) + (format #t "~1Tstate: ~D~%" (-> this state)) (label cfg-4) - obj + this ) ;; definition of type spike-row-info-array @@ -38,17 +38,17 @@ ) ;; definition for method 3 of type spike-row-info-array -(defmethod inspect spike-row-info-array ((obj spike-row-info-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect spike-row-info-array ((this spike-row-info-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -75,21 +75,21 @@ ) ;; definition for method 3 of type fort-floor-spike -(defmethod inspect fort-floor-spike ((obj fort-floor-spike)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-floor-spike ((this fort-floor-spike)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpos-table: #x~X~%" (-> obj pos-table)) - (format #t "~2Tspike-row: ~A~%" (-> obj spike-row)) - (format #t "~2Tspike-dim[2] @ #x~X~%" (-> obj spike-dim)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tno-overlap-timer: ~D~%" (-> obj no-overlap-timer)) + (format #t "~2Tpos-table: #x~X~%" (-> this pos-table)) + (format #t "~2Tspike-row: ~A~%" (-> this spike-row)) + (format #t "~2Tspike-dim[2] @ #x~X~%" (-> this spike-dim)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tno-overlap-timer: ~D~%" (-> this no-overlap-timer)) (label cfg-4) - obj + this ) ;; definition for function joint-mod-set-y-callback @@ -111,7 +111,7 @@ ;; definition for method 21 of type fort-floor-spike ;; WARN: Return type mismatch int vs none. -(defmethod init-spike-joints! fort-floor-spike ((obj fort-floor-spike)) +(defmethod init-spike-joints! fort-floor-spike ((this fort-floor-spike)) "Initializes the skeleton and joints for the spike" 0 (none) @@ -119,14 +119,14 @@ ;; definition for method 22 of type fort-floor-spike ;; WARN: Return type mismatch int vs collide-shape-moving. -(defmethod init-spike-collision! fort-floor-spike ((obj fort-floor-spike)) +(defmethod init-spike-collision! fort-floor-spike ((this fort-floor-spike)) "Initializes the collision for the particular spike" (the-as collide-shape-moving 0) ) ;; definition for method 23 of type fort-floor-spike ;; WARN: Return type mismatch int vs symbol. -(defmethod init-periodic-animation! fort-floor-spike ((obj fort-floor-spike)) +(defmethod init-periodic-animation! fort-floor-spike ((this fort-floor-spike)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (the-as symbol 0) ) @@ -218,33 +218,33 @@ ;; definition for method 7 of type fort-floor-spike ;; WARN: Return type mismatch process-drawable vs fort-floor-spike. -(defmethod relocate fort-floor-spike ((obj fort-floor-spike) (arg0 int)) - (if (nonzero? (-> obj spike-row)) - (&+! (-> obj spike-row) arg0) +(defmethod relocate fort-floor-spike ((this fort-floor-spike) (arg0 int)) + (if (nonzero? (-> this spike-row)) + (&+! (-> this spike-row) arg0) ) - (the-as fort-floor-spike ((method-of-type process-drawable relocate) obj arg0)) + (the-as fort-floor-spike ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type fort-floor-spike ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-floor-spike ((obj fort-floor-spike) (arg0 entity-actor)) +(defmethod init-from-entity! fort-floor-spike ((this fort-floor-spike) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-spike-collision! obj) - (process-drawable-from-entity! obj arg0) - (init-spike-joints! obj) - (init-periodic-animation! obj) + (init-spike-collision! this) + (process-drawable-from-entity! this arg0) + (init-spike-joints! this) + (init-periodic-animation! this) (let* ((v1-6 *game-info*) (a0-6 (+ (-> v1-6 attack-id) 1)) ) (set! (-> v1-6 attack-id) a0-6) - (set! (-> obj attack-id) (the-as int a0-6)) + (set! (-> this attack-id) (the-as int a0-6)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -282,33 +282,33 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-floor-spike-a -(defmethod inspect fort-floor-spike-a ((obj fort-floor-spike-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-floor-spike-a ((this fort-floor-spike-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type fort-floor-spike inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 21 of type fort-floor-spike-a ;; WARN: Return type mismatch int vs none. -(defmethod init-spike-joints! fort-floor-spike-a ((obj fort-floor-spike-a)) +(defmethod init-spike-joints! fort-floor-spike-a ((this fort-floor-spike-a)) "Initializes the skeleton and joints for the spike" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-floor-spike-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-3 frame-num) 0.0) (joint-control-channel-group-eval! a0-3 - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) ) @@ -318,10 +318,10 @@ This commonly includes things such as: ;; definition for method 22 of type fort-floor-spike-a ;; INFO: Used lq/sq -(defmethod init-spike-collision! fort-floor-spike-a ((obj fort-floor-spike-a)) +(defmethod init-spike-collision! fort-floor-spike-a ((this fort-floor-spike-a)) "Initializes the collision for the particular spike" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -367,39 +367,39 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) ;; definition for method 23 of type fort-floor-spike-a ;; INFO: Used lq/sq -(defmethod init-periodic-animation! fort-floor-spike-a ((obj fort-floor-spike-a)) +(defmethod init-periodic-animation! fort-floor-spike-a ((this fort-floor-spike-a)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 2) (s4-0 4) ) - (set! (-> obj spike-dim 0) s5-0) - (set! (-> obj spike-dim 1) s4-0) - (set! (-> obj spike-row) (new 'process 'spike-row-info-array s5-0)) - (set! (-> obj pos-table) (new 'static 'inline-array vector 8 - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - ) + (set! (-> this spike-dim 0) s5-0) + (set! (-> this spike-dim 1) s4-0) + (set! (-> this spike-row) (new 'process 'spike-row-info-array s5-0)) + (set! (-> this pos-table) (new 'static 'inline-array vector 8 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) ) - (let ((s3-0 (-> obj pos-table)) + (let ((s3-0 (-> this pos-table)) (s2-0 4) (s1-0 11) ) (dotimes (s0-0 (+ (- 1 s2-0) s1-0)) - (set! sv-64 (-> obj node-list data (+ s2-0 s0-0))) + (set! sv-64 (-> this node-list data (+ s2-0 s0-0))) (vector<-cspace! (-> s3-0 s0-0) sv-64) (set! (-> s3-0 s0-0 y) 0.0) (set! (-> sv-64 param0) joint-mod-set-y-callback) @@ -408,7 +408,7 @@ This commonly includes things such as: ) ) (dotimes (s3-1 s5-0) - (let ((s2-1 (-> obj spike-row data s3-1))) + (let ((s2-1 (-> this spike-row data s3-1))) (let ((a1-2 (new 'stack-no-clear 'sync-info-params))) (let ((v1-19 0)) (if #t @@ -426,7 +426,7 @@ This commonly includes things such as: ) (set! (-> s2-1 on-ratio) 0.375) (set! (-> s2-1 state) 0) - (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> obj pos-table (* s3-1 s4-0)))) + (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> this pos-table (* s3-1 s4-0)))) ) ) ) @@ -443,33 +443,33 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-floor-spike-b -(defmethod inspect fort-floor-spike-b ((obj fort-floor-spike-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-floor-spike-b ((this fort-floor-spike-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type fort-floor-spike inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 21 of type fort-floor-spike-b ;; WARN: Return type mismatch int vs none. -(defmethod init-spike-joints! fort-floor-spike-b ((obj fort-floor-spike-b)) +(defmethod init-spike-joints! fort-floor-spike-b ((this fort-floor-spike-b)) "Initializes the skeleton and joints for the spike" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-floor-spike-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-3 frame-num) 0.0) (joint-control-channel-group-eval! a0-3 - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) ) @@ -479,10 +479,10 @@ This commonly includes things such as: ;; definition for method 22 of type fort-floor-spike-b ;; INFO: Used lq/sq -(defmethod init-spike-collision! fort-floor-spike-b ((obj fort-floor-spike-b)) +(defmethod init-spike-collision! fort-floor-spike-b ((this fort-floor-spike-b)) "Initializes the collision for the particular spike" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -539,41 +539,41 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) ;; definition for method 23 of type fort-floor-spike-b ;; INFO: Used lq/sq -(defmethod init-periodic-animation! fort-floor-spike-b ((obj fort-floor-spike-b)) +(defmethod init-periodic-animation! fort-floor-spike-b ((this fort-floor-spike-b)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 2) (s4-0 5) ) - (set! (-> obj spike-dim 0) s5-0) - (set! (-> obj spike-dim 1) s4-0) - (set! (-> obj spike-row) (new 'process 'spike-row-info-array s5-0)) - (set! (-> obj pos-table) (new 'static 'inline-array vector 10 - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - ) + (set! (-> this spike-dim 0) s5-0) + (set! (-> this spike-dim 1) s4-0) + (set! (-> this spike-row) (new 'process 'spike-row-info-array s5-0)) + (set! (-> this pos-table) (new 'static 'inline-array vector 10 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) ) - (let ((s3-0 (-> obj pos-table)) + (let ((s3-0 (-> this pos-table)) (s2-0 4) (s1-0 13) ) (dotimes (s0-0 (+ (- 1 s2-0) s1-0)) - (set! sv-64 (-> obj node-list data (+ s2-0 s0-0))) + (set! sv-64 (-> this node-list data (+ s2-0 s0-0))) (vector<-cspace! (-> s3-0 s0-0) sv-64) (set! (-> s3-0 s0-0 y) 0.0) (set! (-> sv-64 param0) joint-mod-set-y-callback) @@ -582,7 +582,7 @@ This commonly includes things such as: ) ) (dotimes (s3-1 s5-0) - (let ((s2-1 (-> obj spike-row data s3-1))) + (let ((s2-1 (-> this spike-row data s3-1))) (let ((a1-2 (new 'stack-no-clear 'sync-info-params))) (let ((v1-19 0)) (if #t @@ -600,7 +600,7 @@ This commonly includes things such as: ) (set! (-> s2-1 on-ratio) 0.375) (set! (-> s2-1 state) 0) - (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> obj pos-table (* s3-1 s4-0)))) + (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> this pos-table (* s3-1 s4-0)))) ) ) ) @@ -617,33 +617,33 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-floor-spike-c -(defmethod inspect fort-floor-spike-c ((obj fort-floor-spike-c)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-floor-spike-c ((this fort-floor-spike-c)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type fort-floor-spike inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 21 of type fort-floor-spike-c ;; WARN: Return type mismatch int vs none. -(defmethod init-spike-joints! fort-floor-spike-c ((obj fort-floor-spike-c)) +(defmethod init-spike-joints! fort-floor-spike-c ((this fort-floor-spike-c)) "Initializes the skeleton and joints for the spike" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-floor-spike-c" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((channel (-> obj skel root-channel 0))) - (set! (-> channel frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((channel (-> this skel root-channel 0))) + (set! (-> channel frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> channel frame-num) 0.0) (joint-control-channel-group-eval! channel - (the-as art-joint-anim (-> obj draw art-group data 4)) + (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity ) ) @@ -653,10 +653,10 @@ This commonly includes things such as: ;; definition for method 22 of type fort-floor-spike-c ;; INFO: Used lq/sq -(defmethod init-spike-collision! fort-floor-spike-c ((obj fort-floor-spike-c)) +(defmethod init-spike-collision! fort-floor-spike-c ((this fort-floor-spike-c)) "Initializes the collision for the particular spike" (local-vars (prim-mesh collide-shape-prim-mesh) (sv-32 type) (sv-48 collide-shape-moving)) - (let ((cshape-moving (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape-moving dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape-moving reaction) cshape-reaction-default) (set! (-> cshape-moving no-reaction) @@ -718,46 +718,46 @@ This commonly includes things such as: (set! (-> cshape-moving backup-collide-with) (-> root-prim prim-core collide-with)) ) (set! (-> cshape-moving event-self) 'touched) - (set! (-> obj root) cshape-moving) + (set! (-> this root) cshape-moving) cshape-moving ) ) ;; definition for method 23 of type fort-floor-spike-c ;; INFO: Used lq/sq -(defmethod init-periodic-animation! fort-floor-spike-c ((obj fort-floor-spike-c)) +(defmethod init-periodic-animation! fort-floor-spike-c ((this fort-floor-spike-c)) "Initialzes the periodic animation of the spikes (exit and re-entry)" (local-vars (sv-64 cspace)) (let ((s5-0 3) (s4-0 5) ) - (set! (-> obj spike-dim 0) s5-0) - (set! (-> obj spike-dim 1) s4-0) - (set! (-> obj spike-row) (new 'process 'spike-row-info-array s5-0)) - (set! (-> obj pos-table) (new 'static 'inline-array vector 15 - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - (new 'static 'vector) - ) + (set! (-> this spike-dim 0) s5-0) + (set! (-> this spike-dim 1) s4-0) + (set! (-> this spike-row) (new 'process 'spike-row-info-array s5-0)) + (set! (-> this pos-table) (new 'static 'inline-array vector 15 + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + (new 'static 'vector) + ) ) - (let ((s3-0 (-> obj pos-table)) + (let ((s3-0 (-> this pos-table)) (s2-0 4) (s1-0 18) ) (dotimes (s0-0 (+ (- 1 s2-0) s1-0)) - (set! sv-64 (-> obj node-list data (+ s2-0 s0-0))) + (set! sv-64 (-> this node-list data (+ s2-0 s0-0))) (vector<-cspace! (-> s3-0 s0-0) sv-64) (set! (-> s3-0 s0-0 y) 0.0) (set! (-> sv-64 param0) joint-mod-set-y-callback) @@ -766,7 +766,7 @@ This commonly includes things such as: ) ) (dotimes (s3-1 s5-0) - (let ((s2-1 (-> obj spike-row data s3-1))) + (let ((s2-1 (-> this spike-row data s3-1))) (let ((a1-2 (new 'stack-no-clear 'sync-info-params))) (let ((v1-19 0)) (if #t @@ -784,7 +784,7 @@ This commonly includes things such as: ) (set! (-> s2-1 on-ratio) 0.375) (set! (-> s2-1 state) 0) - (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> obj pos-table (* s3-1 s4-0)))) + (set! (-> s2-1 table-ptr) (the-as (inline-array vector) (-> this pos-table (* s3-1 s4-0)))) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc b/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc index e867e13ae1..3a2f0d1e01 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/gun-buoy_REF.gc @@ -17,22 +17,22 @@ ) ;; definition for method 3 of type gun-buoy-shot -(defmethod inspect gun-buoy-shot ((obj gun-buoy-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-buoy-shot ((this gun-buoy-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type guard-shot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttail-pos: #~%" (-> obj tail-pos)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) (label cfg-4) - obj + this ) ;; definition for method 28 of type gun-buoy-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound gun-buoy-shot ((obj gun-buoy-shot) (arg0 projectile-options)) +(defmethod play-impact-sound gun-buoy-shot ((this gun-buoy-shot) (arg0 projectile-options)) (if (zero? arg0) (sound-play "buoy-shot") ) @@ -119,9 +119,9 @@ ;; definition for method 30 of type gun-buoy-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! gun-buoy-shot ((obj gun-buoy-shot)) +(defmethod init-proj-collision! gun-buoy-shot ((this gun-buoy-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -157,9 +157,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 @@ -168,17 +168,17 @@ ;; definition for method 31 of type gun-buoy-shot ;; INFO: Used lq/sq -(defmethod init-proj-settings! gun-buoy-shot ((obj gun-buoy-shot)) +(defmethod init-proj-settings! gun-buoy-shot ((this gun-buoy-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj hit-actor?) #f) - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'explode) - (set! (-> obj max-speed) 737280.0) - (set! (-> obj move) gun-buoy-shot-move) - (set! (-> obj timeout) (seconds 2.78)) - (set! (-> obj damage) 1024.0) - (logior! (-> obj options) (projectile-options deal-damage ignore-impact)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'explode) + (set! (-> this max-speed) 737280.0) + (set! (-> this move) gun-buoy-shot-move) + (set! (-> this timeout) (seconds 2.78)) + (set! (-> this damage) 1024.0) + (logior! (-> this options) (projectile-options deal-damage ignore-impact)) + (set-gravity-length (-> this root dynam) 573440.0) (none) ) @@ -327,35 +327,35 @@ ) ;; definition for method 3 of type gun-buoy -(defmethod inspect gun-buoy ((obj gun-buoy)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-buoy ((this gun-buoy)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tgun-elev-jmod: ~A~%" (-> obj gun-elev-jmod)) - (format #t "~2Tstart-pos: #~%" (-> obj start-pos)) - (format #t "~2Taim-dir: #~%" (-> obj aim-dir)) - (format #t "~2Tfocus-pos: #~%" (-> obj focus-pos)) - (format #t "~2Tbanking-quat: #~%" (-> obj banking-quat)) - (format #t "~2Toffset-from-player: #~%" (-> obj offset-from-player)) - (format #t "~2Toffset-y-angular: ~f~%" (-> obj offset-y-angular)) - (format #t "~2Telev-angle: ~f~%" (-> obj elev-angle)) - (format #t "~2Ty-final: ~f~%" (-> obj y-final)) - (format #t "~2Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~2Ty-bob: ~f~%" (-> obj y-bob)) - (format #t "~2Ty-speed: ~f~%" (-> obj y-speed)) - (format #t "~2Twarning-interval: ~D~%" (-> obj warning-interval)) - (format #t "~2Twarning-timer: ~D~%" (-> obj warning-timer)) - (format #t "~2Tsplash-timer: ~D~%" (-> obj splash-timer)) - (format #t "~2Tstare-down-timer: ~D~%" (-> obj stare-down-timer)) - (format #t "~2Twarning-id: ~D~%" (-> obj warning-id)) - (format #t "~2Tvoice-id: ~D~%" (-> obj voice-id)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) + (format #t "~2Tgun-elev-jmod: ~A~%" (-> this gun-elev-jmod)) + (format #t "~2Tstart-pos: #~%" (-> this start-pos)) + (format #t "~2Taim-dir: #~%" (-> this aim-dir)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) + (format #t "~2Tbanking-quat: #~%" (-> this banking-quat)) + (format #t "~2Toffset-from-player: #~%" (-> this offset-from-player)) + (format #t "~2Toffset-y-angular: ~f~%" (-> this offset-y-angular)) + (format #t "~2Telev-angle: ~f~%" (-> this elev-angle)) + (format #t "~2Ty-final: ~f~%" (-> this y-final)) + (format #t "~2Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~2Ty-bob: ~f~%" (-> this y-bob)) + (format #t "~2Ty-speed: ~f~%" (-> this y-speed)) + (format #t "~2Twarning-interval: ~D~%" (-> this warning-interval)) + (format #t "~2Twarning-timer: ~D~%" (-> this warning-timer)) + (format #t "~2Tsplash-timer: ~D~%" (-> this splash-timer)) + (format #t "~2Tstare-down-timer: ~D~%" (-> this stare-down-timer)) + (format #t "~2Twarning-id: ~D~%" (-> this warning-id)) + (format #t "~2Tvoice-id: ~D~%" (-> this voice-id)) + (format #t "~2Tflags: ~D~%" (-> this flags)) (label cfg-4) - obj + this ) ;; definition for symbol *gun-buoy-warning-speech*, type (array string) @@ -461,7 +461,7 @@ (logclear! (-> self flags) (gun-buoy-flags gubflags-2)) ) :trans (behavior () - (when (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (when (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (< 2 (the-as int (-> self focus aware))) (-> *setting-control* user-current gun-buoy) ) @@ -684,7 +684,7 @@ (defstate stare-down (gun-buoy) :virtual #t :enter (behavior () - (set! (-> self stare-down-timer) (current-time)) + (set-time! (-> self stare-down-timer)) ) :trans (behavior () (let ((v1-0 (-> self focus aware))) @@ -694,7 +694,7 @@ ) ((or (< (the-as int v1-0) 2) (not (-> *setting-control* user-current gun-buoy)) - (>= (- (current-time) (-> self stare-down-timer)) (seconds 6)) + (time-elapsed? (-> self stare-down-timer) (seconds 6)) ) (go-virtual exit-ambush) ) @@ -754,7 +754,7 @@ ) ) ) - (set! (-> self warning-timer) (current-time)) + (set-time! (-> self warning-timer)) (set! (-> self warning-id) (sound-play "buoy-alarm")) ) :exit (behavior () @@ -765,7 +765,7 @@ ) :trans (behavior () (let ((gp-0 (-> self focus aware))) - (when (>= (- (current-time) (-> self warning-timer)) (-> self warning-interval)) + (when (time-elapsed? (-> self warning-timer) (-> self warning-interval)) (cond ((>= (the-as int gp-0) 3) (logior! (-> self flags) (gun-buoy-flags gubflags-1)) @@ -825,7 +825,7 @@ 0 ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (let ((v1-3 (-> self focus aware))) (cond ((= v1-3 (enemy-aware enemy-aware-2)) @@ -887,7 +887,7 @@ ) ) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) (seconds 0.75)) + (until (time-elapsed? s5-1 (seconds 0.75)) (suspend) ) ) @@ -918,7 +918,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 2)) + (until (time-elapsed? gp-0 (seconds 2)) (suspend) ) ) @@ -936,7 +936,7 @@ ) ;; definition for method 74 of type gun-buoy -(defmethod general-event-handler gun-buoy ((obj gun-buoy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler gun-buoy ((this gun-buoy) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 @@ -944,7 +944,7 @@ #f ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -952,12 +952,12 @@ ;; definition for method 55 of type gun-buoy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! gun-buoy ((obj gun-buoy)) +(defmethod track-target! gun-buoy ((this gun-buoy)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (-> obj root) + (-> this root) (let* ((s4-0 *target*) (s5-0 (if (type? s4-0 process-focusable) s4-0 @@ -972,8 +972,8 @@ 1.0 ) ) - (f28-0 (-> obj offset-y-angular)) - (s4-2 (-> obj offset-from-player)) + (f28-0 (-> this offset-y-angular)) + (s4-2 (-> this offset-from-player)) (s3-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-2 1.0)) (f30-0 (vector-y-angle s3-1)) (f0-0 (vector-y-angle s2-1)) @@ -982,26 +982,26 @@ (vector-rotate-y! s3-1 s3-1 f30-1) (vector-normalize! s3-1 (vector-length s4-2)) (set! (-> s4-2 quad) (-> s3-1 quad)) - (set! (-> obj offset-y-angular) f30-1) + (set! (-> this offset-y-angular) f30-1) ) (let* ((f30-2 1.1) (v1-10 (get-transv s5-0)) (f30-3 (* f30-2 (sqrtf (+ (* (-> v1-10 x) (-> v1-10 x)) (* (-> v1-10 z) (-> v1-10 z)))))) - (f0-8 (vector-length (vector-! (new 'stack-no-clear 'vector) (get-trans s5-0 0) (-> obj root trans)))) + (f0-8 (vector-length (vector-! (new 'stack-no-clear 'vector) (get-trans s5-0 0) (-> this root trans)))) (f0-10 (fabs (+ -81920.0 f0-8))) - (f1-7 (-> obj nav target-speed)) + (f1-7 (-> this nav target-speed)) (f0-11 (fmax f30-3 f0-10)) ) - (set! (-> obj nav target-speed) (if (< f1-7 f0-11) - (seek f1-7 f0-11 (* 163840.0 (seconds-per-frame))) - (seek f1-7 f0-11 (* 143360.0 (seconds-per-frame))) - ) + (set! (-> this nav target-speed) (if (< f1-7 f0-11) + (seek f1-7 f0-11 (* 163840.0 (seconds-per-frame))) + (seek f1-7 f0-11 (* 143360.0 (seconds-per-frame))) + ) ) ) 0 ) (else - (let ((v1-26 (-> obj nav))) + (let ((v1-26 (-> this nav))) (set! (-> v1-26 target-speed) 0.0) ) 0 @@ -1012,35 +1012,35 @@ (let ((v1-30 (current-time)) (f0-18 4.83) ) - (set! (-> obj y-bob) + (set! (-> this y-bob) (* 1228.8 (cos (* 65536.0 (/ (the float (mod v1-30 (the int (* 300.0 f0-18)))) (* 300.0 f0-18))))) ) ) - (water-control-method-10 (-> obj water)) - (update-trans! (-> obj sound) (-> obj root trans)) - (update! (-> obj sound)) - ((method-of-type nav-enemy track-target!) obj) + (water-control-method-10 (-> this water)) + (update-trans! (-> this sound) (-> this root trans)) + (update! (-> this sound)) + ((method-of-type nav-enemy track-target!) this) 0 (none) ) ;; definition for method 70 of type gun-buoy -(defmethod go-hostile gun-buoy ((obj gun-buoy)) - (if (logtest? (-> obj flags) (gun-buoy-flags gubflags-1)) - (go (method-of-object obj hostile)) - (go (method-of-object obj warning)) +(defmethod go-hostile gun-buoy ((this gun-buoy)) + (if (logtest? (-> this flags) (gun-buoy-flags gubflags-1)) + (go (method-of-object this hostile)) + (go (method-of-object this warning)) ) ) ;; definition for method 61 of type gun-buoy -(defmethod enemy-method-61 gun-buoy ((obj gun-buoy) (arg0 int)) +(defmethod enemy-method-61 gun-buoy ((this gun-buoy) (arg0 int)) arg0 ) ;; definition for method 98 of type gun-buoy ;; WARN: Return type mismatch object vs symbol. ;; WARN: disable def twice: 40. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod in-aggro-range? gun-buoy ((obj gun-buoy) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? gun-buoy ((this gun-buoy) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -1053,13 +1053,13 @@ (the-as symbol (when arg1 - (let ((s4-0 (-> obj root)) + (let ((s4-0 (-> this root)) (f30-0 (-> arg1 y)) - (f28-0 (-> obj root trans y)) + (f28-0 (-> this root trans y)) ) - (-> obj fact) + (-> this fact) (let ((v1-10 - (or (not (and (-> obj next-state) (= (-> obj next-state name) 'dormant-aware))) + (or (not (and (-> this next-state) (= (-> this next-state name) 'dormant-aware))) (let ((s2-0 arg0)) (cond ((if (type? s2-0 target) @@ -1083,7 +1083,7 @@ ) (and v1-10 (begin - (set! f30-1 (-> obj enemy-info notice-nav-radius)) + (set! f30-1 (-> this enemy-info notice-nav-radius)) (set! v1-19 (if (type? arg0 target) arg0 ) @@ -1097,7 +1097,7 @@ ) (let ((f0-2 f30-1)) (or (>= (* f0-2 f0-2) (vector-vector-xz-distance-squared (-> s4-0 trans) arg1)) - (is-in-mesh? (-> obj nav) arg1 f30-1) + (is-in-mesh? (-> this nav) arg1 f30-1) ) ) ) @@ -1111,20 +1111,20 @@ ;; definition for method 183 of type gun-buoy ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod gun-buoy-method-183 gun-buoy ((obj gun-buoy) (arg0 process-focusable)) - (let ((s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8))) - (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 10))) +(defmethod gun-buoy-method-183 gun-buoy ((this gun-buoy) (arg0 process-focusable)) + (let ((s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8))) + (s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 10))) (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans arg0 0) quad)) (+! (-> s5-0 y) 8192.0) - (set! (-> s4-0 ent) (-> obj entity)) + (set! (-> s4-0 ent) (-> this entity)) (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options)) (set! (-> s4-0 notify-handle) (the-as handle #f)) (set! (-> s4-0 owner-handle) (the-as handle #f)) - (set! (-> s4-0 ignore-handle) (process->handle obj)) + (set! (-> s4-0 ignore-handle) (process->handle this)) (let* ((v1-11 *game-info*) (a0-9 (+ (-> v1-11 attack-id) 1)) ) @@ -1135,19 +1135,19 @@ (set! (-> s4-0 pos quad) (-> s2-0 quad)) (vector-! (-> s4-0 vel) s5-0 (-> s4-0 pos)) (vector-normalize! (-> s4-0 vel) 737280.0) - (spawn-projectile gun-buoy-shot s4-0 obj *default-dead-pool*) + (spawn-projectile gun-buoy-shot s4-0 this *default-dead-pool*) (set! (-> s4-0 pos quad) (-> s3-0 quad)) (vector-! (-> s4-0 vel) s5-0 (-> s4-0 pos)) ) (vector-normalize! (-> s4-0 vel) 737280.0) - (spawn-projectile gun-buoy-shot s4-0 obj *default-dead-pool*) + (spawn-projectile gun-buoy-shot s4-0 this *default-dead-pool*) ) (none) ) ;; definition for method 142 of type gun-buoy ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 gun-buoy ((obj gun-buoy) (arg0 nav-control)) +(defmethod nav-enemy-method-142 gun-buoy ((this gun-buoy) (arg0 nav-control)) (local-vars (a0-19 int) (a0-21 int)) (let* ((v1-1 (-> *perf-stats* data 33)) (a0-1 (-> v1-1 ctrl)) @@ -1167,11 +1167,11 @@ (.sync.p) (label cfg-2) 0 - (forward-up-nopitch->quaternion (-> obj root quat) (-> obj aim-dir) *y-vector*) - (seek! (-> obj elev-angle) (- (vector-x-angle (-> obj aim-dir))) (* 10922.667 (seconds-per-frame))) + (forward-up-nopitch->quaternion (-> this root quat) (-> this aim-dir) *y-vector*) + (seek! (-> this elev-angle) (- (vector-x-angle (-> this aim-dir))) (* 10922.667 (seconds-per-frame))) (let* ((s5-1 (new 'stack-no-clear 'quaternion)) - (s4-1 (-> obj root quat)) - (f1-1 (-> obj elev-angle)) + (s4-1 (-> this root quat)) + (f1-1 (-> this elev-angle)) (f0-7 (fmax -728.1778 (fmin 728.1778 f1-1))) (f1-2 (- f1-1 f0-7)) (f2-3 (* 0.2 f1-2)) @@ -1179,16 +1179,16 @@ ) (quaternion-vector-angle! s5-1 *x-vector* f2-3) (quaternion-normalize! (quaternion*! s4-1 s4-1 s5-1)) - (quaternion-vector-angle! (the-as quaternion (-> obj gun-elev-jmod target)) *x-vector* f30-0) + (quaternion-vector-angle! (the-as quaternion (-> this gun-elev-jmod target)) *x-vector* f30-0) ) - (let* ((s2-0 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> obj root transv) (-> obj root quat))) + (let* ((s2-0 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> this root transv) (-> this root quat))) (v1-15 (vector-normalize-copy! (new 'stack-no-clear 'vector) s2-0 1.0)) (s3-1 (new 'stack-no-clear 'vector)) ) 0.0 (let ((s5-2 (new 'stack-no-clear 'quaternion)) - (s4-2 (-> obj root quat)) - (gp-1 (-> obj banking-quat)) + (s4-2 (-> this root quat)) + (gp-1 (-> this banking-quat)) ) (vector-normalize! (vector-cross! s3-1 v1-15 *y-vector*) 1.0) (let ((f0-9 (lerp-scale 0.0 1638.4 (vector-length s2-0) 0.0 81920.0))) @@ -1216,18 +1216,18 @@ ;; definition for method 7 of type gun-buoy ;; WARN: Return type mismatch nav-enemy vs gun-buoy. -(defmethod relocate gun-buoy ((obj gun-buoy) (arg0 int)) - (if (nonzero? (-> obj gun-elev-jmod)) - (&+! (-> obj gun-elev-jmod) arg0) +(defmethod relocate gun-buoy ((this gun-buoy) (arg0 int)) + (if (nonzero? (-> this gun-elev-jmod)) + (&+! (-> this gun-elev-jmod) arg0) ) - (the-as gun-buoy ((method-of-type nav-enemy relocate) obj arg0)) + (the-as gun-buoy ((method-of-type nav-enemy relocate) this arg0)) ) ;; definition for method 114 of type gun-buoy ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! gun-buoy ((obj gun-buoy)) +(defmethod init-enemy-collision! gun-buoy ((this gun-buoy)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1274,7 +1274,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) @@ -1282,22 +1282,22 @@ ;; definition for method 115 of type gun-buoy ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! gun-buoy ((obj gun-buoy)) +(defmethod init-enemy! gun-buoy ((this gun-buoy)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-buoy" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *gun-buoy-nav-enemy-info*) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj start-pos quad) (-> obj root trans quad)) - (set! (-> obj flags) (gun-buoy-flags)) - (set! (-> obj gun-elev-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local obj 6 #f))) - (quaternion-copy! (the-as quaternion (-> obj gun-elev-jmod target)) *unity-quaternion*) - (set! (-> obj water) (new 'process 'water-control obj 3 8192.0 8192.0 2048.0)) - (set! (-> obj water flags) + (init-enemy-behaviour-and-stats! this *gun-buoy-nav-enemy-info*) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this start-pos quad) (-> this root trans quad)) + (set! (-> this flags) (gun-buoy-flags)) + (set! (-> this gun-elev-jmod) (the-as joint-mod (new 'process 'joint-mod-rotate-local this 6 #f))) + (quaternion-copy! (the-as quaternion (-> this gun-elev-jmod target)) *unity-quaternion*) + (set! (-> this water) (new 'process 'water-control this 3 8192.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags active use-ocean @@ -1310,25 +1310,25 @@ find-water ) ) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 24576.0) - (set! (-> obj water wake-size) 12288.0) - (quaternion-copy! (-> obj banking-quat) *unity-quaternion*) - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 24576.0) + (set! (-> this water wake-size) 12288.0) + (quaternion-copy! (-> this banking-quat) *unity-quaternion*) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) (let ((s5-1 (new 'stack-no-clear 'vector))) - (vector-z-quaternion! s5-1 (-> obj root quat)) - (set! (-> obj nav state heading quad) (-> s5-1 quad)) + (vector-z-quaternion! s5-1 (-> this root quat)) + (set! (-> this nav state heading quad) (-> s5-1 quad)) ) 0 - (vector-reset! (-> obj offset-from-player)) - (set! (-> obj offset-y-angular) 0.0) - (set! (-> obj elev-angle) 0.0) - (set-vector! (-> obj aim-dir) 0.0 0.0 1.0 0.0) - (set! (-> obj splash-timer) 0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "gun-buoy-steady" :fo-max 80) (-> obj root trans)) + (vector-reset! (-> this offset-from-player)) + (set! (-> this offset-y-angular) 0.0) + (set! (-> this elev-angle) 0.0) + (set-vector! (-> this aim-dir) 0.0 0.0 1.0 0.0) + (set! (-> this splash-timer) 0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "gun-buoy-steady" :fo-max 80) (-> this root trans)) ) - (update-vol! (-> obj sound) 0.0) - (set! (-> obj warning-id) (the-as sound-id -1)) + (update-vol! (-> this sound) 0.0) + (set! (-> this warning-id) (the-as sound-id -1)) (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 ba0951df33..4e8895b993 100644 --- a/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/entities/spydroid_REF.gc @@ -538,23 +538,23 @@ ) ;; definition for method 3 of type spydroid -(defmethod inspect spydroid ((obj spydroid)) - (when (not obj) - (set! obj obj) +(defmethod inspect spydroid ((this spydroid)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Told-y-deg: ~f~%" (-> obj old-y-deg)) - (format #t "~2Tdiff-angle: ~f~%" (-> obj diff-angle)) - (format #t "~2Tdesire-turn: ~A~%" (-> obj desire-turn)) - (format #t "~2Thit-target: ~A~%" (-> obj hit-target)) - (format #t "~2Tlightning[4] @ #x~X~%" (-> obj lightning)) - (format #t "~2Tfloor: ~f~%" (-> obj floor)) - (format #t "~2Texplode-part: ~A~%" (-> obj explode-part)) + (format #t "~2Told-y-deg: ~f~%" (-> this old-y-deg)) + (format #t "~2Tdiff-angle: ~f~%" (-> this diff-angle)) + (format #t "~2Tdesire-turn: ~A~%" (-> this desire-turn)) + (format #t "~2Thit-target: ~A~%" (-> this hit-target)) + (format #t "~2Tlightning[4] @ #x~X~%" (-> this lightning)) + (format #t "~2Tfloor: ~f~%" (-> this floor)) + (format #t "~2Texplode-part: ~A~%" (-> this explode-part)) (label cfg-4) - obj + this ) ;; definition for symbol *spydroid-nav-enemy-info*, type nav-enemy-info @@ -673,25 +673,25 @@ ;; definition for method 55 of type spydroid ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! spydroid ((obj spydroid)) +(defmethod track-target! spydroid ((this spydroid)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (when (< (-> obj root scale x) 1.0) - (let ((f0-2 (fmin 1.0 (+ 0.025 (-> obj root scale x))))) - (set-vector! (-> obj root scale) f0-2 f0-2 f0-2 1.0) + (when (< (-> this root scale x) 1.0) + (let ((f0-2 (fmin 1.0 (+ 0.025 (-> this root scale x))))) + (set-vector! (-> this root scale) f0-2 f0-2 f0-2 1.0) ) ) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (vector<-cspace! s5-0 (-> obj node-list data 12)) + (vector<-cspace! s5-0 (-> this node-list data 12)) (dotimes (s3-0 4) - (let ((a0-4 (-> obj lightning s3-0)) + (let ((a0-4 (-> this lightning s3-0)) (v1-12 s5-0) ) (set! (-> a0-4 state meet data 0 quad) (-> v1-12 quad)) @@ -699,28 +699,28 @@ (let ((v1-14 s3-0)) (cond ((zero? v1-14) - (vector<-cspace! s4-0 (-> obj node-list data 16)) + (vector<-cspace! s4-0 (-> this node-list data 16)) ) ((= v1-14 1) - (vector<-cspace! s4-0 (-> obj node-list data 20)) + (vector<-cspace! s4-0 (-> this node-list data 20)) ) ((= v1-14 2) - (vector<-cspace! s4-0 (-> obj node-list data 28)) + (vector<-cspace! s4-0 (-> this node-list data 28)) ) (else - (vector<-cspace! s4-0 (-> obj node-list data 24)) + (vector<-cspace! s4-0 (-> this node-list data 24)) ) ) ) - (let ((a0-13 (-> obj lightning s3-0)) + (let ((a0-13 (-> this lightning s3-0)) (v1-25 s4-0) ) (set! (-> a0-13 state meet data (+ (-> a0-13 state points-to-draw) -1) quad) (-> v1-25 quad)) ) - (when (not (and (-> obj next-state) (= (-> obj next-state name) 'die-falling))) - (case (-> obj lightning s3-0 state mode) + (when (not (and (-> this next-state) (= (-> this next-state name) 'die-falling))) + (case (-> this lightning s3-0 state mode) (((lightning-mode lm0) (lightning-mode lm3)) - (let ((v1-39 (-> obj lightning s3-0)) + (let ((v1-39 (-> this lightning s3-0)) (a0-19 1) ) (let ((a1-10 (!= a0-19 (-> v1-39 state mode)))) @@ -743,29 +743,29 @@ ) ) ) - (let ((f0-5 (quaternion-y-angle (-> obj root quat)))) - (set! (-> obj diff-angle) (- (-> obj old-y-deg) f0-5)) + (let ((f0-5 (quaternion-y-angle (-> this root quat)))) + (set! (-> this diff-angle) (- (-> this old-y-deg) f0-5)) (cond - ((< 32768.0 (-> obj diff-angle)) - (+! (-> obj diff-angle) -65536.0) + ((< 32768.0 (-> this diff-angle)) + (+! (-> this diff-angle) -65536.0) ) - ((< (-> obj diff-angle) -32768.0) - (+! (-> obj diff-angle) 65536.0) + ((< (-> this diff-angle) -32768.0) + (+! (-> this diff-angle) 65536.0) ) ) - (set! (-> obj old-y-deg) f0-5) + (set! (-> this old-y-deg) f0-5) ) - (set! (-> obj desire-turn) - (< (+ 0.5 (* 0.00024414062 (-> obj nav state speed))) (* 0.005493164 (fabs (-> obj diff-angle)))) + (set! (-> this desire-turn) + (< (+ 0.5 (* 0.00024414062 (-> this nav state speed))) (* 0.005493164 (fabs (-> this diff-angle)))) ) - (if (and (< (-> obj root trans y) (+ -122880.0 (-> obj floor))) - (-> obj next-state) - (= (-> obj next-state name) 'jump) + (if (and (< (-> this root trans y) (+ -122880.0 (-> this floor))) + (-> this next-state) + (= (-> this next-state name) 'jump) ) - (deactivate obj) + (deactivate this) ) - (if (and (-> obj next-state) (= (-> obj next-state name) 'jump)) - (spawn (-> obj part) (-> obj root trans)) + (if (and (-> this next-state) (= (-> this next-state name) 'jump)) + (spawn (-> this part) (-> this root trans)) ) 0 (none) @@ -773,7 +773,7 @@ ;; definition for method 74 of type spydroid ;; INFO: Used lq/sq -(defmethod general-event-handler spydroid ((obj spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler spydroid ((this spydroid) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v1-6 vector) (sv-144 vector)) @@ -785,7 +785,7 @@ (init-vf0-vector) (case arg2 (('touch 'bonk 'attack) - (set! sv-144 (the-as vector (send-event (ppointer->process (-> obj parent)) 'widow-get-center))) + (set! sv-144 (the-as vector (send-event (ppointer->process (-> this parent)) 'widow-get-center))) (let* ((s1-0 arg0) (s0-0 (if (type? s1-0 process-drawable) s1-0 @@ -799,7 +799,7 @@ (label cfg-15) (cond (v1-6 - (let ((v1-9 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) sv-144)) + (let ((v1-9 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) sv-144)) (s1-1 (new 'stack-no-clear 'vector)) ) (set! (-> s1-1 x) (- (-> v1-9 z))) @@ -807,7 +807,7 @@ (set! (-> s1-1 z) (-> v1-9 x)) (set! (-> s1-1 w) 1.0) (let ((v1-12 - (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-0) root trans) (-> obj root trans)) + (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-0) root trans) (-> this root trans)) ) ) (set! (-> s1-1 y) 0.0) @@ -851,16 +851,16 @@ (logtest? (penetrate dark-bomb) (-> (the-as attack-info v1-30) penetrate-using)) ) ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('jump) - (set! (-> obj floor) (-> (the-as vector (-> arg3 param 1)) y)) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (set! (-> this floor) (-> (the-as vector (-> arg3 param 1)) y)) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -875,7 +875,7 @@ (t9-0) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let ((t9-0 (-> (method-of-type nav-enemy die-falling) trans))) @@ -883,7 +883,7 @@ (t9-0) ) ) - (if (< (- (current-time) (-> self state-time)) (seconds 2)) + (if (not (time-elapsed? (-> self state-time) (seconds 2))) (spawn (-> self explode-part) (-> self root trans)) ) ) @@ -925,7 +925,7 @@ (suspend) (ja-channel-set! 0) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1079,7 +1079,7 @@ ) ) (let ((a0-1 (handle->process (-> self focus handle)))) - (if (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (and a0-1 (let ((f0-0 (vector-vector-xz-distance-squared (get-trans (the-as process-focusable a0-1) 0) (-> self root trans))) (f1-0 16384.0) @@ -1309,9 +1309,9 @@ ;; definition for method 114 of type spydroid ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! spydroid ((obj spydroid)) +(defmethod init-enemy-collision! spydroid ((this spydroid)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1349,55 +1349,55 @@ (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 60 of type spydroid -(defmethod coin-flip? spydroid ((obj spydroid)) +(defmethod coin-flip? spydroid ((this spydroid)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 10 of type spydroid -(defmethod deactivate spydroid ((obj spydroid)) - (if (nonzero? (-> obj explode-part)) - (kill-and-free-particles (-> obj explode-part)) +(defmethod deactivate spydroid ((this spydroid)) + (if (nonzero? (-> this explode-part)) + (kill-and-free-particles (-> this explode-part)) ) - ((the-as (function process-focusable none) (find-parent-method spydroid 10)) obj) + ((the-as (function process-focusable none) (find-parent-method spydroid 10)) this) (none) ) ;; definition for method 7 of type spydroid ;; WARN: Return type mismatch nav-enemy vs spydroid. -(defmethod relocate spydroid ((obj spydroid) (arg0 int)) +(defmethod relocate spydroid ((this spydroid) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj lightning v1-0)) - (&+! (-> obj lightning v1-0) arg0) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) arg0) ) ) - (when (nonzero? (-> obj explode-part)) - (if (nonzero? (-> obj explode-part)) - (&+! (-> obj explode-part) arg0) + (when (nonzero? (-> this explode-part)) + (if (nonzero? (-> this explode-part)) + (&+! (-> this explode-part) arg0) ) ) - (the-as spydroid ((method-of-type nav-enemy relocate) obj arg0)) + (the-as spydroid ((method-of-type nav-enemy relocate) this arg0)) ) ;; definition for method 115 of type spydroid ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! spydroid ((obj spydroid)) +(defmethod init-enemy! spydroid ((this spydroid)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-spydroid" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *spydroid-nav-enemy-info*) + (init-enemy-behaviour-and-stats! this *spydroid-nav-enemy-info*) (dotimes (s5-1 4) - (set! (-> obj lightning s5-1) + (set! (-> this lightning s5-1) (new 'process 'lightning-control @@ -1419,11 +1419,11 @@ :duration -1.0 :sound #f ) - obj + this 0.0 ) ) - (let ((v1-10 (-> obj lightning s5-1)) + (let ((v1-10 (-> this lightning s5-1)) (a0-5 0) ) (let ((a1-5 (!= a0-5 (-> v1-10 state mode)))) @@ -1442,36 +1442,50 @@ (set! (-> v1-10 state mode) (the-as lightning-mode a0-5)) ) ) - (let ((v1-13 (-> obj neck))) + (let ((v1-13 (-> this neck))) (set! (-> v1-13 up) (the-as uint 1)) (set! (-> v1-13 nose) (the-as uint 2)) (set! (-> v1-13 ear) (the-as uint 0)) (set-vector! (-> v1-13 twist-max) 3640.889 11832.889 0.0 1.0) (set! (-> v1-13 ignore-angle) 15473.777) ) - (set-vector! (-> obj root scale) 0.5 0.5 0.5 1.0) - (let ((v1-17 (-> obj nav))) + (set-vector! (-> this root scale) 0.5 0.5 0.5 1.0) + (let ((v1-17 (-> this nav))) (set! (-> v1-17 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 709) obj)) - (set! (-> obj explode-part) (create-launch-control (-> *part-group-id-table* 710) obj)) - (add-connection *part-engine* obj 8 obj 3183 (new 'static 'vector :x -204.8 :y 122.88 :z 1720.32 :w 163840.0)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 709) this)) + (set! (-> this explode-part) (create-launch-control (-> *part-group-id-table* 710) this)) (add-connection *part-engine* - obj + this + 8 + this + 3183 + (new 'static 'vector :x -204.8 :y 122.88 :z 1720.32 :w 163840.0) + ) + (add-connection + *part-engine* + this 10 - obj + this 3183 (new 'static 'vector :x -245.76 :y -122.88 :z 901.12 :w 163840.0) ) - (add-connection *part-engine* obj 4 obj 3184 (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 163840.0)) - (add-connection *part-engine* obj 6 obj 3185 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 6 obj 3186 (new 'static 'vector :w 163840.0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (add-connection + *part-engine* + this + 4 + this + 3184 + (new 'static 'vector :x 819.2 :y -122.88 :z 3358.72 :w 163840.0) + ) + (add-connection *part-engine* this 6 this 3185 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 6 this 3186 (new 'static 'vector :w 163840.0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc b/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc index f162872f8a..bf8b5a61eb 100644 --- a/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/guard-projectile_REF.gc @@ -334,26 +334,26 @@ ) ;; definition for method 3 of type guard-shot -(defmethod inspect guard-shot ((obj guard-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect guard-shot ((this guard-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thit-actor?: ~A~%" (-> obj hit-actor?)) - (format #t "~2Ttail-pos: #~%" (-> obj tail-pos)) + (format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) (label cfg-4) - obj + this ) ;; definition for method 37 of type guard-shot -(defmethod deal-damage! guard-shot ((obj guard-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! guard-shot ((this guard-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) - (when (t9-0 obj arg0 arg1) - (set! (-> obj hit-actor?) #t) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) #t ) ) @@ -362,11 +362,11 @@ ;; definition for method 24 of type guard-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight guard-shot ((obj guard-shot)) +(defmethod draw-laser-sight guard-shot ((this guard-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 610) (-> obj tail-pos) (-> obj starting-dir) #f #t) - (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 2048.0)) - (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> obj tail-pos) a0-3)) + (draw-beam (-> *part-id-table* 610) (-> this tail-pos) (-> this starting-dir) #f #t) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) (t9-2 sp-launch-particles-var) (a0-4 *sp-particle-system-2d*) (a1-4 (-> *part-id-table* 611)) @@ -382,7 +382,7 @@ ;; definition for method 25 of type guard-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles guard-shot ((obj guard-shot)) +(defmethod spawn-impact-particles guard-shot ((this guard-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -392,8 +392,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((gp-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) (f30-0 (vector-length s5-1)) ) @@ -442,16 +442,16 @@ ;; definition for method 26 of type guard-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles guard-shot ((obj guard-shot)) +(defmethod spawn-shell-particles guard-shot ((this guard-shot)) "TODO - confirm" - (let* ((s4-0 (-> obj root)) - (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s4-0 trans)) 2048.0)) + (let* ((s4-0 (-> this root)) + (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> s4-0 trans quad)) (vector+! gp-0 gp-0 v1-1) (cond - ((-> obj hit-actor?) + ((-> this hit-actor?) (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s5-1 (let ((t9-2 (method-of-type part-tracker activate))) @@ -533,7 +533,7 @@ ;; definition for method 28 of type guard-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound guard-shot ((obj guard-shot) (arg0 projectile-options)) +(defmethod play-impact-sound guard-shot ((this guard-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -600,22 +600,22 @@ ) ;; definition for method 38 of type guard-shot -(defmethod made-impact? guard-shot ((obj guard-shot)) +(defmethod made-impact? guard-shot ((this guard-shot)) "TODO - queries the collision cache, return true/false" - (let ((v1-0 (-> obj root)) + (let ((v1-0 (-> this root)) (t1-0 (new 'stack-no-clear 'collide-query)) ) (let ((a0-1 t1-0)) (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) - (set! (-> a0-1 ignore-process0) obj) - (set! (-> a0-1 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) (set! (-> a0-1 action-mask) (collide-action solid)) ) (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) - (if (logtest? (-> obj root status) (collide-status touch-actor)) - (set! (-> obj hit-actor?) #t) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) ) #t ) @@ -624,9 +624,9 @@ ;; definition for method 30 of type guard-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! guard-shot ((obj guard-shot)) +(defmethod init-proj-collision! guard-shot ((this guard-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -668,9 +668,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 @@ -679,17 +679,17 @@ ;; definition for method 31 of type guard-shot ;; INFO: Used lq/sq -(defmethod init-proj-settings! guard-shot ((obj guard-shot)) +(defmethod init-proj-settings! guard-shot ((this guard-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj hit-actor?) #f) - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'guard-shot) - (set! (-> obj max-speed) 819200.0) - (set! (-> obj move) guard-shot-move) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj timeout) (seconds 0.5)) - (logior! (-> obj options) (projectile-options account-for-target-velocity)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'guard-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) guard-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (logior! (-> this options) (projectile-options account-for-target-velocity)) + (set-gravity-length (-> this root dynam) 573440.0) (none) ) @@ -704,17 +704,17 @@ ) ;; definition for method 3 of type vehicle-grenade -(defmethod inspect vehicle-grenade ((obj vehicle-grenade)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-grenade ((this vehicle-grenade)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile-bounce inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tblast-radius: ~f~%" (-> obj blast-radius)) + (format #t "~2Tblast-radius: ~f~%" (-> this blast-radius)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -726,7 +726,7 @@ ;; definition for method 28 of type vehicle-grenade ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound vehicle-grenade ((obj vehicle-grenade) (arg0 projectile-options)) +(defmethod play-impact-sound vehicle-grenade ((this vehicle-grenade) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -743,9 +743,9 @@ ;; definition for method 30 of type vehicle-grenade ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! vehicle-grenade ((obj vehicle-grenade)) +(defmethod init-proj-collision! vehicle-grenade ((this vehicle-grenade)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) projectile-bounce-reaction) (set! (-> s5-0 no-reaction) @@ -765,14 +765,14 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (set-collide-with! - (-> obj root) + (-> this root) (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) ) - (set-collide-as! (-> obj root) (collide-spec enemy)) - (set! (-> obj root pat-ignore-mask) + (set-collide-as! (-> this root) (collide-spec enemy)) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) @@ -780,30 +780,30 @@ ;; definition for method 31 of type vehicle-grenade ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! vehicle-grenade ((obj vehicle-grenade)) +(defmethod init-proj-settings! vehicle-grenade ((this vehicle-grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj attack-mode) 'eco-dark) + (set! (-> this attack-mode) 'eco-dark) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vehicle-grenade" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 138) obj)) - (set! (-> obj blast-radius) 16384.0) - (set! (-> obj max-speed) 90112.0) - (set! (-> obj timeout) (seconds 4)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 138) this)) + (set! (-> this blast-radius) 16384.0) + (set! (-> this max-speed) 90112.0) + (set! (-> this timeout) (seconds 4)) 0 (none) ) ;; definition for method 25 of type vehicle-grenade ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles vehicle-grenade ((obj vehicle-grenade)) +(defmethod spawn-impact-particles vehicle-grenade ((this vehicle-grenade)) "Spawns associated particles with the projectile if applicable" - (spawn (-> obj part) (-> obj root trans)) + (spawn (-> this part) (-> this root trans)) (ja-post) 0 (none) @@ -811,27 +811,27 @@ ;; definition for method 41 of type vehicle-grenade ;; WARN: Return type mismatch int vs none. -(defmethod noop vehicle-grenade ((obj vehicle-grenade)) +(defmethod noop vehicle-grenade ((this vehicle-grenade)) "Does nothing" - (spawn (-> obj part) (-> obj root trans)) + (spawn (-> this part) (-> this root trans)) 0 (none) ) ;; definition for method 39 of type vehicle-grenade ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound! vehicle-grenade ((obj vehicle-grenade)) +(defmethod play-impact-sound! vehicle-grenade ((this vehicle-grenade)) "Plays impact sound" - (let* ((a2-0 (-> obj root)) + (let* ((a2-0 (-> this root)) (v1-0 (-> a2-0 status)) ) (if (logtest? v1-0 (collide-status touch-surface)) (vector-float*! (-> a2-0 transv) (-> a2-0 transv) 0.2) ) (when (and (logtest? v1-0 (collide-status impact-surface)) - (>= (- (current-time) (-> obj played-bounce-time)) (seconds 0.3)) + (time-elapsed? (-> this played-bounce-time) (seconds 0.3)) ) - (set! (-> obj played-bounce-time) (current-time)) + (set-time! (-> this played-bounce-time)) (sound-play "grenade-bounce") ) ) @@ -973,16 +973,16 @@ ) ;; definition for method 3 of type guard-lazer-shot -(defmethod inspect guard-lazer-shot ((obj guard-lazer-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect guard-lazer-shot ((this guard-lazer-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -994,20 +994,20 @@ ) ;; definition for method 38 of type guard-lazer-shot -(defmethod made-impact? guard-lazer-shot ((obj guard-lazer-shot)) +(defmethod made-impact? guard-lazer-shot ((this guard-lazer-shot)) "TODO - queries the collision cache, return true/false" - (let ((gp-0 (-> obj root)) + (let ((gp-0 (-> this root)) (s5-0 (new 'stack-no-clear 'collide-query)) ) (let ((v1-0 s5-0)) (set! (-> v1-0 radius) (-> gp-0 root-prim prim-core world-sphere w)) (set! (-> v1-0 collide-with) (-> gp-0 root-prim prim-core collide-with)) - (set! (-> v1-0 ignore-process0) obj) - (set! (-> v1-0 ignore-process1) (ppointer->process (-> obj parent))) + (set! (-> v1-0 ignore-process0) this) + (set! (-> v1-0 ignore-process1) (ppointer->process (-> this parent))) (set! (-> v1-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-0 action-mask) (collide-action solid)) ) - (let ((a0-2 (handle->process (-> obj notify-handle)))) + (let ((a0-2 (handle->process (-> this notify-handle)))) (when a0-2 (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> gp-0 trans) (get-trans (the-as process-focusable a0-2) 3))) (f0-2 (- (vector-length s4-1))) @@ -1032,9 +1032,9 @@ ;; definition for method 30 of type guard-lazer-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! guard-lazer-shot ((obj guard-lazer-shot)) +(defmethod init-proj-collision! guard-lazer-shot ((this guard-lazer-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1070,9 +1070,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 @@ -1081,15 +1081,15 @@ ;; definition for method 31 of type guard-lazer-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! guard-lazer-shot ((obj guard-lazer-shot)) +(defmethod init-proj-settings! guard-lazer-shot ((this guard-lazer-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj attack-mode) 'shock) - (set! (-> obj max-speed) 131072.0) - (set! (-> obj timeout) (seconds 0.125)) - (set! (-> obj move) guard-lazer-shot-move) - (set! (-> obj root dynam gravity y) 0.0) - (set! (-> obj root dynam gravity-length) 0.0) - (set! (-> obj root dynam gravity-max) 0.0) + (set! (-> this attack-mode) 'shock) + (set! (-> this max-speed) 131072.0) + (set! (-> this timeout) (seconds 0.125)) + (set! (-> this move) guard-lazer-shot-move) + (set! (-> this root dynam gravity y) 0.0) + (set! (-> this root dynam gravity-length) 0.0) + (set! (-> this root dynam gravity-max) 0.0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc b/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc index 1046823f1b..aa302e8635 100644 --- a/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/metalhead-projectile_REF.gc @@ -331,27 +331,27 @@ ) ;; definition for method 3 of type metalhead-shot -(defmethod inspect metalhead-shot ((obj metalhead-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalhead-shot ((this metalhead-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttail-pos: #~%" (-> obj tail-pos)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) (label cfg-4) - obj + this ) ;; definition for method 24 of type metalhead-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight metalhead-shot ((obj metalhead-shot)) +(defmethod draw-laser-sight metalhead-shot ((this metalhead-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 624) (-> obj tail-pos) (-> obj starting-dir) #f #t) - (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 2048.0)) - (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> obj tail-pos) a0-3)) + (draw-beam (-> *part-id-table* 624) (-> this tail-pos) (-> this starting-dir) #f #t) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) (t9-2 sp-launch-particles-var) (a0-4 *sp-particle-system-2d*) (a1-4 (-> *part-id-table* 625)) @@ -367,7 +367,7 @@ ;; definition for method 25 of type metalhead-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles metalhead-shot ((obj metalhead-shot)) +(defmethod spawn-impact-particles metalhead-shot ((this metalhead-shot)) "Spawns associated particles with the projectile if applicable" (rlet ((acc :class vf) (vf0 :class vf) @@ -377,8 +377,8 @@ (vf7 :class vf) ) (init-vf0-vector) - (let* ((gp-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) (f30-0 (vector-length s5-1)) ) @@ -426,10 +426,10 @@ ;; definition for method 26 of type metalhead-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles metalhead-shot ((obj metalhead-shot)) +(defmethod spawn-shell-particles metalhead-shot ((this metalhead-shot)) "TODO - confirm" - (let* ((s5-0 (-> obj root)) - (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s5-0 trans)) 2048.0)) + (let* ((s5-0 (-> this root)) + (v1-2 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s5-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> s5-0 trans quad)) @@ -476,16 +476,16 @@ ;; definition for method 28 of type metalhead-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound metalhead-shot ((obj metalhead-shot) (arg0 projectile-options)) +(defmethod play-impact-sound metalhead-shot ((this metalhead-shot) (arg0 projectile-options)) (with-pp (case arg0 (((projectile-options lose-altitude proj-options-2)) - (when (nonzero? (-> obj sound-id)) + (when (nonzero? (-> this sound-id)) (when *sound-player-enable* (let ((gp-0 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> gp-0 command) (sound-command set-param)) - (set! (-> gp-0 id) (-> obj sound-id)) - (let ((a1-1 (-> obj root trans))) + (set! (-> gp-0 id) (-> this sound-id)) + (let ((a1-1 (-> this root trans))) (let ((s5-1 pp)) (when (= a1-1 #t) (if (and s5-1 (type? s5-1 process-drawable) (nonzero? (-> (the-as process-drawable s5-1) root))) @@ -531,9 +531,9 @@ ;; definition for method 30 of type metalhead-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! metalhead-shot ((obj metalhead-shot)) +(defmethod init-proj-collision! metalhead-shot ((this metalhead-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -575,9 +575,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) @@ -585,14 +585,14 @@ ;; definition for method 31 of type metalhead-shot ;; INFO: Used lq/sq -(defmethod init-proj-settings! metalhead-shot ((obj metalhead-shot)) +(defmethod init-proj-settings! metalhead-shot ((this metalhead-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'metalhead-shot) - (set! (-> obj max-speed) 532480.0) - (set! (-> obj move) metalhead-shot-move) - (set! (-> obj timeout) (seconds 0.767)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'metalhead-shot) + (set! (-> this max-speed) 532480.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this timeout) (seconds 0.767)) + (set-gravity-length (-> this root dynam) 573440.0) (none) ) @@ -721,29 +721,29 @@ ) ;; definition for method 3 of type metalhead-grenade-shot -(defmethod inspect metalhead-grenade-shot ((obj metalhead-grenade-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalhead-grenade-shot ((this metalhead-grenade-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttumble-quat: #~%" (-> obj tumble-quat)) - (format #t "~2Tblast-radius: ~f~%" (-> obj blast-radius)) + (format #t "~2Ttumble-quat: #~%" (-> this tumble-quat)) + (format #t "~2Tblast-radius: ~f~%" (-> this blast-radius)) (label cfg-4) - obj + this ) ;; definition for method 26 of type metalhead-grenade-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles metalhead-grenade-shot ((obj metalhead-grenade-shot)) +(defmethod spawn-shell-particles metalhead-grenade-shot ((this metalhead-grenade-shot)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 (let ((t9-1 (method-of-type part-tracker activate))) - (t9-1 (the-as part-tracker gp-0) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-1 (the-as part-tracker gp-0) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((t9-2 run-function-in-process) (a0-3 gp-0) @@ -755,7 +755,7 @@ (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -776,13 +776,13 @@ ;; definition for method 28 of type metalhead-grenade-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound metalhead-grenade-shot ((obj metalhead-grenade-shot) (arg0 projectile-options)) +(defmethod play-impact-sound metalhead-grenade-shot ((this metalhead-grenade-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "gren-shot-hit") ) (((projectile-options lose-altitude proj-options-2)) - (sound-play "gren-missile" :id (-> obj sound-id) :position (-> obj root trans)) + (sound-play "gren-missile" :id (-> this sound-id) :position (-> this root trans)) ) ) 0 @@ -873,9 +873,9 @@ ;; definition for method 25 of type metalhead-grenade-shot ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles metalhead-grenade-shot ((obj metalhead-grenade-shot)) +(defmethod spawn-impact-particles metalhead-grenade-shot ((this metalhead-grenade-shot)) "Spawns associated particles with the projectile if applicable" - (spawn (-> obj part) (-> obj root trans)) + (spawn (-> this part) (-> this root trans)) 0 (none) ) @@ -922,9 +922,9 @@ ;; definition for method 30 of type metalhead-grenade-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! metalhead-grenade-shot ((obj metalhead-grenade-shot)) +(defmethod init-proj-collision! metalhead-grenade-shot ((this metalhead-grenade-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) gren-cshape-reaction-canister) @@ -950,9 +950,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) @@ -960,22 +960,22 @@ ;; definition for method 31 of type metalhead-grenade-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-proj-settings! metalhead-grenade-shot ((obj metalhead-grenade-shot)) +(defmethod init-proj-settings! metalhead-grenade-shot ((this metalhead-grenade-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj blast-radius) 4096.0) - (set! (-> obj max-speed) 135168.0) - (set! (-> obj timeout) (seconds 4)) - (set! (-> obj update-velocity) projectile-update-velocity-add-gravity) - (set! (-> obj move) gren-canister-move) - (set! (-> obj root dynam gravity y) 102400.0) - (set! (-> obj root dynam gravity-length) 102400.0) - (set! (-> obj root dynam gravity-max) 102400.0) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this blast-radius) 4096.0) + (set! (-> this max-speed) 135168.0) + (set! (-> this timeout) (seconds 4)) + (set! (-> this update-velocity) projectile-update-velocity-add-gravity) + (set! (-> this move) gren-canister-move) + (set! (-> this root dynam gravity y) 102400.0) + (set! (-> this root dynam gravity-length) 102400.0) + (set! (-> this root dynam gravity-max) 102400.0) (let ((f0-5 1092.2667)) - (quaternion-axis-angle! (-> obj tumble-quat) 1.0 0.0 0.0 f0-5) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-5) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 143) obj)) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 143) this)) + (set! (-> this sound-id) (new-sound-id)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-h_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-h_REF.gc index cdc0c457b3..c926d7b343 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-h_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type race-turbo-pad -(defmethod inspect race-turbo-pad ((obj race-turbo-pad)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-turbo-pad ((this race-turbo-pad)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-turbo-pad) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "[~8x] ~A~%" this 'race-turbo-pad) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Thandle: ~D~%" (-> this handle)) (label cfg-4) - obj + this ) ;; definition of type race-decision-point @@ -37,18 +37,18 @@ ) ;; definition for method 3 of type race-decision-point -(defmethod inspect race-decision-point ((obj race-decision-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-decision-point ((this race-decision-point)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-decision-point) - (format #t "~1Tpos: ~f~%" (-> obj pos)) - (format #t "~1Tdecision-type: ~D~%" (-> obj decision-type)) - (format #t "~1Tshortcuts: ~D~%" (-> obj shortcuts)) - (format #t "~1Tsafe-paths: ~D~%" (-> obj safe-paths)) + (format #t "[~8x] ~A~%" this 'race-decision-point) + (format #t "~1Tpos: ~f~%" (-> this pos)) + (format #t "~1Tdecision-type: ~D~%" (-> this decision-type)) + (format #t "~1Tshortcuts: ~D~%" (-> this shortcuts)) + (format #t "~1Tsafe-paths: ~D~%" (-> this safe-paths)) (label cfg-4) - obj + this ) ;; definition of type race-racer-info @@ -64,18 +64,18 @@ ) ;; definition for method 3 of type race-racer-info -(defmethod inspect race-racer-info ((obj race-racer-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-racer-info ((this race-racer-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-racer-info) - (format #t "~1Trider: ~D~%" (-> obj rider)) - (format #t "~1Tvehicle: ~D~%" (-> obj vehicle)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tseek-offset: ~D~%" (-> obj seek-offset)) + (format #t "[~8x] ~A~%" this 'race-racer-info) + (format #t "~1Trider: ~D~%" (-> this rider)) + (format #t "~1Tvehicle: ~D~%" (-> this vehicle)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tseek-offset: ~D~%" (-> this seek-offset)) (label cfg-4) - obj + this ) ;; definition of type race-info @@ -123,47 +123,47 @@ ) ;; definition for method 3 of type race-info -(defmethod inspect race-info ((obj race-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-info ((this race-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Trace-mesh-name: ~A~%" (-> obj race-mesh-name)) - (format #t "~1Tpath-group-name: ~A~%" (-> obj path-group-name)) - (format #t "~1Ttask-node: ~D~%" (-> obj task-node)) - (format #t "~1Tmesh: ~A~%" (-> obj mesh)) - (format #t "~1Tai-min-speed-factor: ~f~%" (-> obj ai-min-speed-factor)) - (format #t "~1Tai-max-speed-factor: ~f~%" (-> obj ai-max-speed-factor)) - (format #t "~1Tai-spread-factor: ~f~%" (-> obj ai-spread-factor)) - (format #t "~1Tstart-sphere: #~%" (-> obj start-sphere)) - (format #t "~1Tstart-dir: #~%" (-> obj start-dir)) - (format #t "~1Tfinish-sphere: #~%" (-> obj finish-sphere)) - (format #t "~1Tfinish-dir: #~%" (-> obj finish-dir)) - (format #t "~1Tplayer-intro-pos: #~%" (-> obj player-intro-pos)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tscore: ~D~%" (-> obj score)) - (format #t "~1Tlap-count: ~D~%" (-> obj lap-count)) - (format #t "~1Tracer-count: ~D~%" (-> obj racer-count)) - (format #t "~1Tturbo-pad-count: ~D~%" (-> obj turbo-pad-count)) - (format #t "~1Tmap-index: ~D~%" (-> obj map-index)) - (format #t "~1Tdecision-point-count: ~D~%" (-> obj decision-point-count)) - (format #t "~1Tsafe-paths: ~D~%" (-> obj safe-paths)) - (format #t "~1Tturbo-pad-array: #x~X~%" (-> obj turbo-pad-array)) - (format #t "~1Tracer-array: #x~X~%" (-> obj racer-array)) - (format #t "~1Tdecision-point-array: #x~X~%" (-> obj decision-point-array)) - (format #t "~1Tlevel: ~A~%" (-> obj level)) - (format #t "~1Tborrow-level: ~A~%" (-> obj borrow-level)) - (format #t "~1Tborrow: ~A~%" (-> obj borrow)) - (format #t "~1Tmanager: ~D~%" (-> obj manager)) - (format #t "~1Tmanager-handle-init-hack: ~A~%" (-> obj manager-handle-init-hack)) - (format #t "~1Thatch-actor-name: ~A~%" (-> obj hatch-actor-name)) - (format #t "~1Tcountdown-scene: ~A~%" (-> obj countdown-scene)) - (format #t "~1Tcomplete-continue: ~A~%" (-> obj complete-continue)) - (format #t "~1Tstart-camera: ~A~%" (-> obj start-camera)) - (format #t "~1Tgo-speech: ~D~%" (-> obj go-speech)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Trace-mesh-name: ~A~%" (-> this race-mesh-name)) + (format #t "~1Tpath-group-name: ~A~%" (-> this path-group-name)) + (format #t "~1Ttask-node: ~D~%" (-> this task-node)) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tai-min-speed-factor: ~f~%" (-> this ai-min-speed-factor)) + (format #t "~1Tai-max-speed-factor: ~f~%" (-> this ai-max-speed-factor)) + (format #t "~1Tai-spread-factor: ~f~%" (-> this ai-spread-factor)) + (format #t "~1Tstart-sphere: #~%" (-> this start-sphere)) + (format #t "~1Tstart-dir: #~%" (-> this start-dir)) + (format #t "~1Tfinish-sphere: #~%" (-> this finish-sphere)) + (format #t "~1Tfinish-dir: #~%" (-> this finish-dir)) + (format #t "~1Tplayer-intro-pos: #~%" (-> this player-intro-pos)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tscore: ~D~%" (-> this score)) + (format #t "~1Tlap-count: ~D~%" (-> this lap-count)) + (format #t "~1Tracer-count: ~D~%" (-> this racer-count)) + (format #t "~1Tturbo-pad-count: ~D~%" (-> this turbo-pad-count)) + (format #t "~1Tmap-index: ~D~%" (-> this map-index)) + (format #t "~1Tdecision-point-count: ~D~%" (-> this decision-point-count)) + (format #t "~1Tsafe-paths: ~D~%" (-> this safe-paths)) + (format #t "~1Tturbo-pad-array: #x~X~%" (-> this turbo-pad-array)) + (format #t "~1Tracer-array: #x~X~%" (-> this racer-array)) + (format #t "~1Tdecision-point-array: #x~X~%" (-> this decision-point-array)) + (format #t "~1Tlevel: ~A~%" (-> this level)) + (format #t "~1Tborrow-level: ~A~%" (-> this borrow-level)) + (format #t "~1Tborrow: ~A~%" (-> this borrow)) + (format #t "~1Tmanager: ~D~%" (-> this manager)) + (format #t "~1Tmanager-handle-init-hack: ~A~%" (-> this manager-handle-init-hack)) + (format #t "~1Thatch-actor-name: ~A~%" (-> this hatch-actor-name)) + (format #t "~1Tcountdown-scene: ~A~%" (-> this countdown-scene)) + (format #t "~1Tcomplete-continue: ~A~%" (-> this complete-continue)) + (format #t "~1Tstart-camera: ~A~%" (-> this start-camera)) + (format #t "~1Tgo-speech: ~D~%" (-> this go-speech)) (label cfg-4) - obj + this ) ;; definition of type racer-state @@ -200,32 +200,32 @@ ) ;; definition for method 3 of type racer-state -(defmethod inspect racer-state ((obj racer-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect racer-state ((this racer-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'racer-state) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tracer: ~D~%" (-> obj racer)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Trank: ~D~%" (-> obj rank)) - (format #t "~1Tfinish-count: ~D~%" (-> obj finish-count)) - (format #t "~1Tlap-count: ~D~%" (-> obj lap-count)) - (format #t "~1Tlap-quadrant: ~D~%" (-> obj lap-quadrant)) - (format #t "~1Trider: ~D~%" (-> obj rider)) - (format #t "~1Tlap-distance: ~f~%" (-> obj lap-distance)) - (format #t "~1Tlap-distance-prev: ~f~%" (-> obj lap-distance-prev)) - (format #t "~1Tpos: ~f~%" (-> obj pos)) - (format #t "~1Ttarget-pos-offset: ~f~%" (-> obj target-pos-offset)) - (format #t "~1Tspeed-factor: ~f~%" (-> obj speed-factor)) - (format #t "~1Tfinish-time: ~D~%" (-> obj finish-time)) - (format #t "~1Tlap-start: ~D~%" (-> obj lap-start)) - (format #t "~1Tbest-lap-time: ~D~%" (-> obj best-lap-time)) - (format #t "~1Tlap-time-array[5] @ #x~X~%" (-> obj lap-time-array)) - (format #t "~1Tstart-position: #~%" (-> obj start-position)) + (format #t "[~8x] ~A~%" this 'racer-state) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tracer: ~D~%" (-> this racer)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Trank: ~D~%" (-> this rank)) + (format #t "~1Tfinish-count: ~D~%" (-> this finish-count)) + (format #t "~1Tlap-count: ~D~%" (-> this lap-count)) + (format #t "~1Tlap-quadrant: ~D~%" (-> this lap-quadrant)) + (format #t "~1Trider: ~D~%" (-> this rider)) + (format #t "~1Tlap-distance: ~f~%" (-> this lap-distance)) + (format #t "~1Tlap-distance-prev: ~f~%" (-> this lap-distance-prev)) + (format #t "~1Tpos: ~f~%" (-> this pos)) + (format #t "~1Ttarget-pos-offset: ~f~%" (-> this target-pos-offset)) + (format #t "~1Tspeed-factor: ~f~%" (-> this speed-factor)) + (format #t "~1Tfinish-time: ~D~%" (-> this finish-time)) + (format #t "~1Tlap-start: ~D~%" (-> this lap-start)) + (format #t "~1Tbest-lap-time: ~D~%" (-> this best-lap-time)) + (format #t "~1Tlap-time-array[5] @ #x~X~%" (-> this lap-time-array)) + (format #t "~1Tstart-position: #~%" (-> this start-position)) (label cfg-4) - obj + this ) ;; definition of type race-state @@ -272,37 +272,37 @@ ) ;; definition for method 3 of type race-state -(defmethod inspect race-state ((obj race-state)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-state ((this race-state)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-state) - (format #t "~1Tinfo: ~A~%" (-> obj info)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tstate: ~D~%" (-> obj state)) - (format #t "~1Tracer-count: ~D~%" (-> obj racer-count)) - (format #t "~1Tfinished-count: ~D~%" (-> obj finished-count)) - (format #t "~1Ti-player: ~D~%" (-> obj i-player)) - (format #t "~1Ti-countdown: ~D~%" (-> obj i-countdown)) - (format #t "~1Tmanager: #x~X~%" (-> obj manager)) - (format #t "~1Tscene-player: #x~X~%" (-> obj scene-player)) - (format #t "~1Trace-signal: #x~X~%" (-> obj race-signal)) - (format #t "~1Tarrow: #x~X~%" (-> obj arrow)) - (format #t "~1Thud-timer: #x~X~%" (-> obj hud-timer)) - (format #t "~1Thud-lap-counter: #x~X~%" (-> obj hud-lap-counter)) - (format #t "~1Thud-turbo-counter: #x~X~%" (-> obj hud-turbo-counter)) - (format #t "~1Thud-position: #x~X~%" (-> obj hud-position)) - (format #t "~1Tcurrent-time: ~D~%" (-> obj current-time)) - (format #t "~1Tcountdown-start-time: ~D~%" (-> obj countdown-start-time)) - (format #t "~1Trace-start-time: ~D~%" (-> obj race-start-time)) - (format #t "~1Trankings[10] @ #x~X~%" (-> obj rankings)) - (format #t "~1Ttarget-pos: ~f~%" (-> obj target-pos)) - (format #t "~1Tsuck-factor: ~f~%" (-> obj suck-factor)) - (format #t "~1Tracer-array[10] @ #x~X~%" (-> obj racer-array)) - (format #t "~1Tplayer-intro-curve: #~%" (-> obj player-intro-curve)) + (format #t "[~8x] ~A~%" this 'race-state) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tstate: ~D~%" (-> this state)) + (format #t "~1Tracer-count: ~D~%" (-> this racer-count)) + (format #t "~1Tfinished-count: ~D~%" (-> this finished-count)) + (format #t "~1Ti-player: ~D~%" (-> this i-player)) + (format #t "~1Ti-countdown: ~D~%" (-> this i-countdown)) + (format #t "~1Tmanager: #x~X~%" (-> this manager)) + (format #t "~1Tscene-player: #x~X~%" (-> this scene-player)) + (format #t "~1Trace-signal: #x~X~%" (-> this race-signal)) + (format #t "~1Tarrow: #x~X~%" (-> this arrow)) + (format #t "~1Thud-timer: #x~X~%" (-> this hud-timer)) + (format #t "~1Thud-lap-counter: #x~X~%" (-> this hud-lap-counter)) + (format #t "~1Thud-turbo-counter: #x~X~%" (-> this hud-turbo-counter)) + (format #t "~1Thud-position: #x~X~%" (-> this hud-position)) + (format #t "~1Tcurrent-time: ~D~%" (-> this current-time)) + (format #t "~1Tcountdown-start-time: ~D~%" (-> this countdown-start-time)) + (format #t "~1Trace-start-time: ~D~%" (-> this race-start-time)) + (format #t "~1Trankings[10] @ #x~X~%" (-> this rankings)) + (format #t "~1Ttarget-pos: ~f~%" (-> this target-pos)) + (format #t "~1Tsuck-factor: ~f~%" (-> this suck-factor)) + (format #t "~1Tracer-array[10] @ #x~X~%" (-> this racer-array)) + (format #t "~1Tplayer-intro-curve: #~%" (-> this player-intro-curve)) (label cfg-4) - obj + this ) ;; definition of type race-manager @@ -336,21 +336,21 @@ ) ;; definition for method 3 of type race-manager -(defmethod inspect race-manager ((obj race-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-manager ((this race-manager)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trace-state: #~%" (-> obj race-state)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tplayer-on-track-time: ~D~%" (-> obj player-on-track-time)) - (format #t "~2Tmessage-id: ~D~%" (-> obj message-id)) - (format #t "~2Tfinish-sound-id: ~D~%" (-> obj finish-sound-id)) + (format #t "~2Trace-state: #~%" (-> this race-state)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tplayer-on-track-time: ~D~%" (-> this player-on-track-time)) + (format #t "~2Tmessage-id: ~D~%" (-> this message-id)) + (format #t "~2Tfinish-sound-id: ~D~%" (-> this finish-sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/common/race/race-hud_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-hud_REF.gc index d2e0df4aaf..39cf9290b3 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-hud_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-hud_REF.gc @@ -3,119 +3,133 @@ ;; definition for method 15 of type hud-race-timer ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-race-timer ((obj hud-race-timer)) - (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 0 (the int (+ 20.0 (* -100.0 (-> obj offset))))) - (format (clear (-> obj strings 0 text)) "~2,'0D:" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) 60 5) - (format (clear (-> obj strings 1 text)) "~2,'0D:" (-> obj values 1 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj strings 0 pos)) 30 0) - (format (clear (-> obj strings 2 text)) "~2,'0D" (-> obj values 2 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 2 pos)) (the-as vector4w (-> obj strings 1 pos)) 28 0) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) 128 0) - ((method-of-type hud draw) obj) +(defmethod draw hud-race-timer ((this hud-race-timer)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + 0 + (the int (+ 20.0 (* -100.0 (-> this offset)))) + ) + (format (clear (-> this strings 0 text)) "~2,'0D:" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 60 5) + (format (clear (-> this strings 1 text)) "~2,'0D:" (-> this values 1 current)) + (set-as-offset-from! + (the-as hud-sprite (-> this strings 1 pos)) + (the-as vector4w (-> this strings 0 pos)) + 30 + 0 + ) + (format (clear (-> this strings 2 text)) "~2,'0D" (-> this values 2 current)) + (set-as-offset-from! + (the-as hud-sprite (-> this strings 2 pos)) + (the-as vector4w (-> this strings 1 pos)) + 28 + 0 + ) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 128 0) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-race-timer ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-race-timer ((obj hud-race-timer)) - (set! (-> obj values 0 target) (/ (the-as int (-> *game-info* race-timer)) #x4650)) - (set! (-> obj values 1 target) (/ (mod (the-as int (-> *game-info* race-timer)) #x4650) 300)) - (set! (-> obj values 2 target) (/ (mod (mod (the-as int (-> *game-info* race-timer)) #x4650) 300) 5)) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-race-timer ((this hud-race-timer)) + (set! (-> this values 0 target) (/ (the-as int (-> *game-info* race-timer)) #x4650)) + (set! (-> this values 1 target) (/ (mod (the-as int (-> *game-info* race-timer)) #x4650) 300)) + (set! (-> this values 2 target) (/ (mod (mod (the-as int (-> *game-info* race-timer)) #x4650) 300) 5)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-race-timer ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-race-timer ((obj hud-race-timer)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-race-timer ((this hud-race-timer)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x22 :page #x679))) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.55) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color green)) - (alloc-string-if-needed obj 1) - (set! (-> obj strings 1 scale) 0.55) - (set! (-> obj strings 1 flags) (font-flags kerning middle large)) - (set! (-> obj strings 1 color) (font-color green)) - (alloc-string-if-needed obj 2) - (set! (-> obj strings 2 scale) 0.55) - (set! (-> obj strings 2 flags) (font-flags kerning middle large)) - (set! (-> obj strings 2 color) (font-color green)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x23 :page #x679))) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x22 :page #x679))) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.55) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color green)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.55) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color green)) + (alloc-string-if-needed this 2) + (set! (-> this strings 2 scale) 0.55) + (set! (-> this strings 2 flags) (font-flags kerning middle large)) + (set! (-> this strings 2 color) (font-color green)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x23 :page #x679))) 0 (none) ) ;; definition for method 15 of type hud-race-lap-counter ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-race-lap-counter ((obj hud-race-lap-counter)) +(defmethod draw hud-race-lap-counter ((this hud-race-lap-counter)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 504 - (the int (+ 20.0 (* -100.0 (-> obj offset)))) + (the int (+ 20.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj strings 0 scale) 0.55) - (format (clear (-> obj strings 0 text)) "~D/~D" (-> obj values 0 current) (-> obj values 1 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -40 5) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) -20 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) -50 0) - ((method-of-type hud draw) obj) + (set! (-> this strings 0 scale) 0.55) + (format (clear (-> this strings 0 text)) "~D/~D" (-> this values 0 current) (-> this values 1 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -40 5) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -20 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) -50 0) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-race-lap-counter ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-race-lap-counter ((obj hud-race-lap-counter)) - (set! (-> obj values 0 target) (-> *game-info* race-current-lap-count)) - (set! (-> obj values 1 target) (-> *game-info* race-total-lap-count)) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-race-lap-counter ((this hud-race-lap-counter)) + (set! (-> this values 0 target) (-> *game-info* race-current-lap-count)) + (set! (-> this values 1 target) (-> *game-info* race-total-lap-count)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-race-lap-counter ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-race-lap-counter ((obj hud-race-lap-counter)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-race-lap-counter ((this hud-race-lap-counter)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xe :page #x679))) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color green)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #x679))) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #x679))) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xe :page #x679))) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color green)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #x679))) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #x679))) 0 (none) ) ;; definition for method 15 of type hud-race-turbo-counter ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-race-turbo-counter ((obj hud-race-turbo-counter)) +(defmethod draw hud-race-turbo-counter ((this hud-race-turbo-counter)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 224 - (the int (+ 25.0 (* -100.0 (-> obj offset)))) + (the int (+ 25.0 (* -100.0 (-> this offset)))) ) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 32 0) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 1)) 32 0) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 2)) 32 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 2)) 32 0) - (let* ((v1-2 (-> obj values 0 current)) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) 32 0) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 1)) 32 0) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 2)) 32 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 2)) 32 0) + (let* ((v1-2 (-> this values 0 current)) (f0-3 (if (> v1-2 0) 1.0 0.0 @@ -132,73 +146,73 @@ ) ) ) - (set! (-> obj sprites 1 scale-x) f0-3) - (set! (-> obj sprites 1 scale-y) f0-3) - (set! (-> obj sprites 3 scale-x) f1-2) - (set! (-> obj sprites 3 scale-y) f1-2) - (set! (-> obj sprites 5 scale-x) f2-1) - (set! (-> obj sprites 5 scale-y) f2-1) + (set! (-> this sprites 1 scale-x) f0-3) + (set! (-> this sprites 1 scale-y) f0-3) + (set! (-> this sprites 3 scale-x) f1-2) + (set! (-> this sprites 3 scale-y) f1-2) + (set! (-> this sprites 5 scale-x) f2-1) + (set! (-> this sprites 5 scale-y) f2-1) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-race-turbo-counter ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-race-turbo-counter ((obj hud-race-turbo-counter)) - (set! (-> obj values 0 target) (-> *game-info* race-number-turbos)) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-race-turbo-counter ((this hud-race-turbo-counter)) + (set! (-> this values 0 target) (-> *game-info* race-number-turbos)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-race-turbo-counter ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-race-turbo-counter ((obj hud-race-turbo-counter)) - (set! (-> obj level) (level-get *level* 'stadium)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-center) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-race-turbo-counter ((this hud-race-turbo-counter)) + (set! (-> this level) (level-get *level* 'stadium)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #x669))) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x669))) 0 (none) ) ;; definition for method 15 of type hud-race-position ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-race-position ((obj hud-race-position)) +(defmethod draw hud-race-position ((this hud-race-position)) (local-vars (s5-0 int)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) + (the-as hud-sprite (-> this sprites)) 24 - (the int (+ 324.0 (* 100.0 (-> obj offset)))) + (the int (+ 324.0 (* 100.0 (-> this offset)))) ) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites)) 0 0) - (set-as-offset-from! (-> obj sprites 7) (the-as vector4w (-> obj sprites)) 0 0) - (let ((v1-2 (-> obj values 0 current))) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites)) 0 0) + (set-as-offset-from! (-> this sprites 7) (the-as vector4w (-> this sprites)) 0 0) + (let ((v1-2 (-> this values 0 current))) (dotimes (a0-9 16) - (set! (-> obj sprites a0-9 scale-x) (if (= a0-9 v1-2) - 0.8 - 0.0 - ) + (set! (-> this sprites a0-9 scale-x) (if (= a0-9 v1-2) + 0.8 + 0.0 + ) ) - (set! (-> obj sprites a0-9 scale-y) (if (= a0-9 v1-2) - 0.8 - 0.0 - ) + (set! (-> this sprites a0-9 scale-y) (if (= a0-9 v1-2) + 0.8 + 0.0 + ) ) ) (cond @@ -220,8 +234,8 @@ ) ) (set-as-offset-from! - (-> obj sprites s5-0) - (the-as vector4w (-> obj sprites v1-2)) + (-> this sprites s5-0) + (the-as vector4w (-> this sprites v1-2)) (if (zero? v1-2) 28 52 @@ -229,47 +243,47 @@ 0 ) ) - (set! (-> obj sprites s5-0 scale-x) 0.8) - (set! (-> obj sprites s5-0 scale-y) 0.8) - ((method-of-type hud draw) obj) + (set! (-> this sprites s5-0 scale-x) 0.8) + (set! (-> this sprites s5-0 scale-y) 0.8) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-race-position ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-race-position ((obj hud-race-position)) - (set! (-> obj values 0 target) (-> *game-info* race-position)) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-race-position ((this hud-race-position)) + (set! (-> this values 0 target) (-> *game-info* race-position)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-race-position ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-race-position ((obj hud-race-position)) - (set! (-> obj level) (level-get *level* 'ctywide)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-race-position ((this hud-race-position)) + (set! (-> this level) (level-get *level* 'ctywide)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x679))) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x13 :page #x679))) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x679))) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x15 :page #x679))) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x679))) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x17 :page #x679))) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x679))) - (set! (-> obj sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x19 :page #x679))) - (set! (-> obj sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x20 :page #x679))) - (set! (-> obj sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1d :page #x679))) - (set! (-> obj sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1f :page #x679))) - (set! (-> obj sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x21 :page #x679))) - (set! (-> obj sprites 12 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x679))) - (set! (-> obj sprites 13 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1b :page #x679))) - (set! (-> obj sprites 14 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x679))) - (set! (-> obj sprites 15 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1c :page #x679))) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x679))) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x13 :page #x679))) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x679))) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x15 :page #x679))) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x679))) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x17 :page #x679))) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x679))) + (set! (-> this sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x19 :page #x679))) + (set! (-> this sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x20 :page #x679))) + (set! (-> this sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1d :page #x679))) + (set! (-> this sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1f :page #x679))) + (set! (-> this sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x21 :page #x679))) + (set! (-> this sprites 12 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x679))) + (set! (-> this sprites 13 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1b :page #x679))) + (set! (-> this sprites 14 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x679))) + (set! (-> this sprites 15 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1c :page #x679))) 0 (none) ) @@ -292,7 +306,7 @@ ;; definition for method 15 of type hud-race-final-stats ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-race-final-stats ((obj hud-race-final-stats)) +(defmethod draw hud-race-final-stats ((this hud-race-final-stats)) (local-vars (s0-0 int) (sv-112 (function string font-context symbol int bucket-id float)) @@ -316,7 +330,7 @@ (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) ) ) - (set! (-> obj strings 0 scale) 0.0) + (set! (-> this strings 0 scale) 0.0) (set! (-> s1-0 origin x) 45.0) (set! (-> s1-0 origin y) 20.0) (let ((v1-15 s1-0)) @@ -376,14 +390,14 @@ ) ) ) - (set! (-> obj strings 1 scale) 0.5) + (set! (-> this strings 1 scale) 0.5) (set-hud-piece-position! - (the-as hud-sprite (-> obj strings 1 pos)) + (the-as hud-sprite (-> this strings 1 pos)) 128 - (the int (+ (- 188.0 (the float s0-0)) (* -100.0 (-> obj offset)))) + (the int (+ (- 188.0 (the float s0-0)) (* -100.0 (-> this offset)))) ) (let ((s1-1 format)) - (set! sv-144 (clear (-> obj strings 1 text))) + (set! sv-144 (clear (-> this strings 1 text))) (let* ((a0-29 *common-text*) (t9-7 (method-of-object a0-29 lookup-text!)) (a1-7 375) @@ -394,26 +408,26 @@ ) ) (set-hud-piece-position! - (the-as hud-sprite (-> obj strings 2 pos)) + (the-as hud-sprite (-> this strings 2 pos)) 384 - (the int (+ (- 188.0 (the float s0-0)) (* -100.0 (-> obj offset)))) + (the int (+ (- 188.0 (the float s0-0)) (* -100.0 (-> this offset)))) ) - (set! (-> obj strings 2 scale) 0.5) - (set! (-> obj strings 2 flags) (font-flags kerning right large)) - (print-time (clear (-> obj strings 2 text)) (the-as time-frame s2-0)) + (set! (-> this strings 2 scale) 0.5) + (set! (-> this strings 2 flags) (font-flags kerning right large)) + (print-time (clear (-> this strings 2 text)) (the-as time-frame s2-0)) (while (and (< 1 (-> s5-0 lap-count)) (< s3-0 (+ (* (-> s5-0 lap-count) 2) 2))) (let ((s2-1 (-> s5-0 lap-time-array (+ (- -1 s4-0) (-> s5-0 lap-count))))) - (set! (-> obj strings s3-0 scale) 0.5) - (set! (-> obj strings s3-0 flags) (font-flags kerning large)) - (set! (-> obj strings s3-0 color) (font-color white)) + (set! (-> this strings s3-0 scale) 0.5) + (set! (-> this strings s3-0 flags) (font-flags kerning large)) + (set! (-> this strings s3-0 color) (font-color white)) (set-as-offset-from! - (the-as hud-sprite (&+ (-> obj strings 0 pos) (* 48 s3-0))) - (the-as vector4w (-> obj strings 1 pos)) + (the-as hud-sprite (&+ (-> this strings 0 pos) (* 48 s3-0))) + (the-as vector4w (-> this strings 1 pos)) 5 (+ (* 28 s4-0) 40) ) (let ((s1-3 format) - (s0-1 (clear (-> obj strings s3-0 text))) + (s0-1 (clear (-> this strings s3-0 text))) ) (set! sv-160 "~S~D") (let ((a2-10 (lookup-text! *common-text* (text-id race-lap) #f)) @@ -423,16 +437,16 @@ ) ) (let ((s3-1 (+ s3-0 1))) - (set! (-> obj strings s3-1 scale) 0.5) - (set! (-> obj strings s3-1 flags) (font-flags kerning right large)) - (set! (-> obj strings s3-1 color) (font-color white)) + (set! (-> this strings s3-1 scale) 0.5) + (set! (-> this strings s3-1 flags) (font-flags kerning right large)) + (set! (-> this strings s3-1 color) (font-color white)) (set-as-offset-from! - (the-as hud-sprite (&+ (-> obj strings 0 pos) (* 48 s3-1))) - (the-as vector4w (-> obj strings 2 pos)) + (the-as hud-sprite (&+ (-> this strings 0 pos) (* 48 s3-1))) + (the-as vector4w (-> this strings 2 pos)) 0 (+ (* 28 s4-0) 40) ) - (print-time (clear (-> obj strings s3-1 text)) (the-as time-frame s2-1)) + (print-time (clear (-> this strings s3-1 text)) (the-as time-frame s2-1)) (+! s4-0 1) (set! s3-0 (+ s3-1 1)) ) @@ -441,37 +455,37 @@ ) ) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-race-final-stats ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-race-final-stats ((obj hud-race-final-stats)) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-race-final-stats ((this hud-race-final-stats)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-race-final-stats ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-race-final-stats ((obj hud-race-final-stats)) - (set! (-> obj level) (level-get *level* 'stadium)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-race-final-stats ((this hud-race-final-stats)) + (set! (-> this level) (level-get *level* 'stadium)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) + (logior! (-> this flags) (hud-flags show)) (dotimes (s5-0 14) - (alloc-string-if-needed obj s5-0) + (alloc-string-if-needed this s5-0) ) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) - (set! (-> obj strings 0 color) (font-color red)) - (set! (-> obj strings 1 flags) (font-flags kerning large)) - (set! (-> obj strings 1 color) (font-color white)) - (set! (-> obj strings 2 flags) (font-flags kerning large)) - (set! (-> obj strings 2 color) (font-color white)) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (set! (-> this strings 1 flags) (font-flags kerning large)) + (set! (-> this strings 1 color) (font-color white)) + (set! (-> this strings 2 flags) (font-flags kerning large)) + (set! (-> this strings 2 color) (font-color white)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-info_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-info_REF.gc index ab34f978b9..af4296daab 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-info_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-info_REF.gc @@ -650,7 +650,7 @@ ;; definition for method 17 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod set-speech-tables! race-state ((obj race-state)) +(defmethod set-speech-tables! race-state ((this race-state)) (speech-table-set! *speech-control* (speech-type speech-type-30) @@ -1130,7 +1130,3 @@ 0 (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 a503b98597..20ec2b1131 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 @@ -48,37 +48,37 @@ ;; definition for method 9 of type race-info ;; WARN: Return type mismatch int vs none. -(defmethod initialize-mesh race-info ((obj race-info)) - (let ((v1-0 (entity-by-name (-> obj race-mesh-name)))) +(defmethod initialize-mesh race-info ((this race-info)) + (let ((v1-0 (entity-by-name (-> this race-mesh-name)))) (cond (v1-0 (let ((gp-0 (-> (the-as entity-race-mesh v1-0) race-mesh))) - (set! (-> obj mesh) gp-0) + (set! (-> this mesh) gp-0) (when gp-0 (let ((s4-0 (-> gp-0 edges 0))) - (vector-average! (-> obj start-sphere) (-> s4-0 left) (-> s4-0 right)) - (+! (-> obj start-sphere y) 40960.0) - (race-find-ground (-> obj start-sphere) (-> obj start-sphere)) - (+! (-> obj start-sphere y) 8192.0) - (set! (-> obj start-sphere r) (* 0.5 (vector-vector-distance (-> s4-0 left) (-> s4-0 right)))) + (vector-average! (-> this start-sphere) (-> s4-0 left) (-> s4-0 right)) + (+! (-> this start-sphere y) 40960.0) + (race-find-ground (-> this start-sphere) (-> this start-sphere)) + (+! (-> this start-sphere y) 8192.0) + (set! (-> this start-sphere r) (* 0.5 (vector-vector-distance (-> s4-0 left) (-> s4-0 right)))) (let ((v1-6 (new 'stack-no-clear 'vector))) (vector-! v1-6 (-> s4-0 right) (-> s4-0 left)) - (set-vector! (-> obj start-dir) (-> v1-6 z) 0.0 (- (-> v1-6 x)) 1.0) + (set-vector! (-> this start-dir) (-> v1-6 z) 0.0 (- (-> v1-6 x)) 1.0) ) ) - (vector-normalize! (-> obj start-dir) 1.0) + (vector-normalize! (-> this start-dir) 1.0) (let* ((a0-8 (+ (-> gp-0 edge-count) -1)) (s4-1 (-> gp-0 edges a0-8)) ) - (vector-average! (-> obj finish-sphere) (-> s4-1 left) (-> s4-1 right)) - (set! (-> obj finish-sphere r) (* 0.75 (vector-vector-distance (-> s4-1 left) (-> s4-1 right)))) + (vector-average! (-> this finish-sphere) (-> s4-1 left) (-> s4-1 right)) + (set! (-> this finish-sphere r) (* 0.75 (vector-vector-distance (-> s4-1 left) (-> s4-1 right)))) (let ((v1-12 (new 'stack-no-clear 'vector))) (vector-! v1-12 (-> s4-1 right) (-> s4-1 left)) - (set-vector! (-> obj finish-dir) (-> v1-12 z) 0.0 (- (-> v1-12 x)) 1.0) + (set-vector! (-> this finish-dir) (-> v1-12 z) 0.0 (- (-> v1-12 x)) 1.0) ) ) - (vector-normalize! (-> obj finish-dir) 1.0) - (let ((f0-18 (vector-vector-distance-squared (-> obj start-sphere) (-> obj finish-sphere))) + (vector-normalize! (-> this finish-dir) 1.0) + (let ((f0-18 (vector-vector-distance-squared (-> this start-sphere) (-> this finish-sphere))) (f1-2 163840.0) ) (if (< f0-18 (* f1-2 f1-2)) @@ -89,7 +89,7 @@ ) ) (else - (set! (-> obj mesh) #f) + (set! (-> this mesh) #f) ) ) ) @@ -99,42 +99,42 @@ ;; definition for method 10 of type racer-state ;; WARN: Return type mismatch int vs none. -(defmethod begin-lap racer-state ((obj racer-state) (arg0 race-state)) - (format #t "begin-lap racer ~d~%" (-> obj rank)) - (set! (-> obj lap-start) (-> arg0 current-time)) - (logior! (-> obj flags) (racer-flags in-race)) +(defmethod begin-lap racer-state ((this racer-state) (arg0 race-state)) + (format #t "begin-lap racer ~d~%" (-> this rank)) + (set! (-> this lap-start) (-> arg0 current-time)) + (logior! (-> this flags) (racer-flags in-race)) 0 (none) ) ;; definition for method 11 of type racer-state ;; WARN: Return type mismatch int vs none. -(defmethod end-lap racer-state ((obj racer-state) (arg0 race-state)) - (+! (-> obj lap-count) 1) - (format #t "end-lap ~d racer ~d~%" (-> obj lap-count) (-> obj rank)) +(defmethod end-lap racer-state ((this racer-state) (arg0 race-state)) + (+! (-> this lap-count) 1) + (format #t "end-lap ~d racer ~d~%" (-> this lap-count) (-> this rank)) (let ((v1-2 4) (a0-2 3) ) (while (>= a0-2 0) - (set! (-> obj lap-time-array v1-2) (-> obj lap-time-array a0-2)) + (set! (-> this lap-time-array v1-2) (-> this lap-time-array a0-2)) (+! a0-2 -1) (+! v1-2 -1) ) ) - (let ((v1-5 (- (-> arg0 current-time) (-> obj lap-start)))) - (set! (-> obj best-lap-time) (the-as uint (min (the-as int (-> obj best-lap-time)) (the-as int v1-5)))) - (set! (-> obj lap-time-array 0) (the-as float v1-5)) + (let ((v1-5 (- (-> arg0 current-time) (-> this lap-start)))) + (set! (-> this best-lap-time) (the-as uint (min (the-as int (-> this best-lap-time)) (the-as int v1-5)))) + (set! (-> this lap-time-array 0) (the-as float v1-5)) ) - (when (= (-> obj lap-count) (-> arg0 info lap-count)) - (logior! (-> obj flags) (racer-flags finished)) - (set! (-> obj finish-time) (-> arg0 current-time)) - (set! (-> obj finish-count) (-> arg0 finished-count)) + (when (= (-> this lap-count) (-> arg0 info lap-count)) + (logior! (-> this flags) (racer-flags finished)) + (set! (-> this finish-time) (-> arg0 current-time)) + (set! (-> this finish-count) (-> arg0 finished-count)) (+! (-> arg0 finished-count) 1) - (send-event (handle->process (-> obj racer)) 'race-finished (-> arg0 info safe-paths)) - (let ((s4-0 (handle->process (-> obj racer)))) + (send-event (handle->process (-> this racer)) 'race-finished (-> arg0 info safe-paths)) + (let ((s4-0 (handle->process (-> this racer)))) (cond - ((zero? (-> obj finish-count)) - (let ((v1-28 (-> obj rider))) + ((zero? (-> this finish-count)) + (let ((v1-28 (-> this rider))) (cond ((zero? v1-28) (format #t "racer-state::end-lap: play speech race-jak-win~%") @@ -152,7 +152,7 @@ ) ) (else - (case (-> obj rider) + (case (-> this rider) ((2) (format #t "racer-state::end-lap: play speech race-errol-lose~%") (speech-control-method-12 *speech-control* (the-as process-drawable s4-0) (speech-type speech-type-56)) @@ -162,9 +162,9 @@ ) ) ) - (when (and (> (-> obj lap-count) 0) (= (-> obj lap-count) (+ (-> arg0 info lap-count) -1))) - (let ((s5-1 (handle->process (-> obj racer))) - (v1-47 (-> obj rider)) + (when (and (> (-> this lap-count) 0) (= (-> this lap-count) (+ (-> arg0 info lap-count) -1))) + (let ((s5-1 (handle->process (-> this racer))) + (v1-47 (-> this rider)) ) (cond ((zero? v1-47) @@ -189,7 +189,7 @@ ;; definition for method 9 of type racer-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-lap-distance racer-state ((obj racer-state) (arg0 race-state)) +(defmethod update-lap-distance racer-state ((this racer-state) (arg0 race-state)) (local-vars (a0-29 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -199,51 +199,51 @@ (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'matrix3))) (-> arg0 info) - (let ((v1-2 (handle->process (-> obj racer)))) + (let ((v1-2 (handle->process (-> this racer)))) (cond (v1-2 (if (focus-test? (the-as process-focusable v1-2) dead inactive) - (logior! (-> obj flags) (racer-flags dead)) + (logior! (-> this flags) (racer-flags dead)) ) (set! (-> s5-0 vector 0 quad) (-> (the-as process-focusable v1-2) root trans quad)) - (when (not (logtest? (-> obj flags) (racer-flags finished dead))) + (when (not (logtest? (-> this flags) (racer-flags finished dead))) (let ((s3-0 (new 'stack-no-clear 'race-mesh-slice-query))) (set! (-> s3-0 search-sphere quad) (-> s5-0 vector 0 quad)) (set! (-> s3-0 search-sphere r) 0.0) (race-mesh-method-13 (-> arg0 info mesh) (the-as race-mesh-slice-query (&-> s3-0 slice-id))) - (set! (-> obj lap-distance-prev) (-> obj lap-distance)) + (set! (-> this lap-distance-prev) (-> this lap-distance)) (cond ((>= (-> s3-0 slice-id) 0) - (set! (-> obj lap-distance) (-> s3-0 lap-dist)) - (if (not (logtest? (-> obj flags) (racer-flags on-track))) - (set! (-> obj lap-distance-prev) (-> obj lap-distance)) + (set! (-> this lap-distance) (-> s3-0 lap-dist)) + (if (not (logtest? (-> this flags) (racer-flags on-track))) + (set! (-> this lap-distance-prev) (-> this lap-distance)) ) - (logior! (-> obj flags) (racer-flags on-track)) + (logior! (-> this flags) (racer-flags on-track)) ) (else - (logclear! (-> obj flags) (racer-flags on-track)) + (logclear! (-> this flags) (racer-flags on-track)) ) ) (cond ((logtest? (-> arg0 info mesh flags) (race-mesh-flags racemeshflag-0)) (when (>= (-> s3-0 slice-id) 0) (let ((v1-29 (min 3 (the int (* 4.0 (-> s3-0 lap-dist)))))) - (when (= v1-29 (logand (+ (-> obj lap-quadrant) 1) 3)) - (set! (-> obj lap-quadrant) v1-29) + (when (= v1-29 (logand (+ (-> this lap-quadrant) 1) 3)) + (set! (-> this lap-quadrant) v1-29) (when (zero? v1-29) - (if (logtest? (-> obj flags) (racer-flags in-race)) - (end-lap obj arg0) + (if (logtest? (-> this flags) (racer-flags in-race)) + (end-lap this arg0) (begin-race arg0) ) - (begin-lap obj arg0) + (begin-lap this arg0) ) ) ) ) ) - ((logtest? (-> obj flags) (racer-flags in-race)) + ((logtest? (-> this flags) (racer-flags in-race)) (let ((v1-39 (new 'stack-no-clear 'vector))) - (vector-! (the-as vector (&-> v1-39 x)) (-> obj position) (the-as vector (-> arg0 info finish-sphere))) + (vector-! (the-as vector (&-> v1-39 x)) (-> this position) (the-as vector (-> arg0 info finish-sphere))) (.lvf vf1 (&-> (the-as vector (&-> v1-39 x)) quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -255,49 +255,49 @@ (f1-1 (-> arg0 info finish-sphere r)) ) (if (and (< f0-7 (* f1-1 f1-1)) (< 0.0 (vector-dot (the-as vector (&-> v1-39 x)) (-> arg0 info finish-dir)))) - (end-lap obj arg0) + (end-lap this arg0) ) ) ) ) (else - (when (< 0.0 (-> obj lap-distance)) + (when (< 0.0 (-> this lap-distance)) (begin-race arg0) - (begin-lap obj arg0) + (begin-lap this arg0) ) ) ) ) (let ((f0-10 (-> arg0 info ai-max-speed-factor))) - (if (< (+ (-> arg0 target-pos) (-> obj target-pos-offset)) (-> obj pos)) + (if (< (+ (-> arg0 target-pos) (-> this target-pos-offset)) (-> this pos)) (set! f0-10 (-> arg0 info ai-min-speed-factor)) ) - (seek! (-> obj speed-factor) f0-10 (* 0.2 (seconds-per-frame))) + (seek! (-> this speed-factor) f0-10 (* 0.2 (seconds-per-frame))) ) 0 ) - (if (logtest? (-> obj flags) (racer-flags finished)) - (seek! (-> obj speed-factor) 0.9 (* 0.2 (seconds-per-frame))) + (if (logtest? (-> this flags) (racer-flags finished)) + (seek! (-> this speed-factor) 0.9 (* 0.2 (seconds-per-frame))) ) - (when (logtest? (-> obj flags) (racer-flags in-race)) + (when (logtest? (-> this flags) (racer-flags in-race)) (dotimes (s3-1 (-> arg0 info decision-point-count)) (let ((v1-70 (-> arg0 info decision-point-array s3-1))) - (if (and (< (-> obj lap-distance-prev) (-> v1-70 pos)) (>= (-> obj lap-distance) (-> v1-70 pos))) - (send-event (handle->process (-> obj racer)) 'race-decision-point v1-70) + (if (and (< (-> this lap-distance-prev) (-> v1-70 pos)) (>= (-> this lap-distance) (-> v1-70 pos))) + (send-event (handle->process (-> this racer)) 'race-decision-point v1-70) ) ) ) - (set! (-> obj pos) (+ (-> obj lap-distance) (the float (-> obj lap-count)))) + (set! (-> this pos) (+ (-> this lap-distance) (the float (-> this lap-count)))) ) - (set! (-> obj position quad) (-> s5-0 vector 0 quad)) + (set! (-> this position quad) (-> s5-0 vector 0 quad)) ) (else - (logior! (-> obj flags) (racer-flags dead)) + (logior! (-> this flags) (racer-flags dead)) ) ) ) ) - (when (logtest? (-> obj flags) (racer-flags unknown)) + (when (logtest? (-> this flags) (racer-flags unknown)) ) 0 (none) @@ -306,22 +306,22 @@ ;; definition for method 12 of type racer-state ;; WARN: Return type mismatch int vs none. -(defmethod print-laps racer-state ((obj racer-state) (arg0 race-state) (arg1 string)) - (let ((s4-0 (- (-> arg0 current-time) (-> obj lap-start)))) - (format arg1 "lap count ~d~%" (-> obj lap-count)) +(defmethod print-laps racer-state ((this racer-state) (arg0 race-state) (arg1 string)) + (let ((s4-0 (- (-> arg0 current-time) (-> this lap-start)))) + (format arg1 "lap count ~d~%" (-> this lap-count)) (format arg1 "best lap ") - (print-time arg1 (the-as time-frame (-> obj best-lap-time))) + (print-time arg1 (the-as time-frame (-> this best-lap-time))) (format arg1 "~%~%") - (when (logtest? (-> obj flags) (racer-flags in-race)) + (when (logtest? (-> this flags) (racer-flags in-race)) (format arg1 "this lap ") (print-time arg1 (the-as time-frame s4-0)) ) ) (format arg1 "~%") - (let ((s4-2 (min 5 (-> obj lap-count)))) + (let ((s4-2 (min 5 (-> this lap-count)))) (dotimes (s3-0 s4-2) (format arg1 "lap ~d " s3-0) - (print-time arg1 (the-as time-frame (-> obj lap-time-array s3-0))) + (print-time arg1 (the-as time-frame (-> this lap-time-array s3-0))) (format arg1 "~%") ) ) @@ -332,30 +332,30 @@ ;; definition for method 13 of type racer-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-racer! racer-state ((obj racer-state) (arg0 process-drawable)) - (set! (-> obj racer) (process->handle arg0)) - (set! (-> obj position quad) (-> arg0 root trans quad)) - (set! (-> obj flags) (racer-flags unknown)) - (set! (-> obj lap-count) 0) - (set! (-> obj lap-distance) 0.0) - (set! (-> obj lap-quadrant) 3) - (set! (-> obj finish-time) (the-as uint 0)) - (set! (-> obj pos) 0.0) - (set! (-> obj target-pos-offset) 0.0) - (set! (-> obj speed-factor) 1.0) - (set! (-> obj finish-count) -1) - (set! (-> obj best-lap-time) (the-as uint #x2dc6c0)) +(defmethod init-racer! racer-state ((this racer-state) (arg0 process-drawable)) + (set! (-> this racer) (process->handle arg0)) + (set! (-> this position quad) (-> arg0 root trans quad)) + (set! (-> this flags) (racer-flags unknown)) + (set! (-> this lap-count) 0) + (set! (-> this lap-distance) 0.0) + (set! (-> this lap-quadrant) 3) + (set! (-> this finish-time) (the-as uint 0)) + (set! (-> this pos) 0.0) + (set! (-> this target-pos-offset) 0.0) + (set! (-> this speed-factor) 1.0) + (set! (-> this finish-count) -1) + (set! (-> this best-lap-time) (the-as uint #x2dc6c0)) 0 (none) ) ;; definition for method 9 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod init-racers! race-state ((obj race-state) (arg0 process-drawable)) - (let ((v1-0 (-> obj racer-count))) +(defmethod init-racers! race-state ((this race-state) (arg0 process-drawable)) + (let ((v1-0 (-> this racer-count))) (when (< v1-0 10) - (+! (-> obj racer-count) 1) - (init-racer! (-> obj racer-array v1-0) arg0) + (+! (-> this racer-count) 1) + (init-racer! (-> this racer-array v1-0) arg0) ) ) 0 @@ -364,42 +364,42 @@ ;; definition for method 10 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod begin-race race-state ((obj race-state)) +(defmethod begin-race race-state ((this race-state)) (format #t "begin-race~%") - (when (not (logtest? (-> obj flags) (race-flags begun))) - (logior! (-> obj flags) (race-flags begun)) - (set-speech-tables! obj) - (send-event (handle->process (-> obj manager)) 'begin-race) + (when (not (logtest? (-> this flags) (race-flags begun))) + (logior! (-> this flags) (race-flags begun)) + (set-speech-tables! this) + (send-event (handle->process (-> this manager)) 'begin-race) (set-setting! 'sound-mode #f 0.0 0) (remove-setting! 'allow-progress) - (set! (-> obj race-start-time) (-> obj current-time)) - (let ((s5-0 (handle->process (-> obj manager)))) - (set! (-> obj hud-timer) (ppointer->handle (process-spawn hud-race-timer :init hud-init-by-other :to s5-0))) - (set! (-> obj hud-position) + (set! (-> this race-start-time) (-> this current-time)) + (let ((s5-0 (handle->process (-> this manager)))) + (set! (-> this hud-timer) (ppointer->handle (process-spawn hud-race-timer :init hud-init-by-other :to s5-0))) + (set! (-> this hud-position) (ppointer->handle (process-spawn hud-race-position :init hud-init-by-other :to s5-0)) ) - (if (< 1 (-> obj info lap-count)) - (set! (-> obj hud-lap-counter) + (if (< 1 (-> this info lap-count)) + (set! (-> this hud-lap-counter) (ppointer->handle (process-spawn hud-race-lap-counter :init hud-init-by-other :to s5-0)) ) ) - (when (logtest? (-> obj info flags) (race-info-flags borrow)) - (set! (-> obj hud-turbo-counter) + (when (logtest? (-> this info flags) (race-info-flags borrow)) + (set! (-> this hud-turbo-counter) (ppointer->handle (process-spawn hud-race-turbo-counter :init hud-init-by-other :to s5-0)) ) - (set-setting! 'race-minimap #f 0.0 (-> obj info map-index)) + (set-setting! 'race-minimap #f 0.0 (-> this info map-index)) ) ) - (dotimes (s5-1 (-> obj racer-count)) - (let ((v1-61 (-> obj racer-array s5-1))) + (dotimes (s5-1 (-> this racer-count)) + (let ((v1-61 (-> this racer-array s5-1))) (send-event (handle->process (-> v1-61 racer)) 'begin-race) ) ) - (send-event (handle->process (-> obj race-signal)) 'count-go) - (when (nonzero? (-> obj info go-speech)) - (format #t "playing speech ~d~%" (-> obj info go-speech)) + (send-event (handle->process (-> this race-signal)) 'count-go) + (when (nonzero? (-> this info go-speech)) + (format #t "playing speech ~d~%" (-> this info go-speech)) (talker-spawn-func - (-> *talker-speech* (-> obj info go-speech)) + (-> *talker-speech* (-> this info go-speech)) *entity-pool* (target-pos 0) (the-as region #f) @@ -412,10 +412,10 @@ ;; definition for method 12 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod update-rankings race-state ((obj race-state)) +(defmethod update-rankings race-state ((this race-state)) (let ((v1-0 (new 'stack-no-clear 'array 'float 10))) - (dotimes (a0-1 (-> obj racer-count)) - (let ((a1-3 (-> obj racer-array a0-1))) + (dotimes (a0-1 (-> this racer-count)) + (let ((a1-3 (-> this racer-array a0-1))) (cond ((logtest? (-> a1-3 flags) (racer-flags finished)) (set! (-> v1-0 a0-1) (the float (- 1000 (-> a1-3 finish-count)))) @@ -432,13 +432,13 @@ (let ((a0-4 0) (a1-16 1) ) - (while (< a1-16 (-> obj racer-count)) - (let ((a2-7 (-> obj rankings a0-4)) - (a3-1 (-> obj rankings a1-16)) + (while (< a1-16 (-> this racer-count)) + (let ((a2-7 (-> this rankings a0-4)) + (a3-1 (-> this rankings a1-16)) ) (when (< (-> v1-0 a2-7) (-> v1-0 a3-1)) - (set! (-> obj rankings a0-4) a3-1) - (set! (-> obj rankings a1-16) a2-7) + (set! (-> this rankings a0-4) a3-1) + (set! (-> this rankings a1-16) a2-7) ) ) (+! a0-4 1) @@ -446,9 +446,9 @@ ) ) ) - (dotimes (s5-0 (-> obj racer-count)) - (let* ((v1-3 (-> obj rankings s5-0)) - (s4-0 (-> obj racer-array v1-3)) + (dotimes (s5-0 (-> this racer-count)) + (let* ((v1-3 (-> this rankings s5-0)) + (s4-0 (-> this racer-array v1-3)) ) (if (and (zero? s5-0) (nonzero? (-> s4-0 rank))) (send-event (handle->process (-> s4-0 racer)) 'race-pass) @@ -465,13 +465,13 @@ ;; definition for method 13 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod debug-print-rankings race-state ((obj race-state)) - (dotimes (s5-0 (-> obj racer-count)) - (let* ((s4-0 (-> obj rankings s5-0)) - (s3-0 (-> obj racer-array s4-0)) +(defmethod debug-print-rankings race-state ((this race-state)) + (dotimes (s5-0 (-> this racer-count)) + (let* ((s4-0 (-> this rankings s5-0)) + (s3-0 (-> this racer-array s4-0)) ) (when (not (logtest? (-> s3-0 flags) (racer-flags dead))) - (if (= s4-0 (-> obj i-player)) + (if (= s4-0 (-> this i-player)) (format *stdcon* ">>>") (format *stdcon* " ") ) @@ -480,14 +480,14 @@ (format *stdcon* " #~d finished " (+ s4-0 1)) (cond ((zero? s5-0) - (let ((a1-3 (- (-> s3-0 finish-time) (-> obj race-start-time)))) + (let ((a1-3 (- (-> s3-0 finish-time) (-> this race-start-time)))) (print-time *stdcon* (the-as time-frame a1-3)) ) ) (else (format *stdcon* "+") - (let ((a1-7 (- (- (-> s3-0 finish-time) (-> obj race-start-time)) - (- (-> obj racer-array (-> obj rankings 0) finish-time) (-> obj race-start-time)) + (let ((a1-7 (- (- (-> s3-0 finish-time) (-> this race-start-time)) + (- (-> this racer-array (-> this rankings 0) finish-time) (-> this race-start-time)) ) ) ) @@ -510,11 +510,11 @@ ;; definition for method 14 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod update-racers race-state ((obj race-state)) +(defmethod update-racers race-state ((this race-state)) (let ((s5-0 0)) - (dotimes (s4-0 (-> obj racer-count)) - (let ((s3-0 (-> obj racer-array s4-0))) - (update-lap-distance s3-0 obj) + (dotimes (s4-0 (-> this racer-count)) + (let ((s3-0 (-> this racer-array s4-0))) + (update-lap-distance s3-0 this) (if (not (logtest? (-> s3-0 flags) (racer-flags finished dead))) (+! s5-0 1) ) @@ -522,7 +522,7 @@ 0 ) (if (zero? s5-0) - (set! (-> obj state) (race-state-enum all-dead)) + (set! (-> this state) (race-state-enum all-dead)) ) ) 0 @@ -532,18 +532,18 @@ ;; definition for method 18 of type race-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod setup-race race-state ((obj race-state)) +(defmethod setup-race race-state ((this race-state)) (set-setting! 'allow-progress #f 0.0 0) - (send-event (handle->process (-> obj arrow)) 'leave) - (when (logtest? (-> obj info flags) (race-info-flags borrow)) + (send-event (handle->process (-> this arrow)) 'leave) + (when (logtest? (-> this info flags) (race-info-flags borrow)) (send-event *traffic-manager* 'set-target-level 0.0) (send-event *traffic-manager* 'set-alert-level 0) ) - (send-event (handle->process (-> obj race-signal)) 'ready) + (send-event (handle->process (-> this race-signal)) 'ready) (let ((v1-27 (new 'stack-no-clear 'matrix))) (vector-reset! (-> v1-27 vector 2)) (vector-reset! (-> v1-27 trans)) - (let ((a0-21 (-> obj racer-array (-> obj i-player)))) + (let ((a0-21 (-> this racer-array (-> this i-player)))) (let ((a3-1 (handle->process (-> a0-21 racer)))) (if a3-1 (set! (-> v1-27 vector 0 quad) (-> (the-as process-drawable a3-1) root trans quad)) @@ -552,47 +552,47 @@ (set! (-> v1-27 vector 1 quad) (-> a0-21 start-position quad)) ) (cubic-curve-method-9 - (-> obj player-intro-curve) + (-> this player-intro-curve) (the-as vector (-> v1-27 vector)) (-> v1-27 vector 2) (-> v1-27 vector 1) (-> v1-27 trans) ) ) - (let ((a0-25 (-> obj info hatch-actor-name))) + (let ((a0-25 (-> this info hatch-actor-name))) (when a0-25 (let ((a0-26 (process-by-name a0-25 *active-pool*))) (send-event a0-26 'open) ) ) ) - (set! (-> obj countdown-start-time) (-> obj current-time)) + (set! (-> this countdown-start-time) (-> this current-time)) 0 (none) ) ;; definition for method 11 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod update race-state ((obj race-state)) - (set! (-> obj current-time) (the-as uint (current-time))) - (case (-> obj state) +(defmethod update race-state ((this race-state)) + (set! (-> this current-time) (the-as uint (current-time))) + (case (-> this state) (((race-state-enum idle)) (let ((v1-3 (the-as object #t))) - (when (not (logtest? (-> obj flags) (race-flags ready))) - (dotimes (s5-0 (-> obj racer-count)) - (let ((a0-7 (-> obj racer-array s5-0))) + (when (not (logtest? (-> this flags) (race-flags ready))) + (dotimes (s5-0 (-> this racer-count)) + (let ((a0-7 (-> this racer-array s5-0))) (set! v1-3 (and v1-3 (send-event (handle->process (-> a0-7 racer)) 'test-ready))) ) ) ) - (when (and v1-3 (not (logtest? (-> obj info flags) (race-info-flags city-race)))) - (spawn-race-signal obj) - (set! v1-3 (handle->process (-> obj race-signal))) + (when (and v1-3 (not (logtest? (-> this info flags) (race-info-flags city-race)))) + (spawn-race-signal this) + (set! v1-3 (handle->process (-> this race-signal))) ) (when v1-3 - (setup-race obj) - (set! (-> obj state) - (if (or (logtest? (-> obj flags) (race-flags pidax)) (logtest? (-> obj info flags) (race-info-flags city-race))) + (setup-race this) + (set! (-> this state) + (if (or (logtest? (-> this flags) (race-flags pidax)) (logtest? (-> this info flags) (race-info-flags city-race))) (race-state-enum countdown-start) (race-state-enum player-get-on) ) @@ -601,8 +601,8 @@ ) ) (((race-state-enum player-get-on)) - (let* ((f30-0 (* 0.0033333334 (the float (- (-> obj current-time) (-> obj countdown-start-time))))) - (s4-0 (handle->process (-> obj racer-array (-> obj i-player) racer))) + (let* ((f30-0 (* 0.0033333334 (the float (- (-> this current-time) (-> this countdown-start-time))))) + (s4-0 (handle->process (-> this racer-array (-> this i-player) racer))) (s5-1 (if (type? s4-0 process-focusable) s4-0 ) @@ -611,12 +611,12 @@ (cond ((< f30-0 1.0) (when s5-1 - (cubic-curve-method-10 (-> obj player-intro-curve) (-> (the-as process-focusable s5-1) root trans) f30-0) - (cubic-curve-method-11 (-> obj player-intro-curve) (-> (the-as process-focusable s5-1) root transv) f30-0) + (cubic-curve-method-10 (-> this player-intro-curve) (-> (the-as process-focusable s5-1) root trans) f30-0) + (cubic-curve-method-11 (-> this player-intro-curve) (-> (the-as process-focusable s5-1) root transv) f30-0) (when (< 0.4 f30-0) - (when (-> obj info start-camera) - (set-setting! 'entity-name (-> obj info start-camera) 0.0 0) - (if (logtest? (-> obj info flags) (race-info-flags show-tutorial)) + (when (-> this info start-camera) + (set-setting! 'entity-name (-> this info start-camera) 0.0 0) + (if (logtest? (-> this info flags) (race-info-flags show-tutorial)) (talker-spawn-func (-> *talker-speech* 377) *entity-pool* (target-pos 0) (the-as region #f)) ) ) @@ -624,51 +624,51 @@ ) ) (else - (set! (-> obj state) (race-state-enum player-set-pos)) + (set! (-> this state) (race-state-enum player-set-pos)) ) ) ) ) (((race-state-enum player-set-pos)) - (let* ((s4-2 (handle->process (-> obj racer-array (-> obj i-player) racer))) + (let* ((s4-2 (handle->process (-> this racer-array (-> this i-player) racer))) (s5-3 (if (type? s4-2 process-focusable) s4-2 ) ) ) (when s5-3 - (cubic-curve-method-10 (-> obj player-intro-curve) (-> (the-as process-focusable s5-3) root trans) 1.0) + (cubic-curve-method-10 (-> this player-intro-curve) (-> (the-as process-focusable s5-3) root trans) 1.0) (vector-reset! (-> (the-as process-focusable s5-3) root transv)) ) ) - (let ((a0-48 (-> obj info hatch-actor-name))) + (let ((a0-48 (-> this info hatch-actor-name))) (when a0-48 (let ((a0-49 (process-by-name a0-48 *active-pool*))) (send-event a0-49 'close) ) ) ) - (set! (-> obj countdown-start-time) (-> obj current-time)) - (set! (-> obj state) (if (-> obj info countdown-scene) - (race-state-enum countdown-scene-start) - (race-state-enum countdown-start) - ) + (set! (-> this countdown-start-time) (-> this current-time)) + (set! (-> this state) (if (-> this info countdown-scene) + (race-state-enum countdown-scene-start) + (race-state-enum countdown-start) + ) ) ) (((race-state-enum countdown-scene-start)) - (when (>= (the-as uint (- (current-time) (the-as int (-> obj countdown-start-time)))) (the-as uint 300)) - (set! (-> obj state) (race-state-enum countdown-scene)) - (set! (-> obj scene-player) - (ppointer->handle (process-spawn scene-player :init scene-player-init (-> obj info countdown-scene) #t #f)) + (when (time-elapsed? (the-as int (-> this countdown-start-time)) (seconds 1)) + (set! (-> this state) (race-state-enum countdown-scene)) + (set! (-> this scene-player) + (ppointer->handle (process-spawn scene-player :init scene-player-init (-> this info countdown-scene) #t #f)) ) ) ) (((race-state-enum countdown-scene)) (cond - ((handle->process (-> obj scene-player)) - (let ((s5-5 (-> obj info))) + ((handle->process (-> this scene-player)) + (let ((s5-5 (-> this info))) (dotimes (s4-3 (-> s5-5 racer-count)) - (let ((v1-95 (-> obj racer-array s4-3))) + (let ((v1-95 (-> this racer-array s4-3))) (if (logtest? (-> s5-5 racer-array s4-3 flags) (racer-info-flags hide-in-scene)) (send-event (handle->process (-> v1-95 racer)) 'hide) ) @@ -677,76 +677,76 @@ ) ) (else - (let ((s5-6 (-> obj info))) + (let ((s5-6 (-> this info))) (dotimes (s4-4 (-> s5-6 racer-count)) - (let ((v1-105 (-> obj racer-array s4-4))) + (let ((v1-105 (-> this racer-array s4-4))) (if (logtest? (-> s5-6 racer-array s4-4 flags) (racer-info-flags hide-in-scene)) (send-event (handle->process (-> v1-105 racer)) 'unhide) ) ) ) ) - (set! (-> obj state) (race-state-enum countdown-start)) + (set! (-> this state) (race-state-enum countdown-start)) ) ) ) (((race-state-enum countdown-start)) - (set! (-> obj i-countdown) 4) - (set! (-> obj state) (race-state-enum countdown)) - (set! (-> obj countdown-start-time) (-> obj current-time)) + (set! (-> this i-countdown) 4) + (set! (-> this state) (race-state-enum countdown)) + (set! (-> this countdown-start-time) (-> this current-time)) (remove-setting! 'entity-name) ) (((race-state-enum countdown)) (let ((f0-3 3.0)) - (if (logtest? (-> obj info flags) (race-info-flags city-race)) + (if (logtest? (-> this info flags) (race-info-flags city-race)) (set! f0-3 0.2) ) - (let ((v1-127 (+ (the int (* 300.0 f0-3)) (- (-> obj countdown-start-time) (-> obj current-time))))) + (let ((v1-127 (+ (the int (* 300.0 f0-3)) (- (-> this countdown-start-time) (-> this current-time))))) (cond ((>= v1-127 (the int (* 225.0 f0-3))) ) ((>= v1-127 (the int (* 150.0 f0-3))) - (when (!= (-> obj i-countdown) 3) - (set! (-> obj i-countdown) 3) - (send-event (handle->process (-> obj race-signal)) 'count-3) + (when (!= (-> this i-countdown) 3) + (set! (-> this i-countdown) 3) + (send-event (handle->process (-> this race-signal)) 'count-3) ) ) ((>= v1-127 (the int (* 75.0 f0-3))) - (when (!= (-> obj i-countdown) 2) - (set! (-> obj i-countdown) 2) - (send-event (handle->process (-> obj race-signal)) 'count-2) + (when (!= (-> this i-countdown) 2) + (set! (-> this i-countdown) 2) + (send-event (handle->process (-> this race-signal)) 'count-2) ) ) ((< (the int (* 0.0 f0-3)) v1-127) - (when (!= (-> obj i-countdown) 1) - (set! (-> obj i-countdown) 1) - (send-event (handle->process (-> obj race-signal)) 'count-1) + (when (!= (-> this i-countdown) 1) + (set! (-> this i-countdown) 1) + (send-event (handle->process (-> this race-signal)) 'count-1) ) ) (else - (set! (-> obj i-countdown) 0) - (set! (-> obj state) (race-state-enum active)) - (begin-race obj) + (set! (-> this i-countdown) 0) + (set! (-> this state) (race-state-enum active)) + (begin-race this) ) ) ) ) - (update-racers obj) + (update-racers this) ) (((race-state-enum active)) - (update-racers obj) - (update-rankings obj) + (update-racers this) + (update-rankings this) ) (((race-state-enum all-dead)) ) (else ) ) - (dotimes (s5-7 (-> obj info turbo-pad-count)) - (let ((s4-5 (-> obj info turbo-pad-array s5-7))) + (dotimes (s5-7 (-> this info turbo-pad-count)) + (let ((s4-5 (-> this info turbo-pad-array s5-7))) (if (not (handle->process (-> s4-5 handle))) (set! (-> s4-5 handle) - (process->handle (turbo-pickup-spawn (handle->process (-> obj manager)) (-> s4-5 position))) + (process->handle (turbo-pickup-spawn (handle->process (-> this manager)) (-> s4-5 position))) ) ) ) @@ -757,7 +757,7 @@ ;; definition for method 15 of type race-state ;; WARN: Return type mismatch int vs none. -(defmethod spawn-race-signal race-state ((obj race-state)) +(defmethod spawn-race-signal race-state ((this race-state)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -767,8 +767,8 @@ ) (init-vf0-vector) (when (= (level-status *level* 'lracelit) 'active) - (let ((s3-0 (-> obj info)) - (s5-1 (handle->process (-> obj manager))) + (let ((s3-0 (-> this info)) + (s5-1 (handle->process (-> this manager))) (s4-0 (new 'stack-no-clear 'matrix)) ) (vector-float*! (-> s4-0 vector 2) (-> s3-0 start-dir) -1.0) @@ -793,7 +793,7 @@ (.svf (&-> a0-7 0 quad) vf6) ) (+! (-> s4-0 vector 0 y) 22528.0) - (set! (-> obj race-signal) + (set! (-> this race-signal) (process->handle (race-signal-spawn s5-1 (the-as vector (-> s4-0 vector)) (the-as quaternion (-> s4-0 vector 1))) ) @@ -808,7 +808,7 @@ ;; definition for method 16 of type race-state ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod initialize race-state ((obj race-state) (arg0 process) (arg1 race-info)) +(defmethod initialize race-state ((this race-state) (arg0 process) (arg1 race-info)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -817,21 +817,21 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s3-0 (-> obj flags))) - (mem-set32! (the-as pointer obj) 324 0) - (set! (-> obj flags) s3-0) + (let ((s3-0 (-> this flags))) + (mem-set32! (the-as pointer this) 324 0) + (set! (-> this flags) s3-0) ) - (set! (-> obj info) arg1) - (set! (-> obj manager) (process->handle arg0)) - (set! (-> obj scene-player) (the-as handle #f)) - (set! (-> obj hud-timer) (the-as handle #f)) - (set! (-> obj hud-lap-counter) (the-as handle #f)) - (set! (-> obj hud-turbo-counter) (the-as handle #f)) - (set! (-> obj hud-position) (the-as handle #f)) - (set! (-> obj arrow) (the-as handle #f)) - (set! (-> obj state) (race-state-enum idle)) - (set! (-> obj racer-count) 0) - (set! (-> obj finished-count) 0) + (set! (-> this info) arg1) + (set! (-> this manager) (process->handle arg0)) + (set! (-> this scene-player) (the-as handle #f)) + (set! (-> this hud-timer) (the-as handle #f)) + (set! (-> this hud-lap-counter) (the-as handle #f)) + (set! (-> this hud-turbo-counter) (the-as handle #f)) + (set! (-> this hud-position) (the-as handle #f)) + (set! (-> this arrow) (the-as handle #f)) + (set! (-> this state) (race-state-enum idle)) + (set! (-> this racer-count) 0) + (set! (-> this finished-count) 0) (let ((v1-3 (new 'stack-no-clear 'mystery-race-manager-type))) (set! (-> v1-3 vec1 z) 81920.0) (set! (-> v1-3 word) 4) @@ -849,7 +849,7 @@ ) (set! (-> v1-3 vec0 y) (+ (-> v1-3 vec0 w) (* (-> v1-3 vec1 y) (the float a1-8)))) ) - (let ((a1-13 (-> obj racer-array a0-15))) + (let ((a1-13 (-> this racer-array a0-15))) (-> arg1 racer-array a0-15) (set! (-> v1-3 mat trans quad) (-> v1-3 mat quad 0)) (let ((t0-0 (-> v1-3 mat trans))) @@ -886,22 +886,22 @@ (set! (-> a1-13 rank) a0-15) (set! (-> a1-13 speed-factor) 1.0) ) - (set! (-> obj rankings a0-15) a0-15) + (set! (-> this rankings a0-15) a0-15) ) ) - (dotimes (v1-6 (-> obj info turbo-pad-count)) - (set! (-> obj info turbo-pad-array v1-6 handle) (the-as handle #f)) + (dotimes (v1-6 (-> this info turbo-pad-count)) + (set! (-> this info turbo-pad-array v1-6 handle) (the-as handle #f)) ) (let ((v1-12 (-> *game-info* sub-task-list (-> arg1 task-node)))) - (set! (-> obj suck-factor) 0.0) + (set! (-> this suck-factor) 0.0) (if (not (logtest? (-> arg1 flags) (race-info-flags bbush))) - (set! (-> obj suck-factor) (fmax 0.0 (fmin 1.0 (* 0.2 (+ -4.0 (the float (-> v1-12 death-count))))))) + (set! (-> this suck-factor) (fmax 0.0 (fmin 1.0 (* 0.2 (+ -4.0 (the float (-> v1-12 death-count))))))) ) (format #t "race-state::initialize: death-count ~d, suck-factor ~f~%" (-> v1-12 death-count) - (-> obj suck-factor) + (-> this suck-factor) ) ) 0 @@ -917,7 +917,7 @@ ;; definition for method 20 of type race-manager ;; INFO: Used lq/sq -(defmethod update race-manager ((obj race-manager)) +(defmethod update race-manager ((this race-manager)) (let ((s5-0 *display-race-marks*)) (when (logtest? s5-0 (race-marks-controls rmc2040)) (let ((a0-3 (entity-by-name (-> *race-info-array* *select-race* race-mesh-name)))) @@ -939,7 +939,7 @@ ) ) (let ((v1-14 (new 'stack-no-clear 'inline-array 'vector 5))) - (let ((a0-6 (-> obj race-state info))) + (let ((a0-6 (-> this race-state info))) (set! (-> v1-14 0 quad) (-> a0-6 start-sphere quad)) (set! (-> v1-14 1 quad) (-> a0-6 start-dir quad)) ) @@ -951,23 +951,23 @@ (vector-! (-> v1-14 5) (-> v1-14 0) (-> v1-14 3)) ) 0 - (update (-> obj race-state)) + (update (-> this race-state)) 0 ) ;; definition for method 22 of type race-manager ;; WARN: Return type mismatch int vs none. -(defmethod race-manager-method-22 race-manager ((obj race-manager)) +(defmethod race-manager-method-22 race-manager ((this race-manager)) 0 (none) ) ;; definition for method 23 of type race-manager ;; WARN: Return type mismatch int vs none. -(defmethod initialize-race-state race-manager ((obj race-manager)) - (let ((s5-0 (-> obj race-state info))) +(defmethod initialize-race-state race-manager ((this race-manager)) + (let ((s5-0 (-> this race-state info))) (initialize-mesh s5-0) - (initialize (-> obj race-state) obj s5-0) + (initialize (-> this race-state) this s5-0) ) (let ((v1-5 *game-info*)) (set! (-> v1-5 race-position) 0) @@ -985,7 +985,7 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] -(defmethod initialize-state race-manager ((obj race-manager)) +(defmethod initialize-state race-manager ((this race-manager)) (local-vars (v1-0 int) (sv-352 task-arrow-params) @@ -995,8 +995,8 @@ (sv-416 int) ) (.mfc0 v1-0 Count) - (rigid-body-queue-manager-spawn *race-rigid-body-queue* obj) - (let* ((gp-0 (-> obj race-state)) + (rigid-body-queue-manager-spawn *race-rigid-body-queue* this) + (let* ((gp-0 (-> this race-state)) (s3-0 (-> gp-0 info)) ) (if (or (logtest? (-> s3-0 flags) (race-info-flags pidax)) @@ -1049,7 +1049,7 @@ (+! (-> s4-0 params position y) 12288.0) (set! (-> s4-0 params behavior) (the-as uint 4)) (logclear! (-> s4-0 params flags) (traffic-spawn-flags trsflags-01)) - (let ((s5-1 (vehicle-spawn obj (type-from-race-vehicle-type (-> s2-0 vehicle)) (-> s4-0 params)))) + (let ((s5-1 (vehicle-spawn this (type-from-race-vehicle-type (-> s2-0 vehicle)) (-> s4-0 params)))) (when s5-1 (init-racers! gp-0 s5-1) (send-event *target* 'change-mode 'pilot s5-1 0 #t) @@ -1087,7 +1087,7 @@ (set! (-> sv-352 flags) (task-arrow-flags)) (set! (-> sv-352 map-icon) (the-as uint 15)) (let ((t9-11 task-arrow-spawn) - (a1-17 obj) + (a1-17 this) ) (set! (-> gp-0 arrow) (process->handle (t9-11 sv-352 a1-17))) ) @@ -1113,7 +1113,7 @@ ) ) (set! sv-368 vehicle-spawn) - (set! sv-384 obj) + (set! sv-384 this) (let ((a1-18 (type-from-race-vehicle-type (-> s1-0 vehicle))) (a2-3 (-> s4-0 params)) ) @@ -1161,9 +1161,9 @@ ;; definition for method 26 of type race-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod save-score race-manager ((obj race-manager) (arg0 float)) +(defmethod save-score race-manager ((this race-manager) (arg0 float)) (local-vars (sv-32 int)) - (let* ((s5-0 (-> obj race-state info score)) + (let* ((s5-0 (-> this race-state info score)) (s3-0 0) (s2-0 (-> *highscore-info-array* s5-0)) ) @@ -1190,7 +1190,7 @@ (s2-2 (max 0 (- v1-24 s3-0))) ) (when (> (the-as uint s2-2) 0) - (set! (-> obj finish-sound-id) (the-as sound-id 1)) + (set! (-> this finish-sound-id) (the-as sound-id 1)) (cond ((= v1-24 3) (talker-spawn-func (-> *talker-speech* 374) *entity-pool* (target-pos 0) (the-as region #f)) @@ -1224,7 +1224,7 @@ ;; definition for method 27 of type race-manager ;; WARN: Return type mismatch int vs none. -(defmethod stop-speech race-manager ((obj race-manager)) +(defmethod stop-speech race-manager ((this race-manager)) (set-action! *gui-control* (gui-action stop) @@ -1251,8 +1251,8 @@ ;; definition for method 24 of type race-manager ;; WARN: Return type mismatch int vs none. -(defmethod draw-message-continue race-manager ((obj race-manager)) - (when (= (get-status *gui-control* (-> obj message-id)) (gui-status active)) +(defmethod draw-message-continue race-manager ((this race-manager)) + (when (= (get-status *gui-control* (-> this message-id)) (gui-status active)) (let ((gp-1 (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) ) @@ -1281,8 +1281,8 @@ ;; definition for method 25 of type race-manager ;; WARN: Return type mismatch int vs none. -(defmethod draw-message-retry race-manager ((obj race-manager)) - (when (= (get-status *gui-control* (-> obj message-id)) (gui-status active)) +(defmethod draw-message-retry race-manager ((this race-manager)) + (when (= (get-status *gui-control* (-> this message-id)) (gui-status active)) (let ((gp-1 (new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning)) ) @@ -1428,10 +1428,10 @@ (when (logtest? (-> gp-0 flags) (racer-flags in-race)) (cond ((logtest? (-> gp-0 flags) (racer-flags on-track)) - (set! (-> self player-on-track-time) (current-time)) + (set-time! (-> self player-on-track-time)) ) (else - (when (>= (- (current-time) (-> self player-on-track-time)) (seconds 1)) + (when (time-elapsed? (-> self player-on-track-time) (seconds 1)) (let ((v1-16 (handle->process (-> gp-0 racer)))) (when v1-16 (when (logtest? (-> (the-as vehicle-racer v1-16) flags) (rigid-body-object-flag on-ground)) @@ -1488,7 +1488,7 @@ (send-event (handle->process (-> self race-state hud-lap-counter)) 'force-hide) (send-event (handle->process (-> self race-state hud-turbo-counter)) 'force-hide) (process-spawn hud-race-final-stats :init hud-init-by-other :to self) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (when (logtest? (-> self race-state info flags) (race-info-flags complete-immediately)) (send-event (ppointer->process (-> self parent)) 'complete) (sleep-code) @@ -1497,7 +1497,7 @@ (cond ((logtest? (-> self race-state info flags) (race-info-flags retryable)) (draw-message-retry self) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (cond ((cpad-pressed? 0 confirm) (stop-speech self) @@ -1514,7 +1514,7 @@ ) (else (draw-message-continue self) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (when (cpad-pressed? 0 confirm) (stop-speech self) (send-event (ppointer->process (-> self parent)) 'complete) @@ -1547,11 +1547,11 @@ (send-event (handle->process (-> self race-state hud-lap-counter)) 'force-hide) (send-event (handle->process (-> self race-state hud-turbo-counter)) 'force-hide) (process-spawn hud-race-final-stats :init hud-init-by-other :to self) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (draw-message-retry self) (-> self race-state info) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (cond ((cpad-pressed? 0 confirm) (stop-speech self) @@ -1582,7 +1582,7 @@ (send-event (handle->process (-> self race-state hud-timer)) 'force-hide) (send-event (handle->process (-> self race-state hud-lap-counter)) 'force-hide) (send-event (handle->process (-> self race-state hud-turbo-counter)) 'force-hide) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (suspend) ) @@ -1602,10 +1602,10 @@ (define *race-manager* (the-as (pointer race-manager) #f)) ;; definition for method 10 of type race-manager -(defmethod deactivate race-manager ((obj race-manager)) +(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)) obj) + ((the-as (function process none) (find-parent-method race-manager 10)) this) (none) ) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc index 5e5b116ca6..2fd87165b4 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-mesh_REF.gc @@ -18,22 +18,22 @@ ) ;; definition for method 3 of type race-mesh-hash-search -(defmethod inspect race-mesh-hash-search ((obj race-mesh-hash-search)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-mesh-hash-search ((this race-mesh-hash-search)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-mesh-hash-search) - (format #t "~1Tbest-dist: ~f~%" (-> obj best-dist)) - (format #t "~1Tdebug-cells-searched: ~D~%" (-> obj debug-cells-searched)) - (format #t "~1Tdebug-slices-searched: ~D~%" (-> obj debug-slices-searched)) - (format #t "~1Tbounds: #~%" (-> obj bounds)) - (format #t "~1Tcell-quads[2] @ #x~X~%" (-> obj cell-quads)) - (format #t "~1Tslice-quads[4] @ #x~X~%" (-> obj slice-quads)) - (format #t "~1Tcell-bits[2] @ #x~X~%" (-> obj cell-quads)) - (format #t "~1Tslice-bits[2] @ #x~X~%" (-> obj slice-quads)) + (format #t "[~8x] ~A~%" this 'race-mesh-hash-search) + (format #t "~1Tbest-dist: ~f~%" (-> this best-dist)) + (format #t "~1Tdebug-cells-searched: ~D~%" (-> this debug-cells-searched)) + (format #t "~1Tdebug-slices-searched: ~D~%" (-> this debug-slices-searched)) + (format #t "~1Tbounds: #~%" (-> this bounds)) + (format #t "~1Tcell-quads[2] @ #x~X~%" (-> this cell-quads)) + (format #t "~1Tslice-quads[4] @ #x~X~%" (-> this slice-quads)) + (format #t "~1Tcell-bits[2] @ #x~X~%" (-> this cell-quads)) + (format #t "~1Tslice-bits[2] @ #x~X~%" (-> this slice-quads)) (label cfg-4) - obj + this ) ;; definition of type race-mesh-slice-query @@ -50,19 +50,19 @@ ) ;; definition for method 3 of type race-mesh-slice-query -(defmethod inspect race-mesh-slice-query ((obj race-mesh-slice-query)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-mesh-slice-query ((this race-mesh-slice-query)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-mesh-slice-query) - (format #t "~1Tslice-id: ~D~%" (-> obj slice-id)) - (format #t "~1Tlap-dist: ~f~%" (-> obj lap-dist)) - (format #t "~1Tpt-on-slice: #~%" (-> obj pt-on-slice)) - (format #t "~1Tslice-corners[4] @ #x~X~%" (-> obj slice-corners)) - (format #t "~1Tsearch-sphere: #~%" (-> obj search-sphere)) + (format #t "[~8x] ~A~%" this 'race-mesh-slice-query) + (format #t "~1Tslice-id: ~D~%" (-> this slice-id)) + (format #t "~1Tlap-dist: ~f~%" (-> this lap-dist)) + (format #t "~1Tpt-on-slice: #~%" (-> this pt-on-slice)) + (format #t "~1Tslice-corners[4] @ #x~X~%" (-> this slice-corners)) + (format #t "~1Tsearch-sphere: #~%" (-> this search-sphere)) (label cfg-4) - obj + this ) ;; definition of type race-path-edge-info @@ -75,15 +75,15 @@ ) ;; definition for method 3 of type race-path-edge-info -(defmethod inspect race-path-edge-info ((obj race-path-edge-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-path-edge-info ((this race-path-edge-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-path-edge-info) - (format #t "~1Tsample-t: ~f~%" (-> obj sample-t)) + (format #t "[~8x] ~A~%" this 'race-path-edge-info) + (format #t "~1Tsample-t: ~f~%" (-> this sample-t)) (label cfg-4) - obj + this ) ;; definition of type race-path-sample @@ -102,21 +102,21 @@ ) ;; definition for method 3 of type race-path-sample -(defmethod inspect race-path-sample ((obj race-path-sample)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-path-sample ((this race-path-sample)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-path-sample) - (format #t "~1Tbytes[32] @ #x~X~%" (-> obj bytes)) - (format #t "~1Tpos: ~`vector`P~%" (-> obj bytes)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Tstick-x: ~D~%" (-> obj stick-x)) - (format #t "~1Tstick-y: ~D~%" (-> obj stick-y)) - (format #t "~1Tthrottle: ~D~%" (-> obj throttle)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "[~8x] ~A~%" this 'race-path-sample) + (format #t "~1Tbytes[32] @ #x~X~%" (-> this bytes)) + (format #t "~1Tpos: ~`vector`P~%" (-> this bytes)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tstick-x: ~D~%" (-> this stick-x)) + (format #t "~1Tstick-y: ~D~%" (-> this stick-y)) + (format #t "~1Tthrottle: ~D~%" (-> this throttle)) + (format #t "~1Tflags: ~D~%" (-> this flags)) (label cfg-4) - obj + this ) ;; definition of type race-path @@ -139,19 +139,19 @@ ) ;; definition for method 3 of type race-path -(defmethod inspect race-path ((obj race-path)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-path ((this race-path)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-path) - (format #t "~1Tsample-count: ~D~%" (-> obj sample-count)) - (format #t "~1Trecord-id: ~D~%" (-> obj record-id)) - (format #t "~1Tpad: ~D~%" (-> obj pad)) - (format #t "~1Tsamples: #x~X~%" (-> obj samples)) - (format #t "~1Tedge-infos: #x~X~%" (-> obj edge-infos)) + (format #t "[~8x] ~A~%" this 'race-path) + (format #t "~1Tsample-count: ~D~%" (-> this sample-count)) + (format #t "~1Trecord-id: ~D~%" (-> this record-id)) + (format #t "~1Tpad: ~D~%" (-> this pad)) + (format #t "~1Tsamples: #x~X~%" (-> this samples)) + (format #t "~1Tedge-infos: #x~X~%" (-> this edge-infos)) (label cfg-4) - obj + this ) ;; definition of type race-path-group @@ -167,18 +167,18 @@ ) ;; definition for method 3 of type race-path-group -(defmethod inspect race-path-group ((obj race-path-group)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-path-group ((this race-path-group)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-path-group) - (format #t "~1Tname: ~A~%" (-> obj name)) - (format #t "~1Tpath-count: ~D~%" (-> obj path-count)) - (format #t "~1Tpad[3] @ #x~X~%" (-> obj pad)) - (format #t "~1Tpaths: #x~X~%" (-> obj paths)) + (format #t "[~8x] ~A~%" this 'race-path-group) + (format #t "~1Tname: ~A~%" (-> this name)) + (format #t "~1Tpath-count: ~D~%" (-> this path-count)) + (format #t "~1Tpad[3] @ #x~X~%" (-> this pad)) + (format #t "~1Tpaths: #x~X~%" (-> this paths)) (label cfg-4) - obj + this ) ;; definition of type race-mesh-edge @@ -193,17 +193,17 @@ ) ;; definition for method 3 of type race-mesh-edge -(defmethod inspect race-mesh-edge ((obj race-mesh-edge)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-mesh-edge ((this race-mesh-edge)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-mesh-edge) - (format #t "~1Tleft: ~`vector`P~%" (-> obj left)) - (format #t "~1Tright: ~`vector`P~%" (-> obj right)) - (format #t "~1Tlap-dist: ~f~%" (-> obj left w)) + (format #t "[~8x] ~A~%" this 'race-mesh-edge) + (format #t "~1Tleft: ~`vector`P~%" (-> this left)) + (format #t "~1Tright: ~`vector`P~%" (-> this right)) + (format #t "~1Tlap-dist: ~f~%" (-> this left w)) (label cfg-4) - obj + this ) ;; definition of type race-mesh-slice @@ -219,17 +219,17 @@ ) ;; definition for method 3 of type race-mesh-slice -(defmethod inspect race-mesh-slice ((obj race-mesh-slice)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-mesh-slice ((this race-mesh-slice)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-mesh-slice) - (format #t "~1Tedge-index-array[2] @ #x~X~%" (-> obj edge-index-array)) - (format #t "~1Tstart-edge: ~D~%" (-> obj start-edge)) - (format #t "~1Tend-edge: ~D~%" (-> obj end-edge)) + (format #t "[~8x] ~A~%" this 'race-mesh-slice) + (format #t "~1Tedge-index-array[2] @ #x~X~%" (-> this edge-index-array)) + (format #t "~1Tstart-edge: ~D~%" (-> this start-edge)) + (format #t "~1Tend-edge: ~D~%" (-> this end-edge)) (label cfg-4) - obj + this ) ;; definition of type race-mesh-hash-cell @@ -244,17 +244,17 @@ ) ;; definition for method 3 of type race-mesh-hash-cell -(defmethod inspect race-mesh-hash-cell ((obj race-mesh-hash-cell)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-mesh-hash-cell ((this race-mesh-hash-cell)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-mesh-hash-cell) - (format #t "~1Tfirst-slice: ~D~%" (-> obj first-slice)) - (format #t "~1Tslice-count: ~D~%" (-> obj slice-count)) - (format #t "~1Tpad: ~D~%" (-> obj pad)) + (format #t "[~8x] ~A~%" this 'race-mesh-hash-cell) + (format #t "~1Tfirst-slice: ~D~%" (-> this first-slice)) + (format #t "~1Tslice-count: ~D~%" (-> this slice-count)) + (format #t "~1Tpad: ~D~%" (-> this pad)) (label cfg-4) - obj + this ) ;; definition of type race-mesh-hash @@ -272,20 +272,20 @@ ) ;; definition for method 3 of type race-mesh-hash -(defmethod inspect race-mesh-hash ((obj race-mesh-hash)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-mesh-hash ((this race-mesh-hash)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-mesh-hash) - (format #t "~1Tcells-wide: ~D~%" (-> obj cells-wide)) - (format #t "~1Tcells-tall: ~D~%" (-> obj cells-tall)) - (format #t "~1Tcell-length: ~f~%" (-> obj cell-length)) - (format #t "~1Tcells: #x~X~%" (-> obj cells)) - (format #t "~1Tslice-table: #x~X~%" (-> obj slice-table)) - (format #t "~1Torigin: ~`vector`P~%" (-> obj origin)) + (format #t "[~8x] ~A~%" this 'race-mesh-hash) + (format #t "~1Tcells-wide: ~D~%" (-> this cells-wide)) + (format #t "~1Tcells-tall: ~D~%" (-> this cells-tall)) + (format #t "~1Tcell-length: ~f~%" (-> this cell-length)) + (format #t "~1Tcells: #x~X~%" (-> this cells)) + (format #t "~1Tslice-table: #x~X~%" (-> this slice-table)) + (format #t "~1Torigin: ~`vector`P~%" (-> this origin)) (label cfg-4) - obj + this ) ;; definition of type race-mesh @@ -320,35 +320,35 @@ ) ;; definition for method 3 of type race-mesh -(defmethod inspect race-mesh ((obj race-mesh)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-mesh ((this race-mesh)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tversion: ~D~%" (-> obj version)) - (format #t "~1Tpath-group-count: ~D~%" (-> obj path-group-count)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tpad[1] @ #x~X~%" (-> obj pad)) - (format #t "~1Tslice-count: ~D~%" (-> obj slice-count)) - (format #t "~1Tedge-count: ~D~%" (-> obj edge-count)) - (format #t "~1Tslices: #x~X~%" (-> obj slices)) - (format #t "~1Tedges: #x~X~%" (-> obj edges)) - (format #t "~1Thash: #~%" (-> obj hash)) - (format #t "~1Tpath-groups: #x~X~%" (-> obj path-groups)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tversion: ~D~%" (-> this version)) + (format #t "~1Tpath-group-count: ~D~%" (-> this path-group-count)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tpad[1] @ #x~X~%" (-> this pad)) + (format #t "~1Tslice-count: ~D~%" (-> this slice-count)) + (format #t "~1Tedge-count: ~D~%" (-> this edge-count)) + (format #t "~1Tslices: #x~X~%" (-> this slices)) + (format #t "~1Tedges: #x~X~%" (-> this edges)) + (format #t "~1Thash: #~%" (-> this hash)) + (format #t "~1Tpath-groups: #x~X~%" (-> this path-groups)) (label cfg-4) - obj + this ) ;; definition for method 10 of type race-path ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod race-path-method-10 race-path ((obj race-path) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod race-path-method-10 race-path ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) (let ((v1-0 (new 'stack-no-clear 'inline-array 'vector 4)) (a3-1 (the int arg1)) ) - (set! (-> v1-0 0 quad) (-> obj samples a3-1 pos quad)) - (set! (-> v1-0 1 quad) (-> obj samples (+ a3-1 1) pos quad)) + (set! (-> v1-0 0 quad) (-> this samples a3-1 pos quad)) + (set! (-> v1-0 1 quad) (-> this samples (+ a3-1 1) pos quad)) (let ((f0-3 (- arg1 (the float a3-1)))) (vector-lerp! arg0 (-> v1-0 0) (-> v1-0 1) f0-3) ) @@ -359,9 +359,9 @@ ;; definition for method 11 of type race-path ;; WARN: Return type mismatch int vs none. -(defmethod race-path-method-11 race-path ((obj race-path) (arg0 race-path-sample) (arg1 vector) (arg2 float)) +(defmethod race-path-method-11 race-path ((this race-path) (arg0 race-path-sample) (arg1 vector) (arg2 float)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'race-path-sample 6))) - (let ((f0-1 (the float (-> obj sample-count)))) + (let ((f0-1 (the float (-> this sample-count)))) (if (< f0-1 arg2) (set! arg2 (- arg2 f0-1)) ) @@ -370,13 +370,13 @@ ) ) (let ((s1-0 (the int arg2))) - (mem-copy! (the-as pointer (-> gp-0 0)) (the-as pointer (-> obj samples s1-0)) 32) - (mem-copy! (the-as pointer (-> gp-0 1)) (the-as pointer (-> obj samples (+ s1-0 1))) 32) + (mem-copy! (the-as pointer (-> gp-0 0)) (the-as pointer (-> this samples s1-0)) 32) + (mem-copy! (the-as pointer (-> gp-0 1)) (the-as pointer (-> this samples (+ s1-0 1))) 32) (let ((v1-7 (+ s1-0 2))) - (if (< (the-as int (-> obj sample-count)) v1-7) - (set! v1-7 (- v1-7 (the-as int (-> obj sample-count)))) + (if (< (the-as int (-> this sample-count)) v1-7) + (set! v1-7 (- v1-7 (the-as int (-> this sample-count)))) ) - (mem-copy! (the-as pointer (-> gp-0 2)) (the-as pointer (-> obj samples v1-7)) 32) + (mem-copy! (the-as pointer (-> gp-0 2)) (the-as pointer (-> this samples v1-7)) 32) ) (let ((f30-0 (- arg2 (the float s1-0)))) (vector-lerp! (the-as vector (-> arg0 bytes)) (the-as vector (-> gp-0 0)) (the-as vector (-> gp-0 1)) f30-0) @@ -408,7 +408,7 @@ ) ;; definition for method 12 of type race-path -(defmethod race-path-method-12 race-path ((obj race-path) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod race-path-method-12 race-path ((this race-path) (arg0 vector) (arg1 float) (arg2 float)) (local-vars (v1-15 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -418,7 +418,7 @@ (init-vf0-vector) (let ((gp-0 arg2) (s4-0 (new 'stack-no-clear 'matrix)) - (f30-0 (the float (-> obj sample-count))) + (f30-0 (the float (-> this sample-count))) ) (if (< f30-0 gp-0) (set! gp-0 (- gp-0 f30-0)) @@ -426,8 +426,8 @@ (if (< arg1 0.0) (set! arg1 (+ arg1 f30-0)) ) - (race-path-method-10 obj (the-as vector (-> s4-0 vector)) arg1 arg2) - (race-path-method-10 obj (-> s4-0 vector 1) gp-0 arg2) + (race-path-method-10 this (the-as vector (-> s4-0 vector)) arg1 arg2) + (race-path-method-10 this (-> s4-0 vector 1) gp-0 arg2) (vector-! (-> s4-0 vector 2) (-> s4-0 vector 1) (the-as vector (-> s4-0 vector))) (vector-! (-> s4-0 trans) arg0 (the-as vector (-> s4-0 vector))) (let ((f0-7 0.0) @@ -463,15 +463,15 @@ ;; definition for method 9 of type race-path ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-path-debug race-path ((obj race-path) (arg0 rgba) (arg1 rgba)) +(defmethod draw-path-debug race-path ((this race-path) (arg0 rgba) (arg1 rgba)) (let ((s1-0 0) (s3-0 1) - (s2-0 (+ (-> obj sample-count) -1)) + (s2-0 (+ (-> this sample-count) -1)) ) (set! (-> (new 'stack-no-clear 'vector) quad) (-> (camera-pos) quad)) (while (< s1-0 (the-as int s2-0)) - (let ((v1-4 (-> obj samples s1-0)) - (a3-0 (-> obj samples s3-0)) + (let ((v1-4 (-> this samples s1-0)) + (a3-0 (-> this samples s3-0)) ) (add-debug-line #t @@ -492,9 +492,9 @@ ) ;; definition for method 9 of type race-mesh -(defmethod debug-draw-path race-mesh ((obj race-mesh) (arg0 int) (arg1 int) (arg2 rgba) (arg3 rgba)) - (when (< arg1 (the-as int (-> obj path-group-count))) - (let ((v1-2 (-> obj path-groups arg1))) +(defmethod debug-draw-path race-mesh ((this race-mesh) (arg0 int) (arg1 int) (arg2 rgba) (arg3 rgba)) + (when (< arg1 (the-as int (-> this path-group-count))) + (let ((v1-2 (-> this path-groups arg1))) (if (< arg0 (-> v1-2 path-count)) (draw-path-debug (-> v1-2 paths arg0) arg2 arg3) ) @@ -504,9 +504,9 @@ ) ;; definition for method 10 of type race-mesh -(defmethod debug-draw-path-from-history race-mesh ((obj race-mesh) (arg0 int) (arg1 int)) - (when (< arg1 (the-as int (-> obj path-group-count))) - (let ((v1-2 (-> obj path-groups arg1))) +(defmethod debug-draw-path-from-history race-mesh ((this race-mesh) (arg0 int) (arg1 int)) + (when (< arg1 (the-as int (-> this path-group-count))) + (let ((v1-2 (-> this path-groups arg1))) (countdown (a2-1 (-> v1-2 path-count)) (let ((a0-3 (-> v1-2 paths a2-1))) (when (= (-> a0-3 record-id) arg0) @@ -544,10 +544,10 @@ ;; definition for method 11 of type race-mesh ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw-slice race-mesh ((obj race-mesh) (arg0 int)) - (let* ((v1-1 (-> obj slices arg0)) - (s3-0 (-> obj edges (-> v1-1 start-edge))) - (s4-0 (-> obj edges (-> v1-1 end-edge))) +(defmethod debug-draw-slice race-mesh ((this race-mesh) (arg0 int)) + (let* ((v1-1 (-> this slices arg0)) + (s3-0 (-> this edges (-> v1-1 start-edge))) + (s4-0 (-> this edges (-> v1-1 end-edge))) ) (add-debug-line #t @@ -604,14 +604,14 @@ ;; definition for method 12 of type race-mesh ;; WARN: Return type mismatch int vs none. -(defmethod debug-draw-edges race-mesh ((obj race-mesh)) +(defmethod debug-draw-edges race-mesh ((this race-mesh)) (let ((idx 0) - (slice-cnt (+ (-> obj slice-count) -1)) + (slice-cnt (+ (-> this slice-count) -1)) ) (while (>= slice-cnt idx) - (let* ((v1-2 (-> obj slices idx)) - (s3-0 (-> obj edges (-> v1-2 start-edge))) - (s2-0 (-> obj edges (-> v1-2 end-edge))) + (let* ((v1-2 (-> this slices idx)) + (s3-0 (-> this edges (-> v1-2 start-edge))) + (s2-0 (-> this edges (-> v1-2 end-edge))) ) (add-debug-line #t (bucket-id debug-no-zbuf1) (-> s3-0 left) (-> s2-0 left) *color-white* #f (the-as rgba -1)) (add-debug-line @@ -628,7 +628,7 @@ (+! idx 1) ) ) - (let ((v1-8 (-> obj edges 0))) + (let ((v1-8 (-> this edges 0))) (add-debug-line #t (bucket-id debug-no-zbuf1) @@ -639,8 +639,8 @@ (the-as rgba -1) ) ) - (let ((s5-1 (+ (-> obj edge-count) -1))) - (let ((v1-12 (-> obj edges s5-1))) + (let ((s5-1 (+ (-> this edge-count) -1))) + (let ((v1-12 (-> this edges s5-1))) (add-debug-line #t (bucket-id debug-no-zbuf1) @@ -651,7 +651,7 @@ (the-as rgba -1) ) ) - (format *stdcon* "edge-count ~d last-edge ~d~%" (-> obj edge-count) s5-1) + (format *stdcon* "edge-count ~d last-edge ~d~%" (-> this edge-count) s5-1) ) 0 (none) @@ -659,11 +659,11 @@ ;; definition for method 19 of type race-mesh ;; INFO: Used lq/sq -(defmethod race-mesh-method-19 race-mesh ((obj race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) +(defmethod race-mesh-method-19 race-mesh ((this race-mesh) (arg0 int) (arg1 race-mesh-slice-query)) (set! (-> arg1 slice-id) -1) - (let* ((v1-2 (-> obj slices arg0)) - (a1-3 (-> obj edges (-> v1-2 start-edge))) - (v1-5 (-> obj edges (-> v1-2 end-edge))) + (let* ((v1-2 (-> this slices arg0)) + (a1-3 (-> this edges (-> v1-2 start-edge))) + (v1-5 (-> this edges (-> v1-2 end-edge))) ) (set! (-> arg1 slice-corners 0 quad) (-> a1-3 left quad)) (set! (-> arg1 slice-corners 1 quad) (-> a1-3 right quad)) @@ -715,9 +715,9 @@ ) ;; definition for method 17 of type race-mesh -(defmethod race-mesh-method-17 race-mesh ((obj race-mesh) (slice-query race-mesh-slice-query)) +(defmethod race-mesh-method-17 race-mesh ((this race-mesh) (slice-query race-mesh-slice-query)) (set! (-> slice-query slice-id) -1) - (let* ((race-hash (-> obj hash)) + (let* ((race-hash (-> this hash)) (v1-2 (max 0 @@ -748,7 +748,7 @@ (+! s1-0 -1) (let ((a1-7 (-> (&-> (-> race-hash slice-table) 0 edge-index-array (+ (-> (the-as (pointer int16) s3-0)) s1-0)) 0)) ) - (when (race-mesh-method-19 obj (the-as int a1-7) s2-0) + (when (race-mesh-method-19 this (the-as int a1-7) s2-0) (if (or (= (-> slice-query slice-id) -1) (< (vector-vector-distance-squared (-> s2-0 pt-on-slice) (-> slice-query search-sphere)) (vector-vector-distance-squared (-> slice-query pt-on-slice) (-> slice-query search-sphere)) @@ -768,12 +768,12 @@ ;; definition for method 15 of type race-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod race-mesh-method-15 race-mesh ((obj race-mesh) (id int) (slice-query race-mesh-slice-query)) +(defmethod race-mesh-method-15 race-mesh ((this race-mesh) (id int) (slice-query race-mesh-slice-query)) (local-vars (v1-8 symbol)) (set! (-> slice-query slice-id) id) - (let* ((v1-1 (-> obj slices id)) - (a1-3 (-> obj edges (-> v1-1 start-edge))) - (v1-4 (-> obj edges (-> v1-1 end-edge))) + (let* ((v1-1 (-> this slices id)) + (a1-3 (-> this edges (-> v1-1 start-edge))) + (v1-4 (-> this edges (-> v1-1 end-edge))) ) (set! (-> slice-query slice-corners 0 quad) (-> a1-3 left quad)) (set! (-> slice-query slice-corners 1 quad) (-> a1-3 right quad)) @@ -853,16 +853,16 @@ ;; definition for method 18 of type race-mesh ;; WARN: Return type mismatch symbol vs none. -(defmethod race-mesh-method-18 race-mesh ((obj race-mesh) (arg0 race-mesh-hash-search) (arg1 int) (arg2 int) (arg3 race-mesh-slice-query)) - (let* ((v1-3 (+ (* arg2 (-> obj hash cells-wide)) arg1)) +(defmethod race-mesh-method-18 race-mesh ((this race-mesh) (arg0 race-mesh-hash-search) (arg1 int) (arg2 int) (arg3 race-mesh-slice-query)) + (let* ((v1-3 (+ (* arg2 (-> this hash cells-wide)) arg1)) (a0-1 (/ v1-3 8)) (a1-2 (ash 1 (logand v1-3 7))) (a2-4 (-> (the-as race-mesh-hash-search (+ a0-1 (the-as int arg0))) cell-bits 0 data 0)) ) (when (not (logtest? a2-4 a1-2)) (set! (-> arg0 cell-bits 0 data a0-1) (logior a2-4 a1-2)) - (let* ((v1-5 (the-as object (+ (the-as uint (-> obj hash cells)) (* v1-3 4)))) - (s3-0 (&-> (-> obj hash slice-table) 0 edge-index-array (-> (the-as (pointer int16) v1-5)))) + (let* ((v1-5 (the-as object (+ (the-as uint (-> this hash cells)) (* v1-3 4)))) + (s3-0 (&-> (-> this hash slice-table) 0 edge-index-array (-> (the-as (pointer int16) v1-5)))) (s1-0 (-> (the-as race-mesh-hash-cell v1-5) slice-count)) ) (when (nonzero? s1-0) @@ -877,7 +877,7 @@ ) (when (not (logtest? a2-9 a0-10)) (set! (-> arg0 slice-bits 0 data v1-6) (logior a2-9 a0-10)) - (race-mesh-method-15 obj (the-as int a1-7) s2-0) + (race-mesh-method-15 this (the-as int a1-7) s2-0) (let ((f0-0 (vector-vector-distance-squared (-> s2-0 pt-on-slice) (-> arg3 search-sphere)))) (when (or (= (-> arg3 slice-id) -1) (< f0-0 (-> arg0 best-dist))) (set! (-> arg0 best-dist) f0-0) @@ -899,12 +899,12 @@ ;; definition for method 16 of type race-mesh ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod race-mesh-method-16 race-mesh ((obj race-mesh) (arg0 race-mesh-slice-query)) +(defmethod race-mesh-method-16 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) (set! (-> arg0 slice-id) -1) - (let ((s4-0 (-> obj hash)) + (let ((s4-0 (-> this hash)) (s3-0 (new 'stack-no-clear 'race-mesh-hash-search)) ) - (let ((v1-3 (/ (+ (-> obj slice-count) 127) 128))) + (let ((v1-3 (/ (+ (-> this slice-count) 127) 128))) (when (< 4 v1-3) (break!) 0 @@ -944,7 +944,7 @@ (until (< (-> s3-0 bounds max z) s2-0) (let ((s1-0 (-> s3-0 bounds min x))) (until (< (-> s3-0 bounds max x) s1-0) - (race-mesh-method-18 obj s3-0 s1-0 s2-0 arg0) + (race-mesh-method-18 this s3-0 s1-0 s2-0 arg0) (+! s1-0 1) ) ) @@ -959,15 +959,15 @@ (set! (-> s3-0 bounds max z) (min (+ (-> s3-0 bounds max z) 1) (+ (-> s4-0 cells-tall) -1))) (let ((s2-1 (-> s3-0 bounds min x))) (until (< (-> s3-0 bounds max x) s2-1) - (race-mesh-method-18 obj s3-0 s2-1 (-> s3-0 bounds min z) arg0) - (race-mesh-method-18 obj s3-0 s2-1 (-> s3-0 bounds max z) arg0) + (race-mesh-method-18 this s3-0 s2-1 (-> s3-0 bounds min z) arg0) + (race-mesh-method-18 this s3-0 s2-1 (-> s3-0 bounds max z) arg0) (+! s2-1 1) ) ) (let ((s2-2 (-> s3-0 bounds min z))) (until (< (-> s3-0 bounds max z) s2-2) - (race-mesh-method-18 obj s3-0 (-> s3-0 bounds min x) s2-2 arg0) - (race-mesh-method-18 obj s3-0 (-> s3-0 bounds max x) s2-2 arg0) + (race-mesh-method-18 this s3-0 (-> s3-0 bounds min x) s2-2 arg0) + (race-mesh-method-18 this s3-0 (-> s3-0 bounds max x) s2-2 arg0) (+! s2-2 1) ) ) @@ -980,7 +980,7 @@ ;; definition for method 14 of type race-mesh ;; WARN: Return type mismatch float vs none. -(defmethod race-mesh-method-14 race-mesh ((obj race-mesh) (arg0 race-mesh-slice-query)) +(defmethod race-mesh-method-14 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) (let* ((f30-0 (vector-line-distance-point! (-> arg0 pt-on-slice) (the-as vector (-> arg0 slice-corners)) @@ -996,9 +996,9 @@ ) ) (f0-0 (+ f30-0 f1-0)) - (v1-1 (-> obj slices (-> arg0 slice-id))) - (f2-0 (-> obj edges (-> v1-1 start-edge) left w)) - (f3-0 (-> obj edges (-> v1-1 end-edge) left w)) + (v1-1 (-> this slices (-> arg0 slice-id))) + (f2-0 (-> this edges (-> v1-1 start-edge) left w)) + (f3-0 (-> this edges (-> v1-1 end-edge) left w)) ) (set! (-> arg0 lap-dist) (+ (* (/ f1-0 f0-0) f2-0) (* (/ f30-0 f0-0) f3-0))) ) @@ -1007,13 +1007,13 @@ ;; definition for method 13 of type race-mesh ;; WARN: Return type mismatch int vs none. -(defmethod race-mesh-method-13 race-mesh ((obj race-mesh) (arg0 race-mesh-slice-query)) - (race-mesh-method-17 obj arg0) +(defmethod race-mesh-method-13 race-mesh ((this race-mesh) (arg0 race-mesh-slice-query)) + (race-mesh-method-17 this arg0) (if (and (= (-> arg0 slice-id) -1) (< 0.0 (-> arg0 search-sphere r))) - (race-mesh-method-16 obj arg0) + (race-mesh-method-16 this arg0) ) (when (!= (-> arg0 slice-id) -1) - (race-mesh-method-14 obj arg0) + (race-mesh-method-14 this arg0) 0 ) (none) diff --git a/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc b/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc index 0e13e7d576..d48f0e48ca 100644 --- a/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/race-obs_REF.gc @@ -26,16 +26,16 @@ ) ;; definition for method 3 of type race-signal-banner -(defmethod inspect race-signal-banner ((obj race-signal-banner)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-signal-banner ((this race-signal-banner)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -116,38 +116,40 @@ ) ;; definition for method 3 of type race-signal -(defmethod inspect race-signal ((obj race-signal)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-signal ((this race-signal)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpos: #~%" (-> obj pos)) - (format #t "~2Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~2Tdest-y-offset: ~f~%" (-> obj dest-y-offset)) - (format #t "~2Tbob-time: ~D~%" (-> obj bob-time)) - (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~2Tbanner: ~D~%" (-> obj banner)) - (format #t "~2Tcurve: #~%" (-> obj curve)) + (format #t "~2Tpos: #~%" (-> this pos)) + (format #t "~2Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~2Tdest-y-offset: ~f~%" (-> this dest-y-offset)) + (format #t "~2Tbob-time: ~D~%" (-> this bob-time)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Tbanner: ~D~%" (-> this banner)) + (format #t "~2Tcurve: #~%" (-> this curve)) (label cfg-4) - obj + this ) ;; definition for method 29 of type race-signal ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod race-signal-method-29 race-signal ((obj race-signal)) - (+! (-> obj y-offset) (* (- (-> obj dest-y-offset) (-> obj y-offset)) (fmin 1.0 (* 2.0 (seconds-per-frame))))) - (let ((f30-0 (* 0.0033333334 (the float (- (current-time) (-> obj bob-time)))))) - (set! (-> obj root trans y) (+ (-> obj pos y) (-> obj y-offset) (* 1024.0 (sin (* 32768.0 f30-0))))) - (set! (-> obj root trans z) (+ (-> obj pos z) (* 2048.0 (cos (* 32768.0 f30-0))))) +(defmethod race-signal-method-29 race-signal ((this race-signal)) + (+! (-> this y-offset) + (* (- (-> this dest-y-offset) (-> this y-offset)) (fmin 1.0 (* 2.0 (seconds-per-frame)))) + ) + (let ((f30-0 (* 0.0033333334 (the float (- (current-time) (-> this bob-time)))))) + (set! (-> this root trans y) (+ (-> this pos y) (-> this y-offset) (* 1024.0 (sin (* 32768.0 f30-0))))) + (set! (-> this root trans z) (+ (-> this pos z) (* 2048.0 (cos (* 32768.0 f30-0))))) ) - (let ((v1-15 (handle->process (-> obj banner)))) + (let ((v1-15 (handle->process (-> this banner)))) (when v1-15 - (set! (-> (the-as race-signal-banner v1-15) root trans quad) (-> obj root trans quad)) - (quaternion-copy! (-> (the-as race-signal-banner v1-15) root quat) (-> obj root quat)) + (set! (-> (the-as race-signal-banner v1-15) root trans quad) (-> this root trans quad)) + (quaternion-copy! (-> (the-as race-signal-banner v1-15) root quat) (-> this root quat)) ) ) (ja-post) @@ -300,7 +302,7 @@ (-> v1-8 trans) ) ) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (until #f (suspend) ) @@ -333,7 +335,7 @@ (until #f (ja :num-func num-func-identity :frame-num (ja-aframe 0.0 0)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (suspend) ) ) @@ -344,7 +346,7 @@ ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 196) 600 #f #f self 5 :to self) (let ((gp-5 (current-time))) - (until (>= (- (current-time) gp-5) (seconds 0.5)) + (until (time-elapsed? gp-5 (seconds 0.5)) (suspend) ) ) @@ -355,7 +357,7 @@ ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 195) 300 #f #f self 7 :to self) (let ((gp-9 (current-time))) - (until (>= (- (current-time) gp-9) (seconds 0.5)) + (until (time-elapsed? gp-9 (seconds 0.5)) (suspend) ) ) @@ -366,13 +368,13 @@ ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 194) 300 #f #f self 9 :to self) (let ((gp-13 (current-time))) - (until (>= (- (current-time) gp-13) (seconds 0.5)) + (until (time-elapsed? gp-13 (seconds 0.5)) (suspend) ) ) (process-spawn part-tracker :init part-tracker-init (-> *part-group-id-table* 197) 300 #f #f self 10 :to self) (let ((gp-15 (current-time))) - (until (>= (- (current-time) gp-15) (seconds 0.5)) + (until (time-elapsed? gp-15 (seconds 0.5)) (suspend) ) ) @@ -401,7 +403,7 @@ (the-as skeleton-group (art-group-get-by-name *level* "skel-race-signal" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> self bob-time) (current-time)) + (set-time! (-> self bob-time)) (set! (-> self banner) (the-as handle #f)) (set! (-> self draw shadow-mask) (the-as uint 30)) (set! (-> self draw shadow-values) (the-as uint #x22220)) @@ -433,17 +435,17 @@ ) ;; definition for method 3 of type stadium-racer -(defmethod inspect stadium-racer ((obj stadium-racer)) - (when (not obj) - (set! obj obj) +(defmethod inspect stadium-racer ((this stadium-racer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-rider inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trider-type: ~D~%" (-> obj rider-type)) + (format #t "~2Trider-type: ~D~%" (-> this rider-type)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -454,15 +456,15 @@ ;; definition for method 33 of type stadium-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-33 stadium-racer ((obj stadium-racer)) +(defmethod vehicle-rider-method-33 stadium-racer ((this stadium-racer)) (let ((t9-0 (method-of-type vehicle-rider vehicle-rider-method-33))) - (t9-0 obj) + (t9-0 this) ) - (setup-masks (-> obj draw) 0 -1) + (setup-masks (-> this draw) 0 -1) (let ((s4-0 0) (s5-0 0) ) - (case (-> obj rider-type) + (case (-> this rider-type) ((3) (set! s4-0 0) (set! s5-0 0) @@ -503,78 +505,78 @@ (let ((v1-14 s4-0)) (cond ((zero? v1-14) - (setup-masks (-> obj draw) 32 0) + (setup-masks (-> this draw) 32 0) ) ((= v1-14 1) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) ) ((= v1-14 2) - (setup-masks (-> obj draw) #x40000 0) + (setup-masks (-> this draw) #x40000 0) ) ) ) (let ((v1-22 s4-0)) (cond ((zero? v1-22) - (setup-masks (-> obj draw) 128 0) + (setup-masks (-> this draw) 128 0) ) ((= v1-22 1) - (setup-masks (-> obj draw) #x4000 0) + (setup-masks (-> this draw) #x4000 0) ) ((= v1-22 2) - (setup-masks (-> obj draw) #x80000 0) + (setup-masks (-> this draw) #x80000 0) ) ) ) (let ((v1-30 s4-0)) (cond ((zero? v1-30) - (setup-masks (-> obj draw) 512 0) + (setup-masks (-> this draw) 512 0) ) ((= v1-30 1) - (setup-masks (-> obj draw) #x8000 0) + (setup-masks (-> this draw) #x8000 0) ) ((= v1-30 2) - (setup-masks (-> obj draw) #x100000 0) + (setup-masks (-> this draw) #x100000 0) ) ) ) (cond ((zero? s4-0) - (setup-masks (-> obj draw) 2048 0) + (setup-masks (-> this draw) 2048 0) ) ((= s4-0 1) - (setup-masks (-> obj draw) #x20000 0) + (setup-masks (-> this draw) #x20000 0) ) ((= s4-0 2) - (setup-masks (-> obj draw) #x400000 0) + (setup-masks (-> this draw) #x400000 0) ) ) (let ((v1-49 s5-0)) (cond ((zero? v1-49) - (setup-masks (-> obj draw) 1024 0) + (setup-masks (-> this draw) 1024 0) ) ((= v1-49 1) - (setup-masks (-> obj draw) #x10000 0) + (setup-masks (-> this draw) #x10000 0) ) ((= v1-49 2) - (setup-masks (-> obj draw) #x200000 0) + (setup-masks (-> this draw) #x200000 0) ) ) ) (let ((v1-58 (min 1 s5-0))) (cond ((zero? v1-58) - (setup-masks (-> obj draw) 64 0) + (setup-masks (-> this draw) 64 0) ) ((= v1-58 1) - (setup-masks (-> obj draw) 8192 0) + (setup-masks (-> this draw) 8192 0) ) ) ) (if (not (logtest? s5-0 1)) - (setup-masks (-> obj draw) 256 0) + (setup-masks (-> this draw) 256 0) ) ) 0 @@ -583,33 +585,33 @@ ;; definition for method 31 of type stadium-racer ;; WARN: Return type mismatch int vs none. -(defmethod initialize-collision stadium-racer ((obj stadium-racer)) - (set! (-> obj level) (level-get *level* 'lracelit)) - (stack-size-set! (-> obj main-thread) 256) - (when (not (-> obj level)) +(defmethod initialize-collision stadium-racer ((this stadium-racer)) + (set! (-> this level) (level-get *level* 'lracelit)) + (stack-size-set! (-> this main-thread) 256) + (when (not (-> this level)) (format 0 "stadium-racer::initialize-collision: ERROR, no lracelit level~%") (go process-drawable-art-error "no lracelit level") ) - (set! (-> obj root) (the-as collide-shape (new 'process 'trsqv))) + (set! (-> this root) (the-as collide-shape (new 'process 'trsqv))) 0 (none) ) ;; definition for method 32 of type stadium-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-32 stadium-racer ((obj stadium-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-rider-method-32 stadium-racer ((this stadium-racer) (arg0 traffic-object-spawn-params)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stadium-racer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj flags) 1) - (set! (-> obj draw lod-set lod 0 dist) 286720.0) - (set! (-> obj rider-type) (-> arg0 user-data)) - (vehicle-rider-method-33 obj) - (if (logtest? (-> obj flags) 4) - (set! (-> obj riding-anim) 5) - (set! (-> obj riding-anim) 4) + (logior! (-> this flags) 1) + (set! (-> this draw lod-set lod 0 dist) 286720.0) + (set! (-> this rider-type) (-> arg0 user-data)) + (vehicle-rider-method-33 this) + (if (logtest? (-> this flags) 4) + (set! (-> this riding-anim) 5) + (set! (-> this riding-anim) 4) ) 0 (none) @@ -654,16 +656,16 @@ ) ;; definition for method 3 of type errol-rider -(defmethod inspect errol-rider ((obj errol-rider)) - (when (not obj) - (set! obj obj) +(defmethod inspect errol-rider ((this errol-rider)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type stadium-racer inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -686,15 +688,15 @@ ;; definition for method 33 of type errol-rider ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-rider-method-33 errol-rider ((obj errol-rider)) +(defmethod vehicle-rider-method-33 errol-rider ((this errol-rider)) (let ((t9-0 (method-of-type vehicle-rider vehicle-rider-method-33))) - (t9-0 obj) + (t9-0 this) ) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 2 0) - (setup-masks (-> obj draw) 4 0) - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 16 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 2 0) + (setup-masks (-> this draw) 4 0) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 16 0) 0 (none) ) @@ -716,25 +718,25 @@ ) ;; definition for method 3 of type turbo-pickup -(defmethod inspect turbo-pickup ((obj turbo-pickup)) - (when (not obj) - (set! obj obj) +(defmethod inspect turbo-pickup ((this turbo-pickup)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tavailable: ~A~%" (-> obj available)) + (format #t "~2Tavailable: ~A~%" (-> this available)) (label cfg-4) - obj + this ) ;; definition for method 22 of type turbo-pickup ;; INFO: Used lq/sq -(defmethod find-ground turbo-pickup ((obj turbo-pickup)) +(defmethod find-ground turbo-pickup ((this turbo-pickup)) (let ((s4-0 #f)) (let ((gp-0 (new 'stack-no-clear 'do-push-aways-work))) - (set! (-> gp-0 push-vel quad) (-> obj root trans quad)) + (set! (-> gp-0 push-vel quad) (-> this root trans quad)) (set! (-> gp-0 cquery start-pos quad) (-> gp-0 push-vel quad)) (vector-reset! (-> gp-0 vec33)) (set! (-> gp-0 vec33 y) 1.0) @@ -756,8 +758,8 @@ (format #t "turbo-pickup::find-ground: ground y ~M~%" (-> gp-0 push-vel y)) ) ) - (set! (-> obj root trans quad) (-> gp-0 push-vel quad)) - (forward-up-nopitch->quaternion (-> obj root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec33)) + (set! (-> this root trans quad) (-> gp-0 push-vel quad)) + (forward-up-nopitch->quaternion (-> this root quat) (new 'static 'vector :z 1.0 :w 1.0) (-> gp-0 vec33)) ) s4-0 ) @@ -789,7 +791,7 @@ (defstate die (turbo-pickup) :virtual #t :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 (let ((t9-1 (method-of-type part-tracker activate))) @@ -830,7 +832,7 @@ (set! (-> v1-11 prim-core collide-with) (collide-spec)) ) 0 - (until (>= (- (current-time) (-> self state-time)) (seconds 2)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc b/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc index 7003720ea2..7c6c863dfe 100644 --- a/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/race/vehicle-racer_REF.gc @@ -26,34 +26,34 @@ ) ;; definition for method 3 of type race-control -(defmethod inspect race-control ((obj race-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-control ((this race-control)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'race-control) - (format #t "~1Tstate: #~%" (-> obj state)) - (format #t "~1Tmesh: ~A~%" (-> obj mesh)) - (format #t "~1Tpath-select: ~D~%" (-> obj path-select)) - (format #t "~1Tpath-group: #~%" (-> obj path-group)) - (format #t "~1Tpath: #~%" (-> obj path)) - (format #t "~1Tpath-t: ~f~%" (-> obj path-t)) - (format #t "~1Tracer-state: #~%" (-> obj racer-state)) - (format #t "~1Tpath-sample: #~%" (-> obj path-sample)) - (format #t "~1Tlin-velocity: #~%" (-> obj lin-velocity)) - (format #t "~1Tang-velocity: #~%" (-> obj ang-velocity)) + (format #t "[~8x] ~A~%" this 'race-control) + (format #t "~1Tstate: #~%" (-> this state)) + (format #t "~1Tmesh: ~A~%" (-> this mesh)) + (format #t "~1Tpath-select: ~D~%" (-> this path-select)) + (format #t "~1Tpath-group: #~%" (-> this path-group)) + (format #t "~1Tpath: #~%" (-> this path)) + (format #t "~1Tpath-t: ~f~%" (-> this path-t)) + (format #t "~1Tracer-state: #~%" (-> this racer-state)) + (format #t "~1Tpath-sample: #~%" (-> this path-sample)) + (format #t "~1Tlin-velocity: #~%" (-> this lin-velocity)) + (format #t "~1Tang-velocity: #~%" (-> this ang-velocity)) (label cfg-4) - obj + this ) ;; definition for method 12 of type race-control ;; WARN: Return type mismatch int vs none. -(defmethod race-control-method-12 race-control ((obj race-control) (arg0 vector)) - (let* ((f0-0 (-> obj path-t)) - (f0-2 (race-path-method-12 (-> obj path) arg0 (+ -1.0 f0-0) (+ 1.0 f0-0))) +(defmethod race-control-method-12 race-control ((this race-control) (arg0 vector)) + (let* ((f0-0 (-> this path-t)) + (f0-2 (race-path-method-12 (-> this path) arg0 (+ -1.0 f0-0) (+ 1.0 f0-0))) ) - (set! (-> obj path-t) f0-2) - (race-path-method-11 (-> obj path) (-> obj path-sample) (-> obj lin-velocity) f0-2) + (set! (-> this path-t) f0-2) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-2) ) 0 (none) @@ -61,11 +61,11 @@ ;; definition for method 11 of type race-control ;; WARN: Return type mismatch int vs none. -(defmethod race-control-method-11 race-control ((obj race-control) (arg0 float)) - (let ((f0-1 (+ (-> obj path-t) (* 15.0 arg0)))) +(defmethod race-control-method-11 race-control ((this race-control) (arg0 float)) + (let ((f0-1 (+ (-> this path-t) (* 15.0 arg0)))) (set! f0-1 (cond - ((logtest? (-> obj mesh flags) (race-mesh-flags racemeshflag-0)) - (let ((f1-3 (the float (-> obj path sample-count)))) + ((logtest? (-> this mesh flags) (race-mesh-flags racemeshflag-0)) + (let ((f1-3 (the float (-> this path sample-count)))) (if (>= f0-1 f1-3) (set! f0-1 (- f0-1 f1-3)) ) @@ -73,14 +73,14 @@ f0-1 ) (else - (fmin f0-1 (the float (+ (-> obj path sample-count) -1))) + (fmin f0-1 (the float (+ (-> this path sample-count) -1))) ) ) ) - (set! (-> obj path-t) f0-1) - (race-path-method-11 (-> obj path) (-> obj path-sample) (-> obj lin-velocity) f0-1) + (set! (-> this path-t) f0-1) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-1) ) - (vector-reset! (-> obj ang-velocity)) + (vector-reset! (-> this ang-velocity)) 0 (none) ) @@ -88,22 +88,22 @@ ;; definition for method 9 of type race-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod race-control-method-9 race-control ((obj race-control) (arg0 int) (arg1 vector)) - (let ((v1-1 (-> obj path-group path-count))) +(defmethod race-control-method-9 race-control ((this race-control) (arg0 int) (arg1 vector)) + (let ((v1-1 (-> this path-group path-count))) (if (>= arg0 v1-1) (set! arg0 0) ) - (set! (-> obj path-select) arg0) + (set! (-> this path-select) arg0) (cond ((> v1-1 0) - (let ((s4-0 (-> obj path-group paths arg0))) - (set! (-> obj path) s4-0) + (let ((s4-0 (-> this path-group paths arg0))) + (set! (-> this path) s4-0) (let ((s3-0 (new 'stack-no-clear 'race-mesh-slice-query))) (set! (-> s3-0 search-sphere quad) (-> arg1 quad)) (set! (-> s3-0 search-sphere r) 61440.0) - (race-mesh-method-13 (-> obj mesh) (the-as race-mesh-slice-query (&-> s3-0 slice-id))) + (race-mesh-method-13 (-> this mesh) (the-as race-mesh-slice-query (&-> s3-0 slice-id))) (when (!= (-> s3-0 slice-id) -1) - (let* ((v1-12 (-> obj mesh slices (-> s3-0 slice-id))) + (let* ((v1-12 (-> this mesh slices (-> s3-0 slice-id))) (f0-1 (-> (the-as (pointer float) (+ (* (-> v1-12 start-edge) 4) (the-as int (-> s4-0 edge-infos)))))) (f1-0 (-> (the-as race-path-edge-info (+ (* (-> v1-12 end-edge) 4) (the-as int (-> s4-0 edge-infos)))) sample-t) @@ -111,8 +111,8 @@ ) (when (and (>= f0-1 0.0) (>= f1-0 0.0)) (let ((f0-2 (race-path-method-12 s4-0 arg1 f0-1 f1-0))) - (set! (-> obj path-t) f0-2) - (race-path-method-11 (-> obj path) (-> obj path-sample) (-> obj lin-velocity) f0-2) + (set! (-> this path-t) f0-2) + (race-path-method-11 (-> this path) (-> this path-sample) (-> this lin-velocity) f0-2) ) ) ) @@ -121,7 +121,7 @@ ) ) (else - (set! (-> obj path) #f) + (set! (-> this path) #f) ) ) ) @@ -131,13 +131,13 @@ ;; definition for method 10 of type race-control ;; WARN: Return type mismatch int vs none. -(defmethod race-control-method-10 race-control ((obj race-control) (arg0 race-state) (arg1 racer-state)) - (set! (-> obj state) arg0) - (set! (-> obj mesh) (-> arg0 info mesh)) - (if (-> obj mesh) - (set! (-> obj path-group) (-> obj mesh path-groups 0)) +(defmethod race-control-method-10 race-control ((this race-control) (arg0 race-state) (arg1 racer-state)) + (set! (-> this state) arg0) + (set! (-> this mesh) (-> arg0 info mesh)) + (if (-> this mesh) + (set! (-> this path-group) (-> this mesh path-groups 0)) ) - (set! (-> obj racer-state) arg1) + (set! (-> this racer-state) arg1) 0 (none) ) @@ -174,33 +174,33 @@ ) ;; definition for method 3 of type vehicle-racer -(defmethod inspect vehicle-racer ((obj vehicle-racer)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-racer ((this vehicle-racer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trace: #~%" (-> obj race)) - (format #t "~2Tai-controls: #~%" (-> obj ai-controls)) - (format #t "~2Trider-hand-joint: ~D~%" (-> obj rider-hand-joint)) - (format #t "~2Tturbo-pickup-count: ~D~%" (-> obj turbo-pickup-count)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) - (format #t "~2Tshortcut-speed-factor: ~f~%" (-> obj shortcut-speed-factor)) - (format #t "~2Tpath-deviation: ~f~%" (-> obj path-deviation)) - (format #t "~2Tshortcut-time: ~D~%" (-> obj shortcut-time)) + (format #t "~2Trace: #~%" (-> this race)) + (format #t "~2Tai-controls: #~%" (-> this ai-controls)) + (format #t "~2Trider-hand-joint: ~D~%" (-> this rider-hand-joint)) + (format #t "~2Tturbo-pickup-count: ~D~%" (-> this turbo-pickup-count)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tshortcut-speed-factor: ~f~%" (-> this shortcut-speed-factor)) + (format #t "~2Tpath-deviation: ~f~%" (-> this path-deviation)) + (format #t "~2Tshortcut-time: ~D~%" (-> this shortcut-time)) (label cfg-4) - obj + this ) ;; definition for method 117 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-117 vehicle-racer ((obj vehicle-racer) (arg0 vector) (arg1 int) (arg2 int)) +(defmethod vehicle-method-117 vehicle-racer ((this vehicle-racer) (arg0 vector) (arg1 int) (arg2 int)) (vector-matrix*! arg0 - (-> obj info rider-hand-offset arg2) - (-> obj node-list data (-> obj rider-hand-joint) bone transform) + (-> this info rider-hand-offset arg2) + (-> this node-list data (-> this rider-hand-joint) bone transform) ) 0 (none) @@ -208,12 +208,12 @@ ;; definition for method 137 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-137 vehicle-racer ((obj vehicle-racer) (arg0 traffic-object-spawn-params)) +(defmethod vehicle-method-137 vehicle-racer ((this vehicle-racer) (arg0 traffic-object-spawn-params)) (let ((t9-0 vehicle-rider-spawn) (v1-0 (-> arg0 user-data)) ) (t9-0 - obj + this (if (= v1-0 2) errol-rider stadium-racer @@ -228,7 +228,7 @@ ;; definition for method 148 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch number vs none. -(defmethod vehicle-racer-method-148 vehicle-racer ((obj vehicle-racer) (arg0 race-path) (arg1 race-mesh-slice)) +(defmethod vehicle-racer-method-148 vehicle-racer ((this vehicle-racer) (arg0 race-path) (arg1 race-mesh-slice)) (let ((f26-0 (the-as number 0.0)) (gp-0 (new 'stack-no-clear 'vehicle-physics-work)) (f30-0 (-> (the-as (pointer float) (+ (* (-> arg1 start-edge) 4) (the-as int (-> arg0 edge-infos)))))) @@ -236,9 +236,9 @@ ) (when (and (>= f30-0 0.0) (>= f28-0 0.0)) (let ((f26-1 1.0)) - (set! (-> gp-0 mat trans quad) (-> obj root trans quad)) - (set! (-> gp-0 velocity quad) (-> obj root transv quad)) - (quaternion-copy! (the-as quaternion (-> gp-0 force)) (-> obj root quat)) + (set! (-> gp-0 mat trans quad) (-> this root trans quad)) + (set! (-> gp-0 velocity quad) (-> this root transv quad)) + (quaternion-copy! (the-as quaternion (-> gp-0 force)) (-> this root quat)) (let* ((f0-2 (race-path-method-12 arg0 (-> gp-0 mat trans) f30-0 f28-0)) (a0-4 arg0) (t9-2 (method-of-type race-path race-path-method-11)) @@ -292,23 +292,23 @@ ;; definition for method 120 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-120 vehicle-racer ((obj vehicle-racer)) - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> *game-info* race-number-turbos) (-> obj turbo-pickup-count)) +(defmethod vehicle-method-120 vehicle-racer ((this vehicle-racer)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (set! (-> *game-info* race-number-turbos) (-> this turbo-pickup-count)) 0 ) - (logior! (-> obj skel status) (joint-control-status sync-math)) + (logior! (-> this skel status) (joint-control-status sync-math)) (let ((t9-0 (method-of-type vehicle vehicle-method-120))) - (t9-0 obj) + (t9-0 this) ) - (let ((v1-10 (-> obj root trans-old-old quad))) - (set! (-> obj root trans-old-old-old quad) v1-10) + (let ((v1-10 (-> this root trans-old-old quad))) + (set! (-> this root trans-old-old-old quad) v1-10) ) - (let ((v1-12 (-> obj root trans-old quad))) - (set! (-> obj root trans-old-old quad) v1-12) + (let ((v1-12 (-> this root trans-old quad))) + (set! (-> this root trans-old-old quad) v1-12) ) - (let ((v1-14 (-> obj root trans quad))) - (set! (-> obj root trans-old quad) v1-14) + (let ((v1-14 (-> this root trans quad))) + (set! (-> this root trans-old quad) v1-14) ) 0 (none) @@ -316,14 +316,14 @@ ;; definition for method 66 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-66 vehicle-racer ((obj vehicle-racer)) - (when (and (not (logtest? (rigid-body-object-flag turbo-boost) (-> obj flags))) (> (-> obj turbo-pickup-count) 0)) - (+! (-> obj turbo-pickup-count) -1) - (set! (-> obj turbo-boost-time) (current-time)) - (set! (-> obj turbo-boost-factor) 1.0) - (set! (-> obj turbo-boost-duration) (the-as uint 150)) - (logior! (-> obj flags) (rigid-body-object-flag turbo-boost)) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) +(defmethod vehicle-method-66 vehicle-racer ((this vehicle-racer)) + (when (and (not (logtest? (rigid-body-object-flag turbo-boost) (-> this flags))) (> (-> this turbo-pickup-count) 0)) + (+! (-> this turbo-pickup-count) -1) + (set-time! (-> this turbo-boost-time)) + (set! (-> this turbo-boost-factor) 1.0) + (set! (-> this turbo-boost-duration) (the-as uint 150)) + (logior! (-> this flags) (rigid-body-object-flag turbo-boost)) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (sound-play "turbo-boost") ) ) @@ -333,46 +333,46 @@ ;; definition for method 136 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-136 vehicle-racer ((obj vehicle-racer) (arg0 traffic-object-spawn-params)) - (set! (-> obj draw lod-set lod 1 dist) 819200.0) - (set! (-> obj draw lod-set lod 2 dist) 1228800.0) +(defmethod vehicle-method-136 vehicle-racer ((this vehicle-racer) (arg0 traffic-object-spawn-params)) + (set! (-> this draw lod-set lod 1 dist) 819200.0) + (set! (-> this draw lod-set lod 2 dist) 1228800.0) (let* ((a1-1 *race-state*) (a2-0 (-> a1-1 racer-array (-> arg0 id))) ) - (race-control-method-10 (-> obj race) a1-1 a2-0) + (race-control-method-10 (-> this race) a1-1 a2-0) ) - (set! (-> obj shortcut-speed-factor) 0.0) + (set! (-> this shortcut-speed-factor) 0.0) (case (-> arg0 behavior) ((10) - (when (not (-> obj race mesh)) + (when (not (-> this race mesh)) (format #t "ERROR: vehicle-racer::go-start-state: no race-mesh found~%") - (go (method-of-object obj die)) + (go (method-of-object this die)) ) - (when (-> obj race mesh) - (race-control-method-9 (-> obj race) (-> obj traffic-priority-id) (-> obj root trans)) + (when (-> this race mesh) + (race-control-method-9 (-> this race) (-> this traffic-priority-id) (-> this root trans)) (cond ((logtest? (-> arg0 flags) (traffic-spawn-flags trsflags-01)) - (logior! (-> obj flags) (rigid-body-object-flag riding ai-driving)) + (logior! (-> this flags) (rigid-body-object-flag riding ai-driving)) (cond - ((-> obj race path) - (go (method-of-object obj waiting-for-start)) + ((-> this race path) + (go (method-of-object this waiting-for-start)) ) (else (format 0 "vehicle-racer::go-start-state: ERROR, no race-paths found~%") - (go (method-of-object obj die)) + (go (method-of-object this die)) ) ) ) (else - (logior! (-> obj flags) (rigid-body-object-flag waiting-for-player)) - (logior! (-> obj focus-status) (focus-status grabbed)) - (go (method-of-object obj waiting-race)) + (logior! (-> this flags) (rigid-body-object-flag waiting-for-player)) + (logior! (-> this focus-status) (focus-status grabbed)) + (go (method-of-object this waiting-race)) ) ) ) ) (else - ((method-of-type vehicle vehicle-method-136) obj arg0) + ((method-of-type vehicle vehicle-method-136) this arg0) ) ) 0 @@ -381,10 +381,10 @@ ;; definition for method 138 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-138 vehicle-racer ((obj vehicle-racer)) - (if (focus-test? obj grabbed) - (go (method-of-object obj waiting-for-start)) - (go (method-of-object obj player-control)) +(defmethod vehicle-method-138 vehicle-racer ((this vehicle-racer)) + (if (focus-test? this grabbed) + (go (method-of-object this waiting-for-start)) + (go (method-of-object this player-control)) ) 0 (none) @@ -392,23 +392,23 @@ ;; definition for method 45 of type vehicle-racer ;; WARN: Return type mismatch symbol vs none. -(defmethod rigid-body-object-method-45 vehicle-racer ((obj vehicle-racer) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 vehicle-racer ((this vehicle-racer) (arg0 rigid-body-impact)) (let ((t9-0 (method-of-type vehicle rigid-body-object-method-45))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (when (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (when (and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (< 40960.0 (-> arg0 impulse)) - (< 0.0 (-> obj hit-points)) + (< 0.0 (-> this hit-points)) ) (cond ((-> arg0 rbody) - (dotimes (s4-0 (-> obj info seat-count)) - (send-event (handle->process (-> obj rider-array s4-0)) 'vehicle-got-hit arg0) + (dotimes (s4-0 (-> this info seat-count)) + (send-event (handle->process (-> this rider-array s4-0)) 'vehicle-got-hit arg0) ) ) (else - (dotimes (s4-1 (-> obj info seat-count)) - (send-event (handle->process (-> obj rider-array s4-1)) 'vehicle-hit arg0) + (dotimes (s4-1 (-> this info seat-count)) + (send-event (handle->process (-> this rider-array s4-1)) 'vehicle-hit arg0) ) ) ) @@ -418,42 +418,42 @@ ;; definition for method 46 of type vehicle-racer ;; WARN: disable def twice: 12. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod rigid-body-object-method-46 vehicle-racer ((obj vehicle-racer) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 vehicle-racer ((this vehicle-racer) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('test-ready) - (and (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) - (logtest? (-> obj flags) (rigid-body-object-flag riding)) + (and (and (-> this next-state) (= (-> this next-state name) 'waiting-for-start)) + (logtest? (-> this flags) (rigid-body-object-flag riding)) ) ) (('begin-race) - (logclear! (-> obj focus-status) (focus-status grabbed)) - (when (and (-> obj next-state) (= (-> obj next-state name) 'waiting-for-start)) + (logclear! (-> this focus-status) (focus-status grabbed)) + (when (and (-> this next-state) (= (-> this next-state name) 'waiting-for-start)) (cond - ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logclear (-> obj flags) (rigid-body-object-flag player-grabbed))) + ((logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logclear (-> this flags) (rigid-body-object-flag player-grabbed))) ) - (go (method-of-object obj player-control)) + (go (method-of-object this player-control)) ) (else - (go (method-of-object obj racing)) + (go (method-of-object this racing)) ) ) ) ) (('turbo-pickup) - (when (< (-> obj turbo-pickup-count) 3) + (when (< (-> this turbo-pickup-count) 3) (sound-play "turbo-pickup") - (when (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) + (when (logtest? (-> this flags) (rigid-body-object-flag player-driving)) (sound-play "turbo-pickup-pl") (send-event *target* 'color-effect 'eco-pill-dark (seconds 0.2)) ) - (+! (-> obj turbo-pickup-count) 1) + (+! (-> this turbo-pickup-count) 1) #t ) ) (('race-decision-point) - (when (logtest? (rigid-body-object-flag ai-driving) (-> obj flags)) + (when (logtest? (rigid-body-object-flag ai-driving) (-> this flags)) (let* ((v1-37 (the-as race-decision-point (-> arg3 param 0))) (a0-16 (-> v1-37 decision-type)) ) @@ -461,29 +461,29 @@ ((zero? a0-16) (cond ((and (nonzero? (-> v1-37 shortcuts)) - (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) - (< 0.1 (- (+ (-> obj race state target-pos) (-> obj race racer-state target-pos-offset)) - (-> obj race racer-state pos) + (>= (-> this race racer-state speed-factor) (-> this race state info ai-max-speed-factor)) + (< 0.1 (- (+ (-> this race state target-pos) (-> this race racer-state target-pos-offset)) + (-> this race racer-state pos) ) ) ) - (select-path-randomly-from-mask obj (-> v1-37 shortcuts)) - (set! (-> obj shortcut-time) (current-time)) - (set! (-> obj shortcut-speed-factor) 1.0) + (select-path-randomly-from-mask this (-> v1-37 shortcuts)) + (set-time! (-> this shortcut-time)) + (set! (-> this shortcut-speed-factor) 1.0) ) (else - (select-path-randomly-from-mask obj (-> v1-37 safe-paths)) - (set! (-> obj shortcut-speed-factor) 0.0) + (select-path-randomly-from-mask this (-> v1-37 safe-paths)) + (set! (-> this shortcut-speed-factor) 0.0) ) ) ) ((= a0-16 1) - (when (and (> (-> obj turbo-pickup-count) 0) - (< (-> obj path-deviation) 1.0) - (>= (-> obj race racer-state speed-factor) (-> obj race state info ai-max-speed-factor)) + (when (and (> (-> this turbo-pickup-count) 0) + (< (-> this path-deviation) 1.0) + (>= (-> this race racer-state speed-factor) (-> this race state info ai-max-speed-factor)) ) - (rigid-body-object-method-38 obj) - (vehicle-method-66 obj) + (rigid-body-object-method-38 this) + (vehicle-method-66 this) ) ) ) @@ -491,57 +491,57 @@ ) ) (('hide) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (send-event (ppointer->process (-> obj child)) 'hide) + (logior! (-> this draw status) (draw-control-status no-draw)) + (send-event (ppointer->process (-> this child)) 'hide) ) (('unhide) - (logclear! (-> obj draw status) (draw-control-status no-draw)) - (send-event (ppointer->process (-> obj child)) 'unhide) + (logclear! (-> this draw status) (draw-control-status no-draw)) + (send-event (ppointer->process (-> this child)) 'unhide) ) (('race-pass) - (if (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (speech-control-method-12 *speech-control* obj (if (-> *target* pilot as-daxter?) - (speech-type speech-type-45) - (speech-type speech-type-36) - ) + (if (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (speech-control-method-12 *speech-control* this (if (-> *target* pilot as-daxter?) + (speech-type speech-type-45) + (speech-type speech-type-36) + ) ) - (send-event (ppointer->process (-> obj child)) 'race-pass) + (send-event (ppointer->process (-> this child)) 'race-pass) ) ) (('race-got-passed) - (if (not (logtest? (-> obj flags) (rigid-body-object-flag player-driving))) - (send-event (ppointer->process (-> obj child)) 'race-got-passed) + (if (not (logtest? (-> this flags) (rigid-body-object-flag player-driving))) + (send-event (ppointer->process (-> this child)) 'race-got-passed) ) ) (('race-finished) (let ((s5-2 (-> arg3 param 0))) - (select-path-randomly-from-mask obj s5-2) - (set! (-> obj damage-factor) 0.0) + (select-path-randomly-from-mask this s5-2) + (set! (-> this damage-factor) 0.0) (cond - ((logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (set! (-> obj flags) - (the-as rigid-body-object-flag (logior (rigid-body-object-flag player-grabbed) (-> obj flags))) + ((logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (set! (-> this flags) + (the-as rigid-body-object-flag (logior (rigid-body-object-flag player-grabbed) (-> this flags))) ) (when (zero? s5-2) - (set! (-> obj race path) #f) + (set! (-> this race path) #f) #f ) ) (else - (go (method-of-object obj race-finished)) + (go (method-of-object this race-finished)) ) ) ) ) (else - ((method-of-type vehicle rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) + ((method-of-type vehicle rigid-body-object-method-46) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 150 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod select-path-randomly-from-mask vehicle-racer ((obj vehicle-racer) (arg0 uint)) +(defmethod select-path-randomly-from-mask vehicle-racer ((this vehicle-racer) (arg0 uint)) (let ((a0-1 0) (v1-0 0) (s5-0 (new 'stack-no-clear 'array 'int8 12)) @@ -557,7 +557,7 @@ (when (> a0-1 0) (let ((s5-1 (-> s5-0 (rand-vu-int-count a0-1)))) (format #t "vehicle-racer::select-path-randomly-from-mask: switching to path-~d~%" s5-1) - (race-control-method-9 (-> obj race) s5-1 (-> obj root trans)) + (race-control-method-9 (-> this race) s5-1 (-> this root trans)) ) ) ) @@ -568,7 +568,7 @@ ;; definition for method 151 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-racer-method-151 vehicle-racer ((obj vehicle-racer)) +(defmethod vehicle-racer-method-151 vehicle-racer ((this vehicle-racer)) (local-vars (v1-18 float) (v1-28 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -580,10 +580,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (-> obj race))) + (let ((s5-0 (-> this race))) (when (nonzero? s5-0) (race-control-method-11 s5-0 0.0) - (let ((s4-0 (-> obj rbody)) + (let ((s4-0 (-> this rbody)) (f30-0 (seconds-per-frame)) ) 1.0 @@ -612,7 +612,7 @@ (f1-5 1.0) (f2-2 40960.0) ) - (set! (-> obj path-deviation) (* f0-6 (/ f1-5 (* f2-2 f2-2)))) + (set! (-> this path-deviation) (* f0-6 (/ f1-5 (* f2-2 f2-2)))) ) (let ((a1-4 (-> s3-0 0 vector 2))) (let ((v1-22 (-> s3-0 0 vector 2))) @@ -681,18 +681,18 @@ (the-as quaternion (-> s3-0 1)) (* 10.0 f30-0) ) - (vector-float*! (-> s4-0 state lin-momentum) (-> s4-0 state lin-velocity) (-> obj info info mass)) + (vector-float*! (-> s4-0 state lin-momentum) (-> s4-0 state lin-velocity) (-> this info info mass)) (vector-reset! (-> s4-0 state ang-momentum)) (rigid-body-method-24 (-> s4-0 state)) (rigid-body-method-13 (-> s4-0 state)) - (set! (-> obj root transv quad) (-> s4-0 state lin-velocity quad)) - (quaternion-copy! (-> obj root quat) (-> s4-0 state rotation)) + (set! (-> this root transv quad) (-> s4-0 state lin-velocity quad)) + (quaternion-copy! (-> this root quat) (-> s4-0 state rotation)) (let ((v1-46 s4-0) - (a1-14 (-> obj root trans)) + (a1-14 (-> this root trans)) ) (rigid-body-method-23 (-> v1-46 state) a1-14) ) - (let* ((v1-51 (-> obj node-list data 0 bone transform)) + (let* ((v1-51 (-> this node-list data 0 bone transform)) (a3-1 (-> s4-0 state matrix)) (a0-20 (-> a3-1 quad 0)) (a1-15 (-> a3-1 quad 1)) @@ -704,20 +704,20 @@ (set! (-> v1-51 quad 2) a2-5) (set! (-> v1-51 trans quad) a3-2) ) - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) (race-control-method-11 s5-0 (* f30-0 f28-0)) ) ) ) ) - (vehicle-method-119 obj) - (vehicle-method-120 obj) - (update-transforms (-> obj root)) + (vehicle-method-119 this) + (vehicle-method-120 this) + (update-transforms (-> this root)) (let ((a1-17 (new 'stack-no-clear 'overlaps-others-params))) (set! (-> a1-17 options) (overlaps-others-options)) (set! (-> a1-17 collide-with-filter) (collide-spec civilian enemy obstacle)) (set! (-> a1-17 tlist) *touching-list*) - (find-overlapping-shapes (-> obj root) a1-17) + (find-overlapping-shapes (-> this root) a1-17) ) 0 (none) @@ -727,7 +727,7 @@ ;; definition for method 153 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod physics-post vehicle-racer ((obj vehicle-racer)) +(defmethod physics-post vehicle-racer ((this vehicle-racer)) (local-vars (v1-35 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -739,26 +739,26 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (-> obj race))) + (let ((s5-0 (-> this race))) (let ((s4-0 (new 'stack-no-clear 'inline-array 'matrix 9))) - (set! (-> s4-0 0 quad 0) (-> obj rbody state position quad)) - (set! (-> s4-0 0 vector 1 quad) (-> obj rbody state lin-velocity quad)) + (set! (-> s4-0 0 quad 0) (-> this rbody state position quad)) + (set! (-> s4-0 0 vector 1 quad) (-> this rbody state lin-velocity quad)) (set! (-> s4-0 3 vector 1 y) 0.0) - (set! (-> s4-0 1 vector 1 quad) (-> obj rbody state matrix quad 0)) + (set! (-> s4-0 1 vector 1 quad) (-> this rbody state matrix quad 0)) (set! (-> s4-0 1 vector 1 y) 0.0) (vector-normalize! (-> s4-0 1 vector 1) 1.0) - (set! (-> s4-0 1 vector 2 quad) (-> obj rbody state matrix vector 2 quad)) + (set! (-> s4-0 1 vector 2 quad) (-> this rbody state matrix vector 2 quad)) (set! (-> s4-0 3 vector 0 x) - (* (-> obj rbody state ang-velocity y) (vector-length (-> obj rbody state lin-velocity))) + (* (-> this rbody state ang-velocity y) (vector-length (-> this rbody state lin-velocity))) ) (set! (-> s4-0 3 vector 1 x) (seconds-per-frame)) (race-control-method-12 s5-0 (the-as vector (-> s4-0 0))) (set! (-> s4-0 3 vector 0 y) (vector-length (-> s4-0 0 vector 1))) (set! (-> s4-0 3 vector 0 z) (vector-length (-> s5-0 lin-velocity))) (set! (-> s4-0 3 vector 0 w) - (* (-> s4-0 3 vector 0 z) (fmax (-> s5-0 racer-state speed-factor) (-> obj shortcut-speed-factor))) + (* (-> s4-0 3 vector 0 z) (fmax (-> s5-0 racer-state speed-factor) (-> this shortcut-speed-factor))) ) - (if (logtest? (rigid-body-object-flag in-air turbo-boost) (-> obj flags)) + (if (logtest? (rigid-body-object-flag in-air turbo-boost) (-> this flags)) (set! (-> s4-0 3 vector 0 w) (* 2.0 (-> s4-0 3 vector 0 w))) ) (let ((v1-21 (-> s5-0 path-sample))) @@ -799,7 +799,7 @@ ) ) ) - (set! (-> obj path-deviation) (-> s4-0 3 vector 1 y)) + (set! (-> this path-deviation) (-> s4-0 3 vector 1 y)) (let ((a1-6 (-> s4-0 0 vector 2))) (let ((v1-39 (-> s4-0 2 trans))) (let ((a0-25 (-> s4-0 0 trans))) @@ -818,13 +818,13 @@ (vector-! (the-as vector (-> s4-0 1)) (-> s4-0 0 vector 2) (-> s4-0 0 vector 1)) (vector-float*! (-> s4-0 1 trans) (the-as vector (-> s4-0 1)) 1.5) (let ((f1-22 (* 0.00036621094 (- (-> s4-0 3 vector 0 w) (-> s4-0 3 vector 0 y)) (-> s4-0 3 vector 1 x)))) - (set! (-> obj ai-controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> obj ai-controls throttle) f1-22)))) + (set! (-> this ai-controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> this ai-controls throttle) f1-22)))) ) - (set! (-> obj ai-controls brake) + (set! (-> this ai-controls brake) (fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ (- -4096.0 (-> s4-0 3 vector 0 w)) (-> s4-0 3 vector 0 y))))) ) - (+! (-> obj ai-controls brake) (* (- (-> obj ai-controls brake)) (fmin 1.0 (* 8.0 (-> s4-0 3 vector 1 x))))) - (set! (-> obj ai-controls steering) + (+! (-> this ai-controls brake) (* (- (-> this ai-controls brake)) (fmin 1.0 (* 8.0 (-> s4-0 3 vector 1 x))))) + (set! (-> this ai-controls steering) (fmax -1.0 (fmin 1.0 (* 0.000000000048894434 (+ 40960.0 (-> s4-0 3 vector 0 y)) (vector-dot (-> s4-0 1 vector 1) (-> s4-0 1 trans)) @@ -834,27 +834,27 @@ ) (set! (-> s4-0 3 vector 1 y) (fmin 1.0 (-> s4-0 3 vector 1 y))) (set! (-> s4-0 2 vector 0 x) (+ (* (-> s4-0 2 vector 0 x) (- 1.0 (-> s4-0 3 vector 1 y))) - (* (-> obj ai-controls steering) (-> s4-0 3 vector 1 y)) + (* (-> this ai-controls steering) (-> s4-0 3 vector 1 y)) ) ) - (set! (-> s4-0 2 vector 0 y) (-> obj ai-controls throttle)) - (set! (-> s4-0 2 vector 0 z) (-> obj ai-controls brake)) - (vehicle-method-95 obj (the-as vector (-> s4-0 2))) + (set! (-> s4-0 2 vector 0 y) (-> this ai-controls throttle)) + (set! (-> s4-0 2 vector 0 z) (-> this ai-controls brake)) + (vehicle-method-95 this (the-as vector (-> s4-0 2))) ) (when (logtest? (-> s5-0 path-sample flags) 2) - (start-jump obj) + (start-jump this) 0 ) ) - (vehicle-method-121 obj) - (when (< (-> obj rbody state position y) -409600.0) + (vehicle-method-121 this) + (when (< (-> this rbody state position y) -409600.0) (format #t "vehicle-racer::physics-post: pid ~d fell to death from path-id ~d~%" - (-> obj pid) - (-> obj race path record-id) + (-> this pid) + (-> this race path record-id) ) - (go (method-of-object obj explode)) + (go (method-of-object this explode)) ) 0 (none) @@ -863,38 +863,38 @@ ;; definition for method 154 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-racer-method-154 vehicle-racer ((obj vehicle-racer)) +(defmethod vehicle-racer-method-154 vehicle-racer ((this vehicle-racer)) (cond - ((logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (if (and (logtest? (-> obj flags) (rigid-body-object-flag on-ground)) - (not (logtest? (rigid-body-object-flag turbo-boost) (-> obj flags))) + ((logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (if (and (logtest? (-> this flags) (rigid-body-object-flag on-ground)) + (not (logtest? (rigid-body-object-flag turbo-boost) (-> this flags))) (let ((f0-0 368640.0)) - (or (< (* f0-0 f0-0) (-> obj player-dist2)) + (or (< (* f0-0 f0-0) (-> this player-dist2)) (let ((f0-3 102400.0)) - (and (< (* f0-3 f0-3) (-> obj player-dist2)) - (not (logtest? (-> obj draw status) (draw-control-status on-screen))) + (and (< (* f0-3 f0-3) (-> this player-dist2)) + (not (logtest? (-> this draw status) (draw-control-status on-screen))) ) ) ) ) ) - (rigid-body-object-method-39 obj) + (rigid-body-object-method-39 this) ) ) (else - (let ((f0-6 (-> obj player-dist2)) + (let ((f0-6 (-> this player-dist2)) (f1-2 348160.0) ) - (if (and (< f0-6 (* f1-2 f1-2)) (let ((f0-7 (-> obj player-dist2)) + (if (and (< f0-6 (* f1-2 f1-2)) (let ((f0-7 (-> this player-dist2)) (f1-5 81920.0) ) (or (< f0-7 (* f1-5 f1-5)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) - (logtest? (rigid-body-object-flag turbo-boost) (-> obj flags)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (logtest? (rigid-body-object-flag turbo-boost) (-> this flags)) ) ) ) - (rigid-body-object-method-38 obj) + (rigid-body-object-method-38 this) ) ) ) @@ -906,19 +906,19 @@ ;; definition for method 152 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-racer-method-152 vehicle-racer ((obj vehicle-racer)) +(defmethod vehicle-racer-method-152 vehicle-racer ((this vehicle-racer)) (let ((s5-0 (new 'stack-no-clear 'matrix3))) - (set! (-> s5-0 vector 0 quad) (-> obj rbody state position quad)) - (set! (-> obj camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (target-pos 0))) + (set! (-> s5-0 vector 0 quad) (-> this rbody state position quad)) + (set! (-> this camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (target-pos 0))) ) - (if (>= (- (current-time) (-> obj shortcut-time)) (seconds 5)) - (set! (-> obj shortcut-speed-factor) 0.0) + (if (time-elapsed? (-> this shortcut-time) (seconds 5)) + (set! (-> this shortcut-speed-factor) 0.0) ) - (vehicle-racer-method-154 obj) - (if (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (physics-post obj) - (vehicle-racer-method-151 obj) + (vehicle-racer-method-154 this) + (if (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (physics-post this) + (vehicle-racer-method-151 this) ) 0 (none) @@ -927,22 +927,22 @@ ;; definition for method 155 of type vehicle-racer ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-racer-method-155 vehicle-racer ((obj vehicle-racer)) +(defmethod vehicle-racer-method-155 vehicle-racer ((this vehicle-racer)) (let ((s5-0 (new 'stack-no-clear 'matrix3))) - (set! (-> s5-0 vector 0 quad) (-> obj rbody state position quad)) - (set! (-> obj camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) - (set! (-> obj player-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (target-pos 0))) + (set! (-> s5-0 vector 0 quad) (-> this rbody state position quad)) + (set! (-> this camera-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (camera-pos))) + (set! (-> this player-dist2) (vector-vector-distance-squared (the-as vector (-> s5-0 vector)) (target-pos 0))) ) - (set! (-> obj shortcut-speed-factor) 0.0) - (vehicle-racer-method-154 obj) - (if (and (logtest? (-> obj flags) (rigid-body-object-flag player-driving)) - (not (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics))) + (set! (-> this shortcut-speed-factor) 0.0) + (vehicle-racer-method-154 this) + (if (and (logtest? (-> this flags) (rigid-body-object-flag player-driving)) + (not (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics))) ) - (rigid-body-object-method-38 obj) + (rigid-body-object-method-38 this) ) - (if (logtest? (-> obj rbody state flags) (rigid-body-flag enable-physics)) - (physics-post obj) - (vehicle-racer-method-151 obj) + (if (logtest? (-> this rbody state flags) (rigid-body-flag enable-physics)) + (physics-post this) + (vehicle-racer-method-151 this) ) 0 (none) @@ -950,17 +950,17 @@ ;; definition for method 124 of type vehicle-racer ;; WARN: Return type mismatch int vs none. -(defmethod vehicle-method-124 vehicle-racer ((obj vehicle-racer)) +(defmethod vehicle-method-124 vehicle-racer ((this vehicle-racer)) (cond - ((and (logtest? (rigid-body-object-flag player-grabbed) (-> obj flags)) (-> obj race path)) - (vehicle-racer-method-155 obj) + ((and (logtest? (rigid-body-object-flag player-grabbed) (-> this flags)) (-> this race path)) + (vehicle-racer-method-155 this) ) (else - (vehicle-method-94 obj) - (vehicle-method-121 obj) + (vehicle-method-94 this) + (vehicle-method-121 this) ) ) - (vehicle-method-97 obj) + (vehicle-method-97 this) 0 (none) ) @@ -970,7 +970,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self flags) (rigid-body-object-flag ignition)) (set! (-> self controls throttle) 0.0) (set! (-> self controls brake) 0.0) @@ -1029,7 +1029,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self damage-factor) (-> self info damage-factor)) (vehicle-method-143 self) (logior! (-> self flags) (rigid-body-object-flag ignition)) @@ -1054,7 +1054,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self flags) (rigid-body-object-flag riding ignition)) (set! (-> self controls throttle) 0.0) (set! (-> self controls brake) 0.0) @@ -1093,7 +1093,7 @@ :virtual #t :event vehicle-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self flags) (the-as rigid-body-object-flag (logior (rigid-body-object-flag persistent riding nav-spheres) (-> self flags)) 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 e16d0e0a95..8bdb52ad43 100644 --- a/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/scene-actor_REF.gc @@ -311,42 +311,42 @@ ) ;; definition for method 3 of type kor-npc -(defmethod inspect kor-npc ((obj kor-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect kor-npc ((this kor-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 35 of type kor-npc -(defmethod get-art-elem kor-npc ((obj kor-npc)) +(defmethod get-art-elem kor-npc ((this kor-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor kor-hideout)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (else - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) ;; definition for method 33 of type kor-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! kor-npc ((obj kor-npc)) +(defmethod init-art! kor-npc ((this kor-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-kor-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) @@ -364,16 +364,16 @@ ) ;; definition for method 3 of type metalkor-highres -(defmethod inspect metalkor-highres ((obj metalkor-highres)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-highres ((this metalkor-highres)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -394,30 +394,30 @@ ;; definition for method 11 of type metalkor-highres ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! metalkor-highres ((obj metalkor-highres) (arg0 entity-actor)) +(defmethod init-from-entity! metalkor-highres ((this metalkor-highres) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-metalkor-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) (let ((s4-1 (process-spawn manipy :init manipy-init - (-> obj root trans) - (-> obj entity) + (-> this root trans) + (-> this entity) (art-group-get-by-name *level* "skel-metalkor-highres-lowtorso" (the-as (pointer uint32) #f)) #f 0 - :to obj + :to this ) ) ) @@ -427,12 +427,12 @@ This commonly includes things such as: (let ((s4-3 (process-spawn manipy :init manipy-init - (-> obj root trans) - (-> obj entity) + (-> this root trans) + (-> this entity) (art-group-get-by-name *level* "skel-metalkor-highres-legs" (the-as (pointer uint32) #f)) #f 0 - :to obj + :to this ) ) ) @@ -442,19 +442,19 @@ This commonly includes things such as: (let ((s4-5 (process-spawn manipy :init manipy-init - (-> obj root trans) - (-> obj entity) + (-> this root trans) + (-> this entity) (art-group-get-by-name *level* "skel-metalkor-highres-wings" (the-as (pointer uint32) #f)) #f 0 - :to obj + :to this ) ) ) (send-event (ppointer->process s4-5) 'anim-mode 'clone-anim) (send-event (ppointer->process s4-5) 'prefix "wings-") ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -468,27 +468,27 @@ This commonly includes things such as: ) ;; definition for method 3 of type tess-npc -(defmethod inspect tess-npc ((obj tess-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect tess-npc ((this tess-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 35 of type tess-npc -(defmethod get-art-elem tess-npc ((obj tess-npc)) +(defmethod get-art-elem tess-npc ((this tess-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor tess-alley)) (if (task-node-closed? (game-task-node ruins-tower-resolution)) - (-> obj draw art-group data 3) - (-> obj draw art-group data 4) + (-> this draw art-group data 3) + (-> this draw art-group data 4) ) ) (((game-task-actor tess-hiphog)) @@ -500,34 +500,34 @@ This commonly includes things such as: (task-node-open? (game-task-node city-errol-challenge-introduction)) (task-node-open? (game-task-node city-errol-challenge-race)) ) - (-> obj draw art-group data 6) + (-> this draw art-group data 6) ) ((and (task-node-closed? (game-task-node city-whack-pre-intro)) (not (task-node-closed? (game-task-node under-mech-resolution))) ) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 33 of type tess-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! tess-npc ((obj tess-npc)) +(defmethod init-art! tess-npc ((this tess-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tess-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) @@ -542,45 +542,42 @@ This commonly includes things such as: ) ;; definition for method 3 of type keira-npc -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect keira-npc ((obj keira-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect keira-npc ((this keira-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 35 of type keira-npc -;; INFO: this function exists in multiple non-identical object files -(defmethod get-art-elem keira-npc ((obj keira-npc)) +(defmethod get-art-elem keira-npc ((this keira-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor keira-stadium)) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 33 of type keira-npc -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch int vs none. -(defmethod init-art! keira-npc ((obj keira-npc)) +(defmethod init-art! keira-npc ((this keira-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-keira-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) @@ -595,35 +592,35 @@ This commonly includes things such as: ) ;; definition for method 3 of type krew-npc -(defmethod inspect krew-npc ((obj krew-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect krew-npc ((this krew-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 35 of type krew-npc -(defmethod get-art-elem krew-npc ((obj krew-npc)) +(defmethod get-art-elem krew-npc ((this krew-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ;; definition for method 33 of type krew-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! krew-npc ((obj krew-npc)) +(defmethod init-art! krew-npc ((this krew-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-krew-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) @@ -638,48 +635,48 @@ This commonly includes things such as: ) ;; definition for method 3 of type kid-npc -(defmethod inspect kid-npc ((obj kid-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect kid-npc ((this kid-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type kid-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! kid-npc ((obj kid-npc)) +(defmethod init-art! kid-npc ((this kid-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-kid-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) ;; definition for method 35 of type kid-npc -(defmethod get-art-elem kid-npc ((obj kid-npc)) +(defmethod get-art-elem kid-npc ((this kid-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor kid-alley)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (((game-task-actor kid-tomb) (game-task-actor kid-vinroom)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (((game-task-actor kid-hideout)) - (-> obj draw art-group data 6) + (-> this draw art-group data 6) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) @@ -694,45 +691,45 @@ This commonly includes things such as: ) ;; definition for method 3 of type crocadog-npc -(defmethod inspect crocadog-npc ((obj crocadog-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect crocadog-npc ((this crocadog-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 35 of type crocadog-npc -(defmethod get-art-elem crocadog-npc ((obj crocadog-npc)) +(defmethod get-art-elem crocadog-npc ((this crocadog-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor crocadog-vinroom)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (((game-task-actor crocadog-alley)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (else - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) ;; definition for method 33 of type crocadog-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! crocadog-npc ((obj crocadog-npc)) +(defmethod init-art! crocadog-npc ((this crocadog-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crocadog-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) @@ -747,55 +744,55 @@ This commonly includes things such as: ) ;; definition for method 3 of type torn-npc -(defmethod inspect torn-npc ((obj torn-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect torn-npc ((this torn-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type torn-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! torn-npc ((obj torn-npc)) +(defmethod init-art! torn-npc ((this torn-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-torn-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) ;; definition for method 35 of type torn-npc -(defmethod get-art-elem torn-npc ((obj torn-npc)) +(defmethod get-art-elem torn-npc ((this torn-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (cond ((task-node-open? (game-task-node ruins-tower-introduction)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) ((task-node-open? (game-task-node ruins-tower-resolution)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (else - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) ;; definition for method 20 of type torn-npc -(defmethod get-trans torn-npc ((obj torn-npc) (arg0 int)) +(defmethod get-trans torn-npc ((this torn-npc) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((v1-0 (-> obj root))) + (let ((v1-0 (-> this root))) (if (= arg0 2) - (vector<-cspace! (new 'static 'vector) (-> obj node-list data 6)) + (vector<-cspace! (new 'static 'vector) (-> this node-list data 6)) (-> v1-0 trans) ) ) @@ -811,29 +808,29 @@ This commonly includes things such as: ) ;; definition for method 3 of type youngsamos-npc -(defmethod inspect youngsamos-npc ((obj youngsamos-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect youngsamos-npc ((this youngsamos-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type youngsamos-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! youngsamos-npc ((obj youngsamos-npc)) +(defmethod init-art! youngsamos-npc ((this youngsamos-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-youngsamos-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (if (zero? (-> obj draw light-index)) - (set! (-> obj draw light-index) (the-as uint 30)) + (if (zero? (-> this draw light-index)) + (set! (-> this draw light-index) (the-as uint 30)) ) 0 (none) @@ -841,58 +838,58 @@ This commonly includes things such as: ;; definition for method 32 of type youngsamos-npc ;; INFO: Used lq/sq -(defmethod process-taskable-method-32 youngsamos-npc ((obj youngsamos-npc)) - (case (-> obj task actor) +(defmethod process-taskable-method-32 youngsamos-npc ((this youngsamos-npc)) + (case (-> this task actor) (((game-task-actor youngsamos-forest)) (when (not (task-node-closed? (game-task-node forest-protect-resolution))) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-identity) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity) ) (ja-post) (let ((s5-0 (new 'stack-no-clear 'task-arrow-params))) - (set! (-> s5-0 pos quad) (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3)) quad)) + (set! (-> s5-0 pos quad) (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 3)) quad)) (quaternion-copy! (-> s5-0 quat) (eul->quat (new 'stack-no-clear 'quaternion) (new 'static 'euler-angles :x -16384.0 :y 16384.0)) ) (set! (-> s5-0 flags) (task-arrow-flags)) (set! (-> s5-0 map-icon) (the-as uint 15)) - (task-arrow-spawn s5-0 obj) + (task-arrow-spawn s5-0 this) ) ) ) ) - ((the-as (function process-taskable none) (find-parent-method youngsamos-npc 32)) obj) + ((the-as (function process-taskable none) (find-parent-method youngsamos-npc 32)) this) (none) ) ;; definition for method 35 of type youngsamos-npc -(defmethod get-art-elem youngsamos-npc ((obj youngsamos-npc)) +(defmethod get-art-elem youngsamos-npc ((this youngsamos-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor youngsamos-forest)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (((game-task-actor youngsamos-alley)) - (-> obj draw art-group data 7) + (-> this draw art-group data 7) ) (((game-task-actor youngsamos-hideout)) - (if (= (-> obj level name) 'lysamsam) - (-> obj draw art-group data 5) - (-> obj draw art-group data 6) + (if (= (-> this level name) 'lysamsam) + (-> this draw art-group data 5) + (-> this draw art-group data 6) ) ) (((game-task-actor youngsamos-tomb)) - (-> obj draw art-group data 8) + (-> this draw art-group data 8) ) (((game-task-actor youngsamos-onintent)) - (-> obj draw art-group data 9) + (-> this draw art-group data 9) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) @@ -907,45 +904,45 @@ This commonly includes things such as: ) ;; definition for method 3 of type samos-npc -(defmethod inspect samos-npc ((obj samos-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect samos-npc ((this samos-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type samos-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! samos-npc ((obj samos-npc)) +(defmethod init-art! samos-npc ((this samos-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-samos-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) ;; definition for method 35 of type samos-npc -(defmethod get-art-elem samos-npc ((obj samos-npc)) +(defmethod get-art-elem samos-npc ((this samos-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor samos-hideout)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (((game-task-actor samos-garage)) - (-> obj draw art-group data 5) + (-> this draw art-group data 5) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) @@ -960,43 +957,43 @@ This commonly includes things such as: ) ;; definition for method 3 of type onin-npc -(defmethod inspect onin-npc ((obj onin-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect onin-npc ((this onin-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type onin-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! onin-npc ((obj onin-npc)) +(defmethod init-art! onin-npc ((this onin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-onin-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) ;; definition for method 35 of type onin-npc -(defmethod get-art-elem onin-npc ((obj onin-npc)) +(defmethod get-art-elem onin-npc ((this onin-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (let ((v1-1 (get-current-task-event (-> obj task)))) + (let ((v1-1 (get-current-task-event (-> this task)))) (case (-> v1-1 action) (((game-task-action play)) - (set! (-> obj talk-message) (text-id press-triangle-to-play)) + (set! (-> this talk-message) (text-id press-triangle-to-play)) ) (else - (set! (-> obj talk-message) (text-id press-triangle-to-talk)) + (set! (-> this talk-message) (text-id press-triangle-to-talk)) ) ) (if (and (= (-> v1-1 action) (game-task-action play)) @@ -1010,8 +1007,8 @@ This commonly includes things such as: ) ) ) - (-> obj draw art-group data 6) - (-> obj draw art-group data 4) + (-> this draw art-group data 6) + (-> this draw art-group data 4) ) ) ) @@ -1047,75 +1044,75 @@ This commonly includes things such as: ) ;; definition for method 3 of type pecker-npc -(defmethod inspect pecker-npc ((obj pecker-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect pecker-npc ((this pecker-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type pecker-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! pecker-npc ((obj pecker-npc)) +(defmethod init-art! pecker-npc ((this pecker-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pecker-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) ;; definition for method 35 of type pecker-npc -(defmethod get-art-elem pecker-npc ((obj pecker-npc)) +(defmethod get-art-elem pecker-npc ((this pecker-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (local-vars (s5-0 art-joint-anim) (f30-0 float)) (cond - ((logtest? (-> (get-current-task-event (-> obj task)) flags) (game-task-flags gatflag-02)) - (-> obj draw art-group data 6) + ((logtest? (-> (get-current-task-event (-> this task)) flags) (game-task-flags gatflag-02)) + (-> this draw art-group data 6) ) ((begin - (set! s5-0 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (set! s5-0 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) (set! f30-0 (ja-aframe-num 0)) - (and (= s5-0 (-> obj draw art-group data 4)) (>= f30-0 0.0) (>= 118.999 f30-0)) + (and (= s5-0 (-> this draw art-group data 4)) (>= f30-0 0.0) (>= 118.999 f30-0)) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) - ((and (= s5-0 (-> obj draw art-group data 4)) + ((and (= s5-0 (-> this draw art-group data 4)) (>= f30-0 119.0) - (>= (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 4)) frames num-frames) -1)) + (>= (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 4)) frames num-frames) -1)) (ja-frame-num 0) ) ) (if (rand-vu-percent? 0.9) - (-> obj draw art-group data 4) - (-> obj draw art-group data 5) + (-> this draw art-group data 4) + (-> this draw art-group data 5) ) ) - ((and (= s5-0 (-> obj draw art-group data 5)) (>= f30-0 0.0) (>= 258.999 f30-0)) - (-> obj draw art-group data 5) + ((and (= s5-0 (-> this draw art-group data 5)) (>= f30-0 0.0) (>= 258.999 f30-0)) + (-> this draw art-group data 5) ) - ((and (= s5-0 (-> obj draw art-group data 5)) + ((and (= s5-0 (-> this draw art-group data 5)) (>= f30-0 259.0) - (>= (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 5)) frames num-frames) -1)) + (>= (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 5)) frames num-frames) -1)) (ja-frame-num 0) ) ) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (else - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) ) ) @@ -1130,28 +1127,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type brutter-npc -(defmethod inspect brutter-npc ((obj brutter-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect brutter-npc ((this brutter-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type brutter-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! brutter-npc ((obj brutter-npc)) +(defmethod init-art! brutter-npc ((this brutter-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-brutter-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) @@ -1166,47 +1163,47 @@ This commonly includes things such as: ) ;; definition for method 3 of type ashelin-npc -(defmethod inspect ashelin-npc ((obj ashelin-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect ashelin-npc ((this ashelin-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type ashelin-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! ashelin-npc ((obj ashelin-npc)) +(defmethod init-art! ashelin-npc ((this ashelin-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ashelin-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) ;; definition for method 35 of type ashelin-npc -(defmethod get-art-elem ashelin-npc ((obj ashelin-npc)) +(defmethod get-art-elem ashelin-npc ((this ashelin-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor ashelin-throne)) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) - (let ((v1-7 (-> obj root root-prim))) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) + (let ((v1-7 (-> this root root-prim))) (set! (-> v1-7 prim-core collide-as) (collide-spec)) (set! (-> v1-7 prim-core collide-with) (collide-spec)) ) 0 ) ) - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ;; definition of type daxter-npc @@ -1219,37 +1216,37 @@ This commonly includes things such as: ) ;; definition for method 3 of type daxter-npc -(defmethod inspect daxter-npc ((obj daxter-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect daxter-npc ((this daxter-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type daxter-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! daxter-npc ((obj daxter-npc)) +(defmethod init-art! daxter-npc ((this daxter-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sidekick-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 30)) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) ;; definition for method 35 of type daxter-npc -(defmethod get-art-elem daxter-npc ((obj daxter-npc)) +(defmethod get-art-elem daxter-npc ((this daxter-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc b/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc index da7cd12e74..4ef4a36770 100644 --- a/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/scene-looper_REF.gc @@ -18,17 +18,17 @@ ) ;; definition for method 3 of type scene-looper -(defmethod inspect scene-looper ((obj scene-looper)) - (when (not obj) - (set! obj obj) +(defmethod inspect scene-looper ((this scene-looper)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tscene-name: ~A~%" (-> obj scene-name)) + (format #t "~2Tscene-name: ~A~%" (-> this scene-name)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc index 43428b05a7..a3251dc65d 100644 --- a/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/warp-gate_REF.gc @@ -499,49 +499,49 @@ ) ;; definition for method 3 of type warp-gate -(defmethod inspect warp-gate ((obj warp-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect warp-gate ((this warp-gate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlevel-name: ~A~%" (-> obj level-name)) - (format #t "~2Ton-notice: ~A~%" (-> obj on-notice)) - (format #t "~2Ton-activate: ~A~%" (-> obj on-activate)) - (format #t "~2Ton-close: ~A~%" (-> obj on-close)) - (format #t "~2Twait-for: ~A~%" (-> obj wait-for)) - (format #t "~2Tcontinue: ~A~%" (-> obj continue)) - (format #t "~2Tdistance: (meters ~m)~%" (-> obj distance)) - (format #t "~2Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~2Ttest-time: ~D~%" (-> obj test-time)) - (format #t "~2Tcenter: ~`vector`P~%" (-> obj center)) + (format #t "~2Tlevel-name: ~A~%" (-> this level-name)) + (format #t "~2Ton-notice: ~A~%" (-> this on-notice)) + (format #t "~2Ton-activate: ~A~%" (-> this on-activate)) + (format #t "~2Ton-close: ~A~%" (-> this on-close)) + (format #t "~2Twait-for: ~A~%" (-> this wait-for)) + (format #t "~2Tcontinue: ~A~%" (-> this continue)) + (format #t "~2Tdistance: (meters ~m)~%" (-> this distance)) + (format #t "~2Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~2Ttest-time: ~D~%" (-> this test-time)) + (format #t "~2Tcenter: ~`vector`P~%" (-> this center)) (label cfg-4) - obj + this ) ;; definition for method 25 of type warp-gate -(defmethod handle-notice warp-gate ((obj warp-gate)) - (let ((s5-0 (script-eval (-> obj on-notice)))) +(defmethod handle-notice warp-gate ((this warp-gate)) + (let ((s5-0 (script-eval (-> this on-notice)))) (cond ((= s5-0 'hide) - (logior! (-> obj draw status) (draw-control-status no-draw)) - (set! (-> obj continue) #f) + (logior! (-> this draw status) (draw-control-status no-draw)) + (set! (-> this continue) #f) ) (s5-0 - (logclear! (-> obj draw status) (draw-control-status no-draw)) - (set! (-> obj continue) (get-continue-by-name *game-info* (the-as string (car s5-0)))) - (set! (-> obj on-activate) (the-as pair (car (cdr s5-0)))) - (set! (-> obj wait-for) (the-as pair (car (cdr (cdr s5-0))))) - (set! (-> obj on-close) (the-as pair (car (cdr (cdr (cdr s5-0)))))) + (logclear! (-> this draw status) (draw-control-status no-draw)) + (set! (-> this continue) (get-continue-by-name *game-info* (the-as string (car s5-0)))) + (set! (-> this on-activate) (the-as pair (car (cdr s5-0)))) + (set! (-> this wait-for) (the-as pair (car (cdr (cdr s5-0))))) + (set! (-> this on-close) (the-as pair (car (cdr (cdr (cdr s5-0)))))) ) (else - (set! (-> obj continue) #f) + (set! (-> this continue) #f) ) ) ) - (-> obj continue) + (-> this continue) ) ;; failed to figure out what this is: @@ -575,7 +575,7 @@ ) :code (behavior () (remove-setting! 'allow-progress) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (update-transforms (-> self root)) (until #f (handle-notice self) @@ -597,14 +597,14 @@ (or (= v1-30 'target-warp-in) (= v1-30 'target-warp-out)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) #f ) (else #t ) ) - (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (time-elapsed? (-> self state-time) (seconds 0.1)) ) (if (and (cpad-pressed? 0 triangle) (process-grab? *target* #f)) (go-virtual use (-> self continue)) @@ -685,7 +685,7 @@ (kill-current-talker (the-as symbol '()) '() 'exit) (set-setting! 'mode-name 'cam-fixed 0.0 0) (set-setting! 'interp-time 'abs 0.0 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (when (not arg0) (process-release? *target*) @@ -727,7 +727,7 @@ ) ) (label cfg-21) - (or v1-38 (< (- (current-time) (-> self state-time)) (seconds 2))) + (or v1-38 (not (time-elapsed? (-> self state-time) (seconds 2)))) ) (update! (-> self sound)) (suspend) @@ -739,7 +739,7 @@ ) (start 'play arg0) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -758,8 +758,8 @@ ;; definition for method 23 of type warp-gate ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide warp-gate ((obj warp-gate)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-skel-and-collide warp-gate ((this warp-gate)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -774,10 +774,10 @@ (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-warp-gate" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -787,20 +787,20 @@ ;; definition for method 24 of type warp-gate ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod setup-fields warp-gate ((obj warp-gate)) - (set! (-> obj level-name) (the-as uint (-> obj level name))) - (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice pair)) - (set! (-> obj on-activate) #f) - (set! (-> obj wait-for) #f) - (set! (-> obj continue) #f) - (set! (-> obj on-close) #f) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 130) obj)) - (set! (-> obj center quad) (-> obj root trans quad)) - (+! (-> obj center y) 13516.8) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "warpgate" :fo-max 30) (-> obj root trans)) +(defmethod setup-fields warp-gate ((this warp-gate)) + (set! (-> this level-name) (the-as uint (-> this level name))) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice pair)) + (set! (-> this on-activate) #f) + (set! (-> this wait-for) #f) + (set! (-> this continue) #f) + (set! (-> this on-close) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 130) this)) + (set! (-> this center quad) (-> this root trans quad)) + (+! (-> this center y) 13516.8) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "warpgate" :fo-max 30) (-> this root trans)) ) - (set! (-> obj distance) (res-lump-float (-> obj entity) 'distance :default 20480.0)) + (set! (-> this distance) (res-lump-float (-> this entity) 'distance :default 20480.0)) (none) ) @@ -823,7 +823,7 @@ ) ;; definition for method 11 of type warp-gate -(defmethod init-from-entity! warp-gate ((obj warp-gate) (arg0 entity-actor)) +(defmethod init-from-entity! warp-gate ((this warp-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -884,7 +884,7 @@ This commonly includes things such as: ) ) :enter (behavior ((arg0 vector) (arg1 vector) (arg2 target)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (set! (-> self control mod-surface) *warp-jump-mods*) (set! (-> self control unknown-vector37 quad) (-> arg0 quad)) @@ -946,7 +946,7 @@ This commonly includes things such as: (set! (-> v1-20 prim-core collide-with) (collide-spec)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self trans-hook) (lambda :behavior target () @@ -972,7 +972,7 @@ This commonly includes things such as: (set! (-> gp-1 y) 0.0) (send-event *target* 'sidekick #f) (when (and (or (< (vector-dot gp-1 (-> self control transv)) 0.0) (-> self control unknown-spool-anim00)) - (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (time-elapsed? (-> self state-time) (seconds 0.05)) ) (vector-seek! (-> self draw color-mult) (new 'static 'vector) (* 2.0 (seconds-per-frame))) (set! (-> self control transv x) (* 0.95 (-> self control transv x))) @@ -1064,7 +1064,7 @@ This commonly includes things such as: (vector-reset! (-> self control transv)) (move-to-point! (-> self control) (-> self control unknown-vector37)) (let ((s5-1 (current-time))) - (while (or (< (- (current-time) s5-1) (seconds 1)) + (while (or (not (time-elapsed? s5-1 (seconds 1))) (< 81920.0 (vector-vector-distance (camera-pos) (-> self control trans))) ) (suspend) @@ -1072,7 +1072,7 @@ This commonly includes things such as: ) (set-heading-vec! (-> self control) (-> self control transv)) (rot->dir-targ! (-> self control)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self post-hook) target-no-stick-post) (ja-channel-set! 1) (send-event @@ -1157,59 +1157,59 @@ This commonly includes things such as: ) ;; definition for method 3 of type air-train -(defmethod inspect air-train ((obj air-train)) - (when (not obj) - (set! obj obj) +(defmethod inspect air-train ((this air-train)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type warp-gate inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpart-exhaust-left: ~A~%" (-> obj part-exhaust-left)) - (format #t "~2Tpart-exhaust-right: ~A~%" (-> obj part-exhaust-right)) - (format #t "~2Tpart-dust: ~A~%" (-> obj part-dust)) - (format #t "~2Tdust-y: ~f~%" (-> obj dust-y)) - (format #t "~2Thover-sound: ~D~%" (-> obj hover-sound)) - (format #t "~2Tbase-pos: #~%" (-> obj base-pos)) + (format #t "~2Tpart-exhaust-left: ~A~%" (-> this part-exhaust-left)) + (format #t "~2Tpart-exhaust-right: ~A~%" (-> this part-exhaust-right)) + (format #t "~2Tpart-dust: ~A~%" (-> this part-dust)) + (format #t "~2Tdust-y: ~f~%" (-> this dust-y)) + (format #t "~2Thover-sound: ~D~%" (-> this hover-sound)) + (format #t "~2Tbase-pos: #~%" (-> this base-pos)) (label cfg-4) - obj + this ) ;; definition for method 7 of type air-train ;; WARN: Return type mismatch warp-gate vs air-train. -(defmethod relocate air-train ((obj air-train) (arg0 int)) - (if (nonzero? (-> obj part-exhaust-left)) - (&+! (-> obj part-exhaust-left) arg0) +(defmethod relocate air-train ((this air-train) (arg0 int)) + (if (nonzero? (-> this part-exhaust-left)) + (&+! (-> this part-exhaust-left) arg0) ) - (if (nonzero? (-> obj part-exhaust-right)) - (&+! (-> obj part-exhaust-right) arg0) + (if (nonzero? (-> this part-exhaust-right)) + (&+! (-> this part-exhaust-right) arg0) ) - (if (nonzero? (-> obj part-dust)) - (&+! (-> obj part-dust) arg0) + (if (nonzero? (-> this part-dust)) + (&+! (-> this part-dust) arg0) ) - (the-as air-train ((method-of-type warp-gate relocate) obj arg0)) + (the-as air-train ((method-of-type warp-gate relocate) this arg0)) ) ;; definition for method 10 of type air-train -(defmethod deactivate air-train ((obj air-train)) - (sound-stop (-> obj hover-sound)) - (if (nonzero? (-> obj part-exhaust-left)) - (kill-and-free-particles (-> obj part-exhaust-left)) +(defmethod deactivate air-train ((this air-train)) + (sound-stop (-> this hover-sound)) + (if (nonzero? (-> this part-exhaust-left)) + (kill-and-free-particles (-> this part-exhaust-left)) ) - (if (nonzero? (-> obj part-exhaust-right)) - (kill-and-free-particles (-> obj part-exhaust-right)) + (if (nonzero? (-> this part-exhaust-right)) + (kill-and-free-particles (-> this part-exhaust-right)) ) - (if (nonzero? (-> obj part-dust)) - (kill-and-free-particles (-> obj part-dust)) + (if (nonzero? (-> this part-dust)) + (kill-and-free-particles (-> this part-dust)) ) - ((method-of-type warp-gate deactivate) obj) + ((method-of-type warp-gate deactivate) this) (none) ) ;; definition for method 23 of type air-train ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide air-train ((obj air-train)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-skel-and-collide air-train ((this air-train)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1244,10 +1244,10 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-air-train" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1257,30 +1257,30 @@ This commonly includes things such as: ;; definition for method 24 of type air-train ;; INFO: Used lq/sq ;; WARN: Return type mismatch sound-id vs none. -(defmethod setup-fields air-train ((obj air-train)) +(defmethod setup-fields air-train ((this air-train)) (let ((t9-0 (method-of-type warp-gate setup-fields))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj base-pos quad) (-> obj root trans quad)) - (let ((v1-2 (-> obj level-name))) - (set! (-> obj dust-y) (cond - ((= v1-2 'nest) - -1105.92 - ) - ((= v1-2 'caspad) - 114647.04 - ) - (else - (the-as float #x7f800000) + (set! (-> this base-pos quad) (-> this root trans quad)) + (let ((v1-2 (-> this level-name))) + (set! (-> this dust-y) (cond + ((= v1-2 'nest) + -1105.92 ) - ) + ((= v1-2 'caspad) + 114647.04 + ) + (else + (the-as float #x7f800000) + ) + ) ) ) - (set! (-> obj part-exhaust-left) (create-launch-control (-> *part-group-id-table* 134) obj)) - (set! (-> obj part-exhaust-right) (create-launch-control (-> *part-group-id-table* 134) obj)) - (set! (-> obj part-dust) (create-launch-control (-> *part-group-id-table* 132) obj)) - (set! (-> obj root pause-adjust-distance) 368640.0) - (set! (-> obj hover-sound) (sound-play "air-train")) + (set! (-> this part-exhaust-left) (create-launch-control (-> *part-group-id-table* 134) this)) + (set! (-> this part-exhaust-right) (create-launch-control (-> *part-group-id-table* 134) this)) + (set! (-> this part-dust) (create-launch-control (-> *part-group-id-table* 132) this)) + (set! (-> this root pause-adjust-distance) 368640.0) + (set! (-> this hover-sound) (sound-play "air-train")) (none) ) @@ -1318,7 +1318,7 @@ This commonly includes things such as: :virtual #t :code (behavior ((arg0 continue-point)) (kill-current-talker (the-as symbol '()) '() 'exit) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause)) (when (not arg0) (process-release? *target*) diff --git a/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc b/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc index 7a62b14f4c..9d041e06c5 100644 --- a/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/consite/consite-obs_REF.gc @@ -20,16 +20,16 @@ ) ;; definition for method 3 of type consite-break-scaffold -(defmethod inspect consite-break-scaffold ((obj consite-break-scaffold)) - (when (not obj) - (set! obj obj) +(defmethod inspect consite-break-scaffold ((this consite-break-scaffold)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -40,17 +40,17 @@ ;; definition for method 11 of type consite-break-scaffold ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-break-scaffold ((obj consite-break-scaffold) (arg0 entity-actor)) +(defmethod init-from-entity! consite-break-scaffold ((this consite-break-scaffold) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-consite-break-piece-break-d" (the-as (pointer uint32) #f)) @@ -60,12 +60,12 @@ This commonly includes things such as: (ja-post) (cond ((task-node-closed? (game-task-node consite-find-baron-resolution)) - (cleanup-for-death obj) - (logclear! (-> obj mask) (process-mask actor-pause)) + (cleanup-for-death this) + (logclear! (-> this mask) (process-mask actor-pause)) (go empty-state) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -84,16 +84,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type consite-bomb-elevator-hinges -(defmethod inspect consite-bomb-elevator-hinges ((obj consite-bomb-elevator-hinges)) - (when (not obj) - (set! obj obj) +(defmethod inspect consite-bomb-elevator-hinges ((this consite-bomb-elevator-hinges)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -121,24 +121,24 @@ This commonly includes things such as: ;; definition for method 11 of type consite-bomb-elevator-hinges ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-bomb-elevator-hinges ((obj consite-bomb-elevator-hinges) (arg0 entity-actor)) +(defmethod init-from-entity! consite-bomb-elevator-hinges ((this consite-bomb-elevator-hinges) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-consite-bomb-elevator-hinges" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -172,16 +172,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type consite-bomb-elevator -(defmethod inspect consite-bomb-elevator ((obj consite-bomb-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect consite-bomb-elevator ((this consite-bomb-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -209,14 +209,14 @@ This commonly includes things such as: ;; definition for method 11 of type consite-bomb-elevator ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-bomb-elevator ((obj consite-bomb-elevator) (arg0 entity-actor)) +(defmethod init-from-entity! consite-bomb-elevator ((this consite-bomb-elevator) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -237,19 +237,19 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-consite-bomb-elevator" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (process-spawn consite-bomb-elevator-hinges obj arg0 :to obj) - (go (method-of-object obj idle)) + (process-spawn consite-bomb-elevator-hinges this arg0 :to this) + (go (method-of-object this idle)) (none) ) @@ -266,16 +266,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type consite-silo-doors -(defmethod inspect consite-silo-doors ((obj consite-silo-doors)) - (when (not obj) - (set! obj obj) +(defmethod inspect consite-silo-doors ((this consite-silo-doors)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -303,14 +303,14 @@ This commonly includes things such as: ;; definition for method 11 of type consite-silo-doors ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! consite-silo-doors ((obj consite-silo-doors) (arg0 entity-actor)) +(defmethod init-from-entity! consite-silo-doors ((this consite-silo-doors) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -338,15 +338,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-consite-silo-doors" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -368,43 +368,43 @@ This commonly includes things such as: ) ;; definition for method 3 of type baron-npc -(defmethod inspect baron-npc ((obj baron-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect baron-npc ((this baron-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 35 of type baron-npc -(defmethod get-art-elem baron-npc ((obj baron-npc)) +(defmethod get-art-elem baron-npc ((this baron-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor baron-consite)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) ;; definition for method 33 of type baron-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! baron-npc ((obj baron-npc)) +(defmethod init-art! baron-npc ((this baron-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-baron-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (set! (-> obj draw shadow) #f) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this draw shadow) #f) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/consite/consite-part_REF.gc b/test/decompiler/reference/jak2/levels/consite/consite-part_REF.gc index 52327ca810..9428b5fee0 100644 --- a/test/decompiler/reference/jak2/levels/consite/consite-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/consite/consite-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type consite-part -(defmethod inspect consite-part ((obj consite-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect consite-part ((this consite-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/consite/consiteb-part_REF.gc b/test/decompiler/reference/jak2/levels/consite/consiteb-part_REF.gc index 69c1594732..ce4d39cc43 100644 --- a/test/decompiler/reference/jak2/levels/consite/consiteb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/consite/consiteb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type consiteb-part -(defmethod inspect consiteb-part ((obj consiteb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect consiteb-part ((this consiteb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc b/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc index 05278fe163..d0b294887e 100644 --- a/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/demo/demo-obs_REF.gc @@ -25,52 +25,52 @@ ) ;; definition for method 3 of type demo-control -(defmethod inspect demo-control ((obj demo-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect demo-control ((this demo-control)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tselected: ~D~%" (-> obj selected)) - (format #t "~2Tsprites[2] @ #x~X~%" (-> obj sprites)) - (format #t "~2Tsprite-pos: ~`vector`P~%" (-> obj sprite-pos)) - (format #t "~2Tsprite-draw: ~D~%" (-> obj sprite-draw)) - (format #t "~2Tbuffer[2] @ #x~X~%" (-> obj buffer)) + (format #t "~2Tselected: ~D~%" (-> this selected)) + (format #t "~2Tsprites[2] @ #x~X~%" (-> this sprites)) + (format #t "~2Tsprite-pos: ~`vector`P~%" (-> this sprite-pos)) + (format #t "~2Tsprite-draw: ~D~%" (-> this sprite-draw)) + (format #t "~2Tbuffer[2] @ #x~X~%" (-> this buffer)) (dotimes (s5-0 2) - (format #t "~T [~D]~2Tbuffer: ~A~%" s5-0 (-> obj buffer s5-0)) + (format #t "~T [~D]~2Tbuffer: ~A~%" s5-0 (-> this buffer s5-0)) ) - (format #t "~2Twant[2] @ #x~X~%" (-> obj want)) - (format #t "~2Thave[2] @ #x~X~%" (-> obj have)) - (format #t "~2Tdraw: ~D~%" (-> obj draw)) - (format #t "~2Tactive: ~A~%" (-> obj active)) - (format #t "~2Tspark-time: ~D~%" (-> obj spark-time)) - (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) + (format #t "~2Twant[2] @ #x~X~%" (-> this want)) + (format #t "~2Thave[2] @ #x~X~%" (-> this have)) + (format #t "~2Tdraw: ~D~%" (-> this draw)) + (format #t "~2Tactive: ~A~%" (-> this active)) + (format #t "~2Tspark-time: ~D~%" (-> this spark-time)) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) (label cfg-7) - obj + this ) ;; definition for method 7 of type demo-control ;; WARN: Return type mismatch process vs demo-control. -(defmethod relocate demo-control ((obj demo-control) (arg0 int)) +(defmethod relocate demo-control ((this demo-control) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj buffer v1-0)) - (&+! (-> obj buffer v1-0) arg0) + (if (nonzero? (-> this buffer v1-0)) + (&+! (-> this buffer v1-0) arg0) ) ) - (the-as demo-control ((method-of-type process relocate) obj arg0)) + (the-as demo-control ((method-of-type process relocate) this arg0)) ) ;; definition for method 10 of type demo-control -(defmethod deactivate demo-control ((obj demo-control)) +(defmethod deactivate demo-control ((this demo-control)) (dotimes (s5-0 2) - (set-pending-file (-> obj buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) + (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) (dotimes (s5-1 2) - (update (-> obj buffer s5-1)) + (update (-> this buffer s5-1)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -498,7 +498,7 @@ (let ((s4-0 (current-time)) (s3-0 #f) ) - (while (not (or (>= (- (current-time) s4-0) arg1) (and (>= (- (current-time) s4-0) arg0) s3-0))) + (while (not (or (time-elapsed? s4-0 arg1) (and (time-elapsed? s4-0 arg0) s3-0))) (if (cpad-pressed? 0 triangle) (set! s3-0 #t) ) @@ -655,14 +655,14 @@ (cond ((zero? (scf-get-territory)) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.38)) + (until (time-elapsed? gp-3 (seconds 0.38)) (suspend) ) ) (set! (-> self sprite-draw) (the-as uint 3)) (set-vector! (-> self sprite-pos) -512.0 40.0 0.0 1.0) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.25)) + (until (time-elapsed? gp-4 (seconds 0.25)) (set! (-> self sprite-pos x) (lerp-scale -512.0 0.0 (sin (* 218.45334 (the float (- (current-time) gp-4)))) 0.0 1.0) ) @@ -670,12 +670,12 @@ ) ) (let ((gp-5 (current-time))) - (until (>= (- (current-time) gp-5) (seconds 2)) + (until (time-elapsed? gp-5 (seconds 2)) (suspend) ) ) (let ((gp-6 (current-time))) - (until (>= (- (current-time) gp-6) (seconds 0.25)) + (until (time-elapsed? gp-6 (seconds 0.25)) (set! (-> self sprite-pos x) (lerp-scale 0.0 512.0 (sin (* 218.45334 (the float (- (current-time) gp-6)))) 0.0 1.0) ) @@ -685,7 +685,7 @@ (set! (-> self sprite-draw) (the-as uint 1)) (set-vector! (-> self sprite-pos) 30.0 -240.0 0.0 1.0) (let ((gp-7 (current-time))) - (until (>= (- (current-time) gp-7) (seconds 0.25)) + (until (time-elapsed? gp-7 (seconds 0.25)) (set! (-> self sprite-pos y) (lerp-scale -240.0 270.0 (sin (* 218.45334 (the float (- (current-time) gp-7)))) 0.0 1.0) ) @@ -693,12 +693,12 @@ ) ) (let ((gp-8 (current-time))) - (until (>= (- (current-time) gp-8) (seconds 2)) + (until (time-elapsed? gp-8 (seconds 2)) (suspend) ) ) (let ((gp-9 (current-time))) - (until (>= (- (current-time) gp-9) (seconds 0.25)) + (until (time-elapsed? gp-9 (seconds 0.25)) (set! (-> self sprite-pos y) (lerp-scale 270.0 720.0 (sin (* 218.45334 (the float (- (current-time) gp-9)))) 0.0 1.0) ) @@ -708,7 +708,7 @@ (set! (-> self sprite-draw) (the-as uint 2)) (set-vector! (-> self sprite-pos) 20.0 40.0 0.0 1.0) (let ((gp-10 (current-time))) - (until (>= (- (current-time) gp-10) (seconds 0.25)) + (until (time-elapsed? gp-10 (seconds 0.25)) (set! (-> self sprite-pos y) (lerp-scale 720.0 20.0 (sin (* 218.45334 (the float (- (current-time) gp-10)))) 0.0 1.0) ) @@ -725,12 +725,12 @@ (want-levels *load-state* a1-21) ) (let ((gp-11 (current-time))) - (until (>= (- (current-time) gp-11) (seconds 2)) + (until (time-elapsed? gp-11 (seconds 2)) (suspend) ) ) (let ((gp-12 (current-time))) - (until (>= (- (current-time) gp-12) (seconds 0.25)) + (until (time-elapsed? gp-12 (seconds 0.25)) (set! (-> self sprite-pos y) (lerp-scale 20.0 -720.0 (sin (* 218.45334 (the float (- (current-time) gp-12)))) 0.0 1.0) ) @@ -740,54 +740,54 @@ ) (else (let ((gp-13 (current-time))) - (until (>= (- (current-time) gp-13) (seconds 0.38)) + (until (time-elapsed? gp-13 (seconds 0.38)) (suspend) ) ) (let ((gp-14 (current-time))) - (until (>= (- (current-time) gp-14) (seconds 2)) + (until (time-elapsed? gp-14 (seconds 2)) (suspend) ) ) (let ((gp-15 (current-time))) - (until (>= (- (current-time) gp-15) (seconds 0.25)) + (until (time-elapsed? gp-15 (seconds 0.25)) (suspend) ) ) (let ((gp-16 (current-time))) - (until (>= (- (current-time) gp-16) (seconds 0.25)) + (until (time-elapsed? gp-16 (seconds 0.25)) (suspend) ) ) (let ((gp-17 (current-time))) - (until (>= (- (current-time) gp-17) (seconds 2)) + (until (time-elapsed? gp-17 (seconds 2)) (suspend) ) ) (let ((gp-18 (current-time))) - (until (>= (- (current-time) gp-18) (seconds 0.25)) + (until (time-elapsed? gp-18 (seconds 0.25)) (suspend) ) ) (let ((gp-19 (current-time))) - (until (>= (- (current-time) gp-19) (seconds 0.25)) + (until (time-elapsed? gp-19 (seconds 0.25)) (suspend) ) ) (let ((gp-20 (current-time))) - (until (>= (- (current-time) gp-20) (seconds 2)) + (until (time-elapsed? gp-20 (seconds 2)) (suspend) ) ) (let ((gp-21 (current-time))) - (until (>= (- (current-time) gp-21) (seconds 0.25)) + (until (time-elapsed? gp-21 (seconds 0.25)) (suspend) ) ) ) ) (let ((gp-22 (current-time))) - (until (>= (- (current-time) gp-22) (seconds 3)) + (until (time-elapsed? gp-22 (seconds 3)) (suspend) ) ) @@ -806,7 +806,7 @@ (script-eval '(fadeout (seconds (new 'static 'bfloat :data 0.3)))) (let ((s5-8 (current-time))) (while (or (!= (-> *setting-control* user-current bg-a) (-> *setting-control* user-target bg-a)) - (< (- (current-time) s5-8) (seconds 0.3)) + (not (time-elapsed? s5-8 (seconds 0.3))) ) (suspend) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc index 3f29c23037..df5a54d2be 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-digger_REF.gc @@ -505,43 +505,43 @@ ;; definition for method 15 of type hud-dig-clasp ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-dig-clasp ((obj hud-dig-clasp)) +(defmethod draw hud-dig-clasp ((this hud-dig-clasp)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 210 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -18 29) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -18 29) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-dig-clasp ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-dig-clasp ((obj hud-dig-clasp)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-dig-clasp ((this hud-dig-clasp)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-dig-clasp ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-dig-clasp ((obj hud-dig-clasp)) - (set! (-> obj level) (level-get *level* 'dig1)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-dig-clasp ((this hud-dig-clasp)) + (set! (-> this level) (level-get *level* 'dig1)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1c))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1c))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -564,18 +564,18 @@ ) ;; definition for method 3 of type dig-clasp -(defmethod inspect dig-clasp ((obj dig-clasp)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-clasp ((this dig-clasp)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tb: ~A~%" (-> obj b)) - (format #t "~2Tconn: #~%" (-> obj conn)) + (format #t "~2Tb: ~A~%" (-> this b)) + (format #t "~2Tconn: #~%" (-> this conn)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -611,10 +611,10 @@ ) ;; definition for method 23 of type dig-clasp -(defmethod dig-clasp-method-23 dig-clasp ((obj dig-clasp) (arg0 vector)) - (if (-> obj b) - (vector<-cspace! arg0 (-> obj node-list data 3)) - (vector<-cspace! arg0 (-> obj node-list data 6)) +(defmethod dig-clasp-method-23 dig-clasp ((this dig-clasp) (arg0 vector)) + (if (-> this b) + (vector<-cspace! arg0 (-> this node-list data 3)) + (vector<-cspace! arg0 (-> this node-list data 6)) ) ) @@ -726,14 +726,14 @@ ;; definition for method 11 of type dig-clasp ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-clasp ((obj dig-clasp) (arg0 entity-actor)) +(defmethod init-from-entity! dig-clasp ((this dig-clasp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -747,21 +747,21 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-clasp" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 1)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1142) obj)) - (set! (-> obj b) #f) - (set! (-> obj conn) (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector #t) 0)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj broken)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1142) this)) + (set! (-> this b) #f) + (set! (-> this conn) (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector #t) 0)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this broken)) + (go (method-of-object this idle)) ) (none) ) @@ -776,21 +776,21 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-clasp-b -(defmethod inspect dig-clasp-b ((obj dig-clasp-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-clasp-b ((this dig-clasp-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type dig-clasp inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type dig-clasp-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-clasp-b ((obj dig-clasp-b) (arg0 entity-actor)) +(defmethod init-from-entity! dig-clasp-b ((this dig-clasp-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -798,7 +798,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (when (not (task-node-closed? (game-task-node dig-knock-down-resolution))) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -812,21 +812,21 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-clasp-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 1)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1142) obj)) - (set! (-> obj b) (the-as basic #t)) - (set! (-> obj conn) (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector #t) 0)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj broken)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1142) this)) + (set! (-> this b) (the-as basic #t)) + (set! (-> this conn) (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector #t) 0)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this broken)) + (go (method-of-object this idle)) ) ) (none) @@ -844,17 +844,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-tether-chain -(defmethod inspect dig-tether-chain ((obj dig-tether-chain)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-tether-chain ((this dig-tether-chain)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dig-tether-chain) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) - (format #t "~1Tjoint-mod: ~A~%" (-> obj joint-mod)) + (format #t "[~8x] ~A~%" this 'dig-tether-chain) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Tjoint-mod: ~A~%" (-> this joint-mod)) (label cfg-4) - obj + this ) ;; definition of type dig-tether @@ -887,29 +887,29 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-tether -(defmethod inspect dig-tether ((obj dig-tether)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-tether ((this dig-tether)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tclasp: ~A~%" (-> obj clasp)) - (format #t "~2Tclasp-info-ok: ~A~%" (-> obj clasp-info-ok)) - (format #t "~2Tclasp-pos: #~%" (-> obj clasp-pos)) - (format #t "~2Tdigger-pos: #~%" (-> obj digger-pos)) - (format #t "~2Tdigger-vertical: #~%" (-> obj digger-vertical)) - (format #t "~2Tframe: #~%" (-> obj frame)) - (format #t "~2Tframe-kicker: #~%" (-> obj frame-kicker)) - (format #t "~2Told-dist: ~f~%" (-> obj old-dist)) - (format #t "~2Tchain-joints[8] @ #x~X~%" (-> obj chain-joints)) - (format #t "~2Tchain-offset-rand: #~%" (-> obj chain-offset-rand)) - (format #t "~2Tchain-offset: #~%" (-> obj chain-offset)) - (format #t "~2Tjoint-one: ~A~%" (-> obj joint-one)) - (format #t "~2Tsnapped-look: #~%" (-> obj snapped-look)) + (format #t "~2Tclasp: ~A~%" (-> this clasp)) + (format #t "~2Tclasp-info-ok: ~A~%" (-> this clasp-info-ok)) + (format #t "~2Tclasp-pos: #~%" (-> this clasp-pos)) + (format #t "~2Tdigger-pos: #~%" (-> this digger-pos)) + (format #t "~2Tdigger-vertical: #~%" (-> this digger-vertical)) + (format #t "~2Tframe: #~%" (-> this frame)) + (format #t "~2Tframe-kicker: #~%" (-> this frame-kicker)) + (format #t "~2Told-dist: ~f~%" (-> this old-dist)) + (format #t "~2Tchain-joints[8] @ #x~X~%" (-> this chain-joints)) + (format #t "~2Tchain-offset-rand: #~%" (-> this chain-offset-rand)) + (format #t "~2Tchain-offset: #~%" (-> this chain-offset)) + (format #t "~2Tjoint-one: ~A~%" (-> this joint-one)) + (format #t "~2Tsnapped-look: #~%" (-> this snapped-look)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -926,10 +926,10 @@ This commonly includes things such as: ;; definition for method 22 of type dig-tether ;; WARN: Return type mismatch int vs none. -(defmethod dig-tether-method-22 dig-tether ((obj dig-tether)) +(defmethod dig-tether-method-22 dig-tether ((this dig-tether)) (with-pp - (when (-> obj clasp) - (let* ((s4-0 (-> obj clasp extra process)) + (when (-> this clasp) + (let* ((s4-0 (-> this clasp extra process)) (s5-0 (if (type? s4-0 dig-clasp) s4-0 ) @@ -941,13 +941,13 @@ This commonly includes things such as: (set! (-> a1-1 message) 'broken?) (cond ((or (send-event-function s5-0 a1-1) - (logtest? (-> obj clasp extra perm status) (entity-perm-status subtask-complete)) + (logtest? (-> this clasp extra perm status) (entity-perm-status subtask-complete)) ) - (go (method-of-object obj broken)) + (go (method-of-object this broken)) ) (s5-0 - (send-event s5-0 'tether-position (-> obj clasp-pos)) - (set! (-> obj clasp-info-ok) #t) + (send-event s5-0 'tether-position (-> this clasp-pos)) + (set! (-> this clasp-info-ok) #t) ) ) ) @@ -959,59 +959,59 @@ This commonly includes things such as: ;; definition for method 23 of type dig-tether ;; INFO: Used lq/sq -(defmethod dig-tether-method-23 dig-tether ((obj dig-tether)) - (set-params! (-> obj chain-offset-rand) 75 150 2048.0 204.8) - (set-params! (-> obj chain-offset) (the-as vector #f) 4.096 20.48 0.9) - (mode-set! (-> obj joint-one) (joint-mod-mode joint-set-world)) +(defmethod dig-tether-method-23 dig-tether ((this dig-tether)) + (set-params! (-> this chain-offset-rand) 75 150 2048.0 204.8) + (set-params! (-> this chain-offset) (the-as vector #f) 4.096 20.48 0.9) + (mode-set! (-> this joint-one) (joint-mod-mode joint-set-world)) (dotimes (s5-0 7) (cond - ((-> obj clasp-info-ok) - (vector<-cspace! (the-as vector (-> obj chain-joints s5-0)) (-> obj chain-joints s5-0 joint-mod joint)) + ((-> this clasp-info-ok) + (vector<-cspace! (the-as vector (-> this chain-joints s5-0)) (-> this chain-joints s5-0 joint-mod joint)) ) (else - (set! (-> obj chain-joints s5-0 position quad) (-> obj root trans quad)) - (set! (-> obj chain-joints s5-0 position y) - (- (-> obj chain-joints s5-0 position y) (* 4096.0 (the float s5-0))) + (set! (-> this chain-joints s5-0 position quad) (-> this root trans quad)) + (set! (-> this chain-joints s5-0 position y) + (- (-> this chain-joints s5-0 position y) (* 4096.0 (the float s5-0))) ) ) ) - (vector-reset! (+ (the-as uint (-> obj chain-joints 0 velocity)) (* 48 s5-0))) - (mode-set! (-> obj chain-joints s5-0 joint-mod) (joint-mod-mode joint-set-world)) + (vector-reset! (+ (the-as uint (-> this chain-joints 0 velocity)) (* 48 s5-0))) + (mode-set! (-> this chain-joints s5-0 joint-mod) (joint-mod-mode joint-set-world)) ) - (set! (-> obj chain-joints 7 position quad) (-> obj chain-joints 6 position quad)) - (vector-reset! (-> obj chain-joints 7 velocity)) - (lods-assign! (-> obj draw) (-> obj snapped-look)) + (set! (-> this chain-joints 7 position quad) (-> this chain-joints 6 position quad)) + (vector-reset! (-> this chain-joints 7 velocity)) + (lods-assign! (-> this draw) (-> this snapped-look)) (none) ) ;; definition for method 24 of type dig-tether ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod dig-tether-method-24 dig-tether ((obj dig-tether)) +(defmethod dig-tether-method-24 dig-tether ((this dig-tether)) (local-vars (sv-144 dig-tether-chain) (sv-160 vector)) - (update-with-delay! (-> obj chain-offset-rand)) - (update! (-> obj chain-offset) (-> obj chain-offset-rand value)) + (update-with-delay! (-> this chain-offset-rand)) + (update! (-> this chain-offset) (-> this chain-offset-rand value)) (let ((s5-0 (new 'stack-no-clear 'matrix)) (s4-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 quad) (-> obj root trans quad)) + (set! (-> s4-0 quad) (-> this root trans quad)) (let ((s3-0 (new 'stack-no-clear 'vector)) (f30-0 0.2) - (s2-0 (-> obj chain-offset)) + (s2-0 (-> this chain-offset)) (f28-0 0.1) (s1-0 (new 'stack-no-clear 'vector)) ) - (vector-! (-> s5-0 vector 2) (the-as vector (-> obj chain-joints)) (-> obj root trans)) + (vector-! (-> s5-0 vector 2) (the-as vector (-> this chain-joints)) (-> this root trans)) (vector-normalize! (-> s5-0 vector 2) 1.0) - (vector-cross! (the-as vector (-> s5-0 vector)) (-> obj digger-vertical) (-> s5-0 vector 2)) + (vector-cross! (the-as vector (-> s5-0 vector)) (-> this digger-vertical) (-> s5-0 vector 2)) (vector-normalize! (the-as vector (-> s5-0 vector)) 1.0) (vector-cross! (-> s5-0 vector 1) (-> s5-0 vector 2) (the-as vector (-> s5-0 vector))) - (matrix->quaternion (-> obj root quat) s5-0) - (set! (-> obj joint-one trans quad) (-> obj root trans quad)) - (quaternion-copy! (-> obj joint-one quat) (-> obj root quat)) + (matrix->quaternion (-> this root quat) s5-0) + (set! (-> this joint-one trans quad) (-> this root trans quad)) + (quaternion-copy! (-> this joint-one quat) (-> this root quat)) (set! (-> s3-0 quad) (-> s5-0 vector 1 quad)) (dotimes (s0-0 8) - (set! sv-144 (-> obj chain-joints s0-0)) + (set! sv-144 (-> this chain-joints s0-0)) (set! sv-160 (new 'stack-no-clear 'vector)) (let ((v1-23 (-> sv-144 position quad))) (set! (-> sv-160 quad) v1-23) @@ -1023,7 +1023,7 @@ This commonly includes things such as: (vector+float*! sv-160 sv-160 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* 48 (+ s0-0 1)))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* 48 (+ s0-0 1)))) f30-0 ) (set! f30-0 (fmin 0.9 (+ 0.2 f30-0))) @@ -1031,8 +1031,8 @@ This commonly includes things such as: (vector-! s1-0 sv-160 s4-0) (vector-normalize! s1-0 12288.0) (vector+! sv-160 s1-0 s4-0) - (vector-! s1-0 sv-160 (-> obj digger-pos)) - (vector-flatten! s1-0 s1-0 (-> obj digger-vertical)) + (vector-! s1-0 sv-160 (-> this digger-pos)) + (vector-flatten! s1-0 s1-0 (-> this digger-vertical)) (let ((f0-6 (vector-normalize-ret-len! s1-0 1.0))) (if (< f0-6 73728.0) (vector+float*! sv-160 sv-160 s1-0 (- 73728.0 f0-6)) @@ -1051,7 +1051,7 @@ This commonly includes things such as: (set! (-> sv-144 joint-mod trans quad) (-> sv-160 quad)) ) (when (< s0-0 7) - (vector-! (-> s5-0 vector 2) (the-as vector (-> obj chain-joints (+ s0-0 1))) sv-160) + (vector-! (-> s5-0 vector 2) (the-as vector (-> this chain-joints (+ s0-0 1))) sv-160) (vector-normalize! (-> s5-0 vector 2) 1.0) (vector-cross! (the-as vector (-> s5-0 vector)) s3-0 (-> s5-0 vector 2)) (vector-normalize! (the-as vector (-> s5-0 vector)) 1.0) @@ -1152,16 +1152,16 @@ This commonly includes things such as: ;; definition for method 7 of type dig-tether ;; WARN: Return type mismatch process-drawable vs dig-tether. -(defmethod relocate dig-tether ((obj dig-tether) (arg0 int)) - (if (nonzero? (-> obj joint-one)) - (&+! (-> obj joint-one) arg0) +(defmethod relocate dig-tether ((this dig-tether) (arg0 int)) + (if (nonzero? (-> this joint-one)) + (&+! (-> this joint-one) arg0) ) (dotimes (v1-4 7) - (if (nonzero? (-> obj chain-joints v1-4 joint-mod)) - (&+! (-> obj chain-joints v1-4 joint-mod) arg0) + (if (nonzero? (-> this chain-joints v1-4 joint-mod)) + (&+! (-> this chain-joints v1-4 joint-mod) arg0) ) ) - (the-as dig-tether ((method-of-type process-drawable relocate) obj arg0)) + (the-as dig-tether ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for function dig-tether-init-by-other @@ -1210,18 +1210,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-digger-tether-info -(defmethod inspect dig-digger-tether-info ((obj dig-digger-tether-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-digger-tether-info ((this dig-digger-tether-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dig-digger-tether-info) - (format #t "~1Trp: ~D~%" (-> obj rp)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Tbroken-x: ~f~%" (-> obj broken-x)) - (format #t "~1Tbroken-z: ~f~%" (-> obj broken-z)) + (format #t "[~8x] ~A~%" this 'dig-digger-tether-info) + (format #t "~1Trp: ~D~%" (-> this rp)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tbroken-x: ~f~%" (-> this broken-x)) + (format #t "~1Tbroken-z: ~f~%" (-> this broken-z)) (label cfg-4) - obj + this ) ;; definition of type dig-digger @@ -1258,36 +1258,36 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-digger -(defmethod inspect dig-digger ((obj dig-digger)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-digger ((this dig-digger)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Ttethers[24] @ #x~X~%" (-> obj tethers)) - (format #t "~2Tvertical: #~%" (-> obj vertical)) - (format #t "~2Tvertical-rand: #~%" (-> obj vertical-rand)) - (format #t "~2Tstart-y: ~f~%" (-> obj start-y)) - (format #t "~2Ty-offset: #~%" (-> obj y-offset)) - (format #t "~2Ty-offset-kicker: #~%" (-> obj y-offset-kicker)) - (format #t "~2Ttwist: #~%" (-> obj twist)) - (format #t "~2Ttwist-kicker: #~%" (-> obj twist-kicker)) - (format #t "~2Tsmoke-part: ~A~%" (-> obj smoke-part)) - (format #t "~2Tmotor-sound: ~D~%" (-> obj motor-sound)) - (format #t "~2Tbit-sound: ~D~%" (-> obj bit-sound)) - (format #t "~2Tmovie-handle: ~D~%" (-> obj movie-handle)) - (format #t "~2Thud-counter: ~D~%" (-> obj hud-counter)) - (format #t "~2Tspeech-time: ~D~%" (-> obj speech-time)) - (format #t "~2Tspeech-count: ~D~%" (-> obj speech-count)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Ttethers[24] @ #x~X~%" (-> this tethers)) + (format #t "~2Tvertical: #~%" (-> this vertical)) + (format #t "~2Tvertical-rand: #~%" (-> this vertical-rand)) + (format #t "~2Tstart-y: ~f~%" (-> this start-y)) + (format #t "~2Ty-offset: #~%" (-> this y-offset)) + (format #t "~2Ty-offset-kicker: #~%" (-> this y-offset-kicker)) + (format #t "~2Ttwist: #~%" (-> this twist)) + (format #t "~2Ttwist-kicker: #~%" (-> this twist-kicker)) + (format #t "~2Tsmoke-part: ~A~%" (-> this smoke-part)) + (format #t "~2Tmotor-sound: ~D~%" (-> this motor-sound)) + (format #t "~2Tbit-sound: ~D~%" (-> this bit-sound)) + (format #t "~2Tmovie-handle: ~D~%" (-> this movie-handle)) + (format #t "~2Thud-counter: ~D~%" (-> this hud-counter)) + (format #t "~2Tspeech-time: ~D~%" (-> this speech-time)) + (format #t "~2Tspeech-count: ~D~%" (-> this speech-count)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -1298,22 +1298,22 @@ This commonly includes things such as: ) ;; definition for method 22 of type dig-digger -(defmethod dig-digger-method-22 dig-digger ((obj dig-digger) (arg0 int)) - (if (and (> (-> obj actor-group-count) 0) (< arg0 (-> obj actor-group 0 length))) - (-> obj actor-group 0 data arg0 actor) +(defmethod dig-digger-method-22 dig-digger ((this dig-digger) (arg0 int)) + (if (and (> (-> this actor-group-count) 0) (< arg0 (-> this actor-group 0 length))) + (-> this actor-group 0 data arg0 actor) (the-as entity #f) ) ) ;; definition for method 23 of type dig-digger ;; WARN: Return type mismatch int vs none. -(defmethod dig-digger-method-23 dig-digger ((obj dig-digger)) +(defmethod dig-digger-method-23 dig-digger ((this dig-digger)) (dotimes (s5-0 24) - (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj tethers s5-0 rp)))) - (s3-0 (dig-digger-method-22 obj s5-0)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this tethers s5-0 rp)))) + (s3-0 (dig-digger-method-22 this s5-0)) ) - (if (and s3-0 (not (handle->process (-> obj tethers s5-0 handle)))) - (set! (-> obj tethers s5-0 handle) (ppointer->handle (process-spawn dig-tether s4-0 s3-0 :to obj))) + (if (and s3-0 (not (handle->process (-> this tethers s5-0 handle)))) + (set! (-> this tethers s5-0 handle) (ppointer->handle (process-spawn dig-tether s4-0 s3-0 :to this))) ) ) ) @@ -1323,25 +1323,25 @@ This commonly includes things such as: ;; definition for method 24 of type dig-digger ;; WARN: Return type mismatch int vs none. -(defmethod dig-digger-method-24 dig-digger ((obj dig-digger)) - (set! (-> obj vertical target x) 0.0) - (set! (-> obj vertical target z) 0.0) - (let ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> obj vertical)) 1.0)) +(defmethod dig-digger-method-24 dig-digger ((this dig-digger)) + (set! (-> this vertical target x) 0.0) + (set! (-> this vertical target z) 0.0) + (let ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this vertical)) 1.0)) (s5-0 0) ) (dotimes (s3-0 24) - (let* ((s2-0 (-> obj tethers s3-0)) + (let* ((s2-0 (-> this tethers s3-0)) (s1-0 (handle->process (-> s2-0 handle))) ) (cond (s1-0 - (let ((v1-10 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj tethers s3-0 rp))))) - (send-event s1-0 'set-pos v1-10 (-> obj root trans) s4-0) + (let ((v1-10 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this tethers s3-0 rp))))) + (send-event s1-0 'set-pos v1-10 (-> this root trans) s4-0) ) (cond ((send-event s1-0 'broken?) - (+! (-> obj vertical target x) (-> s2-0 broken-x)) - (+! (-> obj vertical target z) (-> s2-0 broken-z)) + (+! (-> this vertical target x) (-> s2-0 broken-x)) + (+! (-> this vertical target z) (-> s2-0 broken-z)) ) (else (+! s5-0 1) @@ -1349,21 +1349,21 @@ This commonly includes things such as: ) ) (else - (+! (-> obj vertical target x) (-> s2-0 broken-x)) - (+! (-> obj vertical target z) (-> s2-0 broken-z)) + (+! (-> this vertical target x) (-> s2-0 broken-x)) + (+! (-> this vertical target z) (-> s2-0 broken-z)) ) ) ) ) (set! (-> *game-info* counter) (the float s5-0)) (when (and (= s5-0 24) - (>= (- (current-time) (-> obj speech-time)) (seconds 20)) + (time-elapsed? (-> this speech-time) (seconds 20)) *target* - (and (>= 409600.0 (vector-vector-distance (-> obj root trans) (-> *target* control trans))) + (and (>= 409600.0 (vector-vector-distance (-> this root trans) (-> *target* control trans))) (not (logtest? (focus-status teleporting) (-> *target* focus-status))) ) ) - (let ((v1-37 (logand (-> obj speech-count) 1))) + (let ((v1-37 (logand (-> this speech-count) 1))) (cond ((zero? v1-37) (talker-spawn-func (-> *talker-speech* 191) *entity-pool* (target-pos 0) (the-as region #f)) @@ -1376,19 +1376,19 @@ This commonly includes things such as: ) ) ) - (set! (-> obj speech-time) (current-time)) - (+! (-> obj speech-count) 1) + (set-time! (-> this speech-time)) + (+! (-> this speech-count) 1) ) (cond ((zero? s5-0) - (send-event (handle->process (-> obj hud-counter)) 'hide-and-die) - (set! (-> obj hud-counter) (the-as handle #f)) - (when (= (-> obj movie-handle) #f) - (set! (-> obj movie-handle) + (send-event (handle->process (-> this hud-counter)) 'hide-and-die) + (set! (-> this hud-counter) (the-as handle #f)) + (when (= (-> this movie-handle) #f) + (set! (-> this movie-handle) (ppointer->handle (process-spawn scene-player :init scene-player-init "dig-digger-explode" #t #f)) ) - (if (handle->process (-> obj movie-handle)) - (cleanup-for-death obj) + (if (handle->process (-> this movie-handle)) + (cleanup-for-death this) ) ) ) @@ -1528,29 +1528,29 @@ This commonly includes things such as: ) ;; definition for method 10 of type dig-digger -(defmethod deactivate dig-digger ((obj dig-digger)) - (if (nonzero? (-> obj smoke-part)) - (kill-and-free-particles (-> obj smoke-part)) +(defmethod deactivate dig-digger ((this dig-digger)) + (if (nonzero? (-> this smoke-part)) + (kill-and-free-particles (-> this smoke-part)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type dig-digger ;; WARN: Return type mismatch process-drawable vs dig-digger. -(defmethod relocate dig-digger ((obj dig-digger) (arg0 int)) - (when (nonzero? (-> obj smoke-part)) - (if (nonzero? (-> obj smoke-part)) - (&+! (-> obj smoke-part) arg0) +(defmethod relocate dig-digger ((this dig-digger) (arg0 int)) + (when (nonzero? (-> this smoke-part)) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) arg0) ) ) - (the-as dig-digger ((method-of-type process-drawable relocate) obj arg0)) + (the-as dig-digger ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type dig-digger ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-digger ((obj dig-digger) (arg0 entity-actor)) +(defmethod init-from-entity! dig-digger ((this dig-digger) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1558,7 +1558,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1649,171 +1649,171 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-34 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-34 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj root pause-adjust-distance) 819200.0) - (process-drawable-from-entity! obj arg0) + (set! (-> this root pause-adjust-distance) 819200.0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-digger" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 1)) - (logior! (-> obj skel status) (joint-control-status sync-math)) + (set! (-> this draw light-index) (the-as uint 1)) + (logior! (-> this skel status) (joint-control-status sync-math)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-46 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-46 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-46 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-46)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-46)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) (dotimes (v1-52 24) - (set! (-> obj tethers v1-52 handle) (the-as handle #f)) + (set! (-> this tethers v1-52 handle) (the-as handle #f)) (let ((a0-77 v1-52)) (cond ((zero? a0-77) - (set! (-> obj tethers v1-52 rp) 18) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) -1.0) + (set! (-> this tethers v1-52 rp) 18) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) -1.0) ) ((= a0-77 1) - (set! (-> obj tethers v1-52 rp) 16) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) -1.0) + (set! (-> this tethers v1-52 rp) 16) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) -1.0) ) ((= a0-77 2) - (set! (-> obj tethers v1-52 rp) 17) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) -1.0) + (set! (-> this tethers v1-52 rp) 17) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) -1.0) ) ((= a0-77 3) - (set! (-> obj tethers v1-52 rp) 24) - (set! (-> obj tethers v1-52 broken-x) -1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 24) + (set! (-> this tethers v1-52 broken-x) -1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 4) - (set! (-> obj tethers v1-52 rp) 22) - (set! (-> obj tethers v1-52 broken-x) -1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 22) + (set! (-> this tethers v1-52 broken-x) -1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 5) - (set! (-> obj tethers v1-52 rp) 23) - (set! (-> obj tethers v1-52 broken-x) -1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 23) + (set! (-> this tethers v1-52 broken-x) -1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 6) - (set! (-> obj tethers v1-52 rp) 6) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) 1.0) + (set! (-> this tethers v1-52 rp) 6) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) 1.0) ) ((= a0-77 7) - (set! (-> obj tethers v1-52 rp) 4) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) 1.0) + (set! (-> this tethers v1-52 rp) 4) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) 1.0) ) ((= a0-77 8) - (set! (-> obj tethers v1-52 rp) 5) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) 1.0) + (set! (-> this tethers v1-52 rp) 5) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) 1.0) ) ((= a0-77 9) - (set! (-> obj tethers v1-52 rp) 12) - (set! (-> obj tethers v1-52 broken-x) 1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 12) + (set! (-> this tethers v1-52 broken-x) 1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 10) - (set! (-> obj tethers v1-52 rp) 10) - (set! (-> obj tethers v1-52 broken-x) 1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 10) + (set! (-> this tethers v1-52 broken-x) 1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 11) - (set! (-> obj tethers v1-52 rp) 11) - (set! (-> obj tethers v1-52 broken-x) 1.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 11) + (set! (-> this tethers v1-52 broken-x) 1.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ((= a0-77 12) - (set! (-> obj tethers v1-52 rp) 25) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 25) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) ((= a0-77 13) - (set! (-> obj tethers v1-52 rp) 26) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 26) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) ((= a0-77 14) - (set! (-> obj tethers v1-52 rp) 27) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 27) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) ((= a0-77 15) - (set! (-> obj tethers v1-52 rp) 19) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 19) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 16) - (set! (-> obj tethers v1-52 rp) 21) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 21) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 17) - (set! (-> obj tethers v1-52 rp) 20) - (set! (-> obj tethers v1-52 broken-x) -0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 20) + (set! (-> this tethers v1-52 broken-x) -0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 18) - (set! (-> obj tethers v1-52 rp) 14) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 14) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 19) - (set! (-> obj tethers v1-52 rp) 13) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 13) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 20) - (set! (-> obj tethers v1-52 rp) 15) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) -0.707) + (set! (-> this tethers v1-52 rp) 15) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) -0.707) ) ((= a0-77 21) - (set! (-> obj tethers v1-52 rp) 8) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 8) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) ((= a0-77 22) - (set! (-> obj tethers v1-52 rp) 7) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 7) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) ((= a0-77 23) - (set! (-> obj tethers v1-52 rp) 9) - (set! (-> obj tethers v1-52 broken-x) 0.707) - (set! (-> obj tethers v1-52 broken-z) 0.707) + (set! (-> this tethers v1-52 rp) 9) + (set! (-> this tethers v1-52 broken-x) 0.707) + (set! (-> this tethers v1-52 broken-z) 0.707) ) (else - (set! (-> obj tethers v1-52 rp) 3) - (set! (-> obj tethers v1-52 broken-x) 0.0) - (set! (-> obj tethers v1-52 broken-z) 0.0) + (set! (-> this tethers v1-52 rp) 3) + (set! (-> this tethers v1-52 broken-x) 0.0) + (set! (-> this tethers v1-52 broken-z) 0.0) ) ) ) ) - (set! (-> obj start-y) (-> obj root trans y)) - (set! (-> obj smoke-part) (create-launch-control (-> *part-group-id-table* 1143) obj)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1144) obj)) - (set! (-> obj motor-sound) (new 'static 'sound-id)) - (set! (-> obj bit-sound) (new 'static 'sound-id)) - (set! (-> obj movie-handle) (the-as handle #f)) - (set! (-> obj hud-counter) (ppointer->handle (process-spawn hud-dig-clasp :init hud-init-by-other :to obj))) - (go (method-of-object obj idle)) + (set! (-> this start-y) (-> this root trans y)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 1143) this)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1144) this)) + (set! (-> this motor-sound) (new 'static 'sound-id)) + (set! (-> this bit-sound) (new 'static 'sound-id)) + (set! (-> this movie-handle) (the-as handle #f)) + (set! (-> this hud-counter) (ppointer->handle (process-spawn hud-dig-clasp :init hud-init-by-other :to this))) + (go (method-of-object this idle)) (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 9fcf94562a..ad2eb4828c 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-obs_REF.gc @@ -19,24 +19,24 @@ ) ;; definition for method 3 of type dig-sinking-plat -(defmethod inspect dig-sinking-plat ((obj dig-sinking-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-sinking-plat ((this dig-sinking-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanchor-point: #~%" (-> obj anchor-point)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tlast-ridden-time: ~D~%" (-> obj last-ridden-time)) - (format #t "~2Tprev-pos: ~f~%" (-> obj prev-pos)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tsurface-height: ~f~%" (-> obj surface-height)) - (format #t "~2Tonce: ~A~%" (-> obj once)) - (format #t "~2Tbubbling-sound-id: ~D~%" (-> obj bubbling-sound-id)) + (format #t "~2Tanchor-point: #~%" (-> this anchor-point)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tlast-ridden-time: ~D~%" (-> this last-ridden-time)) + (format #t "~2Tprev-pos: ~f~%" (-> this prev-pos)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tsurface-height: ~f~%" (-> this surface-height)) + (format #t "~2Tonce: ~A~%" (-> this once)) + (format #t "~2Tbubbling-sound-id: ~D~%" (-> this bubbling-sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -47,17 +47,17 @@ ;; 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 ((obj dig-sinking-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method dig-sinking-plat 29)) obj arg0) - (rigid-body-platform-method-56 obj (-> obj anchor-point)) +(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) + (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) ) ;; definition for method 32 of type dig-sinking-plat ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape dig-sinking-plat ((obj dig-sinking-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape dig-sinking-plat ((this dig-sinking-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -79,7 +79,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -120,65 +120,65 @@ ) ;; definition for method 53 of type dig-sinking-plat -(defmethod rigid-body-platform-method-53 dig-sinking-plat ((obj dig-sinking-plat) (arg0 vector)) - (-> obj surface-height) +(defmethod rigid-body-platform-method-53 dig-sinking-plat ((this dig-sinking-plat) (arg0 vector)) + (-> this surface-height) ) ;; definition for method 37 of type dig-sinking-plat -(defmethod rigid-body-object-method-37 dig-sinking-plat ((obj dig-sinking-plat)) - (when (not (logtest? (-> obj path flags) (path-control-flag not-found))) - (set! (-> obj prev-pos) (-> obj path-pos)) - (set! (-> obj path-pos) (get-norm! (-> obj sync) 0)) - (when (< (-> obj path-pos) (-> obj prev-pos)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) +(defmethod rigid-body-object-method-37 dig-sinking-plat ((this dig-sinking-plat)) + (when (not (logtest? (-> this path flags) (path-control-flag not-found))) + (set! (-> this prev-pos) (-> this path-pos)) + (set! (-> this path-pos) (get-norm! (-> this sync) 0)) + (when (< (-> this path-pos) (-> this prev-pos)) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) 1.0) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-seek!) ) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group frames num-frames) -1))) (set! (-> a0-3 param 1) 1.0) (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) ) ) - (let ((f30-0 (/ 300.0 (the float (-> obj sync period))))) + (let ((f30-0 (/ 300.0 (the float (-> this sync period))))) (let* ((f0-12 (/ 1.0 (- 1.0 (* 2.0 f30-0)))) - (f0-13 (* (fmax 0.0 (- (-> obj path-pos) f30-0)) f0-12)) + (f0-13 (* (fmax 0.0 (- (-> this path-pos) f30-0)) f0-12)) ) - (get-point-at-percent-along-path! (-> obj path) (-> obj anchor-point) f0-13 'interp) + (get-point-at-percent-along-path! (-> this path) (-> this anchor-point) f0-13 'interp) ) (cond - ((< (-> obj path-pos) f30-0) - (set! (-> obj float-height-offset) (* -8192.0 (/ (- f30-0 (-> obj path-pos)) f30-0))) + ((< (-> this path-pos) f30-0) + (set! (-> this float-height-offset) (* -8192.0 (/ (- f30-0 (-> this path-pos)) f30-0))) ) - ((< (- 1.0 (* 2.0 f30-0)) (-> obj path-pos)) + ((< (- 1.0 (* 2.0 f30-0)) (-> this path-pos)) (cond - ((< (- 1.0 f30-0) (-> obj path-pos)) - (set! (-> obj float-height-offset) (* -8192.0 (/ (- (-> obj path-pos) (- 1.0 f30-0)) f30-0))) - (let ((a0-5 (-> obj skel root-channel 0))) + ((< (- 1.0 f30-0) (-> this path-pos)) + (set! (-> this float-height-offset) (* -8192.0 (/ (- (-> this path-pos) (- 1.0 f30-0)) f30-0))) + (let ((a0-5 (-> this skel root-channel 0))) (set! (-> a0-5 param 0) (the float (+ (-> a0-5 frame-group frames num-frames) -1))) (set! (-> a0-5 param 1) 1.0) (joint-control-channel-group-eval! a0-5 (the-as art-joint-anim #f) num-func-seek!) ) ) (else - (when (-> obj once) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (when (-> this once) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) 1.0) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-seek!) ) - (set! (-> obj once) #f) + (set! (-> this once) #f) ) - (let ((a0-7 (-> obj skel root-channel 0))) + (let ((a0-7 (-> this skel root-channel 0))) (set! (-> a0-7 param 0) (the float (+ (-> a0-7 frame-group frames num-frames) -1))) (set! (-> a0-7 param 1) 1.0) (joint-control-channel-group-eval! a0-7 (the-as art-joint-anim #f) num-func-seek!) @@ -187,53 +187,53 @@ ) ) (else - (set! (-> obj float-height-offset) 0.0) + (set! (-> this float-height-offset) 0.0) ) ) ) ) (cond - ((>= (- (current-time) (-> obj last-ridden-time)) (seconds 0.5)) - (when (nonzero? (-> obj bubbling-sound-id)) + ((time-elapsed? (-> this last-ridden-time) (seconds 0.5)) + (when (nonzero? (-> this bubbling-sound-id)) (let ((v1-84 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-84 command) (sound-command set-param)) - (set! (-> v1-84 id) (-> obj bubbling-sound-id)) + (set! (-> v1-84 id) (-> this bubbling-sound-id)) (set! (-> v1-84 params volume) -4) (set! (-> v1-84 auto-time) 120) (set! (-> v1-84 auto-from) 2) (set! (-> v1-84 params mask) (the-as uint 17)) (-> v1-84 id) ) - (set! (-> obj bubbling-sound-id) (new 'static 'sound-id)) + (set! (-> this bubbling-sound-id) (new 'static 'sound-id)) 0 ) ) (else - (if (zero? (-> obj bubbling-sound-id)) - (set! (-> obj bubbling-sound-id) (sound-play "lava-plat-sink")) + (if (zero? (-> this bubbling-sound-id)) + (set! (-> this bubbling-sound-id) (sound-play "lava-plat-sink")) ) ) ) - ((method-of-type rigid-body-platform rigid-body-object-method-37) obj) + ((method-of-type rigid-body-platform rigid-body-object-method-37) this) (none) ) ;; definition for method 56 of type dig-sinking-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-56 dig-sinking-plat ((obj dig-sinking-plat) (arg0 vector)) - (when (not (logtest? (-> obj path flags) (path-control-flag not-found))) +(defmethod rigid-body-platform-method-56 dig-sinking-plat ((this dig-sinking-plat) (arg0 vector)) + (when (not (logtest? (-> this path flags) (path-control-flag not-found))) (let ((v1-4 (new 'stack-no-clear 'vector))) (cond - ((< (-> obj prev-pos) (-> obj path-pos)) - (vector-! v1-4 arg0 (-> obj rbody state position)) + ((< (-> this prev-pos) (-> this path-pos)) + (vector-! v1-4 arg0 (-> this rbody state position)) (set! (-> v1-4 y) 0.0) (let* ((f0-2 (vector-length v1-4)) (f1-2 (* 1000.0 (fmax 0.0 (fmin 4096.0 (+ -4096.0 f0-2))))) ) (when (< 0.0 f1-2) (vector-float*! v1-4 v1-4 (/ f1-2 f0-2)) - (rigid-body-method-20 (-> obj rbody state) v1-4) + (rigid-body-method-20 (-> this rbody state) v1-4) ) ) ) @@ -241,13 +241,13 @@ (let ((v1-5 (new 'stack-no-clear 'vector))) (set! (-> v1-5 quad) (-> arg0 quad)) (+! (-> v1-5 y) -8192.0) - (let ((a0-16 (-> obj rbody)) - (a2-2 (-> obj root quat)) + (let ((a0-16 (-> this rbody)) + (a2-2 (-> this root quat)) ) (rigid-body-method-26 (-> a0-16 state) v1-5 a2-2) ) ) - (set! (-> obj once) (the-as basic #t)) + (set! (-> this once) (the-as basic #t)) ) ) ) @@ -262,7 +262,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('ridden) - (set! (-> self last-ridden-time) (current-time)) + (set-time! (-> self last-ridden-time)) ) ) (rigid-body-object-event-handler proc argc message block) @@ -278,18 +278,18 @@ ;; definition for method 33 of type dig-sinking-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body dig-sinking-plat ((obj dig-sinking-plat)) +(defmethod init-skel-and-rigid-body dig-sinking-plat ((this dig-sinking-plat)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-sinking-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *dig-sinking-platform-constants*) - (set! (-> obj anchor-point quad) (-> obj root trans quad)) - (set! (-> obj surface-height) (+ -4096.0 (-> obj root trans y))) - (let ((s5-1 (-> obj info control-point-count))) + (alloc-and-init-rigid-body-control this *dig-sinking-platform-constants*) + (set! (-> this anchor-point quad) (-> this root trans quad)) + (set! (-> this surface-height) (+ -4096.0 (-> this root trans y))) + (let ((s5-1 (-> this info control-point-count))) (dotimes (s4-1 s5-1) - (let ((s3-0 (-> obj control-point-array data s4-1))) + (let ((s3-0 (-> this control-point-array data s4-1))) (let ((f30-0 (* 65536.0 (/ (the float s4-1) (the float s5-1))))) (set! (-> s3-0 local-pos x) (* 16384.0 (sin f30-0))) (set! (-> s3-0 local-pos y) -8192.0) @@ -299,11 +299,11 @@ ) ) ) - (let ((s5-2 (-> obj entity))) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 s5-2 #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (let ((s5-2 (-> this entity))) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 s5-2 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-5 (new 'stack-no-clear 'sync-info-params))) (let ((v1-25 0)) @@ -316,11 +316,11 @@ (set! (-> a1-5 entity) s5-2) (set! (-> a1-5 period) (the-as uint 3000)) (set! (-> a1-5 percent) 0.0) - (initialize! (-> obj sync) a1-5) + (initialize! (-> this sync) a1-5) ) ) - (set! (-> obj bubbling-sound-id) (new 'static 'sound-id)) - (set! (-> obj once) (the-as basic #t)) + (set! (-> this bubbling-sound-id) (new 'static 'sound-id)) + (set! (-> this once) (the-as basic #t)) 0 (none) ) @@ -469,16 +469,16 @@ ) ;; definition for method 3 of type dig-log-button-info -(defmethod inspect dig-log-button-info ((obj dig-log-button-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-log-button-info ((this dig-log-button-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcam-ret-mode: ~A~%" (-> obj cam-ret-mode)) - (format #t "~1Tcam-ret-dir: #~%" (-> obj cam-ret-dir)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcam-ret-mode: ~A~%" (-> this cam-ret-mode)) + (format #t "~1Tcam-ret-dir: #~%" (-> this cam-ret-dir)) (label cfg-4) - obj + this ) ;; definition for symbol *dig-log-button-infos*, type (array dig-log-button-info) @@ -534,22 +534,22 @@ ) ;; definition for method 3 of type dig-log -(defmethod inspect dig-log ((obj dig-log)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-log ((this dig-log)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpressed-count: ~D~%" (-> obj pressed-count)) - (format #t "~2Ttotal-buttons: ~D~%" (-> obj total-buttons)) - (format #t "~2Tlast-button-id: ~D~%" (-> obj last-button-id)) - (format #t "~2Tbase-y: ~f~%" (-> obj base-y)) - (format #t "~2Thud-handle: ~D~%" (-> obj hud-handle)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) + (format #t "~2Tpressed-count: ~D~%" (-> this pressed-count)) + (format #t "~2Ttotal-buttons: ~D~%" (-> this total-buttons)) + (format #t "~2Tlast-button-id: ~D~%" (-> this last-button-id)) + (format #t "~2Tbase-y: ~f~%" (-> this base-y)) + (format #t "~2Thud-handle: ~D~%" (-> this hud-handle)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -584,30 +584,30 @@ ) ;; definition for method 12 of type dig-log -(defmethod run-logic? dig-log ((obj dig-log)) +(defmethod run-logic? dig-log ((this dig-log)) #t ) ;; definition for method 22 of type dig-log ;; WARN: Return type mismatch int vs symbol. ;; WARN: disable def twice: 16. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod dig-log-method-22 dig-log ((obj dig-log) (arg0 symbol)) +(defmethod dig-log-method-22 dig-log ((this dig-log) (arg0 symbol)) (the-as symbol (cond (arg0 - (when (!= (-> obj pressed-count) (-> obj total-buttons)) - (when (not (handle->process (-> obj hud-handle))) - (let ((v0-0 (ppointer->handle (process-spawn hud-dig-button :init hud-init-by-other :to obj)))) - (set! (-> obj hud-handle) (the-as handle v0-0)) + (when (!= (-> this pressed-count) (-> this total-buttons)) + (when (not (handle->process (-> this hud-handle))) + (let ((v0-0 (ppointer->handle (process-spawn hud-dig-button :init hud-init-by-other :to this)))) + (set! (-> this hud-handle) (the-as handle v0-0)) v0-0 ) ) ) ) (else - (send-event (handle->process (-> obj hud-handle)) 'hide-and-die) - (set! (-> obj hud-handle) (the-as handle #f)) + (send-event (handle->process (-> this hud-handle)) 'hide-and-die) + (set! (-> this hud-handle) (the-as handle #f)) (the-as int #f) ) ) @@ -640,8 +640,8 @@ ) (s5-0 (add-process *gui-control* self (gui-channel jak) (gui-action queue) t0-0 -99.0 0)) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.15)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.15)) (suspend) ) (until v1-12 @@ -651,8 +651,8 @@ (while (!= (get-status *gui-control* s5-0) (gui-status ready)) (suspend) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) (set-setting! 'entity-name "camera-249" 0.0 0) @@ -667,8 +667,8 @@ (the-as process #f) ) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) (let ((f30-0 @@ -700,8 +700,8 @@ (suspend) ) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (if (= (-> gp-0 cam-ret-mode) 'instant) @@ -710,22 +710,22 @@ (set-setting! 'string-startup-vector 'abs (-> gp-0 cam-ret-dir) 0) (remove-setting! 'entity-name) (when (!= (-> gp-0 cam-ret-mode) 'instant) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) ) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.1)) (suspend) ) (remove-setting! 'string-startup-vector) (until (process-release? *target*) (suspend) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 4)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 4)) (suspend) ) (go-virtual idle) @@ -736,7 +736,7 @@ ;; definition for method 11 of type dig-log ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-log ((obj dig-log) (arg0 entity-actor)) +(defmethod init-from-entity! dig-log ((this dig-log) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -744,8 +744,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj hud-handle) (the-as handle #f)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this hud-handle) (the-as handle #f)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -761,28 +761,28 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj base-y) (-> obj root trans y)) + (process-drawable-from-entity! this arg0) + (set! (-> this base-y) (-> this root trans y)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-log" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj pressed-count) 0) - (set! (-> obj total-buttons) 0) + (set! (-> this pressed-count) 0) + (set! (-> this total-buttons) 0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-19 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-19 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (when (and v1-19 (nonzero? (-> sv-16 elt-count))) (let ((s5-2 (-> v1-19 0))) (countdown (s4-2 (-> s5-2 length)) (let ((s3-1 (-> s5-2 data s4-2 actor))) (when s3-1 - (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector s3-1) 0) - (+! (-> obj total-buttons) 1) + (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector s3-1) 0) + (+! (-> this total-buttons) 1) (if (logtest? (-> s3-1 extra perm status) (entity-perm-status subtask-complete)) - (+! (-> obj pressed-count) 1) + (+! (-> this pressed-count) 1) ) ) ) @@ -791,21 +791,21 @@ This commonly includes things such as: ) ) (if (task-node-closed? (game-task-node dig-find-totem-raise-log)) - (set! (-> obj pressed-count) (-> obj total-buttons)) + (set! (-> this pressed-count) (-> this total-buttons)) ) - (set! (-> obj root trans y) - (+ (-> (&-> *dig-log-heights* 0 data (- (-> obj total-buttons) (-> obj pressed-count))) 0) (-> obj base-y)) + (set! (-> this root trans y) + (+ (-> (&-> *dig-log-heights* 0 data (- (-> this total-buttons) (-> this pressed-count))) 0) (-> this base-y)) ) (transform-post) - (when (!= (-> obj pressed-count) (-> obj total-buttons)) - (set! (-> *game-info* counter) (the float (- (-> obj total-buttons) (-> obj pressed-count)))) + (when (!= (-> this pressed-count) (-> this total-buttons)) + (set! (-> *game-info* counter) (the float (- (-> this total-buttons) (-> this pressed-count)))) (if (string= (-> *game-info* last-continue name) "dig3b-back-room") - (dig-log-method-22 obj #t) + (dig-log-method-22 this #t) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1145) obj)) - (set! (-> obj event-hook) dig-log-event-handler) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1145) this)) + (set! (-> this event-hook) dig-log-event-handler) + (go (method-of-object this idle)) (none) ) @@ -825,17 +825,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-button -(defmethod inspect dig-button ((obj dig-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-button ((this dig-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tdown-y: ~f~%" (-> obj down-y)) + (format #t "~2Tdown-y: ~f~%" (-> this down-y)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -845,7 +845,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type dig-button -(defmethod run-logic? dig-button ((obj dig-button)) +(defmethod run-logic? dig-button ((this dig-button)) #t ) @@ -906,14 +906,14 @@ This commonly includes things such as: ;; definition for method 11 of type dig-button ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-button ((obj dig-button) (arg0 entity-actor)) +(defmethod init-from-entity! dig-button ((this dig-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -928,64 +928,64 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj down-y) (+ -2048.0 (-> obj root trans y))) + (set! (-> this down-y) (+ -2048.0 (-> this root trans y))) (if (task-node-closed? (game-task-node dig-find-totem-raise-log)) - (process-entity-status! obj (entity-perm-status subtask-complete) #t) + (process-entity-status! this (entity-perm-status subtask-complete) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj idle-down)) - (go (method-of-object obj idle-up)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this idle-down)) + (go (method-of-object this idle-up)) ) (none) ) ;; definition for method 15 of type hud-dig-button ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-dig-button ((obj hud-dig-button)) +(defmethod draw hud-dig-button ((this hud-dig-button)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 487.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 487.0 (* 130.0 (-> this offset)))) 210 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -16 20) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 20) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-dig-button ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-dig-button ((obj hud-dig-button)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-dig-button ((this hud-dig-button)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-dig-button ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-dig-button ((obj hud-dig-button)) - (set! (-> obj level) (level-get *level* 'dig3a)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd21))) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-dig-button ((this hud-dig-button)) + (set! (-> this level) (level-get *level* 'dig3a)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd21))) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/dig/dig-part_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig-part_REF.gc index 44fc7ab7dc..0eafdbe846 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type dig-part -(defmethod inspect dig-part ((obj dig-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-part ((this dig-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc index 84fe4fc73b..abc33b9f57 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig1-obs_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type dig-conveyor -(defmethod inspect dig-conveyor ((obj dig-conveyor)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-conveyor ((this dig-conveyor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type conveyor inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -33,17 +33,17 @@ ;; definition for method 24 of type dig-conveyor ;; WARN: Return type mismatch int vs none. -(defmethod init! dig-conveyor ((obj dig-conveyor)) +(defmethod init! dig-conveyor ((this dig-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj speed) 30720.0) - (set! (-> obj belt-radius) 15974.4) - (set! (-> obj pull-y-threshold) 10240.0) - (set! (-> obj draw light-index) (the-as uint 2)) + (set! (-> this speed) 30720.0) + (set! (-> this belt-radius) 15974.4) + (set! (-> this pull-y-threshold) 10240.0) + (set! (-> this draw light-index) (the-as uint 2)) (none) ) ;; definition for method 22 of type dig-conveyor -(defmethod get-art-group dig-conveyor ((obj dig-conveyor)) +(defmethod get-art-group dig-conveyor ((this dig-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-dig-conveyor" (the-as (pointer uint32) #f)) ) @@ -378,19 +378,19 @@ ) ;; definition for method 3 of type dig-bomb-crate-cylinder -(defmethod inspect dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type rigid-body-object inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tflash-counter: ~D~%" (-> obj flash-counter)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Twait-time: ~D~%" (-> obj wait-time)) + (format #t "~2Tflash-counter: ~D~%" (-> this flash-counter)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Twait-time: ~D~%" (-> this wait-time)) (label cfg-4) - obj + this ) ;; definition of type dig-bomb-crate-cylinder-spawn-params @@ -406,18 +406,18 @@ ) ;; definition for method 3 of type dig-bomb-crate-cylinder-spawn-params -(defmethod inspect dig-bomb-crate-cylinder-spawn-params ((obj dig-bomb-crate-cylinder-spawn-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-bomb-crate-cylinder-spawn-params ((this dig-bomb-crate-cylinder-spawn-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'dig-bomb-crate-cylinder-spawn-params) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tvel: #~%" (-> obj vel)) - (format #t "~1Tavel: #~%" (-> obj avel)) - (format #t "~1Tquat: #~%" (-> obj quat)) + (format #t "[~8x] ~A~%" this 'dig-bomb-crate-cylinder-spawn-params) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tvel: #~%" (-> this vel)) + (format #t "~1Tavel: #~%" (-> this avel)) + (format #t "~1Tquat: #~%" (-> this quat)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -517,7 +517,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (suspend) ) ) @@ -528,7 +528,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.5)) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -540,7 +540,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.5)) + (until (time-elapsed? gp-3 (seconds 0.5)) (suspend) ) ) @@ -551,7 +551,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.25)) + (until (time-elapsed? gp-4 (seconds 0.25)) (suspend) ) ) @@ -562,7 +562,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((gp-5 (current-time))) - (until (>= (- (current-time) gp-5) (seconds 0.125)) + (until (time-elapsed? gp-5 (seconds 0.125)) (suspend) ) ) @@ -574,7 +574,7 @@ ) (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek!) :frame-num 0.0) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 0.05)) + (until (time-elapsed? s5-0 (seconds 0.05)) (suspend) ) ) @@ -616,20 +616,20 @@ ) ;; definition for method 46 of type dig-bomb-crate-cylinder -(defmethod rigid-body-object-method-46 dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod rigid-body-object-method-46 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('track) #t ) (else - ((method-of-type rigid-body-object rigid-body-object-method-46) obj arg0 arg1 arg2 arg3) + ((method-of-type rigid-body-object rigid-body-object-method-46) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 47 of type dig-bomb-crate-cylinder ;; WARN: Return type mismatch object vs symbol. -(defmethod rigid-body-object-method-47 dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder) +(defmethod rigid-body-object-method-47 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) (arg0 process-drawable) (arg1 attack-info) (arg2 touching-shapes-entry) @@ -641,13 +641,13 @@ ((logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot enemy-yellow-shot enemy-dark-shot) arg3 ) - (go (method-of-object obj die)) + (go (method-of-object this die)) ) (else (if (logtest? (penetrate explode) arg3) (set! arg3 (penetrate spin)) ) - ((method-of-type rigid-body-object rigid-body-object-method-47) obj arg0 arg1 arg2 (the-as penetrate arg3)) + ((method-of-type rigid-body-object rigid-body-object-method-47) this arg0 arg1 arg2 (the-as penetrate arg3)) ) ) ) @@ -655,12 +655,12 @@ ;; definition for method 45 of type dig-bomb-crate-cylinder ;; WARN: Return type mismatch sound-id vs none. -(defmethod rigid-body-object-method-45 dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder) (arg0 rigid-body-impact)) (let* ((f0-0 (-> arg0 impulse)) (f1-0 28672.0) - (f30-0 (* f0-0 (/ 1.0 f1-0) (-> obj info info inv-mass))) + (f30-0 (* f0-0 (/ 1.0 f1-0) (-> this info info inv-mass))) ) - (if (< (* 28672.0 (-> obj info info mass)) (-> arg0 impulse)) + (if (< (* 28672.0 (-> this info info mass)) (-> arg0 impulse)) (sound-play-by-name (static-sound-name "barrel-bomb-hit") (new-sound-id) @@ -668,7 +668,7 @@ 0 0 (sound-group sfx) - (-> obj root trans) + (-> this root trans) ) ) ) @@ -678,14 +678,14 @@ ;; definition for method 37 of type dig-bomb-crate-cylinder ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-37 dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder)) +(defmethod rigid-body-object-method-37 dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-0 start-pos quad) (-> obj rbody state position quad)) - (vector-float*! (-> a1-0 move-dist) (-> obj rbody state lin-velocity) (seconds-per-frame)) + (set! (-> a1-0 start-pos quad) (-> this rbody state position quad)) + (vector-float*! (-> a1-0 move-dist) (-> this rbody state lin-velocity) (seconds-per-frame)) (let ((v1-3 a1-0)) - (set! (-> v1-3 radius) (+ 4096.0 (-> obj root root-prim local-sphere w))) - (set! (-> v1-3 collide-with) (-> obj root root-prim prim-core collide-with)) - (set! (-> v1-3 ignore-process0) obj) + (set! (-> v1-3 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) + (set! (-> v1-3 collide-with) (-> this root root-prim prim-core collide-with)) + (set! (-> v1-3 ignore-process0) this) (set! (-> v1-3 ignore-process1) #f) (set! (-> v1-3 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-3 action-mask) (collide-action solid)) @@ -695,16 +695,16 @@ (if *display-collide-cache* (debug-draw *collide-cache*) ) - (rigid-body-object-method-30 obj) - (set! (-> obj root transv quad) (-> obj rbody state lin-velocity quad)) - (quaternion-copy! (-> obj root quat) (-> obj rbody state rotation)) - (rigid-body-method-24 (-> obj rbody state)) - (let ((v1-19 (-> obj rbody)) - (a1-2 (-> obj root trans)) + (rigid-body-object-method-30 this) + (set! (-> this root transv quad) (-> this rbody state lin-velocity quad)) + (quaternion-copy! (-> this root quat) (-> this rbody state rotation)) + (rigid-body-method-24 (-> this rbody state)) + (let ((v1-19 (-> this rbody)) + (a1-2 (-> this root trans)) ) (rigid-body-method-23 (-> v1-19 state) a1-2) ) - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) (transform-post) 0 (none) @@ -712,8 +712,8 @@ ;; definition for method 32 of type dig-bomb-crate-cylinder ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -755,7 +755,7 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -763,19 +763,19 @@ ;; definition for method 33 of type dig-bomb-crate-cylinder ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body dig-bomb-crate-cylinder ((obj dig-bomb-crate-cylinder)) +(defmethod init-skel-and-rigid-body dig-bomb-crate-cylinder ((this dig-bomb-crate-cylinder)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-bomb-crate-cylinder" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *dig-bomb-crate-cylinder-constants*) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-collision)) - (set! (-> obj draw light-index) (the-as uint 10)) + (alloc-and-init-rigid-body-control this *dig-bomb-crate-cylinder-constants*) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this rbody state flags) (rigid-body-flag enable-collision)) + (set! (-> this draw light-index) (the-as uint 10)) 0 (none) ) @@ -817,16 +817,16 @@ ) ;; definition for method 3 of type dig-bomb-crate -(defmethod inspect dig-bomb-crate ((obj dig-bomb-crate)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-bomb-crate ((this dig-bomb-crate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -877,8 +877,8 @@ ;; definition for method 29 of type dig-bomb-crate ;; WARN: Return type mismatch int vs none. -(defmethod dig-bomb-crate-method-29 dig-bomb-crate ((obj dig-bomb-crate) (arg0 vector)) - (let ((s4-0 (-> obj root trans))) +(defmethod dig-bomb-crate-method-29 dig-bomb-crate ((this dig-bomb-crate) (arg0 vector)) + (let ((s4-0 (-> this root trans))) (dotimes (s3-0 8) (let ((a0-2 (-> *dig-bomb-crate-array* s3-0)) (s2-0 (new 'stack-no-clear 'dig-bomb-crate-cylinder-spawn-params)) @@ -894,7 +894,7 @@ (dig-bomb-crate-cylinder-spawn *entity-pool* (the-as dig-bomb-crate-cylinder-spawn-params (-> s2-0 pos)) - (-> obj entity) + (-> this entity) ) ) ) @@ -904,10 +904,10 @@ ) ;; definition for method 20 of type dig-bomb-crate -(defmethod get-trans dig-bomb-crate ((obj dig-bomb-crate) (arg0 int)) +(defmethod get-trans dig-bomb-crate ((this dig-bomb-crate) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (v0-0 vector)) - (let ((v1-0 (-> obj root))) + (let ((v1-0 (-> this root))) (case arg0 ((2 3) (set! v0-0 (new 'static 'vector)) @@ -991,7 +991,7 @@ ) (suspend) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 4)) + (until (time-elapsed? gp-2 (seconds 4)) (suspend) ) ) @@ -1001,14 +1001,14 @@ ;; definition for method 11 of type dig-bomb-crate ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-bomb-crate ((obj dig-bomb-crate) (arg0 entity-actor)) +(defmethod init-from-entity! dig-bomb-crate ((this dig-bomb-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate generic-attack @@ -1042,17 +1042,17 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-6 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-6 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-bomb-crate" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask enemy)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1072,23 +1072,23 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-jump-pad -(defmethod inspect dig-jump-pad ((obj dig-jump-pad)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-jump-pad ((this dig-jump-pad)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bouncer inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 23 of type dig-jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod init-skeleton! dig-jump-pad ((obj dig-jump-pad)) +(defmethod init-skeleton! dig-jump-pad ((this dig-jump-pad)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-jump-pad" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1098,9 +1098,9 @@ This commonly includes things such as: ;; definition for method 24 of type dig-jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 dig-jump-pad ((obj dig-jump-pad)) +(defmethod bouncer-method-24 dig-jump-pad ((this dig-jump-pad)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) @@ -1128,7 +1128,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc b/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc index 909093b32e..9764868826 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig2-obs_REF.gc @@ -17,19 +17,19 @@ ) ;; definition for method 3 of type dig-breakable-door -(defmethod inspect dig-breakable-door ((obj dig-breakable-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-breakable-door ((this dig-breakable-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tart-name: ~A~%" (-> obj art-name)) - (format #t "~2Tcollide-mesh: ~D~%" (-> obj collide-mesh)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) + (format #t "~2Tcollide-mesh: ~D~%" (-> this collide-mesh)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -54,17 +54,17 @@ ;; definition for method 11 of type dig-breakable-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-breakable-door ((obj dig-breakable-door) (arg0 entity-actor)) +(defmethod init-from-entity! dig-breakable-door ((this dig-breakable-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (let ((s4-0 (art-group-get-by-name *level* "skel-dig-breakable-door" (the-as (pointer uint32) #f)))) - (let ((s3-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-7 (new 'process 'collide-shape-prim-mesh s3-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list)) @@ -79,11 +79,11 @@ This commonly includes things such as: (set! (-> s3-0 backup-collide-as) (-> v1-10 prim-core collide-as)) (set! (-> s3-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) - (set! (-> obj root) s3-0) + (set! (-> this root) s3-0) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (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 c3461cd4bc..e6b86f2daf 100644 --- a/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/dig/dig3-obs_REF.gc @@ -260,22 +260,22 @@ ) ;; definition for method 3 of type dig-spikey-step -(defmethod inspect dig-spikey-step ((obj dig-spikey-step)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-spikey-step ((this dig-spikey-step)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsmush: #~%" (-> obj smush)) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Tshudder-angle: ~f~%" (-> obj shudder-angle)) - (format #t "~2Trot-angle: ~f~%" (-> obj rot-angle)) - (format #t "~2Tcycle-time: ~f~%" (-> obj cycle-time)) - (format #t "~2Tcycle-offset: ~f~%" (-> obj cycle-offset)) + (format #t "~2Tsmush: #~%" (-> this smush)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tshudder-angle: ~f~%" (-> this shudder-angle)) + (format #t "~2Trot-angle: ~f~%" (-> this rot-angle)) + (format #t "~2Tcycle-time: ~f~%" (-> this cycle-time)) + (format #t "~2Tcycle-offset: ~f~%" (-> this cycle-offset)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -290,20 +290,20 @@ :trans rider-trans :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (the int (-> self cycle-offset))) + (until (time-elapsed? gp-0 (the int (-> self cycle-offset))) (suspend) ) ) (until #f (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (the int (-> self cycle-time))) + (until (time-elapsed? gp-1 (the int (-> self cycle-time))) (suspend) ) ) (activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock)) (sound-play "spikey-shake" :position (-> self root trans)) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.75)) + (until (time-elapsed? gp-3 (seconds 0.75)) (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))) (suspend) ) @@ -311,7 +311,7 @@ (set! (-> self shudder-angle) 0.0) (set-zero! (-> self smush)) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.25)) + (until (time-elapsed? gp-4 (seconds 0.25)) (suspend) ) ) @@ -320,7 +320,7 @@ (f30-1 (* 65536.0 f0-7)) (gp-6 (current-time)) ) - (until (>= (- (current-time) gp-6) (seconds 1)) + (until (time-elapsed? gp-6 (seconds 1)) (set! (-> self rot-angle) (the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48)) ) @@ -357,7 +357,7 @@ ;; definition for method 11 of type dig-spikey-step ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-spikey-step ((obj dig-spikey-step) (arg0 entity-actor)) +(defmethod init-from-entity! dig-spikey-step ((this dig-spikey-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -365,7 +365,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 int)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -381,15 +381,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-spikey-step" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) + (quaternion-copy! (-> this init-quat) (-> this root quat)) (let ((f28-0 4.0) (f30-0 0.0) ) @@ -400,10 +400,10 @@ This commonly includes things such as: (set! f30-0 (-> v1-20 1)) ) ) - (set! (-> obj cycle-time) (the float (max 0 (+ (the int (* 300.0 f28-0)) -525)))) - (set! (-> obj cycle-offset) (the float (the int (* 300.0 f30-0)))) + (set! (-> this cycle-time) (the float (max 0 (+ (the int (* 300.0 f28-0)) -525)))) + (set! (-> this cycle-offset) (the float (the int (* 300.0 f30-0)))) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -419,18 +419,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-spikey-sphere -(defmethod inspect dig-spikey-sphere ((obj dig-spikey-sphere)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-spikey-sphere ((this dig-spikey-sphere)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile-bounce inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tdeath-height: ~f~%" (-> obj pad-i1hb23h1b)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tdeath-height: ~f~%" (-> this pad-i1hb23h1b)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -492,7 +492,7 @@ This commonly includes things such as: (sound-play "spikey-break") (suspend) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 4)) + (until (time-elapsed? gp-2 (seconds 4)) (suspend) ) ) @@ -527,9 +527,9 @@ This commonly includes things such as: ;; definition for method 30 of type dig-spikey-sphere ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! dig-spikey-sphere ((obj dig-spikey-sphere)) +(defmethod init-proj-collision! dig-spikey-sphere ((this dig-spikey-sphere)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) spikey-sphere-reaction) (set! (-> s5-0 no-reaction) @@ -552,7 +552,7 @@ This commonly includes things such as: ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -568,15 +568,15 @@ This commonly includes things such as: ;; definition for method 39 of type dig-spikey-sphere ;; INFO: Used lq/sq ;; WARN: Return type mismatch time-frame vs none. -(defmethod play-impact-sound! dig-spikey-sphere ((obj dig-spikey-sphere)) +(defmethod play-impact-sound! dig-spikey-sphere ((this dig-spikey-sphere)) "Plays impact sound" - (let* ((a0-1 (-> obj root)) + (let* ((a0-1 (-> this root)) (s5-0 (-> a0-1 status)) ) (when (logtest? s5-0 (collide-status touch-surface)) (vector-float*! (-> a0-1 transv) (-> a0-1 transv) 0.9) (cond - ((< (-> obj root trans y) (-> obj pad-i1hb23h1b)) + ((< (-> this root trans y) (-> this pad-i1hb23h1b)) (let ((s4-0 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-0 (let ((t9-1 (method-of-type part-tracker activate))) @@ -597,7 +597,7 @@ This commonly includes things such as: (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root grount-touch-point quad)) + (set! (-> t3-0 trans quad) (-> this root grount-touch-point quad)) ((the-as (function object object object object object object object object none) t9-2) a0-5 a1-3 @@ -612,7 +612,7 @@ This commonly includes things such as: (-> s4-0 ppointer) ) ) - (go (method-of-object obj die)) + (go (method-of-object this die)) ) (else (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) @@ -635,7 +635,7 @@ This commonly includes things such as: (t2-1 #f) (t3-1 *launch-matrix*) ) - (set! (-> t3-1 trans quad) (-> obj root grount-touch-point quad)) + (set! (-> t3-1 trans quad) (-> this root grount-touch-point quad)) ((the-as (function object object object object object object object object none) t9-6) a0-8 a1-6 @@ -654,9 +654,9 @@ This commonly includes things such as: ) ) (if (and (logtest? s5-0 (collide-status impact-surface)) - (>= (- (current-time) (-> obj played-bounce-time)) (seconds 0.3)) + (time-elapsed? (-> this played-bounce-time) (seconds 0.3)) ) - (set! (-> obj played-bounce-time) (current-time)) + (set-time! (-> this played-bounce-time)) ) ) (none) @@ -664,36 +664,36 @@ This commonly includes things such as: ;; definition for method 31 of type dig-spikey-sphere ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! dig-spikey-sphere ((obj dig-spikey-sphere)) +(defmethod init-proj-settings! dig-spikey-sphere ((this dig-spikey-sphere)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj attack-mode) 'eco-dark) + (set! (-> this attack-mode) 'eco-dark) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-spikey-sphere" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) - (t9-2 obj) + (t9-2 this) ) - (set! (-> obj max-speed) 163840.0) - (set! (-> obj timeout) (seconds 8)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj notify-handle) (the-as handle #f)) - (set! (-> obj update-velocity) spikey-sphere-update-velocity) - (set! (-> obj max-hits) #xffff) - (set! (-> obj move) spikey-sphere-move) - (set-vector! (-> obj root quat) 0.0 0.0 0.0 1.0) - (set! (-> obj pad-i1hb23h1b) (+ -204800.0 (-> obj root trans y))) - (let ((v1-16 (-> obj starting-dir))) + (set! (-> this max-speed) 163840.0) + (set! (-> this timeout) (seconds 8)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this notify-handle) (the-as handle #f)) + (set! (-> this update-velocity) spikey-sphere-update-velocity) + (set! (-> this max-hits) #xffff) + (set! (-> this move) spikey-sphere-move) + (set-vector! (-> this root quat) 0.0 0.0 0.0 1.0) + (set! (-> this pad-i1hb23h1b) (+ -204800.0 (-> this root trans y))) + (let ((v1-16 (-> this starting-dir))) (quaternion-axis-angle! - (-> obj tumble-quat) + (-> this tumble-quat) (-> v1-16 z) (-> v1-16 y) (-> v1-16 x) (* -65536.0 (seconds-per-frame)) ) ) - (set! (-> obj draw light-index) (the-as uint 4)) + (set! (-> this draw light-index) (the-as uint 4)) (sound-play "spikey-roll") 0 (none) @@ -715,18 +715,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-spikey-sphere-door -(defmethod inspect dig-spikey-sphere-door ((obj dig-spikey-sphere-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-spikey-sphere-door ((this dig-spikey-sphere-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tprev-sync: ~f~%" (-> obj prev-sync)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tprev-sync: ~f~%" (-> this prev-sync)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -758,7 +758,7 @@ This commonly includes things such as: :code (behavior () (sound-play "spikey-door") (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.1)) + (until (time-elapsed? gp-1 (seconds 0.1)) (suspend) ) ) @@ -802,17 +802,17 @@ This commonly includes things such as: ;; definition for method 11 of type dig-spikey-sphere-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-spikey-sphere-door ((obj dig-spikey-sphere-door) (arg0 entity-actor)) +(defmethod init-from-entity! dig-spikey-sphere-door ((this dig-spikey-sphere-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-spikey-sphere-door" (the-as (pointer uint32) #f)) @@ -830,12 +830,12 @@ This commonly includes things such as: (set! (-> a1-5 entity) arg0) (set! (-> a1-5 period) (the-as uint 1200)) (set! (-> a1-5 percent) 0.0) - (initialize! (-> obj sync) a1-5) + (initialize! (-> this sync) a1-5) ) - (set! (-> obj prev-sync) (get-norm! (-> obj sync) 0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj draw light-index) (the-as uint 3)) - (go (method-of-object obj idle)) + (set! (-> this prev-sync) (get-norm! (-> this sync) 0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 3)) + (go (method-of-object this idle)) (none) ) @@ -880,31 +880,31 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-balloon-lurker -(defmethod inspect dig-balloon-lurker ((obj dig-balloon-lurker)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-balloon-lurker ((this dig-balloon-lurker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tswing-sync: #~%" (-> obj swing-sync)) - (format #t "~2Tsmush: #~%" (-> obj smush)) - (format #t "~2Tpov-cam-offset: #~%" (-> obj pov-cam-offset)) - (format #t "~2Toptions: ~D~%" (-> obj options)) - (format #t "~2Tbouncing: ~A~%" (-> obj bouncing)) - (format #t "~2Tbounce-scale: (meters ~m)~%" (-> obj bounce-scale)) - (format #t "~2Tbob-counter: ~f~%" (-> obj bob-counter)) - (format #t "~2Tforward-backward: ~A~%" (-> obj forward-backward)) - (format #t "~2Tgrabbed: ~A~%" (-> obj grabbed)) - (format #t "~2Ttrapeze-grabbed: ~A~%" (-> obj trapeze-grabbed)) - (format #t "~2Tpedal-anim-frame: ~f~%" (-> obj pedal-anim-frame)) - (format #t "~2Tpedal-anim-speed: ~f~%" (-> obj pedal-anim-speed)) - (format #t "~2Tpedal-sound-id: ~D~%" (-> obj pedal-sound-id)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tswing-sync: #~%" (-> this swing-sync)) + (format #t "~2Tsmush: #~%" (-> this smush)) + (format #t "~2Tpov-cam-offset: #~%" (-> this pov-cam-offset)) + (format #t "~2Toptions: ~D~%" (-> this options)) + (format #t "~2Tbouncing: ~A~%" (-> this bouncing)) + (format #t "~2Tbounce-scale: (meters ~m)~%" (-> this bounce-scale)) + (format #t "~2Tbob-counter: ~f~%" (-> this bob-counter)) + (format #t "~2Tforward-backward: ~A~%" (-> this forward-backward)) + (format #t "~2Tgrabbed: ~A~%" (-> this grabbed)) + (format #t "~2Ttrapeze-grabbed: ~A~%" (-> this trapeze-grabbed)) + (format #t "~2Tpedal-anim-frame: ~f~%" (-> this pedal-anim-frame)) + (format #t "~2Tpedal-anim-speed: ~f~%" (-> this pedal-anim-speed)) + (format #t "~2Tpedal-sound-id: ~D~%" (-> this pedal-sound-id)) (label cfg-4) - obj + this ) ;; definition of type dig-balloon-lurker-trapeze @@ -925,19 +925,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-balloon-lurker-trapeze -(defmethod inspect dig-balloon-lurker-trapeze ((obj dig-balloon-lurker-trapeze)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-balloon-lurker-trapeze ((this dig-balloon-lurker-trapeze)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tswing-type: ~f~%" (-> obj swing-type)) - (format #t "~2Tswing-pole: #x~X~%" (-> obj swing-pole)) - (format #t "~2Tswing-anim-frame: ~f~%" (-> obj swing-anim-frame)) + (format #t "~2Tswing-type: ~f~%" (-> this swing-type)) + (format #t "~2Tswing-pole: #x~X~%" (-> this swing-pole)) + (format #t "~2Tswing-anim-frame: ~f~%" (-> this swing-anim-frame)) (label cfg-4) - obj + this ) ;; definition for function dig-balloon-lurker-trapeze-init-by-other @@ -1022,20 +1022,20 @@ This commonly includes things such as: ;; definition for method 21 of type dig-balloon-lurker-trapeze ;; WARN: Return type mismatch int vs none. -(defmethod dig-balloon-lurker-trapeze-method-21 dig-balloon-lurker-trapeze ((obj dig-balloon-lurker-trapeze)) +(defmethod dig-balloon-lurker-trapeze-method-21 dig-balloon-lurker-trapeze ((this dig-balloon-lurker-trapeze)) (cond - ((and (-> obj draw shadow) - (zero? (-> obj draw cur-lod)) - (logtest? (-> obj draw status) (draw-control-status on-screen)) + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) ) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (vector<-cspace! (-> s5-0 start-pos) (-> obj node-list data 11)) - (set! (-> s5-0 start-pos y) (+ -24576.0 (-> obj root trans y))) + (vector<-cspace! (-> s5-0 start-pos) (-> this node-list data 11)) + (set! (-> s5-0 start-pos y) (+ -24576.0 (-> this root trans y))) (set-vector! (-> s5-0 move-dist) 0.0 -34816.0 0.0 1.0) (let ((v1-10 s5-0)) (set! (-> v1-10 radius) 8192.0) (set! (-> v1-10 collide-with) (collide-spec backgnd)) - (set! (-> v1-10 ignore-process0) obj) + (set! (-> v1-10 ignore-process0) this) (set! (-> v1-10 ignore-process1) #f) (set! (-> v1-10 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-10 action-mask) (collide-action solid)) @@ -1043,26 +1043,26 @@ This commonly includes things such as: (cond ((>= (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0) (-> s5-0 best-other-tri intersect) - (let ((v1-15 (-> obj draw shadow-ctrl))) + (let ((v1-15 (-> this draw shadow-ctrl))) (logclear! (-> v1-15 settings flags) (shadow-flags disable-draw)) ) 0 - (let ((v1-18 (-> obj draw shadow-ctrl))) + (let ((v1-18 (-> this draw shadow-ctrl))) (set! (-> v1-18 settings bot-plane w) (- (+ -6144.0 (-> s5-0 best-other-tri intersect y)))) ) 0 - (let ((v1-21 (-> obj draw shadow-ctrl))) + (let ((v1-21 (-> this draw shadow-ctrl))) (set! (-> v1-21 settings top-plane w) (- (+ 6144.0 (-> s5-0 best-other-tri intersect y)))) ) 0 - (let* ((f1-4 (vector-vector-distance (-> s5-0 best-other-tri intersect) (-> obj root trans))) + (let* ((f1-4 (vector-vector-distance (-> s5-0 best-other-tri intersect) (-> this root trans))) (f0-15 (* 0.000030517578 (fmin 32768.0 (fmax 0.0 (+ -57344.0 f1-4))))) ) - (set! (-> obj draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-15)) + (set! (-> this draw shadow-ctrl settings shadow-dir w) (lerp 409600.0 40960.0 f0-15)) ) ) (else - (let ((v1-31 (-> obj draw shadow-ctrl))) + (let ((v1-31 (-> this draw shadow-ctrl))) (logior! (-> v1-31 settings flags) (shadow-flags disable-draw)) ) 0 @@ -1071,7 +1071,7 @@ This commonly includes things such as: ) ) (else - (let ((v1-34 (-> obj draw shadow-ctrl))) + (let ((v1-34 (-> this draw shadow-ctrl))) (logior! (-> v1-34 settings flags) (shadow-flags disable-draw)) ) 0 @@ -1083,14 +1083,14 @@ This commonly includes things such as: ;; definition for method 11 of type dig-balloon-lurker ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-balloon-lurker ((obj dig-balloon-lurker) (arg0 entity-actor)) +(defmethod init-from-entity! dig-balloon-lurker ((this dig-balloon-lurker) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec crate)) @@ -1126,34 +1126,34 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-balloon-lurker" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (process-spawn dig-balloon-lurker-trapeze arg0 :to obj) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj options) (res-lump-value arg0 'options int :time -1000000000.0)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (set! (-> obj bouncing) #f) - (set! (-> obj bounce-scale) 1228.8) - (set! (-> obj bob-counter) (if (= (-> obj options) 1) - 145.0 - 0.0 - ) + (process-spawn dig-balloon-lurker-trapeze arg0 :to this) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this options) (res-lump-value arg0 'options int :time -1000000000.0)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (set! (-> this bouncing) #f) + (set! (-> this bounce-scale) 1228.8) + (set! (-> this bob-counter) (if (= (-> this options) 1) + 145.0 + 0.0 + ) ) - (set! (-> obj forward-backward) #f) - (set! (-> obj grabbed) #f) - (set! (-> obj trapeze-grabbed) #f) - (set! (-> obj pedal-anim-frame) 0.0) - (set! (-> obj pedal-anim-speed) 0.5) - (set-vector! (-> obj pov-cam-offset) 0.0 -20480.0 0.0 1.0) - (set! (-> obj pedal-sound-id) (new-sound-id)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this forward-backward) #f) + (set! (-> this grabbed) #f) + (set! (-> this trapeze-grabbed) #f) + (set! (-> this pedal-anim-frame) 0.0) + (set! (-> this pedal-anim-speed) 0.5) + (set-vector! (-> this pov-cam-offset) 0.0 -20480.0 0.0 1.0) + (set! (-> this pedal-sound-id) (new-sound-id)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((a1-23 (new 'stack-no-clear 'sync-info-params))) (let ((v1-39 0)) (if #t @@ -1169,7 +1169,7 @@ This commonly includes things such as: (set! (-> a1-23 ease-out) 0.15) (set! (-> a1-23 pause-in) 0.0) (set! (-> a1-23 pause-out) 0.0) - (initialize! (-> obj sync) a1-23) + (initialize! (-> this sync) a1-23) ) (let ((a1-24 (new 'stack-no-clear 'sync-info-params))) (let ((v1-46 0)) @@ -1182,16 +1182,16 @@ This commonly includes things such as: (set! (-> a1-24 entity) arg0) (set! (-> a1-24 period) (the-as uint 3600)) (set! (-> a1-24 percent) 0.0) - (initialize! (-> obj swing-sync) a1-24) + (initialize! (-> this swing-sync) a1-24) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) ;; definition for method 10 of type dig-balloon-lurker -(defmethod deactivate dig-balloon-lurker ((obj dig-balloon-lurker)) - (sound-stop (-> obj pedal-sound-id)) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate dig-balloon-lurker ((this dig-balloon-lurker)) + (sound-stop (-> this pedal-sound-id)) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -1323,18 +1323,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-wheel-step -(defmethod inspect dig-wheel-step ((obj dig-wheel-step)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-wheel-step ((this dig-wheel-step)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim-speed: ~f~%" (-> obj anim-speed)) - (format #t "~2Twheel-sound-id: ~D~%" (-> obj wheel-sound-id)) + (format #t "~2Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~2Twheel-sound-id: ~D~%" (-> this wheel-sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1364,22 +1364,22 @@ This commonly includes things such as: ) ;; definition for method 10 of type dig-wheel-step -(defmethod deactivate dig-wheel-step ((obj dig-wheel-step)) - (sound-stop (-> obj wheel-sound-id)) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate dig-wheel-step ((this dig-wheel-step)) + (sound-stop (-> this wheel-sound-id)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 11 of type dig-wheel-step ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-wheel-step ((obj dig-wheel-step) (arg0 entity-actor)) +(defmethod init-from-entity! dig-wheel-step ((this dig-wheel-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) @@ -1416,18 +1416,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-18 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-wheel-step" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj wheel-sound-id) (new-sound-id)) - (set! (-> obj draw light-index) (the-as uint 5)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (let* ((a0-30 (-> obj entity)) + (set! (-> this wheel-sound-id) (new-sound-id)) + (set! (-> this draw light-index) (the-as uint 5)) + (logclear! (-> this mask) (process-mask actor-pause)) + (let* ((a0-30 (-> this entity)) (f0-18 ((method-of-object a0-30 get-property-value-float) a0-30 'rotspeed @@ -1439,9 +1439,9 @@ This commonly includes things such as: ) ) ) - (set! (-> obj anim-speed) (* 0.000015258789 f0-18)) + (set! (-> this anim-speed) (* 0.000015258789 f0-18)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1459,20 +1459,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-tipping-rock -(defmethod inspect dig-tipping-rock ((obj dig-tipping-rock)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-tipping-rock ((this dig-tipping-rock)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanchor-point: #~%" (-> obj anchor-point)) - (format #t "~2Tlast-ridden-time: ~D~%" (-> obj last-ridden-time)) - (format #t "~2Tsurface-height: ~f~%" (-> obj surface-height)) - (format #t "~2Tbubbling-sound-id: ~D~%" (-> obj bubbling-sound-id)) + (format #t "~2Tanchor-point: #~%" (-> this anchor-point)) + (format #t "~2Tlast-ridden-time: ~D~%" (-> this last-ridden-time)) + (format #t "~2Tsurface-height: ~f~%" (-> this surface-height)) + (format #t "~2Tbubbling-sound-id: ~D~%" (-> this bubbling-sound-id)) (label cfg-4) - obj + this ) ;; definition for symbol *dig-tipping-rock-constants*, type rigid-body-platform-constants @@ -1518,29 +1518,29 @@ This commonly includes things such as: ;; definition for method 37 of type dig-tipping-rock ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-37 dig-tipping-rock ((obj dig-tipping-rock)) +(defmethod rigid-body-object-method-37 dig-tipping-rock ((this dig-tipping-rock)) (let ((t9-0 (method-of-type rigid-body-platform rigid-body-object-method-37))) - (t9-0 obj) + (t9-0 this) ) (cond - ((>= (- (current-time) (-> obj last-ridden-time)) (seconds 0.5)) - (when (nonzero? (-> obj bubbling-sound-id)) + ((time-elapsed? (-> this last-ridden-time) (seconds 0.5)) + (when (nonzero? (-> this bubbling-sound-id)) (let ((v1-5 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-5 command) (sound-command set-param)) - (set! (-> v1-5 id) (-> obj bubbling-sound-id)) + (set! (-> v1-5 id) (-> this bubbling-sound-id)) (set! (-> v1-5 params volume) -4) (set! (-> v1-5 auto-time) 120) (set! (-> v1-5 auto-from) 2) (set! (-> v1-5 params mask) (the-as uint 17)) (-> v1-5 id) ) - (set! (-> obj bubbling-sound-id) (new 'static 'sound-id)) + (set! (-> this bubbling-sound-id) (new 'static 'sound-id)) 0 ) ) (else - (if (zero? (-> obj bubbling-sound-id)) - (set! (-> obj bubbling-sound-id) (sound-play "lava-plat-tip")) + (if (zero? (-> this bubbling-sound-id)) + (set! (-> this bubbling-sound-id) (sound-play "lava-plat-tip")) ) ) ) @@ -1553,7 +1553,7 @@ This commonly includes things such as: :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('ridden) - (set! (-> self last-ridden-time) (current-time)) + (set-time! (-> self last-ridden-time)) ) ) (rigid-body-object-event-handler proc argc message block) @@ -1573,17 +1573,17 @@ 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 ((obj dig-tipping-rock) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method dig-tipping-rock 29)) obj arg0) - (rigid-body-platform-method-56 obj (-> obj anchor-point)) +(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) + (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) ) ;; definition for method 32 of type dig-tipping-rock ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape dig-tipping-rock ((obj dig-tipping-rock)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod allocate-and-init-cshape dig-tipping-rock ((this dig-tipping-rock)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1604,30 +1604,30 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 53 of type dig-tipping-rock -(defmethod rigid-body-platform-method-53 dig-tipping-rock ((obj dig-tipping-rock) (arg0 vector)) - (-> obj surface-height) +(defmethod rigid-body-platform-method-53 dig-tipping-rock ((this dig-tipping-rock) (arg0 vector)) + (-> this surface-height) ) ;; definition for method 33 of type dig-tipping-rock ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body dig-tipping-rock ((obj dig-tipping-rock)) +(defmethod init-skel-and-rigid-body dig-tipping-rock ((this dig-tipping-rock)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-tipping-rock" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-rotate-local-x! (-> obj root quat) (-> obj root quat) -2555.2202) - (alloc-and-init-rigid-body-control obj *dig-tipping-rock-constants*) - (set! (-> obj anchor-point quad) (-> obj rbody state position quad)) - (let ((v1-8 (-> obj control-point-array))) + (quaternion-rotate-local-x! (-> this root quat) (-> this root quat) -2555.2202) + (alloc-and-init-rigid-body-control this *dig-tipping-rock-constants*) + (set! (-> this anchor-point quad) (-> this rbody state position quad)) + (let ((v1-8 (-> this control-point-array))) (let ((a0-8 (-> v1-8 data))) (set! (-> a0-8 0 local-pos x) 0.0) (set! (-> a0-8 0 local-pos y) 0.0) @@ -1653,8 +1653,8 @@ This commonly includes things such as: (set! (-> v1-9 local-pos w) 1.0) ) ) - (set! (-> obj surface-height) (+ 6144.0 (-> obj root trans y))) - (set! (-> obj bubbling-sound-id) (new 'static 'sound-id)) + (set! (-> this surface-height) (+ 6144.0 (-> this root trans y))) + (set! (-> this bubbling-sound-id) (new 'static 'sound-id)) 0 (none) ) @@ -1675,23 +1675,23 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-wall-bouncer -(defmethod inspect dig-wall-bouncer ((obj dig-wall-bouncer)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-wall-bouncer ((this dig-wall-bouncer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bouncer inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 23 of type dig-wall-bouncer ;; WARN: Return type mismatch int vs none. -(defmethod init-skeleton! dig-wall-bouncer ((obj dig-wall-bouncer)) +(defmethod init-skeleton! dig-wall-bouncer ((this dig-wall-bouncer)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-wall-bouncer" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1701,9 +1701,9 @@ This commonly includes things such as: ;; definition for method 24 of type dig-wall-bouncer ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 dig-wall-bouncer ((obj dig-wall-bouncer)) +(defmethod bouncer-method-24 dig-wall-bouncer ((this dig-wall-bouncer)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 5) 0))) (set! (-> s5-0 total-prims) (the-as uint 6)) (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) @@ -1753,7 +1753,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1775,18 +1775,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-stomp-block -(defmethod inspect dig-stomp-block ((obj dig-stomp-block)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-stomp-block ((this dig-stomp-block)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type rigid-body-object inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tdesty: ~f~%" (-> obj desty)) - (format #t "~2Tflag: ~A~%" (-> obj flag)) + (format #t "~2Tdesty: ~f~%" (-> this desty)) + (format #t "~2Tflag: ~A~%" (-> this flag)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1901,14 +1901,14 @@ This commonly includes things such as: ;; definition for method 37 of type dig-stomp-block ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-37 dig-stomp-block ((obj dig-stomp-block)) +(defmethod rigid-body-object-method-37 dig-stomp-block ((this dig-stomp-block)) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-0 start-pos quad) (-> obj rbody state position quad)) - (vector-float*! (-> a1-0 move-dist) (-> obj rbody state lin-velocity) (seconds-per-frame)) + (set! (-> a1-0 start-pos quad) (-> this rbody state position quad)) + (vector-float*! (-> a1-0 move-dist) (-> this rbody state lin-velocity) (seconds-per-frame)) (let ((v1-3 a1-0)) - (set! (-> v1-3 radius) (+ 4096.0 (-> obj root root-prim local-sphere w))) - (set! (-> v1-3 collide-with) (-> obj root root-prim prim-core collide-with)) - (set! (-> v1-3 ignore-process0) obj) + (set! (-> v1-3 radius) (+ 4096.0 (-> this root root-prim local-sphere w))) + (set! (-> v1-3 collide-with) (-> this root root-prim prim-core collide-with)) + (set! (-> v1-3 ignore-process0) this) (set! (-> v1-3 ignore-process1) #f) (set! (-> v1-3 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-3 action-mask) (collide-action solid)) @@ -1930,16 +1930,16 @@ This commonly includes things such as: (if *display-collide-cache* (debug-draw *collide-cache*) ) - (rigid-body-object-method-30 obj) - (set! (-> obj root transv quad) (-> obj rbody state lin-velocity quad)) - (quaternion-copy! (-> obj root quat) (-> obj rbody state rotation)) - (rigid-body-method-24 (-> obj rbody state)) - (let ((v1-22 (-> obj rbody)) - (a1-8 (-> obj root trans)) + (rigid-body-object-method-30 this) + (set! (-> this root transv quad) (-> this rbody state lin-velocity quad)) + (quaternion-copy! (-> this root quat) (-> this rbody state rotation)) + (rigid-body-method-24 (-> this rbody state)) + (let ((v1-22 (-> this rbody)) + (a1-8 (-> this root trans)) ) (rigid-body-method-23 (-> v1-22 state) a1-8) ) - (set! (-> obj node-list data 0 bone transform trans quad) (-> obj root trans quad)) + (set! (-> this node-list data 0 bone transform trans quad) (-> this root trans quad)) (transform-post) 0 (none) @@ -1947,8 +1947,8 @@ This commonly includes things such as: ;; definition for method 32 of type dig-stomp-block ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape dig-stomp-block ((obj dig-stomp-block)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape dig-stomp-block ((this dig-stomp-block)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2036,7 +2036,7 @@ This commonly includes things such as: ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -2044,17 +2044,17 @@ This commonly includes things such as: ;; definition for method 33 of type dig-stomp-block ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body dig-stomp-block ((obj dig-stomp-block)) +(defmethod init-skel-and-rigid-body dig-stomp-block ((this dig-stomp-block)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-stomp-block" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *dig-stomp-block-constants*) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-collision)) - (set! (-> obj draw light-index) (the-as uint 10)) - (set! (-> obj flag) #f) + (alloc-and-init-rigid-body-control this *dig-stomp-block-constants*) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this rbody state flags) (rigid-body-flag enable-collision)) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this flag) #f) 0 (none) ) @@ -2088,18 +2088,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-stomp-block-controller -(defmethod inspect dig-stomp-block-controller ((obj dig-stomp-block-controller)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-stomp-block-controller ((this dig-stomp-block-controller)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tstomp-blocks[4] @ #x~X~%" (-> obj stomp-blocks)) - (format #t "~2Tplayed-fall?: ~A~%" (-> obj played-fall?)) + (format #t "~2Tstomp-blocks[4] @ #x~X~%" (-> this stomp-blocks)) + (format #t "~2Tplayed-fall?: ~A~%" (-> this played-fall?)) (label cfg-4) - obj + this ) ;; definition for symbol *dig-stomp-block-table*, type vector @@ -2173,17 +2173,17 @@ This commonly includes things such as: ;; definition for method 11 of type dig-stomp-block-controller ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-stomp-block-controller ((obj dig-stomp-block-controller) (arg0 entity-actor)) +(defmethod init-from-entity! dig-stomp-block-controller ((this dig-stomp-block-controller) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj played-fall?) #f) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (go (method-of-object obj idle)) + (set! (-> this played-fall?) #f) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (go (method-of-object this idle)) (none) ) @@ -2200,16 +2200,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type dig-totem -(defmethod inspect dig-totem ((obj dig-totem)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-totem ((this dig-totem)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2219,7 +2219,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type dig-totem -(defmethod run-logic? dig-totem ((obj dig-totem)) +(defmethod run-logic? dig-totem ((this dig-totem)) #t ) @@ -2231,14 +2231,14 @@ This commonly includes things such as: ;; definition for method 11 of type dig-totem ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dig-totem ((obj dig-totem) (arg0 entity-actor)) +(defmethod init-from-entity! dig-totem ((this dig-totem) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core action) (collide-action solid)) @@ -2252,15 +2252,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-dig-totem-entity" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (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 7f1c555a10..f09de6ee8c 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-baron_REF.gc @@ -712,27 +712,27 @@ ) ;; definition for method 3 of type drill-barons-ship -(defmethod inspect drill-barons-ship ((obj drill-barons-ship)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-barons-ship ((this drill-barons-ship)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Tnext-to-shoot-idx: ~D~%" (-> obj next-to-shoot-idx)) - (format #t "~2Tcurrent-y-position: ~f~%" (-> obj current-y-position)) - (format #t "~2Tfrom-y: ~f~%" (-> obj from-y)) - (format #t "~2Tinc-y: ~f~%" (-> obj inc-y)) - (format #t "~2Tease-y: ~f~%" (-> obj ease-y)) - (format #t "~2Tx-offset-angle: ~f~%" (-> obj x-offset-angle)) - (format #t "~2Tpass: ~D~%" (-> obj pass)) - (format #t "~2Tend-of-pass: ~A~%" (-> obj end-of-pass)) - (format #t "~2Trock-angle: ~f~%" (-> obj rock-angle)) - (format #t "~2Tsoundid: ~D~%" (-> obj soundid)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tnext-to-shoot-idx: ~D~%" (-> this next-to-shoot-idx)) + (format #t "~2Tcurrent-y-position: ~f~%" (-> this current-y-position)) + (format #t "~2Tfrom-y: ~f~%" (-> this from-y)) + (format #t "~2Tinc-y: ~f~%" (-> this inc-y)) + (format #t "~2Tease-y: ~f~%" (-> this ease-y)) + (format #t "~2Tx-offset-angle: ~f~%" (-> this x-offset-angle)) + (format #t "~2Tpass: ~D~%" (-> this pass)) + (format #t "~2Tend-of-pass: ~A~%" (-> this end-of-pass)) + (format #t "~2Trock-angle: ~f~%" (-> this rock-angle)) + (format #t "~2Tsoundid: ~D~%" (-> this soundid)) (label cfg-4) - obj + this ) ;; definition of type drill-barons-ship-explode @@ -748,16 +748,16 @@ ) ;; definition for method 3 of type drill-barons-ship-explode -(defmethod inspect drill-barons-ship-explode ((obj drill-barons-ship-explode)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-barons-ship-explode ((this drill-barons-ship-explode)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type barons-ship-turret-info @@ -776,21 +776,21 @@ ) ;; definition for method 3 of type barons-ship-turret-info -(defmethod inspect barons-ship-turret-info ((obj barons-ship-turret-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect barons-ship-turret-info ((this barons-ship-turret-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'barons-ship-turret-info) - (format #t "~1Tinit-y-angle: ~f~%" (-> obj init-y-angle)) - (format #t "~1Ttwist-y-max: ~f~%" (-> obj twist-y-max)) - (format #t "~1Tjoint-idx: ~D~%" (-> obj joint-idx)) - (format #t "~1Tmesh: ~D~%" (-> obj mesh)) - (format #t "~1Tship-y-offset: ~f~%" (-> obj ship-y-offset)) - (format #t "~1Talive: ~A~%" (-> obj alive)) - (format #t "~1Tnext-to-shoot: ~A~%" (-> obj next-to-shoot)) + (format #t "[~8x] ~A~%" this 'barons-ship-turret-info) + (format #t "~1Tinit-y-angle: ~f~%" (-> this init-y-angle)) + (format #t "~1Ttwist-y-max: ~f~%" (-> this twist-y-max)) + (format #t "~1Tjoint-idx: ~D~%" (-> this joint-idx)) + (format #t "~1Tmesh: ~D~%" (-> this mesh)) + (format #t "~1Tship-y-offset: ~f~%" (-> this ship-y-offset)) + (format #t "~1Talive: ~A~%" (-> this alive)) + (format #t "~1Tnext-to-shoot: ~A~%" (-> this next-to-shoot)) (label cfg-4) - obj + this ) ;; definition of type drill-barons-ship-turret @@ -822,27 +822,27 @@ ) ;; definition for method 3 of type drill-barons-ship-turret -(defmethod inspect drill-barons-ship-turret ((obj drill-barons-ship-turret)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-barons-ship-turret ((this drill-barons-ship-turret)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: #~%" (-> obj info)) - (format #t "~2Tshot-timer: ~D~%" (-> obj shot-timer)) - (format #t "~2Tshot-counter: ~D~%" (-> obj shot-counter)) - (format #t "~2Tjmod: ~A~%" (-> obj jmod)) - (format #t "~2Tjmod-left: ~A~%" (-> obj jmod-left)) - (format #t "~2Tjmod-right: ~A~%" (-> obj jmod-right)) - (format #t "~2Tanim-frame: ~f~%" (-> obj anim-frame)) - (format #t "~2Terror-y-angle: ~f~%" (-> obj error-y-angle)) - (format #t "~2Terror-y-angle-dest: ~f~%" (-> obj error-y-angle-dest)) - (format #t "~2Thit-count: ~D~%" (-> obj hit-count)) - (format #t "~2Tsoundid: ~D~%" (-> obj soundid)) + (format #t "~2Tinfo: #~%" (-> this info)) + (format #t "~2Tshot-timer: ~D~%" (-> this shot-timer)) + (format #t "~2Tshot-counter: ~D~%" (-> this shot-counter)) + (format #t "~2Tjmod: ~A~%" (-> this jmod)) + (format #t "~2Tjmod-left: ~A~%" (-> this jmod-left)) + (format #t "~2Tjmod-right: ~A~%" (-> this jmod-right)) + (format #t "~2Tanim-frame: ~f~%" (-> this anim-frame)) + (format #t "~2Terror-y-angle: ~f~%" (-> this error-y-angle)) + (format #t "~2Terror-y-angle-dest: ~f~%" (-> this error-y-angle-dest)) + (format #t "~2Thit-count: ~D~%" (-> this hit-count)) + (format #t "~2Tsoundid: ~D~%" (-> this soundid)) (label cfg-4) - obj + this ) ;; definition for symbol *ship-turrets-first-pass*, type (array int32) @@ -1106,26 +1106,26 @@ ;; 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 ((obj drill-barons-ship-turret) (arg0 int)) - (when (-> obj jmod) - (if (nonzero? (-> obj jmod)) - (&+! (-> obj jmod) arg0) +(defmethod relocate drill-barons-ship-turret ((this drill-barons-ship-turret) (arg0 int)) + (when (-> this jmod) + (if (nonzero? (-> this jmod)) + (&+! (-> this jmod) arg0) ) ) - (when (-> obj jmod-left) - (if (nonzero? (-> obj jmod-left)) - (&+! (-> obj jmod-left) arg0) + (when (-> this jmod-left) + (if (nonzero? (-> this jmod-left)) + (&+! (-> this jmod-left) arg0) ) ) - (when (-> obj jmod-right) - (if (nonzero? (-> obj jmod-right)) - (&+! (-> obj jmod-right) arg0) + (when (-> this jmod-right) + (if (nonzero? (-> this jmod-right)) + (&+! (-> 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)) - obj + this arg0 ) ) @@ -1133,14 +1133,14 @@ ;; definition for method 11 of type drill-barons-ship ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-barons-ship ((obj drill-barons-ship) (arg0 entity-actor)) +(defmethod init-from-entity! drill-barons-ship ((this drill-barons-ship) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) (set! (-> s4-0 total-prims) (the-as uint 2)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1162,41 +1162,41 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-barons-ship" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (quaternion-vector-angle! (-> obj root quat) *y-vector* -16384.0) - (set-vector! (-> obj root trans) 737280.0 -1024000.0 -1433600.0 1.0) - (set! (-> obj next-to-shoot-idx) 0) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (set! (-> obj current-y-position) (-> obj root trans y)) - (set! (-> obj from-y) (-> obj current-y-position)) - (set! (-> obj inc-y) 1228.8) - (set! (-> obj ease-y) 40960.0) - (set! (-> obj pass) 0) - (set! (-> obj end-of-pass) #f) - (set! (-> obj rock-angle) 0.0) - (let ((a0-21 (-> obj skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (quaternion-vector-angle! (-> this root quat) *y-vector* -16384.0) + (set-vector! (-> this root trans) 737280.0 -1024000.0 -1433600.0 1.0) + (set! (-> this next-to-shoot-idx) 0) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (set! (-> this current-y-position) (-> this root trans y)) + (set! (-> this from-y) (-> this current-y-position)) + (set! (-> this inc-y) 1228.8) + (set! (-> this ease-y) 40960.0) + (set! (-> this pass) 0) + (set! (-> this end-of-pass) #f) + (set! (-> this rock-angle) 0.0) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-21 frame-num) 0.0) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (ja-post) (dotimes (s5-2 (length *barons-ship-turrets*)) - (process-spawn drill-barons-ship-turret (-> *barons-ship-turrets* s5-2) :to obj) + (process-spawn drill-barons-ship-turret (-> *barons-ship-turrets* s5-2) :to this) ) (set! (-> *barons-ship-turrets* (-> *ship-turrets-first-pass* 3) alive) #f) (set! (-> *barons-ship-turrets* (-> *ship-turrets-first-pass* 9) alive) #f) (set! (-> *barons-ship-turrets* (-> *ship-turrets-first-pass* 11) alive) #f) - (set! (-> obj soundid) (the-as uint (sound-play "drl-ship-steady"))) - (go (method-of-object obj hidden)) + (set! (-> this soundid) (the-as uint (sound-play "drl-ship-steady"))) + (go (method-of-object this hidden)) (none) ) @@ -1235,26 +1235,26 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-ship-shot -(defmethod inspect drill-ship-shot ((obj drill-ship-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-ship-shot ((this drill-ship-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type guard-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 37 of type drill-ship-shot -(defmethod deal-damage! drill-ship-shot ((obj drill-ship-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! drill-ship-shot ((this drill-ship-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" - (if (not (and (-> (the-as drill-barons-ship (-> obj parent 0)) next-state) - (= (-> (the-as drill-barons-ship (-> obj parent 0)) next-state name) 'hidden) + (if (not (and (-> (the-as drill-barons-ship (-> this parent 0)) next-state) + (= (-> (the-as drill-barons-ship (-> this parent 0)) next-state name) 'hidden) ) ) - ((method-of-type guard-shot deal-damage!) obj arg0 arg1) + ((method-of-type guard-shot deal-damage!) this arg0 arg1) #f ) ) @@ -1269,13 +1269,13 @@ This commonly includes things such as: ;; definition for method 31 of type drill-ship-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! drill-ship-shot ((obj drill-ship-shot)) +(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)) obj) - (set! (-> obj attack-mode) 'drill-ship-shot) - (set! (-> obj move) guard-shot-move) - (set! (-> obj max-speed) 737280.0) - (set! (-> obj timeout) (seconds 4.167)) + ((the-as (function guard-shot none) (find-parent-method drill-ship-shot 31)) this) + (set! (-> this attack-mode) 'drill-ship-shot) + (set! (-> this move) guard-shot-move) + (set! (-> this max-speed) 737280.0) + (set! (-> this timeout) (seconds 4.167)) (none) ) @@ -1515,27 +1515,27 @@ This commonly includes things such as: ;; definition for method 22 of type drill-barons-ship ;; WARN: Return type mismatch int vs none. -(defmethod drill-barons-ship-method-22 drill-barons-ship ((obj drill-barons-ship)) +(defmethod drill-barons-ship-method-22 drill-barons-ship ((this drill-barons-ship)) (with-pp (quaternion-rotate-local-x! - (-> obj root quat) - (-> obj init-quat) + (-> this root quat) + (-> this init-quat) (* 182.04445 (sin (* 36.40889 (the float (current-time))))) ) (let ((f30-2 (* 182.04445 (* 5.0 (sin (* 45.511112 (the float (current-time)))))))) - (when (!= (-> obj rock-angle) 0.0) + (when (!= (-> this rock-angle) 0.0) (+! f30-2 (* 182.04445 (* 20.0 - (if (= (-> obj pass) 1) + (if (= (-> this pass) 1) 1.0 -1.0 ) - (sin (* 182.04445 (-> obj rock-angle))) + (sin (* 182.04445 (-> this rock-angle))) ) ) ) - (set! (-> obj rock-angle) + (set! (-> this rock-angle) (seek-ease - (-> obj rock-angle) + (-> this rock-angle) 0.0 (* 5.0 (-> pp clock time-adjust-ratio)) 90.0 @@ -1543,22 +1543,22 @@ This commonly includes things such as: ) ) ) - (quaternion-rotate-local-z! (-> obj root quat) (-> obj root quat) f30-2) + (quaternion-rotate-local-z! (-> this root quat) (-> this root quat) f30-2) ) - (set! (-> obj root trans z) - (+ (* 4096.0 (* 30.0 (cos (* 45.511112 (the float (current-time)))))) (if (= (-> obj pass) 1) + (set! (-> this root trans z) + (+ (* 4096.0 (* 30.0 (cos (* 45.511112 (the float (current-time)))))) (if (= (-> this pass) 1) -1433600.0 -1433600.0 ) ) ) (if *target* - (set! (-> obj root trans x) - (+ (-> *target* control trans x) (* 4096.0 (+ (if (= (-> obj pass) 1) + (set! (-> this root trans x) + (+ (-> *target* control trans x) (* 4096.0 (+ (if (= (-> this pass) 1) 15.0 -35.0 ) - (* 40.0 (sin (* 182.04445 (-> obj x-offset-angle)))) + (* 40.0 (sin (* 182.04445 (-> this x-offset-angle)))) ) ) ) @@ -1572,17 +1572,17 @@ This commonly includes things such as: ;; definition for method 24 of type drill-barons-ship-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod drill-barons-ship-turret-method-24 drill-barons-ship-turret ((obj drill-barons-ship-turret)) +(defmethod drill-barons-ship-turret-method-24 drill-barons-ship-turret ((this drill-barons-ship-turret)) (vector<-cspace! - (-> obj root trans) - (-> (the-as drill-barons-ship (-> obj parent 0)) node-list data (-> obj info joint-idx)) + (-> this root trans) + (-> (the-as drill-barons-ship (-> this parent 0)) node-list data (-> this info joint-idx)) ) - (let ((a2-1 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (-> obj info init-y-angle)))) - (quaternion*! (-> obj root quat) (-> (the-as drill-barons-ship (-> obj parent 0)) root quat) a2-1) + (let ((a2-1 (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (-> this info init-y-angle)))) + (quaternion*! (-> this root quat) (-> (the-as drill-barons-ship (-> this parent 0)) root quat) a2-1) ) - (when (-> obj jmod) - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root trans))) - (s3-0 (quaternion->matrix (new-stack-matrix0) (-> obj root quat))) + (when (-> this jmod) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (s3-0 (quaternion->matrix (new-stack-matrix0) (-> this root quat))) ) (vector-normalize! s5-1 1.0) (let* ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s3-0 vector 1) 1.0)) @@ -1591,26 +1591,26 @@ This commonly includes things such as: (f30-0 (vector-y-angle a0-13)) (f0-1 (vector-y-angle s3-1)) (f0-5 (fmax - (fmin (+ (deg-diff f0-1 f30-0) (* 182.04445 (-> obj error-y-angle))) (-> obj info twist-y-max)) - (- (-> obj info twist-y-max)) + (fmin (+ (deg-diff f0-1 f30-0) (* 182.04445 (-> this error-y-angle))) (-> this info twist-y-max)) + (- (-> this info twist-y-max)) ) ) ) - (quaternion-axis-angle! (the-as quaternion (-> obj jmod twist)) 0.0 1.0 0.0 f0-5) + (quaternion-axis-angle! (the-as quaternion (-> this jmod twist)) 0.0 1.0 0.0 f0-5) ) ) - (if (-> obj jmod-left) + (if (-> this jmod-left) (quaternion-axis-angle! - (the-as quaternion (-> obj jmod-left twist)) + (the-as quaternion (-> this jmod-left twist)) 0.0 0.0 1.0 (* 182.04445 (* -3.0 (the float (current-time)))) ) ) - (if (-> obj jmod-right) + (if (-> this jmod-right) (quaternion-axis-angle! - (the-as quaternion (-> obj jmod-right twist)) + (the-as quaternion (-> this jmod-right twist)) 0.0 0.0 1.0 @@ -1631,7 +1631,7 @@ This commonly includes things such as: (set! (-> v1-1 prim-core collide-with) (collide-spec)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (vector<-cspace! @@ -1891,7 +1891,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self shot-timer) (current-time)) + (set-time! (-> self shot-timer)) (set! (-> self shot-counter) 0) (set! (-> self error-y-angle) (if (< 25.0 (rand-vu-float-range 0.0 50.0)) -15.0 @@ -2013,7 +2013,7 @@ This commonly includes things such as: ) (go-virtual idle) ) - (when (and (= (-> self anim-frame) 1.0) (>= (- (current-time) (-> self shot-timer)) (seconds 0.2))) + (when (and (= (-> self anim-frame) 1.0) (time-elapsed? (-> self shot-timer) (seconds 0.2))) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (cond ((-> self jmod) @@ -2100,7 +2100,7 @@ This commonly includes things such as: ) (sound-play "ship-gun1-fire") (+! (-> self shot-counter) 1) - (set! (-> self shot-timer) (current-time)) + (set-time! (-> self shot-timer)) (seek! (-> self error-y-angle) (-> self error-y-angle-dest) (-> self clock time-adjust-ratio)) (if (= (-> self error-y-angle) (-> self error-y-angle-dest)) (set! (-> self info next-to-shoot) #f) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc index 6f5969ea81..7eddddaffb 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-mech-master_REF.gc @@ -3,43 +3,43 @@ ;; definition for method 15 of type hud-cpanel ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-cpanel ((obj hud-cpanel)) +(defmethod draw hud-cpanel ((this hud-cpanel)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 502.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 502.0 (* 130.0 (-> this offset)))) 200 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -28 55) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -28 55) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-cpanel ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-cpanel ((obj hud-cpanel)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-cpanel ((this hud-cpanel)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-cpanel ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-cpanel ((obj hud-cpanel)) - (set! (-> obj level) (level-get *level* 'drillmid)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #xb1e))) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-cpanel ((this hud-cpanel)) + (set! (-> this level) (level-get *level* 'drillmid)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #xb1e))) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -75,54 +75,54 @@ ) ;; definition for method 3 of type drill-mech-master -(defmethod inspect drill-mech-master ((obj drill-mech-master)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-mech-master ((this drill-mech-master)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcpanel-count: ~D~%" (-> obj cpanel-count)) - (format #t "~2Talarm-sound-id: ~D~%" (-> obj alarm-sound-id)) - (format #t "~2Texplosion-sound-id: ~D~%" (-> obj explosion-sound-id)) - (format #t "~2Texited?: ~A~%" (-> obj exited?)) - (format #t "~2Tkilled-jak?: ~A~%" (-> obj killed-jak?)) - (format #t "~2Tpart-doom: ~A~%" (-> obj part-doom)) - (format #t "~2Thud-cpanel: ~D~%" (-> obj hud-cpanel)) - (format #t "~2Thud-timer: ~D~%" (-> obj hud-timer)) - (format #t "~2Tscene-player-handle: ~D~%" (-> obj scene-player-handle)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tnext-warn-time: ~D~%" (-> obj next-warn-time)) - (format #t "~2Ttotal-countdown-time: ~D~%" (-> obj total-countdown-time)) - (format #t "~2Tstarted-timer-time: ~D~%" (-> obj started-timer-time)) + (format #t "~2Tcpanel-count: ~D~%" (-> this cpanel-count)) + (format #t "~2Talarm-sound-id: ~D~%" (-> this alarm-sound-id)) + (format #t "~2Texplosion-sound-id: ~D~%" (-> this explosion-sound-id)) + (format #t "~2Texited?: ~A~%" (-> this exited?)) + (format #t "~2Tkilled-jak?: ~A~%" (-> this killed-jak?)) + (format #t "~2Tpart-doom: ~A~%" (-> this part-doom)) + (format #t "~2Thud-cpanel: ~D~%" (-> this hud-cpanel)) + (format #t "~2Thud-timer: ~D~%" (-> this hud-timer)) + (format #t "~2Tscene-player-handle: ~D~%" (-> this scene-player-handle)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tnext-warn-time: ~D~%" (-> this next-warn-time)) + (format #t "~2Ttotal-countdown-time: ~D~%" (-> this total-countdown-time)) + (format #t "~2Tstarted-timer-time: ~D~%" (-> this started-timer-time)) (label cfg-4) - obj + this ) ;; definition for symbol *drill-mech-master*, type (pointer drill-mech-master) (define *drill-mech-master* (the-as (pointer drill-mech-master) #f)) ;; definition for method 10 of type drill-mech-master -(defmethod deactivate drill-mech-master ((obj drill-mech-master)) +(defmethod deactivate drill-mech-master ((this drill-mech-master)) (set! *drill-mech-master* (the-as (pointer drill-mech-master) #f)) - (if (nonzero? (-> obj alarm-sound-id)) - (sound-stop (-> obj alarm-sound-id)) + (if (nonzero? (-> this alarm-sound-id)) + (sound-stop (-> this alarm-sound-id)) ) - (if (nonzero? (-> obj part-doom)) - (kill-and-free-particles (-> obj part-doom)) + (if (nonzero? (-> this part-doom)) + (kill-and-free-particles (-> this part-doom)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) ;; definition for method 7 of type drill-mech-master ;; WARN: Return type mismatch process vs drill-mech-master. -(defmethod relocate drill-mech-master ((obj drill-mech-master) (arg0 int)) - (if (nonzero? (-> obj part-doom)) - (&+! (-> obj part-doom) arg0) +(defmethod relocate drill-mech-master ((this drill-mech-master) (arg0 int)) + (if (nonzero? (-> this part-doom)) + (&+! (-> this part-doom) arg0) ) - (the-as drill-mech-master ((method-of-type process relocate) obj arg0)) + (the-as drill-mech-master ((method-of-type process relocate) this arg0)) ) ;; definition for function drill-mech-master-event-handler @@ -156,17 +156,17 @@ ;; definition for method 19 of type drill-mech-master ;; WARN: Return type mismatch int vs none. -(defmethod spawn-hud-panel drill-mech-master ((obj drill-mech-master) (arg0 symbol)) +(defmethod spawn-hud-panel drill-mech-master ((this drill-mech-master) (arg0 symbol)) "Spawn the hud panel for the drill-mech mission." (cond - ((and arg0 (nonzero? (-> obj cpanel-count))) - (if (not (handle->process (-> obj hud-cpanel))) - (set! (-> obj hud-cpanel) (ppointer->handle (process-spawn hud-cpanel :init hud-init-by-other :to obj))) + ((and arg0 (nonzero? (-> this cpanel-count))) + (if (not (handle->process (-> this hud-cpanel))) + (set! (-> this hud-cpanel) (ppointer->handle (process-spawn hud-cpanel :init hud-init-by-other :to this))) ) ) (else - (send-event (handle->process (-> obj hud-cpanel)) 'hide-and-die) - (set! (-> obj hud-cpanel) (the-as handle #f)) + (send-event (handle->process (-> this hud-cpanel)) 'hide-and-die) + (set! (-> this hud-cpanel) (the-as handle #f)) ) ) (none) @@ -190,16 +190,16 @@ :virtual #t :event drill-mech-master-event-handler :code (behavior () - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (suspend) ) (task-node-close! (game-task-node drill-mech-smash-consoles)) (set! (-> self alarm-sound-id) (sound-play "drill-alarm")) (persist-with-delay *setting-control* 'ignore-target (seconds 8) 'ignore-target #t 0.0 0) (set-setting! 'music 'danger10 0.0 0) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (talker-spawn-func (-> *talker-speech* 183) *entity-pool* (target-pos 0) (the-as region #f)) @@ -218,10 +218,10 @@ :virtual #t :event drill-mech-master-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-continue! *game-info* "drill-escape" #f) (set! (-> self next-warn-time) (+ (current-time) (seconds 1))) - (set! (-> self started-timer-time) (current-time)) + (set-time! (-> self started-timer-time)) (set! (-> self exited?) #f) ) :trans (behavior () @@ -268,7 +268,7 @@ :virtual #t :event drill-mech-master-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-setting! 'allow-pause #f 0.0 0) (set-setting! 'allow-progress #f 0.0 0) ) @@ -279,7 +279,7 @@ ) :trans (behavior () (when (and (not (-> self killed-jak?)) - (>= (- (current-time) (-> self state-time)) (seconds 0.225)) + (time-elapsed? (-> self state-time) (seconds 0.225)) (send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'big-explosion)))) ) (set! (-> self killed-jak?) #t) @@ -314,8 +314,8 @@ (set! (-> s4-0 trans w) 1.0) (spawn-with-matrix (-> self part-doom) s4-0) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (when (and (not gp-1) (>= 2 s5-1) (= (get-status *gui-control* (-> self explosion-sound-id)) (gui-status ready))) (set! gp-1 #t) (set-action! diff --git a/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc index db36e8885c..89109337ce 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-obs2_REF.gc @@ -19,16 +19,16 @@ ) ;; definition for method 3 of type drill-flip-step -(defmethod inspect drill-flip-step ((obj drill-flip-step)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-flip-step ((this drill-flip-step)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -141,9 +141,9 @@ ;; definition for method 31 of type drill-flip-step ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! drill-flip-step ((obj drill-flip-step)) +(defmethod init-plat-collision! drill-flip-step ((this drill-flip-step)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s5-0 total-prims) (the-as uint 4)) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) @@ -181,51 +181,51 @@ (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) (set! (-> s5-0 rider-max-momentum) 0.0) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) ;; definition for method 38 of type drill-flip-step -(defmethod get-skel drill-flip-step ((obj drill-flip-step)) +(defmethod get-skel drill-flip-step ((this drill-flip-step)) (art-group-get-by-name *level* "skel-drill-flip-step" (the-as (pointer uint32) #f)) ) ;; definition for method 39 of type drill-flip-step ;; WARN: Return type mismatch int vs none. -(defmethod set-flipped-state drill-flip-step ((obj drill-flip-step)) +(defmethod set-flipped-state drill-flip-step ((this drill-flip-step)) "Set the state of the platform based on the completion of the drill-mech task." - (if (and (= (-> obj entity extra perm task) (game-task drill-mech)) + (if (and (= (-> this entity extra perm task) (game-task drill-mech)) (task-node-closed? (game-task-node drill-mech-smash-consoles)) ) - (process-entity-status! obj (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))) - (go (method-of-object obj up)) - (go (method-of-object obj down)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))) + (go (method-of-object this up)) + (go (method-of-object this down)) ) 0 (none) ) ;; definition for method 11 of type drill-flip-step -(defmethod init-from-entity! drill-flip-step ((obj drill-flip-step) (arg0 entity-actor)) +(defmethod init-from-entity! drill-flip-step ((this drill-flip-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group (get-skel obj)) (the-as pair 0)) - (stop-bouncing! obj) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + (stop-bouncing! this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (base-plat-method-32 obj) - (set-flipped-state obj) + (base-plat-method-32 this) + (set-flipped-state this) (none) ) @@ -247,18 +247,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-falling-door -(defmethod inspect drill-falling-door ((obj drill-falling-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-falling-door ((this drill-falling-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Thit-state: ~D~%" (-> obj hit-state)) - (format #t "~2Tnext-hit-state: ~D~%" (-> obj next-hit-state)) + (format #t "~2Thit-state: ~D~%" (-> this hit-state)) + (format #t "~2Tnext-hit-state: ~D~%" (-> this next-hit-state)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -389,14 +389,14 @@ This commonly includes things such as: ;; definition for method 11 of type drill-falling-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-falling-door ((obj drill-falling-door) (arg0 entity-actor)) +(defmethod init-from-entity! drill-falling-door ((this drill-falling-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -421,29 +421,29 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-falling-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-push! 1 0) - (let ((a0-18 (-> obj skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-18 (-> this skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (set! (-> obj hit-state) 0) - (set! (-> obj next-hit-state) 0) + (set! (-> this hit-state) 0) + (set! (-> this next-hit-state) 0) (if (task-node-closed? (game-task-node drill-mech-smash-consoles)) - (process-entity-status! obj (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))) - (go (method-of-object obj fall) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))) + (go (method-of-object this fall) #t) + (go (method-of-object this idle)) ) (none) ) @@ -462,16 +462,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-sliding-door -(defmethod inspect drill-sliding-door ((obj drill-sliding-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-sliding-door ((this drill-sliding-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -514,14 +514,14 @@ This commonly includes things such as: ;; definition for method 11 of type drill-sliding-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-sliding-door ((obj drill-sliding-door) (arg0 entity-actor)) +(defmethod init-from-entity! drill-sliding-door ((this drill-sliding-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -548,25 +548,25 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-sliding-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-push! 1 0) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -580,16 +580,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-accelerator-floor -(defmethod inspect drill-accelerator-floor ((obj drill-accelerator-floor)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-accelerator-floor ((this drill-accelerator-floor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type conveyor inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -599,27 +599,27 @@ This commonly includes things such as: ) ;; definition for method 22 of type drill-accelerator-floor -(defmethod get-art-group drill-accelerator-floor ((obj drill-accelerator-floor)) +(defmethod get-art-group drill-accelerator-floor ((this drill-accelerator-floor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-drill-accelerator-floor" (the-as (pointer uint32) #f)) ) ;; definition for method 24 of type drill-accelerator-floor ;; WARN: Return type mismatch int vs none. -(defmethod init! drill-accelerator-floor ((obj drill-accelerator-floor)) +(defmethod init! drill-accelerator-floor ((this drill-accelerator-floor)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj speed) 7372.8) - (set! (-> obj belt-radius) 11878.4) - (set! (-> obj pull-y-threshold) 10240.0) + (set! (-> this speed) 7372.8) + (set! (-> this belt-radius) 11878.4) + (set! (-> this pull-y-threshold) 10240.0) 0 (none) ) ;; definition for method 23 of type drill-accelerator-floor ;; WARN: Return type mismatch int vs none. -(defmethod reset-root! drill-accelerator-floor ((obj drill-accelerator-floor)) +(defmethod reset-root! drill-accelerator-floor ((this drill-accelerator-floor)) "Re-initializes the `root` [[trsqv]]" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -635,7 +635,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -677,16 +677,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-breakable-barrel -(defmethod inspect drill-breakable-barrel ((obj drill-breakable-barrel)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-breakable-barrel ((this drill-breakable-barrel)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -713,14 +713,14 @@ This commonly includes things such as: ;; definition for method 11 of type drill-breakable-barrel ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-breakable-barrel ((obj drill-breakable-barrel) (arg0 entity-actor)) +(defmethod init-from-entity! drill-breakable-barrel ((this drill-breakable-barrel) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -735,18 +735,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-breakable-barrel" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -770,18 +770,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-metalhead-eggs -(defmethod inspect drill-metalhead-eggs ((obj drill-metalhead-eggs)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-metalhead-eggs ((this drill-metalhead-eggs)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tactor-group: ~A~%" (-> obj actor-group)) - (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) + (format #t "~2Tactor-group: ~A~%" (-> this actor-group)) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -919,7 +919,7 @@ This commonly includes things such as: ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.5)) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -949,7 +949,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-metalhead-eggs ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-metalhead-eggs ((obj drill-metalhead-eggs) (arg0 entity-actor)) +(defmethod init-from-entity! drill-metalhead-eggs ((this drill-metalhead-eggs) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -957,22 +957,22 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (init-collision! obj) - (process-drawable-from-entity! obj arg0) - (skel-init! obj) - (set! (-> obj entity extra perm task) (game-task drill-eggs)) - (set! (-> obj notify-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (skel-init! this) + (set! (-> this entity extra perm task) (game-task drill-eggs)) + (set! (-> this notify-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-6 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-6 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (if (and v1-6 (= (-> sv-16 elt-count) 1)) - (set! (-> obj actor-group) (the-as actor-group (-> (the-as (pointer uint32) v1-6)))) - (set! (-> obj actor-group) #f) + (set! (-> this actor-group) (the-as actor-group (-> (the-as (pointer uint32) v1-6)))) + (set! (-> this actor-group) #f) ) ) - (if (or (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) + (if (or (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) (or (task-node-closed? (game-task-node drill-eggs-resolution)) (task-closed? (the-as string ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'task-name 'interp -1000000000.0 @@ -984,9 +984,9 @@ This commonly includes things such as: ) ) ) - (go (method-of-object obj die-fast)) + (go (method-of-object this die-fast)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1000,16 +1000,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-metalhead-eggs-a -(defmethod inspect drill-metalhead-eggs-a ((obj drill-metalhead-eggs-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-metalhead-eggs-a ((this drill-metalhead-eggs-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type drill-metalhead-eggs inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type drill-metalhead-eggs-b @@ -1022,16 +1022,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-metalhead-eggs-b -(defmethod inspect drill-metalhead-eggs-b ((obj drill-metalhead-eggs-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-metalhead-eggs-b ((this drill-metalhead-eggs-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type drill-metalhead-eggs inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type drill-metalhead-eggs-c @@ -1044,16 +1044,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-metalhead-eggs-c -(defmethod inspect drill-metalhead-eggs-c ((obj drill-metalhead-eggs-c)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-metalhead-eggs-c ((this drill-metalhead-eggs-c)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type drill-metalhead-eggs inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1076,30 +1076,30 @@ This commonly includes things such as: ;; definition for method 23 of type drill-metalhead-eggs-a ;; WARN: Return type mismatch int vs none. -(defmethod skel-init! drill-metalhead-eggs-a ((obj drill-metalhead-eggs-a)) +(defmethod skel-init! drill-metalhead-eggs-a ((this drill-metalhead-eggs-a)) "Initialize the skeleton and animations for this object." (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-metalhead-eggs-a" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-3 param 0) 1.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) (none) ) ;; definition for method 24 of type drill-metalhead-eggs-a ;; WARN: Return type mismatch int vs none. -(defmethod init-collision! drill-metalhead-eggs-a ((obj drill-metalhead-eggs-a)) +(defmethod init-collision! drill-metalhead-eggs-a ((this drill-metalhead-eggs-a)) "Define the collision for this object." - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -1114,7 +1114,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -1122,30 +1122,30 @@ This commonly includes things such as: ;; definition for method 23 of type drill-metalhead-eggs-b ;; WARN: Return type mismatch int vs none. -(defmethod skel-init! drill-metalhead-eggs-b ((obj drill-metalhead-eggs-b)) +(defmethod skel-init! drill-metalhead-eggs-b ((this drill-metalhead-eggs-b)) "Initialize the skeleton and animations for this object." (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-metalhead-eggs-b" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-3 param 0) 1.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) (none) ) ;; definition for method 24 of type drill-metalhead-eggs-b ;; WARN: Return type mismatch int vs none. -(defmethod init-collision! drill-metalhead-eggs-b ((obj drill-metalhead-eggs-b)) +(defmethod init-collision! drill-metalhead-eggs-b ((this drill-metalhead-eggs-b)) "Define the collision for this object." - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -1160,7 +1160,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -1168,30 +1168,30 @@ This commonly includes things such as: ;; definition for method 23 of type drill-metalhead-eggs-c ;; WARN: Return type mismatch int vs none. -(defmethod skel-init! drill-metalhead-eggs-c ((obj drill-metalhead-eggs-c)) +(defmethod skel-init! drill-metalhead-eggs-c ((this drill-metalhead-eggs-c)) "Initialize the skeleton and animations for this object." (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-metalhead-eggs-c" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-3 param 0) 1.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) (none) ) ;; definition for method 24 of type drill-metalhead-eggs-c ;; WARN: Return type mismatch int vs none. -(defmethod init-collision! drill-metalhead-eggs-c ((obj drill-metalhead-eggs-c)) +(defmethod init-collision! drill-metalhead-eggs-c ((this drill-metalhead-eggs-c)) "Define the collision for this object." - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -1206,7 +1206,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -1229,18 +1229,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-bridge-shot -(defmethod inspect drill-bridge-shot ((obj drill-bridge-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-bridge-shot ((this drill-bridge-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tart-name: ~A~%" (-> obj art-name)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1365,14 +1365,14 @@ This commonly includes things such as: ;; definition for method 11 of type drill-bridge-shot ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-bridge-shot ((obj drill-bridge-shot) (arg0 entity-actor)) +(defmethod init-from-entity! drill-bridge-shot ((this drill-bridge-shot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1403,23 +1403,23 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-bridge-shot" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw force-lod) 1) - (let ((f0-18 (res-lump-float (-> obj entity) 'rotoffset)) - (a1-16 (-> obj root quat)) + (set! (-> this draw force-lod) 1) + (let ((f0-18 (res-lump-float (-> this entity) 'rotoffset)) + (a1-16 (-> this root quat)) ) (quaternion-rotate-y! a1-16 a1-16 f0-18) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj die) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this die) #t) + (go (method-of-object this idle)) ) (none) ) @@ -1437,16 +1437,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-drill -(defmethod inspect drill-drill ((obj drill-drill)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-drill ((this drill-drill)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1473,22 +1473,22 @@ This commonly includes things such as: ;; definition for method 11 of type drill-drill ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-drill ((obj drill-drill) (arg0 entity-actor)) +(defmethod init-from-entity! drill-drill ((this drill-drill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-drill" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj idle)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) (none) ) @@ -1504,18 +1504,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-drop-plat -(defmethod inspect drill-drop-plat ((obj drill-drop-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-drop-plat ((this drill-drop-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type drill-flip-step inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tridden?: ~A~%" (-> obj ridden?)) - (format #t "~2Tnot-ridden-timer: ~D~%" (-> obj not-ridden-timer)) + (format #t "~2Tridden?: ~A~%" (-> this ridden?)) + (format #t "~2Tnot-ridden-timer: ~D~%" (-> this not-ridden-timer)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1548,9 +1548,9 @@ This commonly includes things such as: ) (if (-> self ridden?) (set! (-> self ridden?) #f) - (set! (-> self not-ridden-timer) (current-time)) + (set-time! (-> self not-ridden-timer)) ) - (if (>= (- (current-time) (-> self not-ridden-timer)) (seconds 0.4)) + (if (time-elapsed? (-> self not-ridden-timer) (seconds 0.4)) (go-virtual swing-down) ) ) @@ -1572,32 +1572,32 @@ This commonly includes things such as: (t9-0) ) ) - (if (>= (- (current-time) (-> self not-ridden-timer)) (seconds 2)) + (if (time-elapsed? (-> self not-ridden-timer) (seconds 2)) (send-event self 'trigger) ) ) ) ;; definition for method 38 of type drill-drop-plat -(defmethod get-skel drill-drop-plat ((obj drill-drop-plat)) +(defmethod get-skel drill-drop-plat ((this drill-drop-plat)) (art-group-get-by-name *level* "skel-drill-drop-plat" (the-as (pointer uint32) #f)) ) ;; definition for method 39 of type drill-drop-plat ;; WARN: Return type mismatch int vs none. -(defmethod set-flipped-state drill-drop-plat ((obj drill-drop-plat)) +(defmethod set-flipped-state drill-drop-plat ((this drill-drop-plat)) "Set the state of the platform." - (set! (-> obj not-ridden-timer) (current-time)) - (go (method-of-object obj up)) + (set-time! (-> this not-ridden-timer)) + (go (method-of-object this up)) 0 (none) ) ;; definition for method 31 of type drill-drop-plat ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! drill-drop-plat ((obj drill-drop-plat)) +(defmethod init-plat-collision! drill-drop-plat ((this drill-drop-plat)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s5-0 total-prims) (the-as uint 4)) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) @@ -1633,7 +1633,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) (set! (-> s5-0 rider-max-momentum) 0.0) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) 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 7459950304..3fb114f77e 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-obs_REF.gc @@ -3,86 +3,86 @@ ;; definition for method 15 of type hud-gruntegg ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-gruntegg ((obj hud-gruntegg)) +(defmethod draw hud-gruntegg ((this hud-gruntegg)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 462.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 462.0 (* 130.0 (-> this offset)))) 200 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -25 33) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -25 33) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-gruntegg ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-gruntegg ((obj hud-gruntegg)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-gruntegg ((this hud-gruntegg)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-gruntegg ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-gruntegg ((obj hud-gruntegg)) - (set! (-> obj level) (level-get *level* 'drillmid)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-gruntegg ((this hud-gruntegg)) + (set! (-> this level) (level-get *level* 'drillmid)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #xb1e))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.7) - (set! (-> obj sprites 0 scale-y) 0.7) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #xb1e))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.7) + (set! (-> this sprites 0 scale-y) 0.7) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) ;; definition for method 15 of type hud-crimsonhover ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-crimsonhover ((obj hud-crimsonhover)) +(defmethod draw hud-crimsonhover ((this hud-crimsonhover)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 462.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 462.0 (* 130.0 (-> this offset)))) 200 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -25 33) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -25 33) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-crimsonhover ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-crimsonhover ((obj hud-crimsonhover)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-crimsonhover ((this hud-crimsonhover)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-crimsonhover ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-crimsonhover ((obj hud-crimsonhover)) - (set! (-> obj level) (level-get *level* 'drillmid)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-lower-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-crimsonhover ((this hud-crimsonhover)) + (set! (-> this level) (level-get *level* 'drillmid)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x11 :page #xb1e))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.7) - (set! (-> obj sprites 0 scale-y) 0.7) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x11 :page #xb1e))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.7) + (set! (-> this sprites 0 scale-y) 0.7) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -102,17 +102,17 @@ ) ;; definition for method 3 of type drill-plat-falling -(defmethod inspect drill-plat-falling ((obj drill-plat-falling)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-plat-falling ((this drill-plat-falling)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -124,15 +124,15 @@ ;; definition for method 29 of type drill-plat-falling ;; WARN: Return type mismatch int vs none. -(defmethod start-bouncing! drill-plat-falling ((obj drill-plat-falling)) +(defmethod start-bouncing! drill-plat-falling ((this drill-plat-falling)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (activate! (-> obj smush) -1.0 24 120 1.0 1.0 (-> self clock)) - (set! (-> obj bounce-time) (current-time)) - (set! (-> obj bouncing) #t) - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) + (activate! (-> this smush) -1.0 24 120 1.0 1.0 (-> self clock)) + (set-time! (-> this bounce-time)) + (set! (-> this bouncing) #t) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -179,7 +179,7 @@ and translate the platform via the `smush` (defstate falling (drill-plat-falling) :virtual #t :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 0.4)) + (if (time-elapsed? (-> self state-time) (seconds 0.4)) (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) ) (drill-plat-falling-trans) @@ -197,14 +197,14 @@ and translate the platform via the `smush` ;; definition for method 11 of type drill-plat-falling ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-plat-falling ((obj drill-plat-falling) (arg0 entity-actor)) +(defmethod init-from-entity! drill-plat-falling ((this drill-plat-falling) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) @@ -220,19 +220,19 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-plat-falling" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (stop-bouncing! obj) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (update-transforms (-> obj root)) + (stop-bouncing! this) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (update-transforms (-> this root)) (ja-channel-push! 1 0) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -252,18 +252,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-elevator-shaft -(defmethod inspect drill-elevator-shaft ((obj drill-elevator-shaft)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-elevator-shaft ((this drill-elevator-shaft)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Textent[2] @ #x~X~%" (-> obj extent)) - (format #t "~2Tlength: ~f~%" (-> obj length)) + (format #t "~2Textent[2] @ #x~X~%" (-> this extent)) + (format #t "~2Tlength: ~f~%" (-> this length)) (label cfg-4) - obj + this ) ;; definition of type drill-elevator @@ -278,18 +278,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-elevator -(defmethod inspect drill-elevator ((obj drill-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-elevator ((this drill-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tshaft: #x~X~%" (-> obj shaft)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tshaft: #x~X~%" (-> this shaft)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -299,16 +299,16 @@ This commonly includes things such as: ) ;; definition for method 30 of type drill-elevator -(defmethod get-art-group drill-elevator ((obj drill-elevator)) +(defmethod get-art-group drill-elevator ((this drill-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-drill-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type drill-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! drill-elevator ((obj drill-elevator)) +(defmethod init-plat-collision! drill-elevator ((this drill-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) @@ -339,7 +339,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -436,8 +436,8 @@ This commonly includes things such as: ;; definition for method 21 of type drill-elevator-shaft ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod set-extent! drill-elevator-shaft ((obj drill-elevator-shaft) (arg0 vector)) - (set! (-> obj extent 1 quad) (-> arg0 quad)) +(defmethod set-extent! drill-elevator-shaft ((this drill-elevator-shaft) (arg0 vector)) + (set! (-> this extent 1 quad) (-> arg0 quad)) (none) ) @@ -509,19 +509,19 @@ This commonly includes things such as: ) ;; definition for method 43 of type drill-elevator -(defmethod move-between-points drill-elevator ((obj drill-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points drill-elevator ((this drill-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 20480.0) (< (fabs (-> s4-2 z)) 20480.0)) ) ) @@ -529,38 +529,38 @@ This commonly includes things such as: ) ;; definition for method 10 of type drill-elevator -(defmethod deactivate drill-elevator ((obj drill-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method drill-elevator 10)) obj) +(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) (none) ) ;; definition for method 42 of type drill-elevator ;; WARN: Return type mismatch sound-id vs none. -(defmethod set-ambient-sound! drill-elevator ((obj drill-elevator)) +(defmethod set-ambient-sound! drill-elevator ((this drill-elevator)) "Sets the elevator's [[ambient-sound]] up" - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this sound-id) (new-sound-id)) (none) ) ;; definition for method 40 of type drill-elevator -(defmethod activate-elevator drill-elevator ((obj drill-elevator)) +(defmethod activate-elevator drill-elevator ((this drill-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" (if (or (not (task-node-closed? (game-task-node drill-ship-introduction))) (task-node-closed? (game-task-node nest-boss-resolution)) ) - ((method-of-type elevator activate-elevator) obj) - (go (method-of-object obj dormant)) + ((method-of-type elevator activate-elevator) this) + (go (method-of-object this dormant)) ) ) ;; definition for method 33 of type drill-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! drill-elevator ((obj drill-elevator)) +(defmethod init-plat! drill-elevator ((this drill-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." - (set! (-> obj shaft) - (process-spawn drill-elevator-shaft (-> obj entity extra trans) (-> obj basetrans) :to obj) + (set! (-> this shaft) + (process-spawn drill-elevator-shaft (-> this entity extra trans) (-> this basetrans) :to this) ) 0 (none) @@ -577,17 +577,17 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 3 of type drill-mech-elevator -(defmethod inspect drill-mech-elevator ((obj drill-mech-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-mech-elevator ((this drill-mech-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type drill-elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trunning-sound-id: ~D~%" (-> obj running-sound-id)) + (format #t "~2Trunning-sound-id: ~D~%" (-> this running-sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -642,9 +642,9 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 45 of type drill-mech-elevator -(defmethod commited-to-ride? drill-mech-elevator ((obj drill-mech-elevator)) +(defmethod commited-to-ride? drill-mech-elevator ((this drill-mech-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" - (when (= (-> obj move-pos 1) (-> obj bottom-top 0)) + (when (= (-> this move-pos 1) (-> this bottom-top 0)) (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) s5-0 @@ -653,9 +653,9 @@ For example for an elevator pre-compute the distance between the first and last ) (when (and a0-2 (focus-test? a0-2 mech) (not (logtest? (-> a0-2 focus-status) (focus-status dead ignore)))) (let* ((v1-5 (get-trans a0-2 0)) - (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-5 (-> obj root trans))) + (s5-2 (vector-! (new 'stack-no-clear 'vector) v1-5 (-> this root trans))) ) - (vector-inv-orient-by-quat! s5-2 s5-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s5-2 s5-2 (-> this root quat)) (and (< (fabs (-> s5-2 x)) 16384.0) (< (fabs (-> s5-2 z)) 16384.0)) ) ) @@ -673,7 +673,7 @@ For example for an elevator pre-compute the distance between the first and last ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Stack slot offset 16 signed mismatch ;; WARN: Return type mismatch int vs none. -(defmethod move-to-next-point! drill-mech-elevator ((obj drill-mech-elevator)) +(defmethod move-to-next-point! drill-mech-elevator ((this drill-mech-elevator)) "If the [[*target*]] is in a valid state and there is a point to transition to in the elevator's path do so. @see [[elevator::47]]" @@ -686,14 +686,14 @@ do so. ) ) (set! sv-16 (the-as float 0.0)) - (when (and (find-closest-point-in-path! obj (get-trans a0-1 0) (& sv-16) #t #t) - (!= (-> obj move-pos 1) sv-16) - (= sv-16 (-> obj bottom-top 0)) + (when (and (find-closest-point-in-path! this (get-trans a0-1 0) (& sv-16) #t #t) + (!= (-> this move-pos 1) sv-16) + (= sv-16 (-> this bottom-top 0)) ) - (set! (-> obj move-pos 0) (-> obj move-pos 1)) - (set! (-> obj move-pos 1) sv-16) - (logior! (-> obj elevator-status) (elevator-status moving)) - (go (method-of-object obj running)) + (set! (-> this move-pos 0) (-> this move-pos 1)) + (set! (-> this move-pos 1) sv-16) + (logior! (-> this elevator-status) (elevator-status moving)) + (go (method-of-object this running)) ) ) ) @@ -702,27 +702,27 @@ do so. ) ;; definition for method 10 of type drill-mech-elevator -(defmethod deactivate drill-mech-elevator ((obj drill-mech-elevator)) - (if (nonzero? (-> obj running-sound-id)) - (sound-stop (-> obj running-sound-id)) +(defmethod deactivate drill-mech-elevator ((this drill-mech-elevator)) + (if (nonzero? (-> this running-sound-id)) + (sound-stop (-> this running-sound-id)) ) - ((method-of-type drill-elevator deactivate) obj) + ((method-of-type drill-elevator deactivate) this) (none) ) ;; definition for method 33 of type drill-mech-elevator -(defmethod init-plat! drill-mech-elevator ((obj drill-mech-elevator)) +(defmethod init-plat! drill-mech-elevator ((this drill-mech-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." - (set! (-> obj running-sound-id) (new 'static 'sound-id)) - ((method-of-type drill-elevator init-plat!) obj) + (set! (-> this running-sound-id) (new 'static 'sound-id)) + ((method-of-type drill-elevator init-plat!) this) (none) ) ;; definition for method 40 of type drill-mech-elevator -(defmethod activate-elevator drill-mech-elevator ((obj drill-mech-elevator)) +(defmethod activate-elevator drill-mech-elevator ((this drill-mech-elevator)) "Puts the elevator initially into the correct state. This is typically based upon game completion" - (go (method-of-object obj waiting)) + (go (method-of-object this waiting)) ) ;; definition of type fire-floor @@ -753,29 +753,29 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 3 of type fire-floor -(defmethod inspect fire-floor ((obj fire-floor)) - (when (not obj) - (set! obj obj) +(defmethod inspect fire-floor ((this fire-floor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpart-off: ~A~%" (-> obj part-off)) - (format #t "~2Tsize[2] @ #x~X~%" (-> obj size)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tsound-playing: ~A~%" (-> obj sound-playing)) - (format #t "~2Tdeadly-width: ~f~%" (-> obj deadly-width)) - (format #t "~2Tdeadly-length: ~f~%" (-> obj deadly-length)) - (format #t "~2Tflames-end-tt: ~f~%" (-> obj flames-end-tt)) - (format #t "~2Tgenerous: ~f~%" (-> obj generous)) - (format #t "~2Tno-collision-timer: ~D~%" (-> obj no-collision-timer)) - (format #t "~2Tlocal-to-world: #~%" (-> obj local-to-world)) - (format #t "~2Tworld-to-local: #~%" (-> obj world-to-local)) - (format #t "~2Tsync: #~%" (-> obj sync)) + (format #t "~2Tpart-off: ~A~%" (-> this part-off)) + (format #t "~2Tsize[2] @ #x~X~%" (-> this size)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tsound-playing: ~A~%" (-> this sound-playing)) + (format #t "~2Tdeadly-width: ~f~%" (-> this deadly-width)) + (format #t "~2Tdeadly-length: ~f~%" (-> this deadly-length)) + (format #t "~2Tflames-end-tt: ~f~%" (-> this flames-end-tt)) + (format #t "~2Tgenerous: ~f~%" (-> this generous)) + (format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer)) + (format #t "~2Tlocal-to-world: #~%" (-> this local-to-world)) + (format #t "~2Tworld-to-local: #~%" (-> this world-to-local)) + (format #t "~2Tsync: #~%" (-> this sync)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -792,9 +792,7 @@ For example for an elevator pre-compute the distance between the first and last ) (when gp-0 (when (or (focus-test? (the-as process-focusable gp-0) mech) - (>= (- (current-time) (-> self no-collision-timer)) - (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) - ) + (time-elapsed? (-> self no-collision-timer) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout))) ) (let ((f0-0 (get-norm! (-> self sync) 0))) (when (and (< (-> self generous) f0-0) (< f0-0 (- (-> self flames-end-tt) (-> self generous)))) @@ -937,47 +935,47 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 21 of type fire-floor ;; WARN: Return type mismatch int vs none. -(defmethod set-part fire-floor ((obj fire-floor)) +(defmethod set-part fire-floor ((this fire-floor)) "Set the particle launch controls for the on/off states." - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 399) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 398) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 399) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 398) this)) 0 (none) ) ;; definition for method 7 of type fire-floor ;; WARN: Return type mismatch process-drawable vs fire-floor. -(defmethod relocate fire-floor ((obj fire-floor) (arg0 int)) - (if (nonzero? (-> obj part-off)) - (&+! (-> obj part-off) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method fire-floor 7)) this arg0) ) ) ;; definition for method 10 of type fire-floor -(defmethod deactivate fire-floor ((obj fire-floor)) - (sound-stop (-> obj sound-id)) - (if (nonzero? (-> obj part-off)) - (kill-and-free-particles (-> obj part-off)) +(defmethod deactivate fire-floor ((this fire-floor)) + (sound-stop (-> this sound-id)) + (if (nonzero? (-> this part-off)) + (kill-and-free-particles (-> this part-off)) ) - ((the-as (function process-drawable none) (find-parent-method fire-floor 10)) obj) + ((the-as (function process-drawable none) (find-parent-method fire-floor 10)) this) (none) ) ;; definition for method 11 of type fire-floor ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fire-floor ((obj fire-floor) (arg0 entity-actor)) +(defmethod init-from-entity! fire-floor ((this fire-floor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -990,10 +988,10 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) - (set-part obj) + (process-drawable-from-entity! this arg0) + (set-part this) (let ((a1-4 (new 'stack-no-clear 'sync-info-params))) (let ((v1-9 0)) (if #t @@ -1005,24 +1003,24 @@ This commonly includes things such as: (set! (-> a1-4 entity) arg0) (set! (-> a1-4 period) (the-as uint 2100)) (set! (-> a1-4 percent) 0.0) - (initialize! (-> obj sync) a1-4) + (initialize! (-> this sync) a1-4) ) - (set! (-> obj flames-end-tt) (/ (the float (the int (* 300.0 (res-lump-float arg0 'timeout :default 3.0)))) - (the float (-> obj sync period)) - ) + (set! (-> this flames-end-tt) (/ (the float (the int (* 300.0 (res-lump-float arg0 'timeout :default 3.0)))) + (the float (-> this sync period)) + ) ) - (set! (-> obj generous) (/ 90.0 (the float (-> obj sync period)))) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 arg0 #t)) - (if (-> obj path) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this generous) (/ 90.0 (the float (-> this sync period)))) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #t)) + (if (-> this path) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) ) (let ((s4-1 (new 'stack-no-clear 'matrix3)) - (s3-0 (-> obj local-to-world)) - (s5-1 (-> obj size)) + (s3-0 (-> this local-to-world)) + (s5-1 (-> this size)) ) - (get-point-in-path! (-> obj path) (the-as vector (-> s4-1 vector)) 0.0 'interp) - (get-point-in-path! (-> obj path) (-> s4-1 vector 1) 1.0 'interp) - (get-point-in-path! (-> obj path) (-> s4-1 vector 2) 3.0 'interp) + (get-point-in-path! (-> this path) (the-as vector (-> s4-1 vector)) 0.0 'interp) + (get-point-in-path! (-> this path) (-> s4-1 vector 1) 1.0 'interp) + (get-point-in-path! (-> this path) (-> s4-1 vector 2) 3.0 'interp) (matrix-identity! s3-0) (vector-normalize-copy! (the-as vector (-> s3-0 vector)) @@ -1038,14 +1036,14 @@ This commonly includes things such as: (vector-cross! (-> s3-0 vector 2) (the-as vector (-> s3-0 vector)) (-> s3-0 vector 1)) (vector-normalize! (-> s3-0 vector 2) 1.0) (set! (-> s3-0 trans quad) (-> s4-1 vector 0 quad)) - (matrix-inverse-of-rot-trans! (-> obj world-to-local) (-> obj local-to-world)) - (set! (-> obj deadly-width) (vector-vector-distance (-> s4-1 vector 1) (the-as vector (-> s4-1 vector)))) - (set! (-> obj deadly-length) (vector-vector-distance (-> s4-1 vector 2) (the-as vector (-> s4-1 vector)))) - (let ((v1-39 (-> obj root root-prim))) + (matrix-inverse-of-rot-trans! (-> this world-to-local) (-> this local-to-world)) + (set! (-> this deadly-width) (vector-vector-distance (-> s4-1 vector 1) (the-as vector (-> s4-1 vector)))) + (set! (-> this deadly-length) (vector-vector-distance (-> s4-1 vector 2) (the-as vector (-> s4-1 vector)))) + (let ((v1-39 (-> this root root-prim))) (vector-reset! (-> v1-39 local-sphere)) - (let* ((f0-14 (* 0.5 (-> obj deadly-width))) + (let* ((f0-14 (* 0.5 (-> this deadly-width))) (f0-16 (* f0-14 f0-14)) - (f1-7 (* 0.5 (-> obj deadly-length))) + (f1-7 (* 0.5 (-> this deadly-length))) ) (set! (-> v1-39 local-sphere w) (sqrtf (+ f0-16 (* f1-7 f1-7)))) ) @@ -1061,12 +1059,12 @@ This commonly includes things such as: (a0-42 (+ (-> v1-46 attack-id) 1)) ) (set! (-> v1-46 attack-id) a0-42) - (set! (-> obj attack-id) a0-42) + (set! (-> this attack-id) a0-42) ) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj sound-playing) #f) - (update-transforms (-> obj root)) - (go (method-of-object obj idle)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this sound-playing) #f) + (update-transforms (-> this root)) + (go (method-of-object this idle)) (none) ) @@ -1080,24 +1078,24 @@ This commonly includes things such as: ) ;; definition for method 3 of type fire-floor-a -(defmethod inspect fire-floor-a ((obj fire-floor-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect fire-floor-a ((this fire-floor-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type fire-floor inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 21 of type fire-floor-a ;; WARN: Return type mismatch int vs none. -(defmethod set-part fire-floor-a ((obj fire-floor-a)) +(defmethod set-part fire-floor-a ((this fire-floor-a)) "Set the particle launch controls for the on/off states." - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 401) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 400) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 401) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 400) this)) 0 (none) ) @@ -1172,18 +1170,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-switch -(defmethod inspect drill-switch ((obj drill-switch)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-switch ((this drill-switch)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type basebutton inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tgreen-part: ~A~%" (-> obj green-part)) - (format #t "~2Tdown-frame: ~f~%" (-> obj down-frame)) + (format #t "~2Tgreen-part: ~A~%" (-> this green-part)) + (format #t "~2Tdown-frame: ~f~%" (-> this down-frame)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1194,32 +1192,32 @@ This commonly includes things such as: ;; definition for method 7 of type drill-switch ;; WARN: Return type mismatch basebutton vs drill-switch. -(defmethod relocate drill-switch ((obj drill-switch) (arg0 int)) - (if (nonzero? (-> obj green-part)) - (&+! (-> obj green-part) arg0) +(defmethod relocate drill-switch ((this drill-switch) (arg0 int)) + (if (nonzero? (-> this green-part)) + (&+! (-> this green-part) arg0) ) - (the-as drill-switch ((method-of-type basebutton relocate) obj arg0)) + (the-as drill-switch ((method-of-type basebutton relocate) this arg0)) ) ;; definition for method 10 of type drill-switch -(defmethod deactivate drill-switch ((obj drill-switch)) - (if (nonzero? (-> obj green-part)) - (kill-and-free-particles (-> obj green-part)) +(defmethod deactivate drill-switch ((this drill-switch)) + (if (nonzero? (-> this green-part)) + (kill-and-free-particles (-> this green-part)) ) - ((method-of-type basebutton deactivate) obj) + ((method-of-type basebutton deactivate) this) (none) ) ;; definition for method 40 of type drill-switch -(defmethod set-switch-color drill-switch ((obj drill-switch) (arg0 symbol)) +(defmethod set-switch-color drill-switch ((this drill-switch) (arg0 symbol)) "Set the switch color based on its state." (when (or arg0 (not (logtest? (current-time) 64))) (let ((s4-0 (new 'stack-no-clear 'vector))) - (vector<-cspace+vector! s4-0 (-> obj node-list data 4) (new 'static 'vector :y 6963.2 :w 1.0)) + (vector<-cspace+vector! s4-0 (-> this node-list data 4) (new 'static 'vector :y 6963.2 :w 1.0)) (spawn (if arg0 - (-> obj green-part) - (-> obj part) + (-> this green-part) + (-> this part) ) s4-0 ) @@ -1230,9 +1228,9 @@ This commonly includes things such as: ;; definition for method 34 of type drill-switch ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-34 drill-switch ((obj drill-switch)) +(defmethod basebutton-method-34 drill-switch ((this drill-switch)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle)) @@ -1260,7 +1258,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1376,7 +1374,7 @@ This commonly includes things such as: (sleep-code) ) (else - (until (>= (- (current-time) (-> self state-time)) (the int (* 300.0 (-> self timeout)))) + (until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout)))) (suspend) ) (send-event! self (-> self event-going-up)) @@ -1438,33 +1436,33 @@ This commonly includes things such as: ) ;; definition for method 38 of type drill-switch -(defmethod press! drill-switch ((obj drill-switch) (arg0 symbol)) +(defmethod press! drill-switch ((this drill-switch) (arg0 symbol)) (if arg0 - (logior! (-> obj button-status) (button-status pressed)) - (logclear! (-> obj button-status) (button-status pressed)) + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) ) - (when (not (logtest? (-> obj button-status) (button-status button-status-1))) + (when (not (logtest? (-> this button-status) (button-status button-status-1))) (if arg0 - (process-entity-status! obj (entity-perm-status bit-12) #t) - (process-entity-status! obj (entity-perm-status bit-12) #f) + (process-entity-status! this (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #f) ) ) ) ;; definition for method 33 of type drill-switch ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 drill-switch ((obj drill-switch)) +(defmethod basebutton-method-33 drill-switch ((this drill-switch)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-switch" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) @@ -1476,26 +1474,26 @@ This commonly includes things such as: ;; definition for method 35 of type drill-switch ;; WARN: Return type mismatch int vs none. -(defmethod prepare-trigger-event! drill-switch ((obj drill-switch)) +(defmethod prepare-trigger-event! drill-switch ((this drill-switch)) "Sets `event-going-down` to `'trigger`" - (set! (-> obj down-frame) 2.0) - (logior! (-> obj button-status) (button-status button-status-3)) - (set! (-> obj event-going-down) 'trigger) - (set! (-> obj event-going-up) 'untrigger) - (if (and (= (-> obj entity extra perm task) (game-task drill-mech)) + (set! (-> this down-frame) 2.0) + (logior! (-> this button-status) (button-status button-status-3)) + (set! (-> this event-going-down) 'trigger) + (set! (-> this event-going-up) 'untrigger) + (if (and (= (-> this entity extra perm task) (game-task drill-mech)) (task-node-closed? (game-task-node drill-mech-smash-consoles)) - (= (-> obj timeout) 0.0) + (= (-> this timeout) 0.0) ) - (process-entity-status! obj (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))) - (logior! (-> obj button-status) (button-status pressed)) - (logclear! (-> obj button-status) (button-status pressed)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))) + (logior! (-> this button-status) (button-status pressed)) + (logclear! (-> this button-status) (button-status pressed)) ) - (logior! (-> obj mask) (process-mask collectable)) - (logclear! (-> obj mask) (process-mask no-track)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 451) obj)) - (set! (-> obj green-part) (create-launch-control (-> *part-group-id-table* 452) obj)) + (logior! (-> this mask) (process-mask collectable)) + (logclear! (-> this mask) (process-mask no-track)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 451) this)) + (set! (-> this green-part) (create-launch-control (-> *part-group-id-table* 452) this)) 0 (none) ) @@ -1572,28 +1570,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-laser -(defmethod inspect drill-laser ((obj drill-laser)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-laser ((this drill-laser)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspeed: ~f~%" (-> obj speed)) - (format #t "~2Toffset: ~f~%" (-> obj offset)) - (format #t "~2Tpause: ~f~%" (-> obj pause)) - (format #t "~2Tfiring?: ~A~%" (-> obj firing?)) - (format #t "~2Thit-sound-id: ~D~%" (-> obj hit-sound-id)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Toffset: ~f~%" (-> this offset)) + (format #t "~2Tpause: ~f~%" (-> this pause)) + (format #t "~2Tfiring?: ~A~%" (-> this firing?)) + (format #t "~2Thit-sound-id: ~D~%" (-> this hit-sound-id)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) (label cfg-4) - obj + this ) ;; definition for method 10 of type drill-laser -(defmethod deactivate drill-laser ((obj drill-laser)) - (sound-stop (-> obj hit-sound-id)) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate drill-laser ((this drill-laser)) + (sound-stop (-> this hit-sound-id)) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -1601,7 +1599,7 @@ This commonly includes things such as: (defstate drill-laser-idle (drill-laser) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let* ((f0-2 (+ (* 0.0033333334 (the float (- (current-time) (-> self state-time)))) @@ -1700,7 +1698,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-laser ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-laser ((obj drill-laser) (arg0 entity-actor)) +(defmethod init-from-entity! drill-laser ((this drill-laser) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1708,13 +1706,13 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj firing?) #f) - (set! (-> obj hit-sound-id) (new 'static 'sound-id)) - (set! (-> obj root) (new 'process 'trsqv)) - (set! (-> obj root trans quad) (-> arg0 extra trans quad)) - (quaternion-copy! (-> obj root quat) (-> arg0 quat)) - (vector-identity! (-> obj root scale)) - (set! (-> obj entity) arg0) + (set! (-> this firing?) #f) + (set! (-> this hit-sound-id) (new 'static 'sound-id)) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (vector-identity! (-> this root scale)) + (set! (-> this entity) arg0) (let ((f30-0 1.0) (f28-0 0.0) (f26-0 3.0) @@ -1727,11 +1725,11 @@ This commonly includes things such as: (set! f26-0 (-> v1-8 2)) ) ) - (set! (-> obj speed) f30-0) - (set! (-> obj offset) f28-0) - (set! (-> obj pause) f26-0) + (set! (-> this speed) f30-0) + (set! (-> this offset) f28-0) + (set! (-> this pause) f26-0) ) - (go (method-of-object obj drill-laser-idle)) + (go (method-of-object this drill-laser-idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc index 6d986fed32..9cc11f6190 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-panel_REF.gc @@ -37,39 +37,39 @@ ) ;; definition for method 3 of type drill-control-panel -(defmethod inspect drill-control-panel ((obj drill-control-panel)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-control-panel ((this drill-control-panel)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tid: ~D~%" (-> obj id)) - (format #t "~2Tidle-sound-id: ~D~%" (-> obj idle-sound-id)) - (format #t "~2Tdebris-part: ~A~%" (-> obj debris-part)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tnext-warn-time: ~D~%" (-> obj next-warn-time)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Tidle-sound-id: ~D~%" (-> this idle-sound-id)) + (format #t "~2Tdebris-part: ~A~%" (-> this debris-part)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tnext-warn-time: ~D~%" (-> this next-warn-time)) (label cfg-4) - obj + this ) ;; definition for method 7 of type drill-control-panel ;; WARN: Return type mismatch process-drawable vs drill-control-panel. -(defmethod relocate drill-control-panel ((obj drill-control-panel) (arg0 int)) - (if (nonzero? (-> obj debris-part)) - (&+! (-> obj debris-part) arg0) +(defmethod relocate drill-control-panel ((this drill-control-panel) (arg0 int)) + (if (nonzero? (-> this debris-part)) + (&+! (-> this debris-part) arg0) ) - (the-as drill-control-panel ((method-of-type process-drawable relocate) obj arg0)) + (the-as drill-control-panel ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type drill-control-panel -(defmethod deactivate drill-control-panel ((obj drill-control-panel)) - (sound-stop (-> obj idle-sound-id)) - (if (nonzero? (-> obj debris-part)) - (kill-and-free-particles (-> obj debris-part)) +(defmethod deactivate drill-control-panel ((this drill-control-panel)) + (sound-stop (-> this idle-sound-id)) + (if (nonzero? (-> this debris-part)) + (kill-and-free-particles (-> this debris-part)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -517,34 +517,34 @@ ) ;; definition for method 32 of type drill-control-panel -(defmethod spawn-explode-part drill-control-panel ((obj drill-control-panel)) +(defmethod spawn-explode-part drill-control-panel ((this drill-control-panel)) "Spawn explosion particles." - (let ((v1-0 (-> obj id))) + (let ((v1-0 (-> this id))) (if (or (zero? v1-0) (= v1-0 1)) - (spawn-drill-panel-explode obj) - (spawn-drill-panel-ab-explode obj) + (spawn-drill-panel-explode this) + (spawn-drill-panel-ab-explode this) ) ) (none) ) ;; definition for method 31 of type drill-control-panel -(defmethod spawn-shock-part drill-control-panel ((obj drill-control-panel)) +(defmethod spawn-shock-part drill-control-panel ((this drill-control-panel)) "Spawn shock particles." - (let ((v1-0 (-> obj id))) + (let ((v1-0 (-> this id))) (cond ((or (zero? v1-0) (= v1-0 1)) (set! (-> *part-id-table* 1852 init-specs 2 initial-valuef) (* 4096.0 (rand-vu-float-range -4.0 4.0))) (set! (-> *part-id-table* 1852 init-specs 3 initial-valuef) (* 4096.0 (rand-vu-float-range -2.0 2.0))) (set! (-> *part-id-table* 1852 init-specs 4 initial-valuef) (* 4096.0 (rand-vu-float-range 1.0 3.0))) - (when (= (-> obj id) 1) + (when (= (-> this id) 1) (set! (-> *part-id-table* 1870 init-specs 3 initial-valuef) 8192.0) (set! (-> *part-id-table* 1869 init-specs 3 initial-valuef) 8192.0) (set! (-> *part-id-table* 1871 init-specs 2 initial-valuef) 8192.0) (set! (-> *part-id-table* 1872 init-specs 2 initial-valuef) 8192.0) (set! (-> *part-id-table* 1873 init-specs 2 initial-valuef) 8192.0) - (when (>= (current-time) (-> obj next-warn-time)) - (set! (-> obj next-warn-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.0 2.0))))) + (when (>= (current-time) (-> this next-warn-time)) + (set! (-> this next-warn-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.0 2.0))))) (set! (-> *part-id-table* 1851 init-specs 4 initial-valuef) -4096.0) (set! (-> *part-id-table* 1851 init-specs 24 initial-valuef) (* 182.04445 (rand-vu-float-range -45.0 45.0))) (set! (-> *part-id-table* 1851 init-specs 25 initial-valuef) (* 182.04445 (rand-vu-float-range 0.0 45.0))) @@ -552,14 +552,14 @@ (set! (-> *part-id-table* 1851 init-specs 3 initial-valuef) (* 4096.0 (rand-vu-float-range -1.0 3.0))) ) ) - (spawn-with-cspace (-> obj debris-part) (-> obj node-list data 18)) + (spawn-with-cspace (-> this debris-part) (-> this node-list data 18)) ) (else - (case (-> obj id) + (case (-> this id) ((3 5 7 8) (if (zero? (rand-vu-int-count 2)) (process-drawable-shock-effect - obj + this (new 'static 'lightning-spec :name #f :flags (lightning-spec-flags lsf0) @@ -597,14 +597,14 @@ (set! (-> *part-id-table* 1871 init-specs 2 initial-valuef) -6144.0) (set! (-> *part-id-table* 1872 init-specs 2 initial-valuef) -6144.0) (set! (-> *part-id-table* 1873 init-specs 2 initial-valuef) -6144.0) - (when (>= (current-time) (-> obj next-warn-time)) - (set! (-> obj next-warn-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.5 3.0))))) + (when (>= (current-time) (-> this next-warn-time)) + (set! (-> this next-warn-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.5 3.0))))) (set! (-> *part-id-table* 1851 init-specs 4 initial-valuef) 4096.0) (set! (-> *part-id-table* 1879 init-specs 23 initial-valuef) (* 182.04445 (rand-vu-float-range -30.0 30.0))) (set! (-> *part-id-table* 1879 init-specs 2 initial-valuef) (* 4096.0 (rand-vu-float-range -1.5 1.5))) (set! (-> *part-id-table* 1879 init-specs 3 initial-valuef) (* 4096.0 (rand-vu-float-range -1.0 3.0))) ) - (spawn-with-cspace (-> obj debris-part) (-> obj node-list data 12)) + (spawn-with-cspace (-> this debris-part) (-> this node-list data 12)) ) ) ) @@ -615,8 +615,8 @@ (defstate hit (drill-control-panel) :virtual #t :enter (behavior ((arg0 symbol)) - (set! (-> self state-time) (current-time)) - (set! (-> self next-warn-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self next-warn-time)) (process-entity-status! self (entity-perm-status bit-12) #t) (set! (-> self draw force-lod) 0) (logior! (-> self focus-status) (focus-status disable dead ignore)) @@ -626,7 +626,7 @@ ) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (time-elapsed? (-> self state-time) (seconds 1)) (spawn-shock-part self) ) ) @@ -698,9 +698,9 @@ ;; definition for method 29 of type drill-control-panel ;; WARN: Return type mismatch int vs none. -(defmethod init-collision! drill-control-panel ((obj drill-control-panel)) +(defmethod init-collision! drill-control-panel ((this drill-control-panel)) "Define the collision for the panel." - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -720,7 +720,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -728,47 +728,47 @@ ;; definition for method 30 of type drill-control-panel ;; WARN: Return type mismatch int vs none. -(defmethod init-panel drill-control-panel ((obj drill-control-panel)) +(defmethod init-panel drill-control-panel ((this drill-control-panel)) "Init some parameters for the panel." - (set! (-> obj idle-sound-id) (new-sound-id)) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) + (set! (-> this idle-sound-id) (new-sound-id)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) 0 (none) ) ;; definition for method 11 of type drill-control-panel ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-control-panel ((obj drill-control-panel) (arg0 entity-actor)) +(defmethod init-from-entity! drill-control-panel ((this drill-control-panel) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-control-panel" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (init-panel obj) + (init-panel this) (transform-post) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 427) obj)) - (if (zero? (-> obj id)) - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 436) obj)) - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 437) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 427) this)) + (if (zero? (-> this id)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 436) this)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 437) this)) ) (if (task-node-closed? (game-task-node drill-mech-smash-consoles)) - (process-entity-status! obj (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))) - (go (method-of-object obj hit) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))) + (go (method-of-object this hit) #t) + (go (method-of-object this idle)) ) (none) ) @@ -783,62 +783,62 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-control-panel-a -(defmethod inspect drill-control-panel-a ((obj drill-control-panel-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-control-panel-a ((this drill-control-panel-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type drill-control-panel inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type drill-control-panel-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-control-panel-a ((obj drill-control-panel-a) (arg0 entity-actor)) +(defmethod init-from-entity! drill-control-panel-a ((this drill-control-panel-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-control-panel-a" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj root root-prim transform-index) (the-as int (-> obj draw origin-joint-index))) - (init-panel obj) - (set! (-> obj draw force-lod) 1) + (set! (-> this root root-prim transform-index) (the-as int (-> this draw origin-joint-index))) + (init-panel this) + (set! (-> this draw force-lod) 1) (transform-post) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 428) obj)) - (case (-> obj id) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 428) this)) + (case (-> this id) ((3 6 8) - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 438) obj)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 438) this)) ) ((5 9) - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 440) obj)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 440) this)) ) ((7) - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 441) obj)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 441) this)) ) (else - (set! (-> obj debris-part) (create-launch-control (-> *part-group-id-table* 439) obj)) + (set! (-> this debris-part) (create-launch-control (-> *part-group-id-table* 439) this)) ) ) (if (task-node-closed? (game-task-node drill-mech-smash-consoles)) - (process-entity-status! obj (entity-perm-status bit-12) #t) + (process-entity-status! this (entity-perm-status bit-12) #t) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status bit-12))) - (go (method-of-object obj hit) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status bit-12))) + (go (method-of-object this hit) #t) + (go (method-of-object this idle)) ) (none) ) @@ -872,16 +872,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-control-panel-b -(defmethod inspect drill-control-panel-b ((obj drill-control-panel-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-control-panel-b ((this drill-control-panel-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type drill-control-panel-a inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/drill/drill-part_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-part_REF.gc index cdc83b3370..d2b7a80ab3 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type drill-part -(defmethod inspect drill-part ((obj drill-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-part ((this drill-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc b/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc index 4e79bae2d8..336282ad3d 100644 --- a/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drill-spool_REF.gc @@ -778,19 +778,19 @@ ) ;; definition for method 3 of type drill-wall -(defmethod inspect drill-wall ((obj drill-wall)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-wall ((this drill-wall)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tart-name: ~A~%" (-> obj art-name)) - (format #t "~2Tegg-group: ~A~%" (-> obj egg-group)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) + (format #t "~2Tegg-group: ~A~%" (-> this egg-group)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -856,7 +856,7 @@ ;; definition for method 11 of type drill-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-wall ((obj drill-wall) (arg0 entity-actor)) +(defmethod init-from-entity! drill-wall ((this drill-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -864,10 +864,10 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (let ((s3-0 ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'art-name 'interp -1000000000.0 @@ -878,8 +878,8 @@ This commonly includes things such as: ) (s4-0 (art-group-get-by-name *level* "skel-drill-wall" (the-as (pointer uint32) #f))) ) - (set! (-> obj art-name) (the-as string s3-0)) - (let ((s2-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this art-name) (the-as string s3-0)) + (let ((s2-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s2-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s2-0 reaction) cshape-reaction-default) (set! (-> s2-0 no-reaction) @@ -900,42 +900,42 @@ This commonly includes things such as: (set! (-> s2-0 backup-collide-as) (-> v1-22 prim-core collide-as)) (set! (-> s2-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) - (set! (-> obj root) s2-0) + (set! (-> this root) s2-0) ) - (if (string= (-> obj art-name) "drill-wall-1") - (set! (-> obj anim) + (if (string= (-> this art-name) "drill-wall-1") + (set! (-> this anim) (new 'static 'spool-anim :name "drill-wall-1" :anim-name "1-break" :parts 1 :command-list '()) ) (go process-drawable-art-error (the-as string s3-0)) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0)) ) (ja-channel-set! 1) - (let* ((s5-1 (-> obj skel root-channel 0)) - (s4-1 (-> obj draw art-group)) + (let* ((s5-1 (-> this skel root-channel 0)) + (s4-1 (-> this draw art-group)) (s3-1 (method-of-object s4-1 get-art-by-name-method)) ) - (format (clear *temp-string*) "~S-idle" (-> obj art-name)) + (format (clear *temp-string*) "~S-idle" (-> this art-name)) (set! (-> s5-1 frame-group) (the-as art-joint-anim (s3-1 s4-1 *temp-string* (the-as type #f)))) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-35 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-35 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (cond ((and v1-35 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj egg-group) (-> v1-35 0)) + (set! (-> this egg-group) (-> v1-35 0)) ) (else ) ) ) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj hit) #t) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this hit) #t) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -958,19 +958,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-crane -(defmethod inspect drill-crane ((obj drill-crane)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-crane ((this drill-crane)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tart-name: ~A~%" (-> obj art-name)) - (format #t "~2Tegg-group: ~A~%" (-> obj egg-group)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) + (format #t "~2Tegg-group: ~A~%" (-> this egg-group)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1063,7 +1063,7 @@ This commonly includes things such as: ;; definition for method 11 of type drill-crane ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-crane ((obj drill-crane) (arg0 entity-actor)) +(defmethod init-from-entity! drill-crane ((this drill-crane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1071,13 +1071,13 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (let ((s3-0 "drill-crane-break") (s4-0 (art-group-get-by-name *level* "skel-drill-crane" (the-as (pointer uint32) #f))) ) - (set! (-> obj art-name) s3-0) - (let ((s3-1 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this art-name) s3-0) + (let ((s3-1 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s3-1 dynam) (copy *standard-dynamics* 'process)) (set! (-> s3-1 reaction) cshape-reaction-default) (set! (-> s3-1 no-reaction) @@ -1098,16 +1098,16 @@ This commonly includes things such as: (set! (-> s3-1 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s3-1 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s3-1) + (set! (-> this root) s3-1) ) - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "drill-crane-break" :anim-name "break" :parts 3 :command-list '()) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0)) ) - (set! (-> obj draw force-lod) 1) - (let ((s4-1 (-> obj root))) + (set! (-> this draw force-lod) 1) + (let ((s4-1 (-> this root))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-28 (res-lump-data arg0 'scale-mult (pointer float) :tag-ptr (& sv-16)))) (when v1-28 @@ -1118,24 +1118,24 @@ This commonly includes things such as: ) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-30 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (let ((v1-30 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-32)))) (cond ((and v1-30 (nonzero? (-> sv-32 elt-count))) - (set! (-> obj egg-group) (the-as actor-group (-> (the-as (pointer uint32) v1-30)))) + (set! (-> this egg-group) (the-as actor-group (-> (the-as (pointer uint32) v1-30)))) ) (else ) ) ) (cond - ((or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + ((or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (task-node-closed? (game-task-node drill-eggs-resolution)) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj hit) #t) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this hit) #t) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (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 0cb025a4e8..9fe455e0f1 100644 --- a/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/drillmid-obs_REF.gc @@ -17,28 +17,28 @@ ) ;; definition for method 3 of type drill-elevator-doors -(defmethod inspect drill-elevator-doors ((obj drill-elevator-doors)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-elevator-doors ((this drill-elevator-doors)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type drill-elevator-doors ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-elevator-doors ((obj drill-elevator-doors) (arg0 entity-actor)) +(defmethod init-from-entity! drill-elevator-doors ((this drill-elevator-doors) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -67,24 +67,24 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-elevator-doors" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj inner?) #t) - (set! (-> obj sound-behind?) #t) - (set! (-> obj sound-open-loop) (static-sound-spec "drl-elev-door-l")) - (set! (-> obj sound-open-stop) (static-sound-spec "drl-elev-door-e")) - (set! (-> obj sound-close-loop) (static-sound-spec "drl-elev-door-l")) - (set! (-> obj sound-close-stop) (static-sound-spec "drl-elev-door-e")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this inner?) #t) + (set! (-> this sound-behind?) #t) + (set! (-> this sound-open-loop) (static-sound-spec "drl-elev-door-l")) + (set! (-> this sound-open-stop) (static-sound-spec "drl-elev-door-e")) + (set! (-> this sound-close-loop) (static-sound-spec "drl-elev-door-l")) + (set! (-> this sound-close-stop) (static-sound-spec "drl-elev-door-e")) + (go (method-of-object this close) #t) (none) ) @@ -102,17 +102,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-lift -(defmethod inspect drill-lift ((obj drill-lift)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-lift ((this drill-lift)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -122,25 +122,25 @@ This commonly includes things such as: ) ;; definition for method 30 of type drill-lift -(defmethod get-art-group drill-lift ((obj drill-lift)) +(defmethod get-art-group drill-lift ((this drill-lift)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-drill-lift" (the-as (pointer uint32) #f)) ) ;; definition for method 43 of type drill-lift -(defmethod move-between-points drill-lift ((obj drill-lift) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points drill-lift ((this drill-lift) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) ) ) @@ -148,7 +148,7 @@ This commonly includes things such as: ) ;; definition for method 45 of type drill-lift -(defmethod commited-to-ride? drill-lift ((obj drill-lift)) +(defmethod commited-to-ride? drill-lift ((this drill-lift)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -158,9 +158,9 @@ This commonly includes things such as: ) (when a0-2 (let* ((v1-1 (get-trans a0-2 0)) - (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> obj root trans))) + (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this root trans))) ) - (vector-inv-orient-by-quat! gp-2 gp-2 (-> obj root quat)) + (vector-inv-orient-by-quat! gp-2 gp-2 (-> this root quat)) (and (< (fabs (-> gp-2 x)) 20480.0) (< 0.0 (-> gp-2 z)) (< (-> gp-2 z) 40960.0)) ) ) @@ -169,8 +169,8 @@ This commonly includes things such as: ;; definition for method 49 of type drill-lift ;; WARN: Return type mismatch int vs none. -(defmethod set-collide-spec! drill-lift ((obj drill-lift) (arg0 symbol)) - (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) +(defmethod set-collide-spec! drill-lift ((this drill-lift) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle pusher)) @@ -237,9 +237,9 @@ This commonly includes things such as: ) ;; definition for method 31 of type drill-lift -(defmethod init-plat-collision! drill-lift ((obj drill-lift)) +(defmethod init-plat-collision! drill-lift ((this drill-lift)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -272,9 +272,9 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set-collide-spec! obj #f) + (set-collide-spec! this #f) (none) ) @@ -288,16 +288,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-moving-staircase -(defmethod inspect drill-moving-staircase ((obj drill-moving-staircase)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-moving-staircase ((this drill-moving-staircase)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type conveyor inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -307,26 +307,26 @@ This commonly includes things such as: ) ;; definition for method 22 of type drill-moving-staircase -(defmethod get-art-group drill-moving-staircase ((obj drill-moving-staircase)) +(defmethod get-art-group drill-moving-staircase ((this drill-moving-staircase)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-drill-moving-staircase" (the-as (pointer uint32) #f)) ) ;; definition for method 24 of type drill-moving-staircase ;; WARN: Return type mismatch float vs none. -(defmethod init! drill-moving-staircase ((obj drill-moving-staircase)) +(defmethod init! drill-moving-staircase ((this drill-moving-staircase)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj speed) 38912.0) - (set! (-> obj belt-radius) 11878.4) - (set! (-> obj pull-y-threshold) 409.6) + (set! (-> this speed) 38912.0) + (set! (-> this belt-radius) 11878.4) + (set! (-> this pull-y-threshold) 409.6) (none) ) ;; definition for method 23 of type drill-moving-staircase ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! drill-moving-staircase ((obj drill-moving-staircase)) +(defmethod reset-root! drill-moving-staircase ((this drill-moving-staircase)) "Re-initializes the `root` [[trsqv]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -347,7 +347,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc b/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc index b181dedfe7..c29c40268b 100644 --- a/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc +++ b/test/decompiler/reference/jak2/levels/drill/ginsu_REF.gc @@ -125,15 +125,15 @@ ) ;; definition for method 3 of type ginsu-anim-info -(defmethod inspect ginsu-anim-info ((obj ginsu-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect ginsu-anim-info ((this ginsu-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ginsu-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "[~8x] ~A~%" this 'ginsu-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) (label cfg-4) - obj + this ) ;; definition of type ginsu-global-info @@ -147,16 +147,16 @@ ) ;; definition for method 3 of type ginsu-global-info -(defmethod inspect ginsu-global-info ((obj ginsu-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect ginsu-global-info ((this ginsu-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) (label cfg-4) - obj + this ) ;; definition of type ginsu @@ -191,30 +191,30 @@ ) ;; definition for method 3 of type ginsu -(defmethod inspect ginsu ((obj ginsu)) - (when (not obj) - (set! obj obj) +(defmethod inspect ginsu ((this ginsu)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tblade-jm: ~A~%" (-> obj blade-jm)) - (format #t "~2Tblade-speed: #~%" (-> obj blade-speed)) - (format #t "~2Tblade-angle: ~f~%" (-> obj blade-angle)) - (format #t "~2Tdesired-distance: ~f~%" (-> obj desired-distance)) - (format #t "~2Tspiral-time: ~D~%" (-> obj spiral-time)) - (format #t "~2Tblade-part: ~A~%" (-> obj blade-part)) - (format #t "~2Tambush-path: ~A~%" (-> obj ambush-path)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tambush-started: ~A~%" (-> obj ambush-started)) - (format #t "~2Tblade-sound: ~D~%" (-> obj blade-sound)) - (format #t "~2Tblade-sound-playing: ~A~%" (-> obj blade-sound-playing)) - (format #t "~2Tgrind-sound: ~D~%" (-> obj grind-sound)) - (format #t "~2Tgrind-sound-playing: ~A~%" (-> obj grind-sound-playing)) - (format #t "~2Tgrind-timer: ~D~%" (-> obj grind-timer)) + (format #t "~2Tblade-jm: ~A~%" (-> this blade-jm)) + (format #t "~2Tblade-speed: #~%" (-> this blade-speed)) + (format #t "~2Tblade-angle: ~f~%" (-> this blade-angle)) + (format #t "~2Tdesired-distance: ~f~%" (-> this desired-distance)) + (format #t "~2Tspiral-time: ~D~%" (-> this spiral-time)) + (format #t "~2Tblade-part: ~A~%" (-> this blade-part)) + (format #t "~2Tambush-path: ~A~%" (-> this ambush-path)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tambush-started: ~A~%" (-> this ambush-started)) + (format #t "~2Tblade-sound: ~D~%" (-> this blade-sound)) + (format #t "~2Tblade-sound-playing: ~A~%" (-> this blade-sound-playing)) + (format #t "~2Tgrind-sound: ~D~%" (-> this grind-sound)) + (format #t "~2Tgrind-sound-playing: ~A~%" (-> this grind-sound-playing)) + (format #t "~2Tgrind-timer: ~D~%" (-> this grind-timer)) (label cfg-4) - obj + this ) ;; definition for symbol *ginsu-global-info*, type ginsu-global-info @@ -366,20 +366,20 @@ ;; definition for method 180 of type ginsu ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ginsu-method-180 ginsu ((obj ginsu)) - (let ((v1-2 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) +(defmethod ginsu-method-180 ginsu ((this ginsu)) + (let ((v1-2 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (when (not (and v1-2 (or (= v1-2 (-> obj draw art-group data 11)) (= v1-2 (-> obj draw art-group data 12))))) - (update! (-> obj blade-speed) 0.0) - (let ((f0-1 (+ (-> obj blade-angle) (* 970903.75 (-> obj blade-speed value))))) - (set! (-> obj blade-angle) (- f0-1 (* (the float (the int (/ f0-1 65536.0))) 65536.0))) + (when (not (and v1-2 (or (= v1-2 (-> this draw art-group data 11)) (= v1-2 (-> this draw art-group data 12))))) + (update! (-> this blade-speed) 0.0) + (let ((f0-1 (+ (-> this blade-angle) (* 970903.75 (-> this blade-speed value))))) + (set! (-> this blade-angle) (- f0-1 (* (the float (the int (/ f0-1 65536.0))) 65536.0))) ) - (quaternion-axis-angle! (-> obj blade-jm quat) 0.0 1.0 0.0 (-> obj blade-angle)) + (quaternion-axis-angle! (-> this blade-jm quat) 0.0 1.0 0.0 (-> this blade-angle)) (let ((s5-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-1 (-> obj node-list data 8 bone transform)) + (let* ((a2-1 (-> this node-list data 8 bone transform)) (v1-14 (-> a2-1 quad 0)) (a0-10 (-> a2-1 quad 1)) (a1-3 (-> a2-1 quad 2)) @@ -390,11 +390,11 @@ (set! (-> s5-0 quad 2) a1-3) (set! (-> s5-0 trans quad) a2-2) ) - (when (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (when (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) (vector-negate! (the-as vector (-> s5-0 vector)) (the-as vector (-> s5-0 vector))) (set! (-> s5-0 vector 0 w) 0.0) ) - (spawn-with-matrix (-> obj blade-part) s5-0) + (spawn-with-matrix (-> this blade-part) s5-0) ) ) ) @@ -403,11 +403,11 @@ ) ;; definition for method 181 of type ginsu -(defmethod ginsu-method-181 ginsu ((obj ginsu) (arg0 vector)) +(defmethod ginsu-method-181 ginsu ((this ginsu) (arg0 vector)) (vector-reset! arg0) - (let ((a0-2 (handle->process (-> obj focus handle)))) + (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 - (vector-! arg0 (get-trans (the-as process-focusable a0-2) 0) (-> obj root trans)) + (vector-! arg0 (get-trans (the-as process-focusable a0-2) 0) (-> this root trans)) ) ) arg0 @@ -415,61 +415,61 @@ ;; definition for method 55 of type ginsu ;; WARN: Return type mismatch symbol vs none. -(defmethod track-target! ginsu ((obj ginsu)) +(defmethod track-target! ginsu ((this ginsu)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (ginsu-method-180 obj) + (ginsu-method-180 this) (let ((t9-1 (method-of-type nav-enemy track-target!))) - (t9-1 obj) + (t9-1 this) ) (cond - ((not (and (-> obj next-state) (let ((v1-6 (-> obj next-state name))) - (or (= v1-6 'idle) - (= v1-6 'active) - (= v1-6 'dormant) - (= v1-6 'ambush) - (= v1-6 'knocked) - (= v1-6 'idle) - (= v1-6 'dormant) - (= v1-6 'die) - (= v1-6 'die-falling) - ) - ) + ((not (and (-> this next-state) (let ((v1-6 (-> this next-state name))) + (or (= v1-6 'idle) + (= v1-6 'active) + (= v1-6 'dormant) + (= v1-6 'ambush) + (= v1-6 'knocked) + (= v1-6 'idle) + (= v1-6 'dormant) + (= v1-6 'die) + (= v1-6 'die-falling) + ) + ) ) ) - (sound-play "ginsu-loop" :id (-> obj blade-sound) :position (-> obj root trans)) - (set! (-> obj blade-sound-playing) #t) + (sound-play "ginsu-loop" :id (-> this blade-sound) :position (-> this root trans)) + (set! (-> this blade-sound-playing) #t) ) - ((-> obj blade-sound-playing) - (sound-stop (-> obj blade-sound)) - (set! (-> obj blade-sound-playing) #f) + ((-> this blade-sound-playing) + (sound-stop (-> this blade-sound)) + (set! (-> this blade-sound-playing) #f) ) ) (cond - ((and (not (and (-> obj next-state) (let ((v1-17 (-> obj next-state name))) - (or (= v1-17 'idle) - (= v1-17 'active) - (= v1-17 'dormant) - (= v1-17 'ambush) - (= v1-17 'knocked) - (= v1-17 'idle) - (= v1-17 'dormant) - (= v1-17 'die) - (= v1-17 'die-falling) - ) - ) + ((and (not (and (-> this next-state) (let ((v1-17 (-> this next-state name))) + (or (= v1-17 'idle) + (= v1-17 'active) + (= v1-17 'dormant) + (= v1-17 'ambush) + (= v1-17 'knocked) + (= v1-17 'idle) + (= v1-17 'dormant) + (= v1-17 'die) + (= v1-17 'die-falling) + ) + ) ) ) - (< (- (current-time) (-> obj grind-timer)) 0) + (< (- (current-time) (-> this grind-timer)) 0) ) - (sound-play "ginsu-grind" :id (-> obj grind-sound) :position (-> obj root trans)) - (set! (-> obj grind-sound-playing) #t) + (sound-play "ginsu-grind" :id (-> this grind-sound) :position (-> this root trans)) + (set! (-> this grind-sound-playing) #t) ) - ((-> obj grind-sound-playing) - (sound-stop (-> obj grind-sound)) - (set! (-> obj grind-sound-playing) #f) + ((-> this grind-sound-playing) + (sound-stop (-> this grind-sound)) + (set! (-> this grind-sound-playing) #f) ) ) (none) @@ -478,54 +478,54 @@ ;; definition for method 182 of type ginsu ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod ginsu-method-182 ginsu ((obj ginsu)) +(defmethod ginsu-method-182 ginsu ((this ginsu)) (local-vars (s5-1 art-element)) (let ((s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'matrix)) ) - (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) - (let* ((v1-8 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let* ((v1-8 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) - (f30-0 (if (and v1-8 (= v1-8 (-> obj draw art-group data 7))) + (f30-0 (if (and v1-8 (= v1-8 (-> this draw art-group data 7))) (cos 9102.223) (cos 7281.778) ) ) ) - (let ((a1-0 (-> obj nav state))) + (let ((a1-0 (-> this nav state))) (set! (-> s5-0 quad) (-> a1-0 velocity quad)) ) - (quaternion->matrix s4-0 (-> obj root quat)) + (quaternion->matrix s4-0 (-> this root quat)) (let ((f0-1 (vector-dot s5-0 (the-as vector (-> s4-0 vector))))) - (if (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags)) + (if (logtest? (enemy-flag dislike-combo) (-> this enemy-flags)) (set! f0-1 (- f0-1)) ) (cond ((< (- f30-0) f0-1) - (set! s5-1 (-> obj draw art-group data 9)) + (set! s5-1 (-> this draw art-group data 9)) ) ((< f0-1 f30-0) - (set! s5-1 (-> obj draw art-group data 8)) + (set! s5-1 (-> this draw art-group data 8)) ) (else - (set! s5-1 (-> obj draw art-group data 7)) + (set! s5-1 (-> this draw art-group data 7)) ) ) ) ) ) - (let ((v1-33 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-33 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond ((and v1-33 (= v1-33 s5-1)) - (let ((a0-11 (-> obj skel root-channel 0))) + (let ((a0-11 (-> this skel root-channel 0))) (set! (-> a0-11 param 0) 1.0) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) ) @@ -533,8 +533,8 @@ (else (let ((f30-2 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) (ja-channel-push! 1 (seconds 0.5)) - (set! (-> obj skel root-channel 0 frame-group) (the-as art-joint-anim s5-1)) - (let ((gp-1 (-> obj skel root-channel 0))) + (set! (-> this skel root-channel 0 frame-group) (the-as art-joint-anim s5-1)) + (let ((gp-1 (-> this skel root-channel 0))) (set! (-> gp-1 num-func) num-func-identity) (set! (-> gp-1 frame-num) (* f30-2 (the float (ja-num-frames 0)))) ) @@ -549,12 +549,12 @@ ;; definition for method 142 of type ginsu ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 ginsu ((obj ginsu) (arg0 nav-control)) +(defmethod nav-enemy-method-142 ginsu ((this ginsu) (arg0 nav-control)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (let ((a0-2 (handle->process (-> obj focus handle)))) + (let ((a0-2 (handle->process (-> this focus handle)))) (cond (a0-2 - (vector-! s3-0 (get-trans (the-as process-focusable a0-2) 0) (-> obj root trans)) + (vector-! s3-0 (get-trans (the-as process-focusable a0-2) 0) (-> this root trans)) ) (else (let ((a0-7 (-> arg0 state))) @@ -566,7 +566,7 @@ (set! (-> s3-0 y) 0.0) (vector-normalize! s3-0 1.0) (let ((s5-3 (new 'stack-no-clear 'quaternion)) - (s4-0 (-> obj root quat)) + (s4-0 (-> this root quat)) ) (quaternion-set! s5-3 0.0 (sqrtf (* 0.5 (- 1.0 (-> s3-0 z)))) 0.0 (sqrtf (* 0.5 (+ 1.0 (-> s3-0 z))))) (if (< (-> s3-0 x) 0.0) @@ -576,7 +576,7 @@ s4-0 s4-0 s5-3 - (* (fmax 0.5 (* 0.00024414062 (-> obj nav state speed))) (seconds-per-frame)) + (* (fmax 0.5 (* 0.00024414062 (-> this nav state speed))) (seconds-per-frame)) ) ) ) @@ -586,7 +586,7 @@ ;; definition for method 74 of type ginsu ;; WARN: disable def twice: 11. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod general-event-handler ginsu ((obj ginsu) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler ginsu ((this ginsu) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars (v0-1 object)) @@ -596,15 +596,15 @@ (when (if (type? s5-0 ginsu) s5-0 ) - (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8)))) - (let ((a0-5 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8)))) + (let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8)))) + (let ((a0-5 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8)))) (vector+! s5-1 s5-1 a0-5) ) (vector-float*! s5-1 s5-1 0.5) - (spawn (-> obj part) s5-1) + (spawn (-> this part) s5-1) ) (set! v0-1 (+ (current-time) (seconds 0.125))) - (set! (-> obj grind-timer) (the-as time-frame v0-1)) + (set! (-> this grind-timer) (the-as time-frame v0-1)) v0-1 ) ) @@ -612,7 +612,7 @@ (('touch 'bonk 'attack) (cond ((or (!= arg0 *target*) (focus-test? *target* dark)) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else (send-event arg0 'attack #f (static-attack-info ((id (new-attack-id))))) @@ -622,11 +622,11 @@ ) (('trigger) (set! v0-1 #t) - (set! (-> obj ambush-started) (the-as symbol v0-1)) + (set! (-> this ambush-started) (the-as symbol v0-1)) v0-1 ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -668,8 +668,8 @@ (set! (-> self enemy-flags) (the-as enemy-flag (logxor (shl 256 32) (the-as int (-> self enemy-flags))))) ) (set! (-> self enemy-flags) (the-as enemy-flag (logclear (-> self enemy-flags) (enemy-flag enemy-flag41)))) - (set! (-> self starting-time) (current-time)) - (set! (-> self spiral-time) (current-time)) + (set-time! (-> self starting-time)) + (set-time! (-> self spiral-time)) (set! (-> self desired-distance) (vector-length (ginsu-method-181 self (new 'stack-no-clear 'vector)))) ) :trans (behavior () @@ -740,7 +740,7 @@ (set! (-> v1-4 target-speed) 8192.0) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (ja-channel-push! 1 (seconds 0.2)) (ja :group! ginsu-idle-ja :num! min) ) @@ -764,7 +764,7 @@ (if (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (go-virtual circling) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.75)) + (if (time-elapsed? (-> self state-time) (seconds 0.75)) (go-virtual attack) ) (ja :num! (loop!)) @@ -811,7 +811,7 @@ (set! (-> v1-10 target-speed) 49152.0) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (ja :group! ginsu-attack-ja :num! min) ) :exit (behavior () @@ -960,20 +960,20 @@ ) ;; definition for method 70 of type ginsu -(defmethod go-hostile ginsu ((obj ginsu)) +(defmethod go-hostile ginsu ((this ginsu)) (cond - ((or (and (-> obj enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> obj enemy-flags))) - (nav-enemy-method-163 obj) + ((or (and (-> this enemy-info use-frustration) (logtest? (enemy-flag not-frustrated) (-> this enemy-flags))) + (nav-enemy-method-163 this) ) - (go-stare2 obj) + (go-stare2 this) ) (else (let* ((v1-8 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-9 (the-as number (logior (the-as int #x3f800000) v1-8))) ) - (if (and (< (+ -1.0 (the-as float v1-9)) 0.1) (logtest? (-> obj draw status) (draw-control-status on-screen))) - (go (method-of-object obj anticipate-attack)) - (go (method-of-object obj hostile)) + (if (and (< (+ -1.0 (the-as float v1-9)) 0.1) (logtest? (-> this draw status) (draw-control-status on-screen))) + (go (method-of-object this anticipate-attack)) + (go (method-of-object this hostile)) ) ) ) @@ -982,50 +982,50 @@ ;; definition for method 116 of type ginsu ;; WARN: Return type mismatch object vs none. -(defmethod go-idle ginsu ((obj ginsu)) - (if (not (logtest? (-> obj ambush-path flags) (path-control-flag not-found))) - (go (method-of-object obj ambush)) - (go (method-of-object obj idle)) +(defmethod go-idle ginsu ((this ginsu)) + (if (not (logtest? (-> this ambush-path flags) (path-control-flag not-found))) + (go (method-of-object this ambush)) + (go (method-of-object this idle)) ) (none) ) ;; definition for method 10 of type ginsu -(defmethod deactivate ginsu ((obj ginsu)) - (when (nonzero? (-> obj blade-part)) - (let ((a0-1 (-> obj blade-part))) +(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 (-> obj blade-sound-playing) - (sound-stop (-> obj blade-sound)) + (if (-> this blade-sound-playing) + (sound-stop (-> this blade-sound)) ) - (if (-> obj grind-sound-playing) - (sound-stop (-> obj grind-sound)) + (if (-> this grind-sound-playing) + (sound-stop (-> this grind-sound)) ) - ((method-of-type nav-enemy deactivate) obj) + ((method-of-type nav-enemy deactivate) this) (none) ) ;; definition for method 7 of type ginsu ;; WARN: Return type mismatch nav-enemy vs ginsu. -(defmethod relocate ginsu ((obj ginsu) (arg0 int)) - (if (nonzero? (-> obj blade-jm)) - (&+! (-> obj blade-jm) arg0) +(defmethod relocate ginsu ((this ginsu) (arg0 int)) + (if (nonzero? (-> this blade-jm)) + (&+! (-> this blade-jm) arg0) ) - (if (nonzero? (-> obj blade-part)) - (&+! (-> obj blade-part) arg0) + (if (nonzero? (-> this blade-part)) + (&+! (-> this blade-part) arg0) ) - (if (nonzero? (-> obj ambush-path)) - (&+! (-> obj ambush-path) arg0) + (if (nonzero? (-> this ambush-path)) + (&+! (-> this ambush-path) arg0) ) - (the-as ginsu ((method-of-type nav-enemy relocate) obj arg0)) + (the-as ginsu ((method-of-type nav-enemy relocate) this arg0)) ) ;; definition for method 183 of type ginsu ;; WARN: Return type mismatch int vs none. -(defmethod ginsu-method-183 ginsu ((obj ginsu) (arg0 symbol)) - (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) +(defmethod ginsu-method-183 ginsu ((this ginsu) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 (set! (-> v1-3 prim-core collide-as) (collide-spec enemy)) @@ -1043,11 +1043,11 @@ ;; definition for method 46 of type ginsu ;; WARN: Return type mismatch int vs none. -(defmethod enemy-method-46 ginsu ((obj ginsu) (arg0 int)) +(defmethod enemy-method-46 ginsu ((this ginsu) (arg0 int)) "@abstract" (case arg0 ((1) - (let ((v1-2 (-> obj root root-prim))) + (let ((v1-2 (-> this root root-prim))) (logior! (-> v1-2 prim-core action) (collide-action solid)) (let ((v1-4 (-> (the-as collide-shape-prim-group v1-2) child 0))) (logior! (-> v1-4 prim-core action) (collide-action solid)) @@ -1061,9 +1061,9 @@ ;; definition for method 114 of type ginsu ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! ginsu ((obj ginsu)) +(defmethod init-enemy-collision! ginsu ((this ginsu)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1121,7 +1121,7 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1129,47 +1129,47 @@ ;; definition for method 115 of type ginsu ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! ginsu ((obj ginsu)) +(defmethod init-enemy! ginsu ((this ginsu)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ginsu" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *ginsu-nav-enemy-info*) - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) - (logclear! (-> obj nav flags) (nav-control-flag limit-rotation-rate)) - (let ((v1-14 (-> obj neck))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *ginsu-nav-enemy-info*) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43)))) + (logclear! (-> this nav flags) (nav-control-flag limit-rotation-rate)) + (let ((v1-14 (-> this neck))) (set! (-> v1-14 up) (the-as uint 1)) (set! (-> v1-14 nose) (the-as uint 2)) (set! (-> v1-14 ear) (the-as uint 0)) (set-vector! (-> v1-14 twist-max) 10922.667 7281.778 0.0 1.0) (set! (-> v1-14 ignore-angle) 18204.445) ) - (let ((v1-16 (-> obj nav))) + (let ((v1-16 (-> this nav))) (set! (-> v1-16 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (ginsu-method-183 obj #f) - (set! (-> obj blade-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 8)) - (init (-> obj blade-speed) 1.0 0.01 0.1 0.9) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 475) obj)) - (set! (-> obj blade-part) (create-launch-control (-> *part-group-id-table* 476) obj)) - (set! (-> obj ambush-path) (new 'process 'curve-control obj 'intro -1000000000.0)) - (set! (-> obj ambush-started) #f) - (set! (-> obj path-pos) 0.0) - (if (not (logtest? (-> obj ambush-path flags) (path-control-flag not-found))) - (logior! (-> obj ambush-path flags) (path-control-flag display draw-line draw-point draw-text)) + (set-gravity-length (-> this root dynam) 573440.0) + (ginsu-method-183 this #f) + (set! (-> this blade-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 8)) + (init (-> this blade-speed) 1.0 0.01 0.1 0.9) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 475) this)) + (set! (-> this blade-part) (create-launch-control (-> *part-group-id-table* 476) this)) + (set! (-> this ambush-path) (new 'process 'curve-control this 'intro -1000000000.0)) + (set! (-> this ambush-started) #f) + (set! (-> this path-pos) 0.0) + (if (not (logtest? (-> this ambush-path flags) (path-control-flag not-found))) + (logior! (-> this ambush-path flags) (path-control-flag display draw-line draw-point draw-text)) ) - (set! (-> obj blade-sound) (new-sound-id)) - (set! (-> obj blade-sound-playing) #f) - (set! (-> obj grind-sound) (new-sound-id)) - (set! (-> obj grind-sound-playing) #f) - (set! (-> obj grind-timer) 0) + (set! (-> this blade-sound) (new-sound-id)) + (set! (-> this blade-sound-playing) #f) + (set! (-> this grind-sound) (new-sound-id)) + (set! (-> this grind-sound-playing) #f) + (set! (-> this grind-timer) 0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/forest/fish_REF.gc b/test/decompiler/reference/jak2/levels/forest/fish_REF.gc index 3df4dded56..c2d7d98f35 100644 --- a/test/decompiler/reference/jak2/levels/forest/fish_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/fish_REF.gc @@ -20,16 +20,16 @@ ) ;; definition for method 3 of type minnow -(defmethod inspect minnow ((obj minnow)) - (when (not obj) - (set! obj obj) +(defmethod inspect minnow ((this minnow)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for function minnow-init-by-other @@ -98,22 +98,22 @@ ) ;; definition for method 3 of type fish -(defmethod inspect fish ((obj fish)) - (when (not obj) - (set! obj obj) +(defmethod inspect fish ((this fish)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fish) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tvel: #~%" (-> obj vel)) - (format #t "~1Tborder-f: #~%" (-> obj border-f)) - (format #t "~1Tavoid-d: #~%" (-> obj avoid-d)) - (format #t "~1Twander: ~f~%" (-> obj wander)) - (format #t "~1Tmax-speed: ~f~%" (-> obj max-speed)) - (format #t "~1Tspeed: ~f~%" (-> obj speed)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "[~8x] ~A~%" this 'fish) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tvel: #~%" (-> this vel)) + (format #t "~1Tborder-f: #~%" (-> this border-f)) + (format #t "~1Tavoid-d: #~%" (-> this avoid-d)) + (format #t "~1Twander: ~f~%" (-> this wander)) + (format #t "~1Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Thandle: ~D~%" (-> this handle)) (label cfg-4) - obj + this ) ;; definition of type fish-manager @@ -130,17 +130,17 @@ ) ;; definition for method 3 of type fish-manager -(defmethod inspect fish-manager ((obj fish-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect fish-manager ((this fish-manager)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfishes[12] @ #x~X~%" (-> obj fishes)) + (format #t "~2Tfishes[12] @ #x~X~%" (-> this fishes)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -495,14 +495,14 @@ ;; definition for method 11 of type fish-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fish-manager ((obj fish-manager) (arg0 entity-actor)) +(defmethod init-from-entity! fish-manager ((this fish-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -518,15 +518,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-8 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-8 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (get-nav-control obj (the-as nav-mesh #f)) + (process-drawable-from-entity! this arg0) + (get-nav-control this (the-as nav-mesh #f)) (let ((s5-1 (rand-vu-int-count 4))) (dotimes (s4-1 12) - (let ((s3-0 (-> obj fishes s4-1))) + (let ((s3-0 (-> this fishes s4-1))) (let ((f30-1 (* 182.04445 (the float (rand-vu-int-count 360))))) - (set! (-> s3-0 pos quad) (-> obj root trans quad)) + (set! (-> s3-0 pos quad) (-> this root trans quad)) (+! (-> s3-0 pos x) (rand-vu-float-range 409.6 4096.0)) (+! (-> s3-0 pos z) (rand-vu-float-range 409.6 4096.0)) (set! (-> s3-0 wander) (rand-vu-float-range 0.0 65536.0)) @@ -535,10 +535,10 @@ This commonly includes things such as: (set! (-> s3-0 border-f quad) (the-as uint128 0)) (set! (-> s3-0 avoid-d quad) (the-as uint128 0)) (set! (-> s3-0 max-speed) 16384.0) - (set! (-> s3-0 handle) (ppointer->handle (process-spawn minnow obj s5-1 :to obj))) + (set! (-> s3-0 handle) (ppointer->handle (process-spawn minnow this s5-1 :to this))) ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) 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 f145b3f1ec..6363c5500b 100644 --- a/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/forest-obs_REF.gc @@ -23,36 +23,36 @@ ) ;; definition for method 3 of type forest-hover-manager -(defmethod inspect forest-hover-manager ((obj forest-hover-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect forest-hover-manager ((this forest-hover-manager)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hover-enemy-manager inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttransport-actor[2] @ #x~X~%" (-> obj transport-actor)) + (format #t "~2Ttransport-actor[2] @ #x~X~%" (-> this transport-actor)) (label cfg-4) - obj + this ) ;; definition for method 11 of type forest-hover-manager ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! forest-hover-manager ((obj forest-hover-manager) (arg0 entity-actor)) +(defmethod init-from-entity! forest-hover-manager ((this forest-hover-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj entity) arg0) - (hover-enemy-manager-init! obj *forest-protect-battle*) - (set! (-> obj transport-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj transport-actor 1) (entity-actor-lookup arg0 'alt-actor 1)) + (set! (-> this entity) arg0) + (hover-enemy-manager-init! this *forest-protect-battle*) + (set! (-> this transport-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this transport-actor 1) (entity-actor-lookup arg0 'alt-actor 1)) (let ((t9-3 (method-of-type hover-formation-control new)) (a0-4 'process) (a1-4 hover-formation-control) - (a2-2 obj) + (a2-2 this) (t0-0 122880.0) (t1-0 (new 'stack-no-clear 'vector)) ) @@ -60,10 +60,10 @@ This commonly includes things such as: (set! (-> t1-0 y) 24576.0) (set! (-> t1-0 z) 61440.0) (set! (-> t1-0 w) 1.0) - (set! (-> obj formation) (t9-3 a0-4 a1-4 a2-2 arg0 t0-0 t1-0 5461.3335 (the-as handle #f))) + (set! (-> this formation) (t9-3 a0-4 a1-4 a2-2 arg0 t0-0 t1-0 5461.3335 (the-as handle #f))) ) - (logior! (-> obj formation flags) 4) - (go (method-of-object obj spawning)) + (logior! (-> this formation flags) 4) + (go (method-of-object this spawning)) (none) ) @@ -93,25 +93,25 @@ This commonly includes things such as: ) ;; definition for method 3 of type forest-youngsamos -(defmethod inspect forest-youngsamos ((obj forest-youngsamos)) - (when (not obj) - (set! obj obj) +(defmethod inspect forest-youngsamos ((this forest-youngsamos)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Tdesired-pos: #~%" (-> obj desired-pos)) - (format #t "~2Thit-dir: #~%" (-> obj hit-dir)) - (format #t "~2Thit-points: ~f~%" (-> obj hit-points)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tfalling?: ~A~%" (-> obj falling?)) - (format #t "~2Tfocus-disable-timer: ~D~%" (-> obj focus-disable-timer)) - (format #t "~2Thud: ~D~%" (-> obj hud)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tdesired-pos: #~%" (-> this desired-pos)) + (format #t "~2Thit-dir: #~%" (-> this hit-dir)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tfalling?: ~A~%" (-> this falling?)) + (format #t "~2Tfocus-disable-timer: ~D~%" (-> this focus-disable-timer)) + (format #t "~2Thud: ~D~%" (-> this hud)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -388,7 +388,7 @@ This commonly includes things such as: ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 2)) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) @@ -433,26 +433,26 @@ This commonly includes things such as: ) ;; definition for method 10 of type forest-youngsamos -(defmethod deactivate forest-youngsamos ((obj forest-youngsamos)) - (if (valid? (-> obj hud) (the-as type #f) "" #t 0) - (send-event (handle->process (-> obj hud)) 'hide-and-die) +(defmethod deactivate forest-youngsamos ((this forest-youngsamos)) + (if (valid? (-> this hud) (the-as type #f) "" #t 0) + (send-event (handle->process (-> this hud)) 'hide-and-die) ) - (sound-stop (-> obj sound-id)) - ((the-as (function process-focusable none) (find-parent-method forest-youngsamos 10)) obj) + (sound-stop (-> this sound-id)) + ((the-as (function process-focusable none) (find-parent-method forest-youngsamos 10)) this) (none) ) ;; definition for method 11 of type forest-youngsamos ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! forest-youngsamos ((obj forest-youngsamos) (arg0 entity-actor)) +(defmethod init-from-entity! forest-youngsamos ((this forest-youngsamos) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) forest-youngsamos-bounce-reaction) (set! (-> s4-0 no-reaction) @@ -491,29 +491,29 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj entity) arg0) - (process-drawable-from-entity! obj (-> obj entity)) + (set! (-> this entity) arg0) + (process-drawable-from-entity! this (-> this entity)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-forest-youngsamos" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj desired-pos quad) (-> obj root trans quad)) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (+! (-> obj desired-pos y) 8192.0) - (vector-reset! (-> obj hit-dir)) - (set! (-> obj hit-points) 9.0) - (set! (-> obj incoming-attack-id) (the-as uint -1)) - (vector-reset! (-> obj root transv)) - (set! (-> obj focus-disable-timer) (the-as uint 0)) - (set! (-> obj hud) (ppointer->handle (process-spawn hud-samos-young :init hud-init-by-other :to obj))) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 494) obj)) - (go (method-of-object obj idle)) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this desired-pos quad) (-> this root trans quad)) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (+! (-> this desired-pos y) 8192.0) + (vector-reset! (-> this hit-dir)) + (set! (-> this hit-points) 9.0) + (set! (-> this incoming-attack-id) (the-as uint -1)) + (vector-reset! (-> this root transv)) + (set! (-> this focus-disable-timer) (the-as uint 0)) + (set! (-> this hud) (ppointer->handle (process-spawn hud-samos-young :init hud-init-by-other :to this))) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 494) this)) + (go (method-of-object this idle)) (none) ) @@ -652,9 +652,9 @@ This commonly includes things such as: TASK_MANAGER_CODE_HOOK (lambda :behavior task-manager () - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.5)) + (until (time-elapsed? gp-0 (seconds 0.5)) (suspend) ) ) @@ -727,7 +727,7 @@ This commonly includes things such as: ) ) (let ((s3-0 (current-time))) - (until (>= (- (current-time) s3-0) (seconds 15)) + (until (time-elapsed? s3-0 (seconds 15)) (suspend) ) ) @@ -765,7 +765,7 @@ This commonly includes things such as: ) (dotimes (s3-1 3) (let ((s2-0 (current-time))) - (until (>= (- (current-time) s2-0) (seconds 10)) + (until (time-elapsed? s2-0 (seconds 10)) (suspend) ) ) @@ -802,7 +802,7 @@ This commonly includes things such as: ) ) (let ((s2-1 (current-time))) - (until (>= (- (current-time) s2-1) (seconds 10)) + (until (time-elapsed? s2-1 (seconds 10)) (suspend) ) ) @@ -840,7 +840,7 @@ This commonly includes things such as: ) ) (let ((s3-2 (current-time))) - (until (>= (- (current-time) s3-2) (seconds 10)) + (until (time-elapsed? s3-2 (seconds 10)) (suspend) ) ) @@ -877,7 +877,7 @@ This commonly includes things such as: ) ) (let ((s3-3 (current-time))) - (until (>= (- (current-time) s3-3) (seconds 10)) + (until (time-elapsed? s3-3 (seconds 10)) (suspend) ) ) @@ -891,7 +891,7 @@ This commonly includes things such as: ) ) (let ((s2-2 (current-time))) - (until (>= (- (current-time) s2-2) (seconds 1)) + (until (time-elapsed? s2-2 (seconds 1)) (suspend) ) ) @@ -970,14 +970,14 @@ This commonly includes things such as: ) ) (let ((s3-5 (current-time))) - (until (>= (- (current-time) s3-5) (seconds 1)) + (until (time-elapsed? s3-5 (seconds 1)) (suspend) ) ) ) ) (let ((s4-1 (current-time))) - (until (>= (- (current-time) s4-1) (seconds 0.5)) + (until (time-elapsed? s4-1 (seconds 0.5)) (suspend) ) ) @@ -985,7 +985,7 @@ This commonly includes things such as: (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) (let ((s4-2 (current-time))) - (until (>= (- (current-time) s4-2) (seconds 0.5)) + (until (time-elapsed? s4-2 (seconds 0.5)) (suspend) ) ) @@ -996,7 +996,7 @@ This commonly includes things such as: 'leave ) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) (seconds 0.2)) + (until (time-elapsed? s5-1 (seconds 0.2)) (suspend) ) ) @@ -1008,7 +1008,7 @@ This commonly includes things such as: ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 3)) + (until (time-elapsed? gp-2 (seconds 3)) (suspend) ) ) @@ -1016,7 +1016,7 @@ This commonly includes things such as: (remove-setting! 'process-mask) (process-release? *target*) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 3)) + (until (time-elapsed? gp-3 (seconds 3)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/levels/forest/forest-part_REF.gc b/test/decompiler/reference/jak2/levels/forest/forest-part_REF.gc index 329c373feb..8645797cb9 100644 --- a/test/decompiler/reference/jak2/levels/forest/forest-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/forest-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type forest-part -(defmethod inspect forest-part ((obj forest-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect forest-part ((this forest-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc index c7f95847fb..449fb06290 100644 --- a/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/pegasus_REF.gc @@ -14,17 +14,17 @@ ) ;; definition for method 3 of type pegasus-path-info -(defmethod inspect pegasus-path-info ((obj pegasus-path-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect pegasus-path-info ((this pegasus-path-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pegasus-path-info) - (format #t "~1Tnum-data: ~D~%" (-> obj num-data)) - (format #t "~1Tpath-data: ~A~%" (-> obj path-data)) - (format #t "~1Tcontrol-data: #x~X~%" (-> obj control-data)) + (format #t "[~8x] ~A~%" this 'pegasus-path-info) + (format #t "~1Tnum-data: ~D~%" (-> this num-data)) + (format #t "~1Tpath-data: ~A~%" (-> this path-data)) + (format #t "~1Tcontrol-data: #x~X~%" (-> this control-data)) (label cfg-4) - obj + this ) ;; definition of type pegasus @@ -71,40 +71,40 @@ ) ;; definition for method 3 of type pegasus -(defmethod inspect pegasus ((obj pegasus)) - (when (not obj) - (set! obj obj) +(defmethod inspect pegasus ((this pegasus)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcurve-position: ~f~%" (-> obj curve-position)) - (format #t "~2Tspeed: ~f~%" (-> obj speed)) - (format #t "~2Tfacing: #~%" (-> obj facing)) - (format #t "~2Ttangent: #~%" (-> obj tangent)) - (format #t "~2Trun-blend-interp: ~f~%" (-> obj run-blend-interp)) - (format #t "~2Tnear-timer: ~D~%" (-> obj near-timer)) - (format #t "~2Tfar-time: ~D~%" (-> obj far-time)) - (format #t "~2Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~2Ty-offset-desired: ~f~%" (-> obj y-offset-desired)) - (format #t "~2Ty-vel: ~f~%" (-> obj y-vel)) - (format #t "~2Twater-height: ~f~%" (-> obj water-height)) - (format #t "~2Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~2Tambient-possible: ~D~%" (-> obj ambient-possible)) - (format #t "~2Tambient-expire: ~D~%" (-> obj ambient-expire)) - (format #t "~2Tcan-run: ~A~%" (-> obj can-run)) - (format #t "~2Ton-ground: ~A~%" (-> obj on-ground)) - (format #t "~2Tover-ground: ~A~%" (-> obj over-ground)) - (format #t "~2Tallow-idle: ~A~%" (-> obj allow-idle)) - (format #t "~2Tpath-info[20] @ #x~X~%" (-> obj path-info)) - (format #t "~2Tprevious-path: ~D~%" (-> obj previous-path)) - (format #t "~2Tcurrent-path: ~D~%" (-> obj current-path)) - (format #t "~2Tnum-paths: ~D~%" (-> obj num-paths)) - (format #t "~2Tdisplay-path: ~D~%" (-> obj display-path)) - (format #t "~2Ttargetted-timer: ~D~%" (-> obj targetted-timer)) + (format #t "~2Tcurve-position: ~f~%" (-> this curve-position)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Tfacing: #~%" (-> this facing)) + (format #t "~2Ttangent: #~%" (-> this tangent)) + (format #t "~2Trun-blend-interp: ~f~%" (-> this run-blend-interp)) + (format #t "~2Tnear-timer: ~D~%" (-> this near-timer)) + (format #t "~2Tfar-time: ~D~%" (-> this far-time)) + (format #t "~2Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~2Ty-offset-desired: ~f~%" (-> this y-offset-desired)) + (format #t "~2Ty-vel: ~f~%" (-> this y-vel)) + (format #t "~2Twater-height: ~f~%" (-> this water-height)) + (format #t "~2Ttimeout: ~D~%" (-> this timeout)) + (format #t "~2Tambient-possible: ~D~%" (-> this ambient-possible)) + (format #t "~2Tambient-expire: ~D~%" (-> this ambient-expire)) + (format #t "~2Tcan-run: ~A~%" (-> this can-run)) + (format #t "~2Ton-ground: ~A~%" (-> this on-ground)) + (format #t "~2Tover-ground: ~A~%" (-> this over-ground)) + (format #t "~2Tallow-idle: ~A~%" (-> this allow-idle)) + (format #t "~2Tpath-info[20] @ #x~X~%" (-> this path-info)) + (format #t "~2Tprevious-path: ~D~%" (-> this previous-path)) + (format #t "~2Tcurrent-path: ~D~%" (-> this current-path)) + (format #t "~2Tnum-paths: ~D~%" (-> this num-paths)) + (format #t "~2Tdisplay-path: ~D~%" (-> this display-path)) + (format #t "~2Ttargetted-timer: ~D~%" (-> this targetted-timer)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -202,11 +202,11 @@ (set! (-> *pegasus-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 12 of type pegasus -(defmethod run-logic? pegasus ((obj pegasus)) +(defmethod run-logic? pegasus ((this pegasus)) "Calls [[process-tree::12]] if we are considered in-range of the [[pegasus]], otherwise returns [[#t]]" (let ((min-distance 491520.0)) - (if (< (* min-distance min-distance) (vector-vector-distance-squared (-> obj root trans) (camera-pos))) - ((method-of-type enemy run-logic?) obj) + (if (< (* min-distance min-distance) (vector-vector-distance-squared (-> this root trans) (camera-pos))) + ((method-of-type enemy run-logic?) this) #t ) ) @@ -214,25 +214,25 @@ ;; definition for method 137 of type pegasus ;; WARN: Return type mismatch int vs none. -(defmethod track-how-long-aimed-at! pegasus ((obj pegasus)) +(defmethod track-how-long-aimed-at! pegasus ((this pegasus)) "Updates `targetted-timer` with the `frame-counter` while Jak is aiming at the [[pegasus]]" (let ((target *target*)) (when (and target (-> target gun active?)) (let ((inaccuracy-dir (new 'stack-no-clear 'vector)) (inaccuracy-vec (new 'stack-no-clear 'vector)) ) - (vector-! inaccuracy-dir (-> obj root trans) (-> target gun fire-point)) + (vector-! inaccuracy-dir (-> this root trans) (-> target gun fire-point)) (vector+float*! inaccuracy-vec (-> target gun fire-point) (-> target gun fire-dir-out) (vector-length inaccuracy-dir) ) - (let ((inaccuracy-mag (vector-vector-distance-squared inaccuracy-vec (-> obj root trans))) + (let ((inaccuracy-mag (vector-vector-distance-squared inaccuracy-vec (-> this root trans))) (threshold 20480.0) ) (if (< inaccuracy-mag (* threshold threshold)) - (set! (-> obj targetted-timer) (current-time)) + (set-time! (-> this targetted-timer)) ) ) ) @@ -244,19 +244,19 @@ ;; definition for method 57 of type pegasus ;; WARN: Return type mismatch int vs enemy-aware. -(defmethod update-target-awareness! pegasus ((obj pegasus) (proc process-focusable) (focus enemy-best-focus)) +(defmethod update-target-awareness! pegasus ((this pegasus) (proc process-focusable) (focus enemy-best-focus)) "Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well! For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targetted for more than 5 [[seconds]] @returns the value from [[enemy::57]], otherwise [[enemy-aware::4]]" - (the-as enemy-aware (if (>= (- (current-time) (-> obj targetted-timer)) (seconds 5)) - (the-as int ((method-of-type enemy update-target-awareness!) obj proc focus)) + (the-as enemy-aware (if (time-elapsed? (-> this targetted-timer) (seconds 5)) + (the-as int ((method-of-type enemy update-target-awareness!) this proc focus)) 4 ) ) ) ;; definition for method 74 of type pegasus -(defmethod general-event-handler pegasus ((obj pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler pegasus ((this pegasus) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case event-type @@ -265,38 +265,38 @@ For pegasus, it will call [[enemy::57]] only if the [[pegasus]] has been targett ) (('hit 'hit-knocked) (cond - ((zero? (-> obj hit-points)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + ((zero? (-> this hit-points)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action proc) (send-event proc 'get-attack-count 1) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) (else (let ((v0-0 (the-as object (current-time)))) - (set! (-> obj targetted-timer) (the-as time-frame v0-0)) + (set! (-> this targetted-timer) (the-as time-frame v0-0)) v0-0 ) ) ) ) (else - ((method-of-type enemy general-event-handler) obj proc arg2 event-type event) + ((method-of-type enemy general-event-handler) this proc arg2 event-type event) ) ) ) ;; definition for method 56 of type pegasus -(defmethod damage-amount-from-attack pegasus ((obj pegasus) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack pegasus ((this pegasus) (arg0 process) (arg1 event-message-block)) "Only attacks from the jetboard will deal max damage (6), but by default it will return `1`. This is why the scouts are technically killable by other means @returns the amount of damage taken from an attack. Also updates the `targetted-timer`. @@ -306,12 +306,12 @@ This is why the scouts are technically killable by other means (case (-> arg1 message) (('attack) (if (and (logtest? (-> attack-info mask) (attack-mask mode)) (= (-> attack-info mode) 'board)) - (set! hitpoints (-> obj hit-points)) + (set! hitpoints (-> this hit-points)) ) ) ) ) - (set! (-> obj targetted-timer) (current-time)) + (set-time! (-> this targetted-timer)) hitpoints ) ) @@ -698,7 +698,7 @@ This function also is what causes the pegasus to flip around (interpolant (- 1.0 (fmax 0.0 (fmin 1.0 dist-from-target)))) (interpolated-speed (lerp min-speed max-speed interpolant)) ) - (if (< (- (current-time) (-> self targetted-timer)) (seconds 5)) + (if (not (time-elapsed? (-> self targetted-timer) (seconds 5))) (set! interpolated-speed (fmax 163840.0 interpolated-speed)) ) (let ((movement-speed (* 0.0033333334 interpolated-speed))) @@ -761,19 +761,19 @@ The faster it's moving the fast it flaps it's wings, etc ) ;; definition for method 55 of type pegasus -(defmethod track-target! pegasus ((obj pegasus)) +(defmethod track-target! pegasus ((this pegasus)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (track-how-long-aimed-at! obj) + (track-how-long-aimed-at! this) (pegasus-show-runs) - ((method-of-type enemy track-target!) obj) + ((method-of-type enemy track-target!) this) (none) ) ;; definition for method 99 of type pegasus -(defmethod enemy-method-99 pegasus ((obj pegasus) (arg0 process-focusable)) +(defmethod enemy-method-99 pegasus ((this pegasus) (arg0 process-focusable)) #t ) @@ -861,7 +861,7 @@ The faster it's moving the fast it flaps it's wings, etc (defstate stare (pegasus) :virtual #t :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((awareness (-> self focus aware))) (cond ((and (>= 1 (the-as int awareness)) @@ -1070,8 +1070,8 @@ The faster it's moving the fast it flaps it's wings, etc (func) ) ) - (set! (-> self state-time) (current-time)) - (set! (-> self far-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self far-time)) (set-setting! 'sound-mode #f 0.0 1) ) :exit (behavior () @@ -1102,7 +1102,7 @@ The faster it's moving the fast it flaps it's wings, etc ) ) ) - (set! (-> self far-time) (current-time)) + (set-time! (-> self far-time)) ) :code (behavior () (until #f @@ -1125,7 +1125,7 @@ The faster it's moving the fast it flaps it's wings, etc ) ) (set! (-> self near-timer) 3000) - (set! (-> self far-time) (current-time)) + (set-time! (-> self far-time)) (set-setting! 'sound-mode #f 0.0 1) ) :exit (behavior () @@ -1156,9 +1156,9 @@ The faster it's moving the fast it flaps it's wings, etc (if (<= (-> self near-timer) 0) (go pegasus-tired) ) - (set! (-> self far-time) (current-time)) + (set-time! (-> self far-time)) ) - (if (>= (- (current-time) (-> self far-time)) (seconds 3)) + (if (time-elapsed? (-> self far-time) (seconds 3)) (set! (-> self near-timer) (the-as int (-> self timeout))) ) ) @@ -1273,9 +1273,9 @@ The faster it's moving the fast it flaps it's wings, etc ;; definition for method 114 of type pegasus ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! pegasus ((obj pegasus)) +(defmethod init-enemy-collision! pegasus ((this pegasus)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -1320,118 +1320,118 @@ The faster it's moving the fast it flaps it's wings, etc (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) 0 (none) ) ;; definition for method 60 of type pegasus -(defmethod coin-flip? pegasus ((obj pegasus)) +(defmethod coin-flip? pegasus ((this pegasus)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 108 of type pegasus -(defmethod enemy-method-108 pegasus ((obj pegasus) (arg0 enemy) (arg1 event-message-block)) +(defmethod enemy-method-108 pegasus ((this pegasus) (arg0 enemy) (arg1 event-message-block)) 0 ) ;; definition for method 7 of type pegasus ;; WARN: Return type mismatch enemy vs pegasus. -(defmethod relocate pegasus ((obj pegasus) (arg0 int)) +(defmethod relocate pegasus ((this pegasus) (arg0 int)) (countdown (v1-0 20) - (if (-> obj path-info v1-0 path-data) - (&+! (-> obj path-info v1-0 path-data) arg0) + (if (-> this path-info v1-0 path-data) + (&+! (-> this path-info v1-0 path-data) arg0) ) ) - (the-as pegasus ((method-of-type enemy relocate) obj arg0)) + (the-as pegasus ((method-of-type enemy relocate) this arg0)) ) ;; definition for method 115 of type pegasus ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! pegasus ((obj pegasus)) +(defmethod init-enemy! pegasus ((this pegasus)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (tag res-tag)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pegasus" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *pegasus-enemy-info*) - (logclear! (-> obj draw shadow-ctrl settings flags) (shadow-flags shdf00)) - (set! (-> obj link) (new 'process 'actor-link-info obj #f)) + (init-enemy-behaviour-and-stats! this *pegasus-enemy-info*) + (logclear! (-> this draw shadow-ctrl settings flags) (shadow-flags shdf00)) + (set! (-> this link) (new 'process 'actor-link-info this #f)) (dotimes (v1-8 20) - (set! (-> obj path-info v1-8 path-data) #f) + (set! (-> this path-info v1-8 path-data) #f) ) - (set! (-> obj num-paths) 0) - (set! (-> obj path-info 0 path-data) (new 'process 'curve-control obj 'path -1000000000.0)) - (when (-> obj path-info 0 path-data) - (logior! (-> obj path-info 0 path-data flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj num-paths) 1) + (set! (-> this num-paths) 0) + (set! (-> this path-info 0 path-data) (new 'process 'curve-control this 'path -1000000000.0)) + (when (-> this path-info 0 path-data) + (logior! (-> this path-info 0 path-data flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this num-paths) 1) ) (dotimes (path-info-idx 20) - (let ((curve (new 'process 'curve-control obj 'path (the float path-info-idx)))) + (let ((curve (new 'process 'curve-control this 'path (the float path-info-idx)))) (if (logtest? (-> curve flags) (path-control-flag not-found)) (goto cfg-15) ) - (set! (-> obj num-paths) (+ path-info-idx 1)) - (set! (-> obj path-info path-info-idx path-data) curve) + (set! (-> this num-paths) (+ path-info-idx 1)) + (set! (-> this path-info path-info-idx path-data) curve) (logior! (-> curve flags) (path-control-flag display draw-line draw-point)) ) (set! tag (new 'static 'res-tag)) (let ((data - (res-lump-data (-> obj entity) 'path-connection pointer :tag-ptr (& tag) :time (the float path-info-idx)) + (res-lump-data (-> this entity) 'path-connection pointer :tag-ptr (& tag) :time (the float path-info-idx)) ) ) (cond (data - (set! (-> obj path-info path-info-idx num-data) (the-as int (-> tag elt-count))) - (set! (-> obj path-info path-info-idx control-data) (the-as (pointer float) data)) + (set! (-> this path-info path-info-idx num-data) (the-as int (-> tag elt-count))) + (set! (-> this path-info path-info-idx control-data) (the-as (pointer float) data)) ) (else - (set! (-> obj path-info path-info-idx num-data) 0) + (set! (-> this path-info path-info-idx num-data) 0) 0 ) ) ) ) (label cfg-15) - (set! (-> obj current-path) 0) - (set! (-> obj previous-path) 0) - (set! (-> obj display-path) -1) - (set! (-> obj curve-position) (res-lump-float (-> obj entity) 'initial-spline-pos)) + (set! (-> this current-path) 0) + (set! (-> this previous-path) 0) + (set! (-> this display-path) -1) + (set! (-> this curve-position) (res-lump-float (-> this entity) 'initial-spline-pos)) (get-point-at-percent-along-path! - (-> obj path-info (-> obj current-path) path-data) - (-> obj root trans) - (-> obj curve-position) + (-> this path-info (-> this current-path) path-data) + (-> this root trans) + (-> this curve-position) 'interp ) (displacement-between-points-at-percent-normalized! - (-> obj path-info (-> obj current-path) path-data) - (-> obj tangent) - (-> obj curve-position) + (-> this path-info (-> this current-path) path-data) + (-> this tangent) + (-> this curve-position) ) - (set! (-> obj facing quad) (-> obj tangent quad)) + (set! (-> this facing quad) (-> this tangent quad)) (let ((matrix (new 'stack-no-clear 'matrix))) - (forward-down->inv-matrix matrix (-> obj facing) (new 'static 'vector :y -1.0)) - (matrix->quaternion (-> obj root quat) matrix) + (forward-down->inv-matrix matrix (-> this facing) (new 'static 'vector :y -1.0)) + (matrix->quaternion (-> this root quat) matrix) ) - (set! (-> obj y-vel) 0.0) - (set! (-> obj water-height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj timeout) (the-as uint 3000)) - (when (-> obj entity) - (let ((timeout (res-lump-float (-> obj entity) 'timeout :default 10.0))) - (set! (-> obj timeout) (the-as uint (the int (* 300.0 timeout)))) + (set! (-> this y-vel) 0.0) + (set! (-> this water-height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this timeout) (the-as uint 3000)) + (when (-> this entity) + (let ((timeout (res-lump-float (-> this entity) 'timeout :default 10.0))) + (set! (-> this timeout) (the-as uint (the int (* 300.0 timeout)))) ) ) - (set! (-> obj ambient-possible) (the-as uint 0)) - (set! (-> obj speed) 0.0) - (set! (-> obj y-offset-desired) 0.0) + (set! (-> this ambient-possible) (the-as uint 0)) + (set! (-> this speed) 0.0) + (set! (-> this y-offset-desired) 0.0) (pegasus-move 409600.0 #t) (pegasus-calc-speed 61440.0 122880.0 2048.0 2048.0) - (set! (-> obj can-run) #f) + (set! (-> this can-run) #f) 0 (none) ) @@ -1471,7 +1471,7 @@ The faster it's moving the fast it flaps it's wings, etc (lambda :behavior task-manager () (local-vars (data int)) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-pegasus :init hud-init-by-other :to self))) (while (> (-> self data-int32 0) 0) (set! data (-> self data-int32 1)) diff --git a/test/decompiler/reference/jak2/levels/forest/predator-h_REF.gc b/test/decompiler/reference/jak2/levels/forest/predator-h_REF.gc index 029a29c41d..c3ad317d51 100644 --- a/test/decompiler/reference/jak2/levels/forest/predator-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/predator-h_REF.gc @@ -20,19 +20,19 @@ ) ;; definition for method 3 of type predator-node -(defmethod inspect predator-node ((obj predator-node)) - (when (not obj) - (set! obj obj) +(defmethod inspect predator-node ((this predator-node)) + (when (not this) + (set! this this) (goto cfg-8) ) - (format #t "[~8x] ~A~%" obj 'predator-node) - (format #t "~1Tposition: ~`vector`P~%" (-> obj position)) - (format #t "~1Tnav-mesh-id: ~D~%" (-> obj nav-mesh-id)) - (format #t "~1Tedge-index: ~D~%" (-> obj edge-index)) - (format #t "~1Tedge-count: ~D~%" (-> obj edge-count)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) - (format #t "~1Tflags: #x~X : (predator-node-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "[~8x] ~A~%" this 'predator-node) + (format #t "~1Tposition: ~`vector`P~%" (-> this position)) + (format #t "~1Tnav-mesh-id: ~D~%" (-> this nav-mesh-id)) + (format #t "~1Tedge-index: ~D~%" (-> this edge-index)) + (format #t "~1Tedge-count: ~D~%" (-> this edge-count)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tflags: #x~X : (predator-node-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (predator-node-flag spawnable)) (predator-node-flag spawnable)) (format #t "spawnable ") ) @@ -41,12 +41,12 @@ ) ) (format #t ")~%") - (format #t "~1Tpoints: ~D~%" (-> obj points)) - (format #t "~1Tpos-x: ~f~%" (-> obj position x)) - (format #t "~1Tpos-y: ~f~%" (-> obj position y)) - (format #t "~1Tpos-z: ~f~%" (-> obj position z)) + (format #t "~1Tpoints: ~D~%" (-> this points)) + (format #t "~1Tpos-x: ~f~%" (-> this position x)) + (format #t "~1Tpos-y: ~f~%" (-> this position y)) + (format #t "~1Tpos-z: ~f~%" (-> this position z)) (label cfg-8) - obj + this ) ;; definition of type predator-edge @@ -61,18 +61,18 @@ ) ;; definition for method 3 of type predator-edge -(defmethod inspect predator-edge ((obj predator-edge)) - (when (not obj) - (set! obj obj) +(defmethod inspect predator-edge ((this predator-edge)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'predator-edge) - (format #t "~1Tdest-node-id: ~D~%" (-> obj dest-node-id)) - (format #t "~1Tflags: #x~X : (predator-edge-flag " (-> obj flags)) - (-> obj flags) + (format #t "[~8x] ~A~%" this 'predator-edge) + (format #t "~1Tdest-node-id: ~D~%" (-> this dest-node-id)) + (format #t "~1Tflags: #x~X : (predator-edge-flag " (-> this flags)) + (-> this flags) (format #t ")~%") (label cfg-4) - obj + this ) ;; definition of type predator-graph @@ -88,18 +88,18 @@ ) ;; definition for method 3 of type predator-graph -(defmethod inspect predator-graph ((obj predator-graph)) - (when (not obj) - (set! obj obj) +(defmethod inspect predator-graph ((this predator-graph)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'predator-graph) - (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) - (format #t "~1Tedge-count: ~D~%" (-> obj edge-count)) - (format #t "~1Tnode: #x~X~%" (-> obj node)) - (format #t "~1Tedge: #x~X~%" (-> obj edge)) + (format #t "[~8x] ~A~%" this 'predator-graph) + (format #t "~1Tnode-count: ~D~%" (-> this node-count)) + (format #t "~1Tedge-count: ~D~%" (-> this edge-count)) + (format #t "~1Tnode: #x~X~%" (-> this node)) + (format #t "~1Tedge: #x~X~%" (-> this edge)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc index 93f3db8d02..93df0012f4 100644 --- a/test/decompiler/reference/jak2/levels/forest/predator_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/predator_REF.gc @@ -3,88 +3,88 @@ ;; definition for method 15 of type hud-predator ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-predator ((obj hud-predator)) - (set-hud-piece-position! (-> obj sprites 1) (the int (+ 480.0 (* 130.0 (-> obj offset)))) 205) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -44 0) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites 1)) -45 45) - ((method-of-type hud draw) obj) +(defmethod draw hud-predator ((this hud-predator)) + (set-hud-piece-position! (-> this sprites 1) (the int (+ 480.0 (* 130.0 (-> this offset)))) 205) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -44 0) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites 1)) -45 45) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-predator ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-predator ((obj hud-predator)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-predator ((this hud-predator)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-predator ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-predator ((obj hud-predator)) - (set! (-> obj level) (level-get *level* 'forest)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-predator ((this hud-predator)) + (set! (-> this level) (level-get *level* 'forest)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xb1d))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.6) - (set! (-> obj sprites 0 scale-y) 0.6) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1d))) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 1 scale-x) 0.6) - (set! (-> obj sprites 1 scale-y) 0.6) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xb1d))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.6) + (set! (-> this sprites 0 scale-y) 0.6) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1d))) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 1 scale-x) 0.6) + (set! (-> this sprites 1 scale-y) 0.6) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) ;; definition for method 15 of type hud-pegasus ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-pegasus ((obj hud-pegasus)) +(defmethod draw hud-pegasus ((this hud-pegasus)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 472.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 472.0 (* 130.0 (-> this offset)))) 190 ) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -26 35) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -26 35) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-pegasus ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-pegasus ((obj hud-pegasus)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-pegasus ((this hud-pegasus)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-pegasus ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-pegasus ((obj hud-pegasus)) - (set! (-> obj level) (level-get *level* 'forest)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-pegasus ((this hud-pegasus)) + (set! (-> this level) (level-get *level* 'forest)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xb1d))) - (set! (-> obj sprites 0 scale-x) 0.8) - (set! (-> obj sprites 0 scale-y) 0.8) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xb1d))) + (set! (-> this sprites 0 scale-x) 0.8) + (set! (-> this sprites 0 scale-y) 0.8) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -117,32 +117,32 @@ ) ;; definition for method 3 of type predator-shot -(defmethod inspect predator-shot ((obj predator-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect predator-shot ((this predator-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type metalhead-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 28 of type predator-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound predator-shot ((obj predator-shot) (arg0 projectile-options)) +(defmethod play-impact-sound predator-shot ((this predator-shot) (arg0 projectile-options)) (case arg0 (((projectile-options lose-altitude)) (sound-play "pred-shot-hit") ) (((projectile-options lose-altitude proj-options-2)) - (let ((f0-0 (doppler-pitch-shift (-> obj root trans) (-> obj root transv))) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) (a0-7 (static-sound-spec "pred-shot-loop" :volume 0.0 :mask (pitch reg0))) ) (set! (-> a0-7 volume) 1024) (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) - (sound-play-by-spec a0-7 (-> obj sound-id) (-> obj root trans)) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) ) ) ) @@ -151,9 +151,9 @@ ;; definition for method 30 of type predator-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! predator-shot ((obj predator-shot)) +(defmethod init-proj-collision! predator-shot ((this predator-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -195,9 +195,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (none) @@ -205,16 +205,16 @@ ;; definition for method 31 of type predator-shot ;; INFO: Used lq/sq -(defmethod init-proj-settings! predator-shot ((obj predator-shot)) +(defmethod init-proj-settings! predator-shot ((this predator-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'predator-shot) - (set! (-> obj max-speed) 532480.0) - (set! (-> obj move) metalhead-shot-move) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj timeout) (seconds 0.767)) - (set! (-> obj sound-id) (new-sound-id)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'predator-shot) + (set! (-> this max-speed) 532480.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.767)) + (set! (-> this sound-id) (new-sound-id)) + (set-gravity-length (-> this root dynam) 573440.0) (none) ) @@ -260,29 +260,29 @@ ) ;; definition for method 3 of type predator -(defmethod inspect predator ((obj predator)) - (when (not obj) - (set! obj obj) +(defmethod inspect predator ((this predator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlos: #~%" (-> obj los)) - (format #t "~2Twant-stop: ~A~%" (-> obj want-stop)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Tcurr-node: ~D~%" (-> obj curr-node)) - (format #t "~2Thide-pos: #~%" (-> obj hide-pos)) - (format #t "~2Tnext-change: ~D~%" (-> obj next-change)) - (format #t "~2Tshoot-angle: ~f~%" (-> obj shoot-angle)) - (format #t "~2Tmiss-amount: ~f~%" (-> obj miss-amount)) - (format #t "~2Tambient-sound-id: ~D~%" (-> obj ambient-sound-id)) - (format #t "~2Tshock-effect-time: ~D~%" (-> obj shock-effect-time)) - (format #t "~2Tshock-effect-end: ~D~%" (-> obj shock-effect-end)) - (format #t "~2Tfade: ~f~%" (-> obj fade)) - (format #t "~2Tdest-fade: ~f~%" (-> obj dest-fade)) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Twant-stop: ~A~%" (-> this want-stop)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tcurr-node: ~D~%" (-> this curr-node)) + (format #t "~2Thide-pos: #~%" (-> this hide-pos)) + (format #t "~2Tnext-change: ~D~%" (-> this next-change)) + (format #t "~2Tshoot-angle: ~f~%" (-> this shoot-angle)) + (format #t "~2Tmiss-amount: ~f~%" (-> this miss-amount)) + (format #t "~2Tambient-sound-id: ~D~%" (-> this ambient-sound-id)) + (format #t "~2Tshock-effect-time: ~D~%" (-> this shock-effect-time)) + (format #t "~2Tshock-effect-end: ~D~%" (-> this shock-effect-end)) + (format #t "~2Tfade: ~f~%" (-> this fade)) + (format #t "~2Tdest-fade: ~f~%" (-> this dest-fade)) (label cfg-4) - obj + this ) ;; definition for symbol *predator-nav-enemy-info*, type nav-enemy-info @@ -465,86 +465,86 @@ (set! (-> *predator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type predator -(defmethod general-event-handler predator ((obj predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler predator ((this predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('attack) - (set! (-> obj shock-effect-end) (the-as uint (+ (current-time) (seconds 1)))) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (set! (-> this shock-effect-end) (the-as uint (+ (current-time) (seconds 1)))) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('death-end) - (when (nonzero? (-> obj ambient-sound-id)) - (sound-stop (-> obj ambient-sound-id)) - (set! (-> obj ambient-sound-id) (new 'static 'sound-id)) + (when (nonzero? (-> this ambient-sound-id)) + (sound-stop (-> this ambient-sound-id)) + (set! (-> this ambient-sound-id) (new 'static 'sound-id)) 0 ) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 77 of type predator -(defmethod enemy-method-77 predator ((obj predator) (arg0 (pointer float))) +(defmethod enemy-method-77 predator ((this predator) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + ((zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 14))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 14))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 14)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 14)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 14)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 14)) num-func-seek!) ) ) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((v1-32 (get-rand-int obj 2))) + (let ((v1-32 (get-rand-int this 2))) (cond ((zero? v1-32) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 21)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) (-> arg0 0)) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) ) ) ((= v1-32 1) - (let ((a0-12 (-> obj skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-12 param 1) (-> arg0 0)) (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) ) ) @@ -552,26 +552,26 @@ ) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-15 (-> obj skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-15 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-15 param 1) (-> arg0 0)) (set! (-> a0-15 frame-num) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-17 (-> obj skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> obj draw art-group data 12))) + (let ((a0-17 (-> this skel root-channel 0))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) (set! (-> a0-17 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 12)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) ) (set! (-> a0-17 param 1) (-> arg0 0)) (set! (-> a0-17 frame-num) 0.0) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> obj draw art-group data 12)) num-func-seek!) + (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) ) ) ) @@ -581,73 +581,73 @@ ) ;; definition for method 78 of type predator -(defmethod enemy-method-78 predator ((obj predator) (arg0 (pointer float))) +(defmethod enemy-method-78 predator ((this predator) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) - (case (-> obj incoming knocked-type) + ((zero? (-> this hit-points)) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 15))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 15))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 15)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 15)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 15)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 15)) num-func-seek!) ) ) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.01)) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) (-> arg0 0)) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) ) (((knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-11 (-> obj skel root-channel 0))) - (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19))) + (let ((a0-11 (-> this skel root-channel 0))) + (set! (-> a0-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) (set! (-> a0-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) ) (set! (-> a0-11 param 1) (-> arg0 0)) (set! (-> a0-11 frame-num) 0.0) - (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!) + (joint-control-channel-group! a0-11 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-13 (-> obj skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 13))) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 13))) (set! (-> a0-13 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 13)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 13)) frames num-frames) -1)) ) (set! (-> a0-13 param 1) (-> arg0 0)) (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 13)) num-func-seek!) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 13)) num-func-seek!) ) ) ) @@ -659,7 +659,7 @@ ;; definition for method 188 of type predator ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod predator-method-188 predator ((obj predator) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod predator-method-188 predator ((this predator) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((f0-0 1228.8) (f30-0 6144.0) @@ -669,8 +669,8 @@ (let ((v1-4 s5-0)) (set! (-> v1-4 radius) f0-0) (set! (-> v1-4 collide-with) (collide-spec backgnd)) - (set! (-> v1-4 ignore-process0) obj) - (set! (-> v1-4 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-4 ignore-process0) this) + (set! (-> v1-4 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-4 action-mask) (collide-action solid)) ) @@ -699,8 +699,8 @@ (let ((v1-14 s5-0)) (set! (-> v1-14 radius) f30-0) (set! (-> v1-14 collide-with) (collide-spec enemy hit-by-player-list hit-by-others-list)) - (set! (-> v1-14 ignore-process0) obj) - (set! (-> v1-14 ignore-process1) (handle->process (-> obj focus handle))) + (set! (-> v1-14 ignore-process0) this) + (set! (-> v1-14 ignore-process1) (handle->process (-> this focus handle))) (set! (-> v1-14 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-14 action-mask) (collide-action solid)) ) @@ -732,7 +732,7 @@ ;; definition for method 184 of type predator ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod predator-method-184 predator ((obj predator) (arg0 int) (arg1 float)) +(defmethod predator-method-184 predator ((this predator) (arg0 int) (arg1 float)) (local-vars (sv-224 vector) (sv-240 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -742,15 +742,15 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((a1-1 (-> obj node-list data arg0)) + (let ((a1-1 (-> this node-list data arg0)) (s5-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options)) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (let* ((v1-10 *game-info*) (a0-11 (+ (-> v1-10 attack-id) 1)) ) @@ -759,11 +759,11 @@ ) (set! (-> s5-0 timeout) (seconds 4)) (vector<-cspace! (-> s5-0 pos) a1-1) - (let ((s2-0 (handle->process (-> obj focus handle))) + (let ((s2-0 (handle->process (-> this focus handle))) (s3-0 (new 'stack-no-clear 'vector)) ) (when s2-0 - (seek! (-> obj miss-amount) (* 0.5 (vector-length (-> (the-as process-focusable s2-0) root transv))) 4096.0) + (seek! (-> this miss-amount) (* 0.5 (vector-length (-> (the-as process-focusable s2-0) root transv))) 4096.0) (set! (-> s3-0 quad) (-> (get-trans (the-as process-focusable s2-0) 3) quad)) (set! sv-224 (new 'stack-no-clear 'vector)) (let ((v1-24 (-> s5-0 pos)) @@ -802,19 +802,19 @@ (vector-normalize! sv-240 1.0) (vector-cross! s0-0 sv-224 sv-240) (vector-normalize! s0-0 1.0) - (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-224 (-> obj shoot-angle)))) + (let ((a2-5 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) sv-224 (-> this shoot-angle)))) (vector-orient-by-quat! sv-240 sv-240 a2-5) ) (let* ((t9-9 quaternion-vector-angle!) (a0-27 (new 'stack-no-clear 'quaternion)) - (a2-6 (-> obj shoot-angle)) + (a2-6 (-> this shoot-angle)) (a2-7 (t9-9 a0-27 sv-224 a2-6)) ) (vector-orient-by-quat! s0-0 s0-0 a2-7) ) (let ((a0-29 s1-1)) (let ((v1-32 s3-0)) - (let ((a1-17 (-> obj miss-amount))) + (let ((a1-17 (-> this miss-amount))) (.mov vf7 a1-17) ) (.lvf vf5 (&-> sv-240 quad)) @@ -826,7 +826,7 @@ (.svf (&-> a0-29 quad) vf6) ) (let ((v1-33 s3-0)) - (let ((a0-30 (* arg1 (-> obj miss-amount)))) + (let ((a0-30 (* arg1 (-> this miss-amount)))) (.mov vf7 a0-30) ) (.lvf vf5 (&-> s0-0 quad)) @@ -841,7 +841,7 @@ (vector-! (-> s5-0 vel) s3-0 (-> s5-0 pos)) (vector-normalize! (-> s5-0 vel) 409600.0) (vector-normalize! (-> s5-0 vel) 532480.0) - (spawn-projectile predator-shot s5-0 obj *default-dead-pool*) + (spawn-projectile predator-shot s5-0 this *default-dead-pool*) ) ) ) @@ -874,48 +874,48 @@ ;; definition for method 183 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod predator-method-183 predator ((obj predator)) +(defmethod predator-method-183 predator ((this predator)) (cond - ((< (-> obj hit-points) 2) - (when (!= (-> obj dest-fade) 128.0) + ((< (-> this hit-points) 2) + (when (!= (-> this dest-fade) 128.0) (sound-play "pred-uncloak") - (stop! (-> obj sound)) - (set! (-> obj sound) (the-as ambient-sound 0)) + (stop! (-> this sound)) + (set! (-> this sound) (the-as ambient-sound 0)) 0 ) - (set! (-> obj dest-fade) 128.0) + (set! (-> this dest-fade) 128.0) ) (else - (set! (-> obj dest-fade) 0.0) + (set! (-> this dest-fade) 0.0) ) ) - (seek! (-> obj fade) (-> obj dest-fade) (* 60.0 (seconds-per-frame))) - (set! (-> obj draw force-fade) (the-as uint (the int (-> obj fade)))) + (seek! (-> this fade) (-> this dest-fade) (* 60.0 (seconds-per-frame))) + (set! (-> this draw force-fade) (the-as uint (the int (-> this fade)))) (cond - ((zero? (-> obj draw force-fade)) - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 0 4) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((zero? (-> this draw force-fade)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 0 4) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) - ((= (-> obj draw force-fade) 128) - (setup-masks (-> obj draw) 0 8) - (setup-masks (-> obj draw) 4 0) - (logclear! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + ((= (-> this draw force-fade) 128) + (setup-masks (-> this draw) 0 8) + (setup-masks (-> this draw) 4 0) + (logclear! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) (else - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 4 0) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 4 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) ) ) - (if (< 245760.0 (vector-vector-distance (-> obj root trans) (camera-pos))) - (setup-masks (-> obj draw) 0 8) + (if (< 245760.0 (vector-vector-distance (-> this root trans) (camera-pos))) + (setup-masks (-> this draw) 0 8) ) - (when (< (current-time) (the-as time-frame (-> obj shock-effect-end))) - (when (>= (- (current-time) (-> obj shock-effect-time)) (seconds 0.04)) - (set! (-> obj shock-effect-time) (current-time)) + (when (< (current-time) (the-as time-frame (-> this shock-effect-end))) + (when (time-elapsed? (-> this shock-effect-time) (seconds 0.04)) + (set-time! (-> this shock-effect-time)) (process-drawable-shock-skel-effect - obj + this (-> *lightning-spec-id-table* 18) lightning-probe-callback (-> *part-id-table* 166) @@ -1098,7 +1098,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1163,7 +1163,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-4 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-4 enemy-flags))) @@ -1186,7 +1186,7 @@ (if (< (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)) 65536.0) (go-virtual hostile) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) (check-los? (-> self los) 0) (not (logtest? (-> self draw status) (draw-control-status on-screen))) ) @@ -1203,7 +1203,7 @@ (set! (-> a0-12 target-post quad) (-> v1-30 quad)) ) 0 - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.5)) (logtest? (-> self nav state flags) (nav-state-flag at-target)) ) (go-virtual hidden) @@ -1235,7 +1235,7 @@ ) ) (set! (-> self want-stop) #f) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self next-change) (the-as uint (+ (current-time) (the int (* 300.0 (rand-vu-float-range 4.0 8.0))))) ) @@ -1249,7 +1249,7 @@ (t9-0) ) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 5)) + (if (time-elapsed? (-> self state-time) (seconds 5)) (go-virtual hide) ) (let ((gp-0 (handle->process (-> self focus handle)))) @@ -1257,7 +1257,7 @@ (go-virtual active) ) (when (get-enemy-target self) - (when (and gp-0 (>= (- (current-time) (-> self state-time)) (-> self reaction-time))) + (when (and gp-0 (time-elapsed? (-> self state-time) (-> self reaction-time))) (let ((f0-0 (vector-vector-xz-distance (get-trans (the-as process-focusable gp-0) 0) (-> self root trans)))) (cond ((< f0-0 16384.0) @@ -1293,7 +1293,7 @@ ;; definition for method 186 of type predator ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod predator-method-186 predator ((obj predator)) +(defmethod predator-method-186 predator ((this predator)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1304,7 +1304,7 @@ (init-vf0-vector) (let ((f30-0 0.0) (s5-0 -1) - (s4-0 (-> *predator-graph* node (-> obj curr-node))) + (s4-0 (-> *predator-graph* node (-> this curr-node))) ) (dotimes (s3-0 32) (when (logtest? (the-as int (-> s4-0 points)) (ash 1 s3-0)) @@ -1329,7 +1329,7 @@ (when (or (= s5-0 -1) (< f30-0 f0-3)) (set! s5-0 s3-0) (set! f30-0 f0-3) - (set! (-> obj hide-pos quad) (-> s2-0 quad)) + (set! (-> this hide-pos quad) (-> s2-0 quad)) ) ) ) @@ -1341,14 +1341,14 @@ ) ;; definition for method 185 of type predator -(defmethod predator-method-185 predator ((obj predator)) +(defmethod predator-method-185 predator ((this predator)) (let ((f30-0 0.0) (s5-0 -1) ) -1 (dotimes (s4-0 (the-as int (-> *predator-graph* node-count))) (let* ((s3-0 (-> *predator-graph* node s4-0)) - (f0-0 (vector-vector-distance (-> s3-0 position) (-> obj root trans))) + (f0-0 (vector-vector-distance (-> s3-0 position) (-> this root trans))) ) (when (and (not (logtest? (-> s3-0 flags) (predator-node-flag taken))) (or (= s5-0 -1) (< f0-0 f30-0))) (set! f30-0 f0-0) @@ -1356,16 +1356,16 @@ ) ) ) - (set! (-> obj curr-node) s5-0) + (set! (-> this curr-node) s5-0) (logior! (-> *predator-graph* node s5-0 flags) (predator-node-flag taken)) ) - (predator-method-186 obj) + (predator-method-186 this) (none) ) ;; definition for method 187 of type predator -(defmethod predator-method-187 predator ((obj predator)) - (let* ((s5-0 (-> *predator-graph* node (-> obj curr-node))) +(defmethod predator-method-187 predator ((this predator)) + (let* ((s5-0 (-> *predator-graph* node (-> this curr-node))) (s4-0 (rand-vu-int-count (-> s5-0 edge-count))) ) (dotimes (s3-0 (-> s5-0 edge-count)) @@ -1383,7 +1383,7 @@ ) (logior! (-> s1-0 flags) (predator-node-flag taken)) (logclear! (-> s5-0 flags) (predator-node-flag taken)) - (set! (-> obj curr-node) (the-as int s2-0)) + (set! (-> this curr-node) (the-as int s2-0)) (return #t) ) ) @@ -1394,26 +1394,26 @@ ;; definition for method 55 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod track-target! predator ((obj predator)) +(defmethod track-target! predator ((this predator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (predator-method-183 obj) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) - (when (nonzero? (-> obj sound)) - (update-trans! (-> obj sound) (-> obj root trans)) - (update! (-> obj sound)) + (predator-method-183 this) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (when (nonzero? (-> this sound)) + (update-trans! (-> this sound) (-> this root trans)) + (update! (-> this sound)) ) (none) ) ;; definition for method 182 of type predator -(defmethod set-dangerous! predator ((obj predator) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod set-dangerous! predator ((this predator) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (dotimes (a0-1 (the-as int (-> v1-1 specific 0))) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a0-1))) (if arg0 @@ -1428,9 +1428,9 @@ ;; definition for method 114 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! predator ((obj predator)) +(defmethod init-enemy-collision! predator ((this predator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1499,7 +1499,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1507,22 +1507,22 @@ ;; definition for method 7 of type predator ;; WARN: Return type mismatch process-focusable vs predator. -(defmethod relocate predator ((obj predator) (arg0 int)) +(defmethod relocate predator ((this predator) (arg0 int)) (the-as predator - ((the-as (function process-focusable int process-focusable) (find-parent-method predator 7)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method predator 7)) this arg0) ) ) ;; definition for method 167 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-167 predator ((obj predator)) - (let ((v1-0 (-> obj nav))) +(defmethod nav-enemy-method-167 predator ((this predator)) + (let ((v1-0 (-> this nav))) (set! (-> v1-0 target-speed) 0.0) ) 0 - (let ((v1-2 (-> obj nav))) - (set! (-> v1-2 acceleration) (-> obj enemy-info walk-acceleration)) + (let ((v1-2 (-> this nav))) + (set! (-> v1-2 acceleration) (-> this enemy-info walk-acceleration)) ) 0 0 @@ -1530,16 +1530,16 @@ ) ;; definition for method 12 of type predator -(defmethod run-logic? predator ((obj predator)) +(defmethod run-logic? predator ((this predator)) #t ) ;; definition for method 63 of type predator ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 predator ((obj predator) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 predator ((this predator) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 obj arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 this arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) @@ -1547,65 +1547,72 @@ ;; definition for method 11 of type predator ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! predator ((obj predator) (arg0 entity-actor)) +(defmethod init-from-entity! predator ((this predator) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) ;; definition for method 113 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-behaviour-and-stats! predator ((obj predator) (arg0 nav-enemy-info)) +(defmethod init-enemy-behaviour-and-stats! predator ((this predator) (arg0 nav-enemy-info)) "Initializes a bunch of enemy fields related to how they should react, how many hitpoints they should have, etc" (set! (-> arg0 nav-mesh) *default-nav-mesh*) (let ((t9-0 (method-of-type nav-enemy init-enemy-behaviour-and-stats!))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) 0 (none) ) ;; definition for method 115 of type predator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! predator ((obj predator)) +(defmethod init-enemy! predator ((this predator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-predator" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *predator-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *predator-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 327680.0) - (add-connection *part-engine* obj 8 obj 318 (new 'static 'vector :x 1228.8 :y 450.56 :z 983.04 :w 614400.0)) - (add-connection *part-engine* obj 8 obj 318 (new 'static 'vector :x -1228.8 :y 450.56 :z 983.04 :w 614400.0)) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd enemy obstacle)) - (setup-masks (-> obj draw) 8 0) - (setup-masks (-> obj draw) 4 0) - (logior! (-> obj draw status) (draw-control-status force-fade warp-cross-fade)) - (set! (-> obj draw force-fade) (the-as uint 0)) - (set! (-> obj fade) 0.0) - (set! (-> obj dest-fade) 0.0) - (set! (-> obj curr-node) -1) - (set! (-> obj next-change) (the-as uint 0)) - (set! (-> obj miss-amount) 16384.0) - (set! (-> obj ambient-sound-id) (new 'static 'sound-id)) - (predator-method-185 obj) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "pred-hum" :fo-min 2 :fo-max 30) (-> obj root trans)) + (set-gravity-length (-> this root dynam) 327680.0) + (add-connection *part-engine* this 8 this 318 (new 'static 'vector :x 1228.8 :y 450.56 :z 983.04 :w 614400.0)) + (add-connection + *part-engine* + this + 8 + this + 318 + (new 'static 'vector :x -1228.8 :y 450.56 :z 983.04 :w 614400.0) + ) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd enemy obstacle)) + (setup-masks (-> this draw) 8 0) + (setup-masks (-> this draw) 4 0) + (logior! (-> this draw status) (draw-control-status force-fade warp-cross-fade)) + (set! (-> this draw force-fade) (the-as uint 0)) + (set! (-> this fade) 0.0) + (set! (-> this dest-fade) 0.0) + (set! (-> this curr-node) -1) + (set! (-> this next-change) (the-as uint 0)) + (set! (-> this miss-amount) 16384.0) + (set! (-> this ambient-sound-id) (new 'static 'sound-id)) + (predator-method-185 this) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "pred-hum" :fo-min 2 :fo-max 30) (-> this root trans)) ) - (logior! (-> obj enemy-flags) (enemy-flag trackable-backup enable-on-hostile)) - (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector #t) 0) + (logior! (-> this enemy-flags) (enemy-flag trackable-backup enable-on-hostile)) + (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector #t) 0) 0 (none) ) @@ -1630,24 +1637,24 @@ This commonly includes things such as: ) ;; definition for method 3 of type predator-manager -(defmethod inspect predator-manager ((obj predator-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect predator-manager ((this predator-manager)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpredator-count: ~D~%" (-> obj predator-count)) - (format #t "~2Tpredator-h[32] @ #x~X~%" (-> obj predator-h)) - (format #t "~2Thud-counter: ~D~%" (-> obj hud-counter)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tpredator-count: ~D~%" (-> this predator-count)) + (format #t "~2Tpredator-h[32] @ #x~X~%" (-> this predator-h)) + (format #t "~2Thud-counter: ~D~%" (-> this hud-counter)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) (label cfg-7) - obj + this ) ;; definition for symbol *predator-manager*, type predator-manager @@ -1655,17 +1662,17 @@ This commonly includes things such as: ;; definition for method 7 of type predator-manager ;; WARN: Return type mismatch process vs predator-manager. -(defmethod relocate predator-manager ((obj predator-manager) (arg0 int)) - (set! *predator-manager* obj) +(defmethod relocate predator-manager ((this predator-manager) (arg0 int)) + (set! *predator-manager* this) (if *predator-manager* (set! *predator-manager* (&+ *predator-manager* arg0)) ) - (the-as predator-manager ((method-of-type process relocate) obj arg0)) + (the-as predator-manager ((method-of-type process relocate) this arg0)) ) ;; definition for method 16 of type predator-manager ;; WARN: Return type mismatch int vs none. -(defmethod predator-manager-method-16 predator-manager ((obj predator-manager)) +(defmethod predator-manager-method-16 predator-manager ((this predator-manager)) 0 (none) ) @@ -1719,7 +1726,7 @@ This commonly includes things such as: ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. ;; WARN: new jak 2 until loop case, check carefully -(defmethod init-from-entity! predator-manager ((obj predator-manager) (arg0 entity-actor)) +(defmethod init-from-entity! predator-manager ((this predator-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1737,7 +1744,7 @@ This commonly includes things such as: (init-vf0-vector) (cond ((task-node-closed? (game-task-node forest-hunt-resolution)) - (go (method-of-object obj closed)) + (go (method-of-object this closed)) ) (else (dotimes (v1-2 (the-as int (-> *predator-graph* node-count))) @@ -1747,23 +1754,23 @@ This commonly includes things such as: ) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-6 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-6 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-6 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-6)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-6)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) (go process-drawable-art-error "actor-group predator-manager") ) ) ) - (dotimes (s5-0 (length (-> obj actor-group 0))) - (let ((t0-1 (-> obj actor-group 0 data s5-0 actor))) + (dotimes (s5-0 (length (-> this actor-group 0))) + (let ((t0-1 (-> this actor-group 0 data s5-0 actor))) (if t0-1 - (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector t0-1) 0) + (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector t0-1) 0) ) ) ) @@ -1818,10 +1825,10 @@ This commonly includes things such as: (set! (-> s2-1 trans quad) (-> s1-0 quad)) ) (quaternion-copy! (-> s2-1 quat) *unity-quaternion*) - (set! (-> s2-1 entity) (-> obj actor-group 1 data s5-2 actor)) + (set! (-> s2-1 entity) (-> this actor-group 1 data s5-2 actor)) (set! (-> s2-1 directed?) #f) (set! (-> s2-1 no-initial-move-to-ground?) #f) - (let* ((s1-2 (ppointer->process (process-spawn predator :init enemy-init-by-other obj s2-1 :to obj))) + (let* ((s1-2 (ppointer->process (process-spawn predator :init enemy-init-by-other this s2-1 :to this))) (s2-2 (if (type? s1-2 process-focusable) s1-2 ) @@ -1832,8 +1839,8 @@ This commonly includes things such as: ) ) ) - (set! (-> obj predator-h (-> obj predator-count)) (process->handle s2-2)) - (+! (-> obj predator-count) 1) + (set! (-> this predator-h (-> this predator-count)) (process->handle s2-2)) + (+! (-> this predator-count) 1) (when v1-66 (change-to (-> v1-66 nav-mesh) (the-as process-drawable s2-2)) (let ((v1-70 (-> (the-as process-drawable s2-2) nav state))) @@ -1848,7 +1855,7 @@ This commonly includes things such as: ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc index 798c2353a6..15e1c0be34 100644 --- a/test/decompiler/reference/jak2/levels/forest/wren_REF.gc +++ b/test/decompiler/reference/jak2/levels/forest/wren_REF.gc @@ -35,30 +35,30 @@ ) ;; definition for method 3 of type wren -(defmethod inspect wren ((obj wren)) - (when (not obj) - (set! obj obj) +(defmethod inspect wren ((this wren)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tmove-dest: #~%" (-> obj move-dest)) - (format #t "~2Tfly-curve[2] @ #x~X~%" (-> obj fly-curve)) - (format #t "~2Tfly-index: ~D~%" (-> obj fly-index)) - (format #t "~2Tfly-speed: ~f~%" (-> obj fly-speed)) - (format #t "~2Tfly-y-rate: ~f~%" (-> obj fly-y-rate)) - (format #t "~2Tfly-interp: ~f~%" (-> obj fly-interp)) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) - (format #t "~2Tpath-du-mod: ~f~%" (-> obj path-du-mod)) - (format #t "~2Tbob-level: ~f~%" (-> obj bob-level)) - (format #t "~2Tbob-level-seek: ~f~%" (-> obj bob-level-seek)) - (format #t "~2Tbank-angle: ~f~%" (-> obj bank-angle)) - (format #t "~2Tpeck-timer: ~D~%" (-> obj peck-timer)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) + (format #t "~2Tmove-dest: #~%" (-> this move-dest)) + (format #t "~2Tfly-curve[2] @ #x~X~%" (-> this fly-curve)) + (format #t "~2Tfly-index: ~D~%" (-> this fly-index)) + (format #t "~2Tfly-speed: ~f~%" (-> this fly-speed)) + (format #t "~2Tfly-y-rate: ~f~%" (-> this fly-y-rate)) + (format #t "~2Tfly-interp: ~f~%" (-> this fly-interp)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-du: ~f~%" (-> this path-du)) + (format #t "~2Tpath-du-mod: ~f~%" (-> this path-du-mod)) + (format #t "~2Tbob-level: ~f~%" (-> this bob-level)) + (format #t "~2Tbob-level-seek: ~f~%" (-> this bob-level-seek)) + (format #t "~2Tbank-angle: ~f~%" (-> this bank-angle)) + (format #t "~2Tpeck-timer: ~D~%" (-> this peck-timer)) + (format #t "~2Tflags: ~D~%" (-> this flags)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -68,11 +68,11 @@ ) ;; definition for method 27 of type wren -(defmethod debug-draw-path wren ((obj wren)) +(defmethod debug-draw-path wren ((this wren)) "Draws the associated [[curve-control]]s associated with this wren" (dotimes (s5-0 2) - (if (-> obj fly-curve s5-0) - (debug-draw (-> obj fly-curve s5-0)) + (if (-> this fly-curve s5-0) + (debug-draw (-> this fly-curve s5-0)) ) ) #f @@ -138,7 +138,7 @@ ;; definition for method 26 of type wren ;; WARN: Return type mismatch object vs symbol. -(defmethod spooked? wren ((obj wren)) +(defmethod spooked? wren ((this wren)) "@returns a [[symbol]] indicating if Jak is considered close enough to the wren to spook it. If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (let* ((gp-0 *target*) @@ -147,7 +147,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" ) ) ) - (the-as symbol (and a0-2 (< (vector-vector-xz-distance (-> obj root trans) (get-trans a0-2 0)) 102400.0))) + (the-as symbol (and a0-2 (< (vector-vector-xz-distance (-> this root trans) (get-trans a0-2 0)) 102400.0))) ) ) @@ -208,12 +208,12 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (defstate peck (wren) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self peck-timer) (the-as uint (the int (* 300.0 (rand-vu-float-range 1.4 4.3))))) (logclear! (-> self flags) (wren-flags wrflags-1 wrflags-2)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self peck-timer))) + (when (time-elapsed? (-> self state-time) (the-as time-frame (-> self peck-timer))) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)))) (if (< (fabs (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle gp-1))) 728.1778) (go-virtual hunt) @@ -256,7 +256,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (f30-1 1.0) ) (ja-no-eval :group! wren-idle-ja :num! (loop! f30-1) :frame-num 0.0) - (until (>= (- (current-time) gp-1) s5-1) + (until (time-elapsed? gp-1 s5-1) (suspend) (ja :num! (loop! f30-1)) ) @@ -267,7 +267,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (f30-3 1.0) ) (ja-no-eval :group! wren-idle-ja :num! (loop! f30-3) :frame-num 0.0) - (until (>= (- (current-time) gp-2) s5-2) + (until (time-elapsed? gp-2 s5-2) (suspend) (ja :num! (loop! f30-3)) ) @@ -309,7 +309,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (f30-0 2.0) ) (ja-no-eval :group! wren-takeoff-ja :num! (loop! f30-0) :frame-num 0.0) - (until (>= (- (current-time) gp-0) s5-0) + (until (time-elapsed? gp-0 s5-0) (suspend) (ja :num! (loop! f30-0)) ) @@ -396,7 +396,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" :trans (behavior () (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)))) (when (< (fabs (deg-diff (quaternion-y-angle (-> self root quat)) (vector-y-angle gp-1))) 728.1778) - (when (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self peck-timer))) + (when (time-elapsed? (-> self state-time) (the-as time-frame (-> self peck-timer))) (set! (-> self fly-index) (logand (+ (-> self fly-index) 1) 1)) (go-virtual fly) ) @@ -411,7 +411,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (f30-1 1.0) ) (ja-no-eval :group! wren-idle-ja :num! (loop! f30-1) :frame-num 0.0) - (until (>= (- (current-time) gp-0) s5-0) + (until (time-elapsed? gp-0 s5-0) (suspend) (ja :num! (loop! f30-1)) ) @@ -422,7 +422,7 @@ If so, it transitions from [[wren::peck]] to [[wren::hunt]]" (f30-2 1.0) ) (ja-no-eval :group! wren-idle-ja :num! (loop! f30-2) :frame-num 0.0) - (until (>= (- (current-time) gp-1) s5-1) + (until (time-elapsed? gp-1 s5-1) (suspend) (ja :num! (loop! f30-2)) ) @@ -449,61 +449,64 @@ 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 ((obj wren) (arg0 int)) +(defmethod relocate wren ((this wren) (arg0 int)) (dotimes (v1-0 2) - (when (-> obj fly-curve v1-0) - (if (nonzero? (-> obj fly-curve v1-0)) - (&+! (-> obj fly-curve v1-0) arg0) + (when (-> this fly-curve v1-0) + (if (nonzero? (-> this fly-curve v1-0)) + (&+! (-> this fly-curve v1-0) arg0) ) ) ) - (the-as wren ((the-as (function process-drawable int process-drawable) (find-parent-method wren 7)) obj arg0)) + (the-as + wren + ((the-as (function process-drawable int process-drawable) (find-parent-method wren 7)) this arg0) + ) ) ;; definition for method 11 of type wren ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! wren ((obj wren) (arg0 entity-actor)) +(defmethod init-from-entity! wren ((this wren) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-wren" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((f0-0 (rand-vu-float-range 1.5 3.5))) - (set-vector! (-> obj root scale) f0-0 f0-0 f0-0 1.0) + (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) ) - (set! (-> obj fly-index) (the-as uint 0)) - (set! (-> obj path-u) 0.0) - (set! (-> obj flags) (wren-flags)) - (set! (-> obj bob-level) 0.0) - (set! (-> obj bank-angle) 0.0) - (set! (-> obj path) (new 'process 'path-control obj 'idle 0.0 arg0 #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fly-index) (the-as uint 0)) + (set! (-> this path-u) 0.0) + (set! (-> this flags) (wren-flags)) + (set! (-> this bob-level) 0.0) + (set! (-> this bank-angle) 0.0) + (set! (-> this path) (new 'process 'path-control this 'idle 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) + ((logtest? (-> this path flags) (path-control-flag not-found)) (dotimes (s5-1 2) - (set! (-> obj fly-curve s5-1) (new 'process 'curve-control obj 'path (the float s5-1))) - (logior! (-> obj fly-curve s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fly-curve s5-1) (new 'process 'curve-control this 'path (the float s5-1))) + (logior! (-> this fly-curve s5-1 flags) (path-control-flag display draw-line draw-point draw-text)) ) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 8 0) - (go (method-of-object obj fly)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 8 0) + (go (method-of-object this fly)) ) (else - (set! (-> obj fly-curve 0) (new 'process 'curve-control obj 'takeoff -1000000000.0)) - (logior! (-> obj fly-curve 0 flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fly-curve 1) #f) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 2 0) - (go (method-of-object obj peck)) + (set! (-> this fly-curve 0) (new 'process 'curve-control this 'takeoff -1000000000.0)) + (logior! (-> this fly-curve 0 flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fly-curve 1) #f) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 2 0) + (go (method-of-object this peck)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc index c80d1617c1..505bc751ed 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-obs_REF.gc @@ -22,24 +22,24 @@ ) ;; definition for method 3 of type fort-elec-switch -(defmethod inspect fort-elec-switch ((obj fort-elec-switch)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-elec-switch ((this fort-elec-switch)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tl-bolt: ~A~%" (-> obj l-bolt)) - (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) - (format #t "~2Ttank-actor: ~A~%" (-> obj tank-actor)) - (format #t "~2Tswitch-group: #x~X~%" (-> obj switch-group)) - (dotimes (s5-0 (-> obj switch-group-count)) - (format #t "~T [~D]~2Tswitch-group: ~`actor-group`P~%" s5-0 (-> obj switch-group s5-0)) + (format #t "~2Tl-bolt: ~A~%" (-> this l-bolt)) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~2Ttank-actor: ~A~%" (-> this tank-actor)) + (format #t "~2Tswitch-group: #x~X~%" (-> this switch-group)) + (dotimes (s5-0 (-> this switch-group-count)) + (format #t "~T [~D]~2Tswitch-group: ~`actor-group`P~%" s5-0 (-> this switch-group s5-0)) ) - (format #t "~2Tswitch-group-count: ~D~%" (-> obj switch-group-count)) + (format #t "~2Tswitch-group-count: ~D~%" (-> this switch-group-count)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -71,7 +71,7 @@ :event (-> (method-of-type fort-elec-switch idle) event) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 16)) + (until (time-elapsed? gp-0 (seconds 16)) (suspend) ) ) @@ -79,7 +79,7 @@ (suspend) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.4)) + (until (time-elapsed? gp-1 (seconds 0.4)) (suspend) ) ) @@ -161,7 +161,7 @@ ) (sound-play "elec-switch") (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.5)) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -197,7 +197,7 @@ ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.75)) + (until (time-elapsed? gp-3 (seconds 0.75)) (suspend) ) ) @@ -217,7 +217,7 @@ ) ) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 1.5)) + (until (time-elapsed? gp-4 (seconds 1.5)) (suspend) ) ) @@ -247,17 +247,17 @@ ;; definition for method 7 of type fort-elec-switch ;; WARN: Return type mismatch process-drawable vs fort-elec-switch. -(defmethod relocate fort-elec-switch ((obj fort-elec-switch) (arg0 int)) - (if (nonzero? (-> obj l-bolt)) - (&+! (-> obj l-bolt) arg0) +(defmethod relocate fort-elec-switch ((this fort-elec-switch) (arg0 int)) + (if (nonzero? (-> this l-bolt)) + (&+! (-> this l-bolt) arg0) ) - (the-as fort-elec-switch ((method-of-type process-drawable relocate) obj arg0)) + (the-as fort-elec-switch ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type fort-elec-switch ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-elec-switch ((obj fort-elec-switch) (arg0 entity-actor)) +(defmethod init-from-entity! fort-elec-switch ((this fort-elec-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -265,7 +265,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -280,34 +280,34 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-elec-switch" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj tank-actor) (entity-actor-lookup arg0 'alt-actor 1)) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this tank-actor) (entity-actor-lookup arg0 'alt-actor 1)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-11 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-11 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-11 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj switch-group) (the-as (pointer actor-group) v1-11)) - (set! (-> obj switch-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this switch-group) (the-as (pointer actor-group) v1-11)) + (set! (-> this switch-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj switch-group) (the-as (pointer actor-group) #f)) - (set! (-> obj switch-group-count) 0) + (set! (-> this switch-group) (the-as (pointer actor-group) #f)) + (set! (-> this switch-group-count) 0) 0 ) ) ) - (let ((a0-18 (-> obj skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-18 (-> this skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) (let ((a2-8 (new 'static 'lightning-spec @@ -330,21 +330,21 @@ This commonly includes things such as: ) ) ) - (set! (-> obj l-bolt) (new 'process 'lightning-control a2-8 obj 0.0)) + (set! (-> this l-bolt) (new 'process 'lightning-control a2-8 this 0.0)) ) (let ((a0-20 (new 'stack-no-clear 'vector)) (v1-26 (new 'stack-no-clear 'vector)) ) - (set! (-> a0-20 quad) (-> obj root trans quad)) - (set! (-> v1-26 quad) (-> obj root trans quad)) + (set! (-> a0-20 quad) (-> this root trans quad)) + (set! (-> v1-26 quad) (-> this root trans quad)) (+! (-> a0-20 y) 4915.2) (+! (-> v1-26 y) 17203.2) - (set! (-> obj l-bolt state meet data 0 quad) (-> a0-20 quad)) - (let ((a0-22 (-> obj l-bolt))) + (set! (-> this l-bolt state meet data 0 quad) (-> a0-20 quad)) + (let ((a0-22 (-> this l-bolt))) (set! (-> a0-22 state meet data (+ (-> a0-22 state points-to-draw) -1) quad) (-> v1-26 quad)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -369,20 +369,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-fence -(defmethod inspect fort-fence ((obj fort-fence)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-fence ((this fort-fence)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Texit-anim: ~A~%" (-> obj exit-anim)) - (format #t "~2Tloading?: ~A~%" (-> obj loading?)) - (format #t "~2Ttank: ~D~%" (-> obj tank)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Texit-anim: ~A~%" (-> this exit-anim)) + (format #t "~2Tloading?: ~A~%" (-> this loading?)) + (format #t "~2Ttank: ~D~%" (-> this tank)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -399,14 +399,14 @@ This commonly includes things such as: ;; definition for method 22 of type fort-fence ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-22 fort-fence ((obj fort-fence)) +(defmethod fort-fence-method-22 fort-fence ((this fort-fence)) 0 (none) ) ;; definition for method 23 of type fort-fence ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-23 fort-fence ((obj fort-fence)) +(defmethod fort-fence-method-23 fort-fence ((this fort-fence)) 0 (none) ) @@ -497,35 +497,35 @@ This commonly includes things such as: ;; definition for method 11 of type fort-fence ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-fence ((obj fort-fence) (arg0 entity-actor)) +(defmethod init-from-entity! fort-fence ((this fort-fence) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (fort-fence-method-23 obj) - (process-drawable-from-entity! obj arg0) - (fort-fence-method-22 obj) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj loading?) #f) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (stack-size-set! (-> this main-thread) 512) + (fort-fence-method-23 this) + (process-drawable-from-entity! this arg0) + (fort-fence-method-22 this) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this loading?) #f) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) (set! (-> a0-6 frame-num) 0.0) (joint-control-channel-group! a0-6 - (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) num-func-identity ) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -539,16 +539,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-fence-a -(defmethod inspect fort-fence-a ((obj fort-fence-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-fence-a ((this fort-fence-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type fort-fence inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type fort-fence-b @@ -561,54 +561,54 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-fence-b -(defmethod inspect fort-fence-b ((obj fort-fence-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-fence-b ((this fort-fence-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type fort-fence inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 22 of type fort-fence-a ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-22 fort-fence-a ((obj fort-fence-a)) +(defmethod fort-fence-method-22 fort-fence-a ((this fort-fence-a)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-fence-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "fort-fence-a" :anim-name "a-break" :parts 2 :command-list '()) ) - (set! (-> obj exit-anim) (-> obj draw art-group data 3)) + (set! (-> this exit-anim) (-> this draw art-group data 3)) 0 (none) ) ;; definition for method 22 of type fort-fence-b ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-22 fort-fence-b ((obj fort-fence-b)) +(defmethod fort-fence-method-22 fort-fence-b ((this fort-fence-b)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-fence-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "fort-fence-b" :anim-name "b-break" :parts 2 :command-list '()) ) - (set! (-> obj exit-anim) (-> obj draw art-group data 8)) + (set! (-> this exit-anim) (-> this draw art-group data 8)) 0 (none) ) ;; definition for method 23 of type fort-fence-a ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-23 fort-fence-a ((obj fort-fence-a)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod fort-fence-method-23 fort-fence-a ((this fort-fence-a)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) @@ -633,7 +633,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -641,8 +641,8 @@ This commonly includes things such as: ;; definition for method 23 of type fort-fence-b ;; WARN: Return type mismatch int vs none. -(defmethod fort-fence-method-23 fort-fence-b ((obj fort-fence-b)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod fort-fence-method-23 fort-fence-b ((this fort-fence-b)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) @@ -667,7 +667,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-part_REF.gc index b5dc510c9c..0990051bc4 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpa-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type fordumpa-part -(defmethod inspect fordumpa-part ((obj fordumpa-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect fordumpa-part ((this fordumpa-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1523,11 +1523,10 @@ ) ;; definition for method 24 of type fort-elec-gate -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch int vs none. -(defmethod elec-gate-method-24 fort-elec-gate ((obj fort-elec-gate)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 551) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 552) obj)) +(defmethod elec-gate-method-24 fort-elec-gate ((this fort-elec-gate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 551) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 552) this)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc index e1a1c18e7e..850117dd78 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-obs_REF.gc @@ -15,17 +15,17 @@ ) ;; definition for method 3 of type fort-plat-orbit -(defmethod inspect fort-plat-orbit ((obj fort-plat-orbit)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-plat-orbit ((this fort-plat-orbit)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) + (format #t "~2Tsync: #~%" (-> this sync)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -65,14 +65,14 @@ ;; definition for method 11 of type fort-plat-orbit ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-plat-orbit ((obj fort-plat-orbit) (arg0 entity-actor)) +(defmethod init-from-entity! fort-plat-orbit ((this fort-plat-orbit) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -127,17 +127,17 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-25 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-plat-orbit" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-23 (new 'stack-no-clear 'sync-info-params))) (let ((v1-34 0)) @@ -147,21 +147,21 @@ This commonly includes things such as: (set! (-> a1-23 sync-type) 'sync-linear) (set! (-> a1-23 sync-flags) (the-as sync-flags v1-34)) ) - (set! (-> a1-23 entity) (-> obj entity)) + (set! (-> a1-23 entity) (-> this entity)) (set! (-> a1-23 period) (the-as uint 6000)) (set! (-> a1-23 percent) 0.0) - (initialize! (-> obj sync) a1-23) + (initialize! (-> this sync) a1-23) ) - (let ((a0-48 (-> obj skel root-channel 0))) - (set! (-> a0-48 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-48 (-> this skel root-channel 0))) + (set! (-> a0-48 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-48 frame-num) 0.0) - (joint-control-channel-group! a0-48 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-48 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "plat-orbit" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "plat-orbit" :fo-max 70) (-> this root trans)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -180,18 +180,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-plat-shuttle-plat -(defmethod inspect fort-plat-shuttle-plat ((obj fort-plat-shuttle-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-plat-shuttle-plat ((this fort-plat-shuttle-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tpath-speed: ~f~%" (-> obj path-speed)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tpath-speed: ~f~%" (-> this path-speed)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -296,18 +296,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-plat-shuttle -(defmethod inspect fort-plat-shuttle ((obj fort-plat-shuttle)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-plat-shuttle ((this fort-plat-shuttle)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnext-spawn-time: ~D~%" (-> obj next-spawn-time)) - (format #t "~2Tsync: #~%" (-> obj sync)) + (format #t "~2Tnext-spawn-time: ~D~%" (-> this next-spawn-time)) + (format #t "~2Tsync: #~%" (-> this sync)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -340,9 +340,9 @@ This commonly includes things such as: ) ;; definition for method 22 of type fort-plat-shuttle -(defmethod fort-plat-shuttle-method-22 fort-plat-shuttle ((obj fort-plat-shuttle)) - (let* ((f28-0 (total-distance (-> obj path))) - (s5-0 (-> obj sync)) +(defmethod fort-plat-shuttle-method-22 fort-plat-shuttle ((this fort-plat-shuttle)) + (let* ((f28-0 (total-distance (-> this path))) + (s5-0 (-> this sync)) (f26-0 81.92) (a0-3 (- (current-time) (get-timeframe-offset! s5-0 0))) (v1-6 (-> s5-0 period)) @@ -351,7 +351,7 @@ This commonly includes things such as: ) (while (>= 1.0 f30-0) (if (>= f30-0 0.0) - (process-spawn fort-plat-shuttle-plat f30-0 :to obj) + (process-spawn fort-plat-shuttle-plat f30-0 :to this) ) (+! f30-0 f28-1) ) @@ -362,7 +362,7 @@ This commonly includes things such as: ;; definition for method 11 of type fort-plat-shuttle ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-plat-shuttle ((obj fort-plat-shuttle) (arg0 entity-actor)) +(defmethod init-from-entity! fort-plat-shuttle ((this fort-plat-shuttle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -370,15 +370,15 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-64 int)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-plat-shuttle" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((s4-1 (new 'stack-no-clear 'sync-info-params))) (let ((s3-1 1200)) @@ -401,14 +401,14 @@ This commonly includes things such as: (set! (-> s4-1 period) (the-as uint s3-1)) ) (set! (-> s4-1 percent) 0.0) - (initialize! (-> obj sync) s4-1) + (initialize! (-> this sync) s4-1) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (if (logtest? (actor-option user17) (-> obj fact options)) - (go (method-of-object obj dormant)) - (go (method-of-object obj idle)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logclear! (-> this mask) (process-mask actor-pause)) + (if (logtest? (actor-option user17) (-> this fact options)) + (go (method-of-object this dormant)) + (go (method-of-object this idle)) ) (none) ) @@ -423,17 +423,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-conveyor -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect fort-conveyor ((obj fort-conveyor)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-conveyor ((this fort-conveyor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type conveyor inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -443,18 +442,16 @@ This commonly includes things such as: ) ;; definition for method 22 of type fort-conveyor -;; INFO: this function exists in multiple non-identical object files -(defmethod get-art-group fort-conveyor ((obj fort-conveyor)) +(defmethod get-art-group fort-conveyor ((this fort-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) ) ;; definition for method 23 of type fort-conveyor -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! fort-conveyor ((obj fort-conveyor)) +(defmethod reset-root! fort-conveyor ((this fort-conveyor)) "Re-initializes the `root` [[trsqv]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -476,43 +473,41 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) (set! (-> s5-0 rider-max-momentum) 8192.0) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; definition for method 24 of type fort-conveyor -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch vector vs none. -(defmethod init! fort-conveyor ((obj fort-conveyor)) +(defmethod init! fort-conveyor ((this fort-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj belt-radius) 24576.0) - (set! (-> obj pull-y-threshold) 16384.0) + (set! (-> this belt-radius) 24576.0) + (set! (-> this pull-y-threshold) 16384.0) (cond - ((name= (-> obj name) "fort-conveyor-2") - (set! (-> obj speed) -21299.2) - (set-vector! (-> obj root scale) 1.0 1.0 0.9 1.0) + ((name= (-> this name) "fort-conveyor-2") + (set! (-> this speed) -21299.2) + (set-vector! (-> this root scale) 1.0 1.0 0.9 1.0) ) - ((name= (-> obj name) "fort-conveyor-3") - (set! (-> obj speed) -18432.0) - (set-vector! (-> obj root scale) 1.0 1.0 0.79 1.0) + ((name= (-> this name) "fort-conveyor-3") + (set! (-> this speed) -18432.0) + (set-vector! (-> this root scale) 1.0 1.0 0.79 1.0) ) ) (none) ) ;; definition for method 25 of type fort-conveyor -;; INFO: this function exists in multiple non-identical object files -(defmethod set-and-get-ambient-sound! fort-conveyor ((obj fort-conveyor)) +(defmethod set-and-get-ambient-sound! fort-conveyor ((this fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" - (let* ((s5-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp)) - (v1-2 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 1.0 'interp)) + (let* ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-2 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 1.0 'interp)) (a3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 v1-2)) ) (vector-float*! a3-3 a3-3 0.5) (let ((v0-2 (new 'process 'ambient-sound (static-sound-spec "fort-conveyor" :fo-max 50) a3-3))) - (set! (-> obj sound) v0-2) + (set! (-> this sound) v0-2) v0-2 ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-part_REF.gc index 4f6a82d304..38da8d57df 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type fordumpb-part -(defmethod inspect fordumpb-part ((obj fordumpb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect fordumpb-part ((this fordumpb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 f3ff340c98..adfbe21519 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 @@ -3,43 +3,43 @@ ;; definition for method 15 of type hud-rocketsensor ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-rocketsensor ((obj hud-rocketsensor)) +(defmethod draw hud-rocketsensor ((this hud-rocketsensor)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 210 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -17 25) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -17 25) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-rocketsensor ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-rocketsensor ((obj hud-rocketsensor)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-rocketsensor ((this hud-rocketsensor)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-rocketsensor ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-rocketsensor ((obj hud-rocketsensor)) - (set! (-> obj level) (level-get *level* 'fordumpc)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-rocketsensor ((this hud-rocketsensor)) + (set! (-> this level) (level-get *level* 'fordumpc)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1f))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.2) - (set! (-> obj sprites 0 scale-y) 1.2) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb1f))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -59,16 +59,16 @@ ) ;; definition for method 3 of type fort-dump-bomb-a -(defmethod inspect fort-dump-bomb-a ((obj fort-dump-bomb-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-dump-bomb-a ((this fort-dump-bomb-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -155,7 +155,7 @@ ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 0.5)) + (until (time-elapsed? gp-2 (seconds 0.5)) (suspend) ) ) @@ -165,14 +165,14 @@ ;; definition for method 11 of type fort-dump-bomb-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-dump-bomb-a ((obj fort-dump-bomb-a) (arg0 entity-actor)) +(defmethod init-from-entity! fort-dump-bomb-a ((this fort-dump-bomb-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec bot)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -187,22 +187,22 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-dump-bomb-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 573) obj)) - (let ((a0-13 (-> obj skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 573) this)) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -223,18 +223,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-missile-target -(defmethod inspect fort-missile-target ((obj fort-missile-target)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-missile-target ((this fort-missile-target)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpart-mat[2] @ #x~X~%" (-> obj part-mat)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tpart-mat[2] @ #x~X~%" (-> this part-mat)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -401,7 +401,7 @@ This commonly includes things such as: ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 1)) + (until (time-elapsed? gp-3 (seconds 1)) (suspend) ) ) @@ -416,9 +416,9 @@ This commonly includes things such as: ) ;; definition for method 10 of type fort-missile-target -(defmethod deactivate fort-missile-target ((obj fort-missile-target)) - (sound-stop (the-as sound-id (-> obj sound-id))) - ((the-as (function process-drawable none) (find-parent-method fort-missile-target 10)) obj) +(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) (none) ) @@ -518,25 +518,25 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-missile -(defmethod inspect fort-missile ((obj fort-missile)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-missile ((this fort-missile)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpart-doom: ~A~%" (-> obj part-doom)) - (format #t "~2Thud: ~D~%" (-> obj hud)) - (format #t "~2Tdoor-actor[2] @ #x~X~%" (-> obj door-actor)) - (format #t "~2Ttank-actor: ~A~%" (-> obj tank-actor)) - (format #t "~2Tbomb[4] @ #x~X~%" (-> obj bomb)) - (format #t "~2Tbomb-count: ~D~%" (-> obj bomb-count)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Texplosion-sound-id: ~D~%" (-> obj explosion-sound-id)) - (format #t "~2Talarm-sound-id: ~D~%" (-> obj alarm-sound-id)) + (format #t "~2Tpart-doom: ~A~%" (-> this part-doom)) + (format #t "~2Thud: ~D~%" (-> this hud)) + (format #t "~2Tdoor-actor[2] @ #x~X~%" (-> this door-actor)) + (format #t "~2Ttank-actor: ~A~%" (-> this tank-actor)) + (format #t "~2Tbomb[4] @ #x~X~%" (-> this bomb)) + (format #t "~2Tbomb-count: ~D~%" (-> this bomb-count)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Texplosion-sound-id: ~D~%" (-> this explosion-sound-id)) + (format #t "~2Talarm-sound-id: ~D~%" (-> this alarm-sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -599,7 +599,7 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 8)) + (until (time-elapsed? gp-0 (seconds 8)) (suspend) ) ) @@ -608,14 +608,14 @@ This commonly includes things such as: ) (when (= (-> self bomb-count) 4) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.4)) + (until (time-elapsed? gp-1 (seconds 0.4)) (suspend) ) ) (add-process *gui-control* self (gui-channel daxter) (gui-action play) "ds017" -99.0 0) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 20)) + (until (time-elapsed? gp-2 (seconds 20)) (suspend) ) ) @@ -624,13 +624,13 @@ This commonly includes things such as: ) (while (> (-> self bomb-count) 0) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 0.2)) + (until (time-elapsed? gp-3 (seconds 0.2)) (suspend) ) ) ) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.8)) + (until (time-elapsed? gp-4 (seconds 0.8)) (suspend) ) ) @@ -678,7 +678,7 @@ This commonly includes things such as: ) (set-fordumpc-light-flag! #t) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.2)) + (until (time-elapsed? gp-0 (seconds 0.2)) (suspend) ) ) @@ -689,7 +689,7 @@ This commonly includes things such as: (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (task-node-close! (game-task-node fortress-dump-missile)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.75)) + (until (time-elapsed? gp-1 (seconds 0.75)) (suspend) ) ) @@ -724,7 +724,7 @@ This commonly includes things such as: ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 1.5)) + (until (time-elapsed? gp-2 (seconds 1.5)) (suspend) ) ) @@ -751,7 +751,7 @@ This commonly includes things such as: (set! (-> self hud) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) ) (let ((gp-4 (current-time))) - (until (>= (- (current-time) gp-4) (seconds 0.4)) + (until (time-elapsed? gp-4 (seconds 0.4)) (suspend) ) ) @@ -761,7 +761,7 @@ This commonly includes things such as: (dotimes (gp-5 10) (set! (-> *game-info* timer) (the-as time-frame (- 3000 (the int (* 300.0 (the float gp-5)))))) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) (seconds 1)) + (until (time-elapsed? s5-0 (seconds 1)) (suspend) ) ) @@ -802,7 +802,7 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.4)) + (until (time-elapsed? gp-0 (seconds 0.4)) (suspend) ) ) @@ -958,13 +958,13 @@ This commonly includes things such as: (set! (-> s5-3 trans w) 1.0) (spawn-with-matrix (-> self part-doom) s5-3) ) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) ) (let ((gp-5 (current-time))) - (until (>= (- (current-time) gp-5) (seconds 10)) + (until (time-elapsed? gp-5 (seconds 10)) (suspend) ) ) @@ -979,40 +979,40 @@ This commonly includes things such as: ) ;; definition for method 10 of type fort-missile -(defmethod deactivate fort-missile ((obj fort-missile)) +(defmethod deactivate fort-missile ((this fort-missile)) (set-fordumpc-light-flag! #f) - (send-event (handle->process (-> obj hud)) 'hide-and-die) - (if (nonzero? (-> obj part-doom)) - (kill-and-free-particles (-> obj part-doom)) + (send-event (handle->process (-> this hud)) 'hide-and-die) + (if (nonzero? (-> this part-doom)) + (kill-and-free-particles (-> this part-doom)) ) - (sound-stop (-> obj alarm-sound-id)) - ((method-of-type process-drawable deactivate) obj) + (sound-stop (-> this alarm-sound-id)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type fort-missile ;; WARN: Return type mismatch process-drawable vs fort-missile. -(defmethod relocate fort-missile ((obj fort-missile) (arg0 int)) - (if (nonzero? (-> obj part-doom)) - (&+! (-> obj part-doom) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method fort-missile 7)) this arg0) ) ) ;; definition for method 11 of type fort-missile ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-missile ((obj fort-missile) (arg0 entity-actor)) +(defmethod init-from-entity! fort-missile ((this fort-missile) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) @@ -1039,17 +1039,17 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-missile" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj door-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj door-actor 1) (entity-actor-lookup arg0 'alt-actor 1)) - (set! (-> obj tank-actor) (entity-actor-lookup arg0 'alt-actor 2)) + (set! (-> this door-actor 0) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this door-actor 1) (entity-actor-lookup arg0 'alt-actor 1)) + (set! (-> this tank-actor) (entity-actor-lookup arg0 'alt-actor 2)) (let ((s5-1 (new 'stack-no-clear 'vector))) (set! (-> s5-1 x) 0.0) (set! (-> s5-1 y) -36864.0) @@ -1057,27 +1057,27 @@ This commonly includes things such as: (set! (-> s5-1 w) 1.0) (let ((s4-2 (new 'stack-no-clear 'vector))) (dotimes (s3-2 4) - (let ((s2-1 (vector+! (new 'stack-no-clear 'vector) (-> obj root trans) s5-1)) + (let ((s2-1 (vector+! (new 'stack-no-clear 'vector) (-> this root trans) s5-1)) (s1-0 (new 'stack-no-clear 'vector)) ) - (vector-normalize! (vector-! s4-2 s2-1 (-> obj root trans)) 1.0) + (vector-normalize! (vector-! s4-2 s2-1 (-> this root trans)) 1.0) (vector-float*! s1-0 s4-2 -1.0) - (set! (-> obj bomb s3-2) (ppointer->handle (process-spawn fort-missile-target s2-1 s1-0 :to obj))) + (set! (-> this bomb s3-2) (ppointer->handle (process-spawn fort-missile-target s2-1 s1-0 :to this))) ) (vector-rotate-y! s5-1 s5-1 16384.0) ) ) ) - (set! (-> obj bomb-count) (the-as uint 4)) - (set! (-> obj hud) (the-as handle #f)) - (set! (-> obj part-doom) (create-launch-control (-> *part-group-id-table* 583) obj)) - (set! (-> obj alarm-sound-id) (new-sound-id)) - (let ((a0-36 (-> obj skel root-channel 0))) - (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> this bomb-count) (the-as uint 4)) + (set! (-> this hud) (the-as handle #f)) + (set! (-> this part-doom) (create-launch-control (-> *part-group-id-table* 583) this)) + (set! (-> this alarm-sound-id) (new-sound-id)) + (let ((a0-36 (-> this skel root-channel 0))) + (set! (-> a0-36 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-36 frame-num) 0.0) - (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-36 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-part_REF.gc index d32bb4ac1b..a87ef3de38 100644 --- a/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/dump/fordumpc-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type fordumpc-part -(defmethod inspect fordumpc-part ((obj fordumpc-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect fordumpc-part ((this fordumpc-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 52aff854c3..d14e62ac2e 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 @@ -47,40 +47,40 @@ ) ;; definition for method 3 of type fort-robotank-turret -(defmethod inspect fort-robotank-turret ((obj fort-robotank-turret)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-robotank-turret ((this fort-robotank-turret)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlos: #~%" (-> obj los)) - (format #t "~2Treticle: ~D~%" (-> obj reticle)) - (format #t "~2Tscreen: ~D~%" (-> obj screen)) - (format #t "~2Ttank-quat: #~%" (-> obj tank-quat)) - (format #t "~2Ttank-quat-vibe-only: #~%" (-> obj tank-quat-vibe-only)) - (format #t "~2Trotate-quat: #~%" (-> obj rotate-quat)) - (format #t "~2Trotate-rate: ~f~%" (-> obj rotate-rate)) - (format #t "~2Trotate-mult: ~f~%" (-> obj rotate-mult)) - (format #t "~2Tshot-range: ~f~%" (-> obj shot-range)) - (format #t "~2Tfov-mult: ~f~%" (-> obj fov-mult)) - (format #t "~2Toffset: #~%" (-> obj offset)) - (format #t "~2Tsight-pos: #~%" (-> obj sight-pos)) - (format #t "~2Tfiring-sight-pos: #~%" (-> obj firing-sight-pos)) - (format #t "~2Taim-pos[3] @ #x~X~%" (-> obj aim-pos)) - (format #t "~2Tgun-timer: ~D~%" (-> obj gun-timer)) - (format #t "~2Tgun-elev-jmod: ~A~%" (-> obj gun-elev-jmod)) - (format #t "~2Tgun-elev: ~f~%" (-> obj gun-elev)) - (format #t "~2Tgun-elev-cam: ~f~%" (-> obj gun-elev-cam)) - (format #t "~2Tgun-joint-l[2] @ #x~X~%" (-> obj gun-joint-l)) - (format #t "~2Tgun-joint-r[2] @ #x~X~%" (-> obj gun-joint-r)) - (format #t "~2Tgun-spread: ~f~%" (-> obj gun-spread)) - (format #t "~2Tgun-index: ~D~%" (-> obj gun-index)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tturn-sound-id: ~D~%" (-> obj turn-sound-id)) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Treticle: ~D~%" (-> this reticle)) + (format #t "~2Tscreen: ~D~%" (-> this screen)) + (format #t "~2Ttank-quat: #~%" (-> this tank-quat)) + (format #t "~2Ttank-quat-vibe-only: #~%" (-> this tank-quat-vibe-only)) + (format #t "~2Trotate-quat: #~%" (-> this rotate-quat)) + (format #t "~2Trotate-rate: ~f~%" (-> this rotate-rate)) + (format #t "~2Trotate-mult: ~f~%" (-> this rotate-mult)) + (format #t "~2Tshot-range: ~f~%" (-> this shot-range)) + (format #t "~2Tfov-mult: ~f~%" (-> this fov-mult)) + (format #t "~2Toffset: #~%" (-> this offset)) + (format #t "~2Tsight-pos: #~%" (-> this sight-pos)) + (format #t "~2Tfiring-sight-pos: #~%" (-> this firing-sight-pos)) + (format #t "~2Taim-pos[3] @ #x~X~%" (-> this aim-pos)) + (format #t "~2Tgun-timer: ~D~%" (-> this gun-timer)) + (format #t "~2Tgun-elev-jmod: ~A~%" (-> this gun-elev-jmod)) + (format #t "~2Tgun-elev: ~f~%" (-> this gun-elev)) + (format #t "~2Tgun-elev-cam: ~f~%" (-> this gun-elev-cam)) + (format #t "~2Tgun-joint-l[2] @ #x~X~%" (-> this gun-joint-l)) + (format #t "~2Tgun-joint-r[2] @ #x~X~%" (-> this gun-joint-r)) + (format #t "~2Tgun-spread: ~f~%" (-> this gun-spread)) + (format #t "~2Tgun-index: ~D~%" (-> this gun-index)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tturn-sound-id: ~D~%" (-> this turn-sound-id)) (label cfg-4) - obj + this ) ;; definition of type fort-robotank-reticle @@ -103,22 +103,22 @@ ) ;; definition for method 3 of type fort-robotank-reticle -(defmethod inspect fort-robotank-reticle ((obj fort-robotank-reticle)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-robotank-reticle ((this fort-robotank-reticle)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tshadow-jmod: ~A~%" (-> obj shadow-jmod)) - (format #t "~2Tsight-jmod: ~A~%" (-> obj sight-jmod)) - (format #t "~2Tring-jmod[3] @ #x~X~%" (-> obj ring-jmod)) - (format #t "~2Tring-timer: ~D~%" (-> obj ring-timer)) - (format #t "~2Tsight-scale: #~%" (-> obj sight-scale)) - (format #t "~2Tcollide-dist: ~f~%" (-> obj collide-dist)) + (format #t "~2Tshadow-jmod: ~A~%" (-> this shadow-jmod)) + (format #t "~2Tsight-jmod: ~A~%" (-> this sight-jmod)) + (format #t "~2Tring-jmod[3] @ #x~X~%" (-> this ring-jmod)) + (format #t "~2Tring-timer: ~D~%" (-> this ring-timer)) + (format #t "~2Tsight-scale: #~%" (-> this sight-scale)) + (format #t "~2Tcollide-dist: ~f~%" (-> this collide-dist)) (label cfg-4) - obj + this ) ;; definition of type fort-roboscreen @@ -142,20 +142,20 @@ ) ;; definition for method 3 of type fort-roboscreen -(defmethod inspect fort-roboscreen ((obj fort-roboscreen)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-roboscreen ((this fort-roboscreen)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim-frame: ~f~%" (-> obj anim-frame)) - (format #t "~2Ttransition: ~f~%" (-> obj transition)) - (format #t "~2Tgui-id-1: ~D~%" (-> obj gui-id-1)) - (format #t "~2Tgui-id-2: ~D~%" (-> obj gui-id-2)) + (format #t "~2Tanim-frame: ~f~%" (-> this anim-frame)) + (format #t "~2Ttransition: ~f~%" (-> this transition)) + (format #t "~2Tgui-id-1: ~D~%" (-> this gui-id-1)) + (format #t "~2Tgui-id-2: ~D~%" (-> this gui-id-2)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -170,7 +170,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('trigger) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (go-virtual active) ) (('die) @@ -245,7 +245,7 @@ ) :code (behavior () (until #f - (when (and (not (paused?)) (>= (- (current-time) (-> self state-time)) (seconds 1))) + (when (and (not (paused?)) (time-elapsed? (-> self state-time) (seconds 1))) (seek! (-> self anim-frame) 0.0 (* 0.2 (-> self clock time-adjust-ratio))) (seek! (-> self transition) 1.0 (* 0.01 (-> self clock time-adjust-ratio))) ) @@ -298,7 +298,7 @@ :virtual #t :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (seek! (-> self transition) 0.0 (seconds-per-frame)) (set-roboscreen-alpha! (-> self transition)) (suspend) @@ -310,7 +310,7 @@ ;; definition for method 24 of type fort-roboscreen ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod fort-roboscreen-method-24 fort-roboscreen ((obj fort-roboscreen)) +(defmethod fort-roboscreen-method-24 fort-roboscreen ((this fort-roboscreen)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -325,12 +325,12 @@ (f30-0 4096.0) ) (let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) - (set-vector! (-> obj root scale) f0-4 f0-4 f0-4 1.0) + (set-vector! (-> this root scale) f0-4 f0-4 f0-4 1.0) ) (set! (-> gp-0 quad) (-> (camera-pos) quad)) (vector-normalize-copy! s5-0 (-> s3-0 vector 2) 1.0) - (matrix->quaternion (-> obj root quat) s3-0) - (let ((v1-10 (-> obj root trans))) + (matrix->quaternion (-> this root quat) s3-0) + (let ((v1-10 (-> this root trans))) (let ((a0-5 f30-0)) (.mov vf7 a0-5) ) @@ -377,10 +377,10 @@ ) ;; definition for method 10 of type fort-roboscreen -(defmethod deactivate fort-roboscreen ((obj fort-roboscreen)) +(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)) obj) + ((the-as (function process-drawable none) (find-parent-method fort-roboscreen 10)) this) (none) ) @@ -610,19 +610,19 @@ ;; definition for method 7 of type fort-robotank-reticle ;; WARN: Return type mismatch process-drawable vs fort-robotank-reticle. -(defmethod relocate fort-robotank-reticle ((obj fort-robotank-reticle) (arg0 int)) - (if (nonzero? (-> obj shadow-jmod)) - (&+! (-> obj shadow-jmod) arg0) +(defmethod relocate fort-robotank-reticle ((this fort-robotank-reticle) (arg0 int)) + (if (nonzero? (-> this shadow-jmod)) + (&+! (-> this shadow-jmod) arg0) ) - (if (nonzero? (-> obj sight-jmod)) - (&+! (-> obj sight-jmod) arg0) + (if (nonzero? (-> this sight-jmod)) + (&+! (-> this sight-jmod) arg0) ) (dotimes (v1-8 3) - (if (nonzero? (-> obj ring-jmod v1-8)) - (&+! (-> obj ring-jmod v1-8) arg0) + (if (nonzero? (-> this ring-jmod v1-8)) + (&+! (-> this ring-jmod v1-8) arg0) ) ) - (the-as fort-robotank-reticle ((method-of-type process-drawable relocate) obj arg0)) + (the-as fort-robotank-reticle ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for function fort-robotank-reticle-init-by-other @@ -680,21 +680,21 @@ ) ;; definition for method 3 of type fort-robotank-shot -(defmethod inspect fort-robotank-shot ((obj fort-robotank-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-robotank-shot ((this fort-robotank-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type guard-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 28 of type fort-robotank-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound fort-robotank-shot ((obj fort-robotank-shot) (arg0 projectile-options)) +(defmethod play-impact-sound fort-robotank-shot ((this fort-robotank-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -711,9 +711,9 @@ ;; definition for method 30 of type fort-robotank-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! fort-robotank-shot ((obj fort-robotank-shot)) +(defmethod init-proj-collision! fort-robotank-shot ((this fort-robotank-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -753,9 +753,9 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 @@ -765,16 +765,16 @@ ;; definition for method 31 of type fort-robotank-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! fort-robotank-shot ((obj fort-robotank-shot)) +(defmethod init-proj-settings! fort-robotank-shot ((this fort-robotank-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'fort-robotank-shot) - (set! (-> obj max-speed) 819200.0) - (set! (-> obj move) guard-shot-move) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj timeout) (seconds 0.5)) - (logior! (-> obj options) (projectile-options account-for-target-velocity)) - (set-gravity-length (-> obj root dynam) 573440.0) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'fort-robotank-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) guard-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (logior! (-> this options) (projectile-options account-for-target-velocity)) + (set-gravity-length (-> this root dynam) 573440.0) 0 (none) ) @@ -973,18 +973,18 @@ ;; definition for method 32 of type fort-robotank-turret ;; INFO: Used lq/sq -(defmethod fort-robotank-turret-method-32 fort-robotank-turret ((obj fort-robotank-turret) (arg0 (inline-array vector))) +(defmethod fort-robotank-turret-method-32 fort-robotank-turret ((this fort-robotank-turret) (arg0 (inline-array vector))) (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((v1-0 (-> arg0 0)) (a0-1 (-> arg0 1)) ) - (set! (-> gp-0 ent) (-> obj entity)) + (set! (-> gp-0 ent) (-> this entity)) (set! (-> gp-0 charge) 1.0) (set! (-> gp-0 options) (projectile-options)) (set! (-> gp-0 pos quad) (-> v1-0 quad)) - (set! (-> gp-0 notify-handle) (process->handle obj)) + (set! (-> gp-0 notify-handle) (process->handle this)) (set! (-> gp-0 owner-handle) (the-as handle #f)) - (set! (-> gp-0 ignore-handle) (process->handle obj)) + (set! (-> gp-0 ignore-handle) (process->handle this)) (let* ((a1-10 *game-info*) (a2-11 (+ (-> a1-10 attack-id) 1)) ) @@ -995,30 +995,30 @@ (vector-! (-> gp-0 vel) a0-1 v1-0) ) (vector-normalize! (-> gp-0 vel) 512000.0) - (spawn-projectile fort-robotank-shot gp-0 obj *default-dead-pool*) + (spawn-projectile fort-robotank-shot gp-0 this *default-dead-pool*) ) ) ;; definition for method 33 of type fort-robotank-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fort-robotank-turret-method-33 fort-robotank-turret ((obj fort-robotank-turret)) +(defmethod fort-robotank-turret-method-33 fort-robotank-turret ((this fort-robotank-turret)) (local-vars (sv-144 vector) (sv-160 vector)) (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 2)) (s5-0 (new 'stack-no-clear 'inline-array 'vector 4)) ) - (-> obj node-list data 11) + (-> this node-list data 11) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s1-0 (-> obj sight-pos)) - (s2-0 (-> obj gun-index)) + (s1-0 (-> this sight-pos)) + (s2-0 (-> this gun-index)) ) 0.0 0.0 - (vector<-cspace! (-> s3-0 0) (-> obj node-list data (-> obj gun-joint-l s2-0))) - (vector<-cspace! (-> s3-0 1) (-> obj node-list data (-> obj gun-joint-r s2-0))) + (vector<-cspace! (-> s3-0 0) (-> this node-list data (-> this gun-joint-l s2-0))) + (vector<-cspace! (-> s3-0 1) (-> this node-list data (-> this gun-joint-r s2-0))) (let ((f30-0 (* 0.5 (vector-length (vector-! (new 'stack-no-clear 'vector) (-> s3-0 1) (-> s3-0 0)))))) (let ((f28-0 (fmax 81920.0 (+ 12288.0 (vector-length (vector-! (new 'stack-no-clear 'vector) s1-0 (-> s3-0 0))))))) - (vector-normalize-copy! s4-0 (-> obj node-list data (-> obj gun-joint-l s2-0) bone transform vector 2) 1.0) + (vector-normalize-copy! s4-0 (-> this node-list data (-> this gun-joint-l s2-0) bone transform vector 2) 1.0) (let ((s0-0 vector-rotate-y!)) (set! sv-144 s4-0) (set! sv-160 s4-0) @@ -1028,19 +1028,19 @@ ) (set! (-> s5-0 0 quad) (-> s3-0 0 quad)) (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) - (set! (-> obj shot-range) (fmin 204800.0 f28-0)) + (set! (-> this shot-range) (fmin 204800.0 f28-0)) ) - (fort-robotank-turret-method-32 obj s5-0) + (fort-robotank-turret-method-32 this s5-0) (let ((f28-1 (fmax 81920.0 (+ 12288.0 (vector-length (vector-! (new 'stack-no-clear 'vector) s1-0 (-> s3-0 1))))))) - (vector-normalize-copy! s4-0 (-> obj node-list data (-> obj gun-joint-r s2-0) bone transform vector 2) 1.0) + (vector-normalize-copy! s4-0 (-> this node-list data (-> this gun-joint-r s2-0) bone transform vector 2) 1.0) (vector-rotate-y! s4-0 s4-0 (- (- 16384.0 (acos (/ f30-0 f28-1))))) (set! (-> s5-0 0 quad) (-> s3-0 1 quad)) (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) - (set! (-> obj shot-range) (fmin 204800.0 f28-1)) + (set! (-> this shot-range) (fmin 204800.0 f28-1)) ) ) ) - (fort-robotank-turret-method-32 obj s5-0) + (fort-robotank-turret-method-32 this s5-0) ) (none) ) @@ -1048,7 +1048,7 @@ ;; definition for method 31 of type fort-robotank-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod fort-robotank-turret-method-31 fort-robotank-turret ((obj fort-robotank-turret) (arg0 vector) (arg1 vector)) +(defmethod fort-robotank-turret-method-31 fort-robotank-turret ((this fort-robotank-turret) (arg0 vector) (arg1 vector)) (let ((s3-0 (new 'stack-no-clear 'collide-query)) (f30-0 307200.0) ) @@ -1057,13 +1057,13 @@ (let ((v1-4 s3-0)) (set! (-> v1-4 radius) 4096.0) (set! (-> v1-4 collide-with) (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list)) - (set! (-> v1-4 ignore-process0) (ppointer->process (-> obj parent))) - (set! (-> v1-4 ignore-process1) obj) + (set! (-> v1-4 ignore-process0) (ppointer->process (-> this parent))) + (set! (-> v1-4 ignore-process1) this) (set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-4 action-mask) (collide-action solid semi-solid)) ) (let ((f28-0 (fill-and-probe-using-line-sphere *collide-cache* s3-0)) - (s4-0 (-> obj sight-pos)) + (s4-0 (-> this sight-pos)) ) (cond ((>= f28-0 0.0) @@ -1098,18 +1098,18 @@ (vector+! s4-0 (-> s3-0 start-pos) (-> s3-0 move-dist)) ) ) - (send-event (handle->process (-> obj reticle)) 'update arg0 s4-0) + (send-event (handle->process (-> this reticle)) 'update arg0 s4-0) ) - (send-event (handle->process (-> obj reticle)) 'collide-dist f30-0) + (send-event (handle->process (-> this reticle)) 'collide-dist f30-0) ) (none) ) ;; definition for method 20 of type fort-robotank-turret ;; WARN: Return type mismatch collide-prim-core vs vector. -(defmethod get-trans fort-robotank-turret ((obj fort-robotank-turret) (arg0 int)) +(defmethod get-trans fort-robotank-turret ((this fort-robotank-turret) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (the-as vector (-> obj root root-prim prim-core)) + (the-as vector (-> this root root-prim prim-core)) ) ;; definition for function turret-post @@ -1363,9 +1363,9 @@ ;; definition for method 34 of type fort-robotank-turret ;; INFO: Used lq/sq -(defmethod fort-robotank-turret-method-34 fort-robotank-turret ((obj fort-robotank-turret) (arg0 vector) (arg1 float)) - (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj root trans))) - (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) +(defmethod fort-robotank-turret-method-34 fort-robotank-turret ((this fort-robotank-turret) (arg0 vector) (arg1 float)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> s5-0 quad) (-> s4-1 quad)) @@ -1390,18 +1390,18 @@ :virtual #t :event robotank-turret-handler :enter (behavior () - (set! (-> self gun-timer) (current-time)) + (set-time! (-> self gun-timer)) ) :trans (behavior () (if (logtest? (-> self flags) (robotank-turret-flags rotflags-4)) - (set! (-> self gun-timer) (current-time)) + (set-time! (-> self gun-timer)) ) (let ((gp-0 *target*)) (if (and (if (type? gp-0 process-focusable) gp-0 ) (or (not (logtest? (-> self flags) (robotank-turret-flags rotflags-9))) (check-los? (-> self los) 0)) - (>= (- (current-time) (-> self gun-timer)) (seconds 1)) + (time-elapsed? (-> self gun-timer) (seconds 1)) ) (go-virtual fire) ) @@ -1465,7 +1465,7 @@ (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) (send-event (handle->process (-> self reticle)) 'lock) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.5)) + (until (time-elapsed? gp-0 (seconds 0.5)) (suspend) ) ) @@ -1497,7 +1497,7 @@ (let ((f30-0 (rand-vu-float-range 0.05 0.43)) (s4-2 (current-time)) ) - (until (>= (- (current-time) s4-2) (the int (* 300.0 f30-0))) + (until (time-elapsed? s4-2 (the int (* 300.0 f30-0))) (suspend) ) ) @@ -1519,7 +1519,7 @@ ) (gp-3 (current-time)) ) - (until (>= (- (current-time) gp-3) (the int (* 300.0 f30-1))) + (until (time-elapsed? gp-3 (the int (* 300.0 f30-1))) (suspend) ) ) @@ -1536,7 +1536,7 @@ (send-event (handle->process (-> self reticle)) 'die) (send-event (handle->process (-> self screen)) 'die) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -1547,25 +1547,25 @@ ) ;; definition for method 10 of type fort-robotank-turret -(defmethod deactivate fort-robotank-turret ((obj fort-robotank-turret)) - (logclear! (-> obj flags) (robotank-turret-flags rotflags-6)) - (sound-stop (-> obj turn-sound-id)) - (let ((a0-4 (handle->process (-> obj screen)))) +(defmethod deactivate fort-robotank-turret ((this fort-robotank-turret)) + (logclear! (-> this flags) (robotank-turret-flags rotflags-6)) + (sound-stop (-> this turn-sound-id)) + (let ((a0-4 (handle->process (-> this screen)))) (if a0-4 (deactivate a0-4) ) ) - ((method-of-type process-focusable deactivate) obj) + ((method-of-type process-focusable deactivate) this) (none) ) ;; definition for method 7 of type fort-robotank-turret ;; WARN: Return type mismatch process-focusable vs fort-robotank-turret. -(defmethod relocate fort-robotank-turret ((obj fort-robotank-turret) (arg0 int)) - (if (nonzero? (-> obj gun-elev-jmod)) - (&+! (-> obj gun-elev-jmod) arg0) +(defmethod relocate fort-robotank-turret ((this fort-robotank-turret) (arg0 int)) + (if (nonzero? (-> this gun-elev-jmod)) + (&+! (-> this gun-elev-jmod) arg0) ) - (the-as fort-robotank-turret ((method-of-type process-focusable relocate) obj arg0)) + (the-as fort-robotank-turret ((method-of-type process-focusable relocate) this arg0)) ) ;; definition for function fort-robotank-turret-init-by-other @@ -1646,7 +1646,7 @@ (set! (-> self aim-pos 0 quad) (-> self root trans quad)) (set! (-> self aim-pos-2 quad) (-> self root trans quad)) (set! (-> self aim-pos-1 quad) (-> self root trans quad)) - (set! (-> self gun-timer) (current-time)) + (set-time! (-> self gun-timer)) (set! (-> self flags) (robotank-turret-flags)) (set! (-> self fov-mult) 1.0) (set! (-> self shot-range) 204800.0) 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 e5beed4f95..51f2c99644 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 @@ -60,19 +60,19 @@ ) ;; definition for method 3 of type fort-robotank-segment-event -(defmethod inspect fort-robotank-segment-event ((obj fort-robotank-segment-event)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-robotank-segment-event ((this fort-robotank-segment-event)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fort-robotank-segment-event) - (format #t "~1Tsource: ~D~%" (-> obj source)) - (format #t "~1Tevent-type: ~A~%" (-> obj event-type)) - (format #t "~1Tactor: ~A~%" (-> obj actor)) - (format #t "~1Tpos-norm: ~f~%" (-> obj pos-norm)) - (format #t "~1Tparam: ~A~%" (-> obj param-obj)) + (format #t "[~8x] ~A~%" this 'fort-robotank-segment-event) + (format #t "~1Tsource: ~D~%" (-> this source)) + (format #t "~1Tevent-type: ~A~%" (-> this event-type)) + (format #t "~1Tactor: ~A~%" (-> this actor)) + (format #t "~1Tpos-norm: ~f~%" (-> this pos-norm)) + (format #t "~1Tparam: ~A~%" (-> this param-obj)) (label cfg-4) - obj + this ) ;; definition of type fort-robotank-segment @@ -90,20 +90,20 @@ ) ;; definition for method 3 of type fort-robotank-segment -(defmethod inspect fort-robotank-segment ((obj fort-robotank-segment)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-robotank-segment ((this fort-robotank-segment)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fort-robotank-segment) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tmax-speed: ~f~%" (-> obj max-speed)) - (format #t "~1Tnext-segment: ~D~%" (-> obj next-segment)) - (format #t "~1Tnext-segment-start: ~f~%" (-> obj next-segment-start)) - (format #t "~1Tevent-count: ~D~%" (-> obj event-count)) - (format #t "~1Tevent-tbl: #x~X~%" (-> obj event-tbl)) + (format #t "[~8x] ~A~%" this 'fort-robotank-segment) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~1Tnext-segment: ~D~%" (-> this next-segment)) + (format #t "~1Tnext-segment-start: ~f~%" (-> this next-segment-start)) + (format #t "~1Tevent-count: ~D~%" (-> this event-count)) + (format #t "~1Tevent-tbl: #x~X~%" (-> this event-tbl)) (label cfg-4) - obj + this ) ;; definition of type fort-robotank-path-info @@ -125,24 +125,24 @@ ) ;; definition for method 3 of type fort-robotank-path-info -(defmethod inspect fort-robotank-path-info ((obj fort-robotank-path-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-robotank-path-info ((this fort-robotank-path-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fort-robotank-path-info) - (format #t "~1Tpath: ~A~%" (-> obj path)) - (format #t "~1Tdir: #~%" (-> obj dir)) - (format #t "~1Tu: ~f~%" (-> obj u)) - (format #t "~1Tdu: ~f~%" (-> obj du)) - (format #t "~1Tdu-final: ~f~%" (-> obj du-final)) - (format #t "~1Tprev-u: ~f~%" (-> obj prev-u)) - (format #t "~1Tmax-speed: ~f~%" (-> obj max-speed)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) - (format #t "~1Tdir-y-angle: ~f~%" (-> obj dir-y-angle)) - (format #t "~1Tstart-y-angle: ~f~%" (-> obj start-y-angle)) + (format #t "[~8x] ~A~%" this 'fort-robotank-path-info) + (format #t "~1Tpath: ~A~%" (-> this path)) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Tu: ~f~%" (-> this u)) + (format #t "~1Tdu: ~f~%" (-> this du)) + (format #t "~1Tdu-final: ~f~%" (-> this du-final)) + (format #t "~1Tprev-u: ~f~%" (-> this prev-u)) + (format #t "~1Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tdir-y-angle: ~f~%" (-> this dir-y-angle)) + (format #t "~1Tstart-y-angle: ~f~%" (-> this start-y-angle)) (label cfg-4) - obj + this ) ;; definition of type fort-robotank-path-info-array @@ -155,17 +155,17 @@ ) ;; definition for method 3 of type fort-robotank-path-info-array -(defmethod inspect fort-robotank-path-info-array ((obj fort-robotank-path-info-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-robotank-path-info-array ((this fort-robotank-path-info-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tlength: ~D~%" (-> obj length)) - (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) - (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tlength: ~D~%" (-> this length)) + (format #t "~1Tallocated-length: ~D~%" (-> this allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -182,16 +182,16 @@ ) ;; definition for method 3 of type fort-robotank-wheel-info -(defmethod inspect fort-robotank-wheel-info ((obj fort-robotank-wheel-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-robotank-wheel-info ((this fort-robotank-wheel-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fort-robotank-wheel-info) - (format #t "~1Tjmod: ~A~%" (-> obj jmod)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) + (format #t "[~8x] ~A~%" this 'fort-robotank-wheel-info) + (format #t "~1Tjmod: ~A~%" (-> this jmod)) + (format #t "~1Tradius: ~f~%" (-> this radius)) (label cfg-4) - obj + this ) ;; definition of type fort-robotank-tread-info @@ -207,18 +207,18 @@ ) ;; definition for method 3 of type fort-robotank-tread-info -(defmethod inspect fort-robotank-tread-info ((obj fort-robotank-tread-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-robotank-tread-info ((this fort-robotank-tread-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'fort-robotank-tread-info) - (format #t "~1Twheel[7] @ #x~X~%" (-> obj wheel)) - (format #t "~1Ttexture: #~%" (-> obj texture)) - (format #t "~1Tlocator-joint: ~D~%" (-> obj locator-joint)) - (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "[~8x] ~A~%" this 'fort-robotank-tread-info) + (format #t "~1Twheel[7] @ #x~X~%" (-> this wheel)) + (format #t "~1Ttexture: #~%" (-> this texture)) + (format #t "~1Tlocator-joint: ~D~%" (-> this locator-joint)) + (format #t "~1Tpos: #~%" (-> this pos)) (label cfg-4) - obj + this ) ;; definition of type fort-robotank @@ -264,38 +264,38 @@ ) ;; definition for method 3 of type fort-robotank -(defmethod inspect fort-robotank ((obj fort-robotank)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-robotank ((this fort-robotank)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbarrel-part: ~A~%" (-> obj barrel-part)) - (format #t "~2Troller-jmod: ~A~%" (-> obj roller-jmod)) - (format #t "~2Tvibe-jmod: ~A~%" (-> obj vibe-jmod)) - (format #t "~2Ttread[2] @ #x~X~%" (-> obj tread)) - (format #t "~2Tpath-info: ~A~%" (-> obj path-info)) - (format #t "~2Tsegment-table: #x~X~%" (-> obj segment-table)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tpov-cam-offset[2] @ #x~X~%" (-> obj pov-cam-offset)) - (format #t "~2Tturret: ~D~%" (-> obj turret)) - (format #t "~2Tno-collision-timer: ~D~%" (-> obj no-collision-timer)) - (format #t "~2Tbuzz-timer: ~D~%" (-> obj buzz-timer)) - (format #t "~2Tplayer-u: ~f~%" (-> obj player-u)) - (format #t "~2Tplayer-prev-u: ~f~%" (-> obj player-prev-u)) - (format #t "~2Troller-spin-rate: ~f~%" (-> obj roller-spin-rate)) - (format #t "~2Tengine-vibe-rate: ~f~%" (-> obj engine-vibe-rate)) - (format #t "~2Tengine-vibe-amp: ~f~%" (-> obj engine-vibe-amp)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tpath-index: ~D~%" (-> obj path-index)) - (format #t "~2Tpath-count: ~D~%" (-> obj path-count)) - (format #t "~2Tcontinue-index: ~D~%" (-> obj continue-index)) - (format #t "~2Tidle-sound: ~A~%" (-> obj idle-sound)) - (format #t "~2Tbarrel-sound: ~A~%" (-> obj barrel-sound)) + (format #t "~2Tbarrel-part: ~A~%" (-> this barrel-part)) + (format #t "~2Troller-jmod: ~A~%" (-> this roller-jmod)) + (format #t "~2Tvibe-jmod: ~A~%" (-> this vibe-jmod)) + (format #t "~2Ttread[2] @ #x~X~%" (-> this tread)) + (format #t "~2Tpath-info: ~A~%" (-> this path-info)) + (format #t "~2Tsegment-table: #x~X~%" (-> this segment-table)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tpov-cam-offset[2] @ #x~X~%" (-> this pov-cam-offset)) + (format #t "~2Tturret: ~D~%" (-> this turret)) + (format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer)) + (format #t "~2Tbuzz-timer: ~D~%" (-> this buzz-timer)) + (format #t "~2Tplayer-u: ~f~%" (-> this player-u)) + (format #t "~2Tplayer-prev-u: ~f~%" (-> this player-prev-u)) + (format #t "~2Troller-spin-rate: ~f~%" (-> this roller-spin-rate)) + (format #t "~2Tengine-vibe-rate: ~f~%" (-> this engine-vibe-rate)) + (format #t "~2Tengine-vibe-amp: ~f~%" (-> this engine-vibe-amp)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tpath-index: ~D~%" (-> this path-index)) + (format #t "~2Tpath-count: ~D~%" (-> this path-count)) + (format #t "~2Tcontinue-index: ~D~%" (-> this continue-index)) + (format #t "~2Tidle-sound: ~A~%" (-> this idle-sound)) + (format #t "~2Tbarrel-sound: ~A~%" (-> this barrel-sound)) (label cfg-4) - obj + this ) ;; definition for symbol *fort-robotank-1-segment-table*, type (inline-array fort-robotank-segment) @@ -398,20 +398,20 @@ ) ;; definition for method 25 of type fort-robotank -(defmethod fort-robotank-method-25 fort-robotank ((obj fort-robotank)) +(defmethod fort-robotank-method-25 fort-robotank ((this fort-robotank)) (with-pp - (let ((v1-0 (-> obj root))) + (let ((v1-0 (-> this root))) (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) (let ((v0-0 (-> *event-queue* data (-> *event-queue* length)))) (+! (-> *event-queue* length) 1) (set! (-> v0-0 form-handle) (process->handle pp)) - (set! (-> v0-0 to-handle) (process->handle (handle->process (-> obj turret)))) + (set! (-> v0-0 to-handle) (process->handle (handle->process (-> this turret)))) (set! (-> v0-0 num-params) 4) (set! (-> v0-0 message) 'update) (set! (-> v0-0 param 0) (the-as uint (-> v1-0 trans))) (set! (-> v0-0 param 1) (the-as uint (-> v1-0 quat))) - (set! (-> v0-0 param 2) (the-as uint (-> obj node-list data 3))) - (set! (-> v0-0 param 3) (the-as uint (-> obj vibe-jmod twist))) + (set! (-> v0-0 param 2) (the-as uint (-> this node-list data 3))) + (set! (-> v0-0 param 3) (the-as uint (-> this vibe-jmod twist))) v0-0 ) ) @@ -424,9 +424,7 @@ ;; WARN: Return type mismatch int vs none. (defbehavior fort-robotank-post fort-robotank () (when (and (nonzero? (-> self no-collision-timer)) - (>= (- (current-time) (-> self no-collision-timer)) - (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) - ) + (time-elapsed? (-> self no-collision-timer) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout))) ) (let ((v1-7 (-> self root root-prim))) (set! (-> v1-7 prim-core collide-as) (-> self root backup-collide-as)) @@ -508,9 +506,7 @@ (f1-16 (- 1.0 f0-44)) (f26-0 0.0) ) - (when (and (or (< f0-44 f24-0) (< f24-0 f1-16)) - (>= (- (current-time) (-> self buzz-timer)) (the int (* 0.5 f30-2))) - ) + (when (and (or (< f0-44 f24-0) (< f24-0 f1-16)) (time-elapsed? (-> self buzz-timer) (the int (* 0.5 f30-2)))) (let* ((gp-2 *target*) (a0-43 (if (type? gp-2 process-focusable) gp-2 @@ -529,7 +525,7 @@ (the int (* 255.0 (* 0.49 f26-0))) (the-as time-frame (max 45 (the int (* 0.25 f30-2)))) ) - (set! (-> self buzz-timer) (current-time)) + (set-time! (-> self buzz-timer)) ) ) (quaternion-axis-angle! @@ -653,7 +649,7 @@ ) ) ) - (set! (-> self no-collision-timer) (current-time)) + (set-time! (-> self no-collision-timer)) (let ((v1-45 (-> self root root-prim))) (set! (-> v1-45 prim-core collide-as) (collide-spec)) (set! (-> v1-45 prim-core collide-with) (collide-spec)) @@ -675,7 +671,7 @@ ;; definition for method 26 of type fort-robotank ;; INFO: Used lq/sq -(defmethod fort-robotank-method-26 fort-robotank ((obj fort-robotank) (arg0 int) (arg1 float) (arg2 float)) +(defmethod fort-robotank-method-26 fort-robotank ((this fort-robotank) (arg0 int) (arg1 float) (arg2 float)) (local-vars (sv-96 fort-robotank-segment-event) (sv-112 (function process-tree event-message-block object)) @@ -684,7 +680,7 @@ (with-pp (let* ((s4-0 (* 0.00001 (the float (the int (+ 0.5 (* 100000.0 arg1)))))) (s3-0 (* 0.00001 (the float (the int (+ 0.5 (* 100000.0 arg2)))))) - (s2-0 (-> obj segment-table (-> obj path-index))) + (s2-0 (-> this segment-table (-> this path-index))) (s1-0 (-> s2-0 event-tbl)) ) (dotimes (s0-0 (-> s2-0 event-count)) @@ -705,7 +701,7 @@ (('code) (let ((t9-2 (-> sv-96 param-obj))) (if t9-2 - ((the-as (function fort-robotank none) t9-2) obj) + ((the-as (function fort-robotank none) t9-2) this) ) ) ) @@ -713,13 +709,13 @@ (set-setting! 'mode-name 'cam-pov-track 0.0 0) (set-setting! 'allow-look-around #f 0.0 0) (set-setting! 'target-height 'abs (meters -3) 0) - (let ((v1-27 (process->ppointer obj))) + (let ((v1-27 (process->ppointer this))) (set-setting! 'pov-handle v1-27 3.0 (-> v1-27 0 pid)) ) - (set-setting! 'pov-offset 'asdf (-> obj pov-cam-offset) 0) - (send-event (handle->process (-> obj turret)) 'pov-cam-on) - (logior! (-> obj flags) (robotank-flags roflags-7)) - (let ((v1-41 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 2))) + (set-setting! 'pov-offset 'asdf (-> this pov-cam-offset) 0) + (send-event (handle->process (-> this turret)) 'pov-cam-on) + (logior! (-> this flags) (robotank-flags roflags-7)) + (let ((v1-41 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 2))) (set! (-> v1-41 prim-core collide-as) (collide-spec enemy pusher)) (set! (-> v1-41 prim-core collide-with) (collide-spec jak bot player-list)) ) @@ -730,9 +726,9 @@ (remove-setting! 'allow-look-around) (remove-setting! 'target-height) (remove-setting! 'pov-offset) - (send-event (handle->process (-> obj turret)) 'pov-cam-off) - (logclear! (-> obj flags) (robotank-flags roflags-7)) - (let ((v1-57 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 2))) + (send-event (handle->process (-> this turret)) 'pov-cam-off) + (logclear! (-> this flags) (robotank-flags roflags-7)) + (let ((v1-57 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 2))) (set! (-> v1-57 prim-core collide-as) (collide-spec)) (set! (-> v1-57 prim-core collide-with) (collide-spec)) ) @@ -744,14 +740,14 @@ (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (remove-setting! 'target-height) (process-grab? *target* #f) - (send-event (handle->process (-> obj turret)) 'fire-suppress #t) + (send-event (handle->process (-> this turret)) 'fire-suppress #t) ) (('external-cam-off) (remove-setting! 'entity-name) (remove-setting! 'process-mask) (remove-setting! 'target-height) (process-release? *target*) - (send-event (handle->process (-> obj turret)) 'fire-suppress #f) + (send-event (handle->process (-> this turret)) 'fire-suppress #f) ) ) ) @@ -764,17 +760,17 @@ ;; definition for method 27 of type fort-robotank ;; WARN: Return type mismatch object vs none. -(defmethod fort-robotank-method-27 fort-robotank ((obj fort-robotank)) - (let ((s5-0 (-> obj segment-table (-> obj path-index) flags))) - (send-event (handle->process (-> obj turret)) 'use-los (if (logtest? s5-0 16) - #t - #f - ) +(defmethod fort-robotank-method-27 fort-robotank ((this fort-robotank)) + (let ((s5-0 (-> this segment-table (-> this path-index) flags))) + (send-event (handle->process (-> this turret)) 'use-los (if (logtest? s5-0 16) + #t + #f + ) ) - (send-event (handle->process (-> obj turret)) 'limit-reticle-elev (if (logtest? s5-0 32) - #t - #f - ) + (send-event (handle->process (-> this turret)) 'limit-reticle-elev (if (logtest? s5-0 32) + #t + #f + ) ) ) (none) @@ -914,7 +910,7 @@ :code (behavior () (logclear! (-> self flags) (robotank-flags roflags-2)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.1)) + (until (time-elapsed? gp-0 (seconds 0.1)) (suspend) ) ) @@ -1048,7 +1044,7 @@ (remove-setting! 'target-height) (send-event (handle->process (-> self turret)) 'die) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 2)) + (until (time-elapsed? gp-0 (seconds 2)) (suspend) ) ) @@ -1060,55 +1056,55 @@ ) ;; definition for method 10 of type fort-robotank -(defmethod deactivate fort-robotank ((obj fort-robotank)) - (stop! (-> obj idle-sound)) - (stop! (-> obj barrel-sound)) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate fort-robotank ((this fort-robotank)) + (stop! (-> this idle-sound)) + (stop! (-> this barrel-sound)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type fort-robotank ;; WARN: Return type mismatch process-drawable vs fort-robotank. -(defmethod relocate fort-robotank ((obj fort-robotank) (arg0 int)) - (if (nonzero? (-> obj barrel-part)) - (&+! (-> obj barrel-part) arg0) +(defmethod relocate fort-robotank ((this fort-robotank) (arg0 int)) + (if (nonzero? (-> this barrel-part)) + (&+! (-> this barrel-part) arg0) ) - (if (nonzero? (-> obj roller-jmod)) - (&+! (-> obj roller-jmod) arg0) + (if (nonzero? (-> this roller-jmod)) + (&+! (-> this roller-jmod) arg0) ) - (if (nonzero? (-> obj vibe-jmod)) - (&+! (-> obj vibe-jmod) arg0) + (if (nonzero? (-> this vibe-jmod)) + (&+! (-> this vibe-jmod) arg0) ) - (if (nonzero? (-> obj idle-sound)) - (&+! (-> obj idle-sound) arg0) + (if (nonzero? (-> this idle-sound)) + (&+! (-> this idle-sound) arg0) ) - (if (nonzero? (-> obj barrel-sound)) - (&+! (-> obj barrel-sound) arg0) + (if (nonzero? (-> this barrel-sound)) + (&+! (-> this barrel-sound) arg0) ) - (let ((v1-20 (-> obj path-info))) + (let ((v1-20 (-> this path-info))) (when (nonzero? v1-20) - (dotimes (a0-2 (-> obj path-count)) + (dotimes (a0-2 (-> this path-count)) (if (nonzero? (-> v1-20 data a0-2 path)) (&+! (-> v1-20 data a0-2 path) arg0) ) ) - (&+! (-> obj path-info) arg0) + (&+! (-> this path-info) arg0) ) ) (dotimes (v1-24 2) (dotimes (a0-4 7) (if (nonzero? (the-as joint-mod - (-> (the-as (pointer uint32) (&+ (&+ (the-as (pointer uint32) obj) (* 144 v1-24)) (* a0-4 16))) 55) + (-> (the-as (pointer uint32) (&+ (&+ (the-as (pointer uint32) this) (* 144 v1-24)) (* a0-4 16))) 55) ) ) - (set! (-> (&+ (&+ (the-as (pointer uint32) obj) (* 144 v1-24)) (* a0-4 16)) 55) + (set! (-> (&+ (&+ (the-as (pointer uint32) this) (* 144 v1-24)) (* a0-4 16)) 55) (the-as uint (&+ (the-as joint-mod - (-> (the-as (pointer uint32) (&+ (&+ (the-as (pointer uint32) obj) (* 144 v1-24)) (* a0-4 16))) 55) + (-> (the-as (pointer uint32) (&+ (&+ (the-as (pointer uint32) this) (* 144 v1-24)) (* a0-4 16))) 55) ) arg0 ) @@ -1119,20 +1115,20 @@ ) (the-as fort-robotank - ((the-as (function process-drawable int process-drawable) (find-parent-method fort-robotank 7)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method fort-robotank 7)) this arg0) ) ) ;; definition for method 11 of type fort-robotank ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-robotank ((obj fort-robotank) (arg0 entity-actor)) +(defmethod init-from-entity! fort-robotank ((this fort-robotank) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1171,171 +1167,171 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-robotank" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj flags) (robotank-flags)) - (set! (-> obj no-collision-timer) 0) - (set! (-> obj engine-vibe-rate) 1.0) - (set! (-> obj buzz-timer) 0) + (set! (-> this flags) (robotank-flags)) + (set! (-> this no-collision-timer) 0) + (set! (-> this engine-vibe-rate) 1.0) + (set! (-> this buzz-timer) 0) (let* ((v1-31 *game-info*) (a0-30 (+ (-> v1-31 attack-id) 1)) ) (set! (-> v1-31 attack-id) a0-30) - (set! (-> obj attack-id) a0-30) + (set! (-> this attack-id) a0-30) ) (cond - ((name= (-> obj name) "fort-robotank-2") - (set! (-> obj segment-table) *fort-robotank-1-segment-table*) - (set! (-> obj path-count) 4) + ((name= (-> this name) "fort-robotank-2") + (set! (-> this segment-table) *fort-robotank-1-segment-table*) + (set! (-> this path-count) 4) ) - ((name= (-> obj name) "fort-robotank-6") - (set! (-> obj segment-table) *fort-robotank-2-segment-table*) - (set! (-> obj path-count) 1) + ((name= (-> this name) "fort-robotank-6") + (set! (-> this segment-table) *fort-robotank-2-segment-table*) + (set! (-> this path-count) 1) ) (else (go process-drawable-art-error "unknown actor-node name") ) ) - (set! (-> obj path-info) (new 'process 'fort-robotank-path-info-array (-> obj path-count))) - (dotimes (s5-2 (-> obj path-count)) - (let ((s4-2 (-> obj path-info data s5-2))) - (if (logtest? (-> obj segment-table s5-2 flags) 8) - (set! (-> s4-2 path) (new 'process 'curve-control obj 'path -1000000000.0)) - (set! (-> s4-2 path) (new 'process 'curve-control obj 'path (the float s5-2))) + (set! (-> this path-info) (new 'process 'fort-robotank-path-info-array (-> this path-count))) + (dotimes (s5-2 (-> this path-count)) + (let ((s4-2 (-> this path-info data s5-2))) + (if (logtest? (-> this segment-table s5-2 flags) 8) + (set! (-> s4-2 path) (new 'process 'curve-control this 'path -1000000000.0)) + (set! (-> s4-2 path) (new 'process 'curve-control this 'path (the float s5-2))) ) (logior! (-> s4-2 path flags) (path-control-flag display draw-line draw-point draw-text)) (set! (-> s4-2 u) 0.0) (set! (-> s4-2 du) (-> s4-2 u)) - (set! (-> s4-2 max-speed) (* 4096.0 (-> obj segment-table s5-2 max-speed))) + (set! (-> s4-2 max-speed) (* 4096.0 (-> this segment-table s5-2 max-speed))) (set! (-> s4-2 dist) (total-distance (-> s4-2 path))) (set! (-> s4-2 start-y-angle) 0.0) (displacement-between-two-points-normalized! (-> s4-2 path) (-> s4-2 dir) 0.0) ) ) - (set! (-> obj path-index) 0) - (set! (-> obj continue-index) -1) + (set! (-> this path-index) 0) + (set! (-> this continue-index) -1) (let ((s5-3 (new 'stack-no-clear 'vector))) - (let ((s4-3 (-> obj path-info data 0 path))) - (get-point-in-path! s4-3 (-> obj root trans) 0.0 'interp) - (+! (-> obj root trans y) 1024.0) + (let ((s4-3 (-> this path-info data 0 path))) + (get-point-in-path! s4-3 (-> this root trans) 0.0 'interp) + (+! (-> this root trans y) 1024.0) (displacement-between-points-at-percent-normalized! s4-3 s5-3 0.0) ) - (set-heading-vec! (-> obj root) s5-3) + (set-heading-vec! (-> this root) s5-3) ) - (let ((a0-46 (-> obj skel root-channel 0))) - (set! (-> a0-46 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-46 (-> this skel root-channel 0))) + (set! (-> a0-46 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-46 frame-num) 0.0) - (joint-control-channel-group! a0-46 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-46 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) (let ((s5-4 (new 'stack-no-clear 'vector))) (set-vector! s5-4 0.0 12541.952 -6778.88 1.0) - (set! (-> obj turret) + (set! (-> this turret) (ppointer->handle - (process-spawn fort-robotank-turret (-> obj root trans) (-> obj root quat) s5-4 #x42000000 :to obj) + (process-spawn fort-robotank-turret (-> this root trans) (-> this root quat) s5-4 #x42000000 :to this) ) ) ) - (set! (-> obj roller-jmod) (the-as joint-mod (new 'process 'joint-mod-spinner obj 5 *x-vector* 0.0))) - (set! (-> obj roller-spin-rate) 0.0) - (set! (-> obj vibe-jmod) (the-as joint-mod (new 'process 'joint-mod-blend-local obj 4 #t))) - (set! (-> obj vibe-jmod scale y) 0.5) - (quaternion-axis-angle! (the-as quaternion (-> obj vibe-jmod twist)) 0.0 0.0 1.0 0.0) - (let ((s5-5 (-> obj tread))) - (set! (-> s5-5 0 wheel 0 jmod) (new 'process 'joint-mod-spinner obj 6 *x-vector* 0.0)) + (set! (-> this roller-jmod) (the-as joint-mod (new 'process 'joint-mod-spinner this 5 *x-vector* 0.0))) + (set! (-> this roller-spin-rate) 0.0) + (set! (-> this vibe-jmod) (the-as joint-mod (new 'process 'joint-mod-blend-local this 4 #t))) + (set! (-> this vibe-jmod scale y) 0.5) + (quaternion-axis-angle! (the-as quaternion (-> this vibe-jmod twist)) 0.0 0.0 1.0 0.0) + (let ((s5-5 (-> this tread))) + (set! (-> s5-5 0 wheel 0 jmod) (new 'process 'joint-mod-spinner this 6 *x-vector* 0.0)) (set! (-> s5-5 0 wheel 0 radius) 2048.0) ) - (let ((s5-6 (-> obj tread 0 wheel 1))) - (set! (-> s5-6 jmod) (new 'process 'joint-mod-spinner obj 7 *x-vector* 0.0)) + (let ((s5-6 (-> this tread 0 wheel 1))) + (set! (-> s5-6 jmod) (new 'process 'joint-mod-spinner this 7 *x-vector* 0.0)) (set! (-> s5-6 radius) 2048.0) ) - (let ((s5-7 (-> obj tread 0 wheel 2))) - (set! (-> s5-7 jmod) (new 'process 'joint-mod-spinner obj 8 *x-vector* 0.0)) + (let ((s5-7 (-> this tread 0 wheel 2))) + (set! (-> s5-7 jmod) (new 'process 'joint-mod-spinner this 8 *x-vector* 0.0)) (set! (-> s5-7 radius) 2048.0) ) - (let ((s5-8 (-> obj tread 0 wheel 3))) - (set! (-> s5-8 jmod) (new 'process 'joint-mod-spinner obj 9 *x-vector* 0.0)) + (let ((s5-8 (-> this tread 0 wheel 3))) + (set! (-> s5-8 jmod) (new 'process 'joint-mod-spinner this 9 *x-vector* 0.0)) (set! (-> s5-8 radius) 2048.0) ) - (let ((s5-9 (-> obj tread 0 wheel 4))) - (set! (-> s5-9 jmod) (new 'process 'joint-mod-spinner obj 10 *x-vector* 0.0)) + (let ((s5-9 (-> this tread 0 wheel 4))) + (set! (-> s5-9 jmod) (new 'process 'joint-mod-spinner this 10 *x-vector* 0.0)) (set! (-> s5-9 radius) 2048.0) ) - (let ((s5-10 (-> obj tread 0 wheel 5))) - (set! (-> s5-10 jmod) (new 'process 'joint-mod-spinner obj 11 *x-vector* 0.0)) + (let ((s5-10 (-> this tread 0 wheel 5))) + (set! (-> s5-10 jmod) (new 'process 'joint-mod-spinner this 11 *x-vector* 0.0)) (set! (-> s5-10 radius) 2048.0) ) - (let ((s5-11 (-> obj tread 0 wheel 6))) - (set! (-> s5-11 jmod) (new 'process 'joint-mod-spinner obj 12 *x-vector* 0.0)) + (let ((s5-11 (-> this tread 0 wheel 6))) + (set! (-> s5-11 jmod) (new 'process 'joint-mod-spinner this 12 *x-vector* 0.0)) (set! (-> s5-11 radius) 2048.0) ) - (let ((s5-12 (-> obj tread 1))) - (set! (-> s5-12 wheel 0 jmod) (new 'process 'joint-mod-spinner obj 13 *x-vector* 0.0)) + (let ((s5-12 (-> this tread 1))) + (set! (-> s5-12 wheel 0 jmod) (new 'process 'joint-mod-spinner this 13 *x-vector* 0.0)) (set! (-> s5-12 wheel 0 radius) 2048.0) ) - (let ((s5-13 (-> obj tread 1 wheel 1))) - (set! (-> s5-13 jmod) (new 'process 'joint-mod-spinner obj 14 *x-vector* 0.0)) + (let ((s5-13 (-> this tread 1 wheel 1))) + (set! (-> s5-13 jmod) (new 'process 'joint-mod-spinner this 14 *x-vector* 0.0)) (set! (-> s5-13 radius) 2048.0) ) - (let ((s5-14 (-> obj tread 1 wheel 2))) - (set! (-> s5-14 jmod) (new 'process 'joint-mod-spinner obj 15 *x-vector* 0.0)) + (let ((s5-14 (-> this tread 1 wheel 2))) + (set! (-> s5-14 jmod) (new 'process 'joint-mod-spinner this 15 *x-vector* 0.0)) (set! (-> s5-14 radius) 2048.0) ) - (let ((s5-15 (-> obj tread 1 wheel 3))) - (set! (-> s5-15 jmod) (new 'process 'joint-mod-spinner obj 16 *x-vector* 0.0)) + (let ((s5-15 (-> this tread 1 wheel 3))) + (set! (-> s5-15 jmod) (new 'process 'joint-mod-spinner this 16 *x-vector* 0.0)) (set! (-> s5-15 radius) 2048.0) ) - (let ((s5-16 (-> obj tread 1 wheel 4))) - (set! (-> s5-16 jmod) (new 'process 'joint-mod-spinner obj 17 *x-vector* 0.0)) + (let ((s5-16 (-> this tread 1 wheel 4))) + (set! (-> s5-16 jmod) (new 'process 'joint-mod-spinner this 17 *x-vector* 0.0)) (set! (-> s5-16 radius) 2048.0) ) - (let ((s5-17 (-> obj tread 1 wheel 5))) - (set! (-> s5-17 jmod) (new 'process 'joint-mod-spinner obj 18 *x-vector* 0.0)) + (let ((s5-17 (-> this tread 1 wheel 5))) + (set! (-> s5-17 jmod) (new 'process 'joint-mod-spinner this 18 *x-vector* 0.0)) (set! (-> s5-17 radius) 2048.0) ) - (let ((s5-18 (-> obj tread 1 wheel 6))) - (set! (-> s5-18 jmod) (new 'process 'joint-mod-spinner obj 19 *x-vector* 0.0)) + (let ((s5-18 (-> this tread 1 wheel 6))) + (set! (-> s5-18 jmod) (new 'process 'joint-mod-spinner this 19 *x-vector* 0.0)) (set! (-> s5-18 radius) 2048.0) ) - (set! (-> obj tread 0 texture) (-> *fortress-pris-texture-anim-array* array-data 0)) - (set! (-> obj tread 0 texture frame-delta) 0.0) + (set! (-> this tread 0 texture) (-> *fortress-pris-texture-anim-array* array-data 0)) + (set! (-> this tread 0 texture frame-delta) 0.0) (let ((v1-128 9)) - (set! (-> obj tread 0 locator-joint) v1-128) - (vector<-cspace! (-> obj tread 0 pos) (-> obj node-list data v1-128)) + (set! (-> this tread 0 locator-joint) v1-128) + (vector<-cspace! (-> this tread 0 pos) (-> this node-list data v1-128)) ) - (set! (-> obj tread 1 texture) (-> *fortress-pris-texture-anim-array* array-data 1)) - (set! (-> obj tread 1 texture frame-delta) 0.0) + (set! (-> this tread 1 texture) (-> *fortress-pris-texture-anim-array* array-data 1)) + (set! (-> this tread 1 texture frame-delta) 0.0) (let ((v1-135 16)) - (set! (-> obj tread 1 locator-joint) v1-135) - (vector<-cspace! (-> obj tread 1 pos) (-> obj node-list data v1-135)) + (set! (-> this tread 1 locator-joint) v1-135) + (vector<-cspace! (-> this tread 1 pos) (-> this node-list data v1-135)) ) - (set-vector! (-> obj pov-cam-offset 0) 0.0 13516.8 -13516.8 1.0) - (set-vector! (-> obj pov-cam-offset 1) 0.0 13516.8 -13516.8 1.0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 561) obj)) - (set! (-> obj barrel-part) (create-launch-control (-> *part-group-id-table* 562) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "robotank-tread" :fo-max 70) (-> obj root trans)) + (set-vector! (-> this pov-cam-offset 0) 0.0 13516.8 -13516.8 1.0) + (set-vector! (-> this pov-cam-offset 1) 0.0 13516.8 -13516.8 1.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 561) this)) + (set! (-> this barrel-part) (create-launch-control (-> *part-group-id-table* 562) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "robotank-tread" :fo-max 70) (-> this root trans)) ) - (set! (-> obj idle-sound) - (new 'process 'ambient-sound (static-sound-spec "robotank-idle" :fo-max 50) (-> obj root trans)) + (set! (-> this idle-sound) + (new 'process 'ambient-sound (static-sound-spec "robotank-idle" :fo-max 50) (-> this root trans)) ) - (set! (-> obj barrel-sound) - (new 'process 'ambient-sound (static-sound-spec "robotank-barrel" :fo-max 50) (-> obj root trans)) + (set! (-> this barrel-sound) + (new 'process 'ambient-sound (static-sound-spec "robotank-barrel" :fo-max 50) (-> this root trans)) ) - (update-vol! (-> obj sound) 0.0) - (update-vol! (-> obj idle-sound) 1.0) - (update-vol! (-> obj barrel-sound) 0.25) - (go (method-of-object obj idle)) + (update-vol! (-> this sound) 0.0) + (update-vol! (-> this idle-sound) 1.0) + (update-vol! (-> this barrel-sound) 0.25) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc index 88b53485f4..a0290cdd8a 100644 --- a/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/exit/forexita-obs_REF.gc @@ -16,18 +16,18 @@ ) ;; definition for method 3 of type fort-lift-plat -(defmethod inspect fort-lift-plat ((obj fort-lift-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-lift-plat ((this fort-lift-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-time: ~D~%" (-> obj sound-time)) - (format #t "~2Tlast-val: ~f~%" (-> obj last-val)) + (format #t "~2Tsound-time: ~D~%" (-> this sound-time)) + (format #t "~2Tlast-val: ~f~%" (-> this last-val)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -37,7 +37,7 @@ ) ;; definition for method 30 of type fort-lift-plat -(defmethod get-art-group fort-lift-plat ((obj fort-lift-plat)) +(defmethod get-art-group fort-lift-plat ((this fort-lift-plat)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-fort-lift-plat" (the-as (pointer uint32) #f)) ) @@ -45,7 +45,7 @@ ;; definition for method 32 of type fort-lift-plat ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 fort-lift-plat ((obj fort-lift-plat)) +(defmethod base-plat-method-32 fort-lift-plat ((this fort-lift-plat)) 0 (none) ) @@ -129,23 +129,23 @@ ;; definition for method 27 of type fort-lift-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod execute-effects fort-lift-plat ((obj fort-lift-plat)) +(defmethod execute-effects fort-lift-plat ((this fort-lift-plat)) "Executes various ancillary tasks with the platform, such as spawning particles or playing the associated sound" - (if (nonzero? (-> obj part)) - (spawn-with-cspace (-> obj part) (-> obj node-list data 6)) + (if (nonzero? (-> this part)) + (spawn-with-cspace (-> this part) (-> this node-list data 6)) ) - (when (nonzero? (-> obj sound)) - (set! (-> obj sound trans quad) (-> obj root trans quad)) - (update! (-> obj sound)) + (when (nonzero? (-> this sound)) + (set! (-> this sound trans quad) (-> this root trans quad)) + (update! (-> this sound)) ) (none) ) ;; definition for method 31 of type fort-lift-plat ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-plat-collision! fort-lift-plat ((obj fort-lift-plat)) +(defmethod init-plat-collision! fort-lift-plat ((this fort-lift-plat)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -201,7 +201,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) @@ -209,53 +209,53 @@ ;; definition for method 32 of type fort-lift-plat ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch sparticle-launch-control vs none. -(defmethod base-plat-method-32 fort-lift-plat ((obj fort-lift-plat)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 618) obj)) +(defmethod base-plat-method-32 fort-lift-plat ((this fort-lift-plat)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 618) this)) (none) ) ;; definition for method 33 of type fort-lift-plat ;; WARN: Return type mismatch sound-id vs none. -(defmethod init-plat! fort-lift-plat ((obj fort-lift-plat)) +(defmethod init-plat! fort-lift-plat ((this fort-lift-plat)) "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." - (set! (-> obj root pause-adjust-distance) 327680.0) - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this root pause-adjust-distance) 327680.0) + (set! (-> this sound-id) (new-sound-id)) (none) ) ;; definition for method 10 of type fort-lift-plat -(defmethod deactivate fort-lift-plat ((obj fort-lift-plat)) - (sound-stop (-> obj sound-id)) - ((method-of-type plat deactivate) obj) +(defmethod deactivate fort-lift-plat ((this fort-lift-plat)) + (sound-stop (-> this sound-id)) + ((method-of-type plat deactivate) this) (none) ) ;; definition for method 36 of type fort-lift-plat -(defmethod plat-path-sync fort-lift-plat ((obj fort-lift-plat)) +(defmethod plat-path-sync fort-lift-plat ((this fort-lift-plat)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @see [[sync-eased]]" (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) - (go (method-of-object obj plat-idle)) + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this plat-idle)) ) - ((logtest? (actor-option user18) (-> obj fact options)) - (set! (-> obj path-pos) (res-lump-float (-> obj entity) 'initial-spline-pos)) - (get-point-at-percent-along-path! (-> obj path) (-> obj root trans) (-> obj path-pos) 'interp) - (go (method-of-object obj plat-anim-active)) + ((logtest? (actor-option user18) (-> this fact options)) + (set! (-> this path-pos) (res-lump-float (-> this entity) 'initial-spline-pos)) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + (go (method-of-object this plat-anim-active)) ) - ((> (-> obj sync period) 0) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + ((> (-> this sync period) 0) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-identity) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity) ) - (go (method-of-object obj plat-path-active)) + (go (method-of-object this plat-path-active)) ) (else - (go (method-of-object obj plat-idle)) + (go (method-of-object this plat-idle)) ) ) ) @@ -276,18 +276,18 @@ otherwise, [[plat::34]] ) ;; definition for method 3 of type fort-claw -(defmethod inspect fort-claw ((obj fort-claw)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-claw ((this fort-claw)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-dest: ~f~%" (-> obj path-dest)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-dest: ~f~%" (-> this path-dest)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -319,10 +319,10 @@ otherwise, [[plat::34]] (defstate pause (fort-claw) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (go-virtual idle) ) ) @@ -331,32 +331,32 @@ otherwise, [[plat::34]] ;; definition for method 11 of type fort-claw ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-claw ((obj fort-claw) (arg0 entity-actor)) +(defmethod init-from-entity! fort-claw ((this fort-claw) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-claw" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-u) 0.0) - (set! (-> obj path-dest) 1.0) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-u) 0.0) + (set! (-> this path-dest) 1.0) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -370,7 +370,7 @@ This commonly includes things such as: (until #f (sound-play "fortress-alarm") (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/exit/forexita-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/exit/forexita-part_REF.gc index a3f795cee8..d380834f5d 100644 --- a/test/decompiler/reference/jak2/levels/fortress/exit/forexita-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/exit/forexita-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type forexita-part -(defmethod inspect forexita-part ((obj forexita-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect forexita-part ((this forexita-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/fortress/exit/forexitb-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/exit/forexitb-part_REF.gc index ee59caf334..4217f0004e 100644 --- a/test/decompiler/reference/jak2/levels/fortress/exit/forexitb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/exit/forexitb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type forexitb-part -(defmethod inspect forexitb-part ((obj forexitb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect forexitb-part ((this forexitb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc index 159d3bff45..43c358a177 100644 --- a/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/fort-turret_REF.gc @@ -445,34 +445,34 @@ ) ;; definition for method 3 of type fort-turret -(defmethod inspect fort-turret ((obj fort-turret)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-turret ((this fort-turret)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tgun-tilt-jm: ~A~%" (-> obj gun-tilt-jm)) - (format #t "~2Tgun-shadow-jm: ~A~%" (-> obj gun-shadow-jm)) - (format #t "~2Taim-pos: #~%" (-> obj aim-pos)) - (format #t "~2Ttarget-bullseye: #~%" (-> obj target-bullseye)) - (format #t "~2Tgun-twist: ~f~%" (-> obj gun-twist)) - (format #t "~2Tgun-tilt: ~f~%" (-> obj gun-tilt)) - (format #t "~2Tdesired-twist: ~f~%" (-> obj desired-twist)) - (format #t "~2Tdesired-tilt: ~f~%" (-> obj desired-tilt)) - (format #t "~2Tlos-clear: ~A~%" (-> obj los-clear)) - (format #t "~2Tflash-state: ~A~%" (-> obj flash-state)) - (format #t "~2Tflash-index: ~D~%" (-> obj flash-index)) - (format #t "~2Tcan-shoot: ~A~%" (-> obj can-shoot)) - (format #t "~2Tlast-hit-time: ~D~%" (-> obj last-hit-time)) - (format #t "~2Tinit-mat: #~%" (-> obj init-mat)) - (format #t "~2Ttarget-timeout: ~D~%" (-> obj target-timeout)) - (format #t "~2Tbeam-intersect: ~A~%" (-> obj beam-intersect)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tinvincible: ~A~%" (-> obj invincible)) + (format #t "~2Tgun-tilt-jm: ~A~%" (-> this gun-tilt-jm)) + (format #t "~2Tgun-shadow-jm: ~A~%" (-> this gun-shadow-jm)) + (format #t "~2Taim-pos: #~%" (-> this aim-pos)) + (format #t "~2Ttarget-bullseye: #~%" (-> this target-bullseye)) + (format #t "~2Tgun-twist: ~f~%" (-> this gun-twist)) + (format #t "~2Tgun-tilt: ~f~%" (-> this gun-tilt)) + (format #t "~2Tdesired-twist: ~f~%" (-> this desired-twist)) + (format #t "~2Tdesired-tilt: ~f~%" (-> this desired-tilt)) + (format #t "~2Tlos-clear: ~A~%" (-> this los-clear)) + (format #t "~2Tflash-state: ~A~%" (-> this flash-state)) + (format #t "~2Tflash-index: ~D~%" (-> this flash-index)) + (format #t "~2Tcan-shoot: ~A~%" (-> this can-shoot)) + (format #t "~2Tlast-hit-time: ~D~%" (-> this last-hit-time)) + (format #t "~2Tinit-mat: #~%" (-> this init-mat)) + (format #t "~2Ttarget-timeout: ~D~%" (-> this target-timeout)) + (format #t "~2Tbeam-intersect: ~A~%" (-> this beam-intersect)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tinvincible: ~A~%" (-> this invincible)) (label cfg-4) - obj + this ) ;; definition for symbol *fort-turret-enemy-info*, type enemy-info @@ -560,29 +560,29 @@ (set! (-> *fort-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 55 of type fort-turret -(defmethod track-target! fort-turret ((obj fort-turret)) +(defmethod track-target! fort-turret ((this fort-turret)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (let ((s5-0 (-> obj root))) + (let ((s5-0 (-> this root))) (update-transforms s5-0) (pull-riders! s5-0) (do-push-aways s5-0) ) - (when (not (and (-> obj next-state) (= (-> obj next-state name) 'die))) - (let ((a0-7 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 12)))) - (fort-turret-draw-laser a0-7 (-> obj target-bullseye)) + (when (not (and (-> this next-state) (= (-> this next-state name) 'die))) + (let ((a0-7 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 12)))) + (fort-turret-draw-laser a0-7 (-> this target-bullseye)) ) - (case (-> obj beam-intersect) + (case (-> this beam-intersect) (('target) - (fort-turret-draw-laser-spot (-> obj target-bullseye) #f #t) + (fort-turret-draw-laser-spot (-> this target-bullseye) #f #t) ) (('wall) - (fort-turret-draw-laser-spot (-> obj target-bullseye) #f #f) + (fort-turret-draw-laser-spot (-> this target-bullseye) #f #f) ) ) ) @@ -592,75 +592,75 @@ ;; definition for method 139 of type fort-turret ;; INFO: Used lq/sq ;; WARN: Return type mismatch quaternion vs none. -(defmethod fort-turret-method-139 fort-turret ((obj fort-turret)) - (let ((a0-2 (handle->process (-> obj focus handle)))) +(defmethod fort-turret-method-139 fort-turret ((this fort-turret)) + (let ((a0-2 (handle->process (-> this focus handle)))) (if a0-2 - (set! (-> obj aim-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) + (set! (-> this aim-pos quad) (-> (get-trans (the-as process-focusable a0-2) 3) quad)) ) ) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 4))) + (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4))) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> obj aim-pos) (-> obj root trans)) - (vector-flatten! s4-0 s4-0 (-> obj init-mat vector 1)) + (vector-! s4-0 (-> this aim-pos) (-> this root trans)) + (vector-flatten! s4-0 s4-0 (-> this init-mat vector 1)) (vector-normalize! s4-0 1.0) - (set! (-> obj desired-twist) (asin (vector-dot (the-as vector (-> obj init-mat)) s4-0))) - (set! (-> obj desired-twist) (fmin 9102.223 (fmax -9102.223 (-> obj desired-twist)))) + (set! (-> this desired-twist) (asin (vector-dot (the-as vector (-> this init-mat)) s4-0))) + (set! (-> this desired-twist) (fmin 9102.223 (fmax -9102.223 (-> this desired-twist)))) (cond - ((< 0.0 (vector-dot (-> obj init-mat vector 2) s4-0)) + ((< 0.0 (vector-dot (-> this init-mat vector 2) s4-0)) ) - ((< (-> obj desired-twist) 0.0) - (set! (-> obj desired-twist) -9102.223) + ((< (-> this desired-twist) 0.0) + (set! (-> this desired-twist) -9102.223) ) (else - (set! (-> obj desired-twist) 9102.223) + (set! (-> this desired-twist) 9102.223) ) ) - (set! (-> obj desired-tilt) 0.0) - (when (< (fabs (-> obj desired-twist)) 9102.223) - (vector-normalize-copy! s3-0 (-> obj node-list data 3 bone transform vector 1) 1.0) - (vector-! s4-0 (-> obj aim-pos) s5-2) - (set! (-> obj desired-tilt) + (set! (-> this desired-tilt) 0.0) + (when (< (fabs (-> this desired-twist)) 9102.223) + (vector-normalize-copy! s3-0 (-> this node-list data 3 bone transform vector 1) 1.0) + (vector-! s4-0 (-> this aim-pos) s5-2) + (set! (-> this desired-tilt) (- (atan 8192.0 (vector-normalize-ret-len! s4-0 1.0)) (asin (vector-dot s3-0 s4-0))) ) - (set! (-> obj desired-tilt) (fmin 8192.0 (fmax -8192.0 (-> obj desired-tilt)))) + (set! (-> this desired-tilt) (fmin 8192.0 (fmax -8192.0 (-> this desired-tilt)))) ) ) (vector-normalize-copy! - (-> obj aim-pos) - (-> obj node-list data 4 bone transform vector 2) - (vector-vector-distance s5-2 (-> obj aim-pos)) + (-> this aim-pos) + (-> this node-list data 4 bone transform vector 2) + (vector-vector-distance s5-2 (-> this aim-pos)) ) ) (vector+! - (-> obj aim-pos) - (-> obj aim-pos) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7)) + (-> this aim-pos) + (-> this aim-pos) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7)) ) - (fort-turret-method-140 obj 0.3 364.0889) + (fort-turret-method-140 this 0.3 364.0889) (none) ) ;; definition for method 140 of type fort-turret -(defmethod fort-turret-method-140 fort-turret ((obj fort-turret) (arg0 float) (arg1 float)) +(defmethod fort-turret-method-140 fort-turret ((this fort-turret) (arg0 float) (arg1 float)) (rider-trans) (let ((s3-0 (new 'stack-no-clear 'matrix))) - (+! (-> obj gun-twist) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> obj desired-twist) (-> obj gun-twist)))))) - (matrix-rotate-y! s3-0 (-> obj gun-twist)) - (matrix*! s3-0 s3-0 (-> obj init-mat)) - (matrix->quaternion (-> obj root quat) s3-0) + (+! (-> this gun-twist) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> this desired-twist) (-> this gun-twist)))))) + (matrix-rotate-y! s3-0 (-> this gun-twist)) + (matrix*! s3-0 s3-0 (-> this init-mat)) + (matrix->quaternion (-> this root quat) s3-0) ) - (+! (-> obj gun-tilt) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> obj desired-tilt) (-> obj gun-tilt)))))) - (quaternion-axis-angle! (-> obj gun-tilt-jm quat) 1.0 0.0 0.0 (-> obj gun-tilt)) + (+! (-> this gun-tilt) (fmax (- arg1) (fmin arg1 (* arg0 (- (-> this desired-tilt) (-> this gun-tilt)))))) + (quaternion-axis-angle! (-> this gun-tilt-jm quat) 1.0 0.0 0.0 (-> this gun-tilt)) ) ;; definition for method 141 of type fort-turret ;; INFO: Used lq/sq -(defmethod fort-turret-method-141 fort-turret ((obj fort-turret)) - (let* ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 12))) +(defmethod fort-turret-method-141 fort-turret ((this fort-turret)) + (let* ((s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 12))) (v1-3 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 12 bone transform vector 2) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 12 bone transform vector 2) 1.0) ) (s4-1 (vector-float*! (new 'stack-no-clear 'vector) v1-3 163840.0)) ) @@ -672,7 +672,7 @@ (set! (-> v1-6 collide-with) (collide-spec backgnd jak crate obstacle hit-by-player-list hit-by-others-list player-list pusher) ) - (set! (-> v1-6 ignore-process0) obj) + (set! (-> v1-6 ignore-process0) this) (set! (-> v1-6 ignore-process1) #f) (set! (-> v1-6 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-6 action-mask) (collide-action solid)) @@ -680,7 +680,7 @@ (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* s3-0))) (cond ((>= f30-0 0.0) - (set! (-> obj beam-intersect) (the-as basic 'wall)) + (set! (-> this beam-intersect) (the-as basic 'wall)) (when (-> s3-0 best-other-tri collide-ptr) (let* ((s3-1 (-> s3-0 best-other-tri collide-ptr)) (a0-14 (if (type? s3-1 collide-shape-prim) @@ -690,52 +690,52 @@ ) (when a0-14 (when (= (-> a0-14 cshape process type) target) - (set! (-> obj target-timeout) (the-as uint (current-time))) - (set! (-> obj beam-intersect) (the-as basic 'target)) + (set! (-> this target-timeout) (the-as uint (current-time))) + (set! (-> this beam-intersect) (the-as basic 'target)) ) ) ) ) (vector-float*! s4-1 s4-1 f30-0) (let ((s3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 s4-1)) - (a0-21 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 10))) - (v1-23 (-> obj gun-shadow-jm twist-max)) + (a0-21 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 10))) + (v1-23 (-> this gun-shadow-jm twist-max)) ) (set! (-> v1-23 z) (+ 2.0 (* 0.00024414062 (vector-length (vector-! (new 'stack-no-clear 'vector) s3-3 a0-21)))) ) - (if (= (-> obj beam-intersect) 'wall) + (if (= (-> this beam-intersect) 'wall) (+! (-> v1-23 z) -5.0) ) ) ) (else - (set! (-> obj beam-intersect) (the-as basic 'nothing)) + (set! (-> this beam-intersect) (the-as basic 'nothing)) ) ) ) ) - (vector+! (-> obj target-bullseye) s5-0 s4-1) + (vector+! (-> this target-bullseye) s5-0 s4-1) ) ) ;; definition for method 142 of type fort-turret ;; INFO: Used lq/sq -(defmethod fort-turret-method-142 fort-turret ((obj fort-turret) (arg0 symbol) (arg1 int)) - (let ((v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg1))) +(defmethod fort-turret-method-142 fort-turret ((this fort-turret) (arg0 symbol) (arg1 int)) + (let ((v1-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1))) (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj aim-pos) v1-2)) + (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this aim-pos) v1-2)) (f30-0 (/ 2013265900.0 (vector-length s2-1))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s4-0 ent) (-> obj entity)) + (set! (-> s4-0 ent) (-> this entity)) (set! (-> s4-0 charge) 1.0) (set! (-> s4-0 options) (projectile-options)) (set! (-> s4-0 pos quad) (-> v1-2 quad)) - (set! (-> s4-0 notify-handle) (process->handle obj)) + (set! (-> s4-0 notify-handle) (process->handle this)) (set! (-> s4-0 owner-handle) (the-as handle #f)) - (set! (-> s4-0 ignore-handle) (process->handle obj)) + (set! (-> s4-0 ignore-handle) (process->handle this)) (let* ((v1-10 *game-info*) (a0-18 (+ (-> v1-10 attack-id) 1)) ) @@ -753,14 +753,14 @@ ) (vector+! (-> s4-0 vel) (-> s4-0 vel) s3-0) ) - (spawn-projectile guard-shot s4-0 obj *default-dead-pool*) + (spawn-projectile guard-shot s4-0 this *default-dead-pool*) ) (sound-play "turret-shot") (if arg0 (sound-play "gtur-shot-fire") ) (let ((v0-11 #t)) - (set! (-> obj flash-state) (the-as basic v0-11)) + (set! (-> this flash-state) (the-as basic v0-11)) v0-11 ) ) @@ -776,15 +776,15 @@ (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (>= 2 (the-as int (-> self focus aware))) (go-stare self) ) ) (set! (-> self root penetrated-by) (get-penetrate-info self)) (fort-turret-method-141 self) - (if (or (>= (- (current-time) (the-as int (-> self target-timeout))) (seconds 0.5)) - (< (- (current-time) (-> self last-hit-time)) (seconds 2)) + (if (or (time-elapsed? (the-as int (-> self target-timeout)) (seconds 0.5)) + (not (time-elapsed? (-> self last-hit-time) (seconds 2))) ) (go-virtual hostile) ) @@ -798,7 +798,7 @@ (ja :num! (seek!)) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (suspend) ) ) @@ -819,7 +819,7 @@ (ja :num! (seek!)) ) (let ((s4-1 (current-time))) - (until (>= (- (current-time) s4-1) (seconds 0.33)) + (until (time-elapsed? s4-1 (seconds 0.33)) (suspend) ) ) @@ -831,7 +831,7 @@ ) (set! (-> self flash-state) #f) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 1.5)) + (until (time-elapsed? gp-3 (seconds 1.5)) (suspend) ) ) @@ -852,13 +852,13 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (>= 2 (the-as int (-> self focus aware))) (go-stare self) ) @@ -867,8 +867,8 @@ (set! (-> self desired-twist) (* 8192.0 (cos (get-scaled-val! (-> self sync) 32768.0 0)))) (fort-turret-method-140 self 0.1 91.022224) (fort-turret-method-141 self) - (if (and (< (- (current-time) (the-as int (-> self target-timeout))) (seconds 0.5)) - (>= (- (current-time) (-> self last-hit-time)) (seconds 2)) + (if (and (not (time-elapsed? (the-as int (-> self target-timeout)) (seconds 0.5))) + (time-elapsed? (-> self last-hit-time) (seconds 2)) ) (go-virtual attack) ) @@ -897,15 +897,15 @@ (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (>= 2 (the-as int (-> self focus aware))) (go-stare self) ) ) (set! (-> self root penetrated-by) (get-penetrate-info self)) (fort-turret-method-141 self) - (if (and (< (- (current-time) (the-as int (-> self target-timeout))) (seconds 0.5)) - (>= (- (current-time) (-> self last-hit-time)) (seconds 2)) + (if (and (not (time-elapsed? (the-as int (-> self target-timeout)) (seconds 0.5))) + (time-elapsed? (-> self last-hit-time) (seconds 2)) ) (go-virtual attack) ) @@ -921,21 +921,21 @@ ) ;; definition for method 74 of type fort-turret -(defmethod general-event-handler fort-turret ((obj fort-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler fort-turret ((this fort-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (if (and (= arg2 'notify) (< 1 arg1) (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) - (set! (-> obj last-hit-time) (current-time)) + (set-time! (-> this last-hit-time)) ) (case arg2 (('start) (let ((v0-0 (the-as object #t))) - (set! (-> obj can-shoot) (the-as symbol v0-0)) + (set! (-> this can-shoot) (the-as symbol v0-0)) v0-0 ) ) (('stop) - (set! (-> obj can-shoot) #f) + (set! (-> this can-shoot) #f) #f ) (('attack) @@ -943,16 +943,16 @@ ((= (-> arg0 type) target) #f ) - ((-> obj invincible) + ((-> this invincible) #f ) (else - ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -988,13 +988,13 @@ (let ((gp-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 4))) (s5-2 (current-time)) ) - (until (>= (- (current-time) s5-2) (seconds 2)) + (until (time-elapsed? s5-2 (seconds 2)) (spawn (-> self part) gp-2) (suspend) ) ) (let ((gp-3 (current-time))) - (until (>= (- (current-time) gp-3) (seconds 1)) + (until (time-elapsed? gp-3 (seconds 1)) (suspend) ) ) @@ -1011,14 +1011,14 @@ ;; definition for method 60 of type fort-turret ;; INFO: this function exists in multiple non-identical object files -(defmethod coin-flip? fort-turret ((obj fort-turret)) +(defmethod coin-flip? fort-turret ((this fort-turret)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 59 of type fort-turret ;; WARN: Return type mismatch int vs penetrate. -(defmethod get-penetrate-info fort-turret ((obj fort-turret)) +(defmethod get-penetrate-info fort-turret ((this fort-turret)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (the-as penetrate 0) @@ -1026,10 +1026,10 @@ ;; definition for method 114 of type fort-turret ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! fort-turret ((obj fort-turret)) +(defmethod init-enemy-collision! fort-turret ((this fort-turret)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (stack-size-set! (-> obj main-thread) 512) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1072,7 +1072,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-24 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1080,52 +1080,52 @@ ;; definition for method 60 of type fort-turret ;; INFO: this function exists in multiple non-identical object files -(defmethod coin-flip? fort-turret ((obj fort-turret)) +(defmethod coin-flip? fort-turret ((this fort-turret)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 7 of type fort-turret ;; WARN: Return type mismatch enemy vs fort-turret. -(defmethod relocate fort-turret ((obj fort-turret) (arg0 int)) - (if (nonzero? (-> obj gun-tilt-jm)) - (&+! (-> obj gun-tilt-jm) arg0) +(defmethod relocate fort-turret ((this fort-turret) (arg0 int)) + (if (nonzero? (-> this gun-tilt-jm)) + (&+! (-> this gun-tilt-jm) arg0) ) - (if (nonzero? (-> obj gun-shadow-jm)) - (&+! (-> obj gun-shadow-jm) arg0) + (if (nonzero? (-> this gun-shadow-jm)) + (&+! (-> this gun-shadow-jm) arg0) ) - (the-as fort-turret ((method-of-type enemy relocate) obj arg0)) + (the-as fort-turret ((method-of-type enemy relocate) this arg0)) ) ;; definition for method 115 of type fort-turret ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! fort-turret ((obj fort-turret)) +(defmethod init-enemy! fort-turret ((this fort-turret)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-turret" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *fort-turret-enemy-info*) - (set! (-> obj invincible) #f) - (if (logtest? (the-as int (res-lump-value (-> obj entity) 'enemy-options uint128 :time -1000000000.0)) 1) - (set! (-> obj invincible) #t) + (init-enemy-behaviour-and-stats! this *fort-turret-enemy-info*) + (set! (-> this invincible) #f) + (if (logtest? (the-as int (res-lump-value (-> this entity) 'enemy-options uint128 :time -1000000000.0)) 1) + (set! (-> this invincible) #t) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 685) obj)) - (set! (-> obj gun-tilt-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4)) - (set! (-> obj gun-shadow-jm) (the-as joint-mod (new 'process 'joint-mod-set-local obj 10 #f #f #t))) - (set! (-> obj gun-shadow-jm twist-min-y) (the-as float #t)) - (set! (-> obj los-clear) #f) - (set! (-> obj gun-twist) 0.0) - (set! (-> obj gun-tilt) 0.0) - (set! (-> obj desired-twist) 0.0) - (set! (-> obj desired-tilt) 0.0) - (set! (-> obj flash-state) #f) - (set! (-> obj can-shoot) #t) - (set! (-> obj last-hit-time) 0) - (set! (-> obj target-timeout) (the-as uint 0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 685) this)) + (set! (-> this gun-tilt-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) + (set! (-> this gun-shadow-jm) (the-as joint-mod (new 'process 'joint-mod-set-local this 10 #f #f #t))) + (set! (-> this gun-shadow-jm twist-min-y) (the-as float #t)) + (set! (-> this los-clear) #f) + (set! (-> this gun-twist) 0.0) + (set! (-> this gun-tilt) 0.0) + (set! (-> this desired-twist) 0.0) + (set! (-> this desired-tilt) 0.0) + (set! (-> this flash-state) #f) + (set! (-> this can-shoot) #t) + (set! (-> this last-hit-time) 0) + (set! (-> this target-timeout) (the-as uint 0)) (let ((a1-7 (new 'stack-no-clear 'sync-info-params))) (let ((v1-21 0)) (if #t @@ -1134,14 +1134,14 @@ (set! (-> a1-7 sync-type) 'sync-linear) (set! (-> a1-7 sync-flags) (the-as sync-flags v1-21)) ) - (set! (-> a1-7 entity) (-> obj entity)) + (set! (-> a1-7 entity) (-> this entity)) (set! (-> a1-7 period) (the-as uint 3000)) (set! (-> a1-7 percent) 0.0) - (initialize! (-> obj sync) a1-7) + (initialize! (-> this sync) a1-7) ) - (set! (-> obj flash-index) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0)) - (quaternion->matrix (-> obj init-mat) (-> obj root quat)) - (set-vector! (-> obj gun-shadow-jm twist-max) 2.0 1.0 10.0 1.0) + (set! (-> this flash-index) (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0)) + (quaternion->matrix (-> this init-mat) (-> this root quat)) + (set-vector! (-> this gun-shadow-jm twist-max) 2.0 1.0 10.0 1.0) (let ((v1-32 (new 'static 'shadow-control :settings (new 'static 'shadow-settings :flags (shadow-flags shdf02 shdf03 shdf04 shdf07) :shadow-dir (new 'static 'vector :y -1.0 :w -983040.0) @@ -1154,7 +1154,7 @@ ) (-> v1-32 settings) (set! (-> v1-32 settings shadow-type) 1) - (set! (-> obj draw shadow-ctrl) v1-32) + (set! (-> this draw shadow-ctrl) v1-32) ) 0 (none) diff --git a/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc index c01c1c9921..a84ef42564 100644 --- a/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/fortress-obs_REF.gc @@ -17,17 +17,17 @@ ) ;; definition for method 3 of type fort-trap-door -(defmethod inspect fort-trap-door ((obj fort-trap-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-trap-door ((this fort-trap-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -145,7 +145,7 @@ (suspend) (ja-channel-set! 0) (let ((frame-counter (current-time))) - (until (>= (- (current-time) frame-counter) (seconds 1)) + (until (time-elapsed? frame-counter (seconds 1)) (suspend) ) ) @@ -160,14 +160,14 @@ ;; definition for method 11 of type fort-trap-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-trap-door ((obj fort-trap-door) (entity entity-actor)) +(defmethod init-from-entity! fort-trap-door ((this fort-trap-door) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak bot player-list)) @@ -182,27 +182,27 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving cshape)) + (set! (-> this root) (the-as collide-shape-moving cshape)) ) - (set! (-> (the-as collide-shape-moving (-> obj root)) penetrated-by) (penetrate flop)) - (process-drawable-from-entity! obj entity) + (set! (-> (the-as collide-shape-moving (-> this root)) penetrated-by) (penetrate flop)) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-trap-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj notify-actor) (entity-actor-lookup entity 'alt-actor 0)) - (let ((channel (-> obj skel root-channel 0))) - (set! (-> channel frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> this notify-actor) (entity-actor-lookup entity 'alt-actor 0)) + (let ((channel (-> this skel root-channel 0))) + (set! (-> channel frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> channel frame-num) 0.0) (joint-control-channel-group! channel - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -216,16 +216,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type water-anim-fortress -(defmethod inspect water-anim-fortress ((obj water-anim-fortress)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-anim-fortress ((this water-anim-fortress)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol ripple-for-water-anim-fortress, type ripple-wave-set @@ -244,14 +244,14 @@ This commonly includes things such as: ;; definition for method 24 of type water-anim-fortress ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-fortress ((obj water-anim-fortress)) +(defmethod init-water! water-anim-fortress ((this water-anim-fortress)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((parent-method (method-of-type water-anim init-water!))) - (parent-method obj) + (parent-method this) ) (let ((ripple (new 'process 'ripple-control))) - (set! (-> obj draw ripple) ripple) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) ripple) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> ripple global-scale) 3072.0) (set! (-> ripple close-fade-dist) 163840.0) (set! (-> ripple far-fade-dist) 245760.0) diff --git a/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc index f28f9c6ac9..526fa5cc2d 100644 --- a/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc @@ -218,18 +218,18 @@ ) ;; definition for method 3 of type prsn-hang-cell -(defmethod inspect prsn-hang-cell ((obj prsn-hang-cell)) - (when (not obj) - (set! obj obj) +(defmethod inspect prsn-hang-cell ((this prsn-hang-cell)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-du: ~f~%" (-> this path-du)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -242,7 +242,7 @@ (defstate idle (prsn-hang-cell) :virtual #t :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let* ((f0-2 (* (/ 1.0 (-> self path-du)) (-> self path-u))) (f0-3 (- f0-2 (* (the float (the int (/ f0-2 1.0))) 1.0))) ) @@ -258,7 +258,7 @@ (seek! (-> self path-u) 1.0 (* (-> self path-du) (seconds-per-frame))) (when (>= (-> self path-u) 1.0) (set! (-> self path-u) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-u) 'interp) (ja-post) @@ -267,30 +267,30 @@ ;; definition for method 11 of type prsn-hang-cell ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-hang-cell ((obj prsn-hang-cell) (arg0 entity-actor)) +(defmethod init-from-entity! prsn-hang-cell ((this prsn-hang-cell) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-hang-cell" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-du) 0.01) - (let ((f0-2 (* 300.0 (/ 1.0 (-> obj path-du)))) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-du) 0.01) + (let ((f0-2 (* 300.0 (/ 1.0 (-> this path-du)))) (f1-3 (the float (current-time))) ) - (set! (-> obj path-u) (/ (- f1-3 (* (the float (the int (/ f1-3 f0-2))) f0-2)) f0-2)) + (set! (-> this path-u) (/ (- f1-3 (* (the float (the int (/ f1-3 f0-2))) f0-2)) f0-2)) ) - (let* ((f30-0 (-> obj path-u)) + (let* ((f30-0 (-> this path-u)) (f28-0 8.0) (f26-0 (/ 1.0 f28-0)) ) @@ -302,11 +302,11 @@ This commonly includes things such as: (+ -1.0 f30-0) f30-0 ) - :to obj + :to this ) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -346,22 +346,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type warp-gate-b -(defmethod inspect warp-gate-b ((obj warp-gate-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect warp-gate-b ((this warp-gate-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type warp-gate inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 23 of type warp-gate-b ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-skel-and-collide warp-gate-b ((obj warp-gate-b)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) +(defmethod init-skel-and-collide warp-gate-b ((this warp-gate-b)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -376,10 +376,10 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-warp-gate-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -401,18 +401,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type prsn-cell-door -(defmethod inspect prsn-cell-door ((obj prsn-cell-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect prsn-cell-door ((this prsn-cell-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tframe: ~f~%" (-> obj frame)) - (format #t "~2Tdesired: ~f~%" (-> obj desired)) + (format #t "~2Tframe: ~f~%" (-> this frame)) + (format #t "~2Tdesired: ~f~%" (-> this desired)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -458,14 +458,14 @@ This commonly includes things such as: ;; definition for method 11 of type prsn-cell-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-cell-door ((obj prsn-cell-door) (arg0 entity-actor)) +(defmethod init-from-entity! prsn-cell-door ((this prsn-cell-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -480,18 +480,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-cell-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj frame) 0.0) - (set! (-> obj desired) 0.0) - (set! (-> obj draw light-index) (the-as uint 10)) - (go (method-of-object obj idle)) + (set! (-> this frame) 0.0) + (set! (-> this desired) 0.0) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) (none) ) @@ -508,16 +508,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type prsn-vent-fan -(defmethod inspect prsn-vent-fan ((obj prsn-vent-fan)) - (when (not obj) - (set! obj obj) +(defmethod inspect prsn-vent-fan ((this prsn-vent-fan)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -545,22 +545,22 @@ This commonly includes things such as: ;; definition for method 11 of type prsn-vent-fan ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-vent-fan ((obj prsn-vent-fan) (arg0 entity-actor)) +(defmethod init-from-entity! prsn-vent-fan ((this prsn-vent-fan) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-vent-fan" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) (none) ) @@ -577,16 +577,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type prsn-torture -(defmethod inspect prsn-torture ((obj prsn-torture)) - (when (not obj) - (set! obj obj) +(defmethod inspect prsn-torture ((this prsn-torture)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -610,14 +610,14 @@ This commonly includes things such as: ;; definition for method 11 of type prsn-torture ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! prsn-torture ((obj prsn-torture) (arg0 entity-actor)) +(defmethod init-from-entity! prsn-torture ((this prsn-torture) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s4-0 total-prims) (the-as uint 10)) @@ -697,16 +697,16 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-30 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-30 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-prsn-torture" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/prison/prison-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/prison/prison-part_REF.gc index 6855756d2b..e138fafedd 100644 --- a/test/decompiler/reference/jak2/levels/fortress/prison/prison-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/prison/prison-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type prison-part -(defmethod inspect prison-part ((obj prison-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect prison-part ((this prison-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 7c4041e218..f483855397 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 @@ -38,17 +38,17 @@ ) ;; definition for method 3 of type fort-elec-button -(defmethod inspect fort-elec-button ((obj fort-elec-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-elec-button ((this fort-elec-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type cty-guard-turret-button inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tstart-up?: ~A~%" (-> obj start-up?)) + (format #t "~2Tstart-up?: ~A~%" (-> this start-up?)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -72,29 +72,29 @@ ;; definition for method 33 of type fort-elec-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 fort-elec-button ((obj fort-elec-button)) +(defmethod basebutton-method-33 fort-elec-button ((this fort-elec-button)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-elec-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) (cond - ((-> obj start-up?) - (let ((a0-4 (-> obj skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + ((-> this start-up?) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-4 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) ) (else - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) ) ) @@ -104,32 +104,32 @@ ;; definition for method 35 of type fort-elec-button ;; WARN: Return type mismatch process-mask vs none. -(defmethod prepare-trigger-event! fort-elec-button ((obj fort-elec-button)) +(defmethod prepare-trigger-event! fort-elec-button ((this fort-elec-button)) "Sets `event-going-down` to `'trigger`" - (set! (-> obj start-up?) (= 1 (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0))) - (set! (-> obj event-going-down) 'trigger) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this start-up?) (= 1 (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0))) + (set! (-> this event-going-down) 'trigger) + (process-entity-status! this (entity-perm-status no-kill) #t) + (logclear! (-> this mask) (process-mask actor-pause)) (none) ) ;; definition for method 32 of type fort-elec-button -(defmethod idle-state-transition fort-elec-button ((obj fort-elec-button)) +(defmethod idle-state-transition fort-elec-button ((this fort-elec-button)) "If `button-status` has [[button-status:0]] set, transition to [[basebutton::27]] otherwise, [[basebutton::30]]" (cond - ((-> obj start-up?) - (let ((s5-0 (-> obj skel root-channel 0))) + ((-> this start-up?) + (let ((s5-0 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-0 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-0 frame-num) 0.0) ) - (go (method-of-object obj up-idle)) + (go (method-of-object this up-idle)) ) (else - (go (method-of-object obj waiting)) + (go (method-of-object this waiting)) ) ) ) @@ -149,17 +149,17 @@ ) ;; definition for method 3 of type fort-led -(defmethod inspect fort-led ((obj fort-led)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-led ((this fort-led)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbutton-actor: ~A~%" (-> obj button-actor)) + (format #t "~2Tbutton-actor: ~A~%" (-> this button-actor)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -204,26 +204,26 @@ ;; definition for method 11 of type fort-led ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-led ((obj fort-led) (arg0 entity-actor)) +(defmethod init-from-entity! fort-led ((this fort-led) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-led" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj button-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (if (and (-> obj button-actor) - (logtest? (-> obj button-actor extra perm status) (entity-perm-status subtask-complete)) + (set! (-> this button-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (if (and (-> this button-actor) + (logtest? (-> this button-actor extra perm status) (entity-perm-status subtask-complete)) ) - (go (method-of-object obj green)) - (go (method-of-object obj red)) + (go (method-of-object this green)) + (go (method-of-object this red)) ) (none) ) @@ -245,22 +245,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type elec-lock-gate -(defmethod inspect elec-lock-gate ((obj elec-lock-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect elec-lock-gate ((this elec-lock-gate)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type fort-elec-gate inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Tall-gone?: ~A~%" (-> obj all-gone?)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tall-gone?: ~A~%" (-> this all-gone?)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -289,7 +289,7 @@ This commonly includes things such as: (when (and a0-0 (< 81920.0 (vector-vector-distance (get-trans a0-0 0) (-> self root trans)))) (set! (-> self quality-enabled?) #f) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.5)) + (until (time-elapsed? gp-1 (seconds 0.5)) (suspend) ) ) @@ -298,7 +298,7 @@ This commonly includes things such as: (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) (process-grab? *target* #f) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 2)) + (until (time-elapsed? gp-2 (seconds 2)) (suspend) ) ) @@ -396,7 +396,7 @@ This commonly includes things such as: :code (behavior () (until (-> self all-gone?) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.5)) + (until (time-elapsed? gp-0 (seconds 0.5)) (suspend) ) ) @@ -414,10 +414,10 @@ This commonly includes things such as: ) ;; definition for method 31 of type elec-lock-gate -(defmethod elec-lock-gate-method-31 elec-lock-gate ((obj elec-lock-gate) (arg0 symbol)) - (dotimes (v1-0 (-> obj actor-group-count)) - (dotimes (a2-0 (-> obj actor-group v1-0 length)) - (when (or (not arg0) (let ((a3-5 (-> obj actor-group v1-0 data a2-0 actor))) +(defmethod elec-lock-gate-method-31 elec-lock-gate ((this elec-lock-gate) (arg0 symbol)) + (dotimes (v1-0 (-> this actor-group-count)) + (dotimes (a2-0 (-> this actor-group v1-0 length)) + (when (or (not arg0) (let ((a3-5 (-> this actor-group v1-0 data a2-0 actor))) (!= (if a3-5 (-> a3-5 extra process) ) @@ -425,7 +425,7 @@ This commonly includes things such as: ) ) ) - (if (not (logtest? (-> obj actor-group v1-0 data a2-0 actor extra perm status) (entity-perm-status subtask-complete)) + (if (not (logtest? (-> this actor-group v1-0 data a2-0 actor extra perm status) (entity-perm-status subtask-complete)) ) (return #f) ) @@ -437,14 +437,14 @@ This commonly includes things such as: ;; definition for method 26 of type elec-lock-gate ;; WARN: Return type mismatch object vs none. -(defmethod set-state! elec-lock-gate ((obj elec-lock-gate)) +(defmethod set-state! elec-lock-gate ((this elec-lock-gate)) "If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed make the gate `idle`. Otherwise, the gate will be `active`." - (if (elec-lock-gate-method-31 obj #f) - (go (method-of-object obj shutdown)) - ((method-of-type fort-elec-gate set-state!) obj) + (if (elec-lock-gate-method-31 this #f) + (go (method-of-object this shutdown)) + ((method-of-type fort-elec-gate set-state!) this) ) (none) ) @@ -452,23 +452,23 @@ Otherwise, the gate will be `active`." ;; definition for method 25 of type elec-lock-gate ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-palette! elec-lock-gate ((obj elec-lock-gate)) +(defmethod set-palette! elec-lock-gate ((this elec-lock-gate)) "Sets the [[elec-gate]]'s `palette-id` appropriately" (local-vars (sv-16 res-tag)) (let ((t9-0 (method-of-type fort-elec-gate set-palette!))) - (t9-0 obj) + (t9-0 this) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-4 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-4 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-4 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-4)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-4)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-part_REF.gc index 71e27b9149..db16483e2c 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forresca-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type forresca-part -(defmethod inspect forresca-part ((obj forresca-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect forresca-part ((this forresca-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1558,11 +1558,10 @@ ) ;; definition for method 24 of type fort-elec-gate -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch int vs none. -(defmethod elec-gate-method-24 fort-elec-gate ((obj fort-elec-gate)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 653) obj)) - (set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 654) obj)) +(defmethod elec-gate-method-24 fort-elec-gate ((this fort-elec-gate)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 653) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 654) this)) 0 (none) ) 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 eb725e4874..d824e2a87f 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 @@ -16,18 +16,18 @@ ) ;; definition for method 3 of type fort-twist-rail -(defmethod inspect fort-twist-rail ((obj fort-twist-rail)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-twist-rail ((this fort-twist-rail)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -51,14 +51,14 @@ ;; definition for method 11 of type fort-twist-rail ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-twist-rail ((obj fort-twist-rail) (arg0 entity-actor)) +(defmethod init-from-entity! fort-twist-rail ((this fort-twist-rail) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -93,15 +93,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fort-twist-rail" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) + (quaternion-copy! (-> this init-quat) (-> this root quat)) (let ((a1-14 (new 'stack-no-clear 'sync-info-params))) (let ((v1-26 0)) (if #t @@ -111,21 +111,21 @@ This commonly includes things such as: (set! (-> a1-14 sync-flags) (the-as sync-flags v1-26)) ) (set! (-> a1-14 period) (the-as uint 900)) - (set! (-> a1-14 entity) (-> obj entity)) + (set! (-> a1-14 entity) (-> this entity)) (set! (-> a1-14 percent) 0.0) (set! (-> a1-14 ease-in) 0.15) (set! (-> a1-14 ease-out) 0.15) (set! (-> a1-14 pause-in) 0.0) (set! (-> a1-14 pause-out) 0.0) - (initialize! (-> obj sync) a1-14) + (initialize! (-> this sync) a1-14) ) - (let ((a0-29 (-> obj skel root-channel 0))) - (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-29 (-> this skel root-channel 0))) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-29 frame-num) 0.0) - (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -151,23 +151,23 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-elec-belt-inst -(defmethod inspect fort-elec-belt-inst ((obj fort-elec-belt-inst)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-elec-belt-inst ((this fort-elec-belt-inst)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tl-spec: ~A~%" (-> obj l-spec)) - (format #t "~2Tl-bolt: ~A~%" (-> obj l-bolt)) - (format #t "~2Tpoints[17] @ #x~X~%" (-> obj points)) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tl-spec: ~A~%" (-> this l-spec)) + (format #t "~2Tl-bolt: ~A~%" (-> this l-bolt)) + (format #t "~2Tpoints[17] @ #x~X~%" (-> this points)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-du: ~f~%" (-> this path-du)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -419,17 +419,17 @@ This commonly includes things such as: ;; definition for method 7 of type fort-elec-belt-inst ;; WARN: Return type mismatch process-drawable vs fort-elec-belt-inst. -(defmethod relocate fort-elec-belt-inst ((obj fort-elec-belt-inst) (arg0 int)) - (if (nonzero? (-> obj l-bolt)) - (&+! (-> obj l-bolt) arg0) +(defmethod relocate fort-elec-belt-inst ((this fort-elec-belt-inst) (arg0 int)) + (if (nonzero? (-> this l-bolt)) + (&+! (-> this l-bolt) arg0) ) - (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) obj arg0)) + (the-as fort-elec-belt-inst ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type fort-elec-belt-inst -(defmethod deactivate fort-elec-belt-inst ((obj fort-elec-belt-inst)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method fort-elec-belt-inst 10)) obj) +(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) (none) ) @@ -498,23 +498,23 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-elec-belt -(defmethod inspect fort-elec-belt ((obj fort-elec-belt)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-elec-belt ((this fort-elec-belt)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tl-spec: ~A~%" (-> obj l-spec)) - (format #t "~2Tnext-spawn-time: ~D~%" (-> obj next-spawn-time)) - (format #t "~2Tpath: ~A~%" (-> obj path)) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) + (format #t "~2Tl-spec: ~A~%" (-> this l-spec)) + (format #t "~2Tnext-spawn-time: ~D~%" (-> this next-spawn-time)) + (format #t "~2Tpath: ~A~%" (-> this path)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tpath-du: ~f~%" (-> this path-du)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -552,9 +552,9 @@ This commonly includes things such as: ;; definition for method 15 of type fort-elec-belt ;; WARN: Return type mismatch symbol vs none. -(defmethod fort-elec-belt-method-15 fort-elec-belt ((obj fort-elec-belt)) - (let* ((f28-0 (total-distance (-> obj path))) - (s5-0 (-> obj sync)) +(defmethod fort-elec-belt-method-15 fort-elec-belt ((this fort-elec-belt)) + (let* ((f28-0 (total-distance (-> this path))) + (s5-0 (-> this sync)) (f26-0 81.92) (a0-3 (- (current-time) (get-timeframe-offset! s5-0 0))) (v1-6 (-> s5-0 period)) @@ -565,12 +565,12 @@ This commonly includes things such as: (if (>= f30-0 0.0) (process-spawn fort-elec-belt-inst - (-> obj init-quat) + (-> this init-quat) f30-0 - (-> obj path-du) - (-> obj l-spec) - (-> obj attack-id) - :to obj + (-> this path-du) + (-> this l-spec) + (-> this attack-id) + :to this ) ) (+! f30-0 f28-1) @@ -581,17 +581,17 @@ This commonly includes things such as: ;; definition for method 7 of type fort-elec-belt ;; WARN: Return type mismatch process vs fort-elec-belt. -(defmethod relocate fort-elec-belt ((obj fort-elec-belt) (arg0 int)) - (if (nonzero? (-> obj path)) - (&+! (-> obj path) arg0) +(defmethod relocate fort-elec-belt ((this fort-elec-belt) (arg0 int)) + (if (nonzero? (-> this path)) + (&+! (-> this path) arg0) ) - (the-as fort-elec-belt ((method-of-type process relocate) obj arg0)) + (the-as fort-elec-belt ((method-of-type process relocate) this arg0)) ) ;; definition for method 11 of type fort-elec-belt ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fort-elec-belt ((obj fort-elec-belt) (arg0 entity-actor)) +(defmethod init-from-entity! fort-elec-belt ((this fort-elec-belt) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -599,7 +599,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-64 int)) - (quaternion-copy! (-> obj init-quat) (-> arg0 quat)) + (quaternion-copy! (-> this init-quat) (-> arg0 quat)) (let ((s5-0 (new 'stack-no-clear 'sync-info-params))) (let ((s3-0 1200)) 0.0 @@ -621,41 +621,41 @@ This commonly includes things such as: (set! (-> s5-0 period) (the-as uint s3-0)) ) (set! (-> s5-0 percent) 0.0) - (initialize! (-> obj sync) s5-0) + (initialize! (-> this sync) s5-0) ) - (set! (-> obj l-spec) (new 'static 'lightning-spec - :name #f - :flags (lightning-spec-flags lsf2) - :rand-func #x2 - :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) - :end-color (new 'static 'rgba :a #x80) - :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) - :fade-start-factor 0.2 - :fade-time 120.0 - :texture (new 'static 'texture-id :index #x83 :page #xc) - :reduction 0.72 - :num-points 17 - :box-size 4997.12 - :merge-factor 0.32 - :merge-count 2 - :radius 7372.8 - :duration -1.0 - :sound #f - ) + (set! (-> this l-spec) (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :rand-func #x2 + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.72 + :num-points 17 + :box-size 4997.12 + :merge-factor 0.32 + :merge-count 2 + :radius 7372.8 + :duration -1.0 + :sound #f + ) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-du) (/ 24576.0 (total-distance (-> obj path)))) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-du) (/ 24576.0 (total-distance (-> this path)))) (let* ((v1-14 *game-info*) (a0-15 (+ (-> v1-14 attack-id) 1)) ) (set! (-> v1-14 attack-id) a0-15) - (set! (-> obj attack-id) a0-15) + (set! (-> this attack-id) a0-15) ) - (fort-elec-belt-method-15 obj) - (set! (-> obj next-spawn-time) (get-timeframe-offset! (-> obj sync) 0)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj idle)) + (fort-elec-belt-method-15 this) + (set! (-> this next-spawn-time) (get-timeframe-offset! (-> this sync) 0)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) (none) ) @@ -669,17 +669,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type fort-conveyor -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect fort-conveyor ((obj fort-conveyor)) - (when (not obj) - (set! obj obj) +(defmethod inspect fort-conveyor ((this fort-conveyor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type conveyor inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -689,18 +688,16 @@ This commonly includes things such as: ) ;; definition for method 22 of type fort-conveyor -;; INFO: this function exists in multiple non-identical object files -(defmethod get-art-group fort-conveyor ((obj fort-conveyor)) +(defmethod get-art-group fort-conveyor ((this fort-conveyor)) "@returns The respective [[art-group]] for the [[conveyor]]" (art-group-get-by-name *level* "skel-fort-conveyor" (the-as (pointer uint32) #f)) ) ;; definition for method 23 of type fort-conveyor -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod reset-root! fort-conveyor ((obj fort-conveyor)) +(defmethod reset-root! fort-conveyor ((this fort-conveyor)) "Re-initializes the `root` [[trsqv]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -721,37 +718,35 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; definition for method 24 of type fort-conveyor -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch vector vs none. -(defmethod init! fort-conveyor ((obj fort-conveyor)) +(defmethod init! fort-conveyor ((this fort-conveyor)) "Initializes defaults for things like the `speed` and `belt-radius`" - (set! (-> obj speed) -47104.0) - (set! (-> obj belt-radius) 24576.0) - (set! (-> obj pull-y-threshold) 4096.0) - (if (name= (-> obj name) "fort-conveyor-4") - (set-vector! (-> obj root scale) 0.8 0.0 0.657 1.0) + (set! (-> this speed) -47104.0) + (set! (-> this belt-radius) 24576.0) + (set! (-> this pull-y-threshold) 4096.0) + (if (name= (-> this name) "fort-conveyor-4") + (set-vector! (-> this root scale) 0.8 0.0 0.657 1.0) ) (none) ) ;; definition for method 25 of type fort-conveyor -;; INFO: this function exists in multiple non-identical object files -(defmethod set-and-get-ambient-sound! fort-conveyor ((obj fort-conveyor)) +(defmethod set-and-get-ambient-sound! fort-conveyor ((this fort-conveyor)) "So long as [[actor-option::16]] is not set, fetch the [[ambient-sound]] for the [[conveyor]] and return it as well. Otherwise, set it to `0`" - (let* ((s5-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 0.0 'interp)) - (v1-2 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) 1.0 'interp)) + (let* ((s5-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (v1-2 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) 1.0 'interp)) (a3-3 (vector+! (new 'stack-no-clear 'vector) s5-0 v1-2)) ) (vector-float*! a3-3 a3-3 0.5) (let ((v0-2 (new 'process 'ambient-sound (static-sound-spec "fort-conveyor" :fo-max 50) a3-3))) - (set! (-> obj sound) v0-2) + (set! (-> this sound) v0-2) v0-2 ) ) diff --git a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-part_REF.gc b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-part_REF.gc index 99a59a1267..b1161b8379 100644 --- a/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/rescue/forrescb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type forrescb-part -(defmethod inspect forrescb-part ((obj forrescb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect forrescb-part ((this forrescb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc index b670f89e07..6372f66ad9 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gun-dummy_REF.gc @@ -1523,19 +1523,19 @@ ) ;; definition for method 3 of type tpath-control-frame -(defmethod inspect tpath-control-frame ((obj tpath-control-frame)) - (when (not obj) - (set! obj obj) +(defmethod inspect tpath-control-frame ((this tpath-control-frame)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tpath-control-frame) - (format #t "~1Ttime: ~f~%" (-> obj time)) - (format #t "~1Tpath-pos: ~D~%" (-> obj path-pos)) - (format #t "~1Tcommand: ~D~%" (-> obj command)) - (format #t "~1Tmove-type: ~D~%" (-> obj move-type)) - (format #t "~1Tpath-num: ~D~%" (-> obj path-num)) + (format #t "[~8x] ~A~%" this 'tpath-control-frame) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tpath-pos: ~D~%" (-> this path-pos)) + (format #t "~1Tcommand: ~D~%" (-> this command)) + (format #t "~1Tmove-type: ~D~%" (-> this move-type)) + (format #t "~1Tpath-num: ~D~%" (-> this path-num)) (label cfg-4) - obj + this ) ;; definition of type tpath-info @@ -1559,26 +1559,26 @@ ) ;; definition for method 3 of type tpath-info -(defmethod inspect tpath-info ((obj tpath-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect tpath-info ((this tpath-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tpath-info) - (format #t "~1Ts-time: ~f~%" (-> obj s-time)) - (format #t "~1Tnum: ~D~%" (-> obj num)) - (format #t "~1Tref-time-num: ~D~%" (-> obj ref-time-num)) - (format #t "~1Tscore: ~D~%" (-> obj score)) - (format #t "~1Tflags: ~D~%" (-> obj flags)) - (format #t "~1Tnum-anims: ~D~%" (-> obj num-anims)) - (format #t "~1Tbonus-time: ~f~%" (-> obj bonus-time)) - (format #t "~1Tlist: ~A~%" (-> obj list)) - (format #t "~1Tanims[3] @ #x~X~%" (&-> obj anim1)) - (format #t "~1Tanim1: #x~X~%" (-> obj anim1)) - (format #t "~1Tanim2: #x~X~%" (-> obj anim2)) - (format #t "~1Tanim3: #x~X~%" (-> obj anim3)) + (format #t "[~8x] ~A~%" this 'tpath-info) + (format #t "~1Ts-time: ~f~%" (-> this s-time)) + (format #t "~1Tnum: ~D~%" (-> this num)) + (format #t "~1Tref-time-num: ~D~%" (-> this ref-time-num)) + (format #t "~1Tscore: ~D~%" (-> this score)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tnum-anims: ~D~%" (-> this num-anims)) + (format #t "~1Tbonus-time: ~f~%" (-> this bonus-time)) + (format #t "~1Tlist: ~A~%" (-> this list)) + (format #t "~1Tanims[3] @ #x~X~%" (&-> this anim1)) + (format #t "~1Tanim1: #x~X~%" (-> this anim1)) + (format #t "~1Tanim2: #x~X~%" (-> this anim2)) + (format #t "~1Tanim3: #x~X~%" (-> this anim3)) (label cfg-4) - obj + this ) ;; definition of type gun-dummy @@ -1621,38 +1621,38 @@ ) ;; definition for method 3 of type gun-dummy -(defmethod inspect gun-dummy ((obj gun-dummy)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-dummy ((this gun-dummy)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Ttrain-man: ~D~%" (-> obj train-man)) - (format #t "~2Tinfo: #~%" (-> obj info)) - (format #t "~2Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~2Trot-y-offset: ~f~%" (-> obj rot-y-offset)) - (format #t "~2Tquat: #~%" (-> obj quat)) - (format #t "~2Thit-points: ~D~%" (-> obj hit-points)) - (format #t "~2Tscore: ~f~%" (-> obj score)) - (format #t "~2Tpath-num: ~D~%" (-> obj path-num)) - (format #t "~2Tnext-spark: ~D~%" (-> obj next-spark)) - (format #t "~2Tinout-percent: ~f~%" (-> obj inout-percent)) - (format #t "~2Tquat-ground: #~%" (-> obj quat-ground)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tscore-speed: ~f~%" (-> obj score-speed)) - (format #t "~2Tfirst-time-command: ~A~%" (-> obj first-time-command)) - (format #t "~2Tcurrent: #~%" (-> obj current)) - (format #t "~2Timpact: #~%" (-> obj impact)) - (format #t "~2Tdone?: ~A~%" (-> obj done? value)) - (format #t "~2Tmove-sound: ~D~%" (-> obj move-sound)) - (format #t "~2Tturn-sound: ~D~%" (-> obj turn-sound)) - (format #t "~2Tspin-sound: ~D~%" (-> obj spin-sound)) - (format #t "~2Tlast-combo-time: ~D~%" (-> obj last-combo-time)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Ttrain-man: ~D~%" (-> this train-man)) + (format #t "~2Tinfo: #~%" (-> this info)) + (format #t "~2Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~2Trot-y-offset: ~f~%" (-> this rot-y-offset)) + (format #t "~2Tquat: #~%" (-> this quat)) + (format #t "~2Thit-points: ~D~%" (-> this hit-points)) + (format #t "~2Tscore: ~f~%" (-> this score)) + (format #t "~2Tpath-num: ~D~%" (-> this path-num)) + (format #t "~2Tnext-spark: ~D~%" (-> this next-spark)) + (format #t "~2Tinout-percent: ~f~%" (-> this inout-percent)) + (format #t "~2Tquat-ground: #~%" (-> this quat-ground)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tscore-speed: ~f~%" (-> this score-speed)) + (format #t "~2Tfirst-time-command: ~A~%" (-> this first-time-command)) + (format #t "~2Tcurrent: #~%" (-> this current)) + (format #t "~2Timpact: #~%" (-> this impact)) + (format #t "~2Tdone?: ~A~%" (-> this done? value)) + (format #t "~2Tmove-sound: ~D~%" (-> this move-sound)) + (format #t "~2Tturn-sound: ~D~%" (-> this turn-sound)) + (format #t "~2Tspin-sound: ~D~%" (-> this spin-sound)) + (format #t "~2Tlast-combo-time: ~D~%" (-> this last-combo-time)) (label cfg-4) - obj + this ) ;; definition for symbol *tpath-rand*, type uint @@ -2008,17 +2008,17 @@ ;; definition for method 32 of type gun-dummy ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy ((obj gun-dummy)) +(defmethod break-dummy gun-dummy ((this gun-dummy)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" 0 (none) ) ;; definition for method 30 of type gun-dummy -(defmethod path-time-elapsed gun-dummy ((obj gun-dummy)) +(defmethod path-time-elapsed gun-dummy ((this gun-dummy)) "@returns Calculates the combined total time across all control frames in the path" (let ((total-time 0.0)) - (let ((curr-frame (the-as tpath-control-frame (-> obj current)))) + (let ((curr-frame (the-as tpath-control-frame (-> this current)))) (loop (case (-> curr-frame command) (((tpath-command begin)) @@ -2056,7 +2056,7 @@ ;; definition for method 29 of type gun-dummy ;; INFO: Used lq/sq -(defmethod path-playing? gun-dummy ((obj gun-dummy)) +(defmethod path-playing? gun-dummy ((this gun-dummy)) "Core functionality for playing back the dummy's path. Does things like: - calculates the score in case the dummy is hit based on the time elapsed - moves around the dummy @@ -2074,31 +2074,31 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((curr-path-command (-> obj current)) + (let ((curr-path-command (-> this current)) (event-msg-block (new 'stack-no-clear 'event-message-block)) ) (set! (-> event-msg-block from) (process->ppointer pp)) (set! (-> event-msg-block num-params) 1) (set! (-> event-msg-block message) 'path) - (set! (-> event-msg-block param 0) (-> obj path-num)) - (let ((path (the-as path-control (send-event-function (handle->process (-> obj train-man)) event-msg-block))) - (f30-0 (* 0.0033333334 (the float (- (current-time) (-> obj state-time))))) + (set! (-> event-msg-block param 0) (-> this path-num)) + (let ((path (the-as path-control (send-event-function (handle->process (-> this train-man)) event-msg-block))) + (f30-0 (* 0.0033333334 (the float (- (current-time) (-> this state-time))))) ) (if (not path) (return #f) ) (case (-> curr-path-command 0 command) (((tpath-command arise)) - (set! (-> obj path-pos) (* 0.007843138 (the float (-> curr-path-command 0 path-pos)))) - (get-point-in-path! path (-> obj root trans) (-> obj path-pos) 'interp) - (+! (-> obj root trans y) (lerp-scale -16384.0 0.0 f30-0 0.0 (-> curr-path-command 0 time))) - (let* ((s3-0 (get-point-in-path! path (new 'stack-no-clear 'vector) (-> obj path-pos) 'interp)) + (set! (-> this path-pos) (* 0.007843138 (the float (-> curr-path-command 0 path-pos)))) + (get-point-in-path! path (-> this root trans) (-> this path-pos) 'interp) + (+! (-> this root trans y) (lerp-scale -16384.0 0.0 f30-0 0.0 (-> curr-path-command 0 time))) + (let* ((s3-0 (get-point-in-path! path (new 'stack-no-clear 'vector) (-> this path-pos) 'interp)) (v1-26 (get-point-in-path! path (new 'stack-no-clear 'vector) - (if (< (-> obj path-pos) 0.01) - (+ 0.1 (-> obj path-pos)) - (+ -0.1 (-> obj path-pos)) + (if (< (-> this path-pos) 0.01) + (+ 0.1 (-> this path-pos)) + (+ -0.1 (-> this path-pos)) ) 'interp ) @@ -2110,44 +2110,44 @@ (vector-negate-in-place! s4-2) ) (vector-normalize! s4-2 1.0) - (forward-up-nopitch->quaternion (-> obj quat-ground) s4-2 *up-vector*) + (forward-up-nopitch->quaternion (-> this quat-ground) s4-2 *up-vector*) ) - (quaternion-normalize! (-> obj quat-ground)) - (if (-> obj first-time-command) + (quaternion-normalize! (-> this quat-ground)) + (if (-> this first-time-command) (sound-play "target-up-slow") ) - (set! (-> obj first-time-command) #f) + (set! (-> this first-time-command) #f) (when (>= f30-0 (-> curr-path-command 0 time)) - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) - (set! (-> obj first-time-command) #t) - (set! (-> obj state-time) (current-time)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) + (set! (-> this first-time-command) #t) + (set-time! (-> this state-time)) ) (return #t) ret ) (((tpath-command lower)) - (get-point-in-path! path (-> obj root trans) (-> obj path-pos) 'interp) - (+! (-> obj root trans y) (lerp-scale 0.0 -16384.0 f30-0 0.0 (-> curr-path-command 0 time))) - (if (-> obj first-time-command) + (get-point-in-path! path (-> this root trans) (-> this path-pos) 'interp) + (+! (-> this root trans y) (lerp-scale 0.0 -16384.0 f30-0 0.0 (-> curr-path-command 0 time))) + (if (-> this first-time-command) (sound-play "target-dwn-slow") ) - (set! (-> obj first-time-command) #f) + (set! (-> this first-time-command) #f) (when (>= f30-0 (-> curr-path-command 0 time)) - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) - (set! (-> obj first-time-command) #t) - (set! (-> obj state-time) (current-time)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) + (set! (-> this first-time-command) #t) + (set-time! (-> this state-time)) ) (return #t) ret ) (((tpath-command align-with-track)) - (let ((s3-3 (get-point-in-path! path (new 'stack-no-clear 'vector) (-> obj path-pos) 'interp))) + (let ((s3-3 (get-point-in-path! path (new 'stack-no-clear 'vector) (-> this path-pos) 'interp))) (let* ((v1-68 (get-point-in-path! path (new 'stack-no-clear 'vector) - (if (< (-> obj path-pos) 0.01) - (+ 0.1 (-> obj path-pos)) - (+ -0.1 (-> obj path-pos)) + (if (< (-> this path-pos) 0.01) + (+ 0.1 (-> this path-pos)) + (+ -0.1 (-> this path-pos)) ) 'interp ) @@ -2159,25 +2159,25 @@ (vector-negate-in-place! s4-6) ) (vector-normalize! s4-6 1.0) - (forward-up-nopitch->quaternion (-> obj quat-ground) s4-6 *up-vector*) + (forward-up-nopitch->quaternion (-> this quat-ground) s4-6 *up-vector*) ) - (quaternion-normalize! (-> obj quat-ground)) - (set! (-> obj root trans quad) (-> s3-3 quad)) + (quaternion-normalize! (-> this quat-ground)) + (set! (-> this root trans quad) (-> s3-3 quad)) ) - (set! (-> obj inout-percent) (lerp-scale 0.0 1.0 f30-0 0.0 (-> curr-path-command 0 time))) - (set! (-> obj first-time-command) #f) + (set! (-> this inout-percent) (lerp-scale 0.0 1.0 f30-0 0.0 (-> curr-path-command 0 time))) + (set! (-> this first-time-command) #f) (when (>= f30-0 (-> curr-path-command 0 time)) - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) - (set! (-> obj inout-percent) 1.0) - (set! (-> obj first-time-command) #t) - (set! (-> obj state-time) (current-time)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) + (set! (-> this inout-percent) 1.0) + (set! (-> this first-time-command) #t) + (set-time! (-> this state-time)) ) (return #t) ret ) (((tpath-command translate)) - (set! (-> obj score) (- (-> obj score) (* (-> obj score-speed) (seconds-per-frame)))) - (set! (-> obj inout-percent) (fmax 0.0 (- (-> obj inout-percent) (* 4.0 (seconds-per-frame))))) + (set! (-> this score) (- (-> this score) (* (-> this score-speed) (seconds-per-frame)))) + (set! (-> this inout-percent) (fmax 0.0 (- (-> this inout-percent) (* 4.0 (seconds-per-frame))))) (let ((s2-4 (new 'stack-no-clear 'vector)) (s3-4 (new 'stack-no-clear 'vector)) (f28-2 (lerp-scale 0.0 1.0 f30-0 0.0 (-> curr-path-command 0 time))) @@ -2197,13 +2197,13 @@ ) ) ) - (get-point-in-path! path s2-4 (-> obj path-pos) 'interp) + (get-point-in-path! path s2-4 (-> this path-pos) 'interp) (get-point-in-path! path s3-4 (* 0.007843138 (the float (-> curr-path-command 0 path-pos))) 'interp) (let ((v1-102 (new 'stack-no-clear 'vector))) - (set! (-> v1-102 quad) (-> obj root trans quad)) - (vector-float*! (-> obj root trans) s2-4 (- 1.0 f28-2)) - (let ((a0-63 (-> obj root trans))) - (let ((a1-23 (-> obj root trans))) + (set! (-> v1-102 quad) (-> this root trans quad)) + (vector-float*! (-> this root trans) s2-4 (- 1.0 f28-2)) + (let ((a0-63 (-> this root trans))) + (let ((a1-23 (-> this root trans))) (let ((a2-17 f28-2)) (.mov vf7 a2-17) ) @@ -2215,8 +2215,8 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> a0-63 quad) vf6) ) - (let ((a0-65 (-> obj root transv))) - (.lvf vf1 (&-> (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) v1-102) quad)) + (let ((a0-65 (-> this root transv))) + (.lvf vf1 (&-> (vector-! (new 'stack-no-clear 'vector) (-> this root trans) v1-102) quad)) (let ((f0-50 (-> pp clock frames-per-second))) (.mov at-0 f0-50) ) @@ -2227,44 +2227,44 @@ ) ) ) - (if (zero? (-> obj move-sound)) - (set! (-> obj move-sound) (new-sound-id)) + (if (zero? (-> this move-sound)) + (set! (-> this move-sound) (new-sound-id)) ) (let ((s4-7 (static-sound-spec "target-mov-slow" :volume 100.0 :fo-max 60 :mask (pitch)))) - (set! (-> s4-7 pitch-mod) (the int (lerp-scale -1.0 1.0 (vector-length (-> obj root transv)) 0.0 81920.0))) - (sound-play-by-spec s4-7 (-> obj move-sound) (-> obj root trans)) + (set! (-> s4-7 pitch-mod) (the int (lerp-scale -1.0 1.0 (vector-length (-> this root transv)) 0.0 81920.0))) + (sound-play-by-spec s4-7 (-> this move-sound) (-> this root trans)) ) - (when (< (-> obj next-spark) (current-time)) - (set! (-> obj next-spark) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.0 0.3)))))) - (spawn (-> obj part) (-> obj root trans)) + (when (< (-> this next-spark) (current-time)) + (set! (-> this next-spark) (the-as int (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.0 0.3)))))) + (spawn (-> this part) (-> this root trans)) ) - (set! (-> obj first-time-command) #f) + (set! (-> this first-time-command) #f) (when (>= f30-0 (-> curr-path-command 0 time)) - (when (nonzero? (-> obj move-sound)) - (sound-stop (-> obj move-sound)) - (set! (-> obj move-sound) (new 'static 'sound-id)) + (when (nonzero? (-> this move-sound)) + (sound-stop (-> this move-sound)) + (set! (-> this move-sound) (new 'static 'sound-id)) 0 ) (sound-play "target-stop") - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) - (set! (-> obj path-pos) (* 0.007843138 (the float (-> curr-path-command 0 path-pos)))) - (set! (-> obj first-time-command) #t) - (set! (-> obj state-time) (current-time)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) + (set! (-> this path-pos) (* 0.007843138 (the float (-> curr-path-command 0 path-pos)))) + (set! (-> this first-time-command) #t) + (set-time! (-> this state-time)) ) (return #t) ret ) (((tpath-command wait)) - (set! (-> obj score) (- (-> obj score) (* (-> obj score-speed) (seconds-per-frame)))) - (set! (-> obj inout-percent) (fmax 0.0 (- (-> obj inout-percent) (* 4.0 (seconds-per-frame))))) - (get-point-in-path! path (-> obj root trans) (-> obj path-pos) 'interp) - (set! (-> obj first-time-command) #f) - (when (or (and (= (-> curr-path-command 0 time) -1.0) (< (-> obj hit-points) 0)) + (set! (-> this score) (- (-> this score) (* (-> this score-speed) (seconds-per-frame)))) + (set! (-> this inout-percent) (fmax 0.0 (- (-> this inout-percent) (* 4.0 (seconds-per-frame))))) + (get-point-in-path! path (-> this root trans) (-> this path-pos) 'interp) + (set! (-> this first-time-command) #f) + (when (or (and (= (-> curr-path-command 0 time) -1.0) (< (-> this hit-points) 0)) (and (!= (-> curr-path-command 0 time) -1.0) (>= f30-0 (-> curr-path-command 0 time))) ) - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) - (set! (-> obj first-time-command) #t) - (set! (-> obj state-time) (current-time)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) + (set! (-> this first-time-command) #t) + (set-time! (-> this state-time)) ) (return #t) ret @@ -2282,9 +2282,9 @@ ;; definition for method 20 of type gun-dummy ;; INFO: Used lq/sq -(defmethod get-trans gun-dummy ((obj gun-dummy) (arg0 int)) +(defmethod get-trans gun-dummy ((this gun-dummy) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" - (let ((root (-> obj root))) + (let ((root (-> this root))) (case arg0 ((3 2) (let ((vec (new 'static 'vector :w 1.0))) @@ -2306,7 +2306,7 @@ :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (case message (('combo) - (set! (-> self last-combo-time) (current-time)) + (set-time! (-> self last-combo-time)) #t ) (('track) @@ -2357,7 +2357,7 @@ ) (else (if (and (logtest? (process-mask projectile) (-> proc-draw mask)) - (< (- (current-time) (-> self last-combo-time)) (seconds 1)) + (not (time-elapsed? (-> self last-combo-time) (seconds 1))) ) (send-event (ppointer->process (-> self parent)) 'combo) ) @@ -2376,7 +2376,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self inout-percent) 1.0) (set! (-> self y-offset) 0.0) (set! (-> self rot-y-offset) 0.0) @@ -2439,9 +2439,9 @@ ;; definition for method 28 of type gun-dummy ;; WARN: Return type mismatch int vs none. -(defmethod init-dummy-collison! gun-dummy ((obj gun-dummy)) +(defmethod init-dummy-collison! gun-dummy ((this gun-dummy)) "Initializes the collision related stuff for the dummy" - (let ((cshape-moving (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape-moving (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape-moving dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape-moving reaction) cshape-reaction-default) (set! (-> cshape-moving no-reaction) @@ -2461,7 +2461,7 @@ (set! (-> cshape-moving backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape-moving backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape-moving) + (set! (-> this root) cshape-moving) ) 0 (none) @@ -2469,69 +2469,69 @@ ;; definition for method 7 of type gun-dummy ;; WARN: Return type mismatch process-focusable vs gun-dummy. -(defmethod relocate gun-dummy ((obj gun-dummy) (arg0 int)) - (the-as gun-dummy ((method-of-type process-focusable relocate) obj arg0)) +(defmethod relocate gun-dummy ((this gun-dummy) (arg0 int)) + (the-as gun-dummy ((method-of-type process-focusable relocate) this arg0)) ) ;; definition for method 11 of type gun-dummy ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gun-dummy ((obj gun-dummy) (arg0 entity-actor)) +(defmethod init-from-entity! gun-dummy ((this gun-dummy) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-dummy-collison! obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (init-dummy-collison! this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gun-dummy" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) ;; definition for method 31 of type gun-dummy ;; WARN: Return type mismatch int vs none. -(defmethod init-tpath-info! gun-dummy ((obj gun-dummy) (arg0 tpath-info)) +(defmethod init-tpath-info! gun-dummy ((this gun-dummy) (arg0 tpath-info)) "Given a [[tpath-info]] use it to initialize the dummy with any relevant data or flags" - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask collectable)) - (vector-identity! (-> obj root scale)) - (quaternion-copy! (-> obj quat) (-> obj root quat)) - (+! (-> obj root trans y) -16384.0) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask collectable)) + (vector-identity! (-> this root scale)) + (quaternion-copy! (-> this quat) (-> this root quat)) + (+! (-> this root trans y) -16384.0) (if (not (logtest? (-> arg0 flags) (tpath-flags tpath-rand))) (set! *tpath-rand* (the-as uint (rand-vu-int-count 16))) ) - (set! (-> obj current) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> (the-as (inline-array tpath-control-frame) (-> arg0 anims (mod *tpath-rand* (-> arg0 num-anims)))) 0) ) ) - (let ((path (-> obj current))) + (let ((path (-> this current))) (when (= (-> path 0 command) (tpath-command begin)) - (set! (-> obj path-num) (-> path 0 path-num)) - (set! (-> obj current) (the-as (inline-array tpath-control-frame) (-> obj current 1))) + (set! (-> this path-num) (-> path 0 path-num)) + (set! (-> this current) (the-as (inline-array tpath-control-frame) (-> this current 1))) ) ) - (set! (-> obj score) (the float (-> arg0 score))) + (set! (-> this score) (the float (-> arg0 score))) (if (logtest? (-> arg0 flags) (tpath-flags citizen)) - (set! (-> obj score-speed) 0.0) - (set! (-> obj score-speed) (/ (-> obj score) (path-time-elapsed obj))) + (set! (-> this score-speed) 0.0) + (set! (-> this score-speed) (/ (-> this score) (path-time-elapsed this))) ) - (set! (-> obj hit-points) (if (logtest? (-> arg0 flags) (tpath-flags big)) - 2 - 1 - ) + (set! (-> this hit-points) (if (logtest? (-> arg0 flags) (tpath-flags big)) + 2 + 1 + ) ) - (set! (-> obj info) arg0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 519) obj)) - (set! (-> obj next-spark) 0) + (set! (-> this info) arg0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 519) this)) + (set! (-> this next-spark) 0) 0 (none) ) @@ -2546,16 +2546,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type gun-dummy-a -(defmethod inspect gun-dummy-a ((obj gun-dummy-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-dummy-a ((this gun-dummy-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gun-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type gun-dummy-b @@ -2568,16 +2568,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type gun-dummy-b -(defmethod inspect gun-dummy-b ((obj gun-dummy-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-dummy-b ((this gun-dummy-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gun-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type gun-dummy-c @@ -2590,16 +2590,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type gun-dummy-c -(defmethod inspect gun-dummy-c ((obj gun-dummy-c)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-dummy-c ((this gun-dummy-c)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gun-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type gun-dummy-big @@ -2612,16 +2612,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type gun-dummy-big -(defmethod inspect gun-dummy-big ((obj gun-dummy-big)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-dummy-big ((this gun-dummy-big)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gun-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type gun-dummy-gold @@ -2634,16 +2634,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type gun-dummy-gold -(defmethod inspect gun-dummy-gold ((obj gun-dummy-gold)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-dummy-gold ((this gun-dummy-gold)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gun-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type gun-dummy-peace @@ -2656,16 +2656,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type gun-dummy-peace -(defmethod inspect gun-dummy-peace ((obj gun-dummy-peace)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-dummy-peace ((this gun-dummy-peace)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gun-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type gun-cit-a @@ -2678,16 +2678,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type gun-cit-a -(defmethod inspect gun-cit-a ((obj gun-cit-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-cit-a ((this gun-cit-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gun-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type gun-cit-b @@ -2700,16 +2700,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type gun-cit-b -(defmethod inspect gun-cit-b ((obj gun-cit-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-cit-b ((this gun-cit-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gun-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type gun-cit-c @@ -2722,16 +2722,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type gun-cit-c -(defmethod inspect gun-cit-c ((obj gun-cit-c)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-cit-c ((this gun-cit-c)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gun-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type gun-cit-d @@ -2744,33 +2744,33 @@ This commonly includes things such as: ) ;; definition for method 3 of type gun-cit-d -(defmethod inspect gun-cit-d ((obj gun-cit-d)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-cit-d ((this gun-cit-d)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gun-dummy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 32 of type gun-dummy-a ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-a ((obj gun-dummy-a)) +(defmethod break-dummy gun-dummy-a ((this gun-dummy-a)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (set! (-> exploder-tuning fountain-rand-transv-hi x) 4096.0) (set! (-> exploder-tuning fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -2781,7 +2781,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2790,7 +2790,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-a-exploder-params* - :to obj + :to this ) ) 0 @@ -2800,18 +2800,18 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-b ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-b ((obj gun-dummy-b)) +(defmethod break-dummy gun-dummy-b ((this gun-dummy-b)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (process-spawn part-tracker :init part-tracker-init @@ -2820,7 +2820,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2829,7 +2829,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-b-exploder-params* - :to obj + :to this ) ) 0 @@ -2839,18 +2839,18 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-c ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-c ((obj gun-dummy-c)) +(defmethod break-dummy gun-dummy-c ((this gun-dummy-c)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (process-spawn part-tracker :init part-tracker-init @@ -2859,7 +2859,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2868,7 +2868,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-c-exploder-params* - :to obj + :to this ) ) 0 @@ -2878,18 +2878,18 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-big ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-big ((obj gun-dummy-big)) +(defmethod break-dummy gun-dummy-big ((this gun-dummy-big)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (process-spawn part-tracker :init part-tracker-init @@ -2898,7 +2898,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2907,7 +2907,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-big-exploder-params* - :to obj + :to this ) ) 0 @@ -2917,18 +2917,18 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-gold ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-gold ((obj gun-dummy-gold)) +(defmethod break-dummy gun-dummy-gold ((this gun-dummy-gold)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-bonus") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (process-spawn part-tracker :init part-tracker-init @@ -2937,7 +2937,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2946,7 +2946,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-gold-exploder-params* - :to obj + :to this ) ) 0 @@ -2956,18 +2956,18 @@ This commonly includes things such as: ;; definition for method 32 of type gun-dummy-peace ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-dummy-peace ((obj gun-dummy-peace)) +(defmethod break-dummy gun-dummy-peace ((this gun-dummy-peace)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (process-spawn part-tracker :init part-tracker-init @@ -2976,7 +2976,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -2985,7 +2985,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-dummy-peace-exploder-params* - :to obj + :to this ) ) 0 @@ -2995,18 +2995,18 @@ This commonly includes things such as: ;; definition for method 32 of type gun-cit-a ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-cit-a ((obj gun-cit-a)) +(defmethod break-dummy gun-cit-a ((this gun-cit-a)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (set! (-> exploder-tuning fountain-rand-transv-hi x) 4096.0) (set! (-> exploder-tuning fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -3017,7 +3017,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -3026,7 +3026,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-cit-a-exploder-params* - :to obj + :to this ) ) 0 @@ -3036,18 +3036,18 @@ This commonly includes things such as: ;; definition for method 32 of type gun-cit-b ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-cit-b ((obj gun-cit-b)) +(defmethod break-dummy gun-cit-b ((this gun-cit-b)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (set! (-> exploder-tuning fountain-rand-transv-hi x) 4096.0) (set! (-> exploder-tuning fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -3058,7 +3058,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -3067,7 +3067,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-cit-b-exploder-params* - :to obj + :to this ) ) 0 @@ -3077,18 +3077,18 @@ This commonly includes things such as: ;; definition for method 32 of type gun-cit-c ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-cit-c ((obj gun-cit-c)) +(defmethod break-dummy gun-cit-c ((this gun-cit-c)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (set! (-> exploder-tuning fountain-rand-transv-hi x) 4096.0) (set! (-> exploder-tuning fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -3099,7 +3099,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -3108,7 +3108,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-cit-c-exploder-params* - :to obj + :to this ) ) 0 @@ -3118,18 +3118,18 @@ This commonly includes things such as: ;; definition for method 32 of type gun-cit-d ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod break-dummy gun-cit-d ((obj gun-cit-d)) +(defmethod break-dummy gun-cit-d ((this gun-cit-d)) "Does what you'd expect, sets up the [[joint-exploder-tuning]] to break the dummy into pieces, plays sounds, etc" - (let ((root-prim (-> obj root root-prim))) + (let ((root-prim (-> this root root-prim))) (set! (-> root-prim prim-core collide-as) (collide-spec)) (set! (-> root-prim prim-core collide-with) (collide-spec)) ) 0 - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (sound-play "target-break") (let ((exploder-tuning (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> obj impact quad)) + (set! (-> exploder-tuning fountain-rand-transv-lo quad) (-> this impact quad)) (set! (-> exploder-tuning fountain-rand-transv-hi x) 4096.0) (set! (-> exploder-tuning fountain-rand-transv-hi y) 122880.0) (process-spawn @@ -3140,7 +3140,7 @@ This commonly includes things such as: #f #f #f - (-> obj node-list data 3 bone transform) + (-> this node-list data 3 bone transform) :to *entity-pool* ) (process-spawn @@ -3149,7 +3149,7 @@ This commonly includes things such as: 5 exploder-tuning *gun-cit-d-exploder-params* - :to obj + :to this ) ) 0 diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-data_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-data_REF.gc index ecb65fbd2b..40eb25fc56 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-data_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-data_REF.gc @@ -20,21 +20,21 @@ For example `20` would mean 4 red gun pickups, or 2 yellow gun pickups" ) ;; definition for method 3 of type gungame-crate -(defmethod inspect gungame-crate ((obj gungame-crate)) - (when (not obj) - (set! obj obj) +(defmethod inspect gungame-crate ((this gungame-crate)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gungame-crate) - (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tpos-x: ~f~%" (-> obj pos x)) - (format #t "~1Tpos-y: ~f~%" (-> obj pos y)) - (format #t "~1Tpos-z: ~f~%" (-> obj pos z)) - (format #t "~1Tangle: ~f~%" (-> obj pos w)) - (format #t "~1Tammo: ~D~%" (-> obj ammo)) - (format #t "~1Tnum: ~D~%" (-> obj num)) + (format #t "[~8x] ~A~%" this 'gungame-crate) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tpos-x: ~f~%" (-> this pos x)) + (format #t "~1Tpos-y: ~f~%" (-> this pos y)) + (format #t "~1Tpos-z: ~f~%" (-> this pos z)) + (format #t "~1Tangle: ~f~%" (-> this pos w)) + (format #t "~1Tammo: ~D~%" (-> this ammo)) + (format #t "~1Tnum: ~D~%" (-> this num)) (label cfg-4) - obj + this ) ;; definition for symbol *entrance-gungame-crates-pos*, type (array gungame-crate) @@ -12139,7 +12139,3 @@ For example `20` would mean 4 red gun pickups, or 2 yellow gun pickups" ) ) ) - - - - 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 e02cdee029..351b6c7f0c 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc @@ -15,17 +15,17 @@ ) ;; definition for method 3 of type training-path -(defmethod inspect training-path ((obj training-path)) - (when (not obj) - (set! obj obj) +(defmethod inspect training-path ((this training-path)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnum: ~D~%" (-> obj num)) + (format #t "~2Tnum: ~D~%" (-> this num)) (label cfg-4) - obj + this ) ;; definition of type training-manager @@ -94,83 +94,83 @@ ) ;; definition for method 3 of type training-manager -(defmethod inspect training-manager ((obj training-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect training-manager ((this training-manager)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) - (format #t "~2Tscore: ~D~%" (-> obj score)) - (format #t "~2Tfirst-enemy-shown?: ~A~%" (-> obj first-enemy-shown?)) - (format #t "~2Tfirst-citizen-shown?: ~A~%" (-> obj first-citizen-shown?)) - (format #t "~2Topen-end?: ~A~%" (-> obj open-end?)) - (format #t "~2Tentrance-crates[32] @ #x~X~%" (-> obj entrance-crates)) - (format #t "~2Tcourse-crates[32] @ #x~X~%" (-> obj course-crates)) - (format #t "~2Tcourse: ~A~%" (-> obj course)) - (format #t "~2Tend-door: ~D~%" (-> obj end-door)) - (format #t "~2Ttotal-target: ~D~%" (-> obj total-target)) - (format #t "~2Ttotal-target-destroyed: ~D~%" (-> obj total-target-destroyed)) - (format #t "~2Ttotal-bonus: ~D~%" (-> obj total-bonus)) - (format #t "~2Ttotal-bonus-destroyed: ~D~%" (-> obj total-bonus-destroyed)) - (format #t "~2Ttotal-civilian: ~D~%" (-> obj total-civilian)) - (format #t "~2Thud-score: ~D~%" (-> obj hud-score)) - (format #t "~2Thud-goal: ~D~%" (-> obj hud-goal)) - (format #t "~2Tin-out: ~D~%" (-> obj in-out)) - (format #t "~2Tcombo-done?: ~A~%" (-> obj combo-done?)) - (format #t "~2Tvoicebox: ~D~%" (-> obj voicebox)) - (format #t "~2Tlast-sound-id: ~D~%" (-> obj last-sound-id)) - (format #t "~2Tdummies[2] @ #x~X~%" (-> obj dummies)) - (format #t "~2Ttask-gold: ~D~%" (-> obj task-gold)) - (format #t "~2Ttask-silver: ~D~%" (-> obj task-silver)) - (format #t "~2Ttask-bronze: ~D~%" (-> obj task-bronze)) - (format #t "~2Tgame-score: ~D~%" (-> obj game-score)) - (format #t "~2Ttraining-goal: ~f~%" (-> obj training-goal)) - (format #t "~2Ttraining?: ~A~%" (-> obj training?)) - (format #t "~2Tegg-count: ~D~%" (-> obj egg-count)) - (format #t "~2Tmedal: ~D~%" (-> obj medal)) - (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tstart-time: ~D~%" (-> this start-time)) + (format #t "~2Tscore: ~D~%" (-> this score)) + (format #t "~2Tfirst-enemy-shown?: ~A~%" (-> this first-enemy-shown?)) + (format #t "~2Tfirst-citizen-shown?: ~A~%" (-> this first-citizen-shown?)) + (format #t "~2Topen-end?: ~A~%" (-> this open-end?)) + (format #t "~2Tentrance-crates[32] @ #x~X~%" (-> this entrance-crates)) + (format #t "~2Tcourse-crates[32] @ #x~X~%" (-> this course-crates)) + (format #t "~2Tcourse: ~A~%" (-> this course)) + (format #t "~2Tend-door: ~D~%" (-> this end-door)) + (format #t "~2Ttotal-target: ~D~%" (-> this total-target)) + (format #t "~2Ttotal-target-destroyed: ~D~%" (-> this total-target-destroyed)) + (format #t "~2Ttotal-bonus: ~D~%" (-> this total-bonus)) + (format #t "~2Ttotal-bonus-destroyed: ~D~%" (-> this total-bonus-destroyed)) + (format #t "~2Ttotal-civilian: ~D~%" (-> this total-civilian)) + (format #t "~2Thud-score: ~D~%" (-> this hud-score)) + (format #t "~2Thud-goal: ~D~%" (-> this hud-goal)) + (format #t "~2Tin-out: ~D~%" (-> this in-out)) + (format #t "~2Tcombo-done?: ~A~%" (-> this combo-done?)) + (format #t "~2Tvoicebox: ~D~%" (-> this voicebox)) + (format #t "~2Tlast-sound-id: ~D~%" (-> this last-sound-id)) + (format #t "~2Tdummies[2] @ #x~X~%" (-> this dummies)) + (format #t "~2Ttask-gold: ~D~%" (-> this task-gold)) + (format #t "~2Ttask-silver: ~D~%" (-> this task-silver)) + (format #t "~2Ttask-bronze: ~D~%" (-> this task-bronze)) + (format #t "~2Tgame-score: ~D~%" (-> this game-score)) + (format #t "~2Ttraining-goal: ~f~%" (-> this training-goal)) + (format #t "~2Ttraining?: ~A~%" (-> this training?)) + (format #t "~2Tegg-count: ~D~%" (-> this egg-count)) + (format #t "~2Tmedal: ~D~%" (-> this medal)) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) (label cfg-7) - obj + this ) ;; definition for method 32 of type training-manager ;; WARN: Return type mismatch int vs none. -(defmethod training-manager-method-32 training-manager ((obj training-manager)) - (when (handle->process (-> obj voicebox)) - (if (= (get-status *gui-control* (-> obj last-sound-id)) (gui-status unknown)) - (send-event (handle->process (-> obj voicebox)) 'speak-effect #f) - (send-event (handle->process (-> obj voicebox)) 'speak-effect #t) +(defmethod training-manager-method-32 training-manager ((this training-manager)) + (when (handle->process (-> this voicebox)) + (if (= (get-status *gui-control* (-> this last-sound-id)) (gui-status unknown)) + (send-event (handle->process (-> this voicebox)) 'speak-effect #f) + (send-event (handle->process (-> this voicebox)) 'speak-effect #t) ) ) (cond ((= (-> (level-get-target-inside *level*) name) 'gungame) - (if (zero? (-> obj gui-id)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel message) (gui-action play) (-> obj name) 81920.0 0) + (if (zero? (-> this gui-id)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel message) (gui-action play) (-> this name) 81920.0 0) ) ) ) (else - (when (nonzero? (-> obj gui-id)) + (when (nonzero? (-> this gui-id)) (set-action! *gui-control* (gui-action stop) - (-> obj gui-id) + (-> this gui-id) (gui-channel none) (gui-action none) (the-as string #f) (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (set! (-> obj gui-id) (new 'static 'sound-id)) + (set! (-> this gui-id) (new 'static 'sound-id)) 0 ) ) @@ -203,19 +203,19 @@ ) ;; definition for method 10 of type training-manager -(defmethod deactivate training-manager ((obj training-manager)) - (if (handle->process (-> obj voicebox)) - (send-event (handle->process (-> obj voicebox)) 'die) +(defmethod deactivate training-manager ((this training-manager)) + (if (handle->process (-> this voicebox)) + (send-event (handle->process (-> this voicebox)) 'die) ) - (training-manager-method-24 obj) - (training-manager-method-25 obj) - ((the-as (function process none) (find-parent-method training-manager 10)) obj) + (training-manager-method-24 this) + (training-manager-method-25 this) + ((the-as (function process none) (find-parent-method training-manager 10)) this) (none) ) ;; definition for method 11 of type training-path ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! training-path ((obj training-path) (arg0 entity-actor)) +(defmethod init-from-entity! training-path ((this training-path) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -223,59 +223,59 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (let ((s5-0 (length "training-path-")) - (a0-3 (length (-> obj name))) + (a0-3 (length (-> this name))) (v1-2 0) ) (cond ((= a0-3 (+ s5-0 1)) - (set! v1-2 (the-as int (+ (-> obj name data 14) -48 v1-2))) + (set! v1-2 (the-as int (+ (-> this name data 14) -48 v1-2))) ) ((= a0-3 (+ s5-0 2)) - (let ((v1-3 (+ v1-2 (* (the-as uint 10) (+ (-> obj name data 14) -48))))) - (set! v1-2 (the-as int (+ (-> obj name data 15) -48 v1-3))) + (let ((v1-3 (+ v1-2 (* (the-as uint 10) (+ (-> this name data 14) -48))))) + (set! v1-2 (the-as int (+ (-> this name data 15) -48 v1-3))) ) ) ((= a0-3 (+ s5-0 3)) (let ((v1-5 (+ v1-2 - (* (the-as uint 100) (+ (-> obj name data 14) -48)) - (* (the-as uint 10) (+ (-> obj name data 15) -48)) + (* (the-as uint 100) (+ (-> this name data 14) -48)) + (* (the-as uint 10) (+ (-> this name data 15) -48)) ) ) ) - (set! v1-2 (the-as int (+ (-> obj name data 16) -48 v1-5))) + (set! v1-2 (the-as int (+ (-> this name data 16) -48 v1-5))) ) ) ) - (set! (-> obj num) (the-as uint (+ v1-2 -76))) + (set! (-> this num) (the-as uint (+ v1-2 -76))) ) - (let ((v1-8 (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #t))) + (let ((v1-8 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #t))) (when (nonzero? v1-8) - (set! (-> obj path) v1-8) + (set! (-> this path) v1-8) (logior! (-> v1-8 flags) (path-control-flag display draw-line draw-point draw-text)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) ;; definition for method 31 of type training-manager ;; WARN: Return type mismatch int vs none. -(defmethod training-manager-method-31 training-manager ((obj training-manager)) +(defmethod training-manager-method-31 training-manager ((this training-manager)) (cond ((= (-> (level-get-target-inside *level*) name) 'gungame) - (when (or (zero? (-> obj in-out)) (= (-> obj in-out) 1)) + (when (or (zero? (-> this in-out)) (= (-> this in-out) 1)) (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) - (set! (-> obj in-out) (the-as uint 2)) + (set! (-> this in-out) (the-as uint 2)) ) ) (else - (when (or (zero? (-> obj in-out)) (= (-> obj in-out) 2)) - (when (handle->process (-> obj voicebox)) - (send-event (handle->process (-> obj voicebox)) 'die) - (set! (-> obj voicebox) (the-as handle #f)) + (when (or (zero? (-> this in-out)) (= (-> this in-out) 2)) + (when (handle->process (-> this voicebox)) + (send-event (handle->process (-> this voicebox)) 'die) + (set! (-> this voicebox) (the-as handle #f)) ) (remove-setting! 'minimap) - (set! (-> obj in-out) (the-as uint 1)) + (set! (-> this in-out) (the-as uint 1)) ) ) ) @@ -283,8 +283,8 @@ This commonly includes things such as: ) ;; definition for method 30 of type training-manager -(defmethod render-text training-manager ((obj training-manager) (arg0 text-id)) - (when (= (get-status *gui-control* (-> obj gui-id)) (gui-status active)) +(defmethod render-text training-manager ((this training-manager) (arg0 text-id)) + (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) (let ((s5-1 (new 'stack 'font-context *font-default-matrix* 32 290 0.0 (font-color default) (font-flags shadow kerning)) ) @@ -1897,7 +1897,7 @@ This commonly includes things such as: ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -1929,14 +1929,14 @@ This commonly includes things such as: ) ;; definition for method 21 of type training-manager -(defmethod training-manager-method-21 training-manager ((obj training-manager) (arg0 handle)) +(defmethod training-manager-method-21 training-manager ((this training-manager) (arg0 handle)) (let ((s4-0 0) - (v1-3 (+ (length (-> obj actor-group 0)) -1)) + (v1-3 (+ (length (-> this actor-group 0)) -1)) ) 0 (while (>= v1-3 s4-0) (let* ((a0-4 (/ (+ s4-0 v1-3) 2)) - (a2-2 (-> obj actor-group 0 data a0-4 actor)) + (a2-2 (-> this actor-group 0 data a0-4 actor)) (a1-4 (if a2-2 (the-as process-focusable (-> a2-2 extra process)) ) @@ -1944,7 +1944,7 @@ This commonly includes things such as: ) (cond ((= arg0 (-> a1-4 focus-status)) - (return (-> obj actor-group 0 data a0-4 actor)) + (return (-> this actor-group 0 data a0-4 actor)) ) ((< (the-as uint (-> a1-4 focus-status)) (the-as uint arg0)) (set! s4-0 (+ a0-4 1)) @@ -1960,14 +1960,14 @@ This commonly includes things such as: ) ;; definition for method 26 of type training-manager -(defmethod training-manager-method-26 training-manager ((obj training-manager)) +(defmethod training-manager-method-26 training-manager ((this training-manager)) (local-vars (s3-0 object)) (let ((gp-0 0)) (dotimes (s4-0 (-> *entrance-gungame-crates-pos* length)) - (if (and (handle->process (-> obj entrance-crates s4-0)) + (if (and (handle->process (-> this entrance-crates s4-0)) (begin (let* ((s3-1 #t) - (s2-0 (-> obj entrance-crates s4-0 process 0)) + (s2-0 (-> this entrance-crates s4-0 process 0)) (v1-11 (the-as focus-status (logand (-> (if (type? s2-0 process-focusable) (the-as process-focusable s2-0) ) @@ -1992,7 +1992,7 @@ This commonly includes things such as: ;; definition for method 29 of type training-manager ;; INFO: Used lq/sq -(defmethod training-manager-method-29 training-manager ((obj training-manager) (arg0 vector)) +(defmethod training-manager-method-29 training-manager ((this training-manager) (arg0 vector)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -2036,7 +2036,7 @@ This commonly includes things such as: ;; definition for method 22 of type training-manager ;; INFO: Used lq/sq -(defmethod training-manager-method-22 training-manager ((obj training-manager) (arg0 symbol)) +(defmethod training-manager-method-22 training-manager ((this training-manager) (arg0 symbol)) (local-vars (v1-28 symbol) (a0-18 symbol) (sv-48 process) (sv-64 process) (sv-80 process)) (let ((s4-0 (new 'static 'fact-info :pickup-type (pickup-type ammo-red) :pickup-spawn-amount 20.0)) (s3-0 (new 'stack-no-clear 'vector)) @@ -2051,7 +2051,7 @@ This commonly includes things such as: (+! (-> s3-0 x) 1667072.0) (+! (-> s3-0 y) 40960.0) (+! (-> s3-0 z) 5025792.0) - (training-manager-method-29 obj s3-0) + (training-manager-method-29 this s3-0) (when arg0 (set! (-> s2-0 quad) (-> s3-0 quad)) (set! (-> s2-0 r) 8192.0) @@ -2059,7 +2059,7 @@ This commonly includes things such as: (set! s1-0 #f) ) ) - (when (and s1-0 (not (handle->process (-> obj entrance-crates s0-0)))) + (when (and s1-0 (not (handle->process (-> this entrance-crates s0-0)))) (set! sv-48 (get-process *default-dead-pool* crate #x4000)) (let ((v1-21 (when sv-48 @@ -2089,10 +2089,10 @@ This commonly includes things such as: *up-vector* (+ -4551.1113 (-> *entrance-gungame-crates-pos* s0-0 pos w)) ) - (set! (-> obj entrance-crates s0-0) (ppointer->handle (if sv-80 - (-> sv-80 ppointer) - ) - ) + (set! (-> this entrance-crates s0-0) (ppointer->handle (if sv-80 + (-> sv-80 ppointer) + ) + ) ) ) ) @@ -2101,22 +2101,22 @@ This commonly includes things such as: ) ;; definition for method 25 of type training-manager -(defmethod training-manager-method-25 training-manager ((obj training-manager)) +(defmethod training-manager-method-25 training-manager ((this training-manager)) (dotimes (s5-0 (-> *entrance-gungame-crates-pos* length)) - (when (handle->process (-> obj entrance-crates s5-0)) - (deactivate (-> obj entrance-crates s5-0 process 0)) - (set! (-> obj entrance-crates s5-0) (the-as handle #f)) + (when (handle->process (-> this entrance-crates s5-0)) + (deactivate (-> this entrance-crates s5-0 process 0)) + (set! (-> this entrance-crates s5-0) (the-as handle #f)) ) ) #f ) ;; definition for method 24 of type training-manager -(defmethod training-manager-method-24 training-manager ((obj training-manager)) +(defmethod training-manager-method-24 training-manager ((this training-manager)) (dotimes (s5-0 32) - (when (handle->process (-> obj course-crates s5-0)) - (deactivate (-> obj course-crates s5-0 process 0)) - (set! (-> obj course-crates s5-0) (the-as handle #f)) + (when (handle->process (-> this course-crates s5-0)) + (deactivate (-> this course-crates s5-0 process 0)) + (set! (-> this course-crates s5-0) (the-as handle #f)) ) ) #f @@ -2124,19 +2124,19 @@ This commonly includes things such as: ;; definition for method 23 of type training-manager ;; INFO: Used lq/sq -(defmethod training-manager-method-23 training-manager ((obj training-manager) (arg0 (array gungame-crate))) +(defmethod training-manager-method-23 training-manager ((this training-manager) (arg0 (array gungame-crate))) (let ((s4-0 (new 'stack-no-clear 'vector)) (s3-0 (new 'static 'fact-info)) ) (dotimes (s2-0 (-> arg0 length)) - (when (not (handle->process (-> obj course-crates s2-0))) + (when (not (handle->process (-> this course-crates s2-0))) (set! (-> s4-0 quad) (-> arg0 s2-0 pos quad)) (set! (-> s4-0 w) 1.0) (vector-rotate-around-y! s4-0 s4-0 -4460.999) (+! (-> s4-0 x) 1667072.0) (+! (-> s4-0 y) 40960.0) (+! (-> s4-0 z) 5025792.0) - (training-manager-method-29 obj s4-0) + (training-manager-method-29 this s4-0) (set! (-> s3-0 pickup-type) (-> arg0 s2-0 ammo)) (set! (-> s3-0 pickup-spawn-amount) (the float (-> arg0 s2-0 num))) (let* ((s0-0 (ppointer->process (process-spawn crate #f s4-0 'wood s3-0 :to *entity-pool*))) @@ -2146,7 +2146,7 @@ This commonly includes things such as: ) ) (quaternion-vector-angle! (-> s1-1 root quat) *up-vector* (+ -4551.1113 (-> arg0 s2-0 pos w))) - (set! (-> obj course-crates s2-0) (process->handle s1-1)) + (set! (-> this course-crates s2-0) (process->handle s1-1)) ) ) ) @@ -2155,7 +2155,7 @@ This commonly includes things such as: ) ;; definition for method 27 of type training-manager -(defmethod training-manager-method-27 training-manager ((obj training-manager) (arg0 (array tpath-info))) +(defmethod training-manager-method-27 training-manager ((this training-manager) (arg0 (array tpath-info))) (dotimes (s5-0 (length arg0)) (let ((v1-2 (-> arg0 s5-0))) 0 @@ -2201,24 +2201,24 @@ This commonly includes things such as: ;; definition for method 28 of type training-manager ;; WARN: Return type mismatch object vs none. -(defmethod training-manager-method-28 training-manager ((obj training-manager)) +(defmethod training-manager-method-28 training-manager ((this training-manager)) (cond ((task-node-open? (game-task-node city-red-gun-training-introduction)) - (go (method-of-object obj red-training-intro)) + (go (method-of-object this red-training-intro)) ) ((or (task-node-open? (game-task-node city-red-gun-training-try-once)) (task-node-open? (game-task-node city-red-gun-training-resolution)) ) - (go (method-of-object obj red-training)) + (go (method-of-object this red-training)) ) ((task-node-open? (game-task-node city-yellow-gun-training-introduction)) - (go (method-of-object obj yellow-training-intro)) + (go (method-of-object this yellow-training-intro)) ) ((task-node-open? (game-task-node city-yellow-gun-training-resolution)) (go yellow-training) ) (else - (go (method-of-object obj red-yellow-training)) + (go (method-of-object this red-yellow-training)) ) ) (none) @@ -2227,7 +2227,7 @@ This commonly includes things such as: ;; definition for method 11 of type training-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! training-manager ((obj training-manager) (arg0 entity-actor)) +(defmethod init-from-entity! training-manager ((this training-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2237,38 +2237,38 @@ This commonly includes things such as: (local-vars (sv-16 res-tag)) (set-setting! 'darkjak #f 0.0 0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-3 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-3 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-3 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-3)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-3)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) (go process-drawable-art-error "actor-group training-manager") ) ) ) - (set! (-> obj score) 0) - (set! (-> obj in-out) (the-as uint 0)) - (set! (-> obj egg-count) 0) - (set! (-> obj medal) 0) - (set! (-> obj voicebox) (the-as handle #f)) - (set! (-> obj gui-id) (new 'static 'sound-id)) + (set! (-> this score) 0) + (set! (-> this in-out) (the-as uint 0)) + (set! (-> this egg-count) 0) + (set! (-> this medal) 0) + (set! (-> this voicebox) (the-as handle #f)) + (set! (-> this gui-id) (new 'static 'sound-id)) (dotimes (v1-10 32) - (set! (-> obj entrance-crates v1-10) (the-as handle #f)) + (set! (-> this entrance-crates v1-10) (the-as handle #f)) ) (dotimes (v1-13 32) - (set! (-> obj course-crates v1-13) (the-as handle #f)) + (set! (-> this course-crates v1-13) (the-as handle #f)) ) - (training-manager-method-27 obj *red-training-path-global-info*) - (training-manager-method-27 obj *yellow-training-path-global-info*) - (training-manager-method-27 obj *blue-training-path-global-info*) - (training-manager-method-27 obj *peace-training-path-global-info*) - (training-manager-method-22 obj #f) + (training-manager-method-27 this *red-training-path-global-info*) + (training-manager-method-27 this *yellow-training-path-global-info*) + (training-manager-method-27 this *blue-training-path-global-info*) + (training-manager-method-27 this *peace-training-path-global-info*) + (training-manager-method-22 this #f) (set-setting! 'speech-control #f 0.0 0) - (go (method-of-object obj wait)) + (go (method-of-object this wait)) (none) ) @@ -2295,22 +2295,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type gungame-door -(defmethod inspect gungame-door ((obj gungame-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect gungame-door ((this gungame-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Topen-side: ~A~%" (-> obj open-side)) - (format #t "~2Tclose-sound: ~D~%" (-> obj close-sound)) - (format #t "~2Ttrain: ~D~%" (-> obj train)) - (format #t "~2Tlast-player-dist: ~f~%" (-> obj last-player-dist)) - (format #t "~2Tlast-camera-dist: ~f~%" (-> obj last-camera-dist)) - (format #t "~2Tclose-state: ~D~%" (-> obj close-state)) + (format #t "~2Topen-side: ~A~%" (-> this open-side)) + (format #t "~2Tclose-sound: ~D~%" (-> this close-sound)) + (format #t "~2Ttrain: ~D~%" (-> this train)) + (format #t "~2Tlast-player-dist: ~f~%" (-> this last-player-dist)) + (format #t "~2Tlast-camera-dist: ~f~%" (-> this last-camera-dist)) + (format #t "~2Tclose-state: ~D~%" (-> this close-state)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2377,7 +2377,7 @@ This commonly includes things such as: :code (behavior () (sound-play "gungame-door") (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.2)) + (until (time-elapsed? gp-1 (seconds 0.2)) (suspend) (suspend) ) @@ -2399,73 +2399,73 @@ This commonly includes things such as: ) ;; definition for method 23 of type gungame-door -(defmethod gungame-door-method-23 gungame-door ((obj gungame-door)) - (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root trans))) - (f26-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) s5-1)) - (f30-0 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) s5-1)) +(defmethod gungame-door-method-23 gungame-door ((this gungame-door)) + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (f26-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) + (f30-0 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) (f28-0 (vector-dot - (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) - (vector-! (new 'stack-no-clear 'vector) (camera-pos) (-> obj root trans)) + (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (-> this root trans)) ) ) (f0-4 (vector-dot - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) - (vector-! (new 'stack-no-clear 'vector) (camera-pos) (-> obj root trans)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (-> this root trans)) ) ) ) (cond - ((-> obj open-side) + ((-> this open-side) (when (< (fabs f26-0) 16384.0) - (if (and (>= (-> obj last-player-dist) 8192.0) (< f30-0 8192.0)) - (+! (-> obj close-state) -1) + (if (and (>= (-> this last-player-dist) 8192.0) (< f30-0 8192.0)) + (+! (-> this close-state) -1) ) - (if (and (< (-> obj last-player-dist) 8192.0) (>= f30-0 8192.0)) - (+! (-> obj close-state) 1) + (if (and (< (-> this last-player-dist) 8192.0) (>= f30-0 8192.0)) + (+! (-> this close-state) 1) ) ) (when (< (fabs f28-0) 16384.0) - (if (and (>= (-> obj last-camera-dist) 8192.0) (< f0-4 8192.0)) - (+! (-> obj close-state) -1) + (if (and (>= (-> this last-camera-dist) 8192.0) (< f0-4 8192.0)) + (+! (-> this close-state) -1) ) - (if (and (< (-> obj last-camera-dist) 8192.0) (>= f0-4 8192.0)) - (+! (-> obj close-state) 1) + (if (and (< (-> this last-camera-dist) 8192.0) (>= f0-4 8192.0)) + (+! (-> this close-state) 1) ) ) ) (else (when (< (fabs f26-0) 16384.0) - (if (and (>= (-> obj last-player-dist) -8192.0) (< f30-0 -8192.0)) - (+! (-> obj close-state) 1) + (if (and (>= (-> this last-player-dist) -8192.0) (< f30-0 -8192.0)) + (+! (-> this close-state) 1) ) - (if (and (< (-> obj last-player-dist) -8192.0) (>= f30-0 -8192.0)) - (+! (-> obj close-state) -1) + (if (and (< (-> this last-player-dist) -8192.0) (>= f30-0 -8192.0)) + (+! (-> this close-state) -1) ) ) (when (< (fabs f28-0) 16384.0) - (if (and (>= (-> obj last-camera-dist) -8192.0) (< f0-4 -8192.0)) - (+! (-> obj close-state) 1) + (if (and (>= (-> this last-camera-dist) -8192.0) (< f0-4 -8192.0)) + (+! (-> this close-state) 1) ) - (if (and (< (-> obj last-camera-dist) -8192.0) (>= f0-4 -8192.0)) - (+! (-> obj close-state) -1) + (if (and (< (-> this last-camera-dist) -8192.0) (>= f0-4 -8192.0)) + (+! (-> this close-state) -1) ) ) ) ) - (set! (-> obj last-player-dist) f30-0) - (set! (-> obj last-camera-dist) f0-4) + (set! (-> this last-player-dist) f30-0) + (set! (-> this last-camera-dist) f0-4) ) - (!= (-> obj close-state) 2) + (!= (-> this close-state) 2) ) ;; definition for method 24 of type gungame-door ;; WARN: disable def twice: 41. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod gungame-door-method-24 gungame-door ((obj gungame-door)) - (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> obj root trans))) - (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) s5-1)) - (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) s5-1)) +(defmethod gungame-door-method-24 gungame-door ((this gungame-door)) + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) + (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) s5-1)) ) - (and (< (fabs f30-0) 16384.0) (if (-> obj open-side) + (and (< (fabs f30-0) 16384.0) (if (-> this open-side) (and (< f0-2 0.0) (< -32768.0 f0-2)) (and (< 0.0 f0-2) (< f0-2 32768.0)) ) @@ -2525,14 +2525,14 @@ This commonly includes things such as: ;; definition for method 11 of type gungame-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gungame-door ((obj gungame-door) (arg0 entity-actor)) +(defmethod init-from-entity! gungame-door ((this gungame-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -2566,22 +2566,22 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gungame-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-push! 1 0) - (let ((a0-23 (-> obj skel root-channel 0))) - (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-23 (-> this skel root-channel 0))) + (set! (-> a0-23 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-23 frame-num) 0.0) - (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-23 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-part_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-part_REF.gc index b2c3340155..7d5d8fa117 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type gungame-part -(defmethod inspect gungame-part ((obj gungame-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect gungame-part ((this gungame-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc b/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc index a9e12181aa..f3453f6049 100644 --- a/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/hideout/hideout-obs_REF.gc @@ -18,28 +18,28 @@ ) ;; definition for method 3 of type hide-door-b -(defmethod inspect hide-door-b ((obj hide-door-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect hide-door-b ((this hide-door-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type hide-door-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-door-b ((obj hide-door-b) (arg0 entity-actor)) +(defmethod init-from-entity! hide-door-b ((this hide-door-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -69,20 +69,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hide-door-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "hide-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "hide-door-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "hide-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "hide-door-hit")) - (set! (-> obj door-radius) 12288.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "hide-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "hide-door-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "hide-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "hide-door-hit")) + (set! (-> this door-radius) 12288.0) + (go (method-of-object this close) #t) (none) ) @@ -99,16 +99,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type hide-light -(defmethod inspect hide-light ((obj hide-light)) - (when (not obj) - (set! obj obj) +(defmethod inspect hide-light ((this hide-light)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -179,19 +179,19 @@ This commonly includes things such as: ;; definition for method 11 of type hide-light ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hide-light ((obj hide-light) (arg0 entity-actor)) +(defmethod init-from-entity! hide-light ((this hide-light) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hide-light" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -200,11 +200,11 @@ This commonly includes things such as: (set-vector! (-> v1-9 settings bot-plane) 0.0 -1.0 0.0 58982.4) (set-vector! (-> v1-9 settings top-plane) 0.0 -1.0 0.0 0.0) (set! (-> v1-9 settings shadow-type) 1) - (set! (-> obj draw shadow-ctrl) v1-9) + (set! (-> this draw shadow-ctrl) v1-9) ) - (hide-light-spawn obj *zero-vector* (-> obj node-list data 12)) + (hide-light-spawn this *zero-vector* (-> this node-list data 12)) (set-setting! 'spotlight-color #f 0.0 (the-as uint #x80c0c0c0)) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/hideout/hideout-part_REF.gc b/test/decompiler/reference/jak2/levels/hideout/hideout-part_REF.gc index 8c7dc640a4..ed63b8127a 100644 --- a/test/decompiler/reference/jak2/levels/hideout/hideout-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/hideout/hideout-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type hide-part -(defmethod inspect hide-part ((obj hide-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect hide-part ((this hide-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc index df1133b90e..921c3a4ae7 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/hiphog-obs_REF.gc @@ -14,16 +14,16 @@ ) ;; definition for method 3 of type hip-trophy-a -(defmethod inspect hip-trophy-a ((obj hip-trophy-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-trophy-a ((this hip-trophy-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -41,26 +41,26 @@ ;; definition for method 11 of type hip-trophy-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-a ((obj hip-trophy-a) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-a ((this hip-trophy-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -77,16 +77,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type hip-trophy-d -(defmethod inspect hip-trophy-d ((obj hip-trophy-d)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-trophy-d ((this hip-trophy-d)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -104,26 +104,26 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-d ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-d ((obj hip-trophy-d) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-d ((this hip-trophy-d) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-d" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -140,16 +140,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type hip-trophy-f -(defmethod inspect hip-trophy-f ((obj hip-trophy-f)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-trophy-f ((this hip-trophy-f)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -167,26 +167,26 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-f ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-f ((obj hip-trophy-f) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-f ((this hip-trophy-f) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-f" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -203,16 +203,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type hip-trophy-g -(defmethod inspect hip-trophy-g ((obj hip-trophy-g)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-trophy-g ((this hip-trophy-g)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -230,26 +230,26 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-g ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-g ((obj hip-trophy-g) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-g ((this hip-trophy-g) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-g" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -266,16 +266,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type hip-trophy-i -(defmethod inspect hip-trophy-i ((obj hip-trophy-i)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-trophy-i ((this hip-trophy-i)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -293,26 +293,26 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-i ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-i ((obj hip-trophy-i) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-i ((this hip-trophy-i) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-i" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -329,16 +329,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type hip-trophy-j -(defmethod inspect hip-trophy-j ((obj hip-trophy-j)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-trophy-j ((this hip-trophy-j)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -356,26 +356,26 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-j ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-j ((obj hip-trophy-j) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-j ((this hip-trophy-j) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-j" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -392,16 +392,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type hip-trophy-n -(defmethod inspect hip-trophy-n ((obj hip-trophy-n)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-trophy-n ((this hip-trophy-n)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -419,26 +419,26 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-n ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-n ((obj hip-trophy-n) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-n ((this hip-trophy-n) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-n" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -455,16 +455,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type hip-trophy-m -(defmethod inspect hip-trophy-m ((obj hip-trophy-m)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-trophy-m ((this hip-trophy-m)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -482,25 +482,25 @@ This commonly includes things such as: ;; definition for method 11 of type hip-trophy-m ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-trophy-m ((obj hip-trophy-m) (arg0 entity-actor)) +(defmethod init-from-entity! hip-trophy-m ((this hip-trophy-m) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-trophy-m" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-5 (res-lump-value (-> obj entity) 'index uint128 :time -1000000000.0))) + (let ((v1-5 (res-lump-value (-> this entity) 'index uint128 :time -1000000000.0))) (if (= (the-as uint v1-5) 1) - (logior! (-> obj draw global-effect) (draw-control-global-effect disable-envmap)) + (logior! (-> this draw global-effect) (draw-control-global-effect disable-envmap)) ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/hiphog/hiphog-part_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/hiphog-part_REF.gc index bcd99b987b..b130e03cb7 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/hiphog-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/hiphog-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type hiphog-part -(defmethod inspect hiphog-part ((obj hiphog-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect hiphog-part ((this hiphog-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1588,16 +1588,16 @@ Every real second is 1/60th of a second in Jak's time of day" ) ;; definition for method 3 of type hiphog-mirror-wf-pt -(defmethod inspect hiphog-mirror-wf-pt ((obj hiphog-mirror-wf-pt)) - (when (not obj) - (set! obj obj) +(defmethod inspect hiphog-mirror-wf-pt ((this hiphog-mirror-wf-pt)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hiphog-mirror-wf-pt) - (format #t "~1Tx: ~f~%" (-> obj x)) - (format #t "~1Ty: ~f~%" (-> obj y)) + (format #t "[~8x] ~A~%" this 'hiphog-mirror-wf-pt) + (format #t "~1Tx: ~f~%" (-> this x)) + (format #t "~1Ty: ~f~%" (-> this y)) (label cfg-4) - obj + this ) ;; definition for symbol *hiphog-mirror-sheen-waveform*, type (inline-array ripple-wave) diff --git a/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc index 10a6a4a1f5..6c036336df 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/hiphog-scenes_REF.gc @@ -17,28 +17,28 @@ ) ;; definition for method 3 of type hip-door-b -(defmethod inspect hip-door-b ((obj hip-door-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-door-b ((this hip-door-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type hip-door-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-door-b ((obj hip-door-b) (entiy entity-actor)) +(defmethod init-from-entity! hip-door-b ((this hip-door-b) (entiy entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape penetrated-by) (penetrate)) (let ((cshape-group (new 'process 'collide-shape-prim-group cshape (the-as uint 2) 0))) (set! (-> cshape total-prims) (the-as uint 3)) @@ -67,20 +67,20 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-door-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wood-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wood-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wood-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wood-close-hit")) - (set! (-> obj door-radius) 8192.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wood-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wood-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wood-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wood-close-hit")) + (set! (-> this door-radius) 8192.0) + (go (method-of-object this close) #t) (none) ) @@ -101,16 +101,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type hip-whack-a-metal -(defmethod inspect hip-whack-a-metal ((obj hip-whack-a-metal)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-whack-a-metal ((this hip-whack-a-metal)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -126,10 +126,10 @@ This commonly includes things such as: ;; definition for method 33 of type hip-whack-a-metal ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! hip-whack-a-metal ((obj hip-whack-a-metal)) +(defmethod init-art! hip-whack-a-metal ((this hip-whack-a-metal)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-whack-a-metal" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -137,18 +137,18 @@ This commonly includes things such as: ) ;; definition for method 35 of type hip-whack-a-metal -(defmethod get-art-elem hip-whack-a-metal ((obj hip-whack-a-metal)) +(defmethod get-art-elem hip-whack-a-metal ((this hip-whack-a-metal)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> (get-current-task-event (-> obj task)) action) + (case (-> (get-current-task-event (-> this task)) action) (((game-task-action play)) - (set! (-> obj talk-message) (text-id press-triangle-to-play)) + (set! (-> this talk-message) (text-id press-triangle-to-play)) ) (else - (set! (-> obj talk-message) (text-id press-triangle-to-talk)) + (set! (-> this talk-message) (text-id press-triangle-to-talk)) ) ) - (-> obj draw art-group data 2) + (-> this draw art-group data 2) ) ;; failed to figure out what this is: @@ -190,16 +190,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type hip-mirror -(defmethod inspect hip-mirror ((obj hip-mirror)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-mirror ((this hip-mirror)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -224,22 +224,22 @@ This commonly includes things such as: ;; definition for method 11 of type hip-mirror ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hip-mirror ((obj hip-mirror) (entity entity-actor)) +(defmethod init-from-entity! hip-mirror ((this hip-mirror) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj entity) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hip-mirror" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj skel status) (joint-control-status blend-shape)) - (go (method-of-object obj idle)) + (logior! (-> this skel status) (joint-control-status blend-shape)) + (go (method-of-object this idle)) (none) ) @@ -420,38 +420,38 @@ This commonly includes things such as: ) ;; definition for method 3 of type sig-npc -(defmethod inspect sig-npc ((obj sig-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig-npc ((this sig-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 35 of type sig-npc -(defmethod get-art-elem sig-npc ((obj sig-npc)) +(defmethod get-art-elem sig-npc ((this sig-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" (if (task-node-open? (game-task-node forest-hunt-introduction)) - (-> obj draw art-group data 4) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) + (-> this draw art-group data 4) ) ) ;; definition for method 33 of type sig-npc ;; WARN: Return type mismatch int vs none. -(defmethod init-art! sig-npc ((obj sig-npc)) +(defmethod init-art! sig-npc ((this sig-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sig-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) + (set! (-> this draw light-index) (the-as uint 10)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc b/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc index 63479c025a..32a630858a 100644 --- a/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc +++ b/test/decompiler/reference/jak2/levels/hiphog/whack_REF.gc @@ -735,17 +735,17 @@ ) ;; definition for method 3 of type hip-mole-event -(defmethod inspect hip-mole-event ((obj hip-mole-event)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-mole-event ((this hip-mole-event)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hip-mole-event) - (format #t "~1Tmin-time: ~D~%" (-> obj min-time)) - (format #t "~1Tmax-time: ~D~%" (-> obj max-time)) - (format #t "~1Tmode: ~D~%" (-> obj mode)) + (format #t "[~8x] ~A~%" this 'hip-mole-event) + (format #t "~1Tmin-time: ~D~%" (-> this min-time)) + (format #t "~1Tmax-time: ~D~%" (-> this max-time)) + (format #t "~1Tmode: ~D~%" (-> this mode)) (label cfg-4) - obj + this ) ;; definition for symbol *mole-data*, type (array (array hip-mole-event)) @@ -1489,21 +1489,21 @@ ) ;; definition for method 3 of type hip-mole -(defmethod inspect hip-mole ((obj hip-mole)) - (when (not obj) - (set! obj obj) +(defmethod inspect hip-mole ((this hip-mole)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcabinet: ~D~%" (-> obj cabinet)) - (format #t "~2Tindex: ~D~%" (-> obj index)) - (format #t "~2Tmode: ~D~%" (-> obj mode)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tabort?: ~A~%" (-> obj abort?)) + (format #t "~2Tcabinet: ~D~%" (-> this cabinet)) + (format #t "~2Tindex: ~D~%" (-> this index)) + (format #t "~2Tmode: ~D~%" (-> this mode)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tabort?: ~A~%" (-> this abort?)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1673,7 +1673,7 @@ ) (ja-channel-push! 1 (seconds 0.05)) (let ((s5-0 (current-time))) - (while (and (< (- (current-time) s5-0) arg0) (not (-> self abort?))) + (while (and (not (time-elapsed? s5-0 arg0)) (not (-> self abort?))) (ja :group! (-> self draw art-group data 4) :num! (loop!)) (suspend) ) @@ -1758,74 +1758,74 @@ ) ;; definition for method 3 of type whack-a-metal -(defmethod inspect whack-a-metal ((obj whack-a-metal)) - (when (not obj) - (set! obj obj) +(defmethod inspect whack-a-metal ((this whack-a-metal)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcabinet: ~D~%" (-> obj cabinet)) - (format #t "~2Tbopper: #x~X~%" (-> obj bopper)) - (format #t "~2Tmole[8] @ #x~X~%" (-> obj mole)) - (format #t "~2Tscore-part[2] @ #x~X~%" (-> obj score-part)) - (format #t "~2Twave: ~D~%" (-> obj wave)) - (format #t "~2Tevent: ~D~%" (-> obj event)) - (format #t "~2Tevent-time: ~D~%" (-> obj event-time)) - (format #t "~2Tevent-length: ~D~%" (-> obj event-length)) - (format #t "~2Thud-score: ~D~%" (-> obj hud-score)) - (format #t "~2Thud-goal: ~D~%" (-> obj hud-goal)) - (format #t "~2Tscore: ~f~%" (-> obj score)) - (format #t "~2Tscore-time: ~D~%" (-> obj score-time)) - (format #t "~2Tdizzy?: ~A~%" (-> obj dizzy?)) - (format #t "~2Tmiss-count: ~D~%" (-> obj miss-count)) - (format #t "~2Tair-attack-count: ~D~%" (-> obj air-attack-count)) - (format #t "~2Tslot-buffer[4] @ #x~X~%" (-> obj slot-buffer)) - (format #t "~2Tspeech-time: ~D~%" (-> obj speech-time)) - (format #t "~2Tspeech-count: ~D~%" (-> obj speech-count)) - (format #t "~2Tspeech-last[4] @ #x~X~%" (-> obj speech-last)) + (format #t "~2Tcabinet: ~D~%" (-> this cabinet)) + (format #t "~2Tbopper: #x~X~%" (-> this bopper)) + (format #t "~2Tmole[8] @ #x~X~%" (-> this mole)) + (format #t "~2Tscore-part[2] @ #x~X~%" (-> this score-part)) + (format #t "~2Twave: ~D~%" (-> this wave)) + (format #t "~2Tevent: ~D~%" (-> this event)) + (format #t "~2Tevent-time: ~D~%" (-> this event-time)) + (format #t "~2Tevent-length: ~D~%" (-> this event-length)) + (format #t "~2Thud-score: ~D~%" (-> this hud-score)) + (format #t "~2Thud-goal: ~D~%" (-> this hud-goal)) + (format #t "~2Tscore: ~f~%" (-> this score)) + (format #t "~2Tscore-time: ~D~%" (-> this score-time)) + (format #t "~2Tdizzy?: ~A~%" (-> this dizzy?)) + (format #t "~2Tmiss-count: ~D~%" (-> this miss-count)) + (format #t "~2Tair-attack-count: ~D~%" (-> this air-attack-count)) + (format #t "~2Tslot-buffer[4] @ #x~X~%" (-> this slot-buffer)) + (format #t "~2Tspeech-time: ~D~%" (-> this speech-time)) + (format #t "~2Tspeech-count: ~D~%" (-> this speech-count)) + (format #t "~2Tspeech-last[4] @ #x~X~%" (-> this speech-last)) (label cfg-4) - obj + this ) ;; definition for method 10 of type whack-a-metal -(defmethod deactivate whack-a-metal ((obj whack-a-metal)) +(defmethod deactivate whack-a-metal ((this whack-a-metal)) (dotimes (s5-0 2) - (if (nonzero? (-> obj score-part s5-0)) - (kill-and-free-particles (-> obj score-part s5-0)) + (if (nonzero? (-> this score-part s5-0)) + (kill-and-free-particles (-> this score-part s5-0)) ) ) - ((the-as (function process none) (find-parent-method whack-a-metal 10)) obj) + ((the-as (function process none) (find-parent-method whack-a-metal 10)) 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 ((obj whack-a-metal) (arg0 int)) +(defmethod relocate whack-a-metal ((this whack-a-metal) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj score-part v1-0)) - (&+! (-> obj score-part v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method whack-a-metal 7)) this arg0) ) ) ;; definition for method 29 of type whack-a-metal -(defmethod whack-a-metal-method-29 whack-a-metal ((obj whack-a-metal) (arg0 int) (arg1 int)) - (let ((v0-1 (mod (+ (-> obj speech-last arg0) (rand-vu-int-range 1 2)) arg1))) - (set! (-> obj speech-last arg0) v0-1) +(defmethod whack-a-metal-method-29 whack-a-metal ((this whack-a-metal) (arg0 int) (arg1 int)) + (let ((v0-1 (mod (+ (-> this speech-last arg0) (rand-vu-int-range 1 2)) arg1))) + (set! (-> this speech-last arg0) v0-1) v0-1 ) ) ;; definition for method 26 of type whack-a-metal ;; WARN: Return type mismatch int vs integer. -(defmethod whack-a-metal-method-26 whack-a-metal ((obj whack-a-metal)) - (if (or (-> obj dizzy?) (>= (-> obj miss-count) 20)) +(defmethod whack-a-metal-method-26 whack-a-metal ((this whack-a-metal)) + (if (or (-> this dizzy?) (>= (-> this miss-count) 20)) (return (the-as integer -1)) ) (let ((v0-0 @@ -1895,14 +1895,14 @@ (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons up right down left triangle circle x square)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons up right down left triangle circle x square)) (dotimes (v1-57 4) - (when (< (-> obj slot-buffer v1-57) 0) - (set! (-> obj slot-buffer v1-57) v0-0) + (when (< (-> this slot-buffer v1-57) 0) + (set! (-> this slot-buffer v1-57) v0-0) (goto cfg-30) ) ) (label cfg-30) - (if (>= (-> obj slot-buffer 0) 0) - (return (the-as integer (-> obj slot-buffer 0))) + (if (>= (-> this slot-buffer 0) 0) + (return (the-as integer (-> this slot-buffer 0))) ) v0-0 ) @@ -1910,32 +1910,32 @@ ;; definition for method 27 of type whack-a-metal ;; WARN: Return type mismatch int vs none. -(defmethod whack-a-metal-method-27 whack-a-metal ((obj whack-a-metal)) - (let ((s4-0 (-> *mole-data* (-> obj wave) (-> obj event))) +(defmethod whack-a-metal-method-27 whack-a-metal ((this whack-a-metal)) + (let ((s4-0 (-> *mole-data* (-> this wave) (-> this event))) (s5-0 #t) ) - (when (zero? (-> obj event-length)) - (set! (-> obj event-length) + (when (zero? (-> this event-length)) + (set! (-> this event-length) (rand-vu-int-range (the-as int (-> s4-0 min-time)) (the-as int (+ (-> s4-0 min-time) (-> s4-0 max-time)))) ) - (set! (-> obj event-time) (current-time)) + (set-time! (-> this event-time)) ) (let ((v1-8 (-> s4-0 mode))) (cond ((= v1-8 8) - (set! s5-0 (>= (- (current-time) (-> obj event-time)) (-> obj event-length))) + (set! s5-0 (time-elapsed? (-> this event-time) (-> this event-length))) ) ((or (= v1-8 9) (= v1-8 10) (= v1-8 11)) (let ((v1-13 (rand-vu-int-range 0 7))) (let ((s3-0 0)) - (while (let ((a0-20 (-> obj mole v1-13))) + (while (let ((a0-20 (-> this mole v1-13))) (and (-> (the-as hip-mole (if a0-20 (the-as hip-mole (-> a0-20 0 self)) ) ) next-state ) - (let ((a0-26 (-> obj mole v1-13))) + (let ((a0-26 (-> this mole v1-13))) (= (-> (the-as hip-mole (if a0-26 (the-as hip-mole (-> a0-26 0 self)) ) @@ -1955,21 +1955,21 @@ ) ) ) - (send-event (ppointer->process (-> obj mole v1-13)) 'active (-> obj event-length) (-> s4-0 mode)) + (send-event (ppointer->process (-> this mole v1-13)) 'active (-> this event-length) (-> s4-0 mode)) ) (label cfg-27) ) ((or (zero? v1-8) (= v1-8 1) (= v1-8 2) (= v1-8 3) (= v1-8 4) (= v1-8 5) (= v1-8 6) (= v1-8 7)) (let ((v1-22 (the-as int (-> s4-0 mode)))) (let ((s3-1 0)) - (while (let ((a0-49 (-> obj mole v1-22))) + (while (let ((a0-49 (-> this mole v1-22))) (and (-> (the-as hip-mole (if a0-49 (the-as hip-mole (-> a0-49 0 self)) ) ) next-state ) - (let ((a0-55 (-> obj mole v1-22))) + (let ((a0-55 (-> this mole v1-22))) (= (-> (the-as hip-mole (if a0-55 (the-as hip-mole (-> a0-55 0 self)) ) @@ -1989,32 +1989,32 @@ ) ) ) - (send-event (ppointer->process (-> obj mole v1-22)) 'active (-> obj event-length) (-> s4-0 mode)) + (send-event (ppointer->process (-> this mole v1-22)) 'active (-> this event-length) (-> s4-0 mode)) ) ) ) ) (label cfg-61) (when s5-0 - (set! (-> obj event-length) 0) - (+! (-> obj event) 1) - (when (>= (-> obj event) (-> *mole-data* (-> obj wave) length)) - (set! (-> obj event) 0) - (+! (-> obj wave) 1) - (if (>= (-> obj wave) (-> *mole-data* length)) - (set! (-> obj wave) (+ (-> *mole-data* length) -1)) + (set! (-> this event-length) 0) + (+! (-> this event) 1) + (when (>= (-> this event) (-> *mole-data* (-> this wave) length)) + (set! (-> this event) 0) + (+! (-> this wave) 1) + (if (>= (-> this wave) (-> *mole-data* length)) + (set! (-> this wave) (+ (-> *mole-data* length) -1)) ) ) ) ) - (when (>= (- (current-time) (-> obj speech-time)) (seconds 15)) + (when (time-elapsed? (-> this speech-time) (seconds 15)) (if (nonzero? (cond - ((= (-> obj speech-count) 1) + ((= (-> this speech-count) 1) 0 ) - ((>= (-> obj score) 1300.0) - (set! (-> obj speech-count) 1) - (let ((v1-50 (whack-a-metal-method-29 obj 0 3))) + ((>= (-> this score) 1300.0) + (set! (-> this speech-count) 1) + (let ((v1-50 (whack-a-metal-method-29 this 0 3))) (cond ((zero? v1-50) (the-as int (talker-spawn-func (-> *talker-speech* 430) *entity-pool* (target-pos 0) (the-as region #f))) @@ -2029,7 +2029,7 @@ ) ) (else - (let ((v1-55 (whack-a-metal-method-29 obj 1 20))) + (let ((v1-55 (whack-a-metal-method-29 this 1 20))) (cond ((zero? v1-55) (the-as int (talker-spawn-func (-> *talker-speech* 395) *entity-pool* (target-pos 0) (the-as region #f))) @@ -2096,32 +2096,38 @@ ) ) ) - (set! (-> obj speech-time) (current-time)) + (set-time! (-> this speech-time)) ) ) - (whack-a-metal-method-28 obj) + (whack-a-metal-method-28 this) 0 (none) ) ;; definition for method 28 of type whack-a-metal ;; WARN: Return type mismatch int vs none. -(defmethod whack-a-metal-method-28 whack-a-metal ((obj whack-a-metal)) +(defmethod whack-a-metal-method-28 whack-a-metal ((this whack-a-metal)) (cond - ((>= (-> *game-info* score) (-> obj score)) - (set! (-> *game-info* score) (-> obj score)) + ((>= (-> *game-info* score) (-> this score)) + (set! (-> *game-info* score) (-> this score)) ) - ((and (< (-> *game-info* score) (-> obj score)) (>= (- (current-time) (-> obj score-time)) (seconds 0.1))) + ((and (< (-> *game-info* score) (-> this score)) (time-elapsed? (-> this score-time) (seconds 0.1))) (sound-play "whack-score") - (seek! (-> *game-info* score) (-> obj score) 2.0) - (set! (-> obj score-time) (current-time)) + (seek! (-> *game-info* score) (-> this score) 2.0) + (set-time! (-> this score-time)) ) ) - (let ((s5-1 (handle->process (-> obj cabinet)))) + (let ((s5-1 (handle->process (-> this cabinet)))) (when s5-1 - (spawn-with-matrix (-> obj score-part 1) (-> (the-as process-drawable s5-1) node-list data 13 bone transform)) - (spawn-with-matrix (-> obj score-part 0) (-> (the-as process-drawable s5-1) node-list data 12 bone transform)) - (dotimes (s4-1 (- 20 (-> obj miss-count))) + (spawn-with-matrix + (-> this score-part 1) + (-> (the-as process-drawable s5-1) node-list data 13 bone transform) + ) + (spawn-with-matrix + (-> this score-part 0) + (-> (the-as process-drawable s5-1) node-list data 12 bone transform) + ) + (dotimes (s4-1 (- 20 (-> this miss-count))) (set! (-> *part-id-table* 3336 init-specs 2 initial-valuef) (+ -1228.8 (* 614.4 (the float (mod s4-1 5))))) (set! (-> *part-id-table* 3336 init-specs 2 random-rangef) 0.0) (set! (-> *part-id-table* 3336 init-specs 3 initial-valuef) (- 921.6 (* 614.4 (the float (/ s4-1 5))))) @@ -2203,7 +2209,7 @@ (set-setting! 'borrow '((ctywide 1 lwidea #f) (hiphog 0 lwhack special)) 0.0 0) (want-display-level *load-state* 'ctyport #f) (want-display-level *load-state* 'ctywide #f) - (set! (-> self speech-time) (current-time)) + (set-time! (-> self speech-time)) (if (not (task-node-closed? (game-task-node city-whack-resolution))) (set! (-> self hud-goal) (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :to self))) ) @@ -2401,7 +2407,7 @@ :exit (-> (method-of-type whack-a-metal active) exit) :code (behavior ((arg0 int)) (sound-play "whack-swish") - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (dotimes (v1-3 3) (set! (-> self slot-buffer v1-3) (-> self slot-buffer (+ v1-3 1))) ) @@ -2630,7 +2636,7 @@ (+! (-> self score) 50.0) ) (else - (when (>= (- (current-time) (-> self speech-time)) (seconds 12)) + (when (time-elapsed? (-> self speech-time) (seconds 12)) (let ((v1-78 (whack-a-metal-method-29 self 3 3))) (cond ((zero? v1-78) @@ -2644,7 +2650,7 @@ ) ) ) - (set! (-> self speech-time) (current-time)) + (set-time! (-> self speech-time)) ) (process-spawn part-tracker @@ -2736,7 +2742,7 @@ ) (s5-8 (current-time)) ) - (while (or (nonzero? (get-status *gui-control* gp-1)) (< (- (current-time) s5-8) (seconds 2))) + (while (or (nonzero? (get-status *gui-control* gp-1)) (not (time-elapsed? s5-8 (seconds 2)))) (suspend) (ja :num! (loop!)) ) @@ -2808,7 +2814,7 @@ ) (s5-8 (current-time)) ) - (while (or (nonzero? (get-status *gui-control* gp-1)) (< (- (current-time) s5-8) (seconds 2))) + (while (or (nonzero? (get-status *gui-control* gp-1)) (not (time-elapsed? s5-8 (seconds 2)))) (suspend) (ja :num! (loop!)) ) 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 a41de56c03..3733bee46b 100644 --- a/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/intro-obs_REF.gc @@ -27,27 +27,27 @@ ) ;; definition for method 3 of type intro-flamer -(defmethod inspect intro-flamer ((obj intro-flamer)) - (when (not obj) - (set! obj obj) +(defmethod inspect intro-flamer ((this intro-flamer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tup-dir: #~%" (-> obj up-dir)) - (format #t "~2Taverage-dir: #~%" (-> obj average-dir)) - (format #t "~2Tid: ~D~%" (-> obj id)) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) - (format #t "~2Tz-rot: ~f~%" (-> obj z-rot)) - (format #t "~2Tflit-prev-offset: #~%" (-> obj flit-prev-offset)) - (format #t "~2Tflit-next-offset: #~%" (-> obj flit-next-offset)) - (format #t "~2Tflit-factor: ~f~%" (-> obj flit-factor)) - (format #t "~2Tflit-timer: ~D~%" (-> obj flit-timer)) - (format #t "~2Tflit-interval: ~D~%" (-> obj flit-interval)) + (format #t "~2Tup-dir: #~%" (-> this up-dir)) + (format #t "~2Taverage-dir: #~%" (-> this average-dir)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-du: ~f~%" (-> this path-du)) + (format #t "~2Tz-rot: ~f~%" (-> this z-rot)) + (format #t "~2Tflit-prev-offset: #~%" (-> this flit-prev-offset)) + (format #t "~2Tflit-next-offset: #~%" (-> this flit-next-offset)) + (format #t "~2Tflit-factor: ~f~%" (-> this flit-factor)) + (format #t "~2Tflit-timer: ~D~%" (-> this flit-timer)) + (format #t "~2Tflit-interval: ~D~%" (-> this flit-interval)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -72,7 +72,7 @@ (if (= (-> self path-u) 1.0) (go-virtual die) ) - (when (>= (- (current-time) (the-as int (-> self flit-timer))) (the-as time-frame (-> self flit-interval))) + (when (time-elapsed? (the-as int (-> self flit-timer)) (the-as time-frame (-> self flit-interval))) (let ((f28-0 (rand-vu-float-range -1.0 1.0)) (f30-0 (rand-vu-float-range -1.0 1.0)) (f0-1 (rand-vu-float-range 0.2 0.6)) @@ -218,27 +218,27 @@ ;; definition for method 22 of type intro-flamer ;; WARN: Return type mismatch object vs path-control. -(defmethod intro-flamer-method-22 intro-flamer ((obj intro-flamer)) - (the-as path-control (send-event (ppointer->process (-> obj parent)) 'path (-> obj id))) +(defmethod intro-flamer-method-22 intro-flamer ((this intro-flamer)) + (the-as path-control (send-event (ppointer->process (-> this parent)) 'path (-> this id))) ) ;; definition for method 11 of type intro-flamer ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! intro-flamer ((obj intro-flamer) (arg0 entity-actor)) +(defmethod init-from-entity! intro-flamer ((this intro-flamer) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-intro-flamer" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -294,19 +294,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type metalhead-spawner -(defmethod inspect metalhead-spawner ((obj metalhead-spawner)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalhead-spawner ((this metalhead-spawner)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpath-tbl[19] @ #x~X~%" (-> obj path-tbl)) - (format #t "~2Tinit-pos: #~%" (-> obj init-pos)) - (format #t "~2Taverage-dir: #~%" (-> obj average-dir)) + (format #t "~2Tpath-tbl[19] @ #x~X~%" (-> this path-tbl)) + (format #t "~2Tinit-pos: #~%" (-> this init-pos)) + (format #t "~2Taverage-dir: #~%" (-> this average-dir)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -357,7 +357,7 @@ This commonly includes things such as: (let ((s5-1 (the int (* 300.0 (rand-vu-float-range 0.03 0.08)))) (s4-0 (current-time)) ) - (until (>= (- (current-time) s4-0) s5-1) + (until (time-elapsed? s4-0 s5-1) (suspend) ) ) @@ -391,45 +391,45 @@ 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 ((obj metalhead-spawner) (arg0 int)) +(defmethod relocate metalhead-spawner ((this metalhead-spawner) (arg0 int)) (dotimes (v1-0 19) - (if (nonzero? (-> obj path-tbl v1-0)) - (&+! (-> obj path-tbl v1-0) arg0) + (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)) obj arg0) + ((the-as (function process int process) (find-parent-method metalhead-spawner 7)) this arg0) ) ) ;; definition for method 11 of type metalhead-spawner ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! metalhead-spawner ((obj metalhead-spawner) (arg0 entity-actor)) +(defmethod init-from-entity! metalhead-spawner ((this metalhead-spawner) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj init-pos quad) (-> arg0 extra trans quad)) - (vector-reset! (-> obj average-dir)) + (set! (-> this init-pos quad) (-> arg0 extra trans quad)) + (vector-reset! (-> this average-dir)) (dotimes (s5-0 19) - (let ((s4-0 (new 'process 'curve-control obj 'path (the float (+ s5-0 1))))) - (set! (-> obj path-tbl s5-0) s4-0) + (let ((s4-0 (new 'process 'curve-control this 'path (the float (+ s5-0 1))))) + (set! (-> this path-tbl s5-0) s4-0) (logior! (-> s4-0 flags) (path-control-flag display draw-line draw-point draw-text)) (let* ((s3-0 (get-point-at-percent-along-path! s4-0 (new 'stack-no-clear 'vector) 0.0 'interp)) (v1-10 (get-point-at-percent-along-path! s4-0 (new 'stack-no-clear 'vector) 1.0 'interp)) (s4-2 (vector-! (new 'stack-no-clear 'vector) v1-10 s3-0)) ) (vector-normalize! s4-2 1.0) - (vector+! (-> obj average-dir) (-> obj average-dir) s4-2) + (vector+! (-> this average-dir) (-> this average-dir) s4-2) ) ) ) - (vector-normalize! (-> obj average-dir) 1.0) - (go (method-of-object obj idle)) + (vector-normalize! (-> this average-dir) 1.0) + (go (method-of-object this idle)) (none) ) @@ -446,16 +446,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type vil-windmill-sail -(defmethod inspect vil-windmill-sail ((obj vil-windmill-sail)) - (when (not obj) - (set! obj obj) +(defmethod inspect vil-windmill-sail ((this vil-windmill-sail)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -482,20 +482,20 @@ This commonly includes things such as: ;; definition for method 11 of type vil-windmill-sail ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! vil-windmill-sail ((obj vil-windmill-sail) (arg0 entity-actor)) +(defmethod init-from-entity! vil-windmill-sail ((this vil-windmill-sail) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-vil-windmill-sail" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc b/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc index 87fbac6299..8c38a5d0ec 100644 --- a/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc @@ -2313,7 +2313,7 @@ () (talker-spawn-func (-> *talker-speech* 123) self (target-pos 0) (the-as region #f)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 5)) + (until (time-elapsed? gp-1 (seconds 5)) (if (cpad-pressed? 0 square) (return #f) ) @@ -2377,7 +2377,7 @@ (set! (-> gp-0 scale-y) 1.0) (when (and s5-0 (-> gp-0 tex)) (let ((s4-0 (current-time))) - (until (>= (- (current-time) s4-0) (seconds 5)) + (until (time-elapsed? s4-0 (seconds 5)) (let ((f0-2 1.0)) (cond ((< f30-0 2.0) @@ -2500,7 +2500,7 @@ ) (when (and s4-0 (-> gp-0 tex)) (let ((s3-0 (current-time))) - (until (>= (- (current-time) s3-0) (seconds 8)) + (until (time-elapsed? s3-0 (seconds 8)) (let ((f0-6 1.0)) (cond ((< f30-0 2.0) diff --git a/test/decompiler/reference/jak2/levels/intro/vortex-data_REF.gc b/test/decompiler/reference/jak2/levels/intro/vortex-data_REF.gc index 0926cf9de1..edb7ca3124 100644 --- a/test/decompiler/reference/jak2/levels/intro/vortex-data_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/vortex-data_REF.gc @@ -12,16 +12,16 @@ ) ;; definition for method 3 of type vortex-vertex -(defmethod inspect vortex-vertex ((obj vortex-vertex)) - (when (not obj) - (set! obj obj) +(defmethod inspect vortex-vertex ((this vortex-vertex)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vortex-vertex) - (format #t "~1Tpos: ~`vector`P~%" (-> obj pos)) - (format #t "~1Tstq: ~`vector`P~%" (-> obj stq)) + (format #t "[~8x] ~A~%" this 'vortex-vertex) + (format #t "~1Tpos: ~`vector`P~%" (-> this pos)) + (format #t "~1Tstq: ~`vector`P~%" (-> this stq)) (label cfg-4) - obj + this ) ;; definition of type vortex-vert-array @@ -34,15 +34,15 @@ ) ;; definition for method 3 of type vortex-vert-array -(defmethod inspect vortex-vert-array ((obj vortex-vert-array)) - (when (not obj) - (set! obj obj) +(defmethod inspect vortex-vert-array ((this vortex-vert-array)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'vortex-vert-array) - (format #t "~1Tdata[306] @ #x~X~%" (-> obj data)) + (format #t "[~8x] ~A~%" this 'vortex-vert-array) + (format #t "~1Tdata[306] @ #x~X~%" (-> this data)) (label cfg-4) - obj + this ) ;; definition of type vortex-work @@ -63,23 +63,23 @@ ) ;; definition for method 3 of type vortex-work -(defmethod inspect vortex-work ((obj vortex-work)) - (when (not obj) - (set! obj obj) +(defmethod inspect vortex-work ((this vortex-work)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tgiftag: #~%" (-> obj giftag)) - (format #t "~1Toff-s-0: ~D~%" (-> obj off-s-0)) - (format #t "~1Toff-t-0: ~D~%" (-> obj off-t-0)) - (format #t "~1Toff-s-1: ~D~%" (-> obj off-s-1)) - (format #t "~1Toff-t-1: ~D~%" (-> obj off-t-1)) - (format #t "~1Toff-s-2: ~D~%" (-> obj off-s-2)) - (format #t "~1Toff-t-2: ~D~%" (-> obj off-t-2)) - (format #t "~1Toff-s-3: ~D~%" (-> obj off-s-3)) - (format #t "~1Toff-t-3: ~D~%" (-> obj off-t-3)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tgiftag: #~%" (-> this giftag)) + (format #t "~1Toff-s-0: ~D~%" (-> this off-s-0)) + (format #t "~1Toff-t-0: ~D~%" (-> this off-t-0)) + (format #t "~1Toff-s-1: ~D~%" (-> this off-s-1)) + (format #t "~1Toff-t-1: ~D~%" (-> this off-t-1)) + (format #t "~1Toff-s-2: ~D~%" (-> this off-s-2)) + (format #t "~1Toff-t-2: ~D~%" (-> this off-t-2)) + (format #t "~1Toff-s-3: ~D~%" (-> this off-s-3)) + (format #t "~1Toff-t-3: ~D~%" (-> this off-t-3)) (label cfg-4) - obj + this ) ;; definition for symbol *vortex-work*, type vortex-work @@ -2704,7 +2704,3 @@ ;; failed to figure out what this is: (init-vortex-polys) - - - - diff --git a/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc b/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc index 77aed34698..7e3531e7db 100644 --- a/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/canyon/mincan-obs_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type water-anim-mincan -(defmethod inspect water-anim-mincan ((obj water-anim-mincan)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-anim-mincan ((this water-anim-mincan)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((func (method-of-type water-anim inspect))) - (func obj) + (func this) ) (label cfg-4) - obj + this ) ;; definition for symbol ripple-for-water-anim-mincan, type ripple-wave-set @@ -39,14 +39,14 @@ ;; definition for method 24 of type water-anim-mincan ;; WARN: Return type mismatch int vs none. -(defmethod init-water! water-anim-mincan ((obj water-anim-mincan)) +(defmethod init-water! water-anim-mincan ((this water-anim-mincan)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((func (method-of-type water-anim init-water!))) - (func obj) + (func this) ) (let ((ripple-control (new 'process 'ripple-control))) - (set! (-> obj draw ripple) ripple-control) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) ripple-control) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> ripple-control global-scale) 3072.0) (set! (-> ripple-control close-fade-dist) 163840.0) (set! (-> ripple-control far-fade-dist) 245760.0) @@ -70,16 +70,16 @@ ) ;; definition for method 3 of type mincan-lighthouse-lens -(defmethod inspect mincan-lighthouse-lens ((obj mincan-lighthouse-lens)) - (when (not obj) - (set! obj obj) +(defmethod inspect mincan-lighthouse-lens ((this mincan-lighthouse-lens)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((func (method-of-type process-drawable inspect))) - (func obj) + (func this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -129,24 +129,24 @@ ;; definition for method 11 of type mincan-lighthouse-lens ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lighthouse-lens ((obj mincan-lighthouse-lens) (arg0 entity-actor)) +(defmethod init-from-entity! mincan-lighthouse-lens ((this mincan-lighthouse-lens) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mincan-lighthouse-lens" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -182,16 +182,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mincan-lighthouse -(defmethod inspect mincan-lighthouse ((obj mincan-lighthouse)) - (when (not obj) - (set! obj obj) +(defmethod inspect mincan-lighthouse ((this mincan-lighthouse)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -242,22 +242,22 @@ This commonly includes things such as: ;; definition for method 11 of type mincan-lighthouse ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lighthouse ((obj mincan-lighthouse) (arg0 entity-actor)) +(defmethod init-from-entity! mincan-lighthouse ((this mincan-lighthouse) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mincan-lighthouse" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (process-spawn mincan-lighthouse-lens obj arg0 :to obj) - (go (method-of-object obj idle)) + (process-spawn mincan-lighthouse-lens this arg0 :to this) + (go (method-of-object this idle)) (none) ) @@ -275,16 +275,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mincan-lens -(defmethod inspect mincan-lens ((obj mincan-lens)) - (when (not obj) - (set! obj obj) +(defmethod inspect mincan-lens ((this mincan-lens)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -335,14 +335,14 @@ This commonly includes things such as: ;; definition for method 11 of type mincan-lens ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-lens ((obj mincan-lens) (arg0 entity-actor)) +(defmethod init-from-entity! mincan-lens ((this mincan-lens) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 7) 0))) (set! (-> cshape total-prims) (the-as uint 8)) (set! (-> prim-group prim-core collide-as) (collide-spec obstacle)) @@ -405,15 +405,15 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mincan-lens" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj closed)) + (go (method-of-object this closed)) (none) ) @@ -430,16 +430,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mincan-cogs -(defmethod inspect mincan-cogs ((obj mincan-cogs)) - (when (not obj) - (set! obj obj) +(defmethod inspect mincan-cogs ((this mincan-cogs)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -467,20 +467,20 @@ This commonly includes things such as: ;; definition for method 11 of type mincan-cogs ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mincan-cogs ((obj mincan-cogs) (arg0 entity-actor)) +(defmethod init-from-entity! mincan-cogs ((this mincan-cogs) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mincan-cogs" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc index 6fa75de2a5..1c5585a258 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-obs2_REF.gc @@ -16,16 +16,16 @@ ) ;; definition for method 3 of type mtn-iris-door -(defmethod inspect mtn-iris-door ((obj mtn-iris-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-iris-door ((this mtn-iris-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -76,14 +76,14 @@ ;; definition for method 11 of type mtn-iris-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-iris-door ((obj mtn-iris-door) (entity entity-actor)) +(defmethod init-from-entity! mtn-iris-door ((this mtn-iris-door) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -98,15 +98,15 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-iris-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj close)) + (go (method-of-object this close)) (none) ) @@ -131,27 +131,27 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-plat-shoot -(defmethod inspect mtn-plat-shoot ((obj mtn-plat-shoot)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-plat-shoot ((this mtn-plat-shoot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tangle-flip: ~f~%" (-> obj angle-flip)) - (format #t "~2Tangle-flip-vel: ~f~%" (-> obj angle-flip-vel)) - (format #t "~2Taxe-flip: #~%" (-> obj axe-flip)) - (format #t "~2Tstate-flip: ~D~%" (-> obj state-flip)) - (format #t "~2Thit-time: ~D~%" (-> obj hit-time)) - (format #t "~2Ttime-flip: ~f~%" (-> obj time-flip)) - (format #t "~2Tdisable-track-under: ~A~%" (-> obj disable-track-under)) - (format #t "~2Tdest-angle: ~f~%" (-> obj dest-angle)) - (format #t "~2Ton-shake: ~A~%" (-> obj on-shake)) - (format #t "~2Thint-count: ~f~%" (-> obj hint-count)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tangle-flip: ~f~%" (-> this angle-flip)) + (format #t "~2Tangle-flip-vel: ~f~%" (-> this angle-flip-vel)) + (format #t "~2Taxe-flip: #~%" (-> this axe-flip)) + (format #t "~2Tstate-flip: ~D~%" (-> this state-flip)) + (format #t "~2Thit-time: ~D~%" (-> this hit-time)) + (format #t "~2Ttime-flip: ~f~%" (-> this time-flip)) + (format #t "~2Tdisable-track-under: ~A~%" (-> this disable-track-under)) + (format #t "~2Tdest-angle: ~f~%" (-> this dest-angle)) + (format #t "~2Ton-shake: ~A~%" (-> this on-shake)) + (format #t "~2Thint-count: ~f~%" (-> this hint-count)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -161,16 +161,16 @@ This commonly includes things such as: ) ;; definition for method 30 of type mtn-plat-shoot -(defmethod get-art-group mtn-plat-shoot ((obj mtn-plat-shoot)) +(defmethod get-art-group mtn-plat-shoot ((this mtn-plat-shoot)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-shoot" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type mtn-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-shoot ((obj mtn-plat-shoot)) +(defmethod init-plat-collision! mtn-plat-shoot ((this mtn-plat-shoot)) "TODO - collision stuff for setting up the platform" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec pusher)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -186,7 +186,7 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving cshape)) + (set! (-> this root) (the-as collide-shape-moving cshape)) ) 0 (none) @@ -194,31 +194,33 @@ This commonly includes things such as: ;; definition for method 32 of type mtn-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 mtn-plat-shoot ((obj mtn-plat-shoot)) +(defmethod base-plat-method-32 mtn-plat-shoot ((this mtn-plat-shoot)) 0 (none) ) ;; definition for method 33 of type mtn-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! mtn-plat-shoot ((obj mtn-plat-shoot)) +(defmethod init-plat! mtn-plat-shoot ((this mtn-plat-shoot)) "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." - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask enemy)) - (set-vector! (-> obj axe-flip) 1.0 0.0 0.0 1.0) - (set! (-> obj angle-flip) 180.0) - (set! (-> obj time-flip) (the float (the int (* 300.0 (res-lump-float (-> obj entity) 'delay :default 4.0))))) - (set! (-> obj disable-track-under) #f) - (if (>= (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj disable-track-under) (the-as basic #t)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask enemy)) + (set-vector! (-> this axe-flip) 1.0 0.0 0.0 1.0) + (set! (-> this angle-flip) 180.0) + (set! (-> this time-flip) + (the float (the int (* 300.0 (res-lump-float (-> this entity) 'delay :default 4.0)))) + ) + (set! (-> this disable-track-under) #f) + (if (>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) + (set! (-> this disable-track-under) (the-as basic #t)) ) - (set! (-> obj hint-count) 0.0) + (set! (-> this hint-count) 0.0) (if (> (you-suck-stage *game-info* #f) 0) - (set! (-> obj hint-count) 5.0) + (set! (-> this hint-count) 5.0) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "shoot-plat-lp" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "shoot-plat-lp" :fo-max 70) (-> this root trans)) ) 0 (none) @@ -262,7 +264,7 @@ For example for an elevator pre-compute the distance between the first and last (vector-normalize! (-> self axe-flip) 1.0) (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) (set! (-> self angle-flip-vel) -10.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -311,10 +313,10 @@ For example for an elevator pre-compute the distance between the first and last ) (set! (-> self dest-angle) 180.0) (set! (-> self on-shake) #f) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (the int (-> self time-flip))) + (when (time-elapsed? (-> self state-time) (the int (-> self time-flip))) (set! (-> self state-flip) (the-as uint 0)) 0 ) @@ -336,9 +338,7 @@ For example for an elevator pre-compute the distance between the first and last (+! (-> self angle-flip-vel) (* -6.0 (seconds-per-frame) (-> self angle-flip-vel))) (+! (-> self angle-flip) (-> self angle-flip-vel)) (quaternion-vector-angle! (-> self root quat) (-> self axe-flip) (* 182.04445 (-> self angle-flip))) - (when (and (>= (- (current-time) (-> self state-time)) (the int (+ -300.0 (-> self time-flip)))) - (= 1 (-> self state-flip)) - ) + (when (and (time-elapsed? (-> self state-time) (the int (+ -300.0 (-> self time-flip)))) (= 1 (-> self state-flip))) (when (not (-> self on-shake)) (sound-play "mtn-plat-shake") (set! (-> self on-shake) #t) 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 1bc20fb259..c0b00899b1 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-obs_REF.gc @@ -55,46 +55,46 @@ ) ;; definition for method 3 of type mtn-dice-button -(defmethod inspect mtn-dice-button ((obj mtn-dice-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-dice-button ((this mtn-dice-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type basebutton inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type mtn-dice-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 mtn-dice-button ((obj mtn-dice-button)) +(defmethod basebutton-method-33 mtn-dice-button ((this mtn-dice-button)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-dice-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) - (let ((s5-1 (-> obj skel root-channel 0))) + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) ) ) (else - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) @@ -107,9 +107,9 @@ ;; definition for method 34 of type mtn-dice-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-34 mtn-dice-button ((obj mtn-dice-button)) +(defmethod basebutton-method-34 mtn-dice-button ((this mtn-dice-button)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -125,7 +125,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -133,11 +133,11 @@ ;; definition for method 35 of type mtn-dice-button ;; WARN: Return type mismatch int vs none. -(defmethod prepare-trigger-event! mtn-dice-button ((obj mtn-dice-button)) +(defmethod prepare-trigger-event! mtn-dice-button ((this mtn-dice-button)) "Sets `event-going-down` to `'trigger`" - (logior! (-> obj button-status) (button-status button-status-4)) - (logior! (-> obj button-status) (button-status pressed)) - (set! (-> obj event-going-down) 'trigger) + (logior! (-> this button-status) (button-status button-status-4)) + (logior! (-> this button-status) (button-status pressed)) + (set! (-> this event-going-down) 'trigger) 0 (none) ) @@ -334,33 +334,33 @@ ) ;; definition for method 3 of type mtn-dice -(defmethod inspect mtn-dice ((obj mtn-dice)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-dice ((this mtn-dice)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Twatervol: ~A~%" (-> obj watervol)) - (format #t "~2Tface-matrix[6] @ #x~X~%" (-> obj face-matrix)) - (format #t "~2Tface-matrix-back[6] @ #x~X~%" (-> obj face-matrix-back)) - (format #t "~2Tface-status[6] @ #x~X~%" (-> obj face-status)) - (format #t "~2Ttime-anim: ~f~%" (-> obj time-anim)) - (format #t "~2Tspeed-anim: ~f~%" (-> obj speed-anim)) - (format #t "~2Trot-axis: #~%" (-> obj rot-axis)) - (format #t "~2Trot-org: #~%" (-> obj rot-org)) - (format #t "~2Tfirst: ~D~%" (-> obj first)) - (format #t "~2Tactive: ~D~%" (-> obj active)) - (format #t "~2Tfree-face: ~D~%" (-> obj free-face)) - (format #t "~2Tcolor: #~%" (-> obj color)) - (format #t "~2Tpunch-anim: ~A~%" (-> obj punch-anim)) - (format #t "~2Tfirst-touch-time: ~D~%" (-> obj first-touch-time)) - (format #t "~2Tcurtime: ~D~%" (-> obj curtime)) - (format #t "~2Thint-count: ~f~%" (-> obj hint-count)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Twatervol: ~A~%" (-> this watervol)) + (format #t "~2Tface-matrix[6] @ #x~X~%" (-> this face-matrix)) + (format #t "~2Tface-matrix-back[6] @ #x~X~%" (-> this face-matrix-back)) + (format #t "~2Tface-status[6] @ #x~X~%" (-> this face-status)) + (format #t "~2Ttime-anim: ~f~%" (-> this time-anim)) + (format #t "~2Tspeed-anim: ~f~%" (-> this speed-anim)) + (format #t "~2Trot-axis: #~%" (-> this rot-axis)) + (format #t "~2Trot-org: #~%" (-> this rot-org)) + (format #t "~2Tfirst: ~D~%" (-> this first)) + (format #t "~2Tactive: ~D~%" (-> this active)) + (format #t "~2Tfree-face: ~D~%" (-> this free-face)) + (format #t "~2Tcolor: #~%" (-> this color)) + (format #t "~2Tpunch-anim: ~A~%" (-> this punch-anim)) + (format #t "~2Tfirst-touch-time: ~D~%" (-> this first-touch-time)) + (format #t "~2Tcurtime: ~D~%" (-> this curtime)) + (format #t "~2Thint-count: ~f~%" (-> this hint-count)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -371,15 +371,15 @@ ;; definition for method 25 of type mtn-dice ;; WARN: Return type mismatch int vs none. -(defmethod mtn-dice-method-25 mtn-dice ((obj mtn-dice) (arg0 int)) - (let ((s4-0 (-> obj face-matrix arg0))) +(defmethod mtn-dice-method-25 mtn-dice ((this mtn-dice) (arg0 int)) + (let ((s4-0 (-> this face-matrix arg0))) (dotimes (s3-0 6) - (let* ((v1-4 (-> obj face-matrix s3-0)) + (let* ((v1-4 (-> this face-matrix s3-0)) (f0-2 (fabs (vector-dot (the-as vector s4-0) (the-as vector v1-4)))) ) - (when (and (!= s3-0 arg0) (zero? (-> obj face-status s3-0)) (< f0-2 0.001)) - (set! (-> obj face-status s3-0) 1) - (mtn-dice-method-25 obj s3-0) + (when (and (!= s3-0 arg0) (zero? (-> this face-status s3-0)) (< f0-2 0.001)) + (set! (-> this face-status s3-0) 1) + (mtn-dice-method-25 this s3-0) ) ) ) @@ -409,12 +409,12 @@ ) ) (sound-play "dice-sink") - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (set! (-> self draw color-mult quad) (-> self color quad)) (cond - ((>= (- (current-time) (-> self state-time)) (seconds 0.5)) + ((time-elapsed? (-> self state-time) (seconds 0.5)) (+! (-> self speed-anim) (* -0.5 (seconds-per-frame) (-> self time-anim))) (+! (-> self speed-anim) (* -6.0 (seconds-per-frame) (-> self speed-anim))) (+! (-> self time-anim) (-> self speed-anim)) @@ -426,7 +426,7 @@ (set! (-> self active) (the-as uint 3)) ) ) - (when (and (>= (- (current-time) (-> self state-time)) (seconds 0.5)) (!= (-> self active) 2)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.5)) (!= (-> self active) 2)) (set! (-> self active) (the-as uint 2)) (dotimes (gp-0 6) (matrix-rotate-xyz! (-> self face-matrix gp-0) (-> *dice-angle-array* gp-0)) @@ -458,7 +458,7 @@ (+ (-> self face-matrix-back v1-51 trans y) (* 4096.0 (-> self time-anim))) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 2)) + (when (time-elapsed? (-> self state-time) (seconds 2)) (set! (-> self active) (-> self first)) (go-virtual idle) ) @@ -469,7 +469,7 @@ ;; definition for method 26 of type mtn-dice ;; INFO: Used lq/sq -(defmethod mtn-dice-method-26 mtn-dice ((obj mtn-dice) (arg0 process-focusable) (arg1 touching-shapes-entry)) +(defmethod mtn-dice-method-26 mtn-dice ((this mtn-dice) (arg0 process-focusable) (arg1 touching-shapes-entry)) (local-vars (sv-96 vector) (sv-112 vector) (sv-128 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -498,17 +498,17 @@ ) (let ((s1-1 (-> arg1 head))) (while s1-1 - (let ((v1-4 (get-touched-prim s1-1 (-> obj root) arg1))) + (let ((v1-4 (get-touched-prim s1-1 (-> this root) arg1))) (-> v1-4 cshape) (set! sv-128 (new 'stack-no-clear 'vector)) (set! (-> sv-128 quad) (the-as uint128 0)) (set! sv-112 (new 'stack-no-clear 'vector)) (let ((s0-1 (new 'stack-no-clear 'vector))) (new 'stack-no-clear 'vector) - (when (>= (-> obj face-status (-> v1-4 prim-id)) 0) - (set! (-> sv-128 quad) (-> obj face-matrix (-> v1-4 prim-id) quad 0)) - (set! (-> sv-128 w) (- (vector-dot (-> obj face-matrix (-> v1-4 prim-id) trans) sv-128))) - (set! (-> sv-112 quad) (-> obj face-matrix (-> v1-4 prim-id) trans quad)) + (when (>= (-> this face-status (-> v1-4 prim-id)) 0) + (set! (-> sv-128 quad) (-> this face-matrix (-> v1-4 prim-id) quad 0)) + (set! (-> sv-128 w) (- (vector-dot (-> this face-matrix (-> v1-4 prim-id) trans) sv-128))) + (set! (-> sv-112 quad) (-> this face-matrix (-> v1-4 prim-id) trans quad)) (let ((f0-4 (vector4-dot sv-128 (-> s4-0 trans))) (f28-0 (vector-dot sv-128 s3-1)) ) @@ -537,7 +537,7 @@ ) ) (let ((a0-40 sv-112)) - (let ((v1-8 (-> obj face-matrix (-> v1-4 prim-id) trans))) + (let ((v1-8 (-> this face-matrix (-> v1-4 prim-id) trans))) (let ((a1-26 sv-128)) (let ((a2-10 16384.0)) (.mov vf7 a2-10) @@ -553,7 +553,7 @@ ) (vector-negate-in-place! sv-128) (set! f28-0 (- f28-0)) - (if (!= (-> obj free-face) 5) + (if (!= (-> this free-face) 5) (set! f28-0 1.0) ) ) @@ -595,7 +595,7 @@ ;; definition for method 27 of type mtn-dice ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod mtn-dice-method-27 mtn-dice ((obj mtn-dice) (arg0 collide-shape) (arg1 process-focusable) (arg2 touching-shapes-entry)) +(defmethod mtn-dice-method-27 mtn-dice ((this mtn-dice) (arg0 collide-shape) (arg1 process-focusable) (arg2 touching-shapes-entry)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -611,9 +611,12 @@ ) ) (when s0-0 - (let ((s5-1 - ((method-of-type touching-prims-entry get-touched-prim) (the-as touching-prims-entry arg0) (-> obj root) arg2) - ) + (let ((s5-1 ((method-of-type touching-prims-entry get-touched-prim) + (the-as touching-prims-entry arg0) + (-> this root) + arg2 + ) + ) ) (-> s5-1 cshape) (let ((s1-0 (new-stack-vector0)) @@ -621,7 +624,7 @@ (s3-1 (new 'stack-no-clear 'vector)) (s4-1 (new 'stack-no-clear 'vector)) ) - (let ((v1-6 (-> obj face-matrix (-> s5-1 prim-id)))) + (let ((v1-6 (-> this face-matrix (-> s5-1 prim-id)))) (set! (-> s1-0 quad) (-> v1-6 vector 0 quad)) (set! (-> s1-0 w) (- (vector-dot (-> v1-6 trans) s1-0))) (set! (-> s4-1 quad) (-> v1-6 trans quad)) @@ -648,11 +651,11 @@ (set! (-> s2-0 y) 1.0) (vector-cross! s3-1 s2-0 s1-0) (vector-normalize! s3-1 1.0) - (set! (-> obj rot-axis quad) (-> s3-1 quad)) - (set! (-> obj rot-org quad) (-> s4-1 quad)) + (set! (-> this rot-axis quad) (-> s3-1 quad)) + (set! (-> this rot-org quad) (-> s4-1 quad)) ) - (set! (-> obj face-status (-> s5-1 prim-id)) 1) - (mtn-dice-method-25 obj (the-as int (-> s5-1 prim-id))) + (set! (-> this face-status (-> s5-1 prim-id)) 1) + (mtn-dice-method-25 this (the-as int (-> s5-1 prim-id))) ) ) ) @@ -671,15 +674,15 @@ ) ;; definition for method 3 of type mtn-dice-info -(defmethod inspect mtn-dice-info ((obj mtn-dice-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-dice-info ((this mtn-dice-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mtn-dice-info) - (format #t "~1Tmat[12] @ #x~X~%" (-> obj mat)) + (format #t "[~8x] ~A~%" this 'mtn-dice-info) + (format #t "~1Tmat[12] @ #x~X~%" (-> this mat)) (label cfg-4) - obj + this ) ;; definition for symbol *mtn-dice-done-info*, type (array mtn-dice-info) @@ -928,9 +931,9 @@ ) :trans (behavior () (if (nonzero? (-> self curtime)) - (set! (-> self first-touch-time) (current-time)) + (set-time! (-> self first-touch-time)) ) - (set! (-> self curtime) (current-time)) + (set-time! (-> self curtime)) (when (and (zero? (-> self active)) (dice-wrong-way?)) ) ) @@ -1012,7 +1015,7 @@ (set! (-> a0-2 trans quad) t0-1) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self time-anim) 1.0) (set! (-> self speed-anim) -0.5) ) @@ -1033,7 +1036,7 @@ (set! (-> self time-anim) 0.0) (set! (-> self speed-anim) (- (-> self speed-anim))) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.7)) + (if (time-elapsed? (-> self state-time) (seconds 0.7)) (set! (-> self time-anim) 0.0) ) (let ((s4-0 (new 'stack-no-clear 'matrix)) @@ -1055,7 +1058,7 @@ ) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.7)) + (when (time-elapsed? (-> self state-time) (seconds 0.7)) (dotimes (v1-34 6) (when (= (-> self face-status v1-34) 1) (set! (-> self face-status v1-34) 0) @@ -1077,7 +1080,7 @@ :enter (behavior () (set! (-> self time-anim) 0.0) (set! (-> self speed-anim) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "dice-sink") ) :trans (behavior () @@ -1088,7 +1091,7 @@ (dotimes (v1-5 6) (+! (-> self face-matrix v1-5 trans y) (* 4096.0 (-> self time-anim))) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (dotimes (v1-11 6) (when (= (-> self face-status v1-11) 1) (set! (-> self face-status v1-11) 0) @@ -1371,14 +1374,14 @@ ;; definition for method 11 of type mtn-dice ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-dice ((obj mtn-dice) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-dice ((this mtn-dice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 6) 0))) (set! (-> s4-0 total-prims) (the-as uint 7)) (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) @@ -1435,24 +1438,24 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-23 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-dice" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel postbind-function) dice-joint-callback) - (set! (-> obj first) (the-as uint 0)) + (set! (-> this skel postbind-function) dice-joint-callback) + (set! (-> this first) (the-as uint 0)) (let ((v1-30 (res-lump-value arg0 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) (if (= (the-as uint v1-30) 2) - (set! (-> obj first) (the-as uint 1)) + (set! (-> this first) (the-as uint 1)) ) ) - (let* ((a0-48 (the int (* 0.00024414062 (-> obj root trans x)))) - (v1-37 (the int (* 0.00024414062 (-> obj root trans y)))) - (a1-21 (the int (* 0.00024414062 (-> obj root trans z)))) + (let* ((a0-48 (the int (* 0.00024414062 (-> this root trans x)))) + (v1-37 (the int (* 0.00024414062 (-> this root trans y)))) + (a1-21 (the int (* 0.00024414062 (-> this root trans z)))) (a0-49 (- a0-48 *dice-offset-x*)) (a2-13 (- a1-21 *dice-offset-z*)) (a1-22 (+ a0-49 1)) @@ -1463,55 +1466,55 @@ This commonly includes things such as: (a1-24 (+ a1-23 *dice-offset-x*)) (a0-52 (+ a0-51 *dice-offset-z*)) ) - (set! (-> obj root trans x) (* 4096.0 (the float a1-24))) - (set! (-> obj root trans y) (* 4096.0 (the float v1-38))) - (set! (-> obj root trans z) (* 4096.0 (the float a0-52))) + (set! (-> this root trans x) (* 4096.0 (the float a1-24))) + (set! (-> this root trans y) (* 4096.0 (the float v1-38))) + (set! (-> this root trans z) (* 4096.0 (the float a0-52))) ) (dotimes (s4-2 6) - (matrix-rotate-xyz! (-> obj face-matrix s4-2) (-> *dice-angle-array* s4-2)) - (set! (-> obj face-matrix s4-2 trans quad) (-> *dice-position-array* s4-2 quad)) - (vector+! (-> obj face-matrix s4-2 trans) (-> obj face-matrix s4-2 trans) (-> obj root trans)) - (+! (-> obj face-matrix s4-2 trans y) 8192.0) + (matrix-rotate-xyz! (-> this face-matrix s4-2) (-> *dice-angle-array* s4-2)) + (set! (-> this face-matrix s4-2 trans quad) (-> *dice-position-array* s4-2 quad)) + (vector+! (-> this face-matrix s4-2 trans) (-> this face-matrix s4-2 trans) (-> this root trans)) + (+! (-> this face-matrix s4-2 trans y) 8192.0) ) (mem-set32! (the-as pointer *dice-blocked-array*) 13 0) (set! (-> *dice-blocked-array* 1) (the-as uint 256)) (set! *dice-back-way-num* 0) (set-vector! *dice-last-safe-position* -2603417.5 384983.03 -107683.84 1.0) - (set-vector! (-> obj color) 0.5 0.5 0.5 1.0) - (set! (-> obj free-face) (the-as uint 6)) - (set! (-> obj watervol) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj hint-count) 0.0) - (set! (-> obj active) (-> obj first)) - (setup-masks (-> obj draw) 0 -1) - (setup-masks (-> obj draw) 1 0) + (set-vector! (-> this color) 0.5 0.5 0.5 1.0) + (set! (-> this free-face) (the-as uint 6)) + (set! (-> this watervol) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this hint-count) 0.0) + (set! (-> this active) (-> this first)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) (cond ((task-node-closed? (game-task-node mountain-shard-dice)) (let ((v1-71 (res-lump-value arg0 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) (dotimes (a0-76 6) (let ((a1-42 (-> *mtn-dice-done-info* (+ a0-76 (* 6 (the-as int (+ v1-71 -1))))))) - (set! (-> obj face-matrix a0-76 vector 0 x) (-> a1-42 mat 0)) - (set! (-> obj face-matrix a0-76 vector 0 y) (-> a1-42 mat 1)) - (set! (-> obj face-matrix a0-76 vector 0 z) (-> a1-42 mat 2)) - (set! (-> obj face-matrix a0-76 vector 0 w) 0.0) - (set! (-> obj face-matrix a0-76 vector 1 x) (-> a1-42 mat 3)) - (set! (-> obj face-matrix a0-76 vector 1 y) (-> a1-42 mat 4)) - (set! (-> obj face-matrix a0-76 vector 1 z) (-> a1-42 mat 5)) - (set! (-> obj face-matrix a0-76 vector 1 w) 0.0) - (set! (-> obj face-matrix a0-76 vector 2 x) (-> a1-42 mat 6)) - (set! (-> obj face-matrix a0-76 vector 2 y) (-> a1-42 mat 7)) - (set! (-> obj face-matrix a0-76 vector 2 z) (-> a1-42 mat 8)) - (set! (-> obj face-matrix a0-76 vector 2 w) 0.0) - (set! (-> obj face-matrix a0-76 trans x) (-> a1-42 mat 9)) - (set! (-> obj face-matrix a0-76 trans y) (-> a1-42 mat 10)) - (set! (-> obj face-matrix a0-76 trans z) (-> a1-42 mat 11)) + (set! (-> this face-matrix a0-76 vector 0 x) (-> a1-42 mat 0)) + (set! (-> this face-matrix a0-76 vector 0 y) (-> a1-42 mat 1)) + (set! (-> this face-matrix a0-76 vector 0 z) (-> a1-42 mat 2)) + (set! (-> this face-matrix a0-76 vector 0 w) 0.0) + (set! (-> this face-matrix a0-76 vector 1 x) (-> a1-42 mat 3)) + (set! (-> this face-matrix a0-76 vector 1 y) (-> a1-42 mat 4)) + (set! (-> this face-matrix a0-76 vector 1 z) (-> a1-42 mat 5)) + (set! (-> this face-matrix a0-76 vector 1 w) 0.0) + (set! (-> this face-matrix a0-76 vector 2 x) (-> a1-42 mat 6)) + (set! (-> this face-matrix a0-76 vector 2 y) (-> a1-42 mat 7)) + (set! (-> this face-matrix a0-76 vector 2 z) (-> a1-42 mat 8)) + (set! (-> this face-matrix a0-76 vector 2 w) 0.0) + (set! (-> this face-matrix a0-76 trans x) (-> a1-42 mat 9)) + (set! (-> this face-matrix a0-76 trans y) (-> a1-42 mat 10)) + (set! (-> this face-matrix a0-76 trans z) (-> a1-42 mat 11)) ) - (set! (-> obj face-matrix a0-76 trans w) 1.0) + (set! (-> this face-matrix a0-76 trans w) 1.0) ) ) - (go (method-of-object obj idle-done)) + (go (method-of-object this idle-done)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1527,16 +1530,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-plat-elevator -(defmethod inspect mtn-plat-elevator ((obj mtn-plat-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-plat-elevator ((this mtn-plat-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elevator inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1546,34 +1549,34 @@ This commonly includes things such as: ) ;; definition for method 30 of type mtn-plat-elevator -(defmethod get-art-group mtn-plat-elevator ((obj mtn-plat-elevator)) +(defmethod get-art-group mtn-plat-elevator ((this mtn-plat-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 42 of type mtn-plat-elevator ;; WARN: Return type mismatch int vs none. -(defmethod set-ambient-sound! mtn-plat-elevator ((obj mtn-plat-elevator)) +(defmethod set-ambient-sound! mtn-plat-elevator ((this mtn-plat-elevator)) "Sets the elevator's [[ambient-sound]] up" - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "mtn-elevator-lp" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "mtn-elevator-lp" :fo-max 70) (-> this root trans)) ) 0 (none) ) ;; definition for method 43 of type mtn-plat-elevator -(defmethod move-between-points mtn-plat-elevator ((obj mtn-plat-elevator) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points mtn-plat-elevator ((this mtn-plat-elevator) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) ) (and (< (-> a0-3 y) (-> s4-0 y)) - (< (-> arg0 y) (+ -4096.0 (-> obj root trans y))) + (< (-> arg0 y) (+ -4096.0 (-> this root trans y))) (< (vector-vector-xz-distance a0-3 arg0) 24576.0) ) ) @@ -1581,9 +1584,9 @@ This commonly includes things such as: ;; definition for method 31 of type mtn-plat-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-elevator ((obj mtn-plat-elevator)) +(defmethod init-plat-collision! mtn-plat-elevator ((this mtn-plat-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -1599,7 +1602,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -1621,18 +1624,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-plat-updown -(defmethod inspect mtn-plat-updown ((obj mtn-plat-updown)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-plat-updown ((this mtn-plat-updown)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1672,9 +1675,9 @@ This commonly includes things such as: ;; definition for method 31 of type mtn-plat-updown ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-updown ((obj mtn-plat-updown)) +(defmethod init-plat-collision! mtn-plat-updown ((this mtn-plat-updown)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -1690,7 +1693,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -1698,44 +1701,44 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-plat-updown ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-updown ((obj mtn-plat-updown) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-plat-updown ((this mtn-plat-updown) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-plat-updown" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) (set! (-> a0-5 param 0) 1.0) (set! (-> a0-5 frame-num) 0.0) (joint-control-channel-group! a0-5 - (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) num-func-loop! ) ) (ja-post) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 arg0 #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-7 (new 'stack-no-clear 'sync-info-params))) (let ((v1-24 0)) - (if (not (logtest? (-> obj fact options) (actor-option loop))) + (if (not (logtest? (-> this fact options) (actor-option loop))) (set! v1-24 (logior v1-24 1)) ) (set! (-> a1-7 sync-type) 'sync-eased) @@ -1748,17 +1751,17 @@ This commonly includes things such as: (set! (-> a1-7 ease-out) 0.15) (set! (-> a1-7 pause-in) 0.2) (set! (-> a1-7 pause-out) 0.0) - (initialize! (-> obj sync) a1-7) + (initialize! (-> this sync) a1-7) ) (cond - ((logtest? (-> obj path flags) (path-control-flag not-found)) - (go (method-of-object obj idle)) + ((logtest? (-> this path flags) (path-control-flag not-found)) + (go (method-of-object this idle)) ) - ((> (-> obj sync period) 0) - (go (method-of-object obj active)) + ((> (-> this sync period) 0) + (go (method-of-object this active)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1780,17 +1783,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-plat-eject -(defmethod inspect mtn-plat-eject ((obj mtn-plat-eject)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-plat-eject ((this mtn-plat-eject)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tdest-pos: #~%" (-> obj dest-pos)) + (format #t "~2Tdest-pos: #~%" (-> this dest-pos)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1832,8 +1835,8 @@ This commonly includes things such as: ;; definition for method 22 of type mtn-plat-eject ;; WARN: Return type mismatch int vs none. -(defmethod mtn-plat-eject-method-22 mtn-plat-eject ((obj mtn-plat-eject)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) +(defmethod mtn-plat-eject-method-22 mtn-plat-eject ((this mtn-plat-eject)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -1848,7 +1851,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1857,32 +1860,32 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-plat-eject ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-eject ((obj mtn-plat-eject) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-plat-eject ((this mtn-plat-eject) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (mtn-plat-eject-method-22 obj) - (process-drawable-from-entity! obj arg0) + (mtn-plat-eject-method-22 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-plat-eject" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj dest-pos quad) (-> obj root trans quad)) + (set! (-> this dest-pos quad) (-> this root trans quad)) (let ((s5-2 (new 'stack-no-clear 'vector))) (set! (-> s5-2 x) 0.0) (set! (-> s5-2 y) 0.0) (set! (-> s5-2 z) -40960.0) (set! (-> s5-2 w) 1.0) - (vector-orient-by-quat! s5-2 s5-2 (-> obj root quat)) - (vector+! (-> obj root trans) (-> obj root trans) s5-2) + (vector-orient-by-quat! s5-2 s5-2 (-> this root quat)) + (vector+! (-> this root trans) (-> this root trans) s5-2) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj eject)) - (go (method-of-object obj wait)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this eject)) + (go (method-of-object this wait)) ) (none) ) @@ -1901,17 +1904,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-plat-long -(defmethod inspect mtn-plat-long ((obj mtn-plat-long)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-plat-long ((this mtn-plat-long)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) + (format #t "~2Tsync: #~%" (-> this sync)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1946,9 +1949,9 @@ This commonly includes things such as: ;; definition for method 31 of type mtn-plat-long ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-long ((obj mtn-plat-long)) +(defmethod init-plat-collision! mtn-plat-long ((this mtn-plat-long)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -1964,7 +1967,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -1972,29 +1975,29 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-plat-long ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-long ((obj mtn-plat-long) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-plat-long ((this mtn-plat-long) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-plat-long" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (stop-bouncing! obj) - (update-transforms (-> obj root)) - (base-plat-method-32 obj) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (stop-bouncing! this) + (update-transforms (-> this root)) + (base-plat-method-32 this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-5 (new 'stack-no-clear 'sync-info-params))) (let ((v1-13 0)) - (if (not (logtest? (-> obj fact options) (actor-option loop))) + (if (not (logtest? (-> this fact options) (actor-option loop))) (set! v1-13 (logior v1-13 1)) ) (set! (-> a1-5 sync-type) 'sync-linear) @@ -2003,9 +2006,9 @@ This commonly includes things such as: (set! (-> a1-5 entity) arg0) (set! (-> a1-5 period) (the-as uint 1200)) (set! (-> a1-5 percent) 0.0) - (initialize! (-> obj sync) a1-5) + (initialize! (-> this sync) a1-5) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2023,16 +2026,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-gate -(defmethod inspect mtn-gate ((obj mtn-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-gate ((this mtn-gate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2063,7 +2066,7 @@ This commonly includes things such as: ) (set-setting! 'entity-name "camera-259" 0.0 0) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -2073,7 +2076,7 @@ This commonly includes things such as: (ja :num! (seek!)) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -2087,14 +2090,14 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-gate ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-gate ((obj mtn-gate) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-gate ((this mtn-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -2121,25 +2124,25 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-gate" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-push! 1 0) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2162,30 +2165,30 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-aval-rocks -(defmethod inspect mtn-aval-rocks ((obj mtn-aval-rocks)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-aval-rocks ((this mtn-aval-rocks)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tart-name: ~A~%" (-> obj art-name)) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Trock-data: ~A~%" (-> obj rock-data)) - (format #t "~2Tloop-id: ~D~%" (-> obj loop-id)) - (format #t "~2Tvolume: ~f~%" (-> obj volume)) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Trock-data: ~A~%" (-> this rock-data)) + (format #t "~2Tloop-id: ~D~%" (-> this loop-id)) + (format #t "~2Tvolume: ~f~%" (-> this volume)) (label cfg-4) - obj + this ) ;; definition for method 7 of type mtn-aval-rocks ;; WARN: Return type mismatch process-drawable vs mtn-aval-rocks. -(defmethod relocate mtn-aval-rocks ((obj mtn-aval-rocks) (arg0 int)) - (if (nonzero? (-> obj rock-data)) - (&+! (-> obj rock-data) arg0) +(defmethod relocate mtn-aval-rocks ((this mtn-aval-rocks) (arg0 int)) + (if (nonzero? (-> this rock-data)) + (&+! (-> this rock-data) arg0) ) - (the-as mtn-aval-rocks ((method-of-type process-drawable relocate) obj arg0)) + (the-as mtn-aval-rocks ((method-of-type process-drawable relocate) this arg0)) ) ;; definition of type mtn-aval-rocks-shadow @@ -2204,18 +2207,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-aval-rocks-shadow -(defmethod inspect mtn-aval-rocks-shadow ((obj mtn-aval-rocks-shadow)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-aval-rocks-shadow ((this mtn-aval-rocks-shadow)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tparent-joint: ~D~%" (-> obj parent-joint)) - (format #t "~2Tupdate-time: ~D~%" (-> obj update-time)) + (format #t "~2Tparent-joint: ~D~%" (-> this parent-joint)) + (format #t "~2Tupdate-time: ~D~%" (-> this update-time)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2591,7 +2594,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-aval-rocks ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-aval-rocks ((obj mtn-aval-rocks) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-aval-rocks ((this mtn-aval-rocks) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2599,8 +2602,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-sphere) (sv-48 collide-shape-prim-sphere) (sv-64 vector)) - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 49) 0))) (set! (-> s4-0 total-prims) (the-as uint 50)) @@ -2689,41 +2692,43 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-27 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-27 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) 32768.0) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) 32768.0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-aval-rocks-1" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (set! (-> obj art-name) (the-as symbol "mtn-aval-rocks-1")) - (set! (-> obj anim) + (logior! (-> this skel status) (joint-control-status sync-math)) + (set! (-> this art-name) (the-as symbol "mtn-aval-rocks-1")) + (set! (-> this anim) (new 'static 'spool-anim :name "mtn-aval-rocks-1" :anim-name "1-fall" :parts 8 :command-list '()) ) - (set! (-> obj loop-id) (new-sound-id)) - (set! (-> obj rock-data) (new 'process 'vector-array (-> obj node-list length))) - (dotimes (v1-42 (-> obj node-list length)) + (set! (-> this loop-id) (new-sound-id)) + (set! (-> this rock-data) (new 'process 'vector-array (-> this node-list length))) + (dotimes (v1-42 (-> this node-list length)) (let* ((a0-21 *game-info*) (a1-13 (the-as number (+ (-> a0-21 attack-id) 1))) ) (set! (-> a0-21 attack-id) (the-as uint a1-13)) - (set! (-> obj rock-data data v1-42 z) (the-as float a1-13)) + (set! (-> this rock-data data v1-42 z) (the-as float a1-13)) ) - (set! (-> obj rock-data data v1-42 w) 0.0) + (set! (-> this rock-data data v1-42 w) 0.0) ) - (let ((a2-7 (matrix<-transformq! (-> obj node-list data 0 bone transform) (the-as transformq (-> obj root trans)))) + (let ((a2-7 + (matrix<-transformq! (-> this node-list data 0 bone transform) (the-as transformq (-> this root trans))) + ) (a1-17 (new 'stack-no-clear 'vector)) ) - (set! (-> a1-17 quad) (-> obj draw bounds quad)) + (set! (-> a1-17 quad) (-> this draw bounds quad)) (set! (-> a1-17 w) 1.0) - (vector-matrix*! (-> obj draw origin) a1-17 a2-7) + (vector-matrix*! (-> this draw origin) a1-17 a2-7) ) - (set! (-> obj draw origin w) (-> obj draw bounds w)) - (go (method-of-object obj idle)) + (set! (-> this draw origin w) (-> this draw bounds w)) + (go (method-of-object this idle)) (none) ) @@ -2748,21 +2753,21 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-plat-return -(defmethod inspect mtn-plat-return ((obj mtn-plat-return)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-plat-return ((this mtn-plat-return)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tride-timer: ~D~%" (-> obj ride-timer)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tdest-pos: ~f~%" (-> obj dest-pos)) - (format #t "~2Tpath-speed: ~f~%" (-> obj path-speed)) + (format #t "~2Tride-timer: ~D~%" (-> this ride-timer)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tdest-pos: ~f~%" (-> this dest-pos)) + (format #t "~2Tpath-speed: ~f~%" (-> this path-speed)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2788,16 +2793,16 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) ) :trans (behavior () (logclear! (-> self flags) (mtn-plat-flags mtpflags-0)) (plat-trans) (if (not (logtest? (-> self flags) (mtn-plat-flags mtpflags-0))) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) ) - (let ((v1-10 (and (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) + (let ((v1-10 (and (time-elapsed? (-> self ride-timer) (seconds 0.5)) (logtest? (-> self flags) (mtn-plat-flags mtpflags-0)) (if (logtest? (-> self flags) (mtn-plat-flags mtpflags-1)) (and *target* (process-grab? *target* #f)) @@ -2872,7 +2877,7 @@ This commonly includes things such as: ) :trans (behavior () (plat-trans) - (when (>= (- (current-time) (-> self ride-timer)) (seconds 1)) + (when (time-elapsed? (-> self ride-timer) (seconds 1)) (cond ((= (-> self path-pos) 1.0) (set! (-> self dest-pos) 0.0) @@ -2890,16 +2895,16 @@ This commonly includes things such as: ;; definition for method 37 of type mtn-plat-return ;; WARN: Return type mismatch object vs none. -(defmethod mtn-plat-return-method-37 mtn-plat-return ((obj mtn-plat-return)) - (go (method-of-object obj waiting)) +(defmethod mtn-plat-return-method-37 mtn-plat-return ((this mtn-plat-return)) + (go (method-of-object this waiting)) (none) ) ;; definition for method 31 of type mtn-plat-return ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-return ((obj mtn-plat-return)) +(defmethod init-plat-collision! mtn-plat-return ((this mtn-plat-return)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -2915,44 +2920,44 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) ) ;; definition for method 11 of type mtn-plat-return -(defmethod init-from-entity! mtn-plat-return ((obj mtn-plat-return) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-plat-return ((this mtn-plat-return) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-plat-return" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (stop-bouncing! obj) - (set! (-> obj flags) (mtn-plat-flags)) - (set! (-> obj path-pos) 0.0) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (if (logtest? (-> obj path flags) (path-control-flag not-found)) + (stop-bouncing! this) + (set! (-> this flags) (mtn-plat-flags)) + (set! (-> this path-pos) 0.0) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (if (logtest? (-> this path flags) (path-control-flag not-found)) (go process-drawable-art-error "error in path") ) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (let ((f30-0 (total-distance (-> obj path)))) - (set! (-> obj path-speed) (/ (res-lump-float arg0 'speed :default 40960.0) f30-0)) - (set! (-> obj root pause-adjust-distance) (+ 204800.0 f30-0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (let ((f30-0 (total-distance (-> this path)))) + (set! (-> this path-speed) (/ (res-lump-float arg0 'speed :default 40960.0) f30-0)) + (set! (-> this root pause-adjust-distance) (+ 204800.0 f30-0)) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "mtn-plat-lp" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "mtn-plat-lp" :fo-max 70) (-> this root trans)) ) - (init-plat! obj) - (mtn-plat-return-method-37 obj) + (init-plat! this) + (mtn-plat-return-method-37 this) (none) ) @@ -2966,16 +2971,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-plat-gap -(defmethod inspect mtn-plat-gap ((obj mtn-plat-gap)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-plat-gap ((this mtn-plat-gap)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type mtn-plat-return inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3042,17 +3047,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-button -(defmethod inspect mtn-button ((obj mtn-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-button ((this mtn-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ton-activate: ~A~%" (-> obj on-activate)) + (format #t "~2Ton-activate: ~A~%" (-> this on-activate)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3132,14 +3137,14 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-button ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-button ((obj mtn-button) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-button ((this mtn-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) @@ -3168,25 +3173,25 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj on-activate) (res-lump-struct (-> obj entity) 'on-activate symbol)) - (let ((a0-22 (-> obj skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> this on-activate) (res-lump-struct (-> this entity) 'on-activate symbol)) + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-22 param 0) 1.0) (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) (transform-post) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj pressed) #t) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this pressed) #t) + (go (method-of-object this idle)) ) (none) ) @@ -3205,16 +3210,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-gear-device -(defmethod inspect mtn-gear-device ((obj mtn-gear-device)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-gear-device ((this mtn-gear-device)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3257,7 +3262,7 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-gear-device ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-gear-device ((obj mtn-gear-device) (arg0 entity-actor)) +(defmethod init-from-entity! mtn-gear-device ((this mtn-gear-device) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3266,7 +3271,7 @@ This commonly includes things such as: - sounds" (cond ((task-complete? *game-info* (game-task mountain-gear)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 9) 0))) (set! (-> s4-0 total-prims) (the-as uint 10)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -3344,21 +3349,21 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-29 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-29 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-gear-device-collapse" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (go (method-of-object obj idle-collapsed)) + (go (method-of-object this idle-collapsed)) ) (else - (let ((s4-2 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-2 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-38 (new 'process 'collide-shape-prim-sphere s4-2 (the-as uint 0)))) (set! (-> v1-38 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-38 prim-core collide-with) (collide-spec jak bot player-list)) @@ -3373,29 +3378,29 @@ This commonly includes things such as: (set! (-> s4-2 backup-collide-as) (-> v1-41 prim-core collide-as)) (set! (-> s4-2 backup-collide-with) (-> v1-41 prim-core collide-with)) ) - (set! (-> obj root) s4-2) + (set! (-> this root) s4-2) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-gear-device" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj root pause-adjust-distance) 450560.0) - (add-connection *part-engine* obj 24 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 25 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 21 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 22 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 14 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 13 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 15 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 16 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 17 obj 1492 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 18 obj 1492 (new 'static 'vector :w 163840.0)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "mtn-gear-device" :fo-max 90) (-> obj root trans)) + (set! (-> this root pause-adjust-distance) 450560.0) + (add-connection *part-engine* this 24 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 25 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 21 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 22 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 14 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 13 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 15 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 16 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 17 this 1492 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 18 this 1492 (new 'static 'vector :w 163840.0)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "mtn-gear-device" :fo-max 90) (-> this root trans)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -3411,16 +3416,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type water-anim-mountain -(defmethod inspect water-anim-mountain ((obj water-anim-mountain)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-anim-mountain ((this water-anim-mountain)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol ripple-for-water-anim-mountain, type ripple-wave-set @@ -3439,14 +3444,14 @@ This commonly includes things such as: ;; definition for method 24 of type water-anim-mountain ;; WARN: Return type mismatch int vs none. -(defmethod init-water! water-anim-mountain ((obj water-anim-mountain)) +(defmethod init-water! water-anim-mountain ((this water-anim-mountain)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) @@ -3469,16 +3474,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type trans-plat -(defmethod inspect trans-plat ((obj trans-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect trans-plat ((this trans-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type mtn-plat-return inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3581,7 +3586,7 @@ This commonly includes things such as: :virtual #t :trans (behavior () (plat-trans) - (if (>= (- (current-time) (-> self ride-timer)) (seconds 1)) + (if (time-elapsed? (-> self ride-timer) (seconds 1)) (go-virtual waiting) ) ) @@ -3589,17 +3594,17 @@ This commonly includes things such as: ;; definition for method 37 of type trans-plat ;; WARN: Return type mismatch object vs none. -(defmethod mtn-plat-return-method-37 trans-plat ((obj trans-plat)) - (go (method-of-object obj rising)) +(defmethod mtn-plat-return-method-37 trans-plat ((this trans-plat)) + (go (method-of-object this rising)) (none) ) ;; definition for method 33 of type trans-plat ;; WARN: Return type mismatch float vs none. -(defmethod init-plat! trans-plat ((obj trans-plat)) +(defmethod init-plat! trans-plat ((this trans-plat)) "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." - (logior! (-> obj flags) (mtn-plat-flags mtpflags-1)) + (logior! (-> this flags) (mtn-plat-flags mtpflags-1)) (let* ((s5-0 *target*) (a0-2 (if (type? s5-0 process-focusable) s5-0 @@ -3608,10 +3613,10 @@ For example for an elevator pre-compute the distance between the first and last ) (when a0-2 (let ((s4-0 (get-trans a0-2 0)) - (s3-0 (-> obj path)) + (s3-0 (-> this path)) (f28-0 0.0) (f30-0 -1.0) - (s5-1 (-> obj path curve num-cverts)) + (s5-1 (-> this path curve num-cverts)) ) (dotimes (s2-0 s5-1) (let ((f0-2 @@ -3625,7 +3630,7 @@ For example for an elevator pre-compute the distance between the first and last ) ) (if (!= f30-0 -1.0) - (set! (-> obj path-pos) (/ f30-0 (+ -1.0 (the float s5-1)))) + (set! (-> this path-pos) (/ f30-0 (+ -1.0 (the float s5-1)))) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-part_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-part_REF.gc index fe8e5a0564..2655f8aaa7 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type mountain-part -(defmethod inspect mountain-part ((obj mountain-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect mountain-part ((this mountain-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc b/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc index efd8a7ae98..f4b5245e4a 100644 --- a/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/mountain-scenes_REF.gc @@ -1690,16 +1690,16 @@ ) ;; definition for method 3 of type mtn-plat-buried-rocks -(defmethod inspect mtn-plat-buried-rocks ((obj mtn-plat-buried-rocks)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-plat-buried-rocks ((this mtn-plat-buried-rocks)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1756,14 +1756,14 @@ ;; definition for method 11 of type mtn-plat-buried-rocks ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-plat-buried-rocks ((obj mtn-plat-buried-rocks) (entity entity-actor)) +(defmethod init-from-entity! mtn-plat-buried-rocks ((this mtn-plat-buried-rocks) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -1778,25 +1778,25 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-plat-buried-rocks" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj draw force-lod) 1) + (set! (-> this draw force-lod) 1) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj done) #t) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this done) #t) ) (else - (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-plat-buried-rocks-a" -99.0 0) - (go (method-of-object obj idle)) + (add-process *gui-control* this (gui-channel art-load) (gui-action queue) "mtn-plat-buried-rocks-a" -99.0 0) + (go (method-of-object this idle)) ) ) (none) @@ -1815,18 +1815,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-plat-buried -(defmethod inspect mtn-plat-buried ((obj mtn-plat-buried)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-plat-buried ((this mtn-plat-buried)) + (when (not this) + (set! this this) (goto cfg-60) ) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Toffset: ~f~%" (-> obj offset)) - (format #t "~2Toptions: #x~X : (actor-option " (-> obj options)) - (let ((s5-0 (-> obj options))) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Toffset: ~f~%" (-> this offset)) + (format #t "~2Toptions: #x~X : (actor-option " (-> this options)) + (let ((s5-0 (-> this options))) (if (= (logand s5-0 (actor-option respawn-delay)) (actor-option respawn-delay)) (format #t "respawn-delay ") ) @@ -1914,7 +1914,7 @@ This commonly includes things such as: ) (format #t ")~%") (label cfg-60) - obj + this ) ;; failed to figure out what this is: @@ -1924,16 +1924,16 @@ This commonly includes things such as: ) ;; definition for method 30 of type mtn-plat-buried -(defmethod get-art-group mtn-plat-buried ((obj mtn-plat-buried)) +(defmethod get-art-group mtn-plat-buried ((this mtn-plat-buried)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-mtn-plat-buried" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type mtn-plat-buried ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! mtn-plat-buried ((obj mtn-plat-buried)) +(defmethod init-plat-collision! mtn-plat-buried ((this mtn-plat-buried)) "TODO - collision stuff for setting up the platform" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -1954,35 +1954,36 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "mtn-plat-lp" :fo-max 100) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "mtn-plat-lp" :fo-max 100) (-> this root trans)) ) - (set! (-> obj options) (res-lump-value (-> obj entity) 'options actor-option :time -1000000000.0)) + (set! (-> this options) (res-lump-value (-> this entity) 'options actor-option :time -1000000000.0)) 0 (none) ) ;; definition for method 36 of type mtn-plat-buried -(defmethod plat-path-sync mtn-plat-buried ((obj mtn-plat-buried)) +(defmethod plat-path-sync mtn-plat-buried ((this mtn-plat-buried)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @see [[sync-eased]]" (cond - ((or (logtest? (-> obj path flags) (path-control-flag not-found)) - (and (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)))) - (logtest? (-> obj options) (actor-option blocked)) + ((or (logtest? (-> this path flags) (path-control-flag not-found)) + (and (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) + (logtest? (-> this options) (actor-option blocked)) ) ) - (go (method-of-object obj plat-idle)) + (go (method-of-object this plat-idle)) ) - ((> (-> obj sync period) 0) - (go (method-of-object obj plat-path-active)) + ((> (-> this sync period) 0) + (go (method-of-object this plat-path-active)) ) (else - (go (method-of-object obj plat-idle)) + (go (method-of-object this plat-idle)) ) ) ) @@ -3091,16 +3092,16 @@ otherwise, [[plat::34]] ) ;; definition for method 3 of type mtn-lens -(defmethod inspect mtn-lens ((obj mtn-lens)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-lens ((this mtn-lens)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3112,22 +3113,22 @@ otherwise, [[plat::34]] ;; definition for method 11 of type mtn-lens ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens ((obj mtn-lens) (entity entity-actor)) +(defmethod init-from-entity! mtn-lens ((this mtn-lens) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-lens" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3144,16 +3145,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-lens-base -(defmethod inspect mtn-lens-base ((obj mtn-lens-base)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-lens-base ((this mtn-lens-base)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3165,24 +3166,24 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-lens-base ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens-base ((obj mtn-lens-base) (entity entity-actor)) +(defmethod init-from-entity! mtn-lens-base ((this mtn-lens-base) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-lens-base" (the-as (pointer uint32) #f))) (the-as pair 0) ) (when (task-complete? *game-info* (game-task mountain-lens)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3200,16 +3201,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-lens-floor -(defmethod inspect mtn-lens-floor ((obj mtn-lens-floor)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-lens-floor ((this mtn-lens-floor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3229,14 +3230,14 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-lens-floor ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-lens-floor ((obj mtn-lens-floor) (entity entity-actor)) +(defmethod init-from-entity! mtn-lens-floor ((this mtn-lens-floor) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak bot player-list)) @@ -3251,20 +3252,20 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-lens-floor" (the-as (pointer uint32) #f))) (the-as pair 0) ) (if (task-complete? *game-info* (game-task mountain-lens)) - (go (method-of-object obj idle-no-beam)) + (go (method-of-object this idle-no-beam)) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 353) obj)) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 353) this)) + (go (method-of-object this idle)) (none) ) @@ -3281,16 +3282,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-shard -(defmethod inspect mtn-shard ((obj mtn-shard)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-shard ((this mtn-shard)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3302,22 +3303,22 @@ This commonly includes things such as: ;; definition for method 11 of type mtn-shard ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-shard ((obj mtn-shard) (entity entity-actor)) +(defmethod init-from-entity! mtn-shard ((this mtn-shard) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-shard" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3331,22 +3332,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-step-plat-rocks-a -(defmethod inspect mtn-step-plat-rocks-a ((obj mtn-step-plat-rocks-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-step-plat-rocks-a ((this mtn-step-plat-rocks-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type mtn-plat-buried-rocks inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type mtn-step-plat-rocks-a ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-a ((obj mtn-step-plat-rocks-a) (entity entity-actor)) +(defmethod init-from-entity! mtn-step-plat-rocks-a ((this mtn-step-plat-rocks-a) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3354,7 +3355,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape)) - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 3) 0))) (set! (-> cshape total-prims) (the-as uint 4)) (set! (-> prim-group prim-core collide-as) (collide-spec obstacle pusher)) @@ -3395,26 +3396,26 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-step-plat-rocks-a" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set-vector! (-> obj draw bounds) 0.0 12288.0 0.0 20480.0) - (set! (-> obj draw lod-set lod 0 dist) 163840.0) + (set-vector! (-> this draw bounds) 0.0 12288.0 0.0 20480.0) + (set! (-> this draw lod-set lod 0 dist) 163840.0) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj done) #t) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this done) #t) ) (else - (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-a" -99.0 0) - (go (method-of-object obj idle)) + (add-process *gui-control* this (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-a" -99.0 0) + (go (method-of-object this idle)) ) ) (none) @@ -3430,22 +3431,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-step-plat-rocks-b -(defmethod inspect mtn-step-plat-rocks-b ((obj mtn-step-plat-rocks-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-step-plat-rocks-b ((this mtn-step-plat-rocks-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type mtn-plat-buried-rocks inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type mtn-step-plat-rocks-b ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-b ((obj mtn-step-plat-rocks-b) (entity entity-actor)) +(defmethod init-from-entity! mtn-step-plat-rocks-b ((this mtn-step-plat-rocks-b) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3453,7 +3454,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape)) - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 17) 0))) (set! (-> cshape total-prims) (the-as uint 18)) (set! (-> prim-group prim-core collide-as) (collide-spec obstacle pusher)) @@ -3512,26 +3513,26 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-step-plat-rocks-b" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set-vector! (-> obj draw bounds) 0.0 -12288.0 0.0 40960.0) - (set! (-> obj draw lod-set lod 0 dist) 163840.0) + (set-vector! (-> this draw bounds) 0.0 -12288.0 0.0 40960.0) + (set! (-> this draw lod-set lod 0 dist) 163840.0) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj done) #t) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this done) #t) ) (else - (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-b" -99.0 0) - (go (method-of-object obj idle)) + (add-process *gui-control* this (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-b" -99.0 0) + (go (method-of-object this idle)) ) ) (none) @@ -3547,22 +3548,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type mtn-step-plat-rocks-c -(defmethod inspect mtn-step-plat-rocks-c ((obj mtn-step-plat-rocks-c)) - (when (not obj) - (set! obj obj) +(defmethod inspect mtn-step-plat-rocks-c ((this mtn-step-plat-rocks-c)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type mtn-plat-buried-rocks inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type mtn-step-plat-rocks-c ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! mtn-step-plat-rocks-c ((obj mtn-step-plat-rocks-c) (entity entity-actor)) +(defmethod init-from-entity! mtn-step-plat-rocks-c ((this mtn-step-plat-rocks-c) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -3570,7 +3571,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape)) - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 24) 0))) (set! (-> cshape total-prims) (the-as uint 25)) (set! (-> prim-group prim-core collide-as) (collide-spec obstacle pusher)) @@ -3636,26 +3637,26 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mtn-step-plat-rocks-c" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set-vector! (-> obj draw bounds) 0.0 0.0 32768.0 57344.0) - (set! (-> obj draw lod-set lod 0 dist) 163840.0) + (set-vector! (-> this draw bounds) 0.0 0.0 32768.0 57344.0) + (set! (-> this draw lod-set lod 0 dist) 163840.0) (cond - ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj done) #t) + ((and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this done) #t) ) (else - (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-c" -99.0 0) - (go (method-of-object obj idle)) + (add-process *gui-control* this (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-c" -99.0 0) + (go (method-of-object this idle)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc b/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc index 048252a485..ab9fa2ed95 100644 --- a/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/rhino-wall_REF.gc @@ -20,19 +20,19 @@ ) ;; definition for method 3 of type rhino-wall -(defmethod inspect rhino-wall ((obj rhino-wall)) - (when (not obj) - (set! obj obj) +(defmethod inspect rhino-wall ((this rhino-wall)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tart-name: ~A~%" (-> obj art-name)) - (format #t "~2Tid: ~D~%" (-> obj id)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) + (format #t "~2Tid: ~D~%" (-> this id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -49,8 +49,8 @@ ;; definition for method 30 of type rhino-wall ;; WARN: Return type mismatch vector vs none. -(defmethod rhino-wall-method-30 rhino-wall ((obj rhino-wall)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod rhino-wall-method-30 rhino-wall ((this rhino-wall)) + (let ((v1-1 (-> this root root-prim))) (countdown (a1-0 (-> v1-1 specific 0)) (let ((a2-1 (-> (the-as collide-shape-prim-group v1-1) child a1-0))) (cond @@ -64,16 +64,16 @@ ) ) ) - (case (-> obj id) + (case (-> this id) ((1) - (set! (-> obj draw origin-joint-index) (the-as uint 2)) - (set-vector! (-> obj draw bounds) 0.0 0.0 81920.0 131072.0) + (set! (-> this draw origin-joint-index) (the-as uint 2)) + (set-vector! (-> this draw bounds) 0.0 0.0 81920.0 131072.0) (set! (-> v1-1 transform-index) 2) (set-vector! (-> v1-1 local-sphere) 0.0 0.0 81920.0 122880.0) ) ((2) - (set! (-> obj draw origin-joint-index) (the-as uint 2)) - (set-vector! (-> obj draw bounds) 0.0 0.0 81920.0 131072.0) + (set! (-> this draw origin-joint-index) (the-as uint 2)) + (set-vector! (-> this draw bounds) 0.0 0.0 81920.0 131072.0) (set! (-> v1-1 transform-index) 2) (set-vector! (-> v1-1 local-sphere) 0.0 0.0 81920.0 122880.0) ) @@ -114,23 +114,23 @@ ;; definition for method 11 of type rhino-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! rhino-wall ((obj rhino-wall) (arg0 entity-actor)) +(defmethod init-from-entity! rhino-wall ((this rhino-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) - (let ((s3-0 (res-lump-struct (-> obj entity) 'art-name structure)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) + (let ((s3-0 (res-lump-struct (-> this entity) 'art-name structure)) (s4-0 (art-group-get-by-name *level* "skel-rhino-wall-1" (the-as (pointer uint32) #f))) ) - (set! (-> obj art-name) (the-as string s3-0)) + (set! (-> this art-name) (the-as string s3-0)) (cond ((string= (the-as string s3-0) "rhino-wall-1") - (set! (-> obj id) 1) - (let ((s4-1 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this id) 1) + (let ((s4-1 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-1 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-1 reaction) cshape-reaction-default) (set! (-> s4-1 no-reaction) @@ -196,16 +196,16 @@ This commonly includes things such as: (set! (-> s4-1 backup-collide-as) (-> v1-38 prim-core collide-as)) (set! (-> s4-1 backup-collide-with) (-> v1-38 prim-core collide-with)) ) - (set! (-> obj root) s4-1) + (set! (-> this root) s4-1) ) (set! s4-0 (art-group-get-by-name *level* "skel-rhino-wall-1" (the-as (pointer uint32) #f))) - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "rhino-wall-1" :anim-name "1-break" :parts 2 :command-list '()) ) ) ((string= (the-as string s3-0) "rhino-wall-2") - (set! (-> obj id) 2) - (let ((s4-2 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this id) 2) + (let ((s4-2 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-2 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-2 reaction) cshape-reaction-default) (set! (-> s4-2 no-reaction) @@ -271,10 +271,10 @@ This commonly includes things such as: (set! (-> s4-2 backup-collide-as) (-> v1-74 prim-core collide-as)) (set! (-> s4-2 backup-collide-with) (-> v1-74 prim-core collide-with)) ) - (set! (-> obj root) s4-2) + (set! (-> this root) s4-2) ) (set! s4-0 (art-group-get-by-name *level* "skel-rhino-wall-2" (the-as (pointer uint32) #f))) - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "rhino-wall-2" :anim-name "2-break" :parts 1 :command-list '()) ) ) @@ -282,12 +282,12 @@ This commonly includes things such as: (go process-drawable-art-error (the-as string s3-0)) ) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0)) ) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj broken)) - (go (method-of-object obj unbroken)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this broken)) + (go (method-of-object this unbroken)) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc b/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc index e6ad48f01b..f80efa6bbf 100644 --- a/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc +++ b/test/decompiler/reference/jak2/levels/mountain/rhino_REF.gc @@ -580,7 +580,7 @@ (set! (-> *rhino-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 182 of type rhino -(defmethod rhino-method-182 rhino ((obj rhino) (arg0 process) (arg1 event-message-block)) +(defmethod rhino-method-182 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) (let* ((gp-0 (-> arg1 param 0)) (s5-0 arg0) (s2-0 (if (type? s5-0 process-drawable) @@ -589,19 +589,19 @@ ) ) (cond - ((and (-> obj can-hit?) gp-0 ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry gp-0) - (-> obj root) - (the-as uint 1) - ) + ((and (-> this can-hit?) gp-0 ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry gp-0) + (-> this root) + (the-as uint 1) + ) ) (let ((s4-0 (new 'stack-no-clear 'vector)) (gp-1 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'vector)) ) - (vector-z-quaternion! s4-0 (-> obj root quat)) - (vector-x-quaternion! gp-1 (-> obj root quat)) - (vector-! s5-1 (-> (the-as process-drawable s2-0) root trans) (-> obj root trans)) + (vector-z-quaternion! s4-0 (-> this root quat)) + (vector-x-quaternion! gp-1 (-> this root quat)) + (vector-! s5-1 (-> (the-as process-drawable s2-0) root trans) (-> this root trans)) (if (and (< 0.0 (vector-dot s5-1 s4-0)) (< (fabs (vector-dot s5-1 gp-1)) 10240.0)) #t #f @@ -616,11 +616,11 @@ ) ;; definition for method 58 of type rhino -(defmethod enemy-method-58 rhino ((obj rhino) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) (let ((t9-0 (method-of-type nav-enemy enemy-method-58))) - (t9-0 obj arg0 arg1) + (t9-0 this arg0 arg1) ) - (if (rhino-method-182 obj arg0 arg1) + (if (rhino-method-182 this arg0 arg1) 'hit 'hit-flinch ) @@ -628,7 +628,7 @@ ;; definition for method 74 of type rhino ;; INFO: Used lq/sq -(defmethod general-event-handler rhino ((obj rhino) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler rhino ((this rhino) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (local-vars @@ -647,28 +647,28 @@ ) (case arg2 (('charge) - (if (-> obj wall) - (go (method-of-object obj charge)) + (if (-> this wall) + (go (method-of-object this charge)) ) ) (('hit) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (set! (-> *rhino-nav-enemy-info* die-anim) 15) - (set! (-> obj frame-die-smush) 11.0) - (kill-prefer-falling obj) + (set! (-> this frame-die-smush) 11.0) + (kill-prefer-falling this) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('hit-flinch) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (set! (-> *rhino-nav-enemy-info* die-anim) 14) - (set! (-> obj frame-die-smush) 16.0) - (kill-prefer-falling obj) + (set! (-> this frame-die-smush) 16.0) + (kill-prefer-falling this) ) (else (let* ((s5-0 arg0) @@ -680,36 +680,36 @@ (s4-0 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'vector)) ) - (vector-z-quaternion! s3-0 (-> obj root quat)) - (vector-x-quaternion! s4-0 (-> obj root quat)) - (vector-! s5-1 (-> (the-as process-focusable s2-0) root trans) (-> obj root trans)) + (vector-z-quaternion! s3-0 (-> this root quat)) + (vector-x-quaternion! s4-0 (-> this root quat)) + (vector-! s5-1 (-> (the-as process-focusable s2-0) root trans) (-> this root trans)) (set! (-> s5-1 y) 0.0) (vector-normalize! s5-1 1.0) (let* ((f30-0 (vector-dot s3-0 s5-1)) (f28-0 (vector-dot s4-0 s5-1)) (a0-16 (cond ((>= f30-0 (cos 8192.0)) - (-> obj draw art-group data 16) + (-> this draw art-group data 16) ) ((>= (cos 24576.0) f30-0) - (-> obj draw art-group data 19) + (-> this draw art-group data 19) ) ((>= f28-0 (cos 8192.0)) - (-> obj draw art-group data 17) + (-> this draw art-group data 17) ) ((>= (cos 24576.0) f28-0) - (-> obj draw art-group data 18) + (-> this draw art-group data 18) ) (else - (-> obj draw art-group data 16) + (-> this draw art-group data 16) ) ) ) (v0-9 (ja-channel-float! (the-as art-joint-anim a0-16) 0.0 0.0 0.0)) ) (when v0-9 - (set! (-> obj skel interp-select 0) (the-as int (the-as uint #x1c9002228))) - (set! (-> obj skel interp-select 1) 0) + (set! (-> this skel interp-select 0) (the-as int (the-as uint #x1c9002228))) + (set! (-> this skel interp-select 1) 0) (set! (-> v0-9 param 0) 1.0) (set! (-> v0-9 param 1) 1.0) (set! (-> v0-9 param 2) 3.0) @@ -717,7 +717,7 @@ ) ) ) - (+! (-> obj num-hit-flinch) 1) + (+! (-> this num-hit-flinch) 1) 'back ) ) @@ -725,11 +725,11 @@ (('event-slide-poof) (let ((s5-2 (-> arg3 param 1))) (cond - ((= (-> obj root ground-pat material) (pat-material grass)) + ((= (-> this root ground-pat material) (pat-material grass)) (let ((s4-1 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-1 (let ((t9-14 (method-of-type part-tracker activate))) - (t9-14 (the-as part-tracker s4-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-14 (the-as part-tracker s4-1) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((s3-1 run-function-in-process) (s2-1 s4-1) @@ -742,7 +742,7 @@ (set! sv-144 (the-as symbol #f)) (set! sv-176 *launch-matrix*) (set! sv-160 (-> sv-176 trans)) - (let ((v1-52 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) + (let ((v1-52 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data s5-2)) quad))) (set! (-> sv-160 quad) v1-52) ) ((the-as (function object object object object object object object object none) s3-1) @@ -764,7 +764,7 @@ (let ((s4-2 (get-process *default-dead-pool* part-tracker #x4000))) (when s4-2 (let ((t9-18 (method-of-type part-tracker activate))) - (t9-18 (the-as part-tracker s4-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) + (t9-18 (the-as part-tracker s4-2) this (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000)) ) (let ((s3-2 run-function-in-process) (s2-2 s4-2) @@ -777,7 +777,7 @@ (set! sv-240 (the-as symbol #f)) (set! sv-272 *launch-matrix*) (set! sv-256 (-> sv-272 trans)) - (let ((v1-64 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data s5-2)) quad))) + (let ((v1-64 (-> (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data s5-2)) quad))) (set! (-> sv-256 quad) v1-64) ) ((the-as (function object object object object object object object object none) s3-2) @@ -799,28 +799,28 @@ ) ) (('interesting) - (+! (-> obj interest) 1) - (let ((v1-67 (process->ppointer obj))) + (+! (-> this interest) 1) + (let ((v1-67 (process->ppointer this))) (set-setting! 'handle-of-interest v1-67 0.0 (-> v1-67 0 pid)) ) ) (('uninteresting) - (+! (-> obj interest) -1) - (when (<= (-> obj interest) 0) - (set! (-> obj interest) 0) + (+! (-> this interest) -1) + (when (<= (-> this interest) 0) + (set! (-> this interest) 0) (remove-setting! 'handle-of-interest) ) ) (('death-end) - (let ((v1-74 (-> obj root root-prim))) + (let ((v1-74 (-> this root root-prim))) (set! (-> v1-74 prim-core collide-as) (collide-spec)) (set! (-> v1-74 prim-core collide-with) (collide-spec)) ) 0 - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -869,9 +869,7 @@ ) ) (else - (if (and (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) - (> (the-as int (-> self focus aware)) 0) - ) + (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) (> (the-as int (-> self focus aware)) 0)) (go-virtual active) ) ) @@ -974,24 +972,24 @@ ) ;; definition for method 56 of type rhino -(defmethod damage-amount-from-attack rhino ((obj rhino) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack rhino ((this rhino) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (-> arg1 param 1) - (let ((f30-0 (the float (penetrate-using->damage (the-as penetrate (-> obj incoming penetrate-using)))))) + (let ((f30-0 (the float (penetrate-using->damage (the-as penetrate (-> this incoming penetrate-using)))))) (cond - ((rhino-method-182 obj arg0 arg1) - (set! (-> obj stomach-touched-once?) #t) + ((rhino-method-182 this arg0 arg1) + (set! (-> this stomach-touched-once?) #t) (the int (* 4.0 f30-0)) ) - ((logtest? #xc0000 (-> obj incoming penetrate-using)) - (if (and (logtest? #x40000 (-> obj incoming penetrate-using)) - (logtest? #x80000 (-> obj incoming penetrate-using)) + ((logtest? #xc0000 (-> this incoming penetrate-using)) + (if (and (logtest? #x40000 (-> this incoming penetrate-using)) + (logtest? #x80000 (-> this incoming penetrate-using)) ) #x420c0000 (the int (* 1.8 f30-0)) ) ) - ((logtest? #x20000 (-> obj incoming penetrate-using)) + ((logtest? #x20000 (-> this incoming penetrate-using)) (the int (* 2.0 f30-0)) ) (else @@ -1003,7 +1001,7 @@ ;; definition for method 75 of type rhino ;; WARN: Return type mismatch symbol vs object. -(defmethod enemy-method-75 rhino ((obj rhino) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-75 rhino ((this rhino) (arg0 process) (arg1 event-message-block)) (let* ((touch-entry (the-as touching-shapes-entry (-> arg1 param 0))) (s3-0 arg0) (v1-0 (if (type? s3-0 process-focusable) @@ -1013,34 +1011,34 @@ ) (when (and (the-as uint touch-entry) v1-0) (cond - ((and (focus-test? obj dangerous) ((method-of-type touching-shapes-entry prims-touching-action?) - touch-entry - (-> obj root) - (collide-action deadly) - (collide-action) - ) + ((and (focus-test? this dangerous) ((method-of-type touching-shapes-entry prims-touching-action?) + touch-entry + (-> this root) + (collide-action deadly) + (collide-action) + ) ) (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) touch-entry - (-> obj root) + (-> this root) (collide-action persistent-attack) (collide-action) ) - (-> obj persistent-attack-id) - (-> obj attack-id) + (-> this persistent-attack-id) + (-> this attack-id) ) ) ) - (enemy-method-104 obj arg0 touch-entry a3-2) + (enemy-method-104 this arg0 touch-entry a3-2) ) ) (((method-of-type touching-shapes-entry prims-touching-action?) touch-entry - (-> obj root) + (-> this root) (collide-action no-standon) (collide-action) ) - (send-shoves (-> obj root) arg0 touch-entry 0.7 6144.0 16384.0) + (send-shoves (-> this root) arg0 touch-entry 0.7 6144.0 16384.0) ) ) ) @@ -1049,14 +1047,14 @@ ;; definition for method 104 of type rhino ;; INFO: Used lq/sq -(defmethod enemy-method-104 rhino ((obj rhino) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) - (if (and (-> obj next-state) (= (-> obj next-state name) 'victory)) +(defmethod enemy-method-104 rhino ((this rhino) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + (if (and (-> this next-state) (= (-> this next-state name) 'victory)) 'attack-or-shove 'attack ) - (let* ((s2-0 (if (-> obj smush-target) + (let* ((s2-0 (if (-> this smush-target) 'smush - (-> obj enemy-info attack-mode) + (-> this enemy-info attack-mode) ) ) (s1-0 arg0) @@ -1066,13 +1064,13 @@ ) (s1-1 (new 'stack-no-clear 'vector)) ) - (vector-! s1-1 (get-trans (the-as process-focusable a0-3) 0) (-> obj root trans)) + (vector-! s1-1 (get-trans (the-as process-focusable a0-3) 0) (-> this root trans)) (set! (-> s1-1 y) 0.0) (vector-normalize! s1-1 1.0) - (vector+float*! s1-1 s1-1 (-> obj root transv) 0.5) + (vector+float*! s1-1 s1-1 (-> this root transv) 0.5) (set! (-> s1-1 y) 20480.0) (when (send-event arg0 'attack arg1 (static-attack-info ((id arg2) (angle 'front) (vector s1-1) (mode s2-0)))) - (enemy-method-105 obj arg0) + (enemy-method-105 this arg0) #t ) ) @@ -1247,7 +1245,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-4 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-4 enemy-flags))) @@ -1291,7 +1289,7 @@ 0 ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 1.5)) + (if (time-elapsed? (-> self state-time) (seconds 1.5)) (go-virtual active) ) ) @@ -1325,7 +1323,7 @@ ) (set! (-> self charge-straight) #f) (nav-enemy-method-166 self) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self enemy-flags) (enemy-flag look-at-focus)) ) :trans (behavior () @@ -1352,7 +1350,7 @@ (vector-! gp-0 s2-0 (-> self root trans)) (vector-normalize! gp-0 (+ 16384.0 (vector-length gp-0))) (vector+! s4-0 (-> self root trans) gp-0) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (and (< (vector-vector-xz-distance (get-trans (the-as process-focusable s3-0) 0) (-> self root trans)) 40960.0) (< 0.9 f30-0) ) @@ -1362,7 +1360,7 @@ (cond ((-> self charge-straight) (cond - ((>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + ((time-elapsed? (-> self state-time) (-> self reaction-time)) (if (< (vector-vector-xz-distance (get-trans (the-as process-focusable s3-0) 0) (-> self root trans)) 20480.0) (go-virtual attack) ) @@ -1376,9 +1374,7 @@ ) ) ) - ((and (< f28-0 8192.0) - (and (>= (- (current-time) (-> self state-time)) (seconds 2)) (>= 9.0 (ja-frame-num 0))) - ) + ((and (< f28-0 8192.0) (and (time-elapsed? (-> self state-time) (seconds 2)) (>= 9.0 (ja-frame-num 0)))) (go-virtual stop-run) ) (else @@ -1501,14 +1497,14 @@ ;; definition for method 142 of type rhino ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 rhino ((obj rhino) (arg0 nav-control)) - (if (-> obj in-stop-run) +(defmethod nav-enemy-method-142 rhino ((this rhino) (arg0 nav-control)) + (if (-> this in-stop-run) (quaternion*! - (-> obj root quat) - (-> obj quat) - (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (* 182.04445 (* 180.0 (-> obj angle)))) + (-> this root quat) + (-> this quat) + (quaternion-axis-angle! (new 'stack-no-clear 'quaternion) 0.0 1.0 0.0 (* 182.04445 (* 180.0 (-> this angle)))) ) - ((method-of-type nav-enemy nav-enemy-method-142) obj arg0) + ((method-of-type nav-enemy nav-enemy-method-142) this arg0) ) 0 (none) @@ -1643,7 +1639,7 @@ :enter (behavior () (set-setting! 'sound-mode #f 0.0 1) (set-setting! 'sound-excitement 'abs 0.0 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (nav-enemy-method-166 self) (let ((v1-8 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-8 enemy-flags))) @@ -1835,9 +1831,9 @@ ;; definition for method 114 of type rhino ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! rhino ((obj rhino)) +(defmethod init-enemy-collision! rhino ((this rhino)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1901,7 +1897,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1909,87 +1905,87 @@ ;; definition for method 7 of type rhino ;; WARN: Return type mismatch process-focusable vs rhino. -(defmethod relocate rhino ((obj rhino) (arg0 int)) - (if (nonzero? (-> obj path-intro)) - (&+! (-> obj path-intro) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method rhino 7)) this arg0) ) ) ;; definition for method 115 of type rhino ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! rhino ((obj rhino)) +(defmethod init-enemy! rhino ((this rhino)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (stack-size-set! (-> obj main-thread) 256) + (stack-size-set! (-> this main-thread) 256) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-rhino" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *rhino-nav-enemy-info*) - (let ((v1-8 (-> obj neck))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *rhino-nav-enemy-info*) + (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) (set! (-> v1-8 nose) (the-as uint 2)) (set! (-> v1-8 ear) (the-as uint 0)) (set-vector! (-> v1-8 twist-max) 10922.667 12743.111 0.0 1.0) (set! (-> v1-8 ignore-angle) 18204.445) ) - (set! (-> obj wall) #f) - (set! (-> obj wall) (the-as rhino-wall (entity-actor-lookup (-> obj entity) 'alt-actor 0))) - (when (-> obj wall) - (set! (-> obj path-intro) (new 'process 'path-control obj 'intro 0.0 (-> obj entity) #f)) - (if (-> obj path-intro) - (logior! (-> obj path-intro flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this wall) #f) + (set! (-> this wall) (the-as rhino-wall (entity-actor-lookup (-> this entity) 'alt-actor 0))) + (when (-> this wall) + (set! (-> this path-intro) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (if (-> this path-intro) + (logior! (-> this path-intro flags) (path-control-flag display draw-line draw-point draw-text)) ) - (when (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (format #t "~S : sub task done~%" (-> obj name)) - (get-point-in-path! (-> obj path-intro) (-> obj root trans) 1.0 'exact) - (set! (-> obj wall) #f) + (when (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (format #t "~S : sub task done~%" (-> this name)) + (get-point-in-path! (-> this path-intro) (-> this root trans) 1.0 'exact) + (set! (-> this wall) #f) ) ) - (set! (-> obj charge-aware) (the-as uint 1)) - (if (>= (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj charge-aware) (the-as uint 2)) + (set! (-> this charge-aware) (the-as uint 1)) + (if (>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) + (set! (-> this charge-aware) (the-as uint 2)) ) - (set! (-> obj charge-straight) #f) - (set! (-> obj in-stop-run) #f) - (set! (-> obj smush-target) #f) - (set! (-> obj num-hit-flinch) 0) - (set! (-> obj can-hit?) #f) - (set! (-> obj anim-skid-left) 21) - (set! (-> obj anim-skid-right) 22) - (set! (-> obj anim-victory-hit) 23) - (set! (-> obj interest) 0) - (set! (-> obj victory-count) (the-as uint 0)) - (set! (-> obj stomach-touched-once?) #f) + (set! (-> this charge-straight) #f) + (set! (-> this in-stop-run) #f) + (set! (-> this smush-target) #f) + (set! (-> this num-hit-flinch) 0) + (set! (-> this can-hit?) #f) + (set! (-> this anim-skid-left) 21) + (set! (-> this anim-skid-right) 22) + (set! (-> this anim-victory-hit) 23) + (set! (-> this interest) 0) + (set! (-> this victory-count) (the-as uint 0)) + (set! (-> this stomach-touched-once?) #f) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x 1433.6 :y -1105.92 :z 1925.12 :w 163840.0) ) (add-connection *part-engine* - obj + this 6 - obj + this 318 (new 'static 'vector :x -1433.6 :y -1105.92 :z 1925.12 :w 163840.0) ) - (let ((v1-38 (-> obj nav))) + (let ((v1-38 (-> this nav))) (set! (-> v1-38 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (logior! (-> obj focus-status) (focus-status dangerous)) - (logior! (-> obj enemy-flags) (enemy-flag check-water)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logior! (-> this enemy-flags) (enemy-flag check-water)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc index 2651a8c416..eae1f41c16 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-extras_REF.gc @@ -108,7 +108,7 @@ :virtual #t :event metalkor-egg-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (local-vars (v1-5 float) (v1-27 float) (v1-34 float)) @@ -134,7 +134,7 @@ ((< f0-0 (* f1-0 f1-0)) (go-virtual idle) ) - ((>= (- (current-time) (-> self state-time)) (seconds 4)) + ((time-elapsed? (-> self state-time) (seconds 4)) (go-virtual hatch) ) (else @@ -218,10 +218,10 @@ :virtual #t :event metalkor-egg-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go-virtual hatch) ) (let ((v1-9 (ja-group))) @@ -279,30 +279,30 @@ ;; definition for method 31 of type metalkor-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod init-proj-settings! metalkor-shot ((obj metalkor-shot)) +(defmethod init-proj-settings! metalkor-shot ((this metalkor-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'metalhead-shot) - (set! (-> obj max-speed) 532480.0) - (set! (-> obj move) metalkor-shot-move) - (set! (-> obj timeout) (seconds 0.767)) - (set-gravity-length (-> obj root dynam) 573440.0) - (set! (-> obj old-transv quad) (-> obj root transv quad)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'metalhead-shot) + (set! (-> this max-speed) 532480.0) + (set! (-> this move) metalkor-shot-move) + (set! (-> this timeout) (seconds 0.767)) + (set-gravity-length (-> this root dynam) 573440.0) + (set! (-> this old-transv quad) (-> this root transv quad)) (none) ) ;; definition for method 26 of type metalkor-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles metalkor-shot ((obj metalkor-shot)) +(defmethod spawn-shell-particles metalkor-shot ((this metalkor-shot)) "TODO - confirm" (local-vars (sv-224 (function vector entity-actor skeleton-group vector object none :behavior manipy)) (sv-240 vector) (sv-256 entity-actor) ) - (let* ((s4-0 (-> obj root)) - (v0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s4-0 trans)) 2048.0)) + (let* ((s4-0 (-> this root)) + (v0-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> s4-0 trans quad)) @@ -344,7 +344,7 @@ ) ) (let ((s4-2 (new 'stack-no-clear 'vector))) - (set! (-> s4-2 quad) (-> obj root trans quad)) + (set! (-> s4-2 quad) (-> this root trans quad)) (let ((gp-1 (new 'stack-no-clear 'quaternion))) (let ((s3-0 (lambda :behavior metalkor-shot () @@ -380,7 +380,7 @@ ) ) (let ((s2-0 (new 'stack-no-clear 'matrix))) - (vector-normalize-copy! (-> s2-0 vector 1) (-> obj old-transv) -1.0) + (vector-normalize-copy! (-> s2-0 vector 1) (-> this old-transv) -1.0) (cond ((and (< (fabs (-> s2-0 vector 1 y)) (fabs (-> s2-0 vector 1 x))) (< (fabs (-> s2-0 vector 1 y)) (fabs (-> s2-0 vector 1 z))) @@ -410,7 +410,7 @@ ) (set! sv-224 manipy-init) (set! sv-240 s4-2) - (set! sv-256 (-> obj entity)) + (set! sv-256 (-> this entity)) (let ((t0-2 (art-group-get-by-name *level* "skel-bomb-blast" (the-as (pointer uint32) #f))) (t1-2 #f) (t2-2 0) @@ -443,7 +443,7 @@ manipy :init manipy-init s4-2 - (-> obj entity) + (-> this entity) (art-group-get-by-name *level* "skel-generic-blast" (the-as (pointer uint32) #f)) #f 0 @@ -465,33 +465,33 @@ ;; definition for method 20 of type metalkor-legs ;; INFO: Used lq/sq -(defmethod get-trans metalkor-legs ((obj metalkor-legs) (arg0 int)) +(defmethod get-trans metalkor-legs ((this metalkor-legs) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (cond ((or (= arg0 2) (= arg0 3)) (let ((v0-0 (new 'static 'vector :w 1.0))) (set! (-> v0-0 quad) - (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 0 prim-core world-sphere quad) + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0 prim-core world-sphere quad) ) (+! (-> v0-0 y) 32768.0) v0-0 ) ) (else - ((method-of-type process-focusable get-trans) obj arg0) + ((method-of-type process-focusable get-trans) this arg0) ) ) ) ;; definition for method 7 of type metalkor-legs ;; WARN: Return type mismatch process-focusable vs metalkor-legs. -(defmethod relocate metalkor-legs ((obj metalkor-legs) (arg0 int)) +(defmethod relocate metalkor-legs ((this metalkor-legs) (arg0 int)) (dotimes (v1-0 6) - (if (nonzero? (-> obj joint-ik v1-0)) - (&+! (-> obj joint-ik v1-0) arg0) + (if (nonzero? (-> this joint-ik v1-0)) + (&+! (-> this joint-ik v1-0) arg0) ) ) - (the-as metalkor-legs ((method-of-type process-focusable relocate) obj arg0)) + (the-as metalkor-legs ((method-of-type process-focusable relocate) this arg0)) ) ;; definition for function metalkor-legs-handler @@ -696,7 +696,7 @@ :virtual #t :event metalkor-legs-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (dotimes (gp-0 6) (enable-set! (-> self joint-ik gp-0) #t) ((method-of-type cam-float-seeker init) (the-as cam-float-seeker (-> self foot-locks gp-0)) 0.0 0.1 0.3 0.9) @@ -804,17 +804,17 @@ ;; definition for method 13 of type metalkor-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod apply-gravity metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (local-vars (f0-16 float) (f0-31 float)) (cond ((zero? arg1) - (set! (-> obj joint-length) 8192.0) + (set! (-> this joint-length) 8192.0) ) ((= arg1 1) - (set! (-> obj joint-length) 12288.0) + (set! (-> this joint-length) 12288.0) ) ((= arg1 2) - (set! (-> obj joint-length) 8192.0) + (set! (-> this joint-length) 8192.0) ) (else (let ((v1-8 (-> arg2 parent))) @@ -836,21 +836,21 @@ ) ) ) - (set! (-> obj joint-length) 5734.4) - (set! (-> obj joint-length) 5324.8) + (set! (-> this joint-length) 5734.4) + (set! (-> this joint-length) 5324.8) ) ) ) ) (vector-float*! arg0 - (-> obj gravity) + (-> this gravity) (* 4096.0 (-> self clock time-adjust-ratio) (lerp-scale 0.2 0.1 (the float arg1) 0.0 20.0)) ) (vector-float*! arg0 arg0 0.75) - (set! (-> obj axial-slop) (* 364.0889 (the float arg1))) - (let ((f26-0 (-> obj prev-rotation)) - (f28-0 (-> obj prev-y-rotation)) + (set! (-> this axial-slop) (* 364.0889 (the float arg1))) + (let ((f26-0 (-> this prev-rotation)) + (f28-0 (-> this prev-y-rotation)) (f30-1 (ja-aframe-num-of-proc (the-as process-drawable (ppointer->process (-> arg2 parent))) 0)) ) (let* ((v1-27 (-> arg2 parent)) @@ -948,8 +948,8 @@ ) ) ) - (set! f26-0 (+ f0-16 (* 182.04445 (-> obj osc-z value)))) - (+ f1-3 (* 182.04445 (-> obj osc-y value))) + (set! f26-0 (+ f0-16 (* 182.04445 (-> this osc-z value)))) + (+ f1-3 (* 182.04445 (-> this osc-y value))) ) ) (else @@ -977,7 +977,7 @@ (set! s2-2 #f) ) (else - (vector-! arg0 (target-pos 0) (the-as vector (-> obj chain-joints arg1))) + (vector-! arg0 (target-pos 0) (the-as vector (-> this chain-joints arg1))) (vector-normalize! arg0 12288.0) ) ) @@ -1036,8 +1036,8 @@ (set! f0-31 (+ 910.2222 f26-0)) ) ) - (set! f26-0 (+ f0-31 (* 182.04445 (-> obj osc-z value)))) - (+! f28-0 (* 182.04445 (-> obj osc-y value))) + (set! f26-0 (+ f0-31 (* 182.04445 (-> this osc-z value)))) + (+! f28-0 (* 182.04445 (-> this osc-y value))) ) ) ) @@ -1048,8 +1048,8 @@ ) ) ) - (set! (-> obj prev-rotation) f26-0) - (set! (-> obj prev-y-rotation) f28-0) + (set! (-> this prev-rotation) f26-0) + (set! (-> this prev-y-rotation) f28-0) (when (not s2-2) (let ((a1-11 (-> arg2 node-list data 3 bone transform)) (s2-3 (new 'stack-no-clear 'matrix)) @@ -1064,7 +1064,7 @@ (vector+float*! arg0 arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* arg1 64))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* arg1 64))) (lerp-scale 0.9 0.5 (the float arg1) 0.0 20.0) ) ) @@ -1118,15 +1118,15 @@ (vector+float*! arg0 arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ arg1 -1) 64))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 -1) 64))) 0.9 ) ) - ((-> obj move-with-parent) + ((-> this move-with-parent) (vector+float*! arg0 arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ arg1 -1) 64))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 -1) 64))) 0.8 ) ) @@ -1138,21 +1138,21 @@ ) ;; definition for method 16 of type metalkor-chain-physics -(defmethod chain-physics-method-16 metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 int)) 10922.667 ) ;; definition for method 14 of type metalkor-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-14 metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) ) ;; definition for method 15 of type metalkor-chain-physics -(defmethod clamp-length metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) - ((method-of-type chain-physics clamp-length) obj arg0 arg1 arg2 arg3) +(defmethod clamp-length metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) + ((method-of-type chain-physics clamp-length) this arg0 arg1 arg2 arg3) (when (< 5 (the-as int arg2)) (let ((a0-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg3 node-list data 3))) (s5-1 (new 'stack-no-clear 'vector)) @@ -1169,14 +1169,14 @@ ;; definition for method 12 of type metalkor-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod gravity-update metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 process-drawable)) +(defmethod gravity-update metalkor-chain-physics ((this metalkor-chain-physics) (arg0 process-drawable)) (let ((t9-0 (method-of-type chain-physics gravity-update))) - (t9-0 obj arg0) + (t9-0 this arg0) ) - (update! (-> obj rand-y)) - (update! (-> obj rand-z)) - (update! (-> obj osc-y) (-> obj rand-y value)) - (update! (-> obj osc-z) (-> obj rand-z value)) + (update! (-> this rand-y)) + (update! (-> this rand-z)) + (update! (-> this osc-y) (-> this rand-y value)) + (update! (-> this osc-z) (-> this rand-z value)) (let ((s5-1 (new 'stack-no-clear 'collide-query))) (let ((s4-0 (new 'stack-no-clear 'bounding-box))) (let ((s3-0 (new 'stack-no-clear 'sphere))) @@ -1200,7 +1200,7 @@ ;; definition for method 17 of type metalkor-chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-17 metalkor-chain-physics ((obj metalkor-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 metalkor-chain-physics ((this metalkor-chain-physics) (arg0 vector) (arg1 int)) (local-vars (v1-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1209,7 +1209,7 @@ ) (init-vf0-vector) (let* ((s5-0 (new 'stack-no-clear 'collide-query)) - (v1-2 (-> obj chain-joints arg1)) + (v1-2 (-> this chain-joints arg1)) (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> v1-2 position))) (s3-0 0) ) @@ -1268,20 +1268,20 @@ ;; definition for method 7 of type metalkor-lowtorso ;; WARN: Return type mismatch process-focusable vs metalkor-lowtorso. -(defmethod relocate metalkor-lowtorso ((obj metalkor-lowtorso) (arg0 int)) - (if (nonzero? (-> obj tail)) - (&+! (-> obj tail) arg0) +(defmethod relocate metalkor-lowtorso ((this metalkor-lowtorso) (arg0 int)) + (if (nonzero? (-> this tail)) + (&+! (-> this tail) arg0) ) - (if (nonzero? (-> obj egg-toss-joint-1)) - (&+! (-> obj egg-toss-joint-1) arg0) + (if (nonzero? (-> this egg-toss-joint-1)) + (&+! (-> this egg-toss-joint-1) arg0) ) - (if (nonzero? (-> obj egg-toss-joint-2)) - (&+! (-> obj egg-toss-joint-2) arg0) + (if (nonzero? (-> this egg-toss-joint-2)) + (&+! (-> this egg-toss-joint-2) arg0) ) - (if (nonzero? (-> obj egg-toss-joint-3)) - (&+! (-> obj egg-toss-joint-3) arg0) + (if (nonzero? (-> this egg-toss-joint-3)) + (&+! (-> this egg-toss-joint-3) arg0) ) - (the-as metalkor-lowtorso ((method-of-type process-focusable relocate) obj arg0)) + (the-as metalkor-lowtorso ((method-of-type process-focusable relocate) this arg0)) ) ;; failed to figure out what this is: @@ -1391,7 +1391,7 @@ (-> block param 0) (static-attack-info ((id (new-attack-id)) (mode 'deadly) (vector s4-2) (shove-up (meters 4)))) ) - (set! (-> self no-collision-timer) (current-time)) + (set-time! (-> self no-collision-timer)) (let ((v1-52 (-> self root root-prim))) (set! (-> v1-52 prim-core collide-as) (collide-spec)) (set! (-> v1-52 prim-core collide-with) (collide-spec)) @@ -1406,11 +1406,11 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set-params! (-> self egg-toss-joint-angle) 0.0 0.05 0.3 0.9) ) :trans (behavior () - (when (>= (- (current-time) (-> self no-collision-timer)) (seconds 0.1)) + (when (time-elapsed? (-> self no-collision-timer) (seconds 0.1)) (let ((v1-5 (-> self root root-prim))) (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) @@ -1490,153 +1490,153 @@ ) ;; definition for method 3 of type nestb-formation -(defmethod inspect nestb-formation ((obj nestb-formation)) - (when (not obj) - (set! obj obj) +(defmethod inspect nestb-formation ((this nestb-formation)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hover-formation inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 15 of type nestb-formation -(defmethod hover-formation-method-15 nestb-formation ((obj nestb-formation) (arg0 vector) (arg1 vector)) - (logior! (-> obj formation flags) 2) +(defmethod hover-formation-method-15 nestb-formation ((this nestb-formation) (arg0 vector) (arg1 vector)) + (logior! (-> this formation flags) 2) 0 ) ;; definition for method 115 of type metalkor-flitter ;; WARN: Return type mismatch symbol vs none. -(defmethod init-enemy! metalkor-flitter ((obj metalkor-flitter)) +(defmethod init-enemy! metalkor-flitter ((this metalkor-flitter)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flitter" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *metalkor-flitter-nav-enemy-info*) - (set! (-> obj move-angle) 10922.667) - (set! (-> obj heading) (the-as basic (if (= (rand-vu-int-range 0 1) 1) - #t - #f - ) - ) + (init-enemy-behaviour-and-stats! this *metalkor-flitter-nav-enemy-info*) + (set! (-> this move-angle) 10922.667) + (set! (-> this heading) (the-as basic (if (= (rand-vu-int-range 0 1) 1) + #t + #f + ) + ) ) - (set! (-> obj change-dir-time) 0) - (set! (-> obj off-screen-timer) (the-as uint 0)) - (set! (-> obj amb-sound-timer) (the-as uint 0)) + (set! (-> this change-dir-time) 0) + (set! (-> this off-screen-timer) (the-as uint 0)) + (set! (-> this amb-sound-timer) (the-as uint 0)) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x 942.08 :y -860.16 :z 1269.76 :w 163840.0) ) (add-connection *part-engine* - obj + this 28 - obj + this 318 (new 'static 'vector :x -942.08 :y -860.16 :z 1269.76 :w 163840.0) ) - (set-gravity-length (-> obj root dynam) 491520.0) - (set! (-> obj minimap) #f) + (set-gravity-length (-> this root dynam) 491520.0) + (set! (-> this minimap) #f) (none) ) ;; definition for method 132 of type metalkor-flitter -(defmethod dispose! metalkor-flitter ((obj metalkor-flitter)) +(defmethod dispose! metalkor-flitter ((this metalkor-flitter)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (with-pp - (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) - (when (and (>= (-> obj enemy-info gem-joint) 0) - (not (logtest? (enemy-flag cam-attack-mode) (-> obj enemy-flags))) + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) + (when (and (>= (-> this enemy-info gem-joint) 0) + (not (logtest? (enemy-flag cam-attack-mode) (-> this enemy-flags))) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'have-gem?) - (or (send-event-function (ppointer->process (-> obj parent)) a1-0) + (or (send-event-function (ppointer->process (-> this parent)) a1-0) (task-node-closed? (game-task-node city-win-introduction)) (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) ) ) ) - (logior! (-> obj enemy-flags) (enemy-flag cam-attack-mode)) - (remove-from-process *part-engine* obj) + (logior! (-> this enemy-flags) (enemy-flag cam-attack-mode)) + (remove-from-process *part-engine* this) (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-no-seg)) - (the-as int (-> obj enemy-info gem-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-no-seg)) + (the-as int (-> this enemy-info gem-seg)) ) (let ((v1-30 (ppointer->process (birth-pickup-at-point - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj enemy-info gem-joint))) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this enemy-info gem-joint))) (pickup-type gem) 1.0 #t - (ppointer->process (-> obj parent)) - (-> obj fact) + (ppointer->process (-> this parent)) + (-> this fact) ) ) ) ) - (send-event (ppointer->process (-> obj parent)) 'flitter-change-gem obj v1-30) + (send-event (ppointer->process (-> this parent)) 'flitter-change-gem this v1-30) ) ) ) - ((method-of-type flitter dispose!) obj) + ((method-of-type flitter dispose!) this) (none) ) ) ;; definition for method 132 of type metalkor-wasp -(defmethod dispose! metalkor-wasp ((obj metalkor-wasp)) +(defmethod dispose! metalkor-wasp ((this metalkor-wasp)) "Cleans-up the enemy and any associated resources. Potentially spawns skull gems" (with-pp - (when (not (logtest? (enemy-flag recover-applied-velocity) (-> obj enemy-flags))) - (when (and (>= (-> obj enemy-info gem-joint) 0) - (not (logtest? (enemy-flag cam-attack-mode) (-> obj enemy-flags))) + (when (not (logtest? (enemy-flag recover-applied-velocity) (-> this enemy-flags))) + (when (and (>= (-> this enemy-info gem-joint) 0) + (not (logtest? (enemy-flag cam-attack-mode) (-> this enemy-flags))) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'have-gem?) - (or (send-event-function (ppointer->process (-> obj parent)) a1-0) + (or (send-event-function (ppointer->process (-> this parent)) a1-0) (task-node-closed? (game-task-node city-win-introduction)) (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) ) ) ) - (logior! (-> obj enemy-flags) (enemy-flag cam-attack-mode)) - (remove-from-process *part-engine* obj) + (logior! (-> this enemy-flags) (enemy-flag cam-attack-mode)) + (remove-from-process *part-engine* this) (setup-masks - (-> obj draw) - (the-as int (-> obj enemy-info gem-no-seg)) - (the-as int (-> obj enemy-info gem-seg)) + (-> this draw) + (the-as int (-> this enemy-info gem-no-seg)) + (the-as int (-> this enemy-info gem-seg)) ) (let ((v1-28 (ppointer->process (birth-pickup-at-point - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj enemy-info gem-joint))) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this enemy-info gem-joint))) (pickup-type gem) 1.0 #t *entity-pool* - (-> obj fact) + (-> this fact) ) ) ) ) - (send-event (ppointer->process (-> obj parent)) 'wasp-change-gem obj v1-28) + (send-event (ppointer->process (-> this parent)) 'wasp-change-gem this v1-28) ) ) ) - ((method-of-type wasp dispose!) obj) + ((method-of-type wasp dispose!) this) (none) ) ) @@ -1664,20 +1664,20 @@ ) ;; definition for method 3 of type rift-ring-ingame -(defmethod inspect rift-ring-ingame ((obj rift-ring-ingame)) - (when (not obj) - (set! obj obj) +(defmethod inspect rift-ring-ingame ((this rift-ring-ingame)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim-speed: #~%" (-> obj anim-speed)) - (format #t "~2Tstutter: ~A~%" (-> obj stutter)) - (format #t "~2Tspin-sound: ~D~%" (-> obj spin-sound)) - (format #t "~2Tspin-sound-playing: ~A~%" (-> obj spin-sound-playing)) + (format #t "~2Tanim-speed: #~%" (-> this anim-speed)) + (format #t "~2Tstutter: ~A~%" (-> this stutter)) + (format #t "~2Tspin-sound: ~D~%" (-> this spin-sound)) + (format #t "~2Tspin-sound-playing: ~A~%" (-> this spin-sound-playing)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1714,55 +1714,55 @@ ) ;; definition for method 10 of type rift-ring-ingame -(defmethod deactivate rift-ring-ingame ((obj rift-ring-ingame)) - (if (-> obj spin-sound-playing) - (sound-stop (-> obj spin-sound)) +(defmethod deactivate rift-ring-ingame ((this rift-ring-ingame)) + (if (-> this spin-sound-playing) + (sound-stop (-> this spin-sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 11 of type rift-ring-ingame ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! rift-ring-ingame ((obj rift-ring-ingame) (arg0 entity-actor)) +(defmethod init-from-entity! rift-ring-ingame ((this rift-ring-ingame) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-rift-ring-ingame" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1236) obj)) - (set! (-> obj draw light-index) (the-as uint 10)) - (set! (-> obj stutter) #f) - (set! (-> obj spin-sound) (new-sound-id)) - (set! (-> obj spin-sound-playing) #f) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1236) this)) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this stutter) #f) + (set! (-> this spin-sound) (new-sound-id)) + (set! (-> this spin-sound-playing) #f) + (go (method-of-object this idle)) (none) ) ;; definition for method 13 of type metalkor-spinner-chain-physics ;; WARN: Return type mismatch vector vs none. -(defmethod apply-gravity metalkor-spinner-chain-physics ((obj metalkor-spinner-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) - (vector-float*! arg0 (-> obj gravity) (-> obj gravity-mult)) +(defmethod apply-gravity metalkor-spinner-chain-physics ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) + (vector-float*! arg0 (-> this gravity) (-> this gravity-mult)) (vector+float*! arg0 arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* arg1 64))) - (-> obj velocity-mult) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* arg1 64))) + (-> this velocity-mult) ) (none) ) ;; definition for method 14 of type metalkor-spinner-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-14 metalkor-spinner-chain-physics ((obj metalkor-spinner-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 metalkor-spinner-chain-physics ((this metalkor-spinner-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) @@ -1770,11 +1770,11 @@ This commonly includes things such as: ;; definition for method 7 of type metalkor-spinner ;; WARN: Return type mismatch process-drawable vs metalkor-spinner. -(defmethod relocate metalkor-spinner ((obj metalkor-spinner) (arg0 int)) - (if (nonzero? (-> obj chain)) - (&+! (-> obj chain) arg0) +(defmethod relocate metalkor-spinner ((this metalkor-spinner) (arg0 int)) + (if (nonzero? (-> this chain)) + (&+! (-> this chain) arg0) ) - (the-as metalkor-spinner ((method-of-type process-drawable relocate) obj arg0)) + (the-as metalkor-spinner ((method-of-type process-drawable relocate) this arg0)) ) ;; failed to figure out what this is: @@ -1784,7 +1784,7 @@ This commonly includes things such as: (set! (-> self chain joint-length) (* 12288.0 (-> self root scale y))) (set! (-> self root scale y) 1.0) (initialize-chain-joints (-> self chain)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let* ((f30-0 0.9) (f28-0 0.2) (v1-12 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) @@ -1811,7 +1811,7 @@ This commonly includes things such as: (quaternion-normalize! (-> self root quat)) (update (-> self chain) self) (cond - ((< (- (current-time) (-> self state-time)) (seconds 1)) + ((not (time-elapsed? (-> self state-time) (seconds 1))) ) ((let ((v1-13 (ja-group))) (and v1-13 (= v1-13 (-> self draw art-group data 53))) @@ -1960,16 +1960,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type nest-break-precipice -(defmethod inspect nest-break-precipice ((obj nest-break-precipice)) - (when (not obj) - (set! obj obj) +(defmethod inspect nest-break-precipice ((this nest-break-precipice)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1993,96 +1993,96 @@ This commonly includes things such as: ;; definition for method 11 of type nest-break-precipice ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-break-precipice ((obj nest-break-precipice) (arg0 entity-actor)) +(defmethod init-from-entity! nest-break-precipice ((this nest-break-precipice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-break-precipice" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 17)) + (set! (-> this draw light-index) (the-as uint 17)) (if (task-node-closed? (game-task-node nest-boss-introduction)) - (go (method-of-object obj die)) - (go (method-of-object obj idle)) + (go (method-of-object this die)) + (go (method-of-object this idle)) ) (none) ) ;; definition for method 15 of type hud-metalkor ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-metalkor ((obj hud-metalkor)) - (set-hud-piece-position! (-> obj sprites 1) (the int (+ 462.0 (* 130.0 (-> obj offset)))) 350) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -32 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 1)) -62 14) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 1)) -32 14) - (let ((s5-0 (-> obj values 0 current)) - (f30-0 (* 0.01 (the float (-> obj values 1 current)))) +(defmethod draw hud-metalkor ((this hud-metalkor)) + (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites 1)) -32 14) + (let ((s5-0 (-> this values 0 current)) + (f30-0 (* 0.01 (the float (-> this values 1 current)))) ) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 1)) -92 15) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 1)) -92 15) (cond ((= s5-0 1) - (set! (-> obj sprites 4 color x) 0) - (set! (-> obj sprites 4 color y) 255) + (set! (-> this sprites 4 color x) 0) + (set! (-> this sprites 4 color y) 255) (set! f30-0 (+ 2.0 f30-0)) ) ((= s5-0 2) - (set! (-> obj sprites 4 color y) 255) - (set! (-> obj sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 255) + (set! (-> this sprites 4 color x) 255) (set! f30-0 (+ 1.0 f30-0)) ) ((= s5-0 3) - (set! (-> obj sprites 4 color x) 255) - (set! (-> obj sprites 4 color y) 0) + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 0) 0 ) (else (set! f30-0 0.0) ) ) - (set! (-> obj sprites 4 scale-x) (* -7.25 f30-0)) + (set! (-> this sprites 4 scale-x) (* -7.25 f30-0)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 17 of type hud-metalkor ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-metalkor ((obj hud-metalkor)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-metalkor ((this hud-metalkor)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj values 0 target) 1) - (set! (-> obj values 1 target) 100) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 5 scale-x) 0.5) - (set! (-> obj sprites 5 flags) (the-as uint 4)) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 6 scale-x) 0.5) - (set! (-> obj sprites 6 flags) (the-as uint 4)) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 4 scale-y) 3.25) - (set! (-> obj sprites 4 color z) 0) - (set! (-> obj sprites 4 flags) (the-as uint 4)) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 3 scale-y) 1.5) - (set! (-> obj sprites 3 color z) 0) - (set! (-> obj sprites 3 flags) (the-as uint 4)) + (set! (-> this values 0 target) 1) + (set! (-> this values 1 target) 100) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 5 scale-x) 0.5) + (set! (-> this sprites 5 flags) (the-as uint 4)) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 6 scale-x) 0.5) + (set! (-> this sprites 6 flags) (the-as uint 4)) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 4 scale-y) 3.25) + (set! (-> this sprites 4 color z) 0) + (set! (-> this sprites 4 flags) (the-as uint 4)) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 3 scale-y) 1.5) + (set! (-> this sprites 3 color z) 0) + (set! (-> this sprites 3 flags) (the-as uint 4)) 0 (none) ) @@ -2183,16 +2183,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type metalkor-rays -(defmethod inspect metalkor-rays ((obj metalkor-rays)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-rays ((this metalkor-rays)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2400,15 +2400,15 @@ This commonly includes things such as: ;; definition for method 7 of type metalkor-bomb ;; WARN: Return type mismatch process-drawable vs metalkor-bomb. -(defmethod relocate metalkor-bomb ((obj metalkor-bomb) (arg0 int)) +(defmethod relocate metalkor-bomb ((this metalkor-bomb) (arg0 int)) (dotimes (v1-0 (min 49 (-> *metalkor-bomb-probe-joints* length))) - (when (nonzero? (-> obj joint-mods v1-0)) - (if (nonzero? (-> obj joint-mods v1-0)) - (&+! (-> obj joint-mods v1-0) arg0) + (when (nonzero? (-> this joint-mods v1-0)) + (if (nonzero? (-> this joint-mods v1-0)) + (&+! (-> this joint-mods v1-0) arg0) ) ) ) - (the-as metalkor-bomb ((method-of-type process-drawable relocate) obj arg0)) + (the-as metalkor-bomb ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for symbol *metalkor-bomb-collide-joints*, type (array int8) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc index 017878afa2..65bb953465 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-setup_REF.gc @@ -100,17 +100,17 @@ ) ;; definition for method 3 of type metalkor-bomb -(defmethod inspect metalkor-bomb ((obj metalkor-bomb)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-bomb ((this metalkor-bomb)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tjoint-mods[49] @ #x~X~%" (-> obj joint-mods)) + (format #t "~2Tjoint-mods[49] @ #x~X~%" (-> this joint-mods)) (label cfg-4) - obj + this ) ;; definition of type gem-tracker @@ -129,19 +129,19 @@ ) ;; definition for method 3 of type gem-tracker -(defmethod inspect gem-tracker ((obj gem-tracker)) - (when (not obj) - (set! obj obj) +(defmethod inspect gem-tracker ((this gem-tracker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tgems[10] @ #x~X~%" (-> obj gems)) - (format #t "~2Tgems-collected: ~D~%" (-> obj gems-collected)) - (format #t "~2Tperm-byte-index: ~D~%" (-> obj perm-byte-index)) + (format #t "~2Tgems[10] @ #x~X~%" (-> this gems)) + (format #t "~2Tgems-collected: ~D~%" (-> this gems-collected)) + (format #t "~2Tperm-byte-index: ~D~%" (-> this perm-byte-index)) (label cfg-4) - obj + this ) ;; definition for function gem-tracker-get-slot @@ -226,16 +226,16 @@ ) ;; definition for method 3 of type flitter-gem-tracker -(defmethod inspect flitter-gem-tracker ((obj flitter-gem-tracker)) - (when (not obj) - (set! obj obj) +(defmethod inspect flitter-gem-tracker ((this flitter-gem-tracker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gem-tracker inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type wasp-gem-tracker @@ -248,16 +248,16 @@ ) ;; definition for method 3 of type wasp-gem-tracker -(defmethod inspect wasp-gem-tracker ((obj wasp-gem-tracker)) - (when (not obj) - (set! obj obj) +(defmethod inspect wasp-gem-tracker ((this wasp-gem-tracker)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type gem-tracker inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type rift-occlude @@ -274,17 +274,17 @@ ) ;; definition for method 3 of type rift-occlude -(defmethod inspect rift-occlude ((obj rift-occlude)) - (when (not obj) - (set! obj obj) +(defmethod inspect rift-occlude ((this rift-occlude)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Toriginal-trans: #~%" (-> obj original-trans)) + (format #t "~2Toriginal-trans: #~%" (-> this original-trans)) (label cfg-4) - obj + this ) ;; definition of type metalkor-distort @@ -301,16 +301,16 @@ ) ;; definition for method 3 of type metalkor-distort -(defmethod inspect metalkor-distort ((obj metalkor-distort)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-distort ((this metalkor-distort)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type metalkor-explode @@ -327,17 +327,17 @@ ) ;; definition for method 3 of type metalkor-explode -(defmethod inspect metalkor-explode ((obj metalkor-explode)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-explode ((this metalkor-explode)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tring: ~D~%" (-> obj ring)) + (format #t "~2Tring: ~D~%" (-> this ring)) (label cfg-4) - obj + this ) ;; definition of type metalkor-kid @@ -353,16 +353,16 @@ ) ;; definition for method 3 of type metalkor-kid -(defmethod inspect metalkor-kid ((obj metalkor-kid)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-kid ((this metalkor-kid)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type nestb-tail-bound @@ -378,16 +378,16 @@ ) ;; definition for method 3 of type nestb-tail-bound -(defmethod inspect nestb-tail-bound ((obj nestb-tail-bound)) - (when (not obj) - (set! obj obj) +(defmethod inspect nestb-tail-bound ((this nestb-tail-bound)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type metalkor-ja-float-info @@ -402,16 +402,16 @@ ) ;; definition for method 3 of type metalkor-ja-float-info -(defmethod inspect metalkor-ja-float-info ((obj metalkor-ja-float-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-ja-float-info ((this metalkor-ja-float-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'metalkor-ja-float-info) - (format #t "~1Tfloat-anim: ~A~%" (-> obj float-anim)) - (format #t "~1Tchannel-index: ~D~%" (-> obj channel-index)) + (format #t "[~8x] ~A~%" this 'metalkor-ja-float-info) + (format #t "~1Tfloat-anim: ~A~%" (-> this float-anim)) + (format #t "~1Tchannel-index: ~D~%" (-> this channel-index)) (label cfg-4) - obj + this ) ;; definition of type metalkor-spinner-info @@ -426,16 +426,16 @@ ) ;; definition for method 3 of type metalkor-spinner-info -(defmethod inspect metalkor-spinner-info ((obj metalkor-spinner-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-spinner-info ((this metalkor-spinner-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'metalkor-spinner-info) - (format #t "~1Tjoint-index: ~D~%" (-> obj joint-index)) - (format #t "~1Tlaunch-angle: ~f~%" (-> obj launch-angle)) + (format #t "[~8x] ~A~%" this 'metalkor-spinner-info) + (format #t "~1Tjoint-index: ~D~%" (-> this joint-index)) + (format #t "~1Tlaunch-angle: ~f~%" (-> this launch-angle)) (label cfg-4) - obj + this ) ;; definition of type metalkor-shot @@ -449,17 +449,17 @@ ) ;; definition for method 3 of type metalkor-shot -(defmethod inspect metalkor-shot ((obj metalkor-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-shot ((this metalkor-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type metalhead-shot inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Told-transv: #~%" (-> obj old-transv)) + (format #t "~2Told-transv: #~%" (-> this old-transv)) (label cfg-4) - obj + this ) ;; definition for symbol *metalkor-flitter-nav-enemy-info*, type nav-enemy-info @@ -575,16 +575,16 @@ ) ;; definition for method 3 of type metalkor-flitter -(defmethod inspect metalkor-flitter ((obj metalkor-flitter)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-flitter ((this metalkor-flitter)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type flitter inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type metalkor-wasp @@ -597,16 +597,16 @@ ) ;; definition for method 3 of type metalkor-wasp -(defmethod inspect metalkor-wasp ((obj metalkor-wasp)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-wasp ((this metalkor-wasp)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type wasp inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type metalkor-spinner-chain-physics @@ -620,31 +620,31 @@ ) ;; definition for method 3 of type metalkor-spinner-chain-physics -(defmethod inspect metalkor-spinner-chain-physics ((obj metalkor-spinner-chain-physics)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-spinner-chain-physics ((this metalkor-spinner-chain-physics)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tchain-joints[20] @ #x~X~%" (-> obj chain-joints)) - (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~1Troot-joint-index: ~D~%" (-> obj root-joint-index)) - (format #t "~1Tjoint-length: ~f~%" (-> obj joint-length)) - (format #t "~1Tgravity: #~%" (-> obj gravity)) - (format #t "~1Tgravity-target: #~%" (-> obj gravity-target)) - (format #t "~1Tstretch-vel: ~f~%" (-> obj stretch-vel)) - (format #t "~1Tstretch-vel-parallel: ~f~%" (-> obj stretch-vel-parallel)) - (format #t "~1Tcompress-vel: ~f~%" (-> obj compress-vel)) - (format #t "~1Tcompress-vel-parallel: ~f~%" (-> obj compress-vel-parallel)) - (format #t "~1Tnegate-y: ~A~%" (-> obj negate-y)) - (format #t "~1Taxial-slop: ~f~%" (-> obj axial-slop)) - (format #t "~1Tmaximum-stretch: ~f~%" (-> obj maximum-stretch)) - (format #t "~1Tturn-off-start: ~D~%" (-> obj turn-off-start)) - (format #t "~1Tturn-off-duration: ~D~%" (-> obj turn-off-duration)) - (format #t "~1Tgravity-mult: ~f~%" (-> obj gravity-mult)) - (format #t "~1Tvelocity-mult: ~f~%" (-> obj velocity-mult)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tchain-joints[20] @ #x~X~%" (-> this chain-joints)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Troot-joint-index: ~D~%" (-> this root-joint-index)) + (format #t "~1Tjoint-length: ~f~%" (-> this joint-length)) + (format #t "~1Tgravity: #~%" (-> this gravity)) + (format #t "~1Tgravity-target: #~%" (-> this gravity-target)) + (format #t "~1Tstretch-vel: ~f~%" (-> this stretch-vel)) + (format #t "~1Tstretch-vel-parallel: ~f~%" (-> this stretch-vel-parallel)) + (format #t "~1Tcompress-vel: ~f~%" (-> this compress-vel)) + (format #t "~1Tcompress-vel-parallel: ~f~%" (-> this compress-vel-parallel)) + (format #t "~1Tnegate-y: ~A~%" (-> this negate-y)) + (format #t "~1Taxial-slop: ~f~%" (-> this axial-slop)) + (format #t "~1Tmaximum-stretch: ~f~%" (-> this maximum-stretch)) + (format #t "~1Tturn-off-start: ~D~%" (-> this turn-off-start)) + (format #t "~1Tturn-off-duration: ~D~%" (-> this turn-off-duration)) + (format #t "~1Tgravity-mult: ~f~%" (-> this gravity-mult)) + (format #t "~1Tvelocity-mult: ~f~%" (-> this velocity-mult)) (label cfg-4) - obj + this ) ;; definition of type metalkor-spinner @@ -666,20 +666,20 @@ ) ;; definition for method 3 of type metalkor-spinner -(defmethod inspect metalkor-spinner ((obj metalkor-spinner)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-spinner ((this metalkor-spinner)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tparent-joint-index: ~D~%" (-> obj parent-joint-index)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Tchain: ~A~%" (-> obj chain)) - (format #t "~2Tanim-speed: ~f~%" (-> obj anim-speed)) + (format #t "~2Tparent-joint-index: ~D~%" (-> this parent-joint-index)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tchain: ~A~%" (-> this chain)) + (format #t "~2Tanim-speed: ~f~%" (-> this anim-speed)) (label cfg-4) - obj + this ) ;; definition of type metalkor-egg @@ -701,19 +701,19 @@ ) ;; definition for method 3 of type metalkor-egg -(defmethod inspect metalkor-egg ((obj metalkor-egg)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-egg ((this metalkor-egg)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlast-hit-normal: #~%" (-> obj last-hit-normal)) - (format #t "~2Tsticky-time: ~D~%" (-> obj sticky-time)) - (format #t "~2Tflitter-slot: ~D~%" (-> obj flitter-slot)) + (format #t "~2Tlast-hit-normal: #~%" (-> this last-hit-normal)) + (format #t "~2Tsticky-time: ~D~%" (-> this sticky-time)) + (format #t "~2Tflitter-slot: ~D~%" (-> this flitter-slot)) (label cfg-4) - obj + this ) ;; definition of type metalkor-wings @@ -730,17 +730,17 @@ ) ;; definition for method 3 of type metalkor-wings -(defmethod inspect metalkor-wings ((obj metalkor-wings)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-wings ((this metalkor-wings)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tprefix: ~A~%" (-> obj prefix)) + (format #t "~2Tprefix: ~A~%" (-> this prefix)) (label cfg-4) - obj + this ) ;; definition of type metalkor-foot-lock @@ -755,17 +755,17 @@ ) ;; definition for method 3 of type metalkor-foot-lock -(defmethod inspect metalkor-foot-lock ((obj metalkor-foot-lock)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-foot-lock ((this metalkor-foot-lock)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'metalkor-foot-lock) - (format #t "~1Tlock: #~%" (-> obj lock)) - (format #t "~1Told-position: #~%" (-> obj old-position)) - (format #t "~1Tinitialized: ~A~%" (-> obj initialized)) + (format #t "[~8x] ~A~%" this 'metalkor-foot-lock) + (format #t "~1Tlock: #~%" (-> this lock)) + (format #t "~1Told-position: #~%" (-> this old-position)) + (format #t "~1Tinitialized: ~A~%" (-> this initialized)) (label cfg-4) - obj + this ) ;; definition of type metalkor-legs @@ -786,21 +786,21 @@ ) ;; definition for method 3 of type metalkor-legs -(defmethod inspect metalkor-legs ((obj metalkor-legs)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-legs ((this metalkor-legs)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tprefix: ~A~%" (-> obj prefix)) - (format #t "~2Ttrackable: ~A~%" (-> obj trackable)) - (format #t "~2Tjoint-ik[6] @ #x~X~%" (-> obj joint-ik)) - (format #t "~2Tja-float-info[3] @ #x~X~%" (-> obj ja-float-info)) - (format #t "~2Tfoot-locks[6] @ #x~X~%" (-> obj foot-locks)) + (format #t "~2Tprefix: ~A~%" (-> this prefix)) + (format #t "~2Ttrackable: ~A~%" (-> this trackable)) + (format #t "~2Tjoint-ik[6] @ #x~X~%" (-> this joint-ik)) + (format #t "~2Tja-float-info[3] @ #x~X~%" (-> this ja-float-info)) + (format #t "~2Tfoot-locks[6] @ #x~X~%" (-> this foot-locks)) (label cfg-4) - obj + this ) ;; definition of type metalkor-chain-physics @@ -819,36 +819,36 @@ ) ;; definition for method 3 of type metalkor-chain-physics -(defmethod inspect metalkor-chain-physics ((obj metalkor-chain-physics)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-chain-physics ((this metalkor-chain-physics)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tchain-joints[20] @ #x~X~%" (-> obj chain-joints)) - (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~1Troot-joint-index: ~D~%" (-> obj root-joint-index)) - (format #t "~1Tjoint-length: ~f~%" (-> obj joint-length)) - (format #t "~1Tgravity: #~%" (-> obj gravity)) - (format #t "~1Tgravity-target: #~%" (-> obj gravity-target)) - (format #t "~1Tstretch-vel: ~f~%" (-> obj stretch-vel)) - (format #t "~1Tstretch-vel-parallel: ~f~%" (-> obj stretch-vel-parallel)) - (format #t "~1Tcompress-vel: ~f~%" (-> obj compress-vel)) - (format #t "~1Tcompress-vel-parallel: ~f~%" (-> obj compress-vel-parallel)) - (format #t "~1Tnegate-y: ~A~%" (-> obj negate-y)) - (format #t "~1Taxial-slop: ~f~%" (-> obj axial-slop)) - (format #t "~1Tmaximum-stretch: ~f~%" (-> obj maximum-stretch)) - (format #t "~1Tturn-off-start: ~D~%" (-> obj turn-off-start)) - (format #t "~1Tturn-off-duration: ~D~%" (-> obj turn-off-duration)) - (format #t "~1Tprev-rotation: ~f~%" (-> obj prev-rotation)) - (format #t "~1Tprev-y-rotation: ~f~%" (-> obj prev-y-rotation)) - (format #t "~1Tosc-z: #~%" (-> obj osc-z)) - (format #t "~1Tosc-y: #~%" (-> obj osc-y)) - (format #t "~1Trand-z: #~%" (-> obj rand-z)) - (format #t "~1Trand-y: #~%" (-> obj rand-y)) - (format #t "~1Tmove-with-parent: ~A~%" (-> obj move-with-parent)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tchain-joints[20] @ #x~X~%" (-> this chain-joints)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Troot-joint-index: ~D~%" (-> this root-joint-index)) + (format #t "~1Tjoint-length: ~f~%" (-> this joint-length)) + (format #t "~1Tgravity: #~%" (-> this gravity)) + (format #t "~1Tgravity-target: #~%" (-> this gravity-target)) + (format #t "~1Tstretch-vel: ~f~%" (-> this stretch-vel)) + (format #t "~1Tstretch-vel-parallel: ~f~%" (-> this stretch-vel-parallel)) + (format #t "~1Tcompress-vel: ~f~%" (-> this compress-vel)) + (format #t "~1Tcompress-vel-parallel: ~f~%" (-> this compress-vel-parallel)) + (format #t "~1Tnegate-y: ~A~%" (-> this negate-y)) + (format #t "~1Taxial-slop: ~f~%" (-> this axial-slop)) + (format #t "~1Tmaximum-stretch: ~f~%" (-> this maximum-stretch)) + (format #t "~1Tturn-off-start: ~D~%" (-> this turn-off-start)) + (format #t "~1Tturn-off-duration: ~D~%" (-> this turn-off-duration)) + (format #t "~1Tprev-rotation: ~f~%" (-> this prev-rotation)) + (format #t "~1Tprev-y-rotation: ~f~%" (-> this prev-y-rotation)) + (format #t "~1Tosc-z: #~%" (-> this osc-z)) + (format #t "~1Tosc-y: #~%" (-> this osc-y)) + (format #t "~1Trand-z: #~%" (-> this rand-z)) + (format #t "~1Trand-y: #~%" (-> this rand-y)) + (format #t "~1Tmove-with-parent: ~A~%" (-> this move-with-parent)) (label cfg-4) - obj + this ) ;; definition of type metalkor-lowtorso @@ -874,26 +874,26 @@ ) ;; definition for method 3 of type metalkor-lowtorso -(defmethod inspect metalkor-lowtorso ((obj metalkor-lowtorso)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-lowtorso ((this metalkor-lowtorso)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tprefix: ~A~%" (-> obj prefix)) - (format #t "~2Ttail: ~A~%" (-> obj tail)) - (format #t "~2Ttail-initialized: ~A~%" (-> obj tail-initialized)) - (format #t "~2Tspinners[4] @ #x~X~%" (-> obj spinners)) - (format #t "~2Tja-float-info[3] @ #x~X~%" (-> obj ja-float-info)) - (format #t "~2Tno-collision-timer: ~D~%" (-> obj no-collision-timer)) - (format #t "~2Tegg-toss-joint-1: ~A~%" (-> obj egg-toss-joint-1)) - (format #t "~2Tegg-toss-joint-2: ~A~%" (-> obj egg-toss-joint-2)) - (format #t "~2Tegg-toss-joint-3: ~A~%" (-> obj egg-toss-joint-3)) - (format #t "~2Tegg-toss-joint-angle: #~%" (-> obj egg-toss-joint-angle)) + (format #t "~2Tprefix: ~A~%" (-> this prefix)) + (format #t "~2Ttail: ~A~%" (-> this tail)) + (format #t "~2Ttail-initialized: ~A~%" (-> this tail-initialized)) + (format #t "~2Tspinners[4] @ #x~X~%" (-> this spinners)) + (format #t "~2Tja-float-info[3] @ #x~X~%" (-> this ja-float-info)) + (format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer)) + (format #t "~2Tegg-toss-joint-1: ~A~%" (-> this egg-toss-joint-1)) + (format #t "~2Tegg-toss-joint-2: ~A~%" (-> this egg-toss-joint-2)) + (format #t "~2Tegg-toss-joint-3: ~A~%" (-> this egg-toss-joint-3)) + (format #t "~2Tegg-toss-joint-angle: #~%" (-> this egg-toss-joint-angle)) (label cfg-4) - obj + this ) ;; definition of type metalkor @@ -988,81 +988,81 @@ ) ;; definition for method 3 of type metalkor -(defmethod inspect metalkor ((obj metalkor)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor ((this metalkor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttrackable: ~A~%" (-> obj trackable)) - (format #t "~2Tflitters[10] @ #x~X~%" (-> obj flitters)) - (format #t "~2Tflitter-gem-tracker: ~D~%" (-> obj flitter-gem-tracker)) - (format #t "~2Twasps[3] @ #x~X~%" (-> obj wasps)) - (format #t "~2Twasp-gem-tracker: ~D~%" (-> obj wasp-gem-tracker)) - (format #t "~2Tlast-flitter-launched: ~D~%" (-> obj last-flitter-launched)) - (format #t "~2Tlast-wasp-launched: ~D~%" (-> obj last-wasp-launched)) - (format #t "~2Tlive-flitters: ~D~%" (-> obj live-flitters)) - (format #t "~2Tlive-wasps: ~D~%" (-> obj live-wasps)) - (format #t "~2Tshoot-timer: ~D~%" (-> obj shoot-timer)) - (format #t "~2Ttarget-angle: ~f~%" (-> obj target-angle)) - (format #t "~2Twave-timer: ~D~%" (-> obj wave-timer)) - (format #t "~2Tin-wave: ~A~%" (-> obj in-wave)) - (format #t "~2Tflitter-timer: ~D~%" (-> obj flitter-timer)) - (format #t "~2Twasp-timer: ~D~%" (-> obj wasp-timer)) - (format #t "~2Tlaunching-flitters: ~A~%" (-> obj launching-flitters)) - (format #t "~2Tlaunching-wasps: ~A~%" (-> obj launching-wasps)) - (format #t "~2Tegg-timer: ~D~%" (-> obj egg-timer)) - (format #t "~2Tlast-close-attack: ~D~%" (-> obj last-close-attack)) - (format #t "~2Tlast-standing-attack: ~D~%" (-> obj last-standing-attack)) - (format #t "~2Tstage: ~D~%" (-> obj stage)) - (format #t "~2Tnext-stage-timer: ~D~%" (-> obj next-stage-timer)) - (format #t "~2Tinitial-y: ~f~%" (-> obj initial-y)) - (format #t "~2Tshots-fired: ~D~%" (-> obj shots-fired)) - (format #t "~2Tstage-hit-points: ~f~%" (-> obj stage-hit-points)) - (format #t "~2Thud: ~D~%" (-> obj hud)) - (format #t "~2Tlowtorso: ~D~%" (-> obj lowtorso)) - (format #t "~2Tlegs: ~D~%" (-> obj legs)) - (format #t "~2Twings: ~D~%" (-> obj wings)) - (format #t "~2Tkid: ~D~%" (-> obj kid)) - (format #t "~2Texplode: ~D~%" (-> obj explode)) - (format #t "~2Trift-occlude: ~D~%" (-> obj rift-occlude)) - (format #t "~2Tlast-attack-id: ~D~%" (-> obj last-attack-id)) - (format #t "~2Tcurrent-nav-poly: #~%" (-> obj current-nav-poly)) - (format #t "~2Tshot-anticipate: ~A~%" (-> obj shot-anticipate)) - (format #t "~2Tspinners[4] @ #x~X~%" (-> obj spinners)) - (format #t "~2Tneck: ~A~%" (-> obj neck)) - (format #t "~2Tprevious-flat-travel: #~%" (-> obj previous-flat-travel)) - (format #t "~2Tprevious-flat-travel-timer: ~D~%" (-> obj previous-flat-travel-timer)) - (format #t "~2Tprevious-flat-travel-long-timer: ~D~%" (-> obj previous-flat-travel-long-timer)) - (format #t "~2Tmin-state-hit-points: ~f~%" (-> obj min-state-hit-points)) - (format #t "~2Tcountdown-to-roar: ~D~%" (-> obj countdown-to-roar)) - (format #t "~2Tfor-back-interp: #~%" (-> obj for-back-interp)) - (format #t "~2Trun-walk-interp: #~%" (-> obj run-walk-interp)) - (format #t "~2Tleft-right-interp: #~%" (-> obj left-right-interp)) - (format #t "~2Twalk-turn-interp: #~%" (-> obj walk-turn-interp)) - (format #t "~2Tidle-interp: #~%" (-> obj idle-interp)) - (format #t "~2Ttmp-hit-points: ~f~%" (-> obj tmp-hit-points)) - (format #t "~2Treps-till-idle-alt: ~D~%" (-> obj reps-till-idle-alt)) - (format #t "~2Tlast-rotation: ~f~%" (-> obj last-rotation)) - (format #t "~2Tno-collision-timer: ~D~%" (-> obj no-collision-timer)) - (format #t "~2Tegg-timer: ~D~%" (-> obj egg-timer)) - (format #t "~2Tegg-angle: ~f~%" (-> obj egg-angle)) - (format #t "~2Tarm-frame: ~f~%" (-> obj arm-frame)) - (format #t "~2Tbeen-to-entity: ~A~%" (-> obj been-to-entity)) - (format #t "~2Tflying-speed: #~%" (-> obj flying-speed)) - (format #t "~2Twing-sound: ~D~%" (-> obj wing-sound)) - (format #t "~2Twing-sound-playing: ~A~%" (-> obj wing-sound-playing)) - (format #t "~2Texplode-sound: ~D~%" (-> obj explode-sound)) - (format #t "~2Tbomb-sound: ~D~%" (-> obj bomb-sound)) - (format #t "~2Tstop-bomb-sound: ~A~%" (-> obj stop-bomb-sound)) - (format #t "~2Thit-ring-trans: #~%" (-> obj hit-ring-trans)) - (format #t "~2Thit-ring-offset: #~%" (-> obj hit-ring-offset)) - (format #t "~2Tring-cam-pos: #~%" (-> obj ring-cam-pos)) - (format #t "~2Tneed-teleport: ~A~%" (-> obj need-teleport)) + (format #t "~2Ttrackable: ~A~%" (-> this trackable)) + (format #t "~2Tflitters[10] @ #x~X~%" (-> this flitters)) + (format #t "~2Tflitter-gem-tracker: ~D~%" (-> this flitter-gem-tracker)) + (format #t "~2Twasps[3] @ #x~X~%" (-> this wasps)) + (format #t "~2Twasp-gem-tracker: ~D~%" (-> this wasp-gem-tracker)) + (format #t "~2Tlast-flitter-launched: ~D~%" (-> this last-flitter-launched)) + (format #t "~2Tlast-wasp-launched: ~D~%" (-> this last-wasp-launched)) + (format #t "~2Tlive-flitters: ~D~%" (-> this live-flitters)) + (format #t "~2Tlive-wasps: ~D~%" (-> this live-wasps)) + (format #t "~2Tshoot-timer: ~D~%" (-> this shoot-timer)) + (format #t "~2Ttarget-angle: ~f~%" (-> this target-angle)) + (format #t "~2Twave-timer: ~D~%" (-> this wave-timer)) + (format #t "~2Tin-wave: ~A~%" (-> this in-wave)) + (format #t "~2Tflitter-timer: ~D~%" (-> this flitter-timer)) + (format #t "~2Twasp-timer: ~D~%" (-> this wasp-timer)) + (format #t "~2Tlaunching-flitters: ~A~%" (-> this launching-flitters)) + (format #t "~2Tlaunching-wasps: ~A~%" (-> this launching-wasps)) + (format #t "~2Tegg-timer: ~D~%" (-> this egg-timer)) + (format #t "~2Tlast-close-attack: ~D~%" (-> this last-close-attack)) + (format #t "~2Tlast-standing-attack: ~D~%" (-> this last-standing-attack)) + (format #t "~2Tstage: ~D~%" (-> this stage)) + (format #t "~2Tnext-stage-timer: ~D~%" (-> this next-stage-timer)) + (format #t "~2Tinitial-y: ~f~%" (-> this initial-y)) + (format #t "~2Tshots-fired: ~D~%" (-> this shots-fired)) + (format #t "~2Tstage-hit-points: ~f~%" (-> this stage-hit-points)) + (format #t "~2Thud: ~D~%" (-> this hud)) + (format #t "~2Tlowtorso: ~D~%" (-> this lowtorso)) + (format #t "~2Tlegs: ~D~%" (-> this legs)) + (format #t "~2Twings: ~D~%" (-> this wings)) + (format #t "~2Tkid: ~D~%" (-> this kid)) + (format #t "~2Texplode: ~D~%" (-> this explode)) + (format #t "~2Trift-occlude: ~D~%" (-> this rift-occlude)) + (format #t "~2Tlast-attack-id: ~D~%" (-> this last-attack-id)) + (format #t "~2Tcurrent-nav-poly: #~%" (-> this current-nav-poly)) + (format #t "~2Tshot-anticipate: ~A~%" (-> this shot-anticipate)) + (format #t "~2Tspinners[4] @ #x~X~%" (-> this spinners)) + (format #t "~2Tneck: ~A~%" (-> this neck)) + (format #t "~2Tprevious-flat-travel: #~%" (-> this previous-flat-travel)) + (format #t "~2Tprevious-flat-travel-timer: ~D~%" (-> this previous-flat-travel-timer)) + (format #t "~2Tprevious-flat-travel-long-timer: ~D~%" (-> this previous-flat-travel-long-timer)) + (format #t "~2Tmin-state-hit-points: ~f~%" (-> this min-state-hit-points)) + (format #t "~2Tcountdown-to-roar: ~D~%" (-> this countdown-to-roar)) + (format #t "~2Tfor-back-interp: #~%" (-> this for-back-interp)) + (format #t "~2Trun-walk-interp: #~%" (-> this run-walk-interp)) + (format #t "~2Tleft-right-interp: #~%" (-> this left-right-interp)) + (format #t "~2Twalk-turn-interp: #~%" (-> this walk-turn-interp)) + (format #t "~2Tidle-interp: #~%" (-> this idle-interp)) + (format #t "~2Ttmp-hit-points: ~f~%" (-> this tmp-hit-points)) + (format #t "~2Treps-till-idle-alt: ~D~%" (-> this reps-till-idle-alt)) + (format #t "~2Tlast-rotation: ~f~%" (-> this last-rotation)) + (format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer)) + (format #t "~2Tegg-timer: ~D~%" (-> this egg-timer)) + (format #t "~2Tegg-angle: ~f~%" (-> this egg-angle)) + (format #t "~2Tarm-frame: ~f~%" (-> this arm-frame)) + (format #t "~2Tbeen-to-entity: ~A~%" (-> this been-to-entity)) + (format #t "~2Tflying-speed: #~%" (-> this flying-speed)) + (format #t "~2Twing-sound: ~D~%" (-> this wing-sound)) + (format #t "~2Twing-sound-playing: ~A~%" (-> this wing-sound-playing)) + (format #t "~2Texplode-sound: ~D~%" (-> this explode-sound)) + (format #t "~2Tbomb-sound: ~D~%" (-> this bomb-sound)) + (format #t "~2Tstop-bomb-sound: ~A~%" (-> this stop-bomb-sound)) + (format #t "~2Thit-ring-trans: #~%" (-> this hit-ring-trans)) + (format #t "~2Thit-ring-offset: #~%" (-> this hit-ring-offset)) + (format #t "~2Tring-cam-pos: #~%" (-> this ring-cam-pos)) + (format #t "~2Tneed-teleport: ~A~%" (-> this need-teleport)) (label cfg-4) - obj + this ) ;; definition for symbol *metalkor-bomb-probe-joints*, type (array int8) @@ -1152,14 +1152,14 @@ ;; definition for method 11 of type nestb-tail-bound ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nestb-tail-bound ((obj nestb-tail-bound) (arg0 entity-actor)) +(defmethod init-from-entity! nestb-tail-bound ((this nestb-tail-bound) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-others)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-others)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec special-obstacle)) (set! (-> v1-2 prim-core action) (collide-action solid)) @@ -1173,18 +1173,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (+! (-> obj root trans y) -36864.0) + (process-drawable-from-entity! this arg0) + (+! (-> this root trans y) -36864.0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nestb-tail-bound" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) - (go (method-of-object obj idle)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) + (go (method-of-object this idle)) (none) ) @@ -1390,7 +1390,7 @@ This commonly includes things such as: (cshape-reaction-update-state arg0 arg1 sv-16) (let ((s5-0 (-> arg0 process))) (cond - ((>= (- (current-time) (-> (the-as metalkor-egg s5-0) sticky-time)) (seconds 0.05)) + ((time-elapsed? (-> (the-as metalkor-egg s5-0) sticky-time) (seconds 0.05)) (let ((t9-1 vector--float*!) (a0-3 arg2) (a1-1 sv-16) @@ -1449,9 +1449,7 @@ This commonly includes things such as: 0 ) ((let ((f1-6 4096.0)) - (and (< (* f1-6 f1-6) f0-10) - (>= (- (current-time) (-> (the-as metalkor-egg s5-0) sticky-time)) (seconds 0.2)) - ) + (and (< (* f1-6 f1-6) f0-10) (time-elapsed? (-> (the-as metalkor-egg s5-0) sticky-time) (seconds 0.2))) ) (vector-float*! arg2 arg2 (/ 4096.0 (sqrtf f0-10))) ) @@ -1559,16 +1557,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type metalkor-ik-setup -(defmethod inspect metalkor-ik-setup ((obj metalkor-ik-setup)) - (when (not obj) - (set! obj obj) +(defmethod inspect metalkor-ik-setup ((this metalkor-ik-setup)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'metalkor-ik-setup) - (format #t "~1Telbow-index: ~D~%" (-> obj elbow-index)) - (format #t "~1Thand-dist: ~f~%" (-> obj hand-dist)) + (format #t "[~8x] ~A~%" this 'metalkor-ik-setup) + (format #t "~1Telbow-index: ~D~%" (-> this elbow-index)) + (format #t "~1Thand-dist: ~f~%" (-> this hand-dist)) (label cfg-4) - obj + this ) ;; definition for symbol *metalkor-ik-setup*, type (array metalkor-ik-setup) @@ -2030,7 +2028,7 @@ This commonly includes things such as: ;; definition for method 11 of type metalkor ;; INFO: Used lq/sq -(defmethod init-from-entity! metalkor ((obj metalkor) (arg0 entity-actor)) +(defmethod init-from-entity! metalkor ((this metalkor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2038,7 +2036,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -2087,48 +2085,48 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj root pause-adjust-distance) 409600.0) - (process-drawable-from-entity! obj arg0) + (set! (-> this root pause-adjust-distance) 409600.0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-metalkor" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (set! (-> obj draw light-index) (the-as uint 10)) - (set! (-> obj lowtorso) (the-as handle #f)) - (set! (-> obj trackable) #f) + (logior! (-> this mask) (process-mask enemy)) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this lowtorso) (the-as handle #f)) + (set! (-> this trackable) #f) (dotimes (v1-33 10) - (set! (-> obj flitters v1-33) (the-as handle #f)) + (set! (-> this flitters v1-33) (the-as handle #f)) ) (dotimes (v1-36 3) - (set! (-> obj wasps v1-36) (the-as handle #f)) + (set! (-> this wasps v1-36) (the-as handle #f)) ) - (set! (-> obj initial-y) (-> obj root trans y)) - (set! (-> obj hud) (the-as handle #f)) - (set! (-> obj legs) (the-as handle #f)) - (set! (-> obj kid) (the-as handle #f)) - (set! (-> obj wings) (the-as handle #f)) - (set! (-> obj explode) (the-as handle #f)) - (set! (-> obj rift-occlude) (the-as handle #f)) - (set! (-> obj last-attack-id) (the-as uint 0)) - (let ((a0-40 (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 1))) + (set! (-> this initial-y) (-> this root trans y)) + (set! (-> this hud) (the-as handle #f)) + (set! (-> this legs) (the-as handle #f)) + (set! (-> this kid) (the-as handle #f)) + (set! (-> this wings) (the-as handle #f)) + (set! (-> this explode) (the-as handle #f)) + (set! (-> this rift-occlude) (the-as handle #f)) + (set! (-> this last-attack-id) (the-as uint 0)) + (let ((a0-40 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 1))) (if a0-40 - (change-to a0-40 obj) + (change-to a0-40 this) ) ) - (set! (-> obj current-nav-poly) #f) - (set! (-> obj shot-anticipate) (create-launch-control (-> *part-group-id-table* 1232) obj)) - (set! (-> obj last-flitter-launched) 0) - (set! (-> obj last-wasp-launched) 0) - (set! (-> obj live-flitters) 0) - (set! (-> obj live-wasps) 0) - (set! (-> obj flitter-gem-tracker) (the-as handle #f)) - (set! (-> obj wasp-gem-tracker) (the-as handle #f)) + (set! (-> this current-nav-poly) #f) + (set! (-> this shot-anticipate) (create-launch-control (-> *part-group-id-table* 1232) this)) + (set! (-> this last-flitter-launched) 0) + (set! (-> this last-wasp-launched) 0) + (set! (-> this live-flitters) 0) + (set! (-> this live-wasps) 0) + (set! (-> this flitter-gem-tracker) (the-as handle #f)) + (set! (-> this wasp-gem-tracker) (the-as handle #f)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-47 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-47 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (when (and v1-47 (> (-> sv-16 elt-count) 0)) (let ((v1-48 (-> v1-47 0))) (when (>= (-> v1-48 length) 1) @@ -2140,8 +2138,8 @@ This commonly includes things such as: ) ) (if a0-52 - (set! (-> obj flitter-gem-tracker) (process->handle a0-52)) - (set! (-> obj flitter-gem-tracker) + (set! (-> this flitter-gem-tracker) (process->handle a0-52)) + (set! (-> this flitter-gem-tracker) (ppointer->handle (process-spawn flitter-gem-tracker :init gem-tracker-init-by-other s5-2 0 :to *entity-pool*) ) @@ -2153,8 +2151,8 @@ This commonly includes things such as: ) ) (if a0-63 - (set! (-> obj wasp-gem-tracker) (process->handle a0-63)) - (set! (-> obj wasp-gem-tracker) + (set! (-> this wasp-gem-tracker) (process->handle a0-63)) + (set! (-> this wasp-gem-tracker) (ppointer->handle (process-spawn wasp-gem-tracker :init gem-tracker-init-by-other s5-2 1 :to *entity-pool*)) ) ) @@ -2167,29 +2165,29 @@ This commonly includes things such as: (copy-nav-enemy-info! *metalkor-flitter-nav-enemy-info* *flitter-nav-enemy-info*) (set! (-> *metalkor-flitter-nav-enemy-info* notice-distance) 1638400.0) (dotimes (v1-71 4) - (set! (-> obj spinners v1-71) (the-as handle #f)) + (set! (-> this spinners v1-71) (the-as handle #f)) ) - (set! (-> obj neck) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 6)) - (set-vector! (-> obj neck twist-max) 8192.0 8192.0 0.0 1.0) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (set! (-> obj neck max-dist) 409600.0) - (set! (-> obj neck ignore-angle) 16384.0) - (mode-set! (-> obj neck) (joint-mod-mode look-at)) - (set! (-> obj previous-flat-travel-timer) 0) - (set! (-> obj previous-flat-travel-long-timer) 0) - (set! (-> obj countdown-to-roar) 3) - (let ((v1-88 (-> obj root root-prim))) - (set! (-> obj root backup-collide-as) (-> v1-88 prim-core collide-as)) - (set! (-> obj root backup-collide-with) (-> v1-88 prim-core collide-with)) + (set! (-> this neck) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 6)) + (set-vector! (-> this neck twist-max) 8192.0 8192.0 0.0 1.0) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this neck max-dist) 409600.0) + (set! (-> this neck ignore-angle) 16384.0) + (mode-set! (-> this neck) (joint-mod-mode look-at)) + (set! (-> this previous-flat-travel-timer) 0) + (set! (-> this previous-flat-travel-long-timer) 0) + (set! (-> this countdown-to-roar) 3) + (let ((v1-88 (-> this root root-prim))) + (set! (-> this root backup-collide-as) (-> v1-88 prim-core collide-as)) + (set! (-> this root backup-collide-with) (-> v1-88 prim-core collide-with)) ) - (set! (-> obj no-collision-timer) 0) - (set! (-> obj wing-sound) (new-sound-id)) - (set! (-> obj wing-sound-playing) #f) - (set! (-> obj explode-sound) (new-sound-id)) - (set! (-> obj bomb-sound) (new-sound-id)) - (set! (-> obj stage) -1) + (set! (-> this no-collision-timer) 0) + (set! (-> this wing-sound) (new-sound-id)) + (set! (-> this wing-sound-playing) #f) + (set! (-> this explode-sound) (new-sound-id)) + (set! (-> this bomb-sound) (new-sound-id)) + (set! (-> this stage) -1) (metalkor-go-next-stage) (none) ) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc index 8b6957371c..6bff66bade 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/metalkor-states_REF.gc @@ -252,7 +252,7 @@ (if (and (nonzero? (-> self next-stage-timer)) (>= (- (current-time) (-> self next-stage-timer)) 0)) (metalkor-go-next-stage) ) - (when (>= (- (current-time) (-> self no-collision-timer)) (seconds 0.1)) + (when (time-elapsed? (-> self no-collision-timer) (seconds 0.1)) (let ((v1-25 (-> self root root-prim))) (set! (-> v1-25 prim-core collide-as) (-> self root backup-collide-as)) (set! (-> v1-25 prim-core collide-with) (-> self root backup-collide-with)) @@ -306,36 +306,36 @@ ) ;; definition for method 10 of type metalkor -(defmethod deactivate metalkor ((obj metalkor)) - (if (-> obj wing-sound-playing) - (sound-stop (-> obj wing-sound)) +(defmethod deactivate metalkor ((this metalkor)) + (if (-> this wing-sound-playing) + (sound-stop (-> this wing-sound)) ) - ((method-of-type process-focusable deactivate) obj) + ((method-of-type process-focusable deactivate) this) (none) ) ;; definition for method 7 of type metalkor ;; WARN: Return type mismatch process-focusable vs metalkor. -(defmethod relocate metalkor ((obj metalkor) (arg0 int)) - (if (nonzero? (-> obj shot-anticipate)) - (&+! (-> obj shot-anticipate) arg0) +(defmethod relocate metalkor ((this metalkor) (arg0 int)) + (if (nonzero? (-> this shot-anticipate)) + (&+! (-> this shot-anticipate) arg0) ) - (if (nonzero? (-> obj neck)) - (&+! (-> obj neck) arg0) + (if (nonzero? (-> this neck)) + (&+! (-> this neck) arg0) ) - (the-as metalkor ((method-of-type process-focusable relocate) obj arg0)) + (the-as metalkor ((method-of-type process-focusable relocate) this arg0)) ) ;; definition for method 20 of type metalkor ;; INFO: Used lq/sq -(defmethod get-trans metalkor ((obj metalkor) (arg0 int)) +(defmethod get-trans metalkor ((this metalkor) (arg0 int)) "@returns the `trans` [[vector]] from the process's `root` (typically either a [[trsqv]] or a [[collide-shape]])" (local-vars (s5-0 vector)) (cond ((or (= arg0 2) (= arg0 3)) (set! s5-0 (new 'static 'vector)) (set! (-> s5-0 quad) - (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 0 prim-core world-sphere quad) + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0 prim-core world-sphere quad) ) (set! (-> s5-0 w) 61440.0) s5-0 @@ -343,31 +343,31 @@ ((= arg0 4) (set! s5-0 (new 'static 'vector)) (cond - ((zero? (-> obj skel active-channels)) + ((zero? (-> this skel active-channels)) ) - ((or (and (-> obj next-state) (= (-> obj next-state name) 'explode)) - (and (and (-> obj next-state) (= (-> obj next-state name) 'fly-to-ring)) (-> obj been-to-entity)) + ((or (and (-> this next-state) (= (-> this next-state name) 'explode)) + (and (and (-> this next-state) (= (-> this next-state name) 'fly-to-ring)) (-> this been-to-entity)) ) - (vector<-cspace! s5-0 (-> obj node-list data 3)) + (vector<-cspace! s5-0 (-> this node-list data 3)) ) (else - (set! (-> s5-0 quad) (-> obj root trans quad)) + (set! (-> s5-0 quad) (-> this root trans quad)) (+! (-> s5-0 y) 8192.0) ) ) - (when (< 0.0 (-> obj ring-cam-pos value)) - (let ((a0-15 (metalkor-get-ring obj)) + (when (< 0.0 (-> this ring-cam-pos value)) + (let ((a0-15 (metalkor-get-ring this)) (a2-0 (new 'stack-no-clear 'vector)) ) (set! (-> a2-0 quad) (-> a0-15 trans quad)) (+! (-> a2-0 y) -65536.0) - (vector-lerp! s5-0 s5-0 a2-0 (-> obj ring-cam-pos value)) + (vector-lerp! s5-0 s5-0 a2-0 (-> this ring-cam-pos value)) ) ) s5-0 ) (else - ((method-of-type process-focusable get-trans) obj arg0) + ((method-of-type process-focusable get-trans) this arg0) ) ) ) @@ -824,7 +824,7 @@ (-> arg3 param 0) (static-attack-info ((id (new-attack-id)) (vector s4-4) (shove-up (meters 6)))) ) - (set! (-> self no-collision-timer) (current-time)) + (set-time! (-> self no-collision-timer)) (let ((v1-175 (-> self root root-prim))) (set! (-> v1-175 prim-core collide-as) (collide-spec)) (set! (-> v1-175 prim-core collide-with) (collide-spec)) @@ -848,7 +848,7 @@ (when (not (handle->process (-> self flitters v1-3))) (new 'stack-no-clear 'vector) (let ((f0-1 (* 182.04445 (rand-vu-float-range 70.0 290.0)))) - (set! (-> self egg-timer) (current-time)) + (set-time! (-> self egg-timer)) (set! (-> self egg-angle) f0-1) (if (< 32768.0 f0-1) (send-event (handle->process (-> self lowtorso)) 'egg-toss 1.0) @@ -868,7 +868,7 @@ (if (zero? (-> self egg-timer)) (return #f) ) - (if (< (- (current-time) (-> self egg-timer)) (seconds 0.2)) + (if (not (time-elapsed? (-> self egg-timer) (seconds 0.2))) (return #t) ) (dotimes (gp-0 10) @@ -1804,7 +1804,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (ja-channel-push! 1 (seconds 0.1)) (ja :group! (-> self draw art-group data 30) :num! min) ) @@ -1858,7 +1858,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self min-state-hit-points) (+ -0.34 (-> self stage-hit-points))) (if (nonzero? (-> self neck)) (set! (-> self neck flex-blend) 0.0) @@ -1883,7 +1883,7 @@ ) ) :trans (behavior () - (if (or (>= (- (current-time) (-> self state-time)) (seconds 1)) + (if (or (time-elapsed? (-> self state-time) (seconds 1)) (>= (-> self min-state-hit-points) (-> self stage-hit-points)) ) (go-virtual overload-recover) @@ -1950,12 +1950,12 @@ (defstate play-drop-movie (metalkor) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (process-entity-status! self (entity-perm-status subtask-complete) #t) (process-spawn scene-player :init scene-player-init "nest-kor-boss-fight-mid" #t "nestb-boss") ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (deactivate self) ) ) @@ -2070,9 +2070,9 @@ (vector-! s3-0 s3-0 (-> s2-0 boundary-normal)) (when (or s1-0 (> s0-1 0) (< (+ (current-time) (seconds -0.1)) (-> self previous-flat-travel-timer))) (set! (-> self previous-flat-travel quad) (-> s4-0 quad)) - (set! (-> self previous-flat-travel-timer) (current-time)) + (set-time! (-> self previous-flat-travel-timer)) (if (zero? (-> self previous-flat-travel-long-timer)) - (set! (-> self previous-flat-travel-long-timer) (current-time)) + (set-time! (-> self previous-flat-travel-long-timer)) ) ) ) @@ -2254,11 +2254,11 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (cond - ((>= (- (current-time) (-> self state-time)) (seconds 4)) + ((time-elapsed? (-> self state-time) (seconds 4)) (go-virtual chase-target) ) ((let ((f0-0 57344.0)) @@ -2297,7 +2297,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self shots-fired) 0) (set! (-> self current-nav-poly) (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) @@ -2325,10 +2325,10 @@ (sound-play "nboss-pre-shot") ) ) - (when (or (>= (- (current-time) (-> self state-time)) (seconds 1.25)) - (and (>= (- (current-time) (-> self state-time)) (seconds 0.75)) (nonzero? (-> self shots-fired))) + (when (or (time-elapsed? (-> self state-time) (seconds 1.25)) + (and (time-elapsed? (-> self state-time) (seconds 0.75)) (nonzero? (-> self shots-fired))) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (metalkor-shoot-projectile) (set-nestb-purple! (fmax 1.0 (get-nestb-purple))) (metalkor-ja-float-stop (the-as art-joint-anim (-> self draw art-group data 32))) @@ -2357,7 +2357,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self current-nav-poly) (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) ) @@ -2365,7 +2365,7 @@ :trans (behavior () (let ((v1-2 (ja-group))) (when (and (not (and v1-2 (= v1-2 (-> self draw art-group data 33)))) - (>= (- (current-time) (-> self state-time)) (seconds 3)) + (time-elapsed? (-> self state-time) (seconds 3)) ) (cond ((or (< (-> self last-standing-attack) -1) @@ -2465,7 +2465,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self shoot-timer) (current-time)) + (set-time! (-> self shoot-timer)) (set! (-> self shots-fired) 0) (set! (-> self wave-timer) 0) (set! (-> self in-wave) #f) @@ -2486,9 +2486,9 @@ (if (and (-> self in-wave) (= (-> self stage) 1)) (set! v1-0 3000) ) - (when (>= (- (current-time) (-> self wave-timer)) v1-0) + (when (time-elapsed? (-> self wave-timer) v1-0) (set! (-> self in-wave) (not (-> self in-wave))) - (set! (-> self wave-timer) (current-time)) + (set-time! (-> self wave-timer)) ) ) (cond @@ -2499,8 +2499,8 @@ (set! (-> self launching-wasps) #t) ) ) - (when (and (-> self launching-wasps) (>= (- (current-time) (-> self wasp-timer)) (seconds 1.5))) - (set! (-> self wasp-timer) (current-time)) + (when (and (-> self launching-wasps) (time-elapsed? (-> self wasp-timer) (seconds 1.5))) + (set-time! (-> self wasp-timer)) (dotimes (gp-0 3) (when (not (handle->process (-> self wasps gp-0))) (set! sv-16 (new 'static 'res-tag)) @@ -2570,7 +2570,7 @@ ) (rotate-and-update-hang-anim) (if (and (< 10922.667 (-> self target-angle)) - (< (- (current-time) (-> self shoot-timer)) (seconds 3.75)) + (not (time-elapsed? (-> self shoot-timer) (seconds 3.75))) (zero? (mod (-> self shots-fired) (-> self stage))) ) (set! (-> self shoot-timer) @@ -2579,12 +2579,12 @@ ) (cond ((metalkor-check-egg) - (set! (-> self shoot-timer) (current-time)) + (set-time! (-> self shoot-timer)) ) - ((or (>= (- (current-time) (-> self shoot-timer)) (seconds 3.75)) + ((or (time-elapsed? (-> self shoot-timer) (seconds 3.75)) (nonzero? (mod (-> self shots-fired) (-> self stage))) ) - (set! (-> self flitter-timer) (current-time)) + (set-time! (-> self flitter-timer)) (spawn (-> self shot-anticipate) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 7))) (if (zero? (mod (-> self shots-fired) (-> self stage))) (set-nestb-purple! @@ -2608,12 +2608,12 @@ (sound-play "nboss-pre-shot") ) ) - (when (or (>= (- (current-time) (-> self shoot-timer)) (seconds 5)) - (and (>= (- (current-time) (-> self shoot-timer)) (seconds 0.75)) + (when (or (time-elapsed? (-> self shoot-timer) (seconds 5)) + (and (time-elapsed? (-> self shoot-timer) (seconds 0.75)) (nonzero? (mod (-> self shots-fired) (-> self stage))) ) ) - (set! (-> self shoot-timer) (current-time)) + (set-time! (-> self shoot-timer)) (metalkor-shoot-projectile) (set-nestb-purple! (fmax 1.0 (get-nestb-purple))) (metalkor-ja-float-stop (the-as art-joint-anim (-> self draw art-group data 23))) @@ -2623,8 +2623,8 @@ ) ) ((and (-> self launching-flitters) (>= (+ (current-time) (seconds -0.5)) (-> self flitter-timer))) - (set! (-> self flitter-timer) (current-time)) - (set! (-> self shoot-timer) (current-time)) + (set-time! (-> self flitter-timer)) + (set-time! (-> self shoot-timer)) (metalkor-start-egg) ) ) @@ -2664,7 +2664,7 @@ :virtual #t :event metalkor-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self current-nav-poly) (cloest-point-on-mesh (-> self nav) (-> self root trans) (-> self root trans) (-> self current-nav-poly)) ) @@ -2678,7 +2678,7 @@ (vf2 :class vf) ) (init-vf0-vector) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.017)) (cpad-hold? 1 x)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.017)) (cpad-hold? 1 x)) (go-virtual test) ) (let ((s4-0 (new-stack-vector0)) @@ -2737,9 +2737,9 @@ (vector-! s4-1 s4-1 (-> s3-0 boundary-normal)) (when (or (> s2-1 0) (< (+ (current-time) (seconds -0.1)) (-> self previous-flat-travel-timer))) (set! (-> self previous-flat-travel quad) (-> s5-1 quad)) - (set! (-> self previous-flat-travel-timer) (current-time)) + (set-time! (-> self previous-flat-travel-timer)) (if (zero? (-> self previous-flat-travel-long-timer)) - (set! (-> self previous-flat-travel-long-timer) (current-time)) + (set-time! (-> self previous-flat-travel-long-timer)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/nest/boss/nestb-part_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/nestb-part_REF.gc index cabde698b3..8f13facf28 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/nestb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/nestb-part_REF.gc @@ -11,21 +11,17 @@ ) ;; definition for method 3 of type nestb-part -(defmethod inspect nestb-part ((obj nestb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect nestb-part ((this nestb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc index cba47aee2d..1d3c256356 100644 --- a/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/boss/nestb-scenes_REF.gc @@ -16,13 +16,13 @@ (set! (-> a1-0 param 0) (the-as uint 7)) (let ((f30-0 (send-event-function *target* a1-0))) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.1)) + (until (time-elapsed? gp-0 (seconds 0.1)) (suspend) ) ) (send-event *target* 'change-mode 'darkjak #f (darkjak-stage no-anim)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.1)) + (until (time-elapsed? gp-1 (seconds 0.1)) (suspend) ) ) @@ -1647,16 +1647,16 @@ ) ;; definition for method 3 of type nest-gun-parts -(defmethod inspect nest-gun-parts ((obj nest-gun-parts)) - (when (not obj) - (set! obj obj) +(defmethod inspect nest-gun-parts ((this nest-gun-parts)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1684,22 +1684,22 @@ ;; definition for method 11 of type nest-gun-parts ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-gun-parts ((obj nest-gun-parts) (arg0 entity-actor)) +(defmethod init-from-entity! nest-gun-parts ((this nest-gun-parts) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-gun-parts" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 11)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 11)) + (go (method-of-object this idle)) (none) ) @@ -1716,16 +1716,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type nest-unbroken-rocks -(defmethod inspect nest-unbroken-rocks ((obj nest-unbroken-rocks)) - (when (not obj) - (set! obj obj) +(defmethod inspect nest-unbroken-rocks ((this nest-unbroken-rocks)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1753,27 +1753,27 @@ This commonly includes things such as: ;; definition for method 11 of type nest-unbroken-rocks ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-unbroken-rocks ((obj nest-unbroken-rocks) (arg0 entity-actor)) +(defmethod init-from-entity! nest-unbroken-rocks ((this nest-unbroken-rocks) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-unbroken-rocks" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 1)) + (set! (-> this draw light-index) (the-as uint 1)) (if (task-node-closed? (game-task-node nest-get-to-gun-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj idle)) + (cleanup-for-death this) + (go (method-of-object this idle)) ) (none) ) 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 7d74ea9cbb..a0b99261f3 100644 --- a/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/flying-spider_REF.gc @@ -11,25 +11,25 @@ ) ;; definition for method 3 of type flying-spider-shot -(defmethod inspect flying-spider-shot ((obj flying-spider-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect flying-spider-shot ((this flying-spider-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type metalhead-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 28 of type flying-spider-shot ;; WARN: Return type mismatch sound-id vs none. -(defmethod play-impact-sound flying-spider-shot ((obj flying-spider-shot) (arg0 projectile-options)) +(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)) - obj + this arg0 ) ) @@ -84,22 +84,22 @@ ) ;; definition for method 3 of type flying-spider -(defmethod inspect flying-spider ((obj flying-spider)) - (when (not obj) - (set! obj obj) +(defmethod inspect flying-spider ((this flying-spider)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tmy-up-vector: #~%" (-> obj my-up-vector)) - (format #t "~2Tgspot-normal: #~%" (-> obj gspot-normal)) - (format #t "~2Tgspot-timer: ~D~%" (-> obj gspot-timer)) - (format #t "~2Tfocus-dir: ~D~%" (-> obj focus-dir)) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) + (format #t "~2Tmy-up-vector: #~%" (-> this my-up-vector)) + (format #t "~2Tgspot-normal: #~%" (-> this gspot-normal)) + (format #t "~2Tgspot-timer: ~D~%" (-> this gspot-timer)) + (format #t "~2Tfocus-dir: ~D~%" (-> this focus-dir)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-du: ~f~%" (-> this path-du)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -546,7 +546,7 @@ :event enemy-event-handler :enter (behavior () (dispose! self) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self hit-points) 0) (enemy-method-103 self) ) @@ -577,102 +577,102 @@ ) ;; definition for method 74 of type flying-spider -(defmethod general-event-handler flying-spider ((obj flying-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler flying-spider ((this flying-spider) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (let ((s5-1 (-> obj incoming knocked-type))) + ((zero? (-> this hit-points)) + (let ((s5-1 (-> this incoming knocked-type))) (cond ((and (= s5-1 (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-32 (-> obj next-state name))) - (or (= v1-32 'knocked) (= v1-32 'jump) (= v1-32 'jump-land)) - ) + (not (and (-> this next-state) (let ((v1-32 (-> this next-state name))) + (or (= v1-32 'knocked) (= v1-32 'jump) (= v1-32 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ((or (= s5-1 (knocked-type knocked-type-4)) (= s5-1 (knocked-type knocked-type-6))) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - (go (method-of-object obj knocked)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) + (go (method-of-object this knocked)) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t ) (('death-start) - (let ((v1-52 (-> obj root root-prim))) + (let ((v1-52 (-> this root root-prim))) (set! (-> v1-52 prim-core collide-as) (collide-spec)) (set! (-> v1-52 prim-core collide-with) (collide-spec)) ) 0 - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 55 of type flying-spider -(defmethod track-target! flying-spider ((obj flying-spider)) +(defmethod track-target! flying-spider ((this flying-spider)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - ((method-of-type nav-enemy track-target!) obj) + ((method-of-type nav-enemy track-target!) this) (none) ) ;; definition for method 125 of type flying-spider ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 flying-spider ((obj flying-spider) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 flying-spider ((this flying-spider) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface - (when (find-ground (-> obj root) arg0 arg1 arg2 arg3 arg4) - (set! (-> obj root ground-pat) (-> arg0 best-other-tri pat)) - (when (>= (- (current-time) (-> obj gspot-timer)) (seconds 0.2)) + (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) + (set! (-> this root ground-pat) (-> arg0 best-other-tri pat)) + (when (time-elapsed? (-> this gspot-timer) (seconds 0.2)) (let ((a1-2 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-2 start-pos quad) (-> obj root gspot-pos quad)) + (set! (-> a1-2 start-pos quad) (-> this root gspot-pos quad)) (+! (-> a1-2 start-pos y) 2048.0) (set-vector! (-> a1-2 move-dist) 0.0 -6144.0 0.0 0.0) (let ((v1-10 a1-2)) (set! (-> v1-10 radius) 4915.2) (set! (-> v1-10 collide-with) arg1) - (set! (-> v1-10 ignore-process0) obj) + (set! (-> v1-10 ignore-process0) this) (set! (-> v1-10 ignore-process1) #f) - (set! (-> v1-10 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-10 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-10 action-mask) (collide-action solid)) ) (fill-using-line-sphere *collide-cache* a1-2) @@ -693,9 +693,9 @@ ) ) ) - (vector-normalize-copy! (-> obj gspot-normal) s5-1 1.0) + (vector-normalize-copy! (-> this gspot-normal) s5-1 1.0) ) - (set! (-> obj gspot-timer) (current-time)) + (set-time! (-> this gspot-timer)) ) #t ) @@ -705,28 +705,28 @@ ;; definition for method 182 of type flying-spider ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod flying-spider-method-182 flying-spider ((obj flying-spider) (arg0 vector)) +(defmethod flying-spider-method-182 flying-spider ((this flying-spider) (arg0 vector)) (cond - ((= (-> obj root gspot-pos y) -40959590.0) + ((= (-> this root gspot-pos y) -40959590.0) (set! (-> arg0 y) 0.0) (vector-normalize! arg0 1.0) - (quaternion-set! (-> obj root quat) 0.0 (-> arg0 x) 0.0 (+ 1.0 (-> arg0 z))) - (quaternion-normalize! (-> obj root quat)) + (quaternion-set! (-> this root quat) 0.0 (-> arg0 x) 0.0 (+ 1.0 (-> arg0 z))) + (quaternion-normalize! (-> this root quat)) ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> *up-vector* quad)) (let ((s3-0 (new 'stack-no-clear 'quaternion))) - (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> obj gspot-normal) 4551.1113) + (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this gspot-normal) 4551.1113) (vector-orient-by-quat! s4-0 s4-0 s3-0) ) - (let ((s3-1 (-> obj my-up-vector))) + (let ((s3-1 (-> this my-up-vector))) (new 'stack-no-clear 'vector) (vector-deg-seek s3-1 s3-1 s4-0 (* 910.2222 (seconds-per-frame))) (vector-normalize! s3-1 1.0) (set! (-> arg0 y) 0.0) (vector-normalize! arg0 1.0) - (forward-up->quaternion (-> obj root quat) arg0 s3-1) + (forward-up->quaternion (-> this root quat) arg0 s3-1) ) ) ) @@ -738,13 +738,13 @@ ;; definition for method 142 of type flying-spider ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 flying-spider ((obj flying-spider) (arg0 nav-control)) - (let ((t9-0 (method-of-object obj flying-spider-method-182)) +(defmethod nav-enemy-method-142 flying-spider ((this flying-spider) (arg0 nav-control)) + (let ((t9-0 (method-of-object this flying-spider-method-182)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 quad) (-> a2-0 heading quad)) - (t9-0 obj a1-1) + (t9-0 this a1-1) ) 0 (none) @@ -752,7 +752,7 @@ ;; definition for method 109 of type flying-spider ;; WARN: Return type mismatch int vs none. -(defmethod look-at-target! flying-spider ((obj flying-spider) (arg0 enemy-flag)) +(defmethod look-at-target! flying-spider ((this flying-spider) (arg0 enemy-flag)) "Logic for looking at the target that is locked on, sets some flags and adjusts the neck to look at the target if available @param flag Reacts to [[enemy-flag::death-start]] and [[enemy-flag::enable-on-active]], see implementation for details" 0 @@ -761,28 +761,28 @@ ;; definition for method 59 of type flying-spider ;; WARN: Return type mismatch int vs penetrate. -(defmethod get-penetrate-info flying-spider ((obj flying-spider)) +(defmethod get-penetrate-info flying-spider ((this flying-spider)) "@returns the allowed way(s) this enemy can take damage @see [[penetrate]] and [[penetrated-by-all&hit-points->penetrated-by]]" (the-as penetrate 0) ) ;; definition for method 51 of type flying-spider -(defmethod enemy-method-51 flying-spider ((obj flying-spider)) - (quaternion-y-angle (-> obj root quat)) +(defmethod enemy-method-51 flying-spider ((this flying-spider)) + (quaternion-y-angle (-> this root quat)) ) ;; definition for method 60 of type flying-spider -(defmethod coin-flip? flying-spider ((obj flying-spider)) +(defmethod coin-flip? flying-spider ((this flying-spider)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 114 of type flying-spider ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! flying-spider ((obj flying-spider)) +(defmethod init-enemy-collision! flying-spider ((this flying-spider)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -838,7 +838,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) @@ -846,39 +846,46 @@ ;; definition for method 115 of type flying-spider ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! flying-spider ((obj flying-spider)) +(defmethod init-enemy! flying-spider ((this flying-spider)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flying-spider" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *flying-spider-nav-enemy-info*) - (let ((v1-5 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *flying-spider-nav-enemy-info*) + (let ((v1-5 (-> this neck))) (set! (-> v1-5 up) (the-as uint 1)) (set! (-> v1-5 nose) (the-as uint 2)) (set! (-> v1-5 ear) (the-as uint 0)) (set-vector! (-> v1-5 twist-max) 11832.889 11832.889 0.0 1.0) (set! (-> v1-5 ignore-angle) 30947.555) ) - (set! (-> obj root dynam gravity y) 327680.0) - (set! (-> obj root dynam gravity-length) 327680.0) - (set! (-> obj root dynam gravity-max) 327680.0) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (set! (-> obj path-u) 0.0) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (add-connection *part-engine* obj 27 obj 318 (new 'static 'vector :x 1392.64 :y 204.8 :z 2621.44 :w 163840.0)) + (set! (-> this root dynam gravity y) 327680.0) + (set! (-> this root dynam gravity-length) 327680.0) + (set! (-> this root dynam gravity-max) 327680.0) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (set! (-> this path-u) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (add-connection *part-engine* - obj + this 27 - obj + this + 318 + (new 'static 'vector :x 1392.64 :y 204.8 :z 2621.44 :w 163840.0) + ) + (add-connection + *part-engine* + this + 27 + this 318 (new 'static 'vector :x -1392.64 :y 204.8 :z 2621.44 :w 163840.0) ) - (set! (-> obj my-up-vector quad) (-> *y-vector* quad)) - (set! (-> obj gspot-normal quad) (-> *y-vector* quad)) - (set! (-> obj gspot-timer) 0) + (set! (-> this my-up-vector quad) (-> *y-vector* quad)) + (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + (set! (-> this gspot-timer) 0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc b/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc index b7730905ac..144f97d924 100644 --- a/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mammoth_REF.gc @@ -50,45 +50,45 @@ ) ;; definition for method 3 of type mammoth -(defmethod inspect mammoth ((obj mammoth)) - (when (not obj) - (set! obj obj) +(defmethod inspect mammoth ((this mammoth)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tjoint-ik[4] @ #x~X~%" (-> obj joint-ik)) - (format #t "~2Tik-handle-pos[4] @ #x~X~%" (-> obj ik-handle-pos)) - (format #t "~2Tik-handle-y[4] @ #x~X~%" (-> obj ik-handle-y)) - (format #t "~2Theel-lerp[4] @ #x~X~%" (-> obj heel-lerp)) - (format #t "~2Tfoot-flags: ~D~%" (-> obj foot-flags)) - (format #t "~2Told-foot-flags: ~D~%" (-> obj old-foot-flags)) - (format #t "~2Ty-level: ~f~%" (-> obj y-level)) - (format #t "~2Tfoot-pos[4] @ #x~X~%" (-> obj foot-pos)) - (format #t "~2Tmy-up-vector: #~%" (-> obj my-up-vector)) - (format #t "~2Tmy-up-quat: #~%" (-> obj my-up-quat)) - (format #t "~2Tmove-pos[2] @ #x~X~%" (-> obj move-pos)) - (format #t "~2Ttravel-dest: #~%" (-> obj travel-dest)) - (format #t "~2Ttilt-quat: #~%" (-> obj tilt-quat)) - (format #t "~2Tpath-index: ~D~%" (-> obj path-index)) - (format #t "~2Tpath-index-dir: ~D~%" (-> obj path-index-dir)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tturn-angle: ~f~%" (-> obj turn-angle)) - (format #t "~2Tgspot-timer: ~D~%" (-> obj gspot-timer)) - (format #t "~2Tgspot-normal: #~%" (-> obj gspot-normal)) - (format #t "~2Tattack-timer: ~D~%" (-> obj attack-timer)) - (format #t "~2Tlightning-timer: ~D~%" (-> obj lightning-timer)) - (format #t "~2Tlightning-attack-timer: ~D~%" (-> obj lightning-attack-timer)) - (format #t "~2Tspawn-timer: ~D~%" (-> obj spawn-timer)) - (format #t "~2Tturn-anim-start: ~D~%" (-> obj turn-anim-start)) - (format #t "~2Tturn-anim: ~D~%" (-> obj turn-anim)) - (format #t "~2Tturn-anim-end: ~D~%" (-> obj turn-anim-end)) - (format #t "~2Tturn-move-start: ~f~%" (-> obj turn-move-start)) - (format #t "~2Tturn-move-end: ~f~%" (-> obj turn-move-end)) - (format #t "~2Tfeet-ik-init-timer: ~D~%" (-> obj feet-ik-init-timer)) + (format #t "~2Tjoint-ik[4] @ #x~X~%" (-> this joint-ik)) + (format #t "~2Tik-handle-pos[4] @ #x~X~%" (-> this ik-handle-pos)) + (format #t "~2Tik-handle-y[4] @ #x~X~%" (-> this ik-handle-y)) + (format #t "~2Theel-lerp[4] @ #x~X~%" (-> this heel-lerp)) + (format #t "~2Tfoot-flags: ~D~%" (-> this foot-flags)) + (format #t "~2Told-foot-flags: ~D~%" (-> this old-foot-flags)) + (format #t "~2Ty-level: ~f~%" (-> this y-level)) + (format #t "~2Tfoot-pos[4] @ #x~X~%" (-> this foot-pos)) + (format #t "~2Tmy-up-vector: #~%" (-> this my-up-vector)) + (format #t "~2Tmy-up-quat: #~%" (-> this my-up-quat)) + (format #t "~2Tmove-pos[2] @ #x~X~%" (-> this move-pos)) + (format #t "~2Ttravel-dest: #~%" (-> this travel-dest)) + (format #t "~2Ttilt-quat: #~%" (-> this tilt-quat)) + (format #t "~2Tpath-index: ~D~%" (-> this path-index)) + (format #t "~2Tpath-index-dir: ~D~%" (-> this path-index-dir)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tturn-angle: ~f~%" (-> this turn-angle)) + (format #t "~2Tgspot-timer: ~D~%" (-> this gspot-timer)) + (format #t "~2Tgspot-normal: #~%" (-> this gspot-normal)) + (format #t "~2Tattack-timer: ~D~%" (-> this attack-timer)) + (format #t "~2Tlightning-timer: ~D~%" (-> this lightning-timer)) + (format #t "~2Tlightning-attack-timer: ~D~%" (-> this lightning-attack-timer)) + (format #t "~2Tspawn-timer: ~D~%" (-> this spawn-timer)) + (format #t "~2Tturn-anim-start: ~D~%" (-> this turn-anim-start)) + (format #t "~2Tturn-anim: ~D~%" (-> this turn-anim)) + (format #t "~2Tturn-anim-end: ~D~%" (-> this turn-anim-end)) + (format #t "~2Tturn-move-start: ~f~%" (-> this turn-move-start)) + (format #t "~2Tturn-move-end: ~f~%" (-> this turn-move-end)) + (format #t "~2Tfeet-ik-init-timer: ~D~%" (-> this feet-ik-init-timer)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -224,18 +224,18 @@ ) ;; definition for method 3 of type mammoth-ik-setup -(defmethod inspect mammoth-ik-setup ((obj mammoth-ik-setup)) - (when (not obj) - (set! obj obj) +(defmethod inspect mammoth-ik-setup ((this mammoth-ik-setup)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mammoth-ik-setup) - (format #t "~1Telbow-index: ~D~%" (-> obj elbow-index)) - (format #t "~1Thand-dist: ~f~%" (-> obj hand-dist)) - (format #t "~1Tground-dist: ~f~%" (-> obj ground-dist)) - (format #t "~1Tfoot-flag: ~D~%" (-> obj foot-flag)) + (format #t "[~8x] ~A~%" this 'mammoth-ik-setup) + (format #t "~1Telbow-index: ~D~%" (-> this elbow-index)) + (format #t "~1Thand-dist: ~f~%" (-> this hand-dist)) + (format #t "~1Tground-dist: ~f~%" (-> this ground-dist)) + (format #t "~1Tfoot-flag: ~D~%" (-> this foot-flag)) (label cfg-4) - obj + this ) ;; definition for symbol *mammoth-ik-setup*, type (inline-array mammoth-ik-setup) @@ -536,8 +536,8 @@ (ja :num! (seek!)) ) (mammoth-walk-check-end) - (when (>= (- (current-time) (-> self attack-timer)) (seconds 5)) - (set! (-> self attack-timer) (current-time)) + (when (time-elapsed? (-> self attack-timer) (seconds 5)) + (set-time! (-> self attack-timer)) (go-virtual walking-attack) ) ) @@ -579,7 +579,7 @@ (logior! (-> self foot-flags) 6) ) :trans (behavior () - (when (and (< (- (current-time) (-> self lightning-timer)) (seconds 3)) (< (-> self spawn-timer) (current-time))) + (when (and (not (time-elapsed? (-> self lightning-timer) (seconds 3))) (< (-> self spawn-timer) (current-time))) (let ((s5-0 *mammoth-lightning-joint-tbl*)) (mammoth-method-185 self (-> self root trans) (-> s5-0 (get-rand-int self (-> s5-0 length)))) ) @@ -603,8 +603,8 @@ (ja :num! (seek! max 0.8)) ) (mammoth-walk-check-end) - (when (>= (- (current-time) (-> self attack-timer)) (seconds 3)) - (set! (-> self attack-timer) (current-time)) + (when (time-elapsed? (-> self attack-timer) (seconds 3)) + (set-time! (-> self attack-timer)) (go-virtual walking) ) ) @@ -758,27 +758,27 @@ ) ;; definition for method 74 of type mammoth -(defmethod general-event-handler mammoth ((obj mammoth) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler mammoth ((this mammoth) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -786,7 +786,7 @@ ;; definition for method 185 of type mammoth ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod mammoth-method-185 mammoth ((obj mammoth) (arg0 vector) (arg1 int)) +(defmethod mammoth-method-185 mammoth ((this mammoth) (arg0 vector) (arg1 int)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -795,10 +795,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s1-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg1))) + (let ((s1-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1))) (s2-0 (new 'stack-no-clear 'vector)) ) - (let ((s4-1 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) 16384.0))) + (let ((s4-1 (vector-normalize! (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) 16384.0))) (vector-! s2-0 s1-0 arg0) (set! (-> s2-0 y) 0.0) (vector-xz-normalize! s2-0 49152.0) @@ -808,7 +808,7 @@ (let ((s3-1 (new 'stack-no-clear 'collide-query)) (s4-2 (new 'stack-no-clear 'matrix)) ) - (matrix->trans (-> obj node-list data arg1 bone transform) (-> s3-1 start-pos)) + (matrix->trans (-> this node-list data arg1 bone transform) (-> s3-1 start-pos)) (set! (-> s3-1 move-dist quad) (-> s2-0 quad)) (let ((v1-11 s3-1)) (set! (-> v1-11 radius) 4.096) @@ -842,7 +842,7 @@ (-> *lightning-spec-id-table* 1) 600 #f - obj + this arg1 s4-2 :to *entity-pool* @@ -857,41 +857,41 @@ ) ;; definition for method 67 of type mammoth -(defmethod go-stare mammoth ((obj mammoth)) - (go (method-of-object obj walking)) +(defmethod go-stare mammoth ((this mammoth)) + (go (method-of-object this walking)) ) ;; definition for method 70 of type mammoth -(defmethod go-hostile mammoth ((obj mammoth)) - (go (method-of-object obj walking)) +(defmethod go-hostile mammoth ((this mammoth)) + (go (method-of-object this walking)) ) ;; definition for method 116 of type mammoth ;; WARN: Return type mismatch object vs none. -(defmethod go-idle mammoth ((obj mammoth)) - (go (method-of-object obj waiting)) +(defmethod go-idle mammoth ((this mammoth)) + (go (method-of-object this waiting)) (none) ) ;; definition for method 125 of type mammoth ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 mammoth ((obj mammoth) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 mammoth ((this mammoth) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface - (when (find-ground (-> obj root) arg0 arg1 arg2 arg3 arg4) - (set! (-> obj root ground-pat) (-> arg0 best-other-tri pat)) + (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) + (set! (-> this root ground-pat) (-> arg0 best-other-tri pat)) (let ((s3-0 (new 'stack-no-clear 'collide-query))) - (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root gspot-pos) (-> obj root trans)))) + (let ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this root gspot-pos) (-> this root trans)))) (vector-normalize! s2-1 1.0) - (vector+float*! (-> s3-0 start-pos) (-> obj root gspot-pos) s2-1 -4096.0) + (vector+float*! (-> s3-0 start-pos) (-> this root gspot-pos) s2-1 -4096.0) (vector-float*! (-> s3-0 move-dist) s2-1 8192.0) ) (let ((v1-9 s3-0)) (set! (-> v1-9 radius) 8192.0) (set! (-> v1-9 collide-with) arg1) - (set! (-> v1-9 ignore-process0) obj) + (set! (-> v1-9 ignore-process0) this) (set! (-> v1-9 ignore-process1) #f) - (set! (-> v1-9 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-9 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-9 action-mask) (collide-action solid)) ) (fill-using-line-sphere *collide-cache* s3-0) @@ -912,16 +912,16 @@ ) ) ) - (vector-normalize-copy! (-> obj gspot-normal) s4-1 1.0) + (vector-normalize-copy! (-> this gspot-normal) s4-1 1.0) ) - (let ((f0-4 (-> obj root gspot-pos y))) - (if (= (-> obj y-level) -40959590.0) - (set! (-> obj y-level) f0-4) - (seek! (-> obj y-level) f0-4 (* 8192.0 (seconds-per-frame))) + (let ((f0-4 (-> this root gspot-pos y))) + (if (= (-> this y-level) -40959590.0) + (set! (-> this y-level) f0-4) + (seek! (-> this y-level) f0-4 (* 8192.0 (seconds-per-frame))) ) ) - (set! (-> obj root gspot-pos y) (-> obj y-level)) - (set! (-> arg0 best-other-tri intersect y) (-> obj y-level)) + (set! (-> this root gspot-pos y) (-> this y-level)) + (set! (-> arg0 best-other-tri intersect y) (-> this y-level)) #t ) ) @@ -930,22 +930,22 @@ ;; definition for method 183 of type mammoth ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod mammoth-method-183 mammoth ((obj mammoth)) +(defmethod mammoth-method-183 mammoth ((this mammoth)) (cond - ((= (-> obj root gspot-pos y) -40959590.0) - (quaternion-copy! (-> obj tilt-quat) *unity-quaternion*) + ((= (-> this root gspot-pos y) -40959590.0) + (quaternion-copy! (-> this tilt-quat) *unity-quaternion*) ) (else - (let ((s1-0 (-> obj root trans)) + (let ((s1-0 (-> this root trans)) (s5-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 quad) (-> obj gspot-normal quad)) + (set! (-> s5-0 quad) (-> this gspot-normal quad)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj gspot-normal quad)) + (set! (-> s4-0 quad) (-> this gspot-normal quad)) (let ((s3-0 (new 'stack-no-clear 'vector))) - (set! (-> s3-0 quad) (-> obj gspot-normal quad)) + (set! (-> s3-0 quad) (-> this gspot-normal quad)) (let ((s2-0 (new 'stack-no-clear 'vector))) - (set! (-> s2-0 quad) (-> obj gspot-normal quad)) + (set! (-> s2-0 quad) (-> this gspot-normal quad)) (let ((s0-0 (lambda ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1)) (s4-1 (vector-! (new 'stack-no-clear 'vector) arg3 arg1)) @@ -957,17 +957,17 @@ ) ) ) - (if (and (logtest? (-> obj foot-flags) 1) (logtest? (-> obj foot-flags) 2)) - (s0-0 s5-0 s1-0 (the-as vector (-> obj foot-pos)) (-> obj foot-pos 1)) + (if (and (logtest? (-> this foot-flags) 1) (logtest? (-> this foot-flags) 2)) + (s0-0 s5-0 s1-0 (the-as vector (-> this foot-pos)) (-> this foot-pos 1)) ) - (if (and (logtest? (-> obj foot-flags) 2) (logtest? (-> obj foot-flags) 4)) - (s0-0 s4-0 s1-0 (-> obj foot-pos 1) (-> obj foot-pos 2)) + (if (and (logtest? (-> this foot-flags) 2) (logtest? (-> this foot-flags) 4)) + (s0-0 s4-0 s1-0 (-> this foot-pos 1) (-> this foot-pos 2)) ) - (if (and (logtest? (-> obj foot-flags) 4) (logtest? (-> obj foot-flags) 8)) - (s0-0 s4-0 s1-0 (-> obj foot-pos 2) (-> obj foot-pos 3)) + (if (and (logtest? (-> this foot-flags) 4) (logtest? (-> this foot-flags) 8)) + (s0-0 s4-0 s1-0 (-> this foot-pos 2) (-> this foot-pos 3)) ) - (if (and (logtest? (-> obj foot-flags) 8) (logtest? (-> obj foot-flags) 1)) - (s0-0 s4-0 s1-0 (-> obj foot-pos 3) (the-as vector (-> obj foot-pos))) + (if (and (logtest? (-> this foot-flags) 8) (logtest? (-> this foot-flags) 1)) + (s0-0 s4-0 s1-0 (-> this foot-pos 3) (the-as vector (-> this foot-pos))) ) ) (vector+! s5-0 s5-0 s4-0) @@ -978,13 +978,13 @@ ) (vector-normalize! s5-0 1.0) (let ((s4-1 (new 'stack-no-clear 'quaternion))) - (let ((s0-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s0-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (set! (-> s0-1 y) 0.0) (vector-xz-normalize! s0-1 1.0) (vector-rotate-y! s5-0 s5-0 (- (vector-y-angle s0-1))) ) (quaternion-from-two-vectors-max-angle! s4-1 *up-vector* s5-0 4551.1113) - (quaternion-slerp! (-> obj tilt-quat) (-> obj tilt-quat) s4-1 (* 0.5 (seconds-per-frame))) + (quaternion-slerp! (-> this tilt-quat) (-> this tilt-quat) s4-1 (* 0.5 (seconds-per-frame))) ) ) ) @@ -1308,7 +1308,7 @@ ;; definition for method 184 of type mammoth ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod mammoth-method-184 mammoth ((obj mammoth)) +(defmethod mammoth-method-184 mammoth ((this mammoth)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1318,8 +1318,8 @@ ) (init-vf0-vector) (dotimes (s5-0 4) - (-> obj joint-ik s5-0 shoulder-matrix-no-ik) - (let ((a0-1 (-> obj joint-ik s5-0 elbow-matrix-no-ik)) + (-> this joint-ik s5-0 shoulder-matrix-no-ik) + (let ((a0-1 (-> this joint-ik s5-0 elbow-matrix-no-ik)) (s3-0 (-> *mammoth-ik-setup* s5-0)) (v1-8 (new 'stack-no-clear 'vector)) (s1-0 (new 'stack-no-clear 'vector)) @@ -1344,7 +1344,7 @@ ) (set! (-> s4-0 quad) (-> v1-8 quad)) (let ((s2-0 (new 'stack-no-clear 'collide-query)) - (f30-0 (- (- (-> s4-0 y) (-> s3-0 ground-dist)) (-> obj root trans y))) + (f30-0 (- (- (-> s4-0 y) (-> s3-0 ground-dist)) (-> this root trans y))) ) (when #t (let ((a1-5 (-> s2-0 bbox)) @@ -1412,15 +1412,15 @@ (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-26 quad) vf6) - (seek! (-> obj ik-handle-y s5-0) (-> v1-26 y) (* 16384.0 (seconds-per-frame))) + (seek! (-> this ik-handle-y s5-0) (-> v1-26 y) (* 16384.0 (seconds-per-frame))) ) ) ) - (set! (-> s4-0 y) (+ (-> obj ik-handle-y s5-0) f30-0)) + (set! (-> s4-0 y) (+ (-> this ik-handle-y s5-0) f30-0)) ) - (set! (-> obj heel-lerp s5-0) (lerp-scale 0.0 1.0 f30-0 0.0 3072.0)) + (set! (-> this heel-lerp s5-0) (lerp-scale 0.0 1.0 f30-0 0.0 3072.0)) ) - (handle-copy! (-> obj joint-ik s5-0) s4-0) + (handle-copy! (-> this joint-ik s5-0) s4-0) ) ) ) @@ -1432,65 +1432,65 @@ ;; definition for method 55 of type mammoth ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod track-target! mammoth ((obj mammoth)) +(defmethod track-target! mammoth ((this mammoth)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (local-vars (sv-752 lightning-spec) (sv-768 int) (sv-784 symbol) (sv-800 mammoth)) (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) (mammoth-update-ik) (dotimes (s5-0 4) - (enable-set! (-> obj joint-ik s5-0) (zero? (-> obj draw cur-lod))) + (enable-set! (-> this joint-ik s5-0) (zero? (-> this draw cur-lod))) ) - (when (!= (-> obj old-foot-flags) (-> obj foot-flags)) + (when (!= (-> this old-foot-flags) (-> this foot-flags)) (let ((s5-1 (new 'static 'array uint32 4 #xa #xd #x1c #x19))) (dotimes (s4-0 4) (let ((s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) - (-> obj node-list data (-> (the-as (pointer int32) (&+ s5-1 (* s4-0 4))))) + (-> this node-list data (-> (the-as (pointer int32) (&+ s5-1 (* s4-0 4))))) ) ) (s2-0 (new 'stack-no-clear 'collide-query)) ) - (when (logtest? (ash 1 s4-0) (-> obj foot-flags)) - (when (not (logtest? (ash 1 s4-0) (-> obj old-foot-flags))) + (when (logtest? (ash 1 s4-0) (-> this foot-flags)) + (when (not (logtest? (ash 1 s4-0) (-> this old-foot-flags))) (set! (-> s2-0 start-pos quad) (-> s3-0 quad)) (vector-reset! (-> s2-0 move-dist)) (+! (-> s2-0 start-pos y) 8192.0) (set! (-> s2-0 move-dist y) -40960.0) (let ((v1-27 s2-0)) (set! (-> v1-27 radius) 2048.0) - (set! (-> v1-27 collide-with) (-> obj enemy-info gnd-collide-with)) - (set! (-> v1-27 ignore-process0) obj) + (set! (-> v1-27 collide-with) (-> this enemy-info gnd-collide-with)) + (set! (-> v1-27 ignore-process0) this) (set! (-> v1-27 ignore-process1) #f) - (set! (-> v1-27 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-27 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-27 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0) (set! (-> s3-0 y) (-> s2-0 best-other-tri intersect y)) ) - (set! (-> obj foot-pos s4-0 quad) (-> s3-0 quad)) + (set! (-> this foot-pos s4-0 quad) (-> s3-0 quad)) ) ) ) ) ) - (set! (-> obj old-foot-flags) (-> obj foot-flags)) + (set! (-> this old-foot-flags) (-> this foot-flags)) ) (dotimes (v1-37 4) - (when (logtest? (ash 1 v1-37) (-> obj foot-flags)) + (when (logtest? (ash 1 v1-37) (-> this foot-flags)) ) ) - (when (and (< (- (current-time) (-> obj lightning-timer)) (seconds 3)) - (< (-> obj lightning-attack-timer) (current-time)) + (when (and (not (time-elapsed? (-> this lightning-timer) (seconds 3))) + (< (-> this lightning-attack-timer) (current-time)) ) (let ((s5-2 *target*)) (when s5-2 (let* ((v1-47 (get-trans s5-2 0)) - (s0-1 (vector-! (new 'stack-no-clear 'vector) v1-47 (-> obj root trans))) + (s0-1 (vector-! (new 'stack-no-clear 'vector) v1-47 (-> this root trans))) ) (when (< (vector-length s0-1) 57344.0) (send-event @@ -1499,7 +1499,7 @@ #f (static-attack-info ((id (new-attack-id)) - (vector (vector-normalize! (vector-! (new 'stack-no-clear 'vector) v1-47 (-> obj root trans)) 1.0)) + (vector (vector-normalize! (vector-! (new 'stack-no-clear 'vector) v1-47 (-> this root trans)) 1.0)) (shove-back (meters 6)) (shove-up (meters 3)) (control (if (focus-test? s5-2 board) @@ -1510,15 +1510,15 @@ ) ) ) - (let ((s2-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s2-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s1-0 *mammoth-lightning-joint-tbl*) (s4-2 (new 'stack-no-clear 'array 'uint32 4)) (s3-2 0) ) (let ((f30-0 (vector-dot s0-1 s2-1))) (dotimes (s0-2 (-> s1-0 length)) - (let* ((v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> s1-0 s0-2)))) - (f0-12 (vector-dot (vector-! (new 'stack-no-clear 'vector) v0-9 (-> obj root trans)) s2-1)) + (let* ((v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> s1-0 s0-2)))) + (f0-12 (vector-dot (vector-! (new 'stack-no-clear 'vector) v0-9 (-> this root trans)) s2-1)) ) (when (or (and (< 0.0 f0-12) (< 0.0 f30-0)) (and (< f0-12 0.0) (< f30-0 0.0))) (set! (-> s4-2 s3-2) (the-as uint (-> s1-0 s0-2))) @@ -1548,8 +1548,8 @@ (set! sv-752 (-> *lightning-spec-id-table* 1)) (set! sv-768 600) (set! sv-784 (the-as symbol #f)) - (set! sv-800 obj) - (let ((t2-0 (-> (the-as (pointer int32) (&+ s4-2 (* (get-rand-int obj s3-2) 4))))) + (set! sv-800 this) + (let ((t2-0 (-> (the-as (pointer int32) (&+ s4-2 (* (get-rand-int this s3-2) 4))))) (t3-0 6) ) ((the-as (function object object object object object object object object none) s5-3) @@ -1568,44 +1568,44 @@ ) ) ) - (set! (-> obj lightning-attack-timer) - (+ (current-time) (the int (* 300.0 (get-rand-float-range obj 0.067 0.1)))) + (set! (-> this lightning-attack-timer) + (+ (current-time) (the int (* 300.0 (get-rand-float-range this 0.067 0.1)))) ) ) ) ) ) ) - (mammoth-method-183 obj) + (mammoth-method-183 this) 0 (none) ) ;; definition for method 60 of type mammoth -(defmethod coin-flip? mammoth ((obj mammoth)) +(defmethod coin-flip? mammoth ((this mammoth)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 7 of type mammoth ;; WARN: Return type mismatch process-focusable vs mammoth. -(defmethod relocate mammoth ((obj mammoth) (arg0 int)) +(defmethod relocate mammoth ((this mammoth) (arg0 int)) (dotimes (v1-0 4) - (if (nonzero? (-> obj joint-ik v1-0)) - (&+! (-> obj joint-ik v1-0) arg0) + (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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method mammoth 7)) this arg0) ) ) ;; definition for method 114 of type mammoth ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! mammoth ((obj mammoth)) +(defmethod init-enemy-collision! mammoth ((this mammoth)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1692,7 +1692,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-36 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-36 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1701,92 +1701,97 @@ ;; definition for method 115 of type mammoth ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! mammoth ((obj mammoth)) +(defmethod init-enemy! mammoth ((this mammoth)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mammoth" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *mammoth-nav-enemy-info*) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set-vector! (-> obj root scale) 1.5 1.5 1.5 1.0) - (set! (-> obj y-level) -40959590.0) - (set! (-> obj foot-flags) (the-as uint 0)) - (set! (-> obj old-foot-flags) (the-as uint 0)) - (set! (-> obj attack-timer) (current-time)) - (set! (-> obj spawn-timer) 0) - (set! (-> obj my-up-vector quad) (-> *y-vector* quad)) - (quaternion-copy! (-> obj my-up-quat) *unity-quaternion*) - (set! (-> obj gspot-timer) 0) - (set! (-> obj gspot-normal quad) (-> *y-vector* quad)) - (set! (-> obj align) (new 'process 'align-control obj)) + (init-enemy-behaviour-and-stats! this *mammoth-nav-enemy-info*) + (logclear! (-> this mask) (process-mask actor-pause)) + (set-vector! (-> this root scale) 1.5 1.5 1.5 1.0) + (set! (-> this y-level) -40959590.0) + (set! (-> this foot-flags) (the-as uint 0)) + (set! (-> this old-foot-flags) (the-as uint 0)) + (set-time! (-> this attack-timer)) + (set! (-> this spawn-timer) 0) + (set! (-> this my-up-vector quad) (-> *y-vector* quad)) + (quaternion-copy! (-> this my-up-quat) *unity-quaternion*) + (set! (-> this gspot-timer) 0) + (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + (set! (-> this align) (new 'process 'align-control this)) (dotimes (s5-1 4) - (set! (-> obj joint-ik s5-1) (new - 'process - 'joint-mod-ik - obj - (-> *mammoth-ik-setup* s5-1 elbow-index) - (-> *mammoth-ik-setup* s5-1 hand-dist) - ) + (set! (-> this joint-ik s5-1) (new + 'process + 'joint-mod-ik + this + (-> *mammoth-ik-setup* s5-1 elbow-index) + (-> *mammoth-ik-setup* s5-1 hand-dist) + ) ) - (set! (-> obj joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) - (set! (-> obj joint-ik 0 callback) mammoth-leg-ik-callback) + (set! (-> this joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this joint-ik 0 callback) mammoth-leg-ik-callback) ) - (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) - (logior! (-> obj joint-ik 2 flags) (joint-mod-ik-flags elbow-trans-neg)) - (logior! (-> obj joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) - (logior! (-> obj joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (-> obj entity) #f)) - (set! (-> obj path-pos) 0.0) - (set! (-> obj path-index) 0) - (set! (-> obj path-index-dir) 1) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (get-point-in-path! (-> obj path) (-> obj root trans) 0.0 'interp) - (set! (-> obj move-pos 0 quad) (-> obj root trans quad)) - (set! (-> obj move-pos 1 quad) (-> obj root trans quad)) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 2 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 0 flags) (joint-mod-ik-flags elbow-rot-neg)) + (logior! (-> this joint-ik 1 flags) (joint-mod-ik-flags elbow-rot-neg)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) + (set! (-> this path-pos) 0.0) + (set! (-> this path-index) 0) + (set! (-> this path-index-dir) 1) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (get-point-in-path! (-> this path) (-> this root trans) 0.0 'interp) + (set! (-> this move-pos 0 quad) (-> this root trans quad)) + (set! (-> this move-pos 1 quad) (-> this root trans quad)) (forward-up-nopitch->quaternion - (-> obj root quat) + (-> this root quat) (vector-! (new 'stack-no-clear 'vector) - (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float (+ (-> obj path-index) 1)) 'interp) - (-> obj root trans) + (get-point-in-path! + (-> this path) + (new 'stack-no-clear 'vector) + (the float (+ (-> this path-index) 1)) + 'interp + ) + (-> this root trans) ) *up-vector* ) - (quaternion-copy! (-> obj tilt-quat) *unity-quaternion*) - (let ((a0-38 (-> obj node-list data 4))) + (quaternion-copy! (-> this tilt-quat) *unity-quaternion*) + (let ((a0-38 (-> this node-list data 4))) (set! (-> a0-38 param0) mammoth-joint-mod-tilt) - (set! (-> a0-38 param1) obj) + (set! (-> a0-38 param1) this) ) - (let ((a0-39 (-> obj node-list data 10))) + (let ((a0-39 (-> this node-list data 10))) (set! (-> a0-39 param0) mammoth-joint-mod-heel) - (set! (-> a0-39 param1) obj) + (set! (-> a0-39 param1) this) (set! (-> a0-39 param2) (the-as basic 0)) ) - (let ((v1-61 (-> obj node-list data 13))) + (let ((v1-61 (-> this node-list data 13))) (set! (-> v1-61 param0) mammoth-joint-mod-heel) - (set! (-> v1-61 param1) obj) + (set! (-> v1-61 param1) this) (set! (-> v1-61 param2) (the-as basic 1)) ) - (let ((v1-63 (-> obj node-list data 25))) + (let ((v1-63 (-> this node-list data 25))) (set! (-> v1-63 param0) mammoth-joint-mod-heel) - (set! (-> v1-63 param1) obj) + (set! (-> v1-63 param1) this) (set! (-> v1-63 param2) (the-as basic 2)) ) - (let ((v1-65 (-> obj node-list data 28))) + (let ((v1-65 (-> this node-list data 28))) (set! (-> v1-65 param0) mammoth-joint-mod-heel) - (set! (-> v1-65 param1) obj) + (set! (-> v1-65 param1) this) (set! (-> v1-65 param2) (the-as basic 3)) ) (dotimes (v1-66 4) - (set! (-> obj heel-lerp v1-66) 0.0) + (set! (-> this heel-lerp v1-66) 0.0) ) - (set! (-> obj lightning-timer) 0) - (set! (-> obj lightning-attack-timer) 0) - (set! (-> obj feet-ik-init-timer) (current-time)) - (logclear! (-> obj enemy-flags) (enemy-flag check-water-backup)) + (set! (-> this lightning-timer) 0) + (set! (-> this lightning-attack-timer) 0) + (set-time! (-> this feet-ik-init-timer)) + (logclear! (-> this enemy-flags) (enemy-flag check-water-backup)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc index 338dc5cdb9..16e5c0a28b 100644 --- a/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/mantis_REF.gc @@ -237,21 +237,21 @@ ) ;; definition for method 3 of type mantis-jump-info -(defmethod inspect mantis-jump-info ((obj mantis-jump-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect mantis-jump-info ((this mantis-jump-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'mantis-jump-info) - (format #t "~1Tdistance: ~f~%" (-> obj distance)) - (format #t "~1Tsearch-step: ~D~%" (-> obj search-step)) - (format #t "~1Tdestination: #~%" (-> obj destination)) - (format #t "~1Tdirection: ~D~%" (-> obj direction)) - (format #t "~1Tstart-anim: ~D~%" (-> obj start-anim)) - (format #t "~1Tair-anim: ~D~%" (-> obj air-anim)) - (format #t "~1Tland-anim: ~D~%" (-> obj land-anim)) + (format #t "[~8x] ~A~%" this 'mantis-jump-info) + (format #t "~1Tdistance: ~f~%" (-> this distance)) + (format #t "~1Tsearch-step: ~D~%" (-> this search-step)) + (format #t "~1Tdestination: #~%" (-> this destination)) + (format #t "~1Tdirection: ~D~%" (-> this direction)) + (format #t "~1Tstart-anim: ~D~%" (-> this start-anim)) + (format #t "~1Tair-anim: ~D~%" (-> this air-anim)) + (format #t "~1Tland-anim: ~D~%" (-> this land-anim)) (label cfg-4) - obj + this ) ;; definition of type mantis @@ -291,17 +291,17 @@ ) ;; definition for method 3 of type mantis -(defmethod inspect mantis ((obj mantis)) - (when (not obj) - (set! obj obj) +(defmethod inspect mantis ((this mantis)) + (when (not this) + (set! this this) (goto cfg-8) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbase-height: ~f~%" (-> obj base-height)) - (format #t "~2Tflags: #x~X : (mantis-flag " (-> obj flags)) - (let ((s5-0 (-> obj flags))) + (format #t "~2Tbase-height: ~f~%" (-> this base-height)) + (format #t "~2Tflags: #x~X : (mantis-flag " (-> this flags)) + (let ((s5-0 (-> this flags))) (if (= (logand s5-0 (mantis-flag attack1-enabled)) (mantis-flag attack1-enabled)) (format #t "attack1-enabled ") ) @@ -310,14 +310,14 @@ ) ) (format #t ")~%") - (format #t "~2Tattack-timer: ~D~%" (-> obj attack-timer)) - (format #t "~2Ttrack-timer: ~D~%" (-> obj track-timer)) - (format #t "~2Tgspot-timer: ~D~%" (-> obj gspot-timer)) - (format #t "~2Tgspot-normal: #~%" (-> obj gspot-normal)) - (format #t "~2Tmy-up-vector: #~%" (-> obj my-up-vector)) - (format #t "~2Tjump: #~%" (-> obj jump)) + (format #t "~2Tattack-timer: ~D~%" (-> this attack-timer)) + (format #t "~2Ttrack-timer: ~D~%" (-> this track-timer)) + (format #t "~2Tgspot-timer: ~D~%" (-> this gspot-timer)) + (format #t "~2Tgspot-normal: #~%" (-> this gspot-normal)) + (format #t "~2Tmy-up-vector: #~%" (-> this my-up-vector)) + (format #t "~2Tjump: #~%" (-> this jump)) (label cfg-8) - obj + this ) ;; failed to figure out what this is: @@ -574,13 +574,13 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.6)) + (until (time-elapsed? gp-1 (seconds 0.6)) (suspend) ) ) (logior! (-> self draw status) (draw-control-status no-draw)) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) + (until (time-elapsed? gp-2 (the int (* 300.0 (get-rand-float-range self 0.0 0.6)))) (suspend) ) ) @@ -632,7 +632,7 @@ ) 0 (look-at-target! self (enemy-flag lock-focus)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self root trans y) (+ -18841.6 (-> self base-height))) (let ((gp-0 (-> self root))) (let ((v1-11 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> gp-0 quat)))) @@ -690,7 +690,7 @@ (ja :num! (seek!)) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (if (logtest? (-> self root status) (collide-status on-ground)) (goto cfg-32) ) @@ -746,7 +746,7 @@ (let ((f30-1 (vector-length s5-1))) (when (not (logtest? (-> self flags) (mantis-flag tracked))) (cond - ((< (- (current-time) (-> self attack-timer)) (seconds 5)) + ((not (time-elapsed? (-> self attack-timer) (seconds 5))) (if (and (< 73728.0 f30-1) (mantis-method-194 self)) (go-virtual crawl) ) @@ -759,10 +759,7 @@ (when (and (and gp-0 (not (logtest? (-> (the-as process-focusable gp-0) focus-status) (focus-status disable dead ignore grabbed))) ) - (and (>= (- (current-time) (-> self attack-timer)) (seconds 5)) - (enemy-method-95 self s4-0 8192.0) - (< f30-1 32768.0) - ) + (and (time-elapsed? (-> self attack-timer) (seconds 5)) (enemy-method-95 self s4-0 8192.0) (< f30-1 32768.0)) ) (cond ((< 24576.0 f30-1) @@ -795,7 +792,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (change-to (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor 1) self) (nav-enemy-method-166 self) (let ((v1-6 (-> self nav))) @@ -906,7 +903,7 @@ (suspend) (ja :num! (seek!)) ) - (if (and (>= (- (current-time) (-> self attack-timer)) (seconds 5)) (< 1 (the-as int (-> self focus aware)))) + (if (and (time-elapsed? (-> self attack-timer) (seconds 5)) (< 1 (the-as int (-> self focus aware)))) (go-virtual hostile) ) (if (< (vector-vector-xz-distance (-> self root trans) (-> self move-dest)) 13107.2) @@ -925,7 +922,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -934,7 +931,7 @@ (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) ) 0 - (set! (-> self attack-timer) (current-time)) + (set-time! (-> self attack-timer)) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) @@ -986,8 +983,8 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) - (set! (-> self attack-timer) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self attack-timer)) ) :exit (behavior () (if (logtest? (-> self enemy-flags) (enemy-flag check-water)) @@ -1164,7 +1161,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (look-at-target! self (enemy-flag lock-focus)) (logior! (-> self enemy-flags) (enemy-flag use-notice-distance)) (let ((v1-6 self)) @@ -1181,7 +1178,7 @@ ) 0 (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self starting-time) (current-time)) + (set-time! (-> self starting-time)) ) :trans (behavior () '() @@ -1224,7 +1221,7 @@ (go-virtual crawl) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (>= (the-as int (-> self focus aware)) 3) (get-enemy-target self) ) @@ -1247,104 +1244,104 @@ ) ;; definition for method 74 of type mantis -(defmethod general-event-handler mantis ((obj mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler mantis ((this mantis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('track) - (if (and (-> arg3 param 0) (>= (- (current-time) (-> obj track-timer)) (seconds 0.5))) + (if (and (-> arg3 param 0) (time-elapsed? (-> this track-timer) (seconds 0.5))) 'abort #t ) ) (('tracked) - (logior! (-> obj flags) (mantis-flag tracked)) + (logior! (-> this flags) (mantis-flag tracked)) (let ((v0-0 (the-as object (current-time)))) - (set! (-> obj track-timer) (the-as time-frame v0-0)) + (set! (-> this track-timer) (the-as time-frame v0-0)) v0-0 ) ) (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) (cond - ((zero? (-> obj hit-points)) - (let ((s5-1 (-> obj incoming knocked-type))) + ((zero? (-> this hit-points)) + (let ((s5-1 (-> this incoming knocked-type))) (cond ((and (= s5-1 (knocked-type knocked-type-4)) - (not (and (-> obj next-state) (let ((v1-41 (-> obj next-state name))) - (or (= v1-41 'knocked) (= v1-41 'jump) (= v1-41 'jump-land)) - ) + (not (and (-> this next-state) (let ((v1-41 (-> this next-state name))) + (or (= v1-41 'knocked) (= v1-41 'jump) (= v1-41 'jump-land)) + ) ) ) - (zero? (get-rand-int obj 3)) - (let ((f0-0 (vector-vector-distance-squared (-> obj root trans) (target-pos 0))) + (zero? (get-rand-int this 3)) + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (target-pos 0))) (f1-0 32768.0) ) (>= f0-0 (* f1-0 f1-0)) ) ) - (kill-prefer-falling obj) + (kill-prefer-falling this) ) ((or (= s5-1 (knocked-type knocked-type-4)) (= s5-1 (knocked-type knocked-type-6))) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) - (go (method-of-object obj knocked)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) + (go (method-of-object this knocked)) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) ) ) (else - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) ) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 77 of type mantis -(defmethod enemy-method-77 mantis ((obj mantis) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 mantis ((this mantis) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.02)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 27))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 27))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 27)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 27)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!) ) #t ) (else (ja-channel-push! 1 (seconds 0.2)) - (let ((a0-5 (-> obj skel root-channel 0))) - (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> obj draw art-group data 10))) + (let ((a0-5 (-> this skel root-channel 0))) + (set! (-> a0-5 frame-group) (the-as art-joint-anim (-> this draw art-group data 10))) (set! (-> a0-5 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 10)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 10)) frames num-frames) -1)) ) (set! (-> a0-5 param 1) (-> arg0 0)) (set! (-> a0-5 frame-num) 0.0) - (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> obj draw art-group data 10)) num-func-seek!) + (joint-control-channel-group! a0-5 (the-as art-joint-anim (-> this draw art-group data 10)) num-func-seek!) ) #t ) @@ -1352,45 +1349,45 @@ ) ;; definition for method 78 of type mantis -(defmethod enemy-method-78 mantis ((obj mantis) (arg0 (pointer float))) +(defmethod enemy-method-78 mantis ((this mantis) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 26))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 26))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 26)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 26)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 26)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 26)) num-func-seek!) ) #t ) - ((let ((v1-15 (-> obj incoming knocked-type))) + ((let ((v1-15 (-> this incoming knocked-type))) (= v1-15 (knocked-type knocked-type-6)) ) - (let ((a0-4 (-> obj skel root-channel 0))) - (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 28))) + (let ((a0-4 (-> this skel root-channel 0))) + (set! (-> a0-4 frame-group) (the-as art-joint-anim (-> this draw art-group data 28))) (set! (-> a0-4 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 28)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 28)) frames num-frames) -1)) ) (set! (-> a0-4 param 1) (-> arg0 0)) (set! (-> a0-4 frame-num) 0.0) - (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> obj draw art-group data 28)) num-func-seek!) + (joint-control-channel-group! a0-4 (the-as art-joint-anim (-> this draw art-group data 28)) num-func-seek!) ) #t ) (else (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 11))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 11)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) (-> arg0 0)) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 11)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) ) #t ) @@ -1400,22 +1397,22 @@ ;; definition for method 125 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs pat-surface. -(defmethod enemy-method-125 mantis ((obj mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) +(defmethod enemy-method-125 mantis ((this mantis) (arg0 collide-query) (arg1 collide-spec) (arg2 float) (arg3 float) (arg4 float)) (the-as pat-surface - (when (find-ground (-> obj root) arg0 arg1 arg2 arg3 arg4) - (set! (-> obj root ground-pat) (-> arg0 best-other-tri pat)) - (when (>= (- (current-time) (-> obj gspot-timer)) (seconds 0.2)) + (when (find-ground (-> this root) arg0 arg1 arg2 arg3 arg4) + (set! (-> this root ground-pat) (-> arg0 best-other-tri pat)) + (when (time-elapsed? (-> this gspot-timer) (seconds 0.2)) (let ((a1-2 (new 'stack-no-clear 'collide-query))) - (set! (-> a1-2 start-pos quad) (-> obj root gspot-pos quad)) + (set! (-> a1-2 start-pos quad) (-> this root gspot-pos quad)) (+! (-> a1-2 start-pos y) 2048.0) (set-vector! (-> a1-2 move-dist) 0.0 -6144.0 0.0 0.0) (let ((v1-10 a1-2)) (set! (-> v1-10 radius) 4915.2) (set! (-> v1-10 collide-with) arg1) - (set! (-> v1-10 ignore-process0) obj) + (set! (-> v1-10 ignore-process0) this) (set! (-> v1-10 ignore-process1) #f) - (set! (-> v1-10 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-10 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-10 action-mask) (collide-action solid)) ) (fill-using-line-sphere *collide-cache* a1-2) @@ -1436,9 +1433,9 @@ ) ) ) - (vector-normalize-copy! (-> obj gspot-normal) s5-1 1.0) + (vector-normalize-copy! (-> this gspot-normal) s5-1 1.0) ) - (set! (-> obj gspot-timer) (current-time)) + (set-time! (-> this gspot-timer)) ) #t ) @@ -1447,13 +1444,13 @@ ;; definition for method 194 of type mantis ;; WARN: Return type mismatch object vs symbol. -(defmethod mantis-method-194 mantis ((obj mantis)) - (let ((a0-2 (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 1)) +(defmethod mantis-method-194 mantis ((this mantis)) + (let ((a0-2 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 1)) (gp-0 (new 'stack-no-clear 'vector)) ) (the-as symbol (and a0-2 - (nav-mesh-method-10 a0-2 gp-0 (-> obj root trans) (the-as nav-poly #f)) - (< (vector-vector-xz-distance gp-0 (-> obj root trans)) 2048.0) + (nav-mesh-method-10 a0-2 gp-0 (-> this root trans) (the-as nav-poly #f)) + (< (vector-vector-xz-distance gp-0 (-> this root trans)) 2048.0) ) ) ) @@ -1462,27 +1459,27 @@ ;; definition for method 193 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod mantis-method-193 mantis ((obj mantis) (arg0 vector)) +(defmethod mantis-method-193 mantis ((this mantis) (arg0 vector)) (cond - ((= (-> obj root gspot-pos y) -40959590.0) + ((= (-> this root gspot-pos y) -40959590.0) (set! (-> arg0 y) 0.0) (vector-normalize! arg0 1.0) - (quaternion-set! (-> obj root quat) 0.0 (-> arg0 x) 0.0 (+ 1.0 (-> arg0 z))) - (quaternion-normalize! (-> obj root quat)) + (quaternion-set! (-> this root quat) 0.0 (-> arg0 x) 0.0 (+ 1.0 (-> arg0 z))) + (quaternion-normalize! (-> this root quat)) ) (else (let ((s4-0 (new 'stack-no-clear 'vector))) (set! (-> s4-0 quad) (-> *up-vector* quad)) (let ((s3-0 (new 'stack-no-clear 'quaternion))) - (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> obj gspot-normal) 10922.667) + (quaternion-from-two-vectors-max-angle! s3-0 s4-0 (-> this gspot-normal) 10922.667) (vector-orient-by-quat! s4-0 s4-0 s3-0) ) - (let ((s3-1 (-> obj my-up-vector))) + (let ((s3-1 (-> this my-up-vector))) (vector-deg-seek s3-1 s3-1 s4-0 (* 8192.0 (seconds-per-frame))) (vector-normalize! s3-1 1.0) (set! (-> arg0 y) 0.0) (vector-normalize! arg0 1.0) - (forward-up-nopitch->quaternion (-> obj root quat) arg0 s3-1) + (forward-up-nopitch->quaternion (-> this root quat) arg0 s3-1) ) ) ) @@ -1494,13 +1491,13 @@ ;; definition for method 142 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 mantis ((obj mantis) (arg0 nav-control)) - (let ((t9-0 (method-of-object obj mantis-method-193)) +(defmethod nav-enemy-method-142 mantis ((this mantis) (arg0 nav-control)) + (let ((t9-0 (method-of-object this mantis-method-193)) (a2-0 (-> arg0 state)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 quad) (-> a2-0 heading quad)) - (t9-0 obj a1-1) + (t9-0 this a1-1) ) 0 (none) @@ -1509,19 +1506,19 @@ ;; definition for method 55 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod track-target! mantis ((obj mantis)) +(defmethod track-target! mantis ((this mantis)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (local-vars (s5-0 vector)) (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (logclear! (-> obj flags) (mantis-flag tracked)) - (let ((a0-4 (handle->process (-> obj focus handle)))) + (logclear! (-> this flags) (mantis-flag tracked)) + (let ((a0-4 (handle->process (-> this focus handle)))) (set! s5-0 (when a0-4 - (set! s5-0 (-> obj focus-pos)) + (set! s5-0 (-> this focus-pos)) (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-4) 0) quad)) s5-0 ) @@ -1532,9 +1529,9 @@ ;; definition for method 187 of type mantis ;; WARN: Return type mismatch object vs none. -(defmethod mantis-method-187 mantis ((obj mantis)) - (let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) - (s4-0 (-> obj root)) +(defmethod mantis-method-187 mantis ((this mantis)) + (let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s4-0 (-> this root)) (s5-0 (lambda ((arg0 mantis) (arg1 collide-shape-moving) (arg2 vector)) (let ((s3-0 (new 'stack-no-clear 'vector)) (f30-0 (vector-length arg2)) @@ -1584,11 +1581,11 @@ ) ) (cond - ((s5-0 obj s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 -40960.0)) - (go (method-of-object obj roll-right)) + ((s5-0 this s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 -40960.0)) + (go (method-of-object this roll-right)) ) - ((s5-0 obj s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 34160.64)) - (go (method-of-object obj roll-left)) + ((s5-0 this s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-0 34160.64)) + (go (method-of-object this roll-left)) ) ) ) @@ -1597,7 +1594,7 @@ ;; definition for method 188 of type mantis ;; WARN: Return type mismatch int vs none. -(defmethod mantis-method-188 mantis ((obj mantis)) +(defmethod mantis-method-188 mantis ((this mantis)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -1606,10 +1603,10 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (handle->process (-> obj focus handle)))) + (let ((s5-0 (handle->process (-> this focus handle)))) (when s5-0 - (let* ((v1-4 (-> obj focus-pos)) - (s4-1 (vector-! (new 'stack-no-clear 'vector) v1-4 (-> obj root trans))) + (let* ((v1-4 (-> this focus-pos)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) v1-4 (-> this root trans))) ) (let ((s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat (the-as process-focusable s5-0) 0))) (s1-0 s4-1) @@ -1626,7 +1623,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s1-0 quad) vf6) ) - (mantis-method-191 obj (the-as vector s5-0) s4-1) + (mantis-method-191 this (the-as vector s5-0) s4-1) ) ) ) @@ -1635,23 +1632,23 @@ ) ;; definition for method 67 of type mantis -(defmethod go-stare mantis ((obj mantis)) - (let ((a0-2 (handle->process (-> obj focus handle)))) +(defmethod go-stare mantis ((this mantis)) + (let ((a0-2 (handle->process (-> this focus handle)))) (if (and a0-2 - (and (< 81920.0 (vector-vector-xz-distance (-> obj root trans) (get-trans (the-as process-focusable a0-2) 0))) - (mantis-method-194 obj) + (and (< 81920.0 (vector-vector-xz-distance (-> this root trans) (get-trans (the-as process-focusable a0-2) 0))) + (mantis-method-194 this) ) ) - (go (method-of-object obj crawl)) + (go (method-of-object this crawl)) ) ) - (go (method-of-object obj hop-away)) + (go (method-of-object this hop-away)) ) ;; definition for method 190 of type mantis ;; WARN: Return type mismatch int vs none. -(defmethod mantis-method-190 mantis ((obj mantis) (arg0 vector) (arg1 vector)) - (let ((s5-0 (-> obj jump))) +(defmethod mantis-method-190 mantis ((this mantis) (arg0 vector) (arg1 vector)) + (let ((s5-0 (-> this jump))) (let* ((f0-0 (vector-length arg1)) (f0-1 (if (< 102400.0 f0-0) 81920.0 @@ -1661,13 +1658,13 @@ ) (vector-normalize! arg1 f0-1) ) - (when (mantis-method-189 obj (-> s5-0 destination) arg1) + (when (mantis-method-189 this (-> s5-0 destination) arg1) (set! (-> s5-0 direction) (the-as uint 0)) (set! (-> s5-0 start-anim) (the-as uint 12)) (set! (-> s5-0 air-anim) (the-as uint 13)) (set! (-> s5-0 land-anim) (the-as uint 0)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag vulnerable)))) - (send-event obj 'jump 0 (-> s5-0 destination)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag vulnerable)))) + (send-event this 'jump 0 (-> s5-0 destination)) ) ) 0 @@ -1675,22 +1672,22 @@ ) ;; definition for method 191 of type mantis -(defmethod mantis-method-191 mantis ((obj mantis) (arg0 vector) (arg1 vector)) - (let ((s5-0 (-> obj jump))) +(defmethod mantis-method-191 mantis ((this mantis) (arg0 vector) (arg1 vector)) + (let ((s5-0 (-> this jump))) (vector-length arg1) (vector-normalize! arg1 1.0) - (vector-rotate-y! arg1 arg1 (* 182.04445 (get-rand-float-range obj -45.0 45.0))) + (vector-rotate-y! arg1 arg1 (* 182.04445 (get-rand-float-range this -45.0 45.0))) (let ((a2-5 - (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 (* 4096.0 (get-rand-float-range obj -4.0 -6.0))) + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 (* 4096.0 (get-rand-float-range this -4.0 -6.0))) ) ) - (when (mantis-method-189 obj (-> s5-0 destination) a2-5) + (when (mantis-method-189 this (-> s5-0 destination) a2-5) (set! (-> s5-0 direction) (the-as uint 1)) (set! (-> s5-0 start-anim) (the-as uint 14)) (set! (-> s5-0 air-anim) (the-as uint 15)) (set! (-> s5-0 land-anim) (the-as uint 16)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag vulnerable)))) - (send-event obj 'jump 0 (-> s5-0 destination)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag vulnerable)))) + (send-event this 'jump 0 (-> s5-0 destination)) ) ) ) @@ -1699,22 +1696,22 @@ ;; definition for method 192 of type mantis ;; WARN: Return type mismatch int vs none. -(defmethod mantis-method-192 mantis ((obj mantis) (arg0 vector) (arg1 vector)) - (let ((s5-0 (-> obj jump))) +(defmethod mantis-method-192 mantis ((this mantis) (arg0 vector) (arg1 vector)) + (let ((s5-0 (-> this jump))) (vector-length arg1) (vector-normalize! arg1 1.0) - (vector-rotate-y! arg1 arg1 (* 182.04445 (get-rand-float-range obj -45.0 45.0))) + (vector-rotate-y! arg1 arg1 (* 182.04445 (get-rand-float-range this -45.0 45.0))) (let ((a2-5 - (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 (* 4096.0 (get-rand-float-range obj -15.0 -22.0))) + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 (* 4096.0 (get-rand-float-range this -15.0 -22.0))) ) ) - (when (mantis-method-189 obj (-> s5-0 destination) a2-5) + (when (mantis-method-189 this (-> s5-0 destination) a2-5) (set! (-> s5-0 direction) (the-as uint 1)) (set! (-> s5-0 start-anim) (the-as uint 20)) (set! (-> s5-0 air-anim) (the-as uint 21)) (set! (-> s5-0 land-anim) (the-as uint 22)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag vulnerable)))) - (send-event obj 'jump 0 (-> s5-0 destination)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag vulnerable)))) + (send-event this 'jump 0 (-> s5-0 destination)) ) ) ) @@ -1723,7 +1720,7 @@ ) ;; definition for method 189 of type mantis -(defmethod mantis-method-189 mantis ((obj mantis) (arg0 vector) (arg1 vector)) +(defmethod mantis-method-189 mantis ((this mantis) (arg0 vector) (arg1 vector)) (let* ((s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) (f30-0 (vector-length arg1)) (f28-0 3640.889) @@ -1776,12 +1773,12 @@ ) ) (cond - ((s3-1 obj s4-0 f30-0 0.0 arg0) + ((s3-1 this s4-0 f30-0 0.0 arg0) #t ) (else (dotimes (s2-0 2) - (if (or (s3-1 obj s4-0 f30-0 f26-0 arg0) (s3-1 obj s4-0 f30-0 (- f26-0) arg0)) + (if (or (s3-1 this s4-0 f30-0 f26-0 arg0) (s3-1 this s4-0 f30-0 (- f26-0) arg0)) (return #t) ) (+! f26-0 f28-0) @@ -1793,10 +1790,10 @@ ) ;; definition for method 89 of type mantis -(defmethod enemy-method-89 mantis ((obj mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-89 mantis ((this mantis) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump start-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump start-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -1808,10 +1805,10 @@ ) ;; definition for method 87 of type mantis -(defmethod enemy-method-87 mantis ((obj mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-87 mantis ((this mantis) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump air-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump air-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -1824,16 +1821,16 @@ ;; definition for method 92 of type mantis ;; WARN: Return type mismatch quaternion vs none. -(defmethod enemy-method-92 mantis ((obj mantis) (arg0 int) (arg1 nav-poly)) +(defmethod enemy-method-92 mantis ((this mantis) (arg0 int) (arg1 nav-poly)) "TODO - nav-poly is a guess @abstract" (let ((v1-0 arg0)) (when (or (zero? v1-0) (= v1-0 1) (= v1-0 2) (= v1-0 3)) - (let ((a0-4 obj)) + (let ((a0-4 this)) (when (logtest? (enemy-flag enemy-flag37) (-> a0-4 enemy-flags)) - (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg1 vertex2) (-> obj root trans)))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> arg1 vertex2) (-> this root trans)))) (vector-normalize! s5-1 1.0) - (let ((v1-5 (-> obj jump direction))) + (let ((v1-5 (-> this jump direction))) (cond ((zero? v1-5) ) @@ -1848,7 +1845,7 @@ ) ) ) - (seek-toward-heading-vec! (-> obj root) s5-1 (-> obj nav max-rotation-rate) (seconds 0.02)) + (seek-toward-heading-vec! (-> this root) s5-1 (-> this nav max-rotation-rate) (seconds 0.02)) ) ) ) @@ -1858,15 +1855,15 @@ ) ;; definition for method 88 of type mantis -(defmethod enemy-method-88 mantis ((obj mantis) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 mantis ((this mantis) (arg0 enemy-jump-info)) (cond - ((zero? (-> obj jump land-anim)) + ((zero? (-> this jump land-anim)) #f ) (else (ja-channel-push! 1 (seconds 0.075)) - (let ((a1-2 (-> obj draw art-group data (-> obj jump land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this jump land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -1880,16 +1877,16 @@ ) ;; definition for method 60 of type mantis -(defmethod coin-flip? mantis ((obj mantis)) +(defmethod coin-flip? mantis ((this mantis)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 114 of type mantis ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! mantis ((obj mantis)) +(defmethod init-enemy-collision! mantis ((this mantis)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1985,7 +1982,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-29 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-29 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) @@ -1993,20 +1990,20 @@ ;; definition for method 115 of type mantis ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! mantis ((obj mantis)) +(defmethod init-enemy! mantis ((this mantis)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-mantis" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *mantis-nav-enemy-info*) - (set! (-> obj flags) (mantis-flag)) - (set! (-> obj my-up-vector quad) (-> *y-vector* quad)) - (set! (-> obj gspot-normal quad) (-> *y-vector* quad)) - (set! (-> obj gspot-timer) 0) - (set! (-> obj attack-timer) (+ (current-time) (seconds -5))) - (set! (-> obj track-timer) 0) - (set! (-> obj draw light-index) (the-as uint 30)) + (init-enemy-behaviour-and-stats! this *mantis-nav-enemy-info*) + (set! (-> this flags) (mantis-flag)) + (set! (-> this my-up-vector quad) (-> *y-vector* quad)) + (set! (-> this gspot-normal quad) (-> *y-vector* quad)) + (set! (-> this gspot-timer) 0) + (set! (-> this attack-timer) (+ (current-time) (seconds -5))) + (set! (-> this track-timer) 0) + (set! (-> this draw light-index) (the-as uint 30)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc b/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc index e5540361c8..00c848b30e 100644 --- a/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/nest-obs_REF.gc @@ -20,21 +20,21 @@ ) ;; definition for method 3 of type nest-switch -(defmethod inspect nest-switch ((obj nest-switch)) - (when (not obj) - (set! obj obj) +(defmethod inspect nest-switch ((this nest-switch)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tset-camera: ~A~%" (-> obj set-camera)) - (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) - (format #t "~2Ty-start: ~f~%" (-> obj y-start)) - (format #t "~2Ty-delta: ~f~%" (-> obj y-delta)) - (format #t "~2Ty-rot-rate: ~f~%" (-> obj y-rot-rate)) + (format #t "~2Tset-camera: ~A~%" (-> this set-camera)) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~2Ty-start: ~f~%" (-> this y-start)) + (format #t "~2Ty-delta: ~f~%" (-> this y-delta)) + (format #t "~2Ty-rot-rate: ~f~%" (-> this y-rot-rate)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -82,11 +82,11 @@ (defstate down (nest-switch) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self set-camera) #f) ) :trans (behavior () - (when (and (not (-> self set-camera)) (>= (- (current-time) (-> self state-time)) (seconds 0.6))) + (when (and (not (-> self set-camera)) (time-elapsed? (-> self state-time) (seconds 0.6))) (process-grab? *target* #f) (hide-hud-quick #f) (set-setting! 'process-mask 'set 0.0 (process-mask movie enemy)) @@ -110,7 +110,7 @@ (suspend) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (seek! (-> self y-rot-rate) 0.0 (* 4000.0 (seconds-per-frame))) (quaternion-rotate-y! (-> self root quat) @@ -121,7 +121,7 @@ ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -136,14 +136,14 @@ ;; definition for method 11 of type nest-switch ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-switch ((obj nest-switch) (arg0 entity-actor)) +(defmethod init-from-entity! nest-switch ((this nest-switch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -177,18 +177,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-switch" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj y-start) (+ -12288.0 (-> obj root trans y))) - (set! (-> obj y-delta) 12288.0) - (go (method-of-object obj up)) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this y-start) (+ -12288.0 (-> this root trans y))) + (set! (-> this y-delta) 12288.0) + (go (method-of-object this up)) (none) ) @@ -208,18 +208,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type nest-piston -(defmethod inspect nest-piston ((obj nest-piston)) - (when (not obj) - (set! obj obj) +(defmethod inspect nest-piston ((this nest-piston)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ty-level: ~f~%" (-> obj y-level)) - (format #t "~2Ty-offset: ~f~%" (-> obj y-offset)) + (format #t "~2Ty-level: ~f~%" (-> this y-level)) + (format #t "~2Ty-offset: ~f~%" (-> this y-offset)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -247,7 +247,7 @@ This commonly includes things such as: :trans rider-trans :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -264,14 +264,14 @@ This commonly includes things such as: ;; definition for method 11 of type nest-piston ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! nest-piston ((obj nest-piston) (arg0 entity-actor)) +(defmethod init-from-entity! nest-piston ((this nest-piston) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -287,19 +287,19 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-nest-piston" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (+! (-> obj root trans y) 8192.0) - (set! (-> obj y-level) (-> obj root trans y)) - (set! (-> obj y-offset) 0.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (+! (-> this root trans y) 8192.0) + (set! (-> this y-level) (-> this root trans y)) + (set! (-> this y-offset) 0.0) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/nest/nest-part_REF.gc b/test/decompiler/reference/jak2/levels/nest/nest-part_REF.gc index 2415d8fcf4..e00d911764 100644 --- a/test/decompiler/reference/jak2/levels/nest/nest-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/nest-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type nest-part -(defmethod inspect nest-part ((obj nest-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect nest-part ((this nest-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc b/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc index 9d5a803811..fe8359e2e1 100644 --- a/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/nest/nest-scenes_REF.gc @@ -76,24 +76,24 @@ ) ;; definition for method 3 of type canyon-lightning-thingy -(defmethod inspect canyon-lightning-thingy ((obj canyon-lightning-thingy)) - (when (not obj) - (set! obj obj) +(defmethod inspect canyon-lightning-thingy ((this canyon-lightning-thingy)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlightning[5] @ #x~X~%" (-> obj lightning)) + (format #t "~2Tlightning[5] @ #x~X~%" (-> this lightning)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: (defstate zap (canyon-lightning-thingy) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (dotimes (v1-0 5) @@ -119,7 +119,7 @@ ) :trans (behavior () (cond - ((>= (- (current-time) (-> self state-time)) (seconds 0.125)) + ((time-elapsed? (-> self state-time) (seconds 0.125)) (let ((gp-0 (new 'stack-no-clear 'vector))) (set! (-> gp-0 quad) (-> self root trans quad)) (let ((v1-7 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat))) @@ -185,13 +185,13 @@ ;; definition for method 7 of type canyon-lightning-thingy ;; WARN: Return type mismatch process-drawable vs canyon-lightning-thingy. -(defmethod relocate canyon-lightning-thingy ((obj canyon-lightning-thingy) (arg0 int)) +(defmethod relocate canyon-lightning-thingy ((this canyon-lightning-thingy) (arg0 int)) (dotimes (index 5) - (if (nonzero? (-> obj lightning index)) - (&+! (-> obj lightning index) arg0) + (if (nonzero? (-> this lightning index)) + (&+! (-> this lightning index) arg0) ) ) - (the-as canyon-lightning-thingy ((method-of-type process-drawable relocate) obj arg0)) + (the-as canyon-lightning-thingy ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for function canyon-lightning-thingy-init-by-other diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc index 5fd8df4d2c..7159603a0c 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-extras_REF.gc @@ -214,7 +214,7 @@ ;; definition for method 39 of type squid-grenade ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound! squid-grenade ((obj squid-grenade)) +(defmethod play-impact-sound! squid-grenade ((this squid-grenade)) "Plays impact sound" (ja-post) 0 @@ -223,9 +223,9 @@ ;; definition for method 30 of type squid-grenade ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! squid-grenade ((obj squid-grenade)) +(defmethod init-proj-collision! squid-grenade ((this squid-grenade)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -269,22 +269,22 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-squid-grenade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (when (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) + (set! (-> this draw light-index) (the-as uint 10)) + (when (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -204800.0 4096.0 4096000.0 (shadow-flags) 819200.0) ) - (let ((v1-25 (-> obj draw shadow-ctrl))) + (let ((v1-25 (-> this draw shadow-ctrl))) (logclear! (-> v1-25 settings flags) (shadow-flags disable-draw)) ) 0 @@ -294,26 +294,26 @@ ) ;; definition for method 31 of type squid-grenade -(defmethod init-proj-settings! squid-grenade ((obj squid-grenade)) +(defmethod init-proj-settings! squid-grenade ((this squid-grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1120) obj)) - (set! (-> obj attack-mode) 'squid-grenade) - (set! (-> obj max-speed) 655360.0) - (set! (-> obj move) squid-grenade-move) - (set! (-> obj timeout) (seconds 5)) - (set! (-> obj stop-speed) 4.096) - (set! (-> obj fly-sound) (new-sound-id)) - (set! (-> obj traj-timer) (current-time)) - (vector+! (-> obj traj-dest) (-> obj root trans) (-> obj root transv)) - (set! (-> obj traj-duration) - (fmax 600.0 (* 0.0018310547 (vector-vector-xz-distance (-> obj root trans) (-> obj traj-dest)))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1120) this)) + (set! (-> this attack-mode) 'squid-grenade) + (set! (-> this max-speed) 655360.0) + (set! (-> this move) squid-grenade-move) + (set! (-> this timeout) (seconds 5)) + (set! (-> this stop-speed) 4.096) + (set! (-> this fly-sound) (new-sound-id)) + (set-time! (-> this traj-timer)) + (vector+! (-> this traj-dest) (-> this root trans) (-> this root transv)) + (set! (-> this traj-duration) + (fmax 600.0 (* 0.0018310547 (vector-vector-xz-distance (-> this root trans) (-> this traj-dest)))) ) - (+! (-> obj traj-duration) (* 75.0 (rand-vu))) + (+! (-> this traj-duration) (* 75.0 (rand-vu))) (let ((f0-8 32768.0)) - (if (< (-> obj root trans y) (-> obj traj-dest y)) - (+! f0-8 (- (-> obj traj-dest y) (-> obj root trans y))) + (if (< (-> this root trans y) (-> this traj-dest y)) + (+! f0-8 (- (-> this traj-dest y) (-> this root trans y))) ) - (setup-from-to-duration-and-height! (-> obj traj) (-> obj root trans) (-> obj traj-dest) 1.0 f0-8) + (setup-from-to-duration-and-height! (-> this traj) (-> this root trans) (-> this traj-dest) 1.0 f0-8) ) (none) ) @@ -389,7 +389,7 @@ (defstate idle (squid-whirlwind) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self duration) (the-as time-frame (+ (the int (* 150.0 (rand-vu))) 1050))) ) :trans (behavior () @@ -402,7 +402,7 @@ (+! (-> a1-2 y) 2048.0) (spawn (-> self part) a1-2) ) - (when (or (>= (- (current-time) (-> self state-time)) (-> self duration)) + (when (or (time-elapsed? (-> self state-time) (-> self duration)) (let ((f0-3 (vector-vector-xz-distance-squared (target-pos 0) (-> self root trans))) (f1-1 12288.0) ) @@ -428,11 +428,11 @@ ) ;; definition for method 10 of type squid-whirlwind -(defmethod deactivate squid-whirlwind ((obj squid-whirlwind)) - (if (-> obj whirl-sound-playing) - (sound-stop (-> obj whirl-sound)) +(defmethod deactivate squid-whirlwind ((this squid-whirlwind)) + (if (-> this whirl-sound-playing) + (sound-stop (-> this whirl-sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -471,87 +471,87 @@ ;; definition for method 15 of type hud-squid ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-squid ((obj hud-squid)) - (set-hud-piece-position! (-> obj sprites 1) (the int (+ 462.0 (* 130.0 (-> obj offset)))) 350) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -32 0) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) -96 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 1)) -62 14) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 1)) -32 14) - (let ((s5-0 (-> obj values 0 current)) - (f28-0 (* 0.01 (the float (-> obj values 1 current)))) - (f30-0 (* 0.01 (the float (-> obj values 2 current)))) +(defmethod draw hud-squid ((this hud-squid)) + (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites 1)) -96 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites 1)) -32 14) + (let ((s5-0 (-> this values 0 current)) + (f28-0 (* 0.01 (the float (-> this values 1 current)))) + (f30-0 (* 0.01 (the float (-> this values 2 current)))) ) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 1)) -92 15) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 1)) -92 15) (cond ((zero? s5-0) - (set! (-> obj sprites 3 color x) 0) - (set! (-> obj sprites 3 color y) 255) + (set! (-> this sprites 3 color x) 0) + (set! (-> this sprites 3 color y) 255) (set! f28-0 (+ 2.0 f28-0)) ) ((= s5-0 1) - (set! (-> obj sprites 3 color y) 255) - (set! (-> obj sprites 3 color x) 255) + (set! (-> this sprites 3 color y) 255) + (set! (-> this sprites 3 color x) 255) (set! f28-0 (+ 1.0 f28-0)) ) (else - (set! (-> obj sprites 3 color x) 255) - (set! (-> obj sprites 3 color y) 0) + (set! (-> this sprites 3 color x) 255) + (set! (-> this sprites 3 color y) 0) 0 ) ) - (set! (-> obj sprites 3 scale-x) (* -7.25 f28-0)) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 1)) -84 4) + (set! (-> this sprites 3 scale-x) (* -7.25 f28-0)) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 1)) -84 4) (cond ((< f30-0 0.5) - (set! (-> obj sprites 4 color x) 255) - (set! (-> obj sprites 4 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-0)))) + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-0)))) ) (else - (set! (-> obj sprites 4 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-0))))) - (set! (-> obj sprites 4 color y) 255) + (set! (-> this sprites 4 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-0))))) + (set! (-> this sprites 4 color y) 255) ) ) - (set! (-> obj sprites 4 scale-x) (* -18.25 f30-0)) + (set! (-> this sprites 4 scale-x) (* -18.25 f30-0)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 17 of type hud-squid ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-squid ((obj hud-squid)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-squid ((this hud-squid)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj values 0 target) 0) - (set! (-> obj values 1 target) 100) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 2 tex) + (set! (-> this values 0 target) 0) + (set! (-> this values 1 target) 100) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 2 tex) (lookup-texture-by-name "hud-baronsymbol-01" (the-as string #f) (the-as (pointer texture-page) #f)) ) - (set! (-> obj sprites 2 flags) (the-as uint 4)) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 5 scale-x) 0.5) - (set! (-> obj sprites 5 flags) (the-as uint 4)) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 6 scale-x) 0.5) - (set! (-> obj sprites 6 flags) (the-as uint 4)) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 3 scale-y) 3.25) - (set! (-> obj sprites 3 color z) 0) - (set! (-> obj sprites 3 flags) (the-as uint 4)) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 4 scale-y) 1.5) - (set! (-> obj sprites 4 color z) 0) - (set! (-> obj sprites 4 flags) (the-as uint 4)) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 flags) (font-flags kerning large)) - (set! (-> obj strings 0 scale) 0.5) + (set! (-> this sprites 2 flags) (the-as uint 4)) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 5 scale-x) 0.5) + (set! (-> this sprites 5 flags) (the-as uint 4)) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 6 scale-x) 0.5) + (set! (-> this sprites 6 flags) (the-as uint 4)) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 3 scale-y) 3.25) + (set! (-> this sprites 3 color z) 0) + (set! (-> this sprites 3 flags) (the-as uint 4)) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 4 scale-y) 1.5) + (set! (-> this sprites 4 color z) 0) + (set! (-> this sprites 4 flags) (the-as uint 4)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning large)) + (set! (-> this strings 0 scale) 0.5) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc index ecf18768bc..7240d6ad9f 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-setup_REF.gc @@ -20,22 +20,22 @@ ) ;; definition for method 3 of type squid-whirlwind -(defmethod inspect squid-whirlwind ((obj squid-whirlwind)) - (when (not obj) - (set! obj obj) +(defmethod inspect squid-whirlwind ((this squid-whirlwind)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcenter: #~%" (-> obj center)) - (format #t "~2Tcenter-vel: #~%" (-> obj center-vel)) - (format #t "~2Tcurrent-nav-poly: #~%" (-> obj current-nav-poly)) - (format #t "~2Tduration: ~D~%" (-> obj duration)) - (format #t "~2Twhirl-sound: ~D~%" (-> obj whirl-sound)) - (format #t "~2Twhirl-sound-playing: ~A~%" (-> obj whirl-sound-playing)) + (format #t "~2Tcenter: #~%" (-> this center)) + (format #t "~2Tcenter-vel: #~%" (-> this center-vel)) + (format #t "~2Tcurrent-nav-poly: #~%" (-> this current-nav-poly)) + (format #t "~2Tduration: ~D~%" (-> this duration)) + (format #t "~2Twhirl-sound: ~D~%" (-> this whirl-sound)) + (format #t "~2Twhirl-sound-playing: ~A~%" (-> this whirl-sound-playing)) (label cfg-4) - obj + this ) ;; definition of type squid-collision @@ -51,16 +51,16 @@ ) ;; definition for method 3 of type squid-collision -(defmethod inspect squid-collision ((obj squid-collision)) - (when (not obj) - (set! obj obj) +(defmethod inspect squid-collision ((this squid-collision)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type squid-driver @@ -78,18 +78,18 @@ ) ;; definition for method 3 of type squid-driver -(defmethod inspect squid-driver ((obj squid-driver)) - (when (not obj) - (set! obj obj) +(defmethod inspect squid-driver ((this squid-driver)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tprefix: ~A~%" (-> obj prefix)) - (format #t "~2Trun-free: ~A~%" (-> obj run-free)) + (format #t "~2Tprefix: ~A~%" (-> this prefix)) + (format #t "~2Trun-free: ~A~%" (-> this run-free)) (label cfg-4) - obj + this ) ;; definition of type squid-baron @@ -105,16 +105,16 @@ ) ;; definition for method 3 of type squid-baron -(defmethod inspect squid-baron ((obj squid-baron)) - (when (not obj) - (set! obj obj) +(defmethod inspect squid-baron ((this squid-baron)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type squid-tentacle-chain @@ -130,18 +130,18 @@ ) ;; definition for method 3 of type squid-tentacle-chain -(defmethod inspect squid-tentacle-chain ((obj squid-tentacle-chain)) - (when (not obj) - (set! obj obj) +(defmethod inspect squid-tentacle-chain ((this squid-tentacle-chain)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'squid-tentacle-chain) - (format #t "~1Tposition: #~%" (-> obj position)) - (format #t "~1Tvelocity: #~%" (-> obj velocity)) - (format #t "~1Told-x: #~%" (-> obj old-x)) - (format #t "~1Tjoint-mod: ~A~%" (-> obj joint-mod)) + (format #t "[~8x] ~A~%" this 'squid-tentacle-chain) + (format #t "~1Tposition: #~%" (-> this position)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Told-x: #~%" (-> this old-x)) + (format #t "~1Tjoint-mod: ~A~%" (-> this joint-mod)) (label cfg-4) - obj + this ) ;; definition of type squid-tentacle @@ -170,25 +170,25 @@ ) ;; definition for method 3 of type squid-tentacle -(defmethod inspect squid-tentacle ((obj squid-tentacle)) - (when (not obj) - (set! obj obj) +(defmethod inspect squid-tentacle ((this squid-tentacle)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tchain-joints[11] @ #x~X~%" (-> obj chain-joints)) - (format #t "~2Tgravity: #~%" (-> obj gravity)) - (format #t "~2Tgravity-target: #~%" (-> obj gravity-target)) - (format #t "~2Tstretch-vel: ~f~%" (-> obj stretch-vel)) - (format #t "~2Tcenter: #~%" (-> obj center)) - (format #t "~2Tavoid-center: ~A~%" (-> obj avoid-center)) - (format #t "~2Twrap: ~A~%" (-> obj wrap)) - (format #t "~2Tnum-bg-collisions: ~D~%" (-> obj num-bg-collisions)) - (format #t "~2Tmax-movement: ~f~%" (-> obj max-movement)) + (format #t "~2Tchain-joints[11] @ #x~X~%" (-> this chain-joints)) + (format #t "~2Tgravity: #~%" (-> this gravity)) + (format #t "~2Tgravity-target: #~%" (-> this gravity-target)) + (format #t "~2Tstretch-vel: ~f~%" (-> this stretch-vel)) + (format #t "~2Tcenter: #~%" (-> this center)) + (format #t "~2Tavoid-center: ~A~%" (-> this avoid-center)) + (format #t "~2Twrap: ~A~%" (-> this wrap)) + (format #t "~2Tnum-bg-collisions: ~D~%" (-> this num-bg-collisions)) + (format #t "~2Tmax-movement: ~f~%" (-> this max-movement)) (label cfg-4) - obj + this ) ;; definition of type squid-grenade-holder @@ -204,18 +204,18 @@ ) ;; definition for method 3 of type squid-grenade-holder -(defmethod inspect squid-grenade-holder ((obj squid-grenade-holder)) - (when (not obj) - (set! obj obj) +(defmethod inspect squid-grenade-holder ((this squid-grenade-holder)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'squid-grenade-holder) - (format #t "~1Ttarget-position: #~%" (-> obj target-position)) - (format #t "~1Tshow-it: ~A~%" (-> obj show-it)) - (format #t "~1Tgrenade: ~D~%" (-> obj grenade)) - (format #t "~1Tmarker: ~D~%" (-> obj marker)) + (format #t "[~8x] ~A~%" this 'squid-grenade-holder) + (format #t "~1Ttarget-position: #~%" (-> this target-position)) + (format #t "~1Tshow-it: ~A~%" (-> this show-it)) + (format #t "~1Tgrenade: ~D~%" (-> this grenade)) + (format #t "~1Tmarker: ~D~%" (-> this marker)) (label cfg-4) - obj + this ) ;; definition of type squid-grenade @@ -233,21 +233,21 @@ ) ;; definition for method 3 of type squid-grenade -(defmethod inspect squid-grenade ((obj squid-grenade)) - (when (not obj) - (set! obj obj) +(defmethod inspect squid-grenade ((this squid-grenade)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttraj: #~%" (-> obj traj)) - (format #t "~2Ttraj-dest: #~%" (-> obj traj-dest)) - (format #t "~2Ttraj-timer: ~D~%" (-> obj traj-timer)) - (format #t "~2Ttraj-duration: ~f~%" (-> obj traj-duration)) - (format #t "~2Tfly-sound: ~D~%" (-> obj fly-sound)) + (format #t "~2Ttraj: #~%" (-> this traj)) + (format #t "~2Ttraj-dest: #~%" (-> this traj-dest)) + (format #t "~2Ttraj-timer: ~D~%" (-> this traj-timer)) + (format #t "~2Ttraj-duration: ~f~%" (-> this traj-duration)) + (format #t "~2Tfly-sound: ~D~%" (-> this fly-sound)) (label cfg-4) - obj + this ) ;; definition of type squid @@ -364,95 +364,95 @@ ) ;; definition for method 3 of type squid -(defmethod inspect squid ((obj squid)) - (when (not obj) - (set! obj obj) +(defmethod inspect squid ((this squid)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tquat: #~%" (-> obj quat)) - (format #t "~2Ttrans: #~%" (-> obj trans)) - (format #t "~2Tresidual-velocity: #~%" (-> obj residual-velocity)) - (format #t "~2Tresidual-accumulator-1: ~f~%" (-> obj residual-accumulator-1)) - (format #t "~2Tresidual-accumulator-2: ~f~%" (-> obj residual-accumulator-2)) - (format #t "~2Tforce-onto-mesh: ~A~%" (-> obj force-onto-mesh)) - (format #t "~2Tmesh-forced: ~A~%" (-> obj mesh-forced)) - (format #t "~2Thit-reaction: #~%" (-> obj hit-reaction)) - (format #t "~2Ttraj: #~%" (-> obj traj)) - (format #t "~2Ttraj-src: #~%" (-> obj traj-src)) - (format #t "~2Ttraj-dest: #~%" (-> obj traj-dest)) - (format #t "~2Ttraj-timer: ~D~%" (-> obj traj-timer)) - (format #t "~2Ttraj-duration: ~f~%" (-> obj traj-duration)) - (format #t "~2Tcurrent-nav-poly: #~%" (-> obj current-nav-poly)) - (format #t "~2Ttentacles[6] @ #x~X~%" (-> obj tentacles)) - (format #t "~2Tbaron: #x~X~%" (-> obj baron)) - (format #t "~2Tdriver: #x~X~%" (-> obj driver)) - (format #t "~2Tdriver-blend: #~%" (-> obj driver-blend)) - (format #t "~2Tblink-time: ~D~%" (-> obj blink-time)) - (format #t "~2Tblink-mask: ~D~%" (-> obj blink-mask)) - (format #t "~2Tthruster-part: ~A~%" (-> obj thruster-part)) - (format #t "~2Tgun-tilt-left-jm: ~A~%" (-> obj gun-tilt-left-jm)) - (format #t "~2Tgun-tilt-right-jm: ~A~%" (-> obj gun-tilt-right-jm)) - (format #t "~2Tgun-tilt: ~f~%" (-> obj gun-tilt)) - (format #t "~2Tnext-gun: ~D~%" (-> obj next-gun)) - (format #t "~2Tfire-aft: ~A~%" (-> obj fire-aft)) - (format #t "~2Tgun-high-to-low: ~A~%" (-> obj gun-high-to-low)) - (format #t "~2Tgrenade[10] @ #x~X~%" (-> obj grenade)) - (format #t "~2Tfirst-path: ~A~%" (-> obj first-path)) - (format #t "~2Tsecond-path: ~A~%" (-> obj second-path)) - (format #t "~2Tthird-path: ~A~%" (-> obj third-path)) - (format #t "~2Tshield-timer: ~D~%" (-> obj shield-timer)) - (format #t "~2Tshield-color: #~%" (-> obj shield-color)) - (format #t "~2Tshield-shattered: ~A~%" (-> obj shield-shattered)) - (format #t "~2Tshield-hit-points: ~f~%" (-> obj shield-hit-points)) - (format #t "~2Thit-points: ~D~%" (-> obj hit-points)) - (format #t "~2Tinvincible-timer: ~D~%" (-> obj invincible-timer)) - (format #t "~2Tstage: ~D~%" (-> obj stage)) - (format #t "~2Tcollision-actor: #x~X~%" (-> obj collision-actor)) - (format #t "~2Ttentacle-base-jm: ~A~%" (-> obj tentacle-base-jm)) - (format #t "~2Ttentacle-base-rotation: ~f~%" (-> obj tentacle-base-rotation)) + (format #t "~2Tquat: #~%" (-> this quat)) + (format #t "~2Ttrans: #~%" (-> this trans)) + (format #t "~2Tresidual-velocity: #~%" (-> this residual-velocity)) + (format #t "~2Tresidual-accumulator-1: ~f~%" (-> this residual-accumulator-1)) + (format #t "~2Tresidual-accumulator-2: ~f~%" (-> this residual-accumulator-2)) + (format #t "~2Tforce-onto-mesh: ~A~%" (-> this force-onto-mesh)) + (format #t "~2Tmesh-forced: ~A~%" (-> this mesh-forced)) + (format #t "~2Thit-reaction: #~%" (-> this hit-reaction)) + (format #t "~2Ttraj: #~%" (-> this traj)) + (format #t "~2Ttraj-src: #~%" (-> this traj-src)) + (format #t "~2Ttraj-dest: #~%" (-> this traj-dest)) + (format #t "~2Ttraj-timer: ~D~%" (-> this traj-timer)) + (format #t "~2Ttraj-duration: ~f~%" (-> this traj-duration)) + (format #t "~2Tcurrent-nav-poly: #~%" (-> this current-nav-poly)) + (format #t "~2Ttentacles[6] @ #x~X~%" (-> this tentacles)) + (format #t "~2Tbaron: #x~X~%" (-> this baron)) + (format #t "~2Tdriver: #x~X~%" (-> this driver)) + (format #t "~2Tdriver-blend: #~%" (-> this driver-blend)) + (format #t "~2Tblink-time: ~D~%" (-> this blink-time)) + (format #t "~2Tblink-mask: ~D~%" (-> this blink-mask)) + (format #t "~2Tthruster-part: ~A~%" (-> this thruster-part)) + (format #t "~2Tgun-tilt-left-jm: ~A~%" (-> this gun-tilt-left-jm)) + (format #t "~2Tgun-tilt-right-jm: ~A~%" (-> this gun-tilt-right-jm)) + (format #t "~2Tgun-tilt: ~f~%" (-> this gun-tilt)) + (format #t "~2Tnext-gun: ~D~%" (-> this next-gun)) + (format #t "~2Tfire-aft: ~A~%" (-> this fire-aft)) + (format #t "~2Tgun-high-to-low: ~A~%" (-> this gun-high-to-low)) + (format #t "~2Tgrenade[10] @ #x~X~%" (-> this grenade)) + (format #t "~2Tfirst-path: ~A~%" (-> this first-path)) + (format #t "~2Tsecond-path: ~A~%" (-> this second-path)) + (format #t "~2Tthird-path: ~A~%" (-> this third-path)) + (format #t "~2Tshield-timer: ~D~%" (-> this shield-timer)) + (format #t "~2Tshield-color: #~%" (-> this shield-color)) + (format #t "~2Tshield-shattered: ~A~%" (-> this shield-shattered)) + (format #t "~2Tshield-hit-points: ~f~%" (-> this shield-hit-points)) + (format #t "~2Thit-points: ~D~%" (-> this hit-points)) + (format #t "~2Tinvincible-timer: ~D~%" (-> this invincible-timer)) + (format #t "~2Tstage: ~D~%" (-> this stage)) + (format #t "~2Tcollision-actor: #x~X~%" (-> this collision-actor)) + (format #t "~2Ttentacle-base-jm: ~A~%" (-> this tentacle-base-jm)) + (format #t "~2Ttentacle-base-rotation: ~f~%" (-> this tentacle-base-rotation)) (format #t "~2Ttentacle-base-rotation-speed: #~%" - (-> obj tentacle-base-rotation-speed) + (-> this tentacle-base-rotation-speed) ) - (format #t "~2Tstage-2-go-status: ~D~%" (-> obj stage-2-go-status)) - (format #t "~2Tgate-intact: ~A~%" (-> obj gate-intact)) - (format #t "~2Thud: ~D~%" (-> obj hud)) - (format #t "~2Tdesired-rotate-to-vector-angle: ~f~%" (-> obj desired-rotate-to-vector-angle)) - (format #t "~2Tallowed-rotate-to-vector-angle: ~f~%" (-> obj allowed-rotate-to-vector-angle)) - (format #t "~2Tstop-shooting: ~A~%" (-> obj stop-shooting)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Trush-sound: ~D~%" (-> obj rush-sound)) - (format #t "~2Trush-sound-playing: ~A~%" (-> obj rush-sound-playing)) - (format #t "~2Trush-end-time: ~D~%" (-> obj rush-end-time)) - (format #t "~2Tjet-sound: ~D~%" (-> obj jet-sound)) - (format #t "~2Tjet-sound-playing: ~A~%" (-> obj jet-sound-playing)) - (format #t "~2Tjet-pitch: ~D~%" (-> obj jet-pitch)) - (format #t "~2Tnegate-jet-pitch: ~A~%" (-> obj negate-jet-pitch)) - (format #t "~2Tjet-volume: ~D~%" (-> obj jet-volume)) - (format #t "~2Tcan-play-squid-boost: ~A~%" (-> obj can-play-squid-boost)) - (format #t "~2Ttentacle-sound: ~D~%" (-> obj tentacle-sound)) - (format #t "~2Ttentacle-sound-playing: ~A~%" (-> obj tentacle-sound-playing)) - (format #t "~2Tspin-sound: ~D~%" (-> obj spin-sound)) - (format #t "~2Tspin-sound-playing: ~A~%" (-> obj spin-sound-playing)) - (format #t "~2Treload-played: ~A~%" (-> obj reload-played)) - (format #t "~2Tmax-plane: ~D~%" (-> obj max-plane)) - (format #t "~2Tdebug-timer: ~D~%" (-> obj debug-timer)) - (format #t "~2Tdebug-on: ~A~%" (-> obj debug-on)) - (format #t "~2Tlast-damaged-talker: ~D~%" (-> obj last-damaged-talker)) - (format #t "~2Tlast-shield-hit-talker: ~D~%" (-> obj last-shield-hit-talker)) - (format #t "~2Tlast-no-energy-talker: ~D~%" (-> obj last-no-energy-talker)) - (format #t "~2Tlast-shooting-talker: ~D~%" (-> obj last-shooting-talker)) - (format #t "~2Tlast-headbutting-talker: ~D~%" (-> obj last-headbutting-talker)) - (format #t "~2Tlast-general-talker: ~D~%" (-> obj last-general-talker)) - (format #t "~2Tlast-start-recharging-talker: ~D~%" (-> obj last-start-recharging-talker)) - (format #t "~2Tlast-done-recharging-talker: ~D~%" (-> obj last-done-recharging-talker)) - (format #t "~2Tsuck: ~f~%" (-> obj suck)) + (format #t "~2Tstage-2-go-status: ~D~%" (-> this stage-2-go-status)) + (format #t "~2Tgate-intact: ~A~%" (-> this gate-intact)) + (format #t "~2Thud: ~D~%" (-> this hud)) + (format #t "~2Tdesired-rotate-to-vector-angle: ~f~%" (-> this desired-rotate-to-vector-angle)) + (format #t "~2Tallowed-rotate-to-vector-angle: ~f~%" (-> this allowed-rotate-to-vector-angle)) + (format #t "~2Tstop-shooting: ~A~%" (-> this stop-shooting)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Trush-sound: ~D~%" (-> this rush-sound)) + (format #t "~2Trush-sound-playing: ~A~%" (-> this rush-sound-playing)) + (format #t "~2Trush-end-time: ~D~%" (-> this rush-end-time)) + (format #t "~2Tjet-sound: ~D~%" (-> this jet-sound)) + (format #t "~2Tjet-sound-playing: ~A~%" (-> this jet-sound-playing)) + (format #t "~2Tjet-pitch: ~D~%" (-> this jet-pitch)) + (format #t "~2Tnegate-jet-pitch: ~A~%" (-> this negate-jet-pitch)) + (format #t "~2Tjet-volume: ~D~%" (-> this jet-volume)) + (format #t "~2Tcan-play-squid-boost: ~A~%" (-> this can-play-squid-boost)) + (format #t "~2Ttentacle-sound: ~D~%" (-> this tentacle-sound)) + (format #t "~2Ttentacle-sound-playing: ~A~%" (-> this tentacle-sound-playing)) + (format #t "~2Tspin-sound: ~D~%" (-> this spin-sound)) + (format #t "~2Tspin-sound-playing: ~A~%" (-> this spin-sound-playing)) + (format #t "~2Treload-played: ~A~%" (-> this reload-played)) + (format #t "~2Tmax-plane: ~D~%" (-> this max-plane)) + (format #t "~2Tdebug-timer: ~D~%" (-> this debug-timer)) + (format #t "~2Tdebug-on: ~A~%" (-> this debug-on)) + (format #t "~2Tlast-damaged-talker: ~D~%" (-> this last-damaged-talker)) + (format #t "~2Tlast-shield-hit-talker: ~D~%" (-> this last-shield-hit-talker)) + (format #t "~2Tlast-no-energy-talker: ~D~%" (-> this last-no-energy-talker)) + (format #t "~2Tlast-shooting-talker: ~D~%" (-> this last-shooting-talker)) + (format #t "~2Tlast-headbutting-talker: ~D~%" (-> this last-headbutting-talker)) + (format #t "~2Tlast-general-talker: ~D~%" (-> this last-general-talker)) + (format #t "~2Tlast-start-recharging-talker: ~D~%" (-> this last-start-recharging-talker)) + (format #t "~2Tlast-done-recharging-talker: ~D~%" (-> this last-done-recharging-talker)) + (format #t "~2Tsuck: ~f~%" (-> this suck)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -866,9 +866,9 @@ ;; definition for method 22 of type squid-tentacle ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod joint-setup squid-tentacle ((obj squid-tentacle)) +(defmethod joint-setup squid-tentacle ((this squid-tentacle)) (dotimes (s5-0 11) - (let ((s4-0 (-> obj chain-joints s5-0))) + (let ((s4-0 (-> this chain-joints s5-0))) (vector<-cspace! (-> s4-0 position) (-> s4-0 joint-mod joint)) (set! (-> s4-0 position quad) (-> s4-0 joint-mod joint bone transform quad 0)) (vector-reset! (-> s4-0 velocity)) @@ -881,7 +881,7 @@ ;; definition for method 23 of type squid-tentacle ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod squid-tentacle-method-23 squid-tentacle ((obj squid-tentacle)) +(defmethod squid-tentacle-method-23 squid-tentacle ((this squid-tentacle)) (local-vars (v1-134 float) (v1-162 float) @@ -927,11 +927,11 @@ (vf6 :class vf) ) (init-vf0-vector) - (vector-seek-3d-smooth! (-> obj gravity) (-> obj gravity-target) 0.05 0.1) + (vector-seek-3d-smooth! (-> this gravity) (-> this gravity-target) 0.05 0.1) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((s4-0 (new 'stack-no-clear 'bounding-box))) (let ((s3-0 (new 'stack-no-clear 'sphere))) - (vector<-cspace! s3-0 (-> obj node-list data 7)) + (vector<-cspace! s3-0 (-> this node-list data 7)) (set! (-> s3-0 r) 61440.0) (set-from-sphere! s4-0 s3-0) ) @@ -945,29 +945,29 @@ (fill-using-bounding-box *collide-cache* s5-0) ) (let ((s5-1 (new 'stack-no-clear 'matrix)) - (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3))) + (s4-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 3))) (s3-1 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 3 bone transform vector 2) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 3 bone transform vector 2) 1.0) ) (s2-0 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 3 bone transform vector 1) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 3 bone transform vector 1) 1.0) ) (s1-0 (new 'stack-no-clear 'vector)) ) - (set! (-> obj num-bg-collisions) 0) - (set! (-> obj max-movement) 0.0) + (set! (-> this num-bg-collisions) 0) + (set! (-> this max-movement) 0.0) (dotimes (s0-0 11) - (set! sv-1456 (-> obj chain-joints s0-0)) + (set! sv-1456 (-> this chain-joints s0-0)) (set! sv-1904 (new 'stack-no-clear 'vector)) (let ((v1-19 (-> sv-1456 position quad))) (set! (-> sv-1904 quad) v1-19) ) (cond - ((-> obj wrap) + ((-> this wrap) (+! (-> sv-1904 y) -409.6) (set! sv-1472 (new 'stack-no-clear 'vector)) (let ((v1-25 sv-1904) - (a0-10 (-> obj center)) + (a0-10 (-> this center)) ) (.lvf vf4 (&-> v1-25 quad)) (.lvf vf5 (&-> a0-10 quad)) @@ -983,7 +983,7 @@ (else (set! sv-1520 sv-1904) (set! sv-1488 sv-1904) - (set! sv-1504 (-> obj gravity)) + (set! sv-1504 (-> this gravity)) (let ((f0-14 (* 4096.0 (-> pp clock time-adjust-ratio) (fmax 0.2 (lerp-scale 0.38 0.18 (the float s0-0) 0.0 5.0)))) ) (.lvf vf2 (&-> sv-1504 quad)) @@ -996,8 +996,8 @@ (.mul.x.vf acc vf2 vf3) (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) (.svf (&-> sv-1520 quad) vf4) - (when (-> obj avoid-center) - (vector-! s1-0 (-> sv-1456 position) (-> obj center)) + (when (-> this avoid-center) + (vector-! s1-0 (-> sv-1456 position) (-> this center)) (set! sv-1536 vector-normalize!) (set! sv-1552 s1-0) (let ((a1-13 (* 4096.0 (-> pp clock time-adjust-ratio) (fmax 0.0 (lerp-scale 0.4 0.6 (the float s0-0) 0.0 8.0))))) @@ -1010,7 +1010,7 @@ (when (< s0-0 10) (set! sv-1600 sv-1904) (set! sv-1568 sv-1904) - (set! sv-1584 (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ s0-0 1) 64)))) + (set! sv-1584 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ s0-0 1) 64)))) (let ((f0-24 (fmin 0.9 (lerp-scale 0.2 1.0 (the float s0-0) 0.0 4.0)))) (.lvf vf2 (&-> sv-1584 quad)) (.lvf vf1 (&-> sv-1568 quad)) @@ -1029,7 +1029,7 @@ (vector-normalize! s1-0 4096.0) ) (vector+! sv-1904 s1-0 s4-1) - (let ((v0-15 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 3)))) + (let ((v0-15 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 3)))) (set! sv-1616 (new 'stack-no-clear 'vector)) (+! (-> v0-15 y) 31744.0) (vector-! sv-1616 sv-1904 v0-15) @@ -1039,7 +1039,7 @@ (vector+float*! sv-1904 sv-1904 sv-1616 (- 32768.0 f0-27)) (vector-normalize-copy! sv-1616 - (-> obj node-list data 3 bone transform vector 2) + (-> this node-list data 3 bone transform vector 2) (* 2048.0 (-> pp clock time-adjust-ratio)) ) (let ((v1-77 sv-1904)) @@ -1055,7 +1055,7 @@ ) (set! sv-1632 (new 'stack-no-clear 'vector)) (let ((v1-79 sv-1904) - (a0-33 (-> obj center)) + (a0-33 (-> this center)) ) (.lvf vf4 (&-> v1-79 quad)) (.lvf vf5 (&-> a0-33 quad)) @@ -1147,7 +1147,7 @@ (let ((v1-114 sv-1744)) (set! (-> v1-114 radius) 4096.0) (set! (-> v1-114 collide-with) (collide-spec player-list special-obstacle)) - (set! (-> v1-114 ignore-process0) obj) + (set! (-> v1-114 ignore-process0) this) (set! (-> v1-114 ignore-process1) #f) (set! (-> v1-114 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) @@ -1183,7 +1183,7 @@ ) (label cfg-27) (if (< 1 sv-1760) - (+! (-> obj num-bg-collisions) 1) + (+! (-> this num-bg-collisions) 1) ) (set! sv-1808 (new 'stack-no-clear 'vector)) (let ((v1-143 s4-1) @@ -1215,7 +1215,7 @@ ) (else (set! f0-51 (* 0.8 f30-4)) - (vector-float*! sv-1792 sv-1792 (-> obj stretch-vel)) + (vector-float*! sv-1792 sv-1792 (-> this stretch-vel)) ) ) ) @@ -1252,8 +1252,8 @@ ) ) ) - (set! (-> obj max-movement) - (fmax (vector-vector-distance (-> sv-1456 position) sv-1904) (-> obj max-movement)) + (set! (-> this max-movement) + (fmax (vector-vector-distance (-> sv-1456 position) sv-1904) (-> this max-movement)) ) (set! (-> sv-1456 position quad) (-> sv-1904 quad)) (if (-> sv-1456 joint-mod) @@ -1322,8 +1322,8 @@ 0 ) ) - (set! (-> obj avoid-center) #f) - (set! (-> obj wrap) #f) + (set! (-> this avoid-center) #f) + (set! (-> this wrap) #f) 0 (none) ) @@ -1332,13 +1332,13 @@ ;; definition for method 7 of type squid-tentacle ;; WARN: Return type mismatch process-drawable vs squid-tentacle. -(defmethod relocate squid-tentacle ((obj squid-tentacle) (arg0 int)) +(defmethod relocate squid-tentacle ((this squid-tentacle) (arg0 int)) (dotimes (v1-0 11) - (if (nonzero? (-> obj chain-joints v1-0 joint-mod)) - (&+! (-> obj chain-joints v1-0 joint-mod) arg0) + (if (nonzero? (-> this chain-joints v1-0 joint-mod)) + (&+! (-> this chain-joints v1-0 joint-mod) arg0) ) ) - (the-as squid-tentacle ((method-of-type process-drawable relocate) obj arg0)) + (the-as squid-tentacle ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for function squid-tentacle-init-by-other @@ -1728,7 +1728,7 @@ (squid-take-hit (the-as touching-shapes-entry (-> arg3 param 0)) (the-as attack-info (-> arg3 param 1)) #f) ) ) - ((>= (- (current-time) (-> self invincible-timer)) (seconds 3)) + ((time-elapsed? (-> self invincible-timer) (seconds 3)) (cond ((and (= (-> self shield-hit-points) 0.0) (not (and (-> self next-state) (= (-> self next-state name) 'recharge))) @@ -1742,7 +1742,7 @@ ) ) (squid-take-hit (the-as touching-shapes-entry (-> arg3 param 0)) (the-as attack-info (-> arg3 param 1)) #t) - (set! (-> self invincible-timer) (current-time)) + (set-time! (-> self invincible-timer)) (squid-check-hit-points) ) ((or (!= (-> self shield-hit-points) 0.0) (and (-> self next-state) (= (-> self next-state name) 'recharge))) @@ -1777,64 +1777,64 @@ ) ;; definition for method 10 of type squid -(defmethod deactivate squid ((obj squid)) - (if (nonzero? (-> obj thruster-part)) - (kill-and-free-particles (-> obj thruster-part)) +(defmethod deactivate squid ((this squid)) + (if (nonzero? (-> this thruster-part)) + (kill-and-free-particles (-> this thruster-part)) ) - (if (-> obj rush-sound-playing) - (sound-stop (-> obj rush-sound)) + (if (-> this rush-sound-playing) + (sound-stop (-> this rush-sound)) ) - (if (-> obj jet-sound-playing) - (sound-stop (-> obj jet-sound)) + (if (-> this jet-sound-playing) + (sound-stop (-> this jet-sound)) ) - (if (-> obj spin-sound-playing) - (sound-stop (-> obj spin-sound)) + (if (-> this spin-sound-playing) + (sound-stop (-> this spin-sound)) ) - (if (-> obj tentacle-sound-playing) - (sound-stop (-> obj tentacle-sound)) + (if (-> this tentacle-sound-playing) + (sound-stop (-> this tentacle-sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type squid ;; WARN: Return type mismatch process-drawable vs squid. -(defmethod relocate squid ((obj squid) (arg0 int)) - (if (nonzero? (-> obj thruster-part)) - (&+! (-> obj thruster-part) arg0) +(defmethod relocate squid ((this squid) (arg0 int)) + (if (nonzero? (-> this thruster-part)) + (&+! (-> this thruster-part) arg0) ) - (if (nonzero? (-> obj first-path)) - (&+! (-> obj first-path) arg0) + (if (nonzero? (-> this first-path)) + (&+! (-> this first-path) arg0) ) - (if (nonzero? (-> obj second-path)) - (&+! (-> obj second-path) arg0) + (if (nonzero? (-> this second-path)) + (&+! (-> this second-path) arg0) ) - (if (nonzero? (-> obj third-path)) - (&+! (-> obj third-path) arg0) + (if (nonzero? (-> this third-path)) + (&+! (-> this third-path) arg0) ) - (if (nonzero? (-> obj gun-tilt-left-jm)) - (&+! (-> obj gun-tilt-left-jm) arg0) + (if (nonzero? (-> this gun-tilt-left-jm)) + (&+! (-> this gun-tilt-left-jm) arg0) ) - (if (nonzero? (-> obj gun-tilt-right-jm)) - (&+! (-> obj gun-tilt-right-jm) arg0) + (if (nonzero? (-> this gun-tilt-right-jm)) + (&+! (-> this gun-tilt-right-jm) arg0) ) - (if (nonzero? (-> obj tentacle-base-jm)) - (&+! (-> obj tentacle-base-jm) arg0) + (if (nonzero? (-> this tentacle-base-jm)) + (&+! (-> this tentacle-base-jm) arg0) ) - (the-as squid ((method-of-type process-drawable relocate) obj arg0)) + (the-as squid ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type squid ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! squid ((obj squid) (arg0 entity-actor)) +(defmethod init-from-entity! squid ((this squid) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate generic-attack @@ -2030,118 +2030,118 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-56 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-squid" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (logior! (-> obj skel status) (joint-control-status sync-math)) - (logior! (-> obj mask) (process-mask enemy)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj trans quad) (-> obj root trans quad)) - (set! (-> obj force-onto-mesh) #t) - (set! (-> obj mesh-forced) #f) - (quaternion-copy! (-> obj quat) (-> obj root quat)) + (set! (-> this draw light-index) (the-as uint 10)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (logior! (-> this mask) (process-mask enemy)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this trans quad) (-> this root trans quad)) + (set! (-> this force-onto-mesh) #t) + (set! (-> this mesh-forced) #f) + (quaternion-copy! (-> this quat) (-> this root quat)) (dotimes (s5-2 6) - (set! (-> obj tentacles s5-2) - (ppointer->handle (process-spawn squid-tentacle (-> obj root trans) s5-2 :to obj)) + (set! (-> this tentacles s5-2) + (ppointer->handle (process-spawn squid-tentacle (-> this root trans) s5-2 :to this)) ) ) - (set! (-> obj baron) (the-as squid-baron (process-spawn squid-baron (-> obj root trans) :to obj))) - (set! (-> obj driver) (process-spawn squid-driver "driver-" :to obj)) - (init (-> obj driver-blend) 0.0 0.0025 0.025 0.5) - (set-params! (-> obj hit-reaction) (the-as vector #f) 0.2 1.0 0.5) + (set! (-> this baron) (the-as squid-baron (process-spawn squid-baron (-> this root trans) :to this))) + (set! (-> this driver) (process-spawn squid-driver "driver-" :to this)) + (init (-> this driver-blend) 0.0 0.0025 0.025 0.5) + (set-params! (-> this hit-reaction) (the-as vector #f) 0.2 1.0 0.5) (let ((s5-6 (vector+! (new 'stack-no-clear 'vector) - (-> obj root trans) + (-> this root trans) (new 'static 'vector :x -20480.0 :y 23388.16 :z 143360.0) ) ) ) - (set! (-> obj collision-actor) (process-spawn squid-collision s5-6 0 :to obj)) + (set! (-> this collision-actor) (process-spawn squid-collision s5-6 0 :to this)) ) - (set! (-> obj blink-time) 0) - (setup-part-engine obj #t) - (set! (-> obj thruster-part) (create-launch-control (-> *part-group-id-table* 1118) obj)) + (set! (-> this blink-time) 0) + (setup-part-engine this #t) + (set! (-> this thruster-part) (create-launch-control (-> *part-group-id-table* 1118) this)) (dotimes (v1-110 10) - (set! (-> obj grenade v1-110 grenade) (the-as handle #f)) - (set! (-> obj grenade v1-110 marker) (the-as handle #f)) - (set! (-> obj grenade v1-110 show-it) #f) + (set! (-> this grenade v1-110 grenade) (the-as handle #f)) + (set! (-> this grenade v1-110 marker) (the-as handle #f)) + (set! (-> this grenade v1-110 show-it) #f) ) - (set! (-> obj gun-tilt-left-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 36)) - (set! (-> obj gun-tilt-right-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 43)) - (set! (-> obj gun-tilt) 0.0) - (set! (-> obj tentacle-base-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 6)) - (init (-> obj tentacle-base-rotation-speed) 0.0 0.01 0.1 0.9) - (set! (-> obj tentacle-base-rotation) 0.0) - (set! (-> obj first-path) (new 'process 'curve-control obj 'first -1000000000.0)) - (logior! (-> obj first-path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj second-path) (new 'process 'curve-control obj 'second -1000000000.0)) - (logior! (-> obj second-path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj third-path) (new 'process 'curve-control obj 'third -1000000000.0)) - (logior! (-> obj third-path flags) (path-control-flag display draw-line draw-point draw-text)) - (change-to (nav-mesh-from-res-tag (-> obj entity) 'nav-mesh-actor 0) obj) - (set! (-> obj current-nav-poly) #f) - (set! (-> obj shield-timer) 0) - (set! (-> obj shield-hit-points) 1.0) - (set! (-> obj shield-shattered) #f) - (set! (-> obj hit-points) 10) - (set! (-> obj invincible-timer) 0) - (set! (-> obj stage) 0) - (set! (-> obj stage-2-go-status) 0) - (set! (-> obj debug-on) #f) - (when (-> obj draw shadow) - (set! (-> obj draw shadow-ctrl) + (set! (-> this gun-tilt-left-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 36)) + (set! (-> this gun-tilt-right-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 43)) + (set! (-> this gun-tilt) 0.0) + (set! (-> this tentacle-base-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 6)) + (init (-> this tentacle-base-rotation-speed) 0.0 0.01 0.1 0.9) + (set! (-> this tentacle-base-rotation) 0.0) + (set! (-> this first-path) (new 'process 'curve-control this 'first -1000000000.0)) + (logior! (-> this first-path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this second-path) (new 'process 'curve-control this 'second -1000000000.0)) + (logior! (-> this second-path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this third-path) (new 'process 'curve-control this 'third -1000000000.0)) + (logior! (-> this third-path flags) (path-control-flag display draw-line draw-point draw-text)) + (change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0) this) + (set! (-> this current-nav-poly) #f) + (set! (-> this shield-timer) 0) + (set! (-> this shield-hit-points) 1.0) + (set! (-> this shield-shattered) #f) + (set! (-> this hit-points) 10) + (set! (-> this invincible-timer) 0) + (set! (-> this stage) 0) + (set! (-> this stage-2-go-status) 0) + (set! (-> this debug-on) #f) + (when (-> this draw shadow) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control -122880.0 4096.0 4096000.0 (shadow-flags) 819200.0) ) - (let ((v1-141 (-> obj draw shadow-ctrl))) + (let ((v1-141 (-> this draw shadow-ctrl))) (logclear! (-> v1-141 settings flags) (shadow-flags disable-draw)) ) 0 ) - (set! (-> obj hud) (the-as handle #f)) - (setup-masks (-> obj draw) 0 5440) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1124) obj)) - (set! (-> obj desired-rotate-to-vector-angle) 0.0) - (set! (-> obj allowed-rotate-to-vector-angle) 0.0) - (set! (-> obj rush-sound) (new-sound-id)) - (set! (-> obj rush-sound-playing) #f) - (set! (-> obj rush-end-time) 0) - (set! (-> obj jet-sound) (new-sound-id)) - (set! (-> obj jet-sound-playing) #f) - (set! (-> obj jet-pitch) 0) - (set! (-> obj jet-volume) 0) - (set! (-> obj tentacle-sound) (new-sound-id)) - (set! (-> obj tentacle-sound-playing) #f) - (set! (-> obj spin-sound) (new-sound-id)) - (set! (-> obj spin-sound-playing) #f) - (set! (-> obj max-plane) -1) - (set! (-> obj last-damaged-talker) 0) - (set! (-> obj last-shield-hit-talker) 0) - (set! (-> obj last-no-energy-talker) 0) - (set! (-> obj last-shooting-talker) 0) - (set! (-> obj last-headbutting-talker) 0) - (set! (-> obj last-general-talker) 0) - (set! (-> obj last-start-recharging-talker) -1) - (set! (-> obj last-done-recharging-talker) -1) - (set! (-> obj suck) (you-suck-scale *game-info* #f)) + (set! (-> this hud) (the-as handle #f)) + (setup-masks (-> this draw) 0 5440) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1124) this)) + (set! (-> this desired-rotate-to-vector-angle) 0.0) + (set! (-> this allowed-rotate-to-vector-angle) 0.0) + (set! (-> this rush-sound) (new-sound-id)) + (set! (-> this rush-sound-playing) #f) + (set! (-> this rush-end-time) 0) + (set! (-> this jet-sound) (new-sound-id)) + (set! (-> this jet-sound-playing) #f) + (set! (-> this jet-pitch) 0) + (set! (-> this jet-volume) 0) + (set! (-> this tentacle-sound) (new-sound-id)) + (set! (-> this tentacle-sound-playing) #f) + (set! (-> this spin-sound) (new-sound-id)) + (set! (-> this spin-sound-playing) #f) + (set! (-> this max-plane) -1) + (set! (-> this last-damaged-talker) 0) + (set! (-> this last-shield-hit-talker) 0) + (set! (-> this last-no-energy-talker) 0) + (set! (-> this last-shooting-talker) 0) + (set! (-> this last-headbutting-talker) 0) + (set! (-> this last-general-talker) 0) + (set! (-> this last-start-recharging-talker) -1) + (set! (-> this last-done-recharging-talker) -1) + (set! (-> this suck) (you-suck-scale *game-info* #f)) (if (task-node-closed? (game-task-node palace-boss-resolution)) - (go (method-of-object obj beaten)) - (go (method-of-object obj hidden)) + (go (method-of-object this beaten)) + (go (method-of-object this hidden)) ) (none) ) ;; definition for method 42 of type squid ;; INFO: Used lq/sq -(defmethod squid-method-42 squid ((obj squid) (arg0 vector)) +(defmethod squid-method-42 squid ((this squid) (arg0 vector)) (set! (-> arg0 quad) (-> (if *target* (get-trans *target* 3) - (-> obj nav state mesh bounds) + (-> this nav state mesh bounds) ) quad ) @@ -2151,19 +2151,19 @@ This commonly includes things such as: ;; definition for method 43 of type squid ;; WARN: Return type mismatch int vs none. -(defmethod squid-method-43 squid ((obj squid) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod squid-method-43 squid ((this squid) (arg0 vector) (arg1 float) (arg2 float)) (let ((s4-0 (new 'stack-no-clear 'matrix)) - (s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj quat))) + (s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this quat))) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s3-0 arg0 (-> obj trans)) + (vector-! s3-0 arg0 (-> this trans)) (vector-flatten! s3-0 s3-0 (-> s5-0 vector 1)) (vector-normalize! s3-0 1.0) (matrix-from-two-vectors-max-angle-partial! s4-0 (-> s5-0 vector 2) s3-0 - (fmin (-> obj allowed-rotate-to-vector-angle) arg1) + (fmin (-> this allowed-rotate-to-vector-angle) arg1) arg2 ) (let* ((v1-2 (vector-cross! (new 'stack-no-clear 'vector) s3-0 (-> s5-0 vector 2))) @@ -2172,28 +2172,28 @@ This commonly includes things such as: (if (< (vector-dot v1-2 (-> s5-0 vector 1)) 0.0) (set! f0-2 (- f0-2)) ) - (set! (-> obj desired-rotate-to-vector-angle) (asin f0-2)) + (set! (-> this desired-rotate-to-vector-angle) (asin f0-2)) ) ) (matrix*! s5-0 s5-0 s4-0) (matrix-remove-z-rot s5-0 (new 'static 'vector :y -1.0)) - (matrix->quaternion (-> obj quat) s5-0) + (matrix->quaternion (-> this quat) s5-0) ) - (quaternion-normalize! (-> obj quat)) + (quaternion-normalize! (-> this quat)) 0 (none) ) ;; definition for method 44 of type squid ;; INFO: Used lq/sq -(defmethod squid-method-44 squid ((obj squid) (arg0 vector) (arg1 vector)) +(defmethod squid-method-44 squid ((this squid) (arg0 vector) (arg1 vector)) (let ((v1-0 (new 'stack-no-clear 'collide-query))) (set! (-> v1-0 start-pos quad) (-> arg0 quad)) (vector-! (-> v1-0 move-dist) arg1 arg0) (let ((a1-1 v1-0)) (set! (-> a1-1 radius) 409.6) (set! (-> a1-1 collide-with) (collide-spec player-list special-obstacle)) - (set! (-> a1-1 ignore-process0) obj) + (set! (-> a1-1 ignore-process0) this) (set! (-> a1-1 ignore-process1) #f) (set! (-> a1-1 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> a1-1 action-mask) (collide-action solid)) @@ -2205,7 +2205,7 @@ This commonly includes things such as: ;; definition for method 45 of type squid ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod move-to-spot squid ((obj squid) (arg0 vector) (arg1 symbol)) +(defmethod move-to-spot squid ((this squid) (arg0 vector) (arg1 symbol)) (local-vars (sv-656 vector) (sv-672 vector) @@ -2234,14 +2234,14 @@ This commonly includes things such as: (let ((s3-0 (new 'stack-no-clear 'vector)) (s0-0 0) ) - (set! sv-672 (squid-method-42 obj (new 'stack-no-clear 'vector))) + (set! sv-672 (squid-method-42 this (new 'stack-no-clear 'vector))) (+! (-> sv-672 y) 8192.0) (set! (-> s3-0 quad) (-> arg0 quad)) - (set! (-> s3-0 y) (-> obj nav state mesh bounds y)) - (set! (-> obj current-nav-poly) (cloest-point-on-mesh (-> obj nav) s3-0 s3-0 (-> obj current-nav-poly))) + (set! (-> s3-0 y) (-> this nav state mesh bounds y)) + (set! (-> this current-nav-poly) (cloest-point-on-mesh (-> this nav) s3-0 s3-0 (-> this current-nav-poly))) (cond - ((-> obj current-nav-poly) - (vector-! sv-656 (-> obj nav state mesh bounds) s3-0) + ((-> this current-nav-poly) + (vector-! sv-656 (-> this nav state mesh bounds) s3-0) (set! (-> sv-656 y) 0.0) (vector-normalize! sv-656 614400.0) (let ((a2-2 (matrix-rotate-y! (new 'stack-no-clear 'matrix) -19114.668))) @@ -2255,16 +2255,16 @@ This commonly includes things such as: (set! (-> s5-0 s0-0 quad) (-> sv-656 quad)) (set! (-> sv-704 poly) #f) (clamp-vector-to-mesh-cross-gaps - (-> obj nav) + (-> this nav) s3-0 - (-> obj current-nav-poly) + (-> this current-nav-poly) (-> s5-0 s0-0) 614400.0 #f sv-704 ) (set! (-> s5-0 s0-0 quad) (-> sv-704 intersection quad)) - (set! (-> s5-0 s0-0 y) (+ 20480.0 (-> obj nav state mesh bounds y))) + (set! (-> s5-0 s0-0 y) (+ 20480.0 (-> this nav state mesh bounds y))) (cond ((not (-> sv-704 found-boundary)) ) @@ -2274,7 +2274,7 @@ This commonly includes things such as: (< f0-6 (* f1-2 f1-2)) ) ) - ((not (squid-method-44 obj (-> s5-0 s0-0) sv-672)) + ((not (squid-method-44 this (-> s5-0 s0-0) sv-672)) ) ((let ((f0-7 (vector-vector-distance-squared s3-0 (-> s5-0 s0-0))) (f1-5 81920.0) @@ -2287,7 +2287,7 @@ This commonly includes things such as: (set! (-> s1-0 quad) (-> s5-0 s0-0 quad)) (when (-> sv-704 poly) (let ((a3-2 (new 'stack-no-clear 'vector))) - (set! sv-736 (-> obj nav)) + (set! sv-736 (-> this nav)) (let ((a1-15 (-> sv-704 poly))) (set! sv-752 s1-0) (let ((v1-53 (-> s5-0 s0-0))) @@ -2320,7 +2320,7 @@ This commonly includes things such as: (else (when (-> sv-704 poly) (let ((a3-3 (new 'stack-no-clear 'vector))) - (set! sv-768 (-> obj nav)) + (set! sv-768 (-> this nav)) (let ((a1-17 (-> sv-704 poly))) (set! sv-784 (-> s5-0 s0-0)) (let ((v1-67 (-> s5-0 s0-0))) @@ -2363,11 +2363,11 @@ This commonly includes things such as: ) ) (set! (-> s3-0 y) (-> arg0 y)) - (set-traj-towards-vec obj arg0 s3-0 (-> s5-0 0)) + (set-traj-towards-vec this arg0 s3-0 (-> s5-0 0)) ) ) (else - (format 0 "~A bad current poly~%" (-> obj name)) + (format 0 "~A bad current poly~%" (-> this name)) ) ) ) @@ -2381,82 +2381,82 @@ This commonly includes things such as: ;; definition for method 46 of type squid ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod set-traj-towards-vec squid ((obj squid) (src vector) (arg2 vector) (dest vector)) +(defmethod set-traj-towards-vec squid ((this squid) (src vector) (arg2 vector) (dest vector)) "Set up the [[trajectory]] towards `dest`." - (set! (-> obj traj-timer) (current-time)) - (set! (-> obj traj-src quad) (-> src quad)) - (set! (-> obj traj-dest quad) (-> dest quad)) - (set! (-> obj traj-duration) (* 0.00091552734 (vector-vector-xz-distance arg2 dest))) - (set! (-> obj traj-duration) (fmax 480.0 (-> obj traj-duration))) + (set-time! (-> this traj-timer)) + (set! (-> this traj-src quad) (-> src quad)) + (set! (-> this traj-dest quad) (-> dest quad)) + (set! (-> this traj-duration) (* 0.00091552734 (vector-vector-xz-distance arg2 dest))) + (set! (-> this traj-duration) (fmax 480.0 (-> this traj-duration))) (let ((f0-4 49152.0)) (if (< (-> arg2 y) (-> dest y)) (+! f0-4 (- (-> dest y) (-> arg2 y))) ) - (setup-from-to-duration-and-height! (-> obj traj) arg2 dest 1.0 f0-4) + (setup-from-to-duration-and-height! (-> this traj) arg2 dest 1.0 f0-4) ) - (set! (-> obj residual-accumulator-1) 1.0) - (set! (-> obj residual-accumulator-2) 0.0) + (set! (-> this residual-accumulator-1) 1.0) + (set! (-> this residual-accumulator-2) 0.0) 0 (none) ) ;; definition for method 47 of type squid -(defmethod float-sin-clamp squid ((obj squid) (arg0 float)) +(defmethod float-sin-clamp squid ((this squid) (arg0 float)) (parameter-ease-sin-clamp (* 0.6366198 arg0)) ) ;; definition for method 48 of type squid ;; INFO: Used lq/sq -(defmethod squid-method-48 squid ((obj squid)) - (when (< 0.00001 (-> obj residual-accumulator-1)) - (set! (-> obj residual-accumulator-1) (* 0.95 (-> obj residual-accumulator-1))) - (+! (-> obj residual-accumulator-2) (-> obj residual-accumulator-1)) +(defmethod squid-method-48 squid ((this squid)) + (when (< 0.00001 (-> this residual-accumulator-1)) + (set! (-> this residual-accumulator-1) (* 0.95 (-> this residual-accumulator-1))) + (+! (-> this residual-accumulator-2) (-> this residual-accumulator-1)) ) (let* ((f28-0 ((method-of-type trajectory compute-time-until-apex) - (the-as trajectory (&-> (the-as squid-grenade (-> obj self)) ignore-handle)) + (the-as trajectory (&-> (the-as squid-grenade (-> this self)) ignore-handle)) ) ) - (s3-0 (compute-trans-at-time (-> obj traj) f28-0 (new 'stack-no-clear 'vector))) + (s3-0 (compute-trans-at-time (-> this traj) f28-0 (new 'stack-no-clear 'vector))) (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) - (f30-0 (/ (the float (- (current-time) (-> obj traj-timer))) (-> obj traj-duration))) + (f30-0 (/ (the float (- (current-time) (-> this traj-timer))) (-> this traj-duration))) ) - (let ((f26-0 (float-sin-clamp obj f30-0))) - (when (and (-> obj can-play-squid-boost) (< 0.125 f30-0)) - (set! (-> obj can-play-squid-boost) #f) + (let ((f26-0 (float-sin-clamp this f30-0))) + (when (and (-> this can-play-squid-boost) (< 0.125 f30-0)) + (set! (-> this can-play-squid-boost) #f) (sound-play "squid-boost") ) (cond ((< f26-0 1.0) - (compute-trans-at-time (-> obj traj) f26-0 s5-0) - (set! (-> s4-0 quad) (-> obj traj-src quad)) - (+! (-> s4-0 y) (* 204.8 (the float (- (current-time) (-> obj traj-timer))) (/ f26-0 f30-0))) - (vector+float*! s4-0 s4-0 (-> obj residual-velocity) (-> obj residual-accumulator-2)) + (compute-trans-at-time (-> this traj) f26-0 s5-0) + (set! (-> s4-0 quad) (-> this traj-src quad)) + (+! (-> s4-0 y) (* 204.8 (the float (- (current-time) (-> this traj-timer))) (/ f26-0 f30-0))) + (vector+float*! s4-0 s4-0 (-> this residual-velocity) (-> this residual-accumulator-2)) (vector-lerp! s5-0 s4-0 s5-0 f26-0) (cond ((< f28-0 f26-0) (let ((f28-1 (/ (- f26-0 f28-0) (- 1.0 f28-0)))) - (vector-lerp! s4-0 s3-0 (-> obj traj-dest) f28-1) + (vector-lerp! s4-0 s3-0 (-> this traj-dest) f28-1) (vector-lerp! s5-0 s5-0 s4-0 f28-1) ) - (squid-method-43 obj (squid-method-42 obj (new 'stack-no-clear 'vector)) 1092.2667 0.05) - (vector-! s4-0 (-> obj traj-dest) (-> obj trans)) + (squid-method-43 this (squid-method-42 this (new 'stack-no-clear 'vector)) 1092.2667 0.05) + (vector-! s4-0 (-> this traj-dest) (-> this trans)) (vector-normalize! s4-0 1.75) (dotimes (s3-2 6) - (send-event (handle->process (-> obj tentacles s3-2)) 'set-gravity s4-0) + (send-event (handle->process (-> this tentacles s3-2)) 'set-gravity s4-0) ) ) (else - (squid-method-43 obj (-> obj traj-dest) 546.13336 0.005) + (squid-method-43 this (-> this traj-dest) 546.13336 0.005) ) ) - (set! (-> obj trans quad) (-> s5-0 quad)) + (set! (-> this trans quad) (-> s5-0 quad)) ) (else (dotimes (s5-1 6) - (send-event (handle->process (-> obj tentacles s5-1)) 'set-gravity-slow (new 'static 'vector :y -1.0)) + (send-event (handle->process (-> this tentacles s5-1)) 'set-gravity-slow (new 'static 'vector :y -1.0)) ) - (set! (-> obj trans quad) (-> obj traj-dest quad)) + (set! (-> this trans quad) (-> this traj-dest quad)) ) ) ) @@ -2466,65 +2466,65 @@ This commonly includes things such as: ;; definition for method 49 of type squid ;; WARN: Return type mismatch int vs none. -(defmethod setup-part-engine squid ((obj squid) (arg0 symbol)) - (when (>= (- (current-time) (-> obj blink-time)) 0) - (set! (-> obj blink-mask) 0) +(defmethod setup-part-engine squid ((this squid) (arg0 symbol)) + (when (>= (- (current-time) (-> this blink-time)) 0) + (set! (-> this blink-mask) 0) (dotimes (s5-0 10) (let* ((f30-0 0.5) (v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-7 (the-as number (logior #x3f800000 v1-6))) ) (if (< f30-0 (+ -1.0 (the-as float v1-7))) - (logior! (-> obj blink-mask) (ash 1 s5-0)) + (logior! (-> this blink-mask) (ash 1 s5-0)) ) ) ) - (set! (-> obj blink-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.75))))) + (set! (-> this blink-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.75))))) (set! arg0 #t) ) (when arg0 - (remove-from-process *part-engine* obj) + (remove-from-process *part-engine* this) (add-connection *part-engine* - obj + this 5 - obj + this 4790 (new 'static 'vector :x -5906.432 :y 3317.76 :z -409.6 :w 819200.0) ) (add-connection *part-engine* - obj + this 5 - obj + this 4790 (new 'static 'vector :x 5906.432 :y 3317.76 :z -409.6 :w 819200.0) ) - (add-connection *part-engine* obj 6 obj 4791 (new 'static 'vector :y 3366.912 :w 819200.0)) - (add-connection *part-engine* obj 13 obj 4791 (new 'static 'vector :y 11993.088 :z 5255.168 :w 819200.0)) + (add-connection *part-engine* this 6 this 4791 (new 'static 'vector :y 3366.912 :w 819200.0)) + (add-connection *part-engine* this 13 this 4791 (new 'static 'vector :y 11993.088 :z 5255.168 :w 819200.0)) (add-connection *part-engine* - obj + this 5 - obj + this 4792 (new 'static 'vector :x 5439.488 :y -1794.048 :z 11444.224 :w 819200.0) ) (add-connection *part-engine* - obj + this 5 - obj + this 4792 (new 'static 'vector :x -5439.488 :y -1794.048 :z 11444.224 :w 819200.0) ) - (let ((s5-2 (-> obj blink-mask))) + (let ((s5-2 (-> this blink-mask))) (if (logtest? s5-2 1) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x -4128.768 :y 2355.2 :z 3653.632 :w 819200.0) ) @@ -2532,9 +2532,9 @@ This commonly includes things such as: (if (logtest? s5-2 2) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x -4554.752 :y 2449.408 :z 2359.296 :w 819200.0) ) @@ -2542,9 +2542,9 @@ This commonly includes things such as: (if (logtest? s5-2 4) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x -4386.816 :y 2191.36 :z 528.384 :w 819200.0) ) @@ -2552,9 +2552,9 @@ This commonly includes things such as: (if (logtest? s5-2 8) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x -5832.704 :y 2945.024 :z 1691.648 :w 819200.0) ) @@ -2562,9 +2562,9 @@ This commonly includes things such as: (if (logtest? s5-2 16) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x -5861.376 :y 2920.448 :z 1118.208 :w 819200.0) ) @@ -2572,9 +2572,9 @@ This commonly includes things such as: (if (logtest? s5-2 32) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x 4128.768 :y 2355.2 :z 3653.632 :w 819200.0) ) @@ -2582,9 +2582,9 @@ This commonly includes things such as: (if (logtest? s5-2 64) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x 4554.752 :y 2449.408 :z 2359.296 :w 819200.0) ) @@ -2592,9 +2592,9 @@ This commonly includes things such as: (if (logtest? s5-2 128) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x 4386.816 :y 2191.36 :z -528.384 :w 819200.0) ) @@ -2602,9 +2602,9 @@ This commonly includes things such as: (if (logtest? s5-2 256) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x 5832.704 :y 2945.024 :z 1691.648 :w 819200.0) ) @@ -2612,9 +2612,9 @@ This commonly includes things such as: (if (logtest? s5-2 512) (add-connection *part-engine* - obj + this 5 - obj + this 4793 (new 'static 'vector :x 5861.376 :y 2920.448 :z 1118.208 :w 819200.0) ) @@ -2628,7 +2628,7 @@ This commonly includes things such as: ;; definition for method 50 of type squid ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod squid-post squid ((obj squid)) +(defmethod squid-post squid ((this squid)) (local-vars (v0-33 object) (s5-9 int) @@ -2637,31 +2637,31 @@ This commonly includes things such as: ) ) (with-pp - (if (= (-> obj stage) 2) + (if (= (-> this stage) 2) (script-eval '(want-anim "palace-boss-res")) ) - (when (-> obj force-onto-mesh) + (when (-> this force-onto-mesh) (let ((s5-0 (new 'stack-no-clear 'vector))) - (set! (-> s5-0 quad) (-> obj trans quad)) - (set! (-> obj trans y) (-> obj nav state mesh bounds y)) - (set! (-> obj current-nav-poly) - (cloest-point-on-mesh (-> obj nav) (-> obj trans) (-> obj trans) (-> obj current-nav-poly)) + (set! (-> s5-0 quad) (-> this trans quad)) + (set! (-> this trans y) (-> this nav state mesh bounds y)) + (set! (-> this current-nav-poly) + (cloest-point-on-mesh (-> this nav) (-> this trans) (-> this trans) (-> this current-nav-poly)) ) - (set! (-> obj trans y) (-> s5-0 y)) + (set! (-> this trans y) (-> s5-0 y)) (let ((f0-2 409.6)) - (set! (-> obj mesh-forced) (< (* f0-2 f0-2) (vector-vector-distance-squared (-> obj trans) s5-0))) + (set! (-> this mesh-forced) (< (* f0-2 f0-2) (vector-vector-distance-squared (-> this trans) s5-0))) ) ) ) - (setup-part-engine obj #f) - (update! (-> obj driver-blend) 0.0) + (setup-part-engine this #f) + (update! (-> this driver-blend) 0.0) (let ((s4-0 (new 'stack-no-clear 'matrix)) (s5-1 (new 'stack-no-clear 'vector)) - (f30-1 (parameter-ease-sin-clamp (-> obj driver-blend value))) + (f30-1 (parameter-ease-sin-clamp (-> this driver-blend value))) ) (matrix-identity! s4-0) - (send-event (ppointer->process (-> obj driver)) 'matrix s4-0) - (vector+float*! (-> obj root trans) (-> obj trans) (-> s4-0 trans) f30-1) + (send-event (ppointer->process (-> this driver)) 'matrix s4-0) + (vector+float*! (-> this root trans) (-> this trans) (-> s4-0 trans) f30-1) (matrix->quaternion (the-as quaternion s5-1) s4-0) (cond ((< (-> s5-1 w) (cos 1.8204443)) @@ -2671,54 +2671,54 @@ This commonly includes things such as: (vector-float*! s5-1 s5-1 (/ (sin f30-2) (sin f28-1))) (set! (-> s5-1 w) (cos f30-2)) ) - (quaternion-normalize! (quaternion*! (-> obj root quat) (the-as quaternion s5-1) (-> obj quat))) + (quaternion-normalize! (quaternion*! (-> this root quat) (the-as quaternion s5-1) (-> this quat))) ) (else - (quaternion-copy! (-> obj root quat) (-> obj quat)) + (quaternion-copy! (-> this root quat) (-> this quat)) ) ) ) - (update! (-> obj hit-reaction) (the-as vector #f)) - (vector+float*! (-> obj root trans) (-> obj root trans) (the-as vector (-> obj hit-reaction)) 4096.0) - (update! (-> obj tentacle-base-rotation-speed) 0.0) - (let ((f0-14 (+ (-> obj tentacle-base-rotation) (* 910.2222 (-> obj tentacle-base-rotation-speed value))))) - (set! (-> obj tentacle-base-rotation) (- f0-14 (* (the float (the int (/ f0-14 65536.0))) 65536.0))) + (update! (-> this hit-reaction) (the-as vector #f)) + (vector+float*! (-> this root trans) (-> this root trans) (the-as vector (-> this hit-reaction)) 4096.0) + (update! (-> this tentacle-base-rotation-speed) 0.0) + (let ((f0-14 (+ (-> this tentacle-base-rotation) (* 910.2222 (-> this tentacle-base-rotation-speed value))))) + (set! (-> this tentacle-base-rotation) (- f0-14 (* (the float (the int (/ f0-14 65536.0))) 65536.0))) ) (quaternion-set! - (-> obj tentacle-base-jm quat) + (-> this tentacle-base-jm quat) 0.0 - (sin (-> obj tentacle-base-rotation)) + (sin (-> this tentacle-base-rotation)) 0.0 - (cos (-> obj tentacle-base-rotation)) + (cos (-> this tentacle-base-rotation)) ) - (when (< 0.5 (-> obj tentacle-base-rotation-speed value)) + (when (< 0.5 (-> this tentacle-base-rotation-speed value)) (let ((s5-3 (new 'stack-no-clear 'vector))) (let ((s4-5 (new 'stack-no-clear 'vector))) - (vector<-cspace! s5-3 (-> obj node-list data 6)) - (vector-normalize-copy! s4-5 (-> obj node-list data 6 bone transform vector 1) 16384.0) + (vector<-cspace! s5-3 (-> this node-list data 6)) + (vector-normalize-copy! s4-5 (-> this node-list data 6 bone transform vector 1) 16384.0) (vector+! s5-3 s5-3 s4-5) ) (dotimes (s4-6 6) - (send-event (handle->process (-> obj tentacles s4-6)) 'avoid-center s5-3) + (send-event (handle->process (-> this tentacles s4-6)) 'avoid-center s5-3) ) ) ) - (if (or (zero? (-> obj stage)) (or (and (= (-> obj stage) 1) (>= (-> obj max-plane) 8)) - (and (= (-> obj stage) 2) - (>= (-> obj max-plane) 24) - (not (and (-> obj next-state) (= (-> obj next-state name) 'flee))) - ) - ) + (if (or (zero? (-> this stage)) (or (and (= (-> this stage) 1) (>= (-> this max-plane) 8)) + (and (= (-> this stage) 2) + (>= (-> this max-plane) 24) + (not (and (-> this next-state) (= (-> this next-state name) 'flee))) + ) + ) ) - (set-setting! 'point-of-interest 'abs (-> obj trans) 0) + (set-setting! 'point-of-interest 'abs (-> this trans) 0) (remove-setting! 'point-of-interest) ) (transform-post) - (do-push-aways (-> obj root)) + (do-push-aways (-> this root)) (dotimes (s5-4 10) - (let ((a0-46 (handle->process (-> obj grenade s5-4 marker)))) + (let ((a0-46 (handle->process (-> this grenade s5-4 marker)))) (when a0-46 - (if (and (not (-> obj grenade s5-4 show-it)) (not (handle->process (-> obj grenade s5-4 grenade)))) + (if (and (not (-> this grenade s5-4 show-it)) (not (handle->process (-> this grenade s5-4 grenade)))) (deactivate a0-46) ) ) @@ -2734,146 +2734,148 @@ This commonly includes things such as: (set! (-> a1-25 from) (process->ppointer pp)) (set! (-> a1-25 num-params) 0) (set! (-> a1-25 message) 'get-num-bg-collisions) - (set! s5-5 (max s5-6 (the-as int (send-event-function (handle->process (-> obj tentacles s4-7)) a1-25)))) + (set! s5-5 (max s5-6 (the-as int (send-event-function (handle->process (-> this tentacles s4-7)) a1-25)))) ) (let ((a1-26 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-26 from) (process->ppointer pp)) (set! (-> a1-26 num-params) 0) (set! (-> a1-26 message) 'get-max-movement) - (set! f30-3 (fmax f30-3 (the-as float (send-event-function (handle->process (-> obj tentacles s4-7)) a1-26)))) + (set! f30-3 + (fmax f30-3 (the-as float (send-event-function (handle->process (-> this tentacles s4-7)) a1-26))) + ) ) ) (set! v0-33 (cond - ((or (and (not (-> obj tentacle-sound-playing)) (>= s5-5 5) (>= f30-3 1638.4)) - (or (and (-> obj next-state) (= (-> obj next-state name) 'recharge)) - (let ((v1-123 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((or (and (not (-> this tentacle-sound-playing)) (>= s5-5 5) (>= f30-3 1638.4)) + (or (and (-> this next-state) (= (-> this next-state name) 'recharge)) + (let ((v1-123 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-123 (= v1-123 (-> obj draw art-group data 5))) + (and v1-123 (= v1-123 (-> this draw art-group data 5))) ) ) ) - (sound-play "tentacles1" :id (-> obj tentacle-sound) :position (-> obj root trans)) + (sound-play "tentacles1" :id (-> this tentacle-sound) :position (-> this root trans)) (set! v0-33 #t) - (set! (-> obj tentacle-sound-playing) (the-as symbol v0-33)) + (set! (-> this tentacle-sound-playing) (the-as symbol v0-33)) v0-33 ) - ((and (-> obj tentacle-sound-playing) (< s5-5 3)) - (sound-stop (-> obj tentacle-sound)) - (set! (-> obj tentacle-sound-playing) #f) + ((and (-> this tentacle-sound-playing) (< s5-5 3)) + (sound-stop (-> this tentacle-sound)) + (set! (-> this tentacle-sound-playing) #f) (sound-play "tentacles-up") ) - ((-> obj tentacle-sound-playing) - (sound-play "tentacles1" :id (-> obj tentacle-sound) :position (-> obj root trans)) + ((-> this tentacle-sound-playing) + (sound-play "tentacles1" :id (-> this tentacle-sound) :position (-> this root trans)) ) ) ) ) - (when (-> obj rush-sound-playing) + (when (-> this rush-sound-playing) (cond - ((or (zero? (-> obj rush-end-time)) (< (- (current-time) (-> obj rush-end-time)) (seconds 0.1))) - (the-as int (sound-play "squid-rush" :id (-> obj rush-sound) :position (-> obj root trans))) + ((or (zero? (-> this rush-end-time)) (not (time-elapsed? (-> this rush-end-time) (seconds 0.1)))) + (the-as int (sound-play "squid-rush" :id (-> this rush-sound) :position (-> this root trans))) ) (else - (sound-stop (-> obj rush-sound)) - (set! (-> obj rush-sound-playing) #f) - (set! (-> obj rush-end-time) 0) + (sound-stop (-> this rush-sound)) + (set! (-> this rush-sound-playing) #f) + (set! (-> this rush-end-time) 0) 0 ) ) ) - (let ((v1-149 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-149 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((or (and v1-149 (= v1-149 (-> obj draw art-group data 33))) - (let ((v1-155 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((or (and v1-149 (= v1-149 (-> this draw art-group data 33))) + (let ((v1-155 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (or (and (and v1-155 (= v1-155 (-> obj draw art-group data 35))) (< -11.0 (ja-aframe-num 0))) - (and (-> obj next-state) (= (-> obj next-state name) 'pre-flee)) + (or (and (and v1-155 (= v1-155 (-> this draw art-group data 35))) (< -11.0 (ja-aframe-num 0))) + (and (-> this next-state) (= (-> this next-state name) 'pre-flee)) ) ) ) - (when (-> obj jet-sound-playing) - (sound-stop (-> obj jet-sound)) - (set! (-> obj jet-sound-playing) #f) + (when (-> this jet-sound-playing) + (sound-stop (-> this jet-sound)) + (set! (-> this jet-sound-playing) #f) ) ) (else - (let* ((f0-23 (fmin 1.0 (* 0.0011111111 (the float (- (current-time) (the-as time-frame (-> obj jet-pitch))))))) - (f28-2 (fmin 1.0 (* 0.006666667 (the float (- (current-time) (the-as time-frame (-> obj jet-volume))))))) + (let* ((f0-23 (fmin 1.0 (* 0.0011111111 (the float (- (current-time) (the-as time-frame (-> this jet-pitch))))))) + (f28-2 (fmin 1.0 (* 0.006666667 (the float (- (current-time) (the-as time-frame (-> this jet-volume))))))) (f30-6 (* 0.2 (- 1.0 f0-23) (sin (* 32768.0 f0-23)))) (f0-31 (+ 1.0 (* 5.0 (- 1.0 f28-2) (sin (* 32768.0 f30-6))))) ) - (if (-> obj negate-jet-pitch) + (if (-> this negate-jet-pitch) (set! f30-6 (- f30-6)) ) (sound-play-by-name (static-sound-name "squid-jets") - (-> obj jet-sound) + (-> this jet-sound) (the int (* 1024.0 f0-31)) (the int (* 1524.0 f30-6)) 0 (sound-group sfx) - (-> obj root trans) + (-> this root trans) ) ) - (set! (-> obj jet-sound-playing) #t) + (set! (-> this jet-sound-playing) #t) ) ) ) - (let ((v1-193 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-193 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (when (and (not (and v1-193 (= v1-193 (-> obj draw art-group data 33)))) - (let ((v1-199 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (and (not (and v1-193 (= v1-193 (-> this draw art-group data 33)))) + (let ((v1-199 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (not (and (and v1-199 (= v1-199 (-> obj draw art-group data 35))) (< -11.0 (ja-aframe-num 0)))) + (not (and (and v1-199 (= v1-199 (-> this draw art-group data 35))) (< -11.0 (ja-aframe-num 0)))) ) ) (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 0.0) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 24)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 25)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 32)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 33)) (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 10922.667) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 24)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 25)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 32)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 33)) (set! (-> *part-id-table* 4812 init-specs 12 initial-valuef) 21845.334) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 24)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 25)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 32)) - (spawn-with-cspace (-> obj thruster-part) (-> obj node-list data 33)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 24)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 25)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 32)) + (spawn-with-cspace (-> this thruster-part) (-> this node-list data 33)) ) ) - (when (not (and (-> obj next-state) (= (-> obj next-state name) 'recharge))) - (let ((v1-249 (the int (lerp-scale 0.0 128.0 (the float (- (current-time) (-> obj shield-timer))) 0.0 600.0)))) + (when (not (and (-> this next-state) (= (-> this next-state name) 'recharge))) + (let ((v1-249 (the int (lerp-scale 0.0 128.0 (the float (- (current-time) (-> this shield-timer))) 0.0 600.0)))) (cond - ((< 0.0 (-> obj shield-hit-points)) + ((< 0.0 (-> this shield-hit-points)) (set! s5-9 (min 100 v1-249)) - (set! (-> obj shield-shattered) #f) + (set! (-> this shield-shattered) #f) ) ((< 16 v1-249) (set! s5-9 128) - (when (not (-> obj shield-shattered)) - (set! (-> obj shield-shattered) #t) + (when (not (-> this shield-shattered)) + (set! (-> this shield-shattered) #t) (sound-play "sqd-shield-brk") (let ((s4-10 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) - (set! (-> s4-10 fountain-rand-transv-lo quad) (-> obj root trans quad)) + (set! (-> s4-10 fountain-rand-transv-lo quad) (-> this root trans quad)) (+! (-> s4-10 fountain-rand-transv-lo y) -12288.0) (set! (-> s4-10 fountain-rand-transv-hi x) 16424.96) (set! (-> s4-10 fountain-rand-transv-hi y) 32808.96) @@ -2887,11 +2889,11 @@ This commonly includes things such as: 70 s4-10 *squid-shield-exploder-params* - :to obj + :to this :stack-size #x8000 ) (dotimes (s3-4 6) - (let ((s1-2 (handle->process (-> obj tentacles s3-4)))) + (let ((s1-2 (handle->process (-> this tentacles s3-4)))) (when s1-2 (let ((s2-2 (get-process *default-dead-pool* joint-exploder #x4000))) (when s2-2 @@ -2929,16 +2931,16 @@ This commonly includes things such as: ) ) ) - (set! (-> obj draw force-fade) (the-as uint s5-9)) + (set! (-> this draw force-fade) (the-as uint s5-9)) (dotimes (s4-11 6) - (send-event (handle->process (-> obj tentacles s4-11)) 'set-fade s5-9) + (send-event (handle->process (-> this tentacles s4-11)) 'set-fade s5-9) ) - (let* ((f0-56 (lerp-scale 0.5 0.0 (the float (- (current-time) (-> obj shield-timer))) 0.0 75.0)) + (let* ((f0-56 (lerp-scale 0.5 0.0 (the float (- (current-time) (-> this shield-timer))) 0.0 75.0)) (a0-147 - (vector-float*! (new 'stack-no-clear 'vector) (-> obj shield-color) (if (< 0.0 (-> obj shield-hit-points)) - f0-56 - (- 1.0 f0-56) - ) + (vector-float*! (new 'stack-no-clear 'vector) (-> this shield-color) (if (< 0.0 (-> this shield-hit-points)) + f0-56 + (- 1.0 f0-56) + ) ) ) ) @@ -2946,52 +2948,52 @@ This commonly includes things such as: (set-shield-flash! a0-147) ) (cond - ((>= (-> obj draw force-fade) (the-as uint 128)) - (setup-masks (-> obj draw) 0 8192) - (logclear! (-> obj draw status) (draw-control-status warp-cross-fade)) + ((>= (-> this draw force-fade) (the-as uint 128)) + (setup-masks (-> this draw) 0 8192) + (logclear! (-> this draw status) (draw-control-status warp-cross-fade)) ) (else - (setup-masks (-> obj draw) 8192 0) - (logior! (-> obj draw status) (draw-control-status warp-cross-fade)) + (setup-masks (-> this draw) 8192 0) + (logior! (-> this draw status) (draw-control-status warp-cross-fade)) ) ) ) - (let ((v1-316 (handle->process (-> obj hud)))) + (let ((v1-316 (handle->process (-> this hud)))) (when v1-316 - (if (not (and (-> obj next-state) (= (-> obj next-state name) 'recharge))) - (set! (-> (the-as hud-squid v1-316) values 2 target) (the int (* 100.0 (-> obj shield-hit-points)))) + (if (not (and (-> this next-state) (= (-> this next-state name) 'recharge))) + (set! (-> (the-as hud-squid v1-316) values 2 target) (the int (* 100.0 (-> this shield-hit-points)))) ) (cond - ((and (zero? (-> obj hit-points)) (< (-> obj stage) 2)) - (set! (-> (the-as hud-squid v1-316) values 0 target) (+ (-> obj stage) 1)) + ((and (zero? (-> this hit-points)) (< (-> this stage) 2)) + (set! (-> (the-as hud-squid v1-316) values 0 target) (+ (-> this stage) 1)) (set! (-> (the-as hud-squid v1-316) values 1 target) 100) ) (else - (set! (-> (the-as hud-squid v1-316) values 0 target) (-> obj stage)) - (set! (-> (the-as hud-squid v1-316) values 1 target) (/ (* 100 (-> obj hit-points)) 10)) + (set! (-> (the-as hud-squid v1-316) values 0 target) (-> this stage)) + (set! (-> (the-as hud-squid v1-316) values 1 target) (/ (* 100 (-> this hit-points)) 10)) ) ) ) ) - (set! (-> obj allowed-rotate-to-vector-angle) (fabs (-> obj desired-rotate-to-vector-angle))) + (set! (-> this allowed-rotate-to-vector-angle) (fabs (-> this desired-rotate-to-vector-angle))) (none) ) ) ;; definition for method 51 of type squid ;; WARN: Return type mismatch (pointer process) vs (pointer squid-whirlwind). -(defmethod spawn-whirlwind squid ((obj squid)) +(defmethod spawn-whirlwind squid ((this squid)) (let ((gp-0 (new 'stack-no-clear 'vector)) - (s4-0 (squid-method-42 obj (new 'stack-no-clear 'vector))) + (s4-0 (squid-method-42 this (new 'stack-no-clear 'vector))) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (send-event (handle->process (-> obj tentacles 0)) 'get-joint-pos 13 gp-0) - (vector-! s4-0 s4-0 (-> obj root trans)) + (send-event (handle->process (-> this tentacles 0)) 'get-joint-pos 13 gp-0) + (vector-! s4-0 s4-0 (-> this root trans)) (set! (-> s4-0 y) 0.0) (vector-normalize! s4-0 1.0) - (vector+float*! s3-0 (-> obj root trans) s4-0 16384.0) + (vector+float*! s3-0 (-> this root trans) s4-0 16384.0) ) - (process-spawn squid-whirlwind gp-0 (-> obj root trans) (-> obj nav state mesh) s4-0 :to obj) + (process-spawn squid-whirlwind gp-0 (-> this root trans) (-> this nav state mesh) s4-0 :to this) ) ) @@ -3013,19 +3015,19 @@ This commonly includes things such as: ;; definition for method 52 of type squid ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-grenade squid ((obj squid) (arg0 int) (arg1 squid-grenade-holder) (arg2 float)) +(defmethod spawn-grenade squid ((this squid) (arg0 int) (arg1 squid-grenade-holder) (arg2 float)) (squid-increment-shield (+ -0.001 (/ -1.0 (* 2.0 (the float (* (squid-num-grenades-to-shoot) 2)))))) (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) - (let ((a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg0))) + (let ((a0-3 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg0))) (v1-6 (-> arg1 target-position)) ) - (set! (-> s4-1 ent) (-> obj entity)) + (set! (-> s4-1 ent) (-> this entity)) (set! (-> s4-1 charge) arg2) (set! (-> s4-1 options) (projectile-options)) (set! (-> s4-1 pos quad) (-> a0-3 quad)) - (set! (-> s4-1 notify-handle) (process->handle obj)) + (set! (-> s4-1 notify-handle) (process->handle this)) (set! (-> s4-1 owner-handle) (the-as handle #f)) - (set! (-> s4-1 ignore-handle) (process->handle obj)) + (set! (-> s4-1 ignore-handle) (process->handle this)) (let* ((a1-11 *game-info*) (a2-12 (+ (-> a1-11 attack-id) 1)) ) @@ -3035,7 +3037,7 @@ This commonly includes things such as: (set! (-> s4-1 timeout) (seconds 4)) (vector-! (-> s4-1 vel) v1-6 a0-3) ) - (set! (-> arg1 grenade) (ppointer->handle (spawn-projectile squid-grenade s4-1 obj *default-dead-pool*))) + (set! (-> arg1 grenade) (ppointer->handle (spawn-projectile squid-grenade s4-1 this *default-dead-pool*))) ) (set! (-> arg1 show-it) #f) (none) @@ -3051,21 +3053,21 @@ This commonly includes things such as: ) ;; definition for method 3 of type squid-shot -(defmethod inspect squid-shot ((obj squid-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect squid-shot ((this squid-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type guard-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 28 of type squid-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound squid-shot ((obj squid-shot) (arg0 projectile-options)) +(defmethod play-impact-sound squid-shot ((this squid-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -3108,30 +3110,30 @@ This commonly includes things such as: ;; definition for method 31 of type squid-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! squid-shot ((obj squid-shot)) +(defmethod init-proj-settings! squid-shot ((this squid-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj hit-actor?) #f) - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'squid-shot) - (set! (-> obj max-speed) 983040.0) - (set! (-> obj move) squid-shot-move) - (set! (-> obj update-velocity) projectile-update-velocity-space-wars) - (set! (-> obj timeout) (seconds 0.417)) - (logior! (-> obj options) (projectile-options account-for-target-velocity)) - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj options) (projectile-options respect-invinc-time)) - (set! (-> obj invinc-time) (seconds 3.5)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'squid-shot) + (set! (-> this max-speed) 983040.0) + (set! (-> this move) squid-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.417)) + (logior! (-> this options) (projectile-options account-for-target-velocity)) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this options) (projectile-options respect-invinc-time)) + (set! (-> this invinc-time) (seconds 3.5)) (none) ) ;; definition for method 24 of type squid-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight squid-shot ((obj squid-shot)) +(defmethod draw-laser-sight squid-shot ((this squid-shot)) "TODO - confirm If applicable, draw the laser sight particles" - (draw-beam (-> *part-id-table* 4861) (-> obj tail-pos) (-> obj starting-dir) #f #t) - (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 2048.0)) - (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> obj tail-pos) a0-3)) + (draw-beam (-> *part-id-table* 4861) (-> this tail-pos) (-> this starting-dir) #f #t) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) (t9-2 sp-launch-particles-var) (a0-4 *sp-particle-system-2d*) (a1-4 (-> *part-id-table* 4862)) @@ -3147,10 +3149,10 @@ This commonly includes things such as: ;; definition for method 25 of type squid-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles squid-shot ((obj squid-shot)) +(defmethod spawn-impact-particles squid-shot ((this squid-shot)) "Spawns associated particles with the projectile if applicable" - (let* ((gp-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) (f30-0 (vector-length s5-1)) ) @@ -3184,18 +3186,18 @@ This commonly includes things such as: ;; definition for method 26 of type squid-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles squid-shot ((obj squid-shot)) +(defmethod spawn-shell-particles squid-shot ((this squid-shot)) "TODO - confirm" - (let* ((s3-0 (-> obj root)) - (s4-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s3-0 trans)) 2048.0)) + (let* ((s3-0 (-> this root)) + (s4-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s3-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> s3-0 trans quad)) - (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 trans) (-> obj tail-pos)))) + (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 trans) (-> this tail-pos)))) (set! (-> *part-id-table* 4857 init-specs 4 initial-valuef) (vector-length a2-1)) (set! (-> *part-id-table* 4857 init-specs 11 initial-valuef) (the-as float #x28)) (set! (-> *part-id-table* 4857 init-specs 10 initial-valuef) -3.2) - (draw-beam (-> *part-id-table* 4857) (-> obj tail-pos) a2-1 #f #t) + (draw-beam (-> *part-id-table* 4857) (-> this tail-pos) a2-1 #f #t) ) (vector+! gp-0 gp-0 s4-0) (let ((s5-1 (get-process *default-dead-pool* part-tracker #x4000))) diff --git a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc index 73daf524d3..115dcff1c0 100644 --- a/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/boss/squid-states_REF.gc @@ -222,13 +222,13 @@ (defstate test (squid) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (ja :num! (loop!)) - (when (>= (- (current-time) (-> self state-time)) (seconds 2)) + (when (time-elapsed? (-> self state-time) (seconds 2)) (set! (-> self driver-blend target) (- 1.0 (-> self driver-blend target))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (debug-draw (-> self first-path)) (debug-draw (-> self second-path)) @@ -500,7 +500,7 @@ :virtual #t :event squid-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self traj-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.5))))) (set! (-> self traj initial-position quad) (-> self trans quad)) (let ((v1-7 (-> self stage))) @@ -553,7 +553,7 @@ (-> self traj-dest) (parameter-ease-sqr-clamp (* 0.0011111111 (the float (- (current-time) (-> self state-time))))) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go-virtual flee) ) (spawn (-> self part) (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 55))) @@ -685,7 +685,7 @@ :event squid-handler :enter (behavior () (squid-talker 'start-recharging) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self invincible-timer) 0) (setup-masks (-> self draw) 8192 0) (logior! (-> self draw status) (draw-control-status warp-cross-fade)) @@ -717,7 +717,7 @@ (go-virtual fly-to-shoot-spot) ) ) - ((>= (- (current-time) (-> self state-time)) (seconds 2)) + ((time-elapsed? (-> self state-time) (seconds 2)) (set! (-> self driver-blend target) 1.0) (ja-channel-push! 1 (seconds 0.1)) (ja :group! (-> self draw art-group data 34) :num! min) @@ -774,7 +774,7 @@ ) (dotimes (gp-4 6) (send-event (handle->process (-> self tentacles gp-4)) 'set-fade (-> self draw force-fade)) - (when (< (- (current-time) (-> self state-time)) (seconds 2)) + (when (not (time-elapsed? (-> self state-time) (seconds 2))) (case (-> self stage) ((1) (send-event (handle->process (-> self tentacles gp-4)) 'wrap *squid-second-pole*) @@ -920,14 +920,14 @@ :event squid-handler :enter (behavior () (squid-talker 'headbutting) - (set! (-> self state-time) (current-time)) - (set! (-> self traj-timer) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self traj-timer)) (vector-reset! (-> self residual-velocity)) (set! (-> self can-play-squid-boost) #t) ) :exit (behavior () (sound-play "squid-rush-end") - (set! (-> self rush-end-time) (current-time)) + (set-time! (-> self rush-end-time)) (let ((v1-5 (ja-group))) (when (and v1-5 (= v1-5 (-> self draw art-group data 5))) (ja-channel-push! 1 (seconds 0.05)) @@ -945,7 +945,7 @@ ) (go-virtual pre-flee) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 3)) + (if (time-elapsed? (-> self state-time) (seconds 3)) (go-virtual fly-to-shoot-spot) ) (let ((v1-17 (ja-group))) @@ -968,7 +968,7 @@ (if (< (ja-aframe-num 0) 20.0) (squid-method-42 self (-> self traj-dest)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (else (let ((v1-53 (ja-group))) @@ -992,7 +992,7 @@ (s5-1 (new 'stack-no-clear 'vector)) (s2-0 (new 'stack 'clamp-travel-vector-to-mesh-return-info)) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.017)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.017)) (let ((f0-8 (vector-vector-xz-distance-squared (-> self traj-dest) (-> self trans))) (f1-1 8192.0) ) @@ -1001,7 +1001,7 @@ ) (go-virtual fly-to-shoot-spot) ) - (when (and (>= (- (current-time) (-> self state-time)) (seconds 0.017)) (-> self mesh-forced)) + (when (and (time-elapsed? (-> self state-time) (seconds 0.017)) (-> self mesh-forced)) (vector-reset! (-> self residual-velocity)) (go-virtual fly-to-shoot-spot) ) @@ -1072,7 +1072,7 @@ :event squid-handler :enter (behavior () (squid-talker 'shooting) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self stop-shooting) #f) (set! (-> self traj-timer) 0) (set! (-> self tentacle-base-rotation-speed target) 1.0) @@ -1104,13 +1104,13 @@ ) ) (squid-method-43 self (squid-method-42 self (new 'stack-no-clear 'vector)) 9.102222 0.75) - (when (or (>= (- (current-time) (-> self state-time)) (squid-whirlwind-time)) (-> self stop-shooting)) + (when (or (time-elapsed? (-> self state-time) (squid-whirlwind-time)) (-> self stop-shooting)) (vector-reset! (-> self residual-velocity)) (go-virtual fly-to-shoot-spot) ) - (when (>= (- (current-time) (-> self traj-timer)) (seconds 0.7)) + (when (time-elapsed? (-> self traj-timer) (seconds 0.7)) (spawn-whirlwind self) - (set! (-> self traj-timer) (current-time)) + (set-time! (-> self traj-timer)) ) ) :code sleep-code @@ -1373,7 +1373,7 @@ (else (ja-channel-push! 1 (seconds 0.15)) (ja :group! (-> self draw art-group data 7) :num! min) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -1481,7 +1481,7 @@ ((let ((v1-77 (ja-group))) (and v1-77 (= v1-77 (-> self draw art-group data 17))) ) - (if (or (>= (- (current-time) (-> self state-time)) (seconds 3)) + (if (or (time-elapsed? (-> self state-time) (seconds 3)) (or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) ) (ja :num! (seek!)) @@ -1500,7 +1500,7 @@ 0 ) ) - (if (and (or (>= (- (current-time) (-> self state-time)) (seconds 3)) + (if (and (or (time-elapsed? (-> self state-time) (seconds 3)) (or (= (-> self shield-hit-points) 0.0) (zero? (-> self hit-points)) (-> self stop-shooting)) ) (ja-done? 0) @@ -1543,7 +1543,7 @@ (else (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data 16) :num! min) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self next-gun) 1) ) ) @@ -1635,7 +1635,7 @@ :enter (behavior () (set-setting! 'music 'danger4 0.0 0) (set! (-> self driver-blend target) 1.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self hud) (ppointer->handle (process-spawn hud-squid :init hud-init-by-other :to self))) (vector+! (-> self trans) (-> self trans) (new 'static 'vector :x 101171.2 :y 45056.0 :z 31047.68)) (let ((v1-14 (squid-method-42 self (new 'stack-no-clear 'vector)))) @@ -1652,7 +1652,7 @@ ) :trans (behavior () (ja :num! (loop!)) - (when (>= (- (current-time) (-> self state-time)) (seconds 3)) + (when (time-elapsed? (-> self state-time) (seconds 3)) ) ) :code sleep-code 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 41ef5a12bb..0e5733b042 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 @@ -15,18 +15,18 @@ ) ;; definition for method 3 of type pal-fan-ring -(defmethod inspect pal-fan-ring ((obj pal-fan-ring)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-fan-ring ((this pal-fan-ring)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pal-fan-ring) - (format #t "~1Tlightning: ~A~%" (-> obj lightning)) - (format #t "~1Tradius: ~f~%" (-> obj radius)) - (format #t "~1Tdist: ~f~%" (-> obj dist)) - (format #t "~1Tlocal-z-rotate: ~f~%" (-> obj local-z-rotate)) + (format #t "[~8x] ~A~%" this 'pal-fan-ring) + (format #t "~1Tlightning: ~A~%" (-> this lightning)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tlocal-z-rotate: ~f~%" (-> this local-z-rotate)) (label cfg-4) - obj + this ) ;; definition of type pal-fan-pole @@ -41,16 +41,16 @@ ) ;; definition for method 3 of type pal-fan-pole -(defmethod inspect pal-fan-pole ((obj pal-fan-pole)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-fan-pole ((this pal-fan-pole)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'pal-fan-pole) - (format #t "~1Trings[6] @ #x~X~%" (-> obj rings)) - (format #t "~1Tz-rotate: ~f~%" (-> obj z-rotate)) + (format #t "[~8x] ~A~%" this 'pal-fan-pole) + (format #t "~1Trings[6] @ #x~X~%" (-> this rings)) + (format #t "~1Tz-rotate: ~f~%" (-> this z-rotate)) (label cfg-4) - obj + this ) ;; definition of type pal-electric-fan @@ -73,22 +73,22 @@ ) ;; definition for method 3 of type pal-electric-fan -(defmethod inspect pal-electric-fan ((obj pal-electric-fan)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-electric-fan ((this pal-electric-fan)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpoles[3] @ #x~X~%" (-> obj poles)) - (format #t "~2Tno-collision-timer: ~D~%" (-> obj no-collision-timer)) - (format #t "~2Tsound-timer: ~D~%" (-> obj sound-timer)) - (format #t "~2Trotate-speed: ~f~%" (-> obj rotate-speed)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tpoles[3] @ #x~X~%" (-> this poles)) + (format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer)) + (format #t "~2Tsound-timer: ~D~%" (-> this sound-timer)) + (format #t "~2Trotate-speed: ~f~%" (-> this rotate-speed)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -137,7 +137,7 @@ ) ) ) - (set! (-> self no-collision-timer) (current-time)) + (set-time! (-> self no-collision-timer)) (let ((v1-19 (-> self root root-prim))) (set! (-> v1-19 prim-core collide-as) (collide-spec)) (set! (-> v1-19 prim-core collide-with) (collide-spec)) @@ -151,13 +151,11 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (when (and (nonzero? (-> self no-collision-timer)) - (>= (- (current-time) (-> self no-collision-timer)) - (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) - ) + (time-elapsed? (-> self no-collision-timer) (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout))) ) (let ((v1-7 (-> self root root-prim))) (set! (-> v1-7 prim-core collide-as) (-> self root backup-collide-as)) @@ -228,14 +226,14 @@ ) ) ) - (when (>= (- (current-time) (-> self state-time)) (-> self sound-timer)) + (when (time-elapsed? (-> self state-time) (-> self sound-timer)) (sound-play "cab-fan-blade") (sound-stop (-> self sound-id)) (sound-play "pal-fan-buzz" :id (-> self sound-id)) (set! (-> self sound-timer) (the-as time-frame (the int (* 300.0 (/ 21845.334 (fabs (-> self rotate-speed)))))) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (update! (-> self sound)) (rider-post) @@ -245,27 +243,27 @@ ;; definition for method 7 of type pal-electric-fan ;; WARN: Return type mismatch process-drawable vs pal-electric-fan. -(defmethod relocate pal-electric-fan ((obj pal-electric-fan) (arg0 int)) +(defmethod relocate pal-electric-fan ((this pal-electric-fan) (arg0 int)) (dotimes (v1-0 3) (dotimes (a2-0 6) - (if (nonzero? (-> (the-as pal-electric-fan (&+ obj (* 112 v1-0))) poles 0 rings a2-0 lightning)) - (&+! (-> (the-as pal-electric-fan (&+ obj (* 112 v1-0))) poles 0 rings a2-0 lightning) arg0) + (if (nonzero? (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning)) + (&+! (-> (the-as pal-electric-fan (&+ this (* 112 v1-0))) poles 0 rings a2-0 lightning) arg0) ) ) ) - (the-as pal-electric-fan ((method-of-type process-drawable relocate) obj arg0)) + (the-as pal-electric-fan ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type pal-electric-fan ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-electric-fan ((obj pal-electric-fan) (arg0 entity-actor)) +(defmethod init-from-entity! pal-electric-fan ((this pal-electric-fan) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -322,17 +320,17 @@ This commonly includes things such as: ) ) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-electric-fan" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (let ((a0-32 (-> obj entity))) - (set! (-> obj rotate-speed) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((a0-32 (-> this entity))) + (set! (-> this rotate-speed) ((method-of-object a0-32 get-property-value-float) a0-32 'rotspeed @@ -348,12 +346,12 @@ This commonly includes things such as: (a0-34 (+ (-> v1-52 attack-id) 1)) ) (set! (-> v1-52 attack-id) a0-34) - (set! (-> obj attack-id) a0-34) + (set! (-> this attack-id) a0-34) ) - (set! (-> obj no-collision-timer) 0) - (let ((f1-7 (lerp-scale 55.0 35.0 (fabs (-> obj rotate-speed)) 10922.667 18204.445))) - (set! (-> obj sound-timer) - (the-as time-frame (the int (* 300.0 (/ (* 182.04445 f1-7) (fabs (-> obj rotate-speed)))))) + (set! (-> this no-collision-timer) 0) + (let ((f1-7 (lerp-scale 55.0 35.0 (fabs (-> this rotate-speed)) 10922.667 18204.445))) + (set! (-> this sound-timer) + (the-as time-frame (the int (* 300.0 (/ (* 182.04445 f1-7) (fabs (-> this rotate-speed)))))) ) ) (let ((s5-2 @@ -381,15 +379,15 @@ This commonly includes things such as: (f28-0 216.0) ) (dotimes (s4-2 3) - (let ((s3-2 (-> obj poles s4-2))) - (if (< 0.0 (-> obj rotate-speed)) + (let ((s3-2 (-> this poles s4-2))) + (if (< 0.0 (-> this rotate-speed)) (set! (-> s3-2 z-rotate) (* 21954.56 (the float s4-2))) (set! (-> s3-2 z-rotate) (* 21736.107 (the float s4-2))) ) (dotimes (s2-1 6) (let ((s1-1 (-> s3-2 rings s2-1))) (let ((s0-0 (+ s2-1 1))) - (set! (-> s1-1 lightning) (new 'process 'lightning-control s5-2 obj 0.0)) + (set! (-> s1-1 lightning) (new 'process 'lightning-control s5-2 this 0.0)) (set! (-> s1-1 dist) (+ 40960.0 (* f30-0 (the float s0-0)))) (set! (-> s1-1 radius) (+ 3276.8 (* 4505.6 (/ (the float (* (* s0-0 s0-0) s0-0)) f28-0)))) ) @@ -402,17 +400,17 @@ This commonly includes things such as: ) ) ) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "fan-blade-motor" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "fan-blade-motor" :fo-max 70) (-> this root trans)) ) - (set! (-> obj sound-id) (new-sound-id)) - (let ((a0-40 (-> obj skel root-channel 0))) - (set! (-> a0-40 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> this sound-id) (new-sound-id)) + (let ((a0-40 (-> this skel root-channel 0))) + (set! (-> a0-40 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-40 frame-num) 0.0) - (joint-control-channel-group! a0-40 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-40 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -435,21 +433,21 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-cable-nut -(defmethod inspect pal-cable-nut ((obj pal-cable-nut)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-cable-nut ((this pal-cable-nut)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Tsound-played?[2] @ #x~X~%" (-> obj sound-played?)) - (format #t "~2Thold-percentage: ~f~%" (-> obj hold-percentage)) - (format #t "~2Twiggle-percentage: ~f~%" (-> obj wiggle-percentage)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tsound-played?[2] @ #x~X~%" (-> this sound-played?)) + (format #t "~2Thold-percentage: ~f~%" (-> this hold-percentage)) + (format #t "~2Twiggle-percentage: ~f~%" (-> this wiggle-percentage)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -511,14 +509,14 @@ This commonly includes things such as: ;; definition for method 11 of type pal-cable-nut ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-cable-nut ((obj pal-cable-nut) (arg0 entity-actor)) +(defmethod init-from-entity! pal-cable-nut ((this pal-cable-nut) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -546,16 +544,16 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-18 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-18 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj root rider-max-momentum) 8192.0) - (process-drawable-from-entity! obj arg0) + (set! (-> this root rider-max-momentum) 8192.0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-cable-nut" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((a1-9 (new 'stack-no-clear 'sync-info-params))) (let ((v1-27 0)) (if #t @@ -564,36 +562,36 @@ This commonly includes things such as: (set! (-> a1-9 sync-type) 'sync-linear) (set! (-> a1-9 sync-flags) (the-as sync-flags v1-27)) ) - (set! (-> a1-9 entity) (-> obj entity)) + (set! (-> a1-9 entity) (-> this entity)) (set! (-> a1-9 period) (the-as uint 3600)) (set! (-> a1-9 percent) 0.0) - (initialize! (-> obj sync) a1-9) + (initialize! (-> this sync) a1-9) ) - (set! (-> obj hold-percentage) 0.3) - (set! (-> obj wiggle-percentage) 0.8) - (quaternion-copy! (-> obj init-quat) (-> obj root quat)) - (let* ((f0-15 (* 6.0 (get-current-phase-no-mod (-> obj sync)))) + (set! (-> this hold-percentage) 0.3) + (set! (-> this wiggle-percentage) 0.8) + (quaternion-copy! (-> this init-quat) (-> this root quat)) + (let* ((f0-15 (* 6.0 (get-current-phase-no-mod (-> this sync)))) (f1-4 (the float (the int f0-15))) (f0-16 (- f0-15 f1-4)) - (f2-4 (the float (sar (shl (the int (* 10922.667 (+ f1-4 (/ f0-16 (-> obj hold-percentage))))) 48) 48))) + (f2-4 (the float (sar (shl (the int (* 10922.667 (+ f1-4 (/ f0-16 (-> this hold-percentage))))) 48) 48))) (f1-8 (the float (sar (shl (the int (* 10922.667 f1-4)) 48) 48))) ) - (if (< (-> obj hold-percentage) f0-16) + (if (< (-> this hold-percentage) f0-16) (quaternion-rotate-local-z! - (-> obj root quat) - (-> obj init-quat) + (-> this root quat) + (-> this init-quat) (the float (sar (shl (the int (+ 10922.667 f1-8)) 48) 48)) ) - (quaternion-rotate-local-z! (-> obj root quat) (-> obj init-quat) f2-4) + (quaternion-rotate-local-z! (-> this root quat) (-> this init-quat) f2-4) ) ) - (let ((a0-26 (-> obj skel root-channel 0))) - (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-26 (-> this skel root-channel 0))) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-26 frame-num) 0.0) - (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -607,25 +605,25 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-rot-gun-shot -(defmethod inspect pal-rot-gun-shot ((obj pal-rot-gun-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-rot-gun-shot ((this pal-rot-gun-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type guard-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 25 of type pal-rot-gun-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles pal-rot-gun-shot ((obj pal-rot-gun-shot)) +(defmethod spawn-impact-particles pal-rot-gun-shot ((this pal-rot-gun-shot)) "Spawns associated particles with the projectile if applicable" - (let* ((gp-0 (-> obj root trans)) - (a1-0 (-> obj tail-pos)) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) (f30-0 (vector-length s5-1)) ) @@ -673,14 +671,14 @@ This commonly includes things such as: ;; definition for method 26 of type pal-rot-gun-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles pal-rot-gun-shot ((obj pal-rot-gun-shot)) +(defmethod spawn-shell-particles pal-rot-gun-shot ((this pal-rot-gun-shot)) "TODO - confirm" - (let* ((s3-0 (-> obj root)) - (s5-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj tail-pos) (-> s3-0 trans)) 2048.0)) + (let* ((s3-0 (-> this root)) + (s5-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s3-0 trans)) 2048.0)) (gp-0 (new 'stack-no-clear 'vector)) ) (set! (-> gp-0 quad) (-> s3-0 trans quad)) - (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 trans) (-> obj tail-pos))) + (let ((a2-1 (vector-! (new 'stack-no-clear 'vector) (-> s3-0 trans) (-> this tail-pos))) (f30-0 (-> *part-id-table* 606 init-specs 4 initial-valuef)) (s3-1 (-> *part-id-table* 606 init-specs 11 initial-valuef)) (f28-0 (-> *part-id-table* 606 init-specs 10 initial-valuef)) @@ -688,7 +686,7 @@ This commonly includes things such as: (set! (-> *part-id-table* 606 init-specs 4 initial-valuef) (vector-length a2-1)) (set! (-> *part-id-table* 606 init-specs 11 initial-valuef) (the-as float #x28)) (set! (-> *part-id-table* 606 init-specs 10 initial-valuef) -3.2) - (draw-beam (-> *part-id-table* 606) (-> obj tail-pos) a2-1 #f #t) + (draw-beam (-> *part-id-table* 606) (-> this tail-pos) a2-1 #f #t) (set! (-> *part-id-table* 606 init-specs 4 initial-valuef) f30-0) (set! (-> *part-id-table* 606 init-specs 11 initial-valuef) s3-1) (set! (-> *part-id-table* 606 init-specs 10 initial-valuef) f28-0) @@ -736,14 +734,14 @@ This commonly includes things such as: ;; definition for method 28 of type pal-rot-gun-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound pal-rot-gun-shot ((obj pal-rot-gun-shot) (arg0 projectile-options)) +(defmethod play-impact-sound pal-rot-gun-shot ((this pal-rot-gun-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) - (sound-play "rot-gun-fire" :position (-> obj root trans)) + (sound-play "rot-gun-fire" :position (-> this root trans)) ) ((= v1-0 (projectile-options lose-altitude)) - (sound-play "pal-rot-gun-sho" :position (-> obj root trans)) + (sound-play "pal-rot-gun-sho" :position (-> this root trans)) ) ) ) @@ -783,9 +781,9 @@ This commonly includes things such as: ;; definition for method 30 of type pal-rot-gun-shot ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-collision! pal-rot-gun-shot ((obj pal-rot-gun-shot)) +(defmethod init-proj-collision! pal-rot-gun-shot ((this pal-rot-gun-shot)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) @@ -808,9 +806,9 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) ) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (set! (-> obj root pat-ignore-mask) + (set! (-> this root pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1) ) 0 @@ -820,13 +818,13 @@ This commonly includes things such as: ;; definition for method 31 of type pal-rot-gun-shot ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-proj-settings! pal-rot-gun-shot ((obj pal-rot-gun-shot)) +(defmethod init-proj-settings! pal-rot-gun-shot ((this pal-rot-gun-shot)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" - (set! (-> obj tail-pos quad) (-> obj root trans quad)) - (set! (-> obj attack-mode) 'pal-rot-gun-shot) - (set! (-> obj move) pal-rot-gun-shot-move) - (set! (-> obj max-speed) 630784.0) - (set! (-> obj timeout) (seconds 1.427)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'pal-rot-gun-shot) + (set! (-> this move) pal-rot-gun-shot-move) + (set! (-> this max-speed) 630784.0) + (set! (-> this timeout) (seconds 1.427)) 0 (none) ) @@ -855,24 +853,24 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-rot-gun -(defmethod inspect pal-rot-gun ((obj pal-rot-gun)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-rot-gun ((this pal-rot-gun)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Tfire-timer: ~D~%" (-> obj fire-timer)) - (format #t "~2Tgun-index: ~D~%" (-> obj gun-index)) - (format #t "~2Tspin-rate: ~f~%" (-> obj spin-rate)) - (format #t "~2Tspin-rate-final: ~f~%" (-> obj spin-rate-final)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tshot-sound-id: ~D~%" (-> obj shot-sound-id)) - (format #t "~2Tprev-z-rot: ~f~%" (-> obj prev-z-rot)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tfire-timer: ~D~%" (-> this fire-timer)) + (format #t "~2Tgun-index: ~D~%" (-> this gun-index)) + (format #t "~2Tspin-rate: ~f~%" (-> this spin-rate)) + (format #t "~2Tspin-rate-final: ~f~%" (-> this spin-rate-final)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tshot-sound-id: ~D~%" (-> this shot-sound-id)) + (format #t "~2Tprev-z-rot: ~f~%" (-> this prev-z-rot)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -907,7 +905,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self fire-timer) (current-time)) + (set-time! (-> self fire-timer)) (set! (-> self gun-index) 0) 0 ) @@ -916,7 +914,7 @@ This commonly includes things such as: (seek! (-> self spin-rate) (-> self spin-rate-final) (* 3640.889 (seconds-per-frame))) (quaternion-rotate-z! (-> self root quat) (-> self root quat) (* (-> self spin-rate) (seconds-per-frame))) (let ((f30-0 1.0)) - (when (>= (- (current-time) (-> self fire-timer)) (seconds 0.05)) + (when (time-elapsed? (-> self fire-timer) (seconds 0.05)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (let ((s5-0 (-> self node-list data (+ (* (-> self gun-index) 2) 4)))) (vector<-cspace! (the-as vector (-> gp-0 vector)) s5-0) @@ -927,7 +925,7 @@ This commonly includes things such as: (pal-rot-gun-method-23 self gp-0) ) (set! (-> self gun-index) (- 1 (-> self gun-index))) - (set! (-> self fire-timer) (current-time)) + (set-time! (-> self fire-timer)) (set! f30-0 1.2) ) (let* ((f0-10 (the float (sar (shl (the int (quaternion-z-angle (-> self root quat))) 48) 48))) @@ -1009,20 +1007,20 @@ This commonly includes things such as: ;; definition for method 23 of type pal-rot-gun ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod pal-rot-gun-method-23 pal-rot-gun ((obj pal-rot-gun) (arg0 matrix)) +(defmethod pal-rot-gun-method-23 pal-rot-gun ((this pal-rot-gun) (arg0 matrix)) (let ((v1-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((a2-0 (-> arg0 vector)) (a1-1 (-> arg0 vector 1)) ) - (set! (-> v1-0 ent) (-> obj entity)) + (set! (-> v1-0 ent) (-> this entity)) (set! (-> v1-0 charge) 1.0) (set! (-> v1-0 options) (projectile-options)) (set! (-> v1-0 pos quad) (-> a2-0 0 quad)) (set! (-> v1-0 vel quad) (-> a1-1 quad)) ) - (set! (-> v1-0 notify-handle) (process->handle obj)) + (set! (-> v1-0 notify-handle) (process->handle this)) (set! (-> v1-0 owner-handle) (the-as handle #f)) - (set! (-> v1-0 ignore-handle) (process->handle obj)) + (set! (-> v1-0 ignore-handle) (process->handle this)) (let* ((a1-9 *game-info*) (a2-12 (+ (-> a1-9 attack-id) 1)) ) @@ -1030,53 +1028,53 @@ This commonly includes things such as: (set! (-> v1-0 attack-id) a2-12) ) (set! (-> v1-0 timeout) (seconds 4)) - (ppointer->handle (spawn-projectile pal-rot-gun-shot v1-0 obj *default-dead-pool*)) + (ppointer->handle (spawn-projectile pal-rot-gun-shot v1-0 this *default-dead-pool*)) ) (none) ) ;; definition for method 10 of type pal-rot-gun -(defmethod deactivate pal-rot-gun ((obj pal-rot-gun)) - (sound-stop (-> obj sound-id)) - (sound-stop (-> obj shot-sound-id)) - ((the-as (function process-drawable none) (find-parent-method pal-rot-gun 10)) obj) +(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) (none) ) ;; definition for method 11 of type pal-rot-gun ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-rot-gun ((obj pal-rot-gun) (arg0 entity-actor)) +(defmethod init-from-entity! pal-rot-gun ((this pal-rot-gun) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-rot-gun" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (let ((s5-2 (-> obj root quat))) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((s5-2 (-> this root quat))) (quaternion-rotate-local-x! s5-2 s5-2 364.0889) (quaternion-rotate-local-z! s5-2 s5-2 16384.0) - (quaternion-copy! (-> obj init-quat) s5-2) + (quaternion-copy! (-> this init-quat) s5-2) ) - (set! (-> obj spin-rate) 0.0) - (set! (-> obj spin-rate-final) 16384.0) - (set! (-> obj prev-z-rot) 65353.957) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj shot-sound-id) (new-sound-id)) - (let ((a0-9 (-> obj skel root-channel 0))) - (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> this spin-rate) 0.0) + (set! (-> this spin-rate-final) 16384.0) + (set! (-> this prev-z-rot) 65353.957) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this shot-sound-id) (new-sound-id)) + (let ((a0-9 (-> this skel root-channel 0))) + (set! (-> a0-9 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-9 frame-num) 0.0) - (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-9 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1093,16 +1091,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-windmill -(defmethod inspect pal-windmill ((obj pal-windmill)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-windmill ((this pal-windmill)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1130,23 +1128,23 @@ This commonly includes things such as: ;; definition for method 11 of type pal-windmill ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-windmill ((obj pal-windmill) (arg0 entity-actor)) +(defmethod init-from-entity! pal-windmill ((this pal-windmill) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask ambient)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-windmill" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1166,17 +1164,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-flip-step -(defmethod inspect pal-flip-step ((obj pal-flip-step)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-flip-step ((this pal-flip-step)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttask-node: ~A~%" (-> obj task-node)) + (format #t "~2Ttask-node: ~A~%" (-> this task-node)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1228,14 +1226,14 @@ This commonly includes things such as: ;; definition for method 11 of type pal-flip-step ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-flip-step ((obj pal-flip-step) (arg0 entity-actor)) +(defmethod init-from-entity! pal-flip-step ((this pal-flip-step) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1255,49 +1253,49 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-flip-step" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj task-node) (task-node-by-name (the-as string ((method-of-type res-lump get-property-struct) - arg0 - 'task-name - 'interp - -1000000000.0 - "palace-cable-resolution" - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - ) + (set! (-> this task-node) (task-node-by-name (the-as string ((method-of-type res-lump get-property-struct) + arg0 + 'task-name + 'interp + -1000000000.0 + "palace-cable-resolution" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) ) (cond - ((and (-> obj task-node) - (logtest? (-> obj task-node flags) (game-task-node-flag closed)) + ((and (-> this task-node) + (logtest? (-> this task-node flags) (game-task-node-flag closed)) (not (task-node-closed? (game-task-node nest-boss-resolution))) ) - (let ((a0-17 (-> obj skel root-channel 0))) - (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-17 (-> this skel root-channel 0))) + (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-17 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 3)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1)) ) - (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-17 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (go (method-of-object obj fallen)) + (go (method-of-object this fallen)) ) (else - (let ((a0-18 (-> obj skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-18 (-> this skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/palace/cable/palcab-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/cable/palcab-part_REF.gc index 64bfa16334..112cfdc5a0 100644 --- a/test/decompiler/reference/jak2/levels/palace/cable/palcab-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/cable/palcab-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type palcab-part -(defmethod inspect palcab-part ((obj palcab-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect palcab-part ((this palcab-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc index a7ba235e9b..e5689906dc 100644 --- a/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/pal-obs_REF.gc @@ -16,16 +16,16 @@ ) ;; definition for method 3 of type pal-falling-plat -(defmethod inspect pal-falling-plat ((obj pal-falling-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-falling-plat ((this pal-falling-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -100,14 +100,14 @@ ;; definition for method 11 of type pal-falling-plat ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-falling-plat ((obj pal-falling-plat) (arg0 entity-actor)) +(defmethod init-from-entity! pal-falling-plat ((this pal-falling-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -155,15 +155,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-24 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-falling-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -184,28 +184,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-ent-door -(defmethod inspect pal-ent-door ((obj pal-ent-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-ent-door ((this pal-ent-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type pal-ent-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-ent-door ((obj pal-ent-door) (arg0 entity-actor)) +(defmethod init-from-entity! pal-ent-door ((this pal-ent-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) @@ -221,20 +221,20 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-ent-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj open-frame) 20.0) - (set! (-> obj sound-open-loop) (static-sound-spec "door-slide-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "door-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "door-slide-cls")) - (set! (-> obj sound-close-stop) (static-sound-spec "door-close-hit")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this open-frame) 20.0) + (set! (-> this sound-open-loop) (static-sound-spec "door-slide-open")) + (set! (-> this sound-open-stop) (static-sound-spec "door-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "door-slide-cls")) + (set! (-> this sound-close-stop) (static-sound-spec "door-close-hit")) + (go (method-of-object this close) #t) (none) ) @@ -255,18 +255,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-grind-ring-center -(defmethod inspect pal-grind-ring-center ((obj pal-grind-ring-center)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-grind-ring-center ((this pal-grind-ring-center)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspeed-y: ~f~%" (-> obj speed-y)) - (format #t "~2Thit-sound-played?: ~A~%" (-> obj hit-sound-played?)) + (format #t "~2Tspeed-y: ~f~%" (-> this speed-y)) + (format #t "~2Thit-sound-played?: ~A~%" (-> this hit-sound-played?)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -371,8 +371,8 @@ This commonly includes things such as: ;; definition for method 29 of type pal-grind-ring-center ;; WARN: Return type mismatch int vs none. -(defmethod pal-grind-ring-center-method-29 pal-grind-ring-center ((obj pal-grind-ring-center)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod pal-grind-ring-center-method-29 pal-grind-ring-center ((this pal-grind-ring-center)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -391,7 +391,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -400,52 +400,52 @@ This commonly includes things such as: ;; definition for method 11 of type pal-grind-ring-center ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-grind-ring-center ((obj pal-grind-ring-center) (arg0 entity-actor)) +(defmethod init-from-entity! pal-grind-ring-center ((this pal-grind-ring-center) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (pal-grind-ring-center-method-29 obj) - (process-drawable-from-entity! obj arg0) + (pal-grind-ring-center-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-grind-ring-center" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask collectable)) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask collectable)) + (go (method-of-object this idle)) (none) ) ;; definition for method 11 of type pal-grind-ring-center ;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-grind-ring-center ((obj pal-grind-ring-center) (arg0 entity-actor)) +(defmethod init-from-entity! pal-grind-ring-center ((this pal-grind-ring-center) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (pal-grind-ring-center-method-29 obj) - (process-drawable-from-entity! obj arg0) + (pal-grind-ring-center-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-grind-ring-center" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask collectable)) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask collectable)) + (go (method-of-object this idle)) (none) ) @@ -472,18 +472,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-grind-ring -(defmethod inspect pal-grind-ring ((obj pal-grind-ring)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-grind-ring ((this pal-grind-ring)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspeed-y: ~f~%" (-> obj speed-y)) - (format #t "~2Thit-sound-played?: ~A~%" (-> obj hit-sound-played?)) + (format #t "~2Tspeed-y: ~f~%" (-> this speed-y)) + (format #t "~2Thit-sound-played?: ~A~%" (-> this hit-sound-played?)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -591,8 +591,8 @@ This commonly includes things such as: ;; definition for method 29 of type pal-grind-ring ;; WARN: Return type mismatch int vs none. -(defmethod pal-grind-ring-method-29 pal-grind-ring ((obj pal-grind-ring)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod pal-grind-ring-method-29 pal-grind-ring ((this pal-grind-ring)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -612,7 +612,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -620,25 +620,25 @@ This commonly includes things such as: ;; definition for method 11 of type pal-grind-ring ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-grind-ring ((obj pal-grind-ring) (arg0 entity-actor)) +(defmethod init-from-entity! pal-grind-ring ((this pal-grind-ring) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (pal-grind-ring-method-29 obj) - (process-drawable-from-entity! obj arg0) + (pal-grind-ring-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-grind-ring" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask collectable)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1131) obj)) - (process-spawn pal-grind-ring-center arg0 :to obj) - (go (method-of-object obj idle)) + (logior! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask collectable)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1131) this)) + (process-spawn pal-grind-ring-center arg0 :to this) + (go (method-of-object this idle)) (none) ) @@ -699,16 +699,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-ent-glass -(defmethod inspect pal-ent-glass ((obj pal-ent-glass)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-ent-glass ((this pal-ent-glass)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -771,8 +771,8 @@ This commonly includes things such as: ;; definition for method 29 of type pal-ent-glass ;; WARN: Return type mismatch int vs none. -(defmethod pal-ent-glass-method-29 pal-ent-glass ((obj pal-ent-glass)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod pal-ent-glass-method-29 pal-ent-glass ((this pal-ent-glass)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -792,7 +792,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -800,31 +800,31 @@ This commonly includes things such as: ;; definition for method 30 of type pal-ent-glass ;; WARN: Return type mismatch int vs none. -(defmethod pal-ent-glass-method-30 pal-ent-glass ((obj pal-ent-glass)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod pal-ent-glass-method-30 pal-ent-glass ((this pal-ent-glass)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; definition for method 11 of type pal-ent-glass ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-ent-glass ((obj pal-ent-glass) (arg0 entity-actor)) +(defmethod init-from-entity! pal-ent-glass ((this pal-ent-glass) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (pal-ent-glass-method-29 obj) - (process-drawable-from-entity! obj arg0) + (pal-ent-glass-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-ent-glass" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (pal-ent-glass-method-30 obj) + (pal-ent-glass-method-30 this) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -838,21 +838,21 @@ This commonly includes things such as: ) ;; definition for method 3 of type palent-turret-shot -(defmethod inspect palent-turret-shot ((obj palent-turret-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect palent-turret-shot ((this palent-turret-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type guard-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 28 of type palent-turret-shot ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound palent-turret-shot ((obj palent-turret-shot) (arg0 projectile-options)) +(defmethod play-impact-sound palent-turret-shot ((this palent-turret-shot) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -888,17 +888,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type palent-turret -(defmethod inspect palent-turret ((obj palent-turret)) - (when (not obj) - (set! obj obj) +(defmethod inspect palent-turret ((this palent-turret)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnext-shoot: ~D~%" (-> obj next-shoot)) + (format #t "~2Tnext-shoot: ~D~%" (-> this next-shoot)) (label cfg-4) - obj + this ) ;; definition for function palent-turret-callback @@ -915,7 +915,7 @@ This commonly includes things such as: (defstate idle (palent-turret) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () '() @@ -923,7 +923,7 @@ This commonly includes things such as: :trans (behavior () (cond ((not (task-node-closed? (game-task-node palace-sneak-in-meeting))) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (else (let* ((f0-0 65536.0) @@ -973,8 +973,8 @@ This commonly includes things such as: ;; definition for method 28 of type palent-turret ;; WARN: Return type mismatch int vs none. -(defmethod palent-turret-method-28 palent-turret ((obj palent-turret)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod palent-turret-method-28 palent-turret ((this palent-turret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1014,7 +1014,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1022,26 +1022,26 @@ This commonly includes things such as: ;; definition for method 11 of type palent-turret ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! palent-turret ((obj palent-turret) (arg0 entity-actor)) +(defmethod init-from-entity! palent-turret ((this palent-turret) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (palent-turret-method-28 obj) - (process-drawable-from-entity! obj arg0) + (palent-turret-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-palent-turret" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-5 (-> obj node-list data 4))) + (let ((a0-5 (-> this node-list data 4))) (set! (-> a0-5 param0) palent-turret-callback) - (set! (-> a0-5 param1) obj) + (set! (-> a0-5 param1) this) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1113,16 +1113,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type pal-breakable-window -(defmethod inspect pal-breakable-window ((obj pal-breakable-window)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-breakable-window ((this pal-breakable-window)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1183,8 +1183,8 @@ This commonly includes things such as: ;; definition for method 29 of type pal-breakable-window ;; WARN: Return type mismatch int vs none. -(defmethod pal-breakable-window-method-29 pal-breakable-window ((obj pal-breakable-window)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod pal-breakable-window-method-29 pal-breakable-window ((this pal-breakable-window)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1204,7 +1204,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1212,33 +1212,33 @@ This commonly includes things such as: ;; definition for method 30 of type pal-breakable-window ;; WARN: Return type mismatch int vs none. -(defmethod pal-breakable-window-method-30 pal-breakable-window ((obj pal-breakable-window)) - (logior! (-> obj mask) (process-mask crate)) +(defmethod pal-breakable-window-method-30 pal-breakable-window ((this pal-breakable-window)) + (logior! (-> this mask) (process-mask crate)) 0 (none) ) ;; definition for method 11 of type pal-breakable-window ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-breakable-window ((obj pal-breakable-window) (arg0 entity-actor)) +(defmethod init-from-entity! pal-breakable-window ((this pal-breakable-window) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (pal-breakable-window-method-29 obj) - (process-drawable-from-entity! obj arg0) + (pal-breakable-window-method-29 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-breakable-window" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (pal-breakable-window-method-30 obj) + (pal-breakable-window-method-30 this) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/palace/palent-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/palent-part_REF.gc index bf5220ba69..844575a501 100644 --- a/test/decompiler/reference/jak2/levels/palace/palent-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/palent-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type palent-part -(defmethod inspect palent-part ((obj palent-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect palent-part ((this palent-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc b/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc index 2577c40e47..628a2b8dad 100644 --- a/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/roof/palroof-obs_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type pal-lowrez-throne -(defmethod inspect pal-lowrez-throne ((obj pal-lowrez-throne)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-lowrez-throne ((this pal-lowrez-throne)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type med-res-level inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -105,16 +105,16 @@ ) ;; definition for method 3 of type pal-prong -(defmethod inspect pal-prong ((obj pal-prong)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-prong ((this pal-prong)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -150,14 +150,14 @@ ;; definition for method 11 of type pal-prong ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pal-prong ((obj pal-prong) (arg0 entity-actor)) +(defmethod init-from-entity! pal-prong ((this pal-prong) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -183,18 +183,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pal-prong" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1111) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1111) this)) (if (task-node-closed? (game-task-node palace-boss-resolution)) - (go (method-of-object obj broken)) - (go (method-of-object obj idle)) + (go (method-of-object this broken)) + (go (method-of-object this idle)) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/palace/roof/palroof-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/roof/palroof-part_REF.gc index 0dcc38d40a..71ac76e8eb 100644 --- a/test/decompiler/reference/jak2/levels/palace/roof/palroof-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/roof/palroof-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type palroof-part -(defmethod inspect palroof-part ((obj palroof-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect palroof-part ((this palroof-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/palace/shaft/palshaft-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/shaft/palshaft-part_REF.gc index e78f05a9d8..c470e89771 100644 --- a/test/decompiler/reference/jak2/levels/palace/shaft/palshaft-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/shaft/palshaft-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type palshaft-part -(defmethod inspect palshaft-part ((obj palshaft-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect palshaft-part ((this palshaft-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc b/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc index af4e2654f0..f3c992c5d8 100644 --- a/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/throne/palace-scenes_REF.gc @@ -14,16 +14,16 @@ ) ;; definition for method 3 of type throne-throne -(defmethod inspect throne-throne ((obj throne-throne)) - (when (not obj) - (set! obj obj) +(defmethod inspect throne-throne ((this throne-throne)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -50,14 +50,14 @@ ;; definition for method 11 of type throne-throne ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! throne-throne ((obj throne-throne) (entity entity-actor)) +(defmethod init-from-entity! throne-throne ((this throne-throne) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-group (new 'process 'collide-shape-prim-group cshape (the-as uint 1) 0))) (set! (-> cshape total-prims) (the-as uint 2)) (set! (-> prim-group prim-core collide-as) (collide-spec obstacle)) @@ -78,15 +78,15 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-throne-throne" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/palace/throne/throne-part_REF.gc b/test/decompiler/reference/jak2/levels/palace/throne/throne-part_REF.gc index 9a11633d27..d143366fe1 100644 --- a/test/decompiler/reference/jak2/levels/palace/throne/throne-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/palace/throne/throne-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type throne-part -(defmethod inspect throne-part ((obj throne-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect throne-part ((this throne-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc b/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc index 9e43e04c23..a620587b6d 100644 --- a/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/breakable-wall_REF.gc @@ -71,21 +71,21 @@ ) ;; definition for method 3 of type rbw-side -(defmethod inspect rbw-side ((obj rbw-side)) - (when (not obj) - (set! obj obj) +(defmethod inspect rbw-side ((this rbw-side)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tbreak-anim: ~A~%" (-> obj break-anim)) - (format #t "~1Tend-anim: ~A~%" (-> obj end-anim)) - (format #t "~1Tbreak-prim-mask: ~D~%" (-> obj break-prim-mask)) - (format #t "~1Tbreak-root-prim-joint: ~D~%" (-> obj break-root-prim-joint)) - (format #t "~1Tbreak-bounds-joint: ~D~%" (-> obj break-bounds-joint)) - (format #t "~1Tbreak-root-prim-sphere: #~%" (-> obj break-root-prim-sphere)) - (format #t "~1Tbreak-bounds-sphere: #~%" (-> obj break-bounds-sphere)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tbreak-anim: ~A~%" (-> this break-anim)) + (format #t "~1Tend-anim: ~A~%" (-> this end-anim)) + (format #t "~1Tbreak-prim-mask: ~D~%" (-> this break-prim-mask)) + (format #t "~1Tbreak-root-prim-joint: ~D~%" (-> this break-root-prim-joint)) + (format #t "~1Tbreak-bounds-joint: ~D~%" (-> this break-bounds-joint)) + (format #t "~1Tbreak-root-prim-sphere: #~%" (-> this break-root-prim-sphere)) + (format #t "~1Tbreak-bounds-sphere: #~%" (-> this break-bounds-sphere)) (label cfg-4) - obj + this ) ;; definition of type rbw-info @@ -100,17 +100,17 @@ ) ;; definition for method 3 of type rbw-info -(defmethod inspect rbw-info ((obj rbw-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect rbw-info ((this rbw-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tskel-group: ~A~%" (-> obj skel-group)) - (format #t "~1Tanim: ~A~%" (-> obj anim)) - (format #t "~1Tsides: ~A~%" (-> obj sides)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tskel-group: ~A~%" (-> this skel-group)) + (format #t "~1Tanim: ~A~%" (-> this anim)) + (format #t "~1Tsides: ~A~%" (-> this sides)) (label cfg-4) - obj + this ) ;; definition for symbol *rbw-infos*, type (array rbw-info) @@ -254,47 +254,47 @@ ) ;; definition for method 3 of type ruins-breakable-wall -(defmethod inspect ruins-breakable-wall ((obj ruins-breakable-wall)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruins-breakable-wall ((this ruins-breakable-wall)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: ~A~%" (-> obj info)) - (format #t "~2Tside: ~A~%" (-> obj side)) - (format #t "~2Tnav-mesh: ~A~%" (-> obj nav-mesh)) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Tside: ~A~%" (-> this side)) + (format #t "~2Tnav-mesh: ~A~%" (-> this nav-mesh)) (label cfg-4) - obj + this ) ;; definition for method 30 of type ruins-breakable-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod ruins-breakable-wall-method-30 ruins-breakable-wall ((obj ruins-breakable-wall) (arg0 symbol)) +(defmethod ruins-breakable-wall-method-30 ruins-breakable-wall ((this ruins-breakable-wall) (arg0 symbol)) (case arg0 (('hit) - (-> obj draw bounds w) - (set! (-> obj draw lod-set max-lod) 2) - (set! (-> obj draw force-lod) 2) - (set! (-> obj draw bounds w) 573440.0) + (-> this draw bounds w) + (set! (-> this draw lod-set max-lod) 2) + (set! (-> this draw force-lod) 2) + (set! (-> this draw bounds w) 573440.0) ) (('broken) - (-> obj draw bounds w) - (set! (-> obj draw lod-set max-lod) 2) - (set! (-> obj draw force-lod) 2) - (set! (-> obj draw bounds quad) (-> obj side break-bounds-sphere quad)) - (let ((v1-12 (-> obj side break-bounds-joint))) + (-> this draw bounds w) + (set! (-> this draw lod-set max-lod) 2) + (set! (-> this draw force-lod) 2) + (set! (-> this draw bounds quad) (-> this side break-bounds-sphere quad)) + (let ((v1-12 (-> this side break-bounds-joint))) (if (>= v1-12 0) - (set! (-> obj draw origin-joint-index) (the-as uint v1-12)) + (set! (-> this draw origin-joint-index) (the-as uint v1-12)) ) ) - (let ((v1-14 (-> obj root root-prim)) - (a1-15 (-> obj side break-prim-mask)) + (let ((v1-14 (-> this root root-prim)) + (a1-15 (-> this side break-prim-mask)) ) - (set! (-> v1-14 local-sphere quad) (-> obj side break-root-prim-sphere quad)) - (let ((a0-2 (-> obj side break-root-prim-joint))) + (set! (-> v1-14 local-sphere quad) (-> this side break-root-prim-sphere quad)) + (let ((a0-2 (-> this side break-root-prim-joint))) (if (>= a0-2 0) (set! (-> v1-14 transform-index) a0-2) ) @@ -470,22 +470,22 @@ ;; definition for method 11 of type ruins-breakable-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-breakable-wall ((obj ruins-breakable-wall) (arg0 entity-actor)) +(defmethod init-from-entity! ruins-breakable-wall ((this ruins-breakable-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) - (set! (-> obj side) #f) - (set! (-> obj nav-mesh) #f) - (let ((v1-5 (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0))) - (set! (-> obj info) (-> *rbw-infos* v1-5)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) + (set! (-> this side) #f) + (set! (-> this nav-mesh) #f) + (let ((v1-5 (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0))) + (set! (-> this info) (-> *rbw-infos* v1-5)) (cond ((zero? v1-5) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 4) 0))) (set! (-> s4-0 total-prims) (the-as uint 5)) @@ -521,11 +521,11 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-22 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-22 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) ) ((= (the-as uint v1-5) 1) - (let ((s4-1 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-1 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-1 penetrated-by) (penetrate)) (let ((s3-1 (new 'process 'collide-shape-prim-group s4-1 (the-as uint 3) 0))) (set! (-> s4-1 total-prims) (the-as uint 4)) @@ -556,11 +556,11 @@ This commonly includes things such as: (set! (-> s4-1 backup-collide-as) (-> v1-38 prim-core collide-as)) (set! (-> s4-1 backup-collide-with) (-> v1-38 prim-core collide-with)) ) - (set! (-> obj root) s4-1) + (set! (-> this root) s4-1) ) ) ((= (the-as uint v1-5) 2) - (let ((s4-2 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-2 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-2 penetrated-by) (penetrate)) (let ((s3-2 (new 'process 'collide-shape-prim-group s4-2 (the-as uint 3) 0))) (set! (-> s4-2 total-prims) (the-as uint 4)) @@ -591,11 +591,11 @@ This commonly includes things such as: (set! (-> s4-2 backup-collide-as) (-> v1-54 prim-core collide-as)) (set! (-> s4-2 backup-collide-with) (-> v1-54 prim-core collide-with)) ) - (set! (-> obj root) s4-2) + (set! (-> this root) s4-2) ) ) ((= (the-as uint v1-5) 3) - (let ((s4-3 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-3 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-3 penetrated-by) (penetrate)) (let ((s3-3 (new 'process 'collide-shape-prim-group s4-3 (the-as uint 2) 0))) (set! (-> s4-3 total-prims) (the-as uint 3)) @@ -621,11 +621,11 @@ This commonly includes things such as: (set! (-> s4-3 backup-collide-as) (-> v1-68 prim-core collide-as)) (set! (-> s4-3 backup-collide-with) (-> v1-68 prim-core collide-with)) ) - (set! (-> obj root) s4-3) + (set! (-> this root) s4-3) ) ) ((= (the-as uint v1-5) 4) - (let ((s4-4 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-4 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-4 penetrated-by) (penetrate)) (let ((s3-4 (new 'process 'collide-shape-prim-group s4-4 (the-as uint 3) 0))) (set! (-> s4-4 total-prims) (the-as uint 4)) @@ -656,11 +656,11 @@ This commonly includes things such as: (set! (-> s4-4 backup-collide-as) (-> v1-84 prim-core collide-as)) (set! (-> s4-4 backup-collide-with) (-> v1-84 prim-core collide-with)) ) - (set! (-> obj root) s4-4) + (set! (-> this root) s4-4) ) ) (else - (let ((s4-5 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-5 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-5 penetrated-by) (penetrate)) (let ((s3-5 (new 'process 'collide-shape-prim-group s4-5 (the-as uint 2) 0))) (set! (-> s4-5 total-prims) (the-as uint 3)) @@ -686,24 +686,24 @@ This commonly includes things such as: (set! (-> s4-5 backup-collide-as) (-> v1-98 prim-core collide-as)) (set! (-> s4-5 backup-collide-with) (-> v1-98 prim-core collide-with)) ) - (set! (-> obj root) s4-5) + (set! (-> this root) s4-5) ) ) ) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton-by-name obj (-> obj info skel-group)) - (case (-> obj entity extra perm user-uint8 0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton-by-name this (-> this info skel-group)) + (case (-> this entity extra perm user-uint8 0) ((1) - (set! (-> obj side) (-> obj info sides 0)) - (go (method-of-object obj broken)) + (set! (-> this side) (-> this info sides 0)) + (go (method-of-object this broken)) ) ((2) - (set! (-> obj side) (-> obj info sides 1)) - (go (method-of-object obj broken)) + (set! (-> this side) (-> this info sides 1)) + (go (method-of-object this broken)) ) (else - (go (method-of-object obj unbroken)) + (go (method-of-object this unbroken)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc index c913e070af..2d85fd12d3 100644 --- a/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/mechtest-obs_REF.gc @@ -26,23 +26,23 @@ ) ;; definition for method 3 of type mechblock -(defmethod inspect mechblock ((obj mechblock)) - (when (not obj) - (set! obj obj) +(defmethod inspect mechblock ((this mechblock)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Torigin: ~`vector`P~%" (-> obj origin)) - (format #t "~2Tdrop-point: ~`vector`P~%" (-> obj drop-point)) - (format #t "~2Tallow-drag?: ~A~%" (-> obj allow-drag?)) - (format #t "~2Treset-on-land?: ~A~%" (-> obj reset-on-land?)) - (format #t "~2Thit-something?: ~A~%" (-> obj hit-something?)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tnext-entity: ~A~%" (-> obj next-entity)) + (format #t "~2Torigin: ~`vector`P~%" (-> this origin)) + (format #t "~2Tdrop-point: ~`vector`P~%" (-> this drop-point)) + (format #t "~2Tallow-drag?: ~A~%" (-> this allow-drag?)) + (format #t "~2Treset-on-land?: ~A~%" (-> this reset-on-land?)) + (format #t "~2Thit-something?: ~A~%" (-> this hit-something?)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tnext-entity: ~A~%" (-> this next-entity)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -303,7 +303,7 @@ ) :enter (behavior () (logclear! (-> self mask) (process-mask actor-pause)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (if (handle->process (-> self carry other)) (drop-impl! (the-as carry-info (send-event (handle->process (-> self carry other)) 'carry-info)) @@ -315,14 +315,14 @@ ) :trans (behavior () (when (or (and (logtest? (-> self root status) (collide-status on-surface)) (< 0.8 (-> self root surface-angle))) - (>= (- (current-time) (-> self state-time)) (seconds 5)) + (time-elapsed? (-> self state-time) (seconds 5)) ) (vector-reset! (-> self root transv)) (set! (-> self root root-prim local-sphere w) (-> self carry backup-radius)) (cond ((and (-> self reset-on-land?) (and (or (< 12288.0 (vector-vector-distance (-> self drop-point) (-> self root trans))) - (>= (- (current-time) (-> self state-time)) (seconds 5)) + (time-elapsed? (-> self state-time) (seconds 5)) ) (and (-> self next-entity) (not (logtest? (-> self next-entity extra perm status) (entity-perm-status subtask-complete))) @@ -363,7 +363,7 @@ (go-virtual wait) ) ((or (< 12288.0 (vector-vector-distance (-> self drop-point) (-> self root trans))) - (>= (- (current-time) (-> self state-time)) (seconds 5)) + (time-elapsed? (-> self state-time) (seconds 5)) ) (sound-play "block-break") (let ((gp-3 (get-process *default-dead-pool* part-tracker #x4000))) @@ -454,16 +454,16 @@ ) ;; definition for method 3 of type throwblock -(defmethod inspect throwblock ((obj throwblock)) - (when (not obj) - (set! obj obj) +(defmethod inspect throwblock ((this throwblock)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type mechblock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -474,14 +474,14 @@ ;; definition for method 11 of type throwblock ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! throwblock ((obj throwblock) (arg0 entity-actor)) +(defmethod init-from-entity! throwblock ((this throwblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -506,35 +506,35 @@ This commonly includes things such as: ) (set! (-> s4-0 max-iteration-count) (the-as uint 4)) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-throwblock" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (mem-copy! (the-as pointer (-> obj origin)) (the-as pointer (-> obj root trans)) 48) - (set! (-> obj allow-drag?) #f) - (set! (-> obj reset-on-land?) #t) + (mem-copy! (the-as pointer (-> this origin)) (the-as pointer (-> this root trans)) 48) + (set! (-> this allow-drag?) #f) + (set! (-> this reset-on-land?) #t) (let* ((v1-18 *game-info*) (a0-16 (+ (-> v1-18 attack-id) 1)) ) (set! (-> v1-18 attack-id) a0-16) - (set! (-> obj attack-id) a0-16) + (set! (-> this attack-id) a0-16) ) - (set! (-> obj hit-something?) #f) - (set! (-> obj next-entity) (entity-actor-lookup (-> obj entity) 'next-actor 0)) - (let ((v1-20 (new 'process 'carry-info obj 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0)) + (set! (-> this hit-something?) #f) + (set! (-> this next-entity) (entity-actor-lookup (-> this entity) 'next-actor 0)) + (let ((v1-20 (new 'process 'carry-info this 3 (new 'static 'vector :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0)) ) (set! (-> v1-20 max-distance) 16384.0) (set! (-> v1-20 min-pull) 2048.0) (set! (-> v1-20 max-pull) 6963.2) (set! (-> v1-20 carry-radius) 6144.0) (set! (-> v1-20 mode) (carry-mode mech-carry)) - (set! (-> obj carry) v1-20) + (set! (-> this carry) v1-20) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -548,16 +548,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type pushblock -(defmethod inspect pushblock ((obj pushblock)) - (when (not obj) - (set! obj obj) +(defmethod inspect pushblock ((this pushblock)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type mechblock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -568,14 +568,14 @@ This commonly includes things such as: ;; definition for method 11 of type pushblock ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pushblock ((obj pushblock) (arg0 entity-actor)) +(defmethod init-from-entity! pushblock ((this pushblock) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -599,36 +599,43 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) (set! (-> s4-0 max-iteration-count) (the-as uint 4)) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pushblock" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (mem-copy! (the-as pointer (-> obj origin)) (the-as pointer (-> obj root trans)) 48) - (set! (-> obj reset-on-land?) #f) - (set! (-> obj allow-drag?) #t) + (mem-copy! (the-as pointer (-> this origin)) (the-as pointer (-> this root trans)) 48) + (set! (-> this reset-on-land?) #f) + (set! (-> this allow-drag?) #t) (let* ((v1-17 *game-info*) (a0-15 (+ (-> v1-17 attack-id) 1)) ) (set! (-> v1-17 attack-id) a0-15) - (set! (-> obj attack-id) a0-15) + (set! (-> this attack-id) a0-15) ) - (set! (-> obj next-entity) #f) - (get-nav-control obj (the-as nav-mesh #f)) - (let ((v1-19 - (new 'process 'carry-info obj 3 (new 'static 'vector :y 819.2 :w 1.0) (new 'static 'vector :y 1.0 :w 1.0) 0.0) - ) + (set! (-> this next-entity) #f) + (get-nav-control this (the-as nav-mesh #f)) + (let ((v1-19 (new + 'process + 'carry-info + this + 3 + (new 'static 'vector :y 819.2 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + 0.0 + ) + ) ) (set! (-> v1-19 max-distance) 22528.0) (set! (-> v1-19 min-pull) 10240.0) (set! (-> v1-19 max-pull) 14336.0) (set! (-> v1-19 carry-radius) 11264.0) (set! (-> v1-19 mode) (carry-mode mech-drag)) - (set! (-> obj carry) v1-19) + (set! (-> this carry) v1-19) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc b/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc index 080c348b1e..226bab0fa2 100644 --- a/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/pillar-collapse_REF.gc @@ -26,24 +26,24 @@ ) ;; definition for method 3 of type ruins-pillar-collapse -(defmethod inspect ruins-pillar-collapse ((obj ruins-pillar-collapse)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruins-pillar-collapse ((this ruins-pillar-collapse)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tplayer-attack-id: ~D~%" (-> obj player-attack-id)) - (format #t "~2Tfall-anim-index: ~D~%" (-> obj fall-anim-index)) - (format #t "~2Thit-points: ~D~%" (-> obj hit-points)) - (format #t "~2Tmesh-trans[3] @ #x~X~%" (-> obj mesh-trans)) - (format #t "~2Tmesh-joint[2] @ #x~X~%" (-> obj mesh-joint)) - (format #t "~2Tdeadly?: ~A~%" (-> obj deadly?)) - (format #t "~2Tart-name: ~A~%" (-> obj art-name)) - (format #t "~2Tanim: ~A~%" (-> obj anim)) + (format #t "~2Tplayer-attack-id: ~D~%" (-> this player-attack-id)) + (format #t "~2Tfall-anim-index: ~D~%" (-> this fall-anim-index)) + (format #t "~2Thit-points: ~D~%" (-> this hit-points)) + (format #t "~2Tmesh-trans[3] @ #x~X~%" (-> this mesh-trans)) + (format #t "~2Tmesh-joint[2] @ #x~X~%" (-> this mesh-joint)) + (format #t "~2Tdeadly?: ~A~%" (-> this deadly?)) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) + (format #t "~2Tanim: ~A~%" (-> this anim)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -224,7 +224,7 @@ ;; definition for method 11 of type ruins-pillar-collapse ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-pillar-collapse ((obj ruins-pillar-collapse) (arg0 entity-actor)) +(defmethod init-from-entity! ruins-pillar-collapse ((this ruins-pillar-collapse) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -232,12 +232,12 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape-moving)) - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (dotimes (v1-3 3) - (set! (-> obj mesh-trans v1-3) (the-as uint v1-3)) + (set! (-> this mesh-trans v1-3) (the-as uint v1-3)) ) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -323,57 +323,57 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-30 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-30 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj mesh-trans 0) (the-as uint 1)) - (set! (-> obj mesh-trans 1) (the-as uint 2)) - (set! (-> obj mesh-trans 2) (the-as uint 0)) - (let ((s5-1 (res-lump-struct (-> obj entity) 'art-name structure))) - (set! (-> obj art-name) (the-as string s5-1)) + (process-drawable-from-entity! this arg0) + (set! (-> this mesh-trans 0) (the-as uint 1)) + (set! (-> this mesh-trans 1) (the-as uint 2)) + (set! (-> this mesh-trans 2) (the-as uint 0)) + (let ((s5-1 (res-lump-struct (-> this entity) 'art-name structure))) + (set! (-> this art-name) (the-as string s5-1)) (cond ((string= (the-as string s5-1) "ruins-pillar-collapse-1") - (let ((v1-38 (-> obj root root-prim local-sphere))) + (let ((v1-38 (-> this root root-prim local-sphere))) (set! (-> v1-38 y) 49152.0) (set! (-> v1-38 z) 65536.0) (set! (-> v1-38 w) 122880.0) ) - (set! (-> obj anim) (new 'static 'spool-anim - :name "ruins-pillar-collapse-1" - :anim-name "1-break-center" - :parts 2 - :command-list '() - ) + (set! (-> this anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-1" + :anim-name "1-break-center" + :parts 2 + :command-list '() + ) ) ) ((string= (the-as string s5-1) "ruins-pillar-collapse-2") - (set! (-> obj anim) (new 'static 'spool-anim - :name "ruins-pillar-collapse-2" - :anim-name "2-break-center" - :parts 2 - :command-list '() - ) + (set! (-> this anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-2" + :anim-name "2-break-center" + :parts 2 + :command-list '() + ) ) - (set-yaw-angle-clear-roll-pitch! (-> obj root) (+ 32768.0 (y-angle (-> obj root)))) + (set-yaw-angle-clear-roll-pitch! (-> this root) (+ 32768.0 (y-angle (-> this root)))) ) ((string= (the-as string s5-1) "ruins-pillar-collapse-3") - (set! (-> obj anim) (new 'static 'spool-anim - :name "ruins-pillar-collapse-3" - :anim-name "3-break-center" - :parts 2 - :command-list '() - ) + (set! (-> this anim) (new 'static 'spool-anim + :name "ruins-pillar-collapse-3" + :anim-name "3-break-center" + :parts 2 + :command-list '() + ) ) - (set-yaw-angle-clear-roll-pitch! (-> obj root) (+ 32768.0 (y-angle (-> obj root)))) + (set-yaw-angle-clear-roll-pitch! (-> this root) (+ 32768.0 (y-angle (-> this root)))) ) ) - (initialize-skeleton-by-name obj (the-as string s5-1)) + (initialize-skeleton-by-name this (the-as string s5-1)) ) - (set! (-> obj hit-points) 1) - (set! (-> obj deadly?) #f) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj fall) #t) - (go (method-of-object obj idle)) + (set! (-> this hit-points) 1) + (set! (-> this deadly?) #f) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this fall) #t) + (go (method-of-object this idle)) ) (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 5d68ea76f5..40b4d333f3 100644 --- a/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/rapid-gunner_REF.gc @@ -41,35 +41,35 @@ ) ;; definition for method 3 of type rapid-gunner -(defmethod inspect rapid-gunner ((obj rapid-gunner)) - (when (not obj) - (set! obj obj) +(defmethod inspect rapid-gunner ((this rapid-gunner)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlos: #~%" (-> obj los)) - (format #t "~2Tjoint: ~A~%" (-> obj joint)) - (format #t "~2Tjoint-blend: ~f~%" (-> obj joint-blend)) - (format #t "~2Tjoint-enable: ~A~%" (-> obj joint-enable)) - (format #t "~2Tshot-timer: ~D~%" (-> obj shot-timer)) - (format #t "~2Tpredict-timer: ~D~%" (-> obj predict-timer)) - (format #t "~2Ttarget-prev-pos: #~%" (-> obj target-prev-pos)) - (format #t "~2Ttarget-next-pos: #~%" (-> obj target-next-pos)) - (format #t "~2Tfocus-dir: #~%" (-> obj focus-dir)) - (format #t "~2Ty-diff: ~f~%" (-> obj y-diff)) - (format #t "~2Tshots-fired: ~D~%" (-> obj shots-fired)) - (format #t "~2Tspin-up-angle: ~f~%" (-> obj spin-up-angle)) - (format #t "~2Tspin-up-timer: ~D~%" (-> obj spin-up-timer)) - (format #t "~2Tshoot-anim-index: ~D~%" (-> obj shoot-anim-index)) - (format #t "~2Tstatus-flags: ~D~%" (-> obj status-flags)) - (format #t "~2Tstart-pos: #~%" (-> obj start-pos)) - (format #t "~2Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~2Thop-dir: #~%" (-> obj hop-dir)) - (format #t "~2Troam-radius: ~f~%" (-> obj roam-radius)) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Tjoint: ~A~%" (-> this joint)) + (format #t "~2Tjoint-blend: ~f~%" (-> this joint-blend)) + (format #t "~2Tjoint-enable: ~A~%" (-> this joint-enable)) + (format #t "~2Tshot-timer: ~D~%" (-> this shot-timer)) + (format #t "~2Tpredict-timer: ~D~%" (-> this predict-timer)) + (format #t "~2Ttarget-prev-pos: #~%" (-> this target-prev-pos)) + (format #t "~2Ttarget-next-pos: #~%" (-> this target-next-pos)) + (format #t "~2Tfocus-dir: #~%" (-> this focus-dir)) + (format #t "~2Ty-diff: ~f~%" (-> this y-diff)) + (format #t "~2Tshots-fired: ~D~%" (-> this shots-fired)) + (format #t "~2Tspin-up-angle: ~f~%" (-> this spin-up-angle)) + (format #t "~2Tspin-up-timer: ~D~%" (-> this spin-up-timer)) + (format #t "~2Tshoot-anim-index: ~D~%" (-> this shoot-anim-index)) + (format #t "~2Tstatus-flags: ~D~%" (-> this status-flags)) + (format #t "~2Tstart-pos: #~%" (-> this start-pos)) + (format #t "~2Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~2Thop-dir: #~%" (-> this hop-dir)) + (format #t "~2Troam-radius: ~f~%" (-> this roam-radius)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -260,25 +260,25 @@ (set! (-> *rapid-gunner-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type rapid-gunner -(defmethod general-event-handler rapid-gunner ((obj rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler rapid-gunner ((this rapid-gunner) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-flinch) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (go (method-of-object obj knocked)) + (go (method-of-object this knocked)) ) (('notify) (if (= (-> arg3 param 0) 'attack) @@ -286,7 +286,7 @@ ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -295,21 +295,21 @@ ;; WARN: Return type mismatch object vs symbol. ;; WARN: Using new Jak 2 rtype-of ;; WARN: Using new Jak 2 rtype-of -(defmethod enemy-method-77 rapid-gunner ((obj rapid-gunner) (arg0 (pointer float))) - (let ((v1-0 (-> obj incoming knocked-type))) +(defmethod enemy-method-77 rapid-gunner ((this rapid-gunner) (arg0 (pointer float))) + (let ((v1-0 (-> this incoming knocked-type))) (the-as symbol (cond ((or (= v1-0 (knocked-type knocked-type-4)) (= v1-0 (knocked-type knocked-type-0))) (cond - ((zero? (-> obj hit-points)) - (let ((a0-3 (-> obj skel root-channel 0))) + ((zero? (-> this hit-points)) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 frame-group) - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) ) (set! (-> a0-3 param 0) (the float - (+ (-> (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) frames num-frames) + (+ (-> (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) frames num-frames) -1 ) ) @@ -318,7 +318,7 @@ (set! (-> a0-3 frame-num) 0.0) (joint-control-channel-group! a0-3 - (the-as art-joint-anim (-> obj draw art-group data (-> obj enemy-info knocked-anim))) + (the-as art-joint-anim (-> this draw art-group data (-> this enemy-info knocked-anim))) num-func-seek! ) ) @@ -329,21 +329,21 @@ (s4-0 (new 'static 'array int64 3 20 21 22)) (s3-0 (new 'static 'array int32 4 0 0 0 0)) (a2-1 (ash 1 (-> s3-0 0))) - (v1-27 (enemy-method-120 obj a1-11 a2-1)) - (s4-1 (-> obj draw art-group data (-> (the-as (pointer int32) (+ (* v1-27 8) (the-as int s4-0)))))) + (v1-27 (enemy-method-120 this a1-11 a2-1)) + (s4-1 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-27 8) (the-as int s4-0)))))) ) (set! (-> s3-0 0) v1-27) - (let ((v1-30 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-30 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-30 (= v1-30 (-> obj draw art-group data 27))) + (if (and v1-30 (= v1-30 (-> this draw art-group data 27))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-19 (-> obj skel root-channel 0))) + (let ((a0-19 (-> this skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-19 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-19 param 1) (-> arg0 0)) @@ -357,14 +357,14 @@ ) ((= v1-0 (knocked-type knocked-type-5)) (ja-channel-push! 1 (seconds 0.067)) - (let ((a0-22 (-> obj skel root-channel 0))) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-22 param 1) (-> arg0 0)) (set! (-> a0-22 frame-num) 0.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) ) ((= v1-0 (knocked-type knocked-type-6)) @@ -373,21 +373,21 @@ (s5-1 (new 'static 'array int64 3 24 25 26)) (s4-2 (new 'static 'array int32 4 0 0 0 0)) (a2-4 (ash 1 (-> s4-2 0))) - (v1-59 (enemy-method-120 obj a1-21 a2-4)) - (s5-2 (-> obj draw art-group data (-> (the-as (pointer int32) (+ (* v1-59 8) (the-as int s5-1)))))) + (v1-59 (enemy-method-120 this a1-21 a2-4)) + (s5-2 (-> this draw art-group data (-> (the-as (pointer int32) (+ (* v1-59 8) (the-as int s5-1)))))) ) (set! (-> s4-2 0) v1-59) - (let ((v1-62 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-62 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-62 (= v1-62 (-> obj draw art-group data 27))) + (if (and v1-62 (= v1-62 (-> this draw art-group data 27))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-39 (-> obj skel root-channel 0))) + (let ((a0-39 (-> this skel root-channel 0))) (set! (-> a0-39 frame-group) (the-as art-joint-anim s5-2)) (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) (set! (-> a0-39 param 1) 1.0) @@ -399,8 +399,8 @@ ) (else (ja-channel-push! 1 (seconds 0.067)) - (let ((a1-28 (-> obj draw art-group data (-> obj enemy-info knocked-anim))) - (a0-43 (-> obj skel root-channel 0)) + (let ((a1-28 (-> this draw art-group data (-> this enemy-info knocked-anim))) + (a0-43 (-> this skel root-channel 0)) ) (set! (-> a0-43 frame-group) (the-as art-joint-anim a1-28)) (set! (-> a0-43 param 0) (the float (+ (-> (the-as art-joint-anim a1-28) frames num-frames) -1))) @@ -417,40 +417,40 @@ ;; definition for method 52 of type rapid-gunner ;; WARN: Return type mismatch object vs none. -(defmethod enemy-method-52 rapid-gunner ((obj rapid-gunner) (arg0 vector)) +(defmethod enemy-method-52 rapid-gunner ((this rapid-gunner) (arg0 vector)) (cond - ((> (-> obj hit-points) 0) - (-> obj enemy-info) - (case (-> obj incoming knocked-type) + ((> (-> this hit-points) 0) + (-> this enemy-info) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (vector-reset! arg0) ) (else - ((method-of-type nav-enemy enemy-method-52) obj arg0) + ((method-of-type nav-enemy enemy-method-52) this arg0) ) ) ) (else - ((method-of-type nav-enemy enemy-method-52) obj arg0) + ((method-of-type nav-enemy enemy-method-52) this arg0) ) ) (none) ) ;; definition for method 78 of type rapid-gunner -(defmethod enemy-method-78 rapid-gunner ((obj rapid-gunner) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 rapid-gunner ((this rapid-gunner) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 27))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 27))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 27)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 27)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!) ) #t ) @@ -459,10 +459,10 @@ #t ) (((knocked-type knocked-type-5)) - (when (zero? (-> obj hit-points)) + (when (zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.067)) - (let ((a1-5 (-> obj draw art-group data (-> obj enemy-info die-anim))) - (a0-10 (-> obj skel root-channel 0)) + (let ((a1-5 (-> this draw art-group data (-> this enemy-info die-anim))) + (a0-10 (-> this skel root-channel 0)) ) (set! (-> a0-10 frame-group) (the-as art-joint-anim a1-5)) (set! (-> a0-10 param 0) (the float (+ (-> (the-as art-joint-anim a1-5) frames num-frames) -1))) @@ -474,8 +474,8 @@ ) ) (else - (let ((a1-6 (-> obj draw art-group data (-> obj enemy-info knocked-land-anim))) - (a0-13 (-> obj skel root-channel 0)) + (let ((a1-6 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-13 (-> this skel root-channel 0)) ) (set! (-> a0-13 frame-group) (the-as art-joint-anim a1-6)) (set! (-> a0-13 param 0) (the float (+ (-> (the-as art-joint-anim a1-6) frames num-frames) -1))) @@ -489,16 +489,16 @@ ) ;; definition for method 98 of type rapid-gunner -(defmethod in-aggro-range? rapid-gunner ((obj rapid-gunner) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? rapid-gunner ((this rapid-gunner) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @param proc The process used to distance check @returns true/false" (let ((t9-0 (method-of-type nav-enemy in-aggro-range?))) - (and (t9-0 obj arg0 arg1) - (or (not (logtest? (-> obj fact enemy-options) (enemy-option user8))) - (and (not (focus-test? arg0 in-air)) (>= 4096.0 (fabs (- (-> (get-trans arg0 0) y) (-> obj root trans y))))) + (and (t9-0 this arg0 arg1) + (or (not (logtest? (-> this fact enemy-options) (enemy-option user8))) + (and (not (focus-test? arg0 in-air)) (>= 4096.0 (fabs (- (-> (get-trans arg0 0) y) (-> this root trans y))))) ) ) ) @@ -508,14 +508,14 @@ ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. ;; WARN: Function (method 185 rapid-gunner) has a return type of none, but the expression builder found a return statement. -(defmethod rapid-gunner-method-185 rapid-gunner ((obj rapid-gunner) (arg0 vector) (arg1 float)) - (if (not (-> obj joint-enable)) +(defmethod rapid-gunner-method-185 rapid-gunner ((this rapid-gunner) (arg0 vector) (arg1 float)) + (if (not (-> this joint-enable)) (return #f) ) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> arg0 quad)) (let ((s4-0 (new 'stack-no-clear 'vector))) - (set! (-> s4-0 quad) (-> obj root root-prim prim-core world-sphere quad)) + (set! (-> s4-0 quad) (-> this root root-prim prim-core world-sphere quad)) (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s5-0 s4-0))) (set! (-> s4-0 w) 1.0) (when (< (vector-vector-distance s5-0 s4-0) 29491.2) @@ -524,10 +524,10 @@ ) ) ) - (let* ((v1-16 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 18))) + (let* ((v1-16 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 18))) (s4-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s5-0 v1-16) 1.0)) (s3-2 - (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj node-list data 4 bone transform vector 2) 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data 4 bone transform vector 2) 1.0) ) (s5-1 (new 'stack-no-clear 'quaternion)) ) @@ -544,8 +544,8 @@ (vector-orient-by-quat! s4-1 s2-0 s1-0) ) ) - (quaternion-from-two-vectors-max-angle-partial! s5-1 s3-2 s4-1 16384.0 (-> obj joint-blend)) - (quaternion-slerp! (-> obj joint quat) (-> obj joint quat) s5-1 0.1) + (quaternion-from-two-vectors-max-angle-partial! s5-1 s3-2 s4-1 16384.0 (-> this joint-blend)) + (quaternion-slerp! (-> this joint quat) (-> this joint quat) s5-1 0.1) ) ) 0 @@ -601,29 +601,29 @@ ;; definition for method 55 of type rapid-gunner ;; WARN: Return type mismatch int vs none. -(defmethod track-target! rapid-gunner ((obj rapid-gunner)) +(defmethod track-target! rapid-gunner ((this rapid-gunner)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (los-control-method-9 (-> obj los) (the-as process-focusable #f) (the-as vector #f) 2048.0) + (los-control-method-9 (-> this los) (the-as process-focusable #f) (the-as vector #f) 2048.0) 0 (none) ) ;; definition for method 96 of type rapid-gunner -(defmethod enemy-method-96 rapid-gunner ((obj rapid-gunner) (arg0 float) (arg1 symbol)) - (enemy-method-95 obj (-> obj target-next-pos) arg0) +(defmethod enemy-method-96 rapid-gunner ((this rapid-gunner) (arg0 float) (arg1 symbol)) + (enemy-method-95 this (-> this target-next-pos) arg0) ) ;; definition for method 184 of type rapid-gunner -(defmethod rapid-gunner-method-184 rapid-gunner ((obj rapid-gunner) (arg0 float)) - (let* ((s4-0 (-> obj node-list data 18)) +(defmethod rapid-gunner-method-184 rapid-gunner ((this rapid-gunner) (arg0 float)) + (let* ((s4-0 (-> this node-list data 18)) (v1-1 (vector<-cspace! (new 'stack-no-clear 'vector) s4-0)) - (s5-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj target-next-pos) v1-1) 1.0)) + (s5-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this target-next-pos) v1-1) 1.0)) (s4-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s4-0 bone transform vector 2) 1.0)) ) (set! (-> s4-1 y) 0.0) @@ -635,8 +635,8 @@ ) ;; definition for method 67 of type rapid-gunner -(defmethod go-stare rapid-gunner ((obj rapid-gunner)) - (go (method-of-object obj hostile)) +(defmethod go-stare rapid-gunner ((this rapid-gunner)) + (go (method-of-object this hostile)) ) ;; failed to figure out what this is: @@ -723,7 +723,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self predict-timer) (the-as uint (+ (current-time) 1))) (set! (-> self shot-timer) (the-as uint (current-time))) (let ((v1-7 self)) @@ -793,7 +793,7 @@ ) (go-virtual reload) ) - ((>= (- (current-time) (the-as int (-> self shot-timer))) (seconds 0.25)) + ((time-elapsed? (the-as int (-> self shot-timer)) (seconds 0.25)) (when (rapid-gunner-method-184 self 2184.5334) (let* ((a1-11 (-> self node-list data 18)) (f30-0 (fmax 0.0 (the float (- (-> self spin-up-timer) (current-time))))) @@ -876,19 +876,19 @@ ;; definition for method 186 of type rapid-gunner ;; WARN: Return type mismatch art-element vs none. -(defmethod rapid-gunner-method-186 rapid-gunner ((obj rapid-gunner) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) +(defmethod rapid-gunner-method-186 rapid-gunner ((this rapid-gunner) (arg0 int) (arg1 float) (arg2 int) (arg3 int)) (local-vars (v1-1 int)) 0 (if (< 0.0 arg1) (set! v1-1 arg2) (set! v1-1 arg3) ) - (let ((a1-2 (-> obj skel root-channel arg0))) + (let ((a1-2 (-> this skel root-channel arg0))) (let ((f0-2 (fabs arg1))) (set! (-> a1-2 frame-interp 1) f0-2) (set! (-> a1-2 frame-interp 0) f0-2) ) - (set! (-> a1-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data v1-1))) + (set! (-> a1-2 frame-group) (the-as art-joint-anim (-> this draw art-group data v1-1))) ) (none) ) @@ -1093,12 +1093,12 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self shots-fired) (the-as uint 0)) 0 ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (if (time-elapsed? (-> self state-time) (seconds 0.5)) (go-hostile self) ) ) @@ -1216,7 +1216,7 @@ ) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (if (>= 1 (the-as int (-> self focus aware))) (go-virtual active) ) @@ -1274,7 +1274,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -1368,17 +1368,17 @@ ;; definition for method 142 of type rapid-gunner ;; WARN: Return type mismatch int vs none. -(defmethod nav-enemy-method-142 rapid-gunner ((obj rapid-gunner) (arg0 nav-control)) +(defmethod nav-enemy-method-142 rapid-gunner ((this rapid-gunner) (arg0 nav-control)) 0 (none) ) ;; definition for method 63 of type rapid-gunner ;; WARN: Return type mismatch none vs symbol. -(defmethod enemy-method-63 rapid-gunner ((obj rapid-gunner) (arg0 process-focusable) (arg1 enemy-aware)) +(defmethod enemy-method-63 rapid-gunner ((this rapid-gunner) (arg0 process-focusable) (arg1 enemy-aware)) (let ((t9-0 (method-of-type nav-enemy enemy-method-63))) - (the-as symbol (if (t9-0 obj arg0 arg1) - (set-dst-proc! (-> obj los) (-> obj focus handle)) + (the-as symbol (if (t9-0 this arg0 arg1) + (set-dst-proc! (-> this los) (-> this focus handle)) ) ) ) @@ -1386,9 +1386,9 @@ ;; definition for method 114 of type rapid-gunner ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! rapid-gunner ((obj rapid-gunner)) +(defmethod init-enemy-collision! rapid-gunner ((this rapid-gunner)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1459,7 +1459,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1467,20 +1467,20 @@ ;; definition for method 7 of type rapid-gunner ;; WARN: Return type mismatch process-focusable vs rapid-gunner. -(defmethod relocate rapid-gunner ((obj rapid-gunner) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(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)) obj arg0) + ((the-as (function process-focusable int process-focusable) (find-parent-method rapid-gunner 7)) this arg0) ) ) ;; definition for method 115 of type rapid-gunner ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! rapid-gunner ((obj rapid-gunner)) +(defmethod init-enemy! rapid-gunner ((this rapid-gunner)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-48 int)) (rlet ((acc :class vf) @@ -1492,21 +1492,21 @@ ) (init-vf0-vector) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-rapid-gunner" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *rapid-gunner-nav-enemy-info*) - (set! (-> obj neck up) (the-as uint 1)) - (set! (-> obj neck nose) (the-as uint 2)) - (set! (-> obj neck ear) (the-as uint 0)) - (new-source! (-> obj los) obj (seconds 0.2) (collide-spec backgnd obstacle)) - (set! (-> obj joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) obj 5)) - (set-vector! (-> obj root scale) 1.2 1.2 1.2 1.0) - (let ((a0-13 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (init-enemy-behaviour-and-stats! this *rapid-gunner-nav-enemy-info*) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (new-source! (-> this los) this (seconds 0.2) (collide-spec backgnd obstacle)) + (set! (-> this joint) (new 'process 'joint-mod (joint-mod-mode joint-set*-world) this 5)) + (set-vector! (-> this root scale) 1.2 1.2 1.2 1.0) + (let ((a0-13 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (v1-14 (new 'stack-no-clear 'vector)) ) - (let ((a1-7 (-> obj root trans))) + (let ((a1-7 (-> this root trans))) (let ((a2-5 409600.0)) (.mov vf7 a2-5) ) @@ -1517,42 +1517,49 @@ (.mul.x.vf acc vf5 vf7 :mask #b111) (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-14 quad) vf6) - (set! (-> obj target-next-pos quad) (-> v1-14 quad)) - (set! (-> obj target-prev-pos quad) (-> v1-14 quad)) + (set! (-> this target-next-pos quad) (-> v1-14 quad)) + (set! (-> this target-prev-pos quad) (-> v1-14 quad)) ) - (set! (-> obj shots-fired) (the-as uint 0)) - (set! (-> obj spin-up-timer) 0) - (logclear! (-> obj status-flags) (rapid-gunner-flags ragflags-0)) - (logior! (-> obj status-flags) (rapid-gunner-flags ragflags-1)) + (set! (-> this shots-fired) (the-as uint 0)) + (set! (-> this spin-up-timer) 0) + (logclear! (-> this status-flags) (rapid-gunner-flags ragflags-0)) + (logior! (-> this status-flags) (rapid-gunner-flags ragflags-1)) (let ((f30-0 3640.889)) (set! sv-48 0) - (let ((v1-22 (res-lump-data (-> obj entity) 'spinup-angle pointer :tag-ptr (the-as (pointer res-tag) (& sv-48))))) + (let ((v1-22 (res-lump-data (-> this entity) 'spinup-angle pointer :tag-ptr (the-as (pointer res-tag) (& sv-48))))) (if v1-22 (set! f30-0 (-> (the-as (pointer float) v1-22))) ) ) - (set! (-> obj spin-up-angle) f30-0) + (set! (-> this spin-up-angle) f30-0) ) - (vector-reset! (-> obj focus-dir)) - (set! (-> obj shoot-anim-index) -1) - (let ((v1-26 (-> obj nav))) + (vector-reset! (-> this focus-dir)) + (set! (-> this shoot-anim-index) -1) + (let ((v1-26 (-> this nav))) (set! (-> v1-26 speed-scale) 1.0) ) 0 - (logclear! (-> obj nav flags) (nav-control-flag update-heading-from-facing)) - (set! (-> obj enemy-flags) (the-as enemy-flag (logclear (-> obj enemy-flags) (enemy-flag enemy-flag43)))) - (set! (-> obj start-pos quad) (-> obj root trans quad)) - (set! (-> obj roam-radius) 16384.0) - (add-connection *part-engine* obj 8 obj 1310 (new 'static 'vector :x 1146.88 :y 450.56 :z 901.12 :w 163840.0)) + (logclear! (-> this nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> this enemy-flags) (the-as enemy-flag (logclear (-> this enemy-flags) (enemy-flag enemy-flag43)))) + (set! (-> this start-pos quad) (-> this root trans quad)) + (set! (-> this roam-radius) 16384.0) (add-connection *part-engine* - obj + this 8 - obj + this + 1310 + (new 'static 'vector :x 1146.88 :y 450.56 :z 901.12 :w 163840.0) + ) + (add-connection + *part-engine* + this + 8 + this 1311 (new 'static 'vector :x -1146.88 :y 450.56 :z 901.12 :w 163840.0) ) - (add-connection *part-engine* obj 18 obj 1312 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 18 this 1312 (new 'static 'vector :w 163840.0)) 0 (none) ) @@ -1568,16 +1575,16 @@ ) ;; definition for method 3 of type shield-gunner -(defmethod inspect shield-gunner ((obj shield-gunner)) - (when (not obj) - (set! obj obj) +(defmethod inspect shield-gunner ((this shield-gunner)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type rapid-gunner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 224ca8d3d5..987d021aa4 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-obs_REF.gc @@ -12,17 +12,17 @@ ) ;; definition for method 3 of type sinking-plat -(defmethod inspect sinking-plat ((obj sinking-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect sinking-plat ((this sinking-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanchor-point: #~%" (-> obj anchor-point)) + (format #t "~2Tanchor-point: #~%" (-> this anchor-point)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -33,17 +33,17 @@ ;; definition for method 29 of type sinking-plat ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 sinking-plat ((obj sinking-plat) (arg0 float)) - ((the-as (function rigid-body-platform float none) (find-parent-method sinking-plat 29)) obj arg0) - (rigid-body-platform-method-56 obj (-> obj anchor-point)) +(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) + (rigid-body-platform-method-56 this (-> this anchor-point)) 0 (none) ) ;; definition for method 32 of type sinking-plat ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape sinking-plat ((obj sinking-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod allocate-and-init-cshape sinking-plat ((this sinking-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -64,7 +64,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -107,18 +107,18 @@ ;; definition for method 33 of type sinking-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body sinking-plat ((obj sinking-plat)) +(defmethod init-skel-and-rigid-body sinking-plat ((this sinking-plat)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sinking-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj float-height-offset) 4096.0) - (alloc-and-init-rigid-body-control obj *ruins-sinking-platform-constants*) - (set! (-> obj anchor-point quad) (-> obj root trans quad)) - (let ((s5-1 (-> obj info control-point-count))) + (set! (-> this float-height-offset) 4096.0) + (alloc-and-init-rigid-body-control this *ruins-sinking-platform-constants*) + (set! (-> this anchor-point quad) (-> this root trans quad)) + (let ((s5-1 (-> this info control-point-count))) (dotimes (s4-1 s5-1) - (let ((s3-0 (-> obj control-point-array data s4-1))) + (let ((s3-0 (-> this control-point-array data s4-1))) (let ((f30-0 (* 65536.0 (/ (the float s4-1) (the float s5-1))))) (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) (set! (-> s3-0 local-pos y) 4096.0) @@ -167,16 +167,16 @@ ) ;; definition for method 3 of type beam -(defmethod inspect beam ((obj beam)) - (when (not obj) - (set! obj obj) +(defmethod inspect beam ((this beam)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -219,31 +219,31 @@ ;; definition for method 11 of type beam ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! beam ((obj beam) (arg0 entity-actor)) +(defmethod init-from-entity! beam ((this beam) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-beam" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-push! 1 0) - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) ) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -257,16 +257,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type ruins-bridge -(defmethod inspect ruins-bridge ((obj ruins-bridge)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruins-bridge ((this ruins-bridge)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type drop-plat inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -277,12 +277,12 @@ This commonly includes things such as: ;; definition for method 29 of type ruins-bridge ;; WARN: Return type mismatch int vs none. -(defmethod start-bouncing! ruins-bridge ((obj ruins-bridge)) +(defmethod start-bouncing! ruins-bridge ((this ruins-bridge)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -296,15 +296,15 @@ and translate the platform via the `smush` ;; definition for method 11 of type ruins-bridge ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-bridge ((obj ruins-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! ruins-bridge ((this ruins-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -352,22 +352,22 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-25 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-25 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-bridge-1" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-bridge-1") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-bridge-1") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-bridge-1" :anim-name "1-crumble" :parts 2 :command-list '()) ) - (set! (-> obj basetrans quad) (-> obj root trans quad)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj fall) #t) - (go (method-of-object obj idle)) + (set! (-> this basetrans quad) (-> this root trans quad)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this fall) #t) + (go (method-of-object this idle)) ) (none) ) @@ -382,16 +382,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type ruins-drop-plat -(defmethod inspect ruins-drop-plat ((obj ruins-drop-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruins-drop-plat ((this ruins-drop-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type drop-plat inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -452,15 +452,15 @@ This commonly includes things such as: ;; definition for method 29 of type ruins-drop-plat ;; WARN: Return type mismatch int vs none. -(defmethod start-bouncing! ruins-drop-plat ((obj ruins-drop-plat)) +(defmethod start-bouncing! ruins-drop-plat ((this ruins-drop-plat)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (activate! (-> obj smush) -1.0 60 150 1.0 1.0 (-> self clock)) - (set! (-> obj bounce-time) (current-time)) - (set! (-> obj bouncing) #t) - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) + (activate! (-> this smush) -1.0 60 150 1.0 1.0 (-> self clock)) + (set-time! (-> this bounce-time)) + (set! (-> this bouncing) #t) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -489,7 +489,7 @@ and translate the platform via the `smush` ) :post (behavior () (when (and (nonzero? (-> self root root-prim prim-core collide-as)) - (>= (- (current-time) (-> self state-time)) (seconds 0.25)) + (time-elapsed? (-> self state-time) (seconds 0.25)) ) (let ((v1-9 (-> self root root-prim))) (set! (-> v1-9 prim-core collide-as) (collide-spec)) @@ -508,15 +508,15 @@ and translate the platform via the `smush` ;; definition for method 11 of type ruins-drop-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-drop-plat ((obj ruins-drop-plat) (arg0 entity-actor)) +(defmethod init-from-entity! ruins-drop-plat ((this ruins-drop-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -550,11 +550,11 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (let ((s5-1 ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'art-name 'interp -1000000000.0 @@ -564,117 +564,117 @@ This commonly includes things such as: ) ) ) - (set! (-> obj art-name) (the-as string s5-1)) + (set! (-> this art-name) (the-as string s5-1)) (cond ((string= (the-as string s5-1) "ruins-drop-plat-a-1") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-a-1" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-a-1") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-a-1") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-1-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-a-2") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-a-2" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-a-2") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-a-2") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-2-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-a-3") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-a-3" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-a-3") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-a-3") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-a-1" :anim-name "a-3-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-b-1") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-b-1" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-b-1") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-b-1") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-b-1" :anim-name "b-1-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-b-2") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-b-2" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-b-2") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-b-2") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-b-1" :anim-name "b-2-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-c-1") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-c-1" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-c-1") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-c-1") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-1-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-c-2") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-c-2" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-c-2") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-c-2") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-2-break-center" :parts 1 :command-list '()) ) ) ((string= (the-as string s5-1) "ruins-drop-plat-c-3") (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-drop-plat-c-3" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj art-name) "ruins-drop-plat-c-3") - (set! (-> obj anim) + (set! (-> this art-name) "ruins-drop-plat-c-3") + (set! (-> this anim) (new 'static 'spool-anim :name "ruins-drop-plat-c-1" :anim-name "c-3-break-center" :parts 1 :command-list '()) ) ) @@ -683,13 +683,13 @@ This commonly includes things such as: ) ) ) - (set! (-> obj draw force-lod) 1) - (set! (-> obj break-anim-name) (new 'process 'string 128 (the-as string #f))) - (set! (-> obj basetrans quad) (-> obj root trans quad)) - (set! (-> obj bounce-scale) 0.0) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj fall) #t) - (go (method-of-object obj idle)) + (set! (-> this draw force-lod) 1) + (set! (-> this break-anim-name) (new 'process 'string 128 (the-as string #f))) + (set! (-> this basetrans quad) (-> this root trans quad)) + (set! (-> this bounce-scale) 0.0) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this fall) #t) + (go (method-of-object this idle)) ) (none) ) @@ -714,7 +714,7 @@ This commonly includes things such as: (set! (-> self data-int32 0) 0) (set! (-> self beep-time) (+ (current-time) (seconds -30))) (until #f - (when (>= (- (current-time) (-> self beep-time)) (seconds 40)) + (when (time-elapsed? (-> self beep-time) (seconds 40)) (let ((v1-8 (mod (-> self data-int32 0) (if (= (-> self node-info task) (game-task ruins-tower)) 4 2 @@ -737,7 +737,7 @@ This commonly includes things such as: ) ) ) - (set! (-> self beep-time) (current-time)) + (set-time! (-> self beep-time)) (+! (-> self data-int32 0) 1) ) (b! @@ -792,12 +792,12 @@ This commonly includes things such as: ) (b! #t cfg-17 :delay (nop!)) (label cfg-8) - (when (and (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (when (and (time-elapsed? (-> self time-limit) (seconds 10)) gp-0 (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 40960.0) ) (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) (suspend) (label cfg-17) @@ -816,22 +816,22 @@ This commonly includes things such as: (until (not (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status))))) (b! #t cfg-47 :delay (nop!)) (label cfg-38) - (when (and (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (when (and (time-elapsed? (-> self time-limit) (seconds 10)) gp-0 (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 40960.0) ) (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) (suspend) (label cfg-47) (b! (or (not *target*) (not (logtest? (focus-status mech) (-> *target* focus-status)))) cfg-38 :delay (nop!)) (talker-spawn-func (-> *talker-speech* 457) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) (b! #t cfg-66 :delay (nop!)) (label cfg-52) ) - (when (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (when (time-elapsed? (-> self time-limit) (seconds 10)) (b! (not (and gp-0 (< (vector-vector-xz-distance (target-pos 0) (-> gp-0 extra trans)) 61440.0))) cfg-63 @@ -842,7 +842,7 @@ This commonly includes things such as: (label cfg-63) (talker-spawn-func (-> *talker-speech* 454) *entity-pool* (target-pos 0) (the-as region #f)) (label cfg-64) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) (suspend) (label cfg-66) @@ -871,7 +871,7 @@ This commonly includes things such as: (label cfg-1) (b! #t cfg-14 :delay (nop!)) (label cfg-2) - (let ((a0-2 (>= (- (current-time) (-> self time-limit)) (seconds 10)))) + (let ((a0-2 (time-elapsed? (-> self time-limit) (seconds 10)))) (b! (not a0-2) cfg-11 :likely-delay (set! v1-3 a0-2)) ) (b! (not gp-0) cfg-11 :likely-delay (set! v1-3 gp-0)) @@ -888,7 +888,7 @@ This commonly includes things such as: (label cfg-11) (when v1-3 (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) (suspend) (label cfg-14) @@ -901,7 +901,7 @@ This commonly includes things such as: (set! v1-18 (not (logtest? (focus-status mech) (-> *target* focus-status)))) (label cfg-22) (b! v1-18 cfg-1 :delay (nop!)) - (when (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (when (time-elapsed? (-> self time-limit) (seconds 10)) (b! (not gp-0) cfg-38 :likely-delay (set! v1-25 gp-0)) (let ((v1-27 (-> gp-0 extra process))) (b! (not v1-27) cfg-28 :delay (nop!)) @@ -926,7 +926,7 @@ This commonly includes things such as: (label cfg-38) (when v1-25 (talker-spawn-func (-> *talker-speech* 458) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) ) (suspend) @@ -961,7 +961,7 @@ This commonly includes things such as: (b! #t cfg-20 :delay (nop!)) (label cfg-8) (set! v1-6 - (and (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (and (time-elapsed? (-> self time-limit) (seconds 10)) (and gp-0 (begin (let ((v1-8 (-> gp-0 extra process))) (b! (not v1-8) cfg-14 :delay (nop!)) @@ -981,7 +981,7 @@ This commonly includes things such as: (label cfg-17) (b! (not v1-6) cfg-19 :delay (empty-form)) (talker-spawn-func (-> *talker-speech* 452) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) (label cfg-19) (suspend) (label cfg-20) @@ -989,7 +989,7 @@ This commonly includes things such as: (b! #t cfg-53 :delay (nop!)) (label cfg-25) ) - (when (>= (- (current-time) (-> self time-limit)) (seconds 10)) + (when (time-elapsed? (-> self time-limit) (seconds 10)) (b! (not (and *target* (focus-test? *target* carry))) cfg-43 :delay (empty-form)) (when (< (vector-vector-xz-distance (target-pos 0) @@ -1017,7 +1017,7 @@ This commonly includes things such as: ) ) (talker-spawn-func (-> *talker-speech* 459) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) (b! #t cfg-52 :delay (nop!)) (label cfg-43) @@ -1033,7 +1033,7 @@ This commonly includes things such as: ) ) (talker-spawn-func (-> *talker-speech* 458) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self time-limit) (current-time)) + (set-time! (-> self time-limit)) ) ) (label cfg-52) diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-part_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-part_REF.gc index f857549db4..08a614e29d 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type ruins-part -(defmethod inspect ruins-part ((obj ruins-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruins-part ((this ruins-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc b/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc index b69d013043..170dd6161a 100644 --- a/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/ruins/ruins-scenes_REF.gc @@ -1340,16 +1340,16 @@ The scale will be linearly-interpolated based on the distance from the camera" ) ;; definition for method 3 of type flag -(defmethod inspect flag ((obj flag)) - (when (not obj) - (set! obj obj) +(defmethod inspect flag ((this flag)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1376,24 +1376,24 @@ The scale will be linearly-interpolated based on the distance from the camera" ;; definition for method 11 of type flag ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! flag ((obj flag) (arg0 entity-actor)) +(defmethod init-from-entity! flag ((this flag) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-flag" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 78) obj)) - (add-icon! *minimap* obj (the-as uint 16) (the-as int #f) (the-as vector #t) 0) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 78) this)) + (add-icon! *minimap* this (the-as uint 16) (the-as int #f) (the-as vector #t) 0) + (go (method-of-object this idle)) (none) ) @@ -1413,17 +1413,17 @@ Touching it flips the `play?` field which will trigger the cutscene" ) ;; definition for method 3 of type ruins-precipice -(defmethod inspect ruins-precipice ((obj ruins-precipice)) - (when (not obj) - (set! obj obj) +(defmethod inspect ruins-precipice ((this ruins-precipice)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tplay?: ~A~%" (-> obj play?)) + (format #t "~2Tplay?: ~A~%" (-> this play?)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1485,14 +1485,14 @@ Touching it flips the `play?` field which will trigger the cutscene" ;; definition for method 11 of type ruins-precipice ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! ruins-precipice ((obj ruins-precipice) (arg0 entity-actor)) +(defmethod init-from-entity! ruins-precipice ((this ruins-precipice) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((cshape-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> cshape-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> cshape-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -1507,18 +1507,18 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (vector+! (-> obj root trans) (-> obj root trans) (new 'static 'vector :z 28672.0 :w 1.0)) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) -7198.0376) + (process-drawable-from-entity! this arg0) + (vector+! (-> this root trans) (-> this root trans) (new 'static 'vector :z 28672.0 :w 1.0)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) -7198.0376) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-ruins-precipice" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj play?) #f) - (go (method-of-object obj idle)) + (set! (-> this play?) #f) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/grim-h_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/grim-h_REF.gc index a84734f956..769a59dd79 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/grim-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/grim-h_REF.gc @@ -11,21 +11,17 @@ ) ;; definition for method 3 of type grim -(defmethod inspect grim ((obj grim)) - (when (not obj) - (set! obj obj) +(defmethod inspect grim ((this grim)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type jinx inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc index 167b00f1ca..d1671075fc 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/grim_REF.gc @@ -3,9 +3,9 @@ ;; definition for method 114 of type grim ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! grim ((obj grim)) +(defmethod init-enemy-collision! grim ((this grim)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -70,79 +70,79 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 6)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 115 of type grim -(defmethod init-enemy! grim ((obj grim)) +(defmethod init-enemy! grim ((this grim)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type jinx init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj channel) (the-as uint 25)) - (set! (-> obj min-speed) 20480.0) - (set! (-> obj max-speed) 40960.0) - (set! (-> obj follow-offset) 12288.0) - (set! (-> obj bot-health-index) 1) - (set! (-> obj spot-color) (the-as uint #x50008f00)) - (setup-masks (-> obj draw) 654 #x3fd70) + (set! (-> this channel) (the-as uint 25)) + (set! (-> this min-speed) 20480.0) + (set! (-> this max-speed) 40960.0) + (set! (-> this follow-offset) 12288.0) + (set! (-> this bot-health-index) 1) + (set! (-> this spot-color) (the-as uint #x50008f00)) + (setup-masks (-> this draw) 654 #x3fd70) (none) ) ;; definition for method 244 of type grim ;; WARN: Return type mismatch int vs none. -(defmethod ruffian-method-244 grim ((obj grim)) +(defmethod ruffian-method-244 grim ((this grim)) (with-pp - (ruffian-method-245 obj) - (let ((f30-0 (-> obj nav state speed))) + (ruffian-method-245 this) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 12288.0 40960.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-9 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-9 (= v1-9 (-> obj draw art-group data 34))) - (let ((v1-14 (-> obj skel root-channel 1))) + ((and v1-9 (= v1-9 (-> this draw art-group data 34))) + (let ((v1-14 (-> this skel root-channel 1))) (set! (-> v1-14 frame-interp 1) f28-0) (set! (-> v1-14 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 16.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) - (a0-11 (-> obj skel root-channel 0)) + (a0-11 (-> this skel root-channel 0)) ) (set! (-> a0-11 param 0) f0-11) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-12 (-> obj skel root-channel 1))) + (let ((a0-12 (-> this skel root-channel 1))) (set! (-> a0-12 param 0) 0.0) (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 dist) 13107.2) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 34))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 34))) (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 34)) num-func-loop!) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 34)) num-func-loop!) ) - (let ((a0-15 (-> obj skel root-channel 1))) + (let ((a0-15 (-> this skel root-channel 1))) (set! (-> a0-15 frame-interp 1) f28-0) (set! (-> a0-15 frame-interp 0) f28-0) (set! (-> a0-15 dist) 21843.969) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 35))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 35))) (set! (-> a0-15 param 0) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 35)) num-func-chan) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 35)) num-func-chan) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc index 7a4c9898d1..0c43629e33 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-bomb_REF.gc @@ -19,20 +19,20 @@ ) ;; definition for method 3 of type jinx-bomb -(defmethod inspect jinx-bomb ((obj jinx-bomb)) - (when (not obj) - (set! obj obj) +(defmethod inspect jinx-bomb ((this jinx-bomb)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tfuse-delay: ~D~%" (-> obj fuse-delay)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tshake-screen?: ~A~%" (-> obj shake-screen?)) - (format #t "~2Texplode-func: ~A~%" (-> obj explode-func)) + (format #t "~2Tfuse-delay: ~D~%" (-> this fuse-delay)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tshake-screen?: ~A~%" (-> this shake-screen?)) + (format #t "~2Texplode-func: ~A~%" (-> this explode-func)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -55,11 +55,11 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (and (nonzero? (-> self fuse-delay)) - (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self fuse-delay))) + (time-elapsed? (-> self state-time) (the-as time-frame (-> self fuse-delay))) ) (go-virtual explode) ) @@ -78,7 +78,7 @@ (defstate explode (jinx-bomb) :virtual #t :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self draw status) (draw-control-status no-draw)) (let ((v1-6 (-> self root root-prim))) (set! (-> v1-6 prim-core collide-as) (collide-spec)) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-h_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-h_REF.gc index aa09217000..ec3a953e0b 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-h_REF.gc @@ -14,19 +14,19 @@ ) ;; definition for method 3 of type jinx -(defmethod inspect jinx ((obj jinx)) - (when (not obj) - (set! obj obj) +(defmethod inspect jinx ((this jinx)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type ruffian inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbomb-handle: ~D~%" (-> obj bomb-handle)) - (format #t "~2Tbomb-func: ~A~%" (-> obj bomb-func)) - (format #t "~2Tbomb-fuse-delay: ~D~%" (-> obj bomb-fuse-delay)) + (format #t "~2Tbomb-handle: ~D~%" (-> this bomb-handle)) + (format #t "~2Tbomb-func: ~A~%" (-> this bomb-func)) + (format #t "~2Tbomb-fuse-delay: ~D~%" (-> this bomb-fuse-delay)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-states_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-states_REF.gc index 0ee9684614..f188fba91a 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/jinx-states_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/jinx-states_REF.gc @@ -479,7 +479,7 @@ (until (ja-done? 0) (seek-toward-heading-vec! (-> self root) (-> self focus-info bullseye-xz-dir) 131072.0 (seconds 0.05)) (bot-method-223 self #t) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (and (time-elapsed? (-> self state-time) (seconds 0.1)) (or (not (bot-method-214 self)) (not (ruffian-method-237 self))) ) (react-to-focus self) @@ -567,12 +567,12 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (if (and (logtest? (-> self bot-flags) (bot-flags failed)) - (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (time-elapsed? (-> self state-time) (seconds 0.5)) (reset? *fail-mission-control*) ) (reset! *fail-mission-control*) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/jinx_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/jinx_REF.gc index b14a7def31..8c4b5c2260 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/jinx_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/jinx_REF.gc @@ -12,15 +12,15 @@ ) ;; definition for method 3 of type jinx-anim-info -(defmethod inspect jinx-anim-info ((obj jinx-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect jinx-anim-info ((this jinx-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'jinx-anim-info) - (format #t "~1Tanim-index: ~D~%" (-> obj anim-index)) + (format #t "[~8x] ~A~%" this 'jinx-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) (label cfg-4) - obj + this ) ;; definition of type jinx-global-info @@ -39,21 +39,21 @@ ) ;; definition for method 3 of type jinx-global-info -(defmethod inspect jinx-global-info ((obj jinx-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect jinx-global-info ((this jinx-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-blue-hit-front: ~D~%" (-> obj prev-blue-hit-front)) - (format #t "~1Tprev-blue-hit-back: ~D~%" (-> obj prev-blue-hit-back)) - (format #t "~1Tblue-hit-front-anim[3] @ #x~X~%" (-> obj blue-hit-front-anim)) - (format #t "~1Tblue-hit-back-anim[3] @ #x~X~%" (-> obj blue-hit-back-anim)) - (format #t "~1Tkick-anim[2] @ #x~X~%" (-> obj kick-anim)) - (format #t "~1Tscared-idle-anim[5] @ #x~X~%" (-> obj scared-idle-anim)) - (format #t "~1Tbomb-recoil-anim[2] @ #x~X~%" (-> obj bomb-recoil-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-blue-hit-front: ~D~%" (-> this prev-blue-hit-front)) + (format #t "~1Tprev-blue-hit-back: ~D~%" (-> this prev-blue-hit-back)) + (format #t "~1Tblue-hit-front-anim[3] @ #x~X~%" (-> this blue-hit-front-anim)) + (format #t "~1Tblue-hit-back-anim[3] @ #x~X~%" (-> this blue-hit-back-anim)) + (format #t "~1Tkick-anim[2] @ #x~X~%" (-> this kick-anim)) + (format #t "~1Tscared-idle-anim[5] @ #x~X~%" (-> this scared-idle-anim)) + (format #t "~1Tbomb-recoil-anim[2] @ #x~X~%" (-> this bomb-recoil-anim)) (label cfg-4) - obj + this ) ;; definition for symbol *jinx-global-info*, type jinx-global-info @@ -243,38 +243,38 @@ (set! (-> *jinx-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type jinx -(defmethod general-event-handler jinx ((obj jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler jinx ((this jinx) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('request) (case (-> arg3 param 0) (('explode) - (send-event (handle->process (-> obj bomb-handle)) 'trigger) + (send-event (handle->process (-> this bomb-handle)) 'trigger) ) (('no-bomb) - (send-event (handle->process (-> obj bomb-handle)) 'die-fast) + (send-event (handle->process (-> this bomb-handle)) 'die-fast) ) (('replace-bomb) - (setup-masks (-> obj draw) 4096 0) + (setup-masks (-> this draw) 4096 0) #t ) (else - ((method-of-type ruffian general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type ruffian general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type ruffian general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type ruffian general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 114 of type jinx ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! jinx ((obj jinx)) +(defmethod init-enemy-collision! jinx ((this jinx)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -339,7 +339,7 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 6)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -347,28 +347,28 @@ ;; definition for method 115 of type jinx ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! jinx ((obj jinx)) +(defmethod init-enemy! jinx ((this jinx)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init! obj) - (set! (-> obj min-speed) 24576.0) - (set! (-> obj max-speed) 49152.0) - (set! (-> obj follow-offset) 24576.0) - (set! (-> obj channel) (the-as uint 24)) - (set! (-> obj notice-enemy-dist) 204800.0) - (set! (-> obj travel-anim-interp) 0.0) - (set! (-> obj focus-info max-los-dist) 61440.0) - (set! (-> obj bomb-handle) (the-as handle #f)) - (set! (-> obj bomb-func) #f) + (init! this) + (set! (-> this min-speed) 24576.0) + (set! (-> this max-speed) 49152.0) + (set! (-> this follow-offset) 24576.0) + (set! (-> this channel) (the-as uint 24)) + (set! (-> this notice-enemy-dist) 204800.0) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 61440.0) + (set! (-> this bomb-handle) (the-as handle #f)) + (set! (-> this bomb-func) #f) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-jinx" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *jinx-nav-enemy-info*) - (set! (-> obj draw light-index) (the-as uint 10)) - (setup-masks (-> obj draw) 6882 #x3e51c) - (set! (-> obj swivel-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 4)) - (let ((v1-17 (-> obj neck))) + (init-enemy-behaviour-and-stats! this *jinx-nav-enemy-info*) + (set! (-> this draw light-index) (the-as uint 10)) + (setup-masks (-> this draw) 6882 #x3e51c) + (set! (-> this swivel-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) + (let ((v1-17 (-> this neck))) (set! (-> v1-17 up) (the-as uint 1)) (set! (-> v1-17 nose) (the-as uint 2)) (set! (-> v1-17 ear) (the-as uint 0)) @@ -376,9 +376,9 @@ (set! (-> v1-17 ignore-angle) 30947.555) ) (let ((t9-6 (method-of-type ruffian init-enemy!))) - (t9-6 obj) + (t9-6 this) ) - (set! (-> obj my-simple-focus) (process-spawn simple-focus :to obj)) + (set! (-> this my-simple-focus) (process-spawn simple-focus :to this)) 0 (none) ) @@ -386,16 +386,16 @@ ;; definition for method 239 of type jinx ;; INFO: Used lq/sq ;; WARN: Return type mismatch (pointer process) vs none. -(defmethod fire-gun jinx ((obj jinx) (arg0 vector)) - (set! (-> obj next-fire-time) (+ (current-time) (get-rand-int-range obj 150 600))) - (+! (-> obj fired-gun-count) 1) +(defmethod fire-gun jinx ((this jinx) (arg0 vector)) + (set! (-> this next-fire-time) (+ (current-time) (get-rand-int-range this 150 600))) + (+! (-> this fired-gun-count) 1) (let ((s4-1 (new 'stack-no-clear 'projectile-init-by-other-params))) - (set! (-> s4-1 ent) (-> obj entity)) + (set! (-> s4-1 ent) (-> this entity)) (set! (-> s4-1 charge) 1.0) (set! (-> s4-1 options) (projectile-options account-for-target-velocity proj-options-8000)) (set! (-> s4-1 notify-handle) (the-as handle #f)) (set! (-> s4-1 owner-handle) (the-as handle #f)) - (set! (-> s4-1 ignore-handle) (process->handle obj)) + (set! (-> s4-1 ignore-handle) (process->handle this)) (let* ((v1-12 *game-info*) (a0-7 (+ (-> v1-12 attack-id) 1)) ) @@ -403,66 +403,66 @@ (set! (-> s4-1 attack-id) a0-7) ) (set! (-> s4-1 timeout) (seconds 4)) - (vector<-cspace! (-> s4-1 pos) (-> obj node-list data 24)) + (vector<-cspace! (-> s4-1 pos) (-> this node-list data 24)) (set! (-> s4-1 vel quad) (-> arg0 quad)) (vector-! (-> s4-1 vel) (-> s4-1 vel) (-> s4-1 pos)) (vector-normalize! (-> s4-1 vel) 307200.0) - (spawn-projectile jinx-shot s4-1 obj *default-dead-pool*) + (spawn-projectile jinx-shot s4-1 this *default-dead-pool*) ) (none) ) ;; definition for method 244 of type jinx ;; WARN: Return type mismatch int vs none. -(defmethod ruffian-method-244 jinx ((obj jinx)) +(defmethod ruffian-method-244 jinx ((this jinx)) (with-pp - (ruffian-method-245 obj) - (let ((f30-0 (-> obj nav state speed))) + (ruffian-method-245 this) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 12288.0 40960.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-9 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-9 (= v1-9 (-> obj draw art-group data 32))) - (let ((v1-14 (-> obj skel root-channel 1))) + ((and v1-9 (= v1-9 (-> this draw art-group data 32))) + (let ((v1-14 (-> this skel root-channel 1))) (set! (-> v1-14 frame-interp 1) f28-0) (set! (-> v1-14 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 16.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) - (a0-11 (-> obj skel root-channel 0)) + (a0-11 (-> this skel root-channel 0)) ) (set! (-> a0-11 param 0) f0-11) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-12 (-> obj skel root-channel 1))) + (let ((a0-12 (-> this skel root-channel 1))) (set! (-> a0-12 param 0) 0.0) (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 dist) 13107.2) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 32))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 32))) (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 32)) num-func-loop!) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 32)) num-func-loop!) ) - (let ((a0-15 (-> obj skel root-channel 1))) + (let ((a0-15 (-> this skel root-channel 1))) (set! (-> a0-15 frame-interp 1) f28-0) (set! (-> a0-15 frame-interp 0) f28-0) (set! (-> a0-15 dist) 21843.969) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 33))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) (set! (-> a0-15 param 0) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 33)) num-func-chan) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-chan) ) ) ) @@ -473,32 +473,32 @@ ) ;; definition for method 77 of type jinx -(defmethod enemy-method-77 jinx ((obj jinx) (arg0 (pointer float))) - (let ((v1-0 (-> obj incoming knocked-type))) +(defmethod enemy-method-77 jinx ((this jinx) (arg0 (pointer float))) + (let ((v1-0 (-> this incoming knocked-type))) (cond ((= v1-0 (knocked-type knocked-type-6)) (let ((s4-0 (new 'stack-no-clear 'vector)) (s5-1 (new 'stack-no-clear 'vector)) ) - (enemy-method-50 obj s4-0) - (vector-z-quaternion! s5-1 (-> obj root quat)) + (enemy-method-50 this s4-0) + (vector-z-quaternion! s5-1 (-> this root quat)) (cond ((>= (vector-dot s4-0 s5-1) 0.0) - (let* ((v1-7 (enemy-method-120 obj 3 (ash 1 (-> *jinx-global-info* prev-blue-hit-back)))) - (s5-2 (-> obj draw art-group data (-> *jinx-global-info* blue-hit-back-anim v1-7))) + (let* ((v1-7 (enemy-method-120 this 3 (ash 1 (-> *jinx-global-info* prev-blue-hit-back)))) + (s5-2 (-> this draw art-group data (-> *jinx-global-info* blue-hit-back-anim v1-7))) ) (set! (-> *jinx-global-info* prev-blue-hit-back) v1-7) - (let ((v1-10 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-10 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-10 (= v1-10 (-> obj draw art-group data 16))) + (if (and v1-10 (= v1-10 (-> this draw art-group data 16))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-17 (-> obj skel root-channel 0))) + (let ((a0-17 (-> this skel root-channel 0))) (set! (-> a0-17 frame-group) (the-as art-joint-anim s5-2)) (set! (-> a0-17 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) (set! (-> a0-17 param 1) 1.0) @@ -508,21 +508,21 @@ ) ) (else - (let* ((v1-24 (enemy-method-120 obj 3 (ash 1 (-> *jinx-global-info* prev-blue-hit-front)))) - (s5-3 (-> obj draw art-group data (-> *jinx-global-info* blue-hit-front-anim v1-24))) + (let* ((v1-24 (enemy-method-120 this 3 (ash 1 (-> *jinx-global-info* prev-blue-hit-front)))) + (s5-3 (-> this draw art-group data (-> *jinx-global-info* blue-hit-front-anim v1-24))) ) (set! (-> *jinx-global-info* prev-blue-hit-front) v1-24) - (let ((v1-27 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-27 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (if (and v1-27 (= v1-27 (-> obj draw art-group data 16))) + (if (and v1-27 (= v1-27 (-> this draw art-group data 16))) (ja-channel-push! 1 (seconds 0.17)) (ja-channel-push! 1 (seconds 0.02)) ) ) - (let ((a0-31 (-> obj skel root-channel 0))) + (let ((a0-31 (-> this skel root-channel 0))) (set! (-> a0-31 frame-group) (the-as art-joint-anim s5-3)) (set! (-> a0-31 param 0) (the float (+ (-> (the-as art-joint-anim s5-3) frames num-frames) -1))) (set! (-> a0-31 param 1) 1.0) @@ -536,44 +536,44 @@ ) ((= v1-0 (knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-34 (-> obj skel root-channel 0))) - (set! (-> a0-34 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-34 (-> this skel root-channel 0))) + (set! (-> a0-34 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-34 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-34 param 1) 1.0) (set! (-> a0-34 frame-num) 0.0) - (joint-control-channel-group! a0-34 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-34 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) ) - ((zero? (get-rand-int obj 3)) + ((zero? (get-rand-int this 3)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-37 (-> obj skel root-channel 0))) - (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> obj draw art-group data 21))) + (let ((a0-37 (-> this skel root-channel 0))) + (set! (-> a0-37 frame-group) (the-as art-joint-anim (-> this draw art-group data 21))) (set! (-> a0-37 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 21)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 21)) frames num-frames) -1)) ) (set! (-> a0-37 param 1) 1.0) (set! (-> a0-37 frame-num) 0.0) - (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> obj draw art-group data 21)) num-func-seek!) + (joint-control-channel-group! a0-37 (the-as art-joint-anim (-> this draw art-group data 21)) num-func-seek!) ) ) (else (let ((s4-1 (new 'stack-no-clear 'vector))) 0.0 0.0 - (vector-z-quaternion! s4-1 (-> obj root quat)) + (vector-z-quaternion! s4-1 (-> this root quat)) (let ((f30-0 (atan (-> s4-1 x) (-> s4-1 z)))) - (enemy-method-50 obj s4-1) + (enemy-method-50 this s4-1) (let* ((f0-24 (atan (-> s4-1 x) (-> s4-1 z))) (s4-2 (if (< (deg- f0-24 f30-0) 0.0) - (-> obj draw art-group data 17) - (-> obj draw art-group data 19) + (-> this draw art-group data 17) + (-> this draw art-group data 19) ) ) ) (ja-channel-push! 1 (seconds 0.03)) - (let ((a0-44 (-> obj skel root-channel 0))) + (let ((a0-44 (-> this skel root-channel 0))) (set! (-> a0-44 frame-group) (the-as art-joint-anim s4-2)) (set! (-> a0-44 param 0) (the float (+ (-> (the-as art-joint-anim s4-2) frames num-frames) -1))) (set! (-> a0-44 param 1) (-> arg0 0)) @@ -590,85 +590,85 @@ ) ;; definition for method 78 of type jinx -(defmethod enemy-method-78 jinx ((obj jinx) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 jinx ((this jinx) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) - (-> obj draw art-group data 16) + (when (>= (-> this incoming blue-juggle-count) (the-as uint 2)) + (-> this draw art-group data 16) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 16))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 16)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) 1.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 16)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) ) #t ) ) (((knocked-type knocked-type-2)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 24))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 24))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 24)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 24)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) 1.0) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 24)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 24)) num-func-seek!) ) #t ) (else - (let ((v1-37 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-37 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-37 (= v1-37 (-> obj draw art-group data 21))) + ((and v1-37 (= v1-37 (-> this draw art-group data 21))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-12 (-> obj skel root-channel 0))) - (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-12 (-> this skel root-channel 0))) + (set! (-> a0-12 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-12 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-12 param 1) 1.0) (set! (-> a0-12 frame-num) 0.0) - (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-12 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) ) (else - (let ((v1-57 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-57 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-57 (= v1-57 (-> obj draw art-group data 17))) + ((and v1-57 (= v1-57 (-> this draw art-group data 17))) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-18 (-> obj skel root-channel 0))) - (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-18 (-> this skel root-channel 0))) + (set! (-> a0-18 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-18 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-18 param 1) 1.0) (set! (-> a0-18 frame-num) 0.0) - (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-18 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) ) (else (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-20 (-> obj skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((a0-20 (-> this skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> a0-20 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> a0-20 param 1) 1.0) (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) ) ) @@ -682,42 +682,42 @@ ) ;; definition for method 79 of type jinx -(defmethod enemy-method-79 jinx ((obj jinx) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 jinx ((this jinx) (arg0 int) (arg1 enemy-knocked-info)) (let ((f30-0 -1.0)) - (when (and (= arg0 3) (logtest? (-> obj bot-flags) (bot-flags attacked))) - (let ((v1-7 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (when (and (= arg0 3) (logtest? (-> this bot-flags) (bot-flags attacked))) + (let ((v1-7 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-7 (= v1-7 (-> obj draw art-group data 22))) + ((and v1-7 (= v1-7 (-> this draw art-group data 22))) (set! f30-0 17.0) ) - ((let ((v1-15 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((let ((v1-15 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-15 (= v1-15 (-> obj draw art-group data 20))) + (and v1-15 (= v1-15 (-> this draw art-group data 20))) ) (set! f30-0 23.0) ) - ((let ((v1-23 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((let ((v1-23 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-23 (= v1-23 (-> obj draw art-group data 18))) + (and v1-23 (= v1-23 (-> this draw art-group data 18))) ) (set! f30-0 11.0) ) - ((let ((v1-31 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + ((let ((v1-31 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (and v1-31 (= v1-31 (-> obj draw art-group data 16))) + (and v1-31 (= v1-31 (-> this draw art-group data 16))) ) (set! f30-0 12.0) ) @@ -726,7 +726,7 @@ ) (cond ((>= f30-0 0.0) - (let ((a0-1 (-> obj skel root-channel 0))) + (let ((a0-1 (-> this skel root-channel 0))) (set! (-> a0-1 param 0) (the float (+ (-> a0-1 frame-group frames num-frames) -1))) (set! (-> a0-1 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) @@ -734,16 +734,16 @@ (>= (ja-aframe-num 0) f30-0) ) (else - ((method-of-type ruffian enemy-method-79) obj arg0 arg1) + ((method-of-type ruffian enemy-method-79) this arg0 arg1) ) ) ) ) ;; definition for method 84 of type jinx -(defmethod enemy-method-84 jinx ((obj jinx) (arg0 enemy-jump-info)) +(defmethod enemy-method-84 jinx ((this jinx) (arg0 enemy-jump-info)) (let ((f0-0 (vector-vector-xz-distance (-> arg0 start-pos) (-> arg0 dest-pos)))) - (fmax (-> obj enemy-info jump-height-min) (* (-> obj enemy-info jump-height-factor) f0-0)) + (fmax (-> this enemy-info jump-height-min) (* (-> this enemy-info jump-height-factor) f0-0)) ) (let ((f0-3 3072.0)) (setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f0-3 -4.551111) @@ -753,101 +753,103 @@ ;; definition for method 216 of type jinx ;; WARN: Return type mismatch int vs none. -(defmethod bot-method-216 jinx ((obj jinx)) - (set! (-> obj health-handle) (ppointer->handle (process-spawn hud-ruffians :init hud-init-by-other :to obj))) +(defmethod bot-method-216 jinx ((this jinx)) + (set! (-> this health-handle) + (ppointer->handle (process-spawn hud-ruffians :init hud-init-by-other :to this)) + ) 0 (none) ) ;; definition for method 15 of type hud-ruffians ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-ruffians ((obj hud-ruffians)) +(defmethod draw hud-ruffians ((this hud-ruffians)) (set-hud-piece-position! - (-> obj sprites 2) - (the int (+ 20.0 (* -130.0 (-> obj offset)))) - (the int (+ 15.0 (* -100.0 (-> obj offset)))) + (-> this sprites 2) + (the int (+ 20.0 (* -130.0 (-> this offset)))) + (the int (+ 15.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 15 2) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 15 2) (set-hud-piece-position! - (-> obj sprites 6) - (the int (+ 100.0 (* -130.0 (-> obj offset)))) - (the int (+ 15.0 (* -100.0 (-> obj offset)))) + (-> this sprites 6) + (the int (+ 100.0 (* -130.0 (-> this offset)))) + (the int (+ 15.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 4 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 1 current)) 100))))) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 6)) 40 16) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 6)) 1 16) - (set-as-offset-from! (-> obj sprites 7) (the-as vector4w (-> obj sprites 6)) 15 2) + (set! (-> this sprites 4 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 1 current)) 100))))) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 6)) 40 16) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 6)) 1 16) + (set-as-offset-from! (-> this sprites 7) (the-as vector4w (-> this sprites 6)) 15 2) (set-hud-piece-position! - (-> obj sprites 10) - (the int (+ 20.0 (* -130.0 (-> obj offset)))) - (the int (+ 85.0 (* -100.0 (-> obj offset)))) + (-> this sprites 10) + (the int (+ 20.0 (* -130.0 (-> this offset)))) + (the int (+ 85.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 8 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 2 current)) 100))))) - (set-as-offset-from! (-> obj sprites 8) (the-as vector4w (-> obj sprites 10)) 40 16) - (set-as-offset-from! (-> obj sprites 9) (the-as vector4w (-> obj sprites 10)) 1 16) - (set-as-offset-from! (-> obj sprites 11) (the-as vector4w (-> obj sprites 10)) 15 2) - ((method-of-type hud draw) obj) + (set! (-> this sprites 8 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 2 current)) 100))))) + (set-as-offset-from! (-> this sprites 8) (the-as vector4w (-> this sprites 10)) 40 16) + (set-as-offset-from! (-> this sprites 9) (the-as vector4w (-> this sprites 10)) 1 16) + (set-as-offset-from! (-> this sprites 11) (the-as vector4w (-> this sprites 10)) 15 2) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-ruffians ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-ruffians ((obj hud-ruffians)) - (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) - (set! (-> obj values 1 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) - (set! (-> obj values 2 target) (the int (* 100.0 (-> *game-info* bot-health 2)))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-ruffians ((this hud-ruffians)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + (set! (-> this values 1 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) + (set! (-> this values 2 target) (the int (* 100.0 (-> *game-info* bot-health 2)))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-ruffians ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-ruffians ((obj hud-ruffians)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-ruffians ((this hud-ruffians)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 scale-x) 12.0) - (set! (-> obj sprites 0 scale-y) 11.2) - (set! (-> obj sprites 0 pos z) #xfffff2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd57))) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.4) - (set! (-> obj sprites 3 pos z) #xffffff) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 4 scale-x) 12.0) - (set! (-> obj sprites 4 scale-y) 11.2) - (set! (-> obj sprites 4 pos z) #xfffff2) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 5 pos z) #xfffff0) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 6 pos z) #xffffff) - (set! (-> obj sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd57))) - (set! (-> obj sprites 7 scale-x) 1.0) - (set! (-> obj sprites 7 scale-y) 1.4) - (set! (-> obj sprites 7 pos z) #xffffff) - (set! (-> obj sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 8 scale-x) 12.0) - (set! (-> obj sprites 8 scale-y) 11.2) - (set! (-> obj sprites 8 pos z) #xfffff2) - (set! (-> obj sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 9 pos z) #xfffff0) - (set! (-> obj sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 10 pos z) #xffffff) - (set! (-> obj sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xd57))) - (set! (-> obj sprites 11 scale-x) 1.0) - (set! (-> obj sprites 11 scale-y) 1.4) - (set! (-> obj sprites 11 pos z) #xffffff) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd57))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.4) + (set! (-> this sprites 3 pos z) #xffffff) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 4 scale-x) 12.0) + (set! (-> this sprites 4 scale-y) 11.2) + (set! (-> this sprites 4 pos z) #xfffff2) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 5 pos z) #xfffff0) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 6 pos z) #xffffff) + (set! (-> this sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd57))) + (set! (-> this sprites 7 scale-x) 1.0) + (set! (-> this sprites 7 scale-y) 1.4) + (set! (-> this sprites 7 pos z) #xffffff) + (set! (-> this sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 8 scale-x) 12.0) + (set! (-> this sprites 8 scale-y) 11.2) + (set! (-> this sprites 8 pos z) #xfffff2) + (set! (-> this sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 9 pos z) #xfffff0) + (set! (-> this sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 10 pos z) #xffffff) + (set! (-> this sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xd57))) + (set! (-> this sprites 11 scale-x) 1.0) + (set! (-> this sprites 11 scale-y) 1.4) + (set! (-> this sprites 11 pos z) #xffffff) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/mog-h_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/mog-h_REF.gc index b55c6dba17..5647aedcac 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/mog-h_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/mog-h_REF.gc @@ -11,21 +11,17 @@ ) ;; definition for method 3 of type mog -(defmethod inspect mog ((obj mog)) - (when (not obj) - (set! obj obj) +(defmethod inspect mog ((this mog)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type jinx inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc b/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc index ff31de46e1..81c1c01304 100644 --- a/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/escort/mog_REF.gc @@ -196,9 +196,9 @@ ;; definition for method 114 of type mog ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! mog ((obj mog)) +(defmethod init-enemy-collision! mog ((this mog)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -263,82 +263,82 @@ ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) (set! (-> s5-0 event-priority) (the-as uint 6)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 115 of type mog -(defmethod init-enemy! mog ((obj mog)) +(defmethod init-enemy! mog ((this mog)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (let ((t9-0 (method-of-type jinx init-enemy!))) - (t9-0 obj) + (t9-0 this) ) - (set-enemy-info! obj *mog-nav-enemy-info*) - (set! (-> obj channel) (the-as uint 23)) - (set! (-> obj spot-color) (the-as uint #x50ff0000)) - (set-vector! (-> obj root scale) 1.15 1.15 1.15 1.0) - (set! (-> obj skel prebind-function) mog-prebind-function) - (set! (-> obj min-speed) 14336.0) - (set! (-> obj max-speed) 32768.0) - (set! (-> obj follow-offset) -20480.0) - (set! (-> obj bot-health-index) 2) - (setup-masks (-> obj draw) #x26002 #x19ffc) + (set-enemy-info! this *mog-nav-enemy-info*) + (set! (-> this channel) (the-as uint 23)) + (set! (-> this spot-color) (the-as uint #x50ff0000)) + (set-vector! (-> this root scale) 1.15 1.15 1.15 1.0) + (set! (-> this skel prebind-function) mog-prebind-function) + (set! (-> this min-speed) 14336.0) + (set! (-> this max-speed) 32768.0) + (set! (-> this follow-offset) -20480.0) + (set! (-> this bot-health-index) 2) + (setup-masks (-> this draw) #x26002 #x19ffc) (none) ) ;; definition for method 244 of type mog ;; WARN: Return type mismatch int vs none. -(defmethod ruffian-method-244 mog ((obj mog)) +(defmethod ruffian-method-244 mog ((this mog)) (with-pp - (ruffian-method-245 obj) - (let ((f30-0 (-> obj nav state speed))) + (ruffian-method-245 this) + (let ((f30-0 (-> this nav state speed))) (let ((f0-1 (lerp-scale 0.0 1.0 f30-0 12288.0 40960.0))) - (seek! (-> obj travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) + (seek! (-> this travel-anim-interp) f0-1 (* 4.0 (seconds-per-frame))) ) - (let ((f28-0 (-> obj travel-anim-interp)) - (v1-9 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((f28-0 (-> this travel-anim-interp)) + (v1-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and v1-9 (= v1-9 (-> obj draw art-group data 36))) - (let ((v1-14 (-> obj skel root-channel 1))) + ((and v1-9 (= v1-9 (-> this draw art-group data 36))) + (let ((v1-14 (-> this skel root-channel 1))) (set! (-> v1-14 frame-interp 1) f28-0) (set! (-> v1-14 frame-interp 0) f28-0) ) - (let* ((f28-1 (current-cycle-distance (-> obj skel))) - (f0-5 (quaternion-y-angle (-> obj root quat))) - (f1-2 (deg- f0-5 (-> obj travel-prev-ry))) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-5 (quaternion-y-angle (-> this root quat))) + (f1-2 (deg- f0-5 (-> this travel-prev-ry))) (f0-8 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-2)))) (f0-11 (/ (* 20.0 (fmax f30-0 f0-8)) (* 15.0 f28-1))) - (a0-11 (-> obj skel root-channel 0)) + (a0-11 (-> this skel root-channel 0)) ) (set! (-> a0-11 param 0) f0-11) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-12 (-> obj skel root-channel 1))) + (let ((a0-12 (-> this skel root-channel 1))) (set! (-> a0-12 param 0) 0.0) (joint-control-channel-group-eval! a0-12 (the-as art-joint-anim #f) num-func-chan) ) ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-14 (-> obj skel root-channel 0))) + (let ((a0-14 (-> this skel root-channel 0))) (set! (-> a0-14 dist) 13107.2) - (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> obj draw art-group data 36))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 36))) (set! (-> a0-14 param 0) 1.0) - (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> obj draw art-group data 36)) num-func-loop!) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 36)) num-func-loop!) ) - (let ((a0-15 (-> obj skel root-channel 1))) + (let ((a0-15 (-> this skel root-channel 1))) (set! (-> a0-15 frame-interp 1) f28-0) (set! (-> a0-15 frame-interp 0) f28-0) (set! (-> a0-15 dist) 21843.969) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 37))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 37))) (set! (-> a0-15 param 0) 0.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 37)) num-func-chan) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 37)) num-func-chan) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc b/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc index b4055ef8dd..42f8087e86 100644 --- a/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/gator_REF.gc @@ -29,21 +29,21 @@ ) ;; definition for method 3 of type gator -(defmethod inspect gator ((obj gator)) - (when (not obj) - (set! obj obj) +(defmethod inspect gator ((this gator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tocean-y: ~f~%" (-> obj ocean-y)) - (format #t "~2Tlock-nav-target: ~A~%" (-> obj lock-nav-target)) - (format #t "~2Tnew-facing: #~%" (-> obj new-facing)) - (format #t "~2Told-facing: #~%" (-> obj old-facing)) - (format #t "~2Tturn-time: ~D~%" (-> obj turn-time)) + (format #t "~2Tocean-y: ~f~%" (-> this ocean-y)) + (format #t "~2Tlock-nav-target: ~A~%" (-> this lock-nav-target)) + (format #t "~2Tnew-facing: #~%" (-> this new-facing)) + (format #t "~2Told-facing: #~%" (-> this old-facing)) + (format #t "~2Tturn-time: ~D~%" (-> this turn-time)) (label cfg-4) - obj + this ) ;; definition for symbol *gator-nav-enemy-info*, type nav-enemy-info @@ -160,53 +160,53 @@ (set! (-> *gator-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type gator -(defmethod general-event-handler gator ((obj gator) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler gator ((this gator) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case event-type (('hit-knocked) - (when (= (-> obj incoming knocked-type) (knocked-type knocked-type-4)) - (set! (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + (when (= (-> this incoming knocked-type) (knocked-type knocked-type-4)) + (set! (-> this incoming knocked-type) (knocked-type knocked-type-0)) 0 ) - ((method-of-type nav-enemy general-event-handler) obj proc arg2 event-type event) + ((method-of-type nav-enemy general-event-handler) this proc arg2 event-type event) ) (('track) #f ) (else - ((method-of-type nav-enemy general-event-handler) obj proc arg2 event-type event) + ((method-of-type nav-enemy general-event-handler) this proc arg2 event-type event) ) ) ) ;; definition for method 179 of type gator -(defmethod adjust-depth! gator ((obj gator)) +(defmethod adjust-depth! gator ((this gator)) "Changes the height based on the ocean depth @see [[get-height]]" - (set! (-> obj ocean-y) (get-height *ocean* (-> obj root trans) #t)) - (set! (-> obj root trans y) (+ -10240.0 (-> obj ocean-y))) + (set! (-> this ocean-y) (get-height *ocean* (-> this root trans) #t)) + (set! (-> this root trans y) (+ -10240.0 (-> this ocean-y))) ) ;; definition for method 180 of type gator ;; INFO: Used lq/sq -(defmethod update-facing! gator ((obj gator) (arg0 vector)) +(defmethod update-facing! gator ((this gator) (arg0 vector)) "Updates the `new-facing` vector" - (let ((matrix (quaternion->matrix (new 'stack-no-clear 'matrix) (-> obj root quat)))) + (let ((matrix (quaternion->matrix (new 'stack-no-clear 'matrix) (-> this root quat)))) (set! (-> arg0 quad) (-> matrix vector 2 quad)) ) arg0 ) ;; definition for method 181 of type gator -(defmethod encircle-target! gator ((obj gator) (arg0 float) (arg1 float) (arg2 symbol)) +(defmethod encircle-target! gator ((this gator) (arg0 float) (arg1 float) (arg2 symbol)) "Core movement for the [[gator]], circles the target, charges at the target, etc @params TODO - not sure, they all dont seem to do very much and this method is a mess" (local-vars (v1-17 object) (a0-5 object)) - (let ((f30-0 (vector-dot (-> obj new-facing) (-> obj old-facing))) + (let ((f30-0 (vector-dot (-> this new-facing) (-> this old-facing))) (s5-0 75) - (s4-0 (the-as art-joint-anim (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (s4-0 (the-as art-joint-anim (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) @@ -214,80 +214,80 @@ (b! (not arg2) cfg-26 :delay (nop!)) (set! s5-0 18) (b! (>= f30-0 (cos (* 182.04445 arg0))) cfg-8 :delay #f) - (if (< (-> (vector-cross! (new 'stack-no-clear 'vector) (-> obj new-facing) (-> obj old-facing)) y) 0.0) - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 40))) - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 39))) + (if (< (-> (vector-cross! (new 'stack-no-clear 'vector) (-> this new-facing) (-> this old-facing)) y) 0.0) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 40))) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 39))) ) (b! #t cfg-25 :delay (nop!)) (label cfg-8) (let ((v1-16 (< (cos (* 182.04445 arg1)) f30-0))) (b! v1-16 cfg-23 :likely-delay (set! v1-17 v1-16)) ) - (let ((v1-20 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-20 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (b! (not v1-20) cfg-21 :likely-delay (set! a0-5 v1-20)) - (let ((a1-3 (= v1-20 (-> obj draw art-group data 14)))) + (let ((a1-3 (= v1-20 (-> this draw art-group data 14)))) (b! a1-3 cfg-21 :likely-delay (set! a0-5 a1-3)) ) - (let ((a1-4 (= v1-20 (-> obj draw art-group data 40)))) + (let ((a1-4 (= v1-20 (-> this draw art-group data 40)))) (b! a1-4 cfg-21 :likely-delay (set! a0-5 a1-4)) ) - (set! a0-5 (= v1-20 (-> obj draw art-group data 39))) + (set! a0-5 (= v1-20 (-> this draw art-group data 39))) ) (label cfg-21) (b! (not a0-5) cfg-23 :delay (set! v1-17 #t)) (set! v1-17 #f) (label cfg-23) (if v1-17 - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 14))) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 14))) ) (label cfg-25) (b! #t cfg-48 :delay (nop!)) (label cfg-26) (b! (>= f30-0 (cos (* 182.04445 arg0))) cfg-31 :delay #f) - (if (< (-> (vector-cross! (new 'stack-no-clear 'vector) (-> obj new-facing) (-> obj old-facing)) y) 0.0) - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 38))) - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 37))) + (if (< (-> (vector-cross! (new 'stack-no-clear 'vector) (-> this new-facing) (-> this old-facing)) y) 0.0) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 38))) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 37))) ) (b! #t cfg-48 :delay (nop!)) (label cfg-31) - (if (or (< (cos (* 182.04445 arg1)) f30-0) (let ((v1-41 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (if (or (< (cos (* 182.04445 arg1)) f30-0) (let ((v1-41 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) - (not (and v1-41 (or (= v1-41 (-> obj draw art-group data 13)) - (= v1-41 (-> obj draw art-group data 38)) - (= v1-41 (-> obj draw art-group data 37)) + (not (and v1-41 (or (= v1-41 (-> this draw art-group data 13)) + (= v1-41 (-> this draw art-group data 38)) + (= v1-41 (-> this draw art-group data 37)) ) ) ) ) ) - (set! s4-0 (the-as art-joint-anim (-> obj draw art-group data 13))) + (set! s4-0 (the-as art-joint-anim (-> this draw art-group data 13))) ) (label cfg-48) - (let ((v1-50 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((v1-50 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (when (and (not (and v1-50 (= v1-50 (the-as art-element s4-0)))) - (>= (- (current-time) (the-as time-frame s5-0)) (-> obj turn-time)) + (time-elapsed? (the-as time-frame s5-0) (-> this turn-time)) ) (let ((f30-2 (/ (ja-frame-num 0) (the float (ja-num-frames 0))))) (ja-channel-push! 1 (the-as time-frame s5-0)) - (set! (-> obj skel root-channel 0 frame-group) s4-0) - (let ((s5-1 (-> obj skel root-channel 0))) + (set! (-> this skel root-channel 0 frame-group) s4-0) + (let ((s5-1 (-> this skel root-channel 0))) (set! (-> s5-1 num-func) num-func-identity) (set! (-> s5-1 frame-num) (* f30-2 (the float (ja-num-frames 0)))) ) ) (let ((v0-4 (current-time))) - (set! (-> obj turn-time) v0-4) + (set! (-> this turn-time) v0-4) v0-4 ) ) @@ -298,35 +298,35 @@ ;; definition for method 55 of type gator ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod track-target! gator ((obj gator)) +(defmethod track-target! gator ((this gator)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((func (method-of-type nav-enemy track-target!))) - (func obj) + (func this) ) - (adjust-depth! obj) - (set! (-> obj old-facing quad) (-> obj new-facing quad)) - (update-facing! obj (-> obj new-facing)) + (adjust-depth! this) + (set! (-> this old-facing quad) (-> this new-facing quad)) + (update-facing! this (-> this new-facing)) (none) ) ;; definition for method 56 of type gator -(defmethod damage-amount-from-attack gator ((obj gator) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack gator ((this gator) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" 0 ) ;; definition for method 70 of type gator -(defmethod go-hostile gator ((obj gator)) - (go (method-of-object obj hostile)) +(defmethod go-hostile gator ((this gator)) + (go (method-of-object this hostile)) ) ;; definition for method 107 of type gator -(defmethod get-enemy-target gator ((obj gator)) +(defmethod get-enemy-target gator ((this gator)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" - (let ((enemy-target ((method-of-type nav-enemy get-enemy-target) obj))) + (let ((enemy-target ((method-of-type nav-enemy get-enemy-target) this))) (if (and enemy-target (< (+ 1024.0 (get-height *ocean* (get-trans enemy-target 0) #t)) (-> (get-trans enemy-target 1) y)) ) @@ -338,7 +338,7 @@ ;; definition for method 98 of type gator ;; INFO: Used lq/sq -(defmethod in-aggro-range? gator ((obj gator) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? gator ((this gator) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -351,7 +351,7 @@ (set! arg1 target-pos) ) ) - ((method-of-type nav-enemy in-aggro-range?) obj arg0 arg1) + ((method-of-type nav-enemy in-aggro-range?) this arg0 arg1) ) ;; failed to figure out what this is: @@ -518,7 +518,7 @@ (defstate stare (gator) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let ((func (-> (method-of-type nav-enemy stare) trans))) @@ -526,7 +526,7 @@ (func) ) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.017)) + (if (time-elapsed? (-> self state-time) (seconds 0.017)) (go-virtual pacing) ) ) @@ -543,16 +543,16 @@ ) ;; definition for method 60 of type gator -(defmethod coin-flip? gator ((obj gator)) +(defmethod coin-flip? gator ((this gator)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 114 of type gator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! gator ((obj gator)) +(defmethod init-enemy-collision! gator ((this gator)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -617,7 +617,7 @@ (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) (set! (-> cshape max-iteration-count) (the-as uint 3)) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) 0 (none) @@ -625,22 +625,22 @@ ;; definition for method 115 of type gator ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! gator ((obj gator)) +(defmethod init-enemy! gator ((this gator)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gator" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *gator-nav-enemy-info*) - (let ((nav (-> obj nav))) + (init-enemy-behaviour-and-stats! this *gator-nav-enemy-info*) + (let ((nav (-> this nav))) (set! (-> nav speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logior! (-> obj nav flags) (nav-control-flag momentum-ignore-heading)) - (adjust-depth! obj) - (set! (-> obj turn-time) 0) + (set-gravity-length (-> this root dynam) 573440.0) + (logior! (-> this nav flags) (nav-control-flag momentum-ignore-heading)) + (adjust-depth! this) + (set! (-> this turn-time) 0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/grim2-course_REF.gc b/test/decompiler/reference/jak2/levels/sewer/grim2-course_REF.gc index 6766a34a6e..55867cc812 100644 --- a/test/decompiler/reference/jak2/levels/sewer/grim2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/grim2-course_REF.gc @@ -11,27 +11,28 @@ ) ;; definition for method 3 of type grim-sewer -(defmethod inspect grim-sewer ((obj grim-sewer)) - (when (not obj) - (set! obj obj) +(defmethod inspect grim-sewer ((this grim-sewer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type grim inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 116 of type grim-sewer -(defmethod go-idle grim-sewer ((obj grim-sewer)) +;; WARN: Return type mismatch object vs none. +(defmethod go-idle grim-sewer ((this grim-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (ruffian-method-240 obj) + (ruffian-method-240 this) ) ) (none) @@ -429,7 +430,7 @@ :nav-mesh-index 2 :skip-to -1 :on-set (lambda ((arg0 grim-sewer)) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) (logior! (-> arg0 bot-flags) (bot-flags bf19)) (clear-poi-and-focus! arg0) (logclear! (-> arg0 focus-status) (focus-status disable)) @@ -443,7 +444,7 @@ (set! (-> (the-as ruft-wait-spot v1-12) check-done) (the-as (function ruft-wait-spot ruffian symbol) - (lambda ((arg0 object) (arg1 grim-sewer)) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) + (lambda ((arg0 object) (arg1 grim-sewer)) (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 16 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) diff --git a/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc index d5ef05dd00..0dfb4ea917 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hal2-course_REF.gc @@ -13,30 +13,30 @@ ) ;; definition for method 3 of type hal2-course -(defmethod inspect hal2-course ((obj hal2-course)) - (when (not obj) - (set! obj obj) +(defmethod inspect hal2-course ((this hal2-course)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcourse-id: ~D~%" (-> obj course-id)) - (format #t "~1Tspeech-count: ~D~%" (-> obj speech-count)) - (format #t "~1Tspot-count: ~D~%" (-> obj spot-count)) - (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) - (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> obj too-far-warn-speeches)) - (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> obj too-far-fail-speeches)) - (format #t "~1Tattack-player-speeches: ~A~%" (-> obj attack-player-speeches)) - (format #t "~1Tdefault-check-too-far: ~A~%" (-> obj default-check-too-far)) - (format #t "~1Twaypoints: ~A~%" (-> obj waypoints)) - (format #t "~1Tspeeches: #x~X~%" (-> obj speeches)) - (format #t "~1Tspeech-tunings: #x~X~%" (-> obj speech-tunings)) - (format #t "~1Tdirs: #x~X~%" (-> obj dirs)) - (format #t "~1Tspots: #x~X~%" (-> obj spots)) - (format #t "~1Tsentries1-reminders: ~A~%" (-> obj sentries1-reminders)) - (format #t "~1Tsentries2-reminders: ~A~%" (-> obj sentries2-reminders)) - (format #t "~1Tbomb2-reminders: ~A~%" (-> obj bomb2-reminders)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse-id: ~D~%" (-> this course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> this speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> this spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> this too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> this too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> this attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> this default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> this waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> this speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> this speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> this dirs)) + (format #t "~1Tspots: #x~X~%" (-> this spots)) + (format #t "~1Tsentries1-reminders: ~A~%" (-> this sentries1-reminders)) + (format #t "~1Tsentries2-reminders: ~A~%" (-> this sentries2-reminders)) + (format #t "~1Tbomb2-reminders: ~A~%" (-> this bomb2-reminders)) (label cfg-4) - obj + this ) ;; definition of type hal-sewer @@ -60,31 +60,31 @@ ) ;; definition for method 3 of type hal-sewer -(defmethod inspect hal-sewer ((obj hal-sewer)) - (when (not obj) - (set! obj obj) +(defmethod inspect hal-sewer ((this hal-sewer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hal inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsentries1-reminder-index: ~D~%" (-> obj sentries1-reminder-index)) - (format #t "~2Tsentries2-reminder-index: ~D~%" (-> obj sentries2-reminder-index)) - (format #t "~2Ttest-plane: #~%" (-> obj test-plane)) + (format #t "~2Tsentries1-reminder-index: ~D~%" (-> this sentries1-reminder-index)) + (format #t "~2Tsentries2-reminder-index: ~D~%" (-> this sentries2-reminder-index)) + (format #t "~2Ttest-plane: #~%" (-> this test-plane)) (label cfg-4) - obj + this ) ;; definition for method 116 of type hal-sewer ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hal-sewer ((obj hal-sewer)) +(defmethod go-idle hal-sewer ((this hal-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -92,34 +92,34 @@ ;; definition for method 210 of type hal-sewer ;; WARN: Return type mismatch float vs none. -(defmethod init! hal-sewer ((obj hal-sewer)) +(defmethod init! hal-sewer ((this hal-sewer)) "Set defaults for various fields." (let ((t9-0 (method-of-type hal init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj too-far-warn-dist-default) 409600.0) - (set! (-> obj too-far-fail-dist-delta-default) 163840.0) + (set! (-> this too-far-warn-dist-default) 409600.0) + (set! (-> this too-far-fail-dist-delta-default) 163840.0) (none) ) ;; definition for method 74 of type hal-sewer -(defmethod general-event-handler hal-sewer ((obj hal-sewer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler hal-sewer ((this hal-sewer) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('notify) (case (-> arg3 param 0) (('jinx-bomb) - (logior! (-> obj bot-task-bits) (bot-task-bits botbits-0)) + (logior! (-> this bot-task-bits) (bot-task-bits botbits-0)) #t ) (else - ((method-of-type hal general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hal general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (else - ((method-of-type hal general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hal general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -219,7 +219,7 @@ ) ;; definition for method 229 of type hal-sewer -(defmethod hal-sewer-method-229 hal-sewer ((obj hal-sewer)) +(defmethod hal-sewer-method-229 hal-sewer ((this hal-sewer)) (let ((a0-1 *target*)) (when a0-1 (let ((v1-1 (get-trans a0-1 0))) @@ -234,9 +234,9 @@ ) ;; definition for method 231 of type hal-sewer -(defmethod hal-sewer-method-231 hal-sewer ((obj hal-sewer) (arg0 int)) +(defmethod hal-sewer-method-231 hal-sewer ((this hal-sewer) (arg0 int)) (countdown (v1-0 3) - (let* ((a2-4 (-> obj actor-group 0 data (+ arg0 v1-0) actor)) + (let* ((a2-4 (-> this actor-group 0 data (+ arg0 v1-0) actor)) (a3-2 (if a2-4 (-> a2-4 extra process) ) @@ -252,7 +252,7 @@ ;; definition for method 230 of type hal-sewer ;; INFO: Used lq/sq -(defmethod hal-sewer-method-230 hal-sewer ((obj hal-sewer) (arg0 process-focusable) (arg1 process-focusable)) +(defmethod hal-sewer-method-230 hal-sewer ((this hal-sewer) (arg0 process-focusable) (arg1 process-focusable)) (when (and arg0 arg1) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 start-pos quad) (-> arg0 root trans quad)) @@ -272,8 +272,8 @@ ) ;; definition for method 227 of type hal-sewer -(defmethod hal-sewer-method-227 hal-sewer ((obj hal-sewer)) - (let* ((a0-1 (-> obj actor-group 0 data 1 actor)) +(defmethod hal-sewer-method-227 hal-sewer ((this hal-sewer)) + (let* ((a0-1 (-> this actor-group 0 data 1 actor)) (v1-3 (if a0-1 (-> a0-1 extra process) ) @@ -285,7 +285,7 @@ (s4-0 (-> (the-as process-drawable v1-3) root trans)) ) (countdown (s3-0 3) - (let* ((v1-10 (-> obj actor-group 0 data (+ s3-0 7) actor)) + (let* ((v1-10 (-> this actor-group 0 data (+ s3-0 7) actor)) (s2-0 (if v1-10 (-> v1-10 extra process) ) @@ -303,9 +303,9 @@ ) ) (when s5-0 - (let* ((a0-5 obj) + (let* ((a0-5 this) (t9-1 (method-of-object a0-5 hal-sewer-method-230)) - (v1-23 (-> obj actor-group 0 data 1 actor)) + (v1-23 (-> this actor-group 0 data 1 actor)) ) (t9-1 a0-5 @@ -324,11 +324,11 @@ ;; definition for method 228 of type hal-sewer ;; WARN: Return type mismatch bot-flags vs none. -(defmethod hal-sewer-method-228 hal-sewer ((obj hal-sewer)) +(defmethod hal-sewer-method-228 hal-sewer ((this hal-sewer)) (with-pp - (let ((s5-0 (-> obj actor-group 0 data 18))) + (let ((s5-0 (-> this actor-group 0 data 18))) (cond - ((logtest? (bot-flags bf22) (-> obj bot-flags)) + ((logtest? (bot-flags bf22) (-> this bot-flags)) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer pp)) (set! (-> a1-0 num-params) 1) @@ -375,8 +375,8 @@ ) ) ) - (logclear! (-> obj bot-flags) (bot-flags bf22)) - (logior! (-> obj bot-flags) (bot-flags bf23)) + (logclear! (-> this bot-flags) (bot-flags bf22)) + (logior! (-> this bot-flags) (bot-flags bf23)) ) ) ) @@ -384,7 +384,7 @@ ) ) ) - ((logtest? (bot-flags bf23) (-> obj bot-flags)) + ((logtest? (bot-flags bf23) (-> this bot-flags)) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-3 from) (process->ppointer pp)) (set! (-> a1-3 num-params) 1) @@ -401,7 +401,7 @@ ) 0.0 ) - (logclear! (-> obj bot-flags) (bot-flags bf23)) + (logclear! (-> this bot-flags) (bot-flags bf23)) ) ) ) @@ -425,7 +425,7 @@ ) ) ) - (logior! (-> obj bot-flags) (bot-flags bf22)) + (logior! (-> this bot-flags) (bot-flags bf22)) ) ) ) @@ -557,7 +557,7 @@ (< -176128.0 (-> (target-pos 0) y)) ) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) ) (cond @@ -567,7 +567,7 @@ (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) #t ) - ((>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) + ((time-elapsed? (-> arg1 waypoint-time0) (seconds 0.5)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 3 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -615,20 +615,20 @@ ) ) ) - (if (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (if (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) (let ((a0-3 s3-0)) (and a0-3 (< (the-as int (send-event a0-3 'query 'waypoint)) 3)) ) ) (send-event s3-0 'request 'waypoint 3) ) - (if (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.75)) + (if (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.75)) (begin (set! a0-8 s4-0) a0-8) (< (the-as int (send-event a0-8 'query 'waypoint)) 3) ) (send-event s4-0 'request 'waypoint 3) ) - (if (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.9)) + (if (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.9)) (begin (set! a0-13 s5-0) a0-13) (< (the-as int (send-event a0-13 'query 'waypoint)) 3) ) @@ -732,7 +732,7 @@ ) (let ((a0-1 s3-0)) (if (and (and a0-1 (= (send-event a0-1 'query 'waypoint) 3)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.5)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.5)) ) (send-event s3-0 'request 'waypoint 9) ) @@ -747,19 +747,19 @@ ) (let ((a0-11 s5-0)) (if (and (and a0-11 (= (send-event a0-11 'query 'waypoint) 3)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.6)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.6)) ) (send-event s5-0 'request 'waypoint 9) ) ) (let ((a0-16 s4-0)) (if (and (and a0-16 (= (send-event a0-16 'query 'waypoint) 3)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.8)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.8)) ) (send-event s4-0 'request 'waypoint 9) ) ) - (when (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) + (when (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 4)) (not (speech-playing? arg1 2)) (not (channel-active? arg1 (the-as uint 0))) ) @@ -853,27 +853,27 @@ ) 1.0 ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) ) ) (let ((a0-3 s3-0)) (if (and (and a0-3 (= (send-event a0-3 'query 'waypoint) 9)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) ) (send-event s3-0 'request 'waypoint 11) ) ) (let ((a0-8 s4-0)) (if (and (and a0-8 (= (send-event a0-8 'query 'waypoint) 9)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.9)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.9)) ) (send-event s4-0 'request 'waypoint 11) ) ) (let ((a0-13 s5-0)) (if (and (and a0-13 (= (send-event a0-13 'query 'waypoint) 9)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.7)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.7)) ) (send-event s5-0 'request 'waypoint 11) ) @@ -1669,7 +1669,7 @@ #t ) (else - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) #f ) ) @@ -1741,7 +1741,7 @@ (-> v1-13 extra process) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.4)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.4)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) (process->ppointer pp)) (set! (-> a1-1 num-params) 2) @@ -1760,7 +1760,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.75)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.75)) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer pp)) (set! (-> a1-2 num-params) 2) @@ -1780,7 +1780,7 @@ ) ) (if (and (not (speech-playing? arg1 28)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (not (channel-active? arg1 (the-as uint 0))) ) (play-speech arg1 28) @@ -1876,7 +1876,7 @@ (lambda ((arg0 object) (arg1 hal-sewer)) (with-pp (cond - ((>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.5)) + ((time-elapsed? (-> arg1 waypoint-time0) (seconds 1.5)) (cond ((logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (when (and (not (speech-playing? arg1 29)) (not (speech-playing? arg1 30))) @@ -1918,7 +1918,7 @@ (-> v1-44 extra process) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer pp)) (set! (-> a1-10 num-params) 2) @@ -1937,7 +1937,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.5)) (let ((a1-11 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-11 from) (process->ppointer pp)) (set! (-> a1-11 num-params) 2) @@ -1956,7 +1956,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3.5)) (let ((a1-12 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-12 from) (process->ppointer pp)) (set! (-> a1-12 num-params) 2) @@ -2180,7 +2180,7 @@ #t ) ) - ((and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) + ((and (time-elapsed? (-> arg1 waypoint-time0) (seconds 4)) (>= (vector4-dot (math-camera-pos) (the-as vector (-> arg1 test-plane))) 0.0) ) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -2275,7 +2275,7 @@ ) ) (hal-sewer-method-228 arg1) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.75)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.75)) (let ((a1-8 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-8 from) (process->ppointer pp)) (set! (-> a1-8 num-params) 2) @@ -2294,7 +2294,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2.75)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.75)) (let ((a1-9 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-9 from) (process->ppointer pp)) (set! (-> a1-9 num-params) 2) @@ -2313,7 +2313,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 3.5)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer pp)) (set! (-> a1-10 num-params) 2) @@ -2404,10 +2404,10 @@ ) ) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.75)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.75)) (send-event s4-0 'request 'waypoint 34) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2.25)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.25)) (send-event s3-0 'request 'waypoint 34) ) (when (and (not (channel-active? arg1 (the-as uint 0))) @@ -2603,7 +2603,7 @@ ) 1.0 ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (else (if (and (not (speech-playing? arg1 46)) (not (channel-active? arg1 (the-as uint 0)))) @@ -2615,21 +2615,21 @@ ) (let ((a0-6 s3-0)) (if (and (and a0-6 (= (send-event a0-6 'query 'waypoint) 35)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) ) (send-event s3-0 'request 'waypoint 37) ) ) (let ((a0-11 s4-0)) (if (and (and a0-11 (= (send-event a0-11 'query 'waypoint) 35)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.9)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.9)) ) (send-event s4-0 'request 'waypoint 37) ) ) (let ((a0-16 s5-0)) (if (and (and a0-16 (= (send-event a0-16 'query 'waypoint) 35)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.7)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.7)) ) (send-event s5-0 'request 'waypoint 37) ) @@ -2780,7 +2780,7 @@ ) (cond ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.5)) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) (process->ppointer pp)) @@ -2805,7 +2805,7 @@ #f ) ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 4)) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (let ((a1-10 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-10 from) (process->ppointer pp)) @@ -2826,7 +2826,7 @@ #f ) ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-2))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 5)) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-2)) (let ((a1-11 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-11 from) (process->ppointer pp)) @@ -2933,10 +2933,10 @@ ) ) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.4)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.4)) (send-event s4-0 'request 'waypoint 42) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.7)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.7)) (send-event s5-0 'request 'waypoint 42) ) (cond @@ -3024,7 +3024,7 @@ ((logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-2 botbits-4)) (logclear! (-> arg1 bot-flags) (bot-flags bf24)) (reset-warn-time! arg1) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (when (not (channel-active? arg1 (the-as uint 0))) (let ((v1-22 *target*)) (when (and v1-22 (focus-test? v1-22 in-air) (not (logtest? (-> v1-22 focus-status) (focus-status hit)))) @@ -3046,11 +3046,11 @@ ) ((channel-active? arg1 (the-as uint 0)) (reset-warn-time! arg1) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 11)) - (set! (-> arg1 waypoint-time0) (current-time)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 11)) + (set-time! (-> arg1 waypoint-time0)) (let ((v1-55 (-> arg1 sentries1-reminder-index)) (a1-14 (-> arg1 hal2-course sentries1-reminders)) ) @@ -3157,10 +3157,10 @@ ) ) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.2)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.2)) (send-event s4-0 'request 'waypoint 44) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.4)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.4)) (send-event s5-0 'request 'waypoint 44) ) (cond @@ -3248,7 +3248,7 @@ ((logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-3 botbits-5)) (logclear! (-> arg1 bot-flags) (bot-flags bf24)) (reset-warn-time! arg1) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) (when (not (channel-active? arg1 (the-as uint 0))) (let ((v1-22 *target*)) (when (and v1-22 (focus-test? v1-22 in-air) (not (logtest? (-> v1-22 focus-status) (focus-status hit)))) @@ -3266,10 +3266,10 @@ ) ((channel-active? arg1 (the-as uint 0)) (reset-warn-time! arg1) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 9)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 9)) (let ((v1-46 (-> arg1 sentries2-reminder-index)) (a1-11 (-> arg1 hal2-course sentries2-reminders)) ) @@ -3277,10 +3277,10 @@ ((< v1-46 (-> a1-11 length)) (set! (-> arg1 sentries2-reminder-index) (+ v1-46 1)) (play-speech arg1 (-> a1-11 v1-46)) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (else - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 20)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 20)) (logior! (-> arg1 bot-flags) (bot-flags bf24)) ) ) @@ -3353,7 +3353,7 @@ ) ) (when (and (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.25)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.25)) ) (logclear! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -3522,10 +3522,10 @@ ) ) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.2)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.2)) (send-event s3-0 'request 'waypoint 48) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.4)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.4)) (send-event s4-0 'request 'waypoint 48) ) ) @@ -3973,18 +3973,18 @@ ) ) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (send-event s5-0 'request 'waypoint 59) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 3)) (send-event s3-0 'request 'waypoint 59) ) - (if (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) + (if (time-elapsed? (-> arg1 waypoint-time0) (seconds 4)) (send-event s4-0 'request 'waypoint 59) ) (when (not (channel-active? arg1 (the-as uint 0))) (cond - ((and (not (speech-playing? arg1 75)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 6))) + ((and (not (speech-playing? arg1 75)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 6))) (play-speech arg1 75) (play-speech arg1 76) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc index 9547873230..4bff223692 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hosehead-fake_REF.gc @@ -23,27 +23,27 @@ ) ;; definition for method 3 of type hosehead-fake-spawn-info -(defmethod inspect hosehead-fake-spawn-info ((obj hosehead-fake-spawn-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect hosehead-fake-spawn-info ((this hosehead-fake-spawn-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tid: ~D~%" (-> obj id)) - (format #t "~1Twalk-dist: ~f~%" (-> obj walk-dist)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) - (format #t "~1Ttrans: #~%" (-> obj trans)) - (format #t "~1Tquat: #~%" (-> obj quat)) - (format #t "~1Ttrans-x: ~f~%" (-> obj trans x)) - (format #t "~1Ttrans-y: ~f~%" (-> obj trans y)) - (format #t "~1Ttrans-z: ~f~%" (-> obj trans z)) - (format #t "~1Ttrans-w: ~f~%" (-> obj trans w)) - (format #t "~1Tquat-x: ~f~%" (-> obj quat x)) - (format #t "~1Tquat-y: ~f~%" (-> obj quat y)) - (format #t "~1Tquat-z: ~f~%" (-> obj quat z)) - (format #t "~1Tquat-w: ~f~%" (-> obj quat w)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tid: ~D~%" (-> this id)) + (format #t "~1Twalk-dist: ~f~%" (-> this walk-dist)) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Ttrans-x: ~f~%" (-> this trans x)) + (format #t "~1Ttrans-y: ~f~%" (-> this trans y)) + (format #t "~1Ttrans-z: ~f~%" (-> this trans z)) + (format #t "~1Ttrans-w: ~f~%" (-> this trans w)) + (format #t "~1Tquat-x: ~f~%" (-> this quat x)) + (format #t "~1Tquat-y: ~f~%" (-> this quat y)) + (format #t "~1Tquat-z: ~f~%" (-> this quat z)) + (format #t "~1Tquat-w: ~f~%" (-> this quat w)) (label cfg-4) - obj + this ) ;; definition of type hosehead-fake @@ -66,28 +66,28 @@ ) ;; definition for method 3 of type hosehead-fake -(defmethod inspect hosehead-fake ((obj hosehead-fake)) - (when (not obj) - (set! obj obj) +(defmethod inspect hosehead-fake ((this hosehead-fake)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: ~A~%" (-> obj info)) - (format #t "~2Tid: ~D~%" (-> obj id)) - (format #t "~2Twalk-dest: #~%" (-> obj walk-dest)) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Twalk-dest: #~%" (-> this walk-dest)) (label cfg-4) - obj + this ) ;; definition for method 24 of type hosehead-fake ;; WARN: Return type mismatch int vs none. -(defmethod print-def hosehead-fake ((obj hosehead-fake)) - (let ((s5-0 (-> obj root))) +(defmethod print-def hosehead-fake ((this hosehead-fake)) + (let ((s5-0 (-> this root))) (format #t "~%") (format #t "(def-hosehead-fake~%") - (format #t " :id ~d~%" (-> obj id)) + (format #t " :id ~d~%" (-> this id)) (format #t " :trans-x ~M~%" (-> s5-0 trans x)) (format #t " :trans-y ~M~%" (-> s5-0 trans y)) (format #t " :trans-z ~M~%" (-> s5-0 trans z)) @@ -96,7 +96,7 @@ (format #t " :quat-z ~f~%" (-> s5-0 quat z)) (format #t " :quat-w ~f~%" (-> s5-0 quat w)) ) - (let ((a0-11 (-> obj info))) + (let ((a0-11 (-> this info))) (when a0-11 (let ((f0-7 (-> a0-11 walk-dist))) (if (!= f0-7 0.0) @@ -112,15 +112,15 @@ ;; definition for method 23 of type hosehead-fake ;; WARN: Return type mismatch symbol vs none. -(defmethod debug-draw hosehead-fake ((obj hosehead-fake)) - (let ((a2-0 (-> obj info))) +(defmethod debug-draw hosehead-fake ((this hosehead-fake)) + (let ((a2-0 (-> this info))) (when a2-0 (if (!= (-> a2-0 walk-dist) 0.0) (add-debug-line #t (bucket-id debug-no-zbuf1) (-> a2-0 trans) - (-> obj walk-dest) + (-> this walk-dest) (new 'static 'rgba :r #xff :g #xff :a #x80) #f (the-as rgba -1) diff --git a/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc b/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc index 34b68f5cfc..5757f422b6 100644 --- a/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/hosehead_REF.gc @@ -110,44 +110,44 @@ ) ;; definition for method 3 of type hosehead -(defmethod inspect hosehead ((obj hosehead)) - (when (not obj) - (set! obj obj) +(defmethod inspect hosehead ((this hosehead)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ton-wall?: ~A~%" (-> obj on-wall?)) - (format #t "~2Tsentry?: ~A~%" (-> obj sentry?)) - (format #t "~2Tshot-by-ruffian?: ~A~%" (-> obj shot-by-ruffian?)) - (format #t "~2Ton-stop-sentry: ~A~%" (-> obj on-stop-sentry)) - (format #t "~2Tjump-point: #~%" (-> obj jump-point)) - (format #t "~2Tlast-time-dist-changed: ~D~%" (-> obj last-time-dist-changed)) - (format #t "~2Tnext-lazer-time: ~D~%" (-> obj next-lazer-time)) - (format #t "~2Tfire-beam?: ~A~%" (-> obj fire-beam?)) - (format #t "~2Thead-angle: ~f~%" (-> obj head-angle)) - (format #t "~2Thead-angle-inc: ~f~%" (-> obj head-angle-inc)) - (format #t "~2Ttarget-pos: #~%" (-> obj target-pos)) - (format #t "~2Tcome-from-notice: ~A~%" (-> obj come-from-notice)) - (format #t "~2Tallow-head: ~A~%" (-> obj allow-head)) - (format #t "~2Thead-joint-mod: ~A~%" (-> obj head-joint-mod)) - (format #t "~2Tjoint-ik[4] @ #x~X~%" (-> obj joint-ik)) - (format #t "~2Tdelta-y-ik[4] @ #x~X~%" (-> obj delta-y-ik)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Ton-wall?: ~A~%" (-> this on-wall?)) + (format #t "~2Tsentry?: ~A~%" (-> this sentry?)) + (format #t "~2Tshot-by-ruffian?: ~A~%" (-> this shot-by-ruffian?)) + (format #t "~2Ton-stop-sentry: ~A~%" (-> this on-stop-sentry)) + (format #t "~2Tjump-point: #~%" (-> this jump-point)) + (format #t "~2Tlast-time-dist-changed: ~D~%" (-> this last-time-dist-changed)) + (format #t "~2Tnext-lazer-time: ~D~%" (-> this next-lazer-time)) + (format #t "~2Tfire-beam?: ~A~%" (-> this fire-beam?)) + (format #t "~2Thead-angle: ~f~%" (-> this head-angle)) + (format #t "~2Thead-angle-inc: ~f~%" (-> this head-angle-inc)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tcome-from-notice: ~A~%" (-> this come-from-notice)) + (format #t "~2Tallow-head: ~A~%" (-> this allow-head)) + (format #t "~2Thead-joint-mod: ~A~%" (-> this head-joint-mod)) + (format #t "~2Tjoint-ik[4] @ #x~X~%" (-> this joint-ik)) + (format #t "~2Tdelta-y-ik[4] @ #x~X~%" (-> this delta-y-ik)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Tlazer-dist: ~f~%" (-> obj lazer-dist)) - (format #t "~2Tlazer-pos-sound: #~%" (-> obj lazer-pos-sound)) - (format #t "~2Tlazer-sound: ~D~%" (-> obj lazer-sound)) - (format #t "~2Tlazer-sound2: ~D~%" (-> obj lazer-sound2)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tangle-sentry: ~f~%" (-> obj angle-sentry)) - (format #t "~2Tlazer-length: ~f~%" (-> obj lazer-length)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tlazer-dist: ~f~%" (-> this lazer-dist)) + (format #t "~2Tlazer-pos-sound: #~%" (-> this lazer-pos-sound)) + (format #t "~2Tlazer-sound: ~D~%" (-> this lazer-sound)) + (format #t "~2Tlazer-sound2: ~D~%" (-> this lazer-sound2)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tangle-sentry: ~f~%" (-> this angle-sentry)) + (format #t "~2Tlazer-length: ~f~%" (-> this lazer-length)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -354,9 +354,9 @@ ;; definition for method 114 of type hosehead ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! hosehead ((obj hosehead)) +(defmethod init-enemy-collision! hosehead ((this hosehead)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -419,7 +419,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -436,17 +436,16 @@ ) ;; definition for method 3 of type ik-setup -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect ik-setup ((obj ik-setup)) - (when (not obj) - (set! obj obj) +(defmethod inspect ik-setup ((this ik-setup)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'ik-setup) - (format #t "~1Telbow-index: ~D~%" (-> obj elbow-index)) - (format #t "~1Thand-dist: ~f~%" (-> obj hand-dist)) + (format #t "[~8x] ~A~%" this 'ik-setup) + (format #t "~1Telbow-index: ~D~%" (-> this elbow-index)) + (format #t "~1Thand-dist: ~f~%" (-> this hand-dist)) (label cfg-4) - obj + this ) ;; definition for symbol *hosehead-ik-setup*, type (inline-array ik-setup) @@ -470,16 +469,16 @@ ) ;; definition for method 3 of type hosehead-anim-info -(defmethod inspect hosehead-anim-info ((obj hosehead-anim-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect hosehead-anim-info ((this hosehead-anim-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'hosehead-anim-info) - (format #t "~1Thit-index: ~D~%" (-> obj hit-index)) - (format #t "~1Tland-index: ~D~%" (-> obj land-index)) + (format #t "[~8x] ~A~%" this 'hosehead-anim-info) + (format #t "~1Thit-index: ~D~%" (-> this hit-index)) + (format #t "~1Tland-index: ~D~%" (-> this land-index)) (label cfg-4) - obj + this ) ;; definition of type hosehead-global-info @@ -497,20 +496,20 @@ ) ;; definition for method 3 of type hosehead-global-info -(defmethod inspect hosehead-global-info ((obj hosehead-global-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect hosehead-global-info ((this hosehead-global-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tprev-yellow-hit: ~D~%" (-> obj prev-yellow-hit)) - (format #t "~1Tprev-blue-hit: ~D~%" (-> obj prev-blue-hit)) - (format #t "~1Tprev-knocked: ~D~%" (-> obj prev-knocked)) - (format #t "~1Tyellow-hit-anim[2] @ #x~X~%" (-> obj yellow-hit-anim)) - (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> obj blue-hit-anim)) - (format #t "~1Tknocked-anim[2] @ #x~X~%" (-> obj knocked-anim)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-yellow-hit: ~D~%" (-> this prev-yellow-hit)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tprev-knocked: ~D~%" (-> this prev-knocked)) + (format #t "~1Tyellow-hit-anim[2] @ #x~X~%" (-> this yellow-hit-anim)) + (format #t "~1Tblue-hit-anim[3] @ #x~X~%" (-> this blue-hit-anim)) + (format #t "~1Tknocked-anim[2] @ #x~X~%" (-> this knocked-anim)) (label cfg-4) - obj + this ) ;; definition for symbol *hosehead-global-info*, type hosehead-global-info @@ -532,31 +531,31 @@ ) ;; definition for method 77 of type hosehead -(defmethod enemy-method-77 hosehead ((obj hosehead) (arg0 (pointer float))) +(defmethod enemy-method-77 hosehead ((this hosehead) (arg0 (pointer float))) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) #t ) (else - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-1 (ash 1 (-> *hosehead-global-info* prev-yellow-hit))) - (v1-18 (enemy-method-120 obj 2 a2-1)) - (a1-8 (-> obj draw art-group data (-> *hosehead-global-info* yellow-hit-anim v1-18 hit-index))) + (v1-18 (enemy-method-120 this 2 a2-1)) + (a1-8 (-> this draw art-group data (-> *hosehead-global-info* yellow-hit-anim v1-18 hit-index))) ) (set! (-> *hosehead-global-info* prev-yellow-hit) v1-18) - (let ((a0-15 (-> obj skel root-channel 0))) + (let ((a0-15 (-> this skel root-channel 0))) (set! (-> a0-15 frame-group) (the-as art-joint-anim a1-8)) (set! (-> a0-15 param 0) (the float (+ (-> (the-as art-joint-anim a1-8) frames num-frames) -1))) (set! (-> a0-15 param 1) (-> arg0 0)) @@ -567,11 +566,11 @@ ) (((knocked-type knocked-type-6)) (let* ((a2-3 (ash 1 (-> *hosehead-global-info* prev-blue-hit))) - (v1-27 (enemy-method-120 obj 3 a2-3)) - (a1-13 (-> obj draw art-group data (-> *hosehead-global-info* blue-hit-anim v1-27 hit-index))) + (v1-27 (enemy-method-120 this 3 a2-3)) + (a1-13 (-> this draw art-group data (-> *hosehead-global-info* blue-hit-anim v1-27 hit-index))) ) (set! (-> *hosehead-global-info* prev-blue-hit) v1-27) - (let ((a0-27 (-> obj skel root-channel 0))) + (let ((a0-27 (-> this skel root-channel 0))) (set! (-> a0-27 frame-group) (the-as art-joint-anim a1-13)) (set! (-> a0-27 param 0) (the float (+ (-> (the-as art-joint-anim a1-13) frames num-frames) -1))) (set! (-> a0-27 param 1) 1.0) @@ -583,11 +582,11 @@ (else (ja-channel-push! 1 (seconds 0.1)) (let* ((a2-5 (ash 1 (-> *hosehead-global-info* prev-knocked))) - (v1-37 (enemy-method-120 obj 2 a2-5)) - (a1-19 (-> obj draw art-group data (-> *hosehead-global-info* knocked-anim v1-37 hit-index))) + (v1-37 (enemy-method-120 this 2 a2-5)) + (a1-19 (-> this draw art-group data (-> *hosehead-global-info* knocked-anim v1-37 hit-index))) ) (set! (-> *hosehead-global-info* prev-knocked) v1-37) - (let ((a0-39 (-> obj skel root-channel 0))) + (let ((a0-39 (-> this skel root-channel 0))) (set! (-> a0-39 frame-group) (the-as art-joint-anim a1-19)) (set! (-> a0-39 param 0) (the float (+ (-> (the-as art-joint-anim a1-19) frames num-frames) -1))) (set! (-> a0-39 param 1) (-> arg0 0)) @@ -603,28 +602,28 @@ ) ;; definition for method 78 of type hosehead -(defmethod enemy-method-78 hosehead ((obj hosehead) (arg0 (pointer float))) +(defmethod enemy-method-78 hosehead ((this hosehead) (arg0 (pointer float))) (local-vars (v1-15 knocked-type)) (cond - ((zero? (-> obj hit-points)) + ((zero? (-> this hit-points)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-2 (-> obj skel root-channel 0))) - (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19))) + (let ((a0-2 (-> this skel root-channel 0))) + (set! (-> a0-2 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) (set! (-> a0-2 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) ) (set! (-> a0-2 param 1) (-> arg0 0)) (set! (-> a0-2 frame-num) 0.0) - (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!) + (joint-control-channel-group! a0-2 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) ) #t ) - ((begin (set! v1-15 (-> obj incoming knocked-type)) (= v1-15 (knocked-type knocked-type-6))) + ((begin (set! v1-15 (-> this incoming knocked-type)) (= v1-15 (knocked-type knocked-type-6))) (let* ((a0-4 (-> *hosehead-global-info* prev-blue-hit)) - (s4-0 (-> obj draw art-group data (-> *hosehead-global-info* blue-hit-anim a0-4 land-index))) + (s4-0 (-> this draw art-group data (-> *hosehead-global-info* blue-hit-anim a0-4 land-index))) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-9 (-> obj skel root-channel 0))) + (let ((a0-9 (-> this skel root-channel 0))) (set! (-> a0-9 frame-group) (the-as art-joint-anim s4-0)) (set! (-> a0-9 param 0) (the float (+ (-> (the-as art-joint-anim s4-0) frames num-frames) -1))) (set! (-> a0-9 param 1) (-> arg0 0)) @@ -638,10 +637,10 @@ ) (else (let* ((a0-11 (-> *hosehead-global-info* prev-knocked)) - (s4-1 (-> obj draw art-group data (-> *hosehead-global-info* knocked-anim a0-11 land-index))) + (s4-1 (-> this draw art-group data (-> *hosehead-global-info* knocked-anim a0-11 land-index))) ) (ja-channel-push! 1 (seconds 0.1)) - (let ((a0-16 (-> obj skel root-channel 0))) + (let ((a0-16 (-> this skel root-channel 0))) (set! (-> a0-16 frame-group) (the-as art-joint-anim s4-1)) (set! (-> a0-16 param 0) (the float (+ (-> (the-as art-joint-anim s4-1) frames num-frames) -1))) (set! (-> a0-16 param 1) (-> arg0 0)) @@ -656,13 +655,13 @@ ;; definition for method 189 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hosehead-method-189 hosehead ((obj hosehead)) - (let ((a0-2 (handle->process (-> obj focus handle)))) +(defmethod hosehead-method-189 hosehead ((this hosehead)) + (let ((a0-2 (handle->process (-> this focus handle)))) (when a0-2 (let ((s5-0 (new 'stack-no-clear 'vector))) (set! (-> s5-0 quad) (-> (get-trans (the-as process-focusable a0-2) 1) quad)) (+! (-> s5-0 y) 8192.0) - (set! (-> obj target-pos quad) (-> s5-0 quad)) + (set! (-> this target-pos quad) (-> s5-0 quad)) ) ) ) @@ -671,7 +670,7 @@ ) ;; definition for method 190 of type hosehead -(defmethod hosehead-method-190 hosehead ((obj hosehead)) +(defmethod hosehead-method-190 hosehead ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -680,11 +679,11 @@ (vf7 :class vf) ) (init-vf0-vector) - (hosehead-method-189 obj) + (hosehead-method-189 this) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((s4-0 (-> gp-0 start-pos))) - (let ((s3-0 (-> obj root trans))) - (let ((v1-4 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s3-0 (-> this root trans))) + (let ((v1-4 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-4 6144.0)) (.mov vf7 a0-4) ) @@ -697,7 +696,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> s4-0 quad) vf6) ) - (vector-! (-> gp-0 move-dist) (-> obj target-pos) (-> gp-0 start-pos)) + (vector-! (-> gp-0 move-dist) (-> this target-pos) (-> gp-0 start-pos)) (let ((v1-7 gp-0)) (set! (-> v1-7 radius) 1024.0) (set! (-> v1-7 collide-with) (collide-spec backgnd enemy obstacle)) @@ -766,9 +765,9 @@ ;; definition for method 197 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hosehead-method-197 hosehead ((obj hosehead)) +(defmethod hosehead-method-197 hosehead ((this hosehead)) (let ((s2-0 (new 'stack-no-clear 'matrix))) - (let* ((a2-0 (-> obj node-list data 12 bone transform)) + (let* ((a2-0 (-> this node-list data 12 bone transform)) (v1-2 (-> a2-0 quad 0)) (a0-1 (-> a2-0 quad 1)) (a1-0 (-> a2-0 quad 2)) @@ -784,13 +783,18 @@ (s5-0 (new 'stack-no-clear 'vector)) (s4-0 (new 'stack-no-clear 'vector)) ) - (seek! (-> obj lazer-length) 327680.0 (* 327680.0 (seconds-per-frame))) - (vector-normalize-copy! s5-0 (-> s2-0 vector 1) (-> obj lazer-length)) + (seek! (-> this lazer-length) 327680.0 (* 327680.0 (seconds-per-frame))) + (vector-normalize-copy! s5-0 (-> s2-0 vector 1) (-> this lazer-length)) (matrix->trans s2-0 s4-0) - (set! (-> obj lazer-dist) - (lerp-scale 1.0 0.0 (point-line-distance (-> obj lazer-pos-sound) (-> obj target-pos) s4-0 s5-0) 0.0 40960.0) + (set! (-> this lazer-dist) (lerp-scale + 1.0 + 0.0 + (point-line-distance (-> this lazer-pos-sound) (-> this target-pos) s4-0 s5-0) + 0.0 + 40960.0 + ) ) - (vector-! (-> obj lazer-pos-sound) (-> obj target-pos) (-> obj lazer-pos-sound)) + (vector-! (-> this lazer-pos-sound) (-> this target-pos) (-> this lazer-pos-sound)) (set! (-> s3-0 start-pos quad) (-> s4-0 quad)) (set! (-> s3-0 move-dist quad) (-> s5-0 quad)) (let ((v1-9 s3-0)) @@ -814,7 +818,7 @@ ) (when s3-1 (if (logtest? (-> (the-as collide-shape-prim s3-1) prim-core collide-as) (collide-spec enemy)) - (go-hostile obj) + (go-hostile this) ) (if (logtest? (-> (the-as collide-shape-prim s3-1) prim-core collide-as) (collide-spec jak bot)) (send-event @@ -837,26 +841,26 @@ (let ((s5-1 sound-play-by-spec) (s4-1 (static-sound-spec "hosehead-lazer" :volume 0.0 :mask (pitch))) ) - (set! (-> s4-1 volume) (the int (* 1024.0 (lerp-scale 1.0 0.4 (-> obj lazer-dist) 1.0 0.0)))) + (set! (-> s4-1 volume) (the int (* 1024.0 (lerp-scale 1.0 0.4 (-> this lazer-dist) 1.0 0.0)))) (set! (-> s4-1 pitch-mod) 0) - (s5-1 s4-1 (-> obj lazer-sound) (-> obj lazer-pos-sound)) + (s5-1 s4-1 (-> this lazer-sound) (-> this lazer-pos-sound)) ) (let ((s5-2 sound-play-by-spec) (s4-2 (static-sound-spec "lazer-sub" :volume 0.0 :mask (pitch))) ) - (set! (-> s4-2 volume) (the int (* 1024.0 (lerp-scale 1.0 0.0 (-> obj lazer-dist) 1.0 0.5)))) + (set! (-> s4-2 volume) (the int (* 1024.0 (lerp-scale 1.0 0.0 (-> this lazer-dist) 1.0 0.5)))) (set! (-> s4-2 pitch-mod) 0) - (s5-2 s4-2 (-> obj lazer-sound2) (-> obj lazer-pos-sound)) + (s5-2 s4-2 (-> this lazer-sound2) (-> this lazer-pos-sound)) ) 0 (none) ) ;; definition for method 88 of type hosehead -(defmethod enemy-method-88 hosehead ((obj hosehead) (arg0 enemy-jump-info)) +(defmethod enemy-method-88 hosehead ((this hosehead) (arg0 enemy-jump-info)) (ja-channel-push! 1 (seconds 0.075)) - (let ((a1-2 (-> obj draw art-group data (-> obj enemy-info jump-land-anim))) - (a0-4 (-> obj skel root-channel 0)) + (let ((a1-2 (-> this draw art-group data (-> this enemy-info jump-land-anim))) + (a0-4 (-> this skel root-channel 0)) ) (set! (-> a0-4 frame-group) (the-as art-joint-anim a1-2)) (set! (-> a0-4 param 0) (the float (+ (-> (the-as art-joint-anim a1-2) frames num-frames) -1))) @@ -868,37 +872,37 @@ ) ;; definition for method 74 of type hosehead -(defmethod general-event-handler hosehead ((obj hosehead) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler hosehead ((this hosehead) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('cue-chase) (cond - ((-> obj on-wall?) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj notice-wall)) + ((-> this on-wall?) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this notice-wall)) ) - ((-> obj sentry?) - (when (and (-> obj next-state) (= (-> obj next-state name) 'idle-sentry)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) - (logior! (-> obj enemy-flags) (enemy-flag dangerous-backup)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj hostile-sentry)) + ((-> this sentry?) + (when (and (-> this next-state) (= (-> this next-state name) 'idle-sentry)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice alert victory called-dying)) + (logior! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this hostile-sentry)) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) (('stop-sentry) - (set! (-> obj sentry?) #f) + (set! (-> this sentry?) #f) #t ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -906,7 +910,7 @@ ;; definition for method 186 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod hosehead-method-186 hosehead ((obj hosehead)) +(defmethod hosehead-method-186 hosehead ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -920,8 +924,8 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (let ((s2-0 gp-0)) - (let ((s1-0 (-> obj root trans))) - (let ((v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))) + (let ((s1-0 (-> this root trans))) + (let ((v1-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)))) (let ((a0-3 8192.0)) (.mov vf7 a0-3) ) @@ -940,7 +944,7 @@ (set! (-> s3-0 start-pos quad) (-> gp-0 quad)) (vector-float*! (-> s3-0 move-dist) - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) -16384.0 ) (let ((v1-9 s3-0)) @@ -973,7 +977,7 @@ (set! (-> s3-0 start-pos quad) (-> s5-0 quad)) (vector-float*! (-> s3-0 move-dist) - (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)) + (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) -16384.0 ) (let ((v1-16 s3-0)) @@ -1004,7 +1008,7 @@ ) ) (let ((s2-6 (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0)) - (s1-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (s1-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (s3-1 (new 'stack-no-clear 'quaternion)) ) (let ((s0-0 (new 'stack-no-clear 'matrix))) @@ -1014,9 +1018,9 @@ (vector-rotate*! s2-6 s2-6 s0-0) ) (quaternion-look-at! s3-1 s2-6 *up-vector*) - (quaternion-pseudo-seek (-> obj root quat) (-> obj root quat) s3-1 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this root quat) (-> this root quat) s3-1 (seconds-per-frame)) ) - (vector-average! (-> obj root trans) gp-0 s5-0) + (vector-average! (-> this root trans) gp-0 s5-0) ) (none) ) @@ -1024,9 +1028,9 @@ ;; definition for method 185 of type hosehead ;; WARN: Return type mismatch int vs none. -(defmethod hosehead-method-185 hosehead ((obj hosehead)) - (countdown (s5-0 (length (-> obj actor-group 1))) - (let* ((v1-5 (-> obj actor-group 1 data s5-0 actor)) +(defmethod hosehead-method-185 hosehead ((this hosehead)) + (countdown (s5-0 (length (-> this actor-group 1))) + (let* ((v1-5 (-> this actor-group 1 data s5-0 actor)) (a0-4 (if v1-5 (-> v1-5 extra process) ) @@ -1046,7 +1050,7 @@ :enter (-> (method-of-type nav-enemy idle) enter) :exit (-> (method-of-type nav-enemy idle) exit) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (let ((a0-3 (handle->process (-> self focus handle)))) (when a0-3 (let ((f0-0 (vector-vector-xz-distance (get-trans (the-as process-focusable a0-3) 0) (-> self root trans)))) @@ -1089,7 +1093,7 @@ (set! (-> self fire-beam?) #f) (set! (-> self allow-head) #t) (set! (-> self lazer-length) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (sound-stop (-> self lazer-sound)) @@ -1133,7 +1137,7 @@ ) (set! (-> self head-angle) f0-5) ) - (when (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (when (time-elapsed? (-> self state-time) (-> self state-timeout)) (let ((a0-8 (handle->process (-> self focus handle)))) (when a0-8 (let ((f0-6 (vector-vector-xz-distance (get-trans (the-as process-focusable a0-8) 0) (-> self root trans)))) @@ -1196,14 +1200,14 @@ ;; definition for method 192 of type hosehead ;; INFO: Used lq/sq -(defmethod hosehead-method-192 hosehead ((obj hosehead) (arg0 vector)) +(defmethod hosehead-method-192 hosehead ((this hosehead) (arg0 vector)) (local-vars (a2-7 float) (a2-14 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) - (set! (-> arg0 x) (get-rand-float-range obj 5607424.0 5812224.0)) - (set! (-> arg0 z) (get-rand-float-range obj 2027520.0 1961984.0)) + (set! (-> arg0 x) (get-rand-float-range this 5607424.0 5812224.0)) + (set! (-> arg0 z) (get-rand-float-range this 2027520.0 1961984.0)) (set! (-> arg0 y) -368680.97) (let ((gp-1 (new 'stack-no-clear 'vector))) (set! (-> gp-1 quad) (-> arg0 quad)) @@ -1320,11 +1324,11 @@ ;; definition for method 191 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod hosehead-method-191 hosehead ((obj hosehead) (arg0 vector) (arg1 vector)) +(defmethod hosehead-method-191 hosehead ((this hosehead) (arg0 vector) (arg1 vector)) (cond - ((logtest? (-> obj fact enemy-options) (enemy-option user10)) + ((logtest? (-> this fact enemy-options) (enemy-option user10)) (countdown (s3-0 8) - (if (hosehead-method-192 obj arg1) + (if (hosehead-method-192 this arg1) (goto cfg-7) ) ) @@ -1335,7 +1339,7 @@ ) ) (else - (set! (-> arg1 quad) (-> obj root trans quad)) + (set! (-> arg1 quad) (-> this root trans quad)) (set! (-> arg0 quad) (-> arg1 quad)) (+! (-> arg0 y) 81920.0) ) @@ -1482,7 +1486,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -1518,7 +1522,7 @@ ;; definition for method 196 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod hosehead-method-196 hosehead ((obj hosehead)) +(defmethod hosehead-method-196 hosehead ((this hosehead)) (local-vars (sv-768 nav-control) (sv-784 vector) (sv-800 vector)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1528,7 +1532,7 @@ (vf7 :class vf) ) (init-vf0-vector) - (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat))) + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) (f30-0 0.0) ) (vector-float*! s5-0 s5-0 20480.0) @@ -1538,7 +1542,7 @@ ) (vector-rotate-around-y! s1-0 s5-0 (* 182.04445 (the float (+ (* 11 s4-0) -90)))) (let ((v1-7 s3-0)) - (let ((a0-5 (-> obj root trans))) + (let ((a0-5 (-> this root trans))) (let ((a1-3 s1-0)) (let ((a2-2 1.0)) (.mov vf7 a2-2) @@ -1552,7 +1556,7 @@ (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) (.svf (&-> v1-7 quad) vf6) ) - (let ((v1-8 (-> obj nav)) + (let ((v1-8 (-> this nav)) (a0-6 s3-0) (a1-4 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -1566,13 +1570,13 @@ (let ((a1-5 (new 'stack-no-clear 'vector))) (set! (-> a1-5 quad) (-> s3-0 quad)) (set! (-> a1-5 w) 8192.0) - (when (not (add-root-sphere-to-hash! (-> obj nav) a1-5 32)) + (when (not (add-root-sphere-to-hash! (-> this nav) a1-5 32)) (when (< f30-0 f28-0) (set! f30-0 f28-0) (let ((s0-0 (new 'stack-no-clear 'vector))) (set! sv-784 (new 'stack-no-clear 'vector)) (let ((s1-1 (new 'stack 'collide-query))) - (set! sv-768 (-> obj nav)) + (set! sv-768 (-> this nav)) (set! sv-800 s0-0) (let* ((v1-22 s3-0) (a0-14 (-> sv-768 state mesh)) @@ -1593,12 +1597,12 @@ ) 0 (set! (-> s3-0 y) (-> s0-0 y)) - (if (enemy-above-ground? obj s1-1 s3-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (if (enemy-above-ground? this s1-1 s3-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) (set! (-> s3-0 y) (-> s1-1 best-other-tri intersect y)) ) ) ) - (set! (-> obj jump-point quad) (-> s3-0 quad)) + (set! (-> this jump-point quad) (-> s3-0 quad)) ) ) ) @@ -1781,8 +1785,8 @@ ) ;; definition for method 195 of type hosehead -(defmethod hosehead-method-195 hosehead ((obj hosehead)) - (= *target* (handle->process (-> obj focus handle))) +(defmethod hosehead-method-195 hosehead ((this hosehead)) + (= *target* (handle->process (-> this focus handle))) ) ;; failed to figure out what this is: @@ -1975,9 +1979,9 @@ ) ) (nav-enemy-method-166 self) - (set! (-> self last-time-dist-changed) (current-time)) + (set-time! (-> self last-time-dist-changed)) (set! (-> self next-lazer-time) 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (let ((t9-0 (-> (method-of-type nav-enemy hostile) exit))) @@ -2086,7 +2090,7 @@ ;; definition for method 187 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hosehead-method-187 hosehead ((obj hosehead) (arg0 vector)) +(defmethod hosehead-method-187 hosehead ((this hosehead) (arg0 vector)) (local-vars (sv-128 vector)) (set! sv-128 (new 'stack-no-clear 'vector)) (let ((s3-0 (new 'stack-no-clear 'vector)) @@ -2095,10 +2099,10 @@ (s4-0 (new 'stack-no-clear 'vector)) (s5-0 (new 'stack-no-clear 'vector)) ) - (let ((a0-1 (-> obj node-list data 9 bone transform))) + (let ((a0-1 (-> this node-list data 9 bone transform))) (matrix->trans a0-1 s1-0) ) - (vector-z-quaternion! s0-0 (-> obj root quat)) + (vector-z-quaternion! s0-0 (-> this root quat)) (vector-! sv-128 arg0 s1-0) (vector-normalize! sv-128 1.0) (rot-zxy-from-vector! s4-0 s0-0) @@ -2106,13 +2110,13 @@ (set! (-> s5-0 x) (fmax -1820.4445 (fmin 1820.4445 (deg- (-> s3-0 x) (-> s4-0 x))))) (set! (-> s5-0 y) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 y) (-> s4-0 y))))) (set! (-> s5-0 z) 0.0) - (if (not (logtest? (enemy-flag dislike-combo) (-> obj enemy-flags))) + (if (not (logtest? (enemy-flag dislike-combo) (-> this enemy-flags))) (set! (-> s5-0 y) (- (-> s5-0 y))) ) - (+! (-> s5-0 y) (-> obj head-angle)) + (+! (-> s5-0 y) (-> this head-angle)) (let ((s4-1 (new 'stack-no-clear 'quaternion))) (quaternion-zxy! s4-1 s5-0) - (quaternion-pseudo-seek (-> obj head-joint-mod quat) (-> obj head-joint-mod quat) s4-1 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this head-joint-mod quat) (-> this head-joint-mod quat) s4-1 (seconds-per-frame)) ) ) 0 @@ -2121,31 +2125,31 @@ ;; definition for method 188 of type hosehead ;; WARN: Return type mismatch quaternion vs none. -(defmethod hosehead-method-188 hosehead ((obj hosehead)) +(defmethod hosehead-method-188 hosehead ((this hosehead)) (let ((gp-0 (new 'stack-no-clear 'quaternion))) (quaternion-identity! gp-0) - (quaternion-pseudo-seek (-> obj head-joint-mod quat) (-> obj head-joint-mod quat) gp-0 (seconds-per-frame)) + (quaternion-pseudo-seek (-> this head-joint-mod quat) (-> this head-joint-mod quat) gp-0 (seconds-per-frame)) ) (none) ) ;; definition for method 55 of type hosehead -(defmethod track-target! hosehead ((obj hosehead)) +(defmethod track-target! hosehead ((this hosehead)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (hosehead-method-194 obj) + (hosehead-method-194 this) (dotimes (s5-0 4) - (enable-set! (-> obj joint-ik s5-0) #t) + (enable-set! (-> this joint-ik s5-0) #t) ) - (let ((v1-11 (handle->process (-> obj focus handle)))) - (if (and (-> obj allow-head) v1-11) - (hosehead-method-187 obj (-> obj target-pos)) - (hosehead-method-188 obj) + (let ((v1-11 (handle->process (-> this focus handle)))) + (if (and (-> this allow-head) v1-11) + (hosehead-method-187 this (-> this target-pos)) + (hosehead-method-188 this) ) ) (none) @@ -2154,7 +2158,7 @@ ;; definition for method 194 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod hosehead-method-194 hosehead ((obj hosehead)) +(defmethod hosehead-method-194 hosehead ((this hosehead)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -2165,7 +2169,7 @@ (init-vf0-vector) (let ((s5-0 (new 'stack-no-clear 'collide-query))) (let ((v1-0 (-> s5-0 bbox)) - (a0-2 (-> obj root trans)) + (a0-2 (-> this root trans)) (a1-0 (new 'stack-no-clear 'vector)) ) (set! (-> a1-0 x) 14336.0) @@ -2175,7 +2179,7 @@ (vector-! (the-as vector v1-0) a0-2 a1-0) ) (let ((v1-2 (-> s5-0 bbox max)) - (a0-4 (-> obj root trans)) + (a0-4 (-> this root trans)) (a1-1 (new 'stack-no-clear 'vector)) ) (set! (-> a1-1 x) 14336.0) @@ -2190,12 +2194,12 @@ (set! (-> s5-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (fill-using-bounding-box *collide-cache* s5-0) (dotimes (s4-0 4) - (-> obj joint-ik s4-0 shoulder-matrix-no-ik) - (let ((a2-8 (-> obj joint-ik s4-0 elbow-matrix-no-ik)) + (-> this joint-ik s4-0 shoulder-matrix-no-ik) + (let ((a2-8 (-> this joint-ik s4-0 elbow-matrix-no-ik)) (v1-15 (new 'stack-no-clear 'vector)) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> obj node-list data 3 bone transform vector 1 quad)) + (set! (-> s3-0 quad) (-> this node-list data 3 bone transform vector 1 quad)) (new 'stack-no-clear 'vector) (let ((s2-0 (new 'stack-no-clear 'vector))) (let ((a1-3 v1-15)) @@ -2257,8 +2261,8 @@ (let* ((f0-14 (- (-> s2-0 y) (-> s1-0 y))) (f0-15 (lerp-scale 1.0 0.0 f0-14 0.0 8192.0)) ) - (- (-> s1-0 y) (-> obj root trans y)) - (let ((f1-5 (vector-dot s3-0 (vector-! (new 'stack-no-clear 'vector) s1-0 (-> obj root trans)))) + (- (-> s1-0 y) (-> this root trans y)) + (let ((f1-5 (vector-dot s3-0 (vector-! (new 'stack-no-clear 'vector) s1-0 (-> this root trans)))) (v1-29 s2-0) ) (let ((a0-23 s2-0)) @@ -2277,7 +2281,7 @@ ) ) ) - (handle-copy! (-> obj joint-ik s4-0) s2-0) + (handle-copy! (-> this joint-ik s4-0) s2-0) ) ) ) @@ -2289,26 +2293,26 @@ ;; definition for method 106 of type hosehead ;; WARN: Return type mismatch symbol vs none. -(defmethod enemy-method-106 hosehead ((obj hosehead) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) +(defmethod enemy-method-106 hosehead ((this hosehead) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info)) (let ((t9-0 (method-of-type nav-enemy enemy-method-106))) - (t9-0 obj arg0 arg1 arg2 arg3) + (t9-0 this arg0 arg1 arg2 arg3) ) - (let ((a1-3 (enemy-method-134 obj arg0 arg3))) + (let ((a1-3 (enemy-method-134 this arg0 arg3))) (if (and a1-3 (logtest? (process-mask bot) (-> a1-3 mask))) - (set! (-> obj shot-by-ruffian?) #t) - (set! (-> obj shot-by-ruffian?) #f) + (set! (-> this shot-by-ruffian?) #t) + (set! (-> this shot-by-ruffian?) #f) ) ) (none) ) ;; definition for method 56 of type hosehead -(defmethod damage-amount-from-attack hosehead ((obj hosehead) (arg0 process) (arg1 event-message-block)) +(defmethod damage-amount-from-attack hosehead ((this hosehead) (arg0 process) (arg1 event-message-block)) "@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]" (let* ((t9-0 (method-of-type nav-enemy damage-amount-from-attack)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (if (-> obj shot-by-ruffian?) + (if (-> this shot-by-ruffian?) (set! v0-0 0) ) v0-0 @@ -2316,11 +2320,11 @@ ) ;; definition for method 58 of type hosehead -(defmethod enemy-method-58 hosehead ((obj hosehead) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-58 hosehead ((this hosehead) (arg0 process) (arg1 event-message-block)) (let* ((t9-0 (method-of-type nav-enemy enemy-method-58)) - (v0-0 (t9-0 obj arg0 arg1)) + (v0-0 (t9-0 this arg0 arg1)) ) - (if (and (-> obj sentry?) (nonzero? (-> obj hit-points)) (zero? (-> obj fated-time))) + (if (and (-> this sentry?) (nonzero? (-> this hit-points)) (zero? (-> this fated-time))) (set! v0-0 'hit) ) v0-0 @@ -2329,103 +2333,117 @@ ;; definition for method 7 of type hosehead ;; WARN: Return type mismatch none vs hosehead. -(defmethod relocate hosehead ((obj hosehead) (arg0 int)) - (if (nonzero? (-> obj head-joint-mod)) - (&+! (-> obj head-joint-mod) arg0) +(defmethod relocate hosehead ((this hosehead) (arg0 int)) + (if (nonzero? (-> this head-joint-mod)) + (&+! (-> this head-joint-mod) arg0) ) (dotimes (v1-4 4) - (if (nonzero? (-> obj joint-ik v1-4)) - (&+! (-> obj joint-ik v1-4) arg0) + (if (nonzero? (-> this joint-ik v1-4)) + (&+! (-> this joint-ik v1-4) arg0) ) ) - (the-as hosehead ((the-as (function process-drawable int none) (find-parent-method hosehead 7)) obj arg0)) + (the-as hosehead ((the-as (function process-drawable int none) (find-parent-method hosehead 7)) this arg0)) ) ;; definition for method 115 of type hosehead ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! hosehead ((obj hosehead)) +(defmethod init-enemy! hosehead ((this hosehead)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (local-vars (sv-16 res-tag) (sv-32 res-tag)) - (stack-size-set! (-> obj main-thread) 256) - (set! (-> obj on-stop-sentry) #f) + (stack-size-set! (-> this main-thread) 256) + (set! (-> this on-stop-sentry) #f) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-hosehead" (the-as (pointer uint32) #f))) (the-as pair 0) ) (set! sv-16 (new 'static 'res-tag)) - (let ((a0-5 (res-lump-data (-> obj entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) + (let ((a0-5 (res-lump-data (-> this entity) 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when a0-5 - (let ((v1-7 (-> obj root))) + (let ((v1-7 (-> this root))) (+! (-> v1-7 trans x) (-> a0-5 0)) (+! (-> v1-7 trans y) (-> a0-5 1)) (+! (-> v1-7 trans z) (-> a0-5 2)) ) ) ) - (let ((f0-6 (res-lump-float (-> obj entity) 'rotoffset))) + (let ((f0-6 (res-lump-float (-> this entity) 'rotoffset))) (if (!= f0-6 0.0) - (quaternion-rotate-local-y! (-> obj root quat) (-> obj root quat) f0-6) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-6) ) ) - (let ((f0-7 (res-lump-float (-> obj entity) 'extra-float-param :default 30.0))) - (set! (-> obj angle-sentry) (* 182.04445 f0-7)) + (let ((f0-7 (res-lump-float (-> this entity) 'extra-float-param :default 30.0))) + (set! (-> this angle-sentry) (* 182.04445 f0-7)) ) - (set! (-> obj on-wall?) #f) - (when (>= (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj on-wall?) #t) - (set! (-> obj enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> obj enemy-flags)))) + (set! (-> this on-wall?) #f) + (when (>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) + (set! (-> this on-wall?) #t) + (set! (-> this enemy-flags) (the-as enemy-flag (logior (enemy-flag vulnerable-backup) (-> this enemy-flags)))) ) - (init-enemy-behaviour-and-stats! obj *hosehead-nav-enemy-info*) - (set! (-> obj sentry?) (logtest? (-> obj fact enemy-options) (enemy-option user9))) - (when (-> obj sentry?) - (set! (-> obj root pause-adjust-distance) 409600.0) - (set! (-> obj on-stop-sentry) (res-lump-struct (-> obj entity) 'on-stop-sentry function)) + (init-enemy-behaviour-and-stats! this *hosehead-nav-enemy-info*) + (set! (-> this sentry?) (logtest? (-> this fact enemy-options) (enemy-option user9))) + (when (-> this sentry?) + (set! (-> this root pause-adjust-distance) 409600.0) + (set! (-> this on-stop-sentry) (res-lump-struct (-> this entity) 'on-stop-sentry function)) ) - (let ((v1-34 (-> obj nav))) + (let ((v1-34 (-> this nav))) (set! (-> v1-34 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 327680.0) - (add-connection *part-engine* obj 9 obj 318 (new 'static 'vector :x 2048.0 :y -40.96 :z 1392.64 :w 163840.0)) - (add-connection *part-engine* obj 9 obj 318 (new 'static 'vector :x -2048.0 :y -40.96 :z 1392.64 :w 163840.0)) - (if (-> obj on-wall?) - (idle-control-method-9 (-> obj idle-anim-player) *hosehead-idle-wall*) - (idle-control-method-9 (-> obj idle-anim-player) *hosehead-idle-ground*) + (set-gravity-length (-> this root dynam) 327680.0) + (add-connection + *part-engine* + this + 9 + this + 318 + (new 'static 'vector :x 2048.0 :y -40.96 :z 1392.64 :w 163840.0) + ) + (add-connection + *part-engine* + this + 9 + this + 318 + (new 'static 'vector :x -2048.0 :y -40.96 :z 1392.64 :w 163840.0) + ) + (if (-> this on-wall?) + (idle-control-method-9 (-> this idle-anim-player) *hosehead-idle-wall*) + (idle-control-method-9 (-> this idle-anim-player) *hosehead-idle-ground*) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-49 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (let ((v1-49 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-32)))) (cond ((and v1-49 (nonzero? (-> sv-32 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-49)) - (set! (-> obj actor-group-count) (the-as int (-> sv-32 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-49)) + (set! (-> this actor-group-count) (the-as int (-> sv-32 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) (go process-drawable-art-error "actor-group sewesc") ) ) ) - (set! (-> obj head-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 9)) + (set! (-> this head-joint-mod) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 9)) (dotimes (s5-1 4) - (set! (-> obj joint-ik s5-1) (new - 'process - 'joint-mod-ik - obj - (-> *hosehead-ik-setup* s5-1 elbow-index) - (-> *hosehead-ik-setup* s5-1 hand-dist) - ) + (set! (-> this joint-ik s5-1) (new + 'process + 'joint-mod-ik + this + (-> *hosehead-ik-setup* s5-1 elbow-index) + (-> *hosehead-ik-setup* s5-1 hand-dist) + ) ) - (set! (-> obj joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) - (set! (-> obj joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) + (set! (-> this joint-ik s5-1 elbow-pole-vector-axis) (the-as uint 2)) + (set! (-> this joint-ik s5-1 elbow-rotation-axis) (the-as uint 0)) ) - (logior! (-> obj joint-ik 0 flags) (joint-mod-ik-flags elbow-trans-neg)) - (logior! (-> obj joint-ik 2 flags) (joint-mod-ik-flags elbow-trans-neg)) - (set! (-> obj come-from-notice) #t) - (set! (-> obj lazer-sound) (new-sound-id)) - (set! (-> obj lazer-sound2) (new-sound-id)) + (logior! (-> this joint-ik 0 flags) (joint-mod-ik-flags elbow-trans-neg)) + (logior! (-> this joint-ik 2 flags) (joint-mod-ik-flags elbow-trans-neg)) + (set! (-> this come-from-notice) #t) + (set! (-> this lazer-sound) (new-sound-id)) + (set! (-> this lazer-sound2) (new-sound-id)) (let ((a1-22 (new 'stack-no-clear 'sync-info-params))) (let ((v1-77 0)) (if #t @@ -2435,37 +2453,37 @@ (set! (-> a1-22 sync-flags) (the-as sync-flags v1-77)) ) (set! (-> a1-22 period) (the-as uint 1200)) - (set! (-> a1-22 entity) (-> obj entity)) + (set! (-> a1-22 entity) (-> this entity)) (set! (-> a1-22 percent) 0.0) (set! (-> a1-22 ease-in) 0.15) (set! (-> a1-22 ease-out) 0.15) (set! (-> a1-22 pause-in) 0.0) (set! (-> a1-22 pause-out) 0.0) - (initialize! (-> obj sync) a1-22) + (initialize! (-> this sync) a1-22) ) 0 (none) ) ;; definition for method 66 of type hosehead -(defmethod go-ambush hosehead ((obj hosehead)) - (go (method-of-object obj ambush)) +(defmethod go-ambush hosehead ((this hosehead)) + (go (method-of-object this ambush)) ) ;; definition for method 70 of type hosehead -(defmethod go-hostile hosehead ((obj hosehead)) - (if (-> obj sentry?) - (go (method-of-object obj hostile-sentry)) - (go (method-of-object obj hostile)) +(defmethod go-hostile hosehead ((this hosehead)) + (if (-> this sentry?) + (go (method-of-object this hostile-sentry)) + (go (method-of-object this hostile)) ) ) ;; definition for method 116 of type hosehead ;; WARN: Return type mismatch object vs none. -(defmethod go-idle hosehead ((obj hosehead)) - (if (-> obj sentry?) - (go (method-of-object obj idle-sentry)) - (go (method-of-object obj idle)) +(defmethod go-idle hosehead ((this hosehead)) + (if (-> this sentry?) + (go (method-of-object this idle-sentry)) + (go (method-of-object this idle)) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/jinx2-course_REF.gc b/test/decompiler/reference/jak2/levels/sewer/jinx2-course_REF.gc index 7ac75ea920..8aa1d2ecaa 100644 --- a/test/decompiler/reference/jak2/levels/sewer/jinx2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/jinx2-course_REF.gc @@ -11,27 +11,28 @@ ) ;; definition for method 3 of type jinx-sewer -(defmethod inspect jinx-sewer ((obj jinx-sewer)) - (when (not obj) - (set! obj obj) +(defmethod inspect jinx-sewer ((this jinx-sewer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type jinx inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 116 of type jinx-sewer -(defmethod go-idle jinx-sewer ((obj jinx-sewer)) +;; WARN: Return type mismatch object vs none. +(defmethod go-idle jinx-sewer ((this jinx-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (ruffian-method-240 obj) + (ruffian-method-240 this) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/sewer/mog2-course_REF.gc b/test/decompiler/reference/jak2/levels/sewer/mog2-course_REF.gc index c28c1e4bf7..508071ecb1 100644 --- a/test/decompiler/reference/jak2/levels/sewer/mog2-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/mog2-course_REF.gc @@ -11,27 +11,28 @@ ) ;; definition for method 3 of type mog-sewer -(defmethod inspect mog-sewer ((obj mog-sewer)) - (when (not obj) - (set! obj obj) +(defmethod inspect mog-sewer ((this mog-sewer)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type mog inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 116 of type mog-sewer -(defmethod go-idle mog-sewer ((obj mog-sewer)) +;; WARN: Return type mismatch object vs none. +(defmethod go-idle mog-sewer ((this mog-sewer)) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (ruffian-method-240 obj) + (ruffian-method-240 this) ) ) (none) @@ -437,7 +438,7 @@ :nav-mesh-index 2 :skip-to -1 :on-set (lambda ((arg0 mog-sewer)) - (set! (-> arg0 waypoint-time0) (current-time)) + (set-time! (-> arg0 waypoint-time0)) (logior! (-> arg0 bot-flags) (bot-flags bf19)) (clear-poi-and-focus! arg0) (logclear! (-> arg0 focus-status) (focus-status disable)) @@ -451,7 +452,7 @@ (set! (-> (the-as ruft-wait-spot v1-12) check-done) (the-as (function ruft-wait-spot ruffian symbol) - (lambda ((arg0 object) (arg1 mog-sewer)) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (lambda ((arg0 object) (arg1 mog-sewer)) (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 16 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) 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 1b2607288a..8f6adf4140 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sew-gunturret_REF.gc @@ -433,23 +433,23 @@ ) ;; definition for method 3 of type gun-turret-params -(defmethod inspect gun-turret-params ((obj gun-turret-params)) - (when (not obj) - (set! obj obj) +(defmethod inspect gun-turret-params ((this gun-turret-params)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'gun-turret-params) - (format #t "~1Tnormal-sg: ~A~%" (-> obj normal-sg)) - (format #t "~1Texplode-sg: ~A~%" (-> obj explode-sg)) - (format #t "~1Tenemy-info: ~A~%" (-> obj enemy-info)) - (format #t "~1Tidle-anim: ~D~%" (-> obj idle-anim)) - (format #t "~1Tshoot-anim: ~D~%" (-> obj shoot-anim)) - (format #t "~1Ttrack-joint: ~D~%" (-> obj track-joint)) - (format #t "~1Tbarrel-joint: ~D~%" (-> obj barrel-joint)) - (format #t "~1Tgun-joint: ~D~%" (-> obj gun-joint)) - (format #t "~1Thole-joints[8] @ #x~X~%" (-> obj hole-joints)) + (format #t "[~8x] ~A~%" this 'gun-turret-params) + (format #t "~1Tnormal-sg: ~A~%" (-> this normal-sg)) + (format #t "~1Texplode-sg: ~A~%" (-> this explode-sg)) + (format #t "~1Tenemy-info: ~A~%" (-> this enemy-info)) + (format #t "~1Tidle-anim: ~D~%" (-> this idle-anim)) + (format #t "~1Tshoot-anim: ~D~%" (-> this shoot-anim)) + (format #t "~1Ttrack-joint: ~D~%" (-> this track-joint)) + (format #t "~1Tbarrel-joint: ~D~%" (-> this barrel-joint)) + (format #t "~1Tgun-joint: ~D~%" (-> this gun-joint)) + (format #t "~1Thole-joints[8] @ #x~X~%" (-> this hole-joints)) (label cfg-4) - obj + this ) ;; definition of type sew-gunturret @@ -484,31 +484,31 @@ ) ;; definition for method 3 of type sew-gunturret -(defmethod inspect sew-gunturret ((obj sew-gunturret)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-gunturret ((this sew-gunturret)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tgun-tilt-jm: ~A~%" (-> obj gun-tilt-jm)) - (format #t "~2Tparams: #~%" (-> obj params)) - (format #t "~2Taim-pos: #~%" (-> obj aim-pos)) - (format #t "~2Tgun-twist: ~f~%" (-> obj gun-twist)) - (format #t "~2Tgun-tilt: ~f~%" (-> obj gun-tilt)) - (format #t "~2Tdesired-twist: ~f~%" (-> obj desired-twist)) - (format #t "~2Tdesired-tilt: ~f~%" (-> obj desired-tilt)) - (format #t "~2Tlos-clear: ~A~%" (-> obj los-clear)) - (format #t "~2Tsmoke-part: ~A~%" (-> obj smoke-part)) - (format #t "~2Tcasing-part: ~A~%" (-> obj casing-part)) - (format #t "~2Tflash-state: ~A~%" (-> obj flash-state)) - (format #t "~2Tcan-shoot: ~A~%" (-> obj can-shoot)) - (format #t "~2Tlast-hit-time: ~D~%" (-> obj last-hit-time)) - (format #t "~2Tinit-mat: #~%" (-> obj init-mat)) - (format #t "~2Tactivate-distance: ~f~%" (-> obj activate-distance)) + (format #t "~2Tgun-tilt-jm: ~A~%" (-> this gun-tilt-jm)) + (format #t "~2Tparams: #~%" (-> this params)) + (format #t "~2Taim-pos: #~%" (-> this aim-pos)) + (format #t "~2Tgun-twist: ~f~%" (-> this gun-twist)) + (format #t "~2Tgun-tilt: ~f~%" (-> this gun-tilt)) + (format #t "~2Tdesired-twist: ~f~%" (-> this desired-twist)) + (format #t "~2Tdesired-tilt: ~f~%" (-> this desired-tilt)) + (format #t "~2Tlos-clear: ~A~%" (-> this los-clear)) + (format #t "~2Tsmoke-part: ~A~%" (-> this smoke-part)) + (format #t "~2Tcasing-part: ~A~%" (-> this casing-part)) + (format #t "~2Tflash-state: ~A~%" (-> this flash-state)) + (format #t "~2Tcan-shoot: ~A~%" (-> this can-shoot)) + (format #t "~2Tlast-hit-time: ~D~%" (-> this last-hit-time)) + (format #t "~2Tinit-mat: #~%" (-> this init-mat)) + (format #t "~2Tactivate-distance: ~f~%" (-> this activate-distance)) (label cfg-4) - obj + this ) ;; definition for symbol *sew-gunturret-enemy-info*, type enemy-info @@ -598,72 +598,78 @@ ;; definition for method 137 of type sew-gunturret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod aim-turret! sew-gunturret ((obj sew-gunturret) (aim-at-target? symbol)) +(defmethod aim-turret! sew-gunturret ((this sew-gunturret) (aim-at-target? symbol)) "Calculates the angle and tilt for the turret to either aim at the target, or it's default direction @param aim-at-target? Whether or not the turret should aim at the target, will ignore the target if #f" (cond - ((and aim-at-target? (-> obj los-clear)) - (let ((target-proc (handle->process (-> obj focus handle)))) + ((and aim-at-target? (-> this los-clear)) + (let ((target-proc (handle->process (-> this focus handle)))) (if target-proc - (set! (-> obj aim-pos quad) (-> (get-trans (the-as process-focusable target-proc) 3) quad)) + (set! (-> this aim-pos quad) (-> (get-trans (the-as process-focusable target-proc) 3) quad)) ) ) ) (else - (set-aim-at-default! obj) + (set-aim-at-default! this) ) ) (let ((s4-0 (new 'stack-no-clear 'vector)) - (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj params track-joint)))) + (s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params track-joint)))) ) (let ((s3-0 (new 'stack-no-clear 'vector))) - (vector-! s4-0 (-> obj aim-pos) (-> obj root trans)) - (vector-flatten! s4-0 s4-0 (-> obj init-mat vector 1)) + (vector-! s4-0 (-> this aim-pos) (-> this root trans)) + (vector-flatten! s4-0 s4-0 (-> this init-mat vector 1)) (vector-normalize! s4-0 1.0) - (set! (-> obj desired-twist) (asin (vector-dot (the-as vector (-> obj init-mat)) s4-0))) - (set! (-> obj desired-twist) (fmin 5461.3335 (fmax -5461.3335 (-> obj desired-twist)))) + (set! (-> this desired-twist) (asin (vector-dot (the-as vector (-> this init-mat)) s4-0))) + (set! (-> this desired-twist) (fmin 5461.3335 (fmax -5461.3335 (-> this desired-twist)))) (cond - ((< 0.0 (vector-dot (-> obj init-mat vector 2) s4-0)) + ((< 0.0 (vector-dot (-> this init-mat vector 2) s4-0)) ) - ((< (-> obj desired-twist) 0.0) - (set! (-> obj desired-twist) -5461.3335) + ((< (-> this desired-twist) 0.0) + (set! (-> this desired-twist) -5461.3335) ) (else - (set! (-> obj desired-twist) 5461.3335) + (set! (-> this desired-twist) 5461.3335) ) ) (cond - ((and (!= (-> obj activate-distance) 0.0) (< (fabs (-> obj desired-twist)) 5461.3335)) - (vector-normalize-copy! s3-0 (-> obj node-list data (-> obj params track-joint) bone transform vector 1) 1.0) - (vector-! s4-0 (-> obj aim-pos) s5-2) + ((and (!= (-> this activate-distance) 0.0) (< (fabs (-> this desired-twist)) 5461.3335)) + (vector-normalize-copy! + s3-0 + (-> this node-list data (-> this params track-joint) bone transform vector 1) + 1.0 + ) + (vector-! s4-0 (-> this aim-pos) s5-2) (vector-normalize! s4-0 1.0) - (set! (-> obj desired-tilt) (- (asin (vector-dot s3-0 s4-0)))) - (set! (-> obj desired-tilt) (fmin 5461.3335 (fmax 0.0 (-> obj desired-tilt)))) + (set! (-> this desired-tilt) (- (asin (vector-dot s3-0 s4-0)))) + (set! (-> this desired-tilt) (fmin 5461.3335 (fmax 0.0 (-> this desired-tilt)))) ) (else - (set! (-> obj desired-tilt) 0.0) + (set! (-> this desired-tilt) 0.0) ) ) ) (vector-normalize-copy! - (-> obj aim-pos) - (-> obj node-list data (-> obj params barrel-joint) bone transform vector 2) - (vector-vector-distance s5-2 (-> obj aim-pos)) + (-> this aim-pos) + (-> this node-list data (-> this params barrel-joint) bone transform vector 2) + (vector-vector-distance s5-2 (-> this aim-pos)) ) ) (vector+! - (-> obj aim-pos) - (-> obj aim-pos) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj params gun-joint))) + (-> this aim-pos) + (-> this aim-pos) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params gun-joint))) ) (let ((matrix (new 'stack-no-clear 'matrix))) - (+! (-> obj gun-twist) (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> obj desired-twist) (-> obj gun-twist)))))) - (matrix-rotate-y! matrix (-> obj gun-twist)) - (matrix*! matrix matrix (-> obj init-mat)) - (matrix->quaternion (-> obj root quat) matrix) + (+! (-> this gun-twist) + (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> this desired-twist) (-> this gun-twist))))) + ) + (matrix-rotate-y! matrix (-> this gun-twist)) + (matrix*! matrix matrix (-> this init-mat)) + (matrix->quaternion (-> this root quat) matrix) ) - (+! (-> obj gun-tilt) (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> obj desired-tilt) (-> obj gun-tilt)))))) - (quaternion-axis-angle! (-> obj gun-tilt-jm quat) 1.0 0.0 0.0 (-> obj gun-tilt)) + (+! (-> this gun-tilt) (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> this desired-tilt) (-> this gun-tilt)))))) + (quaternion-axis-angle! (-> this gun-tilt-jm quat) 1.0 0.0 0.0 (-> this gun-tilt)) 0 (none) ) @@ -671,17 +677,17 @@ ;; definition for method 138 of type sew-gunturret ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-collision! sew-gunturret ((obj sew-gunturret)) +(defmethod update-collision! sew-gunturret ((this sew-gunturret)) "Updates the collision for the turret based on it's aiming direction" - (let ((target-proc (handle->process (-> obj focus handle)))) + (let ((target-proc (handle->process (-> this focus handle)))) (if target-proc - (set! (-> obj aim-pos quad) (-> (get-trans (the-as process-focusable target-proc) 3) quad)) + (set! (-> this aim-pos quad) (-> (get-trans (the-as process-focusable target-proc) 3) quad)) ) ) - (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj params gun-joint)))) - (s5-3 (vector-! (new 'stack-no-clear 'vector) (-> obj aim-pos) s4-0)) + (let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params gun-joint)))) + (s5-3 (vector-! (new 'stack-no-clear 'vector) (-> this aim-pos) s4-0)) ) - (when (< (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-3 1.0) (-> obj init-mat vector 2)) + (when (< (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-3 1.0) (-> this init-mat vector 2)) (cos 364.0889) ) (let ((cquery (new 'stack-no-clear 'collide-query))) @@ -692,7 +698,7 @@ (set! (-> _cquery collide-with) (collide-spec backgnd crate obstacle hit-by-player-list hit-by-others-list pusher) ) - (set! (-> _cquery ignore-process0) obj) + (set! (-> _cquery ignore-process0) this) (set! (-> _cquery ignore-process1) #f) (set! (-> _cquery ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) @@ -700,8 +706,8 @@ (set! (-> _cquery action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* cquery) 0.0) - (set! (-> obj los-clear) #f) - (set! (-> obj los-clear) #t) + (set! (-> this los-clear) #f) + (set! (-> this los-clear) #t) ) ) ) @@ -712,32 +718,32 @@ ;; definition for method 139 of type sew-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod set-aim-at-default! sew-gunturret ((obj sew-gunturret)) +(defmethod set-aim-at-default! sew-gunturret ((this sew-gunturret)) "Aims the turret at it's default direction. Sets `aim-pos` accordingly" - (vector+float*! (-> obj aim-pos) (-> obj root trans) (-> obj init-mat vector 2) 163840.0) + (vector+float*! (-> this aim-pos) (-> this root trans) (-> this init-mat vector 2) 163840.0) 0 (none) ) ;; definition for method 140 of type sew-gunturret ;; INFO: Used lq/sq -(defmethod fire-turret! sew-gunturret ((obj sew-gunturret) (fire-sound? symbol)) +(defmethod fire-turret! sew-gunturret ((this sew-gunturret) (fire-sound? symbol)) "Actually fires the turret, sets `flash-state` to [[#t]] @param fire-sound? Whether to play the fire sound effect or not" - (let ((v1-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> obj params gun-joint)))) + (let ((v1-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params gun-joint)))) (proj-params (new 'stack-no-clear 'projectile-init-by-other-params)) ) - (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> obj aim-pos) v1-4)) + (let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) (-> this aim-pos) v1-4)) (f30-0 (/ 2013265900.0 (vector-length s2-1))) (temp-vec (new 'stack-no-clear 'vector)) ) - (set! (-> proj-params ent) (-> obj entity)) + (set! (-> proj-params ent) (-> this entity)) (set! (-> proj-params charge) 1.0) (set! (-> proj-params options) (projectile-options)) (set! (-> proj-params pos quad) (-> v1-4 quad)) - (set! (-> proj-params notify-handle) (process->handle obj)) + (set! (-> proj-params notify-handle) (process->handle this)) (set! (-> proj-params owner-handle) (the-as handle #f)) - (set! (-> proj-params ignore-handle) (process->handle obj)) + (set! (-> proj-params ignore-handle) (process->handle this)) (let* ((v1-12 *game-info*) (a0-18 (+ (-> v1-12 attack-id) 1)) ) @@ -755,20 +761,20 @@ ) (vector+! (-> proj-params vel) (-> proj-params vel) temp-vec) ) - (spawn-projectile guard-shot proj-params obj *default-dead-pool*) + (spawn-projectile guard-shot proj-params this *default-dead-pool*) ) (if fire-sound? (sound-play "gtur-shot-fire") ) - (set! (-> obj flash-state) #t) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 0))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 1))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 2))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 3))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 4))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 5))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 6))) - (spawn-with-cspace (-> obj casing-part) (-> obj node-list data (-> obj params hole-joints 7))) + (set! (-> this flash-state) #t) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 0))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 1))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 2))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 3))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 4))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 5))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 6))) + (spawn-with-cspace (-> this casing-part) (-> this node-list data (-> this params hole-joints 7))) (none) ) @@ -788,7 +794,7 @@ (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (>= 2 (the-as int (-> self focus aware))) (go-stare self) ) @@ -799,13 +805,13 @@ (set-aim-at-default! self) (until #f (current-time) - (until (>= (- (current-time) (-> self last-hit-time)) (seconds 2)) + (until (time-elapsed? (-> self last-hit-time) (seconds 2)) (suspend) ) (update-collision! self) (sound-play "sew-gun-lock") (let ((frame-counter (current-time))) - (until (>= (- (current-time) frame-counter) (seconds 0.75)) + (until (time-elapsed? frame-counter (seconds 0.75)) (aim-turret! self #t) (suspend) ) @@ -816,11 +822,11 @@ ) (sound-play "gturret") (let ((s4-1 (current-time))) - (until (>= (- (current-time) s4-1) (seconds 0.125)) + (until (time-elapsed? s4-1 (seconds 0.125)) (cond ((not (-> self can-shoot)) ) - ((>= (- (current-time) (the-as time-frame frames)) (seconds 0.05)) + ((time-elapsed? (the-as time-frame frames) (seconds 0.05)) (fire-turret! self fire-sound?) (set! frames (the-as int (current-time))) (set! fire-sound? (not fire-sound?)) @@ -838,7 +844,7 @@ (ja-channel-push! 1 (seconds 0.2)) (ja :group! (-> self draw art-group data (-> self params idle-anim))) (let ((_frame-counter (current-time))) - (until (>= (- (current-time) _frame-counter) (seconds 0.5)) + (until (time-elapsed? _frame-counter (seconds 0.5)) (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 0))) (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 1))) (spawn-with-cspace (-> self smoke-part) (-> self node-list data (-> self params hole-joints 2))) @@ -871,21 +877,21 @@ ) ;; definition for method 74 of type sew-gunturret -(defmethod general-event-handler sew-gunturret ((obj sew-gunturret) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) +(defmethod general-event-handler sew-gunturret ((this sew-gunturret) (proc process) (arg2 int) (event-type symbol) (event event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (if (and (= event-type 'notify) (< 1 arg2) (= (-> event param 0) 'attack) (= (-> event param 1) *target*)) - (set! (-> obj last-hit-time) (current-time)) + (set-time! (-> this last-hit-time)) ) (case event-type (('start) (let ((v0-0 (the-as object #t))) - (set! (-> obj can-shoot) (the-as symbol v0-0)) + (set! (-> this can-shoot) (the-as symbol v0-0)) v0-0 ) ) (('stop) - (set! (-> obj can-shoot) #f) + (set! (-> this can-shoot) #f) #f ) (('bonk) @@ -899,10 +905,10 @@ #f ) (('flash-state) - (-> obj flash-state) + (-> this flash-state) ) (else - ((method-of-type enemy general-event-handler) obj proc arg2 event-type event) + ((method-of-type enemy general-event-handler) this proc arg2 event-type event) ) ) ) @@ -940,14 +946,14 @@ (set! (-> vec quad) (-> self root trans quad)) (+! (-> vec y) 10240.0) (let ((frame-counter (current-time))) - (until (>= (- (current-time) frame-counter) (seconds 2)) + (until (time-elapsed? frame-counter (seconds 2)) (spawn (-> self part) vec) (suspend) ) ) ) (let ((_frame-counter (current-time))) - (until (>= (- (current-time) _frame-counter) (seconds 1)) + (until (time-elapsed? _frame-counter (seconds 1)) (suspend) ) ) @@ -963,9 +969,9 @@ ;; definition for method 114 of type sew-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! sew-gunturret ((obj sew-gunturret)) +(defmethod init-enemy-collision! sew-gunturret ((this sew-gunturret)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -1017,31 +1023,31 @@ (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) 0 (none) ) ;; definition for method 98 of type sew-gunturret -(defmethod in-aggro-range? sew-gunturret ((obj sew-gunturret) (proc process-focusable) (arg1 vector)) +(defmethod in-aggro-range? sew-gunturret ((this sew-gunturret) (proc process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @param proc The process used to distance check @returns true/false" (cond - ((= (-> obj activate-distance) 0.0) + ((= (-> this activate-distance) 0.0) (return #t) ) (else (let ((dist (vector-dot - (vector-! (new 'stack-no-clear 'vector) (get-trans proc 3) (-> obj root trans)) - (-> obj init-mat vector 2) + (vector-! (new 'stack-no-clear 'vector) (get-trans proc 3) (-> this root trans)) + (-> this init-mat vector 2) ) ) ) - (return (and (< 0.0 dist) (< dist (-> obj activate-distance)))) + (return (and (< 0.0 dist) (< dist (-> this activate-distance)))) ) ) ) @@ -1049,41 +1055,41 @@ ) ;; definition for method 10 of type sew-gunturret -(defmethod deactivate sew-gunturret ((obj sew-gunturret)) - (if (nonzero? (-> obj smoke-part)) - (kill-and-free-particles (-> obj smoke-part)) +(defmethod deactivate sew-gunturret ((this sew-gunturret)) + (if (nonzero? (-> this smoke-part)) + (kill-and-free-particles (-> this smoke-part)) ) - (if (nonzero? (-> obj casing-part)) - (kill-and-free-particles (-> obj casing-part)) + (if (nonzero? (-> this casing-part)) + (kill-and-free-particles (-> this casing-part)) ) - ((method-of-type enemy deactivate) obj) + ((method-of-type enemy deactivate) this) (none) ) ;; definition for method 60 of type sew-gunturret -(defmethod coin-flip? sew-gunturret ((obj sew-gunturret)) +(defmethod coin-flip? sew-gunturret ((this sew-gunturret)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 7 of type sew-gunturret ;; WARN: Return type mismatch enemy vs sew-gunturret. -(defmethod relocate sew-gunturret ((obj sew-gunturret) (arg0 int)) - (if (nonzero? (-> obj gun-tilt-jm)) - (&+! (-> obj gun-tilt-jm) arg0) +(defmethod relocate sew-gunturret ((this sew-gunturret) (arg0 int)) + (if (nonzero? (-> this gun-tilt-jm)) + (&+! (-> this gun-tilt-jm) arg0) ) - (if (nonzero? (-> obj smoke-part)) - (&+! (-> obj smoke-part) arg0) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) arg0) ) - (if (nonzero? (-> obj casing-part)) - (&+! (-> obj casing-part) arg0) + (if (nonzero? (-> this casing-part)) + (&+! (-> this casing-part) arg0) ) - (the-as sew-gunturret ((method-of-type enemy relocate) obj arg0)) + (the-as sew-gunturret ((method-of-type enemy relocate) this arg0)) ) ;; definition for method 141 of type sew-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod init-turret-params! sew-gunturret ((obj sew-gunturret)) +(defmethod init-turret-params! sew-gunturret ((this sew-gunturret)) (let ((turret-params (new 'static 'gun-turret-params :idle-anim 2 @@ -1105,7 +1111,7 @@ ) ) (set! (-> turret-params enemy-info) *sew-gunturret-enemy-info*) - (set! (-> obj params) turret-params) + (set! (-> this params) turret-params) ) 0 (none) @@ -1113,43 +1119,43 @@ ;; definition for method 115 of type sew-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! sew-gunturret ((obj sew-gunturret)) +(defmethod init-enemy! sew-gunturret ((this sew-gunturret)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (init-turret-params! obj) - (initialize-skeleton obj (-> obj params normal-sg) (the-as pair 0)) - (init-enemy-behaviour-and-stats! obj (-> obj params enemy-info)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 1126) obj)) - (set! (-> obj smoke-part) (create-launch-control (-> *part-group-id-table* 1127) obj)) - (set! (-> obj casing-part) (create-launch-control (-> *part-group-id-table* 1128) obj)) - (set! (-> obj gun-tilt-jm) - (new 'process 'joint-mod (joint-mod-mode joint-set*) obj (-> obj params barrel-joint)) + (init-turret-params! this) + (initialize-skeleton this (-> this params normal-sg) (the-as pair 0)) + (init-enemy-behaviour-and-stats! this (-> this params enemy-info)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1126) this)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 1127) this)) + (set! (-> this casing-part) (create-launch-control (-> *part-group-id-table* 1128) this)) + (set! (-> this gun-tilt-jm) + (new 'process 'joint-mod (joint-mod-mode joint-set*) this (-> this params barrel-joint)) ) - (set! (-> obj los-clear) #f) - (set! (-> obj gun-twist) 0.0) - (set! (-> obj gun-tilt) 0.0) - (set! (-> obj desired-twist) 0.0) - (set! (-> obj desired-tilt) 0.0) - (set! (-> obj flash-state) #f) - (set! (-> obj can-shoot) #t) - (set! (-> obj last-hit-time) 0) - (quaternion->matrix (-> obj init-mat) (-> obj root quat)) - (set! (-> obj activate-distance) (res-lump-float (-> obj entity) 'distance)) + (set! (-> this los-clear) #f) + (set! (-> this gun-twist) 0.0) + (set! (-> this gun-tilt) 0.0) + (set! (-> this desired-twist) 0.0) + (set! (-> this desired-tilt) 0.0) + (set! (-> this flash-state) #f) + (set! (-> this can-shoot) #t) + (set! (-> this last-hit-time) 0) + (quaternion->matrix (-> this init-mat) (-> this root quat)) + (set! (-> this activate-distance) (res-lump-float (-> this entity) 'distance)) 0 (none) ) ;; definition for method 116 of type sew-gunturret ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sew-gunturret ((obj sew-gunturret)) +(defmethod go-idle sew-gunturret ((this sew-gunturret)) (cond ((task-node-closed? (game-task-node sewer-enemy-blow-up-turrets)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1264,35 +1270,35 @@ ) ;; definition for method 3 of type pal-gun-turret -(defmethod inspect pal-gun-turret ((obj pal-gun-turret)) - (when (not obj) - (set! obj obj) +(defmethod inspect pal-gun-turret ((this pal-gun-turret)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type sew-gunturret inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 140 of type pal-gun-turret -(defmethod fire-turret! pal-gun-turret ((obj pal-gun-turret) (arg0 symbol)) +(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)) obj arg0) + ((the-as (function sew-gunturret symbol none) (find-parent-method pal-gun-turret 140)) this arg0) (set-palcab-turret-flash! 1.0) ) ;; definition for method 116 of type pal-gun-turret ;; WARN: Return type mismatch object vs none. -(defmethod go-idle pal-gun-turret ((obj pal-gun-turret)) - (go (method-of-object obj idle)) +(defmethod go-idle pal-gun-turret ((this pal-gun-turret)) + (go (method-of-object this idle)) (none) ) ;; definition for method 141 of type pal-gun-turret ;; WARN: Return type mismatch int vs none. -(defmethod init-turret-params! pal-gun-turret ((obj pal-gun-turret)) +(defmethod init-turret-params! pal-gun-turret ((this pal-gun-turret)) (let ((turret-params (new 'static 'gun-turret-params :idle-anim 2 @@ -1314,7 +1320,7 @@ ) ) (set! (-> turret-params enemy-info) *pal-gun-turret-enemy-info*) - (set! (-> obj params) turret-params) + (set! (-> this params) turret-params) ) 0 (none) 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 7410ab1b01..6e72a73c18 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs2_REF.gc @@ -15,17 +15,17 @@ ) ;; definition for method 3 of type sew-elevator -(defmethod inspect sew-elevator ((obj sew-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-elevator ((this sew-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -35,25 +35,25 @@ ) ;; definition for method 30 of type sew-elevator -(defmethod get-art-group sew-elevator ((obj sew-elevator)) +(defmethod get-art-group sew-elevator ((this sew-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-sew-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 43 of type sew-elevator -(defmethod move-between-points sew-elevator ((obj sew-elevator) (arg1 vector) (point-a float) (point-b float)) +(defmethod move-between-points sew-elevator ((this sew-elevator) (arg1 vector) (point-a float) (point-b float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((path-point-a (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) point-a 'interp)) - (path-point-b (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) point-b 'interp)) - (elevator-pos (-> obj root trans)) + (let ((path-point-a (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-a 'interp)) + (path-point-b (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) point-b 'interp)) + (elevator-pos (-> this root trans)) ) (when (and (< (-> path-point-b y) (-> path-point-a y)) (< (-> arg1 y) (+ -8192.0 (-> elevator-pos y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg1 elevator-pos))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) ) ) @@ -61,7 +61,7 @@ ) ;; definition for method 45 of type sew-elevator -(defmethod commited-to-ride? sew-elevator ((obj sew-elevator)) +(defmethod commited-to-ride? sew-elevator ((this sew-elevator)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((target *target*) (target-proc (if (type? target process-focusable) @@ -71,9 +71,9 @@ ) (when target-proc (let* ((target-pos (get-trans target-proc 0)) - (dist-from-center (vector-! (new 'stack-no-clear 'vector) target-pos (-> obj root trans))) + (dist-from-center (vector-! (new 'stack-no-clear 'vector) target-pos (-> this root trans))) ) - (vector-inv-orient-by-quat! dist-from-center dist-from-center (-> obj root quat)) + (vector-inv-orient-by-quat! dist-from-center dist-from-center (-> this root quat)) (and (< (fabs (-> dist-from-center x)) 20480.0) (< 0.0 (-> dist-from-center z)) (< (-> dist-from-center z) 40960.0) @@ -85,10 +85,10 @@ ;; definition for method 49 of type sew-elevator ;; WARN: Return type mismatch int vs none. -(defmethod configure-collision sew-elevator ((obj sew-elevator) (collide-with-jak? symbol)) +(defmethod configure-collision sew-elevator ((this sew-elevator) (collide-with-jak? symbol)) "Appropriately sets the collision on the elevator @param collide-with-jak? If set, the elevator will collide with Jak" - (let ((prim-group (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) + (let ((prim-group (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (collide-with-jak? (set! (-> prim-group prim-core collide-as) (collide-spec obstacle pusher)) @@ -151,25 +151,25 @@ ) ;; definition for method 10 of type sew-elevator -(defmethod deactivate sew-elevator ((obj sew-elevator)) - (sound-stop (-> obj sound-id)) - ((the-as (function elevator none) (find-parent-method sew-elevator 10)) obj) +(defmethod deactivate sew-elevator ((this sew-elevator)) + (sound-stop (-> this sound-id)) + ((the-as (function elevator none) (find-parent-method sew-elevator 10)) this) (none) ) ;; definition for method 33 of type sew-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! sew-elevator ((obj sew-elevator)) +(defmethod init-plat! sew-elevator ((this sew-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." - (set! (-> obj sound-id) (new-sound-id)) + (set! (-> this sound-id) (new-sound-id)) 0 (none) ) ;; definition for method 41 of type sew-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-defaults! sew-elevator ((obj sew-elevator)) +(defmethod init-defaults! sew-elevator ((this sew-elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` @@ -177,28 +177,28 @@ For example for an elevator pre-compute the distance between the first and last - `elevator-move-rate` - `elevator-flags`" (let ((func (method-of-type elevator init-defaults!))) - (func obj) + (func this) ) - (if (name= (-> obj name) "sew-elevator-15") - (set! (-> obj params xz-threshold) 348160.0) - (set! (-> obj params xz-threshold) 184320.0) + (if (name= (-> this name) "sew-elevator-15") + (set! (-> this params xz-threshold) 348160.0) + (set! (-> this params xz-threshold) 184320.0) ) - (when (and (logtest? (elevator-flags elevator-flags-17) (-> obj params flags)) + (when (and (logtest? (elevator-flags elevator-flags-17) (-> this params flags)) (and (task-node-closed? (game-task-node sewer-escort-introduction)) (not (task-node-closed? (game-task-node sewer-escort-resolution))) ) ) - (set! (-> obj params start-pos) 0.0) - (logior! (-> obj params flags) (elevator-flags elevator-flags-3)) + (set! (-> this params start-pos) 0.0) + (logior! (-> this params flags) (elevator-flags elevator-flags-3)) ) 0 (none) ) ;; definition for method 31 of type sew-elevator -(defmethod init-plat-collision! sew-elevator ((obj sew-elevator)) +(defmethod init-plat-collision! sew-elevator ((this sew-elevator)) "TODO - collision stuff for setting up the platform" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -231,9 +231,9 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (configure-collision obj #f) + (configure-collision this #f) (none) ) @@ -257,25 +257,25 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 3 of type sew-valve -(defmethod inspect sew-valve ((obj sew-valve)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-valve ((this sew-valve)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tjoint: ~A~%" (-> obj joint)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tjoint: ~A~%" (-> this joint)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Twater-height: ~f~%" (-> obj water-height)) - (format #t "~2Tspin: ~f~%" (-> obj spin)) - (format #t "~2Tspin-rate: ~f~%" (-> obj spin-rate)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Twater-height: ~f~%" (-> this water-height)) + (format #t "~2Tspin: ~f~%" (-> this spin)) + (format #t "~2Tspin-rate: ~f~%" (-> this spin-rate)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -362,20 +362,20 @@ 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 ((obj sew-valve) (arg0 int)) - (if (nonzero? (-> obj joint)) - (&+! (-> obj joint) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method sew-valve 7)) this arg0) ) ) ;; definition for method 11 of type sew-valve ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-valve ((obj sew-valve) (entity entity-actor)) +(defmethod init-from-entity! sew-valve ((this sew-valve) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -383,7 +383,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (tag-1 res-tag) (tag-2 res-tag)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -403,32 +403,32 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-valve" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj spin) 0.0) - (set! (-> obj spin-rate) 0.0) - (set! (-> obj joint) (new 'process 'joint-mod-rotate-local obj 4 #f)) + (set! (-> this spin) 0.0) + (set! (-> this spin-rate) 0.0) + (set! (-> this joint) (new 'process 'joint-mod-rotate-local this 4 #f)) (set! tag-1 (new 'static 'res-tag)) - (set! (-> obj actor-group) - (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& tag-1)) + (set! (-> this actor-group) + (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& tag-1)) ) - (set! (-> obj actor-group-count) (the-as int (-> tag-1 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> tag-1 elt-count))) (set! tag-2 (new 'static 'res-tag)) - (let ((data (res-lump-data (-> obj entity) 'extra-float-param pointer :tag-ptr (& tag-2)))) + (let ((data (res-lump-data (-> this entity) 'extra-float-param pointer :tag-ptr (& tag-2)))) (if (and data (nonzero? (-> tag-2 elt-count))) - (set! (-> obj water-height) (-> (the-as (pointer float) data))) - (set! (-> obj water-height) 0.0) + (set! (-> this water-height) (-> (the-as (pointer float) data))) + (set! (-> this water-height) 0.0) ) ) - (format #t "~S water-height: ~m~%" (-> obj name) (-> obj water-height)) - (+! (-> obj water-height) -216498.17) - (go (method-of-object obj idle)) + (format #t "~S water-height: ~m~%" (-> this name) (-> this water-height)) + (+! (-> this water-height) -216498.17) + (go (method-of-object this idle)) (none) ) @@ -445,16 +445,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-mar-statue-debris -(defmethod inspect sew-mar-statue-debris ((obj sew-mar-statue-debris)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-mar-statue-debris ((this sew-mar-statue-debris)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type sew-mar-statue-debris-b @@ -470,16 +470,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-mar-statue-debris-b -(defmethod inspect sew-mar-statue-debris-b ((obj sew-mar-statue-debris-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-mar-statue-debris-b ((this sew-mar-statue-debris-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type sew-mar-statue @@ -498,17 +498,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-mar-statue -(defmethod inspect sew-mar-statue ((obj sew-mar-statue)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-mar-statue ((this sew-mar-statue)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspawned-debris?: ~A~%" (-> obj spawned-debris?)) + (format #t "~2Tspawned-debris?: ~A~%" (-> this spawned-debris?)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -650,7 +650,7 @@ This commonly includes things such as: ) ;; definition for method 12 of type sew-mar-statue -(defmethod run-logic? sew-mar-statue ((obj sew-mar-statue)) +(defmethod run-logic? sew-mar-statue ((this sew-mar-statue)) #t ) @@ -684,15 +684,15 @@ This commonly includes things such as: ;; definition for method 11 of type sew-mar-statue ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mar-statue ((obj sew-mar-statue) (entity entity-actor)) +(defmethod init-from-entity! sew-mar-statue ((this sew-mar-statue) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj spawned-debris?) #f) - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (set! (-> this spawned-debris?) #f) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec obstacle)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -707,25 +707,25 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-mar-statue" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (set! (-> obj event-hook) sew-mar-statue-event-handler) + (set! (-> this event-hook) sew-mar-statue-event-handler) (cond ((task-node-closed? (game-task-node sewer-escort-resolution)) - (process-spawn sew-mar-statue-debris :to obj) - (process-spawn sew-mar-statue-debris-b :to obj) - (set! (-> obj spawned-debris?) #t) - (go (method-of-object obj hidden)) + (process-spawn sew-mar-statue-debris :to this) + (process-spawn sew-mar-statue-debris-b :to this) + (set! (-> this spawned-debris?) #t) + (go (method-of-object this hidden)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -741,16 +741,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-catwalk -(defmethod inspect sew-catwalk ((obj sew-catwalk)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-catwalk ((this sew-catwalk)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type drop-plat inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -762,12 +762,12 @@ This commonly includes things such as: ;; definition for method 29 of type sew-catwalk ;; WARN: Return type mismatch int vs none. -(defmethod start-bouncing! sew-catwalk ((obj sew-catwalk)) +(defmethod start-bouncing! sew-catwalk ((this sew-catwalk)) "Sets `bouncing` to [[#t]] and sets up the clock to periodically bounce and translate the platform via the `smush` @see [[smush-control]]" - (logclear! (-> obj mask) (process-mask sleep)) - (logclear! (-> obj mask) (process-mask sleep-code)) + (logclear! (-> this mask) (process-mask sleep)) + (logclear! (-> this mask) (process-mask sleep-code)) 0 (none) ) @@ -809,7 +809,7 @@ and translate the platform via the `smush` ;; definition for method 11 of type sew-catwalk ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-catwalk ((obj sew-catwalk) (entity entity-actor)) +(defmethod init-from-entity! sew-catwalk ((this sew-catwalk) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -817,8 +817,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape-moving)) - (stack-size-set! (-> obj main-thread) 512) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -880,22 +880,22 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-catwalk-1" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj art-name) "sew-catwalk-1") - (set! (-> obj anim) + (set! (-> this art-name) "sew-catwalk-1") + (set! (-> this anim) (new 'static 'spool-anim :name "sew-catwalk-1" :anim-name "1-break" :parts 3 :command-list '()) ) - (set! (-> obj basetrans quad) (-> obj root trans quad)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj fall) #t) - (go (method-of-object obj idle)) + (set! (-> this basetrans quad) (-> this root trans quad)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this fall) #t) + (go (method-of-object this idle)) ) (none) ) @@ -917,17 +917,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-mine -(defmethod inspect sew-mine ((obj sew-mine)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-mine ((this sew-mine)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlast-time: ~D~%" (-> obj last-time)) + (format #t "~2Tlast-time: ~D~%" (-> this last-time)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1029,7 +1029,7 @@ This commonly includes things such as: ) (cleanup-for-death self) (let ((frame-counter (current-time))) - (until (>= (- (current-time) frame-counter) (seconds 2)) + (until (time-elapsed? frame-counter (seconds 2)) (suspend) ) ) @@ -1038,10 +1038,10 @@ This commonly includes things such as: ;; definition for method 22 of type sew-mine ;; WARN: Return type mismatch int vs none. -(defmethod init-mine! sew-mine ((obj sew-mine)) +(defmethod init-mine! sew-mine ((this sew-mine)) "Initializes the mine's particles and sets `last-time` to `0`" - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 345) obj)) - (set! (-> obj last-time) 0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 345) this)) + (set! (-> this last-time) 0) 0 (none) ) @@ -1056,16 +1056,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-mine-a -(defmethod inspect sew-mine-a ((obj sew-mine-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-mine-a ((this sew-mine-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type sew-mine inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1076,14 +1076,14 @@ This commonly includes things such as: ;; definition for method 11 of type sew-mine-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mine-a ((obj sew-mine-a) (entity entity-actor)) +(defmethod init-from-entity! sew-mine-a ((this sew-mine-a) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec pusher)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -1099,16 +1099,16 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving cshape)) + (set! (-> this root) (the-as collide-shape-moving cshape)) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-mine-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-mine! obj) - (go (method-of-object obj idle)) + (init-mine! this) + (go (method-of-object this idle)) (none) ) @@ -1126,20 +1126,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-mine-b -(defmethod inspect sew-mine-b ((obj sew-mine-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-mine-b ((this sew-mine-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type sew-mine inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbase-height: ~f~%" (-> obj base-height)) - (format #t "~2Tcenter: #~%" (-> obj center)) - (format #t "~2Ttime-skew: ~D~%" (-> obj time-skew)) - (format #t "~2Tperiod: ~f~%" (-> obj period)) + (format #t "~2Tbase-height: ~f~%" (-> this base-height)) + (format #t "~2Tcenter: #~%" (-> this center)) + (format #t "~2Ttime-skew: ~D~%" (-> this time-skew)) + (format #t "~2Tperiod: ~f~%" (-> this period)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1181,14 +1181,14 @@ This commonly includes things such as: ;; definition for method 11 of type sew-mine-b ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-mine-b ((obj sew-mine-b) (entity entity-actor)) +(defmethod init-from-entity! sew-mine-b ((this sew-mine-b) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((cshape (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((cshape (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((prim-mesh (new 'process 'collide-shape-prim-mesh cshape (the-as uint 0) (the-as uint 0)))) (set! (-> prim-mesh prim-core collide-as) (collide-spec pusher)) (set! (-> prim-mesh prim-core collide-with) (collide-spec jak player-list)) @@ -1204,33 +1204,33 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving cshape)) + (set! (-> this root) (the-as collide-shape-moving cshape)) ) - (process-drawable-from-entity! obj entity) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-mine-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-mine! obj) - (let ((_entity (-> obj entity))) - (set! (-> obj base-height) ((method-of-object _entity get-property-value-float) - _entity - 'base-height - 'interp - -1000000000.0 - -16384000.0 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) + (init-mine! this) + (let ((_entity (-> this entity))) + (set! (-> this base-height) ((method-of-object _entity get-property-value-float) + _entity + 'base-height + 'interp + -1000000000.0 + -16384000.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) ) ) - (set! (-> obj time-skew) (the-as uint (the int (* 300.0 (rand-vu-float-range 0.1 1.4))))) - (set! (-> obj period) (* 300.0 (rand-vu-float-range 1.2 1.8))) - (set! (-> obj center quad) (-> obj root trans quad)) - (+! (-> obj base-height) -216498.17) - (set! (-> obj root pause-adjust-distance) 532480.0) - (go (method-of-object obj idle)) + (set! (-> this time-skew) (the-as uint (the int (* 300.0 (rand-vu-float-range 0.1 1.4))))) + (set! (-> this period) (* 300.0 (rand-vu-float-range 1.2 1.8))) + (set! (-> this center quad) (-> this root trans quad)) + (+! (-> this base-height) -216498.17) + (set! (-> this root pause-adjust-distance) 532480.0) + (go (method-of-object this idle)) (none) ) @@ -1255,22 +1255,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-wall -(defmethod inspect sew-wall ((obj sew-wall)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-wall ((this sew-wall)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tdeadly-radius: ~f~%" (-> obj deadly-radius)) - (format #t "~2Tprev-deadly-radius: ~f~%" (-> obj prev-deadly-radius)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tfirst-wall?: ~A~%" (-> obj first-wall?)) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tart-name: ~A~%" (-> obj art-name)) + (format #t "~2Tdeadly-radius: ~f~%" (-> this deadly-radius)) + (format #t "~2Tprev-deadly-radius: ~f~%" (-> this prev-deadly-radius)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tfirst-wall?: ~A~%" (-> this first-wall?)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1283,24 +1283,24 @@ This commonly includes things such as: ;; definition for method 29 of type sew-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod attack-target! sew-wall ((obj sew-wall)) +(defmethod attack-target! sew-wall ((this sew-wall)) "If the target is close enough to the wall, hit it!" (let ((target *target*)) (when target - (let ((dist-from-wall (vector-vector-xz-distance (get-trans target 0) (-> obj root trans))) - (deadly-radius (-> obj deadly-radius)) - (prev-deadly-radius (-> obj prev-deadly-radius)) + (let ((dist-from-wall (vector-vector-xz-distance (get-trans target 0) (-> this root trans))) + (deadly-radius (-> this deadly-radius)) + (prev-deadly-radius (-> this prev-deadly-radius)) ) - (set! (-> obj prev-deadly-radius) deadly-radius) + (set! (-> this prev-deadly-radius) deadly-radius) (when (and (>= deadly-radius dist-from-wall) (>= dist-from-wall (+ -4096.0 prev-deadly-radius))) (let ((cquery (new 'stack-no-clear 'collide-query))) - (set! (-> cquery start-pos quad) (-> obj root trans quad)) + (set! (-> cquery start-pos quad) (-> this root trans quad)) (+! (-> cquery start-pos y) 12288.0) (vector-! (-> cquery move-dist) (get-trans target 3) (-> cquery start-pos)) (let ((v1-9 cquery)) (set! (-> v1-9 radius) 819.2) (set! (-> v1-9 collide-with) (collide-spec backgnd)) - (set! (-> v1-9 ignore-process0) obj) + (set! (-> v1-9 ignore-process0) this) (set! (-> v1-9 ignore-process1) #f) (set! (-> v1-9 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-9 action-mask) (collide-action solid)) @@ -1310,9 +1310,9 @@ This commonly includes things such as: *target* 'attack #f - (static-attack-info ((id (-> obj attack-id)) (mode 'explode) (attacker-velocity (-> cquery move-dist)))) + (static-attack-info ((id (-> this attack-id)) (mode 'explode) (attacker-velocity (-> cquery move-dist)))) ) - (set! (-> obj deadly-radius) -1.0) + (set! (-> this deadly-radius) -1.0) ) ) ) @@ -1432,17 +1432,17 @@ This commonly includes things such as: ;; definition for method 11 of type sew-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-wall ((obj sew-wall) (entity entity-actor)) +(defmethod init-from-entity! sew-wall ((this sew-wall) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (let ((data ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'art-name 'interp -1000000000.0 @@ -1453,8 +1453,8 @@ This commonly includes things such as: ) (art-group (art-group-get-by-name *level* "skel-sew-wall" (the-as (pointer uint32) #f))) ) - (set! (-> obj art-name) (the-as string data)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this art-name) (the-as string data)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -1501,48 +1501,48 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (cond - ((string= (-> obj art-name) "sew-wall-1") - (set! (-> obj anim) + ((string= (-> this art-name) "sew-wall-1") + (set! (-> this anim) (new 'static 'spool-anim :name "sew-wall-1" :anim-name "1-break" :parts 1 :command-list '()) ) - (set! (-> obj first-wall?) #t) + (set! (-> this first-wall?) #t) ) - ((string= (-> obj art-name) "sew-wall-2") - (set! (-> obj anim) + ((string= (-> this art-name) "sew-wall-2") + (set! (-> this anim) (new 'static 'spool-anim :name "sew-wall-2" :anim-name "2-break" :parts 1 :command-list '()) ) - (+! (-> obj root trans z) 26624.0) - (set! (-> obj first-wall?) #f) + (+! (-> this root trans z) 26624.0) + (set! (-> this first-wall?) #f) ) (else (go process-drawable-art-error (the-as string data)) ) ) - (initialize-skeleton obj (the-as skeleton-group art-group) (the-as pair 0)) + (initialize-skeleton this (the-as skeleton-group art-group) (the-as pair 0)) ) - (set! (-> obj draw force-lod) 0) + (set! (-> this draw force-lod) 0) (ja-channel-set! 1) - (let* ((channel (-> obj skel root-channel 0)) - (_art-group (-> obj draw art-group)) + (let* ((channel (-> this skel root-channel 0)) + (_art-group (-> this draw art-group)) (s3-1 (method-of-object _art-group get-art-by-name-method)) ) - (format (clear *temp-string*) "~S-idle" (-> obj art-name)) + (format (clear *temp-string*) "~S-idle" (-> this art-name)) (set! (-> channel frame-group) (the-as art-joint-anim (s3-1 _art-group *temp-string* (the-as type #f)))) ) (let* ((game-info *game-info*) (id (+ (-> game-info attack-id) 1)) ) (set! (-> game-info attack-id) id) - (set! (-> obj attack-id) id) + (set! (-> this attack-id) id) ) - (if (script-eval (res-lump-struct (-> obj entity) 'on-activate pair)) - (go (method-of-object obj hit) #t) - (go (method-of-object obj idle)) + (if (script-eval (res-lump-struct (-> this entity) 'on-activate pair)) + (go (method-of-object this hit) #t) + (go (method-of-object this idle)) ) (none) ) @@ -1560,16 +1560,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-grill -(defmethod inspect sew-grill ((obj sew-grill)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-grill ((this sew-grill)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1596,21 +1596,21 @@ This commonly includes things such as: ;; definition for method 11 of type sew-grill ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-grill ((obj sew-grill) (entity entity-actor)) +(defmethod init-from-entity! sew-grill ((this sew-grill) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj entity) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-grill" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1632,20 +1632,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-scare-grunt -(defmethod inspect sew-scare-grunt ((obj sew-scare-grunt)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-scare-grunt ((this sew-scare-grunt)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type grunt inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tmanipy: #x~X~%" (-> obj manipy)) - (format #t "~2Tspooled-sound-id: ~D~%" (-> obj spooled-sound-id)) - (format #t "~2Tgrill-actor: ~A~%" (-> obj grill-actor)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tmanipy: #x~X~%" (-> this manipy)) + (format #t "~2Tspooled-sound-id: ~D~%" (-> this spooled-sound-id)) + (format #t "~2Tgrill-actor: ~A~%" (-> this grill-actor)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1773,7 +1773,7 @@ This commonly includes things such as: :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self draw status) (draw-control-status no-draw)) ) :trans (behavior () @@ -1922,17 +1922,17 @@ This commonly includes things such as: ;; definition for method 116 of type sew-scare-grunt ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sew-scare-grunt ((obj sew-scare-grunt)) - (go (method-of-object obj waiting)) +(defmethod go-idle sew-scare-grunt ((this sew-scare-grunt)) + (go (method-of-object this waiting)) (none) ) ;; definition for method 114 of type sew-scare-grunt ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! sew-scare-grunt ((obj sew-scare-grunt)) +(defmethod init-enemy-collision! sew-scare-grunt ((this sew-scare-grunt)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (stack-size-set! (-> obj main-thread) 512) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (stack-size-set! (-> this main-thread) 512) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -2011,29 +2011,29 @@ This commonly includes things such as: (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) (set! (-> cshape max-iteration-count) (the-as uint 3)) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) 0 (none) ) ;; definition for method 185 of type sew-scare-grunt -(defmethod get-enemy-info sew-scare-grunt ((obj sew-scare-grunt)) +(defmethod get-enemy-info sew-scare-grunt ((this sew-scare-grunt)) "@returns the [[nav-enemy-info]] associated with this type of grunt" *sew-scare-grunt-nav-enemy-info* ) ;; definition for method 115 of type sew-scare-grunt ;; WARN: Return type mismatch float vs none. -(defmethod init-enemy! sew-scare-grunt ((obj sew-scare-grunt)) +(defmethod init-enemy! sew-scare-grunt ((this sew-scare-grunt)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (set! (-> obj anim) + (set! (-> this anim) (new 'static 'spool-anim :name "sew-scare-grunt" :anim-name "sew-scare-grunt" :parts 2 :command-list '()) ) - (set! (-> obj grill-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) + (set! (-> this grill-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) (let ((func (method-of-type grunt init-enemy!))) - (func obj) + (func this) ) - (+! (-> obj root trans y) -3276.8) + (+! (-> this root trans y) -3276.8) (none) ) diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc index f034b865e7..77dfd9b43f 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-obs_REF.gc @@ -21,51 +21,51 @@ ;; definition for method 3 of type sew-blade ;; INFO: Used lq/sq -(defmethod inspect sew-blade ((obj sew-blade)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-blade ((this sew-blade)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ty-min: ~f~%" (-> obj y-min)) - (format #t "~2Ty-max: ~f~%" (-> obj y-max)) - (format #t "~2Tsnd-water: ~D~%" (-> obj snd-water)) - (format #t "~2Tsnd-no-water: ~D~%" (-> obj snd-no-water)) - (format #t "~2Tlast-sound: ~D~%" (-> obj last-sound)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Ty-min: ~f~%" (-> this y-min)) + (format #t "~2Ty-max: ~f~%" (-> this y-max)) + (format #t "~2Tsnd-water: ~D~%" (-> this snd-water)) + (format #t "~2Tsnd-no-water: ~D~%" (-> this snd-no-water)) + (format #t "~2Tlast-sound: ~D~%" (-> this last-sound)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) (label cfg-4) - obj + this ) ;; definition for method 20 of type sew-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod update-sound! sew-blade ((obj sew-blade)) +(defmethod update-sound! sew-blade ((this sew-blade)) "Updates the sound of the [[sew-blade]] based on if it's under or above the water" - (when (nonzero? (-> obj sound)) - (let ((f30-0 (+ (-> obj root trans y) (-> obj y-max))) - (f28-0 (+ (-> obj root trans y) (-> obj y-min))) + (when (nonzero? (-> this sound)) + (let ((f30-0 (+ (-> this root trans y) (-> this y-max))) + (f28-0 (+ (-> this root trans y) (-> this y-min))) (ocean-base-height (get-base-height *ocean-map-sewer*)) ) (cond ((< f30-0 ocean-base-height) - (stop! (-> obj sound)) + (stop! (-> this sound)) ) ((< ocean-base-height f28-0) - (when (!= (-> obj last-sound) 1) - (change-sound! (-> obj sound) (-> obj snd-no-water)) - (set! (-> obj last-sound) 1) + (when (!= (-> this last-sound) 1) + (change-sound! (-> this sound) (-> this snd-no-water)) + (set! (-> this last-sound) 1) ) - (update! (-> obj sound)) + (update! (-> this sound)) ) (else - (when (!= (-> obj last-sound) 2) - (change-sound! (-> obj sound) (-> obj snd-water)) - (set! (-> obj last-sound) 2) + (when (!= (-> this last-sound) 2) + (change-sound! (-> this sound) (-> this snd-water)) + (set! (-> this last-sound) 2) ) - (update! (-> obj sound)) + (update! (-> this sound)) ) ) ) @@ -88,17 +88,17 @@ ) ;; definition for method 3 of type sew-single-blade -(defmethod inspect sew-single-blade ((obj sew-single-blade)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-single-blade ((this sew-single-blade)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type sew-blade inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tquat: #~%" (-> obj quat)) + (format #t "~2Tquat: #~%" (-> this quat)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -157,15 +157,15 @@ ;; definition for method 11 of type sew-single-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-single-blade ((obj sew-single-blade) (arg0 entity-actor)) +(defmethod init-from-entity! sew-single-blade ((this sew-single-blade) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask ambient)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -186,30 +186,30 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-single-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-copy! (-> obj quat) (-> obj root quat)) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj root trans))) - (set-falloff-far! (-> obj sound) 286720.0) - (set! (-> obj y-min) -16384.0) - (set! (-> obj y-max) 16384.0) - (set! (-> obj snd-water) (static-sound-name "single-blade-w")) - (set! (-> obj snd-no-water) (static-sound-name "single-blade")) + (quaternion-copy! (-> this quat) (-> this root quat)) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this root trans))) + (set-falloff-far! (-> this sound) 286720.0) + (set! (-> this y-min) -16384.0) + (set! (-> this y-max) 16384.0) + (set! (-> this snd-water) (static-sound-name "single-blade-w")) + (set! (-> this snd-no-water) (static-sound-name "single-blade")) (let* ((game-info *game-info*) (id (+ (-> game-info attack-id) 1)) ) (set! (-> game-info attack-id) id) - (set! (-> obj attack-id) id) + (set! (-> this attack-id) id) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -229,19 +229,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-tri-blade -(defmethod inspect sew-tri-blade ((obj sew-tri-blade)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-tri-blade ((this sew-tri-blade)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type sew-blade inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim-time: ~f~%" (-> obj anim-time)) - (format #t "~2Tanim-offset: ~f~%" (-> obj anim-offset)) - (format #t "~2Tswitch-state: ~D~%" (-> obj switch-state)) + (format #t "~2Tanim-time: ~f~%" (-> this anim-time)) + (format #t "~2Tanim-offset: ~f~%" (-> this anim-offset)) + (format #t "~2Tswitch-state: ~D~%" (-> this switch-state)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -367,15 +367,15 @@ This commonly includes things such as: ;; definition for method 11 of type sew-tri-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-tri-blade ((obj sew-tri-blade) (entity entity-actor)) +(defmethod init-from-entity! sew-tri-blade ((this sew-tri-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask ambient)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -416,36 +416,36 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> v1-23 prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> v1-23 prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-tri-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj state-time) (current-time)) - (set! (-> obj anim-time) 0.0) - (set! (-> obj anim-offset) 0.0) - (set! (-> obj skel postbind-function) sew-tri-blade-joint-callback) + (set-time! (-> this state-time)) + (set! (-> this anim-time) 0.0) + (set! (-> this anim-offset) 0.0) + (set! (-> this skel postbind-function) sew-tri-blade-joint-callback) (let* ((v1-33 *game-info*) (a0-33 (+ (-> v1-33 attack-id) 1)) ) (set! (-> v1-33 attack-id) a0-33) - (set! (-> obj attack-id) a0-33) + (set! (-> this attack-id) a0-33) ) (if (>= (res-lump-value entity 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj anim-offset) 3.0) + (set! (-> this anim-offset) 3.0) ) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj root trans))) - (set-falloff-far! (-> obj sound) 286720.0) - (set! (-> obj y-min) 0.0) - (set! (-> obj y-max) 48332.8) - (set! (-> obj snd-water) (static-sound-name "tri-blade-w")) - (set! (-> obj snd-no-water) (static-sound-name "tri-blade")) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this root trans))) + (set-falloff-far! (-> this sound) 286720.0) + (set! (-> this y-min) 0.0) + (set! (-> this y-max) 48332.8) + (set! (-> this snd-water) (static-sound-name "tri-blade-w")) + (set! (-> this snd-no-water) (static-sound-name "tri-blade")) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -462,16 +462,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-arm-blade -(defmethod inspect sew-arm-blade ((obj sew-arm-blade)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-arm-blade ((this sew-arm-blade)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type sew-blade inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -523,15 +523,15 @@ This commonly includes things such as: ;; definition for method 11 of type sew-arm-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-arm-blade ((obj sew-arm-blade) (entity entity-actor)) +(defmethod init-from-entity! sew-arm-blade ((this sew-arm-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask ambient)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -552,29 +552,29 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-arm-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj root trans))) - (set-falloff-far! (-> obj sound) 286720.0) - (set! (-> obj y-min) -43008.0) - (set! (-> obj y-max) -4096.0) - (set! (-> obj snd-water) (static-sound-name "arm-blade-w")) - (set! (-> obj snd-no-water) (static-sound-name "arm-blade")) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this root trans))) + (set-falloff-far! (-> this sound) 286720.0) + (set! (-> this y-min) -43008.0) + (set! (-> this y-max) -4096.0) + (set! (-> this snd-water) (static-sound-name "arm-blade-w")) + (set! (-> this snd-no-water) (static-sound-name "arm-blade")) (let* ((game-info *game-info*) (id (+ (-> game-info attack-id) 1)) ) (set! (-> game-info attack-id) id) - (set! (-> obj attack-id) id) + (set! (-> this attack-id) id) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -591,16 +591,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-multi-blade -(defmethod inspect sew-multi-blade ((obj sew-multi-blade)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-multi-blade ((this sew-multi-blade)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type sew-blade inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -659,15 +659,15 @@ This commonly includes things such as: ;; definition for method 11 of type sew-multi-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-multi-blade ((obj sew-multi-blade) (entity entity-actor)) +(defmethod init-from-entity! sew-multi-blade ((this sew-multi-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask ambient)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -688,29 +688,29 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-multi-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj root trans))) - (set-falloff-far! (-> obj sound) 368640.0) - (set! (-> obj y-min) -16384.0) - (set! (-> obj y-max) 16384.0) - (set! (-> obj snd-water) (static-sound-name "multi-blade-w")) - (set! (-> obj snd-no-water) (static-sound-name "multi-blade")) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this root trans))) + (set-falloff-far! (-> this sound) 368640.0) + (set! (-> this y-min) -16384.0) + (set! (-> this y-max) 16384.0) + (set! (-> this snd-water) (static-sound-name "multi-blade-w")) + (set! (-> this snd-no-water) (static-sound-name "multi-blade")) (let* ((game-info *game-info*) (id (+ (-> game-info attack-id) 1)) ) (set! (-> game-info attack-id) id) - (set! (-> obj attack-id) id) + (set! (-> this attack-id) id) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -729,17 +729,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-twist-blade -(defmethod inspect sew-twist-blade ((obj sew-twist-blade)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-twist-blade ((this sew-twist-blade)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type sew-blade inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tno-collision-timer: ~D~%" (-> obj no-collision-timer)) + (format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -787,9 +787,10 @@ This commonly includes things such as: ) :trans (behavior () (when (and (nonzero? (-> self no-collision-timer)) - (>= (- (current-time) (the-as int (-> self no-collision-timer))) - (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) - ) + (time-elapsed? + (the-as int (-> self no-collision-timer)) + (the-as time-frame (-> *TARGET-bank* hit-invulnerable-timeout)) + ) ) (let ((root-prim (-> self root-overide root-prim))) (set! (-> root-prim prim-core collide-as) (-> self root-overide backup-collide-as)) @@ -824,15 +825,15 @@ This commonly includes things such as: ;; definition for method 11 of type sew-twist-blade ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-twist-blade ((obj sew-twist-blade) (entity entity-actor)) +(defmethod init-from-entity! sew-twist-blade ((this sew-twist-blade) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask ambient)) - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (logior! (-> this mask) (process-mask ambient)) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -853,29 +854,29 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root-overide) cshape) + (set! (-> this root-overide) cshape) ) - (process-drawable-from-entity! obj entity) - (logclear! (-> obj mask) (process-mask actor-pause)) + (process-drawable-from-entity! this entity) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-twist-blade" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (set! (-> obj sound) (new 'process 'ambient-sound "none" (-> obj root-overide trans))) - (set-falloff-far! (-> obj sound) 245760.0) - (set! (-> obj y-min) -4096.0) - (set! (-> obj y-max) 4096.0) - (set! (-> obj snd-water) (static-sound-name "twist-blade-w")) - (set! (-> obj snd-no-water) (static-sound-name "twist-blade")) + (set! (-> this sound) (new 'process 'ambient-sound "none" (-> this root-overide trans))) + (set-falloff-far! (-> this sound) 245760.0) + (set! (-> this y-min) -4096.0) + (set! (-> this y-max) 4096.0) + (set! (-> this snd-water) (static-sound-name "twist-blade-w")) + (set! (-> this snd-no-water) (static-sound-name "twist-blade")) (let* ((game-info *game-info*) (id (+ (-> game-info attack-id) 1)) ) (set! (-> game-info attack-id) id) - (set! (-> obj attack-id) id) + (set! (-> this attack-id) id) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -898,22 +899,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-light-switch -(defmethod inspect sew-light-switch ((obj sew-light-switch)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-light-switch ((this sew-light-switch)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlight-state: ~A~%" (-> obj light-state)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tlight-state: ~A~%" (-> this light-state)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) (label cfg-7) - obj + this ) ;; definition of type sew-light-control @@ -935,20 +936,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type sew-light-control -(defmethod inspect sew-light-control ((obj sew-light-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect sew-light-control ((this sew-light-control)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsearch-switches: ~A~%" (-> obj search-switches)) - (format #t "~2Tsearch-turrets: ~A~%" (-> obj search-turrets)) - (format #t "~2Tswitch-ent: ~A~%" (-> obj switch-ent)) - (format #t "~2Tturret-ent: ~A~%" (-> obj turret-ent)) + (format #t "~2Tsearch-switches: ~A~%" (-> this search-switches)) + (format #t "~2Tsearch-turrets: ~A~%" (-> this search-turrets)) + (format #t "~2Tswitch-ent: ~A~%" (-> this switch-ent)) + (format #t "~2Tturret-ent: ~A~%" (-> this turret-ent)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1024,9 +1025,9 @@ This commonly includes things such as: ;; definition for method 22 of type sew-light-switch ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-switch-collision! sew-light-switch ((obj sew-light-switch)) +(defmethod init-switch-collision! sew-light-switch ((this sew-light-switch)) "Initializes the collision on the switch" - (let ((cshape (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((cshape (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> cshape dynam) (copy *standard-dynamics* 'process)) (set! (-> cshape reaction) cshape-reaction-default) (set! (-> cshape no-reaction) @@ -1046,19 +1047,19 @@ This commonly includes things such as: (set! (-> cshape backup-collide-as) (-> root-prim prim-core collide-as)) (set! (-> cshape backup-collide-with) (-> root-prim prim-core collide-with)) ) - (set! (-> obj root) cshape) + (set! (-> this root) cshape) ) (none) ) ;; definition for method 23 of type sew-light-switch ;; WARN: Return type mismatch object vs none. -(defmethod broadcast-to-actors sew-light-switch ((obj sew-light-switch) (event-type symbol)) +(defmethod broadcast-to-actors sew-light-switch ((this sew-light-switch) (event-type symbol)) "Broadcast event to all associated [[entity]]s via the `actor-group`s @param `event-type` the symbol to broadcast" (with-pp - (dotimes (group-idx (-> obj actor-group-count)) - (let ((group (-> obj actor-group group-idx))) + (dotimes (group-idx (-> this actor-group-count)) + (let ((group (-> this actor-group group-idx))) (dotimes (actor-idx (-> group length)) (let ((evt (new 'stack-no-clear 'event-message-block))) (set! (-> evt from) (process->ppointer pp)) @@ -1088,7 +1089,7 @@ This commonly includes things such as: ;; definition for method 11 of type sew-light-switch ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! sew-light-switch ((obj sew-light-switch) (entity entity-actor)) +(defmethod init-from-entity! sew-light-switch ((this sew-light-switch) (entity entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1096,30 +1097,30 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (tag res-tag)) - (init-switch-collision! obj) - (process-drawable-from-entity! obj entity) + (init-switch-collision! this) + (process-drawable-from-entity! this entity) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-light-switch" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (process-entity-status! obj (entity-perm-status no-kill) #t) + (process-entity-status! this (entity-perm-status no-kill) #t) (set! tag (new 'static 'res-tag)) - (let ((data (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& tag)))) + (let ((data (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& tag)))) (cond ((and data (nonzero? (-> tag elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) data)) - (set! (-> obj actor-group-count) (the-as int (-> tag elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) data)) + (set! (-> this actor-group-count) (the-as int (-> tag elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (set! (-> obj light-state) #f) - (go (method-of-object obj idle)) + (set! (-> this light-state) #f) + (go (method-of-object this idle)) (none) ) @@ -1306,7 +1307,7 @@ This commonly includes things such as: ) ;; definition for method 15 of type sew-light-control -(defmethod press! sew-light-control ((obj sew-light-control) (switched-on? symbol) (should-turret-flash? symbol)) +(defmethod press! sew-light-control ((this sew-light-control) (switched-on? symbol) (should-turret-flash? symbol)) "Turns the lights on (or off) @param switched-on? Should the sewer lights be turned on or off? @param should-turret-flash? Should the turret have it's `flash` set as well" diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-part_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-part_REF.gc index 549e5d03bb..4b0b118dcf 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type sewer-part -(defmethod inspect sewer-part ((obj sewer-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect sewer-part ((this sewer-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc b/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc index fb536c9cd2..eaf9bf65e5 100644 --- a/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/sewer/sewer-scenes_REF.gc @@ -978,15 +978,15 @@ ) ;; definition for method 3 of type fake-jinx-bomb-info -(defmethod inspect fake-jinx-bomb-info ((obj fake-jinx-bomb-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect fake-jinx-bomb-info ((this fake-jinx-bomb-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Thandle: ~D~%" (-> this handle)) (label cfg-4) - obj + this ) ;; definition for symbol *fake-jinx-bomb-info*, type fake-jinx-bomb-info @@ -1254,43 +1254,43 @@ ;; definition for method 15 of type hud-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-gunturret ((obj hud-gunturret)) +(defmethod draw hud-gunturret ((this hud-gunturret)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 205 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -20 24) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -20 24) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-gunturret ((obj hud-gunturret)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-gunturret ((this hud-gunturret)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-gunturret ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-gunturret ((obj hud-gunturret)) - (set! (-> obj level) (level-get *level* 'sewerb)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-gunturret ((this hud-gunturret)) + (set! (-> this level) (level-get *level* 'sewerb)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd37))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 0.7) - (set! (-> obj sprites 0 scale-y) 0.7) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd37))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 0.7) + (set! (-> this sprites 0 scale-y) 0.7) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -1334,7 +1334,7 @@ (lambda :behavior task-manager () (local-vars (sv-96 int) (sv-100 float) (sv-104 vector)) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-gunturret :init hud-init-by-other :to self))) (while (> (-> self data-int32 0) 0) (when (!= (level-status *level* 'sewer) 'active) @@ -1379,10 +1379,10 @@ (set! (-> *game-info* counter) (the float v1-51)) ) (when (and (= (-> self data-int32 1) sv-96) - (and (< sv-100 122880.0) (>= (- (current-time) (-> self beep-time)) (seconds 40))) + (and (< sv-100 122880.0) (time-elapsed? (-> self beep-time) (seconds 40))) ) (talker-spawn-func (-> *talker-speech* 53) *entity-pool* (target-pos 0) (the-as region #f)) - (set! (-> self beep-time) (current-time)) + (set-time! (-> self beep-time)) ) (suspend) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc b/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc index 6c704a0b12..54615ab91a 100644 --- a/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/racebike_REF.gc @@ -791,38 +791,38 @@ ) ;; definition for method 3 of type vehicle-race-bike -(defmethod inspect vehicle-race-bike ((obj vehicle-race-bike)) - (when (not obj) - (set! obj obj) +(defmethod inspect vehicle-race-bike ((this vehicle-race-bike)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-racer inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsteering-wheel: ~A~%" (-> obj steering-wheel)) + (format #t "~2Tsteering-wheel: ~A~%" (-> this steering-wheel)) (label cfg-4) - obj + this ) ;; definition for method 7 of type vehicle-race-bike ;; WARN: Return type mismatch process-drawable vs vehicle-race-bike. -(defmethod relocate vehicle-race-bike ((obj vehicle-race-bike) (arg0 int)) - (if (nonzero? (-> obj steering-wheel)) - (&+! (-> obj steering-wheel) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method vehicle-race-bike 7)) this arg0) ) ) ;; definition for method 86 of type vehicle-race-bike ;; WARN: Return type mismatch int vs none. -(defmethod update-joint-mods vehicle-race-bike ((obj vehicle-race-bike)) - (let ((f0-1 (* -5461.3335 (-> obj controls steering))) +(defmethod update-joint-mods vehicle-race-bike ((this vehicle-race-bike)) + (let ((f0-1 (* -5461.3335 (-> this controls steering))) (a1-0 (new 'static 'vector :z 1.0 :w 1.0)) ) - (quaternion-vector-angle! (the-as quaternion (-> obj steering-wheel target)) a1-0 f0-1) + (quaternion-vector-angle! (the-as quaternion (-> this steering-wheel target)) a1-0 f0-1) ) 0 (none) @@ -838,22 +838,22 @@ ) ;; definition for method 3 of type race-bike-d -(defmethod inspect race-bike-d ((obj race-bike-d)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-bike-d ((this race-bike-d)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-race-bike inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 32 of type race-bike-d ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape race-bike-d ((obj race-bike-d)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape race-bike-d ((this race-bike-d)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -891,7 +891,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -899,19 +899,19 @@ ;; definition for method 33 of type race-bike-d ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body race-bike-d ((obj race-bike-d)) +(defmethod init-skel-and-rigid-body race-bike-d ((this race-bike-d)) (race-vehicle-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-race-bike-d" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj rider-hand-joint) 4) - (set! (-> obj steering-wheel) - (the-as joint-mod (new 'process 'joint-mod-rotate-local obj (-> obj rider-hand-joint) #t)) + (set! (-> this rider-hand-joint) 4) + (set! (-> this steering-wheel) + (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this rider-hand-joint) #t)) ) - (alloc-and-init-rigid-body-control obj *race-bike-d-constants*) - (set! (-> obj draw light-index) (the-as uint 30)) + (alloc-and-init-rigid-body-control this *race-bike-d-constants*) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) @@ -926,22 +926,22 @@ ) ;; definition for method 3 of type race-bike-e -(defmethod inspect race-bike-e ((obj race-bike-e)) - (when (not obj) - (set! obj obj) +(defmethod inspect race-bike-e ((this race-bike-e)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type vehicle-race-bike inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 32 of type race-bike-e ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape race-bike-e ((obj race-bike-e)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape race-bike-e ((this race-bike-e)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -979,7 +979,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -987,19 +987,19 @@ ;; definition for method 33 of type race-bike-e ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body race-bike-e ((obj race-bike-e)) +(defmethod init-skel-and-rigid-body race-bike-e ((this race-bike-e)) (race-vehicle-entity-hack) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-race-bike-e" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj rider-hand-joint) 4) - (set! (-> obj steering-wheel) - (the-as joint-mod (new 'process 'joint-mod-rotate-local obj (-> obj rider-hand-joint) #t)) + (set! (-> this rider-hand-joint) 4) + (set! (-> this steering-wheel) + (the-as joint-mod (new 'process 'joint-mod-rotate-local this (-> this rider-hand-joint) #t)) ) - (alloc-and-init-rigid-body-control obj *race-bike-e-constants*) - (set! (-> obj draw light-index) (the-as uint 30)) + (alloc-and-init-rigid-body-control this *race-bike-e-constants*) + (set! (-> this draw light-index) (the-as uint 30)) 0 (none) ) 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 a21f4c0f6a..85ac0e2ef5 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 @@ -56,50 +56,50 @@ ) ;; definition for method 3 of type hoverboard-training-manager -(defmethod inspect hoverboard-training-manager ((obj hoverboard-training-manager)) - (when (not obj) - (set! obj obj) +(defmethod inspect hoverboard-training-manager ((this hoverboard-training-manager)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Ttrick-type: ~D~%" (-> obj trick-type)) - (format #t "~2Tboard-picked-up: ~A~%" (-> obj board-picked-up)) - (format #t "~2Tboost: ~A~%" (-> obj boost)) - (format #t "~2Tgrind: ~A~%" (-> obj grind)) - (format #t "~2Ttext: ~A~%" (-> obj text)) - (format #t "~2Tscore: ~f~%" (-> obj score)) - (format #t "~2Tchallenge-done: ~A~%" (-> obj challenge-done)) - (format #t "~2Tarrow: ~D~%" (-> obj arrow)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) - (format #t "~2Thud-score: ~D~%" (-> obj hud-score)) - (format #t "~2Thud-goal: ~D~%" (-> obj hud-goal)) - (format #t "~2Tvoicebox: ~D~%" (-> obj voicebox)) - (format #t "~2Tlast-sound-id: ~D~%" (-> obj last-sound-id)) - (format #t "~2Tcombo-done?: ~A~%" (-> obj combo-done?)) - (format #t "~2Ttask-gold: ~D~%" (-> obj task-gold)) - (format #t "~2Ttask-silver: ~D~%" (-> obj task-silver)) - (format #t "~2Ttask-bronze: ~D~%" (-> obj task-bronze)) - (format #t "~2Tgame-score: ~D~%" (-> obj game-score)) - (format #t "~2Ttraining?: ~A~%" (-> obj training?)) - (format #t "~2Ttraining-goal: ~f~%" (-> obj training-goal)) - (format #t "~2Tegg-count: ~D~%" (-> obj egg-count)) - (format #t "~2Tmedal: ~D~%" (-> obj medal)) - (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) - (format #t "~2Thint-time: ~D~%" (-> obj hint-time)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Ttrick-type: ~D~%" (-> this trick-type)) + (format #t "~2Tboard-picked-up: ~A~%" (-> this board-picked-up)) + (format #t "~2Tboost: ~A~%" (-> this boost)) + (format #t "~2Tgrind: ~A~%" (-> this grind)) + (format #t "~2Ttext: ~A~%" (-> this text)) + (format #t "~2Tscore: ~f~%" (-> this score)) + (format #t "~2Tchallenge-done: ~A~%" (-> this challenge-done)) + (format #t "~2Tarrow: ~D~%" (-> this arrow)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Thud-score: ~D~%" (-> this hud-score)) + (format #t "~2Thud-goal: ~D~%" (-> this hud-goal)) + (format #t "~2Tvoicebox: ~D~%" (-> this voicebox)) + (format #t "~2Tlast-sound-id: ~D~%" (-> this last-sound-id)) + (format #t "~2Tcombo-done?: ~A~%" (-> this combo-done?)) + (format #t "~2Ttask-gold: ~D~%" (-> this task-gold)) + (format #t "~2Ttask-silver: ~D~%" (-> this task-silver)) + (format #t "~2Ttask-bronze: ~D~%" (-> this task-bronze)) + (format #t "~2Tgame-score: ~D~%" (-> this game-score)) + (format #t "~2Ttraining?: ~A~%" (-> this training?)) + (format #t "~2Ttraining-goal: ~f~%" (-> this training-goal)) + (format #t "~2Tegg-count: ~D~%" (-> this egg-count)) + (format #t "~2Tmedal: ~D~%" (-> this medal)) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) + (format #t "~2Thint-time: ~D~%" (-> this hint-time)) (label cfg-7) - obj + this ) ;; definition for method 28 of type hoverboard-training-manager -(defmethod render-text hoverboard-training-manager ((obj hoverboard-training-manager) (arg0 text-id)) - (when (= (get-status *gui-control* (-> obj gui-id)) (gui-status active)) +(defmethod render-text hoverboard-training-manager ((this hoverboard-training-manager) (arg0 text-id)) + (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) (let ((s5-1 (new 'stack 'font-context *font-default-matrix* 32 280 0.0 (font-color default) (font-flags shadow kerning)) ) @@ -387,7 +387,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) ) ) @@ -428,7 +428,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) ) ) @@ -502,7 +502,7 @@ (suspend) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -568,7 +568,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) ) ) @@ -609,7 +609,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) ) ) @@ -647,7 +647,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) ) ) @@ -714,12 +714,12 @@ ;; definition for method 29 of type hoverboard-training-manager ;; WARN: Return type mismatch int vs none. -(defmethod hoverboard-training-manager-method-29 hoverboard-training-manager ((obj hoverboard-training-manager)) - (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> obj game-score)))) - (gp-0 (handle->process (-> obj hud-goal))) +(defmethod hoverboard-training-manager-method-29 hoverboard-training-manager ((this hoverboard-training-manager)) + (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> this game-score)))) + (gp-0 (handle->process (-> this hud-goal))) ) (cond - ((-> obj training?) + ((-> this training?) (cond ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) @@ -751,7 +751,7 @@ (s5-3 gp-3 s4-3 *temp-string*) ) ) - ((>= (-> *game-info* score) (-> obj training-goal)) + ((>= (-> *game-info* score) (-> this training-goal)) (set! (-> *game-info* goal) (-> s5-0 2)) (let ((s5-4 format) (gp-4 (the-as hud-goal (clear (-> (the-as hud-goal gp-0) strings 1 text)))) @@ -762,7 +762,7 @@ ) ) (else - (set! (-> *game-info* goal) (-> obj training-goal)) + (set! (-> *game-info* goal) (-> this training-goal)) (let ((s5-5 format) (gp-5 (the-as hud-goal (clear (-> (the-as hud-goal gp-0) strings 1 text)))) (s4-5 "~S") @@ -773,7 +773,7 @@ ) ) ) - ((task-node-open? (the-as game-task-node (-> obj task-bronze))) + ((task-node-open? (the-as game-task-node (-> this task-bronze))) (cond ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) @@ -817,7 +817,7 @@ ) ) ) - ((task-node-open? (the-as game-task-node (-> obj task-silver))) + ((task-node-open? (the-as game-task-node (-> this task-silver))) (cond ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) @@ -851,8 +851,8 @@ ) ) ) - ((or (task-node-open? (the-as game-task-node (-> obj task-gold))) - (task-node-closed? (the-as game-task-node (-> obj task-gold))) + ((or (task-node-open? (the-as game-task-node (-> this task-gold))) + (task-node-closed? (the-as game-task-node (-> this task-gold))) ) (cond ((>= (-> *game-info* score) (-> s5-0 0)) @@ -885,37 +885,37 @@ ;; definition for method 30 of type hoverboard-training-manager ;; WARN: Return type mismatch int vs none. -(defmethod hoverboard-training-manager-method-30 hoverboard-training-manager ((obj hoverboard-training-manager)) - (set! (-> obj egg-count) 0) - (set! (-> obj medal) 0) - (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> obj game-score))))) - (when (or (-> obj training?) (task-node-open? (the-as game-task-node (-> obj task-bronze)))) +(defmethod hoverboard-training-manager-method-30 hoverboard-training-manager ((this hoverboard-training-manager)) + (set! (-> this egg-count) 0) + (set! (-> this medal) 0) + (let ((s5-0 (get-game-score-ref *game-info* (the-as int (-> this game-score))))) + (when (or (-> this training?) (task-node-open? (the-as game-task-node (-> this task-bronze)))) (when (>= (-> *game-info* score) (-> s5-0 2)) - (task-node-close! (the-as game-task-node (-> obj task-bronze))) + (task-node-close! (the-as game-task-node (-> this task-bronze))) (logior! (-> *game-info* features) (game-feature board)) - (+! (-> obj egg-count) 1) - (set! (-> obj medal) 2) + (+! (-> this egg-count) 1) + (set! (-> this medal) 2) ) ) - (when (task-node-open? (the-as game-task-node (-> obj task-silver))) + (when (task-node-open? (the-as game-task-node (-> this task-silver))) (when (>= (-> *game-info* score) (-> s5-0 1)) - (task-node-close! (the-as game-task-node (-> obj task-silver))) + (task-node-close! (the-as game-task-node (-> this task-silver))) (logior! (-> *game-info* features) (game-feature board)) - (+! (-> obj egg-count) 1) - (set! (-> obj medal) 1) + (+! (-> this egg-count) 1) + (set! (-> this medal) 1) ) ) - (when (task-node-open? (the-as game-task-node (-> obj task-gold))) + (when (task-node-open? (the-as game-task-node (-> this task-gold))) (when (>= (-> *game-info* score) (-> s5-0 0)) - (task-node-close! (the-as game-task-node (-> obj task-gold))) + (task-node-close! (the-as game-task-node (-> this task-gold))) (logior! (-> *game-info* features) (game-feature board)) - (+! (-> obj egg-count) 1) - (set! (-> obj medal) 0) + (+! (-> this egg-count) 1) + (set! (-> this medal) 0) 0 ) ) ) - (game-info-method-28 *game-info* (the-as game-score (-> obj game-score)) (-> obj score)) + (game-info-method-28 *game-info* (the-as game-score (-> this game-score)) (-> this score)) 0 (none) ) @@ -998,11 +998,11 @@ (hoverboard-training-manager-method-29 self) (when (not (-> self challenge-done)) (when (and (not (-> self combo-done?)) - (>= (- (current-time) (-> self hint-time)) (seconds 30)) + (time-elapsed? (-> self hint-time) (seconds 30)) (not (task-node-closed? (game-task-node stadium-board1-resolution))) ) (add-process *gui-control* self (gui-channel sig) (gui-action play) "kei018" -99.0 0) - (set! (-> self hint-time) (current-time)) + (set-time! (-> self hint-time)) ) ) ) @@ -1082,7 +1082,7 @@ (set! (-> self score) 0.0) (set! (-> self challenge-done) #f) (set! (-> self combo-done?) #f) - (set! (-> self hint-time) (current-time)) + (set-time! (-> self hint-time)) (while (and (not (-> self challenge-done)) (logtest? (-> *game-info* features) (game-feature board))) (suspend) ) @@ -1134,7 +1134,7 @@ ) ) (let ((s5-2 (current-time))) - (until (>= (- (current-time) s5-2) (seconds 1)) + (until (time-elapsed? s5-2 (seconds 1)) (suspend) ) ) @@ -1340,7 +1340,7 @@ ) ) (let ((s5-2 (current-time))) - (until (>= (- (current-time) s5-2) (seconds 1)) + (until (time-elapsed? s5-2 (seconds 1)) (suspend) ) ) @@ -1360,16 +1360,16 @@ ) ;; definition for method 10 of type hoverboard-training-manager -(defmethod deactivate hoverboard-training-manager ((obj 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)) obj) + ((the-as (function process none) (find-parent-method hoverboard-training-manager 10)) this) (none) ) ;; definition for method 11 of type hoverboard-training-manager ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! hoverboard-training-manager ((obj hoverboard-training-manager) (arg0 entity-actor)) +(defmethod init-from-entity! hoverboard-training-manager ((this hoverboard-training-manager) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1378,30 +1378,30 @@ This commonly includes things such as: - sounds" (local-vars (sv-16 res-tag)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-1 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-1 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-1)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-1)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) (go process-drawable-art-error "actor-group training-manager") ) ) ) - (set! (-> obj boost) #f) - (set! (-> obj grind) #f) - (set! (-> obj text) #t) - (set! (-> obj combo-done?) #f) - (set! (-> obj hud-score) (the-as handle #f)) - (set! (-> obj hud-goal) (the-as handle #f)) - (set! (-> obj voicebox) (the-as handle #f)) - (set! (-> obj arrow) (the-as handle #f)) - (set! (-> obj gui-id) (new 'static 'sound-id)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel message) (gui-action play) (-> obj name) 81920.0 0) + (set! (-> this boost) #f) + (set! (-> this grind) #f) + (set! (-> this text) #t) + (set! (-> this combo-done?) #f) + (set! (-> this hud-score) (the-as handle #f)) + (set! (-> this hud-goal) (the-as handle #f)) + (set! (-> this voicebox) (the-as handle #f)) + (set! (-> this arrow) (the-as handle #f)) + (set! (-> this gui-id) (new 'static 'sound-id)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel message) (gui-action play) (-> this name) 81920.0 0) ) (let ((s5-0 *traffic-manager*)) (send-event s5-0 'set-object-target-count (traffic-type bikea) 0) @@ -1425,22 +1425,22 @@ This commonly includes things such as: (set-setting! 'allow-continue #f 0.0 0) (cond ((task-node-closed? (game-task-node forest-scouts-get-board)) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((task-node-closed? (game-task-node stadium-board1-resolution)) - (go (method-of-object obj wait-for-pickup-training)) + (go (method-of-object this wait-for-pickup-training)) ) ((task-node-open? (game-task-node stadium-board1-training)) - (go (method-of-object obj jump)) + (go (method-of-object this jump)) ) ((task-node-open? (game-task-node stadium-board1-training-judge)) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((task-node-closed? (game-task-node stadium-board1-training-judge)) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) (else - (go (method-of-object obj wait-for-board)) + (go (method-of-object this wait-for-board)) ) ) (none) @@ -1461,17 +1461,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type skate-training-ramp -(defmethod inspect skate-training-ramp ((obj skate-training-ramp)) - (when (not obj) - (set! obj obj) +(defmethod inspect skate-training-ramp ((this skate-training-ramp)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tonoff: ~A~%" (-> obj onoff)) + (format #t "~2Tonoff: ~A~%" (-> this onoff)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1498,7 +1498,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (until #f @@ -1516,8 +1516,8 @@ This commonly includes things such as: ) ;; definition for method 28 of type skate-training-ramp -(defmethod skate-training-ramp-method-28 skate-training-ramp ((obj skate-training-ramp)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod skate-training-ramp-method-28 skate-training-ramp ((this skate-training-ramp)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1552,40 +1552,40 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) ;; definition for method 11 of type skate-training-ramp ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skate-training-ramp ((obj skate-training-ramp) (arg0 entity-actor)) +(defmethod init-from-entity! skate-training-ramp ((this skate-training-ramp) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (skate-training-ramp-method-28 obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (skate-training-ramp-method-28 this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-skate-training-ramp" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (set! (-> obj onoff) #f) + (set! (-> this onoff) #f) (ja-channel-push! 1 0) - (let ((a0-7 (-> obj skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1605,17 +1605,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type skate-gate -(defmethod inspect skate-gate ((obj skate-gate)) - (when (not obj) - (set! obj obj) +(defmethod inspect skate-gate ((this skate-gate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tonoff: ~A~%" (-> obj onoff)) + (format #t "~2Tonoff: ~A~%" (-> this onoff)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1644,7 +1644,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (until #f @@ -1672,8 +1672,8 @@ This commonly includes things such as: ) ;; definition for method 29 of type skate-gate -(defmethod skate-gate-method-29 skate-gate ((obj skate-gate)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod skate-gate-method-29 skate-gate ((this skate-gate)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1694,29 +1694,29 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) s5-0 ) ) ;; definition for method 11 of type skate-gate ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skate-gate ((obj skate-gate) (arg0 entity-actor)) +(defmethod init-from-entity! skate-gate ((this skate-gate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (skate-gate-method-29 obj) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (skate-gate-method-29 this) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-skate-gate" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj onoff) #f) + (set! (-> this onoff) #f) (send-event *target* 'reset-pickup 'trick-judge) (send-event *target* 'reset-pickup 'trick-point) (ja-channel-push! 1 0) @@ -1724,22 +1724,22 @@ This commonly includes things such as: ((and (not (task-node-open? (game-task-node stadium-board1-training-judge))) (logtest? (-> *game-info* features) (game-feature board)) ) - (let ((a0-15 (-> obj skel root-channel 0))) - (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-15 frame-num) 1.0) - (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj open)) + (go (method-of-object this open)) ) (else - (let ((a0-16 (-> obj skel root-channel 0))) - (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-16 (-> this skel root-channel 0))) + (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-16 frame-num) 0.0) - (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1761,23 +1761,23 @@ This commonly includes things such as: ) ;; definition for method 3 of type skatea-jump-pad -(defmethod inspect skatea-jump-pad ((obj skatea-jump-pad)) - (when (not obj) - (set! obj obj) +(defmethod inspect skatea-jump-pad ((this skatea-jump-pad)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bouncer inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 23 of type skatea-jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod init-skeleton! skatea-jump-pad ((obj skatea-jump-pad)) +(defmethod init-skeleton! skatea-jump-pad ((this skatea-jump-pad)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-skatea-jump-pad" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1787,9 +1787,9 @@ This commonly includes things such as: ;; definition for method 24 of type skatea-jump-pad ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 skatea-jump-pad ((obj skatea-jump-pad)) +(defmethod bouncer-method-24 skatea-jump-pad ((this skatea-jump-pad)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) @@ -1817,7 +1817,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1895,18 +1895,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type skatea-floating-ring -(defmethod inspect skatea-floating-ring ((obj skatea-floating-ring)) - (when (not obj) - (set! obj obj) +(defmethod inspect skatea-floating-ring ((this skatea-floating-ring)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpos-y: ~f~%" (-> obj pos-y)) - (format #t "~2Toffset: ~f~%" (-> obj offset)) + (format #t "~2Tpos-y: ~f~%" (-> this pos-y)) + (format #t "~2Toffset: ~f~%" (-> this offset)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1959,8 +1959,8 @@ This commonly includes things such as: ;; definition for method 28 of type skatea-floating-ring ;; WARN: Return type mismatch int vs none. -(defmethod skatea-floating-ring-method-28 skatea-floating-ring ((obj skatea-floating-ring)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod skatea-floating-ring-method-28 skatea-floating-ring ((this skatea-floating-ring)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1980,7 +1980,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1988,30 +1988,30 @@ This commonly includes things such as: ;; definition for method 11 of type skatea-floating-ring ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! skatea-floating-ring ((obj skatea-floating-ring) (arg0 entity-actor)) +(defmethod init-from-entity! skatea-floating-ring ((this skatea-floating-ring) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (skatea-floating-ring-method-28 obj) - (process-drawable-from-entity! obj arg0) + (skatea-floating-ring-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-skatea-floating-ring" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj pos-y) (-> obj root trans y)) - (set! (-> obj offset) (rand-vu)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 539) obj)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "fire-ring" :fo-min 10 :fo-max 30) (-> obj root trans)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this pos-y) (-> this root trans y)) + (set! (-> this offset) (rand-vu)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 539) this)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "fire-ring" :fo-min 10 :fo-max 30) (-> this root trans)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/skate/skatea-part_REF.gc b/test/decompiler/reference/jak2/levels/stadium/skate/skatea-part_REF.gc index f15157375a..df511da48e 100644 --- a/test/decompiler/reference/jak2/levels/stadium/skate/skatea-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/skate/skatea-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type skatea-part -(defmethod inspect skatea-part ((obj skatea-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect skatea-part ((this skatea-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 1713fa5026..1ba01d0110 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-obs_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type water-anim-stadium -(defmethod inspect water-anim-stadium ((obj water-anim-stadium)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-anim-stadium ((this water-anim-stadium)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol ripple-for-water-anim-stadium, type ripple-wave-set @@ -39,14 +39,14 @@ ;; definition for method 24 of type water-anim-stadium ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-stadium ((obj water-anim-stadium)) +(defmethod init-water! water-anim-stadium ((this water-anim-stadium)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) @@ -68,16 +68,16 @@ ) ;; definition for method 3 of type dummy-vehicle -(defmethod inspect dummy-vehicle ((obj dummy-vehicle)) - (when (not obj) - (set! obj obj) +(defmethod inspect dummy-vehicle ((this dummy-vehicle)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -94,14 +94,14 @@ ;; definition for method 11 of type dummy-vehicle ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! dummy-vehicle ((obj dummy-vehicle) (arg0 entity-actor)) +(defmethod init-from-entity! dummy-vehicle ((this dummy-vehicle) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -122,22 +122,22 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (let ((s5-1 (res-lump-struct (-> obj entity) 'art-name structure))) + (process-drawable-from-entity! this arg0) + (let ((s5-1 (res-lump-struct (-> this entity) 'art-name structure))) (when (not s5-1) - (format 0 "ERROR: dummy-vehicle::initialize: no art-name set for ~s~%" obj) + (format 0 "ERROR: dummy-vehicle::initialize: no art-name set for ~s~%" this) (go process-drawable-art-error "no art-name set") ) - (when (not (art-group-get-by-name *level* (the-as string s5-1) (the-as (pointer uint32) (&-> obj level)))) + (when (not (art-group-get-by-name *level* (the-as string s5-1) (the-as (pointer uint32) (&-> this level)))) (format 0 "ERROR: dummy-vehicle::initialize: no art named ~s found in any currently loaded level~%" s5-1) (go process-drawable-art-error "no named art found in any currently loaded level") ) - (format #t "dummy-vehicle::initialize: setup art ~s from level ~s~%" s5-1 (-> obj level name)) - (initialize-skeleton-by-name obj (the-as string s5-1)) + (format #t "dummy-vehicle::initialize: setup art ~s from level ~s~%" s5-1 (-> this level name)) + (initialize-skeleton-by-name this (the-as string s5-1)) ) - (when (name= (-> obj name) "dummy-vehicle-6") + (when (name= (-> this name) "dummy-vehicle-6") (let ((v1-25 (new 'process 'shadow-control @@ -152,11 +152,11 @@ This commonly includes things such as: (set-vector! (-> v1-25 settings shadow-dir) 0.9128 -0.1825 -0.3651 -98304.0) (set-vector! (-> v1-25 settings top-plane) -0.9128 0.1825 0.3651 958464.0) (set-vector! (-> v1-25 settings bot-plane) -0.9128 0.1825 0.3651 970752.0) - (set! (-> obj draw shadow-ctrl) v1-25) + (set! (-> this draw shadow-ctrl) v1-25) ) ) - (set! (-> obj draw light-index) (the-as uint 17)) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 17)) + (go (method-of-object this idle)) (none) ) @@ -194,16 +194,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type gar-curtain -(defmethod inspect gar-curtain ((obj gar-curtain)) - (when (not obj) - (set! obj obj) +(defmethod inspect gar-curtain ((this gar-curtain)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -225,7 +225,7 @@ This commonly includes things such as: ;; definition for method 11 of type gar-curtain ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gar-curtain ((obj gar-curtain) (arg0 entity-actor)) +(defmethod init-from-entity! gar-curtain ((this gar-curtain) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -233,7 +233,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 collide-shape-prim-mesh) (sv-32 symbol) (sv-48 type) (sv-64 collide-shape)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 8) 0))) (set! (-> s4-0 total-prims) (the-as uint 9)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) @@ -279,16 +279,16 @@ This commonly includes things such as: (+! (-> (the-as collide-shape-prim-group v1-24) child a0-10 local-sphere y) -14336.0) ) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gar-curtain" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-vector-angle! (-> obj root quat) *y-vector* 5461.3335) - (go (method-of-object obj idle)) + (quaternion-vector-angle! (-> this root quat) *y-vector* 5461.3335) + (go (method-of-object this idle)) (none) ) @@ -324,28 +324,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type rift-rider -(defmethod inspect rift-rider ((obj rift-rider)) - (when (not obj) - (set! obj obj) +(defmethod inspect rift-rider ((this rift-rider)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type rigid-body-object inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tescort-actor[2] @ #x~X~%" (-> obj escort-actor)) - (format #t "~2Tescort-force[2] @ #x~X~%" (-> obj escort-force)) - (format #t "~2Tbrutter-balloon-actor: ~A~%" (-> obj brutter-balloon-actor)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tdest-pos: #~%" (-> obj dest-pos)) - (format #t "~2Tspeed: ~f~%" (-> obj speed)) - (format #t "~2Theight: ~f~%" (-> obj height)) - (format #t "~2Tinit-height: ~f~%" (-> obj init-height)) - (format #t "~2Tbattle-entity-triggered: ~D~%" (-> obj battle-entity-triggered)) - (format #t "~2Tbattle-info-index: ~D~%" (-> obj battle-info-index)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Thover-volume: ~f~%" (-> obj hover-volume)) + (format #t "~2Tescort-actor[2] @ #x~X~%" (-> this escort-actor)) + (format #t "~2Tescort-force[2] @ #x~X~%" (-> this escort-force)) + (format #t "~2Tbrutter-balloon-actor: ~A~%" (-> this brutter-balloon-actor)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tdest-pos: #~%" (-> this dest-pos)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Theight: ~f~%" (-> this height)) + (format #t "~2Tinit-height: ~f~%" (-> this init-height)) + (format #t "~2Tbattle-entity-triggered: ~D~%" (-> this battle-entity-triggered)) + (format #t "~2Tbattle-info-index: ~D~%" (-> this battle-info-index)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Thover-volume: ~f~%" (-> this hover-volume)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -400,16 +400,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type rift-rider-battle-info -(defmethod inspect rift-rider-battle-info ((obj rift-rider-battle-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect rift-rider-battle-info ((this rift-rider-battle-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'rift-rider-battle-info) - (format #t "~1Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~1Tentity-index: ~D~%" (-> obj entity-index)) + (format #t "[~8x] ~A~%" this 'rift-rider-battle-info) + (format #t "~1Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~1Tentity-index: ~D~%" (-> this entity-index)) (label cfg-4) - obj + this ) ;; definition for symbol *rift-rider-battle-table*, type (array rift-rider-battle-info) @@ -660,18 +660,18 @@ This commonly includes things such as: ;; definition for method 29 of type rift-rider ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-object-method-29 rift-rider ((obj rift-rider) (arg0 float)) +(defmethod rigid-body-object-method-29 rift-rider ((this rift-rider) (arg0 float)) (let ((s5-0 (new 'stack-no-clear 'vector)) (gp-0 (new 'stack-no-clear 'vector)) ) - (let ((f30-0 (* (-> obj rbody state info mass) (-> obj info extra gravity)))) - (let ((a1-2 (quaternion-conjugate! (new 'stack-no-clear 'quaternion) (-> obj root quat)))) + (let ((f30-0 (* (-> this rbody state info mass) (-> this info extra gravity)))) + (let ((a1-2 (quaternion-conjugate! (new 'stack-no-clear 'quaternion) (-> this root quat)))) (vector-z-quaternion! (new 'stack-no-clear 'vector) a1-2) ) - (let ((f28-0 (fmax 0.0 (fmin 1.0 (* 0.000020345053 (- (-> obj dest-pos y) (-> obj root trans y))))))) + (let ((f28-0 (fmax 0.0 (fmin 1.0 (* 0.000020345053 (- (-> this dest-pos y) (-> this root trans y))))))) (vector-reset! s5-0) (set! (-> s5-0 y) (* -1.0 f30-0)) - (let ((v1-10 (-> obj rbody)) + (let ((v1-10 (-> this rbody)) (a1-3 s5-0) ) (rigid-body-method-20 (-> v1-10 state) a1-3) @@ -679,58 +679,58 @@ This commonly includes things such as: (vector-normalize-copy! s5-0 *y-vector* - (fmin 20480.0 (* 1.5 f30-0 f28-0 (fmax 0.2 (* (-> obj escort-force 0 y) (-> obj escort-force 1 y))))) + (fmin 20480.0 (* 1.5 f30-0 f28-0 (fmax 0.2 (* (-> this escort-force 0 y) (-> this escort-force 1 y))))) ) - (set! (-> gp-0 quad) (-> obj root trans quad)) - (let ((v1-17 (-> obj rbody)) + (set! (-> gp-0 quad) (-> this root trans quad)) + (let ((v1-17 (-> this rbody)) (a1-5 gp-0) (a2-1 s5-0) ) (rigid-body-method-18 (-> v1-17 state) a1-5 a2-1) ) (vector-reset! s5-0) - (vector-! s5-0 (-> obj dest-pos) (-> obj root trans)) + (vector-! s5-0 (-> this dest-pos) (-> this root trans)) (vector-float*! s5-0 s5-0 8.0) (set! (-> s5-0 y) 0.0) - (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 0) (-> obj root quat)) - (vector+! gp-0 gp-0 (-> obj root trans)) - (let ((v1-27 (-> obj rbody)) + (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 0) (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (let ((v1-27 (-> this rbody)) (a1-12 gp-0) (a2-3 s5-0) ) (rigid-body-method-18 (-> v1-27 state) a1-12 a2-3) ) - (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> obj escort-force 0 y))) - (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 1) (-> obj root quat)) - (vector+! gp-0 gp-0 (-> obj root trans)) - (let ((v1-34 (-> obj rbody)) + (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> this escort-force 0 y))) + (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 1) (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (let ((v1-34 (-> this rbody)) (a1-17 gp-0) (a2-6 s5-0) ) (rigid-body-method-18 (-> v1-34 state) a1-17 a2-6) ) - (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 2) (-> obj root quat)) - (vector+! gp-0 gp-0 (-> obj root trans)) - (let ((v1-40 (-> obj rbody)) + (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 2) (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (let ((v1-40 (-> this rbody)) (a1-21 gp-0) (a2-8 s5-0) ) (rigid-body-method-18 (-> v1-40 state) a1-21 a2-8) ) - (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> obj escort-force 1 y))) + (vector-normalize-copy! s5-0 *y-vector* (* 0.5 f30-0 f28-0 (-> this escort-force 1 y))) ) ) - (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 3) (-> obj root quat)) - (vector+! gp-0 gp-0 (-> obj root trans)) - (let ((v1-47 (-> obj rbody)) + (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 3) (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (let ((v1-47 (-> this rbody)) (a1-26 gp-0) (a2-11 s5-0) ) (rigid-body-method-18 (-> v1-47 state) a1-26 a2-11) ) - (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 4) (-> obj root quat)) - (vector+! gp-0 gp-0 (-> obj root trans)) - (rigid-body-method-18 (-> obj rbody state) gp-0 s5-0) + (vector-orient-by-quat! gp-0 (-> *rift-rider-force-points* 4) (-> this root quat)) + (vector+! gp-0 gp-0 (-> this root trans)) + (rigid-body-method-18 (-> this rbody state) gp-0 s5-0) ) 0 (none) @@ -966,7 +966,7 @@ This commonly includes things such as: :virtual #t :event defend-stadium-rift-rider-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (if (< (-> self height) (-> self init-height)) @@ -975,7 +975,7 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1.2)) + (until (time-elapsed? gp-0 (seconds 1.2)) (suspend) ) ) @@ -1041,25 +1041,25 @@ This commonly includes things such as: ) ;; definition for method 45 of type rift-rider -(defmethod rigid-body-object-method-45 rift-rider ((obj rift-rider) (arg0 rigid-body-impact)) +(defmethod rigid-body-object-method-45 rift-rider ((this rift-rider) (arg0 rigid-body-impact)) (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)) obj arg0) + ((the-as (function rigid-body-object rigid-body-impact none) (find-parent-method rift-rider 45)) this arg0) (none) ) ;; definition for method 34 of type rift-rider ;; WARN: Return type mismatch object vs none. -(defmethod rigid-body-object-method-34 rift-rider ((obj rift-rider)) +(defmethod rigid-body-object-method-34 rift-rider ((this rift-rider)) (cond - ((nonzero? (-> obj path)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 902) obj)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + ((nonzero? (-> this path)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 902) this)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (go defend-stadium-wait) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -1067,8 +1067,8 @@ This commonly includes things such as: ;; definition for method 32 of type rift-rider ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape rift-rider ((obj rift-rider)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) +(defmethod allocate-and-init-cshape rift-rider ((this rift-rider)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1107,54 +1107,54 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 10 of type rift-rider -(defmethod deactivate rift-rider ((obj rift-rider)) - (sound-stop (-> obj sound-id)) - ((the-as (function rigid-body-object none) (find-parent-method rift-rider 10)) obj) +(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) (none) ) ;; definition for method 33 of type rift-rider ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body rift-rider ((obj rift-rider)) +(defmethod init-skel-and-rigid-body rift-rider ((this rift-rider)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-rift-rider-no-lift" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *rift-rider-physics-constants*) - (rigid-body-object-method-38 obj) - (rigid-body-object-method-40 obj) - (logior! (-> obj rbody state flags) (rigid-body-flag enable-collision)) - (logior! (-> obj rbody state flags) (rigid-body-flag display-marks)) - (set! (-> obj draw shadow-ctrl) + (alloc-and-init-rigid-body-control this *rift-rider-physics-constants*) + (rigid-body-object-method-38 this) + (rigid-body-object-method-40 this) + (logior! (-> this rbody state flags) (rigid-body-flag enable-collision)) + (logior! (-> this rbody state flags) (rigid-body-flag display-marks)) + (set! (-> this draw shadow-ctrl) (new 'process 'shadow-control 0.0 0.0 614400.0 (shadow-flags shdf02 shdf03 shdf04 disable-draw) 245760.0) ) - (quad-copy! (the-as pointer (-> obj draw shadow-ctrl settings)) (the-as pointer *default-shadow-settings*) 5) - (set! (-> obj root dynam gravity y) 81920.0) - (set! (-> obj root dynam gravity-length) 81920.0) - (set! (-> obj root dynam gravity-max) 81920.0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #t)) - (set! (-> obj height) 0.0) - (set! (-> obj init-height) (-> obj root trans y)) - (set! (-> obj escort-actor 0) #f) - (set! (-> obj escort-actor 1) #f) - (set! (-> obj brutter-balloon-actor) #f) - (set! (-> obj battle-entity-triggered) 0) - (set! (-> obj battle-info-index) 0) - (set! (-> obj sound-id) (new-sound-id)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (let ((a0-13 (-> obj skel root-channel 0))) - (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (quad-copy! (the-as pointer (-> this draw shadow-ctrl settings)) (the-as pointer *default-shadow-settings*) 5) + (set! (-> this root dynam gravity y) 81920.0) + (set! (-> this root dynam gravity-length) 81920.0) + (set! (-> this root dynam gravity-max) 81920.0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #t)) + (set! (-> this height) 0.0) + (set! (-> this init-height) (-> this root trans y)) + (set! (-> this escort-actor 0) #f) + (set! (-> this escort-actor 1) #f) + (set! (-> this brutter-balloon-actor) #f) + (set! (-> this battle-entity-triggered) 0) + (set! (-> this battle-info-index) 0) + (set! (-> this sound-id) (new-sound-id)) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (let ((a0-13 (-> this skel root-channel 0))) + (set! (-> a0-13 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-13 frame-num) 0.0) - (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-identity) + (joint-control-channel-group! a0-13 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-identity) ) (transform-post) (none) @@ -1173,16 +1173,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type spotlight -(defmethod inspect spotlight ((obj spotlight)) - (when (not obj) - (set! obj obj) +(defmethod inspect spotlight ((this spotlight)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1203,21 +1203,21 @@ This commonly includes things such as: ;; definition for method 11 of type spotlight ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! spotlight ((obj spotlight) (arg0 entity-actor)) +(defmethod init-from-entity! spotlight ((this spotlight) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-spotlight" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1238,28 +1238,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type gar-door -(defmethod inspect gar-door ((obj gar-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect gar-door ((this gar-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type gar-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! gar-door ((obj gar-door) (arg0 entity-actor)) +(defmethod init-from-entity! gar-door ((this gar-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1288,16 +1288,16 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-gar-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj door-radius) 40960.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this door-radius) 40960.0) + (go (method-of-object this close) #t) (none) ) @@ -1471,52 +1471,52 @@ This commonly includes things such as: ) ;; definition for method 3 of type stad-samos -(defmethod inspect stad-samos ((obj stad-samos)) - (when (not obj) - (set! obj obj) +(defmethod inspect stad-samos ((this stad-samos)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trift-rider-actor: ~A~%" (-> obj rift-rider-actor)) - (format #t "~2Tlightning[4] @ #x~X~%" (-> obj lightning)) - (format #t "~2Tspeed: ~f~%" (-> obj speed)) - (format #t "~2Tobserved-speed: ~f~%" (-> obj observed-speed)) - (format #t "~2Tcquery-timer: ~D~%" (-> obj cquery-timer)) - (format #t "~2Thit-dir: #~%" (-> obj hit-dir)) - (format #t "~2Thit-points: ~f~%" (-> obj hit-points)) - (format #t "~2Tmax-hit-points: ~f~%" (-> obj max-hit-points)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tfalling?: ~A~%" (-> obj falling?)) - (format #t "~2Tlightning-on?: ~A~%" (-> obj lightning-on?)) - (format #t "~2Tenable-move?: ~A~%" (-> obj enable-move?)) - (format #t "~2Tfocus-disable-timer: ~D~%" (-> obj focus-disable-timer)) - (format #t "~2Tstand-anim: ~D~%" (-> obj stand-anim)) - (format #t "~2Twalk-anim: ~D~%" (-> obj walk-anim)) - (format #t "~2Traise-ship-anim: ~D~%" (-> obj raise-ship-anim)) - (format #t "~2Tknocked-back-anim: ~D~%" (-> obj knocked-back-anim)) - (format #t "~2Tknocked-back-land-anim: ~D~%" (-> obj knocked-back-land-anim)) - (format #t "~2Tknocked-forward-anim: ~D~%" (-> obj knocked-forward-anim)) - (format #t "~2Tknocked-forward-land-anim: ~D~%" (-> obj knocked-forward-land-anim)) - (format #t "~2Tdeath-anim: ~D~%" (-> obj death-anim)) - (format #t "~2Tdeath-end-anim: ~D~%" (-> obj death-end-anim)) - (format #t "~2Tknocked-anim: ~D~%" (-> obj knocked-anim)) - (format #t "~2Tknocked-land-anim: ~D~%" (-> obj knocked-land-anim)) - (format #t "~2Thud: ~D~%" (-> obj hud)) - (format #t "~2Thud-bot-index: ~D~%" (-> obj hud-bot-index)) - (format #t "~2Trift-rider-joint-offset: ~D~%" (-> obj rift-rider-joint-offset)) - (format #t "~2Thand-joint: ~D~%" (-> obj hand-joint)) + (format #t "~2Trift-rider-actor: ~A~%" (-> this rift-rider-actor)) + (format #t "~2Tlightning[4] @ #x~X~%" (-> this lightning)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Tobserved-speed: ~f~%" (-> this observed-speed)) + (format #t "~2Tcquery-timer: ~D~%" (-> this cquery-timer)) + (format #t "~2Thit-dir: #~%" (-> this hit-dir)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tmax-hit-points: ~f~%" (-> this max-hit-points)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tfalling?: ~A~%" (-> this falling?)) + (format #t "~2Tlightning-on?: ~A~%" (-> this lightning-on?)) + (format #t "~2Tenable-move?: ~A~%" (-> this enable-move?)) + (format #t "~2Tfocus-disable-timer: ~D~%" (-> this focus-disable-timer)) + (format #t "~2Tstand-anim: ~D~%" (-> this stand-anim)) + (format #t "~2Twalk-anim: ~D~%" (-> this walk-anim)) + (format #t "~2Traise-ship-anim: ~D~%" (-> this raise-ship-anim)) + (format #t "~2Tknocked-back-anim: ~D~%" (-> this knocked-back-anim)) + (format #t "~2Tknocked-back-land-anim: ~D~%" (-> this knocked-back-land-anim)) + (format #t "~2Tknocked-forward-anim: ~D~%" (-> this knocked-forward-anim)) + (format #t "~2Tknocked-forward-land-anim: ~D~%" (-> this knocked-forward-land-anim)) + (format #t "~2Tdeath-anim: ~D~%" (-> this death-anim)) + (format #t "~2Tdeath-end-anim: ~D~%" (-> this death-end-anim)) + (format #t "~2Tknocked-anim: ~D~%" (-> this knocked-anim)) + (format #t "~2Tknocked-land-anim: ~D~%" (-> this knocked-land-anim)) + (format #t "~2Thud: ~D~%" (-> this hud)) + (format #t "~2Thud-bot-index: ~D~%" (-> this hud-bot-index)) + (format #t "~2Trift-rider-joint-offset: ~D~%" (-> this rift-rider-joint-offset)) + (format #t "~2Thand-joint: ~D~%" (-> this hand-joint)) (label cfg-4) - obj + this ) ;; definition for function stad-samos-post ;; WARN: Return type mismatch int vs none. (defbehavior stad-samos-post stad-samos () - (when (>= (- (current-time) (-> self cquery-timer)) (seconds 0.32)) + (when (time-elapsed? (-> self cquery-timer) (seconds 0.32)) (move-to-ground (-> self root) 40960.0 40960.0 #t (collide-spec backgnd)) - (set! (-> self cquery-timer) (current-time)) + (set-time! (-> self cquery-timer)) ) (when (and (nonzero? (-> self focus-disable-timer)) (< (-> self focus-disable-timer) (current-time))) (logclear! (-> self focus-status) (focus-status ignore)) @@ -1667,7 +1667,7 @@ This commonly includes things such as: ) (set! (-> self rift-rider-actor) (entity-actor-lookup (-> self entity) 'alt-actor 0)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.31)) + (until (time-elapsed? gp-0 (seconds 0.31)) (suspend) ) ) @@ -1725,10 +1725,10 @@ This commonly includes things such as: (set! (-> self enable-move?) #t) (set! (-> self speed) 12288.0) (set! (-> self observed-speed) 0.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (and (nonzero? (-> self state-time)) (>= (- (current-time) (-> self state-time)) (seconds 1))) + (when (and (nonzero? (-> self state-time)) (time-elapsed? (-> self state-time) (seconds 1))) (set! (-> self state-time) 0) (let ((a1-0 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-0 from) (process->ppointer self)) @@ -1747,7 +1747,7 @@ This commonly includes things such as: ) (spawn-lightning self) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (go-virtual move-rift-rider) ) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) @@ -2096,7 +2096,7 @@ This commonly includes things such as: ) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 2)) + (until (time-elapsed? gp-1 (seconds 2)) (suspend) ) ) @@ -2107,14 +2107,14 @@ This commonly includes things such as: ) ;; definition for method 33 of type stad-samos -(defmethod get-position stad-samos ((obj stad-samos)) +(defmethod get-position stad-samos ((this stad-samos)) 'right ) ;; definition for method 34 of type stad-samos ;; WARN: Return type mismatch symbol vs none. -(defmethod spawn-lightning stad-samos ((obj stad-samos)) - (let* ((v1-0 (-> obj rift-rider-actor)) +(defmethod spawn-lightning stad-samos ((this stad-samos)) + (let* ((v1-0 (-> this rift-rider-actor)) (s5-0 (if v1-0 (-> v1-0 extra process) ) @@ -2122,7 +2122,7 @@ This commonly includes things such as: ) (when s5-0 (dotimes (s4-0 4) - (set! (-> obj lightning s4-0) + (set! (-> this lightning s4-0) (process->handle (ppointer->process (process-spawn lightning-tracker @@ -2131,15 +2131,15 @@ This commonly includes things such as: 0 #f s5-0 - (-> *stad-samos-lightning-joint-tbl* (+ s4-0 (-> obj rift-rider-joint-offset))) - (-> obj hand-joint) - :to obj + (-> *stad-samos-lightning-joint-tbl* (+ s4-0 (-> this rift-rider-joint-offset))) + (-> this hand-joint) + :to this ) ) ) ) ) - (set! (-> obj lightning-on?) #t) + (set! (-> this lightning-on?) #t) ) ) (none) @@ -2147,34 +2147,34 @@ This commonly includes things such as: ;; definition for method 35 of type stad-samos ;; WARN: Return type mismatch symbol vs none. -(defmethod kill-lightning stad-samos ((obj stad-samos)) +(defmethod kill-lightning stad-samos ((this stad-samos)) (dotimes (s5-0 4) - (send-event (handle->process (-> obj lightning s5-0)) 'die) + (send-event (handle->process (-> this lightning s5-0)) 'die) ) - (set! (-> obj lightning-on?) #f) + (set! (-> this lightning-on?) #f) (none) ) ;; definition for method 10 of type stad-samos -(defmethod deactivate stad-samos ((obj stad-samos)) - (if (valid? (-> obj hud) (the-as type #f) "" #t 0) - (send-event (handle->process (-> obj hud)) 'hide-and-die) +(defmethod deactivate stad-samos ((this stad-samos)) + (if (valid? (-> this hud) (the-as type #f) "" #t 0) + (send-event (handle->process (-> this hud)) 'hide-and-die) ) - (kill-lightning obj) - ((the-as (function process-focusable none) (find-parent-method stad-samos 10)) obj) + (kill-lightning this) + ((the-as (function process-focusable none) (find-parent-method stad-samos 10)) this) (none) ) ;; definition for method 11 of type stad-samos ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-samos ((obj stad-samos) (arg0 entity-actor)) +(defmethod init-from-entity! stad-samos ((this stad-samos) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-others)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -2221,35 +2221,35 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (set! (-> obj hud) (the-as handle #f)) - (set! (-> obj hud-bot-index) 0) - (set! (-> obj rift-rider-joint-offset) 0) - (process-drawable-from-entity! obj arg0) - (init! obj) - (get-nav-control obj (the-as nav-mesh #f)) - (let ((v1-24 (-> obj nav))) + (set! (-> this hud) (the-as handle #f)) + (set! (-> this hud-bot-index) 0) + (set! (-> this rift-rider-joint-offset) 0) + (process-drawable-from-entity! this arg0) + (init! this) + (get-nav-control this (the-as nav-mesh #f)) + (let ((v1-24 (-> this nav))) (set! (-> v1-24 sphere-mask) (the-as uint 1102)) ) 0 - (logclear! (-> obj mask) (process-mask actor-pause)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (set! (-> obj rift-rider-actor) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) - (set! (-> obj entity) arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (set! (-> this rift-rider-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this entity) arg0) (dotimes (v1-28 4) - (set! (-> obj lightning v1-28) (the-as handle #f)) + (set! (-> this lightning v1-28) (the-as handle #f)) ) - (set! (-> obj lightning-on?) #f) - (set! (-> obj rift-rider-actor) #f) - (set! (-> obj cquery-timer) (current-time)) - (vector-reset! (-> obj hit-dir)) - (set! (-> obj max-hit-points) (+ 5.0 (* 5.0 (you-suck-scale *game-info* #f)))) - (set! (-> obj hit-points) (-> obj max-hit-points)) - (set! (-> obj incoming-attack-id) (the-as uint -1)) - (set! (-> obj focus-disable-timer) 0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 903) obj)) - (go (method-of-object obj idle)) + (set! (-> this lightning-on?) #f) + (set! (-> this rift-rider-actor) #f) + (set-time! (-> this cquery-timer)) + (vector-reset! (-> this hit-dir)) + (set! (-> this max-hit-points) (+ 5.0 (* 5.0 (you-suck-scale *game-info* #f)))) + (set! (-> this hit-points) (-> this max-hit-points)) + (set! (-> this incoming-attack-id) (the-as uint -1)) + (set! (-> this focus-disable-timer) 0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 903) this)) + (go (method-of-object this idle)) (none) ) @@ -2262,25 +2262,25 @@ This commonly includes things such as: ;; definition for method 32 of type stad-samos ;; WARN: Return type mismatch int vs none. -(defmethod init! stad-samos ((obj stad-samos)) +(defmethod init! stad-samos ((this stad-samos)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-samos" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj stand-anim) 6) - (set! (-> obj walk-anim) 8) - (set! (-> obj raise-ship-anim) 7) - (set! (-> obj knocked-back-anim) 11) - (set! (-> obj knocked-back-land-anim) 12) - (set! (-> obj knocked-forward-anim) 9) - (set! (-> obj knocked-forward-land-anim) 10) - (set! (-> obj death-anim) 13) - (set! (-> obj death-end-anim) 14) - (set! (-> obj hud) (ppointer->handle (process-spawn hud-samos-old :init hud-init-by-other :to obj))) - (set! (-> obj hud-bot-index) 1) - (set! (-> obj rift-rider-joint-offset) 4) - (set! (-> obj hand-joint) 22) + (set! (-> this stand-anim) 6) + (set! (-> this walk-anim) 8) + (set! (-> this raise-ship-anim) 7) + (set! (-> this knocked-back-anim) 11) + (set! (-> this knocked-back-land-anim) 12) + (set! (-> this knocked-forward-anim) 9) + (set! (-> this knocked-forward-land-anim) 10) + (set! (-> this death-anim) 13) + (set! (-> this death-end-anim) 14) + (set! (-> this hud) (ppointer->handle (process-spawn hud-samos-old :init hud-init-by-other :to this))) + (set! (-> this hud-bot-index) 1) + (set! (-> this rift-rider-joint-offset) 4) + (set! (-> this hand-joint) 22) 0 (none) ) @@ -2295,16 +2295,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type stad-youngsamos -(defmethod inspect stad-youngsamos ((obj stad-youngsamos)) - (when (not obj) - (set! obj obj) +(defmethod inspect stad-youngsamos ((this stad-youngsamos)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type stad-samos inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2380,30 +2380,30 @@ This commonly includes things such as: ;; definition for method 32 of type stad-youngsamos ;; WARN: Return type mismatch int vs none. -(defmethod init! stad-youngsamos ((obj stad-youngsamos)) +(defmethod init! stad-youngsamos ((this stad-youngsamos)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-youngsamos" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj stand-anim) 17) - (set! (-> obj walk-anim) 25) - (set! (-> obj raise-ship-anim) 18) - (set! (-> obj knocked-back-anim) 19) - (set! (-> obj knocked-back-land-anim) 20) - (set! (-> obj knocked-forward-anim) 21) - (set! (-> obj knocked-forward-land-anim) 22) - (set! (-> obj death-anim) 23) - (set! (-> obj death-end-anim) 24) - (set! (-> obj hud) (ppointer->handle (process-spawn hud-samos-young :init hud-init-by-other :to obj))) - (set! (-> obj hud-bot-index) 0) - (set! (-> obj hand-joint) 25) + (set! (-> this stand-anim) 17) + (set! (-> this walk-anim) 25) + (set! (-> this raise-ship-anim) 18) + (set! (-> this knocked-back-anim) 19) + (set! (-> this knocked-back-land-anim) 20) + (set! (-> this knocked-forward-anim) 21) + (set! (-> this knocked-forward-land-anim) 22) + (set! (-> this death-anim) 23) + (set! (-> this death-end-anim) 24) + (set! (-> this hud) (ppointer->handle (process-spawn hud-samos-young :init hud-init-by-other :to this))) + (set! (-> this hud-bot-index) 0) + (set! (-> this hand-joint) 25) 0 (none) ) ;; definition for method 33 of type stad-youngsamos -(defmethod get-position stad-youngsamos ((obj stad-youngsamos)) +(defmethod get-position stad-youngsamos ((this stad-youngsamos)) 'left ) @@ -2433,39 +2433,39 @@ This commonly includes things such as: ) ;; definition for method 3 of type stadium-barrier -(defmethod inspect stadium-barrier ((obj stadium-barrier)) - (when (not obj) - (set! obj obj) +(defmethod inspect stadium-barrier ((this stadium-barrier)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcolor: #~%" (-> obj color)) - (format #t "~2Tflash: #~%" (-> obj flash)) - (format #t "~2Tflashf: ~f~%" (-> obj flashf)) - (format #t "~2Tcolorf: ~f~%" (-> obj colorf)) + (format #t "~2Tcolor: #~%" (-> this color)) + (format #t "~2Tflash: #~%" (-> this flash)) + (format #t "~2Tflashf: ~f~%" (-> this flashf)) + (format #t "~2Tcolorf: ~f~%" (-> this colorf)) (label cfg-4) - obj + this ) ;; definition for method 22 of type stadium-barrier ;; WARN: Return type mismatch int vs none. -(defmethod stadium-barrier-method-22 stadium-barrier ((obj stadium-barrier)) - (set! (-> obj root) (new 'process 'trsqv)) +(defmethod stadium-barrier-method-22 stadium-barrier ((this stadium-barrier)) + (set! (-> this root) (new 'process 'trsqv)) 0 (none) ) ;; definition for method 23 of type stadium-barrier ;; WARN: Return type mismatch int vs none. -(defmethod stadium-barrier-method-23 stadium-barrier ((obj stadium-barrier)) +(defmethod stadium-barrier-method-23 stadium-barrier ((this stadium-barrier)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stadium-barrier" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw lod-set lod 0 dist) 409600.0) + (set! (-> this draw lod-set lod 0 dist) 409600.0) 0 (none) ) @@ -2506,14 +2506,14 @@ This commonly includes things such as: ;; definition for method 11 of type stadium-barrier ;; WARN: Return type mismatch entity-perm-status vs none. -(defmethod init-from-entity! stadium-barrier ((obj stadium-barrier) (arg0 entity-actor)) +(defmethod init-from-entity! stadium-barrier ((this stadium-barrier) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (process-entity-status! obj (entity-perm-status dead) #t) + (process-entity-status! this (entity-perm-status dead) #t) (none) ) @@ -2574,26 +2574,26 @@ This commonly includes things such as: ) ;; definition for method 3 of type stad-force-field -(defmethod inspect stad-force-field ((obj stad-force-field)) - (when (not obj) - (set! obj obj) +(defmethod inspect stad-force-field ((this stad-force-field)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tplane: #~%" (-> obj plane)) - (format #t "~2Tfield: ~D~%" (-> obj field)) - (format #t "~2Tripple: ~D~%" (-> obj ripple)) - (format #t "~2Tnext-message-time: ~D~%" (-> obj next-message-time)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tplane: #~%" (-> this plane)) + (format #t "~2Tfield: ~D~%" (-> this field)) + (format #t "~2Tripple: ~D~%" (-> this ripple)) + (format #t "~2Tnext-message-time: ~D~%" (-> this next-message-time)) (label cfg-4) - obj + this ) ;; definition for method 29 of type stad-force-field ;; INFO: Used lq/sq -(defmethod stad-force-field-method-29 stad-force-field ((obj stad-force-field) (arg0 touching-shapes-entry)) +(defmethod stad-force-field-method-29 stad-force-field ((this stad-force-field) (arg0 touching-shapes-entry)) (local-vars (sv-256 entity-actor) (sv-272 collide-tri-result) @@ -2611,23 +2611,23 @@ This commonly includes things such as: (if (not arg0) (return (the-as int #f)) ) - (if (handle->process (-> obj field)) - (deactivate (-> obj field process 0)) + (if (handle->process (-> this field)) + (deactivate (-> this field process 0)) ) - (if (handle->process (-> obj ripple)) - (deactivate (-> obj ripple process 0)) + (if (handle->process (-> this ripple)) + (deactivate (-> this ripple process 0)) ) (let* ((s3-0 (get-process *default-dead-pool* manipy #x4000)) (s4-0 (when s3-0 (let ((t9-3 (method-of-type manipy activate))) - (t9-3 (the-as manipy s3-0) obj (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) + (t9-3 (the-as manipy s3-0) this (symbol->string (-> manipy symbol)) (the-as pointer #x70004000)) ) (let ((s4-1 run-function-in-process) (s2-0 s3-0) (s1-0 manipy-init) - (s0-0 (-> obj root trans)) + (s0-0 (-> this root trans)) ) - (set! sv-256 (-> obj entity)) + (set! sv-256 (-> this entity)) (let ((t0-0 (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer uint32) #f))) (t1-0 #f) (t2-0 0) @@ -2652,19 +2652,19 @@ This commonly includes things such as: 0.0 (let ((s3-1 (new 'stack-no-clear 'vector))) (when s4-0 - (set! (-> obj ripple) (ppointer->handle s4-0)) + (set! (-> this ripple) (ppointer->handle s4-0)) (send-event (ppointer->process s4-0) 'anim-mode 'play1) (send-event (ppointer->process s4-0) 'speed 1.5) (send-event (ppointer->process s4-0) 'art-joint-anim "generic-ripples-idle" 0) (set-vector! (-> (the-as process-drawable (-> s4-0 0)) root scale) 1.0 1.0 1.0 1.0) (let ((s2-1 (-> arg0 head))) (while s2-1 - (get-touched-prim s2-1 (-> obj root) arg0) - (set! sv-272 (get-touched-tri s2-1 (-> obj root) arg0)) + (get-touched-prim s2-1 (-> this root) arg0) + (set! sv-272 (get-touched-tri s2-1 (-> this root) arg0)) (when sv-272 (quaternion-look-at! (-> (the-as process-drawable (-> s4-0 0)) root quat) (-> sv-272 normal) *up-vector*) - (set! (-> obj plane quad) (-> sv-272 normal quad)) - (set! (-> obj plane w) (- (vector-dot (-> sv-272 normal) (the-as vector (-> sv-272 vertex))))) + (set! (-> this plane quad) (-> sv-272 normal quad)) + (set! (-> this plane w) (- (vector-dot (-> sv-272 normal) (the-as vector (-> sv-272 vertex))))) (let ((f30-0 (the-as float #x7f800000)) (f28-0 (the-as float #xff800000)) (s0-1 (new 'stack-no-clear 'vector)) @@ -2753,17 +2753,17 @@ This commonly includes things such as: ) ) (send-event (ppointer->process s4-0) 'trans-hook (lambda () (none))) - (set! (-> obj field) (ppointer->handle (stadium-barrier-spawn - obj - (-> (the-as process-drawable (-> s4-0 0)) root trans) - (quaternion-rotate-local-x! - (new 'stack-no-clear 'quaternion) - (-> (the-as process-drawable (-> s4-0 0)) root quat) - 16384.0 - ) - s3-1 - ) - ) + (set! (-> this field) (ppointer->handle (stadium-barrier-spawn + this + (-> (the-as process-drawable (-> s4-0 0)) root trans) + (quaternion-rotate-local-x! + (new 'stack-no-clear 'quaternion) + (-> (the-as process-drawable (-> s4-0 0)) root quat) + 16384.0 + ) + s3-1 + ) + ) ) ) ) @@ -2822,14 +2822,14 @@ This commonly includes things such as: ) ;; definition for method 12 of type stad-force-field -(defmethod run-logic? stad-force-field ((obj stad-force-field)) +(defmethod run-logic? stad-force-field ((this stad-force-field)) #t ) ;; definition for method 28 of type stad-force-field ;; WARN: Return type mismatch int vs none. -(defmethod stad-force-field-method-28 stad-force-field ((obj stad-force-field)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod stad-force-field-method-28 stad-force-field ((this stad-force-field)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -2864,7 +2864,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -2872,25 +2872,25 @@ This commonly includes things such as: ;; definition for method 11 of type stad-force-field ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-force-field ((obj stad-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! stad-force-field ((this stad-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stad-force-field-method-28 obj) - (process-drawable-from-entity! obj arg0) + (stad-force-field-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-force-field" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj field) (the-as handle #f)) - (set! (-> obj ripple) (the-as handle #f)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this field) (the-as handle #f)) + (set! (-> this ripple) (the-as handle #f)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2910,39 +2910,39 @@ This commonly includes things such as: ) ;; definition for method 3 of type stad-c-force-field -(defmethod inspect stad-c-force-field ((obj stad-c-force-field)) - (when (not obj) - (set! obj obj) +(defmethod inspect stad-c-force-field ((this stad-c-force-field)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type stad-force-field inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type stad-c-force-field ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-c-force-field ((obj stad-c-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! stad-c-force-field ((this stad-c-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stad-force-field-method-28 obj) - (process-drawable-from-entity! obj arg0) + (stad-force-field-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-c-force-field" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj field) (the-as handle #f)) - (set! (-> obj ripple) (the-as handle #f)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this field) (the-as handle #f)) + (set! (-> this ripple) (the-as handle #f)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2962,39 +2962,39 @@ This commonly includes things such as: ) ;; definition for method 3 of type stad-d-force-field -(defmethod inspect stad-d-force-field ((obj stad-d-force-field)) - (when (not obj) - (set! obj obj) +(defmethod inspect stad-d-force-field ((this stad-d-force-field)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type stad-force-field inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type stad-d-force-field ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! stad-d-force-field ((obj stad-d-force-field) (arg0 entity-actor)) +(defmethod init-from-entity! stad-d-force-field ((this stad-d-force-field) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stad-force-field-method-28 obj) - (process-drawable-from-entity! obj arg0) + (stad-force-field-method-28 this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stad-d-force-field" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj mask) (process-mask crate)) - (set! (-> obj field) (the-as handle #f)) - (set! (-> obj ripple) (the-as handle #f)) + (logior! (-> this mask) (process-mask crate)) + (set! (-> this field) (the-as handle #f)) + (set! (-> this ripple) (the-as handle #f)) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3011,16 +3011,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type stad-keira -(defmethod inspect stad-keira ((obj stad-keira)) - (when (not obj) - (set! obj obj) +(defmethod inspect stad-keira ((this stad-keira)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3124,16 +3124,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type stad-brutter -(defmethod inspect stad-brutter ((obj stad-brutter)) - (when (not obj) - (set! obj obj) +(defmethod inspect stad-brutter ((this stad-brutter)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3235,16 +3235,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type brutter-balloon -(defmethod inspect brutter-balloon ((obj brutter-balloon)) - (when (not obj) - (set! obj obj) +(defmethod inspect brutter-balloon ((this brutter-balloon)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -3262,14 +3262,14 @@ This commonly includes things such as: ;; definition for method 11 of type brutter-balloon ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! brutter-balloon ((obj brutter-balloon) (arg0 entity-actor)) +(defmethod init-from-entity! brutter-balloon ((this brutter-balloon) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker)) @@ -3305,23 +3305,23 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-brutter-balloon" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((a0-27 (-> obj skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-27 (-> this skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) - (setup-masks (-> obj draw) -1 0) - (setup-masks (-> obj draw) 0 2) + (setup-masks (-> this draw) -1 0) + (setup-masks (-> this draw) 0 2) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -3485,49 +3485,49 @@ This commonly includes things such as: ;; definition for method 15 of type hud-samos-old ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-samos-old ((obj hud-samos-old)) +(defmethod draw hud-samos-old ((this hud-samos-old)) (set-hud-piece-position! - (-> obj sprites 2) - (the int (+ 30.0 (* -130.0 (-> obj offset)))) - (the int (+ 130.0 (* -100.0 (-> obj offset)))) + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 130.0 (* -100.0 (-> this offset)))) ) - (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 5 2) - ((method-of-type hud draw) obj) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 5 2) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-samos-old ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-samos-old ((obj hud-samos-old)) - (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-samos-old ((this hud-samos-old)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 1)))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-samos-old ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-samos-old ((obj hud-samos-old)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-center-left) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-samos-old ((this hud-samos-old)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-left) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) - (set! (-> obj sprites 0 scale-x) 12.0) - (set! (-> obj sprites 0 scale-y) 11.2) - (set! (-> obj sprites 0 pos z) #xfffff2) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) - (set! (-> obj sprites 1 pos z) #xfffff0) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) - (set! (-> obj sprites 2 pos z) #xffffff) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd5a))) - (set! (-> obj sprites 3 scale-x) 1.0) - (set! (-> obj sprites 3 scale-y) 1.0) - (set! (-> obj sprites 3 pos z) #xffffff) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xd5a))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set! (-> this sprites 3 pos z) #xffffff) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-part_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-part_REF.gc index 96b3bd74b3..318e0f5fad 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type stadium-part -(defmethod inspect stadium-part ((obj stadium-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect stadium-part ((this stadium-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc index b953729ff1..0b03fd96ad 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-race-obs_REF.gc @@ -18,18 +18,18 @@ ) ;; definition for method 3 of type stdmb-race-hatch -(defmethod inspect stdmb-race-hatch ((obj stdmb-race-hatch)) - (when (not obj) - (set! obj obj) +(defmethod inspect stdmb-race-hatch ((this stdmb-race-hatch)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttt: ~f~%" (-> obj tt)) - (format #t "~2Ttt-target: ~f~%" (-> obj tt-target)) + (format #t "~2Ttt: ~f~%" (-> this tt)) + (format #t "~2Ttt-target: ~f~%" (-> this tt-target)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -68,8 +68,8 @@ ;; definition for method 21 of type stdmb-race-hatch ;; WARN: Return type mismatch int vs none. -(defmethod stdmb-race-hatch-method-21 stdmb-race-hatch ((obj stdmb-race-hatch)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod stdmb-race-hatch-method-21 stdmb-race-hatch ((this stdmb-race-hatch)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -103,7 +103,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-19 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -111,37 +111,37 @@ ;; definition for method 22 of type stdmb-race-hatch ;; WARN: Return type mismatch int vs none. -(defmethod stdmb-race-hatch-method-22 stdmb-race-hatch ((obj stdmb-race-hatch)) +(defmethod stdmb-race-hatch-method-22 stdmb-race-hatch ((this stdmb-race-hatch)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-stdmb-race-hatch" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw shadow-mask) (the-as uint 30)) - (set! (-> obj draw shadow-values) (the-as uint #x22220)) - (set! (-> obj tt) 0.0) - (set! (-> obj tt-target) 0.0) + (set! (-> this draw shadow-mask) (the-as uint 30)) + (set! (-> this draw shadow-values) (the-as uint #x22220)) + (set! (-> this tt) 0.0) + (set! (-> this tt-target) 0.0) (ja-channel-push! 1 0) - (let ((v1-7 (-> obj skel root-channel 0))) - (set! (-> v1-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((v1-7 (-> this skel root-channel 0))) + (set! (-> v1-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) 0 (none) ) ;; definition for method 11 of type stdmb-race-hatch -(defmethod init-from-entity! stdmb-race-hatch ((obj stdmb-race-hatch) (arg0 entity-actor)) +(defmethod init-from-entity! stdmb-race-hatch ((this stdmb-race-hatch) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stdmb-race-hatch-method-21 obj) - (process-drawable-from-entity! obj arg0) - (stdmb-race-hatch-method-22 obj) + (stdmb-race-hatch-method-21 this) + (process-drawable-from-entity! this arg0) + (stdmb-race-hatch-method-22 this) (none) ) @@ -165,16 +165,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type stdmb-platform -(defmethod inspect stdmb-platform ((obj stdmb-platform)) - (when (not obj) - (set! obj obj) +(defmethod inspect stdmb-platform ((this stdmb-platform)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type stdmb-race-hatch inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc index 62c67db9de..f62bfe2862 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadium-scenes_REF.gc @@ -3221,26 +3221,24 @@ ) ;; definition for method 3 of type keira-npc -;; INFO: this function exists in multiple non-identical object files -(defmethod inspect keira-npc ((obj keira-npc)) - (when (not obj) - (set! obj obj) +(defmethod inspect keira-npc ((this keira-npc)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-taskable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type keira-npc -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch draw-control vs none. -(defmethod init-art! keira-npc ((obj keira-npc)) +(defmethod init-art! keira-npc ((this keira-npc)) "@see [[initialize-skeleton]]" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-keira-highres" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -3248,16 +3246,15 @@ ) ;; definition for method 35 of type keira-npc -;; INFO: this function exists in multiple non-identical object files -(defmethod get-art-elem keira-npc ((obj keira-npc)) +(defmethod get-art-elem keira-npc ((this keira-npc)) "Checks various things such the current actor, task status, etc to determine the right art-group data to use @returns the appropriate [[art-element]] for the given NPC" - (case (-> obj task actor) + (case (-> this task actor) (((game-task-actor keira-stadium)) - (-> obj draw art-group data 4) + (-> this draw art-group data 4) ) (else - (-> obj draw art-group data 3) + (-> this draw art-group data 3) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/stadium/stadiumb-part_REF.gc b/test/decompiler/reference/jak2/levels/stadium/stadiumb-part_REF.gc index 713bf1f0b8..609b0d3b63 100644 --- a/test/decompiler/reference/jak2/levels/stadium/stadiumb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/stadium/stadiumb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type stadiumb-part -(defmethod inspect stadiumb-part ((obj stadiumb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect stadiumb-part ((this stadiumb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type stadiumc-part @@ -33,16 +33,16 @@ ) ;; definition for method 3 of type stadiumc-part -(defmethod inspect stadiumc-part ((obj stadiumc-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect stadiumc-part ((this stadiumc-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type stadiumd-part @@ -55,16 +55,16 @@ ) ;; definition for method 3 of type stadiumd-part -(defmethod inspect stadiumd-part ((obj stadiumd-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect stadiumd-part ((this stadiumd-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -5042,7 +5042,3 @@ (:rotate-y (degrees 0)) ) ) - - - - diff --git a/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc b/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc index 0d62326e74..7f32563d41 100644 --- a/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/chaincrate_REF.gc @@ -95,21 +95,21 @@ ) ;; definition for method 3 of type strip-chain-crate-slave -(defmethod inspect strip-chain-crate-slave ((obj strip-chain-crate-slave)) - (when (not obj) - (set! obj obj) +(defmethod inspect strip-chain-crate-slave ((this strip-chain-crate-slave)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpart2: ~A~%" (-> obj part2)) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-speed: ~f~%" (-> obj path-speed)) - (format #t "~2Tguide-sound-mask: ~D~%" (-> obj guide-sound-mask)) - (format #t "~2Tguide-num: ~D~%" (-> obj guide-num)) + (format #t "~2Tpart2: ~A~%" (-> this part2)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-speed: ~f~%" (-> this path-speed)) + (format #t "~2Tguide-sound-mask: ~D~%" (-> this guide-sound-mask)) + (format #t "~2Tguide-num: ~D~%" (-> this guide-num)) (label cfg-4) - obj + this ) ;; definition for symbol *strip-chain-crate-guides*, type vector4s-3 @@ -132,17 +132,17 @@ ;; definition for method 22 of type strip-chain-crate-slave ;; WARN: Return type mismatch rgbaf vs none. -(defmethod strip-chain-crate-slave-method-22 strip-chain-crate-slave ((obj strip-chain-crate-slave)) - (let ((f0-0 (-> obj path-u))) +(defmethod strip-chain-crate-slave-method-22 strip-chain-crate-slave ((this strip-chain-crate-slave)) + (let ((f0-0 (-> this path-u))) (cond ((>= 0.09 f0-0) (let ((f0-1 (* 11.111111 f0-0))) - (set-vector! (-> obj draw color-mult) f0-1 f0-1 f0-1 1.0) + (set-vector! (-> this draw color-mult) f0-1 f0-1 f0-1 1.0) ) ) ((>= f0-0 0.87) (let ((f0-5 (- 1.0 (* 7.692308 (+ -0.87 f0-0))))) - (set-vector! (-> obj draw color-mult) f0-5 f0-5 f0-5 1.0) + (set-vector! (-> this draw color-mult) f0-5 f0-5 f0-5 1.0) ) ) ) @@ -268,21 +268,21 @@ ) ;; definition for method 10 of type strip-chain-crate-slave -(defmethod deactivate strip-chain-crate-slave ((obj strip-chain-crate-slave)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate strip-chain-crate-slave ((this strip-chain-crate-slave)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type strip-chain-crate-slave ;; WARN: Return type mismatch process-drawable vs strip-chain-crate-slave. -(defmethod relocate strip-chain-crate-slave ((obj strip-chain-crate-slave) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate strip-chain-crate-slave ((this strip-chain-crate-slave) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (the-as strip-chain-crate-slave ((method-of-type process-drawable relocate) obj arg0)) + (the-as strip-chain-crate-slave ((method-of-type process-drawable relocate) this arg0)) ) ;; definition of type strip-chain-crate @@ -305,43 +305,43 @@ ) ;; definition for method 3 of type strip-chain-crate -(defmethod inspect strip-chain-crate ((obj strip-chain-crate)) - (when (not obj) - (set! obj obj) +(defmethod inspect strip-chain-crate ((this strip-chain-crate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspawn-pos: #~%" (-> obj spawn-pos)) - (format #t "~2Tnext-spawn-time: ~D~%" (-> obj next-spawn-time)) - (format #t "~2Tspawn-delay: ~D~%" (-> obj spawn-delay)) - (format #t "~2Tspawn-offset: ~D~%" (-> obj spawn-offset)) - (format #t "~2Tdist-apart: ~f~%" (-> obj dist-apart)) - (format #t "~2Tcrate-speed: ~f~%" (-> obj crate-speed)) + (format #t "~2Tspawn-pos: #~%" (-> this spawn-pos)) + (format #t "~2Tnext-spawn-time: ~D~%" (-> this next-spawn-time)) + (format #t "~2Tspawn-delay: ~D~%" (-> this spawn-delay)) + (format #t "~2Tspawn-offset: ~D~%" (-> this spawn-offset)) + (format #t "~2Tdist-apart: ~f~%" (-> this dist-apart)) + (format #t "~2Tcrate-speed: ~f~%" (-> this crate-speed)) (label cfg-4) - obj + this ) ;; definition for method 21 of type strip-chain-crate ;; WARN: Return type mismatch symbol vs none. -(defmethod strip-chain-crate-method-21 strip-chain-crate ((obj strip-chain-crate)) - (let ((f30-0 (total-distance (-> obj path))) +(defmethod strip-chain-crate-method-21 strip-chain-crate ((this strip-chain-crate)) + (let ((f30-0 (total-distance (-> this path))) (f28-0 (* (/ (the float - (mod (the-as uint (+ (current-time) (the-as time-frame (-> obj spawn-offset)))) (-> obj spawn-delay)) + (mod (the-as uint (+ (current-time) (the-as time-frame (-> this spawn-offset)))) (-> this spawn-delay)) ) - (the float (-> obj spawn-delay)) + (the float (-> this spawn-delay)) ) - (-> obj dist-apart) + (-> this dist-apart) ) ) ) (while (>= f30-0 f28-0) (let ((f26-0 (/ f28-0 f30-0))) - (process-spawn strip-chain-crate-slave f26-0 (-> obj crate-speed) :to obj) + (process-spawn strip-chain-crate-slave f26-0 (-> this crate-speed) :to this) ) - (+! f28-0 (-> obj dist-apart)) + (+! f28-0 (-> this dist-apart)) ) ) (none) @@ -365,7 +365,7 @@ ;; definition for method 11 of type strip-chain-crate ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! strip-chain-crate ((obj strip-chain-crate) (arg0 entity-actor)) +(defmethod init-from-entity! strip-chain-crate ((this strip-chain-crate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -373,9 +373,9 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 int)) - (set! (-> obj root) (new 'process 'trsqv)) - (set! (-> obj path) (new 'process 'curve-control obj 'path -1000000000.0)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this root) (new 'process 'trsqv)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((f28-0 53248.0) (f26-0 131072.0) (f30-0 0.0) @@ -388,23 +388,23 @@ This commonly includes things such as: (set! f30-0 (-> v1-8 2)) ) ) - (set! (-> obj crate-speed) f28-0) - (set! (-> obj dist-apart) f26-0) - (set! (-> obj spawn-delay) (the-as uint (the int (* 300.0 (/ f26-0 f28-0))))) - (set! (-> obj spawn-offset) (the-as uint (the int (* f30-0 (the float (-> obj spawn-delay)))))) + (set! (-> this crate-speed) f28-0) + (set! (-> this dist-apart) f26-0) + (set! (-> this spawn-delay) (the-as uint (the int (* 300.0 (/ f26-0 f28-0))))) + (set! (-> this spawn-offset) (the-as uint (the int (* f30-0 (the float (-> this spawn-delay)))))) ) - (set! (-> obj next-spawn-time) + (set! (-> this next-spawn-time) (+ (current-time) (the-as time-frame - (- (-> obj spawn-delay) - (mod (the-as uint (+ (current-time) (the-as time-frame (-> obj spawn-offset)))) (-> obj spawn-delay)) + (- (-> this spawn-delay) + (mod (the-as uint (+ (current-time) (the-as time-frame (-> this spawn-offset)))) (-> this spawn-delay)) ) ) ) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (strip-chain-crate-method-21 obj) - (go (method-of-object obj idle)) + (logclear! (-> this mask) (process-mask actor-pause)) + (strip-chain-crate-method-21 this) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc index 84bfada6e9..5e964f663e 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-drop_REF.gc @@ -220,18 +220,18 @@ ) ;; definition for method 3 of type strip-game-crate -(defmethod inspect strip-game-crate ((obj strip-game-crate)) - (when (not obj) - (set! obj obj) +(defmethod inspect strip-game-crate ((this strip-game-crate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlocal-offset: #~%" (-> obj local-offset)) - (format #t "~2Tswing-angle: #~%" (-> obj swing-angle)) + (format #t "~2Tlocal-offset: #~%" (-> this local-offset)) + (format #t "~2Tswing-angle: #~%" (-> this swing-angle)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -282,12 +282,12 @@ ;; definition for method 22 of type strip-game-crate ;; INFO: Used lq/sq ;; WARN: Return type mismatch vector vs none. -(defmethod strip-game-crate-method-22 strip-game-crate ((obj strip-game-crate) (arg0 vector) (arg1 quaternion)) - (set! (-> obj root trans quad) (-> arg0 quad)) +(defmethod strip-game-crate-method-22 strip-game-crate ((this strip-game-crate) (arg0 vector) (arg1 quaternion)) + (set! (-> this root trans quad) (-> arg0 quad)) (let ((s4-0 (new 'stack-no-clear 'quaternion))) - (quaternion-rotate-z! s4-0 arg1 (-> obj swing-angle z)) - (quaternion-rotate-x! s4-0 s4-0 (-> obj swing-angle x)) - (quaternion-copy! (-> obj root quat) s4-0) + (quaternion-rotate-z! s4-0 arg1 (-> this swing-angle z)) + (quaternion-rotate-x! s4-0 s4-0 (-> this swing-angle x)) + (quaternion-copy! (-> this root quat) s4-0) ) (none) ) @@ -355,29 +355,29 @@ ) ;; definition for method 3 of type crane -(defmethod inspect crane ((obj crane)) - (when (not obj) - (set! obj obj) +(defmethod inspect crane ((this crane)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tangle-vel: ~f~%" (-> obj angle-vel)) - (format #t "~2Tangle: ~f~%" (-> obj angle)) - (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) - (format #t "~2Tfinal-quat: #~%" (-> obj final-quat)) - (format #t "~2Tcrate: #x~X~%" (-> obj crate)) + (format #t "~2Tangle-vel: ~f~%" (-> this angle-vel)) + (format #t "~2Tangle: ~f~%" (-> this angle)) + (format #t "~2Tinit-quat: #~%" (-> this init-quat)) + (format #t "~2Tfinal-quat: #~%" (-> this final-quat)) + (format #t "~2Tcrate: #x~X~%" (-> this crate)) (label cfg-4) - obj + this ) ;; definition for method 10 of type crane -(defmethod deactivate crane ((obj crane)) - (if (-> obj crate) - (deactivate (-> obj crate 0)) +(defmethod deactivate crane ((this crane)) + (if (-> this crate) + (deactivate (-> this crate 0)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -468,31 +468,31 @@ ;; definition for method 11 of type crane ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! crane ((obj crane) (arg0 entity-actor)) +(defmethod init-from-entity! crane ((this crane) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-crane" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (quaternion-rotate-y! (-> obj root quat) (-> obj root quat) 910.2222) - (quaternion-copy! (-> obj final-quat) (-> obj root quat)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj draw light-index) (the-as uint 10)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) 910.2222) + (quaternion-copy! (-> this final-quat) (-> this root quat)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 10)) (ja-post) - (let ((s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 4)))) - (set! (-> obj crate) (process-spawn strip-game-crate s5-2 (-> obj root quat) :to obj)) + (let ((s5-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 4)))) + (set! (-> this crate) (process-spawn strip-game-crate s5-2 (-> this root quat) :to this)) ) (if (or (task-complete? *game-info* (game-task strip-rescue)) (demo?)) - (go (method-of-object obj final-position)) - (go (method-of-object obj idle)) + (go (method-of-object this final-position)) + (go (method-of-object this idle)) ) (none) ) @@ -513,17 +513,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type cranecrate -(defmethod inspect cranecrate ((obj cranecrate)) - (when (not obj) - (set! obj obj) +(defmethod inspect cranecrate ((this cranecrate)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Troot: #~%" (-> obj root)) + (format #t "~2Troot: #~%" (-> this root)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -563,14 +563,14 @@ This commonly includes things such as: ;; definition for method 11 of type cranecrate ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cranecrate ((obj cranecrate) (arg0 entity-actor)) +(defmethod init-from-entity! cranecrate ((this cranecrate) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak player-list)) @@ -585,15 +585,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cranecrate" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (+! (-> obj root trans y) -163348.48) + (+! (-> this root trans y) -163348.48) (when (or (demo?) (and (= *kernel-boot-message* 'kiosk) (task-node-open? (game-task-node strip-drop-resolution)))) (let ((s5-2 (new 'stack-no-clear 'task-arrow-params))) (set! (-> s5-2 pos quad) (-> (new 'static 'vector :x 9920120.0 :y 288036.03 :z -179639.1 :w 1.0) quad)) @@ -603,12 +603,12 @@ This commonly includes things such as: ) (set! (-> s5-2 flags) (task-arrow-flags task-arrow-flag-02)) (set! (-> s5-2 map-icon) (the-as uint 15)) - (task-arrow-spawn s5-2 obj) + (task-arrow-spawn s5-2 this) ) ) (if (task-node-closed? (game-task-node strip-drop-resolution)) - (go (method-of-object obj idle)) - (go (method-of-object obj hidden)) + (go (method-of-object this idle)) + (go (method-of-object this hidden)) ) (none) ) @@ -631,18 +631,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type grunt-egg -(defmethod inspect grunt-egg ((obj grunt-egg)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt-egg ((this grunt-egg)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tidle-anim-player: #~%" (-> obj idle-anim-player)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Tidle-anim-player: #~%" (-> this idle-anim-player)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -759,7 +759,7 @@ This commonly includes things such as: ;; definition for method 11 of type grunt-egg ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! grunt-egg ((obj grunt-egg) (arg0 entity-actor)) +(defmethod init-from-entity! grunt-egg ((this grunt-egg) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -768,7 +768,7 @@ This commonly includes things such as: - sounds" (cond ((>= (res-lump-value arg0 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-4 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-4 prim-core collide-with) (collide-spec jak player-list)) @@ -783,34 +783,34 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-7 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-7 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) ) (else - (set! (-> obj root) (new 'process 'trsqv)) + (set! (-> this root) (new 'process 'trsqv)) ) ) - (grunt-egg-method-22 obj) - (process-drawable-from-entity! obj arg0) + (grunt-egg-method-22 this) + (process-drawable-from-entity! this arg0) (let* ((v1-12 *game-info*) (a0-14 (+ (-> v1-12 attack-id) 1)) ) (set! (-> v1-12 attack-id) a0-14) - (set! (-> obj attack-id) a0-14) + (set! (-> this attack-id) a0-14) ) - (let ((a1-8 (grunt-egg-method-23 obj))) + (let ((a1-8 (grunt-egg-method-23 this))) (if a1-8 - (idle-control-method-9 (-> obj idle-anim-player) (the-as (pointer idle-control-frame) a1-8)) + (idle-control-method-9 (-> this idle-anim-player) (the-as (pointer idle-control-frame) a1-8)) ) ) (if (>= (res-lump-value arg0 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "grunt-eggs" :fo-min 5 :fo-max 45) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "grunt-eggs" :fo-min 5 :fo-max 45) (-> this root trans)) ) ) (if (task-complete? *game-info* (game-task strip-drop)) - (go (method-of-object obj die)) - (go (method-of-object obj idle)) + (go (method-of-object this die)) + (go (method-of-object this idle)) ) (none) ) @@ -825,16 +825,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type grunt-egg-a -(defmethod inspect grunt-egg-a ((obj grunt-egg-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt-egg-a ((this grunt-egg-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type grunt-egg inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type grunt-egg-b @@ -847,16 +847,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type grunt-egg-b -(defmethod inspect grunt-egg-b ((obj grunt-egg-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt-egg-b ((this grunt-egg-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type grunt-egg inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type grunt-egg-c @@ -869,16 +869,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type grunt-egg-c -(defmethod inspect grunt-egg-c ((obj grunt-egg-c)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt-egg-c ((this grunt-egg-c)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type grunt-egg inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type grunt-egg-d @@ -891,23 +891,23 @@ This commonly includes things such as: ) ;; definition for method 3 of type grunt-egg-d -(defmethod inspect grunt-egg-d ((obj grunt-egg-d)) - (when (not obj) - (set! obj obj) +(defmethod inspect grunt-egg-d ((this grunt-egg-d)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type grunt-egg inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 22 of type grunt-egg-a ;; WARN: Return type mismatch draw-control vs none. -(defmethod grunt-egg-method-22 grunt-egg-a ((obj grunt-egg-a)) +(defmethod grunt-egg-method-22 grunt-egg-a ((this grunt-egg-a)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -915,58 +915,58 @@ This commonly includes things such as: ) ;; definition for method 23 of type grunt-egg-a -(defmethod grunt-egg-method-23 grunt-egg-a ((obj grunt-egg-a)) +(defmethod grunt-egg-method-23 grunt-egg-a ((this grunt-egg-a)) *grunt-egg-a-script* ) ;; definition for method 22 of type grunt-egg-b ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-b ((obj grunt-egg-b)) +(defmethod grunt-egg-method-22 grunt-egg-b ((this grunt-egg-b)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (add-connection *part-engine* obj 9 obj 1035 (new 'static 'vector :w 163840.0)) - (add-connection *part-engine* obj 14 obj 1035 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 9 this 1035 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 14 this 1035 (new 'static 'vector :w 163840.0)) (none) ) ;; definition for method 23 of type grunt-egg-b -(defmethod grunt-egg-method-23 grunt-egg-b ((obj grunt-egg-b)) +(defmethod grunt-egg-method-23 grunt-egg-b ((this grunt-egg-b)) *grunt-egg-b-script* ) ;; definition for method 22 of type grunt-egg-c ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-c ((obj grunt-egg-c)) +(defmethod grunt-egg-method-22 grunt-egg-c ((this grunt-egg-c)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-c" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (add-connection *part-engine* obj 7 obj 1036 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 7 this 1036 (new 'static 'vector :w 163840.0)) (none) ) ;; definition for method 23 of type grunt-egg-c -(defmethod grunt-egg-method-23 grunt-egg-c ((obj grunt-egg-c)) +(defmethod grunt-egg-method-23 grunt-egg-c ((this grunt-egg-c)) *grunt-egg-c-script* ) ;; definition for method 22 of type grunt-egg-d ;; WARN: Return type mismatch connection vs none. -(defmethod grunt-egg-method-22 grunt-egg-d ((obj grunt-egg-d)) +(defmethod grunt-egg-method-22 grunt-egg-d ((this grunt-egg-d)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grunt-egg-d" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (add-connection *part-engine* obj 10 obj 1037 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 10 this 1037 (new 'static 'vector :w 163840.0)) (none) ) ;; definition for method 23 of type grunt-egg-d -(defmethod grunt-egg-method-23 grunt-egg-d ((obj grunt-egg-d)) +(defmethod grunt-egg-method-23 grunt-egg-d ((this grunt-egg-d)) *grunt-egg-d-script* ) 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 c80f77b801..32ca1a736f 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-obs_REF.gc @@ -3,43 +3,43 @@ ;; definition for method 15 of type hud-plasmite ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-plasmite ((obj hud-plasmite)) +(defmethod draw hud-plasmite ((this hud-plasmite)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 457.0 (* 130.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 457.0 (* 130.0 (-> this offset)))) 210 ) - (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) - (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -16 20) - ((method-of-type hud draw) obj) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -16 20) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-plasmite ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-plasmite ((obj hud-plasmite)) - (set! (-> obj values 0 target) (the int (-> *game-info* counter))) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-plasmite ((this hud-plasmite)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-plasmite ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-plasmite ((obj hud-plasmite)) - (set! (-> obj level) (level-get *level* 'strip)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-plasmite ((this hud-plasmite)) + (set! (-> this level) (level-get *level* 'strip)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb26))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 0 scale-x) 1.0) - (set! (-> obj sprites 0 scale-y) 1.0) - (alloc-string-if-needed obj 0) - (set! (-> obj strings 0 scale) 0.6) - (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #xb26))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) 0 (none) ) @@ -62,20 +62,20 @@ ) ;; definition for method 3 of type strip-hazard -(defmethod inspect strip-hazard ((obj strip-hazard)) - (when (not obj) - (set! obj obj) +(defmethod inspect strip-hazard ((this strip-hazard)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tshove-vec: #~%" (-> obj shove-vec)) - (format #t "~2Tno-collision-timer: ~D~%" (-> obj no-collision-timer)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tshove-vec: #~%" (-> this shove-vec)) + (format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) (label cfg-4) - obj + this ) ;; definition for function strip-handler @@ -129,7 +129,7 @@ ;; WARN: Return type mismatch symbol vs none. (defbehavior strip-trans strip-hazard () (when (and (nonzero? (-> self no-collision-timer)) - (>= (- (current-time) (the-as int (-> self no-collision-timer))) (seconds 0.3)) + (time-elapsed? (the-as int (-> self no-collision-timer)) (seconds 0.3)) ) (let ((v1-7 (-> self root root-prim))) (set! (-> v1-7 prim-core collide-as) (-> self root backup-collide-as)) @@ -173,7 +173,7 @@ ;; definition for method 11 of type strip-hazard ;; INFO: Used lq/sq -(defmethod init-from-entity! strip-hazard ((obj strip-hazard) (arg0 entity-actor)) +(defmethod init-from-entity! strip-hazard ((this strip-hazard) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -181,13 +181,13 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-64 res-tag)) - (set-vector! (-> obj shove-vec) 0.0 12288.0 24576.0 1.0) - (set! (-> obj no-collision-timer) (the-as uint 0)) + (set-vector! (-> this shove-vec) 0.0 12288.0 24576.0 1.0) + (set! (-> this no-collision-timer) (the-as uint 0)) (let* ((v1-1 *game-info*) (a0-5 (+ (-> v1-1 attack-id) 1)) ) (set! (-> v1-1 attack-id) a0-5) - (set! (-> obj attack-id) a0-5) + (set! (-> this attack-id) a0-5) ) (let ((s4-0 (new 'stack-no-clear 'sync-info-params)) (s3-0 1200) @@ -210,8 +210,8 @@ This commonly includes things such as: (set! (-> s4-0 entity) arg0) (set! (-> s4-0 period) (the-as uint s3-0)) (set! (-> s4-0 percent) 0.0) - (initialize! (-> obj sync) s4-0) - (sync-now! (-> obj sync) f30-0) + (initialize! (-> this sync) s4-0) + (sync-now! (-> this sync) f30-0) ) (none) ) @@ -230,20 +230,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type fencespikes -(defmethod inspect fencespikes ((obj fencespikes)) - (when (not obj) - (set! obj obj) +(defmethod inspect fencespikes ((this fencespikes)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type strip-hazard inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tstart-quat: #~%" (-> obj start-quat)) - (format #t "~2Tspin: ~f~%" (-> obj spin)) - (format #t "~2Toffset: ~f~%" (-> obj offset)) - (format #t "~2Tsparks-group: #x~X~%" (-> obj sparks-group)) + (format #t "~2Tstart-quat: #~%" (-> this start-quat)) + (format #t "~2Tspin: ~f~%" (-> this spin)) + (format #t "~2Toffset: ~f~%" (-> this offset)) + (format #t "~2Tsparks-group: #x~X~%" (-> this sparks-group)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -278,7 +278,7 @@ This commonly includes things such as: ;; definition for method 11 of type fencespikes ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! fencespikes ((obj fencespikes) (arg0 entity-actor)) +(defmethod init-from-entity! fencespikes ((this fencespikes) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -286,7 +286,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 string)) - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -318,30 +318,30 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-19 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-19 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-fencespikes" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-9 (method-of-type strip-hazard init-from-entity!))) - (t9-9 obj arg0) + (t9-9 this arg0) ) - (quaternion-copy! (-> obj start-quat) (-> obj root quat)) + (quaternion-copy! (-> this start-quat) (-> this root quat)) (set! sv-16 "#f") (let ((a0-24 (entity-lookup-part-group arg0 (& sv-16) 'art-name))) (when a0-24 (let ((a0-25 (-> a0-24 0))) (if (and (nonzero? a0-25) (= (-> a0-25 type) sparticle-launch-group)) - (set! (-> obj part) (create-launch-control a0-25 obj)) + (set! (-> this part) (create-launch-control a0-25 this)) ) ) ) ) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj idle)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) (none) ) @@ -356,17 +356,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type pitspikes -(defmethod inspect pitspikes ((obj pitspikes)) - (when (not obj) - (set! obj obj) +(defmethod inspect pitspikes ((this pitspikes)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type strip-hazard inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspinner: ~A~%" (-> obj spinner)) + (format #t "~2Tspinner: ~A~%" (-> this spinner)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -428,26 +428,26 @@ This commonly includes things such as: ;; definition for method 7 of type pitspikes ;; WARN: Return type mismatch strip-hazard vs pitspikes. -(defmethod relocate pitspikes ((obj pitspikes) (arg0 int)) - (if (nonzero? (-> obj spinner)) - (&+! (-> obj spinner) arg0) +(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)) obj arg0) + ((the-as (function strip-hazard int strip-hazard) (find-parent-method pitspikes 7)) this arg0) ) ) ;; definition for method 11 of type pitspikes ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! pitspikes ((obj pitspikes) (arg0 entity-actor)) +(defmethod init-from-entity! pitspikes ((this pitspikes) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -466,28 +466,28 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-pitspikes" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-6 (method-of-type strip-hazard init-from-entity!))) - (t9-6 obj arg0) + (t9-6 this arg0) ) - (set! (-> obj spinner) (new 'process 'joint-mod-spinner obj 4 (new 'static 'vector :x 1.0 :w 1.0) 262144.0)) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (static-sound-spec "pit-spikes" :fo-max 55) - (vector<-cspace! (new 'static 'vector) (-> obj node-list data 4)) - ) + (set! (-> this spinner) (new 'process 'joint-mod-spinner this 4 (new 'static 'vector :x 1.0 :w 1.0) 262144.0)) + (set! (-> this sound) (new + 'process + 'ambient-sound + (static-sound-spec "pit-spikes" :fo-max 55) + (vector<-cspace! (new 'static 'vector) (-> this node-list data 4)) + ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 214) obj)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 214) this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) (none) ) @@ -501,16 +501,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type curtainsaw -(defmethod inspect curtainsaw ((obj curtainsaw)) - (when (not obj) - (set! obj obj) +(defmethod inspect curtainsaw ((this curtainsaw)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type strip-hazard inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -554,14 +554,14 @@ This commonly includes things such as: ;; definition for method 11 of type curtainsaw ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! curtainsaw ((obj curtainsaw) (arg0 entity-actor)) +(defmethod init-from-entity! curtainsaw ((this curtainsaw) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -580,27 +580,27 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-curtainsaw" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-6 (method-of-type strip-hazard init-from-entity!))) - (t9-6 obj arg0) + (t9-6 this arg0) ) - (set! (-> obj sound) (new - 'process - 'ambient-sound - (static-sound-spec "curtainsaw" :fo-max 55) - (vector<-cspace! (new 'static 'vector) (-> obj node-list data 3)) - ) + (set! (-> this sound) (new + 'process + 'ambient-sound + (static-sound-spec "curtainsaw" :fo-max 55) + (vector<-cspace! (new 'static 'vector) (-> this node-list data 3)) + ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 213) obj)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj idle)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 213) this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) (none) ) @@ -630,56 +630,56 @@ This commonly includes things such as: ) ;; definition for method 3 of type grenade-point -(defmethod inspect grenade-point ((obj grenade-point)) - (when (not obj) - (set! obj obj) +(defmethod inspect grenade-point ((this grenade-point)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tcamera-name: ~A~%" (-> obj camera-name)) - (format #t "~2Tparented?: ~A~%" (-> obj parented?)) - (format #t "~2Tlightning-time: ~D~%" (-> obj lightning-time)) - (format #t "~2Tstrike-table: ~A~%" (-> obj strike-table)) - (format #t "~2Tlast-strike-index: ~D~%" (-> obj last-strike-index)) - (format #t "~2Tspeed: (meters ~m)~%" (-> obj speed)) - (format #t "~2Tpart2: ~A~%" (-> obj part2)) - (format #t "~2Tpart3: ~A~%" (-> obj part3)) - (format #t "~2Tpart-lightning-hit: ~A~%" (-> obj part-lightning-hit)) - (format #t "~2Tenter-time: ~D~%" (-> obj enter-time)) - (format #t "~2Tminimap: #~%" (-> obj minimap)) + (format #t "~2Tcamera-name: ~A~%" (-> this camera-name)) + (format #t "~2Tparented?: ~A~%" (-> this parented?)) + (format #t "~2Tlightning-time: ~D~%" (-> this lightning-time)) + (format #t "~2Tstrike-table: ~A~%" (-> this strike-table)) + (format #t "~2Tlast-strike-index: ~D~%" (-> this last-strike-index)) + (format #t "~2Tspeed: (meters ~m)~%" (-> this speed)) + (format #t "~2Tpart2: ~A~%" (-> this part2)) + (format #t "~2Tpart3: ~A~%" (-> this part3)) + (format #t "~2Tpart-lightning-hit: ~A~%" (-> this part-lightning-hit)) + (format #t "~2Tenter-time: ~D~%" (-> this enter-time)) + (format #t "~2Tminimap: #~%" (-> this minimap)) (label cfg-4) - obj + this ) ;; definition for method 7 of type grenade-point ;; WARN: Return type mismatch process-drawable vs grenade-point. -(defmethod relocate grenade-point ((obj grenade-point) (arg0 int)) - (if (nonzero? (-> obj part2)) - (&+! (-> obj part2) arg0) +(defmethod relocate grenade-point ((this grenade-point) (arg0 int)) + (if (nonzero? (-> this part2)) + (&+! (-> this part2) arg0) ) - (if (nonzero? (-> obj part3)) - (&+! (-> obj part3) arg0) + (if (nonzero? (-> this part3)) + (&+! (-> this part3) arg0) ) - (if (nonzero? (-> obj part-lightning-hit)) - (&+! (-> obj part-lightning-hit) arg0) + (if (nonzero? (-> this part-lightning-hit)) + (&+! (-> this part-lightning-hit) arg0) ) - (the-as grenade-point ((method-of-type process-drawable relocate) obj arg0)) + (the-as grenade-point ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type grenade-point -(defmethod deactivate grenade-point ((obj grenade-point)) - (if (nonzero? (-> obj part2)) - (kill-and-free-particles (-> obj part2)) +(defmethod deactivate grenade-point ((this grenade-point)) + (if (nonzero? (-> this part2)) + (kill-and-free-particles (-> this part2)) ) - (if (nonzero? (-> obj part3)) - (kill-and-free-particles (-> obj part3)) + (if (nonzero? (-> this part3)) + (kill-and-free-particles (-> this part3)) ) - (if (nonzero? (-> obj part-lightning-hit)) - (kill-and-free-particles (-> obj part-lightning-hit)) + (if (nonzero? (-> this part-lightning-hit)) + (kill-and-free-particles (-> this part-lightning-hit)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -858,11 +858,11 @@ This commonly includes things such as: (set-setting! 'entity-name (-> self camera-name) 0.0 -1) ) ) - ((>= (- (current-time) (-> self enter-time)) (seconds 3)) + ((time-elapsed? (-> self enter-time) (seconds 3)) (talker-speech-class-method-12 (-> *talker-speech* 194) 1) ) ) - (set! (-> self enter-time) (current-time)) + (set-time! (-> self enter-time)) ) #f ) @@ -969,23 +969,23 @@ This commonly includes things such as: ;; definition for method 11 of type grenade-point ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! grenade-point ((obj grenade-point) (arg0 entity-actor)) +(defmethod init-from-entity! grenade-point ((this grenade-point) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj parented?) #f) - (when (not (-> obj parented?)) + (set! (-> this parented?) #f) + (when (not (-> this parented?)) (let ((a1-1 (handle->process (-> *game-info* controller 0)))) (when a1-1 - (change-parent obj a1-1) - (set! (-> obj parented?) #t) + (change-parent this a1-1) + (set! (-> this parented?) #t) ) ) ) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((v1-10 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-10 prim-core collide-as) (collide-spec backgnd obstacle)) (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 81920.0) @@ -997,32 +997,32 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (set! (-> obj camera-name) (res-lump-struct (-> obj entity) 'camera-name string)) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 215) obj)) - (set! (-> obj part2) (create-launch-control (-> *part-group-id-table* 216) obj)) - (set! (-> obj part3) (create-launch-control (-> *part-group-id-table* 217) obj)) - (set! (-> obj part-lightning-hit) (create-launch-control (-> *part-group-id-table* 218) obj)) - (set! (-> obj lightning-time) 0) - (set! (-> obj strike-table) + (process-drawable-from-entity! this arg0) + (set! (-> this camera-name) (res-lump-struct (-> this entity) 'camera-name string)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 215) this)) + (set! (-> this part2) (create-launch-control (-> *part-group-id-table* 216) this)) + (set! (-> this part3) (create-launch-control (-> *part-group-id-table* 217) this)) + (set! (-> this part-lightning-hit) (create-launch-control (-> *part-group-id-table* 218) this)) + (set! (-> this lightning-time) 0) + (set! (-> this strike-table) (-> *grenade-point-strike-table* - (+ (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 1) :time -1000000000.0) -1) + (+ (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 1) :time -1000000000.0) -1) ) ) - (set! (-> obj last-strike-index) (rand-vu-int-range 0 19)) - (set! (-> obj speed) (res-lump-float (-> obj entity) 'speed :default 118784.0)) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "eco-plume1" :fo-min 5 :fo-max 90) (-> obj root trans)) + (set! (-> this last-strike-index) (rand-vu-int-range 0 19)) + (set! (-> this speed) (res-lump-float (-> this entity) 'speed :default 118784.0)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "eco-plume1" :fo-min 5 :fo-max 90) (-> this root trans)) ) - (update-transforms (-> obj root)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (if (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (update-transforms (-> this root)) + (logclear! (-> this mask) (process-mask actor-pause)) + (if (or (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) (task-complete? *game-info* (game-task strip-grenade)) ) - (go (method-of-object obj die) #f) - (go (method-of-object obj idle)) + (go (method-of-object this die) #f) + (go (method-of-object this idle)) ) (none) ) @@ -1044,19 +1044,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type grenade -(defmethod inspect grenade ((obj grenade)) - (when (not obj) - (set! obj obj) +(defmethod inspect grenade ((this grenade)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type projectile inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttumble-quat: #~%" (-> obj tumble-quat)) - (format #t "~2Tblast-radius: ~f~%" (-> obj blast-radius)) - (format #t "~2Tend-target: ~D~%" (-> obj end-target)) + (format #t "~2Ttumble-quat: #~%" (-> this tumble-quat)) + (format #t "~2Tblast-radius: ~f~%" (-> this blast-radius)) + (format #t "~2Tend-target: ~D~%" (-> this end-target)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1245,7 +1245,7 @@ This commonly includes things such as: ;; definition for method 24 of type grenade ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod draw-laser-sight grenade ((obj grenade)) +(defmethod draw-laser-sight grenade ((this grenade)) "TODO - confirm If applicable, draw the laser sight particles" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -1267,7 +1267,7 @@ This commonly includes things such as: (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -1288,9 +1288,9 @@ This commonly includes things such as: ;; definition for method 25 of type grenade ;; WARN: Return type mismatch int vs none. -(defmethod spawn-impact-particles grenade ((obj grenade)) +(defmethod spawn-impact-particles grenade ((this grenade)) "Spawns associated particles with the projectile if applicable" - ((method-of-type projectile spawn-impact-particles) obj) + ((method-of-type projectile spawn-impact-particles) this) (ja-post) 0 (none) @@ -1299,7 +1299,7 @@ This commonly includes things such as: ;; definition for method 26 of type grenade ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod spawn-shell-particles grenade ((obj grenade)) +(defmethod spawn-shell-particles grenade ((this grenade)) "TODO - confirm" (let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000))) (when gp-0 @@ -1321,7 +1321,7 @@ This commonly includes things such as: (t2-0 #f) (t3-0 *launch-matrix*) ) - (set! (-> t3-0 trans quad) (-> obj root trans quad)) + (set! (-> t3-0 trans quad) (-> this root trans quad)) ((the-as (function object object object object object object object object none) t9-2) a0-3 a1-2 @@ -1342,7 +1342,7 @@ This commonly includes things such as: ;; definition for method 28 of type grenade ;; WARN: Return type mismatch int vs none. -(defmethod play-impact-sound grenade ((obj grenade) (arg0 projectile-options)) +(defmethod play-impact-sound grenade ((this grenade) (arg0 projectile-options)) (let ((v1-0 arg0)) (cond ((zero? v1-0) @@ -1403,7 +1403,7 @@ This commonly includes things such as: (t9-0) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (send-event (handle->process (-> self end-target)) 'die) (remove-setting! 'point-of-interest) ) @@ -1445,43 +1445,43 @@ This commonly includes things such as: ;; definition for method 40 of type grenade ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod grenade-method-40 grenade ((obj grenade)) - (let ((s5-0 (the-as process-drawable (-> obj end-target process 0)))) +(defmethod grenade-method-40 grenade ((this grenade)) + (let ((s5-0 (the-as process-drawable (-> this end-target process 0)))) (when s5-0 - (set! (-> obj root transv x) (* 4.0 (- (-> s5-0 root trans x) (-> obj root trans x)))) - (set! (-> obj root transv z) (* 4.0 (- (-> s5-0 root trans z) (-> obj root trans z)))) - (let ((v1-12 (-> obj root transv))) + (set! (-> this root transv x) (* 4.0 (- (-> s5-0 root trans x) (-> this root trans x)))) + (set! (-> this root transv z) (* 4.0 (- (-> s5-0 root trans z) (-> this root trans z)))) + (let ((v1-12 (-> this root transv))) (if (< (sqrtf (+ (* (-> v1-12 x) (-> v1-12 x)) (* (-> v1-12 z) (-> v1-12 z)))) 16384.0) - (vector-xz-normalize! (-> obj root transv) 16384.0) + (vector-xz-normalize! (-> this root transv) 16384.0) ) ) - (if (or (logtest? (-> obj root status) (collide-status on-surface on-ground)) - (< (vector-vector-distance (-> s5-0 root trans) (-> obj root trans)) 4096.0) + (if (or (logtest? (-> this root status) (collide-status on-surface on-ground)) + (< (vector-vector-distance (-> s5-0 root trans) (-> this root trans)) 4096.0) ) - (go (method-of-object obj impact)) + (go (method-of-object this impact)) ) ) ) - (vector-v++! (-> obj root transv) (compute-acc-due-to-gravity (-> obj root) (new-stack-vector0) 1.0)) + (vector-v++! (-> this root transv) (compute-acc-due-to-gravity (-> this root) (new-stack-vector0) 1.0)) 0 (none) ) ;; definition for method 41 of type grenade ;; WARN: Return type mismatch int vs none. -(defmethod grenade-method-41 grenade ((obj grenade)) - (quaternion*! (-> obj root quat) (-> obj root quat) (-> obj tumble-quat)) - (projectile-move-fill-all-dirs obj) - (set-setting! 'point-of-interest 'abs (-> obj root trans) 0) +(defmethod grenade-method-41 grenade ((this grenade)) + (quaternion*! (-> this root quat) (-> this root quat) (-> this tumble-quat)) + (projectile-move-fill-all-dirs this) + (set-setting! 'point-of-interest 'abs (-> this root trans) 0) 0 (none) ) ;; definition for method 30 of type grenade ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-proj-collision! grenade ((obj grenade)) +(defmethod init-proj-collision! grenade ((this grenade)) "Init the [[projectile]]'s [[collide-shape]]" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-projectile) (set! (-> s5-0 no-reaction) @@ -1505,49 +1505,49 @@ This commonly includes things such as: ) (set! (-> s5-0 max-iteration-count) (the-as uint 2)) (set! (-> s5-0 event-self) 'touched) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; definition for method 31 of type grenade -(defmethod init-proj-settings! grenade ((obj grenade)) +(defmethod init-proj-settings! grenade ((this grenade)) "Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc" (with-pp (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-grenade" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logclear! (-> obj options) (projectile-options proj-options-4)) - (vector-normalize! (-> obj root transv) 1.0) - (+! (-> obj root transv y) 1.0) - (vector-normalize! (-> obj root transv) 184320.0) - (set! (-> obj attack-mode) 'eco-yellow) - (set! (-> obj blast-radius) 20480.0) - (set! (-> obj max-speed) 184320.0) - (set! (-> obj timeout) (seconds 3.6)) - (set! (-> obj update-velocity) (method-of-object obj grenade-method-40)) - (set! (-> obj move) (method-of-object obj grenade-method-41)) - (set! (-> obj root dynam gravity y) 327680.0) - (set! (-> obj root dynam gravity-length) 327680.0) - (set! (-> obj root dynam gravity-max) 327680.0) + (logclear! (-> this options) (projectile-options proj-options-4)) + (vector-normalize! (-> this root transv) 1.0) + (+! (-> this root transv y) 1.0) + (vector-normalize! (-> this root transv) 184320.0) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this blast-radius) 20480.0) + (set! (-> this max-speed) 184320.0) + (set! (-> this timeout) (seconds 3.6)) + (set! (-> this update-velocity) (method-of-object this grenade-method-40)) + (set! (-> this move) (method-of-object this grenade-method-41)) + (set! (-> this root dynam gravity y) 327680.0) + (set! (-> this root dynam gravity-length) 327680.0) + (set! (-> this root dynam gravity-max) 327680.0) (let ((f0-7 1092.2667)) - (quaternion-axis-angle! (-> obj tumble-quat) 1.0 0.0 0.0 f0-7) + (quaternion-axis-angle! (-> this tumble-quat) 1.0 0.0 0.0 f0-7) ) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) (process->ppointer pp)) (set! (-> a1-5 num-params) 0) (set! (-> a1-5 message) 'target) - (let ((s5-1 (send-event-function (ppointer->process (-> obj parent)) a1-5))) - (set! (-> obj end-target) (process->handle (if (type? s5-1 process-drawable) - (the-as process-drawable s5-1) - ) - ) + (let ((s5-1 (send-event-function (ppointer->process (-> this parent)) a1-5))) + (set! (-> this end-target) (process->handle (if (type? s5-1 process-drawable) + (the-as process-drawable s5-1) + ) + ) ) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 235) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 235) this)) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) (none) ) @@ -1614,11 +1614,11 @@ This commonly includes things such as: (lambda :behavior task-manager () (local-vars (sv-16 object)) - (set! (-> self start-time) (current-time)) + (set-time! (-> self start-time)) (set! (-> self total-time) (seconds 120)) (set! (-> self hud-timer) (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :to *target*))) (set! (-> self hud-counter) (ppointer->handle (process-spawn hud-plasmite :init hud-init-by-other :to self))) - (while (or (< (- (current-time) (-> self start-time)) (-> self total-time)) + (while (or (not (time-elapsed? (-> self start-time) (-> self total-time))) (and *target* (focus-test? *target* in-air)) ) (let ((v1-18 (the-as int (- (-> self total-time) (- (current-time) (-> self start-time)))))) @@ -1674,7 +1674,7 @@ This commonly includes things such as: (talker-spawn-func (-> *talker-speech* 195) *entity-pool* (target-pos 0) (the-as region #f)) ) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> *game-info* counter) (the float (the-as int sv-16))) (if (>= 1 (the-as int sv-16)) (gui-control-method-12 @@ -1723,34 +1723,34 @@ This commonly includes things such as: ) ;; definition for method 3 of type drill-plat -(defmethod inspect drill-plat ((obj drill-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect drill-plat ((this drill-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type strip-hazard inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tplat-sound: ~A~%" (-> obj plat-sound)) + (format #t "~2Tplat-sound: ~A~%" (-> this plat-sound)) (label cfg-4) - obj + this ) ;; definition for method 7 of type drill-plat ;; WARN: Return type mismatch process-drawable vs drill-plat. -(defmethod relocate drill-plat ((obj drill-plat) (arg0 int)) - (if (nonzero? (-> obj plat-sound)) - (&+! (-> obj plat-sound) arg0) +(defmethod relocate drill-plat ((this drill-plat) (arg0 int)) + (if (nonzero? (-> this plat-sound)) + (&+! (-> this plat-sound) arg0) ) - (the-as drill-plat ((method-of-type process-drawable relocate) obj arg0)) + (the-as drill-plat ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type drill-plat -(defmethod deactivate drill-plat ((obj drill-plat)) - (if (nonzero? (-> obj plat-sound)) - (stop! (-> obj plat-sound)) +(defmethod deactivate drill-plat ((this drill-plat)) + (if (nonzero? (-> this plat-sound)) + (stop! (-> this plat-sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -1819,14 +1819,14 @@ This commonly includes things such as: ;; definition for method 11 of type drill-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! drill-plat ((obj drill-plat) (arg0 entity-actor)) +(defmethod init-from-entity! drill-plat ((this drill-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -1868,32 +1868,32 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-drill-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((t9-10 (method-of-type strip-hazard init-from-entity!))) - (t9-10 obj arg0) + (t9-10 this arg0) ) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this mask) (process-mask actor-pause)) (let ((a3-5 (new 'stack-no-clear 'vector))) - (set! (-> a3-5 quad) (-> obj root trans quad)) + (set! (-> a3-5 quad) (-> this root trans quad)) (+! (-> a3-5 x) 57344.0) - (set! (-> obj sound) (new 'process 'ambient-sound (static-sound-spec "drill-plat-a" :fo-max 90) a3-5)) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "drill-plat-a" :fo-max 90) a3-5)) ) (ja-post) - (set! (-> obj plat-sound) (new - 'process - 'ambient-sound - (static-sound-spec "drill-plat-b" :fo-max 50) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 7)) - ) + (set! (-> this plat-sound) (new + 'process + 'ambient-sound + (static-sound-spec "drill-plat-b" :fo-max 50) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 7)) + ) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/strip/strip-part_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-part_REF.gc index d40af6f495..40aeae604b 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type strip-part -(defmethod inspect strip-part ((obj strip-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect strip-part ((this strip-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc b/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc index ae39e0ccf5..f09e1add29 100644 --- a/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc +++ b/test/decompiler/reference/jak2/levels/strip/strip-rescue_REF.gc @@ -23,17 +23,17 @@ ) ;; definition for method 3 of type cntrlrm-door -(defmethod inspect cntrlrm-door ((obj cntrlrm-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect cntrlrm-door ((this cntrlrm-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Troot: #~%" (-> obj root)) + (format #t "~2Troot: #~%" (-> this root)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -63,14 +63,14 @@ ;; definition for method 11 of type cntrlrm-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cntrlrm-door ((obj cntrlrm-door) (arg0 entity-actor)) +(defmethod init-from-entity! cntrlrm-door ((this cntrlrm-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) (set! (-> s4-0 total-prims) (the-as uint 4)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -106,17 +106,17 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cntrlrm-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (if (task-node-closed? (game-task-node strip-rescue-resolution)) - (go (method-of-object obj opened)) - (go (method-of-object obj idle)) + (go (method-of-object this opened)) + (go (method-of-object this idle)) ) (none) ) @@ -142,17 +142,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type cntrlrm-button -(defmethod inspect cntrlrm-button ((obj cntrlrm-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect cntrlrm-button ((this cntrlrm-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Troot: #~%" (-> obj root)) + (format #t "~2Troot: #~%" (-> this root)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -169,14 +169,14 @@ This commonly includes things such as: ;; definition for method 11 of type cntrlrm-button ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cntrlrm-button ((obj cntrlrm-button) (arg0 entity-actor)) +(defmethod init-from-entity! cntrlrm-button ((this cntrlrm-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -205,14 +205,14 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-cntrlrm-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc index 2d1f059a2a..179481488c 100644 --- a/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/title/title-obs_REF.gc @@ -30,54 +30,54 @@ ) ;; definition for method 3 of type title-control -(defmethod inspect title-control ((obj title-control)) - (when (not obj) - (set! obj obj) +(defmethod inspect title-control ((this title-control)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tselected: ~D~%" (-> obj selected)) - (format #t "~2Tsprites[2] @ #x~X~%" (-> obj sprites)) - (format #t "~2Tsprite-pos: ~`vector`P~%" (-> obj sprite-pos)) - (format #t "~2Tsprite-draw: ~D~%" (-> obj sprite-draw)) - (format #t "~2Tbuffer[2] @ #x~X~%" (-> obj buffer)) + (format #t "~2Tselected: ~D~%" (-> this selected)) + (format #t "~2Tsprites[2] @ #x~X~%" (-> this sprites)) + (format #t "~2Tsprite-pos: ~`vector`P~%" (-> this sprite-pos)) + (format #t "~2Tsprite-draw: ~D~%" (-> this sprite-draw)) + (format #t "~2Tbuffer[2] @ #x~X~%" (-> this buffer)) (dotimes (s5-0 2) - (format #t "~T [~D]~2Tbuffer: ~A~%" s5-0 (-> obj buffer s5-0)) + (format #t "~T [~D]~2Tbuffer: ~A~%" s5-0 (-> this buffer s5-0)) ) - (format #t "~2Twant[2] @ #x~X~%" (-> obj want)) - (format #t "~2Twant-name[2] @ #x~X~%" (-> obj want-name)) - (format #t "~2Thave[2] @ #x~X~%" (-> obj have)) - (format #t "~2Tdraw: ~D~%" (-> obj draw)) - (format #t "~2Tdraw-name: ~A~%" (-> obj draw-name)) - (format #t "~2Tactive: ~A~%" (-> obj active)) - (format #t "~2Tspark-time: ~D~%" (-> obj spark-time)) - (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) + (format #t "~2Twant[2] @ #x~X~%" (-> this want)) + (format #t "~2Twant-name[2] @ #x~X~%" (-> this want-name)) + (format #t "~2Thave[2] @ #x~X~%" (-> this have)) + (format #t "~2Tdraw: ~D~%" (-> this draw)) + (format #t "~2Tdraw-name: ~A~%" (-> this draw-name)) + (format #t "~2Tactive: ~A~%" (-> this active)) + (format #t "~2Tspark-time: ~D~%" (-> this spark-time)) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) (label cfg-7) - obj + this ) ;; definition for method 7 of type title-control ;; WARN: Return type mismatch process vs title-control. -(defmethod relocate title-control ((obj title-control) (arg0 int)) +(defmethod relocate title-control ((this title-control) (arg0 int)) (dotimes (v1-0 2) - (if (nonzero? (-> obj buffer v1-0)) - (&+! (-> obj buffer v1-0) arg0) + (if (nonzero? (-> this buffer v1-0)) + (&+! (-> this buffer v1-0) arg0) ) ) - (the-as title-control ((method-of-type process relocate) obj arg0)) + (the-as title-control ((method-of-type process relocate) this arg0)) ) ;; definition for method 10 of type title-control -(defmethod deactivate title-control ((obj title-control)) +(defmethod deactivate title-control ((this title-control)) (dotimes (s5-0 2) - (set-pending-file (-> obj buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) + (set-pending-file (-> this buffer s5-0) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) (dotimes (s5-1 2) - (update (-> obj buffer s5-1)) + (update (-> this buffer s5-1)) ) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -510,7 +510,7 @@ (let ((s3-0 (current-time)) (s4-0 #f) ) - (while (not (or (>= (- (current-time) s3-0) arg1) (and (>= (- (current-time) s3-0) arg0) s4-0))) + (while (not (or (time-elapsed? s3-0 arg1) (and (time-elapsed? s3-0 arg0) s4-0))) (if (cpad-pressed? 0 confirm) (set! s4-0 #t) ) @@ -592,7 +592,7 @@ (defun title-fade-out ((arg0 float)) (setup *screen-filter* (new 'static 'vector) (new 'static 'vector :w 128.0) arg0 (bucket-id screen-filter)) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.4)) + (until (time-elapsed? gp-0 (seconds 0.4)) (suspend) ) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc b/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc index 7862d9f75b..08bfdf97ac 100644 --- a/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/monster-frog_REF.gc @@ -24,16 +24,16 @@ ) ;; definition for method 3 of type monster-frog -(defmethod inspect monster-frog ((obj monster-frog)) - (when (not obj) - (set! obj obj) +(defmethod inspect monster-frog ((this monster-frog)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol *monster-frog-nav-enemy-info*, type nav-enemy-info @@ -486,7 +486,7 @@ (if (and (logtest? (-> self enemy-flags) (enemy-flag look-at-focus)) (-> self enemy-info use-victory)) (go-virtual victory) ) - (when (>= (- (current-time) (-> self state-time)) (-> self reaction-time)) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) (if (nav-enemy-method-163 self) (go-stare2 self) ) @@ -658,7 +658,7 @@ :virtual #t :event enemy-event-handler :enter (behavior ((arg0 vector)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (if (not (logtest? (enemy-flag enemy-flag36) (-> v1-2 enemy-flags))) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag enemy-flag38) (-> v1-2 enemy-flags)))) @@ -771,58 +771,58 @@ ) ;; definition for method 77 of type monster-frog -(defmethod enemy-method-77 monster-frog ((obj monster-frog) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-77 monster-frog ((this monster-frog) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 0) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 26))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 26))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 26)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 26)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 26)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 26)) num-func-seek!) ) #t ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 0) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) (-> arg0 0)) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) (else (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-0)) (ja-channel-push! 1 0) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 30))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 30))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 30)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 30)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) (-> arg0 0)) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 30)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 30)) num-func-seek!) ) ) (else (ja-channel-push! 1 0) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 32))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 32))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 32)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 32)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) (-> arg0 0)) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 32)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 32)) num-func-seek!) ) ) ) @@ -832,58 +832,58 @@ ) ;; definition for method 78 of type monster-frog -(defmethod enemy-method-78 monster-frog ((obj monster-frog) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 monster-frog ((this monster-frog) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-4)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-3 (-> obj skel root-channel 0))) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 27))) + (let ((a0-3 (-> this skel root-channel 0))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 27))) (set! (-> a0-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 27)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 27)) frames num-frames) -1)) ) (set! (-> a0-3 param 1) (-> arg0 0)) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> obj draw art-group data 27)) num-func-seek!) + (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> this draw art-group data 27)) num-func-seek!) ) #t ) (((knocked-type knocked-type-6)) (ja-channel-push! 1 (seconds 0.17)) - (let ((a0-6 (-> obj skel root-channel 0))) - (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 23))) + (let ((a0-6 (-> this skel root-channel 0))) + (set! (-> a0-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 23))) (set! (-> a0-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 23)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 23)) frames num-frames) -1)) ) (set! (-> a0-6 param 1) (-> arg0 0)) (set! (-> a0-6 frame-num) 0.0) - (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> obj draw art-group data 23)) num-func-seek!) + (joint-control-channel-group! a0-6 (the-as art-joint-anim (-> this draw art-group data 23)) num-func-seek!) ) #t ) (else (cond - ((= (-> obj incoming knocked-type) (knocked-type knocked-type-0)) + ((= (-> this incoming knocked-type) (knocked-type knocked-type-0)) (ja-channel-push! 1 0) - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 31))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 31))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 31)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 31)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) (-> arg0 0)) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 31)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 31)) num-func-seek!) ) ) (else (ja-channel-push! 1 0) - (let ((a0-10 (-> obj skel root-channel 0))) - (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> obj draw art-group data 33))) + (let ((a0-10 (-> this skel root-channel 0))) + (set! (-> a0-10 frame-group) (the-as art-joint-anim (-> this draw art-group data 33))) (set! (-> a0-10 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 33)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 33)) frames num-frames) -1)) ) (set! (-> a0-10 param 1) (-> arg0 0)) (set! (-> a0-10 frame-num) 0.0) - (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> obj draw art-group data 33)) num-func-seek!) + (joint-control-channel-group! a0-10 (the-as art-joint-anim (-> this draw art-group data 33)) num-func-seek!) ) ) ) @@ -893,21 +893,21 @@ ) ;; definition for method 55 of type monster-frog -(defmethod track-target! monster-frog ((obj monster-frog)) +(defmethod track-target! monster-frog ((this monster-frog)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (water-control-method-10 (-> obj water)) - ((method-of-type nav-enemy track-target!) obj) + (water-control-method-10 (-> this water)) + ((method-of-type nav-enemy track-target!) this) (none) ) ;; definition for method 114 of type monster-frog ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! monster-frog ((obj monster-frog)) +(defmethod init-enemy-collision! monster-frog ((this monster-frog)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -962,7 +962,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -970,21 +970,21 @@ ;; definition for method 115 of type monster-frog ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! monster-frog ((obj monster-frog)) +(defmethod init-enemy! monster-frog ((this monster-frog)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-monster-frog" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *monster-frog-nav-enemy-info*) - (set! (-> obj water) (new 'process 'water-control obj 5 0.0 8192.0 2048.0)) - (set! (-> obj water flags) + (init-enemy-behaviour-and-stats! this *monster-frog-nav-enemy-info*) + (set! (-> this water) (new 'process 'water-control this 5 0.0 8192.0 2048.0)) + (set! (-> this water flags) (water-flags active use-water-anim touch-water part-splash part-drip part-rings part-water find-water) ) - (set! (-> obj water height) (res-lump-float (-> obj entity) 'water-height)) - (set! (-> obj water ripple-size) 12288.0) - (set! (-> obj water wake-size) 6144.0) + (set! (-> this water height) (res-lump-float (-> this entity) 'water-height)) + (set! (-> this water ripple-size) 12288.0) + (set! (-> this water wake-size) 6144.0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc b/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc index 758f267bcd..1677029a61 100644 --- a/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/target-indax_REF.gc @@ -13,17 +13,17 @@ ) ;; definition for method 3 of type indax-info -(defmethod inspect indax-info ((obj indax-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect indax-info ((this indax-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tindax-start-time: ~D~%" (-> obj indax-start-time)) - (format #t "~1Tindax-time: ~D~%" (-> obj indax-time)) - (format #t "~1Tart-group-backup: ~A~%" (-> obj art-group-backup)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tindax-start-time: ~D~%" (-> this indax-start-time)) + (format #t "~1Tindax-time: ~D~%" (-> this indax-time)) + (format #t "~1Tart-group-backup: ~A~%" (-> this art-group-backup)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -269,7 +269,7 @@ (set! (-> self control bend-target) 0.0) (target-collide-set! 'indax 0.0) (set! (-> self fact health) (-> self fact health-max)) - (set! (-> self indax indax-start-time) (current-time)) + (set-time! (-> self indax indax-start-time)) (set! (-> self indax art-group-backup) (-> self draw art-group)) (set! (-> self draw art-group) (-> self sidekick 0 draw art-group)) (logior! (-> self draw status) (draw-control-status no-draw-bounds2)) @@ -563,7 +563,7 @@ (defstate target-indax-walk (target) :event target-indax-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self control mod-surface) *indax-walk-mods*) ) :exit (behavior () @@ -668,12 +668,12 @@ (suspend) (let ((f26-1 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 16384.0 32768.0))) (cond - ((>= (- (current-time) gp-0) (seconds 5)) + ((time-elapsed? gp-0 (seconds 5)) (set! gp-0 (current-time)) ) - ((>= (- (current-time) gp-0) (seconds 2.5)) + ((time-elapsed? gp-0 (seconds 2.5)) ) - ((>= (- (current-time) gp-0) (seconds 1)) + ((time-elapsed? gp-0 (seconds 1)) (set! f28-0 (seek f28-0 1.0 (* 2.0 (seconds-per-frame)))) ) (else @@ -865,7 +865,7 @@ (defstate target-indax-double-jump (target) :event target-indax-jump-event-handler :enter (behavior ((arg0 float) (arg1 float)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (init-var-jump arg0 arg1 #t #t (-> self control transv) 2.0) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) (if (!= (-> self control mod-surface) *slide-jump-mods*) @@ -987,7 +987,7 @@ (defstate target-indax-trip (target) :event target-indax-jump-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "jump" :vol 70) (logclear! (-> self control status) (collide-status on-surface on-ground touch-surface)) ) @@ -1137,13 +1137,11 @@ (cond ((and (>= (ja-aframe-num 0) 20.0) (and (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) - (>= (- (current-time) (-> self control sliding-start-time)) (seconds 0.04)) + (time-elapsed? (-> self control sliding-start-time) (seconds 0.04)) ) ) (go target-indax-falling #f) @@ -1153,12 +1151,12 @@ (set-forward-vel (the-as float f26-0)) ) ((and (nonzero? (-> self control unknown-time-frame18)) - (>= (- (current-time) (-> self control unknown-time-frame18)) (seconds 0.04)) + (time-elapsed? (-> self control unknown-time-frame18) (seconds 0.04)) ) (set-forward-vel 0.0) ) ((and (not (cpad-hold? (-> self control cpad number) square)) - (>= (- (current-time) (-> self control unknown-combo-tracker00 move-start-time)) (seconds 0.05)) + (time-elapsed? (-> self control unknown-combo-tracker00 move-start-time) (seconds 0.05)) ) (if (= (-> self control ground-pat material) (pat-material ice)) (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control ctrl-xz-vel)))) @@ -1188,7 +1186,7 @@ ) (suspend) (ja :num! (seek! max (* (-> self control current-surface align-speed) f28-0))) - (if (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (if (time-elapsed? (-> self state-time) (seconds 0.1)) (set! (-> *run-attack-mods* turnvv) 0.0) ) (if (< 2 gp-2) @@ -1198,9 +1196,7 @@ ) ) (if (and (not (logtest? (-> self control status) (collide-status on-surface))) - (>= (- (current-time) (-> self control last-time-on-surface)) - (the-as time-frame (-> *TARGET-bank* ground-timeout)) - ) + (time-elapsed? (-> self control last-time-on-surface) (the-as time-frame (-> *TARGET-bank* ground-timeout))) (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) (>= (target-height-above-ground) (-> *TARGET-bank* fall-height)) ) @@ -1252,7 +1248,7 @@ ) :code (behavior ((arg0 symbol) (arg1 attack-info)) (logclear! (-> self water flags) (water-flags jump-out)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self neck flex-blend) 0.0) (let ((gp-0 (-> self attack-info))) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1300,7 +1296,7 @@ (cond ((= arg0 'attack) (logior! (-> self focus-status) (focus-status hit)) - (set! (-> self game hit-time) (current-time)) + (set-time! (-> self game hit-time)) (case (-> gp-0 mode) (('endlessfall) (cond @@ -1309,7 +1305,7 @@ (set! (-> s4-1 quad) (-> self control last-trans-on-ground quad)) (ja-channel-set! 0) (let ((s3-1 (current-time))) - (until (>= (- (current-time) s3-1) (seconds 1)) + (until (time-elapsed? s3-1 (seconds 1)) (suspend) ) ) @@ -1467,7 +1463,7 @@ ) (set! (-> self control transv quad) (the-as uint128 0)) (initialize! (-> self game) 'life (the-as game-save #f) (the-as string #f)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sleep-code) ) :post target-no-stick-post diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc index c75cadc3a7..248abaf000 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-baby-spider_REF.gc @@ -15,16 +15,16 @@ ) ;; definition for method 3 of type tomb-baby-spider -(defmethod inspect tomb-baby-spider ((obj tomb-baby-spider)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-baby-spider ((this tomb-baby-spider)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -410,7 +410,7 @@ :num! (loop! f30-2) :frame-num 0.0 ) - (until (>= (- (current-time) gp-3) s5-1) + (until (time-elapsed? gp-3 s5-1) (suspend) (ja :num! (loop! f30-2)) ) @@ -447,8 +447,8 @@ ) ;; definition for method 77 of type tomb-baby-spider -(defmethod enemy-method-77 tomb-baby-spider ((obj tomb-baby-spider) (arg0 (pointer float))) - (let* ((a2-0 (the-as collide-shape-prim-group (-> obj root root-prim))) +(defmethod enemy-method-77 tomb-baby-spider ((this tomb-baby-spider) (arg0 (pointer float))) + (let* ((a2-0 (the-as collide-shape-prim-group (-> this root root-prim))) (v1-2 (-> a2-0 child 3)) ) (dotimes (a3-0 3) @@ -460,121 +460,121 @@ (collide-spec backgnd jak bot crate obstacle player-list blocking-plane pusher) ) ) - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (let ((v1-6 (-> obj skel root-channel 0))) - (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> obj draw art-group data 20))) + (let ((v1-6 (-> this skel root-channel 0))) + (set! (-> v1-6 frame-group) (the-as art-joint-anim (-> this draw art-group data 20))) (set! (-> v1-6 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 20)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 20)) frames num-frames) -1)) ) (set! (-> v1-6 param 1) (-> arg0 0)) (set! (-> v1-6 frame-num) 0.0) - (joint-control-channel-group! v1-6 (the-as art-joint-anim (-> obj draw art-group data 20)) num-func-seek!) + (joint-control-channel-group! v1-6 (the-as art-joint-anim (-> this draw art-group data 20)) num-func-seek!) ) #t ) (((knocked-type knocked-type-2) (knocked-type knocked-type-5)) - (let ((v1-11 (-> obj skel root-channel 0))) - (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> obj draw art-group data 17))) + (let ((v1-11 (-> this skel root-channel 0))) + (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> this draw art-group data 17))) (set! (-> v1-11 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 17)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 17)) frames num-frames) -1)) ) (set! (-> v1-11 param 1) (-> arg0 0)) (set! (-> v1-11 frame-num) 0.0) - (joint-control-channel-group! v1-11 (the-as art-joint-anim (-> obj draw art-group data 17)) num-func-seek!) + (joint-control-channel-group! v1-11 (the-as art-joint-anim (-> this draw art-group data 17)) num-func-seek!) ) #t ) (else - ((method-of-type nav-enemy enemy-method-77) obj arg0) + ((method-of-type nav-enemy enemy-method-77) this arg0) ) ) ) ;; definition for method 78 of type tomb-baby-spider -(defmethod enemy-method-78 tomb-baby-spider ((obj tomb-baby-spider) (arg0 (pointer float))) - (case (-> obj incoming knocked-type) +(defmethod enemy-method-78 tomb-baby-spider ((this tomb-baby-spider) (arg0 (pointer float))) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) - (let ((v1-3 (-> obj skel root-channel 0))) - (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) + (let ((v1-3 (-> this skel root-channel 0))) + (set! (-> v1-3 frame-group) (the-as art-joint-anim (-> this draw art-group data 22))) (set! (-> v1-3 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 22)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 22)) frames num-frames) -1)) ) (set! (-> v1-3 param 1) (-> arg0 0)) (set! (-> v1-3 frame-num) 0.0) - (joint-control-channel-group! v1-3 (the-as art-joint-anim (-> obj draw art-group data 22)) num-func-seek!) + (joint-control-channel-group! v1-3 (the-as art-joint-anim (-> this draw art-group data 22)) num-func-seek!) ) #t ) (((knocked-type knocked-type-2) (knocked-type knocked-type-5)) - (let ((v1-8 (-> obj skel root-channel 0))) - (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 18))) + (let ((v1-8 (-> this skel root-channel 0))) + (set! (-> v1-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 18))) (set! (-> v1-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 18)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 18)) frames num-frames) -1)) ) (set! (-> v1-8 param 1) (-> arg0 0)) (set! (-> v1-8 frame-num) 0.0) - (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> obj draw art-group data 18)) num-func-seek!) + (joint-control-channel-group! v1-8 (the-as art-joint-anim (-> this draw art-group data 18)) num-func-seek!) ) #t ) (else - ((method-of-type nav-enemy enemy-method-78) obj arg0) + ((method-of-type nav-enemy enemy-method-78) this arg0) ) ) ) ;; definition for method 79 of type tomb-baby-spider -(defmethod enemy-method-79 tomb-baby-spider ((obj tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info)) +(defmethod enemy-method-79 tomb-baby-spider ((this tomb-baby-spider) (arg0 int) (arg1 enemy-knocked-info)) (case arg0 ((3) (let ((s4-0 (ja-done? 0))) - (let ((a0-3 (-> obj skel root-channel 0))) + (let ((a0-3 (-> this skel root-channel 0))) (set! (-> a0-3 param 0) (the float (+ (-> a0-3 frame-group frames num-frames) -1))) (set! (-> a0-3 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-3 (the-as art-joint-anim #f) num-func-seek!) ) (when s4-0 - (case (-> obj incoming knocked-type) + (case (-> this incoming knocked-type) (((knocked-type knocked-type-6)) ) (((knocked-type knocked-type-2) (knocked-type knocked-type-5)) - (let ((a0-7 (-> obj skel root-channel 0))) - (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> obj draw art-group data 19))) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim (-> this draw art-group data 19))) (set! (-> a0-7 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 19)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 19)) frames num-frames) -1)) ) (set! (-> a0-7 param 1) (-> arg1 anim-speed)) (set! (-> a0-7 frame-num) 0.0) - (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> obj draw art-group data 19)) num-func-seek!) + (joint-control-channel-group! a0-7 (the-as art-joint-anim (-> this draw art-group data 19)) num-func-seek!) ) ) (else - (let ((a0-8 (-> obj skel root-channel 0))) - (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> obj draw art-group data 16))) + (let ((a0-8 (-> this skel root-channel 0))) + (set! (-> a0-8 frame-group) (the-as art-joint-anim (-> this draw art-group data 16))) (set! (-> a0-8 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 16)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 16)) frames num-frames) -1)) ) (set! (-> a0-8 param 1) (-> arg1 anim-speed)) (set! (-> a0-8 frame-num) 0.0) - (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> obj draw art-group data 16)) num-func-seek!) + (joint-control-channel-group! a0-8 (the-as art-joint-anim (-> this draw art-group data 16)) num-func-seek!) ) ) ) - (vector-reset! (-> obj root transv)) + (vector-reset! (-> this root transv)) #t ) ) ) ((4) (let ((s4-1 (ja-done? 0))) - (let ((a0-11 (-> obj skel root-channel 0))) + (let ((a0-11 (-> this skel root-channel 0))) (set! (-> a0-11 param 0) (the float (+ (-> a0-11 frame-group frames num-frames) -1))) (set! (-> a0-11 param 1) (-> arg1 anim-speed)) (joint-control-channel-group-eval! a0-11 (the-as art-joint-anim #f) num-func-seek!) ) (when s4-1 - (let ((v1-50 (-> obj root root-prim))) + (let ((v1-50 (-> this root root-prim))) (set! (-> (the-as collide-shape-prim-group v1-50) child 0 local-sphere w) 1638.4) (set! (-> (the-as collide-shape-prim-group v1-50) child 1 local-sphere w) 1638.4) (set! (-> (the-as collide-shape-prim-group v1-50) child 2 local-sphere w) 3276.8) @@ -587,13 +587,13 @@ ) ) (else - ((method-of-type nav-enemy enemy-method-79) obj arg0 arg1) + ((method-of-type nav-enemy enemy-method-79) this arg0 arg1) ) ) ) ;; definition for method 104 of type tomb-baby-spider -(defmethod enemy-method-104 tomb-baby-spider ((obj tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) +(defmethod enemy-method-104 tomb-baby-spider ((this tomb-baby-spider) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) (let* ((s1-0 arg0) (s2-0 (if (type? s1-0 process-focusable) s1-0 @@ -614,15 +614,15 @@ 'attack arg1 (static-attack-info ((id arg2) - (shove-back (* f0-0 (-> obj enemy-info attack-shove-back))) - (shove-up (* f0-0 (-> obj enemy-info attack-shove-up))) - (mode (-> obj enemy-info attack-mode)) - (damage (the float (-> obj enemy-info attack-damage))) + (shove-back (* f0-0 (-> this enemy-info attack-shove-back))) + (shove-up (* f0-0 (-> this enemy-info attack-shove-up))) + (mode (-> this enemy-info attack-mode)) + (damage (the float (-> this enemy-info attack-damage))) (knock (the-as uint 8)) ) ) ) - (enemy-method-105 obj arg0) + (enemy-method-105 this arg0) #t ) ) @@ -630,9 +630,9 @@ ;; definition for method 114 of type tomb-baby-spider ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! tomb-baby-spider ((obj tomb-baby-spider)) +(defmethod init-enemy-collision! tomb-baby-spider ((this tomb-baby-spider)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -698,21 +698,21 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) ) ;; definition for method 115 of type tomb-baby-spider -(defmethod init-enemy! tomb-baby-spider ((obj tomb-baby-spider)) +(defmethod init-enemy! tomb-baby-spider ((this tomb-baby-spider)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-baby-spider" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *tomb-baby-spider-nav-enemy-info*) + (init-enemy-behaviour-and-stats! this *tomb-baby-spider-nav-enemy-info*) (none) ) @@ -726,16 +726,16 @@ ) ;; definition for method 3 of type dig-spider -(defmethod inspect dig-spider ((obj dig-spider)) - (when (not obj) - (set! obj obj) +(defmethod inspect dig-spider ((this dig-spider)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type tomb-baby-spider inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 30dee5b930..64ca82bf4c 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-beetle_REF.gc @@ -21,18 +21,18 @@ ) ;; definition for method 3 of type tomb-beetle-fly-info -(defmethod inspect tomb-beetle-fly-info ((obj tomb-beetle-fly-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-beetle-fly-info ((this tomb-beetle-fly-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tomb-beetle-fly-info) - (format #t "~1Tdst: #~%" (-> obj dst)) - (format #t "~1Tdst-quat: #~%" (-> obj dst-quat)) - (format #t "~1Tdist: (meters ~m)~%" (-> obj dist)) - (format #t "~1Tthreshold: (meters ~m)~%" (-> obj threshold)) + (format #t "[~8x] ~A~%" this 'tomb-beetle-fly-info) + (format #t "~1Tdst: #~%" (-> this dst)) + (format #t "~1Tdst-quat: #~%" (-> this dst-quat)) + (format #t "~1Tdist: (meters ~m)~%" (-> this dist)) + (format #t "~1Tthreshold: (meters ~m)~%" (-> this threshold)) (label cfg-4) - obj + this ) ;; definition of type tomb-beetle @@ -68,29 +68,29 @@ ) ;; definition for method 3 of type tomb-beetle -(defmethod inspect tomb-beetle ((obj tomb-beetle)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-beetle ((this tomb-beetle)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsrc-quat: #~%" (-> obj src-quat)) - (format #t "~2Tfly-info[2] @ #x~X~%" (-> obj fly-info)) - (format #t "~2Tspeed: (meters ~m)~%" (-> obj speed)) - (format #t "~2Tinit-height: (meters ~m)~%" (-> obj init-height)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tdest-index: ~D~%" (-> obj dest-index)) - (format #t "~2Tround: ~D~%" (-> obj round)) - (format #t "~2Tflying?: ~A~%" (-> obj flying?)) - (format #t "~2Tfly-away-radius: ~f~%" (-> obj fly-away-radius)) - (format #t "~2Tfly-away-ry: ~f~%" (-> obj fly-away-ry)) - (format #t "~2Tfly-away-ry-speed: ~f~%" (-> obj fly-away-ry-speed)) - (format #t "~2Tfly-away-acc: ~f~%" (-> obj fly-away-acc)) - (format #t "~2Tfly-away-dir: #~%" (-> obj fly-away-dir)) + (format #t "~2Tsrc-quat: #~%" (-> this src-quat)) + (format #t "~2Tfly-info[2] @ #x~X~%" (-> this fly-info)) + (format #t "~2Tspeed: (meters ~m)~%" (-> this speed)) + (format #t "~2Tinit-height: (meters ~m)~%" (-> this init-height)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tdest-index: ~D~%" (-> this dest-index)) + (format #t "~2Tround: ~D~%" (-> this round)) + (format #t "~2Tflying?: ~A~%" (-> this flying?)) + (format #t "~2Tfly-away-radius: ~f~%" (-> this fly-away-radius)) + (format #t "~2Tfly-away-ry: ~f~%" (-> this fly-away-ry)) + (format #t "~2Tfly-away-ry-speed: ~f~%" (-> this fly-away-ry-speed)) + (format #t "~2Tfly-away-acc: ~f~%" (-> this fly-away-acc)) + (format #t "~2Tfly-away-dir: #~%" (-> this fly-away-dir)) (label cfg-4) - obj + this ) ;; definition for symbol *tomb-beetle-nav-enemy-info*, type nav-enemy-info @@ -229,45 +229,45 @@ (set! (-> *tomb-beetle-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type tomb-beetle -(defmethod general-event-handler tomb-beetle ((obj tomb-beetle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler tomb-beetle ((this tomb-beetle) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (let ((v1-0 (new 'static 'array int64 2 -1 0))) (case arg2 (('cue-chase) - (set! (-> obj round) (-> arg3 param 0)) - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + (set! (-> this round) (-> arg3 param 0)) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) (('attack) - (when (and (-> obj next-state) (let ((a1-4 (-> obj next-state name))) - (or (= a1-4 'active) (= a1-4 'stand)) - ) + (when (and (-> this next-state) (let ((a1-4 (-> this next-state name))) + (or (= a1-4 'active) (= a1-4 'stand)) + ) ) (-> arg3 param 1) (cond - ((logtest? (-> obj fact enemy-options) (ash 1 (+ (-> obj round) 8))) + ((logtest? (-> this fact enemy-options) (ash 1 (+ (-> this round) 8))) (set! (-> v1-0 0) (the-as int (current-time))) - (go (method-of-object obj go-to-door)) + (go (method-of-object this go-to-door)) ) - ((>= (- (current-time) (the-as time-frame (-> v1-0 0))) (seconds 0.5)) - (logior! (-> obj flags) 1) - (go (method-of-object obj die)) + ((time-elapsed? (the-as time-frame (-> v1-0 0)) (seconds 0.5)) + (logior! (-> this flags) 1) + (go (method-of-object this die)) ) ) ) ) (('die) (cond - ((and (-> obj next-state) (= (-> obj next-state name) 'key)) - (go (method-of-object obj explode)) + ((and (-> this next-state) (= (-> this next-state name) 'key)) + (go (method-of-object this explode)) ) - ((not (and (-> obj next-state) (= (-> obj next-state name) 'dormant))) - (go (method-of-object obj fly-away)) + ((not (and (-> this next-state) (= (-> this next-state name) 'dormant))) + (go (method-of-object this fly-away)) ) ) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -276,19 +276,19 @@ ;; definition for method 185 of type tomb-beetle ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod tomb-beetle-method-185 tomb-beetle ((obj tomb-beetle)) +(defmethod tomb-beetle-method-185 tomb-beetle ((this tomb-beetle)) (cond - ((-> obj draw shadow) + ((-> this draw shadow) (new 'stack-no-clear 'vector) (let ((f30-0 81920.0) (s5-0 (new 'stack-no-clear 'collide-query)) ) - (set! (-> s5-0 start-pos quad) (-> obj root trans quad)) + (set! (-> s5-0 start-pos quad) (-> this root trans quad)) (set-vector! (-> s5-0 move-dist) 0.0 (- f30-0) 0.0 1.0) (let ((v1-6 s5-0)) (set! (-> v1-6 radius) 8192.0) (set! (-> v1-6 collide-with) (collide-spec backgnd)) - (set! (-> v1-6 ignore-process0) obj) + (set! (-> v1-6 ignore-process0) this) (set! (-> v1-6 ignore-process1) #f) (set! (-> v1-6 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-6 action-mask) (collide-action solid)) @@ -296,18 +296,18 @@ (let ((f0-5 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) (cond ((>= f0-5 0.0) - (let ((v1-10 (-> obj draw shadow-ctrl))) + (let ((v1-10 (-> this draw shadow-ctrl))) (logclear! (-> v1-10 settings flags) (shadow-flags disable-draw)) ) 0 (-> s5-0 best-other-tri intersect) - (let ((a1-2 (-> obj root trans))) + (let ((a1-2 (-> this root trans))) (-> a1-2 y) (let ((f0-6 (* f0-5 f30-0))) (shadow-control-method-14 - (-> obj draw shadow-ctrl) + (-> this draw shadow-ctrl) a1-2 - (-> obj draw shadow-ctrl settings shadow-dir) + (-> this draw shadow-ctrl settings shadow-dir) (- -8192.0 f30-0) (+ -8192.0 f0-6) (+ 8192.0 f0-6) @@ -316,7 +316,7 @@ ) ) (else - (let ((v1-22 (-> obj draw shadow-ctrl))) + (let ((v1-22 (-> this draw shadow-ctrl))) (logior! (-> v1-22 settings flags) (shadow-flags disable-draw)) ) 0 @@ -326,12 +326,12 @@ ) ) (else - (let ((v1-24 (-> obj draw shadow-ctrl))) + (let ((v1-24 (-> this draw shadow-ctrl))) (logior! (-> v1-24 settings flags) (shadow-flags disable-draw)) ) 0 - (set! (-> obj draw bounds y) 2457.6) - (set! (-> obj draw bounds w) 8192.0) + (set! (-> this draw bounds y) 2457.6) + (set! (-> this draw bounds w) 8192.0) ) ) (none) @@ -429,7 +429,7 @@ (logclear! (-> v1-1 settings flags) (shadow-flags disable-draw)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (ja-no-eval :group! tomb-beetle-land-ja :num! (seek!) :frame-num 0.0) @@ -442,7 +442,7 @@ (f30-1 (rand-vu-float-range 0.8 1.4)) ) (ja-no-eval :group! tomb-beetle-wiggle-ja :num! (loop! f30-1) :frame-num 0.0) - (until (>= (- (current-time) gp-0) s5-0) + (until (time-elapsed? gp-0 s5-0) (suspend) (ja :num! (loop! f30-1)) ) @@ -535,7 +535,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-2 self)) (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag enemy-flag36)))) (set! (-> v1-2 nav callback-info) *nav-enemy-null-callback-info*) @@ -548,7 +548,7 @@ (set! (-> self state-timeout) (the-as time-frame (the int (* 300.0 (rand-vu-float-range 0.2 0.8))))) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (-> self state-timeout)) + (if (time-elapsed? (-> self state-time) (-> self state-timeout)) (go-virtual active) ) ) @@ -785,7 +785,7 @@ ) ) (let ((gp-2 (current-time))) - (until (>= (- (current-time) gp-2) (seconds 2)) + (until (time-elapsed? gp-2 (seconds 2)) (suspend) ) ) @@ -989,9 +989,9 @@ ;; definition for method 114 of type tomb-beetle ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! tomb-beetle ((obj tomb-beetle)) +(defmethod init-enemy-collision! tomb-beetle ((this tomb-beetle)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1031,7 +1031,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1039,21 +1039,21 @@ ;; definition for method 115 of type tomb-beetle ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! tomb-beetle ((obj tomb-beetle)) +(defmethod init-enemy! tomb-beetle ((this tomb-beetle)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-beetle" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-enemy-behaviour-and-stats! obj *tomb-beetle-nav-enemy-info*) - (let ((v1-5 (-> obj nav))) + (init-enemy-behaviour-and-stats! this *tomb-beetle-nav-enemy-info*) + (let ((v1-5 (-> this nav))) (set! (-> v1-5 sphere-mask) (the-as uint #x800fa)) ) 0 - (logclear! (-> obj enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) - (set! (-> obj flags) (the-as uint 0)) - (logclear! (-> obj mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag check-water-backup no-initial-move-to-ground)) + (set! (-> this flags) (the-as uint 0)) + (logclear! (-> this mask) (process-mask actor-pause)) 0 (none) ) 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 10bc23b626..7c70141a2c 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-obs_REF.gc @@ -13,18 +13,18 @@ ) ;; definition for method 3 of type tomb-plat-wall -(defmethod inspect tomb-plat-wall ((obj tomb-plat-wall)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-plat-wall ((this tomb-plat-wall)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tposition: #~%" (-> obj position)) - (format #t "~2Tlast-pos: ~f~%" (-> obj last-pos)) + (format #t "~2Tposition: #~%" (-> this position)) + (format #t "~2Tlast-pos: ~f~%" (-> this last-pos)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -35,7 +35,7 @@ ) ;; definition for method 30 of type tomb-plat-wall -(defmethod get-art-group tomb-plat-wall ((obj tomb-plat-wall)) +(defmethod get-art-group tomb-plat-wall ((this tomb-plat-wall)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-plat-wall" (the-as (pointer uint32) #f)) ) @@ -113,16 +113,16 @@ ;; definition for method 32 of type tomb-plat-wall ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 tomb-plat-wall ((obj tomb-plat-wall)) +(defmethod base-plat-method-32 tomb-plat-wall ((this tomb-plat-wall)) 0 (none) ) ;; definition for method 31 of type tomb-plat-wall ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! tomb-plat-wall ((obj tomb-plat-wall)) +(defmethod init-plat-collision! tomb-plat-wall ((this tomb-plat-wall)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -138,7 +138,7 @@ (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -147,27 +147,27 @@ ;; definition for method 11 of type tomb-plat-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-wall ((obj tomb-plat-wall) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-plat-wall ((this tomb-plat-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (logior! (-> obj mask) (process-mask platform)) - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group (get-art-group obj)) (the-as pair 0)) - (set! (-> obj draw light-index) (the-as uint 1)) - (update-transforms (-> obj root)) - (stop-bouncing! obj) - (base-plat-method-32 obj) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (logior! (-> this mask) (process-mask platform)) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group (get-art-group this)) (the-as pair 0)) + (set! (-> this draw light-index) (the-as uint 1)) + (update-transforms (-> this root)) + (stop-bouncing! this) + (base-plat-method-32 this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (let ((a1-4 (new 'stack-no-clear 'sync-info-params))) (let ((v1-16 0)) - (if (not (logtest? (-> obj fact options) (actor-option loop))) + (if (not (logtest? (-> this fact options) (actor-option loop))) (set! v1-16 (logior v1-16 1)) ) (set! (-> a1-4 sync-type) 'sync-eased) @@ -180,12 +180,12 @@ This commonly includes things such as: (set! (-> a1-4 ease-out) 0.15) (set! (-> a1-4 pause-in) 0.0) (set! (-> a1-4 pause-out) 0.0) - (initialize! (-> obj sync) a1-4) + (initialize! (-> this sync) a1-4) ) - (set! (-> obj sound-id) (new 'static 'sound-id)) - (set! (-> obj position quad) (-> obj root trans quad)) - (set! (-> obj last-pos) 0.0) - (go (method-of-object obj plat-idle)) + (set! (-> this sound-id) (new 'static 'sound-id)) + (set! (-> this position quad) (-> this root trans quad)) + (set! (-> this last-pos) 0.0) + (go (method-of-object this plat-idle)) (none) ) @@ -203,16 +203,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-stair-block-spikes -(defmethod inspect tomb-stair-block-spikes ((obj tomb-stair-block-spikes)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-stair-block-spikes ((this tomb-stair-block-spikes)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -360,19 +360,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-stair-block-spike-info -(defmethod inspect tomb-stair-block-spike-info ((obj tomb-stair-block-spike-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-stair-block-spike-info ((this tomb-stair-block-spike-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'tomb-stair-block-spike-info) - (format #t "~1Tspike: ~D~%" (-> obj spike)) - (format #t "~1Tjoint: ~D~%" (-> obj joint)) - (format #t "~1Ty-offset: ~f~%" (-> obj y-offset)) - (format #t "~1Tup: ~A~%" (-> obj up)) - (format #t "~1Tsounded: ~A~%" (-> obj sounded)) + (format #t "[~8x] ~A~%" this 'tomb-stair-block-spike-info) + (format #t "~1Tspike: ~D~%" (-> this spike)) + (format #t "~1Tjoint: ~D~%" (-> this joint)) + (format #t "~1Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~1Tup: ~A~%" (-> this up)) + (format #t "~1Tsounded: ~A~%" (-> this sounded)) (label cfg-4) - obj + this ) ;; definition of type tomb-stair-block @@ -398,21 +398,21 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-stair-block -(defmethod inspect tomb-stair-block ((obj tomb-stair-block)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-stair-block ((this tomb-stair-block)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinitial-y: ~f~%" (-> obj initial-y)) - (format #t "~2Tspike-info[4] @ #x~X~%" (-> obj spike-info)) - (format #t "~2Tcamera-state: ~D~%" (-> obj camera-state)) - (format #t "~2Tsink-sound: ~D~%" (-> obj sink-sound)) - (format #t "~2Trise-sound: ~D~%" (-> obj rise-sound)) + (format #t "~2Tinitial-y: ~f~%" (-> this initial-y)) + (format #t "~2Tspike-info[4] @ #x~X~%" (-> this spike-info)) + (format #t "~2Tcamera-state: ~D~%" (-> this camera-state)) + (format #t "~2Tsink-sound: ~D~%" (-> this sink-sound)) + (format #t "~2Trise-sound: ~D~%" (-> this rise-sound)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -546,7 +546,7 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self camera-state) 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (task-node-close! (game-task-node tomb-poles-block)) ) :exit (behavior () @@ -565,7 +565,7 @@ This commonly includes things such as: (remove-setting! 'string-startup-vector) (set! (-> self camera-state) 3) ) - ((and (= (-> self camera-state) 1) (>= (- (current-time) (-> self state-time)) (seconds 8))) + ((and (= (-> self camera-state) 1) (time-elapsed? (-> self state-time) (seconds 8))) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) @@ -587,8 +587,8 @@ This commonly includes things such as: (set! (-> self camera-state) 1) (ja-channel-push! 1 (seconds 2)) (ja :group! (-> self draw art-group data 3) :num! min) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 2)) (lift-pool 0) (drop-pool 1) (suspend) @@ -670,7 +670,7 @@ This commonly includes things such as: (set! (-> self camera-state) 3) ) ) - ((and (= (-> self camera-state) 1) (>= (- (current-time) (-> self state-time)) (seconds 4))) + ((and (= (-> self camera-state) 1) (time-elapsed? (-> self state-time) (seconds 4))) (set-setting! 'interp-time 'abs 0.0 0) (set-setting! 'string-startup-vector 'abs (new 'static 'vector :x 1.0) 0) (remove-setting! 'entity-name) @@ -700,7 +700,7 @@ This commonly includes things such as: (set! v1-1 (or (not *target*) (process-grab? *target* #f))) ) (set-setting! 'entity-name "camera-170" 0.0 0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self camera-state) 1) (ja-channel-push! 1 (seconds 2)) (until #f @@ -826,14 +826,14 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-stair-block ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-stair-block ((obj tomb-stair-block) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-stair-block ((this tomb-stair-block) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 penetrated-by) (penetrate)) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 8) 0))) (set! (-> s4-0 total-prims) (the-as uint 9)) @@ -905,43 +905,45 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-27 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-27 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-stair-block" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 1)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj initial-y) (-> obj root trans y)) + (set! (-> this draw light-index) (the-as uint 1)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this initial-y) (-> this root trans y)) (ja-post) - (set! (-> obj spike-info 0 joint) 4) - (set! (-> obj spike-info 1 joint) 6) - (set! (-> obj spike-info 2 joint) 8) - (set! (-> obj spike-info 3 joint) 10) + (set! (-> this spike-info 0 joint) 4) + (set! (-> this spike-info 1 joint) 6) + (set! (-> this spike-info 2 joint) 8) + (set! (-> this spike-info 3 joint) 10) (let ((s5-2 (new 'stack-no-clear 'vector))) (dotimes (s4-2 4) - (set! (-> obj spike-info s4-2 y-offset) 0.0) - (vector<-cspace! s5-2 (-> obj node-list data (-> obj spike-info s4-2 joint))) - (set! (-> obj spike-info s4-2 spike) (ppointer->handle (process-spawn tomb-stair-block-spikes s5-2 :to obj))) - (set! (-> obj spike-info s4-2 up) #f) - (set! (-> obj spike-info s4-2 sounded) #f) + (set! (-> this spike-info s4-2 y-offset) 0.0) + (vector<-cspace! s5-2 (-> this node-list data (-> this spike-info s4-2 joint))) + (set! (-> this spike-info s4-2 spike) + (ppointer->handle (process-spawn tomb-stair-block-spikes s5-2 :to this)) + ) + (set! (-> this spike-info s4-2 up) #f) + (set! (-> this spike-info s4-2 sounded) #f) ) ) - (set! (-> obj root trans y) (+ -104448.0 (-> obj initial-y))) - (let ((s5-3 (-> obj skel root-channel 0))) + (set! (-> this root trans y) (+ -104448.0 (-> this initial-y))) + (let ((s5-3 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-3 - (the-as art-joint-anim (-> obj draw art-group data 3)) + (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity ) (set! (-> s5-3 frame-num) 0.0) ) - (set! (-> obj rise-sound) (new-sound-id)) - (set! (-> obj sink-sound) (new-sound-id)) - (go (method-of-object obj wait-for-pools)) + (set! (-> this rise-sound) (new-sound-id)) + (set! (-> this sink-sound) (new-sound-id)) + (go (method-of-object this wait-for-pools)) (none) ) @@ -961,36 +963,36 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-bounce-web -(defmethod inspect tomb-bounce-web ((obj tomb-bounce-web)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-bounce-web ((this tomb-bounce-web)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type bouncer inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 23 of type tomb-bounce-web ;; WARN: Return type mismatch int vs none. -(defmethod init-skeleton! tomb-bounce-web ((obj tomb-bounce-web)) +(defmethod init-skeleton! tomb-bounce-web ((this tomb-bounce-web)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-bounce-web" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj mods) *indax-bounce-mods*) + (set! (-> this mods) *indax-bounce-mods*) 0 (none) ) ;; definition for method 24 of type tomb-bounce-web ;; WARN: Return type mismatch int vs none. -(defmethod bouncer-method-24 tomb-bounce-web ((obj tomb-bounce-web)) +(defmethod bouncer-method-24 tomb-bounce-web ((this tomb-bounce-web)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 4) 0))) (set! (-> s5-0 total-prims) (the-as uint 5)) (set! (-> s4-0 prim-core collide-as) (collide-spec crate)) @@ -1033,7 +1035,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1049,16 +1051,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-plat-pillar -(defmethod inspect tomb-plat-pillar ((obj tomb-plat-pillar)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-plat-pillar ((this tomb-plat-pillar)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1068,23 +1070,23 @@ This commonly includes things such as: ) ;; definition for method 30 of type tomb-plat-pillar -(defmethod get-art-group tomb-plat-pillar ((obj tomb-plat-pillar)) +(defmethod get-art-group tomb-plat-pillar ((this tomb-plat-pillar)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-plat-pillar" (the-as (pointer uint32) #f)) ) ;; definition for method 32 of type tomb-plat-pillar ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 tomb-plat-pillar ((obj tomb-plat-pillar)) +(defmethod base-plat-method-32 tomb-plat-pillar ((this tomb-plat-pillar)) 0 (none) ) ;; definition for method 31 of type tomb-plat-pillar ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-plat-pillar ((obj tomb-plat-pillar)) +(defmethod init-plat-collision! tomb-plat-pillar ((this tomb-plat-pillar)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1100,7 +1102,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) (none) ) @@ -1117,18 +1119,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-elevator -(defmethod inspect tomb-elevator ((obj tomb-elevator)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-elevator ((this tomb-elevator)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlast-pos: #~%" (-> obj last-pos)) - (format #t "~2Tspeed: ~f~%" (-> obj speed)) + (format #t "~2Tlast-pos: #~%" (-> this last-pos)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1174,7 +1176,7 @@ This commonly includes things such as: ;; definition for method 41 of type tomb-elevator ;; WARN: Return type mismatch int vs none. -(defmethod init-defaults! tomb-elevator ((obj tomb-elevator)) +(defmethod init-defaults! tomb-elevator ((this tomb-elevator)) "Initializes default settings related to the [[elevator]]: - `elevator-xz-threshold` - `elevator-y-threshold` @@ -1182,24 +1184,24 @@ This commonly includes things such as: - `elevator-move-rate` - `elevator-flags`" (let ((t9-0 (method-of-type elevator init-defaults!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj params flags) (elevator-flags elevator-flags-2)) - (set! (-> obj draw light-index) (the-as uint 1)) + (set! (-> this params flags) (elevator-flags elevator-flags-2)) + (set! (-> this draw light-index) (the-as uint 1)) (none) ) ;; definition for method 30 of type tomb-elevator -(defmethod get-art-group tomb-elevator ((obj tomb-elevator)) +(defmethod get-art-group tomb-elevator ((this tomb-elevator)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-elevator" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type tomb-elevator ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-elevator ((obj tomb-elevator)) +(defmethod init-plat-collision! tomb-elevator ((this tomb-elevator)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1215,17 +1217,17 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) (none) ) ;; definition for method 42 of type tomb-elevator ;; WARN: Return type mismatch int vs none. -(defmethod set-ambient-sound! tomb-elevator ((obj tomb-elevator)) +(defmethod set-ambient-sound! tomb-elevator ((this tomb-elevator)) "Sets the elevator's [[ambient-sound]] up" - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "tomb-elevator" :fo-max 70) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "tomb-elevator" :fo-max 70) (-> this root trans)) ) 0 (none) @@ -1248,28 +1250,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-boss-door -(defmethod inspect tomb-boss-door ((obj tomb-boss-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-boss-door ((this tomb-boss-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type tomb-boss-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-door ((obj tomb-boss-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boss-door ((this tomb-boss-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) (set! (-> s5-0 total-prims) (the-as uint 3)) @@ -1298,16 +1300,16 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj door-radius) 61440.0) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this door-radius) 61440.0) + (go (method-of-object this close) #t) (none) ) @@ -1321,16 +1323,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type water-anim-tomb -(defmethod inspect water-anim-tomb ((obj water-anim-tomb)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-anim-tomb ((this water-anim-tomb)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol ripple-for-water-anim-tomb, type ripple-wave-set @@ -1349,14 +1351,14 @@ This commonly includes things such as: ;; definition for method 24 of type water-anim-tomb ;; WARN: Return type mismatch ripple-wave-set vs none. -(defmethod init-water! water-anim-tomb ((obj water-anim-tomb)) +(defmethod init-water! water-anim-tomb ((this water-anim-tomb)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) @@ -1381,28 +1383,28 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-wing-door -(defmethod inspect tomb-wing-door ((obj tomb-wing-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-wing-door ((this tomb-wing-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type com-airlock inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 11 of type tomb-wing-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-wing-door ((obj tomb-wing-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-wing-door ((this tomb-wing-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 penetrated-by) (penetrate)) (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) (set! (-> s5-0 total-prims) (the-as uint 4)) @@ -1438,19 +1440,19 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-wing-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (init-airlock! obj) - (set! (-> obj sound-open-loop) (static-sound-spec "wing-door-open")) - (set! (-> obj sound-open-stop) (static-sound-spec "wing-open-hit")) - (set! (-> obj sound-close-loop) (static-sound-spec "wing-door-close")) - (set! (-> obj sound-close-stop) (static-sound-spec "wing-close-hit")) - (go (method-of-object obj close) #t) + (init-airlock! this) + (set! (-> this sound-open-loop) (static-sound-spec "wing-door-open")) + (set! (-> this sound-open-stop) (static-sound-spec "wing-open-hit")) + (set! (-> this sound-close-loop) (static-sound-spec "wing-door-close")) + (set! (-> this sound-close-stop) (static-sound-spec "wing-close-hit")) + (go (method-of-object this close) #t) (none) ) @@ -1476,16 +1478,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-boulder-door -(defmethod inspect tomb-boulder-door ((obj tomb-boulder-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-boulder-door ((this tomb-boulder-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1527,14 +1529,14 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-boulder-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boulder-door ((obj tomb-boulder-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boulder-door ((this tomb-boulder-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle camera-blocker)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1549,17 +1551,17 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boulder-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (if (task-node-closed? (game-task-node tomb-poles-boulder)) - (go (method-of-object obj close)) - (go (method-of-object obj open)) + (go (method-of-object this close)) + (go (method-of-object this open)) ) (none) ) @@ -1588,23 +1590,23 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-plat-return -(defmethod inspect tomb-plat-return ((obj tomb-plat-return)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-plat-return ((this tomb-plat-return)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tintro-path: ~A~%" (-> obj intro-path)) - (format #t "~2Tride-timer: ~D~%" (-> obj ride-timer)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) - (format #t "~2Tdest-pos: ~f~%" (-> obj dest-pos)) - (format #t "~2Tpath-speed: ~f~%" (-> obj path-speed)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tintro-path: ~A~%" (-> this intro-path)) + (format #t "~2Tride-timer: ~D~%" (-> this ride-timer)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tdest-pos: ~f~%" (-> this dest-pos)) + (format #t "~2Tpath-speed: ~f~%" (-> this path-speed)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1685,16 +1687,16 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) ) :trans (behavior () (logclear! (-> self flags) (tomb-plat-flags topflags-0)) (plat-trans) (if (not (logtest? (-> self flags) (tomb-plat-flags topflags-0))) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) ) - (when (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) + (when (time-elapsed? (-> self ride-timer) (seconds 0.5)) (if (= (-> self path-pos) 0.0) (set! (-> self dest-pos) 1.0) (set! (-> self dest-pos) 0.0) @@ -1763,7 +1765,7 @@ This commonly includes things such as: ) :trans (behavior () (plat-trans) - (when (>= (- (current-time) (-> self ride-timer)) (seconds 1)) + (when (time-elapsed? (-> self ride-timer) (seconds 1)) (cond ((= (-> self path-pos) 1.0) (set! (-> self dest-pos) 0.0) @@ -1781,25 +1783,25 @@ This commonly includes things such as: ;; definition for method 7 of type tomb-plat-return ;; WARN: Return type mismatch process-drawable vs tomb-plat-return. -(defmethod relocate tomb-plat-return ((obj tomb-plat-return) (arg0 int)) - (if (nonzero? (-> obj intro-path)) - (&+! (-> obj intro-path) arg0) +(defmethod relocate tomb-plat-return ((this tomb-plat-return) (arg0 int)) + (if (nonzero? (-> this intro-path)) + (&+! (-> this intro-path) arg0) ) - (the-as tomb-plat-return ((method-of-type process-drawable relocate) obj arg0)) + (the-as tomb-plat-return ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type tomb-plat-return -(defmethod deactivate tomb-plat-return ((obj tomb-plat-return)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method tomb-plat-return 10)) obj) +(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) (none) ) ;; definition for method 31 of type tomb-plat-return ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! tomb-plat-return ((obj tomb-plat-return)) +(defmethod init-plat-collision! tomb-plat-return ((this tomb-plat-return)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -1815,7 +1817,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -1823,45 +1825,45 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-plat-return ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-return ((obj tomb-plat-return) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-plat-return ((this tomb-plat-return) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-plat-return" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (stop-bouncing! obj) - (set! (-> obj flags) (tomb-plat-flags)) - (set! (-> obj path-pos) 0.0) - (let ((s4-1 (new 'process 'curve-control obj 'path -1000000000.0))) + (stop-bouncing! this) + (set! (-> this flags) (tomb-plat-flags)) + (set! (-> this path-pos) 0.0) + (let ((s4-1 (new 'process 'curve-control this 'path -1000000000.0))) (if (logtest? (-> s4-1 flags) (path-control-flag not-found)) (go process-drawable-art-error "error in path") ) (logior! (-> s4-1 flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path) s4-1) + (set! (-> this path) s4-1) ) - (let ((s4-2 (new 'process 'curve-control obj 'intro -1000000000.0))) + (let ((s4-2 (new 'process 'curve-control this 'intro -1000000000.0))) (if (logtest? (-> s4-2 flags) (path-control-flag not-found)) (go process-drawable-art-error "error in intro-path") ) (logior! (-> s4-2 flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj intro-path) s4-2) + (set! (-> this intro-path) s4-2) ) - (let ((f30-0 (total-distance (-> obj path)))) - (set! (-> obj path-speed) (/ (res-lump-float arg0 'speed :default 40960.0) f30-0)) - (set! (-> obj root pause-adjust-distance) (+ 204800.0 f30-0)) + (let ((f30-0 (total-distance (-> this path)))) + (set! (-> this path-speed) (/ (res-lump-float arg0 'speed :default 40960.0) f30-0)) + (set! (-> this root pause-adjust-distance) (+ 204800.0 f30-0)) ) - (set! (-> obj sound-id) (new-sound-id)) - (init-plat! obj) + (set! (-> this sound-id) (new-sound-id)) + (init-plat! this) (if (or (task-closed? (the-as string ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'task-name 'interp -1000000000.0 @@ -1871,10 +1873,10 @@ This commonly includes things such as: ) ) ) - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) ) - (go (method-of-object obj run-intro)) - (go (method-of-object obj hidden)) + (go (method-of-object this run-intro)) + (go (method-of-object this hidden)) ) (none) ) @@ -1966,20 +1968,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-sphinx -(defmethod inspect tomb-sphinx ((obj tomb-sphinx)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-sphinx ((this tomb-sphinx)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttarget-actor: ~A~%" (-> obj target-actor)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tmove-dir: ~f~%" (-> obj move-dir)) + (format #t "~2Ttarget-actor: ~A~%" (-> this target-actor)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tmove-dir: ~f~%" (-> this move-dir)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2011,7 +2013,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (local-vars (sv-96 vector)) @@ -2072,7 +2074,7 @@ This commonly includes things such as: (defstate doors-open (tomb-sphinx) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :code (behavior () (local-vars (sv-96 vector) (sv-112 vector)) @@ -2151,36 +2153,36 @@ This commonly includes things such as: ;; definition for method 7 of type tomb-sphinx ;; WARN: Return type mismatch process-drawable vs tomb-sphinx. -(defmethod relocate tomb-sphinx ((obj tomb-sphinx) (arg0 int)) - (the-as tomb-sphinx ((method-of-type process-drawable relocate) obj arg0)) +(defmethod relocate tomb-sphinx ((this tomb-sphinx) (arg0 int)) + (the-as tomb-sphinx ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type tomb-sphinx -(defmethod deactivate tomb-sphinx ((obj tomb-sphinx)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method tomb-sphinx 10)) obj) +(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) (none) ) ;; definition for method 11 of type tomb-sphinx ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-sphinx ((obj tomb-sphinx) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-sphinx ((this tomb-sphinx) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (the-as collide-shape-moving (new 'process 'trsqv))) - (process-drawable-from-entity! obj arg0) - (set! (-> obj target-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj move-dir) 0.0) - (if (and (task-complete? *game-info* (-> obj entity task)) + (set! (-> this root) (the-as collide-shape-moving (new 'process 'trsqv))) + (process-drawable-from-entity! this arg0) + (set! (-> this target-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this move-dir) 0.0) + (if (and (task-complete? *game-info* (-> this entity task)) (not (task-node-closed? (game-task-node tomb-boss-door))) ) - (go (method-of-object obj active)) - (go (method-of-object obj idle)) + (go (method-of-object this active)) + (go (method-of-object this idle)) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/tomb-part_REF.gc b/test/decompiler/reference/jak2/levels/tomb/tomb-part_REF.gc index 618c6eb054..5523560e8d 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type tomb-part -(defmethod inspect tomb-part ((obj tomb-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-part ((this tomb-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 d7417e80fa..1855dac831 100644 --- a/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/tomb-water_REF.gc @@ -17,18 +17,18 @@ ) ;; definition for method 3 of type tomb-door -(defmethod inspect tomb-door ((obj tomb-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-door ((this tomb-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) - (format #t "~2Tround: ~D~%" (-> obj round)) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~2Tround: ~D~%" (-> this round)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -115,7 +115,7 @@ ) :code (behavior ((arg0 time-frame)) (let ((s5-0 (current-time))) - (until (>= (- (current-time) s5-0) arg0) + (until (time-elapsed? s5-0 arg0) (suspend) ) ) @@ -132,14 +132,14 @@ ;; definition for method 11 of type tomb-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-door ((obj tomb-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-door ((this tomb-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec camera-blocker pusher)) @@ -169,27 +169,27 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj round) (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0)) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this round) (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0)) (ja-channel-push! 1 0) - (let ((a0-27 (-> obj skel root-channel 0))) - (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-27 (-> this skel root-channel 0))) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-27 frame-num) 0.0) - (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -213,25 +213,25 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-beetle-door -(defmethod inspect tomb-beetle-door ((obj tomb-beetle-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-beetle-door ((this tomb-beetle-door)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Toffset[3] @ #x~X~%" (-> obj offset)) - (format #t "~2Toffset-index: ~D~%" (-> obj offset-index)) - (format #t "~2Tkey-index: ~D~%" (-> obj key-index)) - (format #t "~2Tbeetle[3] @ #x~X~%" (-> obj beetle)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Toffset[3] @ #x~X~%" (-> this offset)) + (format #t "~2Toffset-index: ~D~%" (-> this offset-index)) + (format #t "~2Tkey-index: ~D~%" (-> this key-index)) + (format #t "~2Tbeetle[3] @ #x~X~%" (-> this beetle)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -333,7 +333,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-beetle-door ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-beetle-door ((obj tomb-beetle-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-beetle-door ((this tomb-beetle-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -341,7 +341,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec camera-blocker pusher)) @@ -371,43 +371,43 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-beetle-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (countdown (s5-2 3) - (vector-orient-by-quat! (-> obj offset s5-2) (-> tomb-beetle-door-offsets s5-2) (-> obj root quat)) - (set! (-> obj offset s5-2 w) (quaternion-y-angle (-> obj root quat))) - (set! (-> obj beetle s5-2) (the-as handle #f)) + (vector-orient-by-quat! (-> this offset s5-2) (-> tomb-beetle-door-offsets s5-2) (-> this root quat)) + (set! (-> this offset s5-2 w) (quaternion-y-angle (-> this root quat))) + (set! (-> this beetle s5-2) (the-as handle #f)) ) - (set! (-> obj offset-index) 0) - (set! (-> obj key-index) 0) + (set! (-> this offset-index) 0) + (set! (-> this key-index) 0) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-33 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((v1-33 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (cond ((and v1-33 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-33)) - (set! (-> obj actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-33)) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) (ja-channel-push! 1 0) - (let ((a0-30 (-> obj skel root-channel 0))) - (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-30 (-> this skel root-channel 0))) + (set! (-> a0-30 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-30 frame-num) 0.0) - (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-30 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -427,46 +427,46 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-button -(defmethod inspect tomb-button ((obj tomb-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-button ((this tomb-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type basebutton inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 33 of type tomb-button ;; WARN: Return type mismatch int vs none. -(defmethod basebutton-method-33 tomb-button ((obj tomb-button)) +(defmethod basebutton-method-33 tomb-button ((this tomb-button)) "TODO - joint stuff" (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) (ja-channel-set! 1) (cond - ((logtest? (-> obj button-status) (button-status pressed)) - (let ((s5-1 (-> obj skel root-channel 0))) + ((logtest? (-> this button-status) (button-status pressed)) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) ) ) (else - (let ((s5-2 (-> obj skel root-channel 0))) + (let ((s5-2 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-2 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-2 frame-num) 0.0) @@ -479,9 +479,9 @@ This commonly includes things such as: ;; definition for method 34 of type tomb-button ;; WARN: Return type mismatch collide-shape vs none. -(defmethod basebutton-method-34 tomb-button ((obj tomb-button)) +(defmethod basebutton-method-34 tomb-button ((this tomb-button)) "TODO - collision stuff" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -497,18 +497,18 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; definition for method 35 of type tomb-button ;; WARN: Return type mismatch float vs none. -(defmethod prepare-trigger-event! tomb-button ((obj tomb-button)) +(defmethod prepare-trigger-event! tomb-button ((this tomb-button)) "Sets `event-going-down` to `'trigger`" - (logior! (-> obj button-status) (button-status button-status-4)) - (set! (-> obj event-going-down) 'cue-chase) - (+! (-> obj root trans y) 204.8) + (logior! (-> this button-status) (button-status button-status-4)) + (set! (-> this event-going-down) 'cue-chase) + (+! (-> this root trans y) 204.8) (none) ) @@ -528,26 +528,26 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-beetle-button -(defmethod inspect tomb-beetle-button ((obj tomb-beetle-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-beetle-button ((this tomb-beetle-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type tomb-button inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tround: ~D~%" (-> obj round)) - (format #t "~2Tspeech-mask: ~D~%" (-> obj speech-mask)) - (format #t "~2Tspeech-timer: ~D~%" (-> obj speech-timer)) + (format #t "~2Tround: ~D~%" (-> this round)) + (format #t "~2Tspeech-mask: ~D~%" (-> this speech-mask)) + (format #t "~2Tspeech-timer: ~D~%" (-> this speech-timer)) (label cfg-4) - obj + this ) ;; definition for method 39 of type tomb-beetle-button ;; WARN: Return type mismatch int vs none. -(defmethod tomb-beetle-button-method-39 tomb-beetle-button ((obj tomb-beetle-button)) - (when (>= (- (current-time) (-> obj speech-timer)) (seconds 6)) - (let ((s5-0 (rand-vu-int-count-excluding 4 (the-as int (-> obj speech-mask))))) +(defmethod tomb-beetle-button-method-39 tomb-beetle-button ((this tomb-beetle-button)) + (when (time-elapsed? (-> this speech-timer) (seconds 6)) + (let ((s5-0 (rand-vu-int-count-excluding 4 (the-as int (-> this speech-mask))))) (let* ((v1-4 s5-0) (t0-0 (cond ((zero? v1-4) @@ -565,11 +565,11 @@ This commonly includes things such as: ) ) ) - (add-process *gui-control* obj (gui-channel alert) (gui-action play) t0-0 -99.0 0) + (add-process *gui-control* this (gui-channel alert) (gui-action play) t0-0 -99.0 0) ) - (set! (-> obj speech-mask) (the-as uint (ash 1 s5-0))) + (set! (-> this speech-mask) (the-as uint (ash 1 s5-0))) ) - (set! (-> obj speech-timer) (current-time)) + (set-time! (-> this speech-timer)) ) 0 (none) @@ -624,7 +624,7 @@ This commonly includes things such as: (t9-0) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 4)) + (when (time-elapsed? (-> self state-time) (seconds 4)) (if (and *target* (focus-test? *target* grabbed)) (process-release? *target*) ) @@ -711,7 +711,7 @@ This commonly includes things such as: ;; definition for method 36 of type tomb-beetle-button ;; WARN: Return type mismatch symbol vs none. -(defmethod send-event! tomb-beetle-button ((obj tomb-beetle-button) (arg0 symbol)) +(defmethod send-event! tomb-beetle-button ((this tomb-beetle-button) (arg0 symbol)) "Prepares an [[event-message-block]] using the provided type to send an event to: - the `notify-actor` - every [[entity-actor]] in the `actor-group` array @@ -722,7 +722,7 @@ This commonly includes things such as: (set! (-> a1-1 num-params) 0) (set! (-> a1-1 message) arg0) (let ((t9-0 send-event-function) - (v1-1 (-> obj notify-actor)) + (v1-1 (-> this notify-actor)) ) (t9-0 (if v1-1 @@ -732,13 +732,13 @@ This commonly includes things such as: ) ) ) - (let ((s4-0 (-> obj actor-group (-> obj round)))) + (let ((s4-0 (-> this actor-group (-> this round)))) (dotimes (s3-0 (-> s4-0 length)) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer self)) (set! (-> a1-2 num-params) 1) (set! (-> a1-2 message) arg0) - (set! (-> a1-2 param 0) (-> obj round)) + (set! (-> a1-2 param 0) (-> this round)) (let ((t9-1 send-event-function) (v1-11 (-> s4-0 data s3-0 actor)) ) @@ -758,14 +758,14 @@ This commonly includes things such as: ;; definition for method 35 of type tomb-beetle-button ;; WARN: Return type mismatch int vs none. -(defmethod prepare-trigger-event! tomb-beetle-button ((obj tomb-beetle-button)) +(defmethod prepare-trigger-event! tomb-beetle-button ((this tomb-beetle-button)) "Sets `event-going-down` to `'trigger`" (let ((t9-0 (method-of-type tomb-button prepare-trigger-event!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj round) (-> obj entity extra perm user-uint8 0)) - (set! (-> obj speech-mask) (the-as uint 0)) - (set! (-> obj speech-timer) 0) + (set! (-> this round) (-> this entity extra perm user-uint8 0)) + (set! (-> this speech-mask) (the-as uint 0)) + (set! (-> this speech-timer) 0) 0 (none) ) @@ -807,26 +807,26 @@ This commonly includes things such as: ;; definition for method 3 of type tomb-simon-block ;; INFO: Used lq/sq -(defmethod inspect tomb-simon-block ((obj tomb-simon-block)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-simon-block ((this tomb-simon-block)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-show: ~D~%" (-> obj sound-show)) - (format #t "~2Tcolor: #~%" (-> obj color)) - (format #t "~2Tmy-idx: ~D~%" (-> obj my-idx)) - (format #t "~2Tnext-idx: ~D~%" (-> obj next-idx)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tblink-timer[2] @ #x~X~%" (-> obj blink-timer)) - (format #t "~2Tride-timer: ~D~%" (-> obj ride-timer)) - (format #t "~2Torder: ~D~%" (-> obj order)) - (format #t "~2Tbase-height: ~f~%" (-> obj base-height)) - (format #t "~2Tmove-rate: ~f~%" (-> obj move-rate)) + (format #t "~2Tsound-show: ~D~%" (-> this sound-show)) + (format #t "~2Tcolor: #~%" (-> this color)) + (format #t "~2Tmy-idx: ~D~%" (-> this my-idx)) + (format #t "~2Tnext-idx: ~D~%" (-> this next-idx)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tblink-timer[2] @ #x~X~%" (-> this blink-timer)) + (format #t "~2Tride-timer: ~D~%" (-> this ride-timer)) + (format #t "~2Torder: ~D~%" (-> this order)) + (format #t "~2Tbase-height: ~f~%" (-> this base-height)) + (format #t "~2Tmove-rate: ~f~%" (-> this move-rate)) (label cfg-4) - obj + this ) ;; definition of type tomb-plat-simon @@ -854,24 +854,24 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-plat-simon -(defmethod inspect tomb-plat-simon ((obj tomb-plat-simon)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-plat-simon ((this tomb-plat-simon)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tplat: ~A~%" (-> obj plat)) - (format #t "~2Tplat-seq: #x~X~%" (-> obj plat-seq)) - (format #t "~2Tplat-count: ~D~%" (-> obj plat-count)) - (format #t "~2Tplat-seq-count: ~D~%" (-> obj plat-seq-count)) - (format #t "~2Tplat-idx: ~D~%" (-> obj plat-idx)) - (format #t "~2Tbutton-handle: ~D~%" (-> obj button-handle)) - (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) + (format #t "~2Tplat: ~A~%" (-> this plat)) + (format #t "~2Tplat-seq: #x~X~%" (-> this plat-seq)) + (format #t "~2Tplat-count: ~D~%" (-> this plat-count)) + (format #t "~2Tplat-seq-count: ~D~%" (-> this plat-seq-count)) + (format #t "~2Tplat-idx: ~D~%" (-> this plat-idx)) + (format #t "~2Tbutton-handle: ~D~%" (-> this button-handle)) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~2Tflags: ~D~%" (-> this flags)) (label cfg-4) - obj + this ) ;; definition for symbol *tomb-simon-sound-tbl*, type (pointer sound-name) @@ -999,7 +999,7 @@ This commonly includes things such as: (sv-160 int) (sv-176 (function vector vector float)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self plat-idx) 0) (dotimes (gp-0 (-> self plat-count)) (if (nonzero? (-> self plat gp-0)) @@ -1072,7 +1072,7 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 2)) + (until (time-elapsed? gp-0 (seconds 2)) (suspend) ) ) @@ -1090,8 +1090,8 @@ This commonly includes things such as: 0 ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 2)) - (set! (-> self state-time) (current-time)) + (when (time-elapsed? (-> self state-time) (seconds 2)) + (set-time! (-> self state-time)) (if (< (-> self plat-idx) (-> self plat-seq-count)) (send-event (handle->process (-> self plat (-> self plat-seq (-> self plat-idx)))) 'blink) ) @@ -1136,8 +1136,8 @@ This commonly includes things such as: ;; definition for method 24 of type tomb-plat-simon ;; WARN: Return type mismatch object vs none. -(defmethod tomb-plat-simon-method-24 tomb-plat-simon ((obj tomb-plat-simon) (arg0 int)) - (let ((a0-3 (handle->process (-> obj plat arg0)))) +(defmethod tomb-plat-simon-method-24 tomb-plat-simon ((this tomb-plat-simon) (arg0 int)) + (let ((a0-3 (handle->process (-> this plat arg0)))) (send-event a0-3 'ready) ) (none) @@ -1145,17 +1145,17 @@ This commonly includes things such as: ;; definition for method 7 of type tomb-plat-simon ;; WARN: Return type mismatch process-drawable vs tomb-plat-simon. -(defmethod relocate tomb-plat-simon ((obj tomb-plat-simon) (arg0 int)) - (if (nonzero? (-> obj plat)) - (&+! (-> obj plat) arg0) +(defmethod relocate tomb-plat-simon ((this tomb-plat-simon) (arg0 int)) + (if (nonzero? (-> this plat)) + (&+! (-> this plat) arg0) ) - (the-as tomb-plat-simon ((method-of-type process-drawable relocate) obj arg0)) + (the-as tomb-plat-simon ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type tomb-plat-simon ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-plat-simon ((obj tomb-plat-simon) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-plat-simon ((this tomb-plat-simon) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1163,20 +1163,20 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (change-parent obj *pusher-pool*) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (change-parent this *pusher-pool*) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-2 (res-lump-data (-> obj entity) 'plat-seq pointer :tag-ptr (& sv-16)))) + (let ((v1-2 (res-lump-data (-> this entity) 'plat-seq pointer :tag-ptr (& sv-16)))) (cond ((and v1-2 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj plat-seq-count) (the-as int (-> sv-16 elt-count))) - (set! (-> obj plat-seq) (the-as (pointer uint32) v1-2)) + (set! (-> this plat-seq-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this plat-seq) (the-as (pointer uint32) v1-2)) ) (else - (set! (-> obj plat-seq-count) 0) - (set! (-> obj plat-seq) (the-as (pointer uint32) #f)) + (set! (-> this plat-seq-count) 0) + (set! (-> this plat-seq) (the-as (pointer uint32) #f)) ) ) ) @@ -1186,14 +1186,14 @@ This commonly includes things such as: (set! s4-0 v1-4) ) ) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 s4-0 #f)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 s4-0 #f)) ) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj plat-count) (-> obj path curve num-cverts)) - (set! (-> obj plat) (new 'process 'boxed-array handle (-> obj plat-count))) - (set! (-> obj flags) (the-as uint 0)) - (set! (-> obj button-handle) (the-as handle #f)) - (go (method-of-object obj dormant)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this plat-count) (-> this path curve num-cverts)) + (set! (-> this plat) (new 'process 'boxed-array handle (-> this plat-count))) + (set! (-> this flags) (the-as uint 0)) + (set! (-> this button-handle) (the-as handle #f)) + (go (method-of-object this dormant)) (none) ) @@ -1241,7 +1241,7 @@ This commonly includes things such as: (logxor! (-> self flags) (simon-block-flags sbf1)) (set! (-> self blink-timer 1) (+ (current-time) (seconds 0.2))) ) - (when (>= (- (current-time) (-> self blink-timer 0)) (seconds 1.2)) + (when (time-elapsed? (-> self blink-timer 0) (seconds 1.2)) (logclear! (-> self flags) (simon-block-flags sbf0)) (set! (-> self draw color-mult quad) (-> self color quad)) ) @@ -1291,16 +1291,17 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self flags) (simon-block-flags sbf0 sbf1 sbf2 sbf5)) (set! (-> self move-rate) 122880.0) ) :trans tomb-simon-block-trans :code sleep-code :post (behavior () - (if (>= (- (current-time) (-> self state-time)) - (the int (* 300.0 (+ (* 0.1 (the float (-> self order))) (* 0.015 (the float (-> self my-idx)))))) - ) + (if (time-elapsed? + (-> self state-time) + (the int (* 300.0 (+ (* 0.1 (the float (-> self order))) (* 0.015 (the float (-> self my-idx)))))) + ) (tomb-simon-block-post) (plat-post) ) @@ -1319,7 +1320,7 @@ This commonly includes things such as: (go-virtual idle) ) (('touch 'ridden 'bonk 'edge-grabbed) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (when (logtest? (-> self flags) (simon-block-flags sbf4)) (let* ((gp-0 *target*) (a0-10 (if (type? gp-0 process-focusable) @@ -1354,13 +1355,13 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self flags) (simon-block-flags sbf4)) - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) (send-event (ppointer->process (-> self parent)) 'die-but (-> self my-idx)) ) :trans (behavior () - (when (>= (- (current-time) (-> self ride-timer)) (seconds 1)) + (when (time-elapsed? (-> self ride-timer) (seconds 1)) (sound-play "tomb-simon-last") (go-virtual die) ) @@ -1427,7 +1428,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self ride-timer) (current-time)) + (set-time! (-> self ride-timer)) ) :trans (behavior () (let* ((gp-0 *target*) @@ -1441,7 +1442,7 @@ This commonly includes things such as: (a0-3 (-> self root trans)) ) (when (and (or (< 16384.0 (fabs (- (-> a0-3 x) (-> v1-2 x)))) (< 16384.0 (fabs (- (-> a0-3 z) (-> v1-2 z))))) - (>= (- (current-time) (-> self ride-timer)) (seconds 0.25)) + (time-elapsed? (-> self ride-timer) (seconds 0.25)) ) (when (= (-> self next-idx) -1) (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) @@ -1496,9 +1497,7 @@ This commonly includes things such as: (set! (-> self draw color-mult quad) (-> self color quad)) ) :trans (behavior () - (if (and (logtest? (-> self flags) (simon-block-flags sbf2)) - (>= (- (current-time) (-> self ride-timer)) (seconds 0.5)) - ) + (if (and (logtest? (-> self flags) (simon-block-flags sbf2)) (time-elapsed? (-> self ride-timer) (seconds 0.5))) (go-virtual wobble-die) ) (plat-trans) @@ -1539,13 +1538,13 @@ This commonly includes things such as: :code (behavior () (set! (-> self move-rate) (* 4096.0 (rand-vu-float-range 0.5 1.5))) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.25)) + (until (time-elapsed? gp-0 (seconds 0.25)) (suspend) ) ) (logclear! (-> self root root-prim prim-core action) (collide-action rideable)) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 1)) + (until (time-elapsed? gp-1 (seconds 1)) (suspend) ) ) @@ -1560,24 +1559,24 @@ This commonly includes things such as: ;; definition for method 41 of type tomb-simon-block ;; WARN: Return type mismatch time-frame vs none. -(defmethod set-blink-timers! tomb-simon-block ((obj tomb-simon-block)) - (logior! (-> obj flags) (simon-block-flags sbf0 sbf1)) - (set! (-> obj blink-timer 0) (current-time)) - (set! (-> obj blink-timer 1) (current-time)) +(defmethod set-blink-timers! tomb-simon-block ((this tomb-simon-block)) + (logior! (-> this flags) (simon-block-flags sbf0 sbf1)) + (set-time! (-> this blink-timer 0)) + (set-time! (-> this blink-timer 1)) (none) ) ;; definition for method 30 of type tomb-simon-block -(defmethod get-art-group tomb-simon-block ((obj tomb-simon-block)) +(defmethod get-art-group tomb-simon-block ((this tomb-simon-block)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-tomb-simon-block" (the-as (pointer uint32) #f)) ) ;; definition for method 31 of type tomb-simon-block ;; WARN: Return type mismatch collide-shape vs none. -(defmethod init-plat-collision! tomb-simon-block ((obj tomb-simon-block)) +(defmethod init-plat-collision! tomb-simon-block ((this tomb-simon-block)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1593,7 +1592,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) (none) ) @@ -1645,19 +1644,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-simon-button -(defmethod inspect tomb-simon-button ((obj tomb-simon-button)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-simon-button ((this tomb-simon-button)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tnotify-actor: ~A~%" (-> obj notify-actor)) - (format #t "~2Ton-notice: ~A~%" (-> obj on-notice)) - (format #t "~2Ton-activate: ~A~%" (-> obj on-activate)) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~2Ton-notice: ~A~%" (-> this on-notice)) + (format #t "~2Ton-activate: ~A~%" (-> this on-activate)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1809,14 +1808,14 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-simon-button ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-simon-button ((obj tomb-simon-button) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-simon-button ((this tomb-simon-button) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 5) 0))) (set! (-> s4-0 total-prims) (the-as uint 6)) (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) @@ -1866,41 +1865,41 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-21 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-21 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-simon-button" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) - (set! (-> obj on-notice) (res-lump-struct (-> obj entity) 'on-notice (function none))) - (set! (-> obj on-activate) (res-lump-struct (-> obj entity) 'on-activate (function none))) - (let ((a0-42 (-> obj skel root-channel 0))) - (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this on-notice) (res-lump-struct (-> this entity) 'on-notice (function none))) + (set! (-> this on-activate) (res-lump-struct (-> this entity) 'on-activate (function none))) + (let ((a0-42 (-> this skel root-channel 0))) + (set! (-> a0-42 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-42 param 0) 1.0) (set! (-> a0-42 frame-num) 0.0) - (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-loop!) + (joint-control-channel-group! a0-42 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-loop!) ) (transform-post) - (let ((s5-1 (-> obj on-notice))) + (let ((s5-1 (-> this on-notice))) (when s5-1 (if (script-eval (the-as pair s5-1)) - (go (method-of-object obj open) #t) + (go (method-of-object this open) #t) ) ) ) - (let ((v1-49 (-> obj entity extra perm user-uint8 0))) + (let ((v1-49 (-> this entity extra perm user-uint8 0))) (cond ((zero? v1-49) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ((= v1-49 1) - (go (method-of-object obj open) #t) + (go (method-of-object this open) #t) ) ((= v1-49 2) - (go (method-of-object obj pressed) #t) + (go (method-of-object this pressed) #t) ) ) ) @@ -1934,30 +1933,30 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-vibe -(defmethod inspect tomb-vibe ((obj tomb-vibe)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-vibe ((this tomb-vibe)) + (when (not this) + (set! this this) (goto cfg-7) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tspawn-pos: #~%" (-> obj spawn-pos)) - (format #t "~2Tpat-tbl: #x~X~%" (-> obj pat-tbl)) - (format #t "~2Tpat-count: ~D~%" (-> obj pat-count)) - (format #t "~2Tpat-index: ~D~%" (-> obj pat-index)) - (format #t "~2Tpat-entry-index: ~D~%" (-> obj pat-entry-index)) - (format #t "~2Tpat-timer: ~D~%" (-> obj pat-timer)) - (format #t "~2Tpat-duration: ~D~%" (-> obj pat-duration)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (dotimes (s5-0 (-> obj actor-group-count)) - (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> obj actor-group s5-0)) + (format #t "~2Tspawn-pos: #~%" (-> this spawn-pos)) + (format #t "~2Tpat-tbl: #x~X~%" (-> this pat-tbl)) + (format #t "~2Tpat-count: ~D~%" (-> this pat-count)) + (format #t "~2Tpat-index: ~D~%" (-> this pat-index)) + (format #t "~2Tpat-entry-index: ~D~%" (-> this pat-entry-index)) + (format #t "~2Tpat-timer: ~D~%" (-> this pat-timer)) + (format #t "~2Tpat-duration: ~D~%" (-> this pat-duration)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) ) - (format #t "~2Tactor-group-count: ~D~%" (-> obj actor-group-count)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Ton-activate: ~A~%" (-> obj on-activate)) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Ton-activate: ~A~%" (-> this on-activate)) (label cfg-7) - obj + this ) ;; failed to figure out what this is: @@ -2006,7 +2005,7 @@ This commonly includes things such as: ) ) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.45)) + (until (time-elapsed? gp-0 (seconds 0.45)) (suspend) ) ) @@ -2109,7 +2108,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self pat-entry-index) 0) (set-vector! (-> self draw color-mult) 0.9 0.9 0.9 1.0) (let ((gp-0 (-> self actor-group 0))) @@ -2150,7 +2149,7 @@ This commonly includes things such as: ) :code (behavior () (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 0.2)) + (until (time-elapsed? gp-0 (seconds 0.2)) (suspend) ) ) @@ -2164,7 +2163,7 @@ This commonly includes things such as: (+ (-> self pat-tbl (-> self pat-index)) 18) ) (let ((gp-1 (current-time))) - (until (>= (- (current-time) gp-1) (seconds 0.2)) + (until (time-elapsed? gp-1 (seconds 0.2)) (suspend) ) ) @@ -2174,7 +2173,7 @@ This commonly includes things such as: (f30-0 1.0) ) (ja-no-eval :group! (-> self draw art-group data 4) :num! (loop! f30-0) :frame-num 0.0) - (until (>= (- (current-time) gp-2) s5-0) + (until (time-elapsed? gp-2 s5-0) (suspend) (ja :num! (loop! f30-0)) ) @@ -2255,7 +2254,7 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-vibe ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-vibe ((obj tomb-vibe) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-vibe ((this tomb-vibe) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2264,7 +2263,7 @@ This commonly includes things such as: - sounds" (local-vars (sv-16 res-tag) (sv-32 res-tag)) (with-pp - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec camera-blocker pusher)) @@ -2294,59 +2293,59 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-vibe" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj entity) arg0) - (set! (-> obj spawn-pos quad) (-> obj root trans quad)) - (+! (-> obj spawn-pos y) 81.92) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (set! (-> this entity) arg0) + (set! (-> this spawn-pos quad) (-> this root trans quad)) + (+! (-> this spawn-pos y) 81.92) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-26 (res-lump-data (-> obj entity) 'vibe-pattern pointer :tag-ptr (& sv-16)))) + (let ((v1-26 (res-lump-data (-> this entity) 'vibe-pattern pointer :tag-ptr (& sv-16)))) (cond ((and v1-26 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj pat-tbl) (the-as (pointer int32) v1-26)) - (set! (-> obj pat-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this pat-tbl) (the-as (pointer int32) v1-26)) + (set! (-> this pat-count) (the-as int (-> sv-16 elt-count))) ) (else - (set! (-> obj pat-tbl) (the-as (pointer int32) #f)) - (set! (-> obj pat-count) 0) + (set! (-> this pat-tbl) (the-as (pointer int32) #f)) + (set! (-> this pat-count) 0) 0 ) ) ) (set! sv-32 (new 'static 'res-tag)) - (let ((v1-33 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-32)))) + (let ((v1-33 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-32)))) (cond ((and v1-33 (nonzero? (-> sv-32 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) v1-33)) - (set! (-> obj actor-group-count) (the-as int (-> sv-32 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-33)) + (set! (-> this actor-group-count) (the-as int (-> sv-32 elt-count))) ) (else - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) - (set! (-> obj actor-group-count) 0) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group-count) 0) 0 ) ) ) - (when (logtest? (actor-option user17) (-> obj fact options)) - (let ((s5-1 (-> obj entity extra perm))) + (when (logtest? (actor-option user17) (-> this fact options)) + (let ((s5-1 (-> this entity extra perm))) (when (not (logtest? (-> s5-1 status) (entity-perm-status bit-5))) - (set! (-> s5-1 user-object 0) (rand-vu-int-range 0 (+ (-> obj pat-count) -1))) + (set! (-> s5-1 user-object 0) (rand-vu-int-range 0 (+ (-> this pat-count) -1))) (logior! (-> s5-1 status) (entity-perm-status bit-5)) ) (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) (let ((v1-56 (-> *event-queue* data (-> *event-queue* length)))) (+! (-> *event-queue* length) 1) (set! (-> v1-56 form-handle) (process->handle pp)) - (set! (-> v1-56 to-handle) (process->handle obj)) + (set! (-> v1-56 to-handle) (process->handle this)) (set! (-> v1-56 num-params) 1) (set! (-> v1-56 message) 'set-pattern) (set! (-> v1-56 param 0) (the-as uint (-> s5-1 user-object 0))) @@ -2354,25 +2353,25 @@ This commonly includes things such as: ) ) ) - (set! (-> obj pat-index) -1) + (set! (-> this pat-index) -1) (ja-channel-push! 1 0) - (let ((a0-53 (-> obj skel root-channel 0))) - (set! (-> a0-53 frame-group) (the-as art-joint-anim (-> obj draw art-group data 3))) + (let ((a0-53 (-> this skel root-channel 0))) + (set! (-> a0-53 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) (set! (-> a0-53 frame-num) 0.0) - (joint-control-channel-group! a0-53 (the-as art-joint-anim (-> obj draw art-group data 3)) num-func-identity) + (joint-control-channel-group! a0-53 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) ) (transform-post) - (set! (-> obj flags) (tomb-vibe-flags)) - (set! (-> obj event-hook) (-> (method-of-type tomb-vibe idle) event)) + (set! (-> this flags) (tomb-vibe-flags)) + (set! (-> this event-hook) (-> (method-of-type tomb-vibe idle) event)) (cond - ((logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)) - (go (method-of-object obj die) #t) + ((logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (go (method-of-object this die) #t) ) - ((logtest? (actor-option user17) (-> obj fact options)) - (go (method-of-object obj idle)) + ((logtest? (actor-option user17) (-> this fact options)) + (go (method-of-object this idle)) ) (else - (go (method-of-object obj get-pattern)) + (go (method-of-object this get-pattern)) ) ) (none) @@ -2407,27 +2406,27 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-water-trap -(defmethod inspect tomb-water-trap ((obj tomb-water-trap)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-water-trap ((this tomb-water-trap)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbbox: #~%" (-> obj bbox)) - (format #t "~2Trun-bbox: #~%" (-> obj run-bbox)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Ton-duration: ~D~%" (-> obj on-duration)) - (format #t "~2Tharmless-time: ~D~%" (-> obj harmless-time)) - (format #t "~2Tl-spec: ~A~%" (-> obj l-spec)) - (format #t "~2Tl-count: ~D~%" (-> obj l-count)) - (format #t "~2Tl-index: ~A~%" (-> obj l-index)) - (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) - (format #t "~2Tvolume: ~f~%" (-> obj volume)) - (format #t "~2Tcan-exit-running?: ~A~%" (-> obj can-exit-running?)) + (format #t "~2Tbbox: #~%" (-> this bbox)) + (format #t "~2Trun-bbox: #~%" (-> this run-bbox)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Ton-duration: ~D~%" (-> this on-duration)) + (format #t "~2Tharmless-time: ~D~%" (-> this harmless-time)) + (format #t "~2Tl-spec: ~A~%" (-> this l-spec)) + (format #t "~2Tl-count: ~D~%" (-> this l-count)) + (format #t "~2Tl-index: ~A~%" (-> this l-index)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tvolume: ~f~%" (-> this volume)) + (format #t "~2Tcan-exit-running?: ~A~%" (-> this can-exit-running?)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2490,7 +2489,7 @@ This commonly includes things such as: (let ((gp-0 0) (s5-0 (current-time)) ) - (until (>= (- (current-time) s5-0) (-> self on-duration)) + (until (time-elapsed? s5-0 (-> self on-duration)) (when (< (-> self harmless-time) (current-time)) (tomb-water-trap-method-22 self) (dotimes (s4-0 (+ (-> self path curve num-cverts) -1)) @@ -2534,17 +2533,18 @@ This commonly includes things such as: (set! (-> self can-exit-running?) #t) (let ((gp-1 90)) (let ((s5-1 (current-time))) - (until (>= (- (current-time) s5-1) gp-1) + (until (time-elapsed? s5-1 gp-1) (suspend) ) ) (let ((s5-2 #f) (s4-2 (current-time)) ) - (until (>= (- (current-time) s4-2) - (the-as time-frame (- (- (-> self sync period) (the-as uint (-> self on-duration))) (the-as uint gp-1))) - ) - (when (and (not s5-2) (>= (- (current-time) s4-2) (seconds 0.3))) + (until (time-elapsed? + s4-2 + (the-as time-frame (- (- (-> self sync period) (the-as uint (-> self on-duration))) (the-as uint gp-1))) + ) + (when (and (not s5-2) (time-elapsed? s4-2 (seconds 0.3))) (set! s5-2 #t) (set-tombc-electricity-scale! 0.0) ) @@ -2563,14 +2563,14 @@ This commonly includes things such as: ) ;; definition for method 22 of type tomb-water-trap -(defmethod tomb-water-trap-method-22 tomb-water-trap ((obj tomb-water-trap)) +(defmethod tomb-water-trap-method-22 tomb-water-trap ((this tomb-water-trap)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 collide-with) (collide-spec jak bot player-list)) - (set! (-> gp-0 ignore-process0) obj) + (set! (-> gp-0 ignore-process0) this) (set! (-> gp-0 ignore-process1) #f) (set! (-> gp-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> gp-0 action-mask) (collide-action solid)) - (mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer (-> obj bbox)) 32) + (mem-copy! (the-as pointer (-> gp-0 bbox)) (the-as pointer (-> this bbox)) 32) (fill-using-bounding-box *collide-cache* gp-0) ) (none) @@ -2579,7 +2579,7 @@ This commonly includes things such as: ;; definition for method 23 of type tomb-water-trap ;; INFO: Used lq/sq ;; WARN: Return type mismatch time-frame vs none. -(defmethod tomb-water-trap-method-23 tomb-water-trap ((obj tomb-water-trap) (arg0 vector) (arg1 vector)) +(defmethod tomb-water-trap-method-23 tomb-water-trap ((this tomb-water-trap) (arg0 vector) (arg1 vector)) (let ((s4-0 (new 'stack-no-clear 'collide-query)) (s3-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) ) @@ -2588,7 +2588,7 @@ This commonly includes things such as: (let ((v1-3 s4-0)) (set! (-> v1-3 radius) 2048.0) (set! (-> v1-3 collide-with) (collide-spec jak bot player-list)) - (set! (-> v1-3 ignore-process0) obj) + (set! (-> v1-3 ignore-process0) this) (set! (-> v1-3 ignore-process1) #f) (set! (-> v1-3 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-3 action-mask) (collide-action solid semi-solid)) @@ -2603,7 +2603,7 @@ This commonly includes things such as: ) (when s4-1 (let ((s2-2 (vector+float*! (new 'stack-no-clear 'vector) arg0 s3-1 f30-0))) - (tomb-water-trap-method-24 obj arg0 s2-2 (the int (* 3.0 (rand-vu-float-range 5.0 11.0)))) + (tomb-water-trap-method-24 this arg0 s2-2 (the int (* 3.0 (rand-vu-float-range 5.0 11.0)))) ) (let ((v1-10 (vector-reset! (new 'stack-no-clear 'vector)))) (if (send-event @@ -2611,10 +2611,10 @@ This commonly includes things such as: 'attack #f (static-attack-info - ((id (-> obj attack-id)) (invinc-time (seconds 3)) (mode 'shock) (vector v1-10) (shove-up (meters 3))) + ((id (-> this attack-id)) (invinc-time (seconds 3)) (mode 'shock) (vector v1-10) (shove-up (meters 3))) ) ) - (set! (-> obj harmless-time) (+ (current-time) (seconds 3))) + (set! (-> this harmless-time) (+ (current-time) (seconds 3))) ) ) ) @@ -2627,11 +2627,11 @@ This commonly includes things such as: ;; definition for method 24 of type tomb-water-trap ;; INFO: Used lq/sq -(defmethod tomb-water-trap-method-24 tomb-water-trap ((obj tomb-water-trap) (arg0 vector) (arg1 vector) (arg2 int)) +(defmethod tomb-water-trap-method-24 tomb-water-trap ((this tomb-water-trap) (arg0 vector) (arg1 vector) (arg2 int)) (let ((v1-1 (process-spawn lightning-tracker :init lightning-tracker-init - (-> obj l-spec) + (-> this l-spec) (+ arg2 120) #f #f @@ -2654,32 +2654,32 @@ This commonly includes things such as: ) (set! (-> s2-2 trans quad) (-> arg0 quad)) (set! (-> s3-3 trans quad) (-> arg1 quad)) - (spawn-with-matrix (-> obj part) s2-2) - (spawn-with-matrix (-> obj part) s3-3) + (spawn-with-matrix (-> this part) s2-2) + (spawn-with-matrix (-> this part) s3-3) ) (none) ) ;; definition for method 7 of type tomb-water-trap ;; WARN: Return type mismatch process-drawable vs tomb-water-trap. -(defmethod relocate tomb-water-trap ((obj tomb-water-trap) (arg0 int)) - (if (nonzero? (-> obj l-index)) - (&+! (-> obj l-index) arg0) +(defmethod relocate tomb-water-trap ((this tomb-water-trap) (arg0 int)) + (if (nonzero? (-> this l-index)) + (&+! (-> this l-index) arg0) ) - (the-as tomb-water-trap ((method-of-type process-drawable relocate) obj arg0)) + (the-as tomb-water-trap ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type tomb-water-trap ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-water-trap ((obj tomb-water-trap) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-water-trap ((this tomb-water-trap) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (let ((a1-3 (new 'stack-no-clear 'sync-info-params))) (let ((v1-1 0)) (if #t @@ -2691,74 +2691,74 @@ This commonly includes things such as: (set! (-> a1-3 entity) arg0) (set! (-> a1-3 period) (the-as uint 2400)) (set! (-> a1-3 percent) 0.75) - (initialize! (-> obj sync) a1-3) + (initialize! (-> this sync) a1-3) ) - (set! (-> obj on-duration) (the-as time-frame (the int (-> obj sync offset)))) - (set! (-> obj harmless-time) 0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 arg0 #f)) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this on-duration) (the-as time-frame (the int (-> this sync offset)))) + (set! (-> this harmless-time) 0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s5-1 (new 'stack-no-clear 'sphere))) - (get-point-in-path! (-> obj path) s5-1 0.0 'interp) + (get-point-in-path! (-> this path) s5-1 0.0 'interp) (set! (-> s5-1 r) 4096.0) - (set-from-sphere! (-> obj bbox) s5-1) - (countdown (s4-0 (+ (-> obj path curve num-cverts) -1)) + (set-from-sphere! (-> this bbox) s5-1) + (countdown (s4-0 (+ (-> this path curve num-cverts) -1)) (add-point! - (-> obj bbox) - (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) (the float s4-0) 'interp) + (-> this bbox) + (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) (the float s4-0) 'interp) ) ) - (get-bounding-sphere (-> obj bbox) s5-1) + (get-bounding-sphere (-> this bbox) s5-1) (+! (-> s5-1 r) 81920.0) - (set-from-sphere! (-> obj run-bbox) s5-1) + (set-from-sphere! (-> this run-bbox) s5-1) ) (let* ((v1-29 *game-info*) (a0-17 (+ (-> v1-29 attack-id) 1)) ) (set! (-> v1-29 attack-id) a0-17) - (set! (-> obj attack-id) a0-17) + (set! (-> this attack-id) a0-17) ) - (set! (-> obj l-spec) (new 'static 'lightning-spec - :name #f - :flags (lightning-spec-flags lsf2) - :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) - :end-color (new 'static 'rgba :a #x80) - :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) - :fade-start-factor 0.2 - :fade-time 120.0 - :texture (new 'static 'texture-id :index #x83 :page #xc) - :reduction 0.42 - :num-points 12 - :box-size 14336.0 - :merge-factor 0.5 - :merge-count 4 - :radius 3276.8 - :duration -1.0 - :sound #f - ) + (set! (-> this l-spec) (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf2) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x83 :page #xc) + :reduction 0.42 + :num-points 12 + :box-size 14336.0 + :merge-factor 0.5 + :merge-count 4 + :radius 3276.8 + :duration -1.0 + :sound #f + ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 696) obj)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 696) this)) (let ((a3-3 (new 'stack-no-clear 'vector))) - (set! (-> a3-3 x) (* 0.5 (+ (-> obj bbox min x) (-> obj bbox max x)))) - (set! (-> a3-3 y) (* 0.5 (+ (-> obj bbox min y) (-> obj bbox max y)))) - (set! (-> a3-3 z) (* 0.5 (+ (-> obj bbox min z) (-> obj bbox max z)))) - (set! (-> obj sound) (new 'process 'ambient-sound (static-sound-spec "water-trap-zap" :fo-max 55) a3-3)) + (set! (-> a3-3 x) (* 0.5 (+ (-> this bbox min x) (-> this bbox max x)))) + (set! (-> a3-3 y) (* 0.5 (+ (-> this bbox min y) (-> this bbox max y)))) + (set! (-> a3-3 z) (* 0.5 (+ (-> this bbox min z) (-> this bbox max z)))) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "water-trap-zap" :fo-max 55) a3-3)) ) - (set! (-> obj volume) 0.0) - (let ((a0-20 (-> obj entity))) - (set! (-> obj l-count) (the-as uint ((method-of-object a0-20 get-property-value) - a0-20 - 'bolt-count - 'interp - -1000000000.0 - (the-as uint128 8) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (set! (-> this volume) 0.0) + (let ((a0-20 (-> this entity))) + (set! (-> this l-count) (the-as uint ((method-of-object a0-20 get-property-value) + a0-20 + 'bolt-count + 'interp + -1000000000.0 + (the-as uint128 8) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) ) ) - (set! (-> obj l-index) (new 'process 'boxed-array uint32 (the-as int (-> obj l-count)))) - (go (method-of-object obj idle)) + (set! (-> this l-index) (new 'process 'boxed-array uint32 (the-as int (-> this l-count)))) + (go (method-of-object this idle)) (none) ) @@ -2779,18 +2779,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-smash-door -(defmethod inspect tomb-smash-door ((obj tomb-smash-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-smash-door ((this tomb-smash-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttimeout: ~D~%" (-> obj timeout)) - (format #t "~2Tbutton: ~D~%" (-> obj button)) + (format #t "~2Ttimeout: ~D~%" (-> this timeout)) + (format #t "~2Tbutton: ~D~%" (-> this button)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2817,10 +2817,10 @@ This commonly includes things such as: (defstate open (tomb-smash-door) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (-> self timeout)) + (when (time-elapsed? (-> self state-time) (-> self timeout)) (let* ((s5-0 *target*) (gp-0 (if (type? s5-0 process-focusable) s5-0 @@ -2878,14 +2878,14 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-smash-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-smash-door ((obj tomb-smash-door) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-smash-door ((this tomb-smash-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec camera-blocker pusher)) @@ -2914,18 +2914,18 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-15 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-15 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-smash-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (let ((f30-0 300.0) - (a0-22 (-> obj entity)) + (a0-22 (-> this entity)) ) - (set! (-> obj timeout) + (set! (-> this timeout) (the-as time-frame (the int (* f30-0 ((method-of-object a0-22 get-property-value-float) a0-22 'timeout @@ -2941,12 +2941,12 @@ This commonly includes things such as: ) ) (ja-channel-push! 1 0) - (let ((a0-24 (-> obj skel root-channel 0))) - (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-24 (-> this skel root-channel 0))) + (set! (-> a0-24 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-24 frame-num) 0.0) - (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-24 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc index a2d4680e06..2a7683947f 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-baron_REF.gc @@ -24,81 +24,81 @@ ) ;; definition for method 3 of type widow-float-seeker -(defmethod inspect widow-float-seeker ((obj widow-float-seeker)) - (when (not obj) - (set! obj obj) +(defmethod inspect widow-float-seeker ((this widow-float-seeker)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'widow-float-seeker) - (format #t "~1Ttarget: ~f~%" (-> obj target)) - (format #t "~1Tvalue: ~f~%" (-> obj value)) - (format #t "~1Tvel: ~f~%" (-> obj vel)) - (format #t "~1Taccel: ~f~%" (-> obj accel)) - (format #t "~1Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~1Tmax-partial: ~f~%" (-> obj max-partial)) - (format #t "~1Tbounce-high: ~f~%" (-> obj bounce-high)) + (format #t "[~8x] ~A~%" this 'widow-float-seeker) + (format #t "~1Ttarget: ~f~%" (-> this target)) + (format #t "~1Tvalue: ~f~%" (-> this value)) + (format #t "~1Tvel: ~f~%" (-> this vel)) + (format #t "~1Taccel: ~f~%" (-> this accel)) + (format #t "~1Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~1Tmax-partial: ~f~%" (-> this max-partial)) + (format #t "~1Tbounce-high: ~f~%" (-> this bounce-high)) (label cfg-4) - obj + this ) ;; definition for method 9 of type widow-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod widow-float-seeker-method-9 widow-float-seeker ((obj widow-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) - (set! (-> obj target) arg0) - (set! (-> obj value) arg0) - (set! (-> obj vel) 0.0) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj max-partial) arg3) - (set! (-> obj bounce-high) arg4) +(defmethod widow-float-seeker-method-9 widow-float-seeker ((this widow-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (set! (-> this target) arg0) + (set! (-> this value) arg0) + (set! (-> this vel) 0.0) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this max-partial) arg3) + (set! (-> this bounce-high) arg4) 0 (none) ) ;; definition for method 10 of type widow-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod widow-float-seeker-method-10 widow-float-seeker ((obj widow-float-seeker) (arg0 (pointer float))) - (set! (-> obj target) (-> arg0 0)) - (set! (-> obj value) (-> arg0 1)) - (set! (-> obj vel) (-> arg0 2)) - (set! (-> obj accel) (-> arg0 3)) - (set! (-> obj max-vel) (-> arg0 4)) - (set! (-> obj max-partial) (-> arg0 5)) - (set! (-> obj bounce-high) (-> arg0 6)) +(defmethod widow-float-seeker-method-10 widow-float-seeker ((this widow-float-seeker) (arg0 (pointer float))) + (set! (-> this target) (-> arg0 0)) + (set! (-> this value) (-> arg0 1)) + (set! (-> this vel) (-> arg0 2)) + (set! (-> this accel) (-> arg0 3)) + (set! (-> this max-vel) (-> arg0 4)) + (set! (-> this max-partial) (-> arg0 5)) + (set! (-> this bounce-high) (-> arg0 6)) 0 (none) ) ;; definition for method 11 of type widow-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod widow-float-seeker-method-11 widow-float-seeker ((obj widow-float-seeker) (arg0 float)) +(defmethod widow-float-seeker-method-11 widow-float-seeker ((this widow-float-seeker) (arg0 float)) (with-pp 0.0 0.0 - (let* ((f1-2 (- (+ (-> obj target) arg0) (-> obj value))) - (f0-6 (if (= (-> obj target) 0.0) - (* (-> obj max-partial) (fabs f1-2)) - (-> obj max-vel) + (let* ((f1-2 (- (+ (-> this target) arg0) (-> this value))) + (f0-6 (if (= (-> this target) 0.0) + (* (-> this max-partial) (fabs f1-2)) + (-> this max-vel) ) ) ) - (let ((f1-3 (* f1-2 (* (-> obj accel) (-> pp clock time-adjust-ratio))))) - (+! (-> obj vel) f1-3) + (let ((f1-3 (* f1-2 (* (-> this accel) (-> pp clock time-adjust-ratio))))) + (+! (-> this vel) f1-3) ) - (let ((f1-6 (fabs (-> obj vel))) - (f0-7 (fmin f0-6 (-> obj max-vel))) + (let ((f1-6 (fabs (-> this vel))) + (f0-7 (fmin f0-6 (-> this max-vel))) ) (if (< f0-7 f1-6) - (set! (-> obj vel) (* (-> obj vel) (/ f0-7 f1-6))) + (set! (-> this vel) (* (-> this vel) (/ f0-7 f1-6))) ) ) ) - (let ((f0-11 (* (-> obj vel) (-> pp clock time-adjust-ratio)))) - (+! (-> obj value) f0-11) + (let ((f0-11 (* (-> this vel) (-> pp clock time-adjust-ratio)))) + (+! (-> this value) f0-11) ) - (when (and (!= (-> obj target) 0.0) (>= (-> obj value) (-> obj target)) (< 0.0 (-> obj vel))) - (set! (-> obj value) (-> obj target)) - (set! (-> obj vel) (* (-> obj vel) (- (-> obj bounce-high)))) + (when (and (!= (-> this target) 0.0) (>= (-> this value) (-> this target)) (< 0.0 (-> this vel))) + (set! (-> this value) (-> this target)) + (set! (-> this vel) (* (-> this vel) (- (-> this bounce-high)))) ) 0 (none) @@ -107,9 +107,9 @@ ;; definition for method 12 of type widow-float-seeker ;; WARN: Return type mismatch int vs none. -(defmethod widow-float-seeker-method-12 widow-float-seeker ((obj widow-float-seeker) (arg0 float)) - (set! (-> obj value) (+ (-> obj target) arg0)) - (set! (-> obj vel) 0.0) +(defmethod widow-float-seeker-method-12 widow-float-seeker ((this widow-float-seeker) (arg0 float)) + (set! (-> this value) (+ (-> this target) arg0)) + (set! (-> this vel) 0.0) 0 (none) ) @@ -133,47 +133,47 @@ ) ;; definition for method 3 of type widow-rand-vector -(defmethod inspect widow-rand-vector ((obj widow-rand-vector)) - (when (not obj) - (set! obj obj) +(defmethod inspect widow-rand-vector ((this widow-rand-vector)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'widow-rand-vector) - (format #t "~1Tmin-time: ~D~%" (-> obj min-time)) - (format #t "~1Tmax-time: ~D~%" (-> obj max-time)) - (format #t "~1Txz-max: ~f~%" (-> obj xz-max)) - (format #t "~1Ty-max: ~f~%" (-> obj y-max)) - (format #t "~1Ttimer: ~D~%" (-> obj timer)) - (format #t "~1Tvalue: #~%" (-> obj value)) + (format #t "[~8x] ~A~%" this 'widow-rand-vector) + (format #t "~1Tmin-time: ~D~%" (-> this min-time)) + (format #t "~1Tmax-time: ~D~%" (-> this max-time)) + (format #t "~1Txz-max: ~f~%" (-> this xz-max)) + (format #t "~1Ty-max: ~f~%" (-> this y-max)) + (format #t "~1Ttimer: ~D~%" (-> this timer)) + (format #t "~1Tvalue: #~%" (-> this value)) (label cfg-4) - obj + this ) ;; definition for method 9 of type widow-rand-vector ;; WARN: Return type mismatch int vs none. -(defmethod init widow-rand-vector ((obj widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) - (set! (-> obj min-time) arg0) - (set! (-> obj max-time) arg1) - (set! (-> obj xz-max) (* 0.5 arg2)) - (set! (-> obj y-max) (* 0.5 arg3)) - (set! (-> obj timer) 0) - (vector-reset! (-> obj value)) +(defmethod init widow-rand-vector ((this widow-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float)) + (set! (-> this min-time) arg0) + (set! (-> this max-time) arg1) + (set! (-> this xz-max) (* 0.5 arg2)) + (set! (-> this y-max) (* 0.5 arg3)) + (set! (-> this timer) 0) + (vector-reset! (-> this value)) 0 (none) ) ;; definition for method 10 of type widow-rand-vector ;; WARN: Return type mismatch int vs none. -(defmethod widow-rand-vector-method-10 widow-rand-vector ((obj widow-rand-vector)) +(defmethod widow-rand-vector-method-10 widow-rand-vector ((this widow-rand-vector)) (with-pp - (set! (-> obj timer) - (- (the-as time-frame (-> obj timer)) (- (current-time) (-> pp clock old-frame-counter))) + (set! (-> this timer) + (- (the-as time-frame (-> this timer)) (- (current-time) (-> pp clock old-frame-counter))) ) - (when (<= (-> obj timer) 0) - (set! (-> obj timer) (rand-vu-int-range (-> obj min-time) (-> obj max-time))) - (set! (-> obj value x) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) - (set! (-> obj value y) (rand-vu-float-range (- (-> obj y-max)) (-> obj y-max))) - (set! (-> obj value z) (rand-vu-float-range (- (-> obj xz-max)) (-> obj xz-max))) + (when (<= (-> this timer) 0) + (set! (-> this timer) (rand-vu-int-range (-> this min-time) (-> this max-time))) + (set! (-> this value x) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) + (set! (-> this value y) (rand-vu-float-range (- (-> this y-max)) (-> this y-max))) + (set! (-> this value z) (rand-vu-float-range (- (-> this xz-max)) (-> this xz-max))) ) 0 (none) @@ -199,70 +199,70 @@ ) ;; definition for method 3 of type widow-oscillator -(defmethod inspect widow-oscillator ((obj widow-oscillator)) - (when (not obj) - (set! obj obj) +(defmethod inspect widow-oscillator ((this widow-oscillator)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'widow-oscillator) - (format #t "~1Ttarget: #~%" (-> obj target)) - (format #t "~1Tvalue: #~%" (-> obj value)) - (format #t "~1Tvel: #~%" (-> obj vel)) - (format #t "~1Taccel: ~f~%" (-> obj accel)) - (format #t "~1Tmax-vel: ~f~%" (-> obj max-vel)) - (format #t "~1Tdamping: ~f~%" (-> obj damping)) + (format #t "[~8x] ~A~%" this 'widow-oscillator) + (format #t "~1Ttarget: #~%" (-> this target)) + (format #t "~1Tvalue: #~%" (-> this value)) + (format #t "~1Tvel: #~%" (-> this vel)) + (format #t "~1Taccel: ~f~%" (-> this accel)) + (format #t "~1Tmax-vel: ~f~%" (-> this max-vel)) + (format #t "~1Tdamping: ~f~%" (-> this damping)) (label cfg-4) - obj + this ) ;; definition for method 9 of type widow-oscillator ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod widow-oscillator-method-9 widow-oscillator ((obj widow-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) +(defmethod widow-oscillator-method-9 widow-oscillator ((this widow-oscillator) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) (cond (arg0 - (set! (-> obj target quad) (-> arg0 quad)) - (set! (-> obj value quad) (-> arg0 quad)) + (set! (-> this target quad) (-> arg0 quad)) + (set! (-> this value quad) (-> arg0 quad)) ) (else - (vector-reset! (-> obj target)) - (vector-reset! (-> obj value)) + (vector-reset! (-> this target)) + (vector-reset! (-> this value)) ) ) - (vector-reset! (-> obj vel)) - (set! (-> obj accel) arg1) - (set! (-> obj max-vel) arg2) - (set! (-> obj damping) arg3) + (vector-reset! (-> this vel)) + (set! (-> this accel) arg1) + (set! (-> this max-vel) arg2) + (set! (-> this damping) arg3) 0 (none) ) ;; definition for method 10 of type widow-oscillator ;; WARN: Return type mismatch int vs none. -(defmethod widow-oscillator-method-10 widow-oscillator ((obj widow-oscillator) (arg0 vector)) +(defmethod widow-oscillator-method-10 widow-oscillator ((this widow-oscillator) (arg0 vector)) (with-pp (let ((gp-0 (new 'stack-no-clear 'vector))) - (let ((f30-0 (fmax (-> obj max-vel) (vector-length (-> obj vel))))) + (let ((f30-0 (fmax (-> this max-vel) (vector-length (-> this vel))))) (cond (arg0 - (vector+! gp-0 (-> obj target) arg0) - (vector-! gp-0 gp-0 (-> obj value)) + (vector+! gp-0 (-> this target) arg0) + (vector-! gp-0 gp-0 (-> this value)) ) (else - (vector-! gp-0 (-> obj target) (-> obj value)) + (vector-! gp-0 (-> this target) (-> this value)) ) ) - (vector-normalize! gp-0 (* (-> obj accel) (-> pp clock time-adjust-ratio))) - (vector+! (-> obj vel) (-> obj vel) gp-0) - (let ((f0-3 (vector-length (-> obj vel)))) + (vector-normalize! gp-0 (* (-> this accel) (-> pp clock time-adjust-ratio))) + (vector+! (-> this vel) (-> this vel) gp-0) + (let ((f0-3 (vector-length (-> this vel)))) (if (< f30-0 f0-3) - (vector-float*! (-> obj vel) (-> obj vel) (/ f30-0 f0-3)) + (vector-float*! (-> this vel) (-> this vel) (/ f30-0 f0-3)) ) ) ) - (vector-float*! (-> obj vel) (-> obj vel) (-> obj damping)) - (vector-float*! gp-0 (-> obj vel) (-> pp clock time-adjust-ratio)) - (vector+! (-> obj value) (-> obj value) gp-0) + (vector-float*! (-> this vel) (-> this vel) (-> this damping)) + (vector-float*! gp-0 (-> this vel) (-> pp clock time-adjust-ratio)) + (vector+! (-> this value) (-> this value) gp-0) ) 0 (none) @@ -287,16 +287,16 @@ ) ;; definition for method 3 of type widow-shot -(defmethod inspect widow-shot ((obj widow-shot)) - (when (not obj) - (set! obj obj) +(defmethod inspect widow-shot ((this widow-shot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type guard-shot inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type widow @@ -409,87 +409,87 @@ ) ;; definition for method 3 of type widow -(defmethod inspect widow ((obj widow)) - (when (not obj) - (set! obj obj) +(defmethod inspect widow ((this widow)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbomb[8] @ #x~X~%" (-> obj bomb)) - (format #t "~2Tnext-launch: ~D~%" (-> obj next-launch)) - (format #t "~2Tlaunch-dest: #~%" (-> obj launch-dest)) - (format #t "~2Tnext-jumper: ~D~%" (-> obj next-jumper)) - (format #t "~2Tammos[2] @ #x~X~%" (-> obj ammos)) - (format #t "~2Tammo-timers[2] @ #x~X~%" (-> obj ammo-timers)) - (format #t "~2Tbomb-hits: ~D~%" (-> obj bomb-hits)) - (format #t "~2Tcircle-center: #~%" (-> obj circle-center)) - (format #t "~2Ttheta: #~%" (-> obj theta)) - (format #t "~2Ttraj: #~%" (-> obj traj)) - (format #t "~2Tosc: #~%" (-> obj osc)) - (format #t "~2Tnoise-osc: #~%" (-> obj noise-osc)) - (format #t "~2Trand-vec: #~%" (-> obj rand-vec)) - (format #t "~2Tattack-from-high-deg: ~A~%" (-> obj attack-from-high-deg)) - (format #t "~2Twhich-gun: ~D~%" (-> obj which-gun)) - (format #t "~2Twhich-pod: ~D~%" (-> obj which-pod)) - (format #t "~2Tleft-cover-angle: #~%" (-> obj left-cover-angle)) - (format #t "~2Tright-cover-angle: #~%" (-> obj right-cover-angle)) - (format #t "~2Tleft-cover-jm: ~A~%" (-> obj left-cover-jm)) - (format #t "~2Tright-cover-jm: ~A~%" (-> obj right-cover-jm)) - (format #t "~2Tdrill-speed: #~%" (-> obj drill-speed)) - (format #t "~2Tdrill-angle: ~f~%" (-> obj drill-angle)) - (format #t "~2Tleft-drill-jm: ~A~%" (-> obj left-drill-jm)) - (format #t "~2Tright-drill-jm: ~A~%" (-> obj right-drill-jm)) - (format #t "~2Tflying: ~A~%" (-> obj flying)) - (format #t "~2Tprevious-anim: ~D~%" (-> obj previous-anim)) - (format #t "~2Tlaunched-a-bomb: ~A~%" (-> obj launched-a-bomb)) - (format #t "~2Told-bomb-hits: ~D~%" (-> obj old-bomb-hits)) - (format #t "~2Tcatwalk[8] @ #x~X~%" (-> obj catwalk)) - (format #t "~2Theart: ~D~%" (-> obj heart)) - (format #t "~2Tpod: ~D~%" (-> obj pod)) - (format #t "~2Tbaron: #x~X~%" (-> obj baron)) - (format #t "~2Tdrill-spark-part: ~A~%" (-> obj drill-spark-part)) - (format #t "~2Tdrill-spark-part-alt: ~A~%" (-> obj drill-spark-part-alt)) - (format #t "~2Textract-stone-time: ~D~%" (-> obj extract-stone-time)) - (format #t "~2Textract-stone-part: ~A~%" (-> obj extract-stone-part)) - (format #t "~2Tinsert-stone-time: ~D~%" (-> obj insert-stone-time)) - (format #t "~2Tinsert-stone-part: ~A~%" (-> obj insert-stone-part)) - (format #t "~2Tland-part: ~A~%" (-> obj land-part)) - (format #t "~2Tgreen-charge-part: ~A~%" (-> obj green-charge-part)) - (format #t "~2Tgreen-fire-part: ~A~%" (-> obj green-fire-part)) - (format #t "~2Tlightning[5] @ #x~X~%" (-> obj lightning)) - (format #t "~2Tstop-catwalk-sound: ~A~%" (-> obj stop-catwalk-sound)) - (format #t "~2Tcatwalk-sound: ~D~%" (-> obj catwalk-sound)) - (format #t "~2Tdrill-sound: ~D~%" (-> obj drill-sound)) - (format #t "~2Tdrill-sound-playing: ~A~%" (-> obj drill-sound-playing)) - (format #t "~2Tdrill-sweeten-sound: ~D~%" (-> obj drill-sweeten-sound)) - (format #t "~2Tdrill-sweeten-sound-playing: ~A~%" (-> obj drill-sweeten-sound-playing)) - (format #t "~2Tmovie-handle: ~D~%" (-> obj movie-handle)) - (format #t "~2Ttilt: #~%" (-> obj tilt)) - (format #t "~2Ttargetted-catwalk: ~D~%" (-> obj targetted-catwalk)) - (format #t "~2Thover-sound: ~D~%" (-> obj hover-sound)) - (format #t "~2Thover-sound-playing: ~A~%" (-> obj hover-sound-playing)) - (format #t "~2Tshake-sound: ~D~%" (-> obj shake-sound)) - (format #t "~2Tshake-sound-playing: ~A~%" (-> obj shake-sound-playing)) - (format #t "~2Thud: ~D~%" (-> obj hud)) - (format #t "~2Tlast-want-stone-talker: ~D~%" (-> obj last-want-stone-talker)) - (format #t "~2Tlast-general-flying-talker: ~D~%" (-> obj last-general-flying-talker)) - (format #t "~2Tlast-launch-droids-talker: ~D~%" (-> obj last-launch-droids-talker)) - (format #t "~2Tlast-launch-bombs-talker: ~D~%" (-> obj last-launch-bombs-talker)) - (format #t "~2Tlast-shoot-gun-talker: ~D~%" (-> obj last-shoot-gun-talker)) - (format #t "~2Tlast-stone-charge-up-talker: ~D~%" (-> obj last-stone-charge-up-talker)) - (format #t "~2Tlast-after-stone-shot-talker: ~D~%" (-> obj last-after-stone-shot-talker)) - (format #t "~2Tlast-leave-perch-talker: ~D~%" (-> obj last-leave-perch-talker)) - (format #t "~2Tlast-damaged-talker: ~D~%" (-> obj last-damaged-talker)) - (format #t "~2Tkicked-bombs: ~D~%" (-> obj kicked-bombs)) - (format #t "~2Tlaunch-stages-completed: ~D~%" (-> obj launch-stages-completed)) - (format #t "~2Tcurrent-shoot-stage: ~D~%" (-> obj current-shoot-stage)) - (format #t "~2Tlast-gun-hit-stage: ~D~%" (-> obj last-gun-hit-stage)) - (format #t "~2Tgun-hits: ~D~%" (-> obj gun-hits)) - (format #t "~2Tlast-attack-id: ~D~%" (-> obj last-attack-id)) + (format #t "~2Tbomb[8] @ #x~X~%" (-> this bomb)) + (format #t "~2Tnext-launch: ~D~%" (-> this next-launch)) + (format #t "~2Tlaunch-dest: #~%" (-> this launch-dest)) + (format #t "~2Tnext-jumper: ~D~%" (-> this next-jumper)) + (format #t "~2Tammos[2] @ #x~X~%" (-> this ammos)) + (format #t "~2Tammo-timers[2] @ #x~X~%" (-> this ammo-timers)) + (format #t "~2Tbomb-hits: ~D~%" (-> this bomb-hits)) + (format #t "~2Tcircle-center: #~%" (-> this circle-center)) + (format #t "~2Ttheta: #~%" (-> this theta)) + (format #t "~2Ttraj: #~%" (-> this traj)) + (format #t "~2Tosc: #~%" (-> this osc)) + (format #t "~2Tnoise-osc: #~%" (-> this noise-osc)) + (format #t "~2Trand-vec: #~%" (-> this rand-vec)) + (format #t "~2Tattack-from-high-deg: ~A~%" (-> this attack-from-high-deg)) + (format #t "~2Twhich-gun: ~D~%" (-> this which-gun)) + (format #t "~2Twhich-pod: ~D~%" (-> this which-pod)) + (format #t "~2Tleft-cover-angle: #~%" (-> this left-cover-angle)) + (format #t "~2Tright-cover-angle: #~%" (-> this right-cover-angle)) + (format #t "~2Tleft-cover-jm: ~A~%" (-> this left-cover-jm)) + (format #t "~2Tright-cover-jm: ~A~%" (-> this right-cover-jm)) + (format #t "~2Tdrill-speed: #~%" (-> this drill-speed)) + (format #t "~2Tdrill-angle: ~f~%" (-> this drill-angle)) + (format #t "~2Tleft-drill-jm: ~A~%" (-> this left-drill-jm)) + (format #t "~2Tright-drill-jm: ~A~%" (-> this right-drill-jm)) + (format #t "~2Tflying: ~A~%" (-> this flying)) + (format #t "~2Tprevious-anim: ~D~%" (-> this previous-anim)) + (format #t "~2Tlaunched-a-bomb: ~A~%" (-> this launched-a-bomb)) + (format #t "~2Told-bomb-hits: ~D~%" (-> this old-bomb-hits)) + (format #t "~2Tcatwalk[8] @ #x~X~%" (-> this catwalk)) + (format #t "~2Theart: ~D~%" (-> this heart)) + (format #t "~2Tpod: ~D~%" (-> this pod)) + (format #t "~2Tbaron: #x~X~%" (-> this baron)) + (format #t "~2Tdrill-spark-part: ~A~%" (-> this drill-spark-part)) + (format #t "~2Tdrill-spark-part-alt: ~A~%" (-> this drill-spark-part-alt)) + (format #t "~2Textract-stone-time: ~D~%" (-> this extract-stone-time)) + (format #t "~2Textract-stone-part: ~A~%" (-> this extract-stone-part)) + (format #t "~2Tinsert-stone-time: ~D~%" (-> this insert-stone-time)) + (format #t "~2Tinsert-stone-part: ~A~%" (-> this insert-stone-part)) + (format #t "~2Tland-part: ~A~%" (-> this land-part)) + (format #t "~2Tgreen-charge-part: ~A~%" (-> this green-charge-part)) + (format #t "~2Tgreen-fire-part: ~A~%" (-> this green-fire-part)) + (format #t "~2Tlightning[5] @ #x~X~%" (-> this lightning)) + (format #t "~2Tstop-catwalk-sound: ~A~%" (-> this stop-catwalk-sound)) + (format #t "~2Tcatwalk-sound: ~D~%" (-> this catwalk-sound)) + (format #t "~2Tdrill-sound: ~D~%" (-> this drill-sound)) + (format #t "~2Tdrill-sound-playing: ~A~%" (-> this drill-sound-playing)) + (format #t "~2Tdrill-sweeten-sound: ~D~%" (-> this drill-sweeten-sound)) + (format #t "~2Tdrill-sweeten-sound-playing: ~A~%" (-> this drill-sweeten-sound-playing)) + (format #t "~2Tmovie-handle: ~D~%" (-> this movie-handle)) + (format #t "~2Ttilt: #~%" (-> this tilt)) + (format #t "~2Ttargetted-catwalk: ~D~%" (-> this targetted-catwalk)) + (format #t "~2Thover-sound: ~D~%" (-> this hover-sound)) + (format #t "~2Thover-sound-playing: ~A~%" (-> this hover-sound-playing)) + (format #t "~2Tshake-sound: ~D~%" (-> this shake-sound)) + (format #t "~2Tshake-sound-playing: ~A~%" (-> this shake-sound-playing)) + (format #t "~2Thud: ~D~%" (-> this hud)) + (format #t "~2Tlast-want-stone-talker: ~D~%" (-> this last-want-stone-talker)) + (format #t "~2Tlast-general-flying-talker: ~D~%" (-> this last-general-flying-talker)) + (format #t "~2Tlast-launch-droids-talker: ~D~%" (-> this last-launch-droids-talker)) + (format #t "~2Tlast-launch-bombs-talker: ~D~%" (-> this last-launch-bombs-talker)) + (format #t "~2Tlast-shoot-gun-talker: ~D~%" (-> this last-shoot-gun-talker)) + (format #t "~2Tlast-stone-charge-up-talker: ~D~%" (-> this last-stone-charge-up-talker)) + (format #t "~2Tlast-after-stone-shot-talker: ~D~%" (-> this last-after-stone-shot-talker)) + (format #t "~2Tlast-leave-perch-talker: ~D~%" (-> this last-leave-perch-talker)) + (format #t "~2Tlast-damaged-talker: ~D~%" (-> this last-damaged-talker)) + (format #t "~2Tkicked-bombs: ~D~%" (-> this kicked-bombs)) + (format #t "~2Tlaunch-stages-completed: ~D~%" (-> this launch-stages-completed)) + (format #t "~2Tcurrent-shoot-stage: ~D~%" (-> this current-shoot-stage)) + (format #t "~2Tlast-gun-hit-stage: ~D~%" (-> this last-gun-hit-stage)) + (format #t "~2Tgun-hits: ~D~%" (-> this gun-hits)) + (format #t "~2Tlast-attack-id: ~D~%" (-> this last-attack-id)) (label cfg-4) - obj + this ) ;; definition of type baron-pod @@ -511,21 +511,21 @@ ) ;; definition for method 3 of type baron-pod -(defmethod inspect baron-pod ((obj baron-pod)) - (when (not obj) - (set! obj obj) +(defmethod inspect baron-pod ((this baron-pod)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tred-tip-change-time: ~D~%" (-> obj red-tip-change-time)) - (format #t "~2Talt-red-tip-on: ~A~%" (-> obj alt-red-tip-on)) - (format #t "~2Tblink-time: ~D~%" (-> obj blink-time)) - (format #t "~2Tblink-mask: ~D~%" (-> obj blink-mask)) - (format #t "~2Thas-stone: ~A~%" (-> obj has-stone)) + (format #t "~2Tred-tip-change-time: ~D~%" (-> this red-tip-change-time)) + (format #t "~2Talt-red-tip-on: ~A~%" (-> this alt-red-tip-on)) + (format #t "~2Tblink-time: ~D~%" (-> this blink-time)) + (format #t "~2Tblink-mask: ~D~%" (-> this blink-mask)) + (format #t "~2Thas-stone: ~A~%" (-> this has-stone)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -538,80 +538,80 @@ ;; definition for method 21 of type baron-pod ;; WARN: Return type mismatch int vs none. -(defmethod baron-pod-method-21 baron-pod ((obj baron-pod) (arg0 symbol)) - (when (>= (- (current-time) (-> obj red-tip-change-time)) 0) - (set! (-> obj alt-red-tip-on) (not (-> obj alt-red-tip-on))) - (set! (-> obj red-tip-change-time) (+ (current-time) (seconds 0.5))) +(defmethod baron-pod-method-21 baron-pod ((this baron-pod) (arg0 symbol)) + (when (>= (- (current-time) (-> this red-tip-change-time)) 0) + (set! (-> this alt-red-tip-on) (not (-> this alt-red-tip-on))) + (set! (-> this red-tip-change-time) (+ (current-time) (seconds 0.5))) (set! arg0 #t) ) - (when (>= (- (current-time) (-> obj blink-time)) 0) - (set! (-> obj blink-mask) 0) + (when (>= (- (current-time) (-> this blink-time)) 0) + (set! (-> this blink-mask) 0) (dotimes (s5-0 10) (let* ((f30-0 0.5) (v1-17 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) (v1-18 (the-as number (logior #x3f800000 v1-17))) ) (if (< f30-0 (+ -1.0 (the-as float v1-18))) - (logior! (-> obj blink-mask) (ash 1 s5-0)) + (logior! (-> this blink-mask) (ash 1 s5-0)) ) ) ) - (set! (-> obj blink-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.75))))) + (set! (-> this blink-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 0.25 0.75))))) (set! arg0 #t) ) (when arg0 - (remove-from-process *part-engine* obj) - (add-connection *part-engine* obj 13 obj 3264 (new 'static 'vector :w 819200.0)) - (add-connection *part-engine* obj 14 obj 3264 (new 'static 'vector :w 819200.0)) - (if (-> obj alt-red-tip-on) - (add-connection *part-engine* obj 5 obj 3251 (new 'static 'vector :w 819200.0)) - (add-connection *part-engine* obj 6 obj 3251 (new 'static 'vector :w 819200.0)) + (remove-from-process *part-engine* this) + (add-connection *part-engine* this 13 this 3264 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 14 this 3264 (new 'static 'vector :w 819200.0)) + (if (-> this alt-red-tip-on) + (add-connection *part-engine* this 5 this 3251 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 6 this 3251 (new 'static 'vector :w 819200.0)) ) - (let ((s5-2 (-> obj blink-mask))) + (let ((s5-2 (-> this blink-mask))) (if (logtest? s5-2 1) - (add-connection *part-engine* obj 8 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 8 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 2) - (add-connection *part-engine* obj 9 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 9 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 4) - (add-connection *part-engine* obj 10 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 10 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 8) - (add-connection *part-engine* obj 11 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 11 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 16) - (add-connection *part-engine* obj 12 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 12 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 32) - (add-connection *part-engine* obj 15 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 15 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 64) - (add-connection *part-engine* obj 16 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 16 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 128) - (add-connection *part-engine* obj 17 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 17 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 256) - (add-connection *part-engine* obj 18 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 18 this 3252 (new 'static 'vector :w 819200.0)) ) (if (logtest? s5-2 512) - (add-connection *part-engine* obj 19 obj 3252 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 19 this 3252 (new 'static 'vector :w 819200.0)) ) ) (cond - ((-> obj has-stone) - (add-connection *part-engine* obj 4 obj 3258 (new 'static 'vector :y 4096.0 :w 819200.0)) - (add-connection *part-engine* obj 4 obj 3259 (new 'static 'vector :y 4096.0 :w 819200.0)) + ((-> this has-stone) + (add-connection *part-engine* this 4 this 3258 (new 'static 'vector :y 4096.0 :w 819200.0)) + (add-connection *part-engine* this 4 this 3259 (new 'static 'vector :y 4096.0 :w 819200.0)) ) (else - (add-connection *part-engine* obj 4 obj 3256 (new 'static 'vector :y 4096.0 :w 819200.0)) - (add-connection *part-engine* obj 4 obj 3257 (new 'static 'vector :y 4096.0 :w 819200.0)) + (add-connection *part-engine* this 4 this 3256 (new 'static 'vector :y 4096.0 :w 819200.0)) + (add-connection *part-engine* this 4 this 3257 (new 'static 'vector :y 4096.0 :w 819200.0)) ) ) ) - (if (-> obj has-stone) - (spawn (-> obj part) (-> obj root trans)) + (if (-> this has-stone) + (spawn (-> this part) (-> this root trans)) ) 0 (none) @@ -706,16 +706,16 @@ ) ;; definition for method 3 of type tomb-boss-bridge -(defmethod inspect tomb-boss-bridge ((obj tomb-boss-bridge)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-boss-bridge ((this tomb-boss-bridge)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -732,7 +732,7 @@ ;; definition for method 11 of type tomb-boss-bridge ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-bridge ((obj tomb-boss-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boss-bridge ((this tomb-boss-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -740,7 +740,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (case ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'tomb-boss-bridge-type 'interp -1000000000.0 @@ -749,27 +749,27 @@ This commonly includes things such as: *res-static-buf* ) (('b) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-bridge-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) (else - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-bridge-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) ) - (set! (-> obj draw light-index) (the-as uint 2)) + (set! (-> this draw light-index) (the-as uint 2)) (ja-post) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) 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 d0ad8d4f2d..2322821555 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-extras_REF.gc @@ -18,17 +18,17 @@ ) ;; definition for method 3 of type tomb-boss-catwalk -(defmethod inspect tomb-boss-catwalk ((obj tomb-boss-catwalk)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-boss-catwalk ((this tomb-boss-catwalk)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Twhich-look: ~D~%" (-> obj which-look)) + (format #t "~2Twhich-look: ~D~%" (-> this which-look)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -222,10 +222,10 @@ ;; definition for method 22 of type tomb-boss-catwalk ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod tomb-boss-catwalk-method-22 tomb-boss-catwalk ((obj tomb-boss-catwalk) (arg0 vector) (arg1 int)) +(defmethod tomb-boss-catwalk-method-22 tomb-boss-catwalk ((this tomb-boss-catwalk) (arg0 vector) (arg1 int)) (case arg1 ((1) - (let ((s3-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-3 (new 'process 'collide-shape-prim-mesh s3-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-3 prim-core collide-with) (collide-spec jak bot player-list)) @@ -240,11 +240,11 @@ (set! (-> s3-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s3-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-0)) + (set! (-> this root) (the-as collide-shape-moving s3-0)) ) ) ((2) - (let ((s3-1 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-1 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-9 (new 'process 'collide-shape-prim-mesh s3-1 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot player-list)) @@ -259,11 +259,11 @@ (set! (-> s3-1 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s3-1 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-1)) + (set! (-> this root) (the-as collide-shape-moving s3-1)) ) ) ((3) - (let ((s3-2 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-2 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-15 (new 'process 'collide-shape-prim-mesh s3-2 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) @@ -278,11 +278,11 @@ (set! (-> s3-2 backup-collide-as) (-> v1-17 prim-core collide-as)) (set! (-> s3-2 backup-collide-with) (-> v1-17 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-2)) + (set! (-> this root) (the-as collide-shape-moving s3-2)) ) ) ((4) - (let ((s3-3 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-3 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-21 (new 'process 'collide-shape-prim-mesh s3-3 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-21 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-21 prim-core collide-with) (collide-spec jak bot player-list)) @@ -297,11 +297,11 @@ (set! (-> s3-3 backup-collide-as) (-> v1-23 prim-core collide-as)) (set! (-> s3-3 backup-collide-with) (-> v1-23 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-3)) + (set! (-> this root) (the-as collide-shape-moving s3-3)) ) ) ((5) - (let ((s3-4 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-4 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-27 (new 'process 'collide-shape-prim-mesh s3-4 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-27 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-27 prim-core collide-with) (collide-spec jak bot player-list)) @@ -316,11 +316,11 @@ (set! (-> s3-4 backup-collide-as) (-> v1-29 prim-core collide-as)) (set! (-> s3-4 backup-collide-with) (-> v1-29 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-4)) + (set! (-> this root) (the-as collide-shape-moving s3-4)) ) ) ((6) - (let ((s3-5 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-5 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-33 (new 'process 'collide-shape-prim-mesh s3-5 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-33 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-33 prim-core collide-with) (collide-spec jak bot player-list)) @@ -335,11 +335,11 @@ (set! (-> s3-5 backup-collide-as) (-> v1-35 prim-core collide-as)) (set! (-> s3-5 backup-collide-with) (-> v1-35 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-5)) + (set! (-> this root) (the-as collide-shape-moving s3-5)) ) ) ((7) - (let ((s3-6 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-6 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-39 (new 'process 'collide-shape-prim-mesh s3-6 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-39 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-39 prim-core collide-with) (collide-spec jak bot player-list)) @@ -354,11 +354,11 @@ (set! (-> s3-6 backup-collide-as) (-> v1-41 prim-core collide-as)) (set! (-> s3-6 backup-collide-with) (-> v1-41 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-6)) + (set! (-> this root) (the-as collide-shape-moving s3-6)) ) ) (else - (let ((s3-7 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s3-7 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s2-0 (new 'process 'collide-shape-prim-group s3-7 (the-as uint 8) 0))) (set! (-> s3-7 total-prims) (the-as uint 9)) (set! (-> s2-0 prim-core collide-as) (collide-spec obstacle)) @@ -429,92 +429,92 @@ (set! (-> s3-7 backup-collide-as) (-> v1-68 prim-core collide-as)) (set! (-> s3-7 backup-collide-with) (-> v1-68 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s3-7)) + (set! (-> this root) (the-as collide-shape-moving s3-7)) ) ) ) - (set! (-> obj root trans quad) (-> arg0 quad)) + (set! (-> this root trans quad) (-> arg0 quad)) (case arg1 ((1) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-a" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((2) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-b" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((3) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-c" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((4) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-d" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((5) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-e" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((6) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-f" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) ((7) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-g" (the-as (pointer uint32) #f)) ) (the-as pair 0) ) - (logior! (-> obj draw status) (draw-control-status no-draw-bounds)) + (logior! (-> this draw status) (draw-control-status no-draw-bounds)) ) (else (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-catwalk-main" (the-as (pointer uint32) #f)) @@ -523,9 +523,9 @@ ) ) ) - (set! (-> obj root pause-adjust-distance) 245760.0) - (set! (-> obj which-look) arg1) - (quaternion-set! (-> obj root quat) 0.0 1.0 0.0 0.0) + (set! (-> this root pause-adjust-distance) 245760.0) + (set! (-> this which-look) arg1) + (quaternion-set! (-> this root quat) 0.0 1.0 0.0 0.0) (transform-post) 0 (none) @@ -533,7 +533,7 @@ ;; definition for method 11 of type tomb-boss-catwalk ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-catwalk ((obj tomb-boss-catwalk) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boss-catwalk ((this tomb-boss-catwalk) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -541,11 +541,11 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (let ((a2-1 (res-lump-value arg0 'mode uint128 :time -1000000000.0))) - (tomb-boss-catwalk-method-22 obj (-> arg0 extra trans) (the-as int a2-1)) + (tomb-boss-catwalk-method-22 this (-> arg0 extra trans) (the-as int a2-1)) ) - (cleanup-for-death obj) - (deactivate obj) - (go (method-of-object obj idle)) + (cleanup-for-death this) + (deactivate this) + (go (method-of-object this idle)) (none) ) @@ -569,16 +569,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-boss-catwalk-main -(defmethod inspect tomb-boss-catwalk-main ((obj tomb-boss-catwalk-main)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-boss-catwalk-main ((this tomb-boss-catwalk-main)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type tomb-boss-catwalk inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type widow-bomb @@ -618,33 +618,33 @@ This commonly includes things such as: ) ;; definition for method 3 of type widow-bomb -(defmethod inspect widow-bomb ((obj widow-bomb)) - (when (not obj) - (set! obj obj) +(defmethod inspect widow-bomb ((this widow-bomb)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ttraj: #~%" (-> obj traj)) - (format #t "~2Texplode-part: ~A~%" (-> obj explode-part)) - (format #t "~2Ttrail-part: ~A~%" (-> obj trail-part)) - (format #t "~2Twarning-glow-part: ~A~%" (-> obj warning-glow-part)) - (format #t "~2Twarning-spark-part: ~A~%" (-> obj warning-spark-part)) - (format #t "~2Timpact: #~%" (-> obj impact)) - (format #t "~2Twhich-trajectory: ~D~%" (-> obj which-trajectory)) - (format #t "~2Tnext-countdown-tick: ~D~%" (-> obj next-countdown-tick)) - (format #t "~2Tskid-part: ~A~%" (-> obj skid-part)) - (format #t "~2Tx-rotate: ~f~%" (-> obj x-rotate)) - (format #t "~2Ty-rotate: ~f~%" (-> obj y-rotate)) - (format #t "~2Tspin-jm: ~A~%" (-> obj spin-jm)) - (format #t "~2Tfirework-sound-played: ~A~%" (-> obj firework-sound-played)) - (format #t "~2Tsteam-sound: ~D~%" (-> obj steam-sound)) - (format #t "~2Tlaunch: #~%" (-> obj launch)) - (format #t "~2Tlaunch-pos: #~%" (-> obj launch-pos)) - (format #t "~2Tfizzle-timer: ~D~%" (-> obj fizzle-timer)) + (format #t "~2Ttraj: #~%" (-> this traj)) + (format #t "~2Texplode-part: ~A~%" (-> this explode-part)) + (format #t "~2Ttrail-part: ~A~%" (-> this trail-part)) + (format #t "~2Twarning-glow-part: ~A~%" (-> this warning-glow-part)) + (format #t "~2Twarning-spark-part: ~A~%" (-> this warning-spark-part)) + (format #t "~2Timpact: #~%" (-> this impact)) + (format #t "~2Twhich-trajectory: ~D~%" (-> this which-trajectory)) + (format #t "~2Tnext-countdown-tick: ~D~%" (-> this next-countdown-tick)) + (format #t "~2Tskid-part: ~A~%" (-> this skid-part)) + (format #t "~2Tx-rotate: ~f~%" (-> this x-rotate)) + (format #t "~2Ty-rotate: ~f~%" (-> this y-rotate)) + (format #t "~2Tspin-jm: ~A~%" (-> this spin-jm)) + (format #t "~2Tfirework-sound-played: ~A~%" (-> this firework-sound-played)) + (format #t "~2Tsteam-sound: ~D~%" (-> this steam-sound)) + (format #t "~2Tlaunch: #~%" (-> this launch)) + (format #t "~2Tlaunch-pos: #~%" (-> this launch-pos)) + (format #t "~2Tfizzle-timer: ~D~%" (-> this fizzle-timer)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -662,32 +662,32 @@ This commonly includes things such as: ;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 ;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 ;; WARN: Return type mismatch int vs none. -(defmethod widow-bomb-method-34 widow-bomb ((obj widow-bomb)) +(defmethod widow-bomb-method-34 widow-bomb ((this widow-bomb)) (local-vars (sv-48 float) (sv-64 float)) (let ((s5-0 (new 'stack-no-clear 'quaternion)) (gp-0 (new 'stack-no-clear 'quaternion)) ) (let ((s3-0 quaternion-set!) (s2-0 s5-0) - (s1-0 (sin (* 0.5 (-> obj x-rotate)))) + (s1-0 (sin (* 0.5 (-> this x-rotate)))) (s0-0 0.0) ) (set! sv-48 (the-as float 0.0)) - (let ((t0-0 (cos (* 0.5 (-> obj x-rotate))))) + (let ((t0-0 (cos (* 0.5 (-> this x-rotate))))) (s3-0 s2-0 s1-0 s0-0 sv-48 t0-0) ) ) (let ((s3-1 quaternion-set!) (s2-1 gp-0) (s1-1 0.0) - (s0-1 (sin (* 0.5 (-> obj y-rotate)))) + (s0-1 (sin (* 0.5 (-> this y-rotate)))) ) (set! sv-64 (the-as float 0.0)) - (let ((t0-1 (cos (* 0.5 (-> obj y-rotate))))) + (let ((t0-1 (cos (* 0.5 (-> this y-rotate))))) (s3-1 s2-1 s1-1 s0-1 sv-64 t0-1) ) ) - (quaternion-normalize! (quaternion*! (-> obj spin-jm quat) gp-0 s5-0)) + (quaternion-normalize! (quaternion*! (-> this spin-jm quat) gp-0 s5-0)) ) 0 (none) @@ -831,10 +831,10 @@ This commonly includes things such as: :virtual #t :event widow-bomb-back-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (and (nonzero? (-> self fizzle-timer)) (>= (- (current-time) (-> self fizzle-timer)) (seconds 3))) + (if (and (nonzero? (-> self fizzle-timer)) (time-elapsed? (-> self fizzle-timer) (seconds 3))) (go-virtual explode) ) (+! (-> self x-rotate) 1092.2667) @@ -842,7 +842,7 @@ This commonly includes things such as: (widow-bomb-method-34 self) (spawn-with-cspace (-> self part) (-> self node-list data 3)) (cond - ((>= (- (current-time) (-> self state-time)) (seconds 4)) + ((time-elapsed? (-> self state-time) (seconds 4)) (go-virtual explode) ) (else @@ -871,7 +871,7 @@ This commonly includes things such as: :virtual #t :event widow-bomb-back-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (initialize (-> self impact) self @@ -885,14 +885,14 @@ This commonly includes things such as: ) ) :trans (behavior () - (if (and (nonzero? (-> self fizzle-timer)) (>= (- (current-time) (-> self fizzle-timer)) (seconds 3))) + (if (and (nonzero? (-> self fizzle-timer)) (time-elapsed? (-> self fizzle-timer) (seconds 3))) (go-virtual explode) ) (+! (-> self x-rotate) 4369.067) (+! (-> self y-rotate) 3458.8445) (widow-bomb-method-34 self) (cond - ((>= (- (current-time) (-> self state-time)) (the int (-> self traj time))) + ((time-elapsed? (-> self state-time) (the int (-> self traj time))) (compute-transv-at-time (-> self traj) (-> self traj time) (-> self root transv)) (vector-float*! (-> self root transv) (-> self root transv) 300.0) (go-virtual freefall) @@ -904,7 +904,7 @@ This commonly includes things such as: (-> self root trans) ) (update-from-cspace (-> self impact)) - (when (>= (- (current-time) (-> self state-time)) 1) + (when (time-elapsed? (-> self state-time) 1) (let* ((a1-4 (new 'stack-no-clear 'collide-query)) (f0-10 (impact-control-method-11 (-> self impact) @@ -960,11 +960,11 @@ This commonly includes things such as: ) 0 (sound-play "w-bomb-explode") - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (cond - ((< (- (current-time) (-> self state-time)) (seconds 2)) + ((not (time-elapsed? (-> self state-time) (seconds 2))) (let ((a1-0 (new 'stack-no-clear 'vector))) (set! (-> a1-0 quad) (-> self root trans quad)) (+! (-> a1-0 y) 2048.0) @@ -982,22 +982,22 @@ This commonly includes things such as: ;; definition for method 32 of type widow-bomb ;; WARN: Return type mismatch int vs none. -(defmethod widow-bomb-method-32 widow-bomb ((obj widow-bomb)) - (spawn-with-cspace (-> obj part) (-> obj node-list data 3)) - (sound-play "w-bomb-steam" :id (-> obj steam-sound) :position (-> obj root trans)) - (let ((s5-0 (the-as int (- (current-time) (-> obj state-time))))) - (if (nonzero? (-> obj fizzle-timer)) +(defmethod widow-bomb-method-32 widow-bomb ((this widow-bomb)) + (spawn-with-cspace (-> this part) (-> this node-list data 3)) + (sound-play "w-bomb-steam" :id (-> this steam-sound) :position (-> this root trans)) + (let ((s5-0 (the-as int (- (current-time) (-> this state-time))))) + (if (nonzero? (-> this fizzle-timer)) (set! s5-0 - (max (the-as time-frame s5-0) (- (seconds 12) (- (seconds 3) (- (current-time) (-> obj fizzle-timer))))) + (max (the-as time-frame s5-0) (- (seconds 12) (- (seconds 3) (- (current-time) (-> this fizzle-timer))))) ) ) (if (< 3600 s5-0) - (go (method-of-object obj explode)) + (go (method-of-object this explode)) ) (when (< 3000 s5-0) - (spawn-with-cspace (-> obj warning-spark-part) (-> obj node-list data 3)) - (when (not (-> obj firework-sound-played)) - (set! (-> obj firework-sound-played) #t) + (spawn-with-cspace (-> this warning-spark-part) (-> this node-list data 3)) + (when (not (-> this firework-sound-played)) + (set! (-> this firework-sound-played) #t) (sound-play "w-bomb-firewrks") ) ) @@ -1005,19 +1005,19 @@ This commonly includes things such as: (a0-10 3600) (v1-28 (- (* a0-10 a0-10) v1-27)) ) - (when (< v1-28 (-> obj next-countdown-tick)) + (when (< v1-28 (-> this next-countdown-tick)) (let ((a0-14 540)) - (set! (-> obj next-countdown-tick) (the-as time-frame (- v1-28 (mod v1-28 (* a0-14 a0-14))))) + (set! (-> this next-countdown-tick) (the-as time-frame (- v1-28 (mod v1-28 (* a0-14 a0-14))))) ) (let ((s5-2 (new 'stack-no-clear 'vector))) - (vector<-cspace! s5-2 (-> obj node-list data 7)) - (spawn (-> obj warning-glow-part) s5-2) - (vector<-cspace! s5-2 (-> obj node-list data 6)) - (spawn (-> obj warning-glow-part) s5-2) - (vector<-cspace! s5-2 (-> obj node-list data 5)) - (spawn (-> obj warning-glow-part) s5-2) - (vector<-cspace! s5-2 (-> obj node-list data 4)) - (spawn (-> obj warning-glow-part) s5-2) + (vector<-cspace! s5-2 (-> this node-list data 7)) + (spawn (-> this warning-glow-part) s5-2) + (vector<-cspace! s5-2 (-> this node-list data 6)) + (spawn (-> this warning-glow-part) s5-2) + (vector<-cspace! s5-2 (-> this node-list data 5)) + (spawn (-> this warning-glow-part) s5-2) + (vector<-cspace! s5-2 (-> this node-list data 4)) + (spawn (-> this warning-glow-part) s5-2) ) (sound-play "w-bomb-timer") ) @@ -1032,7 +1032,7 @@ This commonly includes things such as: :virtual #t :event widow-bomb-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let* ((v1-2 3600) (v1-3 (* v1-2 v1-2)) (a0-0 540) @@ -1053,19 +1053,19 @@ This commonly includes things such as: ) ;; definition for method 33 of type widow-bomb -(defmethod widow-bomb-method-33 widow-bomb ((obj widow-bomb)) +(defmethod widow-bomb-method-33 widow-bomb ((this widow-bomb)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set-vector! (-> gp-0 vector 1) 0.0 1.0 0.0 1.0) - (vector-! (-> gp-0 vector 2) (the-as vector (-> obj impact trans)) (-> obj impact trans 1)) + (vector-! (-> gp-0 vector 2) (the-as vector (-> this impact trans)) (-> this impact trans 1)) (vector-cross! (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1) (-> gp-0 vector 2)) (vector-normalize! (the-as vector (-> gp-0 vector)) 1.0) (vector-cross! (-> gp-0 vector 2) (the-as vector (-> gp-0 vector)) (-> gp-0 vector 1)) - (vector<-cspace! (-> gp-0 trans) (-> obj node-list data 3)) + (vector<-cspace! (-> gp-0 trans) (-> this node-list data 3)) (set! (-> gp-0 vector 0 w) 0.0) (set! (-> gp-0 vector 1 w) 0.0) (set! (-> gp-0 vector 2 w) 0.0) (set! (-> gp-0 trans w) 1.0) - (spawn-with-matrix (-> obj skid-part) gp-0) + (spawn-with-matrix (-> this skid-part) gp-0) ) (none) ) @@ -1107,7 +1107,7 @@ This commonly includes things such as: ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (initialize (-> self impact) self 3 4096.0 (collide-spec backgnd obstacle hit-by-others-list player-list)) ) :exit (behavior () @@ -1150,7 +1150,7 @@ This commonly includes things such as: ) ) (cond - ((>= (- (current-time) (-> self state-time)) (the int (-> self traj time))) + ((time-elapsed? (-> self state-time) (the int (-> self traj time))) (let ((v1-29 (-> self which-trajectory))) (cond ((zero? v1-29) @@ -1160,7 +1160,7 @@ This commonly includes things such as: (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) (-> self root trans) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self traj))))) (set! (-> gp-1 y) 0.0) (vector-normalize! gp-1 12288.0) @@ -1177,7 +1177,7 @@ This commonly includes things such as: (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) (-> self root trans) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-4 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (the-as vector (-> self traj))))) (set! (-> gp-4 y) 0.0) (vector-normalize! gp-4 4096.0) @@ -1216,7 +1216,7 @@ This commonly includes things such as: (-> self root trans) ) (when (and (zero? (-> self which-trajectory)) - (< (- (current-time) (-> self state-time)) (the int (* 0.75 (-> self traj time)))) + (not (time-elapsed? (-> self state-time) (the int (* 0.75 (-> self traj time))))) ) (vector+float*! (-> self launch-pos) (-> self launch-pos) (-> self launch) (-> self clock time-adjust-ratio)) (vector-lerp! @@ -1231,7 +1231,7 @@ This commonly includes things such as: (spawn-with-cspace (-> self trail-part) (-> self node-list data 3)) (when (zero? (-> self which-trajectory)) (update-from-cspace (-> self impact)) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.05)) + (when (time-elapsed? (-> self state-time) (seconds 0.05)) (let ((f0-42 (impact-control-method-11 (-> self impact) (new 'stack-no-clear 'collide-query) @@ -1258,50 +1258,50 @@ This commonly includes things such as: ) ;; definition for method 10 of type widow-bomb -(defmethod deactivate widow-bomb ((obj widow-bomb)) - (if (nonzero? (-> obj explode-part)) - (kill-and-free-particles (-> obj explode-part)) +(defmethod deactivate widow-bomb ((this widow-bomb)) + (if (nonzero? (-> this explode-part)) + (kill-and-free-particles (-> this explode-part)) ) - (if (nonzero? (-> obj trail-part)) - (kill-and-free-particles (-> obj trail-part)) + (if (nonzero? (-> this trail-part)) + (kill-and-free-particles (-> this trail-part)) ) - (if (nonzero? (-> obj warning-glow-part)) - (kill-and-free-particles (-> obj warning-glow-part)) + (if (nonzero? (-> this warning-glow-part)) + (kill-and-free-particles (-> this warning-glow-part)) ) - (if (nonzero? (-> obj warning-spark-part)) - (kill-and-free-particles (-> obj warning-spark-part)) + (if (nonzero? (-> this warning-spark-part)) + (kill-and-free-particles (-> this warning-spark-part)) ) - (if (nonzero? (-> obj skid-part)) - (kill-and-free-particles (-> obj warning-spark-part)) + (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)) obj) + ((the-as (function process-drawable none) (find-parent-method widow-bomb 10)) this) (none) ) ;; definition for method 7 of type widow-bomb ;; WARN: Return type mismatch process-drawable vs widow-bomb. -(defmethod relocate widow-bomb ((obj widow-bomb) (arg0 int)) - (if (nonzero? (-> obj explode-part)) - (&+! (-> obj explode-part) arg0) +(defmethod relocate widow-bomb ((this widow-bomb) (arg0 int)) + (if (nonzero? (-> this explode-part)) + (&+! (-> this explode-part) arg0) ) - (if (nonzero? (-> obj trail-part)) - (&+! (-> obj trail-part) arg0) + (if (nonzero? (-> this trail-part)) + (&+! (-> this trail-part) arg0) ) - (if (nonzero? (-> obj warning-glow-part)) - (&+! (-> obj warning-glow-part) arg0) + (if (nonzero? (-> this warning-glow-part)) + (&+! (-> this warning-glow-part) arg0) ) - (if (nonzero? (-> obj warning-spark-part)) - (&+! (-> obj warning-spark-part) arg0) + (if (nonzero? (-> this warning-spark-part)) + (&+! (-> this warning-spark-part) arg0) ) - (if (nonzero? (-> obj skid-part)) - (&+! (-> obj skid-part) arg0) + (if (nonzero? (-> this skid-part)) + (&+! (-> this skid-part) arg0) ) - (if (nonzero? (-> obj spin-jm)) - (&+! (-> obj spin-jm) arg0) + (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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method widow-bomb 7)) this arg0) ) ) @@ -1399,16 +1399,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type heart-mar -(defmethod inspect heart-mar ((obj heart-mar)) - (when (not obj) - (set! obj obj) +(defmethod inspect heart-mar ((this heart-mar)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1500,19 +1500,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-boss-pillar -(defmethod inspect tomb-boss-pillar ((obj tomb-boss-pillar)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-boss-pillar ((this tomb-boss-pillar)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Texplode-part: ~A~%" (-> obj explode-part)) - (format #t "~2Tsegs-shot: ~D~%" (-> obj segs-shot)) - (format #t "~2Tlast-pillar-hit: ~D~%" (-> obj last-pillar-hit)) + (format #t "~2Texplode-part: ~A~%" (-> this explode-part)) + (format #t "~2Tsegs-shot: ~D~%" (-> this segs-shot)) + (format #t "~2Tlast-pillar-hit: ~D~%" (-> this last-pillar-hit)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1610,10 +1610,10 @@ This commonly includes things such as: :virtual #t :enter (behavior () (set! (-> self draw bounds w) 245760.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (if (< (- (current-time) (-> self state-time)) (seconds 1)) + (if (not (time-elapsed? (-> self state-time) (seconds 1))) (spawn-with-cspace (-> self explode-part) (-> self node-list data 6)) ) (let ((v1-9 (ja-group))) @@ -1651,7 +1651,7 @@ This commonly includes things such as: ((>= (-> self segs-shot) 16) (go-virtual break-it) ) - ((>= (- (current-time) (-> self last-pillar-hit)) (seconds 2)) + ((time-elapsed? (-> self last-pillar-hit) (seconds 2)) (process-spawn part-tracker :init part-tracker-init @@ -1663,7 +1663,7 @@ This commonly includes things such as: 0 :to *entity-pool* ) - (set! (-> self last-pillar-hit) (current-time)) + (set-time! (-> self last-pillar-hit)) (sound-play "pillar-hit" :position (-> self root trans)) ) ) @@ -1678,7 +1678,7 @@ This commonly includes things such as: (set! (-> v1-3 prim-core collide-with) (collide-spec)) ) 0 - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (let ((v1-2 (-> self entity extra perm))) @@ -1690,36 +1690,36 @@ This commonly includes things such as: ) ;; definition for method 10 of type tomb-boss-pillar -(defmethod deactivate tomb-boss-pillar ((obj tomb-boss-pillar)) - (if (nonzero? (-> obj explode-part)) - (kill-and-free-particles (-> obj explode-part)) +(defmethod deactivate tomb-boss-pillar ((this tomb-boss-pillar)) + (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)) obj) + ((the-as (function process-drawable none) (find-parent-method tomb-boss-pillar 10)) 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 ((obj tomb-boss-pillar) (arg0 int)) - (if (nonzero? (-> obj explode-part)) - (&+! (-> obj explode-part) arg0) +(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)) obj arg0) + ((the-as (function process-drawable int process-drawable) (find-parent-method tomb-boss-pillar 7)) this arg0) ) ) ;; definition for method 11 of type tomb-boss-pillar ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-pillar ((obj tomb-boss-pillar) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boss-pillar ((this tomb-boss-pillar) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1748,25 +1748,25 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-pillar" (the-as (pointer uint32) #f))) (the-as pair 0) ) (transform-post) - (set! (-> obj explode-part) (create-launch-control (-> *part-group-id-table* 719) obj)) - (set! (-> obj last-pillar-hit) 0) - (let ((v1-23 (-> obj entity extra perm))) + (set! (-> this explode-part) (create-launch-control (-> *part-group-id-table* 719) this)) + (set! (-> this last-pillar-hit) 0) + (let ((v1-23 (-> this entity extra perm))) (logior! (-> v1-23 status) (entity-perm-status bit-5)) - (set! (-> obj segs-shot) (the-as int (-> v1-23 user-object 1))) + (set! (-> this segs-shot) (the-as int (-> v1-23 user-object 1))) ) (damage-pillar) - (if (>= (-> obj segs-shot) 16) - (go (method-of-object obj broken)) - (go (method-of-object obj idle)) + (if (>= (-> this segs-shot) 16) + (go (method-of-object this broken)) + (go (method-of-object this idle)) ) (none) ) @@ -1787,16 +1787,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type tomb-boss-firepot -(defmethod inspect tomb-boss-firepot ((obj tomb-boss-firepot)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-boss-firepot ((this tomb-boss-firepot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1941,14 +1941,14 @@ This commonly includes things such as: ;; definition for method 11 of type tomb-boss-firepot ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! tomb-boss-firepot ((obj tomb-boss-firepot) (arg0 entity-actor)) +(defmethod init-from-entity! tomb-boss-firepot ((this tomb-boss-firepot) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1977,102 +1977,102 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-tomb-boss-firepot" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj root pause-adjust-distance) 245760.0) + (set! (-> this root pause-adjust-distance) 245760.0) (transform-post) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj broken)) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this broken)) + (go (method-of-object this idle)) ) (none) ) ;; definition for method 15 of type hud-widow ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-widow ((obj hud-widow)) - (set-hud-piece-position! (-> obj sprites 1) (the int (+ 462.0 (* 130.0 (-> obj offset)))) 350) - (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) -32 0) - (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 1)) -62 14) - (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 1)) -32 14) - (let ((s5-0 (-> obj values 0 current)) - (f30-0 (* 0.01 (the float (-> obj values 1 current)))) +(defmethod draw hud-widow ((this hud-widow)) + (set-hud-piece-position! (-> this sprites 1) (the int (+ 462.0 (* 130.0 (-> this offset)))) 350) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 1)) -32 0) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites 1)) -62 14) + (set-as-offset-from! (-> this sprites 6) (the-as vector4w (-> this sprites 1)) -32 14) + (let ((s5-0 (-> this values 0 current)) + (f30-0 (* 0.01 (the float (-> this values 1 current)))) ) - (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 1)) -92 15) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites 1)) -92 15) (cond ((= s5-0 1) - (set! (-> obj sprites 4 color x) 0) - (set! (-> obj sprites 4 color y) 255) + (set! (-> this sprites 4 color x) 0) + (set! (-> this sprites 4 color y) 255) (set! f30-0 (+ 2.0 f30-0)) ) ((= s5-0 2) - (set! (-> obj sprites 4 color y) 255) - (set! (-> obj sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 255) + (set! (-> this sprites 4 color x) 255) (set! f30-0 (+ 1.0 f30-0)) ) ((= s5-0 3) - (set! (-> obj sprites 4 color x) 255) - (set! (-> obj sprites 4 color y) 0) + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 0) 0 ) (else (set! f30-0 0.0) ) ) - (set! (-> obj sprites 4 scale-x) (* -7.25 f30-0)) + (set! (-> this sprites 4 scale-x) (* -7.25 f30-0)) ) - (let ((f30-1 (* 0.01 (the float (-> obj values 2 current))))) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 1)) -84 4) + (let ((f30-1 (* 0.01 (the float (-> this values 2 current))))) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 1)) -84 4) (cond ((< f30-1 0.5) - (set! (-> obj sprites 3 color x) 255) - (set! (-> obj sprites 3 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-1)))) + (set! (-> this sprites 3 color x) 255) + (set! (-> this sprites 3 color y) (the int (lerp 0.0 255.0 (* 2.0 f30-1)))) ) (else - (set! (-> obj sprites 3 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-1))))) - (set! (-> obj sprites 3 color y) 255) + (set! (-> this sprites 3 color x) (the int (lerp 255.0 0.0 (* 2.0 (+ -0.5 f30-1))))) + (set! (-> this sprites 3 color y) 255) ) ) - (set! (-> obj sprites 3 scale-x) (* -18.25 f30-1)) + (set! (-> this sprites 3 scale-x) (* -18.25 f30-1)) ) - ((method-of-type hud draw) obj) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 17 of type hud-widow ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-widow ((obj hud-widow)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-widow ((this hud-widow)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (set! (-> obj values 0 target) 1) - (set! (-> obj values 1 target) 100) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) - (set! (-> obj sprites 0 flags) (the-as uint 4)) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) - (set! (-> obj sprites 1 flags) (the-as uint 4)) - (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 5 scale-x) 0.5) - (set! (-> obj sprites 5 flags) (the-as uint 4)) - (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) - (set! (-> obj sprites 6 scale-x) 0.5) - (set! (-> obj sprites 6 flags) (the-as uint 4)) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 4 scale-y) 3.25) - (set! (-> obj sprites 4 color z) 0) - (set! (-> obj sprites 4 flags) (the-as uint 4)) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) - (set! (-> obj sprites 3 scale-y) 1.5) - (set! (-> obj sprites 3 color z) 0) - (set! (-> obj sprites 3 flags) (the-as uint 4)) + (set! (-> this values 0 target) 1) + (set! (-> this values 1 target) 100) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3b :page #x67a))) + (set! (-> this sprites 0 flags) (the-as uint 4)) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3c :page #x67a))) + (set! (-> this sprites 1 flags) (the-as uint 4)) + (set! (-> this sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 5 scale-x) 0.5) + (set! (-> this sprites 5 flags) (the-as uint 4)) + (set! (-> this sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3d :page #x67a))) + (set! (-> this sprites 6 scale-x) 0.5) + (set! (-> this sprites 6 flags) (the-as uint 4)) + (set! (-> this sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 4 scale-y) 3.25) + (set! (-> this sprites 4 color z) 0) + (set! (-> this sprites 4 flags) (the-as uint 4)) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x41 :page #x67a))) + (set! (-> this sprites 3 scale-y) 1.5) + (set! (-> this sprites 3 color z) 0) + (set! (-> this sprites 3 flags) (the-as uint 4)) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc index 1e8baac630..29a36318f3 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow-more-extras_REF.gc @@ -21,21 +21,21 @@ ) ;; definition for method 3 of type tomb-boss-debris -(defmethod inspect tomb-boss-debris ((obj tomb-boss-debris)) - (when (not obj) - (set! obj obj) +(defmethod inspect tomb-boss-debris ((this tomb-boss-debris)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Ty-velocity: ~f~%" (-> obj y-velocity)) - (format #t "~2Tfloor: ~f~%" (-> obj floor)) - (format #t "~2Tsound-floor: ~f~%" (-> obj sound-floor)) - (format #t "~2Trot: #~%" (-> obj rot)) - (format #t "~2Tlook: ~D~%" (-> obj look)) + (format #t "~2Ty-velocity: ~f~%" (-> this y-velocity)) + (format #t "~2Tfloor: ~f~%" (-> this floor)) + (format #t "~2Tsound-floor: ~f~%" (-> this sound-floor)) + (format #t "~2Trot: #~%" (-> this rot)) + (format #t "~2Tlook: ~D~%" (-> this look)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -457,17 +457,17 @@ ) ;; definition for method 3 of type cave-in-master -(defmethod inspect cave-in-master ((obj cave-in-master)) - (when (not obj) - (set! obj obj) +(defmethod inspect cave-in-master ((this cave-in-master)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tprev-points[100] @ #x~X~%" (-> obj prev-points)) + (format #t "~2Tprev-points[100] @ #x~X~%" (-> this prev-points)) (label cfg-4) - obj + this ) ;; definition for function cavein-get-random-point @@ -495,7 +495,7 @@ (defstate idle (cave-in-master) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (spawn (-> self part) (-> self root trans)) @@ -526,25 +526,25 @@ ;; definition for method 11 of type cave-in-master ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! cave-in-master ((obj cave-in-master) (arg0 entity-actor)) +(defmethod init-from-entity! cave-in-master ((this cave-in-master) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (the-as entity #f) #f)) - (if (-> obj path) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (if (-> this path) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) ) - (+! (-> obj root trans y) 327680.0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (+! (-> this root trans y) 327680.0) + (logclear! (-> this mask) (process-mask actor-pause)) (dotimes (v1-12 100) - (set! (-> obj prev-points v1-12) 0) + (set! (-> this prev-points v1-12) 0) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 737) obj)) - (go (method-of-object obj wait)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 737) this)) + (go (method-of-object this wait)) (none) ) diff --git a/test/decompiler/reference/jak2/levels/tomb/widow2_REF.gc b/test/decompiler/reference/jak2/levels/tomb/widow2_REF.gc index 435cefc22e..32096e4962 100644 --- a/test/decompiler/reference/jak2/levels/tomb/widow2_REF.gc +++ b/test/decompiler/reference/jak2/levels/tomb/widow2_REF.gc @@ -2,13 +2,13 @@ (in-package goal) ;; definition for method 37 of type widow-shot -(defmethod deal-damage! widow-shot ((obj widow-shot) (arg0 process) (arg1 event-message-block)) +(defmethod deal-damage! widow-shot ((this widow-shot) (arg0 process) (arg1 event-message-block)) "Constructs an [[attack-info]] according to the projectile's `options`" (let ((t9-0 (method-of-type projectile deal-damage!))) - (when (t9-0 obj arg0 arg1) - (set! (-> obj hit-actor?) #t) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) (if (= arg0 *target*) - (send-event (ppointer->process (-> obj parent)) 'shot-hit-target) + (send-event (ppointer->process (-> this parent)) 'shot-hit-target) ) #t ) @@ -17,14 +17,14 @@ ;; definition for method 44 of type widow ;; INFO: Used lq/sq -(defmethod widow-method-44 widow ((obj widow) (arg0 vector) (arg1 vector)) +(defmethod widow-method-44 widow ((this widow) (arg0 vector) (arg1 vector)) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (set! (-> gp-0 start-pos quad) (-> arg0 quad)) (vector-normalize-copy! (-> gp-0 move-dist) arg1 81920.0) (let ((v1-1 gp-0)) (set! (-> v1-1 radius) 4096.0) (set! (-> v1-1 collide-with) (collide-spec enemy hit-by-others-list)) - (set! (-> v1-1 ignore-process0) obj) + (set! (-> v1-1 ignore-process0) this) (set! (-> v1-1 ignore-process1) #f) (set! (-> v1-1 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-1 action-mask) (collide-action solid deadly)) @@ -39,18 +39,18 @@ ;; definition for method 45 of type widow ;; INFO: Used lq/sq ;; WARN: Return type mismatch sound-id vs none. -(defmethod widow-method-45 widow ((obj widow) (arg0 vector) (arg1 vector) (arg2 vector)) +(defmethod widow-method-45 widow ((this widow) (arg0 vector) (arg1 vector) (arg2 vector)) (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) (let ((f30-0 (/ 2013265900.0 (vector-length arg2))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s5-0 ent) (-> obj entity)) + (set! (-> s5-0 ent) (-> this entity)) (set! (-> s5-0 charge) 1.0) (set! (-> s5-0 options) (projectile-options account-for-target-velocity)) (set! (-> s5-0 pos quad) (-> arg1 quad)) - (set! (-> s5-0 notify-handle) (process->handle obj)) + (set! (-> s5-0 notify-handle) (process->handle this)) (set! (-> s5-0 owner-handle) (the-as handle #f)) - (set! (-> s5-0 ignore-handle) (process->handle obj)) + (set! (-> s5-0 ignore-handle) (process->handle this)) (let* ((v1-13 *game-info*) (a0-12 (+ (-> v1-13 attack-id) 1)) ) @@ -68,7 +68,7 @@ ) (vector+! (-> s5-0 vel) (-> s5-0 vel) s3-0) ) - (spawn-projectile widow-shot s5-0 obj *default-dead-pool*) + (spawn-projectile widow-shot s5-0 this *default-dead-pool*) ) (if arg0 (sound-play "widow-fire") @@ -79,13 +79,13 @@ ;; definition for method 46 of type widow ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod widow-method-46 widow ((obj widow) (arg0 vector) (arg1 int)) - (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data arg1))) +(defmethod widow-method-46 widow ((this widow) (arg0 vector) (arg1 int)) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1))) (s3-0 (new 'stack-no-clear 'vector)) ) - (set! (-> s3-0 quad) (-> obj node-list data arg1 bone transform vector 1 quad)) - (if (widow-method-44 obj s4-0 s3-0) - (widow-method-45 obj arg0 s4-0 s3-0) + (set! (-> s3-0 quad) (-> this node-list data arg1 bone transform vector 1 quad)) + (if (widow-method-44 this s4-0 s3-0) + (widow-method-45 this arg0 s4-0 s3-0) ) ) 0 @@ -93,99 +93,99 @@ ) ;; definition for method 10 of type widow -(defmethod deactivate widow ((obj widow)) - (if (nonzero? (-> obj drill-spark-part)) - (kill-and-free-particles (-> obj drill-spark-part)) +(defmethod deactivate widow ((this widow)) + (if (nonzero? (-> this drill-spark-part)) + (kill-and-free-particles (-> this drill-spark-part)) ) - (if (nonzero? (-> obj drill-spark-part-alt)) - (kill-and-free-particles (-> obj drill-spark-part-alt)) + (if (nonzero? (-> this drill-spark-part-alt)) + (kill-and-free-particles (-> this drill-spark-part-alt)) ) - (if (nonzero? (-> obj extract-stone-part)) - (kill-and-free-particles (-> obj extract-stone-part)) + (if (nonzero? (-> this extract-stone-part)) + (kill-and-free-particles (-> this extract-stone-part)) ) - (if (nonzero? (-> obj insert-stone-part)) - (kill-and-free-particles (-> obj insert-stone-part)) + (if (nonzero? (-> this insert-stone-part)) + (kill-and-free-particles (-> this insert-stone-part)) ) - (if (nonzero? (-> obj land-part)) - (kill-and-free-particles (-> obj land-part)) + (if (nonzero? (-> this land-part)) + (kill-and-free-particles (-> this land-part)) ) - (if (nonzero? (-> obj green-charge-part)) - (kill-and-free-particles (-> obj green-charge-part)) + (if (nonzero? (-> this green-charge-part)) + (kill-and-free-particles (-> this green-charge-part)) ) - (if (nonzero? (-> obj green-fire-part)) - (kill-and-free-particles (-> obj green-fire-part)) + (if (nonzero? (-> this green-fire-part)) + (kill-and-free-particles (-> this green-fire-part)) ) - (if (-> obj drill-sound-playing) - (sound-stop (-> obj drill-sound)) + (if (-> this drill-sound-playing) + (sound-stop (-> this drill-sound)) ) - (if (-> obj drill-sweeten-sound-playing) - (sound-stop (-> obj drill-sweeten-sound)) + (if (-> this drill-sweeten-sound-playing) + (sound-stop (-> this drill-sweeten-sound)) ) - (if (-> obj hover-sound-playing) - (sound-stop (-> obj hover-sound)) + (if (-> this hover-sound-playing) + (sound-stop (-> this hover-sound)) ) - (if (-> obj shake-sound-playing) - (sound-stop (-> obj shake-sound)) + (if (-> this shake-sound-playing) + (sound-stop (-> this shake-sound)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 7 of type widow ;; WARN: Return type mismatch process-drawable vs widow. -(defmethod relocate widow ((obj widow) (arg0 int)) - (if (nonzero? (-> obj left-cover-jm)) - (&+! (-> obj left-cover-jm) arg0) +(defmethod relocate widow ((this widow) (arg0 int)) + (if (nonzero? (-> this left-cover-jm)) + (&+! (-> this left-cover-jm) arg0) ) - (if (nonzero? (-> obj right-cover-jm)) - (&+! (-> obj right-cover-jm) arg0) + (if (nonzero? (-> this right-cover-jm)) + (&+! (-> this right-cover-jm) arg0) ) - (if (nonzero? (-> obj left-drill-jm)) - (&+! (-> obj left-drill-jm) arg0) + (if (nonzero? (-> this left-drill-jm)) + (&+! (-> this left-drill-jm) arg0) ) - (if (nonzero? (-> obj right-drill-jm)) - (&+! (-> obj right-drill-jm) arg0) + (if (nonzero? (-> this right-drill-jm)) + (&+! (-> this right-drill-jm) arg0) ) - (if (nonzero? (-> obj drill-spark-part)) - (&+! (-> obj drill-spark-part) arg0) + (if (nonzero? (-> this drill-spark-part)) + (&+! (-> this drill-spark-part) arg0) ) - (if (nonzero? (-> obj drill-spark-part-alt)) - (&+! (-> obj drill-spark-part-alt) arg0) + (if (nonzero? (-> this drill-spark-part-alt)) + (&+! (-> this drill-spark-part-alt) arg0) ) - (if (nonzero? (-> obj extract-stone-part)) - (&+! (-> obj extract-stone-part) arg0) + (if (nonzero? (-> this extract-stone-part)) + (&+! (-> this extract-stone-part) arg0) ) - (if (nonzero? (-> obj insert-stone-part)) - (&+! (-> obj insert-stone-part) arg0) + (if (nonzero? (-> this insert-stone-part)) + (&+! (-> this insert-stone-part) arg0) ) - (if (nonzero? (-> obj land-part)) - (&+! (-> obj land-part) arg0) + (if (nonzero? (-> this land-part)) + (&+! (-> this land-part) arg0) ) - (if (nonzero? (-> obj green-charge-part)) - (&+! (-> obj green-charge-part) arg0) + (if (nonzero? (-> this green-charge-part)) + (&+! (-> this green-charge-part) arg0) ) - (if (nonzero? (-> obj green-fire-part)) - (&+! (-> obj green-fire-part) arg0) + (if (nonzero? (-> this green-fire-part)) + (&+! (-> this green-fire-part) arg0) ) (dotimes (v1-44 5) - (if (nonzero? (-> obj lightning v1-44)) - (&+! (-> obj lightning v1-44) arg0) + (if (nonzero? (-> this lightning v1-44)) + (&+! (-> this lightning v1-44) arg0) ) ) - (the-as widow ((method-of-type process-drawable relocate) obj arg0)) + (the-as widow ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type widow ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! widow ((obj widow) (arg0 entity-actor)) +(defmethod init-from-entity! widow ((this widow) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -231,21 +231,21 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-widow" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (setup-masks (-> obj draw) 0 126) - (set! (-> obj root pause-adjust-distance) 245760.0) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (setup-masks (-> this draw) 0 126) + (set! (-> this root pause-adjust-distance) 245760.0) (dotimes (v1-26 8) - (set! (-> obj catwalk v1-26) (the-as handle #f)) + (set! (-> this catwalk v1-26) (the-as handle #f)) ) - (let ((s4-2 (-> obj entity extra perm))) + (let ((s4-2 (-> this entity extra perm))) (logior! (-> s4-2 status) (entity-perm-status bit-5)) 0 (let ((s3-2 (new 'stack-no-clear 'vector))) @@ -255,105 +255,105 @@ This commonly includes things such as: (dotimes (s5-1 8) (cond ((not (logtest? (the-as int (-> s4-2 user-object 1)) (ash 1 s5-1))) - (set! (-> obj catwalk s5-1) (ppointer->handle (process-spawn tomb-boss-catwalk s3-2 s5-1 :to obj))) - (if (not (handle->process (-> obj catwalk s5-1))) + (set! (-> this catwalk s5-1) (ppointer->handle (process-spawn tomb-boss-catwalk s3-2 s5-1 :to this))) + (if (not (handle->process (-> this catwalk s5-1))) (format 0 "catwalk ~D failed to spawn~%" s5-1) ) ) (else - (send-event (handle->process (-> obj catwalk 0)) 'catwalk-hit s5-1) + (send-event (handle->process (-> this catwalk 0)) 'catwalk-hit s5-1) ) ) ) ) ) (dotimes (v1-62 8) - (set! (-> obj bomb v1-62) (the-as handle #f)) + (set! (-> this bomb v1-62) (the-as handle #f)) ) (dotimes (v1-65 2) - (set! (-> obj ammos v1-65) (the-as handle #f)) - (set! (-> obj ammo-timers v1-65) 0) + (set! (-> this ammos v1-65) (the-as handle #f)) + (set! (-> this ammo-timers v1-65) 0) ) - (set! (-> obj attack-from-high-deg) #f) - (set! (-> obj which-gun) 0) - (set! (-> obj which-pod) 0) - (set! (-> obj bomb-hits) 0) - (set! (-> obj flying) #f) - (set! (-> obj previous-anim) 0) - (set! (-> obj circle-center quad) (-> obj root trans quad)) - (+! (-> obj circle-center z) 40960.0) - (init (-> obj theta) 0.0 0.01 91.022224 0.9) - (init (-> obj tilt) 0.0 0.01 91.022224 0.9) - (set! (-> obj left-cover-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 90)) - (set! (-> obj right-cover-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 91)) - (widow-float-seeker-method-9 (-> obj left-cover-angle) 0.0 0.01 0.1 0.9 0.25) - (widow-float-seeker-method-9 (-> obj right-cover-angle) 0.0 0.01 0.1 0.9 0.25) - (set! (-> obj left-drill-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 11)) - (set! (-> obj right-drill-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) obj 44)) - (init (-> obj drill-speed) 0.0 0.01 0.1 0.9) + (set! (-> this attack-from-high-deg) #f) + (set! (-> this which-gun) 0) + (set! (-> this which-pod) 0) + (set! (-> this bomb-hits) 0) + (set! (-> this flying) #f) + (set! (-> this previous-anim) 0) + (set! (-> this circle-center quad) (-> this root trans quad)) + (+! (-> this circle-center z) 40960.0) + (init (-> this theta) 0.0 0.01 91.022224 0.9) + (init (-> this tilt) 0.0 0.01 91.022224 0.9) + (set! (-> this left-cover-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 90)) + (set! (-> this right-cover-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 91)) + (widow-float-seeker-method-9 (-> this left-cover-angle) 0.0 0.01 0.1 0.9 0.25) + (widow-float-seeker-method-9 (-> this right-cover-angle) 0.0 0.01 0.1 0.9 0.25) + (set! (-> this left-drill-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 11)) + (set! (-> this right-drill-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 44)) + (init (-> this drill-speed) 0.0 0.01 0.1 0.9) (let ((s5-2 (new 'stack-no-clear 'vector))) - (set! (-> s5-2 quad) (-> obj root trans quad)) - (set! (-> obj baron) (process-spawn - manipy - :init manipy-init - s5-2 - (-> obj entity) - (art-group-get-by-name *level* "skel-baron" (the-as (pointer uint32) #f)) - #f - 0 - :to obj - ) + (set! (-> s5-2 quad) (-> this root trans quad)) + (set! (-> this baron) (process-spawn + manipy + :init manipy-init + s5-2 + (-> this entity) + (art-group-get-by-name *level* "skel-baron" (the-as (pointer uint32) #f)) + #f + 0 + :to this + ) ) ) - (logior! (-> obj baron 0 draw global-effect) (draw-control-global-effect disable-envmap)) - (send-event (ppointer->process (-> obj baron)) 'anim-mode 'clone-anim) - (set! (-> obj baron 0 draw light-index) (mod (-> obj draw light-index) (the-as uint 10))) - (let ((v1-106 (-> obj baron))) + (logior! (-> this baron 0 draw global-effect) (draw-control-global-effect disable-envmap)) + (send-event (ppointer->process (-> this baron)) 'anim-mode 'clone-anim) + (set! (-> this baron 0 draw light-index) (mod (-> this draw light-index) (the-as uint 10))) + (let ((v1-106 (-> this baron))) (if v1-106 (logclear! (-> v1-106 0 mask) (process-mask actor-pause)) ) ) - (set! (-> obj pod) (ppointer->handle (process-spawn baron-pod (-> obj root trans) :to obj))) - (set! (-> obj heart) (the-as handle #f)) - (set! (-> obj drill-spark-part) (create-launch-control (-> *part-group-id-table* 713) obj)) - (set! (-> obj drill-spark-part-alt) (create-launch-control (-> *part-group-id-table* 714) obj)) - (set! (-> obj extract-stone-time) 0) - (set! (-> obj extract-stone-part) (create-launch-control (-> *part-group-id-table* 715) obj)) - (set! (-> obj insert-stone-time) 0) - (set! (-> obj insert-stone-part) (create-launch-control (-> *part-group-id-table* 716) obj)) - (set! (-> obj land-part) (create-launch-control (-> *part-group-id-table* 730) obj)) - (set! (-> obj green-charge-part) (create-launch-control (-> *part-group-id-table* 731) obj)) - (set! (-> obj green-fire-part) (create-launch-control (-> *part-group-id-table* 732) obj)) - (add-connection *part-engine* obj 73 obj 3251 (new 'static 'vector :w 819200.0)) - (add-connection *part-engine* obj 77 obj 3251 (new 'static 'vector :w 819200.0)) - (add-connection *part-engine* obj 78 obj 3251 (new 'static 'vector :w 819200.0)) + (set! (-> this pod) (ppointer->handle (process-spawn baron-pod (-> this root trans) :to this))) + (set! (-> this heart) (the-as handle #f)) + (set! (-> this drill-spark-part) (create-launch-control (-> *part-group-id-table* 713) this)) + (set! (-> this drill-spark-part-alt) (create-launch-control (-> *part-group-id-table* 714) this)) + (set! (-> this extract-stone-time) 0) + (set! (-> this extract-stone-part) (create-launch-control (-> *part-group-id-table* 715) this)) + (set! (-> this insert-stone-time) 0) + (set! (-> this insert-stone-part) (create-launch-control (-> *part-group-id-table* 716) this)) + (set! (-> this land-part) (create-launch-control (-> *part-group-id-table* 730) this)) + (set! (-> this green-charge-part) (create-launch-control (-> *part-group-id-table* 731) this)) + (set! (-> this green-fire-part) (create-launch-control (-> *part-group-id-table* 732) this)) + (add-connection *part-engine* this 73 this 3251 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 77 this 3251 (new 'static 'vector :w 819200.0)) + (add-connection *part-engine* this 78 this 3251 (new 'static 'vector :w 819200.0)) (dotimes (s5-4 5) - (set! (-> obj lightning s5-4) (new - 'process - 'lightning-control - (new 'static 'lightning-spec - :name #f - :flags (lightning-spec-flags lsf0) - :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) - :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) - :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) - :fade-start-factor 0.2 - :fade-time 120.0 - :texture (new 'static 'texture-id :index #x7 :page #x8c7) - :reduction 0.4 - :num-points 48 - :box-size 57344.0 - :merge-factor 0.5 - :merge-count 2 - :radius 9216.0 - :duration -1.0 - :sound #f - ) - obj - 0.0 - ) + (set! (-> this lightning s5-4) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x7 :page #x8c7) + :reduction 0.4 + :num-points 48 + :box-size 57344.0 + :merge-factor 0.5 + :merge-count 2 + :radius 9216.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) ) - (let ((v1-148 (-> obj lightning s5-4)) + (let ((v1-148 (-> this lightning s5-4)) (a0-97 0) ) (let ((a1-48 (!= a0-97 (-> v1-148 state mode)))) @@ -372,34 +372,34 @@ This commonly includes things such as: (set! (-> v1-148 state mode) (the-as lightning-mode a0-97)) ) ) - (set! (-> obj catwalk-sound) (new-sound-id)) - (set! (-> obj drill-sound) (new-sound-id)) - (set! (-> obj drill-sound-playing) #f) - (set! (-> obj drill-sweeten-sound) (new-sound-id)) - (set! (-> obj drill-sweeten-sound-playing) #f) - (set! (-> obj hover-sound) (new-sound-id)) - (set! (-> obj hover-sound-playing) #f) - (set! (-> obj shake-sound) (new-sound-id)) - (set! (-> obj shake-sound-playing) #f) - (set! (-> obj hud) (the-as handle #f)) - (set! (-> obj last-want-stone-talker) 0) - (set! (-> obj last-general-flying-talker) 0) - (set! (-> obj last-launch-droids-talker) 0) - (set! (-> obj last-launch-bombs-talker) 0) - (set! (-> obj last-shoot-gun-talker) 0) - (set! (-> obj last-stone-charge-up-talker) 0) - (set! (-> obj last-after-stone-shot-talker) 0) - (set! (-> obj last-leave-perch-talker) 0) - (set! (-> obj last-damaged-talker) 0) - (set! (-> obj kicked-bombs) 0) - (set! (-> obj launch-stages-completed) 0) - (set! (-> obj current-shoot-stage) 0) - (set! (-> obj last-gun-hit-stage) 0) - (set! (-> obj gun-hits) 0) - (set! (-> obj last-attack-id) (the-as uint 0)) + (set! (-> this catwalk-sound) (new-sound-id)) + (set! (-> this drill-sound) (new-sound-id)) + (set! (-> this drill-sound-playing) #f) + (set! (-> this drill-sweeten-sound) (new-sound-id)) + (set! (-> this drill-sweeten-sound-playing) #f) + (set! (-> this hover-sound) (new-sound-id)) + (set! (-> this hover-sound-playing) #f) + (set! (-> this shake-sound) (new-sound-id)) + (set! (-> this shake-sound-playing) #f) + (set! (-> this hud) (the-as handle #f)) + (set! (-> this last-want-stone-talker) 0) + (set! (-> this last-general-flying-talker) 0) + (set! (-> this last-launch-droids-talker) 0) + (set! (-> this last-launch-bombs-talker) 0) + (set! (-> this last-shoot-gun-talker) 0) + (set! (-> this last-stone-charge-up-talker) 0) + (set! (-> this last-after-stone-shot-talker) 0) + (set! (-> this last-leave-perch-talker) 0) + (set! (-> this last-damaged-talker) 0) + (set! (-> this kicked-bombs) 0) + (set! (-> this launch-stages-completed) 0) + (set! (-> this current-shoot-stage) 0) + (set! (-> this last-gun-hit-stage) 0) + (set! (-> this gun-hits) 0) + (set! (-> this last-attack-id) (the-as uint 0)) (if (task-node-closed? (game-task-node tomb-boss-resolution)) - (go (method-of-object obj beaten)) - (go (method-of-object obj hidden)) + (go (method-of-object this beaten)) + (go (method-of-object this hidden)) ) (none) ) diff --git a/test/decompiler/reference/jak2/levels/under/centipede_REF.gc b/test/decompiler/reference/jak2/levels/under/centipede_REF.gc index 056b984da8..82ff442fd8 100644 --- a/test/decompiler/reference/jak2/levels/under/centipede_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/centipede_REF.gc @@ -14,18 +14,18 @@ ) ;; definition for method 3 of type centipede-cam -(defmethod inspect centipede-cam ((obj centipede-cam)) - (when (not obj) - (set! obj obj) +(defmethod inspect centipede-cam ((this centipede-cam)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'centipede-cam) - (format #t "~1Tinit?: ~A~%" (-> obj init?)) - (format #t "~1Ttrans: #~%" (-> obj trans)) - (format #t "~1Tdir: #~%" (-> obj dir)) - (format #t "~1Ttrack-focus-tilt: ~f~%" (-> obj track-focus-tilt)) + (format #t "[~8x] ~A~%" this 'centipede-cam) + (format #t "~1Tinit?: ~A~%" (-> this init?)) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Ttrack-focus-tilt: ~f~%" (-> this track-focus-tilt)) (label cfg-4) - obj + this ) ;; definition of type centipede @@ -69,34 +69,34 @@ ) ;; definition for method 3 of type centipede -(defmethod inspect centipede ((obj centipede)) - (when (not obj) - (set! obj obj) +(defmethod inspect centipede ((this centipede)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type nav-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tid: ~D~%" (-> obj id)) - (format #t "~2Tanim-ctr: ~D~%" (-> obj anim-ctr)) - (format #t "~2Tfocus-pos-hist-count: ~D~%" (-> obj focus-pos-hist-count)) - (format #t "~2Tlegs-sound: ~A~%" (-> obj legs-sound)) - (format #t "~2Tgrabbed-focus?: ~A~%" (-> obj grabbed-focus?)) - (format #t "~2Tusing-chan1-effects?: ~A~%" (-> obj using-chan1-effects?)) - (format #t "~2Tset-camera-mode?: ~A~%" (-> obj set-camera-mode?)) - (format #t "~2Ttalking-volume: ~f~%" (-> obj talking-volume)) - (format #t "~2Tdesired-talking-volume: ~f~%" (-> obj desired-talking-volume)) - (format #t "~2Tlegs-volume: ~f~%" (-> obj legs-volume)) - (format #t "~2Tfocus-gnd-height: ~f~%" (-> obj focus-gnd-height)) - (format #t "~2Ttrack-focus-tilt: ~f~%" (-> obj track-focus-tilt)) - (format #t "~2Tbobbing-intensity: ~f~%" (-> obj bobbing-intensity)) - (format #t "~2Tbobbing: ~A~%" (-> obj bobbing)) - (format #t "~2Tsrc-quat: #~%" (-> obj src-quat)) - (format #t "~2Tdest-quat: #~%" (-> obj dest-quat)) - (format #t "~2Tcam: #~%" (-> obj cam)) - (format #t "~2Tfocus-pos-hist[15] @ #x~X~%" (-> obj focus-pos-hist)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Tanim-ctr: ~D~%" (-> this anim-ctr)) + (format #t "~2Tfocus-pos-hist-count: ~D~%" (-> this focus-pos-hist-count)) + (format #t "~2Tlegs-sound: ~A~%" (-> this legs-sound)) + (format #t "~2Tgrabbed-focus?: ~A~%" (-> this grabbed-focus?)) + (format #t "~2Tusing-chan1-effects?: ~A~%" (-> this using-chan1-effects?)) + (format #t "~2Tset-camera-mode?: ~A~%" (-> this set-camera-mode?)) + (format #t "~2Ttalking-volume: ~f~%" (-> this talking-volume)) + (format #t "~2Tdesired-talking-volume: ~f~%" (-> this desired-talking-volume)) + (format #t "~2Tlegs-volume: ~f~%" (-> this legs-volume)) + (format #t "~2Tfocus-gnd-height: ~f~%" (-> this focus-gnd-height)) + (format #t "~2Ttrack-focus-tilt: ~f~%" (-> this track-focus-tilt)) + (format #t "~2Tbobbing-intensity: ~f~%" (-> this bobbing-intensity)) + (format #t "~2Tbobbing: ~A~%" (-> this bobbing)) + (format #t "~2Tsrc-quat: #~%" (-> this src-quat)) + (format #t "~2Tdest-quat: #~%" (-> this dest-quat)) + (format #t "~2Tcam: #~%" (-> this cam)) + (format #t "~2Tfocus-pos-hist[15] @ #x~X~%" (-> this focus-pos-hist)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -220,80 +220,80 @@ (set! (-> *centipede-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 74 of type centipede -(defmethod general-event-handler centipede ((obj centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler centipede ((this centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('under-break-floor) - (go (method-of-object obj thru-grating)) + (go (method-of-object this thru-grating)) ) (else - ((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type nav-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 7 of type centipede ;; WARN: Return type mismatch nav-enemy vs centipede. -(defmethod relocate centipede ((obj centipede) (arg0 int)) - (if (nonzero? (-> obj bobbing)) - (&+! (-> obj bobbing) arg0) +(defmethod relocate centipede ((this centipede) (arg0 int)) + (if (nonzero? (-> this bobbing)) + (&+! (-> this bobbing) arg0) ) - (if (nonzero? (-> obj legs-sound)) - (&+! (-> obj legs-sound) arg0) + (if (nonzero? (-> this legs-sound)) + (&+! (-> this legs-sound) arg0) ) - (the-as centipede ((method-of-type nav-enemy relocate) obj arg0)) + (the-as centipede ((method-of-type nav-enemy relocate) this arg0)) ) ;; definition for method 10 of type centipede -(defmethod deactivate centipede ((obj centipede)) - (when (-> obj set-camera-mode?) - (set! (-> obj set-camera-mode?) #f) +(defmethod deactivate centipede ((this centipede)) + (when (-> this set-camera-mode?) + (set! (-> this set-camera-mode?) #f) (remove-setting-by-arg0 *setting-control* 'mode-name) ) - (if (nonzero? (-> obj legs-sound)) - (stop! (-> obj legs-sound)) + (if (nonzero? (-> this legs-sound)) + (stop! (-> this legs-sound)) ) - ((method-of-type nav-enemy deactivate) obj) + ((method-of-type nav-enemy deactivate) this) (none) ) ;; definition for method 187 of type centipede ;; INFO: Used lq/sq ;; WARN: Return type mismatch float vs none. -(defmethod centipede-method-187 centipede ((obj centipede)) - (let ((centipede-cam (-> obj cam))) +(defmethod centipede-method-187 centipede ((this centipede)) + (let ((centipede-cam (-> this cam))) (let ((cam-dir (new 'stack-no-clear 'vector))) (set! (-> cam-dir quad) (-> centipede-cam dir quad)) - (vector-z-quaternion! (-> centipede-cam dir) (-> obj root quat)) + (vector-z-quaternion! (-> centipede-cam dir) (-> this root quat)) (set! (-> centipede-cam dir y) 0.0) (vector-normalize! (-> centipede-cam dir) 1.0) - (set! (-> centipede-cam trans quad) (-> obj root trans quad)) + (set! (-> centipede-cam trans quad) (-> this root trans quad)) (set! (-> centipede-cam trans y) (+ 32768.0 (* (+ (* 2048.0 (cos (* 218.45334 (the float (mod (current-time) 300))))) (* 614.4 (cos (* 68.91272 (the float (mod (current-time) 951))))) ) - (-> obj bobbing-intensity) + (-> this bobbing-intensity) ) (-> centipede-cam trans y) ) ) - (if (= (-> obj id) 1) + (if (= (-> this id) 1) (set! (-> centipede-cam dir y) -0.574) (set! (-> centipede-cam dir y) -0.474) ) (vector-normalize! (-> centipede-cam dir) 1.0) - (let ((proc (handle->process (-> obj focus handle))) + (let ((proc (handle->process (-> this focus handle))) (s3-0 #f) ) - (when (and proc (not (and (-> obj next-state) (let ((v1-27 (-> obj next-state name))) - (or (= v1-27 'attack) (= v1-27 'attack-failed)) - ) + (when (and proc (not (and (-> this next-state) (let ((v1-27 (-> this next-state name))) + (or (= v1-27 'attack) (= v1-27 'attack-failed)) + ) ) ) ) (let ((s2-0 (new 'stack-no-clear 'vector))) - (vector-! s2-0 (get-trans (the-as process-focusable proc) 0) (-> obj root trans)) + (vector-! s2-0 (get-trans (the-as process-focusable proc) 0) (-> this root trans)) (vector-normalize! s2-0 1.0) (when (>= (vector-dot s2-0 (-> centipede-cam dir)) 0.342) (let ((f0-23 (fmax @@ -363,75 +363,75 @@ ;; definition for method 188 of type centipede ;; WARN: Return type mismatch int vs none. -(defmethod centipede-method-188 centipede ((obj centipede)) +(defmethod centipede-method-188 centipede ((this centipede)) (local-vars (s5-0 art-element)) - (let ((janim (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) + (let ((janim (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) ) ) ) (cond - ((and janim (= janim (-> obj draw art-group data 4))) + ((and janim (= janim (-> this draw art-group data 4))) (when (ja-done? 1) - (-> obj draw art-group data 7) - (let ((v1-10 (get-rand-int obj 100)) - (a0-9 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 1 frame-group) + (-> this draw art-group data 7) + (let ((v1-10 (get-rand-int this 100)) + (a0-9 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 1 frame-group) ) ) ) (cond - ((and (= a0-9 (-> obj draw art-group data 7)) (> (-> obj anim-ctr) 0)) - (+! (-> obj anim-ctr) -1) - (set! s5-0 (-> obj draw art-group data 7)) + ((and (= a0-9 (-> this draw art-group data 7)) (> (-> this anim-ctr) 0)) + (+! (-> this anim-ctr) -1) + (set! s5-0 (-> this draw art-group data 7)) ) - ((= a0-9 (-> obj draw art-group data 11)) - (set! s5-0 (-> obj draw art-group data 12)) - (set! (-> obj anim-ctr) (get-rand-int-range obj 0 3)) + ((= a0-9 (-> this draw art-group data 11)) + (set! s5-0 (-> this draw art-group data 12)) + (set! (-> this anim-ctr) (get-rand-int-range this 0 3)) ) - ((= a0-9 (-> obj draw art-group data 12)) - (let ((v1-20 (-> obj anim-ctr))) + ((= a0-9 (-> this draw art-group data 12)) + (let ((v1-20 (-> this anim-ctr))) (cond ((> v1-20 0) - (set! (-> obj anim-ctr) (+ v1-20 -1)) - (set! s5-0 (-> obj draw art-group data 12)) + (set! (-> this anim-ctr) (+ v1-20 -1)) + (set! s5-0 (-> this draw art-group data 12)) ) (else - (set! s5-0 (-> obj draw art-group data 13)) + (set! s5-0 (-> this draw art-group data 13)) ) ) ) ) - ((= a0-9 (-> obj draw art-group data 13)) - (set! s5-0 (-> obj draw art-group data 14)) - (set! (-> obj anim-ctr) (get-rand-int-range obj 0 3)) + ((= a0-9 (-> this draw art-group data 13)) + (set! s5-0 (-> this draw art-group data 14)) + (set! (-> this anim-ctr) (get-rand-int-range this 0 3)) ) - ((and (= a0-9 (-> obj draw art-group data 14)) (> (-> obj anim-ctr) 0)) - (+! (-> obj anim-ctr) -1) - (set! s5-0 (-> obj draw art-group data 14)) + ((and (= a0-9 (-> this draw art-group data 14)) (> (-> this anim-ctr) 0)) + (+! (-> this anim-ctr) -1) + (set! s5-0 (-> this draw art-group data 14)) ) ((< v1-10 10) - (set! s5-0 (-> obj draw art-group data 11)) + (set! s5-0 (-> this draw art-group data 11)) ) ((< v1-10 30) - (set! s5-0 (-> obj draw art-group data 8)) + (set! s5-0 (-> this draw art-group data 8)) ) ((< v1-10 50) - (set! s5-0 (-> obj draw art-group data 9)) + (set! s5-0 (-> this draw art-group data 9)) ) ((< v1-10 65) - (set! s5-0 (-> obj draw art-group data 10)) + (set! s5-0 (-> this draw art-group data 10)) ) (else - (set! s5-0 (-> obj draw art-group data 7)) - (set! (-> obj anim-ctr) (get-rand-int-range obj 2 6)) + (set! s5-0 (-> this draw art-group data 7)) + (set! (-> this anim-ctr) (get-rand-int-range this 2 6)) ) ) ) - (let ((a0-17 (-> obj skel root-channel 1))) + (let ((a0-17 (-> this skel root-channel 1))) (set! (-> a0-17 frame-interp 1) 1.0) - (set! (-> obj skel interp-select 0) 192) - (set! (-> obj skel interp-select 1) 0) + (set! (-> this skel interp-select 0) 192) + (set! (-> this skel interp-select 1) 0) (set! (-> a0-17 frame-group) (the-as art-joint-anim s5-0)) (set! (-> a0-17 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) (set! (-> a0-17 param 1) 1.0) @@ -439,11 +439,11 @@ (joint-control-channel-group! a0-17 (the-as art-joint-anim s5-0) num-func-seek!) ) ) - (let ((a0-18 (-> obj skel root-channel 0))) + (let ((a0-18 (-> this skel root-channel 0))) (set! (-> a0-18 param 0) 0.7) (joint-control-channel-group-eval! a0-18 (the-as art-joint-anim #f) num-func-loop!) ) - (let ((a0-19 (-> obj skel root-channel 1))) + (let ((a0-19 (-> this skel root-channel 1))) (set! (-> a0-19 param 0) (the float (+ (-> a0-19 frame-group frames num-frames) -1))) (set! (-> a0-19 param 1) 1.0) (joint-control-channel-group-eval! a0-19 (the-as art-joint-anim #f) num-func-seek!) @@ -451,26 +451,26 @@ ) (else (ja-channel-push! 2 (seconds 0.15)) - (let ((a0-21 (-> obj skel root-channel 0))) - (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> obj draw art-group data 4))) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) (set! (-> a0-21 param 0) 0.7) - (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> obj draw art-group data 4)) num-func-loop!) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-loop!) ) - (let ((a0-22 (-> obj skel root-channel 1))) + (let ((a0-22 (-> this skel root-channel 1))) (set! (-> a0-22 frame-interp 1) 1.0) - (set! (-> obj skel interp-select 0) 192) - (set! (-> obj skel interp-select 1) 0) - (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> obj draw art-group data 7))) + (set! (-> this skel interp-select 0) 192) + (set! (-> this skel interp-select 1) 0) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 7))) (set! (-> a0-22 param 0) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 7)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 7)) frames num-frames) -1)) ) (set! (-> a0-22 param 1) 1.0) - (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> obj draw art-group data 7)) num-func-seek!) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 7)) num-func-seek!) ) - (set! (-> obj anim-ctr) (get-rand-int-range obj 2 6)) - (when (not (-> obj using-chan1-effects?)) - (set! (-> obj using-chan1-effects?) #t) - (let ((v1-106 (-> obj skel effect))) + (set! (-> this anim-ctr) (get-rand-int-range this 2 6)) + (when (not (-> this using-chan1-effects?)) + (set! (-> this using-chan1-effects?) #t) + (let ((v1-106 (-> this skel effect))) (set! (-> v1-106 channel-offset) 1) ) 0 @@ -483,10 +483,10 @@ ;; definition for method 184 of type centipede ;; WARN: Return type mismatch int vs none. -(defmethod set-chan1-effects centipede ((obj centipede)) - (when (-> obj using-chan1-effects?) - (set! (-> obj using-chan1-effects?) #f) - (let ((v1-2 (-> obj skel effect))) +(defmethod set-chan1-effects centipede ((this centipede)) + (when (-> this using-chan1-effects?) + (set! (-> this using-chan1-effects?) #f) + (let ((v1-2 (-> this skel effect))) (set! (-> v1-2 channel-offset) 0) ) 0 @@ -497,36 +497,36 @@ ;; definition for method 142 of type centipede ;; INFO: Used lq/sq ;; WARN: Return type mismatch quaternion vs none. -(defmethod nav-enemy-method-142 centipede ((obj centipede) (arg0 nav-control)) +(defmethod nav-enemy-method-142 centipede ((this centipede) (arg0 nav-control)) (let ((t9-0 (method-of-type nav-enemy nav-enemy-method-142))) - (t9-0 obj arg0) + (t9-0 this arg0) ) (let ((s5-0 (new 'stack-no-clear 'vector))) - (vector-z-quaternion! s5-0 (-> obj root quat)) + (vector-z-quaternion! s5-0 (-> this root quat)) (vector-normalize! s5-0 1.0) - (let ((s3-0 (handle->process (-> obj focus handle))) + (let ((s3-0 (handle->process (-> this focus handle))) (s4-0 #f) ) (cond (s3-0 - (let ((s2-0 (-> obj focus-pos-hist-count))) + (let ((s2-0 (-> this focus-pos-hist-count))) (countdown (v1-7 (min 14 s2-0)) - (set! (-> obj focus-pos-hist (+ v1-7 1) quad) (-> obj focus-pos-hist v1-7 quad)) + (set! (-> this focus-pos-hist (+ v1-7 1) quad) (-> this focus-pos-hist v1-7 quad)) ) - (set! (-> obj focus-pos-hist 0 quad) (-> (get-trans (the-as process-focusable s3-0) 0) quad)) + (set! (-> this focus-pos-hist 0 quad) (-> (get-trans (the-as process-focusable s3-0) 0) quad)) (if (< s2-0 15) - (set! (-> obj focus-pos-hist-count) (+ s2-0 1)) + (set! (-> this focus-pos-hist-count) (+ s2-0 1)) ) ) ) (else - (set! (-> obj focus-pos-hist-count) 0) + (set! (-> this focus-pos-hist-count) 0) 0 ) ) (when s3-0 (let ((s3-1 (new 'stack-no-clear 'vector))) - (vector-! s3-1 (-> obj focus-pos-hist (+ (-> obj focus-pos-hist-count) -1)) (-> obj root trans)) + (vector-! s3-1 (-> this focus-pos-hist (+ (-> this focus-pos-hist-count) -1)) (-> this root trans)) (vector-normalize! s3-1 1.0) (when (>= (vector-dot s3-1 s5-0) 0.342) (let ((f0-9 @@ -536,8 +536,8 @@ ) ) ) - (set! (-> obj track-focus-tilt) - (seek-with-smooth (-> obj track-focus-tilt) f0-9 (* 5461.3335 (seconds-per-frame)) 0.25 1.0) + (set! (-> this track-focus-tilt) + (seek-with-smooth (-> this track-focus-tilt) f0-9 (* 5461.3335 (seconds-per-frame)) 0.25 1.0) ) ) (set! s4-0 #t) @@ -545,8 +545,8 @@ ) ) (if (not s4-0) - (set! (-> obj track-focus-tilt) - (seek-with-smooth (-> obj track-focus-tilt) 0.0 (* 5461.3335 (seconds-per-frame)) 0.25 1.0) + (set! (-> this track-focus-tilt) + (seek-with-smooth (-> this track-focus-tilt) 0.0 (* 5461.3335 (seconds-per-frame)) 0.25 1.0) ) ) ) @@ -554,21 +554,21 @@ (s4-1 (new 'stack-no-clear 'quaternion)) ) (vector-rotate90-around-y! s3-2 s5-0) - (quaternion-vector-angle! s4-1 s3-2 (+ 4551.1113 (-> obj track-focus-tilt))) - (quaternion*! (-> obj root quat) s4-1 (-> obj root quat)) + (quaternion-vector-angle! s4-1 s3-2 (+ 4551.1113 (-> this track-focus-tilt))) + (quaternion*! (-> this root quat) s4-1 (-> this root quat)) ) ) (none) ) ;; definition for method 60 of type centipede -(defmethod coin-flip? centipede ((obj centipede)) +(defmethod coin-flip? centipede ((this centipede)) "@returns The result of a 50/50 RNG roll" #f ) ;; definition for method 98 of type centipede -(defmethod in-aggro-range? centipede ((obj centipede) (arg0 process-focusable) (arg1 vector)) +(defmethod in-aggro-range? centipede ((this centipede) (arg0 process-focusable) (arg1 vector)) "Should the enemy activate. - if `activate-distance` is `0.0`, always true - otherwise, check if the provided process is close enough @@ -579,17 +579,17 @@ (set! arg1 (get-trans arg0 0)) ) (when arg1 - (let* ((f0-0 (-> obj root trans y)) - (v1-4 (-> obj root)) + (let* ((f0-0 (-> this root trans y)) + (v1-4 (-> this root)) (f1-0 (-> v1-4 trans y)) - (a0-2 (-> obj fact)) + (a0-2 (-> this fact)) ) (when (and (< f0-0 (+ f1-0 (-> a0-2 notice-top))) (< (- f1-0 (-> a0-2 notice-bottom)) f0-0)) - (let* ((f30-0 (-> obj enemy-info notice-nav-radius)) + (let* ((f30-0 (-> this enemy-info notice-nav-radius)) (f0-1 f30-0) ) (or (>= (* f0-1 f0-1) (vector-vector-xz-distance-squared (-> v1-4 trans) arg1)) - (is-in-mesh? (-> obj nav) arg1 f30-0) + (is-in-mesh? (-> this nav) arg1 f30-0) ) ) ) @@ -600,9 +600,9 @@ ;; definition for method 107 of type centipede ;; WARN: Return type mismatch process vs process-focusable. -(defmethod get-enemy-target centipede ((obj centipede)) +(defmethod get-enemy-target centipede ((this centipede)) "@returns the [[process-focusable]] that the enemy is currently focusing on, or [[#f]] otherwise" - (let ((v0-0 (handle->process (-> obj focus handle)))) + (let ((v0-0 (handle->process (-> this focus handle)))) (if (and v0-0 (focus-test? (the-as process-focusable v0-0) disable dead grabbed)) (set! v0-0 (the-as process #f)) ) @@ -611,15 +611,15 @@ ) ;; definition for method 185 of type centipede -(defmethod target-close? centipede ((obj centipede)) +(defmethod target-close? centipede ((this centipede)) "Is the target close enough to attack?" - (let ((targ (get-enemy-target obj))) + (let ((targ (get-enemy-target this))) (when targ (let* ((targ-pos (get-trans targ 0)) - (y-off (- (-> targ-pos y) (-> obj root trans y))) + (y-off (- (-> targ-pos y) (-> this root trans y))) (dist 28672.0) ) - (and (>= (* dist dist) (vector-vector-xz-distance-squared (-> obj root trans) targ-pos)) + (and (>= (* dist dist) (vector-vector-xz-distance-squared (-> this root trans) targ-pos)) (or (>= y-off -12288.0) (or (>= 24576.0 y-off) (focus-test? targ edge-grab))) ) ) @@ -630,73 +630,73 @@ ;; definition for method 183 of type centipede ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod centipede-method-183 centipede ((obj centipede)) - (when (not (and (-> obj next-state) (= (-> obj next-state name) 'thru-grating))) - (centipede-method-187 obj) - (when (= (-> obj id) 2) +(defmethod centipede-method-183 centipede ((this centipede)) + (when (not (and (-> this next-state) (= (-> this next-state name) 'thru-grating))) + (centipede-method-187 this) + (when (= (-> this id) 2) (let ((overlap-parms (new 'stack-no-clear 'overlaps-others-params))) (set! (-> overlap-parms options) (overlaps-others-options)) (set! (-> overlap-parms collide-with-filter) (the-as collide-spec -1)) (set! (-> overlap-parms tlist) *touching-list*) - (find-overlapping-shapes (-> obj root) overlap-parms) + (find-overlapping-shapes (-> this root) overlap-parms) ) ) (let* ((travel-speed (-> *centipede-nav-enemy-info* run-travel-speed)) - (f0-2 (fmin 1.0 (/ (vector-length (-> obj root transv)) travel-speed))) + (f0-2 (fmin 1.0 (/ (vector-length (-> this root transv)) travel-speed))) ) - (seek! (-> obj bobbing-intensity) f0-2 (* 4.0 (seconds-per-frame))) + (seek! (-> this bobbing-intensity) f0-2 (* 4.0 (seconds-per-frame))) ) - (quaternion-copy! (-> obj bobbing quat) (-> obj root quat)) - (set! (-> obj bobbing trans quad) (-> obj root trans quad)) + (quaternion-copy! (-> this bobbing quat) (-> this root quat)) + (set! (-> this bobbing trans quad) (-> this root trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector)) (f30-1 (* 2662.4 (cos (* 283.70563 (the float (mod (current-time) 231)))))) - (bob-trans (-> obj bobbing trans)) + (bob-trans (-> this bobbing trans)) ) - (vector-z-quaternion! s5-0 (-> obj root quat)) + (vector-z-quaternion! s5-0 (-> this root quat)) (set! (-> s5-0 y) 0.0) - (vector-normalize! s5-0 (* f30-1 (-> obj bobbing-intensity))) + (vector-normalize! s5-0 (* f30-1 (-> this bobbing-intensity))) (vector+! (the-as vector (&-> bob-trans x)) (the-as vector (&-> bob-trans x)) s5-0) ) ) - (update-trans! (-> obj sound) (-> obj root trans)) - (when (!= (-> obj talking-volume) (-> obj desired-talking-volume)) - (seek! (-> obj talking-volume) (-> obj desired-talking-volume) (* 4.0 (seconds-per-frame))) - (update-vol! (-> obj sound) (-> obj talking-volume)) + (update-trans! (-> this sound) (-> this root trans)) + (when (!= (-> this talking-volume) (-> this desired-talking-volume)) + (seek! (-> this talking-volume) (-> this desired-talking-volume) (* 4.0 (seconds-per-frame))) + (update-vol! (-> this sound) (-> this talking-volume)) ) - (update! (-> obj sound)) - (update-trans! (-> obj legs-sound) (-> obj root trans)) - (let ((f0-20 (fmin 1.0 (* 0.00012207031 (vector-length (-> obj root transv)))))) - (when (!= (-> obj legs-volume) f0-20) - (seek! (-> obj legs-volume) f0-20 (* 4.0 (seconds-per-frame))) - (update-vol! (-> obj legs-sound) (-> obj legs-volume)) + (update! (-> this sound)) + (update-trans! (-> this legs-sound) (-> this root trans)) + (let ((f0-20 (fmin 1.0 (* 0.00012207031 (vector-length (-> this root transv)))))) + (when (!= (-> this legs-volume) f0-20) + (seek! (-> this legs-volume) f0-20 (* 4.0 (seconds-per-frame))) + (update-vol! (-> this legs-sound) (-> this legs-volume)) ) ) - (update! (-> obj legs-sound)) + (update! (-> this legs-sound)) (none) ) ;; definition for method 55 of type centipede ;; INFO: Used lq/sq -(defmethod track-target! centipede ((obj centipede)) +(defmethod track-target! centipede ((this centipede)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" (let ((t9-0 (method-of-type nav-enemy track-target!))) - (t9-0 obj) + (t9-0 this) ) - (let ((a0-3 (handle->process (-> obj focus handle)))) + (let ((a0-3 (handle->process (-> this focus handle)))) (when a0-3 (let ((f0-0 (-> (get-trans (the-as process-focusable a0-3) 1) y))) (if (!= f0-0 -40959590.0) - (set! (-> obj focus-gnd-height) f0-0) + (set! (-> this focus-gnd-height) f0-0) ) ) ) ) - (let ((s5-0 (-> obj root))) + (let ((s5-0 (-> this root))) (set! (-> s5-0 gspot-pos quad) (-> s5-0 trans quad)) - (let ((v1-12 (-> obj nav)) + (let ((v1-12 (-> this nav)) (a0-8 (-> s5-0 trans)) (a1-2 (new 'stack-no-clear 'nav-find-poly-parms)) ) @@ -707,7 +707,7 @@ (s4-0 (new 'stack-no-clear 'collide-query)) ) (when a1-3 - (let ((s2-0 (-> obj nav)) + (let ((s2-0 (-> this nav)) (s3-0 (-> s4-0 best-other-tri intersect)) ) (let ((a3-2 (-> s4-0 best-other-tri normal)) @@ -732,16 +732,16 @@ ) ) ) - (let ((f0-6 (-> obj root trans y))) + (let ((f0-6 (-> this root trans y))) (cond ((>= (-> s5-0 gspot-pos y) f0-6) (set! (-> s5-0 trans y) (-> s5-0 gspot-pos y)) ) - ((and (!= (-> obj focus-gnd-height) -40959590.0) - (>= (- (-> obj focus-gnd-height) (-> s5-0 gspot-pos y)) 4096.0) + ((and (!= (-> this focus-gnd-height) -40959590.0) + (>= (- (-> this focus-gnd-height) (-> s5-0 gspot-pos y)) 4096.0) ) (set! (-> s5-0 trans y) - (seek-with-smooth (-> s5-0 trans y) (-> obj focus-gnd-height) (* 24576.0 (seconds-per-frame)) 0.25 1.0) + (seek-with-smooth (-> s5-0 trans y) (-> this focus-gnd-height) (* 24576.0 (seconds-per-frame)) 0.25 1.0) ) ) (else @@ -752,31 +752,31 @@ ) ) ) - (centipede-method-183 obj) + (centipede-method-183 this) (none) ) ;; definition for method 116 of type centipede ;; WARN: Return type mismatch object vs none. -(defmethod go-idle centipede ((obj centipede)) - (case (-> obj id) +(defmethod go-idle centipede ((this centipede)) + (case (-> this id) ((1) (cond ((or (not *target*) (task-node-closed? (game-task-node under-sig-centipede1-end)) (and *debug-segment* (cpad-hold? 0 l2)) ) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) ((task-node-closed? (game-task-node under-sig-centipede1-start)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (go (method-of-object obj grab-cam)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (go (method-of-object this grab-cam)) ) (else - (go (method-of-object obj hidden)) + (go (method-of-object this hidden)) ) ) ) @@ -786,17 +786,17 @@ (task-node-closed? (game-task-node under-sig-resolution)) (and *debug-segment* (cpad-hold? 0 l2)) ) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) ((task-node-closed? (game-task-node under-sig-centipede2-start)) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (process-entity-status! obj (entity-perm-status no-kill) #t) - (go (method-of-object obj grab-cam)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (go (method-of-object this grab-cam)) ) (else - (go (method-of-object obj hidden)) + (go (method-of-object this hidden)) ) ) ) @@ -892,10 +892,10 @@ (until #f (cond (*target* - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) (else - (when (>= (- (current-time) (-> self state-time)) (seconds 2)) + (when (time-elapsed? (-> self state-time) (seconds 2)) (cleanup-for-death self) (go-virtual die-fast) ) @@ -983,7 +983,7 @@ ) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) (let ((v1-6 (handle->process (-> self focus handle)))) (if (or (not v1-6) (focus-test? (the-as process-focusable v1-6) dead)) (go-virtual stop-chase) @@ -1041,7 +1041,7 @@ ) ) :trans (behavior () - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (react-to-focus self) ) ) @@ -1055,25 +1055,25 @@ ;; definition for method 186 of type centipede ;; INFO: Used lq/sq ;; WARN: Return type mismatch quaternion vs none. -(defmethod centipede-method-186 centipede ((obj centipede)) - (let ((proc (handle->process (-> obj focus handle)))) +(defmethod centipede-method-186 centipede ((this centipede)) + (let ((proc (handle->process (-> this focus handle)))) (when proc - (set! (-> obj focus-pos quad) (-> (get-trans (the-as process-focusable proc) 0) quad)) - (when (and (not (-> obj grabbed-focus?)) (= (-> proc type) target) (>= (ja-frame-num 0) 5.0)) + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable proc) 0) quad)) + (when (and (not (-> this grabbed-focus?)) (= (-> proc type) target) (>= (ja-frame-num 0) 5.0)) (if (send-event proc 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'centipede)))) - (set! (-> obj grabbed-focus?) #t) + (set! (-> this grabbed-focus?) #t) ) ) - (when (not (-> obj grabbed-focus?)) + (when (not (-> this grabbed-focus?)) (let ((s5-1 (new 'stack-no-clear 'vector))) (let ((cam-dir (new 'stack-no-clear 'vector)) (trans-off (new 'stack-no-clear 'vector)) ) (let ((s2-0 (new 'stack-no-clear 'matrix))) - (set! (-> cam-dir quad) (-> obj cam dir quad)) + (set! (-> cam-dir quad) (-> this cam dir quad)) (set! (-> cam-dir y) 0.0) (vector-normalize! cam-dir 1.0) - (vector-! trans-off (-> obj focus-pos) (-> obj root trans)) + (vector-! trans-off (-> this focus-pos) (-> this root trans)) (set! (-> s5-1 quad) (-> trans-off quad)) (set! (-> s5-1 y) 0.0) (vector-normalize! s5-1 1.0) @@ -1089,13 +1089,13 @@ (set! (-> s5-1 y) (+ 49152.0 (-> trans-off y))) ) (vector-normalize! s5-1 1.0) - (quaternion-look-at! (-> obj dest-quat) s5-1 *up-vector*) + (quaternion-look-at! (-> this dest-quat) s5-1 *up-vector*) ) ) ) ) (let ((f0-12 (fmin 1.0 (* 0.16666667 (ja-frame-num 0))))) - (quaternion-slerp! (-> obj root quat) (-> obj src-quat) (-> obj dest-quat) f0-12) + (quaternion-slerp! (-> this root quat) (-> this src-quat) (-> this dest-quat) f0-12) ) (none) ) @@ -1183,9 +1183,9 @@ (set-chan1-effects self) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (set! (-> self desired-talking-volume) 1.0) - (while (< (- (current-time) (-> self state-time)) (seconds 0.35)) + (while (not (time-elapsed? (-> self state-time) (seconds 0.35))) (let* ((v1-5 (- (current-time) (-> self state-time))) (f1-2 (* 0.00952381 (the float v1-5))) ) @@ -1194,7 +1194,7 @@ (centipede-method-188 self) (suspend) ) - (while (< (- (current-time) (-> self state-time)) (seconds 1)) + (while (not (time-elapsed? (-> self state-time) (seconds 1))) (centipede-method-188 self) (suspend) ) @@ -1248,9 +1248,9 @@ ;; definition for method 114 of type centipede ;; WARN: Return type mismatch collide-shape-moving vs none. -(defmethod init-enemy-collision! centipede ((obj centipede)) +(defmethod init-enemy-collision! centipede ((this centipede)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1334,26 +1334,26 @@ (set! (-> s5-0 backup-collide-with) (-> v1-32 prim-core collide-with)) ) (set! (-> s5-0 event-other) 'centipede) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) (none) ) ;; definition for method 115 of type centipede ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! centipede ((obj centipede)) +(defmethod init-enemy! centipede ((this centipede)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (set! (-> obj id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) - (set! (-> obj cam init?) #t) - (set! (-> obj using-chan1-effects?) #f) - (set! (-> obj set-camera-mode?) #f) - (set! (-> obj focus-gnd-height) -40959590.0) - (set! (-> obj bobbing-intensity) 1.0) - (set-vector! (-> obj root scale) 0.75 0.75 0.75 1.0) - (+! (-> obj root trans y) 4096.0) - (case (-> obj id) + (set! (-> this id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) + (set! (-> this cam init?) #t) + (set! (-> this using-chan1-effects?) #f) + (set! (-> this set-camera-mode?) #f) + (set! (-> this focus-gnd-height) -40959590.0) + (set! (-> this bobbing-intensity) 1.0) + (set-vector! (-> this root scale) 0.75 0.75 0.75 1.0) + (+! (-> this root trans y) 4096.0) + (case (-> this id) ((1) - (let ((v1-10 (-> obj root))) + (let ((v1-10 (-> this root))) (set-vector! (-> v1-10 quat) -0.2103 -0.2293 -0.0508 0.949) (set! (-> v1-10 trans x) -248325.33) (set! (-> v1-10 trans z) 8201697.0) @@ -1361,7 +1361,7 @@ (set! (-> *centipede-nav-enemy-info* run-travel-speed) 32768.0) ) ((2) - (let ((v1-16 (-> obj root))) + (let ((v1-16 (-> this root))) (set-vector! (-> v1-16 quat) -0.1832 0.519 0.115 0.827) (set! (-> v1-16 trans x) -1001253.25) (set! (-> v1-16 trans z) 7913366.5) @@ -1370,37 +1370,37 @@ ) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-centipede" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj skel generate-frame-function) create-interpolated2-joint-animation-frame) - (init-enemy-behaviour-and-stats! obj *centipede-nav-enemy-info*) - (logclear! (-> obj mask) (process-mask enemy)) - (logior! (-> obj mask) (process-mask bot)) - (let ((v1-31 (-> obj nav))) + (set! (-> this skel generate-frame-function) create-interpolated2-joint-animation-frame) + (init-enemy-behaviour-and-stats! this *centipede-nav-enemy-info*) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask bot)) + (let ((v1-31 (-> this nav))) (set! (-> v1-31 sphere-mask) (the-as uint 64)) ) 0 - (logclear! (-> obj root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) - (let ((v1-35 (-> obj nav))) + (logclear! (-> this root nav-flags) (nav-flags has-root-sphere has-extra-sphere)) + (let ((v1-35 (-> this nav))) (set! (-> v1-35 speed-scale) 1.0) ) 0 - (set-gravity-length (-> obj root dynam) 573440.0) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-active checking-water)) - (set! (-> obj bobbing) (the-as trsqv (new 'process 'joint-mod-set-world obj 3 #t))) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "cent-talk" :fo-max 90) (-> obj root trans)) + (set-gravity-length (-> this root dynam) 573440.0) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-active checking-water)) + (set! (-> this bobbing) (the-as trsqv (new 'process 'joint-mod-set-world this 3 #t))) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "cent-talk" :fo-max 90) (-> this root trans)) ) - (update-vol! (-> obj sound) 0.0) - (set! (-> obj talking-volume) 0.0) - (set! (-> obj desired-talking-volume) 0.0) - (set! (-> obj legs-sound) - (new 'process 'ambient-sound (static-sound-spec "cent-legs-loop" :fo-max 90) (-> obj root trans)) + (update-vol! (-> this sound) 0.0) + (set! (-> this talking-volume) 0.0) + (set! (-> this desired-talking-volume) 0.0) + (set! (-> this legs-sound) + (new 'process 'ambient-sound (static-sound-spec "cent-legs-loop" :fo-max 90) (-> this root trans)) ) - (update-vol! (-> obj sound) 0.0) - (set! (-> obj legs-volume) 0.0) + (update-vol! (-> this sound) 0.0) + (set! (-> this legs-volume) 0.0) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc b/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc index 66535f76fa..3475f1fc0f 100644 --- a/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/jellyfish_REF.gc @@ -11,21 +11,21 @@ ) ;; definition for method 3 of type jellyfish-formation -(defmethod inspect jellyfish-formation ((obj jellyfish-formation)) - (when (not obj) - (set! obj obj) +(defmethod inspect jellyfish-formation ((this jellyfish-formation)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hover-formation inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for method 15 of type jellyfish-formation -(defmethod hover-formation-method-15 jellyfish-formation ((obj jellyfish-formation) (arg0 vector) (arg1 vector)) - (logior! (-> obj formation flags) 2) +(defmethod hover-formation-method-15 jellyfish-formation ((this jellyfish-formation) (arg0 vector) (arg1 vector)) + (logior! (-> this formation flags) 2) 0 ) @@ -38,50 +38,50 @@ ) ;; definition for method 3 of type jellyfish-chain-physics -(defmethod inspect jellyfish-chain-physics ((obj jellyfish-chain-physics)) - (when (not obj) - (set! obj obj) +(defmethod inspect jellyfish-chain-physics ((this jellyfish-chain-physics)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tchain-joints[20] @ #x~X~%" (-> obj chain-joints)) - (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~1Troot-joint-index: ~D~%" (-> obj root-joint-index)) - (format #t "~1Tjoint-length: ~f~%" (-> obj joint-length)) - (format #t "~1Tgravity: #~%" (-> obj gravity)) - (format #t "~1Tgravity-target: #~%" (-> obj gravity-target)) - (format #t "~1Tstretch-vel: ~f~%" (-> obj stretch-vel)) - (format #t "~1Tstretch-vel-parallel: ~f~%" (-> obj stretch-vel-parallel)) - (format #t "~1Tcompress-vel: ~f~%" (-> obj compress-vel)) - (format #t "~1Tcompress-vel-parallel: ~f~%" (-> obj compress-vel-parallel)) - (format #t "~1Tnegate-y: ~A~%" (-> obj negate-y)) - (format #t "~1Taxial-slop: ~f~%" (-> obj axial-slop)) - (format #t "~1Tmaximum-stretch: ~f~%" (-> obj maximum-stretch)) - (format #t "~1Tturn-off-start: ~D~%" (-> obj turn-off-start)) - (format #t "~1Tturn-off-duration: ~D~%" (-> obj turn-off-duration)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tchain-joints[20] @ #x~X~%" (-> this chain-joints)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Troot-joint-index: ~D~%" (-> this root-joint-index)) + (format #t "~1Tjoint-length: ~f~%" (-> this joint-length)) + (format #t "~1Tgravity: #~%" (-> this gravity)) + (format #t "~1Tgravity-target: #~%" (-> this gravity-target)) + (format #t "~1Tstretch-vel: ~f~%" (-> this stretch-vel)) + (format #t "~1Tstretch-vel-parallel: ~f~%" (-> this stretch-vel-parallel)) + (format #t "~1Tcompress-vel: ~f~%" (-> this compress-vel)) + (format #t "~1Tcompress-vel-parallel: ~f~%" (-> this compress-vel-parallel)) + (format #t "~1Tnegate-y: ~A~%" (-> this negate-y)) + (format #t "~1Taxial-slop: ~f~%" (-> this axial-slop)) + (format #t "~1Tmaximum-stretch: ~f~%" (-> this maximum-stretch)) + (format #t "~1Tturn-off-start: ~D~%" (-> this turn-off-start)) + (format #t "~1Tturn-off-duration: ~D~%" (-> this turn-off-duration)) (label cfg-4) - obj + this ) ;; definition for method 13 of type jellyfish-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod apply-gravity jellyfish-chain-physics ((obj jellyfish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (vector-float*! arg0 - (-> obj gravity) + (-> this gravity) (* 4096.0 (-> self clock time-adjust-ratio) (lerp-scale 0.01 0.1 (the float arg1) 0.0 5.0)) ) - (vector+float*! arg0 arg0 (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* arg1 64))) 0.2) + (vector+float*! arg0 arg0 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* arg1 64))) 0.2) 0 (none) ) ;; definition for method 14 of type jellyfish-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-14 jellyfish-chain-physics ((obj jellyfish-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) (vector-float*! arg0 - (the-as vector (+ (the-as uint (-> obj chain-joints 0 velocity)) (* (+ arg1 1) 64))) + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64))) (lerp-scale 0.1 0.9 (the float arg1) 0.0 5.0) ) 0 @@ -89,7 +89,7 @@ ) ;; definition for method 16 of type jellyfish-chain-physics -(defmethod chain-physics-method-16 jellyfish-chain-physics ((obj jellyfish-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 int)) (if (zero? arg0) 0.0 5461.3335 @@ -99,8 +99,8 @@ ;; definition for method 12 of type jellyfish-chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod gravity-update jellyfish-chain-physics ((obj jellyfish-chain-physics) (arg0 process-drawable)) - ((method-of-type chain-physics gravity-update) obj arg0) +(defmethod gravity-update jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 process-drawable)) + ((method-of-type chain-physics gravity-update) this arg0) (let ((gp-0 (new 'stack-no-clear 'collide-query))) (let ((s5-0 (new 'stack-no-clear 'bounding-box))) (let ((s4-0 (new 'stack-no-clear 'sphere))) @@ -130,7 +130,7 @@ ;; definition for method 17 of type jellyfish-chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-17 jellyfish-chain-physics ((obj jellyfish-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-17 jellyfish-chain-physics ((this jellyfish-chain-physics) (arg0 vector) (arg1 int)) (local-vars (v1-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -139,7 +139,7 @@ ) (init-vf0-vector) (let* ((s5-0 (new 'stack-no-clear 'collide-query)) - (v1-2 (-> obj chain-joints arg1)) + (v1-2 (-> this chain-joints arg1)) (s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> v1-2 position))) (s3-0 0) ) @@ -239,38 +239,38 @@ ) ;; definition for method 3 of type jellyfish -(defmethod inspect jellyfish ((obj jellyfish)) - (when (not obj) - (set! obj obj) +(defmethod inspect jellyfish ((this jellyfish)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type hover-enemy inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tlos: #~%" (-> obj los)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) - (format #t "~2Tpath-player-u: ~f~%" (-> obj path-player-u)) - (format #t "~2Tpath-my-u: ~f~%" (-> obj path-my-u)) - (format #t "~2Tpath-y-offset: ~f~%" (-> obj path-y-offset)) - (format #t "~2Tpath-stare-u: ~f~%" (-> obj path-stare-u)) - (format #t "~2Ttentacle-clock: ~f~%" (-> obj tentacle-clock)) - (format #t "~2Ttentacle-blend: ~f~%" (-> obj tentacle-blend)) - (format #t "~2Tlast-attack-time: ~D~%" (-> obj last-attack-time)) - (format #t "~2Tlast-fire-time: ~D~%" (-> obj last-fire-time)) - (format #t "~2Tcharge-path-timer: ~D~%" (-> obj charge-path-timer)) - (format #t "~2Ttentacles[5] @ #x~X~%" (-> obj tentacles)) - (format #t "~2Ttentacles-initialized: ~A~%" (-> obj tentacles-initialized)) - (format #t "~2Tstare-pos: #~%" (-> obj stare-pos)) - (format #t "~2Tcharge-pos: #~%" (-> obj charge-pos)) - (format #t "~2Tgrab-front: ~A~%" (-> obj grab-front)) - (format #t "~2Tgrab-offset: #~%" (-> obj grab-offset)) - (format #t "~2Tgrab-start-pos: #~%" (-> obj grab-start-pos)) - (format #t "~2Tgrab-start-quat: #~%" (-> obj grab-start-quat)) - (format #t "~2Tfocus-rot: #~%" (-> obj focus-rot)) - (format #t "~2Tattach-lerp: ~f~%" (-> obj attach-lerp)) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tpath-player-u: ~f~%" (-> this path-player-u)) + (format #t "~2Tpath-my-u: ~f~%" (-> this path-my-u)) + (format #t "~2Tpath-y-offset: ~f~%" (-> this path-y-offset)) + (format #t "~2Tpath-stare-u: ~f~%" (-> this path-stare-u)) + (format #t "~2Ttentacle-clock: ~f~%" (-> this tentacle-clock)) + (format #t "~2Ttentacle-blend: ~f~%" (-> this tentacle-blend)) + (format #t "~2Tlast-attack-time: ~D~%" (-> this last-attack-time)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Tcharge-path-timer: ~D~%" (-> this charge-path-timer)) + (format #t "~2Ttentacles[5] @ #x~X~%" (-> this tentacles)) + (format #t "~2Ttentacles-initialized: ~A~%" (-> this tentacles-initialized)) + (format #t "~2Tstare-pos: #~%" (-> this stare-pos)) + (format #t "~2Tcharge-pos: #~%" (-> this charge-pos)) + (format #t "~2Tgrab-front: ~A~%" (-> this grab-front)) + (format #t "~2Tgrab-offset: #~%" (-> this grab-offset)) + (format #t "~2Tgrab-start-pos: #~%" (-> this grab-start-pos)) + (format #t "~2Tgrab-start-quat: #~%" (-> this grab-start-quat)) + (format #t "~2Tfocus-rot: #~%" (-> this focus-rot)) + (format #t "~2Tattach-lerp: ~f~%" (-> this attach-lerp)) (label cfg-4) - obj + this ) ;; definition for symbol *jellyfish-mech-reserved*, type symbol @@ -289,18 +289,18 @@ ) ;; definition for method 3 of type jellyfish-joint-mod-tentacle-info -(defmethod inspect jellyfish-joint-mod-tentacle-info ((obj jellyfish-joint-mod-tentacle-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect jellyfish-joint-mod-tentacle-info ((this jellyfish-joint-mod-tentacle-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj 'jellyfish-joint-mod-tentacle-info) - (format #t "~1Taxis: #~%" (-> obj axis)) - (format #t "~1Tangle: ~f~%" (-> obj angle)) - (format #t "~1Tperiod: ~f~%" (-> obj period)) - (format #t "~1Toffset: ~f~%" (-> obj offset)) + (format #t "[~8x] ~A~%" this 'jellyfish-joint-mod-tentacle-info) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tangle: ~f~%" (-> this angle)) + (format #t "~1Tperiod: ~f~%" (-> this period)) + (format #t "~1Toffset: ~f~%" (-> this offset)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -440,7 +440,7 @@ (set! (-> *jellyfish-enemy-info* fact-defaults) *fact-info-enemy-defaults*) ;; definition for method 151 of type jellyfish -(defmethod hover-enemy-method-151 jellyfish ((obj jellyfish)) +(defmethod hover-enemy-method-151 jellyfish ((this jellyfish)) (new 'static 'hover-enemy-info :fly-forward-anim 2 :fly-backward-anim 2 @@ -455,7 +455,7 @@ ) ;; definition for method 152 of type jellyfish -(defmethod hover-enemy-method-152 jellyfish ((obj jellyfish)) +(defmethod hover-enemy-method-152 jellyfish ((this jellyfish)) (new 'static 'hover-nav-params :max-speed 32768.0 :max-acceleration 24576.0 :friction 0.8) ) @@ -538,7 +538,7 @@ :trans (behavior () (local-vars (gp-0 vector)) (seek! (-> self tentacle-blend) 1.0 (seconds-per-frame)) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((v1-4 (-> self focus aware))) (cond ((>= 1 (the-as int v1-4)) @@ -549,13 +549,13 @@ ) ) ) - (if (and (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (and (time-elapsed? (-> self state-time) (seconds 2)) (not (jellyfish-method-164 self (the-as process-focusable #f))) ) (go-virtual active) ) (if (and (not *jellyfish-mech-reserved*) - (>= (- (current-time) (-> self state-time)) (seconds 1)) + (time-elapsed? (-> self state-time) (seconds 1)) (jellyfish-method-163 self (the-as process-focusable #f)) (begin (set! gp-0 (jellyfish-method-161 self (new 'stack-no-clear 'vector) (-> self path-stare-u))) @@ -634,7 +634,7 @@ (the-as vector #t) ) (logior! (-> self focus-status) (focus-status dangerous)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :exit (behavior () (hover-nav-control-method-14 (-> self hover) 1.0 1.0) @@ -735,7 +735,7 @@ (let ((gp-0 *target*)) (cond ((not (jellyfish-method-163 self gp-0)) - (set! (-> self last-attack-time) (current-time)) + (set-time! (-> self last-attack-time)) (go-virtual active) ) (else @@ -817,7 +817,7 @@ (suspend) (ja :num! (seek!)) ) - (set! (-> self last-attack-time) (current-time)) + (set-time! (-> self last-attack-time)) (go-virtual active) ) :post (behavior () @@ -852,7 +852,7 @@ (f0-4 (ja-aframe-num 0)) ) (when (and (= s5-0 jellyfish-die-ja) (>= f0-4 0.0) (>= 0.5 f0-4)) - (when (>= (- (current-time) gp-0) (seconds 0.05)) + (when (time-elapsed? gp-0 (seconds 0.05)) (process-drawable-shock-skel-effect self (-> *lightning-spec-id-table* 5) @@ -911,59 +911,59 @@ ) ;; definition for method 74 of type jellyfish -(defmethod general-event-handler jellyfish ((obj jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler jellyfish ((this jellyfish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (case arg2 (('hit 'hit-knocked) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj focus-status) (focus-status dangerous)) - (logclear! (-> obj enemy-flags) (enemy-flag enable-on-notice)) - (logior! (-> obj enemy-flags) (enemy-flag chase-startup)) - (logior! (-> obj focus-status) (focus-status hit)) - (if (zero? (-> obj hit-points)) - (logior! (-> obj focus-status) (focus-status dead)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag enable-on-notice)) + (logior! (-> this enemy-flags) (enemy-flag chase-startup)) + (logior! (-> this focus-status) (focus-status hit)) + (if (zero? (-> this hit-points)) + (logior! (-> this focus-status) (focus-status dead)) ) - (logclear! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) - (enemy-method-62 obj) - (logior! (-> obj enemy-flags) (enemy-flag actor-pause-backup)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (enemy-method-62 this) + (logior! (-> this enemy-flags) (enemy-flag actor-pause-backup)) (process-contact-action arg0) (send-event arg0 'get-attack-count 1) - (go (method-of-object obj die)) + (go (method-of-object this die)) #t ) (else - ((method-of-type hover-enemy general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type hover-enemy general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) ;; definition for method 161 of type jellyfish -(defmethod jellyfish-method-161 jellyfish ((obj jellyfish) (arg0 vector) (arg1 float)) - (get-point-in-path! (-> obj path) arg0 arg1 'interp) - (+! (-> arg0 y) (-> obj path-y-offset)) +(defmethod jellyfish-method-161 jellyfish ((this jellyfish) (arg0 vector) (arg1 float)) + (get-point-in-path! (-> this path) arg0 arg1 'interp) + (+! (-> arg0 y) (-> this path-y-offset)) arg0 ) ;; definition for method 164 of type jellyfish ;; WARN: Return type mismatch object vs symbol. -(defmethod jellyfish-method-164 jellyfish ((obj jellyfish) (arg0 process-focusable)) +(defmethod jellyfish-method-164 jellyfish ((this jellyfish) (arg0 process-focusable)) (local-vars (v1-10 object)) - (jellyfish-method-161 obj (new 'stack-no-clear 'vector) (get-norm! (-> obj sync) 0)) - (let ((s5-1 (jellyfish-method-161 obj (new 'stack-no-clear 'vector) (-> obj path-player-u))) - (gp-1 (-> obj focus-pos)) + (jellyfish-method-161 this (new 'stack-no-clear 'vector) (get-norm! (-> this sync) 0)) + (let ((s5-1 (jellyfish-method-161 this (new 'stack-no-clear 'vector) (-> this path-player-u))) + (gp-1 (-> this focus-pos)) ) - (-> obj root trans) + (-> this root trans) (the-as symbol (and (and (if arg0 arg0 - (handle->process (-> obj focus handle)) + (handle->process (-> this focus handle)) ) (focus-test? (the-as process-focusable (if arg0 arg0 - (handle->process (-> obj focus handle)) + (handle->process (-> this focus handle)) ) ) mech @@ -976,7 +976,7 @@ arg0 ) (else - (the-as process-focusable (handle->process (-> obj focus handle))) + (the-as process-focusable (handle->process (-> this focus handle))) ) ) ) @@ -996,21 +996,21 @@ ;; definition for method 163 of type jellyfish ;; WARN: Return type mismatch object vs symbol. -(defmethod jellyfish-method-163 jellyfish ((obj jellyfish) (arg0 process-focusable)) +(defmethod jellyfish-method-163 jellyfish ((this jellyfish) (arg0 process-focusable)) (local-vars (v1-8 object)) - (jellyfish-method-161 obj (new 'stack-no-clear 'vector) (-> obj path-stare-u)) - (let ((s5-0 (-> obj focus-pos))) - (-> obj root trans) + (jellyfish-method-161 this (new 'stack-no-clear 'vector) (-> this path-stare-u)) + (let ((s5-0 (-> this focus-pos))) + (-> this root trans) (the-as symbol (and (and (if arg0 arg0 - (handle->process (-> obj focus handle)) + (handle->process (-> this focus handle)) ) (focus-test? (the-as process-focusable (if arg0 arg0 - (handle->process (-> obj focus handle)) + (handle->process (-> this focus handle)) ) ) mech @@ -1023,7 +1023,7 @@ arg0 ) (else - (the-as process-focusable (handle->process (-> obj focus handle))) + (the-as process-focusable (handle->process (-> this focus handle))) ) ) ) @@ -1034,8 +1034,8 @@ v1-8 ) ) - (< (vector-vector-xz-distance s5-0 (-> obj stare-pos)) 81920.0) - (< (fabs (- (-> s5-0 y) (-> obj stare-pos y))) 32768.0) + (< (vector-vector-xz-distance s5-0 (-> this stare-pos)) 81920.0) + (< (fabs (- (-> s5-0 y) (-> this stare-pos y))) 32768.0) ) ) ) @@ -1043,7 +1043,7 @@ ;; definition for method 162 of type jellyfish ;; INFO: Used lq/sq -(defmethod jellyfish-method-162 jellyfish ((obj jellyfish)) +(defmethod jellyfish-method-162 jellyfish ((this jellyfish)) (local-vars (sv-624 int)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1053,14 +1053,14 @@ (vf4 :class vf) ) (init-vf0-vector) - (let* ((s5-0 (-> obj root trans)) - (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> obj focus-pos) s5-0)) + (let* ((s5-0 (-> this root trans)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> this focus-pos) s5-0)) (s4-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-1 1.0)) (f0-0 (vector-length s3-1)) (f28-0 (+ 16384.0 f0-0)) ) (vector-normalize! s3-1 f28-0) - (vector+! (-> obj charge-pos) s5-0 s3-1) + (vector+! (-> this charge-pos) s5-0 s3-1) (let ((f30-0 f28-0) (f28-1 (* 0.000024414063 f28-0)) (s3-2 0) @@ -1089,11 +1089,13 @@ (set! (-> s0-0 start-pos quad) (-> s1-0 quad)) (vector-! (-> s0-0 move-dist) s2-0 s1-0) (let ((v1-14 s0-0)) - (set! (-> v1-14 radius) (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 0 local-sphere w)) + (set! (-> v1-14 radius) + (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0 local-sphere w) + ) (set! (-> v1-14 collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) - (set! (-> v1-14 ignore-process0) obj) + (set! (-> v1-14 ignore-process0) this) (set! (-> v1-14 ignore-process1) #f) - (set! (-> v1-14 ignore-pat) (-> obj root pat-ignore-mask)) + (set! (-> v1-14 ignore-pat) (-> this root pat-ignore-mask)) (set! (-> v1-14 action-mask) (collide-action solid)) ) (if (>= (fill-and-probe-using-line-sphere *collide-cache* s0-0) 0.0) @@ -1145,58 +1147,59 @@ ;; definition for method 55 of type jellyfish ;; INFO: Used lq/sq -(defmethod track-target! jellyfish ((obj jellyfish)) +(defmethod track-target! jellyfish ((this jellyfish)) "Does a lot of various things relating to interacting with the target - tracks when the enemy was last drawn - looks at the target and handles attacking @TODO Not extremely well understood yet" - (let ((v1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> obj main-joint-acc) (-> obj root quat)))) - (+! (-> obj tentacle-clock) + (let ((v1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) (-> this main-joint-acc) (-> this root quat))) + ) + (+! (-> this tentacle-clock) (* (lerp-scale 1.0 10.0 (fmax (fmax (fmax 0.0 (fabs (-> v1-1 x))) (-> v1-1 y)) (fabs (-> v1-1 z))) 0.0 24576.0) (seconds-per-frame) ) ) ) - (when (not (-> obj tentacles-initialized)) - (set! (-> obj tentacles-initialized) #t) + (when (not (-> this tentacles-initialized)) + (set! (-> this tentacles-initialized) #t) (dotimes (s5-0 5) - (initialize-chain-joints (-> obj tentacles s5-0)) + (initialize-chain-joints (-> this tentacles s5-0)) ) ) (dotimes (s5-1 5) - (update (-> obj tentacles s5-1) obj) + (update (-> this tentacles s5-1) this) ) - (let ((a1-3 (handle->process (-> obj focus handle)))) + (let ((a1-3 (handle->process (-> this focus handle)))) (if a1-3 - (los-control-method-9 (-> obj los) (the-as process-focusable a1-3) (the-as vector #f) 4096.0) + (los-control-method-9 (-> this los) (the-as process-focusable a1-3) (the-as vector #f) 4096.0) ) ) - (let ((a0-10 (handle->process (-> obj focus handle)))) + (let ((a0-10 (handle->process (-> this focus handle)))) (when (and a0-10 (focus-test? (the-as process-focusable a0-10) mech) (not (logtest? (-> (the-as process-focusable a0-10) focus-status) (focus-status dead ignore))) ) - (set! (-> obj focus-pos quad) (-> (get-trans (the-as process-focusable a0-10) 0) quad)) - (set! (-> obj path-player-u) (get-furthest-point-on-path (-> obj path) (-> obj focus-pos))) + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-10) 0) quad)) + (set! (-> this path-player-u) (get-furthest-point-on-path (-> this path) (-> this focus-pos))) ) ) - (set! (-> obj path-my-u) (get-furthest-point-on-path (-> obj path) (-> obj root trans))) - ((method-of-type hover-enemy track-target!) obj) + (set! (-> this path-my-u) (get-furthest-point-on-path (-> this path) (-> this root trans))) + ((method-of-type hover-enemy track-target!) this) (none) ) ;; definition for method 116 of type jellyfish ;; WARN: Return type mismatch object vs none. -(defmethod go-idle jellyfish ((obj jellyfish)) - (go (method-of-object obj active)) +(defmethod go-idle jellyfish ((this jellyfish)) + (go (method-of-object this active)) (none) ) ;; definition for method 149 of type jellyfish ;; WARN: Return type mismatch int vs none. -(defmethod hover-enemy-method-149 jellyfish ((obj jellyfish)) +(defmethod hover-enemy-method-149 jellyfish ((this jellyfish)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-jellyfish" (the-as (pointer uint32) #f))) (the-as pair 0) ) @@ -1205,15 +1208,15 @@ ) ;; definition for method 150 of type jellyfish -(defmethod hover-enemy-method-150 jellyfish ((obj jellyfish)) +(defmethod hover-enemy-method-150 jellyfish ((this jellyfish)) *jellyfish-enemy-info* ) ;; definition for method 114 of type jellyfish ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy-collision! jellyfish ((obj jellyfish)) +(defmethod init-enemy-collision! jellyfish ((this jellyfish)) "Initializes the [[collide-shape-moving]] and any ancillary tasks to make the enemy collide properly" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1276,7 +1279,7 @@ (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) ) (set! (-> s5-0 max-iteration-count) (the-as uint 3)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1284,32 +1287,32 @@ ;; definition for method 7 of type jellyfish ;; WARN: Return type mismatch hover-enemy vs jellyfish. -(defmethod relocate jellyfish ((obj jellyfish) (arg0 int)) +(defmethod relocate jellyfish ((this jellyfish) (arg0 int)) (dotimes (v1-0 5) - (if (nonzero? (-> obj tentacles v1-0)) - (&+! (-> obj tentacles v1-0) arg0) + (if (nonzero? (-> this tentacles v1-0)) + (&+! (-> this tentacles v1-0) arg0) ) ) - (the-as jellyfish ((method-of-type hover-enemy relocate) obj arg0)) + (the-as jellyfish ((method-of-type hover-enemy relocate) this arg0)) ) ;; definition for method 10 of type jellyfish -(defmethod deactivate jellyfish ((obj jellyfish)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method jellyfish 10)) obj) +(defmethod deactivate jellyfish ((this jellyfish)) + (sound-stop (-> this sound-id)) + ((the-as (function process-drawable none) (find-parent-method jellyfish 10)) this) (none) ) ;; definition for method 115 of type jellyfish ;; WARN: Return type mismatch int vs none. -(defmethod init-enemy! jellyfish ((obj jellyfish)) +(defmethod init-enemy! jellyfish ((this jellyfish)) "Common method called to initialize the enemy, typically sets up default field values and calls ancillary helper methods" - (hover-enemy-method-149 obj) - (init-enemy-behaviour-and-stats! obj (hover-enemy-method-150 obj)) - (hover-enemy-method-155 obj) - (set-vector! (-> obj offset) 0.0 6144.0 61440.0 1.0) - (set! (-> obj knocked-fall-dist) 0.0) - (let ((v1-8 (-> obj neck))) + (hover-enemy-method-149 this) + (init-enemy-behaviour-and-stats! this (hover-enemy-method-150 this)) + (hover-enemy-method-155 this) + (set-vector! (-> this offset) 0.0 6144.0 61440.0 1.0) + (set! (-> this knocked-fall-dist) 0.0) + (let ((v1-8 (-> this neck))) (set! (-> v1-8 up) (the-as uint 1)) (set! (-> v1-8 nose) (the-as uint 2)) (set! (-> v1-8 ear) (the-as uint 0)) @@ -1317,20 +1320,20 @@ (set! (-> v1-8 twist-speed-y) 0.06) (set! (-> v1-8 max-dist) 122880.0) ) - (set! (-> obj root dynam gravity y) 40960.0) - (set! (-> obj root dynam gravity-length) 40960.0) - (set! (-> obj root dynam gravity-max) 40960.0) - (logclear! (-> obj mask) (process-mask actor-pause)) - (logclear! (-> obj enemy-flags) (enemy-flag notice)) - (new-source! (-> obj los) obj (seconds 1) (collide-spec backgnd enemy obstacle hit-by-others-list)) - (set! (-> obj last-fire-time) (current-time)) - (set! (-> obj last-attack-time) 0) - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj path) (new 'process 'path-control obj 'path 0.0 (-> obj entity) #f)) - (set! (-> obj path-player-u) 0.0) - (set! (-> obj path-my-u) 0.0) - (logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text)) - (set! (-> obj path-y-offset) (res-lump-float (-> obj entity) 'y-offset)) + (set! (-> this root dynam gravity y) 40960.0) + (set! (-> this root dynam gravity-length) 40960.0) + (set! (-> this root dynam gravity-max) 40960.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag notice)) + (new-source! (-> this los) this (seconds 1) (collide-spec backgnd enemy obstacle hit-by-others-list)) + (set-time! (-> this last-fire-time)) + (set! (-> this last-attack-time) 0) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (-> this entity) #f)) + (set! (-> this path-player-u) 0.0) + (set! (-> this path-my-u) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this path-y-offset) (res-lump-float (-> this entity) 'y-offset)) (let ((a1-4 (new 'stack-no-clear 'sync-info-params))) (let ((v1-32 0)) (if #t @@ -1340,51 +1343,51 @@ (set! (-> a1-4 sync-flags) (the-as sync-flags v1-32)) ) (set! (-> a1-4 period) (the-as uint 6000)) - (set! (-> a1-4 entity) (-> obj entity)) + (set! (-> a1-4 entity) (-> this entity)) (set! (-> a1-4 percent) 0.0) (set! (-> a1-4 ease-in) 0.15) (set! (-> a1-4 ease-out) 0.15) (set! (-> a1-4 pause-in) 0.0) (set! (-> a1-4 pause-out) 0.0) - (initialize! (-> obj sync) a1-4) + (initialize! (-> this sync) a1-4) ) (add-connection *part-engine* - obj + this 36 - obj + this 318 (new 'static 'vector :x 1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) (add-connection *part-engine* - obj + this 36 - obj + this 318 (new 'static 'vector :x -1187.84 :y -3112.96 :z 1392.64 :w 163840.0) ) - (add-connection *part-engine* obj 36 obj 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) + (add-connection *part-engine* this 36 this 743 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) (dotimes (s5-1 5) - (set! (-> obj tentacles s5-1) (new 'process 'jellyfish-chain-physics)) + (set! (-> this tentacles s5-1) (new 'process 'jellyfish-chain-physics)) ) - (chain-physics-initialize obj (-> obj tentacles 0) 10 4096.0 *jellyfish-mainvein-chain-setup*) - (chain-physics-initialize obj (-> obj tentacles 1) 16 4096.0 *jellyfish-lfront-chain-setup*) - (chain-physics-initialize obj (-> obj tentacles 2) 21 4096.0 *jellyfish-rfront-chain-setup*) - (chain-physics-initialize obj (-> obj tentacles 3) 26 4096.0 *jellyfish-lrear-chain-setup*) - (chain-physics-initialize obj (-> obj tentacles 4) 31 4096.0 *jellyfish-rrear-chain-setup*) - (set! (-> obj tentacles 2 negate-y) #t) - (set! (-> obj tentacles 4 negate-y) #t) - (let ((a0-35 (-> obj skel root-channel 0))) - (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (chain-physics-initialize this (-> this tentacles 0) 10 4096.0 *jellyfish-mainvein-chain-setup*) + (chain-physics-initialize this (-> this tentacles 1) 16 4096.0 *jellyfish-lfront-chain-setup*) + (chain-physics-initialize this (-> this tentacles 2) 21 4096.0 *jellyfish-rfront-chain-setup*) + (chain-physics-initialize this (-> this tentacles 3) 26 4096.0 *jellyfish-lrear-chain-setup*) + (chain-physics-initialize this (-> this tentacles 4) 31 4096.0 *jellyfish-rrear-chain-setup*) + (set! (-> this tentacles 2 negate-y) #t) + (set! (-> this tentacles 4 negate-y) #t) + (let ((a0-35 (-> this skel root-channel 0))) + (set! (-> a0-35 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-35 frame-num) 0.0) - (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-35 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (ja-post) (dotimes (s5-2 5) - (initialize-chain-joints (-> obj tentacles s5-2)) + (initialize-chain-joints (-> this tentacles s5-2)) ) - (let ((a1-15 (-> obj node-list data 16)) + (let ((a1-15 (-> this node-list data 16)) (v1-68 (new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :z 1.0 :w 1.0) @@ -1394,10 +1397,10 @@ ) ) (set! (-> a1-15 param0) jellyfish-joint-mod-tentacle) - (set! (-> a1-15 param1) obj) + (set! (-> a1-15 param1) this) (set! (-> a1-15 param2) (the-as basic v1-68)) ) - (let ((a1-16 (-> obj node-list data 21)) + (let ((a1-16 (-> this node-list data 21)) (v1-70 (new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :z 1.0 :w 1.0) @@ -1407,10 +1410,10 @@ ) ) (set! (-> a1-16 param0) jellyfish-joint-mod-tentacle) - (set! (-> a1-16 param1) obj) + (set! (-> a1-16 param1) this) (set! (-> a1-16 param2) (the-as basic v1-70)) ) - (let ((a1-17 (-> obj node-list data 26)) + (let ((a1-17 (-> this node-list data 26)) (v1-72 (new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :z 1.0 :w 1.0) @@ -1420,10 +1423,10 @@ ) ) (set! (-> a1-17 param0) jellyfish-joint-mod-tentacle) - (set! (-> a1-17 param1) obj) + (set! (-> a1-17 param1) this) (set! (-> a1-17 param2) (the-as basic v1-72)) ) - (let ((a1-18 (-> obj node-list data 31)) + (let ((a1-18 (-> this node-list data 31)) (v1-74 (new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :z 1.0 :w 1.0) @@ -1433,34 +1436,34 @@ ) ) (set! (-> a1-18 param0) jellyfish-joint-mod-tentacle) - (set! (-> a1-18 param1) obj) + (set! (-> a1-18 param1) this) (set! (-> a1-18 param2) (the-as basic v1-74)) ) - (let ((a1-19 (-> obj node-list data 10)) + (let ((a1-19 (-> this node-list data 10)) (v1-76 (new 'static 'jellyfish-joint-mod-tentacle-info :axis (new 'static 'vector :x 1.0 :w 1.0) :angle 2730.6667) ) ) (set! (-> a1-19 param0) jellyfish-joint-mod-tentacle) - (set! (-> a1-19 param1) obj) + (set! (-> a1-19 param1) this) (set! (-> a1-19 param2) (the-as basic v1-76)) ) - (set! (-> obj tentacles-initialized) #f) - (set! (-> obj tentacle-clock) 0.0) - (set! (-> obj tentacle-blend) 1.0) + (set! (-> this tentacles-initialized) #f) + (set! (-> this tentacle-clock) 0.0) + (set! (-> this tentacle-blend) 1.0) (add-connection *part-engine* - obj + this 36 - obj + this 318 (new 'static 'vector :x 1966.08 :y -1843.2 :z 2129.92 :w 163840.0) ) (add-connection *part-engine* - obj + this 36 - obj + this 318 (new 'static 'vector :x -1966.08 :y -1843.2 :z 2129.92 :w 163840.0) ) diff --git a/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc b/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc index a2a83a5693..9611d8363a 100644 --- a/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/pipe-grunt_REF.gc @@ -16,27 +16,27 @@ ) ;; definition for method 3 of type pipe-grunt -(defmethod inspect pipe-grunt ((obj pipe-grunt)) - (when (not obj) - (set! obj obj) +(defmethod inspect pipe-grunt ((this pipe-grunt)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type grunt inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpipe-front: #~%" (-> obj pipe-front)) - (format #t "~2Tpipe-dir: #~%" (-> obj pipe-dir)) + (format #t "~2Tpipe-front: #~%" (-> this pipe-front)) + (format #t "~2Tpipe-dir: #~%" (-> this pipe-dir)) (label cfg-4) - obj + this ) ;; definition for method 66 of type pipe-grunt -(defmethod go-ambush pipe-grunt ((obj pipe-grunt)) - (go (method-of-object obj ambush)) +(defmethod go-ambush pipe-grunt ((this pipe-grunt)) + (go (method-of-object this ambush)) ) ;; definition for method 186 of type pipe-grunt -(defmethod pipe-grunt-method-186 pipe-grunt ((obj pipe-grunt)) +(defmethod pipe-grunt-method-186 pipe-grunt ((this pipe-grunt)) (let ((gp-0 (new 'static 'vector :x -1187061.8 :y -278487.03 :z 8090870.0 :w 1.0))) (let ((v1-0 (new 'static 'vector :x -1148026.9 :y -278487.03 :z 8112414.5 :w 1.0)) (s3-0 (new 'stack-no-clear 'vector)) @@ -46,12 +46,12 @@ (let ((f30-0 (vector-length s3-0))) (vector-normalize! s3-0 1.0) (vector-rotate90-around-y! s4-0 s3-0) - (vector-normalize-copy! (-> obj event-param-point) s3-0 (get-rand-float-range obj 0.0 f30-0)) + (vector-normalize-copy! (-> this event-param-point) s3-0 (get-rand-float-range this 0.0 f30-0)) ) - (vector-normalize! s4-0 (get-rand-float-range obj -16384.0 16384.0)) - (vector+! (-> obj event-param-point) (-> obj event-param-point) s4-0) + (vector-normalize! s4-0 (get-rand-float-range this -16384.0 16384.0)) + (vector+! (-> this event-param-point) (-> this event-param-point) s4-0) ) - (vector+! (-> obj event-param-point) (-> obj event-param-point) gp-0) + (vector+! (-> this event-param-point) (-> this event-param-point) gp-0) ) ) @@ -60,7 +60,7 @@ :virtual #t :event enemy-event-handler :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logior! (-> self enemy-flags) (enemy-flag chase-startup)) (logclear! (-> self enemy-flags) (enemy-flag enable-on-notice alert victory)) (let ((v1-7 (-> self root root-prim))) diff --git a/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc b/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc index 8f0e0fe1d7..45b0bf81da 100644 --- a/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/sig5-course_REF.gc @@ -11,28 +11,28 @@ ) ;; definition for method 3 of type sig5-course -(defmethod inspect sig5-course ((obj sig5-course)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig5-course ((this sig5-course)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcourse-id: ~D~%" (-> obj course-id)) - (format #t "~1Tspeech-count: ~D~%" (-> obj speech-count)) - (format #t "~1Tspot-count: ~D~%" (-> obj spot-count)) - (format #t "~1Tretry-cookie: ~D~%" (-> obj retry-cookie)) - (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> obj too-far-warn-speeches)) - (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> obj too-far-fail-speeches)) - (format #t "~1Tattack-player-speeches: ~A~%" (-> obj attack-player-speeches)) - (format #t "~1Tdefault-check-too-far: ~A~%" (-> obj default-check-too-far)) - (format #t "~1Twaypoints: ~A~%" (-> obj waypoints)) - (format #t "~1Tspeeches: #x~X~%" (-> obj speeches)) - (format #t "~1Tspeech-tunings: #x~X~%" (-> obj speech-tunings)) - (format #t "~1Tdirs: #x~X~%" (-> obj dirs)) - (format #t "~1Tspots: #x~X~%" (-> obj spots)) - (format #t "~1Tchase-speeches: ~A~%" (-> obj chase-speeches)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse-id: ~D~%" (-> this course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> this speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> this spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> this too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> this too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> this attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> this default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> this waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> this speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> this speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> this dirs)) + (format #t "~1Tspots: #x~X~%" (-> this spots)) + (format #t "~1Tchase-speeches: ~A~%" (-> this chase-speeches)) (label cfg-4) - obj + this ) ;; definition of type sig-under @@ -59,42 +59,42 @@ ) ;; definition for method 3 of type sig-under -(defmethod inspect sig-under ((obj sig-under)) - (when (not obj) - (set! obj obj) +(defmethod inspect sig-under ((this sig-under)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type sig inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tshot-at-growls-index: ~D~%" (-> obj shot-at-growls-index)) - (format #t "~2Tgrowls[2] @ #x~X~%" (-> obj growls)) - (format #t "~2Tnext-chase-play-time: ~D~%" (-> obj next-chase-play-time)) - (format #t "~2Tgrating-broken-time: ~D~%" (-> obj next-chase-play-time)) - (format #t "~2Ttest-plane: #~%" (-> obj test-plane)) + (format #t "~2Tshot-at-growls-index: ~D~%" (-> this shot-at-growls-index)) + (format #t "~2Tgrowls[2] @ #x~X~%" (-> this growls)) + (format #t "~2Tnext-chase-play-time: ~D~%" (-> this next-chase-play-time)) + (format #t "~2Tgrating-broken-time: ~D~%" (-> this next-chase-play-time)) + (format #t "~2Ttest-plane: #~%" (-> this test-plane)) (label cfg-4) - obj + this ) ;; definition for method 263 of type sig-under ;; WARN: Return type mismatch time-frame vs none. -(defmethod sig-under-method-263 sig-under ((obj sig-under)) +(defmethod sig-under-method-263 sig-under ((this sig-under)) (let ((s5-0 (current-time))) - (when (and (>= s5-0 (-> obj next-chase-play-time)) - (not (channel-active? obj (the-as uint 0))) - (>= (the-as int (sig-method-256 obj)) 750) + (when (and (>= s5-0 (-> this next-chase-play-time)) + (not (channel-active? this (the-as uint 0))) + (>= (the-as int (sig-method-256 this)) 750) ) (let ((a1-2 (bot-speech-list-method-9 - (-> obj sig5-course chase-speeches) - obj - (-> obj sig5-course speeches) + (-> this sig5-course chase-speeches) + this + (-> this sig5-course speeches) (speech-flags) ) ) ) (when (>= a1-2 0) - (play-speech obj a1-2) - (set! (-> obj next-chase-play-time) (+ s5-0 (get-rand-int-range obj 1500 2700))) + (play-speech this a1-2) + (set! (-> this next-chase-play-time) (+ s5-0 (get-rand-int-range this 1500 2700))) ) ) ) @@ -104,24 +104,24 @@ ;; definition for method 195 of type sig-under ;; WARN: Return type mismatch object vs symbol. -(defmethod attacked-by-player? sig-under ((obj sig-under) (arg0 process-focusable)) +(defmethod attacked-by-player? sig-under ((this sig-under) (arg0 process-focusable)) "Were we attacked by the player?" (the-as symbol (and (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed)))) - (or (and (logtest? (process-mask enemy) (-> arg0 mask)) (not (logtest? (bot-flags bf26) (-> obj bot-flags)))) - (and (logtest? (-> arg0 mask) (process-mask target)) (logtest? (-> obj bot-flags) (bot-flags attacked))) + (or (and (logtest? (process-mask enemy) (-> arg0 mask)) (not (logtest? (bot-flags bf26) (-> this bot-flags)))) + (and (logtest? (-> arg0 mask) (process-mask target)) (logtest? (-> this bot-flags) (bot-flags attacked))) ) ) ) ) ;; definition for method 86 of type sig-under -(defmethod enemy-method-86 sig-under ((obj sig-under)) - (let ((gp-0 (-> obj root))) +(defmethod enemy-method-86 sig-under ((this sig-under)) + (let ((gp-0 (-> this root))) (when (< (-> gp-0 transv y) 0.0) (let ((a1-0 (new 'stack-no-clear 'collide-query))) - (find-ground (-> obj root) a1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) + (find-ground (-> this root) a1-0 (collide-spec backgnd) 8192.0 81920.0 1024.0) ) (>= (-> gp-0 gspot-pos y) (-> gp-0 trans y)) ) @@ -130,40 +130,40 @@ ;; definition for method 76 of type sig-under ;; WARN: Return type mismatch object vs symbol. -(defmethod enemy-method-76 sig-under ((obj sig-under) (arg0 process) (arg1 event-message-block)) +(defmethod enemy-method-76 sig-under ((this sig-under) (arg0 process) (arg1 event-message-block)) (the-as symbol (cond - ((and (and (-> obj next-state) (= (-> obj next-state name) 'jump)) (type? arg0 under-break-floor)) + ((and (and (-> this next-state) (= (-> this next-state name) 'jump)) (type? arg0 under-break-floor)) (let ((v1-5 (-> arg1 param 0))) (send-event arg0 'attack v1-5 (static-attack-info ((id (new-attack-id)) (penetrate-using (penetrate flop))))) ) ) (else - ((method-of-type sig enemy-method-76) obj arg0 arg1) + ((method-of-type sig enemy-method-76) this arg0 arg1) ) ) ) ) ;; definition for method 74 of type sig-under -(defmethod general-event-handler sig-under ((obj sig-under) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) +(defmethod general-event-handler sig-under ((this sig-under) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) "Handles various events for the enemy @TODO - unsure if there is a pattern for the events and this should have a more specific name" (with-pp (case arg2 (('set-task) - (let* ((s1-1 (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-4))) + (let* ((s1-1 (logtest? (-> this bot-task-bits) (bot-task-bits botbits-4))) (t9-0 (method-of-type sig general-event-handler)) - (s5-1 (t9-0 obj arg0 arg1 arg2 arg3)) + (s5-1 (t9-0 this arg0 arg1 arg2 arg3)) ) - (when (and (not s1-1) (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-4))) + (when (and (not s1-1) (logtest? (-> this bot-task-bits) (bot-task-bits botbits-4))) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) (process->ppointer pp)) (set! (-> a1-2 num-params) 0) (set! (-> a1-2 message) 'under-break-floor) (let ((t9-1 send-event-function) - (v1-11 (-> obj actor-group 0 data 8 actor)) + (v1-11 (-> this actor-group 0 data 8 actor)) ) (t9-1 (if v1-11 @@ -182,21 +182,21 @@ (if (= (-> arg3 param 0) 2) (set! v1-14 *sig5-cent2-path0*) ) - (send-event obj 'sig-path v1-14) + (send-event this 'sig-path v1-14) ) ) (('notify) (if (and (type? arg0 sig-shot) (= (-> arg3 param 0) 'die) - (-> obj next-state) - (= (-> obj next-state name) 'intro-shooting) + (-> this next-state) + (= (-> this next-state name) 'intro-shooting) ) - (send-event (handle->process (-> obj growls (-> obj shot-at-growls-index))) 'sig-shot) - ((method-of-type sig general-event-handler) obj arg0 arg1 arg2 arg3) + (send-event (handle->process (-> this growls (-> this shot-at-growls-index))) 'sig-shot) + ((method-of-type sig general-event-handler) this arg0 arg1 arg2 arg3) ) ) (else - ((method-of-type sig general-event-handler) obj arg0 arg1 arg2 arg3) + ((method-of-type sig general-event-handler) this arg0 arg1 arg2 arg3) ) ) ) @@ -204,20 +204,20 @@ ;; definition for method 262 of type sig-under ;; WARN: disable def twice: 39. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. -(defmethod sig-under-method-262 sig-under ((obj sig-under) (arg0 symbol)) - (when (or (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-1)) +(defmethod sig-under-method-262 sig-under ((this sig-under) (arg0 symbol)) + (when (or (logtest? (-> this bot-task-bits) (bot-task-bits botbits-1)) (and arg0 (let ((f0-0 81920.0)) - (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> obj root trans))) + (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> this root trans))) ) ) ) (cond - ((speech-playing? obj 7) - (and (not (channel-active? obj (the-as uint 0))) (scene-play obj "under-centipede-one" #f)) + ((speech-playing? this 7) + (and (not (channel-active? this (the-as uint 0))) (scene-play this "under-centipede-one" #f)) ) (else - (play-speech obj 7) - (reset-warn-time! obj) + (play-speech this 7) + (reset-warn-time! this) #f ) ) @@ -225,23 +225,23 @@ ) ;; definition for method 264 of type sig-under -(defmethod sig-under-method-264 sig-under ((obj sig-under)) - (and (logtest? (-> obj bot-task-bits) (bot-task-bits botbits-3)) - (not (channel-active? obj (the-as uint 0))) - (scene-play obj "under-get-sig-out-res" #f) +(defmethod sig-under-method-264 sig-under ((this sig-under)) + (and (logtest? (-> this bot-task-bits) (bot-task-bits botbits-3)) + (not (channel-active? this (the-as uint 0))) + (scene-play this "under-get-sig-out-res" #f) ) ) ;; definition for method 260 of type sig-under ;; INFO: Used lq/sq -(defmethod sig-under-method-260 sig-under ((obj sig-under)) +(defmethod sig-under-method-260 sig-under ((this sig-under)) (local-vars (a2-5 float) (a2-12 float)) (rlet ((vf1 :class vf) (vf2 :class vf) (vf3 :class vf) ) (let ((gp-0 (new 'stack-no-clear 'sphere))) - (set! (-> gp-0 quad) (-> obj root trans quad)) + (set! (-> gp-0 quad) (-> this root trans quad)) (set! (-> gp-0 r) 327680.0) (set! *actor-list-length* 0) (if #t @@ -347,12 +347,12 @@ ;; definition for method 261 of type sig-under ;; INFO: Used lq/sq -(defmethod sig-under-method-261 sig-under ((obj sig-under) (arg0 vector) (arg1 vector) (arg2 symbol)) - (set! (-> arg0 w) (- (+ (* (-> arg0 x) (-> obj root trans x)) (* (-> arg0 z) (-> obj root trans z))))) +(defmethod sig-under-method-261 sig-under ((this sig-under) (arg0 vector) (arg1 vector) (arg2 symbol)) + (set! (-> arg0 w) (- (+ (* (-> arg0 x) (-> this root trans x)) (* (-> arg0 z) (-> this root trans z))))) (let ((v1-2 (new 'stack-no-clear 'vector))) (set! (-> v1-2 quad) (-> arg1 quad)) (set! (-> v1-2 y) 0.0) - (let ((f0-6 (vector4-dot (the-as vector (-> obj test-plane)) v1-2)) + (let ((f0-6 (vector4-dot (the-as vector (-> this test-plane)) v1-2)) (f1-3 14336.0) (f2-1 16384.0) ) @@ -361,7 +361,7 @@ (set! f2-1 (+ 2048.0 f2-1)) ) (if (and (>= f0-6 -2048.0) (>= f1-3 f0-6)) - (>= (* f2-1 f2-1) (vector-vector-xz-distance-squared arg1 (-> obj root trans))) + (>= (* f2-1 f2-1) (vector-vector-xz-distance-squared arg1 (-> this root trans))) ) ) ) @@ -447,7 +447,7 @@ (ja-eval) ) (when #t - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self bot-flags) (bot-flags bf18)) (let ((gp-3 (+ (current-time) (get-rand-int-range self 30 600)))) (ja-channel-push! 1 (seconds 0.5)) @@ -470,35 +470,35 @@ ) ;; definition for method 183 of type sig-under -(defmethod alive? sig-under ((obj sig-under)) - ((method-of-type bot alive?) obj) +(defmethod alive? sig-under ((this sig-under)) + ((method-of-type bot alive?) this) ) ;; definition for method 210 of type sig-under ;; WARN: Return type mismatch symbol vs none. -(defmethod init! sig-under ((obj sig-under)) +(defmethod init! sig-under ((this sig-under)) "Set defaults for various fields." (let ((t9-0 (method-of-type sig init!))) - (t9-0 obj) + (t9-0 this) ) - (set! (-> obj too-far-warn-dist-default) 245760.0) - (set! (-> obj too-far-fail-dist-delta-default) 163840.0) + (set! (-> this too-far-warn-dist-default) 245760.0) + (set! (-> this too-far-fail-dist-delta-default) 163840.0) (countdown (v1-3 2) - (set! (-> obj growls v1-3) (the-as handle #f)) + (set! (-> this growls v1-3) (the-as handle #f)) ) (none) ) ;; definition for method 116 of type sig-under ;; WARN: Return type mismatch object vs none. -(defmethod go-idle sig-under ((obj sig-under)) +(defmethod go-idle sig-under ((this sig-under)) (cond ((task-node-closed? (game-task-node under-sig-resolution)) - (cleanup-for-death obj) - (go (method-of-object obj die-fast)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) ) (else - (go (method-of-object obj intro-shooting)) + (go (method-of-object this intro-shooting)) ) ) (none) @@ -570,9 +570,9 @@ (not (logtest? (-> *target* focus-status) (focus-status dead in-air edge-grab))) ) ) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) - (when (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.1)) + (when (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.1)) (task-node-open? (game-task-node under-sig-introduction)) (scene-play arg1 "under-find-sig-res" #f) ) @@ -968,7 +968,7 @@ (set! (-> (the-as sigt-wait-spot v1-15) check-done) (the-as (function sigt-wait-spot sig symbol) - (lambda ((arg0 object) (arg1 sig-under)) (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.8)) + (lambda ((arg0 object) (arg1 sig-under)) (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.8)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 13 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1104,9 +1104,9 @@ (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) (if (sig-under-method-261 arg1 (-> arg1 test-plane) (target-pos 0) #t) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 16 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1225,7 +1225,7 @@ ) ) ) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.7)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.7)) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) (go-to-waypoint! arg1 20 #f) (ai-task-control-method-10 (-> arg1 ai-ctrl) arg1) @@ -1355,7 +1355,7 @@ (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) (if (and (not (speech-playing? arg1 12)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1.5)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 1.5)) (not (channel-active? arg1 (the-as uint 0))) ) (play-speech arg1 12) @@ -1369,7 +1369,7 @@ #f ) ((not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2)) (remove-setting! 'entity-name) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (add-process *gui-control* arg1 (gui-channel art-load) (gui-action queue) "under-centipede-three" -99.0 0) @@ -1377,7 +1377,7 @@ #f ) (else - (when (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 2.5)) + (when (time-elapsed? (-> arg1 waypoint-time0) (seconds 2.5)) (process-release? *target*) (reset-warn-time! arg1) (ai-task-control-method-12 (-> arg1 ai-ctrl) arg1) @@ -1446,7 +1446,7 @@ ) (let ((s5-0 (new 'stack-no-clear 'vector))) (set! v1-14 - (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.25)) + (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.25)) (begin (set! (-> s5-0 quad) (-> (target-pos 0) quad)) (set! (-> s5-0 y) 0.0) @@ -1574,7 +1574,7 @@ (return #t) ) (sig-under-method-263 arg1) - (when (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 4)) + (when (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 4)) (sig-method-257 arg1) (let ((f0-0 61440.0)) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg1 root trans))) @@ -1639,16 +1639,16 @@ (return #t) ) (if (not (logtest? (-> arg1 bot-task-bits) (bot-task-bits botbits-4))) - (set! (-> arg1 waypoint-time0) (current-time)) + (set-time! (-> arg1 waypoint-time0)) ) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-1))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.5)) (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-1)) (logior! (-> arg1 enemy-flags) (enemy-flag enable-on-active checking-water)) ) - (if (and (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 1)) + (if (and (time-elapsed? (-> arg1 waypoint-time0) (seconds 1)) (not (speech-playing? arg1 21)) (not (channel-active? arg1 (the-as uint 0))) ) @@ -1657,7 +1657,7 @@ (when (zero? (-> arg1 next-chase-play-time)) (let ((a0-14 (-> arg1 actor-group 0 data 7 actor))) (if (and a0-14 (logtest? (-> a0-14 extra perm status) (entity-perm-status subtask-complete))) - (set! (-> arg1 next-chase-play-time) (current-time)) + (set-time! (-> arg1 next-chase-play-time)) ) ) ) @@ -1666,7 +1666,7 @@ (or (= v1-54 'waiting-far) (= v1-54 'waiting-close) (= v1-54 'waiting-turn)) ) ) - (or (nonzero? (-> arg1 next-chase-play-time)) (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 6))) + (or (nonzero? (-> arg1 next-chase-play-time)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 6))) ) (when (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) @@ -1687,8 +1687,8 @@ ) (when (or (zero? (-> arg1 next-chase-play-time)) (and (nonzero? (-> arg1 next-chase-play-time)) - (>= (- (current-time) (-> arg1 next-chase-play-time)) (seconds 2)) - (or (>= (- (current-time) (-> arg1 next-chase-play-time)) (seconds 9)) + (time-elapsed? (-> arg1 next-chase-play-time) (seconds 2)) + (or (time-elapsed? (-> arg1 next-chase-play-time) (seconds 9)) (>= (vector-vector-xz-distance s4-1 (-> s5-1 center)) (+ 8192.0 (-> s5-1 center w))) (< 20480.0 (- (-> s4-1 y) (-> s5-1 center y))) ) @@ -1737,7 +1737,7 @@ (function sigt-wait-spot sig symbol) (lambda ((arg0 object) (arg1 sig-under)) (when (and (not (logtest? (-> arg1 waypoint-bits) (waypoint-bits wabits-0))) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 0.5)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 0.5)) (not (logtest? (-> arg1 focus-status) (focus-status in-air))) ) (logior! (-> arg1 waypoint-bits) (waypoint-bits wabits-0)) @@ -1752,7 +1752,7 @@ ) (else (if (and (not (speech-playing? arg1 23)) - (>= (- (current-time) (-> arg1 waypoint-time0)) (seconds 3.5)) + (time-elapsed? (-> arg1 waypoint-time0) (seconds 3.5)) (not (channel-active? arg1 (the-as uint 0))) ) (play-speech arg1 23) diff --git a/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc b/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc index e3119b1c1f..957e46645b 100644 --- a/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-laser_REF.gc @@ -16,20 +16,20 @@ ) ;; definition for method 3 of type under-laser-info -(defmethod inspect under-laser-info ((obj under-laser-info)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-laser-info ((this under-laser-info)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Toptions: ~D~%" (-> obj options)) - (format #t "~1Tlaser-radius: ~f~%" (-> obj laser-radius)) - (format #t "~1Tlaser-move-dist: ~f~%" (-> obj laser-move-dist)) - (format #t "~1Tshadow-top-y: ~f~%" (-> obj shadow-top-y)) - (format #t "~1Tshadow-height: ~f~%" (-> obj shadow-height)) - (format #t "~1Tshadow-radius-adjust: ~f~%" (-> obj shadow-radius-adjust)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Toptions: ~D~%" (-> this options)) + (format #t "~1Tlaser-radius: ~f~%" (-> this laser-radius)) + (format #t "~1Tlaser-move-dist: ~f~%" (-> this laser-move-dist)) + (format #t "~1Tshadow-top-y: ~f~%" (-> this shadow-top-y)) + (format #t "~1Tshadow-height: ~f~%" (-> this shadow-height)) + (format #t "~1Tshadow-radius-adjust: ~f~%" (-> this shadow-radius-adjust)) (label cfg-4) - obj + this ) ;; definition for symbol *under-laser-infos*, type (array under-laser-info) @@ -97,18 +97,18 @@ ) ;; definition for method 3 of type under-laser-shadow -(defmethod inspect under-laser-shadow ((obj under-laser-shadow)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-laser-shadow ((this under-laser-shadow)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: ~A~%" (-> obj info)) - (format #t "~2Ttrans-xz-offset: #~%" (-> obj trans-xz-offset)) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Ttrans-xz-offset: #~%" (-> this trans-xz-offset)) (label cfg-4) - obj + this ) ;; definition of type under-laser-slave @@ -125,16 +125,16 @@ ) ;; definition for method 3 of type under-laser-slave -(defmethod inspect under-laser-slave ((obj under-laser-slave)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-laser-slave ((this under-laser-slave)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition of type under-laser @@ -162,25 +162,25 @@ ) ;; definition for method 3 of type under-laser -(defmethod inspect under-laser ((obj under-laser)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-laser ((this under-laser)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinfo: ~A~%" (-> obj info)) - (format #t "~2Tid: ~D~%" (-> obj id)) - (format #t "~2Tlightning: ~A~%" (-> obj lightning)) - (format #t "~2Tdraw-test-script: ~A~%" (-> obj draw-test-script)) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tlaser-dir: #~%" (-> obj laser-dir)) - (format #t "~2Tslave-trans-offset: #~%" (-> obj slave-trans-offset)) - (format #t "~2Tzero-pos: #~%" (-> obj zero-pos)) - (format #t "~2Tone-pos: #~%" (-> obj one-pos)) + (format #t "~2Tinfo: ~A~%" (-> this info)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Tlightning: ~A~%" (-> this lightning)) + (format #t "~2Tdraw-test-script: ~A~%" (-> this draw-test-script)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tlaser-dir: #~%" (-> this laser-dir)) + (format #t "~2Tslave-trans-offset: #~%" (-> this slave-trans-offset)) + (format #t "~2Tzero-pos: #~%" (-> this zero-pos)) + (format #t "~2Tone-pos: #~%" (-> this one-pos)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -310,14 +310,14 @@ ;; definition for method 22 of type under-laser ;; INFO: Used lq/sq ;; WARN: Return type mismatch sound-id vs none. -(defmethod under-laser-method-22 under-laser ((obj under-laser)) +(defmethod under-laser-method-22 under-laser ((this under-laser)) (let ((s5-0 (new 'stack-no-clear 'collide-query))) - (set! (-> s5-0 start-pos quad) (-> obj root trans quad)) - (set! (-> s5-0 move-dist quad) (-> obj slave-trans-offset quad)) + (set! (-> s5-0 start-pos quad) (-> this root trans quad)) + (set! (-> s5-0 move-dist quad) (-> this slave-trans-offset quad)) (let ((v1-2 s5-0)) (set! (-> v1-2 radius) 409.6) (set! (-> v1-2 collide-with) (collide-spec jak bot player-list)) - (set! (-> v1-2 ignore-process0) obj) + (set! (-> v1-2 ignore-process0) this) (set! (-> v1-2 ignore-process1) #f) (set! (-> v1-2 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1)) (set! (-> v1-2 action-mask) (collide-action solid)) @@ -331,10 +331,10 @@ ) (when s5-1 (let ((s4-1 (new 'stack-no-clear 'vector))) - (vector-rotate-around-y! s4-1 (-> obj slave-trans-offset) (if (logtest? (-> obj info options) 1) - 16384.0 - -16384.0 - ) + (vector-rotate-around-y! s4-1 (-> this slave-trans-offset) (if (logtest? (-> this info options) 1) + 16384.0 + -16384.0 + ) ) (vector-normalize! s4-1 1.0) (if (send-event @@ -438,17 +438,17 @@ ;; definition for method 7 of type under-laser ;; WARN: Return type mismatch process-drawable vs under-laser. -(defmethod relocate under-laser ((obj under-laser) (arg0 int)) - (if (nonzero? (-> obj lightning)) - (&+! (-> obj lightning) arg0) +(defmethod relocate under-laser ((this under-laser) (arg0 int)) + (if (nonzero? (-> this lightning)) + (&+! (-> this lightning) arg0) ) - (the-as under-laser ((method-of-type process-drawable relocate) obj arg0)) + (the-as under-laser ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type under-laser ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-laser ((obj under-laser) (arg0 entity-actor)) +(defmethod init-from-entity! under-laser ((this under-laser) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -456,17 +456,17 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-64 res-tag)) - (set! (-> obj root) (the-as collide-shape-moving (new 'process 'trsqv))) - (process-drawable-from-entity! obj arg0) - (logclear! (-> obj mask) (process-mask actor-pause)) + (set! (-> this root) (the-as collide-shape-moving (new 'process 'trsqv))) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-laser" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-7 (res-lump-value (-> obj entity) 'extra-id uint128 :time -1000000000.0))) - (set! (-> obj id) (the-as int v1-7)) - (set! (-> obj info) (-> *under-laser-infos* v1-7)) + (let ((v1-7 (res-lump-value (-> this entity) 'extra-id uint128 :time -1000000000.0))) + (set! (-> this id) (the-as int v1-7)) + (set! (-> this info) (-> *under-laser-infos* v1-7)) ) (let ((a1-6 (new 'stack-no-clear 'sync-info-params))) (let ((v1-11 0)) @@ -483,10 +483,10 @@ This commonly includes things such as: (set! (-> a1-6 ease-out) 0.15) (set! (-> a1-6 pause-in) 0.0) (set! (-> a1-6 pause-out) 0.0) - (initialize! (-> obj sync) a1-6) + (initialize! (-> this sync) a1-6) ) - (set! (-> obj clock) (-> *display* user0-clock)) - (let ((s5-1 (-> obj root))) + (set! (-> this clock) (-> *display* user0-clock)) + (let ((s5-1 (-> this root))) (set-vector! (-> s5-1 scale) 1.25 1.25 1.25 1.0) (set! sv-64 (new 'static 'res-tag)) (let ((v1-22 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-64)))) @@ -501,39 +501,39 @@ This commonly includes things such as: (quaternion-rotate-y! (-> s5-1 quat) (-> s5-1 quat) f0-15) ) ) - (vector-z-quaternion! (-> obj laser-dir) (-> s5-1 quat)) - (vector-normalize! (-> obj laser-dir) 1.0) + (vector-z-quaternion! (-> this laser-dir) (-> s5-1 quat)) + (vector-normalize! (-> this laser-dir) 1.0) (quaternion-rotate-y! (-> s5-1 quat) (-> s5-1 quat) -16384.0) - (when (logtest? (-> obj info options) 1) + (when (logtest? (-> this info options) 1) (let ((s4-1 (new 'stack-no-clear 'quaternion))) - (quaternion-vector-angle! s4-1 (-> obj laser-dir) 16384.0) + (quaternion-vector-angle! s4-1 (-> this laser-dir) 16384.0) (quaternion*! (-> s5-1 quat) s4-1 (-> s5-1 quat)) ) ) - (let ((f30-0 (-> obj info laser-radius))) + (let ((f30-0 (-> this info laser-radius))) (let ((s4-2 (new 'stack-no-clear 'vector))) - (vector-normalize-copy! s4-2 (-> obj laser-dir) (- f30-0)) + (vector-normalize-copy! s4-2 (-> this laser-dir) (- f30-0)) (vector+! (-> s5-1 trans) (-> s5-1 trans) s4-2) ) - (vector-normalize-copy! (-> obj slave-trans-offset) (-> obj laser-dir) (* 2.0 f30-0)) + (vector-normalize-copy! (-> this slave-trans-offset) (-> this laser-dir) (* 2.0 f30-0)) ) - (set! (-> obj zero-pos quad) (-> s5-1 trans quad)) - (let ((f30-1 (-> obj info laser-move-dist))) + (set! (-> this zero-pos quad) (-> s5-1 trans quad)) + (let ((f30-1 (-> this info laser-move-dist))) (cond - ((logtest? (-> obj info options) 1) - (set! (-> obj one-pos quad) (-> obj zero-pos quad)) - (+! (-> obj one-pos y) f30-1) + ((logtest? (-> this info options) 1) + (set! (-> this one-pos quad) (-> this zero-pos quad)) + (+! (-> this one-pos y) f30-1) ) (else (let ((s4-3 (new 'stack-no-clear 'vector))) - (vector-rotate-around-y! s4-3 (-> obj laser-dir) 16384.0) + (vector-rotate-around-y! s4-3 (-> this laser-dir) 16384.0) (vector-normalize! s4-3 f30-1) - (vector+! (-> obj one-pos) (-> obj zero-pos) s4-3) + (vector+! (-> this one-pos) (-> this zero-pos) s4-3) ) ) ) ) - (vector-lerp! (-> s5-1 trans) (-> obj zero-pos) (-> obj one-pos) (get-norm! (-> obj sync) 0)) + (vector-lerp! (-> s5-1 trans) (-> this zero-pos) (-> this one-pos) (get-norm! (-> this sync) 0)) ) (let ((a2-13 (new 'static 'lightning-spec :name #f @@ -555,24 +555,24 @@ This commonly includes things such as: ) ) ) - (set! (-> obj lightning) (new 'process 'lightning-control a2-13 obj 0.0)) + (set! (-> this lightning) (new 'process 'lightning-control a2-13 this 0.0)) ) (let ((a3-5 (new 'stack-no-clear 'vector))) - (vector-float*! a3-5 (-> obj slave-trans-offset) 0.5) - (vector+! a3-5 a3-5 (-> obj root trans)) - (if (zero? (-> obj id)) - (set! (-> obj sound) (new 'process 'ambient-sound (static-sound-spec "und-laser-near" :fo-max 40) a3-5)) - (set! (-> obj sound) (new 'process 'ambient-sound (static-sound-spec "und-laser-beam" :fo-max 40) a3-5)) + (vector-float*! a3-5 (-> this slave-trans-offset) 0.5) + (vector+! a3-5 a3-5 (-> this root trans)) + (if (zero? (-> this id)) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "und-laser-near" :fo-max 40) a3-5)) + (set! (-> this sound) (new 'process 'ambient-sound (static-sound-spec "und-laser-beam" :fo-max 40) a3-5)) ) ) - (set! (-> obj draw-test-script) (res-lump-struct (-> obj entity) 'on-activate script-context)) + (set! (-> this draw-test-script) (res-lump-struct (-> this entity) 'on-activate script-context)) (cond - ((and (script-eval (the-as pair (-> obj draw-test-script))) (= *bot-record-path* -1)) - (update-vol! (-> obj sound) 0.0) - (go (method-of-object obj dormant)) + ((and (script-eval (the-as pair (-> this draw-test-script))) (= *bot-record-path* -1)) + (update-vol! (-> this sound) 0.0) + (go (method-of-object this dormant)) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (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 29c51870cf..19df5a8b98 100644 --- a/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-obs_REF.gc @@ -310,19 +310,19 @@ ) ;; definition for method 3 of type bubbler -(defmethod inspect bubbler ((obj bubbler)) - (when (not obj) - (set! obj obj) +(defmethod inspect bubbler ((this bubbler)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trod-of-god-scale: ~f~%" (-> obj rod-of-god-scale)) - (format #t "~2Tambient-id: ~D~%" (-> obj ambient-id)) - (format #t "~2Tlast-recharge-time: ~D~%" (-> obj last-recharge-time)) + (format #t "~2Trod-of-god-scale: ~f~%" (-> this rod-of-god-scale)) + (format #t "~2Tambient-id: ~D~%" (-> this ambient-id)) + (format #t "~2Tlast-recharge-time: ~D~%" (-> this last-recharge-time)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -373,10 +373,10 @@ (>= (* f0-18 f0-18) (vector-vector-xz-distance-squared a0-5 (-> self root trans))) ) ) - (if (>= (- (current-time) (-> self last-recharge-time)) (seconds 1)) + (if (time-elapsed? (-> self last-recharge-time) (seconds 1)) (sound-play "oxygen-recharge") ) - (set! (-> self last-recharge-time) (current-time)) + (set-time! (-> self last-recharge-time)) (send-event (ppointer->process *underb-master*) 'bubbler) ) ) @@ -387,27 +387,27 @@ ) ;; definition for method 10 of type bubbler -(defmethod deactivate bubbler ((obj bubbler)) - (sound-stop (-> obj ambient-id)) - ((method-of-type process-drawable deactivate) obj) +(defmethod deactivate bubbler ((this bubbler)) + (sound-stop (-> this ambient-id)) + ((method-of-type process-drawable deactivate) this) (none) ) ;; definition for method 11 of type bubbler ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! bubbler ((obj bubbler) (arg0 entity-actor)) +(defmethod init-from-entity! bubbler ((this bubbler) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 500) obj)) - (set! (-> obj rod-of-god-scale) 1.0) - (set! (-> obj ambient-id) (sound-play "bubbler" :position (-> obj root trans))) - (go (method-of-object obj idle)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 500) this)) + (set! (-> this rod-of-god-scale) 1.0) + (set! (-> this ambient-id) (sound-play "bubbler" :position (-> this root trans))) + (go (method-of-object this idle)) (none) ) @@ -438,25 +438,25 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-rise-plat -(defmethod inspect under-rise-plat ((obj under-rise-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-rise-plat ((this under-rise-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tup-y: ~f~%" (-> obj up-y)) - (format #t "~2Tdown-y: ~f~%" (-> obj down-y)) - (format #t "~2Tdelta-y: ~f~%" (-> obj delta-y)) - (format #t "~2Tup-threshold: ~f~%" (-> obj up-threshold)) - (format #t "~2Tdown-threshold: ~f~%" (-> obj down-threshold)) - (format #t "~2Tlast-ridden: ~D~%" (-> obj last-ridden)) - (format #t "~2Tridden: ~A~%" (-> obj ridden)) - (format #t "~2Trider-started: ~A~%" (-> obj rider-started)) - (format #t "~2Textra-id: ~D~%" (-> obj extra-id)) + (format #t "~2Tup-y: ~f~%" (-> this up-y)) + (format #t "~2Tdown-y: ~f~%" (-> this down-y)) + (format #t "~2Tdelta-y: ~f~%" (-> this delta-y)) + (format #t "~2Tup-threshold: ~f~%" (-> this up-threshold)) + (format #t "~2Tdown-threshold: ~f~%" (-> this down-threshold)) + (format #t "~2Tlast-ridden: ~D~%" (-> this last-ridden)) + (format #t "~2Tridden: ~A~%" (-> this ridden)) + (format #t "~2Trider-started: ~A~%" (-> this rider-started)) + (format #t "~2Textra-id: ~D~%" (-> this extra-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -627,7 +627,7 @@ This commonly includes things such as: :trans (behavior () (rider-trans) (when (-> self rider-started) - (when (and (not (-> self ridden)) (>= (- (current-time) (-> self last-ridden)) (seconds 2))) + (when (and (not (-> self ridden)) (time-elapsed? (-> self last-ridden) (seconds 2))) (if (= (-> self extra-id) 1) (send-event (ppointer->process *underb-master*) 'request 'big-room 'under-plat 'player #f) ) @@ -652,7 +652,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-rise-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-rise-plat ((obj under-rise-plat) (arg0 entity-actor)) +(defmethod init-from-entity! under-rise-plat ((this under-rise-plat) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -660,7 +660,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -676,37 +676,37 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (-> obj root) + (process-drawable-from-entity! this arg0) + (-> this root) (set! sv-16 (new 'static 'res-tag)) (let ((v1-16 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-16 - (+! (-> obj root trans x) (-> v1-16 0)) - (+! (-> obj root trans y) (-> v1-16 1)) - (+! (-> obj root trans z) (-> v1-16 2)) + (+! (-> this root trans x) (-> v1-16 0)) + (+! (-> this root trans y) (-> v1-16 1)) + (+! (-> this root trans z) (-> v1-16 2)) ) ) - (set! (-> obj extra-id) (res-lump-value arg0 'extra-id int :time -1000000000.0)) - (set! (-> obj delta-y) (res-lump-float arg0 'height :default 92160.0)) + (set! (-> this extra-id) (res-lump-value arg0 'extra-id int :time -1000000000.0)) + (set! (-> this delta-y) (res-lump-float arg0 'height :default 92160.0)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-rise-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (let ((v1-23 (-> obj root))) - (set! (-> obj down-y) (-> v1-23 trans y)) - (+! (-> v1-23 trans y) (-> obj delta-y)) - (set! (-> obj up-y) (-> v1-23 trans y)) - (set! (-> obj down-threshold) (* 0.6666667 (-> obj delta-y))) - (set! (-> obj up-threshold) (- (-> obj down-threshold))) + (let ((v1-23 (-> this root))) + (set! (-> this down-y) (-> v1-23 trans y)) + (+! (-> v1-23 trans y) (-> this delta-y)) + (set! (-> this up-y) (-> v1-23 trans y)) + (set! (-> this down-threshold) (* 0.6666667 (-> this delta-y))) + (set! (-> this up-threshold) (- (-> this down-threshold))) (vector-reset! (-> v1-23 transv)) ) - (set! (-> obj ridden) #f) - (set! (-> obj rider-started) #f) - (set! (-> obj draw light-index) (the-as uint 2)) - (go (method-of-object obj idle-up)) + (set! (-> this ridden) #f) + (set! (-> this rider-started) #f) + (set! (-> this draw light-index) (the-as uint 2)) + (go (method-of-object this idle-up)) (none) ) @@ -726,18 +726,18 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-buoy-base -(defmethod inspect under-buoy-base ((obj under-buoy-base)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-buoy-base ((this under-buoy-base)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Trelease: ~A~%" (-> obj release)) - (format #t "~2Topen-anim-frame: ~f~%" (-> obj open-anim-frame)) + (format #t "~2Trelease: ~A~%" (-> this release)) + (format #t "~2Topen-anim-frame: ~f~%" (-> this open-anim-frame)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -869,16 +869,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-buoy-chain -(defmethod inspect under-buoy-chain ((obj under-buoy-chain)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-buoy-chain ((this under-buoy-chain)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -958,20 +958,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-buoy-plat -(defmethod inspect under-buoy-plat ((obj under-buoy-plat)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-buoy-plat ((this under-buoy-plat)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type rigid-body-platform inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Torig-trans: #~%" (-> obj orig-trans)) - (format #t "~2Tsurface-height: ~f~%" (-> obj surface-height)) - (format #t "~2Tanchor-point: #~%" (-> obj anchor-point)) - (format #t "~2Tbase: #x~X~%" (-> obj base)) + (format #t "~2Torig-trans: #~%" (-> this orig-trans)) + (format #t "~2Tsurface-height: ~f~%" (-> this surface-height)) + (format #t "~2Tanchor-point: #~%" (-> this anchor-point)) + (format #t "~2Tbase: #x~X~%" (-> this base)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -982,17 +982,17 @@ 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 ((obj under-buoy-plat) (arg0 float)) - ((the-as (function rigid-body-object float none) (find-parent-method under-buoy-plat 29)) obj arg0) - (rigid-body-platform-method-56 obj (-> obj orig-trans)) +(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) + (rigid-body-platform-method-56 this (-> this orig-trans)) 0 (none) ) ;; definition for method 32 of type under-buoy-plat ;; WARN: Return type mismatch int vs none. -(defmethod allocate-and-init-cshape under-buoy-plat ((obj under-buoy-plat)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) +(defmethod allocate-and-init-cshape under-buoy-plat ((this under-buoy-plat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1014,7 +1014,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-16 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -1056,22 +1056,22 @@ This commonly includes things such as: ) ;; definition for method 53 of type under-buoy-plat -(defmethod rigid-body-platform-method-53 under-buoy-plat ((obj under-buoy-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-53 under-buoy-plat ((this under-buoy-plat) (arg0 vector)) -220341.05 ) ;; definition for method 56 of type under-buoy-plat ;; WARN: Return type mismatch int vs none. -(defmethod rigid-body-platform-method-56 under-buoy-plat ((obj under-buoy-plat) (arg0 vector)) +(defmethod rigid-body-platform-method-56 under-buoy-plat ((this under-buoy-plat) (arg0 vector)) (let ((v1-0 (new 'stack-no-clear 'vector))) - (vector-! v1-0 arg0 (-> obj rbody state position)) + (vector-! v1-0 arg0 (-> this rbody state position)) (set! (-> v1-0 y) 0.0) (let* ((f0-1 (vector-length v1-0)) (f1-1 (* 4.0 (fmax 0.0 (fmin 4096.0 (+ -819.2 f0-1))))) ) (when (< 0.0 f1-1) (vector-float*! v1-0 v1-0 (/ f1-1 f0-1)) - (rigid-body-method-20 (-> obj rbody state) v1-0) + (rigid-body-method-20 (-> this rbody state) v1-0) ) ) ) @@ -1082,20 +1082,20 @@ This commonly includes things such as: ;; definition for method 33 of type under-buoy-plat ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod init-skel-and-rigid-body under-buoy-plat ((obj under-buoy-plat)) +(defmethod init-skel-and-rigid-body under-buoy-plat ((this under-buoy-plat)) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-buoy-plat" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (alloc-and-init-rigid-body-control obj *under-buoy-plat-platform-constants*) - (set! (-> obj orig-trans quad) (-> obj root trans quad)) - (set! (-> obj anchor-point quad) (-> obj root trans quad)) - (set! (-> obj surface-height) (-> obj root trans y)) - (set! (-> obj info info cm-offset-joint y) 6144.0) - (let ((s5-1 (-> obj info control-point-count))) + (alloc-and-init-rigid-body-control this *under-buoy-plat-platform-constants*) + (set! (-> this orig-trans quad) (-> this root trans quad)) + (set! (-> this anchor-point quad) (-> this root trans quad)) + (set! (-> this surface-height) (-> this root trans y)) + (set! (-> this info info cm-offset-joint y) 6144.0) + (let ((s5-1 (-> this info control-point-count))) (dotimes (s4-1 s5-1) - (let ((s3-0 (-> obj control-point-array data s4-1))) + (let ((s3-0 (-> this control-point-array data s4-1))) (let ((f30-0 (* 65536.0 (/ (the float s4-1) (the float s5-1))))) (set! (-> s3-0 local-pos x) (* 12288.0 (sin f30-0))) (set! (-> s3-0 local-pos y) 8192.0) @@ -1105,19 +1105,19 @@ This commonly includes things such as: ) ) ) - (process-spawn under-buoy-chain (target-pos 0) (-> obj entity) :to obj) - (set! (-> obj base) (process-spawn under-buoy-base (target-pos 0) (-> obj entity) :to obj)) - (logior! (-> obj mask) (process-mask actor-pause)) - (set! (-> obj draw light-index) (the-as uint 2)) + (process-spawn under-buoy-chain (target-pos 0) (-> this entity) :to this) + (set! (-> this base) (process-spawn under-buoy-base (target-pos 0) (-> this entity) :to this)) + (logior! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 2)) (none) ) ;; definition for method 34 of type under-buoy-plat ;; WARN: Return type mismatch object vs none. -(defmethod rigid-body-object-method-34 under-buoy-plat ((obj under-buoy-plat)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj running)) - (go (method-of-object obj waiting)) +(defmethod rigid-body-object-method-34 under-buoy-plat ((this under-buoy-plat)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this running)) + (go (method-of-object this waiting)) ) (none) ) @@ -1194,35 +1194,35 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-mine-chain-physics -(defmethod inspect under-mine-chain-physics ((obj under-mine-chain-physics)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-mine-chain-physics ((this under-mine-chain-physics)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tchain-joints[20] @ #x~X~%" (-> obj chain-joints)) - (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) - (format #t "~1Troot-joint-index: ~D~%" (-> obj root-joint-index)) - (format #t "~1Tjoint-length: ~f~%" (-> obj joint-length)) - (format #t "~1Tgravity: #~%" (-> obj gravity)) - (format #t "~1Tgravity-target: #~%" (-> obj gravity-target)) - (format #t "~1Tstretch-vel: ~f~%" (-> obj stretch-vel)) - (format #t "~1Tstretch-vel-parallel: ~f~%" (-> obj stretch-vel-parallel)) - (format #t "~1Tcompress-vel: ~f~%" (-> obj compress-vel)) - (format #t "~1Tcompress-vel-parallel: ~f~%" (-> obj compress-vel-parallel)) - (format #t "~1Tnegate-y: ~A~%" (-> obj negate-y)) - (format #t "~1Taxial-slop: ~f~%" (-> obj axial-slop)) - (format #t "~1Tmaximum-stretch: ~f~%" (-> obj maximum-stretch)) - (format #t "~1Tturn-off-start: ~D~%" (-> obj turn-off-start)) - (format #t "~1Tturn-off-duration: ~D~%" (-> obj turn-off-duration)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tchain-joints[20] @ #x~X~%" (-> this chain-joints)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Troot-joint-index: ~D~%" (-> this root-joint-index)) + (format #t "~1Tjoint-length: ~f~%" (-> this joint-length)) + (format #t "~1Tgravity: #~%" (-> this gravity)) + (format #t "~1Tgravity-target: #~%" (-> this gravity-target)) + (format #t "~1Tstretch-vel: ~f~%" (-> this stretch-vel)) + (format #t "~1Tstretch-vel-parallel: ~f~%" (-> this stretch-vel-parallel)) + (format #t "~1Tcompress-vel: ~f~%" (-> this compress-vel)) + (format #t "~1Tcompress-vel-parallel: ~f~%" (-> this compress-vel-parallel)) + (format #t "~1Tnegate-y: ~A~%" (-> this negate-y)) + (format #t "~1Taxial-slop: ~f~%" (-> this axial-slop)) + (format #t "~1Tmaximum-stretch: ~f~%" (-> this maximum-stretch)) + (format #t "~1Tturn-off-start: ~D~%" (-> this turn-off-start)) + (format #t "~1Tturn-off-duration: ~D~%" (-> this turn-off-duration)) (label cfg-4) - obj + this ) ;; definition for method 13 of type under-mine-chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod apply-gravity under-mine-chain-physics ((obj under-mine-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) +(defmethod apply-gravity under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) (local-vars (v1-7 vector) (v1-11 vector) (a0-17 float) (a0-26 float)) (rlet ((acc :class vf) (vf0 :class vf) @@ -1230,28 +1230,28 @@ This commonly includes things such as: (vf2 :class vf) ) (init-vf0-vector) - (vector-float*! arg0 (-> obj gravity) (* 81.92 (-> self clock time-adjust-ratio))) + (vector-float*! arg0 (-> this gravity) (* 81.92 (-> self clock time-adjust-ratio))) (cond - ((= arg1 (+ (-> obj num-joints) -1)) + ((= arg1 (+ (-> this num-joints) -1)) (let ((v1-4 (new 'stack-no-clear 'vector))) (set! (-> v1-4 quad) (-> arg2 entity trans quad)) - (vector-! v1-4 v1-4 (the-as vector (-> obj chain-joints arg1))) + (vector-! v1-4 v1-4 (the-as vector (-> this chain-joints arg1))) (vector+float*! arg0 arg0 v1-4 1.0) ) ) (else (cond - ((>= arg1 (the-as int (+ (-> obj num-joints) -1))) + ((>= arg1 (the-as int (+ (-> this num-joints) -1))) (set! v1-7 (new 'stack-no-clear 'vector)) (set! (-> v1-7 quad) (-> arg2 entity trans quad)) (+! (-> v1-7 y) 8192.0) ) (else (set! v1-7 (new 'stack-no-clear 'vector)) - (set! (-> v1-7 quad) (-> obj chain-joints (+ arg1 1) position quad)) + (set! (-> v1-7 quad) (-> this chain-joints (+ arg1 1) position quad)) ) ) - (vector-! v1-7 v1-7 (the-as vector (-> obj chain-joints arg1))) + (vector-! v1-7 v1-7 (the-as vector (-> this chain-joints arg1))) (.lvf vf1 (&-> v1-7 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -1260,21 +1260,21 @@ This commonly includes things such as: (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov a0-17 vf1) (let ((f0-6 (sqrtf a0-17))) - (vector+float*! arg0 arg0 v1-7 (/ (* 1.1 (- f0-6 (-> obj joint-length))) f0-6)) + (vector+float*! arg0 arg0 v1-7 (/ (* 1.1 (- f0-6 (-> this joint-length))) f0-6)) ) (set! v1-11 (cond ((zero? arg1) - (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg2 node-list data (-> obj root-joint-index))) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> arg2 node-list data (-> this root-joint-index))) ) (else (set! v1-11 (new 'stack-no-clear 'vector)) - (set! (-> v1-11 quad) (-> obj chain-joints (+ arg1 -1) position quad)) + (set! (-> v1-11 quad) (-> this chain-joints (+ arg1 -1) position quad)) v1-11 ) ) ) - (vector-! v1-11 v1-11 (the-as vector (-> obj chain-joints arg1))) + (vector-! v1-11 v1-11 (the-as vector (-> this chain-joints arg1))) (.lvf vf1 (&-> v1-11 quad)) (.add.w.vf vf2 vf0 vf0 :mask #b1) (.mul.vf vf1 vf1 vf1) @@ -1283,7 +1283,7 @@ This commonly includes things such as: (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) (.mov a0-26 vf1) (let ((f0-9 (sqrtf a0-26))) - (vector+float*! arg0 arg0 v1-11 (/ (* 1.1 (- f0-9 (-> obj joint-length))) f0-9)) + (vector+float*! arg0 arg0 v1-11 (/ (* 1.1 (- f0-9 (-> this joint-length))) f0-9)) ) ) ) @@ -1294,7 +1294,7 @@ This commonly includes things such as: ;; definition for method 14 of type under-mine-chain-physics ;; WARN: Return type mismatch int vs none. -(defmethod chain-physics-method-14 under-mine-chain-physics ((obj under-mine-chain-physics) (arg0 vector) (arg1 int)) +(defmethod chain-physics-method-14 under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 int)) (vector-reset! arg0) 0 (none) @@ -1303,7 +1303,7 @@ This commonly includes things such as: ;; definition for method 15 of type under-mine-chain-physics ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs vector. -(defmethod clamp-length under-mine-chain-physics ((obj under-mine-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) +(defmethod clamp-length under-mine-chain-physics ((this under-mine-chain-physics) (arg0 vector) (arg1 vector) (arg2 object) (arg3 process-drawable)) (let ((v1-0 (new 'stack-no-clear 'vector))) (set! (-> v1-0 quad) (-> arg3 entity trans quad)) (let ((s5-0 (new 'stack-no-clear 'vector))) @@ -1320,7 +1320,7 @@ This commonly includes things such as: ) ;; definition for method 16 of type under-mine-chain-physics -(defmethod chain-physics-method-16 under-mine-chain-physics ((obj under-mine-chain-physics) (arg0 int)) +(defmethod chain-physics-method-16 under-mine-chain-physics ((this under-mine-chain-physics) (arg0 int)) 21845.334 ) @@ -1343,20 +1343,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-mine -(defmethod inspect under-mine ((obj under-mine)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-mine ((this under-mine)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tchain: ~A~%" (-> obj chain)) - (format #t "~2Tchain-initialized: ~A~%" (-> obj chain-initialized)) - (format #t "~2Tmain-mod: ~A~%" (-> obj main-mod)) - (format #t "~2Thead-mod: ~A~%" (-> obj head-mod)) + (format #t "~2Tchain: ~A~%" (-> this chain)) + (format #t "~2Tchain-initialized: ~A~%" (-> this chain-initialized)) + (format #t "~2Tmain-mod: ~A~%" (-> this main-mod)) + (format #t "~2Thead-mod: ~A~%" (-> this head-mod)) (label cfg-4) - obj + this ) ;; definition for symbol *under-mine-chain-setup*, type (array chain-physics-setup) @@ -1405,7 +1405,7 @@ This commonly includes things such as: (defstate explode (under-mine) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((v1-3 (-> self root root-prim))) (set! (-> v1-3 prim-core collide-as) (collide-spec)) (set! (-> v1-3 prim-core collide-with) (collide-spec)) @@ -1558,30 +1558,30 @@ This commonly includes things such as: ;; definition for method 7 of type under-mine ;; WARN: Return type mismatch process-drawable vs under-mine. -(defmethod relocate under-mine ((obj under-mine) (arg0 int)) - (if (nonzero? (-> obj main-mod)) - (&+! (-> obj main-mod) arg0) +(defmethod relocate under-mine ((this under-mine) (arg0 int)) + (if (nonzero? (-> this main-mod)) + (&+! (-> this main-mod) arg0) ) - (if (nonzero? (-> obj head-mod)) - (&+! (-> obj head-mod) arg0) + (if (nonzero? (-> this head-mod)) + (&+! (-> this head-mod) arg0) ) - (if (nonzero? (-> obj chain)) - (&+! (-> obj chain) arg0) + (if (nonzero? (-> this chain)) + (&+! (-> this chain) arg0) ) - (the-as under-mine ((method-of-type process-drawable relocate) obj arg0)) + (the-as under-mine ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 11 of type under-mine ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-mine ((obj under-mine) (arg0 entity-actor)) +(defmethod init-from-entity! under-mine ((this under-mine) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec enemy camera-blocker)) (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) @@ -1597,34 +1597,34 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) (set! (-> s4-0 event-self) 'touched) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-mine" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj chain-initialized) #f) - (set! (-> obj chain) (new 'process 'under-mine-chain-physics)) - (chain-physics-initialize obj (-> obj chain) 15 1843.2 *under-mine-chain-setup*) - (set! (-> obj chain negate-y) #t) - (set! (-> obj chain axial-slop) 1820.4445) - (set! (-> obj chain maximum-stretch) 100.0) - (set! (-> obj chain stretch-vel) 0.7) - (set! (-> obj chain stretch-vel-parallel) 0.9) - (set! (-> obj chain compress-vel) 0.85) - (set! (-> obj chain compress-vel-parallel) 0.9) - (set! (-> obj main-mod) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 3)) - (set! (-> obj main-mod track-mode) (track-mode no-rotate no-scale)) - (mode-set! (-> obj main-mod) (joint-mod-mode joint-set-world)) - (set! (-> obj main-mod trans quad) (-> obj entity trans quad)) - (set! (-> obj head-mod) (new 'process 'joint-mod (joint-mod-mode flex-blend) obj 15)) - (set! (-> obj head-mod track-mode) (track-mode no-trans no-scale)) - (mode-set! (-> obj head-mod) (joint-mod-mode joint-set*)) - (quaternion-identity! (-> obj head-mod quat)) - (set! (-> obj draw light-index) (the-as uint 10)) - (go (method-of-object obj idle)) + (set! (-> this chain-initialized) #f) + (set! (-> this chain) (new 'process 'under-mine-chain-physics)) + (chain-physics-initialize this (-> this chain) 15 1843.2 *under-mine-chain-setup*) + (set! (-> this chain negate-y) #t) + (set! (-> this chain axial-slop) 1820.4445) + (set! (-> this chain maximum-stretch) 100.0) + (set! (-> this chain stretch-vel) 0.7) + (set! (-> this chain stretch-vel-parallel) 0.9) + (set! (-> this chain compress-vel) 0.85) + (set! (-> this chain compress-vel-parallel) 0.9) + (set! (-> this main-mod) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 3)) + (set! (-> this main-mod track-mode) (track-mode no-rotate no-scale)) + (mode-set! (-> this main-mod) (joint-mod-mode joint-set-world)) + (set! (-> this main-mod trans quad) (-> this entity trans quad)) + (set! (-> this head-mod) (new 'process 'joint-mod (joint-mod-mode flex-blend) this 15)) + (set! (-> this head-mod track-mode) (track-mode no-trans no-scale)) + (mode-set! (-> this head-mod) (joint-mod-mode joint-set*)) + (quaternion-identity! (-> this head-mod quat)) + (set! (-> this draw light-index) (the-as uint 10)) + (go (method-of-object this idle)) (none) ) @@ -1642,17 +1642,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-lift -(defmethod inspect under-lift ((obj under-lift)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-lift ((this under-lift)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type elevator inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1662,25 +1662,25 @@ This commonly includes things such as: ) ;; definition for method 30 of type under-lift -(defmethod get-art-group under-lift ((obj under-lift)) +(defmethod get-art-group under-lift ((this under-lift)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-under-lift" (the-as (pointer uint32) #f)) ) ;; definition for method 43 of type under-lift -(defmethod move-between-points under-lift ((obj under-lift) (arg0 vector) (arg1 float) (arg2 float)) +(defmethod move-between-points under-lift ((this under-lift) (arg0 vector) (arg1 float) (arg2 float)) "Move between two points on the elevator's path @param vec TODO not sure @param point-a The first point fetched from the elevator's path @param point-b The second point fetched from the path @see [[path-control]] and [[elevator]]" - (let ((s4-0 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg1 'interp)) - (a0-3 (get-point-in-path! (-> obj path) (new 'stack-no-clear 'vector) arg2 'interp)) - (v1-3 (-> obj root trans)) + (let ((s4-0 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg1 'interp)) + (a0-3 (get-point-in-path! (-> this path) (new 'stack-no-clear 'vector) arg2 'interp)) + (v1-3 (-> this root trans)) ) (when (and (< (-> a0-3 y) (-> s4-0 y)) (< (-> arg0 y) (+ -8192.0 (-> v1-3 y)))) (let ((s4-2 (vector-! (new 'stack-no-clear 'vector) arg0 v1-3))) - (vector-inv-orient-by-quat! s4-2 s4-2 (-> obj root quat)) + (vector-inv-orient-by-quat! s4-2 s4-2 (-> this root quat)) (and (< (fabs (-> s4-2 x)) 24576.0) (< 0.0 (-> s4-2 z)) (< (-> s4-2 z) 49152.0)) ) ) @@ -1688,7 +1688,7 @@ This commonly includes things such as: ) ;; definition for method 45 of type under-lift -(defmethod commited-to-ride? under-lift ((obj under-lift)) +(defmethod commited-to-ride? under-lift ((this under-lift)) "@returns if the target is considered within the elevator area enough to begin descending/ascending" (let* ((gp-0 *target*) (a0-2 (if (type? gp-0 process-focusable) @@ -1698,9 +1698,9 @@ This commonly includes things such as: ) (when a0-2 (let* ((v1-1 (get-trans a0-2 0)) - (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> obj root trans))) + (gp-2 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this root trans))) ) - (vector-inv-orient-by-quat! gp-2 gp-2 (-> obj root quat)) + (vector-inv-orient-by-quat! gp-2 gp-2 (-> this root quat)) (and (< (fabs (-> gp-2 x)) 20480.0) (< 0.0 (-> gp-2 z)) (< (-> gp-2 z) 40960.0)) ) ) @@ -1709,8 +1709,8 @@ This commonly includes things such as: ;; definition for method 49 of type under-lift ;; WARN: Return type mismatch int vs none. -(defmethod under-lift-method-49 under-lift ((obj under-lift) (arg0 symbol)) - (let ((v1-3 (-> (the-as collide-shape-prim-group (-> obj root root-prim)) child 1))) +(defmethod under-lift-method-49 under-lift ((this under-lift) (arg0 symbol)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) (cond (arg0 (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle pusher)) @@ -1773,27 +1773,27 @@ This commonly includes things such as: ) ;; definition for method 10 of type under-lift -(defmethod deactivate under-lift ((obj under-lift)) - (sound-stop (-> obj sound-id)) - ((the-as (function process-drawable none) (find-parent-method under-lift 10)) obj) +(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) (none) ) ;; definition for method 33 of type under-lift ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! under-lift ((obj under-lift)) +(defmethod init-plat! under-lift ((this under-lift)) "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." - (set! (-> obj sound-id) (new-sound-id)) - (set! (-> obj draw light-index) (the-as uint 4)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this draw light-index) (the-as uint 4)) 0 (none) ) ;; definition for method 31 of type under-lift -(defmethod init-plat-collision! under-lift ((obj under-lift)) +(defmethod init-plat-collision! under-lift ((this under-lift)) "TODO - collision stuff for setting up the platform" - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-default) (set! (-> s5-0 no-reaction) @@ -1826,9 +1826,9 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> s5-0 backup-collide-as) (-> v1-20 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-20 prim-core collide-with)) ) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) - (under-lift-method-49 obj #f) + (under-lift-method-49 this #f) (none) ) @@ -1849,19 +1849,19 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 3 of type under-break-door -(defmethod inspect under-break-door ((obj under-break-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-break-door ((this under-break-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tanim: ~A~%" (-> obj anim)) - (format #t "~2Tart-name: ~A~%" (-> obj art-name)) - (format #t "~2Tcollide-mesh: ~D~%" (-> obj collide-mesh)) + (format #t "~2Tanim: ~A~%" (-> this anim)) + (format #t "~2Tart-name: ~A~%" (-> this art-name)) + (format #t "~2Tcollide-mesh: ~D~%" (-> this collide-mesh)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1921,17 +1921,17 @@ For example for an elevator pre-compute the distance between the first and last ;; definition for method 11 of type under-break-door ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-door ((obj under-break-door) (arg0 entity-actor)) +(defmethod init-from-entity! under-break-door ((this under-break-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (stack-size-set! (-> obj main-thread) 512) - (logior! (-> obj mask) (process-mask collectable)) + (stack-size-set! (-> this main-thread) 512) + (logior! (-> this mask) (process-mask collectable)) (let ((s3-0 ((method-of-type res-lump get-property-struct) - (-> obj entity) + (-> this entity) 'art-name 'interp -1000000000.0 @@ -1942,8 +1942,8 @@ This commonly includes things such as: ) (s4-0 (art-group-get-by-name *level* "skel-under-break-door" (the-as (pointer uint32) #f))) ) - (set! (-> obj art-name) (the-as string s3-0)) - (let ((s2-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this art-name) (the-as string s3-0)) + (let ((s2-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-8 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list)) @@ -1958,35 +1958,35 @@ This commonly includes things such as: (set! (-> s2-0 backup-collide-as) (-> v1-11 prim-core collide-as)) (set! (-> s2-0 backup-collide-with) (-> v1-11 prim-core collide-with)) ) - (set! (-> obj root) s2-0) + (set! (-> this root) s2-0) ) (cond - ((string= (-> obj art-name) "under-break-door-1") - (set! (-> obj anim) + ((string= (-> this art-name) "under-break-door-1") + (set! (-> this anim) (the-as art-joint-anim (new 'static 'spool-anim :name "under-break-door-1" :anim-name "1-break" :parts 1 :command-list '()) ) ) ) - ((string= (-> obj art-name) "under-break-door-2") - (set! (-> obj anim) + ((string= (-> this art-name) "under-break-door-2") + (set! (-> this anim) (the-as art-joint-anim (new 'static 'spool-anim :name "under-break-door-2" :anim-name "2-break" :parts 1 :command-list '()) ) ) ) - ((string= (-> obj art-name) "under-break-door-3") - (set! (-> obj anim) + ((string= (-> this art-name) "under-break-door-3") + (set! (-> this anim) (the-as art-joint-anim (new 'static 'spool-anim :name "under-break-door-3" :anim-name "3-break" :parts 2 :command-list '()) ) ) ) - ((string= (-> obj art-name) "under-break-door-4") - (set! (-> obj anim) + ((string= (-> this art-name) "under-break-door-4") + (set! (-> this anim) (the-as art-joint-anim (new 'static 'spool-anim :name "under-break-door-4" :anim-name "4-break" :parts 1 :command-list '()) @@ -1997,21 +1997,21 @@ This commonly includes things such as: (go process-drawable-art-error (the-as string s3-0)) ) ) - (process-drawable-from-entity! obj arg0) - (initialize-skeleton obj (the-as skeleton-group s4-0) (the-as pair 0)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton this (the-as skeleton-group s4-0) (the-as pair 0)) ) (ja-channel-set! 1) - (let* ((s5-1 (-> obj skel root-channel 0)) - (s4-1 (-> obj draw art-group)) + (let* ((s5-1 (-> this skel root-channel 0)) + (s4-1 (-> this draw art-group)) (s3-1 (method-of-object s4-1 get-art-by-name-method)) ) - (format (clear *temp-string*) "~S-idle" (-> obj art-name)) + (format (clear *temp-string*) "~S-idle" (-> this art-name)) (set! (-> s5-1 frame-group) (the-as art-joint-anim (s3-1 s4-1 *temp-string* (the-as type #f)))) ) - (set! (-> obj draw light-index) (the-as uint 10)) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj hit) #t) - (go (method-of-object obj idle)) + (set! (-> this draw light-index) (the-as uint 10)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this hit) #t) + (go (method-of-object this idle)) ) (none) ) @@ -2029,16 +2029,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-seaweed-a -(defmethod inspect under-seaweed-a ((obj under-seaweed-a)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-seaweed-a ((this under-seaweed-a)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2068,14 +2068,14 @@ This commonly includes things such as: ;; definition for method 11 of type under-seaweed-a ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-a ((obj under-seaweed-a) (arg0 entity-actor)) +(defmethod init-from-entity! under-seaweed-a ((this under-seaweed-a) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s4-0 reaction) cshape-reaction-default) (set! (-> s4-0 no-reaction) @@ -2120,15 +2120,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-24 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-24 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-a" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2145,16 +2145,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-seaweed-b -(defmethod inspect under-seaweed-b ((obj under-seaweed-b)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-seaweed-b ((this under-seaweed-b)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2184,21 +2184,21 @@ This commonly includes things such as: ;; definition for method 11 of type under-seaweed-b ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-b ((obj under-seaweed-b) (arg0 entity-actor)) +(defmethod init-from-entity! under-seaweed-b ((this under-seaweed-b) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-b" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2215,16 +2215,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-seaweed-c -(defmethod inspect under-seaweed-c ((obj under-seaweed-c)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-seaweed-c ((this under-seaweed-c)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2254,21 +2254,21 @@ This commonly includes things such as: ;; definition for method 11 of type under-seaweed-c ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-c ((obj under-seaweed-c) (arg0 entity-actor)) +(defmethod init-from-entity! under-seaweed-c ((this under-seaweed-c) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-c" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -2285,16 +2285,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-seaweed-d -(defmethod inspect under-seaweed-d ((obj under-seaweed-d)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-seaweed-d ((this under-seaweed-d)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -2324,69 +2324,69 @@ This commonly includes things such as: ;; definition for method 11 of type under-seaweed-d ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-seaweed-d ((obj under-seaweed-d) (arg0 entity-actor)) +(defmethod init-from-entity! under-seaweed-d ((this under-seaweed-d) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-seaweed-d" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) ;; definition for method 15 of type hud-mech-air-tank ;; WARN: Return type mismatch int vs none. -(defmethod draw hud-mech-air-tank ((obj hud-mech-air-tank)) +(defmethod draw hud-mech-air-tank ((this hud-mech-air-tank)) (set-hud-piece-position! - (the-as hud-sprite (-> obj sprites)) - (the int (+ 472.0 (* 100.0 (-> obj offset)))) + (the-as hud-sprite (-> this sprites)) + (the int (+ 472.0 (* 100.0 (-> this offset)))) 208 ) - (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) 0 51) - (set! (-> obj sprites 0 scale-x) 0.8) - (set! (-> obj sprites 0 scale-y) 0.8) - (set! (-> obj sprites 1 scale-x) 0.8) - (set! (-> obj sprites 1 scale-y) 0.8) - (set! (-> obj sprites 3 scale-x) 0.8) - (set! (-> obj sprites 3 scale-y) 0.8) - (set! (-> obj sprites 2 scale-x) 3.2) - (set! (-> obj sprites 2 scale-y) (* 4.56 (- 1.0 (-> *game-info* air-supply)))) - (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites)) 0 2) - (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites)) -30 -20) - ((method-of-type hud draw) obj) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 0 51) + (set! (-> this sprites 0 scale-x) 0.8) + (set! (-> this sprites 0 scale-y) 0.8) + (set! (-> this sprites 1 scale-x) 0.8) + (set! (-> this sprites 1 scale-y) 0.8) + (set! (-> this sprites 3 scale-x) 0.8) + (set! (-> this sprites 3 scale-y) 0.8) + (set! (-> this sprites 2 scale-x) 3.2) + (set! (-> this sprites 2 scale-y) (* 4.56 (- 1.0 (-> *game-info* air-supply)))) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) 0 2) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) -30 -20) + ((method-of-type hud draw) this) 0 (none) ) ;; definition for method 16 of type hud-mech-air-tank ;; WARN: Return type mismatch int vs none. -(defmethod update-values hud-mech-air-tank ((obj hud-mech-air-tank)) - (set! (-> obj values 0 target) (the int (-> *game-info* air-supply))) - (logclear! (-> obj flags) (hud-flags disable)) - ((method-of-type hud update-values) obj) +(defmethod update-values hud-mech-air-tank ((this hud-mech-air-tank)) + (set! (-> this values 0 target) (the int (-> *game-info* air-supply))) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values) this) 0 (none) ) ;; definition for method 17 of type hud-mech-air-tank ;; WARN: Return type mismatch int vs none. -(defmethod init-callback hud-mech-air-tank ((obj hud-mech-air-tank)) - (set! (-> obj gui-id) - (add-process *gui-control* obj (gui-channel hud-middle-right) (gui-action hidden) (-> obj name) 81920.0 0) +(defmethod init-callback hud-mech-air-tank ((this hud-mech-air-tank)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) ) - (logior! (-> obj flags) (hud-flags show)) - (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xd55))) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xd55))) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xd55))) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd55))) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #xd55))) + (set! (-> this sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xd55))) + (set! (-> this sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xd55))) + (set! (-> this sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd55))) 0 (none) ) diff --git a/test/decompiler/reference/jak2/levels/under/under-part_REF.gc b/test/decompiler/reference/jak2/levels/under/under-part_REF.gc index 4599ca3ab7..2d33da6147 100644 --- a/test/decompiler/reference/jak2/levels/under/under-part_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-part_REF.gc @@ -11,16 +11,16 @@ ) ;; definition for method 3 of type under-part -(defmethod inspect under-part ((obj under-part)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-part ((this under-part)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type part-spawner inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: 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 a7f4129785..ad8ce908ba 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 @@ -15,19 +15,19 @@ ) ;; definition for method 3 of type under-block-spawner -(defmethod inspect under-block-spawner ((obj under-block-spawner)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-block-spawner ((this under-block-spawner)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcol: ~D~%" (-> obj col)) - (format #t "~1Trow: ~D~%" (-> obj row)) - (format #t "~1Tactive-handle: ~D~%" (-> obj active-handle)) - (format #t "~1Twaiting-handle: ~D~%" (-> obj waiting-handle)) - (format #t "~1Texploded-time: ~D~%" (-> obj exploded-time)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcol: ~D~%" (-> this col)) + (format #t "~1Trow: ~D~%" (-> this row)) + (format #t "~1Tactive-handle: ~D~%" (-> this active-handle)) + (format #t "~1Twaiting-handle: ~D~%" (-> this waiting-handle)) + (format #t "~1Texploded-time: ~D~%" (-> this exploded-time)) (label cfg-4) - obj + this ) ;; definition of type under-block-slot @@ -41,16 +41,16 @@ ) ;; definition for method 3 of type under-block-slot -(defmethod inspect under-block-slot ((obj under-block-slot)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-block-slot ((this under-block-slot)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tcol: ~D~%" (-> obj col)) - (format #t "~1Trow: ~D~%" (-> obj row)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcol: ~D~%" (-> this col)) + (format #t "~1Trow: ~D~%" (-> this row)) (label cfg-4) - obj + this ) ;; definition of type under-block-puzzle @@ -76,28 +76,28 @@ ) ;; definition for method 3 of type under-block-puzzle -(defmethod inspect under-block-puzzle ((obj under-block-puzzle)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-block-puzzle ((this under-block-puzzle)) + (when (not this) + (set! this this) (goto cfg-4) ) - (format #t "[~8x] ~A~%" obj (-> obj type)) - (format #t "~1Tauto-unlock?: ~A~%" (-> obj auto-unlock?)) - (format #t "~1Tcells-wide: ~D~%" (-> obj cells-wide)) - (format #t "~1Tcells-tall: ~D~%" (-> obj cells-tall)) - (format #t "~1Tlast-block-id: ~D~%" (-> obj last-block-id)) - (format #t "~1Tslot-mask: ~D~%" (-> obj slot-mask)) - (format #t "~1Tslot-mask-full: ~D~%" (-> obj slot-mask-full)) - (format #t "~1Tprev-special-attack-id: ~D~%" (-> obj prev-special-attack-id)) - (format #t "~1Torient-ry: ~f~%" (-> obj orient-ry)) - (format #t "~1Tspawners: ~A~%" (-> obj spawners)) - (format #t "~1Tslots: ~A~%" (-> obj slots)) - (format #t "~1Tcells: #x~X~%" (-> obj cells)) - (format #t "~1Tpulse-ops: #x~X~%" (-> obj pulse-ops)) - (format #t "~1Torigin: #~%" (-> obj origin)) - (format #t "~1Tlocal-to-world: #~%" (-> obj local-to-world)) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tauto-unlock?: ~A~%" (-> this auto-unlock?)) + (format #t "~1Tcells-wide: ~D~%" (-> this cells-wide)) + (format #t "~1Tcells-tall: ~D~%" (-> this cells-tall)) + (format #t "~1Tlast-block-id: ~D~%" (-> this last-block-id)) + (format #t "~1Tslot-mask: ~D~%" (-> this slot-mask)) + (format #t "~1Tslot-mask-full: ~D~%" (-> this slot-mask-full)) + (format #t "~1Tprev-special-attack-id: ~D~%" (-> this prev-special-attack-id)) + (format #t "~1Torient-ry: ~f~%" (-> this orient-ry)) + (format #t "~1Tspawners: ~A~%" (-> this spawners)) + (format #t "~1Tslots: ~A~%" (-> this slots)) + (format #t "~1Tcells: #x~X~%" (-> this cells)) + (format #t "~1Tpulse-ops: #x~X~%" (-> this pulse-ops)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tlocal-to-world: #~%" (-> this local-to-world)) (label cfg-4) - obj + this ) ;; definition for symbol *under-block-puzzles*, type (array under-block-puzzle) @@ -720,34 +720,34 @@ ) ;; definition for method 3 of type under-block -(defmethod inspect under-block ((obj under-block)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-block ((this under-block)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-focusable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpuzzle: ~A~%" (-> obj puzzle)) - (format #t "~2Tmy-parent: #x~X~%" (-> obj my-parent)) - (format #t "~2Tprev-attack-id: ~D~%" (-> obj prev-attack-id)) - (format #t "~2Tspawner-id: ~D~%" (-> obj spawner-id)) - (format #t "~2Tmy-id: ~D~%" (-> obj my-id)) - (format #t "~2Tcol: ~D~%" (-> obj col)) - (format #t "~2Trow: ~D~%" (-> obj row)) - (format #t "~2Tprev-col: ~D~%" (-> obj prev-col)) - (format #t "~2Tprev-row: ~D~%" (-> obj prev-row)) - (format #t "~2Tmove-dir-x: ~D~%" (-> obj move-dir-x)) - (format #t "~2Tmove-dir-z: ~D~%" (-> obj move-dir-z)) - (format #t "~2Tpulse-op: ~D~%" (-> obj pulse-op)) - (format #t "~2Tpulse-pc: ~D~%" (-> obj pulse-pc)) - (format #t "~2Tpulse-ctr: ~D~%" (-> obj pulse-ctr)) - (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tactivated-time: ~D~%" (-> obj activated-time)) - (format #t "~2Trot-axis: #~%" (-> obj rot-axis)) - (format #t "~2Taway-from-focal-pt: #~%" (-> obj away-from-focal-pt)) + (format #t "~2Tpuzzle: ~A~%" (-> this puzzle)) + (format #t "~2Tmy-parent: #x~X~%" (-> this my-parent)) + (format #t "~2Tprev-attack-id: ~D~%" (-> this prev-attack-id)) + (format #t "~2Tspawner-id: ~D~%" (-> this spawner-id)) + (format #t "~2Tmy-id: ~D~%" (-> this my-id)) + (format #t "~2Tcol: ~D~%" (-> this col)) + (format #t "~2Trow: ~D~%" (-> this row)) + (format #t "~2Tprev-col: ~D~%" (-> this prev-col)) + (format #t "~2Tprev-row: ~D~%" (-> this prev-row)) + (format #t "~2Tmove-dir-x: ~D~%" (-> this move-dir-x)) + (format #t "~2Tmove-dir-z: ~D~%" (-> this move-dir-z)) + (format #t "~2Tpulse-op: ~D~%" (-> this pulse-op)) + (format #t "~2Tpulse-pc: ~D~%" (-> this pulse-pc)) + (format #t "~2Tpulse-ctr: ~D~%" (-> this pulse-ctr)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tactivated-time: ~D~%" (-> this activated-time)) + (format #t "~2Trot-axis: #~%" (-> this rot-axis)) + (format #t "~2Taway-from-focal-pt: #~%" (-> this away-from-focal-pt)) (label cfg-4) - obj + this ) ;; definition of type under-shoot-block @@ -774,20 +774,20 @@ ) ;; definition for method 3 of type under-shoot-block -(defmethod inspect under-shoot-block ((obj under-shoot-block)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-shoot-block ((this under-shoot-block)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tpuzzle: ~A~%" (-> obj puzzle)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (format #t "~2Tallow-unlock?: ~A~%" (-> obj allow-unlock?)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) + (format #t "~2Tpuzzle: ~A~%" (-> this puzzle)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (format #t "~2Tallow-unlock?: ~A~%" (-> this allow-unlock?)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) (label cfg-4) - obj + this ) ;; definition for function under-block-event-handler @@ -890,12 +890,12 @@ ) ;; definition for method 48 of type under-block -(defmethod under-block-method-48 under-block ((obj under-block) (arg0 int) (arg1 int)) - (let ((v1-0 (-> obj puzzle))) +(defmethod under-block-method-48 under-block ((this under-block) (arg0 int) (arg1 int)) + (let ((v1-0 (-> this puzzle))) (when (and (>= arg0 0) (< arg0 (-> v1-0 cells-wide)) (>= arg1 0) (< arg1 (-> v1-0 cells-tall))) (let* ((a1-1 (+ (* arg1 (-> v1-0 cells-wide)) arg0)) (a2-4 (-> (the-as (pointer int8) (&+ (-> v1-0 cells) a1-1)))) - (a0-1 (-> obj my-id)) + (a0-1 (-> this my-id)) ) (when (or (zero? a2-4) (= a2-4 a0-1)) (set! (-> (the-as (pointer int8) (&+ (-> v1-0 cells) a1-1))) a0-1) @@ -908,11 +908,11 @@ ;; definition for method 46 of type under-block ;; WARN: Return type mismatch int vs none. -(defmethod under-block-method-46 under-block ((obj under-block) (arg0 int) (arg1 int)) - (let ((v1-0 (-> obj puzzle))) +(defmethod under-block-method-46 under-block ((this under-block) (arg0 int) (arg1 int)) + (let ((v1-0 (-> this puzzle))) (when (and (>= arg0 0) (< arg0 (-> v1-0 cells-wide)) (>= arg1 0) (< arg1 (-> v1-0 cells-tall))) (let ((a1-1 (+ (* arg1 (-> v1-0 cells-wide)) arg0))) - (when (= (-> (the-as (pointer int8) (&+ (-> v1-0 cells) a1-1))) (-> obj my-id)) + (when (= (-> (the-as (pointer int8) (&+ (-> v1-0 cells) a1-1))) (-> this my-id)) (set! (-> (the-as (pointer int8) (&+ (-> v1-0 cells) a1-1))) 0) 0 ) @@ -923,8 +923,8 @@ ) ;; definition for method 47 of type under-block -(defmethod under-block-method-47 under-block ((obj under-block) (arg0 int) (arg1 int)) - (let ((v1-0 (-> obj puzzle)) +(defmethod under-block-method-47 under-block ((this under-block) (arg0 int) (arg1 int)) + (let ((v1-0 (-> this puzzle)) (v0-0 -1) ) (when (and (>= arg0 0) (< arg0 (-> v1-0 cells-wide)) (>= arg1 0) (< arg1 (-> v1-0 cells-tall))) @@ -937,25 +937,25 @@ ) ;; definition for method 43 of type under-block -(defmethod under-block-method-43 under-block ((obj under-block) (arg0 int) (arg1 int)) - (let ((v1-3 (under-block-method-47 obj (+ (-> obj col) arg0) (+ (-> obj row) arg1)))) - (or (zero? v1-3) (= v1-3 -2) (= v1-3 (-> obj my-id))) +(defmethod under-block-method-43 under-block ((this under-block) (arg0 int) (arg1 int)) + (let ((v1-3 (under-block-method-47 this (+ (-> this col) arg0) (+ (-> this row) arg1)))) + (or (zero? v1-3) (= v1-3 -2) (= v1-3 (-> this my-id))) ) ) ;; definition for method 49 of type under-block -(defmethod under-block-method-49 under-block ((obj under-block) (arg0 int) (arg1 int)) - (= (under-block-method-47 obj (+ (-> obj col) arg0) (+ (-> obj row) arg1)) -1) +(defmethod under-block-method-49 under-block ((this under-block) (arg0 int) (arg1 int)) + (= (under-block-method-47 this (+ (-> this col) arg0) (+ (-> this row) arg1)) -1) ) ;; definition for method 44 of type under-block -(defmethod under-block-method-44 under-block ((obj under-block)) - (let ((v1-0 (-> obj puzzle)) - (a2-0 (-> obj puzzle slots)) +(defmethod under-block-method-44 under-block ((this under-block)) + (let ((v1-0 (-> this puzzle)) + (a2-0 (-> this puzzle slots)) ) (countdown (a1-1 (-> a2-0 length)) (let ((a3-2 (-> a2-0 a1-1))) - (when (and (= (-> a3-2 col) (-> obj col)) (= (-> a3-2 row) (-> obj row))) + (when (and (= (-> a3-2 col) (-> this col)) (= (-> a3-2 row) (-> this row))) (logior! (-> v1-0 slot-mask) (ash 1 a1-1)) (return #t) ) @@ -967,11 +967,11 @@ ;; definition for method 42 of type under-block ;; WARN: Return type mismatch int vs none. -(defmethod under-block-method-42 under-block ((obj under-block)) - (set! (-> obj activated-time) (current-time)) - (logior! (-> obj flags) (under-block-flags unbflags-1)) - (set! (-> obj pulse-pc) 0) - (set! (-> obj pulse-op) 0) +(defmethod under-block-method-42 under-block ((this under-block)) + (set-time! (-> this activated-time)) + (logior! (-> this flags) (under-block-flags unbflags-1)) + (set! (-> this pulse-pc) 0) + (set! (-> this pulse-op) 0) 0 (none) ) @@ -979,48 +979,50 @@ ;; definition for method 45 of type under-block ;; WARN: Return type mismatch object vs none. ;; WARN: Function (method 45 under-block) has a return type of none, but the expression builder found a return statement. -(defmethod under-block-method-45 under-block ((obj under-block)) - (let ((v1-0 (-> obj puzzle))) - (when (logtest? (-> obj flags) (under-block-flags unbflags-1)) +(defmethod under-block-method-45 under-block ((this under-block)) + (let ((v1-0 (-> this puzzle))) + (when (logtest? (-> this flags) (under-block-flags unbflags-1)) (cond ((!= (-> v1-0 slot-mask) (-> v1-0 slot-mask-full)) - (when (zero? (-> obj pulse-op)) - (if (< (- (current-time) (-> obj activated-time)) - (the-as time-frame (-> (the-as (pointer uint32) (&+ (-> obj puzzle pulse-ops) (* (-> obj pulse-pc) 4))))) - ) + (when (zero? (-> this pulse-op)) + (if (not (time-elapsed? + (-> this activated-time) + (the-as time-frame (-> (the-as (pointer uint32) (&+ (-> this puzzle pulse-ops) (* (-> this pulse-pc) 4))))) + ) + ) (return #f) ) - (set! (-> obj pulse-op) - (the-as int (-> (the-as (pointer uint32) (&+ (-> obj puzzle pulse-ops) (* (+ (-> obj pulse-pc) 1) 4))))) + (set! (-> this pulse-op) + (the-as int (-> (the-as (pointer uint32) (&+ (-> this puzzle pulse-ops) (* (+ (-> this pulse-pc) 1) 4))))) ) - (+! (-> obj pulse-pc) 2) - (case (-> obj pulse-op) + (+! (-> this pulse-pc) 2) + (case (-> this pulse-op) ((1) - (set! (-> obj pulse-ctr) 3) + (set! (-> this pulse-ctr) 3) (sound-play "und-block-flash") ) ((2) - (go (method-of-object obj explode)) + (go (method-of-object this explode)) ) ) ) - (case (-> obj pulse-op) + (case (-> this pulse-op) ((1) - (let ((v1-24 (-> obj pulse-ctr))) + (let ((v1-24 (-> this pulse-ctr))) (cond ((= v1-24 3) - (set-vector! (-> obj draw color-mult) 1.1 0.25 0.25 1.0) - (+! (-> obj pulse-ctr) -1) + (set-vector! (-> this draw color-mult) 1.1 0.25 0.25 1.0) + (+! (-> this pulse-ctr) -1) ) ((or (= v1-24 2) (= v1-24 1)) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj draw color-emissive) 1.0 1.0 1.0 1.0) - (+! (-> obj pulse-ctr) -1) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this draw color-emissive) 1.0 1.0 1.0 1.0) + (+! (-> this pulse-ctr) -1) ) ((zero? v1-24) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj draw color-emissive) 0.0 0.0 0.0 1.0) - (set! (-> obj pulse-op) 0) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 0.0 0.0 1.0) + (set! (-> this pulse-op) 0) 0 ) ) @@ -1029,9 +1031,9 @@ ) ) (else - (logclear! (-> obj flags) (under-block-flags unbflags-1)) - (set-vector! (-> obj draw color-mult) 1.0 1.0 1.0 1.0) - (set-vector! (-> obj draw color-emissive) 0.0 0.0 0.0 1.0) + (logclear! (-> this flags) (under-block-flags unbflags-1)) + (set-vector! (-> this draw color-mult) 1.0 1.0 1.0 1.0) + (set-vector! (-> this draw color-emissive) 0.0 0.0 0.0 1.0) ) ) ) @@ -1041,8 +1043,8 @@ ;; definition for method 41 of type under-block ;; WARN: Return type mismatch int vs none. -(defmethod under-block-method-41 under-block ((obj under-block) (arg0 symbol)) - (let ((v1-1 (-> obj root root-prim))) +(defmethod under-block-method-41 under-block ((this under-block) (arg0 symbol)) + (let ((v1-1 (-> this root root-prim))) (case arg0 (('active) (set! (-> (the-as collide-shape-prim-group v1-1) child 0 prim-core collide-as) (collide-spec obstacle pusher)) @@ -1312,19 +1314,22 @@ ;; definition for method 50 of type under-block ;; INFO: Used lq/sq -(defmethod under-block-method-50 under-block ((obj under-block)) +(defmethod under-block-method-50 under-block ((this under-block)) (with-pp (let ((s5-0 - (new 'stack 'joint-exploder-tuning (the-as uint (if (logtest? (-> obj flags) (under-block-flags unbflags-2)) - 1 - 0 - ) - ) - ) + (new + 'stack + 'joint-exploder-tuning + (the-as uint (if (logtest? (-> this flags) (under-block-flags unbflags-2)) + 1 + 0 + ) + ) + ) ) ) - (when (logtest? (-> obj flags) (under-block-flags unbflags-2)) - (set! (-> s5-0 fountain-rand-transv-lo quad) (-> obj away-from-focal-pt quad)) + (when (logtest? (-> this flags) (under-block-flags unbflags-2)) + (set! (-> s5-0 fountain-rand-transv-lo quad) (-> this away-from-focal-pt quad)) (set! (-> s5-0 fountain-rand-transv-hi x) 24576.0) (set! (-> s5-0 fountain-rand-transv-hi y) 49152.0) (set! (-> s5-0 fountain-rand-transv-hi z) 10240.0) @@ -1336,20 +1341,20 @@ 5 s5-0 *under-shoot-block-exploder-params* - :to obj + :to this ) ) - (if (>= 204800.0 (vector-vector-distance (target-pos 0) (-> obj root trans))) + (if (>= 204800.0 (vector-vector-distance (target-pos 0) (-> this root trans))) (activate! *camera-smush-control* 409.6 37 210 1.0 0.995 (-> pp clock)) ) (let ((s5-2 (new 'stack-no-clear 'explosion-init-params))) - (set! (-> s5-2 spawn-point quad) (-> obj root trans quad)) - (quaternion-copy! (-> s5-2 spawn-quat) (-> obj root quat)) + (set! (-> s5-2 spawn-point quad) (-> this root trans quad)) + (quaternion-copy! (-> s5-2 spawn-quat) (-> this root quat)) (set! (-> s5-2 radius) 16384.0) (set! (-> s5-2 group) (-> *part-group-id-table* 497)) (set! (-> s5-2 collide-with) (collide-spec jak bot player-list)) (set! (-> s5-2 penetrate-using) (penetrate explode)) - (explosion-spawn obj explosion s5-2) + (explosion-spawn this explosion s5-2) ) (none) ) @@ -1376,7 +1381,7 @@ (suspend) ) (under-block-method-41 self 'active) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "und-block-rise") (let ((gp-1 (new 'stack-no-clear 'matrix))) (set! (-> gp-1 vector 0 quad) (-> self root trans quad)) @@ -1401,7 +1406,7 @@ :trans rider-trans :code (behavior () (logclear! (-> self flags) (under-block-flags unbflags-0)) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set! (-> gp-0 vector 0 quad) (-> self root trans quad)) (set! (-> gp-0 vector 1 quad) (-> gp-0 vector 0 quad)) @@ -1497,7 +1502,7 @@ (the-as quaternion (-> gp-1 vector 2)) (the-as quaternion (-> gp-1 trans)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (let ((f30-0 (fmin 1.0 (* 0.022222223 (the float (- (current-time) (-> self state-time))))))) (let ((s5-1 (-> self root))) @@ -1583,7 +1588,7 @@ (the-as quaternion (-> gp-1 vector 2)) (the-as quaternion (-> gp-1 trans)) ) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (let ((f30-0 (fmin 1.0 (* 0.0074074073 (the float (- (current-time) (-> self state-time))))))) (let ((s5-1 (-> self root))) @@ -1606,7 +1611,7 @@ ) #f (label cfg-5) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (until #f (let* ((f1-9 (fmin 1.0 (* 0.0074074073 (the float (- (current-time) (-> self state-time)))))) (s5-2 (-> self root)) @@ -1644,7 +1649,7 @@ (under-block-method-45 self) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "und-block-lock") (let ((gp-1 (new 'stack-no-clear 'matrix))) (set! (-> gp-1 vector 0 quad) (-> self root trans quad)) @@ -1678,7 +1683,7 @@ (under-block-method-45 self) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (sound-play "und-block-sink") (let ((gp-1 (new 'stack-no-clear 'matrix))) (set! (-> gp-1 vector 0 quad) (-> self root trans quad)) @@ -1719,13 +1724,13 @@ (under-block-method-45 self) ) :code (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (let ((gp-0 (new 'stack-no-clear 'quaternion)) (s5-0 (new 'stack-no-clear 'quaternion)) (f30-0 0.0) ) (quaternion-copy! gp-0 (-> self root quat)) - (while (< (- (current-time) (-> self state-time)) (seconds 1.25)) + (while (not (time-elapsed? (-> self state-time) (seconds 1.25))) (+! f30-0 (* 65536.0 (seconds-per-frame))) (quaternion-vector-angle! s5-0 (-> self rot-axis) (- f30-0)) (quaternion*! (-> self root quat) s5-0 gp-0) @@ -1746,7 +1751,7 @@ (fill-cache-integrate-and-collide gp-0 (-> gp-0 transv) a2-0 (meters 0)) ) (when (and (logtest? (-> (the-as collide-shape-moving gp-0) status) (collide-status touch-surface)) - (>= (- (current-time) (-> self state-time)) (seconds 0.01)) + (time-elapsed? (-> self state-time) (seconds 0.01)) ) (logior! (-> self flags) (under-block-flags unbflags-2)) (go-virtual explode) @@ -1931,7 +1936,7 @@ ;; definition for method 25 of type under-shoot-block ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-25 under-shoot-block ((obj under-shoot-block) (arg0 int) (arg1 int) (arg2 float) (arg3 int)) +(defmethod under-shoot-block-method-25 under-shoot-block ((this under-shoot-block) (arg0 int) (arg1 int) (arg2 float) (arg3 int)) (let ((gp-0 (new 'stack-no-clear 'matrix))) (set-vector! (-> gp-0 vector 0) -8192.0 0.0 -8192.0 1.0) (set-vector! (-> gp-0 vector 1) -8192.0 0.0 8192.0 1.0) @@ -1951,7 +1956,7 @@ (vector+! (-> gp-0 vector 1) (-> gp-0 vector 1) (the-as vector (&+ gp-0 64))) (vector+! (-> gp-0 vector 2) (-> gp-0 vector 2) (the-as vector (&+ gp-0 64))) (vector+! (-> gp-0 trans) (-> gp-0 trans) (the-as vector (&+ gp-0 64))) - (let ((s4-0 (-> obj puzzle local-to-world))) + (let ((s4-0 (-> this puzzle local-to-world))) (vector-matrix*! (the-as vector (-> gp-0 vector)) (the-as vector (-> gp-0 vector)) s4-0) (vector-matrix*! (-> gp-0 vector 1) (-> gp-0 vector 1) s4-0) (vector-matrix*! (-> gp-0 vector 2) (-> gp-0 vector 2) s4-0) @@ -1998,15 +2003,15 @@ ) ;; definition for method 24 of type under-shoot-block -(defmethod under-shoot-block-method-24 under-shoot-block ((obj under-shoot-block) (arg0 int) (arg1 int)) +(defmethod under-shoot-block-method-24 under-shoot-block ((this under-shoot-block) (arg0 int) (arg1 int)) (local-vars (v1-11 symbol) (v1-20 symbol)) - (let ((a0-1 (-> obj puzzle))) + (let ((a0-1 (-> this puzzle))) (if (>= (-> (the-as (pointer int8) (&+ (-> a0-1 cells) (+ (* arg1 (-> a0-1 cells-wide)) arg0)))) 0) - (under-shoot-block-method-25 obj arg0 arg1 1.0 (the-as int (the-as uint #x80ffffff))) - (under-shoot-block-method-25 obj arg0 arg1 0.95 (shl #x8000 16)) + (under-shoot-block-method-25 this arg0 arg1 1.0 (the-as int (the-as uint #x80ffffff))) + (under-shoot-block-method-25 this arg0 arg1 0.95 (shl #x8000 16)) ) ) - (let ((v1-9 (-> obj puzzle spawners))) + (let ((v1-9 (-> this puzzle spawners))) (countdown (a0-7 (-> v1-9 length)) (let ((a1-5 (-> v1-9 a0-7))) (when (and (= (-> a1-5 col) arg0) (= (-> a1-5 row) arg1)) @@ -2019,9 +2024,9 @@ (set! v1-11 #f) (label cfg-12) (if v1-11 - (under-shoot-block-method-25 obj arg0 arg1 0.6 (the-as int (the-as uint #x8000ffff))) + (under-shoot-block-method-25 this arg0 arg1 0.6 (the-as int (the-as uint #x8000ffff))) ) - (let ((v1-18 (-> obj puzzle slots))) + (let ((v1-18 (-> this puzzle slots))) (countdown (a0-9 (-> v1-18 length)) (let ((a1-12 (-> v1-18 a0-9))) (when (and (= (-> a1-12 col) arg0) (= (-> a1-12 row) arg1)) @@ -2034,25 +2039,25 @@ (set! v1-20 #f) (label cfg-23) (if v1-20 - (under-shoot-block-method-25 obj arg0 arg1 0.6 (the-as int (the-as uint #x80ffff00))) + (under-shoot-block-method-25 this arg0 arg1 0.6 (the-as int (the-as uint #x80ffff00))) ) (none) ) ;; definition for method 26 of type under-shoot-block ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-26 under-shoot-block ((obj under-shoot-block)) - (countdown (s5-0 (-> obj puzzle cells-tall)) - (countdown (s4-0 (-> obj puzzle cells-wide)) - (under-shoot-block-method-24 obj s4-0 s5-0) +(defmethod under-shoot-block-method-26 under-shoot-block ((this under-shoot-block)) + (countdown (s5-0 (-> this puzzle cells-tall)) + (countdown (s4-0 (-> this puzzle cells-wide)) + (under-shoot-block-method-24 this s4-0 s5-0) ) ) (none) ) ;; definition for method 28 of type under-shoot-block -(defmethod under-shoot-block-method-28 under-shoot-block ((obj under-shoot-block)) - (let* ((v1-0 (-> obj puzzle)) +(defmethod under-shoot-block-method-28 under-shoot-block ((this under-shoot-block)) + (let* ((v1-0 (-> this puzzle)) (v0-0 (+ (-> v1-0 last-block-id) 1)) ) (if (or (< 127 v0-0) (<= v0-0 0)) @@ -2066,7 +2071,7 @@ ;; definition for method 27 of type under-shoot-block ;; INFO: Used lq/sq ;; WARN: Return type mismatch symbol vs none. -(defmethod under-shoot-block-method-27 under-shoot-block ((obj under-shoot-block) (arg0 symbol)) +(defmethod under-shoot-block-method-27 under-shoot-block ((this under-shoot-block) (arg0 symbol)) (local-vars (sv-16 process) (sv-32 (function int int symbol (pointer process) none :behavior under-block)) @@ -2078,7 +2083,7 @@ (sv-128 (function int int symbol (pointer process) none :behavior under-block)) (sv-144 int) ) - (let ((s4-0 (-> obj puzzle))) + (let ((s4-0 (-> this puzzle))) (set! (-> s4-0 prev-special-attack-id) (the-as uint 0)) (set! (-> s4-0 slot-mask) (the-as uint 0)) (let ((v1-0 0)) @@ -2111,15 +2116,15 @@ (ppointer->handle (when s1-0 (let ((t9-2 (method-of-type under-block activate))) - (t9-2 (the-as under-block s1-0) obj (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) + (t9-2 (the-as under-block s1-0) this (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) ) (let ((s0-0 run-function-in-process)) (set! sv-16 s1-0) (set! sv-32 under-block-init-by-other) (set! sv-48 s3-0) - (let ((a3-1 (under-shoot-block-method-28 obj)) + (let ((a3-1 (under-shoot-block-method-28 this)) (t0-0 'beaten) - (t1-0 (process->ppointer obj)) + (t1-0 (process->ppointer this)) ) ((the-as (function object object object object object object none) s0-0) sv-16 sv-32 sv-48 a3-1 t0-0 t1-0) ) @@ -2137,15 +2142,15 @@ (ppointer->handle (when s1-1 (let ((t9-6 (method-of-type under-block activate))) - (t9-6 (the-as under-block s1-1) obj (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) + (t9-6 (the-as under-block s1-1) this (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) ) (let ((s0-1 run-function-in-process)) (set! sv-64 s1-1) (set! sv-80 under-block-init-by-other) (set! sv-96 s3-0) - (let ((a3-3 (under-shoot-block-method-28 obj)) + (let ((a3-3 (under-shoot-block-method-28 this)) (t0-1 'idle) - (t1-1 (process->ppointer obj)) + (t1-1 (process->ppointer this)) ) ((the-as (function object object object object object object none) s0-1) sv-64 sv-80 sv-96 a3-3 t0-1 t1-1) ) @@ -2160,15 +2165,15 @@ (ppointer->handle (when s1-2 (let ((t9-10 (method-of-type under-block activate))) - (t9-10 (the-as under-block s1-2) obj (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) + (t9-10 (the-as under-block s1-2) this (symbol->string (-> under-block symbol)) (the-as pointer #x70004000)) ) (let ((s0-2 run-function-in-process)) (set! sv-112 s1-2) (set! sv-128 under-block-init-by-other) (set! sv-144 s3-0) - (let ((a3-5 (under-shoot-block-method-28 obj)) + (let ((a3-5 (under-shoot-block-method-28 this)) (t0-2 'waiting) - (t1-2 (process->ppointer obj)) + (t1-2 (process->ppointer this)) ) ((the-as (function object object object object object object none) s0-2) sv-112 sv-128 sv-144 a3-5 t0-2 t1-2) ) @@ -2229,9 +2234,7 @@ (let ((gp-1 (-> gp-0 spawners))) (countdown (s5-0 (-> gp-1 length)) (let ((s4-0 (-> gp-1 s5-0))) - (when (and (not (handle->process (-> s4-0 active-handle))) - (>= (- (current-time) (-> s4-0 exploded-time)) (seconds 1)) - ) + (when (and (not (handle->process (-> s4-0 active-handle))) (time-elapsed? (-> s4-0 exploded-time) (seconds 1))) (set! (-> s4-0 active-handle) (-> s4-0 waiting-handle)) (let ((s3-0 (get-process *default-dead-pool* under-block #x4000))) (set! (-> s4-0 waiting-handle) @@ -2302,8 +2305,8 @@ :code (behavior () (process-entity-status! self (entity-perm-status subtask-complete) #t) (sound-play "und-block-chime") - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) (let ((gp-1 (-> self puzzle spawners))) @@ -2344,8 +2347,8 @@ ) ;; definition for method 10 of type under-shoot-block -(defmethod deactivate under-shoot-block ((obj under-shoot-block)) - (let ((s5-0 (-> obj puzzle spawners))) +(defmethod deactivate under-shoot-block ((this under-shoot-block)) + (let ((s5-0 (-> this puzzle spawners))) (countdown (s4-0 (-> s5-0 length)) (let ((s3-0 (-> s5-0 s4-0))) (send-event (handle->process (-> s3-0 active-handle)) 'die-fast) @@ -2353,14 +2356,14 @@ ) ) ) - ((the-as (function process-drawable none) (find-parent-method under-shoot-block 10)) obj) + ((the-as (function process-drawable none) (find-parent-method under-shoot-block 10)) this) (none) ) ;; definition for method 11 of type under-shoot-block ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-shoot-block ((obj under-shoot-block) (arg0 entity-actor)) +(defmethod init-from-entity! under-shoot-block ((this under-shoot-block) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -2368,32 +2371,32 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (let ((s5-1 (res-lump-value (-> obj entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (let ((s5-1 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) (if (or (< (the-as int s5-1) 0) (>= (the-as int s5-1) (-> *under-block-puzzles* length))) (go process-drawable-art-error "bad puzzle id") ) (set! sv-16 (new 'static 'res-tag)) - (let ((a0-7 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((a0-7 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (if (and a0-7 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) a0-7)) - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group) (the-as (pointer actor-group) a0-7)) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) ) ) (let ((v1-13 (-> *under-block-puzzles* s5-1))) - (set! (-> obj puzzle) v1-13) - (set! (-> obj allow-unlock?) (-> v1-13 auto-unlock?)) + (set! (-> this puzzle) v1-13) + (set! (-> this allow-unlock?) (-> v1-13 auto-unlock?)) ) ) (let ((s5-2 - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) + (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) ) ) - (under-shoot-block-method-27 obj (the-as symbol s5-2)) + (under-shoot-block-method-27 this (the-as symbol s5-2)) (if s5-2 - (go (method-of-object obj beaten)) - (go (method-of-object obj idle)) + (go (method-of-object this beaten)) + (go (method-of-object this idle)) ) ) (none) diff --git a/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc b/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc index 74492da206..8a21b3e077 100644 --- a/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/under-sig-obs_REF.gc @@ -28,29 +28,29 @@ ) ;; definition for method 3 of type under-plat-shoot -(defmethod inspect under-plat-shoot ((obj under-plat-shoot)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-plat-shoot ((this under-plat-shoot)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tdraw-test-script: ~A~%" (-> obj draw-test-script)) - (format #t "~2Tincoming-attack-id: ~D~%" (-> obj incoming-attack-id)) - (format #t "~2Tangle-flip: ~f~%" (-> obj angle-flip)) - (format #t "~2Tangle-flip-vel: ~f~%" (-> obj angle-flip-vel)) - (format #t "~2Tstate-flip: ~D~%" (-> obj state-flip)) - (format #t "~2Ttime-flip: ~D~%" (-> obj time-flip)) - (format #t "~2Tdisable-track-under: ~A~%" (-> obj disable-track-under)) - (format #t "~2Tdest-angle: ~f~%" (-> obj dest-angle)) - (format #t "~2Ton-shake: ~A~%" (-> obj on-shake)) - (format #t "~2Thint-count: ~f~%" (-> obj hint-count)) - (format #t "~2Thit-time: ~D~%" (-> obj hit-time)) - (format #t "~2Tknocked-sound-time: ~D~%" (-> obj hit-time)) - (format #t "~2Taxe-flip: #~%" (-> obj axe-flip)) + (format #t "~2Tdraw-test-script: ~A~%" (-> this draw-test-script)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tangle-flip: ~f~%" (-> this angle-flip)) + (format #t "~2Tangle-flip-vel: ~f~%" (-> this angle-flip-vel)) + (format #t "~2Tstate-flip: ~D~%" (-> this state-flip)) + (format #t "~2Ttime-flip: ~D~%" (-> this time-flip)) + (format #t "~2Tdisable-track-under: ~A~%" (-> this disable-track-under)) + (format #t "~2Tdest-angle: ~f~%" (-> this dest-angle)) + (format #t "~2Ton-shake: ~A~%" (-> this on-shake)) + (format #t "~2Thint-count: ~f~%" (-> this hint-count)) + (format #t "~2Thit-time: ~D~%" (-> this hit-time)) + (format #t "~2Tknocked-sound-time: ~D~%" (-> this hit-time)) + (format #t "~2Taxe-flip: #~%" (-> this axe-flip)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -60,7 +60,7 @@ ) ;; definition for method 30 of type under-plat-shoot -(defmethod get-art-group under-plat-shoot ((obj under-plat-shoot)) +(defmethod get-art-group under-plat-shoot ((this under-plat-shoot)) "@returns The associated [[art-group]]" (art-group-get-by-name *level* "skel-under-plat-shoot" (the-as (pointer uint32) #f)) ) @@ -70,9 +70,9 @@ (let ((gp-0 (cshape-reaction-default arg0 arg1 arg2 arg3))) (when (logtest? gp-0 (collide-status touch-surface)) (let ((s5-0 self)) - (when (>= (- (current-time) (-> s5-0 hit-time)) (seconds 0.25)) + (when (time-elapsed? (-> s5-0 hit-time) (seconds 0.25)) (sound-play "shoot-plat-fall") - (set! (-> s5-0 hit-time) (current-time)) + (set-time! (-> s5-0 hit-time)) ) ) ) @@ -82,10 +82,10 @@ ;; definition for method 31 of type under-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! under-plat-shoot ((obj under-plat-shoot)) +(defmethod init-plat-collision! under-plat-shoot ((this under-plat-shoot)) "TODO - collision stuff for setting up the platform" - (set! (-> obj clock) (-> *display* user0-clock)) - (let ((s5-0 (new 'process 'collide-shape-moving obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this clock) (-> *display* user0-clock)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) (set! (-> s5-0 reaction) cshape-reaction-under-plat-shoot) (set! (-> s5-0 no-reaction) @@ -123,7 +123,7 @@ ) (set! (-> s5-0 rider-max-momentum) 0.0) (set! (-> s5-0 max-iteration-count) (the-as uint 5)) - (set! (-> obj root) s5-0) + (set! (-> this root) s5-0) ) 0 (none) @@ -131,29 +131,29 @@ ;; definition for method 32 of type under-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod base-plat-method-32 under-plat-shoot ((obj under-plat-shoot)) +(defmethod base-plat-method-32 under-plat-shoot ((this under-plat-shoot)) 0 (none) ) ;; definition for method 33 of type under-plat-shoot ;; WARN: Return type mismatch int vs none. -(defmethod init-plat! under-plat-shoot ((obj under-plat-shoot)) +(defmethod init-plat! under-plat-shoot ((this under-plat-shoot)) "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." - (logclear! (-> obj mask) (process-mask actor-pause)) - (logior! (-> obj mask) (process-mask enemy)) - (set-vector! (-> obj axe-flip) 1.0 0.0 0.0 1.0) - (set! (-> obj angle-flip) 180.0) - (set! (-> obj time-flip) (the-as uint 570)) - (set! (-> obj draw-test-script) (res-lump-struct (-> obj entity) 'on-activate script-context)) - (set! (-> obj disable-track-under) #f) - (if (>= (res-lump-value (-> obj entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) - (set! (-> obj disable-track-under) (the-as basic #t)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logior! (-> this mask) (process-mask enemy)) + (set-vector! (-> this axe-flip) 1.0 0.0 0.0 1.0) + (set! (-> this angle-flip) 180.0) + (set! (-> this time-flip) (the-as uint 570)) + (set! (-> this draw-test-script) (res-lump-struct (-> this entity) 'on-activate script-context)) + (set! (-> this disable-track-under) #f) + (if (>= (res-lump-value (-> this entity) 'extra-id int :default (the-as uint128 -1) :time -1000000000.0) 0) + (set! (-> this disable-track-under) (the-as basic #t)) ) - (set! (-> obj hint-count) 0.0) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "shoot-plat-lp" :fo-max 70) (-> obj root trans)) + (set! (-> this hint-count) 0.0) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "shoot-plat-lp" :fo-max 70) (-> this root trans)) ) 0 (none) @@ -229,7 +229,7 @@ For example for an elevator pre-compute the distance between the first and last (vector-normalize! (-> self axe-flip) 1.0) (vector-rotate90-around-y! (-> self axe-flip) (-> self axe-flip)) (set! (-> self angle-flip-vel) -10.0) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -300,10 +300,10 @@ For example for an elevator pre-compute the distance between the first and last ) (set! (-> self dest-angle) 180.0) (set! (-> self on-shake) #f) - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (the-as time-frame (-> self time-flip))) + (when (time-elapsed? (-> self state-time) (the-as time-frame (-> self time-flip))) (set! (-> self state-flip) (the-as uint 0)) 0 ) @@ -328,7 +328,7 @@ For example for an elevator pre-compute the distance between the first and last (set! (-> self angle-flip) 0.0) ) (quaternion-vector-angle! (-> self root quat) (-> self axe-flip) (* 182.04445 (-> self angle-flip))) - (when (and (>= (- (current-time) (-> self state-time)) (the-as time-frame (+ (-> self time-flip) -300))) + (when (and (time-elapsed? (-> self state-time) (the-as time-frame (+ (-> self time-flip) -300))) (= 1 (-> self state-flip)) ) (when (not (-> self on-shake)) @@ -370,7 +370,7 @@ For example for an elevator pre-compute the distance between the first and last (defstate die-falling (under-plat-shoot) :virtual #t :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) (logclear! (-> self mask) (process-mask actor-pause enemy platform)) (let ((v1-7 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 0))) (set! (-> v1-7 prim-core collide-as) (collide-spec)) @@ -379,7 +379,7 @@ For example for an elevator pre-compute the distance between the first and last 0 ) :trans (behavior () - (when (>= (- (current-time) (-> self state-time)) (seconds 1)) + (when (time-elapsed? (-> self state-time) (seconds 1)) (let ((f30-0 (* 0.0016666667 (the float (+ (- (seconds -1) (-> self state-time)) (current-time)))))) (when (>= f30-0 1.0) (cleanup-for-death self) @@ -403,7 +403,7 @@ For example for an elevator pre-compute the distance between the first and last #t ) ) - (set! (-> self hit-time) (current-time)) + (set-time! (-> self hit-time)) (let ((gp-1 (new 'stack-no-clear 'quaternion)) (s5-1 (new 'stack-no-clear 'quaternion)) (s4-0 (new 'stack-no-clear 'vector)) @@ -438,19 +438,19 @@ For example for an elevator pre-compute the distance between the first and last ) ;; definition for method 36 of type under-plat-shoot -(defmethod plat-path-sync under-plat-shoot ((obj under-plat-shoot)) +(defmethod plat-path-sync under-plat-shoot ((this under-plat-shoot)) "If the `sync` period is greater than `0` then transition the state to [[plat::35]] otherwise, [[plat::34]] @see [[sync-eased]]" (cond - ((and (script-eval (the-as pair (-> obj draw-test-script))) (= *bot-record-path* -1)) - (go (method-of-object obj dormant)) + ((and (script-eval (the-as pair (-> this draw-test-script))) (= *bot-record-path* -1)) + (go (method-of-object this dormant)) ) (else enter-state #t - (go (method-of-object obj plat-path-active)) + (go (method-of-object this plat-path-active)) ) ) ) @@ -471,16 +471,16 @@ otherwise, [[plat::34]] ) ;; definition for method 3 of type under-break-floor -(defmethod inspect under-break-floor ((obj under-break-floor)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-break-floor ((this under-break-floor)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -565,7 +565,7 @@ otherwise, [[plat::34]] (suspend) (ja-channel-set! 0) (let ((gp-0 (current-time))) - (until (>= (- (current-time) gp-0) (seconds 1)) + (until (time-elapsed? gp-0 (seconds 1)) (suspend) ) ) @@ -588,14 +588,14 @@ otherwise, [[plat::34]] ;; definition for method 11 of type under-break-floor ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-floor ((obj under-break-floor) (arg0 entity-actor)) +(defmethod init-from-entity! under-break-floor ((this under-break-floor) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -624,25 +624,25 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (set! (-> obj root penetrated-by) (penetrate flop)) - (process-drawable-from-entity! obj arg0) + (set! (-> this root penetrated-by) (penetrate flop)) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-break-floor" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (set! (-> obj draw light-index) (the-as uint 3)) - (let ((a0-20 (-> obj skel root-channel 0))) - (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (set! (-> this draw light-index) (the-as uint 3)) + (let ((a0-20 (-> this skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-20 frame-num) 0.0) - (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-identity) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity) ) (transform-post) - (if (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete))) - (go (method-of-object obj die-fast)) - (go (method-of-object obj idle)) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this die-fast)) + (go (method-of-object this idle)) ) (none) ) @@ -661,16 +661,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-break-wall -(defmethod inspect under-break-wall ((obj under-break-wall)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-break-wall ((this under-break-wall)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -702,7 +702,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-break-wall ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-wall ((obj under-break-wall) (arg0 entity-actor)) +(defmethod init-from-entity! under-break-wall ((this under-break-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -710,7 +710,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-2 prim-core collide-as) (collide-spec obstacle)) (set! (-> v1-2 prim-core action) (collide-action solid)) @@ -724,28 +724,28 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-5 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-5 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) - (if (= (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0) 2) + (process-drawable-from-entity! this arg0) + (if (= (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0) 2) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-break-wall2" (the-as (pointer uint32) #f))) (the-as pair 0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-break-wall1" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) - (let ((s4-4 (-> obj root))) + (let ((s4-4 (-> this root))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-15 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-15 - (+! (-> obj root trans x) (-> v1-15 0)) - (+! (-> obj root trans y) (-> v1-15 1)) - (+! (-> obj root trans z) (-> v1-15 2)) + (+! (-> this root trans x) (-> v1-15 0)) + (+! (-> this root trans y) (-> v1-15 1)) + (+! (-> this root trans z) (-> v1-15 2)) ) ) (let ((f0-12 (res-lump-float arg0 'rotoffset))) @@ -755,9 +755,9 @@ This commonly includes things such as: ) ) (transform-post) - (if (script-eval (res-lump-struct (-> obj entity) 'on-activate pair)) - (go (method-of-object obj die)) - (go (method-of-object obj idle)) + (if (script-eval (res-lump-struct (-> this entity) 'on-activate pair)) + (go (method-of-object this die)) + (go (method-of-object this idle)) ) (none) ) @@ -779,17 +779,17 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-break-bridge -(defmethod inspect under-break-bridge ((obj under-break-bridge)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-break-bridge ((this under-break-bridge)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tbridge-id: ~D~%" (-> obj bridge-id)) + (format #t "~2Tbridge-id: ~D~%" (-> this bridge-id)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -845,7 +845,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-break-bridge ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-break-bridge ((obj under-break-bridge) (arg0 entity-actor)) +(defmethod init-from-entity! under-break-bridge ((this under-break-bridge) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -853,8 +853,8 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj bridge-id) (res-lump-value (-> obj entity) 'extra-id int :time -1000000000.0)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this bridge-id) (res-lump-value (-> this entity) 'extra-id int :time -1000000000.0)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -879,28 +879,28 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) - (if (= (res-lump-value (-> obj entity) 'extra-id uint :time -1000000000.0) 1) + (process-drawable-from-entity! this arg0) + (if (= (res-lump-value (-> this entity) 'extra-id uint :time -1000000000.0) 1) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-bridge2" (the-as (pointer uint32) #f))) (the-as pair 0) ) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-bridge1" (the-as (pointer uint32) #f))) (the-as pair 0) ) ) - (let ((s4-4 (-> obj root))) + (let ((s4-4 (-> this root))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-24 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-24 - (+! (-> obj root trans x) (-> v1-24 0)) - (+! (-> obj root trans y) (-> v1-24 1)) - (+! (-> obj root trans z) (-> v1-24 2)) + (+! (-> this root trans x) (-> v1-24 0)) + (+! (-> this root trans y) (-> v1-24 1)) + (+! (-> this root trans z) (-> v1-24 2)) ) ) (let ((f0-20 (res-lump-float arg0 'rotoffset))) @@ -911,14 +911,14 @@ This commonly includes things such as: ) (transform-post) (cond - ((script-eval (res-lump-struct (-> obj entity) 'on-activate pair)) - (if (= (-> obj bridge-id) 1) - (go (method-of-object obj broken)) - (go (method-of-object obj die)) + ((script-eval (res-lump-struct (-> this entity) 'on-activate pair)) + (if (= (-> this bridge-id) 1) + (go (method-of-object this broken)) + (go (method-of-object this die)) ) ) (else - (go (method-of-object obj idle)) + (go (method-of-object this idle)) ) ) (none) @@ -939,16 +939,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-int-door -(defmethod inspect under-int-door ((obj under-int-door)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-int-door ((this under-int-door)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -997,7 +997,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-int-door ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-int-door ((obj under-int-door) (arg0 entity-actor)) +(defmethod init-from-entity! under-int-door ((this under-int-door) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1005,7 +1005,7 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) (set! (-> s4-0 total-prims) (the-as uint 3)) (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) @@ -1032,20 +1032,20 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) ) - (set! (-> obj root) s4-0) + (set! (-> this root) s4-0) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-int-door" (the-as (pointer uint32) #f))) (the-as pair 0) ) (set! sv-16 (new 'static 'res-tag)) - (let ((v1-18 (res-lump-data (-> obj entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (let ((v1-18 (res-lump-data (-> this entity) 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) (when (and v1-18 (nonzero? (-> sv-16 elt-count))) (let ((a0-25 (-> v1-18 0 data 0 actor))) (if (and a0-25 (logtest? (-> a0-25 extra perm status) (entity-perm-status subtask-complete))) - (process-entity-status! obj (entity-perm-status subtask-complete) #t) + (process-entity-status! this (entity-perm-status subtask-complete) #t) ) ) ) @@ -1053,37 +1053,38 @@ This commonly includes things such as: (ja-channel-push! 1 0) (let ((s5-2 #t)) (cond - ((script-eval (res-lump-struct (-> obj entity) 'on-activate pair)) + ((script-eval (res-lump-struct (-> this entity) 'on-activate pair)) (set! s5-2 #f) ) - ((not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status subtask-complete)))) + ((not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) (set! s5-2 #f) ) ) (cond (s5-2 - (let ((a0-40 (-> obj skel root-channel 0))) - (set! (-> a0-40 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-40 (-> this skel root-channel 0))) + (set! (-> a0-40 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-40 param 0) 1.0) (set! (-> a0-40 frame-num) - (the float (+ (-> (the-as art-joint-anim (-> obj draw art-group data 2)) frames num-frames) -1)) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 2)) frames num-frames) -1)) ) - (joint-control-channel-group! a0-40 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-40 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) ) (else - (let ((a0-41 (-> obj skel root-channel 0))) - (set! (-> a0-41 frame-group) (the-as art-joint-anim (-> obj draw art-group data 2))) + (let ((a0-41 (-> this skel root-channel 0))) + (set! (-> a0-41 frame-group) (the-as art-joint-anim (-> this draw art-group data 2))) (set! (-> a0-41 param 0) 1.0) (set! (-> a0-41 frame-num) 0.0) - (joint-control-channel-group! a0-41 (the-as art-joint-anim (-> obj draw art-group data 2)) num-func-loop!) + (joint-control-channel-group! a0-41 (the-as art-joint-anim (-> this draw art-group data 2)) num-func-loop!) ) ) ) (transform-post) (if s5-2 - (go (method-of-object obj idle-open)) - (go (method-of-object obj idle-closed)) + (go (method-of-object this idle-open)) + (go (method-of-object this idle-closed)) ) ) (none) @@ -1105,19 +1106,19 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-plat-long -(defmethod inspect under-plat-long ((obj under-plat-long)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-plat-long ((this under-plat-long)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type base-plat inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tsync: #~%" (-> obj sync)) - (format #t "~2Tmove-start: #~%" (-> obj move-start)) - (format #t "~2Tmove-end: #~%" (-> obj move-end)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tmove-start: #~%" (-> this move-start)) + (format #t "~2Tmove-end: #~%" (-> this move-end)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1141,10 +1142,10 @@ This commonly includes things such as: ;; definition for method 31 of type under-plat-long ;; WARN: Return type mismatch int vs none. -(defmethod init-plat-collision! under-plat-long ((obj under-plat-long)) +(defmethod init-plat-collision! under-plat-long ((this under-plat-long)) "TODO - collision stuff for setting up the platform" - (set! (-> obj clock) (-> *display* user0-clock)) - (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) + (set! (-> this clock) (-> *display* user0-clock)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) @@ -1160,7 +1161,7 @@ This commonly includes things such as: (set! (-> s5-0 backup-collide-as) (-> v1-14 prim-core collide-as)) (set! (-> s5-0 backup-collide-with) (-> v1-14 prim-core collide-with)) ) - (set! (-> obj root) (the-as collide-shape-moving s5-0)) + (set! (-> this root) (the-as collide-shape-moving s5-0)) ) 0 (none) @@ -1169,7 +1170,7 @@ This commonly includes things such as: ;; definition for method 11 of type under-plat-long ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-plat-long ((obj under-plat-long) (arg0 entity-actor)) +(defmethod init-from-entity! under-plat-long ((this under-plat-long) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1177,15 +1178,15 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (init-plat-collision! obj) - (process-drawable-from-entity! obj arg0) + (init-plat-collision! this) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-plat-long" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (stop-bouncing! obj) - (let ((s5-1 (-> obj root))) + (stop-bouncing! this) + (let ((s5-1 (-> this root))) (set! sv-16 (new 'static 'res-tag)) (let ((v1-8 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))) (when v1-8 @@ -1199,12 +1200,12 @@ This commonly includes things such as: (quaternion-rotate-y! (-> s5-1 quat) (-> s5-1 quat) f0-6) ) ) - (set! (-> obj move-start quad) (-> s5-1 trans quad)) + (set! (-> this move-start quad) (-> s5-1 trans quad)) (let ((s3-1 (new 'stack-no-clear 'vector))) (vector-z-quaternion! s3-1 (-> s5-1 quat)) (vector-rotate90-around-y! s3-1 s3-1) (let ((f0-7 (res-lump-float arg0 'distance :default 65536.0))) - (vector+float*! (-> obj move-end) (-> obj move-start) s3-1 f0-7) + (vector+float*! (-> this move-end) (-> this move-start) s3-1 f0-7) ) ) (let ((a1-10 (new 'stack-no-clear 'sync-info-params))) @@ -1222,19 +1223,19 @@ This commonly includes things such as: (set! (-> a1-10 ease-out) 0.15) (set! (-> a1-10 pause-in) 0.0) (set! (-> a1-10 pause-out) 0.0) - (initialize! (-> obj sync) a1-10) + (initialize! (-> this sync) a1-10) ) - (vector-lerp! (-> s5-1 trans) (-> obj move-start) (-> obj move-end) (get-norm! (-> obj sync) 0)) + (vector-lerp! (-> s5-1 trans) (-> this move-start) (-> this move-end) (get-norm! (-> this sync) 0)) ) (transform-post) - (set! (-> obj sound) - (new 'process 'ambient-sound (static-sound-spec "und-float-plat" :fo-max 50) (-> obj root trans)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "und-float-plat" :fo-max 50) (-> this root trans)) ) - (base-plat-method-32 obj) - (set! (-> obj fact) - (new 'process 'fact-info obj (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + (base-plat-method-32 this) + (set! (-> this fact) + (new 'process 'fact-info this (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) ) - (go (method-of-object obj idle)) + (go (method-of-object this idle)) (none) ) @@ -1256,20 +1257,20 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-plat-wall -(defmethod inspect under-plat-wall ((obj under-plat-wall)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-plat-wall ((this under-plat-wall)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Textended-amount: ~f~%" (-> obj extended-amount)) - (format #t "~2Tin-trans: #~%" (-> obj in-trans)) - (format #t "~2Tout-trans: #~%" (-> obj out-trans)) - (format #t "~2Tsync: #~%" (-> obj sync)) + (format #t "~2Textended-amount: ~f~%" (-> this extended-amount)) + (format #t "~2Tin-trans: #~%" (-> this in-trans)) + (format #t "~2Tout-trans: #~%" (-> this out-trans)) + (format #t "~2Tsync: #~%" (-> this sync)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -1329,17 +1330,17 @@ This commonly includes things such as: ;; definition for method 11 of type under-plat-wall ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-plat-wall ((obj under-plat-wall) (arg0 entity-actor)) +(defmethod init-from-entity! under-plat-wall ((this under-plat-wall) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size - collision information - loading the skeleton group / bones - sounds" - (set! (-> obj extended-amount) 0.0) - (logior! (-> obj mask) (process-mask platform)) - (set! (-> obj clock) (-> *display* user0-clock)) - (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) + (set! (-> this extended-amount) 0.0) + (logior! (-> this mask) (process-mask platform)) + (set! (-> this clock) (-> *display* user0-clock)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) @@ -1356,15 +1357,15 @@ This commonly includes things such as: (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) ) (set! (-> s4-0 rider-max-momentum) 0.0) - (set! (-> obj root) (the-as collide-shape-moving s4-0)) + (set! (-> this root) (the-as collide-shape-moving s4-0)) ) - (process-drawable-from-entity! obj arg0) + (process-drawable-from-entity! this arg0) (initialize-skeleton - obj + this (the-as skeleton-group (art-group-get-by-name *level* "skel-under-plat-wall" (the-as (pointer uint32) #f))) (the-as pair 0) ) - (logior! (-> obj skel status) (joint-control-status sync-math)) + (logior! (-> this skel status) (joint-control-status sync-math)) (let ((a1-6 (new 'stack-no-clear 'sync-info-params))) (let ((v1-24 0)) (if #t @@ -1373,35 +1374,35 @@ This commonly includes things such as: (set! (-> a1-6 sync-type) 'sync-paused) (set! (-> a1-6 sync-flags) (the-as sync-flags v1-24)) ) - (set! (-> a1-6 entity) (-> obj entity)) + (set! (-> a1-6 entity) (-> this entity)) (set! (-> a1-6 period) (the-as uint 1500)) (set! (-> a1-6 percent) 0.0) (set! (-> a1-6 pause-in) 0.2) (set! (-> a1-6 pause-out) 0.2) - (initialize! (-> obj sync) a1-6) + (initialize! (-> this sync) a1-6) ) - (let ((f30-0 (quaternion-y-angle (-> obj root quat))) + (let ((f30-0 (quaternion-y-angle (-> this root quat))) (s4-2 (new 'stack-no-clear 'vector)) ) (set-vector! s4-2 0.0 0.0 (res-lump-float arg0 'tunemeters) 1.0) (vector-rotate-around-y! s4-2 s4-2 f30-0) - (vector+! (-> obj out-trans) (-> obj root trans) s4-2) + (vector+! (-> this out-trans) (-> this root trans) s4-2) (set-vector! s4-2 0.0 0.0 -32768.0 1.0) (vector-rotate-around-y! s4-2 s4-2 f30-0) - (vector+! (-> obj in-trans) (-> obj out-trans) s4-2) + (vector+! (-> this in-trans) (-> this out-trans) s4-2) ) (ja-channel-push! 1 0) - (let ((s5-1 (-> obj skel root-channel 0))) + (let ((s5-1 (-> this skel root-channel 0))) (joint-control-channel-group-eval! s5-1 - (the-as art-joint-anim (-> obj draw art-group data 2)) + (the-as art-joint-anim (-> this draw art-group data 2)) num-func-identity ) (set! (-> s5-1 frame-num) 0.0) ) (transform-post) - (logclear! (-> obj mask) (process-mask actor-pause)) - (go (method-of-object obj active)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this active)) (none) ) @@ -1425,22 +1426,22 @@ This commonly includes things such as: ) ;; definition for method 3 of type under-pipe-growls -(defmethod inspect under-pipe-growls ((obj under-pipe-growls)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-pipe-growls ((this under-pipe-growls)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tvolume: ~f~%" (-> obj volume)) - (format #t "~2Tdesired-volume: ~f~%" (-> obj desired-volume)) - (format #t "~2Tvolume-seek-speed: ~f~%" (-> obj volume-seek-speed)) - (format #t "~2Tapproach-sound-id: ~D~%" (-> obj approach-sound-id)) - (format #t "~2Tapproach-play-time: ~D~%" (-> obj approach-play-time)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) + (format #t "~2Tvolume: ~f~%" (-> this volume)) + (format #t "~2Tdesired-volume: ~f~%" (-> this desired-volume)) + (format #t "~2Tvolume-seek-speed: ~f~%" (-> this volume-seek-speed)) + (format #t "~2Tapproach-sound-id: ~D~%" (-> this approach-sound-id)) + (format #t "~2Tapproach-play-time: ~D~%" (-> this approach-play-time)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) (label cfg-4) - obj + this ) ;; definition for function under-pipe-growls-post @@ -1550,28 +1551,28 @@ This commonly includes things such as: ) :code (behavior () (sound-play "grunt-notice" :vol 40 :position (target-pos 0)) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) (sound-play "grunt-warn" :vol 50 :position (target-pos 0)) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.2)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.2)) (suspend) ) (sound-play "grunt-hit" :vol 60 :position (target-pos 0)) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 0.5)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 0.5)) (suspend) ) (sound-play "grunt-notice" :vol 70 :position (target-pos 0)) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (sound-play "grunt-notice" :position (target-pos 0)) - (set! (-> self state-time) (current-time)) - (until (>= (- (current-time) (-> self state-time)) (seconds 1)) + (set-time! (-> self state-time)) + (until (time-elapsed? (-> self state-time) (seconds 1)) (suspend) ) (sound-play "grunt-notice" :vol 200 :position (target-pos 0)) diff --git a/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc b/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc index bf57d9b6e9..deb91a6d38 100644 --- a/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc +++ b/test/decompiler/reference/jak2/levels/under/underb-master_REF.gc @@ -17,17 +17,17 @@ ) ;; definition for method 3 of type under-warp -(defmethod inspect under-warp ((obj under-warp)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-warp ((this under-warp)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tinterp: ~f~%" (-> obj interp)) + (format #t "~2Tinterp: ~f~%" (-> this interp)) (label cfg-4) - obj + this ) ;; failed to figure out what this is: @@ -80,7 +80,7 @@ ;; definition for method 22 of type under-warp ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. -(defmethod under-warp-method-22 under-warp ((obj under-warp)) +(defmethod under-warp-method-22 under-warp ((this under-warp)) (rlet ((acc :class vf) (vf0 :class vf) (vf4 :class vf) @@ -95,12 +95,12 @@ (f30-0 4096.0) ) (let ((f0-4 (* 0.00013563369 (tan (* 0.5 (-> *math-camera* fov))) f30-0))) - (set-vector! (-> obj root scale) f0-4 f0-4 f0-4 1.0) + (set-vector! (-> this root scale) f0-4 f0-4 f0-4 1.0) ) (set! (-> gp-0 quad) (-> (camera-pos) quad)) (vector-normalize-copy! s5-0 (-> s3-0 vector 2) 1.0) - (matrix->quaternion (-> obj root quat) s3-0) - (let ((v1-10 (-> obj root trans))) + (matrix->quaternion (-> this root quat) s3-0) + (let ((v1-10 (-> this root trans))) (let ((a0-5 f30-0)) (.mov vf7 a0-5) ) @@ -180,39 +180,39 @@ ) ;; definition for method 3 of type underb-master -(defmethod inspect underb-master ((obj underb-master)) - (when (not obj) - (set! obj obj) +(defmethod inspect underb-master ((this underb-master)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Twarp-handle: ~D~%" (-> obj warp-handle)) - (format #t "~2Ttank-handle: ~D~%" (-> obj tank-handle)) - (format #t "~2Tunderwater-time: ~D~%" (-> obj underwater-time)) - (format #t "~2Tlast-air-beep-time: ~D~%" (-> obj last-air-beep-time)) - (format #t "~2Tambient-sound-id: ~D~%" (-> obj ambient-sound-id)) - (format #t "~2Tair-supply: ~f~%" (-> obj air-supply)) - (format #t "~2Tair-charge-up?: ~A~%" (-> obj air-charge-up?)) - (format #t "~2Tunder-water-pitch-mod: ~f~%" (-> obj under-water-pitch-mod)) - (format #t "~2Tbig-room-entered: ~A~%" (-> obj big-room-entered)) - (format #t "~2Tbig-room-timer: ~D~%" (-> obj big-room-timer)) - (format #t "~2Tunder-plat-player-on: ~A~%" (-> obj under-plat-player-on)) - (format #t "~2Tunder-plat-is-up: ~A~%" (-> obj under-plat-is-up)) + (format #t "~2Twarp-handle: ~D~%" (-> this warp-handle)) + (format #t "~2Ttank-handle: ~D~%" (-> this tank-handle)) + (format #t "~2Tunderwater-time: ~D~%" (-> this underwater-time)) + (format #t "~2Tlast-air-beep-time: ~D~%" (-> this last-air-beep-time)) + (format #t "~2Tambient-sound-id: ~D~%" (-> this ambient-sound-id)) + (format #t "~2Tair-supply: ~f~%" (-> this air-supply)) + (format #t "~2Tair-charge-up?: ~A~%" (-> this air-charge-up?)) + (format #t "~2Tunder-water-pitch-mod: ~f~%" (-> this under-water-pitch-mod)) + (format #t "~2Tbig-room-entered: ~A~%" (-> this big-room-entered)) + (format #t "~2Tbig-room-timer: ~D~%" (-> this big-room-timer)) + (format #t "~2Tunder-plat-player-on: ~A~%" (-> this under-plat-player-on)) + (format #t "~2Tunder-plat-is-up: ~A~%" (-> this under-plat-is-up)) (label cfg-4) - obj + this ) ;; definition for symbol *underb-master*, type (pointer underb-master) (define *underb-master* (the-as (pointer underb-master) #f)) ;; definition for method 10 of type underb-master -(defmethod deactivate underb-master ((obj underb-master)) - (sound-stop (-> obj ambient-sound-id)) - (send-event (handle->process (-> obj warp-handle)) 'die-fast) +(defmethod deactivate underb-master ((this underb-master)) + (sound-stop (-> this ambient-sound-id)) + (send-event (handle->process (-> this warp-handle)) 'die-fast) (set! *underb-master* (the-as (pointer underb-master) #f)) - ((method-of-type process deactivate) obj) + ((method-of-type process deactivate) this) (none) ) @@ -358,7 +358,7 @@ ) ;; definition for method 22 of type underb-master -(defmethod under-warp-check underb-master ((obj underb-master)) +(defmethod under-warp-check underb-master ((this underb-master)) "Used to check whether the underwater warp effect should be drawn." (let ((target-pos (target-pos 0)) (tpos-offset (new 'stack-no-clear 'vector)) @@ -378,19 +378,19 @@ ;; definition for method 23 of type underb-master ;; WARN: Return type mismatch int vs none. -(defmethod spawn-air-tank-hud underb-master ((obj underb-master) (arg0 symbol)) +(defmethod spawn-air-tank-hud underb-master ((this underb-master) (arg0 symbol)) "Spawns or hides the air tank HUD bar." (cond (arg0 - (if (not (handle->process (-> obj tank-handle))) - (set! (-> obj tank-handle) - (ppointer->handle (process-spawn hud-mech-air-tank :init hud-init-by-other :to obj)) + (if (not (handle->process (-> this tank-handle))) + (set! (-> this tank-handle) + (ppointer->handle (process-spawn hud-mech-air-tank :init hud-init-by-other :to this)) ) ) ) (else - (send-event (handle->process (-> obj tank-handle)) 'hide-and-die) - (set! (-> obj tank-handle) (the-as handle #f)) + (send-event (handle->process (-> this tank-handle)) 'hide-and-die) + (set! (-> this tank-handle) (the-as handle #f)) ) ) (none) @@ -421,7 +421,7 @@ ) (if (or (not gp-0) (not (logtest? (-> gp-0 water flags) (water-flags under-water)))) (set! (-> self air-charge-up?) #t) - (set! (-> self underwater-time) (current-time)) + (set-time! (-> self underwater-time)) ) ) (cond @@ -443,8 +443,8 @@ (else (when (>= 0.4 (-> self air-supply)) (let ((v1-39 (the int (lerp-scale 90.0 300.0 (-> self air-supply) 0.0 0.4)))) - (when (>= (- (current-time) (-> self last-air-beep-time)) v1-39) - (set! (-> self last-air-beep-time) (current-time)) + (when (time-elapsed? (-> self last-air-beep-time) v1-39) + (set-time! (-> self last-air-beep-time)) (sound-play "oxygen-warning") ) ) @@ -455,7 +455,7 @@ ) (set! (-> *game-info* air-supply) (fmin 1.0 (-> self air-supply))) (if (or (and *target* (not (logtest? (focus-status mech) (-> *target* focus-status)))) - (and (>= (-> self air-supply) 1.0) (>= (- (current-time) (-> self underwater-time)) (seconds 3))) + (and (>= (-> self air-supply) 1.0) (time-elapsed? (-> self underwater-time) (seconds 3))) ) (spawn-air-tank-hud self #f) (spawn-air-tank-hud self #t) @@ -580,7 +580,7 @@ :enter (behavior () (persist-with-delay *setting-control* 'interp-time (seconds 0.05) 'interp-time 'abs 0.0 0) (set-setting! 'entity-name "camera-244" 0.0 0) - (set! (-> self big-room-timer) (current-time)) + (set-time! (-> self big-room-timer)) (send-event (ppointer->process *underb-master*) 'request 'under-warp #t) ) :exit (behavior () @@ -588,7 +588,7 @@ (remove-setting! 'entity-name) ) :trans (behavior () - (if (>= (- (current-time) (-> self big-room-timer)) (seconds 1)) + (if (time-elapsed? (-> self big-room-timer) (seconds 1)) (go-virtual idle) ) ) @@ -680,44 +680,44 @@ ) ;; definition for method 3 of type under-locking -(defmethod inspect under-locking ((obj under-locking)) - (when (not obj) - (set! obj obj) +(defmethod inspect under-locking ((this under-locking)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) + (t9-0 this) ) - (format #t "~2Tid: ~D~%" (-> obj id)) - (format #t "~2Tup-y: ~f~%" (-> obj up-y)) - (format #t "~2Tdown-y: ~f~%" (-> obj down-y)) - (format #t "~2Tmode: ~D~%" (-> obj mode)) - (format #t "~2Twhich-reminder?: ~A~%" (-> obj which-reminder?)) - (format #t "~2Tspooled-sound-id: ~D~%" (-> obj spooled-sound-id)) - (format #t "~2Tdraining-part: ~A~%" (-> obj draining-part)) - (format #t "~2Tactor-group: #x~X~%" (-> obj actor-group)) - (format #t "~2Tspooled-sound-delay: ~D~%" (-> obj spooled-sound-delay)) - (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) - (format #t "~2Tlast-reminder-time: ~D~%" (-> obj last-reminder-time)) + (format #t "~2Tid: ~D~%" (-> this id)) + (format #t "~2Tup-y: ~f~%" (-> this up-y)) + (format #t "~2Tdown-y: ~f~%" (-> this down-y)) + (format #t "~2Tmode: ~D~%" (-> this mode)) + (format #t "~2Twhich-reminder?: ~A~%" (-> this which-reminder?)) + (format #t "~2Tspooled-sound-id: ~D~%" (-> this spooled-sound-id)) + (format #t "~2Tdraining-part: ~A~%" (-> this draining-part)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (format #t "~2Tspooled-sound-delay: ~D~%" (-> this spooled-sound-delay)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Tlast-reminder-time: ~D~%" (-> this last-reminder-time)) (label cfg-4) - obj + this ) ;; definition for method 7 of type under-locking ;; WARN: Return type mismatch process-drawable vs under-locking. -(defmethod relocate under-locking ((obj under-locking) (arg0 int)) - (if (nonzero? (-> obj draining-part)) - (&+! (-> obj draining-part) arg0) +(defmethod relocate under-locking ((this under-locking) (arg0 int)) + (if (nonzero? (-> this draining-part)) + (&+! (-> this draining-part) arg0) ) - (the-as under-locking ((method-of-type process-drawable relocate) obj arg0)) + (the-as under-locking ((method-of-type process-drawable relocate) this arg0)) ) ;; definition for method 10 of type under-locking -(defmethod deactivate under-locking ((obj under-locking)) - (if (nonzero? (-> obj draining-part)) - (kill-and-free-particles (-> obj draining-part)) +(defmethod deactivate under-locking ((this under-locking)) + (if (nonzero? (-> this draining-part)) + (kill-and-free-particles (-> this draining-part)) ) - ((method-of-type process-drawable deactivate) obj) + ((method-of-type process-drawable deactivate) this) (none) ) @@ -732,7 +732,7 @@ ) ) :enter (behavior () - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) :trans (behavior () (let ((v1-0 (-> self actor-group))) @@ -754,7 +754,7 @@ ) ) ) - (when (>= (- (current-time) (-> self state-time)) (seconds 0.1)) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) (let ((a0-13 (-> v1-0 0 data 0 actor))) (if a0-13 (-> a0-13 extra process) @@ -811,7 +811,7 @@ ) ) (else - (set! (-> self state-time) (current-time)) + (set-time! (-> self state-time)) ) ) ) @@ -898,8 +898,8 @@ 0 ) ) - (when (>= (- (current-time) (-> self last-reminder-time)) (seconds 9)) - (set! (-> self last-reminder-time) (current-time)) + (when (time-elapsed? (-> self last-reminder-time) (seconds 9)) + (set-time! (-> self last-reminder-time)) (add-process *gui-control* self @@ -939,13 +939,11 @@ (when (and (zero? (-> self state-time)) (= (get-status *gui-control* (-> self spooled-sound-id)) (gui-status ready)) ) - (set! (-> self state-time) (current-time)) - (set! (-> self last-reminder-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-reminder-time)) ) (when (nonzero? (-> self state-time)) - (when (and (>= (-> self spooled-sound-delay) 0) - (>= (- (current-time) (-> self state-time)) (-> self spooled-sound-delay)) - ) + (when (and (>= (-> self spooled-sound-delay) 0) (time-elapsed? (-> self state-time) (-> self spooled-sound-delay))) (set-action! *gui-control* (gui-action play) @@ -972,7 +970,7 @@ ) ) ) - (if (>= (- (current-time) (-> self state-time)) (seconds 2)) + (if (time-elapsed? (-> self state-time) (seconds 2)) (spawn (-> self part) (-> self root trans)) ) ) @@ -1043,8 +1041,8 @@ (when (and (zero? (-> self state-time)) (= (get-status *gui-control* (-> self spooled-sound-id)) (gui-status ready)) ) - (set! (-> self state-time) (current-time)) - (set! (-> self last-reminder-time) (current-time)) + (set-time! (-> self state-time)) + (set-time! (-> self last-reminder-time)) (set-action! *gui-control* (gui-action play) @@ -1071,7 +1069,7 @@ ) ) ) - (if (< (- (current-time) (-> self state-time)) (seconds 1)) + (if (not (time-elapsed? (-> self state-time) (seconds 1))) (spawn (-> self draining-part) (-> self root trans)) ) ) @@ -1131,7 +1129,7 @@ ;; definition for method 11 of type under-locking ;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. -(defmethod init-from-entity! under-locking ((obj under-locking) (arg0 entity-actor)) +(defmethod init-from-entity! under-locking ((this under-locking) (arg0 entity-actor)) "Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that. This commonly includes things such as: - stack size @@ -1139,30 +1137,30 @@ This commonly includes things such as: - loading the skeleton group / bones - sounds" (local-vars (sv-16 res-tag)) - (set! (-> obj which-reminder?) #f) - (set! (-> obj spooled-sound-id) (new 'static 'sound-id)) - (set! (-> obj root) (new 'process 'trsqv)) - (process-drawable-from-entity! obj arg0) - (set! (-> obj id) (res-lump-value arg0 'extra-id int :time -1000000000.0)) - (let ((f0-0 (-> obj root trans y))) - (set! (-> obj up-y) (+ 49152.0 f0-0)) - (set! (-> obj down-y) (+ f0-0 (if (= (-> obj id) 2) - -16384.0 - -20480.0 - ) - ) + (set! (-> this which-reminder?) #f) + (set! (-> this spooled-sound-id) (new 'static 'sound-id)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (set! (-> this id) (res-lump-value arg0 'extra-id int :time -1000000000.0)) + (let ((f0-0 (-> this root trans y))) + (set! (-> this up-y) (+ 49152.0 f0-0)) + (set! (-> this down-y) (+ f0-0 (if (= (-> this id) 2) + -16384.0 + -20480.0 + ) + ) ) ) (set! sv-16 (new 'static 'res-tag)) - (let ((a0-6 (res-lump-data (-> obj entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (let ((a0-6 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) (if (and a0-6 (nonzero? (-> sv-16 elt-count))) - (set! (-> obj actor-group) (the-as (pointer actor-group) a0-6)) - (set! (-> obj actor-group) (the-as (pointer actor-group) #f)) + (set! (-> this actor-group) (the-as (pointer actor-group) a0-6)) + (set! (-> this actor-group) (the-as (pointer actor-group) #f)) ) ) - (set! (-> obj part) (create-launch-control (-> *part-group-id-table* 498) obj)) - (set! (-> obj draining-part) (create-launch-control (-> *part-group-id-table* 499) obj)) - (go (method-of-object obj startup)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 498) this)) + (set! (-> this draining-part) (create-launch-control (-> *part-group-id-table* 499) this)) + (go (method-of-object this startup)) (none) ) @@ -1176,16 +1174,16 @@ This commonly includes things such as: ) ;; definition for method 3 of type water-anim-under -(defmethod inspect water-anim-under ((obj water-anim-under)) - (when (not obj) - (set! obj obj) +(defmethod inspect water-anim-under ((this water-anim-under)) + (when (not this) + (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type water-anim inspect))) - (t9-0 obj) + (t9-0 this) ) (label cfg-4) - obj + this ) ;; definition for symbol ripple-for-water-anim-under, type ripple-wave-set @@ -1204,14 +1202,14 @@ This commonly includes things such as: ;; definition for method 24 of type water-anim-under ;; WARN: Return type mismatch int vs none. -(defmethod init-water! water-anim-under ((obj water-anim-under)) +(defmethod init-water! water-anim-under ((this water-anim-under)) "Initialize a [[water-anim]]'s default settings, this may include applying a [[riple-control]]" (let ((t9-0 (method-of-type water-anim init-water!))) - (t9-0 obj) + (t9-0 this) ) (let ((v1-2 (new 'process 'ripple-control))) - (set! (-> obj draw ripple) v1-2) - (set-vector! (-> obj draw color-mult) 0.01 0.45 0.5 0.75) + (set! (-> this draw ripple) v1-2) + (set-vector! (-> this draw color-mult) 0.01 0.45 0.5 0.75) (set! (-> v1-2 global-scale) 3072.0) (set! (-> v1-2 close-fade-dist) 163840.0) (set! (-> v1-2 far-fade-dist) 245760.0) diff --git a/test/decompiler/test_FormExpressionBuild2.cpp b/test/decompiler/test_FormExpressionBuild2.cpp index 243a0019d9..8c9a55c240 100644 --- a/test/decompiler/test_FormExpressionBuild2.cpp +++ b/test/decompiler/test_FormExpressionBuild2.cpp @@ -202,7 +202,7 @@ TEST_F(FormRegressionTestJak1, EliminateFloatDeadSet) { " (f0-1 0.0)\n" " (f2-2\n" " (+\n" - " (the float (mod (the-as uint (-> *display* base-frame-counter)) v1-0))\n" + " (the float (mod (the-as uint (current-time)) v1-0))\n" " (-> arg0 offset)\n" " )\n" " )\n"